@grackle-ai/web 0.38.2 → 0.39.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,91 +0,0 @@
1
- import{r as Q_,a as S,j as h,v as J_,b as W_,t as _r,i as ex,f as tx,M as Ef,c as Cf}from"./markdown-gcy1Jmzi.js";import{r as nx,d as fy,H as hy,P as py,i as ax,B as sx,a as ix,C as lx,M as ox}from"./dagview-EHk2VaeR.js";(function(){const a=document.createElement("link").relList;if(a&&a.supports&&a.supports("modulepreload"))return;for(const r of document.querySelectorAll('link[rel="modulepreload"]'))o(r);new MutationObserver(r=>{for(const u of r)if(u.type==="childList")for(const d of u.addedNodes)d.tagName==="LINK"&&d.rel==="modulepreload"&&o(d)}).observe(document,{childList:!0,subtree:!0});function i(r){const u={};return r.integrity&&(u.integrity=r.integrity),r.referrerPolicy&&(u.referrerPolicy=r.referrerPolicy),r.crossOrigin==="use-credentials"?u.credentials="include":r.crossOrigin==="anonymous"?u.credentials="omit":u.credentials="same-origin",u}function o(r){if(r.ep)return;r.ep=!0;const u=i(r);fetch(r.href,u)}})();var bd={exports:{}},Ml={},Sd={exports:{}},_d={};/**
2
- * @license React
3
- * scheduler.production.js
4
- *
5
- * Copyright (c) Meta Platforms, Inc. and affiliates.
6
- *
7
- * This source code is licensed under the MIT license found in the
8
- * LICENSE file in the root directory of this source tree.
9
- */var my;function rx(){return my||(my=1,(function(n){function a(U,Q){var te=U.length;U.push(Q);e:for(;0<te;){var we=te-1>>>1,_e=U[we];if(0<r(_e,Q))U[we]=Q,U[te]=_e,te=we;else break e}}function i(U){return U.length===0?null:U[0]}function o(U){if(U.length===0)return null;var Q=U[0],te=U.pop();if(te!==Q){U[0]=te;e:for(var we=0,_e=U.length,Ue=_e>>>1;we<Ue;){var Ee=2*(we+1)-1,ye=U[Ee],xe=Ee+1,W=U[xe];if(0>r(ye,te))xe<_e&&0>r(W,ye)?(U[we]=W,U[xe]=te,we=xe):(U[we]=ye,U[Ee]=te,we=Ee);else if(xe<_e&&0>r(W,te))U[we]=W,U[xe]=te,we=xe;else break e}}return Q}function r(U,Q){var te=U.sortIndex-Q.sortIndex;return te!==0?te:U.id-Q.id}if(n.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var u=performance;n.unstable_now=function(){return u.now()}}else{var d=Date,p=d.now();n.unstable_now=function(){return d.now()-p}}var m=[],g=[],y=1,v=null,_=3,T=!1,C=!1,E=!1,j=!1,A=typeof setTimeout=="function"?setTimeout:null,k=typeof clearTimeout=="function"?clearTimeout:null,R=typeof setImmediate<"u"?setImmediate:null;function $(U){for(var Q=i(g);Q!==null;){if(Q.callback===null)o(g);else if(Q.startTime<=U)o(g),Q.sortIndex=Q.expirationTime,a(m,Q);else break;Q=i(g)}}function H(U){if(E=!1,$(U),!C)if(i(m)!==null)C=!0,V||(V=!0,se());else{var Q=i(g);Q!==null&&G(H,Q.startTime-U)}}var V=!1,q=-1,O=5,ee=-1;function ae(){return j?!0:!(n.unstable_now()-ee<O)}function I(){if(j=!1,V){var U=n.unstable_now();ee=U;var Q=!0;try{e:{C=!1,E&&(E=!1,k(q),q=-1),T=!0;var te=_;try{t:{for($(U),v=i(m);v!==null&&!(v.expirationTime>U&&ae());){var we=v.callback;if(typeof we=="function"){v.callback=null,_=v.priorityLevel;var _e=we(v.expirationTime<=U);if(U=n.unstable_now(),typeof _e=="function"){v.callback=_e,$(U),Q=!0;break t}v===i(m)&&o(m),$(U)}else o(m);v=i(m)}if(v!==null)Q=!0;else{var Ue=i(g);Ue!==null&&G(H,Ue.startTime-U),Q=!1}}break e}finally{v=null,_=te,T=!1}Q=void 0}}finally{Q?se():V=!1}}}var se;if(typeof R=="function")se=function(){R(I)};else if(typeof MessageChannel<"u"){var Y=new MessageChannel,fe=Y.port2;Y.port1.onmessage=I,se=function(){fe.postMessage(null)}}else se=function(){A(I,0)};function G(U,Q){q=A(function(){U(n.unstable_now())},Q)}n.unstable_IdlePriority=5,n.unstable_ImmediatePriority=1,n.unstable_LowPriority=4,n.unstable_NormalPriority=3,n.unstable_Profiling=null,n.unstable_UserBlockingPriority=2,n.unstable_cancelCallback=function(U){U.callback=null},n.unstable_forceFrameRate=function(U){0>U||125<U?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):O=0<U?Math.floor(1e3/U):5},n.unstable_getCurrentPriorityLevel=function(){return _},n.unstable_next=function(U){switch(_){case 1:case 2:case 3:var Q=3;break;default:Q=_}var te=_;_=Q;try{return U()}finally{_=te}},n.unstable_requestPaint=function(){j=!0},n.unstable_runWithPriority=function(U,Q){switch(U){case 1:case 2:case 3:case 4:case 5:break;default:U=3}var te=_;_=U;try{return Q()}finally{_=te}},n.unstable_scheduleCallback=function(U,Q,te){var we=n.unstable_now();switch(typeof te=="object"&&te!==null?(te=te.delay,te=typeof te=="number"&&0<te?we+te:we):te=we,U){case 1:var _e=-1;break;case 2:_e=250;break;case 5:_e=1073741823;break;case 4:_e=1e4;break;default:_e=5e3}return _e=te+_e,U={id:y++,callback:Q,priorityLevel:U,startTime:te,expirationTime:_e,sortIndex:-1},te>we?(U.sortIndex=te,a(g,U),i(m)===null&&U===i(g)&&(E?(k(q),q=-1):E=!0,G(H,te-we))):(U.sortIndex=_e,a(m,U),C||T||(C=!0,V||(V=!0,se()))),U},n.unstable_shouldYield=ae,n.unstable_wrapCallback=function(U){var Q=_;return function(){var te=_;_=Q;try{return U.apply(this,arguments)}finally{_=te}}}})(_d)),_d}var gy;function cx(){return gy||(gy=1,Sd.exports=rx()),Sd.exports}/**
10
- * @license React
11
- * react-dom-client.production.js
12
- *
13
- * Copyright (c) Meta Platforms, Inc. and affiliates.
14
- *
15
- * This source code is licensed under the MIT license found in the
16
- * LICENSE file in the root directory of this source tree.
17
- */var yy;function ux(){if(yy)return Ml;yy=1;var n=cx(),a=Q_(),i=nx();function o(e){var t="https://react.dev/errors/"+e;if(1<arguments.length){t+="?args[]="+encodeURIComponent(arguments[1]);for(var s=2;s<arguments.length;s++)t+="&args[]="+encodeURIComponent(arguments[s])}return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function r(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function u(e){var t=e,s=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,(t.flags&4098)!==0&&(s=t.return),e=t.return;while(e)}return t.tag===3?s:null}function d(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 p(e){if(e.tag===31){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function m(e){if(u(e)!==e)throw Error(o(188))}function g(e){var t=e.alternate;if(!t){if(t=u(e),t===null)throw Error(o(188));return t!==e?null:e}for(var s=e,l=t;;){var c=s.return;if(c===null)break;var f=c.alternate;if(f===null){if(l=c.return,l!==null){s=l;continue}break}if(c.child===f.child){for(f=c.child;f;){if(f===s)return m(c),e;if(f===l)return m(c),t;f=f.sibling}throw Error(o(188))}if(s.return!==l.return)s=c,l=f;else{for(var b=!1,x=c.child;x;){if(x===s){b=!0,s=c,l=f;break}if(x===l){b=!0,l=c,s=f;break}x=x.sibling}if(!b){for(x=f.child;x;){if(x===s){b=!0,s=f,l=c;break}if(x===l){b=!0,l=f,s=c;break}x=x.sibling}if(!b)throw Error(o(189))}}if(s.alternate!==l)throw Error(o(190))}if(s.tag!==3)throw Error(o(188));return s.stateNode.current===s?e:t}function y(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=y(e),t!==null)return t;e=e.sibling}return null}var v=Object.assign,_=Symbol.for("react.element"),T=Symbol.for("react.transitional.element"),C=Symbol.for("react.portal"),E=Symbol.for("react.fragment"),j=Symbol.for("react.strict_mode"),A=Symbol.for("react.profiler"),k=Symbol.for("react.consumer"),R=Symbol.for("react.context"),$=Symbol.for("react.forward_ref"),H=Symbol.for("react.suspense"),V=Symbol.for("react.suspense_list"),q=Symbol.for("react.memo"),O=Symbol.for("react.lazy"),ee=Symbol.for("react.activity"),ae=Symbol.for("react.memo_cache_sentinel"),I=Symbol.iterator;function se(e){return e===null||typeof e!="object"?null:(e=I&&e[I]||e["@@iterator"],typeof e=="function"?e:null)}var Y=Symbol.for("react.client.reference");function fe(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===Y?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case E:return"Fragment";case A:return"Profiler";case j:return"StrictMode";case H:return"Suspense";case V:return"SuspenseList";case ee:return"Activity"}if(typeof e=="object")switch(e.$$typeof){case C:return"Portal";case R:return e.displayName||"Context";case k:return(e._context.displayName||"Context")+".Consumer";case $:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case q:return t=e.displayName||null,t!==null?t:fe(e.type)||"Memo";case O:t=e._payload,e=e._init;try{return fe(e(t))}catch{}}return null}var G=Array.isArray,U=a.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Q=i.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,te={pending:!1,data:null,method:null,action:null},we=[],_e=-1;function Ue(e){return{current:e}}function Ee(e){0>_e||(e.current=we[_e],we[_e]=null,_e--)}function ye(e,t){_e++,we[_e]=e.current,e.current=t}var xe=Ue(null),W=Ue(null),K=Ue(null),me=Ue(null);function Ae(e,t){switch(ye(K,t),ye(W,e),ye(xe,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?Bg(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=Bg(t),e=Lg(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}Ee(xe),ye(xe,e)}function Ve(){Ee(xe),Ee(W),Ee(K)}function mt(e){e.memoizedState!==null&&ye(me,e);var t=xe.current,s=Lg(t,e.type);t!==s&&(ye(W,e),ye(xe,s))}function Tt(e){W.current===e&&(Ee(xe),Ee(W)),me.current===e&&(Ee(me),Nl._currentValue=te)}var Bt,Xe;function qe(e){if(Bt===void 0)try{throw Error()}catch(s){var t=s.stack.trim().match(/\n( *(at )?)/);Bt=t&&t[1]||"",Xe=-1<s.stack.indexOf(`
18
- at`)?" (<anonymous>)":-1<s.stack.indexOf("@")?"@unknown:0:0":""}return`
19
- `+Bt+e+Xe}var Be=!1;function Ln(e,t){if(!e||Be)return"";Be=!0;var s=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var l={DetermineComponentFrameRoot:function(){try{if(t){var X=function(){throw Error()};if(Object.defineProperty(X.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(X,[])}catch(P){var z=P}Reflect.construct(e,[],X)}else{try{X.call()}catch(P){z=P}e.call(X.prototype)}}else{try{throw Error()}catch(P){z=P}(X=e())&&typeof X.catch=="function"&&X.catch(function(){})}}catch(P){if(P&&z&&typeof P.stack=="string")return[P.stack,z.stack]}return[null,null]}};l.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var c=Object.getOwnPropertyDescriptor(l.DetermineComponentFrameRoot,"name");c&&c.configurable&&Object.defineProperty(l.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var f=l.DetermineComponentFrameRoot(),b=f[0],x=f[1];if(b&&x){var N=b.split(`
20
- `),L=x.split(`
21
- `);for(c=l=0;l<N.length&&!N[l].includes("DetermineComponentFrameRoot");)l++;for(;c<L.length&&!L[c].includes("DetermineComponentFrameRoot");)c++;if(l===N.length||c===L.length)for(l=N.length-1,c=L.length-1;1<=l&&0<=c&&N[l]!==L[c];)c--;for(;1<=l&&0<=c;l--,c--)if(N[l]!==L[c]){if(l!==1||c!==1)do if(l--,c--,0>c||N[l]!==L[c]){var F=`
22
- `+N[l].replace(" at new "," at ");return e.displayName&&F.includes("<anonymous>")&&(F=F.replace("<anonymous>",e.displayName)),F}while(1<=l&&0<=c);break}}}finally{Be=!1,Error.prepareStackTrace=s}return(s=e?e.displayName||e.name:"")?qe(s):""}function Un(e,t){switch(e.tag){case 26:case 27:case 5:return qe(e.type);case 16:return qe("Lazy");case 13:return e.child!==t&&t!==null?qe("Suspense Fallback"):qe("Suspense");case 19:return qe("SuspenseList");case 0:case 15:return Ln(e.type,!1);case 11:return Ln(e.type.render,!1);case 1:return Ln(e.type,!0);case 31:return qe("Activity");default:return""}}function ea(e){try{var t="",s=null;do t+=Un(e,s),s=e,e=e.return;while(e);return t}catch(l){return`
23
- Error generating stack: `+l.message+`
24
- `+l.stack}}var en=Object.prototype.hasOwnProperty,ta=n.unstable_scheduleCallback,J=n.unstable_cancelCallback,ne=n.unstable_shouldYield,oe=n.unstable_requestPaint,ue=n.unstable_now,be=n.unstable_getCurrentPriorityLevel,Te=n.unstable_ImmediatePriority,Qe=n.unstable_UserBlockingPriority,De=n.unstable_NormalPriority,Mt=n.unstable_LowPriority,wt=n.unstable_IdlePriority,it=n.log,tn=n.unstable_setDisableYieldValue,rt=null,We=null;function Zt(e){if(typeof it=="function"&&tn(e),We&&typeof We.setStrictMode=="function")try{We.setStrictMode(rt,e)}catch{}}var gt=Math.clz32?Math.clz32:Hi,qt=Math.log,Ft=Math.LN2;function Hi(e){return e>>>=0,e===0?32:31-(qt(e)/Ft|0)|0}var na=256,us=262144,et=4194304;function je(e){var t=e&42;if(t!==0)return t;switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return e&261888;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function yt(e,t,s){var l=e.pendingLanes;if(l===0)return 0;var c=0,f=e.suspendedLanes,b=e.pingedLanes;e=e.warmLanes;var x=l&134217727;return x!==0?(l=x&~f,l!==0?c=je(l):(b&=x,b!==0?c=je(b):s||(s=x&~e,s!==0&&(c=je(s))))):(x=l&~f,x!==0?c=je(x):b!==0?c=je(b):s||(s=l&~e,s!==0&&(c=je(s)))),c===0?0:t!==0&&t!==c&&(t&f)===0&&(f=c&-c,s=t&-t,f>=s||f===32&&(s&4194048)!==0)?t:c}function ie(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function Lt(e,t){switch(e){case 1:case 2:case 4:case 8:case 64:return t+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function aa(){var e=et;return et<<=1,(et&62914560)===0&&(et=4194304),e}function oc(e){for(var t=[],s=0;31>s;s++)t.push(e);return t}function Pi(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function I1(e,t,s,l,c,f){var b=e.pendingLanes;e.pendingLanes=s,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=s,e.entangledLanes&=s,e.errorRecoveryDisabledLanes&=s,e.shellSuspendCounter=0;var x=e.entanglements,N=e.expirationTimes,L=e.hiddenUpdates;for(s=b&~s;0<s;){var F=31-gt(s),X=1<<F;x[F]=0,N[F]=-1;var z=L[F];if(z!==null)for(L[F]=null,F=0;F<z.length;F++){var P=z[F];P!==null&&(P.lane&=-536870913)}s&=~X}l!==0&&yh(e,l,0),f!==0&&c===0&&e.tag!==0&&(e.suspendedLanes|=f&~(b&~t))}function yh(e,t,s){e.pendingLanes|=t,e.suspendedLanes&=~t;var l=31-gt(t);e.entangledLanes|=t,e.entanglements[l]=e.entanglements[l]|1073741824|s&261930}function vh(e,t){var s=e.entangledLanes|=t;for(e=e.entanglements;s;){var l=31-gt(s),c=1<<l;c&t|e[l]&t&&(e[l]|=t),s&=~c}}function bh(e,t){var s=t&-t;return s=(s&42)!==0?1:rc(s),(s&(e.suspendedLanes|t))!==0?0:s}function rc(e){switch(e){case 2:e=1;break;case 8:e=4;break;case 32:e=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:e=128;break;case 268435456:e=134217728;break;default:e=0}return e}function cc(e){return e&=-e,2<e?8<e?(e&134217727)!==0?32:268435456:8:2}function Sh(){var e=Q.p;return e!==0?e:(e=window.event,e===void 0?32:iy(e.type))}function _h(e,t){var s=Q.p;try{return Q.p=e,t()}finally{Q.p=s}}var wa=Math.random().toString(36).slice(2),Ut="__reactFiber$"+wa,nn="__reactProps$"+wa,Is="__reactContainer$"+wa,uc="__reactEvents$"+wa,V1="__reactListeners$"+wa,H1="__reactHandles$"+wa,xh="__reactResources$"+wa,Gi="__reactMarker$"+wa;function dc(e){delete e[Ut],delete e[nn],delete e[uc],delete e[V1],delete e[H1]}function Vs(e){var t=e[Ut];if(t)return t;for(var s=e.parentNode;s;){if(t=s[Is]||s[Ut]){if(s=t.alternate,t.child!==null||s!==null&&s.child!==null)for(e=Gg(e);e!==null;){if(s=e[Ut])return s;e=Gg(e)}return t}e=s,s=e.parentNode}return null}function Hs(e){if(e=e[Ut]||e[Is]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function qi(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(o(33))}function Ps(e){var t=e[xh];return t||(t=e[xh]={hoistableStyles:new Map,hoistableScripts:new Map}),t}function Rt(e){e[Gi]=!0}var Th=new Set,Eh={};function ds(e,t){Gs(e,t),Gs(e+"Capture",t)}function Gs(e,t){for(Eh[e]=t,e=0;e<t.length;e++)Th.add(t[e])}var P1=RegExp("^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$"),Ch={},Ah={};function G1(e){return en.call(Ah,e)?!0:en.call(Ch,e)?!1:P1.test(e)?Ah[e]=!0:(Ch[e]=!0,!1)}function ro(e,t,s){if(G1(t))if(s===null)e.removeAttribute(t);else{switch(typeof s){case"undefined":case"function":case"symbol":e.removeAttribute(t);return;case"boolean":var l=t.toLowerCase().slice(0,5);if(l!=="data-"&&l!=="aria-"){e.removeAttribute(t);return}}e.setAttribute(t,""+s)}}function co(e,t,s){if(s===null)e.removeAttribute(t);else{switch(typeof s){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(t);return}e.setAttribute(t,""+s)}}function sa(e,t,s,l){if(l===null)e.removeAttribute(s);else{switch(typeof l){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(s);return}e.setAttributeNS(t,s,""+l)}}function _n(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function jh(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function q1(e,t,s){var l=Object.getOwnPropertyDescriptor(e.constructor.prototype,t);if(!e.hasOwnProperty(t)&&typeof l<"u"&&typeof l.get=="function"&&typeof l.set=="function"){var c=l.get,f=l.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return c.call(this)},set:function(b){s=""+b,f.call(this,b)}}),Object.defineProperty(e,t,{enumerable:l.enumerable}),{getValue:function(){return s},setValue:function(b){s=""+b},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function fc(e){if(!e._valueTracker){var t=jh(e)?"checked":"value";e._valueTracker=q1(e,t,""+e[t])}}function Nh(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var s=t.getValue(),l="";return e&&(l=jh(e)?e.checked?"true":"false":e.value),e=l,e!==s?(t.setValue(e),!0):!1}function uo(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}}var F1=/[\n"\\]/g;function xn(e){return e.replace(F1,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function hc(e,t,s,l,c,f,b,x){e.name="",b!=null&&typeof b!="function"&&typeof b!="symbol"&&typeof b!="boolean"?e.type=b:e.removeAttribute("type"),t!=null?b==="number"?(t===0&&e.value===""||e.value!=t)&&(e.value=""+_n(t)):e.value!==""+_n(t)&&(e.value=""+_n(t)):b!=="submit"&&b!=="reset"||e.removeAttribute("value"),t!=null?pc(e,b,_n(t)):s!=null?pc(e,b,_n(s)):l!=null&&e.removeAttribute("value"),c==null&&f!=null&&(e.defaultChecked=!!f),c!=null&&(e.checked=c&&typeof c!="function"&&typeof c!="symbol"),x!=null&&typeof x!="function"&&typeof x!="symbol"&&typeof x!="boolean"?e.name=""+_n(x):e.removeAttribute("name")}function wh(e,t,s,l,c,f,b,x){if(f!=null&&typeof f!="function"&&typeof f!="symbol"&&typeof f!="boolean"&&(e.type=f),t!=null||s!=null){if(!(f!=="submit"&&f!=="reset"||t!=null)){fc(e);return}s=s!=null?""+_n(s):"",t=t!=null?""+_n(t):s,x||t===e.value||(e.value=t),e.defaultValue=t}l=l??c,l=typeof l!="function"&&typeof l!="symbol"&&!!l,e.checked=x?e.checked:!!l,e.defaultChecked=!!l,b!=null&&typeof b!="function"&&typeof b!="symbol"&&typeof b!="boolean"&&(e.name=b),fc(e)}function pc(e,t,s){t==="number"&&uo(e.ownerDocument)===e||e.defaultValue===""+s||(e.defaultValue=""+s)}function qs(e,t,s,l){if(e=e.options,t){t={};for(var c=0;c<s.length;c++)t["$"+s[c]]=!0;for(s=0;s<e.length;s++)c=t.hasOwnProperty("$"+e[s].value),e[s].selected!==c&&(e[s].selected=c),c&&l&&(e[s].defaultSelected=!0)}else{for(s=""+_n(s),t=null,c=0;c<e.length;c++){if(e[c].value===s){e[c].selected=!0,l&&(e[c].defaultSelected=!0);return}t!==null||e[c].disabled||(t=e[c])}t!==null&&(t.selected=!0)}}function Dh(e,t,s){if(t!=null&&(t=""+_n(t),t!==e.value&&(e.value=t),s==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=s!=null?""+_n(s):""}function kh(e,t,s,l){if(t==null){if(l!=null){if(s!=null)throw Error(o(92));if(G(l)){if(1<l.length)throw Error(o(93));l=l[0]}s=l}s==null&&(s=""),t=s}s=_n(t),e.defaultValue=s,l=e.textContent,l===s&&l!==""&&l!==null&&(e.value=l),fc(e)}function Fs(e,t){if(t){var s=e.firstChild;if(s&&s===e.lastChild&&s.nodeType===3){s.nodeValue=t;return}}e.textContent=t}var $1=new Set("animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp".split(" "));function Mh(e,t,s){var l=t.indexOf("--")===0;s==null||typeof s=="boolean"||s===""?l?e.setProperty(t,""):t==="float"?e.cssFloat="":e[t]="":l?e.setProperty(t,s):typeof s!="number"||s===0||$1.has(t)?t==="float"?e.cssFloat=s:e[t]=(""+s).trim():e[t]=s+"px"}function Rh(e,t,s){if(t!=null&&typeof t!="object")throw Error(o(62));if(e=e.style,s!=null){for(var l in s)!s.hasOwnProperty(l)||t!=null&&t.hasOwnProperty(l)||(l.indexOf("--")===0?e.setProperty(l,""):l==="float"?e.cssFloat="":e[l]="");for(var c in t)l=t[c],t.hasOwnProperty(c)&&s[c]!==l&&Mh(e,c,l)}else for(var f in t)t.hasOwnProperty(f)&&Mh(e,f,t[f])}function mc(e){if(e.indexOf("-")===-1)return!1;switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var Y1=new Map([["acceptCharset","accept-charset"],["htmlFor","for"],["httpEquiv","http-equiv"],["crossOrigin","crossorigin"],["accentHeight","accent-height"],["alignmentBaseline","alignment-baseline"],["arabicForm","arabic-form"],["baselineShift","baseline-shift"],["capHeight","cap-height"],["clipPath","clip-path"],["clipRule","clip-rule"],["colorInterpolation","color-interpolation"],["colorInterpolationFilters","color-interpolation-filters"],["colorProfile","color-profile"],["colorRendering","color-rendering"],["dominantBaseline","dominant-baseline"],["enableBackground","enable-background"],["fillOpacity","fill-opacity"],["fillRule","fill-rule"],["floodColor","flood-color"],["floodOpacity","flood-opacity"],["fontFamily","font-family"],["fontSize","font-size"],["fontSizeAdjust","font-size-adjust"],["fontStretch","font-stretch"],["fontStyle","font-style"],["fontVariant","font-variant"],["fontWeight","font-weight"],["glyphName","glyph-name"],["glyphOrientationHorizontal","glyph-orientation-horizontal"],["glyphOrientationVertical","glyph-orientation-vertical"],["horizAdvX","horiz-adv-x"],["horizOriginX","horiz-origin-x"],["imageRendering","image-rendering"],["letterSpacing","letter-spacing"],["lightingColor","lighting-color"],["markerEnd","marker-end"],["markerMid","marker-mid"],["markerStart","marker-start"],["overlinePosition","overline-position"],["overlineThickness","overline-thickness"],["paintOrder","paint-order"],["panose-1","panose-1"],["pointerEvents","pointer-events"],["renderingIntent","rendering-intent"],["shapeRendering","shape-rendering"],["stopColor","stop-color"],["stopOpacity","stop-opacity"],["strikethroughPosition","strikethrough-position"],["strikethroughThickness","strikethrough-thickness"],["strokeDasharray","stroke-dasharray"],["strokeDashoffset","stroke-dashoffset"],["strokeLinecap","stroke-linecap"],["strokeLinejoin","stroke-linejoin"],["strokeMiterlimit","stroke-miterlimit"],["strokeOpacity","stroke-opacity"],["strokeWidth","stroke-width"],["textAnchor","text-anchor"],["textDecoration","text-decoration"],["textRendering","text-rendering"],["transformOrigin","transform-origin"],["underlinePosition","underline-position"],["underlineThickness","underline-thickness"],["unicodeBidi","unicode-bidi"],["unicodeRange","unicode-range"],["unitsPerEm","units-per-em"],["vAlphabetic","v-alphabetic"],["vHanging","v-hanging"],["vIdeographic","v-ideographic"],["vMathematical","v-mathematical"],["vectorEffect","vector-effect"],["vertAdvY","vert-adv-y"],["vertOriginX","vert-origin-x"],["vertOriginY","vert-origin-y"],["wordSpacing","word-spacing"],["writingMode","writing-mode"],["xmlnsXlink","xmlns:xlink"],["xHeight","x-height"]]),K1=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function fo(e){return K1.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function ia(){}var gc=null;function yc(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var $s=null,Ys=null;function Oh(e){var t=Hs(e);if(t&&(e=t.stateNode)){var s=e[nn]||null;e:switch(e=t.stateNode,t.type){case"input":if(hc(e,s.value,s.defaultValue,s.defaultValue,s.checked,s.defaultChecked,s.type,s.name),t=s.name,s.type==="radio"&&t!=null){for(s=e;s.parentNode;)s=s.parentNode;for(s=s.querySelectorAll('input[name="'+xn(""+t)+'"][type="radio"]'),t=0;t<s.length;t++){var l=s[t];if(l!==e&&l.form===e.form){var c=l[nn]||null;if(!c)throw Error(o(90));hc(l,c.value,c.defaultValue,c.defaultValue,c.checked,c.defaultChecked,c.type,c.name)}}for(t=0;t<s.length;t++)l=s[t],l.form===e.form&&Nh(l)}break e;case"textarea":Dh(e,s.value,s.defaultValue);break e;case"select":t=s.value,t!=null&&qs(e,!!s.multiple,t,!1)}}}var vc=!1;function Bh(e,t,s){if(vc)return e(t,s);vc=!0;try{var l=e(t);return l}finally{if(vc=!1,($s!==null||Ys!==null)&&(Wo(),$s&&(t=$s,e=Ys,Ys=$s=null,Oh(t),e)))for(t=0;t<e.length;t++)Oh(e[t])}}function Fi(e,t){var s=e.stateNode;if(s===null)return null;var l=s[nn]||null;if(l===null)return null;s=l[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":(l=!l.disabled)||(e=e.type,l=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!l;break e;default:e=!1}if(e)return null;if(s&&typeof s!="function")throw Error(o(231,t,typeof s));return s}var la=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),bc=!1;if(la)try{var $i={};Object.defineProperty($i,"passive",{get:function(){bc=!0}}),window.addEventListener("test",$i,$i),window.removeEventListener("test",$i,$i)}catch{bc=!1}var Da=null,Sc=null,ho=null;function Lh(){if(ho)return ho;var e,t=Sc,s=t.length,l,c="value"in Da?Da.value:Da.textContent,f=c.length;for(e=0;e<s&&t[e]===c[e];e++);var b=s-e;for(l=1;l<=b&&t[s-l]===c[f-l];l++);return ho=c.slice(e,1<l?1-l:void 0)}function po(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 mo(){return!0}function Uh(){return!1}function an(e){function t(s,l,c,f,b){this._reactName=s,this._targetInst=c,this.type=l,this.nativeEvent=f,this.target=b,this.currentTarget=null;for(var x in e)e.hasOwnProperty(x)&&(s=e[x],this[x]=s?s(f):f[x]);return this.isDefaultPrevented=(f.defaultPrevented!=null?f.defaultPrevented:f.returnValue===!1)?mo:Uh,this.isPropagationStopped=Uh,this}return v(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var s=this.nativeEvent;s&&(s.preventDefault?s.preventDefault():typeof s.returnValue!="unknown"&&(s.returnValue=!1),this.isDefaultPrevented=mo)},stopPropagation:function(){var s=this.nativeEvent;s&&(s.stopPropagation?s.stopPropagation():typeof s.cancelBubble!="unknown"&&(s.cancelBubble=!0),this.isPropagationStopped=mo)},persist:function(){},isPersistent:mo}),t}var fs={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},go=an(fs),Yi=v({},fs,{view:0,detail:0}),Z1=an(Yi),_c,xc,Ki,yo=v({},Yi,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Ec,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!==Ki&&(Ki&&e.type==="mousemove"?(_c=e.screenX-Ki.screenX,xc=e.screenY-Ki.screenY):xc=_c=0,Ki=e),_c)},movementY:function(e){return"movementY"in e?e.movementY:xc}}),zh=an(yo),X1=v({},yo,{dataTransfer:0}),Q1=an(X1),J1=v({},Yi,{relatedTarget:0}),Tc=an(J1),W1=v({},fs,{animationName:0,elapsedTime:0,pseudoElement:0}),eS=an(W1),tS=v({},fs,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),nS=an(tS),aS=v({},fs,{data:0}),Ih=an(aS),sS={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},iS={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"},lS={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function oS(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=lS[e])?!!t[e]:!1}function Ec(){return oS}var rS=v({},Yi,{key:function(e){if(e.key){var t=sS[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=po(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?iS[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Ec,charCode:function(e){return e.type==="keypress"?po(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?po(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),cS=an(rS),uS=v({},yo,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Vh=an(uS),dS=v({},Yi,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Ec}),fS=an(dS),hS=v({},fs,{propertyName:0,elapsedTime:0,pseudoElement:0}),pS=an(hS),mS=v({},yo,{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}),gS=an(mS),yS=v({},fs,{newState:0,oldState:0}),vS=an(yS),bS=[9,13,27,32],Cc=la&&"CompositionEvent"in window,Zi=null;la&&"documentMode"in document&&(Zi=document.documentMode);var SS=la&&"TextEvent"in window&&!Zi,Hh=la&&(!Cc||Zi&&8<Zi&&11>=Zi),Ph=" ",Gh=!1;function qh(e,t){switch(e){case"keyup":return bS.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Fh(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Ks=!1;function _S(e,t){switch(e){case"compositionend":return Fh(t);case"keypress":return t.which!==32?null:(Gh=!0,Ph);case"textInput":return e=t.data,e===Ph&&Gh?null:e;default:return null}}function xS(e,t){if(Ks)return e==="compositionend"||!Cc&&qh(e,t)?(e=Lh(),ho=Sc=Da=null,Ks=!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 Hh&&t.locale!=="ko"?null:t.data;default:return null}}var TS={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 $h(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!TS[e.type]:t==="textarea"}function Yh(e,t,s,l){$s?Ys?Ys.push(l):Ys=[l]:$s=l,t=lr(t,"onChange"),0<t.length&&(s=new go("onChange","change",null,s,l),e.push({event:s,listeners:t}))}var Xi=null,Qi=null;function ES(e){wg(e,0)}function vo(e){var t=qi(e);if(Nh(t))return e}function Kh(e,t){if(e==="change")return t}var Zh=!1;if(la){var Ac;if(la){var jc="oninput"in document;if(!jc){var Xh=document.createElement("div");Xh.setAttribute("oninput","return;"),jc=typeof Xh.oninput=="function"}Ac=jc}else Ac=!1;Zh=Ac&&(!document.documentMode||9<document.documentMode)}function Qh(){Xi&&(Xi.detachEvent("onpropertychange",Jh),Qi=Xi=null)}function Jh(e){if(e.propertyName==="value"&&vo(Qi)){var t=[];Yh(t,Qi,e,yc(e)),Bh(ES,t)}}function CS(e,t,s){e==="focusin"?(Qh(),Xi=t,Qi=s,Xi.attachEvent("onpropertychange",Jh)):e==="focusout"&&Qh()}function AS(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return vo(Qi)}function jS(e,t){if(e==="click")return vo(t)}function NS(e,t){if(e==="input"||e==="change")return vo(t)}function wS(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var un=typeof Object.is=="function"?Object.is:wS;function Ji(e,t){if(un(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var s=Object.keys(e),l=Object.keys(t);if(s.length!==l.length)return!1;for(l=0;l<s.length;l++){var c=s[l];if(!en.call(t,c)||!un(e[c],t[c]))return!1}return!0}function Wh(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function ep(e,t){var s=Wh(e);e=0;for(var l;s;){if(s.nodeType===3){if(l=e+s.textContent.length,e<=t&&l>=t)return{node:s,offset:t-e};e=l}e:{for(;s;){if(s.nextSibling){s=s.nextSibling;break e}s=s.parentNode}s=void 0}s=Wh(s)}}function tp(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?tp(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function np(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=uo(e.document);t instanceof e.HTMLIFrameElement;){try{var s=typeof t.contentWindow.location.href=="string"}catch{s=!1}if(s)e=t.contentWindow;else break;t=uo(e.document)}return t}function Nc(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}var DS=la&&"documentMode"in document&&11>=document.documentMode,Zs=null,wc=null,Wi=null,Dc=!1;function ap(e,t,s){var l=s.window===s?s.document:s.nodeType===9?s:s.ownerDocument;Dc||Zs==null||Zs!==uo(l)||(l=Zs,"selectionStart"in l&&Nc(l)?l={start:l.selectionStart,end:l.selectionEnd}:(l=(l.ownerDocument&&l.ownerDocument.defaultView||window).getSelection(),l={anchorNode:l.anchorNode,anchorOffset:l.anchorOffset,focusNode:l.focusNode,focusOffset:l.focusOffset}),Wi&&Ji(Wi,l)||(Wi=l,l=lr(wc,"onSelect"),0<l.length&&(t=new go("onSelect","select",null,t,s),e.push({event:t,listeners:l}),t.target=Zs)))}function hs(e,t){var s={};return s[e.toLowerCase()]=t.toLowerCase(),s["Webkit"+e]="webkit"+t,s["Moz"+e]="moz"+t,s}var Xs={animationend:hs("Animation","AnimationEnd"),animationiteration:hs("Animation","AnimationIteration"),animationstart:hs("Animation","AnimationStart"),transitionrun:hs("Transition","TransitionRun"),transitionstart:hs("Transition","TransitionStart"),transitioncancel:hs("Transition","TransitionCancel"),transitionend:hs("Transition","TransitionEnd")},kc={},sp={};la&&(sp=document.createElement("div").style,"AnimationEvent"in window||(delete Xs.animationend.animation,delete Xs.animationiteration.animation,delete Xs.animationstart.animation),"TransitionEvent"in window||delete Xs.transitionend.transition);function ps(e){if(kc[e])return kc[e];if(!Xs[e])return e;var t=Xs[e],s;for(s in t)if(t.hasOwnProperty(s)&&s in sp)return kc[e]=t[s];return e}var ip=ps("animationend"),lp=ps("animationiteration"),op=ps("animationstart"),kS=ps("transitionrun"),MS=ps("transitionstart"),RS=ps("transitioncancel"),rp=ps("transitionend"),cp=new Map,Mc="abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");Mc.push("scrollEnd");function zn(e,t){cp.set(e,t),ds(t,[e])}var bo=typeof reportError=="function"?reportError:function(e){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var t=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof e=="object"&&e!==null&&typeof e.message=="string"?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",e);return}console.error(e)},Tn=[],Qs=0,Rc=0;function So(){for(var e=Qs,t=Rc=Qs=0;t<e;){var s=Tn[t];Tn[t++]=null;var l=Tn[t];Tn[t++]=null;var c=Tn[t];Tn[t++]=null;var f=Tn[t];if(Tn[t++]=null,l!==null&&c!==null){var b=l.pending;b===null?c.next=c:(c.next=b.next,b.next=c),l.pending=c}f!==0&&up(s,c,f)}}function _o(e,t,s,l){Tn[Qs++]=e,Tn[Qs++]=t,Tn[Qs++]=s,Tn[Qs++]=l,Rc|=l,e.lanes|=l,e=e.alternate,e!==null&&(e.lanes|=l)}function Oc(e,t,s,l){return _o(e,t,s,l),xo(e)}function ms(e,t){return _o(e,null,null,t),xo(e)}function up(e,t,s){e.lanes|=s;var l=e.alternate;l!==null&&(l.lanes|=s);for(var c=!1,f=e.return;f!==null;)f.childLanes|=s,l=f.alternate,l!==null&&(l.childLanes|=s),f.tag===22&&(e=f.stateNode,e===null||e._visibility&1||(c=!0)),e=f,f=f.return;return e.tag===3?(f=e.stateNode,c&&t!==null&&(c=31-gt(s),e=f.hiddenUpdates,l=e[c],l===null?e[c]=[t]:l.push(t),t.lane=s|536870912),f):null}function xo(e){if(50<_l)throw _l=0,Gu=null,Error(o(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var Js={};function OS(e,t,s,l){this.tag=e,this.key=s,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=l,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function dn(e,t,s,l){return new OS(e,t,s,l)}function Bc(e){return e=e.prototype,!(!e||!e.isReactComponent)}function oa(e,t){var s=e.alternate;return s===null?(s=dn(e.tag,t,e.key,e.mode),s.elementType=e.elementType,s.type=e.type,s.stateNode=e.stateNode,s.alternate=e,e.alternate=s):(s.pendingProps=t,s.type=e.type,s.flags=0,s.subtreeFlags=0,s.deletions=null),s.flags=e.flags&65011712,s.childLanes=e.childLanes,s.lanes=e.lanes,s.child=e.child,s.memoizedProps=e.memoizedProps,s.memoizedState=e.memoizedState,s.updateQueue=e.updateQueue,t=e.dependencies,s.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},s.sibling=e.sibling,s.index=e.index,s.ref=e.ref,s.refCleanup=e.refCleanup,s}function dp(e,t){e.flags&=65011714;var s=e.alternate;return s===null?(e.childLanes=0,e.lanes=t,e.child=null,e.subtreeFlags=0,e.memoizedProps=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.stateNode=null):(e.childLanes=s.childLanes,e.lanes=s.lanes,e.child=s.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=s.memoizedProps,e.memoizedState=s.memoizedState,e.updateQueue=s.updateQueue,e.type=s.type,t=s.dependencies,e.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function To(e,t,s,l,c,f){var b=0;if(l=e,typeof e=="function")Bc(e)&&(b=1);else if(typeof e=="string")b=I_(e,s,xe.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(e){case ee:return e=dn(31,s,t,c),e.elementType=ee,e.lanes=f,e;case E:return gs(s.children,c,f,t);case j:b=8,c|=24;break;case A:return e=dn(12,s,t,c|2),e.elementType=A,e.lanes=f,e;case H:return e=dn(13,s,t,c),e.elementType=H,e.lanes=f,e;case V:return e=dn(19,s,t,c),e.elementType=V,e.lanes=f,e;default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case R:b=10;break e;case k:b=9;break e;case $:b=11;break e;case q:b=14;break e;case O:b=16,l=null;break e}b=29,s=Error(o(130,e===null?"null":typeof e,"")),l=null}return t=dn(b,s,t,c),t.elementType=e,t.type=l,t.lanes=f,t}function gs(e,t,s,l){return e=dn(7,e,l,t),e.lanes=s,e}function Lc(e,t,s){return e=dn(6,e,null,t),e.lanes=s,e}function fp(e){var t=dn(18,null,null,0);return t.stateNode=e,t}function Uc(e,t,s){return t=dn(4,e.children!==null?e.children:[],e.key,t),t.lanes=s,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var hp=new WeakMap;function En(e,t){if(typeof e=="object"&&e!==null){var s=hp.get(e);return s!==void 0?s:(t={value:e,source:t,stack:ea(t)},hp.set(e,t),t)}return{value:e,source:t,stack:ea(t)}}var Ws=[],ei=0,Eo=null,el=0,Cn=[],An=0,ka=null,Gn=1,qn="";function ra(e,t){Ws[ei++]=el,Ws[ei++]=Eo,Eo=e,el=t}function pp(e,t,s){Cn[An++]=Gn,Cn[An++]=qn,Cn[An++]=ka,ka=e;var l=Gn;e=qn;var c=32-gt(l)-1;l&=~(1<<c),s+=1;var f=32-gt(t)+c;if(30<f){var b=c-c%5;f=(l&(1<<b)-1).toString(32),l>>=b,c-=b,Gn=1<<32-gt(t)+c|s<<c|l,qn=f+e}else Gn=1<<f|s<<c|l,qn=e}function zc(e){e.return!==null&&(ra(e,1),pp(e,1,0))}function Ic(e){for(;e===Eo;)Eo=Ws[--ei],Ws[ei]=null,el=Ws[--ei],Ws[ei]=null;for(;e===ka;)ka=Cn[--An],Cn[An]=null,qn=Cn[--An],Cn[An]=null,Gn=Cn[--An],Cn[An]=null}function mp(e,t){Cn[An++]=Gn,Cn[An++]=qn,Cn[An++]=ka,Gn=t.id,qn=t.overflow,ka=e}var zt=null,tt=null,Le=!1,Ma=null,jn=!1,Vc=Error(o(519));function Ra(e){var t=Error(o(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw tl(En(t,e)),Vc}function gp(e){var t=e.stateNode,s=e.type,l=e.memoizedProps;switch(t[Ut]=e,t[nn]=l,s){case"dialog":Me("cancel",t),Me("close",t);break;case"iframe":case"object":case"embed":Me("load",t);break;case"video":case"audio":for(s=0;s<Tl.length;s++)Me(Tl[s],t);break;case"source":Me("error",t);break;case"img":case"image":case"link":Me("error",t),Me("load",t);break;case"details":Me("toggle",t);break;case"input":Me("invalid",t),wh(t,l.value,l.defaultValue,l.checked,l.defaultChecked,l.type,l.name,!0);break;case"select":Me("invalid",t);break;case"textarea":Me("invalid",t),kh(t,l.value,l.defaultValue,l.children)}s=l.children,typeof s!="string"&&typeof s!="number"&&typeof s!="bigint"||t.textContent===""+s||l.suppressHydrationWarning===!0||Rg(t.textContent,s)?(l.popover!=null&&(Me("beforetoggle",t),Me("toggle",t)),l.onScroll!=null&&Me("scroll",t),l.onScrollEnd!=null&&Me("scrollend",t),l.onClick!=null&&(t.onclick=ia),t=!0):t=!1,t||Ra(e,!0)}function yp(e){for(zt=e.return;zt;)switch(zt.tag){case 5:case 31:case 13:jn=!1;return;case 27:case 3:jn=!0;return;default:zt=zt.return}}function ti(e){if(e!==zt)return!1;if(!Le)return yp(e),Le=!0,!1;var t=e.tag,s;if((s=t!==3&&t!==27)&&((s=t===5)&&(s=e.type,s=!(s!=="form"&&s!=="button")||sd(e.type,e.memoizedProps)),s=!s),s&&tt&&Ra(e),yp(e),t===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(o(317));tt=Pg(e)}else if(t===31){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(o(317));tt=Pg(e)}else t===27?(t=tt,Ya(e.type)?(e=cd,cd=null,tt=e):tt=t):tt=zt?wn(e.stateNode.nextSibling):null;return!0}function ys(){tt=zt=null,Le=!1}function Hc(){var e=Ma;return e!==null&&(rn===null?rn=e:rn.push.apply(rn,e),Ma=null),e}function tl(e){Ma===null?Ma=[e]:Ma.push(e)}var Pc=Ue(null),vs=null,ca=null;function Oa(e,t,s){ye(Pc,t._currentValue),t._currentValue=s}function ua(e){e._currentValue=Pc.current,Ee(Pc)}function Gc(e,t,s){for(;e!==null;){var l=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,l!==null&&(l.childLanes|=t)):l!==null&&(l.childLanes&t)!==t&&(l.childLanes|=t),e===s)break;e=e.return}}function qc(e,t,s,l){var c=e.child;for(c!==null&&(c.return=e);c!==null;){var f=c.dependencies;if(f!==null){var b=c.child;f=f.firstContext;e:for(;f!==null;){var x=f;f=c;for(var N=0;N<t.length;N++)if(x.context===t[N]){f.lanes|=s,x=f.alternate,x!==null&&(x.lanes|=s),Gc(f.return,s,e),l||(b=null);break e}f=x.next}}else if(c.tag===18){if(b=c.return,b===null)throw Error(o(341));b.lanes|=s,f=b.alternate,f!==null&&(f.lanes|=s),Gc(b,s,e),b=null}else b=c.child;if(b!==null)b.return=c;else for(b=c;b!==null;){if(b===e){b=null;break}if(c=b.sibling,c!==null){c.return=b.return,b=c;break}b=b.return}c=b}}function ni(e,t,s,l){e=null;for(var c=t,f=!1;c!==null;){if(!f){if((c.flags&524288)!==0)f=!0;else if((c.flags&262144)!==0)break}if(c.tag===10){var b=c.alternate;if(b===null)throw Error(o(387));if(b=b.memoizedProps,b!==null){var x=c.type;un(c.pendingProps.value,b.value)||(e!==null?e.push(x):e=[x])}}else if(c===me.current){if(b=c.alternate,b===null)throw Error(o(387));b.memoizedState.memoizedState!==c.memoizedState.memoizedState&&(e!==null?e.push(Nl):e=[Nl])}c=c.return}e!==null&&qc(t,e,s,l),t.flags|=262144}function Co(e){for(e=e.firstContext;e!==null;){if(!un(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function bs(e){vs=e,ca=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function It(e){return vp(vs,e)}function Ao(e,t){return vs===null&&bs(e),vp(e,t)}function vp(e,t){var s=t._currentValue;if(t={context:t,memoizedValue:s,next:null},ca===null){if(e===null)throw Error(o(308));ca=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else ca=ca.next=t;return s}var BS=typeof AbortController<"u"?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(s,l){e.push(l)}};this.abort=function(){t.aborted=!0,e.forEach(function(s){return s()})}},LS=n.unstable_scheduleCallback,US=n.unstable_NormalPriority,Et={$$typeof:R,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Fc(){return{controller:new BS,data:new Map,refCount:0}}function nl(e){e.refCount--,e.refCount===0&&LS(US,function(){e.controller.abort()})}var al=null,$c=0,ai=0,si=null;function zS(e,t){if(al===null){var s=al=[];$c=0,ai=Zu(),si={status:"pending",value:void 0,then:function(l){s.push(l)}}}return $c++,t.then(bp,bp),t}function bp(){if(--$c===0&&al!==null){si!==null&&(si.status="fulfilled");var e=al;al=null,ai=0,si=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function IS(e,t){var s=[],l={status:"pending",value:null,reason:null,then:function(c){s.push(c)}};return e.then(function(){l.status="fulfilled",l.value=t;for(var c=0;c<s.length;c++)(0,s[c])(t)},function(c){for(l.status="rejected",l.reason=c,c=0;c<s.length;c++)(0,s[c])(void 0)}),l}var Sp=U.S;U.S=function(e,t){ag=ue(),typeof t=="object"&&t!==null&&typeof t.then=="function"&&zS(e,t),Sp!==null&&Sp(e,t)};var Ss=Ue(null);function Yc(){var e=Ss.current;return e!==null?e:Je.pooledCache}function jo(e,t){t===null?ye(Ss,Ss.current):ye(Ss,t.pool)}function _p(){var e=Yc();return e===null?null:{parent:Et._currentValue,pool:e}}var ii=Error(o(460)),Kc=Error(o(474)),No=Error(o(542)),wo={then:function(){}};function xp(e){return e=e.status,e==="fulfilled"||e==="rejected"}function Tp(e,t,s){switch(s=e[s],s===void 0?e.push(t):s!==t&&(t.then(ia,ia),t=s),t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,Cp(e),e;default:if(typeof t.status=="string")t.then(ia,ia);else{if(e=Je,e!==null&&100<e.shellSuspendCounter)throw Error(o(482));e=t,e.status="pending",e.then(function(l){if(t.status==="pending"){var c=t;c.status="fulfilled",c.value=l}},function(l){if(t.status==="pending"){var c=t;c.status="rejected",c.reason=l}})}switch(t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,Cp(e),e}throw xs=t,ii}}function _s(e){try{var t=e._init;return t(e._payload)}catch(s){throw s!==null&&typeof s=="object"&&typeof s.then=="function"?(xs=s,ii):s}}var xs=null;function Ep(){if(xs===null)throw Error(o(459));var e=xs;return xs=null,e}function Cp(e){if(e===ii||e===No)throw Error(o(483))}var li=null,sl=0;function Do(e){var t=sl;return sl+=1,li===null&&(li=[]),Tp(li,e,t)}function il(e,t){t=t.props.ref,e.ref=t!==void 0?t:null}function ko(e,t){throw t.$$typeof===_?Error(o(525)):(e=Object.prototype.toString.call(t),Error(o(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e)))}function Ap(e){function t(M,w){if(e){var B=M.deletions;B===null?(M.deletions=[w],M.flags|=16):B.push(w)}}function s(M,w){if(!e)return null;for(;w!==null;)t(M,w),w=w.sibling;return null}function l(M){for(var w=new Map;M!==null;)M.key!==null?w.set(M.key,M):w.set(M.index,M),M=M.sibling;return w}function c(M,w){return M=oa(M,w),M.index=0,M.sibling=null,M}function f(M,w,B){return M.index=B,e?(B=M.alternate,B!==null?(B=B.index,B<w?(M.flags|=67108866,w):B):(M.flags|=67108866,w)):(M.flags|=1048576,w)}function b(M){return e&&M.alternate===null&&(M.flags|=67108866),M}function x(M,w,B,Z){return w===null||w.tag!==6?(w=Lc(B,M.mode,Z),w.return=M,w):(w=c(w,B),w.return=M,w)}function N(M,w,B,Z){var he=B.type;return he===E?F(M,w,B.props.children,Z,B.key):w!==null&&(w.elementType===he||typeof he=="object"&&he!==null&&he.$$typeof===O&&_s(he)===w.type)?(w=c(w,B.props),il(w,B),w.return=M,w):(w=To(B.type,B.key,B.props,null,M.mode,Z),il(w,B),w.return=M,w)}function L(M,w,B,Z){return w===null||w.tag!==4||w.stateNode.containerInfo!==B.containerInfo||w.stateNode.implementation!==B.implementation?(w=Uc(B,M.mode,Z),w.return=M,w):(w=c(w,B.children||[]),w.return=M,w)}function F(M,w,B,Z,he){return w===null||w.tag!==7?(w=gs(B,M.mode,Z,he),w.return=M,w):(w=c(w,B),w.return=M,w)}function X(M,w,B){if(typeof w=="string"&&w!==""||typeof w=="number"||typeof w=="bigint")return w=Lc(""+w,M.mode,B),w.return=M,w;if(typeof w=="object"&&w!==null){switch(w.$$typeof){case T:return B=To(w.type,w.key,w.props,null,M.mode,B),il(B,w),B.return=M,B;case C:return w=Uc(w,M.mode,B),w.return=M,w;case O:return w=_s(w),X(M,w,B)}if(G(w)||se(w))return w=gs(w,M.mode,B,null),w.return=M,w;if(typeof w.then=="function")return X(M,Do(w),B);if(w.$$typeof===R)return X(M,Ao(M,w),B);ko(M,w)}return null}function z(M,w,B,Z){var he=w!==null?w.key:null;if(typeof B=="string"&&B!==""||typeof B=="number"||typeof B=="bigint")return he!==null?null:x(M,w,""+B,Z);if(typeof B=="object"&&B!==null){switch(B.$$typeof){case T:return B.key===he?N(M,w,B,Z):null;case C:return B.key===he?L(M,w,B,Z):null;case O:return B=_s(B),z(M,w,B,Z)}if(G(B)||se(B))return he!==null?null:F(M,w,B,Z,null);if(typeof B.then=="function")return z(M,w,Do(B),Z);if(B.$$typeof===R)return z(M,w,Ao(M,B),Z);ko(M,B)}return null}function P(M,w,B,Z,he){if(typeof Z=="string"&&Z!==""||typeof Z=="number"||typeof Z=="bigint")return M=M.get(B)||null,x(w,M,""+Z,he);if(typeof Z=="object"&&Z!==null){switch(Z.$$typeof){case T:return M=M.get(Z.key===null?B:Z.key)||null,N(w,M,Z,he);case C:return M=M.get(Z.key===null?B:Z.key)||null,L(w,M,Z,he);case O:return Z=_s(Z),P(M,w,B,Z,he)}if(G(Z)||se(Z))return M=M.get(B)||null,F(w,M,Z,he,null);if(typeof Z.then=="function")return P(M,w,B,Do(Z),he);if(Z.$$typeof===R)return P(M,w,B,Ao(w,Z),he);ko(w,Z)}return null}function le(M,w,B,Z){for(var he=null,ze=null,de=w,Ne=w=0,Oe=null;de!==null&&Ne<B.length;Ne++){de.index>Ne?(Oe=de,de=null):Oe=de.sibling;var Ie=z(M,de,B[Ne],Z);if(Ie===null){de===null&&(de=Oe);break}e&&de&&Ie.alternate===null&&t(M,de),w=f(Ie,w,Ne),ze===null?he=Ie:ze.sibling=Ie,ze=Ie,de=Oe}if(Ne===B.length)return s(M,de),Le&&ra(M,Ne),he;if(de===null){for(;Ne<B.length;Ne++)de=X(M,B[Ne],Z),de!==null&&(w=f(de,w,Ne),ze===null?he=de:ze.sibling=de,ze=de);return Le&&ra(M,Ne),he}for(de=l(de);Ne<B.length;Ne++)Oe=P(de,M,Ne,B[Ne],Z),Oe!==null&&(e&&Oe.alternate!==null&&de.delete(Oe.key===null?Ne:Oe.key),w=f(Oe,w,Ne),ze===null?he=Oe:ze.sibling=Oe,ze=Oe);return e&&de.forEach(function(Ja){return t(M,Ja)}),Le&&ra(M,Ne),he}function pe(M,w,B,Z){if(B==null)throw Error(o(151));for(var he=null,ze=null,de=w,Ne=w=0,Oe=null,Ie=B.next();de!==null&&!Ie.done;Ne++,Ie=B.next()){de.index>Ne?(Oe=de,de=null):Oe=de.sibling;var Ja=z(M,de,Ie.value,Z);if(Ja===null){de===null&&(de=Oe);break}e&&de&&Ja.alternate===null&&t(M,de),w=f(Ja,w,Ne),ze===null?he=Ja:ze.sibling=Ja,ze=Ja,de=Oe}if(Ie.done)return s(M,de),Le&&ra(M,Ne),he;if(de===null){for(;!Ie.done;Ne++,Ie=B.next())Ie=X(M,Ie.value,Z),Ie!==null&&(w=f(Ie,w,Ne),ze===null?he=Ie:ze.sibling=Ie,ze=Ie);return Le&&ra(M,Ne),he}for(de=l(de);!Ie.done;Ne++,Ie=B.next())Ie=P(de,M,Ne,Ie.value,Z),Ie!==null&&(e&&Ie.alternate!==null&&de.delete(Ie.key===null?Ne:Ie.key),w=f(Ie,w,Ne),ze===null?he=Ie:ze.sibling=Ie,ze=Ie);return e&&de.forEach(function(X_){return t(M,X_)}),Le&&ra(M,Ne),he}function Ze(M,w,B,Z){if(typeof B=="object"&&B!==null&&B.type===E&&B.key===null&&(B=B.props.children),typeof B=="object"&&B!==null){switch(B.$$typeof){case T:e:{for(var he=B.key;w!==null;){if(w.key===he){if(he=B.type,he===E){if(w.tag===7){s(M,w.sibling),Z=c(w,B.props.children),Z.return=M,M=Z;break e}}else if(w.elementType===he||typeof he=="object"&&he!==null&&he.$$typeof===O&&_s(he)===w.type){s(M,w.sibling),Z=c(w,B.props),il(Z,B),Z.return=M,M=Z;break e}s(M,w);break}else t(M,w);w=w.sibling}B.type===E?(Z=gs(B.props.children,M.mode,Z,B.key),Z.return=M,M=Z):(Z=To(B.type,B.key,B.props,null,M.mode,Z),il(Z,B),Z.return=M,M=Z)}return b(M);case C:e:{for(he=B.key;w!==null;){if(w.key===he)if(w.tag===4&&w.stateNode.containerInfo===B.containerInfo&&w.stateNode.implementation===B.implementation){s(M,w.sibling),Z=c(w,B.children||[]),Z.return=M,M=Z;break e}else{s(M,w);break}else t(M,w);w=w.sibling}Z=Uc(B,M.mode,Z),Z.return=M,M=Z}return b(M);case O:return B=_s(B),Ze(M,w,B,Z)}if(G(B))return le(M,w,B,Z);if(se(B)){if(he=se(B),typeof he!="function")throw Error(o(150));return B=he.call(B),pe(M,w,B,Z)}if(typeof B.then=="function")return Ze(M,w,Do(B),Z);if(B.$$typeof===R)return Ze(M,w,Ao(M,B),Z);ko(M,B)}return typeof B=="string"&&B!==""||typeof B=="number"||typeof B=="bigint"?(B=""+B,w!==null&&w.tag===6?(s(M,w.sibling),Z=c(w,B),Z.return=M,M=Z):(s(M,w),Z=Lc(B,M.mode,Z),Z.return=M,M=Z),b(M)):s(M,w)}return function(M,w,B,Z){try{sl=0;var he=Ze(M,w,B,Z);return li=null,he}catch(de){if(de===ii||de===No)throw de;var ze=dn(29,de,null,M.mode);return ze.lanes=Z,ze.return=M,ze}finally{}}}var Ts=Ap(!0),jp=Ap(!1),Ba=!1;function Zc(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Xc(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function La(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function Ua(e,t,s){var l=e.updateQueue;if(l===null)return null;if(l=l.shared,(He&2)!==0){var c=l.pending;return c===null?t.next=t:(t.next=c.next,c.next=t),l.pending=t,t=xo(e),up(e,null,s),t}return _o(e,l,t,s),xo(e)}function ll(e,t,s){if(t=t.updateQueue,t!==null&&(t=t.shared,(s&4194048)!==0)){var l=t.lanes;l&=e.pendingLanes,s|=l,t.lanes=s,vh(e,s)}}function Qc(e,t){var s=e.updateQueue,l=e.alternate;if(l!==null&&(l=l.updateQueue,s===l)){var c=null,f=null;if(s=s.firstBaseUpdate,s!==null){do{var b={lane:s.lane,tag:s.tag,payload:s.payload,callback:null,next:null};f===null?c=f=b:f=f.next=b,s=s.next}while(s!==null);f===null?c=f=t:f=f.next=t}else c=f=t;s={baseState:l.baseState,firstBaseUpdate:c,lastBaseUpdate:f,shared:l.shared,callbacks:l.callbacks},e.updateQueue=s;return}e=s.lastBaseUpdate,e===null?s.firstBaseUpdate=t:e.next=t,s.lastBaseUpdate=t}var Jc=!1;function ol(){if(Jc){var e=si;if(e!==null)throw e}}function rl(e,t,s,l){Jc=!1;var c=e.updateQueue;Ba=!1;var f=c.firstBaseUpdate,b=c.lastBaseUpdate,x=c.shared.pending;if(x!==null){c.shared.pending=null;var N=x,L=N.next;N.next=null,b===null?f=L:b.next=L,b=N;var F=e.alternate;F!==null&&(F=F.updateQueue,x=F.lastBaseUpdate,x!==b&&(x===null?F.firstBaseUpdate=L:x.next=L,F.lastBaseUpdate=N))}if(f!==null){var X=c.baseState;b=0,F=L=N=null,x=f;do{var z=x.lane&-536870913,P=z!==x.lane;if(P?(Re&z)===z:(l&z)===z){z!==0&&z===ai&&(Jc=!0),F!==null&&(F=F.next={lane:0,tag:x.tag,payload:x.payload,callback:null,next:null});e:{var le=e,pe=x;z=t;var Ze=s;switch(pe.tag){case 1:if(le=pe.payload,typeof le=="function"){X=le.call(Ze,X,z);break e}X=le;break e;case 3:le.flags=le.flags&-65537|128;case 0:if(le=pe.payload,z=typeof le=="function"?le.call(Ze,X,z):le,z==null)break e;X=v({},X,z);break e;case 2:Ba=!0}}z=x.callback,z!==null&&(e.flags|=64,P&&(e.flags|=8192),P=c.callbacks,P===null?c.callbacks=[z]:P.push(z))}else P={lane:z,tag:x.tag,payload:x.payload,callback:x.callback,next:null},F===null?(L=F=P,N=X):F=F.next=P,b|=z;if(x=x.next,x===null){if(x=c.shared.pending,x===null)break;P=x,x=P.next,P.next=null,c.lastBaseUpdate=P,c.shared.pending=null}}while(!0);F===null&&(N=X),c.baseState=N,c.firstBaseUpdate=L,c.lastBaseUpdate=F,f===null&&(c.shared.lanes=0),Pa|=b,e.lanes=b,e.memoizedState=X}}function Np(e,t){if(typeof e!="function")throw Error(o(191,e));e.call(t)}function wp(e,t){var s=e.callbacks;if(s!==null)for(e.callbacks=null,e=0;e<s.length;e++)Np(s[e],t)}var oi=Ue(null),Mo=Ue(0);function Dp(e,t){e=ba,ye(Mo,e),ye(oi,t),ba=e|t.baseLanes}function Wc(){ye(Mo,ba),ye(oi,oi.current)}function eu(){ba=Mo.current,Ee(oi),Ee(Mo)}var fn=Ue(null),Nn=null;function za(e){var t=e.alternate;ye(vt,vt.current&1),ye(fn,e),Nn===null&&(t===null||oi.current!==null||t.memoizedState!==null)&&(Nn=e)}function tu(e){ye(vt,vt.current),ye(fn,e),Nn===null&&(Nn=e)}function kp(e){e.tag===22?(ye(vt,vt.current),ye(fn,e),Nn===null&&(Nn=e)):Ia()}function Ia(){ye(vt,vt.current),ye(fn,fn.current)}function hn(e){Ee(fn),Nn===e&&(Nn=null),Ee(vt)}var vt=Ue(0);function Ro(e){for(var t=e;t!==null;){if(t.tag===13){var s=t.memoizedState;if(s!==null&&(s=s.dehydrated,s===null||od(s)||rd(s)))return t}else if(t.tag===19&&(t.memoizedProps.revealOrder==="forwards"||t.memoizedProps.revealOrder==="backwards"||t.memoizedProps.revealOrder==="unstable_legacy-backwards"||t.memoizedProps.revealOrder==="together")){if((t.flags&128)!==0)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 da=0,Ce=null,Ye=null,Ct=null,Oo=!1,ri=!1,Es=!1,Bo=0,cl=0,ci=null,VS=0;function dt(){throw Error(o(321))}function nu(e,t){if(t===null)return!1;for(var s=0;s<t.length&&s<e.length;s++)if(!un(e[s],t[s]))return!1;return!0}function au(e,t,s,l,c,f){return da=f,Ce=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,U.H=e===null||e.memoizedState===null?pm:vu,Es=!1,f=s(l,c),Es=!1,ri&&(f=Rp(t,s,l,c)),Mp(e),f}function Mp(e){U.H=fl;var t=Ye!==null&&Ye.next!==null;if(da=0,Ct=Ye=Ce=null,Oo=!1,cl=0,ci=null,t)throw Error(o(300));e===null||At||(e=e.dependencies,e!==null&&Co(e)&&(At=!0))}function Rp(e,t,s,l){Ce=e;var c=0;do{if(ri&&(ci=null),cl=0,ri=!1,25<=c)throw Error(o(301));if(c+=1,Ct=Ye=null,e.updateQueue!=null){var f=e.updateQueue;f.lastEffect=null,f.events=null,f.stores=null,f.memoCache!=null&&(f.memoCache.index=0)}U.H=mm,f=t(s,l)}while(ri);return f}function HS(){var e=U.H,t=e.useState()[0];return t=typeof t.then=="function"?ul(t):t,e=e.useState()[0],(Ye!==null?Ye.memoizedState:null)!==e&&(Ce.flags|=1024),t}function su(){var e=Bo!==0;return Bo=0,e}function iu(e,t,s){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~s}function lu(e){if(Oo){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}Oo=!1}da=0,Ct=Ye=Ce=null,ri=!1,cl=Bo=0,ci=null}function Xt(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Ct===null?Ce.memoizedState=Ct=e:Ct=Ct.next=e,Ct}function bt(){if(Ye===null){var e=Ce.alternate;e=e!==null?e.memoizedState:null}else e=Ye.next;var t=Ct===null?Ce.memoizedState:Ct.next;if(t!==null)Ct=t,Ye=e;else{if(e===null)throw Ce.alternate===null?Error(o(467)):Error(o(310));Ye=e,e={memoizedState:Ye.memoizedState,baseState:Ye.baseState,baseQueue:Ye.baseQueue,queue:Ye.queue,next:null},Ct===null?Ce.memoizedState=Ct=e:Ct=Ct.next=e}return Ct}function Lo(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function ul(e){var t=cl;return cl+=1,ci===null&&(ci=[]),e=Tp(ci,e,t),t=Ce,(Ct===null?t.memoizedState:Ct.next)===null&&(t=t.alternate,U.H=t===null||t.memoizedState===null?pm:vu),e}function Uo(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return ul(e);if(e.$$typeof===R)return It(e)}throw Error(o(438,String(e)))}function ou(e){var t=null,s=Ce.updateQueue;if(s!==null&&(t=s.memoCache),t==null){var l=Ce.alternate;l!==null&&(l=l.updateQueue,l!==null&&(l=l.memoCache,l!=null&&(t={data:l.data.map(function(c){return c.slice()}),index:0})))}if(t==null&&(t={data:[],index:0}),s===null&&(s=Lo(),Ce.updateQueue=s),s.memoCache=t,s=t.data[t.index],s===void 0)for(s=t.data[t.index]=Array(e),l=0;l<e;l++)s[l]=ae;return t.index++,s}function fa(e,t){return typeof t=="function"?t(e):t}function zo(e){var t=bt();return ru(t,Ye,e)}function ru(e,t,s){var l=e.queue;if(l===null)throw Error(o(311));l.lastRenderedReducer=s;var c=e.baseQueue,f=l.pending;if(f!==null){if(c!==null){var b=c.next;c.next=f.next,f.next=b}t.baseQueue=c=f,l.pending=null}if(f=e.baseState,c===null)e.memoizedState=f;else{t=c.next;var x=b=null,N=null,L=t,F=!1;do{var X=L.lane&-536870913;if(X!==L.lane?(Re&X)===X:(da&X)===X){var z=L.revertLane;if(z===0)N!==null&&(N=N.next={lane:0,revertLane:0,gesture:null,action:L.action,hasEagerState:L.hasEagerState,eagerState:L.eagerState,next:null}),X===ai&&(F=!0);else if((da&z)===z){L=L.next,z===ai&&(F=!0);continue}else X={lane:0,revertLane:L.revertLane,gesture:null,action:L.action,hasEagerState:L.hasEagerState,eagerState:L.eagerState,next:null},N===null?(x=N=X,b=f):N=N.next=X,Ce.lanes|=z,Pa|=z;X=L.action,Es&&s(f,X),f=L.hasEagerState?L.eagerState:s(f,X)}else z={lane:X,revertLane:L.revertLane,gesture:L.gesture,action:L.action,hasEagerState:L.hasEagerState,eagerState:L.eagerState,next:null},N===null?(x=N=z,b=f):N=N.next=z,Ce.lanes|=X,Pa|=X;L=L.next}while(L!==null&&L!==t);if(N===null?b=f:N.next=x,!un(f,e.memoizedState)&&(At=!0,F&&(s=si,s!==null)))throw s;e.memoizedState=f,e.baseState=b,e.baseQueue=N,l.lastRenderedState=f}return c===null&&(l.lanes=0),[e.memoizedState,l.dispatch]}function cu(e){var t=bt(),s=t.queue;if(s===null)throw Error(o(311));s.lastRenderedReducer=e;var l=s.dispatch,c=s.pending,f=t.memoizedState;if(c!==null){s.pending=null;var b=c=c.next;do f=e(f,b.action),b=b.next;while(b!==c);un(f,t.memoizedState)||(At=!0),t.memoizedState=f,t.baseQueue===null&&(t.baseState=f),s.lastRenderedState=f}return[f,l]}function Op(e,t,s){var l=Ce,c=bt(),f=Le;if(f){if(s===void 0)throw Error(o(407));s=s()}else s=t();var b=!un((Ye||c).memoizedState,s);if(b&&(c.memoizedState=s,At=!0),c=c.queue,fu(Up.bind(null,l,c,e),[e]),c.getSnapshot!==t||b||Ct!==null&&Ct.memoizedState.tag&1){if(l.flags|=2048,ui(9,{destroy:void 0},Lp.bind(null,l,c,s,t),null),Je===null)throw Error(o(349));f||(da&127)!==0||Bp(l,t,s)}return s}function Bp(e,t,s){e.flags|=16384,e={getSnapshot:t,value:s},t=Ce.updateQueue,t===null?(t=Lo(),Ce.updateQueue=t,t.stores=[e]):(s=t.stores,s===null?t.stores=[e]:s.push(e))}function Lp(e,t,s,l){t.value=s,t.getSnapshot=l,zp(t)&&Ip(e)}function Up(e,t,s){return s(function(){zp(t)&&Ip(e)})}function zp(e){var t=e.getSnapshot;e=e.value;try{var s=t();return!un(e,s)}catch{return!0}}function Ip(e){var t=ms(e,2);t!==null&&cn(t,e,2)}function uu(e){var t=Xt();if(typeof e=="function"){var s=e;if(e=s(),Es){Zt(!0);try{s()}finally{Zt(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:fa,lastRenderedState:e},t}function Vp(e,t,s,l){return e.baseState=s,ru(e,Ye,typeof l=="function"?l:fa)}function PS(e,t,s,l,c){if(Ho(e))throw Error(o(485));if(e=t.action,e!==null){var f={payload:c,action:e,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(b){f.listeners.push(b)}};U.T!==null?s(!0):f.isTransition=!1,l(f),s=t.pending,s===null?(f.next=t.pending=f,Hp(t,f)):(f.next=s.next,t.pending=s.next=f)}}function Hp(e,t){var s=t.action,l=t.payload,c=e.state;if(t.isTransition){var f=U.T,b={};U.T=b;try{var x=s(c,l),N=U.S;N!==null&&N(b,x),Pp(e,t,x)}catch(L){du(e,t,L)}finally{f!==null&&b.types!==null&&(f.types=b.types),U.T=f}}else try{f=s(c,l),Pp(e,t,f)}catch(L){du(e,t,L)}}function Pp(e,t,s){s!==null&&typeof s=="object"&&typeof s.then=="function"?s.then(function(l){Gp(e,t,l)},function(l){return du(e,t,l)}):Gp(e,t,s)}function Gp(e,t,s){t.status="fulfilled",t.value=s,qp(t),e.state=s,t=e.pending,t!==null&&(s=t.next,s===t?e.pending=null:(s=s.next,t.next=s,Hp(e,s)))}function du(e,t,s){var l=e.pending;if(e.pending=null,l!==null){l=l.next;do t.status="rejected",t.reason=s,qp(t),t=t.next;while(t!==l)}e.action=null}function qp(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function Fp(e,t){return t}function $p(e,t){if(Le){var s=Je.formState;if(s!==null){e:{var l=Ce;if(Le){if(tt){t:{for(var c=tt,f=jn;c.nodeType!==8;){if(!f){c=null;break t}if(c=wn(c.nextSibling),c===null){c=null;break t}}f=c.data,c=f==="F!"||f==="F"?c:null}if(c){tt=wn(c.nextSibling),l=c.data==="F!";break e}}Ra(l)}l=!1}l&&(t=s[0])}}return s=Xt(),s.memoizedState=s.baseState=t,l={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Fp,lastRenderedState:t},s.queue=l,s=dm.bind(null,Ce,l),l.dispatch=s,l=uu(!1),f=yu.bind(null,Ce,!1,l.queue),l=Xt(),c={state:t,dispatch:null,action:e,pending:null},l.queue=c,s=PS.bind(null,Ce,c,f,s),c.dispatch=s,l.memoizedState=e,[t,s,!1]}function Yp(e){var t=bt();return Kp(t,Ye,e)}function Kp(e,t,s){if(t=ru(e,t,Fp)[0],e=zo(fa)[0],typeof t=="object"&&t!==null&&typeof t.then=="function")try{var l=ul(t)}catch(b){throw b===ii?No:b}else l=t;t=bt();var c=t.queue,f=c.dispatch;return s!==t.memoizedState&&(Ce.flags|=2048,ui(9,{destroy:void 0},GS.bind(null,c,s),null)),[l,f,e]}function GS(e,t){e.action=t}function Zp(e){var t=bt(),s=Ye;if(s!==null)return Kp(t,s,e);bt(),t=t.memoizedState,s=bt();var l=s.queue.dispatch;return s.memoizedState=e,[t,l,!1]}function ui(e,t,s,l){return e={tag:e,create:s,deps:l,inst:t,next:null},t=Ce.updateQueue,t===null&&(t=Lo(),Ce.updateQueue=t),s=t.lastEffect,s===null?t.lastEffect=e.next=e:(l=s.next,s.next=e,e.next=l,t.lastEffect=e),e}function Xp(){return bt().memoizedState}function Io(e,t,s,l){var c=Xt();Ce.flags|=e,c.memoizedState=ui(1|t,{destroy:void 0},s,l===void 0?null:l)}function Vo(e,t,s,l){var c=bt();l=l===void 0?null:l;var f=c.memoizedState.inst;Ye!==null&&l!==null&&nu(l,Ye.memoizedState.deps)?c.memoizedState=ui(t,f,s,l):(Ce.flags|=e,c.memoizedState=ui(1|t,f,s,l))}function Qp(e,t){Io(8390656,8,e,t)}function fu(e,t){Vo(2048,8,e,t)}function qS(e){Ce.flags|=4;var t=Ce.updateQueue;if(t===null)t=Lo(),Ce.updateQueue=t,t.events=[e];else{var s=t.events;s===null?t.events=[e]:s.push(e)}}function Jp(e){var t=bt().memoizedState;return qS({ref:t,nextImpl:e}),function(){if((He&2)!==0)throw Error(o(440));return t.impl.apply(void 0,arguments)}}function Wp(e,t){return Vo(4,2,e,t)}function em(e,t){return Vo(4,4,e,t)}function tm(e,t){if(typeof t=="function"){e=e();var s=t(e);return function(){typeof s=="function"?s():t(null)}}if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function nm(e,t,s){s=s!=null?s.concat([e]):null,Vo(4,4,tm.bind(null,t,e),s)}function hu(){}function am(e,t){var s=bt();t=t===void 0?null:t;var l=s.memoizedState;return t!==null&&nu(t,l[1])?l[0]:(s.memoizedState=[e,t],e)}function sm(e,t){var s=bt();t=t===void 0?null:t;var l=s.memoizedState;if(t!==null&&nu(t,l[1]))return l[0];if(l=e(),Es){Zt(!0);try{e()}finally{Zt(!1)}}return s.memoizedState=[l,t],l}function pu(e,t,s){return s===void 0||(da&1073741824)!==0&&(Re&261930)===0?e.memoizedState=t:(e.memoizedState=s,e=ig(),Ce.lanes|=e,Pa|=e,s)}function im(e,t,s,l){return un(s,t)?s:oi.current!==null?(e=pu(e,s,l),un(e,t)||(At=!0),e):(da&42)===0||(da&1073741824)!==0&&(Re&261930)===0?(At=!0,e.memoizedState=s):(e=ig(),Ce.lanes|=e,Pa|=e,t)}function lm(e,t,s,l,c){var f=Q.p;Q.p=f!==0&&8>f?f:8;var b=U.T,x={};U.T=x,yu(e,!1,t,s);try{var N=c(),L=U.S;if(L!==null&&L(x,N),N!==null&&typeof N=="object"&&typeof N.then=="function"){var F=IS(N,l);dl(e,t,F,gn(e))}else dl(e,t,l,gn(e))}catch(X){dl(e,t,{then:function(){},status:"rejected",reason:X},gn())}finally{Q.p=f,b!==null&&x.types!==null&&(b.types=x.types),U.T=b}}function FS(){}function mu(e,t,s,l){if(e.tag!==5)throw Error(o(476));var c=om(e).queue;lm(e,c,t,te,s===null?FS:function(){return rm(e),s(l)})}function om(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:te,baseState:te,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:fa,lastRenderedState:te},next:null};var s={};return t.next={memoizedState:s,baseState:s,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:fa,lastRenderedState:s},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function rm(e){var t=om(e);t.next===null&&(t=e.alternate.memoizedState),dl(e,t.next.queue,{},gn())}function gu(){return It(Nl)}function cm(){return bt().memoizedState}function um(){return bt().memoizedState}function $S(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var s=gn();e=La(s);var l=Ua(t,e,s);l!==null&&(cn(l,t,s),ll(l,t,s)),t={cache:Fc()},e.payload=t;return}t=t.return}}function YS(e,t,s){var l=gn();s={lane:l,revertLane:0,gesture:null,action:s,hasEagerState:!1,eagerState:null,next:null},Ho(e)?fm(t,s):(s=Oc(e,t,s,l),s!==null&&(cn(s,e,l),hm(s,t,l)))}function dm(e,t,s){var l=gn();dl(e,t,s,l)}function dl(e,t,s,l){var c={lane:l,revertLane:0,gesture:null,action:s,hasEagerState:!1,eagerState:null,next:null};if(Ho(e))fm(t,c);else{var f=e.alternate;if(e.lanes===0&&(f===null||f.lanes===0)&&(f=t.lastRenderedReducer,f!==null))try{var b=t.lastRenderedState,x=f(b,s);if(c.hasEagerState=!0,c.eagerState=x,un(x,b))return _o(e,t,c,0),Je===null&&So(),!1}catch{}finally{}if(s=Oc(e,t,c,l),s!==null)return cn(s,e,l),hm(s,t,l),!0}return!1}function yu(e,t,s,l){if(l={lane:2,revertLane:Zu(),gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null},Ho(e)){if(t)throw Error(o(479))}else t=Oc(e,s,l,2),t!==null&&cn(t,e,2)}function Ho(e){var t=e.alternate;return e===Ce||t!==null&&t===Ce}function fm(e,t){ri=Oo=!0;var s=e.pending;s===null?t.next=t:(t.next=s.next,s.next=t),e.pending=t}function hm(e,t,s){if((s&4194048)!==0){var l=t.lanes;l&=e.pendingLanes,s|=l,t.lanes=s,vh(e,s)}}var fl={readContext:It,use:Uo,useCallback:dt,useContext:dt,useEffect:dt,useImperativeHandle:dt,useLayoutEffect:dt,useInsertionEffect:dt,useMemo:dt,useReducer:dt,useRef:dt,useState:dt,useDebugValue:dt,useDeferredValue:dt,useTransition:dt,useSyncExternalStore:dt,useId:dt,useHostTransitionStatus:dt,useFormState:dt,useActionState:dt,useOptimistic:dt,useMemoCache:dt,useCacheRefresh:dt};fl.useEffectEvent=dt;var pm={readContext:It,use:Uo,useCallback:function(e,t){return Xt().memoizedState=[e,t===void 0?null:t],e},useContext:It,useEffect:Qp,useImperativeHandle:function(e,t,s){s=s!=null?s.concat([e]):null,Io(4194308,4,tm.bind(null,t,e),s)},useLayoutEffect:function(e,t){return Io(4194308,4,e,t)},useInsertionEffect:function(e,t){Io(4,2,e,t)},useMemo:function(e,t){var s=Xt();t=t===void 0?null:t;var l=e();if(Es){Zt(!0);try{e()}finally{Zt(!1)}}return s.memoizedState=[l,t],l},useReducer:function(e,t,s){var l=Xt();if(s!==void 0){var c=s(t);if(Es){Zt(!0);try{s(t)}finally{Zt(!1)}}}else c=t;return l.memoizedState=l.baseState=c,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:c},l.queue=e,e=e.dispatch=YS.bind(null,Ce,e),[l.memoizedState,e]},useRef:function(e){var t=Xt();return e={current:e},t.memoizedState=e},useState:function(e){e=uu(e);var t=e.queue,s=dm.bind(null,Ce,t);return t.dispatch=s,[e.memoizedState,s]},useDebugValue:hu,useDeferredValue:function(e,t){var s=Xt();return pu(s,e,t)},useTransition:function(){var e=uu(!1);return e=lm.bind(null,Ce,e.queue,!0,!1),Xt().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,s){var l=Ce,c=Xt();if(Le){if(s===void 0)throw Error(o(407));s=s()}else{if(s=t(),Je===null)throw Error(o(349));(Re&127)!==0||Bp(l,t,s)}c.memoizedState=s;var f={value:s,getSnapshot:t};return c.queue=f,Qp(Up.bind(null,l,f,e),[e]),l.flags|=2048,ui(9,{destroy:void 0},Lp.bind(null,l,f,s,t),null),s},useId:function(){var e=Xt(),t=Je.identifierPrefix;if(Le){var s=qn,l=Gn;s=(l&~(1<<32-gt(l)-1)).toString(32)+s,t="_"+t+"R_"+s,s=Bo++,0<s&&(t+="H"+s.toString(32)),t+="_"}else s=VS++,t="_"+t+"r_"+s.toString(32)+"_";return e.memoizedState=t},useHostTransitionStatus:gu,useFormState:$p,useActionState:$p,useOptimistic:function(e){var t=Xt();t.memoizedState=t.baseState=e;var s={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=s,t=yu.bind(null,Ce,!0,s),s.dispatch=t,[e,t]},useMemoCache:ou,useCacheRefresh:function(){return Xt().memoizedState=$S.bind(null,Ce)},useEffectEvent:function(e){var t=Xt(),s={impl:e};return t.memoizedState=s,function(){if((He&2)!==0)throw Error(o(440));return s.impl.apply(void 0,arguments)}}},vu={readContext:It,use:Uo,useCallback:am,useContext:It,useEffect:fu,useImperativeHandle:nm,useInsertionEffect:Wp,useLayoutEffect:em,useMemo:sm,useReducer:zo,useRef:Xp,useState:function(){return zo(fa)},useDebugValue:hu,useDeferredValue:function(e,t){var s=bt();return im(s,Ye.memoizedState,e,t)},useTransition:function(){var e=zo(fa)[0],t=bt().memoizedState;return[typeof e=="boolean"?e:ul(e),t]},useSyncExternalStore:Op,useId:cm,useHostTransitionStatus:gu,useFormState:Yp,useActionState:Yp,useOptimistic:function(e,t){var s=bt();return Vp(s,Ye,e,t)},useMemoCache:ou,useCacheRefresh:um};vu.useEffectEvent=Jp;var mm={readContext:It,use:Uo,useCallback:am,useContext:It,useEffect:fu,useImperativeHandle:nm,useInsertionEffect:Wp,useLayoutEffect:em,useMemo:sm,useReducer:cu,useRef:Xp,useState:function(){return cu(fa)},useDebugValue:hu,useDeferredValue:function(e,t){var s=bt();return Ye===null?pu(s,e,t):im(s,Ye.memoizedState,e,t)},useTransition:function(){var e=cu(fa)[0],t=bt().memoizedState;return[typeof e=="boolean"?e:ul(e),t]},useSyncExternalStore:Op,useId:cm,useHostTransitionStatus:gu,useFormState:Zp,useActionState:Zp,useOptimistic:function(e,t){var s=bt();return Ye!==null?Vp(s,Ye,e,t):(s.baseState=e,[e,s.queue.dispatch])},useMemoCache:ou,useCacheRefresh:um};mm.useEffectEvent=Jp;function bu(e,t,s,l){t=e.memoizedState,s=s(l,t),s=s==null?t:v({},t,s),e.memoizedState=s,e.lanes===0&&(e.updateQueue.baseState=s)}var Su={enqueueSetState:function(e,t,s){e=e._reactInternals;var l=gn(),c=La(l);c.payload=t,s!=null&&(c.callback=s),t=Ua(e,c,l),t!==null&&(cn(t,e,l),ll(t,e,l))},enqueueReplaceState:function(e,t,s){e=e._reactInternals;var l=gn(),c=La(l);c.tag=1,c.payload=t,s!=null&&(c.callback=s),t=Ua(e,c,l),t!==null&&(cn(t,e,l),ll(t,e,l))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var s=gn(),l=La(s);l.tag=2,t!=null&&(l.callback=t),t=Ua(e,l,s),t!==null&&(cn(t,e,s),ll(t,e,s))}};function gm(e,t,s,l,c,f,b){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(l,f,b):t.prototype&&t.prototype.isPureReactComponent?!Ji(s,l)||!Ji(c,f):!0}function ym(e,t,s,l){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(s,l),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(s,l),t.state!==e&&Su.enqueueReplaceState(t,t.state,null)}function Cs(e,t){var s=t;if("ref"in t){s={};for(var l in t)l!=="ref"&&(s[l]=t[l])}if(e=e.defaultProps){s===t&&(s=v({},s));for(var c in e)s[c]===void 0&&(s[c]=e[c])}return s}function vm(e){bo(e)}function bm(e){console.error(e)}function Sm(e){bo(e)}function Po(e,t){try{var s=e.onUncaughtError;s(t.value,{componentStack:t.stack})}catch(l){setTimeout(function(){throw l})}}function _m(e,t,s){try{var l=e.onCaughtError;l(s.value,{componentStack:s.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(c){setTimeout(function(){throw c})}}function _u(e,t,s){return s=La(s),s.tag=3,s.payload={element:null},s.callback=function(){Po(e,t)},s}function xm(e){return e=La(e),e.tag=3,e}function Tm(e,t,s,l){var c=s.type.getDerivedStateFromError;if(typeof c=="function"){var f=l.value;e.payload=function(){return c(f)},e.callback=function(){_m(t,s,l)}}var b=s.stateNode;b!==null&&typeof b.componentDidCatch=="function"&&(e.callback=function(){_m(t,s,l),typeof c!="function"&&(Ga===null?Ga=new Set([this]):Ga.add(this));var x=l.stack;this.componentDidCatch(l.value,{componentStack:x!==null?x:""})})}function KS(e,t,s,l,c){if(s.flags|=32768,l!==null&&typeof l=="object"&&typeof l.then=="function"){if(t=s.alternate,t!==null&&ni(t,s,c,!0),s=fn.current,s!==null){switch(s.tag){case 31:case 13:return Nn===null?er():s.alternate===null&&ft===0&&(ft=3),s.flags&=-257,s.flags|=65536,s.lanes=c,l===wo?s.flags|=16384:(t=s.updateQueue,t===null?s.updateQueue=new Set([l]):t.add(l),$u(e,l,c)),!1;case 22:return s.flags|=65536,l===wo?s.flags|=16384:(t=s.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([l])},s.updateQueue=t):(s=t.retryQueue,s===null?t.retryQueue=new Set([l]):s.add(l)),$u(e,l,c)),!1}throw Error(o(435,s.tag))}return $u(e,l,c),er(),!1}if(Le)return t=fn.current,t!==null?((t.flags&65536)===0&&(t.flags|=256),t.flags|=65536,t.lanes=c,l!==Vc&&(e=Error(o(422),{cause:l}),tl(En(e,s)))):(l!==Vc&&(t=Error(o(423),{cause:l}),tl(En(t,s))),e=e.current.alternate,e.flags|=65536,c&=-c,e.lanes|=c,l=En(l,s),c=_u(e.stateNode,l,c),Qc(e,c),ft!==4&&(ft=2)),!1;var f=Error(o(520),{cause:l});if(f=En(f,s),Sl===null?Sl=[f]:Sl.push(f),ft!==4&&(ft=2),t===null)return!0;l=En(l,s),s=t;do{switch(s.tag){case 3:return s.flags|=65536,e=c&-c,s.lanes|=e,e=_u(s.stateNode,l,e),Qc(s,e),!1;case 1:if(t=s.type,f=s.stateNode,(s.flags&128)===0&&(typeof t.getDerivedStateFromError=="function"||f!==null&&typeof f.componentDidCatch=="function"&&(Ga===null||!Ga.has(f))))return s.flags|=65536,c&=-c,s.lanes|=c,c=xm(c),Tm(c,e,s,l),Qc(s,c),!1}s=s.return}while(s!==null);return!1}var xu=Error(o(461)),At=!1;function Vt(e,t,s,l){t.child=e===null?jp(t,null,s,l):Ts(t,e.child,s,l)}function Em(e,t,s,l,c){s=s.render;var f=t.ref;if("ref"in l){var b={};for(var x in l)x!=="ref"&&(b[x]=l[x])}else b=l;return bs(t),l=au(e,t,s,b,f,c),x=su(),e!==null&&!At?(iu(e,t,c),ha(e,t,c)):(Le&&x&&zc(t),t.flags|=1,Vt(e,t,l,c),t.child)}function Cm(e,t,s,l,c){if(e===null){var f=s.type;return typeof f=="function"&&!Bc(f)&&f.defaultProps===void 0&&s.compare===null?(t.tag=15,t.type=f,Am(e,t,f,l,c)):(e=To(s.type,null,l,t,t.mode,c),e.ref=t.ref,e.return=t,t.child=e)}if(f=e.child,!Du(e,c)){var b=f.memoizedProps;if(s=s.compare,s=s!==null?s:Ji,s(b,l)&&e.ref===t.ref)return ha(e,t,c)}return t.flags|=1,e=oa(f,l),e.ref=t.ref,e.return=t,t.child=e}function Am(e,t,s,l,c){if(e!==null){var f=e.memoizedProps;if(Ji(f,l)&&e.ref===t.ref)if(At=!1,t.pendingProps=l=f,Du(e,c))(e.flags&131072)!==0&&(At=!0);else return t.lanes=e.lanes,ha(e,t,c)}return Tu(e,t,s,l,c)}function jm(e,t,s,l){var c=l.children,f=e!==null?e.memoizedState:null;if(e===null&&t.stateNode===null&&(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),l.mode==="hidden"){if((t.flags&128)!==0){if(f=f!==null?f.baseLanes|s:s,e!==null){for(l=t.child=e.child,c=0;l!==null;)c=c|l.lanes|l.childLanes,l=l.sibling;l=c&~f}else l=0,t.child=null;return Nm(e,t,f,s,l)}if((s&536870912)!==0)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&jo(t,f!==null?f.cachePool:null),f!==null?Dp(t,f):Wc(),kp(t);else return l=t.lanes=536870912,Nm(e,t,f!==null?f.baseLanes|s:s,s,l)}else f!==null?(jo(t,f.cachePool),Dp(t,f),Ia(),t.memoizedState=null):(e!==null&&jo(t,null),Wc(),Ia());return Vt(e,t,c,s),t.child}function hl(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function Nm(e,t,s,l,c){var f=Yc();return f=f===null?null:{parent:Et._currentValue,pool:f},t.memoizedState={baseLanes:s,cachePool:f},e!==null&&jo(t,null),Wc(),kp(t),e!==null&&ni(e,t,l,!0),t.childLanes=c,null}function Go(e,t){return t=Fo({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function wm(e,t,s){return Ts(t,e.child,null,s),e=Go(t,t.pendingProps),e.flags|=2,hn(t),t.memoizedState=null,e}function ZS(e,t,s){var l=t.pendingProps,c=(t.flags&128)!==0;if(t.flags&=-129,e===null){if(Le){if(l.mode==="hidden")return e=Go(t,l),t.lanes=536870912,hl(null,e);if(tu(t),(e=tt)?(e=Hg(e,jn),e=e!==null&&e.data==="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:ka!==null?{id:Gn,overflow:qn}:null,retryLane:536870912,hydrationErrors:null},s=fp(e),s.return=t,t.child=s,zt=t,tt=null)):e=null,e===null)throw Ra(t);return t.lanes=536870912,null}return Go(t,l)}var f=e.memoizedState;if(f!==null){var b=f.dehydrated;if(tu(t),c)if(t.flags&256)t.flags&=-257,t=wm(e,t,s);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(o(558));else if(At||ni(e,t,s,!1),c=(s&e.childLanes)!==0,At||c){if(l=Je,l!==null&&(b=bh(l,s),b!==0&&b!==f.retryLane))throw f.retryLane=b,ms(e,b),cn(l,e,b),xu;er(),t=wm(e,t,s)}else e=f.treeContext,tt=wn(b.nextSibling),zt=t,Le=!0,Ma=null,jn=!1,e!==null&&mp(t,e),t=Go(t,l),t.flags|=4096;return t}return e=oa(e.child,{mode:l.mode,children:l.children}),e.ref=t.ref,t.child=e,e.return=t,e}function qo(e,t){var s=t.ref;if(s===null)e!==null&&e.ref!==null&&(t.flags|=4194816);else{if(typeof s!="function"&&typeof s!="object")throw Error(o(284));(e===null||e.ref!==s)&&(t.flags|=4194816)}}function Tu(e,t,s,l,c){return bs(t),s=au(e,t,s,l,void 0,c),l=su(),e!==null&&!At?(iu(e,t,c),ha(e,t,c)):(Le&&l&&zc(t),t.flags|=1,Vt(e,t,s,c),t.child)}function Dm(e,t,s,l,c,f){return bs(t),t.updateQueue=null,s=Rp(t,l,s,c),Mp(e),l=su(),e!==null&&!At?(iu(e,t,f),ha(e,t,f)):(Le&&l&&zc(t),t.flags|=1,Vt(e,t,s,f),t.child)}function km(e,t,s,l,c){if(bs(t),t.stateNode===null){var f=Js,b=s.contextType;typeof b=="object"&&b!==null&&(f=It(b)),f=new s(l,f),t.memoizedState=f.state!==null&&f.state!==void 0?f.state:null,f.updater=Su,t.stateNode=f,f._reactInternals=t,f=t.stateNode,f.props=l,f.state=t.memoizedState,f.refs={},Zc(t),b=s.contextType,f.context=typeof b=="object"&&b!==null?It(b):Js,f.state=t.memoizedState,b=s.getDerivedStateFromProps,typeof b=="function"&&(bu(t,s,b,l),f.state=t.memoizedState),typeof s.getDerivedStateFromProps=="function"||typeof f.getSnapshotBeforeUpdate=="function"||typeof f.UNSAFE_componentWillMount!="function"&&typeof f.componentWillMount!="function"||(b=f.state,typeof f.componentWillMount=="function"&&f.componentWillMount(),typeof f.UNSAFE_componentWillMount=="function"&&f.UNSAFE_componentWillMount(),b!==f.state&&Su.enqueueReplaceState(f,f.state,null),rl(t,l,f,c),ol(),f.state=t.memoizedState),typeof f.componentDidMount=="function"&&(t.flags|=4194308),l=!0}else if(e===null){f=t.stateNode;var x=t.memoizedProps,N=Cs(s,x);f.props=N;var L=f.context,F=s.contextType;b=Js,typeof F=="object"&&F!==null&&(b=It(F));var X=s.getDerivedStateFromProps;F=typeof X=="function"||typeof f.getSnapshotBeforeUpdate=="function",x=t.pendingProps!==x,F||typeof f.UNSAFE_componentWillReceiveProps!="function"&&typeof f.componentWillReceiveProps!="function"||(x||L!==b)&&ym(t,f,l,b),Ba=!1;var z=t.memoizedState;f.state=z,rl(t,l,f,c),ol(),L=t.memoizedState,x||z!==L||Ba?(typeof X=="function"&&(bu(t,s,X,l),L=t.memoizedState),(N=Ba||gm(t,s,N,l,z,L,b))?(F||typeof f.UNSAFE_componentWillMount!="function"&&typeof f.componentWillMount!="function"||(typeof f.componentWillMount=="function"&&f.componentWillMount(),typeof f.UNSAFE_componentWillMount=="function"&&f.UNSAFE_componentWillMount()),typeof f.componentDidMount=="function"&&(t.flags|=4194308)):(typeof f.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=l,t.memoizedState=L),f.props=l,f.state=L,f.context=b,l=N):(typeof f.componentDidMount=="function"&&(t.flags|=4194308),l=!1)}else{f=t.stateNode,Xc(e,t),b=t.memoizedProps,F=Cs(s,b),f.props=F,X=t.pendingProps,z=f.context,L=s.contextType,N=Js,typeof L=="object"&&L!==null&&(N=It(L)),x=s.getDerivedStateFromProps,(L=typeof x=="function"||typeof f.getSnapshotBeforeUpdate=="function")||typeof f.UNSAFE_componentWillReceiveProps!="function"&&typeof f.componentWillReceiveProps!="function"||(b!==X||z!==N)&&ym(t,f,l,N),Ba=!1,z=t.memoizedState,f.state=z,rl(t,l,f,c),ol();var P=t.memoizedState;b!==X||z!==P||Ba||e!==null&&e.dependencies!==null&&Co(e.dependencies)?(typeof x=="function"&&(bu(t,s,x,l),P=t.memoizedState),(F=Ba||gm(t,s,F,l,z,P,N)||e!==null&&e.dependencies!==null&&Co(e.dependencies))?(L||typeof f.UNSAFE_componentWillUpdate!="function"&&typeof f.componentWillUpdate!="function"||(typeof f.componentWillUpdate=="function"&&f.componentWillUpdate(l,P,N),typeof f.UNSAFE_componentWillUpdate=="function"&&f.UNSAFE_componentWillUpdate(l,P,N)),typeof f.componentDidUpdate=="function"&&(t.flags|=4),typeof f.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof f.componentDidUpdate!="function"||b===e.memoizedProps&&z===e.memoizedState||(t.flags|=4),typeof f.getSnapshotBeforeUpdate!="function"||b===e.memoizedProps&&z===e.memoizedState||(t.flags|=1024),t.memoizedProps=l,t.memoizedState=P),f.props=l,f.state=P,f.context=N,l=F):(typeof f.componentDidUpdate!="function"||b===e.memoizedProps&&z===e.memoizedState||(t.flags|=4),typeof f.getSnapshotBeforeUpdate!="function"||b===e.memoizedProps&&z===e.memoizedState||(t.flags|=1024),l=!1)}return f=l,qo(e,t),l=(t.flags&128)!==0,f||l?(f=t.stateNode,s=l&&typeof s.getDerivedStateFromError!="function"?null:f.render(),t.flags|=1,e!==null&&l?(t.child=Ts(t,e.child,null,c),t.child=Ts(t,null,s,c)):Vt(e,t,s,c),t.memoizedState=f.state,e=t.child):e=ha(e,t,c),e}function Mm(e,t,s,l){return ys(),t.flags|=256,Vt(e,t,s,l),t.child}var Eu={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Cu(e){return{baseLanes:e,cachePool:_p()}}function Au(e,t,s){return e=e!==null?e.childLanes&~s:0,t&&(e|=mn),e}function Rm(e,t,s){var l=t.pendingProps,c=!1,f=(t.flags&128)!==0,b;if((b=f)||(b=e!==null&&e.memoizedState===null?!1:(vt.current&2)!==0),b&&(c=!0,t.flags&=-129),b=(t.flags&32)!==0,t.flags&=-33,e===null){if(Le){if(c?za(t):Ia(),(e=tt)?(e=Hg(e,jn),e=e!==null&&e.data!=="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:ka!==null?{id:Gn,overflow:qn}:null,retryLane:536870912,hydrationErrors:null},s=fp(e),s.return=t,t.child=s,zt=t,tt=null)):e=null,e===null)throw Ra(t);return rd(e)?t.lanes=32:t.lanes=536870912,null}var x=l.children;return l=l.fallback,c?(Ia(),c=t.mode,x=Fo({mode:"hidden",children:x},c),l=gs(l,c,s,null),x.return=t,l.return=t,x.sibling=l,t.child=x,l=t.child,l.memoizedState=Cu(s),l.childLanes=Au(e,b,s),t.memoizedState=Eu,hl(null,l)):(za(t),ju(t,x))}var N=e.memoizedState;if(N!==null&&(x=N.dehydrated,x!==null)){if(f)t.flags&256?(za(t),t.flags&=-257,t=Nu(e,t,s)):t.memoizedState!==null?(Ia(),t.child=e.child,t.flags|=128,t=null):(Ia(),x=l.fallback,c=t.mode,l=Fo({mode:"visible",children:l.children},c),x=gs(x,c,s,null),x.flags|=2,l.return=t,x.return=t,l.sibling=x,t.child=l,Ts(t,e.child,null,s),l=t.child,l.memoizedState=Cu(s),l.childLanes=Au(e,b,s),t.memoizedState=Eu,t=hl(null,l));else if(za(t),rd(x)){if(b=x.nextSibling&&x.nextSibling.dataset,b)var L=b.dgst;b=L,l=Error(o(419)),l.stack="",l.digest=b,tl({value:l,source:null,stack:null}),t=Nu(e,t,s)}else if(At||ni(e,t,s,!1),b=(s&e.childLanes)!==0,At||b){if(b=Je,b!==null&&(l=bh(b,s),l!==0&&l!==N.retryLane))throw N.retryLane=l,ms(e,l),cn(b,e,l),xu;od(x)||er(),t=Nu(e,t,s)}else od(x)?(t.flags|=192,t.child=e.child,t=null):(e=N.treeContext,tt=wn(x.nextSibling),zt=t,Le=!0,Ma=null,jn=!1,e!==null&&mp(t,e),t=ju(t,l.children),t.flags|=4096);return t}return c?(Ia(),x=l.fallback,c=t.mode,N=e.child,L=N.sibling,l=oa(N,{mode:"hidden",children:l.children}),l.subtreeFlags=N.subtreeFlags&65011712,L!==null?x=oa(L,x):(x=gs(x,c,s,null),x.flags|=2),x.return=t,l.return=t,l.sibling=x,t.child=l,hl(null,l),l=t.child,x=e.child.memoizedState,x===null?x=Cu(s):(c=x.cachePool,c!==null?(N=Et._currentValue,c=c.parent!==N?{parent:N,pool:N}:c):c=_p(),x={baseLanes:x.baseLanes|s,cachePool:c}),l.memoizedState=x,l.childLanes=Au(e,b,s),t.memoizedState=Eu,hl(e.child,l)):(za(t),s=e.child,e=s.sibling,s=oa(s,{mode:"visible",children:l.children}),s.return=t,s.sibling=null,e!==null&&(b=t.deletions,b===null?(t.deletions=[e],t.flags|=16):b.push(e)),t.child=s,t.memoizedState=null,s)}function ju(e,t){return t=Fo({mode:"visible",children:t},e.mode),t.return=e,e.child=t}function Fo(e,t){return e=dn(22,e,null,t),e.lanes=0,e}function Nu(e,t,s){return Ts(t,e.child,null,s),e=ju(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function Om(e,t,s){e.lanes|=t;var l=e.alternate;l!==null&&(l.lanes|=t),Gc(e.return,t,s)}function wu(e,t,s,l,c,f){var b=e.memoizedState;b===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:l,tail:s,tailMode:c,treeForkCount:f}:(b.isBackwards=t,b.rendering=null,b.renderingStartTime=0,b.last=l,b.tail=s,b.tailMode=c,b.treeForkCount=f)}function Bm(e,t,s){var l=t.pendingProps,c=l.revealOrder,f=l.tail;l=l.children;var b=vt.current,x=(b&2)!==0;if(x?(b=b&1|2,t.flags|=128):b&=1,ye(vt,b),Vt(e,t,l,s),l=Le?el:0,!x&&e!==null&&(e.flags&128)!==0)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&Om(e,s,t);else if(e.tag===19)Om(e,s,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}switch(c){case"forwards":for(s=t.child,c=null;s!==null;)e=s.alternate,e!==null&&Ro(e)===null&&(c=s),s=s.sibling;s=c,s===null?(c=t.child,t.child=null):(c=s.sibling,s.sibling=null),wu(t,!1,c,s,f,l);break;case"backwards":case"unstable_legacy-backwards":for(s=null,c=t.child,t.child=null;c!==null;){if(e=c.alternate,e!==null&&Ro(e)===null){t.child=c;break}e=c.sibling,c.sibling=s,s=c,c=e}wu(t,!0,s,null,f,l);break;case"together":wu(t,!1,null,null,void 0,l);break;default:t.memoizedState=null}return t.child}function ha(e,t,s){if(e!==null&&(t.dependencies=e.dependencies),Pa|=t.lanes,(s&t.childLanes)===0)if(e!==null){if(ni(e,t,s,!1),(s&t.childLanes)===0)return null}else return null;if(e!==null&&t.child!==e.child)throw Error(o(153));if(t.child!==null){for(e=t.child,s=oa(e,e.pendingProps),t.child=s,s.return=t;e.sibling!==null;)e=e.sibling,s=s.sibling=oa(e,e.pendingProps),s.return=t;s.sibling=null}return t.child}function Du(e,t){return(e.lanes&t)!==0?!0:(e=e.dependencies,!!(e!==null&&Co(e)))}function XS(e,t,s){switch(t.tag){case 3:Ae(t,t.stateNode.containerInfo),Oa(t,Et,e.memoizedState.cache),ys();break;case 27:case 5:mt(t);break;case 4:Ae(t,t.stateNode.containerInfo);break;case 10:Oa(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,tu(t),null;break;case 13:var l=t.memoizedState;if(l!==null)return l.dehydrated!==null?(za(t),t.flags|=128,null):(s&t.child.childLanes)!==0?Rm(e,t,s):(za(t),e=ha(e,t,s),e!==null?e.sibling:null);za(t);break;case 19:var c=(e.flags&128)!==0;if(l=(s&t.childLanes)!==0,l||(ni(e,t,s,!1),l=(s&t.childLanes)!==0),c){if(l)return Bm(e,t,s);t.flags|=128}if(c=t.memoizedState,c!==null&&(c.rendering=null,c.tail=null,c.lastEffect=null),ye(vt,vt.current),l)break;return null;case 22:return t.lanes=0,jm(e,t,s,t.pendingProps);case 24:Oa(t,Et,e.memoizedState.cache)}return ha(e,t,s)}function Lm(e,t,s){if(e!==null)if(e.memoizedProps!==t.pendingProps)At=!0;else{if(!Du(e,s)&&(t.flags&128)===0)return At=!1,XS(e,t,s);At=(e.flags&131072)!==0}else At=!1,Le&&(t.flags&1048576)!==0&&pp(t,el,t.index);switch(t.lanes=0,t.tag){case 16:e:{var l=t.pendingProps;if(e=_s(t.elementType),t.type=e,typeof e=="function")Bc(e)?(l=Cs(e,l),t.tag=1,t=km(null,t,e,l,s)):(t.tag=0,t=Tu(null,t,e,l,s));else{if(e!=null){var c=e.$$typeof;if(c===$){t.tag=11,t=Em(null,t,e,l,s);break e}else if(c===q){t.tag=14,t=Cm(null,t,e,l,s);break e}}throw t=fe(e)||e,Error(o(306,t,""))}}return t;case 0:return Tu(e,t,t.type,t.pendingProps,s);case 1:return l=t.type,c=Cs(l,t.pendingProps),km(e,t,l,c,s);case 3:e:{if(Ae(t,t.stateNode.containerInfo),e===null)throw Error(o(387));l=t.pendingProps;var f=t.memoizedState;c=f.element,Xc(e,t),rl(t,l,null,s);var b=t.memoizedState;if(l=b.cache,Oa(t,Et,l),l!==f.cache&&qc(t,[Et],s,!0),ol(),l=b.element,f.isDehydrated)if(f={element:l,isDehydrated:!1,cache:b.cache},t.updateQueue.baseState=f,t.memoizedState=f,t.flags&256){t=Mm(e,t,l,s);break e}else if(l!==c){c=En(Error(o(424)),t),tl(c),t=Mm(e,t,l,s);break e}else{switch(e=t.stateNode.containerInfo,e.nodeType){case 9:e=e.body;break;default:e=e.nodeName==="HTML"?e.ownerDocument.body:e}for(tt=wn(e.firstChild),zt=t,Le=!0,Ma=null,jn=!0,s=jp(t,null,l,s),t.child=s;s;)s.flags=s.flags&-3|4096,s=s.sibling}else{if(ys(),l===c){t=ha(e,t,s);break e}Vt(e,t,l,s)}t=t.child}return t;case 26:return qo(e,t),e===null?(s=Yg(t.type,null,t.pendingProps,null))?t.memoizedState=s:Le||(s=t.type,e=t.pendingProps,l=or(K.current).createElement(s),l[Ut]=t,l[nn]=e,Ht(l,s,e),Rt(l),t.stateNode=l):t.memoizedState=Yg(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return mt(t),e===null&&Le&&(l=t.stateNode=qg(t.type,t.pendingProps,K.current),zt=t,jn=!0,c=tt,Ya(t.type)?(cd=c,tt=wn(l.firstChild)):tt=c),Vt(e,t,t.pendingProps.children,s),qo(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&Le&&((c=l=tt)&&(l=A_(l,t.type,t.pendingProps,jn),l!==null?(t.stateNode=l,zt=t,tt=wn(l.firstChild),jn=!1,c=!0):c=!1),c||Ra(t)),mt(t),c=t.type,f=t.pendingProps,b=e!==null?e.memoizedProps:null,l=f.children,sd(c,f)?l=null:b!==null&&sd(c,b)&&(t.flags|=32),t.memoizedState!==null&&(c=au(e,t,HS,null,null,s),Nl._currentValue=c),qo(e,t),Vt(e,t,l,s),t.child;case 6:return e===null&&Le&&((e=s=tt)&&(s=j_(s,t.pendingProps,jn),s!==null?(t.stateNode=s,zt=t,tt=null,e=!0):e=!1),e||Ra(t)),null;case 13:return Rm(e,t,s);case 4:return Ae(t,t.stateNode.containerInfo),l=t.pendingProps,e===null?t.child=Ts(t,null,l,s):Vt(e,t,l,s),t.child;case 11:return Em(e,t,t.type,t.pendingProps,s);case 7:return Vt(e,t,t.pendingProps,s),t.child;case 8:return Vt(e,t,t.pendingProps.children,s),t.child;case 12:return Vt(e,t,t.pendingProps.children,s),t.child;case 10:return l=t.pendingProps,Oa(t,t.type,l.value),Vt(e,t,l.children,s),t.child;case 9:return c=t.type._context,l=t.pendingProps.children,bs(t),c=It(c),l=l(c),t.flags|=1,Vt(e,t,l,s),t.child;case 14:return Cm(e,t,t.type,t.pendingProps,s);case 15:return Am(e,t,t.type,t.pendingProps,s);case 19:return Bm(e,t,s);case 31:return ZS(e,t,s);case 22:return jm(e,t,s,t.pendingProps);case 24:return bs(t),l=It(Et),e===null?(c=Yc(),c===null&&(c=Je,f=Fc(),c.pooledCache=f,f.refCount++,f!==null&&(c.pooledCacheLanes|=s),c=f),t.memoizedState={parent:l,cache:c},Zc(t),Oa(t,Et,c)):((e.lanes&s)!==0&&(Xc(e,t),rl(t,null,null,s),ol()),c=e.memoizedState,f=t.memoizedState,c.parent!==l?(c={parent:l,cache:l},t.memoizedState=c,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=c),Oa(t,Et,l)):(l=f.cache,Oa(t,Et,l),l!==c.cache&&qc(t,[Et],s,!0))),Vt(e,t,t.pendingProps.children,s),t.child;case 29:throw t.pendingProps}throw Error(o(156,t.tag))}function pa(e){e.flags|=4}function ku(e,t,s,l,c){if((t=(e.mode&32)!==0)&&(t=!1),t){if(e.flags|=16777216,(c&335544128)===c)if(e.stateNode.complete)e.flags|=8192;else if(cg())e.flags|=8192;else throw xs=wo,Kc}else e.flags&=-16777217}function Um(e,t){if(t.type!=="stylesheet"||(t.state.loading&4)!==0)e.flags&=-16777217;else if(e.flags|=16777216,!Jg(t))if(cg())e.flags|=8192;else throw xs=wo,Kc}function $o(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag!==22?aa():536870912,e.lanes|=t,pi|=t)}function pl(e,t){if(!Le)switch(e.tailMode){case"hidden":t=e.tail;for(var s=null;t!==null;)t.alternate!==null&&(s=t),t=t.sibling;s===null?e.tail=null:s.sibling=null;break;case"collapsed":s=e.tail;for(var l=null;s!==null;)s.alternate!==null&&(l=s),s=s.sibling;l===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:l.sibling=null}}function nt(e){var t=e.alternate!==null&&e.alternate.child===e.child,s=0,l=0;if(t)for(var c=e.child;c!==null;)s|=c.lanes|c.childLanes,l|=c.subtreeFlags&65011712,l|=c.flags&65011712,c.return=e,c=c.sibling;else for(c=e.child;c!==null;)s|=c.lanes|c.childLanes,l|=c.subtreeFlags,l|=c.flags,c.return=e,c=c.sibling;return e.subtreeFlags|=l,e.childLanes=s,t}function QS(e,t,s){var l=t.pendingProps;switch(Ic(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return nt(t),null;case 1:return nt(t),null;case 3:return s=t.stateNode,l=null,e!==null&&(l=e.memoizedState.cache),t.memoizedState.cache!==l&&(t.flags|=2048),ua(Et),Ve(),s.pendingContext&&(s.context=s.pendingContext,s.pendingContext=null),(e===null||e.child===null)&&(ti(t)?pa(t):e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,Hc())),nt(t),null;case 26:var c=t.type,f=t.memoizedState;return e===null?(pa(t),f!==null?(nt(t),Um(t,f)):(nt(t),ku(t,c,null,l,s))):f?f!==e.memoizedState?(pa(t),nt(t),Um(t,f)):(nt(t),t.flags&=-16777217):(e=e.memoizedProps,e!==l&&pa(t),nt(t),ku(t,c,e,l,s)),null;case 27:if(Tt(t),s=K.current,c=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==l&&pa(t);else{if(!l){if(t.stateNode===null)throw Error(o(166));return nt(t),null}e=xe.current,ti(t)?gp(t):(e=qg(c,l,s),t.stateNode=e,pa(t))}return nt(t),null;case 5:if(Tt(t),c=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==l&&pa(t);else{if(!l){if(t.stateNode===null)throw Error(o(166));return nt(t),null}if(f=xe.current,ti(t))gp(t);else{var b=or(K.current);switch(f){case 1:f=b.createElementNS("http://www.w3.org/2000/svg",c);break;case 2:f=b.createElementNS("http://www.w3.org/1998/Math/MathML",c);break;default:switch(c){case"svg":f=b.createElementNS("http://www.w3.org/2000/svg",c);break;case"math":f=b.createElementNS("http://www.w3.org/1998/Math/MathML",c);break;case"script":f=b.createElement("div"),f.innerHTML="<script><\/script>",f=f.removeChild(f.firstChild);break;case"select":f=typeof l.is=="string"?b.createElement("select",{is:l.is}):b.createElement("select"),l.multiple?f.multiple=!0:l.size&&(f.size=l.size);break;default:f=typeof l.is=="string"?b.createElement(c,{is:l.is}):b.createElement(c)}}f[Ut]=t,f[nn]=l;e:for(b=t.child;b!==null;){if(b.tag===5||b.tag===6)f.appendChild(b.stateNode);else if(b.tag!==4&&b.tag!==27&&b.child!==null){b.child.return=b,b=b.child;continue}if(b===t)break e;for(;b.sibling===null;){if(b.return===null||b.return===t)break e;b=b.return}b.sibling.return=b.return,b=b.sibling}t.stateNode=f;e:switch(Ht(f,c,l),c){case"button":case"input":case"select":case"textarea":l=!!l.autoFocus;break e;case"img":l=!0;break e;default:l=!1}l&&pa(t)}}return nt(t),ku(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,s),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==l&&pa(t);else{if(typeof l!="string"&&t.stateNode===null)throw Error(o(166));if(e=K.current,ti(t)){if(e=t.stateNode,s=t.memoizedProps,l=null,c=zt,c!==null)switch(c.tag){case 27:case 5:l=c.memoizedProps}e[Ut]=t,e=!!(e.nodeValue===s||l!==null&&l.suppressHydrationWarning===!0||Rg(e.nodeValue,s)),e||Ra(t,!0)}else e=or(e).createTextNode(l),e[Ut]=t,t.stateNode=e}return nt(t),null;case 31:if(s=t.memoizedState,e===null||e.memoizedState!==null){if(l=ti(t),s!==null){if(e===null){if(!l)throw Error(o(318));if(e=t.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(o(557));e[Ut]=t}else ys(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;nt(t),e=!1}else s=Hc(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=s),e=!0;if(!e)return t.flags&256?(hn(t),t):(hn(t),null);if((t.flags&128)!==0)throw Error(o(558))}return nt(t),null;case 13:if(l=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(c=ti(t),l!==null&&l.dehydrated!==null){if(e===null){if(!c)throw Error(o(318));if(c=t.memoizedState,c=c!==null?c.dehydrated:null,!c)throw Error(o(317));c[Ut]=t}else ys(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;nt(t),c=!1}else c=Hc(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=c),c=!0;if(!c)return t.flags&256?(hn(t),t):(hn(t),null)}return hn(t),(t.flags&128)!==0?(t.lanes=s,t):(s=l!==null,e=e!==null&&e.memoizedState!==null,s&&(l=t.child,c=null,l.alternate!==null&&l.alternate.memoizedState!==null&&l.alternate.memoizedState.cachePool!==null&&(c=l.alternate.memoizedState.cachePool.pool),f=null,l.memoizedState!==null&&l.memoizedState.cachePool!==null&&(f=l.memoizedState.cachePool.pool),f!==c&&(l.flags|=2048)),s!==e&&s&&(t.child.flags|=8192),$o(t,t.updateQueue),nt(t),null);case 4:return Ve(),e===null&&Wu(t.stateNode.containerInfo),nt(t),null;case 10:return ua(t.type),nt(t),null;case 19:if(Ee(vt),l=t.memoizedState,l===null)return nt(t),null;if(c=(t.flags&128)!==0,f=l.rendering,f===null)if(c)pl(l,!1);else{if(ft!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(f=Ro(e),f!==null){for(t.flags|=128,pl(l,!1),e=f.updateQueue,t.updateQueue=e,$o(t,e),t.subtreeFlags=0,e=s,s=t.child;s!==null;)dp(s,e),s=s.sibling;return ye(vt,vt.current&1|2),Le&&ra(t,l.treeForkCount),t.child}e=e.sibling}l.tail!==null&&ue()>Qo&&(t.flags|=128,c=!0,pl(l,!1),t.lanes=4194304)}else{if(!c)if(e=Ro(f),e!==null){if(t.flags|=128,c=!0,e=e.updateQueue,t.updateQueue=e,$o(t,e),pl(l,!0),l.tail===null&&l.tailMode==="hidden"&&!f.alternate&&!Le)return nt(t),null}else 2*ue()-l.renderingStartTime>Qo&&s!==536870912&&(t.flags|=128,c=!0,pl(l,!1),t.lanes=4194304);l.isBackwards?(f.sibling=t.child,t.child=f):(e=l.last,e!==null?e.sibling=f:t.child=f,l.last=f)}return l.tail!==null?(e=l.tail,l.rendering=e,l.tail=e.sibling,l.renderingStartTime=ue(),e.sibling=null,s=vt.current,ye(vt,c?s&1|2:s&1),Le&&ra(t,l.treeForkCount),e):(nt(t),null);case 22:case 23:return hn(t),eu(),l=t.memoizedState!==null,e!==null?e.memoizedState!==null!==l&&(t.flags|=8192):l&&(t.flags|=8192),l?(s&536870912)!==0&&(t.flags&128)===0&&(nt(t),t.subtreeFlags&6&&(t.flags|=8192)):nt(t),s=t.updateQueue,s!==null&&$o(t,s.retryQueue),s=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(s=e.memoizedState.cachePool.pool),l=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(l=t.memoizedState.cachePool.pool),l!==s&&(t.flags|=2048),e!==null&&Ee(Ss),null;case 24:return s=null,e!==null&&(s=e.memoizedState.cache),t.memoizedState.cache!==s&&(t.flags|=2048),ua(Et),nt(t),null;case 25:return null;case 30:return null}throw Error(o(156,t.tag))}function JS(e,t){switch(Ic(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return ua(Et),Ve(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return Tt(t),null;case 31:if(t.memoizedState!==null){if(hn(t),t.alternate===null)throw Error(o(340));ys()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(hn(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(o(340));ys()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Ee(vt),null;case 4:return Ve(),null;case 10:return ua(t.type),null;case 22:case 23:return hn(t),eu(),e!==null&&Ee(Ss),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return ua(Et),null;case 25:return null;default:return null}}function zm(e,t){switch(Ic(t),t.tag){case 3:ua(Et),Ve();break;case 26:case 27:case 5:Tt(t);break;case 4:Ve();break;case 31:t.memoizedState!==null&&hn(t);break;case 13:hn(t);break;case 19:Ee(vt);break;case 10:ua(t.type);break;case 22:case 23:hn(t),eu(),e!==null&&Ee(Ss);break;case 24:ua(Et)}}function ml(e,t){try{var s=t.updateQueue,l=s!==null?s.lastEffect:null;if(l!==null){var c=l.next;s=c;do{if((s.tag&e)===e){l=void 0;var f=s.create,b=s.inst;l=f(),b.destroy=l}s=s.next}while(s!==c)}}catch(x){$e(t,t.return,x)}}function Va(e,t,s){try{var l=t.updateQueue,c=l!==null?l.lastEffect:null;if(c!==null){var f=c.next;l=f;do{if((l.tag&e)===e){var b=l.inst,x=b.destroy;if(x!==void 0){b.destroy=void 0,c=t;var N=s,L=x;try{L()}catch(F){$e(c,N,F)}}}l=l.next}while(l!==f)}}catch(F){$e(t,t.return,F)}}function Im(e){var t=e.updateQueue;if(t!==null){var s=e.stateNode;try{wp(t,s)}catch(l){$e(e,e.return,l)}}}function Vm(e,t,s){s.props=Cs(e.type,e.memoizedProps),s.state=e.memoizedState;try{s.componentWillUnmount()}catch(l){$e(e,t,l)}}function gl(e,t){try{var s=e.ref;if(s!==null){switch(e.tag){case 26:case 27:case 5:var l=e.stateNode;break;case 30:l=e.stateNode;break;default:l=e.stateNode}typeof s=="function"?e.refCleanup=s(l):s.current=l}}catch(c){$e(e,t,c)}}function Fn(e,t){var s=e.ref,l=e.refCleanup;if(s!==null)if(typeof l=="function")try{l()}catch(c){$e(e,t,c)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof s=="function")try{s(null)}catch(c){$e(e,t,c)}else s.current=null}function Hm(e){var t=e.type,s=e.memoizedProps,l=e.stateNode;try{e:switch(t){case"button":case"input":case"select":case"textarea":s.autoFocus&&l.focus();break e;case"img":s.src?l.src=s.src:s.srcSet&&(l.srcset=s.srcSet)}}catch(c){$e(e,e.return,c)}}function Mu(e,t,s){try{var l=e.stateNode;S_(l,e.type,s,t),l[nn]=t}catch(c){$e(e,e.return,c)}}function Pm(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&Ya(e.type)||e.tag===4}function Ru(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Pm(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.tag===27&&Ya(e.type)||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 Ou(e,t,s){var l=e.tag;if(l===5||l===6)e=e.stateNode,t?(s.nodeType===9?s.body:s.nodeName==="HTML"?s.ownerDocument.body:s).insertBefore(e,t):(t=s.nodeType===9?s.body:s.nodeName==="HTML"?s.ownerDocument.body:s,t.appendChild(e),s=s._reactRootContainer,s!=null||t.onclick!==null||(t.onclick=ia));else if(l!==4&&(l===27&&Ya(e.type)&&(s=e.stateNode,t=null),e=e.child,e!==null))for(Ou(e,t,s),e=e.sibling;e!==null;)Ou(e,t,s),e=e.sibling}function Yo(e,t,s){var l=e.tag;if(l===5||l===6)e=e.stateNode,t?s.insertBefore(e,t):s.appendChild(e);else if(l!==4&&(l===27&&Ya(e.type)&&(s=e.stateNode),e=e.child,e!==null))for(Yo(e,t,s),e=e.sibling;e!==null;)Yo(e,t,s),e=e.sibling}function Gm(e){var t=e.stateNode,s=e.memoizedProps;try{for(var l=e.type,c=t.attributes;c.length;)t.removeAttributeNode(c[0]);Ht(t,l,s),t[Ut]=e,t[nn]=s}catch(f){$e(e,e.return,f)}}var ma=!1,jt=!1,Bu=!1,qm=typeof WeakSet=="function"?WeakSet:Set,Ot=null;function WS(e,t){if(e=e.containerInfo,nd=pr,e=np(e),Nc(e)){if("selectionStart"in e)var s={start:e.selectionStart,end:e.selectionEnd};else e:{s=(s=e.ownerDocument)&&s.defaultView||window;var l=s.getSelection&&s.getSelection();if(l&&l.rangeCount!==0){s=l.anchorNode;var c=l.anchorOffset,f=l.focusNode;l=l.focusOffset;try{s.nodeType,f.nodeType}catch{s=null;break e}var b=0,x=-1,N=-1,L=0,F=0,X=e,z=null;t:for(;;){for(var P;X!==s||c!==0&&X.nodeType!==3||(x=b+c),X!==f||l!==0&&X.nodeType!==3||(N=b+l),X.nodeType===3&&(b+=X.nodeValue.length),(P=X.firstChild)!==null;)z=X,X=P;for(;;){if(X===e)break t;if(z===s&&++L===c&&(x=b),z===f&&++F===l&&(N=b),(P=X.nextSibling)!==null)break;X=z,z=X.parentNode}X=P}s=x===-1||N===-1?null:{start:x,end:N}}else s=null}s=s||{start:0,end:0}}else s=null;for(ad={focusedElem:e,selectionRange:s},pr=!1,Ot=t;Ot!==null;)if(t=Ot,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,Ot=e;else for(;Ot!==null;){switch(t=Ot,f=t.alternate,e=t.flags,t.tag){case 0:if((e&4)!==0&&(e=t.updateQueue,e=e!==null?e.events:null,e!==null))for(s=0;s<e.length;s++)c=e[s],c.ref.impl=c.nextImpl;break;case 11:case 15:break;case 1:if((e&1024)!==0&&f!==null){e=void 0,s=t,c=f.memoizedProps,f=f.memoizedState,l=s.stateNode;try{var le=Cs(s.type,c);e=l.getSnapshotBeforeUpdate(le,f),l.__reactInternalSnapshotBeforeUpdate=e}catch(pe){$e(s,s.return,pe)}}break;case 3:if((e&1024)!==0){if(e=t.stateNode.containerInfo,s=e.nodeType,s===9)ld(e);else if(s===1)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":ld(e);break;default:e.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((e&1024)!==0)throw Error(o(163))}if(e=t.sibling,e!==null){e.return=t.return,Ot=e;break}Ot=t.return}}function Fm(e,t,s){var l=s.flags;switch(s.tag){case 0:case 11:case 15:ya(e,s),l&4&&ml(5,s);break;case 1:if(ya(e,s),l&4)if(e=s.stateNode,t===null)try{e.componentDidMount()}catch(b){$e(s,s.return,b)}else{var c=Cs(s.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(c,t,e.__reactInternalSnapshotBeforeUpdate)}catch(b){$e(s,s.return,b)}}l&64&&Im(s),l&512&&gl(s,s.return);break;case 3:if(ya(e,s),l&64&&(e=s.updateQueue,e!==null)){if(t=null,s.child!==null)switch(s.child.tag){case 27:case 5:t=s.child.stateNode;break;case 1:t=s.child.stateNode}try{wp(e,t)}catch(b){$e(s,s.return,b)}}break;case 27:t===null&&l&4&&Gm(s);case 26:case 5:ya(e,s),t===null&&l&4&&Hm(s),l&512&&gl(s,s.return);break;case 12:ya(e,s);break;case 31:ya(e,s),l&4&&Km(e,s);break;case 13:ya(e,s),l&4&&Zm(e,s),l&64&&(e=s.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(s=r_.bind(null,s),N_(e,s))));break;case 22:if(l=s.memoizedState!==null||ma,!l){t=t!==null&&t.memoizedState!==null||jt,c=ma;var f=jt;ma=l,(jt=t)&&!f?va(e,s,(s.subtreeFlags&8772)!==0):ya(e,s),ma=c,jt=f}break;case 30:break;default:ya(e,s)}}function $m(e){var t=e.alternate;t!==null&&(e.alternate=null,$m(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&dc(t)),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}var lt=null,sn=!1;function ga(e,t,s){for(s=s.child;s!==null;)Ym(e,t,s),s=s.sibling}function Ym(e,t,s){if(We&&typeof We.onCommitFiberUnmount=="function")try{We.onCommitFiberUnmount(rt,s)}catch{}switch(s.tag){case 26:jt||Fn(s,t),ga(e,t,s),s.memoizedState?s.memoizedState.count--:s.stateNode&&(s=s.stateNode,s.parentNode.removeChild(s));break;case 27:jt||Fn(s,t);var l=lt,c=sn;Ya(s.type)&&(lt=s.stateNode,sn=!1),ga(e,t,s),Cl(s.stateNode),lt=l,sn=c;break;case 5:jt||Fn(s,t);case 6:if(l=lt,c=sn,lt=null,ga(e,t,s),lt=l,sn=c,lt!==null)if(sn)try{(lt.nodeType===9?lt.body:lt.nodeName==="HTML"?lt.ownerDocument.body:lt).removeChild(s.stateNode)}catch(f){$e(s,t,f)}else try{lt.removeChild(s.stateNode)}catch(f){$e(s,t,f)}break;case 18:lt!==null&&(sn?(e=lt,Ig(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,s.stateNode),xi(e)):Ig(lt,s.stateNode));break;case 4:l=lt,c=sn,lt=s.stateNode.containerInfo,sn=!0,ga(e,t,s),lt=l,sn=c;break;case 0:case 11:case 14:case 15:Va(2,s,t),jt||Va(4,s,t),ga(e,t,s);break;case 1:jt||(Fn(s,t),l=s.stateNode,typeof l.componentWillUnmount=="function"&&Vm(s,t,l)),ga(e,t,s);break;case 21:ga(e,t,s);break;case 22:jt=(l=jt)||s.memoizedState!==null,ga(e,t,s),jt=l;break;default:ga(e,t,s)}}function Km(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{xi(e)}catch(s){$e(t,t.return,s)}}}function Zm(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{xi(e)}catch(s){$e(t,t.return,s)}}function e_(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new qm),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new qm),t;default:throw Error(o(435,e.tag))}}function Ko(e,t){var s=e_(e);t.forEach(function(l){if(!s.has(l)){s.add(l);var c=c_.bind(null,e,l);l.then(c,c)}})}function ln(e,t){var s=t.deletions;if(s!==null)for(var l=0;l<s.length;l++){var c=s[l],f=e,b=t,x=b;e:for(;x!==null;){switch(x.tag){case 27:if(Ya(x.type)){lt=x.stateNode,sn=!1;break e}break;case 5:lt=x.stateNode,sn=!1;break e;case 3:case 4:lt=x.stateNode.containerInfo,sn=!0;break e}x=x.return}if(lt===null)throw Error(o(160));Ym(f,b,c),lt=null,sn=!1,f=c.alternate,f!==null&&(f.return=null),c.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)Xm(t,e),t=t.sibling}var In=null;function Xm(e,t){var s=e.alternate,l=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:ln(t,e),on(e),l&4&&(Va(3,e,e.return),ml(3,e),Va(5,e,e.return));break;case 1:ln(t,e),on(e),l&512&&(jt||s===null||Fn(s,s.return)),l&64&&ma&&(e=e.updateQueue,e!==null&&(l=e.callbacks,l!==null&&(s=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=s===null?l:s.concat(l))));break;case 26:var c=In;if(ln(t,e),on(e),l&512&&(jt||s===null||Fn(s,s.return)),l&4){var f=s!==null?s.memoizedState:null;if(l=e.memoizedState,s===null)if(l===null)if(e.stateNode===null){e:{l=e.type,s=e.memoizedProps,c=c.ownerDocument||c;t:switch(l){case"title":f=c.getElementsByTagName("title")[0],(!f||f[Gi]||f[Ut]||f.namespaceURI==="http://www.w3.org/2000/svg"||f.hasAttribute("itemprop"))&&(f=c.createElement(l),c.head.insertBefore(f,c.querySelector("head > title"))),Ht(f,l,s),f[Ut]=e,Rt(f),l=f;break e;case"link":var b=Xg("link","href",c).get(l+(s.href||""));if(b){for(var x=0;x<b.length;x++)if(f=b[x],f.getAttribute("href")===(s.href==null||s.href===""?null:s.href)&&f.getAttribute("rel")===(s.rel==null?null:s.rel)&&f.getAttribute("title")===(s.title==null?null:s.title)&&f.getAttribute("crossorigin")===(s.crossOrigin==null?null:s.crossOrigin)){b.splice(x,1);break t}}f=c.createElement(l),Ht(f,l,s),c.head.appendChild(f);break;case"meta":if(b=Xg("meta","content",c).get(l+(s.content||""))){for(x=0;x<b.length;x++)if(f=b[x],f.getAttribute("content")===(s.content==null?null:""+s.content)&&f.getAttribute("name")===(s.name==null?null:s.name)&&f.getAttribute("property")===(s.property==null?null:s.property)&&f.getAttribute("http-equiv")===(s.httpEquiv==null?null:s.httpEquiv)&&f.getAttribute("charset")===(s.charSet==null?null:s.charSet)){b.splice(x,1);break t}}f=c.createElement(l),Ht(f,l,s),c.head.appendChild(f);break;default:throw Error(o(468,l))}f[Ut]=e,Rt(f),l=f}e.stateNode=l}else Qg(c,e.type,e.stateNode);else e.stateNode=Zg(c,l,e.memoizedProps);else f!==l?(f===null?s.stateNode!==null&&(s=s.stateNode,s.parentNode.removeChild(s)):f.count--,l===null?Qg(c,e.type,e.stateNode):Zg(c,l,e.memoizedProps)):l===null&&e.stateNode!==null&&Mu(e,e.memoizedProps,s.memoizedProps)}break;case 27:ln(t,e),on(e),l&512&&(jt||s===null||Fn(s,s.return)),s!==null&&l&4&&Mu(e,e.memoizedProps,s.memoizedProps);break;case 5:if(ln(t,e),on(e),l&512&&(jt||s===null||Fn(s,s.return)),e.flags&32){c=e.stateNode;try{Fs(c,"")}catch(le){$e(e,e.return,le)}}l&4&&e.stateNode!=null&&(c=e.memoizedProps,Mu(e,c,s!==null?s.memoizedProps:c)),l&1024&&(Bu=!0);break;case 6:if(ln(t,e),on(e),l&4){if(e.stateNode===null)throw Error(o(162));l=e.memoizedProps,s=e.stateNode;try{s.nodeValue=l}catch(le){$e(e,e.return,le)}}break;case 3:if(ur=null,c=In,In=rr(t.containerInfo),ln(t,e),In=c,on(e),l&4&&s!==null&&s.memoizedState.isDehydrated)try{xi(t.containerInfo)}catch(le){$e(e,e.return,le)}Bu&&(Bu=!1,Qm(e));break;case 4:l=In,In=rr(e.stateNode.containerInfo),ln(t,e),on(e),In=l;break;case 12:ln(t,e),on(e);break;case 31:ln(t,e),on(e),l&4&&(l=e.updateQueue,l!==null&&(e.updateQueue=null,Ko(e,l)));break;case 13:ln(t,e),on(e),e.child.flags&8192&&e.memoizedState!==null!=(s!==null&&s.memoizedState!==null)&&(Xo=ue()),l&4&&(l=e.updateQueue,l!==null&&(e.updateQueue=null,Ko(e,l)));break;case 22:c=e.memoizedState!==null;var N=s!==null&&s.memoizedState!==null,L=ma,F=jt;if(ma=L||c,jt=F||N,ln(t,e),jt=F,ma=L,on(e),l&8192)e:for(t=e.stateNode,t._visibility=c?t._visibility&-2:t._visibility|1,c&&(s===null||N||ma||jt||As(e)),s=null,t=e;;){if(t.tag===5||t.tag===26){if(s===null){N=s=t;try{if(f=N.stateNode,c)b=f.style,typeof b.setProperty=="function"?b.setProperty("display","none","important"):b.display="none";else{x=N.stateNode;var X=N.memoizedProps.style,z=X!=null&&X.hasOwnProperty("display")?X.display:null;x.style.display=z==null||typeof z=="boolean"?"":(""+z).trim()}}catch(le){$e(N,N.return,le)}}}else if(t.tag===6){if(s===null){N=t;try{N.stateNode.nodeValue=c?"":N.memoizedProps}catch(le){$e(N,N.return,le)}}}else if(t.tag===18){if(s===null){N=t;try{var P=N.stateNode;c?Vg(P,!0):Vg(N.stateNode,!1)}catch(le){$e(N,N.return,le)}}}else if((t.tag!==22&&t.tag!==23||t.memoizedState===null||t===e)&&t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break e;for(;t.sibling===null;){if(t.return===null||t.return===e)break e;s===t&&(s=null),t=t.return}s===t&&(s=null),t.sibling.return=t.return,t=t.sibling}l&4&&(l=e.updateQueue,l!==null&&(s=l.retryQueue,s!==null&&(l.retryQueue=null,Ko(e,s))));break;case 19:ln(t,e),on(e),l&4&&(l=e.updateQueue,l!==null&&(e.updateQueue=null,Ko(e,l)));break;case 30:break;case 21:break;default:ln(t,e),on(e)}}function on(e){var t=e.flags;if(t&2){try{for(var s,l=e.return;l!==null;){if(Pm(l)){s=l;break}l=l.return}if(s==null)throw Error(o(160));switch(s.tag){case 27:var c=s.stateNode,f=Ru(e);Yo(e,f,c);break;case 5:var b=s.stateNode;s.flags&32&&(Fs(b,""),s.flags&=-33);var x=Ru(e);Yo(e,x,b);break;case 3:case 4:var N=s.stateNode.containerInfo,L=Ru(e);Ou(e,L,N);break;default:throw Error(o(161))}}catch(F){$e(e,e.return,F)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function Qm(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;Qm(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function ya(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)Fm(e,t.alternate,t),t=t.sibling}function As(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:Va(4,t,t.return),As(t);break;case 1:Fn(t,t.return);var s=t.stateNode;typeof s.componentWillUnmount=="function"&&Vm(t,t.return,s),As(t);break;case 27:Cl(t.stateNode);case 26:case 5:Fn(t,t.return),As(t);break;case 22:t.memoizedState===null&&As(t);break;case 30:As(t);break;default:As(t)}e=e.sibling}}function va(e,t,s){for(s=s&&(t.subtreeFlags&8772)!==0,t=t.child;t!==null;){var l=t.alternate,c=e,f=t,b=f.flags;switch(f.tag){case 0:case 11:case 15:va(c,f,s),ml(4,f);break;case 1:if(va(c,f,s),l=f,c=l.stateNode,typeof c.componentDidMount=="function")try{c.componentDidMount()}catch(L){$e(l,l.return,L)}if(l=f,c=l.updateQueue,c!==null){var x=l.stateNode;try{var N=c.shared.hiddenCallbacks;if(N!==null)for(c.shared.hiddenCallbacks=null,c=0;c<N.length;c++)Np(N[c],x)}catch(L){$e(l,l.return,L)}}s&&b&64&&Im(f),gl(f,f.return);break;case 27:Gm(f);case 26:case 5:va(c,f,s),s&&l===null&&b&4&&Hm(f),gl(f,f.return);break;case 12:va(c,f,s);break;case 31:va(c,f,s),s&&b&4&&Km(c,f);break;case 13:va(c,f,s),s&&b&4&&Zm(c,f);break;case 22:f.memoizedState===null&&va(c,f,s),gl(f,f.return);break;case 30:break;default:va(c,f,s)}t=t.sibling}}function Lu(e,t){var s=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(s=e.memoizedState.cachePool.pool),e=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(e=t.memoizedState.cachePool.pool),e!==s&&(e!=null&&e.refCount++,s!=null&&nl(s))}function Uu(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&nl(e))}function Vn(e,t,s,l){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)Jm(e,t,s,l),t=t.sibling}function Jm(e,t,s,l){var c=t.flags;switch(t.tag){case 0:case 11:case 15:Vn(e,t,s,l),c&2048&&ml(9,t);break;case 1:Vn(e,t,s,l);break;case 3:Vn(e,t,s,l),c&2048&&(e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&nl(e)));break;case 12:if(c&2048){Vn(e,t,s,l),e=t.stateNode;try{var f=t.memoizedProps,b=f.id,x=f.onPostCommit;typeof x=="function"&&x(b,t.alternate===null?"mount":"update",e.passiveEffectDuration,-0)}catch(N){$e(t,t.return,N)}}else Vn(e,t,s,l);break;case 31:Vn(e,t,s,l);break;case 13:Vn(e,t,s,l);break;case 23:break;case 22:f=t.stateNode,b=t.alternate,t.memoizedState!==null?f._visibility&2?Vn(e,t,s,l):yl(e,t):f._visibility&2?Vn(e,t,s,l):(f._visibility|=2,di(e,t,s,l,(t.subtreeFlags&10256)!==0||!1)),c&2048&&Lu(b,t);break;case 24:Vn(e,t,s,l),c&2048&&Uu(t.alternate,t);break;default:Vn(e,t,s,l)}}function di(e,t,s,l,c){for(c=c&&((t.subtreeFlags&10256)!==0||!1),t=t.child;t!==null;){var f=e,b=t,x=s,N=l,L=b.flags;switch(b.tag){case 0:case 11:case 15:di(f,b,x,N,c),ml(8,b);break;case 23:break;case 22:var F=b.stateNode;b.memoizedState!==null?F._visibility&2?di(f,b,x,N,c):yl(f,b):(F._visibility|=2,di(f,b,x,N,c)),c&&L&2048&&Lu(b.alternate,b);break;case 24:di(f,b,x,N,c),c&&L&2048&&Uu(b.alternate,b);break;default:di(f,b,x,N,c)}t=t.sibling}}function yl(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var s=e,l=t,c=l.flags;switch(l.tag){case 22:yl(s,l),c&2048&&Lu(l.alternate,l);break;case 24:yl(s,l),c&2048&&Uu(l.alternate,l);break;default:yl(s,l)}t=t.sibling}}var vl=8192;function fi(e,t,s){if(e.subtreeFlags&vl)for(e=e.child;e!==null;)Wm(e,t,s),e=e.sibling}function Wm(e,t,s){switch(e.tag){case 26:fi(e,t,s),e.flags&vl&&e.memoizedState!==null&&V_(s,In,e.memoizedState,e.memoizedProps);break;case 5:fi(e,t,s);break;case 3:case 4:var l=In;In=rr(e.stateNode.containerInfo),fi(e,t,s),In=l;break;case 22:e.memoizedState===null&&(l=e.alternate,l!==null&&l.memoizedState!==null?(l=vl,vl=16777216,fi(e,t,s),vl=l):fi(e,t,s));break;default:fi(e,t,s)}}function eg(e){var t=e.alternate;if(t!==null&&(e=t.child,e!==null)){t.child=null;do t=e.sibling,e.sibling=null,e=t;while(e!==null)}}function bl(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var s=0;s<t.length;s++){var l=t[s];Ot=l,ng(l,e)}eg(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)tg(e),e=e.sibling}function tg(e){switch(e.tag){case 0:case 11:case 15:bl(e),e.flags&2048&&Va(9,e,e.return);break;case 3:bl(e);break;case 12:bl(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,Zo(e)):bl(e);break;default:bl(e)}}function Zo(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var s=0;s<t.length;s++){var l=t[s];Ot=l,ng(l,e)}eg(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:Va(8,t,t.return),Zo(t);break;case 22:s=t.stateNode,s._visibility&2&&(s._visibility&=-3,Zo(t));break;default:Zo(t)}e=e.sibling}}function ng(e,t){for(;Ot!==null;){var s=Ot;switch(s.tag){case 0:case 11:case 15:Va(8,s,t);break;case 23:case 22:if(s.memoizedState!==null&&s.memoizedState.cachePool!==null){var l=s.memoizedState.cachePool.pool;l!=null&&l.refCount++}break;case 24:nl(s.memoizedState.cache)}if(l=s.child,l!==null)l.return=s,Ot=l;else e:for(s=e;Ot!==null;){l=Ot;var c=l.sibling,f=l.return;if($m(l),l===s){Ot=null;break e}if(c!==null){c.return=f,Ot=c;break e}Ot=f}}}var t_={getCacheForType:function(e){var t=It(Et),s=t.data.get(e);return s===void 0&&(s=e(),t.data.set(e,s)),s},cacheSignal:function(){return It(Et).controller.signal}},n_=typeof WeakMap=="function"?WeakMap:Map,He=0,Je=null,ke=null,Re=0,Fe=0,pn=null,Ha=!1,hi=!1,zu=!1,ba=0,ft=0,Pa=0,js=0,Iu=0,mn=0,pi=0,Sl=null,rn=null,Vu=!1,Xo=0,ag=0,Qo=1/0,Jo=null,Ga=null,Dt=0,qa=null,mi=null,Sa=0,Hu=0,Pu=null,sg=null,_l=0,Gu=null;function gn(){return(He&2)!==0&&Re!==0?Re&-Re:U.T!==null?Zu():Sh()}function ig(){if(mn===0)if((Re&536870912)===0||Le){var e=us;us<<=1,(us&3932160)===0&&(us=262144),mn=e}else mn=536870912;return e=fn.current,e!==null&&(e.flags|=32),mn}function cn(e,t,s){(e===Je&&(Fe===2||Fe===9)||e.cancelPendingCommit!==null)&&(gi(e,0),Fa(e,Re,mn,!1)),Pi(e,s),((He&2)===0||e!==Je)&&(e===Je&&((He&2)===0&&(js|=s),ft===4&&Fa(e,Re,mn,!1)),$n(e))}function lg(e,t,s){if((He&6)!==0)throw Error(o(327));var l=!s&&(t&127)===0&&(t&e.expiredLanes)===0||ie(e,t),c=l?i_(e,t):Fu(e,t,!0),f=l;do{if(c===0){hi&&!l&&Fa(e,t,0,!1);break}else{if(s=e.current.alternate,f&&!a_(s)){c=Fu(e,t,!1),f=!1;continue}if(c===2){if(f=t,e.errorRecoveryDisabledLanes&f)var b=0;else b=e.pendingLanes&-536870913,b=b!==0?b:b&536870912?536870912:0;if(b!==0){t=b;e:{var x=e;c=Sl;var N=x.current.memoizedState.isDehydrated;if(N&&(gi(x,b).flags|=256),b=Fu(x,b,!1),b!==2){if(zu&&!N){x.errorRecoveryDisabledLanes|=f,js|=f,c=4;break e}f=rn,rn=c,f!==null&&(rn===null?rn=f:rn.push.apply(rn,f))}c=b}if(f=!1,c!==2)continue}}if(c===1){gi(e,0),Fa(e,t,0,!0);break}e:{switch(l=e,f=c,f){case 0:case 1:throw Error(o(345));case 4:if((t&4194048)!==t)break;case 6:Fa(l,t,mn,!Ha);break e;case 2:rn=null;break;case 3:case 5:break;default:throw Error(o(329))}if((t&62914560)===t&&(c=Xo+300-ue(),10<c)){if(Fa(l,t,mn,!Ha),yt(l,0,!0)!==0)break e;Sa=t,l.timeoutHandle=Ug(og.bind(null,l,s,rn,Jo,Vu,t,mn,js,pi,Ha,f,"Throttled",-0,0),c);break e}og(l,s,rn,Jo,Vu,t,mn,js,pi,Ha,f,null,-0,0)}}break}while(!0);$n(e)}function og(e,t,s,l,c,f,b,x,N,L,F,X,z,P){if(e.timeoutHandle=-1,X=t.subtreeFlags,X&8192||(X&16785408)===16785408){X={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:ia},Wm(t,f,X);var le=(f&62914560)===f?Xo-ue():(f&4194048)===f?ag-ue():0;if(le=H_(X,le),le!==null){Sa=f,e.cancelPendingCommit=le(mg.bind(null,e,t,f,s,l,c,b,x,N,F,X,null,z,P)),Fa(e,f,b,!L);return}}mg(e,t,f,s,l,c,b,x,N)}function a_(e){for(var t=e;;){var s=t.tag;if((s===0||s===11||s===15)&&t.flags&16384&&(s=t.updateQueue,s!==null&&(s=s.stores,s!==null)))for(var l=0;l<s.length;l++){var c=s[l],f=c.getSnapshot;c=c.value;try{if(!un(f(),c))return!1}catch{return!1}}if(s=t.child,t.subtreeFlags&16384&&s!==null)s.return=t,t=s;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 Fa(e,t,s,l){t&=~Iu,t&=~js,e.suspendedLanes|=t,e.pingedLanes&=~t,l&&(e.warmLanes|=t),l=e.expirationTimes;for(var c=t;0<c;){var f=31-gt(c),b=1<<f;l[f]=-1,c&=~b}s!==0&&yh(e,s,t)}function Wo(){return(He&6)===0?(xl(0),!1):!0}function qu(){if(ke!==null){if(Fe===0)var e=ke.return;else e=ke,ca=vs=null,lu(e),li=null,sl=0,e=ke;for(;e!==null;)zm(e.alternate,e),e=e.return;ke=null}}function gi(e,t){var s=e.timeoutHandle;s!==-1&&(e.timeoutHandle=-1,T_(s)),s=e.cancelPendingCommit,s!==null&&(e.cancelPendingCommit=null,s()),Sa=0,qu(),Je=e,ke=s=oa(e.current,null),Re=t,Fe=0,pn=null,Ha=!1,hi=ie(e,t),zu=!1,pi=mn=Iu=js=Pa=ft=0,rn=Sl=null,Vu=!1,(t&8)!==0&&(t|=t&32);var l=e.entangledLanes;if(l!==0)for(e=e.entanglements,l&=t;0<l;){var c=31-gt(l),f=1<<c;t|=e[c],l&=~f}return ba=t,So(),s}function rg(e,t){Ce=null,U.H=fl,t===ii||t===No?(t=Ep(),Fe=3):t===Kc?(t=Ep(),Fe=4):Fe=t===xu?8:t!==null&&typeof t=="object"&&typeof t.then=="function"?6:1,pn=t,ke===null&&(ft=1,Po(e,En(t,e.current)))}function cg(){var e=fn.current;return e===null?!0:(Re&4194048)===Re?Nn===null:(Re&62914560)===Re||(Re&536870912)!==0?e===Nn:!1}function ug(){var e=U.H;return U.H=fl,e===null?fl:e}function dg(){var e=U.A;return U.A=t_,e}function er(){ft=4,Ha||(Re&4194048)!==Re&&fn.current!==null||(hi=!0),(Pa&134217727)===0&&(js&134217727)===0||Je===null||Fa(Je,Re,mn,!1)}function Fu(e,t,s){var l=He;He|=2;var c=ug(),f=dg();(Je!==e||Re!==t)&&(Jo=null,gi(e,t)),t=!1;var b=ft;e:do try{if(Fe!==0&&ke!==null){var x=ke,N=pn;switch(Fe){case 8:qu(),b=6;break e;case 3:case 2:case 9:case 6:fn.current===null&&(t=!0);var L=Fe;if(Fe=0,pn=null,yi(e,x,N,L),s&&hi){b=0;break e}break;default:L=Fe,Fe=0,pn=null,yi(e,x,N,L)}}s_(),b=ft;break}catch(F){rg(e,F)}while(!0);return t&&e.shellSuspendCounter++,ca=vs=null,He=l,U.H=c,U.A=f,ke===null&&(Je=null,Re=0,So()),b}function s_(){for(;ke!==null;)fg(ke)}function i_(e,t){var s=He;He|=2;var l=ug(),c=dg();Je!==e||Re!==t?(Jo=null,Qo=ue()+500,gi(e,t)):hi=ie(e,t);e:do try{if(Fe!==0&&ke!==null){t=ke;var f=pn;t:switch(Fe){case 1:Fe=0,pn=null,yi(e,t,f,1);break;case 2:case 9:if(xp(f)){Fe=0,pn=null,hg(t);break}t=function(){Fe!==2&&Fe!==9||Je!==e||(Fe=7),$n(e)},f.then(t,t);break e;case 3:Fe=7;break e;case 4:Fe=5;break e;case 7:xp(f)?(Fe=0,pn=null,hg(t)):(Fe=0,pn=null,yi(e,t,f,7));break;case 5:var b=null;switch(ke.tag){case 26:b=ke.memoizedState;case 5:case 27:var x=ke;if(b?Jg(b):x.stateNode.complete){Fe=0,pn=null;var N=x.sibling;if(N!==null)ke=N;else{var L=x.return;L!==null?(ke=L,tr(L)):ke=null}break t}}Fe=0,pn=null,yi(e,t,f,5);break;case 6:Fe=0,pn=null,yi(e,t,f,6);break;case 8:qu(),ft=6;break e;default:throw Error(o(462))}}l_();break}catch(F){rg(e,F)}while(!0);return ca=vs=null,U.H=l,U.A=c,He=s,ke!==null?0:(Je=null,Re=0,So(),ft)}function l_(){for(;ke!==null&&!ne();)fg(ke)}function fg(e){var t=Lm(e.alternate,e,ba);e.memoizedProps=e.pendingProps,t===null?tr(e):ke=t}function hg(e){var t=e,s=t.alternate;switch(t.tag){case 15:case 0:t=Dm(s,t,t.pendingProps,t.type,void 0,Re);break;case 11:t=Dm(s,t,t.pendingProps,t.type.render,t.ref,Re);break;case 5:lu(t);default:zm(s,t),t=ke=dp(t,ba),t=Lm(s,t,ba)}e.memoizedProps=e.pendingProps,t===null?tr(e):ke=t}function yi(e,t,s,l){ca=vs=null,lu(t),li=null,sl=0;var c=t.return;try{if(KS(e,c,t,s,Re)){ft=1,Po(e,En(s,e.current)),ke=null;return}}catch(f){if(c!==null)throw ke=c,f;ft=1,Po(e,En(s,e.current)),ke=null;return}t.flags&32768?(Le||l===1?e=!0:hi||(Re&536870912)!==0?e=!1:(Ha=e=!0,(l===2||l===9||l===3||l===6)&&(l=fn.current,l!==null&&l.tag===13&&(l.flags|=16384))),pg(t,e)):tr(t)}function tr(e){var t=e;do{if((t.flags&32768)!==0){pg(t,Ha);return}e=t.return;var s=QS(t.alternate,t,ba);if(s!==null){ke=s;return}if(t=t.sibling,t!==null){ke=t;return}ke=t=e}while(t!==null);ft===0&&(ft=5)}function pg(e,t){do{var s=JS(e.alternate,e);if(s!==null){s.flags&=32767,ke=s;return}if(s=e.return,s!==null&&(s.flags|=32768,s.subtreeFlags=0,s.deletions=null),!t&&(e=e.sibling,e!==null)){ke=e;return}ke=e=s}while(e!==null);ft=6,ke=null}function mg(e,t,s,l,c,f,b,x,N){e.cancelPendingCommit=null;do nr();while(Dt!==0);if((He&6)!==0)throw Error(o(327));if(t!==null){if(t===e.current)throw Error(o(177));if(f=t.lanes|t.childLanes,f|=Rc,I1(e,s,f,b,x,N),e===Je&&(ke=Je=null,Re=0),mi=t,qa=e,Sa=s,Hu=f,Pu=c,sg=l,(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?(e.callbackNode=null,e.callbackPriority=0,u_(De,function(){return Sg(),null})):(e.callbackNode=null,e.callbackPriority=0),l=(t.flags&13878)!==0,(t.subtreeFlags&13878)!==0||l){l=U.T,U.T=null,c=Q.p,Q.p=2,b=He,He|=4;try{WS(e,t,s)}finally{He=b,Q.p=c,U.T=l}}Dt=1,gg(),yg(),vg()}}function gg(){if(Dt===1){Dt=0;var e=qa,t=mi,s=(t.flags&13878)!==0;if((t.subtreeFlags&13878)!==0||s){s=U.T,U.T=null;var l=Q.p;Q.p=2;var c=He;He|=4;try{Xm(t,e);var f=ad,b=np(e.containerInfo),x=f.focusedElem,N=f.selectionRange;if(b!==x&&x&&x.ownerDocument&&tp(x.ownerDocument.documentElement,x)){if(N!==null&&Nc(x)){var L=N.start,F=N.end;if(F===void 0&&(F=L),"selectionStart"in x)x.selectionStart=L,x.selectionEnd=Math.min(F,x.value.length);else{var X=x.ownerDocument||document,z=X&&X.defaultView||window;if(z.getSelection){var P=z.getSelection(),le=x.textContent.length,pe=Math.min(N.start,le),Ze=N.end===void 0?pe:Math.min(N.end,le);!P.extend&&pe>Ze&&(b=Ze,Ze=pe,pe=b);var M=ep(x,pe),w=ep(x,Ze);if(M&&w&&(P.rangeCount!==1||P.anchorNode!==M.node||P.anchorOffset!==M.offset||P.focusNode!==w.node||P.focusOffset!==w.offset)){var B=X.createRange();B.setStart(M.node,M.offset),P.removeAllRanges(),pe>Ze?(P.addRange(B),P.extend(w.node,w.offset)):(B.setEnd(w.node,w.offset),P.addRange(B))}}}}for(X=[],P=x;P=P.parentNode;)P.nodeType===1&&X.push({element:P,left:P.scrollLeft,top:P.scrollTop});for(typeof x.focus=="function"&&x.focus(),x=0;x<X.length;x++){var Z=X[x];Z.element.scrollLeft=Z.left,Z.element.scrollTop=Z.top}}pr=!!nd,ad=nd=null}finally{He=c,Q.p=l,U.T=s}}e.current=t,Dt=2}}function yg(){if(Dt===2){Dt=0;var e=qa,t=mi,s=(t.flags&8772)!==0;if((t.subtreeFlags&8772)!==0||s){s=U.T,U.T=null;var l=Q.p;Q.p=2;var c=He;He|=4;try{Fm(e,t.alternate,t)}finally{He=c,Q.p=l,U.T=s}}Dt=3}}function vg(){if(Dt===4||Dt===3){Dt=0,oe();var e=qa,t=mi,s=Sa,l=sg;(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?Dt=5:(Dt=0,mi=qa=null,bg(e,e.pendingLanes));var c=e.pendingLanes;if(c===0&&(Ga=null),cc(s),t=t.stateNode,We&&typeof We.onCommitFiberRoot=="function")try{We.onCommitFiberRoot(rt,t,void 0,(t.current.flags&128)===128)}catch{}if(l!==null){t=U.T,c=Q.p,Q.p=2,U.T=null;try{for(var f=e.onRecoverableError,b=0;b<l.length;b++){var x=l[b];f(x.value,{componentStack:x.stack})}}finally{U.T=t,Q.p=c}}(Sa&3)!==0&&nr(),$n(e),c=e.pendingLanes,(s&261930)!==0&&(c&42)!==0?e===Gu?_l++:(_l=0,Gu=e):_l=0,xl(0)}}function bg(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,nl(t)))}function nr(){return gg(),yg(),vg(),Sg()}function Sg(){if(Dt!==5)return!1;var e=qa,t=Hu;Hu=0;var s=cc(Sa),l=U.T,c=Q.p;try{Q.p=32>s?32:s,U.T=null,s=Pu,Pu=null;var f=qa,b=Sa;if(Dt=0,mi=qa=null,Sa=0,(He&6)!==0)throw Error(o(331));var x=He;if(He|=4,tg(f.current),Jm(f,f.current,b,s),He=x,xl(0,!1),We&&typeof We.onPostCommitFiberRoot=="function")try{We.onPostCommitFiberRoot(rt,f)}catch{}return!0}finally{Q.p=c,U.T=l,bg(e,t)}}function _g(e,t,s){t=En(s,t),t=_u(e.stateNode,t,2),e=Ua(e,t,2),e!==null&&(Pi(e,2),$n(e))}function $e(e,t,s){if(e.tag===3)_g(e,e,s);else for(;t!==null;){if(t.tag===3){_g(t,e,s);break}else if(t.tag===1){var l=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof l.componentDidCatch=="function"&&(Ga===null||!Ga.has(l))){e=En(s,e),s=xm(2),l=Ua(t,s,2),l!==null&&(Tm(s,l,t,e),Pi(l,2),$n(l));break}}t=t.return}}function $u(e,t,s){var l=e.pingCache;if(l===null){l=e.pingCache=new n_;var c=new Set;l.set(t,c)}else c=l.get(t),c===void 0&&(c=new Set,l.set(t,c));c.has(s)||(zu=!0,c.add(s),e=o_.bind(null,e,t,s),t.then(e,e))}function o_(e,t,s){var l=e.pingCache;l!==null&&l.delete(t),e.pingedLanes|=e.suspendedLanes&s,e.warmLanes&=~s,Je===e&&(Re&s)===s&&(ft===4||ft===3&&(Re&62914560)===Re&&300>ue()-Xo?(He&2)===0&&gi(e,0):Iu|=s,pi===Re&&(pi=0)),$n(e)}function xg(e,t){t===0&&(t=aa()),e=ms(e,t),e!==null&&(Pi(e,t),$n(e))}function r_(e){var t=e.memoizedState,s=0;t!==null&&(s=t.retryLane),xg(e,s)}function c_(e,t){var s=0;switch(e.tag){case 31:case 13:var l=e.stateNode,c=e.memoizedState;c!==null&&(s=c.retryLane);break;case 19:l=e.stateNode;break;case 22:l=e.stateNode._retryCache;break;default:throw Error(o(314))}l!==null&&l.delete(t),xg(e,s)}function u_(e,t){return ta(e,t)}var ar=null,vi=null,Yu=!1,sr=!1,Ku=!1,$a=0;function $n(e){e!==vi&&e.next===null&&(vi===null?ar=vi=e:vi=vi.next=e),sr=!0,Yu||(Yu=!0,f_())}function xl(e,t){if(!Ku&&sr){Ku=!0;do for(var s=!1,l=ar;l!==null;){if(e!==0){var c=l.pendingLanes;if(c===0)var f=0;else{var b=l.suspendedLanes,x=l.pingedLanes;f=(1<<31-gt(42|e)+1)-1,f&=c&~(b&~x),f=f&201326741?f&201326741|1:f?f|2:0}f!==0&&(s=!0,Ag(l,f))}else f=Re,f=yt(l,l===Je?f:0,l.cancelPendingCommit!==null||l.timeoutHandle!==-1),(f&3)===0||ie(l,f)||(s=!0,Ag(l,f));l=l.next}while(s);Ku=!1}}function d_(){Tg()}function Tg(){sr=Yu=!1;var e=0;$a!==0&&x_()&&(e=$a);for(var t=ue(),s=null,l=ar;l!==null;){var c=l.next,f=Eg(l,t);f===0?(l.next=null,s===null?ar=c:s.next=c,c===null&&(vi=s)):(s=l,(e!==0||(f&3)!==0)&&(sr=!0)),l=c}Dt!==0&&Dt!==5||xl(e),$a!==0&&($a=0)}function Eg(e,t){for(var s=e.suspendedLanes,l=e.pingedLanes,c=e.expirationTimes,f=e.pendingLanes&-62914561;0<f;){var b=31-gt(f),x=1<<b,N=c[b];N===-1?((x&s)===0||(x&l)!==0)&&(c[b]=Lt(x,t)):N<=t&&(e.expiredLanes|=x),f&=~x}if(t=Je,s=Re,s=yt(e,e===t?s:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),l=e.callbackNode,s===0||e===t&&(Fe===2||Fe===9)||e.cancelPendingCommit!==null)return l!==null&&l!==null&&J(l),e.callbackNode=null,e.callbackPriority=0;if((s&3)===0||ie(e,s)){if(t=s&-s,t===e.callbackPriority)return t;switch(l!==null&&J(l),cc(s)){case 2:case 8:s=Qe;break;case 32:s=De;break;case 268435456:s=wt;break;default:s=De}return l=Cg.bind(null,e),s=ta(s,l),e.callbackPriority=t,e.callbackNode=s,t}return l!==null&&l!==null&&J(l),e.callbackPriority=2,e.callbackNode=null,2}function Cg(e,t){if(Dt!==0&&Dt!==5)return e.callbackNode=null,e.callbackPriority=0,null;var s=e.callbackNode;if(nr()&&e.callbackNode!==s)return null;var l=Re;return l=yt(e,e===Je?l:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),l===0?null:(lg(e,l,t),Eg(e,ue()),e.callbackNode!=null&&e.callbackNode===s?Cg.bind(null,e):null)}function Ag(e,t){if(nr())return null;lg(e,t,!0)}function f_(){E_(function(){(He&6)!==0?ta(Te,d_):Tg()})}function Zu(){if($a===0){var e=ai;e===0&&(e=na,na<<=1,(na&261888)===0&&(na=256)),$a=e}return $a}function jg(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:fo(""+e)}function Ng(e,t){var s=t.ownerDocument.createElement("input");return s.name=t.name,s.value=t.value,e.id&&s.setAttribute("form",e.id),t.parentNode.insertBefore(s,t),e=new FormData(e),s.parentNode.removeChild(s),e}function h_(e,t,s,l,c){if(t==="submit"&&s&&s.stateNode===c){var f=jg((c[nn]||null).action),b=l.submitter;b&&(t=(t=b[nn]||null)?jg(t.formAction):b.getAttribute("formAction"),t!==null&&(f=t,b=null));var x=new go("action","action",null,l,c);e.push({event:x,listeners:[{instance:null,listener:function(){if(l.defaultPrevented){if($a!==0){var N=b?Ng(c,b):new FormData(c);mu(s,{pending:!0,data:N,method:c.method,action:f},null,N)}}else typeof f=="function"&&(x.preventDefault(),N=b?Ng(c,b):new FormData(c),mu(s,{pending:!0,data:N,method:c.method,action:f},f,N))},currentTarget:c}]})}}for(var Xu=0;Xu<Mc.length;Xu++){var Qu=Mc[Xu],p_=Qu.toLowerCase(),m_=Qu[0].toUpperCase()+Qu.slice(1);zn(p_,"on"+m_)}zn(ip,"onAnimationEnd"),zn(lp,"onAnimationIteration"),zn(op,"onAnimationStart"),zn("dblclick","onDoubleClick"),zn("focusin","onFocus"),zn("focusout","onBlur"),zn(kS,"onTransitionRun"),zn(MS,"onTransitionStart"),zn(RS,"onTransitionCancel"),zn(rp,"onTransitionEnd"),Gs("onMouseEnter",["mouseout","mouseover"]),Gs("onMouseLeave",["mouseout","mouseover"]),Gs("onPointerEnter",["pointerout","pointerover"]),Gs("onPointerLeave",["pointerout","pointerover"]),ds("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),ds("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),ds("onBeforeInput",["compositionend","keypress","textInput","paste"]),ds("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),ds("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),ds("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Tl="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(" "),g_=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Tl));function wg(e,t){t=(t&4)!==0;for(var s=0;s<e.length;s++){var l=e[s],c=l.event;l=l.listeners;e:{var f=void 0;if(t)for(var b=l.length-1;0<=b;b--){var x=l[b],N=x.instance,L=x.currentTarget;if(x=x.listener,N!==f&&c.isPropagationStopped())break e;f=x,c.currentTarget=L;try{f(c)}catch(F){bo(F)}c.currentTarget=null,f=N}else for(b=0;b<l.length;b++){if(x=l[b],N=x.instance,L=x.currentTarget,x=x.listener,N!==f&&c.isPropagationStopped())break e;f=x,c.currentTarget=L;try{f(c)}catch(F){bo(F)}c.currentTarget=null,f=N}}}}function Me(e,t){var s=t[uc];s===void 0&&(s=t[uc]=new Set);var l=e+"__bubble";s.has(l)||(Dg(t,e,2,!1),s.add(l))}function Ju(e,t,s){var l=0;t&&(l|=4),Dg(s,e,l,t)}var ir="_reactListening"+Math.random().toString(36).slice(2);function Wu(e){if(!e[ir]){e[ir]=!0,Th.forEach(function(s){s!=="selectionchange"&&(g_.has(s)||Ju(s,!1,e),Ju(s,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[ir]||(t[ir]=!0,Ju("selectionchange",!1,t))}}function Dg(e,t,s,l){switch(iy(t)){case 2:var c=q_;break;case 8:c=F_;break;default:c=pd}s=c.bind(null,t,s,e),c=void 0,!bc||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(c=!0),l?c!==void 0?e.addEventListener(t,s,{capture:!0,passive:c}):e.addEventListener(t,s,!0):c!==void 0?e.addEventListener(t,s,{passive:c}):e.addEventListener(t,s,!1)}function ed(e,t,s,l,c){var f=l;if((t&1)===0&&(t&2)===0&&l!==null)e:for(;;){if(l===null)return;var b=l.tag;if(b===3||b===4){var x=l.stateNode.containerInfo;if(x===c)break;if(b===4)for(b=l.return;b!==null;){var N=b.tag;if((N===3||N===4)&&b.stateNode.containerInfo===c)return;b=b.return}for(;x!==null;){if(b=Vs(x),b===null)return;if(N=b.tag,N===5||N===6||N===26||N===27){l=f=b;continue e}x=x.parentNode}}l=l.return}Bh(function(){var L=f,F=yc(s),X=[];e:{var z=cp.get(e);if(z!==void 0){var P=go,le=e;switch(e){case"keypress":if(po(s)===0)break e;case"keydown":case"keyup":P=cS;break;case"focusin":le="focus",P=Tc;break;case"focusout":le="blur",P=Tc;break;case"beforeblur":case"afterblur":P=Tc;break;case"click":if(s.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":P=zh;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":P=Q1;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":P=fS;break;case ip:case lp:case op:P=eS;break;case rp:P=pS;break;case"scroll":case"scrollend":P=Z1;break;case"wheel":P=gS;break;case"copy":case"cut":case"paste":P=nS;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":P=Vh;break;case"toggle":case"beforetoggle":P=vS}var pe=(t&4)!==0,Ze=!pe&&(e==="scroll"||e==="scrollend"),M=pe?z!==null?z+"Capture":null:z;pe=[];for(var w=L,B;w!==null;){var Z=w;if(B=Z.stateNode,Z=Z.tag,Z!==5&&Z!==26&&Z!==27||B===null||M===null||(Z=Fi(w,M),Z!=null&&pe.push(El(w,Z,B))),Ze)break;w=w.return}0<pe.length&&(z=new P(z,le,null,s,F),X.push({event:z,listeners:pe}))}}if((t&7)===0){e:{if(z=e==="mouseover"||e==="pointerover",P=e==="mouseout"||e==="pointerout",z&&s!==gc&&(le=s.relatedTarget||s.fromElement)&&(Vs(le)||le[Is]))break e;if((P||z)&&(z=F.window===F?F:(z=F.ownerDocument)?z.defaultView||z.parentWindow:window,P?(le=s.relatedTarget||s.toElement,P=L,le=le?Vs(le):null,le!==null&&(Ze=u(le),pe=le.tag,le!==Ze||pe!==5&&pe!==27&&pe!==6)&&(le=null)):(P=null,le=L),P!==le)){if(pe=zh,Z="onMouseLeave",M="onMouseEnter",w="mouse",(e==="pointerout"||e==="pointerover")&&(pe=Vh,Z="onPointerLeave",M="onPointerEnter",w="pointer"),Ze=P==null?z:qi(P),B=le==null?z:qi(le),z=new pe(Z,w+"leave",P,s,F),z.target=Ze,z.relatedTarget=B,Z=null,Vs(F)===L&&(pe=new pe(M,w+"enter",le,s,F),pe.target=B,pe.relatedTarget=Ze,Z=pe),Ze=Z,P&&le)t:{for(pe=y_,M=P,w=le,B=0,Z=M;Z;Z=pe(Z))B++;Z=0;for(var he=w;he;he=pe(he))Z++;for(;0<B-Z;)M=pe(M),B--;for(;0<Z-B;)w=pe(w),Z--;for(;B--;){if(M===w||w!==null&&M===w.alternate){pe=M;break t}M=pe(M),w=pe(w)}pe=null}else pe=null;P!==null&&kg(X,z,P,pe,!1),le!==null&&Ze!==null&&kg(X,Ze,le,pe,!0)}}e:{if(z=L?qi(L):window,P=z.nodeName&&z.nodeName.toLowerCase(),P==="select"||P==="input"&&z.type==="file")var ze=Kh;else if($h(z))if(Zh)ze=NS;else{ze=AS;var de=CS}else P=z.nodeName,!P||P.toLowerCase()!=="input"||z.type!=="checkbox"&&z.type!=="radio"?L&&mc(L.elementType)&&(ze=Kh):ze=jS;if(ze&&(ze=ze(e,L))){Yh(X,ze,s,F);break e}de&&de(e,z,L),e==="focusout"&&L&&z.type==="number"&&L.memoizedProps.value!=null&&pc(z,"number",z.value)}switch(de=L?qi(L):window,e){case"focusin":($h(de)||de.contentEditable==="true")&&(Zs=de,wc=L,Wi=null);break;case"focusout":Wi=wc=Zs=null;break;case"mousedown":Dc=!0;break;case"contextmenu":case"mouseup":case"dragend":Dc=!1,ap(X,s,F);break;case"selectionchange":if(DS)break;case"keydown":case"keyup":ap(X,s,F)}var Ne;if(Cc)e:{switch(e){case"compositionstart":var Oe="onCompositionStart";break e;case"compositionend":Oe="onCompositionEnd";break e;case"compositionupdate":Oe="onCompositionUpdate";break e}Oe=void 0}else Ks?qh(e,s)&&(Oe="onCompositionEnd"):e==="keydown"&&s.keyCode===229&&(Oe="onCompositionStart");Oe&&(Hh&&s.locale!=="ko"&&(Ks||Oe!=="onCompositionStart"?Oe==="onCompositionEnd"&&Ks&&(Ne=Lh()):(Da=F,Sc="value"in Da?Da.value:Da.textContent,Ks=!0)),de=lr(L,Oe),0<de.length&&(Oe=new Ih(Oe,e,null,s,F),X.push({event:Oe,listeners:de}),Ne?Oe.data=Ne:(Ne=Fh(s),Ne!==null&&(Oe.data=Ne)))),(Ne=SS?_S(e,s):xS(e,s))&&(Oe=lr(L,"onBeforeInput"),0<Oe.length&&(de=new Ih("onBeforeInput","beforeinput",null,s,F),X.push({event:de,listeners:Oe}),de.data=Ne)),h_(X,e,L,s,F)}wg(X,t)})}function El(e,t,s){return{instance:e,listener:t,currentTarget:s}}function lr(e,t){for(var s=t+"Capture",l=[];e!==null;){var c=e,f=c.stateNode;if(c=c.tag,c!==5&&c!==26&&c!==27||f===null||(c=Fi(e,s),c!=null&&l.unshift(El(e,c,f)),c=Fi(e,t),c!=null&&l.push(El(e,c,f))),e.tag===3)return l;e=e.return}return[]}function y_(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function kg(e,t,s,l,c){for(var f=t._reactName,b=[];s!==null&&s!==l;){var x=s,N=x.alternate,L=x.stateNode;if(x=x.tag,N!==null&&N===l)break;x!==5&&x!==26&&x!==27||L===null||(N=L,c?(L=Fi(s,f),L!=null&&b.unshift(El(s,L,N))):c||(L=Fi(s,f),L!=null&&b.push(El(s,L,N)))),s=s.return}b.length!==0&&e.push({event:t,listeners:b})}var v_=/\r\n?/g,b_=/\u0000|\uFFFD/g;function Mg(e){return(typeof e=="string"?e:""+e).replace(v_,`
25
- `).replace(b_,"")}function Rg(e,t){return t=Mg(t),Mg(e)===t}function Ke(e,t,s,l,c,f){switch(s){case"children":typeof l=="string"?t==="body"||t==="textarea"&&l===""||Fs(e,l):(typeof l=="number"||typeof l=="bigint")&&t!=="body"&&Fs(e,""+l);break;case"className":co(e,"class",l);break;case"tabIndex":co(e,"tabindex",l);break;case"dir":case"role":case"viewBox":case"width":case"height":co(e,s,l);break;case"style":Rh(e,l,f);break;case"data":if(t!=="object"){co(e,"data",l);break}case"src":case"href":if(l===""&&(t!=="a"||s!=="href")){e.removeAttribute(s);break}if(l==null||typeof l=="function"||typeof l=="symbol"||typeof l=="boolean"){e.removeAttribute(s);break}l=fo(""+l),e.setAttribute(s,l);break;case"action":case"formAction":if(typeof l=="function"){e.setAttribute(s,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof f=="function"&&(s==="formAction"?(t!=="input"&&Ke(e,t,"name",c.name,c,null),Ke(e,t,"formEncType",c.formEncType,c,null),Ke(e,t,"formMethod",c.formMethod,c,null),Ke(e,t,"formTarget",c.formTarget,c,null)):(Ke(e,t,"encType",c.encType,c,null),Ke(e,t,"method",c.method,c,null),Ke(e,t,"target",c.target,c,null)));if(l==null||typeof l=="symbol"||typeof l=="boolean"){e.removeAttribute(s);break}l=fo(""+l),e.setAttribute(s,l);break;case"onClick":l!=null&&(e.onclick=ia);break;case"onScroll":l!=null&&Me("scroll",e);break;case"onScrollEnd":l!=null&&Me("scrollend",e);break;case"dangerouslySetInnerHTML":if(l!=null){if(typeof l!="object"||!("__html"in l))throw Error(o(61));if(s=l.__html,s!=null){if(c.children!=null)throw Error(o(60));e.innerHTML=s}}break;case"multiple":e.multiple=l&&typeof l!="function"&&typeof l!="symbol";break;case"muted":e.muted=l&&typeof l!="function"&&typeof l!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(l==null||typeof l=="function"||typeof l=="boolean"||typeof l=="symbol"){e.removeAttribute("xlink:href");break}s=fo(""+l),e.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",s);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":l!=null&&typeof l!="function"&&typeof l!="symbol"?e.setAttribute(s,""+l):e.removeAttribute(s);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":l&&typeof l!="function"&&typeof l!="symbol"?e.setAttribute(s,""):e.removeAttribute(s);break;case"capture":case"download":l===!0?e.setAttribute(s,""):l!==!1&&l!=null&&typeof l!="function"&&typeof l!="symbol"?e.setAttribute(s,l):e.removeAttribute(s);break;case"cols":case"rows":case"size":case"span":l!=null&&typeof l!="function"&&typeof l!="symbol"&&!isNaN(l)&&1<=l?e.setAttribute(s,l):e.removeAttribute(s);break;case"rowSpan":case"start":l==null||typeof l=="function"||typeof l=="symbol"||isNaN(l)?e.removeAttribute(s):e.setAttribute(s,l);break;case"popover":Me("beforetoggle",e),Me("toggle",e),ro(e,"popover",l);break;case"xlinkActuate":sa(e,"http://www.w3.org/1999/xlink","xlink:actuate",l);break;case"xlinkArcrole":sa(e,"http://www.w3.org/1999/xlink","xlink:arcrole",l);break;case"xlinkRole":sa(e,"http://www.w3.org/1999/xlink","xlink:role",l);break;case"xlinkShow":sa(e,"http://www.w3.org/1999/xlink","xlink:show",l);break;case"xlinkTitle":sa(e,"http://www.w3.org/1999/xlink","xlink:title",l);break;case"xlinkType":sa(e,"http://www.w3.org/1999/xlink","xlink:type",l);break;case"xmlBase":sa(e,"http://www.w3.org/XML/1998/namespace","xml:base",l);break;case"xmlLang":sa(e,"http://www.w3.org/XML/1998/namespace","xml:lang",l);break;case"xmlSpace":sa(e,"http://www.w3.org/XML/1998/namespace","xml:space",l);break;case"is":ro(e,"is",l);break;case"innerText":case"textContent":break;default:(!(2<s.length)||s[0]!=="o"&&s[0]!=="O"||s[1]!=="n"&&s[1]!=="N")&&(s=Y1.get(s)||s,ro(e,s,l))}}function td(e,t,s,l,c,f){switch(s){case"style":Rh(e,l,f);break;case"dangerouslySetInnerHTML":if(l!=null){if(typeof l!="object"||!("__html"in l))throw Error(o(61));if(s=l.__html,s!=null){if(c.children!=null)throw Error(o(60));e.innerHTML=s}}break;case"children":typeof l=="string"?Fs(e,l):(typeof l=="number"||typeof l=="bigint")&&Fs(e,""+l);break;case"onScroll":l!=null&&Me("scroll",e);break;case"onScrollEnd":l!=null&&Me("scrollend",e);break;case"onClick":l!=null&&(e.onclick=ia);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!Eh.hasOwnProperty(s))e:{if(s[0]==="o"&&s[1]==="n"&&(c=s.endsWith("Capture"),t=s.slice(2,c?s.length-7:void 0),f=e[nn]||null,f=f!=null?f[s]:null,typeof f=="function"&&e.removeEventListener(t,f,c),typeof l=="function")){typeof f!="function"&&f!==null&&(s in e?e[s]=null:e.hasAttribute(s)&&e.removeAttribute(s)),e.addEventListener(t,l,c);break e}s in e?e[s]=l:l===!0?e.setAttribute(s,""):ro(e,s,l)}}}function Ht(e,t,s){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Me("error",e),Me("load",e);var l=!1,c=!1,f;for(f in s)if(s.hasOwnProperty(f)){var b=s[f];if(b!=null)switch(f){case"src":l=!0;break;case"srcSet":c=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(o(137,t));default:Ke(e,t,f,b,s,null)}}c&&Ke(e,t,"srcSet",s.srcSet,s,null),l&&Ke(e,t,"src",s.src,s,null);return;case"input":Me("invalid",e);var x=f=b=c=null,N=null,L=null;for(l in s)if(s.hasOwnProperty(l)){var F=s[l];if(F!=null)switch(l){case"name":c=F;break;case"type":b=F;break;case"checked":N=F;break;case"defaultChecked":L=F;break;case"value":f=F;break;case"defaultValue":x=F;break;case"children":case"dangerouslySetInnerHTML":if(F!=null)throw Error(o(137,t));break;default:Ke(e,t,l,F,s,null)}}wh(e,f,x,N,L,b,c,!1);return;case"select":Me("invalid",e),l=b=f=null;for(c in s)if(s.hasOwnProperty(c)&&(x=s[c],x!=null))switch(c){case"value":f=x;break;case"defaultValue":b=x;break;case"multiple":l=x;default:Ke(e,t,c,x,s,null)}t=f,s=b,e.multiple=!!l,t!=null?qs(e,!!l,t,!1):s!=null&&qs(e,!!l,s,!0);return;case"textarea":Me("invalid",e),f=c=l=null;for(b in s)if(s.hasOwnProperty(b)&&(x=s[b],x!=null))switch(b){case"value":l=x;break;case"defaultValue":c=x;break;case"children":f=x;break;case"dangerouslySetInnerHTML":if(x!=null)throw Error(o(91));break;default:Ke(e,t,b,x,s,null)}kh(e,l,c,f);return;case"option":for(N in s)if(s.hasOwnProperty(N)&&(l=s[N],l!=null))switch(N){case"selected":e.selected=l&&typeof l!="function"&&typeof l!="symbol";break;default:Ke(e,t,N,l,s,null)}return;case"dialog":Me("beforetoggle",e),Me("toggle",e),Me("cancel",e),Me("close",e);break;case"iframe":case"object":Me("load",e);break;case"video":case"audio":for(l=0;l<Tl.length;l++)Me(Tl[l],e);break;case"image":Me("error",e),Me("load",e);break;case"details":Me("toggle",e);break;case"embed":case"source":case"link":Me("error",e),Me("load",e);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(L in s)if(s.hasOwnProperty(L)&&(l=s[L],l!=null))switch(L){case"children":case"dangerouslySetInnerHTML":throw Error(o(137,t));default:Ke(e,t,L,l,s,null)}return;default:if(mc(t)){for(F in s)s.hasOwnProperty(F)&&(l=s[F],l!==void 0&&td(e,t,F,l,s,void 0));return}}for(x in s)s.hasOwnProperty(x)&&(l=s[x],l!=null&&Ke(e,t,x,l,s,null))}function S_(e,t,s,l){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var c=null,f=null,b=null,x=null,N=null,L=null,F=null;for(P in s){var X=s[P];if(s.hasOwnProperty(P)&&X!=null)switch(P){case"checked":break;case"value":break;case"defaultValue":N=X;default:l.hasOwnProperty(P)||Ke(e,t,P,null,l,X)}}for(var z in l){var P=l[z];if(X=s[z],l.hasOwnProperty(z)&&(P!=null||X!=null))switch(z){case"type":f=P;break;case"name":c=P;break;case"checked":L=P;break;case"defaultChecked":F=P;break;case"value":b=P;break;case"defaultValue":x=P;break;case"children":case"dangerouslySetInnerHTML":if(P!=null)throw Error(o(137,t));break;default:P!==X&&Ke(e,t,z,P,l,X)}}hc(e,b,x,N,L,F,f,c);return;case"select":P=b=x=z=null;for(f in s)if(N=s[f],s.hasOwnProperty(f)&&N!=null)switch(f){case"value":break;case"multiple":P=N;default:l.hasOwnProperty(f)||Ke(e,t,f,null,l,N)}for(c in l)if(f=l[c],N=s[c],l.hasOwnProperty(c)&&(f!=null||N!=null))switch(c){case"value":z=f;break;case"defaultValue":x=f;break;case"multiple":b=f;default:f!==N&&Ke(e,t,c,f,l,N)}t=x,s=b,l=P,z!=null?qs(e,!!s,z,!1):!!l!=!!s&&(t!=null?qs(e,!!s,t,!0):qs(e,!!s,s?[]:"",!1));return;case"textarea":P=z=null;for(x in s)if(c=s[x],s.hasOwnProperty(x)&&c!=null&&!l.hasOwnProperty(x))switch(x){case"value":break;case"children":break;default:Ke(e,t,x,null,l,c)}for(b in l)if(c=l[b],f=s[b],l.hasOwnProperty(b)&&(c!=null||f!=null))switch(b){case"value":z=c;break;case"defaultValue":P=c;break;case"children":break;case"dangerouslySetInnerHTML":if(c!=null)throw Error(o(91));break;default:c!==f&&Ke(e,t,b,c,l,f)}Dh(e,z,P);return;case"option":for(var le in s)if(z=s[le],s.hasOwnProperty(le)&&z!=null&&!l.hasOwnProperty(le))switch(le){case"selected":e.selected=!1;break;default:Ke(e,t,le,null,l,z)}for(N in l)if(z=l[N],P=s[N],l.hasOwnProperty(N)&&z!==P&&(z!=null||P!=null))switch(N){case"selected":e.selected=z&&typeof z!="function"&&typeof z!="symbol";break;default:Ke(e,t,N,z,l,P)}return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var pe in s)z=s[pe],s.hasOwnProperty(pe)&&z!=null&&!l.hasOwnProperty(pe)&&Ke(e,t,pe,null,l,z);for(L in l)if(z=l[L],P=s[L],l.hasOwnProperty(L)&&z!==P&&(z!=null||P!=null))switch(L){case"children":case"dangerouslySetInnerHTML":if(z!=null)throw Error(o(137,t));break;default:Ke(e,t,L,z,l,P)}return;default:if(mc(t)){for(var Ze in s)z=s[Ze],s.hasOwnProperty(Ze)&&z!==void 0&&!l.hasOwnProperty(Ze)&&td(e,t,Ze,void 0,l,z);for(F in l)z=l[F],P=s[F],!l.hasOwnProperty(F)||z===P||z===void 0&&P===void 0||td(e,t,F,z,l,P);return}}for(var M in s)z=s[M],s.hasOwnProperty(M)&&z!=null&&!l.hasOwnProperty(M)&&Ke(e,t,M,null,l,z);for(X in l)z=l[X],P=s[X],!l.hasOwnProperty(X)||z===P||z==null&&P==null||Ke(e,t,X,z,l,P)}function Og(e){switch(e){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function __(){if(typeof performance.getEntriesByType=="function"){for(var e=0,t=0,s=performance.getEntriesByType("resource"),l=0;l<s.length;l++){var c=s[l],f=c.transferSize,b=c.initiatorType,x=c.duration;if(f&&x&&Og(b)){for(b=0,x=c.responseEnd,l+=1;l<s.length;l++){var N=s[l],L=N.startTime;if(L>x)break;var F=N.transferSize,X=N.initiatorType;F&&Og(X)&&(N=N.responseEnd,b+=F*(N<x?1:(x-L)/(N-L)))}if(--l,t+=8*(f+b)/(c.duration/1e3),e++,10<e)break}}if(0<e)return t/e/1e6}return navigator.connection&&(e=navigator.connection.downlink,typeof e=="number")?e:5}var nd=null,ad=null;function or(e){return e.nodeType===9?e:e.ownerDocument}function Bg(e){switch(e){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function Lg(e,t){if(e===0)switch(t){case"svg":return 1;case"math":return 2;default:return 0}return e===1&&t==="foreignObject"?0:e}function sd(e,t){return e==="textarea"||e==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.children=="bigint"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var id=null;function x_(){var e=window.event;return e&&e.type==="popstate"?e===id?!1:(id=e,!0):(id=null,!1)}var Ug=typeof setTimeout=="function"?setTimeout:void 0,T_=typeof clearTimeout=="function"?clearTimeout:void 0,zg=typeof Promise=="function"?Promise:void 0,E_=typeof queueMicrotask=="function"?queueMicrotask:typeof zg<"u"?function(e){return zg.resolve(null).then(e).catch(C_)}:Ug;function C_(e){setTimeout(function(){throw e})}function Ya(e){return e==="head"}function Ig(e,t){var s=t,l=0;do{var c=s.nextSibling;if(e.removeChild(s),c&&c.nodeType===8)if(s=c.data,s==="/$"||s==="/&"){if(l===0){e.removeChild(c),xi(t);return}l--}else if(s==="$"||s==="$?"||s==="$~"||s==="$!"||s==="&")l++;else if(s==="html")Cl(e.ownerDocument.documentElement);else if(s==="head"){s=e.ownerDocument.head,Cl(s);for(var f=s.firstChild;f;){var b=f.nextSibling,x=f.nodeName;f[Gi]||x==="SCRIPT"||x==="STYLE"||x==="LINK"&&f.rel.toLowerCase()==="stylesheet"||s.removeChild(f),f=b}}else s==="body"&&Cl(e.ownerDocument.body);s=c}while(s);xi(t)}function Vg(e,t){var s=e;e=0;do{var l=s.nextSibling;if(s.nodeType===1?t?(s._stashedDisplay=s.style.display,s.style.display="none"):(s.style.display=s._stashedDisplay||"",s.getAttribute("style")===""&&s.removeAttribute("style")):s.nodeType===3&&(t?(s._stashedText=s.nodeValue,s.nodeValue=""):s.nodeValue=s._stashedText||""),l&&l.nodeType===8)if(s=l.data,s==="/$"){if(e===0)break;e--}else s!=="$"&&s!=="$?"&&s!=="$~"&&s!=="$!"||e++;s=l}while(s)}function ld(e){var t=e.firstChild;for(t&&t.nodeType===10&&(t=t.nextSibling);t;){var s=t;switch(t=t.nextSibling,s.nodeName){case"HTML":case"HEAD":case"BODY":ld(s),dc(s);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(s.rel.toLowerCase()==="stylesheet")continue}e.removeChild(s)}}function A_(e,t,s,l){for(;e.nodeType===1;){var c=s;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!l&&(e.nodeName!=="INPUT"||e.type!=="hidden"))break}else if(l){if(!e[Gi])switch(t){case"meta":if(!e.hasAttribute("itemprop"))break;return e;case"link":if(f=e.getAttribute("rel"),f==="stylesheet"&&e.hasAttribute("data-precedence"))break;if(f!==c.rel||e.getAttribute("href")!==(c.href==null||c.href===""?null:c.href)||e.getAttribute("crossorigin")!==(c.crossOrigin==null?null:c.crossOrigin)||e.getAttribute("title")!==(c.title==null?null:c.title))break;return e;case"style":if(e.hasAttribute("data-precedence"))break;return e;case"script":if(f=e.getAttribute("src"),(f!==(c.src==null?null:c.src)||e.getAttribute("type")!==(c.type==null?null:c.type)||e.getAttribute("crossorigin")!==(c.crossOrigin==null?null:c.crossOrigin))&&f&&e.hasAttribute("async")&&!e.hasAttribute("itemprop"))break;return e;default:return e}}else if(t==="input"&&e.type==="hidden"){var f=c.name==null?null:""+c.name;if(c.type==="hidden"&&e.getAttribute("name")===f)return e}else return e;if(e=wn(e.nextSibling),e===null)break}return null}function j_(e,t,s){if(t==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!s||(e=wn(e.nextSibling),e===null))return null;return e}function Hg(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!t||(e=wn(e.nextSibling),e===null))return null;return e}function od(e){return e.data==="$?"||e.data==="$~"}function rd(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState!=="loading"}function N_(e,t){var s=e.ownerDocument;if(e.data==="$~")e._reactRetry=t;else if(e.data!=="$?"||s.readyState!=="loading")t();else{var l=function(){t(),s.removeEventListener("DOMContentLoaded",l)};s.addEventListener("DOMContentLoaded",l),e._reactRetry=l}}function wn(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t==="$"||t==="$!"||t==="$?"||t==="$~"||t==="&"||t==="F!"||t==="F")break;if(t==="/$"||t==="/&")return null}}return e}var cd=null;function Pg(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var s=e.data;if(s==="/$"||s==="/&"){if(t===0)return wn(e.nextSibling);t--}else s!=="$"&&s!=="$!"&&s!=="$?"&&s!=="$~"&&s!=="&"||t++}e=e.nextSibling}return null}function Gg(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var s=e.data;if(s==="$"||s==="$!"||s==="$?"||s==="$~"||s==="&"){if(t===0)return e;t--}else s!=="/$"&&s!=="/&"||t++}e=e.previousSibling}return null}function qg(e,t,s){switch(t=or(s),e){case"html":if(e=t.documentElement,!e)throw Error(o(452));return e;case"head":if(e=t.head,!e)throw Error(o(453));return e;case"body":if(e=t.body,!e)throw Error(o(454));return e;default:throw Error(o(451))}}function Cl(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);dc(e)}var Dn=new Map,Fg=new Set;function rr(e){return typeof e.getRootNode=="function"?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var _a=Q.d;Q.d={f:w_,r:D_,D:k_,C:M_,L:R_,m:O_,X:L_,S:B_,M:U_};function w_(){var e=_a.f(),t=Wo();return e||t}function D_(e){var t=Hs(e);t!==null&&t.tag===5&&t.type==="form"?rm(t):_a.r(e)}var bi=typeof document>"u"?null:document;function $g(e,t,s){var l=bi;if(l&&typeof t=="string"&&t){var c=xn(t);c='link[rel="'+e+'"][href="'+c+'"]',typeof s=="string"&&(c+='[crossorigin="'+s+'"]'),Fg.has(c)||(Fg.add(c),e={rel:e,crossOrigin:s,href:t},l.querySelector(c)===null&&(t=l.createElement("link"),Ht(t,"link",e),Rt(t),l.head.appendChild(t)))}}function k_(e){_a.D(e),$g("dns-prefetch",e,null)}function M_(e,t){_a.C(e,t),$g("preconnect",e,t)}function R_(e,t,s){_a.L(e,t,s);var l=bi;if(l&&e&&t){var c='link[rel="preload"][as="'+xn(t)+'"]';t==="image"&&s&&s.imageSrcSet?(c+='[imagesrcset="'+xn(s.imageSrcSet)+'"]',typeof s.imageSizes=="string"&&(c+='[imagesizes="'+xn(s.imageSizes)+'"]')):c+='[href="'+xn(e)+'"]';var f=c;switch(t){case"style":f=Si(e);break;case"script":f=_i(e)}Dn.has(f)||(e=v({rel:"preload",href:t==="image"&&s&&s.imageSrcSet?void 0:e,as:t},s),Dn.set(f,e),l.querySelector(c)!==null||t==="style"&&l.querySelector(Al(f))||t==="script"&&l.querySelector(jl(f))||(t=l.createElement("link"),Ht(t,"link",e),Rt(t),l.head.appendChild(t)))}}function O_(e,t){_a.m(e,t);var s=bi;if(s&&e){var l=t&&typeof t.as=="string"?t.as:"script",c='link[rel="modulepreload"][as="'+xn(l)+'"][href="'+xn(e)+'"]',f=c;switch(l){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":f=_i(e)}if(!Dn.has(f)&&(e=v({rel:"modulepreload",href:e},t),Dn.set(f,e),s.querySelector(c)===null)){switch(l){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(s.querySelector(jl(f)))return}l=s.createElement("link"),Ht(l,"link",e),Rt(l),s.head.appendChild(l)}}}function B_(e,t,s){_a.S(e,t,s);var l=bi;if(l&&e){var c=Ps(l).hoistableStyles,f=Si(e);t=t||"default";var b=c.get(f);if(!b){var x={loading:0,preload:null};if(b=l.querySelector(Al(f)))x.loading=5;else{e=v({rel:"stylesheet",href:e,"data-precedence":t},s),(s=Dn.get(f))&&ud(e,s);var N=b=l.createElement("link");Rt(N),Ht(N,"link",e),N._p=new Promise(function(L,F){N.onload=L,N.onerror=F}),N.addEventListener("load",function(){x.loading|=1}),N.addEventListener("error",function(){x.loading|=2}),x.loading|=4,cr(b,t,l)}b={type:"stylesheet",instance:b,count:1,state:x},c.set(f,b)}}}function L_(e,t){_a.X(e,t);var s=bi;if(s&&e){var l=Ps(s).hoistableScripts,c=_i(e),f=l.get(c);f||(f=s.querySelector(jl(c)),f||(e=v({src:e,async:!0},t),(t=Dn.get(c))&&dd(e,t),f=s.createElement("script"),Rt(f),Ht(f,"link",e),s.head.appendChild(f)),f={type:"script",instance:f,count:1,state:null},l.set(c,f))}}function U_(e,t){_a.M(e,t);var s=bi;if(s&&e){var l=Ps(s).hoistableScripts,c=_i(e),f=l.get(c);f||(f=s.querySelector(jl(c)),f||(e=v({src:e,async:!0,type:"module"},t),(t=Dn.get(c))&&dd(e,t),f=s.createElement("script"),Rt(f),Ht(f,"link",e),s.head.appendChild(f)),f={type:"script",instance:f,count:1,state:null},l.set(c,f))}}function Yg(e,t,s,l){var c=(c=K.current)?rr(c):null;if(!c)throw Error(o(446));switch(e){case"meta":case"title":return null;case"style":return typeof s.precedence=="string"&&typeof s.href=="string"?(t=Si(s.href),s=Ps(c).hoistableStyles,l=s.get(t),l||(l={type:"style",instance:null,count:0,state:null},s.set(t,l)),l):{type:"void",instance:null,count:0,state:null};case"link":if(s.rel==="stylesheet"&&typeof s.href=="string"&&typeof s.precedence=="string"){e=Si(s.href);var f=Ps(c).hoistableStyles,b=f.get(e);if(b||(c=c.ownerDocument||c,b={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},f.set(e,b),(f=c.querySelector(Al(e)))&&!f._p&&(b.instance=f,b.state.loading=5),Dn.has(e)||(s={rel:"preload",as:"style",href:s.href,crossOrigin:s.crossOrigin,integrity:s.integrity,media:s.media,hrefLang:s.hrefLang,referrerPolicy:s.referrerPolicy},Dn.set(e,s),f||z_(c,e,s,b.state))),t&&l===null)throw Error(o(528,""));return b}if(t&&l!==null)throw Error(o(529,""));return null;case"script":return t=s.async,s=s.src,typeof s=="string"&&t&&typeof t!="function"&&typeof t!="symbol"?(t=_i(s),s=Ps(c).hoistableScripts,l=s.get(t),l||(l={type:"script",instance:null,count:0,state:null},s.set(t,l)),l):{type:"void",instance:null,count:0,state:null};default:throw Error(o(444,e))}}function Si(e){return'href="'+xn(e)+'"'}function Al(e){return'link[rel="stylesheet"]['+e+"]"}function Kg(e){return v({},e,{"data-precedence":e.precedence,precedence:null})}function z_(e,t,s,l){e.querySelector('link[rel="preload"][as="style"]['+t+"]")?l.loading=1:(t=e.createElement("link"),l.preload=t,t.addEventListener("load",function(){return l.loading|=1}),t.addEventListener("error",function(){return l.loading|=2}),Ht(t,"link",s),Rt(t),e.head.appendChild(t))}function _i(e){return'[src="'+xn(e)+'"]'}function jl(e){return"script[async]"+e}function Zg(e,t,s){if(t.count++,t.instance===null)switch(t.type){case"style":var l=e.querySelector('style[data-href~="'+xn(s.href)+'"]');if(l)return t.instance=l,Rt(l),l;var c=v({},s,{"data-href":s.href,"data-precedence":s.precedence,href:null,precedence:null});return l=(e.ownerDocument||e).createElement("style"),Rt(l),Ht(l,"style",c),cr(l,s.precedence,e),t.instance=l;case"stylesheet":c=Si(s.href);var f=e.querySelector(Al(c));if(f)return t.state.loading|=4,t.instance=f,Rt(f),f;l=Kg(s),(c=Dn.get(c))&&ud(l,c),f=(e.ownerDocument||e).createElement("link"),Rt(f);var b=f;return b._p=new Promise(function(x,N){b.onload=x,b.onerror=N}),Ht(f,"link",l),t.state.loading|=4,cr(f,s.precedence,e),t.instance=f;case"script":return f=_i(s.src),(c=e.querySelector(jl(f)))?(t.instance=c,Rt(c),c):(l=s,(c=Dn.get(f))&&(l=v({},s),dd(l,c)),e=e.ownerDocument||e,c=e.createElement("script"),Rt(c),Ht(c,"link",l),e.head.appendChild(c),t.instance=c);case"void":return null;default:throw Error(o(443,t.type))}else t.type==="stylesheet"&&(t.state.loading&4)===0&&(l=t.instance,t.state.loading|=4,cr(l,s.precedence,e));return t.instance}function cr(e,t,s){for(var l=s.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),c=l.length?l[l.length-1]:null,f=c,b=0;b<l.length;b++){var x=l[b];if(x.dataset.precedence===t)f=x;else if(f!==c)break}f?f.parentNode.insertBefore(e,f.nextSibling):(t=s.nodeType===9?s.head:s,t.insertBefore(e,t.firstChild))}function ud(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.title==null&&(e.title=t.title)}function dd(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.integrity==null&&(e.integrity=t.integrity)}var ur=null;function Xg(e,t,s){if(ur===null){var l=new Map,c=ur=new Map;c.set(s,l)}else c=ur,l=c.get(s),l||(l=new Map,c.set(s,l));if(l.has(e))return l;for(l.set(e,null),s=s.getElementsByTagName(e),c=0;c<s.length;c++){var f=s[c];if(!(f[Gi]||f[Ut]||e==="link"&&f.getAttribute("rel")==="stylesheet")&&f.namespaceURI!=="http://www.w3.org/2000/svg"){var b=f.getAttribute(t)||"";b=e+b;var x=l.get(b);x?x.push(f):l.set(b,[f])}}return l}function Qg(e,t,s){e=e.ownerDocument||e,e.head.insertBefore(s,t==="title"?e.querySelector("head > title"):null)}function I_(e,t,s){if(s===1||t.itemProp!=null)return!1;switch(e){case"meta":case"title":return!0;case"style":if(typeof t.precedence!="string"||typeof t.href!="string"||t.href==="")break;return!0;case"link":if(typeof t.rel!="string"||typeof t.href!="string"||t.href===""||t.onLoad||t.onError)break;switch(t.rel){case"stylesheet":return e=t.disabled,typeof t.precedence=="string"&&e==null;default:return!0}case"script":if(t.async&&typeof t.async!="function"&&typeof t.async!="symbol"&&!t.onLoad&&!t.onError&&t.src&&typeof t.src=="string")return!0}return!1}function Jg(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function V_(e,t,s,l){if(s.type==="stylesheet"&&(typeof l.media!="string"||matchMedia(l.media).matches!==!1)&&(s.state.loading&4)===0){if(s.instance===null){var c=Si(l.href),f=t.querySelector(Al(c));if(f){t=f._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(e.count++,e=dr.bind(e),t.then(e,e)),s.state.loading|=4,s.instance=f,Rt(f);return}f=t.ownerDocument||t,l=Kg(l),(c=Dn.get(c))&&ud(l,c),f=f.createElement("link"),Rt(f);var b=f;b._p=new Promise(function(x,N){b.onload=x,b.onerror=N}),Ht(f,"link",l),s.instance=f}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(s,t),(t=s.state.preload)&&(s.state.loading&3)===0&&(e.count++,s=dr.bind(e),t.addEventListener("load",s),t.addEventListener("error",s))}}var fd=0;function H_(e,t){return e.stylesheets&&e.count===0&&hr(e,e.stylesheets),0<e.count||0<e.imgCount?function(s){var l=setTimeout(function(){if(e.stylesheets&&hr(e,e.stylesheets),e.unsuspend){var f=e.unsuspend;e.unsuspend=null,f()}},6e4+t);0<e.imgBytes&&fd===0&&(fd=62500*__());var c=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&hr(e,e.stylesheets),e.unsuspend)){var f=e.unsuspend;e.unsuspend=null,f()}},(e.imgBytes>fd?50:800)+t);return e.unsuspend=s,function(){e.unsuspend=null,clearTimeout(l),clearTimeout(c)}}:null}function dr(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)hr(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var fr=null;function hr(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,fr=new Map,t.forEach(P_,e),fr=null,dr.call(e))}function P_(e,t){if(!(t.state.loading&4)){var s=fr.get(e);if(s)var l=s.get(null);else{s=new Map,fr.set(e,s);for(var c=e.querySelectorAll("link[data-precedence],style[data-precedence]"),f=0;f<c.length;f++){var b=c[f];(b.nodeName==="LINK"||b.getAttribute("media")!=="not all")&&(s.set(b.dataset.precedence,b),l=b)}l&&s.set(null,l)}c=t.instance,b=c.getAttribute("data-precedence"),f=s.get(b)||l,f===l&&s.set(null,c),s.set(b,c),this.count++,l=dr.bind(this),c.addEventListener("load",l),c.addEventListener("error",l),f?f.parentNode.insertBefore(c,f.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(c,e.firstChild)),t.state.loading|=4}}var Nl={$$typeof:R,Provider:null,Consumer:null,_currentValue:te,_currentValue2:te,_threadCount:0};function G_(e,t,s,l,c,f,b,x,N){this.tag=1,this.containerInfo=e,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=oc(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=oc(0),this.hiddenUpdates=oc(null),this.identifierPrefix=l,this.onUncaughtError=c,this.onCaughtError=f,this.onRecoverableError=b,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=N,this.incompleteTransitions=new Map}function Wg(e,t,s,l,c,f,b,x,N,L,F,X){return e=new G_(e,t,s,b,N,L,F,X,x),t=1,f===!0&&(t|=24),f=dn(3,null,null,t),e.current=f,f.stateNode=e,t=Fc(),t.refCount++,e.pooledCache=t,t.refCount++,f.memoizedState={element:l,isDehydrated:s,cache:t},Zc(f),e}function ey(e){return e?(e=Js,e):Js}function ty(e,t,s,l,c,f){c=ey(c),l.context===null?l.context=c:l.pendingContext=c,l=La(t),l.payload={element:s},f=f===void 0?null:f,f!==null&&(l.callback=f),s=Ua(e,l,t),s!==null&&(cn(s,e,t),ll(s,e,t))}function ny(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var s=e.retryLane;e.retryLane=s!==0&&s<t?s:t}}function hd(e,t){ny(e,t),(e=e.alternate)&&ny(e,t)}function ay(e){if(e.tag===13||e.tag===31){var t=ms(e,67108864);t!==null&&cn(t,e,67108864),hd(e,67108864)}}function sy(e){if(e.tag===13||e.tag===31){var t=gn();t=rc(t);var s=ms(e,t);s!==null&&cn(s,e,t),hd(e,t)}}var pr=!0;function q_(e,t,s,l){var c=U.T;U.T=null;var f=Q.p;try{Q.p=2,pd(e,t,s,l)}finally{Q.p=f,U.T=c}}function F_(e,t,s,l){var c=U.T;U.T=null;var f=Q.p;try{Q.p=8,pd(e,t,s,l)}finally{Q.p=f,U.T=c}}function pd(e,t,s,l){if(pr){var c=md(l);if(c===null)ed(e,t,l,mr,s),ly(e,l);else if(Y_(c,e,t,s,l))l.stopPropagation();else if(ly(e,l),t&4&&-1<$_.indexOf(e)){for(;c!==null;){var f=Hs(c);if(f!==null)switch(f.tag){case 3:if(f=f.stateNode,f.current.memoizedState.isDehydrated){var b=je(f.pendingLanes);if(b!==0){var x=f;for(x.pendingLanes|=2,x.entangledLanes|=2;b;){var N=1<<31-gt(b);x.entanglements[1]|=N,b&=~N}$n(f),(He&6)===0&&(Qo=ue()+500,xl(0))}}break;case 31:case 13:x=ms(f,2),x!==null&&cn(x,f,2),Wo(),hd(f,2)}if(f=md(l),f===null&&ed(e,t,l,mr,s),f===c)break;c=f}c!==null&&l.stopPropagation()}else ed(e,t,l,null,s)}}function md(e){return e=yc(e),gd(e)}var mr=null;function gd(e){if(mr=null,e=Vs(e),e!==null){var t=u(e);if(t===null)e=null;else{var s=t.tag;if(s===13){if(e=d(t),e!==null)return e;e=null}else if(s===31){if(e=p(t),e!==null)return e;e=null}else if(s===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return mr=e,null}function iy(e){switch(e){case"beforetoggle":case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"toggle":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 2;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(be()){case Te:return 2;case Qe:return 8;case De:case Mt:return 32;case wt:return 268435456;default:return 32}default:return 32}}var yd=!1,Ka=null,Za=null,Xa=null,wl=new Map,Dl=new Map,Qa=[],$_="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset".split(" ");function ly(e,t){switch(e){case"focusin":case"focusout":Ka=null;break;case"dragenter":case"dragleave":Za=null;break;case"mouseover":case"mouseout":Xa=null;break;case"pointerover":case"pointerout":wl.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":Dl.delete(t.pointerId)}}function kl(e,t,s,l,c,f){return e===null||e.nativeEvent!==f?(e={blockedOn:t,domEventName:s,eventSystemFlags:l,nativeEvent:f,targetContainers:[c]},t!==null&&(t=Hs(t),t!==null&&ay(t)),e):(e.eventSystemFlags|=l,t=e.targetContainers,c!==null&&t.indexOf(c)===-1&&t.push(c),e)}function Y_(e,t,s,l,c){switch(t){case"focusin":return Ka=kl(Ka,e,t,s,l,c),!0;case"dragenter":return Za=kl(Za,e,t,s,l,c),!0;case"mouseover":return Xa=kl(Xa,e,t,s,l,c),!0;case"pointerover":var f=c.pointerId;return wl.set(f,kl(wl.get(f)||null,e,t,s,l,c)),!0;case"gotpointercapture":return f=c.pointerId,Dl.set(f,kl(Dl.get(f)||null,e,t,s,l,c)),!0}return!1}function oy(e){var t=Vs(e.target);if(t!==null){var s=u(t);if(s!==null){if(t=s.tag,t===13){if(t=d(s),t!==null){e.blockedOn=t,_h(e.priority,function(){sy(s)});return}}else if(t===31){if(t=p(s),t!==null){e.blockedOn=t,_h(e.priority,function(){sy(s)});return}}else if(t===3&&s.stateNode.current.memoizedState.isDehydrated){e.blockedOn=s.tag===3?s.stateNode.containerInfo:null;return}}}e.blockedOn=null}function gr(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var s=md(e.nativeEvent);if(s===null){s=e.nativeEvent;var l=new s.constructor(s.type,s);gc=l,s.target.dispatchEvent(l),gc=null}else return t=Hs(s),t!==null&&ay(t),e.blockedOn=s,!1;t.shift()}return!0}function ry(e,t,s){gr(e)&&s.delete(t)}function K_(){yd=!1,Ka!==null&&gr(Ka)&&(Ka=null),Za!==null&&gr(Za)&&(Za=null),Xa!==null&&gr(Xa)&&(Xa=null),wl.forEach(ry),Dl.forEach(ry)}function yr(e,t){e.blockedOn===t&&(e.blockedOn=null,yd||(yd=!0,n.unstable_scheduleCallback(n.unstable_NormalPriority,K_)))}var vr=null;function cy(e){vr!==e&&(vr=e,n.unstable_scheduleCallback(n.unstable_NormalPriority,function(){vr===e&&(vr=null);for(var t=0;t<e.length;t+=3){var s=e[t],l=e[t+1],c=e[t+2];if(typeof l!="function"){if(gd(l||s)===null)continue;break}var f=Hs(s);f!==null&&(e.splice(t,3),t-=3,mu(f,{pending:!0,data:c,method:s.method,action:l},l,c))}}))}function xi(e){function t(N){return yr(N,e)}Ka!==null&&yr(Ka,e),Za!==null&&yr(Za,e),Xa!==null&&yr(Xa,e),wl.forEach(t),Dl.forEach(t);for(var s=0;s<Qa.length;s++){var l=Qa[s];l.blockedOn===e&&(l.blockedOn=null)}for(;0<Qa.length&&(s=Qa[0],s.blockedOn===null);)oy(s),s.blockedOn===null&&Qa.shift();if(s=(e.ownerDocument||e).$$reactFormReplay,s!=null)for(l=0;l<s.length;l+=3){var c=s[l],f=s[l+1],b=c[nn]||null;if(typeof f=="function")b||cy(s);else if(b){var x=null;if(f&&f.hasAttribute("formAction")){if(c=f,b=f[nn]||null)x=b.formAction;else if(gd(c)!==null)continue}else x=b.action;typeof x=="function"?s[l+1]=x:(s.splice(l,3),l-=3),cy(s)}}}function uy(){function e(f){f.canIntercept&&f.info==="react-transition"&&f.intercept({handler:function(){return new Promise(function(b){return c=b})},focusReset:"manual",scroll:"manual"})}function t(){c!==null&&(c(),c=null),l||setTimeout(s,20)}function s(){if(!l&&!navigation.transition){var f=navigation.currentEntry;f&&f.url!=null&&navigation.navigate(f.url,{state:f.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var l=!1,c=null;return navigation.addEventListener("navigate",e),navigation.addEventListener("navigatesuccess",t),navigation.addEventListener("navigateerror",t),setTimeout(s,100),function(){l=!0,navigation.removeEventListener("navigate",e),navigation.removeEventListener("navigatesuccess",t),navigation.removeEventListener("navigateerror",t),c!==null&&(c(),c=null)}}}function vd(e){this._internalRoot=e}br.prototype.render=vd.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(o(409));var s=t.current,l=gn();ty(s,l,e,t,null,null)},br.prototype.unmount=vd.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;ty(e.current,2,null,e,null,null),Wo(),t[Is]=null}};function br(e){this._internalRoot=e}br.prototype.unstable_scheduleHydration=function(e){if(e){var t=Sh();e={blockedOn:null,target:e,priority:t};for(var s=0;s<Qa.length&&t!==0&&t<Qa[s].priority;s++);Qa.splice(s,0,e),s===0&&oy(e)}};var dy=a.version;if(dy!=="19.2.4")throw Error(o(527,dy,"19.2.4"));Q.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(o(188)):(e=Object.keys(e).join(","),Error(o(268,e)));return e=g(t),e=e!==null?y(e):null,e=e===null?null:e.stateNode,e};var Z_={bundleType:0,version:"19.2.4",rendererPackageName:"react-dom",currentDispatcherRef:U,reconcilerVersion:"19.2.4"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Sr=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Sr.isDisabled&&Sr.supportsFiber)try{rt=Sr.inject(Z_),We=Sr}catch{}}return Ml.createRoot=function(e,t){if(!r(e))throw Error(o(299));var s=!1,l="",c=vm,f=bm,b=Sm;return t!=null&&(t.unstable_strictMode===!0&&(s=!0),t.identifierPrefix!==void 0&&(l=t.identifierPrefix),t.onUncaughtError!==void 0&&(c=t.onUncaughtError),t.onCaughtError!==void 0&&(f=t.onCaughtError),t.onRecoverableError!==void 0&&(b=t.onRecoverableError)),t=Wg(e,1,!1,null,null,s,l,null,c,f,b,uy),e[Is]=t.current,Wu(e),new vd(t)},Ml.hydrateRoot=function(e,t,s){if(!r(e))throw Error(o(299));var l=!1,c="",f=vm,b=bm,x=Sm,N=null;return s!=null&&(s.unstable_strictMode===!0&&(l=!0),s.identifierPrefix!==void 0&&(c=s.identifierPrefix),s.onUncaughtError!==void 0&&(f=s.onUncaughtError),s.onCaughtError!==void 0&&(b=s.onCaughtError),s.onRecoverableError!==void 0&&(x=s.onRecoverableError),s.formState!==void 0&&(N=s.formState)),t=Wg(e,1,!0,t,s??null,l,c,N,f,b,x,uy),t.context=ey(null),s=t.current,l=gn(),l=rc(l),c=La(l),c.callback=null,Ua(s,c,l),s=l,t.current.lanes=s,Pi(t,s),$n(t),e[Is]=t.current,Wu(e),new br(t)},Ml.version="19.2.4",Ml}var vy;function dx(){if(vy)return bd.exports;vy=1;function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(a){console.error(a)}}return n(),bd.exports=ux(),bd.exports}var fx=dx();/**
26
- * react-router v7.13.1
27
- *
28
- * Copyright (c) Remix Software Inc.
29
- *
30
- * This source code is licensed under the MIT license found in the
31
- * LICENSE.md file in the root directory of this source tree.
32
- *
33
- * @license MIT
34
- */var by="popstate";function Sy(n){return typeof n=="object"&&n!=null&&"pathname"in n&&"search"in n&&"hash"in n&&"state"in n&&"key"in n}function hx(n={}){function a(o,r){var g;let u=(g=r.state)==null?void 0:g.masked,{pathname:d,search:p,hash:m}=u||o.location;return $d("",{pathname:d,search:p,hash:m},r.state&&r.state.usr||null,r.state&&r.state.key||"default",u?{pathname:o.location.pathname,search:o.location.search,hash:o.location.hash}:void 0)}function i(o,r){return typeof r=="string"?r:$l(r)}return mx(a,i,null,n)}function at(n,a){if(n===!1||n===null||typeof n>"u")throw new Error(a)}function On(n,a){if(!n){typeof console<"u"&&console.warn(a);try{throw new Error(a)}catch{}}}function px(){return Math.random().toString(36).substring(2,10)}function _y(n,a){return{usr:n.state,key:n.key,idx:a,masked:n.unstable_mask?{pathname:n.pathname,search:n.search,hash:n.hash}:void 0}}function $d(n,a,i=null,o,r){return{pathname:typeof n=="string"?n:n.pathname,search:"",hash:"",...typeof a=="string"?Bi(a):a,state:i,key:a&&a.key||o||px(),unstable_mask:r}}function $l({pathname:n="/",search:a="",hash:i=""}){return a&&a!=="?"&&(n+=a.charAt(0)==="?"?a:"?"+a),i&&i!=="#"&&(n+=i.charAt(0)==="#"?i:"#"+i),n}function Bi(n){let a={};if(n){let i=n.indexOf("#");i>=0&&(a.hash=n.substring(i),n=n.substring(0,i));let o=n.indexOf("?");o>=0&&(a.search=n.substring(o),n=n.substring(0,o)),n&&(a.pathname=n)}return a}function mx(n,a,i,o={}){let{window:r=document.defaultView,v5Compat:u=!1}=o,d=r.history,p="POP",m=null,g=y();g==null&&(g=0,d.replaceState({...d.state,idx:g},""));function y(){return(d.state||{idx:null}).idx}function v(){p="POP";let j=y(),A=j==null?null:j-g;g=j,m&&m({action:p,location:E.location,delta:A})}function _(j,A){p="PUSH";let k=Sy(j)?j:$d(E.location,j,A);g=y()+1;let R=_y(k,g),$=E.createHref(k.unstable_mask||k);try{d.pushState(R,"",$)}catch(H){if(H instanceof DOMException&&H.name==="DataCloneError")throw H;r.location.assign($)}u&&m&&m({action:p,location:E.location,delta:1})}function T(j,A){p="REPLACE";let k=Sy(j)?j:$d(E.location,j,A);g=y();let R=_y(k,g),$=E.createHref(k.unstable_mask||k);d.replaceState(R,"",$),u&&m&&m({action:p,location:E.location,delta:0})}function C(j){return gx(j)}let E={get action(){return p},get location(){return n(r,d)},listen(j){if(m)throw new Error("A history only accepts one active listener");return r.addEventListener(by,v),m=j,()=>{r.removeEventListener(by,v),m=null}},createHref(j){return a(r,j)},createURL:C,encodeLocation(j){let A=C(j);return{pathname:A.pathname,search:A.search,hash:A.hash}},push:_,replace:T,go(j){return d.go(j)}};return E}function gx(n,a=!1){let i="http://localhost";typeof window<"u"&&(i=window.location.origin!=="null"?window.location.origin:window.location.href),at(i,"No window.location.(origin|href) available to create URL");let o=typeof n=="string"?n:$l(n);return o=o.replace(/ $/,"%20"),!a&&o.startsWith("//")&&(o=i+o),new URL(o,i)}function g0(n,a,i="/"){return yx(n,a,i,!1)}function yx(n,a,i,o){let r=typeof a=="string"?Bi(a):a,u=Aa(r.pathname||"/",i);if(u==null)return null;let d=y0(n);vx(d);let p=null;for(let m=0;p==null&&m<d.length;++m){let g=b0(u);p=jx(d[m],g,o)}return p}function y0(n,a=[],i=[],o="",r=!1){let u=(d,p,m=r,g)=>{let y={relativePath:g===void 0?d.path||"":g,caseSensitive:d.caseSensitive===!0,childrenIndex:p,route:d};if(y.relativePath.startsWith("/")){if(!y.relativePath.startsWith(o)&&m)return;at(y.relativePath.startsWith(o),`Absolute route path "${y.relativePath}" nested under path "${o}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),y.relativePath=y.relativePath.slice(o.length)}let v=Xn([o,y.relativePath]),_=i.concat(y);d.children&&d.children.length>0&&(at(d.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${v}".`),y0(d.children,a,_,v,m)),!(d.path==null&&!d.index)&&a.push({path:v,score:Cx(v,d.index),routesMeta:_})};return n.forEach((d,p)=>{var m;if(d.path===""||!((m=d.path)!=null&&m.includes("?")))u(d,p);else for(let g of v0(d.path))u(d,p,!0,g)}),a}function v0(n){let a=n.split("/");if(a.length===0)return[];let[i,...o]=a,r=i.endsWith("?"),u=i.replace(/\?$/,"");if(o.length===0)return r?[u,""]:[u];let d=v0(o.join("/")),p=[];return p.push(...d.map(m=>m===""?u:[u,m].join("/"))),r&&p.push(...d),p.map(m=>n.startsWith("/")&&m===""?"/":m)}function vx(n){n.sort((a,i)=>a.score!==i.score?i.score-a.score:Ax(a.routesMeta.map(o=>o.childrenIndex),i.routesMeta.map(o=>o.childrenIndex)))}var bx=/^:[\w-]+$/,Sx=3,_x=2,xx=1,Tx=10,Ex=-2,xy=n=>n==="*";function Cx(n,a){let i=n.split("/"),o=i.length;return i.some(xy)&&(o+=Ex),a&&(o+=_x),i.filter(r=>!xy(r)).reduce((r,u)=>r+(bx.test(u)?Sx:u===""?xx:Tx),o)}function Ax(n,a){return n.length===a.length&&n.slice(0,-1).every((o,r)=>o===a[r])?n[n.length-1]-a[a.length-1]:0}function jx(n,a,i=!1){let{routesMeta:o}=n,r={},u="/",d=[];for(let p=0;p<o.length;++p){let m=o[p],g=p===o.length-1,y=u==="/"?a:a.slice(u.length)||"/",v=Yl({path:m.relativePath,caseSensitive:m.caseSensitive,end:g},y),_=m.route;if(!v&&g&&i&&!o[o.length-1].route.index&&(v=Yl({path:m.relativePath,caseSensitive:m.caseSensitive,end:!1},y)),!v)return null;Object.assign(r,v.params),d.push({params:r,pathname:Xn([u,v.pathname]),pathnameBase:Mx(Xn([u,v.pathnameBase])),route:_}),v.pathnameBase!=="/"&&(u=Xn([u,v.pathnameBase]))}return d}function Yl(n,a){typeof n=="string"&&(n={path:n,caseSensitive:!1,end:!0});let[i,o]=Nx(n.path,n.caseSensitive,n.end),r=a.match(i);if(!r)return null;let u=r[0],d=u.replace(/(.)\/+$/,"$1"),p=r.slice(1);return{params:o.reduce((g,{paramName:y,isOptional:v},_)=>{if(y==="*"){let C=p[_]||"";d=u.slice(0,u.length-C.length).replace(/(.)\/+$/,"$1")}const T=p[_];return v&&!T?g[y]=void 0:g[y]=(T||"").replace(/%2F/g,"/"),g},{}),pathname:u,pathnameBase:d,pattern:n}}function Nx(n,a=!1,i=!0){On(n==="*"||!n.endsWith("*")||n.endsWith("/*"),`Route path "${n}" will be treated as if it were "${n.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${n.replace(/\*$/,"/*")}".`);let o=[],r="^"+n.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(d,p,m,g,y)=>{if(o.push({paramName:p,isOptional:m!=null}),m){let v=y.charAt(g+d.length);return v&&v!=="/"?"/([^\\/]*)":"(?:/([^\\/]*))?"}return"/([^\\/]+)"}).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return n.endsWith("*")?(o.push({paramName:"*"}),r+=n==="*"||n==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):i?r+="\\/*$":n!==""&&n!=="/"&&(r+="(?:(?=\\/|$))"),[new RegExp(r,a?void 0:"i"),o]}function b0(n){try{return n.split("/").map(a=>decodeURIComponent(a).replace(/\//g,"%2F")).join("/")}catch(a){return On(!1,`The URL path "${n}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${a}).`),n}}function Aa(n,a){if(a==="/")return n;if(!n.toLowerCase().startsWith(a.toLowerCase()))return null;let i=a.endsWith("/")?a.length-1:a.length,o=n.charAt(i);return o&&o!=="/"?null:n.slice(i)||"/"}var wx=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i;function Dx(n,a="/"){let{pathname:i,search:o="",hash:r=""}=typeof n=="string"?Bi(n):n,u;return i?(i=i.replace(/\/\/+/g,"/"),i.startsWith("/")?u=Ty(i.substring(1),"/"):u=Ty(i,a)):u=a,{pathname:u,search:Rx(o),hash:Ox(r)}}function Ty(n,a){let i=a.replace(/\/+$/,"").split("/");return n.split("/").forEach(r=>{r===".."?i.length>1&&i.pop():r!=="."&&i.push(r)}),i.length>1?i.join("/"):"/"}function xd(n,a,i,o){return`Cannot include a '${n}' character in a manually specified \`to.${a}\` field [${JSON.stringify(o)}]. Please separate it out to the \`to.${i}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function kx(n){return n.filter((a,i)=>i===0||a.route.path&&a.route.path.length>0)}function Af(n){let a=kx(n);return a.map((i,o)=>o===a.length-1?i.pathname:i.pathnameBase)}function Kr(n,a,i,o=!1){let r;typeof n=="string"?r=Bi(n):(r={...n},at(!r.pathname||!r.pathname.includes("?"),xd("?","pathname","search",r)),at(!r.pathname||!r.pathname.includes("#"),xd("#","pathname","hash",r)),at(!r.search||!r.search.includes("#"),xd("#","search","hash",r)));let u=n===""||r.pathname==="",d=u?"/":r.pathname,p;if(d==null)p=i;else{let v=a.length-1;if(!o&&d.startsWith("..")){let _=d.split("/");for(;_[0]==="..";)_.shift(),v-=1;r.pathname=_.join("/")}p=v>=0?a[v]:"/"}let m=Dx(r,p),g=d&&d!=="/"&&d.endsWith("/"),y=(u||d===".")&&i.endsWith("/");return!m.pathname.endsWith("/")&&(g||y)&&(m.pathname+="/"),m}var Xn=n=>n.join("/").replace(/\/\/+/g,"/"),Mx=n=>n.replace(/\/+$/,"").replace(/^\/*/,"/"),Rx=n=>!n||n==="?"?"":n.startsWith("?")?n:"?"+n,Ox=n=>!n||n==="#"?"":n.startsWith("#")?n:"#"+n,Bx=class{constructor(n,a,i,o=!1){this.status=n,this.statusText=a||"",this.internal=o,i instanceof Error?(this.data=i.toString(),this.error=i):this.data=i}};function Lx(n){return n!=null&&typeof n.status=="number"&&typeof n.statusText=="string"&&typeof n.internal=="boolean"&&"data"in n}function Ux(n){return n.map(a=>a.route.path).filter(Boolean).join("/").replace(/\/\/*/g,"/")||"/"}var S0=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function _0(n,a){let i=n;if(typeof i!="string"||!wx.test(i))return{absoluteURL:void 0,isExternal:!1,to:i};let o=i,r=!1;if(S0)try{let u=new URL(window.location.href),d=i.startsWith("//")?new URL(u.protocol+i):new URL(i),p=Aa(d.pathname,a);d.origin===u.origin&&p!=null?i=p+d.search+d.hash:r=!0}catch{On(!1,`<Link to="${i}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:o,isExternal:r,to:i}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");var x0=["POST","PUT","PATCH","DELETE"];new Set(x0);var zx=["GET",...x0];new Set(zx);var Li=S.createContext(null);Li.displayName="DataRouter";var Zr=S.createContext(null);Zr.displayName="DataRouterState";var Ix=S.createContext(!1),T0=S.createContext({isTransitioning:!1});T0.displayName="ViewTransition";var Vx=S.createContext(new Map);Vx.displayName="Fetchers";var Hx=S.createContext(null);Hx.displayName="Await";var Sn=S.createContext(null);Sn.displayName="Navigation";var to=S.createContext(null);to.displayName="Location";var Bn=S.createContext({outlet:null,matches:[],isDataRoute:!1});Bn.displayName="Route";var jf=S.createContext(null);jf.displayName="RouteError";var E0="REACT_ROUTER_ERROR",Px="REDIRECT",Gx="ROUTE_ERROR_RESPONSE";function qx(n){if(n.startsWith(`${E0}:${Px}:{`))try{let a=JSON.parse(n.slice(28));if(typeof a=="object"&&a&&typeof a.status=="number"&&typeof a.statusText=="string"&&typeof a.location=="string"&&typeof a.reloadDocument=="boolean"&&typeof a.replace=="boolean")return a}catch{}}function Fx(n){if(n.startsWith(`${E0}:${Gx}:{`))try{let a=JSON.parse(n.slice(40));if(typeof a=="object"&&a&&typeof a.status=="number"&&typeof a.statusText=="string")return new Bx(a.status,a.statusText,a.data)}catch{}}function $x(n,{relative:a}={}){at(Us(),"useHref() may be used only in the context of a <Router> component.");let{basename:i,navigator:o}=S.useContext(Sn),{hash:r,pathname:u,search:d}=no(n,{relative:a}),p=u;return i!=="/"&&(p=u==="/"?i:Xn([i,u])),o.createHref({pathname:p,search:d,hash:r})}function Us(){return S.useContext(to)!=null}function Wt(){return at(Us(),"useLocation() may be used only in the context of a <Router> component."),S.useContext(to).location}function Qt(n){at(Us(),"useMatch() may be used only in the context of a <Router> component.");let{pathname:a}=Wt();return S.useMemo(()=>Yl(n,b0(a)),[a,n])}var C0="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function A0(n){S.useContext(Sn).static||S.useLayoutEffect(n)}function Xr(){let{isDataRoute:n}=S.useContext(Bn);return n?oT():Yx()}function Yx(){at(Us(),"useNavigate() may be used only in the context of a <Router> component.");let n=S.useContext(Li),{basename:a,navigator:i}=S.useContext(Sn),{matches:o}=S.useContext(Bn),{pathname:r}=Wt(),u=JSON.stringify(Af(o)),d=S.useRef(!1);return A0(()=>{d.current=!0}),S.useCallback((m,g={})=>{if(On(d.current,C0),!d.current)return;if(typeof m=="number"){i.go(m);return}let y=Kr(m,JSON.parse(u),r,g.relative==="path");n==null&&a!=="/"&&(y.pathname=y.pathname==="/"?a:Xn([a,y.pathname])),(g.replace?i.replace:i.push)(y,g.state,g)},[a,i,u,r,n])}var Kx=S.createContext(null);function Zx(n){let a=S.useContext(Bn).outlet;return S.useMemo(()=>a&&S.createElement(Kx.Provider,{value:n},a),[a,n])}function Qr(){let{matches:n}=S.useContext(Bn),a=n[n.length-1];return a?a.params:{}}function no(n,{relative:a}={}){let{matches:i}=S.useContext(Bn),{pathname:o}=Wt(),r=JSON.stringify(Af(i));return S.useMemo(()=>Kr(n,JSON.parse(r),o,a==="path"),[n,r,o,a])}function Xx(n,a){return j0(n,a)}function j0(n,a,i){var j;at(Us(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:o}=S.useContext(Sn),{matches:r}=S.useContext(Bn),u=r[r.length-1],d=u?u.params:{},p=u?u.pathname:"/",m=u?u.pathnameBase:"/",g=u&&u.route;{let A=g&&g.path||"";w0(p,!g||A.endsWith("*")||A.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${p}" (under <Route path="${A}">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render.
35
-
36
- Please change the parent <Route path="${A}"> to <Route path="${A==="/"?"*":`${A}/*`}">.`)}let y=Wt(),v;if(a){let A=typeof a=="string"?Bi(a):a;at(m==="/"||((j=A.pathname)==null?void 0:j.startsWith(m)),`When overriding the location using \`<Routes location>\` or \`useRoutes(routes, location)\`, the location pathname must begin with the portion of the URL pathname that was matched by all parent routes. The current pathname base is "${m}" but pathname "${A.pathname}" was given in the \`location\` prop.`),v=A}else v=y;let _=v.pathname||"/",T=_;if(m!=="/"){let A=m.replace(/^\//,"").split("/");T="/"+_.replace(/^\//,"").split("/").slice(A.length).join("/")}let C=g0(n,{pathname:T});On(g||C!=null,`No routes matched location "${v.pathname}${v.search}${v.hash}" `),On(C==null||C[C.length-1].route.element!==void 0||C[C.length-1].route.Component!==void 0||C[C.length-1].route.lazy!==void 0,`Matched leaf route at location "${v.pathname}${v.search}${v.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`);let E=tT(C&&C.map(A=>Object.assign({},A,{params:Object.assign({},d,A.params),pathname:Xn([m,o.encodeLocation?o.encodeLocation(A.pathname.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:A.pathname]),pathnameBase:A.pathnameBase==="/"?m:Xn([m,o.encodeLocation?o.encodeLocation(A.pathnameBase.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:A.pathnameBase])})),r,i);return a&&E?S.createElement(to.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",unstable_mask:void 0,...v},navigationType:"POP"}},E):E}function Qx(){let n=lT(),a=Lx(n)?`${n.status} ${n.statusText}`:n instanceof Error?n.message:JSON.stringify(n),i=n instanceof Error?n.stack:null,o="rgba(200,200,200, 0.5)",r={padding:"0.5rem",backgroundColor:o},u={padding:"2px 4px",backgroundColor:o},d=null;return console.error("Error handled by React Router default ErrorBoundary:",n),d=S.createElement(S.Fragment,null,S.createElement("p",null,"💿 Hey developer 👋"),S.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",S.createElement("code",{style:u},"ErrorBoundary")," or"," ",S.createElement("code",{style:u},"errorElement")," prop on your route.")),S.createElement(S.Fragment,null,S.createElement("h2",null,"Unexpected Application Error!"),S.createElement("h3",{style:{fontStyle:"italic"}},a),i?S.createElement("pre",{style:r},i):null,d)}var Jx=S.createElement(Qx,null),N0=class extends S.Component{constructor(n){super(n),this.state={location:n.location,revalidation:n.revalidation,error:n.error}}static getDerivedStateFromError(n){return{error:n}}static getDerivedStateFromProps(n,a){return a.location!==n.location||a.revalidation!=="idle"&&n.revalidation==="idle"?{error:n.error,location:n.location,revalidation:n.revalidation}:{error:n.error!==void 0?n.error:a.error,location:a.location,revalidation:n.revalidation||a.revalidation}}componentDidCatch(n,a){this.props.onError?this.props.onError(n,a):console.error("React Router caught the following error during render",n)}render(){let n=this.state.error;if(this.context&&typeof n=="object"&&n&&"digest"in n&&typeof n.digest=="string"){const i=Fx(n.digest);i&&(n=i)}let a=n!==void 0?S.createElement(Bn.Provider,{value:this.props.routeContext},S.createElement(jf.Provider,{value:n,children:this.props.component})):this.props.children;return this.context?S.createElement(Wx,{error:n},a):a}};N0.contextType=Ix;var Td=new WeakMap;function Wx({children:n,error:a}){let{basename:i}=S.useContext(Sn);if(typeof a=="object"&&a&&"digest"in a&&typeof a.digest=="string"){let o=qx(a.digest);if(o){let r=Td.get(a);if(r)throw r;let u=_0(o.location,i);if(S0&&!Td.get(a))if(u.isExternal||o.reloadDocument)window.location.href=u.absoluteURL||u.to;else{const d=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(u.to,{replace:o.replace}));throw Td.set(a,d),d}return S.createElement("meta",{httpEquiv:"refresh",content:`0;url=${u.absoluteURL||u.to}`})}}return n}function eT({routeContext:n,match:a,children:i}){let o=S.useContext(Li);return o&&o.static&&o.staticContext&&(a.route.errorElement||a.route.ErrorBoundary)&&(o.staticContext._deepestRenderedBoundaryId=a.route.id),S.createElement(Bn.Provider,{value:n},i)}function tT(n,a=[],i){let o=i==null?void 0:i.state;if(n==null){if(!o)return null;if(o.errors)n=o.matches;else if(a.length===0&&!o.initialized&&o.matches.length>0)n=o.matches;else return null}let r=n,u=o==null?void 0:o.errors;if(u!=null){let y=r.findIndex(v=>v.route.id&&(u==null?void 0:u[v.route.id])!==void 0);at(y>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(u).join(",")}`),r=r.slice(0,Math.min(r.length,y+1))}let d=!1,p=-1;if(i&&o){d=o.renderFallback;for(let y=0;y<r.length;y++){let v=r[y];if((v.route.HydrateFallback||v.route.hydrateFallbackElement)&&(p=y),v.route.id){let{loaderData:_,errors:T}=o,C=v.route.loader&&!_.hasOwnProperty(v.route.id)&&(!T||T[v.route.id]===void 0);if(v.route.lazy||C){i.isStatic&&(d=!0),p>=0?r=r.slice(0,p+1):r=[r[0]];break}}}}let m=i==null?void 0:i.onError,g=o&&m?(y,v)=>{var _,T;m(y,{location:o.location,params:((T=(_=o.matches)==null?void 0:_[0])==null?void 0:T.params)??{},unstable_pattern:Ux(o.matches),errorInfo:v})}:void 0;return r.reduceRight((y,v,_)=>{let T,C=!1,E=null,j=null;o&&(T=u&&v.route.id?u[v.route.id]:void 0,E=v.route.errorElement||Jx,d&&(p<0&&_===0?(w0("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),C=!0,j=null):p===_&&(C=!0,j=v.route.hydrateFallbackElement||null)));let A=a.concat(r.slice(0,_+1)),k=()=>{let R;return T?R=E:C?R=j:v.route.Component?R=S.createElement(v.route.Component,null):v.route.element?R=v.route.element:R=y,S.createElement(eT,{match:v,routeContext:{outlet:y,matches:A,isDataRoute:o!=null},children:R})};return o&&(v.route.ErrorBoundary||v.route.errorElement||_===0)?S.createElement(N0,{location:o.location,revalidation:o.revalidation,component:E,error:T,children:k(),routeContext:{outlet:null,matches:A,isDataRoute:!0},onError:g}):k()},null)}function Nf(n){return`${n} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function nT(n){let a=S.useContext(Li);return at(a,Nf(n)),a}function aT(n){let a=S.useContext(Zr);return at(a,Nf(n)),a}function sT(n){let a=S.useContext(Bn);return at(a,Nf(n)),a}function wf(n){let a=sT(n),i=a.matches[a.matches.length-1];return at(i.route.id,`${n} can only be used on routes that contain a unique "id"`),i.route.id}function iT(){return wf("useRouteId")}function lT(){var o;let n=S.useContext(jf),a=aT("useRouteError"),i=wf("useRouteError");return n!==void 0?n:(o=a.errors)==null?void 0:o[i]}function oT(){let{router:n}=nT("useNavigate"),a=wf("useNavigate"),i=S.useRef(!1);return A0(()=>{i.current=!0}),S.useCallback(async(r,u={})=>{On(i.current,C0),i.current&&(typeof r=="number"?await n.navigate(r):await n.navigate(r,{fromRouteId:a,...u}))},[n,a])}var Ey={};function w0(n,a,i){!a&&!Ey[n]&&(Ey[n]=!0,On(!1,i))}S.memo(rT);function rT({routes:n,future:a,state:i,isStatic:o,onError:r}){return j0(n,void 0,{state:i,isStatic:o,onError:r})}function Dr({to:n,replace:a,state:i,relative:o}){at(Us(),"<Navigate> may be used only in the context of a <Router> component.");let{static:r}=S.useContext(Sn);On(!r,"<Navigate> must not be used on the initial render in a <StaticRouter>. This is a no-op, but you should modify your code so the <Navigate> is only ever rendered in response to some user interaction or state change.");let{matches:u}=S.useContext(Bn),{pathname:d}=Wt(),p=Xr(),m=Kr(n,Af(u),d,o==="path"),g=JSON.stringify(m);return S.useEffect(()=>{p(JSON.parse(g),{replace:a,state:i,relative:o})},[p,g,o,a,i]),null}function D0(n){return Zx(n.context)}function _t(n){at(!1,"A <Route> is only ever to be used as the child of <Routes> element, never rendered directly. Please wrap your <Route> in a <Routes>.")}function cT({basename:n="/",children:a=null,location:i,navigationType:o="POP",navigator:r,static:u=!1,unstable_useTransitions:d}){at(!Us(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let p=n.replace(/^\/*/,"/"),m=S.useMemo(()=>({basename:p,navigator:r,static:u,unstable_useTransitions:d,future:{}}),[p,r,u,d]);typeof i=="string"&&(i=Bi(i));let{pathname:g="/",search:y="",hash:v="",state:_=null,key:T="default",unstable_mask:C}=i,E=S.useMemo(()=>{let j=Aa(g,p);return j==null?null:{location:{pathname:j,search:y,hash:v,state:_,key:T,unstable_mask:C},navigationType:o}},[p,g,y,v,_,T,o,C]);return On(E!=null,`<Router basename="${p}"> is not able to match the URL "${g}${y}${v}" because it does not start with the basename, so the <Router> won't render anything.`),E==null?null:S.createElement(Sn.Provider,{value:m},S.createElement(to.Provider,{children:a,value:E}))}function uT({children:n,location:a}){return Xx(Yd(n),a)}function Yd(n,a=[]){let i=[];return S.Children.forEach(n,(o,r)=>{if(!S.isValidElement(o))return;let u=[...a,r];if(o.type===S.Fragment){i.push.apply(i,Yd(o.props.children,u));return}at(o.type===_t,`[${typeof o.type=="string"?o.type:o.type.name}] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>`),at(!o.props.index||!o.props.children,"An index route cannot have child routes.");let d={id:o.props.id||u.join("-"),caseSensitive:o.props.caseSensitive,element:o.props.element,Component:o.props.Component,index:o.props.index,path:o.props.path,middleware:o.props.middleware,loader:o.props.loader,action:o.props.action,hydrateFallbackElement:o.props.hydrateFallbackElement,HydrateFallback:o.props.HydrateFallback,errorElement:o.props.errorElement,ErrorBoundary:o.props.ErrorBoundary,hasErrorBoundary:o.props.hasErrorBoundary===!0||o.props.ErrorBoundary!=null||o.props.errorElement!=null,shouldRevalidate:o.props.shouldRevalidate,handle:o.props.handle,lazy:o.props.lazy};o.props.children&&(d.children=Yd(o.props.children,u)),i.push(d)}),i}var kr="get",Mr="application/x-www-form-urlencoded";function Jr(n){return typeof HTMLElement<"u"&&n instanceof HTMLElement}function dT(n){return Jr(n)&&n.tagName.toLowerCase()==="button"}function fT(n){return Jr(n)&&n.tagName.toLowerCase()==="form"}function hT(n){return Jr(n)&&n.tagName.toLowerCase()==="input"}function pT(n){return!!(n.metaKey||n.altKey||n.ctrlKey||n.shiftKey)}function mT(n,a){return n.button===0&&(!a||a==="_self")&&!pT(n)}function Kd(n=""){return new URLSearchParams(typeof n=="string"||Array.isArray(n)||n instanceof URLSearchParams?n:Object.keys(n).reduce((a,i)=>{let o=n[i];return a.concat(Array.isArray(o)?o.map(r=>[i,r]):[[i,o]])},[]))}function gT(n,a){let i=Kd(n);return a&&a.forEach((o,r)=>{i.has(r)||a.getAll(r).forEach(u=>{i.append(r,u)})}),i}var xr=null;function yT(){if(xr===null)try{new FormData(document.createElement("form"),0),xr=!1}catch{xr=!0}return xr}var vT=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function Ed(n){return n!=null&&!vT.has(n)?(On(!1,`"${n}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${Mr}"`),null):n}function bT(n,a){let i,o,r,u,d;if(fT(n)){let p=n.getAttribute("action");o=p?Aa(p,a):null,i=n.getAttribute("method")||kr,r=Ed(n.getAttribute("enctype"))||Mr,u=new FormData(n)}else if(dT(n)||hT(n)&&(n.type==="submit"||n.type==="image")){let p=n.form;if(p==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let m=n.getAttribute("formaction")||p.getAttribute("action");if(o=m?Aa(m,a):null,i=n.getAttribute("formmethod")||p.getAttribute("method")||kr,r=Ed(n.getAttribute("formenctype"))||Ed(p.getAttribute("enctype"))||Mr,u=new FormData(p,n),!yT()){let{name:g,type:y,value:v}=n;if(y==="image"){let _=g?`${g}.`:"";u.append(`${_}x`,"0"),u.append(`${_}y`,"0")}else g&&u.append(g,v)}}else{if(Jr(n))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');i=kr,o=null,r=Mr,d=n}return u&&r==="text/plain"&&(d=u,u=void 0),{action:o,method:i.toLowerCase(),encType:r,formData:u,body:d}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function Df(n,a){if(n===!1||n===null||typeof n>"u")throw new Error(a)}function ST(n,a,i,o){let r=typeof n=="string"?new URL(n,typeof window>"u"?"server://singlefetch/":window.location.origin):n;return i?r.pathname.endsWith("/")?r.pathname=`${r.pathname}_.${o}`:r.pathname=`${r.pathname}.${o}`:r.pathname==="/"?r.pathname=`_root.${o}`:a&&Aa(r.pathname,a)==="/"?r.pathname=`${a.replace(/\/$/,"")}/_root.${o}`:r.pathname=`${r.pathname.replace(/\/$/,"")}.${o}`,r}async function _T(n,a){if(n.id in a)return a[n.id];try{let i=await import(n.module);return a[n.id]=i,i}catch(i){return console.error(`Error loading route module \`${n.module}\`, reloading page...`),console.error(i),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function xT(n){return n==null?!1:n.href==null?n.rel==="preload"&&typeof n.imageSrcSet=="string"&&typeof n.imageSizes=="string":typeof n.rel=="string"&&typeof n.href=="string"}async function TT(n,a,i){let o=await Promise.all(n.map(async r=>{let u=a.routes[r.route.id];if(u){let d=await _T(u,i);return d.links?d.links():[]}return[]}));return jT(o.flat(1).filter(xT).filter(r=>r.rel==="stylesheet"||r.rel==="preload").map(r=>r.rel==="stylesheet"?{...r,rel:"prefetch",as:"style"}:{...r,rel:"prefetch"}))}function Cy(n,a,i,o,r,u){let d=(m,g)=>i[g]?m.route.id!==i[g].route.id:!0,p=(m,g)=>{var y;return i[g].pathname!==m.pathname||((y=i[g].route.path)==null?void 0:y.endsWith("*"))&&i[g].params["*"]!==m.params["*"]};return u==="assets"?a.filter((m,g)=>d(m,g)||p(m,g)):u==="data"?a.filter((m,g)=>{var v;let y=o.routes[m.route.id];if(!y||!y.hasLoader)return!1;if(d(m,g)||p(m,g))return!0;if(m.route.shouldRevalidate){let _=m.route.shouldRevalidate({currentUrl:new URL(r.pathname+r.search+r.hash,window.origin),currentParams:((v=i[0])==null?void 0:v.params)||{},nextUrl:new URL(n,window.origin),nextParams:m.params,defaultShouldRevalidate:!0});if(typeof _=="boolean")return _}return!0}):[]}function ET(n,a,{includeHydrateFallback:i}={}){return CT(n.map(o=>{let r=a.routes[o.route.id];if(!r)return[];let u=[r.module];return r.clientActionModule&&(u=u.concat(r.clientActionModule)),r.clientLoaderModule&&(u=u.concat(r.clientLoaderModule)),i&&r.hydrateFallbackModule&&(u=u.concat(r.hydrateFallbackModule)),r.imports&&(u=u.concat(r.imports)),u}).flat(1))}function CT(n){return[...new Set(n)]}function AT(n){let a={},i=Object.keys(n).sort();for(let o of i)a[o]=n[o];return a}function jT(n,a){let i=new Set;return new Set(a),n.reduce((o,r)=>{let u=JSON.stringify(AT(r));return i.has(u)||(i.add(u),o.push({key:u,link:r})),o},[])}function k0(){let n=S.useContext(Li);return Df(n,"You must render this element inside a <DataRouterContext.Provider> element"),n}function NT(){let n=S.useContext(Zr);return Df(n,"You must render this element inside a <DataRouterStateContext.Provider> element"),n}var kf=S.createContext(void 0);kf.displayName="FrameworkContext";function M0(){let n=S.useContext(kf);return Df(n,"You must render this element inside a <HydratedRouter> element"),n}function wT(n,a){let i=S.useContext(kf),[o,r]=S.useState(!1),[u,d]=S.useState(!1),{onFocus:p,onBlur:m,onMouseEnter:g,onMouseLeave:y,onTouchStart:v}=a,_=S.useRef(null);S.useEffect(()=>{if(n==="render"&&d(!0),n==="viewport"){let E=A=>{A.forEach(k=>{d(k.isIntersecting)})},j=new IntersectionObserver(E,{threshold:.5});return _.current&&j.observe(_.current),()=>{j.disconnect()}}},[n]),S.useEffect(()=>{if(o){let E=setTimeout(()=>{d(!0)},100);return()=>{clearTimeout(E)}}},[o]);let T=()=>{r(!0)},C=()=>{r(!1),d(!1)};return i?n!=="intent"?[u,_,{}]:[u,_,{onFocus:Rl(p,T),onBlur:Rl(m,C),onMouseEnter:Rl(g,T),onMouseLeave:Rl(y,C),onTouchStart:Rl(v,T)}]:[!1,_,{}]}function Rl(n,a){return i=>{n&&n(i),i.defaultPrevented||a(i)}}function DT({page:n,...a}){let{router:i}=k0(),o=S.useMemo(()=>g0(i.routes,n,i.basename),[i.routes,n,i.basename]);return o?S.createElement(MT,{page:n,matches:o,...a}):null}function kT(n){let{manifest:a,routeModules:i}=M0(),[o,r]=S.useState([]);return S.useEffect(()=>{let u=!1;return TT(n,a,i).then(d=>{u||r(d)}),()=>{u=!0}},[n,a,i]),o}function MT({page:n,matches:a,...i}){let o=Wt(),{future:r,manifest:u,routeModules:d}=M0(),{basename:p}=k0(),{loaderData:m,matches:g}=NT(),y=S.useMemo(()=>Cy(n,a,g,u,o,"data"),[n,a,g,u,o]),v=S.useMemo(()=>Cy(n,a,g,u,o,"assets"),[n,a,g,u,o]),_=S.useMemo(()=>{if(n===o.pathname+o.search+o.hash)return[];let E=new Set,j=!1;if(a.forEach(k=>{var $;let R=u.routes[k.route.id];!R||!R.hasLoader||(!y.some(H=>H.route.id===k.route.id)&&k.route.id in m&&(($=d[k.route.id])!=null&&$.shouldRevalidate)||R.hasClientLoader?j=!0:E.add(k.route.id))}),E.size===0)return[];let A=ST(n,p,r.unstable_trailingSlashAwareDataRequests,"data");return j&&E.size>0&&A.searchParams.set("_routes",a.filter(k=>E.has(k.route.id)).map(k=>k.route.id).join(",")),[A.pathname+A.search]},[p,r.unstable_trailingSlashAwareDataRequests,m,o,u,y,a,n,d]),T=S.useMemo(()=>ET(v,u),[v,u]),C=kT(v);return S.createElement(S.Fragment,null,_.map(E=>S.createElement("link",{key:E,rel:"prefetch",as:"fetch",href:E,...i})),T.map(E=>S.createElement("link",{key:E,rel:"modulepreload",href:E,...i})),C.map(({key:E,link:j})=>S.createElement("link",{key:E,nonce:i.nonce,...j,crossOrigin:j.crossOrigin??i.crossOrigin})))}function RT(...n){return a=>{n.forEach(i=>{typeof i=="function"?i(a):i!=null&&(i.current=a)})}}var OT=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{OT&&(window.__reactRouterVersion="7.13.1")}catch{}function BT({basename:n,children:a,unstable_useTransitions:i,window:o}){let r=S.useRef();r.current==null&&(r.current=hx({window:o,v5Compat:!0}));let u=r.current,[d,p]=S.useState({action:u.action,location:u.location}),m=S.useCallback(g=>{i===!1?p(g):S.startTransition(()=>p(g))},[i]);return S.useLayoutEffect(()=>u.listen(m),[u,m]),S.createElement(cT,{basename:n,children:a,location:d.location,navigationType:d.action,navigator:u,unstable_useTransitions:i})}var R0=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Mf=S.forwardRef(function({onClick:a,discover:i="render",prefetch:o="none",relative:r,reloadDocument:u,replace:d,unstable_mask:p,state:m,target:g,to:y,preventScrollReset:v,viewTransition:_,unstable_defaultShouldRevalidate:T,...C},E){let{basename:j,navigator:A,unstable_useTransitions:k}=S.useContext(Sn),R=typeof y=="string"&&R0.test(y),$=_0(y,j);y=$.to;let H=$x(y,{relative:r}),V=Wt(),q=null;if(p){let G=Kr(p,[],V.unstable_mask?V.unstable_mask.pathname:"/",!0);j!=="/"&&(G.pathname=G.pathname==="/"?j:Xn([j,G.pathname])),q=A.createHref(G)}let[O,ee,ae]=wT(o,C),I=IT(y,{replace:d,unstable_mask:p,state:m,target:g,preventScrollReset:v,relative:r,viewTransition:_,unstable_defaultShouldRevalidate:T,unstable_useTransitions:k});function se(G){a&&a(G),G.defaultPrevented||I(G)}let Y=!($.isExternal||u),fe=S.createElement("a",{...C,...ae,href:(Y?q:void 0)||$.absoluteURL||H,onClick:Y?se:a,ref:RT(E,ee),target:g,"data-discover":!R&&i==="render"?"true":void 0});return O&&!R?S.createElement(S.Fragment,null,fe,S.createElement(DT,{page:H})):fe});Mf.displayName="Link";var LT=S.forwardRef(function({"aria-current":a="page",caseSensitive:i=!1,className:o="",end:r=!1,style:u,to:d,viewTransition:p,children:m,...g},y){let v=no(d,{relative:g.relative}),_=Wt(),T=S.useContext(Zr),{navigator:C,basename:E}=S.useContext(Sn),j=T!=null&&qT(v)&&p===!0,A=C.encodeLocation?C.encodeLocation(v).pathname:v.pathname,k=_.pathname,R=T&&T.navigation&&T.navigation.location?T.navigation.location.pathname:null;i||(k=k.toLowerCase(),R=R?R.toLowerCase():null,A=A.toLowerCase()),R&&E&&(R=Aa(R,E)||R);const $=A!=="/"&&A.endsWith("/")?A.length-1:A.length;let H=k===A||!r&&k.startsWith(A)&&k.charAt($)==="/",V=R!=null&&(R===A||!r&&R.startsWith(A)&&R.charAt(A.length)==="/"),q={isActive:H,isPending:V,isTransitioning:j},O=H?a:void 0,ee;typeof o=="function"?ee=o(q):ee=[o,H?"active":null,V?"pending":null,j?"transitioning":null].filter(Boolean).join(" ");let ae=typeof u=="function"?u(q):u;return S.createElement(Mf,{...g,"aria-current":O,className:ee,ref:y,style:ae,to:d,viewTransition:p},typeof m=="function"?m(q):m)});LT.displayName="NavLink";var UT=S.forwardRef(({discover:n="render",fetcherKey:a,navigate:i,reloadDocument:o,replace:r,state:u,method:d=kr,action:p,onSubmit:m,relative:g,preventScrollReset:y,viewTransition:v,unstable_defaultShouldRevalidate:_,...T},C)=>{let{unstable_useTransitions:E}=S.useContext(Sn),j=PT(),A=GT(p,{relative:g}),k=d.toLowerCase()==="get"?"get":"post",R=typeof p=="string"&&R0.test(p),$=H=>{if(m&&m(H),H.defaultPrevented)return;H.preventDefault();let V=H.nativeEvent.submitter,q=(V==null?void 0:V.getAttribute("formmethod"))||d,O=()=>j(V||H.currentTarget,{fetcherKey:a,method:q,navigate:i,replace:r,state:u,relative:g,preventScrollReset:y,viewTransition:v,unstable_defaultShouldRevalidate:_});E&&i!==!1?S.startTransition(()=>O()):O()};return S.createElement("form",{ref:C,method:k,action:A,onSubmit:o?m:$,...T,"data-discover":!R&&n==="render"?"true":void 0})});UT.displayName="Form";function zT(n){return`${n} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function O0(n){let a=S.useContext(Li);return at(a,zT(n)),a}function IT(n,{target:a,replace:i,unstable_mask:o,state:r,preventScrollReset:u,relative:d,viewTransition:p,unstable_defaultShouldRevalidate:m,unstable_useTransitions:g}={}){let y=Xr(),v=Wt(),_=no(n,{relative:d});return S.useCallback(T=>{if(mT(T,a)){T.preventDefault();let C=i!==void 0?i:$l(v)===$l(_),E=()=>y(n,{replace:C,unstable_mask:o,state:r,preventScrollReset:u,relative:d,viewTransition:p,unstable_defaultShouldRevalidate:m});g?S.startTransition(()=>E()):E()}},[v,y,_,i,o,r,a,n,u,d,p,m,g])}function Rf(n){On(typeof URLSearchParams<"u","You cannot use the `useSearchParams` hook in a browser that does not support the URLSearchParams API. If you need to support Internet Explorer 11, we recommend you load a polyfill such as https://github.com/ungap/url-search-params.");let a=S.useRef(Kd(n)),i=S.useRef(!1),o=Wt(),r=S.useMemo(()=>gT(o.search,i.current?null:a.current),[o.search]),u=Xr(),d=S.useCallback((p,m)=>{const g=Kd(typeof p=="function"?p(new URLSearchParams(r)):p);i.current=!0,u("?"+g,m)},[u,r]);return[r,d]}var VT=0,HT=()=>`__${String(++VT)}__`;function PT(){let{router:n}=O0("useSubmit"),{basename:a}=S.useContext(Sn),i=iT(),o=n.fetch,r=n.navigate;return S.useCallback(async(u,d={})=>{let{action:p,method:m,encType:g,formData:y,body:v}=bT(u,a);if(d.navigate===!1){let _=d.fetcherKey||HT();await o(_,i,d.action||p,{unstable_defaultShouldRevalidate:d.unstable_defaultShouldRevalidate,preventScrollReset:d.preventScrollReset,formData:y,body:v,formMethod:d.method||m,formEncType:d.encType||g,flushSync:d.flushSync})}else await r(d.action||p,{unstable_defaultShouldRevalidate:d.unstable_defaultShouldRevalidate,preventScrollReset:d.preventScrollReset,formData:y,body:v,formMethod:d.method||m,formEncType:d.encType||g,replace:d.replace,state:d.state,fromRouteId:i,flushSync:d.flushSync,viewTransition:d.viewTransition})},[o,r,a,i])}function GT(n,{relative:a}={}){let{basename:i}=S.useContext(Sn),o=S.useContext(Bn);at(o,"useFormAction must be used inside a RouteContext");let[r]=o.matches.slice(-1),u={...no(n||".",{relative:a})},d=Wt();if(n==null){u.search=d.search;let p=new URLSearchParams(u.search),m=p.getAll("index");if(m.some(y=>y==="")){p.delete("index"),m.filter(v=>v).forEach(v=>p.append("index",v));let y=p.toString();u.search=y?`?${y}`:""}}return(!n||n===".")&&r.route.index&&(u.search=u.search?u.search.replace(/^\?/,"?index&"):"?index"),i!=="/"&&(u.pathname=u.pathname==="/"?i:Xn([i,u.pathname])),$l(u)}function qT(n,{relative:a}={}){let i=S.useContext(T0);at(i!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:o}=O0("useViewTransitionState"),r=no(n,{relative:a});if(!i.isTransitioning)return!1;let u=Aa(i.currentLocation.pathname,o)||i.currentLocation.pathname,d=Aa(i.nextLocation.pathname,o)||i.nextLocation.pathname;return Yl(r.pathname,d)!=null||Yl(r.pathname,u)!=null}function Pn(){const n=Xr();return S.useCallback((a,i)=>{typeof a=="number"?n(a):n(a,i)},[n])}function B0(n){return`/sessions/${encodeURIComponent(n)}`}function Kl(n){return`/projects/${encodeURIComponent(n)}`}function as(n,a){const i=`/tasks/${encodeURIComponent(n)}`;return a?`${i}/${a}`:i}function FT(n){return`/tasks/${encodeURIComponent(n)}/edit`}function Bs(n,a){const i=new URLSearchParams({project:n});return a&&i.set("parent",a),`/tasks/new?${i.toString()}`}function L0(n,a){return`/sessions/new?${new URLSearchParams({env:n,runtime:a}).toString()}`}const Ay="/environments/new",ki="/settings",$T="/pair";function Kt(n){return typeof n=="object"&&n!==null&&!Array.isArray(n)}function Zl(n,a){return console.warn(`[ws] Malformed "${n}" message: ${a}`),!1}function YT(n){return Kt(n)&&typeof n.id=="string"&&typeof n.displayName=="string"&&typeof n.adapterType=="string"&&typeof n.defaultRuntime=="string"&&typeof n.status=="string"&&typeof n.bootstrapped=="boolean"}function jy(n){return Kt(n)&&typeof n.id=="string"&&typeof n.environmentId=="string"&&typeof n.runtime=="string"&&typeof n.status=="string"&&typeof n.prompt=="string"&&typeof n.startedAt=="string"&&(n.endedAt===void 0||typeof n.endedAt=="string")&&(n.error===void 0||typeof n.error=="string")}function Ny(n){return Kt(n)&&typeof n.sessionId=="string"&&typeof n.eventType=="string"&&typeof n.timestamp=="string"&&typeof n.content=="string"&&(n.raw===void 0||typeof n.raw=="string")}function KT(n){return Kt(n)&&typeof n.id=="string"&&typeof n.name=="string"&&typeof n.description=="string"&&typeof n.repoUrl=="string"&&typeof n.defaultEnvironmentId=="string"&&typeof n.status=="string"&&typeof n.worktreeBasePath=="string"&&typeof n.useWorktrees=="boolean"&&typeof n.createdAt=="string"&&typeof n.updatedAt=="string"}function ZT(n){return Kt(n)&&typeof n.id=="string"&&typeof n.projectId=="string"&&typeof n.title=="string"&&typeof n.status=="string"&&typeof n.branch=="string"&&typeof n.sortOrder=="number"&&typeof n.depth=="number"&&Array.isArray(n.dependsOn)&&Array.isArray(n.childTaskIds)}function XT(n){return Kt(n)&&typeof n.id=="string"&&typeof n.projectId=="string"&&typeof n.taskId=="string"&&typeof n.sessionId=="string"&&typeof n.category=="string"&&typeof n.title=="string"&&typeof n.content=="string"&&Array.isArray(n.tags)&&typeof n.createdAt=="string"}function QT(n){return Kt(n)&&typeof n.name=="string"&&typeof n.tokenType=="string"&&typeof n.envVar=="string"&&typeof n.filePath=="string"&&typeof n.expiresAt=="string"}const JT=new Set(["off","subscription","api_key"]),Cd=new Set(["off","on"]);function WT(n){return Kt(n)&&JT.has(n.claude)&&Cd.has(n.github)&&Cd.has(n.copilot)&&Cd.has(n.codex)}function eE(n){return Kt(n)&&typeof n.environmentId=="string"&&typeof n.stage=="string"&&typeof n.message=="string"&&typeof n.progress=="number"}function tE(n){return Kt(n)&&typeof n.name=="string"&&typeof n.repository=="string"&&typeof n.state=="string"&&typeof n.gitStatus=="string"}function nE(n){return Kt(n)&&typeof n.id=="string"&&typeof n.name=="string"&&typeof n.description=="string"&&typeof n.systemPrompt=="string"&&typeof n.toolConfig=="string"&&typeof n.runtime=="string"&&typeof n.model=="string"&&typeof n.maxTurns=="number"&&typeof n.mcpServers=="string"&&typeof n.createdAt=="string"&&typeof n.updatedAt=="string"}function Qn(n,a,i,o){return Array.isArray(n)?n.filter((r,u)=>a(r)?!0:(Zl(i,`item at index ${u} in "${o}" has unexpected shape`),!1)):(Zl(i,`expected "${o}" to be an array, got ${typeof n}`),[])}function aE(n){let a;try{a=JSON.parse(n)}catch{console.warn("[ws] Failed to parse WebSocket message as JSON");return}if(!Kt(a)||typeof a.type!="string"){console.warn("[ws] Received WebSocket message without a string 'type' field:",a);return}return{type:a.type,payload:Kt(a.payload)?a.payload:void 0}}function sE(n){switch(n){case"waiting_input":return"idle";case"killed":return"interrupted";default:return n}}const iE=3e3,Ti=5e3,lE=4001;function oE(n,a){const i=typeof window<"u"?`${window.location.protocol==="https:"?"wss:":"ws:"}//${window.location.host}`:"ws://localhost:3000",o=S.useRef(void 0),[r,u]=S.useState(!1),d=S.useRef(a.onMessage);d.current=a.onMessage;const p=S.useRef(a.onConnect);p.current=a.onConnect;const m=S.useRef(a.onDisconnect);m.current=a.onDisconnect;const g=S.useCallback(y=>{var v;((v=o.current)==null?void 0:v.readyState)===WebSocket.OPEN&&o.current.send(JSON.stringify(y))},[]);return S.useEffect(()=>{let y,v;function _(){y=new WebSocket(i),o.current=y,y.onopen=()=>{u(!0),p.current(g)},y.onmessage=T=>{if(typeof T.data!="string"){console.warn("[ws] Received non-string WebSocket message; ignoring");return}const C=aE(T.data);C&&d.current(C)},y.onclose=T=>{var C;if(u(!1),o.current=void 0,(C=m.current)==null||C.call(m),clearTimeout(v),T.code===lE){window.location.href=$T;return}v=setTimeout(_,iE)},y.onerror=()=>{y.close()}}return _(),()=>{clearTimeout(v),y==null||y.close()}},[i,g]),{connected:r,send:g}}const rE=5e3;function cE(n){const[a,i]=S.useState([]),[o,r]=S.useState({}),u=S.useCallback(y=>{var v,_;switch(y.type){case"environments":return i(Qn((v=y.payload)==null?void 0:v.environments,YT,"environments","environments")),!0;case"provision_progress":{if(!eE(y.payload))return Zl("provision_progress","payload is not a valid ProvisionStatus with environmentId"),!0;const T=y.payload;return r(C=>({...C,[T.environmentId]:{stage:T.stage,message:T.message,progress:T.progress}})),T.stage==="ready"&&setTimeout(()=>{r(C=>{const E={...C};return delete E[T.environmentId],E})},rE),!0}case"environment_added":return!0;case"environment_removed":if(typeof((_=y.payload)==null?void 0:_.environmentId)=="string"){const T=y.payload.environmentId;i(C=>C.filter(E=>E.id!==T)),r(C=>{const E={...C};return delete E[T],E})}return n({type:"list_sessions"}),!0;default:return!1}},[n]),d=S.useCallback((y,v,_,T)=>{const C={displayName:y,adapterType:v,adapterConfig:_||{}};T&&(C.defaultRuntime=T),n({type:"add_environment",payload:C})},[n]),p=S.useCallback(y=>{n({type:"provision_environment",payload:{environmentId:y}})},[n]),m=S.useCallback(y=>{n({type:"stop_environment",payload:{environmentId:y}})},[n]),g=S.useCallback(y=>{n({type:"remove_environment",payload:{environmentId:y}})},[n]);return{environments:a,provisionStatus:o,addEnvironment:d,provisionEnvironment:p,stopEnvironment:m,removeEnvironment:g,handleMessage:u}}const Ad=new Set(["pending","running","idle"]),uE=new Set(["completed","failed","interrupted"]),wy=["pending","running","idle"];function dE(n){const[a,i]=S.useState([]),[o,r]=S.useState([]),[u,d]=S.useState(0),[p,m]=S.useState(void 0),[g,y]=S.useState({}),v=S.useCallback(k=>{var R,$,H,V,q;switch(k.type){case"sessions":return i(O=>{var I;const ee=Qn((I=k.payload)==null?void 0:I.sessions,jy,"sessions","sessions"),ae=new Map(O.map(se=>[se.id,se.status]));return ee.map(se=>{const Y=ae.get(se.id);return!Y||Y===se.status?se:uE.has(Y)&&Ad.has(se.status)?{...se,status:Y}:Ad.has(Y)&&Ad.has(se.status)&&wy.indexOf(Y)>wy.indexOf(se.status)?{...se,status:Y}:se})}),!0;case"session_event":{if(!Ny(k.payload))return Zl("session_event","payload is not a valid SessionEvent"),!0;const O=k.payload;let ee=0;if(r(ae=>{const I=[...ae,O];return I.length>Ti?(ee=I.length-Ti,I.slice(-Ti)):I}),ee>0&&d(ae=>ae+ee),O.eventType==="status"){const ae=sE(O.content);i(I=>I.some(Y=>Y.id===O.sessionId)?I.map(Y=>Y.id===O.sessionId?{...Y,status:ae}:Y):[...I,{id:O.sessionId,environmentId:"",runtime:"",status:ae,prompt:"",startedAt:O.timestamp}])}return!0}case"session_events":{const O=Qn((R=k.payload)==null?void 0:R.events,Ny,"session_events","events"),ee=($=k.payload)==null?void 0:$.sessionId;if(typeof ee!="string")return Zl("session_events","missing or non-string sessionId"),!0;if(O.length>0){let ae=0;r(I=>{const se=new Set;for(const G of I)G.sessionId===ee&&se.add(`${G.timestamp}|${G.eventType}`);const Y=O.filter(G=>!se.has(`${G.timestamp}|${G.eventType}`)),fe=[...I,...Y].sort((G,U)=>G.sessionId!==U.sessionId?0:G.timestamp.localeCompare(U.timestamp));return fe.length>Ti?(ae=fe.length-Ti,fe.slice(-Ti)):fe}),ae>0&&d(I=>I+ae)}return!0}case"spawned":{const O=(H=k.payload)==null?void 0:H.sessionId;return typeof O=="string"&&O&&m(O),n({type:"list_sessions"}),!0}case"task_sessions":{const O=(V=k.payload)==null?void 0:V.taskId;if(typeof O!="string"||!O)return!0;const ee=Qn((q=k.payload)==null?void 0:q.sessions,jy,"task_sessions","sessions");return y(ae=>({...ae,[O]:ee})),!0}default:return!1}},[n]),_=S.useCallback((k,R,$,H,V,q)=>{n({type:"spawn",payload:{environmentId:k,prompt:R,model:$||"",runtime:H||"",personaId:V||"",worktreeBasePath:q||""}})},[n]),T=S.useCallback((k,R)=>{n({type:"send_input",payload:{sessionId:k,text:R}})},[n]),C=S.useCallback(k=>{n({type:"kill",payload:{sessionId:k}})},[n]),E=S.useCallback(k=>{n({type:"get_session_events",payload:{sessionId:k}})},[n]),j=S.useCallback(()=>{r([]),d(0)},[]),A=S.useCallback(k=>{n({type:"get_task_sessions",payload:{taskId:k}})},[n]);return{sessions:a,events:o,eventsDropped:u,lastSpawnedId:p,taskSessions:g,spawn:_,sendInput:T,kill:C,loadSessionEvents:E,clearEvents:j,loadTaskSessions:A,handleMessage:v}}function fE(n){const[a,i]=S.useState([]),[o,r]=S.useState(!1),u=S.useCallback(y=>{var v;switch(y.type){case"projects":return i(Qn((v=y.payload)==null?void 0:v.projects,KT,"projects","projects")),!0;case"project_created":return r(!1),n({type:"list_projects"}),!0;case"project_archived":return n({type:"list_projects"}),!0;case"project_updated":return n({type:"list_projects"}),!0;default:return!1}},[n]),d=S.useCallback(()=>{r(!1)},[]),p=S.useCallback((y,v,_,T)=>{r(!0),n({type:"create_project",payload:{name:y,description:v||"",repoUrl:_||"",defaultEnvironmentId:T||""}})},[n]),m=S.useCallback(y=>{n({type:"archive_project",payload:{projectId:y}})},[n]),g=S.useCallback((y,v)=>{n({type:"update_project",payload:{projectId:y,...v}})},[n]);return{projects:a,projectCreating:o,createProject:p,archiveProject:m,updateProject:g,handleMessage:u,onDisconnect:d}}const hE=15e3;function pE(n){const[a,i]=S.useState([]),[o,r]=S.useState(void 0),u=S.useRef(new Map),d=S.useCallback(E=>{var j,A,k,R,$,H;switch(E.type){case"tasks":{const V=Qn((j=E.payload)==null?void 0:j.tasks,ZT,"tasks","tasks"),q=(typeof((A=E.payload)==null?void 0:A.projectId)=="string"?E.payload.projectId:"")||(V.length>0?V[0].projectId:"");return q?(i(O=>[...O.filter(ee=>ee.projectId!==q),...V]),!0):(i(V),!0)}case"task_created":{const V=typeof((k=E.payload)==null?void 0:k.requestId)=="string"?E.payload.requestId:"";if(V){const O=u.current.get(V);O&&(clearTimeout(O.timer),u.current.delete(V),O.onSuccess())}const q=(R=E.payload)==null?void 0:R.task;if(Kt(q)){const O=typeof q.project_id=="string"?q.project_id:typeof q.projectId=="string"?q.projectId:"";O&&n({type:"list_tasks",payload:{projectId:O}})}return!0}case"create_task_error":{const V=typeof(($=E.payload)==null?void 0:$.requestId)=="string"?E.payload.requestId:"",q=typeof((H=E.payload)==null?void 0:H.message)=="string"?E.payload.message:"Failed to create task";if(V){const O=u.current.get(V);O?(clearTimeout(O.timer),u.current.delete(V),O.onError(q)):console.error("[useTasks] create_task_error with unknown requestId:",q)}else console.error("[useTasks] create_task_error:",q);return!0}case"task_started":{const V=E.payload;if(!Kt(V))return!0;r(O=>V.taskId&&O===V.taskId?void 0:O),V.sessionId&&(n({type:"list_sessions"}),typeof V.taskId=="string"&&typeof V.sessionId=="string"&&i(O=>O.map(ee=>ee.id===V.taskId?{...ee,latestSessionId:V.sessionId}:ee)));const q=typeof V.projectId=="string"?V.projectId:void 0;return q?n({type:"list_tasks",payload:{projectId:q}}):V.taskId&&i(O=>{const ee=O.find(ae=>ae.id===V.taskId);return ee&&n({type:"list_tasks",payload:{projectId:ee.projectId}}),O}),!0}case"task_completed":case"task_deleted":case"task_updated":{const V=E.payload;if(!Kt(V))return!0;const q=typeof V.projectId=="string"?V.projectId:void 0;return q?n({type:"list_tasks",payload:{projectId:q}}):V.taskId&&i(O=>{const ee=O.find(ae=>ae.id===V.taskId);return ee&&n({type:"list_tasks",payload:{projectId:ee.projectId}}),O}),!0}default:return!1}},[n]),p=S.useCallback(()=>{r(void 0);for(const[,E]of u.current)clearTimeout(E.timer),E.onError("Disconnected");u.current.clear()},[]),m=S.useCallback(E=>{n({type:"list_tasks",payload:{projectId:E}})},[n]),g=S.useCallback((E,j,A,k,R,$,H)=>{const V={projectId:E,title:j,description:A||"",dependsOn:k||[],parentTaskId:R||""};if($||H){const q=crypto.randomUUID();V.requestId=q;const O=H??(()=>{}),ee=setTimeout(()=>{u.current.delete(q)&&O("Request timed out")},hE);u.current.set(q,{onSuccess:$??(()=>{}),onError:O,timer:ee})}n({type:"create_task",payload:V})},[n]),y=S.useCallback((E,j,A,k,R,$)=>{r(E),n({type:"start_task",payload:{taskId:E,runtime:j||"",model:A||"",personaId:k||"",environmentId:R||"",notes:$||""}})},[n]),v=S.useCallback(E=>{n({type:"complete_task",payload:{taskId:E}})},[n]),_=S.useCallback(E=>{n({type:"resume_task",payload:{taskId:E}})},[n]),T=S.useCallback((E,j,A,k)=>{n({type:"update_task",payload:{taskId:E,title:j,description:A,dependsOn:k}})},[n]),C=S.useCallback(E=>{n({type:"delete_task",payload:{taskId:E}})},[n]);return{tasks:a,taskStartingId:o,loadTasks:m,createTask:g,startTask:y,completeTask:v,resumeTask:_,updateTask:T,deleteTask:C,handleMessage:d,onDisconnect:p}}function mE(n){const[a,i]=S.useState([]),o=S.useCallback(d=>{var p,m;switch(d.type){case"findings":return i(Qn((p=d.payload)==null?void 0:p.findings,XT,"findings","findings")),!0;case"finding_posted":return typeof((m=d.payload)==null?void 0:m.projectId)=="string"&&n({type:"list_findings",payload:{projectId:d.payload.projectId}}),!0;default:return!1}},[n]),r=S.useCallback(d=>{n({type:"list_findings",payload:{projectId:d}})},[n]),u=S.useCallback((d,p,m,g,y)=>{n({type:"post_finding",payload:{projectId:d,title:p,content:m,category:g||"general",tags:y||[]}})},[n]);return{findings:a,loadFindings:r,postFinding:u,handleMessage:o}}function gE(n){const[a,i]=S.useState([]),o=S.useCallback(p=>{var m;switch(p.type){case"tokens":return i(Qn((m=p.payload)==null?void 0:m.tokens,QT,"tokens","tokens")),!0;case"token_changed":return n({type:"list_tokens"}),!0;default:return!1}},[n]),r=S.useCallback(()=>{n({type:"list_tokens"})},[n]),u=S.useCallback((p,m,g,y,v)=>{n({type:"set_token",payload:{name:p,value:m,tokenType:g,envVar:y,filePath:v}})},[n]),d=S.useCallback(p=>{n({type:"delete_token",payload:{name:p}})},[n]);return{tokens:a,loadTokens:r,setToken:u,deleteToken:d,handleMessage:o}}function yE(n){const[a,i]=S.useState({claude:"off",github:"off",copilot:"off",codex:"off"}),o=S.useCallback(u=>{switch(u.type){case"credential_providers":return WT(u.payload)&&i(u.payload),!0;default:return!1}},[]),r=S.useCallback(u=>{n({type:"set_credential_providers",payload:u})},[n]);return{credentialProviders:a,updateCredentialProviders:r,handleMessage:o}}function vE(n,a){const[i,o]=S.useState([]),[r,u]=S.useState(""),[d,p]=S.useState(""),[m,g]=S.useState(!1),y=S.useCallback(T=>{var C,E,j;switch(T.type){case"codespaces_list":{const A=Qn((C=T.payload)==null?void 0:C.codespaces,tE,"codespaces_list","codespaces"),k=typeof((E=T.payload)==null?void 0:E.error)=="string"?T.payload.error:"";return o(A),p(k),!0}case"codespace_created":return g(!1),n({type:"list_codespaces"}),!0;case"codespace_create_error":{g(!1);const A=typeof((j=T.payload)==null?void 0:j.message)=="string"?T.payload.message:"Failed to create codespace";return u(A),!0}default:return!1}},[n]),v=S.useCallback(()=>{n({type:"list_codespaces"})},[n]),_=S.useCallback((T,C)=>{if(!a){u("Not connected to server. Please try again once the connection is restored.");return}g(!0),u("");const E={repo:T};C&&(E.machine=C),n({type:"create_codespace",payload:E})},[n,a]);return{codespaces:i,codespaceError:r,codespaceListError:d,codespaceCreating:m,listCodespaces:v,createCodespace:_,handleMessage:y}}function bE(n){const[a,i]=S.useState([]),o=S.useCallback(p=>{var m;switch(p.type){case"personas":{const g=Qn((m=p.payload)==null?void 0:m.personas,nE,"personas","personas");return i(g),!0}case"persona_created":case"persona_updated":case"persona_deleted":return n({type:"list_personas"}),!0;default:return!1}},[n]),r=S.useCallback((p,m,g,y,v,_)=>{n({type:"create_persona",payload:{name:p,description:m,systemPrompt:g,runtime:y||"",model:v||"",maxTurns:_||0}})},[n]),u=S.useCallback((p,m,g,y,v,_,T)=>{n({type:"update_persona",payload:{personaId:p,name:m||"",description:g||"",systemPrompt:y||"",runtime:v||"",model:_||"",maxTurns:T||0}})},[n]),d=S.useCallback(p=>{n({type:"delete_persona",payload:{personaId:p}})},[n]);return{personas:a,createPersona:r,updatePersona:u,deletePersona:d,handleMessage:o}}function SE(n){const{connected:a,send:i}=oE(n,{onMessage:_,onConnect:T,onDisconnect:C}),o=cE(i),r=dE(i),u=fE(i),d=pE(i),p=mE(i),m=gE(i),g=yE(i),y=vE(i,a),v=bE(i);function _(j){var A;if(!o.handleMessage(j)&&!r.handleMessage(j)&&!u.handleMessage(j)&&!d.handleMessage(j)&&!p.handleMessage(j)&&!m.handleMessage(j)&&!g.handleMessage(j)&&!y.handleMessage(j)&&!v.handleMessage(j)&&j.type==="error"){console.error("[ws]",(A=j.payload)==null?void 0:A.message);return}}function T(j){j({type:"list_environments"}),j({type:"list_sessions"}),j({type:"list_projects"}),j({type:"list_tokens"}),j({type:"get_credential_providers"}),j({type:"list_personas"}),j({type:"subscribe_all"})}function C(){u.onDisconnect(),d.onDisconnect()}const E=S.useCallback(()=>{i({type:"list_environments"}),i({type:"list_sessions"}),i({type:"list_projects"}),i({type:"list_tokens"})},[i]);return{connected:a,environments:o.environments,sessions:r.sessions,events:r.events,eventsDropped:r.eventsDropped,lastSpawnedId:r.lastSpawnedId,projects:u.projects,tasks:d.tasks,findings:p.findings,tokens:m.tokens,spawn:r.spawn,sendInput:r.sendInput,kill:r.kill,refresh:E,loadSessionEvents:r.loadSessionEvents,clearEvents:r.clearEvents,createProject:u.createProject,archiveProject:u.archiveProject,updateProject:u.updateProject,loadTasks:d.loadTasks,createTask:d.createTask,startTask:d.startTask,completeTask:d.completeTask,resumeTask:d.resumeTask,updateTask:d.updateTask,deleteTask:d.deleteTask,loadFindings:p.loadFindings,postFinding:p.postFinding,addEnvironment:o.addEnvironment,loadTokens:m.loadTokens,setToken:m.setToken,deleteToken:m.deleteToken,credentialProviders:g.credentialProviders,updateCredentialProviders:g.updateCredentialProviders,provisionStatus:o.provisionStatus,provisionEnvironment:o.provisionEnvironment,stopEnvironment:o.stopEnvironment,removeEnvironment:o.removeEnvironment,codespaces:y.codespaces,codespaceError:y.codespaceError,codespaceListError:y.codespaceListError,codespaceCreating:y.codespaceCreating,listCodespaces:y.listCodespaces,createCodespace:y.createCodespace,projectCreating:u.projectCreating,taskStartingId:d.taskStartingId,personas:v.personas,createPersona:v.createPersona,updatePersona:v.updatePersona,deletePersona:v.deletePersona,taskSessions:r.taskSessions,loadTaskSessions:r.loadTaskSessions}}const Of=S.createContext(void 0);function _E({children:n}){const a=SE();return h.jsx(Of.Provider,{value:a,children:n})}function Gt(){const n=S.useContext(Of);if(!n)throw new Error("useGrackle must be used within GrackleProvider");return n}const xE=[{id:"env-local-01",displayName:"Local Dev",adapterType:"local",defaultRuntime:"claude-code",status:"connected",bootstrapped:!0},{id:"env-docker-01",displayName:"Docker Sandbox",adapterType:"docker",defaultRuntime:"claude-code",status:"connected",bootstrapped:!0},{id:"env-cs-01",displayName:"GitHub Codespace",adapterType:"codespace",defaultRuntime:"claude-code",status:"connected",bootstrapped:!0},{id:"env-remote-01",displayName:"Staging (SSH)",adapterType:"ssh",defaultRuntime:"claude-code",status:"disconnected",bootstrapped:!1}],TE=[{id:"sess-001-prev",environmentId:"env-local-01",runtime:"claude-code",status:"failed",prompt:"Implement auth middleware",startedAt:"2026-02-26T14:00:00Z",endedAt:"2026-02-26T15:12:00Z",error:"Context window exceeded before completing implementation"},{id:"sess-001",environmentId:"env-local-01",runtime:"node",status:"running",prompt:"Refactor the authentication middleware to use JWT tokens",startedAt:"2026-02-27T08:15:00Z"},{id:"sess-002",environmentId:"env-docker-01",runtime:"python",status:"completed",prompt:"Write unit tests for the user registration endpoint",startedAt:"2026-02-27T07:30:00Z"},{id:"sess-003",environmentId:"env-local-01",runtime:"node",status:"failed",prompt:"Migrate database schema to add audit_log table",startedAt:"2026-02-26T22:45:00Z"},{id:"sess-004",environmentId:"env-docker-01",runtime:"python",status:"running",prompt:"Implement rate limiting for the public API",startedAt:"2026-02-27T09:00:00Z"}],EE=[{sessionId:"sess-001-prev",eventType:"status",timestamp:"2026-02-26T14:00:01Z",content:"running"},{sessionId:"sess-001-prev",eventType:"output",timestamp:"2026-02-26T14:00:05Z",content:"Reading src/middleware/auth.ts to understand the current authentication flow..."},{sessionId:"sess-001-prev",eventType:"error",timestamp:"2026-02-26T15:12:00Z",content:"Context window exceeded before completing implementation"},{sessionId:"sess-001",eventType:"status",timestamp:"2026-02-27T08:15:01Z",content:"running"},{sessionId:"sess-001",eventType:"output",timestamp:"2026-02-27T08:15:02Z",content:"Analyzing current authentication middleware in src/middleware/auth.ts..."},{sessionId:"sess-001",eventType:"output",timestamp:"2026-02-27T08:15:04Z",content:`Found 3 files using session-based auth:
37
- - src/middleware/auth.ts
38
- - src/routes/login.ts
39
- - src/routes/protected.ts`},{sessionId:"sess-001",eventType:"output",timestamp:"2026-02-27T08:15:07Z",content:"Installing jsonwebtoken and @types/jsonwebtoken..."},{sessionId:"sess-001",eventType:"output",timestamp:"2026-02-27T08:15:12Z",content:`Rewriting auth middleware:
40
- \`\`\`typescript
41
- import jwt from "jsonwebtoken";
42
- import type { Request, Response, NextFunction } from "express";
43
-
44
- const JWT_SECRET = process.env.JWT_SECRET || "change-me";
45
-
46
- export function verifyToken(req: Request, res: Response, next: NextFunction): void {
47
- const header = req.headers.authorization;
48
- if (!header?.startsWith("Bearer ")) {
49
- res.status(401).json({ error: "Missing token" });
50
- return;
51
- }
52
- try {
53
- const decoded = jwt.verify(header.slice(7), JWT_SECRET);
54
- req.user = decoded;
55
- next();
56
- } catch {
57
- res.status(403).json({ error: "Invalid token" });
58
- }
59
- }
60
- \`\`\``},{sessionId:"sess-001",eventType:"output",timestamp:"2026-02-27T08:15:18Z",content:"Updated login route to issue JWT tokens with 24h expiry."},{sessionId:"sess-001",eventType:"output",timestamp:"2026-02-27T08:15:22Z",content:"Running test suite... 14 tests passed, 2 updated, 0 failed."},{sessionId:"sess-002",eventType:"status",timestamp:"2026-02-27T07:30:01Z",content:"running"},{sessionId:"sess-002",eventType:"output",timestamp:"2026-02-27T07:30:05Z",content:"Generating pytest tests for POST /api/register endpoint..."},{sessionId:"sess-002",eventType:"output",timestamp:"2026-02-27T07:32:00Z",content:"Created 8 test cases covering: valid registration, duplicate email, weak password, missing fields, SQL injection, XSS payload, rate limit, and CORS headers."},{sessionId:"sess-002",eventType:"status",timestamp:"2026-02-27T07:33:00Z",content:"completed"}],CE=[{id:"proj-alpha",name:"Project Alpha",description:"Core platform API and authentication services",repoUrl:"https://github.com/acme/alpha",defaultEnvironmentId:"env-local-01",status:"active",worktreeBasePath:"",useWorktrees:!0,createdAt:"2026-01-15T10:00:00Z",updatedAt:"2026-01-15T10:00:00Z"},{id:"proj-beta",name:"Data Pipeline",description:"ETL pipelines for analytics and reporting",repoUrl:"https://github.com/acme/data-pipeline",defaultEnvironmentId:"env-docker-01",status:"active",worktreeBasePath:"",useWorktrees:!0,createdAt:"2026-02-01T14:30:00Z",updatedAt:"2026-02-01T14:30:00Z"},{id:"proj-gamma",name:"Mobile App",description:"React Native cross-platform mobile application",repoUrl:"",defaultEnvironmentId:"env-local-01",status:"archived",worktreeBasePath:"",useWorktrees:!0,createdAt:"2025-11-20T09:00:00Z",updatedAt:"2025-11-20T09:00:00Z"}],AE=[{id:"task-001",projectId:"proj-alpha",title:"Implement JWT authentication",description:"Replace session-based auth with JWT tokens across all protected routes",status:"working",branch:"feat/jwt-auth",latestSessionId:"sess-001",dependsOn:[],reviewNotes:void 0,sortOrder:1,createdAt:"2026-02-25T10:00:00Z",parentTaskId:"",depth:0,childTaskIds:["task-001a","task-001b","task-001c"],canDecompose:!0},{id:"task-001a",projectId:"proj-alpha",title:"Design token schema",description:"Define JWT payload structure, expiry, and refresh token strategy",status:"complete",branch:"feat/jwt-auth/design-token-schema",latestSessionId:"",dependsOn:[],reviewNotes:void 0,sortOrder:1,createdAt:"2026-02-25T10:10:00Z",parentTaskId:"task-001",depth:1,childTaskIds:[],canDecompose:!1},{id:"task-001b",projectId:"proj-alpha",title:"Implement auth middleware",description:"Build Express middleware that verifies JWT Bearer tokens",status:"working",branch:"feat/jwt-auth/implement-auth-middleware",latestSessionId:"sess-001",dependsOn:[],reviewNotes:void 0,sortOrder:2,createdAt:"2026-02-25T10:15:00Z",parentTaskId:"task-001",depth:1,childTaskIds:[],canDecompose:!1},{id:"task-001c",projectId:"proj-alpha",title:"Write auth integration tests",description:"End-to-end tests for login flow, token refresh, and protected route access",status:"not_started",branch:"",latestSessionId:"",dependsOn:["task-001b"],reviewNotes:void 0,sortOrder:3,createdAt:"2026-02-25T10:20:00Z",parentTaskId:"task-001",depth:1,childTaskIds:[],canDecompose:!1},{id:"task-002",projectId:"proj-alpha",title:"Add rate limiting",description:"Implement token-bucket rate limiting for public API endpoints",status:"not_started",branch:"",latestSessionId:"",dependsOn:["task-001"],reviewNotes:void 0,sortOrder:2,createdAt:"2026-02-25T10:05:00Z",parentTaskId:"",depth:0,childTaskIds:[],canDecompose:!1},{id:"task-003",projectId:"proj-alpha",title:"Set up OpenAPI documentation",description:"Generate Swagger docs from route decorators and serve at /api/docs",status:"paused",branch:"feat/openapi-docs",latestSessionId:"sess-002",dependsOn:[],reviewNotes:void 0,sortOrder:3,createdAt:"2026-02-24T16:00:00Z",parentTaskId:"",depth:0,childTaskIds:[],canDecompose:!1},{id:"task-004",projectId:"proj-alpha",title:"Database connection pooling",description:"Switch from single connection to a connection pool with health checks",status:"complete",branch:"feat/db-pool",latestSessionId:"",dependsOn:[],reviewNotes:void 0,sortOrder:4,createdAt:"2026-02-23T11:00:00Z",parentTaskId:"",depth:0,childTaskIds:[],canDecompose:!1},{id:"task-005",projectId:"proj-alpha",title:"Fix N+1 query in user list",description:"Use a JOIN instead of per-row lookups in GET /api/users",status:"not_started",branch:"fix/user-list-n1",latestSessionId:"",dependsOn:[],reviewNotes:void 0,sortOrder:5,createdAt:"2026-02-22T09:30:00Z",parentTaskId:"",depth:0,childTaskIds:[],canDecompose:!1},{id:"task-006",projectId:"proj-beta",title:"Add Parquet export support",description:"Allow pipeline outputs to be written as Parquet files for Spark consumption",status:"working",branch:"feat/parquet-export",latestSessionId:"",dependsOn:[],reviewNotes:void 0,sortOrder:1,createdAt:"2026-02-26T08:00:00Z",parentTaskId:"",depth:0,childTaskIds:["task-006a","task-006b","task-006c","task-006d"],canDecompose:!0},{id:"task-006a",projectId:"proj-beta",title:"Define Parquet schema mapping",description:"Map internal column types to Arrow/Parquet type system",status:"complete",branch:"feat/parquet-export/define-parquet-schema-mapping",latestSessionId:"",dependsOn:[],reviewNotes:void 0,sortOrder:1,createdAt:"2026-02-26T08:05:00Z",parentTaskId:"task-006",depth:1,childTaskIds:[],canDecompose:!1},{id:"task-006b",projectId:"proj-beta",title:"Implement row-group writer",description:"Write buffered row groups with configurable batch size",status:"complete",branch:"feat/parquet-export/implement-row-group-writer",latestSessionId:"",dependsOn:["task-006a"],reviewNotes:void 0,sortOrder:2,createdAt:"2026-02-26T08:10:00Z",parentTaskId:"task-006",depth:1,childTaskIds:[],canDecompose:!1},{id:"task-006c",projectId:"proj-beta",title:"Add compression options",description:"Support Snappy, ZSTD, and GZIP compression for Parquet output",status:"working",branch:"feat/parquet-export/add-compression-options",latestSessionId:"sess-004",dependsOn:["task-006b"],reviewNotes:void 0,sortOrder:3,createdAt:"2026-02-26T08:15:00Z",parentTaskId:"task-006",depth:1,childTaskIds:[],canDecompose:!1},{id:"task-006d",projectId:"proj-beta",title:"Write Parquet integration tests",description:"Round-trip tests: write Parquet, read back with pyarrow, verify data integrity",status:"not_started",branch:"",latestSessionId:"",dependsOn:["task-006c"],reviewNotes:void 0,sortOrder:4,createdAt:"2026-02-26T08:20:00Z",parentTaskId:"task-006",depth:1,childTaskIds:[],canDecompose:!1},{id:"task-007",projectId:"proj-beta",title:"Implement incremental loads",description:"Track watermarks so pipelines only process new/changed rows",status:"working",branch:"feat/incremental",latestSessionId:"sess-004",dependsOn:[],reviewNotes:void 0,sortOrder:2,createdAt:"2026-02-26T08:30:00Z",parentTaskId:"",depth:0,childTaskIds:["task-007a","task-007b"],canDecompose:!0},{id:"task-007a",projectId:"proj-beta",title:"Design watermark storage",description:"Define schema for per-pipeline high-watermark tracking",status:"complete",branch:"feat/incremental/design-watermark-storage",latestSessionId:"",dependsOn:[],reviewNotes:void 0,sortOrder:1,createdAt:"2026-02-26T08:35:00Z",parentTaskId:"task-007",depth:1,childTaskIds:[],canDecompose:!1},{id:"task-007b",projectId:"proj-beta",title:"Implement change detection query",description:"Generate WHERE clauses from watermarks to fetch only changed rows",status:"failed",branch:"feat/incremental/implement-change-detection-query",latestSessionId:"",dependsOn:["task-007a"],reviewNotes:void 0,sortOrder:2,createdAt:"2026-02-26T08:40:00Z",parentTaskId:"task-007",depth:1,childTaskIds:[],canDecompose:!1},{id:"task-008",projectId:"proj-beta",title:"Add pipeline monitoring dashboard",description:"Real-time metrics for pipeline throughput, latency, and error rates",status:"paused",branch:"feat/monitoring",latestSessionId:"",dependsOn:[],reviewNotes:void 0,sortOrder:3,createdAt:"2026-02-26T09:00:00Z",parentTaskId:"",depth:0,childTaskIds:[],canDecompose:!1}],Dy=[{id:"find-001",projectId:"proj-alpha",taskId:"task-001",sessionId:"sess-001",category:"architecture",title:"Auth middleware is tightly coupled to Express",content:"The current auth middleware directly references Express Request/Response types. Consider extracting a framework-agnostic token verification layer so we can reuse it in the WebSocket auth path.",tags:["auth","decoupling","middleware"],createdAt:"2026-02-27T08:16:00Z"},{id:"find-002",projectId:"proj-alpha",taskId:"task-003",sessionId:"sess-002",category:"api",title:"Missing pagination on GET /api/users",content:"The users endpoint returns all rows without limit/offset. For datasets over 10k rows this will cause timeouts. Recommend cursor-based pagination with a default page size of 50.",tags:["api","pagination","performance"],createdAt:"2026-02-27T07:31:00Z"},{id:"find-003",projectId:"proj-alpha",taskId:"task-005",sessionId:"sess-003",category:"bug",title:"Race condition in session cleanup",content:"When two requests hit /api/logout concurrently, the second call throws a 500 because the session row has already been deleted. Needs an idempotent DELETE or a conditional check.",tags:["bug","concurrency","sessions"],createdAt:"2026-02-26T22:50:00Z"},{id:"find-004",projectId:"proj-alpha",taskId:"task-004",sessionId:"",category:"decision",title:"Chose pg-pool over knex connection pool",content:"pg-pool gives us direct control over idle timeout, max connections, and health check queries. Knex wraps pg-pool anyway and adds overhead we don't need since we write raw SQL.",tags:["database","decision","postgres"],createdAt:"2026-02-23T11:30:00Z"},{id:"find-005",projectId:"proj-alpha",taskId:"",sessionId:"",category:"dependency",title:"jsonwebtoken has 3 high-severity CVEs",content:"The jsonwebtoken package (v8.x) has known vulnerabilities. Consider migrating to jose which is maintained, supports ESM, and covers the same JWS/JWE surface area with zero dependencies.",tags:["security","dependency","jwt"],createdAt:"2026-02-27T08:20:00Z"},{id:"find-006",projectId:"proj-alpha",taskId:"task-001",sessionId:"sess-001",category:"pattern",title:"Consistent error response shape",content:"All error responses should follow the shape `{ error: string, code: string, details?: unknown }`. Currently some routes return `{ message: string }` and others return `{ error: string }`.",tags:["api","consistency","error-handling"],createdAt:"2026-02-27T08:17:00Z"},{id:"find-007",projectId:"proj-beta",taskId:"task-007",sessionId:"sess-004",category:"architecture",title:"Watermark storage should be pluggable",content:"The incremental load watermarks are currently stored in a local SQLite file. For production multi-worker scenarios, this needs to be backed by a shared store (Redis or Postgres).",tags:["architecture","pipeline","scalability"],createdAt:"2026-02-27T09:05:00Z"}],jE=[{name:"anthropic",tokenType:"env_var",envVar:"ANTHROPIC_API_KEY",filePath:"",expiresAt:""},{name:"github",tokenType:"env_var",envVar:"GITHUB_TOKEN",filePath:"",expiresAt:"2026-12-31T23:59:59Z"},{name:"gcp-service-account",tokenType:"file",envVar:"",filePath:"/home/user/.config/gcloud/credentials.json",expiresAt:""}],NE=[{id:"persona-arch",name:"Software Architect",description:"Designs system architecture, defines interfaces, and decomposes large features into implementable tasks.",systemPrompt:"You are a senior software architect. Focus on clean interfaces, separation of concerns, and scalable patterns. When decomposing work, create concrete subtasks with clear acceptance criteria.",toolConfig:JSON.stringify({allowedTools:["Read","Grep","Glob","Write","Edit"]}),runtime:"claude-code",model:"claude-sonnet-4-5-20250929",maxTurns:50,mcpServers:"[]",createdAt:"2026-02-20T10:00:00Z",updatedAt:"2026-02-20T10:00:00Z"},{id:"persona-fe",name:"Frontend Engineer",description:"React specialist — builds UI components, writes CSS, implements routing, and creates Playwright tests.",systemPrompt:"You are a frontend engineer specializing in React, TypeScript, and modern CSS. Follow component composition patterns, use semantic HTML, and write accessible markup.",toolConfig:JSON.stringify({allowedTools:["Read","Grep","Glob","Write","Edit","Bash"]}),runtime:"claude-code",model:"claude-sonnet-4-5-20250929",maxTurns:100,mcpServers:"[]",createdAt:"2026-02-20T10:05:00Z",updatedAt:"2026-02-20T10:05:00Z"},{id:"persona-reviewer",name:"Code Reviewer",description:"Reviews diffs for correctness, security, and style. Posts findings for issues discovered.",systemPrompt:"You are a meticulous code reviewer. Check for security vulnerabilities, performance issues, and style consistency. Post findings for anything noteworthy.",toolConfig:JSON.stringify({allowedTools:["Read","Grep","Glob"]}),runtime:"claude-code",model:"claude-sonnet-4-5-20250929",maxTurns:30,mcpServers:"[]",createdAt:"2026-02-20T10:10:00Z",updatedAt:"2026-02-20T10:10:00Z"},{id:"persona-tester",name:"QA Engineer",description:"Writes comprehensive test suites — unit tests, integration tests, and E2E Playwright specs.",systemPrompt:"You are a QA engineer focused on test coverage. Write tests that cover happy paths, edge cases, error scenarios, and accessibility. Use Playwright for E2E tests.",toolConfig:JSON.stringify({allowedTools:["Read","Grep","Glob","Write","Edit","Bash"]}),runtime:"claude-code",model:"claude-sonnet-4-5-20250929",maxTurns:80,mcpServers:"[]",createdAt:"2026-02-20T10:15:00Z",updatedAt:"2026-02-20T10:15:00Z"}],wE={"task-001b":[{id:"sess-001-prev",environmentId:"env-local-01",runtime:"claude-code",status:"failed",prompt:"Implement auth middleware",startedAt:"2026-02-26T14:00:00Z"},{id:"sess-001",environmentId:"env-local-01",runtime:"claude-code",status:"running",prompt:"Implement auth middleware",startedAt:"2026-02-27T08:15:00Z"}],"task-006c":[{id:"sess-004",environmentId:"env-docker-01",runtime:"claude-code",status:"running",prompt:"Add compression options",startedAt:"2026-02-27T09:00:00Z"}]};function kt(n){return new Date(Date.now()+n).toISOString()}const ky=[{label:"API Refactor",pauseForInput:!1,steps:[{delayMs:0,event:{eventType:"status",timestamp:kt(0),content:"running"}},{delayMs:800,event:{eventType:"output",timestamp:kt(800),content:"Analyzing current API structure in src/routes/..."}},{delayMs:1600,event:{eventType:"output",timestamp:kt(1600),content:`Found 5 endpoints that need refactoring:
61
- - GET /api/users
62
- - POST /api/users
63
- - GET /api/users/:id
64
- - PUT /api/users/:id
65
- - DELETE /api/users/:id`}},{delayMs:2800,event:{eventType:"output",timestamp:kt(2800),content:"Refactoring to use Express Router with middleware chain...\n```typescript\nconst router = Router();\nrouter.use(authenticate);\nrouter.use(validateBody);\n```"}},{delayMs:4e3,event:{eventType:"output",timestamp:kt(4e3),content:"Running test suite... 22 tests passed, 3 updated, 0 failed."}},{delayMs:5e3,event:{eventType:"status",timestamp:kt(5e3),content:"completed"}}]},{label:"Database Migration",pauseForInput:!0,pauseAfterStep:3,steps:[{delayMs:0,event:{eventType:"status",timestamp:kt(0),content:"running"}},{delayMs:600,event:{eventType:"output",timestamp:kt(600),content:"Scanning current schema for migration targets..."}},{delayMs:1400,event:{eventType:"output",timestamp:kt(1400),content:`Found tables to modify:
66
- - users (add column: last_login_at)
67
- - sessions (add index on expires_at)
68
- - audit_log (new table)`}},{delayMs:2200,event:{eventType:"output",timestamp:kt(2200),content:`⚠ This migration will add a NOT NULL column to the users table.
69
- The table has 50,000+ rows — this may lock the table briefly.
70
-
71
- Please confirm to proceed.`}}],resumeSteps:[{delayMs:500,event:{eventType:"output",timestamp:kt(0),content:"Proceeding with migration..."}},{delayMs:1500,event:{eventType:"output",timestamp:kt(1e3),content:`Migration 001_add_last_login.sql applied successfully.
72
- Migration 002_sessions_index.sql applied successfully.
73
- Migration 003_audit_log.sql applied successfully.`}},{delayMs:2500,event:{eventType:"output",timestamp:kt(2e3),content:"All 3 migrations applied. Running verification queries... OK."}},{delayMs:3200,event:{eventType:"status",timestamp:kt(2700),content:"completed"}}]},{label:"Test Writer",pauseForInput:!1,steps:[{delayMs:0,event:{eventType:"status",timestamp:kt(0),content:"running"}},{delayMs:700,event:{eventType:"output",timestamp:kt(700),content:"Generating test scaffolding for src/services/billing.ts..."}},{delayMs:1800,event:{eventType:"output",timestamp:kt(1800),content:`Writing test cases:
74
- - should calculate monthly total
75
- - should apply discount codes
76
- - should handle currency conversion
77
- - should reject expired cards`}},{delayMs:2800,event:{eventType:"output",timestamp:kt(2800),content:`Error: Cannot resolve import 'src/services/stripe-client.ts' — module not found.
78
- The billing service depends on a Stripe client that doesn't exist in this environment.`}},{delayMs:3500,event:{eventType:"status",timestamp:kt(3500),content:"failed"}}]}],My=400;function DE({children:n}){const[a,i]=S.useState(TE),[o,r]=S.useState(EE),[u,d]=S.useState(void 0),[p,m]=S.useState(CE),[g,y]=S.useState(AE),[v,_]=S.useState(Dy),[T,C]=S.useState(jE),[E,j]=S.useState({claude:"off",github:"off",copilot:"off",codex:"off"}),[A,k]=S.useState(NE),[R]=S.useState(wE),$=S.useRef(0),H=S.useRef(0),V=S.useRef(new Set),q=S.useRef(new Map),O=S.useRef(g);O.current=g;const ee=S.useRef(new Map),ae=S.useRef(new Map),I=S.useCallback(J=>($.current+=1,`mock-${J}-${String($.current).padStart(3,"0")}`),[]),se=S.useCallback(()=>{const J=ky[H.current%ky.length];return H.current+=1,J},[]),Y=S.useCallback((J,ne,oe)=>{const ue=setTimeout(()=>{var be;V.current.delete(ue),oe&&((be=q.current.get(oe))==null||be.delete(ue)),J()},ne);V.current.add(ue),oe&&(q.current.has(oe)||q.current.set(oe,new Set),q.current.get(oe).add(ue))},[]),fe=S.useCallback(J=>{const ne=q.current.get(J);ne&&(ne.forEach(oe=>{clearTimeout(oe),V.current.delete(oe)}),q.current.delete(J))},[]),G=S.useCallback((J,ne)=>{i(oe=>oe.map(ue=>ue.id===J?{...ue,status:ne}:ue))},[]),U=S.useCallback(J=>{r(ne=>[...ne,J])},[]),Q=S.useCallback((J,ne,oe)=>{ne.forEach((ue,be)=>{Y(()=>{const Te={sessionId:J,...ue.event,timestamp:new Date().toISOString()};U(Te),ue.event.eventType==="status"&&G(J,ue.event.content),be===ne.length-1&&oe&&oe()},ue.delayMs,J)})},[Y,U,G]),te=S.useCallback((J,ne,oe,ue)=>{console.log("[MockGrackle] spawn",{environmentId:J,prompt:ne,runtime:ue});const be=I("sess"),Te={id:be,environmentId:J,runtime:ue||"claude-code",status:"running",prompt:ne,startedAt:new Date().toISOString()};i(De=>[...De,Te]),d(be);const Qe=se();if(console.log(`[MockGrackle] Playing scenario: ${Qe.label}`),Qe.pauseForInput){const De=Qe.pauseAfterStep??Qe.steps.length-1,Mt=Qe.steps.slice(0,De+1),wt=Mt.length>0?Mt[Mt.length-1].delayMs:0;Q(be,Mt),Y(()=>{G(be,"idle"),U({sessionId:be,eventType:"status",timestamp:new Date().toISOString(),content:"idle"})},wt+My,be),Qe.resumeSteps&&ee.current.set(be,Qe.resumeSteps)}else Q(be,Qe.steps)},[I,se,Q,Y,G,U]),we=S.useCallback(J=>{console.log("[MockGrackle] kill",J),fe(J),ee.current.delete(J),G(J,"interrupted"),U({sessionId:J,eventType:"status",timestamp:new Date().toISOString(),content:"interrupted"}),y(ne=>ne.map(oe=>oe.latestSessionId===J&&oe.status==="working"?{...oe,status:"not_started"}:oe))},[fe,G,U]),_e=S.useCallback(()=>{console.log("[MockGrackle] refresh")},[]),Ue=S.useCallback(J=>{console.log("[MockGrackle] loadSessionEvents",J)},[]),Ee=S.useCallback(()=>{console.log("[MockGrackle] clearEvents"),r([])},[]),ye=S.useCallback((J,ne,oe,ue)=>{console.log("[MockGrackle] createProject",{name:J,description:ne});const be={id:I("proj"),name:J,description:ne||"",repoUrl:oe||"",defaultEnvironmentId:ue||"",status:"active",worktreeBasePath:"",useWorktrees:!0,createdAt:new Date().toISOString(),updatedAt:new Date().toISOString()};m(Te=>[...Te,be])},[I]),xe=S.useCallback(J=>{console.log("[MockGrackle] archiveProject",J),m(ne=>ne.map(oe=>oe.id===J?{...oe,status:"archived"}:oe))},[]),W=S.useCallback(J=>{console.log("[MockGrackle] loadTasks",J)},[]),K=S.useCallback((J,ne,oe,ue,be,Te,Qe)=>{console.log("[MockGrackle] createTask",{projectId:J,title:ne,parentTaskId:be}),y(De=>{const wt=De.filter(We=>We.projectId===J).reduce((We,Zt)=>Math.max(We,Zt.sortOrder),0),it=be?De.find(We=>We.id===be):void 0;if(be&&!it)return console.warn("[MockGrackle] Parent task not found:",be),De;if(it&&!it.canDecompose)return console.warn("[MockGrackle] Parent task does not have decomposition rights:",be),De;const tn=it?it.depth+1:0,rt={id:I("task"),projectId:J,title:ne,description:oe||"",status:"not_started",branch:"",latestSessionId:"",dependsOn:ue||[],reviewNotes:void 0,sortOrder:wt+1,createdAt:new Date().toISOString(),parentTaskId:be||"",depth:tn,childTaskIds:[],canDecompose:!be};return[...De,rt]}),Te&&Te()},[I]),me=S.useCallback((J,ne,oe)=>{var Mt;console.log("[MockGrackle] startTask",{taskId:J,runtime:ne});const ue=O.current.find(wt=>wt.id===J),be=(ue==null?void 0:ue.title)??"",Te=I("sess"),Qe={id:Te,environmentId:"env-local-01",runtime:ne||"claude-code",status:"running",prompt:be||J,startedAt:new Date().toISOString()};i(wt=>[...wt,Qe]),y(wt=>wt.map(it=>it.id===J?{...it,status:"working",latestSessionId:Te,branch:`mock/${J.slice(0,8)}`}:it));const De=se();if(console.log(`[MockGrackle] Playing task scenario: ${De.label}`),De.pauseForInput){const wt=De.pauseAfterStep??De.steps.length-1,it=De.steps.slice(0,wt+1),tn=it.length>0?it[it.length-1].delayMs:0;if(Q(Te,it),Y(()=>{G(Te,"idle"),U({sessionId:Te,eventType:"status",timestamp:new Date().toISOString(),content:"idle"})},tn+My,Te),De.resumeSteps){const rt=[...De.resumeSteps];ee.current.set(Te,rt);const We=rt.reduce((Zt,gt)=>Math.max(Zt,gt.delayMs),0);ae.current.set(Te,{taskId:J,delayAfterResume:We+200})}}else{const wt=De.steps.length>0?De.steps[De.steps.length-1].delayMs:0;Q(Te,De.steps);const it=(Mt=De.steps[De.steps.length-1])==null?void 0:Mt.event.content;Y(()=>{it==="completed"?y(tn=>tn.map(rt=>rt.id===J&&rt.status==="working"?{...rt,status:"paused"}:rt)):it==="failed"&&y(tn=>tn.map(rt=>rt.id===J&&rt.status==="working"?{...rt,status:"failed"}:rt))},wt+100,Te)}},[I,se,Q,Y,G,U]),Ae=S.useCallback((J,ne)=>{console.log("[MockGrackle] sendInput",{sessionId:J,text:ne}),U({sessionId:J,eventType:"output",timestamp:new Date().toISOString(),content:`User input: ${ne}`}),G(J,"running"),U({sessionId:J,eventType:"status",timestamp:new Date().toISOString(),content:"running"});const oe=ee.current.get(J);if(oe)ee.current.delete(J),Q(J,oe);else{const be=[{delayMs:500,event:{eventType:"output",timestamp:new Date().toISOString(),content:"I received your input, continuing..."}},{delayMs:1500,event:{eventType:"status",timestamp:new Date().toISOString(),content:"completed"}}];Q(J,be)}const ue=ae.current.get(J);ue&&(ae.current.delete(J),Y(()=>{y(be=>be.map(Te=>Te.id===ue.taskId&&Te.status==="working"?{...Te,status:"paused"}:Te))},ue.delayAfterResume,J))},[U,G,Q,Y]),Ve=S.useCallback(J=>{console.log("[MockGrackle] completeTask",J),y(ne=>ne.map(oe=>oe.id===J?{...oe,status:"complete"}:oe))},[]),mt=S.useCallback(J=>{console.log("[MockGrackle] resumeTask",J)},[]),Tt=S.useCallback((J,ne,oe,ue)=>{console.log("[MockGrackle] updateTask",{taskId:J,title:ne}),y(be=>be.map(Te=>Te.id===J?{...Te,title:ne.trim()||Te.title,description:oe,dependsOn:ue}:Te))},[]),Bt=S.useCallback(J=>{console.log("[MockGrackle] deleteTask",J),y(ne=>ne.filter(oe=>oe.id!==J))},[]),Xe=S.useCallback(J=>{console.log("[MockGrackle] loadFindings",J),_(Dy.filter(ne=>ne.projectId===J))},[]),qe=S.useCallback((J,ne,oe,ue,be)=>{console.log("[MockGrackle] postFinding",{projectId:J,title:ne});const Te={id:I("find"),projectId:J,taskId:"",sessionId:"",category:ue||"general",title:ne,content:oe,tags:be||[],createdAt:new Date().toISOString()};_(Qe=>[...Qe,Te])},[I]),Be=S.useCallback((J,ne,oe,ue)=>{console.log("[MockGrackle] addEnvironment",{displayName:J,adapterType:ne,adapterConfig:oe,defaultRuntime:ue})},[]),Ln=S.useCallback(()=>{console.log("[MockGrackle] loadTokens")},[]),Un=S.useCallback((J,ne,oe,ue,be)=>{console.log("[MockGrackle] setToken",{name:J,tokenType:oe}),C(Te=>[...Te.filter(De=>De.name!==J),{name:J,tokenType:oe,envVar:ue,filePath:be,expiresAt:""}])},[]),ea=S.useCallback(J=>{console.log("[MockGrackle] deleteToken",J),C(ne=>ne.filter(oe=>oe.name!==J))},[]),en=S.useCallback(J=>{console.log("[MockGrackle] updateCredentialProviders",J),j(J)},[]);S.useEffect(()=>()=>{V.current.forEach(clearTimeout),V.current.clear()},[]);const ta=S.useMemo(()=>({connected:!0,environments:xE,sessions:a,events:o,eventsDropped:0,lastSpawnedId:u,projects:p,tasks:g,findings:v,tokens:T,credentialProviders:E,spawn:te,sendInput:Ae,kill:we,refresh:_e,loadSessionEvents:Ue,clearEvents:Ee,createProject:ye,archiveProject:xe,updateProject:(J,ne)=>{console.log("[MockGrackle] updateProject",{projectId:J,...ne}),m(oe=>oe.map(ue=>ue.id!==J?ue:{...ue,...ne.name!==void 0?{name:ne.name}:{},...ne.description!==void 0?{description:ne.description}:{},...ne.repoUrl!==void 0?{repoUrl:ne.repoUrl}:{},...ne.defaultEnvironmentId!==void 0?{defaultEnvironmentId:ne.defaultEnvironmentId}:{},...ne.worktreeBasePath!==void 0?{worktreeBasePath:ne.worktreeBasePath}:{},...ne.useWorktrees!==void 0?{useWorktrees:ne.useWorktrees}:{},updatedAt:new Date().toISOString()}))},loadTasks:W,createTask:K,startTask:me,completeTask:Ve,resumeTask:mt,updateTask:Tt,deleteTask:Bt,loadFindings:Xe,postFinding:qe,addEnvironment:Be,loadTokens:Ln,setToken:Un,deleteToken:ea,updateCredentialProviders:en,provisionStatus:{},provisionEnvironment:()=>{},stopEnvironment:()=>{},removeEnvironment:()=>{},codespaces:[],codespaceError:"",codespaceListError:"",codespaceCreating:!1,listCodespaces:()=>{},createCodespace:()=>{},projectCreating:!1,taskStartingId:void 0,personas:A,createPersona:(J,ne,oe,ue,be,Te)=>{console.log("[MockGrackle] createPersona",{name:J});const Qe={id:`mock-persona-${Date.now()}`,name:J,description:ne,systemPrompt:oe,toolConfig:"{}",runtime:ue??"claude-code",model:be||"",maxTurns:Te||0,mcpServers:"[]",createdAt:new Date().toISOString(),updatedAt:new Date().toISOString()};k(De=>[...De,Qe])},updatePersona:(J,ne,oe,ue,be,Te,Qe)=>{console.log("[MockGrackle] updatePersona",{personaId:J,name:ne}),k(De=>De.map(Mt=>Mt.id!==J?Mt:{...Mt,...ne!==void 0?{name:ne}:{},...oe!==void 0?{description:oe}:{},...ue!==void 0?{systemPrompt:ue}:{},...be!==void 0?{runtime:be}:{},...Te!==void 0?{model:Te}:{},...Qe!==void 0?{maxTurns:Qe}:{},updatedAt:new Date().toISOString()}))},deletePersona:J=>{console.log("[MockGrackle] deletePersona",J),k(ne=>ne.filter(oe=>oe.id!==J))},taskSessions:R,loadTaskSessions:J=>{console.log("[MockGrackle] loadTaskSessions",J)}}),[a,o,u,p,g,v,T,E,A,R,te,Ae,we,_e,Ue,Ee,ye,xe,W,K,me,Ve,mt,Tt,Bt,Xe,qe,Be,Ln,Un,ea,en]);return h.jsx(Of.Provider,{value:ta,children:n})}const U0=S.createContext(void 0),kE=4e3;function ME({children:n}){const[a,i]=S.useState([]),o=S.useRef(0),r=S.useCallback(d=>{i(p=>p.filter(m=>m.id!==d))},[]),u=S.useCallback((d,p="info",m=kE)=>{const g=`toast-${++o.current}`;i(y=>[...y,{id:g,message:d,variant:p,duration:m}])},[]);return h.jsx(U0.Provider,{value:{toasts:a,showToast:u,dismissToast:r},children:n})}function ao(){const n=S.useContext(U0);if(!n)throw new Error("useToast must be used within ToastProvider");return n}const Wr=[{id:"grackle",label:"Grackle",description:"The default Grackle theme — iridescent purple on clean dark.",swatches:["#0e1218","#8b5cf6","#60a5fa","#e5e7eb","#34d399"],variantLightId:"grackle-light",variantDarkId:"grackle-dark"},{id:"grackle-light",label:"Grackle Light",description:"Light Grackle variant.",hidden:!0},{id:"grackle-dark",label:"Grackle Dark",description:"Dark Grackle variant.",hidden:!0},{id:"glass",label:"Glassmorphism",description:"Dark frosted-glass aesthetic with backdrop blur effects.",swatches:["#0a0c14","#4ecca3","#70a1ff","#e2e8f0","#a855f7"]},{id:"matrix",label:"Matrix",description:"Phosphor-green CRT terminal with scanlines and glow.",swatches:["#050505","#00ff41","#00bfff","#33ff77","#ffb000"]},{id:"brutalist",label:"Neubrutalism",description:"Thick borders, raw colors, bold type — ugly on purpose.",swatches:["#f5f0e8","#ff5757","#5ce1e6","#1a1a1a","#ffde59"],variantLightId:"brutalist-light",variantDarkId:"brutalist-dark"},{id:"brutalist-light",label:"Neubrutalism Light",description:"Light neubrutalism variant.",hidden:!0},{id:"brutalist-dark",label:"Neubrutalism Dark",description:"Dark neubrutalism variant.",hidden:!0},{id:"monokai",label:"Monokai",description:"Classic warm editor palette — pink, green, and purple.",swatches:["#272822","#f92672","#a6e22e","#f8f8f2","#ae81ff"],variantLightId:"monokai-light",variantDarkId:"monokai-dark"},{id:"monokai-dark",label:"Monokai Dark",description:"Dark Monokai variant.",hidden:!0},{id:"monokai-light",label:"Monokai Light",description:"Light Monokai variant.",hidden:!0},{id:"ubuntu",label:"Ubuntu",description:"Aubergine terminal with the GNOME Tango palette.",swatches:["#300a24","#8ae234","#ef2929","#eeeeec","#fce94f"]},{id:"sandstone",label:"Sandstone",description:"Warm terracotta accent on dark brown, in the style of Claude Code.",swatches:["#1a1815","#C15F3C","#6b8afd","#e8e6e3","#a78bfa"]},{id:"verdigris",label:"Verdigris",description:"Teal accent on charcoal, in the style of ChatGPT.",swatches:["#141414","#00a67e","#3b82f6","#ececec","#ab68ff"]},{id:"primer",label:"Primer",description:"Blue accent on ink-dark grey, in the style of GitHub.",swatches:["#0d1117","#58a6ff","#3fb950","#c9d1d9","#bc8cff"]}],z0=new Set(Wr.map(n=>n.id)),Ry="grackle";function Zd(n){return Wr.find(a=>a.id===n)}const Xd="grackle-theme",I0="grackle-prefer-system",V0="(prefers-color-scheme: dark)";let Ul=[],Rr;function jd(){Rr=void 0;for(const n of Ul)n()}function Qd(){return typeof window>"u"?!1:window.matchMedia(V0).matches}function Hl(){if(typeof localStorage>"u")return Ry;try{const n=localStorage.getItem(Xd);if(n!==null&&z0.has(n))return n}catch{}return Ry}function Ur(){if(typeof localStorage>"u")return!1;try{return localStorage.getItem(I0)==="true"}catch{return!1}}function Jd(n){return Wr.find(a=>a.variantLightId===n||a.variantDarkId===n)}function H0(n,a){const i=Zd(n);if(i!=null&&i.variantDarkId)return a&&i.variantLightId?Qd()?i.variantDarkId:i.variantLightId:i.variantDarkId;if(i!=null&&i.hidden&&a){const o=Jd(n);if(o!=null&&o.variantLightId&&o.variantDarkId)return Qd()?o.variantDarkId:o.variantLightId}return n}function Ci(n,a,i=!1){i&&document.documentElement.classList.add("no-transitions"),document.documentElement.dataset.theme=H0(n,a),i&&(document.documentElement.offsetHeight,requestAnimationFrame(()=>{document.documentElement.classList.remove("no-transitions")}))}typeof document<"u"&&Ci(Hl(),Ur());function RE(){return Rr===void 0&&(Rr={themeId:Hl(),systemDark:Qd(),preferSystem:Ur()}),Rr}function OE(n){return Ul=[...Ul,n],()=>{Ul=Ul.filter(a=>a!==n)}}function BE(){const n=S.useSyncExternalStore(OE,RE),{themeId:a,preferSystem:i}=n,o=H0(a,i),r=S.useCallback(d=>{if(z0.has(d)){try{localStorage.setItem(Xd,d)}catch{}Ci(d,Ur(),!0),jd()}},[]),u=S.useCallback(d=>{try{localStorage.setItem(I0,d?"true":"false")}catch{}if(d){const p=Hl(),m=Zd(p);if(m!=null&&m.hidden){const g=Jd(p);if(g)try{localStorage.setItem(Xd,g.id)}catch{}}}Ci(Hl(),d,!0),jd()},[]);return S.useEffect(()=>{Ci(a,i)},[a,i]),S.useEffect(()=>{if(typeof window>"u")return;const d=window.matchMedia(V0),p=()=>{const m=Hl(),g=Ur();if(g){const y=Zd(m);if(y!=null&&y.variantDarkId&&y.variantLightId&&Ci(m,g),y!=null&&y.hidden){const v=Jd(m);v!=null&&v.variantDarkId&&v.variantLightId&&Ci(m,g)}}jd()};return d.addEventListener("change",p),()=>{d.removeEventListener("change",p)}},[]),{themeId:a,setTheme:r,resolvedThemeId:o,preferSystem:i,setPreferSystem:u}}const P0=S.createContext(void 0);function LE({children:n}){const a=BE();return h.jsx(P0.Provider,{value:a,children:n})}function G0(){const n=S.useContext(P0);if(!n)throw new Error("useThemeContext must be used within ThemeProvider");return n}const UE="_container_eix8p_1",zE="_hamburger_eix8p_33",IE="_brand_eix8p_49",VE="_info_eix8p_65",HE="_connectionLabel_eix8p_80",PE="_connectionDot_eix8p_93",GE="_connected_eix8p_96",qE="_disconnected_eix8p_100",FE="_settingsButton_eix8p_104",xa={container:UE,hamburger:zE,brand:IE,info:VE,connectionLabel:HE,connectionDot:PE,connected:GE,disconnected:qE,settingsButton:FE};function $E({onToggleSidebar:n,sidebarOpen:a}){const{connected:i,environments:o,sessions:r}=Gt(),u=Pn(),d=o.length,p=o.filter(g=>g.status==="connected").length,m=r.filter(g=>["running","idle"].includes(g.status)).length;return h.jsxs("div",{className:xa.container,children:[n&&h.jsx("button",{type:"button",className:xa.hamburger,onClick:n,"aria-label":"Toggle sidebar","aria-expanded":a,children:"☰"}),h.jsx("button",{type:"button",className:xa.brand,onClick:()=>u("/"),title:"Home",children:"Grackle"}),h.jsxs("div",{className:xa.info,children:[h.jsxs("span",{"aria-label":i?"Connected":"Disconnected",children:[h.jsx("span",{className:`${xa.connectionDot} ${i?xa.connected:xa.disconnected}`,"aria-hidden":"true",children:"●"})," ",h.jsx("span",{className:xa.connectionLabel,"aria-hidden":"true",children:i?"Connected":"Disconnected"})]}),h.jsxs("span",{children:[p,"/",d," env",d!==1?"s":""]}),h.jsxs("span",{children:[m," active"]}),h.jsx("button",{className:xa.settingsButton,onClick:()=>u(ki),title:"Settings",children:"⚙"})]})]})}const Bf=S.createContext({});function Lf(n){const a=S.useRef(null);return a.current===null&&(a.current=n()),a.current}const ec=S.createContext(null),Uf=S.createContext({transformPagePoint:n=>n,isStatic:!1,reducedMotion:"never"});class YE extends S.Component{getSnapshotBeforeUpdate(a){const i=this.props.childRef.current;if(i&&a.isPresent&&!this.props.isPresent){const o=this.props.sizeRef.current;o.height=i.offsetHeight||0,o.width=i.offsetWidth||0,o.top=i.offsetTop,o.left=i.offsetLeft}return null}componentDidUpdate(){}render(){return this.props.children}}function KE({children:n,isPresent:a}){const i=S.useId(),o=S.useRef(null),r=S.useRef({width:0,height:0,top:0,left:0}),{nonce:u}=S.useContext(Uf);return S.useInsertionEffect(()=>{const{width:d,height:p,top:m,left:g}=r.current;if(a||!o.current||!d||!p)return;o.current.dataset.motionPopId=i;const y=document.createElement("style");return u&&(y.nonce=u),document.head.appendChild(y),y.sheet&&y.sheet.insertRule(`
79
- [data-motion-pop-id="${i}"] {
80
- position: absolute !important;
81
- width: ${d}px !important;
82
- height: ${p}px !important;
83
- top: ${m}px !important;
84
- left: ${g}px !important;
85
- }
86
- `),()=>{document.head.removeChild(y)}},[a]),h.jsx(YE,{isPresent:a,childRef:o,sizeRef:r,children:S.cloneElement(n,{ref:o})})}const ZE=({children:n,initial:a,isPresent:i,onExitComplete:o,custom:r,presenceAffectsLayout:u,mode:d})=>{const p=Lf(XE),m=S.useId(),g=S.useCallback(v=>{p.set(v,!0);for(const _ of p.values())if(!_)return;o&&o()},[p,o]),y=S.useMemo(()=>({id:m,initial:a,isPresent:i,custom:r,onExitComplete:g,register:v=>(p.set(v,!1),()=>p.delete(v))}),u?[Math.random(),g]:[i,g]);return S.useMemo(()=>{p.forEach((v,_)=>p.set(_,!1))},[i]),S.useEffect(()=>{!i&&!p.size&&o&&o()},[i]),d==="popLayout"&&(n=h.jsx(KE,{isPresent:i,children:n})),h.jsx(ec.Provider,{value:y,children:n})};function XE(){return new Map}function q0(n=!0){const a=S.useContext(ec);if(a===null)return[!0,null];const{isPresent:i,onExitComplete:o,register:r}=a,u=S.useId();S.useEffect(()=>{n&&r(u)},[n]);const d=S.useCallback(()=>n&&o&&o(u),[u,o,n]);return!i&&o?[!1,d]:[!0]}const Tr=n=>n.key||"";function Oy(n){const a=[];return S.Children.forEach(n,i=>{S.isValidElement(i)&&a.push(i)}),a}const zf=typeof window<"u",F0=zf?S.useLayoutEffect:S.useEffect,os=({children:n,custom:a,initial:i=!0,onExitComplete:o,presenceAffectsLayout:r=!0,mode:u="sync",propagate:d=!1})=>{const[p,m]=q0(d),g=S.useMemo(()=>Oy(n),[n]),y=d&&!p?[]:g.map(Tr),v=S.useRef(!0),_=S.useRef(g),T=Lf(()=>new Map),[C,E]=S.useState(g),[j,A]=S.useState(g);F0(()=>{v.current=!1,_.current=g;for(let $=0;$<j.length;$++){const H=Tr(j[$]);y.includes(H)?T.delete(H):T.get(H)!==!0&&T.set(H,!1)}},[j,y.length,y.join("-")]);const k=[];if(g!==C){let $=[...g];for(let H=0;H<j.length;H++){const V=j[H],q=Tr(V);y.includes(q)||($.splice(H,0,V),k.push(V))}u==="wait"&&k.length&&($=k),A(Oy($)),E(g);return}const{forceRender:R}=S.useContext(Bf);return h.jsx(h.Fragment,{children:j.map($=>{const H=Tr($),V=d&&!p?!1:g===j||y.includes(H),q=()=>{if(T.has(H))T.set(H,!0);else return;let O=!0;T.forEach(ee=>{ee||(O=!1)}),O&&(R==null||R(),A(_.current),d&&(m==null||m()),o&&o())};return h.jsx(ZE,{isPresent:V,initial:!v.current||i?void 0:!1,custom:V?void 0:a,presenceAffectsLayout:r,mode:u,onExitComplete:V?void 0:q,children:$},H)})})},vn=n=>n;let $0=vn;const QE={useManualTiming:!1};function JE(n){let a=new Set,i=new Set,o=!1,r=!1;const u=new WeakSet;let d={delta:0,timestamp:0,isProcessing:!1};function p(g){u.has(g)&&(m.schedule(g),n()),g(d)}const m={schedule:(g,y=!1,v=!1)=>{const T=v&&o?a:i;return y&&u.add(g),T.has(g)||T.add(g),g},cancel:g=>{i.delete(g),u.delete(g)},process:g=>{if(d=g,o){r=!0;return}o=!0,[a,i]=[i,a],a.forEach(p),a.clear(),o=!1,r&&(r=!1,m.process(g))}};return m}const Er=["read","resolveKeyframes","update","preRender","render","postRender"],WE=40;function Y0(n,a){let i=!1,o=!0;const r={delta:0,timestamp:0,isProcessing:!1},u=()=>i=!0,d=Er.reduce((A,k)=>(A[k]=JE(u),A),{}),{read:p,resolveKeyframes:m,update:g,preRender:y,render:v,postRender:_}=d,T=()=>{const A=performance.now();i=!1,r.delta=o?1e3/60:Math.max(Math.min(A-r.timestamp,WE),1),r.timestamp=A,r.isProcessing=!0,p.process(r),m.process(r),g.process(r),y.process(r),v.process(r),_.process(r),r.isProcessing=!1,i&&a&&(o=!1,n(T))},C=()=>{i=!0,o=!0,r.isProcessing||n(T)};return{schedule:Er.reduce((A,k)=>{const R=d[k];return A[k]=($,H=!1,V=!1)=>(i||C(),R.schedule($,H,V)),A},{}),cancel:A=>{for(let k=0;k<Er.length;k++)d[Er[k]].cancel(A)},state:r,steps:d}}const{schedule:st,cancel:ss,state:Pt,steps:Nd}=Y0(typeof requestAnimationFrame<"u"?requestAnimationFrame:vn,!0),K0=S.createContext({strict:!1}),By={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]},Mi={};for(const n in By)Mi[n]={isEnabled:a=>By[n].some(i=>!!a[i])};function eC(n){for(const a in n)Mi[a]={...Mi[a],...n[a]}}const tC=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","custom","inherit","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","globalTapTarget","ignoreStrict","viewport"]);function zr(n){return n.startsWith("while")||n.startsWith("drag")&&n!=="draggable"||n.startsWith("layout")||n.startsWith("onTap")||n.startsWith("onPan")||n.startsWith("onLayout")||tC.has(n)}let Z0=n=>!zr(n);function nC(n){n&&(Z0=a=>a.startsWith("on")?!zr(a):n(a))}try{nC(require("@emotion/is-prop-valid").default)}catch{}function aC(n,a,i){const o={};for(const r in n)r==="values"&&typeof n.values=="object"||(Z0(r)||i===!0&&zr(r)||!a&&!zr(r)||n.draggable&&r.startsWith("onDrag"))&&(o[r]=n[r]);return o}function sC(n){if(typeof Proxy>"u")return n;const a=new Map,i=(...o)=>n(...o);return new Proxy(i,{get:(o,r)=>r==="create"?n:(a.has(r)||a.set(r,n(r)),a.get(r))})}const tc=S.createContext({});function Xl(n){return typeof n=="string"||Array.isArray(n)}function nc(n){return n!==null&&typeof n=="object"&&typeof n.start=="function"}const If=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],Vf=["initial",...If];function ac(n){return nc(n.animate)||Vf.some(a=>Xl(n[a]))}function X0(n){return!!(ac(n)||n.variants)}function iC(n,a){if(ac(n)){const{initial:i,animate:o}=n;return{initial:i===!1||Xl(i)?i:void 0,animate:Xl(o)?o:void 0}}return n.inherit!==!1?a:{}}function lC(n){const{initial:a,animate:i}=iC(n,S.useContext(tc));return S.useMemo(()=>({initial:a,animate:i}),[Ly(a),Ly(i)])}function Ly(n){return Array.isArray(n)?n.join(" "):n}const oC=Symbol.for("motionComponentSymbol");function Ai(n){return n&&typeof n=="object"&&Object.prototype.hasOwnProperty.call(n,"current")}function rC(n,a,i){return S.useCallback(o=>{o&&n.onMount&&n.onMount(o),a&&(o?a.mount(o):a.unmount()),i&&(typeof i=="function"?i(o):Ai(i)&&(i.current=o))},[a])}const Hf=n=>n.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase(),cC="framerAppearId",Q0="data-"+Hf(cC),{schedule:Pf}=Y0(queueMicrotask,!1),J0=S.createContext({});function uC(n,a,i,o,r){var u,d;const{visualElement:p}=S.useContext(tc),m=S.useContext(K0),g=S.useContext(ec),y=S.useContext(Uf).reducedMotion,v=S.useRef(null);o=o||m.renderer,!v.current&&o&&(v.current=o(n,{visualState:a,parent:p,props:i,presenceContext:g,blockInitialAnimation:g?g.initial===!1:!1,reducedMotionConfig:y}));const _=v.current,T=S.useContext(J0);_&&!_.projection&&r&&(_.type==="html"||_.type==="svg")&&dC(v.current,i,r,T);const C=S.useRef(!1);S.useInsertionEffect(()=>{_&&C.current&&_.update(i,g)});const E=i[Q0],j=S.useRef(!!E&&!(!((u=window.MotionHandoffIsComplete)===null||u===void 0)&&u.call(window,E))&&((d=window.MotionHasOptimisedAnimation)===null||d===void 0?void 0:d.call(window,E)));return F0(()=>{_&&(C.current=!0,window.MotionIsMounted=!0,_.updateFeatures(),Pf.render(_.render),j.current&&_.animationState&&_.animationState.animateChanges())}),S.useEffect(()=>{_&&(!j.current&&_.animationState&&_.animationState.animateChanges(),j.current&&(queueMicrotask(()=>{var A;(A=window.MotionHandoffMarkAsComplete)===null||A===void 0||A.call(window,E)}),j.current=!1))}),_}function dC(n,a,i,o){const{layoutId:r,layout:u,drag:d,dragConstraints:p,layoutScroll:m,layoutRoot:g}=a;n.projection=new i(n.latestValues,a["data-framer-portal-id"]?void 0:W0(n.parent)),n.projection.setOptions({layoutId:r,layout:u,alwaysMeasureLayout:!!d||p&&Ai(p),visualElement:n,animationType:typeof u=="string"?u:"both",initialPromotionConfig:o,layoutScroll:m,layoutRoot:g})}function W0(n){if(n)return n.options.allowProjection!==!1?n.projection:W0(n.parent)}function fC({preloadedFeatures:n,createVisualElement:a,useRender:i,useVisualState:o,Component:r}){var u,d;n&&eC(n);function p(g,y){let v;const _={...S.useContext(Uf),...g,layoutId:hC(g)},{isStatic:T}=_,C=lC(g),E=o(g,T);if(!T&&zf){pC();const j=mC(_);v=j.MeasureLayout,C.visualElement=uC(r,E,_,a,j.ProjectionNode)}return h.jsxs(tc.Provider,{value:C,children:[v&&C.visualElement?h.jsx(v,{visualElement:C.visualElement,..._}):null,i(r,g,rC(E,C.visualElement,y),E,T,C.visualElement)]})}p.displayName=`motion.${typeof r=="string"?r:`create(${(d=(u=r.displayName)!==null&&u!==void 0?u:r.name)!==null&&d!==void 0?d:""})`}`;const m=S.forwardRef(p);return m[oC]=r,m}function hC({layoutId:n}){const a=S.useContext(Bf).id;return a&&n!==void 0?a+"-"+n:n}function pC(n,a){S.useContext(K0).strict}function mC(n){const{drag:a,layout:i}=Mi;if(!a&&!i)return{};const o={...a,...i};return{MeasureLayout:a!=null&&a.isEnabled(n)||i!=null&&i.isEnabled(n)?o.MeasureLayout:void 0,ProjectionNode:o.ProjectionNode}}const gC=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","svg","text","tspan","use","view"];function Gf(n){return typeof n!="string"||n.includes("-")?!1:!!(gC.indexOf(n)>-1||/[A-Z]/u.test(n))}function Uy(n){const a=[{},{}];return n==null||n.values.forEach((i,o)=>{a[0][o]=i.get(),a[1][o]=i.getVelocity()}),a}function qf(n,a,i,o){if(typeof a=="function"){const[r,u]=Uy(o);a=a(i!==void 0?i:n.custom,r,u)}if(typeof a=="string"&&(a=n.variants&&n.variants[a]),typeof a=="function"){const[r,u]=Uy(o);a=a(i!==void 0?i:n.custom,r,u)}return a}const Wd=n=>Array.isArray(n),yC=n=>!!(n&&typeof n=="object"&&n.mix&&n.toValue),vC=n=>Wd(n)?n[n.length-1]||0:n,Yt=n=>!!(n&&n.getVelocity);function Or(n){const a=Yt(n)?n.get():n;return yC(a)?a.toValue():a}function bC({scrapeMotionValuesFromProps:n,createRenderState:a,onUpdate:i},o,r,u){const d={latestValues:SC(o,r,u,n),renderState:a()};return i&&(d.onMount=p=>i({props:o,current:p,...d}),d.onUpdate=p=>i(p)),d}const eb=n=>(a,i)=>{const o=S.useContext(tc),r=S.useContext(ec),u=()=>bC(n,a,o,r);return i?u():Lf(u)};function SC(n,a,i,o){const r={},u=o(n,{});for(const _ in u)r[_]=Or(u[_]);let{initial:d,animate:p}=n;const m=ac(n),g=X0(n);a&&g&&!m&&n.inherit!==!1&&(d===void 0&&(d=a.initial),p===void 0&&(p=a.animate));let y=i?i.initial===!1:!1;y=y||d===!1;const v=y?p:d;if(v&&typeof v!="boolean"&&!nc(v)){const _=Array.isArray(v)?v:[v];for(let T=0;T<_.length;T++){const C=qf(n,_[T]);if(C){const{transitionEnd:E,transition:j,...A}=C;for(const k in A){let R=A[k];if(Array.isArray(R)){const $=y?R.length-1:0;R=R[$]}R!==null&&(r[k]=R)}for(const k in E)r[k]=E[k]}}}return r}const Ui=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],zs=new Set(Ui),tb=n=>a=>typeof a=="string"&&a.startsWith(n),nb=tb("--"),_C=tb("var(--"),Ff=n=>_C(n)?xC.test(n.split("/*")[0].trim()):!1,xC=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu,ab=(n,a)=>a&&typeof n=="number"?a.transform(n):n,ja=(n,a,i)=>i>a?a:i<n?n:i,zi={test:n=>typeof n=="number",parse:parseFloat,transform:n=>n},Ql={...zi,transform:n=>ja(0,1,n)},Cr={...zi,default:1},so=n=>({test:a=>typeof a=="string"&&a.endsWith(n)&&a.split(" ").length===1,parse:parseFloat,transform:a=>`${a}${n}`}),Wa=so("deg"),Jn=so("%"),ge=so("px"),TC=so("vh"),EC=so("vw"),zy={...Jn,parse:n=>Jn.parse(n)/100,transform:n=>Jn.transform(n*100)},CC={borderWidth:ge,borderTopWidth:ge,borderRightWidth:ge,borderBottomWidth:ge,borderLeftWidth:ge,borderRadius:ge,radius:ge,borderTopLeftRadius:ge,borderTopRightRadius:ge,borderBottomRightRadius:ge,borderBottomLeftRadius:ge,width:ge,maxWidth:ge,height:ge,maxHeight:ge,top:ge,right:ge,bottom:ge,left:ge,padding:ge,paddingTop:ge,paddingRight:ge,paddingBottom:ge,paddingLeft:ge,margin:ge,marginTop:ge,marginRight:ge,marginBottom:ge,marginLeft:ge,backgroundPositionX:ge,backgroundPositionY:ge},AC={rotate:Wa,rotateX:Wa,rotateY:Wa,rotateZ:Wa,scale:Cr,scaleX:Cr,scaleY:Cr,scaleZ:Cr,skew:Wa,skewX:Wa,skewY:Wa,distance:ge,translateX:ge,translateY:ge,translateZ:ge,x:ge,y:ge,z:ge,perspective:ge,transformPerspective:ge,opacity:Ql,originX:zy,originY:zy,originZ:ge},Iy={...zi,transform:Math.round},$f={...CC,...AC,zIndex:Iy,size:ge,fillOpacity:Ql,strokeOpacity:Ql,numOctaves:Iy},jC={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},NC=Ui.length;function wC(n,a,i){let o="",r=!0;for(let u=0;u<NC;u++){const d=Ui[u],p=n[d];if(p===void 0)continue;let m=!0;if(typeof p=="number"?m=p===(d.startsWith("scale")?1:0):m=parseFloat(p)===0,!m||i){const g=ab(p,$f[d]);if(!m){r=!1;const y=jC[d]||d;o+=`${y}(${g}) `}i&&(a[d]=g)}}return o=o.trim(),i?o=i(a,r?"":o):r&&(o="none"),o}function Yf(n,a,i){const{style:o,vars:r,transformOrigin:u}=n;let d=!1,p=!1;for(const m in a){const g=a[m];if(zs.has(m)){d=!0;continue}else if(nb(m)){r[m]=g;continue}else{const y=ab(g,$f[m]);m.startsWith("origin")?(p=!0,u[m]=y):o[m]=y}}if(a.transform||(d||i?o.transform=wC(a,n.transform,i):o.transform&&(o.transform="none")),p){const{originX:m="50%",originY:g="50%",originZ:y=0}=u;o.transformOrigin=`${m} ${g} ${y}`}}const DC={offset:"stroke-dashoffset",array:"stroke-dasharray"},kC={offset:"strokeDashoffset",array:"strokeDasharray"};function MC(n,a,i=1,o=0,r=!0){n.pathLength=1;const u=r?DC:kC;n[u.offset]=ge.transform(-o);const d=ge.transform(a),p=ge.transform(i);n[u.array]=`${d} ${p}`}function Vy(n,a,i){return typeof n=="string"?n:ge.transform(a+i*n)}function RC(n,a,i){const o=Vy(a,n.x,n.width),r=Vy(i,n.y,n.height);return`${o} ${r}`}function Kf(n,{attrX:a,attrY:i,attrScale:o,originX:r,originY:u,pathLength:d,pathSpacing:p=1,pathOffset:m=0,...g},y,v){if(Yf(n,g,v),y){n.style.viewBox&&(n.attrs.viewBox=n.style.viewBox);return}n.attrs=n.style,n.style={};const{attrs:_,style:T,dimensions:C}=n;_.transform&&(C&&(T.transform=_.transform),delete _.transform),C&&(r!==void 0||u!==void 0||T.transform)&&(T.transformOrigin=RC(C,r!==void 0?r:.5,u!==void 0?u:.5)),a!==void 0&&(_.x=a),i!==void 0&&(_.y=i),o!==void 0&&(_.scale=o),d!==void 0&&MC(_,d,p,m,!1)}const Zf=()=>({style:{},transform:{},transformOrigin:{},vars:{}}),sb=()=>({...Zf(),attrs:{}}),Xf=n=>typeof n=="string"&&n.toLowerCase()==="svg";function ib(n,{style:a,vars:i},o,r){Object.assign(n.style,a,r&&r.getProjectionStyles(o));for(const u in i)n.style.setProperty(u,i[u])}const lb=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]);function ob(n,a,i,o){ib(n,a,void 0,o);for(const r in a.attrs)n.setAttribute(lb.has(r)?r:Hf(r),a.attrs[r])}const Ir={};function OC(n){Object.assign(Ir,n)}function rb(n,{layout:a,layoutId:i}){return zs.has(n)||n.startsWith("origin")||(a||i!==void 0)&&(!!Ir[n]||n==="opacity")}function Qf(n,a,i){var o;const{style:r}=n,u={};for(const d in r)(Yt(r[d])||a.style&&Yt(a.style[d])||rb(d,n)||((o=i==null?void 0:i.getValue(d))===null||o===void 0?void 0:o.liveStyle)!==void 0)&&(u[d]=r[d]);return u}function cb(n,a,i){const o=Qf(n,a,i);for(const r in n)if(Yt(n[r])||Yt(a[r])){const u=Ui.indexOf(r)!==-1?"attr"+r.charAt(0).toUpperCase()+r.substring(1):r;o[u]=n[r]}return o}function BC(n,a){try{a.dimensions=typeof n.getBBox=="function"?n.getBBox():n.getBoundingClientRect()}catch{a.dimensions={x:0,y:0,width:0,height:0}}}const Hy=["x","y","width","height","cx","cy","r"],LC={useVisualState:eb({scrapeMotionValuesFromProps:cb,createRenderState:sb,onUpdate:({props:n,prevProps:a,current:i,renderState:o,latestValues:r})=>{if(!i)return;let u=!!n.drag;if(!u){for(const p in r)if(zs.has(p)){u=!0;break}}if(!u)return;let d=!a;if(a)for(let p=0;p<Hy.length;p++){const m=Hy[p];n[m]!==a[m]&&(d=!0)}d&&st.read(()=>{BC(i,o),st.render(()=>{Kf(o,r,Xf(i.tagName),n.transformTemplate),ob(i,o)})})}})},UC={useVisualState:eb({scrapeMotionValuesFromProps:Qf,createRenderState:Zf})};function ub(n,a,i){for(const o in a)!Yt(a[o])&&!rb(o,i)&&(n[o]=a[o])}function zC({transformTemplate:n},a){return S.useMemo(()=>{const i=Zf();return Yf(i,a,n),Object.assign({},i.vars,i.style)},[a])}function IC(n,a){const i=n.style||{},o={};return ub(o,i,n),Object.assign(o,zC(n,a)),o}function VC(n,a){const i={},o=IC(n,a);return n.drag&&n.dragListener!==!1&&(i.draggable=!1,o.userSelect=o.WebkitUserSelect=o.WebkitTouchCallout="none",o.touchAction=n.drag===!0?"none":`pan-${n.drag==="x"?"y":"x"}`),n.tabIndex===void 0&&(n.onTap||n.onTapStart||n.whileTap)&&(i.tabIndex=0),i.style=o,i}function HC(n,a,i,o){const r=S.useMemo(()=>{const u=sb();return Kf(u,a,Xf(o),n.transformTemplate),{...u.attrs,style:{...u.style}}},[a]);if(n.style){const u={};ub(u,n.style,n),r.style={...u,...r.style}}return r}function PC(n=!1){return(i,o,r,{latestValues:u},d)=>{const m=(Gf(i)?HC:VC)(o,u,d,i),g=aC(o,typeof i=="string",n),y=i!==S.Fragment?{...g,...m,ref:r}:{},{children:v}=o,_=S.useMemo(()=>Yt(v)?v.get():v,[v]);return S.createElement(i,{...y,children:_})}}function GC(n,a){return function(o,{forwardMotionProps:r}={forwardMotionProps:!1}){const d={...Gf(o)?LC:UC,preloadedFeatures:n,useRender:PC(r),createVisualElement:a,Component:o};return fC(d)}}function db(n,a){if(!Array.isArray(a))return!1;const i=a.length;if(i!==n.length)return!1;for(let o=0;o<i;o++)if(a[o]!==n[o])return!1;return!0}function sc(n,a,i){const o=n.getProps();return qf(o,a,i!==void 0?i:o.custom,n)}function Jf(n,a){return n?n[a]||n.default||n:void 0}const fb=new Set(["width","height","top","left","right","bottom",...Ui]);let Br;function qC(){Br=void 0}const Wn={now:()=>(Br===void 0&&Wn.set(Pt.isProcessing||QE.useManualTiming?Pt.timestamp:performance.now()),Br),set:n=>{Br=n,queueMicrotask(qC)}};function Wf(n,a){n.indexOf(a)===-1&&n.push(a)}function eh(n,a){const i=n.indexOf(a);i>-1&&n.splice(i,1)}class th{constructor(){this.subscriptions=[]}add(a){return Wf(this.subscriptions,a),()=>eh(this.subscriptions,a)}notify(a,i,o){const r=this.subscriptions.length;if(r)if(r===1)this.subscriptions[0](a,i,o);else for(let u=0;u<r;u++){const d=this.subscriptions[u];d&&d(a,i,o)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}function hb(n,a){return a?n*(1e3/a):0}const Py=30,FC=n=>!isNaN(parseFloat(n));class $C{constructor(a,i={}){this.version="11.18.2",this.canTrackVelocity=null,this.events={},this.updateAndNotify=(o,r=!0)=>{const u=Wn.now();this.updatedAt!==u&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(o),this.current!==this.prev&&this.events.change&&this.events.change.notify(this.current),r&&this.events.renderRequest&&this.events.renderRequest.notify(this.current)},this.hasAnimated=!1,this.setCurrent(a),this.owner=i.owner}setCurrent(a){this.current=a,this.updatedAt=Wn.now(),this.canTrackVelocity===null&&a!==void 0&&(this.canTrackVelocity=FC(this.current))}setPrevFrameValue(a=this.current){this.prevFrameValue=a,this.prevUpdatedAt=this.updatedAt}onChange(a){return this.on("change",a)}on(a,i){this.events[a]||(this.events[a]=new th);const o=this.events[a].add(i);return a==="change"?()=>{o(),st.read(()=>{this.events.change.getSize()||this.stop()})}:o}clearListeners(){for(const a in this.events)this.events[a].clear()}attach(a,i){this.passiveEffect=a,this.stopPassiveEffect=i}set(a,i=!0){!i||!this.passiveEffect?this.updateAndNotify(a,i):this.passiveEffect(a,this.updateAndNotify)}setWithVelocity(a,i,o){this.set(i),this.prev=void 0,this.prevFrameValue=a,this.prevUpdatedAt=this.updatedAt-o}jump(a,i=!0){this.updateAndNotify(a),this.prev=a,this.prevUpdatedAt=this.prevFrameValue=void 0,i&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}get(){return this.current}getPrevious(){return this.prev}getVelocity(){const a=Wn.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||a-this.updatedAt>Py)return 0;const i=Math.min(this.updatedAt-this.prevUpdatedAt,Py);return hb(parseFloat(this.current)-parseFloat(this.prevFrameValue),i)}start(a){return this.stop(),new Promise(i=>{this.hasAnimated=!0,this.animation=a(i),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function Jl(n,a){return new $C(n,a)}function YC(n,a,i){n.hasValue(a)?n.getValue(a).set(i):n.addValue(a,Jl(i))}function KC(n,a){const i=sc(n,a);let{transitionEnd:o={},transition:r={},...u}=i||{};u={...u,...o};for(const d in u){const p=vC(u[d]);YC(n,d,p)}}function ZC(n){return!!(Yt(n)&&n.add)}function ef(n,a){const i=n.getValue("willChange");if(ZC(i))return i.add(a)}function pb(n){return n.props[Q0]}function nh(n){let a;return()=>(a===void 0&&(a=n()),a)}const XC=nh(()=>window.ScrollTimeline!==void 0);class QC{constructor(a){this.stop=()=>this.runAll("stop"),this.animations=a.filter(Boolean)}get finished(){return Promise.all(this.animations.map(a=>"finished"in a?a.finished:a))}getAll(a){return this.animations[0][a]}setAll(a,i){for(let o=0;o<this.animations.length;o++)this.animations[o][a]=i}attachTimeline(a,i){const o=this.animations.map(r=>{if(XC()&&r.attachTimeline)return r.attachTimeline(a);if(typeof i=="function")return i(r)});return()=>{o.forEach((r,u)=>{r&&r(),this.animations[u].stop()})}}get time(){return this.getAll("time")}set time(a){this.setAll("time",a)}get speed(){return this.getAll("speed")}set speed(a){this.setAll("speed",a)}get startTime(){return this.getAll("startTime")}get duration(){let a=0;for(let i=0;i<this.animations.length;i++)a=Math.max(a,this.animations[i].duration);return a}runAll(a){this.animations.forEach(i=>i[a]())}flatten(){this.runAll("flatten")}play(){this.runAll("play")}pause(){this.runAll("pause")}cancel(){this.runAll("cancel")}complete(){this.runAll("complete")}}class JC extends QC{then(a,i){return Promise.all(this.animations).then(a).catch(i)}}const Ea=n=>n*1e3,Ca=n=>n/1e3;function ah(n){return typeof n=="function"}function Gy(n,a){n.timeline=a,n.onfinish=null}const sh=n=>Array.isArray(n)&&typeof n[0]=="number",WC={linearEasing:void 0};function eA(n,a){const i=nh(n);return()=>{var o;return(o=WC[a])!==null&&o!==void 0?o:i()}}const Vr=eA(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),Ri=(n,a,i)=>{const o=a-n;return o===0?1:(i-n)/o},mb=(n,a,i=10)=>{let o="";const r=Math.max(Math.round(a/i),2);for(let u=0;u<r;u++)o+=n(Ri(0,r-1,u))+", ";return`linear(${o.substring(0,o.length-2)})`};function gb(n){return!!(typeof n=="function"&&Vr()||!n||typeof n=="string"&&(n in tf||Vr())||sh(n)||Array.isArray(n)&&n.every(gb))}const zl=([n,a,i,o])=>`cubic-bezier(${n}, ${a}, ${i}, ${o})`,tf={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:zl([0,.65,.55,1]),circOut:zl([.55,0,1,.45]),backIn:zl([.31,.01,.66,-.59]),backOut:zl([.33,1.53,.69,.99])};function yb(n,a){if(n)return typeof n=="function"&&Vr()?mb(n,a):sh(n)?zl(n):Array.isArray(n)?n.map(i=>yb(i,a)||tf.easeOut):tf[n]}const vb=(n,a,i)=>(((1-3*i+3*a)*n+(3*i-6*a))*n+3*a)*n,tA=1e-7,nA=12;function aA(n,a,i,o,r){let u,d,p=0;do d=a+(i-a)/2,u=vb(d,o,r)-n,u>0?i=d:a=d;while(Math.abs(u)>tA&&++p<nA);return d}function io(n,a,i,o){if(n===a&&i===o)return vn;const r=u=>aA(u,0,1,n,i);return u=>u===0||u===1?u:vb(r(u),a,o)}const bb=n=>a=>a<=.5?n(2*a)/2:(2-n(2*(1-a)))/2,Sb=n=>a=>1-n(1-a),_b=io(.33,1.53,.69,.99),ih=Sb(_b),xb=bb(ih),Tb=n=>(n*=2)<1?.5*ih(n):.5*(2-Math.pow(2,-10*(n-1))),lh=n=>1-Math.sin(Math.acos(n)),Eb=Sb(lh),Cb=bb(lh),Ab=n=>/^0[^.\s]+$/u.test(n);function sA(n){return typeof n=="number"?n===0:n!==null?n==="none"||n==="0"||Ab(n):!0}const Pl=n=>Math.round(n*1e5)/1e5,oh=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function iA(n){return n==null}const lA=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,rh=(n,a)=>i=>!!(typeof i=="string"&&lA.test(i)&&i.startsWith(n)||a&&!iA(i)&&Object.prototype.hasOwnProperty.call(i,a)),jb=(n,a,i)=>o=>{if(typeof o!="string")return o;const[r,u,d,p]=o.match(oh);return{[n]:parseFloat(r),[a]:parseFloat(u),[i]:parseFloat(d),alpha:p!==void 0?parseFloat(p):1}},oA=n=>ja(0,255,n),wd={...zi,transform:n=>Math.round(oA(n))},Rs={test:rh("rgb","red"),parse:jb("red","green","blue"),transform:({red:n,green:a,blue:i,alpha:o=1})=>"rgba("+wd.transform(n)+", "+wd.transform(a)+", "+wd.transform(i)+", "+Pl(Ql.transform(o))+")"};function rA(n){let a="",i="",o="",r="";return n.length>5?(a=n.substring(1,3),i=n.substring(3,5),o=n.substring(5,7),r=n.substring(7,9)):(a=n.substring(1,2),i=n.substring(2,3),o=n.substring(3,4),r=n.substring(4,5),a+=a,i+=i,o+=o,r+=r),{red:parseInt(a,16),green:parseInt(i,16),blue:parseInt(o,16),alpha:r?parseInt(r,16)/255:1}}const nf={test:rh("#"),parse:rA,transform:Rs.transform},ji={test:rh("hsl","hue"),parse:jb("hue","saturation","lightness"),transform:({hue:n,saturation:a,lightness:i,alpha:o=1})=>"hsla("+Math.round(n)+", "+Jn.transform(Pl(a))+", "+Jn.transform(Pl(i))+", "+Pl(Ql.transform(o))+")"},$t={test:n=>Rs.test(n)||nf.test(n)||ji.test(n),parse:n=>Rs.test(n)?Rs.parse(n):ji.test(n)?ji.parse(n):nf.parse(n),transform:n=>typeof n=="string"?n:n.hasOwnProperty("red")?Rs.transform(n):ji.transform(n)},cA=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function uA(n){var a,i;return isNaN(n)&&typeof n=="string"&&(((a=n.match(oh))===null||a===void 0?void 0:a.length)||0)+(((i=n.match(cA))===null||i===void 0?void 0:i.length)||0)>0}const Nb="number",wb="color",dA="var",fA="var(",qy="${}",hA=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function Wl(n){const a=n.toString(),i=[],o={color:[],number:[],var:[]},r=[];let u=0;const p=a.replace(hA,m=>($t.test(m)?(o.color.push(u),r.push(wb),i.push($t.parse(m))):m.startsWith(fA)?(o.var.push(u),r.push(dA),i.push(m)):(o.number.push(u),r.push(Nb),i.push(parseFloat(m))),++u,qy)).split(qy);return{values:i,split:p,indexes:o,types:r}}function Db(n){return Wl(n).values}function kb(n){const{split:a,types:i}=Wl(n),o=a.length;return r=>{let u="";for(let d=0;d<o;d++)if(u+=a[d],r[d]!==void 0){const p=i[d];p===Nb?u+=Pl(r[d]):p===wb?u+=$t.transform(r[d]):u+=r[d]}return u}}const pA=n=>typeof n=="number"?0:n;function mA(n){const a=Db(n);return kb(n)(a.map(pA))}const is={test:uA,parse:Db,createTransformer:kb,getAnimatableNone:mA},gA=new Set(["brightness","contrast","saturate","opacity"]);function yA(n){const[a,i]=n.slice(0,-1).split("(");if(a==="drop-shadow")return n;const[o]=i.match(oh)||[];if(!o)return n;const r=i.replace(o,"");let u=gA.has(a)?1:0;return o!==i&&(u*=100),a+"("+u+r+")"}const vA=/\b([a-z-]*)\(.*?\)/gu,af={...is,getAnimatableNone:n=>{const a=n.match(vA);return a?a.map(yA).join(" "):n}},bA={...$f,color:$t,backgroundColor:$t,outlineColor:$t,fill:$t,stroke:$t,borderColor:$t,borderTopColor:$t,borderRightColor:$t,borderBottomColor:$t,borderLeftColor:$t,filter:af,WebkitFilter:af},ch=n=>bA[n];function Mb(n,a){let i=ch(n);return i!==af&&(i=is),i.getAnimatableNone?i.getAnimatableNone(a):void 0}const SA=new Set(["auto","none","0"]);function _A(n,a,i){let o=0,r;for(;o<n.length&&!r;){const u=n[o];typeof u=="string"&&!SA.has(u)&&Wl(u).values.length&&(r=n[o]),o++}if(r&&i)for(const u of a)n[u]=Mb(i,r)}const Fy=n=>n===zi||n===ge,$y=(n,a)=>parseFloat(n.split(", ")[a]),Yy=(n,a)=>(i,{transform:o})=>{if(o==="none"||!o)return 0;const r=o.match(/^matrix3d\((.+)\)$/u);if(r)return $y(r[1],a);{const u=o.match(/^matrix\((.+)\)$/u);return u?$y(u[1],n):0}},xA=new Set(["x","y","z"]),TA=Ui.filter(n=>!xA.has(n));function EA(n){const a=[];return TA.forEach(i=>{const o=n.getValue(i);o!==void 0&&(a.push([i,o.get()]),o.set(i.startsWith("scale")?1:0))}),a}const Oi={width:({x:n},{paddingLeft:a="0",paddingRight:i="0"})=>n.max-n.min-parseFloat(a)-parseFloat(i),height:({y:n},{paddingTop:a="0",paddingBottom:i="0"})=>n.max-n.min-parseFloat(a)-parseFloat(i),top:(n,{top:a})=>parseFloat(a),left:(n,{left:a})=>parseFloat(a),bottom:({y:n},{top:a})=>parseFloat(a)+(n.max-n.min),right:({x:n},{left:a})=>parseFloat(a)+(n.max-n.min),x:Yy(4,13),y:Yy(5,14)};Oi.translateX=Oi.x;Oi.translateY=Oi.y;const Os=new Set;let sf=!1,lf=!1;function Rb(){if(lf){const n=Array.from(Os).filter(o=>o.needsMeasurement),a=new Set(n.map(o=>o.element)),i=new Map;a.forEach(o=>{const r=EA(o);r.length&&(i.set(o,r),o.render())}),n.forEach(o=>o.measureInitialState()),a.forEach(o=>{o.render();const r=i.get(o);r&&r.forEach(([u,d])=>{var p;(p=o.getValue(u))===null||p===void 0||p.set(d)})}),n.forEach(o=>o.measureEndState()),n.forEach(o=>{o.suspendedScrollY!==void 0&&window.scrollTo(0,o.suspendedScrollY)})}lf=!1,sf=!1,Os.forEach(n=>n.complete()),Os.clear()}function Ob(){Os.forEach(n=>{n.readKeyframes(),n.needsMeasurement&&(lf=!0)})}function CA(){Ob(),Rb()}class uh{constructor(a,i,o,r,u,d=!1){this.isComplete=!1,this.isAsync=!1,this.needsMeasurement=!1,this.isScheduled=!1,this.unresolvedKeyframes=[...a],this.onComplete=i,this.name=o,this.motionValue=r,this.element=u,this.isAsync=d}scheduleResolve(){this.isScheduled=!0,this.isAsync?(Os.add(this),sf||(sf=!0,st.read(Ob),st.resolveKeyframes(Rb))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:a,name:i,element:o,motionValue:r}=this;for(let u=0;u<a.length;u++)if(a[u]===null)if(u===0){const d=r==null?void 0:r.get(),p=a[a.length-1];if(d!==void 0)a[0]=d;else if(o&&i){const m=o.readValue(i,p);m!=null&&(a[0]=m)}a[0]===void 0&&(a[0]=p),r&&d===void 0&&r.set(a[0])}else a[u]=a[u-1]}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(){this.isComplete=!0,this.onComplete(this.unresolvedKeyframes,this.finalKeyframe),Os.delete(this)}cancel(){this.isComplete||(this.isScheduled=!1,Os.delete(this))}resume(){this.isComplete||this.scheduleResolve()}}const Bb=n=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(n),AA=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function jA(n){const a=AA.exec(n);if(!a)return[,];const[,i,o,r]=a;return[`--${i??o}`,r]}function Lb(n,a,i=1){const[o,r]=jA(n);if(!o)return;const u=window.getComputedStyle(a).getPropertyValue(o);if(u){const d=u.trim();return Bb(d)?parseFloat(d):d}return Ff(r)?Lb(r,a,i+1):r}const Ub=n=>a=>a.test(n),NA={test:n=>n==="auto",parse:n=>n},zb=[zi,ge,Jn,Wa,EC,TC,NA],Ky=n=>zb.find(Ub(n));class Ib extends uh{constructor(a,i,o,r,u){super(a,i,o,r,u,!0)}readKeyframes(){const{unresolvedKeyframes:a,element:i,name:o}=this;if(!i||!i.current)return;super.readKeyframes();for(let m=0;m<a.length;m++){let g=a[m];if(typeof g=="string"&&(g=g.trim(),Ff(g))){const y=Lb(g,i.current);y!==void 0&&(a[m]=y),m===a.length-1&&(this.finalKeyframe=g)}}if(this.resolveNoneKeyframes(),!fb.has(o)||a.length!==2)return;const[r,u]=a,d=Ky(r),p=Ky(u);if(d!==p)if(Fy(d)&&Fy(p))for(let m=0;m<a.length;m++){const g=a[m];typeof g=="string"&&(a[m]=parseFloat(g))}else this.needsMeasurement=!0}resolveNoneKeyframes(){const{unresolvedKeyframes:a,name:i}=this,o=[];for(let r=0;r<a.length;r++)sA(a[r])&&o.push(r);o.length&&_A(a,o,i)}measureInitialState(){const{element:a,unresolvedKeyframes:i,name:o}=this;if(!a||!a.current)return;o==="height"&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=Oi[o](a.measureViewportBox(),window.getComputedStyle(a.current)),i[0]=this.measuredOrigin;const r=i[i.length-1];r!==void 0&&a.getValue(o,r).jump(r,!1)}measureEndState(){var a;const{element:i,name:o,unresolvedKeyframes:r}=this;if(!i||!i.current)return;const u=i.getValue(o);u&&u.jump(this.measuredOrigin,!1);const d=r.length-1,p=r[d];r[d]=Oi[o](i.measureViewportBox(),window.getComputedStyle(i.current)),p!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=p),!((a=this.removedTransforms)===null||a===void 0)&&a.length&&this.removedTransforms.forEach(([m,g])=>{i.getValue(m).set(g)}),this.resolveNoneKeyframes()}}const Zy=(n,a)=>a==="zIndex"?!1:!!(typeof n=="number"||Array.isArray(n)||typeof n=="string"&&(is.test(n)||n==="0")&&!n.startsWith("url("));function wA(n){const a=n[0];if(n.length===1)return!0;for(let i=0;i<n.length;i++)if(n[i]!==a)return!0}function DA(n,a,i,o){const r=n[0];if(r===null)return!1;if(a==="display"||a==="visibility")return!0;const u=n[n.length-1],d=Zy(r,a),p=Zy(u,a);return!d||!p?!1:wA(n)||(i==="spring"||ah(i))&&o}const kA=n=>n!==null;function ic(n,{repeat:a,repeatType:i="loop"},o){const r=n.filter(kA),u=a&&i!=="loop"&&a%2===1?0:r.length-1;return!u||o===void 0?r[u]:o}const MA=40;class Vb{constructor({autoplay:a=!0,delay:i=0,type:o="keyframes",repeat:r=0,repeatDelay:u=0,repeatType:d="loop",...p}){this.isStopped=!1,this.hasAttemptedResolve=!1,this.createdAt=Wn.now(),this.options={autoplay:a,delay:i,type:o,repeat:r,repeatDelay:u,repeatType:d,...p},this.updateFinishedPromise()}calcStartTime(){return this.resolvedAt?this.resolvedAt-this.createdAt>MA?this.resolvedAt:this.createdAt:this.createdAt}get resolved(){return!this._resolved&&!this.hasAttemptedResolve&&CA(),this._resolved}onKeyframesResolved(a,i){this.resolvedAt=Wn.now(),this.hasAttemptedResolve=!0;const{name:o,type:r,velocity:u,delay:d,onComplete:p,onUpdate:m,isGenerator:g}=this.options;if(!g&&!DA(a,o,r,u))if(d)this.options.duration=0;else{m&&m(ic(a,this.options,i)),p&&p(),this.resolveFinishedPromise();return}const y=this.initPlayback(a,i);y!==!1&&(this._resolved={keyframes:a,finalKeyframe:i,...y},this.onPostResolved())}onPostResolved(){}then(a,i){return this.currentFinishedPromise.then(a,i)}flatten(){this.options.type="keyframes",this.options.ease="linear"}updateFinishedPromise(){this.currentFinishedPromise=new Promise(a=>{this.resolveFinishedPromise=a})}}const of=2e4;function Hb(n){let a=0;const i=50;let o=n.next(a);for(;!o.done&&a<of;)a+=i,o=n.next(a);return a>=of?1/0:a}const ut=(n,a,i)=>n+(a-n)*i;function Dd(n,a,i){return i<0&&(i+=1),i>1&&(i-=1),i<1/6?n+(a-n)*6*i:i<1/2?a:i<2/3?n+(a-n)*(2/3-i)*6:n}function RA({hue:n,saturation:a,lightness:i,alpha:o}){n/=360,a/=100,i/=100;let r=0,u=0,d=0;if(!a)r=u=d=i;else{const p=i<.5?i*(1+a):i+a-i*a,m=2*i-p;r=Dd(m,p,n+1/3),u=Dd(m,p,n),d=Dd(m,p,n-1/3)}return{red:Math.round(r*255),green:Math.round(u*255),blue:Math.round(d*255),alpha:o}}function Hr(n,a){return i=>i>0?a:n}const kd=(n,a,i)=>{const o=n*n,r=i*(a*a-o)+o;return r<0?0:Math.sqrt(r)},OA=[nf,Rs,ji],BA=n=>OA.find(a=>a.test(n));function Xy(n){const a=BA(n);if(!a)return!1;let i=a.parse(n);return a===ji&&(i=RA(i)),i}const Qy=(n,a)=>{const i=Xy(n),o=Xy(a);if(!i||!o)return Hr(n,a);const r={...i};return u=>(r.red=kd(i.red,o.red,u),r.green=kd(i.green,o.green,u),r.blue=kd(i.blue,o.blue,u),r.alpha=ut(i.alpha,o.alpha,u),Rs.transform(r))},LA=(n,a)=>i=>a(n(i)),lo=(...n)=>n.reduce(LA),rf=new Set(["none","hidden"]);function UA(n,a){return rf.has(n)?i=>i<=0?n:a:i=>i>=1?a:n}function zA(n,a){return i=>ut(n,a,i)}function dh(n){return typeof n=="number"?zA:typeof n=="string"?Ff(n)?Hr:$t.test(n)?Qy:HA:Array.isArray(n)?Pb:typeof n=="object"?$t.test(n)?Qy:IA:Hr}function Pb(n,a){const i=[...n],o=i.length,r=n.map((u,d)=>dh(u)(u,a[d]));return u=>{for(let d=0;d<o;d++)i[d]=r[d](u);return i}}function IA(n,a){const i={...n,...a},o={};for(const r in i)n[r]!==void 0&&a[r]!==void 0&&(o[r]=dh(n[r])(n[r],a[r]));return r=>{for(const u in o)i[u]=o[u](r);return i}}function VA(n,a){var i;const o=[],r={color:0,var:0,number:0};for(let u=0;u<a.values.length;u++){const d=a.types[u],p=n.indexes[d][r[d]],m=(i=n.values[p])!==null&&i!==void 0?i:0;o[u]=m,r[d]++}return o}const HA=(n,a)=>{const i=is.createTransformer(a),o=Wl(n),r=Wl(a);return o.indexes.var.length===r.indexes.var.length&&o.indexes.color.length===r.indexes.color.length&&o.indexes.number.length>=r.indexes.number.length?rf.has(n)&&!r.values.length||rf.has(a)&&!o.values.length?UA(n,a):lo(Pb(VA(o,r),r.values),i):Hr(n,a)};function Gb(n,a,i){return typeof n=="number"&&typeof a=="number"&&typeof i=="number"?ut(n,a,i):dh(n)(n,a)}const PA=5;function qb(n,a,i){const o=Math.max(a-PA,0);return hb(i-n(o),a-o)}const ht={stiffness:100,damping:10,mass:1,velocity:0,duration:800,bounce:.3,visualDuration:.3,restSpeed:{granular:.01,default:2},restDelta:{granular:.005,default:.5},minDuration:.01,maxDuration:10,minDamping:.05,maxDamping:1},Md=.001;function GA({duration:n=ht.duration,bounce:a=ht.bounce,velocity:i=ht.velocity,mass:o=ht.mass}){let r,u,d=1-a;d=ja(ht.minDamping,ht.maxDamping,d),n=ja(ht.minDuration,ht.maxDuration,Ca(n)),d<1?(r=g=>{const y=g*d,v=y*n,_=y-i,T=cf(g,d),C=Math.exp(-v);return Md-_/T*C},u=g=>{const v=g*d*n,_=v*i+i,T=Math.pow(d,2)*Math.pow(g,2)*n,C=Math.exp(-v),E=cf(Math.pow(g,2),d);return(-r(g)+Md>0?-1:1)*((_-T)*C)/E}):(r=g=>{const y=Math.exp(-g*n),v=(g-i)*n+1;return-Md+y*v},u=g=>{const y=Math.exp(-g*n),v=(i-g)*(n*n);return y*v});const p=5/n,m=FA(r,u,p);if(n=Ea(n),isNaN(m))return{stiffness:ht.stiffness,damping:ht.damping,duration:n};{const g=Math.pow(m,2)*o;return{stiffness:g,damping:d*2*Math.sqrt(o*g),duration:n}}}const qA=12;function FA(n,a,i){let o=i;for(let r=1;r<qA;r++)o=o-n(o)/a(o);return o}function cf(n,a){return n*Math.sqrt(1-a*a)}const $A=["duration","bounce"],YA=["stiffness","damping","mass"];function Jy(n,a){return a.some(i=>n[i]!==void 0)}function KA(n){let a={velocity:ht.velocity,stiffness:ht.stiffness,damping:ht.damping,mass:ht.mass,isResolvedFromDuration:!1,...n};if(!Jy(n,YA)&&Jy(n,$A))if(n.visualDuration){const i=n.visualDuration,o=2*Math.PI/(i*1.2),r=o*o,u=2*ja(.05,1,1-(n.bounce||0))*Math.sqrt(r);a={...a,mass:ht.mass,stiffness:r,damping:u}}else{const i=GA(n);a={...a,...i,mass:ht.mass},a.isResolvedFromDuration=!0}return a}function Fb(n=ht.visualDuration,a=ht.bounce){const i=typeof n!="object"?{visualDuration:n,keyframes:[0,1],bounce:a}:n;let{restSpeed:o,restDelta:r}=i;const u=i.keyframes[0],d=i.keyframes[i.keyframes.length-1],p={done:!1,value:u},{stiffness:m,damping:g,mass:y,duration:v,velocity:_,isResolvedFromDuration:T}=KA({...i,velocity:-Ca(i.velocity||0)}),C=_||0,E=g/(2*Math.sqrt(m*y)),j=d-u,A=Ca(Math.sqrt(m/y)),k=Math.abs(j)<5;o||(o=k?ht.restSpeed.granular:ht.restSpeed.default),r||(r=k?ht.restDelta.granular:ht.restDelta.default);let R;if(E<1){const H=cf(A,E);R=V=>{const q=Math.exp(-E*A*V);return d-q*((C+E*A*j)/H*Math.sin(H*V)+j*Math.cos(H*V))}}else if(E===1)R=H=>d-Math.exp(-A*H)*(j+(C+A*j)*H);else{const H=A*Math.sqrt(E*E-1);R=V=>{const q=Math.exp(-E*A*V),O=Math.min(H*V,300);return d-q*((C+E*A*j)*Math.sinh(O)+H*j*Math.cosh(O))/H}}const $={calculatedDuration:T&&v||null,next:H=>{const V=R(H);if(T)p.done=H>=v;else{let q=0;E<1&&(q=H===0?Ea(C):qb(R,H,V));const O=Math.abs(q)<=o,ee=Math.abs(d-V)<=r;p.done=O&&ee}return p.value=p.done?d:V,p},toString:()=>{const H=Math.min(Hb($),of),V=mb(q=>$.next(H*q).value,H,30);return H+"ms "+V}};return $}function Wy({keyframes:n,velocity:a=0,power:i=.8,timeConstant:o=325,bounceDamping:r=10,bounceStiffness:u=500,modifyTarget:d,min:p,max:m,restDelta:g=.5,restSpeed:y}){const v=n[0],_={done:!1,value:v},T=O=>p!==void 0&&O<p||m!==void 0&&O>m,C=O=>p===void 0?m:m===void 0||Math.abs(p-O)<Math.abs(m-O)?p:m;let E=i*a;const j=v+E,A=d===void 0?j:d(j);A!==j&&(E=A-v);const k=O=>-E*Math.exp(-O/o),R=O=>A+k(O),$=O=>{const ee=k(O),ae=R(O);_.done=Math.abs(ee)<=g,_.value=_.done?A:ae};let H,V;const q=O=>{T(_.value)&&(H=O,V=Fb({keyframes:[_.value,C(_.value)],velocity:qb(R,O,_.value),damping:r,stiffness:u,restDelta:g,restSpeed:y}))};return q(0),{calculatedDuration:null,next:O=>{let ee=!1;return!V&&H===void 0&&(ee=!0,$(O),q(O)),H!==void 0&&O>=H?V.next(O-H):(!ee&&$(O),_)}}}const ZA=io(.42,0,1,1),XA=io(0,0,.58,1),$b=io(.42,0,.58,1),QA=n=>Array.isArray(n)&&typeof n[0]!="number",JA={linear:vn,easeIn:ZA,easeInOut:$b,easeOut:XA,circIn:lh,circInOut:Cb,circOut:Eb,backIn:ih,backInOut:xb,backOut:_b,anticipate:Tb},ev=n=>{if(sh(n)){$0(n.length===4);const[a,i,o,r]=n;return io(a,i,o,r)}else if(typeof n=="string")return JA[n];return n};function WA(n,a,i){const o=[],r=i||Gb,u=n.length-1;for(let d=0;d<u;d++){let p=r(n[d],n[d+1]);if(a){const m=Array.isArray(a)?a[d]||vn:a;p=lo(m,p)}o.push(p)}return o}function ej(n,a,{clamp:i=!0,ease:o,mixer:r}={}){const u=n.length;if($0(u===a.length),u===1)return()=>a[0];if(u===2&&a[0]===a[1])return()=>a[1];const d=n[0]===n[1];n[0]>n[u-1]&&(n=[...n].reverse(),a=[...a].reverse());const p=WA(a,o,r),m=p.length,g=y=>{if(d&&y<n[0])return a[0];let v=0;if(m>1)for(;v<n.length-2&&!(y<n[v+1]);v++);const _=Ri(n[v],n[v+1],y);return p[v](_)};return i?y=>g(ja(n[0],n[u-1],y)):g}function tj(n,a){const i=n[n.length-1];for(let o=1;o<=a;o++){const r=Ri(0,a,o);n.push(ut(i,1,r))}}function nj(n){const a=[0];return tj(a,n.length-1),a}function aj(n,a){return n.map(i=>i*a)}function sj(n,a){return n.map(()=>a||$b).splice(0,n.length-1)}function Pr({duration:n=300,keyframes:a,times:i,ease:o="easeInOut"}){const r=QA(o)?o.map(ev):ev(o),u={done:!1,value:a[0]},d=aj(i&&i.length===a.length?i:nj(a),n),p=ej(d,a,{ease:Array.isArray(r)?r:sj(a,r)});return{calculatedDuration:n,next:m=>(u.value=p(m),u.done=m>=n,u)}}const ij=n=>{const a=({timestamp:i})=>n(i);return{start:()=>st.update(a,!0),stop:()=>ss(a),now:()=>Pt.isProcessing?Pt.timestamp:Wn.now()}},lj={decay:Wy,inertia:Wy,tween:Pr,keyframes:Pr,spring:Fb},oj=n=>n/100;class fh extends Vb{constructor(a){super(a),this.holdTime=null,this.cancelTime=null,this.currentTime=0,this.playbackSpeed=1,this.pendingPlayState="running",this.startTime=null,this.state="idle",this.stop=()=>{if(this.resolver.cancel(),this.isStopped=!0,this.state==="idle")return;this.teardown();const{onStop:m}=this.options;m&&m()};const{name:i,motionValue:o,element:r,keyframes:u}=this.options,d=(r==null?void 0:r.KeyframeResolver)||uh,p=(m,g)=>this.onKeyframesResolved(m,g);this.resolver=new d(u,p,i,o,r),this.resolver.scheduleResolve()}flatten(){super.flatten(),this._resolved&&Object.assign(this._resolved,this.initPlayback(this._resolved.keyframes))}initPlayback(a){const{type:i="keyframes",repeat:o=0,repeatDelay:r=0,repeatType:u,velocity:d=0}=this.options,p=ah(i)?i:lj[i]||Pr;let m,g;p!==Pr&&typeof a[0]!="number"&&(m=lo(oj,Gb(a[0],a[1])),a=[0,100]);const y=p({...this.options,keyframes:a});u==="mirror"&&(g=p({...this.options,keyframes:[...a].reverse(),velocity:-d})),y.calculatedDuration===null&&(y.calculatedDuration=Hb(y));const{calculatedDuration:v}=y,_=v+r,T=_*(o+1)-r;return{generator:y,mirroredGenerator:g,mapPercentToKeyframes:m,calculatedDuration:v,resolvedDuration:_,totalDuration:T}}onPostResolved(){const{autoplay:a=!0}=this.options;this.play(),this.pendingPlayState==="paused"||!a?this.pause():this.state=this.pendingPlayState}tick(a,i=!1){const{resolved:o}=this;if(!o){const{keyframes:O}=this.options;return{done:!0,value:O[O.length-1]}}const{finalKeyframe:r,generator:u,mirroredGenerator:d,mapPercentToKeyframes:p,keyframes:m,calculatedDuration:g,totalDuration:y,resolvedDuration:v}=o;if(this.startTime===null)return u.next(0);const{delay:_,repeat:T,repeatType:C,repeatDelay:E,onUpdate:j}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,a):this.speed<0&&(this.startTime=Math.min(a-y/this.speed,this.startTime)),i?this.currentTime=a:this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=Math.round(a-this.startTime)*this.speed;const A=this.currentTime-_*(this.speed>=0?1:-1),k=this.speed>=0?A<0:A>y;this.currentTime=Math.max(A,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=y);let R=this.currentTime,$=u;if(T){const O=Math.min(this.currentTime,y)/v;let ee=Math.floor(O),ae=O%1;!ae&&O>=1&&(ae=1),ae===1&&ee--,ee=Math.min(ee,T+1),!!(ee%2)&&(C==="reverse"?(ae=1-ae,E&&(ae-=E/v)):C==="mirror"&&($=d)),R=ja(0,1,ae)*v}const H=k?{done:!1,value:m[0]}:$.next(R);p&&(H.value=p(H.value));let{done:V}=H;!k&&g!==null&&(V=this.speed>=0?this.currentTime>=y:this.currentTime<=0);const q=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&V);return q&&r!==void 0&&(H.value=ic(m,this.options,r)),j&&j(H.value),q&&this.finish(),H}get duration(){const{resolved:a}=this;return a?Ca(a.calculatedDuration):0}get time(){return Ca(this.currentTime)}set time(a){a=Ea(a),this.currentTime=a,this.holdTime!==null||this.speed===0?this.holdTime=a:this.driver&&(this.startTime=this.driver.now()-a/this.speed)}get speed(){return this.playbackSpeed}set speed(a){const i=this.playbackSpeed!==a;this.playbackSpeed=a,i&&(this.time=Ca(this.currentTime))}play(){if(this.resolver.isScheduled||this.resolver.resume(),!this._resolved){this.pendingPlayState="running";return}if(this.isStopped)return;const{driver:a=ij,onPlay:i,startTime:o}=this.options;this.driver||(this.driver=a(u=>this.tick(u))),i&&i();const r=this.driver.now();this.holdTime!==null?this.startTime=r-this.holdTime:this.startTime?this.state==="finished"&&(this.startTime=r):this.startTime=o??this.calcStartTime(),this.state==="finished"&&this.updateFinishedPromise(),this.cancelTime=this.startTime,this.holdTime=null,this.state="running",this.driver.start()}pause(){var a;if(!this._resolved){this.pendingPlayState="paused";return}this.state="paused",this.holdTime=(a=this.currentTime)!==null&&a!==void 0?a:0}complete(){this.state!=="running"&&this.play(),this.pendingPlayState=this.state="finished",this.holdTime=null}finish(){this.teardown(),this.state="finished";const{onComplete:a}=this.options;a&&a()}cancel(){this.cancelTime!==null&&this.tick(this.cancelTime),this.teardown(),this.updateFinishedPromise()}teardown(){this.state="idle",this.stopDriver(),this.resolveFinishedPromise(),this.updateFinishedPromise(),this.startTime=this.cancelTime=null,this.resolver.cancel()}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(a){return this.startTime=0,this.tick(a,!0)}}const rj=new Set(["opacity","clipPath","filter","transform"]);function cj(n,a,i,{delay:o=0,duration:r=300,repeat:u=0,repeatType:d="loop",ease:p="easeInOut",times:m}={}){const g={[a]:i};m&&(g.offset=m);const y=yb(p,r);return Array.isArray(y)&&(g.easing=y),n.animate(g,{delay:o,duration:r,easing:Array.isArray(y)?"linear":y,fill:"both",iterations:u+1,direction:d==="reverse"?"alternate":"normal"})}const uj=nh(()=>Object.hasOwnProperty.call(Element.prototype,"animate")),Gr=10,dj=2e4;function fj(n){return ah(n.type)||n.type==="spring"||!gb(n.ease)}function hj(n,a){const i=new fh({...a,keyframes:n,repeat:0,delay:0,isGenerator:!0});let o={done:!1,value:n[0]};const r=[];let u=0;for(;!o.done&&u<dj;)o=i.sample(u),r.push(o.value),u+=Gr;return{times:void 0,keyframes:r,duration:u-Gr,ease:"linear"}}const Yb={anticipate:Tb,backInOut:xb,circInOut:Cb};function pj(n){return n in Yb}class tv extends Vb{constructor(a){super(a);const{name:i,motionValue:o,element:r,keyframes:u}=this.options;this.resolver=new Ib(u,(d,p)=>this.onKeyframesResolved(d,p),i,o,r),this.resolver.scheduleResolve()}initPlayback(a,i){let{duration:o=300,times:r,ease:u,type:d,motionValue:p,name:m,startTime:g}=this.options;if(!p.owner||!p.owner.current)return!1;if(typeof u=="string"&&Vr()&&pj(u)&&(u=Yb[u]),fj(this.options)){const{onComplete:v,onUpdate:_,motionValue:T,element:C,...E}=this.options,j=hj(a,E);a=j.keyframes,a.length===1&&(a[1]=a[0]),o=j.duration,r=j.times,u=j.ease,d="keyframes"}const y=cj(p.owner.current,m,a,{...this.options,duration:o,times:r,ease:u});return y.startTime=g??this.calcStartTime(),this.pendingTimeline?(Gy(y,this.pendingTimeline),this.pendingTimeline=void 0):y.onfinish=()=>{const{onComplete:v}=this.options;p.set(ic(a,this.options,i)),v&&v(),this.cancel(),this.resolveFinishedPromise()},{animation:y,duration:o,times:r,type:d,ease:u,keyframes:a}}get duration(){const{resolved:a}=this;if(!a)return 0;const{duration:i}=a;return Ca(i)}get time(){const{resolved:a}=this;if(!a)return 0;const{animation:i}=a;return Ca(i.currentTime||0)}set time(a){const{resolved:i}=this;if(!i)return;const{animation:o}=i;o.currentTime=Ea(a)}get speed(){const{resolved:a}=this;if(!a)return 1;const{animation:i}=a;return i.playbackRate}set speed(a){const{resolved:i}=this;if(!i)return;const{animation:o}=i;o.playbackRate=a}get state(){const{resolved:a}=this;if(!a)return"idle";const{animation:i}=a;return i.playState}get startTime(){const{resolved:a}=this;if(!a)return null;const{animation:i}=a;return i.startTime}attachTimeline(a){if(!this._resolved)this.pendingTimeline=a;else{const{resolved:i}=this;if(!i)return vn;const{animation:o}=i;Gy(o,a)}return vn}play(){if(this.isStopped)return;const{resolved:a}=this;if(!a)return;const{animation:i}=a;i.playState==="finished"&&this.updateFinishedPromise(),i.play()}pause(){const{resolved:a}=this;if(!a)return;const{animation:i}=a;i.pause()}stop(){if(this.resolver.cancel(),this.isStopped=!0,this.state==="idle")return;this.resolveFinishedPromise(),this.updateFinishedPromise();const{resolved:a}=this;if(!a)return;const{animation:i,keyframes:o,duration:r,type:u,ease:d,times:p}=a;if(i.playState==="idle"||i.playState==="finished")return;if(this.time){const{motionValue:g,onUpdate:y,onComplete:v,element:_,...T}=this.options,C=new fh({...T,keyframes:o,duration:r,type:u,ease:d,times:p,isGenerator:!0}),E=Ea(this.time);g.setWithVelocity(C.sample(E-Gr).value,C.sample(E).value,Gr)}const{onStop:m}=this.options;m&&m(),this.cancel()}complete(){const{resolved:a}=this;a&&a.animation.finish()}cancel(){const{resolved:a}=this;a&&a.animation.cancel()}static supports(a){const{motionValue:i,name:o,repeatDelay:r,repeatType:u,damping:d,type:p}=a;if(!i||!i.owner||!(i.owner.current instanceof HTMLElement))return!1;const{onUpdate:m,transformTemplate:g}=i.owner.getProps();return uj()&&o&&rj.has(o)&&!m&&!g&&!r&&u!=="mirror"&&d!==0&&p!=="inertia"}}const mj={type:"spring",stiffness:500,damping:25,restSpeed:10},gj=n=>({type:"spring",stiffness:550,damping:n===0?2*Math.sqrt(550):30,restSpeed:10}),yj={type:"keyframes",duration:.8},vj={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},bj=(n,{keyframes:a})=>a.length>2?yj:zs.has(n)?n.startsWith("scale")?gj(a[1]):mj:vj;function Sj({when:n,delay:a,delayChildren:i,staggerChildren:o,staggerDirection:r,repeat:u,repeatType:d,repeatDelay:p,from:m,elapsed:g,...y}){return!!Object.keys(y).length}const hh=(n,a,i,o={},r,u)=>d=>{const p=Jf(o,n)||{},m=p.delay||o.delay||0;let{elapsed:g=0}=o;g=g-Ea(m);let y={keyframes:Array.isArray(i)?i:[null,i],ease:"easeOut",velocity:a.getVelocity(),...p,delay:-g,onUpdate:_=>{a.set(_),p.onUpdate&&p.onUpdate(_)},onComplete:()=>{d(),p.onComplete&&p.onComplete()},name:n,motionValue:a,element:u?void 0:r};Sj(p)||(y={...y,...bj(n,y)}),y.duration&&(y.duration=Ea(y.duration)),y.repeatDelay&&(y.repeatDelay=Ea(y.repeatDelay)),y.from!==void 0&&(y.keyframes[0]=y.from);let v=!1;if((y.type===!1||y.duration===0&&!y.repeatDelay)&&(y.duration=0,y.delay===0&&(v=!0)),v&&!u&&a.get()!==void 0){const _=ic(y.keyframes,p);if(_!==void 0)return st.update(()=>{y.onUpdate(_),y.onComplete()}),new JC([])}return!u&&tv.supports(y)?new tv(y):new fh(y)};function _j({protectedKeys:n,needsAnimating:a},i){const o=n.hasOwnProperty(i)&&a[i]!==!0;return a[i]=!1,o}function Kb(n,a,{delay:i=0,transitionOverride:o,type:r}={}){var u;let{transition:d=n.getDefaultTransition(),transitionEnd:p,...m}=a;o&&(d=o);const g=[],y=r&&n.animationState&&n.animationState.getState()[r];for(const v in m){const _=n.getValue(v,(u=n.latestValues[v])!==null&&u!==void 0?u:null),T=m[v];if(T===void 0||y&&_j(y,v))continue;const C={delay:i,...Jf(d||{},v)};let E=!1;if(window.MotionHandoffAnimation){const A=pb(n);if(A){const k=window.MotionHandoffAnimation(A,v,st);k!==null&&(C.startTime=k,E=!0)}}ef(n,v),_.start(hh(v,_,T,n.shouldReduceMotion&&fb.has(v)?{type:!1}:C,n,E));const j=_.animation;j&&g.push(j)}return p&&Promise.all(g).then(()=>{st.update(()=>{p&&KC(n,p)})}),g}function uf(n,a,i={}){var o;const r=sc(n,a,i.type==="exit"?(o=n.presenceContext)===null||o===void 0?void 0:o.custom:void 0);let{transition:u=n.getDefaultTransition()||{}}=r||{};i.transitionOverride&&(u=i.transitionOverride);const d=r?()=>Promise.all(Kb(n,r,i)):()=>Promise.resolve(),p=n.variantChildren&&n.variantChildren.size?(g=0)=>{const{delayChildren:y=0,staggerChildren:v,staggerDirection:_}=u;return xj(n,a,y+g,v,_,i)}:()=>Promise.resolve(),{when:m}=u;if(m){const[g,y]=m==="beforeChildren"?[d,p]:[p,d];return g().then(()=>y())}else return Promise.all([d(),p(i.delay)])}function xj(n,a,i=0,o=0,r=1,u){const d=[],p=(n.variantChildren.size-1)*o,m=r===1?(g=0)=>g*o:(g=0)=>p-g*o;return Array.from(n.variantChildren).sort(Tj).forEach((g,y)=>{g.notify("AnimationStart",a),d.push(uf(g,a,{...u,delay:i+m(y)}).then(()=>g.notify("AnimationComplete",a)))}),Promise.all(d)}function Tj(n,a){return n.sortNodePosition(a)}function Ej(n,a,i={}){n.notify("AnimationStart",a);let o;if(Array.isArray(a)){const r=a.map(u=>uf(n,u,i));o=Promise.all(r)}else if(typeof a=="string")o=uf(n,a,i);else{const r=typeof a=="function"?sc(n,a,i.custom):a;o=Promise.all(Kb(n,r,i))}return o.then(()=>{n.notify("AnimationComplete",a)})}const Cj=Vf.length;function Zb(n){if(!n)return;if(!n.isControllingVariants){const i=n.parent?Zb(n.parent)||{}:{};return n.props.initial!==void 0&&(i.initial=n.props.initial),i}const a={};for(let i=0;i<Cj;i++){const o=Vf[i],r=n.props[o];(Xl(r)||r===!1)&&(a[o]=r)}return a}const Aj=[...If].reverse(),jj=If.length;function Nj(n){return a=>Promise.all(a.map(({animation:i,options:o})=>Ej(n,i,o)))}function wj(n){let a=Nj(n),i=nv(),o=!0;const r=m=>(g,y)=>{var v;const _=sc(n,y,m==="exit"?(v=n.presenceContext)===null||v===void 0?void 0:v.custom:void 0);if(_){const{transition:T,transitionEnd:C,...E}=_;g={...g,...E,...C}}return g};function u(m){a=m(n)}function d(m){const{props:g}=n,y=Zb(n.parent)||{},v=[],_=new Set;let T={},C=1/0;for(let j=0;j<jj;j++){const A=Aj[j],k=i[A],R=g[A]!==void 0?g[A]:y[A],$=Xl(R),H=A===m?k.isActive:null;H===!1&&(C=j);let V=R===y[A]&&R!==g[A]&&$;if(V&&o&&n.manuallyAnimateOnMount&&(V=!1),k.protectedKeys={...T},!k.isActive&&H===null||!R&&!k.prevProp||nc(R)||typeof R=="boolean")continue;const q=Dj(k.prevProp,R);let O=q||A===m&&k.isActive&&!V&&$||j>C&&$,ee=!1;const ae=Array.isArray(R)?R:[R];let I=ae.reduce(r(A),{});H===!1&&(I={});const{prevResolvedValues:se={}}=k,Y={...se,...I},fe=Q=>{O=!0,_.has(Q)&&(ee=!0,_.delete(Q)),k.needsAnimating[Q]=!0;const te=n.getValue(Q);te&&(te.liveStyle=!1)};for(const Q in Y){const te=I[Q],we=se[Q];if(T.hasOwnProperty(Q))continue;let _e=!1;Wd(te)&&Wd(we)?_e=!db(te,we):_e=te!==we,_e?te!=null?fe(Q):_.add(Q):te!==void 0&&_.has(Q)?fe(Q):k.protectedKeys[Q]=!0}k.prevProp=R,k.prevResolvedValues=I,k.isActive&&(T={...T,...I}),o&&n.blockInitialAnimation&&(O=!1),O&&(!(V&&q)||ee)&&v.push(...ae.map(Q=>({animation:Q,options:{type:A}})))}if(_.size){const j={};_.forEach(A=>{const k=n.getBaseTarget(A),R=n.getValue(A);R&&(R.liveStyle=!0),j[A]=k??null}),v.push({animation:j})}let E=!!v.length;return o&&(g.initial===!1||g.initial===g.animate)&&!n.manuallyAnimateOnMount&&(E=!1),o=!1,E?a(v):Promise.resolve()}function p(m,g){var y;if(i[m].isActive===g)return Promise.resolve();(y=n.variantChildren)===null||y===void 0||y.forEach(_=>{var T;return(T=_.animationState)===null||T===void 0?void 0:T.setActive(m,g)}),i[m].isActive=g;const v=d(m);for(const _ in i)i[_].protectedKeys={};return v}return{animateChanges:d,setActive:p,setAnimateFunction:u,getState:()=>i,reset:()=>{i=nv(),o=!0}}}function Dj(n,a){return typeof a=="string"?a!==n:Array.isArray(a)?!db(a,n):!1}function Ns(n=!1){return{isActive:n,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function nv(){return{animate:Ns(!0),whileInView:Ns(),whileHover:Ns(),whileTap:Ns(),whileDrag:Ns(),whileFocus:Ns(),exit:Ns()}}class rs{constructor(a){this.isMounted=!1,this.node=a}update(){}}class kj extends rs{constructor(a){super(a),a.animationState||(a.animationState=wj(a))}updateAnimationControlsSubscription(){const{animate:a}=this.node.getProps();nc(a)&&(this.unmountControls=a.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:a}=this.node.getProps(),{animate:i}=this.node.prevProps||{};a!==i&&this.updateAnimationControlsSubscription()}unmount(){var a;this.node.animationState.reset(),(a=this.unmountControls)===null||a===void 0||a.call(this)}}let Mj=0;class Rj extends rs{constructor(){super(...arguments),this.id=Mj++}update(){if(!this.node.presenceContext)return;const{isPresent:a,onExitComplete:i}=this.node.presenceContext,{isPresent:o}=this.node.prevPresenceContext||{};if(!this.node.animationState||a===o)return;const r=this.node.animationState.setActive("exit",!a);i&&!a&&r.then(()=>i(this.id))}mount(){const{register:a}=this.node.presenceContext||{};a&&(this.unmount=a(this.id))}unmount(){}}const Oj={animation:{Feature:kj},exit:{Feature:Rj}},Hn={x:!1,y:!1};function Xb(){return Hn.x||Hn.y}function Bj(n){return n==="x"||n==="y"?Hn[n]?null:(Hn[n]=!0,()=>{Hn[n]=!1}):Hn.x||Hn.y?null:(Hn.x=Hn.y=!0,()=>{Hn.x=Hn.y=!1})}const ph=n=>n.pointerType==="mouse"?typeof n.button!="number"||n.button<=0:n.isPrimary!==!1;function eo(n,a,i,o={passive:!0}){return n.addEventListener(a,i,o),()=>n.removeEventListener(a,i)}function oo(n){return{point:{x:n.pageX,y:n.pageY}}}const Lj=n=>a=>ph(a)&&n(a,oo(a));function Gl(n,a,i,o){return eo(n,a,Lj(i),o)}const av=(n,a)=>Math.abs(n-a);function Uj(n,a){const i=av(n.x,a.x),o=av(n.y,a.y);return Math.sqrt(i**2+o**2)}class Qb{constructor(a,i,{transformPagePoint:o,contextWindow:r,dragSnapToOrigin:u=!1}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const v=Od(this.lastMoveEventInfo,this.history),_=this.startEvent!==null,T=Uj(v.offset,{x:0,y:0})>=3;if(!_&&!T)return;const{point:C}=v,{timestamp:E}=Pt;this.history.push({...C,timestamp:E});const{onStart:j,onMove:A}=this.handlers;_||(j&&j(this.lastMoveEvent,v),this.startEvent=this.lastMoveEvent),A&&A(this.lastMoveEvent,v)},this.handlePointerMove=(v,_)=>{this.lastMoveEvent=v,this.lastMoveEventInfo=Rd(_,this.transformPagePoint),st.update(this.updatePoint,!0)},this.handlePointerUp=(v,_)=>{this.end();const{onEnd:T,onSessionEnd:C,resumeAnimation:E}=this.handlers;if(this.dragSnapToOrigin&&E&&E(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const j=Od(v.type==="pointercancel"?this.lastMoveEventInfo:Rd(_,this.transformPagePoint),this.history);this.startEvent&&T&&T(v,j),C&&C(v,j)},!ph(a))return;this.dragSnapToOrigin=u,this.handlers=i,this.transformPagePoint=o,this.contextWindow=r||window;const d=oo(a),p=Rd(d,this.transformPagePoint),{point:m}=p,{timestamp:g}=Pt;this.history=[{...m,timestamp:g}];const{onSessionStart:y}=i;y&&y(a,Od(p,this.history)),this.removeListeners=lo(Gl(this.contextWindow,"pointermove",this.handlePointerMove),Gl(this.contextWindow,"pointerup",this.handlePointerUp),Gl(this.contextWindow,"pointercancel",this.handlePointerUp))}updateHandlers(a){this.handlers=a}end(){this.removeListeners&&this.removeListeners(),ss(this.updatePoint)}}function Rd(n,a){return a?{point:a(n.point)}:n}function sv(n,a){return{x:n.x-a.x,y:n.y-a.y}}function Od({point:n},a){return{point:n,delta:sv(n,Jb(a)),offset:sv(n,zj(a)),velocity:Ij(a,.1)}}function zj(n){return n[0]}function Jb(n){return n[n.length-1]}function Ij(n,a){if(n.length<2)return{x:0,y:0};let i=n.length-1,o=null;const r=Jb(n);for(;i>=0&&(o=n[i],!(r.timestamp-o.timestamp>Ea(a)));)i--;if(!o)return{x:0,y:0};const u=Ca(r.timestamp-o.timestamp);if(u===0)return{x:0,y:0};const d={x:(r.x-o.x)/u,y:(r.y-o.y)/u};return d.x===1/0&&(d.x=0),d.y===1/0&&(d.y=0),d}const Wb=1e-4,Vj=1-Wb,Hj=1+Wb,e1=.01,Pj=0-e1,Gj=0+e1;function bn(n){return n.max-n.min}function qj(n,a,i){return Math.abs(n-a)<=i}function iv(n,a,i,o=.5){n.origin=o,n.originPoint=ut(a.min,a.max,n.origin),n.scale=bn(i)/bn(a),n.translate=ut(i.min,i.max,n.origin)-n.originPoint,(n.scale>=Vj&&n.scale<=Hj||isNaN(n.scale))&&(n.scale=1),(n.translate>=Pj&&n.translate<=Gj||isNaN(n.translate))&&(n.translate=0)}function ql(n,a,i,o){iv(n.x,a.x,i.x,o?o.originX:void 0),iv(n.y,a.y,i.y,o?o.originY:void 0)}function lv(n,a,i){n.min=i.min+a.min,n.max=n.min+bn(a)}function Fj(n,a,i){lv(n.x,a.x,i.x),lv(n.y,a.y,i.y)}function ov(n,a,i){n.min=a.min-i.min,n.max=n.min+bn(a)}function Fl(n,a,i){ov(n.x,a.x,i.x),ov(n.y,a.y,i.y)}function $j(n,{min:a,max:i},o){return a!==void 0&&n<a?n=o?ut(a,n,o.min):Math.max(n,a):i!==void 0&&n>i&&(n=o?ut(i,n,o.max):Math.min(n,i)),n}function rv(n,a,i){return{min:a!==void 0?n.min+a:void 0,max:i!==void 0?n.max+i-(n.max-n.min):void 0}}function Yj(n,{top:a,left:i,bottom:o,right:r}){return{x:rv(n.x,i,r),y:rv(n.y,a,o)}}function cv(n,a){let i=a.min-n.min,o=a.max-n.max;return a.max-a.min<n.max-n.min&&([i,o]=[o,i]),{min:i,max:o}}function Kj(n,a){return{x:cv(n.x,a.x),y:cv(n.y,a.y)}}function Zj(n,a){let i=.5;const o=bn(n),r=bn(a);return r>o?i=Ri(a.min,a.max-o,n.min):o>r&&(i=Ri(n.min,n.max-r,a.min)),ja(0,1,i)}function Xj(n,a){const i={};return a.min!==void 0&&(i.min=a.min-n.min),a.max!==void 0&&(i.max=a.max-n.min),i}const df=.35;function Qj(n=df){return n===!1?n=0:n===!0&&(n=df),{x:uv(n,"left","right"),y:uv(n,"top","bottom")}}function uv(n,a,i){return{min:dv(n,a),max:dv(n,i)}}function dv(n,a){return typeof n=="number"?n:n[a]||0}const fv=()=>({translate:0,scale:1,origin:0,originPoint:0}),Ni=()=>({x:fv(),y:fv()}),hv=()=>({min:0,max:0}),xt=()=>({x:hv(),y:hv()});function Mn(n){return[n("x"),n("y")]}function t1({top:n,left:a,right:i,bottom:o}){return{x:{min:a,max:i},y:{min:n,max:o}}}function Jj({x:n,y:a}){return{top:a.min,right:n.max,bottom:a.max,left:n.min}}function Wj(n,a){if(!a)return n;const i=a({x:n.left,y:n.top}),o=a({x:n.right,y:n.bottom});return{top:i.y,left:i.x,bottom:o.y,right:o.x}}function Bd(n){return n===void 0||n===1}function ff({scale:n,scaleX:a,scaleY:i}){return!Bd(n)||!Bd(a)||!Bd(i)}function Ds(n){return ff(n)||n1(n)||n.z||n.rotate||n.rotateX||n.rotateY||n.skewX||n.skewY}function n1(n){return pv(n.x)||pv(n.y)}function pv(n){return n&&n!=="0%"}function qr(n,a,i){const o=n-i,r=a*o;return i+r}function mv(n,a,i,o,r){return r!==void 0&&(n=qr(n,r,o)),qr(n,i,o)+a}function hf(n,a=0,i=1,o,r){n.min=mv(n.min,a,i,o,r),n.max=mv(n.max,a,i,o,r)}function a1(n,{x:a,y:i}){hf(n.x,a.translate,a.scale,a.originPoint),hf(n.y,i.translate,i.scale,i.originPoint)}const gv=.999999999999,yv=1.0000000000001;function e2(n,a,i,o=!1){const r=i.length;if(!r)return;a.x=a.y=1;let u,d;for(let p=0;p<r;p++){u=i[p],d=u.projectionDelta;const{visualElement:m}=u.options;m&&m.props.style&&m.props.style.display==="contents"||(o&&u.options.layoutScroll&&u.scroll&&u!==u.root&&Di(n,{x:-u.scroll.offset.x,y:-u.scroll.offset.y}),d&&(a.x*=d.x.scale,a.y*=d.y.scale,a1(n,d)),o&&Ds(u.latestValues)&&Di(n,u.latestValues))}a.x<yv&&a.x>gv&&(a.x=1),a.y<yv&&a.y>gv&&(a.y=1)}function wi(n,a){n.min=n.min+a,n.max=n.max+a}function vv(n,a,i,o,r=.5){const u=ut(n.min,n.max,r);hf(n,a,i,u,o)}function Di(n,a){vv(n.x,a.x,a.scaleX,a.scale,a.originX),vv(n.y,a.y,a.scaleY,a.scale,a.originY)}function s1(n,a){return t1(Wj(n.getBoundingClientRect(),a))}function t2(n,a,i){const o=s1(n,i),{scroll:r}=a;return r&&(wi(o.x,r.offset.x),wi(o.y,r.offset.y)),o}const i1=({current:n})=>n?n.ownerDocument.defaultView:null,n2=new WeakMap;class a2{constructor(a){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=xt(),this.visualElement=a}start(a,{snapToCursor:i=!1}={}){const{presenceContext:o}=this.visualElement;if(o&&o.isPresent===!1)return;const r=y=>{const{dragSnapToOrigin:v}=this.getProps();v?this.pauseAnimation():this.stopAnimation(),i&&this.snapToCursor(oo(y).point)},u=(y,v)=>{const{drag:_,dragPropagation:T,onDragStart:C}=this.getProps();if(_&&!T&&(this.openDragLock&&this.openDragLock(),this.openDragLock=Bj(_),!this.openDragLock))return;this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),Mn(j=>{let A=this.getAxisMotionValue(j).get()||0;if(Jn.test(A)){const{projection:k}=this.visualElement;if(k&&k.layout){const R=k.layout.layoutBox[j];R&&(A=bn(R)*(parseFloat(A)/100))}}this.originPoint[j]=A}),C&&st.postRender(()=>C(y,v)),ef(this.visualElement,"transform");const{animationState:E}=this.visualElement;E&&E.setActive("whileDrag",!0)},d=(y,v)=>{const{dragPropagation:_,dragDirectionLock:T,onDirectionLock:C,onDrag:E}=this.getProps();if(!_&&!this.openDragLock)return;const{offset:j}=v;if(T&&this.currentDirection===null){this.currentDirection=s2(j),this.currentDirection!==null&&C&&C(this.currentDirection);return}this.updateAxis("x",v.point,j),this.updateAxis("y",v.point,j),this.visualElement.render(),E&&E(y,v)},p=(y,v)=>this.stop(y,v),m=()=>Mn(y=>{var v;return this.getAnimationState(y)==="paused"&&((v=this.getAxisMotionValue(y).animation)===null||v===void 0?void 0:v.play())}),{dragSnapToOrigin:g}=this.getProps();this.panSession=new Qb(a,{onSessionStart:r,onStart:u,onMove:d,onSessionEnd:p,resumeAnimation:m},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:g,contextWindow:i1(this.visualElement)})}stop(a,i){const o=this.isDragging;if(this.cancel(),!o)return;const{velocity:r}=i;this.startAnimation(r);const{onDragEnd:u}=this.getProps();u&&st.postRender(()=>u(a,i))}cancel(){this.isDragging=!1;const{projection:a,animationState:i}=this.visualElement;a&&(a.isAnimationBlocked=!1),this.panSession&&this.panSession.end(),this.panSession=void 0;const{dragPropagation:o}=this.getProps();!o&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),i&&i.setActive("whileDrag",!1)}updateAxis(a,i,o){const{drag:r}=this.getProps();if(!o||!Ar(a,r,this.currentDirection))return;const u=this.getAxisMotionValue(a);let d=this.originPoint[a]+o[a];this.constraints&&this.constraints[a]&&(d=$j(d,this.constraints[a],this.elastic[a])),u.set(d)}resolveConstraints(){var a;const{dragConstraints:i,dragElastic:o}=this.getProps(),r=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):(a=this.visualElement.projection)===null||a===void 0?void 0:a.layout,u=this.constraints;i&&Ai(i)?this.constraints||(this.constraints=this.resolveRefConstraints()):i&&r?this.constraints=Yj(r.layoutBox,i):this.constraints=!1,this.elastic=Qj(o),u!==this.constraints&&r&&this.constraints&&!this.hasMutatedConstraints&&Mn(d=>{this.constraints!==!1&&this.getAxisMotionValue(d)&&(this.constraints[d]=Xj(r.layoutBox[d],this.constraints[d]))})}resolveRefConstraints(){const{dragConstraints:a,onMeasureDragConstraints:i}=this.getProps();if(!a||!Ai(a))return!1;const o=a.current,{projection:r}=this.visualElement;if(!r||!r.layout)return!1;const u=t2(o,r.root,this.visualElement.getTransformPagePoint());let d=Kj(r.layout.layoutBox,u);if(i){const p=i(Jj(d));this.hasMutatedConstraints=!!p,p&&(d=t1(p))}return d}startAnimation(a){const{drag:i,dragMomentum:o,dragElastic:r,dragTransition:u,dragSnapToOrigin:d,onDragTransitionEnd:p}=this.getProps(),m=this.constraints||{},g=Mn(y=>{if(!Ar(y,i,this.currentDirection))return;let v=m&&m[y]||{};d&&(v={min:0,max:0});const _=r?200:1e6,T=r?40:1e7,C={type:"inertia",velocity:o?a[y]:0,bounceStiffness:_,bounceDamping:T,timeConstant:750,restDelta:1,restSpeed:10,...u,...v};return this.startAxisValueAnimation(y,C)});return Promise.all(g).then(p)}startAxisValueAnimation(a,i){const o=this.getAxisMotionValue(a);return ef(this.visualElement,a),o.start(hh(a,o,0,i,this.visualElement,!1))}stopAnimation(){Mn(a=>this.getAxisMotionValue(a).stop())}pauseAnimation(){Mn(a=>{var i;return(i=this.getAxisMotionValue(a).animation)===null||i===void 0?void 0:i.pause()})}getAnimationState(a){var i;return(i=this.getAxisMotionValue(a).animation)===null||i===void 0?void 0:i.state}getAxisMotionValue(a){const i=`_drag${a.toUpperCase()}`,o=this.visualElement.getProps(),r=o[i];return r||this.visualElement.getValue(a,(o.initial?o.initial[a]:void 0)||0)}snapToCursor(a){Mn(i=>{const{drag:o}=this.getProps();if(!Ar(i,o,this.currentDirection))return;const{projection:r}=this.visualElement,u=this.getAxisMotionValue(i);if(r&&r.layout){const{min:d,max:p}=r.layout.layoutBox[i];u.set(a[i]-ut(d,p,.5))}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:a,dragConstraints:i}=this.getProps(),{projection:o}=this.visualElement;if(!Ai(i)||!o||!this.constraints)return;this.stopAnimation();const r={x:0,y:0};Mn(d=>{const p=this.getAxisMotionValue(d);if(p&&this.constraints!==!1){const m=p.get();r[d]=Zj({min:m,max:m},this.constraints[d])}});const{transformTemplate:u}=this.visualElement.getProps();this.visualElement.current.style.transform=u?u({},""):"none",o.root&&o.root.updateScroll(),o.updateLayout(),this.resolveConstraints(),Mn(d=>{if(!Ar(d,a,null))return;const p=this.getAxisMotionValue(d),{min:m,max:g}=this.constraints[d];p.set(ut(m,g,r[d]))})}addListeners(){if(!this.visualElement.current)return;n2.set(this.visualElement,this);const a=this.visualElement.current,i=Gl(a,"pointerdown",m=>{const{drag:g,dragListener:y=!0}=this.getProps();g&&y&&this.start(m)}),o=()=>{const{dragConstraints:m}=this.getProps();Ai(m)&&m.current&&(this.constraints=this.resolveRefConstraints())},{projection:r}=this.visualElement,u=r.addEventListener("measure",o);r&&!r.layout&&(r.root&&r.root.updateScroll(),r.updateLayout()),st.read(o);const d=eo(window,"resize",()=>this.scalePositionWithinConstraints()),p=r.addEventListener("didUpdate",(({delta:m,hasLayoutChanged:g})=>{this.isDragging&&g&&(Mn(y=>{const v=this.getAxisMotionValue(y);v&&(this.originPoint[y]+=m[y].translate,v.set(v.get()+m[y].translate))}),this.visualElement.render())}));return()=>{d(),i(),u(),p&&p()}}getProps(){const a=this.visualElement.getProps(),{drag:i=!1,dragDirectionLock:o=!1,dragPropagation:r=!1,dragConstraints:u=!1,dragElastic:d=df,dragMomentum:p=!0}=a;return{...a,drag:i,dragDirectionLock:o,dragPropagation:r,dragConstraints:u,dragElastic:d,dragMomentum:p}}}function Ar(n,a,i){return(a===!0||a===n)&&(i===null||i===n)}function s2(n,a=10){let i=null;return Math.abs(n.y)>a?i="y":Math.abs(n.x)>a&&(i="x"),i}class i2 extends rs{constructor(a){super(a),this.removeGroupControls=vn,this.removeListeners=vn,this.controls=new a2(a)}mount(){const{dragControls:a}=this.node.getProps();a&&(this.removeGroupControls=a.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||vn}unmount(){this.removeGroupControls(),this.removeListeners()}}const bv=n=>(a,i)=>{n&&st.postRender(()=>n(a,i))};class l2 extends rs{constructor(){super(...arguments),this.removePointerDownListener=vn}onPointerDown(a){this.session=new Qb(a,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:i1(this.node)})}createPanHandlers(){const{onPanSessionStart:a,onPanStart:i,onPan:o,onPanEnd:r}=this.node.getProps();return{onSessionStart:bv(a),onStart:bv(i),onMove:o,onEnd:(u,d)=>{delete this.session,r&&st.postRender(()=>r(u,d))}}}mount(){this.removePointerDownListener=Gl(this.node.current,"pointerdown",a=>this.onPointerDown(a))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}const Lr={hasAnimatedSinceResize:!0,hasEverUpdated:!1};function Sv(n,a){return a.max===a.min?0:n/(a.max-a.min)*100}const Ol={correct:(n,a)=>{if(!a.target)return n;if(typeof n=="string")if(ge.test(n))n=parseFloat(n);else return n;const i=Sv(n,a.target.x),o=Sv(n,a.target.y);return`${i}% ${o}%`}},o2={correct:(n,{treeScale:a,projectionDelta:i})=>{const o=n,r=is.parse(n);if(r.length>5)return o;const u=is.createTransformer(n),d=typeof r[0]!="number"?1:0,p=i.x.scale*a.x,m=i.y.scale*a.y;r[0+d]/=p,r[1+d]/=m;const g=ut(p,m,.5);return typeof r[2+d]=="number"&&(r[2+d]/=g),typeof r[3+d]=="number"&&(r[3+d]/=g),u(r)}};class r2 extends S.Component{componentDidMount(){const{visualElement:a,layoutGroup:i,switchLayoutGroup:o,layoutId:r}=this.props,{projection:u}=a;OC(c2),u&&(i.group&&i.group.add(u),o&&o.register&&r&&o.register(u),u.root.didUpdate(),u.addEventListener("animationComplete",()=>{this.safeToRemove()}),u.setOptions({...u.options,onExitComplete:()=>this.safeToRemove()})),Lr.hasEverUpdated=!0}getSnapshotBeforeUpdate(a){const{layoutDependency:i,visualElement:o,drag:r,isPresent:u}=this.props,d=o.projection;return d&&(d.isPresent=u,r||a.layoutDependency!==i||i===void 0?d.willUpdate():this.safeToRemove(),a.isPresent!==u&&(u?d.promote():d.relegate()||st.postRender(()=>{const p=d.getStack();(!p||!p.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{projection:a}=this.props.visualElement;a&&(a.root.didUpdate(),Pf.postRender(()=>{!a.currentAnimation&&a.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:a,layoutGroup:i,switchLayoutGroup:o}=this.props,{projection:r}=a;r&&(r.scheduleCheckAfterUnmount(),i&&i.group&&i.group.remove(r),o&&o.deregister&&o.deregister(r))}safeToRemove(){const{safeToRemove:a}=this.props;a&&a()}render(){return null}}function l1(n){const[a,i]=q0(),o=S.useContext(Bf);return h.jsx(r2,{...n,layoutGroup:o,switchLayoutGroup:S.useContext(J0),isPresent:a,safeToRemove:i})}const c2={borderRadius:{...Ol,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:Ol,borderTopRightRadius:Ol,borderBottomLeftRadius:Ol,borderBottomRightRadius:Ol,boxShadow:o2};function u2(n,a,i){const o=Yt(n)?n:Jl(n);return o.start(hh("",o,a,i)),o.animation}function d2(n){return n instanceof SVGElement&&n.tagName!=="svg"}const f2=(n,a)=>n.depth-a.depth;class h2{constructor(){this.children=[],this.isDirty=!1}add(a){Wf(this.children,a),this.isDirty=!0}remove(a){eh(this.children,a),this.isDirty=!0}forEach(a){this.isDirty&&this.children.sort(f2),this.isDirty=!1,this.children.forEach(a)}}function p2(n,a){const i=Wn.now(),o=({timestamp:r})=>{const u=r-i;u>=a&&(ss(o),n(u-a))};return st.read(o,!0),()=>ss(o)}const o1=["TopLeft","TopRight","BottomLeft","BottomRight"],m2=o1.length,_v=n=>typeof n=="string"?parseFloat(n):n,xv=n=>typeof n=="number"||ge.test(n);function g2(n,a,i,o,r,u){r?(n.opacity=ut(0,i.opacity!==void 0?i.opacity:1,y2(o)),n.opacityExit=ut(a.opacity!==void 0?a.opacity:1,0,v2(o))):u&&(n.opacity=ut(a.opacity!==void 0?a.opacity:1,i.opacity!==void 0?i.opacity:1,o));for(let d=0;d<m2;d++){const p=`border${o1[d]}Radius`;let m=Tv(a,p),g=Tv(i,p);if(m===void 0&&g===void 0)continue;m||(m=0),g||(g=0),m===0||g===0||xv(m)===xv(g)?(n[p]=Math.max(ut(_v(m),_v(g),o),0),(Jn.test(g)||Jn.test(m))&&(n[p]+="%")):n[p]=g}(a.rotate||i.rotate)&&(n.rotate=ut(a.rotate||0,i.rotate||0,o))}function Tv(n,a){return n[a]!==void 0?n[a]:n.borderRadius}const y2=r1(0,.5,Eb),v2=r1(.5,.95,vn);function r1(n,a,i){return o=>o<n?0:o>a?1:i(Ri(n,a,o))}function Ev(n,a){n.min=a.min,n.max=a.max}function kn(n,a){Ev(n.x,a.x),Ev(n.y,a.y)}function Cv(n,a){n.translate=a.translate,n.scale=a.scale,n.originPoint=a.originPoint,n.origin=a.origin}function Av(n,a,i,o,r){return n-=a,n=qr(n,1/i,o),r!==void 0&&(n=qr(n,1/r,o)),n}function b2(n,a=0,i=1,o=.5,r,u=n,d=n){if(Jn.test(a)&&(a=parseFloat(a),a=ut(d.min,d.max,a/100)-d.min),typeof a!="number")return;let p=ut(u.min,u.max,o);n===u&&(p-=a),n.min=Av(n.min,a,i,p,r),n.max=Av(n.max,a,i,p,r)}function jv(n,a,[i,o,r],u,d){b2(n,a[i],a[o],a[r],a.scale,u,d)}const S2=["x","scaleX","originX"],_2=["y","scaleY","originY"];function Nv(n,a,i,o){jv(n.x,a,S2,i?i.x:void 0,o?o.x:void 0),jv(n.y,a,_2,i?i.y:void 0,o?o.y:void 0)}function wv(n){return n.translate===0&&n.scale===1}function c1(n){return wv(n.x)&&wv(n.y)}function Dv(n,a){return n.min===a.min&&n.max===a.max}function x2(n,a){return Dv(n.x,a.x)&&Dv(n.y,a.y)}function kv(n,a){return Math.round(n.min)===Math.round(a.min)&&Math.round(n.max)===Math.round(a.max)}function u1(n,a){return kv(n.x,a.x)&&kv(n.y,a.y)}function Mv(n){return bn(n.x)/bn(n.y)}function Rv(n,a){return n.translate===a.translate&&n.scale===a.scale&&n.originPoint===a.originPoint}class T2{constructor(){this.members=[]}add(a){Wf(this.members,a),a.scheduleRender()}remove(a){if(eh(this.members,a),a===this.prevLead&&(this.prevLead=void 0),a===this.lead){const i=this.members[this.members.length-1];i&&this.promote(i)}}relegate(a){const i=this.members.findIndex(r=>a===r);if(i===0)return!1;let o;for(let r=i;r>=0;r--){const u=this.members[r];if(u.isPresent!==!1){o=u;break}}return o?(this.promote(o),!0):!1}promote(a,i){const o=this.lead;if(a!==o&&(this.prevLead=o,this.lead=a,a.show(),o)){o.instance&&o.scheduleRender(),a.scheduleRender(),a.resumeFrom=o,i&&(a.resumeFrom.preserveOpacity=!0),o.snapshot&&(a.snapshot=o.snapshot,a.snapshot.latestValues=o.animationValues||o.latestValues),a.root&&a.root.isUpdating&&(a.isLayoutDirty=!0);const{crossfade:r}=a.options;r===!1&&o.hide()}}exitAnimationComplete(){this.members.forEach(a=>{const{options:i,resumingFrom:o}=a;i.onExitComplete&&i.onExitComplete(),o&&o.options.onExitComplete&&o.options.onExitComplete()})}scheduleRender(){this.members.forEach(a=>{a.instance&&a.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}function E2(n,a,i){let o="";const r=n.x.translate/a.x,u=n.y.translate/a.y,d=(i==null?void 0:i.z)||0;if((r||u||d)&&(o=`translate3d(${r}px, ${u}px, ${d}px) `),(a.x!==1||a.y!==1)&&(o+=`scale(${1/a.x}, ${1/a.y}) `),i){const{transformPerspective:g,rotate:y,rotateX:v,rotateY:_,skewX:T,skewY:C}=i;g&&(o=`perspective(${g}px) ${o}`),y&&(o+=`rotate(${y}deg) `),v&&(o+=`rotateX(${v}deg) `),_&&(o+=`rotateY(${_}deg) `),T&&(o+=`skewX(${T}deg) `),C&&(o+=`skewY(${C}deg) `)}const p=n.x.scale*a.x,m=n.y.scale*a.y;return(p!==1||m!==1)&&(o+=`scale(${p}, ${m})`),o||"none"}const ks={type:"projectionFrame",totalNodes:0,resolvedTargetDeltas:0,recalculatedProjection:0},Il=typeof window<"u"&&window.MotionDebug!==void 0,Ld=["","X","Y","Z"],C2={visibility:"hidden"},Ov=1e3;let A2=0;function Ud(n,a,i,o){const{latestValues:r}=a;r[n]&&(i[n]=r[n],a.setStaticValue(n,0),o&&(o[n]=0))}function d1(n){if(n.hasCheckedOptimisedAppear=!0,n.root===n)return;const{visualElement:a}=n.options;if(!a)return;const i=pb(a);if(window.MotionHasOptimisedAnimation(i,"transform")){const{layout:r,layoutId:u}=n.options;window.MotionCancelOptimisedAnimation(i,"transform",st,!(r||u))}const{parent:o}=n;o&&!o.hasCheckedOptimisedAppear&&d1(o)}function f1({attachResizeListener:n,defaultParent:a,measureScroll:i,checkIsScrollRoot:o,resetTransform:r}){return class{constructor(d={},p=a==null?void 0:a()){this.id=A2++,this.animationId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,Il&&(ks.totalNodes=ks.resolvedTargetDeltas=ks.recalculatedProjection=0),this.nodes.forEach(w2),this.nodes.forEach(O2),this.nodes.forEach(B2),this.nodes.forEach(D2),Il&&window.MotionDebug.record(ks)},this.resolvedRelativeTargetAt=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=d,this.root=p?p.root||p:this,this.path=p?[...p.path,p]:[],this.parent=p,this.depth=p?p.depth+1:0;for(let m=0;m<this.path.length;m++)this.path[m].shouldResetTransform=!0;this.root===this&&(this.nodes=new h2)}addEventListener(d,p){return this.eventHandlers.has(d)||this.eventHandlers.set(d,new th),this.eventHandlers.get(d).add(p)}notifyListeners(d,...p){const m=this.eventHandlers.get(d);m&&m.notify(...p)}hasListeners(d){return this.eventHandlers.has(d)}mount(d,p=this.root.hasTreeAnimated){if(this.instance)return;this.isSVG=d2(d),this.instance=d;const{layoutId:m,layout:g,visualElement:y}=this.options;if(y&&!y.current&&y.mount(d),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),p&&(g||m)&&(this.isLayoutDirty=!0),n){let v;const _=()=>this.root.updateBlockedByResize=!1;n(d,()=>{this.root.updateBlockedByResize=!0,v&&v(),v=p2(_,250),Lr.hasAnimatedSinceResize&&(Lr.hasAnimatedSinceResize=!1,this.nodes.forEach(Lv))})}m&&this.root.registerSharedNode(m,this),this.options.animate!==!1&&y&&(m||g)&&this.addEventListener("didUpdate",({delta:v,hasLayoutChanged:_,hasRelativeTargetChanged:T,layout:C})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const E=this.options.transition||y.getDefaultTransition()||V2,{onLayoutAnimationStart:j,onLayoutAnimationComplete:A}=y.getProps(),k=!this.targetLayout||!u1(this.targetLayout,C)||T,R=!_&&T;if(this.options.layoutRoot||this.resumeFrom&&this.resumeFrom.instance||R||_&&(k||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0),this.setAnimationOrigin(v,R);const $={...Jf(E,"layout"),onPlay:j,onComplete:A};(y.shouldReduceMotion||this.options.layoutRoot)&&($.delay=0,$.type=!1),this.startAnimation($)}else _||Lv(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=C})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const d=this.getStack();d&&d.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,ss(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEach(L2),this.animationId++)}getTransformTemplate(){const{visualElement:d}=this.options;return d&&d.getProps().transformTemplate}willUpdate(d=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&d1(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let y=0;y<this.path.length;y++){const v=this.path[y];v.shouldResetTransform=!0,v.updateScroll("snapshot"),v.options.layoutRoot&&v.willUpdate(!1)}const{layoutId:p,layout:m}=this.options;if(p===void 0&&!m)return;const g=this.getTransformTemplate();this.prevTransformTemplateValue=g?g(this.latestValues,""):void 0,this.updateSnapshot(),d&&this.notifyListeners("willUpdate")}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){this.unblockUpdate(),this.clearAllSnapshots(),this.nodes.forEach(Bv);return}this.isUpdating||this.nodes.forEach(M2),this.isUpdating=!1,this.nodes.forEach(R2),this.nodes.forEach(j2),this.nodes.forEach(N2),this.clearAllSnapshots();const p=Wn.now();Pt.delta=ja(0,1e3/60,p-Pt.timestamp),Pt.timestamp=p,Pt.isProcessing=!0,Nd.update.process(Pt),Nd.preRender.process(Pt),Nd.render.process(Pt),Pt.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,Pf.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(k2),this.sharedNodes.forEach(U2)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,st.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){st.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure())}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let m=0;m<this.path.length;m++)this.path[m].updateScroll();const d=this.layout;this.layout=this.measure(!1),this.layoutCorrected=xt(),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);const{visualElement:p}=this.options;p&&p.notify("LayoutMeasure",this.layout.layoutBox,d?d.layoutBox:void 0)}updateScroll(d="measure"){let p=!!(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===d&&(p=!1),p){const m=o(this.instance);this.scroll={animationId:this.root.animationId,phase:d,isRoot:m,offset:i(this.instance),wasRoot:this.scroll?this.scroll.isRoot:m}}}resetTransform(){if(!r)return;const d=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,p=this.projectionDelta&&!c1(this.projectionDelta),m=this.getTransformTemplate(),g=m?m(this.latestValues,""):void 0,y=g!==this.prevTransformTemplateValue;d&&(p||Ds(this.latestValues)||y)&&(r(this.instance,g),this.shouldResetTransform=!1,this.scheduleRender())}measure(d=!0){const p=this.measurePageBox();let m=this.removeElementScroll(p);return d&&(m=this.removeTransform(m)),H2(m),{animationId:this.root.animationId,measuredBox:p,layoutBox:m,latestValues:{},source:this.id}}measurePageBox(){var d;const{visualElement:p}=this.options;if(!p)return xt();const m=p.measureViewportBox();if(!(((d=this.scroll)===null||d===void 0?void 0:d.wasRoot)||this.path.some(P2))){const{scroll:y}=this.root;y&&(wi(m.x,y.offset.x),wi(m.y,y.offset.y))}return m}removeElementScroll(d){var p;const m=xt();if(kn(m,d),!((p=this.scroll)===null||p===void 0)&&p.wasRoot)return m;for(let g=0;g<this.path.length;g++){const y=this.path[g],{scroll:v,options:_}=y;y!==this.root&&v&&_.layoutScroll&&(v.wasRoot&&kn(m,d),wi(m.x,v.offset.x),wi(m.y,v.offset.y))}return m}applyTransform(d,p=!1){const m=xt();kn(m,d);for(let g=0;g<this.path.length;g++){const y=this.path[g];!p&&y.options.layoutScroll&&y.scroll&&y!==y.root&&Di(m,{x:-y.scroll.offset.x,y:-y.scroll.offset.y}),Ds(y.latestValues)&&Di(m,y.latestValues)}return Ds(this.latestValues)&&Di(m,this.latestValues),m}removeTransform(d){const p=xt();kn(p,d);for(let m=0;m<this.path.length;m++){const g=this.path[m];if(!g.instance||!Ds(g.latestValues))continue;ff(g.latestValues)&&g.updateSnapshot();const y=xt(),v=g.measurePageBox();kn(y,v),Nv(p,g.latestValues,g.snapshot?g.snapshot.layoutBox:void 0,y)}return Ds(this.latestValues)&&Nv(p,this.latestValues),p}setTargetDelta(d){this.targetDelta=d,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(d){this.options={...this.options,...d,crossfade:d.crossfade!==void 0?d.crossfade:!0}}clearMeasurements(){this.scroll=void 0,this.layout=void 0,this.snapshot=void 0,this.prevTransformTemplateValue=void 0,this.targetDelta=void 0,this.target=void 0,this.isLayoutDirty=!1}forceRelativeParentToResolveTarget(){this.relativeParent&&this.relativeParent.resolvedRelativeTargetAt!==Pt.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(d=!1){var p;const m=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=m.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=m.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=m.isSharedProjectionDirty);const g=!!this.resumingFrom||this!==m;if(!(d||g&&this.isSharedProjectionDirty||this.isProjectionDirty||!((p=this.parent)===null||p===void 0)&&p.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;const{layout:v,layoutId:_}=this.options;if(!(!this.layout||!(v||_))){if(this.resolvedRelativeTargetAt=Pt.timestamp,!this.targetDelta&&!this.relativeTarget){const T=this.getClosestProjectingParent();T&&T.layout&&this.animationProgress!==1?(this.relativeParent=T,this.forceRelativeParentToResolveTarget(),this.relativeTarget=xt(),this.relativeTargetOrigin=xt(),Fl(this.relativeTargetOrigin,this.layout.layoutBox,T.layout.layoutBox),kn(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}if(!(!this.relativeTarget&&!this.targetDelta)){if(this.target||(this.target=xt(),this.targetWithTransforms=xt()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),Fj(this.target,this.relativeTarget,this.relativeParent.target)):this.targetDelta?(this.resumingFrom?this.target=this.applyTransform(this.layout.layoutBox):kn(this.target,this.layout.layoutBox),a1(this.target,this.targetDelta)):kn(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget){this.attemptToResolveRelativeTarget=!1;const T=this.getClosestProjectingParent();T&&!!T.resumingFrom==!!this.resumingFrom&&!T.options.layoutScroll&&T.target&&this.animationProgress!==1?(this.relativeParent=T,this.forceRelativeParentToResolveTarget(),this.relativeTarget=xt(),this.relativeTargetOrigin=xt(),Fl(this.relativeTargetOrigin,this.target,T.target),kn(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}Il&&ks.resolvedTargetDeltas++}}}getClosestProjectingParent(){if(!(!this.parent||ff(this.parent.latestValues)||n1(this.parent.latestValues)))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return!!((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}calcProjection(){var d;const p=this.getLead(),m=!!this.resumingFrom||this!==p;let g=!0;if((this.isProjectionDirty||!((d=this.parent)===null||d===void 0)&&d.isProjectionDirty)&&(g=!1),m&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(g=!1),this.resolvedRelativeTargetAt===Pt.timestamp&&(g=!1),g)return;const{layout:y,layoutId:v}=this.options;if(this.isTreeAnimating=!!(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(y||v))return;kn(this.layoutCorrected,this.layout.layoutBox);const _=this.treeScale.x,T=this.treeScale.y;e2(this.layoutCorrected,this.treeScale,this.path,m),p.layout&&!p.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(p.target=p.layout.layoutBox,p.targetWithTransforms=xt());const{target:C}=p;if(!C){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(Cv(this.prevProjectionDelta.x,this.projectionDelta.x),Cv(this.prevProjectionDelta.y,this.projectionDelta.y)),ql(this.projectionDelta,this.layoutCorrected,C,this.latestValues),(this.treeScale.x!==_||this.treeScale.y!==T||!Rv(this.projectionDelta.x,this.prevProjectionDelta.x)||!Rv(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",C)),Il&&ks.recalculatedProjection++}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(d=!0){var p;if((p=this.options.visualElement)===null||p===void 0||p.scheduleRender(),d){const m=this.getStack();m&&m.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=Ni(),this.projectionDelta=Ni(),this.projectionDeltaWithTransform=Ni()}setAnimationOrigin(d,p=!1){const m=this.snapshot,g=m?m.latestValues:{},y={...this.latestValues},v=Ni();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!p;const _=xt(),T=m?m.source:void 0,C=this.layout?this.layout.source:void 0,E=T!==C,j=this.getStack(),A=!j||j.members.length<=1,k=!!(E&&!A&&this.options.crossfade===!0&&!this.path.some(I2));this.animationProgress=0;let R;this.mixTargetDelta=$=>{const H=$/1e3;Uv(v.x,d.x,H),Uv(v.y,d.y,H),this.setTargetDelta(v),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(Fl(_,this.layout.layoutBox,this.relativeParent.layout.layoutBox),z2(this.relativeTarget,this.relativeTargetOrigin,_,H),R&&x2(this.relativeTarget,R)&&(this.isProjectionDirty=!1),R||(R=xt()),kn(R,this.relativeTarget)),E&&(this.animationValues=y,g2(y,g,this.latestValues,H,k,A)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=H},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(d){this.notifyListeners("animationStart"),this.currentAnimation&&this.currentAnimation.stop(),this.resumingFrom&&this.resumingFrom.currentAnimation&&this.resumingFrom.currentAnimation.stop(),this.pendingAnimation&&(ss(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=st.update(()=>{Lr.hasAnimatedSinceResize=!0,this.currentAnimation=u2(0,Ov,{...d,onUpdate:p=>{this.mixTargetDelta(p),d.onUpdate&&d.onUpdate(p)},onComplete:()=>{d.onComplete&&d.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);const d=this.getStack();d&&d.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(Ov),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const d=this.getLead();let{targetWithTransforms:p,target:m,layout:g,latestValues:y}=d;if(!(!p||!m||!g)){if(this!==d&&this.layout&&g&&h1(this.options.animationType,this.layout.layoutBox,g.layoutBox)){m=this.target||xt();const v=bn(this.layout.layoutBox.x);m.x.min=d.target.x.min,m.x.max=m.x.min+v;const _=bn(this.layout.layoutBox.y);m.y.min=d.target.y.min,m.y.max=m.y.min+_}kn(p,m),Di(p,y),ql(this.projectionDeltaWithTransform,this.layoutCorrected,p,y)}}registerSharedNode(d,p){this.sharedNodes.has(d)||this.sharedNodes.set(d,new T2),this.sharedNodes.get(d).add(p);const g=p.options.initialPromotionConfig;p.promote({transition:g?g.transition:void 0,preserveFollowOpacity:g&&g.shouldPreserveFollowOpacity?g.shouldPreserveFollowOpacity(p):void 0})}isLead(){const d=this.getStack();return d?d.lead===this:!0}getLead(){var d;const{layoutId:p}=this.options;return p?((d=this.getStack())===null||d===void 0?void 0:d.lead)||this:this}getPrevLead(){var d;const{layoutId:p}=this.options;return p?(d=this.getStack())===null||d===void 0?void 0:d.prevLead:void 0}getStack(){const{layoutId:d}=this.options;if(d)return this.root.sharedNodes.get(d)}promote({needsReset:d,transition:p,preserveFollowOpacity:m}={}){const g=this.getStack();g&&g.promote(this,m),d&&(this.projectionDelta=void 0,this.needsReset=!0),p&&this.setOptions({transition:p})}relegate(){const d=this.getStack();return d?d.relegate(this):!1}resetSkewAndRotation(){const{visualElement:d}=this.options;if(!d)return;let p=!1;const{latestValues:m}=d;if((m.z||m.rotate||m.rotateX||m.rotateY||m.rotateZ||m.skewX||m.skewY)&&(p=!0),!p)return;const g={};m.z&&Ud("z",d,g,this.animationValues);for(let y=0;y<Ld.length;y++)Ud(`rotate${Ld[y]}`,d,g,this.animationValues),Ud(`skew${Ld[y]}`,d,g,this.animationValues);d.render();for(const y in g)d.setStaticValue(y,g[y]),this.animationValues&&(this.animationValues[y]=g[y]);d.scheduleRender()}getProjectionStyles(d){var p,m;if(!this.instance||this.isSVG)return;if(!this.isVisible)return C2;const g={visibility:""},y=this.getTransformTemplate();if(this.needsReset)return this.needsReset=!1,g.opacity="",g.pointerEvents=Or(d==null?void 0:d.pointerEvents)||"",g.transform=y?y(this.latestValues,""):"none",g;const v=this.getLead();if(!this.projectionDelta||!this.layout||!v.target){const E={};return this.options.layoutId&&(E.opacity=this.latestValues.opacity!==void 0?this.latestValues.opacity:1,E.pointerEvents=Or(d==null?void 0:d.pointerEvents)||""),this.hasProjected&&!Ds(this.latestValues)&&(E.transform=y?y({},""):"none",this.hasProjected=!1),E}const _=v.animationValues||v.latestValues;this.applyTransformsToTarget(),g.transform=E2(this.projectionDeltaWithTransform,this.treeScale,_),y&&(g.transform=y(_,g.transform));const{x:T,y:C}=this.projectionDelta;g.transformOrigin=`${T.origin*100}% ${C.origin*100}% 0`,v.animationValues?g.opacity=v===this?(m=(p=_.opacity)!==null&&p!==void 0?p:this.latestValues.opacity)!==null&&m!==void 0?m:1:this.preserveOpacity?this.latestValues.opacity:_.opacityExit:g.opacity=v===this?_.opacity!==void 0?_.opacity:"":_.opacityExit!==void 0?_.opacityExit:0;for(const E in Ir){if(_[E]===void 0)continue;const{correct:j,applyTo:A}=Ir[E],k=g.transform==="none"?_[E]:j(_[E],v);if(A){const R=A.length;for(let $=0;$<R;$++)g[A[$]]=k}else g[E]=k}return this.options.layoutId&&(g.pointerEvents=v===this?Or(d==null?void 0:d.pointerEvents)||"":"none"),g}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(d=>{var p;return(p=d.currentAnimation)===null||p===void 0?void 0:p.stop()}),this.root.nodes.forEach(Bv),this.root.sharedNodes.clear()}}}function j2(n){n.updateLayout()}function N2(n){var a;const i=((a=n.resumeFrom)===null||a===void 0?void 0:a.snapshot)||n.snapshot;if(n.isLead()&&n.layout&&i&&n.hasListeners("didUpdate")){const{layoutBox:o,measuredBox:r}=n.layout,{animationType:u}=n.options,d=i.source!==n.layout.source;u==="size"?Mn(v=>{const _=d?i.measuredBox[v]:i.layoutBox[v],T=bn(_);_.min=o[v].min,_.max=_.min+T}):h1(u,i.layoutBox,o)&&Mn(v=>{const _=d?i.measuredBox[v]:i.layoutBox[v],T=bn(o[v]);_.max=_.min+T,n.relativeTarget&&!n.currentAnimation&&(n.isProjectionDirty=!0,n.relativeTarget[v].max=n.relativeTarget[v].min+T)});const p=Ni();ql(p,o,i.layoutBox);const m=Ni();d?ql(m,n.applyTransform(r,!0),i.measuredBox):ql(m,o,i.layoutBox);const g=!c1(p);let y=!1;if(!n.resumeFrom){const v=n.getClosestProjectingParent();if(v&&!v.resumeFrom){const{snapshot:_,layout:T}=v;if(_&&T){const C=xt();Fl(C,i.layoutBox,_.layoutBox);const E=xt();Fl(E,o,T.layoutBox),u1(C,E)||(y=!0),v.options.layoutRoot&&(n.relativeTarget=E,n.relativeTargetOrigin=C,n.relativeParent=v)}}}n.notifyListeners("didUpdate",{layout:o,snapshot:i,delta:m,layoutDelta:p,hasLayoutChanged:g,hasRelativeTargetChanged:y})}else if(n.isLead()){const{onExitComplete:o}=n.options;o&&o()}n.options.transition=void 0}function w2(n){Il&&ks.totalNodes++,n.parent&&(n.isProjecting()||(n.isProjectionDirty=n.parent.isProjectionDirty),n.isSharedProjectionDirty||(n.isSharedProjectionDirty=!!(n.isProjectionDirty||n.parent.isProjectionDirty||n.parent.isSharedProjectionDirty)),n.isTransformDirty||(n.isTransformDirty=n.parent.isTransformDirty))}function D2(n){n.isProjectionDirty=n.isSharedProjectionDirty=n.isTransformDirty=!1}function k2(n){n.clearSnapshot()}function Bv(n){n.clearMeasurements()}function M2(n){n.isLayoutDirty=!1}function R2(n){const{visualElement:a}=n.options;a&&a.getProps().onBeforeLayoutMeasure&&a.notify("BeforeLayoutMeasure"),n.resetTransform()}function Lv(n){n.finishAnimation(),n.targetDelta=n.relativeTarget=n.target=void 0,n.isProjectionDirty=!0}function O2(n){n.resolveTargetDelta()}function B2(n){n.calcProjection()}function L2(n){n.resetSkewAndRotation()}function U2(n){n.removeLeadSnapshot()}function Uv(n,a,i){n.translate=ut(a.translate,0,i),n.scale=ut(a.scale,1,i),n.origin=a.origin,n.originPoint=a.originPoint}function zv(n,a,i,o){n.min=ut(a.min,i.min,o),n.max=ut(a.max,i.max,o)}function z2(n,a,i,o){zv(n.x,a.x,i.x,o),zv(n.y,a.y,i.y,o)}function I2(n){return n.animationValues&&n.animationValues.opacityExit!==void 0}const V2={duration:.45,ease:[.4,0,.1,1]},Iv=n=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(n),Vv=Iv("applewebkit/")&&!Iv("chrome/")?Math.round:vn;function Hv(n){n.min=Vv(n.min),n.max=Vv(n.max)}function H2(n){Hv(n.x),Hv(n.y)}function h1(n,a,i){return n==="position"||n==="preserve-aspect"&&!qj(Mv(a),Mv(i),.2)}function P2(n){var a;return n!==n.root&&((a=n.scroll)===null||a===void 0?void 0:a.wasRoot)}const G2=f1({attachResizeListener:(n,a)=>eo(n,"resize",a),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),zd={current:void 0},p1=f1({measureScroll:n=>({x:n.scrollLeft,y:n.scrollTop}),defaultParent:()=>{if(!zd.current){const n=new G2({});n.mount(window),n.setOptions({layoutScroll:!0}),zd.current=n}return zd.current},resetTransform:(n,a)=>{n.style.transform=a!==void 0?a:"none"},checkIsScrollRoot:n=>window.getComputedStyle(n).position==="fixed"}),q2={pan:{Feature:l2},drag:{Feature:i2,ProjectionNode:p1,MeasureLayout:l1}};function F2(n,a,i){var o;if(n instanceof Element)return[n];if(typeof n=="string"){let r=document;const u=(o=void 0)!==null&&o!==void 0?o:r.querySelectorAll(n);return u?Array.from(u):[]}return Array.from(n)}function m1(n,a){const i=F2(n),o=new AbortController,r={passive:!0,...a,signal:o.signal};return[i,r,()=>o.abort()]}function Pv(n){return a=>{a.pointerType==="touch"||Xb()||n(a)}}function $2(n,a,i={}){const[o,r,u]=m1(n,i),d=Pv(p=>{const{target:m}=p,g=a(p);if(typeof g!="function"||!m)return;const y=Pv(v=>{g(v),m.removeEventListener("pointerleave",y)});m.addEventListener("pointerleave",y,r)});return o.forEach(p=>{p.addEventListener("pointerenter",d,r)}),u}function Gv(n,a,i){const{props:o}=n;n.animationState&&o.whileHover&&n.animationState.setActive("whileHover",i==="Start");const r="onHover"+i,u=o[r];u&&st.postRender(()=>u(a,oo(a)))}class Y2 extends rs{mount(){const{current:a}=this.node;a&&(this.unmount=$2(a,i=>(Gv(this.node,i,"Start"),o=>Gv(this.node,o,"End"))))}unmount(){}}class K2 extends rs{constructor(){super(...arguments),this.isActive=!1}onFocus(){let a=!1;try{a=this.node.current.matches(":focus-visible")}catch{a=!0}!a||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){!this.isActive||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=lo(eo(this.node.current,"focus",()=>this.onFocus()),eo(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}const g1=(n,a)=>a?n===a?!0:g1(n,a.parentElement):!1,Z2=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function X2(n){return Z2.has(n.tagName)||n.tabIndex!==-1}const Vl=new WeakSet;function qv(n){return a=>{a.key==="Enter"&&n(a)}}function Id(n,a){n.dispatchEvent(new PointerEvent("pointer"+a,{isPrimary:!0,bubbles:!0}))}const Q2=(n,a)=>{const i=n.currentTarget;if(!i)return;const o=qv(()=>{if(Vl.has(i))return;Id(i,"down");const r=qv(()=>{Id(i,"up")}),u=()=>Id(i,"cancel");i.addEventListener("keyup",r,a),i.addEventListener("blur",u,a)});i.addEventListener("keydown",o,a),i.addEventListener("blur",()=>i.removeEventListener("keydown",o),a)};function Fv(n){return ph(n)&&!Xb()}function J2(n,a,i={}){const[o,r,u]=m1(n,i),d=p=>{const m=p.currentTarget;if(!Fv(p)||Vl.has(m))return;Vl.add(m);const g=a(p),y=(T,C)=>{window.removeEventListener("pointerup",v),window.removeEventListener("pointercancel",_),!(!Fv(T)||!Vl.has(m))&&(Vl.delete(m),typeof g=="function"&&g(T,{success:C}))},v=T=>{y(T,i.useGlobalTarget||g1(m,T.target))},_=T=>{y(T,!1)};window.addEventListener("pointerup",v,r),window.addEventListener("pointercancel",_,r)};return o.forEach(p=>{!X2(p)&&p.getAttribute("tabindex")===null&&(p.tabIndex=0),(i.useGlobalTarget?window:p).addEventListener("pointerdown",d,r),p.addEventListener("focus",g=>Q2(g,r),r)}),u}function $v(n,a,i){const{props:o}=n;n.animationState&&o.whileTap&&n.animationState.setActive("whileTap",i==="Start");const r="onTap"+(i==="End"?"":i),u=o[r];u&&st.postRender(()=>u(a,oo(a)))}class W2 extends rs{mount(){const{current:a}=this.node;a&&(this.unmount=J2(a,i=>($v(this.node,i,"Start"),(o,{success:r})=>$v(this.node,o,r?"End":"Cancel")),{useGlobalTarget:this.node.props.globalTapTarget}))}unmount(){}}const pf=new WeakMap,Vd=new WeakMap,eN=n=>{const a=pf.get(n.target);a&&a(n)},tN=n=>{n.forEach(eN)};function nN({root:n,...a}){const i=n||document;Vd.has(i)||Vd.set(i,{});const o=Vd.get(i),r=JSON.stringify(a);return o[r]||(o[r]=new IntersectionObserver(tN,{root:n,...a})),o[r]}function aN(n,a,i){const o=nN(a);return pf.set(n,i),o.observe(n),()=>{pf.delete(n),o.unobserve(n)}}const sN={some:0,all:1};class iN extends rs{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:a={}}=this.node.getProps(),{root:i,margin:o,amount:r="some",once:u}=a,d={root:i?i.current:void 0,rootMargin:o,threshold:typeof r=="number"?r:sN[r]},p=m=>{const{isIntersecting:g}=m;if(this.isInView===g||(this.isInView=g,u&&!g&&this.hasEnteredView))return;g&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",g);const{onViewportEnter:y,onViewportLeave:v}=this.node.getProps(),_=g?y:v;_&&_(m)};return aN(this.node.current,d,p)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:a,prevProps:i}=this.node;["amount","margin","root"].some(lN(a,i))&&this.startObserver()}unmount(){}}function lN({viewport:n={}},{viewport:a={}}={}){return i=>n[i]!==a[i]}const oN={inView:{Feature:iN},tap:{Feature:W2},focus:{Feature:K2},hover:{Feature:Y2}},rN={layout:{ProjectionNode:p1,MeasureLayout:l1}},mf={current:null},y1={current:!1};function cN(){if(y1.current=!0,!!zf)if(window.matchMedia){const n=window.matchMedia("(prefers-reduced-motion)"),a=()=>mf.current=n.matches;n.addListener(a),a()}else mf.current=!1}const uN=[...zb,$t,is],dN=n=>uN.find(Ub(n)),Yv=new WeakMap;function fN(n,a,i){for(const o in a){const r=a[o],u=i[o];if(Yt(r))n.addValue(o,r);else if(Yt(u))n.addValue(o,Jl(r,{owner:n}));else if(u!==r)if(n.hasValue(o)){const d=n.getValue(o);d.liveStyle===!0?d.jump(r):d.hasAnimated||d.set(r)}else{const d=n.getStaticValue(o);n.addValue(o,Jl(d!==void 0?d:r,{owner:n}))}}for(const o in i)a[o]===void 0&&n.removeValue(o);return a}const Kv=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];class hN{scrapeMotionValuesFromProps(a,i,o){return{}}constructor({parent:a,props:i,presenceContext:o,reducedMotionConfig:r,blockInitialAnimation:u,visualState:d},p={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.KeyframeResolver=uh,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{const T=Wn.now();this.renderScheduledAt<T&&(this.renderScheduledAt=T,st.render(this.render,!1,!0))};const{latestValues:m,renderState:g,onUpdate:y}=d;this.onUpdate=y,this.latestValues=m,this.baseTarget={...m},this.initialValues=i.initial?{...m}:{},this.renderState=g,this.parent=a,this.props=i,this.presenceContext=o,this.depth=a?a.depth+1:0,this.reducedMotionConfig=r,this.options=p,this.blockInitialAnimation=!!u,this.isControllingVariants=ac(i),this.isVariantNode=X0(i),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(a&&a.current);const{willChange:v,..._}=this.scrapeMotionValuesFromProps(i,{},this);for(const T in _){const C=_[T];m[T]!==void 0&&Yt(C)&&C.set(m[T],!1)}}mount(a){this.current=a,Yv.set(a,this),this.projection&&!this.projection.instance&&this.projection.mount(a),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((i,o)=>this.bindToMotionValue(o,i)),y1.current||cN(),this.shouldReduceMotion=this.reducedMotionConfig==="never"?!1:this.reducedMotionConfig==="always"?!0:mf.current,this.parent&&this.parent.children.add(this),this.update(this.props,this.presenceContext)}unmount(){Yv.delete(this.current),this.projection&&this.projection.unmount(),ss(this.notifyUpdate),ss(this.render),this.valueSubscriptions.forEach(a=>a()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent&&this.parent.children.delete(this);for(const a in this.events)this.events[a].clear();for(const a in this.features){const i=this.features[a];i&&(i.unmount(),i.isMounted=!1)}this.current=null}bindToMotionValue(a,i){this.valueSubscriptions.has(a)&&this.valueSubscriptions.get(a)();const o=zs.has(a),r=i.on("change",p=>{this.latestValues[a]=p,this.props.onUpdate&&st.preRender(this.notifyUpdate),o&&this.projection&&(this.projection.isTransformDirty=!0)}),u=i.on("renderRequest",this.scheduleRender);let d;window.MotionCheckAppearSync&&(d=window.MotionCheckAppearSync(this,a,i)),this.valueSubscriptions.set(a,()=>{r(),u(),d&&d(),i.owner&&i.stop()})}sortNodePosition(a){return!this.current||!this.sortInstanceNodePosition||this.type!==a.type?0:this.sortInstanceNodePosition(this.current,a.current)}updateFeatures(){let a="animation";for(a in Mi){const i=Mi[a];if(!i)continue;const{isEnabled:o,Feature:r}=i;if(!this.features[a]&&r&&o(this.props)&&(this.features[a]=new r(this)),this.features[a]){const u=this.features[a];u.isMounted?u.update():(u.mount(),u.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):xt()}getStaticValue(a){return this.latestValues[a]}setStaticValue(a,i){this.latestValues[a]=i}update(a,i){(a.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=a,this.prevPresenceContext=this.presenceContext,this.presenceContext=i;for(let o=0;o<Kv.length;o++){const r=Kv[o];this.propEventSubscriptions[r]&&(this.propEventSubscriptions[r](),delete this.propEventSubscriptions[r]);const u="on"+r,d=a[u];d&&(this.propEventSubscriptions[r]=this.on(r,d))}this.prevMotionValues=fN(this,this.scrapeMotionValuesFromProps(a,this.prevProps,this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue(),this.onUpdate&&this.onUpdate(this)}getProps(){return this.props}getVariant(a){return this.props.variants?this.props.variants[a]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}addVariantChild(a){const i=this.getClosestVariantNode();if(i)return i.variantChildren&&i.variantChildren.add(a),()=>i.variantChildren.delete(a)}addValue(a,i){const o=this.values.get(a);i!==o&&(o&&this.removeValue(a),this.bindToMotionValue(a,i),this.values.set(a,i),this.latestValues[a]=i.get())}removeValue(a){this.values.delete(a);const i=this.valueSubscriptions.get(a);i&&(i(),this.valueSubscriptions.delete(a)),delete this.latestValues[a],this.removeValueFromRenderState(a,this.renderState)}hasValue(a){return this.values.has(a)}getValue(a,i){if(this.props.values&&this.props.values[a])return this.props.values[a];let o=this.values.get(a);return o===void 0&&i!==void 0&&(o=Jl(i===null?void 0:i,{owner:this}),this.addValue(a,o)),o}readValue(a,i){var o;let r=this.latestValues[a]!==void 0||!this.current?this.latestValues[a]:(o=this.getBaseTargetFromProps(this.props,a))!==null&&o!==void 0?o:this.readValueFromInstance(this.current,a,this.options);return r!=null&&(typeof r=="string"&&(Bb(r)||Ab(r))?r=parseFloat(r):!dN(r)&&is.test(i)&&(r=Mb(a,i)),this.setBaseTarget(a,Yt(r)?r.get():r)),Yt(r)?r.get():r}setBaseTarget(a,i){this.baseTarget[a]=i}getBaseTarget(a){var i;const{initial:o}=this.props;let r;if(typeof o=="string"||typeof o=="object"){const d=qf(this.props,o,(i=this.presenceContext)===null||i===void 0?void 0:i.custom);d&&(r=d[a])}if(o&&r!==void 0)return r;const u=this.getBaseTargetFromProps(this.props,a);return u!==void 0&&!Yt(u)?u:this.initialValues[a]!==void 0&&r===void 0?void 0:this.baseTarget[a]}on(a,i){return this.events[a]||(this.events[a]=new th),this.events[a].add(i)}notify(a,...i){this.events[a]&&this.events[a].notify(...i)}}class v1 extends hN{constructor(){super(...arguments),this.KeyframeResolver=Ib}sortInstanceNodePosition(a,i){return a.compareDocumentPosition(i)&2?1:-1}getBaseTargetFromProps(a,i){return a.style?a.style[i]:void 0}removeValueFromRenderState(a,{vars:i,style:o}){delete i[a],delete o[a]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:a}=this.props;Yt(a)&&(this.childSubscription=a.on("change",i=>{this.current&&(this.current.textContent=`${i}`)}))}}function pN(n){return window.getComputedStyle(n)}class mN extends v1{constructor(){super(...arguments),this.type="html",this.renderInstance=ib}readValueFromInstance(a,i){if(zs.has(i)){const o=ch(i);return o&&o.default||0}else{const o=pN(a),r=(nb(i)?o.getPropertyValue(i):o[i])||0;return typeof r=="string"?r.trim():r}}measureInstanceViewportBox(a,{transformPagePoint:i}){return s1(a,i)}build(a,i,o){Yf(a,i,o.transformTemplate)}scrapeMotionValuesFromProps(a,i,o){return Qf(a,i,o)}}class gN extends v1{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=xt}getBaseTargetFromProps(a,i){return a[i]}readValueFromInstance(a,i){if(zs.has(i)){const o=ch(i);return o&&o.default||0}return i=lb.has(i)?i:Hf(i),a.getAttribute(i)}scrapeMotionValuesFromProps(a,i,o){return cb(a,i,o)}build(a,i,o){Kf(a,i,this.isSVGTag,o.transformTemplate)}renderInstance(a,i,o,r){ob(a,i,o,r)}mount(a){this.isSVGTag=Xf(a.tagName),super.mount(a)}}const yN=(n,a)=>Gf(n)?new gN(a):new mN(a,{allowProjection:n!==S.Fragment}),vN=GC({...Oj,...oN,...q2,...rN},yN),Rn=sC(vN);var pt;(function(n){n[n.UNSPECIFIED=0]="UNSPECIFIED",n[n.TEXT=1]="TEXT",n[n.TOOL_USE=2]="TOOL_USE",n[n.TOOL_RESULT=3]="TOOL_RESULT",n[n.ERROR=4]="ERROR",n[n.STATUS=5]="STATUS",n[n.SYSTEM=6]="SYSTEM",n[n.FINDING=7]="FINDING",n[n.SUBTASK_CREATE=8]="SUBTASK_CREATE",n[n.USER_INPUT=9]="USER_INPUT"})(pt||(pt={}));var Nt;(function(n){n[n.UNSPECIFIED=0]="UNSPECIFIED",n[n.NOT_STARTED=1]="NOT_STARTED",n[n.WORKING=3]="WORKING",n[n.PAUSED=4]="PAUSED",n[n.COMPLETE=5]="COMPLETE",n[n.FAILED=6]="FAILED"})(Nt||(Nt={}));var es;(function(n){n[n.UNSPECIFIED=0]="UNSPECIFIED",n[n.ACTIVE=1]="ACTIVE",n[n.ARCHIVED=2]="ARCHIVED"})(es||(es={}));var ts;(function(n){n[n.UNSPECIFIED=0]="UNSPECIFIED",n[n.OPEN=1]="OPEN",n[n.CLOSED=2]="CLOSED"})(ts||(ts={}));var Kn;(function(n){n[n.UNSPECIFIED=0]="UNSPECIFIED",n[n.OFF=1]="OFF",n[n.SUBSCRIPTION=2]="SUBSCRIPTION",n[n.API_KEY=3]="API_KEY"})(Kn||(Kn={}));var ns;(function(n){n[n.UNSPECIFIED=0]="UNSPECIFIED",n[n.OFF=1]="OFF",n[n.ON=2]="ON"})(ns||(ns={}));const bN=8;Object.assign(Object.create(null),{"":pt.UNSPECIFIED,text:pt.TEXT,tool_use:pt.TOOL_USE,tool_result:pt.TOOL_RESULT,error:pt.ERROR,status:pt.STATUS,system:pt.SYSTEM,finding:pt.FINDING,subtask_create:pt.SUBTASK_CREATE,user_input:pt.USER_INPUT});pt.UNSPECIFIED+"",pt.TEXT+"",pt.TOOL_USE+"",pt.TOOL_RESULT+"",pt.ERROR+"",pt.STATUS+"",pt.SYSTEM+"",pt.FINDING+"",pt.SUBTASK_CREATE+"",pt.USER_INPUT+"";Object.assign(Object.create(null),{"":Nt.UNSPECIFIED,not_started:Nt.NOT_STARTED,working:Nt.WORKING,paused:Nt.PAUSED,complete:Nt.COMPLETE,failed:Nt.FAILED,pending:Nt.NOT_STARTED,assigned:Nt.NOT_STARTED,in_progress:Nt.WORKING,waiting_input:Nt.PAUSED,review:Nt.PAUSED,done:Nt.COMPLETE});Nt.UNSPECIFIED+"",Nt.NOT_STARTED+"",Nt.WORKING+"",Nt.PAUSED+"",Nt.COMPLETE+"",Nt.FAILED+"";Object.assign(Object.create(null),{"":es.UNSPECIFIED,active:es.ACTIVE,archived:es.ARCHIVED});es.UNSPECIFIED+"",es.ACTIVE+"",es.ARCHIVED+"";Object.assign(Object.create(null),{"":ts.UNSPECIFIED,open:ts.OPEN,closed:ts.CLOSED});ts.UNSPECIFIED+"",ts.OPEN+"",ts.CLOSED+"";Object.assign(Object.create(null),{"":Kn.UNSPECIFIED,off:Kn.OFF,subscription:Kn.SUBSCRIPTION,api_key:Kn.API_KEY});Kn.UNSPECIFIED+"",Kn.OFF+"",Kn.SUBSCRIPTION+"",Kn.API_KEY+"";Object.assign(Object.create(null),{"":ns.UNSPECIFIED,off:ns.OFF,on:ns.ON});ns.UNSPECIFIED+"",ns.OFF+"",ns.ON+"";function Na(n){return Array.isArray?Array.isArray(n):_1(n)==="[object Array]"}function SN(n){if(typeof n=="string")return n;let a=n+"";return a=="0"&&1/n==-1/0?"-0":a}function _N(n){return n==null?"":SN(n)}function Zn(n){return typeof n=="string"}function b1(n){return typeof n=="number"}function xN(n){return n===!0||n===!1||TN(n)&&_1(n)=="[object Boolean]"}function S1(n){return typeof n=="object"}function TN(n){return S1(n)&&n!==null}function yn(n){return n!=null}function Hd(n){return!n.trim().length}function _1(n){return n==null?n===void 0?"[object Undefined]":"[object Null]":Object.prototype.toString.call(n)}const EN="Incorrect 'index' type",CN=n=>`Invalid value for key ${n}`,AN=n=>`Pattern length exceeds max of ${n}.`,jN=n=>`Missing ${n} property in key`,NN=n=>`Property 'weight' in key '${n}' must be a positive integer`,Zv=Object.prototype.hasOwnProperty;class wN{constructor(a){this._keys=[],this._keyMap={};let i=0;a.forEach(o=>{let r=x1(o);this._keys.push(r),this._keyMap[r.id]=r,i+=r.weight}),this._keys.forEach(o=>{o.weight/=i})}get(a){return this._keyMap[a]}keys(){return this._keys}toJSON(){return JSON.stringify(this._keys)}}function x1(n){let a=null,i=null,o=null,r=1,u=null;if(Zn(n)||Na(n))o=n,a=Xv(n),i=gf(n);else{if(!Zv.call(n,"name"))throw new Error(jN("name"));const d=n.name;if(o=d,Zv.call(n,"weight")&&(r=n.weight,r<=0))throw new Error(NN(d));a=Xv(d),i=gf(d),u=n.getFn}return{path:a,id:i,weight:r,src:o,getFn:u}}function Xv(n){return Na(n)?n:n.split(".")}function gf(n){return Na(n)?n.join("."):n}function DN(n,a){let i=[],o=!1;const r=(u,d,p)=>{if(yn(u))if(!d[p])i.push(u);else{let m=d[p];const g=u[m];if(!yn(g))return;if(p===d.length-1&&(Zn(g)||b1(g)||xN(g)))i.push(_N(g));else if(Na(g)){o=!0;for(let y=0,v=g.length;y<v;y+=1)r(g[y],d,p+1)}else d.length&&r(g,d,p+1)}};return r(n,Zn(a)?a.split("."):a,0),o?i:i[0]}const kN={includeMatches:!1,findAllMatches:!1,minMatchCharLength:1},MN={isCaseSensitive:!1,ignoreDiacritics:!1,includeScore:!1,keys:[],shouldSort:!0,sortFn:(n,a)=>n.score===a.score?n.idx<a.idx?-1:1:n.score<a.score?-1:1},RN={location:0,threshold:.6,distance:100},ON={useExtendedSearch:!1,getFn:DN,ignoreLocation:!1,ignoreFieldNorm:!1,fieldNormWeight:1};var ve={...MN,...kN,...RN,...ON};const BN=/[^ ]+/g;function LN(n=1,a=3){const i=new Map,o=Math.pow(10,a);return{get(r){const u=r.match(BN).length;if(i.has(u))return i.get(u);const d=1/Math.pow(u,.5*n),p=parseFloat(Math.round(d*o)/o);return i.set(u,p),p},clear(){i.clear()}}}class mh{constructor({getFn:a=ve.getFn,fieldNormWeight:i=ve.fieldNormWeight}={}){this.norm=LN(i,3),this.getFn=a,this.isCreated=!1,this.setIndexRecords()}setSources(a=[]){this.docs=a}setIndexRecords(a=[]){this.records=a}setKeys(a=[]){this.keys=a,this._keysMap={},a.forEach((i,o)=>{this._keysMap[i.id]=o})}create(){this.isCreated||!this.docs.length||(this.isCreated=!0,Zn(this.docs[0])?this.docs.forEach((a,i)=>{this._addString(a,i)}):this.docs.forEach((a,i)=>{this._addObject(a,i)}),this.norm.clear())}add(a){const i=this.size();Zn(a)?this._addString(a,i):this._addObject(a,i)}removeAt(a){this.records.splice(a,1);for(let i=a,o=this.size();i<o;i+=1)this.records[i].i-=1}getValueForItemAtKeyId(a,i){return a[this._keysMap[i]]}size(){return this.records.length}_addString(a,i){if(!yn(a)||Hd(a))return;let o={v:a,i,n:this.norm.get(a)};this.records.push(o)}_addObject(a,i){let o={i,$:{}};this.keys.forEach((r,u)=>{let d=r.getFn?r.getFn(a):this.getFn(a,r.path);if(yn(d)){if(Na(d)){let p=[];const m=[{nestedArrIndex:-1,value:d}];for(;m.length;){const{nestedArrIndex:g,value:y}=m.pop();if(yn(y))if(Zn(y)&&!Hd(y)){let v={v:y,i:g,n:this.norm.get(y)};p.push(v)}else Na(y)&&y.forEach((v,_)=>{m.push({nestedArrIndex:_,value:v})})}o.$[u]=p}else if(Zn(d)&&!Hd(d)){let p={v:d,n:this.norm.get(d)};o.$[u]=p}}}),this.records.push(o)}toJSON(){return{keys:this.keys,records:this.records}}}function T1(n,a,{getFn:i=ve.getFn,fieldNormWeight:o=ve.fieldNormWeight}={}){const r=new mh({getFn:i,fieldNormWeight:o});return r.setKeys(n.map(x1)),r.setSources(a),r.create(),r}function UN(n,{getFn:a=ve.getFn,fieldNormWeight:i=ve.fieldNormWeight}={}){const{keys:o,records:r}=n,u=new mh({getFn:a,fieldNormWeight:i});return u.setKeys(o),u.setIndexRecords(r),u}function jr(n,{errors:a=0,currentLocation:i=0,expectedLocation:o=0,distance:r=ve.distance,ignoreLocation:u=ve.ignoreLocation}={}){const d=a/n.length;if(u)return d;const p=Math.abs(o-i);return r?d+p/r:p?1:d}function zN(n=[],a=ve.minMatchCharLength){let i=[],o=-1,r=-1,u=0;for(let d=n.length;u<d;u+=1){let p=n[u];p&&o===-1?o=u:!p&&o!==-1&&(r=u-1,r-o+1>=a&&i.push([o,r]),o=-1)}return n[u-1]&&u-o>=a&&i.push([o,u-1]),i}const Ms=32;function IN(n,a,i,{location:o=ve.location,distance:r=ve.distance,threshold:u=ve.threshold,findAllMatches:d=ve.findAllMatches,minMatchCharLength:p=ve.minMatchCharLength,includeMatches:m=ve.includeMatches,ignoreLocation:g=ve.ignoreLocation}={}){if(a.length>Ms)throw new Error(AN(Ms));const y=a.length,v=n.length,_=Math.max(0,Math.min(o,v));let T=u,C=_;const E=p>1||m,j=E?Array(v):[];let A;for(;(A=n.indexOf(a,C))>-1;){let q=jr(a,{currentLocation:A,expectedLocation:_,distance:r,ignoreLocation:g});if(T=Math.min(q,T),C=A+y,E){let O=0;for(;O<y;)j[A+O]=1,O+=1}}C=-1;let k=[],R=1,$=y+v;const H=1<<y-1;for(let q=0;q<y;q+=1){let O=0,ee=$;for(;O<ee;)jr(a,{errors:q,currentLocation:_+ee,expectedLocation:_,distance:r,ignoreLocation:g})<=T?O=ee:$=ee,ee=Math.floor(($-O)/2+O);$=ee;let ae=Math.max(1,_-ee+1),I=d?v:Math.min(_+ee,v)+y,se=Array(I+2);se[I+1]=(1<<q)-1;for(let fe=I;fe>=ae;fe-=1){let G=fe-1,U=i[n.charAt(G)];if(E&&(j[G]=+!!U),se[fe]=(se[fe+1]<<1|1)&U,q&&(se[fe]|=(k[fe+1]|k[fe])<<1|1|k[fe+1]),se[fe]&H&&(R=jr(a,{errors:q,currentLocation:G,expectedLocation:_,distance:r,ignoreLocation:g}),R<=T)){if(T=R,C=G,C<=_)break;ae=Math.max(1,2*_-C)}}if(jr(a,{errors:q+1,currentLocation:_,expectedLocation:_,distance:r,ignoreLocation:g})>T)break;k=se}const V={isMatch:C>=0,score:Math.max(.001,R)};if(E){const q=zN(j,p);q.length?m&&(V.indices=q):V.isMatch=!1}return V}function VN(n){let a={};for(let i=0,o=n.length;i<o;i+=1){const r=n.charAt(i);a[r]=(a[r]||0)|1<<o-i-1}return a}const Fr=String.prototype.normalize?(n=>n.normalize("NFD").replace(/[\u0300-\u036F\u0483-\u0489\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u0711\u0730-\u074A\u07A6-\u07B0\u07EB-\u07F3\u07FD\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u08D3-\u08E1\u08E3-\u0903\u093A-\u093C\u093E-\u094F\u0951-\u0957\u0962\u0963\u0981-\u0983\u09BC\u09BE-\u09C4\u09C7\u09C8\u09CB-\u09CD\u09D7\u09E2\u09E3\u09FE\u0A01-\u0A03\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A70\u0A71\u0A75\u0A81-\u0A83\u0ABC\u0ABE-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AE2\u0AE3\u0AFA-\u0AFF\u0B01-\u0B03\u0B3C\u0B3E-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B62\u0B63\u0B82\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD7\u0C00-\u0C04\u0C3E-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C81-\u0C83\u0CBC\u0CBE-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CE2\u0CE3\u0D00-\u0D03\u0D3B\u0D3C\u0D3E-\u0D44\u0D46-\u0D48\u0D4A-\u0D4D\u0D57\u0D62\u0D63\u0D82\u0D83\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DF2\u0DF3\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0EB1\u0EB4-\u0EB9\u0EBB\u0EBC\u0EC8-\u0ECD\u0F18\u0F19\u0F35\u0F37\u0F39\u0F3E\u0F3F\u0F71-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102B-\u103E\u1056-\u1059\u105E-\u1060\u1062-\u1064\u1067-\u106D\u1071-\u1074\u1082-\u108D\u108F\u109A-\u109D\u135D-\u135F\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17B4-\u17D3\u17DD\u180B-\u180D\u1885\u1886\u18A9\u1920-\u192B\u1930-\u193B\u1A17-\u1A1B\u1A55-\u1A5E\u1A60-\u1A7C\u1A7F\u1AB0-\u1ABE\u1B00-\u1B04\u1B34-\u1B44\u1B6B-\u1B73\u1B80-\u1B82\u1BA1-\u1BAD\u1BE6-\u1BF3\u1C24-\u1C37\u1CD0-\u1CD2\u1CD4-\u1CE8\u1CED\u1CF2-\u1CF4\u1CF7-\u1CF9\u1DC0-\u1DF9\u1DFB-\u1DFF\u20D0-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\uA66F-\uA672\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA823-\uA827\uA880\uA881\uA8B4-\uA8C5\uA8E0-\uA8F1\uA8FF\uA926-\uA92D\uA947-\uA953\uA980-\uA983\uA9B3-\uA9C0\uA9E5\uAA29-\uAA36\uAA43\uAA4C\uAA4D\uAA7B-\uAA7D\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEB-\uAAEF\uAAF5\uAAF6\uABE3-\uABEA\uABEC\uABED\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F]/g,"")):(n=>n);class E1{constructor(a,{location:i=ve.location,threshold:o=ve.threshold,distance:r=ve.distance,includeMatches:u=ve.includeMatches,findAllMatches:d=ve.findAllMatches,minMatchCharLength:p=ve.minMatchCharLength,isCaseSensitive:m=ve.isCaseSensitive,ignoreDiacritics:g=ve.ignoreDiacritics,ignoreLocation:y=ve.ignoreLocation}={}){if(this.options={location:i,threshold:o,distance:r,includeMatches:u,findAllMatches:d,minMatchCharLength:p,isCaseSensitive:m,ignoreDiacritics:g,ignoreLocation:y},a=m?a:a.toLowerCase(),a=g?Fr(a):a,this.pattern=a,this.chunks=[],!this.pattern.length)return;const v=(T,C)=>{this.chunks.push({pattern:T,alphabet:VN(T),startIndex:C})},_=this.pattern.length;if(_>Ms){let T=0;const C=_%Ms,E=_-C;for(;T<E;)v(this.pattern.substr(T,Ms),T),T+=Ms;if(C){const j=_-Ms;v(this.pattern.substr(j),j)}}else v(this.pattern,0)}searchIn(a){const{isCaseSensitive:i,ignoreDiacritics:o,includeMatches:r}=this.options;if(a=i?a:a.toLowerCase(),a=o?Fr(a):a,this.pattern===a){let E={isMatch:!0,score:0};return r&&(E.indices=[[0,a.length-1]]),E}const{location:u,distance:d,threshold:p,findAllMatches:m,minMatchCharLength:g,ignoreLocation:y}=this.options;let v=[],_=0,T=!1;this.chunks.forEach(({pattern:E,alphabet:j,startIndex:A})=>{const{isMatch:k,score:R,indices:$}=IN(a,E,j,{location:u+A,distance:d,threshold:p,findAllMatches:m,minMatchCharLength:g,includeMatches:r,ignoreLocation:y});k&&(T=!0),_+=R,k&&$&&(v=[...v,...$])});let C={isMatch:T,score:T?_/this.chunks.length:1};return T&&r&&(C.indices=v),C}}class cs{constructor(a){this.pattern=a}static isMultiMatch(a){return Qv(a,this.multiRegex)}static isSingleMatch(a){return Qv(a,this.singleRegex)}search(){}}function Qv(n,a){const i=n.match(a);return i?i[1]:null}class HN extends cs{constructor(a){super(a)}static get type(){return"exact"}static get multiRegex(){return/^="(.*)"$/}static get singleRegex(){return/^=(.*)$/}search(a){const i=a===this.pattern;return{isMatch:i,score:i?0:1,indices:[0,this.pattern.length-1]}}}class PN extends cs{constructor(a){super(a)}static get type(){return"inverse-exact"}static get multiRegex(){return/^!"(.*)"$/}static get singleRegex(){return/^!(.*)$/}search(a){const o=a.indexOf(this.pattern)===-1;return{isMatch:o,score:o?0:1,indices:[0,a.length-1]}}}class GN extends cs{constructor(a){super(a)}static get type(){return"prefix-exact"}static get multiRegex(){return/^\^"(.*)"$/}static get singleRegex(){return/^\^(.*)$/}search(a){const i=a.startsWith(this.pattern);return{isMatch:i,score:i?0:1,indices:[0,this.pattern.length-1]}}}class qN extends cs{constructor(a){super(a)}static get type(){return"inverse-prefix-exact"}static get multiRegex(){return/^!\^"(.*)"$/}static get singleRegex(){return/^!\^(.*)$/}search(a){const i=!a.startsWith(this.pattern);return{isMatch:i,score:i?0:1,indices:[0,a.length-1]}}}class FN extends cs{constructor(a){super(a)}static get type(){return"suffix-exact"}static get multiRegex(){return/^"(.*)"\$$/}static get singleRegex(){return/^(.*)\$$/}search(a){const i=a.endsWith(this.pattern);return{isMatch:i,score:i?0:1,indices:[a.length-this.pattern.length,a.length-1]}}}class $N extends cs{constructor(a){super(a)}static get type(){return"inverse-suffix-exact"}static get multiRegex(){return/^!"(.*)"\$$/}static get singleRegex(){return/^!(.*)\$$/}search(a){const i=!a.endsWith(this.pattern);return{isMatch:i,score:i?0:1,indices:[0,a.length-1]}}}class C1 extends cs{constructor(a,{location:i=ve.location,threshold:o=ve.threshold,distance:r=ve.distance,includeMatches:u=ve.includeMatches,findAllMatches:d=ve.findAllMatches,minMatchCharLength:p=ve.minMatchCharLength,isCaseSensitive:m=ve.isCaseSensitive,ignoreDiacritics:g=ve.ignoreDiacritics,ignoreLocation:y=ve.ignoreLocation}={}){super(a),this._bitapSearch=new E1(a,{location:i,threshold:o,distance:r,includeMatches:u,findAllMatches:d,minMatchCharLength:p,isCaseSensitive:m,ignoreDiacritics:g,ignoreLocation:y})}static get type(){return"fuzzy"}static get multiRegex(){return/^"(.*)"$/}static get singleRegex(){return/^(.*)$/}search(a){return this._bitapSearch.searchIn(a)}}class A1 extends cs{constructor(a){super(a)}static get type(){return"include"}static get multiRegex(){return/^'"(.*)"$/}static get singleRegex(){return/^'(.*)$/}search(a){let i=0,o;const r=[],u=this.pattern.length;for(;(o=a.indexOf(this.pattern,i))>-1;)i=o+u,r.push([o,i-1]);const d=!!r.length;return{isMatch:d,score:d?0:1,indices:r}}}const yf=[HN,A1,GN,qN,$N,FN,PN,C1],Jv=yf.length,YN=/ +(?=(?:[^\"]*\"[^\"]*\")*[^\"]*$)/,KN="|";function ZN(n,a={}){return n.split(KN).map(i=>{let o=i.trim().split(YN).filter(u=>u&&!!u.trim()),r=[];for(let u=0,d=o.length;u<d;u+=1){const p=o[u];let m=!1,g=-1;for(;!m&&++g<Jv;){const y=yf[g];let v=y.isMultiMatch(p);v&&(r.push(new y(v,a)),m=!0)}if(!m)for(g=-1;++g<Jv;){const y=yf[g];let v=y.isSingleMatch(p);if(v){r.push(new y(v,a));break}}}return r})}const XN=new Set([C1.type,A1.type]);class QN{constructor(a,{isCaseSensitive:i=ve.isCaseSensitive,ignoreDiacritics:o=ve.ignoreDiacritics,includeMatches:r=ve.includeMatches,minMatchCharLength:u=ve.minMatchCharLength,ignoreLocation:d=ve.ignoreLocation,findAllMatches:p=ve.findAllMatches,location:m=ve.location,threshold:g=ve.threshold,distance:y=ve.distance}={}){this.query=null,this.options={isCaseSensitive:i,ignoreDiacritics:o,includeMatches:r,minMatchCharLength:u,findAllMatches:p,ignoreLocation:d,location:m,threshold:g,distance:y},a=i?a:a.toLowerCase(),a=o?Fr(a):a,this.pattern=a,this.query=ZN(this.pattern,this.options)}static condition(a,i){return i.useExtendedSearch}searchIn(a){const i=this.query;if(!i)return{isMatch:!1,score:1};const{includeMatches:o,isCaseSensitive:r,ignoreDiacritics:u}=this.options;a=r?a:a.toLowerCase(),a=u?Fr(a):a;let d=0,p=[],m=0;for(let g=0,y=i.length;g<y;g+=1){const v=i[g];p.length=0,d=0;for(let _=0,T=v.length;_<T;_+=1){const C=v[_],{isMatch:E,indices:j,score:A}=C.search(a);if(E){if(d+=1,m+=A,o){const k=C.constructor.type;XN.has(k)?p=[...p,...j]:p.push(j)}}else{m=0,d=0,p.length=0;break}}if(d){let _={isMatch:!0,score:m/d};return o&&(_.indices=p),_}}return{isMatch:!1,score:1}}}const vf=[];function JN(...n){vf.push(...n)}function bf(n,a){for(let i=0,o=vf.length;i<o;i+=1){let r=vf[i];if(r.condition(n,a))return new r(n,a)}return new E1(n,a)}const $r={AND:"$and",OR:"$or"},Sf={PATH:"$path",PATTERN:"$val"},_f=n=>!!(n[$r.AND]||n[$r.OR]),WN=n=>!!n[Sf.PATH],ew=n=>!Na(n)&&S1(n)&&!_f(n),Wv=n=>({[$r.AND]:Object.keys(n).map(a=>({[a]:n[a]}))});function j1(n,a,{auto:i=!0}={}){const o=r=>{let u=Object.keys(r);const d=WN(r);if(!d&&u.length>1&&!_f(r))return o(Wv(r));if(ew(r)){const m=d?r[Sf.PATH]:u[0],g=d?r[Sf.PATTERN]:r[m];if(!Zn(g))throw new Error(CN(m));const y={keyId:gf(m),pattern:g};return i&&(y.searcher=bf(g,a)),y}let p={children:[],operator:u[0]};return u.forEach(m=>{const g=r[m];Na(g)&&g.forEach(y=>{p.children.push(o(y))})}),p};return _f(n)||(n=Wv(n)),o(n)}function tw(n,{ignoreFieldNorm:a=ve.ignoreFieldNorm}){n.forEach(i=>{let o=1;i.matches.forEach(({key:r,norm:u,score:d})=>{const p=r?r.weight:null;o*=Math.pow(d===0&&p?Number.EPSILON:d,(p||1)*(a?1:u))}),i.score=o})}function nw(n,a){const i=n.matches;a.matches=[],yn(i)&&i.forEach(o=>{if(!yn(o.indices)||!o.indices.length)return;const{indices:r,value:u}=o;let d={indices:r,value:u};o.key&&(d.key=o.key.src),o.idx>-1&&(d.refIndex=o.idx),a.matches.push(d)})}function aw(n,a){a.score=n.score}function sw(n,a,{includeMatches:i=ve.includeMatches,includeScore:o=ve.includeScore}={}){const r=[];return i&&r.push(nw),o&&r.push(aw),n.map(u=>{const{idx:d}=u,p={item:a[d],refIndex:d};return r.length&&r.forEach(m=>{m(u,p)}),p})}class Ii{constructor(a,i={},o){this.options={...ve,...i},this.options.useExtendedSearch,this._keyStore=new wN(this.options.keys),this.setCollection(a,o)}setCollection(a,i){if(this._docs=a,i&&!(i instanceof mh))throw new Error(EN);this._myIndex=i||T1(this.options.keys,this._docs,{getFn:this.options.getFn,fieldNormWeight:this.options.fieldNormWeight})}add(a){yn(a)&&(this._docs.push(a),this._myIndex.add(a))}remove(a=()=>!1){const i=[];for(let o=0,r=this._docs.length;o<r;o+=1){const u=this._docs[o];a(u,o)&&(this.removeAt(o),o-=1,r-=1,i.push(u))}return i}removeAt(a){this._docs.splice(a,1),this._myIndex.removeAt(a)}getIndex(){return this._myIndex}search(a,{limit:i=-1}={}){const{includeMatches:o,includeScore:r,shouldSort:u,sortFn:d,ignoreFieldNorm:p}=this.options;let m=Zn(a)?Zn(this._docs[0])?this._searchStringList(a):this._searchObjectList(a):this._searchLogical(a);return tw(m,{ignoreFieldNorm:p}),u&&m.sort(d),b1(i)&&i>-1&&(m=m.slice(0,i)),sw(m,this._docs,{includeMatches:o,includeScore:r})}_searchStringList(a){const i=bf(a,this.options),{records:o}=this._myIndex,r=[];return o.forEach(({v:u,i:d,n:p})=>{if(!yn(u))return;const{isMatch:m,score:g,indices:y}=i.searchIn(u);m&&r.push({item:u,idx:d,matches:[{score:g,value:u,norm:p,indices:y}]})}),r}_searchLogical(a){const i=j1(a,this.options),o=(p,m,g)=>{if(!p.children){const{keyId:v,searcher:_}=p,T=this._findMatches({key:this._keyStore.get(v),value:this._myIndex.getValueForItemAtKeyId(m,v),searcher:_});return T&&T.length?[{idx:g,item:m,matches:T}]:[]}const y=[];for(let v=0,_=p.children.length;v<_;v+=1){const T=p.children[v],C=o(T,m,g);if(C.length)y.push(...C);else if(p.operator===$r.AND)return[]}return y},r=this._myIndex.records,u={},d=[];return r.forEach(({$:p,i:m})=>{if(yn(p)){let g=o(i,p,m);g.length&&(u[m]||(u[m]={idx:m,item:p,matches:[]},d.push(u[m])),g.forEach(({matches:y})=>{u[m].matches.push(...y)}))}}),d}_searchObjectList(a){const i=bf(a,this.options),{keys:o,records:r}=this._myIndex,u=[];return r.forEach(({$:d,i:p})=>{if(!yn(d))return;let m=[];o.forEach((g,y)=>{m.push(...this._findMatches({key:g,value:d[y],searcher:i}))}),m.length&&u.push({idx:p,item:d,matches:m})}),u}_findMatches({key:a,value:i,searcher:o}){if(!yn(i))return[];let r=[];if(Na(i))i.forEach(({v:u,i:d,n:p})=>{if(!yn(u))return;const{isMatch:m,score:g,indices:y}=o.searchIn(u);m&&r.push({score:g,key:a,value:u,idx:d,norm:p,indices:y})});else{const{v:u,n:d}=i,{isMatch:p,score:m,indices:g}=o.searchIn(u);p&&r.push({score:m,key:a,value:u,norm:d,indices:g})}return r}}Ii.version="7.1.0";Ii.createIndex=T1;Ii.parseIndex=UN;Ii.config=ve;Ii.parseQuery=j1;JN(QN);function e0(n,a,i,o){if(!a.trim())return[];const r=.3;return new Ii(n,{keys:i,threshold:r,ignoreLocation:!0,includeScore:!0,includeMatches:!0,minMatchCharLength:2}).search(a).map(m=>({item:m.item,score:m.score??1,matches:(m.matches??[]).map(g=>({key:g.key??"",indices:g.indices}))}))}const iw="_breadcrumbs_17or2_1",lw="_list_17or2_11",ow="_item_17or2_21",rw="_separator_17or2_28",cw="_link_17or2_34",uw="_current_17or2_57",Ei={breadcrumbs:iw,list:lw,item:ow,separator:rw,link:cw,current:uw},dw="›";function Vi({segments:n}){return h.jsx("nav",{className:Ei.breadcrumbs,"aria-label":"Breadcrumb","data-testid":"breadcrumbs",children:h.jsx("ol",{className:Ei.list,children:n.map((a,i)=>{const o=i===n.length-1;return h.jsxs("li",{className:Ei.item,children:[i>0&&h.jsx("span",{className:Ei.separator,"aria-hidden":"true",children:dw}),a.url&&!o?h.jsx(Mf,{className:Ei.link,to:a.url,title:a.label,children:a.label}):h.jsx("span",{className:Ei.current,"aria-current":"page",title:a.label,children:a.label})]},i)})})})}function xf(){xf=function(r,u){return new i(r,void 0,u)};var n=RegExp.prototype,a=new WeakMap;function i(r,u,d){var p=new RegExp(r,u);return a.set(p,d||a.get(r)),Yr(p,i.prototype)}function o(r,u){var d=a.get(u);return Object.keys(d).reduce(function(p,m){var g=d[m];if(typeof g=="number")p[m]=r[g];else{for(var y=0;r[g[y]]===void 0&&y+1<g.length;)y++;p[m]=r[g[y]]}return p},Object.create(null))}return(function(r,u){if(typeof u!="function"&&u!==null)throw new TypeError("Super expression must either be null or a function");r.prototype=Object.create(u&&u.prototype,{constructor:{value:r,writable:!0,configurable:!0}}),Object.defineProperty(r,"prototype",{writable:!1}),u&&Yr(r,u)})(i,RegExp),i.prototype.exec=function(r){var u=n.exec.call(this,r);if(u){u.groups=o(u,this);var d=u.indices;d&&(d.groups=o(d,this))}return u},i.prototype[Symbol.replace]=function(r,u){if(typeof u=="string"){var d=a.get(this);return n[Symbol.replace].call(this,r,u.replace(/\$<([^>]+)>/g,function(m,g){var y=d[g];return"$"+(Array.isArray(y)?y.join("$"):y)}))}if(typeof u=="function"){var p=this;return n[Symbol.replace].call(this,r,function(){var m=arguments;return typeof m[m.length-1]!="object"&&(m=[].slice.call(m)).push(o(m,p)),u.apply(this,m)})}return n[Symbol.replace].call(this,r,u)},xf.apply(this,arguments)}function Yr(n,a){return Yr=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(i,o){return i.__proto__=o,i},Yr(n,a)}function t0(n,a){(a==null||a>n.length)&&(a=n.length);for(var i=0,o=new Array(a);i<a;i++)o[i]=n[i];return o}function Pd(n,a){var i=typeof Symbol<"u"&&n[Symbol.iterator]||n["@@iterator"];if(i)return(i=i.call(n)).next.bind(i);if(Array.isArray(n)||(i=(function(r,u){if(r){if(typeof r=="string")return t0(r,u);var d=Object.prototype.toString.call(r).slice(8,-1);return d==="Object"&&r.constructor&&(d=r.constructor.name),d==="Map"||d==="Set"?Array.from(r):d==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(d)?t0(r,u):void 0}})(n))||a){i&&(n=i);var o=0;return function(){return o>=n.length?{done:!0}:{done:!1,value:n[o++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
87
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var fw=(function(n){return function(a){return a===void 0&&(a={}),(function(o,r){if(r&&!o.registered(r))throw new Error('The default language "'+r+'" is not registered with refractor.')})(n,a.defaultLanguage),function(o){J_(o,"element",i)};function i(o,r,u){var d,p;if(u&&u.tagName==="pre"&&o.tagName==="code"){var m=(o==null||(d=o.data)==null?void 0:d.meta)||(o==null||(p=o.properties)==null?void 0:p.metastring)||"";o.properties.className?typeof o.properties.className=="boolean"?o.properties.className=[]:Array.isArray(o.properties.className)||(o.properties.className=[o.properties.className]):o.properties.className=[];var g,y,v=(function(H){for(var V,q=Pd(H.properties.className);!(V=q()).done;){var O=V.value;if(O.slice(0,9)==="language-")return O.slice(9).toLowerCase()}return null})(o);if(!v&&a.defaultLanguage&&o.properties.className.push("language-"+(v=a.defaultLanguage)),o.properties.className.push("code-highlight"),v)try{var _,T;T=(_=v)!=null&&_.includes("diff-")?v.split("-")[1]:v,g=n.highlight(_r(o),T),u.properties.className=(u.properties.className||[]).concat("language-"+T)}catch(H){if(!a.ignoreMissing||!/Unknown language/.test(H.message))throw H;g=o}else g=o;g.children=(y=1,function H(V){return V.reduce(function(q,O){if(O.type==="text"){var ee=O.value,ae=(ee.match(/\n/g)||"").length;if(ae===0)O.position={start:{line:y,column:1},end:{line:y,column:1}},q.push(O);else for(var I,se=ee.split(`
88
- `),Y=Pd(se.entries());!(I=Y()).done;){var fe=I.value,G=fe[0],U=fe[1];q.push({type:"text",value:G===se.length-1?U:U+`
89
- `,position:{start:{line:y+G,column:1},end:{line:y+G,column:1}}})}return y+=ae,q}if(Object.prototype.hasOwnProperty.call(O,"children")){var Q=y;return O.children=H(O.children),q.push(O),O.position={start:{line:Q,column:1},end:{line:y,column:1}},q}return q.push(O),q},[])})(g.children),g.position=g.children.length>0?{start:{line:g.children[0].position.start.line,column:0},end:{line:g.children[g.children.length-1].position.end.line,column:0}}:{start:{line:0,column:0},end:{line:0,column:0}};for(var C,E=(function(H){var V=/{([\d,-]+)}/,q=H.split(",").map(function(ae){return ae.trim()}).join();if(V.test(q)){var O=V.exec(q)[1],ee=ex(O);return function(ae){return ee.includes(ae+1)}}return function(){return!1}})(m),j=(function(H){var V=xf(/showLineNumbers=(\d+)/i,{lines:1});if(V.test(H)){var q=V.exec(H);return Number(q.groups.lines)}return 1})(m),A=(function(H){for(var V=new Array(H),q=0;q<H;q++)V[q]={type:"element",tagName:"span",properties:{className:[]},children:[]};return V})(g.position.end.line),k=["showlinenumbers=false",'showlinenumbers="false"',"showlinenumbers={false}"],R=function(){var H,V,q=C.value,O=q[0],ee=q[1];ee.properties.className=["code-line"];var ae=tx(g,function(I){return I.position.start.line<=O+1&&I.position.end.line>=O+1});ee.children=ae.children,(m.toLowerCase().includes("showLineNumbers".toLowerCase())||a.showLineNumbers===!0||typeof a.showLineNumbers=="object"&&a.showLineNumbers.includes(v))&&!k.some(function(I){return m.toLowerCase().includes(I)})&&(ee.properties.line=[(O+j).toString()],ee.properties.className.push("line-number")),E(O)&&ee.properties.className.push("highlight-line"),(v==="diff"||(H=v)!=null&&H.includes("diff-"))&&_r(ee).substring(0,1)==="-"?ee.properties.className.push("deleted"):(v==="diff"||(V=v)!=null&&V.includes("diff-"))&&_r(ee).substring(0,1)==="+"&&ee.properties.className.push("inserted")},$=Pd(A.entries());!(C=$()).done;)R();A.length>0&&_r(A[A.length-1]).trim()===""&&A.pop(),o.children=A}}}})(W_);const hw="_systemEvent_qvd33_1",pw="_systemTimestamp_qvd33_9",mw="_textEvent_qvd33_13",gw="_toolUseEvent_qvd33_100",yw="_toolUseHeader_qvd33_121",vw="_toolUsePrefix_qvd33_128",bw="_toolUseName_qvd33_133",Sw="_toolUseArgs_qvd33_138",_w="_toolResultEvent_qvd33_149",xw="_toolResultHeader_qvd33_155",Tw="_toolResultIndicatorOk_qvd33_179",Ew="_toolResultIndicatorError_qvd33_186",Cw="_toolResultLabel_qvd33_193",Aw="_toolResultToggle_qvd33_197",jw="_toolResultCommand_qvd33_203",Nw="_toolResultEllipsis_qvd33_213",ww="_toolResultPre_qvd33_217",Dw="_errorEvent_qvd33_238",kw="_statusEvent_qvd33_247",Mw="_userInputEvent_qvd33_257",Rw="_userInputContent_qvd33_264",Ow="_defaultEvent_qvd33_281",ct={systemEvent:hw,systemTimestamp:pw,textEvent:mw,toolUseEvent:gw,toolUseHeader:yw,toolUsePrefix:vw,toolUseName:bw,toolUseArgs:Sw,toolResultEvent:_w,toolResultHeader:xw,toolResultIndicatorOk:Tw,toolResultIndicatorError:Ew,toolResultLabel:Cw,toolResultToggle:Aw,toolResultCommand:jw,toolResultEllipsis:Nw,toolResultPre:ww,errorEvent:Dw,statusEvent:kw,userInputEvent:Mw,userInputContent:Rw,defaultEvent:Ow};function Bw({time:n,content:a}){return h.jsxs("div",{className:ct.systemEvent,children:[h.jsxs("span",{className:ct.systemTimestamp,children:["[",n,"]"]})," ",a]})}function Lw({content:n}){return h.jsx("div",{className:ct.textEvent,children:h.jsx(Ef,{remarkPlugins:[Cf],rehypePlugins:[fw],children:n})})}function Uw({content:n}){let a="",i=n;try{const o=JSON.parse(n);a=o.tool||"",i=JSON.stringify(o.args,null,2)}catch{}return h.jsxs("div",{className:ct.toolUseEvent,children:[h.jsxs("div",{className:ct.toolUseHeader,children:[h.jsx("span",{className:ct.toolUsePrefix,children:">"}),a?h.jsx("span",{className:ct.toolUseName,children:a}):null]}),h.jsx("pre",{className:ct.toolUseArgs,children:i})]})}const n0=5;function zw(n,a){if(a==null)return"";if(typeof a!="object")return String(a);const i=a;if(typeof i.command=="string")return i.command;if(typeof i.file_path=="string")return i.file_path;if(typeof i.pattern=="string"){const o=typeof i.path=="string"?` in ${i.path}`:"";return`${i.pattern}${o}`}if(typeof i.path=="string")return i.path;if(typeof i.query=="string")return i.query;try{const o=JSON.stringify(a);return o.length>150?`${o.slice(0,150)}…`:o}catch{return""}}function Iw({content:n,raw:a,toolUseCtx:i}){const[o,r]=S.useState(!1);let u=!1;if(a)try{u=JSON.parse(a).is_error===!0}catch{}const d=n.split(`
90
- `),p=d.length>n0,m=o?n:d.slice(0,n0).join(`
91
- `),y=((i==null?void 0:i.tool)??"")||(u?"Tool error":"Tool output"),v=i?zw(i.tool,i.args):"",_=h.jsxs(h.Fragment,{children:[h.jsx("span",{className:u?ct.toolResultIndicatorError:ct.toolResultIndicatorOk,"aria-label":u?"error":"success",children:u?"✗":"✓"}),h.jsx("span",{className:ct.toolResultLabel,children:y}),p&&h.jsx("span",{className:ct.toolResultToggle,"aria-hidden":"true",children:o?"▾":"▸"})]});return h.jsxs("div",{className:ct.toolResultEvent,children:[p?h.jsx("button",{className:ct.toolResultHeader,onClick:()=>{r(T=>!T)},"aria-expanded":o,children:_}):h.jsx("div",{className:ct.toolResultHeader,children:_}),v&&h.jsx("div",{className:ct.toolResultCommand,children:v}),h.jsxs("pre",{className:ct.toolResultPre,children:[m,!o&&p&&h.jsx("span",{className:ct.toolResultEllipsis,children:"…"})]})]})}function Vw({content:n}){return h.jsxs("div",{className:ct.errorEvent,children:["Error: ",n]})}function Hw({content:n}){return h.jsxs("div",{className:ct.statusEvent,children:["--- ",n," ---"]})}function Pw({content:n}){return h.jsx("div",{className:ct.userInputEvent,children:h.jsx("span",{className:ct.userInputContent,children:n})})}function Gw({content:n}){return h.jsx("div",{className:ct.defaultEvent,children:n})}function N1({event:n,toolUseCtx:a}){const i=new Date(n.timestamp).toLocaleTimeString();switch(n.eventType){case"system":return h.jsx(Bw,{time:i,content:n.content});case"text":case"output":return h.jsx(Lw,{content:n.content});case"tool_use":return h.jsx(Uw,{content:n.content});case"tool_result":return h.jsx(Iw,{content:n.content,raw:n.raw,toolUseCtx:a});case"error":return h.jsx(Vw,{content:n.content});case"status":return h.jsx(Hw,{content:n.content});case"user_input":return h.jsx(Pw,{content:n.content});default:return h.jsx(Gw,{content:n.content})}}const qw="_overlay_cmicx_1",Fw="_dialog_cmicx_11",$w="_title_cmicx_30",Yw="_description_cmicx_38",Kw="_actions_cmicx_45",Zw="_cancelButton_cmicx_52",Xw="_confirmButton_cmicx_79",ws={overlay:qw,dialog:Fw,title:$w,description:Yw,actions:Kw,cancelButton:Zw,confirmButton:Xw};function lc({isOpen:n,title:a,description:i,confirmLabel:o="Delete",onConfirm:r,onCancel:u}){const d=S.useId(),p=S.useId();return h.jsx(os,{children:n&&h.jsx(Rn.div,{className:ws.overlay,initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.15},onClick:u,onKeyDown:m=>{m.key==="Escape"&&u()},role:"dialog","aria-modal":"true","aria-labelledby":d,"aria-describedby":i?p:void 0,children:h.jsxs(Rn.div,{className:ws.dialog,initial:{opacity:0,scale:.93,y:-10},animate:{opacity:1,scale:1,y:0},exit:{opacity:0,scale:.93,y:-10},transition:{duration:.15,ease:[.16,1,.3,1]},onClick:m=>m.stopPropagation(),children:[h.jsx("h3",{id:d,className:ws.title,children:a}),i&&h.jsx("p",{id:p,className:ws.description,children:i}),h.jsxs("div",{className:ws.actions,children:[h.jsx("button",{type:"button",className:ws.cancelButton,onClick:u,autoFocus:!0,children:"Cancel"}),h.jsx("button",{type:"button",className:ws.confirmButton,onClick:r,children:o})]})]})})})}const Qw="_spinner_13c8l_1",Jw="_spin_13c8l_1",Ww="_sm_13c8l_14",eD="_md_13c8l_20",tD="_lg_13c8l_26",a0={spinner:Qw,spin:Jw,sm:Ww,md:eD,lg:tD};function s0({size:n="md",className:a,label:i="Loading",liveRegion:o=!1}){return h.jsx("span",{className:`${a0.spinner} ${a0[n]} ${a??""}`,role:o?"status":void 0,"aria-label":i,"aria-hidden":o?void 0:!0})}const Tf={not_started:{color:"var(--text-tertiary)",icon:"○",label:"Not Started"},working:{color:"var(--accent-green)",icon:"●",label:"Working"},paused:{color:"var(--accent-yellow)",icon:"◉",label:"Paused"},complete:{color:"var(--accent-green)",icon:"✓",label:"Complete"},failed:{color:"var(--accent-red)",icon:"✗",label:"Failed"},blocked:{color:"var(--accent-yellow)",icon:"⦸",label:"Blocked"}};function ls(n){return n==="blocked"?Tf.blocked:Tf[gh(n)]}const nD={not_started:"statusPending",working:"statusInProgress",paused:"statusWaitingInput",complete:"statusDone",failed:"statusFailed"};function aD(n){return nD[gh(n)]??"statusPending"}const sD=["working","paused","failed","not_started","blocked","complete"],i0=["not_started","working","paused","complete","failed"],iD={pending:"not_started",assigned:"not_started",in_progress:"working",waiting_input:"paused",review:"paused",done:"complete"};function gh(n){return n in Tf&&n!=="blocked"?n:iD[n]??"not_started"}const lD={not_started:"--text-tertiary",working:"--accent-green",paused:"--accent-yellow",complete:"--accent-green",failed:"--accent-red",pending:"--text-tertiary",assigned:"--text-tertiary",in_progress:"--accent-green",review:"--accent-yellow",done:"--accent-green",waiting_input:"--accent-yellow"},oD="_container_15oob_1",rD="_header_15oob_5",cD="_searchInput_15oob_17",uD="_searchHighlight_15oob_50",dD="_addButton_15oob_56",fD="_createForm_15oob_83",hD="_createInput_15oob_89",pD="_createButton_15oob_120",mD="_creatingHint_15oob_161",gD="_projectRow_15oob_170",yD="_selected_15oob_188",vD="_expandArrow_15oob_193",bD="_expanded_15oob_200",SD="_projectName_15oob_204",_D="_taskCount_15oob_208",xD="_newTaskButton_15oob_214",TD="_taskRow_15oob_241",ED="_taskStatusIcon_15oob_271",CD="_taskTitle_15oob_275",AD="_dependencyBadge_15oob_282",jD="_blockedBadge_15oob_294",ND="_leafSpacer_15oob_299",wD="_childCountBadge_15oob_304",DD="_addChildButton_15oob_317",kD="_emptyCta_15oob_366",MD="_ctaDescription_15oob_379",RD="_ctaButton_15oob_385",OD="_emptyTaskCta_15oob_420",BD="_headerActions_15oob_425",LD="_groupToggle_15oob_431",UD="_groupToggleActive_15oob_458",zD="_statusGroupHeader_15oob_462",ID="_statusGroupIcon_15oob_481",VD="_statusGroupLabel_15oob_485",HD="_statusGroupCount_15oob_490",PD="_createTaskLink_15oob_503",Se={container:oD,header:rD,searchInput:cD,searchHighlight:uD,addButton:dD,createForm:fD,createInput:hD,createButton:pD,creatingHint:mD,projectRow:gD,selected:yD,expandArrow:vD,expanded:bD,projectName:SD,taskCount:_D,newTaskButton:xD,taskRow:TD,taskStatusIcon:ED,taskTitle:CD,dependencyBadge:AD,blockedBadge:jD,leafSpacer:ND,childCountBadge:wD,addChildButton:DD,emptyCta:kD,ctaDescription:MD,ctaButton:RD,emptyTaskCta:OD,headerActions:BD,groupToggle:LD,groupToggleActive:UD,statusGroupHeader:zD,statusGroupIcon:ID,statusGroupLabel:VD,statusGroupCount:HD,createTaskLink:PD};function GD(n){if(n.length===0)return[];const a=[...n].sort((o,r)=>o[0]-r[0]),i=[[a[0][0],a[0][1]]];for(let o=1;o<a.length;o++){const r=i[i.length-1],[u,d]=a[o];u<=r[1]+1?r[1]=Math.max(r[1],d):i.push([u,d])}return i}function w1({text:n,indices:a}){if(!a||a.length===0)return h.jsx(h.Fragment,{children:n});const i=GD(a),o=[];let r=0;for(const[u,d]of i)u>r&&o.push(h.jsx("span",{children:n.slice(r,u)},`p${r}`)),o.push(h.jsx("mark",{className:Se.searchHighlight,children:n.slice(u,d+1)},`m${u}`)),r=d+1;return r<n.length&&o.push(h.jsx("span",{children:n.slice(r)},`p${r}`)),h.jsx(h.Fragment,{children:o})}const qD=[{name:"name",weight:2},{name:"description",weight:1}],FD=[{name:"title",weight:2},{name:"description",weight:1}],D1=34,$D=16,k1="grackle-group-by-status";function l0(){try{return localStorage.getItem(k1)==="true"}catch{return!1}}function YD(n){try{localStorage.setItem(k1,String(n))}catch{}}function KD(n,a){const i=new Map;for(const u of n){const p=u.dependsOn.length>0&&u.dependsOn.some(g=>a.get(g)!=="complete")?"blocked":u.status,m=i.get(p);m?m.push(u):i.set(p,[u])}const o=[],r=new Set;for(const u of sD){r.add(u);const d=i.get(u);if(d&&d.length>0){d.sort((m,g)=>m.sortOrder-g.sortOrder);const p=ls(u);o.push({status:u,label:p.label,style:p,tasks:d})}}for(const[u,d]of i)if(!r.has(u)&&d.length>0){d.sort((m,g)=>m.sortOrder-g.sortOrder);const p=ls(u);o.push({status:u,label:p.label,style:p,tasks:d})}return o}function ZD({group:n,isExpanded:a,onToggle:i,selectedTaskId:o,navigate:r,titleHighlights:u}){return h.jsxs("div",{"data-testid":`status-group-${n.status}`,children:[h.jsxs("div",{className:Se.statusGroupHeader,role:"button",tabIndex:0,"aria-expanded":a,onClick:i,onKeyDown:d=>{(d.key==="Enter"||d.key===" ")&&(d.preventDefault(),i())},children:[h.jsx("span",{className:`${Se.expandArrow} ${a?Se.expanded:""}`,children:"▸"}),h.jsx("span",{className:Se.statusGroupIcon,style:{color:n.style.color},children:n.style.icon}),h.jsx("span",{className:Se.statusGroupLabel,children:n.label}),h.jsx("span",{className:Se.statusGroupCount,children:n.tasks.length})]}),h.jsx(os,{children:a&&h.jsx(Rn.div,{initial:{height:0,opacity:0},animate:{height:"auto",opacity:1},exit:{height:0,opacity:0},transition:{duration:.2},style:{overflow:"hidden"},children:n.tasks.map(d=>{const p=ls(d.status),m=o===d.id;return h.jsxs("div",{onClick:()=>r(as(d.id)),className:`${Se.taskRow} ${m?Se.selected:""}`,style:{"--task-indent":`${D1}px`},"data-task-id":d.id,children:[h.jsx("span",{className:Se.leafSpacer}),h.jsx("span",{className:Se.taskStatusIcon,style:{color:p.color},children:p.icon}),h.jsx("span",{className:Se.taskTitle,title:d.title,children:h.jsx(w1,{text:d.title,indices:u.get(d.id)})})]},d.id)})})})]})}function XD(n){const a=new Map(n.map(o=>[o.id,{...o,children:[]}])),i=[];for(const o of a.values())o.parentTaskId&&a.has(o.parentTaskId)?a.get(o.parentTaskId).children.push(o):i.push(o);for(const o of a.values())o.children.sort((r,u)=>r.sortOrder-u.sortOrder);return i.sort((o,r)=>o.sortOrder-r.sortOrder)}function M1({node:n,depth:a,expandedTasks:i,toggleTask:o,selectedTaskId:r,navigate:u,projectId:d,taskStatusById:p,titleHighlights:m}){const g=ls(n.status),y=n.dependsOn.length>0&&n.dependsOn.some(E=>p.get(E)!=="complete"),v=i.has(n.id),_=n.children.length>0,T=r===n.id,C=D1+a*$D;return h.jsxs(h.Fragment,{children:[h.jsxs("div",{onClick:()=>u(as(n.id)),className:`${Se.taskRow} ${T?Se.selected:""}`,style:{"--task-indent":`${C}px`},"data-task-id":n.id,children:[_&&h.jsx("span",{className:`${Se.expandArrow} ${v?Se.expanded:""}`,role:"button",tabIndex:0,"aria-label":v?"Collapse task":"Expand task",onClick:E=>{E.stopPropagation(),o(n.id)},onKeyDown:E=>{(E.key==="Enter"||E.key===" ")&&(E.preventDefault(),E.stopPropagation(),o(n.id))},children:"▸"}),!_&&h.jsx("span",{className:Se.leafSpacer}),h.jsx("span",{className:Se.taskStatusIcon,style:{color:g.color},children:g.icon}),h.jsx("span",{className:Se.taskTitle,title:n.title,children:h.jsx(w1,{text:n.title,indices:m.get(n.id)})}),_&&h.jsxs("span",{className:Se.childCountBadge,children:[n.children.filter(E=>E.status==="complete").length,"/",n.children.length]}),n.dependsOn.length>0&&h.jsx("span",{className:`${Se.dependencyBadge} ${y?Se.blockedBadge:""}`,title:`Depends on: ${n.dependsOn.join(", ")}`,children:y?"blocked":"dep"}),a<bN&&h.jsx("button",{onClick:E=>{E.stopPropagation(),u(Bs(d,n.id))},title:"Add child task","aria-label":"Add child task",className:Se.addChildButton,children:"+"})]}),h.jsx(os,{children:_&&v&&h.jsx(Rn.div,{initial:{height:0,opacity:0},animate:{height:"auto",opacity:1},exit:{height:0,opacity:0},transition:{duration:.15},style:{overflow:"hidden"},children:n.children.map(E=>h.jsx(M1,{node:E,depth:a+1,expandedTasks:i,toggleTask:o,selectedTaskId:r,navigate:u,projectId:d,taskStatusById:p,titleHighlights:m},E.id))})})]})}function QD(){const{projects:n,tasks:a,loadTasks:i,createProject:o,projectCreating:r}=Gt(),u=Pn(),[d,p]=S.useState(new Set),[m,g]=S.useState(new Set),[y,v]=S.useState(new Set),[_,T]=S.useState(!1),[C,E]=S.useState(""),[j,A]=S.useState(l0),[k,R]=S.useState(l0),[$,H]=S.useState(new Map),V=()=>{const K=!j;YD(K),A(K),K&&(R(!0),H(new Map))},q=(K,me)=>{const Ae=`${K}:${me}`;H(Ve=>{const mt=new Map(Ve),Tt=mt.has(Ae)?mt.get(Ae):k;return mt.set(Ae,!Tt),mt})},O=(K,me)=>{const Ae=`${K}:${me}`;return $.has(Ae)?$.get(Ae):k},ee=Qt("/tasks/:taskId/*"),ae=Qt("/projects/:projectId"),I=(ee==null?void 0:ee.params.taskId)!=="new"?ee==null?void 0:ee.params.taskId:void 0,se=ae==null?void 0:ae.params.projectId,Y=S.useRef(d);Y.current=d;const fe=S.useMemo(()=>new Map(a.map(K=>[K.id,K.status])),[a]),G=K=>{p(me=>{const Ae=new Set(me);return Ae.has(K)?Ae.delete(K):(Ae.add(K),i(K)),Ae})},U=K=>{g(me=>{const Ae=new Set(me);return Ae.has(K)?(Ae.delete(K),v(Ve=>new Set(Ve).add(K))):(Ae.add(K),v(Ve=>{const mt=new Set(Ve);return mt.delete(K),mt})),Ae})};S.useEffect(()=>{const K=new Set(a.filter(me=>me.parentTaskId).map(me=>me.parentTaskId));K.size>0&&g(me=>{const Ae=new Set(me);for(const Ve of K)y.has(Ve)||Ae.add(Ve);return Ae})},[a,y]),S.useEffect(()=>{se&&!Y.current.has(se)&&(p(K=>new Set(K).add(se)),i(se))},[se,i]);const Q=()=>{!C.trim()||r||(o(C.trim()),E(""),T(!1))},[te,we]=S.useState(""),{directMatchTaskIds:_e,treeMatchTaskIds:Ue,visibleProjectIds:Ee,matchedProjectIds:ye,titleHighlights:xe}=S.useMemo(()=>{if(!te.trim())return{directMatchTaskIds:null,treeMatchTaskIds:null,visibleProjectIds:null,matchedProjectIds:null,titleHighlights:new Map};const K=e0(n,te,qD),me=e0(a,te,FD),Ae=new Set(K.map(qe=>qe.item.id)),Ve=new Set(me.map(qe=>qe.item.id)),mt=new Map;for(const qe of me){const Be=qe.matches.find(Ln=>Ln.key==="title");Be&&mt.set(qe.item.id,Be.indices)}const Tt=new Set(Ae);for(const qe of me)Tt.add(qe.item.projectId);const Bt=new Set(Ve),Xe=new Map(a.map(qe=>[qe.id,qe]));for(const qe of[...Ve]){let Be=Xe.get(qe);for(;Be!=null&&Be.parentTaskId;)Bt.add(Be.parentTaskId),Be=Xe.get(Be.parentTaskId)}return{directMatchTaskIds:Ve,treeMatchTaskIds:Bt,visibleProjectIds:Tt,matchedProjectIds:Ae,titleHighlights:mt}},[te,n,a]),W=S.useRef(new Set);return S.useEffect(()=>{if(te.trim())for(const K of n)!d.has(K.id)&&!W.current.has(K.id)&&(W.current.add(K.id),i(K.id))},[te,n,d,i]),h.jsxs("div",{className:Se.container,children:[h.jsxs("div",{className:Se.header,children:[h.jsx("span",{children:"Projects"}),h.jsxs("div",{className:Se.headerActions,children:[h.jsx("button",{className:`${Se.groupToggle} ${j?Se.groupToggleActive:""}`,onClick:V,"aria-label":j?"Switch to tree view":"Group tasks by status","aria-pressed":j,title:j?"Switch to tree view":"Group tasks by status","data-testid":"group-by-status-toggle",children:"≡"}),h.jsx("button",{className:Se.addButton,onClick:()=>T(!_),"aria-label":"Create project",title:"Create project",children:"+"})]})]}),n.length>0&&h.jsx("input",{type:"text",value:te,onChange:K=>we(K.target.value),placeholder:"Filter...","aria-label":"Filter projects and tasks",className:Se.searchInput,"data-testid":"sidebar-search"}),_&&h.jsxs("div",{className:Se.createForm,children:[h.jsx("input",{type:"text",value:C,onChange:K=>E(K.target.value),onKeyDown:K=>K.key==="Enter"&&Q(),placeholder:"Project name...",autoFocus:!0,disabled:r,className:Se.createInput}),h.jsx("button",{onClick:Q,className:Se.createButton,disabled:r,children:r?h.jsx(s0,{size:"sm",label:"Creating project"}):"OK"})]}),r&&h.jsxs("div",{className:Se.creatingHint,children:[h.jsx(s0,{size:"sm",label:"Creating project"}),"Creating project…"]}),n.length===0&&!_&&h.jsxs("div",{className:Se.emptyCta,children:[h.jsx("button",{className:Se.ctaButton,onClick:()=>T(!0),children:"Create Project"}),h.jsx("div",{className:Se.ctaDescription,children:"Organize your work into projects"})]}),n.map(K=>{if(Ee&&!Ee.has(K.id))return null;const me=_e!==null,Ae=d.has(K.id)||me,Ve=a.filter(Be=>Be.projectId===K.id),mt=(ye==null?void 0:ye.has(K.id))??!1,Tt=me&&!mt?j?_e:Ue:null,Bt=Tt?Ve.filter(Be=>Tt.has(Be.id)):Ve,Xe=se===K.id,qe=Ae&&!j?XD(Bt):[];return h.jsxs("div",{children:[h.jsxs("div",{onClick:()=>{Xe?G(K.id):(Ae||G(K.id),u(Kl(K.id)))},className:`${Se.projectRow} ${Xe?Se.selected:""}`,children:[h.jsx("span",{className:`${Se.expandArrow} ${Ae?Se.expanded:""}`,children:"▸"}),h.jsx("span",{className:Se.projectName,title:K.name,children:K.name}),h.jsx("span",{className:Se.taskCount,children:Ve.length>0&&`${Ve.filter(Be=>Be.status==="complete").length}/${Ve.length}`}),h.jsx("button",{onClick:Be=>{Be.stopPropagation(),u(Bs(K.id))},title:"New task",className:Se.newTaskButton,children:"+"})]}),h.jsx(os,{children:Ae&&h.jsxs(Rn.div,{initial:{height:0,opacity:0},animate:{height:"auto",opacity:1},exit:{height:0,opacity:0},transition:{duration:.2,ease:"easeInOut"},style:{overflow:"hidden"},children:[j?KD(Bt,fe).map(Be=>h.jsx(ZD,{group:Be,isExpanded:O(K.id,Be.status),onToggle:()=>q(K.id,Be.status),selectedTaskId:I,navigate:u,titleHighlights:xe},Be.status)):qe.map(Be=>h.jsx(M1,{node:Be,depth:0,expandedTasks:m,toggleTask:U,selectedTaskId:I,navigate:u,projectId:K.id,taskStatusById:fe,titleHighlights:xe},Be.id)),Bt.length===0&&h.jsx("div",{className:Se.emptyTaskCta,children:h.jsx("button",{className:Se.createTaskLink,onClick:()=>u(Bs(K.id)),children:"+ Create Task"})})]})})]},K.id)})]})}const JD="_container_lovia_1",WD="_content_lovia_40",o0={container:JD,content:WD},ek=320,R1=220,O1=600,B1="grackle-sidebar-width";function tk(){try{const n=localStorage.getItem(B1);if(n!==null){const a=Number(n);if(Number.isFinite(a)&&a>=R1&&a<=O1)return a}}catch{}return ek}function nk(n){try{localStorage.setItem(B1,String(n))}catch{}}function ak(){const[n]=S.useState(tk),a=S.useRef(null);return S.useEffect(()=>{const i=a.current;if(!i)return;const o=new ResizeObserver(r=>{for(const u of r){const d=u.borderBoxSize[0];if(d){const p=Math.round(d.inlineSize);p>=R1&&p<=O1&&nk(p)}}});return o.observe(i),()=>{o.disconnect()}},[]),h.jsx("div",{className:o0.container,ref:a,"data-testid":"sidebar",style:{width:n},children:h.jsx("div",{className:o0.content,children:h.jsx(QD,{})})})}const sk="_bar_8ghh5_1",ik="_barColumn_8ghh5_32",lk="_barRow_8ghh5_63",ok="_input_8ghh5_74",rk="_inputSmall_8ghh5_109",ck="_select_8ghh5_178",uk="_btnPrimary_8ghh5_214",dk="_btnDanger_8ghh5_245",fk="_btnGhost_8ghh5_284",hk="_badge_8ghh5_312",pk="_statusText_8ghh5_322",mk="_statusCompleted_8ghh5_327",gk="_statusFailed_8ghh5_331",yk="_statusBlocked_8ghh5_335",vk="_hintText_8ghh5_340",bk="_creatingHint_8ghh5_345",Sk="_errorHint_8ghh5_353",_k="_disconnectHint_8ghh5_359",re={bar:sk,barColumn:ik,barRow:lk,input:ok,inputSmall:rk,select:ck,btnPrimary:uk,btnDanger:dk,btnGhost:fk,badge:hk,statusText:pk,statusCompleted:mk,statusFailed:gk,statusBlocked:yk,hintText:vk,creatingHint:bk,errorHint:Sk,disconnectHint:_k};function r0({value:n,onChange:a,testId:i}){return h.jsxs("select",{"data-testid":i,value:n,onChange:o=>a(o.target.value),className:re.select,children:[h.jsx("option",{value:"claude-code",children:"claude-code"}),h.jsx("option",{value:"codex",children:"codex"}),h.jsx("option",{value:"copilot",children:"copilot"}),h.jsx("option",{value:"stub",children:"stub"})]})}function c0(n,a){if(!n)return!1;const i=a.find(o=>o.id===n);return i!==void 0&&(i.status==="disconnected"||i.status==="error")}function u0({environmentId:n,onReconnect:a}){return h.jsxs(h.Fragment,{children:[h.jsx("span",{className:re.disconnectHint,"data-testid":"env-disconnect-hint",children:"Environment unavailable"}),h.jsx("button",{type:"button",onClick:()=>a(n),className:re.btnGhost,"data-testid":"reconnect-btn",title:"Reconnect the environment to resume messaging",children:"Reconnect"})]})}function xk(){const{spawn:n,sendInput:a,kill:i,sessions:o,tasks:r,environments:u,personas:d,addEnvironment:p,provisionEnvironment:m,codespaces:g,codespaceError:y,codespaceListError:v,codespaceCreating:_,listCodespaces:T,createCodespace:C}=Gt(),{showToast:E}=ao(),j=Pn(),[A]=Rf(),k=Qt("/sessions/:sessionId"),R=Qt("/tasks/:taskId"),$=Qt("/tasks/:taskId/stream"),H=Qt("/tasks/:taskId/findings"),V=Qt("/tasks/:taskId/edit"),q=Qt("/sessions/new"),O=Qt("/environments/new"),ee=Qt("/projects/:projectId"),ae=Qt("/tasks/new"),I=Qt("/"),se=Qt("/settings/*"),Y=k==null?void 0:k.params.sessionId,fe=(R==null?void 0:R.params.taskId)??($==null?void 0:$.params.taskId)??(H==null?void 0:H.params.taskId),G=!!q,U=!!O,Q=!!ee,te=!!ae,we=!!V,_e=!!I&&!G&&!U&&!Q&&!te,Ue=!!se,Ee=G?A.get("env")??"":"",ye=G?A.get("runtime")??"claude-code":"claude-code",[xe,W]=S.useState(""),[K,me]=S.useState(G?ye:"claude-code"),[Ae,Ve]=S.useState(""),mt=et=>{if(Ve(et),et){const je=d.find(yt=>yt.id===et);je!=null&&je.runtime&&me(je.runtime)}},[Tt,Bt]=S.useState(""),[Xe,qe]=S.useState("local"),[Be,Ln]=S.useState("claude-code"),[Un,ea]=S.useState(""),[en,ta]=S.useState(""),[J,ne]=S.useState(""),[oe,ue]=S.useState(""),[be,Te]=S.useState(""),[Qe,De]=S.useState(""),[Mt,wt]=S.useState(""),[it,tn]=S.useState(""),[rt,We]=S.useState(""),[Zt,gt]=S.useState("pick");S.useEffect(()=>{G&&me(ye)},[G,ye]);const qt=Y?o.find(et=>et.id===Y):void 0,Ft=fe?r.find(et=>et.id===fe):void 0,Hi=(Ft==null?void 0:Ft.latestSessionId)||void 0,na=Hi?o.find(et=>et.id===Hi):void 0,us=Ft?Ft.dependsOn.some(et=>{const je=r.find(yt=>yt.id===et);return je&&je.status!=="complete"}):!1;if(_e||Ue)return h.jsx("div",{className:re.bar,children:h.jsx("span",{className:re.hintText,children:"Select a session or click + to start"})});if(we||te)return h.jsx(h.Fragment,{});if(U){const et=ie=>{if(!ie.trim())return!0;const Lt=Number(ie);return Number.isInteger(Lt)&&Lt>=1&&Lt<=65535},je=()=>!(!Tt.trim()||Xe==="ssh"&&!Un.trim()||Xe==="codespace"&&!Qe.trim()||(Xe==="local"||Xe==="ssh")&&!et(en)),yt=()=>{if(!je())return;const ie={};if(Xe==="local"){if(Un.trim()&&(ie.host=Un.trim()),en.trim()){const Lt=Number(en);Number.isInteger(Lt)&&(ie.port=Lt)}}else if(Xe==="ssh"){if(ie.host=Un.trim(),J.trim()&&(ie.user=J.trim()),en.trim()){const Lt=Number(en);Number.isInteger(Lt)&&(ie.sshPort=Lt)}Mt.trim()&&(ie.identityFile=Mt.trim())}else Xe==="docker"?(oe.trim()&&(ie.image=oe.trim()),be.trim()&&(ie.repo=be.trim())):Xe==="codespace"&&(ie.codespaceName=Qe.trim());p(Tt.trim(),Xe,ie,Be),E("Environment added successfully","success"),Bt(""),qe("local"),Ln("claude-code"),ea(""),ta(""),ne(""),ue(""),Te(""),De(""),wt(""),tn(""),We(""),gt("pick"),j(ki,{replace:!0})};return h.jsxs("div",{className:re.barColumn,children:[h.jsxs("div",{className:re.barRow,children:[h.jsx("span",{className:re.badge,children:"new env"}),h.jsx("input",{type:"text",value:Tt,onChange:ie=>Bt(ie.target.value),placeholder:"Environment name...",autoFocus:!0,className:re.input}),h.jsxs("select",{value:Xe,onChange:ie=>{qe(ie.target.value),ie.target.value==="codespace"&&(T(),gt("pick"),De(""))},className:re.select,children:[h.jsx("option",{value:"local",children:"local"}),h.jsx("option",{value:"ssh",children:"ssh"}),h.jsx("option",{value:"docker",children:"docker"}),h.jsx("option",{value:"codespace",children:"codespace"})]}),h.jsx(r0,{value:Be,onChange:Ln,testId:"new-environment-runtime-select"}),h.jsx("button",{onClick:yt,disabled:!je(),className:re.btnPrimary,children:"Add"})]}),h.jsxs("div",{className:re.barRow,children:[Xe==="local"&&h.jsxs(h.Fragment,{children:[h.jsx("input",{type:"text",value:Un,onChange:ie=>ea(ie.target.value),placeholder:"Host (optional)...",className:re.inputSmall}),h.jsx("input",{type:"number",min:1,max:65535,value:en,onChange:ie=>ta(ie.target.value),placeholder:"Port (optional)...",className:re.inputSmall})]}),Xe==="ssh"&&h.jsxs(h.Fragment,{children:[h.jsx("input",{type:"text",value:Un,onChange:ie=>ea(ie.target.value),placeholder:"Host (required)...",className:re.inputSmall}),h.jsx("input",{type:"text",value:J,onChange:ie=>ne(ie.target.value),placeholder:"User (optional)...",className:re.inputSmall}),h.jsx("input",{type:"number",min:1,max:65535,value:en,onChange:ie=>ta(ie.target.value),placeholder:"SSH port (optional)...",className:re.inputSmall}),h.jsx("input",{type:"text",value:Mt,onChange:ie=>wt(ie.target.value),placeholder:"Identity file (optional)...",className:re.inputSmall})]}),Xe==="docker"&&h.jsxs(h.Fragment,{children:[h.jsx("input",{type:"text",value:oe,onChange:ie=>ue(ie.target.value),placeholder:"Image (optional)...",className:re.inputSmall}),h.jsx("input",{type:"text",value:be,onChange:ie=>Te(ie.target.value),placeholder:"Repo (optional)...",className:re.inputSmall})]}),Xe==="codespace"&&Zt==="pick"&&h.jsxs(h.Fragment,{children:[!v&&h.jsxs("select",{value:Qe,onChange:ie=>{ie.target.value==="__create__"?(gt("create"),De("")):(De(ie.target.value),ie.target.value&&!Tt.trim()&&Bt(ie.target.value))},disabled:_,className:re.select,children:[h.jsx("option",{value:"",children:"Select a codespace..."}),g.map(ie=>h.jsxs("option",{value:ie.name,children:[ie.name," (",ie.repository,") — ",ie.state]},ie.name)),h.jsx("option",{value:"__create__",children:"Create new from repo..."})]}),_&&h.jsx("span",{className:re.creatingHint,children:"Creating codespace..."}),v&&h.jsxs(h.Fragment,{children:[h.jsx("span",{className:re.errorHint,children:v}),h.jsx("input",{type:"text",value:Qe,onChange:ie=>De(ie.target.value),placeholder:"Or enter codespace name manually...",className:re.inputSmall})]}),y&&!v&&h.jsx("span",{className:re.errorHint,children:y})]}),Xe==="codespace"&&Zt==="create"&&h.jsxs(h.Fragment,{children:[h.jsx("input",{type:"text",value:it,onChange:ie=>tn(ie.target.value),placeholder:"owner/repo",className:re.inputSmall}),h.jsx("input",{type:"text",value:rt,onChange:ie=>We(ie.target.value),placeholder:"Machine type (optional)...",className:re.inputSmall}),h.jsx("button",{onClick:()=>{it.trim()&&(C(it.trim(),rt.trim()||void 0),gt("pick"),tn(""),We(""))},disabled:!it.trim(),className:re.btnPrimary,children:"Create"}),h.jsx("button",{onClick:()=>{gt("pick"),tn(""),We("")},className:re.btnGhost,children:"Cancel"})]})]})]})}if(Q)return h.jsx("div",{className:re.bar,children:h.jsx("span",{className:re.hintText,children:"Select a task or click + to create one"})});if(fe&&Ft){if(Ft.status==="not_started"){const et=us?Ft.dependsOn.map(je=>r.find(yt=>yt.id===je)).filter(je=>je&&je.status!=="complete").map(je=>je.title):[];return h.jsx("div",{className:re.bar,children:us?h.jsxs("span",{className:re.statusBlocked,children:["Blocked by: ",et.join(", ")]}):h.jsx("span",{className:re.hintText,children:"Use the buttons above to start or manage this task"})})}if(Ft.status==="working"||Ft.status==="paused"){if((na==null?void 0:na.status)==="idle"){const je=na.environmentId,yt=c0(je,u),ie=Lt=>{Lt.preventDefault();const aa=Ft.latestSessionId||Hi;!xe.trim()||!aa||yt||(a(aa,xe),W(""))};return h.jsxs("form",{onSubmit:ie,className:re.bar,children:[yt&&je&&h.jsx(u0,{environmentId:je,onReconnect:m}),h.jsx("input",{type:"text",value:xe,onChange:Lt=>W(Lt.target.value),placeholder:"Type a message...",autoFocus:!yt,disabled:yt,className:re.input}),h.jsx("span",{title:yt?"Environment is unavailable — reconnect first":void 0,children:h.jsx("button",{type:"submit",disabled:!xe.trim()||yt,className:re.btnPrimary,children:"Send"})})]})}return h.jsx("div",{className:re.bar,children:h.jsx("input",{type:"text",disabled:!0,placeholder:"Agent is working...",className:re.input})})}if(Ft.status==="complete")return h.jsxs("div",{className:re.bar,children:[h.jsx("span",{className:`${re.statusText} ${re.statusCompleted}`,children:"Task completed"}),h.jsx("button",{onClick:()=>j(Bs(Ft.projectId)),className:re.btnPrimary,children:"+ New Task"})]});if(Ft.status==="failed")return h.jsx("div",{className:re.bar,children:h.jsx("span",{className:`${re.statusText} ${re.statusFailed}`,children:"Task failed"})})}if(G){const et=je=>{je.preventDefault(),!(!xe.trim()||!Ee)&&(n(Ee,xe,void 0,K,Ae),E("Session started","success"),W(""),Ve(""))};return h.jsxs("form",{onSubmit:et,className:re.bar,children:[h.jsx("span",{className:re.badge,children:"new chat"}),h.jsx("input",{type:"text",value:xe,onChange:je=>W(je.target.value),placeholder:"Enter prompt...",autoFocus:!0,className:re.input}),h.jsx(r0,{value:K,onChange:me,testId:"new-chat-runtime-select"}),h.jsxs("select",{value:Ae,onChange:je=>mt(je.target.value),className:re.select,children:[h.jsx("option",{value:"",children:"No persona"}),d.map(je=>h.jsx("option",{value:je.id,children:je.name},je.id))]}),h.jsx("button",{type:"submit",disabled:!xe.trim()||!Ee,className:re.btnPrimary,children:"Go"})]})}if(Y){const et=(qt==null?void 0:qt.status)==="running",je=(qt==null?void 0:qt.status)==="idle",yt=qt!==void 0&&["completed","failed","interrupted"].includes(qt.status);if(et)return h.jsxs("div",{className:re.bar,children:[h.jsx("input",{type:"text",disabled:!0,placeholder:"Agent is working...",className:re.input}),h.jsx("button",{onClick:()=>i(Y),className:re.btnDanger,title:"Stop session",children:"Stop"})]});if(je){const ie=c0(qt.environmentId,u),Lt=aa=>{aa.preventDefault(),!(!xe.trim()||ie)&&(a(Y,xe),W(""))};return h.jsxs("form",{onSubmit:Lt,className:re.bar,children:[ie&&qt.environmentId&&h.jsx(u0,{environmentId:qt.environmentId,onReconnect:m}),h.jsx("input",{type:"text",value:xe,onChange:aa=>W(aa.target.value),placeholder:"Type a message...",autoFocus:!ie,disabled:ie,className:re.input}),h.jsx("span",{title:ie?"Environment is unavailable — reconnect first":void 0,children:h.jsx("button",{type:"submit",disabled:!xe.trim()||ie,className:re.btnPrimary,children:"Send"})}),h.jsx("button",{type:"button",onClick:()=>i(Y),className:re.btnDanger,title:"Stop session",children:"Stop"})]})}if(yt)return h.jsxs("div",{className:re.bar,children:[h.jsxs("span",{className:`${re.statusText} ${re.hintText}`,children:["Session ",qt.status]}),h.jsx("button",{onClick:()=>j(L0(qt.environmentId,qt.runtime)),className:re.btnPrimary,children:"+ New Chat"})]})}return h.jsx("div",{className:re.bar,children:h.jsx("span",{className:re.hintText,children:"Loading..."})})}const Tk="_toast_da8ll_1",Ek="_success_da8ll_18",Ck="_icon_da8ll_22",Ak="_error_da8ll_25",jk="_warning_da8ll_32",Nk="_info_da8ll_38",wk="_message_da8ll_53",Dk="_close_da8ll_60",Bl={toast:Tk,success:Ek,icon:Ck,error:Ak,warning:jk,info:Nk,message:wk,close:Dk},kk={success:"✓",error:"✕",warning:"⚠",info:"ℹ"};function Mk({toast:n,onDismiss:a}){return S.useEffect(()=>{const i=setTimeout(()=>a(n.id),n.duration);return()=>clearTimeout(i)},[n.id,n.duration,a]),h.jsxs(Rn.div,{className:`${Bl.toast} ${Bl[n.variant]}`,role:"status",initial:{opacity:0,y:-16,scale:.94},animate:{opacity:1,y:0,scale:1},exit:{opacity:0,y:-8,scale:.94},transition:{duration:.2,ease:"easeOut"},layout:!0,children:[h.jsx("span",{className:Bl.icon,"aria-hidden":"true",children:kk[n.variant]}),h.jsx("span",{className:Bl.message,children:n.message}),h.jsx("button",{type:"button",className:Bl.close,onClick:()=>a(n.id),"aria-label":"Dismiss notification",children:"×"})]})}const Rk="_container_qqse2_1",Ok={container:Rk};function Bk(){const{toasts:n,dismissToast:a}=ao();return h.jsx("div",{className:Ok.container,"data-testid":"toast-container",children:h.jsx(os,{children:n.map(i=>h.jsx(Mk,{toast:i,onDismiss:a},i.id))})})}function Lk(n,a){const i=S.useRef(null);S.useEffect(()=>{const o=i.current;if(i.current=n,o===null)return;const r=new Map;for(const d of o)r.set(d.id,d);const u=new Set;for(const d of n){u.add(d.id);const p=r.get(d.id);if(p&&p.status!==d.status&&d.status!=="sleeping"){if(d.status==="connecting"){a("Provisioning environment…","info");continue}d.status==="connected"?a("Environment connected","success"):d.status==="error"?a("Environment provision failed","error"):d.status==="disconnected"&&(p.status==="connected"?a("Environment disconnected","warning"):a("Environment stopped","info"))}}for(const d of o)u.has(d.id)||a("Environment removed","info")},[n,a])}const Uk="_panelContainer_yidfr_1",zk="_emptyState_yidfr_8",Ik="_fadeIn_yidfr_1",Vk="_projectSummary_yidfr_17",Hk="_projectSummaryTitle_yidfr_28",Pk="_projectSummarySubtitle_yidfr_32",Gk="_header_yidfr_36",qk="_headerInfo_yidfr_69",Fk="_killButton_yidfr_75",$k="_headerTitle_yidfr_104",Yk="_headerActions_yidfr_119",Kk="_taskStatusBadge_yidfr_126",Zk="_taskBranch_yidfr_135",Xk="_taskBlockedBadge_yidfr_141",Qk="_btnPrimary_yidfr_149",Jk="_btnDanger_yidfr_180",Wk="_btnGhost_yidfr_219",eM="_rejectInput_yidfr_245",tM="_tabBar_yidfr_275",nM="_tab_yidfr_275",aM="_active_yidfr_301",sM="_eventScroll_yidfr_306",iM="_tabContent_yidfr_312",lM="_noContext_yidfr_317",oM="_overviewContent_yidfr_323",rM="_overviewDashboard_yidfr_332",cM="_overviewHero_yidfr_338",uM="_statusBadge_yidfr_345",dM="_statusPending_yidfr_357",fM="_statusAssigned_yidfr_362",hM="_statusInProgress_yidfr_367",pM="_statusReview_yidfr_372",mM="_statusDone_yidfr_377",gM="_statusFailed_yidfr_382",yM="_statusWaitingInput_yidfr_387",vM="_overviewBranchPill_yidfr_392",bM="_branchLink_yidfr_407",SM="_overviewSection_yidfr_418",_M="_overviewLabel_yidfr_424",xM="_overviewValue_yidfr_431",TM="_overviewMuted_yidfr_436",EM="_overviewMarkdown_yidfr_442",CM="_envRow_yidfr_511",AM="_envDot_yidfr_517",jM="_envDotGreen_yidfr_524",NM="_envDotYellow_yidfr_528",wM="_envDotRed_yidfr_532",DM="_envDotGray_yidfr_536",kM="_depList_yidfr_540",MM="_depItem_yidfr_546",RM="_depBlocked_yidfr_553",OM="_depDone_yidfr_557",BM="_timeline_yidfr_561",LM="_timelineRow_yidfr_567",UM="_timelineKey_yidfr_574",zM="_timelineValue_yidfr_580",IM="_timelineDelta_yidfr_584",VM="_reviewNotes_yidfr_595",HM="_overviewDescription_yidfr_606",PM="_waitingMessage_yidfr_612",GM="_errorMessage_yidfr_616",qM="_eventOverflowWarning_yidfr_620",FM="_attemptSelector_yidfr_634",$M="_attemptLabel_yidfr_650",YM="_attemptButton_yidfr_654",KM="_attemptActive_yidfr_671",ZM="_attemptStatus_yidfr_677",XM="_emptyCta_yidfr_683",QM="_ctaTitle_yidfr_695",JM="_ctaDescription_yidfr_701",WM="_ctaButton_yidfr_708",eR="_ctaLink_yidfr_743",tR="_projectHeader_yidfr_757",nR="_projectName_yidfr_782",aR="_projectMeta_yidfr_795",sR="_metaRow_yidfr_803",iR="_metaLabel_yidfr_816",lR="_metaValue_yidfr_831",oR="_metaPlaceholder_yidfr_841",rR="_editButton_yidfr_846",cR="_editInput_yidfr_862",uR="_editTextarea_yidfr_894",dR="_editSelect_yidfr_930",fR="_archiveButton_yidfr_963",hR="_repoLink_yidfr_993",pR="_metaValueClickable_yidfr_1003",mR="_editHint_yidfr_1022",gR="_editError_yidfr_1031",yR="_editInputInvalid_yidfr_1038",vR="_unsavedDot_yidfr_1043",bR="_metaToggle_yidfr_1051",SR="_metaToggleArrow_yidfr_1072",_R="_metaToggleArrowOpen_yidfr_1077",xR="_progressBarContainer_yidfr_1081",TR="_progressBar_yidfr_1081",ER="_progressFill_yidfr_1097",CR="_progressLabel_yidfr_1104",AR="_metaTimestamps_yidfr_1111",jR="_metaTimestamp_yidfr_1111",NR="_worktreeToggle_yidfr_1133",wR="_editFieldWrapper_yidfr_1148",D={panelContainer:Uk,emptyState:zk,fadeIn:Ik,projectSummary:Vk,projectSummaryTitle:Hk,projectSummarySubtitle:Pk,header:Gk,headerInfo:qk,killButton:Fk,headerTitle:$k,headerActions:Yk,taskStatusBadge:Kk,taskBranch:Zk,taskBlockedBadge:Xk,btnPrimary:Qk,btnDanger:Jk,btnGhost:Wk,rejectInput:eM,tabBar:tM,tab:nM,active:aM,eventScroll:sM,tabContent:iM,noContext:lM,overviewContent:oM,overviewDashboard:rM,overviewHero:cM,statusBadge:uM,statusPending:dM,statusAssigned:fM,statusInProgress:hM,statusReview:pM,statusDone:mM,statusFailed:gM,statusWaitingInput:yM,overviewBranchPill:vM,branchLink:bM,overviewSection:SM,overviewLabel:_M,overviewValue:xM,overviewMuted:TM,overviewMarkdown:EM,envRow:CM,envDot:AM,envDotGreen:jM,envDotYellow:NM,envDotRed:wM,envDotGray:DM,depList:kM,depItem:MM,depBlocked:RM,depDone:OM,timeline:BM,timelineRow:LM,timelineKey:UM,timelineValue:zM,timelineDelta:IM,reviewNotes:VM,overviewDescription:HM,waitingMessage:PM,errorMessage:GM,eventOverflowWarning:qM,attemptSelector:FM,attemptLabel:$M,attemptButton:YM,attemptActive:KM,attemptStatus:ZM,emptyCta:XM,ctaTitle:QM,ctaDescription:JM,ctaButton:WM,ctaLink:eR,projectHeader:tR,projectName:nR,projectMeta:aR,metaRow:sR,metaLabel:iR,metaValue:lR,metaPlaceholder:oR,editButton:rR,editInput:cR,editTextarea:uR,editSelect:dR,archiveButton:fR,repoLink:hR,metaValueClickable:pR,editHint:mR,editError:gR,editInputInvalid:yR,unsavedDot:vR,metaToggle:bR,metaToggleArrow:SR,metaToggleArrowOpen:_R,progressBarContainer:xR,progressBar:TR,progressFill:ER,progressLabel:CR,metaTimestamps:AR,metaTimestamp:jR,worktreeToggle:NR,editFieldWrapper:wR};function DR(){const{projects:n,createProject:a}=Gt();return n.length===0?h.jsxs("div",{className:D.emptyCta,children:[h.jsx("div",{className:D.ctaTitle,children:"Welcome to Grackle"}),h.jsx("div",{className:D.ctaDescription,children:"Organize your work into projects and let agents tackle the tasks."}),h.jsx("button",{className:D.ctaButton,onClick:()=>{const i=window.prompt("Project name:");i!=null&&i.trim()&&a(i.trim())},children:"Create Your First Project"})]}):h.jsx("div",{className:D.emptyState,children:"Select a project or task to get started"})}function kR(n,a){const i=[];let o=n;const r=new Set;for(;o&&a.has(o)&&!r.has(o);){r.add(o);const u=a.get(o);i.unshift(u),o=u.parentTaskId||void 0}return i}const Ls={label:"Home",url:"/"};function MR(n){return n?[Ls,{label:"Settings",url:"/settings"},{label:n,url:void 0}]:[Ls,{label:"Settings",url:void 0}]}function RR(){return[Ls,{label:"New Environment",url:void 0}]}function OR(){return[Ls,{label:"New Chat",url:void 0}]}function BR(n){return[Ls,{label:`Session ${n.slice(0,8)}`,url:void 0}]}function LR(n,a){const i=a.find(o=>o.id===n);return[Ls,{label:(i==null?void 0:i.name)??"Project",url:void 0}]}function UR(n,a,i){const o=kR(n,i),r=i.get(n),u=r==null?void 0:r.projectId,d=u?a.find(g=>g.id===u):void 0,p=[Ls];d&&p.push({label:d.name,url:Kl(d.id)});for(let g=0;g<o.length-1;g++)p.push({label:o[g].title,url:as(o[g].id)});const m=o[o.length-1];return p.push({label:(m==null?void 0:m.title)??n,url:void 0}),p}function zR(){const n=OR();return h.jsxs("div",{className:D.panelContainer,children:[h.jsx(Vi,{segments:n}),h.jsx("div",{className:D.emptyState,children:"Enter a prompt below to start a new session"})]})}function L1(n){const a=[];for(const i of n){const o=a[a.length-1];i.eventType==="text"&&(o==null?void 0:o.eventType)==="text"?a[a.length-1]={...o,content:o.content+i.content}:a.push(i)}return a}function U1(n){const a=new Map;for(const u of n)if(u.raw)try{a.set(u,JSON.parse(u.raw))}catch{}const i=new Map;for(const u of n){if(u.eventType!=="tool_use")continue;const d=a.get(u);if(!(!d||typeof d.id!="string"))try{const p=JSON.parse(u.content);i.set(d.id,{tool:p.tool,args:p.args})}catch{}}const o=new Set;return n.map(u=>{if(u.eventType!=="tool_result")return u;const d=a.get(u);if(!d||typeof d.tool_use_id!="string")return u;const p=i.get(d.tool_use_id);return p?(o.add(d.tool_use_id),{...u,toolUseCtx:p}):u}).filter(u=>{if(u.eventType!=="tool_use")return!0;const d=a.get(u);return d&&typeof d.id=="string"?!o.has(d.id):!0})}function IR({sessionId:n,session:a,isActive:i,onKill:o}){return h.jsxs("div",{className:D.header,children:[h.jsxs("span",{children:["Session: ",n.slice(0,8),a&&` | ${a.runtime} | ${a.status}`]}),h.jsxs("span",{className:D.headerInfo,children:[a&&h.jsx("span",{children:a.prompt.length>60?a.prompt.slice(0,60)+"...":a.prompt}),i&&h.jsx("button",{onClick:()=>o(n),title:"Stop session",className:D.killButton,children:"×"})]})]})}function VR({eventsDropped:n}){return n<=0?h.jsx(h.Fragment,{}):h.jsxs("div",{className:D.eventOverflowWarning,role:"alert",children:["⚠ ",n.toLocaleString()," older event",n===1?"":"s"," were dropped — only the most recent 5,000 are shown. Full history is available in the session log."]})}function HR({sessionEvents:n,session:a,eventsDropped:i,scrollRef:o}){const r=a&&["completed","failed","interrupted"].includes(a.status),u=r?`Session ${a.status} with no events recorded.`:"Waiting for events...";return h.jsxs("div",{ref:o,className:D.eventScroll,children:[n.length===0&&h.jsx("div",{className:r?D.errorMessage:D.waitingMessage,children:u}),h.jsx(VR,{eventsDropped:i}),n.map((d,p)=>h.jsx(N1,{event:d,toolUseCtx:d.toolUseCtx},`${d.sessionId}-${d.timestamp}-${p}`))]})}function PR(){const{sessionId:n}=Qr(),{events:a,eventsDropped:i,sessions:o,kill:r,loadSessionEvents:u}=Gt(),d=S.useRef(null),p=S.useRef(void 0),m=BR(n),g=o.find(_=>_.id===n)??void 0,y=S.useMemo(()=>{const _=n?a.filter(T=>T.sessionId===n):[];return U1(L1(_))},[a,n]);if(S.useEffect(()=>{n&&n!==p.current&&(p.current=n,u(n))},[n,u]),S.useEffect(()=>{d.current&&(d.current.scrollTop=d.current.scrollHeight)},[y.length]),!n)return h.jsx("div",{className:D.emptyState,children:"No session selected"});const v=(g==null?void 0:g.status)==="running"||(g==null?void 0:g.status)==="idle";return h.jsxs("div",{className:D.panelContainer,children:[h.jsx(Vi,{segments:m}),h.jsx(IR,{sessionId:n,session:g,isActive:v,onKill:r}),h.jsx(HR,{sessionEvents:y,session:g,eventsDropped:i,scrollRef:d})]})}const d0=220,f0=70,GR=40,qR=60,FR="hierarchy",$R="dependency";function YR(n){return S.useMemo(()=>{if(n.length===0)return{nodes:[],edges:[]};const a=new fy.graphlib.Graph({multigraph:!0});a.setDefaultEdgeLabel(()=>({})),a.setGraph({rankdir:"TB",nodesep:GR,ranksep:qR});const i=new Map(n.map(d=>[d.id,d])),o=new Map;for(const d of n)if(d.parentTaskId&&i.has(d.parentTaskId)){const p=o.get(d.parentTaskId)||[];p.push(d),o.set(d.parentTaskId,p)}for(const d of n)a.setNode(d.id,{width:d0,height:f0});const r=[];for(const d of n){if(d.parentTaskId&&i.has(d.parentTaskId)){const p=`hierarchy-${d.parentTaskId}-${d.id}`;a.setEdge(d.parentTaskId,d.id,{},p),r.push({id:p,source:d.parentTaskId,target:d.id,type:"smoothstep",data:{edgeType:FR},style:{stroke:"var(--accent-green)",strokeWidth:2},animated:!1})}for(const p of d.dependsOn)if(i.has(p)){const m=`dependency-${p}-${d.id}`;a.setEdge(p,d.id,{},m),r.push({id:m,source:p,target:d.id,type:"smoothstep",data:{edgeType:$R},style:{stroke:"var(--text-tertiary)",strokeWidth:1.5,strokeDasharray:"6 3"},animated:!1})}}return fy.layout(a),{nodes:n.map(d=>{const p=a.node(d.id),m=o.get(d.id)||[];return{id:d.id,type:"task",position:{x:p.x-d0/2,y:p.y-f0/2},data:{task:d,childCount:m.length,doneChildCount:m.filter(g=>g.status==="complete").length,hasDependencies:d.dependsOn.length>0}}}),edges:r}},[n])}const KR="_dagContainer_js4w6_1",ZR="_taskNode_js4w6_26",XR="_taskNodeBorder_js4w6_54",QR="_taskNodeContent_js4w6_60",JR="_taskNodeHeader_js4w6_70",WR="_taskNodeIcon_js4w6_77",e3="_taskNodeTitle_js4w6_82",t3="_taskNodeBadges_js4w6_90",n3="_childBadge_js4w6_95",a3="_depBadge_js4w6_107",s3="_handle_js4w6_119",i3="_emptyCta_js4w6_126",l3="_ctaDescription_js4w6_137",o3="_ctaButton_js4w6_144",Jt={dagContainer:KR,taskNode:ZR,taskNodeBorder:XR,taskNodeContent:QR,taskNodeHeader:JR,taskNodeIcon:WR,taskNodeTitle:e3,taskNodeBadges:t3,childBadge:n3,depBadge:a3,handle:s3,emptyCta:i3,ctaDescription:l3,ctaButton:o3};function r3({data:n}){const{task:a,childCount:i,doneChildCount:o,hasDependencies:r}=n,u=ls(a.status);return h.jsxs("div",{className:Jt.taskNode,"data-task-id":a.id,"data-task-title":a.title,children:[h.jsx(hy,{type:"target",position:py.Top,className:Jt.handle}),h.jsx("div",{className:Jt.taskNodeBorder,style:{backgroundColor:u.color}}),h.jsxs("div",{className:Jt.taskNodeContent,children:[h.jsxs("div",{className:Jt.taskNodeHeader,children:[h.jsx("span",{className:Jt.taskNodeIcon,style:{color:u.color},children:u.icon}),h.jsx("span",{className:Jt.taskNodeTitle,children:a.title})]}),h.jsxs("div",{className:Jt.taskNodeBadges,children:[i>0&&h.jsxs("span",{className:Jt.childBadge,children:[o,"/",i]}),r&&h.jsx("span",{className:Jt.depBadge,children:"dep"})]})]}),h.jsx(hy,{type:"source",position:py.Bottom,className:Jt.handle})]})}const c3=lD,u3={task:r3};function d3({projectId:n}){const{tasks:a}=Gt(),i=Pn(),{resolvedThemeId:o}=G0(),r=S.useMemo(()=>a.filter(y=>y.projectId===n),[a,n]),{nodes:u,edges:d}=YR(r),p=S.useMemo(()=>{const y=getComputedStyle(document.documentElement),v={};for(const[_,T]of Object.entries(c3))v[_]=y.getPropertyValue(T).trim()||"#6b7a8d";return v},[o]),m=S.useCallback((y,v)=>{i(as(v.id))},[i]),g=S.useCallback(y=>{const v=y.data;return p[v.task.status]||p.pending},[p]);return r.length===0?h.jsxs("div",{className:Jt.emptyCta,children:[h.jsx("button",{className:Jt.ctaButton,onClick:()=>i(Bs(n)),children:"Create Task"}),h.jsx("div",{className:Jt.ctaDescription,children:"Create tasks to see the dependency graph"})]}):h.jsx("div",{className:Jt.dagContainer,children:h.jsxs(ax,{nodes:u,edges:d,nodeTypes:u3,onNodeClick:m,fitView:!0,fitViewOptions:{padding:.2},minZoom:.3,maxZoom:2,children:[h.jsx(sx,{variant:ix.Dots,gap:24,size:1,color:"var(--text-disabled)"}),h.jsx(lx,{showInteractive:!1}),h.jsx(ox,{nodeColor:g,maskColor:"var(--bg-overlay)",style:{background:"var(--bg-inset)"}})]})})}function f3({tasks:n,taskStatusById:a,sessionStatusByTaskId:i}){const o=new Map;for(const u of n)if(u.parentTaskId){const d=o.get(u.parentTaskId);d?d.push(u):o.set(u.parentTaskId,[u])}const r=new Map(i0.map(u=>[u,[]]));for(const u of n){const d=gh(u.status),p=u.dependsOn.length>0&&u.dependsOn.some(C=>a.get(C)!=="complete"),m=o.get(u.id)??[],g=m.length,y=m.filter(C=>C.status==="complete").length;let v;if(d==="paused"&&i){const C=i.get(u.id);C==="idle"?v="Needs input":C==="completed"&&(v="Ready to complete")}const _={task:u,isBlocked:p,childCount:g,doneChildCount:y,pausedSubBadge:v},T=r.get(d);T?T.push(_):r.get("not_started").push(_)}for(const u of r.values())u.sort((d,p)=>d.task.sortOrder-p.task.sortOrder);return i0.map(u=>{const d=ls(u);return{status:u,label:d.label,style:d,tasks:r.get(u)??[]}})}const h3="_boardContainer_1c4y1_1",p3="_column_1c4y1_17",m3="_columnHeader_1c4y1_34",g3="_columnIcon_1c4y1_47",y3="_columnLabel_1c4y1_52",v3="_columnCount_1c4y1_57",b3="_cardList_1c4y1_67",S3="_emptyPlaceholder_1c4y1_76",_3="_card_1c4y1_67",x3="_cardHeader_1c4y1_107",T3="_cardStatusIcon_1c4y1_113",E3="_cardTitle_1c4y1_119",C3="_cardBadges_1c4y1_127",A3="_badge_1c4y1_134",j3="_blockedBadge_1c4y1_146",N3="_childBadge_1c4y1_151",w3="_depBadge_1c4y1_155",D3="_parentBadge_1c4y1_159",k3="_pausedSubBadge_1c4y1_166",M3="_personaBadge_1c4y1_170",R3="_envBadge_1c4y1_174",O3="_emptyCta_1c4y1_178",B3="_ctaButton_1c4y1_188",L3="_ctaDescription_1c4y1_204",Ge={boardContainer:h3,column:p3,columnHeader:m3,columnIcon:g3,columnLabel:y3,columnCount:v3,cardList:b3,emptyPlaceholder:S3,card:_3,cardHeader:x3,cardStatusIcon:T3,cardTitle:E3,cardBadges:C3,badge:A3,blockedBadge:j3,childBadge:N3,depBadge:w3,parentBadge:D3,pausedSubBadge:k3,personaBadge:M3,envBadge:R3,emptyCta:O3,ctaButton:B3,ctaDescription:L3};function U3({projectId:n}){const{tasks:a,sessions:i,personas:o,environments:r}=Gt(),u=Pn(),d=S.useMemo(()=>a.filter(v=>v.projectId===n),[a,n]),p=S.useMemo(()=>new Map(a.map(v=>[v.id,v.status])),[a]),m=S.useMemo(()=>new Map(d.map(v=>[v.id,v])),[d]),g=S.useMemo(()=>{const v=new Map(i.map(A=>[A.id,A])),_=new Map(o.map(A=>[A.id,A])),T=new Map(r.map(A=>[A.id,A])),C=new Map,E=new Map,j=new Map;for(const A of d)if(A.latestSessionId){const k=v.get(A.latestSessionId);if(k){if(C.set(A.id,k.status),k.personaId){const R=_.get(k.personaId);R&&E.set(A.id,R.name)}if(k.environmentId){const R=T.get(k.environmentId);R&&j.set(A.id,R.displayName)}}}return{sessionStatusByTaskId:C,personaNameByTaskId:E,environmentNameByTaskId:j}},[d,i,o,r]),y=S.useMemo(()=>f3({tasks:d,taskStatusById:p,sessionStatusByTaskId:g.sessionStatusByTaskId}),[d,p,g]);return d.length===0?h.jsxs("div",{className:Ge.emptyCta,"data-testid":"board-empty-cta",children:[h.jsx("button",{className:Ge.ctaButton,onClick:()=>u(Bs(n)),children:"Create Task"}),h.jsx("div",{className:Ge.ctaDescription,children:"Break your work into tasks and let agents tackle them"})]}):h.jsx("div",{className:Ge.boardContainer,"data-testid":"board-container",children:y.map(v=>h.jsxs("section",{className:Ge.column,"data-testid":`board-column-${v.status}`,"aria-label":`${v.label}, ${v.tasks.length} ${v.tasks.length===1?"task":"tasks"}`,children:[h.jsxs("div",{className:Ge.columnHeader,children:[h.jsx("span",{className:Ge.columnIcon,style:{color:v.style.color},children:v.style.icon}),h.jsx("span",{className:Ge.columnLabel,children:v.label}),h.jsx("span",{className:Ge.columnCount,"data-testid":`board-count-${v.status}`,children:v.tasks.length})]}),h.jsx("div",{className:Ge.cardList,children:v.tasks.length===0?h.jsx("div",{className:Ge.emptyPlaceholder,children:"No tasks"}):h.jsx(os,{mode:"popLayout",children:v.tasks.map(_=>h.jsx(Rn.div,{layout:!0,initial:{opacity:0,y:4},animate:{opacity:1,y:0},exit:{opacity:0,y:-4},transition:{duration:.15},children:h.jsx(z3,{boardTask:_,tasksById:m,personaName:g.personaNameByTaskId.get(_.task.id),envName:g.environmentNameByTaskId.get(_.task.id),onClick:()=>u(as(_.task.id))})},_.task.id))})})]},v.status))})}function z3({boardTask:n,tasksById:a,personaName:i,envName:o,onClick:r}){const{task:u,isBlocked:d,childCount:p,doneChildCount:m,pausedSubBadge:g}=n,y=ls(u.status),v=u.parentTaskId?a.get(u.parentTaskId):void 0;return h.jsxs("div",{className:Ge.card,tabIndex:0,role:"button","data-testid":`board-card-${u.id}`,onClick:r,onKeyDown:_=>{(_.key==="Enter"||_.key===" ")&&(_.preventDefault(),r())},children:[h.jsxs("div",{className:Ge.cardHeader,children:[h.jsx("span",{className:Ge.cardStatusIcon,style:{color:y.color},children:y.icon}),h.jsx("span",{className:Ge.cardTitle,children:u.title})]}),h.jsxs("div",{className:Ge.cardBadges,children:[v&&h.jsx("span",{className:`${Ge.badge} ${Ge.parentBadge}`,title:v.title,children:v.title}),p>0&&h.jsxs("span",{className:`${Ge.badge} ${Ge.childBadge}`,children:[m,"/",p]}),d&&h.jsx("span",{className:`${Ge.badge} ${Ge.blockedBadge}`,children:"blocked"}),u.dependsOn.length>0&&!d&&h.jsx("span",{className:`${Ge.badge} ${Ge.depBadge}`,children:"dep"}),g&&h.jsx("span",{className:`${Ge.badge} ${Ge.pausedSubBadge}`,children:g}),i&&h.jsx("span",{className:`${Ge.badge} ${Ge.personaBadge}`,children:i}),o&&h.jsx("span",{className:`${Ge.badge} ${Ge.envBadge}`,children:o})]})]})}function I3(n){const a=n.toLowerCase();return a==="ready"||a==="running"||a==="available"||a==="connected"?D.envDotGreen:a==="provisioning"||a==="starting"||a==="pending"||a==="connecting"?D.envDotYellow:a==="error"||a==="failed"||a==="disconnected"?D.envDotRed:D.envDotGray}function h0(n){if(!n)return"";const a=new Date(n);if(isNaN(a.getTime()))return"";const o=Date.now()-a.getTime();if(o<0)return"just now";const r=Math.floor(o/6e4);if(r<1)return"just now";if(r<60)return`${r}m ago`;const u=Math.floor(r/60);if(u<24)return`${u}h ago`;const d=Math.floor(u/24);return d<30?`${d}d ago`:a.toLocaleDateString(void 0,{month:"short",day:"numeric",year:"numeric"})}function V3(){const{projectId:n}=Qr(),a=Pn(),{tasks:i,environments:o,projects:r,archiveProject:u,updateProject:d}=Gt(),[p,m]=S.useState("tasks"),[g,y]=S.useState(!1),[v,_]=S.useState(null),[T,C]=S.useState(""),[E,j]=S.useState(""),[A,k]=S.useState(!1),R=S.useRef(void 0),$=S.useRef(null),H=S.useRef(null),V=S.useRef(null),q=S.useRef(null),O=S.useRef(null),ee=S.useRef(null),ae=LR(n,r);S.useEffect(()=>{const W=R.current;R.current=n,!(W===void 0||W===n)&&(v!==null||T!=="")&&(_(null),C(""))},[n,v,T]),S.useEffect(()=>{if(v===null)return;const W=v==="name"?H.current:v==="description"?V.current:v==="repoUrl"?q.current:v==="worktreeBasePath"?ee.current:O.current;if(!W)return;const K=window.setTimeout(()=>{W.focus()},0);return()=>{window.clearTimeout(K)}},[v]);const I=r.find(W=>W.id===n),se=i.filter(W=>W.projectId===n),Y=se.filter(W=>W.status==="complete").length,fe=se.length,G=fe>0?Math.round(Y/fe*100):0,U=100,Q=(W,K)=>{$.current=W,_(W),C(K),j("")},te=()=>{$.current=null,_(null),C(""),j("")},we=(W,K)=>{if(W==="name"){const me=K.trim();if(!me)return"Name is required";if(me.length>U)return`Max ${U} characters`}if(W==="repoUrl"){const me=K.trim();if(me&&!/^https?:\/\/.+/.test(me))return"Must be a valid http(s) URL"}return""},_e=W=>{if(!I)return;const K=T.trim(),me=we(W,T);if(me){j(me);return}if(W==="name"){if(K===I.name){te();return}d(I.id,{name:K})}else if(W==="description"){const Ae=T;if(Ae===I.description){te();return}d(I.id,{description:Ae})}else if(W==="repoUrl"){if(K===I.repoUrl){te();return}d(I.id,{repoUrl:K})}else if(W==="defaultEnvironmentId"){if(T===I.defaultEnvironmentId){te();return}d(I.id,{defaultEnvironmentId:T})}else{if(K===I.worktreeBasePath){te();return}d(I.id,{worktreeBasePath:K})}te()},Ue=(W,K)=>{W.key==="Escape"?te():W.key==="Enter"&&K!=="description"&&_e(K)},Ee=W=>I?W==="name"?T.trim()!==I.name:W==="description"?T!==I.description:W==="repoUrl"?T.trim()!==I.repoUrl:W==="defaultEnvironmentId"?T!==I.defaultEnvironmentId:T.trim()!==I.worktreeBasePath:!1,ye=o.find(W=>W.id===(I==null?void 0:I.defaultEnvironmentId)),xe=v==="description"?"Tab to save · Esc to cancel":"Enter to save · Esc to cancel";return h.jsxs("div",{className:D.panelContainer,children:[h.jsx(Vi,{segments:ae}),h.jsxs("div",{className:D.projectHeader,children:[h.jsx("span",{className:D.projectName,"data-testid":"project-name",children:v==="name"?h.jsxs("div",{className:D.editFieldWrapper,children:[h.jsx("input",{ref:H,className:`${D.editInput} ${E?D.editInputInvalid:""}`,value:T,onChange:W=>{C(W.target.value),j("")},onBlur:W=>{if($.current==="name"){$.current=null;return}W.relatedTarget instanceof HTMLElement&&W.relatedTarget.dataset.editAction==="name"||_e("name")},onKeyDown:W=>Ue(W,"name"),maxLength:U,"aria-label":"Project name","data-testid":"edit-name-input"}),Ee("name")&&h.jsx("span",{className:D.unsavedDot,title:"Unsaved changes"}),E&&h.jsx("span",{className:D.editError,"data-testid":"edit-error",children:E}),h.jsx("span",{className:D.editHint,children:xe})]}):h.jsxs("button",{type:"button",className:D.metaValueClickable,onClick:()=>Q("name",(I==null?void 0:I.name)||""),title:"Click to edit name","aria-label":`Edit project name: ${(I==null?void 0:I.name)||n}`,"data-testid":"edit-name-button",children:[(I==null?void 0:I.name)||n,h.jsx("span",{className:D.editButton,"aria-hidden":"true",children:"✏️"})]})}),h.jsx("button",{className:D.archiveButton,onClick:()=>y(!0),title:"Archive project","data-testid":"archive-project-button",children:"Archive"})]}),h.jsxs("button",{className:D.metaToggle,onClick:()=>k(!A),"aria-expanded":!A,"aria-controls":"project-meta-panel","data-testid":"meta-toggle",children:[h.jsx("span",{className:`${D.metaToggleArrow} ${A?"":D.metaToggleArrowOpen}`,children:"▶"}),"Details"]}),!A&&h.jsxs("div",{className:D.projectMeta,"data-testid":"project-meta",id:"project-meta-panel",children:[h.jsxs("div",{className:D.metaRow,children:[h.jsx("span",{className:D.metaLabel,children:"Description"}),h.jsx("div",{className:D.metaValue,children:v==="description"?h.jsxs("div",{className:D.editFieldWrapper,children:[h.jsx("textarea",{ref:V,className:D.editTextarea,value:T,onChange:W=>{C(W.target.value),j("")},onBlur:W=>{if($.current==="description"){$.current=null;return}W.relatedTarget instanceof HTMLElement&&W.relatedTarget.dataset.editAction==="description"||_e("description")},onKeyDown:W=>Ue(W,"description"),title:"Project description","aria-label":"Project description","data-testid":"edit-description-input"}),Ee("description")&&h.jsx("span",{className:D.unsavedDot,title:"Unsaved changes"}),h.jsx("span",{className:D.editHint,children:xe})]}):h.jsxs("button",{type:"button",className:D.metaValueClickable,onClick:()=>Q("description",(I==null?void 0:I.description)||""),title:"Click to edit description","aria-label":"Edit project description","data-testid":"edit-description-button",children:[I!=null&&I.description?h.jsx("span",{className:D.overviewMarkdown,children:h.jsx(Ef,{remarkPlugins:[Cf],children:I.description})}):h.jsx("span",{className:D.metaPlaceholder,children:"No description"}),h.jsx("span",{className:D.editButton,"aria-hidden":"true",children:"✏️"})]})})]}),h.jsxs("div",{className:D.metaRow,children:[h.jsx("span",{className:D.metaLabel,children:"Repository"}),h.jsx("div",{className:D.metaValue,children:v==="repoUrl"?h.jsxs("div",{className:D.editFieldWrapper,children:[h.jsx("input",{ref:q,className:`${D.editInput} ${E?D.editInputInvalid:""}`,value:T,onChange:W=>{C(W.target.value),j("")},onBlur:W=>{if($.current==="repoUrl"){$.current=null;return}W.relatedTarget instanceof HTMLElement&&W.relatedTarget.dataset.editAction==="repoUrl"||_e("repoUrl")},onKeyDown:W=>Ue(W,"repoUrl"),placeholder:"https://github.com/...","aria-label":"Project repository URL","data-testid":"edit-repo-input"}),Ee("repoUrl")&&h.jsx("span",{className:D.unsavedDot,title:"Unsaved changes"}),E&&h.jsx("span",{className:D.editError,"data-testid":"edit-error",children:E}),h.jsx("span",{className:D.editHint,children:xe})]}):h.jsxs("button",{type:"button",className:D.metaValueClickable,onClick:W=>{W.preventDefault(),Q("repoUrl",(I==null?void 0:I.repoUrl)||"")},title:"Click to edit repository URL","aria-label":"Edit project repository URL","data-testid":"edit-repo-button",children:[I!=null&&I.repoUrl&&/^https?:\/\//i.test(I.repoUrl)?h.jsx("a",{className:D.repoLink,href:I.repoUrl,target:"_blank",rel:"noopener noreferrer",onClick:W=>W.stopPropagation(),children:I.repoUrl}):I!=null&&I.repoUrl?h.jsx("span",{children:I.repoUrl}):h.jsx("span",{className:D.metaPlaceholder,children:"No repository"}),h.jsx("span",{className:D.editButton,"aria-hidden":"true",children:"✏️"})]})})]}),h.jsxs("div",{className:D.metaRow,children:[h.jsx("span",{className:D.metaLabel,children:"Environment"}),h.jsx("div",{className:D.metaValue,children:v==="defaultEnvironmentId"?h.jsxs("select",{ref:O,className:D.editSelect,value:T,onChange:W=>{$.current=null,C(W.target.value);const K=W.target.value;I&&K!==I.defaultEnvironmentId&&d(I.id,{defaultEnvironmentId:K}),te()},onBlur:W=>{if($.current==="defaultEnvironmentId"){$.current=null;return}W.relatedTarget instanceof HTMLElement&&W.relatedTarget.dataset.editAction==="defaultEnvironmentId"||te()},title:"Default environment","aria-label":"Project default environment","data-testid":"edit-env-select",children:[h.jsx("option",{value:"",children:"None"}),o.map(W=>h.jsx("option",{value:W.id,children:W.displayName},W.id))]}):h.jsxs("button",{type:"button",className:D.metaValueClickable,onClick:()=>Q("defaultEnvironmentId",(I==null?void 0:I.defaultEnvironmentId)||""),title:"Click to change default environment","aria-label":"Edit project default environment","data-testid":"edit-env-button",children:[ye?h.jsxs("span",{className:D.envRow,children:[h.jsx("span",{className:`${D.envDot} ${I3(ye.status)}`}),ye.displayName]}):h.jsx("span",{className:D.metaPlaceholder,children:(I==null?void 0:I.defaultEnvironmentId)||"No default environment"}),h.jsx("span",{className:D.editButton,"aria-hidden":"true",children:"✏️"})]})})]}),h.jsxs("div",{className:D.metaRow,children:[h.jsx("span",{className:D.metaLabel,children:"Worktrees"}),h.jsx("div",{className:D.metaValue,children:h.jsxs("label",{className:D.worktreeToggle,"data-testid":"worktree-toggle",children:[h.jsx("input",{type:"checkbox",checked:(I==null?void 0:I.useWorktrees)??!0,onChange:W=>{I&&d(I.id,{useWorktrees:W.target.checked})}}),h.jsx("span",{children:"Enable worktree isolation"})]})})]}),h.jsxs("div",{className:D.metaRow,children:[h.jsx("span",{className:D.metaLabel,children:"Working Dir"}),h.jsx("div",{className:D.metaValue,children:v==="worktreeBasePath"?h.jsxs("div",{className:D.editFieldWrapper,children:[h.jsx("input",{ref:ee,className:`${D.editInput} ${E?D.editInputInvalid:""}`,value:T,onChange:W=>{C(W.target.value),j("")},onBlur:W=>{if($.current==="worktreeBasePath"){$.current=null;return}W.relatedTarget instanceof HTMLElement&&W.relatedTarget.dataset.editAction==="worktreeBasePath"||_e("worktreeBasePath")},onKeyDown:W=>Ue(W,"worktreeBasePath"),placeholder:"/workspaces/my-repo","aria-label":"Working directory","data-testid":"edit-worktree-base-path-input"}),Ee("worktreeBasePath")&&h.jsx("span",{className:D.unsavedDot,title:"Unsaved changes"}),E&&h.jsx("span",{className:D.editError,"data-testid":"edit-error",children:E}),h.jsx("span",{className:D.editHint,children:xe})]}):h.jsxs("button",{type:"button",className:D.metaValueClickable,onClick:()=>Q("worktreeBasePath",(I==null?void 0:I.worktreeBasePath)||""),title:"Click to edit working directory","aria-label":"Edit working directory","data-testid":"edit-worktree-base-path-button",children:[I!=null&&I.worktreeBasePath?h.jsx("span",{children:I.worktreeBasePath}):h.jsx("span",{className:D.metaPlaceholder,children:"Default (server default)"}),h.jsx("span",{className:D.editButton,"aria-hidden":"true",children:"✏️"})]})})]}),I&&h.jsxs("div",{className:D.metaTimestamps,children:[h.jsxs("span",{className:D.metaTimestamp,children:["Created ",h0(I.createdAt)]}),I.updatedAt&&I.updatedAt!==I.createdAt&&h.jsxs("span",{className:D.metaTimestamp,children:["· Updated ",h0(I.updatedAt)]})]})]}),fe>0&&h.jsxs("div",{className:D.progressBarContainer,"data-testid":"progress-bar",children:[h.jsx("div",{className:D.progressBar,children:h.jsx("div",{className:D.progressFill,style:{width:`${G}%`}})}),h.jsxs("span",{className:D.progressLabel,children:[Y,"/",fe]})]}),h.jsxs("div",{className:D.tabBar,role:"tablist","aria-label":"Project view",children:[h.jsx("button",{role:"tab","aria-selected":p==="graph",className:`${D.tab} ${p==="graph"?D.active:""}`,onClick:()=>m("graph"),children:"Graph"}),h.jsx("button",{role:"tab","aria-selected":p==="board",className:`${D.tab} ${p==="board"?D.active:""}`,onClick:()=>m("board"),"data-testid":"board-tab",children:"Board"}),h.jsx("button",{role:"tab","aria-selected":p==="tasks",className:`${D.tab} ${p==="tasks"?D.active:""}`,onClick:()=>m("tasks"),children:"Tasks"})]}),p==="tasks"&&fe>0&&h.jsxs("div",{className:D.projectSummary,children:[h.jsx("span",{className:D.projectSummaryTitle,children:`${Y}/${fe} tasks complete`}),h.jsx("span",{className:D.projectSummarySubtitle,children:"Select a task or click + to create one"})]}),p==="tasks"&&fe===0&&h.jsxs("div",{className:D.emptyCta,children:[h.jsx("button",{className:D.ctaButton,onClick:()=>a(Bs(n)),children:"Create Task"}),h.jsx("div",{className:D.ctaDescription,children:"Break your work into tasks and let agents tackle them"})]}),p==="board"&&h.jsx(U3,{projectId:n}),p==="graph"&&h.jsx(d3,{projectId:n}),h.jsx(lc,{isOpen:g,title:"Archive Project?",description:"This will hide the project from the sidebar. Tasks will not be deleted.",confirmLabel:"Archive",onConfirm:()=>{I&&(u(I.id),a("/",{replace:!0})),y(!1)},onCancel:()=>y(!1)})]})}const H3="_container_cddyd_1",P3="_header_cddyd_8",G3="_headerTitle_cddyd_35",q3="_badge_cddyd_44",F3="_headerActions_cddyd_54",$3="_body_cddyd_61",Y3="_formContent_cddyd_73",K3="_section_cddyd_85",Z3="_label_cddyd_91",X3="_titleInput_cddyd_98",Q3="_descriptionTextarea_cddyd_131",J3="_parentContext_cddyd_167",W3="_parentLabel_cddyd_175",eO="_parentName_cddyd_182",tO="_depList_cddyd_220",nO="_depItem_cddyd_226",aO="_depItemSelected_cddyd_248",sO="_noDeps_cddyd_252",iO="_btnPrimary_cddyd_258",lO="_btnGhost_cddyd_289",ot={container:H3,header:P3,headerTitle:G3,badge:q3,headerActions:F3,body:$3,formContent:Y3,section:K3,label:Z3,titleInput:X3,descriptionTextarea:Q3,parentContext:J3,parentLabel:W3,parentName:eO,depList:tO,depItem:nO,depItemSelected:aO,noDeps:sO,btnPrimary:iO,btnGhost:lO};function z1({mode:n,taskId:a,projectId:i,parentTaskId:o}){const{tasks:r,createTask:u,updateTask:d}=Gt(),{showToast:p}=ao(),m=Pn(),g=n==="edit",y=g&&a?r.find(Y=>Y.id===a):void 0,v=g?(y==null?void 0:y.projectId)??"":i??"",_=g?(y==null?void 0:y.parentTaskId)??"":o??"",T=_?r.find(Y=>Y.id===_):void 0,[C,E]=S.useState((y==null?void 0:y.title)??""),[j,A]=S.useState((y==null?void 0:y.description)??""),[k,R]=S.useState((y==null?void 0:y.dependsOn)??[]),[$,H]=S.useState(!1),V=S.useRef(!1);S.useEffect(()=>{g&&y&&!V.current&&(V.current=!0,E(y.title),A(y.description),R(y.dependsOn))},[g,y]);const q=r.filter(Y=>Y.projectId===v&&(!g||Y.id!==a)&&Y.id!==_),O=C.trim().length>0&&(!g||y!==void 0)&&(g||v.length>0),ee=Y=>{R(fe=>fe.includes(Y)?fe.filter(G=>G!==Y):[...fe,Y])},ae=()=>{!O||$||g&&y===void 0||(g&&a?(d(a,C.trim(),j,k),p("Task updated","success"),m(as(a),{replace:!0})):(H(!0),u(v,C.trim(),j,k.length>0?k:void 0,_||void 0,()=>{p("Task created","success"),m(Kl(v),{replace:!0})},Y=>{p(Y,"error"),H(!1)})))},I=()=>{m(g&&a?as(a):Kl(v))},se=g?"edit task":_?"child task":"new task";return h.jsxs("div",{className:ot.container,children:[h.jsxs("div",{className:ot.header,children:[h.jsxs("div",{className:ot.headerTitle,children:[h.jsx("span",{className:ot.badge,children:se}),T&&h.jsxs("span",{className:ot.parentContext,children:[h.jsx("span",{className:ot.parentLabel,children:"Child of"}),h.jsx("span",{className:ot.parentName,children:T.title})]})]}),h.jsxs("div",{className:ot.headerActions,children:[h.jsx("button",{onClick:ae,disabled:!O||$,className:ot.btnPrimary,"data-testid":"task-edit-save",children:$?"Creating…":g?"Save Changes":"Create"}),h.jsx("button",{onClick:I,className:ot.btnGhost,children:"Cancel"})]})]}),h.jsx("div",{className:ot.body,children:h.jsxs("div",{className:ot.formContent,children:[h.jsxs("div",{className:ot.section,children:[h.jsx("label",{className:ot.label,htmlFor:"task-edit-title",children:"Title"}),h.jsx("input",{id:"task-edit-title",type:"text",value:C,onChange:Y=>E(Y.target.value),placeholder:"Task title...",autoFocus:!0,className:ot.titleInput,"data-testid":"task-edit-title",onKeyDown:Y=>{Y.key==="Enter"&&O&&ae()}})]}),h.jsxs("div",{className:ot.section,children:[h.jsx("label",{className:ot.label,htmlFor:"task-edit-description",children:"Description"}),h.jsx("textarea",{id:"task-edit-description",value:j,onChange:Y=>A(Y.target.value),placeholder:"Describe the task... (markdown supported)",className:ot.descriptionTextarea,"data-testid":"task-edit-description",rows:8})]}),h.jsxs("div",{className:ot.section,children:[h.jsx("div",{className:ot.label,children:"Dependencies"}),q.length===0?h.jsx("div",{className:ot.noDeps,children:"No other tasks in this project"}):h.jsx("div",{className:ot.depList,children:q.map(Y=>{const fe=k.includes(Y.id);return h.jsxs("label",{className:`${ot.depItem} ${fe?ot.depItemSelected:""}`,"data-testid":`dep-option-${Y.id}`,children:[h.jsx("input",{type:"checkbox",checked:fe,onChange:()=>ee(Y.id)}),Y.title,h.jsxs("span",{style:{opacity:.5,fontSize:"11px",marginLeft:"4px"},children:["(",Y.status,")"]})]},Y.id)})})]})]})})]})}function oO(){const[n]=Rf(),a=n.get("project")??"",i=n.get("parent")??void 0;return a?h.jsx(z1,{mode:"new",projectId:a,parentTaskId:i}):h.jsx(Dr,{to:"/",replace:!0})}function rO(){const{taskId:n}=Qr();return h.jsx(z1,{mode:"edit",taskId:n})}const cO="_container_1pqxm_1",uO="_emptyState_1pqxm_8",dO="_card_1pqxm_14",fO="_cardHeader_1pqxm_34",hO="_categoryBadge_1pqxm_46",pO="_findingTitle_1pqxm_54",mO="_findingDate_1pqxm_60",gO="_findingContent_1pqxm_72",yO="_tags_1pqxm_78",vO="_tag_1pqxm_78",Yn={container:cO,emptyState:uO,card:dO,cardHeader:fO,categoryBadge:hO,findingTitle:pO,findingDate:mO,findingContent:gO,tags:yO,tag:vO};function bO(n){const a=new Date(n),i=new Date,o=i.getTime()-a.getTime(),r=Math.floor(o/1e3),u=Math.floor(r/60),d=Math.floor(u/60),p=Math.floor(d/24);if(r<60)return"just now";if(u<60)return`${u}m ago`;if(d<24)return`${d}h ago`;if(p===1)return"yesterday";if(p<7)return`${p} days ago`;const m=a.getFullYear()===i.getFullYear(),g=a.toLocaleString("en-US",{month:"short"}),y=a.getDate();return m?`${g} ${y}`:`${g} ${y} ${a.getFullYear()}`}const p0={architecture:{text:"var(--accent-blue)",bg:"var(--accent-blue-dim)"},api:{text:"var(--accent-green)",bg:"var(--accent-green-dim)"},bug:{text:"var(--accent-red)",bg:"var(--accent-red-dim)"},decision:{text:"var(--accent-yellow)",bg:"var(--accent-yellow-dim)"},dependency:{text:"var(--accent-purple)",bg:"var(--accent-purple-dim)"},pattern:{text:"var(--accent-cyan)",bg:"var(--accent-cyan-dim)"},general:{text:"var(--text-secondary)",bg:"var(--bg-elevated)"}};function SO({projectId:n}){const{findings:a}=Gt(),i=a.filter(o=>o.projectId===n);return i.length===0?h.jsx("div",{className:Yn.emptyState,children:"No findings yet. Agents will post discoveries here."}):h.jsx("div",{className:Yn.container,children:i.map((o,r)=>{const u=p0[o.category]||p0.general;return h.jsxs(Rn.div,{className:Yn.card,initial:{opacity:0,y:8},animate:{opacity:1,y:0},transition:{delay:r*.05,duration:.2},children:[h.jsxs("div",{className:Yn.cardHeader,children:[h.jsx("span",{className:Yn.categoryBadge,style:{background:u.bg,color:u.text},children:o.category}),h.jsx("span",{className:Yn.findingTitle,children:o.title}),h.jsx("span",{className:Yn.findingDate,title:o.createdAt,children:bO(o.createdAt)})]}),h.jsx("div",{className:Yn.findingContent,children:o.content.length>300?o.content.slice(0,300)+"...":o.content}),o.tags.length>0&&h.jsx("div",{className:Yn.tags,children:o.tags.map(d=>h.jsx("span",{className:Yn.tag,style:{color:u.text,textShadow:`0 0 8px ${u.text}`},children:d},d))})]},o.id)})})}function Nr(n){if(!n)return"—";const a=new Date(n);return isNaN(a.getTime())?"—":a.toLocaleString(void 0,{month:"short",day:"numeric",year:"numeric",hour:"2-digit",minute:"2-digit"})}function Gd(n,a){if(!n||!a)return;const i=new Date(a).getTime()-new Date(n).getTime();if(isNaN(i)||i<0)return;const o=Math.floor(i/6e4),r=Math.floor(i%6e4/1e3);if(o===0)return`${r}s`;const u=Math.floor(o/60),d=o%60;return u===0?`${o}m ${r}s`:`${u}h ${d}m`}function _O(n){const a=n.toLowerCase();return a==="ready"||a==="running"||a==="available"||a==="connected"?D.envDotGreen:a==="provisioning"||a==="starting"||a==="pending"||a==="connecting"?D.envDotYellow:a==="error"||a==="failed"||a==="disconnected"?D.envDotRed:D.envDotGray}function xO({status:n}){const a=ls(n),i=aD(n);return h.jsx("span",{className:`${D.statusBadge} ${D[i]??D.statusPending}`,children:a.label})}function TO({task:n,tasksById:a,environments:i,projects:o,taskSessions:r}){const u=r.length>0?r[r.length-1]:void 0,d=(u==null?void 0:u.environmentId)??"",p=d?i.find(y=>y.id===d):void 0,m=o.find(y=>y.id===n.projectId),g=n.branch&&(m!=null&&m.repoUrl)?`${m.repoUrl.replace(/\/$/,"")}/tree/${encodeURIComponent(n.branch)}`:void 0;return h.jsxs("div",{className:D.overviewDashboard,children:[h.jsxs("div",{className:D.overviewHero,children:[h.jsx(xO,{status:n.status}),n.branch&&h.jsx("span",{className:D.overviewBranchPill,children:g?h.jsxs("a",{href:g,target:"_blank",rel:"noreferrer noopener",className:D.branchLink,children:["🔗"," ",n.branch]}):h.jsxs("span",{children:["🔗"," ",n.branch]})})]}),typeof n.description=="string"&&n.description&&h.jsxs("div",{className:D.overviewSection,children:[h.jsx("div",{className:D.overviewLabel,children:"Description"}),h.jsx("div",{className:D.overviewMarkdown,children:h.jsx(Ef,{remarkPlugins:[Cf],children:n.description})})]}),d&&h.jsxs("div",{className:D.overviewSection,children:[h.jsx("div",{className:D.overviewLabel,children:"Environment"}),h.jsxs("div",{className:D.envRow,children:[p&&h.jsx("span",{className:`${D.envDot} ${_O(p.status)}`,title:p.status,"aria-label":`Status: ${p.status}`,role:"img"}),h.jsx("span",{className:D.overviewValue,children:(p==null?void 0:p.displayName)??d})]})]}),h.jsxs("div",{className:D.overviewSection,children:[h.jsx("div",{className:D.overviewLabel,children:"Dependencies"}),n.dependsOn.length===0?h.jsx("div",{className:D.overviewMuted,children:"None"}):h.jsx("div",{className:D.depList,children:n.dependsOn.map(y=>{const v=a.get(y),_=(v==null?void 0:v.status)==="complete";return h.jsxs("div",{className:`${D.depItem} ${_?D.depDone:D.depBlocked}`,children:[h.jsx("span",{children:_?"✓":"○"}),h.jsx("span",{children:(v==null?void 0:v.title)??y})]},y)})})]}),h.jsxs("div",{className:D.overviewSection,children:[h.jsx("div",{className:D.overviewLabel,children:"Timeline"}),h.jsxs("div",{className:D.timeline,children:[n.createdAt&&h.jsxs("div",{className:D.timelineRow,children:[h.jsx("span",{className:D.timelineKey,children:"Created"}),h.jsx("span",{className:D.timelineValue,children:Nr(n.createdAt)})]}),n.assignedAt&&(()=>{const y=Gd(n.createdAt,n.assignedAt);return h.jsxs("div",{className:D.timelineRow,children:[h.jsx("span",{className:D.timelineKey,children:"Assigned"}),h.jsx("span",{className:D.timelineValue,children:Nr(n.assignedAt)}),y!==void 0&&h.jsx("span",{className:D.timelineDelta,children:y})]})})(),n.startedAt&&(()=>{const y=Gd(n.assignedAt??n.createdAt,n.startedAt);return h.jsxs("div",{className:D.timelineRow,children:[h.jsx("span",{className:D.timelineKey,children:"Started"}),h.jsx("span",{className:D.timelineValue,children:Nr(n.startedAt)}),y!==void 0&&h.jsx("span",{className:D.timelineDelta,children:y})]})})(),n.completedAt&&(()=>{const y=Gd(n.startedAt,n.completedAt);return h.jsxs("div",{className:D.timelineRow,children:[h.jsx("span",{className:D.timelineKey,children:"Completed"}),h.jsx("span",{className:D.timelineValue,children:Nr(n.completedAt)}),y!==void 0&&h.jsx("span",{className:D.timelineDelta,children:y})]})})(),!n.createdAt&&!n.assignedAt&&!n.startedAt&&!n.completedAt&&h.jsx("div",{className:D.overviewMuted,children:"No timing data"})]})]}),n.reviewNotes&&h.jsxs("div",{className:D.overviewSection,children:[h.jsx("div",{className:D.overviewLabel,children:"Review Notes"}),h.jsx("div",{className:D.reviewNotes,children:n.reviewNotes})]})]})}function EO({eventsDropped:n}){return n<=0?h.jsx(h.Fragment,{}):h.jsxs("div",{className:D.eventOverflowWarning,role:"alert",children:["⚠ ",n.toLocaleString()," older event",n===1?"":"s"," were dropped — only the most recent 5,000 are shown."]})}function CO({task:n,sessionId:a,isBlocked:i,onStart:o,onResume:r,onStop:u,onComplete:d,onDelete:p,onEdit:m}){if(n.status==="not_started")return i?h.jsxs("div",{className:D.headerActions,children:[h.jsx("button",{onClick:m,className:D.btnGhost,children:"Edit"}),h.jsx("button",{onClick:p,className:D.btnDanger,children:"Delete"})]}):h.jsxs("div",{className:D.headerActions,children:[h.jsx("button",{onClick:o,className:D.btnPrimary,children:"Start"}),h.jsx("button",{onClick:m,className:D.btnGhost,children:"Edit"}),h.jsx("button",{onClick:p,className:D.btnDanger,children:"Delete"})]});if(n.status==="working")return h.jsx("div",{className:D.headerActions,children:h.jsx("button",{onClick:u,disabled:!a,className:D.btnDanger,children:"Stop"})});if(n.status==="paused")return h.jsxs("div",{className:D.headerActions,children:[h.jsx("button",{onClick:d,className:D.btnPrimary,children:"Complete"}),h.jsx("button",{onClick:r,className:D.btnGhost,children:"Resume"}),h.jsx("button",{onClick:p,className:D.btnDanger,children:"Delete"})]});if(n.status==="complete")return h.jsx("div",{className:D.headerActions,children:h.jsx("button",{onClick:p,className:D.btnDanger,children:"Delete"})});if(n.status==="failed")return h.jsxs("div",{className:D.headerActions,children:[h.jsx("button",{onClick:o,className:D.btnPrimary,children:"Retry"}),h.jsx("button",{onClick:p,className:D.btnDanger,children:"Delete"})]})}function AO({taskSessions:n,selectedSessionId:a,onSelect:i}){if(!(n.length<2))return h.jsxs("div",{className:D.attemptSelector,"data-testid":"attempt-selector",children:[h.jsx("span",{className:D.attemptLabel,children:"Attempts:"}),n.map((o,r)=>{const u=o.id===a,d=o.status==="completed"?"✓":o.status==="failed"?"✗":o.status==="running"||o.status==="idle"?"●":"";return h.jsxs("button",{className:`${D.attemptButton} ${u?D.attemptActive:""}`,onClick:()=>i(o.id),title:`Attempt #${r+1} — ${o.status}`,"aria-label":`Attempt #${r+1}, ${o.status}`,"aria-pressed":u,"data-testid":`attempt-${r+1}`,children:["#",r+1,d&&h.jsx("span",{className:D.attemptStatus,children:d})]},o.id)})]})}function qd(){const{taskId:n}=Qr(),a=Wt(),i=Pn(),{events:o,eventsDropped:r,tasks:u,environments:d,loadSessionEvents:p,loadFindings:m,kill:g,startTask:y,resumeTask:v,completeTask:_,deleteTask:T,projects:C,taskSessions:E,loadTaskSessions:j}=Gt(),A=S.useRef(null),k=S.useRef(void 0),R=S.useRef(void 0),$=S.useRef(void 0),H=S.useRef(void 0),V=S.useRef(void 0),q=a.pathname.endsWith("/stream")?"stream":a.pathname.endsWith("/findings")?"findings":"overview",[O,ee]=S.useState(q),[ae,I]=S.useState(!1),[se,Y]=S.useState(void 0),fe=S.useRef(q);q!==fe.current&&(fe.current=q,q!==O&&ee(q));const G=u.find(K=>K.id===n),U=(G==null?void 0:G.projectId)||void 0,Q=G?E[G.id]??[]:[];let te;se&&Q.some(K=>K.id===se)?te=se:te=(G==null?void 0:G.latestSessionId)||void 0;const we=()=>{I(!0)},_e=()=>{G&&(T(G.id),I(!1),i(Kl(G.projectId),{replace:!0}))};if((G==null?void 0:G.id)!==R.current&&(R.current=G==null?void 0:G.id,se!==void 0&&Y(void 0)),S.useEffect(()=>{if(!(G!=null&&G.id))return;const K=G.id!==H.current,me=G.latestSessionId!==V.current;(K||me)&&(H.current=G.id,V.current=G.latestSessionId,j(G.id))},[G==null?void 0:G.id,G==null?void 0:G.latestSessionId,j]),(G==null?void 0:G.status)!==$.current){$.current=G==null?void 0:G.status;const K=(G==null?void 0:G.status)==="not_started"?"overview":(G==null?void 0:G.status)==="working"||(G==null?void 0:G.status)==="paused"?"stream":(G==null?void 0:G.status)==="complete"?"findings":void 0;K&&K!==O&&ee(K)}const Ue=S.useMemo(()=>new Map(u.map(K=>[K.id,K])),[u]),Ee=S.useMemo(()=>{const K=te?o.filter(me=>me.sessionId===te):[];return U1(L1(K))},[o,te]),ye=G?G.dependsOn.some(K=>{const me=Ue.get(K);return me!==void 0&&me.status!=="complete"}):!1,xe=S.useMemo(()=>UR(n,C,Ue),[n,C,Ue]);S.useEffect(()=>{te&&te!==k.current&&(k.current=te,p(te))},[te,p]),S.useEffect(()=>{O==="findings"&&U&&m(U)},[O,U,m]),S.useEffect(()=>{A.current&&O==="stream"&&(A.current.scrollTop=A.current.scrollHeight)},[Ee.length,O]);const W=K=>{ee(K),i(as(n,K==="overview"?void 0:K))};return h.jsxs("div",{className:D.panelContainer,children:[h.jsx(Vi,{segments:xe}),h.jsxs("div",{className:D.header,children:[h.jsxs("span",{className:D.headerTitle,children:[h.jsx("span",{"data-testid":"task-title",children:(G==null?void 0:G.title)||n}),G&&h.jsx("span",{className:D.taskStatusBadge,"data-testid":"task-status",children:G.status}),(G==null?void 0:G.branch)&&h.jsx("span",{className:D.taskBranch,children:G.branch}),ye&&h.jsx("span",{className:D.taskBlockedBadge,children:"blocked"})]}),G&&h.jsx(CO,{task:G,sessionId:te,isBlocked:ye,onStart:()=>y(G.id),onResume:()=>v(G.id),onStop:()=>te&&g(te),onComplete:()=>_(G.id),onDelete:we,onEdit:()=>i(FT(G.id))})]}),h.jsxs("div",{className:D.tabBar,role:"tablist","aria-label":"Task view",children:[h.jsx("button",{role:"tab","aria-selected":O==="overview",className:`${D.tab} ${O==="overview"?D.active:""}`,onClick:()=>W("overview"),children:"Overview"}),h.jsx("button",{role:"tab","aria-selected":O==="stream",className:`${D.tab} ${O==="stream"?D.active:""}`,onClick:()=>W("stream"),children:"Stream"}),h.jsx("button",{role:"tab","aria-selected":O==="findings",className:`${D.tab} ${O==="findings"?D.active:""}`,onClick:()=>W("findings"),children:"Findings"})]}),h.jsxs(os,{mode:"wait",children:[O==="overview"&&h.jsx(Rn.div,{initial:{opacity:0,y:4},animate:{opacity:1,y:0},exit:{opacity:0,y:-4},transition:{duration:.15},className:D.overviewContent,children:G?h.jsx(TO,{task:G,tasksById:Ue,environments:d,projects:C,taskSessions:Q}):h.jsx("div",{className:D.waitingMessage,children:"No additional details"})},"overview"),O==="stream"&&h.jsxs(Rn.div,{initial:{opacity:0,y:4},animate:{opacity:1,y:0},exit:{opacity:0,y:-4},transition:{duration:.15},style:{display:"flex",flexDirection:"column",flex:1,overflow:"hidden"},children:[h.jsx(AO,{taskSessions:Q,selectedSessionId:te,onSelect:K=>Y(K)}),h.jsxs("div",{ref:A,className:D.eventScroll,children:[!te&&G&&h.jsxs("div",{className:D.emptyCta,children:[h.jsx("button",{className:D.ctaButton,onClick:()=>y(G.id),children:"Start Task"}),h.jsx("div",{className:D.ctaDescription,children:"Click to begin agent execution"})]}),te&&Ee.length===0&&h.jsx("div",{className:D.waitingMessage,children:"Waiting for events..."}),h.jsx(EO,{eventsDropped:r}),Ee.map((K,me)=>h.jsx(N1,{event:K,toolUseCtx:K.toolUseCtx},`${K.sessionId}-${K.timestamp}-${me}`))]})]},"stream"),O==="findings"&&h.jsx(Rn.div,{initial:{opacity:0,y:4},animate:{opacity:1,y:0},exit:{opacity:0,y:-4},transition:{duration:.15},className:D.tabContent,children:U?h.jsx(SO,{projectId:U}):h.jsx("div",{className:D.noContext,children:"Navigate to a task within a project to view findings"})},"findings")]}),G&&h.jsx(lc,{isOpen:ae,title:"Delete Task?",description:`"${G.title}" will be permanently removed.`,onConfirm:_e,onCancel:()=>I(!1)})]})}function jO(){const n=RR();return h.jsxs("div",{className:D.panelContainer,children:[h.jsx(Vi,{segments:n}),h.jsx("div",{className:D.emptyState,children:"Configure the new environment below"})]})}const NO="_layout_11u79_1",wO="_content_11u79_8",DO="_tabPanel_11u79_14",Fd={layout:NO,content:wO,tabPanel:DO},kO={environments:"Environments",credentials:"Credentials",personas:"Personas",appearance:"Appearance",about:"About"};function MO(){const a=Wt().pathname.replace(/^\/settings\/?/,"").split("/")[0],i=kO[a],o=MR(i);return h.jsxs("div",{className:Fd.layout,children:[h.jsx(Vi,{segments:o}),h.jsx("div",{className:Fd.content,children:h.jsx("div",{className:Fd.tabPanel,children:h.jsx(D0,{})},a)})]})}const RO="_nav_13n0b_1",OO="_tab_13n0b_44",BO="_tabIcon_13n0b_82",LO="_tabActive_13n0b_88",wr={nav:RO,tab:OO,tabIcon:BO,tabActive:LO},Ta=[{path:"environments",label:"Environments",icon:"🖥️"},{path:"credentials",label:"Credentials",icon:"🔑"},{path:"personas",label:"Personas",icon:"👤"},{path:"appearance",label:"Appearance",icon:"🎨"},{path:"about",label:"About",icon:"ℹ️"}];function UO(){var d;const n=Wt(),a=Pn(),i=S.useRef(null),o=((d=Ta.find(p=>n.pathname===`${ki}/${p.path}`))==null?void 0:d.path)??Ta[0].path,r=S.useCallback(p=>{a(`${ki}/${p}`)},[a]),u=S.useCallback(p=>{var T,C;const m=(T=i.current)==null?void 0:T.querySelectorAll('[role="tab"]');if(!m)return;const g=Array.from(m).findIndex(E=>E===document.activeElement),y=g>=0?g:Ta.findIndex(E=>E.path===o);let v=y;if(p.key==="ArrowDown")p.preventDefault(),v=(y+1)%Ta.length;else if(p.key==="ArrowUp")p.preventDefault(),v=(y-1+Ta.length)%Ta.length;else if(p.key==="Home")p.preventDefault(),v=0;else if(p.key==="End")p.preventDefault(),v=Ta.length-1;else return;const _=Ta[v].path;a(`${ki}/${_}`),(C=m[v])==null||C.focus()},[o,a]);return h.jsx("nav",{className:wr.nav,ref:i,role:"tablist","aria-orientation":"vertical","aria-label":"Settings",onKeyDown:u,children:Ta.map(p=>{const m=p.path===o;return h.jsxs("button",{role:"tab",type:"button","aria-selected":m,tabIndex:m?0:-1,className:`${wr.tab} ${m?wr.tabActive:""}`,onClick:()=>r(p.path),children:[h.jsx("span",{className:wr.tabIcon,"aria-hidden":"true",children:p.icon}),p.label]},p.path)})})}const zO="_container_1nk8c_1",IO="_header_1nk8c_5",VO="_headerLabel_1nk8c_12",HO="_addButton_1nk8c_20",PO="_envRow_1nk8c_55",GO="_targeted_1nk8c_69",qO="_expanded_1nk8c_72",FO="_statusDot_1nk8c_76",$O="_pulse_1nk8c_79",YO="_envName_1nk8c_83",KO="_envActions_1nk8c_87",ZO="_idleLabel_1nk8c_94",XO="_newChatButton_1nk8c_99",QO="_envActionsRow_1nk8c_126",JO="_connectButton_1nk8c_134",WO="_stopButton_1nk8c_160",eB="_deleteButton_1nk8c_186",tB="_provisionMessage_1nk8c_213",nB="_errorMessage_1nk8c_220",aB="_sessionRow_1nk8c_227",sB="_selected_1nk8c_243",iB="_sessionDot_1nk8c_248",lB="_sessionSummaryRow_1nk8c_252",oB="_sessionExpandArrow_1nk8c_272",rB="_sessionSummaryText_1nk8c_283",cB="_sessionCountBadge_1nk8c_290",uB="_emptyCta_1nk8c_313",dB="_ctaDescription_1nk8c_326",fB="_ctaButton_1nk8c_332",Pe={container:zO,header:IO,headerLabel:VO,addButton:HO,envRow:PO,targeted:GO,expanded:qO,statusDot:FO,pulse:$O,envName:YO,envActions:KO,idleLabel:ZO,newChatButton:XO,envActionsRow:QO,connectButton:JO,stopButton:WO,deleteButton:eB,provisionMessage:tB,errorMessage:nB,sessionRow:aB,selected:sB,sessionDot:iB,sessionSummaryRow:lB,sessionExpandArrow:oB,sessionSummaryText:rB,sessionCountBadge:cB,emptyCta:uB,ctaDescription:dB,ctaButton:fB},hB={connected:"var(--accent-green)",sleeping:"var(--accent-yellow)",error:"var(--accent-red)",disconnected:"var(--text-tertiary)",connecting:"var(--accent-blue)"},pB={running:"running",idle:"awaiting input",failed:"failed",interrupted:"interrupted",completed:"completed"},m0=["running","idle","failed","interrupted","completed"],mB=.2;function gB(n){const a={};for(const u of n)a[u.status]=(a[u.status]||0)+1;const i=m0.filter(u=>a[u]>0).map(u=>`${a[u]} ${pB[u]||u}`),o=new Set(m0),r=Object.keys(a).filter(u=>!o.has(u)).sort().map(u=>`${a[u]} ${u}`);return[...i,...r].join(", ")}function yB({status:n}){const a=n==="running"?"var(--accent-green)":n==="idle"?"var(--accent-yellow)":n==="completed"?"var(--text-secondary)":n==="failed"||n==="interrupted"?"var(--accent-red)":"var(--text-tertiary)";return h.jsx("span",{className:Pe.sessionDot,style:{color:a},children:"●"})}function vB({env:n,envSessions:a,selectedSessionId:i,isNewChatTarget:o,expanded:r,onToggleExpand:u,sessionsExpanded:d,onToggleSessionsExpand:p,provisionProgress:m,onProvision:g,onStop:y,onRemove:v,navigate:_}){const[T,C]=S.useState(!1),E=hB[n.status]||"var(--text-tertiary)",j=n.status==="connected",A=n.status==="connecting",k=n.status==="disconnected"||n.status==="error";return h.jsxs("div",{children:[h.jsx(lc,{isOpen:T,title:"Delete Environment?",description:`"${n.displayName||n.id}" will be permanently removed. This destroys the workspace and removes all data.`,onConfirm:()=>{v(n.id),C(!1)},onCancel:()=>C(!1)}),h.jsxs("div",{className:`${Pe.envRow} ${o?Pe.targeted:""} ${r?Pe.expanded:""}`,"data-testid":"env-row",onClick:u,children:[h.jsx("span",{className:`${Pe.statusDot} ${j?Pe.pulse:""}`,style:{color:E},children:"●"}),h.jsx("span",{className:Pe.envName,title:n.displayName||n.id,children:n.displayName||n.id}),h.jsxs("span",{className:Pe.envActions,children:[a.length===0&&!o&&!r&&h.jsx("span",{className:Pe.idleLabel,children:"(idle)"}),j&&h.jsx("button",{onClick:R=>{R.stopPropagation(),_(L0(n.id,n.defaultRuntime||"claude-code"))},title:"New chat",className:Pe.newChatButton,children:"+"})]})]}),r&&h.jsxs("div",{className:Pe.envActionsRow,children:[A&&m&&h.jsx("span",{className:Pe.provisionMessage,children:m.message}),n.status==="error"&&(m==null?void 0:m.stage)==="error"&&h.jsx("span",{className:Pe.errorMessage,children:m.message}),k&&h.jsx("button",{onClick:R=>{R.stopPropagation(),g(n.id)},className:Pe.connectButton,children:n.status==="error"?"Retry":"Connect"}),j&&h.jsx("button",{onClick:R=>{R.stopPropagation(),y(n.id)},className:Pe.stopButton,children:"Stop"}),!A&&h.jsx("button",{onClick:R=>{R.stopPropagation(),C(!0)},className:Pe.deleteButton,children:"Delete"})]}),a.length>0&&h.jsxs(h.Fragment,{children:[h.jsxs("div",{className:Pe.sessionSummaryRow,"data-testid":"session-summary-row",role:"button",tabIndex:0,"aria-expanded":d,"aria-label":d?"Collapse sessions":"Expand sessions",onClick:p,onKeyDown:R=>{(R.key==="Enter"||R.key===" ")&&(R.preventDefault(),p())},children:[h.jsx("span",{className:`${Pe.sessionExpandArrow} ${d?Pe.expanded:""}`,children:"▸"}),h.jsx("span",{className:Pe.sessionSummaryText,children:gB(a)}),h.jsx("span",{className:Pe.sessionCountBadge,children:a.length})]}),h.jsx(os,{children:d&&h.jsx(Rn.div,{initial:{height:0,opacity:0},animate:{height:"auto",opacity:1},exit:{height:0,opacity:0},transition:{duration:mB,ease:"easeInOut"},style:{overflow:"hidden"},children:a.map(R=>h.jsxs("div",{onClick:$=>{$.stopPropagation(),_(B0(R.id))},className:`${Pe.sessionRow} ${i===R.id?Pe.selected:""}`,title:R.prompt,"data-testid":"session-row",children:[h.jsx(yB,{status:R.status})," ",R.prompt.length>24?R.prompt.slice(0,24)+"...":R.prompt]},R.id))})})]})]})}function bB(){const{environments:n,sessions:a,provisionStatus:i,provisionEnvironment:o,stopEnvironment:r,removeEnvironment:u}=Gt(),d=Pn(),[p,m]=S.useState(null),[g,y]=S.useState(new Set),v=Qt("/sessions/:sessionId"),_=Qt("/sessions/new"),T=(v==null?void 0:v.params.sessionId)!=="new"?v==null?void 0:v.params.sessionId:void 0,[C]=Rf(),E=_?C.get("env")??void 0:void 0;return h.jsxs("div",{className:Pe.container,children:[h.jsxs("div",{className:Pe.header,children:[h.jsx("span",{className:Pe.headerLabel,children:"Environments"}),h.jsx("button",{className:Pe.addButton,onClick:()=>d(Ay),title:"Add environment",children:"+ Add Environment"})]}),n.length===0&&h.jsxs("div",{className:Pe.emptyCta,children:[h.jsx("button",{className:Pe.ctaButton,onClick:()=>d(Ay),children:"Add Environment"}),h.jsx("div",{className:Pe.ctaDescription,children:"Connect an environment to run agents"})]}),n.map(j=>{const A=a.filter(k=>k.environmentId===j.id);return h.jsx(vB,{env:j,envSessions:A,selectedSessionId:T,isNewChatTarget:E===j.id,expanded:p===j.id,onToggleExpand:()=>m(p===j.id?null:j.id),sessionsExpanded:g.has(j.id),onToggleSessionsExpand:()=>{y(k=>{const R=new Set(k);return R.has(j.id)?R.delete(j.id):R.add(j.id),R})},provisionProgress:i[j.id],onProvision:o,onStop:r,onRemove:u,navigate:d},j.id)})]})}function SB(){return h.jsx(bB,{})}const _B="_section_1ingb_14",xB="_sectionTitle_1ingb_26",TB="_sectionDescription_1ingb_35",EB="_tokenList_1ingb_48",CB="_tokenRow_1ingb_55",AB="_tokenBadge_1ingb_68",jB="_tokenName_1ingb_83",NB="_tokenTarget_1ingb_90",wB="_deleteButton_1ingb_99",DB="_addForm_1ingb_113",kB="_formRow_1ingb_119",MB="_input_1ingb_125",RB="_select_1ingb_155",OB="_addButton_1ingb_187",BB="_emptyStateInfo_1ingb_221",LB="_themeOptions_1ingb_229",UB="_themeOption_1ingb_229",zB="_themeOptionSelected_1ingb_254",IB="_themeOptionHeader_1ingb_259",VB="_themeOptionLabel_1ingb_266",HB="_themeOptionDesc_1ingb_273",PB="_variantToggle_1ingb_279",GB="_variantButton_1ingb_286",qB="_variantActive_1ingb_305",FB="_themeSwatches_1ingb_311",$B="_themeSwatch_1ingb_311",YB="_systemToggle_1ingb_325",KB="_systemToggleHint_1ingb_341",ZB="_themeActive_1ingb_348",XB="_aboutGrid_1ingb_354",QB="_aboutItem_1ingb_360",JB="_aboutLabel_1ingb_373",WB="_aboutValue_1ingb_379",e5="_aboutDot_1ingb_387",t5="_aboutDotConnected_1ingb_394",n5="_aboutDotDisconnected_1ingb_398",ce={section:_B,sectionTitle:xB,sectionDescription:TB,tokenList:EB,tokenRow:CB,tokenBadge:AB,tokenName:jB,tokenTarget:NB,deleteButton:wB,addForm:DB,formRow:kB,input:MB,select:RB,addButton:OB,emptyStateInfo:BB,themeOptions:LB,themeOption:UB,themeOptionSelected:zB,themeOptionHeader:IB,themeOptionLabel:VB,themeOptionDesc:HB,variantToggle:PB,variantButton:GB,variantActive:qB,themeSwatches:FB,themeSwatch:$B,systemToggle:YB,systemToggleHint:KB,themeActive:ZB,aboutGrid:XB,aboutItem:QB,aboutLabel:JB,aboutValue:WB,aboutDot:e5,aboutDotConnected:t5,aboutDotDisconnected:n5},a5=[{key:"claude",label:"Claude",description:"Forward Claude credentials for AI agent access.",options:[{value:"off",label:"Off"},{value:"subscription",label:"Subscription"},{value:"api_key",label:"API Key"}]},{key:"github",label:"GitHub",description:"Forward GITHUB_TOKEN and GH_TOKEN for git operations.",options:[{value:"off",label:"Off"},{value:"on",label:"On"}]},{key:"copilot",label:"Copilot",description:"Forward Copilot tokens (COPILOT_GITHUB_TOKEN, CLI config).",options:[{value:"off",label:"Off"},{value:"on",label:"On"}]},{key:"codex",label:"Codex",description:"Forward OPENAI_API_KEY for Codex/OpenAI access.",options:[{value:"off",label:"Off"},{value:"on",label:"On"}]}];function s5(){const{credentialProviders:n,updateCredentialProviders:a}=Gt(),i=(o,r)=>{const u={...n};o==="claude"?u.claude=r:u[o]=r,a(u)};return h.jsxs("section",{className:ce.section,children:[h.jsx("h3",{className:ce.sectionTitle,children:"Credential Providers"}),h.jsx("p",{className:ce.sectionDescription,children:"Enable providers to automatically forward credentials to environments at task start. Credentials are read fresh from the host each time."}),h.jsx("div",{className:ce.tokenList,children:a5.map(o=>h.jsxs("div",{className:ce.tokenRow,children:[h.jsx("span",{className:ce.tokenName,children:o.label}),h.jsx("span",{className:ce.tokenTarget,children:o.description}),h.jsx("select",{className:ce.select,value:n[o.key],onChange:r=>i(o.key,r.target.value),children:o.options.map(r=>h.jsx("option",{value:r.value,children:r.label},r.value))})]},o.key))})]})}const i5=[{value:"env_var",label:"Environment Variable"},{value:"file",label:"File"}];function l5(){const{tokens:n,setToken:a,deleteToken:i}=Gt(),{showToast:o}=ao(),[r,u]=S.useState(""),[d,p]=S.useState(""),[m,g]=S.useState("env_var"),[y,v]=S.useState(""),[_,T]=S.useState(null),C=A=>{if(A.preventDefault(),!r||!d)return;const k=m==="env_var"?y||r.toUpperCase()+"_TOKEN":"";a(r,d,m,k,m==="file"?y:""),o("Token saved successfully","success"),u(""),p(""),v("")},E=A=>{T(A)},j=()=>{_&&(i(_),o("Token deleted","info")),T(null)};return h.jsxs(h.Fragment,{children:[h.jsx(lc,{isOpen:_!==null,title:"Delete Token?",description:_?`"${_}" will be permanently removed.`:void 0,onConfirm:j,onCancel:()=>T(null)}),h.jsxs("section",{className:ce.section,children:[h.jsx("h3",{className:ce.sectionTitle,children:"Tokens"}),h.jsx("p",{className:ce.sectionDescription,children:"API tokens are auto-pushed to environments when set or updated. Values are write-only."}),n.length===0?h.jsx("div",{className:ce.emptyStateInfo,children:"Add your first API token to enable service integrations."}):h.jsx("div",{className:ce.tokenList,children:n.map(A=>h.jsxs("div",{className:ce.tokenRow,children:[h.jsx("span",{className:ce.tokenBadge,children:A.tokenType}),h.jsx("span",{className:ce.tokenName,children:A.name}),h.jsx("span",{className:ce.tokenTarget,children:A.tokenType==="env_var"?A.envVar:A.filePath}),h.jsx("button",{className:ce.deleteButton,onClick:()=>E(A.name),title:`Delete ${A.name}`,children:"×"})]},A.name))}),h.jsxs("form",{className:ce.addForm,onSubmit:C,children:[h.jsxs("div",{className:ce.formRow,children:[h.jsx("input",{className:ce.input,type:"text",placeholder:"Token name",value:r,onChange:A=>u(A.target.value)}),h.jsx("input",{className:ce.input,type:"password",placeholder:"Value",value:d,onChange:A=>p(A.target.value)})]}),h.jsxs("div",{className:ce.formRow,children:[h.jsx("select",{className:ce.select,value:m,onChange:A=>g(A.target.value),children:i5.map(A=>h.jsx("option",{value:A.value,children:A.label},A.value))}),h.jsx("input",{className:ce.input,type:"text",placeholder:m==="env_var"?"Env var name (e.g. API_TOKEN)":"File path (e.g. /home/user/.token)",value:y,onChange:A=>v(A.target.value)}),h.jsx("button",{className:ce.addButton,type:"submit",children:"Add Token"})]})]})]})]})}function o5(){return h.jsxs(h.Fragment,{children:[h.jsx(s5,{}),h.jsx(l5,{})]})}const r5="_container_1xcp7_1",c5="_header_1xcp7_7",u5="_form_1xcp7_19",d5="_formActions_1xcp7_87",f5="_list_1xcp7_93",h5="_card_1xcp7_99",p5="_active_1xcp7_109",m5="_cardHeader_1xcp7_113",g5="_cardActions_1xcp7_123",y5="_description_1xcp7_128",v5="_meta_1xcp7_134",b5="_promptDetails_1xcp7_151",S5="_promptText_1xcp7_163",_5="_empty_1xcp7_180",x5="_btnPrimary_1xcp7_186",T5="_btnSecondary_1xcp7_220",E5="_btnSmall_1xcp7_247",C5="_btnDanger_1xcp7_273",St={container:r5,header:c5,form:u5,formActions:d5,list:f5,card:h5,active:p5,cardHeader:m5,cardActions:g5,description:y5,meta:v5,promptDetails:b5,promptText:S5,empty:_5,btnPrimary:x5,btnSecondary:T5,btnSmall:E5,btnDanger:C5};function A5(){const{personas:n,createPersona:a,updatePersona:i,deletePersona:o}=Gt(),[r,u]=S.useState(null),[d,p]=S.useState(!1),[m,g]=S.useState(null),[y,v]=S.useState(""),[_,T]=S.useState(""),[C,E]=S.useState(""),[j,A]=S.useState(""),[k,R]=S.useState(""),[$,H]=S.useState(0),V=()=>{v(""),T(""),E(""),A(""),R(""),H(0)},q=()=>{V(),u(null),p(!0)},O=Y=>{v(Y.name),T(Y.description),E(Y.systemPrompt),A(Y.runtime),R(Y.model),H(Y.maxTurns),u(Y),p(!1)},ee=Y=>{Y.preventDefault(),!(!y.trim()||!C.trim())&&(r?(i(r.id,y,_,C,j,k,$),u(null)):(a(y,_,C,j,k,$),p(!1)),V())},ae=Y=>{o(Y),g(null),(r==null?void 0:r.id)===Y&&(u(null),V())},I=()=>{u(null),p(!1),V()},se=()=>h.jsxs("form",{onSubmit:ee,className:St.form,children:[h.jsx("h3",{children:r?"Edit Persona":"Create Persona"}),h.jsxs("label",{children:["Name",h.jsx("input",{type:"text",value:y,onChange:Y=>v(Y.target.value),placeholder:"e.g. Frontend Engineer",required:!0})]}),h.jsxs("label",{children:["Description",h.jsx("input",{type:"text",value:_,onChange:Y=>T(Y.target.value),placeholder:"Brief description..."})]}),h.jsxs("label",{children:["Runtime",h.jsxs("select",{value:j,onChange:Y=>A(Y.target.value),children:[h.jsx("option",{value:"",children:"Default"}),h.jsx("option",{value:"claude-code",children:"claude-code"}),h.jsx("option",{value:"codex",children:"codex"}),h.jsx("option",{value:"copilot",children:"copilot"})]})]}),h.jsxs("label",{children:["Model",h.jsx("input",{type:"text",value:k,onChange:Y=>R(Y.target.value),placeholder:"e.g. sonnet"})]}),h.jsxs("label",{children:["Max Turns",h.jsx("input",{type:"number",value:$,onChange:Y=>H(parseInt(Y.target.value,10)||0),min:0})]}),h.jsxs("label",{children:["System Prompt",h.jsx("textarea",{value:C,onChange:Y=>E(Y.target.value),placeholder:"You are a senior frontend engineer...",rows:10,required:!0})]}),h.jsxs("div",{className:St.formActions,children:[h.jsx("button",{type:"submit",className:St.btnPrimary,children:r?"Save":"Create"}),h.jsx("button",{type:"button",onClick:I,className:St.btnSecondary,children:"Cancel"})]})]});return h.jsxs("div",{className:St.container,children:[h.jsxs("div",{className:St.header,children:[h.jsx("h2",{children:"Personas"}),h.jsx("button",{onClick:q,className:St.btnPrimary,children:"+ New Persona"})]}),(d||r)&&se(),n.length===0&&!d?h.jsx("p",{className:St.empty,children:"No personas yet. Create one to get started."}):h.jsx("div",{className:St.list,children:n.map(Y=>h.jsxs("div",{className:`${St.card} ${(r==null?void 0:r.id)===Y.id?St.active:""}`,children:[h.jsxs("div",{className:St.cardHeader,children:[h.jsx("strong",{children:Y.name}),h.jsxs("div",{className:St.cardActions,children:[h.jsx("button",{onClick:()=>O(Y),className:St.btnSmall,children:"Edit"}),m===Y.id?h.jsxs(h.Fragment,{children:[h.jsx("button",{onClick:()=>ae(Y.id),className:St.btnDanger,children:"Confirm"}),h.jsx("button",{onClick:()=>g(null),className:St.btnSmall,children:"Cancel"})]}):h.jsx("button",{onClick:()=>g(Y.id),className:St.btnSmall,children:"Delete"})]})]}),Y.description&&h.jsx("p",{className:St.description,children:Y.description}),h.jsxs("div",{className:St.meta,children:[Y.runtime&&h.jsxs("span",{children:["Runtime: ",Y.runtime]}),Y.model&&h.jsxs("span",{children:["Model: ",Y.model]}),Y.maxTurns>0&&h.jsxs("span",{children:["Max turns: ",Y.maxTurns]})]}),h.jsxs("details",{className:St.promptDetails,children:[h.jsx("summary",{children:"System Prompt"}),h.jsx("pre",{className:St.promptText,children:Y.systemPrompt})]})]},Y.id))})]})}function j5(){return h.jsx(A5,{})}function N5(){const{themeId:n,resolvedThemeId:a,setTheme:i,preferSystem:o,setPreferSystem:r}=G0();return h.jsxs("section",{className:ce.section,children:[h.jsx("h3",{className:ce.sectionTitle,children:"Appearance"}),h.jsx("p",{className:ce.sectionDescription,children:"Choose how Grackle looks across the app."}),h.jsx("div",{className:ce.themeOptions,children:Wr.filter(u=>!u.hidden).map(u=>{const d=!!(u.variantLightId&&u.variantDarkId),p=d?n===u.id||n===u.variantLightId||n===u.variantDarkId:n===u.id,m=d&&a===u.variantLightId;return h.jsxs("button",{type:"button",className:`${ce.themeOption} ${p?ce.themeOptionSelected:""}`,"aria-pressed":p,onClick:()=>i(u.id),children:[h.jsxs("span",{className:ce.themeOptionHeader,children:[h.jsxs("span",{children:[h.jsx("span",{className:ce.themeOptionLabel,children:u.label}),h.jsx("span",{className:ce.themeOptionDesc,children:u.description})]}),d&&h.jsxs("span",{className:ce.variantToggle,children:[h.jsx("span",{role:"button",tabIndex:0,className:`${ce.variantButton} ${p&&m?ce.variantActive:""}`,onClick:g=>{g.stopPropagation(),r(!1),i(u.variantLightId)},onKeyDown:g=>{(g.key==="Enter"||g.key===" ")&&(g.preventDefault(),g.stopPropagation(),r(!1),i(u.variantLightId))},"aria-label":"Light variant","aria-pressed":p&&m,children:"☼"}),h.jsx("span",{role:"button",tabIndex:0,className:`${ce.variantButton} ${p&&!m?ce.variantActive:""}`,onClick:g=>{g.stopPropagation(),r(!1),i(u.variantDarkId)},onKeyDown:g=>{(g.key==="Enter"||g.key===" ")&&(g.preventDefault(),g.stopPropagation(),r(!1),i(u.variantDarkId))},"aria-label":"Dark variant","aria-pressed":p&&!m,children:"☾"})]})]}),u.swatches&&h.jsx("span",{className:ce.themeSwatches,children:u.swatches.map((g,y)=>h.jsx("span",{className:ce.themeSwatch,style:{background:g}},y))})]},u.id)})}),h.jsxs("label",{className:ce.systemToggle,children:[h.jsx("input",{type:"checkbox",checked:o,onChange:u=>r(u.target.checked)}),h.jsx("span",{children:"Match system light/dark preference"})]}),h.jsx("p",{className:ce.systemToggleHint,children:"Automatically switches between light and dark variants when available."}),h.jsxs("p",{className:ce.themeActive,children:["Active theme: ",h.jsx("strong",{children:a})]})]})}function w5(){return h.jsx(N5,{})}function D5(){const{connected:n,environments:a,sessions:i}=Gt(),o=a.filter(d=>d.status==="connected").length,r=a.length,u=i.filter(d=>["running","idle"].includes(d.status)).length;return h.jsxs("section",{className:ce.section,"data-testid":"about-panel",children:[h.jsx("h3",{className:ce.sectionTitle,children:"About"}),h.jsx("p",{className:ce.sectionDescription,children:"Connection status and application information."}),h.jsxs("div",{className:ce.aboutGrid,children:[h.jsxs("div",{className:ce.aboutItem,children:[h.jsx("span",{className:ce.aboutLabel,children:"Connection"}),h.jsxs("span",{className:ce.aboutValue,children:[h.jsx("span",{className:`${ce.aboutDot} ${n?ce.aboutDotConnected:ce.aboutDotDisconnected}`}),n?"Connected":"Disconnected"]})]}),h.jsxs("div",{className:ce.aboutItem,children:[h.jsx("span",{className:ce.aboutLabel,children:"Environments"}),h.jsxs("span",{className:ce.aboutValue,children:[o,"/",r," connected"]})]}),h.jsxs("div",{className:ce.aboutItem,children:[h.jsx("span",{className:ce.aboutLabel,children:"Active Sessions"}),h.jsx("span",{className:ce.aboutValue,children:u})]}),h.jsxs("div",{className:ce.aboutItem,children:[h.jsx("span",{className:ce.aboutLabel,children:"Version"}),h.jsx("span",{className:ce.aboutValue,children:"0.38.1"})]})]})]})}function k5(){return h.jsx(D5,{})}const M5="_root_h353j_1",R5="_body_h353j_7",O5="_main_h353j_19",B5="_sidebarWrapper_h353j_26",L5="_overlay_h353j_56",Ll={root:M5,body:R5,main:O5,sidebarWrapper:B5,overlay:L5},U5=typeof window<"u"&&new URLSearchParams(window.location.search).has("mock");function z5(){const{lastSpawnedId:n,environments:a}=Gt(),{showToast:i}=ao();Lk(a,i);const o=Pn(),r=Wt(),u=r.pathname.startsWith(ki),[d,p]=S.useState(!1),m=S.useCallback(()=>p(g=>!g),[]);return S.useEffect(()=>{p(!1)},[r.pathname]),S.useEffect(()=>{if(!d)return;const g=y=>{y.key==="Escape"&&p(!1)};return document.addEventListener("keydown",g),()=>{document.removeEventListener("keydown",g)}},[d]),S.useEffect(()=>{n&&!r.pathname.startsWith("/tasks/")&&o(B0(n),{replace:!0})},[n,o,r.pathname]),h.jsxs("div",{className:Ll.root,children:[h.jsx($E,{onToggleSidebar:u?void 0:m,sidebarOpen:d}),h.jsxs("div",{className:Ll.body,children:[h.jsx("div",{className:Ll.sidebarWrapper,"data-sidebar-open":d,"data-settings":u,children:u?h.jsx(UO,{}):h.jsx(ak,{})}),d&&!u&&h.jsx("div",{className:Ll.overlay,"data-testid":"drawer-overlay",onClick:()=>p(!1)}),h.jsxs("div",{className:Ll.main,children:[h.jsx(D0,{}),h.jsx(xk,{})]})]}),h.jsx(Bk,{})]})}function I5(){return h.jsx(uT,{children:h.jsxs(_t,{element:h.jsx(z5,{}),children:[h.jsx(_t,{index:!0,element:h.jsx(DR,{})}),h.jsx(_t,{path:"sessions/new",element:h.jsx(zR,{})}),h.jsx(_t,{path:"sessions/:sessionId",element:h.jsx(PR,{})}),h.jsx(_t,{path:"projects/:projectId",element:h.jsx(V3,{})}),h.jsx(_t,{path:"tasks/new",element:h.jsx(oO,{})}),h.jsx(_t,{path:"tasks/:taskId",element:h.jsx(qd,{})}),h.jsx(_t,{path:"tasks/:taskId/stream",element:h.jsx(qd,{})}),h.jsx(_t,{path:"tasks/:taskId/findings",element:h.jsx(qd,{})}),h.jsx(_t,{path:"tasks/:taskId/edit",element:h.jsx(rO,{})}),h.jsx(_t,{path:"environments/new",element:h.jsx(jO,{})}),h.jsxs(_t,{path:"settings",element:h.jsx(MO,{}),children:[h.jsx(_t,{index:!0,element:h.jsx(Dr,{to:"environments",replace:!0})}),h.jsx(_t,{path:"environments",element:h.jsx(SB,{})}),h.jsx(_t,{path:"credentials",element:h.jsx(o5,{})}),h.jsx(_t,{path:"tokens",element:h.jsx(Dr,{to:"../credentials",replace:!0})}),h.jsx(_t,{path:"personas",element:h.jsx(j5,{})}),h.jsx(_t,{path:"appearance",element:h.jsx(w5,{})}),h.jsx(_t,{path:"about",element:h.jsx(k5,{})})]}),h.jsx(_t,{path:"*",element:h.jsx(Dr,{to:"/",replace:!0})})]})})}function V5(){const n=U5?DE:_E;return h.jsx(LE,{children:h.jsx(ME,{children:h.jsx(n,{children:h.jsx(BT,{children:h.jsx(I5,{})})})})})}fx.createRoot(document.getElementById("root")).render(h.jsx(S.StrictMode,{children:h.jsx(V5,{})}));