@grackle-ai/web 0.52.1 → 0.52.3
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,100 +0,0 @@
|
|
|
1
|
-
import{r as S1,a as x,j as f,v as T1,b as C1,t as jr,i as E1,f as k1,M as Vf,c as Hf}from"./markdown-gcy1Jmzi.js";import{r as w1,d as Ov,H as Lv,P as Iv,i as A1,B as N1,a as j1,C as D1,M as M1}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"]'))l(r);new MutationObserver(r=>{for(const c of r)if(c.type==="childList")for(const d of c.addedNodes)d.tagName==="LINK"&&d.rel==="modulepreload"&&l(d)}).observe(document,{childList:!0,subtree:!0});function i(r){const c={};return r.integrity&&(c.integrity=r.integrity),r.referrerPolicy&&(c.referrerPolicy=r.referrerPolicy),r.crossOrigin==="use-credentials"?c.credentials="include":r.crossOrigin==="anonymous"?c.credentials="omit":c.credentials="same-origin",c}function l(r){if(r.ep)return;r.ep=!0;const c=i(r);fetch(r.href,c)}})();var Dd={exports:{}},Vo={},Md={exports:{}},Rd={};/**
|
|
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 Uv;function R1(){return Uv||(Uv=1,(function(n){function a(j,Z){var K=j.length;j.push(Z);e:for(;0<K;){var de=K-1>>>1,Y=j[de];if(0<r(Y,Z))j[de]=Z,j[K]=Y,K=de;else break e}}function i(j){return j.length===0?null:j[0]}function l(j){if(j.length===0)return null;var Z=j[0],K=j.pop();if(K!==Z){j[0]=K;e:for(var de=0,Y=j.length,je=Y>>>1;de<je;){var Re=2*(de+1)-1,Te=j[Re],st=Re+1,kt=j[st];if(0>r(Te,K))st<Y&&0>r(kt,Te)?(j[de]=kt,j[st]=K,de=st):(j[de]=Te,j[Re]=K,de=Re);else if(st<Y&&0>r(kt,K))j[de]=kt,j[st]=K,de=st;else break e}}return Z}function r(j,Z){var K=j.sortIndex-Z.sortIndex;return K!==0?K:j.id-Z.id}if(n.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var c=performance;n.unstable_now=function(){return c.now()}}else{var d=Date,p=d.now();n.unstable_now=function(){return d.now()-p}}var m=[],g=[],y=1,v=null,_=3,C=!1,E=!1,k=!1,A=!1,S=typeof setTimeout=="function"?setTimeout:null,N=typeof clearTimeout=="function"?clearTimeout:null,D=typeof setImmediate<"u"?setImmediate:null;function H(j){for(var Z=i(g);Z!==null;){if(Z.callback===null)l(g);else if(Z.startTime<=j)l(g),Z.sortIndex=Z.expirationTime,a(m,Z);else break;Z=i(g)}}function O(j){if(k=!1,H(j),!E)if(i(m)!==null)E=!0,$||($=!0,ne());else{var Z=i(g);Z!==null&&oe(O,Z.startTime-j)}}var $=!1,R=-1,L=5,G=-1;function ee(){return A?!0:!(n.unstable_now()-G<L)}function te(){if(A=!1,$){var j=n.unstable_now();G=j;var Z=!0;try{e:{E=!1,k&&(k=!1,N(R),R=-1),C=!0;var K=_;try{t:{for(H(j),v=i(m);v!==null&&!(v.expirationTime>j&&ee());){var de=v.callback;if(typeof de=="function"){v.callback=null,_=v.priorityLevel;var Y=de(v.expirationTime<=j);if(j=n.unstable_now(),typeof Y=="function"){v.callback=Y,H(j),Z=!0;break t}v===i(m)&&l(m),H(j)}else l(m);v=i(m)}if(v!==null)Z=!0;else{var je=i(g);je!==null&&oe(O,je.startTime-j),Z=!1}}break e}finally{v=null,_=K,C=!1}Z=void 0}}finally{Z?ne():$=!1}}}var ne;if(typeof D=="function")ne=function(){D(te)};else if(typeof MessageChannel<"u"){var ie=new MessageChannel,he=ie.port2;ie.port1.onmessage=te,ne=function(){he.postMessage(null)}}else ne=function(){S(te,0)};function oe(j,Z){R=S(function(){j(n.unstable_now())},Z)}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(j){j.callback=null},n.unstable_forceFrameRate=function(j){0>j||125<j?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):L=0<j?Math.floor(1e3/j):5},n.unstable_getCurrentPriorityLevel=function(){return _},n.unstable_next=function(j){switch(_){case 1:case 2:case 3:var Z=3;break;default:Z=_}var K=_;_=Z;try{return j()}finally{_=K}},n.unstable_requestPaint=function(){A=!0},n.unstable_runWithPriority=function(j,Z){switch(j){case 1:case 2:case 3:case 4:case 5:break;default:j=3}var K=_;_=j;try{return Z()}finally{_=K}},n.unstable_scheduleCallback=function(j,Z,K){var de=n.unstable_now();switch(typeof K=="object"&&K!==null?(K=K.delay,K=typeof K=="number"&&0<K?de+K:de):K=de,j){case 1:var Y=-1;break;case 2:Y=250;break;case 5:Y=1073741823;break;case 4:Y=1e4;break;default:Y=5e3}return Y=K+Y,j={id:y++,callback:Z,priorityLevel:j,startTime:K,expirationTime:Y,sortIndex:-1},K>de?(j.sortIndex=K,a(g,j),i(m)===null&&j===i(g)&&(k?(N(R),R=-1):k=!0,oe(O,K-de))):(j.sortIndex=Y,a(m,j),E||C||(E=!0,$||($=!0,ne()))),j},n.unstable_shouldYield=ee,n.unstable_wrapCallback=function(j){var Z=_;return function(){var K=_;_=Z;try{return j.apply(this,arguments)}finally{_=K}}}})(Rd)),Rd}var zv;function B1(){return zv||(zv=1,Md.exports=R1()),Md.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 Vv;function O1(){if(Vv)return Vo;Vv=1;var n=B1(),a=S1(),i=w1();function l(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 c(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(c(e)!==e)throw Error(l(188))}function g(e){var t=e.alternate;if(!t){if(t=c(e),t===null)throw Error(l(188));return t!==e?null:e}for(var s=e,o=t;;){var u=s.return;if(u===null)break;var h=u.alternate;if(h===null){if(o=u.return,o!==null){s=o;continue}break}if(u.child===h.child){for(h=u.child;h;){if(h===s)return m(u),e;if(h===o)return m(u),t;h=h.sibling}throw Error(l(188))}if(s.return!==o.return)s=u,o=h;else{for(var b=!1,T=u.child;T;){if(T===s){b=!0,s=u,o=h;break}if(T===o){b=!0,o=u,s=h;break}T=T.sibling}if(!b){for(T=h.child;T;){if(T===s){b=!0,s=h,o=u;break}if(T===o){b=!0,o=h,s=u;break}T=T.sibling}if(!b)throw Error(l(189))}}if(s.alternate!==o)throw Error(l(190))}if(s.tag!==3)throw Error(l(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"),C=Symbol.for("react.transitional.element"),E=Symbol.for("react.portal"),k=Symbol.for("react.fragment"),A=Symbol.for("react.strict_mode"),S=Symbol.for("react.profiler"),N=Symbol.for("react.consumer"),D=Symbol.for("react.context"),H=Symbol.for("react.forward_ref"),O=Symbol.for("react.suspense"),$=Symbol.for("react.suspense_list"),R=Symbol.for("react.memo"),L=Symbol.for("react.lazy"),G=Symbol.for("react.activity"),ee=Symbol.for("react.memo_cache_sentinel"),te=Symbol.iterator;function ne(e){return e===null||typeof e!="object"?null:(e=te&&e[te]||e["@@iterator"],typeof e=="function"?e:null)}var ie=Symbol.for("react.client.reference");function he(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===ie?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case k:return"Fragment";case S:return"Profiler";case A:return"StrictMode";case O:return"Suspense";case $:return"SuspenseList";case G:return"Activity"}if(typeof e=="object")switch(e.$$typeof){case E:return"Portal";case D:return e.displayName||"Context";case N:return(e._context.displayName||"Context")+".Consumer";case H:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case R:return t=e.displayName||null,t!==null?t:he(e.type)||"Memo";case L:t=e._payload,e=e._init;try{return he(e(t))}catch{}}return null}var oe=Array.isArray,j=a.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Z=i.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,K={pending:!1,data:null,method:null,action:null},de=[],Y=-1;function je(e){return{current:e}}function Re(e){0>Y||(e.current=de[Y],de[Y]=null,Y--)}function Te(e,t){Y++,de[Y]=e.current,e.current=t}var st=je(null),kt=je(null),wt=je(null),Le=je(null);function xe(e,t){switch(Te(wt,t),Te(kt,e),Te(st,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?sv(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=sv(t),e=iv(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}Re(st),Te(st,e)}function J(){Re(st),Re(kt),Re(wt)}function Ze(e){e.memoizedState!==null&&Te(Le,e);var t=st.current,s=iv(t,e.type);t!==s&&(Te(kt,e),Te(st,s))}function we(e){kt.current===e&&(Re(st),Re(kt)),Le.current===e&&(Re(Le),Lo._currentValue=K)}var We,ze;function At(e){if(We===void 0)try{throw Error()}catch(s){var t=s.stack.trim().match(/\n( *(at )?)/);We=t&&t[1]||"",ze=-1<s.stack.indexOf(`
|
|
18
|
-
at`)?" (<anonymous>)":-1<s.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
19
|
-
`+We+e+ze}var Bt=!1;function Qt(e,t){if(!e||Bt)return"";Bt=!0;var s=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var o={DetermineComponentFrameRoot:function(){try{if(t){var Q=function(){throw Error()};if(Object.defineProperty(Q.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(Q,[])}catch(P){var V=P}Reflect.construct(e,[],Q)}else{try{Q.call()}catch(P){V=P}e.call(Q.prototype)}}else{try{throw Error()}catch(P){V=P}(Q=e())&&typeof Q.catch=="function"&&Q.catch(function(){})}}catch(P){if(P&&V&&typeof P.stack=="string")return[P.stack,V.stack]}return[null,null]}};o.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var u=Object.getOwnPropertyDescriptor(o.DetermineComponentFrameRoot,"name");u&&u.configurable&&Object.defineProperty(o.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var h=o.DetermineComponentFrameRoot(),b=h[0],T=h[1];if(b&&T){var w=b.split(`
|
|
20
|
-
`),z=T.split(`
|
|
21
|
-
`);for(u=o=0;o<w.length&&!w[o].includes("DetermineComponentFrameRoot");)o++;for(;u<z.length&&!z[u].includes("DetermineComponentFrameRoot");)u++;if(o===w.length||u===z.length)for(o=w.length-1,u=z.length-1;1<=o&&0<=u&&w[o]!==z[u];)u--;for(;1<=o&&0<=u;o--,u--)if(w[o]!==z[u]){if(o!==1||u!==1)do if(o--,u--,0>u||w[o]!==z[u]){var F=`
|
|
22
|
-
`+w[o].replace(" at new "," at ");return e.displayName&&F.includes("<anonymous>")&&(F=F.replace("<anonymous>",e.displayName)),F}while(1<=o&&0<=u);break}}}finally{Bt=!1,Error.prepareStackTrace=s}return(s=e?e.displayName||e.name:"")?At(s):""}function Je(e,t){switch(e.tag){case 26:case 27:case 5:return At(e.type);case 16:return At("Lazy");case 13:return e.child!==t&&t!==null?At("Suspense Fallback"):At("Suspense");case 19:return At("SuspenseList");case 0:case 15:return Qt(e.type,!1);case 11:return Qt(e.type.render,!1);case 1:return Qt(e.type,!0);case 31:return At("Activity");default:return""}}function Ie(e){try{var t="",s=null;do t+=Je(e,s),s=e,e=e.return;while(e);return t}catch(o){return`
|
|
23
|
-
Error generating stack: `+o.message+`
|
|
24
|
-
`+o.stack}}var En=Object.prototype.hasOwnProperty,sa=n.unstable_scheduleCallback,Yn=n.unstable_cancelCallback,Gs=n.unstable_shouldYield,X=n.unstable_requestPaint,W=n.unstable_now,le=n.unstable_getCurrentPriorityLevel,ye=n.unstable_ImmediatePriority,me=n.unstable_UserBlockingPriority,He=n.unstable_NormalPriority,Ce=n.unstable_LowPriority,yt=n.unstable_IdlePriority,et=n.log,Nt=n.unstable_setDisableYieldValue,bt=null,Ge=null;function Ve(e){if(typeof et=="function"&&Nt(e),Ge&&typeof Ge.setStrictMode=="function")try{Ge.setStrictMode(bt,e)}catch{}}var Ee=Math.clz32?Math.clz32:Ma,ia=Math.log,an=Math.LN2;function Ma(e){return e>>>=0,e===0?32:31-(ia(e)/an|0)|0}var rt=256,Se=262144,_t=4194304;function se(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 Ne(e,t,s){var o=e.pendingLanes;if(o===0)return 0;var u=0,h=e.suspendedLanes,b=e.pingedLanes;e=e.warmLanes;var T=o&134217727;return T!==0?(o=T&~h,o!==0?u=se(o):(b&=T,b!==0?u=se(b):s||(s=T&~e,s!==0&&(u=se(s))))):(T=o&~h,T!==0?u=se(T):b!==0?u=se(b):s||(s=o&~e,s!==0&&(u=se(s)))),u===0?0:t!==0&&t!==u&&(t&h)===0&&(h=u&-u,s=t&-t,h>=s||h===32&&(s&4194048)!==0)?t:u}function sn(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function Ki(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 zh(){var e=_t;return _t<<=1,(_t&62914560)===0&&(_t=4194304),e}function bc(e){for(var t=[],s=0;31>s;s++)t.push(e);return t}function Zi(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function u_(e,t,s,o,u,h){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 T=e.entanglements,w=e.expirationTimes,z=e.hiddenUpdates;for(s=b&~s;0<s;){var F=31-Ee(s),Q=1<<F;T[F]=0,w[F]=-1;var V=z[F];if(V!==null)for(z[F]=null,F=0;F<V.length;F++){var P=V[F];P!==null&&(P.lane&=-536870913)}s&=~Q}o!==0&&Vh(e,o,0),h!==0&&u===0&&e.tag!==0&&(e.suspendedLanes|=h&~(b&~t))}function Vh(e,t,s){e.pendingLanes|=t,e.suspendedLanes&=~t;var o=31-Ee(t);e.entangledLanes|=t,e.entanglements[o]=e.entanglements[o]|1073741824|s&261930}function Hh(e,t){var s=e.entangledLanes|=t;for(e=e.entanglements;s;){var o=31-Ee(s),u=1<<o;u&t|e[o]&t&&(e[o]|=t),s&=~u}}function Gh(e,t){var s=t&-t;return s=(s&42)!==0?1:xc(s),(s&(e.suspendedLanes|t))!==0?0:s}function xc(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 _c(e){return e&=-e,2<e?8<e?(e&134217727)!==0?32:268435456:8:2}function Ph(){var e=Z.p;return e!==0?e:(e=window.event,e===void 0?32:Av(e.type))}function $h(e,t){var s=Z.p;try{return Z.p=e,t()}finally{Z.p=s}}var Ra=Math.random().toString(36).slice(2),$t="__reactFiber$"+Ra,on="__reactProps$"+Ra,Ps="__reactContainer$"+Ra,Sc="__reactEvents$"+Ra,d_="__reactListeners$"+Ra,f_="__reactHandles$"+Ra,Fh="__reactResources$"+Ra,Xi="__reactMarker$"+Ra;function Tc(e){delete e[$t],delete e[on],delete e[Sc],delete e[d_],delete e[f_]}function $s(e){var t=e[$t];if(t)return t;for(var s=e.parentNode;s;){if(t=s[Ps]||s[$t]){if(s=t.alternate,t.child!==null||s!==null&&s.child!==null)for(e=fv(e);e!==null;){if(s=e[$t])return s;e=fv(e)}return t}e=s,s=e.parentNode}return null}function Fs(e){if(e=e[$t]||e[Ps]){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(l(33))}function Ys(e){var t=e[Fh];return t||(t=e[Fh]={hoistableStyles:new Map,hoistableScripts:new Map}),t}function Gt(e){e[Xi]=!0}var Yh=new Set,qh={};function fs(e,t){qs(e,t),qs(e+"Capture",t)}function qs(e,t){for(qh[e]=t,e=0;e<t.length;e++)Yh.add(t[e])}var h_=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]*$"),Kh={},Zh={};function p_(e){return En.call(Zh,e)?!0:En.call(Kh,e)?!1:h_.test(e)?Zh[e]=!0:(Kh[e]=!0,!1)}function yl(e,t,s){if(p_(t))if(s===null)e.removeAttribute(t);else{switch(typeof s){case"undefined":case"function":case"symbol":e.removeAttribute(t);return;case"boolean":var o=t.toLowerCase().slice(0,5);if(o!=="data-"&&o!=="aria-"){e.removeAttribute(t);return}}e.setAttribute(t,""+s)}}function bl(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 oa(e,t,s,o){if(o===null)e.removeAttribute(s);else{switch(typeof o){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(s);return}e.setAttributeNS(t,s,""+o)}}function kn(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Xh(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function m_(e,t,s){var o=Object.getOwnPropertyDescriptor(e.constructor.prototype,t);if(!e.hasOwnProperty(t)&&typeof o<"u"&&typeof o.get=="function"&&typeof o.set=="function"){var u=o.get,h=o.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return u.call(this)},set:function(b){s=""+b,h.call(this,b)}}),Object.defineProperty(e,t,{enumerable:o.enumerable}),{getValue:function(){return s},setValue:function(b){s=""+b},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Cc(e){if(!e._valueTracker){var t=Xh(e)?"checked":"value";e._valueTracker=m_(e,t,""+e[t])}}function Qh(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var s=t.getValue(),o="";return e&&(o=Xh(e)?e.checked?"true":"false":e.value),e=o,e!==s?(t.setValue(e),!0):!1}function xl(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 g_=/[\n"\\]/g;function wn(e){return e.replace(g_,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function Ec(e,t,s,o,u,h,b,T){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=""+kn(t)):e.value!==""+kn(t)&&(e.value=""+kn(t)):b!=="submit"&&b!=="reset"||e.removeAttribute("value"),t!=null?kc(e,b,kn(t)):s!=null?kc(e,b,kn(s)):o!=null&&e.removeAttribute("value"),u==null&&h!=null&&(e.defaultChecked=!!h),u!=null&&(e.checked=u&&typeof u!="function"&&typeof u!="symbol"),T!=null&&typeof T!="function"&&typeof T!="symbol"&&typeof T!="boolean"?e.name=""+kn(T):e.removeAttribute("name")}function Wh(e,t,s,o,u,h,b,T){if(h!=null&&typeof h!="function"&&typeof h!="symbol"&&typeof h!="boolean"&&(e.type=h),t!=null||s!=null){if(!(h!=="submit"&&h!=="reset"||t!=null)){Cc(e);return}s=s!=null?""+kn(s):"",t=t!=null?""+kn(t):s,T||t===e.value||(e.value=t),e.defaultValue=t}o=o??u,o=typeof o!="function"&&typeof o!="symbol"&&!!o,e.checked=T?e.checked:!!o,e.defaultChecked=!!o,b!=null&&typeof b!="function"&&typeof b!="symbol"&&typeof b!="boolean"&&(e.name=b),Cc(e)}function kc(e,t,s){t==="number"&&xl(e.ownerDocument)===e||e.defaultValue===""+s||(e.defaultValue=""+s)}function Ks(e,t,s,o){if(e=e.options,t){t={};for(var u=0;u<s.length;u++)t["$"+s[u]]=!0;for(s=0;s<e.length;s++)u=t.hasOwnProperty("$"+e[s].value),e[s].selected!==u&&(e[s].selected=u),u&&o&&(e[s].defaultSelected=!0)}else{for(s=""+kn(s),t=null,u=0;u<e.length;u++){if(e[u].value===s){e[u].selected=!0,o&&(e[u].defaultSelected=!0);return}t!==null||e[u].disabled||(t=e[u])}t!==null&&(t.selected=!0)}}function Jh(e,t,s){if(t!=null&&(t=""+kn(t),t!==e.value&&(e.value=t),s==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=s!=null?""+kn(s):""}function ep(e,t,s,o){if(t==null){if(o!=null){if(s!=null)throw Error(l(92));if(oe(o)){if(1<o.length)throw Error(l(93));o=o[0]}s=o}s==null&&(s=""),t=s}s=kn(t),e.defaultValue=s,o=e.textContent,o===s&&o!==""&&o!==null&&(e.value=o),Cc(e)}function Zs(e,t){if(t){var s=e.firstChild;if(s&&s===e.lastChild&&s.nodeType===3){s.nodeValue=t;return}}e.textContent=t}var v_=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 tp(e,t,s){var o=t.indexOf("--")===0;s==null||typeof s=="boolean"||s===""?o?e.setProperty(t,""):t==="float"?e.cssFloat="":e[t]="":o?e.setProperty(t,s):typeof s!="number"||s===0||v_.has(t)?t==="float"?e.cssFloat=s:e[t]=(""+s).trim():e[t]=s+"px"}function np(e,t,s){if(t!=null&&typeof t!="object")throw Error(l(62));if(e=e.style,s!=null){for(var o in s)!s.hasOwnProperty(o)||t!=null&&t.hasOwnProperty(o)||(o.indexOf("--")===0?e.setProperty(o,""):o==="float"?e.cssFloat="":e[o]="");for(var u in t)o=t[u],t.hasOwnProperty(u)&&s[u]!==o&&tp(e,u,o)}else for(var h in t)t.hasOwnProperty(h)&&tp(e,h,t[h])}function wc(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 y_=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"]]),b_=/^[\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 _l(e){return b_.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function la(){}var Ac=null;function Nc(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Xs=null,Qs=null;function ap(e){var t=Fs(e);if(t&&(e=t.stateNode)){var s=e[on]||null;e:switch(e=t.stateNode,t.type){case"input":if(Ec(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="'+wn(""+t)+'"][type="radio"]'),t=0;t<s.length;t++){var o=s[t];if(o!==e&&o.form===e.form){var u=o[on]||null;if(!u)throw Error(l(90));Ec(o,u.value,u.defaultValue,u.defaultValue,u.checked,u.defaultChecked,u.type,u.name)}}for(t=0;t<s.length;t++)o=s[t],o.form===e.form&&Qh(o)}break e;case"textarea":Jh(e,s.value,s.defaultValue);break e;case"select":t=s.value,t!=null&&Ks(e,!!s.multiple,t,!1)}}}var jc=!1;function sp(e,t,s){if(jc)return e(t,s);jc=!0;try{var o=e(t);return o}finally{if(jc=!1,(Xs!==null||Qs!==null)&&(rr(),Xs&&(t=Xs,e=Qs,Qs=Xs=null,ap(t),e)))for(t=0;t<e.length;t++)ap(e[t])}}function Wi(e,t){var s=e.stateNode;if(s===null)return null;var o=s[on]||null;if(o===null)return null;s=o[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":(o=!o.disabled)||(e=e.type,o=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!o;break e;default:e=!1}if(e)return null;if(s&&typeof s!="function")throw Error(l(231,t,typeof s));return s}var ra=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Dc=!1;if(ra)try{var Ji={};Object.defineProperty(Ji,"passive",{get:function(){Dc=!0}}),window.addEventListener("test",Ji,Ji),window.removeEventListener("test",Ji,Ji)}catch{Dc=!1}var Ba=null,Mc=null,Sl=null;function ip(){if(Sl)return Sl;var e,t=Mc,s=t.length,o,u="value"in Ba?Ba.value:Ba.textContent,h=u.length;for(e=0;e<s&&t[e]===u[e];e++);var b=s-e;for(o=1;o<=b&&t[s-o]===u[h-o];o++);return Sl=u.slice(e,1<o?1-o:void 0)}function Tl(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 Cl(){return!0}function op(){return!1}function ln(e){function t(s,o,u,h,b){this._reactName=s,this._targetInst=u,this.type=o,this.nativeEvent=h,this.target=b,this.currentTarget=null;for(var T in e)e.hasOwnProperty(T)&&(s=e[T],this[T]=s?s(h):h[T]);return this.isDefaultPrevented=(h.defaultPrevented!=null?h.defaultPrevented:h.returnValue===!1)?Cl:op,this.isPropagationStopped=op,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=Cl)},stopPropagation:function(){var s=this.nativeEvent;s&&(s.stopPropagation?s.stopPropagation():typeof s.cancelBubble!="unknown"&&(s.cancelBubble=!0),this.isPropagationStopped=Cl)},persist:function(){},isPersistent:Cl}),t}var hs={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},El=ln(hs),eo=v({},hs,{view:0,detail:0}),x_=ln(eo),Rc,Bc,to,kl=v({},eo,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Lc,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!==to&&(to&&e.type==="mousemove"?(Rc=e.screenX-to.screenX,Bc=e.screenY-to.screenY):Bc=Rc=0,to=e),Rc)},movementY:function(e){return"movementY"in e?e.movementY:Bc}}),lp=ln(kl),__=v({},kl,{dataTransfer:0}),S_=ln(__),T_=v({},eo,{relatedTarget:0}),Oc=ln(T_),C_=v({},hs,{animationName:0,elapsedTime:0,pseudoElement:0}),E_=ln(C_),k_=v({},hs,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),w_=ln(k_),A_=v({},hs,{data:0}),rp=ln(A_),N_={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},j_={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"},D_={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function M_(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=D_[e])?!!t[e]:!1}function Lc(){return M_}var R_=v({},eo,{key:function(e){if(e.key){var t=N_[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=Tl(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?j_[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Lc,charCode:function(e){return e.type==="keypress"?Tl(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Tl(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),B_=ln(R_),O_=v({},kl,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),cp=ln(O_),L_=v({},eo,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Lc}),I_=ln(L_),U_=v({},hs,{propertyName:0,elapsedTime:0,pseudoElement:0}),z_=ln(U_),V_=v({},kl,{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}),H_=ln(V_),G_=v({},hs,{newState:0,oldState:0}),P_=ln(G_),$_=[9,13,27,32],Ic=ra&&"CompositionEvent"in window,no=null;ra&&"documentMode"in document&&(no=document.documentMode);var F_=ra&&"TextEvent"in window&&!no,up=ra&&(!Ic||no&&8<no&&11>=no),dp=" ",fp=!1;function hp(e,t){switch(e){case"keyup":return $_.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function pp(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Ws=!1;function Y_(e,t){switch(e){case"compositionend":return pp(t);case"keypress":return t.which!==32?null:(fp=!0,dp);case"textInput":return e=t.data,e===dp&&fp?null:e;default:return null}}function q_(e,t){if(Ws)return e==="compositionend"||!Ic&&hp(e,t)?(e=ip(),Sl=Mc=Ba=null,Ws=!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 up&&t.locale!=="ko"?null:t.data;default:return null}}var K_={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 mp(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!K_[e.type]:t==="textarea"}function gp(e,t,s,o){Xs?Qs?Qs.push(o):Qs=[o]:Xs=o,t=mr(t,"onChange"),0<t.length&&(s=new El("onChange","change",null,s,o),e.push({event:s,listeners:t}))}var ao=null,so=null;function Z_(e){Wg(e,0)}function wl(e){var t=Qi(e);if(Qh(t))return e}function vp(e,t){if(e==="change")return t}var yp=!1;if(ra){var Uc;if(ra){var zc="oninput"in document;if(!zc){var bp=document.createElement("div");bp.setAttribute("oninput","return;"),zc=typeof bp.oninput=="function"}Uc=zc}else Uc=!1;yp=Uc&&(!document.documentMode||9<document.documentMode)}function xp(){ao&&(ao.detachEvent("onpropertychange",_p),so=ao=null)}function _p(e){if(e.propertyName==="value"&&wl(so)){var t=[];gp(t,so,e,Nc(e)),sp(Z_,t)}}function X_(e,t,s){e==="focusin"?(xp(),ao=t,so=s,ao.attachEvent("onpropertychange",_p)):e==="focusout"&&xp()}function Q_(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return wl(so)}function W_(e,t){if(e==="click")return wl(t)}function J_(e,t){if(e==="input"||e==="change")return wl(t)}function eS(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var pn=typeof Object.is=="function"?Object.is:eS;function io(e,t){if(pn(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var s=Object.keys(e),o=Object.keys(t);if(s.length!==o.length)return!1;for(o=0;o<s.length;o++){var u=s[o];if(!En.call(t,u)||!pn(e[u],t[u]))return!1}return!0}function Sp(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Tp(e,t){var s=Sp(e);e=0;for(var o;s;){if(s.nodeType===3){if(o=e+s.textContent.length,e<=t&&o>=t)return{node:s,offset:t-e};e=o}e:{for(;s;){if(s.nextSibling){s=s.nextSibling;break e}s=s.parentNode}s=void 0}s=Sp(s)}}function Cp(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Cp(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Ep(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=xl(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=xl(e.document)}return t}function Vc(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 tS=ra&&"documentMode"in document&&11>=document.documentMode,Js=null,Hc=null,oo=null,Gc=!1;function kp(e,t,s){var o=s.window===s?s.document:s.nodeType===9?s:s.ownerDocument;Gc||Js==null||Js!==xl(o)||(o=Js,"selectionStart"in o&&Vc(o)?o={start:o.selectionStart,end:o.selectionEnd}:(o=(o.ownerDocument&&o.ownerDocument.defaultView||window).getSelection(),o={anchorNode:o.anchorNode,anchorOffset:o.anchorOffset,focusNode:o.focusNode,focusOffset:o.focusOffset}),oo&&io(oo,o)||(oo=o,o=mr(Hc,"onSelect"),0<o.length&&(t=new El("onSelect","select",null,t,s),e.push({event:t,listeners:o}),t.target=Js)))}function ps(e,t){var s={};return s[e.toLowerCase()]=t.toLowerCase(),s["Webkit"+e]="webkit"+t,s["Moz"+e]="moz"+t,s}var ei={animationend:ps("Animation","AnimationEnd"),animationiteration:ps("Animation","AnimationIteration"),animationstart:ps("Animation","AnimationStart"),transitionrun:ps("Transition","TransitionRun"),transitionstart:ps("Transition","TransitionStart"),transitioncancel:ps("Transition","TransitionCancel"),transitionend:ps("Transition","TransitionEnd")},Pc={},wp={};ra&&(wp=document.createElement("div").style,"AnimationEvent"in window||(delete ei.animationend.animation,delete ei.animationiteration.animation,delete ei.animationstart.animation),"TransitionEvent"in window||delete ei.transitionend.transition);function ms(e){if(Pc[e])return Pc[e];if(!ei[e])return e;var t=ei[e],s;for(s in t)if(t.hasOwnProperty(s)&&s in wp)return Pc[e]=t[s];return e}var Ap=ms("animationend"),Np=ms("animationiteration"),jp=ms("animationstart"),nS=ms("transitionrun"),aS=ms("transitionstart"),sS=ms("transitioncancel"),Dp=ms("transitionend"),Mp=new Map,$c="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(" ");$c.push("scrollEnd");function Gn(e,t){Mp.set(e,t),fs(t,[e])}var Al=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)},An=[],ti=0,Fc=0;function Nl(){for(var e=ti,t=Fc=ti=0;t<e;){var s=An[t];An[t++]=null;var o=An[t];An[t++]=null;var u=An[t];An[t++]=null;var h=An[t];if(An[t++]=null,o!==null&&u!==null){var b=o.pending;b===null?u.next=u:(u.next=b.next,b.next=u),o.pending=u}h!==0&&Rp(s,u,h)}}function jl(e,t,s,o){An[ti++]=e,An[ti++]=t,An[ti++]=s,An[ti++]=o,Fc|=o,e.lanes|=o,e=e.alternate,e!==null&&(e.lanes|=o)}function Yc(e,t,s,o){return jl(e,t,s,o),Dl(e)}function gs(e,t){return jl(e,null,null,t),Dl(e)}function Rp(e,t,s){e.lanes|=s;var o=e.alternate;o!==null&&(o.lanes|=s);for(var u=!1,h=e.return;h!==null;)h.childLanes|=s,o=h.alternate,o!==null&&(o.childLanes|=s),h.tag===22&&(e=h.stateNode,e===null||e._visibility&1||(u=!0)),e=h,h=h.return;return e.tag===3?(h=e.stateNode,u&&t!==null&&(u=31-Ee(s),e=h.hiddenUpdates,o=e[u],o===null?e[u]=[t]:o.push(t),t.lane=s|536870912),h):null}function Dl(e){if(50<No)throw No=0,td=null,Error(l(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var ni={};function iS(e,t,s,o){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=o,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function mn(e,t,s,o){return new iS(e,t,s,o)}function qc(e){return e=e.prototype,!(!e||!e.isReactComponent)}function ca(e,t){var s=e.alternate;return s===null?(s=mn(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 Bp(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 Ml(e,t,s,o,u,h){var b=0;if(o=e,typeof e=="function")qc(e)&&(b=1);else if(typeof e=="string")b=u1(e,s,st.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(e){case G:return e=mn(31,s,t,u),e.elementType=G,e.lanes=h,e;case k:return vs(s.children,u,h,t);case A:b=8,u|=24;break;case S:return e=mn(12,s,t,u|2),e.elementType=S,e.lanes=h,e;case O:return e=mn(13,s,t,u),e.elementType=O,e.lanes=h,e;case $:return e=mn(19,s,t,u),e.elementType=$,e.lanes=h,e;default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case D:b=10;break e;case N:b=9;break e;case H:b=11;break e;case R:b=14;break e;case L:b=16,o=null;break e}b=29,s=Error(l(130,e===null?"null":typeof e,"")),o=null}return t=mn(b,s,t,u),t.elementType=e,t.type=o,t.lanes=h,t}function vs(e,t,s,o){return e=mn(7,e,o,t),e.lanes=s,e}function Kc(e,t,s){return e=mn(6,e,null,t),e.lanes=s,e}function Op(e){var t=mn(18,null,null,0);return t.stateNode=e,t}function Zc(e,t,s){return t=mn(4,e.children!==null?e.children:[],e.key,t),t.lanes=s,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var Lp=new WeakMap;function Nn(e,t){if(typeof e=="object"&&e!==null){var s=Lp.get(e);return s!==void 0?s:(t={value:e,source:t,stack:Ie(t)},Lp.set(e,t),t)}return{value:e,source:t,stack:Ie(t)}}var ai=[],si=0,Rl=null,lo=0,jn=[],Dn=0,Oa=null,qn=1,Kn="";function ua(e,t){ai[si++]=lo,ai[si++]=Rl,Rl=e,lo=t}function Ip(e,t,s){jn[Dn++]=qn,jn[Dn++]=Kn,jn[Dn++]=Oa,Oa=e;var o=qn;e=Kn;var u=32-Ee(o)-1;o&=~(1<<u),s+=1;var h=32-Ee(t)+u;if(30<h){var b=u-u%5;h=(o&(1<<b)-1).toString(32),o>>=b,u-=b,qn=1<<32-Ee(t)+u|s<<u|o,Kn=h+e}else qn=1<<h|s<<u|o,Kn=e}function Xc(e){e.return!==null&&(ua(e,1),Ip(e,1,0))}function Qc(e){for(;e===Rl;)Rl=ai[--si],ai[si]=null,lo=ai[--si],ai[si]=null;for(;e===Oa;)Oa=jn[--Dn],jn[Dn]=null,Kn=jn[--Dn],jn[Dn]=null,qn=jn[--Dn],jn[Dn]=null}function Up(e,t){jn[Dn++]=qn,jn[Dn++]=Kn,jn[Dn++]=Oa,qn=t.id,Kn=t.overflow,Oa=e}var Ft=null,dt=null,Ue=!1,La=null,Mn=!1,Wc=Error(l(519));function Ia(e){var t=Error(l(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw ro(Nn(t,e)),Wc}function zp(e){var t=e.stateNode,s=e.type,o=e.memoizedProps;switch(t[$t]=e,t[on]=o,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<Do.length;s++)Me(Do[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,o.value,o.defaultValue,o.checked,o.defaultChecked,o.type,o.name,!0);break;case"select":Me("invalid",t);break;case"textarea":Me("invalid",t),ep(t,o.value,o.defaultValue,o.children)}s=o.children,typeof s!="string"&&typeof s!="number"&&typeof s!="bigint"||t.textContent===""+s||o.suppressHydrationWarning===!0||nv(t.textContent,s)?(o.popover!=null&&(Me("beforetoggle",t),Me("toggle",t)),o.onScroll!=null&&Me("scroll",t),o.onScrollEnd!=null&&Me("scrollend",t),o.onClick!=null&&(t.onclick=la),t=!0):t=!1,t||Ia(e,!0)}function Vp(e){for(Ft=e.return;Ft;)switch(Ft.tag){case 5:case 31:case 13:Mn=!1;return;case 27:case 3:Mn=!0;return;default:Ft=Ft.return}}function ii(e){if(e!==Ft)return!1;if(!Ue)return Vp(e),Ue=!0,!1;var t=e.tag,s;if((s=t!==3&&t!==27)&&((s=t===5)&&(s=e.type,s=!(s!=="form"&&s!=="button")||gd(e.type,e.memoizedProps)),s=!s),s&&dt&&Ia(e),Vp(e),t===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(l(317));dt=dv(e)}else if(t===31){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(l(317));dt=dv(e)}else t===27?(t=dt,Qa(e.type)?(e=_d,_d=null,dt=e):dt=t):dt=Ft?Bn(e.stateNode.nextSibling):null;return!0}function ys(){dt=Ft=null,Ue=!1}function Jc(){var e=La;return e!==null&&(dn===null?dn=e:dn.push.apply(dn,e),La=null),e}function ro(e){La===null?La=[e]:La.push(e)}var eu=je(null),bs=null,da=null;function Ua(e,t,s){Te(eu,t._currentValue),t._currentValue=s}function fa(e){e._currentValue=eu.current,Re(eu)}function tu(e,t,s){for(;e!==null;){var o=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,o!==null&&(o.childLanes|=t)):o!==null&&(o.childLanes&t)!==t&&(o.childLanes|=t),e===s)break;e=e.return}}function nu(e,t,s,o){var u=e.child;for(u!==null&&(u.return=e);u!==null;){var h=u.dependencies;if(h!==null){var b=u.child;h=h.firstContext;e:for(;h!==null;){var T=h;h=u;for(var w=0;w<t.length;w++)if(T.context===t[w]){h.lanes|=s,T=h.alternate,T!==null&&(T.lanes|=s),tu(h.return,s,e),o||(b=null);break e}h=T.next}}else if(u.tag===18){if(b=u.return,b===null)throw Error(l(341));b.lanes|=s,h=b.alternate,h!==null&&(h.lanes|=s),tu(b,s,e),b=null}else b=u.child;if(b!==null)b.return=u;else for(b=u;b!==null;){if(b===e){b=null;break}if(u=b.sibling,u!==null){u.return=b.return,b=u;break}b=b.return}u=b}}function oi(e,t,s,o){e=null;for(var u=t,h=!1;u!==null;){if(!h){if((u.flags&524288)!==0)h=!0;else if((u.flags&262144)!==0)break}if(u.tag===10){var b=u.alternate;if(b===null)throw Error(l(387));if(b=b.memoizedProps,b!==null){var T=u.type;pn(u.pendingProps.value,b.value)||(e!==null?e.push(T):e=[T])}}else if(u===Le.current){if(b=u.alternate,b===null)throw Error(l(387));b.memoizedState.memoizedState!==u.memoizedState.memoizedState&&(e!==null?e.push(Lo):e=[Lo])}u=u.return}e!==null&&nu(t,e,s,o),t.flags|=262144}function Bl(e){for(e=e.firstContext;e!==null;){if(!pn(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function xs(e){bs=e,da=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function Yt(e){return Hp(bs,e)}function Ol(e,t){return bs===null&&xs(e),Hp(e,t)}function Hp(e,t){var s=t._currentValue;if(t={context:t,memoizedValue:s,next:null},da===null){if(e===null)throw Error(l(308));da=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else da=da.next=t;return s}var oS=typeof AbortController<"u"?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(s,o){e.push(o)}};this.abort=function(){t.aborted=!0,e.forEach(function(s){return s()})}},lS=n.unstable_scheduleCallback,rS=n.unstable_NormalPriority,Ot={$$typeof:D,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function au(){return{controller:new oS,data:new Map,refCount:0}}function co(e){e.refCount--,e.refCount===0&&lS(rS,function(){e.controller.abort()})}var uo=null,su=0,li=0,ri=null;function cS(e,t){if(uo===null){var s=uo=[];su=0,li=ld(),ri={status:"pending",value:void 0,then:function(o){s.push(o)}}}return su++,t.then(Gp,Gp),t}function Gp(){if(--su===0&&uo!==null){ri!==null&&(ri.status="fulfilled");var e=uo;uo=null,li=0,ri=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function uS(e,t){var s=[],o={status:"pending",value:null,reason:null,then:function(u){s.push(u)}};return e.then(function(){o.status="fulfilled",o.value=t;for(var u=0;u<s.length;u++)(0,s[u])(t)},function(u){for(o.status="rejected",o.reason=u,u=0;u<s.length;u++)(0,s[u])(void 0)}),o}var Pp=j.S;j.S=function(e,t){kg=W(),typeof t=="object"&&t!==null&&typeof t.then=="function"&&cS(e,t),Pp!==null&&Pp(e,t)};var _s=je(null);function iu(){var e=_s.current;return e!==null?e:ct.pooledCache}function Ll(e,t){t===null?Te(_s,_s.current):Te(_s,t.pool)}function $p(){var e=iu();return e===null?null:{parent:Ot._currentValue,pool:e}}var ci=Error(l(460)),ou=Error(l(474)),Il=Error(l(542)),Ul={then:function(){}};function Fp(e){return e=e.status,e==="fulfilled"||e==="rejected"}function Yp(e,t,s){switch(s=e[s],s===void 0?e.push(t):s!==t&&(t.then(la,la),t=s),t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,Kp(e),e;default:if(typeof t.status=="string")t.then(la,la);else{if(e=ct,e!==null&&100<e.shellSuspendCounter)throw Error(l(482));e=t,e.status="pending",e.then(function(o){if(t.status==="pending"){var u=t;u.status="fulfilled",u.value=o}},function(o){if(t.status==="pending"){var u=t;u.status="rejected",u.reason=o}})}switch(t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,Kp(e),e}throw Ts=t,ci}}function Ss(e){try{var t=e._init;return t(e._payload)}catch(s){throw s!==null&&typeof s=="object"&&typeof s.then=="function"?(Ts=s,ci):s}}var Ts=null;function qp(){if(Ts===null)throw Error(l(459));var e=Ts;return Ts=null,e}function Kp(e){if(e===ci||e===Il)throw Error(l(483))}var ui=null,fo=0;function zl(e){var t=fo;return fo+=1,ui===null&&(ui=[]),Yp(ui,e,t)}function ho(e,t){t=t.props.ref,e.ref=t!==void 0?t:null}function Vl(e,t){throw t.$$typeof===_?Error(l(525)):(e=Object.prototype.toString.call(t),Error(l(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e)))}function Zp(e){function t(B,M){if(e){var U=B.deletions;U===null?(B.deletions=[M],B.flags|=16):U.push(M)}}function s(B,M){if(!e)return null;for(;M!==null;)t(B,M),M=M.sibling;return null}function o(B){for(var M=new Map;B!==null;)B.key!==null?M.set(B.key,B):M.set(B.index,B),B=B.sibling;return M}function u(B,M){return B=ca(B,M),B.index=0,B.sibling=null,B}function h(B,M,U){return B.index=U,e?(U=B.alternate,U!==null?(U=U.index,U<M?(B.flags|=67108866,M):U):(B.flags|=67108866,M)):(B.flags|=1048576,M)}function b(B){return e&&B.alternate===null&&(B.flags|=67108866),B}function T(B,M,U,q){return M===null||M.tag!==6?(M=Kc(U,B.mode,q),M.return=B,M):(M=u(M,U),M.return=B,M)}function w(B,M,U,q){var fe=U.type;return fe===k?F(B,M,U.props.children,q,U.key):M!==null&&(M.elementType===fe||typeof fe=="object"&&fe!==null&&fe.$$typeof===L&&Ss(fe)===M.type)?(M=u(M,U.props),ho(M,U),M.return=B,M):(M=Ml(U.type,U.key,U.props,null,B.mode,q),ho(M,U),M.return=B,M)}function z(B,M,U,q){return M===null||M.tag!==4||M.stateNode.containerInfo!==U.containerInfo||M.stateNode.implementation!==U.implementation?(M=Zc(U,B.mode,q),M.return=B,M):(M=u(M,U.children||[]),M.return=B,M)}function F(B,M,U,q,fe){return M===null||M.tag!==7?(M=vs(U,B.mode,q,fe),M.return=B,M):(M=u(M,U),M.return=B,M)}function Q(B,M,U){if(typeof M=="string"&&M!==""||typeof M=="number"||typeof M=="bigint")return M=Kc(""+M,B.mode,U),M.return=B,M;if(typeof M=="object"&&M!==null){switch(M.$$typeof){case C:return U=Ml(M.type,M.key,M.props,null,B.mode,U),ho(U,M),U.return=B,U;case E:return M=Zc(M,B.mode,U),M.return=B,M;case L:return M=Ss(M),Q(B,M,U)}if(oe(M)||ne(M))return M=vs(M,B.mode,U,null),M.return=B,M;if(typeof M.then=="function")return Q(B,zl(M),U);if(M.$$typeof===D)return Q(B,Ol(B,M),U);Vl(B,M)}return null}function V(B,M,U,q){var fe=M!==null?M.key:null;if(typeof U=="string"&&U!==""||typeof U=="number"||typeof U=="bigint")return fe!==null?null:T(B,M,""+U,q);if(typeof U=="object"&&U!==null){switch(U.$$typeof){case C:return U.key===fe?w(B,M,U,q):null;case E:return U.key===fe?z(B,M,U,q):null;case L:return U=Ss(U),V(B,M,U,q)}if(oe(U)||ne(U))return fe!==null?null:F(B,M,U,q,null);if(typeof U.then=="function")return V(B,M,zl(U),q);if(U.$$typeof===D)return V(B,M,Ol(B,U),q);Vl(B,U)}return null}function P(B,M,U,q,fe){if(typeof q=="string"&&q!==""||typeof q=="number"||typeof q=="bigint")return B=B.get(U)||null,T(M,B,""+q,fe);if(typeof q=="object"&&q!==null){switch(q.$$typeof){case C:return B=B.get(q.key===null?U:q.key)||null,w(M,B,q,fe);case E:return B=B.get(q.key===null?U:q.key)||null,z(M,B,q,fe);case L:return q=Ss(q),P(B,M,U,q,fe)}if(oe(q)||ne(q))return B=B.get(U)||null,F(M,B,q,fe,null);if(typeof q.then=="function")return P(B,M,U,zl(q),fe);if(q.$$typeof===D)return P(B,M,U,Ol(M,q),fe);Vl(M,q)}return null}function re(B,M,U,q){for(var fe=null,Pe=null,ue=M,Ae=M=0,Oe=null;ue!==null&&Ae<U.length;Ae++){ue.index>Ae?(Oe=ue,ue=null):Oe=ue.sibling;var $e=V(B,ue,U[Ae],q);if($e===null){ue===null&&(ue=Oe);break}e&&ue&&$e.alternate===null&&t(B,ue),M=h($e,M,Ae),Pe===null?fe=$e:Pe.sibling=$e,Pe=$e,ue=Oe}if(Ae===U.length)return s(B,ue),Ue&&ua(B,Ae),fe;if(ue===null){for(;Ae<U.length;Ae++)ue=Q(B,U[Ae],q),ue!==null&&(M=h(ue,M,Ae),Pe===null?fe=ue:Pe.sibling=ue,Pe=ue);return Ue&&ua(B,Ae),fe}for(ue=o(ue);Ae<U.length;Ae++)Oe=P(ue,B,Ae,U[Ae],q),Oe!==null&&(e&&Oe.alternate!==null&&ue.delete(Oe.key===null?Ae:Oe.key),M=h(Oe,M,Ae),Pe===null?fe=Oe:Pe.sibling=Oe,Pe=Oe);return e&&ue.forEach(function(ns){return t(B,ns)}),Ue&&ua(B,Ae),fe}function ge(B,M,U,q){if(U==null)throw Error(l(151));for(var fe=null,Pe=null,ue=M,Ae=M=0,Oe=null,$e=U.next();ue!==null&&!$e.done;Ae++,$e=U.next()){ue.index>Ae?(Oe=ue,ue=null):Oe=ue.sibling;var ns=V(B,ue,$e.value,q);if(ns===null){ue===null&&(ue=Oe);break}e&&ue&&ns.alternate===null&&t(B,ue),M=h(ns,M,Ae),Pe===null?fe=ns:Pe.sibling=ns,Pe=ns,ue=Oe}if($e.done)return s(B,ue),Ue&&ua(B,Ae),fe;if(ue===null){for(;!$e.done;Ae++,$e=U.next())$e=Q(B,$e.value,q),$e!==null&&(M=h($e,M,Ae),Pe===null?fe=$e:Pe.sibling=$e,Pe=$e);return Ue&&ua(B,Ae),fe}for(ue=o(ue);!$e.done;Ae++,$e=U.next())$e=P(ue,B,Ae,$e.value,q),$e!==null&&(e&&$e.alternate!==null&&ue.delete($e.key===null?Ae:$e.key),M=h($e,M,Ae),Pe===null?fe=$e:Pe.sibling=$e,Pe=$e);return e&&ue.forEach(function(_1){return t(B,_1)}),Ue&&ua(B,Ae),fe}function lt(B,M,U,q){if(typeof U=="object"&&U!==null&&U.type===k&&U.key===null&&(U=U.props.children),typeof U=="object"&&U!==null){switch(U.$$typeof){case C:e:{for(var fe=U.key;M!==null;){if(M.key===fe){if(fe=U.type,fe===k){if(M.tag===7){s(B,M.sibling),q=u(M,U.props.children),q.return=B,B=q;break e}}else if(M.elementType===fe||typeof fe=="object"&&fe!==null&&fe.$$typeof===L&&Ss(fe)===M.type){s(B,M.sibling),q=u(M,U.props),ho(q,U),q.return=B,B=q;break e}s(B,M);break}else t(B,M);M=M.sibling}U.type===k?(q=vs(U.props.children,B.mode,q,U.key),q.return=B,B=q):(q=Ml(U.type,U.key,U.props,null,B.mode,q),ho(q,U),q.return=B,B=q)}return b(B);case E:e:{for(fe=U.key;M!==null;){if(M.key===fe)if(M.tag===4&&M.stateNode.containerInfo===U.containerInfo&&M.stateNode.implementation===U.implementation){s(B,M.sibling),q=u(M,U.children||[]),q.return=B,B=q;break e}else{s(B,M);break}else t(B,M);M=M.sibling}q=Zc(U,B.mode,q),q.return=B,B=q}return b(B);case L:return U=Ss(U),lt(B,M,U,q)}if(oe(U))return re(B,M,U,q);if(ne(U)){if(fe=ne(U),typeof fe!="function")throw Error(l(150));return U=fe.call(U),ge(B,M,U,q)}if(typeof U.then=="function")return lt(B,M,zl(U),q);if(U.$$typeof===D)return lt(B,M,Ol(B,U),q);Vl(B,U)}return typeof U=="string"&&U!==""||typeof U=="number"||typeof U=="bigint"?(U=""+U,M!==null&&M.tag===6?(s(B,M.sibling),q=u(M,U),q.return=B,B=q):(s(B,M),q=Kc(U,B.mode,q),q.return=B,B=q),b(B)):s(B,M)}return function(B,M,U,q){try{fo=0;var fe=lt(B,M,U,q);return ui=null,fe}catch(ue){if(ue===ci||ue===Il)throw ue;var Pe=mn(29,ue,null,B.mode);return Pe.lanes=q,Pe.return=B,Pe}finally{}}}var Cs=Zp(!0),Xp=Zp(!1),za=!1;function lu(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function ru(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 Va(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function Ha(e,t,s){var o=e.updateQueue;if(o===null)return null;if(o=o.shared,(qe&2)!==0){var u=o.pending;return u===null?t.next=t:(t.next=u.next,u.next=t),o.pending=t,t=Dl(e),Rp(e,null,s),t}return jl(e,o,t,s),Dl(e)}function po(e,t,s){if(t=t.updateQueue,t!==null&&(t=t.shared,(s&4194048)!==0)){var o=t.lanes;o&=e.pendingLanes,s|=o,t.lanes=s,Hh(e,s)}}function cu(e,t){var s=e.updateQueue,o=e.alternate;if(o!==null&&(o=o.updateQueue,s===o)){var u=null,h=null;if(s=s.firstBaseUpdate,s!==null){do{var b={lane:s.lane,tag:s.tag,payload:s.payload,callback:null,next:null};h===null?u=h=b:h=h.next=b,s=s.next}while(s!==null);h===null?u=h=t:h=h.next=t}else u=h=t;s={baseState:o.baseState,firstBaseUpdate:u,lastBaseUpdate:h,shared:o.shared,callbacks:o.callbacks},e.updateQueue=s;return}e=s.lastBaseUpdate,e===null?s.firstBaseUpdate=t:e.next=t,s.lastBaseUpdate=t}var uu=!1;function mo(){if(uu){var e=ri;if(e!==null)throw e}}function go(e,t,s,o){uu=!1;var u=e.updateQueue;za=!1;var h=u.firstBaseUpdate,b=u.lastBaseUpdate,T=u.shared.pending;if(T!==null){u.shared.pending=null;var w=T,z=w.next;w.next=null,b===null?h=z:b.next=z,b=w;var F=e.alternate;F!==null&&(F=F.updateQueue,T=F.lastBaseUpdate,T!==b&&(T===null?F.firstBaseUpdate=z:T.next=z,F.lastBaseUpdate=w))}if(h!==null){var Q=u.baseState;b=0,F=z=w=null,T=h;do{var V=T.lane&-536870913,P=V!==T.lane;if(P?(Be&V)===V:(o&V)===V){V!==0&&V===li&&(uu=!0),F!==null&&(F=F.next={lane:0,tag:T.tag,payload:T.payload,callback:null,next:null});e:{var re=e,ge=T;V=t;var lt=s;switch(ge.tag){case 1:if(re=ge.payload,typeof re=="function"){Q=re.call(lt,Q,V);break e}Q=re;break e;case 3:re.flags=re.flags&-65537|128;case 0:if(re=ge.payload,V=typeof re=="function"?re.call(lt,Q,V):re,V==null)break e;Q=v({},Q,V);break e;case 2:za=!0}}V=T.callback,V!==null&&(e.flags|=64,P&&(e.flags|=8192),P=u.callbacks,P===null?u.callbacks=[V]:P.push(V))}else P={lane:V,tag:T.tag,payload:T.payload,callback:T.callback,next:null},F===null?(z=F=P,w=Q):F=F.next=P,b|=V;if(T=T.next,T===null){if(T=u.shared.pending,T===null)break;P=T,T=P.next,P.next=null,u.lastBaseUpdate=P,u.shared.pending=null}}while(!0);F===null&&(w=Q),u.baseState=w,u.firstBaseUpdate=z,u.lastBaseUpdate=F,h===null&&(u.shared.lanes=0),Ya|=b,e.lanes=b,e.memoizedState=Q}}function Qp(e,t){if(typeof e!="function")throw Error(l(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++)Qp(s[e],t)}var di=je(null),Hl=je(0);function Jp(e,t){e=_a,Te(Hl,e),Te(di,t),_a=e|t.baseLanes}function du(){Te(Hl,_a),Te(di,di.current)}function fu(){_a=Hl.current,Re(di),Re(Hl)}var gn=je(null),Rn=null;function Ga(e){var t=e.alternate;Te(jt,jt.current&1),Te(gn,e),Rn===null&&(t===null||di.current!==null||t.memoizedState!==null)&&(Rn=e)}function hu(e){Te(jt,jt.current),Te(gn,e),Rn===null&&(Rn=e)}function em(e){e.tag===22?(Te(jt,jt.current),Te(gn,e),Rn===null&&(Rn=e)):Pa()}function Pa(){Te(jt,jt.current),Te(gn,gn.current)}function vn(e){Re(gn),Rn===e&&(Rn=null),Re(jt)}var jt=je(0);function Gl(e){for(var t=e;t!==null;){if(t.tag===13){var s=t.memoizedState;if(s!==null&&(s=s.dehydrated,s===null||bd(s)||xd(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 ha=0,ke=null,it=null,Lt=null,Pl=!1,fi=!1,Es=!1,$l=0,vo=0,hi=null,dS=0;function St(){throw Error(l(321))}function pu(e,t){if(t===null)return!1;for(var s=0;s<t.length&&s<e.length;s++)if(!pn(e[s],t[s]))return!1;return!0}function mu(e,t,s,o,u,h){return ha=h,ke=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,j.H=e===null||e.memoizedState===null?Im:ju,Es=!1,h=s(o,u),Es=!1,fi&&(h=nm(t,s,o,u)),tm(e),h}function tm(e){j.H=xo;var t=it!==null&&it.next!==null;if(ha=0,Lt=it=ke=null,Pl=!1,vo=0,hi=null,t)throw Error(l(300));e===null||It||(e=e.dependencies,e!==null&&Bl(e)&&(It=!0))}function nm(e,t,s,o){ke=e;var u=0;do{if(fi&&(hi=null),vo=0,fi=!1,25<=u)throw Error(l(301));if(u+=1,Lt=it=null,e.updateQueue!=null){var h=e.updateQueue;h.lastEffect=null,h.events=null,h.stores=null,h.memoCache!=null&&(h.memoCache.index=0)}j.H=Um,h=t(s,o)}while(fi);return h}function fS(){var e=j.H,t=e.useState()[0];return t=typeof t.then=="function"?yo(t):t,e=e.useState()[0],(it!==null?it.memoizedState:null)!==e&&(ke.flags|=1024),t}function gu(){var e=$l!==0;return $l=0,e}function vu(e,t,s){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~s}function yu(e){if(Pl){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}Pl=!1}ha=0,Lt=it=ke=null,fi=!1,vo=$l=0,hi=null}function tn(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Lt===null?ke.memoizedState=Lt=e:Lt=Lt.next=e,Lt}function Dt(){if(it===null){var e=ke.alternate;e=e!==null?e.memoizedState:null}else e=it.next;var t=Lt===null?ke.memoizedState:Lt.next;if(t!==null)Lt=t,it=e;else{if(e===null)throw ke.alternate===null?Error(l(467)):Error(l(310));it=e,e={memoizedState:it.memoizedState,baseState:it.baseState,baseQueue:it.baseQueue,queue:it.queue,next:null},Lt===null?ke.memoizedState=Lt=e:Lt=Lt.next=e}return Lt}function Fl(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function yo(e){var t=vo;return vo+=1,hi===null&&(hi=[]),e=Yp(hi,e,t),t=ke,(Lt===null?t.memoizedState:Lt.next)===null&&(t=t.alternate,j.H=t===null||t.memoizedState===null?Im:ju),e}function Yl(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return yo(e);if(e.$$typeof===D)return Yt(e)}throw Error(l(438,String(e)))}function bu(e){var t=null,s=ke.updateQueue;if(s!==null&&(t=s.memoCache),t==null){var o=ke.alternate;o!==null&&(o=o.updateQueue,o!==null&&(o=o.memoCache,o!=null&&(t={data:o.data.map(function(u){return u.slice()}),index:0})))}if(t==null&&(t={data:[],index:0}),s===null&&(s=Fl(),ke.updateQueue=s),s.memoCache=t,s=t.data[t.index],s===void 0)for(s=t.data[t.index]=Array(e),o=0;o<e;o++)s[o]=ee;return t.index++,s}function pa(e,t){return typeof t=="function"?t(e):t}function ql(e){var t=Dt();return xu(t,it,e)}function xu(e,t,s){var o=e.queue;if(o===null)throw Error(l(311));o.lastRenderedReducer=s;var u=e.baseQueue,h=o.pending;if(h!==null){if(u!==null){var b=u.next;u.next=h.next,h.next=b}t.baseQueue=u=h,o.pending=null}if(h=e.baseState,u===null)e.memoizedState=h;else{t=u.next;var T=b=null,w=null,z=t,F=!1;do{var Q=z.lane&-536870913;if(Q!==z.lane?(Be&Q)===Q:(ha&Q)===Q){var V=z.revertLane;if(V===0)w!==null&&(w=w.next={lane:0,revertLane:0,gesture:null,action:z.action,hasEagerState:z.hasEagerState,eagerState:z.eagerState,next:null}),Q===li&&(F=!0);else if((ha&V)===V){z=z.next,V===li&&(F=!0);continue}else Q={lane:0,revertLane:z.revertLane,gesture:null,action:z.action,hasEagerState:z.hasEagerState,eagerState:z.eagerState,next:null},w===null?(T=w=Q,b=h):w=w.next=Q,ke.lanes|=V,Ya|=V;Q=z.action,Es&&s(h,Q),h=z.hasEagerState?z.eagerState:s(h,Q)}else V={lane:Q,revertLane:z.revertLane,gesture:z.gesture,action:z.action,hasEagerState:z.hasEagerState,eagerState:z.eagerState,next:null},w===null?(T=w=V,b=h):w=w.next=V,ke.lanes|=Q,Ya|=Q;z=z.next}while(z!==null&&z!==t);if(w===null?b=h:w.next=T,!pn(h,e.memoizedState)&&(It=!0,F&&(s=ri,s!==null)))throw s;e.memoizedState=h,e.baseState=b,e.baseQueue=w,o.lastRenderedState=h}return u===null&&(o.lanes=0),[e.memoizedState,o.dispatch]}function _u(e){var t=Dt(),s=t.queue;if(s===null)throw Error(l(311));s.lastRenderedReducer=e;var o=s.dispatch,u=s.pending,h=t.memoizedState;if(u!==null){s.pending=null;var b=u=u.next;do h=e(h,b.action),b=b.next;while(b!==u);pn(h,t.memoizedState)||(It=!0),t.memoizedState=h,t.baseQueue===null&&(t.baseState=h),s.lastRenderedState=h}return[h,o]}function am(e,t,s){var o=ke,u=Dt(),h=Ue;if(h){if(s===void 0)throw Error(l(407));s=s()}else s=t();var b=!pn((it||u).memoizedState,s);if(b&&(u.memoizedState=s,It=!0),u=u.queue,Cu(om.bind(null,o,u,e),[e]),u.getSnapshot!==t||b||Lt!==null&&Lt.memoizedState.tag&1){if(o.flags|=2048,pi(9,{destroy:void 0},im.bind(null,o,u,s,t),null),ct===null)throw Error(l(349));h||(ha&127)!==0||sm(o,t,s)}return s}function sm(e,t,s){e.flags|=16384,e={getSnapshot:t,value:s},t=ke.updateQueue,t===null?(t=Fl(),ke.updateQueue=t,t.stores=[e]):(s=t.stores,s===null?t.stores=[e]:s.push(e))}function im(e,t,s,o){t.value=s,t.getSnapshot=o,lm(t)&&rm(e)}function om(e,t,s){return s(function(){lm(t)&&rm(e)})}function lm(e){var t=e.getSnapshot;e=e.value;try{var s=t();return!pn(e,s)}catch{return!0}}function rm(e){var t=gs(e,2);t!==null&&fn(t,e,2)}function Su(e){var t=tn();if(typeof e=="function"){var s=e;if(e=s(),Es){Ve(!0);try{s()}finally{Ve(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:pa,lastRenderedState:e},t}function cm(e,t,s,o){return e.baseState=s,xu(e,it,typeof o=="function"?o:pa)}function hS(e,t,s,o,u){if(Xl(e))throw Error(l(485));if(e=t.action,e!==null){var h={payload:u,action:e,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(b){h.listeners.push(b)}};j.T!==null?s(!0):h.isTransition=!1,o(h),s=t.pending,s===null?(h.next=t.pending=h,um(t,h)):(h.next=s.next,t.pending=s.next=h)}}function um(e,t){var s=t.action,o=t.payload,u=e.state;if(t.isTransition){var h=j.T,b={};j.T=b;try{var T=s(u,o),w=j.S;w!==null&&w(b,T),dm(e,t,T)}catch(z){Tu(e,t,z)}finally{h!==null&&b.types!==null&&(h.types=b.types),j.T=h}}else try{h=s(u,o),dm(e,t,h)}catch(z){Tu(e,t,z)}}function dm(e,t,s){s!==null&&typeof s=="object"&&typeof s.then=="function"?s.then(function(o){fm(e,t,o)},function(o){return Tu(e,t,o)}):fm(e,t,s)}function fm(e,t,s){t.status="fulfilled",t.value=s,hm(t),e.state=s,t=e.pending,t!==null&&(s=t.next,s===t?e.pending=null:(s=s.next,t.next=s,um(e,s)))}function Tu(e,t,s){var o=e.pending;if(e.pending=null,o!==null){o=o.next;do t.status="rejected",t.reason=s,hm(t),t=t.next;while(t!==o)}e.action=null}function hm(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function pm(e,t){return t}function mm(e,t){if(Ue){var s=ct.formState;if(s!==null){e:{var o=ke;if(Ue){if(dt){t:{for(var u=dt,h=Mn;u.nodeType!==8;){if(!h){u=null;break t}if(u=Bn(u.nextSibling),u===null){u=null;break t}}h=u.data,u=h==="F!"||h==="F"?u:null}if(u){dt=Bn(u.nextSibling),o=u.data==="F!";break e}}Ia(o)}o=!1}o&&(t=s[0])}}return s=tn(),s.memoizedState=s.baseState=t,o={pending:null,lanes:0,dispatch:null,lastRenderedReducer:pm,lastRenderedState:t},s.queue=o,s=Bm.bind(null,ke,o),o.dispatch=s,o=Su(!1),h=Nu.bind(null,ke,!1,o.queue),o=tn(),u={state:t,dispatch:null,action:e,pending:null},o.queue=u,s=hS.bind(null,ke,u,h,s),u.dispatch=s,o.memoizedState=e,[t,s,!1]}function gm(e){var t=Dt();return vm(t,it,e)}function vm(e,t,s){if(t=xu(e,t,pm)[0],e=ql(pa)[0],typeof t=="object"&&t!==null&&typeof t.then=="function")try{var o=yo(t)}catch(b){throw b===ci?Il:b}else o=t;t=Dt();var u=t.queue,h=u.dispatch;return s!==t.memoizedState&&(ke.flags|=2048,pi(9,{destroy:void 0},pS.bind(null,u,s),null)),[o,h,e]}function pS(e,t){e.action=t}function ym(e){var t=Dt(),s=it;if(s!==null)return vm(t,s,e);Dt(),t=t.memoizedState,s=Dt();var o=s.queue.dispatch;return s.memoizedState=e,[t,o,!1]}function pi(e,t,s,o){return e={tag:e,create:s,deps:o,inst:t,next:null},t=ke.updateQueue,t===null&&(t=Fl(),ke.updateQueue=t),s=t.lastEffect,s===null?t.lastEffect=e.next=e:(o=s.next,s.next=e,e.next=o,t.lastEffect=e),e}function bm(){return Dt().memoizedState}function Kl(e,t,s,o){var u=tn();ke.flags|=e,u.memoizedState=pi(1|t,{destroy:void 0},s,o===void 0?null:o)}function Zl(e,t,s,o){var u=Dt();o=o===void 0?null:o;var h=u.memoizedState.inst;it!==null&&o!==null&&pu(o,it.memoizedState.deps)?u.memoizedState=pi(t,h,s,o):(ke.flags|=e,u.memoizedState=pi(1|t,h,s,o))}function xm(e,t){Kl(8390656,8,e,t)}function Cu(e,t){Zl(2048,8,e,t)}function mS(e){ke.flags|=4;var t=ke.updateQueue;if(t===null)t=Fl(),ke.updateQueue=t,t.events=[e];else{var s=t.events;s===null?t.events=[e]:s.push(e)}}function _m(e){var t=Dt().memoizedState;return mS({ref:t,nextImpl:e}),function(){if((qe&2)!==0)throw Error(l(440));return t.impl.apply(void 0,arguments)}}function Sm(e,t){return Zl(4,2,e,t)}function Tm(e,t){return Zl(4,4,e,t)}function Cm(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 Em(e,t,s){s=s!=null?s.concat([e]):null,Zl(4,4,Cm.bind(null,t,e),s)}function Eu(){}function km(e,t){var s=Dt();t=t===void 0?null:t;var o=s.memoizedState;return t!==null&&pu(t,o[1])?o[0]:(s.memoizedState=[e,t],e)}function wm(e,t){var s=Dt();t=t===void 0?null:t;var o=s.memoizedState;if(t!==null&&pu(t,o[1]))return o[0];if(o=e(),Es){Ve(!0);try{e()}finally{Ve(!1)}}return s.memoizedState=[o,t],o}function ku(e,t,s){return s===void 0||(ha&1073741824)!==0&&(Be&261930)===0?e.memoizedState=t:(e.memoizedState=s,e=Ag(),ke.lanes|=e,Ya|=e,s)}function Am(e,t,s,o){return pn(s,t)?s:di.current!==null?(e=ku(e,s,o),pn(e,t)||(It=!0),e):(ha&42)===0||(ha&1073741824)!==0&&(Be&261930)===0?(It=!0,e.memoizedState=s):(e=Ag(),ke.lanes|=e,Ya|=e,t)}function Nm(e,t,s,o,u){var h=Z.p;Z.p=h!==0&&8>h?h:8;var b=j.T,T={};j.T=T,Nu(e,!1,t,s);try{var w=u(),z=j.S;if(z!==null&&z(T,w),w!==null&&typeof w=="object"&&typeof w.then=="function"){var F=uS(w,o);bo(e,t,F,xn(e))}else bo(e,t,o,xn(e))}catch(Q){bo(e,t,{then:function(){},status:"rejected",reason:Q},xn())}finally{Z.p=h,b!==null&&T.types!==null&&(b.types=T.types),j.T=b}}function gS(){}function wu(e,t,s,o){if(e.tag!==5)throw Error(l(476));var u=jm(e).queue;Nm(e,u,t,K,s===null?gS:function(){return Dm(e),s(o)})}function jm(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:K,baseState:K,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:pa,lastRenderedState:K},next:null};var s={};return t.next={memoizedState:s,baseState:s,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:pa,lastRenderedState:s},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function Dm(e){var t=jm(e);t.next===null&&(t=e.alternate.memoizedState),bo(e,t.next.queue,{},xn())}function Au(){return Yt(Lo)}function Mm(){return Dt().memoizedState}function Rm(){return Dt().memoizedState}function vS(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var s=xn();e=Va(s);var o=Ha(t,e,s);o!==null&&(fn(o,t,s),po(o,t,s)),t={cache:au()},e.payload=t;return}t=t.return}}function yS(e,t,s){var o=xn();s={lane:o,revertLane:0,gesture:null,action:s,hasEagerState:!1,eagerState:null,next:null},Xl(e)?Om(t,s):(s=Yc(e,t,s,o),s!==null&&(fn(s,e,o),Lm(s,t,o)))}function Bm(e,t,s){var o=xn();bo(e,t,s,o)}function bo(e,t,s,o){var u={lane:o,revertLane:0,gesture:null,action:s,hasEagerState:!1,eagerState:null,next:null};if(Xl(e))Om(t,u);else{var h=e.alternate;if(e.lanes===0&&(h===null||h.lanes===0)&&(h=t.lastRenderedReducer,h!==null))try{var b=t.lastRenderedState,T=h(b,s);if(u.hasEagerState=!0,u.eagerState=T,pn(T,b))return jl(e,t,u,0),ct===null&&Nl(),!1}catch{}finally{}if(s=Yc(e,t,u,o),s!==null)return fn(s,e,o),Lm(s,t,o),!0}return!1}function Nu(e,t,s,o){if(o={lane:2,revertLane:ld(),gesture:null,action:o,hasEagerState:!1,eagerState:null,next:null},Xl(e)){if(t)throw Error(l(479))}else t=Yc(e,s,o,2),t!==null&&fn(t,e,2)}function Xl(e){var t=e.alternate;return e===ke||t!==null&&t===ke}function Om(e,t){fi=Pl=!0;var s=e.pending;s===null?t.next=t:(t.next=s.next,s.next=t),e.pending=t}function Lm(e,t,s){if((s&4194048)!==0){var o=t.lanes;o&=e.pendingLanes,s|=o,t.lanes=s,Hh(e,s)}}var xo={readContext:Yt,use:Yl,useCallback:St,useContext:St,useEffect:St,useImperativeHandle:St,useLayoutEffect:St,useInsertionEffect:St,useMemo:St,useReducer:St,useRef:St,useState:St,useDebugValue:St,useDeferredValue:St,useTransition:St,useSyncExternalStore:St,useId:St,useHostTransitionStatus:St,useFormState:St,useActionState:St,useOptimistic:St,useMemoCache:St,useCacheRefresh:St};xo.useEffectEvent=St;var Im={readContext:Yt,use:Yl,useCallback:function(e,t){return tn().memoizedState=[e,t===void 0?null:t],e},useContext:Yt,useEffect:xm,useImperativeHandle:function(e,t,s){s=s!=null?s.concat([e]):null,Kl(4194308,4,Cm.bind(null,t,e),s)},useLayoutEffect:function(e,t){return Kl(4194308,4,e,t)},useInsertionEffect:function(e,t){Kl(4,2,e,t)},useMemo:function(e,t){var s=tn();t=t===void 0?null:t;var o=e();if(Es){Ve(!0);try{e()}finally{Ve(!1)}}return s.memoizedState=[o,t],o},useReducer:function(e,t,s){var o=tn();if(s!==void 0){var u=s(t);if(Es){Ve(!0);try{s(t)}finally{Ve(!1)}}}else u=t;return o.memoizedState=o.baseState=u,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:u},o.queue=e,e=e.dispatch=yS.bind(null,ke,e),[o.memoizedState,e]},useRef:function(e){var t=tn();return e={current:e},t.memoizedState=e},useState:function(e){e=Su(e);var t=e.queue,s=Bm.bind(null,ke,t);return t.dispatch=s,[e.memoizedState,s]},useDebugValue:Eu,useDeferredValue:function(e,t){var s=tn();return ku(s,e,t)},useTransition:function(){var e=Su(!1);return e=Nm.bind(null,ke,e.queue,!0,!1),tn().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,s){var o=ke,u=tn();if(Ue){if(s===void 0)throw Error(l(407));s=s()}else{if(s=t(),ct===null)throw Error(l(349));(Be&127)!==0||sm(o,t,s)}u.memoizedState=s;var h={value:s,getSnapshot:t};return u.queue=h,xm(om.bind(null,o,h,e),[e]),o.flags|=2048,pi(9,{destroy:void 0},im.bind(null,o,h,s,t),null),s},useId:function(){var e=tn(),t=ct.identifierPrefix;if(Ue){var s=Kn,o=qn;s=(o&~(1<<32-Ee(o)-1)).toString(32)+s,t="_"+t+"R_"+s,s=$l++,0<s&&(t+="H"+s.toString(32)),t+="_"}else s=dS++,t="_"+t+"r_"+s.toString(32)+"_";return e.memoizedState=t},useHostTransitionStatus:Au,useFormState:mm,useActionState:mm,useOptimistic:function(e){var t=tn();t.memoizedState=t.baseState=e;var s={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=s,t=Nu.bind(null,ke,!0,s),s.dispatch=t,[e,t]},useMemoCache:bu,useCacheRefresh:function(){return tn().memoizedState=vS.bind(null,ke)},useEffectEvent:function(e){var t=tn(),s={impl:e};return t.memoizedState=s,function(){if((qe&2)!==0)throw Error(l(440));return s.impl.apply(void 0,arguments)}}},ju={readContext:Yt,use:Yl,useCallback:km,useContext:Yt,useEffect:Cu,useImperativeHandle:Em,useInsertionEffect:Sm,useLayoutEffect:Tm,useMemo:wm,useReducer:ql,useRef:bm,useState:function(){return ql(pa)},useDebugValue:Eu,useDeferredValue:function(e,t){var s=Dt();return Am(s,it.memoizedState,e,t)},useTransition:function(){var e=ql(pa)[0],t=Dt().memoizedState;return[typeof e=="boolean"?e:yo(e),t]},useSyncExternalStore:am,useId:Mm,useHostTransitionStatus:Au,useFormState:gm,useActionState:gm,useOptimistic:function(e,t){var s=Dt();return cm(s,it,e,t)},useMemoCache:bu,useCacheRefresh:Rm};ju.useEffectEvent=_m;var Um={readContext:Yt,use:Yl,useCallback:km,useContext:Yt,useEffect:Cu,useImperativeHandle:Em,useInsertionEffect:Sm,useLayoutEffect:Tm,useMemo:wm,useReducer:_u,useRef:bm,useState:function(){return _u(pa)},useDebugValue:Eu,useDeferredValue:function(e,t){var s=Dt();return it===null?ku(s,e,t):Am(s,it.memoizedState,e,t)},useTransition:function(){var e=_u(pa)[0],t=Dt().memoizedState;return[typeof e=="boolean"?e:yo(e),t]},useSyncExternalStore:am,useId:Mm,useHostTransitionStatus:Au,useFormState:ym,useActionState:ym,useOptimistic:function(e,t){var s=Dt();return it!==null?cm(s,it,e,t):(s.baseState=e,[e,s.queue.dispatch])},useMemoCache:bu,useCacheRefresh:Rm};Um.useEffectEvent=_m;function Du(e,t,s,o){t=e.memoizedState,s=s(o,t),s=s==null?t:v({},t,s),e.memoizedState=s,e.lanes===0&&(e.updateQueue.baseState=s)}var Mu={enqueueSetState:function(e,t,s){e=e._reactInternals;var o=xn(),u=Va(o);u.payload=t,s!=null&&(u.callback=s),t=Ha(e,u,o),t!==null&&(fn(t,e,o),po(t,e,o))},enqueueReplaceState:function(e,t,s){e=e._reactInternals;var o=xn(),u=Va(o);u.tag=1,u.payload=t,s!=null&&(u.callback=s),t=Ha(e,u,o),t!==null&&(fn(t,e,o),po(t,e,o))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var s=xn(),o=Va(s);o.tag=2,t!=null&&(o.callback=t),t=Ha(e,o,s),t!==null&&(fn(t,e,s),po(t,e,s))}};function zm(e,t,s,o,u,h,b){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(o,h,b):t.prototype&&t.prototype.isPureReactComponent?!io(s,o)||!io(u,h):!0}function Vm(e,t,s,o){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(s,o),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(s,o),t.state!==e&&Mu.enqueueReplaceState(t,t.state,null)}function ks(e,t){var s=t;if("ref"in t){s={};for(var o in t)o!=="ref"&&(s[o]=t[o])}if(e=e.defaultProps){s===t&&(s=v({},s));for(var u in e)s[u]===void 0&&(s[u]=e[u])}return s}function Hm(e){Al(e)}function Gm(e){console.error(e)}function Pm(e){Al(e)}function Ql(e,t){try{var s=e.onUncaughtError;s(t.value,{componentStack:t.stack})}catch(o){setTimeout(function(){throw o})}}function $m(e,t,s){try{var o=e.onCaughtError;o(s.value,{componentStack:s.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(u){setTimeout(function(){throw u})}}function Ru(e,t,s){return s=Va(s),s.tag=3,s.payload={element:null},s.callback=function(){Ql(e,t)},s}function Fm(e){return e=Va(e),e.tag=3,e}function Ym(e,t,s,o){var u=s.type.getDerivedStateFromError;if(typeof u=="function"){var h=o.value;e.payload=function(){return u(h)},e.callback=function(){$m(t,s,o)}}var b=s.stateNode;b!==null&&typeof b.componentDidCatch=="function"&&(e.callback=function(){$m(t,s,o),typeof u!="function"&&(qa===null?qa=new Set([this]):qa.add(this));var T=o.stack;this.componentDidCatch(o.value,{componentStack:T!==null?T:""})})}function bS(e,t,s,o,u){if(s.flags|=32768,o!==null&&typeof o=="object"&&typeof o.then=="function"){if(t=s.alternate,t!==null&&oi(t,s,u,!0),s=gn.current,s!==null){switch(s.tag){case 31:case 13:return Rn===null?cr():s.alternate===null&&Tt===0&&(Tt=3),s.flags&=-257,s.flags|=65536,s.lanes=u,o===Ul?s.flags|=16384:(t=s.updateQueue,t===null?s.updateQueue=new Set([o]):t.add(o),sd(e,o,u)),!1;case 22:return s.flags|=65536,o===Ul?s.flags|=16384:(t=s.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([o])},s.updateQueue=t):(s=t.retryQueue,s===null?t.retryQueue=new Set([o]):s.add(o)),sd(e,o,u)),!1}throw Error(l(435,s.tag))}return sd(e,o,u),cr(),!1}if(Ue)return t=gn.current,t!==null?((t.flags&65536)===0&&(t.flags|=256),t.flags|=65536,t.lanes=u,o!==Wc&&(e=Error(l(422),{cause:o}),ro(Nn(e,s)))):(o!==Wc&&(t=Error(l(423),{cause:o}),ro(Nn(t,s))),e=e.current.alternate,e.flags|=65536,u&=-u,e.lanes|=u,o=Nn(o,s),u=Ru(e.stateNode,o,u),cu(e,u),Tt!==4&&(Tt=2)),!1;var h=Error(l(520),{cause:o});if(h=Nn(h,s),Ao===null?Ao=[h]:Ao.push(h),Tt!==4&&(Tt=2),t===null)return!0;o=Nn(o,s),s=t;do{switch(s.tag){case 3:return s.flags|=65536,e=u&-u,s.lanes|=e,e=Ru(s.stateNode,o,e),cu(s,e),!1;case 1:if(t=s.type,h=s.stateNode,(s.flags&128)===0&&(typeof t.getDerivedStateFromError=="function"||h!==null&&typeof h.componentDidCatch=="function"&&(qa===null||!qa.has(h))))return s.flags|=65536,u&=-u,s.lanes|=u,u=Fm(u),Ym(u,e,s,o),cu(s,u),!1}s=s.return}while(s!==null);return!1}var Bu=Error(l(461)),It=!1;function qt(e,t,s,o){t.child=e===null?Xp(t,null,s,o):Cs(t,e.child,s,o)}function qm(e,t,s,o,u){s=s.render;var h=t.ref;if("ref"in o){var b={};for(var T in o)T!=="ref"&&(b[T]=o[T])}else b=o;return xs(t),o=mu(e,t,s,b,h,u),T=gu(),e!==null&&!It?(vu(e,t,u),ma(e,t,u)):(Ue&&T&&Xc(t),t.flags|=1,qt(e,t,o,u),t.child)}function Km(e,t,s,o,u){if(e===null){var h=s.type;return typeof h=="function"&&!qc(h)&&h.defaultProps===void 0&&s.compare===null?(t.tag=15,t.type=h,Zm(e,t,h,o,u)):(e=Ml(s.type,null,o,t,t.mode,u),e.ref=t.ref,e.return=t,t.child=e)}if(h=e.child,!Gu(e,u)){var b=h.memoizedProps;if(s=s.compare,s=s!==null?s:io,s(b,o)&&e.ref===t.ref)return ma(e,t,u)}return t.flags|=1,e=ca(h,o),e.ref=t.ref,e.return=t,t.child=e}function Zm(e,t,s,o,u){if(e!==null){var h=e.memoizedProps;if(io(h,o)&&e.ref===t.ref)if(It=!1,t.pendingProps=o=h,Gu(e,u))(e.flags&131072)!==0&&(It=!0);else return t.lanes=e.lanes,ma(e,t,u)}return Ou(e,t,s,o,u)}function Xm(e,t,s,o){var u=o.children,h=e!==null?e.memoizedState:null;if(e===null&&t.stateNode===null&&(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),o.mode==="hidden"){if((t.flags&128)!==0){if(h=h!==null?h.baseLanes|s:s,e!==null){for(o=t.child=e.child,u=0;o!==null;)u=u|o.lanes|o.childLanes,o=o.sibling;o=u&~h}else o=0,t.child=null;return Qm(e,t,h,s,o)}if((s&536870912)!==0)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&Ll(t,h!==null?h.cachePool:null),h!==null?Jp(t,h):du(),em(t);else return o=t.lanes=536870912,Qm(e,t,h!==null?h.baseLanes|s:s,s,o)}else h!==null?(Ll(t,h.cachePool),Jp(t,h),Pa(),t.memoizedState=null):(e!==null&&Ll(t,null),du(),Pa());return qt(e,t,u,s),t.child}function _o(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function Qm(e,t,s,o,u){var h=iu();return h=h===null?null:{parent:Ot._currentValue,pool:h},t.memoizedState={baseLanes:s,cachePool:h},e!==null&&Ll(t,null),du(),em(t),e!==null&&oi(e,t,o,!0),t.childLanes=u,null}function Wl(e,t){return t=er({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 Cs(t,e.child,null,s),e=Wl(t,t.pendingProps),e.flags|=2,vn(t),t.memoizedState=null,e}function xS(e,t,s){var o=t.pendingProps,u=(t.flags&128)!==0;if(t.flags&=-129,e===null){if(Ue){if(o.mode==="hidden")return e=Wl(t,o),t.lanes=536870912,_o(null,e);if(hu(t),(e=dt)?(e=uv(e,Mn),e=e!==null&&e.data==="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Oa!==null?{id:qn,overflow:Kn}:null,retryLane:536870912,hydrationErrors:null},s=Op(e),s.return=t,t.child=s,Ft=t,dt=null)):e=null,e===null)throw Ia(t);return t.lanes=536870912,null}return Wl(t,o)}var h=e.memoizedState;if(h!==null){var b=h.dehydrated;if(hu(t),u)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(l(558));else if(It||oi(e,t,s,!1),u=(s&e.childLanes)!==0,It||u){if(o=ct,o!==null&&(b=Gh(o,s),b!==0&&b!==h.retryLane))throw h.retryLane=b,gs(e,b),fn(o,e,b),Bu;cr(),t=Wm(e,t,s)}else e=h.treeContext,dt=Bn(b.nextSibling),Ft=t,Ue=!0,La=null,Mn=!1,e!==null&&Up(t,e),t=Wl(t,o),t.flags|=4096;return t}return e=ca(e.child,{mode:o.mode,children:o.children}),e.ref=t.ref,t.child=e,e.return=t,e}function Jl(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(l(284));(e===null||e.ref!==s)&&(t.flags|=4194816)}}function Ou(e,t,s,o,u){return xs(t),s=mu(e,t,s,o,void 0,u),o=gu(),e!==null&&!It?(vu(e,t,u),ma(e,t,u)):(Ue&&o&&Xc(t),t.flags|=1,qt(e,t,s,u),t.child)}function Jm(e,t,s,o,u,h){return xs(t),t.updateQueue=null,s=nm(t,o,s,u),tm(e),o=gu(),e!==null&&!It?(vu(e,t,h),ma(e,t,h)):(Ue&&o&&Xc(t),t.flags|=1,qt(e,t,s,h),t.child)}function eg(e,t,s,o,u){if(xs(t),t.stateNode===null){var h=ni,b=s.contextType;typeof b=="object"&&b!==null&&(h=Yt(b)),h=new s(o,h),t.memoizedState=h.state!==null&&h.state!==void 0?h.state:null,h.updater=Mu,t.stateNode=h,h._reactInternals=t,h=t.stateNode,h.props=o,h.state=t.memoizedState,h.refs={},lu(t),b=s.contextType,h.context=typeof b=="object"&&b!==null?Yt(b):ni,h.state=t.memoizedState,b=s.getDerivedStateFromProps,typeof b=="function"&&(Du(t,s,b,o),h.state=t.memoizedState),typeof s.getDerivedStateFromProps=="function"||typeof h.getSnapshotBeforeUpdate=="function"||typeof h.UNSAFE_componentWillMount!="function"&&typeof h.componentWillMount!="function"||(b=h.state,typeof h.componentWillMount=="function"&&h.componentWillMount(),typeof h.UNSAFE_componentWillMount=="function"&&h.UNSAFE_componentWillMount(),b!==h.state&&Mu.enqueueReplaceState(h,h.state,null),go(t,o,h,u),mo(),h.state=t.memoizedState),typeof h.componentDidMount=="function"&&(t.flags|=4194308),o=!0}else if(e===null){h=t.stateNode;var T=t.memoizedProps,w=ks(s,T);h.props=w;var z=h.context,F=s.contextType;b=ni,typeof F=="object"&&F!==null&&(b=Yt(F));var Q=s.getDerivedStateFromProps;F=typeof Q=="function"||typeof h.getSnapshotBeforeUpdate=="function",T=t.pendingProps!==T,F||typeof h.UNSAFE_componentWillReceiveProps!="function"&&typeof h.componentWillReceiveProps!="function"||(T||z!==b)&&Vm(t,h,o,b),za=!1;var V=t.memoizedState;h.state=V,go(t,o,h,u),mo(),z=t.memoizedState,T||V!==z||za?(typeof Q=="function"&&(Du(t,s,Q,o),z=t.memoizedState),(w=za||zm(t,s,w,o,V,z,b))?(F||typeof h.UNSAFE_componentWillMount!="function"&&typeof h.componentWillMount!="function"||(typeof h.componentWillMount=="function"&&h.componentWillMount(),typeof h.UNSAFE_componentWillMount=="function"&&h.UNSAFE_componentWillMount()),typeof h.componentDidMount=="function"&&(t.flags|=4194308)):(typeof h.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=o,t.memoizedState=z),h.props=o,h.state=z,h.context=b,o=w):(typeof h.componentDidMount=="function"&&(t.flags|=4194308),o=!1)}else{h=t.stateNode,ru(e,t),b=t.memoizedProps,F=ks(s,b),h.props=F,Q=t.pendingProps,V=h.context,z=s.contextType,w=ni,typeof z=="object"&&z!==null&&(w=Yt(z)),T=s.getDerivedStateFromProps,(z=typeof T=="function"||typeof h.getSnapshotBeforeUpdate=="function")||typeof h.UNSAFE_componentWillReceiveProps!="function"&&typeof h.componentWillReceiveProps!="function"||(b!==Q||V!==w)&&Vm(t,h,o,w),za=!1,V=t.memoizedState,h.state=V,go(t,o,h,u),mo();var P=t.memoizedState;b!==Q||V!==P||za||e!==null&&e.dependencies!==null&&Bl(e.dependencies)?(typeof T=="function"&&(Du(t,s,T,o),P=t.memoizedState),(F=za||zm(t,s,F,o,V,P,w)||e!==null&&e.dependencies!==null&&Bl(e.dependencies))?(z||typeof h.UNSAFE_componentWillUpdate!="function"&&typeof h.componentWillUpdate!="function"||(typeof h.componentWillUpdate=="function"&&h.componentWillUpdate(o,P,w),typeof h.UNSAFE_componentWillUpdate=="function"&&h.UNSAFE_componentWillUpdate(o,P,w)),typeof h.componentDidUpdate=="function"&&(t.flags|=4),typeof h.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof h.componentDidUpdate!="function"||b===e.memoizedProps&&V===e.memoizedState||(t.flags|=4),typeof h.getSnapshotBeforeUpdate!="function"||b===e.memoizedProps&&V===e.memoizedState||(t.flags|=1024),t.memoizedProps=o,t.memoizedState=P),h.props=o,h.state=P,h.context=w,o=F):(typeof h.componentDidUpdate!="function"||b===e.memoizedProps&&V===e.memoizedState||(t.flags|=4),typeof h.getSnapshotBeforeUpdate!="function"||b===e.memoizedProps&&V===e.memoizedState||(t.flags|=1024),o=!1)}return h=o,Jl(e,t),o=(t.flags&128)!==0,h||o?(h=t.stateNode,s=o&&typeof s.getDerivedStateFromError!="function"?null:h.render(),t.flags|=1,e!==null&&o?(t.child=Cs(t,e.child,null,u),t.child=Cs(t,null,s,u)):qt(e,t,s,u),t.memoizedState=h.state,e=t.child):e=ma(e,t,u),e}function tg(e,t,s,o){return ys(),t.flags|=256,qt(e,t,s,o),t.child}var Lu={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Iu(e){return{baseLanes:e,cachePool:$p()}}function Uu(e,t,s){return e=e!==null?e.childLanes&~s:0,t&&(e|=bn),e}function ng(e,t,s){var o=t.pendingProps,u=!1,h=(t.flags&128)!==0,b;if((b=h)||(b=e!==null&&e.memoizedState===null?!1:(jt.current&2)!==0),b&&(u=!0,t.flags&=-129),b=(t.flags&32)!==0,t.flags&=-33,e===null){if(Ue){if(u?Ga(t):Pa(),(e=dt)?(e=uv(e,Mn),e=e!==null&&e.data!=="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Oa!==null?{id:qn,overflow:Kn}:null,retryLane:536870912,hydrationErrors:null},s=Op(e),s.return=t,t.child=s,Ft=t,dt=null)):e=null,e===null)throw Ia(t);return xd(e)?t.lanes=32:t.lanes=536870912,null}var T=o.children;return o=o.fallback,u?(Pa(),u=t.mode,T=er({mode:"hidden",children:T},u),o=vs(o,u,s,null),T.return=t,o.return=t,T.sibling=o,t.child=T,o=t.child,o.memoizedState=Iu(s),o.childLanes=Uu(e,b,s),t.memoizedState=Lu,_o(null,o)):(Ga(t),zu(t,T))}var w=e.memoizedState;if(w!==null&&(T=w.dehydrated,T!==null)){if(h)t.flags&256?(Ga(t),t.flags&=-257,t=Vu(e,t,s)):t.memoizedState!==null?(Pa(),t.child=e.child,t.flags|=128,t=null):(Pa(),T=o.fallback,u=t.mode,o=er({mode:"visible",children:o.children},u),T=vs(T,u,s,null),T.flags|=2,o.return=t,T.return=t,o.sibling=T,t.child=o,Cs(t,e.child,null,s),o=t.child,o.memoizedState=Iu(s),o.childLanes=Uu(e,b,s),t.memoizedState=Lu,t=_o(null,o));else if(Ga(t),xd(T)){if(b=T.nextSibling&&T.nextSibling.dataset,b)var z=b.dgst;b=z,o=Error(l(419)),o.stack="",o.digest=b,ro({value:o,source:null,stack:null}),t=Vu(e,t,s)}else if(It||oi(e,t,s,!1),b=(s&e.childLanes)!==0,It||b){if(b=ct,b!==null&&(o=Gh(b,s),o!==0&&o!==w.retryLane))throw w.retryLane=o,gs(e,o),fn(b,e,o),Bu;bd(T)||cr(),t=Vu(e,t,s)}else bd(T)?(t.flags|=192,t.child=e.child,t=null):(e=w.treeContext,dt=Bn(T.nextSibling),Ft=t,Ue=!0,La=null,Mn=!1,e!==null&&Up(t,e),t=zu(t,o.children),t.flags|=4096);return t}return u?(Pa(),T=o.fallback,u=t.mode,w=e.child,z=w.sibling,o=ca(w,{mode:"hidden",children:o.children}),o.subtreeFlags=w.subtreeFlags&65011712,z!==null?T=ca(z,T):(T=vs(T,u,s,null),T.flags|=2),T.return=t,o.return=t,o.sibling=T,t.child=o,_o(null,o),o=t.child,T=e.child.memoizedState,T===null?T=Iu(s):(u=T.cachePool,u!==null?(w=Ot._currentValue,u=u.parent!==w?{parent:w,pool:w}:u):u=$p(),T={baseLanes:T.baseLanes|s,cachePool:u}),o.memoizedState=T,o.childLanes=Uu(e,b,s),t.memoizedState=Lu,_o(e.child,o)):(Ga(t),s=e.child,e=s.sibling,s=ca(s,{mode:"visible",children:o.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 zu(e,t){return t=er({mode:"visible",children:t},e.mode),t.return=e,e.child=t}function er(e,t){return e=mn(22,e,null,t),e.lanes=0,e}function Vu(e,t,s){return Cs(t,e.child,null,s),e=zu(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function ag(e,t,s){e.lanes|=t;var o=e.alternate;o!==null&&(o.lanes|=t),tu(e.return,t,s)}function Hu(e,t,s,o,u,h){var b=e.memoizedState;b===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:o,tail:s,tailMode:u,treeForkCount:h}:(b.isBackwards=t,b.rendering=null,b.renderingStartTime=0,b.last=o,b.tail=s,b.tailMode=u,b.treeForkCount=h)}function sg(e,t,s){var o=t.pendingProps,u=o.revealOrder,h=o.tail;o=o.children;var b=jt.current,T=(b&2)!==0;if(T?(b=b&1|2,t.flags|=128):b&=1,Te(jt,b),qt(e,t,o,s),o=Ue?lo:0,!T&&e!==null&&(e.flags&128)!==0)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&ag(e,s,t);else if(e.tag===19)ag(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(u){case"forwards":for(s=t.child,u=null;s!==null;)e=s.alternate,e!==null&&Gl(e)===null&&(u=s),s=s.sibling;s=u,s===null?(u=t.child,t.child=null):(u=s.sibling,s.sibling=null),Hu(t,!1,u,s,h,o);break;case"backwards":case"unstable_legacy-backwards":for(s=null,u=t.child,t.child=null;u!==null;){if(e=u.alternate,e!==null&&Gl(e)===null){t.child=u;break}e=u.sibling,u.sibling=s,s=u,u=e}Hu(t,!0,s,null,h,o);break;case"together":Hu(t,!1,null,null,void 0,o);break;default:t.memoizedState=null}return t.child}function ma(e,t,s){if(e!==null&&(t.dependencies=e.dependencies),Ya|=t.lanes,(s&t.childLanes)===0)if(e!==null){if(oi(e,t,s,!1),(s&t.childLanes)===0)return null}else return null;if(e!==null&&t.child!==e.child)throw Error(l(153));if(t.child!==null){for(e=t.child,s=ca(e,e.pendingProps),t.child=s,s.return=t;e.sibling!==null;)e=e.sibling,s=s.sibling=ca(e,e.pendingProps),s.return=t;s.sibling=null}return t.child}function Gu(e,t){return(e.lanes&t)!==0?!0:(e=e.dependencies,!!(e!==null&&Bl(e)))}function _S(e,t,s){switch(t.tag){case 3:xe(t,t.stateNode.containerInfo),Ua(t,Ot,e.memoizedState.cache),ys();break;case 27:case 5:Ze(t);break;case 4:xe(t,t.stateNode.containerInfo);break;case 10:Ua(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,hu(t),null;break;case 13:var o=t.memoizedState;if(o!==null)return o.dehydrated!==null?(Ga(t),t.flags|=128,null):(s&t.child.childLanes)!==0?ng(e,t,s):(Ga(t),e=ma(e,t,s),e!==null?e.sibling:null);Ga(t);break;case 19:var u=(e.flags&128)!==0;if(o=(s&t.childLanes)!==0,o||(oi(e,t,s,!1),o=(s&t.childLanes)!==0),u){if(o)return sg(e,t,s);t.flags|=128}if(u=t.memoizedState,u!==null&&(u.rendering=null,u.tail=null,u.lastEffect=null),Te(jt,jt.current),o)break;return null;case 22:return t.lanes=0,Xm(e,t,s,t.pendingProps);case 24:Ua(t,Ot,e.memoizedState.cache)}return ma(e,t,s)}function ig(e,t,s){if(e!==null)if(e.memoizedProps!==t.pendingProps)It=!0;else{if(!Gu(e,s)&&(t.flags&128)===0)return It=!1,_S(e,t,s);It=(e.flags&131072)!==0}else It=!1,Ue&&(t.flags&1048576)!==0&&Ip(t,lo,t.index);switch(t.lanes=0,t.tag){case 16:e:{var o=t.pendingProps;if(e=Ss(t.elementType),t.type=e,typeof e=="function")qc(e)?(o=ks(e,o),t.tag=1,t=eg(null,t,e,o,s)):(t.tag=0,t=Ou(null,t,e,o,s));else{if(e!=null){var u=e.$$typeof;if(u===H){t.tag=11,t=qm(null,t,e,o,s);break e}else if(u===R){t.tag=14,t=Km(null,t,e,o,s);break e}}throw t=he(e)||e,Error(l(306,t,""))}}return t;case 0:return Ou(e,t,t.type,t.pendingProps,s);case 1:return o=t.type,u=ks(o,t.pendingProps),eg(e,t,o,u,s);case 3:e:{if(xe(t,t.stateNode.containerInfo),e===null)throw Error(l(387));o=t.pendingProps;var h=t.memoizedState;u=h.element,ru(e,t),go(t,o,null,s);var b=t.memoizedState;if(o=b.cache,Ua(t,Ot,o),o!==h.cache&&nu(t,[Ot],s,!0),mo(),o=b.element,h.isDehydrated)if(h={element:o,isDehydrated:!1,cache:b.cache},t.updateQueue.baseState=h,t.memoizedState=h,t.flags&256){t=tg(e,t,o,s);break e}else if(o!==u){u=Nn(Error(l(424)),t),ro(u),t=tg(e,t,o,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(dt=Bn(e.firstChild),Ft=t,Ue=!0,La=null,Mn=!0,s=Xp(t,null,o,s),t.child=s;s;)s.flags=s.flags&-3|4096,s=s.sibling}else{if(ys(),o===u){t=ma(e,t,s);break e}qt(e,t,o,s)}t=t.child}return t;case 26:return Jl(e,t),e===null?(s=gv(t.type,null,t.pendingProps,null))?t.memoizedState=s:Ue||(s=t.type,e=t.pendingProps,o=gr(wt.current).createElement(s),o[$t]=t,o[on]=e,Kt(o,s,e),Gt(o),t.stateNode=o):t.memoizedState=gv(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return Ze(t),e===null&&Ue&&(o=t.stateNode=hv(t.type,t.pendingProps,wt.current),Ft=t,Mn=!0,u=dt,Qa(t.type)?(_d=u,dt=Bn(o.firstChild)):dt=u),qt(e,t,t.pendingProps.children,s),Jl(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&Ue&&((u=o=dt)&&(o=QS(o,t.type,t.pendingProps,Mn),o!==null?(t.stateNode=o,Ft=t,dt=Bn(o.firstChild),Mn=!1,u=!0):u=!1),u||Ia(t)),Ze(t),u=t.type,h=t.pendingProps,b=e!==null?e.memoizedProps:null,o=h.children,gd(u,h)?o=null:b!==null&&gd(u,b)&&(t.flags|=32),t.memoizedState!==null&&(u=mu(e,t,fS,null,null,s),Lo._currentValue=u),Jl(e,t),qt(e,t,o,s),t.child;case 6:return e===null&&Ue&&((e=s=dt)&&(s=WS(s,t.pendingProps,Mn),s!==null?(t.stateNode=s,Ft=t,dt=null,e=!0):e=!1),e||Ia(t)),null;case 13:return ng(e,t,s);case 4:return xe(t,t.stateNode.containerInfo),o=t.pendingProps,e===null?t.child=Cs(t,null,o,s):qt(e,t,o,s),t.child;case 11:return qm(e,t,t.type,t.pendingProps,s);case 7:return qt(e,t,t.pendingProps,s),t.child;case 8:return qt(e,t,t.pendingProps.children,s),t.child;case 12:return qt(e,t,t.pendingProps.children,s),t.child;case 10:return o=t.pendingProps,Ua(t,t.type,o.value),qt(e,t,o.children,s),t.child;case 9:return u=t.type._context,o=t.pendingProps.children,xs(t),u=Yt(u),o=o(u),t.flags|=1,qt(e,t,o,s),t.child;case 14:return Km(e,t,t.type,t.pendingProps,s);case 15:return Zm(e,t,t.type,t.pendingProps,s);case 19:return sg(e,t,s);case 31:return xS(e,t,s);case 22:return Xm(e,t,s,t.pendingProps);case 24:return xs(t),o=Yt(Ot),e===null?(u=iu(),u===null&&(u=ct,h=au(),u.pooledCache=h,h.refCount++,h!==null&&(u.pooledCacheLanes|=s),u=h),t.memoizedState={parent:o,cache:u},lu(t),Ua(t,Ot,u)):((e.lanes&s)!==0&&(ru(e,t),go(t,null,null,s),mo()),u=e.memoizedState,h=t.memoizedState,u.parent!==o?(u={parent:o,cache:o},t.memoizedState=u,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=u),Ua(t,Ot,o)):(o=h.cache,Ua(t,Ot,o),o!==u.cache&&nu(t,[Ot],s,!0))),qt(e,t,t.pendingProps.children,s),t.child;case 29:throw t.pendingProps}throw Error(l(156,t.tag))}function ga(e){e.flags|=4}function Pu(e,t,s,o,u){if((t=(e.mode&32)!==0)&&(t=!1),t){if(e.flags|=16777216,(u&335544128)===u)if(e.stateNode.complete)e.flags|=8192;else if(Mg())e.flags|=8192;else throw Ts=Ul,ou}else e.flags&=-16777217}function og(e,t){if(t.type!=="stylesheet"||(t.state.loading&4)!==0)e.flags&=-16777217;else if(e.flags|=16777216,!_v(t))if(Mg())e.flags|=8192;else throw Ts=Ul,ou}function tr(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag!==22?zh():536870912,e.lanes|=t,yi|=t)}function So(e,t){if(!Ue)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 o=null;s!==null;)s.alternate!==null&&(o=s),s=s.sibling;o===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:o.sibling=null}}function ft(e){var t=e.alternate!==null&&e.alternate.child===e.child,s=0,o=0;if(t)for(var u=e.child;u!==null;)s|=u.lanes|u.childLanes,o|=u.subtreeFlags&65011712,o|=u.flags&65011712,u.return=e,u=u.sibling;else for(u=e.child;u!==null;)s|=u.lanes|u.childLanes,o|=u.subtreeFlags,o|=u.flags,u.return=e,u=u.sibling;return e.subtreeFlags|=o,e.childLanes=s,t}function SS(e,t,s){var o=t.pendingProps;switch(Qc(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return ft(t),null;case 1:return ft(t),null;case 3:return s=t.stateNode,o=null,e!==null&&(o=e.memoizedState.cache),t.memoizedState.cache!==o&&(t.flags|=2048),fa(Ot),J(),s.pendingContext&&(s.context=s.pendingContext,s.pendingContext=null),(e===null||e.child===null)&&(ii(t)?ga(t):e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,Jc())),ft(t),null;case 26:var u=t.type,h=t.memoizedState;return e===null?(ga(t),h!==null?(ft(t),og(t,h)):(ft(t),Pu(t,u,null,o,s))):h?h!==e.memoizedState?(ga(t),ft(t),og(t,h)):(ft(t),t.flags&=-16777217):(e=e.memoizedProps,e!==o&&ga(t),ft(t),Pu(t,u,e,o,s)),null;case 27:if(we(t),s=wt.current,u=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==o&&ga(t);else{if(!o){if(t.stateNode===null)throw Error(l(166));return ft(t),null}e=st.current,ii(t)?zp(t):(e=hv(u,o,s),t.stateNode=e,ga(t))}return ft(t),null;case 5:if(we(t),u=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==o&&ga(t);else{if(!o){if(t.stateNode===null)throw Error(l(166));return ft(t),null}if(h=st.current,ii(t))zp(t);else{var b=gr(wt.current);switch(h){case 1:h=b.createElementNS("http://www.w3.org/2000/svg",u);break;case 2:h=b.createElementNS("http://www.w3.org/1998/Math/MathML",u);break;default:switch(u){case"svg":h=b.createElementNS("http://www.w3.org/2000/svg",u);break;case"math":h=b.createElementNS("http://www.w3.org/1998/Math/MathML",u);break;case"script":h=b.createElement("div"),h.innerHTML="<script><\/script>",h=h.removeChild(h.firstChild);break;case"select":h=typeof o.is=="string"?b.createElement("select",{is:o.is}):b.createElement("select"),o.multiple?h.multiple=!0:o.size&&(h.size=o.size);break;default:h=typeof o.is=="string"?b.createElement(u,{is:o.is}):b.createElement(u)}}h[$t]=t,h[on]=o;e:for(b=t.child;b!==null;){if(b.tag===5||b.tag===6)h.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=h;e:switch(Kt(h,u,o),u){case"button":case"input":case"select":case"textarea":o=!!o.autoFocus;break e;case"img":o=!0;break e;default:o=!1}o&&ga(t)}}return ft(t),Pu(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,s),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==o&&ga(t);else{if(typeof o!="string"&&t.stateNode===null)throw Error(l(166));if(e=wt.current,ii(t)){if(e=t.stateNode,s=t.memoizedProps,o=null,u=Ft,u!==null)switch(u.tag){case 27:case 5:o=u.memoizedProps}e[$t]=t,e=!!(e.nodeValue===s||o!==null&&o.suppressHydrationWarning===!0||nv(e.nodeValue,s)),e||Ia(t,!0)}else e=gr(e).createTextNode(o),e[$t]=t,t.stateNode=e}return ft(t),null;case 31:if(s=t.memoizedState,e===null||e.memoizedState!==null){if(o=ii(t),s!==null){if(e===null){if(!o)throw Error(l(318));if(e=t.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(l(557));e[$t]=t}else ys(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;ft(t),e=!1}else s=Jc(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=s),e=!0;if(!e)return t.flags&256?(vn(t),t):(vn(t),null);if((t.flags&128)!==0)throw Error(l(558))}return ft(t),null;case 13:if(o=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(u=ii(t),o!==null&&o.dehydrated!==null){if(e===null){if(!u)throw Error(l(318));if(u=t.memoizedState,u=u!==null?u.dehydrated:null,!u)throw Error(l(317));u[$t]=t}else ys(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;ft(t),u=!1}else u=Jc(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=u),u=!0;if(!u)return t.flags&256?(vn(t),t):(vn(t),null)}return vn(t),(t.flags&128)!==0?(t.lanes=s,t):(s=o!==null,e=e!==null&&e.memoizedState!==null,s&&(o=t.child,u=null,o.alternate!==null&&o.alternate.memoizedState!==null&&o.alternate.memoizedState.cachePool!==null&&(u=o.alternate.memoizedState.cachePool.pool),h=null,o.memoizedState!==null&&o.memoizedState.cachePool!==null&&(h=o.memoizedState.cachePool.pool),h!==u&&(o.flags|=2048)),s!==e&&s&&(t.child.flags|=8192),tr(t,t.updateQueue),ft(t),null);case 4:return J(),e===null&&dd(t.stateNode.containerInfo),ft(t),null;case 10:return fa(t.type),ft(t),null;case 19:if(Re(jt),o=t.memoizedState,o===null)return ft(t),null;if(u=(t.flags&128)!==0,h=o.rendering,h===null)if(u)So(o,!1);else{if(Tt!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(h=Gl(e),h!==null){for(t.flags|=128,So(o,!1),e=h.updateQueue,t.updateQueue=e,tr(t,e),t.subtreeFlags=0,e=s,s=t.child;s!==null;)Bp(s,e),s=s.sibling;return Te(jt,jt.current&1|2),Ue&&ua(t,o.treeForkCount),t.child}e=e.sibling}o.tail!==null&&W()>or&&(t.flags|=128,u=!0,So(o,!1),t.lanes=4194304)}else{if(!u)if(e=Gl(h),e!==null){if(t.flags|=128,u=!0,e=e.updateQueue,t.updateQueue=e,tr(t,e),So(o,!0),o.tail===null&&o.tailMode==="hidden"&&!h.alternate&&!Ue)return ft(t),null}else 2*W()-o.renderingStartTime>or&&s!==536870912&&(t.flags|=128,u=!0,So(o,!1),t.lanes=4194304);o.isBackwards?(h.sibling=t.child,t.child=h):(e=o.last,e!==null?e.sibling=h:t.child=h,o.last=h)}return o.tail!==null?(e=o.tail,o.rendering=e,o.tail=e.sibling,o.renderingStartTime=W(),e.sibling=null,s=jt.current,Te(jt,u?s&1|2:s&1),Ue&&ua(t,o.treeForkCount),e):(ft(t),null);case 22:case 23:return vn(t),fu(),o=t.memoizedState!==null,e!==null?e.memoizedState!==null!==o&&(t.flags|=8192):o&&(t.flags|=8192),o?(s&536870912)!==0&&(t.flags&128)===0&&(ft(t),t.subtreeFlags&6&&(t.flags|=8192)):ft(t),s=t.updateQueue,s!==null&&tr(t,s.retryQueue),s=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(s=e.memoizedState.cachePool.pool),o=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(o=t.memoizedState.cachePool.pool),o!==s&&(t.flags|=2048),e!==null&&Re(_s),null;case 24:return s=null,e!==null&&(s=e.memoizedState.cache),t.memoizedState.cache!==s&&(t.flags|=2048),fa(Ot),ft(t),null;case 25:return null;case 30:return null}throw Error(l(156,t.tag))}function TS(e,t){switch(Qc(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return fa(Ot),J(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return we(t),null;case 31:if(t.memoizedState!==null){if(vn(t),t.alternate===null)throw Error(l(340));ys()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(vn(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(l(340));ys()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Re(jt),null;case 4:return J(),null;case 10:return fa(t.type),null;case 22:case 23:return vn(t),fu(),e!==null&&Re(_s),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return fa(Ot),null;case 25:return null;default:return null}}function lg(e,t){switch(Qc(t),t.tag){case 3:fa(Ot),J();break;case 26:case 27:case 5:we(t);break;case 4:J();break;case 31:t.memoizedState!==null&&vn(t);break;case 13:vn(t);break;case 19:Re(jt);break;case 10:fa(t.type);break;case 22:case 23:vn(t),fu(),e!==null&&Re(_s);break;case 24:fa(Ot)}}function To(e,t){try{var s=t.updateQueue,o=s!==null?s.lastEffect:null;if(o!==null){var u=o.next;s=u;do{if((s.tag&e)===e){o=void 0;var h=s.create,b=s.inst;o=h(),b.destroy=o}s=s.next}while(s!==u)}}catch(T){nt(t,t.return,T)}}function $a(e,t,s){try{var o=t.updateQueue,u=o!==null?o.lastEffect:null;if(u!==null){var h=u.next;o=h;do{if((o.tag&e)===e){var b=o.inst,T=b.destroy;if(T!==void 0){b.destroy=void 0,u=t;var w=s,z=T;try{z()}catch(F){nt(u,w,F)}}}o=o.next}while(o!==h)}}catch(F){nt(t,t.return,F)}}function rg(e){var t=e.updateQueue;if(t!==null){var s=e.stateNode;try{Wp(t,s)}catch(o){nt(e,e.return,o)}}}function cg(e,t,s){s.props=ks(e.type,e.memoizedProps),s.state=e.memoizedState;try{s.componentWillUnmount()}catch(o){nt(e,t,o)}}function Co(e,t){try{var s=e.ref;if(s!==null){switch(e.tag){case 26:case 27:case 5:var o=e.stateNode;break;case 30:o=e.stateNode;break;default:o=e.stateNode}typeof s=="function"?e.refCleanup=s(o):s.current=o}}catch(u){nt(e,t,u)}}function Zn(e,t){var s=e.ref,o=e.refCleanup;if(s!==null)if(typeof o=="function")try{o()}catch(u){nt(e,t,u)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof s=="function")try{s(null)}catch(u){nt(e,t,u)}else s.current=null}function ug(e){var t=e.type,s=e.memoizedProps,o=e.stateNode;try{e:switch(t){case"button":case"input":case"select":case"textarea":s.autoFocus&&o.focus();break e;case"img":s.src?o.src=s.src:s.srcSet&&(o.srcset=s.srcSet)}}catch(u){nt(e,e.return,u)}}function $u(e,t,s){try{var o=e.stateNode;FS(o,e.type,s,t),o[on]=t}catch(u){nt(e,e.return,u)}}function dg(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&Qa(e.type)||e.tag===4}function Fu(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||dg(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&&Qa(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 Yu(e,t,s){var o=e.tag;if(o===5||o===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=la));else if(o!==4&&(o===27&&Qa(e.type)&&(s=e.stateNode,t=null),e=e.child,e!==null))for(Yu(e,t,s),e=e.sibling;e!==null;)Yu(e,t,s),e=e.sibling}function nr(e,t,s){var o=e.tag;if(o===5||o===6)e=e.stateNode,t?s.insertBefore(e,t):s.appendChild(e);else if(o!==4&&(o===27&&Qa(e.type)&&(s=e.stateNode),e=e.child,e!==null))for(nr(e,t,s),e=e.sibling;e!==null;)nr(e,t,s),e=e.sibling}function fg(e){var t=e.stateNode,s=e.memoizedProps;try{for(var o=e.type,u=t.attributes;u.length;)t.removeAttributeNode(u[0]);Kt(t,o,s),t[$t]=e,t[on]=s}catch(h){nt(e,e.return,h)}}var va=!1,Ut=!1,qu=!1,hg=typeof WeakSet=="function"?WeakSet:Set,Pt=null;function CS(e,t){if(e=e.containerInfo,pd=Tr,e=Ep(e),Vc(e)){if("selectionStart"in e)var s={start:e.selectionStart,end:e.selectionEnd};else e:{s=(s=e.ownerDocument)&&s.defaultView||window;var o=s.getSelection&&s.getSelection();if(o&&o.rangeCount!==0){s=o.anchorNode;var u=o.anchorOffset,h=o.focusNode;o=o.focusOffset;try{s.nodeType,h.nodeType}catch{s=null;break e}var b=0,T=-1,w=-1,z=0,F=0,Q=e,V=null;t:for(;;){for(var P;Q!==s||u!==0&&Q.nodeType!==3||(T=b+u),Q!==h||o!==0&&Q.nodeType!==3||(w=b+o),Q.nodeType===3&&(b+=Q.nodeValue.length),(P=Q.firstChild)!==null;)V=Q,Q=P;for(;;){if(Q===e)break t;if(V===s&&++z===u&&(T=b),V===h&&++F===o&&(w=b),(P=Q.nextSibling)!==null)break;Q=V,V=Q.parentNode}Q=P}s=T===-1||w===-1?null:{start:T,end:w}}else s=null}s=s||{start:0,end:0}}else s=null;for(md={focusedElem:e,selectionRange:s},Tr=!1,Pt=t;Pt!==null;)if(t=Pt,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,Pt=e;else for(;Pt!==null;){switch(t=Pt,h=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++)u=e[s],u.ref.impl=u.nextImpl;break;case 11:case 15:break;case 1:if((e&1024)!==0&&h!==null){e=void 0,s=t,u=h.memoizedProps,h=h.memoizedState,o=s.stateNode;try{var re=ks(s.type,u);e=o.getSnapshotBeforeUpdate(re,h),o.__reactInternalSnapshotBeforeUpdate=e}catch(ge){nt(s,s.return,ge)}}break;case 3:if((e&1024)!==0){if(e=t.stateNode.containerInfo,s=e.nodeType,s===9)yd(e);else if(s===1)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":yd(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(l(163))}if(e=t.sibling,e!==null){e.return=t.return,Pt=e;break}Pt=t.return}}function pg(e,t,s){var o=s.flags;switch(s.tag){case 0:case 11:case 15:ba(e,s),o&4&&To(5,s);break;case 1:if(ba(e,s),o&4)if(e=s.stateNode,t===null)try{e.componentDidMount()}catch(b){nt(s,s.return,b)}else{var u=ks(s.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(u,t,e.__reactInternalSnapshotBeforeUpdate)}catch(b){nt(s,s.return,b)}}o&64&&rg(s),o&512&&Co(s,s.return);break;case 3:if(ba(e,s),o&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){nt(s,s.return,b)}}break;case 27:t===null&&o&4&&fg(s);case 26:case 5:ba(e,s),t===null&&o&4&&ug(s),o&512&&Co(s,s.return);break;case 12:ba(e,s);break;case 31:ba(e,s),o&4&&vg(e,s);break;case 13:ba(e,s),o&4&&yg(e,s),o&64&&(e=s.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(s=RS.bind(null,s),JS(e,s))));break;case 22:if(o=s.memoizedState!==null||va,!o){t=t!==null&&t.memoizedState!==null||Ut,u=va;var h=Ut;va=o,(Ut=t)&&!h?xa(e,s,(s.subtreeFlags&8772)!==0):ba(e,s),va=u,Ut=h}break;case 30:break;default:ba(e,s)}}function mg(e){var t=e.alternate;t!==null&&(e.alternate=null,mg(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&Tc(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 mt=null,rn=!1;function ya(e,t,s){for(s=s.child;s!==null;)gg(e,t,s),s=s.sibling}function gg(e,t,s){if(Ge&&typeof Ge.onCommitFiberUnmount=="function")try{Ge.onCommitFiberUnmount(bt,s)}catch{}switch(s.tag){case 26:Ut||Zn(s,t),ya(e,t,s),s.memoizedState?s.memoizedState.count--:s.stateNode&&(s=s.stateNode,s.parentNode.removeChild(s));break;case 27:Ut||Zn(s,t);var o=mt,u=rn;Qa(s.type)&&(mt=s.stateNode,rn=!1),ya(e,t,s),Ro(s.stateNode),mt=o,rn=u;break;case 5:Ut||Zn(s,t);case 6:if(o=mt,u=rn,mt=null,ya(e,t,s),mt=o,rn=u,mt!==null)if(rn)try{(mt.nodeType===9?mt.body:mt.nodeName==="HTML"?mt.ownerDocument.body:mt).removeChild(s.stateNode)}catch(h){nt(s,t,h)}else try{mt.removeChild(s.stateNode)}catch(h){nt(s,t,h)}break;case 18:mt!==null&&(rn?(e=mt,rv(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,s.stateNode),ki(e)):rv(mt,s.stateNode));break;case 4:o=mt,u=rn,mt=s.stateNode.containerInfo,rn=!0,ya(e,t,s),mt=o,rn=u;break;case 0:case 11:case 14:case 15:$a(2,s,t),Ut||$a(4,s,t),ya(e,t,s);break;case 1:Ut||(Zn(s,t),o=s.stateNode,typeof o.componentWillUnmount=="function"&&cg(s,t,o)),ya(e,t,s);break;case 21:ya(e,t,s);break;case 22:Ut=(o=Ut)||s.memoizedState!==null,ya(e,t,s),Ut=o;break;default:ya(e,t,s)}}function vg(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{ki(e)}catch(s){nt(t,t.return,s)}}}function yg(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{ki(e)}catch(s){nt(t,t.return,s)}}function ES(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new hg),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new hg),t;default:throw Error(l(435,e.tag))}}function ar(e,t){var s=ES(e);t.forEach(function(o){if(!s.has(o)){s.add(o);var u=BS.bind(null,e,o);o.then(u,u)}})}function cn(e,t){var s=t.deletions;if(s!==null)for(var o=0;o<s.length;o++){var u=s[o],h=e,b=t,T=b;e:for(;T!==null;){switch(T.tag){case 27:if(Qa(T.type)){mt=T.stateNode,rn=!1;break e}break;case 5:mt=T.stateNode,rn=!1;break e;case 3:case 4:mt=T.stateNode.containerInfo,rn=!0;break e}T=T.return}if(mt===null)throw Error(l(160));gg(h,b,u),mt=null,rn=!1,h=u.alternate,h!==null&&(h.return=null),u.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)bg(t,e),t=t.sibling}var Pn=null;function bg(e,t){var s=e.alternate,o=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:cn(t,e),un(e),o&4&&($a(3,e,e.return),To(3,e),$a(5,e,e.return));break;case 1:cn(t,e),un(e),o&512&&(Ut||s===null||Zn(s,s.return)),o&64&&va&&(e=e.updateQueue,e!==null&&(o=e.callbacks,o!==null&&(s=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=s===null?o:s.concat(o))));break;case 26:var u=Pn;if(cn(t,e),un(e),o&512&&(Ut||s===null||Zn(s,s.return)),o&4){var h=s!==null?s.memoizedState:null;if(o=e.memoizedState,s===null)if(o===null)if(e.stateNode===null){e:{o=e.type,s=e.memoizedProps,u=u.ownerDocument||u;t:switch(o){case"title":h=u.getElementsByTagName("title")[0],(!h||h[Xi]||h[$t]||h.namespaceURI==="http://www.w3.org/2000/svg"||h.hasAttribute("itemprop"))&&(h=u.createElement(o),u.head.insertBefore(h,u.querySelector("head > title"))),Kt(h,o,s),h[$t]=e,Gt(h),o=h;break e;case"link":var b=bv("link","href",u).get(o+(s.href||""));if(b){for(var T=0;T<b.length;T++)if(h=b[T],h.getAttribute("href")===(s.href==null||s.href===""?null:s.href)&&h.getAttribute("rel")===(s.rel==null?null:s.rel)&&h.getAttribute("title")===(s.title==null?null:s.title)&&h.getAttribute("crossorigin")===(s.crossOrigin==null?null:s.crossOrigin)){b.splice(T,1);break t}}h=u.createElement(o),Kt(h,o,s),u.head.appendChild(h);break;case"meta":if(b=bv("meta","content",u).get(o+(s.content||""))){for(T=0;T<b.length;T++)if(h=b[T],h.getAttribute("content")===(s.content==null?null:""+s.content)&&h.getAttribute("name")===(s.name==null?null:s.name)&&h.getAttribute("property")===(s.property==null?null:s.property)&&h.getAttribute("http-equiv")===(s.httpEquiv==null?null:s.httpEquiv)&&h.getAttribute("charset")===(s.charSet==null?null:s.charSet)){b.splice(T,1);break t}}h=u.createElement(o),Kt(h,o,s),u.head.appendChild(h);break;default:throw Error(l(468,o))}h[$t]=e,Gt(h),o=h}e.stateNode=o}else xv(u,e.type,e.stateNode);else e.stateNode=yv(u,o,e.memoizedProps);else h!==o?(h===null?s.stateNode!==null&&(s=s.stateNode,s.parentNode.removeChild(s)):h.count--,o===null?xv(u,e.type,e.stateNode):yv(u,o,e.memoizedProps)):o===null&&e.stateNode!==null&&$u(e,e.memoizedProps,s.memoizedProps)}break;case 27:cn(t,e),un(e),o&512&&(Ut||s===null||Zn(s,s.return)),s!==null&&o&4&&$u(e,e.memoizedProps,s.memoizedProps);break;case 5:if(cn(t,e),un(e),o&512&&(Ut||s===null||Zn(s,s.return)),e.flags&32){u=e.stateNode;try{Zs(u,"")}catch(re){nt(e,e.return,re)}}o&4&&e.stateNode!=null&&(u=e.memoizedProps,$u(e,u,s!==null?s.memoizedProps:u)),o&1024&&(qu=!0);break;case 6:if(cn(t,e),un(e),o&4){if(e.stateNode===null)throw Error(l(162));o=e.memoizedProps,s=e.stateNode;try{s.nodeValue=o}catch(re){nt(e,e.return,re)}}break;case 3:if(br=null,u=Pn,Pn=vr(t.containerInfo),cn(t,e),Pn=u,un(e),o&4&&s!==null&&s.memoizedState.isDehydrated)try{ki(t.containerInfo)}catch(re){nt(e,e.return,re)}qu&&(qu=!1,xg(e));break;case 4:o=Pn,Pn=vr(e.stateNode.containerInfo),cn(t,e),un(e),Pn=o;break;case 12:cn(t,e),un(e);break;case 31:cn(t,e),un(e),o&4&&(o=e.updateQueue,o!==null&&(e.updateQueue=null,ar(e,o)));break;case 13:cn(t,e),un(e),e.child.flags&8192&&e.memoizedState!==null!=(s!==null&&s.memoizedState!==null)&&(ir=W()),o&4&&(o=e.updateQueue,o!==null&&(e.updateQueue=null,ar(e,o)));break;case 22:u=e.memoizedState!==null;var w=s!==null&&s.memoizedState!==null,z=va,F=Ut;if(va=z||u,Ut=F||w,cn(t,e),Ut=F,va=z,un(e),o&8192)e:for(t=e.stateNode,t._visibility=u?t._visibility&-2:t._visibility|1,u&&(s===null||w||va||Ut||ws(e)),s=null,t=e;;){if(t.tag===5||t.tag===26){if(s===null){w=s=t;try{if(h=w.stateNode,u)b=h.style,typeof b.setProperty=="function"?b.setProperty("display","none","important"):b.display="none";else{T=w.stateNode;var Q=w.memoizedProps.style,V=Q!=null&&Q.hasOwnProperty("display")?Q.display:null;T.style.display=V==null||typeof V=="boolean"?"":(""+V).trim()}}catch(re){nt(w,w.return,re)}}}else if(t.tag===6){if(s===null){w=t;try{w.stateNode.nodeValue=u?"":w.memoizedProps}catch(re){nt(w,w.return,re)}}}else if(t.tag===18){if(s===null){w=t;try{var P=w.stateNode;u?cv(P,!0):cv(w.stateNode,!1)}catch(re){nt(w,w.return,re)}}}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}o&4&&(o=e.updateQueue,o!==null&&(s=o.retryQueue,s!==null&&(o.retryQueue=null,ar(e,s))));break;case 19:cn(t,e),un(e),o&4&&(o=e.updateQueue,o!==null&&(e.updateQueue=null,ar(e,o)));break;case 30:break;case 21:break;default:cn(t,e),un(e)}}function un(e){var t=e.flags;if(t&2){try{for(var s,o=e.return;o!==null;){if(dg(o)){s=o;break}o=o.return}if(s==null)throw Error(l(160));switch(s.tag){case 27:var u=s.stateNode,h=Fu(e);nr(e,h,u);break;case 5:var b=s.stateNode;s.flags&32&&(Zs(b,""),s.flags&=-33);var T=Fu(e);nr(e,T,b);break;case 3:case 4:var w=s.stateNode.containerInfo,z=Fu(e);Yu(e,z,w);break;default:throw Error(l(161))}}catch(F){nt(e,e.return,F)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function xg(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;xg(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function ba(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)pg(e,t.alternate,t),t=t.sibling}function ws(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:$a(4,t,t.return),ws(t);break;case 1:Zn(t,t.return);var s=t.stateNode;typeof s.componentWillUnmount=="function"&&cg(t,t.return,s),ws(t);break;case 27:Ro(t.stateNode);case 26:case 5:Zn(t,t.return),ws(t);break;case 22:t.memoizedState===null&&ws(t);break;case 30:ws(t);break;default:ws(t)}e=e.sibling}}function xa(e,t,s){for(s=s&&(t.subtreeFlags&8772)!==0,t=t.child;t!==null;){var o=t.alternate,u=e,h=t,b=h.flags;switch(h.tag){case 0:case 11:case 15:xa(u,h,s),To(4,h);break;case 1:if(xa(u,h,s),o=h,u=o.stateNode,typeof u.componentDidMount=="function")try{u.componentDidMount()}catch(z){nt(o,o.return,z)}if(o=h,u=o.updateQueue,u!==null){var T=o.stateNode;try{var w=u.shared.hiddenCallbacks;if(w!==null)for(u.shared.hiddenCallbacks=null,u=0;u<w.length;u++)Qp(w[u],T)}catch(z){nt(o,o.return,z)}}s&&b&64&&rg(h),Co(h,h.return);break;case 27:fg(h);case 26:case 5:xa(u,h,s),s&&o===null&&b&4&&ug(h),Co(h,h.return);break;case 12:xa(u,h,s);break;case 31:xa(u,h,s),s&&b&4&&vg(u,h);break;case 13:xa(u,h,s),s&&b&4&&yg(u,h);break;case 22:h.memoizedState===null&&xa(u,h,s),Co(h,h.return);break;case 30:break;default:xa(u,h,s)}t=t.sibling}}function Ku(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&&co(s))}function Zu(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&co(e))}function $n(e,t,s,o){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)_g(e,t,s,o),t=t.sibling}function _g(e,t,s,o){var u=t.flags;switch(t.tag){case 0:case 11:case 15:$n(e,t,s,o),u&2048&&To(9,t);break;case 1:$n(e,t,s,o);break;case 3:$n(e,t,s,o),u&2048&&(e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&co(e)));break;case 12:if(u&2048){$n(e,t,s,o),e=t.stateNode;try{var h=t.memoizedProps,b=h.id,T=h.onPostCommit;typeof T=="function"&&T(b,t.alternate===null?"mount":"update",e.passiveEffectDuration,-0)}catch(w){nt(t,t.return,w)}}else $n(e,t,s,o);break;case 31:$n(e,t,s,o);break;case 13:$n(e,t,s,o);break;case 23:break;case 22:h=t.stateNode,b=t.alternate,t.memoizedState!==null?h._visibility&2?$n(e,t,s,o):Eo(e,t):h._visibility&2?$n(e,t,s,o):(h._visibility|=2,mi(e,t,s,o,(t.subtreeFlags&10256)!==0||!1)),u&2048&&Ku(b,t);break;case 24:$n(e,t,s,o),u&2048&&Zu(t.alternate,t);break;default:$n(e,t,s,o)}}function mi(e,t,s,o,u){for(u=u&&((t.subtreeFlags&10256)!==0||!1),t=t.child;t!==null;){var h=e,b=t,T=s,w=o,z=b.flags;switch(b.tag){case 0:case 11:case 15:mi(h,b,T,w,u),To(8,b);break;case 23:break;case 22:var F=b.stateNode;b.memoizedState!==null?F._visibility&2?mi(h,b,T,w,u):Eo(h,b):(F._visibility|=2,mi(h,b,T,w,u)),u&&z&2048&&Ku(b.alternate,b);break;case 24:mi(h,b,T,w,u),u&&z&2048&&Zu(b.alternate,b);break;default:mi(h,b,T,w,u)}t=t.sibling}}function Eo(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var s=e,o=t,u=o.flags;switch(o.tag){case 22:Eo(s,o),u&2048&&Ku(o.alternate,o);break;case 24:Eo(s,o),u&2048&&Zu(o.alternate,o);break;default:Eo(s,o)}t=t.sibling}}var ko=8192;function gi(e,t,s){if(e.subtreeFlags&ko)for(e=e.child;e!==null;)Sg(e,t,s),e=e.sibling}function Sg(e,t,s){switch(e.tag){case 26:gi(e,t,s),e.flags&ko&&e.memoizedState!==null&&d1(s,Pn,e.memoizedState,e.memoizedProps);break;case 5:gi(e,t,s);break;case 3:case 4:var o=Pn;Pn=vr(e.stateNode.containerInfo),gi(e,t,s),Pn=o;break;case 22:e.memoizedState===null&&(o=e.alternate,o!==null&&o.memoizedState!==null?(o=ko,ko=16777216,gi(e,t,s),ko=o):gi(e,t,s));break;default:gi(e,t,s)}}function Tg(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 wo(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var s=0;s<t.length;s++){var o=t[s];Pt=o,Eg(o,e)}Tg(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)Cg(e),e=e.sibling}function Cg(e){switch(e.tag){case 0:case 11:case 15:wo(e),e.flags&2048&&$a(9,e,e.return);break;case 3:wo(e);break;case 12:wo(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,sr(e)):wo(e);break;default:wo(e)}}function sr(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var s=0;s<t.length;s++){var o=t[s];Pt=o,Eg(o,e)}Tg(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:$a(8,t,t.return),sr(t);break;case 22:s=t.stateNode,s._visibility&2&&(s._visibility&=-3,sr(t));break;default:sr(t)}e=e.sibling}}function Eg(e,t){for(;Pt!==null;){var s=Pt;switch(s.tag){case 0:case 11:case 15:$a(8,s,t);break;case 23:case 22:if(s.memoizedState!==null&&s.memoizedState.cachePool!==null){var o=s.memoizedState.cachePool.pool;o!=null&&o.refCount++}break;case 24:co(s.memoizedState.cache)}if(o=s.child,o!==null)o.return=s,Pt=o;else e:for(s=e;Pt!==null;){o=Pt;var u=o.sibling,h=o.return;if(mg(o),o===s){Pt=null;break e}if(u!==null){u.return=h,Pt=u;break e}Pt=h}}}var kS={getCacheForType:function(e){var t=Yt(Ot),s=t.data.get(e);return s===void 0&&(s=e(),t.data.set(e,s)),s},cacheSignal:function(){return Yt(Ot).controller.signal}},wS=typeof WeakMap=="function"?WeakMap:Map,qe=0,ct=null,De=null,Be=0,tt=0,yn=null,Fa=!1,vi=!1,Xu=!1,_a=0,Tt=0,Ya=0,As=0,Qu=0,bn=0,yi=0,Ao=null,dn=null,Wu=!1,ir=0,kg=0,or=1/0,lr=null,qa=null,Vt=0,Ka=null,bi=null,Sa=0,Ju=0,ed=null,wg=null,No=0,td=null;function xn(){return(qe&2)!==0&&Be!==0?Be&-Be:j.T!==null?ld():Ph()}function Ag(){if(bn===0)if((Be&536870912)===0||Ue){var e=Se;Se<<=1,(Se&3932160)===0&&(Se=262144),bn=e}else bn=536870912;return e=gn.current,e!==null&&(e.flags|=32),bn}function fn(e,t,s){(e===ct&&(tt===2||tt===9)||e.cancelPendingCommit!==null)&&(xi(e,0),Za(e,Be,bn,!1)),Zi(e,s),((qe&2)===0||e!==ct)&&(e===ct&&((qe&2)===0&&(As|=s),Tt===4&&Za(e,Be,bn,!1)),Xn(e))}function Ng(e,t,s){if((qe&6)!==0)throw Error(l(327));var o=!s&&(t&127)===0&&(t&e.expiredLanes)===0||sn(e,t),u=o?jS(e,t):ad(e,t,!0),h=o;do{if(u===0){vi&&!o&&Za(e,t,0,!1);break}else{if(s=e.current.alternate,h&&!AS(s)){u=ad(e,t,!1),h=!1;continue}if(u===2){if(h=t,e.errorRecoveryDisabledLanes&h)var b=0;else b=e.pendingLanes&-536870913,b=b!==0?b:b&536870912?536870912:0;if(b!==0){t=b;e:{var T=e;u=Ao;var w=T.current.memoizedState.isDehydrated;if(w&&(xi(T,b).flags|=256),b=ad(T,b,!1),b!==2){if(Xu&&!w){T.errorRecoveryDisabledLanes|=h,As|=h,u=4;break e}h=dn,dn=u,h!==null&&(dn===null?dn=h:dn.push.apply(dn,h))}u=b}if(h=!1,u!==2)continue}}if(u===1){xi(e,0),Za(e,t,0,!0);break}e:{switch(o=e,h=u,h){case 0:case 1:throw Error(l(345));case 4:if((t&4194048)!==t)break;case 6:Za(o,t,bn,!Fa);break e;case 2:dn=null;break;case 3:case 5:break;default:throw Error(l(329))}if((t&62914560)===t&&(u=ir+300-W(),10<u)){if(Za(o,t,bn,!Fa),Ne(o,0,!0)!==0)break e;Sa=t,o.timeoutHandle=ov(jg.bind(null,o,s,dn,lr,Wu,t,bn,As,yi,Fa,h,"Throttled",-0,0),u);break e}jg(o,s,dn,lr,Wu,t,bn,As,yi,Fa,h,null,-0,0)}}break}while(!0);Xn(e)}function jg(e,t,s,o,u,h,b,T,w,z,F,Q,V,P){if(e.timeoutHandle=-1,Q=t.subtreeFlags,Q&8192||(Q&16785408)===16785408){Q={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:la},Sg(t,h,Q);var re=(h&62914560)===h?ir-W():(h&4194048)===h?kg-W():0;if(re=f1(Q,re),re!==null){Sa=h,e.cancelPendingCommit=re(Ug.bind(null,e,t,h,s,o,u,b,T,w,F,Q,null,V,P)),Za(e,h,b,!z);return}}Ug(e,t,h,s,o,u,b,T,w)}function AS(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 o=0;o<s.length;o++){var u=s[o],h=u.getSnapshot;u=u.value;try{if(!pn(h(),u))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 Za(e,t,s,o){t&=~Qu,t&=~As,e.suspendedLanes|=t,e.pingedLanes&=~t,o&&(e.warmLanes|=t),o=e.expirationTimes;for(var u=t;0<u;){var h=31-Ee(u),b=1<<h;o[h]=-1,u&=~b}s!==0&&Vh(e,s,t)}function rr(){return(qe&6)===0?(jo(0),!1):!0}function nd(){if(De!==null){if(tt===0)var e=De.return;else e=De,da=bs=null,yu(e),ui=null,fo=0,e=De;for(;e!==null;)lg(e.alternate,e),e=e.return;De=null}}function xi(e,t){var s=e.timeoutHandle;s!==-1&&(e.timeoutHandle=-1,KS(s)),s=e.cancelPendingCommit,s!==null&&(e.cancelPendingCommit=null,s()),Sa=0,nd(),ct=e,De=s=ca(e.current,null),Be=t,tt=0,yn=null,Fa=!1,vi=sn(e,t),Xu=!1,yi=bn=Qu=As=Ya=Tt=0,dn=Ao=null,Wu=!1,(t&8)!==0&&(t|=t&32);var o=e.entangledLanes;if(o!==0)for(e=e.entanglements,o&=t;0<o;){var u=31-Ee(o),h=1<<u;t|=e[u],o&=~h}return _a=t,Nl(),s}function Dg(e,t){ke=null,j.H=xo,t===ci||t===Il?(t=qp(),tt=3):t===ou?(t=qp(),tt=4):tt=t===Bu?8:t!==null&&typeof t=="object"&&typeof t.then=="function"?6:1,yn=t,De===null&&(Tt=1,Ql(e,Nn(t,e.current)))}function Mg(){var e=gn.current;return e===null?!0:(Be&4194048)===Be?Rn===null:(Be&62914560)===Be||(Be&536870912)!==0?e===Rn:!1}function Rg(){var e=j.H;return j.H=xo,e===null?xo:e}function Bg(){var e=j.A;return j.A=kS,e}function cr(){Tt=4,Fa||(Be&4194048)!==Be&&gn.current!==null||(vi=!0),(Ya&134217727)===0&&(As&134217727)===0||ct===null||Za(ct,Be,bn,!1)}function ad(e,t,s){var o=qe;qe|=2;var u=Rg(),h=Bg();(ct!==e||Be!==t)&&(lr=null,xi(e,t)),t=!1;var b=Tt;e:do try{if(tt!==0&&De!==null){var T=De,w=yn;switch(tt){case 8:nd(),b=6;break e;case 3:case 2:case 9:case 6:gn.current===null&&(t=!0);var z=tt;if(tt=0,yn=null,_i(e,T,w,z),s&&vi){b=0;break e}break;default:z=tt,tt=0,yn=null,_i(e,T,w,z)}}NS(),b=Tt;break}catch(F){Dg(e,F)}while(!0);return t&&e.shellSuspendCounter++,da=bs=null,qe=o,j.H=u,j.A=h,De===null&&(ct=null,Be=0,Nl()),b}function NS(){for(;De!==null;)Og(De)}function jS(e,t){var s=qe;qe|=2;var o=Rg(),u=Bg();ct!==e||Be!==t?(lr=null,or=W()+500,xi(e,t)):vi=sn(e,t);e:do try{if(tt!==0&&De!==null){t=De;var h=yn;t:switch(tt){case 1:tt=0,yn=null,_i(e,t,h,1);break;case 2:case 9:if(Fp(h)){tt=0,yn=null,Lg(t);break}t=function(){tt!==2&&tt!==9||ct!==e||(tt=7),Xn(e)},h.then(t,t);break e;case 3:tt=7;break e;case 4:tt=5;break e;case 7:Fp(h)?(tt=0,yn=null,Lg(t)):(tt=0,yn=null,_i(e,t,h,7));break;case 5:var b=null;switch(De.tag){case 26:b=De.memoizedState;case 5:case 27:var T=De;if(b?_v(b):T.stateNode.complete){tt=0,yn=null;var w=T.sibling;if(w!==null)De=w;else{var z=T.return;z!==null?(De=z,ur(z)):De=null}break t}}tt=0,yn=null,_i(e,t,h,5);break;case 6:tt=0,yn=null,_i(e,t,h,6);break;case 8:nd(),Tt=6;break e;default:throw Error(l(462))}}DS();break}catch(F){Dg(e,F)}while(!0);return da=bs=null,j.H=o,j.A=u,qe=s,De!==null?0:(ct=null,Be=0,Nl(),Tt)}function DS(){for(;De!==null&&!Gs();)Og(De)}function Og(e){var t=ig(e.alternate,e,_a);e.memoizedProps=e.pendingProps,t===null?ur(e):De=t}function Lg(e){var t=e,s=t.alternate;switch(t.tag){case 15:case 0:t=Jm(s,t,t.pendingProps,t.type,void 0,Be);break;case 11:t=Jm(s,t,t.pendingProps,t.type.render,t.ref,Be);break;case 5:yu(t);default:lg(s,t),t=De=Bp(t,_a),t=ig(s,t,_a)}e.memoizedProps=e.pendingProps,t===null?ur(e):De=t}function _i(e,t,s,o){da=bs=null,yu(t),ui=null,fo=0;var u=t.return;try{if(bS(e,u,t,s,Be)){Tt=1,Ql(e,Nn(s,e.current)),De=null;return}}catch(h){if(u!==null)throw De=u,h;Tt=1,Ql(e,Nn(s,e.current)),De=null;return}t.flags&32768?(Ue||o===1?e=!0:vi||(Be&536870912)!==0?e=!1:(Fa=e=!0,(o===2||o===9||o===3||o===6)&&(o=gn.current,o!==null&&o.tag===13&&(o.flags|=16384))),Ig(t,e)):ur(t)}function ur(e){var t=e;do{if((t.flags&32768)!==0){Ig(t,Fa);return}e=t.return;var s=SS(t.alternate,t,_a);if(s!==null){De=s;return}if(t=t.sibling,t!==null){De=t;return}De=t=e}while(t!==null);Tt===0&&(Tt=5)}function Ig(e,t){do{var s=TS(e.alternate,e);if(s!==null){s.flags&=32767,De=s;return}if(s=e.return,s!==null&&(s.flags|=32768,s.subtreeFlags=0,s.deletions=null),!t&&(e=e.sibling,e!==null)){De=e;return}De=e=s}while(e!==null);Tt=6,De=null}function Ug(e,t,s,o,u,h,b,T,w){e.cancelPendingCommit=null;do dr();while(Vt!==0);if((qe&6)!==0)throw Error(l(327));if(t!==null){if(t===e.current)throw Error(l(177));if(h=t.lanes|t.childLanes,h|=Fc,u_(e,s,h,b,T,w),e===ct&&(De=ct=null,Be=0),bi=t,Ka=e,Sa=s,Ju=h,ed=u,wg=o,(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?(e.callbackNode=null,e.callbackPriority=0,OS(He,function(){return Pg(),null})):(e.callbackNode=null,e.callbackPriority=0),o=(t.flags&13878)!==0,(t.subtreeFlags&13878)!==0||o){o=j.T,j.T=null,u=Z.p,Z.p=2,b=qe,qe|=4;try{CS(e,t,s)}finally{qe=b,Z.p=u,j.T=o}}Vt=1,zg(),Vg(),Hg()}}function zg(){if(Vt===1){Vt=0;var e=Ka,t=bi,s=(t.flags&13878)!==0;if((t.subtreeFlags&13878)!==0||s){s=j.T,j.T=null;var o=Z.p;Z.p=2;var u=qe;qe|=4;try{bg(t,e);var h=md,b=Ep(e.containerInfo),T=h.focusedElem,w=h.selectionRange;if(b!==T&&T&&T.ownerDocument&&Cp(T.ownerDocument.documentElement,T)){if(w!==null&&Vc(T)){var z=w.start,F=w.end;if(F===void 0&&(F=z),"selectionStart"in T)T.selectionStart=z,T.selectionEnd=Math.min(F,T.value.length);else{var Q=T.ownerDocument||document,V=Q&&Q.defaultView||window;if(V.getSelection){var P=V.getSelection(),re=T.textContent.length,ge=Math.min(w.start,re),lt=w.end===void 0?ge:Math.min(w.end,re);!P.extend&&ge>lt&&(b=lt,lt=ge,ge=b);var B=Tp(T,ge),M=Tp(T,lt);if(B&&M&&(P.rangeCount!==1||P.anchorNode!==B.node||P.anchorOffset!==B.offset||P.focusNode!==M.node||P.focusOffset!==M.offset)){var U=Q.createRange();U.setStart(B.node,B.offset),P.removeAllRanges(),ge>lt?(P.addRange(U),P.extend(M.node,M.offset)):(U.setEnd(M.node,M.offset),P.addRange(U))}}}}for(Q=[],P=T;P=P.parentNode;)P.nodeType===1&&Q.push({element:P,left:P.scrollLeft,top:P.scrollTop});for(typeof T.focus=="function"&&T.focus(),T=0;T<Q.length;T++){var q=Q[T];q.element.scrollLeft=q.left,q.element.scrollTop=q.top}}Tr=!!pd,md=pd=null}finally{qe=u,Z.p=o,j.T=s}}e.current=t,Vt=2}}function Vg(){if(Vt===2){Vt=0;var e=Ka,t=bi,s=(t.flags&8772)!==0;if((t.subtreeFlags&8772)!==0||s){s=j.T,j.T=null;var o=Z.p;Z.p=2;var u=qe;qe|=4;try{pg(e,t.alternate,t)}finally{qe=u,Z.p=o,j.T=s}}Vt=3}}function Hg(){if(Vt===4||Vt===3){Vt=0,X();var e=Ka,t=bi,s=Sa,o=wg;(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?Vt=5:(Vt=0,bi=Ka=null,Gg(e,e.pendingLanes));var u=e.pendingLanes;if(u===0&&(qa=null),_c(s),t=t.stateNode,Ge&&typeof Ge.onCommitFiberRoot=="function")try{Ge.onCommitFiberRoot(bt,t,void 0,(t.current.flags&128)===128)}catch{}if(o!==null){t=j.T,u=Z.p,Z.p=2,j.T=null;try{for(var h=e.onRecoverableError,b=0;b<o.length;b++){var T=o[b];h(T.value,{componentStack:T.stack})}}finally{j.T=t,Z.p=u}}(Sa&3)!==0&&dr(),Xn(e),u=e.pendingLanes,(s&261930)!==0&&(u&42)!==0?e===td?No++:(No=0,td=e):No=0,jo(0)}}function Gg(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,co(t)))}function dr(){return zg(),Vg(),Hg(),Pg()}function Pg(){if(Vt!==5)return!1;var e=Ka,t=Ju;Ju=0;var s=_c(Sa),o=j.T,u=Z.p;try{Z.p=32>s?32:s,j.T=null,s=ed,ed=null;var h=Ka,b=Sa;if(Vt=0,bi=Ka=null,Sa=0,(qe&6)!==0)throw Error(l(331));var T=qe;if(qe|=4,Cg(h.current),_g(h,h.current,b,s),qe=T,jo(0,!1),Ge&&typeof Ge.onPostCommitFiberRoot=="function")try{Ge.onPostCommitFiberRoot(bt,h)}catch{}return!0}finally{Z.p=u,j.T=o,Gg(e,t)}}function $g(e,t,s){t=Nn(s,t),t=Ru(e.stateNode,t,2),e=Ha(e,t,2),e!==null&&(Zi(e,2),Xn(e))}function nt(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 o=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof o.componentDidCatch=="function"&&(qa===null||!qa.has(o))){e=Nn(s,e),s=Fm(2),o=Ha(t,s,2),o!==null&&(Ym(s,o,t,e),Zi(o,2),Xn(o));break}}t=t.return}}function sd(e,t,s){var o=e.pingCache;if(o===null){o=e.pingCache=new wS;var u=new Set;o.set(t,u)}else u=o.get(t),u===void 0&&(u=new Set,o.set(t,u));u.has(s)||(Xu=!0,u.add(s),e=MS.bind(null,e,t,s),t.then(e,e))}function MS(e,t,s){var o=e.pingCache;o!==null&&o.delete(t),e.pingedLanes|=e.suspendedLanes&s,e.warmLanes&=~s,ct===e&&(Be&s)===s&&(Tt===4||Tt===3&&(Be&62914560)===Be&&300>W()-ir?(qe&2)===0&&xi(e,0):Qu|=s,yi===Be&&(yi=0)),Xn(e)}function Fg(e,t){t===0&&(t=zh()),e=gs(e,t),e!==null&&(Zi(e,t),Xn(e))}function RS(e){var t=e.memoizedState,s=0;t!==null&&(s=t.retryLane),Fg(e,s)}function BS(e,t){var s=0;switch(e.tag){case 31:case 13:var o=e.stateNode,u=e.memoizedState;u!==null&&(s=u.retryLane);break;case 19:o=e.stateNode;break;case 22:o=e.stateNode._retryCache;break;default:throw Error(l(314))}o!==null&&o.delete(t),Fg(e,s)}function OS(e,t){return sa(e,t)}var fr=null,Si=null,id=!1,hr=!1,od=!1,Xa=0;function Xn(e){e!==Si&&e.next===null&&(Si===null?fr=Si=e:Si=Si.next=e),hr=!0,id||(id=!0,IS())}function jo(e,t){if(!od&&hr){od=!0;do for(var s=!1,o=fr;o!==null;){if(e!==0){var u=o.pendingLanes;if(u===0)var h=0;else{var b=o.suspendedLanes,T=o.pingedLanes;h=(1<<31-Ee(42|e)+1)-1,h&=u&~(b&~T),h=h&201326741?h&201326741|1:h?h|2:0}h!==0&&(s=!0,Zg(o,h))}else h=Be,h=Ne(o,o===ct?h:0,o.cancelPendingCommit!==null||o.timeoutHandle!==-1),(h&3)===0||sn(o,h)||(s=!0,Zg(o,h));o=o.next}while(s);od=!1}}function LS(){Yg()}function Yg(){hr=id=!1;var e=0;Xa!==0&&qS()&&(e=Xa);for(var t=W(),s=null,o=fr;o!==null;){var u=o.next,h=qg(o,t);h===0?(o.next=null,s===null?fr=u:s.next=u,u===null&&(Si=s)):(s=o,(e!==0||(h&3)!==0)&&(hr=!0)),o=u}Vt!==0&&Vt!==5||jo(e),Xa!==0&&(Xa=0)}function qg(e,t){for(var s=e.suspendedLanes,o=e.pingedLanes,u=e.expirationTimes,h=e.pendingLanes&-62914561;0<h;){var b=31-Ee(h),T=1<<b,w=u[b];w===-1?((T&s)===0||(T&o)!==0)&&(u[b]=Ki(T,t)):w<=t&&(e.expiredLanes|=T),h&=~T}if(t=ct,s=Be,s=Ne(e,e===t?s:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),o=e.callbackNode,s===0||e===t&&(tt===2||tt===9)||e.cancelPendingCommit!==null)return o!==null&&o!==null&&Yn(o),e.callbackNode=null,e.callbackPriority=0;if((s&3)===0||sn(e,s)){if(t=s&-s,t===e.callbackPriority)return t;switch(o!==null&&Yn(o),_c(s)){case 2:case 8:s=me;break;case 32:s=He;break;case 268435456:s=yt;break;default:s=He}return o=Kg.bind(null,e),s=sa(s,o),e.callbackPriority=t,e.callbackNode=s,t}return o!==null&&o!==null&&Yn(o),e.callbackPriority=2,e.callbackNode=null,2}function Kg(e,t){if(Vt!==0&&Vt!==5)return e.callbackNode=null,e.callbackPriority=0,null;var s=e.callbackNode;if(dr()&&e.callbackNode!==s)return null;var o=Be;return o=Ne(e,e===ct?o:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),o===0?null:(Ng(e,o,t),qg(e,W()),e.callbackNode!=null&&e.callbackNode===s?Kg.bind(null,e):null)}function Zg(e,t){if(dr())return null;Ng(e,t,!0)}function IS(){ZS(function(){(qe&6)!==0?sa(ye,LS):Yg()})}function ld(){if(Xa===0){var e=li;e===0&&(e=rt,rt<<=1,(rt&261888)===0&&(rt=256)),Xa=e}return Xa}function Xg(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:_l(""+e)}function Qg(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 US(e,t,s,o,u){if(t==="submit"&&s&&s.stateNode===u){var h=Xg((u[on]||null).action),b=o.submitter;b&&(t=(t=b[on]||null)?Xg(t.formAction):b.getAttribute("formAction"),t!==null&&(h=t,b=null));var T=new El("action","action",null,o,u);e.push({event:T,listeners:[{instance:null,listener:function(){if(o.defaultPrevented){if(Xa!==0){var w=b?Qg(u,b):new FormData(u);wu(s,{pending:!0,data:w,method:u.method,action:h},null,w)}}else typeof h=="function"&&(T.preventDefault(),w=b?Qg(u,b):new FormData(u),wu(s,{pending:!0,data:w,method:u.method,action:h},h,w))},currentTarget:u}]})}}for(var rd=0;rd<$c.length;rd++){var cd=$c[rd],zS=cd.toLowerCase(),VS=cd[0].toUpperCase()+cd.slice(1);Gn(zS,"on"+VS)}Gn(Ap,"onAnimationEnd"),Gn(Np,"onAnimationIteration"),Gn(jp,"onAnimationStart"),Gn("dblclick","onDoubleClick"),Gn("focusin","onFocus"),Gn("focusout","onBlur"),Gn(nS,"onTransitionRun"),Gn(aS,"onTransitionStart"),Gn(sS,"onTransitionCancel"),Gn(Dp,"onTransitionEnd"),qs("onMouseEnter",["mouseout","mouseover"]),qs("onMouseLeave",["mouseout","mouseover"]),qs("onPointerEnter",["pointerout","pointerover"]),qs("onPointerLeave",["pointerout","pointerover"]),fs("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),fs("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),fs("onBeforeInput",["compositionend","keypress","textInput","paste"]),fs("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),fs("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),fs("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Do="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(" "),HS=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Do));function Wg(e,t){t=(t&4)!==0;for(var s=0;s<e.length;s++){var o=e[s],u=o.event;o=o.listeners;e:{var h=void 0;if(t)for(var b=o.length-1;0<=b;b--){var T=o[b],w=T.instance,z=T.currentTarget;if(T=T.listener,w!==h&&u.isPropagationStopped())break e;h=T,u.currentTarget=z;try{h(u)}catch(F){Al(F)}u.currentTarget=null,h=w}else for(b=0;b<o.length;b++){if(T=o[b],w=T.instance,z=T.currentTarget,T=T.listener,w!==h&&u.isPropagationStopped())break e;h=T,u.currentTarget=z;try{h(u)}catch(F){Al(F)}u.currentTarget=null,h=w}}}}function Me(e,t){var s=t[Sc];s===void 0&&(s=t[Sc]=new Set);var o=e+"__bubble";s.has(o)||(Jg(t,e,2,!1),s.add(o))}function ud(e,t,s){var o=0;t&&(o|=4),Jg(s,e,o,t)}var pr="_reactListening"+Math.random().toString(36).slice(2);function dd(e){if(!e[pr]){e[pr]=!0,Yh.forEach(function(s){s!=="selectionchange"&&(HS.has(s)||ud(s,!1,e),ud(s,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[pr]||(t[pr]=!0,ud("selectionchange",!1,t))}}function Jg(e,t,s,o){switch(Av(t)){case 2:var u=m1;break;case 8:u=g1;break;default:u=kd}s=u.bind(null,t,s,e),u=void 0,!Dc||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(u=!0),o?u!==void 0?e.addEventListener(t,s,{capture:!0,passive:u}):e.addEventListener(t,s,!0):u!==void 0?e.addEventListener(t,s,{passive:u}):e.addEventListener(t,s,!1)}function fd(e,t,s,o,u){var h=o;if((t&1)===0&&(t&2)===0&&o!==null)e:for(;;){if(o===null)return;var b=o.tag;if(b===3||b===4){var T=o.stateNode.containerInfo;if(T===u)break;if(b===4)for(b=o.return;b!==null;){var w=b.tag;if((w===3||w===4)&&b.stateNode.containerInfo===u)return;b=b.return}for(;T!==null;){if(b=$s(T),b===null)return;if(w=b.tag,w===5||w===6||w===26||w===27){o=h=b;continue e}T=T.parentNode}}o=o.return}sp(function(){var z=h,F=Nc(s),Q=[];e:{var V=Mp.get(e);if(V!==void 0){var P=El,re=e;switch(e){case"keypress":if(Tl(s)===0)break e;case"keydown":case"keyup":P=B_;break;case"focusin":re="focus",P=Oc;break;case"focusout":re="blur",P=Oc;break;case"beforeblur":case"afterblur":P=Oc;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=lp;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":P=S_;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":P=I_;break;case Ap:case Np:case jp:P=E_;break;case Dp:P=z_;break;case"scroll":case"scrollend":P=x_;break;case"wheel":P=H_;break;case"copy":case"cut":case"paste":P=w_;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":P=cp;break;case"toggle":case"beforetoggle":P=P_}var ge=(t&4)!==0,lt=!ge&&(e==="scroll"||e==="scrollend"),B=ge?V!==null?V+"Capture":null:V;ge=[];for(var M=z,U;M!==null;){var q=M;if(U=q.stateNode,q=q.tag,q!==5&&q!==26&&q!==27||U===null||B===null||(q=Wi(M,B),q!=null&&ge.push(Mo(M,q,U))),lt)break;M=M.return}0<ge.length&&(V=new P(V,re,null,s,F),Q.push({event:V,listeners:ge}))}}if((t&7)===0){e:{if(V=e==="mouseover"||e==="pointerover",P=e==="mouseout"||e==="pointerout",V&&s!==Ac&&(re=s.relatedTarget||s.fromElement)&&($s(re)||re[Ps]))break e;if((P||V)&&(V=F.window===F?F:(V=F.ownerDocument)?V.defaultView||V.parentWindow:window,P?(re=s.relatedTarget||s.toElement,P=z,re=re?$s(re):null,re!==null&&(lt=c(re),ge=re.tag,re!==lt||ge!==5&&ge!==27&&ge!==6)&&(re=null)):(P=null,re=z),P!==re)){if(ge=lp,q="onMouseLeave",B="onMouseEnter",M="mouse",(e==="pointerout"||e==="pointerover")&&(ge=cp,q="onPointerLeave",B="onPointerEnter",M="pointer"),lt=P==null?V:Qi(P),U=re==null?V:Qi(re),V=new ge(q,M+"leave",P,s,F),V.target=lt,V.relatedTarget=U,q=null,$s(F)===z&&(ge=new ge(B,M+"enter",re,s,F),ge.target=U,ge.relatedTarget=lt,q=ge),lt=q,P&&re)t:{for(ge=GS,B=P,M=re,U=0,q=B;q;q=ge(q))U++;q=0;for(var fe=M;fe;fe=ge(fe))q++;for(;0<U-q;)B=ge(B),U--;for(;0<q-U;)M=ge(M),q--;for(;U--;){if(B===M||M!==null&&B===M.alternate){ge=B;break t}B=ge(B),M=ge(M)}ge=null}else ge=null;P!==null&&ev(Q,V,P,ge,!1),re!==null&<!==null&&ev(Q,lt,re,ge,!0)}}e:{if(V=z?Qi(z):window,P=V.nodeName&&V.nodeName.toLowerCase(),P==="select"||P==="input"&&V.type==="file")var Pe=vp;else if(mp(V))if(yp)Pe=J_;else{Pe=Q_;var ue=X_}else P=V.nodeName,!P||P.toLowerCase()!=="input"||V.type!=="checkbox"&&V.type!=="radio"?z&&wc(z.elementType)&&(Pe=vp):Pe=W_;if(Pe&&(Pe=Pe(e,z))){gp(Q,Pe,s,F);break e}ue&&ue(e,V,z),e==="focusout"&&z&&V.type==="number"&&z.memoizedProps.value!=null&&kc(V,"number",V.value)}switch(ue=z?Qi(z):window,e){case"focusin":(mp(ue)||ue.contentEditable==="true")&&(Js=ue,Hc=z,oo=null);break;case"focusout":oo=Hc=Js=null;break;case"mousedown":Gc=!0;break;case"contextmenu":case"mouseup":case"dragend":Gc=!1,kp(Q,s,F);break;case"selectionchange":if(tS)break;case"keydown":case"keyup":kp(Q,s,F)}var Ae;if(Ic)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 Ws?hp(e,s)&&(Oe="onCompositionEnd"):e==="keydown"&&s.keyCode===229&&(Oe="onCompositionStart");Oe&&(up&&s.locale!=="ko"&&(Ws||Oe!=="onCompositionStart"?Oe==="onCompositionEnd"&&Ws&&(Ae=ip()):(Ba=F,Mc="value"in Ba?Ba.value:Ba.textContent,Ws=!0)),ue=mr(z,Oe),0<ue.length&&(Oe=new rp(Oe,e,null,s,F),Q.push({event:Oe,listeners:ue}),Ae?Oe.data=Ae:(Ae=pp(s),Ae!==null&&(Oe.data=Ae)))),(Ae=F_?Y_(e,s):q_(e,s))&&(Oe=mr(z,"onBeforeInput"),0<Oe.length&&(ue=new rp("onBeforeInput","beforeinput",null,s,F),Q.push({event:ue,listeners:Oe}),ue.data=Ae)),US(Q,e,z,s,F)}Wg(Q,t)})}function Mo(e,t,s){return{instance:e,listener:t,currentTarget:s}}function mr(e,t){for(var s=t+"Capture",o=[];e!==null;){var u=e,h=u.stateNode;if(u=u.tag,u!==5&&u!==26&&u!==27||h===null||(u=Wi(e,s),u!=null&&o.unshift(Mo(e,u,h)),u=Wi(e,t),u!=null&&o.push(Mo(e,u,h))),e.tag===3)return o;e=e.return}return[]}function GS(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function ev(e,t,s,o,u){for(var h=t._reactName,b=[];s!==null&&s!==o;){var T=s,w=T.alternate,z=T.stateNode;if(T=T.tag,w!==null&&w===o)break;T!==5&&T!==26&&T!==27||z===null||(w=z,u?(z=Wi(s,h),z!=null&&b.unshift(Mo(s,z,w))):u||(z=Wi(s,h),z!=null&&b.push(Mo(s,z,w)))),s=s.return}b.length!==0&&e.push({event:t,listeners:b})}var PS=/\r\n?/g,$S=/\u0000|\uFFFD/g;function tv(e){return(typeof e=="string"?e:""+e).replace(PS,`
|
|
25
|
-
`).replace($S,"")}function nv(e,t){return t=tv(t),tv(e)===t}function ot(e,t,s,o,u,h){switch(s){case"children":typeof o=="string"?t==="body"||t==="textarea"&&o===""||Zs(e,o):(typeof o=="number"||typeof o=="bigint")&&t!=="body"&&Zs(e,""+o);break;case"className":bl(e,"class",o);break;case"tabIndex":bl(e,"tabindex",o);break;case"dir":case"role":case"viewBox":case"width":case"height":bl(e,s,o);break;case"style":np(e,o,h);break;case"data":if(t!=="object"){bl(e,"data",o);break}case"src":case"href":if(o===""&&(t!=="a"||s!=="href")){e.removeAttribute(s);break}if(o==null||typeof o=="function"||typeof o=="symbol"||typeof o=="boolean"){e.removeAttribute(s);break}o=_l(""+o),e.setAttribute(s,o);break;case"action":case"formAction":if(typeof o=="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 h=="function"&&(s==="formAction"?(t!=="input"&&ot(e,t,"name",u.name,u,null),ot(e,t,"formEncType",u.formEncType,u,null),ot(e,t,"formMethod",u.formMethod,u,null),ot(e,t,"formTarget",u.formTarget,u,null)):(ot(e,t,"encType",u.encType,u,null),ot(e,t,"method",u.method,u,null),ot(e,t,"target",u.target,u,null)));if(o==null||typeof o=="symbol"||typeof o=="boolean"){e.removeAttribute(s);break}o=_l(""+o),e.setAttribute(s,o);break;case"onClick":o!=null&&(e.onclick=la);break;case"onScroll":o!=null&&Me("scroll",e);break;case"onScrollEnd":o!=null&&Me("scrollend",e);break;case"dangerouslySetInnerHTML":if(o!=null){if(typeof o!="object"||!("__html"in o))throw Error(l(61));if(s=o.__html,s!=null){if(u.children!=null)throw Error(l(60));e.innerHTML=s}}break;case"multiple":e.multiple=o&&typeof o!="function"&&typeof o!="symbol";break;case"muted":e.muted=o&&typeof o!="function"&&typeof o!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(o==null||typeof o=="function"||typeof o=="boolean"||typeof o=="symbol"){e.removeAttribute("xlink:href");break}s=_l(""+o),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":o!=null&&typeof o!="function"&&typeof o!="symbol"?e.setAttribute(s,""+o):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":o&&typeof o!="function"&&typeof o!="symbol"?e.setAttribute(s,""):e.removeAttribute(s);break;case"capture":case"download":o===!0?e.setAttribute(s,""):o!==!1&&o!=null&&typeof o!="function"&&typeof o!="symbol"?e.setAttribute(s,o):e.removeAttribute(s);break;case"cols":case"rows":case"size":case"span":o!=null&&typeof o!="function"&&typeof o!="symbol"&&!isNaN(o)&&1<=o?e.setAttribute(s,o):e.removeAttribute(s);break;case"rowSpan":case"start":o==null||typeof o=="function"||typeof o=="symbol"||isNaN(o)?e.removeAttribute(s):e.setAttribute(s,o);break;case"popover":Me("beforetoggle",e),Me("toggle",e),yl(e,"popover",o);break;case"xlinkActuate":oa(e,"http://www.w3.org/1999/xlink","xlink:actuate",o);break;case"xlinkArcrole":oa(e,"http://www.w3.org/1999/xlink","xlink:arcrole",o);break;case"xlinkRole":oa(e,"http://www.w3.org/1999/xlink","xlink:role",o);break;case"xlinkShow":oa(e,"http://www.w3.org/1999/xlink","xlink:show",o);break;case"xlinkTitle":oa(e,"http://www.w3.org/1999/xlink","xlink:title",o);break;case"xlinkType":oa(e,"http://www.w3.org/1999/xlink","xlink:type",o);break;case"xmlBase":oa(e,"http://www.w3.org/XML/1998/namespace","xml:base",o);break;case"xmlLang":oa(e,"http://www.w3.org/XML/1998/namespace","xml:lang",o);break;case"xmlSpace":oa(e,"http://www.w3.org/XML/1998/namespace","xml:space",o);break;case"is":yl(e,"is",o);break;case"innerText":case"textContent":break;default:(!(2<s.length)||s[0]!=="o"&&s[0]!=="O"||s[1]!=="n"&&s[1]!=="N")&&(s=y_.get(s)||s,yl(e,s,o))}}function hd(e,t,s,o,u,h){switch(s){case"style":np(e,o,h);break;case"dangerouslySetInnerHTML":if(o!=null){if(typeof o!="object"||!("__html"in o))throw Error(l(61));if(s=o.__html,s!=null){if(u.children!=null)throw Error(l(60));e.innerHTML=s}}break;case"children":typeof o=="string"?Zs(e,o):(typeof o=="number"||typeof o=="bigint")&&Zs(e,""+o);break;case"onScroll":o!=null&&Me("scroll",e);break;case"onScrollEnd":o!=null&&Me("scrollend",e);break;case"onClick":o!=null&&(e.onclick=la);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!qh.hasOwnProperty(s))e:{if(s[0]==="o"&&s[1]==="n"&&(u=s.endsWith("Capture"),t=s.slice(2,u?s.length-7:void 0),h=e[on]||null,h=h!=null?h[s]:null,typeof h=="function"&&e.removeEventListener(t,h,u),typeof o=="function")){typeof h!="function"&&h!==null&&(s in e?e[s]=null:e.hasAttribute(s)&&e.removeAttribute(s)),e.addEventListener(t,o,u);break e}s in e?e[s]=o:o===!0?e.setAttribute(s,""):yl(e,s,o)}}}function Kt(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 o=!1,u=!1,h;for(h in s)if(s.hasOwnProperty(h)){var b=s[h];if(b!=null)switch(h){case"src":o=!0;break;case"srcSet":u=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(l(137,t));default:ot(e,t,h,b,s,null)}}u&&ot(e,t,"srcSet",s.srcSet,s,null),o&&ot(e,t,"src",s.src,s,null);return;case"input":Me("invalid",e);var T=h=b=u=null,w=null,z=null;for(o in s)if(s.hasOwnProperty(o)){var F=s[o];if(F!=null)switch(o){case"name":u=F;break;case"type":b=F;break;case"checked":w=F;break;case"defaultChecked":z=F;break;case"value":h=F;break;case"defaultValue":T=F;break;case"children":case"dangerouslySetInnerHTML":if(F!=null)throw Error(l(137,t));break;default:ot(e,t,o,F,s,null)}}Wh(e,h,T,w,z,b,u,!1);return;case"select":Me("invalid",e),o=b=h=null;for(u in s)if(s.hasOwnProperty(u)&&(T=s[u],T!=null))switch(u){case"value":h=T;break;case"defaultValue":b=T;break;case"multiple":o=T;default:ot(e,t,u,T,s,null)}t=h,s=b,e.multiple=!!o,t!=null?Ks(e,!!o,t,!1):s!=null&&Ks(e,!!o,s,!0);return;case"textarea":Me("invalid",e),h=u=o=null;for(b in s)if(s.hasOwnProperty(b)&&(T=s[b],T!=null))switch(b){case"value":o=T;break;case"defaultValue":u=T;break;case"children":h=T;break;case"dangerouslySetInnerHTML":if(T!=null)throw Error(l(91));break;default:ot(e,t,b,T,s,null)}ep(e,o,u,h);return;case"option":for(w in s)if(s.hasOwnProperty(w)&&(o=s[w],o!=null))switch(w){case"selected":e.selected=o&&typeof o!="function"&&typeof o!="symbol";break;default:ot(e,t,w,o,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(o=0;o<Do.length;o++)Me(Do[o],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(z in s)if(s.hasOwnProperty(z)&&(o=s[z],o!=null))switch(z){case"children":case"dangerouslySetInnerHTML":throw Error(l(137,t));default:ot(e,t,z,o,s,null)}return;default:if(wc(t)){for(F in s)s.hasOwnProperty(F)&&(o=s[F],o!==void 0&&hd(e,t,F,o,s,void 0));return}}for(T in s)s.hasOwnProperty(T)&&(o=s[T],o!=null&&ot(e,t,T,o,s,null))}function FS(e,t,s,o){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var u=null,h=null,b=null,T=null,w=null,z=null,F=null;for(P in s){var Q=s[P];if(s.hasOwnProperty(P)&&Q!=null)switch(P){case"checked":break;case"value":break;case"defaultValue":w=Q;default:o.hasOwnProperty(P)||ot(e,t,P,null,o,Q)}}for(var V in o){var P=o[V];if(Q=s[V],o.hasOwnProperty(V)&&(P!=null||Q!=null))switch(V){case"type":h=P;break;case"name":u=P;break;case"checked":z=P;break;case"defaultChecked":F=P;break;case"value":b=P;break;case"defaultValue":T=P;break;case"children":case"dangerouslySetInnerHTML":if(P!=null)throw Error(l(137,t));break;default:P!==Q&&ot(e,t,V,P,o,Q)}}Ec(e,b,T,w,z,F,h,u);return;case"select":P=b=T=V=null;for(h in s)if(w=s[h],s.hasOwnProperty(h)&&w!=null)switch(h){case"value":break;case"multiple":P=w;default:o.hasOwnProperty(h)||ot(e,t,h,null,o,w)}for(u in o)if(h=o[u],w=s[u],o.hasOwnProperty(u)&&(h!=null||w!=null))switch(u){case"value":V=h;break;case"defaultValue":T=h;break;case"multiple":b=h;default:h!==w&&ot(e,t,u,h,o,w)}t=T,s=b,o=P,V!=null?Ks(e,!!s,V,!1):!!o!=!!s&&(t!=null?Ks(e,!!s,t,!0):Ks(e,!!s,s?[]:"",!1));return;case"textarea":P=V=null;for(T in s)if(u=s[T],s.hasOwnProperty(T)&&u!=null&&!o.hasOwnProperty(T))switch(T){case"value":break;case"children":break;default:ot(e,t,T,null,o,u)}for(b in o)if(u=o[b],h=s[b],o.hasOwnProperty(b)&&(u!=null||h!=null))switch(b){case"value":V=u;break;case"defaultValue":P=u;break;case"children":break;case"dangerouslySetInnerHTML":if(u!=null)throw Error(l(91));break;default:u!==h&&ot(e,t,b,u,o,h)}Jh(e,V,P);return;case"option":for(var re in s)if(V=s[re],s.hasOwnProperty(re)&&V!=null&&!o.hasOwnProperty(re))switch(re){case"selected":e.selected=!1;break;default:ot(e,t,re,null,o,V)}for(w in o)if(V=o[w],P=s[w],o.hasOwnProperty(w)&&V!==P&&(V!=null||P!=null))switch(w){case"selected":e.selected=V&&typeof V!="function"&&typeof V!="symbol";break;default:ot(e,t,w,V,o,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 ge in s)V=s[ge],s.hasOwnProperty(ge)&&V!=null&&!o.hasOwnProperty(ge)&&ot(e,t,ge,null,o,V);for(z in o)if(V=o[z],P=s[z],o.hasOwnProperty(z)&&V!==P&&(V!=null||P!=null))switch(z){case"children":case"dangerouslySetInnerHTML":if(V!=null)throw Error(l(137,t));break;default:ot(e,t,z,V,o,P)}return;default:if(wc(t)){for(var lt in s)V=s[lt],s.hasOwnProperty(lt)&&V!==void 0&&!o.hasOwnProperty(lt)&&hd(e,t,lt,void 0,o,V);for(F in o)V=o[F],P=s[F],!o.hasOwnProperty(F)||V===P||V===void 0&&P===void 0||hd(e,t,F,V,o,P);return}}for(var B in s)V=s[B],s.hasOwnProperty(B)&&V!=null&&!o.hasOwnProperty(B)&&ot(e,t,B,null,o,V);for(Q in o)V=o[Q],P=s[Q],!o.hasOwnProperty(Q)||V===P||V==null&&P==null||ot(e,t,Q,V,o,P)}function av(e){switch(e){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function YS(){if(typeof performance.getEntriesByType=="function"){for(var e=0,t=0,s=performance.getEntriesByType("resource"),o=0;o<s.length;o++){var u=s[o],h=u.transferSize,b=u.initiatorType,T=u.duration;if(h&&T&&av(b)){for(b=0,T=u.responseEnd,o+=1;o<s.length;o++){var w=s[o],z=w.startTime;if(z>T)break;var F=w.transferSize,Q=w.initiatorType;F&&av(Q)&&(w=w.responseEnd,b+=F*(w<T?1:(T-z)/(w-z)))}if(--o,t+=8*(h+b)/(u.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 pd=null,md=null;function gr(e){return e.nodeType===9?e:e.ownerDocument}function sv(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 iv(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 gd(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 vd=null;function qS(){var e=window.event;return e&&e.type==="popstate"?e===vd?!1:(vd=e,!0):(vd=null,!1)}var ov=typeof setTimeout=="function"?setTimeout:void 0,KS=typeof clearTimeout=="function"?clearTimeout:void 0,lv=typeof Promise=="function"?Promise:void 0,ZS=typeof queueMicrotask=="function"?queueMicrotask:typeof lv<"u"?function(e){return lv.resolve(null).then(e).catch(XS)}:ov;function XS(e){setTimeout(function(){throw e})}function Qa(e){return e==="head"}function rv(e,t){var s=t,o=0;do{var u=s.nextSibling;if(e.removeChild(s),u&&u.nodeType===8)if(s=u.data,s==="/$"||s==="/&"){if(o===0){e.removeChild(u),ki(t);return}o--}else if(s==="$"||s==="$?"||s==="$~"||s==="$!"||s==="&")o++;else if(s==="html")Ro(e.ownerDocument.documentElement);else if(s==="head"){s=e.ownerDocument.head,Ro(s);for(var h=s.firstChild;h;){var b=h.nextSibling,T=h.nodeName;h[Xi]||T==="SCRIPT"||T==="STYLE"||T==="LINK"&&h.rel.toLowerCase()==="stylesheet"||s.removeChild(h),h=b}}else s==="body"&&Ro(e.ownerDocument.body);s=u}while(s);ki(t)}function cv(e,t){var s=e;e=0;do{var o=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||""),o&&o.nodeType===8)if(s=o.data,s==="/$"){if(e===0)break;e--}else s!=="$"&&s!=="$?"&&s!=="$~"&&s!=="$!"||e++;s=o}while(s)}function yd(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":yd(s),Tc(s);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(s.rel.toLowerCase()==="stylesheet")continue}e.removeChild(s)}}function QS(e,t,s,o){for(;e.nodeType===1;){var u=s;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!o&&(e.nodeName!=="INPUT"||e.type!=="hidden"))break}else if(o){if(!e[Xi])switch(t){case"meta":if(!e.hasAttribute("itemprop"))break;return e;case"link":if(h=e.getAttribute("rel"),h==="stylesheet"&&e.hasAttribute("data-precedence"))break;if(h!==u.rel||e.getAttribute("href")!==(u.href==null||u.href===""?null:u.href)||e.getAttribute("crossorigin")!==(u.crossOrigin==null?null:u.crossOrigin)||e.getAttribute("title")!==(u.title==null?null:u.title))break;return e;case"style":if(e.hasAttribute("data-precedence"))break;return e;case"script":if(h=e.getAttribute("src"),(h!==(u.src==null?null:u.src)||e.getAttribute("type")!==(u.type==null?null:u.type)||e.getAttribute("crossorigin")!==(u.crossOrigin==null?null:u.crossOrigin))&&h&&e.hasAttribute("async")&&!e.hasAttribute("itemprop"))break;return e;default:return e}}else if(t==="input"&&e.type==="hidden"){var h=u.name==null?null:""+u.name;if(u.type==="hidden"&&e.getAttribute("name")===h)return e}else return e;if(e=Bn(e.nextSibling),e===null)break}return null}function WS(e,t,s){if(t==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!s||(e=Bn(e.nextSibling),e===null))return null;return e}function uv(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!t||(e=Bn(e.nextSibling),e===null))return null;return e}function bd(e){return e.data==="$?"||e.data==="$~"}function xd(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState!=="loading"}function JS(e,t){var s=e.ownerDocument;if(e.data==="$~")e._reactRetry=t;else if(e.data!=="$?"||s.readyState!=="loading")t();else{var o=function(){t(),s.removeEventListener("DOMContentLoaded",o)};s.addEventListener("DOMContentLoaded",o),e._reactRetry=o}}function Bn(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 _d=null;function dv(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var s=e.data;if(s==="/$"||s==="/&"){if(t===0)return Bn(e.nextSibling);t--}else s!=="$"&&s!=="$!"&&s!=="$?"&&s!=="$~"&&s!=="&"||t++}e=e.nextSibling}return null}function fv(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 hv(e,t,s){switch(t=gr(s),e){case"html":if(e=t.documentElement,!e)throw Error(l(452));return e;case"head":if(e=t.head,!e)throw Error(l(453));return e;case"body":if(e=t.body,!e)throw Error(l(454));return e;default:throw Error(l(451))}}function Ro(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);Tc(e)}var On=new Map,pv=new Set;function vr(e){return typeof e.getRootNode=="function"?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var Ta=Z.d;Z.d={f:e1,r:t1,D:n1,C:a1,L:s1,m:i1,X:l1,S:o1,M:r1};function e1(){var e=Ta.f(),t=rr();return e||t}function t1(e){var t=Fs(e);t!==null&&t.tag===5&&t.type==="form"?Dm(t):Ta.r(e)}var Ti=typeof document>"u"?null:document;function mv(e,t,s){var o=Ti;if(o&&typeof t=="string"&&t){var u=wn(t);u='link[rel="'+e+'"][href="'+u+'"]',typeof s=="string"&&(u+='[crossorigin="'+s+'"]'),pv.has(u)||(pv.add(u),e={rel:e,crossOrigin:s,href:t},o.querySelector(u)===null&&(t=o.createElement("link"),Kt(t,"link",e),Gt(t),o.head.appendChild(t)))}}function n1(e){Ta.D(e),mv("dns-prefetch",e,null)}function a1(e,t){Ta.C(e,t),mv("preconnect",e,t)}function s1(e,t,s){Ta.L(e,t,s);var o=Ti;if(o&&e&&t){var u='link[rel="preload"][as="'+wn(t)+'"]';t==="image"&&s&&s.imageSrcSet?(u+='[imagesrcset="'+wn(s.imageSrcSet)+'"]',typeof s.imageSizes=="string"&&(u+='[imagesizes="'+wn(s.imageSizes)+'"]')):u+='[href="'+wn(e)+'"]';var h=u;switch(t){case"style":h=Ci(e);break;case"script":h=Ei(e)}On.has(h)||(e=v({rel:"preload",href:t==="image"&&s&&s.imageSrcSet?void 0:e,as:t},s),On.set(h,e),o.querySelector(u)!==null||t==="style"&&o.querySelector(Bo(h))||t==="script"&&o.querySelector(Oo(h))||(t=o.createElement("link"),Kt(t,"link",e),Gt(t),o.head.appendChild(t)))}}function i1(e,t){Ta.m(e,t);var s=Ti;if(s&&e){var o=t&&typeof t.as=="string"?t.as:"script",u='link[rel="modulepreload"][as="'+wn(o)+'"][href="'+wn(e)+'"]',h=u;switch(o){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":h=Ei(e)}if(!On.has(h)&&(e=v({rel:"modulepreload",href:e},t),On.set(h,e),s.querySelector(u)===null)){switch(o){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(s.querySelector(Oo(h)))return}o=s.createElement("link"),Kt(o,"link",e),Gt(o),s.head.appendChild(o)}}}function o1(e,t,s){Ta.S(e,t,s);var o=Ti;if(o&&e){var u=Ys(o).hoistableStyles,h=Ci(e);t=t||"default";var b=u.get(h);if(!b){var T={loading:0,preload:null};if(b=o.querySelector(Bo(h)))T.loading=5;else{e=v({rel:"stylesheet",href:e,"data-precedence":t},s),(s=On.get(h))&&Sd(e,s);var w=b=o.createElement("link");Gt(w),Kt(w,"link",e),w._p=new Promise(function(z,F){w.onload=z,w.onerror=F}),w.addEventListener("load",function(){T.loading|=1}),w.addEventListener("error",function(){T.loading|=2}),T.loading|=4,yr(b,t,o)}b={type:"stylesheet",instance:b,count:1,state:T},u.set(h,b)}}}function l1(e,t){Ta.X(e,t);var s=Ti;if(s&&e){var o=Ys(s).hoistableScripts,u=Ei(e),h=o.get(u);h||(h=s.querySelector(Oo(u)),h||(e=v({src:e,async:!0},t),(t=On.get(u))&&Td(e,t),h=s.createElement("script"),Gt(h),Kt(h,"link",e),s.head.appendChild(h)),h={type:"script",instance:h,count:1,state:null},o.set(u,h))}}function r1(e,t){Ta.M(e,t);var s=Ti;if(s&&e){var o=Ys(s).hoistableScripts,u=Ei(e),h=o.get(u);h||(h=s.querySelector(Oo(u)),h||(e=v({src:e,async:!0,type:"module"},t),(t=On.get(u))&&Td(e,t),h=s.createElement("script"),Gt(h),Kt(h,"link",e),s.head.appendChild(h)),h={type:"script",instance:h,count:1,state:null},o.set(u,h))}}function gv(e,t,s,o){var u=(u=wt.current)?vr(u):null;if(!u)throw Error(l(446));switch(e){case"meta":case"title":return null;case"style":return typeof s.precedence=="string"&&typeof s.href=="string"?(t=Ci(s.href),s=Ys(u).hoistableStyles,o=s.get(t),o||(o={type:"style",instance:null,count:0,state:null},s.set(t,o)),o):{type:"void",instance:null,count:0,state:null};case"link":if(s.rel==="stylesheet"&&typeof s.href=="string"&&typeof s.precedence=="string"){e=Ci(s.href);var h=Ys(u).hoistableStyles,b=h.get(e);if(b||(u=u.ownerDocument||u,b={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},h.set(e,b),(h=u.querySelector(Bo(e)))&&!h._p&&(b.instance=h,b.state.loading=5),On.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},On.set(e,s),h||c1(u,e,s,b.state))),t&&o===null)throw Error(l(528,""));return b}if(t&&o!==null)throw Error(l(529,""));return null;case"script":return t=s.async,s=s.src,typeof s=="string"&&t&&typeof t!="function"&&typeof t!="symbol"?(t=Ei(s),s=Ys(u).hoistableScripts,o=s.get(t),o||(o={type:"script",instance:null,count:0,state:null},s.set(t,o)),o):{type:"void",instance:null,count:0,state:null};default:throw Error(l(444,e))}}function Ci(e){return'href="'+wn(e)+'"'}function Bo(e){return'link[rel="stylesheet"]['+e+"]"}function vv(e){return v({},e,{"data-precedence":e.precedence,precedence:null})}function c1(e,t,s,o){e.querySelector('link[rel="preload"][as="style"]['+t+"]")?o.loading=1:(t=e.createElement("link"),o.preload=t,t.addEventListener("load",function(){return o.loading|=1}),t.addEventListener("error",function(){return o.loading|=2}),Kt(t,"link",s),Gt(t),e.head.appendChild(t))}function Ei(e){return'[src="'+wn(e)+'"]'}function Oo(e){return"script[async]"+e}function yv(e,t,s){if(t.count++,t.instance===null)switch(t.type){case"style":var o=e.querySelector('style[data-href~="'+wn(s.href)+'"]');if(o)return t.instance=o,Gt(o),o;var u=v({},s,{"data-href":s.href,"data-precedence":s.precedence,href:null,precedence:null});return o=(e.ownerDocument||e).createElement("style"),Gt(o),Kt(o,"style",u),yr(o,s.precedence,e),t.instance=o;case"stylesheet":u=Ci(s.href);var h=e.querySelector(Bo(u));if(h)return t.state.loading|=4,t.instance=h,Gt(h),h;o=vv(s),(u=On.get(u))&&Sd(o,u),h=(e.ownerDocument||e).createElement("link"),Gt(h);var b=h;return b._p=new Promise(function(T,w){b.onload=T,b.onerror=w}),Kt(h,"link",o),t.state.loading|=4,yr(h,s.precedence,e),t.instance=h;case"script":return h=Ei(s.src),(u=e.querySelector(Oo(h)))?(t.instance=u,Gt(u),u):(o=s,(u=On.get(h))&&(o=v({},s),Td(o,u)),e=e.ownerDocument||e,u=e.createElement("script"),Gt(u),Kt(u,"link",o),e.head.appendChild(u),t.instance=u);case"void":return null;default:throw Error(l(443,t.type))}else t.type==="stylesheet"&&(t.state.loading&4)===0&&(o=t.instance,t.state.loading|=4,yr(o,s.precedence,e));return t.instance}function yr(e,t,s){for(var o=s.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),u=o.length?o[o.length-1]:null,h=u,b=0;b<o.length;b++){var T=o[b];if(T.dataset.precedence===t)h=T;else if(h!==u)break}h?h.parentNode.insertBefore(e,h.nextSibling):(t=s.nodeType===9?s.head:s,t.insertBefore(e,t.firstChild))}function Sd(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.title==null&&(e.title=t.title)}function Td(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.integrity==null&&(e.integrity=t.integrity)}var br=null;function bv(e,t,s){if(br===null){var o=new Map,u=br=new Map;u.set(s,o)}else u=br,o=u.get(s),o||(o=new Map,u.set(s,o));if(o.has(e))return o;for(o.set(e,null),s=s.getElementsByTagName(e),u=0;u<s.length;u++){var h=s[u];if(!(h[Xi]||h[$t]||e==="link"&&h.getAttribute("rel")==="stylesheet")&&h.namespaceURI!=="http://www.w3.org/2000/svg"){var b=h.getAttribute(t)||"";b=e+b;var T=o.get(b);T?T.push(h):o.set(b,[h])}}return o}function xv(e,t,s){e=e.ownerDocument||e,e.head.insertBefore(s,t==="title"?e.querySelector("head > title"):null)}function u1(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 _v(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function d1(e,t,s,o){if(s.type==="stylesheet"&&(typeof o.media!="string"||matchMedia(o.media).matches!==!1)&&(s.state.loading&4)===0){if(s.instance===null){var u=Ci(o.href),h=t.querySelector(Bo(u));if(h){t=h._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(e.count++,e=xr.bind(e),t.then(e,e)),s.state.loading|=4,s.instance=h,Gt(h);return}h=t.ownerDocument||t,o=vv(o),(u=On.get(u))&&Sd(o,u),h=h.createElement("link"),Gt(h);var b=h;b._p=new Promise(function(T,w){b.onload=T,b.onerror=w}),Kt(h,"link",o),s.instance=h}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(s,t),(t=s.state.preload)&&(s.state.loading&3)===0&&(e.count++,s=xr.bind(e),t.addEventListener("load",s),t.addEventListener("error",s))}}var Cd=0;function f1(e,t){return e.stylesheets&&e.count===0&&Sr(e,e.stylesheets),0<e.count||0<e.imgCount?function(s){var o=setTimeout(function(){if(e.stylesheets&&Sr(e,e.stylesheets),e.unsuspend){var h=e.unsuspend;e.unsuspend=null,h()}},6e4+t);0<e.imgBytes&&Cd===0&&(Cd=62500*YS());var u=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&Sr(e,e.stylesheets),e.unsuspend)){var h=e.unsuspend;e.unsuspend=null,h()}},(e.imgBytes>Cd?50:800)+t);return e.unsuspend=s,function(){e.unsuspend=null,clearTimeout(o),clearTimeout(u)}}:null}function xr(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Sr(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var _r=null;function Sr(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,_r=new Map,t.forEach(h1,e),_r=null,xr.call(e))}function h1(e,t){if(!(t.state.loading&4)){var s=_r.get(e);if(s)var o=s.get(null);else{s=new Map,_r.set(e,s);for(var u=e.querySelectorAll("link[data-precedence],style[data-precedence]"),h=0;h<u.length;h++){var b=u[h];(b.nodeName==="LINK"||b.getAttribute("media")!=="not all")&&(s.set(b.dataset.precedence,b),o=b)}o&&s.set(null,o)}u=t.instance,b=u.getAttribute("data-precedence"),h=s.get(b)||o,h===o&&s.set(null,u),s.set(b,u),this.count++,o=xr.bind(this),u.addEventListener("load",o),u.addEventListener("error",o),h?h.parentNode.insertBefore(u,h.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(u,e.firstChild)),t.state.loading|=4}}var Lo={$$typeof:D,Provider:null,Consumer:null,_currentValue:K,_currentValue2:K,_threadCount:0};function p1(e,t,s,o,u,h,b,T,w){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=bc(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=bc(0),this.hiddenUpdates=bc(null),this.identifierPrefix=o,this.onUncaughtError=u,this.onCaughtError=h,this.onRecoverableError=b,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=w,this.incompleteTransitions=new Map}function Sv(e,t,s,o,u,h,b,T,w,z,F,Q){return e=new p1(e,t,s,b,w,z,F,Q,T),t=1,h===!0&&(t|=24),h=mn(3,null,null,t),e.current=h,h.stateNode=e,t=au(),t.refCount++,e.pooledCache=t,t.refCount++,h.memoizedState={element:o,isDehydrated:s,cache:t},lu(h),e}function Tv(e){return e?(e=ni,e):ni}function Cv(e,t,s,o,u,h){u=Tv(u),o.context===null?o.context=u:o.pendingContext=u,o=Va(t),o.payload={element:s},h=h===void 0?null:h,h!==null&&(o.callback=h),s=Ha(e,o,t),s!==null&&(fn(s,e,t),po(s,e,t))}function Ev(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var s=e.retryLane;e.retryLane=s!==0&&s<t?s:t}}function Ed(e,t){Ev(e,t),(e=e.alternate)&&Ev(e,t)}function kv(e){if(e.tag===13||e.tag===31){var t=gs(e,67108864);t!==null&&fn(t,e,67108864),Ed(e,67108864)}}function wv(e){if(e.tag===13||e.tag===31){var t=xn();t=xc(t);var s=gs(e,t);s!==null&&fn(s,e,t),Ed(e,t)}}var Tr=!0;function m1(e,t,s,o){var u=j.T;j.T=null;var h=Z.p;try{Z.p=2,kd(e,t,s,o)}finally{Z.p=h,j.T=u}}function g1(e,t,s,o){var u=j.T;j.T=null;var h=Z.p;try{Z.p=8,kd(e,t,s,o)}finally{Z.p=h,j.T=u}}function kd(e,t,s,o){if(Tr){var u=wd(o);if(u===null)fd(e,t,o,Cr,s),Nv(e,o);else if(y1(u,e,t,s,o))o.stopPropagation();else if(Nv(e,o),t&4&&-1<v1.indexOf(e)){for(;u!==null;){var h=Fs(u);if(h!==null)switch(h.tag){case 3:if(h=h.stateNode,h.current.memoizedState.isDehydrated){var b=se(h.pendingLanes);if(b!==0){var T=h;for(T.pendingLanes|=2,T.entangledLanes|=2;b;){var w=1<<31-Ee(b);T.entanglements[1]|=w,b&=~w}Xn(h),(qe&6)===0&&(or=W()+500,jo(0))}}break;case 31:case 13:T=gs(h,2),T!==null&&fn(T,h,2),rr(),Ed(h,2)}if(h=wd(o),h===null&&fd(e,t,o,Cr,s),h===u)break;u=h}u!==null&&o.stopPropagation()}else fd(e,t,o,null,s)}}function wd(e){return e=Nc(e),Ad(e)}var Cr=null;function Ad(e){if(Cr=null,e=$s(e),e!==null){var t=c(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 Cr=e,null}function Av(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(le()){case ye:return 2;case me:return 8;case He:case Ce:return 32;case yt:return 268435456;default:return 32}default:return 32}}var Nd=!1,Wa=null,Ja=null,es=null,Io=new Map,Uo=new Map,ts=[],v1="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 Nv(e,t){switch(e){case"focusin":case"focusout":Wa=null;break;case"dragenter":case"dragleave":Ja=null;break;case"mouseover":case"mouseout":es=null;break;case"pointerover":case"pointerout":Io.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":Uo.delete(t.pointerId)}}function zo(e,t,s,o,u,h){return e===null||e.nativeEvent!==h?(e={blockedOn:t,domEventName:s,eventSystemFlags:o,nativeEvent:h,targetContainers:[u]},t!==null&&(t=Fs(t),t!==null&&kv(t)),e):(e.eventSystemFlags|=o,t=e.targetContainers,u!==null&&t.indexOf(u)===-1&&t.push(u),e)}function y1(e,t,s,o,u){switch(t){case"focusin":return Wa=zo(Wa,e,t,s,o,u),!0;case"dragenter":return Ja=zo(Ja,e,t,s,o,u),!0;case"mouseover":return es=zo(es,e,t,s,o,u),!0;case"pointerover":var h=u.pointerId;return Io.set(h,zo(Io.get(h)||null,e,t,s,o,u)),!0;case"gotpointercapture":return h=u.pointerId,Uo.set(h,zo(Uo.get(h)||null,e,t,s,o,u)),!0}return!1}function jv(e){var t=$s(e.target);if(t!==null){var s=c(t);if(s!==null){if(t=s.tag,t===13){if(t=d(s),t!==null){e.blockedOn=t,$h(e.priority,function(){wv(s)});return}}else if(t===31){if(t=p(s),t!==null){e.blockedOn=t,$h(e.priority,function(){wv(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 Er(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var s=wd(e.nativeEvent);if(s===null){s=e.nativeEvent;var o=new s.constructor(s.type,s);Ac=o,s.target.dispatchEvent(o),Ac=null}else return t=Fs(s),t!==null&&kv(t),e.blockedOn=s,!1;t.shift()}return!0}function Dv(e,t,s){Er(e)&&s.delete(t)}function b1(){Nd=!1,Wa!==null&&Er(Wa)&&(Wa=null),Ja!==null&&Er(Ja)&&(Ja=null),es!==null&&Er(es)&&(es=null),Io.forEach(Dv),Uo.forEach(Dv)}function kr(e,t){e.blockedOn===t&&(e.blockedOn=null,Nd||(Nd=!0,n.unstable_scheduleCallback(n.unstable_NormalPriority,b1)))}var wr=null;function Mv(e){wr!==e&&(wr=e,n.unstable_scheduleCallback(n.unstable_NormalPriority,function(){wr===e&&(wr=null);for(var t=0;t<e.length;t+=3){var s=e[t],o=e[t+1],u=e[t+2];if(typeof o!="function"){if(Ad(o||s)===null)continue;break}var h=Fs(s);h!==null&&(e.splice(t,3),t-=3,wu(h,{pending:!0,data:u,method:s.method,action:o},o,u))}}))}function ki(e){function t(w){return kr(w,e)}Wa!==null&&kr(Wa,e),Ja!==null&&kr(Ja,e),es!==null&&kr(es,e),Io.forEach(t),Uo.forEach(t);for(var s=0;s<ts.length;s++){var o=ts[s];o.blockedOn===e&&(o.blockedOn=null)}for(;0<ts.length&&(s=ts[0],s.blockedOn===null);)jv(s),s.blockedOn===null&&ts.shift();if(s=(e.ownerDocument||e).$$reactFormReplay,s!=null)for(o=0;o<s.length;o+=3){var u=s[o],h=s[o+1],b=u[on]||null;if(typeof h=="function")b||Mv(s);else if(b){var T=null;if(h&&h.hasAttribute("formAction")){if(u=h,b=h[on]||null)T=b.formAction;else if(Ad(u)!==null)continue}else T=b.action;typeof T=="function"?s[o+1]=T:(s.splice(o,3),o-=3),Mv(s)}}}function Rv(){function e(h){h.canIntercept&&h.info==="react-transition"&&h.intercept({handler:function(){return new Promise(function(b){return u=b})},focusReset:"manual",scroll:"manual"})}function t(){u!==null&&(u(),u=null),o||setTimeout(s,20)}function s(){if(!o&&!navigation.transition){var h=navigation.currentEntry;h&&h.url!=null&&navigation.navigate(h.url,{state:h.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var o=!1,u=null;return navigation.addEventListener("navigate",e),navigation.addEventListener("navigatesuccess",t),navigation.addEventListener("navigateerror",t),setTimeout(s,100),function(){o=!0,navigation.removeEventListener("navigate",e),navigation.removeEventListener("navigatesuccess",t),navigation.removeEventListener("navigateerror",t),u!==null&&(u(),u=null)}}}function jd(e){this._internalRoot=e}Ar.prototype.render=jd.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(l(409));var s=t.current,o=xn();Cv(s,o,e,t,null,null)},Ar.prototype.unmount=jd.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;Cv(e.current,2,null,e,null,null),rr(),t[Ps]=null}};function Ar(e){this._internalRoot=e}Ar.prototype.unstable_scheduleHydration=function(e){if(e){var t=Ph();e={blockedOn:null,target:e,priority:t};for(var s=0;s<ts.length&&t!==0&&t<ts[s].priority;s++);ts.splice(s,0,e),s===0&&jv(e)}};var Bv=a.version;if(Bv!=="19.2.4")throw Error(l(527,Bv,"19.2.4"));Z.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(l(188)):(e=Object.keys(e).join(","),Error(l(268,e)));return e=g(t),e=e!==null?y(e):null,e=e===null?null:e.stateNode,e};var x1={bundleType:0,version:"19.2.4",rendererPackageName:"react-dom",currentDispatcherRef:j,reconcilerVersion:"19.2.4"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Nr=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Nr.isDisabled&&Nr.supportsFiber)try{bt=Nr.inject(x1),Ge=Nr}catch{}}return Vo.createRoot=function(e,t){if(!r(e))throw Error(l(299));var s=!1,o="",u=Hm,h=Gm,b=Pm;return t!=null&&(t.unstable_strictMode===!0&&(s=!0),t.identifierPrefix!==void 0&&(o=t.identifierPrefix),t.onUncaughtError!==void 0&&(u=t.onUncaughtError),t.onCaughtError!==void 0&&(h=t.onCaughtError),t.onRecoverableError!==void 0&&(b=t.onRecoverableError)),t=Sv(e,1,!1,null,null,s,o,null,u,h,b,Rv),e[Ps]=t.current,dd(e),new jd(t)},Vo.hydrateRoot=function(e,t,s){if(!r(e))throw Error(l(299));var o=!1,u="",h=Hm,b=Gm,T=Pm,w=null;return s!=null&&(s.unstable_strictMode===!0&&(o=!0),s.identifierPrefix!==void 0&&(u=s.identifierPrefix),s.onUncaughtError!==void 0&&(h=s.onUncaughtError),s.onCaughtError!==void 0&&(b=s.onCaughtError),s.onRecoverableError!==void 0&&(T=s.onRecoverableError),s.formState!==void 0&&(w=s.formState)),t=Sv(e,1,!0,t,s??null,o,u,w,h,b,T,Rv),t.context=Tv(null),s=t.current,o=xn(),o=xc(o),u=Va(o),u.callback=null,Ha(s,u,o),s=o,t.current.lanes=s,Zi(t,s),Xn(t),e[Ps]=t.current,dd(e),new Ar(t)},Vo.version="19.2.4",Vo}var Hv;function L1(){if(Hv)return Dd.exports;Hv=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(),Dd.exports=O1(),Dd.exports}var I1=L1();/**
|
|
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 Gv="popstate";function Pv(n){return typeof n=="object"&&n!=null&&"pathname"in n&&"search"in n&&"hash"in n&&"state"in n&&"key"in n}function U1(n={}){function a(l,r){var g;let c=(g=r.state)==null?void 0:g.masked,{pathname:d,search:p,hash:m}=c||l.location;return cf("",{pathname:d,search:p,hash:m},r.state&&r.state.usr||null,r.state&&r.state.key||"default",c?{pathname:l.location.pathname,search:l.location.search,hash:l.location.hash}:void 0)}function i(l,r){return typeof r=="string"?r:nl(r)}return V1(a,i,null,n)}function ht(n,a){if(n===!1||n===null||typeof n>"u")throw new Error(a)}function Un(n,a){if(!n){typeof console<"u"&&console.warn(a);try{throw new Error(a)}catch{}}}function z1(){return Math.random().toString(36).substring(2,10)}function $v(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 cf(n,a,i=null,l,r){return{pathname:typeof n=="string"?n:n.pathname,search:"",hash:"",...typeof a=="string"?Gi(a):a,state:i,key:a&&a.key||l||z1(),unstable_mask:r}}function nl({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 Gi(n){let a={};if(n){let i=n.indexOf("#");i>=0&&(a.hash=n.substring(i),n=n.substring(0,i));let l=n.indexOf("?");l>=0&&(a.search=n.substring(l),n=n.substring(0,l)),n&&(a.pathname=n)}return a}function V1(n,a,i,l={}){let{window:r=document.defaultView,v5Compat:c=!1}=l,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 A=y(),S=A==null?null:A-g;g=A,m&&m({action:p,location:k.location,delta:S})}function _(A,S){p="PUSH";let N=Pv(A)?A:cf(k.location,A,S);g=y()+1;let D=$v(N,g),H=k.createHref(N.unstable_mask||N);try{d.pushState(D,"",H)}catch(O){if(O instanceof DOMException&&O.name==="DataCloneError")throw O;r.location.assign(H)}c&&m&&m({action:p,location:k.location,delta:1})}function C(A,S){p="REPLACE";let N=Pv(A)?A:cf(k.location,A,S);g=y();let D=$v(N,g),H=k.createHref(N.unstable_mask||N);d.replaceState(D,"",H),c&&m&&m({action:p,location:k.location,delta:0})}function E(A){return H1(A)}let k={get action(){return p},get location(){return n(r,d)},listen(A){if(m)throw new Error("A history only accepts one active listener");return r.addEventListener(Gv,v),m=A,()=>{r.removeEventListener(Gv,v),m=null}},createHref(A){return a(r,A)},createURL:E,encodeLocation(A){let S=E(A);return{pathname:S.pathname,search:S.search,hash:S.hash}},push:_,replace:C,go(A){return d.go(A)}};return k}function H1(n,a=!1){let i="http://localhost";typeof window<"u"&&(i=window.location.origin!=="null"?window.location.origin:window.location.href),ht(i,"No window.location.(origin|href) available to create URL");let l=typeof n=="string"?n:nl(n);return l=l.replace(/ $/,"%20"),!a&&l.startsWith("//")&&(l=i+l),new URL(l,i)}function H0(n,a,i="/"){return G1(n,a,i,!1)}function G1(n,a,i,l){let r=typeof a=="string"?Gi(a):a,c=Aa(r.pathname||"/",i);if(c==null)return null;let d=G0(n);P1(d);let p=null;for(let m=0;p==null&&m<d.length;++m){let g=$0(c);p=W1(d[m],g,l)}return p}function G0(n,a=[],i=[],l="",r=!1){let c=(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(l)&&m)return;ht(y.relativePath.startsWith(l),`Absolute route path "${y.relativePath}" nested under path "${l}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),y.relativePath=y.relativePath.slice(l.length)}let v=ea([l,y.relativePath]),_=i.concat(y);d.children&&d.children.length>0&&(ht(d.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${v}".`),G0(d.children,a,_,v,m)),!(d.path==null&&!d.index)&&a.push({path:v,score:X1(v,d.index),routesMeta:_})};return n.forEach((d,p)=>{var m;if(d.path===""||!((m=d.path)!=null&&m.includes("?")))c(d,p);else for(let g of P0(d.path))c(d,p,!0,g)}),a}function P0(n){let a=n.split("/");if(a.length===0)return[];let[i,...l]=a,r=i.endsWith("?"),c=i.replace(/\?$/,"");if(l.length===0)return r?[c,""]:[c];let d=P0(l.join("/")),p=[];return p.push(...d.map(m=>m===""?c:[c,m].join("/"))),r&&p.push(...d),p.map(m=>n.startsWith("/")&&m===""?"/":m)}function P1(n){n.sort((a,i)=>a.score!==i.score?i.score-a.score:Q1(a.routesMeta.map(l=>l.childrenIndex),i.routesMeta.map(l=>l.childrenIndex)))}var $1=/^:[\w-]+$/,F1=3,Y1=2,q1=1,K1=10,Z1=-2,Fv=n=>n==="*";function X1(n,a){let i=n.split("/"),l=i.length;return i.some(Fv)&&(l+=Z1),a&&(l+=Y1),i.filter(r=>!Fv(r)).reduce((r,c)=>r+($1.test(c)?F1:c===""?q1:K1),l)}function Q1(n,a){return n.length===a.length&&n.slice(0,-1).every((l,r)=>l===a[r])?n[n.length-1]-a[a.length-1]:0}function W1(n,a,i=!1){let{routesMeta:l}=n,r={},c="/",d=[];for(let p=0;p<l.length;++p){let m=l[p],g=p===l.length-1,y=c==="/"?a:a.slice(c.length)||"/",v=al({path:m.relativePath,caseSensitive:m.caseSensitive,end:g},y),_=m.route;if(!v&&g&&i&&!l[l.length-1].route.index&&(v=al({path:m.relativePath,caseSensitive:m.caseSensitive,end:!1},y)),!v)return null;Object.assign(r,v.params),d.push({params:r,pathname:ea([c,v.pathname]),pathnameBase:aT(ea([c,v.pathnameBase])),route:_}),v.pathnameBase!=="/"&&(c=ea([c,v.pathnameBase]))}return d}function al(n,a){typeof n=="string"&&(n={path:n,caseSensitive:!1,end:!0});let[i,l]=J1(n.path,n.caseSensitive,n.end),r=a.match(i);if(!r)return null;let c=r[0],d=c.replace(/(.)\/+$/,"$1"),p=r.slice(1);return{params:l.reduce((g,{paramName:y,isOptional:v},_)=>{if(y==="*"){let E=p[_]||"";d=c.slice(0,c.length-E.length).replace(/(.)\/+$/,"$1")}const C=p[_];return v&&!C?g[y]=void 0:g[y]=(C||"").replace(/%2F/g,"/"),g},{}),pathname:c,pathnameBase:d,pattern:n}}function J1(n,a=!1,i=!0){Un(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 l=[],r="^"+n.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(d,p,m,g,y)=>{if(l.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("*")?(l.push({paramName:"*"}),r+=n==="*"||n==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):i?r+="\\/*$":n!==""&&n!=="/"&&(r+="(?:(?=\\/|$))"),[new RegExp(r,a?void 0:"i"),l]}function $0(n){try{return n.split("/").map(a=>decodeURIComponent(a).replace(/\//g,"%2F")).join("/")}catch(a){return Un(!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,l=n.charAt(i);return l&&l!=="/"?null:n.slice(i)||"/"}var eT=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i;function tT(n,a="/"){let{pathname:i,search:l="",hash:r=""}=typeof n=="string"?Gi(n):n,c;return i?(i=i.replace(/\/\/+/g,"/"),i.startsWith("/")?c=Yv(i.substring(1),"/"):c=Yv(i,a)):c=a,{pathname:c,search:sT(l),hash:iT(r)}}function Yv(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 Bd(n,a,i,l){return`Cannot include a '${n}' character in a manually specified \`to.${a}\` field [${JSON.stringify(l)}]. 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 nT(n){return n.filter((a,i)=>i===0||a.route.path&&a.route.path.length>0)}function Gf(n){let a=nT(n);return a.map((i,l)=>l===a.length-1?i.pathname:i.pathnameBase)}function oc(n,a,i,l=!1){let r;typeof n=="string"?r=Gi(n):(r={...n},ht(!r.pathname||!r.pathname.includes("?"),Bd("?","pathname","search",r)),ht(!r.pathname||!r.pathname.includes("#"),Bd("#","pathname","hash",r)),ht(!r.search||!r.search.includes("#"),Bd("#","search","hash",r)));let c=n===""||r.pathname==="",d=c?"/":r.pathname,p;if(d==null)p=i;else{let v=a.length-1;if(!l&&d.startsWith("..")){let _=d.split("/");for(;_[0]==="..";)_.shift(),v-=1;r.pathname=_.join("/")}p=v>=0?a[v]:"/"}let m=tT(r,p),g=d&&d!=="/"&&d.endsWith("/"),y=(c||d===".")&&i.endsWith("/");return!m.pathname.endsWith("/")&&(g||y)&&(m.pathname+="/"),m}var ea=n=>n.join("/").replace(/\/\/+/g,"/"),aT=n=>n.replace(/\/+$/,"").replace(/^\/*/,"/"),sT=n=>!n||n==="?"?"":n.startsWith("?")?n:"?"+n,iT=n=>!n||n==="#"?"":n.startsWith("#")?n:"#"+n,oT=class{constructor(n,a,i,l=!1){this.status=n,this.statusText=a||"",this.internal=l,i instanceof Error?(this.data=i.toString(),this.error=i):this.data=i}};function lT(n){return n!=null&&typeof n.status=="number"&&typeof n.statusText=="string"&&typeof n.internal=="boolean"&&"data"in n}function rT(n){return n.map(a=>a.route.path).filter(Boolean).join("/").replace(/\/\/*/g,"/")||"/"}var F0=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function Y0(n,a){let i=n;if(typeof i!="string"||!eT.test(i))return{absoluteURL:void 0,isExternal:!1,to:i};let l=i,r=!1;if(F0)try{let c=new URL(window.location.href),d=i.startsWith("//")?new URL(c.protocol+i):new URL(i),p=Aa(d.pathname,a);d.origin===c.origin&&p!=null?i=p+d.search+d.hash:r=!0}catch{Un(!1,`<Link to="${i}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:l,isExternal:r,to:i}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");var q0=["POST","PUT","PATCH","DELETE"];new Set(q0);var cT=["GET",...q0];new Set(cT);var Pi=x.createContext(null);Pi.displayName="DataRouter";var lc=x.createContext(null);lc.displayName="DataRouterState";var uT=x.createContext(!1),K0=x.createContext({isTransitioning:!1});K0.displayName="ViewTransition";var dT=x.createContext(new Map);dT.displayName="Fetchers";var fT=x.createContext(null);fT.displayName="Await";var Cn=x.createContext(null);Cn.displayName="Navigation";var dl=x.createContext(null);dl.displayName="Location";var Hn=x.createContext({outlet:null,matches:[],isDataRoute:!1});Hn.displayName="Route";var Pf=x.createContext(null);Pf.displayName="RouteError";var Z0="REACT_ROUTER_ERROR",hT="REDIRECT",pT="ROUTE_ERROR_RESPONSE";function mT(n){if(n.startsWith(`${Z0}:${hT}:{`))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 gT(n){if(n.startsWith(`${Z0}:${pT}:{`))try{let a=JSON.parse(n.slice(40));if(typeof a=="object"&&a&&typeof a.status=="number"&&typeof a.statusText=="string")return new oT(a.status,a.statusText,a.data)}catch{}}function vT(n,{relative:a}={}){ht(Vs(),"useHref() may be used only in the context of a <Router> component.");let{basename:i,navigator:l}=x.useContext(Cn),{hash:r,pathname:c,search:d}=fl(n,{relative:a}),p=c;return i!=="/"&&(p=c==="/"?i:ea([i,c])),l.createHref({pathname:p,search:d,hash:r})}function Vs(){return x.useContext(dl)!=null}function en(){return ht(Vs(),"useLocation() may be used only in the context of a <Router> component."),x.useContext(dl).location}function Zt(n){ht(Vs(),"useMatch() may be used only in the context of a <Router> component.");let{pathname:a}=en();return x.useMemo(()=>al(n,$0(a)),[a,n])}var X0="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function Q0(n){x.useContext(Cn).static||x.useLayoutEffect(n)}function rc(){let{isDataRoute:n}=x.useContext(Hn);return n?MT():yT()}function yT(){ht(Vs(),"useNavigate() may be used only in the context of a <Router> component.");let n=x.useContext(Pi),{basename:a,navigator:i}=x.useContext(Cn),{matches:l}=x.useContext(Hn),{pathname:r}=en(),c=JSON.stringify(Gf(l)),d=x.useRef(!1);return Q0(()=>{d.current=!0}),x.useCallback((m,g={})=>{if(Un(d.current,X0),!d.current)return;if(typeof m=="number"){i.go(m);return}let y=oc(m,JSON.parse(c),r,g.relative==="path");n==null&&a!=="/"&&(y.pathname=y.pathname==="/"?a:ea([a,y.pathname])),(g.replace?i.replace:i.push)(y,g.state,g)},[a,i,c,r,n])}var bT=x.createContext(null);function xT(n){let a=x.useContext(Hn).outlet;return x.useMemo(()=>a&&x.createElement(bT.Provider,{value:n},a),[a,n])}function cc(){let{matches:n}=x.useContext(Hn),a=n[n.length-1];return a?a.params:{}}function fl(n,{relative:a}={}){let{matches:i}=x.useContext(Hn),{pathname:l}=en(),r=JSON.stringify(Gf(i));return x.useMemo(()=>oc(n,JSON.parse(r),l,a==="path"),[n,r,l,a])}function _T(n,a){return W0(n,a)}function W0(n,a,i){var A;ht(Vs(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:l}=x.useContext(Cn),{matches:r}=x.useContext(Hn),c=r[r.length-1],d=c?c.params:{},p=c?c.pathname:"/",m=c?c.pathnameBase:"/",g=c&&c.route;{let S=g&&g.path||"";eb(p,!g||S.endsWith("*")||S.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${p}" (under <Route path="${S}">) 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="${S}"> to <Route path="${S==="/"?"*":`${S}/*`}">.`)}let y=en(),v;if(a){let S=typeof a=="string"?Gi(a):a;ht(m==="/"||((A=S.pathname)==null?void 0:A.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 "${S.pathname}" was given in the \`location\` prop.`),v=S}else v=y;let _=v.pathname||"/",C=_;if(m!=="/"){let S=m.replace(/^\//,"").split("/");C="/"+_.replace(/^\//,"").split("/").slice(S.length).join("/")}let E=H0(n,{pathname:C});Un(g||E!=null,`No routes matched location "${v.pathname}${v.search}${v.hash}" `),Un(E==null||E[E.length-1].route.element!==void 0||E[E.length-1].route.Component!==void 0||E[E.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 k=kT(E&&E.map(S=>Object.assign({},S,{params:Object.assign({},d,S.params),pathname:ea([m,l.encodeLocation?l.encodeLocation(S.pathname.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:S.pathname]),pathnameBase:S.pathnameBase==="/"?m:ea([m,l.encodeLocation?l.encodeLocation(S.pathnameBase.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:S.pathnameBase])})),r,i);return a&&k?x.createElement(dl.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",unstable_mask:void 0,...v},navigationType:"POP"}},k):k}function ST(){let n=DT(),a=lT(n)?`${n.status} ${n.statusText}`:n instanceof Error?n.message:JSON.stringify(n),i=n instanceof Error?n.stack:null,l="rgba(200,200,200, 0.5)",r={padding:"0.5rem",backgroundColor:l},c={padding:"2px 4px",backgroundColor:l},d=null;return console.error("Error handled by React Router default ErrorBoundary:",n),d=x.createElement(x.Fragment,null,x.createElement("p",null,"💿 Hey developer 👋"),x.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",x.createElement("code",{style:c},"ErrorBoundary")," or"," ",x.createElement("code",{style:c},"errorElement")," prop on your route.")),x.createElement(x.Fragment,null,x.createElement("h2",null,"Unexpected Application Error!"),x.createElement("h3",{style:{fontStyle:"italic"}},a),i?x.createElement("pre",{style:r},i):null,d)}var TT=x.createElement(ST,null),J0=class extends x.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=gT(n.digest);i&&(n=i)}let a=n!==void 0?x.createElement(Hn.Provider,{value:this.props.routeContext},x.createElement(Pf.Provider,{value:n,children:this.props.component})):this.props.children;return this.context?x.createElement(CT,{error:n},a):a}};J0.contextType=uT;var Od=new WeakMap;function CT({children:n,error:a}){let{basename:i}=x.useContext(Cn);if(typeof a=="object"&&a&&"digest"in a&&typeof a.digest=="string"){let l=mT(a.digest);if(l){let r=Od.get(a);if(r)throw r;let c=Y0(l.location,i);if(F0&&!Od.get(a))if(c.isExternal||l.reloadDocument)window.location.href=c.absoluteURL||c.to;else{const d=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(c.to,{replace:l.replace}));throw Od.set(a,d),d}return x.createElement("meta",{httpEquiv:"refresh",content:`0;url=${c.absoluteURL||c.to}`})}}return n}function ET({routeContext:n,match:a,children:i}){let l=x.useContext(Pi);return l&&l.static&&l.staticContext&&(a.route.errorElement||a.route.ErrorBoundary)&&(l.staticContext._deepestRenderedBoundaryId=a.route.id),x.createElement(Hn.Provider,{value:n},i)}function kT(n,a=[],i){let l=i==null?void 0:i.state;if(n==null){if(!l)return null;if(l.errors)n=l.matches;else if(a.length===0&&!l.initialized&&l.matches.length>0)n=l.matches;else return null}let r=n,c=l==null?void 0:l.errors;if(c!=null){let y=r.findIndex(v=>v.route.id&&(c==null?void 0:c[v.route.id])!==void 0);ht(y>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(c).join(",")}`),r=r.slice(0,Math.min(r.length,y+1))}let d=!1,p=-1;if(i&&l){d=l.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:C}=l,E=v.route.loader&&!_.hasOwnProperty(v.route.id)&&(!C||C[v.route.id]===void 0);if(v.route.lazy||E){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=l&&m?(y,v)=>{var _,C;m(y,{location:l.location,params:((C=(_=l.matches)==null?void 0:_[0])==null?void 0:C.params)??{},unstable_pattern:rT(l.matches),errorInfo:v})}:void 0;return r.reduceRight((y,v,_)=>{let C,E=!1,k=null,A=null;l&&(C=c&&v.route.id?c[v.route.id]:void 0,k=v.route.errorElement||TT,d&&(p<0&&_===0?(eb("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),E=!0,A=null):p===_&&(E=!0,A=v.route.hydrateFallbackElement||null)));let S=a.concat(r.slice(0,_+1)),N=()=>{let D;return C?D=k:E?D=A:v.route.Component?D=x.createElement(v.route.Component,null):v.route.element?D=v.route.element:D=y,x.createElement(ET,{match:v,routeContext:{outlet:y,matches:S,isDataRoute:l!=null},children:D})};return l&&(v.route.ErrorBoundary||v.route.errorElement||_===0)?x.createElement(J0,{location:l.location,revalidation:l.revalidation,component:k,error:C,children:N(),routeContext:{outlet:null,matches:S,isDataRoute:!0},onError:g}):N()},null)}function $f(n){return`${n} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function wT(n){let a=x.useContext(Pi);return ht(a,$f(n)),a}function AT(n){let a=x.useContext(lc);return ht(a,$f(n)),a}function NT(n){let a=x.useContext(Hn);return ht(a,$f(n)),a}function Ff(n){let a=NT(n),i=a.matches[a.matches.length-1];return ht(i.route.id,`${n} can only be used on routes that contain a unique "id"`),i.route.id}function jT(){return Ff("useRouteId")}function DT(){var l;let n=x.useContext(Pf),a=AT("useRouteError"),i=Ff("useRouteError");return n!==void 0?n:(l=a.errors)==null?void 0:l[i]}function MT(){let{router:n}=wT("useNavigate"),a=Ff("useNavigate"),i=x.useRef(!1);return Q0(()=>{i.current=!0}),x.useCallback(async(r,c={})=>{Un(i.current,X0),i.current&&(typeof r=="number"?await n.navigate(r):await n.navigate(r,{fromRouteId:a,...c}))},[n,a])}var qv={};function eb(n,a,i){!a&&!qv[n]&&(qv[n]=!0,Un(!1,i))}x.memo(RT);function RT({routes:n,future:a,state:i,isStatic:l,onError:r}){return W0(n,void 0,{state:i,isStatic:l,onError:r})}function Li({to:n,replace:a,state:i,relative:l}){ht(Vs(),"<Navigate> may be used only in the context of a <Router> component.");let{static:r}=x.useContext(Cn);Un(!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:c}=x.useContext(Hn),{pathname:d}=en(),p=rc(),m=oc(n,Gf(c),d,l==="path"),g=JSON.stringify(m);return x.useEffect(()=>{p(JSON.parse(g),{replace:a,state:i,relative:l})},[p,g,l,a,i]),null}function tb(n){return xT(n.context)}function gt(n){ht(!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 BT({basename:n="/",children:a=null,location:i,navigationType:l="POP",navigator:r,static:c=!1,unstable_useTransitions:d}){ht(!Vs(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let p=n.replace(/^\/*/,"/"),m=x.useMemo(()=>({basename:p,navigator:r,static:c,unstable_useTransitions:d,future:{}}),[p,r,c,d]);typeof i=="string"&&(i=Gi(i));let{pathname:g="/",search:y="",hash:v="",state:_=null,key:C="default",unstable_mask:E}=i,k=x.useMemo(()=>{let A=Aa(g,p);return A==null?null:{location:{pathname:A,search:y,hash:v,state:_,key:C,unstable_mask:E},navigationType:l}},[p,g,y,v,_,C,l,E]);return Un(k!=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.`),k==null?null:x.createElement(Cn.Provider,{value:m},x.createElement(dl.Provider,{children:a,value:k}))}function OT({children:n,location:a}){return _T(uf(n),a)}function uf(n,a=[]){let i=[];return x.Children.forEach(n,(l,r)=>{if(!x.isValidElement(l))return;let c=[...a,r];if(l.type===x.Fragment){i.push.apply(i,uf(l.props.children,c));return}ht(l.type===gt,`[${typeof l.type=="string"?l.type:l.type.name}] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>`),ht(!l.props.index||!l.props.children,"An index route cannot have child routes.");let d={id:l.props.id||c.join("-"),caseSensitive:l.props.caseSensitive,element:l.props.element,Component:l.props.Component,index:l.props.index,path:l.props.path,middleware:l.props.middleware,loader:l.props.loader,action:l.props.action,hydrateFallbackElement:l.props.hydrateFallbackElement,HydrateFallback:l.props.HydrateFallback,errorElement:l.props.errorElement,ErrorBoundary:l.props.ErrorBoundary,hasErrorBoundary:l.props.hasErrorBoundary===!0||l.props.ErrorBoundary!=null||l.props.errorElement!=null,shouldRevalidate:l.props.shouldRevalidate,handle:l.props.handle,lazy:l.props.lazy};l.props.children&&(d.children=uf(l.props.children,c)),i.push(d)}),i}var Hr="get",Gr="application/x-www-form-urlencoded";function uc(n){return typeof HTMLElement<"u"&&n instanceof HTMLElement}function LT(n){return uc(n)&&n.tagName.toLowerCase()==="button"}function IT(n){return uc(n)&&n.tagName.toLowerCase()==="form"}function UT(n){return uc(n)&&n.tagName.toLowerCase()==="input"}function zT(n){return!!(n.metaKey||n.altKey||n.ctrlKey||n.shiftKey)}function VT(n,a){return n.button===0&&(!a||a==="_self")&&!zT(n)}function df(n=""){return new URLSearchParams(typeof n=="string"||Array.isArray(n)||n instanceof URLSearchParams?n:Object.keys(n).reduce((a,i)=>{let l=n[i];return a.concat(Array.isArray(l)?l.map(r=>[i,r]):[[i,l]])},[]))}function HT(n,a){let i=df(n);return a&&a.forEach((l,r)=>{i.has(r)||a.getAll(r).forEach(c=>{i.append(r,c)})}),i}var Dr=null;function GT(){if(Dr===null)try{new FormData(document.createElement("form"),0),Dr=!1}catch{Dr=!0}return Dr}var PT=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function Ld(n){return n!=null&&!PT.has(n)?(Un(!1,`"${n}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${Gr}"`),null):n}function $T(n,a){let i,l,r,c,d;if(IT(n)){let p=n.getAttribute("action");l=p?Aa(p,a):null,i=n.getAttribute("method")||Hr,r=Ld(n.getAttribute("enctype"))||Gr,c=new FormData(n)}else if(LT(n)||UT(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(l=m?Aa(m,a):null,i=n.getAttribute("formmethod")||p.getAttribute("method")||Hr,r=Ld(n.getAttribute("formenctype"))||Ld(p.getAttribute("enctype"))||Gr,c=new FormData(p,n),!GT()){let{name:g,type:y,value:v}=n;if(y==="image"){let _=g?`${g}.`:"";c.append(`${_}x`,"0"),c.append(`${_}y`,"0")}else g&&c.append(g,v)}}else{if(uc(n))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');i=Hr,l=null,r=Gr,d=n}return c&&r==="text/plain"&&(d=c,c=void 0),{action:l,method:i.toLowerCase(),encType:r,formData:c,body:d}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function Yf(n,a){if(n===!1||n===null||typeof n>"u")throw new Error(a)}function FT(n,a,i,l){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}_.${l}`:r.pathname=`${r.pathname}.${l}`:r.pathname==="/"?r.pathname=`_root.${l}`:a&&Aa(r.pathname,a)==="/"?r.pathname=`${a.replace(/\/$/,"")}/_root.${l}`:r.pathname=`${r.pathname.replace(/\/$/,"")}.${l}`,r}async function YT(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 qT(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 KT(n,a,i){let l=await Promise.all(n.map(async r=>{let c=a.routes[r.route.id];if(c){let d=await YT(c,i);return d.links?d.links():[]}return[]}));return WT(l.flat(1).filter(qT).filter(r=>r.rel==="stylesheet"||r.rel==="preload").map(r=>r.rel==="stylesheet"?{...r,rel:"prefetch",as:"style"}:{...r,rel:"prefetch"}))}function Kv(n,a,i,l,r,c){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 c==="assets"?a.filter((m,g)=>d(m,g)||p(m,g)):c==="data"?a.filter((m,g)=>{var v;let y=l.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 ZT(n,a,{includeHydrateFallback:i}={}){return XT(n.map(l=>{let r=a.routes[l.route.id];if(!r)return[];let c=[r.module];return r.clientActionModule&&(c=c.concat(r.clientActionModule)),r.clientLoaderModule&&(c=c.concat(r.clientLoaderModule)),i&&r.hydrateFallbackModule&&(c=c.concat(r.hydrateFallbackModule)),r.imports&&(c=c.concat(r.imports)),c}).flat(1))}function XT(n){return[...new Set(n)]}function QT(n){let a={},i=Object.keys(n).sort();for(let l of i)a[l]=n[l];return a}function WT(n,a){let i=new Set;return new Set(a),n.reduce((l,r)=>{let c=JSON.stringify(QT(r));return i.has(c)||(i.add(c),l.push({key:c,link:r})),l},[])}function nb(){let n=x.useContext(Pi);return Yf(n,"You must render this element inside a <DataRouterContext.Provider> element"),n}function JT(){let n=x.useContext(lc);return Yf(n,"You must render this element inside a <DataRouterStateContext.Provider> element"),n}var qf=x.createContext(void 0);qf.displayName="FrameworkContext";function ab(){let n=x.useContext(qf);return Yf(n,"You must render this element inside a <HydratedRouter> element"),n}function eC(n,a){let i=x.useContext(qf),[l,r]=x.useState(!1),[c,d]=x.useState(!1),{onFocus:p,onBlur:m,onMouseEnter:g,onMouseLeave:y,onTouchStart:v}=a,_=x.useRef(null);x.useEffect(()=>{if(n==="render"&&d(!0),n==="viewport"){let k=S=>{S.forEach(N=>{d(N.isIntersecting)})},A=new IntersectionObserver(k,{threshold:.5});return _.current&&A.observe(_.current),()=>{A.disconnect()}}},[n]),x.useEffect(()=>{if(l){let k=setTimeout(()=>{d(!0)},100);return()=>{clearTimeout(k)}}},[l]);let C=()=>{r(!0)},E=()=>{r(!1),d(!1)};return i?n!=="intent"?[c,_,{}]:[c,_,{onFocus:Ho(p,C),onBlur:Ho(m,E),onMouseEnter:Ho(g,C),onMouseLeave:Ho(y,E),onTouchStart:Ho(v,C)}]:[!1,_,{}]}function Ho(n,a){return i=>{n&&n(i),i.defaultPrevented||a(i)}}function tC({page:n,...a}){let{router:i}=nb(),l=x.useMemo(()=>H0(i.routes,n,i.basename),[i.routes,n,i.basename]);return l?x.createElement(aC,{page:n,matches:l,...a}):null}function nC(n){let{manifest:a,routeModules:i}=ab(),[l,r]=x.useState([]);return x.useEffect(()=>{let c=!1;return KT(n,a,i).then(d=>{c||r(d)}),()=>{c=!0}},[n,a,i]),l}function aC({page:n,matches:a,...i}){let l=en(),{future:r,manifest:c,routeModules:d}=ab(),{basename:p}=nb(),{loaderData:m,matches:g}=JT(),y=x.useMemo(()=>Kv(n,a,g,c,l,"data"),[n,a,g,c,l]),v=x.useMemo(()=>Kv(n,a,g,c,l,"assets"),[n,a,g,c,l]),_=x.useMemo(()=>{if(n===l.pathname+l.search+l.hash)return[];let k=new Set,A=!1;if(a.forEach(N=>{var H;let D=c.routes[N.route.id];!D||!D.hasLoader||(!y.some(O=>O.route.id===N.route.id)&&N.route.id in m&&((H=d[N.route.id])!=null&&H.shouldRevalidate)||D.hasClientLoader?A=!0:k.add(N.route.id))}),k.size===0)return[];let S=FT(n,p,r.unstable_trailingSlashAwareDataRequests,"data");return A&&k.size>0&&S.searchParams.set("_routes",a.filter(N=>k.has(N.route.id)).map(N=>N.route.id).join(",")),[S.pathname+S.search]},[p,r.unstable_trailingSlashAwareDataRequests,m,l,c,y,a,n,d]),C=x.useMemo(()=>ZT(v,c),[v,c]),E=nC(v);return x.createElement(x.Fragment,null,_.map(k=>x.createElement("link",{key:k,rel:"prefetch",as:"fetch",href:k,...i})),C.map(k=>x.createElement("link",{key:k,rel:"modulepreload",href:k,...i})),E.map(({key:k,link:A})=>x.createElement("link",{key:k,nonce:i.nonce,...A,crossOrigin:A.crossOrigin??i.crossOrigin})))}function sC(...n){return a=>{n.forEach(i=>{typeof i=="function"?i(a):i!=null&&(i.current=a)})}}var iC=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{iC&&(window.__reactRouterVersion="7.13.1")}catch{}function oC({basename:n,children:a,unstable_useTransitions:i,window:l}){let r=x.useRef();r.current==null&&(r.current=U1({window:l,v5Compat:!0}));let c=r.current,[d,p]=x.useState({action:c.action,location:c.location}),m=x.useCallback(g=>{i===!1?p(g):x.startTransition(()=>p(g))},[i]);return x.useLayoutEffect(()=>c.listen(m),[c,m]),x.createElement(BT,{basename:n,children:a,location:d.location,navigationType:d.action,navigator:c,unstable_useTransitions:i})}var sb=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Kf=x.forwardRef(function({onClick:a,discover:i="render",prefetch:l="none",relative:r,reloadDocument:c,replace:d,unstable_mask:p,state:m,target:g,to:y,preventScrollReset:v,viewTransition:_,unstable_defaultShouldRevalidate:C,...E},k){let{basename:A,navigator:S,unstable_useTransitions:N}=x.useContext(Cn),D=typeof y=="string"&&sb.test(y),H=Y0(y,A);y=H.to;let O=vT(y,{relative:r}),$=en(),R=null;if(p){let oe=oc(p,[],$.unstable_mask?$.unstable_mask.pathname:"/",!0);A!=="/"&&(oe.pathname=oe.pathname==="/"?A:ea([A,oe.pathname])),R=S.createHref(oe)}let[L,G,ee]=eC(l,E),te=uC(y,{replace:d,unstable_mask:p,state:m,target:g,preventScrollReset:v,relative:r,viewTransition:_,unstable_defaultShouldRevalidate:C,unstable_useTransitions:N});function ne(oe){a&&a(oe),oe.defaultPrevented||te(oe)}let ie=!(H.isExternal||c),he=x.createElement("a",{...E,...ee,href:(ie?R:void 0)||H.absoluteURL||O,onClick:ie?ne:a,ref:sC(k,G),target:g,"data-discover":!D&&i==="render"?"true":void 0});return L&&!D?x.createElement(x.Fragment,null,he,x.createElement(tC,{page:O})):he});Kf.displayName="Link";var lC=x.forwardRef(function({"aria-current":a="page",caseSensitive:i=!1,className:l="",end:r=!1,style:c,to:d,viewTransition:p,children:m,...g},y){let v=fl(d,{relative:g.relative}),_=en(),C=x.useContext(lc),{navigator:E,basename:k}=x.useContext(Cn),A=C!=null&&mC(v)&&p===!0,S=E.encodeLocation?E.encodeLocation(v).pathname:v.pathname,N=_.pathname,D=C&&C.navigation&&C.navigation.location?C.navigation.location.pathname:null;i||(N=N.toLowerCase(),D=D?D.toLowerCase():null,S=S.toLowerCase()),D&&k&&(D=Aa(D,k)||D);const H=S!=="/"&&S.endsWith("/")?S.length-1:S.length;let O=N===S||!r&&N.startsWith(S)&&N.charAt(H)==="/",$=D!=null&&(D===S||!r&&D.startsWith(S)&&D.charAt(S.length)==="/"),R={isActive:O,isPending:$,isTransitioning:A},L=O?a:void 0,G;typeof l=="function"?G=l(R):G=[l,O?"active":null,$?"pending":null,A?"transitioning":null].filter(Boolean).join(" ");let ee=typeof c=="function"?c(R):c;return x.createElement(Kf,{...g,"aria-current":L,className:G,ref:y,style:ee,to:d,viewTransition:p},typeof m=="function"?m(R):m)});lC.displayName="NavLink";var rC=x.forwardRef(({discover:n="render",fetcherKey:a,navigate:i,reloadDocument:l,replace:r,state:c,method:d=Hr,action:p,onSubmit:m,relative:g,preventScrollReset:y,viewTransition:v,unstable_defaultShouldRevalidate:_,...C},E)=>{let{unstable_useTransitions:k}=x.useContext(Cn),A=hC(),S=pC(p,{relative:g}),N=d.toLowerCase()==="get"?"get":"post",D=typeof p=="string"&&sb.test(p),H=O=>{if(m&&m(O),O.defaultPrevented)return;O.preventDefault();let $=O.nativeEvent.submitter,R=($==null?void 0:$.getAttribute("formmethod"))||d,L=()=>A($||O.currentTarget,{fetcherKey:a,method:R,navigate:i,replace:r,state:c,relative:g,preventScrollReset:y,viewTransition:v,unstable_defaultShouldRevalidate:_});k&&i!==!1?x.startTransition(()=>L()):L()};return x.createElement("form",{ref:E,method:N,action:S,onSubmit:l?m:H,...C,"data-discover":!D&&n==="render"?"true":void 0})});rC.displayName="Form";function cC(n){return`${n} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function ib(n){let a=x.useContext(Pi);return ht(a,cC(n)),a}function uC(n,{target:a,replace:i,unstable_mask:l,state:r,preventScrollReset:c,relative:d,viewTransition:p,unstable_defaultShouldRevalidate:m,unstable_useTransitions:g}={}){let y=rc(),v=en(),_=fl(n,{relative:d});return x.useCallback(C=>{if(VT(C,a)){C.preventDefault();let E=i!==void 0?i:nl(v)===nl(_),k=()=>y(n,{replace:E,unstable_mask:l,state:r,preventScrollReset:c,relative:d,viewTransition:p,unstable_defaultShouldRevalidate:m});g?x.startTransition(()=>k()):k()}},[v,y,_,i,l,r,a,n,c,d,p,m,g])}function Zf(n){Un(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=x.useRef(df(n)),i=x.useRef(!1),l=en(),r=x.useMemo(()=>HT(l.search,i.current?null:a.current),[l.search]),c=rc(),d=x.useCallback((p,m)=>{const g=df(typeof p=="function"?p(new URLSearchParams(r)):p);i.current=!0,c("?"+g,m)},[c,r]);return[r,d]}var dC=0,fC=()=>`__${String(++dC)}__`;function hC(){let{router:n}=ib("useSubmit"),{basename:a}=x.useContext(Cn),i=jT(),l=n.fetch,r=n.navigate;return x.useCallback(async(c,d={})=>{let{action:p,method:m,encType:g,formData:y,body:v}=$T(c,a);if(d.navigate===!1){let _=d.fetcherKey||fC();await l(_,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})},[l,r,a,i])}function pC(n,{relative:a}={}){let{basename:i}=x.useContext(Cn),l=x.useContext(Hn);ht(l,"useFormAction must be used inside a RouteContext");let[r]=l.matches.slice(-1),c={...fl(n||".",{relative:a})},d=en();if(n==null){c.search=d.search;let p=new URLSearchParams(c.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();c.search=y?`?${y}`:""}}return(!n||n===".")&&r.route.index&&(c.search=c.search?c.search.replace(/^\?/,"?index&"):"?index"),i!=="/"&&(c.pathname=c.pathname==="/"?i:ea([i,c.pathname])),nl(c)}function mC(n,{relative:a}={}){let i=x.useContext(K0);ht(i!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:l}=ib("useViewTransitionState"),r=fl(n,{relative:a});if(!i.isTransitioning)return!1;let c=Aa(i.currentLocation.pathname,l)||i.currentLocation.pathname,d=Aa(i.nextLocation.pathname,l)||i.nextLocation.pathname;return al(r.pathname,d)!=null||al(r.pathname,c)!=null}function hn(){const n=rc();return x.useCallback((a,i)=>{typeof a=="number"?n(a):n(a,i)},[n])}function Xf(n){return`/sessions/${encodeURIComponent(n)}`}function Ii(n){return`/workspaces/${encodeURIComponent(n)}`}function Na(n,a){const i=`/tasks/${encodeURIComponent(n)}`;return a?`${i}/${a}`:i}function gC(n){return`/tasks/${encodeURIComponent(n)}/edit`}function zs(n,a){const i=new URLSearchParams;n&&i.set("workspace",n),a&&i.set("parent",a);const l=i.toString();return l?`/tasks/new?${l}`:"/tasks/new"}function ob(n){return`/sessions/new?${new URLSearchParams({env:n}).toString()}`}const Zv="/environments/new",Is="/settings",vC="/pair",yC="/chat",sl="/",bC="/workspaces";function zn(n){return typeof n=="object"&&n!==null&&!Array.isArray(n)}function il(n,a){return console.warn(`[ws] Malformed "${n}" message: ${a}`),!1}function xC(n){return zn(n)&&typeof n.id=="string"&&typeof n.displayName=="string"&&typeof n.adapterType=="string"&&typeof n.status=="string"&&typeof n.bootstrapped=="boolean"}function Xv(n){return zn(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 Qv(n){return zn(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 _C(n){return zn(n)&&typeof n.id=="string"&&typeof n.name=="string"&&typeof n.description=="string"&&typeof n.repoUrl=="string"&&typeof n.environmentId=="string"&&typeof n.status=="string"&&typeof n.worktreeBasePath=="string"&&typeof n.useWorktrees=="boolean"&&(n.defaultPersonaId===void 0||typeof n.defaultPersonaId=="string")&&typeof n.createdAt=="string"&&typeof n.updatedAt=="string"}function SC(n){return zn(n)&&typeof n.id=="string"&&(typeof n.workspaceId=="string"||n.workspaceId===void 0)&&typeof n.title=="string"&&typeof n.status=="string"&&typeof n.branch=="string"&&typeof n.sortOrder=="number"&&typeof n.depth=="number"&&(n.defaultPersonaId===void 0||typeof n.defaultPersonaId=="string")&&Array.isArray(n.dependsOn)&&Array.isArray(n.childTaskIds)}function TC(n){return zn(n)&&typeof n.id=="string"&&typeof n.workspaceId=="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 CC(n){return zn(n)&&typeof n.name=="string"&&typeof n.tokenType=="string"&&typeof n.envVar=="string"&&typeof n.filePath=="string"&&typeof n.expiresAt=="string"}const EC=new Set(["off","subscription","api_key"]),Id=new Set(["off","on"]);function Wv(n){return zn(n)&&EC.has(n.claude)&&Id.has(n.github)&&Id.has(n.copilot)&&Id.has(n.codex)}function kC(n){return zn(n)&&typeof n.name=="string"&&typeof n.repository=="string"&&typeof n.state=="string"&&typeof n.gitStatus=="string"}function wC(n){return zn(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"&&typeof n.type=="string"&&typeof n.script=="string"}function ta(n,a,i,l){return Array.isArray(n)?n.filter((r,c)=>a(r)?!0:(il(i,`item at index ${c} in "${l}" has unexpected shape`),!1)):(il(i,`expected "${l}" to be an array, got ${typeof n}`),[])}function AC(n){let a;try{a=JSON.parse(n)}catch{console.warn("[ws] Failed to parse WebSocket message as JSON");return}if(!zn(a)||typeof a.type!="string"){console.warn("[ws] Received WebSocket message without a string 'type' field:",a);return}const i={type:a.type,payload:zn(a.payload)?a.payload:void 0};return typeof a.id=="string"&&(i.id=a.id),typeof a.timestamp=="string"&&(i.timestamp=a.timestamp),i}function NC(n){switch(n){case"waiting_input":return"idle";case"killed":return"interrupted";default:return n}}const jC=3e3,wi=5e3,DC=4001;function MC(n,a){const i=typeof window<"u"?`${window.location.protocol==="https:"?"wss:":"ws:"}//${window.location.host}`:"ws://localhost:3000",l=x.useRef(void 0),[r,c]=x.useState(!1),d=x.useRef(a.onMessage);d.current=a.onMessage;const p=x.useRef(a.onConnect);p.current=a.onConnect;const m=x.useRef(a.onDisconnect);m.current=a.onDisconnect;const g=x.useCallback(y=>{var v;((v=l.current)==null?void 0:v.readyState)===WebSocket.OPEN&&l.current.send(JSON.stringify(y))},[]);return x.useEffect(()=>{let y,v;function _(){y=new WebSocket(i),l.current=y,y.onopen=()=>{c(!0),p.current(g)},y.onmessage=C=>{if(typeof C.data!="string"){console.warn("[ws] Received non-string WebSocket message; ignoring");return}const E=AC(C.data);E&&d.current(E)},y.onclose=C=>{var E;if(c(!1),l.current=void 0,(E=m.current)==null||E.call(m),clearTimeout(v),C.code===DC){window.location.href=vC;return}v=setTimeout(_,jC)},y.onerror=()=>{y.close()}}return _(),()=>{clearTimeout(v),y==null||y.close()}},[i,g]),{connected:r,send:g}}const RC=5e3;function BC(n){const[a,i]=x.useState([]),[l,r]=x.useState({}),c=x.useCallback(v=>{switch(v.type){case"environment.added":return!0;case"environment.removed":{const _=v.payload.environmentId;return _&&(i(C=>C.filter(E=>E.id!==_)),r(C=>{const E={...C};return delete E[_],E})),n({type:"list_sessions"}),!0}case"environment.changed":return n({type:"list_environments"}),!0;case"environment.provision_progress":{const _=v.payload;if(typeof _.environmentId!="string"||typeof _.stage!="string"||typeof _.message!="string"||typeof _.progress!="number")return il("environment.provision_progress","invalid payload"),!0;if(r(C=>({...C,[_.environmentId]:{stage:_.stage,message:_.message,progress:_.progress}})),_.stage==="ready"){const C=_.environmentId;setTimeout(()=>{r(E=>{const k={...E};return delete k[C],k})},RC)}return!0}default:return!1}},[n]),d=x.useCallback(v=>{var _;switch(v.type){case"environments":return i(ta((_=v.payload)==null?void 0:_.environments,xC,"environments","environments")),!0;default:return!1}},[]),p=x.useCallback((v,_,C)=>{n({type:"add_environment",payload:{displayName:v,adapterType:_,adapterConfig:C||{}}})},[n]),m=x.useCallback(v=>{n({type:"provision_environment",payload:{environmentId:v}})},[n]),g=x.useCallback(v=>{n({type:"stop_environment",payload:{environmentId:v}})},[n]),y=x.useCallback(v=>{n({type:"remove_environment",payload:{environmentId:v}})},[n]);return{environments:a,provisionStatus:l,addEnvironment:p,provisionEnvironment:m,stopEnvironment:g,removeEnvironment:y,handleMessage:d,handleEvent:c}}const Ud=new Set(["pending","running","idle"]),OC=new Set(["completed","failed","interrupted"]),Jv=["pending","running","idle"];function LC(n){const[a,i]=x.useState([]),[l,r]=x.useState([]),[c,d]=x.useState(0),[p,m]=x.useState(void 0),[g,y]=x.useState({}),v=x.useCallback(N=>{var D,H,O,$,R;switch(N.type){case"sessions":return i(L=>{var te;const G=ta((te=N.payload)==null?void 0:te.sessions,Xv,"sessions","sessions"),ee=new Map(L.map(ne=>[ne.id,ne.status]));return G.map(ne=>{const ie=ee.get(ne.id);return!ie||ie===ne.status?ne:OC.has(ie)&&Ud.has(ne.status)?{...ne,status:ie}:Ud.has(ie)&&Ud.has(ne.status)&&Jv.indexOf(ie)>Jv.indexOf(ne.status)?{...ne,status:ie}:ne})}),!0;case"session_event":{if(!Qv(N.payload))return il("session_event","payload is not a valid SessionEvent"),!0;const L=N.payload;let G=0;if(r(ee=>{const te=[...ee,L];return te.length>wi?(G=te.length-wi,te.slice(-wi)):te}),G>0&&d(ee=>ee+G),L.eventType==="status"){const ee=NC(L.content);i(te=>te.some(ie=>ie.id===L.sessionId)?te.map(ie=>ie.id===L.sessionId?{...ie,status:ee}:ie):[...te,{id:L.sessionId,environmentId:"",runtime:"",status:ee,prompt:"",startedAt:L.timestamp}])}return!0}case"session_events":{const L=ta((D=N.payload)==null?void 0:D.events,Qv,"session_events","events"),G=(H=N.payload)==null?void 0:H.sessionId;if(typeof G!="string")return il("session_events","missing or non-string sessionId"),!0;if(L.length>0){let ee=0;r(te=>{const ne=new Set;for(const oe of te)oe.sessionId===G&&ne.add(`${oe.timestamp}|${oe.eventType}`);const ie=L.filter(oe=>!ne.has(`${oe.timestamp}|${oe.eventType}`)),he=[...te,...ie].sort((oe,j)=>oe.sessionId!==j.sessionId?0:oe.timestamp.localeCompare(j.timestamp));return he.length>wi?(ee=he.length-wi,he.slice(-wi)):he}),ee>0&&d(te=>te+ee)}return!0}case"spawned":{const L=(O=N.payload)==null?void 0:O.sessionId;return typeof L=="string"&&L&&m(L),n({type:"list_sessions"}),!0}case"task_sessions":{const L=($=N.payload)==null?void 0:$.taskId;if(typeof L!="string"||!L)return!0;const G=ta((R=N.payload)==null?void 0:R.sessions,Xv,"task_sessions","sessions");return y(ee=>({...ee,[L]:G})),!0}default:return!1}},[n]),_=x.useCallback((N,D,H,O)=>{n({type:"spawn",payload:{environmentId:N,prompt:D,personaId:H||"",worktreeBasePath:O||""}})},[n]),C=x.useCallback((N,D)=>{n({type:"send_input",payload:{sessionId:N,text:D}})},[n]),E=x.useCallback(N=>{n({type:"kill",payload:{sessionId:N}})},[n]),k=x.useCallback(N=>{n({type:"get_session_events",payload:{sessionId:N}})},[n]),A=x.useCallback(()=>{r([]),d(0)},[]),S=x.useCallback(N=>{n({type:"get_task_sessions",payload:{taskId:N}})},[n]);return{sessions:a,events:l,eventsDropped:c,lastSpawnedId:p,taskSessions:g,spawn:_,sendInput:C,kill:E,loadSessionEvents:k,clearEvents:A,loadTaskSessions:S,handleMessage:v}}function IC(n){const[a,i]=x.useState([]),[l,r]=x.useState(!1),c=x.useCallback(v=>{switch(v.type){case"workspace.created":return r(!1),n({type:"list_workspaces"}),!0;case"workspace.archived":case"workspace.updated":return n({type:"list_workspaces"}),!0;default:return!1}},[n]),d=x.useCallback(v=>{var _;switch(v.type){case"workspaces":return i(ta((_=v.payload)==null?void 0:_.workspaces,_C,"workspaces","workspaces")),!0;default:return!1}},[]),p=x.useCallback(()=>{r(!1)},[]),m=x.useCallback((v,_,C,E,k)=>{r(!0),n({type:"create_workspace",payload:{name:v,description:_||"",repoUrl:C||"",environmentId:E||"",defaultPersonaId:k||""}})},[n]),g=x.useCallback(v=>{n({type:"archive_workspace",payload:{workspaceId:v}})},[n]),y=x.useCallback((v,_)=>{n({type:"update_workspace",payload:{workspaceId:v,..._}})},[n]);return{workspaces:a,workspaceCreating:l,createWorkspace:m,archiveWorkspace:g,updateWorkspace:y,handleMessage:d,handleEvent:c,onDisconnect:p}}const UC=15e3;function zC(n){const[a,i]=x.useState([]),[l,r]=x.useState(void 0),c=x.useRef(new Map),d=x.useCallback(S=>{const N=S.payload;switch(S.type){case"task.created":{const D=typeof N.requestId=="string"?N.requestId:"";if(D){const O=c.current.get(D);O&&(clearTimeout(O.timer),c.current.delete(D),O.onSuccess())}const H=typeof N.workspaceId=="string"?N.workspaceId:"";return H&&n({type:"list_tasks",payload:{workspaceId:H}}),!0}case"task.started":{const D=typeof N.taskId=="string"?N.taskId:"",H=typeof N.sessionId=="string"?N.sessionId:"",O=typeof N.workspaceId=="string"?N.workspaceId:"";return r($=>D&&$===D?void 0:$),H&&(n({type:"list_sessions"}),D&&i($=>$.map(R=>R.id===D?{...R,latestSessionId:H}:R))),O?n({type:"list_tasks",payload:{workspaceId:O}}):D&&i($=>{const R=$.find(L=>L.id===D);return R!=null&&R.workspaceId?n({type:"list_tasks",payload:{workspaceId:R.workspaceId}}):n({type:"list_tasks",payload:{}}),$}),!0}case"task.completed":case"task.deleted":case"task.updated":{const D=typeof N.workspaceId=="string"?N.workspaceId:"",H=typeof N.taskId=="string"?N.taskId:"";return D?n({type:"list_tasks",payload:{workspaceId:D}}):H&&i(O=>{const $=O.find(R=>R.id===H);return $!=null&&$.workspaceId?n({type:"list_tasks",payload:{workspaceId:$.workspaceId}}):n({type:"list_tasks",payload:{}}),O}),!0}default:return!1}},[n]),p=x.useCallback(S=>{var N,D,H,O;switch(S.type){case"tasks":{const $=ta((N=S.payload)==null?void 0:N.tasks,SC,"tasks","tasks"),R=typeof((D=S.payload)==null?void 0:D.workspaceId)=="string"?S.payload.workspaceId:"";return R?(i(L=>[...L.filter(G=>G.workspaceId!==R),...$]),!0):(i(L=>{const G=new Set($.map(ee=>ee.id));return[...L.filter(ee=>!G.has(ee.id)),...$]}),!0)}case"create_task_error":{const $=typeof((H=S.payload)==null?void 0:H.requestId)=="string"?S.payload.requestId:"",R=typeof((O=S.payload)==null?void 0:O.message)=="string"?S.payload.message:"Failed to create task";if($){const L=c.current.get($);L?(clearTimeout(L.timer),c.current.delete($),L.onError(R)):console.error("[useTasks] create_task_error with unknown requestId:",R)}else console.error("[useTasks] create_task_error:",R);return!0}default:return!1}},[]),m=x.useCallback(()=>{r(void 0);for(const[,S]of c.current)clearTimeout(S.timer),S.onError("Disconnected");c.current.clear()},[]),g=x.useCallback(S=>{n({type:"list_tasks",payload:{workspaceId:S}})},[n]),y=x.useCallback((S,N,D,H,O,$,R,L,G)=>{const ee={workspaceId:S,title:N,description:D||"",dependsOn:H||[],parentTaskId:O||"",defaultPersonaId:$||"",canDecompose:R||!1};if(L||G){const te=crypto.randomUUID();ee.requestId=te;const ne=G??(()=>{}),ie=setTimeout(()=>{c.current.delete(te)&&ne("Request timed out")},UC);c.current.set(te,{onSuccess:L??(()=>{}),onError:ne,timer:ie})}n({type:"create_task",payload:ee})},[n]),v=x.useCallback((S,N,D,H)=>{r(S),n({type:"start_task",payload:{taskId:S,personaId:N||"",environmentId:D||"",notes:H||""}})},[n]),_=x.useCallback(S=>{n({type:"stop_task",payload:{taskId:S}})},[n]),C=x.useCallback(S=>{n({type:"complete_task",payload:{taskId:S}})},[n]),E=x.useCallback(S=>{n({type:"resume_task",payload:{taskId:S}})},[n]),k=x.useCallback((S,N,D,H,O)=>{const $={taskId:S,title:N,description:D,dependsOn:H};O!==void 0&&($.defaultPersonaId=O),n({type:"update_task",payload:$})},[n]),A=x.useCallback(S=>{n({type:"delete_task",payload:{taskId:S}})},[n]);return{tasks:a,taskStartingId:l,loadTasks:g,createTask:y,startTask:v,stopTask:_,completeTask:C,resumeTask:E,updateTask:k,deleteTask:A,handleMessage:p,handleEvent:d,onDisconnect:m}}function VC(n){const[a,i]=x.useState([]),l=x.useCallback(p=>{if(p.type==="finding.posted"){const m=typeof p.payload.workspaceId=="string"?p.payload.workspaceId:"";return m&&n({type:"list_findings",payload:{workspaceId:m}}),!0}return!1},[n]),r=x.useCallback(p=>{var m;switch(p.type){case"findings":return i(ta((m=p.payload)==null?void 0:m.findings,TC,"findings","findings")),!0;default:return!1}},[]),c=x.useCallback(p=>{n({type:"list_findings",payload:{workspaceId:p}})},[n]),d=x.useCallback((p,m,g,y,v)=>{n({type:"post_finding",payload:{workspaceId:p,title:m,content:g,category:y||"general",tags:v||[]}})},[n]);return{findings:a,loadFindings:c,postFinding:d,handleMessage:r,handleEvent:l}}function HC(n){const[a,i]=x.useState([]),l=x.useCallback(m=>m.type==="token.changed"?(n({type:"list_tokens"}),!0):!1,[n]),r=x.useCallback(m=>{var g;switch(m.type){case"tokens":return i(ta((g=m.payload)==null?void 0:g.tokens,CC,"tokens","tokens")),!0;default:return!1}},[]),c=x.useCallback(()=>{n({type:"list_tokens"})},[n]),d=x.useCallback((m,g,y,v,_)=>{n({type:"set_token",payload:{name:m,value:g,tokenType:y,envVar:v,filePath:_}})},[n]),p=x.useCallback(m=>{n({type:"delete_token",payload:{name:m}})},[n]);return{tokens:a,loadTokens:c,setToken:d,deleteToken:p,handleMessage:r,handleEvent:l}}function GC(n){const[a,i]=x.useState({claude:"off",github:"off",copilot:"off",codex:"off"}),l=x.useCallback(d=>d.type==="credential.providers_changed"?(Wv(d.payload)&&i(d.payload),!0):!1,[]),r=x.useCallback(d=>{switch(d.type){case"credential_providers":return Wv(d.payload)&&i(d.payload),!0;default:return!1}},[]),c=x.useCallback(d=>{n({type:"set_credential_providers",payload:d})},[n]);return{credentialProviders:a,updateCredentialProviders:c,handleMessage:r,handleEvent:l}}function PC(n,a){const[i,l]=x.useState([]),[r,c]=x.useState(""),[d,p]=x.useState(""),[m,g]=x.useState(!1),y=x.useCallback(C=>{var E,k,A;switch(C.type){case"codespaces_list":{const S=ta((E=C.payload)==null?void 0:E.codespaces,kC,"codespaces_list","codespaces"),N=typeof((k=C.payload)==null?void 0:k.error)=="string"?C.payload.error:"";return l(S),p(N),!0}case"codespace_created":return g(!1),n({type:"list_codespaces"}),!0;case"codespace_create_error":{g(!1);const S=typeof((A=C.payload)==null?void 0:A.message)=="string"?C.payload.message:"Failed to create codespace";return c(S),!0}default:return!1}},[n]),v=x.useCallback(()=>{n({type:"list_codespaces"})},[n]),_=x.useCallback((C,E)=>{if(!a){c("Not connected to server. Please try again once the connection is restored.");return}g(!0),c("");const k={repo:C};E&&(k.machine=E),n({type:"create_codespace",payload:k})},[n,a]);return{codespaces:i,codespaceError:r,codespaceListError:d,codespaceCreating:m,listCodespaces:v,createCodespace:_,handleMessage:y}}function $C(n){const[a,i]=x.useState([]),l=x.useCallback(m=>{switch(m.type){case"persona.created":case"persona.updated":case"persona.deleted":return n({type:"list_personas"}),!0;default:return!1}},[n]),r=x.useCallback(m=>{var g;switch(m.type){case"personas":{const y=ta((g=m.payload)==null?void 0:g.personas,wC,"personas","personas");return i(y),!0}default:return!1}},[]),c=x.useCallback((m,g,y,v,_,C,E,k)=>{n({type:"create_persona",payload:{name:m,description:g,systemPrompt:y,runtime:v||"",model:_||"",maxTurns:C||0,type:E||"agent",script:k||""}})},[n]),d=x.useCallback((m,g,y,v,_,C,E,k,A)=>{const S={personaId:m};g!==void 0&&(S.name=g),y!==void 0&&(S.description=y),v!==void 0&&(S.systemPrompt=v),_!==void 0&&(S.runtime=_),C!==void 0&&(S.model=C),E!==void 0&&(S.maxTurns=E),k!==void 0&&(S.type=k),A!==void 0&&(S.script=A),n({type:"update_persona",payload:S})},[n]),p=x.useCallback(m=>{n({type:"delete_persona",payload:{personaId:m}})},[n]);return{personas:a,createPersona:c,updatePersona:d,deletePersona:p,handleMessage:r,handleEvent:l}}function FC(n){const[a,i]=x.useState(""),[l,r]=x.useState(void 0),{connected:c,send:d}=MC(n,{onMessage:O,onConnect:$,onDisconnect:R}),p=BC(d),m=LC(d),g=IC(d),y=zC(d),v=VC(d),_=HC(d),C=GC(d),E=PC(d,c),k=$C(d),A="default_persona_id",S="onboarding_completed",N=x.useCallback(G=>{i(G),d({type:"set_setting",payload:{key:A,value:G}})},[d]),D=x.useCallback(()=>{r(!0),d({type:"set_setting",payload:{key:S,value:"true"}})},[d]);function H(G){const ee=G.payload.key,te=G.payload.value;if(G.type==="setting.changed"){ee===A&&i(te??""),ee===S&&r(te==="true");return}p.handleEvent(G)||g.handleEvent(G)||y.handleEvent(G)||v.handleEvent(G)||_.handleEvent(G)||C.handleEvent(G)||k.handleEvent(G)}function O(G){var ee,te,ne;if(typeof G.type=="string"&&G.type.includes(".")){const ie=G,he={id:ie.id??"",type:G.type,timestamp:ie.timestamp??"",payload:G.payload??{}};H(he);return}if(G.type==="setting"){const ie=(ee=G.payload)==null?void 0:ee.key,he=(te=G.payload)==null?void 0:te.value;ie===A&&i(he??""),ie===S&&r(he==="true");return}if(!p.handleMessage(G)&&!m.handleMessage(G)&&!g.handleMessage(G)&&!y.handleMessage(G)&&!v.handleMessage(G)&&!_.handleMessage(G)&&!C.handleMessage(G)&&!E.handleMessage(G)&&!k.handleMessage(G)&&G.type==="error"){console.error("[ws]",(ne=G.payload)==null?void 0:ne.message);return}}function $(G){G({type:"list_environments"}),G({type:"list_sessions"}),G({type:"list_workspaces"}),G({type:"list_tokens"}),G({type:"get_credential_providers"}),G({type:"list_personas"}),G({type:"get_setting",payload:{key:A}}),G({type:"get_setting",payload:{key:S}}),G({type:"list_tasks",payload:{}}),G({type:"subscribe_all"})}function R(){g.onDisconnect(),y.onDisconnect()}const L=x.useCallback(()=>{d({type:"list_environments"}),d({type:"list_sessions"}),d({type:"list_workspaces"}),d({type:"list_tokens"})},[d]);return{connected:c,environments:p.environments,sessions:m.sessions,events:m.events,eventsDropped:m.eventsDropped,lastSpawnedId:m.lastSpawnedId,workspaces:g.workspaces,tasks:y.tasks,findings:v.findings,tokens:_.tokens,spawn:m.spawn,sendInput:m.sendInput,kill:m.kill,refresh:L,loadSessionEvents:m.loadSessionEvents,clearEvents:m.clearEvents,createWorkspace:g.createWorkspace,archiveWorkspace:g.archiveWorkspace,updateWorkspace:g.updateWorkspace,loadTasks:y.loadTasks,createTask:y.createTask,startTask:y.startTask,stopTask:y.stopTask,completeTask:y.completeTask,resumeTask:y.resumeTask,updateTask:y.updateTask,deleteTask:y.deleteTask,loadFindings:v.loadFindings,postFinding:v.postFinding,addEnvironment:p.addEnvironment,loadTokens:_.loadTokens,setToken:_.setToken,deleteToken:_.deleteToken,credentialProviders:C.credentialProviders,updateCredentialProviders:C.updateCredentialProviders,provisionStatus:p.provisionStatus,provisionEnvironment:p.provisionEnvironment,stopEnvironment:p.stopEnvironment,removeEnvironment:p.removeEnvironment,codespaces:E.codespaces,codespaceError:E.codespaceError,codespaceListError:E.codespaceListError,codespaceCreating:E.codespaceCreating,listCodespaces:E.listCodespaces,createCodespace:E.createCodespace,workspaceCreating:g.workspaceCreating,taskStartingId:y.taskStartingId,personas:k.personas,createPersona:k.createPersona,updatePersona:k.updatePersona,deletePersona:k.deletePersona,taskSessions:m.taskSessions,loadTaskSessions:m.loadTaskSessions,appDefaultPersonaId:a,setAppDefaultPersonaId:N,onboardingCompleted:l,completeOnboarding:D}}const Qf=x.createContext(void 0);function YC({children:n}){const a=FC();return f.jsx(Qf.Provider,{value:a,children:n})}function Rt(){const n=x.useContext(Qf);if(!n)throw new Error("useGrackle must be used within GrackleProvider");return n}const qC=[{id:"env-local-01",displayName:"Local Dev",adapterType:"local",status:"connected",bootstrapped:!0},{id:"env-docker-01",displayName:"Docker Sandbox",adapterType:"docker",status:"connected",bootstrapped:!0},{id:"env-cs-01",displayName:"GitHub Codespace",adapterType:"codespace",status:"connected",bootstrapped:!0},{id:"env-remote-01",displayName:"Staging (SSH)",adapterType:"ssh",status:"disconnected",bootstrapped:!1}],KC=[{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"}],ZC=[{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"}],XC=[{id:"proj-alpha",name:"Workspace Alpha",description:"Core platform API and authentication services",repoUrl:"https://github.com/acme/alpha",environmentId:"env-local-01",status:"active",worktreeBasePath:"",useWorktrees:!0,defaultPersonaId:"",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",environmentId:"env-docker-01",status:"active",worktreeBasePath:"",useWorktrees:!0,defaultPersonaId:"",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:"",environmentId:"env-local-01",status:"archived",worktreeBasePath:"",useWorktrees:!0,defaultPersonaId:"",createdAt:"2025-11-20T09:00:00Z",updatedAt:"2025-11-20T09:00:00Z"}],QC=[{id:"task-001",workspaceId:"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,defaultPersonaId:""},{id:"task-001a",workspaceId:"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,defaultPersonaId:""},{id:"task-001b",workspaceId:"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,defaultPersonaId:""},{id:"task-001c",workspaceId:"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,defaultPersonaId:""},{id:"task-002",workspaceId:"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,defaultPersonaId:""},{id:"task-003",workspaceId:"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,defaultPersonaId:""},{id:"task-004",workspaceId:"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,defaultPersonaId:""},{id:"task-005",workspaceId:"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,defaultPersonaId:""},{id:"task-006",workspaceId:"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,defaultPersonaId:""},{id:"task-006a",workspaceId:"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,defaultPersonaId:""},{id:"task-006b",workspaceId:"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,defaultPersonaId:""},{id:"task-006c",workspaceId:"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,defaultPersonaId:""},{id:"task-006d",workspaceId:"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,defaultPersonaId:""},{id:"task-007",workspaceId:"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,defaultPersonaId:""},{id:"task-007a",workspaceId:"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,defaultPersonaId:""},{id:"task-007b",workspaceId:"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,defaultPersonaId:""},{id:"task-008",workspaceId:"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,defaultPersonaId:""}],ey=[{id:"find-001",workspaceId:"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",workspaceId:"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",workspaceId:"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",workspaceId:"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",workspaceId:"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",workspaceId:"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",workspaceId:"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"}],WC=[{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:""}],JC=[{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",type:"agent",script:""},{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",type:"agent",script:""},{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",type:"agent",script:""},{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",type:"agent",script:""}],eE={"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 Ht(n){return new Date(Date.now()+n).toISOString()}const ty=[{label:"API Refactor",pauseForInput:!1,steps:[{delayMs:0,event:{eventType:"status",timestamp:Ht(0),content:"running"}},{delayMs:800,event:{eventType:"output",timestamp:Ht(800),content:"Analyzing current API structure in src/routes/..."}},{delayMs:1600,event:{eventType:"output",timestamp:Ht(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:Ht(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:Ht(4e3),content:"Running test suite... 22 tests passed, 3 updated, 0 failed."}},{delayMs:5e3,event:{eventType:"status",timestamp:Ht(5e3),content:"completed"}}]},{label:"Database Migration",pauseForInput:!0,pauseAfterStep:3,steps:[{delayMs:0,event:{eventType:"status",timestamp:Ht(0),content:"running"}},{delayMs:600,event:{eventType:"output",timestamp:Ht(600),content:"Scanning current schema for migration targets..."}},{delayMs:1400,event:{eventType:"output",timestamp:Ht(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:Ht(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:Ht(0),content:"Proceeding with migration..."}},{delayMs:1500,event:{eventType:"output",timestamp:Ht(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:Ht(2e3),content:"All 3 migrations applied. Running verification queries... OK."}},{delayMs:3200,event:{eventType:"status",timestamp:Ht(2700),content:"completed"}}]},{label:"Test Writer",pauseForInput:!1,steps:[{delayMs:0,event:{eventType:"status",timestamp:Ht(0),content:"running"}},{delayMs:700,event:{eventType:"output",timestamp:Ht(700),content:"Generating test scaffolding for src/services/billing.ts..."}},{delayMs:1800,event:{eventType:"output",timestamp:Ht(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:Ht(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:Ht(3500),content:"failed"}}]}],ny=400;function tE({children:n}){const[a,i]=x.useState(KC),[l,r]=x.useState(ZC),[c,d]=x.useState(void 0),[p,m]=x.useState(XC),[g,y]=x.useState(QC),[v,_]=x.useState(ey),[C,E]=x.useState(WC),[k,A]=x.useState({claude:"off",github:"off",copilot:"off",codex:"off"}),[S,N]=x.useState(JC),[D]=x.useState(eE),[H,O]=x.useState(""),$=x.useRef(0),R=x.useRef(0),L=x.useRef(new Set),G=x.useRef(new Map),ee=x.useRef(g);ee.current=g;const te=x.useRef(new Map),ne=x.useRef(new Map),ie=x.useCallback(X=>($.current+=1,`mock-${X}-${String($.current).padStart(3,"0")}`),[]),he=x.useCallback(()=>{const X=ty[R.current%ty.length];return R.current+=1,X},[]),oe=x.useCallback((X,W,le)=>{const ye=setTimeout(()=>{var me;L.current.delete(ye),le&&((me=G.current.get(le))==null||me.delete(ye)),X()},W);L.current.add(ye),le&&(G.current.has(le)||G.current.set(le,new Set),G.current.get(le).add(ye))},[]),j=x.useCallback(X=>{const W=G.current.get(X);W&&(W.forEach(le=>{clearTimeout(le),L.current.delete(le)}),G.current.delete(X))},[]),Z=x.useCallback((X,W)=>{i(le=>le.map(ye=>ye.id===X?{...ye,status:W}:ye))},[]),K=x.useCallback(X=>{r(W=>[...W,X])},[]),de=x.useCallback((X,W,le)=>{W.forEach((ye,me)=>{oe(()=>{const He={sessionId:X,...ye.event,timestamp:new Date().toISOString()};K(He),ye.event.eventType==="status"&&Z(X,ye.event.content),me===W.length-1&&le&&le()},ye.delayMs,X)})},[oe,K,Z]),Y=x.useCallback((X,W,le,ye)=>{console.log("[MockGrackle] spawn",{environmentId:X,prompt:W,runtime:ye});const me=ie("sess"),He={id:me,environmentId:X,runtime:ye||"claude-code",status:"running",prompt:W,startedAt:new Date().toISOString()};i(yt=>[...yt,He]),d(me);const Ce=he();if(console.log(`[MockGrackle] Playing scenario: ${Ce.label}`),Ce.pauseForInput){const yt=Ce.pauseAfterStep??Ce.steps.length-1,et=Ce.steps.slice(0,yt+1),Nt=et.length>0?et[et.length-1].delayMs:0;de(me,et),oe(()=>{Z(me,"idle"),K({sessionId:me,eventType:"status",timestamp:new Date().toISOString(),content:"idle"})},Nt+ny,me),Ce.resumeSteps&&te.current.set(me,Ce.resumeSteps)}else de(me,Ce.steps)},[ie,he,de,oe,Z,K]),je=x.useCallback(X=>{console.log("[MockGrackle] kill",X),j(X),te.current.delete(X),Z(X,"interrupted"),K({sessionId:X,eventType:"status",timestamp:new Date().toISOString(),content:"interrupted"}),y(W=>W.map(le=>le.latestSessionId===X&&le.status==="working"?{...le,status:"not_started"}:le))},[j,Z,K]),Re=x.useCallback(()=>{console.log("[MockGrackle] refresh")},[]),Te=x.useCallback(X=>{console.log("[MockGrackle] loadSessionEvents",X)},[]),st=x.useCallback(()=>{console.log("[MockGrackle] clearEvents"),r([])},[]),kt=x.useCallback((X,W,le,ye,me)=>{console.log("[MockGrackle] createWorkspace",{name:X,description:W});const He={id:ie("proj"),name:X,description:W||"",repoUrl:le||"",environmentId:ye||"",status:"active",worktreeBasePath:"",useWorktrees:!0,defaultPersonaId:me||"",createdAt:new Date().toISOString(),updatedAt:new Date().toISOString()};m(Ce=>[...Ce,He])},[ie]),wt=x.useCallback(X=>{console.log("[MockGrackle] archiveWorkspace",X),m(W=>W.map(le=>le.id===X?{...le,status:"archived"}:le))},[]),Le=x.useCallback(X=>{console.log("[MockGrackle] loadTasks",X)},[]),xe=x.useCallback((X,W,le,ye,me,He,Ce,yt,et)=>{console.log("[MockGrackle] createTask",{workspaceId:X,title:W,parentTaskId:me}),y(Nt=>{const Ge=Nt.filter(an=>an.workspaceId===X).reduce((an,Ma)=>Math.max(an,Ma.sortOrder),0),Ve=me?Nt.find(an=>an.id===me):void 0;if(me&&!Ve)return console.warn("[MockGrackle] Parent task not found:",me),Nt;if(Ve&&!Ve.canDecompose)return console.warn("[MockGrackle] Parent task does not have decomposition rights:",me),Nt;const Ee=Ve?Ve.depth+1:0,ia={id:ie("task"),workspaceId:X,title:W,description:le||"",status:"not_started",branch:"",latestSessionId:"",dependsOn:ye||[],reviewNotes:void 0,sortOrder:Ge+1,createdAt:new Date().toISOString(),parentTaskId:me||"",depth:Ee,childTaskIds:[],canDecompose:Ce??!me,defaultPersonaId:He||""};return[...Nt,ia]}),yt&&yt()},[ie]),J=x.useCallback((X,W,le,ye)=>{var Nt;console.log("[MockGrackle] startTask",{taskId:X});const me=ee.current.find(bt=>bt.id===X),He=(me==null?void 0:me.title)??"",Ce=ie("sess"),yt={id:Ce,environmentId:"env-local-01",runtime:"claude-code",status:"running",prompt:He||X,startedAt:new Date().toISOString()};i(bt=>[...bt,yt]),y(bt=>bt.map(Ge=>Ge.id===X?{...Ge,status:"working",latestSessionId:Ce,branch:`mock/${X.slice(0,8)}`}:Ge));const et=he();if(console.log(`[MockGrackle] Playing task scenario: ${et.label}`),et.pauseForInput){const bt=et.pauseAfterStep??et.steps.length-1,Ge=et.steps.slice(0,bt+1),Ve=Ge.length>0?Ge[Ge.length-1].delayMs:0;if(de(Ce,Ge),oe(()=>{Z(Ce,"idle"),K({sessionId:Ce,eventType:"status",timestamp:new Date().toISOString(),content:"idle"})},Ve+ny,Ce),et.resumeSteps){const Ee=[...et.resumeSteps];te.current.set(Ce,Ee);const ia=Ee.reduce((an,Ma)=>Math.max(an,Ma.delayMs),0);ne.current.set(Ce,{taskId:X,delayAfterResume:ia+200})}}else{const bt=et.steps.length>0?et.steps[et.steps.length-1].delayMs:0;de(Ce,et.steps);const Ge=(Nt=et.steps[et.steps.length-1])==null?void 0:Nt.event.content;oe(()=>{Ge==="completed"?y(Ve=>Ve.map(Ee=>Ee.id===X&&Ee.status==="working"?{...Ee,status:"paused"}:Ee)):Ge==="failed"&&y(Ve=>Ve.map(Ee=>Ee.id===X&&Ee.status==="working"?{...Ee,status:"failed"}:Ee))},bt+100,Ce)}},[ie,he,de,oe,Z,K]),Ze=x.useCallback((X,W)=>{console.log("[MockGrackle] sendInput",{sessionId:X,text:W}),K({sessionId:X,eventType:"output",timestamp:new Date().toISOString(),content:`User input: ${W}`}),Z(X,"running"),K({sessionId:X,eventType:"status",timestamp:new Date().toISOString(),content:"running"});const le=te.current.get(X);if(le)te.current.delete(X),de(X,le);else{const me=[{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"}}];de(X,me)}const ye=ne.current.get(X);ye&&(ne.current.delete(X),oe(()=>{y(me=>me.map(He=>He.id===ye.taskId&&He.status==="working"?{...He,status:"paused"}:He))},ye.delayAfterResume,X))},[K,Z,de,oe]),we=x.useCallback(X=>{console.log("[MockGrackle] completeTask",X),y(W=>W.map(le=>le.id===X?{...le,status:"complete"}:le))},[]),We=x.useCallback(X=>{console.log("[MockGrackle] resumeTask",X)},[]),ze=x.useCallback((X,W,le,ye,me)=>{console.log("[MockGrackle] updateTask",{taskId:X,title:W}),y(He=>He.map(Ce=>Ce.id===X?{...Ce,title:W.trim()||Ce.title,description:le,dependsOn:ye,...me!==void 0?{defaultPersonaId:me}:{}}:Ce))},[]),At=x.useCallback(X=>{console.log("[MockGrackle] deleteTask",X),y(W=>W.filter(le=>le.id!==X))},[]),Bt=x.useCallback(X=>{console.log("[MockGrackle] loadFindings",X),_(ey.filter(W=>W.workspaceId===X))},[]),Qt=x.useCallback((X,W,le,ye,me)=>{console.log("[MockGrackle] postFinding",{workspaceId:X,title:W});const He={id:ie("find"),workspaceId:X,taskId:"",sessionId:"",category:ye||"general",title:W,content:le,tags:me||[],createdAt:new Date().toISOString()};_(Ce=>[...Ce,He])},[ie]),Je=x.useCallback((X,W,le)=>{console.log("[MockGrackle] addEnvironment",{displayName:X,adapterType:W,adapterConfig:le})},[]),Ie=x.useCallback(()=>{console.log("[MockGrackle] loadTokens")},[]),En=x.useCallback((X,W,le,ye,me)=>{console.log("[MockGrackle] setToken",{name:X,tokenType:le}),E(He=>[...He.filter(yt=>yt.name!==X),{name:X,tokenType:le,envVar:ye,filePath:me,expiresAt:""}])},[]),sa=x.useCallback(X=>{console.log("[MockGrackle] deleteToken",X),E(W=>W.filter(le=>le.name!==X))},[]),Yn=x.useCallback(X=>{console.log("[MockGrackle] updateCredentialProviders",X),A(X)},[]);x.useEffect(()=>()=>{L.current.forEach(clearTimeout),L.current.clear()},[]);const Gs=x.useMemo(()=>({connected:!0,environments:qC,sessions:a,events:l,eventsDropped:0,lastSpawnedId:c,workspaces:p,tasks:g,findings:v,tokens:C,credentialProviders:k,spawn:Y,sendInput:Ze,kill:je,refresh:Re,loadSessionEvents:Te,clearEvents:st,createWorkspace:kt,archiveWorkspace:wt,updateWorkspace:(X,W)=>{console.log("[MockGrackle] updateWorkspace",{workspaceId:X,...W}),m(le=>le.map(ye=>ye.id!==X?ye:{...ye,...W.name!==void 0?{name:W.name}:{},...W.description!==void 0?{description:W.description}:{},...W.repoUrl!==void 0?{repoUrl:W.repoUrl}:{},...W.environmentId!==void 0?{environmentId:W.environmentId}:{},...W.worktreeBasePath!==void 0?{worktreeBasePath:W.worktreeBasePath}:{},...W.useWorktrees!==void 0?{useWorktrees:W.useWorktrees}:{},...W.defaultPersonaId!==void 0?{defaultPersonaId:W.defaultPersonaId}:{},updatedAt:new Date().toISOString()}))},loadTasks:Le,createTask:xe,startTask:J,stopTask:X=>{console.log("[MockGrackle] stopTask",{taskId:X}),we(X)},completeTask:we,resumeTask:We,updateTask:ze,deleteTask:At,loadFindings:Bt,postFinding:Qt,addEnvironment:Je,loadTokens:Ie,setToken:En,deleteToken:sa,updateCredentialProviders:Yn,provisionStatus:{},provisionEnvironment:()=>{},stopEnvironment:()=>{},removeEnvironment:()=>{},codespaces:[],codespaceError:"",codespaceListError:"",codespaceCreating:!1,listCodespaces:()=>{},createCodespace:()=>{},workspaceCreating:!1,taskStartingId:void 0,personas:S,createPersona:(X,W,le,ye,me,He,Ce,yt)=>{console.log("[MockGrackle] createPersona",{name:X});const et={id:`mock-persona-${Date.now()}`,name:X,description:W,systemPrompt:le,toolConfig:"{}",runtime:ye??"claude-code",model:me||"",maxTurns:He||0,mcpServers:"[]",createdAt:new Date().toISOString(),updatedAt:new Date().toISOString(),type:Ce||"agent",script:yt||""};N(Nt=>[...Nt,et])},updatePersona:(X,W,le,ye,me,He,Ce,yt,et)=>{console.log("[MockGrackle] updatePersona",{personaId:X,name:W}),N(Nt=>Nt.map(bt=>bt.id!==X?bt:{...bt,...W!==void 0?{name:W}:{},...le!==void 0?{description:le}:{},...ye!==void 0?{systemPrompt:ye}:{},...me!==void 0?{runtime:me}:{},...He!==void 0?{model:He}:{},...Ce!==void 0?{maxTurns:Ce}:{},...yt!==void 0?{type:yt}:{},...et!==void 0?{script:et}:{},updatedAt:new Date().toISOString()}))},deletePersona:X=>{console.log("[MockGrackle] deletePersona",X),N(W=>W.filter(le=>le.id!==X))},taskSessions:D,loadTaskSessions:X=>{console.log("[MockGrackle] loadTaskSessions",X)},appDefaultPersonaId:H,setAppDefaultPersonaId:X=>{console.log("[MockGrackle] setAppDefaultPersonaId",X),O(X)},onboardingCompleted:!0,completeOnboarding:()=>{console.log("[MockGrackle] completeOnboarding")}}),[a,l,c,p,g,v,C,k,S,D,H,Y,Ze,je,Re,Te,st,kt,wt,Le,xe,J,we,We,ze,At,Bt,Qt,Je,Ie,En,sa,Yn]);return f.jsx(Qf.Provider,{value:Gs,children:n})}const lb=x.createContext(void 0),nE=4e3;function aE({children:n}){const[a,i]=x.useState([]),l=x.useRef(0),r=x.useCallback(d=>{i(p=>p.filter(m=>m.id!==d))},[]),c=x.useCallback((d,p="info",m=nE)=>{const g=`toast-${++l.current}`;i(y=>[...y,{id:g,message:d,variant:p,duration:m}])},[]);return f.jsx(lb.Provider,{value:{toasts:a,showToast:c,dismissToast:r},children:n})}function hl(){const n=x.useContext(lb);if(!n)throw new Error("useToast must be used within ToastProvider");return n}const dc=[{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"]}],rb=new Set(dc.map(n=>n.id)),ay="grackle";function ff(n){return dc.find(a=>a.id===n)}const hf="grackle-theme",cb="grackle-prefer-system",ub="(prefers-color-scheme: dark)";let Yo=[],Pr;function zd(){Pr=void 0;for(const n of Yo)n()}function pf(){return typeof window>"u"?!1:window.matchMedia(ub).matches}function Qo(){if(typeof localStorage>"u")return ay;try{const n=localStorage.getItem(hf);if(n!==null&&rb.has(n))return n}catch{}return ay}function qr(){if(typeof localStorage>"u")return!1;try{return localStorage.getItem(cb)==="true"}catch{return!1}}function mf(n){return dc.find(a=>a.variantLightId===n||a.variantDarkId===n)}function db(n,a){const i=ff(n);if(i!=null&&i.variantDarkId)return a&&i.variantLightId?pf()?i.variantDarkId:i.variantLightId:i.variantDarkId;if(i!=null&&i.hidden&&a){const l=mf(n);if(l!=null&&l.variantLightId&&l.variantDarkId)return pf()?l.variantDarkId:l.variantLightId}return n}function Ni(n,a,i=!1){i&&document.documentElement.classList.add("no-transitions"),document.documentElement.dataset.theme=db(n,a),i&&(document.documentElement.offsetHeight,requestAnimationFrame(()=>{document.documentElement.classList.remove("no-transitions")}))}typeof document<"u"&&Ni(Qo(),qr());function sE(){return Pr===void 0&&(Pr={themeId:Qo(),systemDark:pf(),preferSystem:qr()}),Pr}function iE(n){return Yo=[...Yo,n],()=>{Yo=Yo.filter(a=>a!==n)}}function oE(){const n=x.useSyncExternalStore(iE,sE),{themeId:a,preferSystem:i}=n,l=db(a,i),r=x.useCallback(d=>{if(rb.has(d)){try{localStorage.setItem(hf,d)}catch{}Ni(d,qr(),!0),zd()}},[]),c=x.useCallback(d=>{try{localStorage.setItem(cb,d?"true":"false")}catch{}if(d){const p=Qo(),m=ff(p);if(m!=null&&m.hidden){const g=mf(p);if(g)try{localStorage.setItem(hf,g.id)}catch{}}}Ni(Qo(),d,!0),zd()},[]);return x.useEffect(()=>{Ni(a,i)},[a,i]),x.useEffect(()=>{if(typeof window>"u")return;const d=window.matchMedia(ub),p=()=>{const m=Qo(),g=qr();if(g){const y=ff(m);if(y!=null&&y.variantDarkId&&y.variantLightId&&Ni(m,g),y!=null&&y.hidden){const v=mf(m);v!=null&&v.variantDarkId&&v.variantLightId&&Ni(m,g)}}zd()};return d.addEventListener("change",p),()=>{d.removeEventListener("change",p)}},[]),{themeId:a,setTheme:r,resolvedThemeId:l,preferSystem:i,setPreferSystem:c}}const fb=x.createContext(void 0);function lE({children:n}){const a=oE();return f.jsx(fb.Provider,{value:a,children:n})}function hb(){const n=x.useContext(fb);if(!n)throw new Error("useThemeContext must be used within ThemeProvider");return n}const rE="_container_eix8p_1",cE="_hamburger_eix8p_33",uE="_brand_eix8p_49",dE="_info_eix8p_65",fE="_connectionLabel_eix8p_80",hE="_connectionDot_eix8p_93",pE="_connected_eix8p_96",mE="_disconnected_eix8p_100",gE="_settingsButton_eix8p_104",Ca={container:rE,hamburger:cE,brand:uE,info:dE,connectionLabel:fE,connectionDot:hE,connected:pE,disconnected:mE,settingsButton:gE};function vE({onToggleSidebar:n,sidebarOpen:a}){const{connected:i,environments:l,sessions:r}=Rt(),c=hn(),d=l.length,p=l.filter(g=>g.status==="connected").length,m=r.filter(g=>["running","idle"].includes(g.status)).length;return f.jsxs("div",{className:Ca.container,children:[n&&f.jsx("button",{type:"button",className:Ca.hamburger,onClick:n,"aria-label":"Toggle sidebar","aria-expanded":a,children:"☰"}),f.jsx("button",{type:"button",className:Ca.brand,onClick:()=>c(sl),title:"Home",children:"Grackle"}),f.jsxs("div",{className:Ca.info,children:[f.jsxs("span",{"aria-label":i?"Connected":"Disconnected",children:[f.jsx("span",{className:`${Ca.connectionDot} ${i?Ca.connected:Ca.disconnected}`,"aria-hidden":"true",children:"●"})," ",f.jsx("span",{className:Ca.connectionLabel,"aria-hidden":"true",children:i?"Connected":"Disconnected"})]}),f.jsxs("span",{children:[p,"/",d," env",d!==1?"s":""]}),f.jsxs("span",{children:[m," active"]}),f.jsx("button",{className:Ca.settingsButton,onClick:()=>c(Is),title:"Settings",children:"⚙"})]})]})}const Wf=x.createContext({});function Jf(n){const a=x.useRef(null);return a.current===null&&(a.current=n()),a.current}const fc=x.createContext(null),eh=x.createContext({transformPagePoint:n=>n,isStatic:!1,reducedMotion:"never"});class yE extends x.Component{getSnapshotBeforeUpdate(a){const i=this.props.childRef.current;if(i&&a.isPresent&&!this.props.isPresent){const l=this.props.sizeRef.current;l.height=i.offsetHeight||0,l.width=i.offsetWidth||0,l.top=i.offsetTop,l.left=i.offsetLeft}return null}componentDidUpdate(){}render(){return this.props.children}}function bE({children:n,isPresent:a}){const i=x.useId(),l=x.useRef(null),r=x.useRef({width:0,height:0,top:0,left:0}),{nonce:c}=x.useContext(eh);return x.useInsertionEffect(()=>{const{width:d,height:p,top:m,left:g}=r.current;if(a||!l.current||!d||!p)return;l.current.dataset.motionPopId=i;const y=document.createElement("style");return c&&(y.nonce=c),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]),f.jsx(yE,{isPresent:a,childRef:l,sizeRef:r,children:x.cloneElement(n,{ref:l})})}const xE=({children:n,initial:a,isPresent:i,onExitComplete:l,custom:r,presenceAffectsLayout:c,mode:d})=>{const p=Jf(_E),m=x.useId(),g=x.useCallback(v=>{p.set(v,!0);for(const _ of p.values())if(!_)return;l&&l()},[p,l]),y=x.useMemo(()=>({id:m,initial:a,isPresent:i,custom:r,onExitComplete:g,register:v=>(p.set(v,!1),()=>p.delete(v))}),c?[Math.random(),g]:[i,g]);return x.useMemo(()=>{p.forEach((v,_)=>p.set(_,!1))},[i]),x.useEffect(()=>{!i&&!p.size&&l&&l()},[i]),d==="popLayout"&&(n=f.jsx(bE,{isPresent:i,children:n})),f.jsx(fc.Provider,{value:y,children:n})};function _E(){return new Map}function pb(n=!0){const a=x.useContext(fc);if(a===null)return[!0,null];const{isPresent:i,onExitComplete:l,register:r}=a,c=x.useId();x.useEffect(()=>{n&&r(c)},[n]);const d=x.useCallback(()=>n&&l&&l(c),[c,l,n]);return!i&&l?[!1,d]:[!0]}const Mr=n=>n.key||"";function sy(n){const a=[];return x.Children.forEach(n,i=>{x.isValidElement(i)&&a.push(i)}),a}const th=typeof window<"u",mb=th?x.useLayoutEffect:x.useEffect,Vn=({children:n,custom:a,initial:i=!0,onExitComplete:l,presenceAffectsLayout:r=!0,mode:c="sync",propagate:d=!1})=>{const[p,m]=pb(d),g=x.useMemo(()=>sy(n),[n]),y=d&&!p?[]:g.map(Mr),v=x.useRef(!0),_=x.useRef(g),C=Jf(()=>new Map),[E,k]=x.useState(g),[A,S]=x.useState(g);mb(()=>{v.current=!1,_.current=g;for(let H=0;H<A.length;H++){const O=Mr(A[H]);y.includes(O)?C.delete(O):C.get(O)!==!0&&C.set(O,!1)}},[A,y.length,y.join("-")]);const N=[];if(g!==E){let H=[...g];for(let O=0;O<A.length;O++){const $=A[O],R=Mr($);y.includes(R)||(H.splice(O,0,$),N.push($))}c==="wait"&&N.length&&(H=N),S(sy(H)),k(g);return}const{forceRender:D}=x.useContext(Wf);return f.jsx(f.Fragment,{children:A.map(H=>{const O=Mr(H),$=d&&!p?!1:g===A||y.includes(O),R=()=>{if(C.has(O))C.set(O,!0);else return;let L=!0;C.forEach(G=>{G||(L=!1)}),L&&(D==null||D(),S(_.current),d&&(m==null||m()),l&&l())};return f.jsx(xE,{isPresent:$,initial:!v.current||i?void 0:!1,custom:$?void 0:a,presenceAffectsLayout:r,mode:c,onExitComplete:$?void 0:R,children:H},O)})})},Sn=n=>n;let gb=Sn;const SE={useManualTiming:!1};function TE(n){let a=new Set,i=new Set,l=!1,r=!1;const c=new WeakSet;let d={delta:0,timestamp:0,isProcessing:!1};function p(g){c.has(g)&&(m.schedule(g),n()),g(d)}const m={schedule:(g,y=!1,v=!1)=>{const C=v&&l?a:i;return y&&c.add(g),C.has(g)||C.add(g),g},cancel:g=>{i.delete(g),c.delete(g)},process:g=>{if(d=g,l){r=!0;return}l=!0,[a,i]=[i,a],a.forEach(p),a.clear(),l=!1,r&&(r=!1,m.process(g))}};return m}const Rr=["read","resolveKeyframes","update","preRender","render","postRender"],CE=40;function vb(n,a){let i=!1,l=!0;const r={delta:0,timestamp:0,isProcessing:!1},c=()=>i=!0,d=Rr.reduce((S,N)=>(S[N]=TE(c),S),{}),{read:p,resolveKeyframes:m,update:g,preRender:y,render:v,postRender:_}=d,C=()=>{const S=performance.now();i=!1,r.delta=l?1e3/60:Math.max(Math.min(S-r.timestamp,CE),1),r.timestamp=S,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&&(l=!1,n(C))},E=()=>{i=!0,l=!0,r.isProcessing||n(C)};return{schedule:Rr.reduce((S,N)=>{const D=d[N];return S[N]=(H,O=!1,$=!1)=>(i||E(),D.schedule(H,O,$)),S},{}),cancel:S=>{for(let N=0;N<Rr.length;N++)d[Rr[N]].cancel(S)},state:r,steps:d}}const{schedule:pt,cancel:ls,state:Xt,steps:Vd}=vb(typeof requestAnimationFrame<"u"?requestAnimationFrame:Sn,!0),yb=x.createContext({strict:!1}),iy={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"]},Ui={};for(const n in iy)Ui[n]={isEnabled:a=>iy[n].some(i=>!!a[i])};function EE(n){for(const a in n)Ui[a]={...Ui[a],...n[a]}}const kE=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 Kr(n){return n.startsWith("while")||n.startsWith("drag")&&n!=="draggable"||n.startsWith("layout")||n.startsWith("onTap")||n.startsWith("onPan")||n.startsWith("onLayout")||kE.has(n)}let bb=n=>!Kr(n);function wE(n){n&&(bb=a=>a.startsWith("on")?!Kr(a):n(a))}try{wE(require("@emotion/is-prop-valid").default)}catch{}function AE(n,a,i){const l={};for(const r in n)r==="values"&&typeof n.values=="object"||(bb(r)||i===!0&&Kr(r)||!a&&!Kr(r)||n.draggable&&r.startsWith("onDrag"))&&(l[r]=n[r]);return l}function NE(n){if(typeof Proxy>"u")return n;const a=new Map,i=(...l)=>n(...l);return new Proxy(i,{get:(l,r)=>r==="create"?n:(a.has(r)||a.set(r,n(r)),a.get(r))})}const hc=x.createContext({});function ol(n){return typeof n=="string"||Array.isArray(n)}function pc(n){return n!==null&&typeof n=="object"&&typeof n.start=="function"}const nh=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],ah=["initial",...nh];function mc(n){return pc(n.animate)||ah.some(a=>ol(n[a]))}function xb(n){return!!(mc(n)||n.variants)}function jE(n,a){if(mc(n)){const{initial:i,animate:l}=n;return{initial:i===!1||ol(i)?i:void 0,animate:ol(l)?l:void 0}}return n.inherit!==!1?a:{}}function DE(n){const{initial:a,animate:i}=jE(n,x.useContext(hc));return x.useMemo(()=>({initial:a,animate:i}),[oy(a),oy(i)])}function oy(n){return Array.isArray(n)?n.join(" "):n}const ME=Symbol.for("motionComponentSymbol");function ji(n){return n&&typeof n=="object"&&Object.prototype.hasOwnProperty.call(n,"current")}function RE(n,a,i){return x.useCallback(l=>{l&&n.onMount&&n.onMount(l),a&&(l?a.mount(l):a.unmount()),i&&(typeof i=="function"?i(l):ji(i)&&(i.current=l))},[a])}const sh=n=>n.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase(),BE="framerAppearId",_b="data-"+sh(BE),{schedule:ih}=vb(queueMicrotask,!1),Sb=x.createContext({});function OE(n,a,i,l,r){var c,d;const{visualElement:p}=x.useContext(hc),m=x.useContext(yb),g=x.useContext(fc),y=x.useContext(eh).reducedMotion,v=x.useRef(null);l=l||m.renderer,!v.current&&l&&(v.current=l(n,{visualState:a,parent:p,props:i,presenceContext:g,blockInitialAnimation:g?g.initial===!1:!1,reducedMotionConfig:y}));const _=v.current,C=x.useContext(Sb);_&&!_.projection&&r&&(_.type==="html"||_.type==="svg")&&LE(v.current,i,r,C);const E=x.useRef(!1);x.useInsertionEffect(()=>{_&&E.current&&_.update(i,g)});const k=i[_b],A=x.useRef(!!k&&!(!((c=window.MotionHandoffIsComplete)===null||c===void 0)&&c.call(window,k))&&((d=window.MotionHasOptimisedAnimation)===null||d===void 0?void 0:d.call(window,k)));return mb(()=>{_&&(E.current=!0,window.MotionIsMounted=!0,_.updateFeatures(),ih.render(_.render),A.current&&_.animationState&&_.animationState.animateChanges())}),x.useEffect(()=>{_&&(!A.current&&_.animationState&&_.animationState.animateChanges(),A.current&&(queueMicrotask(()=>{var S;(S=window.MotionHandoffMarkAsComplete)===null||S===void 0||S.call(window,k)}),A.current=!1))}),_}function LE(n,a,i,l){const{layoutId:r,layout:c,drag:d,dragConstraints:p,layoutScroll:m,layoutRoot:g}=a;n.projection=new i(n.latestValues,a["data-framer-portal-id"]?void 0:Tb(n.parent)),n.projection.setOptions({layoutId:r,layout:c,alwaysMeasureLayout:!!d||p&&ji(p),visualElement:n,animationType:typeof c=="string"?c:"both",initialPromotionConfig:l,layoutScroll:m,layoutRoot:g})}function Tb(n){if(n)return n.options.allowProjection!==!1?n.projection:Tb(n.parent)}function IE({preloadedFeatures:n,createVisualElement:a,useRender:i,useVisualState:l,Component:r}){var c,d;n&&EE(n);function p(g,y){let v;const _={...x.useContext(eh),...g,layoutId:UE(g)},{isStatic:C}=_,E=DE(g),k=l(g,C);if(!C&&th){zE();const A=VE(_);v=A.MeasureLayout,E.visualElement=OE(r,k,_,a,A.ProjectionNode)}return f.jsxs(hc.Provider,{value:E,children:[v&&E.visualElement?f.jsx(v,{visualElement:E.visualElement,..._}):null,i(r,g,RE(k,E.visualElement,y),k,C,E.visualElement)]})}p.displayName=`motion.${typeof r=="string"?r:`create(${(d=(c=r.displayName)!==null&&c!==void 0?c:r.name)!==null&&d!==void 0?d:""})`}`;const m=x.forwardRef(p);return m[ME]=r,m}function UE({layoutId:n}){const a=x.useContext(Wf).id;return a&&n!==void 0?a+"-"+n:n}function zE(n,a){x.useContext(yb).strict}function VE(n){const{drag:a,layout:i}=Ui;if(!a&&!i)return{};const l={...a,...i};return{MeasureLayout:a!=null&&a.isEnabled(n)||i!=null&&i.isEnabled(n)?l.MeasureLayout:void 0,ProjectionNode:l.ProjectionNode}}const HE=["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 oh(n){return typeof n!="string"||n.includes("-")?!1:!!(HE.indexOf(n)>-1||/[A-Z]/u.test(n))}function ly(n){const a=[{},{}];return n==null||n.values.forEach((i,l)=>{a[0][l]=i.get(),a[1][l]=i.getVelocity()}),a}function lh(n,a,i,l){if(typeof a=="function"){const[r,c]=ly(l);a=a(i!==void 0?i:n.custom,r,c)}if(typeof a=="string"&&(a=n.variants&&n.variants[a]),typeof a=="function"){const[r,c]=ly(l);a=a(i!==void 0?i:n.custom,r,c)}return a}const gf=n=>Array.isArray(n),GE=n=>!!(n&&typeof n=="object"&&n.mix&&n.toValue),PE=n=>gf(n)?n[n.length-1]||0:n,Jt=n=>!!(n&&n.getVelocity);function $r(n){const a=Jt(n)?n.get():n;return GE(a)?a.toValue():a}function $E({scrapeMotionValuesFromProps:n,createRenderState:a,onUpdate:i},l,r,c){const d={latestValues:FE(l,r,c,n),renderState:a()};return i&&(d.onMount=p=>i({props:l,current:p,...d}),d.onUpdate=p=>i(p)),d}const Cb=n=>(a,i)=>{const l=x.useContext(hc),r=x.useContext(fc),c=()=>$E(n,a,l,r);return i?c():Jf(c)};function FE(n,a,i,l){const r={},c=l(n,{});for(const _ in c)r[_]=$r(c[_]);let{initial:d,animate:p}=n;const m=mc(n),g=xb(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"&&!pc(v)){const _=Array.isArray(v)?v:[v];for(let C=0;C<_.length;C++){const E=lh(n,_[C]);if(E){const{transitionEnd:k,transition:A,...S}=E;for(const N in S){let D=S[N];if(Array.isArray(D)){const H=y?D.length-1:0;D=D[H]}D!==null&&(r[N]=D)}for(const N in k)r[N]=k[N]}}}return r}const $i=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],Hs=new Set($i),Eb=n=>a=>typeof a=="string"&&a.startsWith(n),kb=Eb("--"),YE=Eb("var(--"),rh=n=>YE(n)?qE.test(n.split("/*")[0].trim()):!1,qE=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu,wb=(n,a)=>a&&typeof n=="number"?a.transform(n):n,ja=(n,a,i)=>i>a?a:i<n?n:i,Fi={test:n=>typeof n=="number",parse:parseFloat,transform:n=>n},ll={...Fi,transform:n=>ja(0,1,n)},Br={...Fi,default:1},pl=n=>({test:a=>typeof a=="string"&&a.endsWith(n)&&a.split(" ").length===1,parse:parseFloat,transform:a=>`${a}${n}`}),as=pl("deg"),na=pl("%"),ve=pl("px"),KE=pl("vh"),ZE=pl("vw"),ry={...na,parse:n=>na.parse(n)/100,transform:n=>na.transform(n*100)},XE={borderWidth:ve,borderTopWidth:ve,borderRightWidth:ve,borderBottomWidth:ve,borderLeftWidth:ve,borderRadius:ve,radius:ve,borderTopLeftRadius:ve,borderTopRightRadius:ve,borderBottomRightRadius:ve,borderBottomLeftRadius:ve,width:ve,maxWidth:ve,height:ve,maxHeight:ve,top:ve,right:ve,bottom:ve,left:ve,padding:ve,paddingTop:ve,paddingRight:ve,paddingBottom:ve,paddingLeft:ve,margin:ve,marginTop:ve,marginRight:ve,marginBottom:ve,marginLeft:ve,backgroundPositionX:ve,backgroundPositionY:ve},QE={rotate:as,rotateX:as,rotateY:as,rotateZ:as,scale:Br,scaleX:Br,scaleY:Br,scaleZ:Br,skew:as,skewX:as,skewY:as,distance:ve,translateX:ve,translateY:ve,translateZ:ve,x:ve,y:ve,z:ve,perspective:ve,transformPerspective:ve,opacity:ll,originX:ry,originY:ry,originZ:ve},cy={...Fi,transform:Math.round},ch={...XE,...QE,zIndex:cy,size:ve,fillOpacity:ll,strokeOpacity:ll,numOctaves:cy},WE={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},JE=$i.length;function ek(n,a,i){let l="",r=!0;for(let c=0;c<JE;c++){const d=$i[c],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=wb(p,ch[d]);if(!m){r=!1;const y=WE[d]||d;l+=`${y}(${g}) `}i&&(a[d]=g)}}return l=l.trim(),i?l=i(a,r?"":l):r&&(l="none"),l}function uh(n,a,i){const{style:l,vars:r,transformOrigin:c}=n;let d=!1,p=!1;for(const m in a){const g=a[m];if(Hs.has(m)){d=!0;continue}else if(kb(m)){r[m]=g;continue}else{const y=wb(g,ch[m]);m.startsWith("origin")?(p=!0,c[m]=y):l[m]=y}}if(a.transform||(d||i?l.transform=ek(a,n.transform,i):l.transform&&(l.transform="none")),p){const{originX:m="50%",originY:g="50%",originZ:y=0}=c;l.transformOrigin=`${m} ${g} ${y}`}}const tk={offset:"stroke-dashoffset",array:"stroke-dasharray"},nk={offset:"strokeDashoffset",array:"strokeDasharray"};function ak(n,a,i=1,l=0,r=!0){n.pathLength=1;const c=r?tk:nk;n[c.offset]=ve.transform(-l);const d=ve.transform(a),p=ve.transform(i);n[c.array]=`${d} ${p}`}function uy(n,a,i){return typeof n=="string"?n:ve.transform(a+i*n)}function sk(n,a,i){const l=uy(a,n.x,n.width),r=uy(i,n.y,n.height);return`${l} ${r}`}function dh(n,{attrX:a,attrY:i,attrScale:l,originX:r,originY:c,pathLength:d,pathSpacing:p=1,pathOffset:m=0,...g},y,v){if(uh(n,g,v),y){n.style.viewBox&&(n.attrs.viewBox=n.style.viewBox);return}n.attrs=n.style,n.style={};const{attrs:_,style:C,dimensions:E}=n;_.transform&&(E&&(C.transform=_.transform),delete _.transform),E&&(r!==void 0||c!==void 0||C.transform)&&(C.transformOrigin=sk(E,r!==void 0?r:.5,c!==void 0?c:.5)),a!==void 0&&(_.x=a),i!==void 0&&(_.y=i),l!==void 0&&(_.scale=l),d!==void 0&&ak(_,d,p,m,!1)}const fh=()=>({style:{},transform:{},transformOrigin:{},vars:{}}),Ab=()=>({...fh(),attrs:{}}),hh=n=>typeof n=="string"&&n.toLowerCase()==="svg";function Nb(n,{style:a,vars:i},l,r){Object.assign(n.style,a,r&&r.getProjectionStyles(l));for(const c in i)n.style.setProperty(c,i[c])}const jb=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 Db(n,a,i,l){Nb(n,a,void 0,l);for(const r in a.attrs)n.setAttribute(jb.has(r)?r:sh(r),a.attrs[r])}const Zr={};function ik(n){Object.assign(Zr,n)}function Mb(n,{layout:a,layoutId:i}){return Hs.has(n)||n.startsWith("origin")||(a||i!==void 0)&&(!!Zr[n]||n==="opacity")}function ph(n,a,i){var l;const{style:r}=n,c={};for(const d in r)(Jt(r[d])||a.style&&Jt(a.style[d])||Mb(d,n)||((l=i==null?void 0:i.getValue(d))===null||l===void 0?void 0:l.liveStyle)!==void 0)&&(c[d]=r[d]);return c}function Rb(n,a,i){const l=ph(n,a,i);for(const r in n)if(Jt(n[r])||Jt(a[r])){const c=$i.indexOf(r)!==-1?"attr"+r.charAt(0).toUpperCase()+r.substring(1):r;l[c]=n[r]}return l}function ok(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 dy=["x","y","width","height","cx","cy","r"],lk={useVisualState:Cb({scrapeMotionValuesFromProps:Rb,createRenderState:Ab,onUpdate:({props:n,prevProps:a,current:i,renderState:l,latestValues:r})=>{if(!i)return;let c=!!n.drag;if(!c){for(const p in r)if(Hs.has(p)){c=!0;break}}if(!c)return;let d=!a;if(a)for(let p=0;p<dy.length;p++){const m=dy[p];n[m]!==a[m]&&(d=!0)}d&&pt.read(()=>{ok(i,l),pt.render(()=>{dh(l,r,hh(i.tagName),n.transformTemplate),Db(i,l)})})}})},rk={useVisualState:Cb({scrapeMotionValuesFromProps:ph,createRenderState:fh})};function Bb(n,a,i){for(const l in a)!Jt(a[l])&&!Mb(l,i)&&(n[l]=a[l])}function ck({transformTemplate:n},a){return x.useMemo(()=>{const i=fh();return uh(i,a,n),Object.assign({},i.vars,i.style)},[a])}function uk(n,a){const i=n.style||{},l={};return Bb(l,i,n),Object.assign(l,ck(n,a)),l}function dk(n,a){const i={},l=uk(n,a);return n.drag&&n.dragListener!==!1&&(i.draggable=!1,l.userSelect=l.WebkitUserSelect=l.WebkitTouchCallout="none",l.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=l,i}function fk(n,a,i,l){const r=x.useMemo(()=>{const c=Ab();return dh(c,a,hh(l),n.transformTemplate),{...c.attrs,style:{...c.style}}},[a]);if(n.style){const c={};Bb(c,n.style,n),r.style={...c,...r.style}}return r}function hk(n=!1){return(i,l,r,{latestValues:c},d)=>{const m=(oh(i)?fk:dk)(l,c,d,i),g=AE(l,typeof i=="string",n),y=i!==x.Fragment?{...g,...m,ref:r}:{},{children:v}=l,_=x.useMemo(()=>Jt(v)?v.get():v,[v]);return x.createElement(i,{...y,children:_})}}function pk(n,a){return function(l,{forwardMotionProps:r}={forwardMotionProps:!1}){const d={...oh(l)?lk:rk,preloadedFeatures:n,useRender:hk(r),createVisualElement:a,Component:l};return IE(d)}}function Ob(n,a){if(!Array.isArray(a))return!1;const i=a.length;if(i!==n.length)return!1;for(let l=0;l<i;l++)if(a[l]!==n[l])return!1;return!0}function gc(n,a,i){const l=n.getProps();return lh(l,a,i!==void 0?i:l.custom,n)}function mh(n,a){return n?n[a]||n.default||n:void 0}const Lb=new Set(["width","height","top","left","right","bottom",...$i]);let Fr;function mk(){Fr=void 0}const aa={now:()=>(Fr===void 0&&aa.set(Xt.isProcessing||SE.useManualTiming?Xt.timestamp:performance.now()),Fr),set:n=>{Fr=n,queueMicrotask(mk)}};function gh(n,a){n.indexOf(a)===-1&&n.push(a)}function vh(n,a){const i=n.indexOf(a);i>-1&&n.splice(i,1)}class yh{constructor(){this.subscriptions=[]}add(a){return gh(this.subscriptions,a),()=>vh(this.subscriptions,a)}notify(a,i,l){const r=this.subscriptions.length;if(r)if(r===1)this.subscriptions[0](a,i,l);else for(let c=0;c<r;c++){const d=this.subscriptions[c];d&&d(a,i,l)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}function Ib(n,a){return a?n*(1e3/a):0}const fy=30,gk=n=>!isNaN(parseFloat(n));class vk{constructor(a,i={}){this.version="11.18.2",this.canTrackVelocity=null,this.events={},this.updateAndNotify=(l,r=!0)=>{const c=aa.now();this.updatedAt!==c&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(l),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=aa.now(),this.canTrackVelocity===null&&a!==void 0&&(this.canTrackVelocity=gk(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 yh);const l=this.events[a].add(i);return a==="change"?()=>{l(),pt.read(()=>{this.events.change.getSize()||this.stop()})}:l}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,l){this.set(i),this.prev=void 0,this.prevFrameValue=a,this.prevUpdatedAt=this.updatedAt-l}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=aa.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||a-this.updatedAt>fy)return 0;const i=Math.min(this.updatedAt-this.prevUpdatedAt,fy);return Ib(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 rl(n,a){return new vk(n,a)}function yk(n,a,i){n.hasValue(a)?n.getValue(a).set(i):n.addValue(a,rl(i))}function bk(n,a){const i=gc(n,a);let{transitionEnd:l={},transition:r={},...c}=i||{};c={...c,...l};for(const d in c){const p=PE(c[d]);yk(n,d,p)}}function xk(n){return!!(Jt(n)&&n.add)}function vf(n,a){const i=n.getValue("willChange");if(xk(i))return i.add(a)}function Ub(n){return n.props[_b]}function bh(n){let a;return()=>(a===void 0&&(a=n()),a)}const _k=bh(()=>window.ScrollTimeline!==void 0);class Sk{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 l=0;l<this.animations.length;l++)this.animations[l][a]=i}attachTimeline(a,i){const l=this.animations.map(r=>{if(_k()&&r.attachTimeline)return r.attachTimeline(a);if(typeof i=="function")return i(r)});return()=>{l.forEach((r,c)=>{r&&r(),this.animations[c].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 Tk extends Sk{then(a,i){return Promise.all(this.animations).then(a).catch(i)}}const ka=n=>n*1e3,wa=n=>n/1e3;function xh(n){return typeof n=="function"}function hy(n,a){n.timeline=a,n.onfinish=null}const _h=n=>Array.isArray(n)&&typeof n[0]=="number",Ck={linearEasing:void 0};function Ek(n,a){const i=bh(n);return()=>{var l;return(l=Ck[a])!==null&&l!==void 0?l:i()}}const Xr=Ek(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),zi=(n,a,i)=>{const l=a-n;return l===0?1:(i-n)/l},zb=(n,a,i=10)=>{let l="";const r=Math.max(Math.round(a/i),2);for(let c=0;c<r;c++)l+=n(zi(0,r-1,c))+", ";return`linear(${l.substring(0,l.length-2)})`};function Vb(n){return!!(typeof n=="function"&&Xr()||!n||typeof n=="string"&&(n in yf||Xr())||_h(n)||Array.isArray(n)&&n.every(Vb))}const qo=([n,a,i,l])=>`cubic-bezier(${n}, ${a}, ${i}, ${l})`,yf={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:qo([0,.65,.55,1]),circOut:qo([.55,0,1,.45]),backIn:qo([.31,.01,.66,-.59]),backOut:qo([.33,1.53,.69,.99])};function Hb(n,a){if(n)return typeof n=="function"&&Xr()?zb(n,a):_h(n)?qo(n):Array.isArray(n)?n.map(i=>Hb(i,a)||yf.easeOut):yf[n]}const Gb=(n,a,i)=>(((1-3*i+3*a)*n+(3*i-6*a))*n+3*a)*n,kk=1e-7,wk=12;function Ak(n,a,i,l,r){let c,d,p=0;do d=a+(i-a)/2,c=Gb(d,l,r)-n,c>0?i=d:a=d;while(Math.abs(c)>kk&&++p<wk);return d}function ml(n,a,i,l){if(n===a&&i===l)return Sn;const r=c=>Ak(c,0,1,n,i);return c=>c===0||c===1?c:Gb(r(c),a,l)}const Pb=n=>a=>a<=.5?n(2*a)/2:(2-n(2*(1-a)))/2,$b=n=>a=>1-n(1-a),Fb=ml(.33,1.53,.69,.99),Sh=$b(Fb),Yb=Pb(Sh),qb=n=>(n*=2)<1?.5*Sh(n):.5*(2-Math.pow(2,-10*(n-1))),Th=n=>1-Math.sin(Math.acos(n)),Kb=$b(Th),Zb=Pb(Th),Xb=n=>/^0[^.\s]+$/u.test(n);function Nk(n){return typeof n=="number"?n===0:n!==null?n==="none"||n==="0"||Xb(n):!0}const Wo=n=>Math.round(n*1e5)/1e5,Ch=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function jk(n){return n==null}const Dk=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,Eh=(n,a)=>i=>!!(typeof i=="string"&&Dk.test(i)&&i.startsWith(n)||a&&!jk(i)&&Object.prototype.hasOwnProperty.call(i,a)),Qb=(n,a,i)=>l=>{if(typeof l!="string")return l;const[r,c,d,p]=l.match(Ch);return{[n]:parseFloat(r),[a]:parseFloat(c),[i]:parseFloat(d),alpha:p!==void 0?parseFloat(p):1}},Mk=n=>ja(0,255,n),Hd={...Fi,transform:n=>Math.round(Mk(n))},Os={test:Eh("rgb","red"),parse:Qb("red","green","blue"),transform:({red:n,green:a,blue:i,alpha:l=1})=>"rgba("+Hd.transform(n)+", "+Hd.transform(a)+", "+Hd.transform(i)+", "+Wo(ll.transform(l))+")"};function Rk(n){let a="",i="",l="",r="";return n.length>5?(a=n.substring(1,3),i=n.substring(3,5),l=n.substring(5,7),r=n.substring(7,9)):(a=n.substring(1,2),i=n.substring(2,3),l=n.substring(3,4),r=n.substring(4,5),a+=a,i+=i,l+=l,r+=r),{red:parseInt(a,16),green:parseInt(i,16),blue:parseInt(l,16),alpha:r?parseInt(r,16)/255:1}}const bf={test:Eh("#"),parse:Rk,transform:Os.transform},Di={test:Eh("hsl","hue"),parse:Qb("hue","saturation","lightness"),transform:({hue:n,saturation:a,lightness:i,alpha:l=1})=>"hsla("+Math.round(n)+", "+na.transform(Wo(a))+", "+na.transform(Wo(i))+", "+Wo(ll.transform(l))+")"},Wt={test:n=>Os.test(n)||bf.test(n)||Di.test(n),parse:n=>Os.test(n)?Os.parse(n):Di.test(n)?Di.parse(n):bf.parse(n),transform:n=>typeof n=="string"?n:n.hasOwnProperty("red")?Os.transform(n):Di.transform(n)},Bk=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function Ok(n){var a,i;return isNaN(n)&&typeof n=="string"&&(((a=n.match(Ch))===null||a===void 0?void 0:a.length)||0)+(((i=n.match(Bk))===null||i===void 0?void 0:i.length)||0)>0}const Wb="number",Jb="color",Lk="var",Ik="var(",py="${}",Uk=/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 cl(n){const a=n.toString(),i=[],l={color:[],number:[],var:[]},r=[];let c=0;const p=a.replace(Uk,m=>(Wt.test(m)?(l.color.push(c),r.push(Jb),i.push(Wt.parse(m))):m.startsWith(Ik)?(l.var.push(c),r.push(Lk),i.push(m)):(l.number.push(c),r.push(Wb),i.push(parseFloat(m))),++c,py)).split(py);return{values:i,split:p,indexes:l,types:r}}function ex(n){return cl(n).values}function tx(n){const{split:a,types:i}=cl(n),l=a.length;return r=>{let c="";for(let d=0;d<l;d++)if(c+=a[d],r[d]!==void 0){const p=i[d];p===Wb?c+=Wo(r[d]):p===Jb?c+=Wt.transform(r[d]):c+=r[d]}return c}}const zk=n=>typeof n=="number"?0:n;function Vk(n){const a=ex(n);return tx(n)(a.map(zk))}const rs={test:Ok,parse:ex,createTransformer:tx,getAnimatableNone:Vk},Hk=new Set(["brightness","contrast","saturate","opacity"]);function Gk(n){const[a,i]=n.slice(0,-1).split("(");if(a==="drop-shadow")return n;const[l]=i.match(Ch)||[];if(!l)return n;const r=i.replace(l,"");let c=Hk.has(a)?1:0;return l!==i&&(c*=100),a+"("+c+r+")"}const Pk=/\b([a-z-]*)\(.*?\)/gu,xf={...rs,getAnimatableNone:n=>{const a=n.match(Pk);return a?a.map(Gk).join(" "):n}},$k={...ch,color:Wt,backgroundColor:Wt,outlineColor:Wt,fill:Wt,stroke:Wt,borderColor:Wt,borderTopColor:Wt,borderRightColor:Wt,borderBottomColor:Wt,borderLeftColor:Wt,filter:xf,WebkitFilter:xf},kh=n=>$k[n];function nx(n,a){let i=kh(n);return i!==xf&&(i=rs),i.getAnimatableNone?i.getAnimatableNone(a):void 0}const Fk=new Set(["auto","none","0"]);function Yk(n,a,i){let l=0,r;for(;l<n.length&&!r;){const c=n[l];typeof c=="string"&&!Fk.has(c)&&cl(c).values.length&&(r=n[l]),l++}if(r&&i)for(const c of a)n[c]=nx(i,r)}const my=n=>n===Fi||n===ve,gy=(n,a)=>parseFloat(n.split(", ")[a]),vy=(n,a)=>(i,{transform:l})=>{if(l==="none"||!l)return 0;const r=l.match(/^matrix3d\((.+)\)$/u);if(r)return gy(r[1],a);{const c=l.match(/^matrix\((.+)\)$/u);return c?gy(c[1],n):0}},qk=new Set(["x","y","z"]),Kk=$i.filter(n=>!qk.has(n));function Zk(n){const a=[];return Kk.forEach(i=>{const l=n.getValue(i);l!==void 0&&(a.push([i,l.get()]),l.set(i.startsWith("scale")?1:0))}),a}const Vi={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:vy(4,13),y:vy(5,14)};Vi.translateX=Vi.x;Vi.translateY=Vi.y;const Us=new Set;let _f=!1,Sf=!1;function ax(){if(Sf){const n=Array.from(Us).filter(l=>l.needsMeasurement),a=new Set(n.map(l=>l.element)),i=new Map;a.forEach(l=>{const r=Zk(l);r.length&&(i.set(l,r),l.render())}),n.forEach(l=>l.measureInitialState()),a.forEach(l=>{l.render();const r=i.get(l);r&&r.forEach(([c,d])=>{var p;(p=l.getValue(c))===null||p===void 0||p.set(d)})}),n.forEach(l=>l.measureEndState()),n.forEach(l=>{l.suspendedScrollY!==void 0&&window.scrollTo(0,l.suspendedScrollY)})}Sf=!1,_f=!1,Us.forEach(n=>n.complete()),Us.clear()}function sx(){Us.forEach(n=>{n.readKeyframes(),n.needsMeasurement&&(Sf=!0)})}function Xk(){sx(),ax()}class wh{constructor(a,i,l,r,c,d=!1){this.isComplete=!1,this.isAsync=!1,this.needsMeasurement=!1,this.isScheduled=!1,this.unresolvedKeyframes=[...a],this.onComplete=i,this.name=l,this.motionValue=r,this.element=c,this.isAsync=d}scheduleResolve(){this.isScheduled=!0,this.isAsync?(Us.add(this),_f||(_f=!0,pt.read(sx),pt.resolveKeyframes(ax))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:a,name:i,element:l,motionValue:r}=this;for(let c=0;c<a.length;c++)if(a[c]===null)if(c===0){const d=r==null?void 0:r.get(),p=a[a.length-1];if(d!==void 0)a[0]=d;else if(l&&i){const m=l.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[c]=a[c-1]}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(){this.isComplete=!0,this.onComplete(this.unresolvedKeyframes,this.finalKeyframe),Us.delete(this)}cancel(){this.isComplete||(this.isScheduled=!1,Us.delete(this))}resume(){this.isComplete||this.scheduleResolve()}}const ix=n=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(n),Qk=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function Wk(n){const a=Qk.exec(n);if(!a)return[,];const[,i,l,r]=a;return[`--${i??l}`,r]}function ox(n,a,i=1){const[l,r]=Wk(n);if(!l)return;const c=window.getComputedStyle(a).getPropertyValue(l);if(c){const d=c.trim();return ix(d)?parseFloat(d):d}return rh(r)?ox(r,a,i+1):r}const lx=n=>a=>a.test(n),Jk={test:n=>n==="auto",parse:n=>n},rx=[Fi,ve,na,as,ZE,KE,Jk],yy=n=>rx.find(lx(n));class cx extends wh{constructor(a,i,l,r,c){super(a,i,l,r,c,!0)}readKeyframes(){const{unresolvedKeyframes:a,element:i,name:l}=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(),rh(g))){const y=ox(g,i.current);y!==void 0&&(a[m]=y),m===a.length-1&&(this.finalKeyframe=g)}}if(this.resolveNoneKeyframes(),!Lb.has(l)||a.length!==2)return;const[r,c]=a,d=yy(r),p=yy(c);if(d!==p)if(my(d)&&my(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,l=[];for(let r=0;r<a.length;r++)Nk(a[r])&&l.push(r);l.length&&Yk(a,l,i)}measureInitialState(){const{element:a,unresolvedKeyframes:i,name:l}=this;if(!a||!a.current)return;l==="height"&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=Vi[l](a.measureViewportBox(),window.getComputedStyle(a.current)),i[0]=this.measuredOrigin;const r=i[i.length-1];r!==void 0&&a.getValue(l,r).jump(r,!1)}measureEndState(){var a;const{element:i,name:l,unresolvedKeyframes:r}=this;if(!i||!i.current)return;const c=i.getValue(l);c&&c.jump(this.measuredOrigin,!1);const d=r.length-1,p=r[d];r[d]=Vi[l](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 by=(n,a)=>a==="zIndex"?!1:!!(typeof n=="number"||Array.isArray(n)||typeof n=="string"&&(rs.test(n)||n==="0")&&!n.startsWith("url("));function ew(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 tw(n,a,i,l){const r=n[0];if(r===null)return!1;if(a==="display"||a==="visibility")return!0;const c=n[n.length-1],d=by(r,a),p=by(c,a);return!d||!p?!1:ew(n)||(i==="spring"||xh(i))&&l}const nw=n=>n!==null;function vc(n,{repeat:a,repeatType:i="loop"},l){const r=n.filter(nw),c=a&&i!=="loop"&&a%2===1?0:r.length-1;return!c||l===void 0?r[c]:l}const aw=40;class ux{constructor({autoplay:a=!0,delay:i=0,type:l="keyframes",repeat:r=0,repeatDelay:c=0,repeatType:d="loop",...p}){this.isStopped=!1,this.hasAttemptedResolve=!1,this.createdAt=aa.now(),this.options={autoplay:a,delay:i,type:l,repeat:r,repeatDelay:c,repeatType:d,...p},this.updateFinishedPromise()}calcStartTime(){return this.resolvedAt?this.resolvedAt-this.createdAt>aw?this.resolvedAt:this.createdAt:this.createdAt}get resolved(){return!this._resolved&&!this.hasAttemptedResolve&&Xk(),this._resolved}onKeyframesResolved(a,i){this.resolvedAt=aa.now(),this.hasAttemptedResolve=!0;const{name:l,type:r,velocity:c,delay:d,onComplete:p,onUpdate:m,isGenerator:g}=this.options;if(!g&&!tw(a,l,r,c))if(d)this.options.duration=0;else{m&&m(vc(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 Tf=2e4;function dx(n){let a=0;const i=50;let l=n.next(a);for(;!l.done&&a<Tf;)a+=i,l=n.next(a);return a>=Tf?1/0:a}const xt=(n,a,i)=>n+(a-n)*i;function Gd(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 sw({hue:n,saturation:a,lightness:i,alpha:l}){n/=360,a/=100,i/=100;let r=0,c=0,d=0;if(!a)r=c=d=i;else{const p=i<.5?i*(1+a):i+a-i*a,m=2*i-p;r=Gd(m,p,n+1/3),c=Gd(m,p,n),d=Gd(m,p,n-1/3)}return{red:Math.round(r*255),green:Math.round(c*255),blue:Math.round(d*255),alpha:l}}function Qr(n,a){return i=>i>0?a:n}const Pd=(n,a,i)=>{const l=n*n,r=i*(a*a-l)+l;return r<0?0:Math.sqrt(r)},iw=[bf,Os,Di],ow=n=>iw.find(a=>a.test(n));function xy(n){const a=ow(n);if(!a)return!1;let i=a.parse(n);return a===Di&&(i=sw(i)),i}const _y=(n,a)=>{const i=xy(n),l=xy(a);if(!i||!l)return Qr(n,a);const r={...i};return c=>(r.red=Pd(i.red,l.red,c),r.green=Pd(i.green,l.green,c),r.blue=Pd(i.blue,l.blue,c),r.alpha=xt(i.alpha,l.alpha,c),Os.transform(r))},lw=(n,a)=>i=>a(n(i)),gl=(...n)=>n.reduce(lw),Cf=new Set(["none","hidden"]);function rw(n,a){return Cf.has(n)?i=>i<=0?n:a:i=>i>=1?a:n}function cw(n,a){return i=>xt(n,a,i)}function Ah(n){return typeof n=="number"?cw:typeof n=="string"?rh(n)?Qr:Wt.test(n)?_y:fw:Array.isArray(n)?fx:typeof n=="object"?Wt.test(n)?_y:uw:Qr}function fx(n,a){const i=[...n],l=i.length,r=n.map((c,d)=>Ah(c)(c,a[d]));return c=>{for(let d=0;d<l;d++)i[d]=r[d](c);return i}}function uw(n,a){const i={...n,...a},l={};for(const r in i)n[r]!==void 0&&a[r]!==void 0&&(l[r]=Ah(n[r])(n[r],a[r]));return r=>{for(const c in l)i[c]=l[c](r);return i}}function dw(n,a){var i;const l=[],r={color:0,var:0,number:0};for(let c=0;c<a.values.length;c++){const d=a.types[c],p=n.indexes[d][r[d]],m=(i=n.values[p])!==null&&i!==void 0?i:0;l[c]=m,r[d]++}return l}const fw=(n,a)=>{const i=rs.createTransformer(a),l=cl(n),r=cl(a);return l.indexes.var.length===r.indexes.var.length&&l.indexes.color.length===r.indexes.color.length&&l.indexes.number.length>=r.indexes.number.length?Cf.has(n)&&!r.values.length||Cf.has(a)&&!l.values.length?rw(n,a):gl(fx(dw(l,r),r.values),i):Qr(n,a)};function hx(n,a,i){return typeof n=="number"&&typeof a=="number"&&typeof i=="number"?xt(n,a,i):Ah(n)(n,a)}const hw=5;function px(n,a,i){const l=Math.max(a-hw,0);return Ib(i-n(l),a-l)}const Ct={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},$d=.001;function pw({duration:n=Ct.duration,bounce:a=Ct.bounce,velocity:i=Ct.velocity,mass:l=Ct.mass}){let r,c,d=1-a;d=ja(Ct.minDamping,Ct.maxDamping,d),n=ja(Ct.minDuration,Ct.maxDuration,wa(n)),d<1?(r=g=>{const y=g*d,v=y*n,_=y-i,C=Ef(g,d),E=Math.exp(-v);return $d-_/C*E},c=g=>{const v=g*d*n,_=v*i+i,C=Math.pow(d,2)*Math.pow(g,2)*n,E=Math.exp(-v),k=Ef(Math.pow(g,2),d);return(-r(g)+$d>0?-1:1)*((_-C)*E)/k}):(r=g=>{const y=Math.exp(-g*n),v=(g-i)*n+1;return-$d+y*v},c=g=>{const y=Math.exp(-g*n),v=(i-g)*(n*n);return y*v});const p=5/n,m=gw(r,c,p);if(n=ka(n),isNaN(m))return{stiffness:Ct.stiffness,damping:Ct.damping,duration:n};{const g=Math.pow(m,2)*l;return{stiffness:g,damping:d*2*Math.sqrt(l*g),duration:n}}}const mw=12;function gw(n,a,i){let l=i;for(let r=1;r<mw;r++)l=l-n(l)/a(l);return l}function Ef(n,a){return n*Math.sqrt(1-a*a)}const vw=["duration","bounce"],yw=["stiffness","damping","mass"];function Sy(n,a){return a.some(i=>n[i]!==void 0)}function bw(n){let a={velocity:Ct.velocity,stiffness:Ct.stiffness,damping:Ct.damping,mass:Ct.mass,isResolvedFromDuration:!1,...n};if(!Sy(n,yw)&&Sy(n,vw))if(n.visualDuration){const i=n.visualDuration,l=2*Math.PI/(i*1.2),r=l*l,c=2*ja(.05,1,1-(n.bounce||0))*Math.sqrt(r);a={...a,mass:Ct.mass,stiffness:r,damping:c}}else{const i=pw(n);a={...a,...i,mass:Ct.mass},a.isResolvedFromDuration=!0}return a}function mx(n=Ct.visualDuration,a=Ct.bounce){const i=typeof n!="object"?{visualDuration:n,keyframes:[0,1],bounce:a}:n;let{restSpeed:l,restDelta:r}=i;const c=i.keyframes[0],d=i.keyframes[i.keyframes.length-1],p={done:!1,value:c},{stiffness:m,damping:g,mass:y,duration:v,velocity:_,isResolvedFromDuration:C}=bw({...i,velocity:-wa(i.velocity||0)}),E=_||0,k=g/(2*Math.sqrt(m*y)),A=d-c,S=wa(Math.sqrt(m/y)),N=Math.abs(A)<5;l||(l=N?Ct.restSpeed.granular:Ct.restSpeed.default),r||(r=N?Ct.restDelta.granular:Ct.restDelta.default);let D;if(k<1){const O=Ef(S,k);D=$=>{const R=Math.exp(-k*S*$);return d-R*((E+k*S*A)/O*Math.sin(O*$)+A*Math.cos(O*$))}}else if(k===1)D=O=>d-Math.exp(-S*O)*(A+(E+S*A)*O);else{const O=S*Math.sqrt(k*k-1);D=$=>{const R=Math.exp(-k*S*$),L=Math.min(O*$,300);return d-R*((E+k*S*A)*Math.sinh(L)+O*A*Math.cosh(L))/O}}const H={calculatedDuration:C&&v||null,next:O=>{const $=D(O);if(C)p.done=O>=v;else{let R=0;k<1&&(R=O===0?ka(E):px(D,O,$));const L=Math.abs(R)<=l,G=Math.abs(d-$)<=r;p.done=L&&G}return p.value=p.done?d:$,p},toString:()=>{const O=Math.min(dx(H),Tf),$=zb(R=>H.next(O*R).value,O,30);return O+"ms "+$}};return H}function Ty({keyframes:n,velocity:a=0,power:i=.8,timeConstant:l=325,bounceDamping:r=10,bounceStiffness:c=500,modifyTarget:d,min:p,max:m,restDelta:g=.5,restSpeed:y}){const v=n[0],_={done:!1,value:v},C=L=>p!==void 0&&L<p||m!==void 0&&L>m,E=L=>p===void 0?m:m===void 0||Math.abs(p-L)<Math.abs(m-L)?p:m;let k=i*a;const A=v+k,S=d===void 0?A:d(A);S!==A&&(k=S-v);const N=L=>-k*Math.exp(-L/l),D=L=>S+N(L),H=L=>{const G=N(L),ee=D(L);_.done=Math.abs(G)<=g,_.value=_.done?S:ee};let O,$;const R=L=>{C(_.value)&&(O=L,$=mx({keyframes:[_.value,E(_.value)],velocity:px(D,L,_.value),damping:r,stiffness:c,restDelta:g,restSpeed:y}))};return R(0),{calculatedDuration:null,next:L=>{let G=!1;return!$&&O===void 0&&(G=!0,H(L),R(L)),O!==void 0&&L>=O?$.next(L-O):(!G&&H(L),_)}}}const xw=ml(.42,0,1,1),_w=ml(0,0,.58,1),gx=ml(.42,0,.58,1),Sw=n=>Array.isArray(n)&&typeof n[0]!="number",Tw={linear:Sn,easeIn:xw,easeInOut:gx,easeOut:_w,circIn:Th,circInOut:Zb,circOut:Kb,backIn:Sh,backInOut:Yb,backOut:Fb,anticipate:qb},Cy=n=>{if(_h(n)){gb(n.length===4);const[a,i,l,r]=n;return ml(a,i,l,r)}else if(typeof n=="string")return Tw[n];return n};function Cw(n,a,i){const l=[],r=i||hx,c=n.length-1;for(let d=0;d<c;d++){let p=r(n[d],n[d+1]);if(a){const m=Array.isArray(a)?a[d]||Sn:a;p=gl(m,p)}l.push(p)}return l}function Ew(n,a,{clamp:i=!0,ease:l,mixer:r}={}){const c=n.length;if(gb(c===a.length),c===1)return()=>a[0];if(c===2&&a[0]===a[1])return()=>a[1];const d=n[0]===n[1];n[0]>n[c-1]&&(n=[...n].reverse(),a=[...a].reverse());const p=Cw(a,l,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 _=zi(n[v],n[v+1],y);return p[v](_)};return i?y=>g(ja(n[0],n[c-1],y)):g}function kw(n,a){const i=n[n.length-1];for(let l=1;l<=a;l++){const r=zi(0,a,l);n.push(xt(i,1,r))}}function ww(n){const a=[0];return kw(a,n.length-1),a}function Aw(n,a){return n.map(i=>i*a)}function Nw(n,a){return n.map(()=>a||gx).splice(0,n.length-1)}function Wr({duration:n=300,keyframes:a,times:i,ease:l="easeInOut"}){const r=Sw(l)?l.map(Cy):Cy(l),c={done:!1,value:a[0]},d=Aw(i&&i.length===a.length?i:ww(a),n),p=Ew(d,a,{ease:Array.isArray(r)?r:Nw(a,r)});return{calculatedDuration:n,next:m=>(c.value=p(m),c.done=m>=n,c)}}const jw=n=>{const a=({timestamp:i})=>n(i);return{start:()=>pt.update(a,!0),stop:()=>ls(a),now:()=>Xt.isProcessing?Xt.timestamp:aa.now()}},Dw={decay:Ty,inertia:Ty,tween:Wr,keyframes:Wr,spring:mx},Mw=n=>n/100;class Nh extends ux{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:l,element:r,keyframes:c}=this.options,d=(r==null?void 0:r.KeyframeResolver)||wh,p=(m,g)=>this.onKeyframesResolved(m,g);this.resolver=new d(c,p,i,l,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:l=0,repeatDelay:r=0,repeatType:c,velocity:d=0}=this.options,p=xh(i)?i:Dw[i]||Wr;let m,g;p!==Wr&&typeof a[0]!="number"&&(m=gl(Mw,hx(a[0],a[1])),a=[0,100]);const y=p({...this.options,keyframes:a});c==="mirror"&&(g=p({...this.options,keyframes:[...a].reverse(),velocity:-d})),y.calculatedDuration===null&&(y.calculatedDuration=dx(y));const{calculatedDuration:v}=y,_=v+r,C=_*(l+1)-r;return{generator:y,mirroredGenerator:g,mapPercentToKeyframes:m,calculatedDuration:v,resolvedDuration:_,totalDuration:C}}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:l}=this;if(!l){const{keyframes:L}=this.options;return{done:!0,value:L[L.length-1]}}const{finalKeyframe:r,generator:c,mirroredGenerator:d,mapPercentToKeyframes:p,keyframes:m,calculatedDuration:g,totalDuration:y,resolvedDuration:v}=l;if(this.startTime===null)return c.next(0);const{delay:_,repeat:C,repeatType:E,repeatDelay:k,onUpdate:A}=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 S=this.currentTime-_*(this.speed>=0?1:-1),N=this.speed>=0?S<0:S>y;this.currentTime=Math.max(S,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=y);let D=this.currentTime,H=c;if(C){const L=Math.min(this.currentTime,y)/v;let G=Math.floor(L),ee=L%1;!ee&&L>=1&&(ee=1),ee===1&&G--,G=Math.min(G,C+1),!!(G%2)&&(E==="reverse"?(ee=1-ee,k&&(ee-=k/v)):E==="mirror"&&(H=d)),D=ja(0,1,ee)*v}const O=N?{done:!1,value:m[0]}:H.next(D);p&&(O.value=p(O.value));let{done:$}=O;!N&&g!==null&&($=this.speed>=0?this.currentTime>=y:this.currentTime<=0);const R=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&$);return R&&r!==void 0&&(O.value=vc(m,this.options,r)),A&&A(O.value),R&&this.finish(),O}get duration(){const{resolved:a}=this;return a?wa(a.calculatedDuration):0}get time(){return wa(this.currentTime)}set time(a){a=ka(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=wa(this.currentTime))}play(){if(this.resolver.isScheduled||this.resolver.resume(),!this._resolved){this.pendingPlayState="running";return}if(this.isStopped)return;const{driver:a=jw,onPlay:i,startTime:l}=this.options;this.driver||(this.driver=a(c=>this.tick(c))),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=l??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 Rw=new Set(["opacity","clipPath","filter","transform"]);function Bw(n,a,i,{delay:l=0,duration:r=300,repeat:c=0,repeatType:d="loop",ease:p="easeInOut",times:m}={}){const g={[a]:i};m&&(g.offset=m);const y=Hb(p,r);return Array.isArray(y)&&(g.easing=y),n.animate(g,{delay:l,duration:r,easing:Array.isArray(y)?"linear":y,fill:"both",iterations:c+1,direction:d==="reverse"?"alternate":"normal"})}const Ow=bh(()=>Object.hasOwnProperty.call(Element.prototype,"animate")),Jr=10,Lw=2e4;function Iw(n){return xh(n.type)||n.type==="spring"||!Vb(n.ease)}function Uw(n,a){const i=new Nh({...a,keyframes:n,repeat:0,delay:0,isGenerator:!0});let l={done:!1,value:n[0]};const r=[];let c=0;for(;!l.done&&c<Lw;)l=i.sample(c),r.push(l.value),c+=Jr;return{times:void 0,keyframes:r,duration:c-Jr,ease:"linear"}}const vx={anticipate:qb,backInOut:Yb,circInOut:Zb};function zw(n){return n in vx}class Ey extends ux{constructor(a){super(a);const{name:i,motionValue:l,element:r,keyframes:c}=this.options;this.resolver=new cx(c,(d,p)=>this.onKeyframesResolved(d,p),i,l,r),this.resolver.scheduleResolve()}initPlayback(a,i){let{duration:l=300,times:r,ease:c,type:d,motionValue:p,name:m,startTime:g}=this.options;if(!p.owner||!p.owner.current)return!1;if(typeof c=="string"&&Xr()&&zw(c)&&(c=vx[c]),Iw(this.options)){const{onComplete:v,onUpdate:_,motionValue:C,element:E,...k}=this.options,A=Uw(a,k);a=A.keyframes,a.length===1&&(a[1]=a[0]),l=A.duration,r=A.times,c=A.ease,d="keyframes"}const y=Bw(p.owner.current,m,a,{...this.options,duration:l,times:r,ease:c});return y.startTime=g??this.calcStartTime(),this.pendingTimeline?(hy(y,this.pendingTimeline),this.pendingTimeline=void 0):y.onfinish=()=>{const{onComplete:v}=this.options;p.set(vc(a,this.options,i)),v&&v(),this.cancel(),this.resolveFinishedPromise()},{animation:y,duration:l,times:r,type:d,ease:c,keyframes:a}}get duration(){const{resolved:a}=this;if(!a)return 0;const{duration:i}=a;return wa(i)}get time(){const{resolved:a}=this;if(!a)return 0;const{animation:i}=a;return wa(i.currentTime||0)}set time(a){const{resolved:i}=this;if(!i)return;const{animation:l}=i;l.currentTime=ka(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:l}=i;l.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 Sn;const{animation:l}=i;hy(l,a)}return Sn}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:l,duration:r,type:c,ease:d,times:p}=a;if(i.playState==="idle"||i.playState==="finished")return;if(this.time){const{motionValue:g,onUpdate:y,onComplete:v,element:_,...C}=this.options,E=new Nh({...C,keyframes:l,duration:r,type:c,ease:d,times:p,isGenerator:!0}),k=ka(this.time);g.setWithVelocity(E.sample(k-Jr).value,E.sample(k).value,Jr)}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:l,repeatDelay:r,repeatType:c,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 Ow()&&l&&Rw.has(l)&&!m&&!g&&!r&&c!=="mirror"&&d!==0&&p!=="inertia"}}const Vw={type:"spring",stiffness:500,damping:25,restSpeed:10},Hw=n=>({type:"spring",stiffness:550,damping:n===0?2*Math.sqrt(550):30,restSpeed:10}),Gw={type:"keyframes",duration:.8},Pw={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},$w=(n,{keyframes:a})=>a.length>2?Gw:Hs.has(n)?n.startsWith("scale")?Hw(a[1]):Vw:Pw;function Fw({when:n,delay:a,delayChildren:i,staggerChildren:l,staggerDirection:r,repeat:c,repeatType:d,repeatDelay:p,from:m,elapsed:g,...y}){return!!Object.keys(y).length}const jh=(n,a,i,l={},r,c)=>d=>{const p=mh(l,n)||{},m=p.delay||l.delay||0;let{elapsed:g=0}=l;g=g-ka(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:c?void 0:r};Fw(p)||(y={...y,...$w(n,y)}),y.duration&&(y.duration=ka(y.duration)),y.repeatDelay&&(y.repeatDelay=ka(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&&!c&&a.get()!==void 0){const _=vc(y.keyframes,p);if(_!==void 0)return pt.update(()=>{y.onUpdate(_),y.onComplete()}),new Tk([])}return!c&&Ey.supports(y)?new Ey(y):new Nh(y)};function Yw({protectedKeys:n,needsAnimating:a},i){const l=n.hasOwnProperty(i)&&a[i]!==!0;return a[i]=!1,l}function yx(n,a,{delay:i=0,transitionOverride:l,type:r}={}){var c;let{transition:d=n.getDefaultTransition(),transitionEnd:p,...m}=a;l&&(d=l);const g=[],y=r&&n.animationState&&n.animationState.getState()[r];for(const v in m){const _=n.getValue(v,(c=n.latestValues[v])!==null&&c!==void 0?c:null),C=m[v];if(C===void 0||y&&Yw(y,v))continue;const E={delay:i,...mh(d||{},v)};let k=!1;if(window.MotionHandoffAnimation){const S=Ub(n);if(S){const N=window.MotionHandoffAnimation(S,v,pt);N!==null&&(E.startTime=N,k=!0)}}vf(n,v),_.start(jh(v,_,C,n.shouldReduceMotion&&Lb.has(v)?{type:!1}:E,n,k));const A=_.animation;A&&g.push(A)}return p&&Promise.all(g).then(()=>{pt.update(()=>{p&&bk(n,p)})}),g}function kf(n,a,i={}){var l;const r=gc(n,a,i.type==="exit"?(l=n.presenceContext)===null||l===void 0?void 0:l.custom:void 0);let{transition:c=n.getDefaultTransition()||{}}=r||{};i.transitionOverride&&(c=i.transitionOverride);const d=r?()=>Promise.all(yx(n,r,i)):()=>Promise.resolve(),p=n.variantChildren&&n.variantChildren.size?(g=0)=>{const{delayChildren:y=0,staggerChildren:v,staggerDirection:_}=c;return qw(n,a,y+g,v,_,i)}:()=>Promise.resolve(),{when:m}=c;if(m){const[g,y]=m==="beforeChildren"?[d,p]:[p,d];return g().then(()=>y())}else return Promise.all([d(),p(i.delay)])}function qw(n,a,i=0,l=0,r=1,c){const d=[],p=(n.variantChildren.size-1)*l,m=r===1?(g=0)=>g*l:(g=0)=>p-g*l;return Array.from(n.variantChildren).sort(Kw).forEach((g,y)=>{g.notify("AnimationStart",a),d.push(kf(g,a,{...c,delay:i+m(y)}).then(()=>g.notify("AnimationComplete",a)))}),Promise.all(d)}function Kw(n,a){return n.sortNodePosition(a)}function Zw(n,a,i={}){n.notify("AnimationStart",a);let l;if(Array.isArray(a)){const r=a.map(c=>kf(n,c,i));l=Promise.all(r)}else if(typeof a=="string")l=kf(n,a,i);else{const r=typeof a=="function"?gc(n,a,i.custom):a;l=Promise.all(yx(n,r,i))}return l.then(()=>{n.notify("AnimationComplete",a)})}const Xw=ah.length;function bx(n){if(!n)return;if(!n.isControllingVariants){const i=n.parent?bx(n.parent)||{}:{};return n.props.initial!==void 0&&(i.initial=n.props.initial),i}const a={};for(let i=0;i<Xw;i++){const l=ah[i],r=n.props[l];(ol(r)||r===!1)&&(a[l]=r)}return a}const Qw=[...nh].reverse(),Ww=nh.length;function Jw(n){return a=>Promise.all(a.map(({animation:i,options:l})=>Zw(n,i,l)))}function eA(n){let a=Jw(n),i=ky(),l=!0;const r=m=>(g,y)=>{var v;const _=gc(n,y,m==="exit"?(v=n.presenceContext)===null||v===void 0?void 0:v.custom:void 0);if(_){const{transition:C,transitionEnd:E,...k}=_;g={...g,...k,...E}}return g};function c(m){a=m(n)}function d(m){const{props:g}=n,y=bx(n.parent)||{},v=[],_=new Set;let C={},E=1/0;for(let A=0;A<Ww;A++){const S=Qw[A],N=i[S],D=g[S]!==void 0?g[S]:y[S],H=ol(D),O=S===m?N.isActive:null;O===!1&&(E=A);let $=D===y[S]&&D!==g[S]&&H;if($&&l&&n.manuallyAnimateOnMount&&($=!1),N.protectedKeys={...C},!N.isActive&&O===null||!D&&!N.prevProp||pc(D)||typeof D=="boolean")continue;const R=tA(N.prevProp,D);let L=R||S===m&&N.isActive&&!$&&H||A>E&&H,G=!1;const ee=Array.isArray(D)?D:[D];let te=ee.reduce(r(S),{});O===!1&&(te={});const{prevResolvedValues:ne={}}=N,ie={...ne,...te},he=Z=>{L=!0,_.has(Z)&&(G=!0,_.delete(Z)),N.needsAnimating[Z]=!0;const K=n.getValue(Z);K&&(K.liveStyle=!1)};for(const Z in ie){const K=te[Z],de=ne[Z];if(C.hasOwnProperty(Z))continue;let Y=!1;gf(K)&&gf(de)?Y=!Ob(K,de):Y=K!==de,Y?K!=null?he(Z):_.add(Z):K!==void 0&&_.has(Z)?he(Z):N.protectedKeys[Z]=!0}N.prevProp=D,N.prevResolvedValues=te,N.isActive&&(C={...C,...te}),l&&n.blockInitialAnimation&&(L=!1),L&&(!($&&R)||G)&&v.push(...ee.map(Z=>({animation:Z,options:{type:S}})))}if(_.size){const A={};_.forEach(S=>{const N=n.getBaseTarget(S),D=n.getValue(S);D&&(D.liveStyle=!0),A[S]=N??null}),v.push({animation:A})}let k=!!v.length;return l&&(g.initial===!1||g.initial===g.animate)&&!n.manuallyAnimateOnMount&&(k=!1),l=!1,k?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 C;return(C=_.animationState)===null||C===void 0?void 0:C.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:c,getState:()=>i,reset:()=>{i=ky(),l=!0}}}function tA(n,a){return typeof a=="string"?a!==n:Array.isArray(a)?!Ob(a,n):!1}function Ns(n=!1){return{isActive:n,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function ky(){return{animate:Ns(!0),whileInView:Ns(),whileHover:Ns(),whileTap:Ns(),whileDrag:Ns(),whileFocus:Ns(),exit:Ns()}}class us{constructor(a){this.isMounted=!1,this.node=a}update(){}}class nA extends us{constructor(a){super(a),a.animationState||(a.animationState=eA(a))}updateAnimationControlsSubscription(){const{animate:a}=this.node.getProps();pc(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 aA=0;class sA extends us{constructor(){super(...arguments),this.id=aA++}update(){if(!this.node.presenceContext)return;const{isPresent:a,onExitComplete:i}=this.node.presenceContext,{isPresent:l}=this.node.prevPresenceContext||{};if(!this.node.animationState||a===l)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 iA={animation:{Feature:nA},exit:{Feature:sA}},Fn={x:!1,y:!1};function xx(){return Fn.x||Fn.y}function oA(n){return n==="x"||n==="y"?Fn[n]?null:(Fn[n]=!0,()=>{Fn[n]=!1}):Fn.x||Fn.y?null:(Fn.x=Fn.y=!0,()=>{Fn.x=Fn.y=!1})}const Dh=n=>n.pointerType==="mouse"?typeof n.button!="number"||n.button<=0:n.isPrimary!==!1;function ul(n,a,i,l={passive:!0}){return n.addEventListener(a,i,l),()=>n.removeEventListener(a,i)}function vl(n){return{point:{x:n.pageX,y:n.pageY}}}const lA=n=>a=>Dh(a)&&n(a,vl(a));function Jo(n,a,i,l){return ul(n,a,lA(i),l)}const wy=(n,a)=>Math.abs(n-a);function rA(n,a){const i=wy(n.x,a.x),l=wy(n.y,a.y);return Math.sqrt(i**2+l**2)}class _x{constructor(a,i,{transformPagePoint:l,contextWindow:r,dragSnapToOrigin:c=!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=Yd(this.lastMoveEventInfo,this.history),_=this.startEvent!==null,C=rA(v.offset,{x:0,y:0})>=3;if(!_&&!C)return;const{point:E}=v,{timestamp:k}=Xt;this.history.push({...E,timestamp:k});const{onStart:A,onMove:S}=this.handlers;_||(A&&A(this.lastMoveEvent,v),this.startEvent=this.lastMoveEvent),S&&S(this.lastMoveEvent,v)},this.handlePointerMove=(v,_)=>{this.lastMoveEvent=v,this.lastMoveEventInfo=Fd(_,this.transformPagePoint),pt.update(this.updatePoint,!0)},this.handlePointerUp=(v,_)=>{this.end();const{onEnd:C,onSessionEnd:E,resumeAnimation:k}=this.handlers;if(this.dragSnapToOrigin&&k&&k(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const A=Yd(v.type==="pointercancel"?this.lastMoveEventInfo:Fd(_,this.transformPagePoint),this.history);this.startEvent&&C&&C(v,A),E&&E(v,A)},!Dh(a))return;this.dragSnapToOrigin=c,this.handlers=i,this.transformPagePoint=l,this.contextWindow=r||window;const d=vl(a),p=Fd(d,this.transformPagePoint),{point:m}=p,{timestamp:g}=Xt;this.history=[{...m,timestamp:g}];const{onSessionStart:y}=i;y&&y(a,Yd(p,this.history)),this.removeListeners=gl(Jo(this.contextWindow,"pointermove",this.handlePointerMove),Jo(this.contextWindow,"pointerup",this.handlePointerUp),Jo(this.contextWindow,"pointercancel",this.handlePointerUp))}updateHandlers(a){this.handlers=a}end(){this.removeListeners&&this.removeListeners(),ls(this.updatePoint)}}function Fd(n,a){return a?{point:a(n.point)}:n}function Ay(n,a){return{x:n.x-a.x,y:n.y-a.y}}function Yd({point:n},a){return{point:n,delta:Ay(n,Sx(a)),offset:Ay(n,cA(a)),velocity:uA(a,.1)}}function cA(n){return n[0]}function Sx(n){return n[n.length-1]}function uA(n,a){if(n.length<2)return{x:0,y:0};let i=n.length-1,l=null;const r=Sx(n);for(;i>=0&&(l=n[i],!(r.timestamp-l.timestamp>ka(a)));)i--;if(!l)return{x:0,y:0};const c=wa(r.timestamp-l.timestamp);if(c===0)return{x:0,y:0};const d={x:(r.x-l.x)/c,y:(r.y-l.y)/c};return d.x===1/0&&(d.x=0),d.y===1/0&&(d.y=0),d}const Tx=1e-4,dA=1-Tx,fA=1+Tx,Cx=.01,hA=0-Cx,pA=0+Cx;function Tn(n){return n.max-n.min}function mA(n,a,i){return Math.abs(n-a)<=i}function Ny(n,a,i,l=.5){n.origin=l,n.originPoint=xt(a.min,a.max,n.origin),n.scale=Tn(i)/Tn(a),n.translate=xt(i.min,i.max,n.origin)-n.originPoint,(n.scale>=dA&&n.scale<=fA||isNaN(n.scale))&&(n.scale=1),(n.translate>=hA&&n.translate<=pA||isNaN(n.translate))&&(n.translate=0)}function el(n,a,i,l){Ny(n.x,a.x,i.x,l?l.originX:void 0),Ny(n.y,a.y,i.y,l?l.originY:void 0)}function jy(n,a,i){n.min=i.min+a.min,n.max=n.min+Tn(a)}function gA(n,a,i){jy(n.x,a.x,i.x),jy(n.y,a.y,i.y)}function Dy(n,a,i){n.min=a.min-i.min,n.max=n.min+Tn(a)}function tl(n,a,i){Dy(n.x,a.x,i.x),Dy(n.y,a.y,i.y)}function vA(n,{min:a,max:i},l){return a!==void 0&&n<a?n=l?xt(a,n,l.min):Math.max(n,a):i!==void 0&&n>i&&(n=l?xt(i,n,l.max):Math.min(n,i)),n}function My(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 yA(n,{top:a,left:i,bottom:l,right:r}){return{x:My(n.x,i,r),y:My(n.y,a,l)}}function Ry(n,a){let i=a.min-n.min,l=a.max-n.max;return a.max-a.min<n.max-n.min&&([i,l]=[l,i]),{min:i,max:l}}function bA(n,a){return{x:Ry(n.x,a.x),y:Ry(n.y,a.y)}}function xA(n,a){let i=.5;const l=Tn(n),r=Tn(a);return r>l?i=zi(a.min,a.max-l,n.min):l>r&&(i=zi(n.min,n.max-r,a.min)),ja(0,1,i)}function _A(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 wf=.35;function SA(n=wf){return n===!1?n=0:n===!0&&(n=wf),{x:By(n,"left","right"),y:By(n,"top","bottom")}}function By(n,a,i){return{min:Oy(n,a),max:Oy(n,i)}}function Oy(n,a){return typeof n=="number"?n:n[a]||0}const Ly=()=>({translate:0,scale:1,origin:0,originPoint:0}),Mi=()=>({x:Ly(),y:Ly()}),Iy=()=>({min:0,max:0}),Mt=()=>({x:Iy(),y:Iy()});function In(n){return[n("x"),n("y")]}function Ex({top:n,left:a,right:i,bottom:l}){return{x:{min:a,max:i},y:{min:n,max:l}}}function TA({x:n,y:a}){return{top:a.min,right:n.max,bottom:a.max,left:n.min}}function CA(n,a){if(!a)return n;const i=a({x:n.left,y:n.top}),l=a({x:n.right,y:n.bottom});return{top:i.y,left:i.x,bottom:l.y,right:l.x}}function qd(n){return n===void 0||n===1}function Af({scale:n,scaleX:a,scaleY:i}){return!qd(n)||!qd(a)||!qd(i)}function Ms(n){return Af(n)||kx(n)||n.z||n.rotate||n.rotateX||n.rotateY||n.skewX||n.skewY}function kx(n){return Uy(n.x)||Uy(n.y)}function Uy(n){return n&&n!=="0%"}function ec(n,a,i){const l=n-i,r=a*l;return i+r}function zy(n,a,i,l,r){return r!==void 0&&(n=ec(n,r,l)),ec(n,i,l)+a}function Nf(n,a=0,i=1,l,r){n.min=zy(n.min,a,i,l,r),n.max=zy(n.max,a,i,l,r)}function wx(n,{x:a,y:i}){Nf(n.x,a.translate,a.scale,a.originPoint),Nf(n.y,i.translate,i.scale,i.originPoint)}const Vy=.999999999999,Hy=1.0000000000001;function EA(n,a,i,l=!1){const r=i.length;if(!r)return;a.x=a.y=1;let c,d;for(let p=0;p<r;p++){c=i[p],d=c.projectionDelta;const{visualElement:m}=c.options;m&&m.props.style&&m.props.style.display==="contents"||(l&&c.options.layoutScroll&&c.scroll&&c!==c.root&&Bi(n,{x:-c.scroll.offset.x,y:-c.scroll.offset.y}),d&&(a.x*=d.x.scale,a.y*=d.y.scale,wx(n,d)),l&&Ms(c.latestValues)&&Bi(n,c.latestValues))}a.x<Hy&&a.x>Vy&&(a.x=1),a.y<Hy&&a.y>Vy&&(a.y=1)}function Ri(n,a){n.min=n.min+a,n.max=n.max+a}function Gy(n,a,i,l,r=.5){const c=xt(n.min,n.max,r);Nf(n,a,i,c,l)}function Bi(n,a){Gy(n.x,a.x,a.scaleX,a.scale,a.originX),Gy(n.y,a.y,a.scaleY,a.scale,a.originY)}function Ax(n,a){return Ex(CA(n.getBoundingClientRect(),a))}function kA(n,a,i){const l=Ax(n,i),{scroll:r}=a;return r&&(Ri(l.x,r.offset.x),Ri(l.y,r.offset.y)),l}const Nx=({current:n})=>n?n.ownerDocument.defaultView:null,wA=new WeakMap;class AA{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=Mt(),this.visualElement=a}start(a,{snapToCursor:i=!1}={}){const{presenceContext:l}=this.visualElement;if(l&&l.isPresent===!1)return;const r=y=>{const{dragSnapToOrigin:v}=this.getProps();v?this.pauseAnimation():this.stopAnimation(),i&&this.snapToCursor(vl(y).point)},c=(y,v)=>{const{drag:_,dragPropagation:C,onDragStart:E}=this.getProps();if(_&&!C&&(this.openDragLock&&this.openDragLock(),this.openDragLock=oA(_),!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),In(A=>{let S=this.getAxisMotionValue(A).get()||0;if(na.test(S)){const{projection:N}=this.visualElement;if(N&&N.layout){const D=N.layout.layoutBox[A];D&&(S=Tn(D)*(parseFloat(S)/100))}}this.originPoint[A]=S}),E&&pt.postRender(()=>E(y,v)),vf(this.visualElement,"transform");const{animationState:k}=this.visualElement;k&&k.setActive("whileDrag",!0)},d=(y,v)=>{const{dragPropagation:_,dragDirectionLock:C,onDirectionLock:E,onDrag:k}=this.getProps();if(!_&&!this.openDragLock)return;const{offset:A}=v;if(C&&this.currentDirection===null){this.currentDirection=NA(A),this.currentDirection!==null&&E&&E(this.currentDirection);return}this.updateAxis("x",v.point,A),this.updateAxis("y",v.point,A),this.visualElement.render(),k&&k(y,v)},p=(y,v)=>this.stop(y,v),m=()=>In(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 _x(a,{onSessionStart:r,onStart:c,onMove:d,onSessionEnd:p,resumeAnimation:m},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:g,contextWindow:Nx(this.visualElement)})}stop(a,i){const l=this.isDragging;if(this.cancel(),!l)return;const{velocity:r}=i;this.startAnimation(r);const{onDragEnd:c}=this.getProps();c&&pt.postRender(()=>c(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:l}=this.getProps();!l&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),i&&i.setActive("whileDrag",!1)}updateAxis(a,i,l){const{drag:r}=this.getProps();if(!l||!Or(a,r,this.currentDirection))return;const c=this.getAxisMotionValue(a);let d=this.originPoint[a]+l[a];this.constraints&&this.constraints[a]&&(d=vA(d,this.constraints[a],this.elastic[a])),c.set(d)}resolveConstraints(){var a;const{dragConstraints:i,dragElastic:l}=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,c=this.constraints;i&&ji(i)?this.constraints||(this.constraints=this.resolveRefConstraints()):i&&r?this.constraints=yA(r.layoutBox,i):this.constraints=!1,this.elastic=SA(l),c!==this.constraints&&r&&this.constraints&&!this.hasMutatedConstraints&&In(d=>{this.constraints!==!1&&this.getAxisMotionValue(d)&&(this.constraints[d]=_A(r.layoutBox[d],this.constraints[d]))})}resolveRefConstraints(){const{dragConstraints:a,onMeasureDragConstraints:i}=this.getProps();if(!a||!ji(a))return!1;const l=a.current,{projection:r}=this.visualElement;if(!r||!r.layout)return!1;const c=kA(l,r.root,this.visualElement.getTransformPagePoint());let d=bA(r.layout.layoutBox,c);if(i){const p=i(TA(d));this.hasMutatedConstraints=!!p,p&&(d=Ex(p))}return d}startAnimation(a){const{drag:i,dragMomentum:l,dragElastic:r,dragTransition:c,dragSnapToOrigin:d,onDragTransitionEnd:p}=this.getProps(),m=this.constraints||{},g=In(y=>{if(!Or(y,i,this.currentDirection))return;let v=m&&m[y]||{};d&&(v={min:0,max:0});const _=r?200:1e6,C=r?40:1e7,E={type:"inertia",velocity:l?a[y]:0,bounceStiffness:_,bounceDamping:C,timeConstant:750,restDelta:1,restSpeed:10,...c,...v};return this.startAxisValueAnimation(y,E)});return Promise.all(g).then(p)}startAxisValueAnimation(a,i){const l=this.getAxisMotionValue(a);return vf(this.visualElement,a),l.start(jh(a,l,0,i,this.visualElement,!1))}stopAnimation(){In(a=>this.getAxisMotionValue(a).stop())}pauseAnimation(){In(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()}`,l=this.visualElement.getProps(),r=l[i];return r||this.visualElement.getValue(a,(l.initial?l.initial[a]:void 0)||0)}snapToCursor(a){In(i=>{const{drag:l}=this.getProps();if(!Or(i,l,this.currentDirection))return;const{projection:r}=this.visualElement,c=this.getAxisMotionValue(i);if(r&&r.layout){const{min:d,max:p}=r.layout.layoutBox[i];c.set(a[i]-xt(d,p,.5))}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:a,dragConstraints:i}=this.getProps(),{projection:l}=this.visualElement;if(!ji(i)||!l||!this.constraints)return;this.stopAnimation();const r={x:0,y:0};In(d=>{const p=this.getAxisMotionValue(d);if(p&&this.constraints!==!1){const m=p.get();r[d]=xA({min:m,max:m},this.constraints[d])}});const{transformTemplate:c}=this.visualElement.getProps();this.visualElement.current.style.transform=c?c({},""):"none",l.root&&l.root.updateScroll(),l.updateLayout(),this.resolveConstraints(),In(d=>{if(!Or(d,a,null))return;const p=this.getAxisMotionValue(d),{min:m,max:g}=this.constraints[d];p.set(xt(m,g,r[d]))})}addListeners(){if(!this.visualElement.current)return;wA.set(this.visualElement,this);const a=this.visualElement.current,i=Jo(a,"pointerdown",m=>{const{drag:g,dragListener:y=!0}=this.getProps();g&&y&&this.start(m)}),l=()=>{const{dragConstraints:m}=this.getProps();ji(m)&&m.current&&(this.constraints=this.resolveRefConstraints())},{projection:r}=this.visualElement,c=r.addEventListener("measure",l);r&&!r.layout&&(r.root&&r.root.updateScroll(),r.updateLayout()),pt.read(l);const d=ul(window,"resize",()=>this.scalePositionWithinConstraints()),p=r.addEventListener("didUpdate",(({delta:m,hasLayoutChanged:g})=>{this.isDragging&&g&&(In(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(),c(),p&&p()}}getProps(){const a=this.visualElement.getProps(),{drag:i=!1,dragDirectionLock:l=!1,dragPropagation:r=!1,dragConstraints:c=!1,dragElastic:d=wf,dragMomentum:p=!0}=a;return{...a,drag:i,dragDirectionLock:l,dragPropagation:r,dragConstraints:c,dragElastic:d,dragMomentum:p}}}function Or(n,a,i){return(a===!0||a===n)&&(i===null||i===n)}function NA(n,a=10){let i=null;return Math.abs(n.y)>a?i="y":Math.abs(n.x)>a&&(i="x"),i}class jA extends us{constructor(a){super(a),this.removeGroupControls=Sn,this.removeListeners=Sn,this.controls=new AA(a)}mount(){const{dragControls:a}=this.node.getProps();a&&(this.removeGroupControls=a.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||Sn}unmount(){this.removeGroupControls(),this.removeListeners()}}const Py=n=>(a,i)=>{n&&pt.postRender(()=>n(a,i))};class DA extends us{constructor(){super(...arguments),this.removePointerDownListener=Sn}onPointerDown(a){this.session=new _x(a,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:Nx(this.node)})}createPanHandlers(){const{onPanSessionStart:a,onPanStart:i,onPan:l,onPanEnd:r}=this.node.getProps();return{onSessionStart:Py(a),onStart:Py(i),onMove:l,onEnd:(c,d)=>{delete this.session,r&&pt.postRender(()=>r(c,d))}}}mount(){this.removePointerDownListener=Jo(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 Yr={hasAnimatedSinceResize:!0,hasEverUpdated:!1};function $y(n,a){return a.max===a.min?0:n/(a.max-a.min)*100}const Go={correct:(n,a)=>{if(!a.target)return n;if(typeof n=="string")if(ve.test(n))n=parseFloat(n);else return n;const i=$y(n,a.target.x),l=$y(n,a.target.y);return`${i}% ${l}%`}},MA={correct:(n,{treeScale:a,projectionDelta:i})=>{const l=n,r=rs.parse(n);if(r.length>5)return l;const c=rs.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=xt(p,m,.5);return typeof r[2+d]=="number"&&(r[2+d]/=g),typeof r[3+d]=="number"&&(r[3+d]/=g),c(r)}};class RA extends x.Component{componentDidMount(){const{visualElement:a,layoutGroup:i,switchLayoutGroup:l,layoutId:r}=this.props,{projection:c}=a;ik(BA),c&&(i.group&&i.group.add(c),l&&l.register&&r&&l.register(c),c.root.didUpdate(),c.addEventListener("animationComplete",()=>{this.safeToRemove()}),c.setOptions({...c.options,onExitComplete:()=>this.safeToRemove()})),Yr.hasEverUpdated=!0}getSnapshotBeforeUpdate(a){const{layoutDependency:i,visualElement:l,drag:r,isPresent:c}=this.props,d=l.projection;return d&&(d.isPresent=c,r||a.layoutDependency!==i||i===void 0?d.willUpdate():this.safeToRemove(),a.isPresent!==c&&(c?d.promote():d.relegate()||pt.postRender(()=>{const p=d.getStack();(!p||!p.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{projection:a}=this.props.visualElement;a&&(a.root.didUpdate(),ih.postRender(()=>{!a.currentAnimation&&a.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:a,layoutGroup:i,switchLayoutGroup:l}=this.props,{projection:r}=a;r&&(r.scheduleCheckAfterUnmount(),i&&i.group&&i.group.remove(r),l&&l.deregister&&l.deregister(r))}safeToRemove(){const{safeToRemove:a}=this.props;a&&a()}render(){return null}}function jx(n){const[a,i]=pb(),l=x.useContext(Wf);return f.jsx(RA,{...n,layoutGroup:l,switchLayoutGroup:x.useContext(Sb),isPresent:a,safeToRemove:i})}const BA={borderRadius:{...Go,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:Go,borderTopRightRadius:Go,borderBottomLeftRadius:Go,borderBottomRightRadius:Go,boxShadow:MA};function OA(n,a,i){const l=Jt(n)?n:rl(n);return l.start(jh("",l,a,i)),l.animation}function LA(n){return n instanceof SVGElement&&n.tagName!=="svg"}const IA=(n,a)=>n.depth-a.depth;class UA{constructor(){this.children=[],this.isDirty=!1}add(a){gh(this.children,a),this.isDirty=!0}remove(a){vh(this.children,a),this.isDirty=!0}forEach(a){this.isDirty&&this.children.sort(IA),this.isDirty=!1,this.children.forEach(a)}}function zA(n,a){const i=aa.now(),l=({timestamp:r})=>{const c=r-i;c>=a&&(ls(l),n(c-a))};return pt.read(l,!0),()=>ls(l)}const Dx=["TopLeft","TopRight","BottomLeft","BottomRight"],VA=Dx.length,Fy=n=>typeof n=="string"?parseFloat(n):n,Yy=n=>typeof n=="number"||ve.test(n);function HA(n,a,i,l,r,c){r?(n.opacity=xt(0,i.opacity!==void 0?i.opacity:1,GA(l)),n.opacityExit=xt(a.opacity!==void 0?a.opacity:1,0,PA(l))):c&&(n.opacity=xt(a.opacity!==void 0?a.opacity:1,i.opacity!==void 0?i.opacity:1,l));for(let d=0;d<VA;d++){const p=`border${Dx[d]}Radius`;let m=qy(a,p),g=qy(i,p);if(m===void 0&&g===void 0)continue;m||(m=0),g||(g=0),m===0||g===0||Yy(m)===Yy(g)?(n[p]=Math.max(xt(Fy(m),Fy(g),l),0),(na.test(g)||na.test(m))&&(n[p]+="%")):n[p]=g}(a.rotate||i.rotate)&&(n.rotate=xt(a.rotate||0,i.rotate||0,l))}function qy(n,a){return n[a]!==void 0?n[a]:n.borderRadius}const GA=Mx(0,.5,Kb),PA=Mx(.5,.95,Sn);function Mx(n,a,i){return l=>l<n?0:l>a?1:i(zi(n,a,l))}function Ky(n,a){n.min=a.min,n.max=a.max}function Ln(n,a){Ky(n.x,a.x),Ky(n.y,a.y)}function Zy(n,a){n.translate=a.translate,n.scale=a.scale,n.originPoint=a.originPoint,n.origin=a.origin}function Xy(n,a,i,l,r){return n-=a,n=ec(n,1/i,l),r!==void 0&&(n=ec(n,1/r,l)),n}function $A(n,a=0,i=1,l=.5,r,c=n,d=n){if(na.test(a)&&(a=parseFloat(a),a=xt(d.min,d.max,a/100)-d.min),typeof a!="number")return;let p=xt(c.min,c.max,l);n===c&&(p-=a),n.min=Xy(n.min,a,i,p,r),n.max=Xy(n.max,a,i,p,r)}function Qy(n,a,[i,l,r],c,d){$A(n,a[i],a[l],a[r],a.scale,c,d)}const FA=["x","scaleX","originX"],YA=["y","scaleY","originY"];function Wy(n,a,i,l){Qy(n.x,a,FA,i?i.x:void 0,l?l.x:void 0),Qy(n.y,a,YA,i?i.y:void 0,l?l.y:void 0)}function Jy(n){return n.translate===0&&n.scale===1}function Rx(n){return Jy(n.x)&&Jy(n.y)}function e0(n,a){return n.min===a.min&&n.max===a.max}function qA(n,a){return e0(n.x,a.x)&&e0(n.y,a.y)}function t0(n,a){return Math.round(n.min)===Math.round(a.min)&&Math.round(n.max)===Math.round(a.max)}function Bx(n,a){return t0(n.x,a.x)&&t0(n.y,a.y)}function n0(n){return Tn(n.x)/Tn(n.y)}function a0(n,a){return n.translate===a.translate&&n.scale===a.scale&&n.originPoint===a.originPoint}class KA{constructor(){this.members=[]}add(a){gh(this.members,a),a.scheduleRender()}remove(a){if(vh(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 l;for(let r=i;r>=0;r--){const c=this.members[r];if(c.isPresent!==!1){l=c;break}}return l?(this.promote(l),!0):!1}promote(a,i){const l=this.lead;if(a!==l&&(this.prevLead=l,this.lead=a,a.show(),l)){l.instance&&l.scheduleRender(),a.scheduleRender(),a.resumeFrom=l,i&&(a.resumeFrom.preserveOpacity=!0),l.snapshot&&(a.snapshot=l.snapshot,a.snapshot.latestValues=l.animationValues||l.latestValues),a.root&&a.root.isUpdating&&(a.isLayoutDirty=!0);const{crossfade:r}=a.options;r===!1&&l.hide()}}exitAnimationComplete(){this.members.forEach(a=>{const{options:i,resumingFrom:l}=a;i.onExitComplete&&i.onExitComplete(),l&&l.options.onExitComplete&&l.options.onExitComplete()})}scheduleRender(){this.members.forEach(a=>{a.instance&&a.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}function ZA(n,a,i){let l="";const r=n.x.translate/a.x,c=n.y.translate/a.y,d=(i==null?void 0:i.z)||0;if((r||c||d)&&(l=`translate3d(${r}px, ${c}px, ${d}px) `),(a.x!==1||a.y!==1)&&(l+=`scale(${1/a.x}, ${1/a.y}) `),i){const{transformPerspective:g,rotate:y,rotateX:v,rotateY:_,skewX:C,skewY:E}=i;g&&(l=`perspective(${g}px) ${l}`),y&&(l+=`rotate(${y}deg) `),v&&(l+=`rotateX(${v}deg) `),_&&(l+=`rotateY(${_}deg) `),C&&(l+=`skewX(${C}deg) `),E&&(l+=`skewY(${E}deg) `)}const p=n.x.scale*a.x,m=n.y.scale*a.y;return(p!==1||m!==1)&&(l+=`scale(${p}, ${m})`),l||"none"}const Rs={type:"projectionFrame",totalNodes:0,resolvedTargetDeltas:0,recalculatedProjection:0},Ko=typeof window<"u"&&window.MotionDebug!==void 0,Kd=["","X","Y","Z"],XA={visibility:"hidden"},s0=1e3;let QA=0;function Zd(n,a,i,l){const{latestValues:r}=a;r[n]&&(i[n]=r[n],a.setStaticValue(n,0),l&&(l[n]=0))}function Ox(n){if(n.hasCheckedOptimisedAppear=!0,n.root===n)return;const{visualElement:a}=n.options;if(!a)return;const i=Ub(a);if(window.MotionHasOptimisedAnimation(i,"transform")){const{layout:r,layoutId:c}=n.options;window.MotionCancelOptimisedAnimation(i,"transform",pt,!(r||c))}const{parent:l}=n;l&&!l.hasCheckedOptimisedAppear&&Ox(l)}function Lx({attachResizeListener:n,defaultParent:a,measureScroll:i,checkIsScrollRoot:l,resetTransform:r}){return class{constructor(d={},p=a==null?void 0:a()){this.id=QA++,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,Ko&&(Rs.totalNodes=Rs.resolvedTargetDeltas=Rs.recalculatedProjection=0),this.nodes.forEach(eN),this.nodes.forEach(iN),this.nodes.forEach(oN),this.nodes.forEach(tN),Ko&&window.MotionDebug.record(Rs)},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 UA)}addEventListener(d,p){return this.eventHandlers.has(d)||this.eventHandlers.set(d,new yh),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=LA(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=zA(_,250),Yr.hasAnimatedSinceResize&&(Yr.hasAnimatedSinceResize=!1,this.nodes.forEach(o0))})}m&&this.root.registerSharedNode(m,this),this.options.animate!==!1&&y&&(m||g)&&this.addEventListener("didUpdate",({delta:v,hasLayoutChanged:_,hasRelativeTargetChanged:C,layout:E})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const k=this.options.transition||y.getDefaultTransition()||dN,{onLayoutAnimationStart:A,onLayoutAnimationComplete:S}=y.getProps(),N=!this.targetLayout||!Bx(this.targetLayout,E)||C,D=!_&&C;if(this.options.layoutRoot||this.resumeFrom&&this.resumeFrom.instance||D||_&&(N||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0),this.setAnimationOrigin(v,D);const H={...mh(k,"layout"),onPlay:A,onComplete:S};(y.shouldReduceMotion||this.options.layoutRoot)&&(H.delay=0,H.type=!1),this.startAnimation(H)}else _||o0(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=E})}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,ls(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(lN),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&&Ox(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(i0);return}this.isUpdating||this.nodes.forEach(aN),this.isUpdating=!1,this.nodes.forEach(sN),this.nodes.forEach(WA),this.nodes.forEach(JA),this.clearAllSnapshots();const p=aa.now();Xt.delta=ja(0,1e3/60,p-Xt.timestamp),Xt.timestamp=p,Xt.isProcessing=!0,Vd.update.process(Xt),Vd.preRender.process(Xt),Vd.render.process(Xt),Xt.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,ih.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(nN),this.sharedNodes.forEach(rN)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,pt.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){pt.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=Mt(),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=l(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&&!Rx(this.projectionDelta),m=this.getTransformTemplate(),g=m?m(this.latestValues,""):void 0,y=g!==this.prevTransformTemplateValue;d&&(p||Ms(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)),fN(m),{animationId:this.root.animationId,measuredBox:p,layoutBox:m,latestValues:{},source:this.id}}measurePageBox(){var d;const{visualElement:p}=this.options;if(!p)return Mt();const m=p.measureViewportBox();if(!(((d=this.scroll)===null||d===void 0?void 0:d.wasRoot)||this.path.some(hN))){const{scroll:y}=this.root;y&&(Ri(m.x,y.offset.x),Ri(m.y,y.offset.y))}return m}removeElementScroll(d){var p;const m=Mt();if(Ln(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&&Ln(m,d),Ri(m.x,v.offset.x),Ri(m.y,v.offset.y))}return m}applyTransform(d,p=!1){const m=Mt();Ln(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&&Bi(m,{x:-y.scroll.offset.x,y:-y.scroll.offset.y}),Ms(y.latestValues)&&Bi(m,y.latestValues)}return Ms(this.latestValues)&&Bi(m,this.latestValues),m}removeTransform(d){const p=Mt();Ln(p,d);for(let m=0;m<this.path.length;m++){const g=this.path[m];if(!g.instance||!Ms(g.latestValues))continue;Af(g.latestValues)&&g.updateSnapshot();const y=Mt(),v=g.measurePageBox();Ln(y,v),Wy(p,g.latestValues,g.snapshot?g.snapshot.layoutBox:void 0,y)}return Ms(this.latestValues)&&Wy(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!==Xt.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=Xt.timestamp,!this.targetDelta&&!this.relativeTarget){const C=this.getClosestProjectingParent();C&&C.layout&&this.animationProgress!==1?(this.relativeParent=C,this.forceRelativeParentToResolveTarget(),this.relativeTarget=Mt(),this.relativeTargetOrigin=Mt(),tl(this.relativeTargetOrigin,this.layout.layoutBox,C.layout.layoutBox),Ln(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}if(!(!this.relativeTarget&&!this.targetDelta)){if(this.target||(this.target=Mt(),this.targetWithTransforms=Mt()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),gA(this.target,this.relativeTarget,this.relativeParent.target)):this.targetDelta?(this.resumingFrom?this.target=this.applyTransform(this.layout.layoutBox):Ln(this.target,this.layout.layoutBox),wx(this.target,this.targetDelta)):Ln(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget){this.attemptToResolveRelativeTarget=!1;const C=this.getClosestProjectingParent();C&&!!C.resumingFrom==!!this.resumingFrom&&!C.options.layoutScroll&&C.target&&this.animationProgress!==1?(this.relativeParent=C,this.forceRelativeParentToResolveTarget(),this.relativeTarget=Mt(),this.relativeTargetOrigin=Mt(),tl(this.relativeTargetOrigin,this.target,C.target),Ln(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}Ko&&Rs.resolvedTargetDeltas++}}}getClosestProjectingParent(){if(!(!this.parent||Af(this.parent.latestValues)||kx(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===Xt.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;Ln(this.layoutCorrected,this.layout.layoutBox);const _=this.treeScale.x,C=this.treeScale.y;EA(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=Mt());const{target:E}=p;if(!E){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(Zy(this.prevProjectionDelta.x,this.projectionDelta.x),Zy(this.prevProjectionDelta.y,this.projectionDelta.y)),el(this.projectionDelta,this.layoutCorrected,E,this.latestValues),(this.treeScale.x!==_||this.treeScale.y!==C||!a0(this.projectionDelta.x,this.prevProjectionDelta.x)||!a0(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",E)),Ko&&Rs.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=Mi(),this.projectionDelta=Mi(),this.projectionDeltaWithTransform=Mi()}setAnimationOrigin(d,p=!1){const m=this.snapshot,g=m?m.latestValues:{},y={...this.latestValues},v=Mi();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!p;const _=Mt(),C=m?m.source:void 0,E=this.layout?this.layout.source:void 0,k=C!==E,A=this.getStack(),S=!A||A.members.length<=1,N=!!(k&&!S&&this.options.crossfade===!0&&!this.path.some(uN));this.animationProgress=0;let D;this.mixTargetDelta=H=>{const O=H/1e3;l0(v.x,d.x,O),l0(v.y,d.y,O),this.setTargetDelta(v),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(tl(_,this.layout.layoutBox,this.relativeParent.layout.layoutBox),cN(this.relativeTarget,this.relativeTargetOrigin,_,O),D&&qA(this.relativeTarget,D)&&(this.isProjectionDirty=!1),D||(D=Mt()),Ln(D,this.relativeTarget)),k&&(this.animationValues=y,HA(y,g,this.latestValues,O,N,S)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=O},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&&(ls(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=pt.update(()=>{Yr.hasAnimatedSinceResize=!0,this.currentAnimation=OA(0,s0,{...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(s0),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&&Ix(this.options.animationType,this.layout.layoutBox,g.layoutBox)){m=this.target||Mt();const v=Tn(this.layout.layoutBox.x);m.x.min=d.target.x.min,m.x.max=m.x.min+v;const _=Tn(this.layout.layoutBox.y);m.y.min=d.target.y.min,m.y.max=m.y.min+_}Ln(p,m),Bi(p,y),el(this.projectionDeltaWithTransform,this.layoutCorrected,p,y)}}registerSharedNode(d,p){this.sharedNodes.has(d)||this.sharedNodes.set(d,new KA),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&&Zd("z",d,g,this.animationValues);for(let y=0;y<Kd.length;y++)Zd(`rotate${Kd[y]}`,d,g,this.animationValues),Zd(`skew${Kd[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 XA;const g={visibility:""},y=this.getTransformTemplate();if(this.needsReset)return this.needsReset=!1,g.opacity="",g.pointerEvents=$r(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 k={};return this.options.layoutId&&(k.opacity=this.latestValues.opacity!==void 0?this.latestValues.opacity:1,k.pointerEvents=$r(d==null?void 0:d.pointerEvents)||""),this.hasProjected&&!Ms(this.latestValues)&&(k.transform=y?y({},""):"none",this.hasProjected=!1),k}const _=v.animationValues||v.latestValues;this.applyTransformsToTarget(),g.transform=ZA(this.projectionDeltaWithTransform,this.treeScale,_),y&&(g.transform=y(_,g.transform));const{x:C,y:E}=this.projectionDelta;g.transformOrigin=`${C.origin*100}% ${E.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 k in Zr){if(_[k]===void 0)continue;const{correct:A,applyTo:S}=Zr[k],N=g.transform==="none"?_[k]:A(_[k],v);if(S){const D=S.length;for(let H=0;H<D;H++)g[S[H]]=N}else g[k]=N}return this.options.layoutId&&(g.pointerEvents=v===this?$r(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(i0),this.root.sharedNodes.clear()}}}function WA(n){n.updateLayout()}function JA(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:l,measuredBox:r}=n.layout,{animationType:c}=n.options,d=i.source!==n.layout.source;c==="size"?In(v=>{const _=d?i.measuredBox[v]:i.layoutBox[v],C=Tn(_);_.min=l[v].min,_.max=_.min+C}):Ix(c,i.layoutBox,l)&&In(v=>{const _=d?i.measuredBox[v]:i.layoutBox[v],C=Tn(l[v]);_.max=_.min+C,n.relativeTarget&&!n.currentAnimation&&(n.isProjectionDirty=!0,n.relativeTarget[v].max=n.relativeTarget[v].min+C)});const p=Mi();el(p,l,i.layoutBox);const m=Mi();d?el(m,n.applyTransform(r,!0),i.measuredBox):el(m,l,i.layoutBox);const g=!Rx(p);let y=!1;if(!n.resumeFrom){const v=n.getClosestProjectingParent();if(v&&!v.resumeFrom){const{snapshot:_,layout:C}=v;if(_&&C){const E=Mt();tl(E,i.layoutBox,_.layoutBox);const k=Mt();tl(k,l,C.layoutBox),Bx(E,k)||(y=!0),v.options.layoutRoot&&(n.relativeTarget=k,n.relativeTargetOrigin=E,n.relativeParent=v)}}}n.notifyListeners("didUpdate",{layout:l,snapshot:i,delta:m,layoutDelta:p,hasLayoutChanged:g,hasRelativeTargetChanged:y})}else if(n.isLead()){const{onExitComplete:l}=n.options;l&&l()}n.options.transition=void 0}function eN(n){Ko&&Rs.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 tN(n){n.isProjectionDirty=n.isSharedProjectionDirty=n.isTransformDirty=!1}function nN(n){n.clearSnapshot()}function i0(n){n.clearMeasurements()}function aN(n){n.isLayoutDirty=!1}function sN(n){const{visualElement:a}=n.options;a&&a.getProps().onBeforeLayoutMeasure&&a.notify("BeforeLayoutMeasure"),n.resetTransform()}function o0(n){n.finishAnimation(),n.targetDelta=n.relativeTarget=n.target=void 0,n.isProjectionDirty=!0}function iN(n){n.resolveTargetDelta()}function oN(n){n.calcProjection()}function lN(n){n.resetSkewAndRotation()}function rN(n){n.removeLeadSnapshot()}function l0(n,a,i){n.translate=xt(a.translate,0,i),n.scale=xt(a.scale,1,i),n.origin=a.origin,n.originPoint=a.originPoint}function r0(n,a,i,l){n.min=xt(a.min,i.min,l),n.max=xt(a.max,i.max,l)}function cN(n,a,i,l){r0(n.x,a.x,i.x,l),r0(n.y,a.y,i.y,l)}function uN(n){return n.animationValues&&n.animationValues.opacityExit!==void 0}const dN={duration:.45,ease:[.4,0,.1,1]},c0=n=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(n),u0=c0("applewebkit/")&&!c0("chrome/")?Math.round:Sn;function d0(n){n.min=u0(n.min),n.max=u0(n.max)}function fN(n){d0(n.x),d0(n.y)}function Ix(n,a,i){return n==="position"||n==="preserve-aspect"&&!mA(n0(a),n0(i),.2)}function hN(n){var a;return n!==n.root&&((a=n.scroll)===null||a===void 0?void 0:a.wasRoot)}const pN=Lx({attachResizeListener:(n,a)=>ul(n,"resize",a),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),Xd={current:void 0},Ux=Lx({measureScroll:n=>({x:n.scrollLeft,y:n.scrollTop}),defaultParent:()=>{if(!Xd.current){const n=new pN({});n.mount(window),n.setOptions({layoutScroll:!0}),Xd.current=n}return Xd.current},resetTransform:(n,a)=>{n.style.transform=a!==void 0?a:"none"},checkIsScrollRoot:n=>window.getComputedStyle(n).position==="fixed"}),mN={pan:{Feature:DA},drag:{Feature:jA,ProjectionNode:Ux,MeasureLayout:jx}};function gN(n,a,i){var l;if(n instanceof Element)return[n];if(typeof n=="string"){let r=document;const c=(l=void 0)!==null&&l!==void 0?l:r.querySelectorAll(n);return c?Array.from(c):[]}return Array.from(n)}function zx(n,a){const i=gN(n),l=new AbortController,r={passive:!0,...a,signal:l.signal};return[i,r,()=>l.abort()]}function f0(n){return a=>{a.pointerType==="touch"||xx()||n(a)}}function vN(n,a,i={}){const[l,r,c]=zx(n,i),d=f0(p=>{const{target:m}=p,g=a(p);if(typeof g!="function"||!m)return;const y=f0(v=>{g(v),m.removeEventListener("pointerleave",y)});m.addEventListener("pointerleave",y,r)});return l.forEach(p=>{p.addEventListener("pointerenter",d,r)}),c}function h0(n,a,i){const{props:l}=n;n.animationState&&l.whileHover&&n.animationState.setActive("whileHover",i==="Start");const r="onHover"+i,c=l[r];c&&pt.postRender(()=>c(a,vl(a)))}class yN extends us{mount(){const{current:a}=this.node;a&&(this.unmount=vN(a,i=>(h0(this.node,i,"Start"),l=>h0(this.node,l,"End"))))}unmount(){}}class bN extends us{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=gl(ul(this.node.current,"focus",()=>this.onFocus()),ul(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}const Vx=(n,a)=>a?n===a?!0:Vx(n,a.parentElement):!1,xN=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function _N(n){return xN.has(n.tagName)||n.tabIndex!==-1}const Zo=new WeakSet;function p0(n){return a=>{a.key==="Enter"&&n(a)}}function Qd(n,a){n.dispatchEvent(new PointerEvent("pointer"+a,{isPrimary:!0,bubbles:!0}))}const SN=(n,a)=>{const i=n.currentTarget;if(!i)return;const l=p0(()=>{if(Zo.has(i))return;Qd(i,"down");const r=p0(()=>{Qd(i,"up")}),c=()=>Qd(i,"cancel");i.addEventListener("keyup",r,a),i.addEventListener("blur",c,a)});i.addEventListener("keydown",l,a),i.addEventListener("blur",()=>i.removeEventListener("keydown",l),a)};function m0(n){return Dh(n)&&!xx()}function TN(n,a,i={}){const[l,r,c]=zx(n,i),d=p=>{const m=p.currentTarget;if(!m0(p)||Zo.has(m))return;Zo.add(m);const g=a(p),y=(C,E)=>{window.removeEventListener("pointerup",v),window.removeEventListener("pointercancel",_),!(!m0(C)||!Zo.has(m))&&(Zo.delete(m),typeof g=="function"&&g(C,{success:E}))},v=C=>{y(C,i.useGlobalTarget||Vx(m,C.target))},_=C=>{y(C,!1)};window.addEventListener("pointerup",v,r),window.addEventListener("pointercancel",_,r)};return l.forEach(p=>{!_N(p)&&p.getAttribute("tabindex")===null&&(p.tabIndex=0),(i.useGlobalTarget?window:p).addEventListener("pointerdown",d,r),p.addEventListener("focus",g=>SN(g,r),r)}),c}function g0(n,a,i){const{props:l}=n;n.animationState&&l.whileTap&&n.animationState.setActive("whileTap",i==="Start");const r="onTap"+(i==="End"?"":i),c=l[r];c&&pt.postRender(()=>c(a,vl(a)))}class CN extends us{mount(){const{current:a}=this.node;a&&(this.unmount=TN(a,i=>(g0(this.node,i,"Start"),(l,{success:r})=>g0(this.node,l,r?"End":"Cancel")),{useGlobalTarget:this.node.props.globalTapTarget}))}unmount(){}}const jf=new WeakMap,Wd=new WeakMap,EN=n=>{const a=jf.get(n.target);a&&a(n)},kN=n=>{n.forEach(EN)};function wN({root:n,...a}){const i=n||document;Wd.has(i)||Wd.set(i,{});const l=Wd.get(i),r=JSON.stringify(a);return l[r]||(l[r]=new IntersectionObserver(kN,{root:n,...a})),l[r]}function AN(n,a,i){const l=wN(a);return jf.set(n,i),l.observe(n),()=>{jf.delete(n),l.unobserve(n)}}const NN={some:0,all:1};class jN extends us{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:a={}}=this.node.getProps(),{root:i,margin:l,amount:r="some",once:c}=a,d={root:i?i.current:void 0,rootMargin:l,threshold:typeof r=="number"?r:NN[r]},p=m=>{const{isIntersecting:g}=m;if(this.isInView===g||(this.isInView=g,c&&!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(DN(a,i))&&this.startObserver()}unmount(){}}function DN({viewport:n={}},{viewport:a={}}={}){return i=>n[i]!==a[i]}const MN={inView:{Feature:jN},tap:{Feature:CN},focus:{Feature:bN},hover:{Feature:yN}},RN={layout:{ProjectionNode:Ux,MeasureLayout:jx}},tc={current:null},Mh={current:!1};function Hx(){if(Mh.current=!0,!!th)if(window.matchMedia){const n=window.matchMedia("(prefers-reduced-motion)"),a=()=>tc.current=n.matches;n.addListener(a),a()}else tc.current=!1}const BN=[...rx,Wt,rs],ON=n=>BN.find(lx(n)),v0=new WeakMap;function LN(n,a,i){for(const l in a){const r=a[l],c=i[l];if(Jt(r))n.addValue(l,r);else if(Jt(c))n.addValue(l,rl(r,{owner:n}));else if(c!==r)if(n.hasValue(l)){const d=n.getValue(l);d.liveStyle===!0?d.jump(r):d.hasAnimated||d.set(r)}else{const d=n.getStaticValue(l);n.addValue(l,rl(d!==void 0?d:r,{owner:n}))}}for(const l in i)a[l]===void 0&&n.removeValue(l);return a}const y0=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];class IN{scrapeMotionValuesFromProps(a,i,l){return{}}constructor({parent:a,props:i,presenceContext:l,reducedMotionConfig:r,blockInitialAnimation:c,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=wh,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 C=aa.now();this.renderScheduledAt<C&&(this.renderScheduledAt=C,pt.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=l,this.depth=a?a.depth+1:0,this.reducedMotionConfig=r,this.options=p,this.blockInitialAnimation=!!c,this.isControllingVariants=mc(i),this.isVariantNode=xb(i),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(a&&a.current);const{willChange:v,..._}=this.scrapeMotionValuesFromProps(i,{},this);for(const C in _){const E=_[C];m[C]!==void 0&&Jt(E)&&E.set(m[C],!1)}}mount(a){this.current=a,v0.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,l)=>this.bindToMotionValue(l,i)),Mh.current||Hx(),this.shouldReduceMotion=this.reducedMotionConfig==="never"?!1:this.reducedMotionConfig==="always"?!0:tc.current,this.parent&&this.parent.children.add(this),this.update(this.props,this.presenceContext)}unmount(){v0.delete(this.current),this.projection&&this.projection.unmount(),ls(this.notifyUpdate),ls(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 l=Hs.has(a),r=i.on("change",p=>{this.latestValues[a]=p,this.props.onUpdate&&pt.preRender(this.notifyUpdate),l&&this.projection&&(this.projection.isTransformDirty=!0)}),c=i.on("renderRequest",this.scheduleRender);let d;window.MotionCheckAppearSync&&(d=window.MotionCheckAppearSync(this,a,i)),this.valueSubscriptions.set(a,()=>{r(),c(),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 Ui){const i=Ui[a];if(!i)continue;const{isEnabled:l,Feature:r}=i;if(!this.features[a]&&r&&l(this.props)&&(this.features[a]=new r(this)),this.features[a]){const c=this.features[a];c.isMounted?c.update():(c.mount(),c.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):Mt()}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 l=0;l<y0.length;l++){const r=y0[l];this.propEventSubscriptions[r]&&(this.propEventSubscriptions[r](),delete this.propEventSubscriptions[r]);const c="on"+r,d=a[c];d&&(this.propEventSubscriptions[r]=this.on(r,d))}this.prevMotionValues=LN(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 l=this.values.get(a);i!==l&&(l&&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 l=this.values.get(a);return l===void 0&&i!==void 0&&(l=rl(i===null?void 0:i,{owner:this}),this.addValue(a,l)),l}readValue(a,i){var l;let r=this.latestValues[a]!==void 0||!this.current?this.latestValues[a]:(l=this.getBaseTargetFromProps(this.props,a))!==null&&l!==void 0?l:this.readValueFromInstance(this.current,a,this.options);return r!=null&&(typeof r=="string"&&(ix(r)||Xb(r))?r=parseFloat(r):!ON(r)&&rs.test(i)&&(r=nx(a,i)),this.setBaseTarget(a,Jt(r)?r.get():r)),Jt(r)?r.get():r}setBaseTarget(a,i){this.baseTarget[a]=i}getBaseTarget(a){var i;const{initial:l}=this.props;let r;if(typeof l=="string"||typeof l=="object"){const d=lh(this.props,l,(i=this.presenceContext)===null||i===void 0?void 0:i.custom);d&&(r=d[a])}if(l&&r!==void 0)return r;const c=this.getBaseTargetFromProps(this.props,a);return c!==void 0&&!Jt(c)?c:this.initialValues[a]!==void 0&&r===void 0?void 0:this.baseTarget[a]}on(a,i){return this.events[a]||(this.events[a]=new yh),this.events[a].add(i)}notify(a,...i){this.events[a]&&this.events[a].notify(...i)}}class Gx extends IN{constructor(){super(...arguments),this.KeyframeResolver=cx}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:l}){delete i[a],delete l[a]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:a}=this.props;Jt(a)&&(this.childSubscription=a.on("change",i=>{this.current&&(this.current.textContent=`${i}`)}))}}function UN(n){return window.getComputedStyle(n)}class zN extends Gx{constructor(){super(...arguments),this.type="html",this.renderInstance=Nb}readValueFromInstance(a,i){if(Hs.has(i)){const l=kh(i);return l&&l.default||0}else{const l=UN(a),r=(kb(i)?l.getPropertyValue(i):l[i])||0;return typeof r=="string"?r.trim():r}}measureInstanceViewportBox(a,{transformPagePoint:i}){return Ax(a,i)}build(a,i,l){uh(a,i,l.transformTemplate)}scrapeMotionValuesFromProps(a,i,l){return ph(a,i,l)}}class VN extends Gx{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=Mt}getBaseTargetFromProps(a,i){return a[i]}readValueFromInstance(a,i){if(Hs.has(i)){const l=kh(i);return l&&l.default||0}return i=jb.has(i)?i:sh(i),a.getAttribute(i)}scrapeMotionValuesFromProps(a,i,l){return Rb(a,i,l)}build(a,i,l){dh(a,i,this.isSVGTag,l.transformTemplate)}renderInstance(a,i,l,r){Db(a,i,l,r)}mount(a){this.isSVGTag=hh(a.tagName),super.mount(a)}}const HN=(n,a)=>oh(n)?new VN(a):new zN(a,{allowProjection:n!==x.Fragment}),GN=pk({...iA,...MN,...mN,...RN},HN),Et=NE(GN);function PN(){!Mh.current&&Hx();const[n]=x.useState(tc.current);return n}var vt;(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",n[n.SIGNAL=10]="SIGNAL"})(vt||(vt={}));var zt;(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"})(zt||(zt={}));var ss;(function(n){n[n.UNSPECIFIED=0]="UNSPECIFIED",n[n.ACTIVE=1]="ACTIVE",n[n.ARCHIVED=2]="ARCHIVED"})(ss||(ss={}));var is;(function(n){n[n.UNSPECIFIED=0]="UNSPECIFIED",n[n.OPEN=1]="OPEN",n[n.CLOSED=2]="CLOSED"})(is||(is={}));var Wn;(function(n){n[n.UNSPECIFIED=0]="UNSPECIFIED",n[n.OFF=1]="OFF",n[n.SUBSCRIPTION=2]="SUBSCRIPTION",n[n.API_KEY=3]="API_KEY"})(Wn||(Wn={}));var os;(function(n){n[n.UNSPECIFIED=0]="UNSPECIFIED",n[n.OFF=1]="OFF",n[n.ON=2]="ON"})(os||(os={}));const $N=8,b0="system",Ls="system";Object.assign(Object.create(null),{"":vt.UNSPECIFIED,text:vt.TEXT,tool_use:vt.TOOL_USE,tool_result:vt.TOOL_RESULT,error:vt.ERROR,status:vt.STATUS,system:vt.SYSTEM,finding:vt.FINDING,subtask_create:vt.SUBTASK_CREATE,user_input:vt.USER_INPUT,signal:vt.SIGNAL});vt.UNSPECIFIED+"",vt.TEXT+"",vt.TOOL_USE+"",vt.TOOL_RESULT+"",vt.ERROR+"",vt.STATUS+"",vt.SYSTEM+"",vt.FINDING+"",vt.SUBTASK_CREATE+"",vt.USER_INPUT+"",vt.SIGNAL+"";Object.assign(Object.create(null),{"":zt.UNSPECIFIED,not_started:zt.NOT_STARTED,working:zt.WORKING,paused:zt.PAUSED,complete:zt.COMPLETE,failed:zt.FAILED,pending:zt.NOT_STARTED,assigned:zt.NOT_STARTED,in_progress:zt.WORKING,waiting_input:zt.PAUSED,review:zt.PAUSED,done:zt.COMPLETE});zt.UNSPECIFIED+"",zt.NOT_STARTED+"",zt.WORKING+"",zt.PAUSED+"",zt.COMPLETE+"",zt.FAILED+"";Object.assign(Object.create(null),{"":ss.UNSPECIFIED,active:ss.ACTIVE,archived:ss.ARCHIVED});ss.UNSPECIFIED+"",ss.ACTIVE+"",ss.ARCHIVED+"";Object.assign(Object.create(null),{"":is.UNSPECIFIED,open:is.OPEN,closed:is.CLOSED});is.UNSPECIFIED+"",is.OPEN+"",is.CLOSED+"";Object.assign(Object.create(null),{"":Wn.UNSPECIFIED,off:Wn.OFF,subscription:Wn.SUBSCRIPTION,api_key:Wn.API_KEY});Wn.UNSPECIFIED+"",Wn.OFF+"",Wn.SUBSCRIPTION+"",Wn.API_KEY+"";Object.assign(Object.create(null),{"":os.UNSPECIFIED,off:os.OFF,on:os.ON});os.UNSPECIFIED+"",os.OFF+"",os.ON+"";function Da(n){return Array.isArray?Array.isArray(n):Fx(n)==="[object Array]"}function FN(n){if(typeof n=="string")return n;let a=n+"";return a=="0"&&1/n==-1/0?"-0":a}function YN(n){return n==null?"":FN(n)}function Jn(n){return typeof n=="string"}function Px(n){return typeof n=="number"}function qN(n){return n===!0||n===!1||KN(n)&&Fx(n)=="[object Boolean]"}function $x(n){return typeof n=="object"}function KN(n){return $x(n)&&n!==null}function _n(n){return n!=null}function Jd(n){return!n.trim().length}function Fx(n){return n==null?n===void 0?"[object Undefined]":"[object Null]":Object.prototype.toString.call(n)}const ZN="Incorrect 'index' type",XN=n=>`Invalid value for key ${n}`,QN=n=>`Pattern length exceeds max of ${n}.`,WN=n=>`Missing ${n} property in key`,JN=n=>`Property 'weight' in key '${n}' must be a positive integer`,x0=Object.prototype.hasOwnProperty;class e2{constructor(a){this._keys=[],this._keyMap={};let i=0;a.forEach(l=>{let r=Yx(l);this._keys.push(r),this._keyMap[r.id]=r,i+=r.weight}),this._keys.forEach(l=>{l.weight/=i})}get(a){return this._keyMap[a]}keys(){return this._keys}toJSON(){return JSON.stringify(this._keys)}}function Yx(n){let a=null,i=null,l=null,r=1,c=null;if(Jn(n)||Da(n))l=n,a=_0(n),i=Df(n);else{if(!x0.call(n,"name"))throw new Error(WN("name"));const d=n.name;if(l=d,x0.call(n,"weight")&&(r=n.weight,r<=0))throw new Error(JN(d));a=_0(d),i=Df(d),c=n.getFn}return{path:a,id:i,weight:r,src:l,getFn:c}}function _0(n){return Da(n)?n:n.split(".")}function Df(n){return Da(n)?n.join("."):n}function t2(n,a){let i=[],l=!1;const r=(c,d,p)=>{if(_n(c))if(!d[p])i.push(c);else{let m=d[p];const g=c[m];if(!_n(g))return;if(p===d.length-1&&(Jn(g)||Px(g)||qN(g)))i.push(YN(g));else if(Da(g)){l=!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,Jn(a)?a.split("."):a,0),l?i:i[0]}const n2={includeMatches:!1,findAllMatches:!1,minMatchCharLength:1},a2={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},s2={location:0,threshold:.6,distance:100},i2={useExtendedSearch:!1,getFn:t2,ignoreLocation:!1,ignoreFieldNorm:!1,fieldNormWeight:1};var _e={...a2,...n2,...s2,...i2};const o2=/[^ ]+/g;function l2(n=1,a=3){const i=new Map,l=Math.pow(10,a);return{get(r){const c=r.match(o2).length;if(i.has(c))return i.get(c);const d=1/Math.pow(c,.5*n),p=parseFloat(Math.round(d*l)/l);return i.set(c,p),p},clear(){i.clear()}}}class Rh{constructor({getFn:a=_e.getFn,fieldNormWeight:i=_e.fieldNormWeight}={}){this.norm=l2(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,l)=>{this._keysMap[i.id]=l})}create(){this.isCreated||!this.docs.length||(this.isCreated=!0,Jn(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();Jn(a)?this._addString(a,i):this._addObject(a,i)}removeAt(a){this.records.splice(a,1);for(let i=a,l=this.size();i<l;i+=1)this.records[i].i-=1}getValueForItemAtKeyId(a,i){return a[this._keysMap[i]]}size(){return this.records.length}_addString(a,i){if(!_n(a)||Jd(a))return;let l={v:a,i,n:this.norm.get(a)};this.records.push(l)}_addObject(a,i){let l={i,$:{}};this.keys.forEach((r,c)=>{let d=r.getFn?r.getFn(a):this.getFn(a,r.path);if(_n(d)){if(Da(d)){let p=[];const m=[{nestedArrIndex:-1,value:d}];for(;m.length;){const{nestedArrIndex:g,value:y}=m.pop();if(_n(y))if(Jn(y)&&!Jd(y)){let v={v:y,i:g,n:this.norm.get(y)};p.push(v)}else Da(y)&&y.forEach((v,_)=>{m.push({nestedArrIndex:_,value:v})})}l.$[c]=p}else if(Jn(d)&&!Jd(d)){let p={v:d,n:this.norm.get(d)};l.$[c]=p}}}),this.records.push(l)}toJSON(){return{keys:this.keys,records:this.records}}}function qx(n,a,{getFn:i=_e.getFn,fieldNormWeight:l=_e.fieldNormWeight}={}){const r=new Rh({getFn:i,fieldNormWeight:l});return r.setKeys(n.map(Yx)),r.setSources(a),r.create(),r}function r2(n,{getFn:a=_e.getFn,fieldNormWeight:i=_e.fieldNormWeight}={}){const{keys:l,records:r}=n,c=new Rh({getFn:a,fieldNormWeight:i});return c.setKeys(l),c.setIndexRecords(r),c}function Lr(n,{errors:a=0,currentLocation:i=0,expectedLocation:l=0,distance:r=_e.distance,ignoreLocation:c=_e.ignoreLocation}={}){const d=a/n.length;if(c)return d;const p=Math.abs(l-i);return r?d+p/r:p?1:d}function c2(n=[],a=_e.minMatchCharLength){let i=[],l=-1,r=-1,c=0;for(let d=n.length;c<d;c+=1){let p=n[c];p&&l===-1?l=c:!p&&l!==-1&&(r=c-1,r-l+1>=a&&i.push([l,r]),l=-1)}return n[c-1]&&c-l>=a&&i.push([l,c-1]),i}const Bs=32;function u2(n,a,i,{location:l=_e.location,distance:r=_e.distance,threshold:c=_e.threshold,findAllMatches:d=_e.findAllMatches,minMatchCharLength:p=_e.minMatchCharLength,includeMatches:m=_e.includeMatches,ignoreLocation:g=_e.ignoreLocation}={}){if(a.length>Bs)throw new Error(QN(Bs));const y=a.length,v=n.length,_=Math.max(0,Math.min(l,v));let C=c,E=_;const k=p>1||m,A=k?Array(v):[];let S;for(;(S=n.indexOf(a,E))>-1;){let R=Lr(a,{currentLocation:S,expectedLocation:_,distance:r,ignoreLocation:g});if(C=Math.min(R,C),E=S+y,k){let L=0;for(;L<y;)A[S+L]=1,L+=1}}E=-1;let N=[],D=1,H=y+v;const O=1<<y-1;for(let R=0;R<y;R+=1){let L=0,G=H;for(;L<G;)Lr(a,{errors:R,currentLocation:_+G,expectedLocation:_,distance:r,ignoreLocation:g})<=C?L=G:H=G,G=Math.floor((H-L)/2+L);H=G;let ee=Math.max(1,_-G+1),te=d?v:Math.min(_+G,v)+y,ne=Array(te+2);ne[te+1]=(1<<R)-1;for(let he=te;he>=ee;he-=1){let oe=he-1,j=i[n.charAt(oe)];if(k&&(A[oe]=+!!j),ne[he]=(ne[he+1]<<1|1)&j,R&&(ne[he]|=(N[he+1]|N[he])<<1|1|N[he+1]),ne[he]&O&&(D=Lr(a,{errors:R,currentLocation:oe,expectedLocation:_,distance:r,ignoreLocation:g}),D<=C)){if(C=D,E=oe,E<=_)break;ee=Math.max(1,2*_-E)}}if(Lr(a,{errors:R+1,currentLocation:_,expectedLocation:_,distance:r,ignoreLocation:g})>C)break;N=ne}const $={isMatch:E>=0,score:Math.max(.001,D)};if(k){const R=c2(A,p);R.length?m&&($.indices=R):$.isMatch=!1}return $}function d2(n){let a={};for(let i=0,l=n.length;i<l;i+=1){const r=n.charAt(i);a[r]=(a[r]||0)|1<<l-i-1}return a}const nc=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 Kx{constructor(a,{location:i=_e.location,threshold:l=_e.threshold,distance:r=_e.distance,includeMatches:c=_e.includeMatches,findAllMatches:d=_e.findAllMatches,minMatchCharLength:p=_e.minMatchCharLength,isCaseSensitive:m=_e.isCaseSensitive,ignoreDiacritics:g=_e.ignoreDiacritics,ignoreLocation:y=_e.ignoreLocation}={}){if(this.options={location:i,threshold:l,distance:r,includeMatches:c,findAllMatches:d,minMatchCharLength:p,isCaseSensitive:m,ignoreDiacritics:g,ignoreLocation:y},a=m?a:a.toLowerCase(),a=g?nc(a):a,this.pattern=a,this.chunks=[],!this.pattern.length)return;const v=(C,E)=>{this.chunks.push({pattern:C,alphabet:d2(C),startIndex:E})},_=this.pattern.length;if(_>Bs){let C=0;const E=_%Bs,k=_-E;for(;C<k;)v(this.pattern.substr(C,Bs),C),C+=Bs;if(E){const A=_-Bs;v(this.pattern.substr(A),A)}}else v(this.pattern,0)}searchIn(a){const{isCaseSensitive:i,ignoreDiacritics:l,includeMatches:r}=this.options;if(a=i?a:a.toLowerCase(),a=l?nc(a):a,this.pattern===a){let k={isMatch:!0,score:0};return r&&(k.indices=[[0,a.length-1]]),k}const{location:c,distance:d,threshold:p,findAllMatches:m,minMatchCharLength:g,ignoreLocation:y}=this.options;let v=[],_=0,C=!1;this.chunks.forEach(({pattern:k,alphabet:A,startIndex:S})=>{const{isMatch:N,score:D,indices:H}=u2(a,k,A,{location:c+S,distance:d,threshold:p,findAllMatches:m,minMatchCharLength:g,includeMatches:r,ignoreLocation:y});N&&(C=!0),_+=D,N&&H&&(v=[...v,...H])});let E={isMatch:C,score:C?_/this.chunks.length:1};return C&&r&&(E.indices=v),E}}class ds{constructor(a){this.pattern=a}static isMultiMatch(a){return S0(a,this.multiRegex)}static isSingleMatch(a){return S0(a,this.singleRegex)}search(){}}function S0(n,a){const i=n.match(a);return i?i[1]:null}class f2 extends ds{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 h2 extends ds{constructor(a){super(a)}static get type(){return"inverse-exact"}static get multiRegex(){return/^!"(.*)"$/}static get singleRegex(){return/^!(.*)$/}search(a){const l=a.indexOf(this.pattern)===-1;return{isMatch:l,score:l?0:1,indices:[0,a.length-1]}}}class p2 extends ds{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 m2 extends ds{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 g2 extends ds{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 v2 extends ds{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 Zx extends ds{constructor(a,{location:i=_e.location,threshold:l=_e.threshold,distance:r=_e.distance,includeMatches:c=_e.includeMatches,findAllMatches:d=_e.findAllMatches,minMatchCharLength:p=_e.minMatchCharLength,isCaseSensitive:m=_e.isCaseSensitive,ignoreDiacritics:g=_e.ignoreDiacritics,ignoreLocation:y=_e.ignoreLocation}={}){super(a),this._bitapSearch=new Kx(a,{location:i,threshold:l,distance:r,includeMatches:c,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 Xx extends ds{constructor(a){super(a)}static get type(){return"include"}static get multiRegex(){return/^'"(.*)"$/}static get singleRegex(){return/^'(.*)$/}search(a){let i=0,l;const r=[],c=this.pattern.length;for(;(l=a.indexOf(this.pattern,i))>-1;)i=l+c,r.push([l,i-1]);const d=!!r.length;return{isMatch:d,score:d?0:1,indices:r}}}const Mf=[f2,Xx,p2,m2,v2,g2,h2,Zx],T0=Mf.length,y2=/ +(?=(?:[^\"]*\"[^\"]*\")*[^\"]*$)/,b2="|";function x2(n,a={}){return n.split(b2).map(i=>{let l=i.trim().split(y2).filter(c=>c&&!!c.trim()),r=[];for(let c=0,d=l.length;c<d;c+=1){const p=l[c];let m=!1,g=-1;for(;!m&&++g<T0;){const y=Mf[g];let v=y.isMultiMatch(p);v&&(r.push(new y(v,a)),m=!0)}if(!m)for(g=-1;++g<T0;){const y=Mf[g];let v=y.isSingleMatch(p);if(v){r.push(new y(v,a));break}}}return r})}const _2=new Set([Zx.type,Xx.type]);class S2{constructor(a,{isCaseSensitive:i=_e.isCaseSensitive,ignoreDiacritics:l=_e.ignoreDiacritics,includeMatches:r=_e.includeMatches,minMatchCharLength:c=_e.minMatchCharLength,ignoreLocation:d=_e.ignoreLocation,findAllMatches:p=_e.findAllMatches,location:m=_e.location,threshold:g=_e.threshold,distance:y=_e.distance}={}){this.query=null,this.options={isCaseSensitive:i,ignoreDiacritics:l,includeMatches:r,minMatchCharLength:c,findAllMatches:p,ignoreLocation:d,location:m,threshold:g,distance:y},a=i?a:a.toLowerCase(),a=l?nc(a):a,this.pattern=a,this.query=x2(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:l,isCaseSensitive:r,ignoreDiacritics:c}=this.options;a=r?a:a.toLowerCase(),a=c?nc(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,C=v.length;_<C;_+=1){const E=v[_],{isMatch:k,indices:A,score:S}=E.search(a);if(k){if(d+=1,m+=S,l){const N=E.constructor.type;_2.has(N)?p=[...p,...A]:p.push(A)}}else{m=0,d=0,p.length=0;break}}if(d){let _={isMatch:!0,score:m/d};return l&&(_.indices=p),_}}return{isMatch:!1,score:1}}}const Rf=[];function T2(...n){Rf.push(...n)}function Bf(n,a){for(let i=0,l=Rf.length;i<l;i+=1){let r=Rf[i];if(r.condition(n,a))return new r(n,a)}return new Kx(n,a)}const ac={AND:"$and",OR:"$or"},Of={PATH:"$path",PATTERN:"$val"},Lf=n=>!!(n[ac.AND]||n[ac.OR]),C2=n=>!!n[Of.PATH],E2=n=>!Da(n)&&$x(n)&&!Lf(n),C0=n=>({[ac.AND]:Object.keys(n).map(a=>({[a]:n[a]}))});function Qx(n,a,{auto:i=!0}={}){const l=r=>{let c=Object.keys(r);const d=C2(r);if(!d&&c.length>1&&!Lf(r))return l(C0(r));if(E2(r)){const m=d?r[Of.PATH]:c[0],g=d?r[Of.PATTERN]:r[m];if(!Jn(g))throw new Error(XN(m));const y={keyId:Df(m),pattern:g};return i&&(y.searcher=Bf(g,a)),y}let p={children:[],operator:c[0]};return c.forEach(m=>{const g=r[m];Da(g)&&g.forEach(y=>{p.children.push(l(y))})}),p};return Lf(n)||(n=C0(n)),l(n)}function k2(n,{ignoreFieldNorm:a=_e.ignoreFieldNorm}){n.forEach(i=>{let l=1;i.matches.forEach(({key:r,norm:c,score:d})=>{const p=r?r.weight:null;l*=Math.pow(d===0&&p?Number.EPSILON:d,(p||1)*(a?1:c))}),i.score=l})}function w2(n,a){const i=n.matches;a.matches=[],_n(i)&&i.forEach(l=>{if(!_n(l.indices)||!l.indices.length)return;const{indices:r,value:c}=l;let d={indices:r,value:c};l.key&&(d.key=l.key.src),l.idx>-1&&(d.refIndex=l.idx),a.matches.push(d)})}function A2(n,a){a.score=n.score}function N2(n,a,{includeMatches:i=_e.includeMatches,includeScore:l=_e.includeScore}={}){const r=[];return i&&r.push(w2),l&&r.push(A2),n.map(c=>{const{idx:d}=c,p={item:a[d],refIndex:d};return r.length&&r.forEach(m=>{m(c,p)}),p})}class Yi{constructor(a,i={},l){this.options={..._e,...i},this.options.useExtendedSearch,this._keyStore=new e2(this.options.keys),this.setCollection(a,l)}setCollection(a,i){if(this._docs=a,i&&!(i instanceof Rh))throw new Error(ZN);this._myIndex=i||qx(this.options.keys,this._docs,{getFn:this.options.getFn,fieldNormWeight:this.options.fieldNormWeight})}add(a){_n(a)&&(this._docs.push(a),this._myIndex.add(a))}remove(a=()=>!1){const i=[];for(let l=0,r=this._docs.length;l<r;l+=1){const c=this._docs[l];a(c,l)&&(this.removeAt(l),l-=1,r-=1,i.push(c))}return i}removeAt(a){this._docs.splice(a,1),this._myIndex.removeAt(a)}getIndex(){return this._myIndex}search(a,{limit:i=-1}={}){const{includeMatches:l,includeScore:r,shouldSort:c,sortFn:d,ignoreFieldNorm:p}=this.options;let m=Jn(a)?Jn(this._docs[0])?this._searchStringList(a):this._searchObjectList(a):this._searchLogical(a);return k2(m,{ignoreFieldNorm:p}),c&&m.sort(d),Px(i)&&i>-1&&(m=m.slice(0,i)),N2(m,this._docs,{includeMatches:l,includeScore:r})}_searchStringList(a){const i=Bf(a,this.options),{records:l}=this._myIndex,r=[];return l.forEach(({v:c,i:d,n:p})=>{if(!_n(c))return;const{isMatch:m,score:g,indices:y}=i.searchIn(c);m&&r.push({item:c,idx:d,matches:[{score:g,value:c,norm:p,indices:y}]})}),r}_searchLogical(a){const i=Qx(a,this.options),l=(p,m,g)=>{if(!p.children){const{keyId:v,searcher:_}=p,C=this._findMatches({key:this._keyStore.get(v),value:this._myIndex.getValueForItemAtKeyId(m,v),searcher:_});return C&&C.length?[{idx:g,item:m,matches:C}]:[]}const y=[];for(let v=0,_=p.children.length;v<_;v+=1){const C=p.children[v],E=l(C,m,g);if(E.length)y.push(...E);else if(p.operator===ac.AND)return[]}return y},r=this._myIndex.records,c={},d=[];return r.forEach(({$:p,i:m})=>{if(_n(p)){let g=l(i,p,m);g.length&&(c[m]||(c[m]={idx:m,item:p,matches:[]},d.push(c[m])),g.forEach(({matches:y})=>{c[m].matches.push(...y)}))}}),d}_searchObjectList(a){const i=Bf(a,this.options),{keys:l,records:r}=this._myIndex,c=[];return r.forEach(({$:d,i:p})=>{if(!_n(d))return;let m=[];l.forEach((g,y)=>{m.push(...this._findMatches({key:g,value:d[y],searcher:i}))}),m.length&&c.push({idx:p,item:d,matches:m})}),c}_findMatches({key:a,value:i,searcher:l}){if(!_n(i))return[];let r=[];if(Da(i))i.forEach(({v:c,i:d,n:p})=>{if(!_n(c))return;const{isMatch:m,score:g,indices:y}=l.searchIn(c);m&&r.push({score:g,key:a,value:c,idx:d,norm:p,indices:y})});else{const{v:c,n:d}=i,{isMatch:p,score:m,indices:g}=l.searchIn(c);p&&r.push({score:m,key:a,value:c,norm:d,indices:g})}return r}}Yi.version="7.1.0";Yi.createIndex=qx;Yi.parseIndex=r2;Yi.config=_e;Yi.parseQuery=Qx;T2(S2);function E0(n,a,i,l){if(!a.trim())return[];const r=.3;return new Yi(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 j2="_breadcrumbs_17or2_1",D2="_list_17or2_11",M2="_item_17or2_21",R2="_separator_17or2_28",B2="_link_17or2_34",O2="_current_17or2_57",Ai={breadcrumbs:j2,list:D2,item:M2,separator:R2,link:B2,current:O2},L2="›";function qi({segments:n}){return f.jsx("nav",{className:Ai.breadcrumbs,"aria-label":"Breadcrumb","data-testid":"breadcrumbs",children:f.jsx("ol",{className:Ai.list,children:n.map((a,i)=>{const l=i===n.length-1;return f.jsxs("li",{className:Ai.item,children:[i>0&&f.jsx("span",{className:Ai.separator,"aria-hidden":"true",children:L2}),a.url&&!l?f.jsx(Kf,{className:Ai.link,to:a.url,title:a.label,children:a.label}):f.jsx("span",{className:Ai.current,"aria-current":"page",title:a.label,children:a.label})]},i)})})})}function If(){If=function(r,c){return new i(r,void 0,c)};var n=RegExp.prototype,a=new WeakMap;function i(r,c,d){var p=new RegExp(r,c);return a.set(p,d||a.get(r)),sc(p,i.prototype)}function l(r,c){var d=a.get(c);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,c){if(typeof c!="function"&&c!==null)throw new TypeError("Super expression must either be null or a function");r.prototype=Object.create(c&&c.prototype,{constructor:{value:r,writable:!0,configurable:!0}}),Object.defineProperty(r,"prototype",{writable:!1}),c&&sc(r,c)})(i,RegExp),i.prototype.exec=function(r){var c=n.exec.call(this,r);if(c){c.groups=l(c,this);var d=c.indices;d&&(d.groups=l(d,this))}return c},i.prototype[Symbol.replace]=function(r,c){if(typeof c=="string"){var d=a.get(this);return n[Symbol.replace].call(this,r,c.replace(/\$<([^>]+)>/g,function(m,g){var y=d[g];return"$"+(Array.isArray(y)?y.join("$"):y)}))}if(typeof c=="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(l(m,p)),c.apply(this,m)})}return n[Symbol.replace].call(this,r,c)},If.apply(this,arguments)}function sc(n,a){return sc=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(i,l){return i.__proto__=l,i},sc(n,a)}function k0(n,a){(a==null||a>n.length)&&(a=n.length);for(var i=0,l=new Array(a);i<a;i++)l[i]=n[i];return l}function ef(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,c){if(r){if(typeof r=="string")return k0(r,c);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)?k0(r,c):void 0}})(n))||a){i&&(n=i);var l=0;return function(){return l>=n.length?{done:!0}:{done:!1,value:n[l++]}}}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 I2=(function(n){return function(a){return a===void 0&&(a={}),(function(l,r){if(r&&!l.registered(r))throw new Error('The default language "'+r+'" is not registered with refractor.')})(n,a.defaultLanguage),function(l){T1(l,"element",i)};function i(l,r,c){var d,p;if(c&&c.tagName==="pre"&&l.tagName==="code"){var m=(l==null||(d=l.data)==null?void 0:d.meta)||(l==null||(p=l.properties)==null?void 0:p.metastring)||"";l.properties.className?typeof l.properties.className=="boolean"?l.properties.className=[]:Array.isArray(l.properties.className)||(l.properties.className=[l.properties.className]):l.properties.className=[];var g,y,v=(function(O){for(var $,R=ef(O.properties.className);!($=R()).done;){var L=$.value;if(L.slice(0,9)==="language-")return L.slice(9).toLowerCase()}return null})(l);if(!v&&a.defaultLanguage&&l.properties.className.push("language-"+(v=a.defaultLanguage)),l.properties.className.push("code-highlight"),v)try{var _,C;C=(_=v)!=null&&_.includes("diff-")?v.split("-")[1]:v,g=n.highlight(jr(l),C),c.properties.className=(c.properties.className||[]).concat("language-"+C)}catch(O){if(!a.ignoreMissing||!/Unknown language/.test(O.message))throw O;g=l}else g=l;g.children=(y=1,function O($){return $.reduce(function(R,L){if(L.type==="text"){var G=L.value,ee=(G.match(/\n/g)||"").length;if(ee===0)L.position={start:{line:y,column:1},end:{line:y,column:1}},R.push(L);else for(var te,ne=G.split(`
|
|
88
|
-
`),ie=ef(ne.entries());!(te=ie()).done;){var he=te.value,oe=he[0],j=he[1];R.push({type:"text",value:oe===ne.length-1?j:j+`
|
|
89
|
-
`,position:{start:{line:y+oe,column:1},end:{line:y+oe,column:1}}})}return y+=ee,R}if(Object.prototype.hasOwnProperty.call(L,"children")){var Z=y;return L.children=O(L.children),R.push(L),L.position={start:{line:Z,column:1},end:{line:y,column:1}},R}return R.push(L),R},[])})(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 E,k=(function(O){var $=/{([\d,-]+)}/,R=O.split(",").map(function(ee){return ee.trim()}).join();if($.test(R)){var L=$.exec(R)[1],G=E1(L);return function(ee){return G.includes(ee+1)}}return function(){return!1}})(m),A=(function(O){var $=If(/showLineNumbers=(\d+)/i,{lines:1});if($.test(O)){var R=$.exec(O);return Number(R.groups.lines)}return 1})(m),S=(function(O){for(var $=new Array(O),R=0;R<O;R++)$[R]={type:"element",tagName:"span",properties:{className:[]},children:[]};return $})(g.position.end.line),N=["showlinenumbers=false",'showlinenumbers="false"',"showlinenumbers={false}"],D=function(){var O,$,R=E.value,L=R[0],G=R[1];G.properties.className=["code-line"];var ee=k1(g,function(te){return te.position.start.line<=L+1&&te.position.end.line>=L+1});G.children=ee.children,(m.toLowerCase().includes("showLineNumbers".toLowerCase())||a.showLineNumbers===!0||typeof a.showLineNumbers=="object"&&a.showLineNumbers.includes(v))&&!N.some(function(te){return m.toLowerCase().includes(te)})&&(G.properties.line=[(L+A).toString()],G.properties.className.push("line-number")),k(L)&&G.properties.className.push("highlight-line"),(v==="diff"||(O=v)!=null&&O.includes("diff-"))&&jr(G).substring(0,1)==="-"?G.properties.className.push("deleted"):(v==="diff"||($=v)!=null&&$.includes("diff-"))&&jr(G).substring(0,1)==="+"&&G.properties.className.push("inserted")},H=ef(S.entries());!(E=H()).done;)D();S.length>0&&jr(S[S.length-1]).trim()===""&&S.pop(),l.children=S}}}})(C1);const U2="_systemContextEvent_5vmgk_1",z2="_systemContextHeader_5vmgk_7",V2="_systemContextBadge_5vmgk_28",H2="_systemContextToggle_5vmgk_37",G2="_systemContextPre_5vmgk_43",P2="_systemContextEllipsis_5vmgk_54",$2="_systemEvent_5vmgk_58",F2="_systemTimestamp_5vmgk_65",Y2="_textEvent_5vmgk_69",q2="_toolUseEvent_5vmgk_155",K2="_toolUseHeader_5vmgk_175",Z2="_toolUsePrefix_5vmgk_182",X2="_toolUseName_5vmgk_187",Q2="_toolUseArgs_5vmgk_192",W2="_toolResultEvent_5vmgk_203",J2="_toolResultHeader_5vmgk_208",ej="_toolResultIndicatorOk_5vmgk_232",tj="_toolResultIndicatorError_5vmgk_239",nj="_toolResultLabel_5vmgk_246",aj="_toolResultToggle_5vmgk_250",sj="_toolResultCommand_5vmgk_256",ij="_toolResultEllipsis_5vmgk_266",oj="_toolResultPre_5vmgk_270",lj="_errorEvent_5vmgk_291",rj="_statusEvent_5vmgk_299",cj="_userInputEvent_5vmgk_308",uj="_userInputContent_5vmgk_314",dj="_signalEvent_5vmgk_331",fj="_signalBadge_5vmgk_342",hj="_signalContent_5vmgk_351",pj="_defaultEvent_5vmgk_356",Ye={systemContextEvent:U2,systemContextHeader:z2,systemContextBadge:V2,systemContextToggle:H2,systemContextPre:G2,systemContextEllipsis:P2,systemEvent:$2,systemTimestamp:F2,textEvent:Y2,toolUseEvent:q2,toolUseHeader:K2,toolUsePrefix:Z2,toolUseName:X2,toolUseArgs:Q2,toolResultEvent:W2,toolResultHeader:J2,toolResultIndicatorOk:ej,toolResultIndicatorError:tj,toolResultLabel:nj,toolResultToggle:aj,toolResultCommand:sj,toolResultEllipsis:ij,toolResultPre:oj,errorEvent:lj,statusEvent:rj,userInputEvent:cj,userInputContent:uj,signalEvent:dj,signalBadge:fj,signalContent:hj,defaultEvent:pj},w0=3;function mj({content:n}){const[a,i]=x.useState(!1),l=n.split(`
|
|
90
|
-
`),r=l.length>w0,c=a?n:l.slice(0,w0).join(`
|
|
91
|
-
`);return f.jsxs("div",{className:Ye.systemContextEvent,"data-testid":"system-context-event",children:[f.jsxs("button",{type:"button",className:Ye.systemContextHeader,onClick:()=>{i(d=>!d)},"aria-expanded":a,children:[f.jsx("span",{className:Ye.systemContextBadge,children:"SYSTEM PROMPT"}),r&&f.jsx("span",{className:Ye.systemContextToggle,"aria-hidden":"true",children:a?"▾":"▸"})]}),f.jsxs("pre",{className:Ye.systemContextPre,children:[c,!a&&r&&f.jsx("span",{className:Ye.systemContextEllipsis,children:"…"})]})]})}function gj({time:n,content:a}){return f.jsxs("div",{className:Ye.systemEvent,children:[f.jsxs("span",{className:Ye.systemTimestamp,children:["[",n,"]"]})," ",a]})}function vj({content:n}){return f.jsx("div",{className:Ye.textEvent,children:f.jsx(Vf,{remarkPlugins:[Hf],rehypePlugins:[I2],children:n})})}function yj({content:n}){let a="",i=n;try{const l=JSON.parse(n);a=l.tool||"",i=JSON.stringify(l.args,null,2)}catch{}return f.jsxs("div",{className:Ye.toolUseEvent,children:[f.jsxs("div",{className:Ye.toolUseHeader,children:[f.jsx("span",{className:Ye.toolUsePrefix,children:">"}),a?f.jsx("span",{className:Ye.toolUseName,children:a}):null]}),f.jsx("pre",{className:Ye.toolUseArgs,children:i})]})}const A0=5;function bj(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 l=typeof i.path=="string"?` in ${i.path}`:"";return`${i.pattern}${l}`}if(typeof i.path=="string")return i.path;if(typeof i.query=="string")return i.query;try{const l=JSON.stringify(a);return l.length>150?`${l.slice(0,150)}…`:l}catch{return""}}function xj({content:n,raw:a,toolUseCtx:i}){const[l,r]=x.useState(!1);let c=!1;if(a)try{c=JSON.parse(a).is_error===!0}catch{}const d=n.split(`
|
|
92
|
-
`),p=d.length>A0,m=l?n:d.slice(0,A0).join(`
|
|
93
|
-
`),y=((i==null?void 0:i.tool)??"")||(c?"Tool error":"Tool output"),v=i?bj(i.tool,i.args):"",_=f.jsxs(f.Fragment,{children:[f.jsx("span",{className:c?Ye.toolResultIndicatorError:Ye.toolResultIndicatorOk,"aria-label":c?"error":"success","data-testid":c?"tool-result-indicator-error":"tool-result-indicator-ok",children:c?"✗":"✓"}),f.jsx("span",{className:Ye.toolResultLabel,"data-testid":"tool-result-label",children:y}),p&&f.jsx("span",{className:Ye.toolResultToggle,"aria-hidden":"true",children:l?"▾":"▸"})]});return f.jsxs("div",{className:Ye.toolResultEvent,"data-testid":"tool-result",children:[p?f.jsx("button",{className:Ye.toolResultHeader,"data-testid":"tool-result-header",onClick:()=>{r(C=>!C)},"aria-expanded":l,children:_}):f.jsx("div",{className:Ye.toolResultHeader,"data-testid":"tool-result-header",children:_}),v&&f.jsx("div",{className:Ye.toolResultCommand,children:v}),f.jsxs("pre",{className:Ye.toolResultPre,"data-testid":"tool-result-content",children:[m,!l&&p&&f.jsx("span",{className:Ye.toolResultEllipsis,children:"…"})]})]})}function _j({content:n}){return f.jsxs("div",{className:Ye.errorEvent,children:["Error: ",n]})}function Sj({content:n}){return f.jsxs("div",{className:Ye.statusEvent,children:["--- ",n," ---"]})}function Tj({content:n}){return f.jsx("div",{className:Ye.userInputEvent,children:f.jsx("span",{className:Ye.userInputContent,children:n})})}function Cj({content:n}){return f.jsxs("div",{className:Ye.signalEvent,"data-testid":"signal-event",children:[f.jsx("span",{className:Ye.signalBadge,children:"SIGNAL"}),f.jsx("span",{className:Ye.signalContent,children:n})]})}function Ej({content:n}){return f.jsx("div",{className:Ye.defaultEvent,children:n})}function kj({event:n,toolUseCtx:a}){const i=new Date(n.timestamp).toLocaleTimeString();switch(n.eventType){case"system":{if(n.raw)try{if(JSON.parse(n.raw).systemContext===!0)return f.jsx(mj,{content:n.content})}catch{}return f.jsx(gj,{time:i,content:n.content})}case"text":case"output":return f.jsx(vj,{content:n.content});case"tool_use":return f.jsx(yj,{content:n.content});case"tool_result":return f.jsx(xj,{content:n.content,raw:n.raw,toolUseCtx:a});case"error":return f.jsx(_j,{content:n.content});case"status":return f.jsx(Sj,{content:n.content});case"user_input":return f.jsx(Tj,{content:n.content});case"signal":return f.jsx(Cj,{content:n.content});default:return f.jsx(Ej,{content:n.content})}}const wj="_overlay_cmicx_1",Aj="_dialog_cmicx_11",Nj="_title_cmicx_30",jj="_description_cmicx_38",Dj="_actions_cmicx_45",Mj="_cancelButton_cmicx_52",Rj="_confirmButton_cmicx_79",js={overlay:wj,dialog:Aj,title:Nj,description:jj,actions:Dj,cancelButton:Mj,confirmButton:Rj};function yc({isOpen:n,title:a,description:i,confirmLabel:l="Delete",onConfirm:r,onCancel:c}){const d=x.useId(),p=x.useId();return f.jsx(Vn,{children:n&&f.jsx(Et.div,{className:js.overlay,initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.15},onClick:c,onKeyDown:m=>{m.key==="Escape"&&c()},role:"dialog","aria-modal":"true","aria-labelledby":d,"aria-describedby":i?p:void 0,children:f.jsxs(Et.div,{className:js.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:[f.jsx("h3",{id:d,className:js.title,children:a}),i&&f.jsx("p",{id:p,className:js.description,children:i}),f.jsxs("div",{className:js.actions,children:[f.jsx("button",{type:"button",className:js.cancelButton,onClick:c,autoFocus:!0,children:"Cancel"}),f.jsx("button",{type:"button",className:js.confirmButton,onClick:r,children:l})]})]})})})}const Bj="_spinner_1uyt1_1",Oj="_spin_1uyt1_1",Lj="_sm_1uyt1_14",Ij="_md_1uyt1_20",Uj="_lg_1uyt1_26",zj="_xl_1uyt1_32",N0={spinner:Bj,spin:Oj,sm:Lj,md:Ij,lg:Uj,xl:zj};function ic({size:n="md",className:a,label:i="Loading",liveRegion:l=!1}){return f.jsx("span",{className:`${N0.spinner} ${N0[n]} ${a??""}`,role:l?"status":void 0,"aria-label":i,"aria-hidden":l?void 0:!0})}const Vj="_splash_1bn1g_1",Hj="_logo_1bn1g_11",j0={splash:Vj,logo:Hj};function Gj(){return f.jsxs("div",{className:j0.splash,"data-testid":"splash-screen",children:[f.jsx("img",{src:"/grackle-logo.png",alt:"Grackle",className:j0.logo}),f.jsx(ic,{size:"xl",label:"Loading Grackle",liveRegion:!0})]})}const Uf={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 cs(n){return n==="blocked"?Uf.blocked:Uf[Bh(n)]}const Pj={not_started:"statusPending",working:"statusInProgress",paused:"statusWaitingInput",complete:"statusDone",failed:"statusFailed"};function $j(n){return Pj[Bh(n)]??"statusPending"}const Fj=["working","paused","failed","not_started","blocked","complete"],D0=["not_started","working","paused","complete","failed"],Yj={pending:"not_started",assigned:"not_started",in_progress:"working",waiting_input:"paused",review:"paused",done:"complete"};function Bh(n){return n in Uf&&n!=="blocked"?n:Yj[n]??"not_started"}const qj={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"},Kj="_container_wg6d2_1",Zj="_homeRow_wg6d2_5",Xj="_selected_wg6d2_30",Qj="_homeIcon_wg6d2_36",Wj="_header_wg6d2_41",Jj="_searchInput_wg6d2_53",eD="_searchHighlight_wg6d2_86",tD="_addButton_wg6d2_92",nD="_createForm_wg6d2_119",aD="_createInput_wg6d2_125",sD="_createButton_wg6d2_156",iD="_creatingHint_wg6d2_197",oD="_workspaceRow_wg6d2_206",lD="_expandArrow_wg6d2_229",rD="_expanded_wg6d2_236",cD="_workspaceName_wg6d2_240",uD="_taskCount_wg6d2_244",dD="_newTaskButton_wg6d2_250",fD="_taskRow_wg6d2_277",hD="_taskStatusIcon_wg6d2_307",pD="_taskTitle_wg6d2_311",mD="_dependencyBadge_wg6d2_318",gD="_blockedBadge_wg6d2_330",vD="_leafSpacer_wg6d2_335",yD="_childCountBadge_wg6d2_340",bD="_addChildButton_wg6d2_353",xD="_emptyCta_wg6d2_402",_D="_ctaDescription_wg6d2_415",SD="_ctaButton_wg6d2_421",TD="_emptyTaskCta_wg6d2_456",CD="_headerActions_wg6d2_461",ED="_groupToggle_wg6d2_467",kD="_groupToggleActive_wg6d2_494",wD="_statusGroupHeader_wg6d2_498",AD="_statusGroupIcon_wg6d2_517",ND="_statusGroupLabel_wg6d2_521",jD="_statusGroupCount_wg6d2_526",DD="_createTaskLink_wg6d2_539",be={container:Kj,homeRow:Zj,selected:Xj,homeIcon:Qj,header:Wj,searchInput:Jj,searchHighlight:eD,addButton:tD,createForm:nD,createInput:aD,createButton:sD,creatingHint:iD,workspaceRow:oD,expandArrow:lD,expanded:rD,workspaceName:cD,taskCount:uD,newTaskButton:dD,taskRow:fD,taskStatusIcon:hD,taskTitle:pD,dependencyBadge:mD,blockedBadge:gD,leafSpacer:vD,childCountBadge:yD,addChildButton:bD,emptyCta:xD,ctaDescription:_D,ctaButton:SD,emptyTaskCta:TD,headerActions:CD,groupToggle:ED,groupToggleActive:kD,statusGroupHeader:wD,statusGroupIcon:AD,statusGroupLabel:ND,statusGroupCount:jD,createTaskLink:DD};function MD(n){if(n.length===0)return[];const a=[...n].sort((l,r)=>l[0]-r[0]),i=[[a[0][0],a[0][1]]];for(let l=1;l<a.length;l++){const r=i[i.length-1],[c,d]=a[l];c<=r[1]+1?r[1]=Math.max(r[1],d):i.push([c,d])}return i}function Wx({text:n,indices:a}){if(!a||a.length===0)return f.jsx(f.Fragment,{children:n});const i=MD(a),l=[];let r=0;for(const[c,d]of i)c>r&&l.push(f.jsx("span",{children:n.slice(r,c)},`p${r}`)),l.push(f.jsx("mark",{className:be.searchHighlight,children:n.slice(c,d+1)},`m${c}`)),r=d+1;return r<n.length&&l.push(f.jsx("span",{children:n.slice(r)},`p${r}`)),f.jsx(f.Fragment,{children:l})}const RD=[{name:"name",weight:2},{name:"description",weight:1}],BD=[{name:"title",weight:2},{name:"description",weight:1}],Jx=34,OD=16,e_="grackle-group-by-status";function M0(){try{return localStorage.getItem(e_)==="true"}catch{return!1}}function LD(n){try{localStorage.setItem(e_,String(n))}catch{}}function ID(n,a){const i=new Map;for(const c of n){const p=c.dependsOn.length>0&&c.dependsOn.some(g=>a.get(g)!=="complete")?"blocked":c.status,m=i.get(p);m?m.push(c):i.set(p,[c])}const l=[],r=new Set;for(const c of Fj){r.add(c);const d=i.get(c);if(d&&d.length>0){d.sort((m,g)=>m.sortOrder-g.sortOrder);const p=cs(c);l.push({status:c,label:p.label,style:p,tasks:d})}}for(const[c,d]of i)if(!r.has(c)&&d.length>0){d.sort((m,g)=>m.sortOrder-g.sortOrder);const p=cs(c);l.push({status:c,label:p.label,style:p,tasks:d})}return l}function UD({group:n,isExpanded:a,onToggle:i,selectedTaskId:l,navigate:r,titleHighlights:c}){return f.jsxs("div",{"data-testid":`status-group-${n.status}`,children:[f.jsxs("div",{className:be.statusGroupHeader,role:"button",tabIndex:0,"aria-expanded":a,onClick:i,onKeyDown:d=>{(d.key==="Enter"||d.key===" ")&&(d.preventDefault(),i())},children:[f.jsx("span",{className:`${be.expandArrow} ${a?be.expanded:""}`,children:"▸"}),f.jsx("span",{className:be.statusGroupIcon,style:{color:n.style.color},children:n.style.icon}),f.jsx("span",{className:be.statusGroupLabel,children:n.label}),f.jsx("span",{className:be.statusGroupCount,children:n.tasks.length})]}),f.jsx(Vn,{children:a&&f.jsx(Et.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=cs(d.status),m=l===d.id;return f.jsxs("div",{onClick:()=>r(Na(d.id)),className:`${be.taskRow} ${m?be.selected:""}`,style:{"--task-indent":`${Jx}px`},"data-task-id":d.id,children:[f.jsx("span",{className:be.leafSpacer}),f.jsx("span",{className:be.taskStatusIcon,style:{color:p.color},children:p.icon}),f.jsx("span",{className:be.taskTitle,title:d.title,children:f.jsx(Wx,{text:d.title,indices:c.get(d.id)})})]},d.id)})})})]})}function zD(n){const a=new Map(n.map(l=>[l.id,{...l,children:[]}])),i=[];for(const l of a.values())l.parentTaskId&&a.has(l.parentTaskId)?a.get(l.parentTaskId).children.push(l):i.push(l);for(const l of a.values())l.children.sort((r,c)=>r.sortOrder-c.sortOrder);return i.sort((l,r)=>l.sortOrder-r.sortOrder)}function t_({node:n,depth:a,expandedTasks:i,toggleTask:l,selectedTaskId:r,navigate:c,workspaceId:d,taskStatusById:p,titleHighlights:m}){const g=cs(n.status),y=n.dependsOn.length>0&&n.dependsOn.some(k=>p.get(k)!=="complete"),v=i.has(n.id),_=n.children.length>0,C=r===n.id,E=Jx+a*OD;return f.jsxs(f.Fragment,{children:[f.jsxs("div",{onClick:()=>c(Na(n.id)),className:`${be.taskRow} ${C?be.selected:""}`,style:{"--task-indent":`${E}px`},"data-task-id":n.id,children:[_&&f.jsx("span",{className:`${be.expandArrow} ${v?be.expanded:""}`,role:"button",tabIndex:0,"aria-label":v?"Collapse task":"Expand task",onClick:k=>{k.stopPropagation(),l(n.id)},onKeyDown:k=>{(k.key==="Enter"||k.key===" ")&&(k.preventDefault(),k.stopPropagation(),l(n.id))},children:"▸"}),!_&&f.jsx("span",{className:be.leafSpacer}),f.jsx("span",{className:be.taskStatusIcon,style:{color:g.color},children:g.icon}),f.jsx("span",{className:be.taskTitle,title:n.title,children:f.jsx(Wx,{text:n.title,indices:m.get(n.id)})}),_&&f.jsxs("span",{className:be.childCountBadge,children:[n.children.filter(k=>k.status==="complete").length,"/",n.children.length]}),n.dependsOn.length>0&&f.jsx("span",{className:`${be.dependencyBadge} ${y?be.blockedBadge:""}`,title:`Depends on: ${n.dependsOn.join(", ")}`,children:y?"blocked":"dep"}),a<$N&&f.jsx("button",{onClick:k=>{k.stopPropagation(),c(zs(d,n.id))},title:"Add child task","aria-label":"Add child task",className:be.addChildButton,children:"+"})]}),f.jsx(Vn,{children:_&&v&&f.jsx(Et.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(k=>f.jsx(t_,{node:k,depth:a+1,expandedTasks:i,toggleTask:l,selectedTaskId:r,navigate:c,workspaceId:d,taskStatusById:p,titleHighlights:m},k.id))})})]})}function VD(){const{workspaces:n,tasks:a,environments:i,loadTasks:l,createWorkspace:r,workspaceCreating:c}=Rt(),d=hn(),m=en().pathname===sl,[g,y]=x.useState(new Set),[v,_]=x.useState(new Set),[C,E]=x.useState(new Set),[k,A]=x.useState(!1),[S,N]=x.useState(""),[D,H]=x.useState(M0),[O,$]=x.useState(M0),[R,L]=x.useState(new Map),G=()=>{const J=!D;LD(J),H(J),J&&($(!0),L(new Map))},ee=(J,Ze)=>{const we=`${J}:${Ze}`;L(We=>{const ze=new Map(We),At=ze.has(we)?ze.get(we):O;return ze.set(we,!At),ze})},te=(J,Ze)=>{const we=`${J}:${Ze}`;return R.has(we)?R.get(we):O},ne=Zt("/tasks/:taskId/*"),ie=Zt("/workspaces/:workspaceId"),he=(ne==null?void 0:ne.params.taskId)!=="new"?ne==null?void 0:ne.params.taskId:void 0,oe=ie==null?void 0:ie.params.workspaceId,j=x.useRef(g);j.current=g;const Z=x.useMemo(()=>new Map(a.map(J=>[J.id,J.status])),[a]),K=J=>{y(Ze=>{const we=new Set(Ze);return we.has(J)?we.delete(J):(we.add(J),l(J)),we})},de=J=>{_(Ze=>{const we=new Set(Ze);return we.has(J)?(we.delete(J),E(We=>new Set(We).add(J))):(we.add(J),E(We=>{const ze=new Set(We);return ze.delete(J),ze})),we})};x.useEffect(()=>{const J=new Set(a.filter(Ze=>Ze.parentTaskId).map(Ze=>Ze.parentTaskId));J.size>0&&_(Ze=>{const we=new Set(Ze);for(const We of J)C.has(We)||we.add(We);return we})},[a,C]),x.useEffect(()=>{oe&&!j.current.has(oe)&&(y(J=>new Set(J).add(oe)),l(oe))},[oe,l]);const Y=()=>{!S.trim()||c||i.length===0||(r(S.trim(),void 0,void 0,i[0].id),N(""),A(!1))},[je,Re]=x.useState(""),{directMatchTaskIds:Te,treeMatchTaskIds:st,visibleWorkspaceIds:kt,matchedWorkspaceIds:wt,titleHighlights:Le}=x.useMemo(()=>{if(!je.trim())return{directMatchTaskIds:null,treeMatchTaskIds:null,visibleWorkspaceIds:null,matchedWorkspaceIds:null,titleHighlights:new Map};const J=E0(n,je,RD),Ze=E0(a,je,BD),we=new Set(J.map(Je=>Je.item.id)),We=new Set(Ze.map(Je=>Je.item.id)),ze=new Map;for(const Je of Ze){const Ie=Je.matches.find(En=>En.key==="title");Ie&&ze.set(Je.item.id,Ie.indices)}const At=new Set(we);for(const Je of Ze)Je.item.workspaceId&&At.add(Je.item.workspaceId);const Bt=new Set(We),Qt=new Map(a.map(Je=>[Je.id,Je]));for(const Je of[...We]){let Ie=Qt.get(Je);for(;Ie!=null&&Ie.parentTaskId;)Bt.add(Ie.parentTaskId),Ie=Qt.get(Ie.parentTaskId)}return{directMatchTaskIds:We,treeMatchTaskIds:Bt,visibleWorkspaceIds:At,matchedWorkspaceIds:we,titleHighlights:ze}},[je,n,a]),xe=x.useRef(new Set);return x.useEffect(()=>{if(je.trim())for(const J of n)!g.has(J.id)&&!xe.current.has(J.id)&&(xe.current.add(J.id),l(J.id))},[je,n,g,l]),f.jsxs("div",{className:be.container,children:[f.jsxs("div",{className:be.header,children:[f.jsx("span",{children:"Workspaces"}),f.jsxs("div",{className:be.headerActions,children:[f.jsx("button",{className:`${be.groupToggle} ${D?be.groupToggleActive:""}`,onClick:G,"aria-label":D?"Switch to tree view":"Group tasks by status","aria-pressed":D,title:D?"Switch to tree view":"Group tasks by status","data-testid":"group-by-status-toggle",children:"≡"}),f.jsx("button",{className:be.addButton,onClick:()=>A(!k),"aria-label":"Create workspace",title:"Create workspace",children:"+"})]})]}),f.jsxs("button",{type:"button",className:`${be.homeRow} ${m?be.selected:""}`,onClick:()=>d(sl),"data-testid":"sidebar-home","aria-current":m?"page":void 0,children:[f.jsx("span",{className:be.homeIcon,"aria-hidden":"true",children:"⌂"}),f.jsx("span",{children:"Home"})]}),n.length>0&&f.jsx("input",{type:"text",value:je,onChange:J=>Re(J.target.value),placeholder:"Filter...","aria-label":"Filter workspaces and tasks",className:be.searchInput,"data-testid":"sidebar-search"}),k&&f.jsxs("div",{className:be.createForm,children:[f.jsx("input",{type:"text",value:S,onChange:J=>N(J.target.value),onKeyDown:J=>J.key==="Enter"&&Y(),placeholder:"Workspace name...",autoFocus:!0,disabled:c,className:be.createInput}),f.jsx("button",{onClick:Y,className:be.createButton,disabled:c,children:c?f.jsx(ic,{size:"sm",label:"Creating workspace"}):"OK"})]}),c&&f.jsxs("div",{className:be.creatingHint,children:[f.jsx(ic,{size:"sm",label:"Creating workspace"}),"Creating workspace…"]}),n.length===0&&!k&&f.jsxs("div",{className:be.emptyCta,children:[f.jsx("button",{className:be.ctaButton,onClick:()=>A(!0),children:"Create Workspace"}),f.jsx("div",{className:be.ctaDescription,children:"Organize your work into workspaces"})]}),n.map(J=>{if(kt&&!kt.has(J.id))return null;const Ze=Te!==null,we=g.has(J.id)||Ze,We=a.filter(Ie=>Ie.workspaceId===J.id),ze=(wt==null?void 0:wt.has(J.id))??!1,At=Ze&&!ze?D?Te:st:null,Bt=At?We.filter(Ie=>At.has(Ie.id)):We,Qt=oe===J.id,Je=we&&!D?zD(Bt):[];return f.jsxs("div",{children:[f.jsxs("div",{onClick:()=>{Qt?K(J.id):(we||K(J.id),d(Ii(J.id)))},className:`${be.workspaceRow} ${Qt?be.selected:""}`,children:[f.jsx("span",{className:`${be.expandArrow} ${we?be.expanded:""}`,children:"▸"}),f.jsx("span",{className:be.workspaceName,title:J.name,children:J.name}),f.jsx("span",{className:be.taskCount,children:We.length>0&&`${We.filter(Ie=>Ie.status==="complete").length}/${We.length}`}),f.jsx("button",{onClick:Ie=>{Ie.stopPropagation(),d(zs(J.id))},title:"New task",className:be.newTaskButton,children:"+"})]}),f.jsx(Vn,{children:we&&f.jsxs(Et.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:[D?ID(Bt,Z).map(Ie=>f.jsx(UD,{group:Ie,isExpanded:te(J.id,Ie.status),onToggle:()=>ee(J.id,Ie.status),selectedTaskId:he,navigate:d,titleHighlights:Le},Ie.status)):Je.map(Ie=>f.jsx(t_,{node:Ie,depth:0,expandedTasks:v,toggleTask:de,selectedTaskId:he,navigate:d,workspaceId:J.id,taskStatusById:Z,titleHighlights:Le},Ie.id)),Bt.length===0&&f.jsx("div",{className:be.emptyTaskCta,children:f.jsx("button",{className:be.createTaskLink,onClick:()=>d(zs(J.id)),children:"+ Create Task"})})]})})]},J.id)})]})}const HD="_container_pi6ii_1",GD="_tabBar_pi6ii_40",PD="_tab_pi6ii_40",$D="_content_pi6ii_66",Po={container:HD,tabBar:GD,tab:PD,content:$D},FD=320,n_=220,a_=600,s_="grackle-sidebar-width";function YD(){try{const n=localStorage.getItem(s_);if(n!==null){const a=Number(n);if(Number.isFinite(a)&&a>=n_&&a<=a_)return a}}catch{}return FD}function qD(n){try{localStorage.setItem(s_,String(n))}catch{}}function KD(){const[n]=x.useState(YD),a=x.useRef(null),i=hn(),l=!!Zt("/chat");return x.useEffect(()=>{const r=a.current;if(!r)return;const c=new ResizeObserver(d=>{for(const p of d){const m=p.borderBoxSize[0];if(m){const g=Math.round(m.inlineSize);g>=n_&&g<=a_&&qD(g)}}});return c.observe(r),()=>{c.disconnect()}},[]),f.jsxs("div",{className:Po.container,ref:a,"data-testid":"sidebar",style:{width:n},children:[f.jsxs("nav",{className:Po.tabBar,"aria-label":"Sidebar navigation","data-testid":"sidebar-tabs",children:[f.jsx("button",{className:Po.tab,"aria-current":l?"page":void 0,"data-active":l,"data-testid":"sidebar-tab-chat",onClick:()=>i(yC),children:"Chat"}),f.jsx("button",{className:Po.tab,"aria-current":l?void 0:"page","data-active":!l,"data-testid":"sidebar-tab-workspaces",onClick:()=>i(bC),children:"Workspaces"})]}),f.jsx("div",{className:Po.content,children:f.jsx(VD,{})})]})}const ZD="_bar_8ghh5_1",XD="_barColumn_8ghh5_32",QD="_barRow_8ghh5_63",WD="_input_8ghh5_74",JD="_inputSmall_8ghh5_109",eM="_select_8ghh5_178",tM="_btnPrimary_8ghh5_214",nM="_btnDanger_8ghh5_245",aM="_btnGhost_8ghh5_284",sM="_badge_8ghh5_312",iM="_statusText_8ghh5_322",oM="_statusCompleted_8ghh5_327",lM="_statusFailed_8ghh5_331",rM="_statusBlocked_8ghh5_335",cM="_hintText_8ghh5_340",uM="_creatingHint_8ghh5_345",dM="_errorHint_8ghh5_353",fM="_disconnectHint_8ghh5_359",ae={bar:ZD,barColumn:XD,barRow:QD,input:WD,inputSmall:JD,select:eM,btnPrimary:tM,btnDanger:nM,btnGhost:aM,badge:sM,statusText:iM,statusCompleted:oM,statusFailed:lM,statusBlocked:rM,hintText:cM,creatingHint:uM,errorHint:dM,disconnectHint:fM};function tf(n,a){if(!n)return!1;const i=a.find(l=>l.id===n);return i!==void 0&&(i.status==="disconnected"||i.status==="error")}function nf({environmentId:n,onReconnect:a}){return f.jsxs(f.Fragment,{children:[f.jsx("span",{className:ae.disconnectHint,"data-testid":"env-disconnect-hint",children:"Environment unavailable"}),f.jsx("button",{type:"button",onClick:()=>a(n),className:ae.btnGhost,"data-testid":"reconnect-btn",title:"Reconnect the environment to resume messaging",children:"Reconnect"})]})}function hM(){const{spawn:n,sendInput:a,kill:i,sessions:l,tasks:r,environments:c,personas:d,addEnvironment:p,provisionEnvironment:m,startTask:g,taskSessions:y,codespaces:v,codespaceError:_,codespaceListError:C,codespaceCreating:E,listCodespaces:k,createCodespace:A}=Rt(),{showToast:S}=hl(),N=hn(),[D]=Zf(),H=Zt("/sessions/:sessionId"),O=Zt("/tasks/:taskId"),$=Zt("/tasks/:taskId/stream"),R=Zt("/tasks/:taskId/findings"),L=Zt("/tasks/:taskId/edit"),G=Zt("/sessions/new"),ee=Zt("/environments/new"),te=Zt("/workspaces/:workspaceId"),ne=Zt("/tasks/new"),ie=Zt("/chat"),he=Zt("/"),oe=Zt("/settings/*"),j=H==null?void 0:H.params.sessionId,Z=(O==null?void 0:O.params.taskId)??($==null?void 0:$.params.taskId)??(R==null?void 0:R.params.taskId),K=!!ie,de=!!G,Y=!!ee,je=!!te,Re=!!ne,Te=!!L,st=!!he&&!de&&!Y&&!je&&!Re,kt=!!oe,wt=de?D.get("env")??"":"",[Le,xe]=x.useState(""),[J,Ze]=x.useState(""),[we,We]=x.useState(""),[ze,At]=x.useState("local"),[Bt,Qt]=x.useState(""),[Je,Ie]=x.useState(""),[En,sa]=x.useState(""),[Yn,Gs]=x.useState(""),[X,W]=x.useState(""),[le,ye]=x.useState(""),[me,He]=x.useState(""),[Ce,yt]=x.useState(""),[et,Nt]=x.useState(""),[bt,Ge]=x.useState("pick"),Ve=j?l.find(rt=>rt.id===j):void 0,Ee=Z?r.find(rt=>rt.id===Z):void 0,ia=(Ee==null?void 0:Ee.latestSessionId)||void 0,an=ia?l.find(rt=>rt.id===ia):void 0,Ma=Ee?Ee.dependsOn.some(rt=>{const Se=r.find(_t=>_t.id===rt);return Se&&Se.status!=="complete"}):!1;if(K){const rt=r.find(Ne=>Ne.id===Ls),Se=rt!=null&&rt.latestSessionId?l.find(Ne=>Ne.id===rt.latestSessionId)??(y[Ls]??[]).find(Ne=>Ne.id===rt.latestSessionId):void 0,_t=c.find(Ne=>Ne.adapterType==="local"&&Ne.status==="connected");if(!_t)return f.jsx("div",{className:ae.bar,children:f.jsx("span",{className:ae.hintText,children:"Add a local environment to start chatting"})});if((Se==null?void 0:Se.status)==="running")return f.jsxs("div",{className:ae.bar,children:[f.jsx("input",{type:"text",disabled:!0,placeholder:"Agent is working...",className:ae.input}),f.jsx("button",{onClick:()=>i(Se.id),className:ae.btnDanger,title:"Stop session",children:"Stop"})]});if((Se==null?void 0:Se.status)==="idle"){const Ne=tf(Se.environmentId,c),sn=Ki=>{Ki.preventDefault(),!(!Le.trim()||Ne)&&(a(Se.id,Le),xe(""))};return f.jsxs("form",{onSubmit:sn,className:ae.bar,children:[Ne&&Se.environmentId&&f.jsx(nf,{environmentId:Se.environmentId,onReconnect:m}),f.jsx("input",{type:"text",value:Le,onChange:Ki=>xe(Ki.target.value),placeholder:"Type a message...",autoFocus:!Ne,disabled:Ne,className:ae.input}),f.jsx("span",{title:Ne?"Environment is unavailable — reconnect first":void 0,children:f.jsx("button",{type:"submit",disabled:!Le.trim()||Ne,className:ae.btnPrimary,children:"Send"})}),f.jsx("button",{type:"button",onClick:()=>i(Se.id),className:ae.btnDanger,title:"Stop session",children:"Stop"})]})}const se=Ne=>{Ne.preventDefault(),Le.trim()&&(g(Ls,void 0,_t.id,Le),xe(""))};return f.jsxs("form",{onSubmit:se,className:ae.bar,children:[f.jsx("input",{type:"text",value:Le,onChange:Ne=>xe(Ne.target.value),placeholder:"Type a message...",autoFocus:!0,className:ae.input}),f.jsx("button",{type:"submit",disabled:!Le.trim(),className:ae.btnPrimary,children:"Send"})]})}if(st||kt)return f.jsx(f.Fragment,{});if(Te||Re)return f.jsx(f.Fragment,{});if(Y){const rt=se=>{if(!se.trim())return!0;const Ne=Number(se);return Number.isInteger(Ne)&&Ne>=1&&Ne<=65535},Se=()=>!(!we.trim()||ze==="ssh"&&!Bt.trim()||ze==="codespace"&&!le.trim()||(ze==="local"||ze==="ssh")&&!rt(Je)),_t=()=>{if(!Se())return;const se={};if(ze==="local"){if(Bt.trim()&&(se.host=Bt.trim()),Je.trim()){const Ne=Number(Je);Number.isInteger(Ne)&&(se.port=Ne)}}else if(ze==="ssh"){if(se.host=Bt.trim(),En.trim()&&(se.user=En.trim()),Je.trim()){const Ne=Number(Je);Number.isInteger(Ne)&&(se.sshPort=Ne)}me.trim()&&(se.identityFile=me.trim())}else ze==="docker"?(Yn.trim()&&(se.image=Yn.trim()),X.trim()&&(se.repo=X.trim())):ze==="codespace"&&(se.codespaceName=le.trim());p(we.trim(),ze,se),S("Environment added successfully","success"),We(""),At("local"),Qt(""),Ie(""),sa(""),Gs(""),W(""),ye(""),He(""),yt(""),Nt(""),Ge("pick"),N(Is,{replace:!0})};return f.jsxs("div",{className:ae.barColumn,children:[f.jsxs("div",{className:ae.barRow,children:[f.jsx("span",{className:ae.badge,children:"new env"}),f.jsx("input",{type:"text",value:we,onChange:se=>We(se.target.value),placeholder:"Environment name...",autoFocus:!0,className:ae.input}),f.jsxs("select",{value:ze,onChange:se=>{At(se.target.value),se.target.value==="codespace"&&(k(),Ge("pick"),ye(""))},className:ae.select,children:[f.jsx("option",{value:"local",children:"local"}),f.jsx("option",{value:"ssh",children:"ssh"}),f.jsx("option",{value:"docker",children:"docker"}),f.jsx("option",{value:"codespace",children:"codespace"})]}),f.jsx("button",{onClick:_t,disabled:!Se(),className:ae.btnPrimary,children:"Add"})]}),f.jsxs("div",{className:ae.barRow,children:[ze==="local"&&f.jsxs(f.Fragment,{children:[f.jsx("input",{type:"text",value:Bt,onChange:se=>Qt(se.target.value),placeholder:"Host (optional)...",className:ae.inputSmall}),f.jsx("input",{type:"number",min:1,max:65535,value:Je,onChange:se=>Ie(se.target.value),placeholder:"Port (optional)...",className:ae.inputSmall})]}),ze==="ssh"&&f.jsxs(f.Fragment,{children:[f.jsx("input",{type:"text",value:Bt,onChange:se=>Qt(se.target.value),placeholder:"Host (required)...",className:ae.inputSmall}),f.jsx("input",{type:"text",value:En,onChange:se=>sa(se.target.value),placeholder:"User (optional)...",className:ae.inputSmall}),f.jsx("input",{type:"number",min:1,max:65535,value:Je,onChange:se=>Ie(se.target.value),placeholder:"SSH port (optional)...",className:ae.inputSmall}),f.jsx("input",{type:"text",value:me,onChange:se=>He(se.target.value),placeholder:"Identity file (optional)...",className:ae.inputSmall})]}),ze==="docker"&&f.jsxs(f.Fragment,{children:[f.jsx("input",{type:"text",value:Yn,onChange:se=>Gs(se.target.value),placeholder:"Image (optional)...",className:ae.inputSmall}),f.jsx("input",{type:"text",value:X,onChange:se=>W(se.target.value),placeholder:"Repo (optional)...",className:ae.inputSmall})]}),ze==="codespace"&&bt==="pick"&&f.jsxs(f.Fragment,{children:[!C&&f.jsxs("select",{value:le,onChange:se=>{se.target.value==="__create__"?(Ge("create"),ye("")):(ye(se.target.value),se.target.value&&!we.trim()&&We(se.target.value))},disabled:E,className:ae.select,children:[f.jsx("option",{value:"",children:"Select a codespace..."}),v.map(se=>f.jsxs("option",{value:se.name,children:[se.name," (",se.repository,") — ",se.state]},se.name)),f.jsx("option",{value:"__create__",children:"Create new from repo..."})]}),E&&f.jsx("span",{className:ae.creatingHint,children:"Creating codespace..."}),C&&f.jsxs(f.Fragment,{children:[f.jsx("span",{className:ae.errorHint,children:C}),f.jsx("input",{type:"text",value:le,onChange:se=>ye(se.target.value),placeholder:"Or enter codespace name manually...",className:ae.inputSmall})]}),_&&!C&&f.jsx("span",{className:ae.errorHint,children:_})]}),ze==="codespace"&&bt==="create"&&f.jsxs(f.Fragment,{children:[f.jsx("input",{type:"text",value:Ce,onChange:se=>yt(se.target.value),placeholder:"owner/repo",className:ae.inputSmall}),f.jsx("input",{type:"text",value:et,onChange:se=>Nt(se.target.value),placeholder:"Machine type (optional)...",className:ae.inputSmall}),f.jsx("button",{onClick:()=>{Ce.trim()&&(A(Ce.trim(),et.trim()||void 0),Ge("pick"),yt(""),Nt(""))},disabled:!Ce.trim(),className:ae.btnPrimary,children:"Create"}),f.jsx("button",{onClick:()=>{Ge("pick"),yt(""),Nt("")},className:ae.btnGhost,children:"Cancel"})]})]})]})}if(je)return f.jsx("div",{className:ae.bar,children:f.jsx("span",{className:ae.hintText,children:"Select a task or click + to create one"})});if(Z&&Ee){if(Ee.status==="not_started"){const rt=Ma?Ee.dependsOn.map(Se=>r.find(_t=>_t.id===Se)).filter(Se=>Se&&Se.status!=="complete").map(Se=>Se.title):[];return f.jsx("div",{className:ae.bar,children:Ma?f.jsxs("span",{className:ae.statusBlocked,children:["Blocked by: ",rt.join(", ")]}):f.jsx("span",{className:ae.hintText,children:"Use the buttons above to start or manage this task"})})}if(Ee.status==="working"||Ee.status==="paused"){if((an==null?void 0:an.status)==="idle"){const Se=an.environmentId,_t=tf(Se,c),se=Ne=>{Ne.preventDefault();const sn=Ee.latestSessionId||ia;!Le.trim()||!sn||_t||(a(sn,Le),xe(""))};return f.jsxs("form",{onSubmit:se,className:ae.bar,children:[_t&&Se&&f.jsx(nf,{environmentId:Se,onReconnect:m}),f.jsx("input",{type:"text",value:Le,onChange:Ne=>xe(Ne.target.value),placeholder:"Type a message...",autoFocus:!_t,disabled:_t,className:ae.input}),f.jsx("span",{title:_t?"Environment is unavailable — reconnect first":void 0,children:f.jsx("button",{type:"submit",disabled:!Le.trim()||_t,className:ae.btnPrimary,children:"Send"})})]})}return f.jsx("div",{className:ae.bar,children:f.jsx("input",{type:"text",disabled:!0,placeholder:"Agent is working...",className:ae.input})})}if(Ee.status==="complete")return f.jsxs("div",{className:ae.bar,children:[f.jsx("span",{className:`${ae.statusText} ${ae.statusCompleted}`,children:"Task completed"}),f.jsx("button",{onClick:()=>N(zs(Ee.workspaceId)),className:ae.btnPrimary,children:"+ New Task"})]});if(Ee.status==="failed")return f.jsx("div",{className:ae.bar,children:f.jsx("span",{className:`${ae.statusText} ${ae.statusFailed}`,children:"Task failed"})})}if(de){const rt=Se=>{Se.preventDefault(),!(!Le.trim()||!wt)&&(n(wt,Le,J),S("Session started","success"),xe(""),Ze(""))};return f.jsxs("form",{onSubmit:rt,className:ae.bar,children:[f.jsx("span",{className:ae.badge,children:"new chat"}),f.jsx("input",{type:"text",value:Le,onChange:Se=>xe(Se.target.value),placeholder:"Enter prompt...",autoFocus:!0,className:ae.input}),f.jsxs("select",{value:J,onChange:Se=>Ze(Se.target.value),className:ae.select,children:[f.jsx("option",{value:"",children:"(Default)"}),d.map(Se=>f.jsx("option",{value:Se.id,children:Se.name},Se.id))]}),f.jsx("button",{type:"submit",disabled:!Le.trim()||!wt,className:ae.btnPrimary,children:"Go"})]})}if(j){const rt=(Ve==null?void 0:Ve.status)==="running",Se=(Ve==null?void 0:Ve.status)==="idle",_t=Ve!==void 0&&["completed","failed","interrupted"].includes(Ve.status);if(rt)return f.jsxs("div",{className:ae.bar,children:[f.jsx("input",{type:"text",disabled:!0,placeholder:"Agent is working...",className:ae.input}),f.jsx("button",{onClick:()=>i(j),className:ae.btnDanger,title:"Stop session",children:"Stop"})]});if(Se){const se=tf(Ve.environmentId,c),Ne=sn=>{sn.preventDefault(),!(!Le.trim()||se)&&(a(j,Le),xe(""))};return f.jsxs("form",{onSubmit:Ne,className:ae.bar,children:[se&&Ve.environmentId&&f.jsx(nf,{environmentId:Ve.environmentId,onReconnect:m}),f.jsx("input",{type:"text",value:Le,onChange:sn=>xe(sn.target.value),placeholder:"Type a message...",autoFocus:!se,disabled:se,className:ae.input}),f.jsx("span",{title:se?"Environment is unavailable — reconnect first":void 0,children:f.jsx("button",{type:"submit",disabled:!Le.trim()||se,className:ae.btnPrimary,children:"Send"})}),f.jsx("button",{type:"button",onClick:()=>i(j),className:ae.btnDanger,title:"Stop session",children:"Stop"})]})}if(_t)return f.jsxs("div",{className:ae.bar,children:[f.jsxs("span",{className:`${ae.statusText} ${ae.hintText}`,children:["Session ",Ve.status]}),f.jsx("button",{onClick:()=>N(ob(Ve.environmentId)),className:ae.btnPrimary,children:"+ New Chat"})]})}return f.jsx("div",{className:ae.bar,children:f.jsx("span",{className:ae.hintText,children:"Loading..."})})}const pM="_toast_da8ll_1",mM="_success_da8ll_18",gM="_icon_da8ll_22",vM="_error_da8ll_25",yM="_warning_da8ll_32",bM="_info_da8ll_38",xM="_message_da8ll_53",_M="_close_da8ll_60",$o={toast:pM,success:mM,icon:gM,error:vM,warning:yM,info:bM,message:xM,close:_M},SM={success:"✓",error:"✕",warning:"⚠",info:"ℹ"};function TM({toast:n,onDismiss:a}){return x.useEffect(()=>{const i=setTimeout(()=>a(n.id),n.duration);return()=>clearTimeout(i)},[n.id,n.duration,a]),f.jsxs(Et.div,{className:`${$o.toast} ${$o[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:[f.jsx("span",{className:$o.icon,"aria-hidden":"true",children:SM[n.variant]}),f.jsx("span",{className:$o.message,children:n.message}),f.jsx("button",{type:"button",className:$o.close,onClick:()=>a(n.id),"aria-label":"Dismiss notification",children:"×"})]})}const CM="_container_qqse2_1",EM={container:CM};function kM(){const{toasts:n,dismissToast:a}=hl();return f.jsx("div",{className:EM.container,"data-testid":"toast-container",children:f.jsx(Vn,{children:n.map(i=>f.jsx(TM,{toast:i,onDismiss:a},i.id))})})}function wM(n,a){const i=x.useRef(null);x.useEffect(()=>{const l=i.current;if(i.current=n,l===null)return;const r=new Map;for(const d of l)r.set(d.id,d);const c=new Set;for(const d of n){c.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 l)c.has(d.id)||a("Environment removed","info")},[n,a])}const i_=50;function AM(n,a,i,l,r=i_){return l?n<r:a-n-i<r}function NM(n,a){const i=a-n;return i>0?i:0}function jM({scrollRef:n,contentLength:a,isReversed:i}){const[l,r]=x.useState(!0),c=x.useRef(0),d=x.useRef(!1),p=x.useRef(0);x.useEffect(()=>{const g=n.current;if(!g)return;let y=!0;const v=()=>{p.current||(p.current=requestAnimationFrame(()=>{p.current=0;const _=AM(g.scrollTop,g.scrollHeight,g.clientHeight,i,i_);_!==y&&(y=_,r(_))}))};return g.addEventListener("scroll",v,{passive:!0}),()=>{g.removeEventListener("scroll",v),p.current&&(cancelAnimationFrame(p.current),p.current=0)}},[n,i]),x.useLayoutEffect(()=>{const g=n.current;!g||d.current||(d.current=!0,i?g.scrollTop=0:g.scrollTop=g.scrollHeight,r(!0))},[n,i]),x.useLayoutEffect(()=>{const g=n.current;if(g){if(i&&!l){const y=NM(c.current,g.scrollHeight);y>0&&(g.scrollTop+=y)}l&&(i?g.scrollTo({top:0,behavior:"smooth"}):g.scrollTo({top:g.scrollHeight,behavior:"smooth"})),c.current=g.scrollHeight}},[a,l,i,n]);const m=x.useCallback(()=>{const g=n.current;if(!g)return;const y=i?0:g.scrollHeight;g.scrollTo({top:y,behavior:"smooth"}),r(!0)},[n,i]);return{isAtAnchor:l,scrollToAnchor:m}}const DM="_panelContainer_aei9x_1",MM="_emptyState_aei9x_8",RM="_fadeIn_aei9x_1",BM="_workspaceSummary_aei9x_17",OM="_workspaceSummaryTitle_aei9x_28",LM="_workspaceSummarySubtitle_aei9x_32",IM="_header_aei9x_36",UM="_headerInfo_aei9x_69",zM="_killButton_aei9x_75",VM="_headerTitle_aei9x_104",HM="_headerActions_aei9x_119",GM="_taskStatusBadge_aei9x_126",PM="_taskBranch_aei9x_135",$M="_taskBlockedBadge_aei9x_141",FM="_btnPrimary_aei9x_149",YM="_btnDanger_aei9x_180",qM="_btnGhost_aei9x_219",KM="_rejectInput_aei9x_245",ZM="_tabBar_aei9x_275",XM="_tab_aei9x_275",QM="_active_aei9x_301",WM="_eventScroll_aei9x_306",JM="_tabContent_aei9x_312",eR="_noContext_aei9x_317",tR="_overviewContent_aei9x_323",nR="_overviewDashboard_aei9x_332",aR="_overviewHero_aei9x_338",sR="_statusBadge_aei9x_345",iR="_statusPending_aei9x_357",oR="_statusAssigned_aei9x_362",lR="_statusInProgress_aei9x_367",rR="_statusReview_aei9x_372",cR="_statusDone_aei9x_377",uR="_statusFailed_aei9x_382",dR="_statusWaitingInput_aei9x_387",fR="_overviewBranchPill_aei9x_392",hR="_branchLink_aei9x_407",pR="_overviewSection_aei9x_418",mR="_overviewLabel_aei9x_424",gR="_overviewValue_aei9x_431",vR="_overviewMuted_aei9x_436",yR="_overviewMarkdown_aei9x_442",bR="_envRow_aei9x_511",xR="_envDot_aei9x_517",_R="_envDotGreen_aei9x_524",SR="_envDotYellow_aei9x_528",TR="_envDotRed_aei9x_532",CR="_envDotGray_aei9x_536",ER="_depList_aei9x_540",kR="_depItem_aei9x_546",wR="_depBlocked_aei9x_553",AR="_depDone_aei9x_557",NR="_timeline_aei9x_561",jR="_timelineRow_aei9x_567",DR="_timelineKey_aei9x_574",MR="_timelineValue_aei9x_580",RR="_timelineDelta_aei9x_584",BR="_reviewNotes_aei9x_595",OR="_overviewDescription_aei9x_606",LR="_waitingMessage_aei9x_612",IR="_errorMessage_aei9x_616",UR="_eventOverflowWarning_aei9x_620",zR="_attemptSelector_aei9x_634",VR="_attemptLabel_aei9x_650",HR="_attemptButton_aei9x_654",GR="_attemptActive_aei9x_671",PR="_attemptStatus_aei9x_677",$R="_emptyCta_aei9x_683",FR="_ctaTitle_aei9x_695",YR="_ctaDescription_aei9x_701",qR="_ctaButton_aei9x_708",KR="_ctaCreateForm_aei9x_743",ZR="_ctaCreateInput_aei9x_749",XR="_ctaCreateOk_aei9x_780",QR="_ctaLink_aei9x_815",WR="_workspaceHeader_aei9x_829",JR="_workspaceName_aei9x_854",e3="_workspaceMeta_aei9x_867",t3="_metaRow_aei9x_875",n3="_metaLabel_aei9x_888",a3="_metaValue_aei9x_903",s3="_archiveButton_aei9x_913",i3="_repoLink_aei9x_943",o3="_metaToggle_aei9x_953",l3="_metaToggleArrow_aei9x_974",r3="_metaToggleArrowOpen_aei9x_979",c3="_progressBarContainer_aei9x_983",u3="_progressBar_aei9x_983",d3="_progressFill_aei9x_999",f3="_progressLabel_aei9x_1006",h3="_metaTimestamps_aei9x_1013",p3="_metaTimestamp_aei9x_1013",I={panelContainer:DM,emptyState:MM,fadeIn:RM,workspaceSummary:BM,workspaceSummaryTitle:OM,workspaceSummarySubtitle:LM,header:IM,headerInfo:UM,killButton:zM,headerTitle:VM,headerActions:HM,taskStatusBadge:GM,taskBranch:PM,taskBlockedBadge:$M,btnPrimary:FM,btnDanger:YM,btnGhost:qM,rejectInput:KM,tabBar:ZM,tab:XM,active:QM,eventScroll:WM,tabContent:JM,noContext:eR,overviewContent:tR,overviewDashboard:nR,overviewHero:aR,statusBadge:sR,statusPending:iR,statusAssigned:oR,statusInProgress:lR,statusReview:rR,statusDone:cR,statusFailed:uR,statusWaitingInput:dR,overviewBranchPill:fR,branchLink:hR,overviewSection:pR,overviewLabel:mR,overviewValue:gR,overviewMuted:vR,overviewMarkdown:yR,envRow:bR,envDot:xR,envDotGreen:_R,envDotYellow:SR,envDotRed:TR,envDotGray:CR,depList:ER,depItem:kR,depBlocked:wR,depDone:AR,timeline:NR,timelineRow:jR,timelineKey:DR,timelineValue:MR,timelineDelta:RR,reviewNotes:BR,overviewDescription:OR,waitingMessage:LR,errorMessage:IR,eventOverflowWarning:UR,attemptSelector:zR,attemptLabel:VR,attemptButton:HR,attemptActive:GR,attemptStatus:PR,emptyCta:$R,ctaTitle:FR,ctaDescription:YR,ctaButton:qR,ctaCreateForm:KR,ctaCreateInput:ZR,ctaCreateOk:XR,ctaLink:QR,workspaceHeader:WR,workspaceName:JR,workspaceMeta:e3,metaRow:t3,metaLabel:n3,metaValue:a3,archiveButton:s3,repoLink:i3,metaToggle:o3,metaToggleArrow:l3,metaToggleArrowOpen:r3,progressBarContainer:c3,progressBar:u3,progressFill:d3,progressLabel:f3,metaTimestamps:h3,metaTimestamp:p3},m3="_wrapper_p24zt_1",g3="_scrollContainer_p24zt_9",v3="_toolbar_p24zt_15",y3="_directionToggle_p24zt_22",b3="_scrollToAnchor_p24zt_60",x3="_scrollToAnchorBottom_p24zt_84",_3="_scrollToAnchorTop_p24zt_88",Ds={wrapper:m3,scrollContainer:g3,toolbar:v3,directionToggle:y3,scrollToAnchor:b3,scrollToAnchorBottom:x3,scrollToAnchorTop:_3},o_="grackle-stream-direction";function S3(){try{return localStorage.getItem(o_)==="reversed"}catch{return!1}}function T3({eventsDropped:n}){return n<=0?f.jsx(f.Fragment,{}):f.jsxs("div",{className:I.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 Oh({events:n,eventsDropped:a,emptyState:i}){const l=x.useRef(null),[r,c]=x.useState(S3),d=PN(),p=x.useMemo(()=>r?[...n].reverse():n,[n,r]),{isAtAnchor:m,scrollToAnchor:g}=jM({scrollRef:l,contentLength:n.length,isReversed:r}),y=()=>{const C=!r;c(C);try{localStorage.setItem(o_,C?"reversed":"default")}catch{}},v=d?0:.2,_=r?-8:8;return f.jsxs("div",{className:Ds.wrapper,children:[f.jsx("div",{className:Ds.toolbar,children:f.jsx("button",{className:Ds.directionToggle,onClick:y,title:r?"Showing newest first":"Showing oldest first","aria-label":r?"Switch to newest at bottom":"Switch to newest at top","data-testid":"direction-toggle",children:r?"↓":"↑"})}),f.jsxs("div",{ref:l,className:Ds.scrollContainer,"data-testid":"event-stream-scroll",children:[n.length===0&&i,f.jsx(T3,{eventsDropped:a}),f.jsx(Vn,{initial:!1,children:p.map((C,E)=>{const k=r?n.length-1-E:E;return f.jsx(Et.div,{initial:{opacity:0,y:_},animate:{opacity:1,y:0},transition:{duration:v,ease:"easeOut"},children:f.jsx(kj,{event:C,toolUseCtx:C.toolUseCtx})},`${C.sessionId}-${C.timestamp}-${k}`)})})]}),f.jsx(Vn,{children:!m&&f.jsxs(Et.button,{className:`${Ds.scrollToAnchor} ${r?Ds.scrollToAnchorTop:Ds.scrollToAnchorBottom}`,onClick:g,initial:{opacity:0,scale:.9},animate:{opacity:1,scale:1},exit:{opacity:0,scale:.9},transition:{duration:.15},"aria-label":"Scroll to latest","data-testid":"scroll-to-anchor",children:[r?"↑":"↓"," New events"]})})]})}function Lh(n){const a=[];for(const i of n){const l=a[a.length-1];i.eventType==="text"&&(l==null?void 0:l.eventType)==="text"?a[a.length-1]={...l,content:l.content+i.content}:a.push(i)}return a}function Ih(n){const a=new Map;for(const c of n)if(c.raw)try{a.set(c,JSON.parse(c.raw))}catch{}const i=new Map;for(const c of n){if(c.eventType!=="tool_use")continue;const d=a.get(c);if(!(!d||typeof d.id!="string"))try{const p=JSON.parse(c.content);i.set(d.id,{tool:p.tool,args:p.args})}catch{}}const l=new Set;return n.map(c=>{if(c.eventType!=="tool_result")return c;const d=a.get(c);if(!d||typeof d.tool_use_id!="string")return c;const p=i.get(d.tool_use_id);return p?(l.add(d.tool_use_id),{...c,toolUseCtx:p}):c}).filter(c=>{if(c.eventType!=="tool_use")return!0;const d=a.get(c);return d&&typeof d.id=="string"?!l.has(d.id):!0})}const C3="_panelContainer_pz4cr_1",E3="_emptyState_pz4cr_8",k3="_emptyTitle_pz4cr_20",w3="_emptyDescription_pz4cr_26",A3="_emptyHint_pz4cr_32",Xo={panelContainer:C3,emptyState:E3,emptyTitle:k3,emptyDescription:w3,emptyHint:A3};function N3({hasLocalEnvironment:n}){return f.jsxs("div",{className:Xo.emptyState,"data-testid":"chat-empty-state",children:[f.jsx("div",{className:Xo.emptyTitle,children:"Welcome to Grackle"}),f.jsx("div",{className:Xo.emptyDescription,children:n?"Type a message below to start chatting with the System agent. It can help you plan work, create tasks, and coordinate agents.":"Add a local environment in Settings to start chatting."}),!n&&f.jsx("div",{className:Xo.emptyHint,children:"Go to Settings → Environments to add one."})]})}function j3(){const{tasks:n,sessions:a,events:i,eventsDropped:l,environments:r,loadTaskSessions:c,loadSessionEvents:d,taskSessions:p}=Rt(),m=x.useRef(void 0),g=n.find(C=>C.id===Ls),y=g!=null&&g.latestSessionId?a.find(C=>C.id===g.latestSessionId)??(p[Ls]??[]).find(C=>C.id===g.latestSessionId):void 0;x.useEffect(()=>{c(Ls)},[c]),x.useEffect(()=>{g!=null&&g.latestSessionId&&c(Ls)},[g==null?void 0:g.latestSessionId,c]),x.useEffect(()=>{y&&y.id!==m.current&&(m.current=y.id,d(y.id))},[y==null?void 0:y.id,d]);const v=x.useMemo(()=>{if(!y)return[];const C=i.filter(E=>E.sessionId===y.id);return Ih(Lh(C))},[i,y==null?void 0:y.id]),_=r.find(C=>C.adapterType==="local"&&C.status==="connected");return f.jsx("div",{className:Xo.panelContainer,"data-testid":"chat-page",children:f.jsx(Oh,{events:v,eventsDropped:l,emptyState:f.jsx(N3,{hasLocalEnvironment:!!_})})})}function D3(n,a,i){const l=n.filter(m=>m.status==="running"||m.status==="idle"||m.status==="waiting").length,r=l_(a),c=a.filter(m=>zf(m,r)).length,d=a.filter(m=>m.status==="paused"||m.status==="failed"||zf(m,r)).length,p=i.filter(m=>m.status==="disconnected"||m.status==="error").length;return{activeSessions:l,blockedTasks:c,attentionTasks:d,unhealthyEnvironments:p}}function l_(n){const a=new Map;for(const i of n)a.set(i.id,i.status);return a}function zf(n,a){return n.dependsOn.some(i=>a.get(i)!=="complete")}function M3(n,a){var d;const i=new Map;for(const p of a)i.set(p.id,p);const l=l_(n),r=[];for(const p of n){const m=p.workspaceId?((d=i.get(p.workspaceId))==null?void 0:d.name)??"Unknown":"Unknown";p.status==="failed"?r.push({task:p,reason:"failed",workspaceName:m}):zf(p,l)?r.push({task:p,reason:"blocked",workspaceName:m}):p.status==="paused"&&r.push({task:p,reason:"paused",workspaceName:m})}const c={failed:0,blocked:1,paused:2};return r.sort((p,m)=>(c[p.reason]??3)-(c[m.reason]??3)),r}function R3(n,a){const i=new Map;for(const l of a)i.set(l.id,l);return n.filter(l=>l.status==="running"||l.status==="idle"||l.status==="waiting").map(l=>{var r;return{session:l,environmentName:((r=i.get(l.environmentId))==null?void 0:r.displayName)??"Unknown"}})}function B3(n,a,i){const l=new Map;for(const r of a){if(!r.workspaceId)continue;let c=l.get(r.workspaceId);c||(c={totalTasks:0,completedTasks:0,workingTasks:0,failedTasks:0},l.set(r.workspaceId,c)),c.totalTasks+=1,r.status==="complete"?c.completedTasks+=1:r.status==="working"?c.workingTasks+=1:r.status==="failed"&&(c.failedTasks+=1)}return n.map(r=>{const c=l.get(r.id)??{totalTasks:0,completedTasks:0,workingTasks:0,failedTasks:0};return{workspace:r,totalTasks:c.totalTasks,completedTasks:c.completedTasks,workingTasks:c.workingTasks,failedTasks:c.failedTasks}})}const O3="_dashboard_1avpn_1",L3="_kpiStrip_1avpn_11",I3="_kpiCard_1avpn_23",U3="_kpiValue_1avpn_68",z3="_kpiLabel_1avpn_76",V3="_bodyGrid_1avpn_84",H3="_section_1avpn_96",G3="_sectionHeader_1avpn_109",P3="_sectionIcon_1avpn_118",$3="_sectionTitle_1avpn_123",F3="_sectionCount_1avpn_131",Y3="_sectionBody_1avpn_138",q3="_emptyHint_1avpn_143",K3="_sessionRow_1avpn_150",Z3="_sessionPrompt_1avpn_177",X3="_sessionEnv_1avpn_186",Q3="_sessionRuntime_1avpn_192",W3="_sessionStatus_1avpn_198",J3="_statusDot_1avpn_207",eB="_attentionRow_1avpn_229",tB="_attentionTitle_1avpn_255",nB="_attentionMeta_1avpn_263",aB="_reasonBadge_1avpn_270",sB="_bottomGrid_1avpn_297",iB="_envRow_1avpn_308",oB="_envName_1avpn_319",lB="_envStatusBadge_1avpn_329",rB="_workspaceRow_1avpn_365",cB="_workspaceTop_1avpn_391",uB="_workspaceName_1avpn_397",dB="_workspaceCounts_1avpn_403",fB="_progressBar_1avpn_411",hB="_progressFill_1avpn_418",pe={dashboard:O3,kpiStrip:L3,kpiCard:I3,kpiValue:U3,kpiLabel:z3,bodyGrid:V3,section:H3,sectionHeader:G3,sectionIcon:P3,sectionTitle:$3,sectionCount:F3,sectionBody:Y3,emptyHint:q3,sessionRow:K3,sessionPrompt:Z3,sessionEnv:X3,sessionRuntime:Q3,sessionStatus:W3,statusDot:J3,attentionRow:eB,attentionTitle:tB,attentionMeta:nB,reasonBadge:aB,bottomGrid:sB,envRow:iB,envName:oB,envStatusBadge:lB,workspaceRow:rB,workspaceTop:cB,workspaceName:uB,workspaceCounts:dB,progressBar:fB,progressFill:hB},pB={hidden:{opacity:0,y:12},visible:n=>({opacity:1,y:0,transition:{delay:n*.06,duration:.3,ease:"easeOut"}})},Ir={hidden:{opacity:0,y:16},visible:n=>({opacity:1,y:0,transition:{delay:.15+n*.08,duration:.35,ease:"easeOut"}})};function mB(n,a,i,l){const r=[`${n} of ${a} tasks completed`];return i>0&&r.push(`${i} in progress`),l>0&&r.push(`${l} failed`),r.join(", ")}function Ur({value:n,label:a,accent:i,index:l,testId:r}){return f.jsxs(Et.div,{className:pe.kpiCard,"data-accent":i,"data-testid":r,variants:pB,initial:"hidden",animate:"visible",custom:l,children:[f.jsx("span",{className:pe.kpiValue,children:n}),f.jsx("span",{className:pe.kpiLabel,children:a})]})}function gB(){const{workspaces:n,tasks:a,sessions:i,environments:l,loadTasks:r}=Rt(),c=hn(),d=x.useRef(new Set);x.useEffect(()=>{for(const v of n)d.current.has(v.id)||(d.current.add(v.id),r(v.id))},[n,r]);const p=x.useMemo(()=>D3(i,a,l),[i,a,l]),m=x.useMemo(()=>R3(i,l),[i,l]),g=x.useMemo(()=>M3(a,n),[a,n]),y=x.useMemo(()=>B3(n,a),[n,a,l]);return f.jsxs("div",{className:pe.dashboard,"data-testid":"dashboard",children:[f.jsxs("div",{className:pe.kpiStrip,"data-testid":"dashboard-kpi-strip",children:[f.jsx(Ur,{value:p.activeSessions,label:"Active Sessions",accent:"green",index:0,testId:"kpi-active-sessions"}),f.jsx(Ur,{value:p.blockedTasks,label:"Blocked Tasks",accent:"yellow",index:1,testId:"kpi-blocked-tasks"}),f.jsx(Ur,{value:p.attentionTasks,label:"Needs Attention",accent:"red",index:2,testId:"kpi-attention-tasks"}),f.jsx(Ur,{value:p.unhealthyEnvironments,label:"Unhealthy Envs",accent:"blue",index:3,testId:"kpi-unhealthy-envs"})]}),f.jsxs("div",{className:pe.bodyGrid,children:[f.jsxs(Et.div,{className:pe.section,variants:Ir,initial:"hidden",animate:"visible",custom:0,"data-testid":"dashboard-active-sessions",children:[f.jsxs("div",{className:pe.sectionHeader,children:[f.jsx("span",{className:pe.sectionIcon,"aria-hidden":"true",children:"●"}),f.jsx("span",{className:pe.sectionTitle,children:"Active Sessions"}),f.jsx("span",{className:pe.sectionCount,children:m.length})]}),f.jsx("div",{className:pe.sectionBody,children:m.length===0?f.jsx("div",{className:pe.emptyHint,children:"No active sessions"}):m.map(({session:v,environmentName:_})=>f.jsxs("button",{type:"button",className:pe.sessionRow,onClick:()=>c(Xf(v.id)),"data-testid":"session-row",children:[f.jsx("span",{className:pe.sessionPrompt,title:v.prompt,children:v.prompt||"—"}),f.jsx("span",{className:pe.sessionEnv,children:_}),f.jsx("span",{className:pe.sessionRuntime,children:v.runtime}),f.jsxs("span",{className:pe.sessionStatus,children:[f.jsx("span",{className:pe.statusDot,"data-status":v.status}),v.status]})]},v.id))})]}),f.jsxs(Et.div,{className:pe.section,variants:Ir,initial:"hidden",animate:"visible",custom:1,"data-testid":"dashboard-needs-attention",children:[f.jsxs("div",{className:pe.sectionHeader,children:[f.jsx("span",{className:pe.sectionIcon,"aria-hidden":"true",children:"⚑"}),f.jsx("span",{className:pe.sectionTitle,children:"Needs Attention"}),f.jsx("span",{className:pe.sectionCount,children:g.length})]}),f.jsx("div",{className:pe.sectionBody,children:g.length===0?f.jsx("div",{className:pe.emptyHint,children:"All clear"}):g.map(({task:v,reason:_,workspaceName:C})=>f.jsxs("button",{type:"button",className:pe.attentionRow,onClick:()=>c(Na(v.id)),"data-testid":"attention-row",children:[f.jsxs("div",{className:pe.attentionTitle,children:[f.jsx("span",{className:pe.reasonBadge,"data-reason":_,children:_}),v.title]}),f.jsx("div",{className:pe.attentionMeta,children:f.jsx("span",{children:C})})]},v.id))})]})]}),f.jsxs("div",{className:pe.bottomGrid,children:[f.jsxs(Et.div,{className:pe.section,variants:Ir,initial:"hidden",animate:"visible",custom:2,"data-testid":"dashboard-env-health",children:[f.jsxs("div",{className:pe.sectionHeader,children:[f.jsx("span",{className:pe.sectionIcon,"aria-hidden":"true",children:"◈"}),f.jsx("span",{className:pe.sectionTitle,children:"Environment Health"}),f.jsx("span",{className:pe.sectionCount,children:l.length})]}),f.jsx("div",{className:pe.sectionBody,children:l.length===0?f.jsx("div",{className:pe.emptyHint,children:"No environments configured"}):l.map(v=>f.jsxs("div",{className:pe.envRow,"data-testid":"dashboard-env-row",children:[f.jsx("span",{className:pe.envName,children:v.displayName}),f.jsx("span",{className:pe.envStatusBadge,"data-status":v.status,children:v.status})]},v.id))})]}),f.jsxs(Et.div,{className:pe.section,variants:Ir,initial:"hidden",animate:"visible",custom:3,"data-testid":"dashboard-workspace-snapshot",children:[f.jsxs("div",{className:pe.sectionHeader,children:[f.jsx("span",{className:pe.sectionIcon,"aria-hidden":"true",children:"▦"}),f.jsx("span",{className:pe.sectionTitle,children:"Workspaces"}),f.jsx("span",{className:pe.sectionCount,children:n.length})]}),f.jsx("div",{className:pe.sectionBody,children:y.length===0?f.jsx("div",{className:pe.emptyHint,children:"No workspaces yet"}):y.map(({workspace:v,totalTasks:_,completedTasks:C,workingTasks:E,failedTasks:k})=>{const A=_>0?Math.round(C/_*100):0;return f.jsxs("button",{type:"button",className:pe.workspaceRow,onClick:()=>c(Ii(v.id)),"data-testid":"workspace-row",children:[f.jsxs("div",{className:pe.workspaceTop,children:[f.jsx("span",{className:pe.workspaceName,children:v.name}),f.jsxs("span",{className:pe.workspaceCounts,"aria-label":mB(C,_,E,k),children:[C,"/",_,E>0&&f.jsxs("span",{style:{color:"var(--accent-green)"},"aria-hidden":"true",children:["▸",E]}),k>0&&f.jsxs("span",{style:{color:"var(--accent-red)"},"aria-hidden":"true",children:["✗",k]})]})]}),_>0&&f.jsx("div",{className:pe.progressBar,children:f.jsx("div",{className:pe.progressFill,style:{width:`${A}%`}})})]},v.id)})})]})]})]})}function R0(){const{workspaces:n,environments:a,createWorkspace:i,workspaceCreating:l}=Rt(),[r,c]=x.useState(!1),[d,p]=x.useState(""),m=a.length>0,g=()=>{!d.trim()||l||!m||i(d.trim(),void 0,void 0,a[0].id)};return n.length>0?f.jsx(gB,{}):f.jsxs("div",{className:I.emptyCta,"data-testid":"welcome-cta",children:[f.jsx("div",{className:I.ctaTitle,children:"Welcome to Grackle"}),f.jsx("div",{className:I.ctaDescription,children:"Organize your work into workspaces and let agents tackle the tasks."}),r?f.jsxs("div",{className:I.ctaCreateForm,children:[f.jsx("input",{type:"text",value:d,onChange:y=>p(y.target.value),onKeyDown:y=>{y.key==="Enter"?g():y.key==="Escape"&&(c(!1),p(""))},placeholder:"Workspace name...","aria-label":"Workspace name",autoFocus:!0,disabled:l,className:I.ctaCreateInput,"data-testid":"welcome-create-input"}),f.jsx("button",{onClick:g,className:I.ctaCreateOk,disabled:l,"aria-label":l?"Creating workspace":void 0,"data-testid":"welcome-create-ok",children:l?f.jsx(ic,{size:"sm",label:"Creating workspace"}):"OK"})]}):f.jsx("button",{className:I.ctaButton,onClick:()=>c(!0),disabled:l||!m,"data-testid":"welcome-create-button",children:"Create Your First Workspace"}),!m&&f.jsx("div",{className:I.ctaDescription,children:"Add an environment first via Settings before creating a workspace."})]})}function vB(n,a){const i=[];let l=n;const r=new Set;for(;l&&a.has(l)&&!r.has(l);){r.add(l);const c=a.get(l);i.unshift(c),l=c.parentTaskId||void 0}return i}const Hi={label:"Home",url:sl};function yB(n){return n?[Hi,{label:"Settings",url:Is},{label:n,url:void 0}]:[Hi,{label:"Settings",url:void 0}]}function bB(){return[Hi,{label:"New Environment",url:void 0}]}function xB(){return[Hi,{label:"New Chat",url:void 0}]}function _B(n){return[Hi,{label:`Session ${n.slice(0,8)}`,url:void 0}]}function SB(n,a,i){const l=vB(n,i),r=i.get(n),c=r==null?void 0:r.workspaceId,d=c?a.find(g=>g.id===c):void 0,p=[Hi];d&&p.push({label:d.name,url:Ii(d.id)});for(let g=0;g<l.length-1;g++)p.push({label:l[g].title,url:Na(l[g].id)});const m=l[l.length-1];return p.push({label:(m==null?void 0:m.title)??n,url:void 0}),p}function TB(){const n=xB();return f.jsxs("div",{className:I.panelContainer,children:[f.jsx(qi,{segments:n}),f.jsx("div",{className:I.emptyState,children:"Enter a prompt below to start a new session"})]})}function CB({sessionId:n,session:a,isActive:i,onKill:l}){return f.jsxs("div",{className:I.header,children:[f.jsxs("span",{children:["Session: ",n.slice(0,8),a&&` | ${a.runtime} | ${a.status}`]}),f.jsxs("span",{className:I.headerInfo,children:[a&&f.jsx("span",{children:a.prompt.length>60?a.prompt.slice(0,60)+"...":a.prompt}),i&&f.jsx("button",{onClick:()=>l(n),title:"Stop session",className:I.killButton,children:"×"})]})]})}function EB({session:n}){const a=n&&["completed","failed","interrupted"].includes(n.status),i=a?`Session ${n.status} with no events recorded.`:"Waiting for events...";return f.jsx("div",{className:a?I.errorMessage:I.waitingMessage,children:i})}function kB(){const{sessionId:n}=cc(),{events:a,eventsDropped:i,sessions:l,kill:r,loadSessionEvents:c}=Rt(),d=x.useRef(void 0),p=_B(n),m=l.find(v=>v.id===n)??void 0,g=x.useMemo(()=>{const v=n?a.filter(_=>_.sessionId===n):[];return Ih(Lh(v))},[a,n]);if(x.useEffect(()=>{n&&n!==d.current&&(d.current=n,c(n))},[n,c]),!n)return f.jsx("div",{className:I.emptyState,children:"No session selected"});const y=(m==null?void 0:m.status)==="running"||(m==null?void 0:m.status)==="idle";return f.jsxs("div",{className:I.panelContainer,children:[f.jsx(qi,{segments:p}),f.jsx(CB,{sessionId:n,session:m,isActive:y,onKill:r}),f.jsx(Oh,{events:g,eventsDropped:i,emptyState:f.jsx(EB,{session:m})})]})}const B0=220,O0=70,wB=40,AB=60,NB="hierarchy",jB="dependency";function DB(n){return x.useMemo(()=>{if(n.length===0)return{nodes:[],edges:[]};const a=new Ov.graphlib.Graph({multigraph:!0});a.setDefaultEdgeLabel(()=>({})),a.setGraph({rankdir:"TB",nodesep:wB,ranksep:AB});const i=new Map(n.map(d=>[d.id,d])),l=new Map;for(const d of n)if(d.parentTaskId&&i.has(d.parentTaskId)){const p=l.get(d.parentTaskId)||[];p.push(d),l.set(d.parentTaskId,p)}for(const d of n)a.setNode(d.id,{width:B0,height:O0});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:NB},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:jB},style:{stroke:"var(--text-tertiary)",strokeWidth:1.5,strokeDasharray:"6 3"},animated:!1})}}return Ov.layout(a),{nodes:n.map(d=>{const p=a.node(d.id),m=l.get(d.id)||[];return{id:d.id,type:"task",position:{x:p.x-B0/2,y:p.y-O0/2},data:{task:d,childCount:m.length,doneChildCount:m.filter(g=>g.status==="complete").length,hasDependencies:d.dependsOn.length>0}}}),edges:r}},[n])}const MB="_dagContainer_js4w6_1",RB="_taskNode_js4w6_26",BB="_taskNodeBorder_js4w6_54",OB="_taskNodeContent_js4w6_60",LB="_taskNodeHeader_js4w6_70",IB="_taskNodeIcon_js4w6_77",UB="_taskNodeTitle_js4w6_82",zB="_taskNodeBadges_js4w6_90",VB="_childBadge_js4w6_95",HB="_depBadge_js4w6_107",GB="_handle_js4w6_119",PB="_emptyCta_js4w6_126",$B="_ctaDescription_js4w6_137",FB="_ctaButton_js4w6_144",nn={dagContainer:MB,taskNode:RB,taskNodeBorder:BB,taskNodeContent:OB,taskNodeHeader:LB,taskNodeIcon:IB,taskNodeTitle:UB,taskNodeBadges:zB,childBadge:VB,depBadge:HB,handle:GB,emptyCta:PB,ctaDescription:$B,ctaButton:FB};function YB({data:n}){const{task:a,childCount:i,doneChildCount:l,hasDependencies:r}=n,c=cs(a.status);return f.jsxs("div",{className:nn.taskNode,"data-task-id":a.id,"data-task-title":a.title,children:[f.jsx(Lv,{type:"target",position:Iv.Top,className:nn.handle}),f.jsx("div",{className:nn.taskNodeBorder,style:{backgroundColor:c.color}}),f.jsxs("div",{className:nn.taskNodeContent,children:[f.jsxs("div",{className:nn.taskNodeHeader,children:[f.jsx("span",{className:nn.taskNodeIcon,style:{color:c.color},children:c.icon}),f.jsx("span",{className:nn.taskNodeTitle,children:a.title})]}),f.jsxs("div",{className:nn.taskNodeBadges,children:[i>0&&f.jsxs("span",{className:nn.childBadge,children:[l,"/",i]}),r&&f.jsx("span",{className:nn.depBadge,children:"dep"})]})]}),f.jsx(Lv,{type:"source",position:Iv.Bottom,className:nn.handle})]})}const qB=qj,KB={task:YB};function ZB({workspaceId:n}){const{tasks:a}=Rt(),i=hn(),{resolvedThemeId:l}=hb(),r=x.useMemo(()=>a.filter(y=>y.workspaceId===n),[a,n]),{nodes:c,edges:d}=DB(r),p=x.useMemo(()=>{const y=getComputedStyle(document.documentElement),v={};for(const[_,C]of Object.entries(qB))v[_]=y.getPropertyValue(C).trim()||"#6b7a8d";return v},[l]),m=x.useCallback((y,v)=>{i(Na(v.id))},[i]),g=x.useCallback(y=>{const v=y.data;return p[v.task.status]||p.pending},[p]);return r.length===0?f.jsxs("div",{className:nn.emptyCta,children:[f.jsx("button",{className:nn.ctaButton,onClick:()=>i(zs(n)),children:"Create Task"}),f.jsx("div",{className:nn.ctaDescription,children:"Create tasks to see the dependency graph"})]}):f.jsx("div",{className:nn.dagContainer,children:f.jsxs(A1,{nodes:c,edges:d,nodeTypes:KB,onNodeClick:m,fitView:!0,fitViewOptions:{padding:.2},minZoom:.3,maxZoom:2,children:[f.jsx(N1,{variant:j1.Dots,gap:24,size:1,color:"var(--text-disabled)"}),f.jsx(D1,{showInteractive:!1}),f.jsx(M1,{nodeColor:g,maskColor:"var(--bg-overlay)",style:{background:"var(--bg-inset)"}})]})})}function XB({tasks:n,taskStatusById:a,sessionStatusByTaskId:i}){const l=new Map;for(const c of n)if(c.parentTaskId){const d=l.get(c.parentTaskId);d?d.push(c):l.set(c.parentTaskId,[c])}const r=new Map(D0.map(c=>[c,[]]));for(const c of n){const d=Bh(c.status),p=c.dependsOn.length>0&&c.dependsOn.some(E=>a.get(E)!=="complete"),m=l.get(c.id)??[],g=m.length,y=m.filter(E=>E.status==="complete").length;let v;if(d==="paused"&&i){const E=i.get(c.id);E==="idle"?v="Needs input":E==="completed"&&(v="Ready to complete")}const _={task:c,isBlocked:p,childCount:g,doneChildCount:y,pausedSubBadge:v},C=r.get(d);C?C.push(_):r.get("not_started").push(_)}for(const c of r.values())c.sort((d,p)=>d.task.sortOrder-p.task.sortOrder);return D0.map(c=>{const d=cs(c);return{status:c,label:d.label,style:d,tasks:r.get(c)??[]}})}const QB="_boardContainer_1c4y1_1",WB="_column_1c4y1_17",JB="_columnHeader_1c4y1_34",eO="_columnIcon_1c4y1_47",tO="_columnLabel_1c4y1_52",nO="_columnCount_1c4y1_57",aO="_cardList_1c4y1_67",sO="_emptyPlaceholder_1c4y1_76",iO="_card_1c4y1_67",oO="_cardHeader_1c4y1_107",lO="_cardStatusIcon_1c4y1_113",rO="_cardTitle_1c4y1_119",cO="_cardBadges_1c4y1_127",uO="_badge_1c4y1_134",dO="_blockedBadge_1c4y1_146",fO="_childBadge_1c4y1_151",hO="_depBadge_1c4y1_155",pO="_parentBadge_1c4y1_159",mO="_pausedSubBadge_1c4y1_166",gO="_personaBadge_1c4y1_170",vO="_envBadge_1c4y1_174",yO="_emptyCta_1c4y1_178",bO="_ctaButton_1c4y1_188",xO="_ctaDescription_1c4y1_204",Qe={boardContainer:QB,column:WB,columnHeader:JB,columnIcon:eO,columnLabel:tO,columnCount:nO,cardList:aO,emptyPlaceholder:sO,card:iO,cardHeader:oO,cardStatusIcon:lO,cardTitle:rO,cardBadges:cO,badge:uO,blockedBadge:dO,childBadge:fO,depBadge:hO,parentBadge:pO,pausedSubBadge:mO,personaBadge:gO,envBadge:vO,emptyCta:yO,ctaButton:bO,ctaDescription:xO};function _O({workspaceId:n}){const{tasks:a,sessions:i,personas:l,environments:r}=Rt(),c=hn(),d=x.useMemo(()=>a.filter(v=>v.workspaceId===n),[a,n]),p=x.useMemo(()=>new Map(a.map(v=>[v.id,v.status])),[a]),m=x.useMemo(()=>new Map(d.map(v=>[v.id,v])),[d]),g=x.useMemo(()=>{const v=new Map(i.map(S=>[S.id,S])),_=new Map(l.map(S=>[S.id,S])),C=new Map(r.map(S=>[S.id,S])),E=new Map,k=new Map,A=new Map;for(const S of d)if(S.latestSessionId){const N=v.get(S.latestSessionId);if(N){if(E.set(S.id,N.status),N.personaId){const D=_.get(N.personaId);D&&k.set(S.id,D.name)}if(N.environmentId){const D=C.get(N.environmentId);D&&A.set(S.id,D.displayName)}}}return{sessionStatusByTaskId:E,personaNameByTaskId:k,environmentNameByTaskId:A}},[d,i,l,r]),y=x.useMemo(()=>XB({tasks:d,taskStatusById:p,sessionStatusByTaskId:g.sessionStatusByTaskId}),[d,p,g]);return d.length===0?f.jsxs("div",{className:Qe.emptyCta,"data-testid":"board-empty-cta",children:[f.jsx("button",{className:Qe.ctaButton,onClick:()=>c(zs(n)),children:"Create Task"}),f.jsx("div",{className:Qe.ctaDescription,children:"Break your work into tasks and let agents tackle them"})]}):f.jsx("div",{className:Qe.boardContainer,"data-testid":"board-container",children:y.map(v=>f.jsxs("section",{className:Qe.column,"data-testid":`board-column-${v.status}`,"aria-label":`${v.label}, ${v.tasks.length} ${v.tasks.length===1?"task":"tasks"}`,children:[f.jsxs("div",{className:Qe.columnHeader,children:[f.jsx("span",{className:Qe.columnIcon,style:{color:v.style.color},children:v.style.icon}),f.jsx("span",{className:Qe.columnLabel,children:v.label}),f.jsx("span",{className:Qe.columnCount,"data-testid":`board-count-${v.status}`,children:v.tasks.length})]}),f.jsx("div",{className:Qe.cardList,children:v.tasks.length===0?f.jsx("div",{className:Qe.emptyPlaceholder,children:"No tasks"}):f.jsx(Vn,{mode:"popLayout",children:v.tasks.map(_=>f.jsx(Et.div,{layout:!0,initial:{opacity:0,y:4},animate:{opacity:1,y:0},exit:{opacity:0,y:-4},transition:{duration:.15},children:f.jsx(SO,{boardTask:_,tasksById:m,personaName:g.personaNameByTaskId.get(_.task.id),envName:g.environmentNameByTaskId.get(_.task.id),onClick:()=>c(Na(_.task.id))})},_.task.id))})})]},v.status))})}function SO({boardTask:n,tasksById:a,personaName:i,envName:l,onClick:r}){const{task:c,isBlocked:d,childCount:p,doneChildCount:m,pausedSubBadge:g}=n,y=cs(c.status),v=c.parentTaskId?a.get(c.parentTaskId):void 0;return f.jsxs("div",{className:Qe.card,tabIndex:0,role:"button","data-testid":`board-card-${c.id}`,onClick:r,onKeyDown:_=>{(_.key==="Enter"||_.key===" ")&&(_.preventDefault(),r())},children:[f.jsxs("div",{className:Qe.cardHeader,children:[f.jsx("span",{className:Qe.cardStatusIcon,style:{color:y.color},children:y.icon}),f.jsx("span",{className:Qe.cardTitle,children:c.title})]}),f.jsxs("div",{className:Qe.cardBadges,children:[v&&f.jsx("span",{className:`${Qe.badge} ${Qe.parentBadge}`,title:v.title,children:v.title}),p>0&&f.jsxs("span",{className:`${Qe.badge} ${Qe.childBadge}`,children:[m,"/",p]}),d&&f.jsx("span",{className:`${Qe.badge} ${Qe.blockedBadge}`,children:"blocked"}),c.dependsOn.length>0&&!d&&f.jsx("span",{className:`${Qe.badge} ${Qe.depBadge}`,children:"dep"}),g&&f.jsx("span",{className:`${Qe.badge} ${Qe.pausedSubBadge}`,children:g}),i&&f.jsx("span",{className:`${Qe.badge} ${Qe.personaBadge}`,children:i}),l&&f.jsx("span",{className:`${Qe.badge} ${Qe.envBadge}`,children:l})]})]})}function Uh(n){const{value:a,onSave:i,validate:l,fieldId:r,activeFieldId:c,onActivate:d,enterToSave:p=!0,trimOnSave:m=!0}=n,[g,y]=x.useState(""),[v,_]=x.useState(""),C=x.useRef(!1),E=c===r,k=x.useCallback(R=>{y(R),_("")},[]),A=x.useCallback(()=>{_("")},[]),S=x.useCallback(()=>{C.current=!1,d==null||d(null),y(""),_("")},[d]),N=x.useCallback(()=>{const R=m?g.trim():g;if(l){const G=l(g);if(G){_(G);return}}const L=m?a.trim():a;if(R===L){S();return}i(R),S()},[g,a,m,l,i,S]),D=x.useCallback(()=>{C.current=!0,d==null||d(r),y(a),_("")},[r,a,d]),H=x.useCallback(R=>{if(C.current){C.current=!1;return}R.relatedTarget instanceof HTMLElement&&R.relatedTarget.dataset.editAction===r||N()},[r,N]),O=x.useCallback(R=>{R.key==="Escape"?S():R.key==="Enter"&&p&&N()},[S,p,N]),$=(()=>{if(!E)return!1;const R=m?a.trim():a;return(m?g.trim():g)!==R})();return x.useEffect(()=>{!E&&(g!==""||v!=="")&&(y(""),_(""))},[E,g,v]),{isEditing:E,draft:g,error:v,isDirty:$,startEdit:D,cancelEdit:S,save:N,setDraft:k,clearError:A,handleBlur:H,handleKeyDown:O,ignoreInitialBlurRef:C}}const TO="_editFieldWrapper_yuzty_1",CO="_editInput_yuzty_10",EO="_editTextarea_yuzty_42",kO="_editSelect_yuzty_78",wO="_editError_yuzty_111",AO="_editInputInvalid_yuzty_118",NO="_editHint_yuzty_123",jO="_unsavedDot_yuzty_132",DO="_metaValueClickable_yuzty_140",MO="_editButton_yuzty_159",RO="_metaPlaceholder_yuzty_175",BO="_worktreeToggle_yuzty_180",Fe={editFieldWrapper:TO,editInput:CO,editTextarea:EO,editSelect:kO,editError:wO,editInputInvalid:AO,editHint:NO,unsavedDot:jO,metaValueClickable:DO,editButton:MO,metaPlaceholder:RO,worktreeToggle:BO};function af(n){const{value:a,onSave:i,validate:l,mode:r="edit",fieldId:c="text",activeFieldId:d,onActivate:p,onChange:m,renderDisplay:g,placeholder:y,maxLength:v,ariaLabel:_,"data-testid":C}=n,E=x.useRef(null),k=Uh({value:a,onSave:i,validate:l,fieldId:c,activeFieldId:d,onActivate:p,enterToSave:!0,trimOnSave:!0});if(x.useEffect(()=>{if(k.isEditing){const S=window.setTimeout(()=>{var N;(N=E.current)==null||N.focus()},0);return()=>window.clearTimeout(S)}},[k.isEditing]),r==="create"){const S=D=>{m==null||m(D.target.value)},N=l==null?void 0:l(a);return f.jsxs("div",{className:Fe.editFieldWrapper,children:[f.jsx("input",{className:`${Fe.editInput} ${N?Fe.editInputInvalid:""}`,value:a,onChange:S,maxLength:v,placeholder:y,"aria-label":_,"data-testid":C?`${C}-input`:void 0}),N&&f.jsx("span",{className:Fe.editError,"data-testid":"edit-error",children:N})]})}if(k.isEditing)return f.jsxs("div",{className:Fe.editFieldWrapper,children:[f.jsx("input",{ref:E,className:`${Fe.editInput} ${k.error?Fe.editInputInvalid:""}`,value:k.draft,onChange:S=>k.setDraft(S.target.value),onBlur:k.handleBlur,onKeyDown:k.handleKeyDown,maxLength:v,placeholder:y,"aria-label":_,"data-testid":C?`${C}-input`:void 0}),k.isDirty&&f.jsx("span",{className:Fe.unsavedDot,title:"Unsaved changes"}),k.error&&f.jsx("span",{className:Fe.editError,"data-testid":"edit-error",children:k.error}),f.jsx("span",{className:Fe.editHint,children:"Enter to save · Esc to cancel"})]});const A=g==null?void 0:g(a);return f.jsxs("span",{role:"button",tabIndex:0,className:Fe.metaValueClickable,onClick:()=>k.startEdit(),onKeyDown:S=>{(S.key==="Enter"||S.key===" ")&&(S.preventDefault(),k.startEdit())},title:"Click to edit","aria-label":_,"data-testid":C?`${C}-button`:void 0,children:[A!==void 0?A:a?f.jsx("span",{children:a}):f.jsx("span",{className:Fe.metaPlaceholder,children:y||"None"}),f.jsx("span",{className:Fe.editButton,"aria-hidden":"true",children:"✏️"})]})}function OO(n){const{value:a,onSave:i,validate:l,mode:r="edit",fieldId:c="textarea",activeFieldId:d,onActivate:p,onChange:m,renderDisplay:g,placeholder:y,ariaLabel:v,"data-testid":_}=n,C=x.useRef(null),E=Uh({value:a,onSave:i,validate:l,fieldId:c,activeFieldId:d,onActivate:p,enterToSave:!1,trimOnSave:!1});if(x.useEffect(()=>{if(E.isEditing){const A=window.setTimeout(()=>{var S;(S=C.current)==null||S.focus()},0);return()=>window.clearTimeout(A)}},[E.isEditing]),r==="create"){const A=N=>{m==null||m(N.target.value)},S=l==null?void 0:l(a);return f.jsxs("div",{className:Fe.editFieldWrapper,children:[f.jsx("textarea",{className:`${Fe.editTextarea} ${S?Fe.editInputInvalid:""}`,value:a,onChange:A,placeholder:y,"aria-label":v,"data-testid":_?`${_}-input`:void 0}),S&&f.jsx("span",{className:Fe.editError,"data-testid":"edit-error",children:S})]})}if(E.isEditing)return f.jsxs("div",{className:Fe.editFieldWrapper,children:[f.jsx("textarea",{ref:C,className:`${Fe.editTextarea} ${E.error?Fe.editInputInvalid:""}`,value:E.draft,onChange:A=>E.setDraft(A.target.value),onBlur:E.handleBlur,onKeyDown:E.handleKeyDown,title:v,"aria-label":v,"data-testid":_?`${_}-input`:void 0}),E.isDirty&&f.jsx("span",{className:Fe.unsavedDot,title:"Unsaved changes"}),E.error&&f.jsx("span",{className:Fe.editError,"data-testid":"edit-error",children:E.error}),f.jsx("span",{className:Fe.editHint,children:"Tab to save · Esc to cancel"})]});const k=g==null?void 0:g(a);return f.jsxs("span",{role:"button",tabIndex:0,className:Fe.metaValueClickable,onClick:()=>E.startEdit(),onKeyDown:A=>{(A.key==="Enter"||A.key===" ")&&(A.preventDefault(),E.startEdit())},title:"Click to edit","aria-label":v,"data-testid":_?`${_}-button`:void 0,children:[k!==void 0?k:a?f.jsx("span",{children:a}):f.jsx("span",{className:Fe.metaPlaceholder,children:y||"None"}),f.jsx("span",{className:Fe.editButton,"aria-hidden":"true",children:"✏️"})]})}function r_(n){var D;const{value:a,onSave:i,mode:l="edit",options:r,fieldId:c="select",activeFieldId:d,onActivate:p,onChange:m,renderDisplay:g,placeholder:y,ariaLabel:v,"data-testid":_}=n,C=x.useRef(null),E=Uh({value:a,onSave:i,fieldId:c,activeFieldId:d,onActivate:p,enterToSave:!1,trimOnSave:!1});x.useEffect(()=>{if(E.isEditing){const H=window.setTimeout(()=>{var O;(O=C.current)==null||O.focus()},0);return()=>window.clearTimeout(H)}},[E.isEditing]);const k=x.useCallback(H=>{const O=H.target.value;E.ignoreInitialBlurRef.current=!1,O!==a&&i(O),E.cancelEdit()},[a,i,E]),A=x.useCallback(H=>{if(E.ignoreInitialBlurRef.current){E.ignoreInitialBlurRef.current=!1;return}H.relatedTarget instanceof HTMLElement&&H.relatedTarget.dataset.editAction===c||E.cancelEdit()},[c,E]);if(l==="create")return f.jsx("select",{className:Fe.editSelect,value:a,onChange:H=>m==null?void 0:m(H.target.value),"aria-label":v,"data-testid":_?`${_}-select`:void 0,children:r.map(H=>f.jsx("option",{value:H.value,children:H.label},H.value))});if(E.isEditing)return f.jsx("select",{ref:C,className:Fe.editSelect,value:E.draft,onChange:k,onBlur:A,title:v,"aria-label":v,"data-testid":_?`${_}-select`:void 0,children:r.map(H=>f.jsx("option",{value:H.value,children:H.label},H.value))});const S=g==null?void 0:g(a),N=(D=r.find(H=>H.value===a))==null?void 0:D.label;return f.jsxs("button",{type:"button",className:Fe.metaValueClickable,onClick:()=>E.startEdit(),title:"Click to change","aria-label":v,"data-testid":_?`${_}-button`:void 0,children:[S!==void 0?S:N?f.jsx("span",{children:N}):f.jsx("span",{className:Fe.metaPlaceholder,children:y||"None"}),f.jsx("span",{className:Fe.editButton,"aria-hidden":"true",children:"✏️"})]})}function LO(n){const{checked:a,onChange:i,label:l,ariaLabel:r,"data-testid":c}=n;return f.jsxs("label",{className:Fe.worktreeToggle,"data-testid":c,children:[f.jsx("input",{type:"checkbox",checked:a,onChange:d=>i(d.target.checked),"aria-label":r}),f.jsx("span",{children:l})]})}const IO="_envRow_1e1r5_1",UO="_envDot_1e1r5_7",zO="_envDotGreen_1e1r5_14",VO="_envDotYellow_1e1r5_18",HO="_envDotRed_1e1r5_22",GO="_envDotGray_1e1r5_26",Oi={envRow:IO,envDot:UO,envDotGreen:zO,envDotYellow:VO,envDotRed:HO,envDotGray:GO};function PO(n){const a=n.toLowerCase();return a==="ready"||a==="running"||a==="available"||a==="connected"?Oi.envDotGreen:a==="provisioning"||a==="starting"||a==="pending"||a==="connecting"?Oi.envDotYellow:a==="error"||a==="failed"||a==="disconnected"?Oi.envDotRed:Oi.envDotGray}function $O(n){const{value:a,onSave:i,environments:l,allowNone:r=!1,fieldId:c="environment",activeFieldId:d,onActivate:p,placeholder:m="No environment",ariaLabel:g="Environment","data-testid":y}=n,v=l.find(E=>E.id===a),_=[...r?[{value:"",label:"None"}]:[],...l.map(E=>({value:E.id,label:E.displayName}))],C=()=>{if(v)return f.jsxs("span",{className:Oi.envRow,children:[f.jsx("span",{className:`${Oi.envDot} ${PO(v.status)}`}),v.displayName]})};return f.jsx(r_,{value:a,onSave:i,options:_,fieldId:c,activeFieldId:d,onActivate:p,renderDisplay:C,placeholder:m,ariaLabel:g,"data-testid":y})}function L0(n){if(!n)return"";const a=new Date(n);if(isNaN(a.getTime()))return"";const l=Date.now()-a.getTime();if(l<0)return"just now";const r=Math.floor(l/6e4);if(r<1)return"just now";if(r<60)return`${r}m ago`;const c=Math.floor(r/60);if(c<24)return`${c}h ago`;const d=Math.floor(c/24);return d<30?`${d}d ago`:a.toLocaleDateString(void 0,{month:"short",day:"numeric",year:"numeric"})}const sf=100;function FO(){const{workspaceId:n}=cc(),a=hn(),{tasks:i,environments:l,workspaces:r,personas:c,archiveWorkspace:d,updateWorkspace:p}=Rt(),[m,g]=x.useState("tasks"),[y,v]=x.useState(!1),[_,C]=x.useState(null),[E,k]=x.useState(!1),A=x.useRef(void 0),S=r.find(R=>R.id===n),N=[{label:"Home",url:sl},{label:(S==null?void 0:S.name)??"Workspace",url:void 0}];x.useEffect(()=>{const R=A.current;A.current=n,!(R===void 0||R===n)&&_!==null&&C(null)},[n,_]);const D=i.filter(R=>R.workspaceId===n),H=D.filter(R=>R.status==="complete").length,O=D.length,$=O>0?Math.round(H/O*100):0;return f.jsxs("div",{className:I.panelContainer,children:[f.jsx(qi,{segments:N}),f.jsxs("div",{className:I.workspaceHeader,children:[f.jsx("span",{className:I.workspaceName,"data-testid":"workspace-name",children:f.jsx(af,{value:(S==null?void 0:S.name)||"",onSave:R=>{S&&p(S.id,{name:R})},validate:R=>{const L=R.trim();if(!L)return"Name is required";if(L.length>sf)return`Max ${sf} characters`},maxLength:sf,fieldId:"name",activeFieldId:_,onActivate:C,ariaLabel:"Workspace name",renderDisplay:R=>R||n||void 0,"data-testid":"edit-name"})}),f.jsx("button",{className:I.archiveButton,onClick:()=>v(!0),title:"Archive workspace","data-testid":"archive-workspace-button",children:"Archive"})]}),f.jsxs("button",{className:I.metaToggle,onClick:()=>k(!E),"aria-expanded":!E,"aria-controls":"workspace-meta-panel","data-testid":"meta-toggle",children:[f.jsx("span",{className:`${I.metaToggleArrow} ${E?"":I.metaToggleArrowOpen}`,children:"▶"}),"Details"]}),!E&&f.jsxs("div",{className:I.workspaceMeta,"data-testid":"workspace-meta",id:"workspace-meta-panel",children:[f.jsxs("div",{className:I.metaRow,children:[f.jsx("span",{className:I.metaLabel,children:"Description"}),f.jsx("div",{className:I.metaValue,children:f.jsx(OO,{value:(S==null?void 0:S.description)||"",onSave:R=>{S&&p(S.id,{description:R})},fieldId:"description",activeFieldId:_,onActivate:C,renderDisplay:R=>R?f.jsx("span",{className:I.overviewMarkdown,children:f.jsx(Vf,{remarkPlugins:[Hf],children:R})}):void 0,placeholder:"No description",ariaLabel:"Workspace description","data-testid":"edit-description"})})]}),f.jsxs("div",{className:I.metaRow,children:[f.jsx("span",{className:I.metaLabel,children:"Repository"}),f.jsx("div",{className:I.metaValue,children:f.jsx(af,{value:(S==null?void 0:S.repoUrl)||"",onSave:R=>{S&&p(S.id,{repoUrl:R})},validate:R=>{const L=R.trim();if(L&&!/^https?:\/\/.+/.test(L))return"Must be a valid http(s) URL"},fieldId:"repoUrl",activeFieldId:_,onActivate:C,renderDisplay:R=>R&&/^https?:\/\//i.test(R)?f.jsx("a",{className:I.repoLink,href:R,target:"_blank",rel:"noopener noreferrer",onClick:L=>L.stopPropagation(),children:R}):R?f.jsx("span",{children:R}):void 0,placeholder:"No repository",ariaLabel:"Workspace repository URL","data-testid":"edit-repo"})})]}),f.jsxs("div",{className:I.metaRow,children:[f.jsx("span",{className:I.metaLabel,children:"Environment"}),f.jsx("div",{className:I.metaValue,children:f.jsx($O,{value:(S==null?void 0:S.environmentId)||"",onSave:R=>{S&&R&&p(S.id,{environmentId:R})},environments:l,fieldId:"environmentId",activeFieldId:_,onActivate:C,placeholder:"Select environment",ariaLabel:"Workspace environment","data-testid":"edit-env"})})]}),f.jsxs("div",{className:I.metaRow,children:[f.jsx("span",{className:I.metaLabel,children:"Persona"}),f.jsx("div",{className:I.metaValue,children:f.jsx(r_,{value:(S==null?void 0:S.defaultPersonaId)||"",onSave:R=>{S&&p(S.id,{defaultPersonaId:R})},options:[{value:"",label:"(Inherit)"},...c.map(R=>({value:R.id,label:R.name}))],fieldId:"defaultPersonaId",activeFieldId:_,onActivate:C,renderDisplay:R=>{const L=c.find(G=>G.id===R);if(L)return f.jsx("span",{children:L.name})},placeholder:(S==null?void 0:S.defaultPersonaId)||"(Inherit)",ariaLabel:"Workspace default persona","data-testid":"edit-persona"})})]}),f.jsxs("div",{className:I.metaRow,children:[f.jsx("span",{className:I.metaLabel,children:"Worktrees"}),f.jsx("div",{className:I.metaValue,children:f.jsx(LO,{checked:(S==null?void 0:S.useWorktrees)??!0,onChange:R=>{S&&p(S.id,{useWorktrees:R})},label:"Enable worktree isolation","data-testid":"worktree-toggle"})})]}),f.jsxs("div",{className:I.metaRow,children:[f.jsx("span",{className:I.metaLabel,children:"Working Dir"}),f.jsx("div",{className:I.metaValue,children:f.jsx(af,{value:(S==null?void 0:S.worktreeBasePath)||"",onSave:R=>{S&&p(S.id,{worktreeBasePath:R})},fieldId:"worktreeBasePath",activeFieldId:_,onActivate:C,placeholder:"Default (server default)",ariaLabel:"Working directory","data-testid":"edit-worktree-base-path"})})]}),S&&f.jsxs("div",{className:I.metaTimestamps,children:[f.jsxs("span",{className:I.metaTimestamp,children:["Created ",L0(S.createdAt)]}),S.updatedAt&&S.updatedAt!==S.createdAt&&f.jsxs("span",{className:I.metaTimestamp,children:["· Updated ",L0(S.updatedAt)]})]})]}),O>0&&f.jsxs("div",{className:I.progressBarContainer,"data-testid":"progress-bar",children:[f.jsx("div",{className:I.progressBar,children:f.jsx("div",{className:I.progressFill,style:{width:`${$}%`}})}),f.jsxs("span",{className:I.progressLabel,children:[H,"/",O]})]}),f.jsxs("div",{className:I.tabBar,role:"tablist","aria-label":"Workspace view",children:[f.jsx("button",{role:"tab","aria-selected":m==="graph",className:`${I.tab} ${m==="graph"?I.active:""}`,onClick:()=>g("graph"),children:"Graph"}),f.jsx("button",{role:"tab","aria-selected":m==="board",className:`${I.tab} ${m==="board"?I.active:""}`,onClick:()=>g("board"),"data-testid":"board-tab",children:"Board"}),f.jsx("button",{role:"tab","aria-selected":m==="tasks",className:`${I.tab} ${m==="tasks"?I.active:""}`,onClick:()=>g("tasks"),children:"Tasks"})]}),m==="tasks"&&O>0&&f.jsxs("div",{className:I.workspaceSummary,children:[f.jsx("span",{className:I.workspaceSummaryTitle,children:`${H}/${O} tasks complete`}),f.jsx("span",{className:I.workspaceSummarySubtitle,children:"Select a task or click + to create one"})]}),m==="tasks"&&O===0&&f.jsxs("div",{className:I.emptyCta,children:[f.jsx("button",{className:I.ctaButton,onClick:()=>a(zs(n)),children:"Create Task"}),f.jsx("div",{className:I.ctaDescription,children:"Break your work into tasks and let agents tackle them"})]}),m==="board"&&f.jsx(_O,{workspaceId:n}),m==="graph"&&f.jsx(ZB,{workspaceId:n}),f.jsx(yc,{isOpen:y,title:"Archive Workspace?",description:"This will hide the workspace from the sidebar. Tasks will not be deleted.",confirmLabel:"Archive",onConfirm:()=>{S&&(d(S.id),a("/",{replace:!0})),v(!1)},onCancel:()=>v(!1)})]})}const YO="_container_cddyd_1",qO="_header_cddyd_8",KO="_headerTitle_cddyd_35",ZO="_badge_cddyd_44",XO="_headerActions_cddyd_54",QO="_body_cddyd_61",WO="_formContent_cddyd_73",JO="_section_cddyd_85",e6="_label_cddyd_91",t6="_titleInput_cddyd_98",n6="_descriptionTextarea_cddyd_131",a6="_parentContext_cddyd_167",s6="_parentLabel_cddyd_175",i6="_parentName_cddyd_182",o6="_personaSelect_cddyd_186",l6="_depList_cddyd_220",r6="_depItem_cddyd_226",c6="_depItemSelected_cddyd_248",u6="_noDeps_cddyd_252",d6="_btnPrimary_cddyd_258",f6="_btnGhost_cddyd_289",at={container:YO,header:qO,headerTitle:KO,badge:ZO,headerActions:XO,body:QO,formContent:WO,section:JO,label:e6,titleInput:t6,descriptionTextarea:n6,parentContext:a6,parentLabel:s6,parentName:i6,personaSelect:o6,depList:l6,depItem:r6,depItemSelected:c6,noDeps:u6,btnPrimary:d6,btnGhost:f6};function c_({mode:n,taskId:a,workspaceId:i,parentTaskId:l}){const{tasks:r,personas:c,createTask:d,updateTask:p}=Rt(),{showToast:m}=hl(),g=hn(),y=n==="edit",v=y&&a?r.find(K=>K.id===a):void 0,_=y?(v==null?void 0:v.workspaceId)??"":i??"",C=y?(v==null?void 0:v.parentTaskId)??"":l??"",E=C?r.find(K=>K.id===C):void 0,[k,A]=x.useState((v==null?void 0:v.title)??""),[S,N]=x.useState((v==null?void 0:v.description)??""),[D,H]=x.useState((v==null?void 0:v.dependsOn)??[]),[O,$]=x.useState((v==null?void 0:v.defaultPersonaId)??""),[R,L]=x.useState((v==null?void 0:v.canDecompose)??!1),[G,ee]=x.useState(!1),te=x.useRef(!1);x.useEffect(()=>{y&&v&&!te.current&&(te.current=!0,A(v.title),N(v.description),H(v.dependsOn),$(v.defaultPersonaId),L(v.canDecompose))},[y,v]);const ne=r.filter(K=>K.workspaceId===_&&(!y||K.id!==a)&&K.id!==C),ie=k.trim().length>0&&(!y||v!==void 0)&&(y||_.length>0),he=K=>{H(de=>de.includes(K)?de.filter(Y=>Y!==K):[...de,K])},oe=()=>{!ie||G||y&&v===void 0||(y&&a?(p(a,k.trim(),S,D,O),m("Task updated","success"),g(Na(a),{replace:!0})):(ee(!0),d(_,k.trim(),S,D.length>0?D:void 0,C||void 0,O,R,()=>{m("Task created","success"),g(_?Ii(_):"/",{replace:!0})},K=>{m(K,"error"),ee(!1)})))},j=()=>{g(y&&a?Na(a):_?Ii(_):"/")},Z=y?"edit task":C?"child task":"new task";return f.jsxs("div",{className:at.container,children:[f.jsxs("div",{className:at.header,children:[f.jsxs("div",{className:at.headerTitle,children:[f.jsx("span",{className:at.badge,children:Z}),E&&f.jsxs("span",{className:at.parentContext,children:[f.jsx("span",{className:at.parentLabel,children:"Child of"}),f.jsx("span",{className:at.parentName,children:E.title})]})]}),f.jsxs("div",{className:at.headerActions,children:[f.jsx("button",{onClick:oe,disabled:!ie||G,className:at.btnPrimary,"data-testid":"task-edit-save",children:G?"Creating…":y?"Save Changes":"Create"}),f.jsx("button",{onClick:j,className:at.btnGhost,children:"Cancel"})]})]}),f.jsx("div",{className:at.body,children:f.jsxs("div",{className:at.formContent,children:[f.jsxs("div",{className:at.section,children:[f.jsx("label",{className:at.label,htmlFor:"task-edit-title",children:"Title"}),f.jsx("input",{id:"task-edit-title",type:"text",value:k,onChange:K=>A(K.target.value),placeholder:"Task title...",autoFocus:!0,className:at.titleInput,"data-testid":"task-edit-title",onKeyDown:K=>{K.key==="Enter"&&ie&&oe()}})]}),f.jsxs("div",{className:at.section,children:[f.jsx("label",{className:at.label,htmlFor:"task-edit-description",children:"Description"}),f.jsx("textarea",{id:"task-edit-description",value:S,onChange:K=>N(K.target.value),placeholder:"Describe the task... (markdown supported)",className:at.descriptionTextarea,"data-testid":"task-edit-description",rows:8})]}),f.jsxs("div",{className:at.section,children:[f.jsx("label",{className:at.label,htmlFor:"task-edit-persona",children:"Default Persona"}),f.jsxs("select",{id:"task-edit-persona",value:O,onChange:K=>$(K.target.value),className:at.personaSelect,"data-testid":"task-edit-persona",children:[f.jsx("option",{value:"",children:"(Inherit)"}),c.map(K=>f.jsx("option",{value:K.id,children:K.name},K.id))]})]}),!y&&f.jsx("div",{className:at.section,children:f.jsxs("label",{className:at.depItem,"data-testid":"task-edit-can-decompose",children:[f.jsx("input",{type:"checkbox",checked:R,onChange:K=>L(K.target.checked)}),"Can spawn subtasks"]})}),f.jsxs("div",{className:at.section,children:[f.jsx("div",{className:at.label,children:"Dependencies"}),ne.length===0?f.jsx("div",{className:at.noDeps,children:"No other tasks in this workspace"}):f.jsx("div",{className:at.depList,children:ne.map(K=>{const de=D.includes(K.id);return f.jsxs("label",{className:`${at.depItem} ${de?at.depItemSelected:""}`,"data-testid":`dep-option-${K.id}`,children:[f.jsx("input",{type:"checkbox",checked:de,onChange:()=>he(K.id)}),K.title,f.jsxs("span",{style:{opacity:.5,fontSize:"11px",marginLeft:"4px"},children:["(",K.status,")"]})]},K.id)})})]})]})})]})}function h6(){const[n]=Zf(),a=n.get("workspace")??"",i=n.get("parent")??void 0;return a?f.jsx(c_,{mode:"new",workspaceId:a,parentTaskId:i}):f.jsx(Li,{to:"/",replace:!0})}function p6(){const{taskId:n}=cc();return f.jsx(c_,{mode:"edit",taskId:n})}const m6="_container_1pqxm_1",g6="_emptyState_1pqxm_8",v6="_card_1pqxm_14",y6="_cardHeader_1pqxm_34",b6="_categoryBadge_1pqxm_46",x6="_findingTitle_1pqxm_54",_6="_findingDate_1pqxm_60",S6="_findingContent_1pqxm_72",T6="_tags_1pqxm_78",C6="_tag_1pqxm_78",Qn={container:m6,emptyState:g6,card:v6,cardHeader:y6,categoryBadge:b6,findingTitle:x6,findingDate:_6,findingContent:S6,tags:T6,tag:C6};function E6(n){const a=new Date(n),i=new Date,l=i.getTime()-a.getTime(),r=Math.floor(l/1e3),c=Math.floor(r/60),d=Math.floor(c/60),p=Math.floor(d/24);if(r<60)return"just now";if(c<60)return`${c}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 I0={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 k6({workspaceId:n}){const{findings:a}=Rt(),i=a.filter(l=>l.workspaceId===n);return i.length===0?f.jsx("div",{className:Qn.emptyState,children:"No findings yet. Agents will post discoveries here."}):f.jsx("div",{className:Qn.container,children:i.map((l,r)=>{const c=I0[l.category]||I0.general;return f.jsxs(Et.div,{className:Qn.card,initial:{opacity:0,y:8},animate:{opacity:1,y:0},transition:{delay:r*.05,duration:.2},children:[f.jsxs("div",{className:Qn.cardHeader,children:[f.jsx("span",{className:Qn.categoryBadge,style:{background:c.bg,color:c.text},children:l.category}),f.jsx("span",{className:Qn.findingTitle,children:l.title}),f.jsx("span",{className:Qn.findingDate,title:l.createdAt,children:E6(l.createdAt)})]}),f.jsx("div",{className:Qn.findingContent,children:l.content.length>300?l.content.slice(0,300)+"...":l.content}),l.tags.length>0&&f.jsx("div",{className:Qn.tags,children:l.tags.map(d=>f.jsx("span",{className:Qn.tag,style:{color:c.text,textShadow:`0 0 8px ${c.text}`},children:d},d))})]},l.id)})})}function zr(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 of(n,a){if(!n||!a)return;const i=new Date(a).getTime()-new Date(n).getTime();if(isNaN(i)||i<0)return;const l=Math.floor(i/6e4),r=Math.floor(i%6e4/1e3);if(l===0)return`${r}s`;const c=Math.floor(l/60),d=l%60;return c===0?`${l}m ${r}s`:`${c}h ${d}m`}function U0(n){const a=n.toLowerCase();return a==="ready"||a==="running"||a==="available"||a==="connected"?I.envDotGreen:a==="provisioning"||a==="starting"||a==="pending"||a==="connecting"?I.envDotYellow:a==="error"||a==="failed"||a==="disconnected"?I.envDotRed:I.envDotGray}function w6({status:n}){const a=cs(n),i=$j(n);return f.jsx("span",{className:`${I.statusBadge} ${I[i]??I.statusPending}`,children:a.label})}function A6({task:n,tasksById:a,environments:i,workspaces:l,taskSessions:r,selectedEnvId:c}){const d=r.length>0?r[r.length-1]:void 0,p=(d==null?void 0:d.environmentId)??"",m=p?i.find(_=>_.id===p):void 0,g=l.find(_=>_.id===n.workspaceId),y=i.find(_=>_.id===c),v=n.branch&&(g!=null&&g.repoUrl)?`${g.repoUrl.replace(/\/$/,"")}/tree/${encodeURIComponent(n.branch)}`:void 0;return f.jsxs("div",{className:I.overviewDashboard,children:[f.jsxs("div",{className:I.overviewHero,children:[f.jsx(w6,{status:n.status}),n.branch&&f.jsx("span",{className:I.overviewBranchPill,children:v?f.jsxs("a",{href:v,target:"_blank",rel:"noreferrer noopener",className:I.branchLink,children:["🔗"," ",n.branch]}):f.jsxs("span",{children:["🔗"," ",n.branch]})})]}),typeof n.description=="string"&&n.description&&f.jsxs("div",{className:I.overviewSection,children:[f.jsx("div",{className:I.overviewLabel,children:"Description"}),f.jsx("div",{className:I.overviewMarkdown,children:f.jsx(Vf,{remarkPlugins:[Hf],children:n.description})})]}),f.jsxs("div",{className:I.overviewSection,children:[f.jsx("div",{className:I.overviewLabel,children:"Environment"}),p&&m?f.jsxs("div",{className:I.envRow,"data-testid":"task-overview-environment",children:[f.jsx("span",{className:`${I.envDot} ${U0(m.status)}`,title:m.status,"aria-label":`Status: ${m.status}`,role:"img"}),f.jsx("span",{className:I.overviewValue,children:m.displayName})]}):y?f.jsxs("div",{className:I.envRow,"data-testid":"task-overview-environment",children:[f.jsx("span",{className:`${I.envDot} ${U0(y.status)}`,title:y.status,"aria-label":`Status: ${y.status}`,role:"img"}),f.jsx("span",{className:I.overviewValue,children:y.displayName}),f.jsx("span",{className:I.overviewMuted,children:"(workspace default)"})]}):f.jsx("div",{className:I.overviewMuted,children:"Set in workspace settings"})]}),f.jsxs("div",{className:I.overviewSection,children:[f.jsx("div",{className:I.overviewLabel,children:"Dependencies"}),n.dependsOn.length===0?f.jsx("div",{className:I.overviewMuted,children:"None"}):f.jsx("div",{className:I.depList,children:n.dependsOn.map(_=>{const C=a.get(_),E=(C==null?void 0:C.status)==="complete";return f.jsxs("div",{className:`${I.depItem} ${E?I.depDone:I.depBlocked}`,children:[f.jsx("span",{children:E?"✓":"○"}),f.jsx("span",{children:(C==null?void 0:C.title)??_})]},_)})})]}),f.jsxs("div",{className:I.overviewSection,children:[f.jsx("div",{className:I.overviewLabel,children:"Timeline"}),f.jsxs("div",{className:I.timeline,children:[n.createdAt&&f.jsxs("div",{className:I.timelineRow,children:[f.jsx("span",{className:I.timelineKey,children:"Created"}),f.jsx("span",{className:I.timelineValue,children:zr(n.createdAt)})]}),n.assignedAt&&(()=>{const _=of(n.createdAt,n.assignedAt);return f.jsxs("div",{className:I.timelineRow,children:[f.jsx("span",{className:I.timelineKey,children:"Assigned"}),f.jsx("span",{className:I.timelineValue,children:zr(n.assignedAt)}),_!==void 0&&f.jsx("span",{className:I.timelineDelta,children:_})]})})(),n.startedAt&&(()=>{const _=of(n.assignedAt??n.createdAt,n.startedAt);return f.jsxs("div",{className:I.timelineRow,children:[f.jsx("span",{className:I.timelineKey,children:"Started"}),f.jsx("span",{className:I.timelineValue,children:zr(n.startedAt)}),_!==void 0&&f.jsx("span",{className:I.timelineDelta,children:_})]})})(),n.completedAt&&(()=>{const _=of(n.startedAt,n.completedAt);return f.jsxs("div",{className:I.timelineRow,children:[f.jsx("span",{className:I.timelineKey,children:"Completed"}),f.jsx("span",{className:I.timelineValue,children:zr(n.completedAt)}),_!==void 0&&f.jsx("span",{className:I.timelineDelta,children:_})]})})(),!n.createdAt&&!n.assignedAt&&!n.startedAt&&!n.completedAt&&f.jsx("div",{className:I.overviewMuted,children:"No timing data"})]})]}),n.reviewNotes&&f.jsxs("div",{className:I.overviewSection,children:[f.jsx("div",{className:I.overviewLabel,children:"Review Notes"}),f.jsx("div",{className:I.reviewNotes,children:n.reviewNotes})]})]})}function N6({task:n,sessionId:a,isBlocked:i,onStart:l,onResume:r,onStop:c,onPause:d,onDelete:p,onEdit:m}){if(n.status==="not_started")return i?f.jsxs("div",{className:I.headerActions,children:[f.jsx("button",{onClick:m,className:I.btnGhost,children:"Edit"}),f.jsx("button",{onClick:p,className:I.btnDanger,children:"Delete"})]}):f.jsxs("div",{className:I.headerActions,children:[f.jsx("button",{onClick:l,className:I.btnPrimary,children:"Start"}),f.jsx("button",{onClick:m,className:I.btnGhost,children:"Edit"}),f.jsx("button",{onClick:p,className:I.btnDanger,children:"Delete"})]});if(n.status==="working")return f.jsxs("div",{className:I.headerActions,children:[f.jsx("button",{onClick:c,className:I.btnDanger,children:"Stop"}),f.jsx("button",{onClick:d,disabled:!a,className:I.btnGhost,children:"Pause"})]});if(n.status==="paused")return f.jsxs("div",{className:I.headerActions,children:[f.jsx("button",{onClick:c,className:I.btnPrimary,children:"Stop"}),f.jsx("button",{onClick:r,className:I.btnGhost,children:"Resume"}),f.jsx("button",{onClick:p,className:I.btnDanger,children:"Delete"})]});if(n.status==="complete")return f.jsx("div",{className:I.headerActions,children:f.jsx("button",{onClick:p,className:I.btnDanger,children:"Delete"})});if(n.status==="failed")return f.jsxs("div",{className:I.headerActions,children:[f.jsx("button",{onClick:l,className:I.btnPrimary,children:"Retry"}),f.jsx("button",{onClick:p,className:I.btnDanger,children:"Delete"})]})}function j6({taskSessions:n,selectedSessionId:a,onSelect:i}){if(!(n.length<2))return f.jsxs("div",{className:I.attemptSelector,"data-testid":"attempt-selector",children:[f.jsx("span",{className:I.attemptLabel,children:"Attempts:"}),n.map((l,r)=>{const c=l.id===a,d=l.status==="completed"?"✓":l.status==="failed"?"✗":l.status==="running"||l.status==="idle"?"●":"";return f.jsxs("button",{className:`${I.attemptButton} ${c?I.attemptActive:""}`,onClick:()=>i(l.id),title:`Attempt #${r+1} — ${l.status}`,"aria-label":`Attempt #${r+1}, ${l.status}`,"aria-pressed":c,"data-testid":`attempt-${r+1}`,children:["#",r+1,d&&f.jsx("span",{className:I.attemptStatus,children:d})]},l.id)})]})}function lf(){const{taskId:n}=cc(),a=en(),i=hn(),{events:l,eventsDropped:r,tasks:c,environments:d,loadSessionEvents:p,loadFindings:m,kill:g,startTask:y,stopTask:v,resumeTask:_,deleteTask:C,workspaces:E,taskSessions:k,loadTaskSessions:A}=Rt(),S=x.useRef(void 0),N=x.useRef(void 0),D=x.useRef(void 0),H=x.useRef(void 0),O=x.useRef(void 0),$=a.pathname.endsWith("/stream")?"stream":a.pathname.endsWith("/findings")?"findings":"overview",[R,L]=x.useState($),[G,ee]=x.useState(!1),[te,ne]=x.useState(void 0),[ie,he]=x.useState(""),oe=x.useRef($);$!==oe.current&&(oe.current=$,$!==R&&L($));const j=c.find(xe=>xe.id===n),Z=(j==null?void 0:j.workspaceId)||void 0,K=E.find(xe=>xe.id===Z);x.useEffect(()=>{if(ie===""){if(K!=null&&K.environmentId)he(K.environmentId);else if(d.length>0){const xe=d.find(J=>J.status==="connected");he((xe==null?void 0:xe.id)??d[0].id)}}},[ie,K==null?void 0:K.environmentId,d]);const de=j?k[j.id]??[]:[];let Y;te&&de.some(xe=>xe.id===te)?Y=te:Y=(j==null?void 0:j.latestSessionId)||void 0;const je=()=>{ee(!0)},Re=()=>{j&&(C(j.id),ee(!1),i(j.workspaceId?Ii(j.workspaceId):"/",{replace:!0}))};if((j==null?void 0:j.id)!==N.current&&(N.current=j==null?void 0:j.id,te!==void 0&&ne(void 0),ie!==""&&he("")),x.useEffect(()=>{if(!(j!=null&&j.id))return;const xe=j.id!==H.current,J=j.latestSessionId!==O.current;(xe||J)&&(H.current=j.id,O.current=j.latestSessionId,A(j.id))},[j==null?void 0:j.id,j==null?void 0:j.latestSessionId,A]),(j==null?void 0:j.status)!==D.current){const xe=D.current===void 0;D.current=j==null?void 0:j.status;const J=(j==null?void 0:j.status)==="not_started"?"overview":(j==null?void 0:j.status)==="working"||(j==null?void 0:j.status)==="paused"?"stream":(j==null?void 0:j.status)==="complete"?"findings":void 0;J&&J!==R&&!(xe&&$!=="overview")&&L(J)}const Te=x.useMemo(()=>new Map(c.map(xe=>[xe.id,xe])),[c]),st=x.useMemo(()=>{const xe=Y?l.filter(J=>J.sessionId===Y):[];return Ih(Lh(xe))},[l,Y]),kt=j?j.dependsOn.some(xe=>{const J=Te.get(xe);return J!==void 0&&J.status!=="complete"}):!1,wt=x.useMemo(()=>SB(n,E,Te),[n,E,Te]);x.useEffect(()=>{Y&&Y!==S.current&&(S.current=Y,p(Y))},[Y,p]),x.useEffect(()=>{R==="findings"&&Z&&m(Z)},[R,Z,m]);const Le=xe=>{L(xe),i(Na(n,xe==="overview"?void 0:xe))};return f.jsxs("div",{className:I.panelContainer,children:[f.jsx(qi,{segments:wt}),f.jsxs("div",{className:I.header,children:[f.jsxs("span",{className:I.headerTitle,children:[f.jsx("span",{"data-testid":"task-title",children:(j==null?void 0:j.title)||n}),j&&f.jsx("span",{className:I.taskStatusBadge,"data-testid":"task-status",children:j.status}),(j==null?void 0:j.branch)&&f.jsx("span",{className:I.taskBranch,children:j.branch}),kt&&f.jsx("span",{className:I.taskBlockedBadge,children:"blocked"})]}),j&&f.jsx(N6,{task:j,sessionId:Y,isBlocked:kt,onStart:()=>y(j.id,void 0,ie),onResume:()=>_(j.id),onStop:()=>v(j.id),onPause:()=>Y&&g(Y),onDelete:je,onEdit:()=>i(gC(j.id))})]}),f.jsxs("div",{className:I.tabBar,role:"tablist","aria-label":"Task view",children:[f.jsx("button",{role:"tab","aria-selected":R==="overview",className:`${I.tab} ${R==="overview"?I.active:""}`,onClick:()=>Le("overview"),children:"Overview"}),f.jsx("button",{role:"tab","aria-selected":R==="stream",className:`${I.tab} ${R==="stream"?I.active:""}`,onClick:()=>Le("stream"),children:"Stream"}),f.jsx("button",{role:"tab","aria-selected":R==="findings",className:`${I.tab} ${R==="findings"?I.active:""}`,onClick:()=>Le("findings"),children:"Findings"})]}),f.jsxs(Vn,{mode:"wait",children:[R==="overview"&&f.jsx(Et.div,{initial:{opacity:0,y:4},animate:{opacity:1,y:0},exit:{opacity:0,y:-4},transition:{duration:.15},className:I.overviewContent,"data-testid":"task-overview",children:j?f.jsx(A6,{task:j,tasksById:Te,environments:d,workspaces:E,taskSessions:de,selectedEnvId:ie}):f.jsx("div",{className:I.waitingMessage,children:"No additional details"})},"overview"),R==="stream"&&f.jsxs(Et.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:[f.jsx(j6,{taskSessions:de,selectedSessionId:Y,onSelect:xe=>ne(xe)}),f.jsx(Oh,{events:st,eventsDropped:r,emptyState:!Y&&j?f.jsxs("div",{className:I.emptyCta,children:[f.jsx("button",{className:I.ctaButton,onClick:()=>y(j.id,void 0,ie),children:"Start Task"}),f.jsx("div",{className:I.ctaDescription,children:"Click to begin agent execution"})]}):Y&&st.length===0?f.jsx("div",{className:I.waitingMessage,children:"Waiting for events..."}):void 0})]},"stream"),R==="findings"&&f.jsx(Et.div,{initial:{opacity:0,y:4},animate:{opacity:1,y:0},exit:{opacity:0,y:-4},transition:{duration:.15},className:I.tabContent,children:Z?f.jsx(k6,{workspaceId:Z}):f.jsx("div",{className:I.noContext,children:"Navigate to a task within a workspace to view findings"})},"findings")]}),j&&f.jsx(yc,{isOpen:G,title:"Delete Task?",description:`"${j.title}" will be permanently removed.`,onConfirm:Re,onCancel:()=>ee(!1)})]})}function D6(){const n=bB();return f.jsxs("div",{className:I.panelContainer,children:[f.jsx(qi,{segments:n}),f.jsx("div",{className:I.emptyState,children:"Configure the new environment below"})]})}const M6="_layout_11u79_1",R6="_content_11u79_8",B6="_tabPanel_11u79_14",rf={layout:M6,content:R6,tabPanel:B6},O6={environments:"Environments",credentials:"Credentials",personas:"Personas",appearance:"Appearance",about:"About"};function L6(){const a=en().pathname.replace(/^\/settings\/?/,"").split("/")[0],i=O6[a],l=yB(i);return f.jsxs("div",{className:rf.layout,children:[f.jsx(qi,{segments:l}),f.jsx("div",{className:rf.content,children:f.jsx("div",{className:rf.tabPanel,children:f.jsx(tb,{})},a)})]})}const I6="_nav_13n0b_1",U6="_tab_13n0b_44",z6="_tabIcon_13n0b_82",V6="_tabActive_13n0b_88",Vr={nav:I6,tab:U6,tabIcon:z6,tabActive:V6},Ea=[{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 H6(){var d;const n=en(),a=hn(),i=x.useRef(null),l=((d=Ea.find(p=>n.pathname===`${Is}/${p.path}`))==null?void 0:d.path)??Ea[0].path,r=x.useCallback(p=>{a(`${Is}/${p}`)},[a]),c=x.useCallback(p=>{var C,E;const m=(C=i.current)==null?void 0:C.querySelectorAll('[role="tab"]');if(!m)return;const g=Array.from(m).findIndex(k=>k===document.activeElement),y=g>=0?g:Ea.findIndex(k=>k.path===l);let v=y;if(p.key==="ArrowDown")p.preventDefault(),v=(y+1)%Ea.length;else if(p.key==="ArrowUp")p.preventDefault(),v=(y-1+Ea.length)%Ea.length;else if(p.key==="Home")p.preventDefault(),v=0;else if(p.key==="End")p.preventDefault(),v=Ea.length-1;else return;const _=Ea[v].path;a(`${Is}/${_}`),(E=m[v])==null||E.focus()},[l,a]);return f.jsx("nav",{className:Vr.nav,ref:i,role:"tablist","aria-orientation":"vertical","aria-label":"Settings",onKeyDown:c,children:Ea.map(p=>{const m=p.path===l;return f.jsxs("button",{role:"tab",type:"button","aria-selected":m,tabIndex:m?0:-1,className:`${Vr.tab} ${m?Vr.tabActive:""}`,onClick:()=>r(p.path),children:[f.jsx("span",{className:Vr.tabIcon,"aria-hidden":"true",children:p.icon}),p.label]},p.path)})})}const G6="_container_1nk8c_1",P6="_header_1nk8c_5",$6="_headerLabel_1nk8c_12",F6="_addButton_1nk8c_20",Y6="_envRow_1nk8c_55",q6="_targeted_1nk8c_69",K6="_expanded_1nk8c_72",Z6="_statusDot_1nk8c_76",X6="_pulse_1nk8c_79",Q6="_envName_1nk8c_83",W6="_envActions_1nk8c_87",J6="_idleLabel_1nk8c_94",e5="_newChatButton_1nk8c_99",t5="_envActionsRow_1nk8c_126",n5="_connectButton_1nk8c_134",a5="_stopButton_1nk8c_160",s5="_deleteButton_1nk8c_186",i5="_provisionMessage_1nk8c_213",o5="_errorMessage_1nk8c_220",l5="_sessionRow_1nk8c_227",r5="_selected_1nk8c_243",c5="_sessionDot_1nk8c_248",u5="_sessionSummaryRow_1nk8c_252",d5="_sessionExpandArrow_1nk8c_272",f5="_sessionSummaryText_1nk8c_283",h5="_sessionCountBadge_1nk8c_290",p5="_emptyCta_1nk8c_313",m5="_ctaDescription_1nk8c_326",g5="_ctaButton_1nk8c_332",Xe={container:G6,header:P6,headerLabel:$6,addButton:F6,envRow:Y6,targeted:q6,expanded:K6,statusDot:Z6,pulse:X6,envName:Q6,envActions:W6,idleLabel:J6,newChatButton:e5,envActionsRow:t5,connectButton:n5,stopButton:a5,deleteButton:s5,provisionMessage:i5,errorMessage:o5,sessionRow:l5,selected:r5,sessionDot:c5,sessionSummaryRow:u5,sessionExpandArrow:d5,sessionSummaryText:f5,sessionCountBadge:h5,emptyCta:p5,ctaDescription:m5,ctaButton:g5},v5={connected:"var(--accent-green)",sleeping:"var(--accent-yellow)",error:"var(--accent-red)",disconnected:"var(--text-tertiary)",connecting:"var(--accent-blue)"},y5={running:"running",idle:"awaiting input",failed:"failed",interrupted:"interrupted",completed:"completed"},z0=["running","idle","failed","interrupted","completed"],b5=.2;function x5(n){const a={};for(const c of n)a[c.status]=(a[c.status]||0)+1;const i=z0.filter(c=>a[c]>0).map(c=>`${a[c]} ${y5[c]||c}`),l=new Set(z0),r=Object.keys(a).filter(c=>!l.has(c)).sort().map(c=>`${a[c]} ${c}`);return[...i,...r].join(", ")}function _5({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 f.jsx("span",{className:Xe.sessionDot,style:{color:a},children:"●"})}function S5({env:n,envSessions:a,selectedSessionId:i,isNewChatTarget:l,expanded:r,onToggleExpand:c,sessionsExpanded:d,onToggleSessionsExpand:p,provisionProgress:m,onProvision:g,onStop:y,onRemove:v,navigate:_}){const[C,E]=x.useState(!1),k=v5[n.status]||"var(--text-tertiary)",A=n.status==="connected",S=n.status==="connecting",N=n.status==="disconnected"||n.status==="error";return f.jsxs("div",{children:[f.jsx(yc,{isOpen:C,title:"Delete Environment?",description:`"${n.displayName||n.id}" will be permanently removed. This destroys the workspace and removes all data.`,onConfirm:()=>{v(n.id),E(!1)},onCancel:()=>E(!1)}),f.jsxs("div",{className:`${Xe.envRow} ${l?Xe.targeted:""} ${r?Xe.expanded:""}`,"data-testid":"env-row",onClick:c,children:[f.jsx("span",{className:`${Xe.statusDot} ${A?Xe.pulse:""}`,style:{color:k},children:"●"}),f.jsx("span",{className:Xe.envName,title:n.displayName||n.id,children:n.displayName||n.id}),f.jsxs("span",{className:Xe.envActions,children:[a.length===0&&!l&&!r&&f.jsx("span",{className:Xe.idleLabel,children:"(idle)"}),A&&f.jsx("button",{onClick:D=>{D.stopPropagation(),_(ob(n.id))},title:"New chat",className:Xe.newChatButton,children:"+"})]})]}),r&&f.jsxs("div",{className:Xe.envActionsRow,children:[S&&m&&f.jsx("span",{className:Xe.provisionMessage,children:m.message}),n.status==="error"&&(m==null?void 0:m.stage)==="error"&&f.jsx("span",{className:Xe.errorMessage,children:m.message}),N&&f.jsx("button",{onClick:D=>{D.stopPropagation(),g(n.id)},className:Xe.connectButton,children:n.status==="error"?"Retry":"Connect"}),A&&f.jsx("button",{onClick:D=>{D.stopPropagation(),y(n.id)},className:Xe.stopButton,children:"Stop"}),!S&&f.jsx("button",{onClick:D=>{D.stopPropagation(),E(!0)},className:Xe.deleteButton,children:"Delete"})]}),a.length>0&&f.jsxs(f.Fragment,{children:[f.jsxs("div",{className:Xe.sessionSummaryRow,"data-testid":"session-summary-row",role:"button",tabIndex:0,"aria-expanded":d,"aria-label":d?"Collapse sessions":"Expand sessions",onClick:p,onKeyDown:D=>{(D.key==="Enter"||D.key===" ")&&(D.preventDefault(),p())},children:[f.jsx("span",{className:`${Xe.sessionExpandArrow} ${d?Xe.expanded:""}`,children:"▸"}),f.jsx("span",{className:Xe.sessionSummaryText,children:x5(a)}),f.jsx("span",{className:Xe.sessionCountBadge,children:a.length})]}),f.jsx(Vn,{children:d&&f.jsx(Et.div,{initial:{height:0,opacity:0},animate:{height:"auto",opacity:1},exit:{height:0,opacity:0},transition:{duration:b5,ease:"easeInOut"},style:{overflow:"hidden"},children:a.map(D=>f.jsxs("div",{onClick:H=>{H.stopPropagation(),_(Xf(D.id))},className:`${Xe.sessionRow} ${i===D.id?Xe.selected:""}`,title:D.prompt,"data-testid":"session-row",children:[f.jsx(_5,{status:D.status})," ",D.prompt.length>24?D.prompt.slice(0,24)+"...":D.prompt]},D.id))})})]})]})}function T5(){const{environments:n,sessions:a,provisionStatus:i,provisionEnvironment:l,stopEnvironment:r,removeEnvironment:c}=Rt(),d=hn(),[p,m]=x.useState(null),[g,y]=x.useState(new Set),v=Zt("/sessions/:sessionId"),_=Zt("/sessions/new"),C=(v==null?void 0:v.params.sessionId)!=="new"?v==null?void 0:v.params.sessionId:void 0,[E]=Zf(),k=_?E.get("env")??void 0:void 0;return f.jsxs("div",{className:Xe.container,children:[f.jsxs("div",{className:Xe.header,children:[f.jsx("span",{className:Xe.headerLabel,children:"Environments"}),f.jsx("button",{className:Xe.addButton,onClick:()=>d(Zv),title:"Add environment",children:"+ Add Environment"})]}),n.length===0&&f.jsxs("div",{className:Xe.emptyCta,children:[f.jsx("button",{className:Xe.ctaButton,onClick:()=>d(Zv),children:"Add Environment"}),f.jsx("div",{className:Xe.ctaDescription,children:"Connect an environment to run agents"})]}),n.map(A=>{const S=a.filter(N=>N.environmentId===A.id);return f.jsx(S5,{env:A,envSessions:S,selectedSessionId:C,isNewChatTarget:k===A.id,expanded:p===A.id,onToggleExpand:()=>m(p===A.id?null:A.id),sessionsExpanded:g.has(A.id),onToggleSessionsExpand:()=>{y(N=>{const D=new Set(N);return D.has(A.id)?D.delete(A.id):D.add(A.id),D})},provisionProgress:i[A.id],onProvision:l,onStop:r,onRemove:c,navigate:d},A.id)})]})}function C5(){return f.jsx(T5,{})}const E5="_section_1ingb_14",k5="_sectionTitle_1ingb_26",w5="_sectionDescription_1ingb_35",A5="_tokenList_1ingb_48",N5="_tokenRow_1ingb_55",j5="_tokenBadge_1ingb_68",D5="_tokenName_1ingb_83",M5="_tokenTarget_1ingb_90",R5="_deleteButton_1ingb_99",B5="_addForm_1ingb_113",O5="_formRow_1ingb_119",L5="_input_1ingb_125",I5="_select_1ingb_155",U5="_addButton_1ingb_187",z5="_emptyStateInfo_1ingb_221",V5="_themeOptions_1ingb_229",H5="_themeOption_1ingb_229",G5="_themeOptionSelected_1ingb_254",P5="_themeOptionHeader_1ingb_259",$5="_themeOptionLabel_1ingb_266",F5="_themeOptionDesc_1ingb_273",Y5="_variantToggle_1ingb_279",q5="_variantButton_1ingb_286",K5="_variantActive_1ingb_305",Z5="_themeSwatches_1ingb_311",X5="_themeSwatch_1ingb_311",Q5="_systemToggle_1ingb_325",W5="_systemToggleHint_1ingb_341",J5="_themeActive_1ingb_348",e4="_aboutGrid_1ingb_354",t4="_aboutItem_1ingb_360",n4="_aboutLabel_1ingb_373",a4="_aboutValue_1ingb_379",s4="_aboutDot_1ingb_387",i4="_aboutDotConnected_1ingb_394",o4="_aboutDotDisconnected_1ingb_398",ce={section:E5,sectionTitle:k5,sectionDescription:w5,tokenList:A5,tokenRow:N5,tokenBadge:j5,tokenName:D5,tokenTarget:M5,deleteButton:R5,addForm:B5,formRow:O5,input:L5,select:I5,addButton:U5,emptyStateInfo:z5,themeOptions:V5,themeOption:H5,themeOptionSelected:G5,themeOptionHeader:P5,themeOptionLabel:$5,themeOptionDesc:F5,variantToggle:Y5,variantButton:q5,variantActive:K5,themeSwatches:Z5,themeSwatch:X5,systemToggle:Q5,systemToggleHint:W5,themeActive:J5,aboutGrid:e4,aboutItem:t4,aboutLabel:n4,aboutValue:a4,aboutDot:s4,aboutDotConnected:i4,aboutDotDisconnected:o4},l4=[{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 r4(){const{credentialProviders:n,updateCredentialProviders:a}=Rt(),i=(l,r)=>{const c={...n};l==="claude"?c.claude=r:c[l]=r,a(c)};return f.jsxs("section",{className:ce.section,children:[f.jsx("h3",{className:ce.sectionTitle,children:"Credential Providers"}),f.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."}),f.jsx("div",{className:ce.tokenList,children:l4.map(l=>f.jsxs("div",{className:ce.tokenRow,children:[f.jsx("span",{className:ce.tokenName,children:l.label}),f.jsx("span",{className:ce.tokenTarget,children:l.description}),f.jsx("select",{className:ce.select,value:n[l.key],onChange:r=>i(l.key,r.target.value),children:l.options.map(r=>f.jsx("option",{value:r.value,children:r.label},r.value))})]},l.key))})]})}const c4=[{value:"env_var",label:"Environment Variable"},{value:"file",label:"File"}];function u4(){const{tokens:n,setToken:a,deleteToken:i}=Rt(),{showToast:l}=hl(),[r,c]=x.useState(""),[d,p]=x.useState(""),[m,g]=x.useState("env_var"),[y,v]=x.useState(""),[_,C]=x.useState(null),E=S=>{if(S.preventDefault(),!r||!d)return;const N=m==="env_var"?y||r.toUpperCase()+"_TOKEN":"";a(r,d,m,N,m==="file"?y:""),l("Token saved successfully","success"),c(""),p(""),v("")},k=S=>{C(S)},A=()=>{_&&(i(_),l("Token deleted","info")),C(null)};return f.jsxs(f.Fragment,{children:[f.jsx(yc,{isOpen:_!==null,title:"Delete Token?",description:_?`"${_}" will be permanently removed.`:void 0,onConfirm:A,onCancel:()=>C(null)}),f.jsxs("section",{className:ce.section,children:[f.jsx("h3",{className:ce.sectionTitle,children:"Tokens"}),f.jsx("p",{className:ce.sectionDescription,children:"API tokens are auto-pushed to environments when set or updated. Values are write-only."}),n.length===0?f.jsx("div",{className:ce.emptyStateInfo,children:"Add your first API token to enable service integrations."}):f.jsx("div",{className:ce.tokenList,children:n.map(S=>f.jsxs("div",{className:ce.tokenRow,children:[f.jsx("span",{className:ce.tokenBadge,children:S.tokenType}),f.jsx("span",{className:ce.tokenName,children:S.name}),f.jsx("span",{className:ce.tokenTarget,children:S.tokenType==="env_var"?S.envVar:S.filePath}),f.jsx("button",{className:ce.deleteButton,onClick:()=>k(S.name),title:`Delete ${S.name}`,children:"×"})]},S.name))}),f.jsxs("form",{className:ce.addForm,onSubmit:E,children:[f.jsxs("div",{className:ce.formRow,children:[f.jsx("input",{className:ce.input,type:"text",placeholder:"Token name",value:r,onChange:S=>c(S.target.value)}),f.jsx("input",{className:ce.input,type:"password",placeholder:"Value",value:d,onChange:S=>p(S.target.value)})]}),f.jsxs("div",{className:ce.formRow,children:[f.jsx("select",{className:ce.select,value:m,onChange:S=>g(S.target.value),children:c4.map(S=>f.jsx("option",{value:S.value,children:S.label},S.value))}),f.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:S=>v(S.target.value)}),f.jsx("button",{className:ce.addButton,type:"submit",children:"Add Token"})]})]})]})]})}function d4(){return f.jsxs(f.Fragment,{children:[f.jsx(r4,{}),f.jsx(u4,{})]})}const f4="_container_xb7ms_1",h4="_header_xb7ms_7",p4="_form_xb7ms_19",m4="_formActions_xb7ms_87",g4="_list_xb7ms_93",v4="_card_xb7ms_99",y4="_active_xb7ms_109",b4="_cardHeader_xb7ms_113",x4="_cardTitle_xb7ms_123",_4="_defaultBadge_xb7ms_129",S4="_cardActions_xb7ms_143",T4="_description_xb7ms_148",C4="_meta_xb7ms_154",E4="_promptDetails_xb7ms_171",k4="_promptText_xb7ms_183",w4="_empty_xb7ms_200",A4="_btnPrimary_xb7ms_206",N4="_btnSecondary_xb7ms_240",j4="_btnSmall_xb7ms_267",D4="_btnDanger_xb7ms_293",M4="_typeToggle_xb7ms_336",R4="_typeBadge_xb7ms_350",B4="_scriptEditor_xb7ms_364",O4="_optional_xb7ms_371",Ke={container:f4,header:h4,form:p4,formActions:m4,list:g4,card:v4,active:y4,cardHeader:b4,cardTitle:x4,defaultBadge:_4,cardActions:S4,description:T4,meta:C4,promptDetails:E4,promptText:k4,empty:w4,btnPrimary:A4,btnSecondary:N4,btnSmall:j4,btnDanger:D4,typeToggle:M4,typeBadge:R4,scriptEditor:B4,optional:O4};function L4(){const{personas:n,createPersona:a,updatePersona:i,deletePersona:l,appDefaultPersonaId:r,setAppDefaultPersonaId:c}=Rt(),[d,p]=x.useState(null),[m,g]=x.useState(!1),[y,v]=x.useState(null),[_,C]=x.useState(""),[E,k]=x.useState(""),[A,S]=x.useState(""),[N,D]=x.useState("claude-code"),[H,O]=x.useState("sonnet"),[$,R]=x.useState(0),[L,G]=x.useState("agent"),[ee,te]=x.useState(""),ne=()=>{C(""),k(""),S(""),D("claude-code"),O("sonnet"),R(0),G("agent"),te("")},ie=()=>{ne(),p(null),g(!0)},he=Y=>{C(Y.name),k(Y.description),S(Y.systemPrompt);const je=Y.type==="script"?"script":"agent";D(je==="script"?Y.runtime||"genaiscript":Y.runtime),O(Y.model),R(Y.maxTurns),G(je),te(Y.script||""),p(Y),g(!1)},oe=Y=>{G(Y),Y==="script"?D("genaiscript"):N==="genaiscript"&&D("claude-code")},j=Y=>{if(Y.preventDefault(),!!_.trim()){if(L==="script"){if(!ee.trim())return}else if(!A.trim()||!N||!H)return;d?(i(d.id,_,E,A,N,H,$,L,ee),p(null)):(a(_,E,A,N,H,$,L,ee),g(!1)),ne()}},Z=Y=>{l(Y),v(null),(d==null?void 0:d.id)===Y&&(p(null),ne())},K=()=>{p(null),g(!1),ne()},de=()=>f.jsxs("form",{onSubmit:j,className:Ke.form,children:[f.jsx("h3",{children:d?"Edit Persona":"Create Persona"}),f.jsxs("div",{className:Ke.typeToggle,"data-testid":"persona-type-toggle",children:[f.jsxs("label",{children:[f.jsx("input",{type:"radio",name:"personaType",value:"agent",checked:L==="agent",onChange:()=>oe("agent")}),"Agent"]}),f.jsxs("label",{children:[f.jsx("input",{type:"radio",name:"personaType",value:"script",checked:L==="script",onChange:()=>oe("script")}),"Script"]})]}),f.jsxs("label",{children:["Name",f.jsx("input",{type:"text",value:_,onChange:Y=>C(Y.target.value),placeholder:L==="script"?"e.g. Nightly Report":"e.g. Frontend Engineer",required:!0})]}),f.jsxs("label",{children:["Description",f.jsx("input",{type:"text",value:E,onChange:Y=>k(Y.target.value),placeholder:"Brief description..."})]}),f.jsxs("label",{children:["Runtime",f.jsx("select",{value:N,onChange:Y=>D(Y.target.value),"data-testid":"persona-runtime-select",children:L==="script"?f.jsx("option",{value:"genaiscript",children:"genaiscript"}):f.jsxs(f.Fragment,{children:[f.jsx("option",{value:"claude-code",children:"claude-code"}),f.jsx("option",{value:"codex",children:"codex"}),f.jsx("option",{value:"copilot",children:"copilot"}),f.jsx("option",{value:"stub",children:"stub"}),f.jsx("option",{value:"claude-code-acp",children:"claude-code-acp (experimental)"}),f.jsx("option",{value:"codex-acp",children:"codex-acp (experimental)"}),f.jsx("option",{value:"copilot-acp",children:"copilot-acp (experimental)"})]})})]}),L==="agent"&&f.jsxs(f.Fragment,{children:[f.jsxs("label",{children:["Model",f.jsx("input",{type:"text",value:H,onChange:Y=>O(Y.target.value),placeholder:"e.g. sonnet"})]}),f.jsxs("label",{children:["Max Turns",f.jsx("input",{type:"number",value:$,onChange:Y=>R(parseInt(Y.target.value,10)||0),min:0})]}),f.jsxs("label",{children:["System Prompt",f.jsx("textarea",{value:A,onChange:Y=>S(Y.target.value),placeholder:"You are a senior frontend engineer...",rows:10,required:!0})]})]}),L==="script"&&f.jsxs(f.Fragment,{children:[f.jsxs("label",{children:["Model ",f.jsx("span",{className:Ke.optional,children:"(optional)"}),f.jsx("input",{type:"text",value:H,onChange:Y=>O(Y.target.value),placeholder:"e.g. sonnet (leave empty for script-only)"})]}),f.jsxs("label",{children:["System Prompt ",f.jsx("span",{className:Ke.optional,children:"(optional)"}),f.jsx("textarea",{value:A,onChange:Y=>S(Y.target.value),placeholder:"Optional context for the script...",rows:4})]}),f.jsxs("label",{children:["Script",f.jsx("textarea",{value:ee,onChange:Y=>te(Y.target.value),placeholder:`script({ model: "openai:gpt-4o" });
|
|
94
|
-
|
|
95
|
-
const grackle = await host.mcpServer({
|
|
96
|
-
id: "grackle",
|
|
97
|
-
url: env.vars.GRACKLE_MCP_URL,
|
|
98
|
-
});
|
|
99
|
-
|
|
100
|
-
$\`Summarize the current tasks.\`;`,rows:20,className:Ke.scriptEditor,required:!0,"data-testid":"persona-script-editor"})]})]}),f.jsxs("div",{className:Ke.formActions,children:[f.jsx("button",{type:"submit",className:Ke.btnPrimary,children:d?"Save":"Create"}),f.jsx("button",{type:"button",onClick:K,className:Ke.btnSecondary,children:"Cancel"})]})]});return f.jsxs("div",{className:Ke.container,children:[f.jsxs("div",{className:Ke.header,children:[f.jsx("h2",{children:"Personas"}),f.jsx("button",{onClick:ie,className:Ke.btnPrimary,children:"+ New Persona"})]}),(m||d)&&de(),n.length===0&&!m?f.jsx("p",{className:Ke.empty,children:"No personas yet. Create one to get started."}):f.jsx("div",{className:Ke.list,children:n.map(Y=>{const je=r===Y.id,Re=Y.type==="script";return f.jsxs("div",{className:`${Ke.card} ${(d==null?void 0:d.id)===Y.id?Ke.active:""}`,"data-testid":`persona-card-${Y.id}`,children:[f.jsxs("div",{className:Ke.cardHeader,children:[f.jsxs("span",{className:Ke.cardTitle,children:[f.jsx("strong",{children:Y.name}),f.jsx("span",{className:Ke.typeBadge,"data-testid":`persona-type-badge-${Y.id}`,children:Re?"Script":"Agent"}),je&&f.jsx("span",{className:Ke.defaultBadge,"data-testid":`persona-default-badge-${Y.id}`,children:"App Default"})]}),f.jsxs("div",{className:Ke.cardActions,children:[!je&&f.jsx("button",{onClick:()=>c(Y.id),className:Ke.btnSmall,"data-testid":`persona-set-default-${Y.id}`,title:"Set as app default persona",children:"Set Default"}),f.jsx("button",{onClick:()=>he(Y),className:Ke.btnSmall,children:"Edit"}),y===Y.id?f.jsxs(f.Fragment,{children:[f.jsx("button",{onClick:()=>Z(Y.id),className:Ke.btnDanger,children:"Confirm"}),f.jsx("button",{onClick:()=>v(null),className:Ke.btnSmall,children:"Cancel"})]}):f.jsx("button",{onClick:()=>v(Y.id),className:Ke.btnSmall,children:"Delete"})]})]}),Y.description&&f.jsx("p",{className:Ke.description,children:Y.description}),f.jsxs("div",{className:Ke.meta,children:[Y.runtime&&f.jsxs("span",{children:["Runtime: ",Y.runtime]}),Y.model&&f.jsxs("span",{children:["Model: ",Y.model]}),Y.maxTurns>0&&f.jsxs("span",{children:["Max turns: ",Y.maxTurns]})]}),Re?f.jsxs("details",{className:Ke.promptDetails,children:[f.jsx("summary",{children:"Script"}),f.jsx("pre",{className:Ke.promptText,children:Y.script})]}):f.jsxs("details",{className:Ke.promptDetails,children:[f.jsx("summary",{children:"System Prompt"}),f.jsx("pre",{className:Ke.promptText,children:Y.systemPrompt})]})]},Y.id)})})]})}function I4(){return f.jsx(L4,{})}function U4(){const{themeId:n,resolvedThemeId:a,setTheme:i,preferSystem:l,setPreferSystem:r}=hb();return f.jsxs("section",{className:ce.section,children:[f.jsx("h3",{className:ce.sectionTitle,children:"Appearance"}),f.jsx("p",{className:ce.sectionDescription,children:"Choose how Grackle looks across the app."}),f.jsx("div",{className:ce.themeOptions,children:dc.filter(c=>!c.hidden).map(c=>{const d=!!(c.variantLightId&&c.variantDarkId),p=d?n===c.id||n===c.variantLightId||n===c.variantDarkId:n===c.id,m=d&&a===c.variantLightId;return f.jsxs("button",{type:"button",className:`${ce.themeOption} ${p?ce.themeOptionSelected:""}`,"aria-pressed":p,onClick:()=>i(c.id),children:[f.jsxs("span",{className:ce.themeOptionHeader,children:[f.jsxs("span",{children:[f.jsx("span",{className:ce.themeOptionLabel,children:c.label}),f.jsx("span",{className:ce.themeOptionDesc,children:c.description})]}),d&&f.jsxs("span",{className:ce.variantToggle,children:[f.jsx("span",{role:"button",tabIndex:0,className:`${ce.variantButton} ${p&&m?ce.variantActive:""}`,onClick:g=>{g.stopPropagation(),r(!1),i(c.variantLightId)},onKeyDown:g=>{(g.key==="Enter"||g.key===" ")&&(g.preventDefault(),g.stopPropagation(),r(!1),i(c.variantLightId))},"aria-label":"Light variant","aria-pressed":p&&m,children:"☼"}),f.jsx("span",{role:"button",tabIndex:0,className:`${ce.variantButton} ${p&&!m?ce.variantActive:""}`,onClick:g=>{g.stopPropagation(),r(!1),i(c.variantDarkId)},onKeyDown:g=>{(g.key==="Enter"||g.key===" ")&&(g.preventDefault(),g.stopPropagation(),r(!1),i(c.variantDarkId))},"aria-label":"Dark variant","aria-pressed":p&&!m,children:"☾"})]})]}),c.swatches&&f.jsx("span",{className:ce.themeSwatches,children:c.swatches.map((g,y)=>f.jsx("span",{className:ce.themeSwatch,style:{background:g}},y))})]},c.id)})}),f.jsxs("label",{className:ce.systemToggle,children:[f.jsx("input",{type:"checkbox",checked:l,onChange:c=>r(c.target.checked)}),f.jsx("span",{children:"Match system light/dark preference"})]}),f.jsx("p",{className:ce.systemToggleHint,children:"Automatically switches between light and dark variants when available."}),f.jsxs("p",{className:ce.themeActive,children:["Active theme: ",f.jsx("strong",{children:a})]})]})}function z4(){return f.jsx(U4,{})}function V4(){const{connected:n,environments:a,sessions:i}=Rt(),l=a.filter(d=>d.status==="connected").length,r=a.length,c=i.filter(d=>["running","idle"].includes(d.status)).length;return f.jsxs("section",{className:ce.section,"data-testid":"about-panel",children:[f.jsx("h3",{className:ce.sectionTitle,children:"About"}),f.jsx("p",{className:ce.sectionDescription,children:"Connection status and application information."}),f.jsxs("div",{className:ce.aboutGrid,children:[f.jsxs("div",{className:ce.aboutItem,children:[f.jsx("span",{className:ce.aboutLabel,children:"Connection"}),f.jsxs("span",{className:ce.aboutValue,children:[f.jsx("span",{className:`${ce.aboutDot} ${n?ce.aboutDotConnected:ce.aboutDotDisconnected}`}),n?"Connected":"Disconnected"]})]}),f.jsxs("div",{className:ce.aboutItem,children:[f.jsx("span",{className:ce.aboutLabel,children:"Environments"}),f.jsxs("span",{className:ce.aboutValue,children:[l,"/",r," connected"]})]}),f.jsxs("div",{className:ce.aboutItem,children:[f.jsx("span",{className:ce.aboutLabel,children:"Active Sessions"}),f.jsx("span",{className:ce.aboutValue,children:c})]}),f.jsxs("div",{className:ce.aboutItem,children:[f.jsx("span",{className:ce.aboutLabel,children:"Version"}),f.jsx("span",{className:ce.aboutValue,children:"0.52.0"})]})]})]})}function H4(){return f.jsx(V4,{})}const G4="_wizard_1260s_1",P4="_container_1260s_10",$4="_stepContent_1260s_19",F4="_logoArea_1260s_28",Y4="_logoImage_1260s_32",q4="_heading_1260s_41",K4="_tagline_1260s_49",Z4="_subtitle_1260s_56",X4="_featureList_1260s_64",Q4="_runtimeGrid_1260s_89",W4="_runtimeCard_1260s_101",J4="_runtimeName_1260s_133",e8="_runtimeDescription_1260s_139",t8="_buttonRow_1260s_144",n8="_primaryButton_1260s_151",a8="_ghostButton_1260s_185",s8="_dots_1260s_213",i8="_dot_1260s_213",ut={wizard:G4,container:P4,stepContent:$4,logoArea:F4,logoImage:Y4,heading:q4,tagline:K4,subtitle:Z4,featureList:X4,runtimeGrid:Q4,runtimeCard:W4,runtimeName:J4,runtimeDescription:e8,buttonRow:t8,primaryButton:n8,ghostButton:a8,dots:s8,dot:i8};function o8({onNext:n}){return f.jsxs("div",{className:ut.stepContent,"data-testid":"setup-welcome",children:[f.jsx("div",{className:ut.logoArea,children:f.jsx("img",{src:"/grackle-logo.png",alt:"Grackle",className:ut.logoImage})}),f.jsx("h1",{className:ut.heading,children:"Welcome to Grackle"}),f.jsx("p",{className:ut.tagline,children:"Multi-agent orchestration for software teams"}),f.jsx("button",{type:"button",className:ut.primaryButton,onClick:n,"data-testid":"setup-get-started",children:"Get Started"})]})}function l8({onNext:n,onBack:a}){return f.jsxs("div",{className:ut.stepContent,"data-testid":"setup-about",children:[f.jsx("h2",{className:ut.heading,children:"What is Grackle?"}),f.jsxs("ul",{className:ut.featureList,children:[f.jsx("li",{children:"Run Claude, Copilot, and Codex agents side by side"}),f.jsx("li",{children:"Provision and control dev environments — SSH, Codespaces, or local"}),f.jsx("li",{children:"Organize work into workspaces with agent-executable tasks"}),f.jsx("li",{children:"Customize agent behavior with personas, tools, and MCP servers"}),f.jsx("li",{children:"Live-stream agent sessions with full terminal replay"})]}),f.jsxs("div",{className:ut.buttonRow,children:[f.jsx("button",{type:"button",className:ut.ghostButton,onClick:a,children:"Back"}),f.jsx("button",{type:"button",className:ut.primaryButton,onClick:n,"data-testid":"setup-about-next",children:"Next"})]})]})}const r8=[{id:"claude-code",name:"Claude Code",description:"Anthropic's agentic coding tool"},{id:"copilot",name:"Copilot Coding Agent",description:"GitHub's AI pair programmer"},{id:"codex",name:"Codex CLI",description:"OpenAI's coding agent"}];function c8({currentRuntime:n,onFinish:a,onBack:i,finishDisabled:l}){const[r,c]=x.useState(n||"claude-code");return x.useEffect(()=>{n&&c(n)},[n]),f.jsxs("div",{className:ut.stepContent,"data-testid":"setup-runtime",children:[f.jsx("h2",{className:ut.heading,children:"Choose Your Runtime"}),f.jsx("p",{className:ut.subtitle,children:"Select the primary agent runtime for your workspace. You can change this later."}),f.jsx("div",{className:ut.runtimeGrid,children:r8.map(d=>f.jsxs("button",{type:"button",className:ut.runtimeCard,"data-selected":r===d.id,"aria-pressed":r===d.id,"data-testid":`runtime-card-${d.id}`,onClick:()=>c(d.id),children:[f.jsx("span",{className:ut.runtimeName,children:d.name}),f.jsx("span",{className:ut.runtimeDescription,children:d.description})]},d.id))}),f.jsxs("div",{className:ut.buttonRow,children:[f.jsx("button",{type:"button",className:ut.ghostButton,onClick:i,children:"Back"}),f.jsx("button",{type:"button",className:ut.primaryButton,onClick:()=>a(r),disabled:l,"data-testid":"setup-finish",children:"Finish"})]})]})}const u8=3,V0={"claude-code":"sonnet",copilot:"gpt-4o",codex:"o3"};function d8(){const{personas:n,updatePersona:a,completeOnboarding:i,onboardingCompleted:l}=Rt(),r=hn(),[c,d]=x.useState(0),p=n.find(g=>g.id==="claude-code"),m=x.useCallback(g=>{if(p&&g!==p.runtime){const v=V0[g]??"sonnet";a(p.id,void 0,void 0,void 0,g,v)}const y=n.find(v=>v.id===b0);if(y&&g!==y.runtime){const v=V0[g]??"sonnet";a(b0,void 0,void 0,void 0,g,v)}i(),r("/",{replace:!0})},[p,n,a,i,r]);return l===!0?f.jsx(Li,{to:"/",replace:!0}):f.jsx("div",{className:ut.wizard,"data-testid":"setup-wizard",children:f.jsxs("div",{className:ut.container,children:[f.jsx(Vn,{mode:"wait",children:f.jsxs(Et.div,{initial:{opacity:0,x:40},animate:{opacity:1,x:0},exit:{opacity:0,x:-40},transition:{duration:.2,ease:"easeInOut"},children:[c===0&&f.jsx(o8,{onNext:()=>d(1)}),c===1&&f.jsx(l8,{onNext:()=>d(2),onBack:()=>d(0)}),c===2&&f.jsx(c8,{currentRuntime:(p==null?void 0:p.runtime)??"claude-code",onFinish:m,onBack:()=>d(1),finishDisabled:!p})]},c)}),f.jsx("div",{className:ut.dots,children:Array.from({length:u8},(g,y)=>f.jsx("span",{className:ut.dot,"data-active":y===c},y))})]})})}const f8="_root_h353j_1",h8="_body_h353j_7",p8="_main_h353j_19",m8="_sidebarWrapper_h353j_26",g8="_overlay_h353j_56",Fo={root:f8,body:h8,main:p8,sidebarWrapper:m8,overlay:g8},v8=typeof window<"u"&&new URLSearchParams(window.location.search).has("mock");function y8(){const{lastSpawnedId:n,environments:a,connected:i,onboardingCompleted:l}=Rt(),{showToast:r}=hl();wM(a,r);const c=hn(),d=en(),p=d.pathname.startsWith(Is),[m,g]=x.useState(!1),y=x.useCallback(()=>g(v=>!v),[]);return x.useEffect(()=>{g(!1)},[d.pathname]),x.useEffect(()=>{if(!m)return;const v=_=>{_.key==="Escape"&&g(!1)};return document.addEventListener("keydown",v),()=>{document.removeEventListener("keydown",v)}},[m]),x.useEffect(()=>{n&&!d.pathname.startsWith("/tasks/")&&c(Xf(n),{replace:!0})},[n,c,d.pathname]),i&&l===!1?f.jsx(Li,{to:"/setup",replace:!0}):f.jsxs("div",{className:Fo.root,children:[f.jsx(vE,{onToggleSidebar:p?void 0:y,sidebarOpen:m}),f.jsxs("div",{className:Fo.body,children:[f.jsx("div",{className:Fo.sidebarWrapper,"data-sidebar-open":m,"data-settings":p,children:p?f.jsx(H6,{}):f.jsx(KD,{})}),m&&!p&&f.jsx("div",{className:Fo.overlay,"data-testid":"drawer-overlay",onClick:()=>g(!1)}),f.jsxs("div",{className:Fo.main,children:[f.jsx(tb,{}),f.jsx(hM,{})]})]}),f.jsx(kM,{})]})}function b8(){return f.jsxs(OT,{children:[f.jsx(gt,{path:"setup",element:f.jsx(d8,{})}),f.jsxs(gt,{element:f.jsx(y8,{}),children:[f.jsx(gt,{index:!0,element:f.jsx(R0,{})}),f.jsx(gt,{path:"chat",element:f.jsx(j3,{})}),f.jsx(gt,{path:"sessions/new",element:f.jsx(TB,{})}),f.jsx(gt,{path:"sessions/:sessionId",element:f.jsx(kB,{})}),f.jsx(gt,{path:"workspaces",element:f.jsx(R0,{})}),f.jsx(gt,{path:"workspaces/:workspaceId",element:f.jsx(FO,{})}),f.jsx(gt,{path:"tasks/new",element:f.jsx(h6,{})}),f.jsx(gt,{path:"tasks/:taskId",element:f.jsx(lf,{})}),f.jsx(gt,{path:"tasks/:taskId/stream",element:f.jsx(lf,{})}),f.jsx(gt,{path:"tasks/:taskId/findings",element:f.jsx(lf,{})}),f.jsx(gt,{path:"tasks/:taskId/edit",element:f.jsx(p6,{})}),f.jsx(gt,{path:"environments/new",element:f.jsx(D6,{})}),f.jsxs(gt,{path:"settings",element:f.jsx(L6,{}),children:[f.jsx(gt,{index:!0,element:f.jsx(Li,{to:"environments",replace:!0})}),f.jsx(gt,{path:"environments",element:f.jsx(C5,{})}),f.jsx(gt,{path:"credentials",element:f.jsx(d4,{})}),f.jsx(gt,{path:"tokens",element:f.jsx(Li,{to:"../credentials",replace:!0})}),f.jsx(gt,{path:"personas",element:f.jsx(I4,{})}),f.jsx(gt,{path:"appearance",element:f.jsx(z4,{})}),f.jsx(gt,{path:"about",element:f.jsx(H4,{})})]}),f.jsx(gt,{path:"*",element:f.jsx(Li,{to:"/",replace:!0})})]})]})}const x8=1e4;function _8(){const{onboardingCompleted:n}=Rt(),[a,i]=x.useState(!1);x.useEffect(()=>{if(n!==void 0)return;const r=setTimeout(()=>i(!0),x8);return()=>clearTimeout(r)},[n]);const l=n===void 0&&!a;return f.jsx(Vn,{mode:"wait",children:l?f.jsx(Et.div,{initial:{opacity:1},exit:{opacity:0},transition:{duration:.25},children:f.jsx(Gj,{})},"splash"):f.jsx(Et.div,{initial:{opacity:0},animate:{opacity:1},transition:{duration:.25},style:{minHeight:"100vh"},children:f.jsx(oC,{children:f.jsx(b8,{})})},"app")})}function S8(){const n=v8?tE:YC;return f.jsx(lE,{children:f.jsx(aE,{children:f.jsx(n,{children:f.jsx(_8,{})})})})}I1.createRoot(document.getElementById("root")).render(f.jsx(x.StrictMode,{children:f.jsx(S8,{})}));
|