@grackle-ai/web 0.26.0 → 0.28.0

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,80 +0,0 @@
1
- import{r as Mb,a as _,j as d,v as Rb,b as Ob,t as Fo,i as zb,f as Bb,M as fd,c as hd}from"./markdown-gcy1Jmzi.js";import{r as Ub,d as Hp,H as Gp,P as Ip,i as Vb,B as Lb,a as qb,C as Hb,M as Gb}from"./dagview-EHk2VaeR.js";(function(){const i=document.createElement("link").relList;if(i&&i.supports&&i.supports("modulepreload"))return;for(const u of document.querySelectorAll('link[rel="modulepreload"]'))o(u);new MutationObserver(u=>{for(const h of u)if(h.type==="childList")for(const f of h.addedNodes)f.tagName==="LINK"&&f.rel==="modulepreload"&&o(f)}).observe(document,{childList:!0,subtree:!0});function l(u){const h={};return u.integrity&&(h.integrity=u.integrity),u.referrerPolicy&&(h.referrerPolicy=u.referrerPolicy),u.crossOrigin==="use-credentials"?h.credentials="include":u.crossOrigin==="anonymous"?h.credentials="omit":h.credentials="same-origin",h}function o(u){if(u.ep)return;u.ep=!0;const h=l(u);fetch(u.href,h)}})();var ku={exports:{}},pl={},wu={exports:{}},Mu={};/**
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 Yp;function Ib(){return Yp||(Yp=1,(function(a){function i(B,Q){var lt=B.length;B.push(Q);t:for(;0<lt;){var At=lt-1>>>1,mt=B[At];if(0<u(mt,Q))B[At]=Q,B[lt]=mt,lt=At;else break t}}function l(B){return B.length===0?null:B[0]}function o(B){if(B.length===0)return null;var Q=B[0],lt=B.pop();if(lt!==Q){B[0]=lt;t:for(var At=0,mt=B.length,Qt=mt>>>1;At<Qt;){var yt=2*(At+1)-1,bt=B[yt],I=yt+1,ae=B[I];if(0>u(bt,lt))I<mt&&0>u(ae,bt)?(B[At]=ae,B[I]=lt,At=I):(B[At]=bt,B[yt]=lt,At=yt);else if(I<mt&&0>u(ae,lt))B[At]=ae,B[I]=lt,At=I;else break t}}return Q}function u(B,Q){var lt=B.sortIndex-Q.sortIndex;return lt!==0?lt:B.id-Q.id}if(a.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var h=performance;a.unstable_now=function(){return h.now()}}else{var f=Date,p=f.now();a.unstable_now=function(){return f.now()-p}}var g=[],v=[],b=1,S=null,x=3,E=!1,k=!1,q=!1,K=!1,z=typeof setTimeout=="function"?setTimeout:null,P=typeof clearTimeout=="function"?clearTimeout:null,Y=typeof setImmediate<"u"?setImmediate:null;function nt(B){for(var Q=l(v);Q!==null;){if(Q.callback===null)o(v);else if(Q.startTime<=B)o(v),Q.sortIndex=Q.expirationTime,i(g,Q);else break;Q=l(v)}}function X(B){if(q=!1,nt(B),!k)if(l(g)!==null)k=!0,V||(V=!0,zt());else{var Q=l(v);Q!==null&&wt(X,Q.startTime-B)}}var V=!1,et=-1,w=5,$=-1;function st(){return K?!0:!(a.unstable_now()-$<w)}function ht(){if(K=!1,V){var B=a.unstable_now();$=B;var Q=!0;try{t:{k=!1,q&&(q=!1,P(et),et=-1),E=!0;var lt=x;try{e:{for(nt(B),S=l(g);S!==null&&!(S.expirationTime>B&&st());){var At=S.callback;if(typeof At=="function"){S.callback=null,x=S.priorityLevel;var mt=At(S.expirationTime<=B);if(B=a.unstable_now(),typeof mt=="function"){S.callback=mt,nt(B),Q=!0;break e}S===l(g)&&o(g),nt(B)}else o(g);S=l(g)}if(S!==null)Q=!0;else{var Qt=l(v);Qt!==null&&wt(X,Qt.startTime-B),Q=!1}}break t}finally{S=null,x=lt,E=!1}Q=void 0}}finally{Q?zt():V=!1}}}var zt;if(typeof Y=="function")zt=function(){Y(ht)};else if(typeof MessageChannel<"u"){var tt=new MessageChannel,Ut=tt.port2;tt.port1.onmessage=ht,zt=function(){Ut.postMessage(null)}}else zt=function(){z(ht,0)};function wt(B,Q){et=z(function(){B(a.unstable_now())},Q)}a.unstable_IdlePriority=5,a.unstable_ImmediatePriority=1,a.unstable_LowPriority=4,a.unstable_NormalPriority=3,a.unstable_Profiling=null,a.unstable_UserBlockingPriority=2,a.unstable_cancelCallback=function(B){B.callback=null},a.unstable_forceFrameRate=function(B){0>B||125<B?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):w=0<B?Math.floor(1e3/B):5},a.unstable_getCurrentPriorityLevel=function(){return x},a.unstable_next=function(B){switch(x){case 1:case 2:case 3:var Q=3;break;default:Q=x}var lt=x;x=Q;try{return B()}finally{x=lt}},a.unstable_requestPaint=function(){K=!0},a.unstable_runWithPriority=function(B,Q){switch(B){case 1:case 2:case 3:case 4:case 5:break;default:B=3}var lt=x;x=B;try{return Q()}finally{x=lt}},a.unstable_scheduleCallback=function(B,Q,lt){var At=a.unstable_now();switch(typeof lt=="object"&&lt!==null?(lt=lt.delay,lt=typeof lt=="number"&&0<lt?At+lt:At):lt=At,B){case 1:var mt=-1;break;case 2:mt=250;break;case 5:mt=1073741823;break;case 4:mt=1e4;break;default:mt=5e3}return mt=lt+mt,B={id:b++,callback:Q,priorityLevel:B,startTime:lt,expirationTime:mt,sortIndex:-1},lt>At?(B.sortIndex=lt,i(v,B),l(g)===null&&B===l(v)&&(q?(P(et),et=-1):q=!0,wt(X,lt-At))):(B.sortIndex=mt,i(g,B),k||E||(k=!0,V||(V=!0,zt()))),B},a.unstable_shouldYield=st,a.unstable_wrapCallback=function(B){var Q=x;return function(){var lt=x;x=Q;try{return B.apply(this,arguments)}finally{x=lt}}}})(Mu)),Mu}var Zp;function Yb(){return Zp||(Zp=1,wu.exports=Ib()),wu.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 Kp;function Zb(){if(Kp)return pl;Kp=1;var a=Yb(),i=Mb(),l=Ub();function o(t){var e="https://react.dev/errors/"+t;if(1<arguments.length){e+="?args[]="+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)e+="&args[]="+encodeURIComponent(arguments[n])}return"Minified React error #"+t+"; visit "+e+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function u(t){return!(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)}function h(t){var e=t,n=t;if(t.alternate)for(;e.return;)e=e.return;else{t=e;do e=t,(e.flags&4098)!==0&&(n=e.return),t=e.return;while(t)}return e.tag===3?n:null}function f(t){if(t.tag===13){var e=t.memoizedState;if(e===null&&(t=t.alternate,t!==null&&(e=t.memoizedState)),e!==null)return e.dehydrated}return null}function p(t){if(t.tag===31){var e=t.memoizedState;if(e===null&&(t=t.alternate,t!==null&&(e=t.memoizedState)),e!==null)return e.dehydrated}return null}function g(t){if(h(t)!==t)throw Error(o(188))}function v(t){var e=t.alternate;if(!e){if(e=h(t),e===null)throw Error(o(188));return e!==t?null:t}for(var n=t,s=e;;){var r=n.return;if(r===null)break;var c=r.alternate;if(c===null){if(s=r.return,s!==null){n=s;continue}break}if(r.child===c.child){for(c=r.child;c;){if(c===n)return g(r),t;if(c===s)return g(r),e;c=c.sibling}throw Error(o(188))}if(n.return!==s.return)n=r,s=c;else{for(var m=!1,y=r.child;y;){if(y===n){m=!0,n=r,s=c;break}if(y===s){m=!0,s=r,n=c;break}y=y.sibling}if(!m){for(y=c.child;y;){if(y===n){m=!0,n=c,s=r;break}if(y===s){m=!0,s=c,n=r;break}y=y.sibling}if(!m)throw Error(o(189))}}if(n.alternate!==s)throw Error(o(190))}if(n.tag!==3)throw Error(o(188));return n.stateNode.current===n?t:e}function b(t){var e=t.tag;if(e===5||e===26||e===27||e===6)return t;for(t=t.child;t!==null;){if(e=b(t),e!==null)return e;t=t.sibling}return null}var S=Object.assign,x=Symbol.for("react.element"),E=Symbol.for("react.transitional.element"),k=Symbol.for("react.portal"),q=Symbol.for("react.fragment"),K=Symbol.for("react.strict_mode"),z=Symbol.for("react.profiler"),P=Symbol.for("react.consumer"),Y=Symbol.for("react.context"),nt=Symbol.for("react.forward_ref"),X=Symbol.for("react.suspense"),V=Symbol.for("react.suspense_list"),et=Symbol.for("react.memo"),w=Symbol.for("react.lazy"),$=Symbol.for("react.activity"),st=Symbol.for("react.memo_cache_sentinel"),ht=Symbol.iterator;function zt(t){return t===null||typeof t!="object"?null:(t=ht&&t[ht]||t["@@iterator"],typeof t=="function"?t:null)}var tt=Symbol.for("react.client.reference");function Ut(t){if(t==null)return null;if(typeof t=="function")return t.$$typeof===tt?null:t.displayName||t.name||null;if(typeof t=="string")return t;switch(t){case q:return"Fragment";case z:return"Profiler";case K:return"StrictMode";case X:return"Suspense";case V:return"SuspenseList";case $:return"Activity"}if(typeof t=="object")switch(t.$$typeof){case k:return"Portal";case Y:return t.displayName||"Context";case P:return(t._context.displayName||"Context")+".Consumer";case nt:var e=t.render;return t=t.displayName,t||(t=e.displayName||e.name||"",t=t!==""?"ForwardRef("+t+")":"ForwardRef"),t;case et:return e=t.displayName||null,e!==null?e:Ut(t.type)||"Memo";case w:e=t._payload,t=t._init;try{return Ut(t(e))}catch{}}return null}var wt=Array.isArray,B=i.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Q=l.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,lt={pending:!1,data:null,method:null,action:null},At=[],mt=-1;function Qt(t){return{current:t}}function yt(t){0>mt||(t.current=At[mt],At[mt]=null,mt--)}function bt(t,e){mt++,At[mt]=t.current,t.current=e}var I=Qt(null),ae=Qt(null),ve=Qt(null),tn=Qt(null);function Le(t,e){switch(bt(ve,e),bt(ae,t),bt(I,null),e.nodeType){case 9:case 11:t=(t=e.documentElement)&&(t=t.namespaceURI)?up(t):0;break;default:if(t=e.tagName,e=e.namespaceURI)e=up(e),t=dp(e,t);else switch(t){case"svg":t=1;break;case"math":t=2;break;default:t=0}}yt(I),bt(I,t)}function Wt(){yt(I),yt(ae),yt(ve)}function en(t){t.memoizedState!==null&&bt(tn,t);var e=I.current,n=dp(e,t.type);e!==n&&(bt(ae,t),bt(I,n))}function ze(t){ae.current===t&&(yt(I),yt(ae)),tn.current===t&&(yt(tn),dl._currentValue=lt)}var Gt,Pt;function me(t){if(Gt===void 0)try{throw Error()}catch(n){var e=n.stack.trim().match(/\n( *(at )?)/);Gt=e&&e[1]||"",Pt=-1<n.stack.indexOf(`
18
- at`)?" (<anonymous>)":-1<n.stack.indexOf("@")?"@unknown:0:0":""}return`
19
- `+Gt+t+Pt}var F=!1;function Mt(t,e){if(!t||F)return"";F=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var s={DetermineComponentFrameRoot:function(){try{if(e){var Z=function(){throw Error()};if(Object.defineProperty(Z.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(Z,[])}catch(O){var M=O}Reflect.construct(t,[],Z)}else{try{Z.call()}catch(O){M=O}t.call(Z.prototype)}}else{try{throw Error()}catch(O){M=O}(Z=t())&&typeof Z.catch=="function"&&Z.catch(function(){})}}catch(O){if(O&&M&&typeof O.stack=="string")return[O.stack,M.stack]}return[null,null]}};s.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var r=Object.getOwnPropertyDescriptor(s.DetermineComponentFrameRoot,"name");r&&r.configurable&&Object.defineProperty(s.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var c=s.DetermineComponentFrameRoot(),m=c[0],y=c[1];if(m&&y){var T=m.split(`
20
- `),D=y.split(`
21
- `);for(r=s=0;s<T.length&&!T[s].includes("DetermineComponentFrameRoot");)s++;for(;r<D.length&&!D[r].includes("DetermineComponentFrameRoot");)r++;if(s===T.length||r===D.length)for(s=T.length-1,r=D.length-1;1<=s&&0<=r&&T[s]!==D[r];)r--;for(;1<=s&&0<=r;s--,r--)if(T[s]!==D[r]){if(s!==1||r!==1)do if(s--,r--,0>r||T[s]!==D[r]){var L=`
22
- `+T[s].replace(" at new "," at ");return t.displayName&&L.includes("<anonymous>")&&(L=L.replace("<anonymous>",t.displayName)),L}while(1<=s&&0<=r);break}}}finally{F=!1,Error.prepareStackTrace=n}return(n=t?t.displayName||t.name:"")?me(n):""}function _t(t,e){switch(t.tag){case 26:case 27:case 5:return me(t.type);case 16:return me("Lazy");case 13:return t.child!==e&&e!==null?me("Suspense Fallback"):me("Suspense");case 19:return me("SuspenseList");case 0:case 15:return Mt(t.type,!1);case 11:return Mt(t.type.render,!1);case 1:return Mt(t.type,!0);case 31:return me("Activity");default:return""}}function R(t){try{var e="",n=null;do e+=_t(t,n),n=t,t=t.return;while(t);return e}catch(s){return`
23
- Error generating stack: `+s.message+`
24
- `+s.stack}}var U=Object.prototype.hasOwnProperty,W=a.unstable_scheduleCallback,ct=a.unstable_cancelCallback,St=a.unstable_shouldYield,gt=a.unstable_requestPaint,Nt=a.unstable_now,Vt=a.unstable_getCurrentPriorityLevel,Yt=a.unstable_ImmediatePriority,ie=a.unstable_UserBlockingPriority,Ft=a.unstable_NormalPriority,qe=a.unstable_LowPriority,H=a.unstable_IdlePriority,Me=a.log,$n=a.unstable_setDisableYieldValue,He=null,Ge=null;function nn(t){if(typeof Me=="function"&&$n(t),Ge&&typeof Ge.setStrictMode=="function")try{Ge.setStrictMode(He,t)}catch{}}var J=Math.clz32?Math.clz32:Zt,Tt=Math.log,le=Math.LN2;function Zt(t){return t>>>=0,t===0?32:31-(Tt(t)/le|0)|0}var dt=256,Fe=262144,fn=4194304;function an(t){var e=t&42;if(e!==0)return e;switch(t&-t){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 t&261888;case 262144:case 524288:case 1048576:case 2097152:return t&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return t&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return t}}function it(t,e,n){var s=t.pendingLanes;if(s===0)return 0;var r=0,c=t.suspendedLanes,m=t.pingedLanes;t=t.warmLanes;var y=s&134217727;return y!==0?(s=y&~c,s!==0?r=an(s):(m&=y,m!==0?r=an(m):n||(n=y&~t,n!==0&&(r=an(n))))):(y=s&~c,y!==0?r=an(y):m!==0?r=an(m):n||(n=s&~t,n!==0&&(r=an(n)))),r===0?0:e!==0&&e!==r&&(e&c)===0&&(c=r&-r,n=e&-e,c>=n||c===32&&(n&4194048)!==0)?e:r}function de(t,e){return(t.pendingLanes&~(t.suspendedLanes&~t.pingedLanes)&e)===0}function hn(t,e){switch(t){case 1:case 2:case 4:case 8:case 64:return e+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 e+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 _a(){var t=fn;return fn<<=1,(fn&62914560)===0&&(fn=4194304),t}function js(t){for(var e=[],n=0;31>n;n++)e.push(t);return e}function Ta(t,e){t.pendingLanes|=e,e!==268435456&&(t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0)}function Bl(t,e,n,s,r,c){var m=t.pendingLanes;t.pendingLanes=n,t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0,t.expiredLanes&=n,t.entangledLanes&=n,t.errorRecoveryDisabledLanes&=n,t.shellSuspendCounter=0;var y=t.entanglements,T=t.expirationTimes,D=t.hiddenUpdates;for(n=m&~n;0<n;){var L=31-J(n),Z=1<<L;y[L]=0,T[L]=-1;var M=D[L];if(M!==null)for(D[L]=null,L=0;L<M.length;L++){var O=M[L];O!==null&&(O.lane&=-536870913)}n&=~Z}s!==0&&Ti(t,s,0),c!==0&&r===0&&t.tag!==0&&(t.suspendedLanes|=c&~(m&~e))}function Ti(t,e,n){t.pendingLanes|=e,t.suspendedLanes&=~e;var s=31-J(e);t.entangledLanes|=e,t.entanglements[s]=t.entanglements[s]|1073741824|n&261930}function xi(t,e){var n=t.entangledLanes|=e;for(t=t.entanglements;n;){var s=31-J(n),r=1<<s;r&e|t[s]&e&&(t[s]|=e),n&=~r}}function ji(t,e){var n=e&-e;return n=(n&42)!==0?1:As(n),(n&(t.suspendedLanes|e))!==0?0:n}function As(t){switch(t){case 2:t=1;break;case 8:t=4;break;case 32:t=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:t=128;break;case 268435456:t=134217728;break;default:t=0}return t}function Ns(t){return t&=-t,2<t?8<t?(t&134217727)!==0?32:268435456:8:2}function Ai(){var t=Q.p;return t!==0?t:(t=window.event,t===void 0?32:Op(t.type))}function Ni(t,e){var n=Q.p;try{return Q.p=t,e()}finally{Q.p=n}}var zn=Math.random().toString(36).slice(2),Ne="__reactFiber$"+zn,at="__reactProps$"+zn,Et="__reactContainer$"+zn,Ct="__reactEvents$"+zn,oe="__reactListeners$"+zn,sn="__reactHandles$"+zn,Gn="__reactResources$"+zn,Ee="__reactMarker$"+zn;function Bn(t){delete t[Ne],delete t[at],delete t[Ct],delete t[oe],delete t[sn]}function Wn(t){var e=t[Ne];if(e)return e;for(var n=t.parentNode;n;){if(e=n[Et]||n[Ne]){if(n=e.alternate,e.child!==null||n!==null&&n.child!==null)for(t=yp(t);t!==null;){if(n=t[Ne])return n;t=yp(t)}return e}t=n,n=t.parentNode}return null}function Es(t){if(t=t[Ne]||t[Et]){var e=t.tag;if(e===5||e===6||e===13||e===31||e===26||e===27||e===3)return t}return null}function Ei(t){var e=t.tag;if(e===5||e===26||e===27||e===6)return t.stateNode;throw Error(o(33))}function Cs(t){var e=t[Gn];return e||(e=t[Gn]={hoistableStyles:new Map,hoistableScripts:new Map}),e}function Be(t){t[Ee]=!0}var Jd=new Set,$d={};function Wa(t,e){Ds(t,e),Ds(t+"Capture",e)}function Ds(t,e){for($d[t]=e,t=0;t<e.length;t++)Jd.add(e[t])}var xy=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]*$"),Wd={},tf={};function jy(t){return U.call(tf,t)?!0:U.call(Wd,t)?!1:xy.test(t)?tf[t]=!0:(Wd[t]=!0,!1)}function Ul(t,e,n){if(jy(e))if(n===null)t.removeAttribute(e);else{switch(typeof n){case"undefined":case"function":case"symbol":t.removeAttribute(e);return;case"boolean":var s=e.toLowerCase().slice(0,5);if(s!=="data-"&&s!=="aria-"){t.removeAttribute(e);return}}t.setAttribute(e,""+n)}}function Vl(t,e,n){if(n===null)t.removeAttribute(e);else{switch(typeof n){case"undefined":case"function":case"symbol":case"boolean":t.removeAttribute(e);return}t.setAttribute(e,""+n)}}function ta(t,e,n,s){if(s===null)t.removeAttribute(n);else{switch(typeof s){case"undefined":case"function":case"symbol":case"boolean":t.removeAttribute(n);return}t.setAttributeNS(e,n,""+s)}}function xn(t){switch(typeof t){case"bigint":case"boolean":case"number":case"string":case"undefined":return t;case"object":return t;default:return""}}function ef(t){var e=t.type;return(t=t.nodeName)&&t.toLowerCase()==="input"&&(e==="checkbox"||e==="radio")}function Ay(t,e,n){var s=Object.getOwnPropertyDescriptor(t.constructor.prototype,e);if(!t.hasOwnProperty(e)&&typeof s<"u"&&typeof s.get=="function"&&typeof s.set=="function"){var r=s.get,c=s.set;return Object.defineProperty(t,e,{configurable:!0,get:function(){return r.call(this)},set:function(m){n=""+m,c.call(this,m)}}),Object.defineProperty(t,e,{enumerable:s.enumerable}),{getValue:function(){return n},setValue:function(m){n=""+m},stopTracking:function(){t._valueTracker=null,delete t[e]}}}}function xr(t){if(!t._valueTracker){var e=ef(t)?"checked":"value";t._valueTracker=Ay(t,e,""+t[e])}}function nf(t){if(!t)return!1;var e=t._valueTracker;if(!e)return!0;var n=e.getValue(),s="";return t&&(s=ef(t)?t.checked?"true":"false":t.value),t=s,t!==n?(e.setValue(t),!0):!1}function Ll(t){if(t=t||(typeof document<"u"?document:void 0),typeof t>"u")return null;try{return t.activeElement||t.body}catch{return t.body}}var Ny=/[\n"\\]/g;function jn(t){return t.replace(Ny,function(e){return"\\"+e.charCodeAt(0).toString(16)+" "})}function jr(t,e,n,s,r,c,m,y){t.name="",m!=null&&typeof m!="function"&&typeof m!="symbol"&&typeof m!="boolean"?t.type=m:t.removeAttribute("type"),e!=null?m==="number"?(e===0&&t.value===""||t.value!=e)&&(t.value=""+xn(e)):t.value!==""+xn(e)&&(t.value=""+xn(e)):m!=="submit"&&m!=="reset"||t.removeAttribute("value"),e!=null?Ar(t,m,xn(e)):n!=null?Ar(t,m,xn(n)):s!=null&&t.removeAttribute("value"),r==null&&c!=null&&(t.defaultChecked=!!c),r!=null&&(t.checked=r&&typeof r!="function"&&typeof r!="symbol"),y!=null&&typeof y!="function"&&typeof y!="symbol"&&typeof y!="boolean"?t.name=""+xn(y):t.removeAttribute("name")}function af(t,e,n,s,r,c,m,y){if(c!=null&&typeof c!="function"&&typeof c!="symbol"&&typeof c!="boolean"&&(t.type=c),e!=null||n!=null){if(!(c!=="submit"&&c!=="reset"||e!=null)){xr(t);return}n=n!=null?""+xn(n):"",e=e!=null?""+xn(e):n,y||e===t.value||(t.value=e),t.defaultValue=e}s=s??r,s=typeof s!="function"&&typeof s!="symbol"&&!!s,t.checked=y?t.checked:!!s,t.defaultChecked=!!s,m!=null&&typeof m!="function"&&typeof m!="symbol"&&typeof m!="boolean"&&(t.name=m),xr(t)}function Ar(t,e,n){e==="number"&&Ll(t.ownerDocument)===t||t.defaultValue===""+n||(t.defaultValue=""+n)}function ks(t,e,n,s){if(t=t.options,e){e={};for(var r=0;r<n.length;r++)e["$"+n[r]]=!0;for(n=0;n<t.length;n++)r=e.hasOwnProperty("$"+t[n].value),t[n].selected!==r&&(t[n].selected=r),r&&s&&(t[n].defaultSelected=!0)}else{for(n=""+xn(n),e=null,r=0;r<t.length;r++){if(t[r].value===n){t[r].selected=!0,s&&(t[r].defaultSelected=!0);return}e!==null||t[r].disabled||(e=t[r])}e!==null&&(e.selected=!0)}}function sf(t,e,n){if(e!=null&&(e=""+xn(e),e!==t.value&&(t.value=e),n==null)){t.defaultValue!==e&&(t.defaultValue=e);return}t.defaultValue=n!=null?""+xn(n):""}function lf(t,e,n,s){if(e==null){if(s!=null){if(n!=null)throw Error(o(92));if(wt(s)){if(1<s.length)throw Error(o(93));s=s[0]}n=s}n==null&&(n=""),e=n}n=xn(e),t.defaultValue=n,s=t.textContent,s===n&&s!==""&&s!==null&&(t.value=s),xr(t)}function ws(t,e){if(e){var n=t.firstChild;if(n&&n===t.lastChild&&n.nodeType===3){n.nodeValue=e;return}}t.textContent=e}var Ey=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 of(t,e,n){var s=e.indexOf("--")===0;n==null||typeof n=="boolean"||n===""?s?t.setProperty(e,""):e==="float"?t.cssFloat="":t[e]="":s?t.setProperty(e,n):typeof n!="number"||n===0||Ey.has(e)?e==="float"?t.cssFloat=n:t[e]=(""+n).trim():t[e]=n+"px"}function rf(t,e,n){if(e!=null&&typeof e!="object")throw Error(o(62));if(t=t.style,n!=null){for(var s in n)!n.hasOwnProperty(s)||e!=null&&e.hasOwnProperty(s)||(s.indexOf("--")===0?t.setProperty(s,""):s==="float"?t.cssFloat="":t[s]="");for(var r in e)s=e[r],e.hasOwnProperty(r)&&n[r]!==s&&of(t,r,s)}else for(var c in e)e.hasOwnProperty(c)&&of(t,c,e[c])}function Nr(t){if(t.indexOf("-")===-1)return!1;switch(t){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 Cy=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"]]),Dy=/^[\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 ql(t){return Dy.test(""+t)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":t}function ea(){}var Er=null;function Cr(t){return t=t.target||t.srcElement||window,t.correspondingUseElement&&(t=t.correspondingUseElement),t.nodeType===3?t.parentNode:t}var Ms=null,Rs=null;function cf(t){var e=Es(t);if(e&&(t=e.stateNode)){var n=t[at]||null;t:switch(t=e.stateNode,e.type){case"input":if(jr(t,n.value,n.defaultValue,n.defaultValue,n.checked,n.defaultChecked,n.type,n.name),e=n.name,n.type==="radio"&&e!=null){for(n=t;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll('input[name="'+jn(""+e)+'"][type="radio"]'),e=0;e<n.length;e++){var s=n[e];if(s!==t&&s.form===t.form){var r=s[at]||null;if(!r)throw Error(o(90));jr(s,r.value,r.defaultValue,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name)}}for(e=0;e<n.length;e++)s=n[e],s.form===t.form&&nf(s)}break t;case"textarea":sf(t,n.value,n.defaultValue);break t;case"select":e=n.value,e!=null&&ks(t,!!n.multiple,e,!1)}}}var Dr=!1;function uf(t,e,n){if(Dr)return t(e,n);Dr=!0;try{var s=t(e);return s}finally{if(Dr=!1,(Ms!==null||Rs!==null)&&(Co(),Ms&&(e=Ms,t=Rs,Rs=Ms=null,cf(e),t)))for(e=0;e<t.length;e++)cf(t[e])}}function Ci(t,e){var n=t.stateNode;if(n===null)return null;var s=n[at]||null;if(s===null)return null;n=s[e];t:switch(e){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(s=!s.disabled)||(t=t.type,s=!(t==="button"||t==="input"||t==="select"||t==="textarea")),t=!s;break t;default:t=!1}if(t)return null;if(n&&typeof n!="function")throw Error(o(231,e,typeof n));return n}var na=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),kr=!1;if(na)try{var Di={};Object.defineProperty(Di,"passive",{get:function(){kr=!0}}),window.addEventListener("test",Di,Di),window.removeEventListener("test",Di,Di)}catch{kr=!1}var xa=null,wr=null,Hl=null;function df(){if(Hl)return Hl;var t,e=wr,n=e.length,s,r="value"in xa?xa.value:xa.textContent,c=r.length;for(t=0;t<n&&e[t]===r[t];t++);var m=n-t;for(s=1;s<=m&&e[n-s]===r[c-s];s++);return Hl=r.slice(t,1<s?1-s:void 0)}function Gl(t){var e=t.keyCode;return"charCode"in t?(t=t.charCode,t===0&&e===13&&(t=13)):t=e,t===10&&(t=13),32<=t||t===13?t:0}function Il(){return!0}function ff(){return!1}function ln(t){function e(n,s,r,c,m){this._reactName=n,this._targetInst=r,this.type=s,this.nativeEvent=c,this.target=m,this.currentTarget=null;for(var y in t)t.hasOwnProperty(y)&&(n=t[y],this[y]=n?n(c):c[y]);return this.isDefaultPrevented=(c.defaultPrevented!=null?c.defaultPrevented:c.returnValue===!1)?Il:ff,this.isPropagationStopped=ff,this}return S(e.prototype,{preventDefault:function(){this.defaultPrevented=!0;var n=this.nativeEvent;n&&(n.preventDefault?n.preventDefault():typeof n.returnValue!="unknown"&&(n.returnValue=!1),this.isDefaultPrevented=Il)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=Il)},persist:function(){},isPersistent:Il}),e}var ts={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(t){return t.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Yl=ln(ts),ki=S({},ts,{view:0,detail:0}),ky=ln(ki),Mr,Rr,wi,Zl=S({},ki,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:zr,button:0,buttons:0,relatedTarget:function(t){return t.relatedTarget===void 0?t.fromElement===t.srcElement?t.toElement:t.fromElement:t.relatedTarget},movementX:function(t){return"movementX"in t?t.movementX:(t!==wi&&(wi&&t.type==="mousemove"?(Mr=t.screenX-wi.screenX,Rr=t.screenY-wi.screenY):Rr=Mr=0,wi=t),Mr)},movementY:function(t){return"movementY"in t?t.movementY:Rr}}),hf=ln(Zl),wy=S({},Zl,{dataTransfer:0}),My=ln(wy),Ry=S({},ki,{relatedTarget:0}),Or=ln(Ry),Oy=S({},ts,{animationName:0,elapsedTime:0,pseudoElement:0}),zy=ln(Oy),By=S({},ts,{clipboardData:function(t){return"clipboardData"in t?t.clipboardData:window.clipboardData}}),Uy=ln(By),Vy=S({},ts,{data:0}),mf=ln(Vy),Ly={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},qy={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"},Hy={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Gy(t){var e=this.nativeEvent;return e.getModifierState?e.getModifierState(t):(t=Hy[t])?!!e[t]:!1}function zr(){return Gy}var Iy=S({},ki,{key:function(t){if(t.key){var e=Ly[t.key]||t.key;if(e!=="Unidentified")return e}return t.type==="keypress"?(t=Gl(t),t===13?"Enter":String.fromCharCode(t)):t.type==="keydown"||t.type==="keyup"?qy[t.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:zr,charCode:function(t){return t.type==="keypress"?Gl(t):0},keyCode:function(t){return t.type==="keydown"||t.type==="keyup"?t.keyCode:0},which:function(t){return t.type==="keypress"?Gl(t):t.type==="keydown"||t.type==="keyup"?t.keyCode:0}}),Yy=ln(Iy),Zy=S({},Zl,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),pf=ln(Zy),Ky=S({},ki,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:zr}),Xy=ln(Ky),Qy=S({},ts,{propertyName:0,elapsedTime:0,pseudoElement:0}),Py=ln(Qy),Fy=S({},Zl,{deltaX:function(t){return"deltaX"in t?t.deltaX:"wheelDeltaX"in t?-t.wheelDeltaX:0},deltaY:function(t){return"deltaY"in t?t.deltaY:"wheelDeltaY"in t?-t.wheelDeltaY:"wheelDelta"in t?-t.wheelDelta:0},deltaZ:0,deltaMode:0}),Jy=ln(Fy),$y=S({},ts,{newState:0,oldState:0}),Wy=ln($y),t1=[9,13,27,32],Br=na&&"CompositionEvent"in window,Mi=null;na&&"documentMode"in document&&(Mi=document.documentMode);var e1=na&&"TextEvent"in window&&!Mi,gf=na&&(!Br||Mi&&8<Mi&&11>=Mi),vf=" ",yf=!1;function bf(t,e){switch(t){case"keyup":return t1.indexOf(e.keyCode)!==-1;case"keydown":return e.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Sf(t){return t=t.detail,typeof t=="object"&&"data"in t?t.data:null}var Os=!1;function n1(t,e){switch(t){case"compositionend":return Sf(e);case"keypress":return e.which!==32?null:(yf=!0,vf);case"textInput":return t=e.data,t===vf&&yf?null:t;default:return null}}function a1(t,e){if(Os)return t==="compositionend"||!Br&&bf(t,e)?(t=df(),Hl=wr=xa=null,Os=!1,t):null;switch(t){case"paste":return null;case"keypress":if(!(e.ctrlKey||e.altKey||e.metaKey)||e.ctrlKey&&e.altKey){if(e.char&&1<e.char.length)return e.char;if(e.which)return String.fromCharCode(e.which)}return null;case"compositionend":return gf&&e.locale!=="ko"?null:e.data;default:return null}}var s1={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 _f(t){var e=t&&t.nodeName&&t.nodeName.toLowerCase();return e==="input"?!!s1[t.type]:e==="textarea"}function Tf(t,e,n,s){Ms?Rs?Rs.push(s):Rs=[s]:Ms=s,e=zo(e,"onChange"),0<e.length&&(n=new Yl("onChange","change",null,n,s),t.push({event:n,listeners:e}))}var Ri=null,Oi=null;function i1(t){sp(t,0)}function Kl(t){var e=Ei(t);if(nf(e))return t}function xf(t,e){if(t==="change")return e}var jf=!1;if(na){var Ur;if(na){var Vr="oninput"in document;if(!Vr){var Af=document.createElement("div");Af.setAttribute("oninput","return;"),Vr=typeof Af.oninput=="function"}Ur=Vr}else Ur=!1;jf=Ur&&(!document.documentMode||9<document.documentMode)}function Nf(){Ri&&(Ri.detachEvent("onpropertychange",Ef),Oi=Ri=null)}function Ef(t){if(t.propertyName==="value"&&Kl(Oi)){var e=[];Tf(e,Oi,t,Cr(t)),uf(i1,e)}}function l1(t,e,n){t==="focusin"?(Nf(),Ri=e,Oi=n,Ri.attachEvent("onpropertychange",Ef)):t==="focusout"&&Nf()}function o1(t){if(t==="selectionchange"||t==="keyup"||t==="keydown")return Kl(Oi)}function r1(t,e){if(t==="click")return Kl(e)}function c1(t,e){if(t==="input"||t==="change")return Kl(e)}function u1(t,e){return t===e&&(t!==0||1/t===1/e)||t!==t&&e!==e}var mn=typeof Object.is=="function"?Object.is:u1;function zi(t,e){if(mn(t,e))return!0;if(typeof t!="object"||t===null||typeof e!="object"||e===null)return!1;var n=Object.keys(t),s=Object.keys(e);if(n.length!==s.length)return!1;for(s=0;s<n.length;s++){var r=n[s];if(!U.call(e,r)||!mn(t[r],e[r]))return!1}return!0}function Cf(t){for(;t&&t.firstChild;)t=t.firstChild;return t}function Df(t,e){var n=Cf(t);t=0;for(var s;n;){if(n.nodeType===3){if(s=t+n.textContent.length,t<=e&&s>=e)return{node:n,offset:e-t};t=s}t:{for(;n;){if(n.nextSibling){n=n.nextSibling;break t}n=n.parentNode}n=void 0}n=Cf(n)}}function kf(t,e){return t&&e?t===e?!0:t&&t.nodeType===3?!1:e&&e.nodeType===3?kf(t,e.parentNode):"contains"in t?t.contains(e):t.compareDocumentPosition?!!(t.compareDocumentPosition(e)&16):!1:!1}function wf(t){t=t!=null&&t.ownerDocument!=null&&t.ownerDocument.defaultView!=null?t.ownerDocument.defaultView:window;for(var e=Ll(t.document);e instanceof t.HTMLIFrameElement;){try{var n=typeof e.contentWindow.location.href=="string"}catch{n=!1}if(n)t=e.contentWindow;else break;e=Ll(t.document)}return e}function Lr(t){var e=t&&t.nodeName&&t.nodeName.toLowerCase();return e&&(e==="input"&&(t.type==="text"||t.type==="search"||t.type==="tel"||t.type==="url"||t.type==="password")||e==="textarea"||t.contentEditable==="true")}var d1=na&&"documentMode"in document&&11>=document.documentMode,zs=null,qr=null,Bi=null,Hr=!1;function Mf(t,e,n){var s=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Hr||zs==null||zs!==Ll(s)||(s=zs,"selectionStart"in s&&Lr(s)?s={start:s.selectionStart,end:s.selectionEnd}:(s=(s.ownerDocument&&s.ownerDocument.defaultView||window).getSelection(),s={anchorNode:s.anchorNode,anchorOffset:s.anchorOffset,focusNode:s.focusNode,focusOffset:s.focusOffset}),Bi&&zi(Bi,s)||(Bi=s,s=zo(qr,"onSelect"),0<s.length&&(e=new Yl("onSelect","select",null,e,n),t.push({event:e,listeners:s}),e.target=zs)))}function es(t,e){var n={};return n[t.toLowerCase()]=e.toLowerCase(),n["Webkit"+t]="webkit"+e,n["Moz"+t]="moz"+e,n}var Bs={animationend:es("Animation","AnimationEnd"),animationiteration:es("Animation","AnimationIteration"),animationstart:es("Animation","AnimationStart"),transitionrun:es("Transition","TransitionRun"),transitionstart:es("Transition","TransitionStart"),transitioncancel:es("Transition","TransitionCancel"),transitionend:es("Transition","TransitionEnd")},Gr={},Rf={};na&&(Rf=document.createElement("div").style,"AnimationEvent"in window||(delete Bs.animationend.animation,delete Bs.animationiteration.animation,delete Bs.animationstart.animation),"TransitionEvent"in window||delete Bs.transitionend.transition);function ns(t){if(Gr[t])return Gr[t];if(!Bs[t])return t;var e=Bs[t],n;for(n in e)if(e.hasOwnProperty(n)&&n in Rf)return Gr[t]=e[n];return t}var Of=ns("animationend"),zf=ns("animationiteration"),Bf=ns("animationstart"),f1=ns("transitionrun"),h1=ns("transitionstart"),m1=ns("transitioncancel"),Uf=ns("transitionend"),Vf=new Map,Ir="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(" ");Ir.push("scrollEnd");function Un(t,e){Vf.set(t,e),Wa(e,[t])}var Xl=typeof reportError=="function"?reportError:function(t){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var e=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof t=="object"&&t!==null&&typeof t.message=="string"?String(t.message):String(t),error:t});if(!window.dispatchEvent(e))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",t);return}console.error(t)},An=[],Us=0,Yr=0;function Ql(){for(var t=Us,e=Yr=Us=0;e<t;){var n=An[e];An[e++]=null;var s=An[e];An[e++]=null;var r=An[e];An[e++]=null;var c=An[e];if(An[e++]=null,s!==null&&r!==null){var m=s.pending;m===null?r.next=r:(r.next=m.next,m.next=r),s.pending=r}c!==0&&Lf(n,r,c)}}function Pl(t,e,n,s){An[Us++]=t,An[Us++]=e,An[Us++]=n,An[Us++]=s,Yr|=s,t.lanes|=s,t=t.alternate,t!==null&&(t.lanes|=s)}function Zr(t,e,n,s){return Pl(t,e,n,s),Fl(t)}function as(t,e){return Pl(t,null,null,e),Fl(t)}function Lf(t,e,n){t.lanes|=n;var s=t.alternate;s!==null&&(s.lanes|=n);for(var r=!1,c=t.return;c!==null;)c.childLanes|=n,s=c.alternate,s!==null&&(s.childLanes|=n),c.tag===22&&(t=c.stateNode,t===null||t._visibility&1||(r=!0)),t=c,c=c.return;return t.tag===3?(c=t.stateNode,r&&e!==null&&(r=31-J(n),t=c.hiddenUpdates,s=t[r],s===null?t[r]=[e]:s.push(e),e.lane=n|536870912),c):null}function Fl(t){if(50<sl)throw sl=0,tu=null,Error(o(185));for(var e=t.return;e!==null;)t=e,e=t.return;return t.tag===3?t.stateNode:null}var Vs={};function p1(t,e,n,s){this.tag=t,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=e,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=s,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function pn(t,e,n,s){return new p1(t,e,n,s)}function Kr(t){return t=t.prototype,!(!t||!t.isReactComponent)}function aa(t,e){var n=t.alternate;return n===null?(n=pn(t.tag,e,t.key,t.mode),n.elementType=t.elementType,n.type=t.type,n.stateNode=t.stateNode,n.alternate=t,t.alternate=n):(n.pendingProps=e,n.type=t.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=t.flags&65011712,n.childLanes=t.childLanes,n.lanes=t.lanes,n.child=t.child,n.memoizedProps=t.memoizedProps,n.memoizedState=t.memoizedState,n.updateQueue=t.updateQueue,e=t.dependencies,n.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext},n.sibling=t.sibling,n.index=t.index,n.ref=t.ref,n.refCleanup=t.refCleanup,n}function qf(t,e){t.flags&=65011714;var n=t.alternate;return n===null?(t.childLanes=0,t.lanes=e,t.child=null,t.subtreeFlags=0,t.memoizedProps=null,t.memoizedState=null,t.updateQueue=null,t.dependencies=null,t.stateNode=null):(t.childLanes=n.childLanes,t.lanes=n.lanes,t.child=n.child,t.subtreeFlags=0,t.deletions=null,t.memoizedProps=n.memoizedProps,t.memoizedState=n.memoizedState,t.updateQueue=n.updateQueue,t.type=n.type,e=n.dependencies,t.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),t}function Jl(t,e,n,s,r,c){var m=0;if(s=t,typeof t=="function")Kr(t)&&(m=1);else if(typeof t=="string")m=Sb(t,n,I.current)?26:t==="html"||t==="head"||t==="body"?27:5;else t:switch(t){case $:return t=pn(31,n,e,r),t.elementType=$,t.lanes=c,t;case q:return ss(n.children,r,c,e);case K:m=8,r|=24;break;case z:return t=pn(12,n,e,r|2),t.elementType=z,t.lanes=c,t;case X:return t=pn(13,n,e,r),t.elementType=X,t.lanes=c,t;case V:return t=pn(19,n,e,r),t.elementType=V,t.lanes=c,t;default:if(typeof t=="object"&&t!==null)switch(t.$$typeof){case Y:m=10;break t;case P:m=9;break t;case nt:m=11;break t;case et:m=14;break t;case w:m=16,s=null;break t}m=29,n=Error(o(130,t===null?"null":typeof t,"")),s=null}return e=pn(m,n,e,r),e.elementType=t,e.type=s,e.lanes=c,e}function ss(t,e,n,s){return t=pn(7,t,s,e),t.lanes=n,t}function Xr(t,e,n){return t=pn(6,t,null,e),t.lanes=n,t}function Hf(t){var e=pn(18,null,null,0);return e.stateNode=t,e}function Qr(t,e,n){return e=pn(4,t.children!==null?t.children:[],t.key,e),e.lanes=n,e.stateNode={containerInfo:t.containerInfo,pendingChildren:null,implementation:t.implementation},e}var Gf=new WeakMap;function Nn(t,e){if(typeof t=="object"&&t!==null){var n=Gf.get(t);return n!==void 0?n:(e={value:t,source:e,stack:R(e)},Gf.set(t,e),e)}return{value:t,source:e,stack:R(e)}}var Ls=[],qs=0,$l=null,Ui=0,En=[],Cn=0,ja=null,In=1,Yn="";function sa(t,e){Ls[qs++]=Ui,Ls[qs++]=$l,$l=t,Ui=e}function If(t,e,n){En[Cn++]=In,En[Cn++]=Yn,En[Cn++]=ja,ja=t;var s=In;t=Yn;var r=32-J(s)-1;s&=~(1<<r),n+=1;var c=32-J(e)+r;if(30<c){var m=r-r%5;c=(s&(1<<m)-1).toString(32),s>>=m,r-=m,In=1<<32-J(e)+r|n<<r|s,Yn=c+t}else In=1<<c|n<<r|s,Yn=t}function Pr(t){t.return!==null&&(sa(t,1),If(t,1,0))}function Fr(t){for(;t===$l;)$l=Ls[--qs],Ls[qs]=null,Ui=Ls[--qs],Ls[qs]=null;for(;t===ja;)ja=En[--Cn],En[Cn]=null,Yn=En[--Cn],En[Cn]=null,In=En[--Cn],En[Cn]=null}function Yf(t,e){En[Cn++]=In,En[Cn++]=Yn,En[Cn++]=ja,In=e.id,Yn=e.overflow,ja=t}var Ie=null,re=null,Bt=!1,Aa=null,Dn=!1,Jr=Error(o(519));function Na(t){var e=Error(o(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Vi(Nn(e,t)),Jr}function Zf(t){var e=t.stateNode,n=t.type,s=t.memoizedProps;switch(e[Ne]=t,e[at]=s,n){case"dialog":kt("cancel",e),kt("close",e);break;case"iframe":case"object":case"embed":kt("load",e);break;case"video":case"audio":for(n=0;n<ll.length;n++)kt(ll[n],e);break;case"source":kt("error",e);break;case"img":case"image":case"link":kt("error",e),kt("load",e);break;case"details":kt("toggle",e);break;case"input":kt("invalid",e),af(e,s.value,s.defaultValue,s.checked,s.defaultChecked,s.type,s.name,!0);break;case"select":kt("invalid",e);break;case"textarea":kt("invalid",e),lf(e,s.value,s.defaultValue,s.children)}n=s.children,typeof n!="string"&&typeof n!="number"&&typeof n!="bigint"||e.textContent===""+n||s.suppressHydrationWarning===!0||rp(e.textContent,n)?(s.popover!=null&&(kt("beforetoggle",e),kt("toggle",e)),s.onScroll!=null&&kt("scroll",e),s.onScrollEnd!=null&&kt("scrollend",e),s.onClick!=null&&(e.onclick=ea),e=!0):e=!1,e||Na(t,!0)}function Kf(t){for(Ie=t.return;Ie;)switch(Ie.tag){case 5:case 31:case 13:Dn=!1;return;case 27:case 3:Dn=!0;return;default:Ie=Ie.return}}function Hs(t){if(t!==Ie)return!1;if(!Bt)return Kf(t),Bt=!0,!1;var e=t.tag,n;if((n=e!==3&&e!==27)&&((n=e===5)&&(n=t.type,n=!(n!=="form"&&n!=="button")||pu(t.type,t.memoizedProps)),n=!n),n&&re&&Na(t),Kf(t),e===13){if(t=t.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(o(317));re=vp(t)}else if(e===31){if(t=t.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(o(317));re=vp(t)}else e===27?(e=re,qa(t.type)?(t=Su,Su=null,re=t):re=e):re=Ie?wn(t.stateNode.nextSibling):null;return!0}function is(){re=Ie=null,Bt=!1}function $r(){var t=Aa;return t!==null&&(un===null?un=t:un.push.apply(un,t),Aa=null),t}function Vi(t){Aa===null?Aa=[t]:Aa.push(t)}var Wr=Qt(null),ls=null,ia=null;function Ea(t,e,n){bt(Wr,e._currentValue),e._currentValue=n}function la(t){t._currentValue=Wr.current,yt(Wr)}function tc(t,e,n){for(;t!==null;){var s=t.alternate;if((t.childLanes&e)!==e?(t.childLanes|=e,s!==null&&(s.childLanes|=e)):s!==null&&(s.childLanes&e)!==e&&(s.childLanes|=e),t===n)break;t=t.return}}function ec(t,e,n,s){var r=t.child;for(r!==null&&(r.return=t);r!==null;){var c=r.dependencies;if(c!==null){var m=r.child;c=c.firstContext;t:for(;c!==null;){var y=c;c=r;for(var T=0;T<e.length;T++)if(y.context===e[T]){c.lanes|=n,y=c.alternate,y!==null&&(y.lanes|=n),tc(c.return,n,t),s||(m=null);break t}c=y.next}}else if(r.tag===18){if(m=r.return,m===null)throw Error(o(341));m.lanes|=n,c=m.alternate,c!==null&&(c.lanes|=n),tc(m,n,t),m=null}else m=r.child;if(m!==null)m.return=r;else for(m=r;m!==null;){if(m===t){m=null;break}if(r=m.sibling,r!==null){r.return=m.return,m=r;break}m=m.return}r=m}}function Gs(t,e,n,s){t=null;for(var r=e,c=!1;r!==null;){if(!c){if((r.flags&524288)!==0)c=!0;else if((r.flags&262144)!==0)break}if(r.tag===10){var m=r.alternate;if(m===null)throw Error(o(387));if(m=m.memoizedProps,m!==null){var y=r.type;mn(r.pendingProps.value,m.value)||(t!==null?t.push(y):t=[y])}}else if(r===tn.current){if(m=r.alternate,m===null)throw Error(o(387));m.memoizedState.memoizedState!==r.memoizedState.memoizedState&&(t!==null?t.push(dl):t=[dl])}r=r.return}t!==null&&ec(e,t,n,s),e.flags|=262144}function Wl(t){for(t=t.firstContext;t!==null;){if(!mn(t.context._currentValue,t.memoizedValue))return!0;t=t.next}return!1}function os(t){ls=t,ia=null,t=t.dependencies,t!==null&&(t.firstContext=null)}function Ye(t){return Xf(ls,t)}function to(t,e){return ls===null&&os(t),Xf(t,e)}function Xf(t,e){var n=e._currentValue;if(e={context:e,memoizedValue:n,next:null},ia===null){if(t===null)throw Error(o(308));ia=e,t.dependencies={lanes:0,firstContext:e},t.flags|=524288}else ia=ia.next=e;return n}var g1=typeof AbortController<"u"?AbortController:function(){var t=[],e=this.signal={aborted:!1,addEventListener:function(n,s){t.push(s)}};this.abort=function(){e.aborted=!0,t.forEach(function(n){return n()})}},v1=a.unstable_scheduleCallback,y1=a.unstable_NormalPriority,Ce={$$typeof:Y,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function nc(){return{controller:new g1,data:new Map,refCount:0}}function Li(t){t.refCount--,t.refCount===0&&v1(y1,function(){t.controller.abort()})}var qi=null,ac=0,Is=0,Ys=null;function b1(t,e){if(qi===null){var n=qi=[];ac=0,Is=lu(),Ys={status:"pending",value:void 0,then:function(s){n.push(s)}}}return ac++,e.then(Qf,Qf),e}function Qf(){if(--ac===0&&qi!==null){Ys!==null&&(Ys.status="fulfilled");var t=qi;qi=null,Is=0,Ys=null;for(var e=0;e<t.length;e++)(0,t[e])()}}function S1(t,e){var n=[],s={status:"pending",value:null,reason:null,then:function(r){n.push(r)}};return t.then(function(){s.status="fulfilled",s.value=e;for(var r=0;r<n.length;r++)(0,n[r])(e)},function(r){for(s.status="rejected",s.reason=r,r=0;r<n.length;r++)(0,n[r])(void 0)}),s}var Pf=B.S;B.S=function(t,e){Mm=Nt(),typeof e=="object"&&e!==null&&typeof e.then=="function"&&b1(t,e),Pf!==null&&Pf(t,e)};var rs=Qt(null);function sc(){var t=rs.current;return t!==null?t:se.pooledCache}function eo(t,e){e===null?bt(rs,rs.current):bt(rs,e.pool)}function Ff(){var t=sc();return t===null?null:{parent:Ce._currentValue,pool:t}}var Zs=Error(o(460)),ic=Error(o(474)),no=Error(o(542)),ao={then:function(){}};function Jf(t){return t=t.status,t==="fulfilled"||t==="rejected"}function $f(t,e,n){switch(n=t[n],n===void 0?t.push(e):n!==e&&(e.then(ea,ea),e=n),e.status){case"fulfilled":return e.value;case"rejected":throw t=e.reason,th(t),t;default:if(typeof e.status=="string")e.then(ea,ea);else{if(t=se,t!==null&&100<t.shellSuspendCounter)throw Error(o(482));t=e,t.status="pending",t.then(function(s){if(e.status==="pending"){var r=e;r.status="fulfilled",r.value=s}},function(s){if(e.status==="pending"){var r=e;r.status="rejected",r.reason=s}})}switch(e.status){case"fulfilled":return e.value;case"rejected":throw t=e.reason,th(t),t}throw us=e,Zs}}function cs(t){try{var e=t._init;return e(t._payload)}catch(n){throw n!==null&&typeof n=="object"&&typeof n.then=="function"?(us=n,Zs):n}}var us=null;function Wf(){if(us===null)throw Error(o(459));var t=us;return us=null,t}function th(t){if(t===Zs||t===no)throw Error(o(483))}var Ks=null,Hi=0;function so(t){var e=Hi;return Hi+=1,Ks===null&&(Ks=[]),$f(Ks,t,e)}function Gi(t,e){e=e.props.ref,t.ref=e!==void 0?e:null}function io(t,e){throw e.$$typeof===x?Error(o(525)):(t=Object.prototype.toString.call(e),Error(o(31,t==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":t)))}function eh(t){function e(N,j){if(t){var C=N.deletions;C===null?(N.deletions=[j],N.flags|=16):C.push(j)}}function n(N,j){if(!t)return null;for(;j!==null;)e(N,j),j=j.sibling;return null}function s(N){for(var j=new Map;N!==null;)N.key!==null?j.set(N.key,N):j.set(N.index,N),N=N.sibling;return j}function r(N,j){return N=aa(N,j),N.index=0,N.sibling=null,N}function c(N,j,C){return N.index=C,t?(C=N.alternate,C!==null?(C=C.index,C<j?(N.flags|=67108866,j):C):(N.flags|=67108866,j)):(N.flags|=1048576,j)}function m(N){return t&&N.alternate===null&&(N.flags|=67108866),N}function y(N,j,C,G){return j===null||j.tag!==6?(j=Xr(C,N.mode,G),j.return=N,j):(j=r(j,C),j.return=N,j)}function T(N,j,C,G){var ft=C.type;return ft===q?L(N,j,C.props.children,G,C.key):j!==null&&(j.elementType===ft||typeof ft=="object"&&ft!==null&&ft.$$typeof===w&&cs(ft)===j.type)?(j=r(j,C.props),Gi(j,C),j.return=N,j):(j=Jl(C.type,C.key,C.props,null,N.mode,G),Gi(j,C),j.return=N,j)}function D(N,j,C,G){return j===null||j.tag!==4||j.stateNode.containerInfo!==C.containerInfo||j.stateNode.implementation!==C.implementation?(j=Qr(C,N.mode,G),j.return=N,j):(j=r(j,C.children||[]),j.return=N,j)}function L(N,j,C,G,ft){return j===null||j.tag!==7?(j=ss(C,N.mode,G,ft),j.return=N,j):(j=r(j,C),j.return=N,j)}function Z(N,j,C){if(typeof j=="string"&&j!==""||typeof j=="number"||typeof j=="bigint")return j=Xr(""+j,N.mode,C),j.return=N,j;if(typeof j=="object"&&j!==null){switch(j.$$typeof){case E:return C=Jl(j.type,j.key,j.props,null,N.mode,C),Gi(C,j),C.return=N,C;case k:return j=Qr(j,N.mode,C),j.return=N,j;case w:return j=cs(j),Z(N,j,C)}if(wt(j)||zt(j))return j=ss(j,N.mode,C,null),j.return=N,j;if(typeof j.then=="function")return Z(N,so(j),C);if(j.$$typeof===Y)return Z(N,to(N,j),C);io(N,j)}return null}function M(N,j,C,G){var ft=j!==null?j.key:null;if(typeof C=="string"&&C!==""||typeof C=="number"||typeof C=="bigint")return ft!==null?null:y(N,j,""+C,G);if(typeof C=="object"&&C!==null){switch(C.$$typeof){case E:return C.key===ft?T(N,j,C,G):null;case k:return C.key===ft?D(N,j,C,G):null;case w:return C=cs(C),M(N,j,C,G)}if(wt(C)||zt(C))return ft!==null?null:L(N,j,C,G,null);if(typeof C.then=="function")return M(N,j,so(C),G);if(C.$$typeof===Y)return M(N,j,to(N,C),G);io(N,C)}return null}function O(N,j,C,G,ft){if(typeof G=="string"&&G!==""||typeof G=="number"||typeof G=="bigint")return N=N.get(C)||null,y(j,N,""+G,ft);if(typeof G=="object"&&G!==null){switch(G.$$typeof){case E:return N=N.get(G.key===null?C:G.key)||null,T(j,N,G,ft);case k:return N=N.get(G.key===null?C:G.key)||null,D(j,N,G,ft);case w:return G=cs(G),O(N,j,C,G,ft)}if(wt(G)||zt(G))return N=N.get(C)||null,L(j,N,G,ft,null);if(typeof G.then=="function")return O(N,j,C,so(G),ft);if(G.$$typeof===Y)return O(N,j,C,to(j,G),ft);io(j,G)}return null}function ot(N,j,C,G){for(var ft=null,Lt=null,ut=j,jt=j=0,Ot=null;ut!==null&&jt<C.length;jt++){ut.index>jt?(Ot=ut,ut=null):Ot=ut.sibling;var qt=M(N,ut,C[jt],G);if(qt===null){ut===null&&(ut=Ot);break}t&&ut&&qt.alternate===null&&e(N,ut),j=c(qt,j,jt),Lt===null?ft=qt:Lt.sibling=qt,Lt=qt,ut=Ot}if(jt===C.length)return n(N,ut),Bt&&sa(N,jt),ft;if(ut===null){for(;jt<C.length;jt++)ut=Z(N,C[jt],G),ut!==null&&(j=c(ut,j,jt),Lt===null?ft=ut:Lt.sibling=ut,Lt=ut);return Bt&&sa(N,jt),ft}for(ut=s(ut);jt<C.length;jt++)Ot=O(ut,N,jt,C[jt],G),Ot!==null&&(t&&Ot.alternate!==null&&ut.delete(Ot.key===null?jt:Ot.key),j=c(Ot,j,jt),Lt===null?ft=Ot:Lt.sibling=Ot,Lt=Ot);return t&&ut.forEach(function(Za){return e(N,Za)}),Bt&&sa(N,jt),ft}function pt(N,j,C,G){if(C==null)throw Error(o(151));for(var ft=null,Lt=null,ut=j,jt=j=0,Ot=null,qt=C.next();ut!==null&&!qt.done;jt++,qt=C.next()){ut.index>jt?(Ot=ut,ut=null):Ot=ut.sibling;var Za=M(N,ut,qt.value,G);if(Za===null){ut===null&&(ut=Ot);break}t&&ut&&Za.alternate===null&&e(N,ut),j=c(Za,j,jt),Lt===null?ft=Za:Lt.sibling=Za,Lt=Za,ut=Ot}if(qt.done)return n(N,ut),Bt&&sa(N,jt),ft;if(ut===null){for(;!qt.done;jt++,qt=C.next())qt=Z(N,qt.value,G),qt!==null&&(j=c(qt,j,jt),Lt===null?ft=qt:Lt.sibling=qt,Lt=qt);return Bt&&sa(N,jt),ft}for(ut=s(ut);!qt.done;jt++,qt=C.next())qt=O(ut,N,jt,qt.value,G),qt!==null&&(t&&qt.alternate!==null&&ut.delete(qt.key===null?jt:qt.key),j=c(qt,j,jt),Lt===null?ft=qt:Lt.sibling=qt,Lt=qt);return t&&ut.forEach(function(wb){return e(N,wb)}),Bt&&sa(N,jt),ft}function ne(N,j,C,G){if(typeof C=="object"&&C!==null&&C.type===q&&C.key===null&&(C=C.props.children),typeof C=="object"&&C!==null){switch(C.$$typeof){case E:t:{for(var ft=C.key;j!==null;){if(j.key===ft){if(ft=C.type,ft===q){if(j.tag===7){n(N,j.sibling),G=r(j,C.props.children),G.return=N,N=G;break t}}else if(j.elementType===ft||typeof ft=="object"&&ft!==null&&ft.$$typeof===w&&cs(ft)===j.type){n(N,j.sibling),G=r(j,C.props),Gi(G,C),G.return=N,N=G;break t}n(N,j);break}else e(N,j);j=j.sibling}C.type===q?(G=ss(C.props.children,N.mode,G,C.key),G.return=N,N=G):(G=Jl(C.type,C.key,C.props,null,N.mode,G),Gi(G,C),G.return=N,N=G)}return m(N);case k:t:{for(ft=C.key;j!==null;){if(j.key===ft)if(j.tag===4&&j.stateNode.containerInfo===C.containerInfo&&j.stateNode.implementation===C.implementation){n(N,j.sibling),G=r(j,C.children||[]),G.return=N,N=G;break t}else{n(N,j);break}else e(N,j);j=j.sibling}G=Qr(C,N.mode,G),G.return=N,N=G}return m(N);case w:return C=cs(C),ne(N,j,C,G)}if(wt(C))return ot(N,j,C,G);if(zt(C)){if(ft=zt(C),typeof ft!="function")throw Error(o(150));return C=ft.call(C),pt(N,j,C,G)}if(typeof C.then=="function")return ne(N,j,so(C),G);if(C.$$typeof===Y)return ne(N,j,to(N,C),G);io(N,C)}return typeof C=="string"&&C!==""||typeof C=="number"||typeof C=="bigint"?(C=""+C,j!==null&&j.tag===6?(n(N,j.sibling),G=r(j,C),G.return=N,N=G):(n(N,j),G=Xr(C,N.mode,G),G.return=N,N=G),m(N)):n(N,j)}return function(N,j,C,G){try{Hi=0;var ft=ne(N,j,C,G);return Ks=null,ft}catch(ut){if(ut===Zs||ut===no)throw ut;var Lt=pn(29,ut,null,N.mode);return Lt.lanes=G,Lt.return=N,Lt}finally{}}}var ds=eh(!0),nh=eh(!1),Ca=!1;function lc(t){t.updateQueue={baseState:t.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function oc(t,e){t=t.updateQueue,e.updateQueue===t&&(e.updateQueue={baseState:t.baseState,firstBaseUpdate:t.firstBaseUpdate,lastBaseUpdate:t.lastBaseUpdate,shared:t.shared,callbacks:null})}function Da(t){return{lane:t,tag:0,payload:null,callback:null,next:null}}function ka(t,e,n){var s=t.updateQueue;if(s===null)return null;if(s=s.shared,(It&2)!==0){var r=s.pending;return r===null?e.next=e:(e.next=r.next,r.next=e),s.pending=e,e=Fl(t),Lf(t,null,n),e}return Pl(t,s,e,n),Fl(t)}function Ii(t,e,n){if(e=e.updateQueue,e!==null&&(e=e.shared,(n&4194048)!==0)){var s=e.lanes;s&=t.pendingLanes,n|=s,e.lanes=n,xi(t,n)}}function rc(t,e){var n=t.updateQueue,s=t.alternate;if(s!==null&&(s=s.updateQueue,n===s)){var r=null,c=null;if(n=n.firstBaseUpdate,n!==null){do{var m={lane:n.lane,tag:n.tag,payload:n.payload,callback:null,next:null};c===null?r=c=m:c=c.next=m,n=n.next}while(n!==null);c===null?r=c=e:c=c.next=e}else r=c=e;n={baseState:s.baseState,firstBaseUpdate:r,lastBaseUpdate:c,shared:s.shared,callbacks:s.callbacks},t.updateQueue=n;return}t=n.lastBaseUpdate,t===null?n.firstBaseUpdate=e:t.next=e,n.lastBaseUpdate=e}var cc=!1;function Yi(){if(cc){var t=Ys;if(t!==null)throw t}}function Zi(t,e,n,s){cc=!1;var r=t.updateQueue;Ca=!1;var c=r.firstBaseUpdate,m=r.lastBaseUpdate,y=r.shared.pending;if(y!==null){r.shared.pending=null;var T=y,D=T.next;T.next=null,m===null?c=D:m.next=D,m=T;var L=t.alternate;L!==null&&(L=L.updateQueue,y=L.lastBaseUpdate,y!==m&&(y===null?L.firstBaseUpdate=D:y.next=D,L.lastBaseUpdate=T))}if(c!==null){var Z=r.baseState;m=0,L=D=T=null,y=c;do{var M=y.lane&-536870913,O=M!==y.lane;if(O?(Rt&M)===M:(s&M)===M){M!==0&&M===Is&&(cc=!0),L!==null&&(L=L.next={lane:0,tag:y.tag,payload:y.payload,callback:null,next:null});t:{var ot=t,pt=y;M=e;var ne=n;switch(pt.tag){case 1:if(ot=pt.payload,typeof ot=="function"){Z=ot.call(ne,Z,M);break t}Z=ot;break t;case 3:ot.flags=ot.flags&-65537|128;case 0:if(ot=pt.payload,M=typeof ot=="function"?ot.call(ne,Z,M):ot,M==null)break t;Z=S({},Z,M);break t;case 2:Ca=!0}}M=y.callback,M!==null&&(t.flags|=64,O&&(t.flags|=8192),O=r.callbacks,O===null?r.callbacks=[M]:O.push(M))}else O={lane:M,tag:y.tag,payload:y.payload,callback:y.callback,next:null},L===null?(D=L=O,T=Z):L=L.next=O,m|=M;if(y=y.next,y===null){if(y=r.shared.pending,y===null)break;O=y,y=O.next,O.next=null,r.lastBaseUpdate=O,r.shared.pending=null}}while(!0);L===null&&(T=Z),r.baseState=T,r.firstBaseUpdate=D,r.lastBaseUpdate=L,c===null&&(r.shared.lanes=0),za|=m,t.lanes=m,t.memoizedState=Z}}function ah(t,e){if(typeof t!="function")throw Error(o(191,t));t.call(e)}function sh(t,e){var n=t.callbacks;if(n!==null)for(t.callbacks=null,t=0;t<n.length;t++)ah(n[t],e)}var Xs=Qt(null),lo=Qt(0);function ih(t,e){t=pa,bt(lo,t),bt(Xs,e),pa=t|e.baseLanes}function uc(){bt(lo,pa),bt(Xs,Xs.current)}function dc(){pa=lo.current,yt(Xs),yt(lo)}var gn=Qt(null),kn=null;function wa(t){var e=t.alternate;bt(Te,Te.current&1),bt(gn,t),kn===null&&(e===null||Xs.current!==null||e.memoizedState!==null)&&(kn=t)}function fc(t){bt(Te,Te.current),bt(gn,t),kn===null&&(kn=t)}function lh(t){t.tag===22?(bt(Te,Te.current),bt(gn,t),kn===null&&(kn=t)):Ma()}function Ma(){bt(Te,Te.current),bt(gn,gn.current)}function vn(t){yt(gn),kn===t&&(kn=null),yt(Te)}var Te=Qt(0);function oo(t){for(var e=t;e!==null;){if(e.tag===13){var n=e.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||yu(n)||bu(n)))return e}else if(e.tag===19&&(e.memoizedProps.revealOrder==="forwards"||e.memoizedProps.revealOrder==="backwards"||e.memoizedProps.revealOrder==="unstable_legacy-backwards"||e.memoizedProps.revealOrder==="together")){if((e.flags&128)!==0)return e}else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break;for(;e.sibling===null;){if(e.return===null||e.return===t)return null;e=e.return}e.sibling.return=e.return,e=e.sibling}return null}var oa=0,xt=null,te=null,De=null,ro=!1,Qs=!1,fs=!1,co=0,Ki=0,Ps=null,_1=0;function ye(){throw Error(o(321))}function hc(t,e){if(e===null)return!1;for(var n=0;n<e.length&&n<t.length;n++)if(!mn(t[n],e[n]))return!1;return!0}function mc(t,e,n,s,r,c){return oa=c,xt=e,e.memoizedState=null,e.updateQueue=null,e.lanes=0,B.H=t===null||t.memoizedState===null?Ih:Dc,fs=!1,c=n(s,r),fs=!1,Qs&&(c=rh(e,n,s,r)),oh(t),c}function oh(t){B.H=Pi;var e=te!==null&&te.next!==null;if(oa=0,De=te=xt=null,ro=!1,Ki=0,Ps=null,e)throw Error(o(300));t===null||ke||(t=t.dependencies,t!==null&&Wl(t)&&(ke=!0))}function rh(t,e,n,s){xt=t;var r=0;do{if(Qs&&(Ps=null),Ki=0,Qs=!1,25<=r)throw Error(o(301));if(r+=1,De=te=null,t.updateQueue!=null){var c=t.updateQueue;c.lastEffect=null,c.events=null,c.stores=null,c.memoCache!=null&&(c.memoCache.index=0)}B.H=Yh,c=e(n,s)}while(Qs);return c}function T1(){var t=B.H,e=t.useState()[0];return e=typeof e.then=="function"?Xi(e):e,t=t.useState()[0],(te!==null?te.memoizedState:null)!==t&&(xt.flags|=1024),e}function pc(){var t=co!==0;return co=0,t}function gc(t,e,n){e.updateQueue=t.updateQueue,e.flags&=-2053,t.lanes&=~n}function vc(t){if(ro){for(t=t.memoizedState;t!==null;){var e=t.queue;e!==null&&(e.pending=null),t=t.next}ro=!1}oa=0,De=te=xt=null,Qs=!1,Ki=co=0,Ps=null}function Je(){var t={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return De===null?xt.memoizedState=De=t:De=De.next=t,De}function xe(){if(te===null){var t=xt.alternate;t=t!==null?t.memoizedState:null}else t=te.next;var e=De===null?xt.memoizedState:De.next;if(e!==null)De=e,te=t;else{if(t===null)throw xt.alternate===null?Error(o(467)):Error(o(310));te=t,t={memoizedState:te.memoizedState,baseState:te.baseState,baseQueue:te.baseQueue,queue:te.queue,next:null},De===null?xt.memoizedState=De=t:De=De.next=t}return De}function uo(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Xi(t){var e=Ki;return Ki+=1,Ps===null&&(Ps=[]),t=$f(Ps,t,e),e=xt,(De===null?e.memoizedState:De.next)===null&&(e=e.alternate,B.H=e===null||e.memoizedState===null?Ih:Dc),t}function fo(t){if(t!==null&&typeof t=="object"){if(typeof t.then=="function")return Xi(t);if(t.$$typeof===Y)return Ye(t)}throw Error(o(438,String(t)))}function yc(t){var e=null,n=xt.updateQueue;if(n!==null&&(e=n.memoCache),e==null){var s=xt.alternate;s!==null&&(s=s.updateQueue,s!==null&&(s=s.memoCache,s!=null&&(e={data:s.data.map(function(r){return r.slice()}),index:0})))}if(e==null&&(e={data:[],index:0}),n===null&&(n=uo(),xt.updateQueue=n),n.memoCache=e,n=e.data[e.index],n===void 0)for(n=e.data[e.index]=Array(t),s=0;s<t;s++)n[s]=st;return e.index++,n}function ra(t,e){return typeof e=="function"?e(t):e}function ho(t){var e=xe();return bc(e,te,t)}function bc(t,e,n){var s=t.queue;if(s===null)throw Error(o(311));s.lastRenderedReducer=n;var r=t.baseQueue,c=s.pending;if(c!==null){if(r!==null){var m=r.next;r.next=c.next,c.next=m}e.baseQueue=r=c,s.pending=null}if(c=t.baseState,r===null)t.memoizedState=c;else{e=r.next;var y=m=null,T=null,D=e,L=!1;do{var Z=D.lane&-536870913;if(Z!==D.lane?(Rt&Z)===Z:(oa&Z)===Z){var M=D.revertLane;if(M===0)T!==null&&(T=T.next={lane:0,revertLane:0,gesture:null,action:D.action,hasEagerState:D.hasEagerState,eagerState:D.eagerState,next:null}),Z===Is&&(L=!0);else if((oa&M)===M){D=D.next,M===Is&&(L=!0);continue}else Z={lane:0,revertLane:D.revertLane,gesture:null,action:D.action,hasEagerState:D.hasEagerState,eagerState:D.eagerState,next:null},T===null?(y=T=Z,m=c):T=T.next=Z,xt.lanes|=M,za|=M;Z=D.action,fs&&n(c,Z),c=D.hasEagerState?D.eagerState:n(c,Z)}else M={lane:Z,revertLane:D.revertLane,gesture:D.gesture,action:D.action,hasEagerState:D.hasEagerState,eagerState:D.eagerState,next:null},T===null?(y=T=M,m=c):T=T.next=M,xt.lanes|=Z,za|=Z;D=D.next}while(D!==null&&D!==e);if(T===null?m=c:T.next=y,!mn(c,t.memoizedState)&&(ke=!0,L&&(n=Ys,n!==null)))throw n;t.memoizedState=c,t.baseState=m,t.baseQueue=T,s.lastRenderedState=c}return r===null&&(s.lanes=0),[t.memoizedState,s.dispatch]}function Sc(t){var e=xe(),n=e.queue;if(n===null)throw Error(o(311));n.lastRenderedReducer=t;var s=n.dispatch,r=n.pending,c=e.memoizedState;if(r!==null){n.pending=null;var m=r=r.next;do c=t(c,m.action),m=m.next;while(m!==r);mn(c,e.memoizedState)||(ke=!0),e.memoizedState=c,e.baseQueue===null&&(e.baseState=c),n.lastRenderedState=c}return[c,s]}function ch(t,e,n){var s=xt,r=xe(),c=Bt;if(c){if(n===void 0)throw Error(o(407));n=n()}else n=e();var m=!mn((te||r).memoizedState,n);if(m&&(r.memoizedState=n,ke=!0),r=r.queue,xc(fh.bind(null,s,r,t),[t]),r.getSnapshot!==e||m||De!==null&&De.memoizedState.tag&1){if(s.flags|=2048,Fs(9,{destroy:void 0},dh.bind(null,s,r,n,e),null),se===null)throw Error(o(349));c||(oa&127)!==0||uh(s,e,n)}return n}function uh(t,e,n){t.flags|=16384,t={getSnapshot:e,value:n},e=xt.updateQueue,e===null?(e=uo(),xt.updateQueue=e,e.stores=[t]):(n=e.stores,n===null?e.stores=[t]:n.push(t))}function dh(t,e,n,s){e.value=n,e.getSnapshot=s,hh(e)&&mh(t)}function fh(t,e,n){return n(function(){hh(e)&&mh(t)})}function hh(t){var e=t.getSnapshot;t=t.value;try{var n=e();return!mn(t,n)}catch{return!0}}function mh(t){var e=as(t,2);e!==null&&dn(e,t,2)}function _c(t){var e=Je();if(typeof t=="function"){var n=t;if(t=n(),fs){nn(!0);try{n()}finally{nn(!1)}}}return e.memoizedState=e.baseState=t,e.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:ra,lastRenderedState:t},e}function ph(t,e,n,s){return t.baseState=n,bc(t,te,typeof s=="function"?s:ra)}function x1(t,e,n,s,r){if(go(t))throw Error(o(485));if(t=e.action,t!==null){var c={payload:r,action:t,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(m){c.listeners.push(m)}};B.T!==null?n(!0):c.isTransition=!1,s(c),n=e.pending,n===null?(c.next=e.pending=c,gh(e,c)):(c.next=n.next,e.pending=n.next=c)}}function gh(t,e){var n=e.action,s=e.payload,r=t.state;if(e.isTransition){var c=B.T,m={};B.T=m;try{var y=n(r,s),T=B.S;T!==null&&T(m,y),vh(t,e,y)}catch(D){Tc(t,e,D)}finally{c!==null&&m.types!==null&&(c.types=m.types),B.T=c}}else try{c=n(r,s),vh(t,e,c)}catch(D){Tc(t,e,D)}}function vh(t,e,n){n!==null&&typeof n=="object"&&typeof n.then=="function"?n.then(function(s){yh(t,e,s)},function(s){return Tc(t,e,s)}):yh(t,e,n)}function yh(t,e,n){e.status="fulfilled",e.value=n,bh(e),t.state=n,e=t.pending,e!==null&&(n=e.next,n===e?t.pending=null:(n=n.next,e.next=n,gh(t,n)))}function Tc(t,e,n){var s=t.pending;if(t.pending=null,s!==null){s=s.next;do e.status="rejected",e.reason=n,bh(e),e=e.next;while(e!==s)}t.action=null}function bh(t){t=t.listeners;for(var e=0;e<t.length;e++)(0,t[e])()}function Sh(t,e){return e}function _h(t,e){if(Bt){var n=se.formState;if(n!==null){t:{var s=xt;if(Bt){if(re){e:{for(var r=re,c=Dn;r.nodeType!==8;){if(!c){r=null;break e}if(r=wn(r.nextSibling),r===null){r=null;break e}}c=r.data,r=c==="F!"||c==="F"?r:null}if(r){re=wn(r.nextSibling),s=r.data==="F!";break t}}Na(s)}s=!1}s&&(e=n[0])}}return n=Je(),n.memoizedState=n.baseState=e,s={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Sh,lastRenderedState:e},n.queue=s,n=qh.bind(null,xt,s),s.dispatch=n,s=_c(!1),c=Cc.bind(null,xt,!1,s.queue),s=Je(),r={state:e,dispatch:null,action:t,pending:null},s.queue=r,n=x1.bind(null,xt,r,c,n),r.dispatch=n,s.memoizedState=t,[e,n,!1]}function Th(t){var e=xe();return xh(e,te,t)}function xh(t,e,n){if(e=bc(t,e,Sh)[0],t=ho(ra)[0],typeof e=="object"&&e!==null&&typeof e.then=="function")try{var s=Xi(e)}catch(m){throw m===Zs?no:m}else s=e;e=xe();var r=e.queue,c=r.dispatch;return n!==e.memoizedState&&(xt.flags|=2048,Fs(9,{destroy:void 0},j1.bind(null,r,n),null)),[s,c,t]}function j1(t,e){t.action=e}function jh(t){var e=xe(),n=te;if(n!==null)return xh(e,n,t);xe(),e=e.memoizedState,n=xe();var s=n.queue.dispatch;return n.memoizedState=t,[e,s,!1]}function Fs(t,e,n,s){return t={tag:t,create:n,deps:s,inst:e,next:null},e=xt.updateQueue,e===null&&(e=uo(),xt.updateQueue=e),n=e.lastEffect,n===null?e.lastEffect=t.next=t:(s=n.next,n.next=t,t.next=s,e.lastEffect=t),t}function Ah(){return xe().memoizedState}function mo(t,e,n,s){var r=Je();xt.flags|=t,r.memoizedState=Fs(1|e,{destroy:void 0},n,s===void 0?null:s)}function po(t,e,n,s){var r=xe();s=s===void 0?null:s;var c=r.memoizedState.inst;te!==null&&s!==null&&hc(s,te.memoizedState.deps)?r.memoizedState=Fs(e,c,n,s):(xt.flags|=t,r.memoizedState=Fs(1|e,c,n,s))}function Nh(t,e){mo(8390656,8,t,e)}function xc(t,e){po(2048,8,t,e)}function A1(t){xt.flags|=4;var e=xt.updateQueue;if(e===null)e=uo(),xt.updateQueue=e,e.events=[t];else{var n=e.events;n===null?e.events=[t]:n.push(t)}}function Eh(t){var e=xe().memoizedState;return A1({ref:e,nextImpl:t}),function(){if((It&2)!==0)throw Error(o(440));return e.impl.apply(void 0,arguments)}}function Ch(t,e){return po(4,2,t,e)}function Dh(t,e){return po(4,4,t,e)}function kh(t,e){if(typeof e=="function"){t=t();var n=e(t);return function(){typeof n=="function"?n():e(null)}}if(e!=null)return t=t(),e.current=t,function(){e.current=null}}function wh(t,e,n){n=n!=null?n.concat([t]):null,po(4,4,kh.bind(null,e,t),n)}function jc(){}function Mh(t,e){var n=xe();e=e===void 0?null:e;var s=n.memoizedState;return e!==null&&hc(e,s[1])?s[0]:(n.memoizedState=[t,e],t)}function Rh(t,e){var n=xe();e=e===void 0?null:e;var s=n.memoizedState;if(e!==null&&hc(e,s[1]))return s[0];if(s=t(),fs){nn(!0);try{t()}finally{nn(!1)}}return n.memoizedState=[s,e],s}function Ac(t,e,n){return n===void 0||(oa&1073741824)!==0&&(Rt&261930)===0?t.memoizedState=e:(t.memoizedState=n,t=Om(),xt.lanes|=t,za|=t,n)}function Oh(t,e,n,s){return mn(n,e)?n:Xs.current!==null?(t=Ac(t,n,s),mn(t,e)||(ke=!0),t):(oa&42)===0||(oa&1073741824)!==0&&(Rt&261930)===0?(ke=!0,t.memoizedState=n):(t=Om(),xt.lanes|=t,za|=t,e)}function zh(t,e,n,s,r){var c=Q.p;Q.p=c!==0&&8>c?c:8;var m=B.T,y={};B.T=y,Cc(t,!1,e,n);try{var T=r(),D=B.S;if(D!==null&&D(y,T),T!==null&&typeof T=="object"&&typeof T.then=="function"){var L=S1(T,s);Qi(t,e,L,Sn(t))}else Qi(t,e,s,Sn(t))}catch(Z){Qi(t,e,{then:function(){},status:"rejected",reason:Z},Sn())}finally{Q.p=c,m!==null&&y.types!==null&&(m.types=y.types),B.T=m}}function N1(){}function Nc(t,e,n,s){if(t.tag!==5)throw Error(o(476));var r=Bh(t).queue;zh(t,r,e,lt,n===null?N1:function(){return Uh(t),n(s)})}function Bh(t){var e=t.memoizedState;if(e!==null)return e;e={memoizedState:lt,baseState:lt,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ra,lastRenderedState:lt},next:null};var n={};return e.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ra,lastRenderedState:n},next:null},t.memoizedState=e,t=t.alternate,t!==null&&(t.memoizedState=e),e}function Uh(t){var e=Bh(t);e.next===null&&(e=t.alternate.memoizedState),Qi(t,e.next.queue,{},Sn())}function Ec(){return Ye(dl)}function Vh(){return xe().memoizedState}function Lh(){return xe().memoizedState}function E1(t){for(var e=t.return;e!==null;){switch(e.tag){case 24:case 3:var n=Sn();t=Da(n);var s=ka(e,t,n);s!==null&&(dn(s,e,n),Ii(s,e,n)),e={cache:nc()},t.payload=e;return}e=e.return}}function C1(t,e,n){var s=Sn();n={lane:s,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},go(t)?Hh(e,n):(n=Zr(t,e,n,s),n!==null&&(dn(n,t,s),Gh(n,e,s)))}function qh(t,e,n){var s=Sn();Qi(t,e,n,s)}function Qi(t,e,n,s){var r={lane:s,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(go(t))Hh(e,r);else{var c=t.alternate;if(t.lanes===0&&(c===null||c.lanes===0)&&(c=e.lastRenderedReducer,c!==null))try{var m=e.lastRenderedState,y=c(m,n);if(r.hasEagerState=!0,r.eagerState=y,mn(y,m))return Pl(t,e,r,0),se===null&&Ql(),!1}catch{}finally{}if(n=Zr(t,e,r,s),n!==null)return dn(n,t,s),Gh(n,e,s),!0}return!1}function Cc(t,e,n,s){if(s={lane:2,revertLane:lu(),gesture:null,action:s,hasEagerState:!1,eagerState:null,next:null},go(t)){if(e)throw Error(o(479))}else e=Zr(t,n,s,2),e!==null&&dn(e,t,2)}function go(t){var e=t.alternate;return t===xt||e!==null&&e===xt}function Hh(t,e){Qs=ro=!0;var n=t.pending;n===null?e.next=e:(e.next=n.next,n.next=e),t.pending=e}function Gh(t,e,n){if((n&4194048)!==0){var s=e.lanes;s&=t.pendingLanes,n|=s,e.lanes=n,xi(t,n)}}var Pi={readContext:Ye,use:fo,useCallback:ye,useContext:ye,useEffect:ye,useImperativeHandle:ye,useLayoutEffect:ye,useInsertionEffect:ye,useMemo:ye,useReducer:ye,useRef:ye,useState:ye,useDebugValue:ye,useDeferredValue:ye,useTransition:ye,useSyncExternalStore:ye,useId:ye,useHostTransitionStatus:ye,useFormState:ye,useActionState:ye,useOptimistic:ye,useMemoCache:ye,useCacheRefresh:ye};Pi.useEffectEvent=ye;var Ih={readContext:Ye,use:fo,useCallback:function(t,e){return Je().memoizedState=[t,e===void 0?null:e],t},useContext:Ye,useEffect:Nh,useImperativeHandle:function(t,e,n){n=n!=null?n.concat([t]):null,mo(4194308,4,kh.bind(null,e,t),n)},useLayoutEffect:function(t,e){return mo(4194308,4,t,e)},useInsertionEffect:function(t,e){mo(4,2,t,e)},useMemo:function(t,e){var n=Je();e=e===void 0?null:e;var s=t();if(fs){nn(!0);try{t()}finally{nn(!1)}}return n.memoizedState=[s,e],s},useReducer:function(t,e,n){var s=Je();if(n!==void 0){var r=n(e);if(fs){nn(!0);try{n(e)}finally{nn(!1)}}}else r=e;return s.memoizedState=s.baseState=r,t={pending:null,lanes:0,dispatch:null,lastRenderedReducer:t,lastRenderedState:r},s.queue=t,t=t.dispatch=C1.bind(null,xt,t),[s.memoizedState,t]},useRef:function(t){var e=Je();return t={current:t},e.memoizedState=t},useState:function(t){t=_c(t);var e=t.queue,n=qh.bind(null,xt,e);return e.dispatch=n,[t.memoizedState,n]},useDebugValue:jc,useDeferredValue:function(t,e){var n=Je();return Ac(n,t,e)},useTransition:function(){var t=_c(!1);return t=zh.bind(null,xt,t.queue,!0,!1),Je().memoizedState=t,[!1,t]},useSyncExternalStore:function(t,e,n){var s=xt,r=Je();if(Bt){if(n===void 0)throw Error(o(407));n=n()}else{if(n=e(),se===null)throw Error(o(349));(Rt&127)!==0||uh(s,e,n)}r.memoizedState=n;var c={value:n,getSnapshot:e};return r.queue=c,Nh(fh.bind(null,s,c,t),[t]),s.flags|=2048,Fs(9,{destroy:void 0},dh.bind(null,s,c,n,e),null),n},useId:function(){var t=Je(),e=se.identifierPrefix;if(Bt){var n=Yn,s=In;n=(s&~(1<<32-J(s)-1)).toString(32)+n,e="_"+e+"R_"+n,n=co++,0<n&&(e+="H"+n.toString(32)),e+="_"}else n=_1++,e="_"+e+"r_"+n.toString(32)+"_";return t.memoizedState=e},useHostTransitionStatus:Ec,useFormState:_h,useActionState:_h,useOptimistic:function(t){var e=Je();e.memoizedState=e.baseState=t;var n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return e.queue=n,e=Cc.bind(null,xt,!0,n),n.dispatch=e,[t,e]},useMemoCache:yc,useCacheRefresh:function(){return Je().memoizedState=E1.bind(null,xt)},useEffectEvent:function(t){var e=Je(),n={impl:t};return e.memoizedState=n,function(){if((It&2)!==0)throw Error(o(440));return n.impl.apply(void 0,arguments)}}},Dc={readContext:Ye,use:fo,useCallback:Mh,useContext:Ye,useEffect:xc,useImperativeHandle:wh,useInsertionEffect:Ch,useLayoutEffect:Dh,useMemo:Rh,useReducer:ho,useRef:Ah,useState:function(){return ho(ra)},useDebugValue:jc,useDeferredValue:function(t,e){var n=xe();return Oh(n,te.memoizedState,t,e)},useTransition:function(){var t=ho(ra)[0],e=xe().memoizedState;return[typeof t=="boolean"?t:Xi(t),e]},useSyncExternalStore:ch,useId:Vh,useHostTransitionStatus:Ec,useFormState:Th,useActionState:Th,useOptimistic:function(t,e){var n=xe();return ph(n,te,t,e)},useMemoCache:yc,useCacheRefresh:Lh};Dc.useEffectEvent=Eh;var Yh={readContext:Ye,use:fo,useCallback:Mh,useContext:Ye,useEffect:xc,useImperativeHandle:wh,useInsertionEffect:Ch,useLayoutEffect:Dh,useMemo:Rh,useReducer:Sc,useRef:Ah,useState:function(){return Sc(ra)},useDebugValue:jc,useDeferredValue:function(t,e){var n=xe();return te===null?Ac(n,t,e):Oh(n,te.memoizedState,t,e)},useTransition:function(){var t=Sc(ra)[0],e=xe().memoizedState;return[typeof t=="boolean"?t:Xi(t),e]},useSyncExternalStore:ch,useId:Vh,useHostTransitionStatus:Ec,useFormState:jh,useActionState:jh,useOptimistic:function(t,e){var n=xe();return te!==null?ph(n,te,t,e):(n.baseState=t,[t,n.queue.dispatch])},useMemoCache:yc,useCacheRefresh:Lh};Yh.useEffectEvent=Eh;function kc(t,e,n,s){e=t.memoizedState,n=n(s,e),n=n==null?e:S({},e,n),t.memoizedState=n,t.lanes===0&&(t.updateQueue.baseState=n)}var wc={enqueueSetState:function(t,e,n){t=t._reactInternals;var s=Sn(),r=Da(s);r.payload=e,n!=null&&(r.callback=n),e=ka(t,r,s),e!==null&&(dn(e,t,s),Ii(e,t,s))},enqueueReplaceState:function(t,e,n){t=t._reactInternals;var s=Sn(),r=Da(s);r.tag=1,r.payload=e,n!=null&&(r.callback=n),e=ka(t,r,s),e!==null&&(dn(e,t,s),Ii(e,t,s))},enqueueForceUpdate:function(t,e){t=t._reactInternals;var n=Sn(),s=Da(n);s.tag=2,e!=null&&(s.callback=e),e=ka(t,s,n),e!==null&&(dn(e,t,n),Ii(e,t,n))}};function Zh(t,e,n,s,r,c,m){return t=t.stateNode,typeof t.shouldComponentUpdate=="function"?t.shouldComponentUpdate(s,c,m):e.prototype&&e.prototype.isPureReactComponent?!zi(n,s)||!zi(r,c):!0}function Kh(t,e,n,s){t=e.state,typeof e.componentWillReceiveProps=="function"&&e.componentWillReceiveProps(n,s),typeof e.UNSAFE_componentWillReceiveProps=="function"&&e.UNSAFE_componentWillReceiveProps(n,s),e.state!==t&&wc.enqueueReplaceState(e,e.state,null)}function hs(t,e){var n=e;if("ref"in e){n={};for(var s in e)s!=="ref"&&(n[s]=e[s])}if(t=t.defaultProps){n===e&&(n=S({},n));for(var r in t)n[r]===void 0&&(n[r]=t[r])}return n}function Xh(t){Xl(t)}function Qh(t){console.error(t)}function Ph(t){Xl(t)}function vo(t,e){try{var n=t.onUncaughtError;n(e.value,{componentStack:e.stack})}catch(s){setTimeout(function(){throw s})}}function Fh(t,e,n){try{var s=t.onCaughtError;s(n.value,{componentStack:n.stack,errorBoundary:e.tag===1?e.stateNode:null})}catch(r){setTimeout(function(){throw r})}}function Mc(t,e,n){return n=Da(n),n.tag=3,n.payload={element:null},n.callback=function(){vo(t,e)},n}function Jh(t){return t=Da(t),t.tag=3,t}function $h(t,e,n,s){var r=n.type.getDerivedStateFromError;if(typeof r=="function"){var c=s.value;t.payload=function(){return r(c)},t.callback=function(){Fh(e,n,s)}}var m=n.stateNode;m!==null&&typeof m.componentDidCatch=="function"&&(t.callback=function(){Fh(e,n,s),typeof r!="function"&&(Ba===null?Ba=new Set([this]):Ba.add(this));var y=s.stack;this.componentDidCatch(s.value,{componentStack:y!==null?y:""})})}function D1(t,e,n,s,r){if(n.flags|=32768,s!==null&&typeof s=="object"&&typeof s.then=="function"){if(e=n.alternate,e!==null&&Gs(e,n,r,!0),n=gn.current,n!==null){switch(n.tag){case 31:case 13:return kn===null?Do():n.alternate===null&&be===0&&(be=3),n.flags&=-257,n.flags|=65536,n.lanes=r,s===ao?n.flags|=16384:(e=n.updateQueue,e===null?n.updateQueue=new Set([s]):e.add(s),au(t,s,r)),!1;case 22:return n.flags|=65536,s===ao?n.flags|=16384:(e=n.updateQueue,e===null?(e={transitions:null,markerInstances:null,retryQueue:new Set([s])},n.updateQueue=e):(n=e.retryQueue,n===null?e.retryQueue=new Set([s]):n.add(s)),au(t,s,r)),!1}throw Error(o(435,n.tag))}return au(t,s,r),Do(),!1}if(Bt)return e=gn.current,e!==null?((e.flags&65536)===0&&(e.flags|=256),e.flags|=65536,e.lanes=r,s!==Jr&&(t=Error(o(422),{cause:s}),Vi(Nn(t,n)))):(s!==Jr&&(e=Error(o(423),{cause:s}),Vi(Nn(e,n))),t=t.current.alternate,t.flags|=65536,r&=-r,t.lanes|=r,s=Nn(s,n),r=Mc(t.stateNode,s,r),rc(t,r),be!==4&&(be=2)),!1;var c=Error(o(520),{cause:s});if(c=Nn(c,n),al===null?al=[c]:al.push(c),be!==4&&(be=2),e===null)return!0;s=Nn(s,n),n=e;do{switch(n.tag){case 3:return n.flags|=65536,t=r&-r,n.lanes|=t,t=Mc(n.stateNode,s,t),rc(n,t),!1;case 1:if(e=n.type,c=n.stateNode,(n.flags&128)===0&&(typeof e.getDerivedStateFromError=="function"||c!==null&&typeof c.componentDidCatch=="function"&&(Ba===null||!Ba.has(c))))return n.flags|=65536,r&=-r,n.lanes|=r,r=Jh(r),$h(r,t,n,s),rc(n,r),!1}n=n.return}while(n!==null);return!1}var Rc=Error(o(461)),ke=!1;function Ze(t,e,n,s){e.child=t===null?nh(e,null,n,s):ds(e,t.child,n,s)}function Wh(t,e,n,s,r){n=n.render;var c=e.ref;if("ref"in s){var m={};for(var y in s)y!=="ref"&&(m[y]=s[y])}else m=s;return os(e),s=mc(t,e,n,m,c,r),y=pc(),t!==null&&!ke?(gc(t,e,r),ca(t,e,r)):(Bt&&y&&Pr(e),e.flags|=1,Ze(t,e,s,r),e.child)}function tm(t,e,n,s,r){if(t===null){var c=n.type;return typeof c=="function"&&!Kr(c)&&c.defaultProps===void 0&&n.compare===null?(e.tag=15,e.type=c,em(t,e,c,s,r)):(t=Jl(n.type,null,s,e,e.mode,r),t.ref=e.ref,t.return=e,e.child=t)}if(c=t.child,!Hc(t,r)){var m=c.memoizedProps;if(n=n.compare,n=n!==null?n:zi,n(m,s)&&t.ref===e.ref)return ca(t,e,r)}return e.flags|=1,t=aa(c,s),t.ref=e.ref,t.return=e,e.child=t}function em(t,e,n,s,r){if(t!==null){var c=t.memoizedProps;if(zi(c,s)&&t.ref===e.ref)if(ke=!1,e.pendingProps=s=c,Hc(t,r))(t.flags&131072)!==0&&(ke=!0);else return e.lanes=t.lanes,ca(t,e,r)}return Oc(t,e,n,s,r)}function nm(t,e,n,s){var r=s.children,c=t!==null?t.memoizedState:null;if(t===null&&e.stateNode===null&&(e.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),s.mode==="hidden"){if((e.flags&128)!==0){if(c=c!==null?c.baseLanes|n:n,t!==null){for(s=e.child=t.child,r=0;s!==null;)r=r|s.lanes|s.childLanes,s=s.sibling;s=r&~c}else s=0,e.child=null;return am(t,e,c,n,s)}if((n&536870912)!==0)e.memoizedState={baseLanes:0,cachePool:null},t!==null&&eo(e,c!==null?c.cachePool:null),c!==null?ih(e,c):uc(),lh(e);else return s=e.lanes=536870912,am(t,e,c!==null?c.baseLanes|n:n,n,s)}else c!==null?(eo(e,c.cachePool),ih(e,c),Ma(),e.memoizedState=null):(t!==null&&eo(e,null),uc(),Ma());return Ze(t,e,r,n),e.child}function Fi(t,e){return t!==null&&t.tag===22||e.stateNode!==null||(e.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),e.sibling}function am(t,e,n,s,r){var c=sc();return c=c===null?null:{parent:Ce._currentValue,pool:c},e.memoizedState={baseLanes:n,cachePool:c},t!==null&&eo(e,null),uc(),lh(e),t!==null&&Gs(t,e,s,!0),e.childLanes=r,null}function yo(t,e){return e=So({mode:e.mode,children:e.children},t.mode),e.ref=t.ref,t.child=e,e.return=t,e}function sm(t,e,n){return ds(e,t.child,null,n),t=yo(e,e.pendingProps),t.flags|=2,vn(e),e.memoizedState=null,t}function k1(t,e,n){var s=e.pendingProps,r=(e.flags&128)!==0;if(e.flags&=-129,t===null){if(Bt){if(s.mode==="hidden")return t=yo(e,s),e.lanes=536870912,Fi(null,t);if(fc(e),(t=re)?(t=gp(t,Dn),t=t!==null&&t.data==="&"?t:null,t!==null&&(e.memoizedState={dehydrated:t,treeContext:ja!==null?{id:In,overflow:Yn}:null,retryLane:536870912,hydrationErrors:null},n=Hf(t),n.return=e,e.child=n,Ie=e,re=null)):t=null,t===null)throw Na(e);return e.lanes=536870912,null}return yo(e,s)}var c=t.memoizedState;if(c!==null){var m=c.dehydrated;if(fc(e),r)if(e.flags&256)e.flags&=-257,e=sm(t,e,n);else if(e.memoizedState!==null)e.child=t.child,e.flags|=128,e=null;else throw Error(o(558));else if(ke||Gs(t,e,n,!1),r=(n&t.childLanes)!==0,ke||r){if(s=se,s!==null&&(m=ji(s,n),m!==0&&m!==c.retryLane))throw c.retryLane=m,as(t,m),dn(s,t,m),Rc;Do(),e=sm(t,e,n)}else t=c.treeContext,re=wn(m.nextSibling),Ie=e,Bt=!0,Aa=null,Dn=!1,t!==null&&Yf(e,t),e=yo(e,s),e.flags|=4096;return e}return t=aa(t.child,{mode:s.mode,children:s.children}),t.ref=e.ref,e.child=t,t.return=e,t}function bo(t,e){var n=e.ref;if(n===null)t!==null&&t.ref!==null&&(e.flags|=4194816);else{if(typeof n!="function"&&typeof n!="object")throw Error(o(284));(t===null||t.ref!==n)&&(e.flags|=4194816)}}function Oc(t,e,n,s,r){return os(e),n=mc(t,e,n,s,void 0,r),s=pc(),t!==null&&!ke?(gc(t,e,r),ca(t,e,r)):(Bt&&s&&Pr(e),e.flags|=1,Ze(t,e,n,r),e.child)}function im(t,e,n,s,r,c){return os(e),e.updateQueue=null,n=rh(e,s,n,r),oh(t),s=pc(),t!==null&&!ke?(gc(t,e,c),ca(t,e,c)):(Bt&&s&&Pr(e),e.flags|=1,Ze(t,e,n,c),e.child)}function lm(t,e,n,s,r){if(os(e),e.stateNode===null){var c=Vs,m=n.contextType;typeof m=="object"&&m!==null&&(c=Ye(m)),c=new n(s,c),e.memoizedState=c.state!==null&&c.state!==void 0?c.state:null,c.updater=wc,e.stateNode=c,c._reactInternals=e,c=e.stateNode,c.props=s,c.state=e.memoizedState,c.refs={},lc(e),m=n.contextType,c.context=typeof m=="object"&&m!==null?Ye(m):Vs,c.state=e.memoizedState,m=n.getDerivedStateFromProps,typeof m=="function"&&(kc(e,n,m,s),c.state=e.memoizedState),typeof n.getDerivedStateFromProps=="function"||typeof c.getSnapshotBeforeUpdate=="function"||typeof c.UNSAFE_componentWillMount!="function"&&typeof c.componentWillMount!="function"||(m=c.state,typeof c.componentWillMount=="function"&&c.componentWillMount(),typeof c.UNSAFE_componentWillMount=="function"&&c.UNSAFE_componentWillMount(),m!==c.state&&wc.enqueueReplaceState(c,c.state,null),Zi(e,s,c,r),Yi(),c.state=e.memoizedState),typeof c.componentDidMount=="function"&&(e.flags|=4194308),s=!0}else if(t===null){c=e.stateNode;var y=e.memoizedProps,T=hs(n,y);c.props=T;var D=c.context,L=n.contextType;m=Vs,typeof L=="object"&&L!==null&&(m=Ye(L));var Z=n.getDerivedStateFromProps;L=typeof Z=="function"||typeof c.getSnapshotBeforeUpdate=="function",y=e.pendingProps!==y,L||typeof c.UNSAFE_componentWillReceiveProps!="function"&&typeof c.componentWillReceiveProps!="function"||(y||D!==m)&&Kh(e,c,s,m),Ca=!1;var M=e.memoizedState;c.state=M,Zi(e,s,c,r),Yi(),D=e.memoizedState,y||M!==D||Ca?(typeof Z=="function"&&(kc(e,n,Z,s),D=e.memoizedState),(T=Ca||Zh(e,n,T,s,M,D,m))?(L||typeof c.UNSAFE_componentWillMount!="function"&&typeof c.componentWillMount!="function"||(typeof c.componentWillMount=="function"&&c.componentWillMount(),typeof c.UNSAFE_componentWillMount=="function"&&c.UNSAFE_componentWillMount()),typeof c.componentDidMount=="function"&&(e.flags|=4194308)):(typeof c.componentDidMount=="function"&&(e.flags|=4194308),e.memoizedProps=s,e.memoizedState=D),c.props=s,c.state=D,c.context=m,s=T):(typeof c.componentDidMount=="function"&&(e.flags|=4194308),s=!1)}else{c=e.stateNode,oc(t,e),m=e.memoizedProps,L=hs(n,m),c.props=L,Z=e.pendingProps,M=c.context,D=n.contextType,T=Vs,typeof D=="object"&&D!==null&&(T=Ye(D)),y=n.getDerivedStateFromProps,(D=typeof y=="function"||typeof c.getSnapshotBeforeUpdate=="function")||typeof c.UNSAFE_componentWillReceiveProps!="function"&&typeof c.componentWillReceiveProps!="function"||(m!==Z||M!==T)&&Kh(e,c,s,T),Ca=!1,M=e.memoizedState,c.state=M,Zi(e,s,c,r),Yi();var O=e.memoizedState;m!==Z||M!==O||Ca||t!==null&&t.dependencies!==null&&Wl(t.dependencies)?(typeof y=="function"&&(kc(e,n,y,s),O=e.memoizedState),(L=Ca||Zh(e,n,L,s,M,O,T)||t!==null&&t.dependencies!==null&&Wl(t.dependencies))?(D||typeof c.UNSAFE_componentWillUpdate!="function"&&typeof c.componentWillUpdate!="function"||(typeof c.componentWillUpdate=="function"&&c.componentWillUpdate(s,O,T),typeof c.UNSAFE_componentWillUpdate=="function"&&c.UNSAFE_componentWillUpdate(s,O,T)),typeof c.componentDidUpdate=="function"&&(e.flags|=4),typeof c.getSnapshotBeforeUpdate=="function"&&(e.flags|=1024)):(typeof c.componentDidUpdate!="function"||m===t.memoizedProps&&M===t.memoizedState||(e.flags|=4),typeof c.getSnapshotBeforeUpdate!="function"||m===t.memoizedProps&&M===t.memoizedState||(e.flags|=1024),e.memoizedProps=s,e.memoizedState=O),c.props=s,c.state=O,c.context=T,s=L):(typeof c.componentDidUpdate!="function"||m===t.memoizedProps&&M===t.memoizedState||(e.flags|=4),typeof c.getSnapshotBeforeUpdate!="function"||m===t.memoizedProps&&M===t.memoizedState||(e.flags|=1024),s=!1)}return c=s,bo(t,e),s=(e.flags&128)!==0,c||s?(c=e.stateNode,n=s&&typeof n.getDerivedStateFromError!="function"?null:c.render(),e.flags|=1,t!==null&&s?(e.child=ds(e,t.child,null,r),e.child=ds(e,null,n,r)):Ze(t,e,n,r),e.memoizedState=c.state,t=e.child):t=ca(t,e,r),t}function om(t,e,n,s){return is(),e.flags|=256,Ze(t,e,n,s),e.child}var zc={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Bc(t){return{baseLanes:t,cachePool:Ff()}}function Uc(t,e,n){return t=t!==null?t.childLanes&~n:0,e&&(t|=bn),t}function rm(t,e,n){var s=e.pendingProps,r=!1,c=(e.flags&128)!==0,m;if((m=c)||(m=t!==null&&t.memoizedState===null?!1:(Te.current&2)!==0),m&&(r=!0,e.flags&=-129),m=(e.flags&32)!==0,e.flags&=-33,t===null){if(Bt){if(r?wa(e):Ma(),(t=re)?(t=gp(t,Dn),t=t!==null&&t.data!=="&"?t:null,t!==null&&(e.memoizedState={dehydrated:t,treeContext:ja!==null?{id:In,overflow:Yn}:null,retryLane:536870912,hydrationErrors:null},n=Hf(t),n.return=e,e.child=n,Ie=e,re=null)):t=null,t===null)throw Na(e);return bu(t)?e.lanes=32:e.lanes=536870912,null}var y=s.children;return s=s.fallback,r?(Ma(),r=e.mode,y=So({mode:"hidden",children:y},r),s=ss(s,r,n,null),y.return=e,s.return=e,y.sibling=s,e.child=y,s=e.child,s.memoizedState=Bc(n),s.childLanes=Uc(t,m,n),e.memoizedState=zc,Fi(null,s)):(wa(e),Vc(e,y))}var T=t.memoizedState;if(T!==null&&(y=T.dehydrated,y!==null)){if(c)e.flags&256?(wa(e),e.flags&=-257,e=Lc(t,e,n)):e.memoizedState!==null?(Ma(),e.child=t.child,e.flags|=128,e=null):(Ma(),y=s.fallback,r=e.mode,s=So({mode:"visible",children:s.children},r),y=ss(y,r,n,null),y.flags|=2,s.return=e,y.return=e,s.sibling=y,e.child=s,ds(e,t.child,null,n),s=e.child,s.memoizedState=Bc(n),s.childLanes=Uc(t,m,n),e.memoizedState=zc,e=Fi(null,s));else if(wa(e),bu(y)){if(m=y.nextSibling&&y.nextSibling.dataset,m)var D=m.dgst;m=D,s=Error(o(419)),s.stack="",s.digest=m,Vi({value:s,source:null,stack:null}),e=Lc(t,e,n)}else if(ke||Gs(t,e,n,!1),m=(n&t.childLanes)!==0,ke||m){if(m=se,m!==null&&(s=ji(m,n),s!==0&&s!==T.retryLane))throw T.retryLane=s,as(t,s),dn(m,t,s),Rc;yu(y)||Do(),e=Lc(t,e,n)}else yu(y)?(e.flags|=192,e.child=t.child,e=null):(t=T.treeContext,re=wn(y.nextSibling),Ie=e,Bt=!0,Aa=null,Dn=!1,t!==null&&Yf(e,t),e=Vc(e,s.children),e.flags|=4096);return e}return r?(Ma(),y=s.fallback,r=e.mode,T=t.child,D=T.sibling,s=aa(T,{mode:"hidden",children:s.children}),s.subtreeFlags=T.subtreeFlags&65011712,D!==null?y=aa(D,y):(y=ss(y,r,n,null),y.flags|=2),y.return=e,s.return=e,s.sibling=y,e.child=s,Fi(null,s),s=e.child,y=t.child.memoizedState,y===null?y=Bc(n):(r=y.cachePool,r!==null?(T=Ce._currentValue,r=r.parent!==T?{parent:T,pool:T}:r):r=Ff(),y={baseLanes:y.baseLanes|n,cachePool:r}),s.memoizedState=y,s.childLanes=Uc(t,m,n),e.memoizedState=zc,Fi(t.child,s)):(wa(e),n=t.child,t=n.sibling,n=aa(n,{mode:"visible",children:s.children}),n.return=e,n.sibling=null,t!==null&&(m=e.deletions,m===null?(e.deletions=[t],e.flags|=16):m.push(t)),e.child=n,e.memoizedState=null,n)}function Vc(t,e){return e=So({mode:"visible",children:e},t.mode),e.return=t,t.child=e}function So(t,e){return t=pn(22,t,null,e),t.lanes=0,t}function Lc(t,e,n){return ds(e,t.child,null,n),t=Vc(e,e.pendingProps.children),t.flags|=2,e.memoizedState=null,t}function cm(t,e,n){t.lanes|=e;var s=t.alternate;s!==null&&(s.lanes|=e),tc(t.return,e,n)}function qc(t,e,n,s,r,c){var m=t.memoizedState;m===null?t.memoizedState={isBackwards:e,rendering:null,renderingStartTime:0,last:s,tail:n,tailMode:r,treeForkCount:c}:(m.isBackwards=e,m.rendering=null,m.renderingStartTime=0,m.last=s,m.tail=n,m.tailMode=r,m.treeForkCount=c)}function um(t,e,n){var s=e.pendingProps,r=s.revealOrder,c=s.tail;s=s.children;var m=Te.current,y=(m&2)!==0;if(y?(m=m&1|2,e.flags|=128):m&=1,bt(Te,m),Ze(t,e,s,n),s=Bt?Ui:0,!y&&t!==null&&(t.flags&128)!==0)t:for(t=e.child;t!==null;){if(t.tag===13)t.memoizedState!==null&&cm(t,n,e);else if(t.tag===19)cm(t,n,e);else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break t;for(;t.sibling===null;){if(t.return===null||t.return===e)break t;t=t.return}t.sibling.return=t.return,t=t.sibling}switch(r){case"forwards":for(n=e.child,r=null;n!==null;)t=n.alternate,t!==null&&oo(t)===null&&(r=n),n=n.sibling;n=r,n===null?(r=e.child,e.child=null):(r=n.sibling,n.sibling=null),qc(e,!1,r,n,c,s);break;case"backwards":case"unstable_legacy-backwards":for(n=null,r=e.child,e.child=null;r!==null;){if(t=r.alternate,t!==null&&oo(t)===null){e.child=r;break}t=r.sibling,r.sibling=n,n=r,r=t}qc(e,!0,n,null,c,s);break;case"together":qc(e,!1,null,null,void 0,s);break;default:e.memoizedState=null}return e.child}function ca(t,e,n){if(t!==null&&(e.dependencies=t.dependencies),za|=e.lanes,(n&e.childLanes)===0)if(t!==null){if(Gs(t,e,n,!1),(n&e.childLanes)===0)return null}else return null;if(t!==null&&e.child!==t.child)throw Error(o(153));if(e.child!==null){for(t=e.child,n=aa(t,t.pendingProps),e.child=n,n.return=e;t.sibling!==null;)t=t.sibling,n=n.sibling=aa(t,t.pendingProps),n.return=e;n.sibling=null}return e.child}function Hc(t,e){return(t.lanes&e)!==0?!0:(t=t.dependencies,!!(t!==null&&Wl(t)))}function w1(t,e,n){switch(e.tag){case 3:Le(e,e.stateNode.containerInfo),Ea(e,Ce,t.memoizedState.cache),is();break;case 27:case 5:en(e);break;case 4:Le(e,e.stateNode.containerInfo);break;case 10:Ea(e,e.type,e.memoizedProps.value);break;case 31:if(e.memoizedState!==null)return e.flags|=128,fc(e),null;break;case 13:var s=e.memoizedState;if(s!==null)return s.dehydrated!==null?(wa(e),e.flags|=128,null):(n&e.child.childLanes)!==0?rm(t,e,n):(wa(e),t=ca(t,e,n),t!==null?t.sibling:null);wa(e);break;case 19:var r=(t.flags&128)!==0;if(s=(n&e.childLanes)!==0,s||(Gs(t,e,n,!1),s=(n&e.childLanes)!==0),r){if(s)return um(t,e,n);e.flags|=128}if(r=e.memoizedState,r!==null&&(r.rendering=null,r.tail=null,r.lastEffect=null),bt(Te,Te.current),s)break;return null;case 22:return e.lanes=0,nm(t,e,n,e.pendingProps);case 24:Ea(e,Ce,t.memoizedState.cache)}return ca(t,e,n)}function dm(t,e,n){if(t!==null)if(t.memoizedProps!==e.pendingProps)ke=!0;else{if(!Hc(t,n)&&(e.flags&128)===0)return ke=!1,w1(t,e,n);ke=(t.flags&131072)!==0}else ke=!1,Bt&&(e.flags&1048576)!==0&&If(e,Ui,e.index);switch(e.lanes=0,e.tag){case 16:t:{var s=e.pendingProps;if(t=cs(e.elementType),e.type=t,typeof t=="function")Kr(t)?(s=hs(t,s),e.tag=1,e=lm(null,e,t,s,n)):(e.tag=0,e=Oc(null,e,t,s,n));else{if(t!=null){var r=t.$$typeof;if(r===nt){e.tag=11,e=Wh(null,e,t,s,n);break t}else if(r===et){e.tag=14,e=tm(null,e,t,s,n);break t}}throw e=Ut(t)||t,Error(o(306,e,""))}}return e;case 0:return Oc(t,e,e.type,e.pendingProps,n);case 1:return s=e.type,r=hs(s,e.pendingProps),lm(t,e,s,r,n);case 3:t:{if(Le(e,e.stateNode.containerInfo),t===null)throw Error(o(387));s=e.pendingProps;var c=e.memoizedState;r=c.element,oc(t,e),Zi(e,s,null,n);var m=e.memoizedState;if(s=m.cache,Ea(e,Ce,s),s!==c.cache&&ec(e,[Ce],n,!0),Yi(),s=m.element,c.isDehydrated)if(c={element:s,isDehydrated:!1,cache:m.cache},e.updateQueue.baseState=c,e.memoizedState=c,e.flags&256){e=om(t,e,s,n);break t}else if(s!==r){r=Nn(Error(o(424)),e),Vi(r),e=om(t,e,s,n);break t}else{switch(t=e.stateNode.containerInfo,t.nodeType){case 9:t=t.body;break;default:t=t.nodeName==="HTML"?t.ownerDocument.body:t}for(re=wn(t.firstChild),Ie=e,Bt=!0,Aa=null,Dn=!0,n=nh(e,null,s,n),e.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling}else{if(is(),s===r){e=ca(t,e,n);break t}Ze(t,e,s,n)}e=e.child}return e;case 26:return bo(t,e),t===null?(n=Tp(e.type,null,e.pendingProps,null))?e.memoizedState=n:Bt||(n=e.type,t=e.pendingProps,s=Bo(ve.current).createElement(n),s[Ne]=e,s[at]=t,Ke(s,n,t),Be(s),e.stateNode=s):e.memoizedState=Tp(e.type,t.memoizedProps,e.pendingProps,t.memoizedState),null;case 27:return en(e),t===null&&Bt&&(s=e.stateNode=bp(e.type,e.pendingProps,ve.current),Ie=e,Dn=!0,r=re,qa(e.type)?(Su=r,re=wn(s.firstChild)):re=r),Ze(t,e,e.pendingProps.children,n),bo(t,e),t===null&&(e.flags|=4194304),e.child;case 5:return t===null&&Bt&&((r=s=re)&&(s=ob(s,e.type,e.pendingProps,Dn),s!==null?(e.stateNode=s,Ie=e,re=wn(s.firstChild),Dn=!1,r=!0):r=!1),r||Na(e)),en(e),r=e.type,c=e.pendingProps,m=t!==null?t.memoizedProps:null,s=c.children,pu(r,c)?s=null:m!==null&&pu(r,m)&&(e.flags|=32),e.memoizedState!==null&&(r=mc(t,e,T1,null,null,n),dl._currentValue=r),bo(t,e),Ze(t,e,s,n),e.child;case 6:return t===null&&Bt&&((t=n=re)&&(n=rb(n,e.pendingProps,Dn),n!==null?(e.stateNode=n,Ie=e,re=null,t=!0):t=!1),t||Na(e)),null;case 13:return rm(t,e,n);case 4:return Le(e,e.stateNode.containerInfo),s=e.pendingProps,t===null?e.child=ds(e,null,s,n):Ze(t,e,s,n),e.child;case 11:return Wh(t,e,e.type,e.pendingProps,n);case 7:return Ze(t,e,e.pendingProps,n),e.child;case 8:return Ze(t,e,e.pendingProps.children,n),e.child;case 12:return Ze(t,e,e.pendingProps.children,n),e.child;case 10:return s=e.pendingProps,Ea(e,e.type,s.value),Ze(t,e,s.children,n),e.child;case 9:return r=e.type._context,s=e.pendingProps.children,os(e),r=Ye(r),s=s(r),e.flags|=1,Ze(t,e,s,n),e.child;case 14:return tm(t,e,e.type,e.pendingProps,n);case 15:return em(t,e,e.type,e.pendingProps,n);case 19:return um(t,e,n);case 31:return k1(t,e,n);case 22:return nm(t,e,n,e.pendingProps);case 24:return os(e),s=Ye(Ce),t===null?(r=sc(),r===null&&(r=se,c=nc(),r.pooledCache=c,c.refCount++,c!==null&&(r.pooledCacheLanes|=n),r=c),e.memoizedState={parent:s,cache:r},lc(e),Ea(e,Ce,r)):((t.lanes&n)!==0&&(oc(t,e),Zi(e,null,null,n),Yi()),r=t.memoizedState,c=e.memoizedState,r.parent!==s?(r={parent:s,cache:s},e.memoizedState=r,e.lanes===0&&(e.memoizedState=e.updateQueue.baseState=r),Ea(e,Ce,s)):(s=c.cache,Ea(e,Ce,s),s!==r.cache&&ec(e,[Ce],n,!0))),Ze(t,e,e.pendingProps.children,n),e.child;case 29:throw e.pendingProps}throw Error(o(156,e.tag))}function ua(t){t.flags|=4}function Gc(t,e,n,s,r){if((e=(t.mode&32)!==0)&&(e=!1),e){if(t.flags|=16777216,(r&335544128)===r)if(t.stateNode.complete)t.flags|=8192;else if(Vm())t.flags|=8192;else throw us=ao,ic}else t.flags&=-16777217}function fm(t,e){if(e.type!=="stylesheet"||(e.state.loading&4)!==0)t.flags&=-16777217;else if(t.flags|=16777216,!Ep(e))if(Vm())t.flags|=8192;else throw us=ao,ic}function _o(t,e){e!==null&&(t.flags|=4),t.flags&16384&&(e=t.tag!==22?_a():536870912,t.lanes|=e,ti|=e)}function Ji(t,e){if(!Bt)switch(t.tailMode){case"hidden":e=t.tail;for(var n=null;e!==null;)e.alternate!==null&&(n=e),e=e.sibling;n===null?t.tail=null:n.sibling=null;break;case"collapsed":n=t.tail;for(var s=null;n!==null;)n.alternate!==null&&(s=n),n=n.sibling;s===null?e||t.tail===null?t.tail=null:t.tail.sibling=null:s.sibling=null}}function ce(t){var e=t.alternate!==null&&t.alternate.child===t.child,n=0,s=0;if(e)for(var r=t.child;r!==null;)n|=r.lanes|r.childLanes,s|=r.subtreeFlags&65011712,s|=r.flags&65011712,r.return=t,r=r.sibling;else for(r=t.child;r!==null;)n|=r.lanes|r.childLanes,s|=r.subtreeFlags,s|=r.flags,r.return=t,r=r.sibling;return t.subtreeFlags|=s,t.childLanes=n,e}function M1(t,e,n){var s=e.pendingProps;switch(Fr(e),e.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return ce(e),null;case 1:return ce(e),null;case 3:return n=e.stateNode,s=null,t!==null&&(s=t.memoizedState.cache),e.memoizedState.cache!==s&&(e.flags|=2048),la(Ce),Wt(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(t===null||t.child===null)&&(Hs(e)?ua(e):t===null||t.memoizedState.isDehydrated&&(e.flags&256)===0||(e.flags|=1024,$r())),ce(e),null;case 26:var r=e.type,c=e.memoizedState;return t===null?(ua(e),c!==null?(ce(e),fm(e,c)):(ce(e),Gc(e,r,null,s,n))):c?c!==t.memoizedState?(ua(e),ce(e),fm(e,c)):(ce(e),e.flags&=-16777217):(t=t.memoizedProps,t!==s&&ua(e),ce(e),Gc(e,r,t,s,n)),null;case 27:if(ze(e),n=ve.current,r=e.type,t!==null&&e.stateNode!=null)t.memoizedProps!==s&&ua(e);else{if(!s){if(e.stateNode===null)throw Error(o(166));return ce(e),null}t=I.current,Hs(e)?Zf(e):(t=bp(r,s,n),e.stateNode=t,ua(e))}return ce(e),null;case 5:if(ze(e),r=e.type,t!==null&&e.stateNode!=null)t.memoizedProps!==s&&ua(e);else{if(!s){if(e.stateNode===null)throw Error(o(166));return ce(e),null}if(c=I.current,Hs(e))Zf(e);else{var m=Bo(ve.current);switch(c){case 1:c=m.createElementNS("http://www.w3.org/2000/svg",r);break;case 2:c=m.createElementNS("http://www.w3.org/1998/Math/MathML",r);break;default:switch(r){case"svg":c=m.createElementNS("http://www.w3.org/2000/svg",r);break;case"math":c=m.createElementNS("http://www.w3.org/1998/Math/MathML",r);break;case"script":c=m.createElement("div"),c.innerHTML="<script><\/script>",c=c.removeChild(c.firstChild);break;case"select":c=typeof s.is=="string"?m.createElement("select",{is:s.is}):m.createElement("select"),s.multiple?c.multiple=!0:s.size&&(c.size=s.size);break;default:c=typeof s.is=="string"?m.createElement(r,{is:s.is}):m.createElement(r)}}c[Ne]=e,c[at]=s;t:for(m=e.child;m!==null;){if(m.tag===5||m.tag===6)c.appendChild(m.stateNode);else if(m.tag!==4&&m.tag!==27&&m.child!==null){m.child.return=m,m=m.child;continue}if(m===e)break t;for(;m.sibling===null;){if(m.return===null||m.return===e)break t;m=m.return}m.sibling.return=m.return,m=m.sibling}e.stateNode=c;t:switch(Ke(c,r,s),r){case"button":case"input":case"select":case"textarea":s=!!s.autoFocus;break t;case"img":s=!0;break t;default:s=!1}s&&ua(e)}}return ce(e),Gc(e,e.type,t===null?null:t.memoizedProps,e.pendingProps,n),null;case 6:if(t&&e.stateNode!=null)t.memoizedProps!==s&&ua(e);else{if(typeof s!="string"&&e.stateNode===null)throw Error(o(166));if(t=ve.current,Hs(e)){if(t=e.stateNode,n=e.memoizedProps,s=null,r=Ie,r!==null)switch(r.tag){case 27:case 5:s=r.memoizedProps}t[Ne]=e,t=!!(t.nodeValue===n||s!==null&&s.suppressHydrationWarning===!0||rp(t.nodeValue,n)),t||Na(e,!0)}else t=Bo(t).createTextNode(s),t[Ne]=e,e.stateNode=t}return ce(e),null;case 31:if(n=e.memoizedState,t===null||t.memoizedState!==null){if(s=Hs(e),n!==null){if(t===null){if(!s)throw Error(o(318));if(t=e.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(o(557));t[Ne]=e}else is(),(e.flags&128)===0&&(e.memoizedState=null),e.flags|=4;ce(e),t=!1}else n=$r(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=n),t=!0;if(!t)return e.flags&256?(vn(e),e):(vn(e),null);if((e.flags&128)!==0)throw Error(o(558))}return ce(e),null;case 13:if(s=e.memoizedState,t===null||t.memoizedState!==null&&t.memoizedState.dehydrated!==null){if(r=Hs(e),s!==null&&s.dehydrated!==null){if(t===null){if(!r)throw Error(o(318));if(r=e.memoizedState,r=r!==null?r.dehydrated:null,!r)throw Error(o(317));r[Ne]=e}else is(),(e.flags&128)===0&&(e.memoizedState=null),e.flags|=4;ce(e),r=!1}else r=$r(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=r),r=!0;if(!r)return e.flags&256?(vn(e),e):(vn(e),null)}return vn(e),(e.flags&128)!==0?(e.lanes=n,e):(n=s!==null,t=t!==null&&t.memoizedState!==null,n&&(s=e.child,r=null,s.alternate!==null&&s.alternate.memoizedState!==null&&s.alternate.memoizedState.cachePool!==null&&(r=s.alternate.memoizedState.cachePool.pool),c=null,s.memoizedState!==null&&s.memoizedState.cachePool!==null&&(c=s.memoizedState.cachePool.pool),c!==r&&(s.flags|=2048)),n!==t&&n&&(e.child.flags|=8192),_o(e,e.updateQueue),ce(e),null);case 4:return Wt(),t===null&&uu(e.stateNode.containerInfo),ce(e),null;case 10:return la(e.type),ce(e),null;case 19:if(yt(Te),s=e.memoizedState,s===null)return ce(e),null;if(r=(e.flags&128)!==0,c=s.rendering,c===null)if(r)Ji(s,!1);else{if(be!==0||t!==null&&(t.flags&128)!==0)for(t=e.child;t!==null;){if(c=oo(t),c!==null){for(e.flags|=128,Ji(s,!1),t=c.updateQueue,e.updateQueue=t,_o(e,t),e.subtreeFlags=0,t=n,n=e.child;n!==null;)qf(n,t),n=n.sibling;return bt(Te,Te.current&1|2),Bt&&sa(e,s.treeForkCount),e.child}t=t.sibling}s.tail!==null&&Nt()>No&&(e.flags|=128,r=!0,Ji(s,!1),e.lanes=4194304)}else{if(!r)if(t=oo(c),t!==null){if(e.flags|=128,r=!0,t=t.updateQueue,e.updateQueue=t,_o(e,t),Ji(s,!0),s.tail===null&&s.tailMode==="hidden"&&!c.alternate&&!Bt)return ce(e),null}else 2*Nt()-s.renderingStartTime>No&&n!==536870912&&(e.flags|=128,r=!0,Ji(s,!1),e.lanes=4194304);s.isBackwards?(c.sibling=e.child,e.child=c):(t=s.last,t!==null?t.sibling=c:e.child=c,s.last=c)}return s.tail!==null?(t=s.tail,s.rendering=t,s.tail=t.sibling,s.renderingStartTime=Nt(),t.sibling=null,n=Te.current,bt(Te,r?n&1|2:n&1),Bt&&sa(e,s.treeForkCount),t):(ce(e),null);case 22:case 23:return vn(e),dc(),s=e.memoizedState!==null,t!==null?t.memoizedState!==null!==s&&(e.flags|=8192):s&&(e.flags|=8192),s?(n&536870912)!==0&&(e.flags&128)===0&&(ce(e),e.subtreeFlags&6&&(e.flags|=8192)):ce(e),n=e.updateQueue,n!==null&&_o(e,n.retryQueue),n=null,t!==null&&t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(n=t.memoizedState.cachePool.pool),s=null,e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(s=e.memoizedState.cachePool.pool),s!==n&&(e.flags|=2048),t!==null&&yt(rs),null;case 24:return n=null,t!==null&&(n=t.memoizedState.cache),e.memoizedState.cache!==n&&(e.flags|=2048),la(Ce),ce(e),null;case 25:return null;case 30:return null}throw Error(o(156,e.tag))}function R1(t,e){switch(Fr(e),e.tag){case 1:return t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 3:return la(Ce),Wt(),t=e.flags,(t&65536)!==0&&(t&128)===0?(e.flags=t&-65537|128,e):null;case 26:case 27:case 5:return ze(e),null;case 31:if(e.memoizedState!==null){if(vn(e),e.alternate===null)throw Error(o(340));is()}return t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 13:if(vn(e),t=e.memoizedState,t!==null&&t.dehydrated!==null){if(e.alternate===null)throw Error(o(340));is()}return t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 19:return yt(Te),null;case 4:return Wt(),null;case 10:return la(e.type),null;case 22:case 23:return vn(e),dc(),t!==null&&yt(rs),t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 24:return la(Ce),null;case 25:return null;default:return null}}function hm(t,e){switch(Fr(e),e.tag){case 3:la(Ce),Wt();break;case 26:case 27:case 5:ze(e);break;case 4:Wt();break;case 31:e.memoizedState!==null&&vn(e);break;case 13:vn(e);break;case 19:yt(Te);break;case 10:la(e.type);break;case 22:case 23:vn(e),dc(),t!==null&&yt(rs);break;case 24:la(Ce)}}function $i(t,e){try{var n=e.updateQueue,s=n!==null?n.lastEffect:null;if(s!==null){var r=s.next;n=r;do{if((n.tag&t)===t){s=void 0;var c=n.create,m=n.inst;s=c(),m.destroy=s}n=n.next}while(n!==r)}}catch(y){$t(e,e.return,y)}}function Ra(t,e,n){try{var s=e.updateQueue,r=s!==null?s.lastEffect:null;if(r!==null){var c=r.next;s=c;do{if((s.tag&t)===t){var m=s.inst,y=m.destroy;if(y!==void 0){m.destroy=void 0,r=e;var T=n,D=y;try{D()}catch(L){$t(r,T,L)}}}s=s.next}while(s!==c)}}catch(L){$t(e,e.return,L)}}function mm(t){var e=t.updateQueue;if(e!==null){var n=t.stateNode;try{sh(e,n)}catch(s){$t(t,t.return,s)}}}function pm(t,e,n){n.props=hs(t.type,t.memoizedProps),n.state=t.memoizedState;try{n.componentWillUnmount()}catch(s){$t(t,e,s)}}function Wi(t,e){try{var n=t.ref;if(n!==null){switch(t.tag){case 26:case 27:case 5:var s=t.stateNode;break;case 30:s=t.stateNode;break;default:s=t.stateNode}typeof n=="function"?t.refCleanup=n(s):n.current=s}}catch(r){$t(t,e,r)}}function Zn(t,e){var n=t.ref,s=t.refCleanup;if(n!==null)if(typeof s=="function")try{s()}catch(r){$t(t,e,r)}finally{t.refCleanup=null,t=t.alternate,t!=null&&(t.refCleanup=null)}else if(typeof n=="function")try{n(null)}catch(r){$t(t,e,r)}else n.current=null}function gm(t){var e=t.type,n=t.memoizedProps,s=t.stateNode;try{t:switch(e){case"button":case"input":case"select":case"textarea":n.autoFocus&&s.focus();break t;case"img":n.src?s.src=n.src:n.srcSet&&(s.srcset=n.srcSet)}}catch(r){$t(t,t.return,r)}}function Ic(t,e,n){try{var s=t.stateNode;eb(s,t.type,n,e),s[at]=e}catch(r){$t(t,t.return,r)}}function vm(t){return t.tag===5||t.tag===3||t.tag===26||t.tag===27&&qa(t.type)||t.tag===4}function Yc(t){t:for(;;){for(;t.sibling===null;){if(t.return===null||vm(t.return))return null;t=t.return}for(t.sibling.return=t.return,t=t.sibling;t.tag!==5&&t.tag!==6&&t.tag!==18;){if(t.tag===27&&qa(t.type)||t.flags&2||t.child===null||t.tag===4)continue t;t.child.return=t,t=t.child}if(!(t.flags&2))return t.stateNode}}function Zc(t,e,n){var s=t.tag;if(s===5||s===6)t=t.stateNode,e?(n.nodeType===9?n.body:n.nodeName==="HTML"?n.ownerDocument.body:n).insertBefore(t,e):(e=n.nodeType===9?n.body:n.nodeName==="HTML"?n.ownerDocument.body:n,e.appendChild(t),n=n._reactRootContainer,n!=null||e.onclick!==null||(e.onclick=ea));else if(s!==4&&(s===27&&qa(t.type)&&(n=t.stateNode,e=null),t=t.child,t!==null))for(Zc(t,e,n),t=t.sibling;t!==null;)Zc(t,e,n),t=t.sibling}function To(t,e,n){var s=t.tag;if(s===5||s===6)t=t.stateNode,e?n.insertBefore(t,e):n.appendChild(t);else if(s!==4&&(s===27&&qa(t.type)&&(n=t.stateNode),t=t.child,t!==null))for(To(t,e,n),t=t.sibling;t!==null;)To(t,e,n),t=t.sibling}function ym(t){var e=t.stateNode,n=t.memoizedProps;try{for(var s=t.type,r=e.attributes;r.length;)e.removeAttributeNode(r[0]);Ke(e,s,n),e[Ne]=t,e[at]=n}catch(c){$t(t,t.return,c)}}var da=!1,we=!1,Kc=!1,bm=typeof WeakSet=="function"?WeakSet:Set,Ue=null;function O1(t,e){if(t=t.containerInfo,hu=Io,t=wf(t),Lr(t)){if("selectionStart"in t)var n={start:t.selectionStart,end:t.selectionEnd};else t:{n=(n=t.ownerDocument)&&n.defaultView||window;var s=n.getSelection&&n.getSelection();if(s&&s.rangeCount!==0){n=s.anchorNode;var r=s.anchorOffset,c=s.focusNode;s=s.focusOffset;try{n.nodeType,c.nodeType}catch{n=null;break t}var m=0,y=-1,T=-1,D=0,L=0,Z=t,M=null;e:for(;;){for(var O;Z!==n||r!==0&&Z.nodeType!==3||(y=m+r),Z!==c||s!==0&&Z.nodeType!==3||(T=m+s),Z.nodeType===3&&(m+=Z.nodeValue.length),(O=Z.firstChild)!==null;)M=Z,Z=O;for(;;){if(Z===t)break e;if(M===n&&++D===r&&(y=m),M===c&&++L===s&&(T=m),(O=Z.nextSibling)!==null)break;Z=M,M=Z.parentNode}Z=O}n=y===-1||T===-1?null:{start:y,end:T}}else n=null}n=n||{start:0,end:0}}else n=null;for(mu={focusedElem:t,selectionRange:n},Io=!1,Ue=e;Ue!==null;)if(e=Ue,t=e.child,(e.subtreeFlags&1028)!==0&&t!==null)t.return=e,Ue=t;else for(;Ue!==null;){switch(e=Ue,c=e.alternate,t=e.flags,e.tag){case 0:if((t&4)!==0&&(t=e.updateQueue,t=t!==null?t.events:null,t!==null))for(n=0;n<t.length;n++)r=t[n],r.ref.impl=r.nextImpl;break;case 11:case 15:break;case 1:if((t&1024)!==0&&c!==null){t=void 0,n=e,r=c.memoizedProps,c=c.memoizedState,s=n.stateNode;try{var ot=hs(n.type,r);t=s.getSnapshotBeforeUpdate(ot,c),s.__reactInternalSnapshotBeforeUpdate=t}catch(pt){$t(n,n.return,pt)}}break;case 3:if((t&1024)!==0){if(t=e.stateNode.containerInfo,n=t.nodeType,n===9)vu(t);else if(n===1)switch(t.nodeName){case"HEAD":case"HTML":case"BODY":vu(t);break;default:t.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((t&1024)!==0)throw Error(o(163))}if(t=e.sibling,t!==null){t.return=e.return,Ue=t;break}Ue=e.return}}function Sm(t,e,n){var s=n.flags;switch(n.tag){case 0:case 11:case 15:ha(t,n),s&4&&$i(5,n);break;case 1:if(ha(t,n),s&4)if(t=n.stateNode,e===null)try{t.componentDidMount()}catch(m){$t(n,n.return,m)}else{var r=hs(n.type,e.memoizedProps);e=e.memoizedState;try{t.componentDidUpdate(r,e,t.__reactInternalSnapshotBeforeUpdate)}catch(m){$t(n,n.return,m)}}s&64&&mm(n),s&512&&Wi(n,n.return);break;case 3:if(ha(t,n),s&64&&(t=n.updateQueue,t!==null)){if(e=null,n.child!==null)switch(n.child.tag){case 27:case 5:e=n.child.stateNode;break;case 1:e=n.child.stateNode}try{sh(t,e)}catch(m){$t(n,n.return,m)}}break;case 27:e===null&&s&4&&ym(n);case 26:case 5:ha(t,n),e===null&&s&4&&gm(n),s&512&&Wi(n,n.return);break;case 12:ha(t,n);break;case 31:ha(t,n),s&4&&xm(t,n);break;case 13:ha(t,n),s&4&&jm(t,n),s&64&&(t=n.memoizedState,t!==null&&(t=t.dehydrated,t!==null&&(n=I1.bind(null,n),cb(t,n))));break;case 22:if(s=n.memoizedState!==null||da,!s){e=e!==null&&e.memoizedState!==null||we,r=da;var c=we;da=s,(we=e)&&!c?ma(t,n,(n.subtreeFlags&8772)!==0):ha(t,n),da=r,we=c}break;case 30:break;default:ha(t,n)}}function _m(t){var e=t.alternate;e!==null&&(t.alternate=null,_m(e)),t.child=null,t.deletions=null,t.sibling=null,t.tag===5&&(e=t.stateNode,e!==null&&Bn(e)),t.stateNode=null,t.return=null,t.dependencies=null,t.memoizedProps=null,t.memoizedState=null,t.pendingProps=null,t.stateNode=null,t.updateQueue=null}var fe=null,on=!1;function fa(t,e,n){for(n=n.child;n!==null;)Tm(t,e,n),n=n.sibling}function Tm(t,e,n){if(Ge&&typeof Ge.onCommitFiberUnmount=="function")try{Ge.onCommitFiberUnmount(He,n)}catch{}switch(n.tag){case 26:we||Zn(n,e),fa(t,e,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&(n=n.stateNode,n.parentNode.removeChild(n));break;case 27:we||Zn(n,e);var s=fe,r=on;qa(n.type)&&(fe=n.stateNode,on=!1),fa(t,e,n),rl(n.stateNode),fe=s,on=r;break;case 5:we||Zn(n,e);case 6:if(s=fe,r=on,fe=null,fa(t,e,n),fe=s,on=r,fe!==null)if(on)try{(fe.nodeType===9?fe.body:fe.nodeName==="HTML"?fe.ownerDocument.body:fe).removeChild(n.stateNode)}catch(c){$t(n,e,c)}else try{fe.removeChild(n.stateNode)}catch(c){$t(n,e,c)}break;case 18:fe!==null&&(on?(t=fe,mp(t.nodeType===9?t.body:t.nodeName==="HTML"?t.ownerDocument.body:t,n.stateNode),ri(t)):mp(fe,n.stateNode));break;case 4:s=fe,r=on,fe=n.stateNode.containerInfo,on=!0,fa(t,e,n),fe=s,on=r;break;case 0:case 11:case 14:case 15:Ra(2,n,e),we||Ra(4,n,e),fa(t,e,n);break;case 1:we||(Zn(n,e),s=n.stateNode,typeof s.componentWillUnmount=="function"&&pm(n,e,s)),fa(t,e,n);break;case 21:fa(t,e,n);break;case 22:we=(s=we)||n.memoizedState!==null,fa(t,e,n),we=s;break;default:fa(t,e,n)}}function xm(t,e){if(e.memoizedState===null&&(t=e.alternate,t!==null&&(t=t.memoizedState,t!==null))){t=t.dehydrated;try{ri(t)}catch(n){$t(e,e.return,n)}}}function jm(t,e){if(e.memoizedState===null&&(t=e.alternate,t!==null&&(t=t.memoizedState,t!==null&&(t=t.dehydrated,t!==null))))try{ri(t)}catch(n){$t(e,e.return,n)}}function z1(t){switch(t.tag){case 31:case 13:case 19:var e=t.stateNode;return e===null&&(e=t.stateNode=new bm),e;case 22:return t=t.stateNode,e=t._retryCache,e===null&&(e=t._retryCache=new bm),e;default:throw Error(o(435,t.tag))}}function xo(t,e){var n=z1(t);e.forEach(function(s){if(!n.has(s)){n.add(s);var r=Y1.bind(null,t,s);s.then(r,r)}})}function rn(t,e){var n=e.deletions;if(n!==null)for(var s=0;s<n.length;s++){var r=n[s],c=t,m=e,y=m;t:for(;y!==null;){switch(y.tag){case 27:if(qa(y.type)){fe=y.stateNode,on=!1;break t}break;case 5:fe=y.stateNode,on=!1;break t;case 3:case 4:fe=y.stateNode.containerInfo,on=!0;break t}y=y.return}if(fe===null)throw Error(o(160));Tm(c,m,r),fe=null,on=!1,c=r.alternate,c!==null&&(c.return=null),r.return=null}if(e.subtreeFlags&13886)for(e=e.child;e!==null;)Am(e,t),e=e.sibling}var Vn=null;function Am(t,e){var n=t.alternate,s=t.flags;switch(t.tag){case 0:case 11:case 14:case 15:rn(e,t),cn(t),s&4&&(Ra(3,t,t.return),$i(3,t),Ra(5,t,t.return));break;case 1:rn(e,t),cn(t),s&512&&(we||n===null||Zn(n,n.return)),s&64&&da&&(t=t.updateQueue,t!==null&&(s=t.callbacks,s!==null&&(n=t.shared.hiddenCallbacks,t.shared.hiddenCallbacks=n===null?s:n.concat(s))));break;case 26:var r=Vn;if(rn(e,t),cn(t),s&512&&(we||n===null||Zn(n,n.return)),s&4){var c=n!==null?n.memoizedState:null;if(s=t.memoizedState,n===null)if(s===null)if(t.stateNode===null){t:{s=t.type,n=t.memoizedProps,r=r.ownerDocument||r;e:switch(s){case"title":c=r.getElementsByTagName("title")[0],(!c||c[Ee]||c[Ne]||c.namespaceURI==="http://www.w3.org/2000/svg"||c.hasAttribute("itemprop"))&&(c=r.createElement(s),r.head.insertBefore(c,r.querySelector("head > title"))),Ke(c,s,n),c[Ne]=t,Be(c),s=c;break t;case"link":var m=Ap("link","href",r).get(s+(n.href||""));if(m){for(var y=0;y<m.length;y++)if(c=m[y],c.getAttribute("href")===(n.href==null||n.href===""?null:n.href)&&c.getAttribute("rel")===(n.rel==null?null:n.rel)&&c.getAttribute("title")===(n.title==null?null:n.title)&&c.getAttribute("crossorigin")===(n.crossOrigin==null?null:n.crossOrigin)){m.splice(y,1);break e}}c=r.createElement(s),Ke(c,s,n),r.head.appendChild(c);break;case"meta":if(m=Ap("meta","content",r).get(s+(n.content||""))){for(y=0;y<m.length;y++)if(c=m[y],c.getAttribute("content")===(n.content==null?null:""+n.content)&&c.getAttribute("name")===(n.name==null?null:n.name)&&c.getAttribute("property")===(n.property==null?null:n.property)&&c.getAttribute("http-equiv")===(n.httpEquiv==null?null:n.httpEquiv)&&c.getAttribute("charset")===(n.charSet==null?null:n.charSet)){m.splice(y,1);break e}}c=r.createElement(s),Ke(c,s,n),r.head.appendChild(c);break;default:throw Error(o(468,s))}c[Ne]=t,Be(c),s=c}t.stateNode=s}else Np(r,t.type,t.stateNode);else t.stateNode=jp(r,s,t.memoizedProps);else c!==s?(c===null?n.stateNode!==null&&(n=n.stateNode,n.parentNode.removeChild(n)):c.count--,s===null?Np(r,t.type,t.stateNode):jp(r,s,t.memoizedProps)):s===null&&t.stateNode!==null&&Ic(t,t.memoizedProps,n.memoizedProps)}break;case 27:rn(e,t),cn(t),s&512&&(we||n===null||Zn(n,n.return)),n!==null&&s&4&&Ic(t,t.memoizedProps,n.memoizedProps);break;case 5:if(rn(e,t),cn(t),s&512&&(we||n===null||Zn(n,n.return)),t.flags&32){r=t.stateNode;try{ws(r,"")}catch(ot){$t(t,t.return,ot)}}s&4&&t.stateNode!=null&&(r=t.memoizedProps,Ic(t,r,n!==null?n.memoizedProps:r)),s&1024&&(Kc=!0);break;case 6:if(rn(e,t),cn(t),s&4){if(t.stateNode===null)throw Error(o(162));s=t.memoizedProps,n=t.stateNode;try{n.nodeValue=s}catch(ot){$t(t,t.return,ot)}}break;case 3:if(Lo=null,r=Vn,Vn=Uo(e.containerInfo),rn(e,t),Vn=r,cn(t),s&4&&n!==null&&n.memoizedState.isDehydrated)try{ri(e.containerInfo)}catch(ot){$t(t,t.return,ot)}Kc&&(Kc=!1,Nm(t));break;case 4:s=Vn,Vn=Uo(t.stateNode.containerInfo),rn(e,t),cn(t),Vn=s;break;case 12:rn(e,t),cn(t);break;case 31:rn(e,t),cn(t),s&4&&(s=t.updateQueue,s!==null&&(t.updateQueue=null,xo(t,s)));break;case 13:rn(e,t),cn(t),t.child.flags&8192&&t.memoizedState!==null!=(n!==null&&n.memoizedState!==null)&&(Ao=Nt()),s&4&&(s=t.updateQueue,s!==null&&(t.updateQueue=null,xo(t,s)));break;case 22:r=t.memoizedState!==null;var T=n!==null&&n.memoizedState!==null,D=da,L=we;if(da=D||r,we=L||T,rn(e,t),we=L,da=D,cn(t),s&8192)t:for(e=t.stateNode,e._visibility=r?e._visibility&-2:e._visibility|1,r&&(n===null||T||da||we||ms(t)),n=null,e=t;;){if(e.tag===5||e.tag===26){if(n===null){T=n=e;try{if(c=T.stateNode,r)m=c.style,typeof m.setProperty=="function"?m.setProperty("display","none","important"):m.display="none";else{y=T.stateNode;var Z=T.memoizedProps.style,M=Z!=null&&Z.hasOwnProperty("display")?Z.display:null;y.style.display=M==null||typeof M=="boolean"?"":(""+M).trim()}}catch(ot){$t(T,T.return,ot)}}}else if(e.tag===6){if(n===null){T=e;try{T.stateNode.nodeValue=r?"":T.memoizedProps}catch(ot){$t(T,T.return,ot)}}}else if(e.tag===18){if(n===null){T=e;try{var O=T.stateNode;r?pp(O,!0):pp(T.stateNode,!1)}catch(ot){$t(T,T.return,ot)}}}else if((e.tag!==22&&e.tag!==23||e.memoizedState===null||e===t)&&e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break t;for(;e.sibling===null;){if(e.return===null||e.return===t)break t;n===e&&(n=null),e=e.return}n===e&&(n=null),e.sibling.return=e.return,e=e.sibling}s&4&&(s=t.updateQueue,s!==null&&(n=s.retryQueue,n!==null&&(s.retryQueue=null,xo(t,n))));break;case 19:rn(e,t),cn(t),s&4&&(s=t.updateQueue,s!==null&&(t.updateQueue=null,xo(t,s)));break;case 30:break;case 21:break;default:rn(e,t),cn(t)}}function cn(t){var e=t.flags;if(e&2){try{for(var n,s=t.return;s!==null;){if(vm(s)){n=s;break}s=s.return}if(n==null)throw Error(o(160));switch(n.tag){case 27:var r=n.stateNode,c=Yc(t);To(t,c,r);break;case 5:var m=n.stateNode;n.flags&32&&(ws(m,""),n.flags&=-33);var y=Yc(t);To(t,y,m);break;case 3:case 4:var T=n.stateNode.containerInfo,D=Yc(t);Zc(t,D,T);break;default:throw Error(o(161))}}catch(L){$t(t,t.return,L)}t.flags&=-3}e&4096&&(t.flags&=-4097)}function Nm(t){if(t.subtreeFlags&1024)for(t=t.child;t!==null;){var e=t;Nm(e),e.tag===5&&e.flags&1024&&e.stateNode.reset(),t=t.sibling}}function ha(t,e){if(e.subtreeFlags&8772)for(e=e.child;e!==null;)Sm(t,e.alternate,e),e=e.sibling}function ms(t){for(t=t.child;t!==null;){var e=t;switch(e.tag){case 0:case 11:case 14:case 15:Ra(4,e,e.return),ms(e);break;case 1:Zn(e,e.return);var n=e.stateNode;typeof n.componentWillUnmount=="function"&&pm(e,e.return,n),ms(e);break;case 27:rl(e.stateNode);case 26:case 5:Zn(e,e.return),ms(e);break;case 22:e.memoizedState===null&&ms(e);break;case 30:ms(e);break;default:ms(e)}t=t.sibling}}function ma(t,e,n){for(n=n&&(e.subtreeFlags&8772)!==0,e=e.child;e!==null;){var s=e.alternate,r=t,c=e,m=c.flags;switch(c.tag){case 0:case 11:case 15:ma(r,c,n),$i(4,c);break;case 1:if(ma(r,c,n),s=c,r=s.stateNode,typeof r.componentDidMount=="function")try{r.componentDidMount()}catch(D){$t(s,s.return,D)}if(s=c,r=s.updateQueue,r!==null){var y=s.stateNode;try{var T=r.shared.hiddenCallbacks;if(T!==null)for(r.shared.hiddenCallbacks=null,r=0;r<T.length;r++)ah(T[r],y)}catch(D){$t(s,s.return,D)}}n&&m&64&&mm(c),Wi(c,c.return);break;case 27:ym(c);case 26:case 5:ma(r,c,n),n&&s===null&&m&4&&gm(c),Wi(c,c.return);break;case 12:ma(r,c,n);break;case 31:ma(r,c,n),n&&m&4&&xm(r,c);break;case 13:ma(r,c,n),n&&m&4&&jm(r,c);break;case 22:c.memoizedState===null&&ma(r,c,n),Wi(c,c.return);break;case 30:break;default:ma(r,c,n)}e=e.sibling}}function Xc(t,e){var n=null;t!==null&&t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(n=t.memoizedState.cachePool.pool),t=null,e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(t=e.memoizedState.cachePool.pool),t!==n&&(t!=null&&t.refCount++,n!=null&&Li(n))}function Qc(t,e){t=null,e.alternate!==null&&(t=e.alternate.memoizedState.cache),e=e.memoizedState.cache,e!==t&&(e.refCount++,t!=null&&Li(t))}function Ln(t,e,n,s){if(e.subtreeFlags&10256)for(e=e.child;e!==null;)Em(t,e,n,s),e=e.sibling}function Em(t,e,n,s){var r=e.flags;switch(e.tag){case 0:case 11:case 15:Ln(t,e,n,s),r&2048&&$i(9,e);break;case 1:Ln(t,e,n,s);break;case 3:Ln(t,e,n,s),r&2048&&(t=null,e.alternate!==null&&(t=e.alternate.memoizedState.cache),e=e.memoizedState.cache,e!==t&&(e.refCount++,t!=null&&Li(t)));break;case 12:if(r&2048){Ln(t,e,n,s),t=e.stateNode;try{var c=e.memoizedProps,m=c.id,y=c.onPostCommit;typeof y=="function"&&y(m,e.alternate===null?"mount":"update",t.passiveEffectDuration,-0)}catch(T){$t(e,e.return,T)}}else Ln(t,e,n,s);break;case 31:Ln(t,e,n,s);break;case 13:Ln(t,e,n,s);break;case 23:break;case 22:c=e.stateNode,m=e.alternate,e.memoizedState!==null?c._visibility&2?Ln(t,e,n,s):tl(t,e):c._visibility&2?Ln(t,e,n,s):(c._visibility|=2,Js(t,e,n,s,(e.subtreeFlags&10256)!==0||!1)),r&2048&&Xc(m,e);break;case 24:Ln(t,e,n,s),r&2048&&Qc(e.alternate,e);break;default:Ln(t,e,n,s)}}function Js(t,e,n,s,r){for(r=r&&((e.subtreeFlags&10256)!==0||!1),e=e.child;e!==null;){var c=t,m=e,y=n,T=s,D=m.flags;switch(m.tag){case 0:case 11:case 15:Js(c,m,y,T,r),$i(8,m);break;case 23:break;case 22:var L=m.stateNode;m.memoizedState!==null?L._visibility&2?Js(c,m,y,T,r):tl(c,m):(L._visibility|=2,Js(c,m,y,T,r)),r&&D&2048&&Xc(m.alternate,m);break;case 24:Js(c,m,y,T,r),r&&D&2048&&Qc(m.alternate,m);break;default:Js(c,m,y,T,r)}e=e.sibling}}function tl(t,e){if(e.subtreeFlags&10256)for(e=e.child;e!==null;){var n=t,s=e,r=s.flags;switch(s.tag){case 22:tl(n,s),r&2048&&Xc(s.alternate,s);break;case 24:tl(n,s),r&2048&&Qc(s.alternate,s);break;default:tl(n,s)}e=e.sibling}}var el=8192;function $s(t,e,n){if(t.subtreeFlags&el)for(t=t.child;t!==null;)Cm(t,e,n),t=t.sibling}function Cm(t,e,n){switch(t.tag){case 26:$s(t,e,n),t.flags&el&&t.memoizedState!==null&&_b(n,Vn,t.memoizedState,t.memoizedProps);break;case 5:$s(t,e,n);break;case 3:case 4:var s=Vn;Vn=Uo(t.stateNode.containerInfo),$s(t,e,n),Vn=s;break;case 22:t.memoizedState===null&&(s=t.alternate,s!==null&&s.memoizedState!==null?(s=el,el=16777216,$s(t,e,n),el=s):$s(t,e,n));break;default:$s(t,e,n)}}function Dm(t){var e=t.alternate;if(e!==null&&(t=e.child,t!==null)){e.child=null;do e=t.sibling,t.sibling=null,t=e;while(t!==null)}}function nl(t){var e=t.deletions;if((t.flags&16)!==0){if(e!==null)for(var n=0;n<e.length;n++){var s=e[n];Ue=s,wm(s,t)}Dm(t)}if(t.subtreeFlags&10256)for(t=t.child;t!==null;)km(t),t=t.sibling}function km(t){switch(t.tag){case 0:case 11:case 15:nl(t),t.flags&2048&&Ra(9,t,t.return);break;case 3:nl(t);break;case 12:nl(t);break;case 22:var e=t.stateNode;t.memoizedState!==null&&e._visibility&2&&(t.return===null||t.return.tag!==13)?(e._visibility&=-3,jo(t)):nl(t);break;default:nl(t)}}function jo(t){var e=t.deletions;if((t.flags&16)!==0){if(e!==null)for(var n=0;n<e.length;n++){var s=e[n];Ue=s,wm(s,t)}Dm(t)}for(t=t.child;t!==null;){switch(e=t,e.tag){case 0:case 11:case 15:Ra(8,e,e.return),jo(e);break;case 22:n=e.stateNode,n._visibility&2&&(n._visibility&=-3,jo(e));break;default:jo(e)}t=t.sibling}}function wm(t,e){for(;Ue!==null;){var n=Ue;switch(n.tag){case 0:case 11:case 15:Ra(8,n,e);break;case 23:case 22:if(n.memoizedState!==null&&n.memoizedState.cachePool!==null){var s=n.memoizedState.cachePool.pool;s!=null&&s.refCount++}break;case 24:Li(n.memoizedState.cache)}if(s=n.child,s!==null)s.return=n,Ue=s;else t:for(n=t;Ue!==null;){s=Ue;var r=s.sibling,c=s.return;if(_m(s),s===n){Ue=null;break t}if(r!==null){r.return=c,Ue=r;break t}Ue=c}}}var B1={getCacheForType:function(t){var e=Ye(Ce),n=e.data.get(t);return n===void 0&&(n=t(),e.data.set(t,n)),n},cacheSignal:function(){return Ye(Ce).controller.signal}},U1=typeof WeakMap=="function"?WeakMap:Map,It=0,se=null,Dt=null,Rt=0,Jt=0,yn=null,Oa=!1,Ws=!1,Pc=!1,pa=0,be=0,za=0,ps=0,Fc=0,bn=0,ti=0,al=null,un=null,Jc=!1,Ao=0,Mm=0,No=1/0,Eo=null,Ba=null,Re=0,Ua=null,ei=null,ga=0,$c=0,Wc=null,Rm=null,sl=0,tu=null;function Sn(){return(It&2)!==0&&Rt!==0?Rt&-Rt:B.T!==null?lu():Ai()}function Om(){if(bn===0)if((Rt&536870912)===0||Bt){var t=Fe;Fe<<=1,(Fe&3932160)===0&&(Fe=262144),bn=t}else bn=536870912;return t=gn.current,t!==null&&(t.flags|=32),bn}function dn(t,e,n){(t===se&&(Jt===2||Jt===9)||t.cancelPendingCommit!==null)&&(ni(t,0),Va(t,Rt,bn,!1)),Ta(t,n),((It&2)===0||t!==se)&&(t===se&&((It&2)===0&&(ps|=n),be===4&&Va(t,Rt,bn,!1)),Kn(t))}function zm(t,e,n){if((It&6)!==0)throw Error(o(327));var s=!n&&(e&127)===0&&(e&t.expiredLanes)===0||de(t,e),r=s?q1(t,e):nu(t,e,!0),c=s;do{if(r===0){Ws&&!s&&Va(t,e,0,!1);break}else{if(n=t.current.alternate,c&&!V1(n)){r=nu(t,e,!1),c=!1;continue}if(r===2){if(c=e,t.errorRecoveryDisabledLanes&c)var m=0;else m=t.pendingLanes&-536870913,m=m!==0?m:m&536870912?536870912:0;if(m!==0){e=m;t:{var y=t;r=al;var T=y.current.memoizedState.isDehydrated;if(T&&(ni(y,m).flags|=256),m=nu(y,m,!1),m!==2){if(Pc&&!T){y.errorRecoveryDisabledLanes|=c,ps|=c,r=4;break t}c=un,un=r,c!==null&&(un===null?un=c:un.push.apply(un,c))}r=m}if(c=!1,r!==2)continue}}if(r===1){ni(t,0),Va(t,e,0,!0);break}t:{switch(s=t,c=r,c){case 0:case 1:throw Error(o(345));case 4:if((e&4194048)!==e)break;case 6:Va(s,e,bn,!Oa);break t;case 2:un=null;break;case 3:case 5:break;default:throw Error(o(329))}if((e&62914560)===e&&(r=Ao+300-Nt(),10<r)){if(Va(s,e,bn,!Oa),it(s,0,!0)!==0)break t;ga=e,s.timeoutHandle=fp(Bm.bind(null,s,n,un,Eo,Jc,e,bn,ps,ti,Oa,c,"Throttled",-0,0),r);break t}Bm(s,n,un,Eo,Jc,e,bn,ps,ti,Oa,c,null,-0,0)}}break}while(!0);Kn(t)}function Bm(t,e,n,s,r,c,m,y,T,D,L,Z,M,O){if(t.timeoutHandle=-1,Z=e.subtreeFlags,Z&8192||(Z&16785408)===16785408){Z={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:ea},Cm(e,c,Z);var ot=(c&62914560)===c?Ao-Nt():(c&4194048)===c?Mm-Nt():0;if(ot=Tb(Z,ot),ot!==null){ga=c,t.cancelPendingCommit=ot(Ym.bind(null,t,e,c,n,s,r,m,y,T,L,Z,null,M,O)),Va(t,c,m,!D);return}}Ym(t,e,c,n,s,r,m,y,T)}function V1(t){for(var e=t;;){var n=e.tag;if((n===0||n===11||n===15)&&e.flags&16384&&(n=e.updateQueue,n!==null&&(n=n.stores,n!==null)))for(var s=0;s<n.length;s++){var r=n[s],c=r.getSnapshot;r=r.value;try{if(!mn(c(),r))return!1}catch{return!1}}if(n=e.child,e.subtreeFlags&16384&&n!==null)n.return=e,e=n;else{if(e===t)break;for(;e.sibling===null;){if(e.return===null||e.return===t)return!0;e=e.return}e.sibling.return=e.return,e=e.sibling}}return!0}function Va(t,e,n,s){e&=~Fc,e&=~ps,t.suspendedLanes|=e,t.pingedLanes&=~e,s&&(t.warmLanes|=e),s=t.expirationTimes;for(var r=e;0<r;){var c=31-J(r),m=1<<c;s[c]=-1,r&=~m}n!==0&&Ti(t,n,e)}function Co(){return(It&6)===0?(il(0),!1):!0}function eu(){if(Dt!==null){if(Jt===0)var t=Dt.return;else t=Dt,ia=ls=null,vc(t),Ks=null,Hi=0,t=Dt;for(;t!==null;)hm(t.alternate,t),t=t.return;Dt=null}}function ni(t,e){var n=t.timeoutHandle;n!==-1&&(t.timeoutHandle=-1,sb(n)),n=t.cancelPendingCommit,n!==null&&(t.cancelPendingCommit=null,n()),ga=0,eu(),se=t,Dt=n=aa(t.current,null),Rt=e,Jt=0,yn=null,Oa=!1,Ws=de(t,e),Pc=!1,ti=bn=Fc=ps=za=be=0,un=al=null,Jc=!1,(e&8)!==0&&(e|=e&32);var s=t.entangledLanes;if(s!==0)for(t=t.entanglements,s&=e;0<s;){var r=31-J(s),c=1<<r;e|=t[r],s&=~c}return pa=e,Ql(),n}function Um(t,e){xt=null,B.H=Pi,e===Zs||e===no?(e=Wf(),Jt=3):e===ic?(e=Wf(),Jt=4):Jt=e===Rc?8:e!==null&&typeof e=="object"&&typeof e.then=="function"?6:1,yn=e,Dt===null&&(be=1,vo(t,Nn(e,t.current)))}function Vm(){var t=gn.current;return t===null?!0:(Rt&4194048)===Rt?kn===null:(Rt&62914560)===Rt||(Rt&536870912)!==0?t===kn:!1}function Lm(){var t=B.H;return B.H=Pi,t===null?Pi:t}function qm(){var t=B.A;return B.A=B1,t}function Do(){be=4,Oa||(Rt&4194048)!==Rt&&gn.current!==null||(Ws=!0),(za&134217727)===0&&(ps&134217727)===0||se===null||Va(se,Rt,bn,!1)}function nu(t,e,n){var s=It;It|=2;var r=Lm(),c=qm();(se!==t||Rt!==e)&&(Eo=null,ni(t,e)),e=!1;var m=be;t:do try{if(Jt!==0&&Dt!==null){var y=Dt,T=yn;switch(Jt){case 8:eu(),m=6;break t;case 3:case 2:case 9:case 6:gn.current===null&&(e=!0);var D=Jt;if(Jt=0,yn=null,ai(t,y,T,D),n&&Ws){m=0;break t}break;default:D=Jt,Jt=0,yn=null,ai(t,y,T,D)}}L1(),m=be;break}catch(L){Um(t,L)}while(!0);return e&&t.shellSuspendCounter++,ia=ls=null,It=s,B.H=r,B.A=c,Dt===null&&(se=null,Rt=0,Ql()),m}function L1(){for(;Dt!==null;)Hm(Dt)}function q1(t,e){var n=It;It|=2;var s=Lm(),r=qm();se!==t||Rt!==e?(Eo=null,No=Nt()+500,ni(t,e)):Ws=de(t,e);t:do try{if(Jt!==0&&Dt!==null){e=Dt;var c=yn;e:switch(Jt){case 1:Jt=0,yn=null,ai(t,e,c,1);break;case 2:case 9:if(Jf(c)){Jt=0,yn=null,Gm(e);break}e=function(){Jt!==2&&Jt!==9||se!==t||(Jt=7),Kn(t)},c.then(e,e);break t;case 3:Jt=7;break t;case 4:Jt=5;break t;case 7:Jf(c)?(Jt=0,yn=null,Gm(e)):(Jt=0,yn=null,ai(t,e,c,7));break;case 5:var m=null;switch(Dt.tag){case 26:m=Dt.memoizedState;case 5:case 27:var y=Dt;if(m?Ep(m):y.stateNode.complete){Jt=0,yn=null;var T=y.sibling;if(T!==null)Dt=T;else{var D=y.return;D!==null?(Dt=D,ko(D)):Dt=null}break e}}Jt=0,yn=null,ai(t,e,c,5);break;case 6:Jt=0,yn=null,ai(t,e,c,6);break;case 8:eu(),be=6;break t;default:throw Error(o(462))}}H1();break}catch(L){Um(t,L)}while(!0);return ia=ls=null,B.H=s,B.A=r,It=n,Dt!==null?0:(se=null,Rt=0,Ql(),be)}function H1(){for(;Dt!==null&&!St();)Hm(Dt)}function Hm(t){var e=dm(t.alternate,t,pa);t.memoizedProps=t.pendingProps,e===null?ko(t):Dt=e}function Gm(t){var e=t,n=e.alternate;switch(e.tag){case 15:case 0:e=im(n,e,e.pendingProps,e.type,void 0,Rt);break;case 11:e=im(n,e,e.pendingProps,e.type.render,e.ref,Rt);break;case 5:vc(e);default:hm(n,e),e=Dt=qf(e,pa),e=dm(n,e,pa)}t.memoizedProps=t.pendingProps,e===null?ko(t):Dt=e}function ai(t,e,n,s){ia=ls=null,vc(e),Ks=null,Hi=0;var r=e.return;try{if(D1(t,r,e,n,Rt)){be=1,vo(t,Nn(n,t.current)),Dt=null;return}}catch(c){if(r!==null)throw Dt=r,c;be=1,vo(t,Nn(n,t.current)),Dt=null;return}e.flags&32768?(Bt||s===1?t=!0:Ws||(Rt&536870912)!==0?t=!1:(Oa=t=!0,(s===2||s===9||s===3||s===6)&&(s=gn.current,s!==null&&s.tag===13&&(s.flags|=16384))),Im(e,t)):ko(e)}function ko(t){var e=t;do{if((e.flags&32768)!==0){Im(e,Oa);return}t=e.return;var n=M1(e.alternate,e,pa);if(n!==null){Dt=n;return}if(e=e.sibling,e!==null){Dt=e;return}Dt=e=t}while(e!==null);be===0&&(be=5)}function Im(t,e){do{var n=R1(t.alternate,t);if(n!==null){n.flags&=32767,Dt=n;return}if(n=t.return,n!==null&&(n.flags|=32768,n.subtreeFlags=0,n.deletions=null),!e&&(t=t.sibling,t!==null)){Dt=t;return}Dt=t=n}while(t!==null);be=6,Dt=null}function Ym(t,e,n,s,r,c,m,y,T){t.cancelPendingCommit=null;do wo();while(Re!==0);if((It&6)!==0)throw Error(o(327));if(e!==null){if(e===t.current)throw Error(o(177));if(c=e.lanes|e.childLanes,c|=Yr,Bl(t,n,c,m,y,T),t===se&&(Dt=se=null,Rt=0),ei=e,Ua=t,ga=n,$c=c,Wc=r,Rm=s,(e.subtreeFlags&10256)!==0||(e.flags&10256)!==0?(t.callbackNode=null,t.callbackPriority=0,Z1(Ft,function(){return Pm(),null})):(t.callbackNode=null,t.callbackPriority=0),s=(e.flags&13878)!==0,(e.subtreeFlags&13878)!==0||s){s=B.T,B.T=null,r=Q.p,Q.p=2,m=It,It|=4;try{O1(t,e,n)}finally{It=m,Q.p=r,B.T=s}}Re=1,Zm(),Km(),Xm()}}function Zm(){if(Re===1){Re=0;var t=Ua,e=ei,n=(e.flags&13878)!==0;if((e.subtreeFlags&13878)!==0||n){n=B.T,B.T=null;var s=Q.p;Q.p=2;var r=It;It|=4;try{Am(e,t);var c=mu,m=wf(t.containerInfo),y=c.focusedElem,T=c.selectionRange;if(m!==y&&y&&y.ownerDocument&&kf(y.ownerDocument.documentElement,y)){if(T!==null&&Lr(y)){var D=T.start,L=T.end;if(L===void 0&&(L=D),"selectionStart"in y)y.selectionStart=D,y.selectionEnd=Math.min(L,y.value.length);else{var Z=y.ownerDocument||document,M=Z&&Z.defaultView||window;if(M.getSelection){var O=M.getSelection(),ot=y.textContent.length,pt=Math.min(T.start,ot),ne=T.end===void 0?pt:Math.min(T.end,ot);!O.extend&&pt>ne&&(m=ne,ne=pt,pt=m);var N=Df(y,pt),j=Df(y,ne);if(N&&j&&(O.rangeCount!==1||O.anchorNode!==N.node||O.anchorOffset!==N.offset||O.focusNode!==j.node||O.focusOffset!==j.offset)){var C=Z.createRange();C.setStart(N.node,N.offset),O.removeAllRanges(),pt>ne?(O.addRange(C),O.extend(j.node,j.offset)):(C.setEnd(j.node,j.offset),O.addRange(C))}}}}for(Z=[],O=y;O=O.parentNode;)O.nodeType===1&&Z.push({element:O,left:O.scrollLeft,top:O.scrollTop});for(typeof y.focus=="function"&&y.focus(),y=0;y<Z.length;y++){var G=Z[y];G.element.scrollLeft=G.left,G.element.scrollTop=G.top}}Io=!!hu,mu=hu=null}finally{It=r,Q.p=s,B.T=n}}t.current=e,Re=2}}function Km(){if(Re===2){Re=0;var t=Ua,e=ei,n=(e.flags&8772)!==0;if((e.subtreeFlags&8772)!==0||n){n=B.T,B.T=null;var s=Q.p;Q.p=2;var r=It;It|=4;try{Sm(t,e.alternate,e)}finally{It=r,Q.p=s,B.T=n}}Re=3}}function Xm(){if(Re===4||Re===3){Re=0,gt();var t=Ua,e=ei,n=ga,s=Rm;(e.subtreeFlags&10256)!==0||(e.flags&10256)!==0?Re=5:(Re=0,ei=Ua=null,Qm(t,t.pendingLanes));var r=t.pendingLanes;if(r===0&&(Ba=null),Ns(n),e=e.stateNode,Ge&&typeof Ge.onCommitFiberRoot=="function")try{Ge.onCommitFiberRoot(He,e,void 0,(e.current.flags&128)===128)}catch{}if(s!==null){e=B.T,r=Q.p,Q.p=2,B.T=null;try{for(var c=t.onRecoverableError,m=0;m<s.length;m++){var y=s[m];c(y.value,{componentStack:y.stack})}}finally{B.T=e,Q.p=r}}(ga&3)!==0&&wo(),Kn(t),r=t.pendingLanes,(n&261930)!==0&&(r&42)!==0?t===tu?sl++:(sl=0,tu=t):sl=0,il(0)}}function Qm(t,e){(t.pooledCacheLanes&=e)===0&&(e=t.pooledCache,e!=null&&(t.pooledCache=null,Li(e)))}function wo(){return Zm(),Km(),Xm(),Pm()}function Pm(){if(Re!==5)return!1;var t=Ua,e=$c;$c=0;var n=Ns(ga),s=B.T,r=Q.p;try{Q.p=32>n?32:n,B.T=null,n=Wc,Wc=null;var c=Ua,m=ga;if(Re=0,ei=Ua=null,ga=0,(It&6)!==0)throw Error(o(331));var y=It;if(It|=4,km(c.current),Em(c,c.current,m,n),It=y,il(0,!1),Ge&&typeof Ge.onPostCommitFiberRoot=="function")try{Ge.onPostCommitFiberRoot(He,c)}catch{}return!0}finally{Q.p=r,B.T=s,Qm(t,e)}}function Fm(t,e,n){e=Nn(n,e),e=Mc(t.stateNode,e,2),t=ka(t,e,2),t!==null&&(Ta(t,2),Kn(t))}function $t(t,e,n){if(t.tag===3)Fm(t,t,n);else for(;e!==null;){if(e.tag===3){Fm(e,t,n);break}else if(e.tag===1){var s=e.stateNode;if(typeof e.type.getDerivedStateFromError=="function"||typeof s.componentDidCatch=="function"&&(Ba===null||!Ba.has(s))){t=Nn(n,t),n=Jh(2),s=ka(e,n,2),s!==null&&($h(n,s,e,t),Ta(s,2),Kn(s));break}}e=e.return}}function au(t,e,n){var s=t.pingCache;if(s===null){s=t.pingCache=new U1;var r=new Set;s.set(e,r)}else r=s.get(e),r===void 0&&(r=new Set,s.set(e,r));r.has(n)||(Pc=!0,r.add(n),t=G1.bind(null,t,e,n),e.then(t,t))}function G1(t,e,n){var s=t.pingCache;s!==null&&s.delete(e),t.pingedLanes|=t.suspendedLanes&n,t.warmLanes&=~n,se===t&&(Rt&n)===n&&(be===4||be===3&&(Rt&62914560)===Rt&&300>Nt()-Ao?(It&2)===0&&ni(t,0):Fc|=n,ti===Rt&&(ti=0)),Kn(t)}function Jm(t,e){e===0&&(e=_a()),t=as(t,e),t!==null&&(Ta(t,e),Kn(t))}function I1(t){var e=t.memoizedState,n=0;e!==null&&(n=e.retryLane),Jm(t,n)}function Y1(t,e){var n=0;switch(t.tag){case 31:case 13:var s=t.stateNode,r=t.memoizedState;r!==null&&(n=r.retryLane);break;case 19:s=t.stateNode;break;case 22:s=t.stateNode._retryCache;break;default:throw Error(o(314))}s!==null&&s.delete(e),Jm(t,n)}function Z1(t,e){return W(t,e)}var Mo=null,si=null,su=!1,Ro=!1,iu=!1,La=0;function Kn(t){t!==si&&t.next===null&&(si===null?Mo=si=t:si=si.next=t),Ro=!0,su||(su=!0,X1())}function il(t,e){if(!iu&&Ro){iu=!0;do for(var n=!1,s=Mo;s!==null;){if(t!==0){var r=s.pendingLanes;if(r===0)var c=0;else{var m=s.suspendedLanes,y=s.pingedLanes;c=(1<<31-J(42|t)+1)-1,c&=r&~(m&~y),c=c&201326741?c&201326741|1:c?c|2:0}c!==0&&(n=!0,ep(s,c))}else c=Rt,c=it(s,s===se?c:0,s.cancelPendingCommit!==null||s.timeoutHandle!==-1),(c&3)===0||de(s,c)||(n=!0,ep(s,c));s=s.next}while(n);iu=!1}}function K1(){$m()}function $m(){Ro=su=!1;var t=0;La!==0&&ab()&&(t=La);for(var e=Nt(),n=null,s=Mo;s!==null;){var r=s.next,c=Wm(s,e);c===0?(s.next=null,n===null?Mo=r:n.next=r,r===null&&(si=n)):(n=s,(t!==0||(c&3)!==0)&&(Ro=!0)),s=r}Re!==0&&Re!==5||il(t),La!==0&&(La=0)}function Wm(t,e){for(var n=t.suspendedLanes,s=t.pingedLanes,r=t.expirationTimes,c=t.pendingLanes&-62914561;0<c;){var m=31-J(c),y=1<<m,T=r[m];T===-1?((y&n)===0||(y&s)!==0)&&(r[m]=hn(y,e)):T<=e&&(t.expiredLanes|=y),c&=~y}if(e=se,n=Rt,n=it(t,t===e?n:0,t.cancelPendingCommit!==null||t.timeoutHandle!==-1),s=t.callbackNode,n===0||t===e&&(Jt===2||Jt===9)||t.cancelPendingCommit!==null)return s!==null&&s!==null&&ct(s),t.callbackNode=null,t.callbackPriority=0;if((n&3)===0||de(t,n)){if(e=n&-n,e===t.callbackPriority)return e;switch(s!==null&&ct(s),Ns(n)){case 2:case 8:n=ie;break;case 32:n=Ft;break;case 268435456:n=H;break;default:n=Ft}return s=tp.bind(null,t),n=W(n,s),t.callbackPriority=e,t.callbackNode=n,e}return s!==null&&s!==null&&ct(s),t.callbackPriority=2,t.callbackNode=null,2}function tp(t,e){if(Re!==0&&Re!==5)return t.callbackNode=null,t.callbackPriority=0,null;var n=t.callbackNode;if(wo()&&t.callbackNode!==n)return null;var s=Rt;return s=it(t,t===se?s:0,t.cancelPendingCommit!==null||t.timeoutHandle!==-1),s===0?null:(zm(t,s,e),Wm(t,Nt()),t.callbackNode!=null&&t.callbackNode===n?tp.bind(null,t):null)}function ep(t,e){if(wo())return null;zm(t,e,!0)}function X1(){ib(function(){(It&6)!==0?W(Yt,K1):$m()})}function lu(){if(La===0){var t=Is;t===0&&(t=dt,dt<<=1,(dt&261888)===0&&(dt=256)),La=t}return La}function np(t){return t==null||typeof t=="symbol"||typeof t=="boolean"?null:typeof t=="function"?t:ql(""+t)}function ap(t,e){var n=e.ownerDocument.createElement("input");return n.name=e.name,n.value=e.value,t.id&&n.setAttribute("form",t.id),e.parentNode.insertBefore(n,e),t=new FormData(t),n.parentNode.removeChild(n),t}function Q1(t,e,n,s,r){if(e==="submit"&&n&&n.stateNode===r){var c=np((r[at]||null).action),m=s.submitter;m&&(e=(e=m[at]||null)?np(e.formAction):m.getAttribute("formAction"),e!==null&&(c=e,m=null));var y=new Yl("action","action",null,s,r);t.push({event:y,listeners:[{instance:null,listener:function(){if(s.defaultPrevented){if(La!==0){var T=m?ap(r,m):new FormData(r);Nc(n,{pending:!0,data:T,method:r.method,action:c},null,T)}}else typeof c=="function"&&(y.preventDefault(),T=m?ap(r,m):new FormData(r),Nc(n,{pending:!0,data:T,method:r.method,action:c},c,T))},currentTarget:r}]})}}for(var ou=0;ou<Ir.length;ou++){var ru=Ir[ou],P1=ru.toLowerCase(),F1=ru[0].toUpperCase()+ru.slice(1);Un(P1,"on"+F1)}Un(Of,"onAnimationEnd"),Un(zf,"onAnimationIteration"),Un(Bf,"onAnimationStart"),Un("dblclick","onDoubleClick"),Un("focusin","onFocus"),Un("focusout","onBlur"),Un(f1,"onTransitionRun"),Un(h1,"onTransitionStart"),Un(m1,"onTransitionCancel"),Un(Uf,"onTransitionEnd"),Ds("onMouseEnter",["mouseout","mouseover"]),Ds("onMouseLeave",["mouseout","mouseover"]),Ds("onPointerEnter",["pointerout","pointerover"]),Ds("onPointerLeave",["pointerout","pointerover"]),Wa("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Wa("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Wa("onBeforeInput",["compositionend","keypress","textInput","paste"]),Wa("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Wa("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Wa("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var ll="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(" "),J1=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(ll));function sp(t,e){e=(e&4)!==0;for(var n=0;n<t.length;n++){var s=t[n],r=s.event;s=s.listeners;t:{var c=void 0;if(e)for(var m=s.length-1;0<=m;m--){var y=s[m],T=y.instance,D=y.currentTarget;if(y=y.listener,T!==c&&r.isPropagationStopped())break t;c=y,r.currentTarget=D;try{c(r)}catch(L){Xl(L)}r.currentTarget=null,c=T}else for(m=0;m<s.length;m++){if(y=s[m],T=y.instance,D=y.currentTarget,y=y.listener,T!==c&&r.isPropagationStopped())break t;c=y,r.currentTarget=D;try{c(r)}catch(L){Xl(L)}r.currentTarget=null,c=T}}}}function kt(t,e){var n=e[Ct];n===void 0&&(n=e[Ct]=new Set);var s=t+"__bubble";n.has(s)||(ip(e,t,2,!1),n.add(s))}function cu(t,e,n){var s=0;e&&(s|=4),ip(n,t,s,e)}var Oo="_reactListening"+Math.random().toString(36).slice(2);function uu(t){if(!t[Oo]){t[Oo]=!0,Jd.forEach(function(n){n!=="selectionchange"&&(J1.has(n)||cu(n,!1,t),cu(n,!0,t))});var e=t.nodeType===9?t:t.ownerDocument;e===null||e[Oo]||(e[Oo]=!0,cu("selectionchange",!1,e))}}function ip(t,e,n,s){switch(Op(e)){case 2:var r=Ab;break;case 8:r=Nb;break;default:r=Au}n=r.bind(null,e,n,t),r=void 0,!kr||e!=="touchstart"&&e!=="touchmove"&&e!=="wheel"||(r=!0),s?r!==void 0?t.addEventListener(e,n,{capture:!0,passive:r}):t.addEventListener(e,n,!0):r!==void 0?t.addEventListener(e,n,{passive:r}):t.addEventListener(e,n,!1)}function du(t,e,n,s,r){var c=s;if((e&1)===0&&(e&2)===0&&s!==null)t:for(;;){if(s===null)return;var m=s.tag;if(m===3||m===4){var y=s.stateNode.containerInfo;if(y===r)break;if(m===4)for(m=s.return;m!==null;){var T=m.tag;if((T===3||T===4)&&m.stateNode.containerInfo===r)return;m=m.return}for(;y!==null;){if(m=Wn(y),m===null)return;if(T=m.tag,T===5||T===6||T===26||T===27){s=c=m;continue t}y=y.parentNode}}s=s.return}uf(function(){var D=c,L=Cr(n),Z=[];t:{var M=Vf.get(t);if(M!==void 0){var O=Yl,ot=t;switch(t){case"keypress":if(Gl(n)===0)break t;case"keydown":case"keyup":O=Yy;break;case"focusin":ot="focus",O=Or;break;case"focusout":ot="blur",O=Or;break;case"beforeblur":case"afterblur":O=Or;break;case"click":if(n.button===2)break t;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":O=hf;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":O=My;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":O=Xy;break;case Of:case zf:case Bf:O=zy;break;case Uf:O=Py;break;case"scroll":case"scrollend":O=ky;break;case"wheel":O=Jy;break;case"copy":case"cut":case"paste":O=Uy;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":O=pf;break;case"toggle":case"beforetoggle":O=Wy}var pt=(e&4)!==0,ne=!pt&&(t==="scroll"||t==="scrollend"),N=pt?M!==null?M+"Capture":null:M;pt=[];for(var j=D,C;j!==null;){var G=j;if(C=G.stateNode,G=G.tag,G!==5&&G!==26&&G!==27||C===null||N===null||(G=Ci(j,N),G!=null&&pt.push(ol(j,G,C))),ne)break;j=j.return}0<pt.length&&(M=new O(M,ot,null,n,L),Z.push({event:M,listeners:pt}))}}if((e&7)===0){t:{if(M=t==="mouseover"||t==="pointerover",O=t==="mouseout"||t==="pointerout",M&&n!==Er&&(ot=n.relatedTarget||n.fromElement)&&(Wn(ot)||ot[Et]))break t;if((O||M)&&(M=L.window===L?L:(M=L.ownerDocument)?M.defaultView||M.parentWindow:window,O?(ot=n.relatedTarget||n.toElement,O=D,ot=ot?Wn(ot):null,ot!==null&&(ne=h(ot),pt=ot.tag,ot!==ne||pt!==5&&pt!==27&&pt!==6)&&(ot=null)):(O=null,ot=D),O!==ot)){if(pt=hf,G="onMouseLeave",N="onMouseEnter",j="mouse",(t==="pointerout"||t==="pointerover")&&(pt=pf,G="onPointerLeave",N="onPointerEnter",j="pointer"),ne=O==null?M:Ei(O),C=ot==null?M:Ei(ot),M=new pt(G,j+"leave",O,n,L),M.target=ne,M.relatedTarget=C,G=null,Wn(L)===D&&(pt=new pt(N,j+"enter",ot,n,L),pt.target=C,pt.relatedTarget=ne,G=pt),ne=G,O&&ot)e:{for(pt=$1,N=O,j=ot,C=0,G=N;G;G=pt(G))C++;G=0;for(var ft=j;ft;ft=pt(ft))G++;for(;0<C-G;)N=pt(N),C--;for(;0<G-C;)j=pt(j),G--;for(;C--;){if(N===j||j!==null&&N===j.alternate){pt=N;break e}N=pt(N),j=pt(j)}pt=null}else pt=null;O!==null&&lp(Z,M,O,pt,!1),ot!==null&&ne!==null&&lp(Z,ne,ot,pt,!0)}}t:{if(M=D?Ei(D):window,O=M.nodeName&&M.nodeName.toLowerCase(),O==="select"||O==="input"&&M.type==="file")var Lt=xf;else if(_f(M))if(jf)Lt=c1;else{Lt=o1;var ut=l1}else O=M.nodeName,!O||O.toLowerCase()!=="input"||M.type!=="checkbox"&&M.type!=="radio"?D&&Nr(D.elementType)&&(Lt=xf):Lt=r1;if(Lt&&(Lt=Lt(t,D))){Tf(Z,Lt,n,L);break t}ut&&ut(t,M,D),t==="focusout"&&D&&M.type==="number"&&D.memoizedProps.value!=null&&Ar(M,"number",M.value)}switch(ut=D?Ei(D):window,t){case"focusin":(_f(ut)||ut.contentEditable==="true")&&(zs=ut,qr=D,Bi=null);break;case"focusout":Bi=qr=zs=null;break;case"mousedown":Hr=!0;break;case"contextmenu":case"mouseup":case"dragend":Hr=!1,Mf(Z,n,L);break;case"selectionchange":if(d1)break;case"keydown":case"keyup":Mf(Z,n,L)}var jt;if(Br)t:{switch(t){case"compositionstart":var Ot="onCompositionStart";break t;case"compositionend":Ot="onCompositionEnd";break t;case"compositionupdate":Ot="onCompositionUpdate";break t}Ot=void 0}else Os?bf(t,n)&&(Ot="onCompositionEnd"):t==="keydown"&&n.keyCode===229&&(Ot="onCompositionStart");Ot&&(gf&&n.locale!=="ko"&&(Os||Ot!=="onCompositionStart"?Ot==="onCompositionEnd"&&Os&&(jt=df()):(xa=L,wr="value"in xa?xa.value:xa.textContent,Os=!0)),ut=zo(D,Ot),0<ut.length&&(Ot=new mf(Ot,t,null,n,L),Z.push({event:Ot,listeners:ut}),jt?Ot.data=jt:(jt=Sf(n),jt!==null&&(Ot.data=jt)))),(jt=e1?n1(t,n):a1(t,n))&&(Ot=zo(D,"onBeforeInput"),0<Ot.length&&(ut=new mf("onBeforeInput","beforeinput",null,n,L),Z.push({event:ut,listeners:Ot}),ut.data=jt)),Q1(Z,t,D,n,L)}sp(Z,e)})}function ol(t,e,n){return{instance:t,listener:e,currentTarget:n}}function zo(t,e){for(var n=e+"Capture",s=[];t!==null;){var r=t,c=r.stateNode;if(r=r.tag,r!==5&&r!==26&&r!==27||c===null||(r=Ci(t,n),r!=null&&s.unshift(ol(t,r,c)),r=Ci(t,e),r!=null&&s.push(ol(t,r,c))),t.tag===3)return s;t=t.return}return[]}function $1(t){if(t===null)return null;do t=t.return;while(t&&t.tag!==5&&t.tag!==27);return t||null}function lp(t,e,n,s,r){for(var c=e._reactName,m=[];n!==null&&n!==s;){var y=n,T=y.alternate,D=y.stateNode;if(y=y.tag,T!==null&&T===s)break;y!==5&&y!==26&&y!==27||D===null||(T=D,r?(D=Ci(n,c),D!=null&&m.unshift(ol(n,D,T))):r||(D=Ci(n,c),D!=null&&m.push(ol(n,D,T)))),n=n.return}m.length!==0&&t.push({event:e,listeners:m})}var W1=/\r\n?/g,tb=/\u0000|\uFFFD/g;function op(t){return(typeof t=="string"?t:""+t).replace(W1,`
25
- `).replace(tb,"")}function rp(t,e){return e=op(e),op(t)===e}function ee(t,e,n,s,r,c){switch(n){case"children":typeof s=="string"?e==="body"||e==="textarea"&&s===""||ws(t,s):(typeof s=="number"||typeof s=="bigint")&&e!=="body"&&ws(t,""+s);break;case"className":Vl(t,"class",s);break;case"tabIndex":Vl(t,"tabindex",s);break;case"dir":case"role":case"viewBox":case"width":case"height":Vl(t,n,s);break;case"style":rf(t,s,c);break;case"data":if(e!=="object"){Vl(t,"data",s);break}case"src":case"href":if(s===""&&(e!=="a"||n!=="href")){t.removeAttribute(n);break}if(s==null||typeof s=="function"||typeof s=="symbol"||typeof s=="boolean"){t.removeAttribute(n);break}s=ql(""+s),t.setAttribute(n,s);break;case"action":case"formAction":if(typeof s=="function"){t.setAttribute(n,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof c=="function"&&(n==="formAction"?(e!=="input"&&ee(t,e,"name",r.name,r,null),ee(t,e,"formEncType",r.formEncType,r,null),ee(t,e,"formMethod",r.formMethod,r,null),ee(t,e,"formTarget",r.formTarget,r,null)):(ee(t,e,"encType",r.encType,r,null),ee(t,e,"method",r.method,r,null),ee(t,e,"target",r.target,r,null)));if(s==null||typeof s=="symbol"||typeof s=="boolean"){t.removeAttribute(n);break}s=ql(""+s),t.setAttribute(n,s);break;case"onClick":s!=null&&(t.onclick=ea);break;case"onScroll":s!=null&&kt("scroll",t);break;case"onScrollEnd":s!=null&&kt("scrollend",t);break;case"dangerouslySetInnerHTML":if(s!=null){if(typeof s!="object"||!("__html"in s))throw Error(o(61));if(n=s.__html,n!=null){if(r.children!=null)throw Error(o(60));t.innerHTML=n}}break;case"multiple":t.multiple=s&&typeof s!="function"&&typeof s!="symbol";break;case"muted":t.muted=s&&typeof s!="function"&&typeof s!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(s==null||typeof s=="function"||typeof s=="boolean"||typeof s=="symbol"){t.removeAttribute("xlink:href");break}n=ql(""+s),t.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",n);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":s!=null&&typeof s!="function"&&typeof s!="symbol"?t.setAttribute(n,""+s):t.removeAttribute(n);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":s&&typeof s!="function"&&typeof s!="symbol"?t.setAttribute(n,""):t.removeAttribute(n);break;case"capture":case"download":s===!0?t.setAttribute(n,""):s!==!1&&s!=null&&typeof s!="function"&&typeof s!="symbol"?t.setAttribute(n,s):t.removeAttribute(n);break;case"cols":case"rows":case"size":case"span":s!=null&&typeof s!="function"&&typeof s!="symbol"&&!isNaN(s)&&1<=s?t.setAttribute(n,s):t.removeAttribute(n);break;case"rowSpan":case"start":s==null||typeof s=="function"||typeof s=="symbol"||isNaN(s)?t.removeAttribute(n):t.setAttribute(n,s);break;case"popover":kt("beforetoggle",t),kt("toggle",t),Ul(t,"popover",s);break;case"xlinkActuate":ta(t,"http://www.w3.org/1999/xlink","xlink:actuate",s);break;case"xlinkArcrole":ta(t,"http://www.w3.org/1999/xlink","xlink:arcrole",s);break;case"xlinkRole":ta(t,"http://www.w3.org/1999/xlink","xlink:role",s);break;case"xlinkShow":ta(t,"http://www.w3.org/1999/xlink","xlink:show",s);break;case"xlinkTitle":ta(t,"http://www.w3.org/1999/xlink","xlink:title",s);break;case"xlinkType":ta(t,"http://www.w3.org/1999/xlink","xlink:type",s);break;case"xmlBase":ta(t,"http://www.w3.org/XML/1998/namespace","xml:base",s);break;case"xmlLang":ta(t,"http://www.w3.org/XML/1998/namespace","xml:lang",s);break;case"xmlSpace":ta(t,"http://www.w3.org/XML/1998/namespace","xml:space",s);break;case"is":Ul(t,"is",s);break;case"innerText":case"textContent":break;default:(!(2<n.length)||n[0]!=="o"&&n[0]!=="O"||n[1]!=="n"&&n[1]!=="N")&&(n=Cy.get(n)||n,Ul(t,n,s))}}function fu(t,e,n,s,r,c){switch(n){case"style":rf(t,s,c);break;case"dangerouslySetInnerHTML":if(s!=null){if(typeof s!="object"||!("__html"in s))throw Error(o(61));if(n=s.__html,n!=null){if(r.children!=null)throw Error(o(60));t.innerHTML=n}}break;case"children":typeof s=="string"?ws(t,s):(typeof s=="number"||typeof s=="bigint")&&ws(t,""+s);break;case"onScroll":s!=null&&kt("scroll",t);break;case"onScrollEnd":s!=null&&kt("scrollend",t);break;case"onClick":s!=null&&(t.onclick=ea);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!$d.hasOwnProperty(n))t:{if(n[0]==="o"&&n[1]==="n"&&(r=n.endsWith("Capture"),e=n.slice(2,r?n.length-7:void 0),c=t[at]||null,c=c!=null?c[n]:null,typeof c=="function"&&t.removeEventListener(e,c,r),typeof s=="function")){typeof c!="function"&&c!==null&&(n in t?t[n]=null:t.hasAttribute(n)&&t.removeAttribute(n)),t.addEventListener(e,s,r);break t}n in t?t[n]=s:s===!0?t.setAttribute(n,""):Ul(t,n,s)}}}function Ke(t,e,n){switch(e){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":kt("error",t),kt("load",t);var s=!1,r=!1,c;for(c in n)if(n.hasOwnProperty(c)){var m=n[c];if(m!=null)switch(c){case"src":s=!0;break;case"srcSet":r=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(o(137,e));default:ee(t,e,c,m,n,null)}}r&&ee(t,e,"srcSet",n.srcSet,n,null),s&&ee(t,e,"src",n.src,n,null);return;case"input":kt("invalid",t);var y=c=m=r=null,T=null,D=null;for(s in n)if(n.hasOwnProperty(s)){var L=n[s];if(L!=null)switch(s){case"name":r=L;break;case"type":m=L;break;case"checked":T=L;break;case"defaultChecked":D=L;break;case"value":c=L;break;case"defaultValue":y=L;break;case"children":case"dangerouslySetInnerHTML":if(L!=null)throw Error(o(137,e));break;default:ee(t,e,s,L,n,null)}}af(t,c,y,T,D,m,r,!1);return;case"select":kt("invalid",t),s=m=c=null;for(r in n)if(n.hasOwnProperty(r)&&(y=n[r],y!=null))switch(r){case"value":c=y;break;case"defaultValue":m=y;break;case"multiple":s=y;default:ee(t,e,r,y,n,null)}e=c,n=m,t.multiple=!!s,e!=null?ks(t,!!s,e,!1):n!=null&&ks(t,!!s,n,!0);return;case"textarea":kt("invalid",t),c=r=s=null;for(m in n)if(n.hasOwnProperty(m)&&(y=n[m],y!=null))switch(m){case"value":s=y;break;case"defaultValue":r=y;break;case"children":c=y;break;case"dangerouslySetInnerHTML":if(y!=null)throw Error(o(91));break;default:ee(t,e,m,y,n,null)}lf(t,s,r,c);return;case"option":for(T in n)if(n.hasOwnProperty(T)&&(s=n[T],s!=null))switch(T){case"selected":t.selected=s&&typeof s!="function"&&typeof s!="symbol";break;default:ee(t,e,T,s,n,null)}return;case"dialog":kt("beforetoggle",t),kt("toggle",t),kt("cancel",t),kt("close",t);break;case"iframe":case"object":kt("load",t);break;case"video":case"audio":for(s=0;s<ll.length;s++)kt(ll[s],t);break;case"image":kt("error",t),kt("load",t);break;case"details":kt("toggle",t);break;case"embed":case"source":case"link":kt("error",t),kt("load",t);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(D in n)if(n.hasOwnProperty(D)&&(s=n[D],s!=null))switch(D){case"children":case"dangerouslySetInnerHTML":throw Error(o(137,e));default:ee(t,e,D,s,n,null)}return;default:if(Nr(e)){for(L in n)n.hasOwnProperty(L)&&(s=n[L],s!==void 0&&fu(t,e,L,s,n,void 0));return}}for(y in n)n.hasOwnProperty(y)&&(s=n[y],s!=null&&ee(t,e,y,s,n,null))}function eb(t,e,n,s){switch(e){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var r=null,c=null,m=null,y=null,T=null,D=null,L=null;for(O in n){var Z=n[O];if(n.hasOwnProperty(O)&&Z!=null)switch(O){case"checked":break;case"value":break;case"defaultValue":T=Z;default:s.hasOwnProperty(O)||ee(t,e,O,null,s,Z)}}for(var M in s){var O=s[M];if(Z=n[M],s.hasOwnProperty(M)&&(O!=null||Z!=null))switch(M){case"type":c=O;break;case"name":r=O;break;case"checked":D=O;break;case"defaultChecked":L=O;break;case"value":m=O;break;case"defaultValue":y=O;break;case"children":case"dangerouslySetInnerHTML":if(O!=null)throw Error(o(137,e));break;default:O!==Z&&ee(t,e,M,O,s,Z)}}jr(t,m,y,T,D,L,c,r);return;case"select":O=m=y=M=null;for(c in n)if(T=n[c],n.hasOwnProperty(c)&&T!=null)switch(c){case"value":break;case"multiple":O=T;default:s.hasOwnProperty(c)||ee(t,e,c,null,s,T)}for(r in s)if(c=s[r],T=n[r],s.hasOwnProperty(r)&&(c!=null||T!=null))switch(r){case"value":M=c;break;case"defaultValue":y=c;break;case"multiple":m=c;default:c!==T&&ee(t,e,r,c,s,T)}e=y,n=m,s=O,M!=null?ks(t,!!n,M,!1):!!s!=!!n&&(e!=null?ks(t,!!n,e,!0):ks(t,!!n,n?[]:"",!1));return;case"textarea":O=M=null;for(y in n)if(r=n[y],n.hasOwnProperty(y)&&r!=null&&!s.hasOwnProperty(y))switch(y){case"value":break;case"children":break;default:ee(t,e,y,null,s,r)}for(m in s)if(r=s[m],c=n[m],s.hasOwnProperty(m)&&(r!=null||c!=null))switch(m){case"value":M=r;break;case"defaultValue":O=r;break;case"children":break;case"dangerouslySetInnerHTML":if(r!=null)throw Error(o(91));break;default:r!==c&&ee(t,e,m,r,s,c)}sf(t,M,O);return;case"option":for(var ot in n)if(M=n[ot],n.hasOwnProperty(ot)&&M!=null&&!s.hasOwnProperty(ot))switch(ot){case"selected":t.selected=!1;break;default:ee(t,e,ot,null,s,M)}for(T in s)if(M=s[T],O=n[T],s.hasOwnProperty(T)&&M!==O&&(M!=null||O!=null))switch(T){case"selected":t.selected=M&&typeof M!="function"&&typeof M!="symbol";break;default:ee(t,e,T,M,s,O)}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 pt in n)M=n[pt],n.hasOwnProperty(pt)&&M!=null&&!s.hasOwnProperty(pt)&&ee(t,e,pt,null,s,M);for(D in s)if(M=s[D],O=n[D],s.hasOwnProperty(D)&&M!==O&&(M!=null||O!=null))switch(D){case"children":case"dangerouslySetInnerHTML":if(M!=null)throw Error(o(137,e));break;default:ee(t,e,D,M,s,O)}return;default:if(Nr(e)){for(var ne in n)M=n[ne],n.hasOwnProperty(ne)&&M!==void 0&&!s.hasOwnProperty(ne)&&fu(t,e,ne,void 0,s,M);for(L in s)M=s[L],O=n[L],!s.hasOwnProperty(L)||M===O||M===void 0&&O===void 0||fu(t,e,L,M,s,O);return}}for(var N in n)M=n[N],n.hasOwnProperty(N)&&M!=null&&!s.hasOwnProperty(N)&&ee(t,e,N,null,s,M);for(Z in s)M=s[Z],O=n[Z],!s.hasOwnProperty(Z)||M===O||M==null&&O==null||ee(t,e,Z,M,s,O)}function cp(t){switch(t){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function nb(){if(typeof performance.getEntriesByType=="function"){for(var t=0,e=0,n=performance.getEntriesByType("resource"),s=0;s<n.length;s++){var r=n[s],c=r.transferSize,m=r.initiatorType,y=r.duration;if(c&&y&&cp(m)){for(m=0,y=r.responseEnd,s+=1;s<n.length;s++){var T=n[s],D=T.startTime;if(D>y)break;var L=T.transferSize,Z=T.initiatorType;L&&cp(Z)&&(T=T.responseEnd,m+=L*(T<y?1:(y-D)/(T-D)))}if(--s,e+=8*(c+m)/(r.duration/1e3),t++,10<t)break}}if(0<t)return e/t/1e6}return navigator.connection&&(t=navigator.connection.downlink,typeof t=="number")?t:5}var hu=null,mu=null;function Bo(t){return t.nodeType===9?t:t.ownerDocument}function up(t){switch(t){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function dp(t,e){if(t===0)switch(e){case"svg":return 1;case"math":return 2;default:return 0}return t===1&&e==="foreignObject"?0:t}function pu(t,e){return t==="textarea"||t==="noscript"||typeof e.children=="string"||typeof e.children=="number"||typeof e.children=="bigint"||typeof e.dangerouslySetInnerHTML=="object"&&e.dangerouslySetInnerHTML!==null&&e.dangerouslySetInnerHTML.__html!=null}var gu=null;function ab(){var t=window.event;return t&&t.type==="popstate"?t===gu?!1:(gu=t,!0):(gu=null,!1)}var fp=typeof setTimeout=="function"?setTimeout:void 0,sb=typeof clearTimeout=="function"?clearTimeout:void 0,hp=typeof Promise=="function"?Promise:void 0,ib=typeof queueMicrotask=="function"?queueMicrotask:typeof hp<"u"?function(t){return hp.resolve(null).then(t).catch(lb)}:fp;function lb(t){setTimeout(function(){throw t})}function qa(t){return t==="head"}function mp(t,e){var n=e,s=0;do{var r=n.nextSibling;if(t.removeChild(n),r&&r.nodeType===8)if(n=r.data,n==="/$"||n==="/&"){if(s===0){t.removeChild(r),ri(e);return}s--}else if(n==="$"||n==="$?"||n==="$~"||n==="$!"||n==="&")s++;else if(n==="html")rl(t.ownerDocument.documentElement);else if(n==="head"){n=t.ownerDocument.head,rl(n);for(var c=n.firstChild;c;){var m=c.nextSibling,y=c.nodeName;c[Ee]||y==="SCRIPT"||y==="STYLE"||y==="LINK"&&c.rel.toLowerCase()==="stylesheet"||n.removeChild(c),c=m}}else n==="body"&&rl(t.ownerDocument.body);n=r}while(n);ri(e)}function pp(t,e){var n=t;t=0;do{var s=n.nextSibling;if(n.nodeType===1?e?(n._stashedDisplay=n.style.display,n.style.display="none"):(n.style.display=n._stashedDisplay||"",n.getAttribute("style")===""&&n.removeAttribute("style")):n.nodeType===3&&(e?(n._stashedText=n.nodeValue,n.nodeValue=""):n.nodeValue=n._stashedText||""),s&&s.nodeType===8)if(n=s.data,n==="/$"){if(t===0)break;t--}else n!=="$"&&n!=="$?"&&n!=="$~"&&n!=="$!"||t++;n=s}while(n)}function vu(t){var e=t.firstChild;for(e&&e.nodeType===10&&(e=e.nextSibling);e;){var n=e;switch(e=e.nextSibling,n.nodeName){case"HTML":case"HEAD":case"BODY":vu(n),Bn(n);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(n.rel.toLowerCase()==="stylesheet")continue}t.removeChild(n)}}function ob(t,e,n,s){for(;t.nodeType===1;){var r=n;if(t.nodeName.toLowerCase()!==e.toLowerCase()){if(!s&&(t.nodeName!=="INPUT"||t.type!=="hidden"))break}else if(s){if(!t[Ee])switch(e){case"meta":if(!t.hasAttribute("itemprop"))break;return t;case"link":if(c=t.getAttribute("rel"),c==="stylesheet"&&t.hasAttribute("data-precedence"))break;if(c!==r.rel||t.getAttribute("href")!==(r.href==null||r.href===""?null:r.href)||t.getAttribute("crossorigin")!==(r.crossOrigin==null?null:r.crossOrigin)||t.getAttribute("title")!==(r.title==null?null:r.title))break;return t;case"style":if(t.hasAttribute("data-precedence"))break;return t;case"script":if(c=t.getAttribute("src"),(c!==(r.src==null?null:r.src)||t.getAttribute("type")!==(r.type==null?null:r.type)||t.getAttribute("crossorigin")!==(r.crossOrigin==null?null:r.crossOrigin))&&c&&t.hasAttribute("async")&&!t.hasAttribute("itemprop"))break;return t;default:return t}}else if(e==="input"&&t.type==="hidden"){var c=r.name==null?null:""+r.name;if(r.type==="hidden"&&t.getAttribute("name")===c)return t}else return t;if(t=wn(t.nextSibling),t===null)break}return null}function rb(t,e,n){if(e==="")return null;for(;t.nodeType!==3;)if((t.nodeType!==1||t.nodeName!=="INPUT"||t.type!=="hidden")&&!n||(t=wn(t.nextSibling),t===null))return null;return t}function gp(t,e){for(;t.nodeType!==8;)if((t.nodeType!==1||t.nodeName!=="INPUT"||t.type!=="hidden")&&!e||(t=wn(t.nextSibling),t===null))return null;return t}function yu(t){return t.data==="$?"||t.data==="$~"}function bu(t){return t.data==="$!"||t.data==="$?"&&t.ownerDocument.readyState!=="loading"}function cb(t,e){var n=t.ownerDocument;if(t.data==="$~")t._reactRetry=e;else if(t.data!=="$?"||n.readyState!=="loading")e();else{var s=function(){e(),n.removeEventListener("DOMContentLoaded",s)};n.addEventListener("DOMContentLoaded",s),t._reactRetry=s}}function wn(t){for(;t!=null;t=t.nextSibling){var e=t.nodeType;if(e===1||e===3)break;if(e===8){if(e=t.data,e==="$"||e==="$!"||e==="$?"||e==="$~"||e==="&"||e==="F!"||e==="F")break;if(e==="/$"||e==="/&")return null}}return t}var Su=null;function vp(t){t=t.nextSibling;for(var e=0;t;){if(t.nodeType===8){var n=t.data;if(n==="/$"||n==="/&"){if(e===0)return wn(t.nextSibling);e--}else n!=="$"&&n!=="$!"&&n!=="$?"&&n!=="$~"&&n!=="&"||e++}t=t.nextSibling}return null}function yp(t){t=t.previousSibling;for(var e=0;t;){if(t.nodeType===8){var n=t.data;if(n==="$"||n==="$!"||n==="$?"||n==="$~"||n==="&"){if(e===0)return t;e--}else n!=="/$"&&n!=="/&"||e++}t=t.previousSibling}return null}function bp(t,e,n){switch(e=Bo(n),t){case"html":if(t=e.documentElement,!t)throw Error(o(452));return t;case"head":if(t=e.head,!t)throw Error(o(453));return t;case"body":if(t=e.body,!t)throw Error(o(454));return t;default:throw Error(o(451))}}function rl(t){for(var e=t.attributes;e.length;)t.removeAttributeNode(e[0]);Bn(t)}var Mn=new Map,Sp=new Set;function Uo(t){return typeof t.getRootNode=="function"?t.getRootNode():t.nodeType===9?t:t.ownerDocument}var va=Q.d;Q.d={f:ub,r:db,D:fb,C:hb,L:mb,m:pb,X:vb,S:gb,M:yb};function ub(){var t=va.f(),e=Co();return t||e}function db(t){var e=Es(t);e!==null&&e.tag===5&&e.type==="form"?Uh(e):va.r(t)}var ii=typeof document>"u"?null:document;function _p(t,e,n){var s=ii;if(s&&typeof e=="string"&&e){var r=jn(e);r='link[rel="'+t+'"][href="'+r+'"]',typeof n=="string"&&(r+='[crossorigin="'+n+'"]'),Sp.has(r)||(Sp.add(r),t={rel:t,crossOrigin:n,href:e},s.querySelector(r)===null&&(e=s.createElement("link"),Ke(e,"link",t),Be(e),s.head.appendChild(e)))}}function fb(t){va.D(t),_p("dns-prefetch",t,null)}function hb(t,e){va.C(t,e),_p("preconnect",t,e)}function mb(t,e,n){va.L(t,e,n);var s=ii;if(s&&t&&e){var r='link[rel="preload"][as="'+jn(e)+'"]';e==="image"&&n&&n.imageSrcSet?(r+='[imagesrcset="'+jn(n.imageSrcSet)+'"]',typeof n.imageSizes=="string"&&(r+='[imagesizes="'+jn(n.imageSizes)+'"]')):r+='[href="'+jn(t)+'"]';var c=r;switch(e){case"style":c=li(t);break;case"script":c=oi(t)}Mn.has(c)||(t=S({rel:"preload",href:e==="image"&&n&&n.imageSrcSet?void 0:t,as:e},n),Mn.set(c,t),s.querySelector(r)!==null||e==="style"&&s.querySelector(cl(c))||e==="script"&&s.querySelector(ul(c))||(e=s.createElement("link"),Ke(e,"link",t),Be(e),s.head.appendChild(e)))}}function pb(t,e){va.m(t,e);var n=ii;if(n&&t){var s=e&&typeof e.as=="string"?e.as:"script",r='link[rel="modulepreload"][as="'+jn(s)+'"][href="'+jn(t)+'"]',c=r;switch(s){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":c=oi(t)}if(!Mn.has(c)&&(t=S({rel:"modulepreload",href:t},e),Mn.set(c,t),n.querySelector(r)===null)){switch(s){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(n.querySelector(ul(c)))return}s=n.createElement("link"),Ke(s,"link",t),Be(s),n.head.appendChild(s)}}}function gb(t,e,n){va.S(t,e,n);var s=ii;if(s&&t){var r=Cs(s).hoistableStyles,c=li(t);e=e||"default";var m=r.get(c);if(!m){var y={loading:0,preload:null};if(m=s.querySelector(cl(c)))y.loading=5;else{t=S({rel:"stylesheet",href:t,"data-precedence":e},n),(n=Mn.get(c))&&_u(t,n);var T=m=s.createElement("link");Be(T),Ke(T,"link",t),T._p=new Promise(function(D,L){T.onload=D,T.onerror=L}),T.addEventListener("load",function(){y.loading|=1}),T.addEventListener("error",function(){y.loading|=2}),y.loading|=4,Vo(m,e,s)}m={type:"stylesheet",instance:m,count:1,state:y},r.set(c,m)}}}function vb(t,e){va.X(t,e);var n=ii;if(n&&t){var s=Cs(n).hoistableScripts,r=oi(t),c=s.get(r);c||(c=n.querySelector(ul(r)),c||(t=S({src:t,async:!0},e),(e=Mn.get(r))&&Tu(t,e),c=n.createElement("script"),Be(c),Ke(c,"link",t),n.head.appendChild(c)),c={type:"script",instance:c,count:1,state:null},s.set(r,c))}}function yb(t,e){va.M(t,e);var n=ii;if(n&&t){var s=Cs(n).hoistableScripts,r=oi(t),c=s.get(r);c||(c=n.querySelector(ul(r)),c||(t=S({src:t,async:!0,type:"module"},e),(e=Mn.get(r))&&Tu(t,e),c=n.createElement("script"),Be(c),Ke(c,"link",t),n.head.appendChild(c)),c={type:"script",instance:c,count:1,state:null},s.set(r,c))}}function Tp(t,e,n,s){var r=(r=ve.current)?Uo(r):null;if(!r)throw Error(o(446));switch(t){case"meta":case"title":return null;case"style":return typeof n.precedence=="string"&&typeof n.href=="string"?(e=li(n.href),n=Cs(r).hoistableStyles,s=n.get(e),s||(s={type:"style",instance:null,count:0,state:null},n.set(e,s)),s):{type:"void",instance:null,count:0,state:null};case"link":if(n.rel==="stylesheet"&&typeof n.href=="string"&&typeof n.precedence=="string"){t=li(n.href);var c=Cs(r).hoistableStyles,m=c.get(t);if(m||(r=r.ownerDocument||r,m={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},c.set(t,m),(c=r.querySelector(cl(t)))&&!c._p&&(m.instance=c,m.state.loading=5),Mn.has(t)||(n={rel:"preload",as:"style",href:n.href,crossOrigin:n.crossOrigin,integrity:n.integrity,media:n.media,hrefLang:n.hrefLang,referrerPolicy:n.referrerPolicy},Mn.set(t,n),c||bb(r,t,n,m.state))),e&&s===null)throw Error(o(528,""));return m}if(e&&s!==null)throw Error(o(529,""));return null;case"script":return e=n.async,n=n.src,typeof n=="string"&&e&&typeof e!="function"&&typeof e!="symbol"?(e=oi(n),n=Cs(r).hoistableScripts,s=n.get(e),s||(s={type:"script",instance:null,count:0,state:null},n.set(e,s)),s):{type:"void",instance:null,count:0,state:null};default:throw Error(o(444,t))}}function li(t){return'href="'+jn(t)+'"'}function cl(t){return'link[rel="stylesheet"]['+t+"]"}function xp(t){return S({},t,{"data-precedence":t.precedence,precedence:null})}function bb(t,e,n,s){t.querySelector('link[rel="preload"][as="style"]['+e+"]")?s.loading=1:(e=t.createElement("link"),s.preload=e,e.addEventListener("load",function(){return s.loading|=1}),e.addEventListener("error",function(){return s.loading|=2}),Ke(e,"link",n),Be(e),t.head.appendChild(e))}function oi(t){return'[src="'+jn(t)+'"]'}function ul(t){return"script[async]"+t}function jp(t,e,n){if(e.count++,e.instance===null)switch(e.type){case"style":var s=t.querySelector('style[data-href~="'+jn(n.href)+'"]');if(s)return e.instance=s,Be(s),s;var r=S({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return s=(t.ownerDocument||t).createElement("style"),Be(s),Ke(s,"style",r),Vo(s,n.precedence,t),e.instance=s;case"stylesheet":r=li(n.href);var c=t.querySelector(cl(r));if(c)return e.state.loading|=4,e.instance=c,Be(c),c;s=xp(n),(r=Mn.get(r))&&_u(s,r),c=(t.ownerDocument||t).createElement("link"),Be(c);var m=c;return m._p=new Promise(function(y,T){m.onload=y,m.onerror=T}),Ke(c,"link",s),e.state.loading|=4,Vo(c,n.precedence,t),e.instance=c;case"script":return c=oi(n.src),(r=t.querySelector(ul(c)))?(e.instance=r,Be(r),r):(s=n,(r=Mn.get(c))&&(s=S({},n),Tu(s,r)),t=t.ownerDocument||t,r=t.createElement("script"),Be(r),Ke(r,"link",s),t.head.appendChild(r),e.instance=r);case"void":return null;default:throw Error(o(443,e.type))}else e.type==="stylesheet"&&(e.state.loading&4)===0&&(s=e.instance,e.state.loading|=4,Vo(s,n.precedence,t));return e.instance}function Vo(t,e,n){for(var s=n.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),r=s.length?s[s.length-1]:null,c=r,m=0;m<s.length;m++){var y=s[m];if(y.dataset.precedence===e)c=y;else if(c!==r)break}c?c.parentNode.insertBefore(t,c.nextSibling):(e=n.nodeType===9?n.head:n,e.insertBefore(t,e.firstChild))}function _u(t,e){t.crossOrigin==null&&(t.crossOrigin=e.crossOrigin),t.referrerPolicy==null&&(t.referrerPolicy=e.referrerPolicy),t.title==null&&(t.title=e.title)}function Tu(t,e){t.crossOrigin==null&&(t.crossOrigin=e.crossOrigin),t.referrerPolicy==null&&(t.referrerPolicy=e.referrerPolicy),t.integrity==null&&(t.integrity=e.integrity)}var Lo=null;function Ap(t,e,n){if(Lo===null){var s=new Map,r=Lo=new Map;r.set(n,s)}else r=Lo,s=r.get(n),s||(s=new Map,r.set(n,s));if(s.has(t))return s;for(s.set(t,null),n=n.getElementsByTagName(t),r=0;r<n.length;r++){var c=n[r];if(!(c[Ee]||c[Ne]||t==="link"&&c.getAttribute("rel")==="stylesheet")&&c.namespaceURI!=="http://www.w3.org/2000/svg"){var m=c.getAttribute(e)||"";m=t+m;var y=s.get(m);y?y.push(c):s.set(m,[c])}}return s}function Np(t,e,n){t=t.ownerDocument||t,t.head.insertBefore(n,e==="title"?t.querySelector("head > title"):null)}function Sb(t,e,n){if(n===1||e.itemProp!=null)return!1;switch(t){case"meta":case"title":return!0;case"style":if(typeof e.precedence!="string"||typeof e.href!="string"||e.href==="")break;return!0;case"link":if(typeof e.rel!="string"||typeof e.href!="string"||e.href===""||e.onLoad||e.onError)break;switch(e.rel){case"stylesheet":return t=e.disabled,typeof e.precedence=="string"&&t==null;default:return!0}case"script":if(e.async&&typeof e.async!="function"&&typeof e.async!="symbol"&&!e.onLoad&&!e.onError&&e.src&&typeof e.src=="string")return!0}return!1}function Ep(t){return!(t.type==="stylesheet"&&(t.state.loading&3)===0)}function _b(t,e,n,s){if(n.type==="stylesheet"&&(typeof s.media!="string"||matchMedia(s.media).matches!==!1)&&(n.state.loading&4)===0){if(n.instance===null){var r=li(s.href),c=e.querySelector(cl(r));if(c){e=c._p,e!==null&&typeof e=="object"&&typeof e.then=="function"&&(t.count++,t=qo.bind(t),e.then(t,t)),n.state.loading|=4,n.instance=c,Be(c);return}c=e.ownerDocument||e,s=xp(s),(r=Mn.get(r))&&_u(s,r),c=c.createElement("link"),Be(c);var m=c;m._p=new Promise(function(y,T){m.onload=y,m.onerror=T}),Ke(c,"link",s),n.instance=c}t.stylesheets===null&&(t.stylesheets=new Map),t.stylesheets.set(n,e),(e=n.state.preload)&&(n.state.loading&3)===0&&(t.count++,n=qo.bind(t),e.addEventListener("load",n),e.addEventListener("error",n))}}var xu=0;function Tb(t,e){return t.stylesheets&&t.count===0&&Go(t,t.stylesheets),0<t.count||0<t.imgCount?function(n){var s=setTimeout(function(){if(t.stylesheets&&Go(t,t.stylesheets),t.unsuspend){var c=t.unsuspend;t.unsuspend=null,c()}},6e4+e);0<t.imgBytes&&xu===0&&(xu=62500*nb());var r=setTimeout(function(){if(t.waitingForImages=!1,t.count===0&&(t.stylesheets&&Go(t,t.stylesheets),t.unsuspend)){var c=t.unsuspend;t.unsuspend=null,c()}},(t.imgBytes>xu?50:800)+e);return t.unsuspend=n,function(){t.unsuspend=null,clearTimeout(s),clearTimeout(r)}}:null}function qo(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Go(this,this.stylesheets);else if(this.unsuspend){var t=this.unsuspend;this.unsuspend=null,t()}}}var Ho=null;function Go(t,e){t.stylesheets=null,t.unsuspend!==null&&(t.count++,Ho=new Map,e.forEach(xb,t),Ho=null,qo.call(t))}function xb(t,e){if(!(e.state.loading&4)){var n=Ho.get(t);if(n)var s=n.get(null);else{n=new Map,Ho.set(t,n);for(var r=t.querySelectorAll("link[data-precedence],style[data-precedence]"),c=0;c<r.length;c++){var m=r[c];(m.nodeName==="LINK"||m.getAttribute("media")!=="not all")&&(n.set(m.dataset.precedence,m),s=m)}s&&n.set(null,s)}r=e.instance,m=r.getAttribute("data-precedence"),c=n.get(m)||s,c===s&&n.set(null,r),n.set(m,r),this.count++,s=qo.bind(this),r.addEventListener("load",s),r.addEventListener("error",s),c?c.parentNode.insertBefore(r,c.nextSibling):(t=t.nodeType===9?t.head:t,t.insertBefore(r,t.firstChild)),e.state.loading|=4}}var dl={$$typeof:Y,Provider:null,Consumer:null,_currentValue:lt,_currentValue2:lt,_threadCount:0};function jb(t,e,n,s,r,c,m,y,T){this.tag=1,this.containerInfo=t,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=js(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=js(0),this.hiddenUpdates=js(null),this.identifierPrefix=s,this.onUncaughtError=r,this.onCaughtError=c,this.onRecoverableError=m,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=T,this.incompleteTransitions=new Map}function Cp(t,e,n,s,r,c,m,y,T,D,L,Z){return t=new jb(t,e,n,m,T,D,L,Z,y),e=1,c===!0&&(e|=24),c=pn(3,null,null,e),t.current=c,c.stateNode=t,e=nc(),e.refCount++,t.pooledCache=e,e.refCount++,c.memoizedState={element:s,isDehydrated:n,cache:e},lc(c),t}function Dp(t){return t?(t=Vs,t):Vs}function kp(t,e,n,s,r,c){r=Dp(r),s.context===null?s.context=r:s.pendingContext=r,s=Da(e),s.payload={element:n},c=c===void 0?null:c,c!==null&&(s.callback=c),n=ka(t,s,e),n!==null&&(dn(n,t,e),Ii(n,t,e))}function wp(t,e){if(t=t.memoizedState,t!==null&&t.dehydrated!==null){var n=t.retryLane;t.retryLane=n!==0&&n<e?n:e}}function ju(t,e){wp(t,e),(t=t.alternate)&&wp(t,e)}function Mp(t){if(t.tag===13||t.tag===31){var e=as(t,67108864);e!==null&&dn(e,t,67108864),ju(t,67108864)}}function Rp(t){if(t.tag===13||t.tag===31){var e=Sn();e=As(e);var n=as(t,e);n!==null&&dn(n,t,e),ju(t,e)}}var Io=!0;function Ab(t,e,n,s){var r=B.T;B.T=null;var c=Q.p;try{Q.p=2,Au(t,e,n,s)}finally{Q.p=c,B.T=r}}function Nb(t,e,n,s){var r=B.T;B.T=null;var c=Q.p;try{Q.p=8,Au(t,e,n,s)}finally{Q.p=c,B.T=r}}function Au(t,e,n,s){if(Io){var r=Nu(s);if(r===null)du(t,e,s,Yo,n),zp(t,s);else if(Cb(r,t,e,n,s))s.stopPropagation();else if(zp(t,s),e&4&&-1<Eb.indexOf(t)){for(;r!==null;){var c=Es(r);if(c!==null)switch(c.tag){case 3:if(c=c.stateNode,c.current.memoizedState.isDehydrated){var m=an(c.pendingLanes);if(m!==0){var y=c;for(y.pendingLanes|=2,y.entangledLanes|=2;m;){var T=1<<31-J(m);y.entanglements[1]|=T,m&=~T}Kn(c),(It&6)===0&&(No=Nt()+500,il(0))}}break;case 31:case 13:y=as(c,2),y!==null&&dn(y,c,2),Co(),ju(c,2)}if(c=Nu(s),c===null&&du(t,e,s,Yo,n),c===r)break;r=c}r!==null&&s.stopPropagation()}else du(t,e,s,null,n)}}function Nu(t){return t=Cr(t),Eu(t)}var Yo=null;function Eu(t){if(Yo=null,t=Wn(t),t!==null){var e=h(t);if(e===null)t=null;else{var n=e.tag;if(n===13){if(t=f(e),t!==null)return t;t=null}else if(n===31){if(t=p(e),t!==null)return t;t=null}else if(n===3){if(e.stateNode.current.memoizedState.isDehydrated)return e.tag===3?e.stateNode.containerInfo:null;t=null}else e!==t&&(t=null)}}return Yo=t,null}function Op(t){switch(t){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(Vt()){case Yt:return 2;case ie:return 8;case Ft:case qe:return 32;case H:return 268435456;default:return 32}default:return 32}}var Cu=!1,Ha=null,Ga=null,Ia=null,fl=new Map,hl=new Map,Ya=[],Eb="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 zp(t,e){switch(t){case"focusin":case"focusout":Ha=null;break;case"dragenter":case"dragleave":Ga=null;break;case"mouseover":case"mouseout":Ia=null;break;case"pointerover":case"pointerout":fl.delete(e.pointerId);break;case"gotpointercapture":case"lostpointercapture":hl.delete(e.pointerId)}}function ml(t,e,n,s,r,c){return t===null||t.nativeEvent!==c?(t={blockedOn:e,domEventName:n,eventSystemFlags:s,nativeEvent:c,targetContainers:[r]},e!==null&&(e=Es(e),e!==null&&Mp(e)),t):(t.eventSystemFlags|=s,e=t.targetContainers,r!==null&&e.indexOf(r)===-1&&e.push(r),t)}function Cb(t,e,n,s,r){switch(e){case"focusin":return Ha=ml(Ha,t,e,n,s,r),!0;case"dragenter":return Ga=ml(Ga,t,e,n,s,r),!0;case"mouseover":return Ia=ml(Ia,t,e,n,s,r),!0;case"pointerover":var c=r.pointerId;return fl.set(c,ml(fl.get(c)||null,t,e,n,s,r)),!0;case"gotpointercapture":return c=r.pointerId,hl.set(c,ml(hl.get(c)||null,t,e,n,s,r)),!0}return!1}function Bp(t){var e=Wn(t.target);if(e!==null){var n=h(e);if(n!==null){if(e=n.tag,e===13){if(e=f(n),e!==null){t.blockedOn=e,Ni(t.priority,function(){Rp(n)});return}}else if(e===31){if(e=p(n),e!==null){t.blockedOn=e,Ni(t.priority,function(){Rp(n)});return}}else if(e===3&&n.stateNode.current.memoizedState.isDehydrated){t.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}t.blockedOn=null}function Zo(t){if(t.blockedOn!==null)return!1;for(var e=t.targetContainers;0<e.length;){var n=Nu(t.nativeEvent);if(n===null){n=t.nativeEvent;var s=new n.constructor(n.type,n);Er=s,n.target.dispatchEvent(s),Er=null}else return e=Es(n),e!==null&&Mp(e),t.blockedOn=n,!1;e.shift()}return!0}function Up(t,e,n){Zo(t)&&n.delete(e)}function Db(){Cu=!1,Ha!==null&&Zo(Ha)&&(Ha=null),Ga!==null&&Zo(Ga)&&(Ga=null),Ia!==null&&Zo(Ia)&&(Ia=null),fl.forEach(Up),hl.forEach(Up)}function Ko(t,e){t.blockedOn===e&&(t.blockedOn=null,Cu||(Cu=!0,a.unstable_scheduleCallback(a.unstable_NormalPriority,Db)))}var Xo=null;function Vp(t){Xo!==t&&(Xo=t,a.unstable_scheduleCallback(a.unstable_NormalPriority,function(){Xo===t&&(Xo=null);for(var e=0;e<t.length;e+=3){var n=t[e],s=t[e+1],r=t[e+2];if(typeof s!="function"){if(Eu(s||n)===null)continue;break}var c=Es(n);c!==null&&(t.splice(e,3),e-=3,Nc(c,{pending:!0,data:r,method:n.method,action:s},s,r))}}))}function ri(t){function e(T){return Ko(T,t)}Ha!==null&&Ko(Ha,t),Ga!==null&&Ko(Ga,t),Ia!==null&&Ko(Ia,t),fl.forEach(e),hl.forEach(e);for(var n=0;n<Ya.length;n++){var s=Ya[n];s.blockedOn===t&&(s.blockedOn=null)}for(;0<Ya.length&&(n=Ya[0],n.blockedOn===null);)Bp(n),n.blockedOn===null&&Ya.shift();if(n=(t.ownerDocument||t).$$reactFormReplay,n!=null)for(s=0;s<n.length;s+=3){var r=n[s],c=n[s+1],m=r[at]||null;if(typeof c=="function")m||Vp(n);else if(m){var y=null;if(c&&c.hasAttribute("formAction")){if(r=c,m=c[at]||null)y=m.formAction;else if(Eu(r)!==null)continue}else y=m.action;typeof y=="function"?n[s+1]=y:(n.splice(s,3),s-=3),Vp(n)}}}function Lp(){function t(c){c.canIntercept&&c.info==="react-transition"&&c.intercept({handler:function(){return new Promise(function(m){return r=m})},focusReset:"manual",scroll:"manual"})}function e(){r!==null&&(r(),r=null),s||setTimeout(n,20)}function n(){if(!s&&!navigation.transition){var c=navigation.currentEntry;c&&c.url!=null&&navigation.navigate(c.url,{state:c.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var s=!1,r=null;return navigation.addEventListener("navigate",t),navigation.addEventListener("navigatesuccess",e),navigation.addEventListener("navigateerror",e),setTimeout(n,100),function(){s=!0,navigation.removeEventListener("navigate",t),navigation.removeEventListener("navigatesuccess",e),navigation.removeEventListener("navigateerror",e),r!==null&&(r(),r=null)}}}function Du(t){this._internalRoot=t}Qo.prototype.render=Du.prototype.render=function(t){var e=this._internalRoot;if(e===null)throw Error(o(409));var n=e.current,s=Sn();kp(n,s,t,e,null,null)},Qo.prototype.unmount=Du.prototype.unmount=function(){var t=this._internalRoot;if(t!==null){this._internalRoot=null;var e=t.containerInfo;kp(t.current,2,null,t,null,null),Co(),e[Et]=null}};function Qo(t){this._internalRoot=t}Qo.prototype.unstable_scheduleHydration=function(t){if(t){var e=Ai();t={blockedOn:null,target:t,priority:e};for(var n=0;n<Ya.length&&e!==0&&e<Ya[n].priority;n++);Ya.splice(n,0,t),n===0&&Bp(t)}};var qp=i.version;if(qp!=="19.2.4")throw Error(o(527,qp,"19.2.4"));Q.findDOMNode=function(t){var e=t._reactInternals;if(e===void 0)throw typeof t.render=="function"?Error(o(188)):(t=Object.keys(t).join(","),Error(o(268,t)));return t=v(e),t=t!==null?b(t):null,t=t===null?null:t.stateNode,t};var kb={bundleType:0,version:"19.2.4",rendererPackageName:"react-dom",currentDispatcherRef:B,reconcilerVersion:"19.2.4"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Po=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Po.isDisabled&&Po.supportsFiber)try{He=Po.inject(kb),Ge=Po}catch{}}return pl.createRoot=function(t,e){if(!u(t))throw Error(o(299));var n=!1,s="",r=Xh,c=Qh,m=Ph;return e!=null&&(e.unstable_strictMode===!0&&(n=!0),e.identifierPrefix!==void 0&&(s=e.identifierPrefix),e.onUncaughtError!==void 0&&(r=e.onUncaughtError),e.onCaughtError!==void 0&&(c=e.onCaughtError),e.onRecoverableError!==void 0&&(m=e.onRecoverableError)),e=Cp(t,1,!1,null,null,n,s,null,r,c,m,Lp),t[Et]=e.current,uu(t),new Du(e)},pl.hydrateRoot=function(t,e,n){if(!u(t))throw Error(o(299));var s=!1,r="",c=Xh,m=Qh,y=Ph,T=null;return n!=null&&(n.unstable_strictMode===!0&&(s=!0),n.identifierPrefix!==void 0&&(r=n.identifierPrefix),n.onUncaughtError!==void 0&&(c=n.onUncaughtError),n.onCaughtError!==void 0&&(m=n.onCaughtError),n.onRecoverableError!==void 0&&(y=n.onRecoverableError),n.formState!==void 0&&(T=n.formState)),e=Cp(t,1,!0,e,n??null,s,r,T,c,m,y,Lp),e.context=Dp(null),n=e.current,s=Sn(),s=As(s),r=Da(s),r.callback=null,ka(n,r,s),n=s,e.current.lanes=n,Ta(e,n),Kn(e),t[Et]=e.current,uu(t),new Qo(e)},pl.version="19.2.4",pl}var Xp;function Kb(){if(Xp)return ku.exports;Xp=1;function a(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(a)}catch(i){console.error(i)}}return a(),ku.exports=Zb(),ku.exports}var Xb=Kb();function We(a){return typeof a=="object"&&a!==null&&!Array.isArray(a)}function Tl(a,i){return console.warn(`[ws] Malformed "${a}" message: ${i}`),!1}function Qb(a){return We(a)&&typeof a.id=="string"&&typeof a.displayName=="string"&&typeof a.adapterType=="string"&&typeof a.defaultRuntime=="string"&&typeof a.status=="string"&&typeof a.bootstrapped=="boolean"}function Qp(a){return We(a)&&typeof a.id=="string"&&typeof a.environmentId=="string"&&typeof a.runtime=="string"&&typeof a.status=="string"&&typeof a.prompt=="string"&&typeof a.startedAt=="string"&&(a.endedAt===void 0||typeof a.endedAt=="string")&&(a.error===void 0||typeof a.error=="string")}function Pp(a){return We(a)&&typeof a.sessionId=="string"&&typeof a.eventType=="string"&&typeof a.timestamp=="string"&&typeof a.content=="string"&&(a.raw===void 0||typeof a.raw=="string")}function Pb(a){return We(a)&&typeof a.id=="string"&&typeof a.name=="string"&&typeof a.description=="string"&&typeof a.repoUrl=="string"&&typeof a.defaultEnvironmentId=="string"&&typeof a.status=="string"&&typeof a.createdAt=="string"&&typeof a.updatedAt=="string"}function Fb(a){return We(a)&&typeof a.id=="string"&&typeof a.projectId=="string"&&typeof a.title=="string"&&typeof a.status=="string"&&typeof a.branch=="string"&&typeof a.sortOrder=="number"&&typeof a.depth=="number"&&Array.isArray(a.dependsOn)&&Array.isArray(a.childTaskIds)}function Jb(a){return We(a)&&typeof a.id=="string"&&typeof a.projectId=="string"&&typeof a.taskId=="string"&&typeof a.sessionId=="string"&&typeof a.category=="string"&&typeof a.title=="string"&&typeof a.content=="string"&&Array.isArray(a.tags)&&typeof a.createdAt=="string"}function $b(a){return We(a)&&typeof a.name=="string"&&typeof a.tokenType=="string"&&typeof a.envVar=="string"&&typeof a.filePath=="string"&&typeof a.expiresAt=="string"}function Wb(a){return We(a)&&typeof a.environmentId=="string"&&typeof a.stage=="string"&&typeof a.message=="string"&&typeof a.progress=="number"}function tS(a){return We(a)&&typeof a.name=="string"&&typeof a.repository=="string"&&typeof a.state=="string"&&typeof a.gitStatus=="string"}function eS(a){return We(a)&&typeof a.id=="string"&&typeof a.name=="string"&&typeof a.description=="string"&&typeof a.systemPrompt=="string"&&typeof a.toolConfig=="string"&&typeof a.runtime=="string"&&typeof a.model=="string"&&typeof a.maxTurns=="number"&&typeof a.mcpServers=="string"&&typeof a.createdAt=="string"&&typeof a.updatedAt=="string"}function Xn(a,i,l,o){return Array.isArray(a)?a.filter((u,h)=>i(u)?!0:(Tl(l,`item at index ${h} in "${o}" has unexpected shape`),!1)):(Tl(l,`expected "${o}" to be an array, got ${typeof a}`),[])}function nS(a){let i;try{i=JSON.parse(a)}catch{console.warn("[ws] Failed to parse WebSocket message as JSON");return}if(!We(i)||typeof i.type!="string"){console.warn("[ws] Received WebSocket message without a string 'type' field:",i);return}return{type:i.type,payload:We(i.payload)?i.payload:void 0}}const aS=3e3,ci=5e3;function sS(a){const i=typeof window<"u"&&window.__GRACKLE_API_KEY__||"",l=typeof window<"u"?`${window.location.protocol==="https:"?"wss:":"ws:"}//${window.location.host}?token=${encodeURIComponent(i)}`:"ws://localhost:3000",o=_.useRef(void 0),[u,h]=_.useState(!1),[f,p]=_.useState([]),[g,v]=_.useState([]),[b,S]=_.useState([]),[x,E]=_.useState(0),[k,q]=_.useState(void 0),[K,z]=_.useState([]),[P,Y]=_.useState([]),[nt,X]=_.useState([]),[V,et]=_.useState([]),[w,$]=_.useState({}),[st,ht]=_.useState([]),[zt,tt]=_.useState(""),[Ut,wt]=_.useState(!1),[B,Q]=_.useState([]),[lt,At]=_.useState({}),[mt,Qt]=_.useState(!1),[yt,bt]=_.useState(void 0),I=_.useCallback(J=>{var Tt;((Tt=o.current)==null?void 0:Tt.readyState)===WebSocket.OPEN&&o.current.send(JSON.stringify(J))},[]);_.useEffect(()=>{let J,Tt;function le(){J=new WebSocket(l),o.current=J,J.onopen=()=>{h(!0),I({type:"list_environments"}),I({type:"list_sessions"}),I({type:"list_projects"}),I({type:"list_tokens"}),I({type:"list_personas"}),I({type:"subscribe_all"})},J.onmessage=Zt=>{var Fe,fn,an,it,de,hn,_a,js,Ta,Bl,Ti,xi,ji,As,Ns,Ai,Ni,zn,Ne;if(typeof Zt.data!="string"){console.warn("[ws] Received non-string WebSocket message; ignoring");return}const dt=nS(Zt.data);if(dt)switch(dt.type){case"environments":p(Xn((Fe=dt.payload)==null?void 0:Fe.environments,Qb,"environments","environments"));break;case"sessions":v(at=>{var Gn;const Et=Xn((Gn=dt.payload)==null?void 0:Gn.sessions,Qp,"sessions","sessions"),Ct=new Map(at.map(Ee=>[Ee.id,Ee.status])),oe=new Set(["pending","running","waiting_input"]),sn=new Set(["completed","failed","killed"]);return Et.map(Ee=>{const Bn=Ct.get(Ee.id);if(!Bn||Bn===Ee.status)return Ee;if(sn.has(Bn)&&oe.has(Ee.status))return{...Ee,status:Bn};if(oe.has(Bn)&&oe.has(Ee.status)){const Wn=["pending","running","waiting_input"];if(Wn.indexOf(Bn)>Wn.indexOf(Ee.status))return{...Ee,status:Bn}}return Ee})});break;case"session_event":{if(!Pp(dt.payload)){Tl("session_event","payload is not a valid SessionEvent");break}const at=dt.payload;let Et=0;S(Ct=>{const oe=[...Ct,at];return oe.length>ci?(Et=oe.length-ci,oe.slice(-ci)):oe}),Et>0&&E(Ct=>Ct+Et),at.eventType==="status"&&v(Ct=>Ct.some(sn=>sn.id===at.sessionId)?Ct.map(sn=>sn.id===at.sessionId?{...sn,status:at.content}:sn):[...Ct,{id:at.sessionId,environmentId:"",runtime:"",status:at.content,prompt:"",startedAt:at.timestamp}]);break}case"session_events":{const at=Xn((fn=dt.payload)==null?void 0:fn.events,Pp,"session_events","events"),Et=(an=dt.payload)==null?void 0:an.sessionId;if(typeof Et!="string"){Tl("session_events","missing or non-string sessionId");break}if(at.length>0){let Ct=0;S(oe=>{const Gn=[...oe.filter(Ee=>Ee.sessionId!==Et),...at];return Gn.length>ci?(Ct=Gn.length-ci,Gn.slice(-ci)):Gn}),Ct>0&&E(oe=>oe+Ct)}break}case"spawned":{const at=(it=dt.payload)==null?void 0:it.sessionId;typeof at=="string"&&at&&q(at),I({type:"list_sessions"});break}case"projects":z(Xn((de=dt.payload)==null?void 0:de.projects,Pb,"projects","projects"));break;case"project_created":Qt(!1),I({type:"list_projects"});break;case"project_archived":I({type:"list_projects"});break;case"project_updated":I({type:"list_projects"});break;case"tasks":{const at=Xn((hn=dt.payload)==null?void 0:hn.tasks,Fb,"tasks","tasks"),Et=(typeof((_a=dt.payload)==null?void 0:_a.projectId)=="string"?dt.payload.projectId:"")||(at.length>0?at[0].projectId:"");if(!Et){Y(at);break}Y(Ct=>[...Ct.filter(oe=>oe.projectId!==Et),...at]);break}case"task_created":{const at=(js=dt.payload)==null?void 0:js.task;if(We(at)){const Et=typeof at.project_id=="string"?at.project_id:typeof at.projectId=="string"?at.projectId:"";Et&&I({type:"list_tasks",payload:{projectId:Et}})}break}case"task_started":{const at=dt.payload;if(!We(at))break;bt(Ct=>at.taskId&&Ct===at.taskId?void 0:Ct),at.sessionId&&I({type:"list_sessions"});const Et=typeof at.projectId=="string"?at.projectId:void 0;Et?I({type:"list_tasks",payload:{projectId:Et}}):at.taskId&&Y(Ct=>{const oe=Ct.find(sn=>sn.id===at.taskId);return oe&&I({type:"list_tasks",payload:{projectId:oe.projectId}}),Ct});break}case"task_approved":case"task_rejected":case"task_deleted":case"task_updated":{const at=dt.payload;if(!We(at))break;const Et=typeof at.projectId=="string"?at.projectId:void 0;Et?I({type:"list_tasks",payload:{projectId:Et}}):at.taskId&&Y(Ct=>{const oe=Ct.find(sn=>sn.id===at.taskId);return oe&&I({type:"list_tasks",payload:{projectId:oe.projectId}}),Ct});break}case"findings":X(Xn((Ta=dt.payload)==null?void 0:Ta.findings,Jb,"findings","findings"));break;case"finding_posted":typeof((Bl=dt.payload)==null?void 0:Bl.projectId)=="string"&&I({type:"list_findings",payload:{projectId:dt.payload.projectId}});break;case"tokens":et(Xn((Ti=dt.payload)==null?void 0:Ti.tokens,$b,"tokens","tokens"));break;case"token_changed":I({type:"list_tokens"});break;case"provision_progress":{if(!Wb(dt.payload)){Tl("provision_progress","payload is not a valid ProvisionStatus with environmentId");break}const at=dt.payload;$(Et=>({...Et,[at.environmentId]:{stage:at.stage,message:at.message,progress:at.progress}})),at.stage==="ready"&&setTimeout(()=>{$(Ct=>{const oe={...Ct};return delete oe[at.environmentId],oe})},5e3);break}case"environment_added":break;case"environment_removed":if(typeof((xi=dt.payload)==null?void 0:xi.environmentId)=="string"){const at=dt.payload.environmentId;p(Et=>Et.filter(Ct=>Ct.id!==at)),$(Et=>{const Ct={...Et};return delete Ct[at],Ct})}I({type:"list_sessions"});break;case"codespaces_list":{const at=Xn((ji=dt.payload)==null?void 0:ji.codespaces,tS,"codespaces_list","codespaces"),Et=typeof((As=dt.payload)==null?void 0:As.error)=="string"?dt.payload.error:"";ht(at),tt(Et);break}case"codespace_created":{wt(!1),I({type:"list_codespaces"});break}case"codespace_create_error":{wt(!1);const at=typeof((Ns=dt.payload)==null?void 0:Ns.message)=="string"?dt.payload.message:"Failed to create codespace";tt(at);break}case"personas":{const at=Xn((Ai=dt.payload)==null?void 0:Ai.personas,eS,"personas","personas");Q(at);break}case"persona_created":case"persona_updated":case"persona_deleted":I({type:"list_personas"});break;case"task_sessions":{const at=(Ni=dt.payload)==null?void 0:Ni.taskId;if(typeof at!="string"||!at)break;const Et=Xn((zn=dt.payload)==null?void 0:zn.sessions,Qp,"task_sessions","sessions");At(Ct=>({...Ct,[at]:Et}));break}case"error":console.error("[ws]",(Ne=dt.payload)==null?void 0:Ne.message);break}},J.onclose=()=>{h(!1),o.current=void 0,Qt(!1),bt(void 0),clearTimeout(Tt),Tt=setTimeout(le,aS)},J.onerror=()=>{J.close()}}return le(),()=>{clearTimeout(Tt),J==null||J.close()}},[l,I]);const ae=_.useCallback((J,Tt,le,Zt,dt)=>{I({type:"spawn",payload:{environmentId:J,prompt:Tt,model:le||"",runtime:Zt||"",personaId:dt||""}})},[I]),ve=_.useCallback((J,Tt)=>{I({type:"send_input",payload:{sessionId:J,text:Tt}})},[I]),tn=_.useCallback(J=>{I({type:"kill",payload:{sessionId:J}})},[I]),Le=_.useCallback(()=>{I({type:"list_environments"}),I({type:"list_sessions"}),I({type:"list_projects"}),I({type:"list_tokens"})},[I]),Wt=_.useCallback(J=>{I({type:"get_session_events",payload:{sessionId:J}})},[I]),en=_.useCallback(()=>{S([]),E(0)},[]),ze=_.useCallback((J,Tt,le,Zt)=>{Qt(!0),I({type:"create_project",payload:{name:J,description:Tt||"",repoUrl:le||"",defaultEnvironmentId:Zt||""}})},[I]),Gt=_.useCallback(J=>{I({type:"archive_project",payload:{projectId:J}})},[I]),Pt=_.useCallback((J,Tt)=>{I({type:"update_project",payload:{projectId:J,...Tt}})},[I]),me=_.useCallback(J=>{I({type:"list_tasks",payload:{projectId:J}})},[I]),F=_.useCallback((J,Tt,le,Zt,dt)=>{I({type:"create_task",payload:{projectId:J,title:Tt,description:le||"",dependsOn:Zt||[],parentTaskId:dt||""}})},[I]),Mt=_.useCallback((J,Tt,le,Zt,dt)=>{bt(J),I({type:"start_task",payload:{taskId:J,runtime:Tt||"",model:le||"",personaId:Zt||"",environmentId:dt||""}})},[I]),_t=_.useCallback(J=>{I({type:"approve_task",payload:{taskId:J}})},[I]),R=_.useCallback((J,Tt)=>{I({type:"reject_task",payload:{taskId:J,reviewNotes:Tt}})},[I]),U=_.useCallback((J,Tt,le,Zt)=>{I({type:"update_task",payload:{taskId:J,title:Tt,description:le,dependsOn:Zt}})},[I]),W=_.useCallback(J=>{I({type:"delete_task",payload:{taskId:J}})},[I]),ct=_.useCallback(J=>{I({type:"list_findings",payload:{projectId:J}})},[I]),St=_.useCallback((J,Tt,le,Zt,dt)=>{I({type:"post_finding",payload:{projectId:J,title:Tt,content:le,category:Zt||"general",tags:dt||[]}})},[I]),gt=_.useCallback(()=>{I({type:"list_tokens"})},[I]),Nt=_.useCallback((J,Tt,le,Zt,dt)=>{I({type:"set_token",payload:{name:J,value:Tt,tokenType:le,envVar:Zt,filePath:dt}})},[I]),Vt=_.useCallback(J=>{I({type:"delete_token",payload:{name:J}})},[I]),Yt=_.useCallback((J,Tt,le,Zt)=>{const dt={displayName:J,adapterType:Tt,adapterConfig:le||{}};Zt&&(dt.defaultRuntime=Zt),I({type:"add_environment",payload:dt})},[I]),ie=_.useCallback(J=>{I({type:"provision_environment",payload:{environmentId:J}})},[I]),Ft=_.useCallback(J=>{I({type:"stop_environment",payload:{environmentId:J}})},[I]),qe=_.useCallback(J=>{I({type:"remove_environment",payload:{environmentId:J}})},[I]),H=_.useCallback(()=>{I({type:"list_codespaces"})},[I]),Me=_.useCallback(J=>{if(!u){tt("Not connected to server. Please try again once the connection is restored.");return}wt(!0),tt(""),I({type:"create_codespace",payload:{repo:J}})},[I,u]),$n=_.useCallback((J,Tt,le,Zt,dt,Fe)=>{I({type:"create_persona",payload:{name:J,description:Tt,systemPrompt:le,runtime:Zt||"",model:dt||"",maxTurns:Fe||0}})},[I]),He=_.useCallback((J,Tt,le,Zt,dt,Fe,fn)=>{I({type:"update_persona",payload:{personaId:J,name:Tt||"",description:le||"",systemPrompt:Zt||"",runtime:dt||"",model:Fe||"",maxTurns:fn||0}})},[I]),Ge=_.useCallback(J=>{I({type:"delete_persona",payload:{personaId:J}})},[I]),nn=_.useCallback(J=>{I({type:"get_task_sessions",payload:{taskId:J}})},[I]);return{connected:u,environments:f,sessions:g,events:b,eventsDropped:x,lastSpawnedId:k,projects:K,tasks:P,findings:nt,tokens:V,spawn:ae,sendInput:ve,kill:tn,refresh:Le,loadSessionEvents:Wt,clearEvents:en,createProject:ze,archiveProject:Gt,updateProject:Pt,loadTasks:me,createTask:F,startTask:Mt,approveTask:_t,rejectTask:R,updateTask:U,deleteTask:W,loadFindings:ct,postFinding:St,addEnvironment:Yt,loadTokens:gt,setToken:Nt,deleteToken:Vt,provisionStatus:w,provisionEnvironment:ie,stopEnvironment:Ft,removeEnvironment:qe,codespaces:st,codespaceError:zt,codespaceCreating:Ut,listCodespaces:H,createCodespace:Me,projectCreating:mt,taskStartingId:yt,personas:B,createPersona:$n,updatePersona:He,deletePersona:Ge,taskSessions:lt,loadTaskSessions:nn}}const md=_.createContext(void 0);function iS({children:a}){const i=sS();return d.jsx(md.Provider,{value:i,children:a})}function Hn(){const a=_.useContext(md);if(!a)throw new Error("useGrackle must be used within GrackleProvider");return a}const lS=[{id:"env-local-01",displayName:"Local Dev",adapterType:"local",defaultRuntime:"claude-code",status:"connected",bootstrapped:!0},{id:"env-docker-01",displayName:"Docker Sandbox",adapterType:"docker",defaultRuntime:"claude-code",status:"connected",bootstrapped:!0},{id:"env-cs-01",displayName:"GitHub Codespace",adapterType:"codespace",defaultRuntime:"claude-code",status:"connected",bootstrapped:!0},{id:"env-remote-01",displayName:"Staging (SSH)",adapterType:"ssh",defaultRuntime:"claude-code",status:"disconnected",bootstrapped:!1}],oS=[{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"}],rS=[{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:
26
- - src/middleware/auth.ts
27
- - src/routes/login.ts
28
- - 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:
29
- \`\`\`typescript
30
- import jwt from "jsonwebtoken";
31
- import type { Request, Response, NextFunction } from "express";
32
-
33
- const JWT_SECRET = process.env.JWT_SECRET || "change-me";
34
-
35
- export function verifyToken(req: Request, res: Response, next: NextFunction): void {
36
- const header = req.headers.authorization;
37
- if (!header?.startsWith("Bearer ")) {
38
- res.status(401).json({ error: "Missing token" });
39
- return;
40
- }
41
- try {
42
- const decoded = jwt.verify(header.slice(7), JWT_SECRET);
43
- req.user = decoded;
44
- next();
45
- } catch {
46
- res.status(403).json({ error: "Invalid token" });
47
- }
48
- }
49
- \`\`\``},{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"}],cS=[{id:"proj-alpha",name:"Project Alpha",description:"Core platform API and authentication services",repoUrl:"https://github.com/acme/alpha",defaultEnvironmentId:"env-local-01",status:"active",createdAt:"2026-01-15T10:00:00Z",updatedAt:"2026-01-15T10:00:00Z"},{id:"proj-beta",name:"Data Pipeline",description:"ETL pipelines for analytics and reporting",repoUrl:"https://github.com/acme/data-pipeline",defaultEnvironmentId:"env-docker-01",status:"active",createdAt:"2026-02-01T14:30:00Z",updatedAt:"2026-02-01T14:30:00Z"},{id:"proj-gamma",name:"Mobile App",description:"React Native cross-platform mobile application",repoUrl:"",defaultEnvironmentId:"env-local-01",status:"archived",createdAt:"2025-11-20T09:00:00Z",updatedAt:"2025-11-20T09:00:00Z"}],uS=[{id:"task-001",projectId:"proj-alpha",title:"Implement JWT authentication",description:"Replace session-based auth with JWT tokens across all protected routes",status:"in_progress",branch:"feat/jwt-auth",latestSessionId:"sess-001",dependsOn:[],reviewNotes:"",sortOrder:1,createdAt:"2026-02-25T10:00:00Z",parentTaskId:"",depth:0,childTaskIds:["task-001a","task-001b","task-001c"],canDecompose:!0},{id:"task-001a",projectId:"proj-alpha",title:"Design token schema",description:"Define JWT payload structure, expiry, and refresh token strategy",status:"done",branch:"feat/jwt-auth/design-token-schema",latestSessionId:"",dependsOn:[],reviewNotes:"",sortOrder:1,createdAt:"2026-02-25T10:10:00Z",parentTaskId:"task-001",depth:1,childTaskIds:[],canDecompose:!1},{id:"task-001b",projectId:"proj-alpha",title:"Implement auth middleware",description:"Build Express middleware that verifies JWT Bearer tokens",status:"in_progress",branch:"feat/jwt-auth/implement-auth-middleware",latestSessionId:"sess-001",dependsOn:[],reviewNotes:"",sortOrder:2,createdAt:"2026-02-25T10:15:00Z",parentTaskId:"task-001",depth:1,childTaskIds:[],canDecompose:!1},{id:"task-001c",projectId:"proj-alpha",title:"Write auth integration tests",description:"End-to-end tests for login flow, token refresh, and protected route access",status:"pending",branch:"",latestSessionId:"",dependsOn:["task-001b"],reviewNotes:"",sortOrder:3,createdAt:"2026-02-25T10:20:00Z",parentTaskId:"task-001",depth:1,childTaskIds:[],canDecompose:!1},{id:"task-002",projectId:"proj-alpha",title:"Add rate limiting",description:"Implement token-bucket rate limiting for public API endpoints",status:"pending",branch:"",latestSessionId:"",dependsOn:["task-001"],reviewNotes:"",sortOrder:2,createdAt:"2026-02-25T10:05:00Z",parentTaskId:"",depth:0,childTaskIds:[],canDecompose:!1},{id:"task-003",projectId:"proj-alpha",title:"Set up OpenAPI documentation",description:"Generate Swagger docs from route decorators and serve at /api/docs",status:"review",branch:"feat/openapi-docs",latestSessionId:"sess-002",dependsOn:[],reviewNotes:"",sortOrder:3,createdAt:"2026-02-24T16:00:00Z",parentTaskId:"",depth:0,childTaskIds:[],canDecompose:!1},{id:"task-004",projectId:"proj-alpha",title:"Database connection pooling",description:"Switch from single connection to a connection pool with health checks",status:"done",branch:"feat/db-pool",latestSessionId:"",dependsOn:[],reviewNotes:"LGTM — pool size and idle timeout values are sensible.",sortOrder:4,createdAt:"2026-02-23T11:00:00Z",parentTaskId:"",depth:0,childTaskIds:[],canDecompose:!1},{id:"task-005",projectId:"proj-alpha",title:"Fix N+1 query in user list",description:"Use a JOIN instead of per-row lookups in GET /api/users",status:"assigned",branch:"fix/user-list-n1",latestSessionId:"",dependsOn:[],reviewNotes:"The fix breaks pagination — cursor should reference the joined table, not the subquery.",sortOrder:5,createdAt:"2026-02-22T09:30:00Z",parentTaskId:"",depth:0,childTaskIds:[],canDecompose:!1},{id:"task-006",projectId:"proj-beta",title:"Add Parquet export support",description:"Allow pipeline outputs to be written as Parquet files for Spark consumption",status:"in_progress",branch:"feat/parquet-export",latestSessionId:"",dependsOn:[],reviewNotes:"",sortOrder:1,createdAt:"2026-02-26T08:00:00Z",parentTaskId:"",depth:0,childTaskIds:["task-006a","task-006b","task-006c","task-006d"],canDecompose:!0},{id:"task-006a",projectId:"proj-beta",title:"Define Parquet schema mapping",description:"Map internal column types to Arrow/Parquet type system",status:"done",branch:"feat/parquet-export/define-parquet-schema-mapping",latestSessionId:"",dependsOn:[],reviewNotes:"",sortOrder:1,createdAt:"2026-02-26T08:05:00Z",parentTaskId:"task-006",depth:1,childTaskIds:[],canDecompose:!1},{id:"task-006b",projectId:"proj-beta",title:"Implement row-group writer",description:"Write buffered row groups with configurable batch size",status:"done",branch:"feat/parquet-export/implement-row-group-writer",latestSessionId:"",dependsOn:["task-006a"],reviewNotes:"",sortOrder:2,createdAt:"2026-02-26T08:10:00Z",parentTaskId:"task-006",depth:1,childTaskIds:[],canDecompose:!1},{id:"task-006c",projectId:"proj-beta",title:"Add compression options",description:"Support Snappy, ZSTD, and GZIP compression for Parquet output",status:"in_progress",branch:"feat/parquet-export/add-compression-options",latestSessionId:"sess-004",dependsOn:["task-006b"],reviewNotes:"",sortOrder:3,createdAt:"2026-02-26T08:15:00Z",parentTaskId:"task-006",depth:1,childTaskIds:[],canDecompose:!1},{id:"task-006d",projectId:"proj-beta",title:"Write Parquet integration tests",description:"Round-trip tests: write Parquet, read back with pyarrow, verify data integrity",status:"pending",branch:"",latestSessionId:"",dependsOn:["task-006c"],reviewNotes:"",sortOrder:4,createdAt:"2026-02-26T08:20:00Z",parentTaskId:"task-006",depth:1,childTaskIds:[],canDecompose:!1},{id:"task-007",projectId:"proj-beta",title:"Implement incremental loads",description:"Track watermarks so pipelines only process new/changed rows",status:"in_progress",branch:"feat/incremental",latestSessionId:"sess-004",dependsOn:[],reviewNotes:"",sortOrder:2,createdAt:"2026-02-26T08:30:00Z",parentTaskId:"",depth:0,childTaskIds:["task-007a","task-007b"],canDecompose:!0},{id:"task-007a",projectId:"proj-beta",title:"Design watermark storage",description:"Define schema for per-pipeline high-watermark tracking",status:"done",branch:"feat/incremental/design-watermark-storage",latestSessionId:"",dependsOn:[],reviewNotes:"",sortOrder:1,createdAt:"2026-02-26T08:35:00Z",parentTaskId:"task-007",depth:1,childTaskIds:[],canDecompose:!1},{id:"task-007b",projectId:"proj-beta",title:"Implement change detection query",description:"Generate WHERE clauses from watermarks to fetch only changed rows",status:"failed",branch:"feat/incremental/implement-change-detection-query",latestSessionId:"",dependsOn:["task-007a"],reviewNotes:"Query fails on tables without a monotonic primary key",sortOrder:2,createdAt:"2026-02-26T08:40:00Z",parentTaskId:"task-007",depth:1,childTaskIds:[],canDecompose:!1},{id:"task-008",projectId:"proj-beta",title:"Add pipeline monitoring dashboard",description:"Real-time metrics for pipeline throughput, latency, and error rates",status:"review",branch:"feat/monitoring",latestSessionId:"",dependsOn:[],reviewNotes:"",sortOrder:3,createdAt:"2026-02-26T09:00:00Z",parentTaskId:"",depth:0,childTaskIds:[],canDecompose:!1}],Fp=[{id:"find-001",projectId:"proj-alpha",taskId:"task-001",sessionId:"sess-001",category:"architecture",title:"Auth middleware is tightly coupled to Express",content:"The current auth middleware directly references Express Request/Response types. Consider extracting a framework-agnostic token verification layer so we can reuse it in the WebSocket auth path.",tags:["auth","decoupling","middleware"],createdAt:"2026-02-27T08:16:00Z"},{id:"find-002",projectId:"proj-alpha",taskId:"task-003",sessionId:"sess-002",category:"api",title:"Missing pagination on GET /api/users",content:"The users endpoint returns all rows without limit/offset. For datasets over 10k rows this will cause timeouts. Recommend cursor-based pagination with a default page size of 50.",tags:["api","pagination","performance"],createdAt:"2026-02-27T07:31:00Z"},{id:"find-003",projectId:"proj-alpha",taskId:"task-005",sessionId:"sess-003",category:"bug",title:"Race condition in session cleanup",content:"When two requests hit /api/logout concurrently, the second call throws a 500 because the session row has already been deleted. Needs an idempotent DELETE or a conditional check.",tags:["bug","concurrency","sessions"],createdAt:"2026-02-26T22:50:00Z"},{id:"find-004",projectId:"proj-alpha",taskId:"task-004",sessionId:"",category:"decision",title:"Chose pg-pool over knex connection pool",content:"pg-pool gives us direct control over idle timeout, max connections, and health check queries. Knex wraps pg-pool anyway and adds overhead we don't need since we write raw SQL.",tags:["database","decision","postgres"],createdAt:"2026-02-23T11:30:00Z"},{id:"find-005",projectId:"proj-alpha",taskId:"",sessionId:"",category:"dependency",title:"jsonwebtoken has 3 high-severity CVEs",content:"The jsonwebtoken package (v8.x) has known vulnerabilities. Consider migrating to jose which is maintained, supports ESM, and covers the same JWS/JWE surface area with zero dependencies.",tags:["security","dependency","jwt"],createdAt:"2026-02-27T08:20:00Z"},{id:"find-006",projectId:"proj-alpha",taskId:"task-001",sessionId:"sess-001",category:"pattern",title:"Consistent error response shape",content:"All error responses should follow the shape `{ error: string, code: string, details?: unknown }`. Currently some routes return `{ message: string }` and others return `{ error: string }`.",tags:["api","consistency","error-handling"],createdAt:"2026-02-27T08:17:00Z"},{id:"find-007",projectId:"proj-beta",taskId:"task-007",sessionId:"sess-004",category:"architecture",title:"Watermark storage should be pluggable",content:"The incremental load watermarks are currently stored in a local SQLite file. For production multi-worker scenarios, this needs to be backed by a shared store (Redis or Postgres).",tags:["architecture","pipeline","scalability"],createdAt:"2026-02-27T09:05:00Z"}],dS=[{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:""}],fS=[{id:"persona-arch",name:"Software Architect",description:"Designs system architecture, defines interfaces, and decomposes large features into implementable tasks.",systemPrompt:"You are a senior software architect. Focus on clean interfaces, separation of concerns, and scalable patterns. When decomposing work, create concrete subtasks with clear acceptance criteria.",toolConfig:JSON.stringify({allowedTools:["Read","Grep","Glob","Write","Edit"]}),runtime:"claude-code",model:"claude-sonnet-4-5-20250929",maxTurns:50,mcpServers:"[]",createdAt:"2026-02-20T10:00:00Z",updatedAt:"2026-02-20T10:00:00Z"},{id:"persona-fe",name:"Frontend Engineer",description:"React specialist — builds UI components, writes CSS, implements routing, and creates Playwright tests.",systemPrompt:"You are a frontend engineer specializing in React, TypeScript, and modern CSS. Follow component composition patterns, use semantic HTML, and write accessible markup.",toolConfig:JSON.stringify({allowedTools:["Read","Grep","Glob","Write","Edit","Bash"]}),runtime:"claude-code",model:"claude-sonnet-4-5-20250929",maxTurns:100,mcpServers:"[]",createdAt:"2026-02-20T10:05:00Z",updatedAt:"2026-02-20T10:05:00Z"},{id:"persona-reviewer",name:"Code Reviewer",description:"Reviews diffs for correctness, security, and style. Posts findings for issues discovered.",systemPrompt:"You are a meticulous code reviewer. Check for security vulnerabilities, performance issues, and style consistency. Post findings for anything noteworthy.",toolConfig:JSON.stringify({allowedTools:["Read","Grep","Glob"]}),runtime:"claude-code",model:"claude-sonnet-4-5-20250929",maxTurns:30,mcpServers:"[]",createdAt:"2026-02-20T10:10:00Z",updatedAt:"2026-02-20T10:10:00Z"},{id:"persona-tester",name:"QA Engineer",description:"Writes comprehensive test suites — unit tests, integration tests, and E2E Playwright specs.",systemPrompt:"You are a QA engineer focused on test coverage. Write tests that cover happy paths, edge cases, error scenarios, and accessibility. Use Playwright for E2E tests.",toolConfig:JSON.stringify({allowedTools:["Read","Grep","Glob","Write","Edit","Bash"]}),runtime:"claude-code",model:"claude-sonnet-4-5-20250929",maxTurns:80,mcpServers:"[]",createdAt:"2026-02-20T10:15:00Z",updatedAt:"2026-02-20T10:15:00Z"}],hS={"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 Oe(a){return new Date(Date.now()+a).toISOString()}const Jp=[{label:"API Refactor",pauseForInput:!1,steps:[{delayMs:0,event:{eventType:"status",timestamp:Oe(0),content:"running"}},{delayMs:800,event:{eventType:"output",timestamp:Oe(800),content:"Analyzing current API structure in src/routes/..."}},{delayMs:1600,event:{eventType:"output",timestamp:Oe(1600),content:`Found 5 endpoints that need refactoring:
50
- - GET /api/users
51
- - POST /api/users
52
- - GET /api/users/:id
53
- - PUT /api/users/:id
54
- - DELETE /api/users/:id`}},{delayMs:2800,event:{eventType:"output",timestamp:Oe(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:Oe(4e3),content:"Running test suite... 22 tests passed, 3 updated, 0 failed."}},{delayMs:5e3,event:{eventType:"status",timestamp:Oe(5e3),content:"completed"}}]},{label:"Database Migration",pauseForInput:!0,pauseAfterStep:3,steps:[{delayMs:0,event:{eventType:"status",timestamp:Oe(0),content:"running"}},{delayMs:600,event:{eventType:"output",timestamp:Oe(600),content:"Scanning current schema for migration targets..."}},{delayMs:1400,event:{eventType:"output",timestamp:Oe(1400),content:`Found tables to modify:
55
- - users (add column: last_login_at)
56
- - sessions (add index on expires_at)
57
- - audit_log (new table)`}},{delayMs:2200,event:{eventType:"output",timestamp:Oe(2200),content:`⚠ This migration will add a NOT NULL column to the users table.
58
- The table has 50,000+ rows — this may lock the table briefly.
59
-
60
- Please confirm to proceed.`}}],resumeSteps:[{delayMs:500,event:{eventType:"output",timestamp:Oe(0),content:"Proceeding with migration..."}},{delayMs:1500,event:{eventType:"output",timestamp:Oe(1e3),content:`Migration 001_add_last_login.sql applied successfully.
61
- Migration 002_sessions_index.sql applied successfully.
62
- Migration 003_audit_log.sql applied successfully.`}},{delayMs:2500,event:{eventType:"output",timestamp:Oe(2e3),content:"All 3 migrations applied. Running verification queries... OK."}},{delayMs:3200,event:{eventType:"status",timestamp:Oe(2700),content:"completed"}}]},{label:"Test Writer",pauseForInput:!1,steps:[{delayMs:0,event:{eventType:"status",timestamp:Oe(0),content:"running"}},{delayMs:700,event:{eventType:"output",timestamp:Oe(700),content:"Generating test scaffolding for src/services/billing.ts..."}},{delayMs:1800,event:{eventType:"output",timestamp:Oe(1800),content:`Writing test cases:
63
- - should calculate monthly total
64
- - should apply discount codes
65
- - should handle currency conversion
66
- - should reject expired cards`}},{delayMs:2800,event:{eventType:"output",timestamp:Oe(2800),content:`Error: Cannot resolve import 'src/services/stripe-client.ts' — module not found.
67
- The billing service depends on a Stripe client that doesn't exist in this environment.`}},{delayMs:3500,event:{eventType:"status",timestamp:Oe(3500),content:"failed"}}]}],$p=400;function mS({children:a}){const[i,l]=_.useState(oS),[o,u]=_.useState(rS),[h,f]=_.useState(void 0),[p,g]=_.useState(cS),[v,b]=_.useState(uS),[S,x]=_.useState(Fp),[E,k]=_.useState(dS),[q,K]=_.useState(fS),[z]=_.useState(hS),P=_.useRef(0),Y=_.useRef(0),nt=_.useRef(new Set),X=_.useRef(new Map),V=_.useRef(v);V.current=v;const et=_.useRef(new Map),w=_.useRef(new Map),$=_.useCallback(R=>(P.current+=1,`mock-${R}-${String(P.current).padStart(3,"0")}`),[]),st=_.useCallback(()=>{const R=Jp[Y.current%Jp.length];return Y.current+=1,R},[]),ht=_.useCallback((R,U,W)=>{const ct=setTimeout(()=>{var St;nt.current.delete(ct),W&&((St=X.current.get(W))==null||St.delete(ct)),R()},U);nt.current.add(ct),W&&(X.current.has(W)||X.current.set(W,new Set),X.current.get(W).add(ct))},[]),zt=_.useCallback(R=>{const U=X.current.get(R);U&&(U.forEach(W=>{clearTimeout(W),nt.current.delete(W)}),X.current.delete(R))},[]),tt=_.useCallback((R,U)=>{l(W=>W.map(ct=>ct.id===R?{...ct,status:U}:ct))},[]),Ut=_.useCallback(R=>{u(U=>[...U,R])},[]),wt=_.useCallback((R,U,W)=>{U.forEach((ct,St)=>{ht(()=>{const gt={sessionId:R,...ct.event,timestamp:new Date().toISOString()};Ut(gt),ct.event.eventType==="status"&&tt(R,ct.event.content),St===U.length-1&&W&&W()},ct.delayMs,R)})},[ht,Ut,tt]),B=_.useCallback((R,U,W,ct)=>{console.log("[MockGrackle] spawn",{environmentId:R,prompt:U,runtime:ct});const St=$("sess"),gt={id:St,environmentId:R,runtime:ct||"claude-code",status:"running",prompt:U,startedAt:new Date().toISOString()};l(Vt=>[...Vt,gt]),f(St);const Nt=st();if(console.log(`[MockGrackle] Playing scenario: ${Nt.label}`),Nt.pauseForInput){const Vt=Nt.pauseAfterStep??Nt.steps.length-1,Yt=Nt.steps.slice(0,Vt+1),ie=Yt.length>0?Yt[Yt.length-1].delayMs:0;wt(St,Yt),ht(()=>{tt(St,"waiting_input"),Ut({sessionId:St,eventType:"status",timestamp:new Date().toISOString(),content:"waiting_input"})},ie+$p,St),Nt.resumeSteps&&et.current.set(St,Nt.resumeSteps)}else wt(St,Nt.steps)},[$,st,wt,ht,tt,Ut]),Q=_.useCallback(R=>{console.log("[MockGrackle] kill",R),zt(R),et.current.delete(R),tt(R,"killed"),Ut({sessionId:R,eventType:"status",timestamp:new Date().toISOString(),content:"killed"}),b(U=>U.map(W=>W.latestSessionId===R&&W.status==="in_progress"?{...W,status:"pending"}:W))},[zt,tt,Ut]),lt=_.useCallback(()=>{console.log("[MockGrackle] refresh")},[]),At=_.useCallback(R=>{console.log("[MockGrackle] loadSessionEvents",R)},[]),mt=_.useCallback(()=>{console.log("[MockGrackle] clearEvents"),u([])},[]),Qt=_.useCallback((R,U,W,ct)=>{console.log("[MockGrackle] createProject",{name:R,description:U});const St={id:$("proj"),name:R,description:U||"",repoUrl:W||"",defaultEnvironmentId:ct||"",status:"active",createdAt:new Date().toISOString(),updatedAt:new Date().toISOString()};g(gt=>[...gt,St])},[$]),yt=_.useCallback(R=>{console.log("[MockGrackle] archiveProject",R),g(U=>U.map(W=>W.id===R?{...W,status:"archived"}:W))},[]),bt=_.useCallback(R=>{console.log("[MockGrackle] loadTasks",R)},[]),I=_.useCallback((R,U,W,ct,St)=>{console.log("[MockGrackle] createTask",{projectId:R,title:U,parentTaskId:St}),b(gt=>{const Vt=gt.filter(qe=>qe.projectId===R).reduce((qe,H)=>Math.max(qe,H.sortOrder),0),Yt=St?gt.find(qe=>qe.id===St):void 0;if(St&&!Yt)return console.warn("[MockGrackle] Parent task not found:",St),gt;if(Yt&&!Yt.canDecompose)return console.warn("[MockGrackle] Parent task does not have decomposition rights:",St),gt;const ie=Yt?Yt.depth+1:0,Ft={id:$("task"),projectId:R,title:U,description:W||"",status:"pending",branch:"",latestSessionId:"",dependsOn:ct||[],reviewNotes:"",sortOrder:Vt+1,createdAt:new Date().toISOString(),parentTaskId:St||"",depth:ie,childTaskIds:[],canDecompose:!St};return[...gt,Ft]})},[$]),ae=_.useCallback((R,U,W)=>{var Yt;console.log("[MockGrackle] startTask",{taskId:R,runtime:U});const ct=V.current.find(ie=>ie.id===R),St=(ct==null?void 0:ct.title)??"",gt=$("sess"),Nt={id:gt,environmentId:"env-local-01",runtime:U||"claude-code",status:"running",prompt:St||R,startedAt:new Date().toISOString()};l(ie=>[...ie,Nt]),b(ie=>ie.map(Ft=>Ft.id===R?{...Ft,status:"in_progress",latestSessionId:gt,branch:`mock/${R.slice(0,8)}`}:Ft));const Vt=st();if(console.log(`[MockGrackle] Playing task scenario: ${Vt.label}`),Vt.pauseForInput){const ie=Vt.pauseAfterStep??Vt.steps.length-1,Ft=Vt.steps.slice(0,ie+1),qe=Ft.length>0?Ft[Ft.length-1].delayMs:0;if(wt(gt,Ft),ht(()=>{tt(gt,"waiting_input"),Ut({sessionId:gt,eventType:"status",timestamp:new Date().toISOString(),content:"waiting_input"})},qe+$p,gt),Vt.resumeSteps){const H=[...Vt.resumeSteps];et.current.set(gt,H);const Me=H.reduce(($n,He)=>Math.max($n,He.delayMs),0);w.current.set(gt,{taskId:R,delayAfterResume:Me+200})}}else{const ie=Vt.steps.length>0?Vt.steps[Vt.steps.length-1].delayMs:0;wt(gt,Vt.steps);const Ft=(Yt=Vt.steps[Vt.steps.length-1])==null?void 0:Yt.event.content;ht(()=>{Ft==="completed"?b(qe=>qe.map(H=>H.id===R&&H.status==="in_progress"?{...H,status:"review"}:H)):Ft==="failed"&&b(qe=>qe.map(H=>H.id===R&&H.status==="in_progress"?{...H,status:"failed"}:H))},ie+100,gt)}},[$,st,wt,ht,tt,Ut]),ve=_.useCallback((R,U)=>{console.log("[MockGrackle] sendInput",{sessionId:R,text:U}),Ut({sessionId:R,eventType:"output",timestamp:new Date().toISOString(),content:`User input: ${U}`}),tt(R,"running"),Ut({sessionId:R,eventType:"status",timestamp:new Date().toISOString(),content:"running"});const W=et.current.get(R);if(W)et.current.delete(R),wt(R,W);else{const St=[{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"}}];wt(R,St)}const ct=w.current.get(R);ct&&(w.current.delete(R),ht(()=>{b(St=>St.map(gt=>gt.id===ct.taskId&&gt.status==="in_progress"?{...gt,status:"review"}:gt))},ct.delayAfterResume,R))},[Ut,tt,wt,ht]),tn=_.useCallback(R=>{console.log("[MockGrackle] approveTask",R),b(U=>U.map(W=>W.id===R?{...W,status:"done"}:W))},[]),Le=_.useCallback((R,U)=>{console.log("[MockGrackle] rejectTask",{taskId:R,reviewNotes:U}),b(W=>W.map(ct=>ct.id===R?{...ct,status:"assigned",reviewNotes:U,latestSessionId:""}:ct))},[]),Wt=_.useCallback((R,U,W,ct)=>{console.log("[MockGrackle] updateTask",{taskId:R,title:U}),b(St=>St.map(gt=>gt.id===R?{...gt,title:U.trim()||gt.title,description:W,dependsOn:ct}:gt))},[]),en=_.useCallback(R=>{console.log("[MockGrackle] deleteTask",R),b(U=>U.filter(W=>W.id!==R))},[]),ze=_.useCallback(R=>{console.log("[MockGrackle] loadFindings",R),x(Fp.filter(U=>U.projectId===R))},[]),Gt=_.useCallback((R,U,W,ct,St)=>{console.log("[MockGrackle] postFinding",{projectId:R,title:U});const gt={id:$("find"),projectId:R,taskId:"",sessionId:"",category:ct||"general",title:U,content:W,tags:St||[],createdAt:new Date().toISOString()};x(Nt=>[...Nt,gt])},[$]),Pt=_.useCallback((R,U,W,ct)=>{console.log("[MockGrackle] addEnvironment",{displayName:R,adapterType:U,adapterConfig:W,defaultRuntime:ct})},[]),me=_.useCallback(()=>{console.log("[MockGrackle] loadTokens")},[]),F=_.useCallback((R,U,W,ct,St)=>{console.log("[MockGrackle] setToken",{name:R,tokenType:W}),k(gt=>[...gt.filter(Vt=>Vt.name!==R),{name:R,tokenType:W,envVar:ct,filePath:St,expiresAt:""}])},[]),Mt=_.useCallback(R=>{console.log("[MockGrackle] deleteToken",R),k(U=>U.filter(W=>W.name!==R))},[]);_.useEffect(()=>()=>{nt.current.forEach(clearTimeout),nt.current.clear()},[]);const _t=_.useMemo(()=>({connected:!0,environments:lS,sessions:i,events:o,eventsDropped:0,lastSpawnedId:h,projects:p,tasks:v,findings:S,tokens:E,spawn:B,sendInput:ve,kill:Q,refresh:lt,loadSessionEvents:At,clearEvents:mt,createProject:Qt,archiveProject:yt,updateProject:(R,U)=>{console.log("[MockGrackle] updateProject",{projectId:R,...U}),g(W=>W.map(ct=>ct.id!==R?ct:{...ct,...U.name!==void 0?{name:U.name}:{},...U.description!==void 0?{description:U.description}:{},...U.repoUrl!==void 0?{repoUrl:U.repoUrl}:{},...U.defaultEnvironmentId!==void 0?{defaultEnvironmentId:U.defaultEnvironmentId}:{},updatedAt:new Date().toISOString()}))},loadTasks:bt,createTask:I,startTask:ae,approveTask:tn,rejectTask:Le,updateTask:Wt,deleteTask:en,loadFindings:ze,postFinding:Gt,addEnvironment:Pt,loadTokens:me,setToken:F,deleteToken:Mt,provisionStatus:{},provisionEnvironment:()=>{},stopEnvironment:()=>{},removeEnvironment:()=>{},codespaces:[],codespaceError:"",codespaceCreating:!1,listCodespaces:()=>{},createCodespace:()=>{},projectCreating:!1,taskStartingId:void 0,personas:q,createPersona:(R,U,W,ct,St,gt)=>{console.log("[MockGrackle] createPersona",{name:R});const Nt={id:`mock-persona-${Date.now()}`,name:R,description:U,systemPrompt:W,toolConfig:"{}",runtime:ct??"claude-code",model:St||"",maxTurns:gt||0,mcpServers:"[]",createdAt:new Date().toISOString(),updatedAt:new Date().toISOString()};K(Vt=>[...Vt,Nt])},updatePersona:(R,U,W,ct,St,gt,Nt)=>{console.log("[MockGrackle] updatePersona",{personaId:R,name:U}),K(Vt=>Vt.map(Yt=>Yt.id!==R?Yt:{...Yt,...U!==void 0?{name:U}:{},...W!==void 0?{description:W}:{},...ct!==void 0?{systemPrompt:ct}:{},...St!==void 0?{runtime:St}:{},...gt!==void 0?{model:gt}:{},...Nt!==void 0?{maxTurns:Nt}:{},updatedAt:new Date().toISOString()}))},deletePersona:R=>{console.log("[MockGrackle] deletePersona",R),K(U=>U.filter(W=>W.id!==R))},taskSessions:z,loadTaskSessions:R=>{console.log("[MockGrackle] loadTaskSessions",R)}}),[i,o,h,p,v,S,E,q,z,B,ve,Q,lt,At,mt,Qt,yt,bt,I,ae,tn,Le,Wt,en,ze,Gt,Pt,me,F,Mt]);return d.jsx(md.Provider,{value:_t,children:a})}const Rv=_.createContext(void 0),pS=4e3;function gS({children:a}){const[i,l]=_.useState([]),o=_.useRef(0),u=_.useCallback(f=>{l(p=>p.filter(g=>g.id!==f))},[]),h=_.useCallback((f,p="info",g=pS)=>{const v=`toast-${++o.current}`;l(b=>[...b,{id:v,message:f,variant:p,duration:g}])},[]);return d.jsx(Rv.Provider,{value:{toasts:i,showToast:h,dismissToast:u},children:a})}function gr(){const a=_.useContext(Rv);if(!a)throw new Error("useToast must be used within ToastProvider");return a}const pd=[{id:"glass",label:"Glassmorphism",description:"Dark frosted-glass aesthetic with backdrop blur effects."},{id:"light",label:"Light",description:"Clean light theme with subtle depth cues."},{id:"dark",label:"Dark",description:"Clean dark theme with subtle depth cues."},{id:"system",label:"System",description:"Follow your OS light/dark preference (clean theme).",isSystemAuto:!0,systemLightId:"light",systemDarkId:"dark"}],Ov=new Set(pd.map(a=>a.id)),Wp="glass";function zv(a){return pd.find(i=>i.id===a)}const Bv="grackle-theme",Uv="(prefers-color-scheme: dark)";let yl=[],nr;function tg(){nr=void 0;for(const a of yl)a()}function Vv(){return typeof window>"u"?!1:window.matchMedia(Uv).matches}function gd(){if(typeof localStorage>"u")return Wp;try{const a=localStorage.getItem(Bv);if(a!==null&&Ov.has(a))return a}catch{}return Wp}function Lv(a){const i=zv(a);return i!=null&&i.isSystemAuto?Vv()?i.systemDarkId??"dark":i.systemLightId??"light":a}function ar(a,i=!1){i&&document.documentElement.classList.add("no-transitions"),document.documentElement.dataset.theme=Lv(a),i&&(document.documentElement.offsetHeight,requestAnimationFrame(()=>{document.documentElement.classList.remove("no-transitions")}))}typeof document<"u"&&ar(gd());function vS(){return nr===void 0&&(nr={themeId:gd(),systemDark:Vv()}),nr}function yS(a){return yl=[...yl,a],()=>{yl=yl.filter(i=>i!==a)}}function bS(){const a=_.useSyncExternalStore(yS,vS),{themeId:i}=a,l=Lv(i),o=_.useCallback(u=>{if(Ov.has(u)){try{localStorage.setItem(Bv,u)}catch{}ar(u,!0),tg()}},[]);return _.useEffect(()=>{ar(i)},[i]),_.useEffect(()=>{if(typeof window>"u")return;const u=window.matchMedia(Uv),h=()=>{const f=gd(),p=zv(f);p!=null&&p.isSystemAuto&&ar(f),tg()};return u.addEventListener("change",h),()=>{u.removeEventListener("change",h)}},[]),{themeId:i,setTheme:o,resolvedThemeId:l}}const qv=_.createContext(void 0);function SS({children:a}){const i=bS();return d.jsx(qv.Provider,{value:i,children:a})}function _S(){const a=_.useContext(qv);if(!a)throw new Error("useThemeContext must be used within ThemeProvider");return a}const TS="_container_h53m1_1",xS="_brand_h53m1_27",jS="_info_h53m1_34",AS="_connectionDot_h53m1_42",NS="_connected_h53m1_45",ES="_disconnected_h53m1_49",CS="_settingsButton_h53m1_53",Ka={container:TS,brand:xS,info:jS,connectionDot:AS,connected:NS,disconnected:ES,settingsButton:CS};function DS({setViewMode:a}){const{connected:i,environments:l,sessions:o}=Hn(),u=l.length,h=l.filter(p=>p.status==="connected").length,f=o.filter(p=>["running","waiting_input"].includes(p.status)).length;return d.jsxs("div",{className:Ka.container,children:[d.jsx("div",{className:Ka.brand,children:"Grackle"}),d.jsxs("div",{className:Ka.info,children:[d.jsxs("span",{children:[d.jsx("span",{className:`${Ka.connectionDot} ${i?Ka.connected:Ka.disconnected}`,children:"●"})," ",i?"Connected":"Disconnected"]}),d.jsxs("span",{children:[h,"/",u," env",u!==1?"s":""]}),d.jsxs("span",{children:[f," active"]}),a&&d.jsxs(d.Fragment,{children:[d.jsx("button",{className:Ka.settingsButton,onClick:()=>a({kind:"persona_management"}),title:"Personas",children:"👤"}),d.jsx("button",{className:Ka.settingsButton,onClick:()=>a({kind:"settings"}),title:"Settings",children:"⚙"})]})]})]})}const vd=_.createContext({});function yd(a){const i=_.useRef(null);return i.current===null&&(i.current=a()),i.current}const vr=_.createContext(null),bd=_.createContext({transformPagePoint:a=>a,isStatic:!1,reducedMotion:"never"});class kS extends _.Component{getSnapshotBeforeUpdate(i){const l=this.props.childRef.current;if(l&&i.isPresent&&!this.props.isPresent){const o=this.props.sizeRef.current;o.height=l.offsetHeight||0,o.width=l.offsetWidth||0,o.top=l.offsetTop,o.left=l.offsetLeft}return null}componentDidUpdate(){}render(){return this.props.children}}function wS({children:a,isPresent:i}){const l=_.useId(),o=_.useRef(null),u=_.useRef({width:0,height:0,top:0,left:0}),{nonce:h}=_.useContext(bd);return _.useInsertionEffect(()=>{const{width:f,height:p,top:g,left:v}=u.current;if(i||!o.current||!f||!p)return;o.current.dataset.motionPopId=l;const b=document.createElement("style");return h&&(b.nonce=h),document.head.appendChild(b),b.sheet&&b.sheet.insertRule(`
68
- [data-motion-pop-id="${l}"] {
69
- position: absolute !important;
70
- width: ${f}px !important;
71
- height: ${p}px !important;
72
- top: ${g}px !important;
73
- left: ${v}px !important;
74
- }
75
- `),()=>{document.head.removeChild(b)}},[i]),d.jsx(kS,{isPresent:i,childRef:o,sizeRef:u,children:_.cloneElement(a,{ref:o})})}const MS=({children:a,initial:i,isPresent:l,onExitComplete:o,custom:u,presenceAffectsLayout:h,mode:f})=>{const p=yd(RS),g=_.useId(),v=_.useCallback(S=>{p.set(S,!0);for(const x of p.values())if(!x)return;o&&o()},[p,o]),b=_.useMemo(()=>({id:g,initial:i,isPresent:l,custom:u,onExitComplete:v,register:S=>(p.set(S,!1),()=>p.delete(S))}),h?[Math.random(),v]:[l,v]);return _.useMemo(()=>{p.forEach((S,x)=>p.set(x,!1))},[l]),_.useEffect(()=>{!l&&!p.size&&o&&o()},[l]),f==="popLayout"&&(a=d.jsx(wS,{isPresent:l,children:a})),d.jsx(vr.Provider,{value:b,children:a})};function RS(){return new Map}function Hv(a=!0){const i=_.useContext(vr);if(i===null)return[!0,null];const{isPresent:l,onExitComplete:o,register:u}=i,h=_.useId();_.useEffect(()=>{a&&u(h)},[a]);const f=_.useCallback(()=>a&&o&&o(h),[h,o,a]);return!l&&o?[!1,f]:[!0]}const Jo=a=>a.key||"";function eg(a){const i=[];return _.Children.forEach(a,l=>{_.isValidElement(l)&&i.push(l)}),i}const Sd=typeof window<"u",Gv=Sd?_.useLayoutEffect:_.useEffect,bi=({children:a,custom:i,initial:l=!0,onExitComplete:o,presenceAffectsLayout:u=!0,mode:h="sync",propagate:f=!1})=>{const[p,g]=Hv(f),v=_.useMemo(()=>eg(a),[a]),b=f&&!p?[]:v.map(Jo),S=_.useRef(!0),x=_.useRef(v),E=yd(()=>new Map),[k,q]=_.useState(v),[K,z]=_.useState(v);Gv(()=>{S.current=!1,x.current=v;for(let nt=0;nt<K.length;nt++){const X=Jo(K[nt]);b.includes(X)?E.delete(X):E.get(X)!==!0&&E.set(X,!1)}},[K,b.length,b.join("-")]);const P=[];if(v!==k){let nt=[...v];for(let X=0;X<K.length;X++){const V=K[X],et=Jo(V);b.includes(et)||(nt.splice(X,0,V),P.push(V))}h==="wait"&&P.length&&(nt=P),z(eg(nt)),q(v);return}const{forceRender:Y}=_.useContext(vd);return d.jsx(d.Fragment,{children:K.map(nt=>{const X=Jo(nt),V=f&&!p?!1:v===K||b.includes(X),et=()=>{if(E.has(X))E.set(X,!0);else return;let w=!0;E.forEach($=>{$||(w=!1)}),w&&(Y==null||Y(),z(x.current),f&&(g==null||g()),o&&o())};return d.jsx(MS,{isPresent:V,initial:!S.current||l?void 0:!1,custom:V?void 0:i,presenceAffectsLayout:u,mode:h,onExitComplete:V?void 0:et,children:nt},X)})})},_n=a=>a;let Iv=_n;const OS={useManualTiming:!1};function zS(a){let i=new Set,l=new Set,o=!1,u=!1;const h=new WeakSet;let f={delta:0,timestamp:0,isProcessing:!1};function p(v){h.has(v)&&(g.schedule(v),a()),v(f)}const g={schedule:(v,b=!1,S=!1)=>{const E=S&&o?i:l;return b&&h.add(v),E.has(v)||E.add(v),v},cancel:v=>{l.delete(v),h.delete(v)},process:v=>{if(f=v,o){u=!0;return}o=!0,[i,l]=[l,i],i.forEach(p),i.clear(),o=!1,u&&(u=!1,g.process(v))}};return g}const $o=["read","resolveKeyframes","update","preRender","render","postRender"],BS=40;function Yv(a,i){let l=!1,o=!0;const u={delta:0,timestamp:0,isProcessing:!1},h=()=>l=!0,f=$o.reduce((z,P)=>(z[P]=zS(h),z),{}),{read:p,resolveKeyframes:g,update:v,preRender:b,render:S,postRender:x}=f,E=()=>{const z=performance.now();l=!1,u.delta=o?1e3/60:Math.max(Math.min(z-u.timestamp,BS),1),u.timestamp=z,u.isProcessing=!0,p.process(u),g.process(u),v.process(u),b.process(u),S.process(u),x.process(u),u.isProcessing=!1,l&&i&&(o=!1,a(E))},k=()=>{l=!0,o=!0,u.isProcessing||a(E)};return{schedule:$o.reduce((z,P)=>{const Y=f[P];return z[P]=(nt,X=!1,V=!1)=>(l||k(),Y.schedule(nt,X,V)),z},{}),cancel:z=>{for(let P=0;P<$o.length;P++)f[$o[P]].cancel(z)},state:u,steps:f}}const{schedule:ue,cancel:Fa,state:Xe,steps:Ru}=Yv(typeof requestAnimationFrame<"u"?requestAnimationFrame:_n,!0),Zv=_.createContext({strict:!1}),ng={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"]},gi={};for(const a in ng)gi[a]={isEnabled:i=>ng[a].some(l=>!!i[l])};function US(a){for(const i in a)gi[i]={...gi[i],...a[i]}}const VS=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 or(a){return a.startsWith("while")||a.startsWith("drag")&&a!=="draggable"||a.startsWith("layout")||a.startsWith("onTap")||a.startsWith("onPan")||a.startsWith("onLayout")||VS.has(a)}let Kv=a=>!or(a);function LS(a){a&&(Kv=i=>i.startsWith("on")?!or(i):a(i))}try{LS(require("@emotion/is-prop-valid").default)}catch{}function qS(a,i,l){const o={};for(const u in a)u==="values"&&typeof a.values=="object"||(Kv(u)||l===!0&&or(u)||!i&&!or(u)||a.draggable&&u.startsWith("onDrag"))&&(o[u]=a[u]);return o}function HS(a){if(typeof Proxy>"u")return a;const i=new Map,l=(...o)=>a(...o);return new Proxy(l,{get:(o,u)=>u==="create"?a:(i.has(u)||i.set(u,a(u)),i.get(u))})}const yr=_.createContext({});function El(a){return typeof a=="string"||Array.isArray(a)}function br(a){return a!==null&&typeof a=="object"&&typeof a.start=="function"}const _d=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],Td=["initial",..._d];function Sr(a){return br(a.animate)||Td.some(i=>El(a[i]))}function Xv(a){return!!(Sr(a)||a.variants)}function GS(a,i){if(Sr(a)){const{initial:l,animate:o}=a;return{initial:l===!1||El(l)?l:void 0,animate:El(o)?o:void 0}}return a.inherit!==!1?i:{}}function IS(a){const{initial:i,animate:l}=GS(a,_.useContext(yr));return _.useMemo(()=>({initial:i,animate:l}),[ag(i),ag(l)])}function ag(a){return Array.isArray(a)?a.join(" "):a}const YS=Symbol.for("motionComponentSymbol");function di(a){return a&&typeof a=="object"&&Object.prototype.hasOwnProperty.call(a,"current")}function ZS(a,i,l){return _.useCallback(o=>{o&&a.onMount&&a.onMount(o),i&&(o?i.mount(o):i.unmount()),l&&(typeof l=="function"?l(o):di(l)&&(l.current=o))},[i])}const xd=a=>a.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase(),KS="framerAppearId",Qv="data-"+xd(KS),{schedule:jd}=Yv(queueMicrotask,!1),Pv=_.createContext({});function XS(a,i,l,o,u){var h,f;const{visualElement:p}=_.useContext(yr),g=_.useContext(Zv),v=_.useContext(vr),b=_.useContext(bd).reducedMotion,S=_.useRef(null);o=o||g.renderer,!S.current&&o&&(S.current=o(a,{visualState:i,parent:p,props:l,presenceContext:v,blockInitialAnimation:v?v.initial===!1:!1,reducedMotionConfig:b}));const x=S.current,E=_.useContext(Pv);x&&!x.projection&&u&&(x.type==="html"||x.type==="svg")&&QS(S.current,l,u,E);const k=_.useRef(!1);_.useInsertionEffect(()=>{x&&k.current&&x.update(l,v)});const q=l[Qv],K=_.useRef(!!q&&!(!((h=window.MotionHandoffIsComplete)===null||h===void 0)&&h.call(window,q))&&((f=window.MotionHasOptimisedAnimation)===null||f===void 0?void 0:f.call(window,q)));return Gv(()=>{x&&(k.current=!0,window.MotionIsMounted=!0,x.updateFeatures(),jd.render(x.render),K.current&&x.animationState&&x.animationState.animateChanges())}),_.useEffect(()=>{x&&(!K.current&&x.animationState&&x.animationState.animateChanges(),K.current&&(queueMicrotask(()=>{var z;(z=window.MotionHandoffMarkAsComplete)===null||z===void 0||z.call(window,q)}),K.current=!1))}),x}function QS(a,i,l,o){const{layoutId:u,layout:h,drag:f,dragConstraints:p,layoutScroll:g,layoutRoot:v}=i;a.projection=new l(a.latestValues,i["data-framer-portal-id"]?void 0:Fv(a.parent)),a.projection.setOptions({layoutId:u,layout:h,alwaysMeasureLayout:!!f||p&&di(p),visualElement:a,animationType:typeof h=="string"?h:"both",initialPromotionConfig:o,layoutScroll:g,layoutRoot:v})}function Fv(a){if(a)return a.options.allowProjection!==!1?a.projection:Fv(a.parent)}function PS({preloadedFeatures:a,createVisualElement:i,useRender:l,useVisualState:o,Component:u}){var h,f;a&&US(a);function p(v,b){let S;const x={..._.useContext(bd),...v,layoutId:FS(v)},{isStatic:E}=x,k=IS(v),q=o(v,E);if(!E&&Sd){JS();const K=$S(x);S=K.MeasureLayout,k.visualElement=XS(u,q,x,i,K.ProjectionNode)}return d.jsxs(yr.Provider,{value:k,children:[S&&k.visualElement?d.jsx(S,{visualElement:k.visualElement,...x}):null,l(u,v,ZS(q,k.visualElement,b),q,E,k.visualElement)]})}p.displayName=`motion.${typeof u=="string"?u:`create(${(f=(h=u.displayName)!==null&&h!==void 0?h:u.name)!==null&&f!==void 0?f:""})`}`;const g=_.forwardRef(p);return g[YS]=u,g}function FS({layoutId:a}){const i=_.useContext(vd).id;return i&&a!==void 0?i+"-"+a:a}function JS(a,i){_.useContext(Zv).strict}function $S(a){const{drag:i,layout:l}=gi;if(!i&&!l)return{};const o={...i,...l};return{MeasureLayout:i!=null&&i.isEnabled(a)||l!=null&&l.isEnabled(a)?o.MeasureLayout:void 0,ProjectionNode:o.ProjectionNode}}const WS=["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 Ad(a){return typeof a!="string"||a.includes("-")?!1:!!(WS.indexOf(a)>-1||/[A-Z]/u.test(a))}function sg(a){const i=[{},{}];return a==null||a.values.forEach((l,o)=>{i[0][o]=l.get(),i[1][o]=l.getVelocity()}),i}function Nd(a,i,l,o){if(typeof i=="function"){const[u,h]=sg(o);i=i(l!==void 0?l:a.custom,u,h)}if(typeof i=="string"&&(i=a.variants&&a.variants[i]),typeof i=="function"){const[u,h]=sg(o);i=i(l!==void 0?l:a.custom,u,h)}return i}const Pu=a=>Array.isArray(a),t_=a=>!!(a&&typeof a=="object"&&a.mix&&a.toValue),e_=a=>Pu(a)?a[a.length-1]||0:a,Pe=a=>!!(a&&a.getVelocity);function sr(a){const i=Pe(a)?a.get():a;return t_(i)?i.toValue():i}function n_({scrapeMotionValuesFromProps:a,createRenderState:i,onUpdate:l},o,u,h){const f={latestValues:a_(o,u,h,a),renderState:i()};return l&&(f.onMount=p=>l({props:o,current:p,...f}),f.onUpdate=p=>l(p)),f}const Jv=a=>(i,l)=>{const o=_.useContext(yr),u=_.useContext(vr),h=()=>n_(a,i,o,u);return l?h():yd(h)};function a_(a,i,l,o){const u={},h=o(a,{});for(const x in h)u[x]=sr(h[x]);let{initial:f,animate:p}=a;const g=Sr(a),v=Xv(a);i&&v&&!g&&a.inherit!==!1&&(f===void 0&&(f=i.initial),p===void 0&&(p=i.animate));let b=l?l.initial===!1:!1;b=b||f===!1;const S=b?p:f;if(S&&typeof S!="boolean"&&!br(S)){const x=Array.isArray(S)?S:[S];for(let E=0;E<x.length;E++){const k=Nd(a,x[E]);if(k){const{transitionEnd:q,transition:K,...z}=k;for(const P in z){let Y=z[P];if(Array.isArray(Y)){const nt=b?Y.length-1:0;Y=Y[nt]}Y!==null&&(u[P]=Y)}for(const P in q)u[P]=q[P]}}}return u}const Si=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],xs=new Set(Si),$v=a=>i=>typeof i=="string"&&i.startsWith(a),Wv=$v("--"),s_=$v("var(--"),Ed=a=>s_(a)?i_.test(a.split("/*")[0].trim()):!1,i_=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu,t0=(a,i)=>i&&typeof a=="number"?i.transform(a):a,Sa=(a,i,l)=>l>i?i:l<a?a:l,_i={test:a=>typeof a=="number",parse:parseFloat,transform:a=>a},Cl={..._i,transform:a=>Sa(0,1,a)},Wo={..._i,default:1},Ml=a=>({test:i=>typeof i=="string"&&i.endsWith(a)&&i.split(" ").length===1,parse:parseFloat,transform:i=>`${i}${a}`}),Xa=Ml("deg"),Pn=Ml("%"),vt=Ml("px"),l_=Ml("vh"),o_=Ml("vw"),ig={...Pn,parse:a=>Pn.parse(a)/100,transform:a=>Pn.transform(a*100)},r_={borderWidth:vt,borderTopWidth:vt,borderRightWidth:vt,borderBottomWidth:vt,borderLeftWidth:vt,borderRadius:vt,radius:vt,borderTopLeftRadius:vt,borderTopRightRadius:vt,borderBottomRightRadius:vt,borderBottomLeftRadius:vt,width:vt,maxWidth:vt,height:vt,maxHeight:vt,top:vt,right:vt,bottom:vt,left:vt,padding:vt,paddingTop:vt,paddingRight:vt,paddingBottom:vt,paddingLeft:vt,margin:vt,marginTop:vt,marginRight:vt,marginBottom:vt,marginLeft:vt,backgroundPositionX:vt,backgroundPositionY:vt},c_={rotate:Xa,rotateX:Xa,rotateY:Xa,rotateZ:Xa,scale:Wo,scaleX:Wo,scaleY:Wo,scaleZ:Wo,skew:Xa,skewX:Xa,skewY:Xa,distance:vt,translateX:vt,translateY:vt,translateZ:vt,x:vt,y:vt,z:vt,perspective:vt,transformPerspective:vt,opacity:Cl,originX:ig,originY:ig,originZ:vt},lg={..._i,transform:Math.round},Cd={...r_,...c_,zIndex:lg,size:vt,fillOpacity:Cl,strokeOpacity:Cl,numOctaves:lg},u_={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},d_=Si.length;function f_(a,i,l){let o="",u=!0;for(let h=0;h<d_;h++){const f=Si[h],p=a[f];if(p===void 0)continue;let g=!0;if(typeof p=="number"?g=p===(f.startsWith("scale")?1:0):g=parseFloat(p)===0,!g||l){const v=t0(p,Cd[f]);if(!g){u=!1;const b=u_[f]||f;o+=`${b}(${v}) `}l&&(i[f]=v)}}return o=o.trim(),l?o=l(i,u?"":o):u&&(o="none"),o}function Dd(a,i,l){const{style:o,vars:u,transformOrigin:h}=a;let f=!1,p=!1;for(const g in i){const v=i[g];if(xs.has(g)){f=!0;continue}else if(Wv(g)){u[g]=v;continue}else{const b=t0(v,Cd[g]);g.startsWith("origin")?(p=!0,h[g]=b):o[g]=b}}if(i.transform||(f||l?o.transform=f_(i,a.transform,l):o.transform&&(o.transform="none")),p){const{originX:g="50%",originY:v="50%",originZ:b=0}=h;o.transformOrigin=`${g} ${v} ${b}`}}const h_={offset:"stroke-dashoffset",array:"stroke-dasharray"},m_={offset:"strokeDashoffset",array:"strokeDasharray"};function p_(a,i,l=1,o=0,u=!0){a.pathLength=1;const h=u?h_:m_;a[h.offset]=vt.transform(-o);const f=vt.transform(i),p=vt.transform(l);a[h.array]=`${f} ${p}`}function og(a,i,l){return typeof a=="string"?a:vt.transform(i+l*a)}function g_(a,i,l){const o=og(i,a.x,a.width),u=og(l,a.y,a.height);return`${o} ${u}`}function kd(a,{attrX:i,attrY:l,attrScale:o,originX:u,originY:h,pathLength:f,pathSpacing:p=1,pathOffset:g=0,...v},b,S){if(Dd(a,v,S),b){a.style.viewBox&&(a.attrs.viewBox=a.style.viewBox);return}a.attrs=a.style,a.style={};const{attrs:x,style:E,dimensions:k}=a;x.transform&&(k&&(E.transform=x.transform),delete x.transform),k&&(u!==void 0||h!==void 0||E.transform)&&(E.transformOrigin=g_(k,u!==void 0?u:.5,h!==void 0?h:.5)),i!==void 0&&(x.x=i),l!==void 0&&(x.y=l),o!==void 0&&(x.scale=o),f!==void 0&&p_(x,f,p,g,!1)}const wd=()=>({style:{},transform:{},transformOrigin:{},vars:{}}),e0=()=>({...wd(),attrs:{}}),Md=a=>typeof a=="string"&&a.toLowerCase()==="svg";function n0(a,{style:i,vars:l},o,u){Object.assign(a.style,i,u&&u.getProjectionStyles(o));for(const h in l)a.style.setProperty(h,l[h])}const a0=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 s0(a,i,l,o){n0(a,i,void 0,o);for(const u in i.attrs)a.setAttribute(a0.has(u)?u:xd(u),i.attrs[u])}const rr={};function v_(a){Object.assign(rr,a)}function i0(a,{layout:i,layoutId:l}){return xs.has(a)||a.startsWith("origin")||(i||l!==void 0)&&(!!rr[a]||a==="opacity")}function Rd(a,i,l){var o;const{style:u}=a,h={};for(const f in u)(Pe(u[f])||i.style&&Pe(i.style[f])||i0(f,a)||((o=l==null?void 0:l.getValue(f))===null||o===void 0?void 0:o.liveStyle)!==void 0)&&(h[f]=u[f]);return h}function l0(a,i,l){const o=Rd(a,i,l);for(const u in a)if(Pe(a[u])||Pe(i[u])){const h=Si.indexOf(u)!==-1?"attr"+u.charAt(0).toUpperCase()+u.substring(1):u;o[h]=a[u]}return o}function y_(a,i){try{i.dimensions=typeof a.getBBox=="function"?a.getBBox():a.getBoundingClientRect()}catch{i.dimensions={x:0,y:0,width:0,height:0}}}const rg=["x","y","width","height","cx","cy","r"],b_={useVisualState:Jv({scrapeMotionValuesFromProps:l0,createRenderState:e0,onUpdate:({props:a,prevProps:i,current:l,renderState:o,latestValues:u})=>{if(!l)return;let h=!!a.drag;if(!h){for(const p in u)if(xs.has(p)){h=!0;break}}if(!h)return;let f=!i;if(i)for(let p=0;p<rg.length;p++){const g=rg[p];a[g]!==i[g]&&(f=!0)}f&&ue.read(()=>{y_(l,o),ue.render(()=>{kd(o,u,Md(l.tagName),a.transformTemplate),s0(l,o)})})}})},S_={useVisualState:Jv({scrapeMotionValuesFromProps:Rd,createRenderState:wd})};function o0(a,i,l){for(const o in i)!Pe(i[o])&&!i0(o,l)&&(a[o]=i[o])}function __({transformTemplate:a},i){return _.useMemo(()=>{const l=wd();return Dd(l,i,a),Object.assign({},l.vars,l.style)},[i])}function T_(a,i){const l=a.style||{},o={};return o0(o,l,a),Object.assign(o,__(a,i)),o}function x_(a,i){const l={},o=T_(a,i);return a.drag&&a.dragListener!==!1&&(l.draggable=!1,o.userSelect=o.WebkitUserSelect=o.WebkitTouchCallout="none",o.touchAction=a.drag===!0?"none":`pan-${a.drag==="x"?"y":"x"}`),a.tabIndex===void 0&&(a.onTap||a.onTapStart||a.whileTap)&&(l.tabIndex=0),l.style=o,l}function j_(a,i,l,o){const u=_.useMemo(()=>{const h=e0();return kd(h,i,Md(o),a.transformTemplate),{...h.attrs,style:{...h.style}}},[i]);if(a.style){const h={};o0(h,a.style,a),u.style={...h,...u.style}}return u}function A_(a=!1){return(l,o,u,{latestValues:h},f)=>{const g=(Ad(l)?j_:x_)(o,h,f,l),v=qS(o,typeof l=="string",a),b=l!==_.Fragment?{...v,...g,ref:u}:{},{children:S}=o,x=_.useMemo(()=>Pe(S)?S.get():S,[S]);return _.createElement(l,{...b,children:x})}}function N_(a,i){return function(o,{forwardMotionProps:u}={forwardMotionProps:!1}){const f={...Ad(o)?b_:S_,preloadedFeatures:a,useRender:A_(u),createVisualElement:i,Component:o};return PS(f)}}function r0(a,i){if(!Array.isArray(i))return!1;const l=i.length;if(l!==a.length)return!1;for(let o=0;o<l;o++)if(i[o]!==a[o])return!1;return!0}function _r(a,i,l){const o=a.getProps();return Nd(o,i,l!==void 0?l:o.custom,a)}function Od(a,i){return a?a[i]||a.default||a:void 0}const c0=new Set(["width","height","top","left","right","bottom",...Si]);let ir;function E_(){ir=void 0}const Fn={now:()=>(ir===void 0&&Fn.set(Xe.isProcessing||OS.useManualTiming?Xe.timestamp:performance.now()),ir),set:a=>{ir=a,queueMicrotask(E_)}};function zd(a,i){a.indexOf(i)===-1&&a.push(i)}function Bd(a,i){const l=a.indexOf(i);l>-1&&a.splice(l,1)}class Ud{constructor(){this.subscriptions=[]}add(i){return zd(this.subscriptions,i),()=>Bd(this.subscriptions,i)}notify(i,l,o){const u=this.subscriptions.length;if(u)if(u===1)this.subscriptions[0](i,l,o);else for(let h=0;h<u;h++){const f=this.subscriptions[h];f&&f(i,l,o)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}function u0(a,i){return i?a*(1e3/i):0}const cg=30,C_=a=>!isNaN(parseFloat(a));class D_{constructor(i,l={}){this.version="11.18.2",this.canTrackVelocity=null,this.events={},this.updateAndNotify=(o,u=!0)=>{const h=Fn.now();this.updatedAt!==h&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(o),this.current!==this.prev&&this.events.change&&this.events.change.notify(this.current),u&&this.events.renderRequest&&this.events.renderRequest.notify(this.current)},this.hasAnimated=!1,this.setCurrent(i),this.owner=l.owner}setCurrent(i){this.current=i,this.updatedAt=Fn.now(),this.canTrackVelocity===null&&i!==void 0&&(this.canTrackVelocity=C_(this.current))}setPrevFrameValue(i=this.current){this.prevFrameValue=i,this.prevUpdatedAt=this.updatedAt}onChange(i){return this.on("change",i)}on(i,l){this.events[i]||(this.events[i]=new Ud);const o=this.events[i].add(l);return i==="change"?()=>{o(),ue.read(()=>{this.events.change.getSize()||this.stop()})}:o}clearListeners(){for(const i in this.events)this.events[i].clear()}attach(i,l){this.passiveEffect=i,this.stopPassiveEffect=l}set(i,l=!0){!l||!this.passiveEffect?this.updateAndNotify(i,l):this.passiveEffect(i,this.updateAndNotify)}setWithVelocity(i,l,o){this.set(l),this.prev=void 0,this.prevFrameValue=i,this.prevUpdatedAt=this.updatedAt-o}jump(i,l=!0){this.updateAndNotify(i),this.prev=i,this.prevUpdatedAt=this.prevFrameValue=void 0,l&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}get(){return this.current}getPrevious(){return this.prev}getVelocity(){const i=Fn.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||i-this.updatedAt>cg)return 0;const l=Math.min(this.updatedAt-this.prevUpdatedAt,cg);return u0(parseFloat(this.current)-parseFloat(this.prevFrameValue),l)}start(i){return this.stop(),new Promise(l=>{this.hasAnimated=!0,this.animation=i(l),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 Dl(a,i){return new D_(a,i)}function k_(a,i,l){a.hasValue(i)?a.getValue(i).set(l):a.addValue(i,Dl(l))}function w_(a,i){const l=_r(a,i);let{transitionEnd:o={},transition:u={},...h}=l||{};h={...h,...o};for(const f in h){const p=e_(h[f]);k_(a,f,p)}}function M_(a){return!!(Pe(a)&&a.add)}function Fu(a,i){const l=a.getValue("willChange");if(M_(l))return l.add(i)}function d0(a){return a.props[Qv]}function Vd(a){let i;return()=>(i===void 0&&(i=a()),i)}const R_=Vd(()=>window.ScrollTimeline!==void 0);class O_{constructor(i){this.stop=()=>this.runAll("stop"),this.animations=i.filter(Boolean)}get finished(){return Promise.all(this.animations.map(i=>"finished"in i?i.finished:i))}getAll(i){return this.animations[0][i]}setAll(i,l){for(let o=0;o<this.animations.length;o++)this.animations[o][i]=l}attachTimeline(i,l){const o=this.animations.map(u=>{if(R_()&&u.attachTimeline)return u.attachTimeline(i);if(typeof l=="function")return l(u)});return()=>{o.forEach((u,h)=>{u&&u(),this.animations[h].stop()})}}get time(){return this.getAll("time")}set time(i){this.setAll("time",i)}get speed(){return this.getAll("speed")}set speed(i){this.setAll("speed",i)}get startTime(){return this.getAll("startTime")}get duration(){let i=0;for(let l=0;l<this.animations.length;l++)i=Math.max(i,this.animations[l].duration);return i}runAll(i){this.animations.forEach(l=>l[i]())}flatten(){this.runAll("flatten")}play(){this.runAll("play")}pause(){this.runAll("pause")}cancel(){this.runAll("cancel")}complete(){this.runAll("complete")}}class z_ extends O_{then(i,l){return Promise.all(this.animations).then(i).catch(l)}}const ya=a=>a*1e3,ba=a=>a/1e3;function Ld(a){return typeof a=="function"}function ug(a,i){a.timeline=i,a.onfinish=null}const qd=a=>Array.isArray(a)&&typeof a[0]=="number",B_={linearEasing:void 0};function U_(a,i){const l=Vd(a);return()=>{var o;return(o=B_[i])!==null&&o!==void 0?o:l()}}const cr=U_(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),vi=(a,i,l)=>{const o=i-a;return o===0?1:(l-a)/o},f0=(a,i,l=10)=>{let o="";const u=Math.max(Math.round(i/l),2);for(let h=0;h<u;h++)o+=a(vi(0,u-1,h))+", ";return`linear(${o.substring(0,o.length-2)})`};function h0(a){return!!(typeof a=="function"&&cr()||!a||typeof a=="string"&&(a in Ju||cr())||qd(a)||Array.isArray(a)&&a.every(h0))}const bl=([a,i,l,o])=>`cubic-bezier(${a}, ${i}, ${l}, ${o})`,Ju={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:bl([0,.65,.55,1]),circOut:bl([.55,0,1,.45]),backIn:bl([.31,.01,.66,-.59]),backOut:bl([.33,1.53,.69,.99])};function m0(a,i){if(a)return typeof a=="function"&&cr()?f0(a,i):qd(a)?bl(a):Array.isArray(a)?a.map(l=>m0(l,i)||Ju.easeOut):Ju[a]}const p0=(a,i,l)=>(((1-3*l+3*i)*a+(3*l-6*i))*a+3*i)*a,V_=1e-7,L_=12;function q_(a,i,l,o,u){let h,f,p=0;do f=i+(l-i)/2,h=p0(f,o,u)-a,h>0?l=f:i=f;while(Math.abs(h)>V_&&++p<L_);return f}function Rl(a,i,l,o){if(a===i&&l===o)return _n;const u=h=>q_(h,0,1,a,l);return h=>h===0||h===1?h:p0(u(h),i,o)}const g0=a=>i=>i<=.5?a(2*i)/2:(2-a(2*(1-i)))/2,v0=a=>i=>1-a(1-i),y0=Rl(.33,1.53,.69,.99),Hd=v0(y0),b0=g0(Hd),S0=a=>(a*=2)<1?.5*Hd(a):.5*(2-Math.pow(2,-10*(a-1))),Gd=a=>1-Math.sin(Math.acos(a)),_0=v0(Gd),T0=g0(Gd),x0=a=>/^0[^.\s]+$/u.test(a);function H_(a){return typeof a=="number"?a===0:a!==null?a==="none"||a==="0"||x0(a):!0}const xl=a=>Math.round(a*1e5)/1e5,Id=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function G_(a){return a==null}const I_=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,Yd=(a,i)=>l=>!!(typeof l=="string"&&I_.test(l)&&l.startsWith(a)||i&&!G_(l)&&Object.prototype.hasOwnProperty.call(l,i)),j0=(a,i,l)=>o=>{if(typeof o!="string")return o;const[u,h,f,p]=o.match(Id);return{[a]:parseFloat(u),[i]:parseFloat(h),[l]:parseFloat(f),alpha:p!==void 0?parseFloat(p):1}},Y_=a=>Sa(0,255,a),Ou={..._i,transform:a=>Math.round(Y_(a))},_s={test:Yd("rgb","red"),parse:j0("red","green","blue"),transform:({red:a,green:i,blue:l,alpha:o=1})=>"rgba("+Ou.transform(a)+", "+Ou.transform(i)+", "+Ou.transform(l)+", "+xl(Cl.transform(o))+")"};function Z_(a){let i="",l="",o="",u="";return a.length>5?(i=a.substring(1,3),l=a.substring(3,5),o=a.substring(5,7),u=a.substring(7,9)):(i=a.substring(1,2),l=a.substring(2,3),o=a.substring(3,4),u=a.substring(4,5),i+=i,l+=l,o+=o,u+=u),{red:parseInt(i,16),green:parseInt(l,16),blue:parseInt(o,16),alpha:u?parseInt(u,16)/255:1}}const $u={test:Yd("#"),parse:Z_,transform:_s.transform},fi={test:Yd("hsl","hue"),parse:j0("hue","saturation","lightness"),transform:({hue:a,saturation:i,lightness:l,alpha:o=1})=>"hsla("+Math.round(a)+", "+Pn.transform(xl(i))+", "+Pn.transform(xl(l))+", "+xl(Cl.transform(o))+")"},Qe={test:a=>_s.test(a)||$u.test(a)||fi.test(a),parse:a=>_s.test(a)?_s.parse(a):fi.test(a)?fi.parse(a):$u.parse(a),transform:a=>typeof a=="string"?a:a.hasOwnProperty("red")?_s.transform(a):fi.transform(a)},K_=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function X_(a){var i,l;return isNaN(a)&&typeof a=="string"&&(((i=a.match(Id))===null||i===void 0?void 0:i.length)||0)+(((l=a.match(K_))===null||l===void 0?void 0:l.length)||0)>0}const A0="number",N0="color",Q_="var",P_="var(",dg="${}",F_=/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 kl(a){const i=a.toString(),l=[],o={color:[],number:[],var:[]},u=[];let h=0;const p=i.replace(F_,g=>(Qe.test(g)?(o.color.push(h),u.push(N0),l.push(Qe.parse(g))):g.startsWith(P_)?(o.var.push(h),u.push(Q_),l.push(g)):(o.number.push(h),u.push(A0),l.push(parseFloat(g))),++h,dg)).split(dg);return{values:l,split:p,indexes:o,types:u}}function E0(a){return kl(a).values}function C0(a){const{split:i,types:l}=kl(a),o=i.length;return u=>{let h="";for(let f=0;f<o;f++)if(h+=i[f],u[f]!==void 0){const p=l[f];p===A0?h+=xl(u[f]):p===N0?h+=Qe.transform(u[f]):h+=u[f]}return h}}const J_=a=>typeof a=="number"?0:a;function $_(a){const i=E0(a);return C0(a)(i.map(J_))}const Ja={test:X_,parse:E0,createTransformer:C0,getAnimatableNone:$_},W_=new Set(["brightness","contrast","saturate","opacity"]);function tT(a){const[i,l]=a.slice(0,-1).split("(");if(i==="drop-shadow")return a;const[o]=l.match(Id)||[];if(!o)return a;const u=l.replace(o,"");let h=W_.has(i)?1:0;return o!==l&&(h*=100),i+"("+h+u+")"}const eT=/\b([a-z-]*)\(.*?\)/gu,Wu={...Ja,getAnimatableNone:a=>{const i=a.match(eT);return i?i.map(tT).join(" "):a}},nT={...Cd,color:Qe,backgroundColor:Qe,outlineColor:Qe,fill:Qe,stroke:Qe,borderColor:Qe,borderTopColor:Qe,borderRightColor:Qe,borderBottomColor:Qe,borderLeftColor:Qe,filter:Wu,WebkitFilter:Wu},Zd=a=>nT[a];function D0(a,i){let l=Zd(a);return l!==Wu&&(l=Ja),l.getAnimatableNone?l.getAnimatableNone(i):void 0}const aT=new Set(["auto","none","0"]);function sT(a,i,l){let o=0,u;for(;o<a.length&&!u;){const h=a[o];typeof h=="string"&&!aT.has(h)&&kl(h).values.length&&(u=a[o]),o++}if(u&&l)for(const h of i)a[h]=D0(l,u)}const fg=a=>a===_i||a===vt,hg=(a,i)=>parseFloat(a.split(", ")[i]),mg=(a,i)=>(l,{transform:o})=>{if(o==="none"||!o)return 0;const u=o.match(/^matrix3d\((.+)\)$/u);if(u)return hg(u[1],i);{const h=o.match(/^matrix\((.+)\)$/u);return h?hg(h[1],a):0}},iT=new Set(["x","y","z"]),lT=Si.filter(a=>!iT.has(a));function oT(a){const i=[];return lT.forEach(l=>{const o=a.getValue(l);o!==void 0&&(i.push([l,o.get()]),o.set(l.startsWith("scale")?1:0))}),i}const yi={width:({x:a},{paddingLeft:i="0",paddingRight:l="0"})=>a.max-a.min-parseFloat(i)-parseFloat(l),height:({y:a},{paddingTop:i="0",paddingBottom:l="0"})=>a.max-a.min-parseFloat(i)-parseFloat(l),top:(a,{top:i})=>parseFloat(i),left:(a,{left:i})=>parseFloat(i),bottom:({y:a},{top:i})=>parseFloat(i)+(a.max-a.min),right:({x:a},{left:i})=>parseFloat(i)+(a.max-a.min),x:mg(4,13),y:mg(5,14)};yi.translateX=yi.x;yi.translateY=yi.y;const Ts=new Set;let td=!1,ed=!1;function k0(){if(ed){const a=Array.from(Ts).filter(o=>o.needsMeasurement),i=new Set(a.map(o=>o.element)),l=new Map;i.forEach(o=>{const u=oT(o);u.length&&(l.set(o,u),o.render())}),a.forEach(o=>o.measureInitialState()),i.forEach(o=>{o.render();const u=l.get(o);u&&u.forEach(([h,f])=>{var p;(p=o.getValue(h))===null||p===void 0||p.set(f)})}),a.forEach(o=>o.measureEndState()),a.forEach(o=>{o.suspendedScrollY!==void 0&&window.scrollTo(0,o.suspendedScrollY)})}ed=!1,td=!1,Ts.forEach(a=>a.complete()),Ts.clear()}function w0(){Ts.forEach(a=>{a.readKeyframes(),a.needsMeasurement&&(ed=!0)})}function rT(){w0(),k0()}class Kd{constructor(i,l,o,u,h,f=!1){this.isComplete=!1,this.isAsync=!1,this.needsMeasurement=!1,this.isScheduled=!1,this.unresolvedKeyframes=[...i],this.onComplete=l,this.name=o,this.motionValue=u,this.element=h,this.isAsync=f}scheduleResolve(){this.isScheduled=!0,this.isAsync?(Ts.add(this),td||(td=!0,ue.read(w0),ue.resolveKeyframes(k0))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:i,name:l,element:o,motionValue:u}=this;for(let h=0;h<i.length;h++)if(i[h]===null)if(h===0){const f=u==null?void 0:u.get(),p=i[i.length-1];if(f!==void 0)i[0]=f;else if(o&&l){const g=o.readValue(l,p);g!=null&&(i[0]=g)}i[0]===void 0&&(i[0]=p),u&&f===void 0&&u.set(i[0])}else i[h]=i[h-1]}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(){this.isComplete=!0,this.onComplete(this.unresolvedKeyframes,this.finalKeyframe),Ts.delete(this)}cancel(){this.isComplete||(this.isScheduled=!1,Ts.delete(this))}resume(){this.isComplete||this.scheduleResolve()}}const M0=a=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(a),cT=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function uT(a){const i=cT.exec(a);if(!i)return[,];const[,l,o,u]=i;return[`--${l??o}`,u]}function R0(a,i,l=1){const[o,u]=uT(a);if(!o)return;const h=window.getComputedStyle(i).getPropertyValue(o);if(h){const f=h.trim();return M0(f)?parseFloat(f):f}return Ed(u)?R0(u,i,l+1):u}const O0=a=>i=>i.test(a),dT={test:a=>a==="auto",parse:a=>a},z0=[_i,vt,Pn,Xa,o_,l_,dT],pg=a=>z0.find(O0(a));class B0 extends Kd{constructor(i,l,o,u,h){super(i,l,o,u,h,!0)}readKeyframes(){const{unresolvedKeyframes:i,element:l,name:o}=this;if(!l||!l.current)return;super.readKeyframes();for(let g=0;g<i.length;g++){let v=i[g];if(typeof v=="string"&&(v=v.trim(),Ed(v))){const b=R0(v,l.current);b!==void 0&&(i[g]=b),g===i.length-1&&(this.finalKeyframe=v)}}if(this.resolveNoneKeyframes(),!c0.has(o)||i.length!==2)return;const[u,h]=i,f=pg(u),p=pg(h);if(f!==p)if(fg(f)&&fg(p))for(let g=0;g<i.length;g++){const v=i[g];typeof v=="string"&&(i[g]=parseFloat(v))}else this.needsMeasurement=!0}resolveNoneKeyframes(){const{unresolvedKeyframes:i,name:l}=this,o=[];for(let u=0;u<i.length;u++)H_(i[u])&&o.push(u);o.length&&sT(i,o,l)}measureInitialState(){const{element:i,unresolvedKeyframes:l,name:o}=this;if(!i||!i.current)return;o==="height"&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=yi[o](i.measureViewportBox(),window.getComputedStyle(i.current)),l[0]=this.measuredOrigin;const u=l[l.length-1];u!==void 0&&i.getValue(o,u).jump(u,!1)}measureEndState(){var i;const{element:l,name:o,unresolvedKeyframes:u}=this;if(!l||!l.current)return;const h=l.getValue(o);h&&h.jump(this.measuredOrigin,!1);const f=u.length-1,p=u[f];u[f]=yi[o](l.measureViewportBox(),window.getComputedStyle(l.current)),p!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=p),!((i=this.removedTransforms)===null||i===void 0)&&i.length&&this.removedTransforms.forEach(([g,v])=>{l.getValue(g).set(v)}),this.resolveNoneKeyframes()}}const gg=(a,i)=>i==="zIndex"?!1:!!(typeof a=="number"||Array.isArray(a)||typeof a=="string"&&(Ja.test(a)||a==="0")&&!a.startsWith("url("));function fT(a){const i=a[0];if(a.length===1)return!0;for(let l=0;l<a.length;l++)if(a[l]!==i)return!0}function hT(a,i,l,o){const u=a[0];if(u===null)return!1;if(i==="display"||i==="visibility")return!0;const h=a[a.length-1],f=gg(u,i),p=gg(h,i);return!f||!p?!1:fT(a)||(l==="spring"||Ld(l))&&o}const mT=a=>a!==null;function Tr(a,{repeat:i,repeatType:l="loop"},o){const u=a.filter(mT),h=i&&l!=="loop"&&i%2===1?0:u.length-1;return!h||o===void 0?u[h]:o}const pT=40;class U0{constructor({autoplay:i=!0,delay:l=0,type:o="keyframes",repeat:u=0,repeatDelay:h=0,repeatType:f="loop",...p}){this.isStopped=!1,this.hasAttemptedResolve=!1,this.createdAt=Fn.now(),this.options={autoplay:i,delay:l,type:o,repeat:u,repeatDelay:h,repeatType:f,...p},this.updateFinishedPromise()}calcStartTime(){return this.resolvedAt?this.resolvedAt-this.createdAt>pT?this.resolvedAt:this.createdAt:this.createdAt}get resolved(){return!this._resolved&&!this.hasAttemptedResolve&&rT(),this._resolved}onKeyframesResolved(i,l){this.resolvedAt=Fn.now(),this.hasAttemptedResolve=!0;const{name:o,type:u,velocity:h,delay:f,onComplete:p,onUpdate:g,isGenerator:v}=this.options;if(!v&&!hT(i,o,u,h))if(f)this.options.duration=0;else{g&&g(Tr(i,this.options,l)),p&&p(),this.resolveFinishedPromise();return}const b=this.initPlayback(i,l);b!==!1&&(this._resolved={keyframes:i,finalKeyframe:l,...b},this.onPostResolved())}onPostResolved(){}then(i,l){return this.currentFinishedPromise.then(i,l)}flatten(){this.options.type="keyframes",this.options.ease="linear"}updateFinishedPromise(){this.currentFinishedPromise=new Promise(i=>{this.resolveFinishedPromise=i})}}const nd=2e4;function V0(a){let i=0;const l=50;let o=a.next(i);for(;!o.done&&i<nd;)i+=l,o=a.next(i);return i>=nd?1/0:i}const ge=(a,i,l)=>a+(i-a)*l;function zu(a,i,l){return l<0&&(l+=1),l>1&&(l-=1),l<1/6?a+(i-a)*6*l:l<1/2?i:l<2/3?a+(i-a)*(2/3-l)*6:a}function gT({hue:a,saturation:i,lightness:l,alpha:o}){a/=360,i/=100,l/=100;let u=0,h=0,f=0;if(!i)u=h=f=l;else{const p=l<.5?l*(1+i):l+i-l*i,g=2*l-p;u=zu(g,p,a+1/3),h=zu(g,p,a),f=zu(g,p,a-1/3)}return{red:Math.round(u*255),green:Math.round(h*255),blue:Math.round(f*255),alpha:o}}function ur(a,i){return l=>l>0?i:a}const Bu=(a,i,l)=>{const o=a*a,u=l*(i*i-o)+o;return u<0?0:Math.sqrt(u)},vT=[$u,_s,fi],yT=a=>vT.find(i=>i.test(a));function vg(a){const i=yT(a);if(!i)return!1;let l=i.parse(a);return i===fi&&(l=gT(l)),l}const yg=(a,i)=>{const l=vg(a),o=vg(i);if(!l||!o)return ur(a,i);const u={...l};return h=>(u.red=Bu(l.red,o.red,h),u.green=Bu(l.green,o.green,h),u.blue=Bu(l.blue,o.blue,h),u.alpha=ge(l.alpha,o.alpha,h),_s.transform(u))},bT=(a,i)=>l=>i(a(l)),Ol=(...a)=>a.reduce(bT),ad=new Set(["none","hidden"]);function ST(a,i){return ad.has(a)?l=>l<=0?a:i:l=>l>=1?i:a}function _T(a,i){return l=>ge(a,i,l)}function Xd(a){return typeof a=="number"?_T:typeof a=="string"?Ed(a)?ur:Qe.test(a)?yg:jT:Array.isArray(a)?L0:typeof a=="object"?Qe.test(a)?yg:TT:ur}function L0(a,i){const l=[...a],o=l.length,u=a.map((h,f)=>Xd(h)(h,i[f]));return h=>{for(let f=0;f<o;f++)l[f]=u[f](h);return l}}function TT(a,i){const l={...a,...i},o={};for(const u in l)a[u]!==void 0&&i[u]!==void 0&&(o[u]=Xd(a[u])(a[u],i[u]));return u=>{for(const h in o)l[h]=o[h](u);return l}}function xT(a,i){var l;const o=[],u={color:0,var:0,number:0};for(let h=0;h<i.values.length;h++){const f=i.types[h],p=a.indexes[f][u[f]],g=(l=a.values[p])!==null&&l!==void 0?l:0;o[h]=g,u[f]++}return o}const jT=(a,i)=>{const l=Ja.createTransformer(i),o=kl(a),u=kl(i);return o.indexes.var.length===u.indexes.var.length&&o.indexes.color.length===u.indexes.color.length&&o.indexes.number.length>=u.indexes.number.length?ad.has(a)&&!u.values.length||ad.has(i)&&!o.values.length?ST(a,i):Ol(L0(xT(o,u),u.values),l):ur(a,i)};function q0(a,i,l){return typeof a=="number"&&typeof i=="number"&&typeof l=="number"?ge(a,i,l):Xd(a)(a,i)}const AT=5;function H0(a,i,l){const o=Math.max(i-AT,0);return u0(l-a(o),i-o)}const Se={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},Uu=.001;function NT({duration:a=Se.duration,bounce:i=Se.bounce,velocity:l=Se.velocity,mass:o=Se.mass}){let u,h,f=1-i;f=Sa(Se.minDamping,Se.maxDamping,f),a=Sa(Se.minDuration,Se.maxDuration,ba(a)),f<1?(u=v=>{const b=v*f,S=b*a,x=b-l,E=sd(v,f),k=Math.exp(-S);return Uu-x/E*k},h=v=>{const S=v*f*a,x=S*l+l,E=Math.pow(f,2)*Math.pow(v,2)*a,k=Math.exp(-S),q=sd(Math.pow(v,2),f);return(-u(v)+Uu>0?-1:1)*((x-E)*k)/q}):(u=v=>{const b=Math.exp(-v*a),S=(v-l)*a+1;return-Uu+b*S},h=v=>{const b=Math.exp(-v*a),S=(l-v)*(a*a);return b*S});const p=5/a,g=CT(u,h,p);if(a=ya(a),isNaN(g))return{stiffness:Se.stiffness,damping:Se.damping,duration:a};{const v=Math.pow(g,2)*o;return{stiffness:v,damping:f*2*Math.sqrt(o*v),duration:a}}}const ET=12;function CT(a,i,l){let o=l;for(let u=1;u<ET;u++)o=o-a(o)/i(o);return o}function sd(a,i){return a*Math.sqrt(1-i*i)}const DT=["duration","bounce"],kT=["stiffness","damping","mass"];function bg(a,i){return i.some(l=>a[l]!==void 0)}function wT(a){let i={velocity:Se.velocity,stiffness:Se.stiffness,damping:Se.damping,mass:Se.mass,isResolvedFromDuration:!1,...a};if(!bg(a,kT)&&bg(a,DT))if(a.visualDuration){const l=a.visualDuration,o=2*Math.PI/(l*1.2),u=o*o,h=2*Sa(.05,1,1-(a.bounce||0))*Math.sqrt(u);i={...i,mass:Se.mass,stiffness:u,damping:h}}else{const l=NT(a);i={...i,...l,mass:Se.mass},i.isResolvedFromDuration=!0}return i}function G0(a=Se.visualDuration,i=Se.bounce){const l=typeof a!="object"?{visualDuration:a,keyframes:[0,1],bounce:i}:a;let{restSpeed:o,restDelta:u}=l;const h=l.keyframes[0],f=l.keyframes[l.keyframes.length-1],p={done:!1,value:h},{stiffness:g,damping:v,mass:b,duration:S,velocity:x,isResolvedFromDuration:E}=wT({...l,velocity:-ba(l.velocity||0)}),k=x||0,q=v/(2*Math.sqrt(g*b)),K=f-h,z=ba(Math.sqrt(g/b)),P=Math.abs(K)<5;o||(o=P?Se.restSpeed.granular:Se.restSpeed.default),u||(u=P?Se.restDelta.granular:Se.restDelta.default);let Y;if(q<1){const X=sd(z,q);Y=V=>{const et=Math.exp(-q*z*V);return f-et*((k+q*z*K)/X*Math.sin(X*V)+K*Math.cos(X*V))}}else if(q===1)Y=X=>f-Math.exp(-z*X)*(K+(k+z*K)*X);else{const X=z*Math.sqrt(q*q-1);Y=V=>{const et=Math.exp(-q*z*V),w=Math.min(X*V,300);return f-et*((k+q*z*K)*Math.sinh(w)+X*K*Math.cosh(w))/X}}const nt={calculatedDuration:E&&S||null,next:X=>{const V=Y(X);if(E)p.done=X>=S;else{let et=0;q<1&&(et=X===0?ya(k):H0(Y,X,V));const w=Math.abs(et)<=o,$=Math.abs(f-V)<=u;p.done=w&&$}return p.value=p.done?f:V,p},toString:()=>{const X=Math.min(V0(nt),nd),V=f0(et=>nt.next(X*et).value,X,30);return X+"ms "+V}};return nt}function Sg({keyframes:a,velocity:i=0,power:l=.8,timeConstant:o=325,bounceDamping:u=10,bounceStiffness:h=500,modifyTarget:f,min:p,max:g,restDelta:v=.5,restSpeed:b}){const S=a[0],x={done:!1,value:S},E=w=>p!==void 0&&w<p||g!==void 0&&w>g,k=w=>p===void 0?g:g===void 0||Math.abs(p-w)<Math.abs(g-w)?p:g;let q=l*i;const K=S+q,z=f===void 0?K:f(K);z!==K&&(q=z-S);const P=w=>-q*Math.exp(-w/o),Y=w=>z+P(w),nt=w=>{const $=P(w),st=Y(w);x.done=Math.abs($)<=v,x.value=x.done?z:st};let X,V;const et=w=>{E(x.value)&&(X=w,V=G0({keyframes:[x.value,k(x.value)],velocity:H0(Y,w,x.value),damping:u,stiffness:h,restDelta:v,restSpeed:b}))};return et(0),{calculatedDuration:null,next:w=>{let $=!1;return!V&&X===void 0&&($=!0,nt(w),et(w)),X!==void 0&&w>=X?V.next(w-X):(!$&&nt(w),x)}}}const MT=Rl(.42,0,1,1),RT=Rl(0,0,.58,1),I0=Rl(.42,0,.58,1),OT=a=>Array.isArray(a)&&typeof a[0]!="number",zT={linear:_n,easeIn:MT,easeInOut:I0,easeOut:RT,circIn:Gd,circInOut:T0,circOut:_0,backIn:Hd,backInOut:b0,backOut:y0,anticipate:S0},_g=a=>{if(qd(a)){Iv(a.length===4);const[i,l,o,u]=a;return Rl(i,l,o,u)}else if(typeof a=="string")return zT[a];return a};function BT(a,i,l){const o=[],u=l||q0,h=a.length-1;for(let f=0;f<h;f++){let p=u(a[f],a[f+1]);if(i){const g=Array.isArray(i)?i[f]||_n:i;p=Ol(g,p)}o.push(p)}return o}function UT(a,i,{clamp:l=!0,ease:o,mixer:u}={}){const h=a.length;if(Iv(h===i.length),h===1)return()=>i[0];if(h===2&&i[0]===i[1])return()=>i[1];const f=a[0]===a[1];a[0]>a[h-1]&&(a=[...a].reverse(),i=[...i].reverse());const p=BT(i,o,u),g=p.length,v=b=>{if(f&&b<a[0])return i[0];let S=0;if(g>1)for(;S<a.length-2&&!(b<a[S+1]);S++);const x=vi(a[S],a[S+1],b);return p[S](x)};return l?b=>v(Sa(a[0],a[h-1],b)):v}function VT(a,i){const l=a[a.length-1];for(let o=1;o<=i;o++){const u=vi(0,i,o);a.push(ge(l,1,u))}}function LT(a){const i=[0];return VT(i,a.length-1),i}function qT(a,i){return a.map(l=>l*i)}function HT(a,i){return a.map(()=>i||I0).splice(0,a.length-1)}function dr({duration:a=300,keyframes:i,times:l,ease:o="easeInOut"}){const u=OT(o)?o.map(_g):_g(o),h={done:!1,value:i[0]},f=qT(l&&l.length===i.length?l:LT(i),a),p=UT(f,i,{ease:Array.isArray(u)?u:HT(i,u)});return{calculatedDuration:a,next:g=>(h.value=p(g),h.done=g>=a,h)}}const GT=a=>{const i=({timestamp:l})=>a(l);return{start:()=>ue.update(i,!0),stop:()=>Fa(i),now:()=>Xe.isProcessing?Xe.timestamp:Fn.now()}},IT={decay:Sg,inertia:Sg,tween:dr,keyframes:dr,spring:G0},YT=a=>a/100;class Qd extends U0{constructor(i){super(i),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:g}=this.options;g&&g()};const{name:l,motionValue:o,element:u,keyframes:h}=this.options,f=(u==null?void 0:u.KeyframeResolver)||Kd,p=(g,v)=>this.onKeyframesResolved(g,v);this.resolver=new f(h,p,l,o,u),this.resolver.scheduleResolve()}flatten(){super.flatten(),this._resolved&&Object.assign(this._resolved,this.initPlayback(this._resolved.keyframes))}initPlayback(i){const{type:l="keyframes",repeat:o=0,repeatDelay:u=0,repeatType:h,velocity:f=0}=this.options,p=Ld(l)?l:IT[l]||dr;let g,v;p!==dr&&typeof i[0]!="number"&&(g=Ol(YT,q0(i[0],i[1])),i=[0,100]);const b=p({...this.options,keyframes:i});h==="mirror"&&(v=p({...this.options,keyframes:[...i].reverse(),velocity:-f})),b.calculatedDuration===null&&(b.calculatedDuration=V0(b));const{calculatedDuration:S}=b,x=S+u,E=x*(o+1)-u;return{generator:b,mirroredGenerator:v,mapPercentToKeyframes:g,calculatedDuration:S,resolvedDuration:x,totalDuration:E}}onPostResolved(){const{autoplay:i=!0}=this.options;this.play(),this.pendingPlayState==="paused"||!i?this.pause():this.state=this.pendingPlayState}tick(i,l=!1){const{resolved:o}=this;if(!o){const{keyframes:w}=this.options;return{done:!0,value:w[w.length-1]}}const{finalKeyframe:u,generator:h,mirroredGenerator:f,mapPercentToKeyframes:p,keyframes:g,calculatedDuration:v,totalDuration:b,resolvedDuration:S}=o;if(this.startTime===null)return h.next(0);const{delay:x,repeat:E,repeatType:k,repeatDelay:q,onUpdate:K}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,i):this.speed<0&&(this.startTime=Math.min(i-b/this.speed,this.startTime)),l?this.currentTime=i:this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=Math.round(i-this.startTime)*this.speed;const z=this.currentTime-x*(this.speed>=0?1:-1),P=this.speed>=0?z<0:z>b;this.currentTime=Math.max(z,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=b);let Y=this.currentTime,nt=h;if(E){const w=Math.min(this.currentTime,b)/S;let $=Math.floor(w),st=w%1;!st&&w>=1&&(st=1),st===1&&$--,$=Math.min($,E+1),!!($%2)&&(k==="reverse"?(st=1-st,q&&(st-=q/S)):k==="mirror"&&(nt=f)),Y=Sa(0,1,st)*S}const X=P?{done:!1,value:g[0]}:nt.next(Y);p&&(X.value=p(X.value));let{done:V}=X;!P&&v!==null&&(V=this.speed>=0?this.currentTime>=b:this.currentTime<=0);const et=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&V);return et&&u!==void 0&&(X.value=Tr(g,this.options,u)),K&&K(X.value),et&&this.finish(),X}get duration(){const{resolved:i}=this;return i?ba(i.calculatedDuration):0}get time(){return ba(this.currentTime)}set time(i){i=ya(i),this.currentTime=i,this.holdTime!==null||this.speed===0?this.holdTime=i:this.driver&&(this.startTime=this.driver.now()-i/this.speed)}get speed(){return this.playbackSpeed}set speed(i){const l=this.playbackSpeed!==i;this.playbackSpeed=i,l&&(this.time=ba(this.currentTime))}play(){if(this.resolver.isScheduled||this.resolver.resume(),!this._resolved){this.pendingPlayState="running";return}if(this.isStopped)return;const{driver:i=GT,onPlay:l,startTime:o}=this.options;this.driver||(this.driver=i(h=>this.tick(h))),l&&l();const u=this.driver.now();this.holdTime!==null?this.startTime=u-this.holdTime:this.startTime?this.state==="finished"&&(this.startTime=u):this.startTime=o??this.calcStartTime(),this.state==="finished"&&this.updateFinishedPromise(),this.cancelTime=this.startTime,this.holdTime=null,this.state="running",this.driver.start()}pause(){var i;if(!this._resolved){this.pendingPlayState="paused";return}this.state="paused",this.holdTime=(i=this.currentTime)!==null&&i!==void 0?i:0}complete(){this.state!=="running"&&this.play(),this.pendingPlayState=this.state="finished",this.holdTime=null}finish(){this.teardown(),this.state="finished";const{onComplete:i}=this.options;i&&i()}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(i){return this.startTime=0,this.tick(i,!0)}}const ZT=new Set(["opacity","clipPath","filter","transform"]);function KT(a,i,l,{delay:o=0,duration:u=300,repeat:h=0,repeatType:f="loop",ease:p="easeInOut",times:g}={}){const v={[i]:l};g&&(v.offset=g);const b=m0(p,u);return Array.isArray(b)&&(v.easing=b),a.animate(v,{delay:o,duration:u,easing:Array.isArray(b)?"linear":b,fill:"both",iterations:h+1,direction:f==="reverse"?"alternate":"normal"})}const XT=Vd(()=>Object.hasOwnProperty.call(Element.prototype,"animate")),fr=10,QT=2e4;function PT(a){return Ld(a.type)||a.type==="spring"||!h0(a.ease)}function FT(a,i){const l=new Qd({...i,keyframes:a,repeat:0,delay:0,isGenerator:!0});let o={done:!1,value:a[0]};const u=[];let h=0;for(;!o.done&&h<QT;)o=l.sample(h),u.push(o.value),h+=fr;return{times:void 0,keyframes:u,duration:h-fr,ease:"linear"}}const Y0={anticipate:S0,backInOut:b0,circInOut:T0};function JT(a){return a in Y0}class Tg extends U0{constructor(i){super(i);const{name:l,motionValue:o,element:u,keyframes:h}=this.options;this.resolver=new B0(h,(f,p)=>this.onKeyframesResolved(f,p),l,o,u),this.resolver.scheduleResolve()}initPlayback(i,l){let{duration:o=300,times:u,ease:h,type:f,motionValue:p,name:g,startTime:v}=this.options;if(!p.owner||!p.owner.current)return!1;if(typeof h=="string"&&cr()&&JT(h)&&(h=Y0[h]),PT(this.options)){const{onComplete:S,onUpdate:x,motionValue:E,element:k,...q}=this.options,K=FT(i,q);i=K.keyframes,i.length===1&&(i[1]=i[0]),o=K.duration,u=K.times,h=K.ease,f="keyframes"}const b=KT(p.owner.current,g,i,{...this.options,duration:o,times:u,ease:h});return b.startTime=v??this.calcStartTime(),this.pendingTimeline?(ug(b,this.pendingTimeline),this.pendingTimeline=void 0):b.onfinish=()=>{const{onComplete:S}=this.options;p.set(Tr(i,this.options,l)),S&&S(),this.cancel(),this.resolveFinishedPromise()},{animation:b,duration:o,times:u,type:f,ease:h,keyframes:i}}get duration(){const{resolved:i}=this;if(!i)return 0;const{duration:l}=i;return ba(l)}get time(){const{resolved:i}=this;if(!i)return 0;const{animation:l}=i;return ba(l.currentTime||0)}set time(i){const{resolved:l}=this;if(!l)return;const{animation:o}=l;o.currentTime=ya(i)}get speed(){const{resolved:i}=this;if(!i)return 1;const{animation:l}=i;return l.playbackRate}set speed(i){const{resolved:l}=this;if(!l)return;const{animation:o}=l;o.playbackRate=i}get state(){const{resolved:i}=this;if(!i)return"idle";const{animation:l}=i;return l.playState}get startTime(){const{resolved:i}=this;if(!i)return null;const{animation:l}=i;return l.startTime}attachTimeline(i){if(!this._resolved)this.pendingTimeline=i;else{const{resolved:l}=this;if(!l)return _n;const{animation:o}=l;ug(o,i)}return _n}play(){if(this.isStopped)return;const{resolved:i}=this;if(!i)return;const{animation:l}=i;l.playState==="finished"&&this.updateFinishedPromise(),l.play()}pause(){const{resolved:i}=this;if(!i)return;const{animation:l}=i;l.pause()}stop(){if(this.resolver.cancel(),this.isStopped=!0,this.state==="idle")return;this.resolveFinishedPromise(),this.updateFinishedPromise();const{resolved:i}=this;if(!i)return;const{animation:l,keyframes:o,duration:u,type:h,ease:f,times:p}=i;if(l.playState==="idle"||l.playState==="finished")return;if(this.time){const{motionValue:v,onUpdate:b,onComplete:S,element:x,...E}=this.options,k=new Qd({...E,keyframes:o,duration:u,type:h,ease:f,times:p,isGenerator:!0}),q=ya(this.time);v.setWithVelocity(k.sample(q-fr).value,k.sample(q).value,fr)}const{onStop:g}=this.options;g&&g(),this.cancel()}complete(){const{resolved:i}=this;i&&i.animation.finish()}cancel(){const{resolved:i}=this;i&&i.animation.cancel()}static supports(i){const{motionValue:l,name:o,repeatDelay:u,repeatType:h,damping:f,type:p}=i;if(!l||!l.owner||!(l.owner.current instanceof HTMLElement))return!1;const{onUpdate:g,transformTemplate:v}=l.owner.getProps();return XT()&&o&&ZT.has(o)&&!g&&!v&&!u&&h!=="mirror"&&f!==0&&p!=="inertia"}}const $T={type:"spring",stiffness:500,damping:25,restSpeed:10},WT=a=>({type:"spring",stiffness:550,damping:a===0?2*Math.sqrt(550):30,restSpeed:10}),tx={type:"keyframes",duration:.8},ex={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},nx=(a,{keyframes:i})=>i.length>2?tx:xs.has(a)?a.startsWith("scale")?WT(i[1]):$T:ex;function ax({when:a,delay:i,delayChildren:l,staggerChildren:o,staggerDirection:u,repeat:h,repeatType:f,repeatDelay:p,from:g,elapsed:v,...b}){return!!Object.keys(b).length}const Pd=(a,i,l,o={},u,h)=>f=>{const p=Od(o,a)||{},g=p.delay||o.delay||0;let{elapsed:v=0}=o;v=v-ya(g);let b={keyframes:Array.isArray(l)?l:[null,l],ease:"easeOut",velocity:i.getVelocity(),...p,delay:-v,onUpdate:x=>{i.set(x),p.onUpdate&&p.onUpdate(x)},onComplete:()=>{f(),p.onComplete&&p.onComplete()},name:a,motionValue:i,element:h?void 0:u};ax(p)||(b={...b,...nx(a,b)}),b.duration&&(b.duration=ya(b.duration)),b.repeatDelay&&(b.repeatDelay=ya(b.repeatDelay)),b.from!==void 0&&(b.keyframes[0]=b.from);let S=!1;if((b.type===!1||b.duration===0&&!b.repeatDelay)&&(b.duration=0,b.delay===0&&(S=!0)),S&&!h&&i.get()!==void 0){const x=Tr(b.keyframes,p);if(x!==void 0)return ue.update(()=>{b.onUpdate(x),b.onComplete()}),new z_([])}return!h&&Tg.supports(b)?new Tg(b):new Qd(b)};function sx({protectedKeys:a,needsAnimating:i},l){const o=a.hasOwnProperty(l)&&i[l]!==!0;return i[l]=!1,o}function Z0(a,i,{delay:l=0,transitionOverride:o,type:u}={}){var h;let{transition:f=a.getDefaultTransition(),transitionEnd:p,...g}=i;o&&(f=o);const v=[],b=u&&a.animationState&&a.animationState.getState()[u];for(const S in g){const x=a.getValue(S,(h=a.latestValues[S])!==null&&h!==void 0?h:null),E=g[S];if(E===void 0||b&&sx(b,S))continue;const k={delay:l,...Od(f||{},S)};let q=!1;if(window.MotionHandoffAnimation){const z=d0(a);if(z){const P=window.MotionHandoffAnimation(z,S,ue);P!==null&&(k.startTime=P,q=!0)}}Fu(a,S),x.start(Pd(S,x,E,a.shouldReduceMotion&&c0.has(S)?{type:!1}:k,a,q));const K=x.animation;K&&v.push(K)}return p&&Promise.all(v).then(()=>{ue.update(()=>{p&&w_(a,p)})}),v}function id(a,i,l={}){var o;const u=_r(a,i,l.type==="exit"?(o=a.presenceContext)===null||o===void 0?void 0:o.custom:void 0);let{transition:h=a.getDefaultTransition()||{}}=u||{};l.transitionOverride&&(h=l.transitionOverride);const f=u?()=>Promise.all(Z0(a,u,l)):()=>Promise.resolve(),p=a.variantChildren&&a.variantChildren.size?(v=0)=>{const{delayChildren:b=0,staggerChildren:S,staggerDirection:x}=h;return ix(a,i,b+v,S,x,l)}:()=>Promise.resolve(),{when:g}=h;if(g){const[v,b]=g==="beforeChildren"?[f,p]:[p,f];return v().then(()=>b())}else return Promise.all([f(),p(l.delay)])}function ix(a,i,l=0,o=0,u=1,h){const f=[],p=(a.variantChildren.size-1)*o,g=u===1?(v=0)=>v*o:(v=0)=>p-v*o;return Array.from(a.variantChildren).sort(lx).forEach((v,b)=>{v.notify("AnimationStart",i),f.push(id(v,i,{...h,delay:l+g(b)}).then(()=>v.notify("AnimationComplete",i)))}),Promise.all(f)}function lx(a,i){return a.sortNodePosition(i)}function ox(a,i,l={}){a.notify("AnimationStart",i);let o;if(Array.isArray(i)){const u=i.map(h=>id(a,h,l));o=Promise.all(u)}else if(typeof i=="string")o=id(a,i,l);else{const u=typeof i=="function"?_r(a,i,l.custom):i;o=Promise.all(Z0(a,u,l))}return o.then(()=>{a.notify("AnimationComplete",i)})}const rx=Td.length;function K0(a){if(!a)return;if(!a.isControllingVariants){const l=a.parent?K0(a.parent)||{}:{};return a.props.initial!==void 0&&(l.initial=a.props.initial),l}const i={};for(let l=0;l<rx;l++){const o=Td[l],u=a.props[o];(El(u)||u===!1)&&(i[o]=u)}return i}const cx=[..._d].reverse(),ux=_d.length;function dx(a){return i=>Promise.all(i.map(({animation:l,options:o})=>ox(a,l,o)))}function fx(a){let i=dx(a),l=xg(),o=!0;const u=g=>(v,b)=>{var S;const x=_r(a,b,g==="exit"?(S=a.presenceContext)===null||S===void 0?void 0:S.custom:void 0);if(x){const{transition:E,transitionEnd:k,...q}=x;v={...v,...q,...k}}return v};function h(g){i=g(a)}function f(g){const{props:v}=a,b=K0(a.parent)||{},S=[],x=new Set;let E={},k=1/0;for(let K=0;K<ux;K++){const z=cx[K],P=l[z],Y=v[z]!==void 0?v[z]:b[z],nt=El(Y),X=z===g?P.isActive:null;X===!1&&(k=K);let V=Y===b[z]&&Y!==v[z]&&nt;if(V&&o&&a.manuallyAnimateOnMount&&(V=!1),P.protectedKeys={...E},!P.isActive&&X===null||!Y&&!P.prevProp||br(Y)||typeof Y=="boolean")continue;const et=hx(P.prevProp,Y);let w=et||z===g&&P.isActive&&!V&&nt||K>k&&nt,$=!1;const st=Array.isArray(Y)?Y:[Y];let ht=st.reduce(u(z),{});X===!1&&(ht={});const{prevResolvedValues:zt={}}=P,tt={...zt,...ht},Ut=Q=>{w=!0,x.has(Q)&&($=!0,x.delete(Q)),P.needsAnimating[Q]=!0;const lt=a.getValue(Q);lt&&(lt.liveStyle=!1)};for(const Q in tt){const lt=ht[Q],At=zt[Q];if(E.hasOwnProperty(Q))continue;let mt=!1;Pu(lt)&&Pu(At)?mt=!r0(lt,At):mt=lt!==At,mt?lt!=null?Ut(Q):x.add(Q):lt!==void 0&&x.has(Q)?Ut(Q):P.protectedKeys[Q]=!0}P.prevProp=Y,P.prevResolvedValues=ht,P.isActive&&(E={...E,...ht}),o&&a.blockInitialAnimation&&(w=!1),w&&(!(V&&et)||$)&&S.push(...st.map(Q=>({animation:Q,options:{type:z}})))}if(x.size){const K={};x.forEach(z=>{const P=a.getBaseTarget(z),Y=a.getValue(z);Y&&(Y.liveStyle=!0),K[z]=P??null}),S.push({animation:K})}let q=!!S.length;return o&&(v.initial===!1||v.initial===v.animate)&&!a.manuallyAnimateOnMount&&(q=!1),o=!1,q?i(S):Promise.resolve()}function p(g,v){var b;if(l[g].isActive===v)return Promise.resolve();(b=a.variantChildren)===null||b===void 0||b.forEach(x=>{var E;return(E=x.animationState)===null||E===void 0?void 0:E.setActive(g,v)}),l[g].isActive=v;const S=f(g);for(const x in l)l[x].protectedKeys={};return S}return{animateChanges:f,setActive:p,setAnimateFunction:h,getState:()=>l,reset:()=>{l=xg(),o=!0}}}function hx(a,i){return typeof i=="string"?i!==a:Array.isArray(i)?!r0(i,a):!1}function gs(a=!1){return{isActive:a,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function xg(){return{animate:gs(!0),whileInView:gs(),whileHover:gs(),whileTap:gs(),whileDrag:gs(),whileFocus:gs(),exit:gs()}}class $a{constructor(i){this.isMounted=!1,this.node=i}update(){}}class mx extends $a{constructor(i){super(i),i.animationState||(i.animationState=fx(i))}updateAnimationControlsSubscription(){const{animate:i}=this.node.getProps();br(i)&&(this.unmountControls=i.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:i}=this.node.getProps(),{animate:l}=this.node.prevProps||{};i!==l&&this.updateAnimationControlsSubscription()}unmount(){var i;this.node.animationState.reset(),(i=this.unmountControls)===null||i===void 0||i.call(this)}}let px=0;class gx extends $a{constructor(){super(...arguments),this.id=px++}update(){if(!this.node.presenceContext)return;const{isPresent:i,onExitComplete:l}=this.node.presenceContext,{isPresent:o}=this.node.prevPresenceContext||{};if(!this.node.animationState||i===o)return;const u=this.node.animationState.setActive("exit",!i);l&&!i&&u.then(()=>l(this.id))}mount(){const{register:i}=this.node.presenceContext||{};i&&(this.unmount=i(this.id))}unmount(){}}const vx={animation:{Feature:mx},exit:{Feature:gx}},qn={x:!1,y:!1};function X0(){return qn.x||qn.y}function yx(a){return a==="x"||a==="y"?qn[a]?null:(qn[a]=!0,()=>{qn[a]=!1}):qn.x||qn.y?null:(qn.x=qn.y=!0,()=>{qn.x=qn.y=!1})}const Fd=a=>a.pointerType==="mouse"?typeof a.button!="number"||a.button<=0:a.isPrimary!==!1;function wl(a,i,l,o={passive:!0}){return a.addEventListener(i,l,o),()=>a.removeEventListener(i,l)}function zl(a){return{point:{x:a.pageX,y:a.pageY}}}const bx=a=>i=>Fd(i)&&a(i,zl(i));function jl(a,i,l,o){return wl(a,i,bx(l),o)}const jg=(a,i)=>Math.abs(a-i);function Sx(a,i){const l=jg(a.x,i.x),o=jg(a.y,i.y);return Math.sqrt(l**2+o**2)}class Q0{constructor(i,l,{transformPagePoint:o,contextWindow:u,dragSnapToOrigin:h=!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 S=Lu(this.lastMoveEventInfo,this.history),x=this.startEvent!==null,E=Sx(S.offset,{x:0,y:0})>=3;if(!x&&!E)return;const{point:k}=S,{timestamp:q}=Xe;this.history.push({...k,timestamp:q});const{onStart:K,onMove:z}=this.handlers;x||(K&&K(this.lastMoveEvent,S),this.startEvent=this.lastMoveEvent),z&&z(this.lastMoveEvent,S)},this.handlePointerMove=(S,x)=>{this.lastMoveEvent=S,this.lastMoveEventInfo=Vu(x,this.transformPagePoint),ue.update(this.updatePoint,!0)},this.handlePointerUp=(S,x)=>{this.end();const{onEnd:E,onSessionEnd:k,resumeAnimation:q}=this.handlers;if(this.dragSnapToOrigin&&q&&q(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const K=Lu(S.type==="pointercancel"?this.lastMoveEventInfo:Vu(x,this.transformPagePoint),this.history);this.startEvent&&E&&E(S,K),k&&k(S,K)},!Fd(i))return;this.dragSnapToOrigin=h,this.handlers=l,this.transformPagePoint=o,this.contextWindow=u||window;const f=zl(i),p=Vu(f,this.transformPagePoint),{point:g}=p,{timestamp:v}=Xe;this.history=[{...g,timestamp:v}];const{onSessionStart:b}=l;b&&b(i,Lu(p,this.history)),this.removeListeners=Ol(jl(this.contextWindow,"pointermove",this.handlePointerMove),jl(this.contextWindow,"pointerup",this.handlePointerUp),jl(this.contextWindow,"pointercancel",this.handlePointerUp))}updateHandlers(i){this.handlers=i}end(){this.removeListeners&&this.removeListeners(),Fa(this.updatePoint)}}function Vu(a,i){return i?{point:i(a.point)}:a}function Ag(a,i){return{x:a.x-i.x,y:a.y-i.y}}function Lu({point:a},i){return{point:a,delta:Ag(a,P0(i)),offset:Ag(a,_x(i)),velocity:Tx(i,.1)}}function _x(a){return a[0]}function P0(a){return a[a.length-1]}function Tx(a,i){if(a.length<2)return{x:0,y:0};let l=a.length-1,o=null;const u=P0(a);for(;l>=0&&(o=a[l],!(u.timestamp-o.timestamp>ya(i)));)l--;if(!o)return{x:0,y:0};const h=ba(u.timestamp-o.timestamp);if(h===0)return{x:0,y:0};const f={x:(u.x-o.x)/h,y:(u.y-o.y)/h};return f.x===1/0&&(f.x=0),f.y===1/0&&(f.y=0),f}const F0=1e-4,xx=1-F0,jx=1+F0,J0=.01,Ax=0-J0,Nx=0+J0;function Tn(a){return a.max-a.min}function Ex(a,i,l){return Math.abs(a-i)<=l}function Ng(a,i,l,o=.5){a.origin=o,a.originPoint=ge(i.min,i.max,a.origin),a.scale=Tn(l)/Tn(i),a.translate=ge(l.min,l.max,a.origin)-a.originPoint,(a.scale>=xx&&a.scale<=jx||isNaN(a.scale))&&(a.scale=1),(a.translate>=Ax&&a.translate<=Nx||isNaN(a.translate))&&(a.translate=0)}function Al(a,i,l,o){Ng(a.x,i.x,l.x,o?o.originX:void 0),Ng(a.y,i.y,l.y,o?o.originY:void 0)}function Eg(a,i,l){a.min=l.min+i.min,a.max=a.min+Tn(i)}function Cx(a,i,l){Eg(a.x,i.x,l.x),Eg(a.y,i.y,l.y)}function Cg(a,i,l){a.min=i.min-l.min,a.max=a.min+Tn(i)}function Nl(a,i,l){Cg(a.x,i.x,l.x),Cg(a.y,i.y,l.y)}function Dx(a,{min:i,max:l},o){return i!==void 0&&a<i?a=o?ge(i,a,o.min):Math.max(a,i):l!==void 0&&a>l&&(a=o?ge(l,a,o.max):Math.min(a,l)),a}function Dg(a,i,l){return{min:i!==void 0?a.min+i:void 0,max:l!==void 0?a.max+l-(a.max-a.min):void 0}}function kx(a,{top:i,left:l,bottom:o,right:u}){return{x:Dg(a.x,l,u),y:Dg(a.y,i,o)}}function kg(a,i){let l=i.min-a.min,o=i.max-a.max;return i.max-i.min<a.max-a.min&&([l,o]=[o,l]),{min:l,max:o}}function wx(a,i){return{x:kg(a.x,i.x),y:kg(a.y,i.y)}}function Mx(a,i){let l=.5;const o=Tn(a),u=Tn(i);return u>o?l=vi(i.min,i.max-o,a.min):o>u&&(l=vi(a.min,a.max-u,i.min)),Sa(0,1,l)}function Rx(a,i){const l={};return i.min!==void 0&&(l.min=i.min-a.min),i.max!==void 0&&(l.max=i.max-a.min),l}const ld=.35;function Ox(a=ld){return a===!1?a=0:a===!0&&(a=ld),{x:wg(a,"left","right"),y:wg(a,"top","bottom")}}function wg(a,i,l){return{min:Mg(a,i),max:Mg(a,l)}}function Mg(a,i){return typeof a=="number"?a:a[i]||0}const Rg=()=>({translate:0,scale:1,origin:0,originPoint:0}),hi=()=>({x:Rg(),y:Rg()}),Og=()=>({min:0,max:0}),Ae=()=>({x:Og(),y:Og()});function On(a){return[a("x"),a("y")]}function $0({top:a,left:i,right:l,bottom:o}){return{x:{min:i,max:l},y:{min:a,max:o}}}function zx({x:a,y:i}){return{top:i.min,right:a.max,bottom:i.max,left:a.min}}function Bx(a,i){if(!i)return a;const l=i({x:a.left,y:a.top}),o=i({x:a.right,y:a.bottom});return{top:l.y,left:l.x,bottom:o.y,right:o.x}}function qu(a){return a===void 0||a===1}function od({scale:a,scaleX:i,scaleY:l}){return!qu(a)||!qu(i)||!qu(l)}function bs(a){return od(a)||W0(a)||a.z||a.rotate||a.rotateX||a.rotateY||a.skewX||a.skewY}function W0(a){return zg(a.x)||zg(a.y)}function zg(a){return a&&a!=="0%"}function hr(a,i,l){const o=a-l,u=i*o;return l+u}function Bg(a,i,l,o,u){return u!==void 0&&(a=hr(a,u,o)),hr(a,l,o)+i}function rd(a,i=0,l=1,o,u){a.min=Bg(a.min,i,l,o,u),a.max=Bg(a.max,i,l,o,u)}function ty(a,{x:i,y:l}){rd(a.x,i.translate,i.scale,i.originPoint),rd(a.y,l.translate,l.scale,l.originPoint)}const Ug=.999999999999,Vg=1.0000000000001;function Ux(a,i,l,o=!1){const u=l.length;if(!u)return;i.x=i.y=1;let h,f;for(let p=0;p<u;p++){h=l[p],f=h.projectionDelta;const{visualElement:g}=h.options;g&&g.props.style&&g.props.style.display==="contents"||(o&&h.options.layoutScroll&&h.scroll&&h!==h.root&&pi(a,{x:-h.scroll.offset.x,y:-h.scroll.offset.y}),f&&(i.x*=f.x.scale,i.y*=f.y.scale,ty(a,f)),o&&bs(h.latestValues)&&pi(a,h.latestValues))}i.x<Vg&&i.x>Ug&&(i.x=1),i.y<Vg&&i.y>Ug&&(i.y=1)}function mi(a,i){a.min=a.min+i,a.max=a.max+i}function Lg(a,i,l,o,u=.5){const h=ge(a.min,a.max,u);rd(a,i,l,h,o)}function pi(a,i){Lg(a.x,i.x,i.scaleX,i.scale,i.originX),Lg(a.y,i.y,i.scaleY,i.scale,i.originY)}function ey(a,i){return $0(Bx(a.getBoundingClientRect(),i))}function Vx(a,i,l){const o=ey(a,l),{scroll:u}=i;return u&&(mi(o.x,u.offset.x),mi(o.y,u.offset.y)),o}const ny=({current:a})=>a?a.ownerDocument.defaultView:null,Lx=new WeakMap;class qx{constructor(i){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=Ae(),this.visualElement=i}start(i,{snapToCursor:l=!1}={}){const{presenceContext:o}=this.visualElement;if(o&&o.isPresent===!1)return;const u=b=>{const{dragSnapToOrigin:S}=this.getProps();S?this.pauseAnimation():this.stopAnimation(),l&&this.snapToCursor(zl(b).point)},h=(b,S)=>{const{drag:x,dragPropagation:E,onDragStart:k}=this.getProps();if(x&&!E&&(this.openDragLock&&this.openDragLock(),this.openDragLock=yx(x),!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),On(K=>{let z=this.getAxisMotionValue(K).get()||0;if(Pn.test(z)){const{projection:P}=this.visualElement;if(P&&P.layout){const Y=P.layout.layoutBox[K];Y&&(z=Tn(Y)*(parseFloat(z)/100))}}this.originPoint[K]=z}),k&&ue.postRender(()=>k(b,S)),Fu(this.visualElement,"transform");const{animationState:q}=this.visualElement;q&&q.setActive("whileDrag",!0)},f=(b,S)=>{const{dragPropagation:x,dragDirectionLock:E,onDirectionLock:k,onDrag:q}=this.getProps();if(!x&&!this.openDragLock)return;const{offset:K}=S;if(E&&this.currentDirection===null){this.currentDirection=Hx(K),this.currentDirection!==null&&k&&k(this.currentDirection);return}this.updateAxis("x",S.point,K),this.updateAxis("y",S.point,K),this.visualElement.render(),q&&q(b,S)},p=(b,S)=>this.stop(b,S),g=()=>On(b=>{var S;return this.getAnimationState(b)==="paused"&&((S=this.getAxisMotionValue(b).animation)===null||S===void 0?void 0:S.play())}),{dragSnapToOrigin:v}=this.getProps();this.panSession=new Q0(i,{onSessionStart:u,onStart:h,onMove:f,onSessionEnd:p,resumeAnimation:g},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:v,contextWindow:ny(this.visualElement)})}stop(i,l){const o=this.isDragging;if(this.cancel(),!o)return;const{velocity:u}=l;this.startAnimation(u);const{onDragEnd:h}=this.getProps();h&&ue.postRender(()=>h(i,l))}cancel(){this.isDragging=!1;const{projection:i,animationState:l}=this.visualElement;i&&(i.isAnimationBlocked=!1),this.panSession&&this.panSession.end(),this.panSession=void 0;const{dragPropagation:o}=this.getProps();!o&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),l&&l.setActive("whileDrag",!1)}updateAxis(i,l,o){const{drag:u}=this.getProps();if(!o||!tr(i,u,this.currentDirection))return;const h=this.getAxisMotionValue(i);let f=this.originPoint[i]+o[i];this.constraints&&this.constraints[i]&&(f=Dx(f,this.constraints[i],this.elastic[i])),h.set(f)}resolveConstraints(){var i;const{dragConstraints:l,dragElastic:o}=this.getProps(),u=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):(i=this.visualElement.projection)===null||i===void 0?void 0:i.layout,h=this.constraints;l&&di(l)?this.constraints||(this.constraints=this.resolveRefConstraints()):l&&u?this.constraints=kx(u.layoutBox,l):this.constraints=!1,this.elastic=Ox(o),h!==this.constraints&&u&&this.constraints&&!this.hasMutatedConstraints&&On(f=>{this.constraints!==!1&&this.getAxisMotionValue(f)&&(this.constraints[f]=Rx(u.layoutBox[f],this.constraints[f]))})}resolveRefConstraints(){const{dragConstraints:i,onMeasureDragConstraints:l}=this.getProps();if(!i||!di(i))return!1;const o=i.current,{projection:u}=this.visualElement;if(!u||!u.layout)return!1;const h=Vx(o,u.root,this.visualElement.getTransformPagePoint());let f=wx(u.layout.layoutBox,h);if(l){const p=l(zx(f));this.hasMutatedConstraints=!!p,p&&(f=$0(p))}return f}startAnimation(i){const{drag:l,dragMomentum:o,dragElastic:u,dragTransition:h,dragSnapToOrigin:f,onDragTransitionEnd:p}=this.getProps(),g=this.constraints||{},v=On(b=>{if(!tr(b,l,this.currentDirection))return;let S=g&&g[b]||{};f&&(S={min:0,max:0});const x=u?200:1e6,E=u?40:1e7,k={type:"inertia",velocity:o?i[b]:0,bounceStiffness:x,bounceDamping:E,timeConstant:750,restDelta:1,restSpeed:10,...h,...S};return this.startAxisValueAnimation(b,k)});return Promise.all(v).then(p)}startAxisValueAnimation(i,l){const o=this.getAxisMotionValue(i);return Fu(this.visualElement,i),o.start(Pd(i,o,0,l,this.visualElement,!1))}stopAnimation(){On(i=>this.getAxisMotionValue(i).stop())}pauseAnimation(){On(i=>{var l;return(l=this.getAxisMotionValue(i).animation)===null||l===void 0?void 0:l.pause()})}getAnimationState(i){var l;return(l=this.getAxisMotionValue(i).animation)===null||l===void 0?void 0:l.state}getAxisMotionValue(i){const l=`_drag${i.toUpperCase()}`,o=this.visualElement.getProps(),u=o[l];return u||this.visualElement.getValue(i,(o.initial?o.initial[i]:void 0)||0)}snapToCursor(i){On(l=>{const{drag:o}=this.getProps();if(!tr(l,o,this.currentDirection))return;const{projection:u}=this.visualElement,h=this.getAxisMotionValue(l);if(u&&u.layout){const{min:f,max:p}=u.layout.layoutBox[l];h.set(i[l]-ge(f,p,.5))}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:i,dragConstraints:l}=this.getProps(),{projection:o}=this.visualElement;if(!di(l)||!o||!this.constraints)return;this.stopAnimation();const u={x:0,y:0};On(f=>{const p=this.getAxisMotionValue(f);if(p&&this.constraints!==!1){const g=p.get();u[f]=Mx({min:g,max:g},this.constraints[f])}});const{transformTemplate:h}=this.visualElement.getProps();this.visualElement.current.style.transform=h?h({},""):"none",o.root&&o.root.updateScroll(),o.updateLayout(),this.resolveConstraints(),On(f=>{if(!tr(f,i,null))return;const p=this.getAxisMotionValue(f),{min:g,max:v}=this.constraints[f];p.set(ge(g,v,u[f]))})}addListeners(){if(!this.visualElement.current)return;Lx.set(this.visualElement,this);const i=this.visualElement.current,l=jl(i,"pointerdown",g=>{const{drag:v,dragListener:b=!0}=this.getProps();v&&b&&this.start(g)}),o=()=>{const{dragConstraints:g}=this.getProps();di(g)&&g.current&&(this.constraints=this.resolveRefConstraints())},{projection:u}=this.visualElement,h=u.addEventListener("measure",o);u&&!u.layout&&(u.root&&u.root.updateScroll(),u.updateLayout()),ue.read(o);const f=wl(window,"resize",()=>this.scalePositionWithinConstraints()),p=u.addEventListener("didUpdate",(({delta:g,hasLayoutChanged:v})=>{this.isDragging&&v&&(On(b=>{const S=this.getAxisMotionValue(b);S&&(this.originPoint[b]+=g[b].translate,S.set(S.get()+g[b].translate))}),this.visualElement.render())}));return()=>{f(),l(),h(),p&&p()}}getProps(){const i=this.visualElement.getProps(),{drag:l=!1,dragDirectionLock:o=!1,dragPropagation:u=!1,dragConstraints:h=!1,dragElastic:f=ld,dragMomentum:p=!0}=i;return{...i,drag:l,dragDirectionLock:o,dragPropagation:u,dragConstraints:h,dragElastic:f,dragMomentum:p}}}function tr(a,i,l){return(i===!0||i===a)&&(l===null||l===a)}function Hx(a,i=10){let l=null;return Math.abs(a.y)>i?l="y":Math.abs(a.x)>i&&(l="x"),l}class Gx extends $a{constructor(i){super(i),this.removeGroupControls=_n,this.removeListeners=_n,this.controls=new qx(i)}mount(){const{dragControls:i}=this.node.getProps();i&&(this.removeGroupControls=i.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||_n}unmount(){this.removeGroupControls(),this.removeListeners()}}const qg=a=>(i,l)=>{a&&ue.postRender(()=>a(i,l))};class Ix extends $a{constructor(){super(...arguments),this.removePointerDownListener=_n}onPointerDown(i){this.session=new Q0(i,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:ny(this.node)})}createPanHandlers(){const{onPanSessionStart:i,onPanStart:l,onPan:o,onPanEnd:u}=this.node.getProps();return{onSessionStart:qg(i),onStart:qg(l),onMove:o,onEnd:(h,f)=>{delete this.session,u&&ue.postRender(()=>u(h,f))}}}mount(){this.removePointerDownListener=jl(this.node.current,"pointerdown",i=>this.onPointerDown(i))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}const lr={hasAnimatedSinceResize:!0,hasEverUpdated:!1};function Hg(a,i){return i.max===i.min?0:a/(i.max-i.min)*100}const gl={correct:(a,i)=>{if(!i.target)return a;if(typeof a=="string")if(vt.test(a))a=parseFloat(a);else return a;const l=Hg(a,i.target.x),o=Hg(a,i.target.y);return`${l}% ${o}%`}},Yx={correct:(a,{treeScale:i,projectionDelta:l})=>{const o=a,u=Ja.parse(a);if(u.length>5)return o;const h=Ja.createTransformer(a),f=typeof u[0]!="number"?1:0,p=l.x.scale*i.x,g=l.y.scale*i.y;u[0+f]/=p,u[1+f]/=g;const v=ge(p,g,.5);return typeof u[2+f]=="number"&&(u[2+f]/=v),typeof u[3+f]=="number"&&(u[3+f]/=v),h(u)}};class Zx extends _.Component{componentDidMount(){const{visualElement:i,layoutGroup:l,switchLayoutGroup:o,layoutId:u}=this.props,{projection:h}=i;v_(Kx),h&&(l.group&&l.group.add(h),o&&o.register&&u&&o.register(h),h.root.didUpdate(),h.addEventListener("animationComplete",()=>{this.safeToRemove()}),h.setOptions({...h.options,onExitComplete:()=>this.safeToRemove()})),lr.hasEverUpdated=!0}getSnapshotBeforeUpdate(i){const{layoutDependency:l,visualElement:o,drag:u,isPresent:h}=this.props,f=o.projection;return f&&(f.isPresent=h,u||i.layoutDependency!==l||l===void 0?f.willUpdate():this.safeToRemove(),i.isPresent!==h&&(h?f.promote():f.relegate()||ue.postRender(()=>{const p=f.getStack();(!p||!p.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{projection:i}=this.props.visualElement;i&&(i.root.didUpdate(),jd.postRender(()=>{!i.currentAnimation&&i.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:i,layoutGroup:l,switchLayoutGroup:o}=this.props,{projection:u}=i;u&&(u.scheduleCheckAfterUnmount(),l&&l.group&&l.group.remove(u),o&&o.deregister&&o.deregister(u))}safeToRemove(){const{safeToRemove:i}=this.props;i&&i()}render(){return null}}function ay(a){const[i,l]=Hv(),o=_.useContext(vd);return d.jsx(Zx,{...a,layoutGroup:o,switchLayoutGroup:_.useContext(Pv),isPresent:i,safeToRemove:l})}const Kx={borderRadius:{...gl,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:gl,borderTopRightRadius:gl,borderBottomLeftRadius:gl,borderBottomRightRadius:gl,boxShadow:Yx};function Xx(a,i,l){const o=Pe(a)?a:Dl(a);return o.start(Pd("",o,i,l)),o.animation}function Qx(a){return a instanceof SVGElement&&a.tagName!=="svg"}const Px=(a,i)=>a.depth-i.depth;class Fx{constructor(){this.children=[],this.isDirty=!1}add(i){zd(this.children,i),this.isDirty=!0}remove(i){Bd(this.children,i),this.isDirty=!0}forEach(i){this.isDirty&&this.children.sort(Px),this.isDirty=!1,this.children.forEach(i)}}function Jx(a,i){const l=Fn.now(),o=({timestamp:u})=>{const h=u-l;h>=i&&(Fa(o),a(h-i))};return ue.read(o,!0),()=>Fa(o)}const sy=["TopLeft","TopRight","BottomLeft","BottomRight"],$x=sy.length,Gg=a=>typeof a=="string"?parseFloat(a):a,Ig=a=>typeof a=="number"||vt.test(a);function Wx(a,i,l,o,u,h){u?(a.opacity=ge(0,l.opacity!==void 0?l.opacity:1,t2(o)),a.opacityExit=ge(i.opacity!==void 0?i.opacity:1,0,e2(o))):h&&(a.opacity=ge(i.opacity!==void 0?i.opacity:1,l.opacity!==void 0?l.opacity:1,o));for(let f=0;f<$x;f++){const p=`border${sy[f]}Radius`;let g=Yg(i,p),v=Yg(l,p);if(g===void 0&&v===void 0)continue;g||(g=0),v||(v=0),g===0||v===0||Ig(g)===Ig(v)?(a[p]=Math.max(ge(Gg(g),Gg(v),o),0),(Pn.test(v)||Pn.test(g))&&(a[p]+="%")):a[p]=v}(i.rotate||l.rotate)&&(a.rotate=ge(i.rotate||0,l.rotate||0,o))}function Yg(a,i){return a[i]!==void 0?a[i]:a.borderRadius}const t2=iy(0,.5,_0),e2=iy(.5,.95,_n);function iy(a,i,l){return o=>o<a?0:o>i?1:l(vi(a,i,o))}function Zg(a,i){a.min=i.min,a.max=i.max}function Rn(a,i){Zg(a.x,i.x),Zg(a.y,i.y)}function Kg(a,i){a.translate=i.translate,a.scale=i.scale,a.originPoint=i.originPoint,a.origin=i.origin}function Xg(a,i,l,o,u){return a-=i,a=hr(a,1/l,o),u!==void 0&&(a=hr(a,1/u,o)),a}function n2(a,i=0,l=1,o=.5,u,h=a,f=a){if(Pn.test(i)&&(i=parseFloat(i),i=ge(f.min,f.max,i/100)-f.min),typeof i!="number")return;let p=ge(h.min,h.max,o);a===h&&(p-=i),a.min=Xg(a.min,i,l,p,u),a.max=Xg(a.max,i,l,p,u)}function Qg(a,i,[l,o,u],h,f){n2(a,i[l],i[o],i[u],i.scale,h,f)}const a2=["x","scaleX","originX"],s2=["y","scaleY","originY"];function Pg(a,i,l,o){Qg(a.x,i,a2,l?l.x:void 0,o?o.x:void 0),Qg(a.y,i,s2,l?l.y:void 0,o?o.y:void 0)}function Fg(a){return a.translate===0&&a.scale===1}function ly(a){return Fg(a.x)&&Fg(a.y)}function Jg(a,i){return a.min===i.min&&a.max===i.max}function i2(a,i){return Jg(a.x,i.x)&&Jg(a.y,i.y)}function $g(a,i){return Math.round(a.min)===Math.round(i.min)&&Math.round(a.max)===Math.round(i.max)}function oy(a,i){return $g(a.x,i.x)&&$g(a.y,i.y)}function Wg(a){return Tn(a.x)/Tn(a.y)}function tv(a,i){return a.translate===i.translate&&a.scale===i.scale&&a.originPoint===i.originPoint}class l2{constructor(){this.members=[]}add(i){zd(this.members,i),i.scheduleRender()}remove(i){if(Bd(this.members,i),i===this.prevLead&&(this.prevLead=void 0),i===this.lead){const l=this.members[this.members.length-1];l&&this.promote(l)}}relegate(i){const l=this.members.findIndex(u=>i===u);if(l===0)return!1;let o;for(let u=l;u>=0;u--){const h=this.members[u];if(h.isPresent!==!1){o=h;break}}return o?(this.promote(o),!0):!1}promote(i,l){const o=this.lead;if(i!==o&&(this.prevLead=o,this.lead=i,i.show(),o)){o.instance&&o.scheduleRender(),i.scheduleRender(),i.resumeFrom=o,l&&(i.resumeFrom.preserveOpacity=!0),o.snapshot&&(i.snapshot=o.snapshot,i.snapshot.latestValues=o.animationValues||o.latestValues),i.root&&i.root.isUpdating&&(i.isLayoutDirty=!0);const{crossfade:u}=i.options;u===!1&&o.hide()}}exitAnimationComplete(){this.members.forEach(i=>{const{options:l,resumingFrom:o}=i;l.onExitComplete&&l.onExitComplete(),o&&o.options.onExitComplete&&o.options.onExitComplete()})}scheduleRender(){this.members.forEach(i=>{i.instance&&i.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}function o2(a,i,l){let o="";const u=a.x.translate/i.x,h=a.y.translate/i.y,f=(l==null?void 0:l.z)||0;if((u||h||f)&&(o=`translate3d(${u}px, ${h}px, ${f}px) `),(i.x!==1||i.y!==1)&&(o+=`scale(${1/i.x}, ${1/i.y}) `),l){const{transformPerspective:v,rotate:b,rotateX:S,rotateY:x,skewX:E,skewY:k}=l;v&&(o=`perspective(${v}px) ${o}`),b&&(o+=`rotate(${b}deg) `),S&&(o+=`rotateX(${S}deg) `),x&&(o+=`rotateY(${x}deg) `),E&&(o+=`skewX(${E}deg) `),k&&(o+=`skewY(${k}deg) `)}const p=a.x.scale*i.x,g=a.y.scale*i.y;return(p!==1||g!==1)&&(o+=`scale(${p}, ${g})`),o||"none"}const Ss={type:"projectionFrame",totalNodes:0,resolvedTargetDeltas:0,recalculatedProjection:0},Sl=typeof window<"u"&&window.MotionDebug!==void 0,Hu=["","X","Y","Z"],r2={visibility:"hidden"},ev=1e3;let c2=0;function Gu(a,i,l,o){const{latestValues:u}=i;u[a]&&(l[a]=u[a],i.setStaticValue(a,0),o&&(o[a]=0))}function ry(a){if(a.hasCheckedOptimisedAppear=!0,a.root===a)return;const{visualElement:i}=a.options;if(!i)return;const l=d0(i);if(window.MotionHasOptimisedAnimation(l,"transform")){const{layout:u,layoutId:h}=a.options;window.MotionCancelOptimisedAnimation(l,"transform",ue,!(u||h))}const{parent:o}=a;o&&!o.hasCheckedOptimisedAppear&&ry(o)}function cy({attachResizeListener:a,defaultParent:i,measureScroll:l,checkIsScrollRoot:o,resetTransform:u}){return class{constructor(f={},p=i==null?void 0:i()){this.id=c2++,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,Sl&&(Ss.totalNodes=Ss.resolvedTargetDeltas=Ss.recalculatedProjection=0),this.nodes.forEach(f2),this.nodes.forEach(v2),this.nodes.forEach(y2),this.nodes.forEach(h2),Sl&&window.MotionDebug.record(Ss)},this.resolvedRelativeTargetAt=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=f,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 g=0;g<this.path.length;g++)this.path[g].shouldResetTransform=!0;this.root===this&&(this.nodes=new Fx)}addEventListener(f,p){return this.eventHandlers.has(f)||this.eventHandlers.set(f,new Ud),this.eventHandlers.get(f).add(p)}notifyListeners(f,...p){const g=this.eventHandlers.get(f);g&&g.notify(...p)}hasListeners(f){return this.eventHandlers.has(f)}mount(f,p=this.root.hasTreeAnimated){if(this.instance)return;this.isSVG=Qx(f),this.instance=f;const{layoutId:g,layout:v,visualElement:b}=this.options;if(b&&!b.current&&b.mount(f),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),p&&(v||g)&&(this.isLayoutDirty=!0),a){let S;const x=()=>this.root.updateBlockedByResize=!1;a(f,()=>{this.root.updateBlockedByResize=!0,S&&S(),S=Jx(x,250),lr.hasAnimatedSinceResize&&(lr.hasAnimatedSinceResize=!1,this.nodes.forEach(av))})}g&&this.root.registerSharedNode(g,this),this.options.animate!==!1&&b&&(g||v)&&this.addEventListener("didUpdate",({delta:S,hasLayoutChanged:x,hasRelativeTargetChanged:E,layout:k})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const q=this.options.transition||b.getDefaultTransition()||x2,{onLayoutAnimationStart:K,onLayoutAnimationComplete:z}=b.getProps(),P=!this.targetLayout||!oy(this.targetLayout,k)||E,Y=!x&&E;if(this.options.layoutRoot||this.resumeFrom&&this.resumeFrom.instance||Y||x&&(P||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0),this.setAnimationOrigin(S,Y);const nt={...Od(q,"layout"),onPlay:K,onComplete:z};(b.shouldReduceMotion||this.options.layoutRoot)&&(nt.delay=0,nt.type=!1),this.startAnimation(nt)}else x||av(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=k})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const f=this.getStack();f&&f.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,Fa(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(b2),this.animationId++)}getTransformTemplate(){const{visualElement:f}=this.options;return f&&f.getProps().transformTemplate}willUpdate(f=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&ry(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let b=0;b<this.path.length;b++){const S=this.path[b];S.shouldResetTransform=!0,S.updateScroll("snapshot"),S.options.layoutRoot&&S.willUpdate(!1)}const{layoutId:p,layout:g}=this.options;if(p===void 0&&!g)return;const v=this.getTransformTemplate();this.prevTransformTemplateValue=v?v(this.latestValues,""):void 0,this.updateSnapshot(),f&&this.notifyListeners("willUpdate")}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){this.unblockUpdate(),this.clearAllSnapshots(),this.nodes.forEach(nv);return}this.isUpdating||this.nodes.forEach(p2),this.isUpdating=!1,this.nodes.forEach(g2),this.nodes.forEach(u2),this.nodes.forEach(d2),this.clearAllSnapshots();const p=Fn.now();Xe.delta=Sa(0,1e3/60,p-Xe.timestamp),Xe.timestamp=p,Xe.isProcessing=!0,Ru.update.process(Xe),Ru.preRender.process(Xe),Ru.render.process(Xe),Xe.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,jd.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(m2),this.sharedNodes.forEach(S2)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,ue.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){ue.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 g=0;g<this.path.length;g++)this.path[g].updateScroll();const f=this.layout;this.layout=this.measure(!1),this.layoutCorrected=Ae(),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,f?f.layoutBox:void 0)}updateScroll(f="measure"){let p=!!(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===f&&(p=!1),p){const g=o(this.instance);this.scroll={animationId:this.root.animationId,phase:f,isRoot:g,offset:l(this.instance),wasRoot:this.scroll?this.scroll.isRoot:g}}}resetTransform(){if(!u)return;const f=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,p=this.projectionDelta&&!ly(this.projectionDelta),g=this.getTransformTemplate(),v=g?g(this.latestValues,""):void 0,b=v!==this.prevTransformTemplateValue;f&&(p||bs(this.latestValues)||b)&&(u(this.instance,v),this.shouldResetTransform=!1,this.scheduleRender())}measure(f=!0){const p=this.measurePageBox();let g=this.removeElementScroll(p);return f&&(g=this.removeTransform(g)),j2(g),{animationId:this.root.animationId,measuredBox:p,layoutBox:g,latestValues:{},source:this.id}}measurePageBox(){var f;const{visualElement:p}=this.options;if(!p)return Ae();const g=p.measureViewportBox();if(!(((f=this.scroll)===null||f===void 0?void 0:f.wasRoot)||this.path.some(A2))){const{scroll:b}=this.root;b&&(mi(g.x,b.offset.x),mi(g.y,b.offset.y))}return g}removeElementScroll(f){var p;const g=Ae();if(Rn(g,f),!((p=this.scroll)===null||p===void 0)&&p.wasRoot)return g;for(let v=0;v<this.path.length;v++){const b=this.path[v],{scroll:S,options:x}=b;b!==this.root&&S&&x.layoutScroll&&(S.wasRoot&&Rn(g,f),mi(g.x,S.offset.x),mi(g.y,S.offset.y))}return g}applyTransform(f,p=!1){const g=Ae();Rn(g,f);for(let v=0;v<this.path.length;v++){const b=this.path[v];!p&&b.options.layoutScroll&&b.scroll&&b!==b.root&&pi(g,{x:-b.scroll.offset.x,y:-b.scroll.offset.y}),bs(b.latestValues)&&pi(g,b.latestValues)}return bs(this.latestValues)&&pi(g,this.latestValues),g}removeTransform(f){const p=Ae();Rn(p,f);for(let g=0;g<this.path.length;g++){const v=this.path[g];if(!v.instance||!bs(v.latestValues))continue;od(v.latestValues)&&v.updateSnapshot();const b=Ae(),S=v.measurePageBox();Rn(b,S),Pg(p,v.latestValues,v.snapshot?v.snapshot.layoutBox:void 0,b)}return bs(this.latestValues)&&Pg(p,this.latestValues),p}setTargetDelta(f){this.targetDelta=f,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(f){this.options={...this.options,...f,crossfade:f.crossfade!==void 0?f.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!==Xe.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(f=!1){var p;const g=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=g.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=g.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=g.isSharedProjectionDirty);const v=!!this.resumingFrom||this!==g;if(!(f||v&&this.isSharedProjectionDirty||this.isProjectionDirty||!((p=this.parent)===null||p===void 0)&&p.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;const{layout:S,layoutId:x}=this.options;if(!(!this.layout||!(S||x))){if(this.resolvedRelativeTargetAt=Xe.timestamp,!this.targetDelta&&!this.relativeTarget){const E=this.getClosestProjectingParent();E&&E.layout&&this.animationProgress!==1?(this.relativeParent=E,this.forceRelativeParentToResolveTarget(),this.relativeTarget=Ae(),this.relativeTargetOrigin=Ae(),Nl(this.relativeTargetOrigin,this.layout.layoutBox,E.layout.layoutBox),Rn(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}if(!(!this.relativeTarget&&!this.targetDelta)){if(this.target||(this.target=Ae(),this.targetWithTransforms=Ae()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),Cx(this.target,this.relativeTarget,this.relativeParent.target)):this.targetDelta?(this.resumingFrom?this.target=this.applyTransform(this.layout.layoutBox):Rn(this.target,this.layout.layoutBox),ty(this.target,this.targetDelta)):Rn(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget){this.attemptToResolveRelativeTarget=!1;const E=this.getClosestProjectingParent();E&&!!E.resumingFrom==!!this.resumingFrom&&!E.options.layoutScroll&&E.target&&this.animationProgress!==1?(this.relativeParent=E,this.forceRelativeParentToResolveTarget(),this.relativeTarget=Ae(),this.relativeTargetOrigin=Ae(),Nl(this.relativeTargetOrigin,this.target,E.target),Rn(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}Sl&&Ss.resolvedTargetDeltas++}}}getClosestProjectingParent(){if(!(!this.parent||od(this.parent.latestValues)||W0(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 f;const p=this.getLead(),g=!!this.resumingFrom||this!==p;let v=!0;if((this.isProjectionDirty||!((f=this.parent)===null||f===void 0)&&f.isProjectionDirty)&&(v=!1),g&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(v=!1),this.resolvedRelativeTargetAt===Xe.timestamp&&(v=!1),v)return;const{layout:b,layoutId:S}=this.options;if(this.isTreeAnimating=!!(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(b||S))return;Rn(this.layoutCorrected,this.layout.layoutBox);const x=this.treeScale.x,E=this.treeScale.y;Ux(this.layoutCorrected,this.treeScale,this.path,g),p.layout&&!p.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(p.target=p.layout.layoutBox,p.targetWithTransforms=Ae());const{target:k}=p;if(!k){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(Kg(this.prevProjectionDelta.x,this.projectionDelta.x),Kg(this.prevProjectionDelta.y,this.projectionDelta.y)),Al(this.projectionDelta,this.layoutCorrected,k,this.latestValues),(this.treeScale.x!==x||this.treeScale.y!==E||!tv(this.projectionDelta.x,this.prevProjectionDelta.x)||!tv(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",k)),Sl&&Ss.recalculatedProjection++}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(f=!0){var p;if((p=this.options.visualElement)===null||p===void 0||p.scheduleRender(),f){const g=this.getStack();g&&g.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=hi(),this.projectionDelta=hi(),this.projectionDeltaWithTransform=hi()}setAnimationOrigin(f,p=!1){const g=this.snapshot,v=g?g.latestValues:{},b={...this.latestValues},S=hi();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!p;const x=Ae(),E=g?g.source:void 0,k=this.layout?this.layout.source:void 0,q=E!==k,K=this.getStack(),z=!K||K.members.length<=1,P=!!(q&&!z&&this.options.crossfade===!0&&!this.path.some(T2));this.animationProgress=0;let Y;this.mixTargetDelta=nt=>{const X=nt/1e3;sv(S.x,f.x,X),sv(S.y,f.y,X),this.setTargetDelta(S),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(Nl(x,this.layout.layoutBox,this.relativeParent.layout.layoutBox),_2(this.relativeTarget,this.relativeTargetOrigin,x,X),Y&&i2(this.relativeTarget,Y)&&(this.isProjectionDirty=!1),Y||(Y=Ae()),Rn(Y,this.relativeTarget)),q&&(this.animationValues=b,Wx(b,v,this.latestValues,X,P,z)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=X},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(f){this.notifyListeners("animationStart"),this.currentAnimation&&this.currentAnimation.stop(),this.resumingFrom&&this.resumingFrom.currentAnimation&&this.resumingFrom.currentAnimation.stop(),this.pendingAnimation&&(Fa(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=ue.update(()=>{lr.hasAnimatedSinceResize=!0,this.currentAnimation=Xx(0,ev,{...f,onUpdate:p=>{this.mixTargetDelta(p),f.onUpdate&&f.onUpdate(p)},onComplete:()=>{f.onComplete&&f.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 f=this.getStack();f&&f.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(ev),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const f=this.getLead();let{targetWithTransforms:p,target:g,layout:v,latestValues:b}=f;if(!(!p||!g||!v)){if(this!==f&&this.layout&&v&&uy(this.options.animationType,this.layout.layoutBox,v.layoutBox)){g=this.target||Ae();const S=Tn(this.layout.layoutBox.x);g.x.min=f.target.x.min,g.x.max=g.x.min+S;const x=Tn(this.layout.layoutBox.y);g.y.min=f.target.y.min,g.y.max=g.y.min+x}Rn(p,g),pi(p,b),Al(this.projectionDeltaWithTransform,this.layoutCorrected,p,b)}}registerSharedNode(f,p){this.sharedNodes.has(f)||this.sharedNodes.set(f,new l2),this.sharedNodes.get(f).add(p);const v=p.options.initialPromotionConfig;p.promote({transition:v?v.transition:void 0,preserveFollowOpacity:v&&v.shouldPreserveFollowOpacity?v.shouldPreserveFollowOpacity(p):void 0})}isLead(){const f=this.getStack();return f?f.lead===this:!0}getLead(){var f;const{layoutId:p}=this.options;return p?((f=this.getStack())===null||f===void 0?void 0:f.lead)||this:this}getPrevLead(){var f;const{layoutId:p}=this.options;return p?(f=this.getStack())===null||f===void 0?void 0:f.prevLead:void 0}getStack(){const{layoutId:f}=this.options;if(f)return this.root.sharedNodes.get(f)}promote({needsReset:f,transition:p,preserveFollowOpacity:g}={}){const v=this.getStack();v&&v.promote(this,g),f&&(this.projectionDelta=void 0,this.needsReset=!0),p&&this.setOptions({transition:p})}relegate(){const f=this.getStack();return f?f.relegate(this):!1}resetSkewAndRotation(){const{visualElement:f}=this.options;if(!f)return;let p=!1;const{latestValues:g}=f;if((g.z||g.rotate||g.rotateX||g.rotateY||g.rotateZ||g.skewX||g.skewY)&&(p=!0),!p)return;const v={};g.z&&Gu("z",f,v,this.animationValues);for(let b=0;b<Hu.length;b++)Gu(`rotate${Hu[b]}`,f,v,this.animationValues),Gu(`skew${Hu[b]}`,f,v,this.animationValues);f.render();for(const b in v)f.setStaticValue(b,v[b]),this.animationValues&&(this.animationValues[b]=v[b]);f.scheduleRender()}getProjectionStyles(f){var p,g;if(!this.instance||this.isSVG)return;if(!this.isVisible)return r2;const v={visibility:""},b=this.getTransformTemplate();if(this.needsReset)return this.needsReset=!1,v.opacity="",v.pointerEvents=sr(f==null?void 0:f.pointerEvents)||"",v.transform=b?b(this.latestValues,""):"none",v;const S=this.getLead();if(!this.projectionDelta||!this.layout||!S.target){const q={};return this.options.layoutId&&(q.opacity=this.latestValues.opacity!==void 0?this.latestValues.opacity:1,q.pointerEvents=sr(f==null?void 0:f.pointerEvents)||""),this.hasProjected&&!bs(this.latestValues)&&(q.transform=b?b({},""):"none",this.hasProjected=!1),q}const x=S.animationValues||S.latestValues;this.applyTransformsToTarget(),v.transform=o2(this.projectionDeltaWithTransform,this.treeScale,x),b&&(v.transform=b(x,v.transform));const{x:E,y:k}=this.projectionDelta;v.transformOrigin=`${E.origin*100}% ${k.origin*100}% 0`,S.animationValues?v.opacity=S===this?(g=(p=x.opacity)!==null&&p!==void 0?p:this.latestValues.opacity)!==null&&g!==void 0?g:1:this.preserveOpacity?this.latestValues.opacity:x.opacityExit:v.opacity=S===this?x.opacity!==void 0?x.opacity:"":x.opacityExit!==void 0?x.opacityExit:0;for(const q in rr){if(x[q]===void 0)continue;const{correct:K,applyTo:z}=rr[q],P=v.transform==="none"?x[q]:K(x[q],S);if(z){const Y=z.length;for(let nt=0;nt<Y;nt++)v[z[nt]]=P}else v[q]=P}return this.options.layoutId&&(v.pointerEvents=S===this?sr(f==null?void 0:f.pointerEvents)||"":"none"),v}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(f=>{var p;return(p=f.currentAnimation)===null||p===void 0?void 0:p.stop()}),this.root.nodes.forEach(nv),this.root.sharedNodes.clear()}}}function u2(a){a.updateLayout()}function d2(a){var i;const l=((i=a.resumeFrom)===null||i===void 0?void 0:i.snapshot)||a.snapshot;if(a.isLead()&&a.layout&&l&&a.hasListeners("didUpdate")){const{layoutBox:o,measuredBox:u}=a.layout,{animationType:h}=a.options,f=l.source!==a.layout.source;h==="size"?On(S=>{const x=f?l.measuredBox[S]:l.layoutBox[S],E=Tn(x);x.min=o[S].min,x.max=x.min+E}):uy(h,l.layoutBox,o)&&On(S=>{const x=f?l.measuredBox[S]:l.layoutBox[S],E=Tn(o[S]);x.max=x.min+E,a.relativeTarget&&!a.currentAnimation&&(a.isProjectionDirty=!0,a.relativeTarget[S].max=a.relativeTarget[S].min+E)});const p=hi();Al(p,o,l.layoutBox);const g=hi();f?Al(g,a.applyTransform(u,!0),l.measuredBox):Al(g,o,l.layoutBox);const v=!ly(p);let b=!1;if(!a.resumeFrom){const S=a.getClosestProjectingParent();if(S&&!S.resumeFrom){const{snapshot:x,layout:E}=S;if(x&&E){const k=Ae();Nl(k,l.layoutBox,x.layoutBox);const q=Ae();Nl(q,o,E.layoutBox),oy(k,q)||(b=!0),S.options.layoutRoot&&(a.relativeTarget=q,a.relativeTargetOrigin=k,a.relativeParent=S)}}}a.notifyListeners("didUpdate",{layout:o,snapshot:l,delta:g,layoutDelta:p,hasLayoutChanged:v,hasRelativeTargetChanged:b})}else if(a.isLead()){const{onExitComplete:o}=a.options;o&&o()}a.options.transition=void 0}function f2(a){Sl&&Ss.totalNodes++,a.parent&&(a.isProjecting()||(a.isProjectionDirty=a.parent.isProjectionDirty),a.isSharedProjectionDirty||(a.isSharedProjectionDirty=!!(a.isProjectionDirty||a.parent.isProjectionDirty||a.parent.isSharedProjectionDirty)),a.isTransformDirty||(a.isTransformDirty=a.parent.isTransformDirty))}function h2(a){a.isProjectionDirty=a.isSharedProjectionDirty=a.isTransformDirty=!1}function m2(a){a.clearSnapshot()}function nv(a){a.clearMeasurements()}function p2(a){a.isLayoutDirty=!1}function g2(a){const{visualElement:i}=a.options;i&&i.getProps().onBeforeLayoutMeasure&&i.notify("BeforeLayoutMeasure"),a.resetTransform()}function av(a){a.finishAnimation(),a.targetDelta=a.relativeTarget=a.target=void 0,a.isProjectionDirty=!0}function v2(a){a.resolveTargetDelta()}function y2(a){a.calcProjection()}function b2(a){a.resetSkewAndRotation()}function S2(a){a.removeLeadSnapshot()}function sv(a,i,l){a.translate=ge(i.translate,0,l),a.scale=ge(i.scale,1,l),a.origin=i.origin,a.originPoint=i.originPoint}function iv(a,i,l,o){a.min=ge(i.min,l.min,o),a.max=ge(i.max,l.max,o)}function _2(a,i,l,o){iv(a.x,i.x,l.x,o),iv(a.y,i.y,l.y,o)}function T2(a){return a.animationValues&&a.animationValues.opacityExit!==void 0}const x2={duration:.45,ease:[.4,0,.1,1]},lv=a=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(a),ov=lv("applewebkit/")&&!lv("chrome/")?Math.round:_n;function rv(a){a.min=ov(a.min),a.max=ov(a.max)}function j2(a){rv(a.x),rv(a.y)}function uy(a,i,l){return a==="position"||a==="preserve-aspect"&&!Ex(Wg(i),Wg(l),.2)}function A2(a){var i;return a!==a.root&&((i=a.scroll)===null||i===void 0?void 0:i.wasRoot)}const N2=cy({attachResizeListener:(a,i)=>wl(a,"resize",i),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),Iu={current:void 0},dy=cy({measureScroll:a=>({x:a.scrollLeft,y:a.scrollTop}),defaultParent:()=>{if(!Iu.current){const a=new N2({});a.mount(window),a.setOptions({layoutScroll:!0}),Iu.current=a}return Iu.current},resetTransform:(a,i)=>{a.style.transform=i!==void 0?i:"none"},checkIsScrollRoot:a=>window.getComputedStyle(a).position==="fixed"}),E2={pan:{Feature:Ix},drag:{Feature:Gx,ProjectionNode:dy,MeasureLayout:ay}};function C2(a,i,l){var o;if(a instanceof Element)return[a];if(typeof a=="string"){let u=document;const h=(o=void 0)!==null&&o!==void 0?o:u.querySelectorAll(a);return h?Array.from(h):[]}return Array.from(a)}function fy(a,i){const l=C2(a),o=new AbortController,u={passive:!0,...i,signal:o.signal};return[l,u,()=>o.abort()]}function cv(a){return i=>{i.pointerType==="touch"||X0()||a(i)}}function D2(a,i,l={}){const[o,u,h]=fy(a,l),f=cv(p=>{const{target:g}=p,v=i(p);if(typeof v!="function"||!g)return;const b=cv(S=>{v(S),g.removeEventListener("pointerleave",b)});g.addEventListener("pointerleave",b,u)});return o.forEach(p=>{p.addEventListener("pointerenter",f,u)}),h}function uv(a,i,l){const{props:o}=a;a.animationState&&o.whileHover&&a.animationState.setActive("whileHover",l==="Start");const u="onHover"+l,h=o[u];h&&ue.postRender(()=>h(i,zl(i)))}class k2 extends $a{mount(){const{current:i}=this.node;i&&(this.unmount=D2(i,l=>(uv(this.node,l,"Start"),o=>uv(this.node,o,"End"))))}unmount(){}}class w2 extends $a{constructor(){super(...arguments),this.isActive=!1}onFocus(){let i=!1;try{i=this.node.current.matches(":focus-visible")}catch{i=!0}!i||!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=Ol(wl(this.node.current,"focus",()=>this.onFocus()),wl(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}const hy=(a,i)=>i?a===i?!0:hy(a,i.parentElement):!1,M2=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function R2(a){return M2.has(a.tagName)||a.tabIndex!==-1}const _l=new WeakSet;function dv(a){return i=>{i.key==="Enter"&&a(i)}}function Yu(a,i){a.dispatchEvent(new PointerEvent("pointer"+i,{isPrimary:!0,bubbles:!0}))}const O2=(a,i)=>{const l=a.currentTarget;if(!l)return;const o=dv(()=>{if(_l.has(l))return;Yu(l,"down");const u=dv(()=>{Yu(l,"up")}),h=()=>Yu(l,"cancel");l.addEventListener("keyup",u,i),l.addEventListener("blur",h,i)});l.addEventListener("keydown",o,i),l.addEventListener("blur",()=>l.removeEventListener("keydown",o),i)};function fv(a){return Fd(a)&&!X0()}function z2(a,i,l={}){const[o,u,h]=fy(a,l),f=p=>{const g=p.currentTarget;if(!fv(p)||_l.has(g))return;_l.add(g);const v=i(p),b=(E,k)=>{window.removeEventListener("pointerup",S),window.removeEventListener("pointercancel",x),!(!fv(E)||!_l.has(g))&&(_l.delete(g),typeof v=="function"&&v(E,{success:k}))},S=E=>{b(E,l.useGlobalTarget||hy(g,E.target))},x=E=>{b(E,!1)};window.addEventListener("pointerup",S,u),window.addEventListener("pointercancel",x,u)};return o.forEach(p=>{!R2(p)&&p.getAttribute("tabindex")===null&&(p.tabIndex=0),(l.useGlobalTarget?window:p).addEventListener("pointerdown",f,u),p.addEventListener("focus",v=>O2(v,u),u)}),h}function hv(a,i,l){const{props:o}=a;a.animationState&&o.whileTap&&a.animationState.setActive("whileTap",l==="Start");const u="onTap"+(l==="End"?"":l),h=o[u];h&&ue.postRender(()=>h(i,zl(i)))}class B2 extends $a{mount(){const{current:i}=this.node;i&&(this.unmount=z2(i,l=>(hv(this.node,l,"Start"),(o,{success:u})=>hv(this.node,o,u?"End":"Cancel")),{useGlobalTarget:this.node.props.globalTapTarget}))}unmount(){}}const cd=new WeakMap,Zu=new WeakMap,U2=a=>{const i=cd.get(a.target);i&&i(a)},V2=a=>{a.forEach(U2)};function L2({root:a,...i}){const l=a||document;Zu.has(l)||Zu.set(l,{});const o=Zu.get(l),u=JSON.stringify(i);return o[u]||(o[u]=new IntersectionObserver(V2,{root:a,...i})),o[u]}function q2(a,i,l){const o=L2(i);return cd.set(a,l),o.observe(a),()=>{cd.delete(a),o.unobserve(a)}}const H2={some:0,all:1};class G2 extends $a{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:i={}}=this.node.getProps(),{root:l,margin:o,amount:u="some",once:h}=i,f={root:l?l.current:void 0,rootMargin:o,threshold:typeof u=="number"?u:H2[u]},p=g=>{const{isIntersecting:v}=g;if(this.isInView===v||(this.isInView=v,h&&!v&&this.hasEnteredView))return;v&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",v);const{onViewportEnter:b,onViewportLeave:S}=this.node.getProps(),x=v?b:S;x&&x(g)};return q2(this.node.current,f,p)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:i,prevProps:l}=this.node;["amount","margin","root"].some(I2(i,l))&&this.startObserver()}unmount(){}}function I2({viewport:a={}},{viewport:i={}}={}){return l=>a[l]!==i[l]}const Y2={inView:{Feature:G2},tap:{Feature:B2},focus:{Feature:w2},hover:{Feature:k2}},Z2={layout:{ProjectionNode:dy,MeasureLayout:ay}},ud={current:null},my={current:!1};function K2(){if(my.current=!0,!!Sd)if(window.matchMedia){const a=window.matchMedia("(prefers-reduced-motion)"),i=()=>ud.current=a.matches;a.addListener(i),i()}else ud.current=!1}const X2=[...z0,Qe,Ja],Q2=a=>X2.find(O0(a)),mv=new WeakMap;function P2(a,i,l){for(const o in i){const u=i[o],h=l[o];if(Pe(u))a.addValue(o,u);else if(Pe(h))a.addValue(o,Dl(u,{owner:a}));else if(h!==u)if(a.hasValue(o)){const f=a.getValue(o);f.liveStyle===!0?f.jump(u):f.hasAnimated||f.set(u)}else{const f=a.getStaticValue(o);a.addValue(o,Dl(f!==void 0?f:u,{owner:a}))}}for(const o in l)i[o]===void 0&&a.removeValue(o);return i}const pv=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];class F2{scrapeMotionValuesFromProps(i,l,o){return{}}constructor({parent:i,props:l,presenceContext:o,reducedMotionConfig:u,blockInitialAnimation:h,visualState:f},p={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.KeyframeResolver=Kd,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 E=Fn.now();this.renderScheduledAt<E&&(this.renderScheduledAt=E,ue.render(this.render,!1,!0))};const{latestValues:g,renderState:v,onUpdate:b}=f;this.onUpdate=b,this.latestValues=g,this.baseTarget={...g},this.initialValues=l.initial?{...g}:{},this.renderState=v,this.parent=i,this.props=l,this.presenceContext=o,this.depth=i?i.depth+1:0,this.reducedMotionConfig=u,this.options=p,this.blockInitialAnimation=!!h,this.isControllingVariants=Sr(l),this.isVariantNode=Xv(l),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(i&&i.current);const{willChange:S,...x}=this.scrapeMotionValuesFromProps(l,{},this);for(const E in x){const k=x[E];g[E]!==void 0&&Pe(k)&&k.set(g[E],!1)}}mount(i){this.current=i,mv.set(i,this),this.projection&&!this.projection.instance&&this.projection.mount(i),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((l,o)=>this.bindToMotionValue(o,l)),my.current||K2(),this.shouldReduceMotion=this.reducedMotionConfig==="never"?!1:this.reducedMotionConfig==="always"?!0:ud.current,this.parent&&this.parent.children.add(this),this.update(this.props,this.presenceContext)}unmount(){mv.delete(this.current),this.projection&&this.projection.unmount(),Fa(this.notifyUpdate),Fa(this.render),this.valueSubscriptions.forEach(i=>i()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent&&this.parent.children.delete(this);for(const i in this.events)this.events[i].clear();for(const i in this.features){const l=this.features[i];l&&(l.unmount(),l.isMounted=!1)}this.current=null}bindToMotionValue(i,l){this.valueSubscriptions.has(i)&&this.valueSubscriptions.get(i)();const o=xs.has(i),u=l.on("change",p=>{this.latestValues[i]=p,this.props.onUpdate&&ue.preRender(this.notifyUpdate),o&&this.projection&&(this.projection.isTransformDirty=!0)}),h=l.on("renderRequest",this.scheduleRender);let f;window.MotionCheckAppearSync&&(f=window.MotionCheckAppearSync(this,i,l)),this.valueSubscriptions.set(i,()=>{u(),h(),f&&f(),l.owner&&l.stop()})}sortNodePosition(i){return!this.current||!this.sortInstanceNodePosition||this.type!==i.type?0:this.sortInstanceNodePosition(this.current,i.current)}updateFeatures(){let i="animation";for(i in gi){const l=gi[i];if(!l)continue;const{isEnabled:o,Feature:u}=l;if(!this.features[i]&&u&&o(this.props)&&(this.features[i]=new u(this)),this.features[i]){const h=this.features[i];h.isMounted?h.update():(h.mount(),h.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):Ae()}getStaticValue(i){return this.latestValues[i]}setStaticValue(i,l){this.latestValues[i]=l}update(i,l){(i.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=i,this.prevPresenceContext=this.presenceContext,this.presenceContext=l;for(let o=0;o<pv.length;o++){const u=pv[o];this.propEventSubscriptions[u]&&(this.propEventSubscriptions[u](),delete this.propEventSubscriptions[u]);const h="on"+u,f=i[h];f&&(this.propEventSubscriptions[u]=this.on(u,f))}this.prevMotionValues=P2(this,this.scrapeMotionValuesFromProps(i,this.prevProps,this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue(),this.onUpdate&&this.onUpdate(this)}getProps(){return this.props}getVariant(i){return this.props.variants?this.props.variants[i]: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(i){const l=this.getClosestVariantNode();if(l)return l.variantChildren&&l.variantChildren.add(i),()=>l.variantChildren.delete(i)}addValue(i,l){const o=this.values.get(i);l!==o&&(o&&this.removeValue(i),this.bindToMotionValue(i,l),this.values.set(i,l),this.latestValues[i]=l.get())}removeValue(i){this.values.delete(i);const l=this.valueSubscriptions.get(i);l&&(l(),this.valueSubscriptions.delete(i)),delete this.latestValues[i],this.removeValueFromRenderState(i,this.renderState)}hasValue(i){return this.values.has(i)}getValue(i,l){if(this.props.values&&this.props.values[i])return this.props.values[i];let o=this.values.get(i);return o===void 0&&l!==void 0&&(o=Dl(l===null?void 0:l,{owner:this}),this.addValue(i,o)),o}readValue(i,l){var o;let u=this.latestValues[i]!==void 0||!this.current?this.latestValues[i]:(o=this.getBaseTargetFromProps(this.props,i))!==null&&o!==void 0?o:this.readValueFromInstance(this.current,i,this.options);return u!=null&&(typeof u=="string"&&(M0(u)||x0(u))?u=parseFloat(u):!Q2(u)&&Ja.test(l)&&(u=D0(i,l)),this.setBaseTarget(i,Pe(u)?u.get():u)),Pe(u)?u.get():u}setBaseTarget(i,l){this.baseTarget[i]=l}getBaseTarget(i){var l;const{initial:o}=this.props;let u;if(typeof o=="string"||typeof o=="object"){const f=Nd(this.props,o,(l=this.presenceContext)===null||l===void 0?void 0:l.custom);f&&(u=f[i])}if(o&&u!==void 0)return u;const h=this.getBaseTargetFromProps(this.props,i);return h!==void 0&&!Pe(h)?h:this.initialValues[i]!==void 0&&u===void 0?void 0:this.baseTarget[i]}on(i,l){return this.events[i]||(this.events[i]=new Ud),this.events[i].add(l)}notify(i,...l){this.events[i]&&this.events[i].notify(...l)}}class py extends F2{constructor(){super(...arguments),this.KeyframeResolver=B0}sortInstanceNodePosition(i,l){return i.compareDocumentPosition(l)&2?1:-1}getBaseTargetFromProps(i,l){return i.style?i.style[l]:void 0}removeValueFromRenderState(i,{vars:l,style:o}){delete l[i],delete o[i]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:i}=this.props;Pe(i)&&(this.childSubscription=i.on("change",l=>{this.current&&(this.current.textContent=`${l}`)}))}}function J2(a){return window.getComputedStyle(a)}class $2 extends py{constructor(){super(...arguments),this.type="html",this.renderInstance=n0}readValueFromInstance(i,l){if(xs.has(l)){const o=Zd(l);return o&&o.default||0}else{const o=J2(i),u=(Wv(l)?o.getPropertyValue(l):o[l])||0;return typeof u=="string"?u.trim():u}}measureInstanceViewportBox(i,{transformPagePoint:l}){return ey(i,l)}build(i,l,o){Dd(i,l,o.transformTemplate)}scrapeMotionValuesFromProps(i,l,o){return Rd(i,l,o)}}class W2 extends py{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=Ae}getBaseTargetFromProps(i,l){return i[l]}readValueFromInstance(i,l){if(xs.has(l)){const o=Zd(l);return o&&o.default||0}return l=a0.has(l)?l:xd(l),i.getAttribute(l)}scrapeMotionValuesFromProps(i,l,o){return l0(i,l,o)}build(i,l,o){kd(i,l,this.isSVGTag,o.transformTemplate)}renderInstance(i,l,o,u){s0(i,l,o,u)}mount(i){this.isSVGTag=Md(i.tagName),super.mount(i)}}const tj=(a,i)=>Ad(a)?new W2(i):new $2(i,{allowProjection:a!==_.Fragment}),ej=N_({...vx,...Y2,...E2,...Z2},tj),Jn=HS(ej);var _e;(function(a){a[a.UNSPECIFIED=0]="UNSPECIFIED",a[a.TEXT=1]="TEXT",a[a.TOOL_USE=2]="TOOL_USE",a[a.TOOL_RESULT=3]="TOOL_RESULT",a[a.ERROR=4]="ERROR",a[a.STATUS=5]="STATUS",a[a.SYSTEM=6]="SYSTEM",a[a.FINDING=7]="FINDING",a[a.SUBTASK_CREATE=8]="SUBTASK_CREATE",a[a.USER_INPUT=9]="USER_INPUT"})(_e||(_e={}));var Ve;(function(a){a[a.UNSPECIFIED=0]="UNSPECIFIED",a[a.PENDING=1]="PENDING",a[a.ASSIGNED=2]="ASSIGNED",a[a.IN_PROGRESS=3]="IN_PROGRESS",a[a.REVIEW=4]="REVIEW",a[a.DONE=5]="DONE",a[a.FAILED=6]="FAILED",a[a.WAITING_INPUT=7]="WAITING_INPUT"})(Ve||(Ve={}));var Qa;(function(a){a[a.UNSPECIFIED=0]="UNSPECIFIED",a[a.ACTIVE=1]="ACTIVE",a[a.ARCHIVED=2]="ARCHIVED"})(Qa||(Qa={}));var Pa;(function(a){a[a.UNSPECIFIED=0]="UNSPECIFIED",a[a.OPEN=1]="OPEN",a[a.CLOSED=2]="CLOSED"})(Pa||(Pa={}));const nj=8;Object.assign(Object.create(null),{"":_e.UNSPECIFIED,text:_e.TEXT,tool_use:_e.TOOL_USE,tool_result:_e.TOOL_RESULT,error:_e.ERROR,status:_e.STATUS,system:_e.SYSTEM,finding:_e.FINDING,subtask_create:_e.SUBTASK_CREATE,user_input:_e.USER_INPUT});_e.UNSPECIFIED+"",_e.TEXT+"",_e.TOOL_USE+"",_e.TOOL_RESULT+"",_e.ERROR+"",_e.STATUS+"",_e.SYSTEM+"",_e.FINDING+"",_e.SUBTASK_CREATE+"",_e.USER_INPUT+"";Object.assign(Object.create(null),{"":Ve.UNSPECIFIED,pending:Ve.PENDING,assigned:Ve.ASSIGNED,in_progress:Ve.IN_PROGRESS,review:Ve.REVIEW,done:Ve.DONE,failed:Ve.FAILED,waiting_input:Ve.WAITING_INPUT});Ve.UNSPECIFIED+"",Ve.PENDING+"",Ve.ASSIGNED+"",Ve.IN_PROGRESS+"",Ve.REVIEW+"",Ve.DONE+"",Ve.FAILED+"",Ve.WAITING_INPUT+"";Object.assign(Object.create(null),{"":Qa.UNSPECIFIED,active:Qa.ACTIVE,archived:Qa.ARCHIVED});Qa.UNSPECIFIED+"",Qa.ACTIVE+"",Qa.ARCHIVED+"";Object.assign(Object.create(null),{"":Pa.UNSPECIFIED,open:Pa.OPEN,closed:Pa.CLOSED});Pa.UNSPECIFIED+"",Pa.OPEN+"",Pa.CLOSED+"";const aj="_breadcrumbs_1s6xc_1",sj="_list_1s6xc_11",ij="_item_1s6xc_21",lj="_separator_1s6xc_28",oj="_link_1s6xc_34",rj="_current_1s6xc_57",ui={breadcrumbs:aj,list:sj,item:ij,separator:lj,link:oj,current:rj},cj="›";function vs({segments:a,onNavigate:i}){return d.jsx("nav",{className:ui.breadcrumbs,"aria-label":"Breadcrumb","data-testid":"breadcrumbs",children:d.jsx("ol",{className:ui.list,children:a.map((l,o)=>{const u=o===a.length-1;return d.jsxs("li",{className:ui.item,children:[o>0&&d.jsx("span",{className:ui.separator,"aria-hidden":"true",children:cj}),l.viewMode&&!u?d.jsx("button",{className:ui.link,onClick:()=>i(l),title:l.label,children:l.label}):d.jsx("span",{className:ui.current,"aria-current":"page",title:l.label,children:l.label})]},o)})})})}function dd(){dd=function(u,h){return new l(u,void 0,h)};var a=RegExp.prototype,i=new WeakMap;function l(u,h,f){var p=new RegExp(u,h);return i.set(p,f||i.get(u)),mr(p,l.prototype)}function o(u,h){var f=i.get(h);return Object.keys(f).reduce(function(p,g){var v=f[g];if(typeof v=="number")p[g]=u[v];else{for(var b=0;u[v[b]]===void 0&&b+1<v.length;)b++;p[g]=u[v[b]]}return p},Object.create(null))}return(function(u,h){if(typeof h!="function"&&h!==null)throw new TypeError("Super expression must either be null or a function");u.prototype=Object.create(h&&h.prototype,{constructor:{value:u,writable:!0,configurable:!0}}),Object.defineProperty(u,"prototype",{writable:!1}),h&&mr(u,h)})(l,RegExp),l.prototype.exec=function(u){var h=a.exec.call(this,u);if(h){h.groups=o(h,this);var f=h.indices;f&&(f.groups=o(f,this))}return h},l.prototype[Symbol.replace]=function(u,h){if(typeof h=="string"){var f=i.get(this);return a[Symbol.replace].call(this,u,h.replace(/\$<([^>]+)>/g,function(g,v){var b=f[v];return"$"+(Array.isArray(b)?b.join("$"):b)}))}if(typeof h=="function"){var p=this;return a[Symbol.replace].call(this,u,function(){var g=arguments;return typeof g[g.length-1]!="object"&&(g=[].slice.call(g)).push(o(g,p)),h.apply(this,g)})}return a[Symbol.replace].call(this,u,h)},dd.apply(this,arguments)}function mr(a,i){return mr=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(l,o){return l.__proto__=o,l},mr(a,i)}function gv(a,i){(i==null||i>a.length)&&(i=a.length);for(var l=0,o=new Array(i);l<i;l++)o[l]=a[l];return o}function Ku(a,i){var l=typeof Symbol<"u"&&a[Symbol.iterator]||a["@@iterator"];if(l)return(l=l.call(a)).next.bind(l);if(Array.isArray(a)||(l=(function(u,h){if(u){if(typeof u=="string")return gv(u,h);var f=Object.prototype.toString.call(u).slice(8,-1);return f==="Object"&&u.constructor&&(f=u.constructor.name),f==="Map"||f==="Set"?Array.from(u):f==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(f)?gv(u,h):void 0}})(a))||i){l&&(a=l);var o=0;return function(){return o>=a.length?{done:!0}:{done:!1,value:a[o++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
76
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var uj=(function(a){return function(i){return i===void 0&&(i={}),(function(o,u){if(u&&!o.registered(u))throw new Error('The default language "'+u+'" is not registered with refractor.')})(a,i.defaultLanguage),function(o){Rb(o,"element",l)};function l(o,u,h){var f,p;if(h&&h.tagName==="pre"&&o.tagName==="code"){var g=(o==null||(f=o.data)==null?void 0:f.meta)||(o==null||(p=o.properties)==null?void 0:p.metastring)||"";o.properties.className?typeof o.properties.className=="boolean"?o.properties.className=[]:Array.isArray(o.properties.className)||(o.properties.className=[o.properties.className]):o.properties.className=[];var v,b,S=(function(X){for(var V,et=Ku(X.properties.className);!(V=et()).done;){var w=V.value;if(w.slice(0,9)==="language-")return w.slice(9).toLowerCase()}return null})(o);if(!S&&i.defaultLanguage&&o.properties.className.push("language-"+(S=i.defaultLanguage)),o.properties.className.push("code-highlight"),S)try{var x,E;E=(x=S)!=null&&x.includes("diff-")?S.split("-")[1]:S,v=a.highlight(Fo(o),E),h.properties.className=(h.properties.className||[]).concat("language-"+E)}catch(X){if(!i.ignoreMissing||!/Unknown language/.test(X.message))throw X;v=o}else v=o;v.children=(b=1,function X(V){return V.reduce(function(et,w){if(w.type==="text"){var $=w.value,st=($.match(/\n/g)||"").length;if(st===0)w.position={start:{line:b,column:1},end:{line:b,column:1}},et.push(w);else for(var ht,zt=$.split(`
77
- `),tt=Ku(zt.entries());!(ht=tt()).done;){var Ut=ht.value,wt=Ut[0],B=Ut[1];et.push({type:"text",value:wt===zt.length-1?B:B+`
78
- `,position:{start:{line:b+wt,column:1},end:{line:b+wt,column:1}}})}return b+=st,et}if(Object.prototype.hasOwnProperty.call(w,"children")){var Q=b;return w.children=X(w.children),et.push(w),w.position={start:{line:Q,column:1},end:{line:b,column:1}},et}return et.push(w),et},[])})(v.children),v.position=v.children.length>0?{start:{line:v.children[0].position.start.line,column:0},end:{line:v.children[v.children.length-1].position.end.line,column:0}}:{start:{line:0,column:0},end:{line:0,column:0}};for(var k,q=(function(X){var V=/{([\d,-]+)}/,et=X.split(",").map(function(st){return st.trim()}).join();if(V.test(et)){var w=V.exec(et)[1],$=zb(w);return function(st){return $.includes(st+1)}}return function(){return!1}})(g),K=(function(X){var V=dd(/showLineNumbers=(\d+)/i,{lines:1});if(V.test(X)){var et=V.exec(X);return Number(et.groups.lines)}return 1})(g),z=(function(X){for(var V=new Array(X),et=0;et<X;et++)V[et]={type:"element",tagName:"span",properties:{className:[]},children:[]};return V})(v.position.end.line),P=["showlinenumbers=false",'showlinenumbers="false"',"showlinenumbers={false}"],Y=function(){var X,V,et=k.value,w=et[0],$=et[1];$.properties.className=["code-line"];var st=Bb(v,function(ht){return ht.position.start.line<=w+1&&ht.position.end.line>=w+1});$.children=st.children,(g.toLowerCase().includes("showLineNumbers".toLowerCase())||i.showLineNumbers===!0||typeof i.showLineNumbers=="object"&&i.showLineNumbers.includes(S))&&!P.some(function(ht){return g.toLowerCase().includes(ht)})&&($.properties.line=[(w+K).toString()],$.properties.className.push("line-number")),q(w)&&$.properties.className.push("highlight-line"),(S==="diff"||(X=S)!=null&&X.includes("diff-"))&&Fo($).substring(0,1)==="-"?$.properties.className.push("deleted"):(S==="diff"||(V=S)!=null&&V.includes("diff-"))&&Fo($).substring(0,1)==="+"&&$.properties.className.push("inserted")},nt=Ku(z.entries());!(k=nt()).done;)Y();z.length>0&&Fo(z[z.length-1]).trim()===""&&z.pop(),o.children=z}}}})(Ob);const dj="_systemEvent_1iozp_1",fj="_systemTimestamp_1iozp_9",hj="_textEvent_1iozp_13",mj="_toolUseEvent_1iozp_100",pj="_toolUseHeader_1iozp_116",gj="_toolUsePrefix_1iozp_123",vj="_toolUseName_1iozp_128",yj="_toolUseArgs_1iozp_133",bj="_toolResultEvent_1iozp_144",Sj="_toolResultHeader_1iozp_150",_j="_toolResultIndicatorOk_1iozp_174",Tj="_toolResultIndicatorError_1iozp_181",xj="_toolResultLabel_1iozp_188",jj="_toolResultToggle_1iozp_192",Aj="_toolResultCommand_1iozp_198",Nj="_toolResultEllipsis_1iozp_208",Ej="_toolResultPre_1iozp_212",Cj="_errorEvent_1iozp_227",Dj="_statusEvent_1iozp_236",kj="_userInputEvent_1iozp_246",wj="_userInputContent_1iozp_253",Mj="_defaultEvent_1iozp_265",pe={systemEvent:dj,systemTimestamp:fj,textEvent:hj,toolUseEvent:mj,toolUseHeader:pj,toolUsePrefix:gj,toolUseName:vj,toolUseArgs:yj,toolResultEvent:bj,toolResultHeader:Sj,toolResultIndicatorOk:_j,toolResultIndicatorError:Tj,toolResultLabel:xj,toolResultToggle:jj,toolResultCommand:Aj,toolResultEllipsis:Nj,toolResultPre:Ej,errorEvent:Cj,statusEvent:Dj,userInputEvent:kj,userInputContent:wj,defaultEvent:Mj};function Rj({time:a,content:i}){return d.jsxs("div",{className:pe.systemEvent,children:[d.jsxs("span",{className:pe.systemTimestamp,children:["[",a,"]"]})," ",i]})}function Oj({content:a}){return d.jsx("div",{className:pe.textEvent,children:d.jsx(fd,{remarkPlugins:[hd],rehypePlugins:[uj],children:a})})}function zj({content:a}){let i="",l=a;try{const o=JSON.parse(a);i=o.tool||"",l=JSON.stringify(o.args,null,2)??""}catch{}return d.jsxs("div",{className:pe.toolUseEvent,children:[d.jsxs("div",{className:pe.toolUseHeader,children:[d.jsx("span",{className:pe.toolUsePrefix,children:">"}),i?d.jsx("span",{className:pe.toolUseName,children:i}):null]}),d.jsx("pre",{className:pe.toolUseArgs,children:l})]})}const vv=5;function Bj(a,i){if(i==null)return"";if(typeof i!="object")return String(i);const l=i;if(typeof l.command=="string")return l.command;if(typeof l.file_path=="string")return l.file_path;if(typeof l.pattern=="string"){const o=typeof l.path=="string"?` in ${l.path}`:"";return`${l.pattern}${o}`}if(typeof l.path=="string")return l.path;if(typeof l.query=="string")return l.query;try{const o=JSON.stringify(i);return o.length>150?`${o.slice(0,150)}…`:o}catch{return""}}function Uj({content:a,raw:i,toolUseCtx:l}){const[o,u]=_.useState(!1);let h=!1;if(i)try{h=JSON.parse(i).is_error===!0}catch{}const f=a.split(`
79
- `),p=f.length>vv,g=o?a:f.slice(0,vv).join(`
80
- `),b=((l==null?void 0:l.tool)??"")||(h?"Tool error":"Tool output"),S=l?Bj(l.tool,l.args):"",x=d.jsxs(d.Fragment,{children:[d.jsx("span",{className:h?pe.toolResultIndicatorError:pe.toolResultIndicatorOk,"aria-label":h?"error":"success",children:h?"✗":"✓"}),d.jsx("span",{className:pe.toolResultLabel,children:b}),p&&d.jsx("span",{className:pe.toolResultToggle,"aria-hidden":"true",children:o?"▾":"▸"})]});return d.jsxs("div",{className:pe.toolResultEvent,children:[p?d.jsx("button",{className:pe.toolResultHeader,onClick:()=>{u(E=>!E)},"aria-expanded":o,children:x}):d.jsx("div",{className:pe.toolResultHeader,children:x}),S&&d.jsx("div",{className:pe.toolResultCommand,children:S}),d.jsxs("pre",{className:pe.toolResultPre,children:[g,!o&&p&&d.jsx("span",{className:pe.toolResultEllipsis,children:"…"})]})]})}function Vj({content:a}){return d.jsxs("div",{className:pe.errorEvent,children:["Error: ",a]})}function Lj({content:a}){return d.jsxs("div",{className:pe.statusEvent,children:["--- ",a," ---"]})}function qj({content:a}){return d.jsx("div",{className:pe.userInputEvent,children:d.jsx("span",{className:pe.userInputContent,children:a})})}function Hj({content:a}){return d.jsx("div",{className:pe.defaultEvent,children:a})}function gy({event:a,toolUseCtx:i}){const l=new Date(a.timestamp).toLocaleTimeString();switch(a.eventType){case"system":return d.jsx(Rj,{time:l,content:a.content});case"text":case"output":return d.jsx(Oj,{content:a.content});case"tool_use":return d.jsx(zj,{content:a.content});case"tool_result":return d.jsx(Uj,{content:a.content,raw:a.raw,toolUseCtx:i});case"error":return d.jsx(Vj,{content:a.content});case"status":return d.jsx(Lj,{content:a.content});case"user_input":return d.jsx(qj,{content:a.content});default:return d.jsx(Hj,{content:a.content})}}const Gj="_overlay_9j2g5_1",Ij="_dialog_9j2g5_11",Yj="_title_9j2g5_30",Zj="_description_9j2g5_38",Kj="_actions_9j2g5_45",Xj="_cancelButton_9j2g5_52",Qj="_confirmButton_9j2g5_79",ys={overlay:Gj,dialog:Ij,title:Yj,description:Zj,actions:Kj,cancelButton:Xj,confirmButton:Qj};function pr({isOpen:a,title:i,description:l,confirmLabel:o="Delete",onConfirm:u,onCancel:h}){const f=_.useId(),p=_.useId();return d.jsx(bi,{children:a&&d.jsx(Jn.div,{className:ys.overlay,initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.15},onClick:h,onKeyDown:g=>{g.key==="Escape"&&h()},role:"dialog","aria-modal":"true","aria-labelledby":f,"aria-describedby":l?p:void 0,children:d.jsxs(Jn.div,{className:ys.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:g=>g.stopPropagation(),children:[d.jsx("h3",{id:f,className:ys.title,children:i}),l&&d.jsx("p",{id:p,className:ys.description,children:l}),d.jsxs("div",{className:ys.actions,children:[d.jsx("button",{type:"button",className:ys.cancelButton,onClick:h,autoFocus:!0,children:"Cancel"}),d.jsx("button",{type:"button",className:ys.confirmButton,onClick:u,children:o})]})]})})})}const Pj="_spinner_13c8l_1",Fj="_spin_13c8l_1",Jj="_sm_13c8l_14",$j="_md_13c8l_20",Wj="_lg_13c8l_26",yv={spinner:Pj,spin:Fj,sm:Jj,md:$j,lg:Wj};function bv({size:a="md",className:i,label:l="Loading",liveRegion:o=!1}){return d.jsx("span",{className:`${yv.spinner} ${yv[a]} ${i??""}`,role:o?"status":void 0,"aria-label":l,"aria-hidden":o?void 0:!0})}const tA="_container_1vu3l_1",eA="_header_1vu3l_5",nA="_addButton_1vu3l_17",aA="_createForm_1vu3l_44",sA="_createInput_1vu3l_50",iA="_createButton_1vu3l_81",lA="_creatingHint_1vu3l_122",oA="_projectRow_1vu3l_131",rA="_selected_1vu3l_149",cA="_expandArrow_1vu3l_154",uA="_expanded_1vu3l_161",dA="_projectName_1vu3l_165",fA="_taskCount_1vu3l_169",hA="_newTaskButton_1vu3l_175",mA="_taskRow_1vu3l_202",pA="_taskStatusIcon_1vu3l_227",gA="_taskTitle_1vu3l_231",vA="_dependencyBadge_1vu3l_238",yA="_blockedBadge_1vu3l_250",bA="_leafSpacer_1vu3l_255",SA="_childCountBadge_1vu3l_260",_A="_addChildButton_1vu3l_273",TA="_emptyCta_1vu3l_317",xA="_ctaDescription_1vu3l_330",jA="_ctaButton_1vu3l_336",AA="_emptyTaskCta_1vu3l_371",NA="_createTaskLink_1vu3l_376",Xt={container:tA,header:eA,addButton:nA,createForm:aA,createInput:sA,createButton:iA,creatingHint:lA,projectRow:oA,selected:rA,expandArrow:cA,expanded:uA,projectName:dA,taskCount:fA,newTaskButton:hA,taskRow:mA,taskStatusIcon:pA,taskTitle:gA,dependencyBadge:vA,blockedBadge:yA,leafSpacer:bA,childCountBadge:SA,addChildButton:_A,emptyCta:TA,ctaDescription:xA,ctaButton:jA,emptyTaskCta:AA,createTaskLink:NA},Sv={pending:{color:"var(--text-tertiary)",icon:"○"},assigned:{color:"var(--accent-blue)",icon:"◎"},in_progress:{color:"var(--accent-green)",icon:"●"},review:{color:"var(--accent-yellow)",icon:"◉"},done:{color:"var(--accent-green)",icon:"✓"},failed:{color:"var(--accent-red)",icon:"✗"},waiting_input:{color:"var(--accent-yellow)",icon:"⧖"}};function EA(a){const i=new Map(a.map(o=>[o.id,{...o,children:[]}])),l=[];for(const o of i.values())o.parentTaskId&&i.has(o.parentTaskId)?i.get(o.parentTaskId).children.push(o):l.push(o);for(const o of i.values())o.children.sort((u,h)=>u.sortOrder-h.sortOrder);return l.sort((o,u)=>o.sortOrder-u.sortOrder)}const CA=34,DA=16;function vy({node:a,depth:i,expandedTasks:l,toggleTask:o,selectedTaskId:u,setViewMode:h,projectId:f,taskStatusById:p}){const g=Sv[a.status]||Sv.pending,v=a.dependsOn.length>0&&a.dependsOn.some(k=>p.get(k)!=="done"),b=l.has(a.id),S=a.children.length>0,x=u===a.id,E=CA+i*DA;return d.jsxs(d.Fragment,{children:[d.jsxs("div",{onClick:()=>h({kind:"task",taskId:a.id}),className:`${Xt.taskRow} ${x?Xt.selected:""}`,style:{paddingLeft:E},"data-task-id":a.id,children:[S&&d.jsx("span",{className:`${Xt.expandArrow} ${b?Xt.expanded:""}`,role:"button",tabIndex:0,"aria-label":b?"Collapse task":"Expand task",onClick:k=>{k.stopPropagation(),o(a.id)},onKeyDown:k=>{(k.key==="Enter"||k.key===" ")&&(k.preventDefault(),k.stopPropagation(),o(a.id))},children:"▸"}),!S&&d.jsx("span",{className:Xt.leafSpacer}),d.jsx("span",{className:Xt.taskStatusIcon,style:{color:g.color},children:g.icon}),d.jsx("span",{className:Xt.taskTitle,title:a.title,children:a.title}),S&&d.jsxs("span",{className:Xt.childCountBadge,children:[a.children.filter(k=>k.status==="done").length,"/",a.children.length]}),a.dependsOn.length>0&&d.jsx("span",{className:`${Xt.dependencyBadge} ${v?Xt.blockedBadge:""}`,title:`Depends on: ${a.dependsOn.join(", ")}`,children:v?"blocked":"dep"}),i<nj&&d.jsx("button",{onClick:k=>{k.stopPropagation(),h({kind:"new_task",projectId:f,parentTaskId:a.id})},title:"Add child task","aria-label":"Add child task",className:Xt.addChildButton,children:"+"})]}),d.jsx(bi,{children:S&&b&&d.jsx(Jn.div,{initial:{height:0,opacity:0},animate:{height:"auto",opacity:1},exit:{height:0,opacity:0},transition:{duration:.15},style:{overflow:"hidden"},children:a.children.map(k=>d.jsx(vy,{node:k,depth:i+1,expandedTasks:l,toggleTask:o,selectedTaskId:u,setViewMode:h,projectId:f,taskStatusById:p},k.id))})})]})}function kA({viewMode:a,setViewMode:i}){const{projects:l,tasks:o,loadTasks:u,createProject:h,projectCreating:f}=Hn(),[p,g]=_.useState(new Set),[v,b]=_.useState(new Set),[S,x]=_.useState(new Set),[E,k]=_.useState(!1),[q,K]=_.useState(""),z=a.kind==="project"?a.projectId:void 0,P=a.kind==="task"?a.taskId:void 0,Y=_.useRef(p);Y.current=p;const nt=_.useMemo(()=>new Map(o.map(w=>[w.id,w.status])),[o]),X=w=>{g($=>{const st=new Set($);return st.has(w)?st.delete(w):(st.add(w),u(w)),st})},V=w=>{b($=>{const st=new Set($);return st.has(w)?(st.delete(w),x(ht=>new Set(ht).add(w))):(st.add(w),x(ht=>{const zt=new Set(ht);return zt.delete(w),zt})),st})};_.useEffect(()=>{const w=new Set(o.filter($=>$.parentTaskId).map($=>$.parentTaskId));w.size>0&&b($=>{const st=new Set($);for(const ht of w)S.has(ht)||st.add(ht);return st})},[o,S]),_.useEffect(()=>{z&&!Y.current.has(z)&&(g(w=>new Set(w).add(z)),u(z))},[z,u]);const et=()=>{!q.trim()||f||(h(q.trim()),K(""),k(!1))};return d.jsxs("div",{className:Xt.container,children:[d.jsxs("div",{className:Xt.header,children:[d.jsx("span",{children:"Projects"}),d.jsx("button",{className:Xt.addButton,onClick:()=>k(!E),"aria-label":"Create project",title:"Create project",children:"+"})]}),E&&d.jsxs("div",{className:Xt.createForm,children:[d.jsx("input",{type:"text",value:q,onChange:w=>K(w.target.value),onKeyDown:w=>w.key==="Enter"&&et(),placeholder:"Project name...",autoFocus:!0,disabled:f,className:Xt.createInput}),d.jsx("button",{onClick:et,className:Xt.createButton,disabled:f,children:f?d.jsx(bv,{size:"sm",label:"Creating project"}):"OK"})]}),f&&d.jsxs("div",{className:Xt.creatingHint,children:[d.jsx(bv,{size:"sm",label:"Creating project"}),"Creating project…"]}),l.length===0&&!E&&d.jsxs("div",{className:Xt.emptyCta,children:[d.jsx("button",{className:Xt.ctaButton,onClick:()=>k(!0),children:"Create Project"}),d.jsx("div",{className:Xt.ctaDescription,children:"Organize your work into projects"})]}),l.map(w=>{const $=p.has(w.id),st=o.filter(tt=>tt.projectId===w.id),ht=z===w.id,zt=$?EA(st):[];return d.jsxs("div",{children:[d.jsxs("div",{onClick:()=>{ht?X(w.id):($||X(w.id),i({kind:"project",projectId:w.id}))},className:`${Xt.projectRow} ${ht?Xt.selected:""}`,children:[d.jsx("span",{className:`${Xt.expandArrow} ${$?Xt.expanded:""}`,children:"▸"}),d.jsx("span",{className:Xt.projectName,title:w.name,children:w.name}),d.jsx("span",{className:Xt.taskCount,children:st.length>0&&`${st.filter(tt=>tt.status==="done").length}/${st.length}`}),d.jsx("button",{onClick:tt=>{tt.stopPropagation(),i({kind:"new_task",projectId:w.id})},title:"New task",className:Xt.newTaskButton,children:"+"})]}),d.jsx(bi,{children:$&&d.jsxs(Jn.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:[zt.map(tt=>d.jsx(vy,{node:tt,depth:0,expandedTasks:v,toggleTask:V,selectedTaskId:P,setViewMode:i,projectId:w.id,taskStatusById:nt},tt.id)),st.length===0&&d.jsx("div",{className:Xt.emptyTaskCta,children:d.jsx("button",{className:Xt.createTaskLink,onClick:()=>i({kind:"new_task",projectId:w.id}),children:"+ Create Task"})})]})})]},w.id)})]})}const wA="_container_17mc8_1",MA="_content_17mc8_30",_v={container:wA,content:MA},RA=320,yy=220,by=600,Sy="grackle-sidebar-width";function OA(){try{const a=localStorage.getItem(Sy);if(a!==null){const i=Number(a);if(Number.isFinite(i)&&i>=yy&&i<=by)return i}}catch{}return RA}function zA(a){try{localStorage.setItem(Sy,String(a))}catch{}}function BA({viewMode:a,setViewMode:i}){const[l]=_.useState(OA),o=_.useRef(null);return _.useEffect(()=>{const u=o.current;if(!u)return;const h=new ResizeObserver(f=>{for(const p of f){const g=p.borderBoxSize[0];if(g){const v=Math.round(g.inlineSize);v>=yy&&v<=by&&zA(v)}}});return h.observe(u),()=>{h.disconnect()}},[]),d.jsx("div",{className:_v.container,ref:o,"data-testid":"sidebar",style:{width:l},children:d.jsx("div",{className:_v.content,children:d.jsx(kA,{viewMode:a,setViewMode:i})})})}const UA="_bar_23ni8_1",VA="_barColumn_23ni8_26",LA="_barRow_23ni8_52",qA="_input_23ni8_58",HA="_inputSmall_23ni8_87",GA="_select_23ni8_150",IA="_btnPrimary_23ni8_180",YA="_btnDanger_23ni8_211",ZA="_btnGhost_23ni8_250",KA="_badge_23ni8_278",XA="_statusText_23ni8_288",QA="_statusCompleted_23ni8_293",PA="_statusFailed_23ni8_297",FA="_statusBlocked_23ni8_301",JA="_hintText_23ni8_306",$A="_creatingHint_23ni8_311",WA="_errorHint_23ni8_319",tN="_disconnectHint_23ni8_325",rt={bar:UA,barColumn:VA,barRow:LA,input:qA,inputSmall:HA,select:GA,btnPrimary:IA,btnDanger:YA,btnGhost:ZA,badge:KA,statusText:XA,statusCompleted:QA,statusFailed:PA,statusBlocked:FA,hintText:JA,creatingHint:$A,errorHint:WA,disconnectHint:tN};function Tv({value:a,onChange:i,testId:l}){return d.jsxs("select",{"data-testid":l,value:a,onChange:o=>i(o.target.value),className:rt.select,children:[d.jsx("option",{value:"claude-code",children:"claude-code"}),d.jsx("option",{value:"codex",children:"codex"}),d.jsx("option",{value:"copilot",children:"copilot"}),d.jsx("option",{value:"stub",children:"stub"})]})}function xv(a,i){if(!a)return!1;const l=i.find(o=>o.id===a);return l!==void 0&&(l.status==="disconnected"||l.status==="error")}function jv({environmentId:a,onReconnect:i}){return d.jsxs(d.Fragment,{children:[d.jsx("span",{className:rt.disconnectHint,"data-testid":"env-disconnect-hint",children:"Environment unavailable"}),d.jsx("button",{type:"button",onClick:()=>i(a),className:rt.btnGhost,"data-testid":"reconnect-btn",title:"Reconnect the environment to resume messaging",children:"Reconnect"})]})}function eN({viewMode:a,setViewMode:i}){const{spawn:l,sendInput:o,kill:u,sessions:h,tasks:f,environments:p,personas:g,addEnvironment:v,provisionEnvironment:b,codespaces:S,codespaceError:x,codespaceCreating:E,listCodespaces:k,createCodespace:q}=Hn(),{showToast:K}=gr(),[z,P]=_.useState(""),[Y,nt]=_.useState(a.kind==="new_chat"?a.runtime:"claude-code"),[X,V]=_.useState(""),et=Mt=>{if(V(Mt),Mt){const _t=g.find(R=>R.id===Mt);_t!=null&&_t.runtime&&nt(_t.runtime)}},[w,$]=_.useState(""),[st,ht]=_.useState("local"),[zt,tt]=_.useState("claude-code"),[Ut,wt]=_.useState(""),[B,Q]=_.useState(""),[lt,At]=_.useState(""),[mt,Qt]=_.useState(""),[yt,bt]=_.useState(""),[I,ae]=_.useState(""),[ve,tn]=_.useState(""),[Le,Wt]=_.useState(""),[en,ze]=_.useState("pick");_.useEffect(()=>{a.kind==="new_chat"&&nt(a.runtime)},[a]);const Gt=a.kind==="session"?h.find(Mt=>Mt.id===a.sessionId):void 0,Pt=a.kind==="task"?f.find(Mt=>Mt.id===a.taskId):void 0,me=Pt!=null&&Pt.latestSessionId?h.find(Mt=>Mt.id===Pt.latestSessionId):void 0,F=Pt?Pt.dependsOn.some(Mt=>{const _t=f.find(R=>R.id===Mt);return _t&&_t.status!=="done"}):!1;if(a.kind==="empty")return d.jsx("div",{className:rt.bar,children:d.jsx("span",{className:rt.hintText,children:"Select a session or click + to start"})});if(a.kind==="edit_task")return d.jsx(d.Fragment,{});if(a.kind==="new_environment"){const Mt=U=>{if(!U.trim())return!0;const W=Number(U);return Number.isInteger(W)&&W>=1&&W<=65535},_t=()=>!(!w.trim()||st==="ssh"&&!Ut.trim()||st==="codespace"&&!I.trim()||(st==="local"||st==="ssh")&&!Mt(B)),R=()=>{if(!_t())return;const U={};if(st==="local"){if(Ut.trim()&&(U.host=Ut.trim()),B.trim()){const W=Number(B);Number.isInteger(W)&&(U.port=W)}}else if(st==="ssh"){if(U.host=Ut.trim(),lt.trim()&&(U.user=lt.trim()),B.trim()){const W=Number(B);Number.isInteger(W)&&(U.sshPort=W)}ve.trim()&&(U.identityFile=ve.trim())}else st==="docker"?(mt.trim()&&(U.image=mt.trim()),yt.trim()&&(U.repo=yt.trim())):st==="codespace"&&(U.codespaceName=I.trim());v(w.trim(),st,U,zt),K("Environment added successfully","success"),$(""),ht("local"),tt("claude-code"),wt(""),Q(""),At(""),Qt(""),bt(""),ae(""),tn(""),Wt(""),ze("pick"),i({kind:"settings"})};return d.jsxs("div",{className:rt.barColumn,children:[d.jsxs("div",{className:rt.barRow,children:[d.jsx("span",{className:rt.badge,children:"new env"}),d.jsx("input",{type:"text",value:w,onChange:U=>$(U.target.value),placeholder:"Environment name...",autoFocus:!0,className:rt.input}),d.jsxs("select",{value:st,onChange:U=>{ht(U.target.value),U.target.value==="codespace"&&(k(),ze("pick"),ae(""))},className:rt.select,children:[d.jsx("option",{value:"local",children:"local"}),d.jsx("option",{value:"ssh",children:"ssh"}),d.jsx("option",{value:"docker",children:"docker"}),d.jsx("option",{value:"codespace",children:"codespace"})]}),d.jsx(Tv,{value:zt,onChange:tt,testId:"new-environment-runtime-select"}),d.jsx("button",{onClick:R,disabled:!_t(),className:rt.btnPrimary,children:"Add"})]}),d.jsxs("div",{className:rt.barRow,children:[st==="local"&&d.jsxs(d.Fragment,{children:[d.jsx("input",{type:"text",value:Ut,onChange:U=>wt(U.target.value),placeholder:"Host (optional)...",className:rt.inputSmall}),d.jsx("input",{type:"number",min:1,max:65535,value:B,onChange:U=>Q(U.target.value),placeholder:"Port (optional)...",className:rt.inputSmall})]}),st==="ssh"&&d.jsxs(d.Fragment,{children:[d.jsx("input",{type:"text",value:Ut,onChange:U=>wt(U.target.value),placeholder:"Host (required)...",className:rt.inputSmall}),d.jsx("input",{type:"text",value:lt,onChange:U=>At(U.target.value),placeholder:"User (optional)...",className:rt.inputSmall}),d.jsx("input",{type:"number",min:1,max:65535,value:B,onChange:U=>Q(U.target.value),placeholder:"SSH port (optional)...",className:rt.inputSmall}),d.jsx("input",{type:"text",value:ve,onChange:U=>tn(U.target.value),placeholder:"Identity file (optional)...",className:rt.inputSmall})]}),st==="docker"&&d.jsxs(d.Fragment,{children:[d.jsx("input",{type:"text",value:mt,onChange:U=>Qt(U.target.value),placeholder:"Image (optional)...",className:rt.inputSmall}),d.jsx("input",{type:"text",value:yt,onChange:U=>bt(U.target.value),placeholder:"Repo (optional)...",className:rt.inputSmall})]}),st==="codespace"&&en==="pick"&&d.jsxs(d.Fragment,{children:[d.jsxs("select",{value:I,onChange:U=>{U.target.value==="__create__"?(ze("create"),ae("")):(ae(U.target.value),U.target.value&&!w.trim()&&$(U.target.value))},disabled:E,className:rt.select,children:[d.jsx("option",{value:"",children:"Select a codespace..."}),S.map(U=>d.jsxs("option",{value:U.name,children:[U.name," (",U.repository,") — ",U.state]},U.name)),d.jsx("option",{value:"__create__",children:"Create new from repo..."})]}),E&&d.jsx("span",{className:rt.creatingHint,children:"Creating codespace..."}),x&&d.jsx("span",{className:rt.errorHint,children:x})]}),st==="codespace"&&en==="create"&&d.jsxs(d.Fragment,{children:[d.jsx("input",{type:"text",value:Le,onChange:U=>Wt(U.target.value),placeholder:"owner/repo",className:rt.inputSmall}),d.jsx("button",{onClick:()=>{Le.trim()&&(q(Le.trim()),ze("pick"),Wt(""))},disabled:!Le.trim(),className:rt.btnPrimary,children:"Create"}),d.jsx("button",{onClick:()=>{ze("pick"),Wt("")},className:rt.btnGhost,children:"Cancel"})]})]})]})}if(a.kind==="project")return d.jsx("div",{className:rt.bar,children:d.jsx("span",{className:rt.hintText,children:"Select a task or click + to create one"})});if(a.kind==="new_task")return d.jsx(d.Fragment,{});if(a.kind==="task"&&Pt){if(Pt.status==="pending"||Pt.status==="assigned"){const Mt=F?Pt.dependsOn.map(_t=>f.find(R=>R.id===_t)).filter(_t=>_t&&_t.status!=="done").map(_t=>_t.title):[];return d.jsx("div",{className:rt.bar,children:F?d.jsxs("span",{className:rt.statusBlocked,children:["Blocked by: ",Mt.join(", ")]}):d.jsx("span",{className:rt.hintText,children:"Use the buttons above to start or manage this task"})})}if(Pt.status==="in_progress"||Pt.status==="waiting_input"){if((me==null?void 0:me.status)==="waiting_input"){const _t=me==null?void 0:me.environmentId,R=xv(_t,p),U=W=>{W.preventDefault(),!(!z.trim()||!Pt.latestSessionId||R)&&(o(Pt.latestSessionId,z),P(""))};return d.jsxs("form",{onSubmit:U,className:rt.bar,children:[R&&_t&&d.jsx(jv,{environmentId:_t,onReconnect:b}),d.jsx("input",{type:"text",value:z,onChange:W=>P(W.target.value),placeholder:"Type a message...",autoFocus:!R,disabled:R,className:rt.input}),d.jsx("span",{title:R?"Environment is unavailable — reconnect first":void 0,children:d.jsx("button",{type:"submit",disabled:!z.trim()||R,className:rt.btnPrimary,children:"Send"})})]})}return d.jsx("div",{className:rt.bar,children:d.jsx("input",{type:"text",disabled:!0,placeholder:"Agent is working...",className:rt.input})})}if(Pt.status==="review")return d.jsx("div",{className:rt.bar,children:d.jsx("span",{className:rt.hintText,children:"Review the changes above, then approve or reject in the header"})});if(Pt.status==="done")return d.jsxs("div",{className:rt.bar,children:[d.jsx("span",{className:`${rt.statusText} ${rt.statusCompleted}`,children:"Task completed"}),d.jsx("button",{onClick:()=>i({kind:"new_task",projectId:Pt.projectId}),className:rt.btnPrimary,children:"+ New Task"})]});if(Pt.status==="failed")return d.jsx("div",{className:rt.bar,children:d.jsx("span",{className:`${rt.statusText} ${rt.statusFailed}`,children:"Task failed"})})}if(a.kind==="new_chat"){const Mt=_t=>{_t.preventDefault(),z.trim()&&(l(a.environmentId,z,void 0,Y,X),K("Session started","success"),P(""),V(""))};return d.jsxs("form",{onSubmit:Mt,className:rt.bar,children:[d.jsx("span",{className:rt.badge,children:"new chat"}),d.jsx("input",{type:"text",value:z,onChange:_t=>P(_t.target.value),placeholder:"Enter prompt...",autoFocus:!0,className:rt.input}),d.jsx(Tv,{value:Y,onChange:nt,testId:"new-chat-runtime-select"}),d.jsxs("select",{value:X,onChange:_t=>et(_t.target.value),className:rt.select,children:[d.jsx("option",{value:"",children:"No persona"}),g.map(_t=>d.jsx("option",{value:_t.id,children:_t.name},_t.id))]}),d.jsx("button",{type:"submit",disabled:!z.trim(),className:rt.btnPrimary,children:"Go"})]})}if(a.kind==="session"){const Mt=(Gt==null?void 0:Gt.status)==="running",_t=(Gt==null?void 0:Gt.status)==="waiting_input",R=Gt!==void 0&&["completed","failed","killed"].includes(Gt.status);if(Mt)return d.jsxs("div",{className:rt.bar,children:[d.jsx("input",{type:"text",disabled:!0,placeholder:"Agent is working...",className:rt.input}),d.jsx("button",{onClick:()=>u(a.sessionId),className:rt.btnDanger,title:"Stop session",children:"Stop"})]});if(_t){const U=xv(Gt==null?void 0:Gt.environmentId,p),W=ct=>{ct.preventDefault(),!(!z.trim()||U)&&(o(a.sessionId,z),P(""))};return d.jsxs("form",{onSubmit:W,className:rt.bar,children:[U&&(Gt==null?void 0:Gt.environmentId)&&d.jsx(jv,{environmentId:Gt.environmentId,onReconnect:b}),d.jsx("input",{type:"text",value:z,onChange:ct=>P(ct.target.value),placeholder:"Type a message...",autoFocus:!U,disabled:U,className:rt.input}),d.jsx("span",{title:U?"Environment is unavailable — reconnect first":void 0,children:d.jsx("button",{type:"submit",disabled:!z.trim()||U,className:rt.btnPrimary,children:"Send"})}),d.jsx("button",{type:"button",onClick:()=>u(a.sessionId),className:rt.btnDanger,title:"Stop session",children:"Stop"})]})}if(R&&Gt)return d.jsxs("div",{className:rt.bar,children:[d.jsxs("span",{className:`${rt.statusText} ${rt.hintText}`,children:["Session ",Gt.status]}),d.jsx("button",{onClick:()=>i({kind:"new_chat",environmentId:Gt.environmentId,runtime:Gt.runtime}),className:rt.btnPrimary,children:"+ New Chat"})]})}return d.jsx("div",{className:rt.bar,children:d.jsx("span",{className:rt.hintText,children:"Loading..."})})}const nN="_container_654kj_1",aN="_emptyState_654kj_8",sN="_card_654kj_14",iN="_cardHeader_654kj_34",lN="_categoryBadge_654kj_41",oN="_findingTitle_654kj_49",rN="_findingDate_654kj_55",cN="_findingContent_654kj_61",uN="_tags_654kj_67",dN="_tag_654kj_67",Qn={container:nN,emptyState:aN,card:sN,cardHeader:iN,categoryBadge:lN,findingTitle:oN,findingDate:rN,findingContent:cN,tags:uN,tag:dN};function fN(a){const i=new Date(a),l=new Date,o=l.getTime()-i.getTime(),u=Math.floor(o/1e3),h=Math.floor(u/60),f=Math.floor(h/60),p=Math.floor(f/24);if(u<60)return"just now";if(h<60)return`${h}m ago`;if(f<24)return`${f}h ago`;if(p===1)return"yesterday";if(p<7)return`${p} days ago`;const g=i.getFullYear()===l.getFullYear(),v=i.toLocaleString("en-US",{month:"short"}),b=i.getDate();return g?`${v} ${b}`:`${v} ${b} ${i.getFullYear()}`}const hN={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)"}},mN={text:"var(--text-secondary)",bg:"var(--bg-elevated)"};function pN({projectId:a}){const{findings:i}=Hn(),l=i.filter(o=>o.projectId===a);return l.length===0?d.jsx("div",{className:Qn.emptyState,children:"No findings yet. Agents will post discoveries here."}):d.jsx("div",{className:Qn.container,children:l.map((o,u)=>{const h=hN[o.category]||mN;return d.jsxs(Jn.div,{className:Qn.card,initial:{opacity:0,y:8},animate:{opacity:1,y:0},transition:{delay:u*.05,duration:.2},children:[d.jsxs("div",{className:Qn.cardHeader,children:[d.jsx("span",{className:Qn.categoryBadge,style:{background:h.bg,color:h.text},children:o.category}),d.jsx("span",{className:Qn.findingTitle,children:o.title}),d.jsx("span",{className:Qn.findingDate,title:o.createdAt,children:fN(o.createdAt)})]}),d.jsx("div",{className:Qn.findingContent,children:o.content.length>300?o.content.slice(0,300)+"...":o.content}),o.tags.length>0&&d.jsx("div",{className:Qn.tags,children:o.tags.map(f=>d.jsx("span",{className:Qn.tag,style:{color:h.text,textShadow:`0 0 8px ${h.text}`},children:f},f))})]},o.id)})})}const gN="_container_bge4k_1",vN="_header_bge4k_5",yN="_headerLabel_bge4k_12",bN="_addButton_bge4k_20",SN="_envRow_bge4k_55",_N="_targeted_bge4k_69",TN="_expanded_bge4k_72",xN="_statusDot_bge4k_76",jN="_pulse_bge4k_79",AN="_envName_bge4k_83",NN="_envActions_bge4k_87",EN="_idleLabel_bge4k_94",CN="_newChatButton_bge4k_99",DN="_envActionsRow_bge4k_126",kN="_connectButton_bge4k_134",wN="_stopButton_bge4k_160",MN="_deleteButton_bge4k_186",RN="_provisionMessage_bge4k_213",ON="_errorMessage_bge4k_220",zN="_sessionRow_bge4k_227",BN="_selected_bge4k_243",UN="_sessionDot_bge4k_248",VN="_sessionSummaryRow_bge4k_252",LN="_sessionExpandArrow_bge4k_272",qN="_sessionSummaryText_bge4k_283",HN="_sessionCountBadge_bge4k_290",GN="_emptyCta_bge4k_313",IN="_ctaDescription_bge4k_326",YN="_ctaButton_bge4k_332",Kt={container:gN,header:vN,headerLabel:yN,addButton:bN,envRow:SN,targeted:_N,expanded:TN,statusDot:xN,pulse:jN,envName:AN,envActions:NN,idleLabel:EN,newChatButton:CN,envActionsRow:DN,connectButton:kN,stopButton:wN,deleteButton:MN,provisionMessage:RN,errorMessage:ON,sessionRow:zN,selected:BN,sessionDot:UN,sessionSummaryRow:VN,sessionExpandArrow:LN,sessionSummaryText:qN,sessionCountBadge:HN,emptyCta:GN,ctaDescription:IN,ctaButton:YN},ZN={connected:"var(--accent-green)",sleeping:"var(--accent-yellow)",error:"var(--accent-red)",disconnected:"var(--text-tertiary)",connecting:"var(--accent-blue)"},KN={running:"running",waiting_input:"awaiting input",failed:"failed",killed:"killed",completed:"completed"},Av=["running","waiting_input","failed","killed","completed"],XN=.2;function QN(a){const i={};for(const h of a)i[h.status]=(i[h.status]||0)+1;const l=Av.filter(h=>i[h]>0).map(h=>`${i[h]} ${KN[h]||h}`),o=new Set(Av),u=Object.keys(i).filter(h=>!o.has(h)).sort().map(h=>`${i[h]} ${h}`);return[...l,...u].join(", ")}function PN({status:a}){const i=a==="running"?"var(--accent-green)":a==="waiting_input"?"var(--accent-yellow)":a==="completed"?"var(--text-secondary)":a==="failed"||a==="killed"?"var(--accent-red)":"var(--text-tertiary)";return d.jsx("span",{className:Kt.sessionDot,style:{color:i},children:"●"})}function FN({env:a,envSessions:i,selectedSessionId:l,isNewChatTarget:o,expanded:u,onToggleExpand:h,sessionsExpanded:f,onToggleSessionsExpand:p,provisionProgress:g,onProvision:v,onStop:b,onRemove:S,setViewMode:x}){const[E,k]=_.useState(!1),q=ZN[a.status]||"var(--text-tertiary)",K=a.status==="connected",z=a.status==="connecting",P=a.status==="disconnected"||a.status==="error";return d.jsxs("div",{children:[d.jsx(pr,{isOpen:E,title:"Delete Environment?",description:`"${a.displayName||a.id}" will be permanently removed. This destroys the workspace and removes all data.`,onConfirm:()=>{S(a.id),k(!1)},onCancel:()=>k(!1)}),d.jsxs("div",{className:`${Kt.envRow} ${o?Kt.targeted:""} ${u?Kt.expanded:""}`,"data-testid":"env-row",onClick:h,children:[d.jsx("span",{className:`${Kt.statusDot} ${K?Kt.pulse:""}`,style:{color:q},children:"●"}),d.jsx("span",{className:Kt.envName,title:a.displayName||a.id,children:a.displayName||a.id}),d.jsxs("span",{className:Kt.envActions,children:[i.length===0&&!o&&!u&&d.jsx("span",{className:Kt.idleLabel,children:"(idle)"}),K&&d.jsx("button",{onClick:Y=>{Y.stopPropagation(),x({kind:"new_chat",environmentId:a.id,runtime:a.defaultRuntime||"claude-code"})},title:"New chat",className:Kt.newChatButton,children:"+"})]})]}),u&&d.jsxs("div",{className:Kt.envActionsRow,children:[z&&g&&d.jsx("span",{className:Kt.provisionMessage,children:g.message}),a.status==="error"&&(g==null?void 0:g.stage)==="error"&&d.jsx("span",{className:Kt.errorMessage,children:g.message}),P&&d.jsx("button",{onClick:Y=>{Y.stopPropagation(),v(a.id)},className:Kt.connectButton,children:a.status==="error"?"Retry":"Connect"}),K&&d.jsx("button",{onClick:Y=>{Y.stopPropagation(),b(a.id)},className:Kt.stopButton,children:"Stop"}),!z&&d.jsx("button",{onClick:Y=>{Y.stopPropagation(),k(!0)},className:Kt.deleteButton,children:"Delete"})]}),i.length>0&&d.jsxs(d.Fragment,{children:[d.jsxs("div",{className:Kt.sessionSummaryRow,"data-testid":"session-summary-row",role:"button",tabIndex:0,"aria-expanded":f,"aria-label":f?"Collapse sessions":"Expand sessions",onClick:p,onKeyDown:Y=>{(Y.key==="Enter"||Y.key===" ")&&(Y.preventDefault(),p())},children:[d.jsx("span",{className:`${Kt.sessionExpandArrow} ${f?Kt.expanded:""}`,children:"▸"}),d.jsx("span",{className:Kt.sessionSummaryText,children:QN(i)}),d.jsx("span",{className:Kt.sessionCountBadge,children:i.length})]}),d.jsx(bi,{children:f&&d.jsx(Jn.div,{initial:{height:0,opacity:0},animate:{height:"auto",opacity:1},exit:{height:0,opacity:0},transition:{duration:XN,ease:"easeInOut"},style:{overflow:"hidden"},children:i.map(Y=>d.jsxs("div",{onClick:nt=>{nt.stopPropagation(),x({kind:"session",sessionId:Y.id})},className:`${Kt.sessionRow} ${l===Y.id?Kt.selected:""}`,title:Y.prompt,"data-testid":"session-row",children:[d.jsx(PN,{status:Y.status})," ",Y.prompt.length>24?Y.prompt.slice(0,24)+"...":Y.prompt]},Y.id))})})]})]})}function JN({viewMode:a,setViewMode:i}){const{environments:l,sessions:o,provisionStatus:u,provisionEnvironment:h,stopEnvironment:f,removeEnvironment:p}=Hn(),[g,v]=_.useState(null),[b,S]=_.useState(new Set),x=a.kind==="session"?a.sessionId:void 0,E=a.kind==="new_chat"?a.environmentId:void 0;return d.jsxs("div",{className:Kt.container,children:[d.jsxs("div",{className:Kt.header,children:[d.jsx("span",{className:Kt.headerLabel,children:"Environments"}),d.jsx("button",{className:Kt.addButton,onClick:()=>i({kind:"new_environment"}),title:"Add environment",children:"+ Add Environment"})]}),l.length===0&&d.jsxs("div",{className:Kt.emptyCta,children:[d.jsx("button",{className:Kt.ctaButton,onClick:()=>i({kind:"new_environment"}),children:"Add Environment"}),d.jsx("div",{className:Kt.ctaDescription,children:"Connect an environment to run agents"})]}),l.map(k=>{const q=o.filter(K=>K.environmentId===k.id);return d.jsx(FN,{env:k,envSessions:q,selectedSessionId:x,isNewChatTarget:E===k.id,expanded:g===k.id,onToggleExpand:()=>v(g===k.id?null:k.id),sessionsExpanded:b.has(k.id),onToggleSessionsExpand:()=>{S(K=>{const z=new Set(K);return z.has(k.id)?z.delete(k.id):z.add(k.id),z})},provisionProgress:u[k.id],onProvision:h,onStop:f,onRemove:p,setViewMode:i},k.id)})]})}const $N="_container_ifz7r_1",WN="_heading_ifz7r_7",tE="_section_ifz7r_14",eE="_sectionTitle_ifz7r_26",nE="_sectionDescription_ifz7r_35",aE="_tokenList_ifz7r_48",sE="_tokenRow_ifz7r_55",iE="_tokenBadge_ifz7r_68",lE="_tokenName_ifz7r_83",oE="_tokenTarget_ifz7r_90",rE="_deleteButton_ifz7r_99",cE="_addForm_ifz7r_113",uE="_formRow_ifz7r_119",dE="_input_ifz7r_125",fE="_select_ifz7r_155",hE="_addButton_ifz7r_187",mE="_emptyStateInfo_ifz7r_221",pE="_themeOptions_ifz7r_229",gE="_themeOption_ifz7r_229",vE="_themeOptionSelected_ifz7r_254",yE="_themeOptionLabel_ifz7r_259",bE="_themeOptionDesc_ifz7r_265",SE="_themeActive_ifz7r_270",Ht={container:$N,heading:WN,section:tE,sectionTitle:eE,sectionDescription:nE,tokenList:aE,tokenRow:sE,tokenBadge:iE,tokenName:lE,tokenTarget:oE,deleteButton:rE,addForm:cE,formRow:uE,input:dE,select:fE,addButton:hE,emptyStateInfo:mE,themeOptions:pE,themeOption:gE,themeOptionSelected:vE,themeOptionLabel:yE,themeOptionDesc:bE,themeActive:SE},_E=[{value:"env_var",label:"Environment Variable"},{value:"file",label:"File"}];function TE({viewMode:a,setViewMode:i}){const{tokens:l,setToken:o,deleteToken:u}=Hn(),{showToast:h}=gr(),{themeId:f,resolvedThemeId:p,setTheme:g}=_S(),[v,b]=_.useState(""),[S,x]=_.useState(""),[E,k]=_.useState("env_var"),[q,K]=_.useState(""),[z,P]=_.useState(null),Y=V=>{if(V.preventDefault(),!v||!S)return;const et=E==="env_var"?q||v.toUpperCase()+"_TOKEN":"";o(v,S,E,et,E==="file"?q:""),h("Token saved successfully","success"),b(""),x(""),K("")},nt=V=>{P(V)},X=()=>{z&&(u(z),h("Token deleted","info")),P(null)};return d.jsxs("div",{className:Ht.container,children:[d.jsx(pr,{isOpen:z!==null,title:"Delete Token?",description:z?`"${z}" will be permanently removed.`:void 0,onConfirm:X,onCancel:()=>P(null)}),d.jsx("h2",{className:Ht.heading,children:"Settings"}),d.jsxs("section",{className:Ht.section,children:[d.jsx("h3",{className:Ht.sectionTitle,children:"Appearance"}),d.jsx("p",{className:Ht.sectionDescription,children:"Choose how Grackle looks across the app."}),d.jsx("div",{className:Ht.themeOptions,children:pd.map(V=>{const et=f===V.id;return d.jsxs("button",{type:"button",className:`${Ht.themeOption} ${et?Ht.themeOptionSelected:""}`,"aria-pressed":et,onClick:()=>g(V.id),children:[d.jsx("span",{className:Ht.themeOptionLabel,children:V.label}),d.jsx("span",{className:Ht.themeOptionDesc,children:V.description})]},V.id)})}),d.jsxs("p",{className:Ht.themeActive,children:["Active theme: ",d.jsx("strong",{children:p})]})]}),d.jsxs("section",{className:Ht.section,children:[d.jsx("h3",{className:Ht.sectionTitle,children:"Environments"}),d.jsx("p",{className:Ht.sectionDescription,children:"Environments are compute workspaces where agents run. Configure once, reuse across projects."}),d.jsx(JN,{viewMode:a,setViewMode:i})]}),d.jsxs("section",{className:Ht.section,children:[d.jsx("h3",{className:Ht.sectionTitle,children:"Tokens"}),d.jsx("p",{className:Ht.sectionDescription,children:"API tokens are auto-pushed to environments when set or updated. Values are write-only."}),l.length===0?d.jsx("div",{className:Ht.emptyStateInfo,children:"Add your first API token to enable service integrations."}):d.jsx("div",{className:Ht.tokenList,children:l.map(V=>d.jsxs("div",{className:Ht.tokenRow,children:[d.jsx("span",{className:Ht.tokenBadge,children:V.tokenType}),d.jsx("span",{className:Ht.tokenName,children:V.name}),d.jsx("span",{className:Ht.tokenTarget,children:V.tokenType==="env_var"?V.envVar:V.filePath}),d.jsx("button",{className:Ht.deleteButton,onClick:()=>nt(V.name),title:`Delete ${V.name}`,children:"×"})]},V.name))}),d.jsxs("form",{className:Ht.addForm,onSubmit:Y,children:[d.jsxs("div",{className:Ht.formRow,children:[d.jsx("input",{className:Ht.input,type:"text",placeholder:"Token name",value:v,onChange:V=>b(V.target.value)}),d.jsx("input",{className:Ht.input,type:"password",placeholder:"Value",value:S,onChange:V=>x(V.target.value)})]}),d.jsxs("div",{className:Ht.formRow,children:[d.jsx("select",{className:Ht.select,value:E,onChange:V=>k(V.target.value),children:_E.map(V=>d.jsx("option",{value:V.value,children:V.label},V.value))}),d.jsx("input",{className:Ht.input,type:"text",placeholder:E==="env_var"?"Env var name (e.g. API_TOKEN)":"File path (e.g. /home/user/.token)",value:q,onChange:V=>K(V.target.value)}),d.jsx("button",{className:Ht.addButton,type:"submit",children:"Add Token"})]})]})]})]})}const xE="_container_1m894_1",jE="_header_1m894_8",AE="_headerTitle_1m894_35",NE="_badge_1m894_44",EE="_headerActions_1m894_54",CE="_body_1m894_61",DE="_formContent_1m894_68",kE="_section_1m894_75",wE="_label_1m894_81",ME="_titleInput_1m894_88",RE="_descriptionTextarea_1m894_121",OE="_parentContext_1m894_157",zE="_parentLabel_1m894_165",BE="_parentName_1m894_172",UE="_depList_1m894_210",VE="_depItem_1m894_216",LE="_depItemSelected_1m894_238",qE="_noDeps_1m894_242",HE="_btnPrimary_1m894_248",GE="_btnGhost_1m894_279",he={container:xE,header:jE,headerTitle:AE,badge:NE,headerActions:EE,body:CE,formContent:DE,section:kE,label:wE,titleInput:ME,descriptionTextarea:RE,parentContext:OE,parentLabel:zE,parentName:BE,depList:UE,depItem:VE,depItemSelected:LE,noDeps:qE,btnPrimary:HE,btnGhost:GE};function Nv({viewMode:a,setViewMode:i}){const{tasks:l,createTask:o,updateTask:u}=Hn(),{showToast:h}=gr(),f=a.kind==="edit_task",p=f?l.find(w=>w.id===a.taskId):void 0,g=f?(p==null?void 0:p.projectId)??"":a.projectId,v=f?(p==null?void 0:p.parentTaskId)??"":a.kind==="new_task"?a.parentTaskId??"":"",b=v?l.find(w=>w.id===v):void 0,[S,x]=_.useState((p==null?void 0:p.title)??""),[E,k]=_.useState((p==null?void 0:p.description)??""),[q,K]=_.useState((p==null?void 0:p.dependsOn)??[]),z=_.useRef(!1);_.useEffect(()=>{f&&p&&!z.current&&(z.current=!0,x(p.title),k(p.description??""),K(p.dependsOn??[]))},[f,p]);const P=l.filter(w=>w.projectId===g&&(!f||w.id!==a.taskId)&&w.id!==v),Y=S.trim().length>0&&(!f||p!==void 0),nt=w=>{K($=>$.includes(w)?$.filter(st=>st!==w):[...$,w])},X=()=>{Y&&(f&&p===void 0||(f?(u(a.taskId,S.trim(),E,q),h("Task updated","success"),i({kind:"task",taskId:a.taskId})):(o(g,S.trim(),E,q.length>0?q:void 0,v||void 0),h("Task created","success"),i({kind:"project",projectId:g}))))},V=()=>{i(f?{kind:"task",taskId:a.taskId}:{kind:"project",projectId:g})},et=f?"edit task":v?"child task":"new task";return d.jsxs("div",{className:he.container,children:[d.jsxs("div",{className:he.header,children:[d.jsxs("div",{className:he.headerTitle,children:[d.jsx("span",{className:he.badge,children:et}),b&&d.jsxs("span",{className:he.parentContext,children:[d.jsx("span",{className:he.parentLabel,children:"Child of"}),d.jsx("span",{className:he.parentName,children:b.title})]})]}),d.jsxs("div",{className:he.headerActions,children:[d.jsx("button",{onClick:X,disabled:!Y,className:he.btnPrimary,"data-testid":"task-edit-save",children:f?"Save Changes":"Create"}),d.jsx("button",{onClick:V,className:he.btnGhost,children:"Cancel"})]})]}),d.jsx("div",{className:he.body,children:d.jsxs("div",{className:he.formContent,children:[d.jsxs("div",{className:he.section,children:[d.jsx("label",{className:he.label,htmlFor:"task-edit-title",children:"Title"}),d.jsx("input",{id:"task-edit-title",type:"text",value:S,onChange:w=>x(w.target.value),placeholder:"Task title...",autoFocus:!0,className:he.titleInput,"data-testid":"task-edit-title",onKeyDown:w=>{w.key==="Enter"&&Y&&X()}})]}),d.jsxs("div",{className:he.section,children:[d.jsx("label",{className:he.label,htmlFor:"task-edit-description",children:"Description"}),d.jsx("textarea",{id:"task-edit-description",value:E,onChange:w=>k(w.target.value),placeholder:"Describe the task... (markdown supported)",className:he.descriptionTextarea,"data-testid":"task-edit-description",rows:8})]}),d.jsxs("div",{className:he.section,children:[d.jsx("div",{className:he.label,children:"Dependencies"}),P.length===0?d.jsx("div",{className:he.noDeps,children:"No other tasks in this project"}):d.jsx("div",{className:he.depList,children:P.map(w=>{const $=q.includes(w.id);return d.jsxs("label",{className:`${he.depItem} ${$?he.depItemSelected:""}`,"data-testid":`dep-option-${w.id}`,children:[d.jsx("input",{type:"checkbox",checked:$,onChange:()=>nt(w.id)}),w.title,d.jsxs("span",{style:{opacity:.5,fontSize:"11px",marginLeft:"4px"},children:["(",w.status,")"]})]},w.id)})})]})]})})]})}const IE="_container_1xczq_1",YE="_header_1xczq_7",ZE="_form_1xczq_19",KE="_formActions_1xczq_87",XE="_list_1xczq_93",QE="_card_1xczq_99",PE="_active_1xczq_109",FE="_cardHeader_1xczq_113",JE="_cardActions_1xczq_123",$E="_description_1xczq_128",WE="_meta_1xczq_134",tC="_promptDetails_1xczq_151",eC="_promptText_1xczq_163",nC="_empty_1xczq_180",aC="_btnPrimary_1xczq_186",sC="_btnSecondary_1xczq_220",iC="_btnSmall_1xczq_247",lC="_btnDanger_1xczq_273",je={container:IE,header:YE,form:ZE,formActions:KE,list:XE,card:QE,active:PE,cardHeader:FE,cardActions:JE,description:$E,meta:WE,promptDetails:tC,promptText:eC,empty:nC,btnPrimary:aC,btnSecondary:sC,btnSmall:iC,btnDanger:lC};function oC(){const{personas:a,createPersona:i,updatePersona:l,deletePersona:o}=Hn(),[u,h]=_.useState(null),[f,p]=_.useState(!1),[g,v]=_.useState(null),[b,S]=_.useState(""),[x,E]=_.useState(""),[k,q]=_.useState(""),[K,z]=_.useState(""),[P,Y]=_.useState(""),[nt,X]=_.useState(0),V=()=>{S(""),E(""),q(""),z(""),Y(""),X(0)},et=()=>{V(),h(null),p(!0)},w=tt=>{S(tt.name),E(tt.description),q(tt.systemPrompt),z(tt.runtime),Y(tt.model),X(tt.maxTurns),h(tt),p(!1)},$=tt=>{tt.preventDefault(),!(!b.trim()||!k.trim())&&(u?(l(u.id,b,x,k,K,P,nt),h(null)):(i(b,x,k,K,P,nt),p(!1)),V())},st=tt=>{o(tt),v(null),(u==null?void 0:u.id)===tt&&(h(null),V())},ht=()=>{h(null),p(!1),V()},zt=()=>d.jsxs("form",{onSubmit:$,className:je.form,children:[d.jsx("h3",{children:u?"Edit Persona":"Create Persona"}),d.jsxs("label",{children:["Name",d.jsx("input",{type:"text",value:b,onChange:tt=>S(tt.target.value),placeholder:"e.g. Frontend Engineer",required:!0})]}),d.jsxs("label",{children:["Description",d.jsx("input",{type:"text",value:x,onChange:tt=>E(tt.target.value),placeholder:"Brief description..."})]}),d.jsxs("label",{children:["Runtime",d.jsxs("select",{value:K,onChange:tt=>z(tt.target.value),children:[d.jsx("option",{value:"",children:"Default"}),d.jsx("option",{value:"claude-code",children:"claude-code"}),d.jsx("option",{value:"codex",children:"codex"}),d.jsx("option",{value:"copilot",children:"copilot"})]})]}),d.jsxs("label",{children:["Model",d.jsx("input",{type:"text",value:P,onChange:tt=>Y(tt.target.value),placeholder:"e.g. sonnet"})]}),d.jsxs("label",{children:["Max Turns",d.jsx("input",{type:"number",value:nt,onChange:tt=>X(parseInt(tt.target.value,10)||0),min:0})]}),d.jsxs("label",{children:["System Prompt",d.jsx("textarea",{value:k,onChange:tt=>q(tt.target.value),placeholder:"You are a senior frontend engineer...",rows:10,required:!0})]}),d.jsxs("div",{className:je.formActions,children:[d.jsx("button",{type:"submit",className:je.btnPrimary,children:u?"Save":"Create"}),d.jsx("button",{type:"button",onClick:ht,className:je.btnSecondary,children:"Cancel"})]})]});return d.jsxs("div",{className:je.container,children:[d.jsxs("div",{className:je.header,children:[d.jsx("h2",{children:"Personas"}),d.jsx("button",{onClick:et,className:je.btnPrimary,children:"+ New Persona"})]}),(f||u)&&zt(),a.length===0&&!f?d.jsx("p",{className:je.empty,children:"No personas yet. Create one to get started."}):d.jsx("div",{className:je.list,children:a.map(tt=>d.jsxs("div",{className:`${je.card} ${(u==null?void 0:u.id)===tt.id?je.active:""}`,children:[d.jsxs("div",{className:je.cardHeader,children:[d.jsx("strong",{children:tt.name}),d.jsxs("div",{className:je.cardActions,children:[d.jsx("button",{onClick:()=>w(tt),className:je.btnSmall,children:"Edit"}),g===tt.id?d.jsxs(d.Fragment,{children:[d.jsx("button",{onClick:()=>st(tt.id),className:je.btnDanger,children:"Confirm"}),d.jsx("button",{onClick:()=>v(null),className:je.btnSmall,children:"Cancel"})]}):d.jsx("button",{onClick:()=>v(tt.id),className:je.btnSmall,children:"Delete"})]})]}),tt.description&&d.jsx("p",{className:je.description,children:tt.description}),d.jsxs("div",{className:je.meta,children:[tt.runtime&&d.jsxs("span",{children:["Runtime: ",tt.runtime]}),tt.model&&d.jsxs("span",{children:["Model: ",tt.model]}),tt.maxTurns>0&&d.jsxs("span",{children:["Max turns: ",tt.maxTurns]})]}),d.jsxs("details",{className:je.promptDetails,children:[d.jsx("summary",{children:"System Prompt"}),d.jsx("pre",{className:je.promptText,children:tt.systemPrompt})]})]},tt.id))})]})}const Ev=220,Cv=70,rC=40,cC=60,uC="hierarchy",dC="dependency";function fC(a){return _.useMemo(()=>{if(a.length===0)return{nodes:[],edges:[]};const i=new Hp.graphlib.Graph({multigraph:!0});i.setDefaultEdgeLabel(()=>({})),i.setGraph({rankdir:"TB",nodesep:rC,ranksep:cC});const l=new Map(a.map(f=>[f.id,f])),o=new Map;for(const f of a)if(f.parentTaskId&&l.has(f.parentTaskId)){const p=o.get(f.parentTaskId)||[];p.push(f),o.set(f.parentTaskId,p)}for(const f of a)i.setNode(f.id,{width:Ev,height:Cv});const u=[];for(const f of a){if(f.parentTaskId&&l.has(f.parentTaskId)){const p=`hierarchy-${f.parentTaskId}-${f.id}`;i.setEdge(f.parentTaskId,f.id,{},p),u.push({id:p,source:f.parentTaskId,target:f.id,type:"smoothstep",data:{edgeType:uC},style:{stroke:"var(--accent-green)",strokeWidth:2},animated:!1})}for(const p of f.dependsOn)if(l.has(p)){const g=`dependency-${p}-${f.id}`;i.setEdge(p,f.id,{},g),u.push({id:g,source:p,target:f.id,type:"smoothstep",data:{edgeType:dC},style:{stroke:"var(--text-tertiary)",strokeWidth:1.5,strokeDasharray:"6 3"},animated:!1})}}return Hp.layout(i),{nodes:a.map(f=>{const p=i.node(f.id),g=o.get(f.id)||[];return{id:f.id,type:"task",position:{x:p.x-Ev/2,y:p.y-Cv/2},data:{task:f,childCount:g.length,doneChildCount:g.filter(v=>v.status==="done").length,hasDependencies:f.dependsOn.length>0}}}),edges:u}},[a])}const hC="_dagContainer_iuddu_1",mC="_taskNode_iuddu_26",pC="_taskNodeBorder_iuddu_48",gC="_taskNodeContent_iuddu_54",vC="_taskNodeHeader_iuddu_64",yC="_taskNodeIcon_iuddu_71",bC="_taskNodeTitle_iuddu_76",SC="_taskNodeBadges_iuddu_84",_C="_childBadge_iuddu_89",TC="_depBadge_iuddu_101",xC="_handle_iuddu_113",jC="_emptyCta_iuddu_120",AC="_ctaDescription_iuddu_131",NC="_ctaButton_iuddu_138",$e={dagContainer:hC,taskNode:mC,taskNodeBorder:pC,taskNodeContent:gC,taskNodeHeader:vC,taskNodeIcon:yC,taskNodeTitle:bC,taskNodeBadges:SC,childBadge:_C,depBadge:TC,handle:xC,emptyCta:jC,ctaDescription:AC,ctaButton:NC},Dv={pending:{color:"var(--text-tertiary)",icon:"○"},assigned:{color:"var(--accent-blue)",icon:"◎"},in_progress:{color:"var(--accent-green)",icon:"●"},review:{color:"var(--accent-yellow)",icon:"◉"},done:{color:"var(--accent-green)",icon:"✓"},failed:{color:"var(--accent-red)",icon:"✗"},waiting_input:{color:"var(--accent-yellow)",icon:"⧖"}};function EC({data:a}){const{task:i,childCount:l,doneChildCount:o,hasDependencies:u}=a,h=Dv[i.status]||Dv.pending;return d.jsxs("div",{className:$e.taskNode,"data-task-id":i.id,"data-task-title":i.title,children:[d.jsx(Gp,{type:"target",position:Ip.Top,className:$e.handle}),d.jsx("div",{className:$e.taskNodeBorder,style:{backgroundColor:h.color}}),d.jsxs("div",{className:$e.taskNodeContent,children:[d.jsxs("div",{className:$e.taskNodeHeader,children:[d.jsx("span",{className:$e.taskNodeIcon,style:{color:h.color},children:h.icon}),d.jsx("span",{className:$e.taskNodeTitle,children:i.title})]}),d.jsxs("div",{className:$e.taskNodeBadges,children:[l>0&&d.jsxs("span",{className:$e.childBadge,children:[o,"/",l]}),u&&d.jsx("span",{className:$e.depBadge,children:"dep"})]})]}),d.jsx(Gp,{type:"source",position:Ip.Bottom,className:$e.handle})]})}const kv={pending:"#6b7a8d",assigned:"#70a1ff",in_progress:"#4ecca3",review:"#f0c040",done:"#4ecca3",failed:"#e94560",waiting_input:"#f0c040"},CC={task:EC};function DC({projectId:a,setViewMode:i}){const{tasks:l}=Hn(),o=_.useMemo(()=>l.filter(g=>g.projectId===a),[l,a]),{nodes:u,edges:h}=fC(o),f=_.useCallback((g,v)=>{i({kind:"task",taskId:v.id})},[i]),p=_.useCallback(g=>{const v=g.data;return kv[v.task.status]||kv.pending},[]);return o.length===0?d.jsxs("div",{className:$e.emptyCta,children:[d.jsx("button",{className:$e.ctaButton,onClick:()=>i({kind:"new_task",projectId:a}),children:"Create Task"}),d.jsx("div",{className:$e.ctaDescription,children:"Create tasks to see the dependency graph"})]}):d.jsx("div",{className:$e.dagContainer,children:d.jsxs(Vb,{nodes:u,edges:h,nodeTypes:CC,onNodeClick:f,fitView:!0,fitViewOptions:{padding:.2},minZoom:.3,maxZoom:2,children:[d.jsx(Lb,{variant:qb.Dots,gap:24,size:1,color:"var(--text-disabled)"}),d.jsx(Hb,{showInteractive:!1}),d.jsx(Gb,{nodeColor:p,maskColor:"var(--bg-overlay)",style:{background:"var(--bg-inset)"}})]})})}const kC="_panelContainer_1fq0v_1",wC="_emptyState_1fq0v_8",MC="_projectSummary_1fq0v_17",RC="_projectSummaryTitle_1fq0v_28",OC="_projectSummarySubtitle_1fq0v_32",zC="_header_1fq0v_36",BC="_headerInfo_1fq0v_63",UC="_killButton_1fq0v_69",VC="_headerTitle_1fq0v_98",LC="_headerActions_1fq0v_108",qC="_taskStatusBadge_1fq0v_115",HC="_taskBranch_1fq0v_124",GC="_taskBlockedBadge_1fq0v_130",IC="_btnPrimary_1fq0v_138",YC="_btnDanger_1fq0v_169",ZC="_btnGhost_1fq0v_208",KC="_rejectInput_1fq0v_234",XC="_tabBar_1fq0v_264",QC="_tab_1fq0v_264",PC="_active_1fq0v_285",FC="_eventScroll_1fq0v_290",JC="_tabContent_1fq0v_296",$C="_noContext_1fq0v_301",WC="_overviewContent_1fq0v_307",tD="_overviewDashboard_1fq0v_316",eD="_overviewHero_1fq0v_322",nD="_statusBadge_1fq0v_329",aD="_statusPending_1fq0v_341",sD="_statusAssigned_1fq0v_346",iD="_statusInProgress_1fq0v_351",lD="_statusReview_1fq0v_356",oD="_statusDone_1fq0v_361",rD="_statusFailed_1fq0v_366",cD="_statusWaitingInput_1fq0v_371",uD="_overviewBranchPill_1fq0v_376",dD="_branchLink_1fq0v_391",fD="_overviewSection_1fq0v_402",hD="_overviewLabel_1fq0v_408",mD="_overviewValue_1fq0v_415",pD="_overviewMuted_1fq0v_420",gD="_overviewMarkdown_1fq0v_426",vD="_envRow_1fq0v_495",yD="_envDot_1fq0v_501",bD="_envDotGreen_1fq0v_508",SD="_envDotYellow_1fq0v_512",_D="_envDotRed_1fq0v_516",TD="_envDotGray_1fq0v_520",xD="_depList_1fq0v_524",jD="_depItem_1fq0v_530",AD="_depBlocked_1fq0v_537",ND="_depDone_1fq0v_541",ED="_timeline_1fq0v_545",CD="_timelineRow_1fq0v_551",DD="_timelineKey_1fq0v_558",kD="_timelineValue_1fq0v_564",wD="_timelineDelta_1fq0v_568",MD="_reviewNotes_1fq0v_579",RD="_waitingMessage_1fq0v_596",OD="_errorMessage_1fq0v_600",zD="_eventOverflowWarning_1fq0v_604",BD="_attemptSelector_1fq0v_618",UD="_attemptLabel_1fq0v_629",VD="_attemptButton_1fq0v_633",LD="_attemptActive_1fq0v_650",qD="_attemptStatus_1fq0v_656",HD="_emptyCta_1fq0v_662",GD="_ctaTitle_1fq0v_674",ID="_ctaDescription_1fq0v_680",YD="_ctaButton_1fq0v_687",ZD="_projectHeader_1fq0v_736",KD="_projectName_1fq0v_761",XD="_projectMeta_1fq0v_774",QD="_metaRow_1fq0v_782",PD="_metaLabel_1fq0v_789",FD="_metaValue_1fq0v_799",JD="_metaPlaceholder_1fq0v_809",$D="_editButton_1fq0v_814",WD="_editInput_1fq0v_830",tk="_editTextarea_1fq0v_862",ek="_editSelect_1fq0v_898",nk="_archiveButton_1fq0v_931",ak="_repoLink_1fq0v_961",sk="_metaValueClickable_1fq0v_971",ik="_editHint_1fq0v_990",lk="_editError_1fq0v_999",ok="_editInputInvalid_1fq0v_1006",rk="_unsavedDot_1fq0v_1011",ck="_metaToggle_1fq0v_1019",uk="_metaToggleArrow_1fq0v_1040",dk="_metaToggleArrowOpen_1fq0v_1045",fk="_progressBarContainer_1fq0v_1049",hk="_progressBar_1fq0v_1049",mk="_progressFill_1fq0v_1065",pk="_progressLabel_1fq0v_1072",gk="_metaTimestamps_1fq0v_1079",vk="_metaTimestamp_1fq0v_1079",yk="_editFieldWrapper_1fq0v_1095",A={panelContainer:kC,emptyState:wC,projectSummary:MC,projectSummaryTitle:RC,projectSummarySubtitle:OC,header:zC,headerInfo:BC,killButton:UC,headerTitle:VC,headerActions:LC,taskStatusBadge:qC,taskBranch:HC,taskBlockedBadge:GC,btnPrimary:IC,btnDanger:YC,btnGhost:ZC,rejectInput:KC,tabBar:XC,tab:QC,active:PC,eventScroll:FC,tabContent:JC,noContext:$C,overviewContent:WC,overviewDashboard:tD,overviewHero:eD,statusBadge:nD,statusPending:aD,statusAssigned:sD,statusInProgress:iD,statusReview:lD,statusDone:oD,statusFailed:rD,statusWaitingInput:cD,overviewBranchPill:uD,branchLink:dD,overviewSection:fD,overviewLabel:hD,overviewValue:mD,overviewMuted:pD,overviewMarkdown:gD,envRow:vD,envDot:yD,envDotGreen:bD,envDotYellow:SD,envDotRed:_D,envDotGray:TD,depList:xD,depItem:jD,depBlocked:AD,depDone:ND,timeline:ED,timelineRow:CD,timelineKey:DD,timelineValue:kD,timelineDelta:wD,reviewNotes:MD,waitingMessage:RD,errorMessage:OD,eventOverflowWarning:zD,attemptSelector:BD,attemptLabel:UD,attemptButton:VD,attemptActive:LD,attemptStatus:qD,emptyCta:HD,ctaTitle:GD,ctaDescription:ID,ctaButton:YD,projectHeader:ZD,projectName:KD,projectMeta:XD,metaRow:QD,metaLabel:PD,metaValue:FD,metaPlaceholder:JD,editButton:$D,editInput:WD,editTextarea:tk,editSelect:ek,archiveButton:nk,repoLink:ak,metaValueClickable:sk,editHint:ik,editError:lk,editInputInvalid:ok,unsavedDot:rk,metaToggle:ck,metaToggleArrow:uk,metaToggleArrowOpen:dk,progressBarContainer:fk,progressBar:hk,progressFill:mk,progressLabel:pk,metaTimestamps:gk,metaTimestamp:vk,editFieldWrapper:yk};function wv(a,i){const l=[];let o=a;const u=new Set;for(;o&&i.has(o)&&!u.has(o);){u.add(o);const h=i.get(o);l.unshift(h),o=h.parentTaskId||void 0}return l}function bk(a,i,l){const o={label:"Home",viewMode:{kind:"empty"}};switch(a.kind){case"empty":return[{label:"Home",viewMode:void 0}];case"settings":return[o,{label:"Settings",viewMode:void 0}];case"persona_management":return[o,{label:"Personas",viewMode:void 0}];case"new_environment":return[o,{label:"New Environment",viewMode:void 0}];case"project":{const u=i.find(h=>h.id===a.projectId);return[o,{label:(u==null?void 0:u.name)??"Project",viewMode:void 0}]}case"new_task":{const u=i.find(f=>f.id===a.projectId),h=[o,{label:(u==null?void 0:u.name)??"Project",viewMode:{kind:"project",projectId:a.projectId}}];if(a.parentTaskId){const f=wv(a.parentTaskId,l);for(const p of f)h.push({label:p.title,viewMode:{kind:"task",taskId:p.id}})}return h.push({label:"New Task",viewMode:void 0}),h}case"task":{const u=wv(a.taskId,l),h=l.get(a.taskId),f=h==null?void 0:h.projectId,p=f?i.find(b=>b.id===f):void 0,g=[o];p&&g.push({label:p.name,viewMode:{kind:"project",projectId:p.id}});for(let b=0;b<u.length-1;b++)g.push({label:u[b].title,viewMode:{kind:"task",taskId:u[b].id}});const v=u[u.length-1];return g.push({label:(v==null?void 0:v.title)??a.taskId,viewMode:void 0}),g}case"new_chat":return[o,{label:"New Chat",viewMode:void 0}];case"session":return[o,{label:`Session ${a.sessionId.slice(0,8)}`,viewMode:void 0}];default:return[{label:"Home",viewMode:void 0}]}}function Sk({sessionId:a,session:i,isActive:l,onKill:o}){return d.jsxs("div",{className:A.header,children:[d.jsxs("span",{children:["Session: ",a.slice(0,8),i&&` | ${i.runtime} | ${i.status}`]}),d.jsxs("span",{className:A.headerInfo,children:[i&&d.jsx("span",{children:i.prompt.length>60?i.prompt.slice(0,60)+"...":i.prompt}),l&&d.jsx("button",{onClick:()=>o(a),title:"Stop session",className:A.killButton,children:"×"})]})]})}function _y({eventsDropped:a}){return a<=0?d.jsx(d.Fragment,{}):d.jsxs("div",{className:A.eventOverflowWarning,role:"alert",children:["⚠ ",a.toLocaleString()," older event",a===1?"":"s"," were dropped — only the most recent 5,000 are shown. Full history is available in the session log."]})}function _k({sessionEvents:a,session:i,eventsDropped:l,scrollRef:o}){const u=i&&["completed","failed","killed"].includes(i.status),h=u?`Session ${i.status} with no events recorded.`:"Waiting for events...";return d.jsxs("div",{ref:o,className:A.eventScroll,children:[a.length===0&&d.jsx("div",{className:u?A.errorMessage:A.waitingMessage,children:h}),d.jsx(_y,{eventsDropped:l}),a.map((f,p)=>d.jsx(gy,{event:f,toolUseCtx:f.toolUseCtx},`${f.sessionId}-${f.timestamp}-${p}`))]})}function Tk(a){const i=[];for(const l of a){const o=i[i.length-1];l.eventType==="text"&&(o==null?void 0:o.eventType)==="text"?i[i.length-1]={...o,content:o.content+l.content}:i.push(l)}return i}function xk(a){const i=new Map;for(const h of a)if(h.raw)try{i.set(h,JSON.parse(h.raw))}catch{}const l=new Map;for(const h of a){if(h.eventType!=="tool_use")continue;const f=i.get(h);if(!(!f||typeof f.id!="string"))try{const p=JSON.parse(h.content);l.set(f.id,{tool:p.tool??"",args:p.args})}catch{}}const o=new Set;return a.map(h=>{if(h.eventType!=="tool_result")return h;const f=i.get(h);if(!f||typeof f.tool_use_id!="string")return h;const p=l.get(f.tool_use_id);return p?(o.add(f.tool_use_id),{...h,toolUseCtx:p}):h}).filter(h=>{if(h.eventType!=="tool_use")return!0;const f=i.get(h);return f&&typeof f.id=="string"?!o.has(f.id):!0})}function er(a){if(!a)return"—";const i=new Date(a);return isNaN(i.getTime())?"—":i.toLocaleString(void 0,{month:"short",day:"numeric",year:"numeric",hour:"2-digit",minute:"2-digit"})}function Xu(a,i){if(!a||!i)return;const l=new Date(i).getTime()-new Date(a).getTime();if(isNaN(l)||l<0)return;const o=Math.floor(l/6e4),u=Math.floor(l%6e4/1e3);if(o===0)return`${u}s`;const h=Math.floor(o/60),f=o%60;return h===0?`${o}m ${u}s`:`${h}h ${f}m`}function Ty(a){const i=a.toLowerCase();return i==="ready"||i==="running"||i==="available"||i==="connected"?A.envDotGreen:i==="provisioning"||i==="starting"||i==="pending"||i==="connecting"?A.envDotYellow:i==="error"||i==="failed"||i==="disconnected"?A.envDotRed:A.envDotGray}function Mv(a){if(!a)return"";const i=new Date(a);if(isNaN(i.getTime()))return"";const o=Date.now()-i.getTime();if(o<0)return"just now";const u=Math.floor(o/6e4);if(u<1)return"just now";if(u<60)return`${u}m ago`;const h=Math.floor(u/60);if(h<24)return`${h}h ago`;const f=Math.floor(h/24);return f<30?`${f}d ago`:i.toLocaleDateString(void 0,{month:"short",day:"numeric",year:"numeric"})}function jk({status:a}){const i={pending:"Pending",assigned:"Assigned",in_progress:"In Progress",waiting_input:"Waiting for Input",review:"Review",done:"Done",failed:"Failed"},l={pending:A.statusPending,assigned:A.statusAssigned,in_progress:A.statusInProgress,waiting_input:A.statusWaitingInput,review:A.statusReview,done:A.statusDone,failed:A.statusFailed};return d.jsx("span",{className:`${A.statusBadge} ${l[a]??A.statusPending}`,children:i[a]??a})}function Ak({task:a,tasksById:i,environments:l,projects:o,taskSessions:u}){const h=u.length>0?u[u.length-1]:void 0,f=(h==null?void 0:h.environmentId)??"",p=f?l.find(b=>b.id===f):void 0,g=o.find(b=>b.id===a.projectId),v=a.branch&&(g!=null&&g.repoUrl)?`${g.repoUrl.replace(/\/$/,"")}/tree/${encodeURIComponent(a.branch)}`:void 0;return d.jsxs("div",{className:A.overviewDashboard,children:[d.jsxs("div",{className:A.overviewHero,children:[d.jsx(jk,{status:a.status}),a.branch&&d.jsx("span",{className:A.overviewBranchPill,children:v?d.jsxs("a",{href:v,target:"_blank",rel:"noreferrer noopener",className:A.branchLink,children:["🔗"," ",a.branch]}):d.jsxs("span",{children:["🔗"," ",a.branch]})})]}),typeof a.description=="string"&&a.description&&d.jsxs("div",{className:A.overviewSection,children:[d.jsx("div",{className:A.overviewLabel,children:"Description"}),d.jsx("div",{className:A.overviewMarkdown,children:d.jsx(fd,{remarkPlugins:[hd],children:a.description})})]}),f&&d.jsxs("div",{className:A.overviewSection,children:[d.jsx("div",{className:A.overviewLabel,children:"Environment"}),d.jsxs("div",{className:A.envRow,children:[p&&d.jsx("span",{className:`${A.envDot} ${Ty(p.status)}`,title:p.status,"aria-label":`Status: ${p.status}`,role:"img"}),d.jsx("span",{className:A.overviewValue,children:(p==null?void 0:p.displayName)??f})]})]}),d.jsxs("div",{className:A.overviewSection,children:[d.jsx("div",{className:A.overviewLabel,children:"Dependencies"}),a.dependsOn.length===0?d.jsx("div",{className:A.overviewMuted,children:"None"}):d.jsx("div",{className:A.depList,children:a.dependsOn.map(b=>{const S=i.get(b),x=(S==null?void 0:S.status)==="done";return d.jsxs("div",{className:`${A.depItem} ${x?A.depDone:A.depBlocked}`,children:[d.jsx("span",{children:x?"✓":"○"}),d.jsx("span",{children:(S==null?void 0:S.title)??b})]},b)})})]}),d.jsxs("div",{className:A.overviewSection,children:[d.jsx("div",{className:A.overviewLabel,children:"Timeline"}),d.jsxs("div",{className:A.timeline,children:[a.createdAt&&d.jsxs("div",{className:A.timelineRow,children:[d.jsx("span",{className:A.timelineKey,children:"Created"}),d.jsx("span",{className:A.timelineValue,children:er(a.createdAt)})]}),a.assignedAt&&(()=>{const b=Xu(a.createdAt,a.assignedAt);return d.jsxs("div",{className:A.timelineRow,children:[d.jsx("span",{className:A.timelineKey,children:"Assigned"}),d.jsx("span",{className:A.timelineValue,children:er(a.assignedAt)}),b!==void 0&&d.jsx("span",{className:A.timelineDelta,children:b})]})})(),a.startedAt&&(()=>{const b=Xu(a.assignedAt??a.createdAt,a.startedAt);return d.jsxs("div",{className:A.timelineRow,children:[d.jsx("span",{className:A.timelineKey,children:"Started"}),d.jsx("span",{className:A.timelineValue,children:er(a.startedAt)}),b!==void 0&&d.jsx("span",{className:A.timelineDelta,children:b})]})})(),a.completedAt&&(()=>{const b=Xu(a.startedAt,a.completedAt);return d.jsxs("div",{className:A.timelineRow,children:[d.jsx("span",{className:A.timelineKey,children:"Completed"}),d.jsx("span",{className:A.timelineValue,children:er(a.completedAt)}),b!==void 0&&d.jsx("span",{className:A.timelineDelta,children:b})]})})(),!a.createdAt&&!a.assignedAt&&!a.startedAt&&!a.completedAt&&d.jsx("div",{className:A.overviewMuted,children:"No timing data"})]})]}),a.reviewNotes&&d.jsxs("div",{className:A.overviewSection,children:[d.jsx("div",{className:A.overviewLabel,children:"Review Notes"}),d.jsx("div",{className:A.reviewNotes,children:a.reviewNotes})]})]})}function Nk({task:a,sessionId:i,isBlocked:l,rejectNotes:o,onRejectNotesChange:u,onStart:h,onStop:f,onApprove:p,onReject:g,onDelete:v,onEdit:b}){if(a.status==="pending"||a.status==="assigned")return l?d.jsxs("div",{className:A.headerActions,children:[d.jsx("button",{onClick:b,className:A.btnGhost,children:"Edit"}),d.jsx("button",{onClick:v,className:A.btnDanger,children:"Delete"})]}):d.jsxs("div",{className:A.headerActions,children:[d.jsx("button",{onClick:h,className:A.btnPrimary,children:"Start"}),d.jsx("button",{onClick:b,className:A.btnGhost,children:"Edit"}),d.jsx("button",{onClick:v,className:A.btnDanger,children:"Delete"})]});if(a.status==="in_progress"||a.status==="waiting_input")return d.jsx("div",{className:A.headerActions,children:d.jsx("button",{onClick:f,disabled:!i,className:A.btnDanger,children:"Stop"})});if(a.status==="review")return d.jsxs("div",{className:A.headerActions,children:[d.jsx("input",{type:"text",value:o,onChange:S=>u(S.target.value),placeholder:"Rejection notes...",className:A.rejectInput}),d.jsx("button",{onClick:p,className:A.btnPrimary,children:"Approve"}),d.jsx("button",{onClick:g,className:A.btnDanger,children:"Reject"})]});if(a.status==="done")return d.jsx("div",{className:A.headerActions,children:d.jsx("button",{onClick:v,className:A.btnDanger,children:"Delete"})});if(a.status==="failed")return d.jsxs("div",{className:A.headerActions,children:[d.jsx("button",{onClick:h,className:A.btnPrimary,children:"Retry"}),d.jsx("button",{onClick:v,className:A.btnDanger,children:"Delete"})]})}function Ek({taskSessions:a,selectedSessionId:i,onSelect:l}){if(!(a.length<2))return d.jsxs("div",{className:A.attemptSelector,"data-testid":"attempt-selector",children:[d.jsx("span",{className:A.attemptLabel,children:"Attempts:"}),a.map((o,u)=>{const h=o.id===i,f=o.status==="completed"?"✓":o.status==="failed"?"✗":o.status==="running"||o.status==="waiting_input"?"●":"";return d.jsxs("button",{className:`${A.attemptButton} ${h?A.attemptActive:""}`,onClick:()=>l(o.id),title:`Attempt #${u+1} — ${o.status}`,"aria-label":`Attempt #${u+1}, ${o.status}`,"aria-pressed":h,"data-testid":`attempt-${u+1}`,children:["#",u+1,f&&d.jsx("span",{className:A.attemptStatus,children:f})]},o.id)})]})}function Ck({viewMode:a,setViewMode:i}){const{events:l,eventsDropped:o,sessions:u,tasks:h,environments:f,loadSessionEvents:p,loadFindings:g,kill:v,startTask:b,approveTask:S,rejectTask:x,deleteTask:E,projects:k,createProject:q,archiveProject:K,updateProject:z,taskSessions:P,loadTaskSessions:Y}=Hn(),nt=_.useRef(null),X=_.useRef(void 0),[V,et]=_.useState("overview"),[w,$]=_.useState("tasks"),[st,ht]=_.useState(""),[zt,tt]=_.useState(!1),[Ut,wt]=_.useState(!1),[B,Q]=_.useState(void 0),lt=_.useRef(void 0),At=_.useRef(void 0),[mt,Qt]=_.useState(null),[yt,bt]=_.useState(""),[I,ae]=_.useState(""),[ve,tn]=_.useState(!1),Le=_.useRef(void 0),Wt=_.useRef(null),en=_.useRef(null),ze=_.useRef(null),Gt=_.useRef(null),Pt=_.useRef(null),me=a.kind==="project"?a.projectId:void 0;_.useEffect(()=>{const H=Le.current;Le.current=me,!(H===void 0||H===me)&&(mt!==null||yt!=="")&&(Qt(null),bt(""))},[me,mt,yt]),_.useEffect(()=>{if(mt===null)return;const H=mt==="name"?en.current:mt==="description"?ze.current:mt==="repoUrl"?Gt.current:Pt.current;if(!H)return;const Me=window.setTimeout(()=>{H.focus()},0);return()=>{window.clearTimeout(Me)}},[mt]);let F,Mt;a.kind==="task"&&(F=h.find(H=>H.id===a.taskId),Mt=(F==null?void 0:F.projectId)||void 0);const _t=F?P[F.id]??[]:[];let R;a.kind==="session"?R=a.sessionId:a.kind==="task"&&(B&&_t.some(H=>H.id===B)?R=B:R=(F==null?void 0:F.latestSessionId)||void 0);const U=()=>{tt(!0)},W=()=>{F&&(E(F.id),tt(!1),i({kind:"project",projectId:F.projectId}))};a.kind==="task"&&(F==null?void 0:F.id)!==lt.current&&(lt.current=F==null?void 0:F.id,V!=="overview"&&et("overview"),st!==""&&ht(""),B!==void 0&&Q(void 0));const ct=_.useRef(void 0),St=_.useRef(void 0);if(_.useEffect(()=>{if(!(F!=null&&F.id))return;const H=F.id!==ct.current,Me=F.latestSessionId!==St.current;(H||Me)&&(ct.current=F.id,St.current=F.latestSessionId,Y(F.id))},[F==null?void 0:F.id,F==null?void 0:F.latestSessionId,Y]),(F==null?void 0:F.status)!==At.current){At.current=F==null?void 0:F.status;const H=(F==null?void 0:F.status)==="pending"||(F==null?void 0:F.status)==="assigned"?"overview":(F==null?void 0:F.status)==="in_progress"||(F==null?void 0:F.status)==="waiting_input"||(F==null?void 0:F.status)==="review"?"stream":(F==null?void 0:F.status)==="done"?"findings":void 0;H&&H!==V&&et(H)}const gt=_.useMemo(()=>{const H=R?l.filter(Me=>Me.sessionId===R):[];return xk(Tk(H))},[l,R]),Nt=_.useMemo(()=>new Map(h.map(H=>[H.id,H])),[h]),Vt=F?F.dependsOn.some(H=>{const Me=Nt.get(H);return Me!==void 0&&Me.status!=="done"}):!1,Yt=_.useMemo(()=>bk(a,k,Nt),[a,k,Nt]),ie=H=>{H.viewMode&&i(H.viewMode)},Ft=R?u.find(H=>H.id===R)??void 0:void 0;if(_.useEffect(()=>{R&&R!==X.current&&(X.current=R,p(R))},[R,p]),_.useEffect(()=>{V==="findings"&&Mt&&g(Mt)},[V,Mt,g]),_.useEffect(()=>{nt.current&&V==="stream"&&(nt.current.scrollTop=nt.current.scrollHeight)},[gt.length,V]),a.kind==="settings")return d.jsxs("div",{className:A.panelContainer,children:[d.jsx(vs,{segments:Yt,onNavigate:ie}),d.jsx(TE,{viewMode:a,setViewMode:i})]});if(a.kind==="persona_management")return d.jsxs("div",{className:A.panelContainer,children:[d.jsx(vs,{segments:Yt,onNavigate:ie}),d.jsx(oC,{})]});if(a.kind==="empty")return k.length===0?d.jsxs("div",{className:A.emptyCta,children:[d.jsx("div",{className:A.ctaTitle,children:"Welcome to Grackle"}),d.jsx("div",{className:A.ctaDescription,children:"Organize your work into projects and let agents tackle the tasks."}),d.jsx("button",{className:A.ctaButton,onClick:()=>{const H=window.prompt("Project name:");H!=null&&H.trim()&&q(H.trim())},children:"Create Your First Project"})]}):d.jsx("div",{className:A.emptyState,children:"Select a project or task to get started"});if(a.kind==="new_chat")return d.jsxs("div",{className:A.panelContainer,children:[d.jsx(vs,{segments:Yt,onNavigate:ie}),d.jsx("div",{className:A.emptyState,children:"Enter a prompt below to start a new session"})]});if(a.kind==="project"){const H=k.find(it=>it.id===a.projectId),Me=h.filter(it=>it.projectId===a.projectId),$n=Me.filter(it=>it.status==="done").length,He=Me.length,Ge=He>0?Math.round($n/He*100):0,nn=100,J=(it,de)=>{Wt.current=it,Qt(it),bt(de),ae("")},Tt=()=>{Wt.current=null,Qt(null),bt(""),ae("")},le=(it,de)=>{if(it==="name"){const hn=de.trim();if(!hn)return"Name is required";if(hn.length>nn)return`Max ${nn} characters`}if(it==="repoUrl"){const hn=de.trim();if(hn&&!/^https?:\/\/.+/.test(hn))return"Must be a valid http(s) URL"}return""},Zt=it=>{if(!H)return;const de=yt.trim(),hn=le(it,yt);if(hn){ae(hn);return}if(it==="name"){if(de===H.name){Tt();return}z(H.id,{name:de})}else if(it==="description"){const _a=yt;if(_a===H.description){Tt();return}z(H.id,{description:_a})}else if(it==="repoUrl"){if(de===H.repoUrl){Tt();return}z(H.id,{repoUrl:de})}else if(it==="defaultEnvironmentId"){if(yt===H.defaultEnvironmentId){Tt();return}z(H.id,{defaultEnvironmentId:yt})}Tt()},dt=(it,de)=>{it.key==="Escape"?Tt():it.key==="Enter"&&de!=="description"&&Zt(de)},Fe=it=>H?it==="name"?yt.trim()!==H.name:it==="description"?yt!==H.description:it==="repoUrl"?yt.trim()!==H.repoUrl:it==="defaultEnvironmentId"?yt!==H.defaultEnvironmentId:!1:!1,fn=f.find(it=>it.id===(H==null?void 0:H.defaultEnvironmentId)),an=mt==="description"?"Tab to save · Esc to cancel":"Enter to save · Esc to cancel";return d.jsxs("div",{className:A.panelContainer,children:[d.jsx(vs,{segments:Yt,onNavigate:ie}),d.jsxs("div",{className:A.projectHeader,children:[d.jsx("span",{className:A.projectName,"data-testid":"project-name",children:mt==="name"?d.jsxs("div",{className:A.editFieldWrapper,children:[d.jsx("input",{ref:en,className:`${A.editInput} ${I?A.editInputInvalid:""}`,value:yt,onChange:it=>{bt(it.target.value),ae("")},onBlur:it=>{if(Wt.current==="name"){Wt.current=null;return}it.relatedTarget instanceof HTMLElement&&it.relatedTarget.dataset.editAction==="name"||Zt("name")},onKeyDown:it=>dt(it,"name"),maxLength:nn,"aria-label":"Project name","data-testid":"edit-name-input"}),Fe("name")&&d.jsx("span",{className:A.unsavedDot,title:"Unsaved changes"}),I&&d.jsx("span",{className:A.editError,"data-testid":"edit-error",children:I}),d.jsx("span",{className:A.editHint,children:an})]}):d.jsxs("button",{type:"button",className:A.metaValueClickable,onClick:()=>J("name",(H==null?void 0:H.name)||""),title:"Click to edit name","aria-label":`Edit project name: ${(H==null?void 0:H.name)||a.projectId}`,"data-testid":"edit-name-button",children:[(H==null?void 0:H.name)||a.projectId,d.jsx("span",{className:A.editButton,"aria-hidden":"true",children:"✏️"})]})}),d.jsx("button",{className:A.archiveButton,onClick:()=>wt(!0),title:"Archive project","data-testid":"archive-project-button",children:"Archive"})]}),d.jsxs("button",{className:A.metaToggle,onClick:()=>tn(!ve),"aria-expanded":!ve,"aria-controls":"project-meta-panel","data-testid":"meta-toggle",children:[d.jsx("span",{className:`${A.metaToggleArrow} ${ve?"":A.metaToggleArrowOpen}`,children:"▶"}),"Details"]}),!ve&&d.jsxs("div",{className:A.projectMeta,"data-testid":"project-meta",id:"project-meta-panel",children:[d.jsxs("div",{className:A.metaRow,children:[d.jsx("span",{className:A.metaLabel,children:"Description"}),d.jsx("div",{className:A.metaValue,children:mt==="description"?d.jsxs("div",{className:A.editFieldWrapper,children:[d.jsx("textarea",{ref:ze,className:A.editTextarea,value:yt,onChange:it=>{bt(it.target.value),ae("")},onBlur:it=>{if(Wt.current==="description"){Wt.current=null;return}it.relatedTarget instanceof HTMLElement&&it.relatedTarget.dataset.editAction==="description"||Zt("description")},onKeyDown:it=>dt(it,"description"),title:"Project description","aria-label":"Project description","data-testid":"edit-description-input"}),Fe("description")&&d.jsx("span",{className:A.unsavedDot,title:"Unsaved changes"}),d.jsx("span",{className:A.editHint,children:an})]}):d.jsxs("button",{type:"button",className:A.metaValueClickable,onClick:()=>J("description",(H==null?void 0:H.description)||""),title:"Click to edit description","aria-label":"Edit project description","data-testid":"edit-description-button",children:[H!=null&&H.description?d.jsx("span",{className:A.overviewMarkdown,children:d.jsx(fd,{remarkPlugins:[hd],children:H.description})}):d.jsx("span",{className:A.metaPlaceholder,children:"No description"}),d.jsx("span",{className:A.editButton,"aria-hidden":"true",children:"✏️"})]})})]}),d.jsxs("div",{className:A.metaRow,children:[d.jsx("span",{className:A.metaLabel,children:"Repository"}),d.jsx("div",{className:A.metaValue,children:mt==="repoUrl"?d.jsxs("div",{className:A.editFieldWrapper,children:[d.jsx("input",{ref:Gt,className:`${A.editInput} ${I?A.editInputInvalid:""}`,value:yt,onChange:it=>{bt(it.target.value),ae("")},onBlur:it=>{if(Wt.current==="repoUrl"){Wt.current=null;return}it.relatedTarget instanceof HTMLElement&&it.relatedTarget.dataset.editAction==="repoUrl"||Zt("repoUrl")},onKeyDown:it=>dt(it,"repoUrl"),placeholder:"https://github.com/...","aria-label":"Project repository URL","data-testid":"edit-repo-input"}),Fe("repoUrl")&&d.jsx("span",{className:A.unsavedDot,title:"Unsaved changes"}),I&&d.jsx("span",{className:A.editError,"data-testid":"edit-error",children:I}),d.jsx("span",{className:A.editHint,children:an})]}):d.jsxs("button",{type:"button",className:A.metaValueClickable,onClick:it=>{it.preventDefault(),J("repoUrl",(H==null?void 0:H.repoUrl)||"")},title:"Click to edit repository URL","aria-label":"Edit project repository URL","data-testid":"edit-repo-button",children:[H!=null&&H.repoUrl&&/^https?:\/\//i.test(H.repoUrl)?d.jsx("a",{className:A.repoLink,href:H.repoUrl,target:"_blank",rel:"noopener noreferrer",onClick:it=>it.stopPropagation(),children:H.repoUrl}):H!=null&&H.repoUrl?d.jsx("span",{children:H.repoUrl}):d.jsx("span",{className:A.metaPlaceholder,children:"No repository"}),d.jsx("span",{className:A.editButton,"aria-hidden":"true",children:"✏️"})]})})]}),d.jsxs("div",{className:A.metaRow,children:[d.jsx("span",{className:A.metaLabel,children:"Environment"}),d.jsx("div",{className:A.metaValue,children:mt==="defaultEnvironmentId"?d.jsxs("select",{ref:Pt,className:A.editSelect,value:yt,onChange:it=>{Wt.current=null,bt(it.target.value);const de=it.target.value;H&&de!==H.defaultEnvironmentId&&z(H.id,{defaultEnvironmentId:de}),Tt()},onBlur:it=>{if(Wt.current==="defaultEnvironmentId"){Wt.current=null;return}it.relatedTarget instanceof HTMLElement&&it.relatedTarget.dataset.editAction==="defaultEnvironmentId"||Tt()},title:"Default environment","aria-label":"Project default environment","data-testid":"edit-env-select",children:[d.jsx("option",{value:"",children:"None"}),f.map(it=>d.jsx("option",{value:it.id,children:it.displayName},it.id))]}):d.jsxs("button",{type:"button",className:A.metaValueClickable,onClick:()=>J("defaultEnvironmentId",(H==null?void 0:H.defaultEnvironmentId)||""),title:"Click to change default environment","aria-label":"Edit project default environment","data-testid":"edit-env-button",children:[fn?d.jsxs("span",{className:A.envRow,children:[d.jsx("span",{className:`${A.envDot} ${Ty(fn.status)}`}),fn.displayName]}):d.jsx("span",{className:A.metaPlaceholder,children:(H==null?void 0:H.defaultEnvironmentId)||"No default environment"}),d.jsx("span",{className:A.editButton,"aria-hidden":"true",children:"✏️"})]})})]}),H&&d.jsxs("div",{className:A.metaTimestamps,children:[d.jsxs("span",{className:A.metaTimestamp,children:["Created ",Mv(H.createdAt)]}),H.updatedAt&&H.updatedAt!==H.createdAt&&d.jsxs("span",{className:A.metaTimestamp,children:["· Updated ",Mv(H.updatedAt)]})]})]}),He>0&&d.jsxs("div",{className:A.progressBarContainer,"data-testid":"progress-bar",children:[d.jsx("div",{className:A.progressBar,children:d.jsx("div",{className:A.progressFill,style:{width:`${Ge}%`}})}),d.jsxs("span",{className:A.progressLabel,children:[$n,"/",He]})]}),d.jsxs("div",{className:A.tabBar,role:"tablist","aria-label":"Project view",children:[d.jsx("button",{role:"tab","aria-selected":w==="graph",className:`${A.tab} ${w==="graph"?A.active:""}`,onClick:()=>$("graph"),children:"Graph"}),d.jsx("button",{role:"tab","aria-selected":w==="tasks",className:`${A.tab} ${w==="tasks"?A.active:""}`,onClick:()=>$("tasks"),children:"Tasks"})]}),w==="tasks"&&He>0&&d.jsxs("div",{className:A.projectSummary,children:[d.jsx("span",{className:A.projectSummaryTitle,children:`${$n}/${He} tasks complete`}),d.jsx("span",{className:A.projectSummarySubtitle,children:"Select a task or click + to create one"})]}),w==="tasks"&&He===0&&d.jsxs("div",{className:A.emptyCta,children:[d.jsx("button",{className:A.ctaButton,onClick:()=>i({kind:"new_task",projectId:a.projectId}),children:"Create Task"}),d.jsx("div",{className:A.ctaDescription,children:"Break your work into tasks and let agents tackle them"})]}),w==="graph"&&d.jsx(DC,{projectId:a.projectId,setViewMode:i}),d.jsx(pr,{isOpen:Ut,title:"Archive Project?",description:"This will hide the project from the sidebar. Tasks will not be deleted.",confirmLabel:"Archive",onConfirm:()=>{H&&(K(H.id),i({kind:"empty"})),wt(!1)},onCancel:()=>wt(!1)})]})}if(a.kind==="new_environment")return d.jsxs("div",{className:A.panelContainer,children:[d.jsx(vs,{segments:Yt,onNavigate:ie}),d.jsx("div",{className:A.emptyState,children:"Configure the new environment below"})]});if(a.kind==="new_task")return d.jsx(Nv,{viewMode:a,setViewMode:i});if(a.kind==="edit_task")return d.jsx(Nv,{viewMode:a,setViewMode:i});if(a.kind==="task")return d.jsxs("div",{className:A.panelContainer,children:[d.jsx(vs,{segments:Yt,onNavigate:ie}),d.jsxs("div",{className:A.header,children:[d.jsxs("span",{className:A.headerTitle,children:[d.jsx("span",{"data-testid":"task-title",children:(F==null?void 0:F.title)||a.taskId}),F&&d.jsx("span",{className:A.taskStatusBadge,"data-testid":"task-status",children:F.status}),(F==null?void 0:F.branch)&&d.jsx("span",{className:A.taskBranch,children:F.branch}),Vt&&d.jsx("span",{className:A.taskBlockedBadge,children:"blocked"})]}),F&&d.jsx(Nk,{task:F,sessionId:R,isBlocked:Vt,rejectNotes:st,onRejectNotesChange:ht,onStart:()=>b(F.id),onStop:()=>R&&v(R),onApprove:()=>S(F.id),onReject:()=>{x(F.id,st),ht("")},onDelete:U,onEdit:()=>i({kind:"edit_task",taskId:F.id})})]}),d.jsxs("div",{className:A.tabBar,role:"tablist","aria-label":"Task view",children:[d.jsx("button",{role:"tab","aria-selected":V==="overview",className:`${A.tab} ${V==="overview"?A.active:""}`,onClick:()=>et("overview"),children:"Overview"}),d.jsx("button",{role:"tab","aria-selected":V==="stream",className:`${A.tab} ${V==="stream"?A.active:""}`,onClick:()=>et("stream"),children:"Stream"}),d.jsx("button",{role:"tab","aria-selected":V==="findings",className:`${A.tab} ${V==="findings"?A.active:""}`,onClick:()=>et("findings"),children:"Findings"})]}),d.jsxs(bi,{mode:"wait",children:[V==="overview"&&d.jsx(Jn.div,{initial:{opacity:0,y:4},animate:{opacity:1,y:0},exit:{opacity:0,y:-4},transition:{duration:.15},className:A.overviewContent,children:F?d.jsx(Ak,{task:F,tasksById:Nt,environments:f,projects:k,taskSessions:_t}):d.jsx("div",{className:A.waitingMessage,children:"No additional details"})},"overview"),V==="stream"&&d.jsxs(Jn.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:[d.jsx(Ek,{taskSessions:_t,selectedSessionId:R,onSelect:H=>{Q(H)}}),d.jsxs("div",{ref:nt,className:A.eventScroll,children:[!R&&F&&d.jsxs("div",{className:A.emptyCta,children:[d.jsx("button",{className:A.ctaButton,onClick:()=>b(F.id),children:"Start Task"}),d.jsx("div",{className:A.ctaDescription,children:"Click to begin agent execution"})]}),R&&gt.length===0&&d.jsx("div",{className:A.waitingMessage,children:"Waiting for events..."}),d.jsx(_y,{eventsDropped:o}),gt.map((H,Me)=>d.jsx(gy,{event:H,toolUseCtx:H.toolUseCtx},`${H.sessionId}-${H.timestamp}-${Me}`))]})]},"stream"),V==="findings"&&d.jsx(Jn.div,{initial:{opacity:0,y:4},animate:{opacity:1,y:0},exit:{opacity:0,y:-4},transition:{duration:.15},className:A.tabContent,children:Mt?d.jsx(pN,{projectId:Mt}):d.jsx("div",{className:A.noContext,children:"Navigate to a task within a project to view findings"})},"findings")]}),F&&d.jsx(pr,{isOpen:zt,title:"Delete Task?",description:`"${F.title}" will be permanently removed.`,onConfirm:W,onCancel:()=>tt(!1)})]});if(!R)return d.jsx("div",{className:A.emptyState,children:"No session selected"});const qe=(Ft==null?void 0:Ft.status)==="running"||(Ft==null?void 0:Ft.status)==="waiting_input";return d.jsxs("div",{className:A.panelContainer,children:[d.jsx(vs,{segments:Yt,onNavigate:ie}),d.jsx(Sk,{sessionId:R,session:Ft,isActive:qe,onKill:v}),d.jsx(_k,{sessionEvents:gt,session:Ft,eventsDropped:o,scrollRef:nt})]})}const Dk="_toast_sfumy_1",kk="_success_sfumy_18",wk="_icon_sfumy_22",Mk="_error_sfumy_25",Rk="_warning_sfumy_32",Ok="_info_sfumy_38",zk="_message_sfumy_53",Bk="_close_sfumy_60",vl={toast:Dk,success:kk,icon:wk,error:Mk,warning:Rk,info:Ok,message:zk,close:Bk},Uk={success:"✓",error:"✕",warning:"⚠",info:"ℹ"};function Vk({toast:a,onDismiss:i}){return _.useEffect(()=>{const l=setTimeout(()=>i(a.id),a.duration);return()=>clearTimeout(l)},[a.id,a.duration,i]),d.jsxs(Jn.div,{className:`${vl.toast} ${vl[a.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:[d.jsx("span",{className:vl.icon,"aria-hidden":"true",children:Uk[a.variant]}),d.jsx("span",{className:vl.message,children:a.message}),d.jsx("button",{type:"button",className:vl.close,onClick:()=>i(a.id),"aria-label":"Dismiss notification",children:"×"})]})}const Lk="_container_qqse2_1",qk={container:Lk};function Hk(){const{toasts:a,dismissToast:i}=gr();return d.jsx("div",{className:qk.container,"data-testid":"toast-container",children:d.jsx(bi,{children:a.map(l=>d.jsx(Vk,{toast:l,onDismiss:i},l.id))})})}const Gk="_root_cdda9_1",Ik="_body_cdda9_7",Yk="_main_cdda9_13",Qu={root:Gk,body:Ik,main:Yk},Zk=typeof window<"u"&&new URLSearchParams(window.location.search).has("mock");function Kk(){const[a,i]=_.useState({kind:"empty"}),{lastSpawnedId:l}=Hn();return _.useEffect(()=>{l&&i({kind:"session",sessionId:l})},[l]),d.jsxs("div",{className:Qu.root,children:[d.jsx(DS,{setViewMode:i}),d.jsxs("div",{className:Qu.body,children:[d.jsx(BA,{viewMode:a,setViewMode:i}),d.jsxs("div",{className:Qu.main,children:[d.jsx(Ck,{viewMode:a,setViewMode:i},a.kind==="task"?a.taskId:a.kind==="edit_task"?`edit_task:${a.taskId}`:a.kind==="new_task"?`new_task:${a.projectId}:${a.parentTaskId??""}`:a.kind==="session"?a.sessionId:a.kind),d.jsx(eN,{viewMode:a,setViewMode:i})]})]}),d.jsx(Hk,{})]})}function Xk(){const a=Zk?mS:iS;return d.jsx(SS,{children:d.jsx(gS,{children:d.jsx(a,{children:d.jsx(Kk,{})})})})}Xb.createRoot(document.getElementById("root")).render(d.jsx(_.StrictMode,{children:d.jsx(Xk,{})}));