@gbasin/agentboard-darwin-x64 0.4.4 → 0.4.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -5,7 +5,7 @@ var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=
5
5
  `+i[o].replace(` at new `,` at `);return e.displayName&&c.includes(`<anonymous>`)&&(c=c.replace(`<anonymous>`,e.displayName)),c}while(1<=o&&0<=s);break}}}finally{H=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:``)?V(e):``}function W(e){switch(e.tag){case 5:return V(e.type);case 16:return V(`Lazy`);case 13:return V(`Suspense`);case 19:return V(`SuspenseList`);case 0:case 2:case 15:return e=U(e.type,!1),e;case 11:return e=U(e.type.render,!1),e;case 1:return e=U(e.type,!0),e;default:return``}}function G(e){if(e==null)return null;if(typeof e==`function`)return e.displayName||e.name||null;if(typeof e==`string`)return e;switch(e){case E:return`Fragment`;case T:return`Portal`;case O:return`Profiler`;case D:return`StrictMode`;case M:return`Suspense`;case N:return`SuspenseList`}if(typeof e==`object`)switch(e.$$typeof){case A:return(e.displayName||`Context`)+`.Consumer`;case k:return(e._context.displayName||`Context`)+`.Provider`;case j:var t=e.render;return e=e.displayName,e||=(e=t.displayName||t.name||``,e===``?`ForwardRef`:`ForwardRef(`+e+`)`),e;case P:return t=e.displayName||null,t===null?G(e.type)||`Memo`:t;case F:t=e._payload,e=e._init;try{return G(e(t))}catch{}}return null}function ee(e){var t=e.type;switch(e.tag){case 24:return`Cache`;case 9:return(t.displayName||`Context`)+`.Consumer`;case 10:return(t._context.displayName||`Context`)+`.Provider`;case 18:return`DehydratedFragment`;case 11:return e=t.render,e=e.displayName||e.name||``,t.displayName||(e===``?`ForwardRef`:`ForwardRef(`+e+`)`);case 7:return`Fragment`;case 5:return t;case 4:return`Portal`;case 3:return`Root`;case 6:return`Text`;case 16:return G(t);case 8:return t===D?`StrictMode`:`Mode`;case 22:return`Offscreen`;case 12:return`Profiler`;case 21:return`Scope`;case 13:return`Suspense`;case 19:return`SuspenseList`;case 25:return`TracingMarker`;case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t==`function`)return t.displayName||t.name||null;if(typeof t==`string`)return t}return null}function K(e){switch(typeof e){case`boolean`:case`number`:case`string`:case`undefined`:return e;case`object`:return e;default:return``}}function te(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()===`input`&&(t===`checkbox`||t===`radio`)}function ne(e){var t=te(e)?`checked`:`value`,n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=``+e[t];if(!e.hasOwnProperty(t)&&n!==void 0&&typeof n.get==`function`&&typeof n.set==`function`){var i=n.get,a=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(e){r=``+e,a.call(this,e)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(e){r=``+e},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function re(e){e._valueTracker||=ne(e)}function ie(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r=``;return e&&(r=te(e)?e.checked?`true`:`false`:e.value),e=r,e===n?!1:(t.setValue(e),!0)}function ae(e){if(e||=typeof document<`u`?document:void 0,e===void 0)return null;try{return e.activeElement||e.body}catch{return e.body}}function oe(e,t){var n=t.checked;return z({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function se(e,t){var n=t.defaultValue==null?``:t.defaultValue,r=t.checked==null?t.defaultChecked:t.checked;n=K(t.value==null?n:t.value),e._wrapperState={initialChecked:r,initialValue:n,controlled:t.type===`checkbox`||t.type===`radio`?t.checked!=null:t.value!=null}}function ce(e,t){t=t.checked,t!=null&&S(e,`checked`,t,!1)}function le(e,t){ce(e,t);var n=K(t.value),r=t.type;if(n!=null)r===`number`?(n===0&&e.value===``||e.value!=n)&&(e.value=``+n):e.value!==``+n&&(e.value=``+n);else if(r===`submit`||r===`reset`){e.removeAttribute(`value`);return}t.hasOwnProperty(`value`)?de(e,t.type,n):t.hasOwnProperty(`defaultValue`)&&de(e,t.type,K(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function ue(e,t,n){if(t.hasOwnProperty(`value`)||t.hasOwnProperty(`defaultValue`)){var r=t.type;if(!(r!==`submit`&&r!==`reset`||t.value!==void 0&&t.value!==null))return;t=``+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}n=e.name,n!==``&&(e.name=``),e.defaultChecked=!!e._wrapperState.initialChecked,n!==``&&(e.name=n)}function de(e,t,n){(t!==`number`||ae(e.ownerDocument)!==e)&&(n==null?e.defaultValue=``+e._wrapperState.initialValue:e.defaultValue!==``+n&&(e.defaultValue=``+n))}var fe=Array.isArray;function pe(e,t,n,r){if(e=e.options,t){t={};for(var i=0;i<n.length;i++)t[`$`+n[i]]=!0;for(n=0;n<e.length;n++)i=t.hasOwnProperty(`$`+e[n].value),e[n].selected!==i&&(e[n].selected=i),i&&r&&(e[n].defaultSelected=!0)}else{for(n=``+K(n),t=null,i=0;i<e.length;i++){if(e[i].value===n){e[i].selected=!0,r&&(e[i].defaultSelected=!0);return}t!==null||e[i].disabled||(t=e[i])}t!==null&&(t.selected=!0)}}function me(e,t){if(t.dangerouslySetInnerHTML!=null)throw Error(r(91));return z({},t,{value:void 0,defaultValue:void 0,children:``+e._wrapperState.initialValue})}function he(e,t){var n=t.value;if(n==null){if(n=t.children,t=t.defaultValue,n!=null){if(t!=null)throw Error(r(92));if(fe(n)){if(1<n.length)throw Error(r(93));n=n[0]}t=n}t??=``,n=t}e._wrapperState={initialValue:K(n)}}function ge(e,t){var n=K(t.value),r=K(t.defaultValue);n!=null&&(n=``+n,n!==e.value&&(e.value=n),t.defaultValue==null&&e.defaultValue!==n&&(e.defaultValue=n)),r!=null&&(e.defaultValue=``+r)}function _e(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==``&&t!==null&&(e.value=t)}function ve(e){switch(e){case`svg`:return`http://www.w3.org/2000/svg`;case`math`:return`http://www.w3.org/1998/Math/MathML`;default:return`http://www.w3.org/1999/xhtml`}}function ye(e,t){return e==null||e===`http://www.w3.org/1999/xhtml`?ve(t):e===`http://www.w3.org/2000/svg`&&t===`foreignObject`?`http://www.w3.org/1999/xhtml`:e}var be,xe=function(e){return typeof MSApp<`u`&&MSApp.execUnsafeLocalFunction?function(t,n,r,i){MSApp.execUnsafeLocalFunction(function(){return e(t,n,r,i)})}:e}(function(e,t){if(e.namespaceURI!==`http://www.w3.org/2000/svg`||`innerHTML`in e)e.innerHTML=t;else{for(be||=document.createElement(`div`),be.innerHTML=`<svg>`+t.valueOf().toString()+`</svg>`,t=be.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function Se(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Ce={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},we=[`Webkit`,`ms`,`Moz`,`O`];Object.keys(Ce).forEach(function(e){we.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),Ce[t]=Ce[e]})});function Te(e,t,n){return t==null||typeof t==`boolean`||t===``?``:n||typeof t!=`number`||t===0||Ce.hasOwnProperty(e)&&Ce[e]?(``+t).trim():t+`px`}function Ee(e,t){for(var n in e=e.style,t)if(t.hasOwnProperty(n)){var r=n.indexOf(`--`)===0,i=Te(n,t[n],r);n===`float`&&(n=`cssFloat`),r?e.setProperty(n,i):e[n]=i}}var De=z({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function Oe(e,t){if(t){if(De[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(r(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(r(60));if(typeof t.dangerouslySetInnerHTML!=`object`||!(`__html`in t.dangerouslySetInnerHTML))throw Error(r(61))}if(t.style!=null&&typeof t.style!=`object`)throw Error(r(62))}}function ke(e,t){if(e.indexOf(`-`)===-1)return typeof t.is==`string`;switch(e){case`annotation-xml`:case`color-profile`:case`font-face`:case`font-face-src`:case`font-face-uri`:case`font-face-format`:case`font-face-name`:case`missing-glyph`:return!1;default:return!0}}var Ae=null;function je(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Me=null,Ne=null,Pe=null;function Fe(e){if(e=Pi(e)){if(typeof Me!=`function`)throw Error(r(280));var t=e.stateNode;t&&(t=Ii(t),Me(e.stateNode,e.type,t))}}function Ie(e){Ne?Pe?Pe.push(e):Pe=[e]:Ne=e}function Le(){if(Ne){var e=Ne,t=Pe;if(Pe=Ne=null,Fe(e),t)for(e=0;e<t.length;e++)Fe(t[e])}}function Re(e,t){return e(t)}function ze(){}var Be=!1;function Ve(e,t,n){if(Be)return e(t,n);Be=!0;try{return Re(e,t,n)}finally{Be=!1,(Ne!==null||Pe!==null)&&(ze(),Le())}}function He(e,t){var n=e.stateNode;if(n===null)return null;var i=Ii(n);if(i===null)return null;n=i[t];a:switch(t){case`onClick`:case`onClickCapture`:case`onDoubleClick`:case`onDoubleClickCapture`:case`onMouseDown`:case`onMouseDownCapture`:case`onMouseMove`:case`onMouseMoveCapture`:case`onMouseUp`:case`onMouseUpCapture`:case`onMouseEnter`:(i=!i.disabled)||(e=e.type,i=!(e===`button`||e===`input`||e===`select`||e===`textarea`)),e=!i;break a;default:e=!1}if(e)return null;if(n&&typeof n!=`function`)throw Error(r(231,t,typeof n));return n}var Ue=!1;if(c)try{var We={};Object.defineProperty(We,`passive`,{get:function(){Ue=!0}}),window.addEventListener(`test`,We,We),window.removeEventListener(`test`,We,We)}catch{Ue=!1}function Ge(e,t,n,r,i,a,o,s,c){var l=Array.prototype.slice.call(arguments,3);try{t.apply(n,l)}catch(e){this.onError(e)}}var Ke=!1,qe=null,Je=!1,q=null,Ye={onError:function(e){Ke=!0,qe=e}};function Xe(e,t,n,r,i,a,o,s,c){Ke=!1,qe=null,Ge.apply(Ye,arguments)}function Ze(e,t,n,i,a,o,s,c,l){if(Xe.apply(this,arguments),Ke){if(Ke){var u=qe;Ke=!1,qe=null}else throw Error(r(198));Je||(Je=!0,q=u)}}function Qe(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,t.flags&4098&&(n=t.return),e=t.return;while(e)}return t.tag===3?n:null}function $e(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function et(e){if(Qe(e)!==e)throw Error(r(188))}function tt(e){var t=e.alternate;if(!t){if(t=Qe(e),t===null)throw Error(r(188));return t===e?e:null}for(var n=e,i=t;;){var a=n.return;if(a===null)break;var o=a.alternate;if(o===null){if(i=a.return,i!==null){n=i;continue}break}if(a.child===o.child){for(o=a.child;o;){if(o===n)return et(a),e;if(o===i)return et(a),t;o=o.sibling}throw Error(r(188))}if(n.return!==i.return)n=a,i=o;else{for(var s=!1,c=a.child;c;){if(c===n){s=!0,n=a,i=o;break}if(c===i){s=!0,i=a,n=o;break}c=c.sibling}if(!s){for(c=o.child;c;){if(c===n){s=!0,n=o,i=a;break}if(c===i){s=!0,i=o,n=a;break}c=c.sibling}if(!s)throw Error(r(189))}}if(n.alternate!==i)throw Error(r(190))}if(n.tag!==3)throw Error(r(188));return n.stateNode.current===n?e:t}function nt(e){return e=tt(e),e===null?null:rt(e)}function rt(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=rt(e);if(t!==null)return t;e=e.sibling}return null}var it=n.unstable_scheduleCallback,at=n.unstable_cancelCallback,ot=n.unstable_shouldYield,st=n.unstable_requestPaint,ct=n.unstable_now,lt=n.unstable_getCurrentPriorityLevel,ut=n.unstable_ImmediatePriority,dt=n.unstable_UserBlockingPriority,ft=n.unstable_NormalPriority,pt=n.unstable_LowPriority,mt=n.unstable_IdlePriority,ht=null,gt=null;function _t(e){if(gt&&typeof gt.onCommitFiberRoot==`function`)try{gt.onCommitFiberRoot(ht,e,void 0,(e.current.flags&128)==128)}catch{}}var vt=Math.clz32?Math.clz32:xt,yt=Math.log,bt=Math.LN2;function xt(e){return e>>>=0,e===0?32:31-(yt(e)/bt|0)|0}var St=64,Ct=4194304;function wt(e){switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function Tt(e,t){var n=e.pendingLanes;if(n===0)return 0;var r=0,i=e.suspendedLanes,a=e.pingedLanes,o=n&268435455;if(o!==0){var s=o&~i;s===0?(a&=o,a!==0&&(r=wt(a))):r=wt(s)}else o=n&~i,o===0?a!==0&&(r=wt(a)):r=wt(o);if(r===0)return 0;if(t!==0&&t!==r&&(t&i)===0&&(i=r&-r,a=t&-t,i>=a||i===16&&a&4194240))return t;if(r&4&&(r|=n&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=r;0<t;)n=31-vt(t),i=1<<n,r|=e[n],t&=~i;return r}function Et(e,t){switch(e){case 1:case 2:case 4:return t+250;case 8:case 16:case 32:case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return-1;case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function Dt(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,i=e.expirationTimes,a=e.pendingLanes;0<a;){var o=31-vt(a),s=1<<o,c=i[o];c===-1?((s&n)===0||(s&r)!==0)&&(i[o]=Et(s,t)):c<=t&&(e.expiredLanes|=s),a&=~s}}function Ot(e){return e=e.pendingLanes&-1073741825,e===0?e&1073741824?1073741824:0:e}function kt(){var e=St;return St<<=1,!(St&4194240)&&(St=64),e}function At(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function jt(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-vt(t),e[t]=n}function Mt(e,t){var n=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var r=e.eventTimes;for(e=e.expirationTimes;0<n;){var i=31-vt(n),a=1<<i;t[i]=0,r[i]=-1,e[i]=-1,n&=~a}}function Nt(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-vt(n),i=1<<r;i&t|e[r]&t&&(e[r]|=t),n&=~i}}var Pt=0;function Ft(e){return e&=-e,1<e?4<e?e&268435455?16:536870912:4:1}var It,Lt,Rt,zt,Bt,Vt=!1,Ht=[],Ut=null,Wt=null,Gt=null,Kt=new Map,qt=new Map,Jt=[],Yt=`mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset submit`.split(` `);function Xt(e,t){switch(e){case`focusin`:case`focusout`:Ut=null;break;case`dragenter`:case`dragleave`:Wt=null;break;case`mouseover`:case`mouseout`:Gt=null;break;case`pointerover`:case`pointerout`:Kt.delete(t.pointerId);break;case`gotpointercapture`:case`lostpointercapture`:qt.delete(t.pointerId)}}function Zt(e,t,n,r,i,a){return e===null||e.nativeEvent!==a?(e={blockedOn:t,domEventName:n,eventSystemFlags:r,nativeEvent:a,targetContainers:[i]},t!==null&&(t=Pi(t),t!==null&&Lt(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,i!==null&&t.indexOf(i)===-1&&t.push(i),e)}function Qt(e,t,n,r,i){switch(t){case`focusin`:return Ut=Zt(Ut,e,t,n,r,i),!0;case`dragenter`:return Wt=Zt(Wt,e,t,n,r,i),!0;case`mouseover`:return Gt=Zt(Gt,e,t,n,r,i),!0;case`pointerover`:var a=i.pointerId;return Kt.set(a,Zt(Kt.get(a)||null,e,t,n,r,i)),!0;case`gotpointercapture`:return a=i.pointerId,qt.set(a,Zt(qt.get(a)||null,e,t,n,r,i)),!0}return!1}function $t(e){var t=Ni(e.target);if(t!==null){var n=Qe(t);if(n!==null){if(t=n.tag,t===13){if(t=$e(n),t!==null){e.blockedOn=t,Bt(e.priority,function(){Rt(n)});return}}else if(t===3&&n.stateNode.current.memoizedState.isDehydrated){e.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}e.blockedOn=null}function en(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=fn(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);Ae=r,n.target.dispatchEvent(r),Ae=null}else return t=Pi(n),t!==null&&Lt(t),e.blockedOn=n,!1;t.shift()}return!0}function tn(e,t,n){en(e)&&n.delete(t)}function nn(){Vt=!1,Ut!==null&&en(Ut)&&(Ut=null),Wt!==null&&en(Wt)&&(Wt=null),Gt!==null&&en(Gt)&&(Gt=null),Kt.forEach(tn),qt.forEach(tn)}function rn(e,t){e.blockedOn===t&&(e.blockedOn=null,Vt||(Vt=!0,n.unstable_scheduleCallback(n.unstable_NormalPriority,nn)))}function an(e){function t(t){return rn(t,e)}if(0<Ht.length){rn(Ht[0],e);for(var n=1;n<Ht.length;n++){var r=Ht[n];r.blockedOn===e&&(r.blockedOn=null)}}for(Ut!==null&&rn(Ut,e),Wt!==null&&rn(Wt,e),Gt!==null&&rn(Gt,e),Kt.forEach(t),qt.forEach(t),n=0;n<Jt.length;n++)r=Jt[n],r.blockedOn===e&&(r.blockedOn=null);for(;0<Jt.length&&(n=Jt[0],n.blockedOn===null);)$t(n),n.blockedOn===null&&Jt.shift()}var on=C.ReactCurrentBatchConfig,sn=!0;function cn(e,t,n,r){var i=Pt,a=on.transition;on.transition=null;try{Pt=1,un(e,t,n,r)}finally{Pt=i,on.transition=a}}function ln(e,t,n,r){var i=Pt,a=on.transition;on.transition=null;try{Pt=4,un(e,t,n,r)}finally{Pt=i,on.transition=a}}function un(e,t,n,r){if(sn){var i=fn(e,t,n,r);if(i===null)ai(e,t,r,dn,n),Xt(e,r);else if(Qt(i,e,t,n,r))r.stopPropagation();else if(Xt(e,r),t&4&&-1<Yt.indexOf(e)){for(;i!==null;){var a=Pi(i);if(a!==null&&It(a),a=fn(e,t,n,r),a===null&&ai(e,t,r,dn,n),a===i)break;i=a}i!==null&&r.stopPropagation()}else ai(e,t,r,null,n)}}var dn=null;function fn(e,t,n,r){if(dn=null,e=je(r),e=Ni(e),e!==null)if(t=Qe(e),t===null)e=null;else if(n=t.tag,n===13){if(e=$e(t),e!==null)return e;e=null}else if(n===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null);return dn=e,null}function pn(e){switch(e){case`cancel`:case`click`:case`close`:case`contextmenu`:case`copy`:case`cut`:case`auxclick`:case`dblclick`:case`dragend`:case`dragstart`:case`drop`:case`focusin`:case`focusout`:case`input`:case`invalid`:case`keydown`:case`keypress`:case`keyup`:case`mousedown`:case`mouseup`:case`paste`:case`pause`:case`play`:case`pointercancel`:case`pointerdown`:case`pointerup`:case`ratechange`:case`reset`:case`resize`:case`seeked`:case`submit`:case`touchcancel`:case`touchend`:case`touchstart`:case`volumechange`:case`change`:case`selectionchange`:case`textInput`:case`compositionstart`:case`compositionend`:case`compositionupdate`:case`beforeblur`:case`afterblur`:case`beforeinput`:case`blur`:case`fullscreenchange`:case`focus`:case`hashchange`:case`popstate`:case`select`:case`selectstart`:return 1;case`drag`:case`dragenter`:case`dragexit`:case`dragleave`:case`dragover`:case`mousemove`:case`mouseout`:case`mouseover`:case`pointermove`:case`pointerout`:case`pointerover`:case`scroll`:case`toggle`:case`touchmove`:case`wheel`:case`mouseenter`:case`mouseleave`:case`pointerenter`:case`pointerleave`:return 4;case`message`:switch(lt()){case ut:return 1;case dt:return 4;case ft:case pt:return 16;case mt:return 536870912;default:return 16}default:return 16}}var mn=null,hn=null,gn=null;function _n(){if(gn)return gn;var e,t=hn,n=t.length,r,i=`value`in mn?mn.value:mn.textContent,a=i.length;for(e=0;e<n&&t[e]===i[e];e++);var o=n-e;for(r=1;r<=o&&t[n-r]===i[a-r];r++);return gn=i.slice(e,1<r?1-r:void 0)}function vn(e){var t=e.keyCode;return`charCode`in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function yn(){return!0}function bn(){return!1}function xn(e){function t(t,n,r,i,a){for(var o in this._reactName=t,this._targetInst=r,this.type=n,this.nativeEvent=i,this.target=a,this.currentTarget=null,e)e.hasOwnProperty(o)&&(t=e[o],this[o]=t?t(i):i[o]);return this.isDefaultPrevented=(i.defaultPrevented==null?!1===i.returnValue:i.defaultPrevented)?yn:bn,this.isPropagationStopped=bn,this}return z(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var e=this.nativeEvent;e&&(e.preventDefault?e.preventDefault():typeof e.returnValue!=`unknown`&&(e.returnValue=!1),this.isDefaultPrevented=yn)},stopPropagation:function(){var e=this.nativeEvent;e&&(e.stopPropagation?e.stopPropagation():typeof e.cancelBubble!=`unknown`&&(e.cancelBubble=!0),this.isPropagationStopped=yn)},persist:function(){},isPersistent:yn}),t}var Sn={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},J=xn(Sn),Cn=z({},Sn,{view:0,detail:0}),wn=xn(Cn),Tn,En,Dn,On=z({},Cn,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:zn,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return`movementX`in e?e.movementX:(e!==Dn&&(Dn&&e.type===`mousemove`?(Tn=e.screenX-Dn.screenX,En=e.screenY-Dn.screenY):En=Tn=0,Dn=e),Tn)},movementY:function(e){return`movementY`in e?e.movementY:En}}),kn=xn(On),An=xn(z({},On,{dataTransfer:0})),jn=xn(z({},Cn,{relatedTarget:0})),Mn=xn(z({},Sn,{animationName:0,elapsedTime:0,pseudoElement:0})),Nn=xn(z({},Sn,{clipboardData:function(e){return`clipboardData`in e?e.clipboardData:window.clipboardData}})),Pn=xn(z({},Sn,{data:0})),Fn={Esc:`Escape`,Spacebar:` `,Left:`ArrowLeft`,Up:`ArrowUp`,Right:`ArrowRight`,Down:`ArrowDown`,Del:`Delete`,Win:`OS`,Menu:`ContextMenu`,Apps:`ContextMenu`,Scroll:`ScrollLock`,MozPrintableKey:`Unidentified`},In={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`},Ln={Alt:`altKey`,Control:`ctrlKey`,Meta:`metaKey`,Shift:`shiftKey`};function Rn(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=Ln[e])?!!t[e]:!1}function zn(){return Rn}var Bn=xn(z({},Cn,{key:function(e){if(e.key){var t=Fn[e.key]||e.key;if(t!==`Unidentified`)return t}return e.type===`keypress`?(e=vn(e),e===13?`Enter`:String.fromCharCode(e)):e.type===`keydown`||e.type===`keyup`?In[e.keyCode]||`Unidentified`:``},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:zn,charCode:function(e){return e.type===`keypress`?vn(e):0},keyCode:function(e){return e.type===`keydown`||e.type===`keyup`?e.keyCode:0},which:function(e){return e.type===`keypress`?vn(e):e.type===`keydown`||e.type===`keyup`?e.keyCode:0}})),Vn=xn(z({},On,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0})),Hn=xn(z({},Cn,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:zn})),Un=xn(z({},Sn,{propertyName:0,elapsedTime:0,pseudoElement:0})),Wn=xn(z({},On,{deltaX:function(e){return`deltaX`in e?e.deltaX:`wheelDeltaX`in e?-e.wheelDeltaX:0},deltaY:function(e){return`deltaY`in e?e.deltaY:`wheelDeltaY`in e?-e.wheelDeltaY:`wheelDelta`in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0})),Gn=[9,13,27,32],Kn=c&&`CompositionEvent`in window,qn=null;c&&`documentMode`in document&&(qn=document.documentMode);var Jn=c&&`TextEvent`in window&&!qn,Yn=c&&(!Kn||qn&&8<qn&&11>=qn),Xn=` `,Zn=!1;function Qn(e,t){switch(e){case`keyup`:return Gn.indexOf(t.keyCode)!==-1;case`keydown`:return t.keyCode!==229;case`keypress`:case`mousedown`:case`focusout`:return!0;default:return!1}}function $n(e){return e=e.detail,typeof e==`object`&&`data`in e?e.data:null}var er=!1;function tr(e,t){switch(e){case`compositionend`:return $n(t);case`keypress`:return t.which===32?(Zn=!0,Xn):null;case`textInput`:return e=t.data,e===Xn&&Zn?null:e;default:return null}}function nr(e,t){if(er)return e===`compositionend`||!Kn&&Qn(e,t)?(e=_n(),gn=hn=mn=null,er=!1,e):null;switch(e){case`paste`:return null;case`keypress`:if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case`compositionend`:return Yn&&t.locale!==`ko`?null:t.data;default:return null}}var rr={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 ir(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t===`input`?!!rr[e.type]:t===`textarea`}function ar(e,t,n,r){Ie(r),t=si(t,`onChange`),0<t.length&&(n=new J(`onChange`,`change`,null,n,r),e.push({event:n,listeners:t}))}var or=null,sr=null;function cr(e){$r(e,0)}function lr(e){if(ie(Fi(e)))return e}function ur(e,t){if(e===`change`)return t}var dr=!1;if(c){var fr;if(c){var pr=`oninput`in document;if(!pr){var mr=document.createElement(`div`);mr.setAttribute(`oninput`,`return;`),pr=typeof mr.oninput==`function`}fr=pr}else fr=!1;dr=fr&&(!document.documentMode||9<document.documentMode)}function hr(){or&&(or.detachEvent(`onpropertychange`,gr),sr=or=null)}function gr(e){if(e.propertyName===`value`&&lr(sr)){var t=[];ar(t,sr,e,je(e)),Ve(cr,t)}}function _r(e,t,n){e===`focusin`?(hr(),or=t,sr=n,or.attachEvent(`onpropertychange`,gr)):e===`focusout`&&hr()}function vr(e){if(e===`selectionchange`||e===`keyup`||e===`keydown`)return lr(sr)}function yr(e,t){if(e===`click`)return lr(t)}function br(e,t){if(e===`input`||e===`change`)return lr(t)}function xr(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var Sr=typeof Object.is==`function`?Object.is:xr;function Cr(e,t){if(Sr(e,t))return!0;if(typeof e!=`object`||!e||typeof t!=`object`||!t)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(r=0;r<n.length;r++){var i=n[r];if(!l.call(t,i)||!Sr(e[i],t[i]))return!1}return!0}function wr(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Tr(e,t){var n=wr(e);e=0;for(var r;n;){if(n.nodeType===3){if(r=e+n.textContent.length,e<=t&&r>=t)return{node:n,offset:t-e};e=r}a:{for(;n;){if(n.nextSibling){n=n.nextSibling;break a}n=n.parentNode}n=void 0}n=wr(n)}}function Er(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Er(e,t.parentNode):`contains`in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Dr(){for(var e=window,t=ae();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href==`string`}catch{n=!1}if(n)e=t.contentWindow;else break;t=ae(e.document)}return t}function Or(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t===`input`&&(e.type===`text`||e.type===`search`||e.type===`tel`||e.type===`url`||e.type===`password`)||t===`textarea`||e.contentEditable===`true`)}function kr(e){var t=Dr(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&Er(n.ownerDocument.documentElement,n)){if(r!==null&&Or(n)){if(t=r.start,e=r.end,e===void 0&&(e=t),`selectionStart`in n)n.selectionStart=t,n.selectionEnd=Math.min(e,n.value.length);else if(e=(t=n.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var i=n.textContent.length,a=Math.min(r.start,i);r=r.end===void 0?a:Math.min(r.end,i),!e.extend&&a>r&&(i=r,r=a,a=i),i=Tr(n,a);var o=Tr(n,r);i&&o&&(e.rangeCount!==1||e.anchorNode!==i.node||e.anchorOffset!==i.offset||e.focusNode!==o.node||e.focusOffset!==o.offset)&&(t=t.createRange(),t.setStart(i.node,i.offset),e.removeAllRanges(),a>r?(e.addRange(t),e.extend(o.node,o.offset)):(t.setEnd(o.node,o.offset),e.addRange(t)))}}for(t=[],e=n;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof n.focus==`function`&&n.focus(),n=0;n<t.length;n++)e=t[n],e.element.scrollLeft=e.left,e.element.scrollTop=e.top}}var Ar=c&&`documentMode`in document&&11>=document.documentMode,jr=null,Mr=null,Nr=null,Pr=!1;function Fr(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Pr||jr==null||jr!==ae(r)||(r=jr,`selectionStart`in r&&Or(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),Nr&&Cr(Nr,r)||(Nr=r,r=si(Mr,`onSelect`),0<r.length&&(t=new J(`onSelect`,`select`,null,t,n),e.push({event:t,listeners:r}),t.target=jr)))}function Ir(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n[`Webkit`+e]=`webkit`+t,n[`Moz`+e]=`moz`+t,n}var Lr={animationend:Ir(`Animation`,`AnimationEnd`),animationiteration:Ir(`Animation`,`AnimationIteration`),animationstart:Ir(`Animation`,`AnimationStart`),transitionend:Ir(`Transition`,`TransitionEnd`)},Rr={},zr={};c&&(zr=document.createElement(`div`).style,`AnimationEvent`in window||(delete Lr.animationend.animation,delete Lr.animationiteration.animation,delete Lr.animationstart.animation),`TransitionEvent`in window||delete Lr.transitionend.transition);function Br(e){if(Rr[e])return Rr[e];if(!Lr[e])return e;var t=Lr[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in zr)return Rr[e]=t[n];return e}var Vr=Br(`animationend`),Hr=Br(`animationiteration`),Ur=Br(`animationstart`),Wr=Br(`transitionend`),Gr=new Map,Kr=`abort auxClick cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel`.split(` `);function qr(e,t){Gr.set(e,t),o(t,[e])}for(var Jr=0;Jr<Kr.length;Jr++){var Yr=Kr[Jr];qr(Yr.toLowerCase(),`on`+(Yr[0].toUpperCase()+Yr.slice(1)))}qr(Vr,`onAnimationEnd`),qr(Hr,`onAnimationIteration`),qr(Ur,`onAnimationStart`),qr(`dblclick`,`onDoubleClick`),qr(`focusin`,`onFocus`),qr(`focusout`,`onBlur`),qr(Wr,`onTransitionEnd`),s(`onMouseEnter`,[`mouseout`,`mouseover`]),s(`onMouseLeave`,[`mouseout`,`mouseover`]),s(`onPointerEnter`,[`pointerout`,`pointerover`]),s(`onPointerLeave`,[`pointerout`,`pointerover`]),o(`onChange`,`change click focusin focusout input keydown keyup selectionchange`.split(` `)),o(`onSelect`,`focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange`.split(` `)),o(`onBeforeInput`,[`compositionend`,`keypress`,`textInput`,`paste`]),o(`onCompositionEnd`,`compositionend focusout keydown keypress keyup mousedown`.split(` `)),o(`onCompositionStart`,`compositionstart focusout keydown keypress keyup mousedown`.split(` `)),o(`onCompositionUpdate`,`compositionupdate focusout keydown keypress keyup mousedown`.split(` `));var Xr=`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(` `),Zr=new Set(`cancel close invalid load scroll toggle`.split(` `).concat(Xr));function Qr(e,t,n){var r=e.type||`unknown-event`;e.currentTarget=n,Ze(r,t,void 0,e),e.currentTarget=null}function $r(e,t){t=(t&4)!=0;for(var n=0;n<e.length;n++){var r=e[n],i=r.event;r=r.listeners;a:{var a=void 0;if(t)for(var o=r.length-1;0<=o;o--){var s=r[o],c=s.instance,l=s.currentTarget;if(s=s.listener,c!==a&&i.isPropagationStopped())break a;Qr(i,s,l),a=c}else for(o=0;o<r.length;o++){if(s=r[o],c=s.instance,l=s.currentTarget,s=s.listener,c!==a&&i.isPropagationStopped())break a;Qr(i,s,l),a=c}}}if(Je)throw e=q,Je=!1,q=null,e}function ei(e,t){var n=t[Ai];n===void 0&&(n=t[Ai]=new Set);var r=e+`__bubble`;n.has(r)||(ii(t,e,2,!1),n.add(r))}function ti(e,t,n){var r=0;t&&(r|=4),ii(n,e,r,t)}var ni=`_reactListening`+Math.random().toString(36).slice(2);function ri(e){if(!e[ni]){e[ni]=!0,i.forEach(function(t){t!==`selectionchange`&&(Zr.has(t)||ti(t,!1,e),ti(t,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[ni]||(t[ni]=!0,ti(`selectionchange`,!1,t))}}function ii(e,t,n,r){switch(pn(t)){case 1:var i=cn;break;case 4:i=ln;break;default:i=un}n=i.bind(null,t,n,e),i=void 0,!Ue||t!==`touchstart`&&t!==`touchmove`&&t!==`wheel`||(i=!0),r?i===void 0?e.addEventListener(t,n,!0):e.addEventListener(t,n,{capture:!0,passive:i}):i===void 0?e.addEventListener(t,n,!1):e.addEventListener(t,n,{passive:i})}function ai(e,t,n,r,i){var a=r;if(!(t&1)&&!(t&2)&&r!==null)a:for(;;){if(r===null)return;var o=r.tag;if(o===3||o===4){var s=r.stateNode.containerInfo;if(s===i||s.nodeType===8&&s.parentNode===i)break;if(o===4)for(o=r.return;o!==null;){var c=o.tag;if((c===3||c===4)&&(c=o.stateNode.containerInfo,c===i||c.nodeType===8&&c.parentNode===i))return;o=o.return}for(;s!==null;){if(o=Ni(s),o===null)return;if(c=o.tag,c===5||c===6){r=a=o;continue a}s=s.parentNode}}r=r.return}Ve(function(){var r=a,i=je(n),o=[];a:{var s=Gr.get(e);if(s!==void 0){var c=J,l=e;switch(e){case`keypress`:if(vn(n)===0)break a;case`keydown`:case`keyup`:c=Bn;break;case`focusin`:l=`focus`,c=jn;break;case`focusout`:l=`blur`,c=jn;break;case`beforeblur`:case`afterblur`:c=jn;break;case`click`:if(n.button===2)break a;case`auxclick`:case`dblclick`:case`mousedown`:case`mousemove`:case`mouseup`:case`mouseout`:case`mouseover`:case`contextmenu`:c=kn;break;case`drag`:case`dragend`:case`dragenter`:case`dragexit`:case`dragleave`:case`dragover`:case`dragstart`:case`drop`:c=An;break;case`touchcancel`:case`touchend`:case`touchmove`:case`touchstart`:c=Hn;break;case Vr:case Hr:case Ur:c=Mn;break;case Wr:c=Un;break;case`scroll`:c=wn;break;case`wheel`:c=Wn;break;case`copy`:case`cut`:case`paste`:c=Nn;break;case`gotpointercapture`:case`lostpointercapture`:case`pointercancel`:case`pointerdown`:case`pointermove`:case`pointerout`:case`pointerover`:case`pointerup`:c=Vn}var u=(t&4)!=0,d=!u&&e===`scroll`,f=u?s===null?null:s+`Capture`:s;u=[];for(var p=r,m;p!==null;){m=p;var h=m.stateNode;if(m.tag===5&&h!==null&&(m=h,f!==null&&(h=He(p,f),h!=null&&u.push(oi(p,h,m)))),d)break;p=p.return}0<u.length&&(s=new c(s,l,null,n,i),o.push({event:s,listeners:u}))}}if(!(t&7)){a:{if(s=e===`mouseover`||e===`pointerover`,c=e===`mouseout`||e===`pointerout`,s&&n!==Ae&&(l=n.relatedTarget||n.fromElement)&&(Ni(l)||l[ki]))break a;if((c||s)&&(s=i.window===i?i:(s=i.ownerDocument)?s.defaultView||s.parentWindow:window,c?(l=n.relatedTarget||n.toElement,c=r,l=l?Ni(l):null,l!==null&&(d=Qe(l),l!==d||l.tag!==5&&l.tag!==6)&&(l=null)):(c=null,l=r),c!==l)){if(u=kn,h=`onMouseLeave`,f=`onMouseEnter`,p=`mouse`,(e===`pointerout`||e===`pointerover`)&&(u=Vn,h=`onPointerLeave`,f=`onPointerEnter`,p=`pointer`),d=c==null?s:Fi(c),m=l==null?s:Fi(l),s=new u(h,p+`leave`,c,n,i),s.target=d,s.relatedTarget=m,h=null,Ni(i)===r&&(u=new u(f,p+`enter`,l,n,i),u.target=m,u.relatedTarget=d,h=u),d=h,c&&l)b:{for(u=c,f=l,p=0,m=u;m;m=ci(m))p++;for(m=0,h=f;h;h=ci(h))m++;for(;0<p-m;)u=ci(u),p--;for(;0<m-p;)f=ci(f),m--;for(;p--;){if(u===f||f!==null&&u===f.alternate)break b;u=ci(u),f=ci(f)}u=null}else u=null;c!==null&&li(o,s,c,u,!1),l!==null&&d!==null&&li(o,d,l,u,!0)}}a:{if(s=r?Fi(r):window,c=s.nodeName&&s.nodeName.toLowerCase(),c===`select`||c===`input`&&s.type===`file`)var g=ur;else if(ir(s))if(dr)g=br;else{g=vr;var _=_r}else (c=s.nodeName)&&c.toLowerCase()===`input`&&(s.type===`checkbox`||s.type===`radio`)&&(g=yr);if(g&&=g(e,r)){ar(o,g,n,i);break a}_&&_(e,s,r),e===`focusout`&&(_=s._wrapperState)&&_.controlled&&s.type===`number`&&de(s,`number`,s.value)}switch(_=r?Fi(r):window,e){case`focusin`:(ir(_)||_.contentEditable===`true`)&&(jr=_,Mr=r,Nr=null);break;case`focusout`:Nr=Mr=jr=null;break;case`mousedown`:Pr=!0;break;case`contextmenu`:case`mouseup`:case`dragend`:Pr=!1,Fr(o,n,i);break;case`selectionchange`:if(Ar)break;case`keydown`:case`keyup`:Fr(o,n,i)}var v;if(Kn)b:{switch(e){case`compositionstart`:var y=`onCompositionStart`;break b;case`compositionend`:y=`onCompositionEnd`;break b;case`compositionupdate`:y=`onCompositionUpdate`;break b}y=void 0}else er?Qn(e,n)&&(y=`onCompositionEnd`):e===`keydown`&&n.keyCode===229&&(y=`onCompositionStart`);y&&(Yn&&n.locale!==`ko`&&(er||y!==`onCompositionStart`?y===`onCompositionEnd`&&er&&(v=_n()):(mn=i,hn=`value`in mn?mn.value:mn.textContent,er=!0)),_=si(r,y),0<_.length&&(y=new Pn(y,e,null,n,i),o.push({event:y,listeners:_}),v?y.data=v:(v=$n(n),v!==null&&(y.data=v)))),(v=Jn?tr(e,n):nr(e,n))&&(r=si(r,`onBeforeInput`),0<r.length&&(i=new Pn(`onBeforeInput`,`beforeinput`,null,n,i),o.push({event:i,listeners:r}),i.data=v))}$r(o,t)})}function oi(e,t,n){return{instance:e,listener:t,currentTarget:n}}function si(e,t){for(var n=t+`Capture`,r=[];e!==null;){var i=e,a=i.stateNode;i.tag===5&&a!==null&&(i=a,a=He(e,n),a!=null&&r.unshift(oi(e,a,i)),a=He(e,t),a!=null&&r.push(oi(e,a,i))),e=e.return}return r}function ci(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function li(e,t,n,r,i){for(var a=t._reactName,o=[];n!==null&&n!==r;){var s=n,c=s.alternate,l=s.stateNode;if(c!==null&&c===r)break;s.tag===5&&l!==null&&(s=l,i?(c=He(n,a),c!=null&&o.unshift(oi(n,c,s))):i||(c=He(n,a),c!=null&&o.push(oi(n,c,s)))),n=n.return}o.length!==0&&e.push({event:t,listeners:o})}var ui=/\r\n?/g,di=/\u0000|\uFFFD/g;function fi(e){return(typeof e==`string`?e:``+e).replace(ui,`
6
6
  `).replace(di,``)}function pi(e,t,n){if(t=fi(t),fi(e)!==t&&n)throw Error(r(425))}function mi(){}var hi=null,gi=null;function _i(e,t){return e===`textarea`||e===`noscript`||typeof t.children==`string`||typeof t.children==`number`||typeof t.dangerouslySetInnerHTML==`object`&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var vi=typeof setTimeout==`function`?setTimeout:void 0,yi=typeof clearTimeout==`function`?clearTimeout:void 0,bi=typeof Promise==`function`?Promise:void 0,xi=typeof queueMicrotask==`function`?queueMicrotask:bi===void 0?vi:function(e){return bi.resolve(null).then(e).catch(Si)};function Si(e){setTimeout(function(){throw e})}function Ci(e,t){var n=t,r=0;do{var i=n.nextSibling;if(e.removeChild(n),i&&i.nodeType===8)if(n=i.data,n===`/$`){if(r===0){e.removeChild(i),an(t);return}r--}else n!==`$`&&n!==`$?`&&n!==`$!`||r++;n=i}while(n);an(t)}function wi(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t===`$`||t===`$!`||t===`$?`)break;if(t===`/$`)return null}}return e}function Ti(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`$`||n===`$!`||n===`$?`){if(t===0)return e;t--}else n===`/$`&&t++}e=e.previousSibling}return null}var Ei=Math.random().toString(36).slice(2),Di=`__reactFiber$`+Ei,Oi=`__reactProps$`+Ei,ki=`__reactContainer$`+Ei,Ai=`__reactEvents$`+Ei,ji=`__reactListeners$`+Ei,Mi=`__reactHandles$`+Ei;function Ni(e){var t=e[Di];if(t)return t;for(var n=e.parentNode;n;){if(t=n[ki]||n[Di]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=Ti(e);e!==null;){if(n=e[Di])return n;e=Ti(e)}return t}e=n,n=e.parentNode}return null}function Pi(e){return e=e[Di]||e[ki],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function Fi(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(r(33))}function Ii(e){return e[Oi]||null}var Li=[],Ri=-1;function zi(e){return{current:e}}function Bi(e){0>Ri||(e.current=Li[Ri],Li[Ri]=null,Ri--)}function Vi(e,t){Ri++,Li[Ri]=e.current,e.current=t}var Hi={},Ui=zi(Hi),Wi=zi(!1),Gi=Hi;function Ki(e,t){var n=e.type.contextTypes;if(!n)return Hi;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var i={},a;for(a in n)i[a]=t[a];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=i),i}function qi(e){return e=e.childContextTypes,e!=null}function Ji(){Bi(Wi),Bi(Ui)}function Yi(e,t,n){if(Ui.current!==Hi)throw Error(r(168));Vi(Ui,t),Vi(Wi,n)}function Xi(e,t,n){var i=e.stateNode;if(t=t.childContextTypes,typeof i.getChildContext!=`function`)return n;for(var a in i=i.getChildContext(),i)if(!(a in t))throw Error(r(108,ee(e)||`Unknown`,a));return z({},n,i)}function Zi(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Hi,Gi=Ui.current,Vi(Ui,e),Vi(Wi,Wi.current),!0}function Qi(e,t,n){var i=e.stateNode;if(!i)throw Error(r(169));n?(e=Xi(e,t,Gi),i.__reactInternalMemoizedMergedChildContext=e,Bi(Wi),Bi(Ui),Vi(Ui,e)):Bi(Wi),Vi(Wi,n)}var $i=null,ea=!1,ta=!1;function na(e){$i===null?$i=[e]:$i.push(e)}function ra(e){ea=!0,na(e)}function ia(){if(!ta&&$i!==null){ta=!0;var e=0,t=Pt;try{var n=$i;for(Pt=1;e<n.length;e++){var r=n[e];do r=r(!0);while(r!==null)}$i=null,ea=!1}catch(t){throw $i!==null&&($i=$i.slice(e+1)),it(ut,ia),t}finally{Pt=t,ta=!1}}return null}var aa=[],oa=0,sa=null,ca=0,la=[],ua=0,da=null,fa=1,pa=``;function ma(e,t){aa[oa++]=ca,aa[oa++]=sa,sa=e,ca=t}function ha(e,t,n){la[ua++]=fa,la[ua++]=pa,la[ua++]=da,da=e;var r=fa;e=pa;var i=32-vt(r)-1;r&=~(1<<i),n+=1;var a=32-vt(t)+i;if(30<a){var o=i-i%5;a=(r&(1<<o)-1).toString(32),r>>=o,i-=o,fa=1<<32-vt(t)+i|n<<i|r,pa=a+e}else fa=1<<a|n<<i|r,pa=e}function ga(e){e.return!==null&&(ma(e,1),ha(e,1,0))}function _a(e){for(;e===sa;)sa=aa[--oa],aa[oa]=null,ca=aa[--oa],aa[oa]=null;for(;e===da;)da=la[--ua],la[ua]=null,pa=la[--ua],la[ua]=null,fa=la[--ua],la[ua]=null}var va=null,ya=null,ba=!1,xa=null;function Sa(e,t){var n=Xl(5,null,null,0);n.elementType=`DELETED`,n.stateNode=t,n.return=e,t=e.deletions,t===null?(e.deletions=[n],e.flags|=16):t.push(n)}function Ca(e,t){switch(e.tag){case 5:var n=e.type;return t=t.nodeType!==1||n.toLowerCase()!==t.nodeName.toLowerCase()?null:t,t===null?!1:(e.stateNode=t,va=e,ya=wi(t.firstChild),!0);case 6:return t=e.pendingProps===``||t.nodeType!==3?null:t,t===null?!1:(e.stateNode=t,va=e,ya=null,!0);case 13:return t=t.nodeType===8?t:null,t===null?!1:(n=da===null?null:{id:fa,overflow:pa},e.memoizedState={dehydrated:t,treeContext:n,retryLane:1073741824},n=Xl(18,null,null,0),n.stateNode=t,n.return=e,e.child=n,va=e,ya=null,!0);default:return!1}}function wa(e){return(e.mode&1)!=0&&(e.flags&128)==0}function Ta(e){if(ba){var t=ya;if(t){var n=t;if(!Ca(e,t)){if(wa(e))throw Error(r(418));t=wi(n.nextSibling);var i=va;t&&Ca(e,t)?Sa(i,n):(e.flags=e.flags&-4097|2,ba=!1,va=e)}}else{if(wa(e))throw Error(r(418));e.flags=e.flags&-4097|2,ba=!1,va=e}}}function Ea(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;va=e}function Da(e){if(e!==va)return!1;if(!ba)return Ea(e),ba=!0,!1;var t;if((t=e.tag!==3)&&!(t=e.tag!==5)&&(t=e.type,t=t!==`head`&&t!==`body`&&!_i(e.type,e.memoizedProps)),t&&=ya){if(wa(e))throw Oa(),Error(r(418));for(;t;)Sa(e,t),t=wi(t.nextSibling)}if(Ea(e),e.tag===13){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(r(317));a:{for(e=e.nextSibling,t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`/$`){if(t===0){ya=wi(e.nextSibling);break a}t--}else n!==`$`&&n!==`$!`&&n!==`$?`||t++}e=e.nextSibling}ya=null}}else ya=va?wi(e.stateNode.nextSibling):null;return!0}function Oa(){for(var e=ya;e;)e=wi(e.nextSibling)}function ka(){ya=va=null,ba=!1}function Aa(e){xa===null?xa=[e]:xa.push(e)}var ja=C.ReactCurrentBatchConfig;function Ma(e,t,n){if(e=n.ref,e!==null&&typeof e!=`function`&&typeof e!=`object`){if(n._owner){if(n=n._owner,n){if(n.tag!==1)throw Error(r(309));var i=n.stateNode}if(!i)throw Error(r(147,e));var a=i,o=``+e;return t!==null&&t.ref!==null&&typeof t.ref==`function`&&t.ref._stringRef===o?t.ref:(t=function(e){var t=a.refs;e===null?delete t[o]:t[o]=e},t._stringRef=o,t)}if(typeof e!=`string`)throw Error(r(284));if(!n._owner)throw Error(r(290,e))}return e}function Na(e,t){throw e=Object.prototype.toString.call(t),Error(r(31,e===`[object Object]`?`object with keys {`+Object.keys(t).join(`, `)+`}`:e))}function Pa(e){var t=e._init;return t(e._payload)}function Fa(e){function t(t,n){if(e){var r=t.deletions;r===null?(t.deletions=[n],t.flags|=16):r.push(n)}}function n(n,r){if(!e)return null;for(;r!==null;)t(n,r),r=r.sibling;return null}function i(e,t){for(e=new Map;t!==null;)t.key===null?e.set(t.index,t):e.set(t.key,t),t=t.sibling;return e}function a(e,t){return e=$l(e,t),e.index=0,e.sibling=null,e}function o(t,n,r){return t.index=r,e?(r=t.alternate,r===null?(t.flags|=2,n):(r=r.index,r<n?(t.flags|=2,n):r)):(t.flags|=1048576,n)}function s(t){return e&&t.alternate===null&&(t.flags|=2),t}function c(e,t,n,r){return t===null||t.tag!==6?(t=ru(n,e.mode,r),t.return=e,t):(t=a(t,n),t.return=e,t)}function l(e,t,n,r){var i=n.type;return i===E?d(e,t,n.props.children,r,n.key):t!==null&&(t.elementType===i||typeof i==`object`&&i&&i.$$typeof===F&&Pa(i)===t.type)?(r=a(t,n.props),r.ref=Ma(e,t,n),r.return=e,r):(r=eu(n.type,n.key,n.props,null,e.mode,r),r.ref=Ma(e,t,n),r.return=e,r)}function u(e,t,n,r){return t===null||t.tag!==4||t.stateNode.containerInfo!==n.containerInfo||t.stateNode.implementation!==n.implementation?(t=iu(n,e.mode,r),t.return=e,t):(t=a(t,n.children||[]),t.return=e,t)}function d(e,t,n,r,i){return t===null||t.tag!==7?(t=tu(n,e.mode,r,i),t.return=e,t):(t=a(t,n),t.return=e,t)}function f(e,t,n){if(typeof t==`string`&&t!==``||typeof t==`number`)return t=ru(``+t,e.mode,n),t.return=e,t;if(typeof t==`object`&&t){switch(t.$$typeof){case w:return n=eu(t.type,t.key,t.props,null,e.mode,n),n.ref=Ma(e,null,t),n.return=e,n;case T:return t=iu(t,e.mode,n),t.return=e,t;case F:var r=t._init;return f(e,r(t._payload),n)}if(fe(t)||R(t))return t=tu(t,e.mode,n,null),t.return=e,t;Na(e,t)}return null}function p(e,t,n,r){var i=t===null?null:t.key;if(typeof n==`string`&&n!==``||typeof n==`number`)return i===null?c(e,t,``+n,r):null;if(typeof n==`object`&&n){switch(n.$$typeof){case w:return n.key===i?l(e,t,n,r):null;case T:return n.key===i?u(e,t,n,r):null;case F:return i=n._init,p(e,t,i(n._payload),r)}if(fe(n)||R(n))return i===null?d(e,t,n,r,null):null;Na(e,n)}return null}function m(e,t,n,r,i){if(typeof r==`string`&&r!==``||typeof r==`number`)return e=e.get(n)||null,c(t,e,``+r,i);if(typeof r==`object`&&r){switch(r.$$typeof){case w:return e=e.get(r.key===null?n:r.key)||null,l(t,e,r,i);case T:return e=e.get(r.key===null?n:r.key)||null,u(t,e,r,i);case F:var a=r._init;return m(e,t,n,a(r._payload),i)}if(fe(r)||R(r))return e=e.get(n)||null,d(t,e,r,i,null);Na(t,r)}return null}function h(r,a,s,c){for(var l=null,u=null,d=a,h=a=0,g=null;d!==null&&h<s.length;h++){d.index>h?(g=d,d=null):g=d.sibling;var _=p(r,d,s[h],c);if(_===null){d===null&&(d=g);break}e&&d&&_.alternate===null&&t(r,d),a=o(_,a,h),u===null?l=_:u.sibling=_,u=_,d=g}if(h===s.length)return n(r,d),ba&&ma(r,h),l;if(d===null){for(;h<s.length;h++)d=f(r,s[h],c),d!==null&&(a=o(d,a,h),u===null?l=d:u.sibling=d,u=d);return ba&&ma(r,h),l}for(d=i(r,d);h<s.length;h++)g=m(d,r,h,s[h],c),g!==null&&(e&&g.alternate!==null&&d.delete(g.key===null?h:g.key),a=o(g,a,h),u===null?l=g:u.sibling=g,u=g);return e&&d.forEach(function(e){return t(r,e)}),ba&&ma(r,h),l}function g(a,s,c,l){var u=R(c);if(typeof u!=`function`)throw Error(r(150));if(c=u.call(c),c==null)throw Error(r(151));for(var d=u=null,h=s,g=s=0,_=null,v=c.next();h!==null&&!v.done;g++,v=c.next()){h.index>g?(_=h,h=null):_=h.sibling;var y=p(a,h,v.value,l);if(y===null){h===null&&(h=_);break}e&&h&&y.alternate===null&&t(a,h),s=o(y,s,g),d===null?u=y:d.sibling=y,d=y,h=_}if(v.done)return n(a,h),ba&&ma(a,g),u;if(h===null){for(;!v.done;g++,v=c.next())v=f(a,v.value,l),v!==null&&(s=o(v,s,g),d===null?u=v:d.sibling=v,d=v);return ba&&ma(a,g),u}for(h=i(a,h);!v.done;g++,v=c.next())v=m(h,a,g,v.value,l),v!==null&&(e&&v.alternate!==null&&h.delete(v.key===null?g:v.key),s=o(v,s,g),d===null?u=v:d.sibling=v,d=v);return e&&h.forEach(function(e){return t(a,e)}),ba&&ma(a,g),u}function _(e,r,i,o){if(typeof i==`object`&&i&&i.type===E&&i.key===null&&(i=i.props.children),typeof i==`object`&&i){switch(i.$$typeof){case w:a:{for(var c=i.key,l=r;l!==null;){if(l.key===c){if(c=i.type,c===E){if(l.tag===7){n(e,l.sibling),r=a(l,i.props.children),r.return=e,e=r;break a}}else if(l.elementType===c||typeof c==`object`&&c&&c.$$typeof===F&&Pa(c)===l.type){n(e,l.sibling),r=a(l,i.props),r.ref=Ma(e,l,i),r.return=e,e=r;break a}n(e,l);break}else t(e,l);l=l.sibling}i.type===E?(r=tu(i.props.children,e.mode,o,i.key),r.return=e,e=r):(o=eu(i.type,i.key,i.props,null,e.mode,o),o.ref=Ma(e,r,i),o.return=e,e=o)}return s(e);case T:a:{for(l=i.key;r!==null;){if(r.key===l)if(r.tag===4&&r.stateNode.containerInfo===i.containerInfo&&r.stateNode.implementation===i.implementation){n(e,r.sibling),r=a(r,i.children||[]),r.return=e,e=r;break a}else{n(e,r);break}else t(e,r);r=r.sibling}r=iu(i,e.mode,o),r.return=e,e=r}return s(e);case F:return l=i._init,_(e,r,l(i._payload),o)}if(fe(i))return h(e,r,i,o);if(R(i))return g(e,r,i,o);Na(e,i)}return typeof i==`string`&&i!==``||typeof i==`number`?(i=``+i,r!==null&&r.tag===6?(n(e,r.sibling),r=a(r,i),r.return=e,e=r):(n(e,r),r=ru(i,e.mode,o),r.return=e,e=r),s(e)):n(e,r)}return _}var Ia=Fa(!0),La=Fa(!1),Ra=zi(null),za=null,Ba=null,Va=null;function Ha(){Va=Ba=za=null}function Ua(e){var t=Ra.current;Bi(Ra),e._currentValue=t}function Wa(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)===t?r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t):(e.childLanes|=t,r!==null&&(r.childLanes|=t)),e===n)break;e=e.return}}function Ga(e,t){za=e,Va=Ba=null,e=e.dependencies,e!==null&&e.firstContext!==null&&((e.lanes&t)!==0&&(Fs=!0),e.firstContext=null)}function Ka(e){var t=e._currentValue;if(Va!==e)if(e={context:e,memoizedValue:t,next:null},Ba===null){if(za===null)throw Error(r(308));Ba=e,za.dependencies={lanes:0,firstContext:e}}else Ba=Ba.next=e;return t}var qa=null;function Ja(e){qa===null?qa=[e]:qa.push(e)}function Ya(e,t,n,r){var i=t.interleaved;return i===null?(n.next=n,Ja(t)):(n.next=i.next,i.next=n),t.interleaved=n,Xa(e,r)}function Xa(e,t){e.lanes|=t;var n=e.alternate;for(n!==null&&(n.lanes|=t),n=e,e=e.return;e!==null;)e.childLanes|=t,n=e.alternate,n!==null&&(n.childLanes|=t),n=e,e=e.return;return n.tag===3?n.stateNode:null}var Za=!1;function Qa(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function $a(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function eo(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function to(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,Wc&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,Xa(e,n)}return i=r.interleaved,i===null?(t.next=t,Ja(r)):(t.next=i.next,i.next=t),r.interleaved=t,Xa(e,n)}function no(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,n&4194240)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Nt(e,n)}}function ro(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var i=null,a=null;if(n=n.firstBaseUpdate,n!==null){do{var o={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};a===null?i=a=o:a=a.next=o,n=n.next}while(n!==null);a===null?i=a=t:a=a.next=t}else i=a=t;n={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:a,shared:r.shared,effects:r.effects},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}function io(e,t,n,r){var i=e.updateQueue;Za=!1;var a=i.firstBaseUpdate,o=i.lastBaseUpdate,s=i.shared.pending;if(s!==null){i.shared.pending=null;var c=s,l=c.next;c.next=null,o===null?a=l:o.next=l,o=c;var u=e.alternate;u!==null&&(u=u.updateQueue,s=u.lastBaseUpdate,s!==o&&(s===null?u.firstBaseUpdate=l:s.next=l,u.lastBaseUpdate=c))}if(a!==null){var d=i.baseState;o=0,u=l=c=null,s=a;do{var f=s.lane,p=s.eventTime;if((r&f)===f){u!==null&&(u=u.next={eventTime:p,lane:0,tag:s.tag,payload:s.payload,callback:s.callback,next:null});a:{var m=e,h=s;switch(f=t,p=n,h.tag){case 1:if(m=h.payload,typeof m==`function`){d=m.call(p,d,f);break a}d=m;break a;case 3:m.flags=m.flags&-65537|128;case 0:if(m=h.payload,f=typeof m==`function`?m.call(p,d,f):m,f==null)break a;d=z({},d,f);break a;case 2:Za=!0}}s.callback!==null&&s.lane!==0&&(e.flags|=64,f=i.effects,f===null?i.effects=[s]:f.push(s))}else p={eventTime:p,lane:f,tag:s.tag,payload:s.payload,callback:s.callback,next:null},u===null?(l=u=p,c=d):u=u.next=p,o|=f;if(s=s.next,s===null){if(s=i.shared.pending,s===null)break;f=s,s=f.next,f.next=null,i.lastBaseUpdate=f,i.shared.pending=null}}while(1);if(u===null&&(c=d),i.baseState=c,i.firstBaseUpdate=l,i.lastBaseUpdate=u,t=i.shared.interleaved,t!==null){i=t;do o|=i.lane,i=i.next;while(i!==t)}else a===null&&(i.shared.lanes=0);Qc|=o,e.lanes=o,e.memoizedState=d}}function ao(e,t,n){if(e=t.effects,t.effects=null,e!==null)for(t=0;t<e.length;t++){var i=e[t],a=i.callback;if(a!==null){if(i.callback=null,i=n,typeof a!=`function`)throw Error(r(191,a));a.call(i)}}}var oo={},so=zi(oo),co=zi(oo),lo=zi(oo);function uo(e){if(e===oo)throw Error(r(174));return e}function fo(e,t){switch(Vi(lo,t),Vi(co,e),Vi(so,oo),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:ye(null,``);break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=ye(t,e)}Bi(so),Vi(so,t)}function po(){Bi(so),Bi(co),Bi(lo)}function mo(e){uo(lo.current);var t=uo(so.current),n=ye(t,e.type);t!==n&&(Vi(co,e),Vi(so,n))}function ho(e){co.current===e&&(Bi(so),Bi(co))}var go=zi(0);function _o(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||n.data===`$?`||n.data===`$!`))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==void 0){if(t.flags&128)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var vo=[];function yo(){for(var e=0;e<vo.length;e++)vo[e]._workInProgressVersionPrimary=null;vo.length=0}var bo=C.ReactCurrentDispatcher,xo=C.ReactCurrentBatchConfig,So=0,Co=null,wo=null,To=null,Eo=!1,Do=!1,Oo=0,ko=0;function Ao(){throw Error(r(321))}function jo(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!Sr(e[n],t[n]))return!1;return!0}function Mo(e,t,n,i,a,o){if(So=o,Co=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,bo.current=e===null||e.memoizedState===null?hs:gs,e=n(i,a),Do){o=0;do{if(Do=!1,Oo=0,25<=o)throw Error(r(301));o+=1,To=wo=null,t.updateQueue=null,bo.current=_s,e=n(i,a)}while(Do)}if(bo.current=ms,t=wo!==null&&wo.next!==null,So=0,To=wo=Co=null,Eo=!1,t)throw Error(r(300));return e}function No(){var e=Oo!==0;return Oo=0,e}function Po(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return To===null?Co.memoizedState=To=e:To=To.next=e,To}function Fo(){if(wo===null){var e=Co.alternate;e=e===null?null:e.memoizedState}else e=wo.next;var t=To===null?Co.memoizedState:To.next;if(t!==null)To=t,wo=e;else{if(e===null)throw Error(r(310));wo=e,e={memoizedState:wo.memoizedState,baseState:wo.baseState,baseQueue:wo.baseQueue,queue:wo.queue,next:null},To===null?Co.memoizedState=To=e:To=To.next=e}return To}function Io(e,t){return typeof t==`function`?t(e):t}function Lo(e){var t=Fo(),n=t.queue;if(n===null)throw Error(r(311));n.lastRenderedReducer=e;var i=wo,a=i.baseQueue,o=n.pending;if(o!==null){if(a!==null){var s=a.next;a.next=o.next,o.next=s}i.baseQueue=a=o,n.pending=null}if(a!==null){o=a.next,i=i.baseState;var c=s=null,l=null,u=o;do{var d=u.lane;if((So&d)===d)l!==null&&(l=l.next={lane:0,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null}),i=u.hasEagerState?u.eagerState:e(i,u.action);else{var f={lane:d,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null};l===null?(c=l=f,s=i):l=l.next=f,Co.lanes|=d,Qc|=d}u=u.next}while(u!==null&&u!==o);l===null?s=i:l.next=c,Sr(i,t.memoizedState)||(Fs=!0),t.memoizedState=i,t.baseState=s,t.baseQueue=l,n.lastRenderedState=i}if(e=n.interleaved,e!==null){a=e;do o=a.lane,Co.lanes|=o,Qc|=o,a=a.next;while(a!==e)}else a===null&&(n.lanes=0);return[t.memoizedState,n.dispatch]}function Ro(e){var t=Fo(),n=t.queue;if(n===null)throw Error(r(311));n.lastRenderedReducer=e;var i=n.dispatch,a=n.pending,o=t.memoizedState;if(a!==null){n.pending=null;var s=a=a.next;do o=e(o,s.action),s=s.next;while(s!==a);Sr(o,t.memoizedState)||(Fs=!0),t.memoizedState=o,t.baseQueue===null&&(t.baseState=o),n.lastRenderedState=o}return[o,i]}function zo(){}function Bo(e,t){var n=Co,i=Fo(),a=t(),o=!Sr(i.memoizedState,a);if(o&&(i.memoizedState=a,Fs=!0),i=i.queue,Qo(Uo.bind(null,n,i,e),[e]),i.getSnapshot!==t||o||To!==null&&To.memoizedState.tag&1){if(n.flags|=2048,qo(9,Ho.bind(null,n,i,a,t),void 0,null),Gc===null)throw Error(r(349));So&30||Vo(n,t,a)}return a}function Vo(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=Co.updateQueue,t===null?(t={lastEffect:null,stores:null},Co.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function Ho(e,t,n,r){t.value=n,t.getSnapshot=r,Wo(t)&&Go(e)}function Uo(e,t,n){return n(function(){Wo(t)&&Go(e)})}function Wo(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!Sr(e,n)}catch{return!0}}function Go(e){var t=Xa(e,1);t!==null&&vl(t,e,1,-1)}function Ko(e){var t=Po();return typeof e==`function`&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:Io,lastRenderedState:e},t.queue=e,e=e.dispatch=us.bind(null,Co,e),[t.memoizedState,e]}function qo(e,t,n,r){return e={tag:e,create:t,destroy:n,deps:r,next:null},t=Co.updateQueue,t===null?(t={lastEffect:null,stores:null},Co.updateQueue=t,t.lastEffect=e.next=e):(n=t.lastEffect,n===null?t.lastEffect=e.next=e:(r=n.next,n.next=e,e.next=r,t.lastEffect=e)),e}function Jo(){return Fo().memoizedState}function Yo(e,t,n,r){var i=Po();Co.flags|=e,i.memoizedState=qo(1|t,n,void 0,r===void 0?null:r)}function Xo(e,t,n,r){var i=Fo();r=r===void 0?null:r;var a=void 0;if(wo!==null){var o=wo.memoizedState;if(a=o.destroy,r!==null&&jo(r,o.deps)){i.memoizedState=qo(t,n,a,r);return}}Co.flags|=e,i.memoizedState=qo(1|t,n,a,r)}function Zo(e,t){return Yo(8390656,8,e,t)}function Qo(e,t){return Xo(2048,8,e,t)}function $o(e,t){return Xo(4,2,e,t)}function es(e,t){return Xo(4,4,e,t)}function ts(e,t){if(typeof t==`function`)return e=e(),t(e),function(){t(null)};if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function ns(e,t,n){return n=n==null?null:n.concat([e]),Xo(4,4,ts.bind(null,t,e),n)}function rs(){}function is(e,t){var n=Fo();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&jo(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function as(e,t){var n=Fo();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&jo(t,r[1])?r[0]:(e=e(),n.memoizedState=[e,t],e)}function os(e,t,n){return So&21?(Sr(n,t)||(n=kt(),Co.lanes|=n,Qc|=n,e.baseState=!0),t):(e.baseState&&(e.baseState=!1,Fs=!0),e.memoizedState=n)}function ss(e,t){var n=Pt;Pt=n!==0&&4>n?n:4,e(!0);var r=xo.transition;xo.transition={};try{e(!1),t()}finally{Pt=n,xo.transition=r}}function cs(){return Fo().memoizedState}function ls(e,t,n){var r=_l(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},ds(e))fs(t,n);else if(n=Ya(e,t,n,r),n!==null){var i=gl();vl(n,e,r,i),ps(n,t,r)}}function us(e,t,n){var r=_l(e),i={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(ds(e))fs(t,i);else{var a=e.alternate;if(e.lanes===0&&(a===null||a.lanes===0)&&(a=t.lastRenderedReducer,a!==null))try{var o=t.lastRenderedState,s=a(o,n);if(i.hasEagerState=!0,i.eagerState=s,Sr(s,o)){var c=t.interleaved;c===null?(i.next=i,Ja(t)):(i.next=c.next,c.next=i),t.interleaved=i;return}}catch{}n=Ya(e,t,i,r),n!==null&&(i=gl(),vl(n,e,r,i),ps(n,t,r))}}function ds(e){var t=e.alternate;return e===Co||t!==null&&t===Co}function fs(e,t){Do=Eo=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function ps(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Nt(e,n)}}var ms={readContext:Ka,useCallback:Ao,useContext:Ao,useEffect:Ao,useImperativeHandle:Ao,useInsertionEffect:Ao,useLayoutEffect:Ao,useMemo:Ao,useReducer:Ao,useRef:Ao,useState:Ao,useDebugValue:Ao,useDeferredValue:Ao,useTransition:Ao,useMutableSource:Ao,useSyncExternalStore:Ao,useId:Ao,unstable_isNewReconciler:!1},hs={readContext:Ka,useCallback:function(e,t){return Po().memoizedState=[e,t===void 0?null:t],e},useContext:Ka,useEffect:Zo,useImperativeHandle:function(e,t,n){return n=n==null?null:n.concat([e]),Yo(4194308,4,ts.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Yo(4194308,4,e,t)},useInsertionEffect:function(e,t){return Yo(4,2,e,t)},useMemo:function(e,t){var n=Po();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=Po();return t=n===void 0?t:n(t),r.memoizedState=r.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},r.queue=e,e=e.dispatch=ls.bind(null,Co,e),[r.memoizedState,e]},useRef:function(e){var t=Po();return e={current:e},t.memoizedState=e},useState:Ko,useDebugValue:rs,useDeferredValue:function(e){return Po().memoizedState=e},useTransition:function(){var e=Ko(!1),t=e[0];return e=ss.bind(null,e[1]),Po().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var i=Co,a=Po();if(ba){if(n===void 0)throw Error(r(407));n=n()}else{if(n=t(),Gc===null)throw Error(r(349));So&30||Vo(i,t,n)}a.memoizedState=n;var o={value:n,getSnapshot:t};return a.queue=o,Zo(Uo.bind(null,i,o,e),[e]),i.flags|=2048,qo(9,Ho.bind(null,i,o,n,t),void 0,null),n},useId:function(){var e=Po(),t=Gc.identifierPrefix;if(ba){var n=pa,r=fa;n=(r&~(1<<32-vt(r)-1)).toString(32)+n,t=`:`+t+`R`+n,n=Oo++,0<n&&(t+=`H`+n.toString(32)),t+=`:`}else n=ko++,t=`:`+t+`r`+n.toString(32)+`:`;return e.memoizedState=t},unstable_isNewReconciler:!1},gs={readContext:Ka,useCallback:is,useContext:Ka,useEffect:Qo,useImperativeHandle:ns,useInsertionEffect:$o,useLayoutEffect:es,useMemo:as,useReducer:Lo,useRef:Jo,useState:function(){return Lo(Io)},useDebugValue:rs,useDeferredValue:function(e){return os(Fo(),wo.memoizedState,e)},useTransition:function(){return[Lo(Io)[0],Fo().memoizedState]},useMutableSource:zo,useSyncExternalStore:Bo,useId:cs,unstable_isNewReconciler:!1},_s={readContext:Ka,useCallback:is,useContext:Ka,useEffect:Qo,useImperativeHandle:ns,useInsertionEffect:$o,useLayoutEffect:es,useMemo:as,useReducer:Ro,useRef:Jo,useState:function(){return Ro(Io)},useDebugValue:rs,useDeferredValue:function(e){var t=Fo();return wo===null?t.memoizedState=e:os(t,wo.memoizedState,e)},useTransition:function(){return[Ro(Io)[0],Fo().memoizedState]},useMutableSource:zo,useSyncExternalStore:Bo,useId:cs,unstable_isNewReconciler:!1};function vs(e,t){if(e&&e.defaultProps){for(var n in t=z({},t),e=e.defaultProps,e)t[n]===void 0&&(t[n]=e[n]);return t}return t}function ys(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:z({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var bs={isMounted:function(e){return(e=e._reactInternals)?Qe(e)===e:!1},enqueueSetState:function(e,t,n){e=e._reactInternals;var r=gl(),i=_l(e),a=eo(r,i);a.payload=t,n!=null&&(a.callback=n),t=to(e,a,i),t!==null&&(vl(t,e,i,r),no(t,e,i))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=gl(),i=_l(e),a=eo(r,i);a.tag=1,a.payload=t,n!=null&&(a.callback=n),t=to(e,a,i),t!==null&&(vl(t,e,i,r),no(t,e,i))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=gl(),r=_l(e),i=eo(n,r);i.tag=2,t!=null&&(i.callback=t),t=to(e,i,r),t!==null&&(vl(t,e,r,n),no(t,e,r))}};function xs(e,t,n,r,i,a,o){return e=e.stateNode,typeof e.shouldComponentUpdate==`function`?e.shouldComponentUpdate(r,a,o):t.prototype&&t.prototype.isPureReactComponent?!Cr(n,r)||!Cr(i,a):!0}function Ss(e,t,n){var r=!1,i=Hi,a=t.contextType;return typeof a==`object`&&a?a=Ka(a):(i=qi(t)?Gi:Ui.current,r=t.contextTypes,a=(r=r!=null)?Ki(e,i):Hi),t=new t(n,a),e.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=bs,e.stateNode=t,t._reactInternals=e,r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=i,e.__reactInternalMemoizedMaskedChildContext=a),t}function Cs(e,t,n,r){e=t.state,typeof t.componentWillReceiveProps==`function`&&t.componentWillReceiveProps(n,r),typeof t.UNSAFE_componentWillReceiveProps==`function`&&t.UNSAFE_componentWillReceiveProps(n,r),t.state!==e&&bs.enqueueReplaceState(t,t.state,null)}function ws(e,t,n,r){var i=e.stateNode;i.props=n,i.state=e.memoizedState,i.refs={},Qa(e);var a=t.contextType;typeof a==`object`&&a?i.context=Ka(a):(a=qi(t)?Gi:Ui.current,i.context=Ki(e,a)),i.state=e.memoizedState,a=t.getDerivedStateFromProps,typeof a==`function`&&(ys(e,t,a,n),i.state=e.memoizedState),typeof t.getDerivedStateFromProps==`function`||typeof i.getSnapshotBeforeUpdate==`function`||typeof i.UNSAFE_componentWillMount!=`function`&&typeof i.componentWillMount!=`function`||(t=i.state,typeof i.componentWillMount==`function`&&i.componentWillMount(),typeof i.UNSAFE_componentWillMount==`function`&&i.UNSAFE_componentWillMount(),t!==i.state&&bs.enqueueReplaceState(i,i.state,null),io(e,n,i,r),i.state=e.memoizedState),typeof i.componentDidMount==`function`&&(e.flags|=4194308)}function Ts(e,t){try{var n=``,r=t;do n+=W(r),r=r.return;while(r);var i=n}catch(e){i=`
7
7
  Error generating stack: `+e.message+`
8
- `+e.stack}return{value:e,source:t,stack:i,digest:null}}function Es(e,t,n){return{value:e,source:null,stack:n??null,digest:t??null}}function Ds(e,t){try{console.error(t.value)}catch(e){setTimeout(function(){throw e})}}var Os=typeof WeakMap==`function`?WeakMap:Map;function ks(e,t,n){n=eo(-1,n),n.tag=3,n.payload={element:null};var r=t.value;return n.callback=function(){ol||(ol=!0,sl=r),Ds(e,t)},n}function As(e,t,n){n=eo(-1,n),n.tag=3;var r=e.type.getDerivedStateFromError;if(typeof r==`function`){var i=t.value;n.payload=function(){return r(i)},n.callback=function(){Ds(e,t)}}var a=e.stateNode;return a!==null&&typeof a.componentDidCatch==`function`&&(n.callback=function(){Ds(e,t),typeof r!=`function`&&(cl===null?cl=new Set([this]):cl.add(this));var n=t.stack;this.componentDidCatch(t.value,{componentStack:n===null?``:n})}),n}function js(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new Os;var i=new Set;r.set(t,i)}else i=r.get(t),i===void 0&&(i=new Set,r.set(t,i));i.has(n)||(i.add(n),e=Ul.bind(null,e,t,n),t.then(e,e))}function Ms(e){do{var t;if((t=e.tag===13)&&(t=e.memoizedState,t=t===null?!0:t.dehydrated!==null),t)return e;e=e.return}while(e!==null);return null}function Ns(e,t,n,r,i){return e.mode&1?(e.flags|=65536,e.lanes=i,e):(e===t?e.flags|=65536:(e.flags|=128,n.flags|=131072,n.flags&=-52805,n.tag===1&&(n.alternate===null?n.tag=17:(t=eo(-1,1),t.tag=2,to(n,t,1))),n.lanes|=1),e)}var Ps=C.ReactCurrentOwner,Fs=!1;function Is(e,t,n,r){t.child=e===null?La(t,null,n,r):Ia(t,e.child,n,r)}function Ls(e,t,n,r,i){n=n.render;var a=t.ref;return Ga(t,i),r=Mo(e,t,n,r,a,i),n=No(),e!==null&&!Fs?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i,rc(e,t,i)):(ba&&n&&ga(t),t.flags|=1,Is(e,t,r,i),t.child)}function Rs(e,t,n,r,i){if(e===null){var a=n.type;return typeof a==`function`&&!Zl(a)&&a.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(t.tag=15,t.type=a,zs(e,t,a,r,i)):(e=eu(n.type,null,r,t,t.mode,i),e.ref=t.ref,e.return=t,t.child=e)}if(a=e.child,(e.lanes&i)===0){var o=a.memoizedProps;if(n=n.compare,n=n===null?Cr:n,n(o,r)&&e.ref===t.ref)return rc(e,t,i)}return t.flags|=1,e=$l(a,r),e.ref=t.ref,e.return=t,t.child=e}function zs(e,t,n,r,i){if(e!==null){var a=e.memoizedProps;if(Cr(a,r)&&e.ref===t.ref)if(Fs=!1,t.pendingProps=r=a,(e.lanes&i)!==0)e.flags&131072&&(Fs=!0);else return t.lanes=e.lanes,rc(e,t,i)}return Hs(e,t,n,r,i)}function Bs(e,t,n){var r=t.pendingProps,i=r.children,a=e===null?null:e.memoizedState;if(r.mode===`hidden`)if(!(t.mode&1))t.memoizedState={baseLanes:0,cachePool:null,transitions:null},Vi(Yc,Jc),Jc|=n;else{if(!(n&1073741824))return e=a===null?n:a.baseLanes|n,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,Vi(Yc,Jc),Jc|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=a===null?n:a.baseLanes,Vi(Yc,Jc),Jc|=r}else a===null?r=n:(r=a.baseLanes|n,t.memoizedState=null),Vi(Yc,Jc),Jc|=r;return Is(e,t,i,n),t.child}function Vs(e,t){var n=t.ref;(e===null&&n!==null||e!==null&&e.ref!==n)&&(t.flags|=512,t.flags|=2097152)}function Hs(e,t,n,r,i){var a=qi(n)?Gi:Ui.current;return a=Ki(t,a),Ga(t,i),n=Mo(e,t,n,r,a,i),r=No(),e!==null&&!Fs?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i,rc(e,t,i)):(ba&&r&&ga(t),t.flags|=1,Is(e,t,n,i),t.child)}function Us(e,t,n,r,i){if(qi(n)){var a=!0;Zi(t)}else a=!1;if(Ga(t,i),t.stateNode===null)nc(e,t),Ss(t,n,r),ws(t,n,r,i),r=!0;else if(e===null){var o=t.stateNode,s=t.memoizedProps;o.props=s;var c=o.context,l=n.contextType;typeof l==`object`&&l?l=Ka(l):(l=qi(n)?Gi:Ui.current,l=Ki(t,l));var u=n.getDerivedStateFromProps,d=typeof u==`function`||typeof o.getSnapshotBeforeUpdate==`function`;d||typeof o.UNSAFE_componentWillReceiveProps!=`function`&&typeof o.componentWillReceiveProps!=`function`||(s!==r||c!==l)&&Cs(t,o,r,l),Za=!1;var f=t.memoizedState;o.state=f,io(t,r,o,i),c=t.memoizedState,s!==r||f!==c||Wi.current||Za?(typeof u==`function`&&(ys(t,n,u,r),c=t.memoizedState),(s=Za||xs(t,n,s,r,f,c,l))?(d||typeof o.UNSAFE_componentWillMount!=`function`&&typeof o.componentWillMount!=`function`||(typeof o.componentWillMount==`function`&&o.componentWillMount(),typeof o.UNSAFE_componentWillMount==`function`&&o.UNSAFE_componentWillMount()),typeof o.componentDidMount==`function`&&(t.flags|=4194308)):(typeof o.componentDidMount==`function`&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=c),o.props=r,o.state=c,o.context=l,r=s):(typeof o.componentDidMount==`function`&&(t.flags|=4194308),r=!1)}else{o=t.stateNode,$a(e,t),s=t.memoizedProps,l=t.type===t.elementType?s:vs(t.type,s),o.props=l,d=t.pendingProps,f=o.context,c=n.contextType,typeof c==`object`&&c?c=Ka(c):(c=qi(n)?Gi:Ui.current,c=Ki(t,c));var p=n.getDerivedStateFromProps;(u=typeof p==`function`||typeof o.getSnapshotBeforeUpdate==`function`)||typeof o.UNSAFE_componentWillReceiveProps!=`function`&&typeof o.componentWillReceiveProps!=`function`||(s!==d||f!==c)&&Cs(t,o,r,c),Za=!1,f=t.memoizedState,o.state=f,io(t,r,o,i);var m=t.memoizedState;s!==d||f!==m||Wi.current||Za?(typeof p==`function`&&(ys(t,n,p,r),m=t.memoizedState),(l=Za||xs(t,n,l,r,f,m,c)||!1)?(u||typeof o.UNSAFE_componentWillUpdate!=`function`&&typeof o.componentWillUpdate!=`function`||(typeof o.componentWillUpdate==`function`&&o.componentWillUpdate(r,m,c),typeof o.UNSAFE_componentWillUpdate==`function`&&o.UNSAFE_componentWillUpdate(r,m,c)),typeof o.componentDidUpdate==`function`&&(t.flags|=4),typeof o.getSnapshotBeforeUpdate==`function`&&(t.flags|=1024)):(typeof o.componentDidUpdate!=`function`||s===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof o.getSnapshotBeforeUpdate!=`function`||s===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=m),o.props=r,o.state=m,o.context=c,r=l):(typeof o.componentDidUpdate!=`function`||s===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof o.getSnapshotBeforeUpdate!=`function`||s===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),r=!1)}return Ws(e,t,n,r,a,i)}function Ws(e,t,n,r,i,a){Vs(e,t);var o=(t.flags&128)!=0;if(!r&&!o)return i&&Qi(t,n,!1),rc(e,t,a);r=t.stateNode,Ps.current=t;var s=o&&typeof n.getDerivedStateFromError!=`function`?null:r.render();return t.flags|=1,e!==null&&o?(t.child=Ia(t,e.child,null,a),t.child=Ia(t,null,s,a)):Is(e,t,s,a),t.memoizedState=r.state,i&&Qi(t,n,!0),t.child}function Gs(e){var t=e.stateNode;t.pendingContext?Yi(e,t.pendingContext,t.pendingContext!==t.context):t.context&&Yi(e,t.context,!1),fo(e,t.containerInfo)}function Ks(e,t,n,r,i){return ka(),Aa(i),t.flags|=256,Is(e,t,n,r),t.child}var qs={dehydrated:null,treeContext:null,retryLane:0};function Js(e){return{baseLanes:e,cachePool:null,transitions:null}}function Ys(e,t,n){var r=t.pendingProps,i=go.current,a=!1,o=(t.flags&128)!=0,s;if((s=o)||(s=e!==null&&e.memoizedState===null?!1:(i&2)!=0),s?(a=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(i|=1),Vi(go,i&1),e===null)return Ta(t),e=t.memoizedState,e!==null&&(e=e.dehydrated,e!==null)?(t.mode&1?e.data===`$!`?t.lanes=8:t.lanes=1073741824:t.lanes=1,null):(o=r.children,e=r.fallback,a?(r=t.mode,a=t.child,o={mode:`hidden`,children:o},!(r&1)&&a!==null?(a.childLanes=0,a.pendingProps=o):a=nu(o,r,0,null),e=tu(e,r,n,null),a.return=t,e.return=t,a.sibling=e,t.child=a,t.child.memoizedState=Js(n),t.memoizedState=qs,e):Xs(t,o));if(i=e.memoizedState,i!==null&&(s=i.dehydrated,s!==null))return Qs(e,t,o,r,s,i,n);if(a){a=r.fallback,o=t.mode,i=e.child,s=i.sibling;var c={mode:`hidden`,children:r.children};return!(o&1)&&t.child!==i?(r=t.child,r.childLanes=0,r.pendingProps=c,t.deletions=null):(r=$l(i,c),r.subtreeFlags=i.subtreeFlags&14680064),s===null?(a=tu(a,o,n,null),a.flags|=2):a=$l(s,a),a.return=t,r.return=t,r.sibling=a,t.child=r,r=a,a=t.child,o=e.child.memoizedState,o=o===null?Js(n):{baseLanes:o.baseLanes|n,cachePool:null,transitions:o.transitions},a.memoizedState=o,a.childLanes=e.childLanes&~n,t.memoizedState=qs,r}return a=e.child,e=a.sibling,r=$l(a,{mode:`visible`,children:r.children}),!(t.mode&1)&&(r.lanes=n),r.return=t,r.sibling=null,e!==null&&(n=t.deletions,n===null?(t.deletions=[e],t.flags|=16):n.push(e)),t.child=r,t.memoizedState=null,r}function Xs(e,t){return t=nu({mode:`visible`,children:t},e.mode,0,null),t.return=e,e.child=t}function Zs(e,t,n,r){return r!==null&&Aa(r),Ia(t,e.child,null,n),e=Xs(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function Qs(e,t,n,i,a,o,s){if(n)return t.flags&256?(t.flags&=-257,i=Es(Error(r(422))),Zs(e,t,s,i)):t.memoizedState===null?(o=i.fallback,a=t.mode,i=nu({mode:`visible`,children:i.children},a,0,null),o=tu(o,a,s,null),o.flags|=2,i.return=t,o.return=t,i.sibling=o,t.child=i,t.mode&1&&Ia(t,e.child,null,s),t.child.memoizedState=Js(s),t.memoizedState=qs,o):(t.child=e.child,t.flags|=128,null);if(!(t.mode&1))return Zs(e,t,s,null);if(a.data===`$!`){if(i=a.nextSibling&&a.nextSibling.dataset,i)var c=i.dgst;return i=c,o=Error(r(419)),i=Es(o,i,void 0),Zs(e,t,s,i)}if(c=(s&e.childLanes)!==0,Fs||c){if(i=Gc,i!==null){switch(s&-s){case 4:a=2;break;case 16:a=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:a=32;break;case 536870912:a=268435456;break;default:a=0}a=(a&(i.suspendedLanes|s))===0?a:0,a!==0&&a!==o.retryLane&&(o.retryLane=a,Xa(e,a),vl(i,e,a,-1))}return Ml(),i=Es(Error(r(421))),Zs(e,t,s,i)}return a.data===`$?`?(t.flags|=128,t.child=e.child,t=Gl.bind(null,e),a._reactRetry=t,null):(e=o.treeContext,ya=wi(a.nextSibling),va=t,ba=!0,xa=null,e!==null&&(la[ua++]=fa,la[ua++]=pa,la[ua++]=da,fa=e.id,pa=e.overflow,da=t),t=Xs(t,i.children),t.flags|=4096,t)}function $s(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),Wa(e.return,t,n)}function ec(e,t,n,r,i){var a=e.memoizedState;a===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:i}:(a.isBackwards=t,a.rendering=null,a.renderingStartTime=0,a.last=r,a.tail=n,a.tailMode=i)}function tc(e,t,n){var r=t.pendingProps,i=r.revealOrder,a=r.tail;if(Is(e,t,r.children,n),r=go.current,r&2)r=r&1|2,t.flags|=128;else{if(e!==null&&e.flags&128)a:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&$s(e,n,t);else if(e.tag===19)$s(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break a;for(;e.sibling===null;){if(e.return===null||e.return===t)break a;e=e.return}e.sibling.return=e.return,e=e.sibling}r&=1}if(Vi(go,r),!(t.mode&1))t.memoizedState=null;else switch(i){case`forwards`:for(n=t.child,i=null;n!==null;)e=n.alternate,e!==null&&_o(e)===null&&(i=n),n=n.sibling;n=i,n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null),ec(t,!1,i,n,a);break;case`backwards`:for(n=null,i=t.child,t.child=null;i!==null;){if(e=i.alternate,e!==null&&_o(e)===null){t.child=i;break}e=i.sibling,i.sibling=n,n=i,i=e}ec(t,!0,n,null,a);break;case`together`:ec(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function nc(e,t){!(t.mode&1)&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function rc(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),Qc|=t.lanes,(n&t.childLanes)===0)return null;if(e!==null&&t.child!==e.child)throw Error(r(153));if(t.child!==null){for(e=t.child,n=$l(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=$l(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function ic(e,t,n){switch(t.tag){case 3:Gs(t),ka();break;case 5:mo(t);break;case 1:qi(t.type)&&Zi(t);break;case 4:fo(t,t.stateNode.containerInfo);break;case 10:var r=t.type._context,i=t.memoizedProps.value;Vi(Ra,r._currentValue),r._currentValue=i;break;case 13:if(r=t.memoizedState,r!==null)return r.dehydrated===null?(n&t.child.childLanes)===0?(Vi(go,go.current&1),e=rc(e,t,n),e===null?null:e.sibling):Ys(e,t,n):(Vi(go,go.current&1),t.flags|=128,null);Vi(go,go.current&1);break;case 19:if(r=(n&t.childLanes)!==0,e.flags&128){if(r)return tc(e,t,n);t.flags|=128}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),Vi(go,go.current),r)break;return null;case 22:case 23:return t.lanes=0,Bs(e,t,n)}return rc(e,t,n)}var ac=function(e,t){for(var n=t.child;n!==null;){if(n.tag===5||n.tag===6)e.appendChild(n.stateNode);else if(n.tag!==4&&n.child!==null){n.child.return=n,n=n.child;continue}if(n===t)break;for(;n.sibling===null;){if(n.return===null||n.return===t)return;n=n.return}n.sibling.return=n.return,n=n.sibling}},oc=function(e,t,n,r){var i=e.memoizedProps;if(i!==r){e=t.stateNode,uo(so.current);var o=null;switch(n){case`input`:i=oe(e,i),r=oe(e,r),o=[];break;case`select`:i=z({},i,{value:void 0}),r=z({},r,{value:void 0}),o=[];break;case`textarea`:i=me(e,i),r=me(e,r),o=[];break;default:typeof i.onClick!=`function`&&typeof r.onClick==`function`&&(e.onclick=mi)}Oe(n,r);var s;for(u in n=null,i)if(!r.hasOwnProperty(u)&&i.hasOwnProperty(u)&&i[u]!=null)if(u===`style`){var c=i[u];for(s in c)c.hasOwnProperty(s)&&(n||={},n[s]=``)}else u!==`dangerouslySetInnerHTML`&&u!==`children`&&u!==`suppressContentEditableWarning`&&u!==`suppressHydrationWarning`&&u!==`autoFocus`&&(a.hasOwnProperty(u)?o||=[]:(o||=[]).push(u,null));for(u in r){var l=r[u];if(c=i?.[u],r.hasOwnProperty(u)&&l!==c&&(l!=null||c!=null))if(u===`style`)if(c){for(s in c)!c.hasOwnProperty(s)||l&&l.hasOwnProperty(s)||(n||={},n[s]=``);for(s in l)l.hasOwnProperty(s)&&c[s]!==l[s]&&(n||={},n[s]=l[s])}else n||(o||=[],o.push(u,n)),n=l;else u===`dangerouslySetInnerHTML`?(l=l?l.__html:void 0,c=c?c.__html:void 0,l!=null&&c!==l&&(o||=[]).push(u,l)):u===`children`?typeof l!=`string`&&typeof l!=`number`||(o||=[]).push(u,``+l):u!==`suppressContentEditableWarning`&&u!==`suppressHydrationWarning`&&(a.hasOwnProperty(u)?(l!=null&&u===`onScroll`&&ei(`scroll`,e),o||c===l||(o=[])):(o||=[]).push(u,l))}n&&(o||=[]).push(`style`,n);var u=o;(t.updateQueue=u)&&(t.flags|=4)}},sc=function(e,t,n,r){n!==r&&(t.flags|=4)};function cc(e,t){if(!ba)switch(e.tailMode){case`hidden`:t=e.tail;for(var n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null;break;case`collapsed`:n=e.tail;for(var r=null;n!==null;)n.alternate!==null&&(r=n),n=n.sibling;r===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:r.sibling=null}}function lc(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,r=0;if(t)for(var i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags&14680064,r|=i.flags&14680064,i.return=e,i=i.sibling;else for(i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags,r|=i.flags,i.return=e,i=i.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function uc(e,t,n){var i=t.pendingProps;switch(_a(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return lc(t),null;case 1:return qi(t.type)&&Ji(),lc(t),null;case 3:return i=t.stateNode,po(),Bi(Wi),Bi(Ui),yo(),i.pendingContext&&(i.context=i.pendingContext,i.pendingContext=null),(e===null||e.child===null)&&(Da(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,xa!==null&&(Sl(xa),xa=null))),lc(t),null;case 5:ho(t);var o=uo(lo.current);if(n=t.type,e!==null&&t.stateNode!=null)oc(e,t,n,i,o),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!i){if(t.stateNode===null)throw Error(r(166));return lc(t),null}if(e=uo(so.current),Da(t)){i=t.stateNode,n=t.type;var s=t.memoizedProps;switch(i[Di]=t,i[Oi]=s,e=(t.mode&1)!=0,n){case`dialog`:ei(`cancel`,i),ei(`close`,i);break;case`iframe`:case`object`:case`embed`:ei(`load`,i);break;case`video`:case`audio`:for(o=0;o<Xr.length;o++)ei(Xr[o],i);break;case`source`:ei(`error`,i);break;case`img`:case`image`:case`link`:ei(`error`,i),ei(`load`,i);break;case`details`:ei(`toggle`,i);break;case`input`:se(i,s),ei(`invalid`,i);break;case`select`:i._wrapperState={wasMultiple:!!s.multiple},ei(`invalid`,i);break;case`textarea`:he(i,s),ei(`invalid`,i)}for(var c in Oe(n,s),o=null,s)if(s.hasOwnProperty(c)){var l=s[c];c===`children`?typeof l==`string`?i.textContent!==l&&(!0!==s.suppressHydrationWarning&&pi(i.textContent,l,e),o=[`children`,l]):typeof l==`number`&&i.textContent!==``+l&&(!0!==s.suppressHydrationWarning&&pi(i.textContent,l,e),o=[`children`,``+l]):a.hasOwnProperty(c)&&l!=null&&c===`onScroll`&&ei(`scroll`,i)}switch(n){case`input`:re(i),ue(i,s,!0);break;case`textarea`:re(i),_e(i);break;case`select`:case`option`:break;default:typeof s.onClick==`function`&&(i.onclick=mi)}i=o,t.updateQueue=i,i!==null&&(t.flags|=4)}else{c=o.nodeType===9?o:o.ownerDocument,e===`http://www.w3.org/1999/xhtml`&&(e=ve(n)),e===`http://www.w3.org/1999/xhtml`?n===`script`?(e=c.createElement(`div`),e.innerHTML=`<script><\/script>`,e=e.removeChild(e.firstChild)):typeof i.is==`string`?e=c.createElement(n,{is:i.is}):(e=c.createElement(n),n===`select`&&(c=e,i.multiple?c.multiple=!0:i.size&&(c.size=i.size))):e=c.createElementNS(e,n),e[Di]=t,e[Oi]=i,ac(e,t,!1,!1),t.stateNode=e;a:{switch(c=ke(n,i),n){case`dialog`:ei(`cancel`,e),ei(`close`,e),o=i;break;case`iframe`:case`object`:case`embed`:ei(`load`,e),o=i;break;case`video`:case`audio`:for(o=0;o<Xr.length;o++)ei(Xr[o],e);o=i;break;case`source`:ei(`error`,e),o=i;break;case`img`:case`image`:case`link`:ei(`error`,e),ei(`load`,e),o=i;break;case`details`:ei(`toggle`,e),o=i;break;case`input`:se(e,i),o=oe(e,i),ei(`invalid`,e);break;case`option`:o=i;break;case`select`:e._wrapperState={wasMultiple:!!i.multiple},o=z({},i,{value:void 0}),ei(`invalid`,e);break;case`textarea`:he(e,i),o=me(e,i),ei(`invalid`,e);break;default:o=i}for(s in Oe(n,o),l=o,l)if(l.hasOwnProperty(s)){var u=l[s];s===`style`?Ee(e,u):s===`dangerouslySetInnerHTML`?(u=u?u.__html:void 0,u!=null&&xe(e,u)):s===`children`?typeof u==`string`?(n!==`textarea`||u!==``)&&Se(e,u):typeof u==`number`&&Se(e,``+u):s!==`suppressContentEditableWarning`&&s!==`suppressHydrationWarning`&&s!==`autoFocus`&&(a.hasOwnProperty(s)?u!=null&&s===`onScroll`&&ei(`scroll`,e):u!=null&&S(e,s,u,c))}switch(n){case`input`:re(e),ue(e,i,!1);break;case`textarea`:re(e),_e(e);break;case`option`:i.value!=null&&e.setAttribute(`value`,``+K(i.value));break;case`select`:e.multiple=!!i.multiple,s=i.value,s==null?i.defaultValue!=null&&pe(e,!!i.multiple,i.defaultValue,!0):pe(e,!!i.multiple,s,!1);break;default:typeof o.onClick==`function`&&(e.onclick=mi)}switch(n){case`button`:case`input`:case`select`:case`textarea`:i=!!i.autoFocus;break a;case`img`:i=!0;break a;default:i=!1}}i&&(t.flags|=4)}t.ref!==null&&(t.flags|=512,t.flags|=2097152)}return lc(t),null;case 6:if(e&&t.stateNode!=null)sc(e,t,e.memoizedProps,i);else{if(typeof i!=`string`&&t.stateNode===null)throw Error(r(166));if(n=uo(lo.current),uo(so.current),Da(t)){if(i=t.stateNode,n=t.memoizedProps,i[Di]=t,(s=i.nodeValue!==n)&&(e=va,e!==null))switch(e.tag){case 3:pi(i.nodeValue,n,(e.mode&1)!=0);break;case 5:!0!==e.memoizedProps.suppressHydrationWarning&&pi(i.nodeValue,n,(e.mode&1)!=0)}s&&(t.flags|=4)}else i=(n.nodeType===9?n:n.ownerDocument).createTextNode(i),i[Di]=t,t.stateNode=i}return lc(t),null;case 13:if(Bi(go),i=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(ba&&ya!==null&&t.mode&1&&!(t.flags&128))Oa(),ka(),t.flags|=98560,s=!1;else if(s=Da(t),i!==null&&i.dehydrated!==null){if(e===null){if(!s)throw Error(r(318));if(s=t.memoizedState,s=s===null?null:s.dehydrated,!s)throw Error(r(317));s[Di]=t}else ka(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;lc(t),s=!1}else xa!==null&&(Sl(xa),xa=null),s=!0;if(!s)return t.flags&65536?t:null}return t.flags&128?(t.lanes=n,t):(i=i!==null,i!==(e!==null&&e.memoizedState!==null)&&i&&(t.child.flags|=8192,t.mode&1&&(e===null||go.current&1?Xc===0&&(Xc=3):Ml())),t.updateQueue!==null&&(t.flags|=4),lc(t),null);case 4:return po(),e===null&&ri(t.stateNode.containerInfo),lc(t),null;case 10:return Ua(t.type._context),lc(t),null;case 17:return qi(t.type)&&Ji(),lc(t),null;case 19:if(Bi(go),s=t.memoizedState,s===null)return lc(t),null;if(i=(t.flags&128)!=0,c=s.rendering,c===null)if(i)cc(s,!1);else{if(Xc!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(c=_o(e),c!==null){for(t.flags|=128,cc(s,!1),i=c.updateQueue,i!==null&&(t.updateQueue=i,t.flags|=4),t.subtreeFlags=0,i=n,n=t.child;n!==null;)s=n,e=i,s.flags&=14680066,c=s.alternate,c===null?(s.childLanes=0,s.lanes=e,s.child=null,s.subtreeFlags=0,s.memoizedProps=null,s.memoizedState=null,s.updateQueue=null,s.dependencies=null,s.stateNode=null):(s.childLanes=c.childLanes,s.lanes=c.lanes,s.child=c.child,s.subtreeFlags=0,s.deletions=null,s.memoizedProps=c.memoizedProps,s.memoizedState=c.memoizedState,s.updateQueue=c.updateQueue,s.type=c.type,e=c.dependencies,s.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),n=n.sibling;return Vi(go,go.current&1|2),t.child}e=e.sibling}s.tail!==null&&ct()>il&&(t.flags|=128,i=!0,cc(s,!1),t.lanes=4194304)}else{if(!i)if(e=_o(c),e!==null){if(t.flags|=128,i=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),cc(s,!0),s.tail===null&&s.tailMode===`hidden`&&!c.alternate&&!ba)return lc(t),null}else 2*ct()-s.renderingStartTime>il&&n!==1073741824&&(t.flags|=128,i=!0,cc(s,!1),t.lanes=4194304);s.isBackwards?(c.sibling=t.child,t.child=c):(n=s.last,n===null?t.child=c:n.sibling=c,s.last=c)}return s.tail===null?(lc(t),null):(t=s.tail,s.rendering=t,s.tail=t.sibling,s.renderingStartTime=ct(),t.sibling=null,n=go.current,Vi(go,i?n&1|2:n&1),t);case 22:case 23:return Ol(),i=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==i&&(t.flags|=8192),i&&t.mode&1?Jc&1073741824&&(lc(t),t.subtreeFlags&6&&(t.flags|=8192)):lc(t),null;case 24:return null;case 25:return null}throw Error(r(156,t.tag))}function dc(e,t){switch(_a(t),t.tag){case 1:return qi(t.type)&&Ji(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return po(),Bi(Wi),Bi(Ui),yo(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return ho(t),null;case 13:if(Bi(go),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(r(340));ka()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Bi(go),null;case 4:return po(),null;case 10:return Ua(t.type._context),null;case 22:case 23:return Ol(),null;case 24:return null;default:return null}}var fc=!1,pc=!1,mc=typeof WeakSet==`function`?WeakSet:Set,Y=null;function hc(e,t){var n=e.ref;if(n!==null)if(typeof n==`function`)try{n(null)}catch(n){Hl(e,t,n)}else n.current=null}function gc(e,t,n){try{n()}catch(n){Hl(e,t,n)}}var _c=!1;function vc(e,t){if(hi=sn,e=Dr(),Or(e)){if(`selectionStart`in e)var n={start:e.selectionStart,end:e.selectionEnd};else a:{n=(n=e.ownerDocument)&&n.defaultView||window;var i=n.getSelection&&n.getSelection();if(i&&i.rangeCount!==0){n=i.anchorNode;var a=i.anchorOffset,o=i.focusNode;i=i.focusOffset;try{n.nodeType,o.nodeType}catch{n=null;break a}var s=0,c=-1,l=-1,u=0,d=0,f=e,p=null;b:for(;;){for(var m;f!==n||a!==0&&f.nodeType!==3||(c=s+a),f!==o||i!==0&&f.nodeType!==3||(l=s+i),f.nodeType===3&&(s+=f.nodeValue.length),(m=f.firstChild)!==null;)p=f,f=m;for(;;){if(f===e)break b;if(p===n&&++u===a&&(c=s),p===o&&++d===i&&(l=s),(m=f.nextSibling)!==null)break;f=p,p=f.parentNode}f=m}n=c===-1||l===-1?null:{start:c,end:l}}else n=null}n||={start:0,end:0}}else n=null;for(gi={focusedElem:e,selectionRange:n},sn=!1,Y=t;Y!==null;)if(t=Y,e=t.child,t.subtreeFlags&1028&&e!==null)e.return=t,Y=e;else for(;Y!==null;){t=Y;try{var h=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(h!==null){var g=h.memoizedProps,_=h.memoizedState,v=t.stateNode;v.__reactInternalSnapshotBeforeUpdate=v.getSnapshotBeforeUpdate(t.elementType===t.type?g:vs(t.type,g),_)}break;case 3:var y=t.stateNode.containerInfo;y.nodeType===1?y.textContent=``:y.nodeType===9&&y.documentElement&&y.removeChild(y.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(r(163))}}catch(e){Hl(t,t.return,e)}if(e=t.sibling,e!==null){e.return=t.return,Y=e;break}Y=t.return}return h=_c,_c=!1,h}function yc(e,t,n){var r=t.updateQueue;if(r=r===null?null:r.lastEffect,r!==null){var i=r=r.next;do{if((i.tag&e)===e){var a=i.destroy;i.destroy=void 0,a!==void 0&&gc(t,n,a)}i=i.next}while(i!==r)}}function bc(e,t){if(t=t.updateQueue,t=t===null?null:t.lastEffect,t!==null){var n=t=t.next;do{if((n.tag&e)===e){var r=n.create;n.destroy=r()}n=n.next}while(n!==t)}}function xc(e){var t=e.ref;if(t!==null){var n=e.stateNode;switch(e.tag){case 5:e=n;break;default:e=n}typeof t==`function`?t(e):t.current=e}}function Sc(e){var t=e.alternate;t!==null&&(e.alternate=null,Sc(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[Di],delete t[Oi],delete t[Ai],delete t[ji],delete t[Mi])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function Cc(e){return e.tag===5||e.tag===3||e.tag===4}function wc(e){a:for(;;){for(;e.sibling===null;){if(e.return===null||Cc(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue a;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function Tc(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.nodeType===8?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(n.nodeType===8?(t=n.parentNode,t.insertBefore(e,n)):(t=n,t.appendChild(e)),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=mi));else if(r!==4&&(e=e.child,e!==null))for(Tc(e,t,n),e=e.sibling;e!==null;)Tc(e,t,n),e=e.sibling}function Ec(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(e=e.child,e!==null))for(Ec(e,t,n),e=e.sibling;e!==null;)Ec(e,t,n),e=e.sibling}var Dc=null,Oc=!1;function kc(e,t,n){for(n=n.child;n!==null;)Ac(e,t,n),n=n.sibling}function Ac(e,t,n){if(gt&&typeof gt.onCommitFiberUnmount==`function`)try{gt.onCommitFiberUnmount(ht,n)}catch{}switch(n.tag){case 5:pc||hc(n,t);case 6:var r=Dc,i=Oc;Dc=null,kc(e,t,n),Dc=r,Oc=i,Dc!==null&&(Oc?(e=Dc,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):Dc.removeChild(n.stateNode));break;case 18:Dc!==null&&(Oc?(e=Dc,n=n.stateNode,e.nodeType===8?Ci(e.parentNode,n):e.nodeType===1&&Ci(e,n),an(e)):Ci(Dc,n.stateNode));break;case 4:r=Dc,i=Oc,Dc=n.stateNode.containerInfo,Oc=!0,kc(e,t,n),Dc=r,Oc=i;break;case 0:case 11:case 14:case 15:if(!pc&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){i=r=r.next;do{var a=i,o=a.destroy;a=a.tag,o!==void 0&&(a&2||a&4)&&gc(n,t,o),i=i.next}while(i!==r)}kc(e,t,n);break;case 1:if(!pc&&(hc(n,t),r=n.stateNode,typeof r.componentWillUnmount==`function`))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(e){Hl(n,t,e)}kc(e,t,n);break;case 21:kc(e,t,n);break;case 22:n.mode&1?(pc=(r=pc)||n.memoizedState!==null,kc(e,t,n),pc=r):kc(e,t,n);break;default:kc(e,t,n)}}function jc(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new mc),t.forEach(function(t){var r=Kl.bind(null,e,t);n.has(t)||(n.add(t),t.then(r,r))})}}function Mc(e,t){var n=t.deletions;if(n!==null)for(var i=0;i<n.length;i++){var a=n[i];try{var o=e,s=t,c=s;a:for(;c!==null;){switch(c.tag){case 5:Dc=c.stateNode,Oc=!1;break a;case 3:Dc=c.stateNode.containerInfo,Oc=!0;break a;case 4:Dc=c.stateNode.containerInfo,Oc=!0;break a}c=c.return}if(Dc===null)throw Error(r(160));Ac(o,s,a),Dc=null,Oc=!1;var l=a.alternate;l!==null&&(l.return=null),a.return=null}catch(e){Hl(a,t,e)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)Nc(t,e),t=t.sibling}function Nc(e,t){var n=e.alternate,i=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(Mc(t,e),Pc(e),i&4){try{yc(3,e,e.return),bc(3,e)}catch(t){Hl(e,e.return,t)}try{yc(5,e,e.return)}catch(t){Hl(e,e.return,t)}}break;case 1:Mc(t,e),Pc(e),i&512&&n!==null&&hc(n,n.return);break;case 5:if(Mc(t,e),Pc(e),i&512&&n!==null&&hc(n,n.return),e.flags&32){var a=e.stateNode;try{Se(a,``)}catch(t){Hl(e,e.return,t)}}if(i&4&&(a=e.stateNode,a!=null)){var o=e.memoizedProps,s=n===null?o:n.memoizedProps,c=e.type,l=e.updateQueue;if(e.updateQueue=null,l!==null)try{c===`input`&&o.type===`radio`&&o.name!=null&&ce(a,o),ke(c,s);var u=ke(c,o);for(s=0;s<l.length;s+=2){var d=l[s],f=l[s+1];d===`style`?Ee(a,f):d===`dangerouslySetInnerHTML`?xe(a,f):d===`children`?Se(a,f):S(a,d,f,u)}switch(c){case`input`:le(a,o);break;case`textarea`:ge(a,o);break;case`select`:var p=a._wrapperState.wasMultiple;a._wrapperState.wasMultiple=!!o.multiple;var m=o.value;m==null?p!==!!o.multiple&&(o.defaultValue==null?pe(a,!!o.multiple,o.multiple?[]:``,!1):pe(a,!!o.multiple,o.defaultValue,!0)):pe(a,!!o.multiple,m,!1)}a[Oi]=o}catch(t){Hl(e,e.return,t)}}break;case 6:if(Mc(t,e),Pc(e),i&4){if(e.stateNode===null)throw Error(r(162));a=e.stateNode,o=e.memoizedProps;try{a.nodeValue=o}catch(t){Hl(e,e.return,t)}}break;case 3:if(Mc(t,e),Pc(e),i&4&&n!==null&&n.memoizedState.isDehydrated)try{an(t.containerInfo)}catch(t){Hl(e,e.return,t)}break;case 4:Mc(t,e),Pc(e);break;case 13:Mc(t,e),Pc(e),a=e.child,a.flags&8192&&(o=a.memoizedState!==null,a.stateNode.isHidden=o,!o||a.alternate!==null&&a.alternate.memoizedState!==null||(rl=ct())),i&4&&jc(e);break;case 22:if(d=n!==null&&n.memoizedState!==null,e.mode&1?(pc=(u=pc)||d,Mc(t,e),pc=u):Mc(t,e),Pc(e),i&8192){if(u=e.memoizedState!==null,(e.stateNode.isHidden=u)&&!d&&e.mode&1)for(Y=e,d=e.child;d!==null;){for(f=Y=d;Y!==null;){switch(p=Y,m=p.child,p.tag){case 0:case 11:case 14:case 15:yc(4,p,p.return);break;case 1:hc(p,p.return);var h=p.stateNode;if(typeof h.componentWillUnmount==`function`){i=p,n=p.return;try{t=i,h.props=t.memoizedProps,h.state=t.memoizedState,h.componentWillUnmount()}catch(e){Hl(i,n,e)}}break;case 5:hc(p,p.return);break;case 22:if(p.memoizedState!==null){Rc(f);continue}}m===null?Rc(f):(m.return=p,Y=m)}d=d.sibling}a:for(d=null,f=e;;){if(f.tag===5){if(d===null){d=f;try{a=f.stateNode,u?(o=a.style,typeof o.setProperty==`function`?o.setProperty(`display`,`none`,`important`):o.display=`none`):(c=f.stateNode,l=f.memoizedProps.style,s=l!=null&&l.hasOwnProperty(`display`)?l.display:null,c.style.display=Te(`display`,s))}catch(t){Hl(e,e.return,t)}}}else if(f.tag===6){if(d===null)try{f.stateNode.nodeValue=u?``:f.memoizedProps}catch(t){Hl(e,e.return,t)}}else if((f.tag!==22&&f.tag!==23||f.memoizedState===null||f===e)&&f.child!==null){f.child.return=f,f=f.child;continue}if(f===e)break a;for(;f.sibling===null;){if(f.return===null||f.return===e)break a;d===f&&(d=null),f=f.return}d===f&&(d=null),f.sibling.return=f.return,f=f.sibling}}break;case 19:Mc(t,e),Pc(e),i&4&&jc(e);break;case 21:break;default:Mc(t,e),Pc(e)}}function Pc(e){var t=e.flags;if(t&2){try{a:{for(var n=e.return;n!==null;){if(Cc(n)){var i=n;break a}n=n.return}throw Error(r(160))}switch(i.tag){case 5:var a=i.stateNode;i.flags&32&&(Se(a,``),i.flags&=-33),Ec(e,wc(e),a);break;case 3:case 4:var o=i.stateNode.containerInfo;Tc(e,wc(e),o);break;default:throw Error(r(161))}}catch(t){Hl(e,e.return,t)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function Fc(e,t,n){Y=e,Ic(e,t,n)}function Ic(e,t,n){for(var r=(e.mode&1)!=0;Y!==null;){var i=Y,a=i.child;if(i.tag===22&&r){var o=i.memoizedState!==null||fc;if(!o){var s=i.alternate,c=s!==null&&s.memoizedState!==null||pc;s=fc;var l=pc;if(fc=o,(pc=c)&&!l)for(Y=i;Y!==null;)o=Y,c=o.child,o.tag===22&&o.memoizedState!==null||c===null?zc(i):(c.return=o,Y=c);for(;a!==null;)Y=a,Ic(a,t,n),a=a.sibling;Y=i,fc=s,pc=l}Lc(e,t,n)}else i.subtreeFlags&8772&&a!==null?(a.return=i,Y=a):Lc(e,t,n)}}function Lc(e){for(;Y!==null;){var t=Y;if(t.flags&8772){var n=t.alternate;try{if(t.flags&8772)switch(t.tag){case 0:case 11:case 15:pc||bc(5,t);break;case 1:var i=t.stateNode;if(t.flags&4&&!pc)if(n===null)i.componentDidMount();else{var a=t.elementType===t.type?n.memoizedProps:vs(t.type,n.memoizedProps);i.componentDidUpdate(a,n.memoizedState,i.__reactInternalSnapshotBeforeUpdate)}var o=t.updateQueue;o!==null&&ao(t,o,i);break;case 3:var s=t.updateQueue;if(s!==null){if(n=null,t.child!==null)switch(t.child.tag){case 5:n=t.child.stateNode;break;case 1:n=t.child.stateNode}ao(t,s,n)}break;case 5:var c=t.stateNode;if(n===null&&t.flags&4){n=c;var l=t.memoizedProps;switch(t.type){case`button`:case`input`:case`select`:case`textarea`:l.autoFocus&&n.focus();break;case`img`:l.src&&(n.src=l.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(t.memoizedState===null){var u=t.alternate;if(u!==null){var d=u.memoizedState;if(d!==null){var f=d.dehydrated;f!==null&&an(f)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(r(163))}pc||t.flags&512&&xc(t)}catch(e){Hl(t,t.return,e)}}if(t===e){Y=null;break}if(n=t.sibling,n!==null){n.return=t.return,Y=n;break}Y=t.return}}function Rc(e){for(;Y!==null;){var t=Y;if(t===e){Y=null;break}var n=t.sibling;if(n!==null){n.return=t.return,Y=n;break}Y=t.return}}function zc(e){for(;Y!==null;){var t=Y;try{switch(t.tag){case 0:case 11:case 15:var n=t.return;try{bc(4,t)}catch(e){Hl(t,n,e)}break;case 1:var r=t.stateNode;if(typeof r.componentDidMount==`function`){var i=t.return;try{r.componentDidMount()}catch(e){Hl(t,i,e)}}var a=t.return;try{xc(t)}catch(e){Hl(t,a,e)}break;case 5:var o=t.return;try{xc(t)}catch(e){Hl(t,o,e)}}}catch(e){Hl(t,t.return,e)}if(t===e){Y=null;break}var s=t.sibling;if(s!==null){s.return=t.return,Y=s;break}Y=t.return}}var Bc=Math.ceil,Vc=C.ReactCurrentDispatcher,Hc=C.ReactCurrentOwner,Uc=C.ReactCurrentBatchConfig,Wc=0,Gc=null,Kc=null,qc=0,Jc=0,Yc=zi(0),Xc=0,Zc=null,Qc=0,$c=0,el=0,tl=null,nl=null,rl=0,il=1/0,al=null,ol=!1,sl=null,cl=null,ll=!1,ul=null,dl=0,fl=0,pl=null,ml=-1,hl=0;function gl(){return Wc&6?ct():ml===-1?ml=ct():ml}function _l(e){return e.mode&1?Wc&2&&qc!==0?qc&-qc:ja.transition===null?(e=Pt,e===0?(e=window.event,e=e===void 0?16:pn(e.type),e):e):(hl===0&&(hl=kt()),hl):1}function vl(e,t,n,i){if(50<fl)throw fl=0,pl=null,Error(r(185));jt(e,n,i),(!(Wc&2)||e!==Gc)&&(e===Gc&&(!(Wc&2)&&($c|=n),Xc===4&&wl(e,qc)),yl(e,i),n===1&&Wc===0&&!(t.mode&1)&&(il=ct()+500,ea&&ia()))}function yl(e,t){var n=e.callbackNode;Dt(e,t);var r=Tt(e,e===Gc?qc:0);if(r===0)n!==null&&at(n),e.callbackNode=null,e.callbackPriority=0;else if(t=r&-r,e.callbackPriority!==t){if(n!=null&&at(n),t===1)e.tag===0?ra(Tl.bind(null,e)):na(Tl.bind(null,e)),xi(function(){!(Wc&6)&&ia()}),n=null;else{switch(Ft(r)){case 1:n=ut;break;case 4:n=dt;break;case 16:n=ft;break;case 536870912:n=mt;break;default:n=ft}n=Jl(n,bl.bind(null,e))}e.callbackPriority=t,e.callbackNode=n}}function bl(e,t){if(ml=-1,hl=0,Wc&6)throw Error(r(327));var n=e.callbackNode;if(Bl()&&e.callbackNode!==n)return null;var i=Tt(e,e===Gc?qc:0);if(i===0)return null;if(i&30||(i&e.expiredLanes)!==0||t)t=Nl(e,i);else{t=i;var a=Wc;Wc|=2;var o=jl();(Gc!==e||qc!==t)&&(al=null,il=ct()+500,kl(e,t));do try{Fl();break}catch(t){Al(e,t)}while(1);Ha(),Vc.current=o,Wc=a,Kc===null?(Gc=null,qc=0,t=Xc):t=0}if(t!==0){if(t===2&&(a=Ot(e),a!==0&&(i=a,t=xl(e,a))),t===1)throw n=Zc,kl(e,0),wl(e,i),yl(e,ct()),n;if(t===6)wl(e,i);else{if(a=e.current.alternate,!(i&30)&&!Cl(a)&&(t=Nl(e,i),t===2&&(o=Ot(e),o!==0&&(i=o,t=xl(e,o))),t===1))throw n=Zc,kl(e,0),wl(e,i),yl(e,ct()),n;switch(e.finishedWork=a,e.finishedLanes=i,t){case 0:case 1:throw Error(r(345));case 2:Rl(e,nl,al);break;case 3:if(wl(e,i),(i&130023424)===i&&(t=rl+500-ct(),10<t)){if(Tt(e,0)!==0)break;if(a=e.suspendedLanes,(a&i)!==i){gl(),e.pingedLanes|=e.suspendedLanes&a;break}e.timeoutHandle=vi(Rl.bind(null,e,nl,al),t);break}Rl(e,nl,al);break;case 4:if(wl(e,i),(i&4194240)===i)break;for(t=e.eventTimes,a=-1;0<i;){var s=31-vt(i);o=1<<s,s=t[s],s>a&&(a=s),i&=~o}if(i=a,i=ct()-i,i=(120>i?120:480>i?480:1080>i?1080:1920>i?1920:3e3>i?3e3:4320>i?4320:1960*Bc(i/1960))-i,10<i){e.timeoutHandle=vi(Rl.bind(null,e,nl,al),i);break}Rl(e,nl,al);break;case 5:Rl(e,nl,al);break;default:throw Error(r(329))}}}return yl(e,ct()),e.callbackNode===n?bl.bind(null,e):null}function xl(e,t){var n=tl;return e.current.memoizedState.isDehydrated&&(kl(e,t).flags|=256),e=Nl(e,t),e!==2&&(t=nl,nl=n,t!==null&&Sl(t)),e}function Sl(e){nl===null?nl=e:nl.push.apply(nl,e)}function Cl(e){for(var t=e;;){if(t.flags&16384){var n=t.updateQueue;if(n!==null&&(n=n.stores,n!==null))for(var r=0;r<n.length;r++){var i=n[r],a=i.getSnapshot;i=i.value;try{if(!Sr(a(),i))return!1}catch{return!1}}}if(n=t.child,t.subtreeFlags&16384&&n!==null)n.return=t,t=n;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function wl(e,t){for(t&=~el,t&=~$c,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var n=31-vt(t),r=1<<n;e[n]=-1,t&=~r}}function Tl(e){if(Wc&6)throw Error(r(327));Bl();var t=Tt(e,0);if(!(t&1))return yl(e,ct()),null;var n=Nl(e,t);if(e.tag!==0&&n===2){var i=Ot(e);i!==0&&(t=i,n=xl(e,i))}if(n===1)throw n=Zc,kl(e,0),wl(e,t),yl(e,ct()),n;if(n===6)throw Error(r(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,Rl(e,nl,al),yl(e,ct()),null}function El(e,t){var n=Wc;Wc|=1;try{return e(t)}finally{Wc=n,Wc===0&&(il=ct()+500,ea&&ia())}}function Dl(e){ul!==null&&ul.tag===0&&!(Wc&6)&&Bl();var t=Wc;Wc|=1;var n=Uc.transition,r=Pt;try{if(Uc.transition=null,Pt=1,e)return e()}finally{Pt=r,Uc.transition=n,Wc=t,!(Wc&6)&&ia()}}function Ol(){Jc=Yc.current,Bi(Yc)}function kl(e,t){e.finishedWork=null,e.finishedLanes=0;var n=e.timeoutHandle;if(n!==-1&&(e.timeoutHandle=-1,yi(n)),Kc!==null)for(n=Kc.return;n!==null;){var r=n;switch(_a(r),r.tag){case 1:r=r.type.childContextTypes,r!=null&&Ji();break;case 3:po(),Bi(Wi),Bi(Ui),yo();break;case 5:ho(r);break;case 4:po();break;case 13:Bi(go);break;case 19:Bi(go);break;case 10:Ua(r.type._context);break;case 22:case 23:Ol()}n=n.return}if(Gc=e,Kc=e=$l(e.current,null),qc=Jc=t,Xc=0,Zc=null,el=$c=Qc=0,nl=tl=null,qa!==null){for(t=0;t<qa.length;t++)if(n=qa[t],r=n.interleaved,r!==null){n.interleaved=null;var i=r.next,a=n.pending;if(a!==null){var o=a.next;a.next=i,r.next=o}n.pending=r}qa=null}return e}function Al(e,t){do{var n=Kc;try{if(Ha(),bo.current=ms,Eo){for(var i=Co.memoizedState;i!==null;){var a=i.queue;a!==null&&(a.pending=null),i=i.next}Eo=!1}if(So=0,To=wo=Co=null,Do=!1,Oo=0,Hc.current=null,n===null||n.return===null){Xc=1,Zc=t,Kc=null;break}a:{var o=e,s=n.return,c=n,l=t;if(t=qc,c.flags|=32768,typeof l==`object`&&l&&typeof l.then==`function`){var u=l,d=c,f=d.tag;if(!(d.mode&1)&&(f===0||f===11||f===15)){var p=d.alternate;p?(d.updateQueue=p.updateQueue,d.memoizedState=p.memoizedState,d.lanes=p.lanes):(d.updateQueue=null,d.memoizedState=null)}var m=Ms(s);if(m!==null){m.flags&=-257,Ns(m,s,c,o,t),m.mode&1&&js(o,u,t),t=m,l=u;var h=t.updateQueue;if(h===null){var g=new Set;g.add(l),t.updateQueue=g}else h.add(l);break a}else{if(!(t&1)){js(o,u,t),Ml();break a}l=Error(r(426))}}else if(ba&&c.mode&1){var _=Ms(s);if(_!==null){!(_.flags&65536)&&(_.flags|=256),Ns(_,s,c,o,t),Aa(Ts(l,c));break a}}o=l=Ts(l,c),Xc!==4&&(Xc=2),tl===null?tl=[o]:tl.push(o),o=s;do{switch(o.tag){case 3:o.flags|=65536,t&=-t,o.lanes|=t;var v=ks(o,l,t);ro(o,v);break a;case 1:c=l;var y=o.type,b=o.stateNode;if(!(o.flags&128)&&(typeof y.getDerivedStateFromError==`function`||b!==null&&typeof b.componentDidCatch==`function`&&(cl===null||!cl.has(b)))){o.flags|=65536,t&=-t,o.lanes|=t;var x=As(o,c,t);ro(o,x);break a}}o=o.return}while(o!==null)}Ll(n)}catch(e){t=e,Kc===n&&n!==null&&(Kc=n=n.return);continue}break}while(1)}function jl(){var e=Vc.current;return Vc.current=ms,e===null?ms:e}function Ml(){(Xc===0||Xc===3||Xc===2)&&(Xc=4),Gc===null||!(Qc&268435455)&&!($c&268435455)||wl(Gc,qc)}function Nl(e,t){var n=Wc;Wc|=2;var i=jl();(Gc!==e||qc!==t)&&(al=null,kl(e,t));do try{Pl();break}catch(t){Al(e,t)}while(1);if(Ha(),Wc=n,Vc.current=i,Kc!==null)throw Error(r(261));return Gc=null,qc=0,Xc}function Pl(){for(;Kc!==null;)Il(Kc)}function Fl(){for(;Kc!==null&&!ot();)Il(Kc)}function Il(e){var t=ql(e.alternate,e,Jc);e.memoizedProps=e.pendingProps,t===null?Ll(e):Kc=t,Hc.current=null}function Ll(e){var t=e;do{var n=t.alternate;if(e=t.return,t.flags&32768){if(n=dc(n,t),n!==null){n.flags&=32767,Kc=n;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{Xc=6,Kc=null;return}}else if(n=uc(n,t,Jc),n!==null){Kc=n;return}if(t=t.sibling,t!==null){Kc=t;return}Kc=t=e}while(t!==null);Xc===0&&(Xc=5)}function Rl(e,t,n){var r=Pt,i=Uc.transition;try{Uc.transition=null,Pt=1,zl(e,t,n,r)}finally{Uc.transition=i,Pt=r}return null}function zl(e,t,n,i){do Bl();while(ul!==null);if(Wc&6)throw Error(r(327));n=e.finishedWork;var a=e.finishedLanes;if(n===null)return null;if(e.finishedWork=null,e.finishedLanes=0,n===e.current)throw Error(r(177));e.callbackNode=null,e.callbackPriority=0;var o=n.lanes|n.childLanes;if(Mt(e,o),e===Gc&&(Kc=Gc=null,qc=0),!(n.subtreeFlags&2064)&&!(n.flags&2064)||ll||(ll=!0,Jl(ft,function(){return Bl(),null})),o=(n.flags&15990)!=0,n.subtreeFlags&15990||o){o=Uc.transition,Uc.transition=null;var s=Pt;Pt=1;var c=Wc;Wc|=4,Hc.current=null,vc(e,n),Nc(n,e),kr(gi),sn=!!hi,gi=hi=null,e.current=n,Fc(n,e,a),st(),Wc=c,Pt=s,Uc.transition=o}else e.current=n;if(ll&&(ll=!1,ul=e,dl=a),o=e.pendingLanes,o===0&&(cl=null),_t(n.stateNode,i),yl(e,ct()),t!==null)for(i=e.onRecoverableError,n=0;n<t.length;n++)a=t[n],i(a.value,{componentStack:a.stack,digest:a.digest});if(ol)throw ol=!1,e=sl,sl=null,e;return dl&1&&e.tag!==0&&Bl(),o=e.pendingLanes,o&1?e===pl?fl++:(fl=0,pl=e):fl=0,ia(),null}function Bl(){if(ul!==null){var e=Ft(dl),t=Uc.transition,n=Pt;try{if(Uc.transition=null,Pt=16>e?16:e,ul===null)var i=!1;else{if(e=ul,ul=null,dl=0,Wc&6)throw Error(r(331));var a=Wc;for(Wc|=4,Y=e.current;Y!==null;){var o=Y,s=o.child;if(Y.flags&16){var c=o.deletions;if(c!==null){for(var l=0;l<c.length;l++){var u=c[l];for(Y=u;Y!==null;){var d=Y;switch(d.tag){case 0:case 11:case 15:yc(8,d,o)}var f=d.child;if(f!==null)f.return=d,Y=f;else for(;Y!==null;){d=Y;var p=d.sibling,m=d.return;if(Sc(d),d===u){Y=null;break}if(p!==null){p.return=m,Y=p;break}Y=m}}}var h=o.alternate;if(h!==null){var g=h.child;if(g!==null){h.child=null;do{var _=g.sibling;g.sibling=null,g=_}while(g!==null)}}Y=o}}if(o.subtreeFlags&2064&&s!==null)s.return=o,Y=s;else b:for(;Y!==null;){if(o=Y,o.flags&2048)switch(o.tag){case 0:case 11:case 15:yc(9,o,o.return)}var v=o.sibling;if(v!==null){v.return=o.return,Y=v;break b}Y=o.return}}var y=e.current;for(Y=y;Y!==null;){s=Y;var b=s.child;if(s.subtreeFlags&2064&&b!==null)b.return=s,Y=b;else b:for(s=y;Y!==null;){if(c=Y,c.flags&2048)try{switch(c.tag){case 0:case 11:case 15:bc(9,c)}}catch(e){Hl(c,c.return,e)}if(c===s){Y=null;break b}var x=c.sibling;if(x!==null){x.return=c.return,Y=x;break b}Y=c.return}}if(Wc=a,ia(),gt&&typeof gt.onPostCommitFiberRoot==`function`)try{gt.onPostCommitFiberRoot(ht,e)}catch{}i=!0}return i}finally{Pt=n,Uc.transition=t}}return!1}function Vl(e,t,n){t=Ts(n,t),t=ks(e,t,1),e=to(e,t,1),t=gl(),e!==null&&(jt(e,1,t),yl(e,t))}function Hl(e,t,n){if(e.tag===3)Vl(e,e,n);else for(;t!==null;){if(t.tag===3){Vl(t,e,n);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError==`function`||typeof r.componentDidCatch==`function`&&(cl===null||!cl.has(r))){e=Ts(n,e),e=As(t,e,1),t=to(t,e,1),e=gl(),t!==null&&(jt(t,1,e),yl(t,e));break}}t=t.return}}function Ul(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),t=gl(),e.pingedLanes|=e.suspendedLanes&n,Gc===e&&(qc&n)===n&&(Xc===4||Xc===3&&(qc&130023424)===qc&&500>ct()-rl?kl(e,0):el|=n),yl(e,t)}function Wl(e,t){t===0&&(e.mode&1?(t=Ct,Ct<<=1,!(Ct&130023424)&&(Ct=4194304)):t=1);var n=gl();e=Xa(e,t),e!==null&&(jt(e,t,n),yl(e,n))}function Gl(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),Wl(e,n)}function Kl(e,t){var n=0;switch(e.tag){case 13:var i=e.stateNode,a=e.memoizedState;a!==null&&(n=a.retryLane);break;case 19:i=e.stateNode;break;default:throw Error(r(314))}i!==null&&i.delete(t),Wl(e,n)}var ql=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||Wi.current)Fs=!0;else{if((e.lanes&n)===0&&!(t.flags&128))return Fs=!1,ic(e,t,n);Fs=!!(e.flags&131072)}else Fs=!1,ba&&t.flags&1048576&&ha(t,ca,t.index);switch(t.lanes=0,t.tag){case 2:var i=t.type;nc(e,t),e=t.pendingProps;var a=Ki(t,Ui.current);Ga(t,n),a=Mo(null,t,i,e,a,n);var o=No();return t.flags|=1,typeof a==`object`&&a&&typeof a.render==`function`&&a.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,qi(i)?(o=!0,Zi(t)):o=!1,t.memoizedState=a.state!==null&&a.state!==void 0?a.state:null,Qa(t),a.updater=bs,t.stateNode=a,a._reactInternals=t,ws(t,i,e,n),t=Ws(null,t,i,!0,o,n)):(t.tag=0,ba&&o&&ga(t),Is(null,t,a,n),t=t.child),t;case 16:i=t.elementType;a:{switch(nc(e,t),e=t.pendingProps,a=i._init,i=a(i._payload),t.type=i,a=t.tag=Ql(i),e=vs(i,e),a){case 0:t=Hs(null,t,i,e,n);break a;case 1:t=Us(null,t,i,e,n);break a;case 11:t=Ls(null,t,i,e,n);break a;case 14:t=Rs(null,t,i,vs(i.type,e),n);break a}throw Error(r(306,i,``))}return t;case 0:return i=t.type,a=t.pendingProps,a=t.elementType===i?a:vs(i,a),Hs(e,t,i,a,n);case 1:return i=t.type,a=t.pendingProps,a=t.elementType===i?a:vs(i,a),Us(e,t,i,a,n);case 3:a:{if(Gs(t),e===null)throw Error(r(387));i=t.pendingProps,o=t.memoizedState,a=o.element,$a(e,t),io(t,i,null,n);var s=t.memoizedState;if(i=s.element,o.isDehydrated)if(o={element:i,isDehydrated:!1,cache:s.cache,pendingSuspenseBoundaries:s.pendingSuspenseBoundaries,transitions:s.transitions},t.updateQueue.baseState=o,t.memoizedState=o,t.flags&256){a=Ts(Error(r(423)),t),t=Ks(e,t,i,n,a);break a}else if(i!==a){a=Ts(Error(r(424)),t),t=Ks(e,t,i,n,a);break a}else for(ya=wi(t.stateNode.containerInfo.firstChild),va=t,ba=!0,xa=null,n=La(t,null,i,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(ka(),i===a){t=rc(e,t,n);break a}Is(e,t,i,n)}t=t.child}return t;case 5:return mo(t),e===null&&Ta(t),i=t.type,a=t.pendingProps,o=e===null?null:e.memoizedProps,s=a.children,_i(i,a)?s=null:o!==null&&_i(i,o)&&(t.flags|=32),Vs(e,t),Is(e,t,s,n),t.child;case 6:return e===null&&Ta(t),null;case 13:return Ys(e,t,n);case 4:return fo(t,t.stateNode.containerInfo),i=t.pendingProps,e===null?t.child=Ia(t,null,i,n):Is(e,t,i,n),t.child;case 11:return i=t.type,a=t.pendingProps,a=t.elementType===i?a:vs(i,a),Ls(e,t,i,a,n);case 7:return Is(e,t,t.pendingProps,n),t.child;case 8:return Is(e,t,t.pendingProps.children,n),t.child;case 12:return Is(e,t,t.pendingProps.children,n),t.child;case 10:a:{if(i=t.type._context,a=t.pendingProps,o=t.memoizedProps,s=a.value,Vi(Ra,i._currentValue),i._currentValue=s,o!==null)if(Sr(o.value,s)){if(o.children===a.children&&!Wi.current){t=rc(e,t,n);break a}}else for(o=t.child,o!==null&&(o.return=t);o!==null;){var c=o.dependencies;if(c!==null){s=o.child;for(var l=c.firstContext;l!==null;){if(l.context===i){if(o.tag===1){l=eo(-1,n&-n),l.tag=2;var u=o.updateQueue;if(u!==null){u=u.shared;var d=u.pending;d===null?l.next=l:(l.next=d.next,d.next=l),u.pending=l}}o.lanes|=n,l=o.alternate,l!==null&&(l.lanes|=n),Wa(o.return,n,t),c.lanes|=n;break}l=l.next}}else if(o.tag===10)s=o.type===t.type?null:o.child;else if(o.tag===18){if(s=o.return,s===null)throw Error(r(341));s.lanes|=n,c=s.alternate,c!==null&&(c.lanes|=n),Wa(s,n,t),s=o.sibling}else s=o.child;if(s!==null)s.return=o;else for(s=o;s!==null;){if(s===t){s=null;break}if(o=s.sibling,o!==null){o.return=s.return,s=o;break}s=s.return}o=s}Is(e,t,a.children,n),t=t.child}return t;case 9:return a=t.type,i=t.pendingProps.children,Ga(t,n),a=Ka(a),i=i(a),t.flags|=1,Is(e,t,i,n),t.child;case 14:return i=t.type,a=vs(i,t.pendingProps),a=vs(i.type,a),Rs(e,t,i,a,n);case 15:return zs(e,t,t.type,t.pendingProps,n);case 17:return i=t.type,a=t.pendingProps,a=t.elementType===i?a:vs(i,a),nc(e,t),t.tag=1,qi(i)?(e=!0,Zi(t)):e=!1,Ga(t,n),Ss(t,i,a),ws(t,i,a,n),Ws(null,t,i,!0,e,n);case 19:return tc(e,t,n);case 22:return Bs(e,t,n)}throw Error(r(156,t.tag))};function Jl(e,t){return it(e,t)}function Yl(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Xl(e,t,n,r){return new Yl(e,t,n,r)}function Zl(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Ql(e){if(typeof e==`function`)return+!!Zl(e);if(e!=null){if(e=e.$$typeof,e===j)return 11;if(e===P)return 14}return 2}function $l(e,t){var n=e.alternate;return n===null?(n=Xl(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&14680064,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function eu(e,t,n,i,a,o){var s=2;if(i=e,typeof e==`function`)Zl(e)&&(s=1);else if(typeof e==`string`)s=5;else a:switch(e){case E:return tu(n.children,a,o,t);case D:s=8,a|=8;break;case O:return e=Xl(12,n,t,a|2),e.elementType=O,e.lanes=o,e;case M:return e=Xl(13,n,t,a),e.elementType=M,e.lanes=o,e;case N:return e=Xl(19,n,t,a),e.elementType=N,e.lanes=o,e;case I:return nu(n,a,o,t);default:if(typeof e==`object`&&e)switch(e.$$typeof){case k:s=10;break a;case A:s=9;break a;case j:s=11;break a;case P:s=14;break a;case F:s=16,i=null;break a}throw Error(r(130,e==null?e:typeof e,``))}return t=Xl(s,n,t,a),t.elementType=e,t.type=i,t.lanes=o,t}function tu(e,t,n,r){return e=Xl(7,e,r,t),e.lanes=n,e}function nu(e,t,n,r){return e=Xl(22,e,r,t),e.elementType=I,e.lanes=n,e.stateNode={isHidden:!1},e}function ru(e,t,n){return e=Xl(6,e,null,t),e.lanes=n,e}function iu(e,t,n){return t=Xl(4,e.children===null?[]:e.children,e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function au(e,t,n,r,i){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=At(0),this.expirationTimes=At(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=At(0),this.identifierPrefix=r,this.onRecoverableError=i,this.mutableSourceEagerHydrationData=null}function ou(e,t,n,r,i,a,o,s,c){return e=new au(e,t,n,s,c),t===1?(t=1,!0===a&&(t|=8)):t=0,a=Xl(3,null,null,t),e.current=a,a.stateNode=e,a.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},Qa(a),e}function su(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:T,key:r==null?null:``+r,children:e,containerInfo:t,implementation:n}}function cu(e){if(!e)return Hi;e=e._reactInternals;a:{if(Qe(e)!==e||e.tag!==1)throw Error(r(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break a;case 1:if(qi(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break a}}t=t.return}while(t!==null);throw Error(r(171))}if(e.tag===1){var n=e.type;if(qi(n))return Xi(e,n,t)}return t}function lu(e,t,n,r,i,a,o,s,c){return e=ou(n,r,!0,e,i,a,o,s,c),e.context=cu(null),n=e.current,r=gl(),i=_l(n),a=eo(r,i),a.callback=t??null,to(n,a,i),e.current.lanes=i,jt(e,i,r),yl(e,r),e}function uu(e,t,n,r){var i=t.current,a=gl(),o=_l(i);return n=cu(n),t.context===null?t.context=n:t.pendingContext=n,t=eo(a,o),t.payload={element:e},r=r===void 0?null:r,r!==null&&(t.callback=r),e=to(i,t,o),e!==null&&(vl(e,i,o,a),no(e,i,o)),o}function du(e){if(e=e.current,!e.child)return null;switch(e.child.tag){case 5:return e.child.stateNode;default:return e.child.stateNode}}function fu(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function pu(e,t){fu(e,t),(e=e.alternate)&&fu(e,t)}function mu(){return null}var hu=typeof reportError==`function`?reportError:function(e){console.error(e)};function gu(e){this._internalRoot=e}_u.prototype.render=gu.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(r(409));uu(e,t,null,null)},_u.prototype.unmount=gu.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;Dl(function(){uu(null,e,null,null)}),t[ki]=null}};function _u(e){this._internalRoot=e}_u.prototype.unstable_scheduleHydration=function(e){if(e){var t=zt();e={blockedOn:null,target:e,priority:t};for(var n=0;n<Jt.length&&t!==0&&t<Jt[n].priority;n++);Jt.splice(n,0,e),n===0&&$t(e)}};function vu(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function yu(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==` react-mount-point-unstable `))}function bu(){}function xu(e,t,n,r,i){if(i){if(typeof r==`function`){var a=r;r=function(){var e=du(o);a.call(e)}}var o=lu(t,r,e,0,null,!1,!1,``,bu);return e._reactRootContainer=o,e[ki]=o.current,ri(e.nodeType===8?e.parentNode:e),Dl(),o}for(;i=e.lastChild;)e.removeChild(i);if(typeof r==`function`){var s=r;r=function(){var e=du(c);s.call(e)}}var c=ou(e,0,!1,null,null,!1,!1,``,bu);return e._reactRootContainer=c,e[ki]=c.current,ri(e.nodeType===8?e.parentNode:e),Dl(function(){uu(t,c,n,r)}),c}function Su(e,t,n,r,i){var a=n._reactRootContainer;if(a){var o=a;if(typeof i==`function`){var s=i;i=function(){var e=du(o);s.call(e)}}uu(t,o,e,i)}else o=xu(n,t,e,i,r);return du(o)}It=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var n=wt(t.pendingLanes);n!==0&&(Nt(t,n|1),yl(t,ct()),!(Wc&6)&&(il=ct()+500,ia()))}break;case 13:Dl(function(){var t=Xa(e,1);t!==null&&vl(t,e,1,gl())}),pu(e,1)}},Lt=function(e){if(e.tag===13){var t=Xa(e,134217728);t!==null&&vl(t,e,134217728,gl()),pu(e,134217728)}},Rt=function(e){if(e.tag===13){var t=_l(e),n=Xa(e,t);n!==null&&vl(n,e,t,gl()),pu(e,t)}},zt=function(){return Pt},Bt=function(e,t){var n=Pt;try{return Pt=e,t()}finally{Pt=n}},Me=function(e,t,n){switch(t){case`input`:if(le(e,n),t=n.name,n.type===`radio`&&t!=null){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll(`input[name=`+JSON.stringify(``+t)+`][type="radio"]`),t=0;t<n.length;t++){var i=n[t];if(i!==e&&i.form===e.form){var a=Ii(i);if(!a)throw Error(r(90));ie(i),le(i,a)}}}break;case`textarea`:ge(e,n);break;case`select`:t=n.value,t!=null&&pe(e,!!n.multiple,t,!1)}},Re=El,ze=Dl;var Cu={usingClientEntryPoint:!1,Events:[Pi,Fi,Ii,Ie,Le,El]},wu={findFiberByHostInstance:Ni,bundleType:0,version:`18.3.1`,rendererPackageName:`react-dom`},Tu={bundleType:wu.bundleType,version:wu.version,rendererPackageName:wu.rendererPackageName,rendererConfig:wu.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:C.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=nt(e),e===null?null:e.stateNode},findFiberByHostInstance:wu.findFiberByHostInstance||mu,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:`18.3.1-next-f1338f8080-20240426`};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`){var Eu=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Eu.isDisabled&&Eu.supportsFiber)try{ht=Eu.inject(Tu),gt=Eu}catch{}}e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=Cu,e.createPortal=function(e,t){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!vu(t))throw Error(r(200));return su(e,t,null,n)},e.createRoot=function(e,t){if(!vu(e))throw Error(r(299));var n=!1,i=``,a=hu;return t!=null&&(!0===t.unstable_strictMode&&(n=!0),t.identifierPrefix!==void 0&&(i=t.identifierPrefix),t.onRecoverableError!==void 0&&(a=t.onRecoverableError)),t=ou(e,1,!1,null,null,n,!1,i,a),e[ki]=t.current,ri(e.nodeType===8?e.parentNode:e),new gu(t)},e.findDOMNode=function(e){if(e==null)return null;if(e.nodeType===1)return e;var t=e._reactInternals;if(t===void 0)throw typeof e.render==`function`?Error(r(188)):(e=Object.keys(e).join(`,`),Error(r(268,e)));return e=nt(t),e=e===null?null:e.stateNode,e},e.flushSync=function(e){return Dl(e)},e.hydrate=function(e,t,n){if(!yu(t))throw Error(r(200));return Su(null,e,t,!0,n)},e.hydrateRoot=function(e,t,n){if(!vu(e))throw Error(r(405));var i=n!=null&&n.hydratedSources||null,a=!1,o=``,s=hu;if(n!=null&&(!0===n.unstable_strictMode&&(a=!0),n.identifierPrefix!==void 0&&(o=n.identifierPrefix),n.onRecoverableError!==void 0&&(s=n.onRecoverableError)),t=lu(t,null,e,1,n??null,a,!1,o,s),e[ki]=t.current,ri(e),i)for(e=0;e<i.length;e++)n=i[e],a=n._getVersion,a=a(n._source),t.mutableSourceEagerHydrationData==null?t.mutableSourceEagerHydrationData=[n,a]:t.mutableSourceEagerHydrationData.push(n,a);return new _u(t)},e.render=function(e,t,n){if(!yu(t))throw Error(r(200));return Su(null,e,t,!1,n)},e.unmountComponentAtNode=function(e){if(!yu(e))throw Error(r(40));return e._reactRootContainer?(Dl(function(){Su(null,null,e,!1,function(){e._reactRootContainer=null,e[ki]=null})}),!0):!1},e.unstable_batchedUpdates=El,e.unstable_renderSubtreeIntoContainer=function(e,t,n,i){if(!yu(n))throw Error(r(200));if(e==null||e._reactInternals===void 0)throw Error(r(38));return Su(e,t,n,!1,i)},e.version=`18.3.1-next-f1338f8080-20240426`})),_=s(((e,t)=>{function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>`u`||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!=`function`))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}n(),t.exports=g()})),v=s((e=>{var t=_();e.createRoot=t.createRoot,e.hydrateRoot=t.hydrateRoot})),y=e=>{let t,n=new Set,r=(e,r)=>{let i=typeof e==`function`?e(t):e;if(!Object.is(i,t)){let e=t;t=r??(typeof i!=`object`||!i)?i:Object.assign({},t,i),n.forEach(n=>n(t,e))}},i=()=>t,a={setState:r,getState:i,getInitialState:()=>o,subscribe:e=>(n.add(e),()=>n.delete(e))},o=t=e(r,i,a);return a},b=(e=>e?y(e):y),x=u(p(),1),S=e=>e;function C(e,t=S){let n=x.useSyncExternalStore(e.subscribe,x.useCallback(()=>t(e.getState()),[e,t]),x.useCallback(()=>t(e.getInitialState()),[e,t]));return x.useDebugValue(n),n}var w=e=>{let t=b(e),n=e=>C(t,e);return Object.assign(n,t),n},T=(e=>e?w(e):w),E=v();function D(e,t){let n;try{n=e()}catch{return}return{getItem:e=>{let r=e=>e===null?null:JSON.parse(e,t?.reviver),i=n.getItem(e)??null;return i instanceof Promise?i.then(r):r(i)},setItem:(e,r)=>n.setItem(e,JSON.stringify(r,t?.replacer)),removeItem:e=>n.removeItem(e)}}var O=e=>t=>{try{let n=e(t);return n instanceof Promise?n:{then(e){return O(e)(n)},catch(e){return this}}}catch(e){return{then(e){return this},catch(t){return O(t)(e)}}}},k=(e,t)=>(n,r,i)=>{let a={storage:D(()=>localStorage),partialize:e=>e,version:0,merge:(e,t)=>({...t,...e}),...t},o=!1,s=new Set,c=new Set,l=a.storage;if(!l)return e((...e)=>{console.warn(`[zustand persist middleware] Unable to update item '${a.name}', the given storage is currently unavailable.`),n(...e)},r,i);let u=()=>{let e=a.partialize({...r()});return l.setItem(a.name,{state:e,version:a.version})},d=i.setState;i.setState=(e,t)=>(d(e,t),u());let f=e((...e)=>(n(...e),u()),r,i);i.getInitialState=()=>f;let p,m=()=>{if(!l)return;o=!1,s.forEach(e=>e(r()??f));let e=a.onRehydrateStorage?.call(a,r()??f)||void 0;return O(l.getItem.bind(l))(a.name).then(e=>{if(e)if(typeof e.version==`number`&&e.version!==a.version){if(a.migrate){let t=a.migrate(e.state,e.version);return t instanceof Promise?t.then(e=>[!0,e]):[!0,t]}console.error(`State loaded from storage couldn't be migrated since no migrate function was provided`)}else return[!1,e.state];return[!1,void 0]}).then(e=>{let[t,i]=e;if(p=a.merge(i,r()??f),n(p,!0),t)return u()}).then(()=>{e?.(p,void 0),p=r(),o=!0,c.forEach(e=>e(p))}).catch(t=>{e?.(void 0,t)})};return i.persist={setOptions:e=>{a={...a,...e},e.storage&&(l=e.storage)},clearStorage:()=>{l?.removeItem(a.name)},getOptions:()=>a,rehydrate:()=>m(),hasHydrated:()=>o,onHydrate:e=>(s.add(e),()=>{s.delete(e)}),onFinishHydration:e=>(c.add(e),()=>{c.delete(e)})},a.skipHydration||m(),p||f};function A(){let e=new Map;return{getItem:t=>e.get(t)??null,setItem:(t,n)=>{e.set(t,n)},removeItem:t=>{e.delete(t)}}}var j=A(),M={getItem:e=>{if(typeof localStorage>`u`)return j.getItem(e);try{return localStorage.getItem(e)}catch{return j.getItem(e)}},setItem:(e,t)=>{if(typeof localStorage>`u`){j.setItem(e,t);return}try{localStorage.setItem(e,t)}catch{j.setItem(e,t)}},removeItem:e=>{if(typeof localStorage>`u`){j.removeItem(e);return}try{localStorage.removeItem(e)}catch{j.removeItem(e)}}};function N(e){let t=new Map,n=!1,r=t=>{let n={BASE_URL:`/`,DEV:!1,MODE:`production`,PROD:!0,SSR:!1},r=globalThis.Bun?.main??``,i=/\.test\.[cm]?[jt]sx?$/.test(r);if((typeof n?.DEV==`boolean`?n.DEV:i)&&t!==e)throw Error(`createTabStorage("${e}") received unexpected key "${t}". Create a dedicated tab storage instance per persist key.`)};return{getItem(e){if(r(e),n)return t.get(e)??null;n=!0;let i=M.getItem(e);return i!==null&&t.set(e,i),i},setItem(e,n){r(e),t.set(e,n),M.setItem(e,n)},removeItem(e){r(e),t.delete(e),M.removeItem(e)}}}var P=`~/Documents/GitHub`,F=`claude`,I=!(typeof navigator<`u`&&/^((?!chrome|android).)*safari/i.test(navigator.userAgent)&&!/iPhone|iPad|iPod/.test(navigator.userAgent)&&(typeof devicePixelRatio<`u`?devicePixelRatio:1)>1),L=[{id:`jetbrains-mono`,label:`JetBrains Mono`,family:`"JetBrains Mono Variable", "JetBrains Mono", "SF Mono", "Fira Code", ui-monospace, monospace`},{id:`system`,label:`System Default`,family:`ui-monospace, "SF Mono", Menlo, Monaco, "Cascadia Code", "Consolas", monospace`},{id:`custom`,label:`Custom`,family:``}];function R(e,t){return e===`custom`&&t.trim()?t.trim():L.find(t=>t.id===e)?.family||L[0].family}var z=[{id:`claude`,label:`Claude`,command:`claude`,isBuiltIn:!0,agentType:`claude`},{id:`codex`,label:`Codex`,command:`codex`,isBuiltIn:!0,agentType:`codex`},{id:`pi`,label:`Pi`,command:`pi`,isBuiltIn:!0,agentType:`pi`}];function B(e){if(typeof e!=`object`||!e)return!1;let t=e;return typeof t.id==`string`&&t.id.length>=1&&t.id.length<=128&&typeof t.label==`string`&&t.label.trim().length>=1&&t.label.length<=64&&typeof t.command==`string`&&t.command.trim().length>=1&&t.command.length<=1024&&typeof t.isBuiltIn==`boolean`&&(t.agentType===void 0||t.agentType===`claude`||t.agentType===`codex`||t.agentType===`pi`)}function V(e){return{...e,label:e.label.trim().slice(0,64),command:e.command.trim().slice(0,1024)}}function H(e){return e.command.trim()}function U(e){for(let t=0;t<100;t++){let t=`custom-${Date.now()}-${Math.random().toString(36).slice(2,6)}`;if(!e.has(t))return t}return`custom-${Date.now()}-${Math.random().toString(36).slice(2)}`}function W(e,t){return e.some(e=>e.id===t)?t:e[0]?.id||`claude`}var G=T()(k((e,t)=>({defaultProjectDir:P,setDefaultProjectDir:t=>e({defaultProjectDir:t}),defaultCommand:F,setDefaultCommand:t=>e({defaultCommand:t}),lastProjectPath:null,setLastProjectPath:t=>e({lastProjectPath:t}),recentPaths:[],addRecentPath:t=>e(e=>({recentPaths:[t,...e.recentPaths.filter(e=>e!==t)].slice(0,5)})),sessionSortMode:`created`,setSessionSortMode:t=>e({sessionSortMode:t}),sessionSortDirection:`desc`,setSessionSortDirection:t=>e({sessionSortDirection:t}),manualSessionOrder:[],setManualSessionOrder:t=>e({manualSessionOrder:t}),useWebGL:I,setUseWebGL:t=>e({useWebGL:t}),fontSize:13,setFontSize:t=>e({fontSize:Math.max(6,Math.min(24,t))}),lineHeight:1,setLineHeight:t=>e({lineHeight:Math.max(1,Math.min(2,t))}),letterSpacing:0,setLetterSpacing:t=>e({letterSpacing:Math.max(-3,Math.min(3,t))}),fontOption:`jetbrains-mono`,setFontOption:t=>e({fontOption:t}),customFontFamily:``,setCustomFontFamily:t=>e({customFontFamily:t.slice(0,256)}),shortcutModifier:`auto`,setShortcutModifier:t=>e({shortcutModifier:t}),showProjectName:!0,setShowProjectName:t=>e({showProjectName:t}),showLastUserMessage:!0,setShowLastUserMessage:t=>e({showLastUserMessage:t}),showSessionIdPrefix:!1,setShowSessionIdPrefix:t=>e({showSessionIdPrefix:t}),historySessionsExpanded:!1,setHistorySessionsExpanded:t=>e({historySessionsExpanded:t}),hibernatingSessionsExpanded:!0,setHibernatingSessionsExpanded:t=>e({hibernatingSessionsExpanded:t}),sidebarWidth:240,setSidebarWidth:t=>e({sidebarWidth:Math.max(180,Math.min(400,t))}),projectFilters:[],setProjectFilters:t=>e({projectFilters:t}),hostFilters:[],setHostFilters:t=>e({hostFilters:t}),soundOnPermission:!1,setSoundOnPermission:t=>e({soundOnPermission:t}),soundOnIdle:!1,setSoundOnIdle:t=>e({soundOnIdle:t}),commandPresets:z,setCommandPresets:t=>e({commandPresets:t}),defaultPresetId:`claude`,setDefaultPresetId:t=>e({defaultPresetId:t}),updatePresetCommand:(n,r)=>{let{commandPresets:i}=t();e({commandPresets:i.map(e=>e.id===n?{...e,command:r.trim().slice(0,1024)}:e)})},addPreset:n=>{let{commandPresets:r}=t();if(r.length>=50){console.warn(`[agentboard:settings] Max presets reached`);return}let i=new Set(r.map(e=>e.id)),a={...V({...n,id:``,isBuiltIn:!1}),id:U(i),isBuiltIn:!1};e({commandPresets:[...r,a]})},removePreset:n=>{let{commandPresets:r,defaultPresetId:i}=t(),a=r.find(e=>e.id===n);if(!a||a.isBuiltIn)return;let o=r.filter(e=>e.id!==n);e({commandPresets:o,defaultPresetId:n===i?W(o,i):i})}}),{name:`agentboard-settings`,storage:D(()=>M),version:6,partialize:e=>{let{manualSessionOrder:t,...n}=e;return n},migrate:(e,t)=>{let n=e;typeof n.historySessionsExpanded!=`boolean`&&typeof n.inactiveSessionsExpanded==`boolean`&&(n.historySessionsExpanded=n.inactiveSessionsExpanded),typeof n.hibernatingSessionsExpanded!=`boolean`&&typeof n.snoozedSessionsExpanded==`boolean`&&(n.hibernatingSessionsExpanded=n.snoozedSessionsExpanded);let r=e=>{if(typeof e.command==`string`)return e;let t=typeof e.baseCommand==`string`?e.baseCommand.trim():``,n=typeof e.modifiers==`string`?e.modifiers.trim():``,r=n?`${t} ${n}`:t;return{id:e.id,label:e.label,command:r||`claude`,isBuiltIn:e.isBuiltIn,agentType:e.agentType}};if(t===0||!Array.isArray(n.commandPresets)){let e=typeof n.defaultCommand==`string`?n.defaultCommand:`claude`,t=[...z],r=`claude`;if(e===`codex`)r=`codex`;else if(e!==`claude`){let n={id:U(new Set(t.map(e=>e.id))),label:`Migrated`,command:e,isBuiltIn:!1};t.push(n),r=n.id}return console.info(`[agentboard:settings] Migrated from v0 to v2`),{...n,commandPresets:t,defaultPresetId:r,defaultCommand:e,recentPaths:[]}}let i=n.commandPresets.map(r).filter(B);if(!(i.some(e=>e.id===`claude`)&&i.some(e=>e.id===`codex`))||i.length===0)return console.warn(`[agentboard:settings] Invalid presets, resetting to defaults`),{...n,commandPresets:z,defaultPresetId:`claude`};let a=i.length>50?[...i.filter(e=>e.isBuiltIn),...i.filter(e=>!e.isBuiltIn).slice(0,48)]:i,o=new Set(a.map(e=>e.id)),s=z.filter(e=>e.isBuiltIn&&!o.has(e.id)),c=[...a,...s];return t<6&&console.info(`[agentboard:settings] Migrated from v${t} to v6`),{...n,commandPresets:c.map(V),defaultPresetId:W(a,n.defaultPresetId)}}}));function ee(){let[e,t]=(0,x.useState)(G.persist.hasHydrated());return(0,x.useEffect)(()=>{let e=G.persist.onFinishHydration(()=>t(!0));return G.persist.hasHydrated()&&t(!0),e},[]),e}var K=u(_());function te({title:e,titleId:t,...n},r){return x.createElement(`svg`,Object.assign({xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 24 24`,strokeWidth:1.5,stroke:`currentColor`,"aria-hidden":`true`,ref:r,"aria-labelledby":t},n),e?x.createElement(`title`,{id:t},e):null,x.createElement(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M12 9v4m0 4h.01M10.615 3.892L2.39 18.098c-.456.788-.684 1.182-.65 1.506a1 1 0 00.406.705c.263.191.718.191 1.629.191h16.45c.91 0 1.365 0 1.628-.191a1 1 0 00.407-.705c.034-.324-.195-.718-.65-1.506L13.383 3.892c-.454-.785-.681-1.178-.978-1.31a1 1 0 00-.813 0c-.296.132-.523.525-.978 1.31z`}))}var ne=x.forwardRef(te);function re({title:e,titleId:t,...n},r){return x.createElement(`svg`,Object.assign({xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 24 24`,strokeWidth:1.5,stroke:`currentColor`,"aria-hidden":`true`,ref:r,"aria-labelledby":t},n),e?x.createElement(`title`,{id:t},e):null,x.createElement(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M6 9l6 6 6-6`}))}var ie=x.forwardRef(re);function ae({title:e,titleId:t,...n},r){return x.createElement(`svg`,Object.assign({xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 24 24`,strokeWidth:1.5,stroke:`currentColor`,"aria-hidden":`true`,ref:r,"aria-labelledby":t},n),e?x.createElement(`title`,{id:t},e):null,x.createElement(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M9 18l6-6-6-6`}))}var oe=x.forwardRef(ae);function se({title:e,titleId:t,...n},r){return x.createElement(`svg`,Object.assign({xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 24 24`,strokeWidth:1.5,stroke:`currentColor`,"aria-hidden":`true`,ref:r,"aria-labelledby":t},n),e?x.createElement(`title`,{id:t},e):null,x.createElement(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M5 15c-.932 0-1.398 0-1.765-.152a2 2 0 01-1.083-1.083C2 13.398 2 12.932 2 12V5.2c0-1.12 0-1.68.218-2.108a2 2 0 01.874-.874C3.52 2 4.08 2 5.2 2H12c.932 0 1.398 0 1.765.152a2 2 0 011.083 1.083C15 3.602 15 4.068 15 5m-2.8 17h6.6c1.12 0 1.68 0 2.108-.218a2 2 0 00.874-.874C22 20.48 22 19.92 22 18.8v-6.6c0-1.12 0-1.68-.218-2.108a2 2 0 00-.874-.874C20.48 9 19.92 9 18.8 9h-6.6c-1.12 0-1.68 0-2.108.218a2 2 0 00-.874.874C9 10.52 9 11.08 9 12.2v6.6c0 1.12 0 1.68.218 2.108a2 2 0 00.874.874C10.52 22 11.08 22 12.2 22z`}))}var ce=x.forwardRef(se);function le({title:e,titleId:t,...n},r){return x.createElement(`svg`,Object.assign({xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 24 24`,strokeWidth:1.5,stroke:`currentColor`,"aria-hidden":`true`,ref:r,"aria-labelledby":t},n),e?x.createElement(`title`,{id:t},e):null,x.createElement(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M20 4v1.4c0 3.36 0 5.04-.654 6.324a6 6 0 01-2.622 2.622C15.44 15 13.76 15 10.4 15H4m0 0l5-5m-5 5l5 5`}))}var ue=x.forwardRef(le);function de({title:e,titleId:t,...n},r){return x.createElement(`svg`,Object.assign({xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 24 24`,strokeWidth:1.5,stroke:`currentColor`,"aria-hidden":`true`,ref:r,"aria-labelledby":t},n),e?x.createElement(`title`,{id:t},e):null,x.createElement(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M12 13a1 1 0 100-2 1 1 0 000 2zM12 6a1 1 0 100-2 1 1 0 000 2zM12 20a1 1 0 100-2 1 1 0 000 2z`}))}var fe=x.forwardRef(de);function pe({title:e,titleId:t,...n},r){return x.createElement(`svg`,Object.assign({xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 24 24`,strokeWidth:1.5,stroke:`currentColor`,"aria-hidden":`true`,ref:r,"aria-labelledby":t},n),e?x.createElement(`title`,{id:t},e):null,x.createElement(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M11 4H6.8c-1.68 0-2.52 0-3.162.327a3 3 0 00-1.311 1.311C2 6.28 2 7.12 2 8.8v8.4c0 1.68 0 2.52.327 3.162a3 3 0 001.311 1.311C4.28 22 5.12 22 6.8 22h8.4c1.68 0 2.52 0 3.162-.327a3 3 0 001.311-1.311C20 19.72 20 18.88 20 17.2V13M8 16h1.675c.489 0 .733 0 .963-.055.204-.05.4-.13.579-.24.201-.123.374-.296.72-.642L21.5 5.5a2.121 2.121 0 00-3-3l-9.563 9.563c-.346.346-.519.519-.642.72a2 2 0 00-.24.579c-.055.23-.055.474-.055.963V16z`}))}var me=x.forwardRef(pe);function he({title:e,titleId:t,...n},r){return x.createElement(`svg`,Object.assign({xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 24 24`,strokeWidth:1.5,stroke:`currentColor`,"aria-hidden":`true`,ref:r,"aria-labelledby":t},n),e?x.createElement(`title`,{id:t},e):null,x.createElement(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M14 2.27V6.4c0 .56 0 .84.109 1.054a1 1 0 00.437.437c.214.11.494.11 1.054.11h4.13M16 13H8m8 4H8m2-8H8m6-7H8.8c-1.68 0-2.52 0-3.162.327a3 3 0 00-1.311 1.311C4 4.28 4 5.12 4 6.8v10.4c0 1.68 0 2.52.327 3.162a3 3 0 001.311 1.311C6.28 22 7.12 22 8.8 22h6.4c1.68 0 2.52 0 3.162-.327a3 3 0 001.311-1.311C20 19.72 20 18.88 20 17.2V8l-6-6z`}))}var ge=x.forwardRef(he);function _e({title:e,titleId:t,...n},r){return x.createElement(`svg`,Object.assign({xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 24 24`,strokeWidth:1.5,stroke:`currentColor`,"aria-hidden":`true`,ref:r,"aria-labelledby":t},n),e?x.createElement(`title`,{id:t},e):null,x.createElement(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M13 7l-1.116-2.231c-.32-.642-.481-.963-.72-1.198a2 2 0 00-.748-.462C10.1 3 9.74 3 9.022 3H5.2c-1.12 0-1.68 0-2.108.218a2 2 0 00-.874.874C2 4.52 2 5.08 2 6.2V7m0 0h15.2c1.68 0 2.52 0 3.162.327a3 3 0 011.311 1.311C22 9.28 22 10.12 22 11.8v4.4c0 1.68 0 2.52-.327 3.162a3 3 0 01-1.311 1.311C19.72 21 18.88 21 17.2 21H6.8c-1.68 0-2.52 0-3.162-.327a3 3 0 01-1.311-1.311C2 18.72 2 17.88 2 16.2V7z`}))}var ve=x.forwardRef(_e);function ye({title:e,titleId:t,...n},r){return x.createElement(`svg`,Object.assign({xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 24 24`,strokeWidth:1.5,stroke:`currentColor`,"aria-hidden":`true`,ref:r,"aria-labelledby":t},n),e?x.createElement(`title`,{id:t},e):null,x.createElement(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M6.9 11.444v2.778m0-2.778V4.778c0-.92.761-1.667 1.7-1.667s1.7.746 1.7 1.667m-3.4 6.666c0-.92-.761-1.666-1.7-1.666s-1.7.746-1.7 1.666v2.223C3.5 18.269 7.306 22 12 22s8.5-3.731 8.5-8.333V8.11c0-.92-.761-1.667-1.7-1.667s-1.7.747-1.7 1.667m-6.8-3.333v6.11m0-6.11V3.667C10.3 2.747 11.061 2 12 2s1.7.746 1.7 1.667v1.11m0 0v6.112m0-6.111c0-.92.761-1.667 1.7-1.667s1.7.746 1.7 1.667V8.11m0 0v2.778`}))}var be=x.forwardRef(ye);function xe({title:e,titleId:t,...n},r){return x.createElement(`svg`,Object.assign({xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 24 24`,strokeWidth:1.5,stroke:`currentColor`,"aria-hidden":`true`,ref:r,"aria-labelledby":t},n),e?x.createElement(`title`,{id:t},e):null,x.createElement(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M3 12h18M3 6h18M3 18h18`}))}var Se=x.forwardRef(xe);function Ce({title:e,titleId:t,...n},r){return x.createElement(`svg`,Object.assign({xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 24 24`,strokeWidth:1.5,stroke:`currentColor`,"aria-hidden":`true`,ref:r,"aria-labelledby":t},n),e?x.createElement(`title`,{id:t},e):null,x.createElement(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M22 15.844a10.424 10.424 0 01-4.306.925c-5.779 0-10.463-4.684-10.463-10.462 0-1.536.33-2.994.925-4.307A10.464 10.464 0 002 11.538C2 17.316 6.684 22 12.462 22c4.243 0 7.896-2.526 9.538-6.156z`}))}var we=x.forwardRef(Ce);function Te({title:e,titleId:t,...n},r){return x.createElement(`svg`,Object.assign({xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 24 24`,strokeWidth:1.5,stroke:`currentColor`,"aria-hidden":`true`,ref:r,"aria-labelledby":t},n),e?x.createElement(`title`,{id:t},e):null,x.createElement(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M5 9l-3 3m0 0l3 3m-3-3h20M9 5l3-3m0 0l3 3m-3-3v20m3-3l-3 3m0 0l-3-3M19 9l3 3m0 0l-3 3`}))}var Ee=x.forwardRef(Te);function De({title:e,titleId:t,...n},r){return x.createElement(`svg`,Object.assign({xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 24 24`,strokeWidth:1.5,stroke:`currentColor`,"aria-hidden":`true`,ref:r,"aria-labelledby":t},n),e?x.createElement(`title`,{id:t},e):null,x.createElement(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M5 4.99c0-.972 0-1.457.202-1.725a1 1 0 01.738-.395c.335-.02.74.25 1.548.788l10.515 7.01c.668.446 1.002.668 1.118.949a1 1 0 010 .766c-.116.28-.45.503-1.118.948l-10.515 7.01c-.809.54-1.213.809-1.548.789a1 1 0 01-.738-.395C5 20.467 5 19.98 5 19.01V4.99z`}))}var Oe=x.forwardRef(De);function ke({title:e,titleId:t,...n},r){return x.createElement(`svg`,Object.assign({xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 24 24`,strokeWidth:1.5,stroke:`currentColor`,"aria-hidden":`true`,ref:r,"aria-labelledby":t},n),e?x.createElement(`title`,{id:t},e):null,x.createElement(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M12 5v14m-7-7h14`}))}var Ae=x.forwardRef(ke);function je({title:e,titleId:t,...n},r){return x.createElement(`svg`,Object.assign({xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 24 24`,strokeWidth:1.5,stroke:`currentColor`,"aria-hidden":`true`,ref:r,"aria-labelledby":t},n),e?x.createElement(`title`,{id:t},e):null,x.createElement(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M6 6h.01M6 18h.01m-.81-8h13.6c1.12 0 1.68 0 2.108-.218a2 2 0 00.874-.874C22 8.48 22 7.92 22 6.8V5.2c0-1.12 0-1.68-.218-2.108a2 2 0 00-.874-.874C20.48 2 19.92 2 18.8 2H5.2c-1.12 0-1.68 0-2.108.218a2 2 0 00-.874.874C2 3.52 2 4.08 2 5.2v1.6c0 1.12 0 1.68.218 2.108a2 2 0 00.874.874C3.52 10 4.08 10 5.2 10zm0 12h13.6c1.12 0 1.68 0 2.108-.218a2 2 0 00.874-.874C22 20.48 22 19.92 22 18.8v-1.6c0-1.12 0-1.68-.218-2.108a2 2 0 00-.874-.874C20.48 14 19.92 14 18.8 14H5.2c-1.12 0-1.68 0-2.108.218a2 2 0 00-.874.874C2 15.52 2 16.08 2 17.2v1.6c0 1.12 0 1.68.218 2.108a2 2 0 00.874.874C3.52 22 4.08 22 5.2 22z`}))}var Me=x.forwardRef(je);function Ne({title:e,titleId:t,...n},r){return x.createElement(`svg`,Object.assign({xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 24 24`,strokeWidth:1.5,stroke:`currentColor`,"aria-hidden":`true`,ref:r,"aria-labelledby":t},n),e?x.createElement(`title`,{id:t},e):null,x.createElement(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M12 15a3 3 0 100-6 3 3 0 000 6z`}),x.createElement(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M18.727 14.727a1.5 1.5 0 00.3 1.655l.055.054a1.816 1.816 0 010 2.573 1.818 1.818 0 01-2.573 0l-.055-.055a1.5 1.5 0 00-1.654-.3 1.5 1.5 0 00-.91 1.373v.155a1.818 1.818 0 11-3.636 0V20.1a1.5 1.5 0 00-.981-1.373 1.5 1.5 0 00-1.655.3l-.054.055a1.818 1.818 0 01-3.106-1.287 1.818 1.818 0 01.533-1.286l.054-.055a1.5 1.5 0 00.3-1.654 1.5 1.5 0 00-1.372-.91h-.155a1.818 1.818 0 110-3.636H3.9a1.5 1.5 0 001.373-.981 1.5 1.5 0 00-.3-1.655l-.055-.054A1.818 1.818 0 117.491 4.99l.054.054a1.5 1.5 0 001.655.3h.073a1.5 1.5 0 00.909-1.372v-.155a1.818 1.818 0 013.636 0V3.9a1.499 1.499 0 00.91 1.373 1.5 1.5 0 001.654-.3l.054-.055a1.817 1.817 0 012.573 0 1.819 1.819 0 010 2.573l-.055.054a1.5 1.5 0 00-.3 1.655v.073a1.5 1.5 0 001.373.909h.155a1.818 1.818 0 010 3.636H20.1a1.499 1.499 0 00-1.373.91z`}))}var Pe=x.forwardRef(Ne);function Fe({title:e,titleId:t,...n},r){return x.createElement(`svg`,Object.assign({xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 24 24`,strokeWidth:1.5,stroke:`currentColor`,"aria-hidden":`true`,ref:r,"aria-labelledby":t},n),e?x.createElement(`title`,{id:t},e):null,x.createElement(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M12 15a3 3 0 100-6 3 3 0 000 6z`}),x.createElement(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M9.29 19.371l.584 1.315a2.213 2.213 0 004.044 0l.585-1.315a2.426 2.426 0 012.47-1.423l1.43.152a2.212 2.212 0 002.022-3.502l-.847-1.164a2.428 2.428 0 01-.46-1.434c0-.513.163-1.014.465-1.429l.847-1.163a2.212 2.212 0 00-2.023-3.502l-1.43.152a2.433 2.433 0 01-1.47-.312 2.425 2.425 0 01-1-1.117l-.588-1.315a2.212 2.212 0 00-4.045 0L9.29 4.63c-.207.468-.558.86-1 1.117-.445.256-.96.365-1.47.312l-1.435-.152a2.212 2.212 0 00-2.022 3.502l.847 1.163a2.43 2.43 0 010 2.858l-.847 1.163a2.21 2.21 0 00.786 3.273c.381.195.81.274 1.236.23l1.43-.153a2.434 2.434 0 012.475 1.43z`}))}var Ie=x.forwardRef(Fe);function Le({title:e,titleId:t,...n},r){return x.createElement(`svg`,Object.assign({xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 24 24`,strokeWidth:1.5,stroke:`currentColor`,"aria-hidden":`true`,ref:r,"aria-labelledby":t},n),e?x.createElement(`title`,{id:t},e):null,x.createElement(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M4 17l6-6-6-6m8 14h8`}))}var Re=x.forwardRef(Le);function ze({title:e,titleId:t,...n},r){return x.createElement(`svg`,Object.assign({xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 24 24`,strokeWidth:1.5,stroke:`currentColor`,"aria-hidden":`true`,ref:r,"aria-labelledby":t},n),e?x.createElement(`title`,{id:t},e):null,x.createElement(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M18 6L6 18M6 6l12 12`}))}var Be=x.forwardRef(ze);function Ve(){if(typeof navigator>`u`)return!1;let e=navigator.userAgent,t=/iPad|iPhone|iPod/.test(e),n=navigator.platform===`MacIntel`&&navigator.maxTouchPoints>1;return t||n}function He(){return typeof navigator>`u`?!1:Ve()&&navigator.standalone===!0}function Ue(){return typeof navigator>`u`?!1:navigator.platform.toUpperCase().indexOf(`MAC`)>=0}function We(e){return e===`auto`?Ue()?`ctrl-option`:`ctrl-shift`:e}var Ge={"ctrl-option":`⌃⌥`,"ctrl-shift":`⌃⇧`,"cmd-option":`⌘⌥`,"cmd-shift":`⌘⇧`};function Ke(e){return Ge[e]}function qe(e,t){switch(t){case`ctrl-option`:return e.ctrlKey&&e.altKey&&!e.metaKey&&!e.shiftKey;case`ctrl-shift`:return e.ctrlKey&&e.shiftKey&&!e.metaKey&&!e.altKey;case`cmd-option`:return e.metaKey&&e.altKey&&!e.ctrlKey&&!e.shiftKey;case`cmd-shift`:return e.metaKey&&e.shiftKey&&!e.ctrlKey&&!e.altKey}}var Je=s((e=>{var t=p(),n=Symbol.for(`react.element`),r=Symbol.for(`react.fragment`),i=Object.prototype.hasOwnProperty,a=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,o={key:!0,ref:!0,__self:!0,__source:!0};function s(e,t,r){var s,c={},l=null,u=null;for(s in r!==void 0&&(l=``+r),t.key!==void 0&&(l=``+t.key),t.ref!==void 0&&(u=t.ref),t)i.call(t,s)&&!o.hasOwnProperty(s)&&(c[s]=t[s]);if(e&&e.defaultProps)for(s in t=e.defaultProps,t)c[s]===void 0&&(c[s]=t[s]);return{$$typeof:n,type:e,key:l,ref:u,props:c,_owner:a.current}}e.Fragment=r,e.jsx=s,e.jsxs=s})),q=s(((e,t)=>{t.exports=Je()}))(),Ye={connected:`bg-working`,connecting:`bg-approval`,reconnecting:`bg-approval`,disconnected:`bg-danger`};function Xe({connectionStatus:e,onNewSession:t,onOpenSettings:n,tailscaleIp:r}){let[i,a]=(0,x.useState)(!1),o=Ke(We(G(e=>e.shortcutModifier)));return(0,q.jsxs)(`header`,{className:`flex h-10 shrink-0 items-center justify-between border-b border-border bg-elevated px-3`,children:[(0,q.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,q.jsx)(`h1`,{className:`text-sm font-semibold tracking-tight text-primary text-balance`,children:`AGENTBOARD`}),(0,q.jsxs)(`div`,{className:`flex items-center gap-1.5 text-xs text-muted`,children:[(0,q.jsx)(`span`,{className:`h-2 w-2 rounded-full ${Ye[e]}`}),r&&(0,q.jsxs)(`button`,{onClick:()=>{if(!r)return;let e=`http://${r}:${window.location.port||`4040`}`;navigator.clipboard.writeText(e),a(!0),setTimeout(()=>a(!1),1500)},className:`ml-3 inline-flex items-center gap-1 text-muted/70 hover:text-muted transition-colors cursor-pointer`,title:`Tailscale IP - click to copy remote access URL`,children:[(0,q.jsx)(`span`,{className:`leading-none translate-y-[1px]`,children:i?`Copied!`:r}),!i&&(0,q.jsx)(ce,{width:12,height:12,className:`shrink-0`})]})]})]}),(0,q.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,q.jsx)(`button`,{onClick:t,className:`flex h-7 w-7 items-center justify-center rounded bg-accent text-white hover:bg-accent/90 active:scale-95 transition-all`,title:`New session (${o}N)`,"aria-label":`New session`,children:(0,q.jsx)(Ae,{width:16,height:16})}),(0,q.jsx)(`button`,{onClick:n,className:`flex h-7 w-7 items-center justify-center rounded border border-border text-secondary hover:bg-hover hover:text-primary active:scale-95 transition-all`,title:`Settings`,"aria-label":`Settings`,children:(0,q.jsx)(Ie,{width:14,height:14})})]})]})}var Ze=(0,x.createContext)({});function Qe(e){let t=(0,x.useRef)(null);return t.current===null&&(t.current=e()),t.current}var $e=typeof window<`u`,et=$e?x.useLayoutEffect:x.useEffect,tt=(0,x.createContext)(null);function nt(e,t){e.indexOf(t)===-1&&e.push(t)}function rt(e,t){let n=e.indexOf(t);n>-1&&e.splice(n,1)}var it=(e,t,n)=>n>t?t:n<e?e:n,at={},ot=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e);function st(e){return typeof e==`object`&&!!e}var ct=e=>/^0[^.\s]+$/u.test(e);function lt(e){let t;return()=>(t===void 0&&(t=e()),t)}var ut=e=>e,dt=(e,t)=>n=>t(e(n)),ft=(...e)=>e.reduce(dt),pt=(e,t,n)=>{let r=t-e;return r===0?1:(n-e)/r},mt=class{constructor(){this.subscriptions=[]}add(e){return nt(this.subscriptions,e),()=>rt(this.subscriptions,e)}notify(e,t,n){let r=this.subscriptions.length;if(r)if(r===1)this.subscriptions[0](e,t,n);else for(let i=0;i<r;i++){let r=this.subscriptions[i];r&&r(e,t,n)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}},ht=e=>e*1e3,gt=e=>e/1e3;function _t(e,t){return t?1e3/t*e:0}var vt=(e,t,n)=>(((1-3*n+3*t)*e+(3*n-6*t))*e+3*t)*e,yt=1e-7,bt=12;function xt(e,t,n,r,i){let a,o,s=0;do o=t+(n-t)/2,a=vt(o,r,i)-e,a>0?n=o:t=o;while(Math.abs(a)>yt&&++s<bt);return o}function St(e,t,n,r){if(e===t&&n===r)return ut;let i=t=>xt(t,0,1,e,n);return e=>e===0||e===1?e:vt(i(e),t,r)}var Ct=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,wt=e=>t=>1-e(1-t),Tt=St(.33,1.53,.69,.99),Et=wt(Tt),Dt=Ct(Et),Ot=e=>(e*=2)<1?.5*Et(e):.5*(2-2**(-10*(e-1))),kt=e=>1-Math.sin(Math.acos(e)),At=wt(kt),jt=Ct(kt),Mt=St(.42,0,1,1),Nt=St(0,0,.58,1),Pt=St(.42,0,.58,1),Ft=e=>Array.isArray(e)&&typeof e[0]!=`number`,It=e=>Array.isArray(e)&&typeof e[0]==`number`,Lt={linear:ut,easeIn:Mt,easeInOut:Pt,easeOut:Nt,circIn:kt,circInOut:jt,circOut:At,backIn:Et,backInOut:Dt,backOut:Tt,anticipate:Ot},Rt=e=>typeof e==`string`,zt=e=>{if(It(e)){e.length;let[t,n,r,i]=e;return St(t,n,r,i)}else if(Rt(e))return Lt[e],`${e}`,Lt[e];return e},Bt=[`setup`,`read`,`resolveKeyframes`,`preUpdate`,`update`,`preRender`,`render`,`postRender`],Vt={value:null,addProjectionMetrics:null};function Ht(e,t){let n=new Set,r=new Set,i=!1,a=!1,o=new WeakSet,s={delta:0,timestamp:0,isProcessing:!1},c=0;function l(t){o.has(t)&&(u.schedule(t),e()),c++,t(s)}let u={schedule:(e,t=!1,a=!1)=>{let s=a&&i?n:r;return t&&o.add(e),s.has(e)||s.add(e),e},cancel:e=>{r.delete(e),o.delete(e)},process:e=>{if(s=e,i){a=!0;return}i=!0,[n,r]=[r,n],n.forEach(l),t&&Vt.value&&Vt.value.frameloop[t].push(c),c=0,n.clear(),i=!1,a&&(a=!1,u.process(e))}};return u}var Ut=40;function Wt(e,t){let n=!1,r=!0,i={delta:0,timestamp:0,isProcessing:!1},a=()=>n=!0,o=Bt.reduce((e,n)=>(e[n]=Ht(a,t?n:void 0),e),{}),{setup:s,read:c,resolveKeyframes:l,preUpdate:u,update:d,preRender:f,render:p,postRender:m}=o,h=()=>{let a=at.useManualTiming?i.timestamp:performance.now();n=!1,at.useManualTiming||(i.delta=r?1e3/60:Math.max(Math.min(a-i.timestamp,Ut),1)),i.timestamp=a,i.isProcessing=!0,s.process(i),c.process(i),l.process(i),u.process(i),d.process(i),f.process(i),p.process(i),m.process(i),i.isProcessing=!1,n&&t&&(r=!1,e(h))},g=()=>{n=!0,r=!0,i.isProcessing||e(h)};return{schedule:Bt.reduce((e,t)=>{let r=o[t];return e[t]=(e,t=!1,i=!1)=>(n||g(),r.schedule(e,t,i)),e},{}),cancel:e=>{for(let t=0;t<Bt.length;t++)o[Bt[t]].cancel(e)},state:i,steps:o}}var{schedule:Gt,cancel:Kt,state:qt,steps:Jt}=Wt(typeof requestAnimationFrame<`u`?requestAnimationFrame:ut,!0),Yt;function Xt(){Yt=void 0}var Zt={now:()=>(Yt===void 0&&Zt.set(qt.isProcessing||at.useManualTiming?qt.timestamp:performance.now()),Yt),set:e=>{Yt=e,queueMicrotask(Xt)}},Qt={layout:0,mainThread:0,waapi:0},$t=e=>t=>typeof t==`string`&&t.startsWith(e),en=$t(`--`),tn=$t(`var(--`),nn=e=>tn(e)?rn.test(e.split(`/*`)[0].trim()):!1,rn=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function an(e){return typeof e==`string`?e.split(`/*`)[0].includes(`var(--`):!1}var on={test:e=>typeof e==`number`,parse:parseFloat,transform:e=>e},sn={...on,transform:e=>it(0,1,e)},cn={...on,default:1},ln=e=>Math.round(e*1e5)/1e5,un=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function dn(e){return e==null}var fn=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,pn=(e,t)=>n=>!!(typeof n==`string`&&fn.test(n)&&n.startsWith(e)||t&&!dn(n)&&Object.prototype.hasOwnProperty.call(n,t)),mn=(e,t,n)=>r=>{if(typeof r!=`string`)return r;let[i,a,o,s]=r.match(un);return{[e]:parseFloat(i),[t]:parseFloat(a),[n]:parseFloat(o),alpha:s===void 0?1:parseFloat(s)}},hn=e=>it(0,255,e),gn={...on,transform:e=>Math.round(hn(e))},_n={test:pn(`rgb`,`red`),parse:mn(`red`,`green`,`blue`),transform:({red:e,green:t,blue:n,alpha:r=1})=>`rgba(`+gn.transform(e)+`, `+gn.transform(t)+`, `+gn.transform(n)+`, `+ln(sn.transform(r))+`)`};function vn(e){let t=``,n=``,r=``,i=``;return e.length>5?(t=e.substring(1,3),n=e.substring(3,5),r=e.substring(5,7),i=e.substring(7,9)):(t=e.substring(1,2),n=e.substring(2,3),r=e.substring(3,4),i=e.substring(4,5),t+=t,n+=n,r+=r,i+=i),{red:parseInt(t,16),green:parseInt(n,16),blue:parseInt(r,16),alpha:i?parseInt(i,16)/255:1}}var yn={test:pn(`#`),parse:vn,transform:_n.transform},bn=e=>({test:t=>typeof t==`string`&&t.endsWith(e)&&t.split(` `).length===1,parse:parseFloat,transform:t=>`${t}${e}`}),xn=bn(`deg`),Sn=bn(`%`),J=bn(`px`),Cn=bn(`vh`),wn=bn(`vw`),Tn={...Sn,parse:e=>Sn.parse(e)/100,transform:e=>Sn.transform(e*100)},En={test:pn(`hsl`,`hue`),parse:mn(`hue`,`saturation`,`lightness`),transform:({hue:e,saturation:t,lightness:n,alpha:r=1})=>`hsla(`+Math.round(e)+`, `+Sn.transform(ln(t))+`, `+Sn.transform(ln(n))+`, `+ln(sn.transform(r))+`)`},Dn={test:e=>_n.test(e)||yn.test(e)||En.test(e),parse:e=>_n.test(e)?_n.parse(e):En.test(e)?En.parse(e):yn.parse(e),transform:e=>typeof e==`string`?e:e.hasOwnProperty(`red`)?_n.transform(e):En.transform(e),getAnimatableNone:e=>{let t=Dn.parse(e);return t.alpha=0,Dn.transform(t)}},On=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function kn(e){return isNaN(e)&&typeof e==`string`&&(e.match(un)?.length||0)+(e.match(On)?.length||0)>0}var An=`number`,jn=`color`,Mn=`var`,Nn=`var(`,Pn="${}",Fn=/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 In(e){let t=e.toString(),n=[],r={color:[],number:[],var:[]},i=[],a=0;return{values:n,split:t.replace(Fn,e=>(Dn.test(e)?(r.color.push(a),i.push(jn),n.push(Dn.parse(e))):e.startsWith(Nn)?(r.var.push(a),i.push(Mn),n.push(e)):(r.number.push(a),i.push(An),n.push(parseFloat(e))),++a,Pn)).split(Pn),indexes:r,types:i}}function Ln(e){return In(e).values}function Rn(e){let{split:t,types:n}=In(e),r=t.length;return e=>{let i=``;for(let a=0;a<r;a++)if(i+=t[a],e[a]!==void 0){let t=n[a];t===An?i+=ln(e[a]):t===jn?i+=Dn.transform(e[a]):i+=e[a]}return i}}var zn=e=>typeof e==`number`?0:Dn.test(e)?Dn.getAnimatableNone(e):e;function Bn(e){let t=Ln(e);return Rn(e)(t.map(zn))}var Vn={test:kn,parse:Ln,createTransformer:Rn,getAnimatableNone:Bn};function Hn(e,t,n){return n<0&&(n+=1),n>1&&--n,n<1/6?e+(t-e)*6*n:n<1/2?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function Un({hue:e,saturation:t,lightness:n,alpha:r}){e/=360,t/=100,n/=100;let i=0,a=0,o=0;if(!t)i=a=o=n;else{let r=n<.5?n*(1+t):n+t-n*t,s=2*n-r;i=Hn(s,r,e+1/3),a=Hn(s,r,e),o=Hn(s,r,e-1/3)}return{red:Math.round(i*255),green:Math.round(a*255),blue:Math.round(o*255),alpha:r}}function Wn(e,t){return n=>n>0?t:e}var Gn=(e,t,n)=>e+(t-e)*n,Kn=(e,t,n)=>{let r=e*e,i=n*(t*t-r)+r;return i<0?0:Math.sqrt(i)},qn=[yn,_n,En],Jn=e=>qn.find(t=>t.test(e));function Yn(e){let t=Jn(e);if(`${e}`,!t)return!1;let n=t.parse(e);return t===En&&(n=Un(n)),n}var Xn=(e,t)=>{let n=Yn(e),r=Yn(t);if(!n||!r)return Wn(e,t);let i={...n};return e=>(i.red=Kn(n.red,r.red,e),i.green=Kn(n.green,r.green,e),i.blue=Kn(n.blue,r.blue,e),i.alpha=Gn(n.alpha,r.alpha,e),_n.transform(i))},Zn=new Set([`none`,`hidden`]);function Qn(e,t){return Zn.has(e)?n=>n<=0?e:t:n=>n>=1?t:e}function $n(e,t){return n=>Gn(e,t,n)}function er(e){return typeof e==`number`?$n:typeof e==`string`?nn(e)?Wn:Dn.test(e)?Xn:ir:Array.isArray(e)?tr:typeof e==`object`?Dn.test(e)?Xn:nr:Wn}function tr(e,t){let n=[...e],r=n.length,i=e.map((e,n)=>er(e)(e,t[n]));return e=>{for(let t=0;t<r;t++)n[t]=i[t](e);return n}}function nr(e,t){let n={...e,...t},r={};for(let i in n)e[i]!==void 0&&t[i]!==void 0&&(r[i]=er(e[i])(e[i],t[i]));return e=>{for(let t in r)n[t]=r[t](e);return n}}function rr(e,t){let n=[],r={color:0,var:0,number:0};for(let i=0;i<t.values.length;i++){let a=t.types[i],o=e.indexes[a][r[a]];n[i]=e.values[o]??0,r[a]++}return n}var ir=(e,t)=>{let n=Vn.createTransformer(t),r=In(e),i=In(t);return r.indexes.var.length===i.indexes.var.length&&r.indexes.color.length===i.indexes.color.length&&r.indexes.number.length>=i.indexes.number.length?Zn.has(e)&&!i.values.length||Zn.has(t)&&!r.values.length?Qn(e,t):ft(tr(rr(r,i),i.values),n):(`${e}${t}`,Wn(e,t))};function ar(e,t,n){return typeof e==`number`&&typeof t==`number`&&typeof n==`number`?Gn(e,t,n):er(e)(e,t)}var or=e=>{let t=({timestamp:t})=>e(t);return{start:(e=!0)=>Gt.update(t,e),stop:()=>Kt(t),now:()=>qt.isProcessing?qt.timestamp:Zt.now()}},sr=(e,t,n=10)=>{let r=``,i=Math.max(Math.round(t/n),2);for(let t=0;t<i;t++)r+=Math.round(e(t/(i-1))*1e4)/1e4+`, `;return`linear(${r.substring(0,r.length-2)})`},cr=2e4;function lr(e){let t=0,n=e.next(t);for(;!n.done&&t<2e4;)t+=50,n=e.next(t);return t>=2e4?1/0:t}function ur(e,t=100,n){let r=n({...e,keyframes:[0,t]}),i=Math.min(lr(r),cr);return{type:`keyframes`,ease:e=>r.next(i*e).value/t,duration:gt(i)}}var dr=5;function fr(e,t,n){let r=Math.max(t-dr,0);return _t(n-e(r),t-r)}var pr={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},mr=.001;function hr({duration:e=pr.duration,bounce:t=pr.bounce,velocity:n=pr.velocity,mass:r=pr.mass}){let i,a;pr.maxDuration;let o=1-t;o=it(pr.minDamping,pr.maxDamping,o),e=it(pr.minDuration,pr.maxDuration,gt(e)),o<1?(i=t=>{let r=t*o,i=r*e,a=r-n,s=vr(t,o),c=Math.exp(-i);return mr-a/s*c},a=t=>{let r=t*o*e,a=r*n+n,s=o**2*t**2*e,c=Math.exp(-r),l=vr(t**2,o);return(-i(t)+mr>0?-1:1)*((a-s)*c)/l}):(i=t=>{let r=Math.exp(-t*e),i=(t-n)*e+1;return-mr+r*i},a=t=>Math.exp(-t*e)*((n-t)*(e*e)));let s=5/e,c=_r(i,a,s);if(e=ht(e),isNaN(c))return{stiffness:pr.stiffness,damping:pr.damping,duration:e};{let t=c**2*r;return{stiffness:t,damping:o*2*Math.sqrt(r*t),duration:e}}}var gr=12;function _r(e,t,n){let r=n;for(let n=1;n<gr;n++)r-=e(r)/t(r);return r}function vr(e,t){return e*Math.sqrt(1-t*t)}var yr=[`duration`,`bounce`],br=[`stiffness`,`damping`,`mass`];function xr(e,t){return t.some(t=>e[t]!==void 0)}function Sr(e){let t={velocity:pr.velocity,stiffness:pr.stiffness,damping:pr.damping,mass:pr.mass,isResolvedFromDuration:!1,...e};if(!xr(e,br)&&xr(e,yr))if(e.visualDuration){let n=e.visualDuration,r=2*Math.PI/(n*1.2),i=r*r,a=2*it(.05,1,1-(e.bounce||0))*Math.sqrt(i);t={...t,mass:pr.mass,stiffness:i,damping:a}}else{let n=hr(e);t={...t,...n,mass:pr.mass},t.isResolvedFromDuration=!0}return t}function Cr(e=pr.visualDuration,t=pr.bounce){let n=typeof e==`object`?e:{visualDuration:e,keyframes:[0,1],bounce:t},{restSpeed:r,restDelta:i}=n,a=n.keyframes[0],o=n.keyframes[n.keyframes.length-1],s={done:!1,value:a},{stiffness:c,damping:l,mass:u,duration:d,velocity:f,isResolvedFromDuration:p}=Sr({...n,velocity:-gt(n.velocity||0)}),m=f||0,h=l/(2*Math.sqrt(c*u)),g=o-a,_=gt(Math.sqrt(c/u)),v=Math.abs(g)<5;r||=v?pr.restSpeed.granular:pr.restSpeed.default,i||=v?pr.restDelta.granular:pr.restDelta.default;let y;if(h<1){let e=vr(_,h);y=t=>o-Math.exp(-h*_*t)*((m+h*_*g)/e*Math.sin(e*t)+g*Math.cos(e*t))}else if(h===1)y=e=>o-Math.exp(-_*e)*(g+(m+_*g)*e);else{let e=_*Math.sqrt(h*h-1);y=t=>{let n=Math.exp(-h*_*t),r=Math.min(e*t,300);return o-n*((m+h*_*g)*Math.sinh(r)+e*g*Math.cosh(r))/e}}let b={calculatedDuration:p&&d||null,next:e=>{let t=y(e);if(p)s.done=e>=d;else{let n=e===0?m:0;h<1&&(n=e===0?ht(m):fr(y,e,t));let a=Math.abs(n)<=r,c=Math.abs(o-t)<=i;s.done=a&&c}return s.value=s.done?o:t,s},toString:()=>{let e=Math.min(lr(b),cr),t=sr(t=>b.next(e*t).value,e,30);return e+`ms `+t},toTransition:()=>{}};return b}Cr.applyToOptions=e=>{let t=ur(e,100,Cr);return e.ease=t.ease,e.duration=ht(t.duration),e.type=`keyframes`,e};function wr({keyframes:e,velocity:t=0,power:n=.8,timeConstant:r=325,bounceDamping:i=10,bounceStiffness:a=500,modifyTarget:o,min:s,max:c,restDelta:l=.5,restSpeed:u}){let d=e[0],f={done:!1,value:d},p=e=>s!==void 0&&e<s||c!==void 0&&e>c,m=e=>s===void 0?c:c===void 0||Math.abs(s-e)<Math.abs(c-e)?s:c,h=n*t,g=d+h,_=o===void 0?g:o(g);_!==g&&(h=_-d);let v=e=>-h*Math.exp(-e/r),y=e=>_+v(e),b=e=>{let t=v(e),n=y(e);f.done=Math.abs(t)<=l,f.value=f.done?_:n},x,S,C=e=>{p(f.value)&&(x=e,S=Cr({keyframes:[f.value,m(f.value)],velocity:fr(y,e,f.value),damping:i,stiffness:a,restDelta:l,restSpeed:u}))};return C(0),{calculatedDuration:null,next:e=>{let t=!1;return!S&&x===void 0&&(t=!0,b(e),C(e)),x!==void 0&&e>=x?S.next(e-x):(!t&&b(e),f)}}}function Tr(e,t,n){let r=[],i=n||at.mix||ar,a=e.length-1;for(let n=0;n<a;n++){let a=i(e[n],e[n+1]);t&&(a=ft(Array.isArray(t)?t[n]||ut:t,a)),r.push(a)}return r}function Er(e,t,{clamp:n=!0,ease:r,mixer:i}={}){let a=e.length;if(t.length,a===1)return()=>t[0];if(a===2&&t[0]===t[1])return()=>t[1];let o=e[0]===e[1];e[0]>e[a-1]&&(e=[...e].reverse(),t=[...t].reverse());let s=Tr(t,r,i),c=s.length,l=n=>{if(o&&n<e[0])return t[0];let r=0;if(c>1)for(;r<e.length-2&&!(n<e[r+1]);r++);let i=pt(e[r],e[r+1],n);return s[r](i)};return n?t=>l(it(e[0],e[a-1],t)):l}function Dr(e,t){let n=e[e.length-1];for(let r=1;r<=t;r++){let i=pt(0,t,r);e.push(Gn(n,1,i))}}function Or(e){let t=[0];return Dr(t,e.length-1),t}function kr(e,t){return e.map(e=>e*t)}function Ar(e,t){return e.map(()=>t||Pt).splice(0,e.length-1)}function jr({duration:e=300,keyframes:t,times:n,ease:r=`easeInOut`}){let i=Ft(r)?r.map(zt):zt(r),a={done:!1,value:t[0]},o=Er(kr(n&&n.length===t.length?n:Or(t),e),t,{ease:Array.isArray(i)?i:Ar(t,i)});return{calculatedDuration:e,next:t=>(a.value=o(t),a.done=t>=e,a)}}var Mr=e=>e!==null;function Nr(e,{repeat:t,repeatType:n=`loop`},r,i=1){let a=e.filter(Mr),o=i<0||t&&n!==`loop`&&t%2==1?0:a.length-1;return!o||r===void 0?a[o]:r}var Pr={decay:wr,inertia:wr,tween:jr,keyframes:jr,spring:Cr};function Fr(e){typeof e.type==`string`&&(e.type=Pr[e.type])}var Ir=class{constructor(){this.updateFinished()}get finished(){return this._finished}updateFinished(){this._finished=new Promise(e=>{this.resolve=e})}notifyFinished(){this.resolve()}then(e,t){return this.finished.then(e,t)}},Lr=e=>e/100,Rr=class extends Ir{constructor(e){super(),this.state=`idle`,this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.stop=()=>{let{motionValue:e}=this.options;e&&e.updatedAt!==Zt.now()&&this.tick(Zt.now()),this.isStopped=!0,this.state!==`idle`&&(this.teardown(),this.options.onStop?.())},Qt.mainThread++,this.options=e,this.initAnimation(),this.play(),e.autoplay===!1&&this.pause()}initAnimation(){let{options:e}=this;Fr(e);let{type:t=jr,repeat:n=0,repeatDelay:r=0,repeatType:i,velocity:a=0}=e,{keyframes:o}=e,s=t||jr;s!==jr&&typeof o[0]!=`number`&&(this.mixKeyframes=ft(Lr,ar(o[0],o[1])),o=[0,100]);let c=s({...e,keyframes:o});i===`mirror`&&(this.mirroredGenerator=s({...e,keyframes:[...o].reverse(),velocity:-a})),c.calculatedDuration===null&&(c.calculatedDuration=lr(c));let{calculatedDuration:l}=c;this.calculatedDuration=l,this.resolvedDuration=l+r,this.totalDuration=this.resolvedDuration*(n+1)-r,this.generator=c}updateTime(e){let t=Math.round(e-this.startTime)*this.playbackSpeed;this.holdTime===null?this.currentTime=t:this.currentTime=this.holdTime}tick(e,t=!1){let{generator:n,totalDuration:r,mixKeyframes:i,mirroredGenerator:a,resolvedDuration:o,calculatedDuration:s}=this;if(this.startTime===null)return n.next(0);let{delay:c=0,keyframes:l,repeat:u,repeatType:d,repeatDelay:f,type:p,onUpdate:m,finalKeyframe:h}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,e):this.speed<0&&(this.startTime=Math.min(e-r/this.speed,this.startTime)),t?this.currentTime=e:this.updateTime(e);let g=this.currentTime-c*(this.playbackSpeed>=0?1:-1),_=this.playbackSpeed>=0?g<0:g>r;this.currentTime=Math.max(g,0),this.state===`finished`&&this.holdTime===null&&(this.currentTime=r);let v=this.currentTime,y=n;if(u){let e=Math.min(this.currentTime,r)/o,t=Math.floor(e),n=e%1;!n&&e>=1&&(n=1),n===1&&t--,t=Math.min(t,u+1),t%2&&(d===`reverse`?(n=1-n,f&&(n-=f/o)):d===`mirror`&&(y=a)),v=it(0,1,n)*o}let b=_?{done:!1,value:l[0]}:y.next(v);i&&(b.value=i(b.value));let{done:x}=b;!_&&s!==null&&(x=this.playbackSpeed>=0?this.currentTime>=r:this.currentTime<=0);let S=this.holdTime===null&&(this.state===`finished`||this.state===`running`&&x);return S&&p!==wr&&(b.value=Nr(l,this.options,h,this.speed)),m&&m(b.value),S&&this.finish(),b}then(e,t){return this.finished.then(e,t)}get duration(){return gt(this.calculatedDuration)}get iterationDuration(){let{delay:e=0}=this.options||{};return this.duration+gt(e)}get time(){return gt(this.currentTime)}set time(e){e=ht(e),this.currentTime=e,this.startTime===null||this.holdTime!==null||this.playbackSpeed===0?this.holdTime=e:this.driver&&(this.startTime=this.driver.now()-e/this.playbackSpeed),this.driver?.start(!1)}get speed(){return this.playbackSpeed}set speed(e){this.updateTime(Zt.now());let t=this.playbackSpeed!==e;this.playbackSpeed=e,t&&(this.time=gt(this.currentTime))}play(){if(this.isStopped)return;let{driver:e=or,startTime:t}=this.options;this.driver||=e(e=>this.tick(e)),this.options.onPlay?.();let n=this.driver.now();this.state===`finished`?(this.updateFinished(),this.startTime=n):this.holdTime===null?this.startTime||=t??n:this.startTime=n-this.holdTime,this.state===`finished`&&this.speed<0&&(this.startTime+=this.calculatedDuration),this.holdTime=null,this.state=`running`,this.driver.start()}pause(){this.state=`paused`,this.updateTime(Zt.now()),this.holdTime=this.currentTime}complete(){this.state!==`running`&&this.play(),this.state=`finished`,this.holdTime=null}finish(){this.notifyFinished(),this.teardown(),this.state=`finished`,this.options.onComplete?.()}cancel(){this.holdTime=null,this.startTime=0,this.tick(0),this.teardown(),this.options.onCancel?.()}teardown(){this.state=`idle`,this.stopDriver(),this.startTime=this.holdTime=null,Qt.mainThread--}stopDriver(){this.driver&&=(this.driver.stop(),void 0)}sample(e){return this.startTime=0,this.tick(e,!0)}attachTimeline(e){return this.options.allowFlatten&&(this.options.type=`keyframes`,this.options.ease=`linear`,this.initAnimation()),this.driver?.stop(),e.observe(this)}};function zr(e){for(let t=1;t<e.length;t++)e[t]??(e[t]=e[t-1])}var Br=e=>e*180/Math.PI,Vr=e=>Ur(Br(Math.atan2(e[1],e[0]))),Hr={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:e=>(Math.abs(e[0])+Math.abs(e[3]))/2,rotate:Vr,rotateZ:Vr,skewX:e=>Br(Math.atan(e[1])),skewY:e=>Br(Math.atan(e[2])),skew:e=>(Math.abs(e[1])+Math.abs(e[2]))/2},Ur=e=>(e%=360,e<0&&(e+=360),e),Wr=Vr,Gr=e=>Math.sqrt(e[0]*e[0]+e[1]*e[1]),Kr=e=>Math.sqrt(e[4]*e[4]+e[5]*e[5]),qr={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:Gr,scaleY:Kr,scale:e=>(Gr(e)+Kr(e))/2,rotateX:e=>Ur(Br(Math.atan2(e[6],e[5]))),rotateY:e=>Ur(Br(Math.atan2(-e[2],e[0]))),rotateZ:Wr,rotate:Wr,skewX:e=>Br(Math.atan(e[4])),skewY:e=>Br(Math.atan(e[1])),skew:e=>(Math.abs(e[1])+Math.abs(e[4]))/2};function Jr(e){return+!!e.includes(`scale`)}function Yr(e,t){if(!e||e===`none`)return Jr(t);let n=e.match(/^matrix3d\(([-\d.e\s,]+)\)$/u),r,i;if(n)r=qr,i=n;else{let t=e.match(/^matrix\(([-\d.e\s,]+)\)$/u);r=Hr,i=t}if(!i)return Jr(t);let a=r[t],o=i[1].split(`,`).map(Zr);return typeof a==`function`?a(o):o[a]}var Xr=(e,t)=>{let{transform:n=`none`}=getComputedStyle(e);return Yr(n,t)};function Zr(e){return parseFloat(e.trim())}var Qr=[`transformPerspective`,`x`,`y`,`z`,`translateX`,`translateY`,`translateZ`,`scale`,`scaleX`,`scaleY`,`rotate`,`rotateX`,`rotateY`,`rotateZ`,`skew`,`skewX`,`skewY`],$r=new Set(Qr),ei=e=>e===on||e===J,ti=new Set([`x`,`y`,`z`]),ni=Qr.filter(e=>!ti.has(e));function ri(e){let t=[];return ni.forEach(n=>{let r=e.getValue(n);r!==void 0&&(t.push([n,r.get()]),r.set(+!!n.startsWith(`scale`)))}),t}var ii={width:({x:e},{paddingLeft:t=`0`,paddingRight:n=`0`})=>e.max-e.min-parseFloat(t)-parseFloat(n),height:({y:e},{paddingTop:t=`0`,paddingBottom:n=`0`})=>e.max-e.min-parseFloat(t)-parseFloat(n),top:(e,{top:t})=>parseFloat(t),left:(e,{left:t})=>parseFloat(t),bottom:({y:e},{top:t})=>parseFloat(t)+(e.max-e.min),right:({x:e},{left:t})=>parseFloat(t)+(e.max-e.min),x:(e,{transform:t})=>Yr(t,`x`),y:(e,{transform:t})=>Yr(t,`y`)};ii.translateX=ii.x,ii.translateY=ii.y;var ai=new Set,oi=!1,si=!1,ci=!1;function li(){if(si){let e=Array.from(ai).filter(e=>e.needsMeasurement),t=new Set(e.map(e=>e.element)),n=new Map;t.forEach(e=>{let t=ri(e);t.length&&(n.set(e,t),e.render())}),e.forEach(e=>e.measureInitialState()),t.forEach(e=>{e.render();let t=n.get(e);t&&t.forEach(([t,n])=>{e.getValue(t)?.set(n)})}),e.forEach(e=>e.measureEndState()),e.forEach(e=>{e.suspendedScrollY!==void 0&&window.scrollTo(0,e.suspendedScrollY)})}si=!1,oi=!1,ai.forEach(e=>e.complete(ci)),ai.clear()}function ui(){ai.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(si=!0)})}function di(){ci=!0,ui(),li(),ci=!1}var fi=class{constructor(e,t,n,r,i,a=!1){this.state=`pending`,this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...e],this.onComplete=t,this.name=n,this.motionValue=r,this.element=i,this.isAsync=a}scheduleResolve(){this.state=`scheduled`,this.isAsync?(ai.add(this),oi||(oi=!0,Gt.read(ui),Gt.resolveKeyframes(li))):(this.readKeyframes(),this.complete())}readKeyframes(){let{unresolvedKeyframes:e,name:t,element:n,motionValue:r}=this;if(e[0]===null){let i=r?.get(),a=e[e.length-1];if(i!==void 0)e[0]=i;else if(n&&t){let r=n.readValue(t,a);r!=null&&(e[0]=r)}e[0]===void 0&&(e[0]=a),r&&i===void 0&&r.set(e[0])}zr(e)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(e=!1){this.state=`complete`,this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,e),ai.delete(this)}cancel(){this.state===`scheduled`&&(ai.delete(this),this.state=`pending`)}resume(){this.state===`pending`&&this.scheduleResolve()}},pi=e=>e.startsWith(`--`);function mi(e,t,n){pi(t)?e.style.setProperty(t,n):e.style[t]=n}var hi=lt(()=>window.ScrollTimeline!==void 0),gi={};function _i(e,t){let n=lt(e);return()=>gi[t]??n()}var vi=_i(()=>{try{document.createElement(`div`).animate({opacity:0},{easing:`linear(0, 1)`})}catch{return!1}return!0},`linearEasing`),yi=([e,t,n,r])=>`cubic-bezier(${e}, ${t}, ${n}, ${r})`,bi={linear:`linear`,ease:`ease`,easeIn:`ease-in`,easeOut:`ease-out`,easeInOut:`ease-in-out`,circIn:yi([0,.65,.55,1]),circOut:yi([.55,0,1,.45]),backIn:yi([.31,.01,.66,-.59]),backOut:yi([.33,1.53,.69,.99])};function xi(e,t){if(e)return typeof e==`function`?vi()?sr(e,t):`ease-out`:It(e)?yi(e):Array.isArray(e)?e.map(e=>xi(e,t)||bi.easeOut):bi[e]}function Si(e,t,n,{delay:r=0,duration:i=300,repeat:a=0,repeatType:o=`loop`,ease:s=`easeOut`,times:c}={},l=void 0){let u={[t]:n};c&&(u.offset=c);let d=xi(s,i);Array.isArray(d)&&(u.easing=d),Vt.value&&Qt.waapi++;let f={delay:r,duration:i,easing:Array.isArray(d)?`linear`:d,fill:`both`,iterations:a+1,direction:o===`reverse`?`alternate`:`normal`};l&&(f.pseudoElement=l);let p=e.animate(u,f);return Vt.value&&p.finished.finally(()=>{Qt.waapi--}),p}function Ci(e){return typeof e==`function`&&`applyToOptions`in e}function wi({type:e,...t}){return Ci(e)&&vi()?e.applyToOptions(t):(t.duration??=300,t.ease??=`easeOut`,t)}var Ti=class extends Ir{constructor(e){if(super(),this.finishedTime=null,this.isStopped=!1,this.manualStartTime=null,!e)return;let{element:t,name:n,keyframes:r,pseudoElement:i,allowFlatten:a=!1,finalKeyframe:o,onComplete:s}=e;this.isPseudoElement=!!i,this.allowFlatten=a,this.options=e,e.type;let c=wi(e);this.animation=Si(t,n,r,c,i),c.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!i){let e=Nr(r,this.options,o,this.speed);this.updateMotionValue?this.updateMotionValue(e):mi(t,n,e),this.animation.cancel()}s?.(),this.notifyFinished()}}play(){this.isStopped||(this.manualStartTime=null,this.animation.play(),this.state===`finished`&&this.updateFinished())}pause(){this.animation.pause()}complete(){this.animation.finish?.()}cancel(){try{this.animation.cancel()}catch{}}stop(){if(this.isStopped)return;this.isStopped=!0;let{state:e}=this;e===`idle`||e===`finished`||(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){this.isPseudoElement||this.animation.commitStyles?.()}get duration(){let e=this.animation.effect?.getComputedTiming?.().duration||0;return gt(Number(e))}get iterationDuration(){let{delay:e=0}=this.options||{};return this.duration+gt(e)}get time(){return gt(Number(this.animation.currentTime)||0)}set time(e){this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=ht(e)}get speed(){return this.animation.playbackRate}set speed(e){e<0&&(this.finishedTime=null),this.animation.playbackRate=e}get state(){return this.finishedTime===null?this.animation.playState:`finished`}get startTime(){return this.manualStartTime??Number(this.animation.startTime)}set startTime(e){this.manualStartTime=this.animation.startTime=e}attachTimeline({timeline:e,observe:t}){return this.allowFlatten&&this.animation.effect?.updateTiming({easing:`linear`}),this.animation.onfinish=null,e&&hi()?(this.animation.timeline=e,ut):t(this)}},Ei={anticipate:Ot,backInOut:Dt,circInOut:jt};function Di(e){return e in Ei}function Oi(e){typeof e.ease==`string`&&Di(e.ease)&&(e.ease=Ei[e.ease])}var ki=10,Ai=class extends Ti{constructor(e){Oi(e),Fr(e),super(e),e.startTime!==void 0&&(this.startTime=e.startTime),this.options=e}updateMotionValue(e){let{motionValue:t,onUpdate:n,onComplete:r,element:i,...a}=this.options;if(!t)return;if(e!==void 0){t.set(e);return}let o=new Rr({...a,autoplay:!1}),s=Math.max(ki,Zt.now()-this.startTime),c=it(0,ki,s-ki);t.setWithVelocity(o.sample(Math.max(0,s-c)).value,o.sample(s).value,c),o.stop()}},ji=(e,t)=>t===`zIndex`?!1:!!(typeof e==`number`||Array.isArray(e)||typeof e==`string`&&(Vn.test(e)||e===`0`)&&!e.startsWith(`url(`));function Mi(e){let t=e[0];if(e.length===1)return!0;for(let n=0;n<e.length;n++)if(e[n]!==t)return!0}function Ni(e,t,n,r){let i=e[0];if(i===null)return!1;if(t===`display`||t===`visibility`)return!0;let a=e[e.length-1],o=ji(i,t),s=ji(a,t);return`${t}${i}${a}${o?a:i}`,!o||!s?!1:Mi(e)||(n===`spring`||Ci(n))&&r}function Pi(e){e.duration=0,e.type=`keyframes`}var Fi=new Set([`opacity`,`clipPath`,`filter`,`transform`]),Ii=lt(()=>Object.hasOwnProperty.call(Element.prototype,`animate`));function Li(e){let{motionValue:t,name:n,repeatDelay:r,repeatType:i,damping:a,type:o}=e;if(!(t?.owner?.current instanceof HTMLElement))return!1;let{onUpdate:s,transformTemplate:c}=t.owner.getProps();return Ii()&&n&&Fi.has(n)&&(n!==`transform`||!c)&&!s&&!r&&i!==`mirror`&&a!==0&&o!==`inertia`}var Ri=40,zi=class extends Ir{constructor({autoplay:e=!0,delay:t=0,type:n=`keyframes`,repeat:r=0,repeatDelay:i=0,repeatType:a=`loop`,keyframes:o,name:s,motionValue:c,element:l,...u}){super(),this.stop=()=>{this._animation&&(this._animation.stop(),this.stopTimeline?.()),this.keyframeResolver?.cancel()},this.createdAt=Zt.now();let d={autoplay:e,delay:t,type:n,repeat:r,repeatDelay:i,repeatType:a,name:s,motionValue:c,element:l,...u};this.keyframeResolver=new(l?.KeyframeResolver||fi)(o,(e,t,n)=>this.onKeyframesResolved(e,t,d,!n),s,c,l),this.keyframeResolver?.scheduleResolve()}onKeyframesResolved(e,t,n,r){this.keyframeResolver=void 0;let{name:i,type:a,velocity:o,delay:s,isHandoff:c,onUpdate:l}=n;this.resolvedAt=Zt.now(),Ni(e,i,a,o)||((at.instantAnimations||!s)&&l?.(Nr(e,n,t)),e[0]=e[e.length-1],Pi(n),n.repeat=0);let u={startTime:r?this.resolvedAt&&this.resolvedAt-this.createdAt>Ri?this.resolvedAt:this.createdAt:void 0,finalKeyframe:t,...n,keyframes:e},d=!c&&Li(u)?new Ai({...u,element:u.motionValue.owner.current}):new Rr(u);d.finished.then(()=>this.notifyFinished()).catch(ut),this.pendingTimeline&&=(this.stopTimeline=d.attachTimeline(this.pendingTimeline),void 0),this._animation=d}get finished(){return this._animation?this.animation.finished:this._finished}then(e,t){return this.finished.finally(e).then(()=>{})}get animation(){return this._animation||(this.keyframeResolver?.resume(),di()),this._animation}get duration(){return this.animation.duration}get iterationDuration(){return this.animation.iterationDuration}get time(){return this.animation.time}set time(e){this.animation.time=e}get speed(){return this.animation.speed}get state(){return this.animation.state}set speed(e){this.animation.speed=e}get startTime(){return this.animation.startTime}attachTimeline(e){return this._animation?this.stopTimeline=this.animation.attachTimeline(e):this.pendingTimeline=e,()=>this.stop()}play(){this.animation.play()}pause(){this.animation.pause()}complete(){this.animation.complete()}cancel(){this._animation&&this.animation.cancel(),this.keyframeResolver?.cancel()}},Bi=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function Vi(e){let t=Bi.exec(e);if(!t)return[,];let[,n,r,i]=t;return[`--${n??r}`,i]}function Hi(e,t,n=1){`${e}`;let[r,i]=Vi(e);if(!r)return;let a=window.getComputedStyle(t).getPropertyValue(r);if(a){let e=a.trim();return ot(e)?parseFloat(e):e}return nn(i)?Hi(i,t,n+1):i}function Ui(e,t){return e?.[t]??e?.default??e}var Wi=new Set([`width`,`height`,`top`,`left`,`right`,`bottom`,...Qr]),Gi={test:e=>e===`auto`,parse:e=>e},Ki=e=>t=>t.test(e),qi=[on,J,Sn,xn,wn,Cn,Gi],Ji=e=>qi.find(Ki(e));function Yi(e){return typeof e==`number`?e===0:e===null?!0:e===`none`||e===`0`||ct(e)}var Xi=new Set([`brightness`,`contrast`,`saturate`,`opacity`]);function Zi(e){let[t,n]=e.slice(0,-1).split(`(`);if(t===`drop-shadow`)return e;let[r]=n.match(un)||[];if(!r)return e;let i=n.replace(r,``),a=+!!Xi.has(t);return r!==n&&(a*=100),t+`(`+a+i+`)`}var Qi=/\b([a-z-]*)\(.*?\)/gu,$i={...Vn,getAnimatableNone:e=>{let t=e.match(Qi);return t?t.map(Zi).join(` `):e}},ea={...on,transform:Math.round},ta={borderWidth:J,borderTopWidth:J,borderRightWidth:J,borderBottomWidth:J,borderLeftWidth:J,borderRadius:J,radius:J,borderTopLeftRadius:J,borderTopRightRadius:J,borderBottomRightRadius:J,borderBottomLeftRadius:J,width:J,maxWidth:J,height:J,maxHeight:J,top:J,right:J,bottom:J,left:J,inset:J,insetBlock:J,insetBlockStart:J,insetBlockEnd:J,insetInline:J,insetInlineStart:J,insetInlineEnd:J,padding:J,paddingTop:J,paddingRight:J,paddingBottom:J,paddingLeft:J,paddingBlock:J,paddingBlockStart:J,paddingBlockEnd:J,paddingInline:J,paddingInlineStart:J,paddingInlineEnd:J,margin:J,marginTop:J,marginRight:J,marginBottom:J,marginLeft:J,marginBlock:J,marginBlockStart:J,marginBlockEnd:J,marginInline:J,marginInlineStart:J,marginInlineEnd:J,backgroundPositionX:J,backgroundPositionY:J,rotate:xn,rotateX:xn,rotateY:xn,rotateZ:xn,scale:cn,scaleX:cn,scaleY:cn,scaleZ:cn,skew:xn,skewX:xn,skewY:xn,distance:J,translateX:J,translateY:J,translateZ:J,x:J,y:J,z:J,perspective:J,transformPerspective:J,opacity:sn,originX:Tn,originY:Tn,originZ:J,zIndex:ea,fillOpacity:sn,strokeOpacity:sn,numOctaves:ea},na={...ta,color:Dn,backgroundColor:Dn,outlineColor:Dn,fill:Dn,stroke:Dn,borderColor:Dn,borderTopColor:Dn,borderRightColor:Dn,borderBottomColor:Dn,borderLeftColor:Dn,filter:$i,WebkitFilter:$i},ra=e=>na[e];function ia(e,t){let n=ra(e);return n!==$i&&(n=Vn),n.getAnimatableNone?n.getAnimatableNone(t):void 0}var aa=new Set([`auto`,`none`,`0`]);function oa(e,t,n){let r=0,i;for(;r<e.length&&!i;){let t=e[r];typeof t==`string`&&!aa.has(t)&&In(t).values.length&&(i=e[r]),r++}if(i&&n)for(let r of t)e[r]=ia(n,i)}var sa=class extends fi{constructor(e,t,n,r,i){super(e,t,n,r,i,!0)}readKeyframes(){let{unresolvedKeyframes:e,element:t,name:n}=this;if(!t||!t.current)return;super.readKeyframes();for(let n=0;n<e.length;n++){let r=e[n];if(typeof r==`string`&&(r=r.trim(),nn(r))){let i=Hi(r,t.current);i!==void 0&&(e[n]=i),n===e.length-1&&(this.finalKeyframe=r)}}if(this.resolveNoneKeyframes(),!Wi.has(n)||e.length!==2)return;let[r,i]=e,a=Ji(r),o=Ji(i);if(an(r)!==an(i)&&ii[n]){this.needsMeasurement=!0;return}if(a!==o)if(ei(a)&&ei(o))for(let t=0;t<e.length;t++){let n=e[t];typeof n==`string`&&(e[t]=parseFloat(n))}else ii[n]&&(this.needsMeasurement=!0)}resolveNoneKeyframes(){let{unresolvedKeyframes:e,name:t}=this,n=[];for(let t=0;t<e.length;t++)(e[t]===null||Yi(e[t]))&&n.push(t);n.length&&oa(e,n,t)}measureInitialState(){let{element:e,unresolvedKeyframes:t,name:n}=this;if(!e||!e.current)return;n===`height`&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=ii[n](e.measureViewportBox(),window.getComputedStyle(e.current)),t[0]=this.measuredOrigin;let r=t[t.length-1];r!==void 0&&e.getValue(n,r).jump(r,!1)}measureEndState(){let{element:e,name:t,unresolvedKeyframes:n}=this;if(!e||!e.current)return;let r=e.getValue(t);r&&r.jump(this.measuredOrigin,!1);let i=n.length-1,a=n[i];n[i]=ii[t](e.measureViewportBox(),window.getComputedStyle(e.current)),a!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=a),this.removedTransforms?.length&&this.removedTransforms.forEach(([t,n])=>{e.getValue(t).set(n)}),this.resolveNoneKeyframes()}};function ca(e,t,n){if(e instanceof EventTarget)return[e];if(typeof e==`string`){let r=document;t&&(r=t.current);let i=n?.[e]??r.querySelectorAll(e);return i?Array.from(i):[]}return Array.from(e)}var la=(e,t)=>t&&typeof e==`number`?t.transform(e):e;function ua(e){return st(e)&&`offsetHeight`in e}var da=30,fa=e=>!isNaN(parseFloat(e)),pa={current:void 0},ma=class{constructor(e,t={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=e=>{let t=Zt.now();if(this.updatedAt!==t&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(e),this.current!==this.prev&&(this.events.change?.notify(this.current),this.dependents))for(let e of this.dependents)e.dirty()},this.hasAnimated=!1,this.setCurrent(e),this.owner=t.owner}setCurrent(e){this.current=e,this.updatedAt=Zt.now(),this.canTrackVelocity===null&&e!==void 0&&(this.canTrackVelocity=fa(this.current))}setPrevFrameValue(e=this.current){this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt}onChange(e){return this.on(`change`,e)}on(e,t){this.events[e]||(this.events[e]=new mt);let n=this.events[e].add(t);return e===`change`?()=>{n(),Gt.read(()=>{this.events.change.getSize()||this.stop()})}:n}clearListeners(){for(let e in this.events)this.events[e].clear()}attach(e,t){this.passiveEffect=e,this.stopPassiveEffect=t}set(e){this.passiveEffect?this.passiveEffect(e,this.updateAndNotify):this.updateAndNotify(e)}setWithVelocity(e,t,n){this.set(t),this.prev=void 0,this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt-n}jump(e,t=!0){this.updateAndNotify(e),this.prev=e,this.prevUpdatedAt=this.prevFrameValue=void 0,t&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}dirty(){this.events.change?.notify(this.current)}addDependent(e){this.dependents||=new Set,this.dependents.add(e)}removeDependent(e){this.dependents&&this.dependents.delete(e)}get(){return pa.current&&pa.current.push(this),this.current}getPrevious(){return this.prev}getVelocity(){let e=Zt.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||e-this.updatedAt>da)return 0;let t=Math.min(this.updatedAt-this.prevUpdatedAt,da);return _t(parseFloat(this.current)-parseFloat(this.prevFrameValue),t)}start(e){return this.stop(),new Promise(t=>{this.hasAnimated=!0,this.animation=e(t),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.dependents?.clear(),this.events.destroy?.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}};function ha(e,t){return new ma(e,t)}var{schedule:ga,cancel:_a}=Wt(queueMicrotask,!1),va={x:!1,y:!1};function ya(){return va.x||va.y}function ba(e){return e===`x`||e===`y`?va[e]?null:(va[e]=!0,()=>{va[e]=!1}):va.x||va.y?null:(va.x=va.y=!0,()=>{va.x=va.y=!1})}function xa(e,t){let n=ca(e),r=new AbortController;return[n,{passive:!0,...t,signal:r.signal},()=>r.abort()]}function Sa(e){return!(e.pointerType===`touch`||ya())}function Ca(e,t,n={}){let[r,i,a]=xa(e,n),o=e=>{if(!Sa(e))return;let{target:n}=e,r=t(n,e);if(typeof r!=`function`||!n)return;let a=e=>{Sa(e)&&(r(e),n.removeEventListener(`pointerleave`,a))};n.addEventListener(`pointerleave`,a,i)};return r.forEach(e=>{e.addEventListener(`pointerenter`,o,i)}),a}var wa=(e,t)=>t?e===t?!0:wa(e,t.parentElement):!1,Ta=e=>e.pointerType===`mouse`?typeof e.button!=`number`||e.button<=0:e.isPrimary!==!1,Ea=new Set([`BUTTON`,`INPUT`,`SELECT`,`TEXTAREA`,`A`]);function Da(e){return Ea.has(e.tagName)||e.isContentEditable===!0}var Oa=new WeakSet;function ka(e){return t=>{t.key===`Enter`&&e(t)}}function Aa(e,t){e.dispatchEvent(new PointerEvent(`pointer`+t,{isPrimary:!0,bubbles:!0}))}var ja=(e,t)=>{let n=e.currentTarget;if(!n)return;let r=ka(()=>{if(Oa.has(n))return;Aa(n,`down`);let e=ka(()=>{Aa(n,`up`)});n.addEventListener(`keyup`,e,t),n.addEventListener(`blur`,()=>Aa(n,`cancel`),t)});n.addEventListener(`keydown`,r,t),n.addEventListener(`blur`,()=>n.removeEventListener(`keydown`,r),t)};function Ma(e){return Ta(e)&&!ya()}function Na(e,t,n={}){let[r,i,a]=xa(e,n),o=e=>{let r=e.currentTarget;if(!Ma(e))return;Oa.add(r);let a=t(r,e),o=(e,t)=>{window.removeEventListener(`pointerup`,s),window.removeEventListener(`pointercancel`,c),Oa.has(r)&&Oa.delete(r),Ma(e)&&typeof a==`function`&&a(e,{success:t})},s=e=>{o(e,r===window||r===document||n.useGlobalTarget||wa(r,e.target))},c=e=>{o(e,!1)};window.addEventListener(`pointerup`,s,i),window.addEventListener(`pointercancel`,c,i)};return r.forEach(e=>{(n.useGlobalTarget?window:e).addEventListener(`pointerdown`,o,i),ua(e)&&(e.addEventListener(`focus`,e=>ja(e,i)),!Da(e)&&!e.hasAttribute(`tabindex`)&&(e.tabIndex=0))}),a}function Pa(e){return st(e)&&`ownerSVGElement`in e}function Fa(e){return Pa(e)&&e.tagName===`svg`}var Ia=e=>!!(e&&e.getVelocity),La=[...qi,Dn,Vn],Ra=e=>La.find(Ki(e)),za=(0,x.createContext)({transformPagePoint:e=>e,isStatic:!1,reducedMotion:`never`});function Ba(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}function Va(...e){return t=>{let n=!1,r=e.map(e=>{let r=Ba(e,t);return!n&&typeof r==`function`&&(n=!0),r});if(n)return()=>{for(let t=0;t<r.length;t++){let n=r[t];typeof n==`function`?n():Ba(e[t],null)}}}}function Ha(...e){return x.useCallback(Va(...e),e)}var Ua=class extends x.Component{getSnapshotBeforeUpdate(e){let t=this.props.childRef.current;if(t&&e.isPresent&&!this.props.isPresent){let e=t.offsetParent,n=ua(e)&&e.offsetWidth||0,r=this.props.sizeRef.current;r.height=t.offsetHeight||0,r.width=t.offsetWidth||0,r.top=t.offsetTop,r.left=t.offsetLeft,r.right=n-r.width-r.left}return null}componentDidUpdate(){}render(){return this.props.children}};function Wa({children:e,isPresent:t,anchorX:n,root:r}){let i=(0,x.useId)(),a=(0,x.useRef)(null),o=(0,x.useRef)({width:0,height:0,top:0,left:0,right:0}),{nonce:s}=(0,x.useContext)(za),c=Ha(a,e.props?.ref??e?.ref);return(0,x.useInsertionEffect)(()=>{let{width:e,height:c,top:l,left:u,right:d}=o.current;if(t||!a.current||!e||!c)return;let f=n===`left`?`left: ${u}`:`right: ${d}`;a.current.dataset.motionPopId=i;let p=document.createElement(`style`);s&&(p.nonce=s);let m=r??document.head;return m.appendChild(p),p.sheet&&p.sheet.insertRule(`
8
+ `+e.stack}return{value:e,source:t,stack:i,digest:null}}function Es(e,t,n){return{value:e,source:null,stack:n??null,digest:t??null}}function Ds(e,t){try{console.error(t.value)}catch(e){setTimeout(function(){throw e})}}var Os=typeof WeakMap==`function`?WeakMap:Map;function ks(e,t,n){n=eo(-1,n),n.tag=3,n.payload={element:null};var r=t.value;return n.callback=function(){ol||(ol=!0,sl=r),Ds(e,t)},n}function As(e,t,n){n=eo(-1,n),n.tag=3;var r=e.type.getDerivedStateFromError;if(typeof r==`function`){var i=t.value;n.payload=function(){return r(i)},n.callback=function(){Ds(e,t)}}var a=e.stateNode;return a!==null&&typeof a.componentDidCatch==`function`&&(n.callback=function(){Ds(e,t),typeof r!=`function`&&(cl===null?cl=new Set([this]):cl.add(this));var n=t.stack;this.componentDidCatch(t.value,{componentStack:n===null?``:n})}),n}function js(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new Os;var i=new Set;r.set(t,i)}else i=r.get(t),i===void 0&&(i=new Set,r.set(t,i));i.has(n)||(i.add(n),e=Ul.bind(null,e,t,n),t.then(e,e))}function Ms(e){do{var t;if((t=e.tag===13)&&(t=e.memoizedState,t=t===null?!0:t.dehydrated!==null),t)return e;e=e.return}while(e!==null);return null}function Ns(e,t,n,r,i){return e.mode&1?(e.flags|=65536,e.lanes=i,e):(e===t?e.flags|=65536:(e.flags|=128,n.flags|=131072,n.flags&=-52805,n.tag===1&&(n.alternate===null?n.tag=17:(t=eo(-1,1),t.tag=2,to(n,t,1))),n.lanes|=1),e)}var Ps=C.ReactCurrentOwner,Fs=!1;function Is(e,t,n,r){t.child=e===null?La(t,null,n,r):Ia(t,e.child,n,r)}function Ls(e,t,n,r,i){n=n.render;var a=t.ref;return Ga(t,i),r=Mo(e,t,n,r,a,i),n=No(),e!==null&&!Fs?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i,rc(e,t,i)):(ba&&n&&ga(t),t.flags|=1,Is(e,t,r,i),t.child)}function Rs(e,t,n,r,i){if(e===null){var a=n.type;return typeof a==`function`&&!Zl(a)&&a.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(t.tag=15,t.type=a,zs(e,t,a,r,i)):(e=eu(n.type,null,r,t,t.mode,i),e.ref=t.ref,e.return=t,t.child=e)}if(a=e.child,(e.lanes&i)===0){var o=a.memoizedProps;if(n=n.compare,n=n===null?Cr:n,n(o,r)&&e.ref===t.ref)return rc(e,t,i)}return t.flags|=1,e=$l(a,r),e.ref=t.ref,e.return=t,t.child=e}function zs(e,t,n,r,i){if(e!==null){var a=e.memoizedProps;if(Cr(a,r)&&e.ref===t.ref)if(Fs=!1,t.pendingProps=r=a,(e.lanes&i)!==0)e.flags&131072&&(Fs=!0);else return t.lanes=e.lanes,rc(e,t,i)}return Hs(e,t,n,r,i)}function Bs(e,t,n){var r=t.pendingProps,i=r.children,a=e===null?null:e.memoizedState;if(r.mode===`hidden`)if(!(t.mode&1))t.memoizedState={baseLanes:0,cachePool:null,transitions:null},Vi(Yc,Jc),Jc|=n;else{if(!(n&1073741824))return e=a===null?n:a.baseLanes|n,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,Vi(Yc,Jc),Jc|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=a===null?n:a.baseLanes,Vi(Yc,Jc),Jc|=r}else a===null?r=n:(r=a.baseLanes|n,t.memoizedState=null),Vi(Yc,Jc),Jc|=r;return Is(e,t,i,n),t.child}function Vs(e,t){var n=t.ref;(e===null&&n!==null||e!==null&&e.ref!==n)&&(t.flags|=512,t.flags|=2097152)}function Hs(e,t,n,r,i){var a=qi(n)?Gi:Ui.current;return a=Ki(t,a),Ga(t,i),n=Mo(e,t,n,r,a,i),r=No(),e!==null&&!Fs?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i,rc(e,t,i)):(ba&&r&&ga(t),t.flags|=1,Is(e,t,n,i),t.child)}function Us(e,t,n,r,i){if(qi(n)){var a=!0;Zi(t)}else a=!1;if(Ga(t,i),t.stateNode===null)nc(e,t),Ss(t,n,r),ws(t,n,r,i),r=!0;else if(e===null){var o=t.stateNode,s=t.memoizedProps;o.props=s;var c=o.context,l=n.contextType;typeof l==`object`&&l?l=Ka(l):(l=qi(n)?Gi:Ui.current,l=Ki(t,l));var u=n.getDerivedStateFromProps,d=typeof u==`function`||typeof o.getSnapshotBeforeUpdate==`function`;d||typeof o.UNSAFE_componentWillReceiveProps!=`function`&&typeof o.componentWillReceiveProps!=`function`||(s!==r||c!==l)&&Cs(t,o,r,l),Za=!1;var f=t.memoizedState;o.state=f,io(t,r,o,i),c=t.memoizedState,s!==r||f!==c||Wi.current||Za?(typeof u==`function`&&(ys(t,n,u,r),c=t.memoizedState),(s=Za||xs(t,n,s,r,f,c,l))?(d||typeof o.UNSAFE_componentWillMount!=`function`&&typeof o.componentWillMount!=`function`||(typeof o.componentWillMount==`function`&&o.componentWillMount(),typeof o.UNSAFE_componentWillMount==`function`&&o.UNSAFE_componentWillMount()),typeof o.componentDidMount==`function`&&(t.flags|=4194308)):(typeof o.componentDidMount==`function`&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=c),o.props=r,o.state=c,o.context=l,r=s):(typeof o.componentDidMount==`function`&&(t.flags|=4194308),r=!1)}else{o=t.stateNode,$a(e,t),s=t.memoizedProps,l=t.type===t.elementType?s:vs(t.type,s),o.props=l,d=t.pendingProps,f=o.context,c=n.contextType,typeof c==`object`&&c?c=Ka(c):(c=qi(n)?Gi:Ui.current,c=Ki(t,c));var p=n.getDerivedStateFromProps;(u=typeof p==`function`||typeof o.getSnapshotBeforeUpdate==`function`)||typeof o.UNSAFE_componentWillReceiveProps!=`function`&&typeof o.componentWillReceiveProps!=`function`||(s!==d||f!==c)&&Cs(t,o,r,c),Za=!1,f=t.memoizedState,o.state=f,io(t,r,o,i);var m=t.memoizedState;s!==d||f!==m||Wi.current||Za?(typeof p==`function`&&(ys(t,n,p,r),m=t.memoizedState),(l=Za||xs(t,n,l,r,f,m,c)||!1)?(u||typeof o.UNSAFE_componentWillUpdate!=`function`&&typeof o.componentWillUpdate!=`function`||(typeof o.componentWillUpdate==`function`&&o.componentWillUpdate(r,m,c),typeof o.UNSAFE_componentWillUpdate==`function`&&o.UNSAFE_componentWillUpdate(r,m,c)),typeof o.componentDidUpdate==`function`&&(t.flags|=4),typeof o.getSnapshotBeforeUpdate==`function`&&(t.flags|=1024)):(typeof o.componentDidUpdate!=`function`||s===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof o.getSnapshotBeforeUpdate!=`function`||s===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=m),o.props=r,o.state=m,o.context=c,r=l):(typeof o.componentDidUpdate!=`function`||s===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof o.getSnapshotBeforeUpdate!=`function`||s===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),r=!1)}return Ws(e,t,n,r,a,i)}function Ws(e,t,n,r,i,a){Vs(e,t);var o=(t.flags&128)!=0;if(!r&&!o)return i&&Qi(t,n,!1),rc(e,t,a);r=t.stateNode,Ps.current=t;var s=o&&typeof n.getDerivedStateFromError!=`function`?null:r.render();return t.flags|=1,e!==null&&o?(t.child=Ia(t,e.child,null,a),t.child=Ia(t,null,s,a)):Is(e,t,s,a),t.memoizedState=r.state,i&&Qi(t,n,!0),t.child}function Gs(e){var t=e.stateNode;t.pendingContext?Yi(e,t.pendingContext,t.pendingContext!==t.context):t.context&&Yi(e,t.context,!1),fo(e,t.containerInfo)}function Ks(e,t,n,r,i){return ka(),Aa(i),t.flags|=256,Is(e,t,n,r),t.child}var qs={dehydrated:null,treeContext:null,retryLane:0};function Js(e){return{baseLanes:e,cachePool:null,transitions:null}}function Ys(e,t,n){var r=t.pendingProps,i=go.current,a=!1,o=(t.flags&128)!=0,s;if((s=o)||(s=e!==null&&e.memoizedState===null?!1:(i&2)!=0),s?(a=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(i|=1),Vi(go,i&1),e===null)return Ta(t),e=t.memoizedState,e!==null&&(e=e.dehydrated,e!==null)?(t.mode&1?e.data===`$!`?t.lanes=8:t.lanes=1073741824:t.lanes=1,null):(o=r.children,e=r.fallback,a?(r=t.mode,a=t.child,o={mode:`hidden`,children:o},!(r&1)&&a!==null?(a.childLanes=0,a.pendingProps=o):a=nu(o,r,0,null),e=tu(e,r,n,null),a.return=t,e.return=t,a.sibling=e,t.child=a,t.child.memoizedState=Js(n),t.memoizedState=qs,e):Xs(t,o));if(i=e.memoizedState,i!==null&&(s=i.dehydrated,s!==null))return Qs(e,t,o,r,s,i,n);if(a){a=r.fallback,o=t.mode,i=e.child,s=i.sibling;var c={mode:`hidden`,children:r.children};return!(o&1)&&t.child!==i?(r=t.child,r.childLanes=0,r.pendingProps=c,t.deletions=null):(r=$l(i,c),r.subtreeFlags=i.subtreeFlags&14680064),s===null?(a=tu(a,o,n,null),a.flags|=2):a=$l(s,a),a.return=t,r.return=t,r.sibling=a,t.child=r,r=a,a=t.child,o=e.child.memoizedState,o=o===null?Js(n):{baseLanes:o.baseLanes|n,cachePool:null,transitions:o.transitions},a.memoizedState=o,a.childLanes=e.childLanes&~n,t.memoizedState=qs,r}return a=e.child,e=a.sibling,r=$l(a,{mode:`visible`,children:r.children}),!(t.mode&1)&&(r.lanes=n),r.return=t,r.sibling=null,e!==null&&(n=t.deletions,n===null?(t.deletions=[e],t.flags|=16):n.push(e)),t.child=r,t.memoizedState=null,r}function Xs(e,t){return t=nu({mode:`visible`,children:t},e.mode,0,null),t.return=e,e.child=t}function Zs(e,t,n,r){return r!==null&&Aa(r),Ia(t,e.child,null,n),e=Xs(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function Qs(e,t,n,i,a,o,s){if(n)return t.flags&256?(t.flags&=-257,i=Es(Error(r(422))),Zs(e,t,s,i)):t.memoizedState===null?(o=i.fallback,a=t.mode,i=nu({mode:`visible`,children:i.children},a,0,null),o=tu(o,a,s,null),o.flags|=2,i.return=t,o.return=t,i.sibling=o,t.child=i,t.mode&1&&Ia(t,e.child,null,s),t.child.memoizedState=Js(s),t.memoizedState=qs,o):(t.child=e.child,t.flags|=128,null);if(!(t.mode&1))return Zs(e,t,s,null);if(a.data===`$!`){if(i=a.nextSibling&&a.nextSibling.dataset,i)var c=i.dgst;return i=c,o=Error(r(419)),i=Es(o,i,void 0),Zs(e,t,s,i)}if(c=(s&e.childLanes)!==0,Fs||c){if(i=Gc,i!==null){switch(s&-s){case 4:a=2;break;case 16:a=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:a=32;break;case 536870912:a=268435456;break;default:a=0}a=(a&(i.suspendedLanes|s))===0?a:0,a!==0&&a!==o.retryLane&&(o.retryLane=a,Xa(e,a),vl(i,e,a,-1))}return Ml(),i=Es(Error(r(421))),Zs(e,t,s,i)}return a.data===`$?`?(t.flags|=128,t.child=e.child,t=Gl.bind(null,e),a._reactRetry=t,null):(e=o.treeContext,ya=wi(a.nextSibling),va=t,ba=!0,xa=null,e!==null&&(la[ua++]=fa,la[ua++]=pa,la[ua++]=da,fa=e.id,pa=e.overflow,da=t),t=Xs(t,i.children),t.flags|=4096,t)}function $s(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),Wa(e.return,t,n)}function ec(e,t,n,r,i){var a=e.memoizedState;a===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:i}:(a.isBackwards=t,a.rendering=null,a.renderingStartTime=0,a.last=r,a.tail=n,a.tailMode=i)}function tc(e,t,n){var r=t.pendingProps,i=r.revealOrder,a=r.tail;if(Is(e,t,r.children,n),r=go.current,r&2)r=r&1|2,t.flags|=128;else{if(e!==null&&e.flags&128)a:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&$s(e,n,t);else if(e.tag===19)$s(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break a;for(;e.sibling===null;){if(e.return===null||e.return===t)break a;e=e.return}e.sibling.return=e.return,e=e.sibling}r&=1}if(Vi(go,r),!(t.mode&1))t.memoizedState=null;else switch(i){case`forwards`:for(n=t.child,i=null;n!==null;)e=n.alternate,e!==null&&_o(e)===null&&(i=n),n=n.sibling;n=i,n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null),ec(t,!1,i,n,a);break;case`backwards`:for(n=null,i=t.child,t.child=null;i!==null;){if(e=i.alternate,e!==null&&_o(e)===null){t.child=i;break}e=i.sibling,i.sibling=n,n=i,i=e}ec(t,!0,n,null,a);break;case`together`:ec(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function nc(e,t){!(t.mode&1)&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function rc(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),Qc|=t.lanes,(n&t.childLanes)===0)return null;if(e!==null&&t.child!==e.child)throw Error(r(153));if(t.child!==null){for(e=t.child,n=$l(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=$l(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function ic(e,t,n){switch(t.tag){case 3:Gs(t),ka();break;case 5:mo(t);break;case 1:qi(t.type)&&Zi(t);break;case 4:fo(t,t.stateNode.containerInfo);break;case 10:var r=t.type._context,i=t.memoizedProps.value;Vi(Ra,r._currentValue),r._currentValue=i;break;case 13:if(r=t.memoizedState,r!==null)return r.dehydrated===null?(n&t.child.childLanes)===0?(Vi(go,go.current&1),e=rc(e,t,n),e===null?null:e.sibling):Ys(e,t,n):(Vi(go,go.current&1),t.flags|=128,null);Vi(go,go.current&1);break;case 19:if(r=(n&t.childLanes)!==0,e.flags&128){if(r)return tc(e,t,n);t.flags|=128}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),Vi(go,go.current),r)break;return null;case 22:case 23:return t.lanes=0,Bs(e,t,n)}return rc(e,t,n)}var ac=function(e,t){for(var n=t.child;n!==null;){if(n.tag===5||n.tag===6)e.appendChild(n.stateNode);else if(n.tag!==4&&n.child!==null){n.child.return=n,n=n.child;continue}if(n===t)break;for(;n.sibling===null;){if(n.return===null||n.return===t)return;n=n.return}n.sibling.return=n.return,n=n.sibling}},oc=function(e,t,n,r){var i=e.memoizedProps;if(i!==r){e=t.stateNode,uo(so.current);var o=null;switch(n){case`input`:i=oe(e,i),r=oe(e,r),o=[];break;case`select`:i=z({},i,{value:void 0}),r=z({},r,{value:void 0}),o=[];break;case`textarea`:i=me(e,i),r=me(e,r),o=[];break;default:typeof i.onClick!=`function`&&typeof r.onClick==`function`&&(e.onclick=mi)}Oe(n,r);var s;for(u in n=null,i)if(!r.hasOwnProperty(u)&&i.hasOwnProperty(u)&&i[u]!=null)if(u===`style`){var c=i[u];for(s in c)c.hasOwnProperty(s)&&(n||={},n[s]=``)}else u!==`dangerouslySetInnerHTML`&&u!==`children`&&u!==`suppressContentEditableWarning`&&u!==`suppressHydrationWarning`&&u!==`autoFocus`&&(a.hasOwnProperty(u)?o||=[]:(o||=[]).push(u,null));for(u in r){var l=r[u];if(c=i?.[u],r.hasOwnProperty(u)&&l!==c&&(l!=null||c!=null))if(u===`style`)if(c){for(s in c)!c.hasOwnProperty(s)||l&&l.hasOwnProperty(s)||(n||={},n[s]=``);for(s in l)l.hasOwnProperty(s)&&c[s]!==l[s]&&(n||={},n[s]=l[s])}else n||(o||=[],o.push(u,n)),n=l;else u===`dangerouslySetInnerHTML`?(l=l?l.__html:void 0,c=c?c.__html:void 0,l!=null&&c!==l&&(o||=[]).push(u,l)):u===`children`?typeof l!=`string`&&typeof l!=`number`||(o||=[]).push(u,``+l):u!==`suppressContentEditableWarning`&&u!==`suppressHydrationWarning`&&(a.hasOwnProperty(u)?(l!=null&&u===`onScroll`&&ei(`scroll`,e),o||c===l||(o=[])):(o||=[]).push(u,l))}n&&(o||=[]).push(`style`,n);var u=o;(t.updateQueue=u)&&(t.flags|=4)}},sc=function(e,t,n,r){n!==r&&(t.flags|=4)};function cc(e,t){if(!ba)switch(e.tailMode){case`hidden`:t=e.tail;for(var n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null;break;case`collapsed`:n=e.tail;for(var r=null;n!==null;)n.alternate!==null&&(r=n),n=n.sibling;r===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:r.sibling=null}}function lc(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,r=0;if(t)for(var i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags&14680064,r|=i.flags&14680064,i.return=e,i=i.sibling;else for(i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags,r|=i.flags,i.return=e,i=i.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function uc(e,t,n){var i=t.pendingProps;switch(_a(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return lc(t),null;case 1:return qi(t.type)&&Ji(),lc(t),null;case 3:return i=t.stateNode,po(),Bi(Wi),Bi(Ui),yo(),i.pendingContext&&(i.context=i.pendingContext,i.pendingContext=null),(e===null||e.child===null)&&(Da(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,xa!==null&&(Sl(xa),xa=null))),lc(t),null;case 5:ho(t);var o=uo(lo.current);if(n=t.type,e!==null&&t.stateNode!=null)oc(e,t,n,i,o),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!i){if(t.stateNode===null)throw Error(r(166));return lc(t),null}if(e=uo(so.current),Da(t)){i=t.stateNode,n=t.type;var s=t.memoizedProps;switch(i[Di]=t,i[Oi]=s,e=(t.mode&1)!=0,n){case`dialog`:ei(`cancel`,i),ei(`close`,i);break;case`iframe`:case`object`:case`embed`:ei(`load`,i);break;case`video`:case`audio`:for(o=0;o<Xr.length;o++)ei(Xr[o],i);break;case`source`:ei(`error`,i);break;case`img`:case`image`:case`link`:ei(`error`,i),ei(`load`,i);break;case`details`:ei(`toggle`,i);break;case`input`:se(i,s),ei(`invalid`,i);break;case`select`:i._wrapperState={wasMultiple:!!s.multiple},ei(`invalid`,i);break;case`textarea`:he(i,s),ei(`invalid`,i)}for(var c in Oe(n,s),o=null,s)if(s.hasOwnProperty(c)){var l=s[c];c===`children`?typeof l==`string`?i.textContent!==l&&(!0!==s.suppressHydrationWarning&&pi(i.textContent,l,e),o=[`children`,l]):typeof l==`number`&&i.textContent!==``+l&&(!0!==s.suppressHydrationWarning&&pi(i.textContent,l,e),o=[`children`,``+l]):a.hasOwnProperty(c)&&l!=null&&c===`onScroll`&&ei(`scroll`,i)}switch(n){case`input`:re(i),ue(i,s,!0);break;case`textarea`:re(i),_e(i);break;case`select`:case`option`:break;default:typeof s.onClick==`function`&&(i.onclick=mi)}i=o,t.updateQueue=i,i!==null&&(t.flags|=4)}else{c=o.nodeType===9?o:o.ownerDocument,e===`http://www.w3.org/1999/xhtml`&&(e=ve(n)),e===`http://www.w3.org/1999/xhtml`?n===`script`?(e=c.createElement(`div`),e.innerHTML=`<script><\/script>`,e=e.removeChild(e.firstChild)):typeof i.is==`string`?e=c.createElement(n,{is:i.is}):(e=c.createElement(n),n===`select`&&(c=e,i.multiple?c.multiple=!0:i.size&&(c.size=i.size))):e=c.createElementNS(e,n),e[Di]=t,e[Oi]=i,ac(e,t,!1,!1),t.stateNode=e;a:{switch(c=ke(n,i),n){case`dialog`:ei(`cancel`,e),ei(`close`,e),o=i;break;case`iframe`:case`object`:case`embed`:ei(`load`,e),o=i;break;case`video`:case`audio`:for(o=0;o<Xr.length;o++)ei(Xr[o],e);o=i;break;case`source`:ei(`error`,e),o=i;break;case`img`:case`image`:case`link`:ei(`error`,e),ei(`load`,e),o=i;break;case`details`:ei(`toggle`,e),o=i;break;case`input`:se(e,i),o=oe(e,i),ei(`invalid`,e);break;case`option`:o=i;break;case`select`:e._wrapperState={wasMultiple:!!i.multiple},o=z({},i,{value:void 0}),ei(`invalid`,e);break;case`textarea`:he(e,i),o=me(e,i),ei(`invalid`,e);break;default:o=i}for(s in Oe(n,o),l=o,l)if(l.hasOwnProperty(s)){var u=l[s];s===`style`?Ee(e,u):s===`dangerouslySetInnerHTML`?(u=u?u.__html:void 0,u!=null&&xe(e,u)):s===`children`?typeof u==`string`?(n!==`textarea`||u!==``)&&Se(e,u):typeof u==`number`&&Se(e,``+u):s!==`suppressContentEditableWarning`&&s!==`suppressHydrationWarning`&&s!==`autoFocus`&&(a.hasOwnProperty(s)?u!=null&&s===`onScroll`&&ei(`scroll`,e):u!=null&&S(e,s,u,c))}switch(n){case`input`:re(e),ue(e,i,!1);break;case`textarea`:re(e),_e(e);break;case`option`:i.value!=null&&e.setAttribute(`value`,``+K(i.value));break;case`select`:e.multiple=!!i.multiple,s=i.value,s==null?i.defaultValue!=null&&pe(e,!!i.multiple,i.defaultValue,!0):pe(e,!!i.multiple,s,!1);break;default:typeof o.onClick==`function`&&(e.onclick=mi)}switch(n){case`button`:case`input`:case`select`:case`textarea`:i=!!i.autoFocus;break a;case`img`:i=!0;break a;default:i=!1}}i&&(t.flags|=4)}t.ref!==null&&(t.flags|=512,t.flags|=2097152)}return lc(t),null;case 6:if(e&&t.stateNode!=null)sc(e,t,e.memoizedProps,i);else{if(typeof i!=`string`&&t.stateNode===null)throw Error(r(166));if(n=uo(lo.current),uo(so.current),Da(t)){if(i=t.stateNode,n=t.memoizedProps,i[Di]=t,(s=i.nodeValue!==n)&&(e=va,e!==null))switch(e.tag){case 3:pi(i.nodeValue,n,(e.mode&1)!=0);break;case 5:!0!==e.memoizedProps.suppressHydrationWarning&&pi(i.nodeValue,n,(e.mode&1)!=0)}s&&(t.flags|=4)}else i=(n.nodeType===9?n:n.ownerDocument).createTextNode(i),i[Di]=t,t.stateNode=i}return lc(t),null;case 13:if(Bi(go),i=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(ba&&ya!==null&&t.mode&1&&!(t.flags&128))Oa(),ka(),t.flags|=98560,s=!1;else if(s=Da(t),i!==null&&i.dehydrated!==null){if(e===null){if(!s)throw Error(r(318));if(s=t.memoizedState,s=s===null?null:s.dehydrated,!s)throw Error(r(317));s[Di]=t}else ka(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;lc(t),s=!1}else xa!==null&&(Sl(xa),xa=null),s=!0;if(!s)return t.flags&65536?t:null}return t.flags&128?(t.lanes=n,t):(i=i!==null,i!==(e!==null&&e.memoizedState!==null)&&i&&(t.child.flags|=8192,t.mode&1&&(e===null||go.current&1?Xc===0&&(Xc=3):Ml())),t.updateQueue!==null&&(t.flags|=4),lc(t),null);case 4:return po(),e===null&&ri(t.stateNode.containerInfo),lc(t),null;case 10:return Ua(t.type._context),lc(t),null;case 17:return qi(t.type)&&Ji(),lc(t),null;case 19:if(Bi(go),s=t.memoizedState,s===null)return lc(t),null;if(i=(t.flags&128)!=0,c=s.rendering,c===null)if(i)cc(s,!1);else{if(Xc!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(c=_o(e),c!==null){for(t.flags|=128,cc(s,!1),i=c.updateQueue,i!==null&&(t.updateQueue=i,t.flags|=4),t.subtreeFlags=0,i=n,n=t.child;n!==null;)s=n,e=i,s.flags&=14680066,c=s.alternate,c===null?(s.childLanes=0,s.lanes=e,s.child=null,s.subtreeFlags=0,s.memoizedProps=null,s.memoizedState=null,s.updateQueue=null,s.dependencies=null,s.stateNode=null):(s.childLanes=c.childLanes,s.lanes=c.lanes,s.child=c.child,s.subtreeFlags=0,s.deletions=null,s.memoizedProps=c.memoizedProps,s.memoizedState=c.memoizedState,s.updateQueue=c.updateQueue,s.type=c.type,e=c.dependencies,s.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),n=n.sibling;return Vi(go,go.current&1|2),t.child}e=e.sibling}s.tail!==null&&ct()>il&&(t.flags|=128,i=!0,cc(s,!1),t.lanes=4194304)}else{if(!i)if(e=_o(c),e!==null){if(t.flags|=128,i=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),cc(s,!0),s.tail===null&&s.tailMode===`hidden`&&!c.alternate&&!ba)return lc(t),null}else 2*ct()-s.renderingStartTime>il&&n!==1073741824&&(t.flags|=128,i=!0,cc(s,!1),t.lanes=4194304);s.isBackwards?(c.sibling=t.child,t.child=c):(n=s.last,n===null?t.child=c:n.sibling=c,s.last=c)}return s.tail===null?(lc(t),null):(t=s.tail,s.rendering=t,s.tail=t.sibling,s.renderingStartTime=ct(),t.sibling=null,n=go.current,Vi(go,i?n&1|2:n&1),t);case 22:case 23:return Ol(),i=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==i&&(t.flags|=8192),i&&t.mode&1?Jc&1073741824&&(lc(t),t.subtreeFlags&6&&(t.flags|=8192)):lc(t),null;case 24:return null;case 25:return null}throw Error(r(156,t.tag))}function dc(e,t){switch(_a(t),t.tag){case 1:return qi(t.type)&&Ji(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return po(),Bi(Wi),Bi(Ui),yo(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return ho(t),null;case 13:if(Bi(go),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(r(340));ka()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Bi(go),null;case 4:return po(),null;case 10:return Ua(t.type._context),null;case 22:case 23:return Ol(),null;case 24:return null;default:return null}}var fc=!1,pc=!1,mc=typeof WeakSet==`function`?WeakSet:Set,Y=null;function hc(e,t){var n=e.ref;if(n!==null)if(typeof n==`function`)try{n(null)}catch(n){Hl(e,t,n)}else n.current=null}function gc(e,t,n){try{n()}catch(n){Hl(e,t,n)}}var _c=!1;function vc(e,t){if(hi=sn,e=Dr(),Or(e)){if(`selectionStart`in e)var n={start:e.selectionStart,end:e.selectionEnd};else a:{n=(n=e.ownerDocument)&&n.defaultView||window;var i=n.getSelection&&n.getSelection();if(i&&i.rangeCount!==0){n=i.anchorNode;var a=i.anchorOffset,o=i.focusNode;i=i.focusOffset;try{n.nodeType,o.nodeType}catch{n=null;break a}var s=0,c=-1,l=-1,u=0,d=0,f=e,p=null;b:for(;;){for(var m;f!==n||a!==0&&f.nodeType!==3||(c=s+a),f!==o||i!==0&&f.nodeType!==3||(l=s+i),f.nodeType===3&&(s+=f.nodeValue.length),(m=f.firstChild)!==null;)p=f,f=m;for(;;){if(f===e)break b;if(p===n&&++u===a&&(c=s),p===o&&++d===i&&(l=s),(m=f.nextSibling)!==null)break;f=p,p=f.parentNode}f=m}n=c===-1||l===-1?null:{start:c,end:l}}else n=null}n||={start:0,end:0}}else n=null;for(gi={focusedElem:e,selectionRange:n},sn=!1,Y=t;Y!==null;)if(t=Y,e=t.child,t.subtreeFlags&1028&&e!==null)e.return=t,Y=e;else for(;Y!==null;){t=Y;try{var h=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(h!==null){var g=h.memoizedProps,_=h.memoizedState,v=t.stateNode;v.__reactInternalSnapshotBeforeUpdate=v.getSnapshotBeforeUpdate(t.elementType===t.type?g:vs(t.type,g),_)}break;case 3:var y=t.stateNode.containerInfo;y.nodeType===1?y.textContent=``:y.nodeType===9&&y.documentElement&&y.removeChild(y.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(r(163))}}catch(e){Hl(t,t.return,e)}if(e=t.sibling,e!==null){e.return=t.return,Y=e;break}Y=t.return}return h=_c,_c=!1,h}function yc(e,t,n){var r=t.updateQueue;if(r=r===null?null:r.lastEffect,r!==null){var i=r=r.next;do{if((i.tag&e)===e){var a=i.destroy;i.destroy=void 0,a!==void 0&&gc(t,n,a)}i=i.next}while(i!==r)}}function bc(e,t){if(t=t.updateQueue,t=t===null?null:t.lastEffect,t!==null){var n=t=t.next;do{if((n.tag&e)===e){var r=n.create;n.destroy=r()}n=n.next}while(n!==t)}}function xc(e){var t=e.ref;if(t!==null){var n=e.stateNode;switch(e.tag){case 5:e=n;break;default:e=n}typeof t==`function`?t(e):t.current=e}}function Sc(e){var t=e.alternate;t!==null&&(e.alternate=null,Sc(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[Di],delete t[Oi],delete t[Ai],delete t[ji],delete t[Mi])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function Cc(e){return e.tag===5||e.tag===3||e.tag===4}function wc(e){a:for(;;){for(;e.sibling===null;){if(e.return===null||Cc(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue a;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function Tc(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.nodeType===8?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(n.nodeType===8?(t=n.parentNode,t.insertBefore(e,n)):(t=n,t.appendChild(e)),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=mi));else if(r!==4&&(e=e.child,e!==null))for(Tc(e,t,n),e=e.sibling;e!==null;)Tc(e,t,n),e=e.sibling}function Ec(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(e=e.child,e!==null))for(Ec(e,t,n),e=e.sibling;e!==null;)Ec(e,t,n),e=e.sibling}var Dc=null,Oc=!1;function kc(e,t,n){for(n=n.child;n!==null;)Ac(e,t,n),n=n.sibling}function Ac(e,t,n){if(gt&&typeof gt.onCommitFiberUnmount==`function`)try{gt.onCommitFiberUnmount(ht,n)}catch{}switch(n.tag){case 5:pc||hc(n,t);case 6:var r=Dc,i=Oc;Dc=null,kc(e,t,n),Dc=r,Oc=i,Dc!==null&&(Oc?(e=Dc,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):Dc.removeChild(n.stateNode));break;case 18:Dc!==null&&(Oc?(e=Dc,n=n.stateNode,e.nodeType===8?Ci(e.parentNode,n):e.nodeType===1&&Ci(e,n),an(e)):Ci(Dc,n.stateNode));break;case 4:r=Dc,i=Oc,Dc=n.stateNode.containerInfo,Oc=!0,kc(e,t,n),Dc=r,Oc=i;break;case 0:case 11:case 14:case 15:if(!pc&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){i=r=r.next;do{var a=i,o=a.destroy;a=a.tag,o!==void 0&&(a&2||a&4)&&gc(n,t,o),i=i.next}while(i!==r)}kc(e,t,n);break;case 1:if(!pc&&(hc(n,t),r=n.stateNode,typeof r.componentWillUnmount==`function`))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(e){Hl(n,t,e)}kc(e,t,n);break;case 21:kc(e,t,n);break;case 22:n.mode&1?(pc=(r=pc)||n.memoizedState!==null,kc(e,t,n),pc=r):kc(e,t,n);break;default:kc(e,t,n)}}function jc(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new mc),t.forEach(function(t){var r=Kl.bind(null,e,t);n.has(t)||(n.add(t),t.then(r,r))})}}function Mc(e,t){var n=t.deletions;if(n!==null)for(var i=0;i<n.length;i++){var a=n[i];try{var o=e,s=t,c=s;a:for(;c!==null;){switch(c.tag){case 5:Dc=c.stateNode,Oc=!1;break a;case 3:Dc=c.stateNode.containerInfo,Oc=!0;break a;case 4:Dc=c.stateNode.containerInfo,Oc=!0;break a}c=c.return}if(Dc===null)throw Error(r(160));Ac(o,s,a),Dc=null,Oc=!1;var l=a.alternate;l!==null&&(l.return=null),a.return=null}catch(e){Hl(a,t,e)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)Nc(t,e),t=t.sibling}function Nc(e,t){var n=e.alternate,i=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(Mc(t,e),Pc(e),i&4){try{yc(3,e,e.return),bc(3,e)}catch(t){Hl(e,e.return,t)}try{yc(5,e,e.return)}catch(t){Hl(e,e.return,t)}}break;case 1:Mc(t,e),Pc(e),i&512&&n!==null&&hc(n,n.return);break;case 5:if(Mc(t,e),Pc(e),i&512&&n!==null&&hc(n,n.return),e.flags&32){var a=e.stateNode;try{Se(a,``)}catch(t){Hl(e,e.return,t)}}if(i&4&&(a=e.stateNode,a!=null)){var o=e.memoizedProps,s=n===null?o:n.memoizedProps,c=e.type,l=e.updateQueue;if(e.updateQueue=null,l!==null)try{c===`input`&&o.type===`radio`&&o.name!=null&&ce(a,o),ke(c,s);var u=ke(c,o);for(s=0;s<l.length;s+=2){var d=l[s],f=l[s+1];d===`style`?Ee(a,f):d===`dangerouslySetInnerHTML`?xe(a,f):d===`children`?Se(a,f):S(a,d,f,u)}switch(c){case`input`:le(a,o);break;case`textarea`:ge(a,o);break;case`select`:var p=a._wrapperState.wasMultiple;a._wrapperState.wasMultiple=!!o.multiple;var m=o.value;m==null?p!==!!o.multiple&&(o.defaultValue==null?pe(a,!!o.multiple,o.multiple?[]:``,!1):pe(a,!!o.multiple,o.defaultValue,!0)):pe(a,!!o.multiple,m,!1)}a[Oi]=o}catch(t){Hl(e,e.return,t)}}break;case 6:if(Mc(t,e),Pc(e),i&4){if(e.stateNode===null)throw Error(r(162));a=e.stateNode,o=e.memoizedProps;try{a.nodeValue=o}catch(t){Hl(e,e.return,t)}}break;case 3:if(Mc(t,e),Pc(e),i&4&&n!==null&&n.memoizedState.isDehydrated)try{an(t.containerInfo)}catch(t){Hl(e,e.return,t)}break;case 4:Mc(t,e),Pc(e);break;case 13:Mc(t,e),Pc(e),a=e.child,a.flags&8192&&(o=a.memoizedState!==null,a.stateNode.isHidden=o,!o||a.alternate!==null&&a.alternate.memoizedState!==null||(rl=ct())),i&4&&jc(e);break;case 22:if(d=n!==null&&n.memoizedState!==null,e.mode&1?(pc=(u=pc)||d,Mc(t,e),pc=u):Mc(t,e),Pc(e),i&8192){if(u=e.memoizedState!==null,(e.stateNode.isHidden=u)&&!d&&e.mode&1)for(Y=e,d=e.child;d!==null;){for(f=Y=d;Y!==null;){switch(p=Y,m=p.child,p.tag){case 0:case 11:case 14:case 15:yc(4,p,p.return);break;case 1:hc(p,p.return);var h=p.stateNode;if(typeof h.componentWillUnmount==`function`){i=p,n=p.return;try{t=i,h.props=t.memoizedProps,h.state=t.memoizedState,h.componentWillUnmount()}catch(e){Hl(i,n,e)}}break;case 5:hc(p,p.return);break;case 22:if(p.memoizedState!==null){Rc(f);continue}}m===null?Rc(f):(m.return=p,Y=m)}d=d.sibling}a:for(d=null,f=e;;){if(f.tag===5){if(d===null){d=f;try{a=f.stateNode,u?(o=a.style,typeof o.setProperty==`function`?o.setProperty(`display`,`none`,`important`):o.display=`none`):(c=f.stateNode,l=f.memoizedProps.style,s=l!=null&&l.hasOwnProperty(`display`)?l.display:null,c.style.display=Te(`display`,s))}catch(t){Hl(e,e.return,t)}}}else if(f.tag===6){if(d===null)try{f.stateNode.nodeValue=u?``:f.memoizedProps}catch(t){Hl(e,e.return,t)}}else if((f.tag!==22&&f.tag!==23||f.memoizedState===null||f===e)&&f.child!==null){f.child.return=f,f=f.child;continue}if(f===e)break a;for(;f.sibling===null;){if(f.return===null||f.return===e)break a;d===f&&(d=null),f=f.return}d===f&&(d=null),f.sibling.return=f.return,f=f.sibling}}break;case 19:Mc(t,e),Pc(e),i&4&&jc(e);break;case 21:break;default:Mc(t,e),Pc(e)}}function Pc(e){var t=e.flags;if(t&2){try{a:{for(var n=e.return;n!==null;){if(Cc(n)){var i=n;break a}n=n.return}throw Error(r(160))}switch(i.tag){case 5:var a=i.stateNode;i.flags&32&&(Se(a,``),i.flags&=-33),Ec(e,wc(e),a);break;case 3:case 4:var o=i.stateNode.containerInfo;Tc(e,wc(e),o);break;default:throw Error(r(161))}}catch(t){Hl(e,e.return,t)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function Fc(e,t,n){Y=e,Ic(e,t,n)}function Ic(e,t,n){for(var r=(e.mode&1)!=0;Y!==null;){var i=Y,a=i.child;if(i.tag===22&&r){var o=i.memoizedState!==null||fc;if(!o){var s=i.alternate,c=s!==null&&s.memoizedState!==null||pc;s=fc;var l=pc;if(fc=o,(pc=c)&&!l)for(Y=i;Y!==null;)o=Y,c=o.child,o.tag===22&&o.memoizedState!==null||c===null?zc(i):(c.return=o,Y=c);for(;a!==null;)Y=a,Ic(a,t,n),a=a.sibling;Y=i,fc=s,pc=l}Lc(e,t,n)}else i.subtreeFlags&8772&&a!==null?(a.return=i,Y=a):Lc(e,t,n)}}function Lc(e){for(;Y!==null;){var t=Y;if(t.flags&8772){var n=t.alternate;try{if(t.flags&8772)switch(t.tag){case 0:case 11:case 15:pc||bc(5,t);break;case 1:var i=t.stateNode;if(t.flags&4&&!pc)if(n===null)i.componentDidMount();else{var a=t.elementType===t.type?n.memoizedProps:vs(t.type,n.memoizedProps);i.componentDidUpdate(a,n.memoizedState,i.__reactInternalSnapshotBeforeUpdate)}var o=t.updateQueue;o!==null&&ao(t,o,i);break;case 3:var s=t.updateQueue;if(s!==null){if(n=null,t.child!==null)switch(t.child.tag){case 5:n=t.child.stateNode;break;case 1:n=t.child.stateNode}ao(t,s,n)}break;case 5:var c=t.stateNode;if(n===null&&t.flags&4){n=c;var l=t.memoizedProps;switch(t.type){case`button`:case`input`:case`select`:case`textarea`:l.autoFocus&&n.focus();break;case`img`:l.src&&(n.src=l.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(t.memoizedState===null){var u=t.alternate;if(u!==null){var d=u.memoizedState;if(d!==null){var f=d.dehydrated;f!==null&&an(f)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(r(163))}pc||t.flags&512&&xc(t)}catch(e){Hl(t,t.return,e)}}if(t===e){Y=null;break}if(n=t.sibling,n!==null){n.return=t.return,Y=n;break}Y=t.return}}function Rc(e){for(;Y!==null;){var t=Y;if(t===e){Y=null;break}var n=t.sibling;if(n!==null){n.return=t.return,Y=n;break}Y=t.return}}function zc(e){for(;Y!==null;){var t=Y;try{switch(t.tag){case 0:case 11:case 15:var n=t.return;try{bc(4,t)}catch(e){Hl(t,n,e)}break;case 1:var r=t.stateNode;if(typeof r.componentDidMount==`function`){var i=t.return;try{r.componentDidMount()}catch(e){Hl(t,i,e)}}var a=t.return;try{xc(t)}catch(e){Hl(t,a,e)}break;case 5:var o=t.return;try{xc(t)}catch(e){Hl(t,o,e)}}}catch(e){Hl(t,t.return,e)}if(t===e){Y=null;break}var s=t.sibling;if(s!==null){s.return=t.return,Y=s;break}Y=t.return}}var Bc=Math.ceil,Vc=C.ReactCurrentDispatcher,Hc=C.ReactCurrentOwner,Uc=C.ReactCurrentBatchConfig,Wc=0,Gc=null,Kc=null,qc=0,Jc=0,Yc=zi(0),Xc=0,Zc=null,Qc=0,$c=0,el=0,tl=null,nl=null,rl=0,il=1/0,al=null,ol=!1,sl=null,cl=null,ll=!1,ul=null,dl=0,fl=0,pl=null,ml=-1,hl=0;function gl(){return Wc&6?ct():ml===-1?ml=ct():ml}function _l(e){return e.mode&1?Wc&2&&qc!==0?qc&-qc:ja.transition===null?(e=Pt,e===0?(e=window.event,e=e===void 0?16:pn(e.type),e):e):(hl===0&&(hl=kt()),hl):1}function vl(e,t,n,i){if(50<fl)throw fl=0,pl=null,Error(r(185));jt(e,n,i),(!(Wc&2)||e!==Gc)&&(e===Gc&&(!(Wc&2)&&($c|=n),Xc===4&&wl(e,qc)),yl(e,i),n===1&&Wc===0&&!(t.mode&1)&&(il=ct()+500,ea&&ia()))}function yl(e,t){var n=e.callbackNode;Dt(e,t);var r=Tt(e,e===Gc?qc:0);if(r===0)n!==null&&at(n),e.callbackNode=null,e.callbackPriority=0;else if(t=r&-r,e.callbackPriority!==t){if(n!=null&&at(n),t===1)e.tag===0?ra(Tl.bind(null,e)):na(Tl.bind(null,e)),xi(function(){!(Wc&6)&&ia()}),n=null;else{switch(Ft(r)){case 1:n=ut;break;case 4:n=dt;break;case 16:n=ft;break;case 536870912:n=mt;break;default:n=ft}n=Jl(n,bl.bind(null,e))}e.callbackPriority=t,e.callbackNode=n}}function bl(e,t){if(ml=-1,hl=0,Wc&6)throw Error(r(327));var n=e.callbackNode;if(Bl()&&e.callbackNode!==n)return null;var i=Tt(e,e===Gc?qc:0);if(i===0)return null;if(i&30||(i&e.expiredLanes)!==0||t)t=Nl(e,i);else{t=i;var a=Wc;Wc|=2;var o=jl();(Gc!==e||qc!==t)&&(al=null,il=ct()+500,kl(e,t));do try{Fl();break}catch(t){Al(e,t)}while(1);Ha(),Vc.current=o,Wc=a,Kc===null?(Gc=null,qc=0,t=Xc):t=0}if(t!==0){if(t===2&&(a=Ot(e),a!==0&&(i=a,t=xl(e,a))),t===1)throw n=Zc,kl(e,0),wl(e,i),yl(e,ct()),n;if(t===6)wl(e,i);else{if(a=e.current.alternate,!(i&30)&&!Cl(a)&&(t=Nl(e,i),t===2&&(o=Ot(e),o!==0&&(i=o,t=xl(e,o))),t===1))throw n=Zc,kl(e,0),wl(e,i),yl(e,ct()),n;switch(e.finishedWork=a,e.finishedLanes=i,t){case 0:case 1:throw Error(r(345));case 2:Rl(e,nl,al);break;case 3:if(wl(e,i),(i&130023424)===i&&(t=rl+500-ct(),10<t)){if(Tt(e,0)!==0)break;if(a=e.suspendedLanes,(a&i)!==i){gl(),e.pingedLanes|=e.suspendedLanes&a;break}e.timeoutHandle=vi(Rl.bind(null,e,nl,al),t);break}Rl(e,nl,al);break;case 4:if(wl(e,i),(i&4194240)===i)break;for(t=e.eventTimes,a=-1;0<i;){var s=31-vt(i);o=1<<s,s=t[s],s>a&&(a=s),i&=~o}if(i=a,i=ct()-i,i=(120>i?120:480>i?480:1080>i?1080:1920>i?1920:3e3>i?3e3:4320>i?4320:1960*Bc(i/1960))-i,10<i){e.timeoutHandle=vi(Rl.bind(null,e,nl,al),i);break}Rl(e,nl,al);break;case 5:Rl(e,nl,al);break;default:throw Error(r(329))}}}return yl(e,ct()),e.callbackNode===n?bl.bind(null,e):null}function xl(e,t){var n=tl;return e.current.memoizedState.isDehydrated&&(kl(e,t).flags|=256),e=Nl(e,t),e!==2&&(t=nl,nl=n,t!==null&&Sl(t)),e}function Sl(e){nl===null?nl=e:nl.push.apply(nl,e)}function Cl(e){for(var t=e;;){if(t.flags&16384){var n=t.updateQueue;if(n!==null&&(n=n.stores,n!==null))for(var r=0;r<n.length;r++){var i=n[r],a=i.getSnapshot;i=i.value;try{if(!Sr(a(),i))return!1}catch{return!1}}}if(n=t.child,t.subtreeFlags&16384&&n!==null)n.return=t,t=n;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function wl(e,t){for(t&=~el,t&=~$c,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var n=31-vt(t),r=1<<n;e[n]=-1,t&=~r}}function Tl(e){if(Wc&6)throw Error(r(327));Bl();var t=Tt(e,0);if(!(t&1))return yl(e,ct()),null;var n=Nl(e,t);if(e.tag!==0&&n===2){var i=Ot(e);i!==0&&(t=i,n=xl(e,i))}if(n===1)throw n=Zc,kl(e,0),wl(e,t),yl(e,ct()),n;if(n===6)throw Error(r(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,Rl(e,nl,al),yl(e,ct()),null}function El(e,t){var n=Wc;Wc|=1;try{return e(t)}finally{Wc=n,Wc===0&&(il=ct()+500,ea&&ia())}}function Dl(e){ul!==null&&ul.tag===0&&!(Wc&6)&&Bl();var t=Wc;Wc|=1;var n=Uc.transition,r=Pt;try{if(Uc.transition=null,Pt=1,e)return e()}finally{Pt=r,Uc.transition=n,Wc=t,!(Wc&6)&&ia()}}function Ol(){Jc=Yc.current,Bi(Yc)}function kl(e,t){e.finishedWork=null,e.finishedLanes=0;var n=e.timeoutHandle;if(n!==-1&&(e.timeoutHandle=-1,yi(n)),Kc!==null)for(n=Kc.return;n!==null;){var r=n;switch(_a(r),r.tag){case 1:r=r.type.childContextTypes,r!=null&&Ji();break;case 3:po(),Bi(Wi),Bi(Ui),yo();break;case 5:ho(r);break;case 4:po();break;case 13:Bi(go);break;case 19:Bi(go);break;case 10:Ua(r.type._context);break;case 22:case 23:Ol()}n=n.return}if(Gc=e,Kc=e=$l(e.current,null),qc=Jc=t,Xc=0,Zc=null,el=$c=Qc=0,nl=tl=null,qa!==null){for(t=0;t<qa.length;t++)if(n=qa[t],r=n.interleaved,r!==null){n.interleaved=null;var i=r.next,a=n.pending;if(a!==null){var o=a.next;a.next=i,r.next=o}n.pending=r}qa=null}return e}function Al(e,t){do{var n=Kc;try{if(Ha(),bo.current=ms,Eo){for(var i=Co.memoizedState;i!==null;){var a=i.queue;a!==null&&(a.pending=null),i=i.next}Eo=!1}if(So=0,To=wo=Co=null,Do=!1,Oo=0,Hc.current=null,n===null||n.return===null){Xc=1,Zc=t,Kc=null;break}a:{var o=e,s=n.return,c=n,l=t;if(t=qc,c.flags|=32768,typeof l==`object`&&l&&typeof l.then==`function`){var u=l,d=c,f=d.tag;if(!(d.mode&1)&&(f===0||f===11||f===15)){var p=d.alternate;p?(d.updateQueue=p.updateQueue,d.memoizedState=p.memoizedState,d.lanes=p.lanes):(d.updateQueue=null,d.memoizedState=null)}var m=Ms(s);if(m!==null){m.flags&=-257,Ns(m,s,c,o,t),m.mode&1&&js(o,u,t),t=m,l=u;var h=t.updateQueue;if(h===null){var g=new Set;g.add(l),t.updateQueue=g}else h.add(l);break a}else{if(!(t&1)){js(o,u,t),Ml();break a}l=Error(r(426))}}else if(ba&&c.mode&1){var _=Ms(s);if(_!==null){!(_.flags&65536)&&(_.flags|=256),Ns(_,s,c,o,t),Aa(Ts(l,c));break a}}o=l=Ts(l,c),Xc!==4&&(Xc=2),tl===null?tl=[o]:tl.push(o),o=s;do{switch(o.tag){case 3:o.flags|=65536,t&=-t,o.lanes|=t;var v=ks(o,l,t);ro(o,v);break a;case 1:c=l;var y=o.type,b=o.stateNode;if(!(o.flags&128)&&(typeof y.getDerivedStateFromError==`function`||b!==null&&typeof b.componentDidCatch==`function`&&(cl===null||!cl.has(b)))){o.flags|=65536,t&=-t,o.lanes|=t;var x=As(o,c,t);ro(o,x);break a}}o=o.return}while(o!==null)}Ll(n)}catch(e){t=e,Kc===n&&n!==null&&(Kc=n=n.return);continue}break}while(1)}function jl(){var e=Vc.current;return Vc.current=ms,e===null?ms:e}function Ml(){(Xc===0||Xc===3||Xc===2)&&(Xc=4),Gc===null||!(Qc&268435455)&&!($c&268435455)||wl(Gc,qc)}function Nl(e,t){var n=Wc;Wc|=2;var i=jl();(Gc!==e||qc!==t)&&(al=null,kl(e,t));do try{Pl();break}catch(t){Al(e,t)}while(1);if(Ha(),Wc=n,Vc.current=i,Kc!==null)throw Error(r(261));return Gc=null,qc=0,Xc}function Pl(){for(;Kc!==null;)Il(Kc)}function Fl(){for(;Kc!==null&&!ot();)Il(Kc)}function Il(e){var t=ql(e.alternate,e,Jc);e.memoizedProps=e.pendingProps,t===null?Ll(e):Kc=t,Hc.current=null}function Ll(e){var t=e;do{var n=t.alternate;if(e=t.return,t.flags&32768){if(n=dc(n,t),n!==null){n.flags&=32767,Kc=n;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{Xc=6,Kc=null;return}}else if(n=uc(n,t,Jc),n!==null){Kc=n;return}if(t=t.sibling,t!==null){Kc=t;return}Kc=t=e}while(t!==null);Xc===0&&(Xc=5)}function Rl(e,t,n){var r=Pt,i=Uc.transition;try{Uc.transition=null,Pt=1,zl(e,t,n,r)}finally{Uc.transition=i,Pt=r}return null}function zl(e,t,n,i){do Bl();while(ul!==null);if(Wc&6)throw Error(r(327));n=e.finishedWork;var a=e.finishedLanes;if(n===null)return null;if(e.finishedWork=null,e.finishedLanes=0,n===e.current)throw Error(r(177));e.callbackNode=null,e.callbackPriority=0;var o=n.lanes|n.childLanes;if(Mt(e,o),e===Gc&&(Kc=Gc=null,qc=0),!(n.subtreeFlags&2064)&&!(n.flags&2064)||ll||(ll=!0,Jl(ft,function(){return Bl(),null})),o=(n.flags&15990)!=0,n.subtreeFlags&15990||o){o=Uc.transition,Uc.transition=null;var s=Pt;Pt=1;var c=Wc;Wc|=4,Hc.current=null,vc(e,n),Nc(n,e),kr(gi),sn=!!hi,gi=hi=null,e.current=n,Fc(n,e,a),st(),Wc=c,Pt=s,Uc.transition=o}else e.current=n;if(ll&&(ll=!1,ul=e,dl=a),o=e.pendingLanes,o===0&&(cl=null),_t(n.stateNode,i),yl(e,ct()),t!==null)for(i=e.onRecoverableError,n=0;n<t.length;n++)a=t[n],i(a.value,{componentStack:a.stack,digest:a.digest});if(ol)throw ol=!1,e=sl,sl=null,e;return dl&1&&e.tag!==0&&Bl(),o=e.pendingLanes,o&1?e===pl?fl++:(fl=0,pl=e):fl=0,ia(),null}function Bl(){if(ul!==null){var e=Ft(dl),t=Uc.transition,n=Pt;try{if(Uc.transition=null,Pt=16>e?16:e,ul===null)var i=!1;else{if(e=ul,ul=null,dl=0,Wc&6)throw Error(r(331));var a=Wc;for(Wc|=4,Y=e.current;Y!==null;){var o=Y,s=o.child;if(Y.flags&16){var c=o.deletions;if(c!==null){for(var l=0;l<c.length;l++){var u=c[l];for(Y=u;Y!==null;){var d=Y;switch(d.tag){case 0:case 11:case 15:yc(8,d,o)}var f=d.child;if(f!==null)f.return=d,Y=f;else for(;Y!==null;){d=Y;var p=d.sibling,m=d.return;if(Sc(d),d===u){Y=null;break}if(p!==null){p.return=m,Y=p;break}Y=m}}}var h=o.alternate;if(h!==null){var g=h.child;if(g!==null){h.child=null;do{var _=g.sibling;g.sibling=null,g=_}while(g!==null)}}Y=o}}if(o.subtreeFlags&2064&&s!==null)s.return=o,Y=s;else b:for(;Y!==null;){if(o=Y,o.flags&2048)switch(o.tag){case 0:case 11:case 15:yc(9,o,o.return)}var v=o.sibling;if(v!==null){v.return=o.return,Y=v;break b}Y=o.return}}var y=e.current;for(Y=y;Y!==null;){s=Y;var b=s.child;if(s.subtreeFlags&2064&&b!==null)b.return=s,Y=b;else b:for(s=y;Y!==null;){if(c=Y,c.flags&2048)try{switch(c.tag){case 0:case 11:case 15:bc(9,c)}}catch(e){Hl(c,c.return,e)}if(c===s){Y=null;break b}var x=c.sibling;if(x!==null){x.return=c.return,Y=x;break b}Y=c.return}}if(Wc=a,ia(),gt&&typeof gt.onPostCommitFiberRoot==`function`)try{gt.onPostCommitFiberRoot(ht,e)}catch{}i=!0}return i}finally{Pt=n,Uc.transition=t}}return!1}function Vl(e,t,n){t=Ts(n,t),t=ks(e,t,1),e=to(e,t,1),t=gl(),e!==null&&(jt(e,1,t),yl(e,t))}function Hl(e,t,n){if(e.tag===3)Vl(e,e,n);else for(;t!==null;){if(t.tag===3){Vl(t,e,n);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError==`function`||typeof r.componentDidCatch==`function`&&(cl===null||!cl.has(r))){e=Ts(n,e),e=As(t,e,1),t=to(t,e,1),e=gl(),t!==null&&(jt(t,1,e),yl(t,e));break}}t=t.return}}function Ul(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),t=gl(),e.pingedLanes|=e.suspendedLanes&n,Gc===e&&(qc&n)===n&&(Xc===4||Xc===3&&(qc&130023424)===qc&&500>ct()-rl?kl(e,0):el|=n),yl(e,t)}function Wl(e,t){t===0&&(e.mode&1?(t=Ct,Ct<<=1,!(Ct&130023424)&&(Ct=4194304)):t=1);var n=gl();e=Xa(e,t),e!==null&&(jt(e,t,n),yl(e,n))}function Gl(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),Wl(e,n)}function Kl(e,t){var n=0;switch(e.tag){case 13:var i=e.stateNode,a=e.memoizedState;a!==null&&(n=a.retryLane);break;case 19:i=e.stateNode;break;default:throw Error(r(314))}i!==null&&i.delete(t),Wl(e,n)}var ql=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||Wi.current)Fs=!0;else{if((e.lanes&n)===0&&!(t.flags&128))return Fs=!1,ic(e,t,n);Fs=!!(e.flags&131072)}else Fs=!1,ba&&t.flags&1048576&&ha(t,ca,t.index);switch(t.lanes=0,t.tag){case 2:var i=t.type;nc(e,t),e=t.pendingProps;var a=Ki(t,Ui.current);Ga(t,n),a=Mo(null,t,i,e,a,n);var o=No();return t.flags|=1,typeof a==`object`&&a&&typeof a.render==`function`&&a.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,qi(i)?(o=!0,Zi(t)):o=!1,t.memoizedState=a.state!==null&&a.state!==void 0?a.state:null,Qa(t),a.updater=bs,t.stateNode=a,a._reactInternals=t,ws(t,i,e,n),t=Ws(null,t,i,!0,o,n)):(t.tag=0,ba&&o&&ga(t),Is(null,t,a,n),t=t.child),t;case 16:i=t.elementType;a:{switch(nc(e,t),e=t.pendingProps,a=i._init,i=a(i._payload),t.type=i,a=t.tag=Ql(i),e=vs(i,e),a){case 0:t=Hs(null,t,i,e,n);break a;case 1:t=Us(null,t,i,e,n);break a;case 11:t=Ls(null,t,i,e,n);break a;case 14:t=Rs(null,t,i,vs(i.type,e),n);break a}throw Error(r(306,i,``))}return t;case 0:return i=t.type,a=t.pendingProps,a=t.elementType===i?a:vs(i,a),Hs(e,t,i,a,n);case 1:return i=t.type,a=t.pendingProps,a=t.elementType===i?a:vs(i,a),Us(e,t,i,a,n);case 3:a:{if(Gs(t),e===null)throw Error(r(387));i=t.pendingProps,o=t.memoizedState,a=o.element,$a(e,t),io(t,i,null,n);var s=t.memoizedState;if(i=s.element,o.isDehydrated)if(o={element:i,isDehydrated:!1,cache:s.cache,pendingSuspenseBoundaries:s.pendingSuspenseBoundaries,transitions:s.transitions},t.updateQueue.baseState=o,t.memoizedState=o,t.flags&256){a=Ts(Error(r(423)),t),t=Ks(e,t,i,n,a);break a}else if(i!==a){a=Ts(Error(r(424)),t),t=Ks(e,t,i,n,a);break a}else for(ya=wi(t.stateNode.containerInfo.firstChild),va=t,ba=!0,xa=null,n=La(t,null,i,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(ka(),i===a){t=rc(e,t,n);break a}Is(e,t,i,n)}t=t.child}return t;case 5:return mo(t),e===null&&Ta(t),i=t.type,a=t.pendingProps,o=e===null?null:e.memoizedProps,s=a.children,_i(i,a)?s=null:o!==null&&_i(i,o)&&(t.flags|=32),Vs(e,t),Is(e,t,s,n),t.child;case 6:return e===null&&Ta(t),null;case 13:return Ys(e,t,n);case 4:return fo(t,t.stateNode.containerInfo),i=t.pendingProps,e===null?t.child=Ia(t,null,i,n):Is(e,t,i,n),t.child;case 11:return i=t.type,a=t.pendingProps,a=t.elementType===i?a:vs(i,a),Ls(e,t,i,a,n);case 7:return Is(e,t,t.pendingProps,n),t.child;case 8:return Is(e,t,t.pendingProps.children,n),t.child;case 12:return Is(e,t,t.pendingProps.children,n),t.child;case 10:a:{if(i=t.type._context,a=t.pendingProps,o=t.memoizedProps,s=a.value,Vi(Ra,i._currentValue),i._currentValue=s,o!==null)if(Sr(o.value,s)){if(o.children===a.children&&!Wi.current){t=rc(e,t,n);break a}}else for(o=t.child,o!==null&&(o.return=t);o!==null;){var c=o.dependencies;if(c!==null){s=o.child;for(var l=c.firstContext;l!==null;){if(l.context===i){if(o.tag===1){l=eo(-1,n&-n),l.tag=2;var u=o.updateQueue;if(u!==null){u=u.shared;var d=u.pending;d===null?l.next=l:(l.next=d.next,d.next=l),u.pending=l}}o.lanes|=n,l=o.alternate,l!==null&&(l.lanes|=n),Wa(o.return,n,t),c.lanes|=n;break}l=l.next}}else if(o.tag===10)s=o.type===t.type?null:o.child;else if(o.tag===18){if(s=o.return,s===null)throw Error(r(341));s.lanes|=n,c=s.alternate,c!==null&&(c.lanes|=n),Wa(s,n,t),s=o.sibling}else s=o.child;if(s!==null)s.return=o;else for(s=o;s!==null;){if(s===t){s=null;break}if(o=s.sibling,o!==null){o.return=s.return,s=o;break}s=s.return}o=s}Is(e,t,a.children,n),t=t.child}return t;case 9:return a=t.type,i=t.pendingProps.children,Ga(t,n),a=Ka(a),i=i(a),t.flags|=1,Is(e,t,i,n),t.child;case 14:return i=t.type,a=vs(i,t.pendingProps),a=vs(i.type,a),Rs(e,t,i,a,n);case 15:return zs(e,t,t.type,t.pendingProps,n);case 17:return i=t.type,a=t.pendingProps,a=t.elementType===i?a:vs(i,a),nc(e,t),t.tag=1,qi(i)?(e=!0,Zi(t)):e=!1,Ga(t,n),Ss(t,i,a),ws(t,i,a,n),Ws(null,t,i,!0,e,n);case 19:return tc(e,t,n);case 22:return Bs(e,t,n)}throw Error(r(156,t.tag))};function Jl(e,t){return it(e,t)}function Yl(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Xl(e,t,n,r){return new Yl(e,t,n,r)}function Zl(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Ql(e){if(typeof e==`function`)return+!!Zl(e);if(e!=null){if(e=e.$$typeof,e===j)return 11;if(e===P)return 14}return 2}function $l(e,t){var n=e.alternate;return n===null?(n=Xl(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&14680064,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function eu(e,t,n,i,a,o){var s=2;if(i=e,typeof e==`function`)Zl(e)&&(s=1);else if(typeof e==`string`)s=5;else a:switch(e){case E:return tu(n.children,a,o,t);case D:s=8,a|=8;break;case O:return e=Xl(12,n,t,a|2),e.elementType=O,e.lanes=o,e;case M:return e=Xl(13,n,t,a),e.elementType=M,e.lanes=o,e;case N:return e=Xl(19,n,t,a),e.elementType=N,e.lanes=o,e;case I:return nu(n,a,o,t);default:if(typeof e==`object`&&e)switch(e.$$typeof){case k:s=10;break a;case A:s=9;break a;case j:s=11;break a;case P:s=14;break a;case F:s=16,i=null;break a}throw Error(r(130,e==null?e:typeof e,``))}return t=Xl(s,n,t,a),t.elementType=e,t.type=i,t.lanes=o,t}function tu(e,t,n,r){return e=Xl(7,e,r,t),e.lanes=n,e}function nu(e,t,n,r){return e=Xl(22,e,r,t),e.elementType=I,e.lanes=n,e.stateNode={isHidden:!1},e}function ru(e,t,n){return e=Xl(6,e,null,t),e.lanes=n,e}function iu(e,t,n){return t=Xl(4,e.children===null?[]:e.children,e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function au(e,t,n,r,i){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=At(0),this.expirationTimes=At(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=At(0),this.identifierPrefix=r,this.onRecoverableError=i,this.mutableSourceEagerHydrationData=null}function ou(e,t,n,r,i,a,o,s,c){return e=new au(e,t,n,s,c),t===1?(t=1,!0===a&&(t|=8)):t=0,a=Xl(3,null,null,t),e.current=a,a.stateNode=e,a.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},Qa(a),e}function su(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:T,key:r==null?null:``+r,children:e,containerInfo:t,implementation:n}}function cu(e){if(!e)return Hi;e=e._reactInternals;a:{if(Qe(e)!==e||e.tag!==1)throw Error(r(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break a;case 1:if(qi(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break a}}t=t.return}while(t!==null);throw Error(r(171))}if(e.tag===1){var n=e.type;if(qi(n))return Xi(e,n,t)}return t}function lu(e,t,n,r,i,a,o,s,c){return e=ou(n,r,!0,e,i,a,o,s,c),e.context=cu(null),n=e.current,r=gl(),i=_l(n),a=eo(r,i),a.callback=t??null,to(n,a,i),e.current.lanes=i,jt(e,i,r),yl(e,r),e}function uu(e,t,n,r){var i=t.current,a=gl(),o=_l(i);return n=cu(n),t.context===null?t.context=n:t.pendingContext=n,t=eo(a,o),t.payload={element:e},r=r===void 0?null:r,r!==null&&(t.callback=r),e=to(i,t,o),e!==null&&(vl(e,i,o,a),no(e,i,o)),o}function du(e){if(e=e.current,!e.child)return null;switch(e.child.tag){case 5:return e.child.stateNode;default:return e.child.stateNode}}function fu(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function pu(e,t){fu(e,t),(e=e.alternate)&&fu(e,t)}function mu(){return null}var hu=typeof reportError==`function`?reportError:function(e){console.error(e)};function gu(e){this._internalRoot=e}_u.prototype.render=gu.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(r(409));uu(e,t,null,null)},_u.prototype.unmount=gu.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;Dl(function(){uu(null,e,null,null)}),t[ki]=null}};function _u(e){this._internalRoot=e}_u.prototype.unstable_scheduleHydration=function(e){if(e){var t=zt();e={blockedOn:null,target:e,priority:t};for(var n=0;n<Jt.length&&t!==0&&t<Jt[n].priority;n++);Jt.splice(n,0,e),n===0&&$t(e)}};function vu(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function yu(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==` react-mount-point-unstable `))}function bu(){}function xu(e,t,n,r,i){if(i){if(typeof r==`function`){var a=r;r=function(){var e=du(o);a.call(e)}}var o=lu(t,r,e,0,null,!1,!1,``,bu);return e._reactRootContainer=o,e[ki]=o.current,ri(e.nodeType===8?e.parentNode:e),Dl(),o}for(;i=e.lastChild;)e.removeChild(i);if(typeof r==`function`){var s=r;r=function(){var e=du(c);s.call(e)}}var c=ou(e,0,!1,null,null,!1,!1,``,bu);return e._reactRootContainer=c,e[ki]=c.current,ri(e.nodeType===8?e.parentNode:e),Dl(function(){uu(t,c,n,r)}),c}function Su(e,t,n,r,i){var a=n._reactRootContainer;if(a){var o=a;if(typeof i==`function`){var s=i;i=function(){var e=du(o);s.call(e)}}uu(t,o,e,i)}else o=xu(n,t,e,i,r);return du(o)}It=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var n=wt(t.pendingLanes);n!==0&&(Nt(t,n|1),yl(t,ct()),!(Wc&6)&&(il=ct()+500,ia()))}break;case 13:Dl(function(){var t=Xa(e,1);t!==null&&vl(t,e,1,gl())}),pu(e,1)}},Lt=function(e){if(e.tag===13){var t=Xa(e,134217728);t!==null&&vl(t,e,134217728,gl()),pu(e,134217728)}},Rt=function(e){if(e.tag===13){var t=_l(e),n=Xa(e,t);n!==null&&vl(n,e,t,gl()),pu(e,t)}},zt=function(){return Pt},Bt=function(e,t){var n=Pt;try{return Pt=e,t()}finally{Pt=n}},Me=function(e,t,n){switch(t){case`input`:if(le(e,n),t=n.name,n.type===`radio`&&t!=null){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll(`input[name=`+JSON.stringify(``+t)+`][type="radio"]`),t=0;t<n.length;t++){var i=n[t];if(i!==e&&i.form===e.form){var a=Ii(i);if(!a)throw Error(r(90));ie(i),le(i,a)}}}break;case`textarea`:ge(e,n);break;case`select`:t=n.value,t!=null&&pe(e,!!n.multiple,t,!1)}},Re=El,ze=Dl;var Cu={usingClientEntryPoint:!1,Events:[Pi,Fi,Ii,Ie,Le,El]},wu={findFiberByHostInstance:Ni,bundleType:0,version:`18.3.1`,rendererPackageName:`react-dom`},Tu={bundleType:wu.bundleType,version:wu.version,rendererPackageName:wu.rendererPackageName,rendererConfig:wu.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:C.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=nt(e),e===null?null:e.stateNode},findFiberByHostInstance:wu.findFiberByHostInstance||mu,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:`18.3.1-next-f1338f8080-20240426`};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`){var Eu=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Eu.isDisabled&&Eu.supportsFiber)try{ht=Eu.inject(Tu),gt=Eu}catch{}}e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=Cu,e.createPortal=function(e,t){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!vu(t))throw Error(r(200));return su(e,t,null,n)},e.createRoot=function(e,t){if(!vu(e))throw Error(r(299));var n=!1,i=``,a=hu;return t!=null&&(!0===t.unstable_strictMode&&(n=!0),t.identifierPrefix!==void 0&&(i=t.identifierPrefix),t.onRecoverableError!==void 0&&(a=t.onRecoverableError)),t=ou(e,1,!1,null,null,n,!1,i,a),e[ki]=t.current,ri(e.nodeType===8?e.parentNode:e),new gu(t)},e.findDOMNode=function(e){if(e==null)return null;if(e.nodeType===1)return e;var t=e._reactInternals;if(t===void 0)throw typeof e.render==`function`?Error(r(188)):(e=Object.keys(e).join(`,`),Error(r(268,e)));return e=nt(t),e=e===null?null:e.stateNode,e},e.flushSync=function(e){return Dl(e)},e.hydrate=function(e,t,n){if(!yu(t))throw Error(r(200));return Su(null,e,t,!0,n)},e.hydrateRoot=function(e,t,n){if(!vu(e))throw Error(r(405));var i=n!=null&&n.hydratedSources||null,a=!1,o=``,s=hu;if(n!=null&&(!0===n.unstable_strictMode&&(a=!0),n.identifierPrefix!==void 0&&(o=n.identifierPrefix),n.onRecoverableError!==void 0&&(s=n.onRecoverableError)),t=lu(t,null,e,1,n??null,a,!1,o,s),e[ki]=t.current,ri(e),i)for(e=0;e<i.length;e++)n=i[e],a=n._getVersion,a=a(n._source),t.mutableSourceEagerHydrationData==null?t.mutableSourceEagerHydrationData=[n,a]:t.mutableSourceEagerHydrationData.push(n,a);return new _u(t)},e.render=function(e,t,n){if(!yu(t))throw Error(r(200));return Su(null,e,t,!1,n)},e.unmountComponentAtNode=function(e){if(!yu(e))throw Error(r(40));return e._reactRootContainer?(Dl(function(){Su(null,null,e,!1,function(){e._reactRootContainer=null,e[ki]=null})}),!0):!1},e.unstable_batchedUpdates=El,e.unstable_renderSubtreeIntoContainer=function(e,t,n,i){if(!yu(n))throw Error(r(200));if(e==null||e._reactInternals===void 0)throw Error(r(38));return Su(e,t,n,!1,i)},e.version=`18.3.1-next-f1338f8080-20240426`})),_=s(((e,t)=>{function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>`u`||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!=`function`))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}n(),t.exports=g()})),v=s((e=>{var t=_();e.createRoot=t.createRoot,e.hydrateRoot=t.hydrateRoot})),y=e=>{let t,n=new Set,r=(e,r)=>{let i=typeof e==`function`?e(t):e;if(!Object.is(i,t)){let e=t;t=r??(typeof i!=`object`||!i)?i:Object.assign({},t,i),n.forEach(n=>n(t,e))}},i=()=>t,a={setState:r,getState:i,getInitialState:()=>o,subscribe:e=>(n.add(e),()=>n.delete(e))},o=t=e(r,i,a);return a},b=(e=>e?y(e):y),x=u(p(),1),S=e=>e;function C(e,t=S){let n=x.useSyncExternalStore(e.subscribe,x.useCallback(()=>t(e.getState()),[e,t]),x.useCallback(()=>t(e.getInitialState()),[e,t]));return x.useDebugValue(n),n}var w=e=>{let t=b(e),n=e=>C(t,e);return Object.assign(n,t),n},T=(e=>e?w(e):w),E=v();function D(e,t){let n;try{n=e()}catch{return}return{getItem:e=>{let r=e=>e===null?null:JSON.parse(e,t?.reviver),i=n.getItem(e)??null;return i instanceof Promise?i.then(r):r(i)},setItem:(e,r)=>n.setItem(e,JSON.stringify(r,t?.replacer)),removeItem:e=>n.removeItem(e)}}var O=e=>t=>{try{let n=e(t);return n instanceof Promise?n:{then(e){return O(e)(n)},catch(e){return this}}}catch(e){return{then(e){return this},catch(t){return O(t)(e)}}}},k=(e,t)=>(n,r,i)=>{let a={storage:D(()=>localStorage),partialize:e=>e,version:0,merge:(e,t)=>({...t,...e}),...t},o=!1,s=new Set,c=new Set,l=a.storage;if(!l)return e((...e)=>{console.warn(`[zustand persist middleware] Unable to update item '${a.name}', the given storage is currently unavailable.`),n(...e)},r,i);let u=()=>{let e=a.partialize({...r()});return l.setItem(a.name,{state:e,version:a.version})},d=i.setState;i.setState=(e,t)=>(d(e,t),u());let f=e((...e)=>(n(...e),u()),r,i);i.getInitialState=()=>f;let p,m=()=>{if(!l)return;o=!1,s.forEach(e=>e(r()??f));let e=a.onRehydrateStorage?.call(a,r()??f)||void 0;return O(l.getItem.bind(l))(a.name).then(e=>{if(e)if(typeof e.version==`number`&&e.version!==a.version){if(a.migrate){let t=a.migrate(e.state,e.version);return t instanceof Promise?t.then(e=>[!0,e]):[!0,t]}console.error(`State loaded from storage couldn't be migrated since no migrate function was provided`)}else return[!1,e.state];return[!1,void 0]}).then(e=>{let[t,i]=e;if(p=a.merge(i,r()??f),n(p,!0),t)return u()}).then(()=>{e?.(p,void 0),p=r(),o=!0,c.forEach(e=>e(p))}).catch(t=>{e?.(void 0,t)})};return i.persist={setOptions:e=>{a={...a,...e},e.storage&&(l=e.storage)},clearStorage:()=>{l?.removeItem(a.name)},getOptions:()=>a,rehydrate:()=>m(),hasHydrated:()=>o,onHydrate:e=>(s.add(e),()=>{s.delete(e)}),onFinishHydration:e=>(c.add(e),()=>{c.delete(e)})},a.skipHydration||m(),p||f};function A(){let e=new Map;return{getItem:t=>e.get(t)??null,setItem:(t,n)=>{e.set(t,n)},removeItem:t=>{e.delete(t)}}}var j=A(),M={getItem:e=>{if(typeof localStorage>`u`)return j.getItem(e);try{return localStorage.getItem(e)}catch{return j.getItem(e)}},setItem:(e,t)=>{if(typeof localStorage>`u`){j.setItem(e,t);return}try{localStorage.setItem(e,t)}catch{j.setItem(e,t)}},removeItem:e=>{if(typeof localStorage>`u`){j.removeItem(e);return}try{localStorage.removeItem(e)}catch{j.removeItem(e)}}};function N(e){let t=new Map,n=!1,r=t=>{let n={BASE_URL:`/`,DEV:!1,MODE:`production`,PROD:!0,SSR:!1},r=globalThis.Bun?.main??``,i=/\.test\.[cm]?[jt]sx?$/.test(r);if((typeof n?.DEV==`boolean`?n.DEV:i)&&t!==e)throw Error(`createTabStorage("${e}") received unexpected key "${t}". Create a dedicated tab storage instance per persist key.`)};return{getItem(e){if(r(e),n)return t.get(e)??null;n=!0;let i=M.getItem(e);return i!==null&&t.set(e,i),i},setItem(e,n){r(e),t.set(e,n),M.setItem(e,n)},removeItem(e){r(e),t.delete(e),M.removeItem(e)}}}var P=`~/Documents/GitHub`,F=`claude`,I=!(typeof navigator<`u`&&/^((?!chrome|android).)*safari/i.test(navigator.userAgent)&&!/iPhone|iPad|iPod/.test(navigator.userAgent)&&(typeof devicePixelRatio<`u`?devicePixelRatio:1)>1),L=[{id:`jetbrains-mono`,label:`JetBrains Mono`,family:`"JetBrains Mono Variable", "JetBrains Mono", "SF Mono", "Fira Code", ui-monospace, monospace`},{id:`system`,label:`System Default`,family:`ui-monospace, "SF Mono", Menlo, Monaco, "Cascadia Code", "Consolas", monospace`},{id:`custom`,label:`Custom`,family:``}];function R(e,t){return e===`custom`&&t.trim()?t.trim():L.find(t=>t.id===e)?.family||L[0].family}var z=[{id:`claude`,label:`Claude`,command:`claude`,isBuiltIn:!0,agentType:`claude`},{id:`codex`,label:`Codex`,command:`codex`,isBuiltIn:!0,agentType:`codex`},{id:`pi`,label:`Pi`,command:`pi`,isBuiltIn:!0,agentType:`pi`}];function B(e){if(typeof e!=`object`||!e)return!1;let t=e;return typeof t.id==`string`&&t.id.length>=1&&t.id.length<=128&&typeof t.label==`string`&&t.label.trim().length>=1&&t.label.length<=64&&typeof t.command==`string`&&t.command.trim().length>=1&&t.command.length<=1024&&typeof t.isBuiltIn==`boolean`&&(t.agentType===void 0||t.agentType===`claude`||t.agentType===`codex`||t.agentType===`pi`)}function V(e){return{...e,label:e.label.trim().slice(0,64),command:e.command.trim().slice(0,1024)}}function H(e){return e.command.trim()}function U(e){for(let t=0;t<100;t++){let t=`custom-${Date.now()}-${Math.random().toString(36).slice(2,6)}`;if(!e.has(t))return t}return`custom-${Date.now()}-${Math.random().toString(36).slice(2)}`}function W(e,t){return e.some(e=>e.id===t)?t:e[0]?.id||`claude`}var G=T()(k((e,t)=>({defaultProjectDir:P,setDefaultProjectDir:t=>e({defaultProjectDir:t}),defaultCommand:F,setDefaultCommand:t=>e({defaultCommand:t}),lastProjectPath:null,setLastProjectPath:t=>e({lastProjectPath:t}),recentPaths:[],addRecentPath:t=>e(e=>({recentPaths:[t,...e.recentPaths.filter(e=>e!==t)].slice(0,5)})),sessionSortMode:`created`,setSessionSortMode:t=>e({sessionSortMode:t}),sessionSortDirection:`desc`,setSessionSortDirection:t=>e({sessionSortDirection:t}),manualSessionOrder:[],setManualSessionOrder:t=>e({manualSessionOrder:t}),useWebGL:I,setUseWebGL:t=>e({useWebGL:t}),fontSize:13,setFontSize:t=>e({fontSize:Math.max(6,Math.min(24,t))}),lineHeight:1,setLineHeight:t=>e({lineHeight:Math.max(1,Math.min(2,t))}),letterSpacing:0,setLetterSpacing:t=>e({letterSpacing:Math.max(-3,Math.min(3,t))}),fontOption:`jetbrains-mono`,setFontOption:t=>e({fontOption:t}),customFontFamily:``,setCustomFontFamily:t=>e({customFontFamily:t.slice(0,256)}),shortcutModifier:`auto`,setShortcutModifier:t=>e({shortcutModifier:t}),showProjectName:!0,setShowProjectName:t=>e({showProjectName:t}),showLastUserMessage:!0,setShowLastUserMessage:t=>e({showLastUserMessage:t}),showSessionIdPrefix:!1,setShowSessionIdPrefix:t=>e({showSessionIdPrefix:t}),historySessionsExpanded:!1,setHistorySessionsExpanded:t=>e({historySessionsExpanded:t}),hibernatingSessionsExpanded:!0,setHibernatingSessionsExpanded:t=>e({hibernatingSessionsExpanded:t}),sidebarWidth:240,setSidebarWidth:t=>e({sidebarWidth:Math.max(180,Math.min(400,t))}),projectFilters:[],setProjectFilters:t=>e({projectFilters:t}),hostFilters:[],setHostFilters:t=>e({hostFilters:t}),soundOnPermission:!1,setSoundOnPermission:t=>e({soundOnPermission:t}),soundOnIdle:!1,setSoundOnIdle:t=>e({soundOnIdle:t}),commandPresets:z,setCommandPresets:t=>e({commandPresets:t}),defaultPresetId:`claude`,setDefaultPresetId:t=>e({defaultPresetId:t}),updatePresetCommand:(n,r)=>{let{commandPresets:i}=t();e({commandPresets:i.map(e=>e.id===n?{...e,command:r.trim().slice(0,1024)}:e)})},addPreset:n=>{let{commandPresets:r}=t();if(r.length>=50){console.warn(`[agentboard:settings] Max presets reached`);return}let i=new Set(r.map(e=>e.id)),a={...V({...n,id:``,isBuiltIn:!1}),id:U(i),isBuiltIn:!1};e({commandPresets:[...r,a]})},removePreset:n=>{let{commandPresets:r,defaultPresetId:i}=t(),a=r.find(e=>e.id===n);if(!a||a.isBuiltIn)return;let o=r.filter(e=>e.id!==n);e({commandPresets:o,defaultPresetId:n===i?W(o,i):i})}}),{name:`agentboard-settings`,storage:D(()=>M),version:6,migrate:(e,t)=>{let n=e;typeof n.historySessionsExpanded!=`boolean`&&typeof n.inactiveSessionsExpanded==`boolean`&&(n.historySessionsExpanded=n.inactiveSessionsExpanded),typeof n.hibernatingSessionsExpanded!=`boolean`&&typeof n.snoozedSessionsExpanded==`boolean`&&(n.hibernatingSessionsExpanded=n.snoozedSessionsExpanded);let r=e=>{if(typeof e.command==`string`)return e;let t=typeof e.baseCommand==`string`?e.baseCommand.trim():``,n=typeof e.modifiers==`string`?e.modifiers.trim():``,r=n?`${t} ${n}`:t;return{id:e.id,label:e.label,command:r||`claude`,isBuiltIn:e.isBuiltIn,agentType:e.agentType}};if(t===0||!Array.isArray(n.commandPresets)){let e=typeof n.defaultCommand==`string`?n.defaultCommand:`claude`,t=[...z],r=`claude`;if(e===`codex`)r=`codex`;else if(e!==`claude`){let n={id:U(new Set(t.map(e=>e.id))),label:`Migrated`,command:e,isBuiltIn:!1};t.push(n),r=n.id}return console.info(`[agentboard:settings] Migrated from v0 to v2`),{...n,commandPresets:t,defaultPresetId:r,defaultCommand:e,recentPaths:[]}}let i=n.commandPresets.map(r).filter(B);if(!(i.some(e=>e.id===`claude`)&&i.some(e=>e.id===`codex`))||i.length===0)return console.warn(`[agentboard:settings] Invalid presets, resetting to defaults`),{...n,commandPresets:z,defaultPresetId:`claude`};let a=i.length>50?[...i.filter(e=>e.isBuiltIn),...i.filter(e=>!e.isBuiltIn).slice(0,48)]:i,o=new Set(a.map(e=>e.id)),s=z.filter(e=>e.isBuiltIn&&!o.has(e.id)),c=[...a,...s];return t<6&&console.info(`[agentboard:settings] Migrated from v${t} to v6`),{...n,commandPresets:c.map(V),defaultPresetId:W(a,n.defaultPresetId)}}}));function ee(){let[e,t]=(0,x.useState)(G.persist.hasHydrated());return(0,x.useEffect)(()=>{let e=G.persist.onFinishHydration(()=>t(!0));return G.persist.hasHydrated()&&t(!0),e},[]),e}var K=u(_());function te({title:e,titleId:t,...n},r){return x.createElement(`svg`,Object.assign({xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 24 24`,strokeWidth:1.5,stroke:`currentColor`,"aria-hidden":`true`,ref:r,"aria-labelledby":t},n),e?x.createElement(`title`,{id:t},e):null,x.createElement(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M12 9v4m0 4h.01M10.615 3.892L2.39 18.098c-.456.788-.684 1.182-.65 1.506a1 1 0 00.406.705c.263.191.718.191 1.629.191h16.45c.91 0 1.365 0 1.628-.191a1 1 0 00.407-.705c.034-.324-.195-.718-.65-1.506L13.383 3.892c-.454-.785-.681-1.178-.978-1.31a1 1 0 00-.813 0c-.296.132-.523.525-.978 1.31z`}))}var ne=x.forwardRef(te);function re({title:e,titleId:t,...n},r){return x.createElement(`svg`,Object.assign({xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 24 24`,strokeWidth:1.5,stroke:`currentColor`,"aria-hidden":`true`,ref:r,"aria-labelledby":t},n),e?x.createElement(`title`,{id:t},e):null,x.createElement(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M6 9l6 6 6-6`}))}var ie=x.forwardRef(re);function ae({title:e,titleId:t,...n},r){return x.createElement(`svg`,Object.assign({xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 24 24`,strokeWidth:1.5,stroke:`currentColor`,"aria-hidden":`true`,ref:r,"aria-labelledby":t},n),e?x.createElement(`title`,{id:t},e):null,x.createElement(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M9 18l6-6-6-6`}))}var oe=x.forwardRef(ae);function se({title:e,titleId:t,...n},r){return x.createElement(`svg`,Object.assign({xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 24 24`,strokeWidth:1.5,stroke:`currentColor`,"aria-hidden":`true`,ref:r,"aria-labelledby":t},n),e?x.createElement(`title`,{id:t},e):null,x.createElement(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M5 15c-.932 0-1.398 0-1.765-.152a2 2 0 01-1.083-1.083C2 13.398 2 12.932 2 12V5.2c0-1.12 0-1.68.218-2.108a2 2 0 01.874-.874C3.52 2 4.08 2 5.2 2H12c.932 0 1.398 0 1.765.152a2 2 0 011.083 1.083C15 3.602 15 4.068 15 5m-2.8 17h6.6c1.12 0 1.68 0 2.108-.218a2 2 0 00.874-.874C22 20.48 22 19.92 22 18.8v-6.6c0-1.12 0-1.68-.218-2.108a2 2 0 00-.874-.874C20.48 9 19.92 9 18.8 9h-6.6c-1.12 0-1.68 0-2.108.218a2 2 0 00-.874.874C9 10.52 9 11.08 9 12.2v6.6c0 1.12 0 1.68.218 2.108a2 2 0 00.874.874C10.52 22 11.08 22 12.2 22z`}))}var ce=x.forwardRef(se);function le({title:e,titleId:t,...n},r){return x.createElement(`svg`,Object.assign({xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 24 24`,strokeWidth:1.5,stroke:`currentColor`,"aria-hidden":`true`,ref:r,"aria-labelledby":t},n),e?x.createElement(`title`,{id:t},e):null,x.createElement(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M20 4v1.4c0 3.36 0 5.04-.654 6.324a6 6 0 01-2.622 2.622C15.44 15 13.76 15 10.4 15H4m0 0l5-5m-5 5l5 5`}))}var ue=x.forwardRef(le);function de({title:e,titleId:t,...n},r){return x.createElement(`svg`,Object.assign({xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 24 24`,strokeWidth:1.5,stroke:`currentColor`,"aria-hidden":`true`,ref:r,"aria-labelledby":t},n),e?x.createElement(`title`,{id:t},e):null,x.createElement(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M12 13a1 1 0 100-2 1 1 0 000 2zM12 6a1 1 0 100-2 1 1 0 000 2zM12 20a1 1 0 100-2 1 1 0 000 2z`}))}var fe=x.forwardRef(de);function pe({title:e,titleId:t,...n},r){return x.createElement(`svg`,Object.assign({xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 24 24`,strokeWidth:1.5,stroke:`currentColor`,"aria-hidden":`true`,ref:r,"aria-labelledby":t},n),e?x.createElement(`title`,{id:t},e):null,x.createElement(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M11 4H6.8c-1.68 0-2.52 0-3.162.327a3 3 0 00-1.311 1.311C2 6.28 2 7.12 2 8.8v8.4c0 1.68 0 2.52.327 3.162a3 3 0 001.311 1.311C4.28 22 5.12 22 6.8 22h8.4c1.68 0 2.52 0 3.162-.327a3 3 0 001.311-1.311C20 19.72 20 18.88 20 17.2V13M8 16h1.675c.489 0 .733 0 .963-.055.204-.05.4-.13.579-.24.201-.123.374-.296.72-.642L21.5 5.5a2.121 2.121 0 00-3-3l-9.563 9.563c-.346.346-.519.519-.642.72a2 2 0 00-.24.579c-.055.23-.055.474-.055.963V16z`}))}var me=x.forwardRef(pe);function he({title:e,titleId:t,...n},r){return x.createElement(`svg`,Object.assign({xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 24 24`,strokeWidth:1.5,stroke:`currentColor`,"aria-hidden":`true`,ref:r,"aria-labelledby":t},n),e?x.createElement(`title`,{id:t},e):null,x.createElement(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M14 2.27V6.4c0 .56 0 .84.109 1.054a1 1 0 00.437.437c.214.11.494.11 1.054.11h4.13M16 13H8m8 4H8m2-8H8m6-7H8.8c-1.68 0-2.52 0-3.162.327a3 3 0 00-1.311 1.311C4 4.28 4 5.12 4 6.8v10.4c0 1.68 0 2.52.327 3.162a3 3 0 001.311 1.311C6.28 22 7.12 22 8.8 22h6.4c1.68 0 2.52 0 3.162-.327a3 3 0 001.311-1.311C20 19.72 20 18.88 20 17.2V8l-6-6z`}))}var ge=x.forwardRef(he);function _e({title:e,titleId:t,...n},r){return x.createElement(`svg`,Object.assign({xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 24 24`,strokeWidth:1.5,stroke:`currentColor`,"aria-hidden":`true`,ref:r,"aria-labelledby":t},n),e?x.createElement(`title`,{id:t},e):null,x.createElement(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M13 7l-1.116-2.231c-.32-.642-.481-.963-.72-1.198a2 2 0 00-.748-.462C10.1 3 9.74 3 9.022 3H5.2c-1.12 0-1.68 0-2.108.218a2 2 0 00-.874.874C2 4.52 2 5.08 2 6.2V7m0 0h15.2c1.68 0 2.52 0 3.162.327a3 3 0 011.311 1.311C22 9.28 22 10.12 22 11.8v4.4c0 1.68 0 2.52-.327 3.162a3 3 0 01-1.311 1.311C19.72 21 18.88 21 17.2 21H6.8c-1.68 0-2.52 0-3.162-.327a3 3 0 01-1.311-1.311C2 18.72 2 17.88 2 16.2V7z`}))}var ve=x.forwardRef(_e);function ye({title:e,titleId:t,...n},r){return x.createElement(`svg`,Object.assign({xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 24 24`,strokeWidth:1.5,stroke:`currentColor`,"aria-hidden":`true`,ref:r,"aria-labelledby":t},n),e?x.createElement(`title`,{id:t},e):null,x.createElement(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M6.9 11.444v2.778m0-2.778V4.778c0-.92.761-1.667 1.7-1.667s1.7.746 1.7 1.667m-3.4 6.666c0-.92-.761-1.666-1.7-1.666s-1.7.746-1.7 1.666v2.223C3.5 18.269 7.306 22 12 22s8.5-3.731 8.5-8.333V8.11c0-.92-.761-1.667-1.7-1.667s-1.7.747-1.7 1.667m-6.8-3.333v6.11m0-6.11V3.667C10.3 2.747 11.061 2 12 2s1.7.746 1.7 1.667v1.11m0 0v6.112m0-6.111c0-.92.761-1.667 1.7-1.667s1.7.746 1.7 1.667V8.11m0 0v2.778`}))}var be=x.forwardRef(ye);function xe({title:e,titleId:t,...n},r){return x.createElement(`svg`,Object.assign({xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 24 24`,strokeWidth:1.5,stroke:`currentColor`,"aria-hidden":`true`,ref:r,"aria-labelledby":t},n),e?x.createElement(`title`,{id:t},e):null,x.createElement(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M3 12h18M3 6h18M3 18h18`}))}var Se=x.forwardRef(xe);function Ce({title:e,titleId:t,...n},r){return x.createElement(`svg`,Object.assign({xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 24 24`,strokeWidth:1.5,stroke:`currentColor`,"aria-hidden":`true`,ref:r,"aria-labelledby":t},n),e?x.createElement(`title`,{id:t},e):null,x.createElement(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M22 15.844a10.424 10.424 0 01-4.306.925c-5.779 0-10.463-4.684-10.463-10.462 0-1.536.33-2.994.925-4.307A10.464 10.464 0 002 11.538C2 17.316 6.684 22 12.462 22c4.243 0 7.896-2.526 9.538-6.156z`}))}var we=x.forwardRef(Ce);function Te({title:e,titleId:t,...n},r){return x.createElement(`svg`,Object.assign({xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 24 24`,strokeWidth:1.5,stroke:`currentColor`,"aria-hidden":`true`,ref:r,"aria-labelledby":t},n),e?x.createElement(`title`,{id:t},e):null,x.createElement(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M5 9l-3 3m0 0l3 3m-3-3h20M9 5l3-3m0 0l3 3m-3-3v20m3-3l-3 3m0 0l-3-3M19 9l3 3m0 0l-3 3`}))}var Ee=x.forwardRef(Te);function De({title:e,titleId:t,...n},r){return x.createElement(`svg`,Object.assign({xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 24 24`,strokeWidth:1.5,stroke:`currentColor`,"aria-hidden":`true`,ref:r,"aria-labelledby":t},n),e?x.createElement(`title`,{id:t},e):null,x.createElement(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M5 4.99c0-.972 0-1.457.202-1.725a1 1 0 01.738-.395c.335-.02.74.25 1.548.788l10.515 7.01c.668.446 1.002.668 1.118.949a1 1 0 010 .766c-.116.28-.45.503-1.118.948l-10.515 7.01c-.809.54-1.213.809-1.548.789a1 1 0 01-.738-.395C5 20.467 5 19.98 5 19.01V4.99z`}))}var Oe=x.forwardRef(De);function ke({title:e,titleId:t,...n},r){return x.createElement(`svg`,Object.assign({xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 24 24`,strokeWidth:1.5,stroke:`currentColor`,"aria-hidden":`true`,ref:r,"aria-labelledby":t},n),e?x.createElement(`title`,{id:t},e):null,x.createElement(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M12 5v14m-7-7h14`}))}var Ae=x.forwardRef(ke);function je({title:e,titleId:t,...n},r){return x.createElement(`svg`,Object.assign({xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 24 24`,strokeWidth:1.5,stroke:`currentColor`,"aria-hidden":`true`,ref:r,"aria-labelledby":t},n),e?x.createElement(`title`,{id:t},e):null,x.createElement(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M6 6h.01M6 18h.01m-.81-8h13.6c1.12 0 1.68 0 2.108-.218a2 2 0 00.874-.874C22 8.48 22 7.92 22 6.8V5.2c0-1.12 0-1.68-.218-2.108a2 2 0 00-.874-.874C20.48 2 19.92 2 18.8 2H5.2c-1.12 0-1.68 0-2.108.218a2 2 0 00-.874.874C2 3.52 2 4.08 2 5.2v1.6c0 1.12 0 1.68.218 2.108a2 2 0 00.874.874C3.52 10 4.08 10 5.2 10zm0 12h13.6c1.12 0 1.68 0 2.108-.218a2 2 0 00.874-.874C22 20.48 22 19.92 22 18.8v-1.6c0-1.12 0-1.68-.218-2.108a2 2 0 00-.874-.874C20.48 14 19.92 14 18.8 14H5.2c-1.12 0-1.68 0-2.108.218a2 2 0 00-.874.874C2 15.52 2 16.08 2 17.2v1.6c0 1.12 0 1.68.218 2.108a2 2 0 00.874.874C3.52 22 4.08 22 5.2 22z`}))}var Me=x.forwardRef(je);function Ne({title:e,titleId:t,...n},r){return x.createElement(`svg`,Object.assign({xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 24 24`,strokeWidth:1.5,stroke:`currentColor`,"aria-hidden":`true`,ref:r,"aria-labelledby":t},n),e?x.createElement(`title`,{id:t},e):null,x.createElement(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M12 15a3 3 0 100-6 3 3 0 000 6z`}),x.createElement(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M18.727 14.727a1.5 1.5 0 00.3 1.655l.055.054a1.816 1.816 0 010 2.573 1.818 1.818 0 01-2.573 0l-.055-.055a1.5 1.5 0 00-1.654-.3 1.5 1.5 0 00-.91 1.373v.155a1.818 1.818 0 11-3.636 0V20.1a1.5 1.5 0 00-.981-1.373 1.5 1.5 0 00-1.655.3l-.054.055a1.818 1.818 0 01-3.106-1.287 1.818 1.818 0 01.533-1.286l.054-.055a1.5 1.5 0 00.3-1.654 1.5 1.5 0 00-1.372-.91h-.155a1.818 1.818 0 110-3.636H3.9a1.5 1.5 0 001.373-.981 1.5 1.5 0 00-.3-1.655l-.055-.054A1.818 1.818 0 117.491 4.99l.054.054a1.5 1.5 0 001.655.3h.073a1.5 1.5 0 00.909-1.372v-.155a1.818 1.818 0 013.636 0V3.9a1.499 1.499 0 00.91 1.373 1.5 1.5 0 001.654-.3l.054-.055a1.817 1.817 0 012.573 0 1.819 1.819 0 010 2.573l-.055.054a1.5 1.5 0 00-.3 1.655v.073a1.5 1.5 0 001.373.909h.155a1.818 1.818 0 010 3.636H20.1a1.499 1.499 0 00-1.373.91z`}))}var Pe=x.forwardRef(Ne);function Fe({title:e,titleId:t,...n},r){return x.createElement(`svg`,Object.assign({xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 24 24`,strokeWidth:1.5,stroke:`currentColor`,"aria-hidden":`true`,ref:r,"aria-labelledby":t},n),e?x.createElement(`title`,{id:t},e):null,x.createElement(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M12 15a3 3 0 100-6 3 3 0 000 6z`}),x.createElement(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M9.29 19.371l.584 1.315a2.213 2.213 0 004.044 0l.585-1.315a2.426 2.426 0 012.47-1.423l1.43.152a2.212 2.212 0 002.022-3.502l-.847-1.164a2.428 2.428 0 01-.46-1.434c0-.513.163-1.014.465-1.429l.847-1.163a2.212 2.212 0 00-2.023-3.502l-1.43.152a2.433 2.433 0 01-1.47-.312 2.425 2.425 0 01-1-1.117l-.588-1.315a2.212 2.212 0 00-4.045 0L9.29 4.63c-.207.468-.558.86-1 1.117-.445.256-.96.365-1.47.312l-1.435-.152a2.212 2.212 0 00-2.022 3.502l.847 1.163a2.43 2.43 0 010 2.858l-.847 1.163a2.21 2.21 0 00.786 3.273c.381.195.81.274 1.236.23l1.43-.153a2.434 2.434 0 012.475 1.43z`}))}var Ie=x.forwardRef(Fe);function Le({title:e,titleId:t,...n},r){return x.createElement(`svg`,Object.assign({xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 24 24`,strokeWidth:1.5,stroke:`currentColor`,"aria-hidden":`true`,ref:r,"aria-labelledby":t},n),e?x.createElement(`title`,{id:t},e):null,x.createElement(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M4 17l6-6-6-6m8 14h8`}))}var Re=x.forwardRef(Le);function ze({title:e,titleId:t,...n},r){return x.createElement(`svg`,Object.assign({xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 24 24`,strokeWidth:1.5,stroke:`currentColor`,"aria-hidden":`true`,ref:r,"aria-labelledby":t},n),e?x.createElement(`title`,{id:t},e):null,x.createElement(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M18 6L6 18M6 6l12 12`}))}var Be=x.forwardRef(ze);function Ve(){if(typeof navigator>`u`)return!1;let e=navigator.userAgent,t=/iPad|iPhone|iPod/.test(e),n=navigator.platform===`MacIntel`&&navigator.maxTouchPoints>1;return t||n}function He(){return typeof navigator>`u`?!1:Ve()&&navigator.standalone===!0}function Ue(){return typeof navigator>`u`?!1:navigator.platform.toUpperCase().indexOf(`MAC`)>=0}function We(e){return e===`auto`?Ue()?`ctrl-option`:`ctrl-shift`:e}var Ge={"ctrl-option":`⌃⌥`,"ctrl-shift":`⌃⇧`,"cmd-option":`⌘⌥`,"cmd-shift":`⌘⇧`};function Ke(e){return Ge[e]}function qe(e,t){switch(t){case`ctrl-option`:return e.ctrlKey&&e.altKey&&!e.metaKey&&!e.shiftKey;case`ctrl-shift`:return e.ctrlKey&&e.shiftKey&&!e.metaKey&&!e.altKey;case`cmd-option`:return e.metaKey&&e.altKey&&!e.ctrlKey&&!e.shiftKey;case`cmd-shift`:return e.metaKey&&e.shiftKey&&!e.ctrlKey&&!e.altKey}}var Je=s((e=>{var t=p(),n=Symbol.for(`react.element`),r=Symbol.for(`react.fragment`),i=Object.prototype.hasOwnProperty,a=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,o={key:!0,ref:!0,__self:!0,__source:!0};function s(e,t,r){var s,c={},l=null,u=null;for(s in r!==void 0&&(l=``+r),t.key!==void 0&&(l=``+t.key),t.ref!==void 0&&(u=t.ref),t)i.call(t,s)&&!o.hasOwnProperty(s)&&(c[s]=t[s]);if(e&&e.defaultProps)for(s in t=e.defaultProps,t)c[s]===void 0&&(c[s]=t[s]);return{$$typeof:n,type:e,key:l,ref:u,props:c,_owner:a.current}}e.Fragment=r,e.jsx=s,e.jsxs=s})),q=s(((e,t)=>{t.exports=Je()}))(),Ye={connected:`bg-working`,connecting:`bg-approval`,reconnecting:`bg-approval`,disconnected:`bg-danger`};function Xe({connectionStatus:e,onNewSession:t,onOpenSettings:n,tailscaleIp:r}){let[i,a]=(0,x.useState)(!1),o=Ke(We(G(e=>e.shortcutModifier)));return(0,q.jsxs)(`header`,{className:`flex h-10 shrink-0 items-center justify-between border-b border-border bg-elevated px-3`,children:[(0,q.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,q.jsx)(`h1`,{className:`text-sm font-semibold tracking-tight text-primary text-balance`,children:`AGENTBOARD`}),(0,q.jsxs)(`div`,{className:`flex items-center gap-1.5 text-xs text-muted`,children:[(0,q.jsx)(`span`,{className:`h-2 w-2 rounded-full ${Ye[e]}`}),r&&(0,q.jsxs)(`button`,{onClick:()=>{if(!r)return;let e=`http://${r}:${window.location.port||`4040`}`;navigator.clipboard.writeText(e),a(!0),setTimeout(()=>a(!1),1500)},className:`ml-3 inline-flex items-center gap-1 text-muted/70 hover:text-muted transition-colors cursor-pointer`,title:`Tailscale IP - click to copy remote access URL`,children:[(0,q.jsx)(`span`,{className:`leading-none translate-y-[1px]`,children:i?`Copied!`:r}),!i&&(0,q.jsx)(ce,{width:12,height:12,className:`shrink-0`})]})]})]}),(0,q.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,q.jsx)(`button`,{onClick:t,className:`flex h-7 w-7 items-center justify-center rounded bg-accent text-white hover:bg-accent/90 active:scale-95 transition-all`,title:`New session (${o}N)`,"aria-label":`New session`,children:(0,q.jsx)(Ae,{width:16,height:16})}),(0,q.jsx)(`button`,{onClick:n,className:`flex h-7 w-7 items-center justify-center rounded border border-border text-secondary hover:bg-hover hover:text-primary active:scale-95 transition-all`,title:`Settings`,"aria-label":`Settings`,children:(0,q.jsx)(Ie,{width:14,height:14})})]})]})}var Ze=(0,x.createContext)({});function Qe(e){let t=(0,x.useRef)(null);return t.current===null&&(t.current=e()),t.current}var $e=typeof window<`u`,et=$e?x.useLayoutEffect:x.useEffect,tt=(0,x.createContext)(null);function nt(e,t){e.indexOf(t)===-1&&e.push(t)}function rt(e,t){let n=e.indexOf(t);n>-1&&e.splice(n,1)}var it=(e,t,n)=>n>t?t:n<e?e:n,at={},ot=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e);function st(e){return typeof e==`object`&&!!e}var ct=e=>/^0[^.\s]+$/u.test(e);function lt(e){let t;return()=>(t===void 0&&(t=e()),t)}var ut=e=>e,dt=(e,t)=>n=>t(e(n)),ft=(...e)=>e.reduce(dt),pt=(e,t,n)=>{let r=t-e;return r===0?1:(n-e)/r},mt=class{constructor(){this.subscriptions=[]}add(e){return nt(this.subscriptions,e),()=>rt(this.subscriptions,e)}notify(e,t,n){let r=this.subscriptions.length;if(r)if(r===1)this.subscriptions[0](e,t,n);else for(let i=0;i<r;i++){let r=this.subscriptions[i];r&&r(e,t,n)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}},ht=e=>e*1e3,gt=e=>e/1e3;function _t(e,t){return t?1e3/t*e:0}var vt=(e,t,n)=>(((1-3*n+3*t)*e+(3*n-6*t))*e+3*t)*e,yt=1e-7,bt=12;function xt(e,t,n,r,i){let a,o,s=0;do o=t+(n-t)/2,a=vt(o,r,i)-e,a>0?n=o:t=o;while(Math.abs(a)>yt&&++s<bt);return o}function St(e,t,n,r){if(e===t&&n===r)return ut;let i=t=>xt(t,0,1,e,n);return e=>e===0||e===1?e:vt(i(e),t,r)}var Ct=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,wt=e=>t=>1-e(1-t),Tt=St(.33,1.53,.69,.99),Et=wt(Tt),Dt=Ct(Et),Ot=e=>(e*=2)<1?.5*Et(e):.5*(2-2**(-10*(e-1))),kt=e=>1-Math.sin(Math.acos(e)),At=wt(kt),jt=Ct(kt),Mt=St(.42,0,1,1),Nt=St(0,0,.58,1),Pt=St(.42,0,.58,1),Ft=e=>Array.isArray(e)&&typeof e[0]!=`number`,It=e=>Array.isArray(e)&&typeof e[0]==`number`,Lt={linear:ut,easeIn:Mt,easeInOut:Pt,easeOut:Nt,circIn:kt,circInOut:jt,circOut:At,backIn:Et,backInOut:Dt,backOut:Tt,anticipate:Ot},Rt=e=>typeof e==`string`,zt=e=>{if(It(e)){e.length;let[t,n,r,i]=e;return St(t,n,r,i)}else if(Rt(e))return Lt[e],`${e}`,Lt[e];return e},Bt=[`setup`,`read`,`resolveKeyframes`,`preUpdate`,`update`,`preRender`,`render`,`postRender`],Vt={value:null,addProjectionMetrics:null};function Ht(e,t){let n=new Set,r=new Set,i=!1,a=!1,o=new WeakSet,s={delta:0,timestamp:0,isProcessing:!1},c=0;function l(t){o.has(t)&&(u.schedule(t),e()),c++,t(s)}let u={schedule:(e,t=!1,a=!1)=>{let s=a&&i?n:r;return t&&o.add(e),s.has(e)||s.add(e),e},cancel:e=>{r.delete(e),o.delete(e)},process:e=>{if(s=e,i){a=!0;return}i=!0,[n,r]=[r,n],n.forEach(l),t&&Vt.value&&Vt.value.frameloop[t].push(c),c=0,n.clear(),i=!1,a&&(a=!1,u.process(e))}};return u}var Ut=40;function Wt(e,t){let n=!1,r=!0,i={delta:0,timestamp:0,isProcessing:!1},a=()=>n=!0,o=Bt.reduce((e,n)=>(e[n]=Ht(a,t?n:void 0),e),{}),{setup:s,read:c,resolveKeyframes:l,preUpdate:u,update:d,preRender:f,render:p,postRender:m}=o,h=()=>{let a=at.useManualTiming?i.timestamp:performance.now();n=!1,at.useManualTiming||(i.delta=r?1e3/60:Math.max(Math.min(a-i.timestamp,Ut),1)),i.timestamp=a,i.isProcessing=!0,s.process(i),c.process(i),l.process(i),u.process(i),d.process(i),f.process(i),p.process(i),m.process(i),i.isProcessing=!1,n&&t&&(r=!1,e(h))},g=()=>{n=!0,r=!0,i.isProcessing||e(h)};return{schedule:Bt.reduce((e,t)=>{let r=o[t];return e[t]=(e,t=!1,i=!1)=>(n||g(),r.schedule(e,t,i)),e},{}),cancel:e=>{for(let t=0;t<Bt.length;t++)o[Bt[t]].cancel(e)},state:i,steps:o}}var{schedule:Gt,cancel:Kt,state:qt,steps:Jt}=Wt(typeof requestAnimationFrame<`u`?requestAnimationFrame:ut,!0),Yt;function Xt(){Yt=void 0}var Zt={now:()=>(Yt===void 0&&Zt.set(qt.isProcessing||at.useManualTiming?qt.timestamp:performance.now()),Yt),set:e=>{Yt=e,queueMicrotask(Xt)}},Qt={layout:0,mainThread:0,waapi:0},$t=e=>t=>typeof t==`string`&&t.startsWith(e),en=$t(`--`),tn=$t(`var(--`),nn=e=>tn(e)?rn.test(e.split(`/*`)[0].trim()):!1,rn=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function an(e){return typeof e==`string`?e.split(`/*`)[0].includes(`var(--`):!1}var on={test:e=>typeof e==`number`,parse:parseFloat,transform:e=>e},sn={...on,transform:e=>it(0,1,e)},cn={...on,default:1},ln=e=>Math.round(e*1e5)/1e5,un=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function dn(e){return e==null}var fn=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,pn=(e,t)=>n=>!!(typeof n==`string`&&fn.test(n)&&n.startsWith(e)||t&&!dn(n)&&Object.prototype.hasOwnProperty.call(n,t)),mn=(e,t,n)=>r=>{if(typeof r!=`string`)return r;let[i,a,o,s]=r.match(un);return{[e]:parseFloat(i),[t]:parseFloat(a),[n]:parseFloat(o),alpha:s===void 0?1:parseFloat(s)}},hn=e=>it(0,255,e),gn={...on,transform:e=>Math.round(hn(e))},_n={test:pn(`rgb`,`red`),parse:mn(`red`,`green`,`blue`),transform:({red:e,green:t,blue:n,alpha:r=1})=>`rgba(`+gn.transform(e)+`, `+gn.transform(t)+`, `+gn.transform(n)+`, `+ln(sn.transform(r))+`)`};function vn(e){let t=``,n=``,r=``,i=``;return e.length>5?(t=e.substring(1,3),n=e.substring(3,5),r=e.substring(5,7),i=e.substring(7,9)):(t=e.substring(1,2),n=e.substring(2,3),r=e.substring(3,4),i=e.substring(4,5),t+=t,n+=n,r+=r,i+=i),{red:parseInt(t,16),green:parseInt(n,16),blue:parseInt(r,16),alpha:i?parseInt(i,16)/255:1}}var yn={test:pn(`#`),parse:vn,transform:_n.transform},bn=e=>({test:t=>typeof t==`string`&&t.endsWith(e)&&t.split(` `).length===1,parse:parseFloat,transform:t=>`${t}${e}`}),xn=bn(`deg`),Sn=bn(`%`),J=bn(`px`),Cn=bn(`vh`),wn=bn(`vw`),Tn={...Sn,parse:e=>Sn.parse(e)/100,transform:e=>Sn.transform(e*100)},En={test:pn(`hsl`,`hue`),parse:mn(`hue`,`saturation`,`lightness`),transform:({hue:e,saturation:t,lightness:n,alpha:r=1})=>`hsla(`+Math.round(e)+`, `+Sn.transform(ln(t))+`, `+Sn.transform(ln(n))+`, `+ln(sn.transform(r))+`)`},Dn={test:e=>_n.test(e)||yn.test(e)||En.test(e),parse:e=>_n.test(e)?_n.parse(e):En.test(e)?En.parse(e):yn.parse(e),transform:e=>typeof e==`string`?e:e.hasOwnProperty(`red`)?_n.transform(e):En.transform(e),getAnimatableNone:e=>{let t=Dn.parse(e);return t.alpha=0,Dn.transform(t)}},On=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function kn(e){return isNaN(e)&&typeof e==`string`&&(e.match(un)?.length||0)+(e.match(On)?.length||0)>0}var An=`number`,jn=`color`,Mn=`var`,Nn=`var(`,Pn="${}",Fn=/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 In(e){let t=e.toString(),n=[],r={color:[],number:[],var:[]},i=[],a=0;return{values:n,split:t.replace(Fn,e=>(Dn.test(e)?(r.color.push(a),i.push(jn),n.push(Dn.parse(e))):e.startsWith(Nn)?(r.var.push(a),i.push(Mn),n.push(e)):(r.number.push(a),i.push(An),n.push(parseFloat(e))),++a,Pn)).split(Pn),indexes:r,types:i}}function Ln(e){return In(e).values}function Rn(e){let{split:t,types:n}=In(e),r=t.length;return e=>{let i=``;for(let a=0;a<r;a++)if(i+=t[a],e[a]!==void 0){let t=n[a];t===An?i+=ln(e[a]):t===jn?i+=Dn.transform(e[a]):i+=e[a]}return i}}var zn=e=>typeof e==`number`?0:Dn.test(e)?Dn.getAnimatableNone(e):e;function Bn(e){let t=Ln(e);return Rn(e)(t.map(zn))}var Vn={test:kn,parse:Ln,createTransformer:Rn,getAnimatableNone:Bn};function Hn(e,t,n){return n<0&&(n+=1),n>1&&--n,n<1/6?e+(t-e)*6*n:n<1/2?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function Un({hue:e,saturation:t,lightness:n,alpha:r}){e/=360,t/=100,n/=100;let i=0,a=0,o=0;if(!t)i=a=o=n;else{let r=n<.5?n*(1+t):n+t-n*t,s=2*n-r;i=Hn(s,r,e+1/3),a=Hn(s,r,e),o=Hn(s,r,e-1/3)}return{red:Math.round(i*255),green:Math.round(a*255),blue:Math.round(o*255),alpha:r}}function Wn(e,t){return n=>n>0?t:e}var Gn=(e,t,n)=>e+(t-e)*n,Kn=(e,t,n)=>{let r=e*e,i=n*(t*t-r)+r;return i<0?0:Math.sqrt(i)},qn=[yn,_n,En],Jn=e=>qn.find(t=>t.test(e));function Yn(e){let t=Jn(e);if(`${e}`,!t)return!1;let n=t.parse(e);return t===En&&(n=Un(n)),n}var Xn=(e,t)=>{let n=Yn(e),r=Yn(t);if(!n||!r)return Wn(e,t);let i={...n};return e=>(i.red=Kn(n.red,r.red,e),i.green=Kn(n.green,r.green,e),i.blue=Kn(n.blue,r.blue,e),i.alpha=Gn(n.alpha,r.alpha,e),_n.transform(i))},Zn=new Set([`none`,`hidden`]);function Qn(e,t){return Zn.has(e)?n=>n<=0?e:t:n=>n>=1?t:e}function $n(e,t){return n=>Gn(e,t,n)}function er(e){return typeof e==`number`?$n:typeof e==`string`?nn(e)?Wn:Dn.test(e)?Xn:ir:Array.isArray(e)?tr:typeof e==`object`?Dn.test(e)?Xn:nr:Wn}function tr(e,t){let n=[...e],r=n.length,i=e.map((e,n)=>er(e)(e,t[n]));return e=>{for(let t=0;t<r;t++)n[t]=i[t](e);return n}}function nr(e,t){let n={...e,...t},r={};for(let i in n)e[i]!==void 0&&t[i]!==void 0&&(r[i]=er(e[i])(e[i],t[i]));return e=>{for(let t in r)n[t]=r[t](e);return n}}function rr(e,t){let n=[],r={color:0,var:0,number:0};for(let i=0;i<t.values.length;i++){let a=t.types[i],o=e.indexes[a][r[a]];n[i]=e.values[o]??0,r[a]++}return n}var ir=(e,t)=>{let n=Vn.createTransformer(t),r=In(e),i=In(t);return r.indexes.var.length===i.indexes.var.length&&r.indexes.color.length===i.indexes.color.length&&r.indexes.number.length>=i.indexes.number.length?Zn.has(e)&&!i.values.length||Zn.has(t)&&!r.values.length?Qn(e,t):ft(tr(rr(r,i),i.values),n):(`${e}${t}`,Wn(e,t))};function ar(e,t,n){return typeof e==`number`&&typeof t==`number`&&typeof n==`number`?Gn(e,t,n):er(e)(e,t)}var or=e=>{let t=({timestamp:t})=>e(t);return{start:(e=!0)=>Gt.update(t,e),stop:()=>Kt(t),now:()=>qt.isProcessing?qt.timestamp:Zt.now()}},sr=(e,t,n=10)=>{let r=``,i=Math.max(Math.round(t/n),2);for(let t=0;t<i;t++)r+=Math.round(e(t/(i-1))*1e4)/1e4+`, `;return`linear(${r.substring(0,r.length-2)})`},cr=2e4;function lr(e){let t=0,n=e.next(t);for(;!n.done&&t<2e4;)t+=50,n=e.next(t);return t>=2e4?1/0:t}function ur(e,t=100,n){let r=n({...e,keyframes:[0,t]}),i=Math.min(lr(r),cr);return{type:`keyframes`,ease:e=>r.next(i*e).value/t,duration:gt(i)}}var dr=5;function fr(e,t,n){let r=Math.max(t-dr,0);return _t(n-e(r),t-r)}var pr={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},mr=.001;function hr({duration:e=pr.duration,bounce:t=pr.bounce,velocity:n=pr.velocity,mass:r=pr.mass}){let i,a;pr.maxDuration;let o=1-t;o=it(pr.minDamping,pr.maxDamping,o),e=it(pr.minDuration,pr.maxDuration,gt(e)),o<1?(i=t=>{let r=t*o,i=r*e,a=r-n,s=vr(t,o),c=Math.exp(-i);return mr-a/s*c},a=t=>{let r=t*o*e,a=r*n+n,s=o**2*t**2*e,c=Math.exp(-r),l=vr(t**2,o);return(-i(t)+mr>0?-1:1)*((a-s)*c)/l}):(i=t=>{let r=Math.exp(-t*e),i=(t-n)*e+1;return-mr+r*i},a=t=>Math.exp(-t*e)*((n-t)*(e*e)));let s=5/e,c=_r(i,a,s);if(e=ht(e),isNaN(c))return{stiffness:pr.stiffness,damping:pr.damping,duration:e};{let t=c**2*r;return{stiffness:t,damping:o*2*Math.sqrt(r*t),duration:e}}}var gr=12;function _r(e,t,n){let r=n;for(let n=1;n<gr;n++)r-=e(r)/t(r);return r}function vr(e,t){return e*Math.sqrt(1-t*t)}var yr=[`duration`,`bounce`],br=[`stiffness`,`damping`,`mass`];function xr(e,t){return t.some(t=>e[t]!==void 0)}function Sr(e){let t={velocity:pr.velocity,stiffness:pr.stiffness,damping:pr.damping,mass:pr.mass,isResolvedFromDuration:!1,...e};if(!xr(e,br)&&xr(e,yr))if(e.visualDuration){let n=e.visualDuration,r=2*Math.PI/(n*1.2),i=r*r,a=2*it(.05,1,1-(e.bounce||0))*Math.sqrt(i);t={...t,mass:pr.mass,stiffness:i,damping:a}}else{let n=hr(e);t={...t,...n,mass:pr.mass},t.isResolvedFromDuration=!0}return t}function Cr(e=pr.visualDuration,t=pr.bounce){let n=typeof e==`object`?e:{visualDuration:e,keyframes:[0,1],bounce:t},{restSpeed:r,restDelta:i}=n,a=n.keyframes[0],o=n.keyframes[n.keyframes.length-1],s={done:!1,value:a},{stiffness:c,damping:l,mass:u,duration:d,velocity:f,isResolvedFromDuration:p}=Sr({...n,velocity:-gt(n.velocity||0)}),m=f||0,h=l/(2*Math.sqrt(c*u)),g=o-a,_=gt(Math.sqrt(c/u)),v=Math.abs(g)<5;r||=v?pr.restSpeed.granular:pr.restSpeed.default,i||=v?pr.restDelta.granular:pr.restDelta.default;let y;if(h<1){let e=vr(_,h);y=t=>o-Math.exp(-h*_*t)*((m+h*_*g)/e*Math.sin(e*t)+g*Math.cos(e*t))}else if(h===1)y=e=>o-Math.exp(-_*e)*(g+(m+_*g)*e);else{let e=_*Math.sqrt(h*h-1);y=t=>{let n=Math.exp(-h*_*t),r=Math.min(e*t,300);return o-n*((m+h*_*g)*Math.sinh(r)+e*g*Math.cosh(r))/e}}let b={calculatedDuration:p&&d||null,next:e=>{let t=y(e);if(p)s.done=e>=d;else{let n=e===0?m:0;h<1&&(n=e===0?ht(m):fr(y,e,t));let a=Math.abs(n)<=r,c=Math.abs(o-t)<=i;s.done=a&&c}return s.value=s.done?o:t,s},toString:()=>{let e=Math.min(lr(b),cr),t=sr(t=>b.next(e*t).value,e,30);return e+`ms `+t},toTransition:()=>{}};return b}Cr.applyToOptions=e=>{let t=ur(e,100,Cr);return e.ease=t.ease,e.duration=ht(t.duration),e.type=`keyframes`,e};function wr({keyframes:e,velocity:t=0,power:n=.8,timeConstant:r=325,bounceDamping:i=10,bounceStiffness:a=500,modifyTarget:o,min:s,max:c,restDelta:l=.5,restSpeed:u}){let d=e[0],f={done:!1,value:d},p=e=>s!==void 0&&e<s||c!==void 0&&e>c,m=e=>s===void 0?c:c===void 0||Math.abs(s-e)<Math.abs(c-e)?s:c,h=n*t,g=d+h,_=o===void 0?g:o(g);_!==g&&(h=_-d);let v=e=>-h*Math.exp(-e/r),y=e=>_+v(e),b=e=>{let t=v(e),n=y(e);f.done=Math.abs(t)<=l,f.value=f.done?_:n},x,S,C=e=>{p(f.value)&&(x=e,S=Cr({keyframes:[f.value,m(f.value)],velocity:fr(y,e,f.value),damping:i,stiffness:a,restDelta:l,restSpeed:u}))};return C(0),{calculatedDuration:null,next:e=>{let t=!1;return!S&&x===void 0&&(t=!0,b(e),C(e)),x!==void 0&&e>=x?S.next(e-x):(!t&&b(e),f)}}}function Tr(e,t,n){let r=[],i=n||at.mix||ar,a=e.length-1;for(let n=0;n<a;n++){let a=i(e[n],e[n+1]);t&&(a=ft(Array.isArray(t)?t[n]||ut:t,a)),r.push(a)}return r}function Er(e,t,{clamp:n=!0,ease:r,mixer:i}={}){let a=e.length;if(t.length,a===1)return()=>t[0];if(a===2&&t[0]===t[1])return()=>t[1];let o=e[0]===e[1];e[0]>e[a-1]&&(e=[...e].reverse(),t=[...t].reverse());let s=Tr(t,r,i),c=s.length,l=n=>{if(o&&n<e[0])return t[0];let r=0;if(c>1)for(;r<e.length-2&&!(n<e[r+1]);r++);let i=pt(e[r],e[r+1],n);return s[r](i)};return n?t=>l(it(e[0],e[a-1],t)):l}function Dr(e,t){let n=e[e.length-1];for(let r=1;r<=t;r++){let i=pt(0,t,r);e.push(Gn(n,1,i))}}function Or(e){let t=[0];return Dr(t,e.length-1),t}function kr(e,t){return e.map(e=>e*t)}function Ar(e,t){return e.map(()=>t||Pt).splice(0,e.length-1)}function jr({duration:e=300,keyframes:t,times:n,ease:r=`easeInOut`}){let i=Ft(r)?r.map(zt):zt(r),a={done:!1,value:t[0]},o=Er(kr(n&&n.length===t.length?n:Or(t),e),t,{ease:Array.isArray(i)?i:Ar(t,i)});return{calculatedDuration:e,next:t=>(a.value=o(t),a.done=t>=e,a)}}var Mr=e=>e!==null;function Nr(e,{repeat:t,repeatType:n=`loop`},r,i=1){let a=e.filter(Mr),o=i<0||t&&n!==`loop`&&t%2==1?0:a.length-1;return!o||r===void 0?a[o]:r}var Pr={decay:wr,inertia:wr,tween:jr,keyframes:jr,spring:Cr};function Fr(e){typeof e.type==`string`&&(e.type=Pr[e.type])}var Ir=class{constructor(){this.updateFinished()}get finished(){return this._finished}updateFinished(){this._finished=new Promise(e=>{this.resolve=e})}notifyFinished(){this.resolve()}then(e,t){return this.finished.then(e,t)}},Lr=e=>e/100,Rr=class extends Ir{constructor(e){super(),this.state=`idle`,this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.stop=()=>{let{motionValue:e}=this.options;e&&e.updatedAt!==Zt.now()&&this.tick(Zt.now()),this.isStopped=!0,this.state!==`idle`&&(this.teardown(),this.options.onStop?.())},Qt.mainThread++,this.options=e,this.initAnimation(),this.play(),e.autoplay===!1&&this.pause()}initAnimation(){let{options:e}=this;Fr(e);let{type:t=jr,repeat:n=0,repeatDelay:r=0,repeatType:i,velocity:a=0}=e,{keyframes:o}=e,s=t||jr;s!==jr&&typeof o[0]!=`number`&&(this.mixKeyframes=ft(Lr,ar(o[0],o[1])),o=[0,100]);let c=s({...e,keyframes:o});i===`mirror`&&(this.mirroredGenerator=s({...e,keyframes:[...o].reverse(),velocity:-a})),c.calculatedDuration===null&&(c.calculatedDuration=lr(c));let{calculatedDuration:l}=c;this.calculatedDuration=l,this.resolvedDuration=l+r,this.totalDuration=this.resolvedDuration*(n+1)-r,this.generator=c}updateTime(e){let t=Math.round(e-this.startTime)*this.playbackSpeed;this.holdTime===null?this.currentTime=t:this.currentTime=this.holdTime}tick(e,t=!1){let{generator:n,totalDuration:r,mixKeyframes:i,mirroredGenerator:a,resolvedDuration:o,calculatedDuration:s}=this;if(this.startTime===null)return n.next(0);let{delay:c=0,keyframes:l,repeat:u,repeatType:d,repeatDelay:f,type:p,onUpdate:m,finalKeyframe:h}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,e):this.speed<0&&(this.startTime=Math.min(e-r/this.speed,this.startTime)),t?this.currentTime=e:this.updateTime(e);let g=this.currentTime-c*(this.playbackSpeed>=0?1:-1),_=this.playbackSpeed>=0?g<0:g>r;this.currentTime=Math.max(g,0),this.state===`finished`&&this.holdTime===null&&(this.currentTime=r);let v=this.currentTime,y=n;if(u){let e=Math.min(this.currentTime,r)/o,t=Math.floor(e),n=e%1;!n&&e>=1&&(n=1),n===1&&t--,t=Math.min(t,u+1),t%2&&(d===`reverse`?(n=1-n,f&&(n-=f/o)):d===`mirror`&&(y=a)),v=it(0,1,n)*o}let b=_?{done:!1,value:l[0]}:y.next(v);i&&(b.value=i(b.value));let{done:x}=b;!_&&s!==null&&(x=this.playbackSpeed>=0?this.currentTime>=r:this.currentTime<=0);let S=this.holdTime===null&&(this.state===`finished`||this.state===`running`&&x);return S&&p!==wr&&(b.value=Nr(l,this.options,h,this.speed)),m&&m(b.value),S&&this.finish(),b}then(e,t){return this.finished.then(e,t)}get duration(){return gt(this.calculatedDuration)}get iterationDuration(){let{delay:e=0}=this.options||{};return this.duration+gt(e)}get time(){return gt(this.currentTime)}set time(e){e=ht(e),this.currentTime=e,this.startTime===null||this.holdTime!==null||this.playbackSpeed===0?this.holdTime=e:this.driver&&(this.startTime=this.driver.now()-e/this.playbackSpeed),this.driver?.start(!1)}get speed(){return this.playbackSpeed}set speed(e){this.updateTime(Zt.now());let t=this.playbackSpeed!==e;this.playbackSpeed=e,t&&(this.time=gt(this.currentTime))}play(){if(this.isStopped)return;let{driver:e=or,startTime:t}=this.options;this.driver||=e(e=>this.tick(e)),this.options.onPlay?.();let n=this.driver.now();this.state===`finished`?(this.updateFinished(),this.startTime=n):this.holdTime===null?this.startTime||=t??n:this.startTime=n-this.holdTime,this.state===`finished`&&this.speed<0&&(this.startTime+=this.calculatedDuration),this.holdTime=null,this.state=`running`,this.driver.start()}pause(){this.state=`paused`,this.updateTime(Zt.now()),this.holdTime=this.currentTime}complete(){this.state!==`running`&&this.play(),this.state=`finished`,this.holdTime=null}finish(){this.notifyFinished(),this.teardown(),this.state=`finished`,this.options.onComplete?.()}cancel(){this.holdTime=null,this.startTime=0,this.tick(0),this.teardown(),this.options.onCancel?.()}teardown(){this.state=`idle`,this.stopDriver(),this.startTime=this.holdTime=null,Qt.mainThread--}stopDriver(){this.driver&&=(this.driver.stop(),void 0)}sample(e){return this.startTime=0,this.tick(e,!0)}attachTimeline(e){return this.options.allowFlatten&&(this.options.type=`keyframes`,this.options.ease=`linear`,this.initAnimation()),this.driver?.stop(),e.observe(this)}};function zr(e){for(let t=1;t<e.length;t++)e[t]??(e[t]=e[t-1])}var Br=e=>e*180/Math.PI,Vr=e=>Ur(Br(Math.atan2(e[1],e[0]))),Hr={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:e=>(Math.abs(e[0])+Math.abs(e[3]))/2,rotate:Vr,rotateZ:Vr,skewX:e=>Br(Math.atan(e[1])),skewY:e=>Br(Math.atan(e[2])),skew:e=>(Math.abs(e[1])+Math.abs(e[2]))/2},Ur=e=>(e%=360,e<0&&(e+=360),e),Wr=Vr,Gr=e=>Math.sqrt(e[0]*e[0]+e[1]*e[1]),Kr=e=>Math.sqrt(e[4]*e[4]+e[5]*e[5]),qr={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:Gr,scaleY:Kr,scale:e=>(Gr(e)+Kr(e))/2,rotateX:e=>Ur(Br(Math.atan2(e[6],e[5]))),rotateY:e=>Ur(Br(Math.atan2(-e[2],e[0]))),rotateZ:Wr,rotate:Wr,skewX:e=>Br(Math.atan(e[4])),skewY:e=>Br(Math.atan(e[1])),skew:e=>(Math.abs(e[1])+Math.abs(e[4]))/2};function Jr(e){return+!!e.includes(`scale`)}function Yr(e,t){if(!e||e===`none`)return Jr(t);let n=e.match(/^matrix3d\(([-\d.e\s,]+)\)$/u),r,i;if(n)r=qr,i=n;else{let t=e.match(/^matrix\(([-\d.e\s,]+)\)$/u);r=Hr,i=t}if(!i)return Jr(t);let a=r[t],o=i[1].split(`,`).map(Zr);return typeof a==`function`?a(o):o[a]}var Xr=(e,t)=>{let{transform:n=`none`}=getComputedStyle(e);return Yr(n,t)};function Zr(e){return parseFloat(e.trim())}var Qr=[`transformPerspective`,`x`,`y`,`z`,`translateX`,`translateY`,`translateZ`,`scale`,`scaleX`,`scaleY`,`rotate`,`rotateX`,`rotateY`,`rotateZ`,`skew`,`skewX`,`skewY`],$r=new Set(Qr),ei=e=>e===on||e===J,ti=new Set([`x`,`y`,`z`]),ni=Qr.filter(e=>!ti.has(e));function ri(e){let t=[];return ni.forEach(n=>{let r=e.getValue(n);r!==void 0&&(t.push([n,r.get()]),r.set(+!!n.startsWith(`scale`)))}),t}var ii={width:({x:e},{paddingLeft:t=`0`,paddingRight:n=`0`})=>e.max-e.min-parseFloat(t)-parseFloat(n),height:({y:e},{paddingTop:t=`0`,paddingBottom:n=`0`})=>e.max-e.min-parseFloat(t)-parseFloat(n),top:(e,{top:t})=>parseFloat(t),left:(e,{left:t})=>parseFloat(t),bottom:({y:e},{top:t})=>parseFloat(t)+(e.max-e.min),right:({x:e},{left:t})=>parseFloat(t)+(e.max-e.min),x:(e,{transform:t})=>Yr(t,`x`),y:(e,{transform:t})=>Yr(t,`y`)};ii.translateX=ii.x,ii.translateY=ii.y;var ai=new Set,oi=!1,si=!1,ci=!1;function li(){if(si){let e=Array.from(ai).filter(e=>e.needsMeasurement),t=new Set(e.map(e=>e.element)),n=new Map;t.forEach(e=>{let t=ri(e);t.length&&(n.set(e,t),e.render())}),e.forEach(e=>e.measureInitialState()),t.forEach(e=>{e.render();let t=n.get(e);t&&t.forEach(([t,n])=>{e.getValue(t)?.set(n)})}),e.forEach(e=>e.measureEndState()),e.forEach(e=>{e.suspendedScrollY!==void 0&&window.scrollTo(0,e.suspendedScrollY)})}si=!1,oi=!1,ai.forEach(e=>e.complete(ci)),ai.clear()}function ui(){ai.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(si=!0)})}function di(){ci=!0,ui(),li(),ci=!1}var fi=class{constructor(e,t,n,r,i,a=!1){this.state=`pending`,this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...e],this.onComplete=t,this.name=n,this.motionValue=r,this.element=i,this.isAsync=a}scheduleResolve(){this.state=`scheduled`,this.isAsync?(ai.add(this),oi||(oi=!0,Gt.read(ui),Gt.resolveKeyframes(li))):(this.readKeyframes(),this.complete())}readKeyframes(){let{unresolvedKeyframes:e,name:t,element:n,motionValue:r}=this;if(e[0]===null){let i=r?.get(),a=e[e.length-1];if(i!==void 0)e[0]=i;else if(n&&t){let r=n.readValue(t,a);r!=null&&(e[0]=r)}e[0]===void 0&&(e[0]=a),r&&i===void 0&&r.set(e[0])}zr(e)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(e=!1){this.state=`complete`,this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,e),ai.delete(this)}cancel(){this.state===`scheduled`&&(ai.delete(this),this.state=`pending`)}resume(){this.state===`pending`&&this.scheduleResolve()}},pi=e=>e.startsWith(`--`);function mi(e,t,n){pi(t)?e.style.setProperty(t,n):e.style[t]=n}var hi=lt(()=>window.ScrollTimeline!==void 0),gi={};function _i(e,t){let n=lt(e);return()=>gi[t]??n()}var vi=_i(()=>{try{document.createElement(`div`).animate({opacity:0},{easing:`linear(0, 1)`})}catch{return!1}return!0},`linearEasing`),yi=([e,t,n,r])=>`cubic-bezier(${e}, ${t}, ${n}, ${r})`,bi={linear:`linear`,ease:`ease`,easeIn:`ease-in`,easeOut:`ease-out`,easeInOut:`ease-in-out`,circIn:yi([0,.65,.55,1]),circOut:yi([.55,0,1,.45]),backIn:yi([.31,.01,.66,-.59]),backOut:yi([.33,1.53,.69,.99])};function xi(e,t){if(e)return typeof e==`function`?vi()?sr(e,t):`ease-out`:It(e)?yi(e):Array.isArray(e)?e.map(e=>xi(e,t)||bi.easeOut):bi[e]}function Si(e,t,n,{delay:r=0,duration:i=300,repeat:a=0,repeatType:o=`loop`,ease:s=`easeOut`,times:c}={},l=void 0){let u={[t]:n};c&&(u.offset=c);let d=xi(s,i);Array.isArray(d)&&(u.easing=d),Vt.value&&Qt.waapi++;let f={delay:r,duration:i,easing:Array.isArray(d)?`linear`:d,fill:`both`,iterations:a+1,direction:o===`reverse`?`alternate`:`normal`};l&&(f.pseudoElement=l);let p=e.animate(u,f);return Vt.value&&p.finished.finally(()=>{Qt.waapi--}),p}function Ci(e){return typeof e==`function`&&`applyToOptions`in e}function wi({type:e,...t}){return Ci(e)&&vi()?e.applyToOptions(t):(t.duration??=300,t.ease??=`easeOut`,t)}var Ti=class extends Ir{constructor(e){if(super(),this.finishedTime=null,this.isStopped=!1,this.manualStartTime=null,!e)return;let{element:t,name:n,keyframes:r,pseudoElement:i,allowFlatten:a=!1,finalKeyframe:o,onComplete:s}=e;this.isPseudoElement=!!i,this.allowFlatten=a,this.options=e,e.type;let c=wi(e);this.animation=Si(t,n,r,c,i),c.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!i){let e=Nr(r,this.options,o,this.speed);this.updateMotionValue?this.updateMotionValue(e):mi(t,n,e),this.animation.cancel()}s?.(),this.notifyFinished()}}play(){this.isStopped||(this.manualStartTime=null,this.animation.play(),this.state===`finished`&&this.updateFinished())}pause(){this.animation.pause()}complete(){this.animation.finish?.()}cancel(){try{this.animation.cancel()}catch{}}stop(){if(this.isStopped)return;this.isStopped=!0;let{state:e}=this;e===`idle`||e===`finished`||(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){this.isPseudoElement||this.animation.commitStyles?.()}get duration(){let e=this.animation.effect?.getComputedTiming?.().duration||0;return gt(Number(e))}get iterationDuration(){let{delay:e=0}=this.options||{};return this.duration+gt(e)}get time(){return gt(Number(this.animation.currentTime)||0)}set time(e){this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=ht(e)}get speed(){return this.animation.playbackRate}set speed(e){e<0&&(this.finishedTime=null),this.animation.playbackRate=e}get state(){return this.finishedTime===null?this.animation.playState:`finished`}get startTime(){return this.manualStartTime??Number(this.animation.startTime)}set startTime(e){this.manualStartTime=this.animation.startTime=e}attachTimeline({timeline:e,observe:t}){return this.allowFlatten&&this.animation.effect?.updateTiming({easing:`linear`}),this.animation.onfinish=null,e&&hi()?(this.animation.timeline=e,ut):t(this)}},Ei={anticipate:Ot,backInOut:Dt,circInOut:jt};function Di(e){return e in Ei}function Oi(e){typeof e.ease==`string`&&Di(e.ease)&&(e.ease=Ei[e.ease])}var ki=10,Ai=class extends Ti{constructor(e){Oi(e),Fr(e),super(e),e.startTime!==void 0&&(this.startTime=e.startTime),this.options=e}updateMotionValue(e){let{motionValue:t,onUpdate:n,onComplete:r,element:i,...a}=this.options;if(!t)return;if(e!==void 0){t.set(e);return}let o=new Rr({...a,autoplay:!1}),s=Math.max(ki,Zt.now()-this.startTime),c=it(0,ki,s-ki);t.setWithVelocity(o.sample(Math.max(0,s-c)).value,o.sample(s).value,c),o.stop()}},ji=(e,t)=>t===`zIndex`?!1:!!(typeof e==`number`||Array.isArray(e)||typeof e==`string`&&(Vn.test(e)||e===`0`)&&!e.startsWith(`url(`));function Mi(e){let t=e[0];if(e.length===1)return!0;for(let n=0;n<e.length;n++)if(e[n]!==t)return!0}function Ni(e,t,n,r){let i=e[0];if(i===null)return!1;if(t===`display`||t===`visibility`)return!0;let a=e[e.length-1],o=ji(i,t),s=ji(a,t);return`${t}${i}${a}${o?a:i}`,!o||!s?!1:Mi(e)||(n===`spring`||Ci(n))&&r}function Pi(e){e.duration=0,e.type=`keyframes`}var Fi=new Set([`opacity`,`clipPath`,`filter`,`transform`]),Ii=lt(()=>Object.hasOwnProperty.call(Element.prototype,`animate`));function Li(e){let{motionValue:t,name:n,repeatDelay:r,repeatType:i,damping:a,type:o}=e;if(!(t?.owner?.current instanceof HTMLElement))return!1;let{onUpdate:s,transformTemplate:c}=t.owner.getProps();return Ii()&&n&&Fi.has(n)&&(n!==`transform`||!c)&&!s&&!r&&i!==`mirror`&&a!==0&&o!==`inertia`}var Ri=40,zi=class extends Ir{constructor({autoplay:e=!0,delay:t=0,type:n=`keyframes`,repeat:r=0,repeatDelay:i=0,repeatType:a=`loop`,keyframes:o,name:s,motionValue:c,element:l,...u}){super(),this.stop=()=>{this._animation&&(this._animation.stop(),this.stopTimeline?.()),this.keyframeResolver?.cancel()},this.createdAt=Zt.now();let d={autoplay:e,delay:t,type:n,repeat:r,repeatDelay:i,repeatType:a,name:s,motionValue:c,element:l,...u};this.keyframeResolver=new(l?.KeyframeResolver||fi)(o,(e,t,n)=>this.onKeyframesResolved(e,t,d,!n),s,c,l),this.keyframeResolver?.scheduleResolve()}onKeyframesResolved(e,t,n,r){this.keyframeResolver=void 0;let{name:i,type:a,velocity:o,delay:s,isHandoff:c,onUpdate:l}=n;this.resolvedAt=Zt.now(),Ni(e,i,a,o)||((at.instantAnimations||!s)&&l?.(Nr(e,n,t)),e[0]=e[e.length-1],Pi(n),n.repeat=0);let u={startTime:r?this.resolvedAt&&this.resolvedAt-this.createdAt>Ri?this.resolvedAt:this.createdAt:void 0,finalKeyframe:t,...n,keyframes:e},d=!c&&Li(u)?new Ai({...u,element:u.motionValue.owner.current}):new Rr(u);d.finished.then(()=>this.notifyFinished()).catch(ut),this.pendingTimeline&&=(this.stopTimeline=d.attachTimeline(this.pendingTimeline),void 0),this._animation=d}get finished(){return this._animation?this.animation.finished:this._finished}then(e,t){return this.finished.finally(e).then(()=>{})}get animation(){return this._animation||(this.keyframeResolver?.resume(),di()),this._animation}get duration(){return this.animation.duration}get iterationDuration(){return this.animation.iterationDuration}get time(){return this.animation.time}set time(e){this.animation.time=e}get speed(){return this.animation.speed}get state(){return this.animation.state}set speed(e){this.animation.speed=e}get startTime(){return this.animation.startTime}attachTimeline(e){return this._animation?this.stopTimeline=this.animation.attachTimeline(e):this.pendingTimeline=e,()=>this.stop()}play(){this.animation.play()}pause(){this.animation.pause()}complete(){this.animation.complete()}cancel(){this._animation&&this.animation.cancel(),this.keyframeResolver?.cancel()}},Bi=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function Vi(e){let t=Bi.exec(e);if(!t)return[,];let[,n,r,i]=t;return[`--${n??r}`,i]}function Hi(e,t,n=1){`${e}`;let[r,i]=Vi(e);if(!r)return;let a=window.getComputedStyle(t).getPropertyValue(r);if(a){let e=a.trim();return ot(e)?parseFloat(e):e}return nn(i)?Hi(i,t,n+1):i}function Ui(e,t){return e?.[t]??e?.default??e}var Wi=new Set([`width`,`height`,`top`,`left`,`right`,`bottom`,...Qr]),Gi={test:e=>e===`auto`,parse:e=>e},Ki=e=>t=>t.test(e),qi=[on,J,Sn,xn,wn,Cn,Gi],Ji=e=>qi.find(Ki(e));function Yi(e){return typeof e==`number`?e===0:e===null?!0:e===`none`||e===`0`||ct(e)}var Xi=new Set([`brightness`,`contrast`,`saturate`,`opacity`]);function Zi(e){let[t,n]=e.slice(0,-1).split(`(`);if(t===`drop-shadow`)return e;let[r]=n.match(un)||[];if(!r)return e;let i=n.replace(r,``),a=+!!Xi.has(t);return r!==n&&(a*=100),t+`(`+a+i+`)`}var Qi=/\b([a-z-]*)\(.*?\)/gu,$i={...Vn,getAnimatableNone:e=>{let t=e.match(Qi);return t?t.map(Zi).join(` `):e}},ea={...on,transform:Math.round},ta={borderWidth:J,borderTopWidth:J,borderRightWidth:J,borderBottomWidth:J,borderLeftWidth:J,borderRadius:J,radius:J,borderTopLeftRadius:J,borderTopRightRadius:J,borderBottomRightRadius:J,borderBottomLeftRadius:J,width:J,maxWidth:J,height:J,maxHeight:J,top:J,right:J,bottom:J,left:J,inset:J,insetBlock:J,insetBlockStart:J,insetBlockEnd:J,insetInline:J,insetInlineStart:J,insetInlineEnd:J,padding:J,paddingTop:J,paddingRight:J,paddingBottom:J,paddingLeft:J,paddingBlock:J,paddingBlockStart:J,paddingBlockEnd:J,paddingInline:J,paddingInlineStart:J,paddingInlineEnd:J,margin:J,marginTop:J,marginRight:J,marginBottom:J,marginLeft:J,marginBlock:J,marginBlockStart:J,marginBlockEnd:J,marginInline:J,marginInlineStart:J,marginInlineEnd:J,backgroundPositionX:J,backgroundPositionY:J,rotate:xn,rotateX:xn,rotateY:xn,rotateZ:xn,scale:cn,scaleX:cn,scaleY:cn,scaleZ:cn,skew:xn,skewX:xn,skewY:xn,distance:J,translateX:J,translateY:J,translateZ:J,x:J,y:J,z:J,perspective:J,transformPerspective:J,opacity:sn,originX:Tn,originY:Tn,originZ:J,zIndex:ea,fillOpacity:sn,strokeOpacity:sn,numOctaves:ea},na={...ta,color:Dn,backgroundColor:Dn,outlineColor:Dn,fill:Dn,stroke:Dn,borderColor:Dn,borderTopColor:Dn,borderRightColor:Dn,borderBottomColor:Dn,borderLeftColor:Dn,filter:$i,WebkitFilter:$i},ra=e=>na[e];function ia(e,t){let n=ra(e);return n!==$i&&(n=Vn),n.getAnimatableNone?n.getAnimatableNone(t):void 0}var aa=new Set([`auto`,`none`,`0`]);function oa(e,t,n){let r=0,i;for(;r<e.length&&!i;){let t=e[r];typeof t==`string`&&!aa.has(t)&&In(t).values.length&&(i=e[r]),r++}if(i&&n)for(let r of t)e[r]=ia(n,i)}var sa=class extends fi{constructor(e,t,n,r,i){super(e,t,n,r,i,!0)}readKeyframes(){let{unresolvedKeyframes:e,element:t,name:n}=this;if(!t||!t.current)return;super.readKeyframes();for(let n=0;n<e.length;n++){let r=e[n];if(typeof r==`string`&&(r=r.trim(),nn(r))){let i=Hi(r,t.current);i!==void 0&&(e[n]=i),n===e.length-1&&(this.finalKeyframe=r)}}if(this.resolveNoneKeyframes(),!Wi.has(n)||e.length!==2)return;let[r,i]=e,a=Ji(r),o=Ji(i);if(an(r)!==an(i)&&ii[n]){this.needsMeasurement=!0;return}if(a!==o)if(ei(a)&&ei(o))for(let t=0;t<e.length;t++){let n=e[t];typeof n==`string`&&(e[t]=parseFloat(n))}else ii[n]&&(this.needsMeasurement=!0)}resolveNoneKeyframes(){let{unresolvedKeyframes:e,name:t}=this,n=[];for(let t=0;t<e.length;t++)(e[t]===null||Yi(e[t]))&&n.push(t);n.length&&oa(e,n,t)}measureInitialState(){let{element:e,unresolvedKeyframes:t,name:n}=this;if(!e||!e.current)return;n===`height`&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=ii[n](e.measureViewportBox(),window.getComputedStyle(e.current)),t[0]=this.measuredOrigin;let r=t[t.length-1];r!==void 0&&e.getValue(n,r).jump(r,!1)}measureEndState(){let{element:e,name:t,unresolvedKeyframes:n}=this;if(!e||!e.current)return;let r=e.getValue(t);r&&r.jump(this.measuredOrigin,!1);let i=n.length-1,a=n[i];n[i]=ii[t](e.measureViewportBox(),window.getComputedStyle(e.current)),a!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=a),this.removedTransforms?.length&&this.removedTransforms.forEach(([t,n])=>{e.getValue(t).set(n)}),this.resolveNoneKeyframes()}};function ca(e,t,n){if(e instanceof EventTarget)return[e];if(typeof e==`string`){let r=document;t&&(r=t.current);let i=n?.[e]??r.querySelectorAll(e);return i?Array.from(i):[]}return Array.from(e)}var la=(e,t)=>t&&typeof e==`number`?t.transform(e):e;function ua(e){return st(e)&&`offsetHeight`in e}var da=30,fa=e=>!isNaN(parseFloat(e)),pa={current:void 0},ma=class{constructor(e,t={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=e=>{let t=Zt.now();if(this.updatedAt!==t&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(e),this.current!==this.prev&&(this.events.change?.notify(this.current),this.dependents))for(let e of this.dependents)e.dirty()},this.hasAnimated=!1,this.setCurrent(e),this.owner=t.owner}setCurrent(e){this.current=e,this.updatedAt=Zt.now(),this.canTrackVelocity===null&&e!==void 0&&(this.canTrackVelocity=fa(this.current))}setPrevFrameValue(e=this.current){this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt}onChange(e){return this.on(`change`,e)}on(e,t){this.events[e]||(this.events[e]=new mt);let n=this.events[e].add(t);return e===`change`?()=>{n(),Gt.read(()=>{this.events.change.getSize()||this.stop()})}:n}clearListeners(){for(let e in this.events)this.events[e].clear()}attach(e,t){this.passiveEffect=e,this.stopPassiveEffect=t}set(e){this.passiveEffect?this.passiveEffect(e,this.updateAndNotify):this.updateAndNotify(e)}setWithVelocity(e,t,n){this.set(t),this.prev=void 0,this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt-n}jump(e,t=!0){this.updateAndNotify(e),this.prev=e,this.prevUpdatedAt=this.prevFrameValue=void 0,t&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}dirty(){this.events.change?.notify(this.current)}addDependent(e){this.dependents||=new Set,this.dependents.add(e)}removeDependent(e){this.dependents&&this.dependents.delete(e)}get(){return pa.current&&pa.current.push(this),this.current}getPrevious(){return this.prev}getVelocity(){let e=Zt.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||e-this.updatedAt>da)return 0;let t=Math.min(this.updatedAt-this.prevUpdatedAt,da);return _t(parseFloat(this.current)-parseFloat(this.prevFrameValue),t)}start(e){return this.stop(),new Promise(t=>{this.hasAnimated=!0,this.animation=e(t),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.dependents?.clear(),this.events.destroy?.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}};function ha(e,t){return new ma(e,t)}var{schedule:ga,cancel:_a}=Wt(queueMicrotask,!1),va={x:!1,y:!1};function ya(){return va.x||va.y}function ba(e){return e===`x`||e===`y`?va[e]?null:(va[e]=!0,()=>{va[e]=!1}):va.x||va.y?null:(va.x=va.y=!0,()=>{va.x=va.y=!1})}function xa(e,t){let n=ca(e),r=new AbortController;return[n,{passive:!0,...t,signal:r.signal},()=>r.abort()]}function Sa(e){return!(e.pointerType===`touch`||ya())}function Ca(e,t,n={}){let[r,i,a]=xa(e,n),o=e=>{if(!Sa(e))return;let{target:n}=e,r=t(n,e);if(typeof r!=`function`||!n)return;let a=e=>{Sa(e)&&(r(e),n.removeEventListener(`pointerleave`,a))};n.addEventListener(`pointerleave`,a,i)};return r.forEach(e=>{e.addEventListener(`pointerenter`,o,i)}),a}var wa=(e,t)=>t?e===t?!0:wa(e,t.parentElement):!1,Ta=e=>e.pointerType===`mouse`?typeof e.button!=`number`||e.button<=0:e.isPrimary!==!1,Ea=new Set([`BUTTON`,`INPUT`,`SELECT`,`TEXTAREA`,`A`]);function Da(e){return Ea.has(e.tagName)||e.isContentEditable===!0}var Oa=new WeakSet;function ka(e){return t=>{t.key===`Enter`&&e(t)}}function Aa(e,t){e.dispatchEvent(new PointerEvent(`pointer`+t,{isPrimary:!0,bubbles:!0}))}var ja=(e,t)=>{let n=e.currentTarget;if(!n)return;let r=ka(()=>{if(Oa.has(n))return;Aa(n,`down`);let e=ka(()=>{Aa(n,`up`)});n.addEventListener(`keyup`,e,t),n.addEventListener(`blur`,()=>Aa(n,`cancel`),t)});n.addEventListener(`keydown`,r,t),n.addEventListener(`blur`,()=>n.removeEventListener(`keydown`,r),t)};function Ma(e){return Ta(e)&&!ya()}function Na(e,t,n={}){let[r,i,a]=xa(e,n),o=e=>{let r=e.currentTarget;if(!Ma(e))return;Oa.add(r);let a=t(r,e),o=(e,t)=>{window.removeEventListener(`pointerup`,s),window.removeEventListener(`pointercancel`,c),Oa.has(r)&&Oa.delete(r),Ma(e)&&typeof a==`function`&&a(e,{success:t})},s=e=>{o(e,r===window||r===document||n.useGlobalTarget||wa(r,e.target))},c=e=>{o(e,!1)};window.addEventListener(`pointerup`,s,i),window.addEventListener(`pointercancel`,c,i)};return r.forEach(e=>{(n.useGlobalTarget?window:e).addEventListener(`pointerdown`,o,i),ua(e)&&(e.addEventListener(`focus`,e=>ja(e,i)),!Da(e)&&!e.hasAttribute(`tabindex`)&&(e.tabIndex=0))}),a}function Pa(e){return st(e)&&`ownerSVGElement`in e}function Fa(e){return Pa(e)&&e.tagName===`svg`}var Ia=e=>!!(e&&e.getVelocity),La=[...qi,Dn,Vn],Ra=e=>La.find(Ki(e)),za=(0,x.createContext)({transformPagePoint:e=>e,isStatic:!1,reducedMotion:`never`});function Ba(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}function Va(...e){return t=>{let n=!1,r=e.map(e=>{let r=Ba(e,t);return!n&&typeof r==`function`&&(n=!0),r});if(n)return()=>{for(let t=0;t<r.length;t++){let n=r[t];typeof n==`function`?n():Ba(e[t],null)}}}}function Ha(...e){return x.useCallback(Va(...e),e)}var Ua=class extends x.Component{getSnapshotBeforeUpdate(e){let t=this.props.childRef.current;if(t&&e.isPresent&&!this.props.isPresent){let e=t.offsetParent,n=ua(e)&&e.offsetWidth||0,r=this.props.sizeRef.current;r.height=t.offsetHeight||0,r.width=t.offsetWidth||0,r.top=t.offsetTop,r.left=t.offsetLeft,r.right=n-r.width-r.left}return null}componentDidUpdate(){}render(){return this.props.children}};function Wa({children:e,isPresent:t,anchorX:n,root:r}){let i=(0,x.useId)(),a=(0,x.useRef)(null),o=(0,x.useRef)({width:0,height:0,top:0,left:0,right:0}),{nonce:s}=(0,x.useContext)(za),c=Ha(a,e.props?.ref??e?.ref);return(0,x.useInsertionEffect)(()=>{let{width:e,height:c,top:l,left:u,right:d}=o.current;if(t||!a.current||!e||!c)return;let f=n===`left`?`left: ${u}`:`right: ${d}`;a.current.dataset.motionPopId=i;let p=document.createElement(`style`);s&&(p.nonce=s);let m=r??document.head;return m.appendChild(p),p.sheet&&p.sheet.insertRule(`
9
9
  [data-motion-pop-id="${i}"] {
10
10
  position: absolute !important;
11
11
  width: ${e}px !important;
@@ -48,7 +48,7 @@ Error generating stack: `+e.message+`
48
48
  `))}function c(e,t,n,r){let i=n.enter(`tableCell`),o=n.enter(`phrasing`),s=n.containerPhrasing(e,{...r,before:a,after:a});return o(),i(),s}function l(e,t){return eC(e,{align:t,alignDelimiters:r,padding:n,stringLength:i})}function u(e,t,n){let r=e.children,i=-1,a=[],o=t.enter(`table`);for(;++i<r.length;)a[i]=d(r[i],t,n);return o(),a}function d(e,t,n){let r=e.children,i=-1,a=[],o=t.enter(`tableRow`);for(;++i<r.length;)a[i]=c(r[i],e,t,n);return o(),a}function f(e,t,n){let r=ZC.inlineCode(e,t,n);return n.stack.includes(`tableCell`)&&(r=r.replace(/\|/g,`\\$&`)),r}}function sw(){return{exit:{taskListCheckValueChecked:lw,taskListCheckValueUnchecked:lw,paragraph:uw}}}function cw(){return{unsafe:[{atBreak:!0,character:`-`,after:`[:|-]`}],handlers:{listItem:dw}}}function lw(e){let t=this.stack[this.stack.length-2];t.type,t.checked=e.type===`taskListCheckValueChecked`}function uw(e){let t=this.stack[this.stack.length-2];if(t&&t.type===`listItem`&&typeof t.checked==`boolean`){let e=this.stack[this.stack.length-1];e.type;let n=e.children[0];if(n&&n.type===`text`){let r=t.children,i=-1,a;for(;++i<r.length;){let e=r[i];if(e.type===`paragraph`){a=e;break}}a===e&&(n.value=n.value.slice(1),n.value.length===0?e.children.shift():e.position&&n.position&&typeof n.position.start.offset==`number`&&(n.position.start.column++,n.position.start.offset++,e.position.start=Object.assign({},n.position.start)))}}this.exit(e)}function dw(e,t,n,r){let i=e.children[0],a=typeof e.checked==`boolean`&&i&&i.type===`paragraph`,o=`[`+(e.checked?`x`:` `)+`] `,s=n.createTracker(r);a&&s.move(o);let c=ZC.listItem(e,t,n,{...r,...s.current()});return a&&(c=c.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,l)),c;function l(e){return e+o}}function fw(){return[vS(),HS(),qS(),QC(),sw()]}function pw(e){return{extensions:[yS(),US(e),JS(),ow(e),cw()]}}var mw={tokenize:Ow,partial:!0},hw={tokenize:kw,partial:!0},gw={tokenize:Aw,partial:!0},_w={tokenize:jw,partial:!0},vw={tokenize:Mw,partial:!0},yw={name:`wwwAutolink`,tokenize:Ew,previous:Nw},bw={name:`protocolAutolink`,tokenize:Dw,previous:Pw},xw={name:`emailAutolink`,tokenize:Tw,previous:Fw},Sw={};function Cw(){return{text:Sw}}for(var ww=48;ww<123;)Sw[ww]=xw,ww++,ww===58?ww=65:ww===91&&(ww=97);Sw[43]=xw,Sw[45]=xw,Sw[46]=xw,Sw[95]=xw,Sw[72]=[xw,bw],Sw[104]=[xw,bw],Sw[87]=[xw,yw],Sw[119]=[xw,yw];function Tw(e,t,n){let r=this,i,a;return o;function o(t){return!Iw(t)||!Fw.call(r,r.previous)||Lw(r.events)?n(t):(e.enter(`literalAutolink`),e.enter(`literalAutolinkEmail`),s(t))}function s(t){return Iw(t)?(e.consume(t),s):t===64?(e.consume(t),c):n(t)}function c(t){return t===46?e.check(vw,u,l)(t):t===45||t===95||v_(t)?(a=!0,e.consume(t),c):u(t)}function l(t){return e.consume(t),i=!0,c}function u(o){return a&&i&&__(r.previous)?(e.exit(`literalAutolinkEmail`),e.exit(`literalAutolink`),t(o)):n(o)}}function Ew(e,t,n){let r=this;return i;function i(t){return t!==87&&t!==119||!Nw.call(r,r.previous)||Lw(r.events)?n(t):(e.enter(`literalAutolink`),e.enter(`literalAutolinkWww`),e.check(mw,e.attempt(hw,e.attempt(gw,a),n),n)(t))}function a(n){return e.exit(`literalAutolinkWww`),e.exit(`literalAutolink`),t(n)}}function Dw(e,t,n){let r=this,i=``,a=!1;return o;function o(t){return(t===72||t===104)&&Pw.call(r,r.previous)&&!Lw(r.events)?(e.enter(`literalAutolink`),e.enter(`literalAutolinkHttp`),i+=String.fromCodePoint(t),e.consume(t),s):n(t)}function s(t){if(__(t)&&i.length<5)return i+=String.fromCodePoint(t),e.consume(t),s;if(t===58){let n=i.toLowerCase();if(n===`http`||n===`https`)return e.consume(t),c}return n(t)}function c(t){return t===47?(e.consume(t),a?l:(a=!0,c)):n(t)}function l(t){return t===null||b_(t)||w_(t)||D_(t)||E_(t)?n(t):e.attempt(hw,e.attempt(gw,u),n)(t)}function u(n){return e.exit(`literalAutolinkHttp`),e.exit(`literalAutolink`),t(n)}}function Ow(e,t,n){let r=0;return i;function i(t){return(t===87||t===119)&&r<3?(r++,e.consume(t),i):t===46&&r===3?(e.consume(t),a):n(t)}function a(e){return e===null?n(e):t(e)}}function kw(e,t,n){let r,i,a;return o;function o(t){return t===46||t===95?e.check(_w,c,s)(t):t===null||w_(t)||D_(t)||t!==45&&E_(t)?c(t):(a=!0,e.consume(t),o)}function s(t){return t===95?r=!0:(i=r,r=void 0),e.consume(t),o}function c(e){return i||r||!a?n(e):t(e)}}function Aw(e,t){let n=0,r=0;return i;function i(o){return o===40?(n++,e.consume(o),i):o===41&&r<n?a(o):o===33||o===34||o===38||o===39||o===41||o===42||o===44||o===46||o===58||o===59||o===60||o===63||o===93||o===95||o===126?e.check(_w,t,a)(o):o===null||w_(o)||D_(o)?t(o):(e.consume(o),i)}function a(t){return t===41&&r++,e.consume(t),i}}function jw(e,t,n){return r;function r(o){return o===33||o===34||o===39||o===41||o===42||o===44||o===46||o===58||o===59||o===63||o===95||o===126?(e.consume(o),r):o===38?(e.consume(o),a):o===93?(e.consume(o),i):o===60||o===null||w_(o)||D_(o)?t(o):n(o)}function i(e){return e===null||e===40||e===91||w_(e)||D_(e)?t(e):r(e)}function a(e){return __(e)?o(e):n(e)}function o(t){return t===59?(e.consume(t),r):__(t)?(e.consume(t),o):n(t)}}function Mw(e,t,n){return r;function r(t){return e.consume(t),i}function i(e){return v_(e)?n(e):t(e)}}function Nw(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||w_(e)}function Pw(e){return!__(e)}function Fw(e){return!(e===47||Iw(e))}function Iw(e){return e===43||e===45||e===46||e===95||v_(e)}function Lw(e){let t=e.length,n=!1;for(;t--;){let r=e[t][1];if((r.type===`labelLink`||r.type===`labelImage`)&&!r._balanced){n=!0;break}if(r._gfmAutolinkLiteralWalkedInto){n=!1;break}}return e.length>0&&!n&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}var Rw={tokenize:Kw,partial:!0};function zw(){return{document:{91:{name:`gfmFootnoteDefinition`,tokenize:Uw,continuation:{tokenize:Ww},exit:Gw}},text:{91:{name:`gfmFootnoteCall`,tokenize:Hw},93:{name:`gfmPotentialFootnoteCall`,add:`after`,tokenize:Bw,resolveTo:Vw}}}}function Bw(e,t,n){let r=this,i=r.events.length,a=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]),o;for(;i--;){let e=r.events[i][1];if(e.type===`labelImage`){o=e;break}if(e.type===`gfmFootnoteCall`||e.type===`labelLink`||e.type===`label`||e.type===`image`||e.type===`link`)break}return s;function s(i){if(!o||!o._balanced)return n(i);let s=g_(r.sliceSerialize({start:o.end,end:r.now()}));return s.codePointAt(0)!==94||!a.includes(s.slice(1))?n(i):(e.enter(`gfmFootnoteCallLabelMarker`),e.consume(i),e.exit(`gfmFootnoteCallLabelMarker`),t(i))}}function Vw(e,t){let n=e.length;for(;n--;)if(e[n][1].type===`labelImage`&&e[n][0]===`enter`){e[n][1];break}e[n+1][1].type=`data`,e[n+3][1].type=`gfmFootnoteCallLabelMarker`;let r={type:`gfmFootnoteCall`,start:Object.assign({},e[n+3][1].start),end:Object.assign({},e[e.length-1][1].end)},i={type:`gfmFootnoteCallMarker`,start:Object.assign({},e[n+3][1].end),end:Object.assign({},e[n+3][1].end)};i.end.column++,i.end.offset++,i.end._bufferIndex++;let a={type:`gfmFootnoteCallString`,start:Object.assign({},i.end),end:Object.assign({},e[e.length-1][1].start)},o={type:`chunkString`,contentType:`string`,start:Object.assign({},a.start),end:Object.assign({},a.end)},s=[e[n+1],e[n+2],[`enter`,r,t],e[n+3],e[n+4],[`enter`,i,t],[`exit`,i,t],[`enter`,a,t],[`enter`,o,t],[`exit`,o,t],[`exit`,a,t],e[e.length-2],e[e.length-1],[`exit`,r,t]];return e.splice(n,e.length-n+1,...s),e}function Hw(e,t,n){let r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]),a=0,o;return s;function s(t){return e.enter(`gfmFootnoteCall`),e.enter(`gfmFootnoteCallLabelMarker`),e.consume(t),e.exit(`gfmFootnoteCallLabelMarker`),c}function c(t){return t===94?(e.enter(`gfmFootnoteCallMarker`),e.consume(t),e.exit(`gfmFootnoteCallMarker`),e.enter(`gfmFootnoteCallString`),e.enter(`chunkString`).contentType=`string`,l):n(t)}function l(s){if(a>999||s===93&&!o||s===null||s===91||w_(s))return n(s);if(s===93){e.exit(`chunkString`);let a=e.exit(`gfmFootnoteCallString`);return i.includes(g_(r.sliceSerialize(a)))?(e.enter(`gfmFootnoteCallLabelMarker`),e.consume(s),e.exit(`gfmFootnoteCallLabelMarker`),e.exit(`gfmFootnoteCall`),t):n(s)}return w_(s)||(o=!0),a++,e.consume(s),s===92?u:l}function u(t){return t===91||t===92||t===93?(e.consume(t),a++,l):l(t)}}function Uw(e,t,n){let r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]),a,o=0,s;return c;function c(t){return e.enter(`gfmFootnoteDefinition`)._container=!0,e.enter(`gfmFootnoteDefinitionLabel`),e.enter(`gfmFootnoteDefinitionLabelMarker`),e.consume(t),e.exit(`gfmFootnoteDefinitionLabelMarker`),l}function l(t){return t===94?(e.enter(`gfmFootnoteDefinitionMarker`),e.consume(t),e.exit(`gfmFootnoteDefinitionMarker`),e.enter(`gfmFootnoteDefinitionLabelString`),e.enter(`chunkString`).contentType=`string`,u):n(t)}function u(t){if(o>999||t===93&&!s||t===null||t===91||w_(t))return n(t);if(t===93){e.exit(`chunkString`);let n=e.exit(`gfmFootnoteDefinitionLabelString`);return a=g_(r.sliceSerialize(n)),e.enter(`gfmFootnoteDefinitionLabelMarker`),e.consume(t),e.exit(`gfmFootnoteDefinitionLabelMarker`),e.exit(`gfmFootnoteDefinitionLabel`),f}return w_(t)||(s=!0),o++,e.consume(t),t===92?d:u}function d(t){return t===91||t===92||t===93?(e.consume(t),o++,u):u(t)}function f(t){return t===58?(e.enter(`definitionMarker`),e.consume(t),e.exit(`definitionMarker`),i.includes(a)||i.push(a),A_(e,p,`gfmFootnoteDefinitionWhitespace`)):n(t)}function p(e){return t(e)}}function Ww(e,t,n){return e.check(G_,t,e.attempt(Rw,t,n))}function Gw(e){e.exit(`gfmFootnoteDefinition`)}function Kw(e,t,n){let r=this;return A_(e,i,`gfmFootnoteDefinitionIndent`,5);function i(e){let i=r.events[r.events.length-1];return i&&i[1].type===`gfmFootnoteDefinitionIndent`&&i[2].sliceSerialize(i[1],!0).length===4?t(e):n(e)}}function qw(e){let t=(e||{}).singleTilde,n={name:`strikethrough`,tokenize:i,resolveAll:r};return t??=!0,{text:{126:n},insideSpan:{null:[n]},attentionMarkers:{null:[126]}};function r(e,t){let n=-1;for(;++n<e.length;)if(e[n][0]===`enter`&&e[n][1].type===`strikethroughSequenceTemporary`&&e[n][1]._close){let r=n;for(;r--;)if(e[r][0]===`exit`&&e[r][1].type===`strikethroughSequenceTemporary`&&e[r][1]._open&&e[n][1].end.offset-e[n][1].start.offset===e[r][1].end.offset-e[r][1].start.offset){e[n][1].type=`strikethroughSequence`,e[r][1].type=`strikethroughSequence`;let i={type:`strikethrough`,start:Object.assign({},e[r][1].start),end:Object.assign({},e[n][1].end)},a={type:`strikethroughText`,start:Object.assign({},e[r][1].end),end:Object.assign({},e[n][1].start)},o=[[`enter`,i,t],[`enter`,e[r][1],t],[`exit`,e[r][1],t],[`enter`,a,t]],s=t.parser.constructs.insideSpan.null;s&&l_(o,o.length,0,R_(s,e.slice(r+1,n),t)),l_(o,o.length,0,[[`exit`,a,t],[`enter`,e[n][1],t],[`exit`,e[n][1],t],[`exit`,i,t]]),l_(e,r-1,n-r+3,o),n=r+o.length-2;break}}for(n=-1;++n<e.length;)e[n][1].type===`strikethroughSequenceTemporary`&&(e[n][1].type=`data`);return e}function i(e,n,r){let i=this.previous,a=this.events,o=0;return s;function s(t){return i===126&&a[a.length-1][1].type!==`characterEscape`?r(t):(e.enter(`strikethroughSequenceTemporary`),c(t))}function c(a){let s=L_(i);if(a===126)return o>1?r(a):(e.consume(a),o++,c);if(o<2&&!t)return r(a);let l=e.exit(`strikethroughSequenceTemporary`),u=L_(a);return l._open=!u||u===2&&!!s,l._close=!s||s===2&&!!u,n(a)}}}var Jw=class{constructor(){this.map=[]}add(e,t,n){Yw(this,e,t,n)}consume(e){if(this.map.sort(function(e,t){return e[0]-t[0]}),this.map.length===0)return;let t=this.map.length,n=[];for(;t>0;)--t,n.push(e.slice(this.map[t][0]+this.map[t][1]),this.map[t][2]),e.length=this.map[t][0];n.push(e.slice()),e.length=0;let r=n.pop();for(;r;){for(let t of r)e.push(t);r=n.pop()}this.map.length=0}};function Yw(e,t,n,r){let i=0;if(!(n===0&&r.length===0)){for(;i<e.map.length;){if(e.map[i][0]===t){e.map[i][1]+=n,e.map[i][2].push(...r);return}i+=1}e.map.push([t,n,r])}}function Xw(e,t){let n=!1,r=[];for(;t<e.length;){let i=e[t];if(n){if(i[0]===`enter`)i[1].type===`tableContent`&&r.push(e[t+1][1].type===`tableDelimiterMarker`?`left`:`none`);else if(i[1].type===`tableContent`){if(e[t-1][1].type===`tableDelimiterMarker`){let e=r.length-1;r[e]=r[e]===`left`?`center`:`right`}}else if(i[1].type===`tableDelimiterRow`)break}else i[0]===`enter`&&i[1].type===`tableDelimiterRow`&&(n=!0);t+=1}return r}function Zw(){return{flow:{null:{name:`table`,tokenize:Qw,resolveAll:$w}}}}function Qw(e,t,n){let r=this,i=0,a=0,o;return s;function s(e){let t=r.events.length-1;for(;t>-1;){let e=r.events[t][1].type;if(e===`lineEnding`||e===`linePrefix`)t--;else break}let i=t>-1?r.events[t][1].type:null,a=i===`tableHead`||i===`tableRow`?S:c;return a===S&&r.parser.lazy[r.now().line]?n(e):a(e)}function c(t){return e.enter(`tableHead`),e.enter(`tableRow`),l(t)}function l(e){return e===124?u(e):(o=!0,a+=1,u(e))}function u(t){return t===null?n(t):Z(t)?a>1?(a=0,r.interrupt=!0,e.exit(`tableRow`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),p):n(t):T_(t)?A_(e,u,`whitespace`)(t):(a+=1,o&&(o=!1,i+=1),t===124?(e.enter(`tableCellDivider`),e.consume(t),e.exit(`tableCellDivider`),o=!0,u):(e.enter(`data`),d(t)))}function d(t){return t===null||t===124||w_(t)?(e.exit(`data`),u(t)):(e.consume(t),t===92?f:d)}function f(t){return t===92||t===124?(e.consume(t),d):d(t)}function p(t){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(t):(e.enter(`tableDelimiterRow`),o=!1,T_(t)?A_(e,m,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):m(t))}function m(t){return t===45||t===58?g(t):t===124?(o=!0,e.enter(`tableCellDivider`),e.consume(t),e.exit(`tableCellDivider`),h):x(t)}function h(t){return T_(t)?A_(e,g,`whitespace`)(t):g(t)}function g(t){return t===58?(a+=1,o=!0,e.enter(`tableDelimiterMarker`),e.consume(t),e.exit(`tableDelimiterMarker`),_):t===45?(a+=1,_(t)):t===null||Z(t)?b(t):x(t)}function _(t){return t===45?(e.enter(`tableDelimiterFiller`),v(t)):x(t)}function v(t){return t===45?(e.consume(t),v):t===58?(o=!0,e.exit(`tableDelimiterFiller`),e.enter(`tableDelimiterMarker`),e.consume(t),e.exit(`tableDelimiterMarker`),y):(e.exit(`tableDelimiterFiller`),y(t))}function y(t){return T_(t)?A_(e,b,`whitespace`)(t):b(t)}function b(n){return n===124?m(n):n===null||Z(n)?!o||i!==a?x(n):(e.exit(`tableDelimiterRow`),e.exit(`tableHead`),t(n)):x(n)}function x(e){return n(e)}function S(t){return e.enter(`tableRow`),C(t)}function C(n){return n===124?(e.enter(`tableCellDivider`),e.consume(n),e.exit(`tableCellDivider`),C):n===null||Z(n)?(e.exit(`tableRow`),t(n)):T_(n)?A_(e,C,`whitespace`)(n):(e.enter(`data`),w(n))}function w(t){return t===null||t===124||w_(t)?(e.exit(`data`),C(t)):(e.consume(t),t===92?T:w)}function T(t){return t===92||t===124?(e.consume(t),w):w(t)}}function $w(e,t){let n=-1,r=!0,i=0,a=[0,0,0,0],o=[0,0,0,0],s=!1,c=0,l,u,d,f=new Jw;for(;++n<e.length;){let p=e[n],m=p[1];p[0]===`enter`?m.type===`tableHead`?(s=!1,c!==0&&(tT(f,t,c,l,u),u=void 0,c=0),l={type:`table`,start:Object.assign({},m.start),end:Object.assign({},m.end)},f.add(n,0,[[`enter`,l,t]])):m.type===`tableRow`||m.type===`tableDelimiterRow`?(r=!0,d=void 0,a=[0,0,0,0],o=[0,n+1,0,0],s&&(s=!1,u={type:`tableBody`,start:Object.assign({},m.start),end:Object.assign({},m.end)},f.add(n,0,[[`enter`,u,t]])),i=m.type===`tableDelimiterRow`?2:u?3:1):i&&(m.type===`data`||m.type===`tableDelimiterMarker`||m.type===`tableDelimiterFiller`)?(r=!1,o[2]===0&&(a[1]!==0&&(o[0]=o[1],d=eT(f,t,a,i,void 0,d),a=[0,0,0,0]),o[2]=n)):m.type===`tableCellDivider`&&(r?r=!1:(a[1]!==0&&(o[0]=o[1],d=eT(f,t,a,i,void 0,d)),a=o,o=[a[1],n,0,0])):m.type===`tableHead`?(s=!0,c=n):m.type===`tableRow`||m.type===`tableDelimiterRow`?(c=n,a[1]===0?o[1]!==0&&(d=eT(f,t,o,i,n,d)):(o[0]=o[1],d=eT(f,t,a,i,n,d)),i=0):i&&(m.type===`data`||m.type===`tableDelimiterMarker`||m.type===`tableDelimiterFiller`)&&(o[3]=n)}for(c!==0&&tT(f,t,c,l,u),f.consume(t.events),n=-1;++n<t.events.length;){let e=t.events[n];e[0]===`enter`&&e[1].type===`table`&&(e[1]._align=Xw(t.events,n))}return e}function eT(e,t,n,r,i,a){let o=r===1?`tableHeader`:r===2?`tableDelimiter`:`tableData`;n[0]!==0&&(a.end=Object.assign({},nT(t.events,n[0])),e.add(n[0],0,[[`exit`,a,t]]));let s=nT(t.events,n[1]);if(a={type:o,start:Object.assign({},s),end:Object.assign({},s)},e.add(n[1],0,[[`enter`,a,t]]),n[2]!==0){let i=nT(t.events,n[2]),a=nT(t.events,n[3]),o={type:`tableContent`,start:Object.assign({},i),end:Object.assign({},a)};if(e.add(n[2],0,[[`enter`,o,t]]),r!==2){let r=t.events[n[2]],i=t.events[n[3]];if(r[1].end=Object.assign({},i[1].end),r[1].type=`chunkText`,r[1].contentType=`text`,n[3]>n[2]+1){let t=n[2]+1,r=n[3]-n[2]-1;e.add(t,r,[])}}e.add(n[3]+1,0,[[`exit`,o,t]])}return i!==void 0&&(a.end=Object.assign({},nT(t.events,i)),e.add(i,0,[[`exit`,a,t]]),a=void 0),a}function tT(e,t,n,r,i){let a=[],o=nT(t.events,n);i&&(i.end=Object.assign({},o),a.push([`exit`,i,t])),r.end=Object.assign({},o),a.push([`exit`,r,t]),e.add(n+1,0,a)}function nT(e,t){let n=e[t],r=n[0]===`enter`?`start`:`end`;return n[1][r]}var rT={name:`tasklistCheck`,tokenize:aT};function iT(){return{text:{91:rT}}}function aT(e,t,n){let r=this;return i;function i(t){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?n(t):(e.enter(`taskListCheck`),e.enter(`taskListCheckMarker`),e.consume(t),e.exit(`taskListCheckMarker`),a)}function a(t){return w_(t)?(e.enter(`taskListCheckValueUnchecked`),e.consume(t),e.exit(`taskListCheckValueUnchecked`),o):t===88||t===120?(e.enter(`taskListCheckValueChecked`),e.consume(t),e.exit(`taskListCheckValueChecked`),o):n(t)}function o(t){return t===93?(e.enter(`taskListCheckMarker`),e.consume(t),e.exit(`taskListCheckMarker`),e.exit(`taskListCheck`),s):n(t)}function s(r){return Z(r)?t(r):T_(r)?e.check({tokenize:oT},t,n)(r):n(r)}}function oT(e,t,n){return A_(e,r,`whitespace`);function r(e){return e===null?n(e):t(e)}}function sT(e){return f_([Cw(),zw(),qw(e),Zw(),iT()])}var cT={};function lT(e){let t=this,n=e||cT,r=t.data(),i=r.micromarkExtensions||=[],a=r.fromMarkdownExtensions||=[],o=r.toMarkdownExtensions||=[];i.push(sT(n)),a.push(fw()),o.push(pw(n))}function uT(e){fS(e,[/\r?\n|\r/g,dT])}function dT(){return{type:`break`}}function fT(){return function(e){uT(e)}}var pT=1e4,mT=200;function hT(e){let t=oh(e.payload),n=oh(e.message),r=sh(e.timestamp)??sh(t?.timestamp)??sh(n?.timestamp)??sh(e.created_at)??sh(t?.created_at)??sh(e.createdAt)??sh(t?.createdAt);return r&&!Number.isNaN(Date.parse(r))?r:null}function gT(e){if(!e)return null;let t=new Date(e);if(Number.isNaN(t.getTime()))return null;let n=new Date,r=t.toDateString()===n.toDateString(),i=t.getFullYear()===n.getFullYear(),a=r?{hour:`numeric`,minute:`2-digit`}:i?{month:`short`,day:`numeric`,hour:`numeric`,minute:`2-digit`}:{month:`short`,day:`numeric`,year:`numeric`,hour:`numeric`,minute:`2-digit`};return new Intl.DateTimeFormat(void 0,a).format(t)}function _T(e){if(e==null)return``;if(typeof e==`string`)return e;try{return JSON.stringify(e,null,2)}catch{return String(e)}}function vT(e){if(typeof e==`string`)return e;if(Array.isArray(e))return e.map(e=>{if(typeof e==`string`)return e;let t=oh(e);if(!t)return``;let n=sh(t.type);return n===`thinking`?``:n===`tool_use`?`[Tool: ${sh(t.name)??`tool`}]`:(sh(t.text)??sh(t.content)??sh(t.output))||``}).filter(Boolean).join(`
49
49
 
50
50
  `);let t=oh(e);if(!t)return _T(e);let n=sh(t.type);return n===`thinking`?``:n===`tool_use`?`[Tool: ${sh(t.name)??`tool`}]`:vT(t.content)||vT(t.message)||(sh(t.text)??sh(t.output)??``)}function yT(e){let t=dh(e);if(t===`pi`)return`pi`;let n=sh(e.type)??``,r=sh(oh(e.payload)?.type)??``;return n===`event_msg`||n===`response_item`||r?`codex`:t===`claude`||n===`tool_result`?`claude`:`log`}function bT(e,t,n,r){try{let i=JSON.parse(e),a=oh(i);if(!a)return{lineNumber:n,sourceKey:t,exactLineNumber:r,parsed:!0,raw:e,source:`json`,type:Array.isArray(i)?`array`:typeof i,prominence:`plain`,title:Array.isArray(i)?`JSON array`:`JSON value`,body:_T(i),details:[]};let o=oh(a.payload),s=oh(a.message),c=sh(a.type)??`unknown`,l=sh(o?.type),u=sh(a.role)??sh(s?.role)??sh(o?.role),d=hT(a),f=yT(a),p=xT(c,l??void 0,u??void 0),m=[l?`${c} / ${l}`:c,u].filter(Boolean),h=vT(s?.content)||vT(s?.message)||vT(o?.message)||vT(o?.content)||vT(o?.text)||sh(a.result)||sh(a.name)||vT(a.content)||vT(a.text);c===`tool_use`&&sh(a.name)&&(h=`[Tool: ${sh(a.name)}]`);let g=[{label:`uuid`,value:sh(a.uuid)??``},{label:`parent`,value:sh(a.parentUuid)??``},{label:`session`,value:sh(a.sessionId)??sh(o?.session_id)??``},{label:`cwd`,value:sh(a.cwd)??``},{label:`metadata`,value:_T(a.metadata??o?.metadata)},{label:`payload`,value:o?_T(o):``}].filter(e=>e.value);return{lineNumber:n,sourceKey:t,exactLineNumber:r,parsed:!0,raw:e,source:f,type:l?`${c}:${l}`:c,prominence:p,...u?{role:u}:{},...d?{timestamp:d}:{},title:m.join(` · `),...h?{body:h}:{},details:g}}catch{return{lineNumber:n,sourceKey:t,exactLineNumber:r,parsed:!1,raw:e,source:`text`,type:`plain`,prominence:`plain`,title:`Plain text`,body:e,details:[]}}}function xT(e,t,n){return n===`user`||n===`assistant`||e===`user`||e===`assistant`||t===`user_message`||t===`assistant_message`||t===`agent_message`||t===`message`?`message`:e===`tool_use`||e===`tool_result`||e===`result`||e.includes(`tool`)||t?.includes(`tool`)||t===`function_call`||t===`function_call_output`||t===`custom_tool_call_output`?`tool`:e===`plain`?`plain`:`system`}function ST(e){return e===`user`?`user`:e===`assistant`?`assistant`:e===`system`?`system`:e===`tool`?`tool`:`other`}function CT(e,t,n,r){let i=Ch(e);if(!i)return[];let a=i.parsed?oh(i.raw):null,o=a?hT(a):null,s=i.events.map((i,a)=>({type:ST(i.role),kind:i.kind,content:i.text.trim(),raw:e,sourceKey:t,lineNumber:n,seq:a,exactLineNumber:r,...o?{timestamp:o}:{}})).filter(e=>e.content.length>0);return s.length>0?s:!i.parsed&&e.trim()?[{type:`other`,kind:`unknown`,content:e.trim(),raw:e,sourceKey:t,lineNumber:n,seq:0,exactLineNumber:r}]:[]}function wT(e){let t=[];for(let n of e){let e=t[t.length-1];e&&n.kind===`message`&&e.kind===`message`&&n.type===e.type&&n.content===e.content||t.push(n)}return t}function TT(e){return e.kind===`tool_call`||e.kind===`result`}function ET(e){let t=[],n=null;for(let r of e)(t.length===0||!TT(r)&&r.type!==n)&&(t.push([]),TT(r)||(n=r.type)),t[t.length-1].push(r);let r=[];for(let e=t.length-1;e>=0;e--){let n=!1;for(let i of t[e]){let e=!TT(i)&&!n;e&&(n=!0),r.push({entry:i,showRole:e})}}return r}function DT(e){return`${e.sourceKey}:${e.seq}`}function OT(e,t,n){return n?t?`Line ${e+1} · ${t}`:void 0:t}function kT(e,t,n){return gT(t)||(n?`Line ${e+1}`:`Entry`)}function AT(e){return e.type===`user`?`User`:e.type===`assistant`?`Assistant`:e.type===`system`?`System`:e.type===`tool`?`Tool`:`Log`}function jT(e){return e.type===`user`?`text-blue-400`:e.type===`assistant`?`text-emerald-400`:e.type===`system`?`text-yellow-400`:`text-muted`}function MT({entry:e}){let[t,n]=(0,x.useState)(!1),r=kT(e.lineNumber,e.timestamp,e.exactLineNumber),i=e.kind===`tool_call`?e.content:`Result`;return(0,q.jsxs)(`div`,{className:`rounded-md border border-border bg-surface/40`,children:[(0,q.jsxs)(`button`,{type:`button`,className:`flex w-full items-center justify-between gap-3 px-3 py-2 text-left text-xs text-muted hover:text-primary`,onClick:()=>n(e=>!e),"aria-expanded":t,children:[(0,q.jsxs)(`span`,{className:`min-w-0 truncate`,children:[(0,q.jsx)(`span`,{className:`mr-2 text-[10px] uppercase tracking-wide text-muted`,title:OT(e.lineNumber,e.timestamp,e.exactLineNumber),children:r}),i]}),(0,q.jsx)(`span`,{className:`shrink-0 text-[11px]`,children:t?`Hide`:`Show`})]}),t&&(0,q.jsx)(`pre`,{className:`max-h-80 overflow-auto border-t border-border px-3 py-2 whitespace-pre-wrap break-words text-xs leading-relaxed text-secondary`,children:e.content})]})}var NT={p:({children:e})=>(0,q.jsx)(`p`,{className:`my-2 first:mt-0 last:mb-0`,children:e}),a:({children:e,href:t})=>(0,q.jsx)(`a`,{href:t,target:`_blank`,rel:`noreferrer noopener`,className:`text-accent underline underline-offset-2 hover:text-primary`,children:e}),ul:({children:e})=>(0,q.jsx)(`ul`,{className:`my-2 list-disc space-y-1 pl-5`,children:e}),ol:({children:e})=>(0,q.jsx)(`ol`,{className:`my-2 list-decimal space-y-1 pl-5`,children:e}),li:({children:e})=>(0,q.jsx)(`li`,{className:`leading-6`,children:e}),h1:({children:e})=>(0,q.jsx)(`h1`,{className:`mb-1 mt-3 text-base font-semibold first:mt-0`,children:e}),h2:({children:e})=>(0,q.jsx)(`h2`,{className:`mb-1 mt-3 text-sm font-semibold first:mt-0`,children:e}),h3:({children:e})=>(0,q.jsx)(`h3`,{className:`mb-1 mt-3 text-sm font-semibold first:mt-0`,children:e}),strong:({children:e})=>(0,q.jsx)(`strong`,{className:`font-semibold text-primary`,children:e}),em:({children:e})=>(0,q.jsx)(`em`,{className:`italic`,children:e}),blockquote:({children:e})=>(0,q.jsx)(`blockquote`,{className:`my-2 border-l-2 border-border pl-3 text-secondary`,children:e}),hr:()=>(0,q.jsx)(`hr`,{className:`my-3 border-border`}),pre:({children:e})=>(0,q.jsx)(`pre`,{className:`my-2 overflow-x-auto rounded bg-base p-3 text-xs leading-relaxed text-secondary`,children:e}),code:({className:e,children:t})=>{let n=String(t??``);return(e?.includes(`language-`)??!1)||n.includes(`
51
- `)?(0,q.jsx)(`code`,{className:e,children:t}):(0,q.jsx)(`code`,{className:`rounded bg-surface px-1 py-0.5 text-[0.9em] text-primary`,children:t})},table:({children:e})=>(0,q.jsx)(`div`,{className:`my-2 overflow-x-auto`,children:(0,q.jsx)(`table`,{className:`w-full border-collapse text-xs`,children:e})}),th:({children:e})=>(0,q.jsx)(`th`,{className:`border border-border px-2 py-1 text-left font-semibold`,children:e}),td:({children:e})=>(0,q.jsx)(`td`,{className:`border border-border px-2 py-1 align-top`,children:e})};function PT({content:e}){return(0,q.jsx)(`div`,{className:`min-w-0 break-words text-sm leading-6 text-primary [overflow-wrap:anywhere]`,children:(0,q.jsx)(aS,{remarkPlugins:[lT,fT],components:NT,children:e})})}function FT({entry:e,showRole:t=!0}){if(TT(e))return(0,q.jsx)(MT,{entry:e});let n=kT(e.lineNumber,e.timestamp,e.exactLineNumber);return(0,q.jsxs)(`article`,{className:`grid grid-cols-[5.75rem_minmax(0,1fr)] gap-3 pb-2 sm:grid-cols-[6.75rem_minmax(0,1fr)] ${t?`mt-4 border-t border-border/60 pt-4 first:mt-0 first:border-t-0 first:pt-0`:`pt-1`}`,children:[(0,q.jsxs)(`div`,{className:`select-none pt-0.5 text-right`,children:[t&&(0,q.jsx)(`div`,{className:`text-[11px] font-semibold uppercase tracking-wide ${jT(e)}`,children:AT(e)}),(0,q.jsx)(`div`,{className:`text-[10px] tabular-nums text-muted ${t?`mt-1`:``}`,title:OT(e.lineNumber,e.timestamp,e.exactLineNumber),children:n})]}),(0,q.jsx)(PT,{content:e.content})]})}function IT({entry:e}){let[t,n]=(0,x.useState)(!1),r=e.prominence===`system`||e.prominence===`plain`,i=e.prominence===`tool`&&!!(e.body&&e.body.length>160),a=gT(e.timestamp),o=r?`border-border/70 bg-surface/20 opacity-80`:e.prominence===`tool`?`border-border bg-surface/35`:`border-border bg-surface/50`,s=e.prominence===`message`?`bg-accent/15 text-accent`:`bg-surface text-muted`;return(0,q.jsx)(`article`,{className:`rounded-md border ${o}`,children:(0,q.jsxs)(`div`,{className:`grid grid-cols-[5.75rem_minmax(0,1fr)] gap-3 px-3 py-2 sm:grid-cols-[6.75rem_minmax(0,1fr)]`,children:[(0,q.jsx)(`div`,{className:`select-none text-right text-[11px] tabular-nums text-muted`,title:OT(e.lineNumber,e.timestamp,e.exactLineNumber),children:a??(e.exactLineNumber?`Line ${e.lineNumber+1}`:`Entry`)}),(0,q.jsxs)(`div`,{className:`min-w-0 space-y-2`,children:[(0,q.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,q.jsx)(`span`,{className:`rounded px-1.5 py-0.5 text-[10px] font-semibold uppercase tracking-wide ${s}`,children:e.source}),(0,q.jsx)(`span`,{className:`min-w-0 break-words text-xs font-semibold text-primary`,children:e.title})]}),e.body&&!i&&(0,q.jsx)(`pre`,{className:`whitespace-pre-wrap break-words rounded bg-base px-3 py-2 text-xs leading-relaxed text-secondary`,children:e.body}),e.body&&i&&(0,q.jsxs)(`div`,{className:`rounded bg-base px-3 py-2`,children:[(0,q.jsx)(`button`,{type:`button`,className:`select-none text-[11px] text-muted hover:text-primary`,"aria-expanded":t,onClick:()=>n(e=>!e),children:`Output`}),t&&(0,q.jsx)(`pre`,{className:`mt-2 max-h-80 overflow-auto whitespace-pre-wrap break-words text-xs leading-relaxed text-secondary`,children:e.body})]}),e.details.length>0&&(0,q.jsxs)(`details`,{className:`group`,children:[(0,q.jsx)(`summary`,{className:`cursor-pointer select-none text-[11px] text-muted hover:text-primary`,children:`Details`}),(0,q.jsx)(`div`,{className:`mt-2 space-y-2`,children:e.details.map(e=>(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`div`,{className:`mb-1 text-[10px] font-semibold uppercase tracking-wide text-muted`,children:e.label}),(0,q.jsx)(`pre`,{className:`max-h-72 overflow-auto whitespace-pre-wrap break-words rounded bg-base px-3 py-2 text-[11px] leading-relaxed text-muted`,children:e.value})]},e.label))})]})]})]})})}async function LT(e,t){let n=await fetch(e,{signal:t});if(!n.ok){let e=`Failed to load preview (HTTP ${n.status})`;try{let t=await n.json();t?.error&&(e=t.error)}catch{}throw Error(e)}return await n.json()}function RT({session:e,className:t=``,onStateChange:n}){let[r,i]=(0,x.useState)(!0),[a,o]=(0,x.useState)(!1),[s,c]=(0,x.useState)(null),[l,u]=(0,x.useState)(null),[d,f]=(0,x.useState)(`messages`),p=(0,x.useRef)(null),m=(0,x.useRef)(!1),h=(0,x.useRef)(!1);(0,x.useEffect)(()=>{let t=!1,n=new AbortController,r=setTimeout(()=>n.abort(),pT);return(async()=>{i(!0),c(null),u(null);try{let r=await LT(`/api/session-preview/${e.sessionId}?limit=${mT}`,n.signal);t||u(r)}catch(e){if(t)return;n.signal.aborted?c(`Preview timed out`):c(e instanceof Error?e.message:`Failed to load preview`)}finally{t||i(!1)}})(),()=>{t=!0,clearTimeout(r),n.abort()}},[e.sessionId]);let g=async()=>{if(!l||h.current||!l.hasMoreBefore)return;h.current=!0,m.current=!0;let t=new AbortController,n=setTimeout(()=>t.abort(),pT);o(!0),c(null);try{let n=new URLSearchParams({limit:String(mT)});typeof l.startByte==`number`?n.set(`beforeByte`,String(l.startByte)):n.set(`beforeLine`,String(l.startLine));let r=await LT(`/api/session-preview/${e.sessionId}?${n.toString()}`,t.signal);u(e=>e?{...e,totalLines:r.totalLines??e.totalLines,startLine:r.startLine,endLine:e.endLine,hasMoreBefore:r.hasMoreBefore,startByte:r.startByte,endByte:e.endByte,lines:[...r.lines,...e.lines],lineKeys:[...r.lineKeys??r.lines.map((e,t)=>String(r.startLine+t)),...e.lineKeys??e.lines.map((t,n)=>String(e.startLine+n))]}:r)}catch(e){m.current=!1,t.signal.aborted?c(`Preview timed out`):c(e instanceof Error?e.message:`Failed to load preview`)}finally{clearTimeout(n),h.current=!1,o(!1)}};(0,x.useEffect)(()=>{n?.({loading:r,error:s})},[s,r,n]),(0,x.useLayoutEffect)(()=>{if(!(!p.current||!l)){if(m.current){m.current=!1;return}p.current.scrollTop=0}},[l,d]);let _=(0,x.useMemo)(()=>l?.lines.flatMap((e,t)=>{let n=l.totalLines!==null,r=n?l.startLine+t:(l.startByte??0)+t;return CT(e,l.lineKeys?.[t]??String(r),r,n)})??[],[l]),v=(0,x.useMemo)(()=>l?.lines.map((e,t)=>{let n=l.totalLines!==null,r=n?l.startLine+t:(l.startByte??0)+t;return bT(e,l.lineKeys?.[t]??String(r),r,n)})??[],[l]),y=(0,x.useMemo)(()=>wT(_),[_]),b=(0,x.useMemo)(()=>ET(y),[y]),S=(0,x.useMemo)(()=>v.slice().reverse(),[v]),C=l?l.totalLines===0?`No transcript entries`:l.totalLines===null?`Showing ${l.lines.length} recent log entries`:`Showing ${l.lines.length} of ${l.totalLines} log entries`:`Derived from the saved session log.`;return(0,q.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col overflow-hidden rounded-xl border border-border bg-elevated ${t}`.trim(),children:[(0,q.jsxs)(`div`,{className:`flex flex-col gap-3 border-b border-border px-4 py-3 sm:flex-row sm:items-center sm:justify-between`,children:[(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`h3`,{className:`text-sm font-semibold text-primary`,children:`Transcript`}),(0,q.jsx)(`p`,{className:`text-xs text-muted`,children:C})]}),(0,q.jsxs)(`div`,{className:`inline-flex w-fit rounded-md border border-border bg-base p-0.5`,children:[(0,q.jsx)(`button`,{type:`button`,onClick:()=>f(`messages`),className:`rounded px-2.5 py-1 text-xs transition-colors ${d===`messages`?`bg-accent text-white`:`text-muted hover:text-primary`}`,"aria-pressed":d===`messages`,children:`Messages`}),(0,q.jsx)(`button`,{type:`button`,onClick:()=>f(`events`),className:`rounded px-2.5 py-1 text-xs transition-colors ${d===`events`?`bg-accent text-white`:`text-muted hover:text-primary`}`,"aria-pressed":d===`events`,children:`Events`})]})]}),(0,q.jsxs)(`div`,{ref:p,className:`flex-1 overflow-y-auto p-4 font-mono text-xs`,children:[r&&(0,q.jsx)(`div`,{className:`flex items-center justify-center py-8 text-muted`,children:`Loading preview...`}),s&&(0,q.jsx)(`div`,{className:`flex items-center justify-center py-8 text-danger`,children:s}),l&&d===`messages`&&(0,q.jsxs)(`div`,{className:`mx-auto flex w-full max-w-4xl flex-col`,children:[b.length===0?(0,q.jsx)(`div`,{className:`py-8 text-center text-muted`,children:`No readable messages found. Try Events.`}):b.map(({entry:e,showRole:t})=>(0,q.jsx)(FT,{entry:e,showRole:t},DT(e))),l.hasMoreBefore&&(0,q.jsx)(`button`,{type:`button`,className:`btn mx-auto mt-3`,onClick:g,disabled:a,children:a?`Loading...`:`Load earlier`})]}),l&&d===`events`&&(0,q.jsxs)(`div`,{className:`mx-auto flex w-full max-w-5xl flex-col gap-2`,children:[(0,q.jsx)(`div`,{className:`space-y-2`,children:S.map(e=>(0,q.jsx)(IT,{entry:e},`${e.lineNumber}:${e.type}:${e.raw.slice(0,24)}`))}),l.hasMoreBefore&&(0,q.jsx)(`button`,{type:`button`,className:`btn mx-auto`,onClick:g,disabled:a,children:a?`Loading...`:`Load earlier`})]})]})]})}function zT({session:e,onClose:t,onResume:n}){let r=(0,x.useRef)(null),[i,a]=(0,x.useState)({loading:!0,error:null}),o=(0,x.useCallback)(()=>{i.loading||n(e.sessionId)},[i.loading,n,e.sessionId]);(0,x.useEffect)(()=>{let e=e=>{e.key===`Escape`?(e.stopPropagation(),t()):e.key===`Enter`&&(e.preventDefault(),o())};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[o,t]),(0,x.useEffect)(()=>{r.current?.focus()},[]);let s=e.displayName||Nm(e.projectPath)||e.sessionId.slice(0,8),c=Mm(e.lastActivityAt);return(0,q.jsx)(`div`,{role:`dialog`,"aria-modal":`true`,"aria-labelledby":`preview-title`,className:`fixed inset-0 z-50 flex items-center justify-center bg-black/60 p-4`,onClick:e=>{e.target===e.currentTarget&&t()},children:(0,q.jsxs)(`div`,{ref:r,tabIndex:-1,className:`flex max-h-[80vh] w-full max-w-2xl flex-col border border-border bg-elevated`,children:[(0,q.jsxs)(`div`,{className:`flex items-center gap-3 border-b border-border px-4 py-3`,children:[(0,q.jsx)(Zm,{agentType:e.agentType,className:`h-5 w-5 shrink-0 text-muted`}),(0,q.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,q.jsx)(`h2`,{id:`preview-title`,className:`truncate text-sm font-semibold text-primary`,children:s}),(0,q.jsxs)(`p`,{className:`truncate text-xs text-muted`,title:e.projectPath,children:[Nm(e.projectPath),` · `,c]})]})]}),(0,q.jsx)(RT,{session:e,className:`m-4 mt-0 flex-1 border-0 bg-transparent`,onStateChange:a}),(0,q.jsxs)(`div`,{className:`flex items-center justify-end gap-2 border-t border-border px-4 py-3`,children:[(0,q.jsx)(`button`,{type:`button`,onClick:t,className:`btn`,children:`Cancel`}),(0,q.jsx)(`button`,{type:`button`,onClick:o,className:`btn btn-primary`,disabled:i.loading,children:`Wake`})]})]})})}function BT({session:e,isSelected:t,showSessionIdPrefix:n,showProjectName:r,showLastUserMessage:i,onSelect:a,onWake:o,onRename:s,onMoveToHistory:c}){let l=Mm(e.lastActivityAt),u=Nm(e.projectPath),d=e.displayName||u||e.sessionId.slice(0,8),f=r&&!!u,p=i&&!!e.lastUserMessage,m=n?Fm(e.sessionId):``,h=(0,x.useRef)(null),g=(0,x.useRef)(null),[_,v]=(0,x.useState)(null),[y,b]=(0,x.useState)(!1),[S,C]=(0,x.useState)(d);(0,x.useEffect)(()=>{C(d)},[d]),(0,x.useEffect)(()=>{y&&g.current&&(g.current.focus(),g.current.select())},[y]);let w=()=>{let t=S.trim();t&&t!==d&&s?.(e.sessionId,t),b(!1)};return(0,x.useEffect)(()=>{if(!_)return;let e=e=>{h.current&&!h.current.contains(e.target)&&v(null)},t=e=>{e.key===`Escape`&&v(null)};return document.addEventListener(`mousedown`,e),document.addEventListener(`touchstart`,e),document.addEventListener(`keydown`,t),()=>{document.removeEventListener(`mousedown`,e),document.removeEventListener(`touchstart`,e),document.removeEventListener(`keydown`,t)}},[_]),(0,q.jsxs)(`div`,{className:`group relative cursor-pointer px-3 py-2 hover:bg-hover ${t?`bg-hover`:``}`,role:`button`,tabIndex:0,"data-testid":`hibernating-session-card`,onClick:()=>a(e.sessionId),onContextMenu:e=>{e.preventDefault(),e.stopPropagation(),v({x:e.clientX,y:e.clientY})},onKeyDown:t=>{(t.key===`Enter`||t.key===` `)&&(t.preventDefault(),a(e.sessionId))},children:[(0,q.jsxs)(`div`,{className:`flex flex-col gap-0.5 pl-2.5`,children:[(0,q.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,q.jsx)(Zm,{agentType:e.agentType,className:`h-3.5 w-3.5 shrink-0 text-muted`}),y?(0,q.jsx)(`input`,{ref:g,type:`text`,value:S,onChange:e=>C(e.target.value),onBlur:w,onKeyDown:e=>{e.key===`Enter`?(e.preventDefault(),w()):e.key===`Escape`&&(e.preventDefault(),C(d),b(!1))},onClick:e=>e.stopPropagation(),className:`min-w-0 flex-1 rounded border border-border bg-surface px-1.5 py-0.5 text-sm font-medium text-primary outline-none focus:border-accent`}):(0,q.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-sm font-medium text-primary`,children:d}),(0,q.jsx)(we,{className:`h-3 w-3 shrink-0 text-muted`,"aria-label":`Hibernating`,title:`Hibernating`}),e.lastResumeError&&(0,q.jsx)(ne,{className:`h-3 w-3 shrink-0 text-amber-500`,"aria-label":`Wake failed`,title:`Last wake failed: ${e.lastResumeError}`}),m&&(0,q.jsx)(`span`,{className:`shrink-0 text-[11px] font-mono text-muted`,title:e.sessionId,children:m}),(0,q.jsx)(`span`,{className:`ml-1 w-8 shrink-0 text-right text-xs tabular-nums text-muted`,children:l})]}),(f||p)&&(0,q.jsxs)(`div`,{className:`flex flex-wrap items-center gap-1 pl-[1.375rem]`,children:[f&&(0,q.jsx)(th,{name:u,fullPath:e.projectPath}),p&&(0,q.jsxs)(`span`,{className:`line-clamp-2 text-xs italic text-muted`,children:[`"`,e.lastUserMessage.length>200?e.lastUserMessage.slice(0,200)+`...`:e.lastUserMessage,`"`]})]})]}),_&&(0,q.jsxs)(`div`,{ref:h,className:`fixed z-50 min-w-[160px] rounded-md border border-border bg-elevated shadow-lg py-1`,style:{left:_.x,top:_.y},role:`menu`,children:[o&&(0,q.jsxs)(`button`,{onClick:t=>{t.stopPropagation(),v(null),o(e.sessionId)},className:`w-full px-3 py-2 text-left text-sm text-secondary hover:bg-hover hover:text-primary flex items-center gap-2`,role:`menuitem`,children:[(0,q.jsx)(Oe,{width:14,height:14}),`Wake`]}),s&&(0,q.jsxs)(`button`,{onClick:e=>{e.stopPropagation(),v(null),b(!0)},className:`w-full px-3 py-2 text-left text-sm text-secondary hover:bg-hover hover:text-primary flex items-center gap-2`,role:`menuitem`,children:[(0,q.jsx)(me,{width:14,height:14}),`Rename`]}),e.logFilePath&&(0,q.jsxs)(`button`,{onClick:t=>{t.stopPropagation(),v(null),Im(e.logFilePath)},className:`w-full px-3 py-2 text-left text-sm text-secondary hover:bg-hover hover:text-primary flex items-center gap-2`,role:`menuitem`,title:e.logFilePath,children:[(0,q.jsx)(ge,{width:14,height:14}),`Copy Log Path`]}),c&&(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(`div`,{className:`my-1 border-t border-border`}),(0,q.jsxs)(`button`,{onClick:t=>{t.stopPropagation(),v(null),c(e.sessionId)},className:`w-full px-3 py-2 text-left text-sm text-danger hover:bg-danger/10 flex items-center gap-2`,role:`menuitem`,children:[(0,q.jsx)(Be,{width:14,height:14}),`Move to History`]})]})]})]})}var VT={working:`bg-green-500/20 text-green-600`,waiting:`bg-zinc-500/20 text-zinc-400`,permission:`bg-amber-500/20 text-amber-600`,unknown:`bg-zinc-500/20 text-zinc-400`};function HT(){let[,e]=(0,x.useState)(0);(0,x.useEffect)(()=>{let t=setInterval(()=>e(e=>e+1),3e4);return()=>clearInterval(t)},[])}function UT({sessions:e,hibernatingSessions:t=[],historySessions:n=[],selectedSessionId:r,selectedHibernatingSessionId:i=null,loading:a,error:o,onSelect:s,onSelectHibernating:c,onRename:l,onResume:u,onHibernate:d,onKill:f,onDuplicate:p,onMoveToHistory:m,onNewSession:h}){HT();let g=(0,x.useMemo)(()=>typeof navigator>`u`?!1:/^((?!chrome|android).)*safari/i.test(navigator.userAgent),[]),[_,v]=(0,x.useState)(null),y=G(e=>e.historySessionsExpanded),b=G(e=>e.setHistorySessionsExpanded),S=G(e=>e.hibernatingSessionsExpanded),C=G(e=>e.setHibernatingSessionsExpanded),[w,T]=(0,x.useState)(null),[E,D]=(0,x.useState)(20),O=ud(),k=g&&!O,A=(0,x.useMemo)(()=>[...t,...n],[t,n]);(0,x.useEffect)(()=>{y||D(20)},[y]);let[j,M]=Gm(e.length,200),[N,P]=Gm(n.length,200,!0),F=(0,x.useRef)(new Set(e.map(e=>e.id))),I=(0,x.useRef)(new Set([...t,...n].map(e=>e.sessionId))),[L,R]=(0,x.useState)(new Set);(0,x.useEffect)(()=>{let r=new Set(e.map(e=>e.id)),i=new Set([...t,...n].map(e=>e.sessionId)),a=new Set;for(let e of r)F.current.has(e)||a.add(e);for(let t of e){let e=t.agentSessionId?.trim();e&&I.current.has(e)&&!i.has(e)&&a.add(t.id)}F.current=r,I.current=i,a.size>0&&R(a)},[e,t,n]),(0,x.useEffect)(()=>{if(L.size===0)return;let e=setTimeout(()=>R(new Set),500);return()=>clearTimeout(e)},[L]);let z=Ke(We(G(e=>e.shortcutModifier))),B=G(e=>e.sessionSortMode),V=G(e=>e.setSessionSortMode),H=G(e=>e.sessionSortDirection),U=G(e=>e.manualSessionOrder),W=G(e=>e.setManualSessionOrder),ee=G(e=>e.showProjectName),K=G(e=>e.showLastUserMessage),te=G(e=>e.showSessionIdPrefix),ne=G(e=>e.projectFilters),re=G(e=>e.setProjectFilters),ae=G(e=>e.hostFilters),se=G(e=>e.setHostFilters),ce=Wm(e=>e.exitingSessions),le=Wm(e=>e.clearExitingSession),ue=Wm(e=>e.hostStatuses),de=Wm(e=>e.remoteAllowControl);Km(e,ce,le,200),(0,x.useEffect)(()=>{if(U.length===0)return;let t=new Set;for(let n of e)t.add(Dm(n)),t.add(n.id);for(let e of A)t.add(e.sessionId);let n=U.filter(e=>t.has(e));n.length!==U.length&&W(n)},[e,A,U,W]);let fe=(0,x.useMemo)(()=>km(e,{mode:B,direction:H,manualOrder:U}),[e,B,H,U]),pe=(0,x.useMemo)(()=>Am(e,A),[e,A]),me=(0,x.useMemo)(()=>{let t=jm(e,A),n=ue.map(e=>e.host),r=new Set,i=[];for(let e of n)!e||r.has(e)||(r.add(e),i.push(e));for(let e of t)!e||r.has(e)||(r.add(e),i.push(e));return i},[e,A,ue]),he=(0,x.useMemo)(()=>me.length>1,[me]),ge=(0,x.useMemo)(()=>{let e=fe;return ne.length>0&&(e=e.filter(e=>ne.includes(e.projectPath))),ae.length>0&&(e=e.filter(e=>ae.includes(e.host??``))),e},[fe,ne,ae]),_e=(0,x.useMemo)(()=>`${ne.length===0?`all-projects`:ne.join(`|`)}::${ae.length===0?`all-hosts`:ae.join(`|`)}`,[ne,ae]),ve=(0,x.useRef)(new Set(ge.map(e=>e.id))),[ye,be]=(0,x.useState)(new Set);(0,x.useEffect)(()=>{let e=new Set(ge.map(e=>e.id)),t=new Set;for(let n of e)ve.current.has(n)||L.has(n)||t.add(n);ve.current=e,t.size>0&&be(t)},[ge,L]),(0,x.useEffect)(()=>{if(ye.size===0)return;let e=setTimeout(()=>be(new Set),500);return()=>clearTimeout(e)},[ye]);let xe=(0,x.useMemo)(()=>{let e=t;return ne.length>0&&(e=e.filter(e=>ne.includes(e.projectPath))),ae.length>0&&(e=e.filter(e=>ae.includes(e.host??``))),e},[t,ne,ae]),Se=(0,x.useMemo)(()=>{let e=n;return ne.length>0&&(e=e.filter(e=>ne.includes(e.projectPath))),ae.length>0&&(e=e.filter(e=>ae.includes(e.host??``))),e},[n,ne,ae]),Ce=(0,x.useMemo)(()=>{if(ne.length===0)return 0;let t=new Set(ne);return e.filter(e=>!t.has(e.projectPath)&&e.status===`permission`).length},[e,ne]);(0,x.useEffect)(()=>{if(ne.length===0||pe.length===0)return;let e=new Set(pe),t=ne.filter(t=>e.has(t));t.length!==ne.length&&re(t)},[ne,pe,re]),(0,x.useEffect)(()=>{if(ae.length===0||me.length===0)return;let e=new Set(me),t=ae.filter(t=>e.has(t));t.length!==ae.length&&se(t)},[ae,me,se]);let we=Qd(Zd($f,{activationConstraint:{distance:8}})),[Te,Ee]=(0,x.useState)(null),[De,Oe]=(0,x.useState)(null),[ke,je]=(0,x.useState)(!1),Me=(0,x.useCallback)(e=>{Ee(e.active.id),je(!0)},[]),Ne=(0,x.useCallback)(e=>{Oe(e.over?.id)},[]),Pe=(0,x.useCallback)(e=>{let{active:t,over:n}=e;if(Ee(null),Oe(null),!n||t.id===n.id){setTimeout(()=>je(!1),100);return}let r=ge.findIndex(e=>e.id===t.id),i=ge.findIndex(e=>e.id===n.id);if(r===-1||i===-1){setTimeout(()=>je(!1),100);return}let a=ge.map(e=>Dm(e)),[o]=a.splice(r,1);a.splice(i,0,o);let s=fe.map(e=>Dm(e)),c=new Set(a),l=0,u=s.map(e=>{if(!c.has(e))return e;let t=a[l];return l+=1,t});B!==`manual`&&V(`manual`),W(u),setTimeout(()=>je(!1),100)},[ge,fe,B,V,W]),Fe=(0,x.useCallback)(()=>{Ee(null),Oe(null),setTimeout(()=>je(!1),100)},[]);(0,x.useEffect)(()=>{if(!Te&&!De)return;let e=new Set(ge.map(e=>e.id)),t=!1;Te&&!e.has(Te)&&(Ee(null),t=!0),De&&!e.has(De)&&(Oe(null),t=!0),t&&je(!1)},[ge,Te,De]);let Ie=(e,t)=>{l(e,t),v(null)};return(0,q.jsxs)(`aside`,{className:`flex min-h-0 flex-1 flex-col border-r border-border bg-elevated`,children:[o&&(0,q.jsx)(`div`,{className:`shrink-0 border-b border-danger/30 bg-danger/10 px-3 py-2 text-xs text-danger`,children:o}),(0,q.jsxs)(`div`,{className:`min-h-0 flex-1 overflow-y-auto`,children:[(0,q.jsxs)(`div`,{className:`sticky top-0 z-10 flex h-10 items-center justify-start gap-2 border-b border-border bg-elevated px-3`,children:[he&&(0,q.jsx)(ih,{hosts:me,selectedHosts:ae,onSelect:se,statuses:ue}),(0,q.jsx)(ah,{projects:pe,selectedProjects:ne,onSelect:re,hasHiddenPermissions:Ce>0})]}),a?(0,q.jsx)(`div`,{className:`space-y-1 p-2`,children:[0,1,2].map(e=>(0,q.jsx)(`div`,{className:`h-14 animate-pulse rounded bg-surface`},e))}):(0,q.jsxs)(q.Fragment,{children:[(0,q.jsxs)(`div`,{className:`flex items-center justify-between px-3 py-2 text-xs font-medium uppercase tracking-wider text-muted`,children:[(0,q.jsx)(`span`,{children:`Active`}),(0,q.jsxs)(`div`,{className:`flex items-center gap-2`,children:[ge.length===0&&h&&(0,q.jsxs)(`button`,{type:`button`,onClick:h,className:`flex items-center gap-1 rounded px-1.5 py-0.5 text-[11px] font-medium normal-case tracking-normal text-accent hover:bg-hover`,title:`Start a new session`,children:[(0,q.jsx)(Ae,{className:`h-3.5 w-3.5`}),`New session`]}),(0,q.jsx)(ld.span,{className:`w-8 text-right text-xs`,animate:j&&!O?{scale:[1,1.3,1]}:{},transition:{duration:.3},onAnimationComplete:M,children:ge.length})]})]}),ge.length>0&&(0,q.jsx)(Xp,{sensors:we,collisionDetection:of,onDragStart:Me,onDragOver:Ne,onDragEnd:Pe,onDragCancel:Fe,children:(0,q.jsx)(gm,{items:ge.map(e=>e.id),strategy:fm,children:(0,q.jsx)(`div`,{children:(0,q.jsx)(Xa,{initial:!1,mode:k?`sync`:`popLayout`,children:ge.map((e,t)=>{let n=L.has(e.id),i=ye.has(e.id),a=e.remote===!0,o=e.source===`managed`,c=!a||de&&o,l=!!(d&&!a&&o&&e.agentSessionId?.trim()),u=Te?ge.findIndex(e=>e.id===Te):-1,m=De===e.id&&Te!==e.id?u>t?`above`:`below`:null;return(0,q.jsx)(WT,{session:e,isNew:n||i,exitDuration:200,prefersReducedMotion:O,useSafariLayoutFallback:k,layoutAnimationsDisabled:ke,isSelected:e.id===r,isEditing:e.id===_,showSessionIdPrefix:te,showProjectName:ee,showLastUserMessage:K,showHostInfo:he,dropIndicator:m,onSelect:()=>s(e.id),onStartEdit:c?()=>v(e.id):void 0,onCancelEdit:()=>v(null),onRename:t=>Ie(e.id,t),onHibernate:l?()=>d?.(e.agentSessionId.trim()):void 0,onKill:f&&c?()=>f(e.id,`session_list_context_menu`):void 0,onDuplicate:p&&c?()=>p(e.id):void 0},e.id)})})},_e)})}),xe.length>0&&(0,q.jsxs)(`div`,{className:`border-t border-border`,children:[(0,q.jsxs)(`button`,{type:`button`,onClick:()=>C(!S),className:`flex w-full items-center justify-between px-3 py-2 text-left text-xs font-medium uppercase tracking-wider text-muted hover:text-primary`,children:[(0,q.jsxs)(`span`,{className:`flex items-center gap-2`,children:[S?(0,q.jsx)(ie,{className:`h-4 w-4`}):(0,q.jsx)(oe,{className:`h-4 w-4`}),`Hibernating`]}),(0,q.jsx)(`span`,{className:`w-8 text-right text-xs text-muted`,children:xe.length})]}),S&&(0,q.jsx)(`div`,{className:`py-1`,children:xe.map(e=>(0,q.jsx)(BT,{session:e,isSelected:i===e.sessionId,showSessionIdPrefix:te,showProjectName:ee,showLastUserMessage:K,onSelect:e=>c?.(e),onWake:e=>u?.(e),onRename:(e,t)=>Ie(e,t),onMoveToHistory:m},e.sessionId))})]})]}),Se.length>0&&(0,q.jsxs)(`div`,{className:`border-t border-border`,children:[(0,q.jsxs)(`button`,{type:`button`,onClick:()=>b(!y),className:`flex w-full items-center justify-between px-3 py-2 text-left text-xs font-medium uppercase tracking-wider text-muted hover:text-primary`,children:[(0,q.jsxs)(`span`,{className:`flex items-center gap-2`,children:[y?(0,q.jsx)(ie,{className:`h-4 w-4`}):(0,q.jsx)(oe,{className:`h-4 w-4`}),`History`]}),(0,q.jsx)(ld.span,{className:`w-8 text-right text-xs`,animate:N&&!O?{scale:[1,1.3,1]}:{},transition:{duration:.3},onAnimationComplete:P,children:Se.length})]}),y&&(0,q.jsxs)(`div`,{className:`py-1`,children:[Se.slice(0,E).map(e=>(0,q.jsx)(nh,{session:e,showSessionIdPrefix:te,showProjectName:ee,showLastUserMessage:K,onResume:e=>u?.(e),onPreview:T},e.sessionId)),Se.length>E&&(0,q.jsxs)(`button`,{type:`button`,onClick:()=>D(e=>e+20),className:`w-full px-3 py-2 text-center text-xs text-muted hover:text-primary hover:bg-hover`,children:[`Show more (`,Se.length-E,` remaining)`]})]})]})]}),(0,q.jsx)(`div`,{className:`hidden shrink-0 border-t border-border px-3 py-2 md:block`,children:(0,q.jsxs)(`div`,{className:`flex flex-wrap gap-x-3 gap-y-0.5 text-[10px] text-muted`,children:[(0,q.jsxs)(`span`,{children:[z,`[ ] nav`]}),(0,q.jsxs)(`span`,{children:[z,`N new`]}),(0,q.jsxs)(`span`,{children:[z,`X kill`]})]})}),w&&(0,q.jsx)(zT,{session:w,onClose:()=>T(null),onResume:e=>{T(null),u?.(e)}})]})}var WT=(0,x.forwardRef)(function({session:e,isNew:t,exitDuration:n,prefersReducedMotion:r,useSafariLayoutFallback:i,layoutAnimationsDisabled:a,isSelected:o,isEditing:s,showSessionIdPrefix:c,showProjectName:l,showLastUserMessage:u,showHostInfo:d,dropIndicator:f,onSelect:p,onStartEdit:m,onCancelEdit:h,onRename:g,onHibernate:_,onKill:v,onDuplicate:y},b){let{attributes:S,listeners:C,setNodeRef:w,transform:T,transition:E,isDragging:D}=wm({id:e.id,animateLayoutChanges:({isSorting:e,wasDragging:t})=>e||t}),O=Id.Transform.toString(T),k={...r&&O?{transform:O,transition:E}:{},zIndex:D?10:void 0,opacity:D?.9:void 0},A=(0,x.useCallback)(e=>{w(e),typeof b==`function`?b(e):b&&(b.current=e)},[w,b]);return(0,q.jsxs)(ld.div,{ref:A,style:{...k,overflow:`hidden`},className:`relative`,layout:!r&&!D&&!a&&!t?!i:!1,transformTemplate:(e,t)=>Lm({useSafariLayoutFallback:i,isDragging:D,dndTransform:O,generatedTransform:t}),initial:r||!t?!1:i?{opacity:0}:{opacity:0,scale:.97},animate:r?{opacity:1}:t?i?{opacity:1}:{opacity:1,scale:[1.02,.99,1]}:{opacity:1,scale:1},exit:r?{opacity:0}:i?{opacity:0,height:0}:{opacity:0,height:0,scale:.97},transition:r?{duration:0}:i?{opacity:{duration:n/1e3},height:{duration:n/1e3,ease:`easeOut`}}:{layout:{type:`spring`,stiffness:500,damping:35},opacity:{duration:n/1e3},scale:{duration:n/1e3,ease:[.34,1.56,.64,1]},height:{duration:n/1e3,ease:`easeOut`}},...S,...C,children:[f===`above`&&(0,q.jsx)(`div`,{className:`absolute -top-px left-3 right-3 h-0.5 border-t-2 border-dashed border-accent`}),(0,q.jsx)(GT,{session:e,isSelected:o,isEditing:s,showSessionIdPrefix:c,showProjectName:l,showLastUserMessage:u,showHostInfo:d,isDragging:D,onSelect:p,onStartEdit:m,onCancelEdit:h,onRename:g,onHibernate:_,onKill:v,onDuplicate:y}),f===`below`&&(0,q.jsx)(`div`,{className:`absolute -bottom-px left-3 right-3 h-0.5 border-t-2 border-dashed border-accent`})]})});WT.displayName=`SortableSessionItem`;function GT({session:e,isSelected:t,isEditing:n,showSessionIdPrefix:r,showProjectName:i,showLastUserMessage:a,showHostInfo:o,isDragging:s=!1,onSelect:c,onStartEdit:l,onCancelEdit:u,onRename:d,onHibernate:f,onKill:p,onDuplicate:m}){let h=Mm(e.lastActivity),g=(0,x.useRef)(null),_=(0,x.useRef)(null),v=e.agentSessionName?.trim()||e.name?.trim()||e.id,[y,b]=(0,x.useState)(v),S=(0,x.useRef)(null),[C,w]=(0,x.useState)(null),T=Nm(e.projectPath),E=e.host?.trim(),D=e.status===`permission`,O=e.agentSessionId?.trim(),k=r&&O?Fm(O):``,A=i&&!!T,j=o&&!!E,M=a&&!!e.lastUserMessage,N=(0,x.useRef)(e.status),[P,F]=(0,x.useState)(!1);(0,x.useEffect)(()=>{let t=N.current,n=e.status;t===`working`&&n===`waiting`?F(!0):N.current=n},[e.status]);let I=()=>{F(!1),N.current=e.status};(0,x.useEffect)(()=>{n&&g.current&&(g.current.focus(),g.current.select())},[n]),(0,x.useEffect)(()=>{b(v)},[v]);let L=()=>{let e=y.trim();e&&e!==v?d(e):u()},R=e=>{e.key===`Enter`?(e.preventDefault(),L()):e.key===`Escape`&&(e.preventDefault(),b(v),u())},z=(0,x.useRef)(null),B=e=>{if(s)return;let t=e.touches[0];z.current={x:t.clientX,y:t.clientY},S.current=setTimeout(()=>{z.current&&w(z.current)},500)},V=()=>{S.current&&=(clearTimeout(S.current),null)};return(0,x.useEffect)(()=>{if(!C)return;let e=e=>{_.current&&!_.current.contains(e.target)&&w(null)},t=e=>{e.key===`Escape`&&w(null)};return document.addEventListener(`mousedown`,e),document.addEventListener(`touchstart`,e),document.addEventListener(`keydown`,t),()=>{document.removeEventListener(`mousedown`,e),document.removeEventListener(`touchstart`,e),document.removeEventListener(`keydown`,t)}},[C]),(0,q.jsxs)(`div`,{className:`session-row group cursor-pointer select-none px-3 py-2 ${t?`selected`:``} ${s?`cursor-grabbing shadow-lg ring-1 ring-accent/30 bg-elevated`:`cursor-grab`}`,role:`button`,tabIndex:0,"data-testid":`session-card`,"data-session-id":e.id,onClick:s?void 0:c,onKeyDown:e=>{(e.key===`Enter`||e.key===` `)&&c()},onContextMenu:e=>{e.preventDefault(),e.stopPropagation(),w({x:e.clientX,y:e.clientY})},onTouchStart:B,onTouchEnd:V,onTouchCancel:V,children:[(0,q.jsxs)(`div`,{className:`flex flex-col gap-0.5 pl-0.5`,children:[(0,q.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,q.jsx)(Zm,{agentType:e.agentType,command:e.command,className:`h-3.5 w-3.5 shrink-0 text-muted`}),n?(0,q.jsx)(`input`,{ref:g,type:`text`,value:y,onChange:e=>b(e.target.value),onBlur:L,onKeyDown:R,onClick:e=>e.stopPropagation(),className:`min-w-0 flex-1 rounded border border-border bg-surface px-1.5 py-0.5 text-sm font-medium text-primary outline-none focus:border-accent`}):(0,q.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-sm font-medium text-primary`,children:v}),k&&(0,q.jsx)(`span`,{className:`shrink-0 text-[11px] font-mono text-muted`,title:O,children:k}),D?(0,q.jsx)(`span`,{className:`ml-1 flex shrink-0 items-center justify-center rounded-full px-1.5 py-0.5 ${VT[e.status]} pulse-approval`,onAnimationEnd:I,children:(0,q.jsx)(be,{className:`h-3 w-3`,"aria-label":`Needs input`})}):(0,q.jsx)(`span`,{className:`ml-1 shrink-0 rounded-full px-1.5 py-0.5 text-right text-xs tabular-nums ${VT[e.status]}${P?` pulse-complete`:``}`,onAnimationEnd:I,children:h})]}),(A||j||M)&&(0,q.jsxs)(`div`,{className:`flex flex-wrap items-center gap-1 pl-[1.375rem]`,children:[j&&(0,q.jsx)(rh,{name:E}),A&&(0,q.jsx)(th,{name:T,fullPath:e.projectPath}),M&&(0,q.jsxs)(`span`,{className:`line-clamp-2 text-xs italic text-muted`,children:[`"`,e.lastUserMessage.length>200?e.lastUserMessage.slice(0,200)+`…`:e.lastUserMessage,`"`]})]})]}),C&&(0,q.jsxs)(`div`,{ref:_,className:`fixed z-50 min-w-[160px] rounded-md border border-border bg-elevated shadow-lg py-1`,style:{left:C.x,top:C.y},role:`menu`,children:[l&&(0,q.jsxs)(`button`,{onClick:e=>{e.stopPropagation(),w(null),l()},className:`w-full px-3 py-2 text-left text-sm text-secondary hover:bg-hover hover:text-primary flex items-center gap-2`,role:`menuitem`,children:[(0,q.jsx)(me,{width:14,height:14}),`Rename`]}),m&&(0,q.jsxs)(`button`,{onClick:e=>{e.stopPropagation(),w(null),m()},className:`w-full px-3 py-2 text-left text-sm text-secondary hover:bg-hover hover:text-primary flex items-center gap-2`,role:`menuitem`,title:`Create a copy in a new tmux window`,children:[(0,q.jsx)(ce,{width:14,height:14}),`Duplicate`]}),f&&(0,q.jsxs)(`button`,{onClick:e=>{e.stopPropagation(),w(null),f()},className:`w-full px-3 py-2 text-left text-sm text-secondary hover:bg-hover hover:text-primary flex items-center gap-2`,role:`menuitem`,title:`Close the live window and keep this session ready to wake`,children:[(0,q.jsx)(we,{width:14,height:14}),`Hibernate`]}),e.logFilePath&&(0,q.jsxs)(`button`,{onClick:t=>{t.stopPropagation(),w(null),e.logFilePath&&Im(e.logFilePath)},className:`w-full px-3 py-2 text-left text-sm text-secondary hover:bg-hover hover:text-primary flex items-center gap-2`,role:`menuitem`,title:e.logFilePath,children:[(0,q.jsx)(ge,{width:14,height:14}),`Copy Log Path`]}),p&&(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(`div`,{className:`my-1 border-t border-border`}),(0,q.jsxs)(`button`,{onClick:e=>{e.stopPropagation(),w(null),p()},className:`w-full px-3 py-2 text-left text-sm text-danger hover:bg-danger/10 flex items-center gap-2`,role:`menuitem`,children:[(0,q.jsx)(Be,{width:14,height:14}),`Kill Session`]})]})]})]})}var KT={debug:0,info:1,warn:2,error:3},qT=`info`;function JT(e){let t=e.toLowerCase();t in KT&&(qT=t)}function YT(e,t,n=`debug`){if(!(KT[n]<KT[qT]))try{fetch(`/api/client-log`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({event:e,data:t,level:n})}).catch(()=>{})}catch{}}var XT=s(((e,t)=>{(function(n,r){if(typeof e==`object`&&typeof t==`object`)t.exports=r();else if(typeof define==`function`&&define.amd)define([],r);else{var i=r();for(var a in i)(typeof e==`object`?e:n)[a]=i[a]}})(globalThis,(()=>(()=>{var e={4567:function(e,t,n){var r=this&&this.__decorate||function(e,t,n,r){var i,a=arguments.length,o=a<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r;if(typeof Reflect==`object`&&typeof Reflect.decorate==`function`)o=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(o=(a<3?i(o):a>3?i(t,n,o):i(t,n))||o);return a>3&&o&&Object.defineProperty(t,n,o),o},i=this&&this.__param||function(e,t){return function(n,r){t(n,r,e)}};Object.defineProperty(t,`__esModule`,{value:!0}),t.AccessibilityManager=void 0;let a=n(9042),o=n(9924),s=n(844),c=n(4725),l=n(2585),u=n(3656),d=t.AccessibilityManager=class extends s.Disposable{constructor(e,t,n,r){super(),this._terminal=e,this._coreBrowserService=n,this._renderService=r,this._rowColumns=new WeakMap,this._liveRegionLineCount=0,this._charsToConsume=[],this._charsToAnnounce=``,this._accessibilityContainer=this._coreBrowserService.mainDocument.createElement(`div`),this._accessibilityContainer.classList.add(`xterm-accessibility`),this._rowContainer=this._coreBrowserService.mainDocument.createElement(`div`),this._rowContainer.setAttribute(`role`,`list`),this._rowContainer.classList.add(`xterm-accessibility-tree`),this._rowElements=[];for(let e=0;e<this._terminal.rows;e++)this._rowElements[e]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[e]);if(this._topBoundaryFocusListener=e=>this._handleBoundaryFocus(e,0),this._bottomBoundaryFocusListener=e=>this._handleBoundaryFocus(e,1),this._rowElements[0].addEventListener(`focus`,this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener(`focus`,this._bottomBoundaryFocusListener),this._refreshRowsDimensions(),this._accessibilityContainer.appendChild(this._rowContainer),this._liveRegion=this._coreBrowserService.mainDocument.createElement(`div`),this._liveRegion.classList.add(`live-region`),this._liveRegion.setAttribute(`aria-live`,`assertive`),this._accessibilityContainer.appendChild(this._liveRegion),this._liveRegionDebouncer=this.register(new o.TimeBasedDebouncer(this._renderRows.bind(this))),!this._terminal.element)throw Error(`Cannot enable accessibility before Terminal.open`);this._terminal.element.insertAdjacentElement(`afterbegin`,this._accessibilityContainer),this.register(this._terminal.onResize((e=>this._handleResize(e.rows)))),this.register(this._terminal.onRender((e=>this._refreshRows(e.start,e.end)))),this.register(this._terminal.onScroll((()=>this._refreshRows()))),this.register(this._terminal.onA11yChar((e=>this._handleChar(e)))),this.register(this._terminal.onLineFeed((()=>this._handleChar(`
51
+ `)?(0,q.jsx)(`code`,{className:e,children:t}):(0,q.jsx)(`code`,{className:`rounded bg-surface px-1 py-0.5 text-[0.9em] text-primary`,children:t})},table:({children:e})=>(0,q.jsx)(`div`,{className:`my-2 overflow-x-auto`,children:(0,q.jsx)(`table`,{className:`w-full border-collapse text-xs`,children:e})}),th:({children:e})=>(0,q.jsx)(`th`,{className:`border border-border px-2 py-1 text-left font-semibold`,children:e}),td:({children:e})=>(0,q.jsx)(`td`,{className:`border border-border px-2 py-1 align-top`,children:e})};function PT({content:e}){return(0,q.jsx)(`div`,{className:`min-w-0 break-words text-sm leading-6 text-primary [overflow-wrap:anywhere]`,children:(0,q.jsx)(aS,{remarkPlugins:[lT,fT],components:NT,children:e})})}function FT({entry:e,showRole:t=!0}){if(TT(e))return(0,q.jsx)(MT,{entry:e});let n=kT(e.lineNumber,e.timestamp,e.exactLineNumber);return(0,q.jsxs)(`article`,{className:`grid grid-cols-[5.75rem_minmax(0,1fr)] gap-3 pb-2 sm:grid-cols-[6.75rem_minmax(0,1fr)] ${t?`mt-4 border-t border-border/60 pt-4 first:mt-0 first:border-t-0 first:pt-0`:`pt-1`}`,children:[(0,q.jsxs)(`div`,{className:`select-none pt-0.5 text-right`,children:[t&&(0,q.jsx)(`div`,{className:`text-[11px] font-semibold uppercase tracking-wide ${jT(e)}`,children:AT(e)}),(0,q.jsx)(`div`,{className:`text-[10px] tabular-nums text-muted ${t?`mt-1`:``}`,title:OT(e.lineNumber,e.timestamp,e.exactLineNumber),children:n})]}),(0,q.jsx)(PT,{content:e.content})]})}function IT({entry:e}){let[t,n]=(0,x.useState)(!1),r=e.prominence===`system`||e.prominence===`plain`,i=e.prominence===`tool`&&!!(e.body&&e.body.length>160),a=gT(e.timestamp),o=r?`border-border/70 bg-surface/20 opacity-80`:e.prominence===`tool`?`border-border bg-surface/35`:`border-border bg-surface/50`,s=e.prominence===`message`?`bg-accent/15 text-accent`:`bg-surface text-muted`;return(0,q.jsx)(`article`,{className:`rounded-md border ${o}`,children:(0,q.jsxs)(`div`,{className:`grid grid-cols-[5.75rem_minmax(0,1fr)] gap-3 px-3 py-2 sm:grid-cols-[6.75rem_minmax(0,1fr)]`,children:[(0,q.jsx)(`div`,{className:`select-none text-right text-[11px] tabular-nums text-muted`,title:OT(e.lineNumber,e.timestamp,e.exactLineNumber),children:a??(e.exactLineNumber?`Line ${e.lineNumber+1}`:`Entry`)}),(0,q.jsxs)(`div`,{className:`min-w-0 space-y-2`,children:[(0,q.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,q.jsx)(`span`,{className:`rounded px-1.5 py-0.5 text-[10px] font-semibold uppercase tracking-wide ${s}`,children:e.source}),(0,q.jsx)(`span`,{className:`min-w-0 break-words text-xs font-semibold text-primary`,children:e.title})]}),e.body&&!i&&(0,q.jsx)(`pre`,{className:`whitespace-pre-wrap break-words rounded bg-base px-3 py-2 text-xs leading-relaxed text-secondary`,children:e.body}),e.body&&i&&(0,q.jsxs)(`div`,{className:`rounded bg-base px-3 py-2`,children:[(0,q.jsx)(`button`,{type:`button`,className:`select-none text-[11px] text-muted hover:text-primary`,"aria-expanded":t,onClick:()=>n(e=>!e),children:`Output`}),t&&(0,q.jsx)(`pre`,{className:`mt-2 max-h-80 overflow-auto whitespace-pre-wrap break-words text-xs leading-relaxed text-secondary`,children:e.body})]}),e.details.length>0&&(0,q.jsxs)(`details`,{className:`group`,children:[(0,q.jsx)(`summary`,{className:`cursor-pointer select-none text-[11px] text-muted hover:text-primary`,children:`Details`}),(0,q.jsx)(`div`,{className:`mt-2 space-y-2`,children:e.details.map(e=>(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`div`,{className:`mb-1 text-[10px] font-semibold uppercase tracking-wide text-muted`,children:e.label}),(0,q.jsx)(`pre`,{className:`max-h-72 overflow-auto whitespace-pre-wrap break-words rounded bg-base px-3 py-2 text-[11px] leading-relaxed text-muted`,children:e.value})]},e.label))})]})]})]})})}async function LT(e,t){let n=await fetch(e,{signal:t});if(!n.ok){let e=`Failed to load preview (HTTP ${n.status})`;try{let t=await n.json();t?.error&&(e=t.error)}catch{}throw Error(e)}return await n.json()}function RT({session:e,className:t=``,onStateChange:n}){let[r,i]=(0,x.useState)(!0),[a,o]=(0,x.useState)(!1),[s,c]=(0,x.useState)(null),[l,u]=(0,x.useState)(null),[d,f]=(0,x.useState)(`messages`),p=(0,x.useRef)(null),m=(0,x.useRef)(!1),h=(0,x.useRef)(!1);(0,x.useEffect)(()=>{let t=!1,n=new AbortController,r=setTimeout(()=>n.abort(),pT);return(async()=>{i(!0),c(null),u(null);try{let r=await LT(`/api/session-preview/${e.sessionId}?limit=${mT}`,n.signal);t||u(r)}catch(e){if(t)return;n.signal.aborted?c(`Preview timed out`):c(e instanceof Error?e.message:`Failed to load preview`)}finally{t||i(!1)}})(),()=>{t=!0,clearTimeout(r),n.abort()}},[e.sessionId]);let g=async()=>{if(!l||h.current||!l.hasMoreBefore)return;h.current=!0,m.current=!0;let t=new AbortController,n=setTimeout(()=>t.abort(),pT);o(!0),c(null);try{let n=new URLSearchParams({limit:String(mT)});typeof l.startByte==`number`?n.set(`beforeByte`,String(l.startByte)):n.set(`beforeLine`,String(l.startLine));let r=await LT(`/api/session-preview/${e.sessionId}?${n.toString()}`,t.signal);u(e=>e?{...e,totalLines:r.totalLines??e.totalLines,startLine:r.startLine,endLine:e.endLine,hasMoreBefore:r.hasMoreBefore,startByte:r.startByte,endByte:e.endByte,lines:[...r.lines,...e.lines],lineKeys:[...r.lineKeys??r.lines.map((e,t)=>String(r.startLine+t)),...e.lineKeys??e.lines.map((t,n)=>String(e.startLine+n))]}:r)}catch(e){m.current=!1,t.signal.aborted?c(`Preview timed out`):c(e instanceof Error?e.message:`Failed to load preview`)}finally{clearTimeout(n),h.current=!1,o(!1)}};(0,x.useEffect)(()=>{n?.({loading:r,error:s})},[s,r,n]),(0,x.useLayoutEffect)(()=>{if(!(!p.current||!l)){if(m.current){m.current=!1;return}p.current.scrollTop=0}},[l,d]);let _=(0,x.useMemo)(()=>l?.lines.flatMap((e,t)=>{let n=l.totalLines!==null,r=n?l.startLine+t:(l.startByte??0)+t;return CT(e,l.lineKeys?.[t]??String(r),r,n)})??[],[l]),v=(0,x.useMemo)(()=>l?.lines.map((e,t)=>{let n=l.totalLines!==null,r=n?l.startLine+t:(l.startByte??0)+t;return bT(e,l.lineKeys?.[t]??String(r),r,n)})??[],[l]),y=(0,x.useMemo)(()=>wT(_),[_]),b=(0,x.useMemo)(()=>ET(y),[y]),S=(0,x.useMemo)(()=>v.slice().reverse(),[v]),C=l?l.totalLines===0?`No transcript entries`:l.totalLines===null?`Showing ${l.lines.length} recent log entries`:`Showing ${l.lines.length} of ${l.totalLines} log entries`:`Derived from the saved session log.`;return(0,q.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col overflow-hidden rounded-xl border border-border bg-elevated ${t}`.trim(),children:[(0,q.jsxs)(`div`,{className:`flex flex-col gap-3 border-b border-border px-4 py-3 sm:flex-row sm:items-center sm:justify-between`,children:[(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`h3`,{className:`text-sm font-semibold text-primary`,children:`Transcript`}),(0,q.jsx)(`p`,{className:`text-xs text-muted`,children:C})]}),(0,q.jsxs)(`div`,{className:`inline-flex w-fit rounded-md border border-border bg-base p-0.5`,children:[(0,q.jsx)(`button`,{type:`button`,onClick:()=>f(`messages`),className:`rounded px-2.5 py-1 text-xs transition-colors ${d===`messages`?`bg-accent text-white`:`text-muted hover:text-primary`}`,"aria-pressed":d===`messages`,children:`Messages`}),(0,q.jsx)(`button`,{type:`button`,onClick:()=>f(`events`),className:`rounded px-2.5 py-1 text-xs transition-colors ${d===`events`?`bg-accent text-white`:`text-muted hover:text-primary`}`,"aria-pressed":d===`events`,children:`Events`})]})]}),(0,q.jsxs)(`div`,{ref:p,className:`flex-1 overflow-y-auto p-4 font-mono text-xs`,children:[r&&(0,q.jsx)(`div`,{className:`flex items-center justify-center py-8 text-muted`,children:`Loading preview...`}),s&&(0,q.jsx)(`div`,{className:`flex items-center justify-center py-8 text-danger`,children:s}),l&&d===`messages`&&(0,q.jsxs)(`div`,{className:`mx-auto flex w-full max-w-4xl flex-col`,children:[b.length===0?(0,q.jsx)(`div`,{className:`py-8 text-center text-muted`,children:`No readable messages found. Try Events.`}):b.map(({entry:e,showRole:t})=>(0,q.jsx)(FT,{entry:e,showRole:t},DT(e))),l.hasMoreBefore&&(0,q.jsx)(`button`,{type:`button`,className:`btn mx-auto mt-3`,onClick:g,disabled:a,children:a?`Loading...`:`Load earlier`})]}),l&&d===`events`&&(0,q.jsxs)(`div`,{className:`mx-auto flex w-full max-w-5xl flex-col gap-2`,children:[(0,q.jsx)(`div`,{className:`space-y-2`,children:S.map(e=>(0,q.jsx)(IT,{entry:e},`${e.lineNumber}:${e.type}:${e.raw.slice(0,24)}`))}),l.hasMoreBefore&&(0,q.jsx)(`button`,{type:`button`,className:`btn mx-auto`,onClick:g,disabled:a,children:a?`Loading...`:`Load earlier`})]})]})]})}function zT({session:e,onClose:t,onResume:n}){let r=(0,x.useRef)(null),[i,a]=(0,x.useState)({loading:!0,error:null}),o=(0,x.useCallback)(()=>{i.loading||n(e.sessionId)},[i.loading,n,e.sessionId]);(0,x.useEffect)(()=>{let e=e=>{e.key===`Escape`?(e.stopPropagation(),t()):e.key===`Enter`&&(e.preventDefault(),o())};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[o,t]),(0,x.useEffect)(()=>{r.current?.focus()},[]);let s=e.displayName||Nm(e.projectPath)||e.sessionId.slice(0,8),c=Mm(e.lastActivityAt);return(0,q.jsx)(`div`,{role:`dialog`,"aria-modal":`true`,"aria-labelledby":`preview-title`,className:`fixed inset-0 z-50 flex items-center justify-center bg-black/60 p-4`,onClick:e=>{e.target===e.currentTarget&&t()},children:(0,q.jsxs)(`div`,{ref:r,tabIndex:-1,className:`flex max-h-[80vh] w-full max-w-2xl flex-col border border-border bg-elevated`,children:[(0,q.jsxs)(`div`,{className:`flex items-center gap-3 border-b border-border px-4 py-3`,children:[(0,q.jsx)(Zm,{agentType:e.agentType,className:`h-5 w-5 shrink-0 text-muted`}),(0,q.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,q.jsx)(`h2`,{id:`preview-title`,className:`truncate text-sm font-semibold text-primary`,children:s}),(0,q.jsxs)(`p`,{className:`truncate text-xs text-muted`,title:e.projectPath,children:[Nm(e.projectPath),` · `,c]})]})]}),(0,q.jsx)(RT,{session:e,className:`m-4 mt-0 flex-1 border-0 bg-transparent`,onStateChange:a}),(0,q.jsxs)(`div`,{className:`flex items-center justify-end gap-2 border-t border-border px-4 py-3`,children:[(0,q.jsx)(`button`,{type:`button`,onClick:t,className:`btn`,children:`Cancel`}),(0,q.jsx)(`button`,{type:`button`,onClick:o,className:`btn btn-primary`,disabled:i.loading,children:`Wake`})]})]})})}function BT({session:e,isSelected:t,showSessionIdPrefix:n,showProjectName:r,showLastUserMessage:i,onSelect:a,onWake:o,onRename:s,onMoveToHistory:c}){let l=Mm(e.lastActivityAt),u=Nm(e.projectPath),d=e.displayName||u||e.sessionId.slice(0,8),f=r&&!!u,p=i&&!!e.lastUserMessage,m=n?Fm(e.sessionId):``,h=(0,x.useRef)(null),g=(0,x.useRef)(null),[_,v]=(0,x.useState)(null),[y,b]=(0,x.useState)(!1),[S,C]=(0,x.useState)(d);(0,x.useEffect)(()=>{C(d)},[d]),(0,x.useEffect)(()=>{y&&g.current&&(g.current.focus(),g.current.select())},[y]);let w=()=>{let t=S.trim();t&&t!==d&&s?.(e.sessionId,t),b(!1)};return(0,x.useEffect)(()=>{if(!_)return;let e=e=>{h.current&&!h.current.contains(e.target)&&v(null)},t=e=>{e.key===`Escape`&&v(null)};return document.addEventListener(`mousedown`,e),document.addEventListener(`touchstart`,e),document.addEventListener(`keydown`,t),()=>{document.removeEventListener(`mousedown`,e),document.removeEventListener(`touchstart`,e),document.removeEventListener(`keydown`,t)}},[_]),(0,q.jsxs)(`div`,{className:`group relative cursor-pointer px-3 py-2 hover:bg-hover ${t?`bg-hover`:``}`,role:`button`,tabIndex:0,"data-testid":`hibernating-session-card`,onClick:()=>a(e.sessionId),onContextMenu:e=>{e.preventDefault(),e.stopPropagation(),v({x:e.clientX,y:e.clientY})},onKeyDown:t=>{(t.key===`Enter`||t.key===` `)&&(t.preventDefault(),a(e.sessionId))},children:[(0,q.jsxs)(`div`,{className:`flex flex-col gap-0.5 pl-2.5`,children:[(0,q.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,q.jsx)(Zm,{agentType:e.agentType,className:`h-3.5 w-3.5 shrink-0 text-muted`}),y?(0,q.jsx)(`input`,{ref:g,type:`text`,value:S,onChange:e=>C(e.target.value),onBlur:w,onKeyDown:e=>{e.key===`Enter`?(e.preventDefault(),w()):e.key===`Escape`&&(e.preventDefault(),C(d),b(!1))},onClick:e=>e.stopPropagation(),className:`min-w-0 flex-1 rounded border border-border bg-surface px-1.5 py-0.5 text-sm font-medium text-primary outline-none focus:border-accent`}):(0,q.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-sm font-medium text-primary`,children:d}),(0,q.jsx)(we,{className:`h-3 w-3 shrink-0 text-muted`,"aria-label":`Hibernating`,title:`Hibernating`}),e.lastResumeError&&(0,q.jsx)(ne,{className:`h-3 w-3 shrink-0 text-amber-500`,"aria-label":`Wake failed`,title:`Last wake failed: ${e.lastResumeError}`}),m&&(0,q.jsx)(`span`,{className:`shrink-0 text-[11px] font-mono text-muted`,title:e.sessionId,children:m}),(0,q.jsx)(`span`,{className:`ml-1 w-8 shrink-0 text-right text-xs tabular-nums text-muted`,children:l})]}),(f||p)&&(0,q.jsxs)(`div`,{className:`flex flex-wrap items-center gap-1 pl-[1.375rem]`,children:[f&&(0,q.jsx)(th,{name:u,fullPath:e.projectPath}),p&&(0,q.jsxs)(`span`,{className:`line-clamp-2 text-xs italic text-muted`,children:[`"`,e.lastUserMessage.length>200?e.lastUserMessage.slice(0,200)+`...`:e.lastUserMessage,`"`]})]})]}),_&&(0,q.jsxs)(`div`,{ref:h,className:`fixed z-50 min-w-[160px] rounded-md border border-border bg-elevated shadow-lg py-1`,style:{left:_.x,top:_.y},role:`menu`,children:[o&&(0,q.jsxs)(`button`,{onClick:t=>{t.stopPropagation(),v(null),o(e.sessionId)},className:`w-full px-3 py-2 text-left text-sm text-secondary hover:bg-hover hover:text-primary flex items-center gap-2`,role:`menuitem`,children:[(0,q.jsx)(Oe,{width:14,height:14}),`Wake`]}),s&&(0,q.jsxs)(`button`,{onClick:e=>{e.stopPropagation(),v(null),b(!0)},className:`w-full px-3 py-2 text-left text-sm text-secondary hover:bg-hover hover:text-primary flex items-center gap-2`,role:`menuitem`,children:[(0,q.jsx)(me,{width:14,height:14}),`Rename`]}),e.logFilePath&&(0,q.jsxs)(`button`,{onClick:t=>{t.stopPropagation(),v(null),Im(e.logFilePath)},className:`w-full px-3 py-2 text-left text-sm text-secondary hover:bg-hover hover:text-primary flex items-center gap-2`,role:`menuitem`,title:e.logFilePath,children:[(0,q.jsx)(ge,{width:14,height:14}),`Copy Log Path`]}),c&&(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(`div`,{className:`my-1 border-t border-border`}),(0,q.jsxs)(`button`,{onClick:t=>{t.stopPropagation(),v(null),c(e.sessionId)},className:`w-full px-3 py-2 text-left text-sm text-danger hover:bg-danger/10 flex items-center gap-2`,role:`menuitem`,children:[(0,q.jsx)(Be,{width:14,height:14}),`Move to History`]})]})]})]})}var VT={working:`bg-green-500/20 text-green-600`,waiting:`bg-zinc-500/20 text-zinc-400`,permission:`bg-amber-500/20 text-amber-600`,unknown:`bg-zinc-500/20 text-zinc-400`};function HT(){let[,e]=(0,x.useState)(0);(0,x.useEffect)(()=>{let t=setInterval(()=>e(e=>e+1),3e4);return()=>clearInterval(t)},[])}function UT({sessions:e,hibernatingSessions:t=[],historySessions:n=[],selectedSessionId:r,selectedHibernatingSessionId:i=null,loading:a,error:o,onSelect:s,onSelectHibernating:c,onRename:l,onResume:u,onHibernate:d,onKill:f,onDuplicate:p,onMoveToHistory:m,onNewSession:h}){HT();let g=(0,x.useMemo)(()=>typeof navigator>`u`?!1:/^((?!chrome|android).)*safari/i.test(navigator.userAgent),[]),[_,v]=(0,x.useState)(null),y=G(e=>e.historySessionsExpanded),b=G(e=>e.setHistorySessionsExpanded),S=G(e=>e.hibernatingSessionsExpanded),C=G(e=>e.setHibernatingSessionsExpanded),[w,T]=(0,x.useState)(null),[E,D]=(0,x.useState)(20),O=ud(),k=g&&!O,A=(0,x.useMemo)(()=>[...t,...n],[t,n]);(0,x.useEffect)(()=>{y||D(20)},[y]);let[j,M]=Gm(e.length,200),[N,P]=Gm(n.length,200,!0),F=(0,x.useRef)(new Set(e.map(e=>e.id))),I=(0,x.useRef)(new Set([...t,...n].map(e=>e.sessionId))),[L,R]=(0,x.useState)(new Set);(0,x.useEffect)(()=>{let r=new Set(e.map(e=>e.id)),i=new Set([...t,...n].map(e=>e.sessionId)),a=new Set;for(let e of r)F.current.has(e)||a.add(e);for(let t of e){let e=t.agentSessionId?.trim();e&&I.current.has(e)&&!i.has(e)&&a.add(t.id)}F.current=r,I.current=i,a.size>0&&R(a)},[e,t,n]),(0,x.useEffect)(()=>{if(L.size===0)return;let e=setTimeout(()=>R(new Set),500);return()=>clearTimeout(e)},[L]);let z=Ke(We(G(e=>e.shortcutModifier))),B=G(e=>e.sessionSortMode),V=G(e=>e.setSessionSortMode),H=G(e=>e.sessionSortDirection),U=G(e=>e.manualSessionOrder),W=G(e=>e.setManualSessionOrder),ee=G(e=>e.showProjectName),K=G(e=>e.showLastUserMessage),te=G(e=>e.showSessionIdPrefix),ne=G(e=>e.projectFilters),re=G(e=>e.setProjectFilters),ae=G(e=>e.hostFilters),se=G(e=>e.setHostFilters),ce=Wm(e=>e.exitingSessions),le=Wm(e=>e.clearExitingSession),ue=Wm(e=>e.hostStatuses),de=Wm(e=>e.remoteAllowControl);Km(e,ce,le,200),(0,x.useEffect)(()=>{if(U.length===0)return;let t=new Set;for(let n of e)t.add(Dm(n)),t.add(n.id);for(let e of A)t.add(e.sessionId);let n=U.filter(e=>t.has(e));n.length!==U.length&&W(n)},[e,A,U,W]);let fe=(0,x.useMemo)(()=>km(e,{mode:B,direction:H,manualOrder:U}),[e,B,H,U]),pe=(0,x.useMemo)(()=>Am(e,A),[e,A]),me=(0,x.useMemo)(()=>{let t=jm(e,A),n=ue.map(e=>e.host),r=new Set,i=[];for(let e of n)!e||r.has(e)||(r.add(e),i.push(e));for(let e of t)!e||r.has(e)||(r.add(e),i.push(e));return i},[e,A,ue]),he=(0,x.useMemo)(()=>me.length>1,[me]),ge=(0,x.useMemo)(()=>{let e=fe;return ne.length>0&&(e=e.filter(e=>ne.includes(e.projectPath))),ae.length>0&&(e=e.filter(e=>ae.includes(e.host??``))),e},[fe,ne,ae]),_e=(0,x.useMemo)(()=>`${ne.length===0?`all-projects`:ne.join(`|`)}::${ae.length===0?`all-hosts`:ae.join(`|`)}`,[ne,ae]),ve=(0,x.useRef)(new Set(ge.map(e=>e.id))),[ye,be]=(0,x.useState)(new Set);(0,x.useEffect)(()=>{let e=new Set(ge.map(e=>e.id)),t=new Set;for(let n of e)ve.current.has(n)||L.has(n)||t.add(n);ve.current=e,t.size>0&&be(t)},[ge,L]),(0,x.useEffect)(()=>{if(ye.size===0)return;let e=setTimeout(()=>be(new Set),500);return()=>clearTimeout(e)},[ye]);let xe=(0,x.useMemo)(()=>{let e=t;return ne.length>0&&(e=e.filter(e=>ne.includes(e.projectPath))),ae.length>0&&(e=e.filter(e=>ae.includes(e.host??``))),e},[t,ne,ae]),Se=(0,x.useMemo)(()=>{let e=n;return ne.length>0&&(e=e.filter(e=>ne.includes(e.projectPath))),ae.length>0&&(e=e.filter(e=>ae.includes(e.host??``))),e},[n,ne,ae]),Ce=(0,x.useMemo)(()=>{if(ne.length===0)return 0;let t=new Set(ne);return e.filter(e=>!t.has(e.projectPath)&&e.status===`permission`).length},[e,ne]);(0,x.useEffect)(()=>{if(ne.length===0||pe.length===0)return;let e=new Set(pe),t=ne.filter(t=>e.has(t));t.length!==ne.length&&re(t)},[ne,pe,re]),(0,x.useEffect)(()=>{if(ae.length===0||me.length===0)return;let e=new Set(me),t=ae.filter(t=>e.has(t));t.length!==ae.length&&se(t)},[ae,me,se]);let we=Qd(Zd($f,{activationConstraint:{distance:8}})),[Te,Ee]=(0,x.useState)(null),[De,Oe]=(0,x.useState)(null),ke=(0,x.useCallback)(e=>{Ee(e.active.id)},[]),je=(0,x.useCallback)(e=>{Oe(e.over?.id)},[]),Me=(0,x.useCallback)(e=>{let{active:t,over:n}=e;if(Ee(null),Oe(null),!n||t.id===n.id)return;let r=ge.findIndex(e=>e.id===t.id),i=ge.findIndex(e=>e.id===n.id);if(r===-1||i===-1)return;let a=ge.map(e=>Dm(e)),[o]=a.splice(r,1);a.splice(i,0,o);let s=fe.map(e=>Dm(e)),c=new Set(a),l=0,u=s.map(e=>{if(!c.has(e))return e;let t=a[l];return l+=1,t});B!==`manual`&&V(`manual`),W(u)},[ge,fe,B,V,W]),Ne=(0,x.useCallback)(()=>{Ee(null),Oe(null)},[]);(0,x.useEffect)(()=>{if(!Te&&!De)return;let e=new Set(ge.map(e=>e.id));Te&&!e.has(Te)&&Ee(null),De&&!e.has(De)&&Oe(null)},[ge,Te,De]);let Pe=(e,t)=>{l(e,t),v(null)};return(0,q.jsxs)(`aside`,{className:`flex min-h-0 flex-1 flex-col border-r border-border bg-elevated`,children:[o&&(0,q.jsx)(`div`,{className:`shrink-0 border-b border-danger/30 bg-danger/10 px-3 py-2 text-xs text-danger`,children:o}),(0,q.jsxs)(`div`,{className:`min-h-0 flex-1 overflow-y-auto`,children:[(0,q.jsxs)(`div`,{className:`sticky top-0 z-10 flex h-10 items-center justify-start gap-2 border-b border-border bg-elevated px-3`,children:[he&&(0,q.jsx)(ih,{hosts:me,selectedHosts:ae,onSelect:se,statuses:ue}),(0,q.jsx)(ah,{projects:pe,selectedProjects:ne,onSelect:re,hasHiddenPermissions:Ce>0})]}),a?(0,q.jsx)(`div`,{className:`space-y-1 p-2`,children:[0,1,2].map(e=>(0,q.jsx)(`div`,{className:`h-14 animate-pulse rounded bg-surface`},e))}):(0,q.jsxs)(q.Fragment,{children:[(0,q.jsxs)(`div`,{className:`flex items-center justify-between px-3 py-2 text-xs font-medium uppercase tracking-wider text-muted`,children:[(0,q.jsx)(`span`,{children:`Active`}),(0,q.jsxs)(`div`,{className:`flex items-center gap-2`,children:[ge.length===0&&h&&(0,q.jsxs)(`button`,{type:`button`,onClick:h,className:`flex items-center gap-1 rounded px-1.5 py-0.5 text-[11px] font-medium normal-case tracking-normal text-accent hover:bg-hover`,title:`Start a new session`,children:[(0,q.jsx)(Ae,{className:`h-3.5 w-3.5`}),`New session`]}),(0,q.jsx)(ld.span,{className:`w-8 text-right text-xs`,animate:j&&!O?{scale:[1,1.3,1]}:{},transition:{duration:.3},onAnimationComplete:M,children:ge.length})]})]}),ge.length>0&&(0,q.jsx)(Xp,{sensors:we,collisionDetection:of,onDragStart:ke,onDragOver:je,onDragEnd:Me,onDragCancel:Ne,children:(0,q.jsx)(gm,{items:ge.map(e=>e.id),strategy:fm,children:(0,q.jsx)(`div`,{children:(0,q.jsx)(Xa,{initial:!1,mode:`sync`,children:ge.map((e,t)=>{let n=L.has(e.id),i=ye.has(e.id),a=e.remote===!0,o=e.source===`managed`,c=!a||de&&o,l=!!(d&&!a&&o&&e.agentSessionId?.trim()),u=Te?ge.findIndex(e=>e.id===Te):-1,m=De===e.id&&Te!==e.id?u>t?`above`:`below`:null;return(0,q.jsx)(WT,{session:e,isNew:n||i,exitDuration:200,prefersReducedMotion:O,useSafariLayoutFallback:k,isSelected:e.id===r,isEditing:e.id===_,showSessionIdPrefix:te,showProjectName:ee,showLastUserMessage:K,showHostInfo:he,dropIndicator:m,onSelect:()=>s(e.id),onStartEdit:c?()=>v(e.id):void 0,onCancelEdit:()=>v(null),onRename:t=>Pe(e.id,t),onHibernate:l?()=>d?.(e.agentSessionId.trim()):void 0,onKill:f&&c?()=>f(e.id,`session_list_context_menu`):void 0,onDuplicate:p&&c?()=>p(e.id):void 0},e.id)})})},_e)})}),xe.length>0&&(0,q.jsxs)(`div`,{className:`border-t border-border`,children:[(0,q.jsxs)(`button`,{type:`button`,onClick:()=>C(!S),className:`flex w-full items-center justify-between px-3 py-2 text-left text-xs font-medium uppercase tracking-wider text-muted hover:text-primary`,children:[(0,q.jsxs)(`span`,{className:`flex items-center gap-2`,children:[S?(0,q.jsx)(ie,{className:`h-4 w-4`}):(0,q.jsx)(oe,{className:`h-4 w-4`}),`Hibernating`]}),(0,q.jsx)(`span`,{className:`w-8 text-right text-xs text-muted`,children:xe.length})]}),S&&(0,q.jsx)(`div`,{className:`py-1`,children:xe.map(e=>(0,q.jsx)(BT,{session:e,isSelected:i===e.sessionId,showSessionIdPrefix:te,showProjectName:ee,showLastUserMessage:K,onSelect:e=>c?.(e),onWake:e=>u?.(e),onRename:(e,t)=>Pe(e,t),onMoveToHistory:m},e.sessionId))})]})]}),Se.length>0&&(0,q.jsxs)(`div`,{className:`border-t border-border`,children:[(0,q.jsxs)(`button`,{type:`button`,onClick:()=>b(!y),className:`flex w-full items-center justify-between px-3 py-2 text-left text-xs font-medium uppercase tracking-wider text-muted hover:text-primary`,children:[(0,q.jsxs)(`span`,{className:`flex items-center gap-2`,children:[y?(0,q.jsx)(ie,{className:`h-4 w-4`}):(0,q.jsx)(oe,{className:`h-4 w-4`}),`History`]}),(0,q.jsx)(ld.span,{className:`w-8 text-right text-xs`,animate:N&&!O?{scale:[1,1.3,1]}:{},transition:{duration:.3},onAnimationComplete:P,children:Se.length})]}),y&&(0,q.jsxs)(`div`,{className:`py-1`,children:[Se.slice(0,E).map(e=>(0,q.jsx)(nh,{session:e,showSessionIdPrefix:te,showProjectName:ee,showLastUserMessage:K,onResume:e=>u?.(e),onPreview:T},e.sessionId)),Se.length>E&&(0,q.jsxs)(`button`,{type:`button`,onClick:()=>D(e=>e+20),className:`w-full px-3 py-2 text-center text-xs text-muted hover:text-primary hover:bg-hover`,children:[`Show more (`,Se.length-E,` remaining)`]})]})]})]}),(0,q.jsx)(`div`,{className:`hidden shrink-0 border-t border-border px-3 py-2 md:block`,children:(0,q.jsxs)(`div`,{className:`flex flex-wrap gap-x-3 gap-y-0.5 text-[10px] text-muted`,children:[(0,q.jsxs)(`span`,{children:[z,`[ ] nav`]}),(0,q.jsxs)(`span`,{children:[z,`N new`]}),(0,q.jsxs)(`span`,{children:[z,`X kill`]})]})}),w&&(0,q.jsx)(zT,{session:w,onClose:()=>T(null),onResume:e=>{T(null),u?.(e)}})]})}var WT=(0,x.forwardRef)(function({session:e,isNew:t,exitDuration:n,prefersReducedMotion:r,useSafariLayoutFallback:i,isSelected:a,isEditing:o,showSessionIdPrefix:s,showProjectName:c,showLastUserMessage:l,showHostInfo:u,dropIndicator:d,onSelect:f,onStartEdit:p,onCancelEdit:m,onRename:h,onHibernate:g,onKill:_,onDuplicate:v},y){let{attributes:b,listeners:S,setNodeRef:C,transform:w,transition:T,isDragging:E}=wm({id:e.id,animateLayoutChanges:({isSorting:e,wasDragging:t})=>e||t}),D=Id.Transform.toString(w),O={...r&&D?{transform:D,transition:T}:{},zIndex:E?10:void 0,opacity:E?.9:void 0},k=(0,x.useCallback)(e=>{C(e),typeof y==`function`?y(e):y&&(y.current=e)},[C,y]);return(0,q.jsxs)(ld.div,{ref:k,style:{...O,overflow:`hidden`},className:`relative`,transformTemplate:(e,t)=>Lm({useSafariLayoutFallback:i,isDragging:E,dndTransform:D,generatedTransform:t}),initial:r||!t?!1:i?{opacity:0}:{opacity:0,scale:.97},animate:r?{opacity:1}:t?i?{opacity:1}:{opacity:1,scale:[1.02,.99,1]}:{opacity:1,scale:1},exit:r?{opacity:0}:i?{opacity:0,height:0}:{opacity:0,height:0,scale:.97},transition:r?{duration:0}:i?{opacity:{duration:n/1e3},height:{duration:n/1e3,ease:`easeOut`}}:{opacity:{duration:n/1e3},scale:{duration:n/1e3,ease:[.34,1.56,.64,1]},height:{duration:n/1e3,ease:`easeOut`}},...b,...S,children:[d===`above`&&(0,q.jsx)(`div`,{className:`absolute -top-px left-3 right-3 h-0.5 border-t-2 border-dashed border-accent`}),(0,q.jsx)(GT,{session:e,isSelected:a,isEditing:o,showSessionIdPrefix:s,showProjectName:c,showLastUserMessage:l,showHostInfo:u,isDragging:E,onSelect:f,onStartEdit:p,onCancelEdit:m,onRename:h,onHibernate:g,onKill:_,onDuplicate:v}),d===`below`&&(0,q.jsx)(`div`,{className:`absolute -bottom-px left-3 right-3 h-0.5 border-t-2 border-dashed border-accent`})]})});WT.displayName=`SortableSessionItem`;function GT({session:e,isSelected:t,isEditing:n,showSessionIdPrefix:r,showProjectName:i,showLastUserMessage:a,showHostInfo:o,isDragging:s=!1,onSelect:c,onStartEdit:l,onCancelEdit:u,onRename:d,onHibernate:f,onKill:p,onDuplicate:m}){let h=Mm(e.lastActivity),g=(0,x.useRef)(null),_=(0,x.useRef)(null),v=e.agentSessionName?.trim()||e.name?.trim()||e.id,[y,b]=(0,x.useState)(v),S=(0,x.useRef)(null),[C,w]=(0,x.useState)(null),T=Nm(e.projectPath),E=e.host?.trim(),D=e.status===`permission`,O=e.agentSessionId?.trim(),k=r&&O?Fm(O):``,A=i&&!!T,j=o&&!!E,M=a&&!!e.lastUserMessage,N=(0,x.useRef)(e.status),[P,F]=(0,x.useState)(!1);(0,x.useEffect)(()=>{let t=N.current,n=e.status;t===`working`&&n===`waiting`?F(!0):N.current=n},[e.status]);let I=()=>{F(!1),N.current=e.status};(0,x.useEffect)(()=>{n&&g.current&&(g.current.focus(),g.current.select())},[n]),(0,x.useEffect)(()=>{b(v)},[v]);let L=()=>{let e=y.trim();e&&e!==v?d(e):u()},R=e=>{e.key===`Enter`?(e.preventDefault(),L()):e.key===`Escape`&&(e.preventDefault(),b(v),u())},z=(0,x.useRef)(null),B=e=>{if(s)return;let t=e.touches[0];z.current={x:t.clientX,y:t.clientY},S.current=setTimeout(()=>{z.current&&w(z.current)},500)},V=()=>{S.current&&=(clearTimeout(S.current),null)};return(0,x.useEffect)(()=>{if(!C)return;let e=e=>{_.current&&!_.current.contains(e.target)&&w(null)},t=e=>{e.key===`Escape`&&w(null)};return document.addEventListener(`mousedown`,e),document.addEventListener(`touchstart`,e),document.addEventListener(`keydown`,t),()=>{document.removeEventListener(`mousedown`,e),document.removeEventListener(`touchstart`,e),document.removeEventListener(`keydown`,t)}},[C]),(0,q.jsxs)(`div`,{className:`session-row group cursor-pointer select-none px-3 py-2 ${t?`selected`:``} ${s?`cursor-grabbing shadow-lg ring-1 ring-accent/30 bg-elevated`:`cursor-grab`}`,role:`button`,tabIndex:0,"data-testid":`session-card`,"data-session-id":e.id,onClick:s?void 0:c,onKeyDown:e=>{(e.key===`Enter`||e.key===` `)&&c()},onContextMenu:e=>{e.preventDefault(),e.stopPropagation(),w({x:e.clientX,y:e.clientY})},onTouchStart:B,onTouchEnd:V,onTouchCancel:V,children:[(0,q.jsxs)(`div`,{className:`flex flex-col gap-0.5 pl-0.5`,children:[(0,q.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,q.jsx)(Zm,{agentType:e.agentType,command:e.command,className:`h-3.5 w-3.5 shrink-0 text-muted`}),n?(0,q.jsx)(`input`,{ref:g,type:`text`,value:y,onChange:e=>b(e.target.value),onBlur:L,onKeyDown:R,onClick:e=>e.stopPropagation(),className:`min-w-0 flex-1 rounded border border-border bg-surface px-1.5 py-0.5 text-sm font-medium text-primary outline-none focus:border-accent`}):(0,q.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-sm font-medium text-primary`,children:v}),k&&(0,q.jsx)(`span`,{className:`shrink-0 text-[11px] font-mono text-muted`,title:O,children:k}),D?(0,q.jsx)(`span`,{className:`ml-1 flex shrink-0 items-center justify-center rounded-full px-1.5 py-0.5 ${VT[e.status]} pulse-approval`,onAnimationEnd:I,children:(0,q.jsx)(be,{className:`h-3 w-3`,"aria-label":`Needs input`})}):(0,q.jsx)(`span`,{className:`ml-1 shrink-0 rounded-full px-1.5 py-0.5 text-right text-xs tabular-nums ${VT[e.status]}${P?` pulse-complete`:``}`,onAnimationEnd:I,children:h})]}),(A||j||M)&&(0,q.jsxs)(`div`,{className:`flex flex-wrap items-center gap-1 pl-[1.375rem]`,children:[j&&(0,q.jsx)(rh,{name:E}),A&&(0,q.jsx)(th,{name:T,fullPath:e.projectPath}),M&&(0,q.jsxs)(`span`,{className:`line-clamp-2 text-xs italic text-muted`,children:[`"`,e.lastUserMessage.length>200?e.lastUserMessage.slice(0,200)+`…`:e.lastUserMessage,`"`]})]})]}),C&&(0,q.jsxs)(`div`,{ref:_,className:`fixed z-50 min-w-[160px] rounded-md border border-border bg-elevated shadow-lg py-1`,style:{left:C.x,top:C.y},role:`menu`,children:[l&&(0,q.jsxs)(`button`,{onClick:e=>{e.stopPropagation(),w(null),l()},className:`w-full px-3 py-2 text-left text-sm text-secondary hover:bg-hover hover:text-primary flex items-center gap-2`,role:`menuitem`,children:[(0,q.jsx)(me,{width:14,height:14}),`Rename`]}),m&&(0,q.jsxs)(`button`,{onClick:e=>{e.stopPropagation(),w(null),m()},className:`w-full px-3 py-2 text-left text-sm text-secondary hover:bg-hover hover:text-primary flex items-center gap-2`,role:`menuitem`,title:`Create a copy in a new tmux window`,children:[(0,q.jsx)(ce,{width:14,height:14}),`Duplicate`]}),f&&(0,q.jsxs)(`button`,{onClick:e=>{e.stopPropagation(),w(null),f()},className:`w-full px-3 py-2 text-left text-sm text-secondary hover:bg-hover hover:text-primary flex items-center gap-2`,role:`menuitem`,title:`Close the live window and keep this session ready to wake`,children:[(0,q.jsx)(we,{width:14,height:14}),`Hibernate`]}),e.logFilePath&&(0,q.jsxs)(`button`,{onClick:t=>{t.stopPropagation(),w(null),e.logFilePath&&Im(e.logFilePath)},className:`w-full px-3 py-2 text-left text-sm text-secondary hover:bg-hover hover:text-primary flex items-center gap-2`,role:`menuitem`,title:e.logFilePath,children:[(0,q.jsx)(ge,{width:14,height:14}),`Copy Log Path`]}),p&&(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(`div`,{className:`my-1 border-t border-border`}),(0,q.jsxs)(`button`,{onClick:e=>{e.stopPropagation(),w(null),p()},className:`w-full px-3 py-2 text-left text-sm text-danger hover:bg-danger/10 flex items-center gap-2`,role:`menuitem`,children:[(0,q.jsx)(Be,{width:14,height:14}),`Kill Session`]})]})]})]})}var KT={debug:0,info:1,warn:2,error:3},qT=`info`;function JT(e){let t=e.toLowerCase();t in KT&&(qT=t)}function YT(e,t,n=`debug`){if(!(KT[n]<KT[qT]))try{fetch(`/api/client-log`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({event:e,data:t,level:n})}).catch(()=>{})}catch{}}var XT=s(((e,t)=>{(function(n,r){if(typeof e==`object`&&typeof t==`object`)t.exports=r();else if(typeof define==`function`&&define.amd)define([],r);else{var i=r();for(var a in i)(typeof e==`object`?e:n)[a]=i[a]}})(globalThis,(()=>(()=>{var e={4567:function(e,t,n){var r=this&&this.__decorate||function(e,t,n,r){var i,a=arguments.length,o=a<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r;if(typeof Reflect==`object`&&typeof Reflect.decorate==`function`)o=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(o=(a<3?i(o):a>3?i(t,n,o):i(t,n))||o);return a>3&&o&&Object.defineProperty(t,n,o),o},i=this&&this.__param||function(e,t){return function(n,r){t(n,r,e)}};Object.defineProperty(t,`__esModule`,{value:!0}),t.AccessibilityManager=void 0;let a=n(9042),o=n(9924),s=n(844),c=n(4725),l=n(2585),u=n(3656),d=t.AccessibilityManager=class extends s.Disposable{constructor(e,t,n,r){super(),this._terminal=e,this._coreBrowserService=n,this._renderService=r,this._rowColumns=new WeakMap,this._liveRegionLineCount=0,this._charsToConsume=[],this._charsToAnnounce=``,this._accessibilityContainer=this._coreBrowserService.mainDocument.createElement(`div`),this._accessibilityContainer.classList.add(`xterm-accessibility`),this._rowContainer=this._coreBrowserService.mainDocument.createElement(`div`),this._rowContainer.setAttribute(`role`,`list`),this._rowContainer.classList.add(`xterm-accessibility-tree`),this._rowElements=[];for(let e=0;e<this._terminal.rows;e++)this._rowElements[e]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[e]);if(this._topBoundaryFocusListener=e=>this._handleBoundaryFocus(e,0),this._bottomBoundaryFocusListener=e=>this._handleBoundaryFocus(e,1),this._rowElements[0].addEventListener(`focus`,this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener(`focus`,this._bottomBoundaryFocusListener),this._refreshRowsDimensions(),this._accessibilityContainer.appendChild(this._rowContainer),this._liveRegion=this._coreBrowserService.mainDocument.createElement(`div`),this._liveRegion.classList.add(`live-region`),this._liveRegion.setAttribute(`aria-live`,`assertive`),this._accessibilityContainer.appendChild(this._liveRegion),this._liveRegionDebouncer=this.register(new o.TimeBasedDebouncer(this._renderRows.bind(this))),!this._terminal.element)throw Error(`Cannot enable accessibility before Terminal.open`);this._terminal.element.insertAdjacentElement(`afterbegin`,this._accessibilityContainer),this.register(this._terminal.onResize((e=>this._handleResize(e.rows)))),this.register(this._terminal.onRender((e=>this._refreshRows(e.start,e.end)))),this.register(this._terminal.onScroll((()=>this._refreshRows()))),this.register(this._terminal.onA11yChar((e=>this._handleChar(e)))),this.register(this._terminal.onLineFeed((()=>this._handleChar(`
52
52
  `)))),this.register(this._terminal.onA11yTab((e=>this._handleTab(e)))),this.register(this._terminal.onKey((e=>this._handleKey(e.key)))),this.register(this._terminal.onBlur((()=>this._clearLiveRegion()))),this.register(this._renderService.onDimensionsChange((()=>this._refreshRowsDimensions()))),this.register((0,u.addDisposableDomListener)(document,`selectionchange`,(()=>this._handleSelectionChange()))),this.register(this._coreBrowserService.onDprChange((()=>this._refreshRowsDimensions()))),this._refreshRows(),this.register((0,s.toDisposable)((()=>{this._accessibilityContainer.remove(),this._rowElements.length=0})))}_handleTab(e){for(let t=0;t<e;t++)this._handleChar(` `)}_handleChar(e){this._liveRegionLineCount<21&&(this._charsToConsume.length>0?this._charsToConsume.shift()!==e&&(this._charsToAnnounce+=e):this._charsToAnnounce+=e,e===`
53
53
  `&&(this._liveRegionLineCount++,this._liveRegionLineCount===21&&(this._liveRegion.textContent+=a.tooMuchOutput)))}_clearLiveRegion(){this._liveRegion.textContent=``,this._liveRegionLineCount=0}_handleKey(e){this._clearLiveRegion(),/\p{Control}/u.test(e)||this._charsToConsume.push(e)}_refreshRows(e,t){this._liveRegionDebouncer.refresh(e,t,this._terminal.rows)}_renderRows(e,t){let n=this._terminal.buffer,r=n.lines.length.toString();for(let i=e;i<=t;i++){let e=n.lines.get(n.ydisp+i),t=[],a=e?.translateToString(!0,void 0,void 0,t)||``,o=(n.ydisp+i+1).toString(),s=this._rowElements[i];s&&(a.length===0?(s.innerText=`\xA0`,this._rowColumns.set(s,[0,1])):(s.textContent=a,this._rowColumns.set(s,t)),s.setAttribute(`aria-posinset`,o),s.setAttribute(`aria-setsize`,r))}this._announceCharacters()}_announceCharacters(){this._charsToAnnounce.length!==0&&(this._liveRegion.textContent+=this._charsToAnnounce,this._charsToAnnounce=``)}_handleBoundaryFocus(e,t){let n=e.target,r=this._rowElements[t===0?1:this._rowElements.length-2];if(n.getAttribute(`aria-posinset`)===(t===0?`1`:`${this._terminal.buffer.lines.length}`)||e.relatedTarget!==r)return;let i,a;if(t===0?(i=n,a=this._rowElements.pop(),this._rowContainer.removeChild(a)):(i=this._rowElements.shift(),a=n,this._rowContainer.removeChild(i)),i.removeEventListener(`focus`,this._topBoundaryFocusListener),a.removeEventListener(`focus`,this._bottomBoundaryFocusListener),t===0){let e=this._createAccessibilityTreeNode();this._rowElements.unshift(e),this._rowContainer.insertAdjacentElement(`afterbegin`,e)}else{let e=this._createAccessibilityTreeNode();this._rowElements.push(e),this._rowContainer.appendChild(e)}this._rowElements[0].addEventListener(`focus`,this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener(`focus`,this._bottomBoundaryFocusListener),this._terminal.scrollLines(t===0?-1:1),this._rowElements[t===0?1:this._rowElements.length-2].focus(),e.preventDefault(),e.stopImmediatePropagation()}_handleSelectionChange(){if(this._rowElements.length===0)return;let e=document.getSelection();if(!e)return;if(e.isCollapsed)return void(this._rowContainer.contains(e.anchorNode)&&this._terminal.clearSelection());if(!e.anchorNode||!e.focusNode)return void console.error(`anchorNode and/or focusNode are null`);let t={node:e.anchorNode,offset:e.anchorOffset},n={node:e.focusNode,offset:e.focusOffset};if((t.node.compareDocumentPosition(n.node)&Node.DOCUMENT_POSITION_PRECEDING||t.node===n.node&&t.offset>n.offset)&&([t,n]=[n,t]),t.node.compareDocumentPosition(this._rowElements[0])&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_FOLLOWING)&&(t={node:this._rowElements[0].childNodes[0],offset:0}),!this._rowContainer.contains(t.node))return;let r=this._rowElements.slice(-1)[0];if(n.node.compareDocumentPosition(r)&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_PRECEDING)&&(n={node:r,offset:r.textContent?.length??0}),!this._rowContainer.contains(n.node))return;let i=({node:e,offset:t})=>{let n=e instanceof Text?e.parentNode:e,r=parseInt(n?.getAttribute(`aria-posinset`),10)-1;if(isNaN(r))return console.warn(`row is invalid. Race condition?`),null;let i=this._rowColumns.get(n);if(!i)return console.warn(`columns is null. Race condition?`),null;let a=t<i.length?i[t]:i.slice(-1)[0]+1;return a>=this._terminal.cols&&(++r,a=0),{row:r,column:a}},a=i(t),o=i(n);if(a&&o){if(a.row>o.row||a.row===o.row&&a.column>=o.column)throw Error(`invalid range`);this._terminal.select(a.column,a.row,(o.row-a.row)*this._terminal.cols-a.column+o.column)}}_handleResize(e){this._rowElements[this._rowElements.length-1].removeEventListener(`focus`,this._bottomBoundaryFocusListener);for(let e=this._rowContainer.children.length;e<this._terminal.rows;e++)this._rowElements[e]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[e]);for(;this._rowElements.length>e;)this._rowContainer.removeChild(this._rowElements.pop());this._rowElements[this._rowElements.length-1].addEventListener(`focus`,this._bottomBoundaryFocusListener),this._refreshRowsDimensions()}_createAccessibilityTreeNode(){let e=this._coreBrowserService.mainDocument.createElement(`div`);return e.setAttribute(`role`,`listitem`),e.tabIndex=-1,this._refreshRowDimensions(e),e}_refreshRowsDimensions(){if(this._renderService.dimensions.css.cell.height){this._accessibilityContainer.style.width=`${this._renderService.dimensions.css.canvas.width}px`,this._rowElements.length!==this._terminal.rows&&this._handleResize(this._terminal.rows);for(let e=0;e<this._terminal.rows;e++)this._refreshRowDimensions(this._rowElements[e])}}_refreshRowDimensions(e){e.style.height=`${this._renderService.dimensions.css.cell.height}px`}};t.AccessibilityManager=d=r([i(1,l.IInstantiationService),i(2,c.ICoreBrowserService),i(3,c.IRenderService)],d)},3614:(e,t)=>{function n(e){return e.replace(/\r?\n/g,`\r`)}function r(e,t){return t?`\x1B[200~`+e+`\x1B[201~`:e}function i(e,t,i,a){e=r(e=n(e),i.decPrivateModes.bracketedPasteMode&&!0!==a.rawOptions.ignoreBracketedPasteMode),i.triggerDataEvent(e,!0),t.value=``}function a(e,t,n){let r=n.getBoundingClientRect(),i=e.clientX-r.left-10,a=e.clientY-r.top-10;t.style.width=`20px`,t.style.height=`20px`,t.style.left=`${i}px`,t.style.top=`${a}px`,t.style.zIndex=`1000`,t.focus()}Object.defineProperty(t,`__esModule`,{value:!0}),t.rightClickHandler=t.moveTextAreaUnderMouseCursor=t.paste=t.handlePasteEvent=t.copyHandler=t.bracketTextForPaste=t.prepareTextForTerminal=void 0,t.prepareTextForTerminal=n,t.bracketTextForPaste=r,t.copyHandler=function(e,t){e.clipboardData&&e.clipboardData.setData(`text/plain`,t.selectionText),e.preventDefault()},t.handlePasteEvent=function(e,t,n,r){e.stopPropagation(),e.clipboardData&&i(e.clipboardData.getData(`text/plain`),t,n,r)},t.paste=i,t.moveTextAreaUnderMouseCursor=a,t.rightClickHandler=function(e,t,n,r,i){a(e,t,n),i&&r.rightClickSelect(e),t.value=r.selectionText,t.select()}},7239:(e,t,n)=>{Object.defineProperty(t,`__esModule`,{value:!0}),t.ColorContrastCache=void 0;let r=n(1505);t.ColorContrastCache=class{constructor(){this._color=new r.TwoKeyMap,this._css=new r.TwoKeyMap}setCss(e,t,n){this._css.set(e,t,n)}getCss(e,t){return this._css.get(e,t)}setColor(e,t,n){this._color.set(e,t,n)}getColor(e,t){return this._color.get(e,t)}clear(){this._color.clear(),this._css.clear()}}},3656:(e,t)=>{Object.defineProperty(t,`__esModule`,{value:!0}),t.addDisposableDomListener=void 0,t.addDisposableDomListener=function(e,t,n,r){e.addEventListener(t,n,r);let i=!1;return{dispose:()=>{i||(i=!0,e.removeEventListener(t,n,r))}}}},3551:function(e,t,n){var r=this&&this.__decorate||function(e,t,n,r){var i,a=arguments.length,o=a<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r;if(typeof Reflect==`object`&&typeof Reflect.decorate==`function`)o=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(o=(a<3?i(o):a>3?i(t,n,o):i(t,n))||o);return a>3&&o&&Object.defineProperty(t,n,o),o},i=this&&this.__param||function(e,t){return function(n,r){t(n,r,e)}};Object.defineProperty(t,`__esModule`,{value:!0}),t.Linkifier=void 0;let a=n(3656),o=n(8460),s=n(844),c=n(2585),l=n(4725),u=t.Linkifier=class extends s.Disposable{get currentLink(){return this._currentLink}constructor(e,t,n,r,i){super(),this._element=e,this._mouseService=t,this._renderService=n,this._bufferService=r,this._linkProviderService=i,this._linkCacheDisposables=[],this._isMouseOut=!0,this._wasResized=!1,this._activeLine=-1,this._onShowLinkUnderline=this.register(new o.EventEmitter),this.onShowLinkUnderline=this._onShowLinkUnderline.event,this._onHideLinkUnderline=this.register(new o.EventEmitter),this.onHideLinkUnderline=this._onHideLinkUnderline.event,this.register((0,s.getDisposeArrayDisposable)(this._linkCacheDisposables)),this.register((0,s.toDisposable)((()=>{this._lastMouseEvent=void 0,this._activeProviderReplies?.clear()}))),this.register(this._bufferService.onResize((()=>{this._clearCurrentLink(),this._wasResized=!0}))),this.register((0,a.addDisposableDomListener)(this._element,`mouseleave`,(()=>{this._isMouseOut=!0,this._clearCurrentLink()}))),this.register((0,a.addDisposableDomListener)(this._element,`mousemove`,this._handleMouseMove.bind(this))),this.register((0,a.addDisposableDomListener)(this._element,`mousedown`,this._handleMouseDown.bind(this))),this.register((0,a.addDisposableDomListener)(this._element,`mouseup`,this._handleMouseUp.bind(this)))}_handleMouseMove(e){this._lastMouseEvent=e;let t=this._positionFromMouseEvent(e,this._element,this._mouseService);if(!t)return;this._isMouseOut=!1;let n=e.composedPath();for(let e=0;e<n.length;e++){let t=n[e];if(t.classList.contains(`xterm`))break;if(t.classList.contains(`xterm-hover`))return}this._lastBufferCell&&t.x===this._lastBufferCell.x&&t.y===this._lastBufferCell.y||(this._handleHover(t),this._lastBufferCell=t)}_handleHover(e){if(this._activeLine!==e.y||this._wasResized)return this._clearCurrentLink(),this._askForLink(e,!1),void(this._wasResized=!1);this._currentLink&&this._linkAtPosition(this._currentLink.link,e)||(this._clearCurrentLink(),this._askForLink(e,!0))}_askForLink(e,t){this._activeProviderReplies&&t||(this._activeProviderReplies?.forEach((e=>{e?.forEach((e=>{e.link.dispose&&e.link.dispose()}))})),this._activeProviderReplies=new Map,this._activeLine=e.y);let n=!1;for(let[r,i]of this._linkProviderService.linkProviders.entries())t?this._activeProviderReplies?.get(r)&&(n=this._checkLinkProviderResult(r,e,n)):i.provideLinks(e.y,(t=>{if(this._isMouseOut)return;let i=t?.map((e=>({link:e})));this._activeProviderReplies?.set(r,i),n=this._checkLinkProviderResult(r,e,n),this._activeProviderReplies?.size===this._linkProviderService.linkProviders.length&&this._removeIntersectingLinks(e.y,this._activeProviderReplies)}))}_removeIntersectingLinks(e,t){let n=new Set;for(let r=0;r<t.size;r++){let i=t.get(r);if(i)for(let t=0;t<i.length;t++){let r=i[t],a=r.link.range.start.y<e?0:r.link.range.start.x,o=r.link.range.end.y>e?this._bufferService.cols:r.link.range.end.x;for(let e=a;e<=o;e++){if(n.has(e)){i.splice(t--,1);break}n.add(e)}}}}_checkLinkProviderResult(e,t,n){if(!this._activeProviderReplies)return n;let r=this._activeProviderReplies.get(e),i=!1;for(let t=0;t<e;t++)this._activeProviderReplies.has(t)&&!this._activeProviderReplies.get(t)||(i=!0);if(!i&&r){let e=r.find((e=>this._linkAtPosition(e.link,t)));e&&(n=!0,this._handleNewLink(e))}if(this._activeProviderReplies.size===this._linkProviderService.linkProviders.length&&!n)for(let e=0;e<this._activeProviderReplies.size;e++){let r=this._activeProviderReplies.get(e)?.find((e=>this._linkAtPosition(e.link,t)));if(r){n=!0,this._handleNewLink(r);break}}return n}_handleMouseDown(){this._mouseDownLink=this._currentLink}_handleMouseUp(e){if(!this._currentLink)return;let t=this._positionFromMouseEvent(e,this._element,this._mouseService);t&&this._mouseDownLink===this._currentLink&&this._linkAtPosition(this._currentLink.link,t)&&this._currentLink.link.activate(e,this._currentLink.link.text)}_clearCurrentLink(e,t){this._currentLink&&this._lastMouseEvent&&(!e||!t||this._currentLink.link.range.start.y>=e&&this._currentLink.link.range.end.y<=t)&&(this._linkLeave(this._element,this._currentLink.link,this._lastMouseEvent),this._currentLink=void 0,(0,s.disposeArray)(this._linkCacheDisposables))}_handleNewLink(e){if(!this._lastMouseEvent)return;let t=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);t&&this._linkAtPosition(e.link,t)&&(this._currentLink=e,this._currentLink.state={decorations:{underline:e.link.decorations===void 0||e.link.decorations.underline,pointerCursor:e.link.decorations===void 0||e.link.decorations.pointerCursor},isHovered:!0},this._linkHover(this._element,e.link,this._lastMouseEvent),e.link.decorations={},Object.defineProperties(e.link.decorations,{pointerCursor:{get:()=>this._currentLink?.state?.decorations.pointerCursor,set:e=>{this._currentLink?.state&&this._currentLink.state.decorations.pointerCursor!==e&&(this._currentLink.state.decorations.pointerCursor=e,this._currentLink.state.isHovered&&this._element.classList.toggle(`xterm-cursor-pointer`,e))}},underline:{get:()=>this._currentLink?.state?.decorations.underline,set:t=>{this._currentLink?.state&&this._currentLink?.state?.decorations.underline!==t&&(this._currentLink.state.decorations.underline=t,this._currentLink.state.isHovered&&this._fireUnderlineEvent(e.link,t))}}}),this._linkCacheDisposables.push(this._renderService.onRenderedViewportChange((e=>{if(!this._currentLink)return;let t=e.start===0?0:e.start+1+this._bufferService.buffer.ydisp,n=this._bufferService.buffer.ydisp+1+e.end;if(this._currentLink.link.range.start.y>=t&&this._currentLink.link.range.end.y<=n&&(this._clearCurrentLink(t,n),this._lastMouseEvent)){let e=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);e&&this._askForLink(e,!1)}}))))}_linkHover(e,t,n){this._currentLink?.state&&(this._currentLink.state.isHovered=!0,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(t,!0),this._currentLink.state.decorations.pointerCursor&&e.classList.add(`xterm-cursor-pointer`)),t.hover&&t.hover(n,t.text)}_fireUnderlineEvent(e,t){let n=e.range,r=this._bufferService.buffer.ydisp,i=this._createLinkUnderlineEvent(n.start.x-1,n.start.y-r-1,n.end.x,n.end.y-r-1,void 0);(t?this._onShowLinkUnderline:this._onHideLinkUnderline).fire(i)}_linkLeave(e,t,n){this._currentLink?.state&&(this._currentLink.state.isHovered=!1,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(t,!1),this._currentLink.state.decorations.pointerCursor&&e.classList.remove(`xterm-cursor-pointer`)),t.leave&&t.leave(n,t.text)}_linkAtPosition(e,t){let n=e.range.start.y*this._bufferService.cols+e.range.start.x,r=e.range.end.y*this._bufferService.cols+e.range.end.x,i=t.y*this._bufferService.cols+t.x;return n<=i&&i<=r}_positionFromMouseEvent(e,t,n){let r=n.getCoords(e,t,this._bufferService.cols,this._bufferService.rows);if(r)return{x:r[0],y:r[1]+this._bufferService.buffer.ydisp}}_createLinkUnderlineEvent(e,t,n,r,i){return{x1:e,y1:t,x2:n,y2:r,cols:this._bufferService.cols,fg:i}}};t.Linkifier=u=r([i(1,l.IMouseService),i(2,l.IRenderService),i(3,c.IBufferService),i(4,l.ILinkProviderService)],u)},9042:(e,t)=>{Object.defineProperty(t,`__esModule`,{value:!0}),t.tooMuchOutput=t.promptLabel=void 0,t.promptLabel=`Terminal input`,t.tooMuchOutput=`Too much output to announce, navigate to rows manually to read`},3730:function(e,t,n){var r=this&&this.__decorate||function(e,t,n,r){var i,a=arguments.length,o=a<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r;if(typeof Reflect==`object`&&typeof Reflect.decorate==`function`)o=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(o=(a<3?i(o):a>3?i(t,n,o):i(t,n))||o);return a>3&&o&&Object.defineProperty(t,n,o),o},i=this&&this.__param||function(e,t){return function(n,r){t(n,r,e)}};Object.defineProperty(t,`__esModule`,{value:!0}),t.OscLinkProvider=void 0;let a=n(511),o=n(2585),s=t.OscLinkProvider=class{constructor(e,t,n){this._bufferService=e,this._optionsService=t,this._oscLinkService=n}provideLinks(e,t){let n=this._bufferService.buffer.lines.get(e-1);if(!n)return void t(void 0);let r=[],i=this._optionsService.rawOptions.linkHandler,o=new a.CellData,s=n.getTrimmedLength(),l=-1,u=-1,d=!1;for(let t=0;t<s;t++)if(u!==-1||n.hasContent(t)){if(n.loadCell(t,o),o.hasExtendedAttrs()&&o.extended.urlId){if(u===-1){u=t,l=o.extended.urlId;continue}d=o.extended.urlId!==l}else u!==-1&&(d=!0);if(d||u!==-1&&t===s-1){let n=this._oscLinkService.getLinkData(l)?.uri;if(n){let a={start:{x:u+1,y:e},end:{x:t+(d||t!==s-1?0:1),y:e}},o=!1;if(!i?.allowNonHttpProtocols)try{let e=new URL(n);[`http:`,`https:`].includes(e.protocol)||(o=!0)}catch{o=!0}o||r.push({text:n,range:a,activate:(e,t)=>i?i.activate(e,t,a):c(0,t),hover:(e,t)=>i?.hover?.(e,t,a),leave:(e,t)=>i?.leave?.(e,t,a)})}d=!1,o.hasExtendedAttrs()&&o.extended.urlId?(u=t,l=o.extended.urlId):(u=-1,l=-1)}}t(r)}};function c(e,t){if(confirm(`Do you want to navigate to ${t}?\n\nWARNING: This link could potentially be dangerous`)){let e=window.open();if(e){try{e.opener=null}catch{}e.location.href=t}else console.warn(`Opening link blocked as opener could not be cleared`)}}t.OscLinkProvider=s=r([i(0,o.IBufferService),i(1,o.IOptionsService),i(2,o.IOscLinkService)],s)},6193:(e,t)=>{Object.defineProperty(t,`__esModule`,{value:!0}),t.RenderDebouncer=void 0,t.RenderDebouncer=class{constructor(e,t){this._renderCallback=e,this._coreBrowserService=t,this._refreshCallbacks=[]}dispose(){this._animationFrame&&=(this._coreBrowserService.window.cancelAnimationFrame(this._animationFrame),void 0)}addRefreshCallback(e){return this._refreshCallbacks.push(e),this._animationFrame||=this._coreBrowserService.window.requestAnimationFrame((()=>this._innerRefresh())),this._animationFrame}refresh(e,t,n){this._rowCount=n,e=e===void 0?0:e,t=t===void 0?this._rowCount-1:t,this._rowStart=this._rowStart===void 0?e:Math.min(this._rowStart,e),this._rowEnd=this._rowEnd===void 0?t:Math.max(this._rowEnd,t),this._animationFrame||=this._coreBrowserService.window.requestAnimationFrame((()=>this._innerRefresh()))}_innerRefresh(){if(this._animationFrame=void 0,this._rowStart===void 0||this._rowEnd===void 0||this._rowCount===void 0)return void this._runRefreshCallbacks();let e=Math.max(this._rowStart,0),t=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(e,t),this._runRefreshCallbacks()}_runRefreshCallbacks(){for(let e of this._refreshCallbacks)e(0);this._refreshCallbacks=[]}}},3236:(e,t,n)=>{Object.defineProperty(t,`__esModule`,{value:!0}),t.Terminal=void 0;let r=n(3614),i=n(3656),a=n(3551),o=n(9042),s=n(3730),c=n(1680),l=n(3107),u=n(5744),d=n(2950),f=n(1296),p=n(428),m=n(4269),h=n(5114),g=n(8934),_=n(3230),v=n(9312),y=n(4725),b=n(6731),x=n(8055),S=n(8969),C=n(8460),w=n(844),T=n(6114),E=n(8437),D=n(2584),O=n(7399),k=n(5941),A=n(9074),j=n(2585),M=n(5435),N=n(4567),P=n(779);class F extends S.CoreTerminal{get onFocus(){return this._onFocus.event}get onBlur(){return this._onBlur.event}get onA11yChar(){return this._onA11yCharEmitter.event}get onA11yTab(){return this._onA11yTabEmitter.event}get onWillOpen(){return this._onWillOpen.event}constructor(e={}){super(e),this.browser=T,this._keyDownHandled=!1,this._keyDownSeen=!1,this._keyPressHandled=!1,this._unprocessedDeadKey=!1,this._accessibilityManager=this.register(new w.MutableDisposable),this._onCursorMove=this.register(new C.EventEmitter),this.onCursorMove=this._onCursorMove.event,this._onKey=this.register(new C.EventEmitter),this.onKey=this._onKey.event,this._onRender=this.register(new C.EventEmitter),this.onRender=this._onRender.event,this._onSelectionChange=this.register(new C.EventEmitter),this.onSelectionChange=this._onSelectionChange.event,this._onTitleChange=this.register(new C.EventEmitter),this.onTitleChange=this._onTitleChange.event,this._onBell=this.register(new C.EventEmitter),this.onBell=this._onBell.event,this._onFocus=this.register(new C.EventEmitter),this._onBlur=this.register(new C.EventEmitter),this._onA11yCharEmitter=this.register(new C.EventEmitter),this._onA11yTabEmitter=this.register(new C.EventEmitter),this._onWillOpen=this.register(new C.EventEmitter),this._setup(),this._decorationService=this._instantiationService.createInstance(A.DecorationService),this._instantiationService.setService(j.IDecorationService,this._decorationService),this._linkProviderService=this._instantiationService.createInstance(P.LinkProviderService),this._instantiationService.setService(y.ILinkProviderService,this._linkProviderService),this._linkProviderService.registerLinkProvider(this._instantiationService.createInstance(s.OscLinkProvider)),this.register(this._inputHandler.onRequestBell((()=>this._onBell.fire()))),this.register(this._inputHandler.onRequestRefreshRows(((e,t)=>this.refresh(e,t)))),this.register(this._inputHandler.onRequestSendFocus((()=>this._reportFocus()))),this.register(this._inputHandler.onRequestReset((()=>this.reset()))),this.register(this._inputHandler.onRequestWindowsOptionsReport((e=>this._reportWindowsOptions(e)))),this.register(this._inputHandler.onColor((e=>this._handleColorEvent(e)))),this.register((0,C.forwardEvent)(this._inputHandler.onCursorMove,this._onCursorMove)),this.register((0,C.forwardEvent)(this._inputHandler.onTitleChange,this._onTitleChange)),this.register((0,C.forwardEvent)(this._inputHandler.onA11yChar,this._onA11yCharEmitter)),this.register((0,C.forwardEvent)(this._inputHandler.onA11yTab,this._onA11yTabEmitter)),this.register(this._bufferService.onResize((e=>this._afterResize(e.cols,e.rows)))),this.register((0,w.toDisposable)((()=>{this._customKeyEventHandler=void 0,this.element?.parentNode?.removeChild(this.element)})))}_handleColorEvent(e){if(this._themeService)for(let t of e){let e,n=``;switch(t.index){case 256:e=`foreground`,n=`10`;break;case 257:e=`background`,n=`11`;break;case 258:e=`cursor`,n=`12`;break;default:e=`ansi`,n=`4;`+t.index}switch(t.type){case 0:let r=x.color.toColorRGB(e===`ansi`?this._themeService.colors.ansi[t.index]:this._themeService.colors[e]);this.coreService.triggerDataEvent(`${D.C0.ESC}]${n};${(0,k.toRgbString)(r)}${D.C1_ESCAPED.ST}`);break;case 1:if(e===`ansi`)this._themeService.modifyColors((e=>e.ansi[t.index]=x.channels.toColor(...t.color)));else{let n=e;this._themeService.modifyColors((e=>e[n]=x.channels.toColor(...t.color)))}break;case 2:this._themeService.restoreColor(t.index)}}}_setup(){super._setup(),this._customKeyEventHandler=void 0}get buffer(){return this.buffers.active}focus(){this.textarea&&this.textarea.focus({preventScroll:!0})}_handleScreenReaderModeOptionChange(e){e?!this._accessibilityManager.value&&this._renderService&&(this._accessibilityManager.value=this._instantiationService.createInstance(N.AccessibilityManager,this)):this._accessibilityManager.clear()}_handleTextAreaFocus(e){this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(D.C0.ESC+`[I`),this.element.classList.add(`focus`),this._showCursor(),this._onFocus.fire()}blur(){return this.textarea?.blur()}_handleTextAreaBlur(){this.textarea.value=``,this.refresh(this.buffer.y,this.buffer.y),this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(D.C0.ESC+`[O`),this.element.classList.remove(`focus`),this._onBlur.fire()}_syncTextArea(){if(!this.textarea||!this.buffer.isCursorInViewport||this._compositionHelper.isComposing||!this._renderService)return;let e=this.buffer.ybase+this.buffer.y,t=this.buffer.lines.get(e);if(!t)return;let n=Math.min(this.buffer.x,this.cols-1),r=this._renderService.dimensions.css.cell.height,i=t.getWidth(n),a=this._renderService.dimensions.css.cell.width*i,o=this.buffer.y*this._renderService.dimensions.css.cell.height,s=n*this._renderService.dimensions.css.cell.width;this.textarea.style.left=s+`px`,this.textarea.style.top=o+`px`,this.textarea.style.width=a+`px`,this.textarea.style.height=r+`px`,this.textarea.style.lineHeight=r+`px`,this.textarea.style.zIndex=`-5`}_initGlobal(){this._bindKeys(),this.register((0,i.addDisposableDomListener)(this.element,`copy`,(e=>{this.hasSelection()&&(0,r.copyHandler)(e,this._selectionService)})));let e=e=>(0,r.handlePasteEvent)(e,this.textarea,this.coreService,this.optionsService);this.register((0,i.addDisposableDomListener)(this.textarea,`paste`,e)),this.register((0,i.addDisposableDomListener)(this.element,`paste`,e)),T.isFirefox?this.register((0,i.addDisposableDomListener)(this.element,`mousedown`,(e=>{e.button===2&&(0,r.rightClickHandler)(e,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)}))):this.register((0,i.addDisposableDomListener)(this.element,`contextmenu`,(e=>{(0,r.rightClickHandler)(e,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)}))),T.isLinux&&this.register((0,i.addDisposableDomListener)(this.element,`auxclick`,(e=>{e.button===1&&(0,r.moveTextAreaUnderMouseCursor)(e,this.textarea,this.screenElement)})))}_bindKeys(){this.register((0,i.addDisposableDomListener)(this.textarea,`keyup`,(e=>this._keyUp(e)),!0)),this.register((0,i.addDisposableDomListener)(this.textarea,`keydown`,(e=>this._keyDown(e)),!0)),this.register((0,i.addDisposableDomListener)(this.textarea,`keypress`,(e=>this._keyPress(e)),!0)),this.register((0,i.addDisposableDomListener)(this.textarea,`compositionstart`,(()=>this._compositionHelper.compositionstart()))),this.register((0,i.addDisposableDomListener)(this.textarea,`compositionupdate`,(e=>this._compositionHelper.compositionupdate(e)))),this.register((0,i.addDisposableDomListener)(this.textarea,`compositionend`,(()=>this._compositionHelper.compositionend()))),this.register((0,i.addDisposableDomListener)(this.textarea,`input`,(e=>this._inputEvent(e)),!0)),this.register(this.onRender((()=>this._compositionHelper.updateCompositionElements())))}open(e){if(!e)throw Error(`Terminal requires a parent element.`);if(e.isConnected||this._logService.debug(`Terminal.open was called on an element that was not attached to the DOM`),this.element?.ownerDocument.defaultView&&this._coreBrowserService)return void(this.element.ownerDocument.defaultView!==this._coreBrowserService.window&&(this._coreBrowserService.window=this.element.ownerDocument.defaultView));this._document=e.ownerDocument,this.options.documentOverride&&this.options.documentOverride instanceof Document&&(this._document=this.optionsService.rawOptions.documentOverride),this.element=this._document.createElement(`div`),this.element.dir=`ltr`,this.element.classList.add(`terminal`),this.element.classList.add(`xterm`),e.appendChild(this.element);let t=this._document.createDocumentFragment();this._viewportElement=this._document.createElement(`div`),this._viewportElement.classList.add(`xterm-viewport`),t.appendChild(this._viewportElement),this._viewportScrollArea=this._document.createElement(`div`),this._viewportScrollArea.classList.add(`xterm-scroll-area`),this._viewportElement.appendChild(this._viewportScrollArea),this.screenElement=this._document.createElement(`div`),this.screenElement.classList.add(`xterm-screen`),this.register((0,i.addDisposableDomListener)(this.screenElement,`mousemove`,(e=>this.updateCursorStyle(e)))),this._helperContainer=this._document.createElement(`div`),this._helperContainer.classList.add(`xterm-helpers`),this.screenElement.appendChild(this._helperContainer),t.appendChild(this.screenElement),this.textarea=this._document.createElement(`textarea`),this.textarea.classList.add(`xterm-helper-textarea`),this.textarea.setAttribute(`aria-label`,o.promptLabel),T.isChromeOS||this.textarea.setAttribute(`aria-multiline`,`false`),this.textarea.setAttribute(`autocorrect`,`off`),this.textarea.setAttribute(`autocapitalize`,`off`),this.textarea.setAttribute(`spellcheck`,`false`),this.textarea.tabIndex=0,this._coreBrowserService=this.register(this._instantiationService.createInstance(h.CoreBrowserService,this.textarea,e.ownerDocument.defaultView??window,this._document??typeof window<`u`?window.document:null)),this._instantiationService.setService(y.ICoreBrowserService,this._coreBrowserService),this.register((0,i.addDisposableDomListener)(this.textarea,`focus`,(e=>this._handleTextAreaFocus(e)))),this.register((0,i.addDisposableDomListener)(this.textarea,`blur`,(()=>this._handleTextAreaBlur()))),this._helperContainer.appendChild(this.textarea),this._charSizeService=this._instantiationService.createInstance(p.CharSizeService,this._document,this._helperContainer),this._instantiationService.setService(y.ICharSizeService,this._charSizeService),this._themeService=this._instantiationService.createInstance(b.ThemeService),this._instantiationService.setService(y.IThemeService,this._themeService),this._characterJoinerService=this._instantiationService.createInstance(m.CharacterJoinerService),this._instantiationService.setService(y.ICharacterJoinerService,this._characterJoinerService),this._renderService=this.register(this._instantiationService.createInstance(_.RenderService,this.rows,this.screenElement)),this._instantiationService.setService(y.IRenderService,this._renderService),this.register(this._renderService.onRenderedViewportChange((e=>this._onRender.fire(e)))),this.onResize((e=>this._renderService.resize(e.cols,e.rows))),this._compositionView=this._document.createElement(`div`),this._compositionView.classList.add(`composition-view`),this._compositionHelper=this._instantiationService.createInstance(d.CompositionHelper,this.textarea,this._compositionView),this._helperContainer.appendChild(this._compositionView),this._mouseService=this._instantiationService.createInstance(g.MouseService),this._instantiationService.setService(y.IMouseService,this._mouseService),this.linkifier=this.register(this._instantiationService.createInstance(a.Linkifier,this.screenElement)),this.element.appendChild(t);try{this._onWillOpen.fire(this.element)}catch{}this._renderService.hasRenderer()||this._renderService.setRenderer(this._createRenderer()),this.viewport=this._instantiationService.createInstance(c.Viewport,this._viewportElement,this._viewportScrollArea),this.viewport.onRequestScrollLines((e=>this.scrollLines(e.amount,e.suppressScrollEvent,1))),this.register(this._inputHandler.onRequestSyncScrollBar((()=>this.viewport.syncScrollArea()))),this.register(this.viewport),this.register(this.onCursorMove((()=>{this._renderService.handleCursorMove(),this._syncTextArea()}))),this.register(this.onResize((()=>this._renderService.handleResize(this.cols,this.rows)))),this.register(this.onBlur((()=>this._renderService.handleBlur()))),this.register(this.onFocus((()=>this._renderService.handleFocus()))),this.register(this._renderService.onDimensionsChange((()=>this.viewport.syncScrollArea()))),this._selectionService=this.register(this._instantiationService.createInstance(v.SelectionService,this.element,this.screenElement,this.linkifier)),this._instantiationService.setService(y.ISelectionService,this._selectionService),this.register(this._selectionService.onRequestScrollLines((e=>this.scrollLines(e.amount,e.suppressScrollEvent)))),this.register(this._selectionService.onSelectionChange((()=>this._onSelectionChange.fire()))),this.register(this._selectionService.onRequestRedraw((e=>this._renderService.handleSelectionChanged(e.start,e.end,e.columnSelectMode)))),this.register(this._selectionService.onLinuxMouseSelection((e=>{this.textarea.value=e,this.textarea.focus(),this.textarea.select()}))),this.register(this._onScroll.event((e=>{this.viewport.syncScrollArea(),this._selectionService.refresh()}))),this.register((0,i.addDisposableDomListener)(this._viewportElement,`scroll`,(()=>this._selectionService.refresh()))),this.register(this._instantiationService.createInstance(l.BufferDecorationRenderer,this.screenElement)),this.register((0,i.addDisposableDomListener)(this.element,`mousedown`,(e=>this._selectionService.handleMouseDown(e)))),this.coreMouseService.areMouseEventsActive?(this._selectionService.disable(),this.element.classList.add(`enable-mouse-events`)):this._selectionService.enable(),this.options.screenReaderMode&&(this._accessibilityManager.value=this._instantiationService.createInstance(N.AccessibilityManager,this)),this.register(this.optionsService.onSpecificOptionChange(`screenReaderMode`,(e=>this._handleScreenReaderModeOptionChange(e)))),this.options.overviewRulerWidth&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(u.OverviewRulerRenderer,this._viewportElement,this.screenElement))),this.optionsService.onSpecificOptionChange(`overviewRulerWidth`,(e=>{!this._overviewRulerRenderer&&e&&this._viewportElement&&this.screenElement&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(u.OverviewRulerRenderer,this._viewportElement,this.screenElement)))})),this._charSizeService.measure(),this.refresh(0,this.rows-1),this._initGlobal(),this.bindMouse()}_createRenderer(){return this._instantiationService.createInstance(f.DomRenderer,this,this._document,this.element,this.screenElement,this._viewportElement,this._helperContainer,this.linkifier)}bindMouse(){let e=this,t=this.element;function n(t){let n=e._mouseService.getMouseReportCoords(t,e.screenElement);if(!n)return!1;let r,i;switch(t.overrideType||t.type){case`mousemove`:i=32,t.buttons===void 0?(r=3,t.button!==void 0&&(r=t.button<3?t.button:3)):r=1&t.buttons?0:4&t.buttons?1:2&t.buttons?2:3;break;case`mouseup`:i=0,r=t.button<3?t.button:3;break;case`mousedown`:i=1,r=t.button<3?t.button:3;break;case`wheel`:if(e._customWheelEventHandler&&!1===e._customWheelEventHandler(t)||e.viewport.getLinesScrolled(t)===0)return!1;i=t.deltaY<0?0:1,r=4;break;default:return!1}return!(i===void 0||r===void 0||r>4)&&e.coreMouseService.triggerMouseEvent({col:n.col,row:n.row,x:n.x,y:n.y,button:r,action:i,ctrl:t.ctrlKey,alt:t.altKey,shift:t.shiftKey})}let r={mouseup:null,wheel:null,mousedrag:null,mousemove:null},a={mouseup:e=>(n(e),e.buttons||(this._document.removeEventListener(`mouseup`,r.mouseup),r.mousedrag&&this._document.removeEventListener(`mousemove`,r.mousedrag)),this.cancel(e)),wheel:e=>(n(e),this.cancel(e,!0)),mousedrag:e=>{e.buttons&&n(e)},mousemove:e=>{e.buttons||n(e)}};this.register(this.coreMouseService.onProtocolChange((e=>{e?(this.optionsService.rawOptions.logLevel===`debug`&&this._logService.debug(`Binding to mouse events:`,this.coreMouseService.explainEvents(e)),this.element.classList.add(`enable-mouse-events`),this._selectionService.disable()):(this._logService.debug(`Unbinding from mouse events.`),this.element.classList.remove(`enable-mouse-events`),this._selectionService.enable()),8&e?r.mousemove||=(t.addEventListener(`mousemove`,a.mousemove),a.mousemove):(t.removeEventListener(`mousemove`,r.mousemove),r.mousemove=null),16&e?r.wheel||=(t.addEventListener(`wheel`,a.wheel,{passive:!1}),a.wheel):(t.removeEventListener(`wheel`,r.wheel),r.wheel=null),2&e?r.mouseup||=a.mouseup:(this._document.removeEventListener(`mouseup`,r.mouseup),r.mouseup=null),4&e?r.mousedrag||=a.mousedrag:(this._document.removeEventListener(`mousemove`,r.mousedrag),r.mousedrag=null)}))),this.coreMouseService.activeProtocol=this.coreMouseService.activeProtocol,this.register((0,i.addDisposableDomListener)(t,`mousedown`,(e=>{if(e.preventDefault(),this.focus(),this.coreMouseService.areMouseEventsActive&&!this._selectionService.shouldForceSelection(e))return n(e),r.mouseup&&this._document.addEventListener(`mouseup`,r.mouseup),r.mousedrag&&this._document.addEventListener(`mousemove`,r.mousedrag),this.cancel(e)}))),this.register((0,i.addDisposableDomListener)(t,`wheel`,(e=>{if(!r.wheel){if(this._customWheelEventHandler&&!1===this._customWheelEventHandler(e))return!1;if(!this.buffer.hasScrollback){let t=this.viewport.getLinesScrolled(e);if(t===0)return;let n=D.C0.ESC+(this.coreService.decPrivateModes.applicationCursorKeys?`O`:`[`)+(e.deltaY<0?`A`:`B`),r=``;for(let e=0;e<Math.abs(t);e++)r+=n;return this.coreService.triggerDataEvent(r,!0),this.cancel(e,!0)}return this.viewport.handleWheel(e)?this.cancel(e):void 0}}),{passive:!1})),this.register((0,i.addDisposableDomListener)(t,`touchstart`,(e=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchStart(e),this.cancel(e)}),{passive:!0})),this.register((0,i.addDisposableDomListener)(t,`touchmove`,(e=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchMove(e)?void 0:this.cancel(e)}),{passive:!1}))}refresh(e,t){this._renderService?.refreshRows(e,t)}updateCursorStyle(e){this._selectionService?.shouldColumnSelect(e)?this.element.classList.add(`column-select`):this.element.classList.remove(`column-select`)}_showCursor(){this.coreService.isCursorInitialized||(this.coreService.isCursorInitialized=!0,this.refresh(this.buffer.y,this.buffer.y))}scrollLines(e,t,n=0){n===1?(super.scrollLines(e,t,n),this.refresh(0,this.rows-1)):this.viewport?.scrollLines(e)}paste(e){(0,r.paste)(e,this.textarea,this.coreService,this.optionsService)}attachCustomKeyEventHandler(e){this._customKeyEventHandler=e}attachCustomWheelEventHandler(e){this._customWheelEventHandler=e}registerLinkProvider(e){return this._linkProviderService.registerLinkProvider(e)}registerCharacterJoiner(e){if(!this._characterJoinerService)throw Error(`Terminal must be opened first`);let t=this._characterJoinerService.register(e);return this.refresh(0,this.rows-1),t}deregisterCharacterJoiner(e){if(!this._characterJoinerService)throw Error(`Terminal must be opened first`);this._characterJoinerService.deregister(e)&&this.refresh(0,this.rows-1)}get markers(){return this.buffer.markers}registerMarker(e){return this.buffer.addMarker(this.buffer.ybase+this.buffer.y+e)}registerDecoration(e){return this._decorationService.registerDecoration(e)}hasSelection(){return!!this._selectionService&&this._selectionService.hasSelection}select(e,t,n){this._selectionService.setSelection(e,t,n)}getSelection(){return this._selectionService?this._selectionService.selectionText:``}getSelectionPosition(){if(this._selectionService&&this._selectionService.hasSelection)return{start:{x:this._selectionService.selectionStart[0],y:this._selectionService.selectionStart[1]},end:{x:this._selectionService.selectionEnd[0],y:this._selectionService.selectionEnd[1]}}}clearSelection(){this._selectionService?.clearSelection()}selectAll(){this._selectionService?.selectAll()}selectLines(e,t){this._selectionService?.selectLines(e,t)}_keyDown(e){if(this._keyDownHandled=!1,this._keyDownSeen=!0,this._customKeyEventHandler&&!1===this._customKeyEventHandler(e))return!1;let t=this.browser.isMac&&this.options.macOptionIsMeta&&e.altKey;if(!t&&!this._compositionHelper.keydown(e))return this.options.scrollOnUserInput&&this.buffer.ybase!==this.buffer.ydisp&&this.scrollToBottom(),!1;t||e.key!==`Dead`&&e.key!==`AltGraph`||(this._unprocessedDeadKey=!0);let n=(0,O.evaluateKeyboardEvent)(e,this.coreService.decPrivateModes.applicationCursorKeys,this.browser.isMac,this.options.macOptionIsMeta);if(this.updateCursorStyle(e),n.type===3||n.type===2){let t=this.rows-1;return this.scrollLines(n.type===2?-t:t),this.cancel(e,!0)}return n.type===1&&this.selectAll(),!!this._isThirdLevelShift(this.browser,e)||(n.cancel&&this.cancel(e,!0),!n.key||!!(e.key&&!e.ctrlKey&&!e.altKey&&!e.metaKey&&e.key.length===1&&e.key.charCodeAt(0)>=65&&e.key.charCodeAt(0)<=90)||(this._unprocessedDeadKey?(this._unprocessedDeadKey=!1,!0):(n.key!==D.C0.ETX&&n.key!==D.C0.CR||(this.textarea.value=``),this._onKey.fire({key:n.key,domEvent:e}),this._showCursor(),this.coreService.triggerDataEvent(n.key,!0),!this.optionsService.rawOptions.screenReaderMode||e.altKey||e.ctrlKey?this.cancel(e,!0):void(this._keyDownHandled=!0))))}_isThirdLevelShift(e,t){let n=e.isMac&&!this.options.macOptionIsMeta&&t.altKey&&!t.ctrlKey&&!t.metaKey||e.isWindows&&t.altKey&&t.ctrlKey&&!t.metaKey||e.isWindows&&t.getModifierState(`AltGraph`);return t.type===`keypress`?n:n&&(!t.keyCode||t.keyCode>47)}_keyUp(e){this._keyDownSeen=!1,this._customKeyEventHandler&&!1===this._customKeyEventHandler(e)||(function(e){return e.keyCode===16||e.keyCode===17||e.keyCode===18}(e)||this.focus(),this.updateCursorStyle(e),this._keyPressHandled=!1)}_keyPress(e){let t;if(this._keyPressHandled=!1,this._keyDownHandled||this._customKeyEventHandler&&!1===this._customKeyEventHandler(e))return!1;if(this.cancel(e),e.charCode)t=e.charCode;else if(e.which===null||e.which===void 0)t=e.keyCode;else{if(e.which===0||e.charCode===0)return!1;t=e.which}return!(!t||(e.altKey||e.ctrlKey||e.metaKey)&&!this._isThirdLevelShift(this.browser,e)||(t=String.fromCharCode(t),this._onKey.fire({key:t,domEvent:e}),this._showCursor(),this.coreService.triggerDataEvent(t,!0),this._keyPressHandled=!0,this._unprocessedDeadKey=!1,0))}_inputEvent(e){if(e.data&&e.inputType===`insertText`&&(!e.composed||!this._keyDownSeen)&&!this.optionsService.rawOptions.screenReaderMode){if(this._keyPressHandled)return!1;this._unprocessedDeadKey=!1;let t=e.data;return this.coreService.triggerDataEvent(t,!0),this.cancel(e),!0}return!1}resize(e,t){e!==this.cols||t!==this.rows?super.resize(e,t):this._charSizeService&&!this._charSizeService.hasValidSize&&this._charSizeService.measure()}_afterResize(e,t){this._charSizeService?.measure(),this.viewport?.syncScrollArea(!0)}clear(){if(this.buffer.ybase!==0||this.buffer.y!==0){this.buffer.clearAllMarkers(),this.buffer.lines.set(0,this.buffer.lines.get(this.buffer.ybase+this.buffer.y)),this.buffer.lines.length=1,this.buffer.ydisp=0,this.buffer.ybase=0,this.buffer.y=0;for(let e=1;e<this.rows;e++)this.buffer.lines.push(this.buffer.getBlankLine(E.DEFAULT_ATTR_DATA));this._onScroll.fire({position:this.buffer.ydisp,source:0}),this.viewport?.reset(),this.refresh(0,this.rows-1)}}reset(){this.options.rows=this.rows,this.options.cols=this.cols;let e=this._customKeyEventHandler;this._setup(),super.reset(),this._selectionService?.reset(),this._decorationService.reset(),this.viewport?.reset(),this._customKeyEventHandler=e,this.refresh(0,this.rows-1)}clearTextureAtlas(){this._renderService?.clearTextureAtlas()}_reportFocus(){this.element?.classList.contains(`focus`)?this.coreService.triggerDataEvent(D.C0.ESC+`[I`):this.coreService.triggerDataEvent(D.C0.ESC+`[O`)}_reportWindowsOptions(e){if(this._renderService)switch(e){case M.WindowsOptionsReportType.GET_WIN_SIZE_PIXELS:let e=this._renderService.dimensions.css.canvas.width.toFixed(0),t=this._renderService.dimensions.css.canvas.height.toFixed(0);this.coreService.triggerDataEvent(`${D.C0.ESC}[4;${t};${e}t`);break;case M.WindowsOptionsReportType.GET_CELL_SIZE_PIXELS:let n=this._renderService.dimensions.css.cell.width.toFixed(0),r=this._renderService.dimensions.css.cell.height.toFixed(0);this.coreService.triggerDataEvent(`${D.C0.ESC}[6;${r};${n}t`)}}cancel(e,t){if(this.options.cancelEvents||t)return e.preventDefault(),e.stopPropagation(),!1}}t.Terminal=F},9924:(e,t)=>{Object.defineProperty(t,`__esModule`,{value:!0}),t.TimeBasedDebouncer=void 0,t.TimeBasedDebouncer=class{constructor(e,t=1e3){this._renderCallback=e,this._debounceThresholdMS=t,this._lastRefreshMs=0,this._additionalRefreshRequested=!1}dispose(){this._refreshTimeoutID&&clearTimeout(this._refreshTimeoutID)}refresh(e,t,n){this._rowCount=n,e=e===void 0?0:e,t=t===void 0?this._rowCount-1:t,this._rowStart=this._rowStart===void 0?e:Math.min(this._rowStart,e),this._rowEnd=this._rowEnd===void 0?t:Math.max(this._rowEnd,t);let r=Date.now();if(r-this._lastRefreshMs>=this._debounceThresholdMS)this._lastRefreshMs=r,this._innerRefresh();else if(!this._additionalRefreshRequested){let e=r-this._lastRefreshMs,t=this._debounceThresholdMS-e;this._additionalRefreshRequested=!0,this._refreshTimeoutID=window.setTimeout((()=>{this._lastRefreshMs=Date.now(),this._innerRefresh(),this._additionalRefreshRequested=!1,this._refreshTimeoutID=void 0}),t)}}_innerRefresh(){if(this._rowStart===void 0||this._rowEnd===void 0||this._rowCount===void 0)return;let e=Math.max(this._rowStart,0),t=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(e,t)}}},1680:function(e,t,n){var r=this&&this.__decorate||function(e,t,n,r){var i,a=arguments.length,o=a<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r;if(typeof Reflect==`object`&&typeof Reflect.decorate==`function`)o=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(o=(a<3?i(o):a>3?i(t,n,o):i(t,n))||o);return a>3&&o&&Object.defineProperty(t,n,o),o},i=this&&this.__param||function(e,t){return function(n,r){t(n,r,e)}};Object.defineProperty(t,`__esModule`,{value:!0}),t.Viewport=void 0;let a=n(3656),o=n(4725),s=n(8460),c=n(844),l=n(2585),u=t.Viewport=class extends c.Disposable{constructor(e,t,n,r,i,o,c,l){super(),this._viewportElement=e,this._scrollArea=t,this._bufferService=n,this._optionsService=r,this._charSizeService=i,this._renderService=o,this._coreBrowserService=c,this.scrollBarWidth=0,this._currentRowHeight=0,this._currentDeviceCellHeight=0,this._lastRecordedBufferLength=0,this._lastRecordedViewportHeight=0,this._lastRecordedBufferHeight=0,this._lastTouchY=0,this._lastScrollTop=0,this._wheelPartialScroll=0,this._refreshAnimationFrame=null,this._ignoreNextScrollEvent=!1,this._smoothScrollState={startTime:0,origin:-1,target:-1},this._onRequestScrollLines=this.register(new s.EventEmitter),this.onRequestScrollLines=this._onRequestScrollLines.event,this.scrollBarWidth=this._viewportElement.offsetWidth-this._scrollArea.offsetWidth||15,this.register((0,a.addDisposableDomListener)(this._viewportElement,`scroll`,this._handleScroll.bind(this))),this._activeBuffer=this._bufferService.buffer,this.register(this._bufferService.buffers.onBufferActivate((e=>this._activeBuffer=e.activeBuffer))),this._renderDimensions=this._renderService.dimensions,this.register(this._renderService.onDimensionsChange((e=>this._renderDimensions=e))),this._handleThemeChange(l.colors),this.register(l.onChangeColors((e=>this._handleThemeChange(e)))),this.register(this._optionsService.onSpecificOptionChange(`scrollback`,(()=>this.syncScrollArea()))),setTimeout((()=>this.syncScrollArea()))}_handleThemeChange(e){this._viewportElement.style.backgroundColor=e.background.css}reset(){this._currentRowHeight=0,this._currentDeviceCellHeight=0,this._lastRecordedBufferLength=0,this._lastRecordedViewportHeight=0,this._lastRecordedBufferHeight=0,this._lastTouchY=0,this._lastScrollTop=0,this._coreBrowserService.window.requestAnimationFrame((()=>this.syncScrollArea()))}_refresh(e){if(e)return this._innerRefresh(),void(this._refreshAnimationFrame!==null&&this._coreBrowserService.window.cancelAnimationFrame(this._refreshAnimationFrame));this._refreshAnimationFrame===null&&(this._refreshAnimationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._innerRefresh())))}_innerRefresh(){if(this._charSizeService.height>0){this._currentRowHeight=this._renderDimensions.device.cell.height/this._coreBrowserService.dpr,this._currentDeviceCellHeight=this._renderDimensions.device.cell.height,this._lastRecordedViewportHeight=this._viewportElement.offsetHeight;let e=Math.round(this._currentRowHeight*this._lastRecordedBufferLength)+(this._lastRecordedViewportHeight-this._renderDimensions.css.canvas.height);this._lastRecordedBufferHeight!==e&&(this._lastRecordedBufferHeight=e,this._scrollArea.style.height=this._lastRecordedBufferHeight+`px`)}let e=this._bufferService.buffer.ydisp*this._currentRowHeight;this._viewportElement.scrollTop!==e&&(this._ignoreNextScrollEvent=!0,this._viewportElement.scrollTop=e),this._refreshAnimationFrame=null}syncScrollArea(e=!1){if(this._lastRecordedBufferLength!==this._bufferService.buffer.lines.length)return this._lastRecordedBufferLength=this._bufferService.buffer.lines.length,void this._refresh(e);this._lastRecordedViewportHeight===this._renderService.dimensions.css.canvas.height&&this._lastScrollTop===this._activeBuffer.ydisp*this._currentRowHeight&&this._renderDimensions.device.cell.height===this._currentDeviceCellHeight||this._refresh(e)}_handleScroll(e){if(this._lastScrollTop=this._viewportElement.scrollTop,!this._viewportElement.offsetParent)return;if(this._ignoreNextScrollEvent)return this._ignoreNextScrollEvent=!1,void this._onRequestScrollLines.fire({amount:0,suppressScrollEvent:!0});let t=Math.round(this._lastScrollTop/this._currentRowHeight)-this._bufferService.buffer.ydisp;this._onRequestScrollLines.fire({amount:t,suppressScrollEvent:!0})}_smoothScroll(){if(this._isDisposed||this._smoothScrollState.origin===-1||this._smoothScrollState.target===-1)return;let e=this._smoothScrollPercent();this._viewportElement.scrollTop=this._smoothScrollState.origin+Math.round(e*(this._smoothScrollState.target-this._smoothScrollState.origin)),e<1?this._coreBrowserService.window.requestAnimationFrame((()=>this._smoothScroll())):this._clearSmoothScrollState()}_smoothScrollPercent(){return this._optionsService.rawOptions.smoothScrollDuration&&this._smoothScrollState.startTime?Math.max(Math.min((Date.now()-this._smoothScrollState.startTime)/this._optionsService.rawOptions.smoothScrollDuration,1),0):1}_clearSmoothScrollState(){this._smoothScrollState.startTime=0,this._smoothScrollState.origin=-1,this._smoothScrollState.target=-1}_bubbleScroll(e,t){let n=this._viewportElement.scrollTop+this._lastRecordedViewportHeight;return!(t<0&&this._viewportElement.scrollTop!==0||t>0&&n<this._lastRecordedBufferHeight)||(e.cancelable&&e.preventDefault(),!1)}handleWheel(e){let t=this._getPixelsScrolled(e);return t!==0&&(this._optionsService.rawOptions.smoothScrollDuration?(this._smoothScrollState.startTime=Date.now(),this._smoothScrollPercent()<1?(this._smoothScrollState.origin=this._viewportElement.scrollTop,this._smoothScrollState.target===-1?this._smoothScrollState.target=this._viewportElement.scrollTop+t:this._smoothScrollState.target+=t,this._smoothScrollState.target=Math.max(Math.min(this._smoothScrollState.target,this._viewportElement.scrollHeight),0),this._smoothScroll()):this._clearSmoothScrollState()):this._viewportElement.scrollTop+=t,this._bubbleScroll(e,t))}scrollLines(e){if(e!==0)if(this._optionsService.rawOptions.smoothScrollDuration){let t=e*this._currentRowHeight;this._smoothScrollState.startTime=Date.now(),this._smoothScrollPercent()<1?(this._smoothScrollState.origin=this._viewportElement.scrollTop,this._smoothScrollState.target=this._smoothScrollState.origin+t,this._smoothScrollState.target=Math.max(Math.min(this._smoothScrollState.target,this._viewportElement.scrollHeight),0),this._smoothScroll()):this._clearSmoothScrollState()}else this._onRequestScrollLines.fire({amount:e,suppressScrollEvent:!1})}_getPixelsScrolled(e){if(e.deltaY===0||e.shiftKey)return 0;let t=this._applyScrollModifier(e.deltaY,e);return e.deltaMode===WheelEvent.DOM_DELTA_LINE?t*=this._currentRowHeight:e.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(t*=this._currentRowHeight*this._bufferService.rows),t}getBufferElements(e,t){let n,r=``,i=[],a=t??this._bufferService.buffer.lines.length,o=this._bufferService.buffer.lines;for(let t=e;t<a;t++){let e=o.get(t);if(!e)continue;let a=o.get(t+1)?.isWrapped;if(r+=e.translateToString(!a),!a||t===o.length-1){let e=document.createElement(`div`);e.textContent=r,i.push(e),r.length>0&&(n=e),r=``}}return{bufferElements:i,cursorElement:n}}getLinesScrolled(e){if(e.deltaY===0||e.shiftKey)return 0;let t=this._applyScrollModifier(e.deltaY,e);return e.deltaMode===WheelEvent.DOM_DELTA_PIXEL?(t/=this._currentRowHeight+0,this._wheelPartialScroll+=t,t=Math.floor(Math.abs(this._wheelPartialScroll))*(this._wheelPartialScroll>0?1:-1),this._wheelPartialScroll%=1):e.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(t*=this._bufferService.rows),t}_applyScrollModifier(e,t){let n=this._optionsService.rawOptions.fastScrollModifier;return n===`alt`&&t.altKey||n===`ctrl`&&t.ctrlKey||n===`shift`&&t.shiftKey?e*this._optionsService.rawOptions.fastScrollSensitivity*this._optionsService.rawOptions.scrollSensitivity:e*this._optionsService.rawOptions.scrollSensitivity}handleTouchStart(e){this._lastTouchY=e.touches[0].pageY}handleTouchMove(e){let t=this._lastTouchY-e.touches[0].pageY;return this._lastTouchY=e.touches[0].pageY,t!==0&&(this._viewportElement.scrollTop+=t,this._bubbleScroll(e,t))}};t.Viewport=u=r([i(2,l.IBufferService),i(3,l.IOptionsService),i(4,o.ICharSizeService),i(5,o.IRenderService),i(6,o.ICoreBrowserService),i(7,o.IThemeService)],u)},3107:function(e,t,n){var r=this&&this.__decorate||function(e,t,n,r){var i,a=arguments.length,o=a<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r;if(typeof Reflect==`object`&&typeof Reflect.decorate==`function`)o=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(o=(a<3?i(o):a>3?i(t,n,o):i(t,n))||o);return a>3&&o&&Object.defineProperty(t,n,o),o},i=this&&this.__param||function(e,t){return function(n,r){t(n,r,e)}};Object.defineProperty(t,`__esModule`,{value:!0}),t.BufferDecorationRenderer=void 0;let a=n(4725),o=n(844),s=n(2585),c=t.BufferDecorationRenderer=class extends o.Disposable{constructor(e,t,n,r,i){super(),this._screenElement=e,this._bufferService=t,this._coreBrowserService=n,this._decorationService=r,this._renderService=i,this._decorationElements=new Map,this._altBufferIsActive=!1,this._dimensionsChanged=!1,this._container=document.createElement(`div`),this._container.classList.add(`xterm-decoration-container`),this._screenElement.appendChild(this._container),this.register(this._renderService.onRenderedViewportChange((()=>this._doRefreshDecorations()))),this.register(this._renderService.onDimensionsChange((()=>{this._dimensionsChanged=!0,this._queueRefresh()}))),this.register(this._coreBrowserService.onDprChange((()=>this._queueRefresh()))),this.register(this._bufferService.buffers.onBufferActivate((()=>{this._altBufferIsActive=this._bufferService.buffer===this._bufferService.buffers.alt}))),this.register(this._decorationService.onDecorationRegistered((()=>this._queueRefresh()))),this.register(this._decorationService.onDecorationRemoved((e=>this._removeDecoration(e)))),this.register((0,o.toDisposable)((()=>{this._container.remove(),this._decorationElements.clear()})))}_queueRefresh(){this._animationFrame===void 0&&(this._animationFrame=this._renderService.addRefreshCallback((()=>{this._doRefreshDecorations(),this._animationFrame=void 0})))}_doRefreshDecorations(){for(let e of this._decorationService.decorations)this._renderDecoration(e);this._dimensionsChanged=!1}_renderDecoration(e){this._refreshStyle(e),this._dimensionsChanged&&this._refreshXPosition(e)}_createElement(e){let t=this._coreBrowserService.mainDocument.createElement(`div`);t.classList.add(`xterm-decoration`),t.classList.toggle(`xterm-decoration-top-layer`,e?.options?.layer===`top`),t.style.width=`${Math.round((e.options.width||1)*this._renderService.dimensions.css.cell.width)}px`,t.style.height=(e.options.height||1)*this._renderService.dimensions.css.cell.height+`px`,t.style.top=(e.marker.line-this._bufferService.buffers.active.ydisp)*this._renderService.dimensions.css.cell.height+`px`,t.style.lineHeight=`${this._renderService.dimensions.css.cell.height}px`;let n=e.options.x??0;return n&&n>this._bufferService.cols&&(t.style.display=`none`),this._refreshXPosition(e,t),t}_refreshStyle(e){let t=e.marker.line-this._bufferService.buffers.active.ydisp;if(t<0||t>=this._bufferService.rows)e.element&&(e.element.style.display=`none`,e.onRenderEmitter.fire(e.element));else{let n=this._decorationElements.get(e);n||(n=this._createElement(e),e.element=n,this._decorationElements.set(e,n),this._container.appendChild(n),e.onDispose((()=>{this._decorationElements.delete(e),n.remove()}))),n.style.top=t*this._renderService.dimensions.css.cell.height+`px`,n.style.display=this._altBufferIsActive?`none`:`block`,e.onRenderEmitter.fire(n)}}_refreshXPosition(e,t=e.element){if(!t)return;let n=e.options.x??0;(e.options.anchor||`left`)===`right`?t.style.right=n?n*this._renderService.dimensions.css.cell.width+`px`:``:t.style.left=n?n*this._renderService.dimensions.css.cell.width+`px`:``}_removeDecoration(e){this._decorationElements.get(e)?.remove(),this._decorationElements.delete(e),e.dispose()}};t.BufferDecorationRenderer=c=r([i(1,s.IBufferService),i(2,a.ICoreBrowserService),i(3,s.IDecorationService),i(4,a.IRenderService)],c)},5871:(e,t)=>{Object.defineProperty(t,`__esModule`,{value:!0}),t.ColorZoneStore=void 0,t.ColorZoneStore=class{constructor(){this._zones=[],this._zonePool=[],this._zonePoolIndex=0,this._linePadding={full:0,left:0,center:0,right:0}}get zones(){return this._zonePool.length=Math.min(this._zonePool.length,this._zones.length),this._zones}clear(){this._zones.length=0,this._zonePoolIndex=0}addDecoration(e){if(e.options.overviewRulerOptions){for(let t of this._zones)if(t.color===e.options.overviewRulerOptions.color&&t.position===e.options.overviewRulerOptions.position){if(this._lineIntersectsZone(t,e.marker.line))return;if(this._lineAdjacentToZone(t,e.marker.line,e.options.overviewRulerOptions.position))return void this._addLineToZone(t,e.marker.line)}if(this._zonePoolIndex<this._zonePool.length)return this._zonePool[this._zonePoolIndex].color=e.options.overviewRulerOptions.color,this._zonePool[this._zonePoolIndex].position=e.options.overviewRulerOptions.position,this._zonePool[this._zonePoolIndex].startBufferLine=e.marker.line,this._zonePool[this._zonePoolIndex].endBufferLine=e.marker.line,void this._zones.push(this._zonePool[this._zonePoolIndex++]);this._zones.push({color:e.options.overviewRulerOptions.color,position:e.options.overviewRulerOptions.position,startBufferLine:e.marker.line,endBufferLine:e.marker.line}),this._zonePool.push(this._zones[this._zones.length-1]),this._zonePoolIndex++}}setPadding(e){this._linePadding=e}_lineIntersectsZone(e,t){return t>=e.startBufferLine&&t<=e.endBufferLine}_lineAdjacentToZone(e,t,n){return t>=e.startBufferLine-this._linePadding[n||`full`]&&t<=e.endBufferLine+this._linePadding[n||`full`]}_addLineToZone(e,t){e.startBufferLine=Math.min(e.startBufferLine,t),e.endBufferLine=Math.max(e.endBufferLine,t)}}},5744:function(e,t,n){var r=this&&this.__decorate||function(e,t,n,r){var i,a=arguments.length,o=a<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r;if(typeof Reflect==`object`&&typeof Reflect.decorate==`function`)o=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(o=(a<3?i(o):a>3?i(t,n,o):i(t,n))||o);return a>3&&o&&Object.defineProperty(t,n,o),o},i=this&&this.__param||function(e,t){return function(n,r){t(n,r,e)}};Object.defineProperty(t,`__esModule`,{value:!0}),t.OverviewRulerRenderer=void 0;let a=n(5871),o=n(4725),s=n(844),c=n(2585),l={full:0,left:0,center:0,right:0},u={full:0,left:0,center:0,right:0},d={full:0,left:0,center:0,right:0},f=t.OverviewRulerRenderer=class extends s.Disposable{get _width(){return this._optionsService.options.overviewRulerWidth||0}constructor(e,t,n,r,i,o,c){super(),this._viewportElement=e,this._screenElement=t,this._bufferService=n,this._decorationService=r,this._renderService=i,this._optionsService=o,this._coreBrowserService=c,this._colorZoneStore=new a.ColorZoneStore,this._shouldUpdateDimensions=!0,this._shouldUpdateAnchor=!0,this._lastKnownBufferLength=0,this._canvas=this._coreBrowserService.mainDocument.createElement(`canvas`),this._canvas.classList.add(`xterm-decoration-overview-ruler`),this._refreshCanvasDimensions(),this._viewportElement.parentElement?.insertBefore(this._canvas,this._viewportElement);let l=this._canvas.getContext(`2d`);if(!l)throw Error(`Ctx cannot be null`);this._ctx=l,this._registerDecorationListeners(),this._registerBufferChangeListeners(),this._registerDimensionChangeListeners(),this.register((0,s.toDisposable)((()=>{this._canvas?.remove()})))}_registerDecorationListeners(){this.register(this._decorationService.onDecorationRegistered((()=>this._queueRefresh(void 0,!0)))),this.register(this._decorationService.onDecorationRemoved((()=>this._queueRefresh(void 0,!0))))}_registerBufferChangeListeners(){this.register(this._renderService.onRenderedViewportChange((()=>this._queueRefresh()))),this.register(this._bufferService.buffers.onBufferActivate((()=>{this._canvas.style.display=this._bufferService.buffer===this._bufferService.buffers.alt?`none`:`block`}))),this.register(this._bufferService.onScroll((()=>{this._lastKnownBufferLength!==this._bufferService.buffers.normal.lines.length&&(this._refreshDrawHeightConstants(),this._refreshColorZonePadding())})))}_registerDimensionChangeListeners(){this.register(this._renderService.onRender((()=>{this._containerHeight&&this._containerHeight===this._screenElement.clientHeight||(this._queueRefresh(!0),this._containerHeight=this._screenElement.clientHeight)}))),this.register(this._optionsService.onSpecificOptionChange(`overviewRulerWidth`,(()=>this._queueRefresh(!0)))),this.register(this._coreBrowserService.onDprChange((()=>this._queueRefresh(!0)))),this._queueRefresh(!0)}_refreshDrawConstants(){let e=Math.floor(this._canvas.width/3),t=Math.ceil(this._canvas.width/3);u.full=this._canvas.width,u.left=e,u.center=t,u.right=e,this._refreshDrawHeightConstants(),d.full=0,d.left=0,d.center=u.left,d.right=u.left+u.center}_refreshDrawHeightConstants(){l.full=Math.round(2*this._coreBrowserService.dpr);let e=this._canvas.height/this._bufferService.buffer.lines.length,t=Math.round(Math.max(Math.min(e,12),6)*this._coreBrowserService.dpr);l.left=t,l.center=t,l.right=t}_refreshColorZonePadding(){this._colorZoneStore.setPadding({full:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*l.full),left:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*l.left),center:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*l.center),right:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*l.right)}),this._lastKnownBufferLength=this._bufferService.buffers.normal.lines.length}_refreshCanvasDimensions(){this._canvas.style.width=`${this._width}px`,this._canvas.width=Math.round(this._width*this._coreBrowserService.dpr),this._canvas.style.height=`${this._screenElement.clientHeight}px`,this._canvas.height=Math.round(this._screenElement.clientHeight*this._coreBrowserService.dpr),this._refreshDrawConstants(),this._refreshColorZonePadding()}_refreshDecorations(){this._shouldUpdateDimensions&&this._refreshCanvasDimensions(),this._ctx.clearRect(0,0,this._canvas.width,this._canvas.height),this._colorZoneStore.clear();for(let e of this._decorationService.decorations)this._colorZoneStore.addDecoration(e);this._ctx.lineWidth=1;let e=this._colorZoneStore.zones;for(let t of e)t.position!==`full`&&this._renderColorZone(t);for(let t of e)t.position===`full`&&this._renderColorZone(t);this._shouldUpdateDimensions=!1,this._shouldUpdateAnchor=!1}_renderColorZone(e){this._ctx.fillStyle=e.color,this._ctx.fillRect(d[e.position||`full`],Math.round((this._canvas.height-1)*(e.startBufferLine/this._bufferService.buffers.active.lines.length)-l[e.position||`full`]/2),u[e.position||`full`],Math.round((this._canvas.height-1)*((e.endBufferLine-e.startBufferLine)/this._bufferService.buffers.active.lines.length)+l[e.position||`full`]))}_queueRefresh(e,t){this._shouldUpdateDimensions=e||this._shouldUpdateDimensions,this._shouldUpdateAnchor=t||this._shouldUpdateAnchor,this._animationFrame===void 0&&(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>{this._refreshDecorations(),this._animationFrame=void 0})))}};t.OverviewRulerRenderer=f=r([i(2,c.IBufferService),i(3,c.IDecorationService),i(4,o.IRenderService),i(5,c.IOptionsService),i(6,o.ICoreBrowserService)],f)},2950:function(e,t,n){var r=this&&this.__decorate||function(e,t,n,r){var i,a=arguments.length,o=a<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r;if(typeof Reflect==`object`&&typeof Reflect.decorate==`function`)o=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(o=(a<3?i(o):a>3?i(t,n,o):i(t,n))||o);return a>3&&o&&Object.defineProperty(t,n,o),o},i=this&&this.__param||function(e,t){return function(n,r){t(n,r,e)}};Object.defineProperty(t,`__esModule`,{value:!0}),t.CompositionHelper=void 0;let a=n(4725),o=n(2585),s=n(2584),c=t.CompositionHelper=class{get isComposing(){return this._isComposing}constructor(e,t,n,r,i,a){this._textarea=e,this._compositionView=t,this._bufferService=n,this._optionsService=r,this._coreService=i,this._renderService=a,this._isComposing=!1,this._isSendingComposition=!1,this._compositionPosition={start:0,end:0},this._dataAlreadySent=``}compositionstart(){this._isComposing=!0,this._compositionPosition.start=this._textarea.value.length,this._compositionView.textContent=``,this._dataAlreadySent=``,this._compositionView.classList.add(`active`)}compositionupdate(e){this._compositionView.textContent=e.data,this.updateCompositionElements(),setTimeout((()=>{this._compositionPosition.end=this._textarea.value.length}),0)}compositionend(){this._finalizeComposition(!0)}keydown(e){if(this._isComposing||this._isSendingComposition){if(e.keyCode===229||e.keyCode===16||e.keyCode===17||e.keyCode===18)return!1;this._finalizeComposition(!1)}return e.keyCode!==229||(this._handleAnyTextareaChanges(),!1)}_finalizeComposition(e){if(this._compositionView.classList.remove(`active`),this._isComposing=!1,e){let e={start:this._compositionPosition.start,end:this._compositionPosition.end};this._isSendingComposition=!0,setTimeout((()=>{if(this._isSendingComposition){let t;this._isSendingComposition=!1,e.start+=this._dataAlreadySent.length,t=this._isComposing?this._textarea.value.substring(e.start,e.end):this._textarea.value.substring(e.start),t.length>0&&this._coreService.triggerDataEvent(t,!0)}}),0)}else{this._isSendingComposition=!1;let e=this._textarea.value.substring(this._compositionPosition.start,this._compositionPosition.end);this._coreService.triggerDataEvent(e,!0)}}_handleAnyTextareaChanges(){let e=this._textarea.value;setTimeout((()=>{if(!this._isComposing){let t=this._textarea.value,n=t.replace(e,``);this._dataAlreadySent=n,t.length>e.length?this._coreService.triggerDataEvent(n,!0):t.length<e.length?this._coreService.triggerDataEvent(`${s.C0.DEL}`,!0):t.length===e.length&&t!==e&&this._coreService.triggerDataEvent(t,!0)}}),0)}updateCompositionElements(e){if(this._isComposing){if(this._bufferService.buffer.isCursorInViewport){let e=Math.min(this._bufferService.buffer.x,this._bufferService.cols-1),t=this._renderService.dimensions.css.cell.height,n=this._bufferService.buffer.y*this._renderService.dimensions.css.cell.height,r=e*this._renderService.dimensions.css.cell.width;this._compositionView.style.left=r+`px`,this._compositionView.style.top=n+`px`,this._compositionView.style.height=t+`px`,this._compositionView.style.lineHeight=t+`px`,this._compositionView.style.fontFamily=this._optionsService.rawOptions.fontFamily,this._compositionView.style.fontSize=this._optionsService.rawOptions.fontSize+`px`;let i=this._compositionView.getBoundingClientRect();this._textarea.style.left=r+`px`,this._textarea.style.top=n+`px`,this._textarea.style.width=Math.max(i.width,1)+`px`,this._textarea.style.height=Math.max(i.height,1)+`px`,this._textarea.style.lineHeight=i.height+`px`}e||setTimeout((()=>this.updateCompositionElements(!0)),0)}}};t.CompositionHelper=c=r([i(2,o.IBufferService),i(3,o.IOptionsService),i(4,o.ICoreService),i(5,a.IRenderService)],c)},9806:(e,t)=>{function n(e,t,n){let r=n.getBoundingClientRect(),i=e.getComputedStyle(n),a=parseInt(i.getPropertyValue(`padding-left`)),o=parseInt(i.getPropertyValue(`padding-top`));return[t.clientX-r.left-a,t.clientY-r.top-o]}Object.defineProperty(t,`__esModule`,{value:!0}),t.getCoords=t.getCoordsRelativeToElement=void 0,t.getCoordsRelativeToElement=n,t.getCoords=function(e,t,r,i,a,o,s,c,l){if(!o)return;let u=n(e,t,r);return u?(u[0]=Math.ceil((u[0]+(l?s/2:0))/s),u[1]=Math.ceil(u[1]/c),u[0]=Math.min(Math.max(u[0],1),i+ +!!l),u[1]=Math.min(Math.max(u[1],1),a),u):void 0}},9504:(e,t,n)=>{Object.defineProperty(t,`__esModule`,{value:!0}),t.moveToCellSequence=void 0;let r=n(2584);function i(e,t,n,r){let i=e-a(e,n),s=t-a(t,n);return l(Math.abs(i-s)-function(e,t,n){let r=0,i=e-a(e,n),s=t-a(t,n);for(let a=0;a<Math.abs(i-s);a++){let s=o(e,t)===`A`?-1:1;n.buffer.lines.get(i+s*a)?.isWrapped&&r++}return r}(e,t,n),c(o(e,t),r))}function a(e,t){let n=0,r=t.buffer.lines.get(e),i=r?.isWrapped;for(;i&&e>=0&&e<t.rows;)n++,r=t.buffer.lines.get(--e),i=r?.isWrapped;return n}function o(e,t){return e>t?`A`:`B`}function s(e,t,n,r,i,a){let o=e,s=t,c=``;for(;o!==n||s!==r;)o+=i?1:-1,i&&o>a.cols-1?(c+=a.buffer.translateBufferLineToString(s,!1,e,o),o=0,e=0,s++):!i&&o<0&&(c+=a.buffer.translateBufferLineToString(s,!1,0,e+1),o=a.cols-1,e=o,s--);return c+a.buffer.translateBufferLineToString(s,!1,e,o)}function c(e,t){let n=t?`O`:`[`;return r.C0.ESC+n+e}function l(e,t){e=Math.floor(e);let n=``;for(let r=0;r<e;r++)n+=t;return n}t.moveToCellSequence=function(e,t,n,r){let o=n.buffer.x,u=n.buffer.y;if(!n.buffer.hasScrollback)return function(e,t,n,r,o,u){return i(t,r,o,u).length===0?``:l(s(e,t,e,t-a(t,o),!1,o).length,c(`D`,u))}(o,u,0,t,n,r)+i(u,t,n,r)+function(e,t,n,r,o,u){let d;d=i(t,r,o,u).length>0?r-a(r,o):t;let f=r,p=function(e,t,n,r,o,s){let c;return c=i(n,r,o,s).length>0?r-a(r,o):t,e<n&&c<=r||e>=n&&c<r?`C`:`D`}(e,t,n,r,o,u);return l(s(e,d,n,f,p===`C`,o).length,c(p,u))}(o,u,e,t,n,r);let d;if(u===t)return d=o>e?`D`:`C`,l(Math.abs(o-e),c(d,r));d=u>t?`D`:`C`;let f=Math.abs(u-t);return l(function(e,t){return t.cols-e}(u>t?e:o,n)+(f-1)*n.cols+1+((u>t?o:e)-1),c(d,r))}},1296:function(e,t,n){var r=this&&this.__decorate||function(e,t,n,r){var i,a=arguments.length,o=a<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r;if(typeof Reflect==`object`&&typeof Reflect.decorate==`function`)o=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(o=(a<3?i(o):a>3?i(t,n,o):i(t,n))||o);return a>3&&o&&Object.defineProperty(t,n,o),o},i=this&&this.__param||function(e,t){return function(n,r){t(n,r,e)}};Object.defineProperty(t,`__esModule`,{value:!0}),t.DomRenderer=void 0;let a=n(3787),o=n(2550),s=n(2223),c=n(6171),l=n(6052),u=n(4725),d=n(8055),f=n(8460),p=n(844),m=n(2585),h=`xterm-dom-renderer-owner-`,g=`xterm-rows`,_=`xterm-fg-`,v=`xterm-bg-`,y=`xterm-focus`,b=`xterm-selection`,x=1,S=t.DomRenderer=class extends p.Disposable{constructor(e,t,n,r,i,s,u,d,m,_,v,y,S){super(),this._terminal=e,this._document=t,this._element=n,this._screenElement=r,this._viewportElement=i,this._helperContainer=s,this._linkifier2=u,this._charSizeService=m,this._optionsService=_,this._bufferService=v,this._coreBrowserService=y,this._themeService=S,this._terminalClass=x++,this._rowElements=[],this._selectionRenderModel=(0,l.createSelectionRenderModel)(),this.onRequestRedraw=this.register(new f.EventEmitter).event,this._rowContainer=this._document.createElement(`div`),this._rowContainer.classList.add(g),this._rowContainer.style.lineHeight=`normal`,this._rowContainer.setAttribute(`aria-hidden`,`true`),this._refreshRowElements(this._bufferService.cols,this._bufferService.rows),this._selectionContainer=this._document.createElement(`div`),this._selectionContainer.classList.add(b),this._selectionContainer.setAttribute(`aria-hidden`,`true`),this.dimensions=(0,c.createRenderDimensions)(),this._updateDimensions(),this.register(this._optionsService.onOptionChange((()=>this._handleOptionsChanged()))),this.register(this._themeService.onChangeColors((e=>this._injectCss(e)))),this._injectCss(this._themeService.colors),this._rowFactory=d.createInstance(a.DomRendererRowFactory,document),this._element.classList.add(h+this._terminalClass),this._screenElement.appendChild(this._rowContainer),this._screenElement.appendChild(this._selectionContainer),this.register(this._linkifier2.onShowLinkUnderline((e=>this._handleLinkHover(e)))),this.register(this._linkifier2.onHideLinkUnderline((e=>this._handleLinkLeave(e)))),this.register((0,p.toDisposable)((()=>{this._element.classList.remove(h+this._terminalClass),this._rowContainer.remove(),this._selectionContainer.remove(),this._widthCache.dispose(),this._themeStyleElement.remove(),this._dimensionsStyleElement.remove()}))),this._widthCache=new o.WidthCache(this._document,this._helperContainer),this._widthCache.setFont(this._optionsService.rawOptions.fontFamily,this._optionsService.rawOptions.fontSize,this._optionsService.rawOptions.fontWeight,this._optionsService.rawOptions.fontWeightBold),this._setDefaultSpacing()}_updateDimensions(){let e=this._coreBrowserService.dpr;this.dimensions.device.char.width=this._charSizeService.width*e,this.dimensions.device.char.height=Math.ceil(this._charSizeService.height*e),this.dimensions.device.cell.width=this.dimensions.device.char.width+Math.round(this._optionsService.rawOptions.letterSpacing),this.dimensions.device.cell.height=Math.floor(this.dimensions.device.char.height*this._optionsService.rawOptions.lineHeight),this.dimensions.device.char.left=0,this.dimensions.device.char.top=0,this.dimensions.device.canvas.width=this.dimensions.device.cell.width*this._bufferService.cols,this.dimensions.device.canvas.height=this.dimensions.device.cell.height*this._bufferService.rows,this.dimensions.css.canvas.width=Math.round(this.dimensions.device.canvas.width/e),this.dimensions.css.canvas.height=Math.round(this.dimensions.device.canvas.height/e),this.dimensions.css.cell.width=this.dimensions.css.canvas.width/this._bufferService.cols,this.dimensions.css.cell.height=this.dimensions.css.canvas.height/this._bufferService.rows;for(let e of this._rowElements)e.style.width=`${this.dimensions.css.canvas.width}px`,e.style.height=`${this.dimensions.css.cell.height}px`,e.style.lineHeight=`${this.dimensions.css.cell.height}px`,e.style.overflow=`hidden`;this._dimensionsStyleElement||(this._dimensionsStyleElement=this._document.createElement(`style`),this._screenElement.appendChild(this._dimensionsStyleElement));let t=`${this._terminalSelector} .${g} span { display: inline-block; height: 100%; vertical-align: top;}`;this._dimensionsStyleElement.textContent=t,this._selectionContainer.style.height=this._viewportElement.style.height,this._screenElement.style.width=`${this.dimensions.css.canvas.width}px`,this._screenElement.style.height=`${this.dimensions.css.canvas.height}px`}_injectCss(e){this._themeStyleElement||(this._themeStyleElement=this._document.createElement(`style`),this._screenElement.appendChild(this._themeStyleElement));let t=`${this._terminalSelector} .${g} { color: ${e.foreground.css}; font-family: ${this._optionsService.rawOptions.fontFamily}; font-size: ${this._optionsService.rawOptions.fontSize}px; font-kerning: none; white-space: pre}`;t+=`${this._terminalSelector} .${g} .xterm-dim { color: ${d.color.multiplyOpacity(e.foreground,.5).css};}`,t+=`${this._terminalSelector} span:not(.xterm-bold) { font-weight: ${this._optionsService.rawOptions.fontWeight};}${this._terminalSelector} span.xterm-bold { font-weight: ${this._optionsService.rawOptions.fontWeightBold};}${this._terminalSelector} span.xterm-italic { font-style: italic;}`;let n=`blink_underline_${this._terminalClass}`,r=`blink_bar_${this._terminalClass}`,i=`blink_block_${this._terminalClass}`;t+=`@keyframes ${n} { 50% { border-bottom-style: hidden; }}`,t+=`@keyframes ${r} { 50% { box-shadow: none; }}`,t+=`@keyframes ${i} { 0% { background-color: ${e.cursor.css}; color: ${e.cursorAccent.css}; } 50% { background-color: inherit; color: ${e.cursor.css}; }}`,t+=`${this._terminalSelector} .${g}.${y} .xterm-cursor.xterm-cursor-blink.xterm-cursor-underline { animation: ${n} 1s step-end infinite;}${this._terminalSelector} .${g}.${y} .xterm-cursor.xterm-cursor-blink.xterm-cursor-bar { animation: ${r} 1s step-end infinite;}${this._terminalSelector} .${g}.${y} .xterm-cursor.xterm-cursor-blink.xterm-cursor-block { animation: ${i} 1s step-end infinite;}${this._terminalSelector} .${g} .xterm-cursor.xterm-cursor-block { background-color: ${e.cursor.css}; color: ${e.cursorAccent.css};}${this._terminalSelector} .${g} .xterm-cursor.xterm-cursor-block:not(.xterm-cursor-blink) { background-color: ${e.cursor.css} !important; color: ${e.cursorAccent.css} !important;}${this._terminalSelector} .${g} .xterm-cursor.xterm-cursor-outline { outline: 1px solid ${e.cursor.css}; outline-offset: -1px;}${this._terminalSelector} .${g} .xterm-cursor.xterm-cursor-bar { box-shadow: ${this._optionsService.rawOptions.cursorWidth}px 0 0 ${e.cursor.css} inset;}${this._terminalSelector} .${g} .xterm-cursor.xterm-cursor-underline { border-bottom: 1px ${e.cursor.css}; border-bottom-style: solid; height: calc(100% - 1px);}`,t+=`${this._terminalSelector} .${b} { position: absolute; top: 0; left: 0; z-index: 1; pointer-events: none;}${this._terminalSelector}.focus .${b} div { position: absolute; background-color: ${e.selectionBackgroundOpaque.css};}${this._terminalSelector} .${b} div { position: absolute; background-color: ${e.selectionInactiveBackgroundOpaque.css};}`;for(let[n,r]of e.ansi.entries())t+=`${this._terminalSelector} .${_}${n} { color: ${r.css}; }${this._terminalSelector} .${_}${n}.xterm-dim { color: ${d.color.multiplyOpacity(r,.5).css}; }${this._terminalSelector} .${v}${n} { background-color: ${r.css}; }`;t+=`${this._terminalSelector} .${_}${s.INVERTED_DEFAULT_COLOR} { color: ${d.color.opaque(e.background).css}; }${this._terminalSelector} .${_}${s.INVERTED_DEFAULT_COLOR}.xterm-dim { color: ${d.color.multiplyOpacity(d.color.opaque(e.background),.5).css}; }${this._terminalSelector} .${v}${s.INVERTED_DEFAULT_COLOR} { background-color: ${e.foreground.css}; }`,this._themeStyleElement.textContent=t}_setDefaultSpacing(){let e=this.dimensions.css.cell.width-this._widthCache.get(`W`,!1,!1);this._rowContainer.style.letterSpacing=`${e}px`,this._rowFactory.defaultSpacing=e}handleDevicePixelRatioChange(){this._updateDimensions(),this._widthCache.clear(),this._setDefaultSpacing()}_refreshRowElements(e,t){for(let e=this._rowElements.length;e<=t;e++){let e=this._document.createElement(`div`);this._rowContainer.appendChild(e),this._rowElements.push(e)}for(;this._rowElements.length>t;)this._rowContainer.removeChild(this._rowElements.pop())}handleResize(e,t){this._refreshRowElements(e,t),this._updateDimensions(),this.handleSelectionChanged(this._selectionRenderModel.selectionStart,this._selectionRenderModel.selectionEnd,this._selectionRenderModel.columnSelectMode)}handleCharSizeChanged(){this._updateDimensions(),this._widthCache.clear(),this._setDefaultSpacing()}handleBlur(){this._rowContainer.classList.remove(y),this.renderRows(0,this._bufferService.rows-1)}handleFocus(){this._rowContainer.classList.add(y),this.renderRows(this._bufferService.buffer.y,this._bufferService.buffer.y)}handleSelectionChanged(e,t,n){if(this._selectionContainer.replaceChildren(),this._rowFactory.handleSelectionChanged(e,t,n),this.renderRows(0,this._bufferService.rows-1),!e||!t)return;this._selectionRenderModel.update(this._terminal,e,t,n);let r=this._selectionRenderModel.viewportStartRow,i=this._selectionRenderModel.viewportEndRow,a=this._selectionRenderModel.viewportCappedStartRow,o=this._selectionRenderModel.viewportCappedEndRow;if(a>=this._bufferService.rows||o<0)return;let s=this._document.createDocumentFragment();if(n){let n=e[0]>t[0];s.appendChild(this._createSelectionElement(a,n?t[0]:e[0],n?e[0]:t[0],o-a+1))}else{let n=r===a?e[0]:0,c=a===i?t[0]:this._bufferService.cols;s.appendChild(this._createSelectionElement(a,n,c));let l=o-a-1;if(s.appendChild(this._createSelectionElement(a+1,0,this._bufferService.cols,l)),a!==o){let e=i===o?t[0]:this._bufferService.cols;s.appendChild(this._createSelectionElement(o,0,e))}}this._selectionContainer.appendChild(s)}_createSelectionElement(e,t,n,r=1){let i=this._document.createElement(`div`),a=t*this.dimensions.css.cell.width,o=this.dimensions.css.cell.width*(n-t);return a+o>this.dimensions.css.canvas.width&&(o=this.dimensions.css.canvas.width-a),i.style.height=r*this.dimensions.css.cell.height+`px`,i.style.top=e*this.dimensions.css.cell.height+`px`,i.style.left=`${a}px`,i.style.width=`${o}px`,i}handleCursorMove(){}_handleOptionsChanged(){this._updateDimensions(),this._injectCss(this._themeService.colors),this._widthCache.setFont(this._optionsService.rawOptions.fontFamily,this._optionsService.rawOptions.fontSize,this._optionsService.rawOptions.fontWeight,this._optionsService.rawOptions.fontWeightBold),this._setDefaultSpacing()}clear(){for(let e of this._rowElements)e.replaceChildren()}renderRows(e,t){let n=this._bufferService.buffer,r=n.ybase+n.y,i=Math.min(n.x,this._bufferService.cols-1),a=this._optionsService.rawOptions.cursorBlink,o=this._optionsService.rawOptions.cursorStyle,s=this._optionsService.rawOptions.cursorInactiveStyle;for(let c=e;c<=t;c++){let e=c+n.ydisp,t=this._rowElements[c],l=n.lines.get(e);if(!t||!l)break;t.replaceChildren(...this._rowFactory.createRow(l,e,e===r,o,s,i,a,this.dimensions.css.cell.width,this._widthCache,-1,-1))}}get _terminalSelector(){return`.${h}${this._terminalClass}`}_handleLinkHover(e){this._setCellUnderline(e.x1,e.x2,e.y1,e.y2,e.cols,!0)}_handleLinkLeave(e){this._setCellUnderline(e.x1,e.x2,e.y1,e.y2,e.cols,!1)}_setCellUnderline(e,t,n,r,i,a){n<0&&(e=0),r<0&&(t=0);let o=this._bufferService.rows-1;n=Math.max(Math.min(n,o),0),r=Math.max(Math.min(r,o),0),i=Math.min(i,this._bufferService.cols);let s=this._bufferService.buffer,c=s.ybase+s.y,l=Math.min(s.x,i-1),u=this._optionsService.rawOptions.cursorBlink,d=this._optionsService.rawOptions.cursorStyle,f=this._optionsService.rawOptions.cursorInactiveStyle;for(let o=n;o<=r;++o){let p=o+s.ydisp,m=this._rowElements[o],h=s.lines.get(p);if(!m||!h)break;m.replaceChildren(...this._rowFactory.createRow(h,p,p===c,d,f,l,u,this.dimensions.css.cell.width,this._widthCache,a?o===n?e:0:-1,a?(o===r?t:i)-1:-1))}}};t.DomRenderer=S=r([i(7,m.IInstantiationService),i(8,u.ICharSizeService),i(9,m.IOptionsService),i(10,m.IBufferService),i(11,u.ICoreBrowserService),i(12,u.IThemeService)],S)},3787:function(e,t,n){var r=this&&this.__decorate||function(e,t,n,r){var i,a=arguments.length,o=a<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r;if(typeof Reflect==`object`&&typeof Reflect.decorate==`function`)o=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(o=(a<3?i(o):a>3?i(t,n,o):i(t,n))||o);return a>3&&o&&Object.defineProperty(t,n,o),o},i=this&&this.__param||function(e,t){return function(n,r){t(n,r,e)}};Object.defineProperty(t,`__esModule`,{value:!0}),t.DomRendererRowFactory=void 0;let a=n(2223),o=n(643),s=n(511),c=n(2585),l=n(8055),u=n(4725),d=n(4269),f=n(6171),p=n(3734),m=t.DomRendererRowFactory=class{constructor(e,t,n,r,i,a,o){this._document=e,this._characterJoinerService=t,this._optionsService=n,this._coreBrowserService=r,this._coreService=i,this._decorationService=a,this._themeService=o,this._workCell=new s.CellData,this._columnSelectMode=!1,this.defaultSpacing=0}handleSelectionChanged(e,t,n){this._selectionStart=e,this._selectionEnd=t,this._columnSelectMode=n}createRow(e,t,n,r,i,s,c,u,f,m,g){let _=[],v=this._characterJoinerService.getJoinedCharacters(t),y=this._themeService.colors,b,x=e.getNoBgTrimmedLength();n&&x<s+1&&(x=s+1);let S=0,C=``,w=0,T=0,E=0,D=!1,O=0,k=!1,A=0,j=[],M=m!==-1&&g!==-1;for(let N=0;N<x;N++){e.loadCell(N,this._workCell);let x=this._workCell.getWidth();if(x===0)continue;let P=!1,F=N,I=this._workCell;if(v.length>0&&N===v[0][0]){P=!0;let t=v.shift();I=new d.JoinedCellData(this._workCell,e.translateToString(!0,t[0],t[1]),t[1]-t[0]),F=t[1]-1,x=I.getWidth()}let L=this._isCellInSelection(N,t),R=n&&N===s,z=M&&N>=m&&N<=g,B=!1;this._decorationService.forEachDecorationAtCell(N,t,void 0,(e=>{B=!0}));let V=I.getChars()||o.WHITESPACE_CELL_CHAR;if(V===` `&&(I.isUnderline()||I.isOverline())&&(V=`\xA0`),A=x*u-f.get(V,I.isBold(),I.isItalic()),b){if(S&&(L&&k||!L&&!k&&I.bg===w)&&(L&&k&&y.selectionForeground||I.fg===T)&&I.extended.ext===E&&z===D&&A===O&&!R&&!P&&!B){I.isInvisible()?C+=o.WHITESPACE_CELL_CHAR:C+=V,S++;continue}S&&(b.textContent=C),b=this._document.createElement(`span`),S=0,C=``}else b=this._document.createElement(`span`);if(w=I.bg,T=I.fg,E=I.extended.ext,D=z,O=A,k=L,P&&s>=N&&s<=F&&(s=N),!this._coreService.isCursorHidden&&R&&this._coreService.isCursorInitialized){if(j.push(`xterm-cursor`),this._coreBrowserService.isFocused)c&&j.push(`xterm-cursor-blink`),j.push(r===`bar`?`xterm-cursor-bar`:r===`underline`?`xterm-cursor-underline`:`xterm-cursor-block`);else if(i)switch(i){case`outline`:j.push(`xterm-cursor-outline`);break;case`block`:j.push(`xterm-cursor-block`);break;case`bar`:j.push(`xterm-cursor-bar`);break;case`underline`:j.push(`xterm-cursor-underline`)}}if(I.isBold()&&j.push(`xterm-bold`),I.isItalic()&&j.push(`xterm-italic`),I.isDim()&&j.push(`xterm-dim`),C=I.isInvisible()?o.WHITESPACE_CELL_CHAR:I.getChars()||o.WHITESPACE_CELL_CHAR,I.isUnderline()&&(j.push(`xterm-underline-${I.extended.underlineStyle}`),C===` `&&(C=`\xA0`),!I.isUnderlineColorDefault()))if(I.isUnderlineColorRGB())b.style.textDecorationColor=`rgb(${p.AttributeData.toColorRGB(I.getUnderlineColor()).join(`,`)})`;else{let e=I.getUnderlineColor();this._optionsService.rawOptions.drawBoldTextInBrightColors&&I.isBold()&&e<8&&(e+=8),b.style.textDecorationColor=y.ansi[e].css}I.isOverline()&&(j.push(`xterm-overline`),C===` `&&(C=`\xA0`)),I.isStrikethrough()&&j.push(`xterm-strikethrough`),z&&(b.style.textDecoration=`underline`);let H=I.getFgColor(),U=I.getFgColorMode(),W=I.getBgColor(),G=I.getBgColorMode(),ee=!!I.isInverse();if(ee){let e=H;H=W,W=e;let t=U;U=G,G=t}let K,te,ne,re=!1;switch(this._decorationService.forEachDecorationAtCell(N,t,void 0,(e=>{e.options.layer!==`top`&&re||(e.backgroundColorRGB&&(G=50331648,W=e.backgroundColorRGB.rgba>>8&16777215,K=e.backgroundColorRGB),e.foregroundColorRGB&&(U=50331648,H=e.foregroundColorRGB.rgba>>8&16777215,te=e.foregroundColorRGB),re=e.options.layer===`top`)})),!re&&L&&(K=this._coreBrowserService.isFocused?y.selectionBackgroundOpaque:y.selectionInactiveBackgroundOpaque,W=K.rgba>>8&16777215,G=50331648,re=!0,y.selectionForeground&&(U=50331648,H=y.selectionForeground.rgba>>8&16777215,te=y.selectionForeground)),re&&j.push(`xterm-decoration-top`),G){case 16777216:case 33554432:ne=y.ansi[W],j.push(`xterm-bg-${W}`);break;case 50331648:ne=l.channels.toColor(W>>16,W>>8&255,255&W),this._addStyle(b,`background-color:#${h((W>>>0).toString(16),`0`,6)}`);break;default:ee?(ne=y.foreground,j.push(`xterm-bg-${a.INVERTED_DEFAULT_COLOR}`)):ne=y.background}switch(K||I.isDim()&&(K=l.color.multiplyOpacity(ne,.5)),U){case 16777216:case 33554432:I.isBold()&&H<8&&this._optionsService.rawOptions.drawBoldTextInBrightColors&&(H+=8),this._applyMinimumContrast(b,ne,y.ansi[H],I,K,void 0)||j.push(`xterm-fg-${H}`);break;case 50331648:let e=l.channels.toColor(H>>16&255,H>>8&255,255&H);this._applyMinimumContrast(b,ne,e,I,K,te)||this._addStyle(b,`color:#${h(H.toString(16),`0`,6)}`);break;default:this._applyMinimumContrast(b,ne,y.foreground,I,K,te)||ee&&j.push(`xterm-fg-${a.INVERTED_DEFAULT_COLOR}`)}j.length&&=(b.className=j.join(` `),0),R||P||B?b.textContent=C:S++,A!==this.defaultSpacing&&(b.style.letterSpacing=`${A}px`),_.push(b),N=F}return b&&S&&(b.textContent=C),_}_applyMinimumContrast(e,t,n,r,i,a){if(this._optionsService.rawOptions.minimumContrastRatio===1||(0,f.treatGlyphAsBackgroundColor)(r.getCode()))return!1;let o=this._getContrastCache(r),s;if(i||a||(s=o.getColor(t.rgba,n.rgba)),s===void 0){let e=this._optionsService.rawOptions.minimumContrastRatio/(r.isDim()?2:1);s=l.color.ensureContrastRatio(i||t,a||n,e),o.setColor((i||t).rgba,(a||n).rgba,s??null)}return!!s&&(this._addStyle(e,`color:${s.css}`),!0)}_getContrastCache(e){return e.isDim()?this._themeService.colors.halfContrastCache:this._themeService.colors.contrastCache}_addStyle(e,t){e.setAttribute(`style`,`${e.getAttribute(`style`)||``}${t};`)}_isCellInSelection(e,t){let n=this._selectionStart,r=this._selectionEnd;return!(!n||!r)&&(this._columnSelectMode?n[0]<=r[0]?e>=n[0]&&t>=n[1]&&e<r[0]&&t<=r[1]:e<n[0]&&t>=n[1]&&e>=r[0]&&t<=r[1]:t>n[1]&&t<r[1]||n[1]===r[1]&&t===n[1]&&e>=n[0]&&e<r[0]||n[1]<r[1]&&t===r[1]&&e<r[0]||n[1]<r[1]&&t===n[1]&&e>=n[0])}};function h(e,t,n){for(;e.length<n;)e=t+e;return e}t.DomRendererRowFactory=m=r([i(1,u.ICharacterJoinerService),i(2,c.IOptionsService),i(3,u.ICoreBrowserService),i(4,c.ICoreService),i(5,c.IDecorationService),i(6,u.IThemeService)],m)},2550:(e,t)=>{Object.defineProperty(t,`__esModule`,{value:!0}),t.WidthCache=void 0,t.WidthCache=class{constructor(e,t){this._flat=new Float32Array(256),this._font=``,this._fontSize=0,this._weight=`normal`,this._weightBold=`bold`,this._measureElements=[],this._container=e.createElement(`div`),this._container.classList.add(`xterm-width-cache-measure-container`),this._container.setAttribute(`aria-hidden`,`true`),this._container.style.whiteSpace=`pre`,this._container.style.fontKerning=`none`;let n=e.createElement(`span`);n.classList.add(`xterm-char-measure-element`);let r=e.createElement(`span`);r.classList.add(`xterm-char-measure-element`),r.style.fontWeight=`bold`;let i=e.createElement(`span`);i.classList.add(`xterm-char-measure-element`),i.style.fontStyle=`italic`;let a=e.createElement(`span`);a.classList.add(`xterm-char-measure-element`),a.style.fontWeight=`bold`,a.style.fontStyle=`italic`,this._measureElements=[n,r,i,a],this._container.appendChild(n),this._container.appendChild(r),this._container.appendChild(i),this._container.appendChild(a),t.appendChild(this._container),this.clear()}dispose(){this._container.remove(),this._measureElements.length=0,this._holey=void 0}clear(){this._flat.fill(-9999),this._holey=new Map}setFont(e,t,n,r){e===this._font&&t===this._fontSize&&n===this._weight&&r===this._weightBold||(this._font=e,this._fontSize=t,this._weight=n,this._weightBold=r,this._container.style.fontFamily=this._font,this._container.style.fontSize=`${this._fontSize}px`,this._measureElements[0].style.fontWeight=`${n}`,this._measureElements[1].style.fontWeight=`${r}`,this._measureElements[2].style.fontWeight=`${n}`,this._measureElements[3].style.fontWeight=`${r}`,this.clear())}get(e,t,n){let r=0;if(!t&&!n&&e.length===1&&(r=e.charCodeAt(0))<256){if(this._flat[r]!==-9999)return this._flat[r];let t=this._measure(e,0);return t>0&&(this._flat[r]=t),t}let i=e;t&&(i+=`B`),n&&(i+=`I`);let a=this._holey.get(i);if(a===void 0){let r=0;t&&(r|=1),n&&(r|=2),a=this._measure(e,r),a>0&&this._holey.set(i,a)}return a}_measure(e,t){let n=this._measureElements[t];return n.textContent=e.repeat(32),n.offsetWidth/32}}},2223:(e,t,n)=>{Object.defineProperty(t,`__esModule`,{value:!0}),t.TEXT_BASELINE=t.DIM_OPACITY=t.INVERTED_DEFAULT_COLOR=void 0;let r=n(6114);t.INVERTED_DEFAULT_COLOR=257,t.DIM_OPACITY=.5,t.TEXT_BASELINE=r.isFirefox||r.isLegacyEdge?`bottom`:`ideographic`},6171:(e,t)=>{function n(e){return 57508<=e&&e<=57558}function r(e){return e>=128512&&e<=128591||e>=127744&&e<=128511||e>=128640&&e<=128767||e>=9728&&e<=9983||e>=9984&&e<=10175||e>=65024&&e<=65039||e>=129280&&e<=129535||e>=127462&&e<=127487}Object.defineProperty(t,`__esModule`,{value:!0}),t.computeNextVariantOffset=t.createRenderDimensions=t.treatGlyphAsBackgroundColor=t.allowRescaling=t.isEmoji=t.isRestrictedPowerlineGlyph=t.isPowerlineGlyph=t.throwIfFalsy=void 0,t.throwIfFalsy=function(e){if(!e)throw Error(`value must not be falsy`);return e},t.isPowerlineGlyph=n,t.isRestrictedPowerlineGlyph=function(e){return 57520<=e&&e<=57527},t.isEmoji=r,t.allowRescaling=function(e,t,i,a){return t===1&&i>Math.ceil(1.5*a)&&e!==void 0&&e>255&&!r(e)&&!n(e)&&!function(e){return 57344<=e&&e<=63743}(e)},t.treatGlyphAsBackgroundColor=function(e){return n(e)||function(e){return 9472<=e&&e<=9631}(e)},t.createRenderDimensions=function(){return{css:{canvas:{width:0,height:0},cell:{width:0,height:0}},device:{canvas:{width:0,height:0},cell:{width:0,height:0},char:{width:0,height:0,left:0,top:0}}}},t.computeNextVariantOffset=function(e,t,n=0){return(e-(2*Math.round(t)-n))%(2*Math.round(t))}},6052:(e,t)=>{Object.defineProperty(t,`__esModule`,{value:!0}),t.createSelectionRenderModel=void 0;class n{constructor(){this.clear()}clear(){this.hasSelection=!1,this.columnSelectMode=!1,this.viewportStartRow=0,this.viewportEndRow=0,this.viewportCappedStartRow=0,this.viewportCappedEndRow=0,this.startCol=0,this.endCol=0,this.selectionStart=void 0,this.selectionEnd=void 0}update(e,t,n,r=!1){if(this.selectionStart=t,this.selectionEnd=n,!t||!n||t[0]===n[0]&&t[1]===n[1])return void this.clear();let i=e.buffers.active.ydisp,a=t[1]-i,o=n[1]-i,s=Math.max(a,0),c=Math.min(o,e.rows-1);s>=e.rows||c<0?this.clear():(this.hasSelection=!0,this.columnSelectMode=r,this.viewportStartRow=a,this.viewportEndRow=o,this.viewportCappedStartRow=s,this.viewportCappedEndRow=c,this.startCol=t[0],this.endCol=n[0])}isCellSelected(e,t,n){return!!this.hasSelection&&(n-=e.buffer.active.viewportY,this.columnSelectMode?this.startCol<=this.endCol?t>=this.startCol&&n>=this.viewportCappedStartRow&&t<this.endCol&&n<=this.viewportCappedEndRow:t<this.startCol&&n>=this.viewportCappedStartRow&&t>=this.endCol&&n<=this.viewportCappedEndRow:n>this.viewportStartRow&&n<this.viewportEndRow||this.viewportStartRow===this.viewportEndRow&&n===this.viewportStartRow&&t>=this.startCol&&t<this.endCol||this.viewportStartRow<this.viewportEndRow&&n===this.viewportEndRow&&t<this.endCol||this.viewportStartRow<this.viewportEndRow&&n===this.viewportStartRow&&t>=this.startCol)}}t.createSelectionRenderModel=function(){return new n}},456:(e,t)=>{Object.defineProperty(t,`__esModule`,{value:!0}),t.SelectionModel=void 0,t.SelectionModel=class{constructor(e){this._bufferService=e,this.isSelectAllActive=!1,this.selectionStartLength=0}clearSelection(){this.selectionStart=void 0,this.selectionEnd=void 0,this.isSelectAllActive=!1,this.selectionStartLength=0}get finalSelectionStart(){return this.isSelectAllActive?[0,0]:this.selectionEnd&&this.selectionStart&&this.areSelectionValuesReversed()?this.selectionEnd:this.selectionStart}get finalSelectionEnd(){if(this.isSelectAllActive)return[this._bufferService.cols,this._bufferService.buffer.ybase+this._bufferService.rows-1];if(this.selectionStart){if(!this.selectionEnd||this.areSelectionValuesReversed()){let e=this.selectionStart[0]+this.selectionStartLength;return e>this._bufferService.cols?e%this._bufferService.cols==0?[this._bufferService.cols,this.selectionStart[1]+Math.floor(e/this._bufferService.cols)-1]:[e%this._bufferService.cols,this.selectionStart[1]+Math.floor(e/this._bufferService.cols)]:[e,this.selectionStart[1]]}if(this.selectionStartLength&&this.selectionEnd[1]===this.selectionStart[1]){let e=this.selectionStart[0]+this.selectionStartLength;return e>this._bufferService.cols?[e%this._bufferService.cols,this.selectionStart[1]+Math.floor(e/this._bufferService.cols)]:[Math.max(e,this.selectionEnd[0]),this.selectionEnd[1]]}return this.selectionEnd}}areSelectionValuesReversed(){let e=this.selectionStart,t=this.selectionEnd;return!(!e||!t)&&(e[1]>t[1]||e[1]===t[1]&&e[0]>t[0])}handleTrim(e){return this.selectionStart&&(this.selectionStart[1]-=e),this.selectionEnd&&(this.selectionEnd[1]-=e),this.selectionEnd&&this.selectionEnd[1]<0?(this.clearSelection(),!0):(this.selectionStart&&this.selectionStart[1]<0&&(this.selectionStart[1]=0),!1)}}},428:function(e,t,n){var r=this&&this.__decorate||function(e,t,n,r){var i,a=arguments.length,o=a<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r;if(typeof Reflect==`object`&&typeof Reflect.decorate==`function`)o=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(o=(a<3?i(o):a>3?i(t,n,o):i(t,n))||o);return a>3&&o&&Object.defineProperty(t,n,o),o},i=this&&this.__param||function(e,t){return function(n,r){t(n,r,e)}};Object.defineProperty(t,`__esModule`,{value:!0}),t.CharSizeService=void 0;let a=n(2585),o=n(8460),s=n(844),c=t.CharSizeService=class extends s.Disposable{get hasValidSize(){return this.width>0&&this.height>0}constructor(e,t,n){super(),this._optionsService=n,this.width=0,this.height=0,this._onCharSizeChange=this.register(new o.EventEmitter),this.onCharSizeChange=this._onCharSizeChange.event;try{this._measureStrategy=this.register(new d(this._optionsService))}catch{this._measureStrategy=this.register(new u(e,t,this._optionsService))}this.register(this._optionsService.onMultipleOptionChange([`fontFamily`,`fontSize`],(()=>this.measure())))}measure(){let e=this._measureStrategy.measure();e.width===this.width&&e.height===this.height||(this.width=e.width,this.height=e.height,this._onCharSizeChange.fire())}};t.CharSizeService=c=r([i(2,a.IOptionsService)],c);class l extends s.Disposable{constructor(){super(...arguments),this._result={width:0,height:0}}_validateAndSet(e,t){e!==void 0&&e>0&&t!==void 0&&t>0&&(this._result.width=e,this._result.height=t)}}class u extends l{constructor(e,t,n){super(),this._document=e,this._parentElement=t,this._optionsService=n,this._measureElement=this._document.createElement(`span`),this._measureElement.classList.add(`xterm-char-measure-element`),this._measureElement.textContent=`W`.repeat(32),this._measureElement.setAttribute(`aria-hidden`,`true`),this._measureElement.style.whiteSpace=`pre`,this._measureElement.style.fontKerning=`none`,this._parentElement.appendChild(this._measureElement)}measure(){return this._measureElement.style.fontFamily=this._optionsService.rawOptions.fontFamily,this._measureElement.style.fontSize=`${this._optionsService.rawOptions.fontSize}px`,this._validateAndSet(Number(this._measureElement.offsetWidth)/32,Number(this._measureElement.offsetHeight)),this._result}}class d extends l{constructor(e){super(),this._optionsService=e,this._canvas=new OffscreenCanvas(100,100),this._ctx=this._canvas.getContext(`2d`);let t=this._ctx.measureText(`W`);if(!(`width`in t&&`fontBoundingBoxAscent`in t&&`fontBoundingBoxDescent`in t))throw Error(`Required font metrics not supported`)}measure(){this._ctx.font=`${this._optionsService.rawOptions.fontSize}px ${this._optionsService.rawOptions.fontFamily}`;let e=this._ctx.measureText(`W`);return this._validateAndSet(e.width,e.fontBoundingBoxAscent+e.fontBoundingBoxDescent),this._result}}},4269:function(e,t,n){var r=this&&this.__decorate||function(e,t,n,r){var i,a=arguments.length,o=a<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r;if(typeof Reflect==`object`&&typeof Reflect.decorate==`function`)o=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(o=(a<3?i(o):a>3?i(t,n,o):i(t,n))||o);return a>3&&o&&Object.defineProperty(t,n,o),o},i=this&&this.__param||function(e,t){return function(n,r){t(n,r,e)}};Object.defineProperty(t,`__esModule`,{value:!0}),t.CharacterJoinerService=t.JoinedCellData=void 0;let a=n(3734),o=n(643),s=n(511),c=n(2585);class l extends a.AttributeData{constructor(e,t,n){super(),this.content=0,this.combinedData=``,this.fg=e.fg,this.bg=e.bg,this.combinedData=t,this._width=n}isCombined(){return 2097152}getWidth(){return this._width}getChars(){return this.combinedData}getCode(){return 2097151}setFromCharData(e){throw Error(`not implemented`)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}t.JoinedCellData=l;let u=t.CharacterJoinerService=class e{constructor(e){this._bufferService=e,this._characterJoiners=[],this._nextCharacterJoinerId=0,this._workCell=new s.CellData}register(e){let t={id:this._nextCharacterJoinerId++,handler:e};return this._characterJoiners.push(t),t.id}deregister(e){for(let t=0;t<this._characterJoiners.length;t++)if(this._characterJoiners[t].id===e)return this._characterJoiners.splice(t,1),!0;return!1}getJoinedCharacters(e){if(this._characterJoiners.length===0)return[];let t=this._bufferService.buffer.lines.get(e);if(!t||t.length===0)return[];let n=[],r=t.translateToString(!0),i=0,a=0,s=0,c=t.getFg(0),l=t.getBg(0);for(let e=0;e<t.getTrimmedLength();e++)if(t.loadCell(e,this._workCell),this._workCell.getWidth()!==0){if(this._workCell.fg!==c||this._workCell.bg!==l){if(e-i>1){let e=this._getJoinedRanges(r,s,a,t,i);for(let t=0;t<e.length;t++)n.push(e[t])}i=e,s=a,c=this._workCell.fg,l=this._workCell.bg}a+=this._workCell.getChars().length||o.WHITESPACE_CELL_CHAR.length}if(this._bufferService.cols-i>1){let e=this._getJoinedRanges(r,s,a,t,i);for(let t=0;t<e.length;t++)n.push(e[t])}return n}_getJoinedRanges(t,n,r,i,a){let o=t.substring(n,r),s=[];try{s=this._characterJoiners[0].handler(o)}catch(e){console.error(e)}for(let t=1;t<this._characterJoiners.length;t++)try{let n=this._characterJoiners[t].handler(o);for(let t=0;t<n.length;t++)e._mergeRanges(s,n[t])}catch(e){console.error(e)}return this._stringRangesToCellRanges(s,i,a),s}_stringRangesToCellRanges(e,t,n){let r=0,i=!1,a=0,s=e[r];if(s){for(let c=n;c<this._bufferService.cols;c++){let n=t.getWidth(c),l=t.getString(c).length||o.WHITESPACE_CELL_CHAR.length;if(n!==0){if(!i&&s[0]<=a&&(s[0]=c,i=!0),s[1]<=a){if(s[1]=c,s=e[++r],!s)break;s[0]<=a?(s[0]=c,i=!0):i=!1}a+=l}}s&&(s[1]=this._bufferService.cols)}}static _mergeRanges(e,t){let n=!1;for(let r=0;r<e.length;r++){let i=e[r];if(n){if(t[1]<=i[0])return e[r-1][1]=t[1],e;if(t[1]<=i[1])return e[r-1][1]=Math.max(t[1],i[1]),e.splice(r,1),e;e.splice(r,1),r--}else{if(t[1]<=i[0])return e.splice(r,0,t),e;if(t[1]<=i[1])return i[0]=Math.min(t[0],i[0]),e;t[0]<i[1]&&(i[0]=Math.min(t[0],i[0]),n=!0)}}return n?e[e.length-1][1]=t[1]:e.push(t),e}};t.CharacterJoinerService=u=r([i(0,c.IBufferService)],u)},5114:(e,t,n)=>{Object.defineProperty(t,`__esModule`,{value:!0}),t.CoreBrowserService=void 0;let r=n(844),i=n(8460),a=n(3656);class o extends r.Disposable{constructor(e,t,n){super(),this._textarea=e,this._window=t,this.mainDocument=n,this._isFocused=!1,this._cachedIsFocused=void 0,this._screenDprMonitor=new s(this._window),this._onDprChange=this.register(new i.EventEmitter),this.onDprChange=this._onDprChange.event,this._onWindowChange=this.register(new i.EventEmitter),this.onWindowChange=this._onWindowChange.event,this.register(this.onWindowChange((e=>this._screenDprMonitor.setWindow(e)))),this.register((0,i.forwardEvent)(this._screenDprMonitor.onDprChange,this._onDprChange)),this._textarea.addEventListener(`focus`,(()=>this._isFocused=!0)),this._textarea.addEventListener(`blur`,(()=>this._isFocused=!1))}get window(){return this._window}set window(e){this._window!==e&&(this._window=e,this._onWindowChange.fire(this._window))}get dpr(){return this.window.devicePixelRatio}get isFocused(){return this._cachedIsFocused===void 0&&(this._cachedIsFocused=this._isFocused&&this._textarea.ownerDocument.hasFocus(),queueMicrotask((()=>this._cachedIsFocused=void 0))),this._cachedIsFocused}}t.CoreBrowserService=o;class s extends r.Disposable{constructor(e){super(),this._parentWindow=e,this._windowResizeListener=this.register(new r.MutableDisposable),this._onDprChange=this.register(new i.EventEmitter),this.onDprChange=this._onDprChange.event,this._outerListener=()=>this._setDprAndFireIfDiffers(),this._currentDevicePixelRatio=this._parentWindow.devicePixelRatio,this._updateDpr(),this._setWindowResizeListener(),this.register((0,r.toDisposable)((()=>this.clearListener())))}setWindow(e){this._parentWindow=e,this._setWindowResizeListener(),this._setDprAndFireIfDiffers()}_setWindowResizeListener(){this._windowResizeListener.value=(0,a.addDisposableDomListener)(this._parentWindow,`resize`,(()=>this._setDprAndFireIfDiffers()))}_setDprAndFireIfDiffers(){this._parentWindow.devicePixelRatio!==this._currentDevicePixelRatio&&this._onDprChange.fire(this._parentWindow.devicePixelRatio),this._updateDpr()}_updateDpr(){this._outerListener&&(this._resolutionMediaMatchList?.removeListener(this._outerListener),this._currentDevicePixelRatio=this._parentWindow.devicePixelRatio,this._resolutionMediaMatchList=this._parentWindow.matchMedia(`screen and (resolution: ${this._parentWindow.devicePixelRatio}dppx)`),this._resolutionMediaMatchList.addListener(this._outerListener))}clearListener(){this._resolutionMediaMatchList&&this._outerListener&&(this._resolutionMediaMatchList.removeListener(this._outerListener),this._resolutionMediaMatchList=void 0,this._outerListener=void 0)}}},779:(e,t,n)=>{Object.defineProperty(t,`__esModule`,{value:!0}),t.LinkProviderService=void 0;let r=n(844);class i extends r.Disposable{constructor(){super(),this.linkProviders=[],this.register((0,r.toDisposable)((()=>this.linkProviders.length=0)))}registerLinkProvider(e){return this.linkProviders.push(e),{dispose:()=>{let t=this.linkProviders.indexOf(e);t!==-1&&this.linkProviders.splice(t,1)}}}}t.LinkProviderService=i},8934:function(e,t,n){var r=this&&this.__decorate||function(e,t,n,r){var i,a=arguments.length,o=a<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r;if(typeof Reflect==`object`&&typeof Reflect.decorate==`function`)o=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(o=(a<3?i(o):a>3?i(t,n,o):i(t,n))||o);return a>3&&o&&Object.defineProperty(t,n,o),o},i=this&&this.__param||function(e,t){return function(n,r){t(n,r,e)}};Object.defineProperty(t,`__esModule`,{value:!0}),t.MouseService=void 0;let a=n(4725),o=n(9806),s=t.MouseService=class{constructor(e,t){this._renderService=e,this._charSizeService=t}getCoords(e,t,n,r,i){return(0,o.getCoords)(window,e,t,n,r,this._charSizeService.hasValidSize,this._renderService.dimensions.css.cell.width,this._renderService.dimensions.css.cell.height,i)}getMouseReportCoords(e,t){let n=(0,o.getCoordsRelativeToElement)(window,e,t);if(this._charSizeService.hasValidSize)return n[0]=Math.min(Math.max(n[0],0),this._renderService.dimensions.css.canvas.width-1),n[1]=Math.min(Math.max(n[1],0),this._renderService.dimensions.css.canvas.height-1),{col:Math.floor(n[0]/this._renderService.dimensions.css.cell.width),row:Math.floor(n[1]/this._renderService.dimensions.css.cell.height),x:Math.floor(n[0]),y:Math.floor(n[1])}}};t.MouseService=s=r([i(0,a.IRenderService),i(1,a.ICharSizeService)],s)},3230:function(e,t,n){var r=this&&this.__decorate||function(e,t,n,r){var i,a=arguments.length,o=a<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r;if(typeof Reflect==`object`&&typeof Reflect.decorate==`function`)o=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(o=(a<3?i(o):a>3?i(t,n,o):i(t,n))||o);return a>3&&o&&Object.defineProperty(t,n,o),o},i=this&&this.__param||function(e,t){return function(n,r){t(n,r,e)}};Object.defineProperty(t,`__esModule`,{value:!0}),t.RenderService=void 0;let a=n(6193),o=n(4725),s=n(8460),c=n(844),l=n(7226),u=n(2585),d=t.RenderService=class extends c.Disposable{get dimensions(){return this._renderer.value.dimensions}constructor(e,t,n,r,i,o,u,d){super(),this._rowCount=e,this._charSizeService=r,this._renderer=this.register(new c.MutableDisposable),this._pausedResizeTask=new l.DebouncedIdleTask,this._observerDisposable=this.register(new c.MutableDisposable),this._isPaused=!1,this._needsFullRefresh=!1,this._isNextRenderRedrawOnly=!0,this._needsSelectionRefresh=!1,this._canvasWidth=0,this._canvasHeight=0,this._selectionState={start:void 0,end:void 0,columnSelectMode:!1},this._onDimensionsChange=this.register(new s.EventEmitter),this.onDimensionsChange=this._onDimensionsChange.event,this._onRenderedViewportChange=this.register(new s.EventEmitter),this.onRenderedViewportChange=this._onRenderedViewportChange.event,this._onRender=this.register(new s.EventEmitter),this.onRender=this._onRender.event,this._onRefreshRequest=this.register(new s.EventEmitter),this.onRefreshRequest=this._onRefreshRequest.event,this._renderDebouncer=new a.RenderDebouncer(((e,t)=>this._renderRows(e,t)),u),this.register(this._renderDebouncer),this.register(u.onDprChange((()=>this.handleDevicePixelRatioChange()))),this.register(o.onResize((()=>this._fullRefresh()))),this.register(o.buffers.onBufferActivate((()=>this._renderer.value?.clear()))),this.register(n.onOptionChange((()=>this._handleOptionsChanged()))),this.register(this._charSizeService.onCharSizeChange((()=>this.handleCharSizeChanged()))),this.register(i.onDecorationRegistered((()=>this._fullRefresh()))),this.register(i.onDecorationRemoved((()=>this._fullRefresh()))),this.register(n.onMultipleOptionChange([`customGlyphs`,`drawBoldTextInBrightColors`,`letterSpacing`,`lineHeight`,`fontFamily`,`fontSize`,`fontWeight`,`fontWeightBold`,`minimumContrastRatio`,`rescaleOverlappingGlyphs`],(()=>{this.clear(),this.handleResize(o.cols,o.rows),this._fullRefresh()}))),this.register(n.onMultipleOptionChange([`cursorBlink`,`cursorStyle`],(()=>this.refreshRows(o.buffer.y,o.buffer.y,!0)))),this.register(d.onChangeColors((()=>this._fullRefresh()))),this._registerIntersectionObserver(u.window,t),this.register(u.onWindowChange((e=>this._registerIntersectionObserver(e,t))))}_registerIntersectionObserver(e,t){if(`IntersectionObserver`in e){let n=new e.IntersectionObserver((e=>this._handleIntersectionChange(e[e.length-1])),{threshold:0});n.observe(t),this._observerDisposable.value=(0,c.toDisposable)((()=>n.disconnect()))}}_handleIntersectionChange(e){this._isPaused=e.isIntersecting===void 0?e.intersectionRatio===0:!e.isIntersecting,this._isPaused||this._charSizeService.hasValidSize||this._charSizeService.measure(),!this._isPaused&&this._needsFullRefresh&&(this._pausedResizeTask.flush(),this.refreshRows(0,this._rowCount-1),this._needsFullRefresh=!1)}refreshRows(e,t,n=!1){this._isPaused?this._needsFullRefresh=!0:(n||(this._isNextRenderRedrawOnly=!1),this._renderDebouncer.refresh(e,t,this._rowCount))}_renderRows(e,t){this._renderer.value&&(e=Math.min(e,this._rowCount-1),t=Math.min(t,this._rowCount-1),this._renderer.value.renderRows(e,t),this._needsSelectionRefresh&&=(this._renderer.value.handleSelectionChanged(this._selectionState.start,this._selectionState.end,this._selectionState.columnSelectMode),!1),this._isNextRenderRedrawOnly||this._onRenderedViewportChange.fire({start:e,end:t}),this._onRender.fire({start:e,end:t}),this._isNextRenderRedrawOnly=!0)}resize(e,t){this._rowCount=t,this._fireOnCanvasResize()}_handleOptionsChanged(){this._renderer.value&&(this.refreshRows(0,this._rowCount-1),this._fireOnCanvasResize())}_fireOnCanvasResize(){this._renderer.value&&(this._renderer.value.dimensions.css.canvas.width===this._canvasWidth&&this._renderer.value.dimensions.css.canvas.height===this._canvasHeight||this._onDimensionsChange.fire(this._renderer.value.dimensions))}hasRenderer(){return!!this._renderer.value}setRenderer(e){this._renderer.value=e,this._renderer.value&&(this._renderer.value.onRequestRedraw((e=>this.refreshRows(e.start,e.end,!0))),this._needsSelectionRefresh=!0,this._fullRefresh())}addRefreshCallback(e){return this._renderDebouncer.addRefreshCallback(e)}_fullRefresh(){this._isPaused?this._needsFullRefresh=!0:this.refreshRows(0,this._rowCount-1)}clearTextureAtlas(){this._renderer.value&&(this._renderer.value.clearTextureAtlas?.(),this._fullRefresh())}handleDevicePixelRatioChange(){this._charSizeService.measure(),this._renderer.value&&(this._renderer.value.handleDevicePixelRatioChange(),this.refreshRows(0,this._rowCount-1))}handleResize(e,t){this._renderer.value&&(this._isPaused?this._pausedResizeTask.set((()=>this._renderer.value?.handleResize(e,t))):this._renderer.value.handleResize(e,t),this._fullRefresh())}handleCharSizeChanged(){this._renderer.value?.handleCharSizeChanged()}handleBlur(){this._renderer.value?.handleBlur()}handleFocus(){this._renderer.value?.handleFocus()}handleSelectionChanged(e,t,n){this._selectionState.start=e,this._selectionState.end=t,this._selectionState.columnSelectMode=n,this._renderer.value?.handleSelectionChanged(e,t,n)}handleCursorMove(){this._renderer.value?.handleCursorMove()}clear(){this._renderer.value?.clear()}};t.RenderService=d=r([i(2,u.IOptionsService),i(3,o.ICharSizeService),i(4,u.IDecorationService),i(5,u.IBufferService),i(6,o.ICoreBrowserService),i(7,o.IThemeService)],d)},9312:function(e,t,n){var r=this&&this.__decorate||function(e,t,n,r){var i,a=arguments.length,o=a<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r;if(typeof Reflect==`object`&&typeof Reflect.decorate==`function`)o=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(o=(a<3?i(o):a>3?i(t,n,o):i(t,n))||o);return a>3&&o&&Object.defineProperty(t,n,o),o},i=this&&this.__param||function(e,t){return function(n,r){t(n,r,e)}};Object.defineProperty(t,`__esModule`,{value:!0}),t.SelectionService=void 0;let a=n(9806),o=n(9504),s=n(456),c=n(4725),l=n(8460),u=n(844),d=n(6114),f=n(4841),p=n(511),m=n(2585),h=RegExp(`\xA0`,`g`),g=t.SelectionService=class extends u.Disposable{constructor(e,t,n,r,i,a,o,c,d){super(),this._element=e,this._screenElement=t,this._linkifier=n,this._bufferService=r,this._coreService=i,this._mouseService=a,this._optionsService=o,this._renderService=c,this._coreBrowserService=d,this._dragScrollAmount=0,this._enabled=!0,this._workCell=new p.CellData,this._mouseDownTimeStamp=0,this._oldHasSelection=!1,this._oldSelectionStart=void 0,this._oldSelectionEnd=void 0,this._onLinuxMouseSelection=this.register(new l.EventEmitter),this.onLinuxMouseSelection=this._onLinuxMouseSelection.event,this._onRedrawRequest=this.register(new l.EventEmitter),this.onRequestRedraw=this._onRedrawRequest.event,this._onSelectionChange=this.register(new l.EventEmitter),this.onSelectionChange=this._onSelectionChange.event,this._onRequestScrollLines=this.register(new l.EventEmitter),this.onRequestScrollLines=this._onRequestScrollLines.event,this._mouseMoveListener=e=>this._handleMouseMove(e),this._mouseUpListener=e=>this._handleMouseUp(e),this._coreService.onUserInput((()=>{this.hasSelection&&this.clearSelection()})),this._trimListener=this._bufferService.buffer.lines.onTrim((e=>this._handleTrim(e))),this.register(this._bufferService.buffers.onBufferActivate((e=>this._handleBufferActivate(e)))),this.enable(),this._model=new s.SelectionModel(this._bufferService),this._activeSelectionMode=0,this.register((0,u.toDisposable)((()=>{this._removeMouseDownListeners()})))}reset(){this.clearSelection()}disable(){this.clearSelection(),this._enabled=!1}enable(){this._enabled=!0}get selectionStart(){return this._model.finalSelectionStart}get selectionEnd(){return this._model.finalSelectionEnd}get hasSelection(){let e=this._model.finalSelectionStart,t=this._model.finalSelectionEnd;return!(!e||!t||e[0]===t[0]&&e[1]===t[1])}get selectionText(){let e=this._model.finalSelectionStart,t=this._model.finalSelectionEnd;if(!e||!t)return``;let n=this._bufferService.buffer,r=[];if(this._activeSelectionMode===3){if(e[0]===t[0])return``;let i=e[0]<t[0]?e[0]:t[0],a=e[0]<t[0]?t[0]:e[0];for(let o=e[1];o<=t[1];o++){let e=n.translateBufferLineToString(o,!0,i,a);r.push(e)}}else{let i=e[1]===t[1]?t[0]:void 0;r.push(n.translateBufferLineToString(e[1],!0,e[0],i));for(let i=e[1]+1;i<=t[1]-1;i++){let e=n.lines.get(i),t=n.translateBufferLineToString(i,!0);e?.isWrapped?r[r.length-1]+=t:r.push(t)}if(e[1]!==t[1]){let e=n.lines.get(t[1]),i=n.translateBufferLineToString(t[1],!0,0,t[0]);e&&e.isWrapped?r[r.length-1]+=i:r.push(i)}}return r.map((e=>e.replace(h,` `))).join(d.isWindows?`\r
54
54
  `:`
@@ -226,4 +226,4 @@ void main() {
226
226
  active:scale-95 transition-all duration-75
227
227
  select-none touch-manipulation
228
228
  ${r?IO[t.status]:FO[t.status]}
229
- `,onClick:()=>{LO(),u(t.id)},title:$e?t.name:void 0,children:i},t.id)})})]}),(0,q.jsxs)(`div`,{className:`relative flex-1`,children:[(0,q.jsx)(`div`,{ref:ye,className:`absolute inset-0`}),Ee&&e&&(0,q.jsxs)(`div`,{className:`absolute top-2 left-2 z-50 flex items-center gap-1.5 rounded-lg bg-black/60 px-2.5 py-1.5 text-xs text-white/90 shadow-lg backdrop-blur-md`,children:[(0,q.jsxs)(`svg`,{className:`h-3 w-3 animate-spin`,viewBox:`0 0 24 24`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,children:[(0,q.jsx)(`circle`,{className:`opacity-25`,cx:`12`,cy:`12`,r:`10`,stroke:`currentColor`,strokeWidth:`4`}),(0,q.jsx)(`path`,{className:`opacity-75`,fill:`currentColor`,d:`M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4z`})]}),`Loading`]}),De&&e&&(0,q.jsxs)(`div`,{className:`absolute ${j&&!N?`bottom-20`:`bottom-8`} left-1/2 z-30 flex max-w-[calc(100%-2rem)] -translate-x-1/2 items-center gap-2 rounded-lg border border-border bg-elevated/95 px-2 py-2 shadow-lg backdrop-blur-sm md:left-auto md:right-4 md:translate-x-0`,children:[(0,q.jsx)(`span`,{className:`max-w-[12rem] truncate text-xs text-secondary md:max-w-[18rem]`,children:`Selection ready`}),(0,q.jsxs)(`button`,{type:`button`,onClick:Oe,className:`flex h-8 shrink-0 items-center justify-center gap-1.5 rounded bg-accent px-2.5 text-xs font-medium text-white hover:bg-accent/90 active:scale-95 transition-all`,title:`Copy selection`,"aria-label":`Copy selection`,children:[(0,q.jsx)(ce,{width:14,height:14}),`Copy`]}),(0,q.jsx)(`button`,{type:`button`,onClick:ke,className:`flex h-8 w-8 shrink-0 items-center justify-center rounded border border-border text-secondary hover:bg-hover hover:text-primary active:scale-95 transition-all`,title:`Dismiss`,"aria-label":`Dismiss`,children:(0,q.jsx)(Be,{width:14,height:14})})]}),!e&&(0,q.jsx)(`div`,{className:`absolute inset-0 flex items-center justify-center text-sm text-muted`,children:n?null:`Select a session to view terminal`}),e&&de&&(0,q.jsx)(`div`,{className:`absolute inset-0 flex items-center justify-center text-center text-sm text-muted`,children:`Remote session (read-only). Use SSH to attach on the host.`}),n&&(0,q.jsx)(`div`,{className:`absolute inset-0 z-10 overflow-y-auto bg-base`,children:(0,q.jsxs)(`div`,{className:`mx-auto flex min-h-full w-full max-w-5xl flex-col gap-4 p-4 md:p-6`,children:[(0,q.jsx)(`div`,{className:`border-b border-border pb-4`,children:(0,q.jsxs)(`div`,{className:`flex flex-col gap-3 md:flex-row md:items-start md:justify-between`,children:[(0,q.jsxs)(`div`,{className:`min-w-0 space-y-2`,children:[(0,q.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-2 gap-y-1 text-sm`,children:[(0,q.jsx)(`h2`,{className:`min-w-0 truncate text-lg font-semibold text-primary`,children:he}),(0,q.jsx)(`span`,{className:`rounded-full bg-blue-500/15 px-2 py-0.5 text-[10px] font-semibold uppercase tracking-wide text-blue-400`,children:`Hibernating`}),ge&&(0,q.jsx)(`span`,{className:`text-muted`,children:ge}),(0,q.jsxs)(`span`,{className:`text-muted`,children:[`Last active `,_e]})]}),n.lastResumeError&&(0,q.jsxs)(`div`,{className:`inline-flex items-center gap-1 rounded bg-amber-500/15 px-2 py-1 text-xs text-amber-400`,title:`Last wake failed: ${n.lastResumeError}`,children:[(0,q.jsx)(ne,{width:12,height:12}),`Last wake failed`]}),n.lastUserMessage&&(0,q.jsx)(`p`,{className:`max-h-28 max-w-3xl overflow-y-auto whitespace-pre-wrap break-words pr-2 text-sm leading-6 text-secondary`,children:n.lastUserMessage})]}),(0,q.jsxs)(`div`,{className:`flex shrink-0 items-center gap-2`,children:[(0,q.jsx)(`button`,{type:`button`,onClick:()=>h(n.sessionId),className:`btn btn-primary hidden md:inline-flex`,children:`Wake`}),_&&(0,q.jsx)(`button`,{type:`button`,onClick:()=>_(n.sessionId),className:`btn btn-secondary`,children:`Move to History`})]})]})}),(0,q.jsx)(RT,{session:n})]})}),j&&e&&!N&&(0,q.jsxs)(`button`,{onClick:je,className:`absolute bottom-8 left-1/2 z-20 flex h-10 px-4 items-center justify-center gap-1.5 rounded-full bg-blue-600/90 text-white shadow-lg hover:bg-blue-600 active:scale-95 transition-all`,style:{transform:`translateX(-50%)`},title:`Scroll to bottom`,"aria-label":`Scroll to bottom`,children:[(0,q.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:`18`,height:`18`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2.5`,strokeLinecap:`round`,strokeLinejoin:`round`,children:(0,q.jsx)(`path`,{d:`M12 5v14M5 12l7 7 7-7`})}),(0,q.jsx)(`span`,{className:`text-sm font-medium`,children:`Jump to bottom`})]})]}),e&&(0,q.jsx)(jO,{onSendKey:Je,onPasteText:Ye,disabled:a!==`connected`||de,sessions:t.map(e=>({id:e.id,name:e.name,status:e.status})),currentSessionId:e.id,agentType:e.agentType,onSelectSession:u,hideSessionSwitcher:!0,onRefocus:Xe,isKeyboardVisible:Qe,onEnterTextMode:Ze}),(A||k)&&(0,q.jsx)(MO,{isOpen:B,onClose:()=>V(!1),sessions:t,hibernatingSessions:r,historySessions:i,selectedSessionId:e?.id??null,selectedHibernatingSessionId:n?.sessionId??null,onSelect:u,onSelectHibernating:d,onRename:m,onResume:h,onHibernate:g,onMoveToHistory:_,onNewSession:f,loading:y,error:b}),F&&e&&(0,q.jsx)(`div`,{className:`fixed inset-0 z-50 flex items-center justify-center bg-black/50`,children:(0,q.jsxs)(`div`,{className:`mx-4 w-full max-w-sm rounded-lg border border-border bg-elevated p-4 shadow-xl`,children:[(0,q.jsx)(`h3`,{className:`text-base font-medium text-primary mb-2 text-balance`,children:`Kill Session`}),(0,q.jsxs)(`p`,{className:`text-sm text-secondary mb-4 text-pretty`,children:[`Kill "`,e.agentSessionName||e.name,`"? The process will be terminated. Conversation history is preserved in logs.`]}),(0,q.jsxs)(`div`,{className:`flex justify-end gap-2`,children:[(0,q.jsx)(`button`,{onClick:()=>I(!1),className:`btn py-1.5 px-3 text-sm`,children:`Cancel`}),(0,q.jsx)(`button`,{ref:ae,onClick:Fe,className:`btn btn-danger py-1.5 px-3 text-sm`,children:`Kill Session`})]})]})})]})}function zO({onSelect:e,onCancel:t,initialPath:n}){let[r,i]=(0,x.useState)(n||`~`),[a,o]=(0,x.useState)(null),[s,c]=(0,x.useState)(null),[l,u]=(0,x.useState)(!0),[d,f]=(0,x.useState)(-1),p=(0,x.useRef)(null),m=G(e=>e.recentPaths),h=(0,x.useCallback)(async e=>{p.current?.abort();let t=new AbortController;p.current=t;let{signal:n}=t;u(!0),c(null),o(null),f(-1),i(e);try{let r=await fetch(`/api/directories?path=${encodeURIComponent(e)}`,{signal:n});if(!r.ok){let e=await r.json();throw Error(e.message||`Failed to load directory`)}let a=await r.json();if(p.current!==t)return;o(a),i(a.path)}catch(e){if(p.current!==t)return;let n=e;n?.name!==`AbortError`&&c(n?.message||`Failed to load directory`)}finally{p.current===t&&u(!1)}},[]);(0,x.useEffect)(()=>(h(n||`~`),()=>{p.current?.abort()}),[h,n]);let g=a?.directories??[],_=a?.path||r,v=a?.parent;return(0,x.useEffect)(()=>{let n=n=>{if(n.key===`Escape`){n.preventDefault(),t();return}if(!l){if(n.key===`ArrowDown`){n.preventDefault(),f(e=>g.length===0?-1:e<0?0:Math.min(e+1,g.length-1));return}if(n.key===`ArrowUp`){n.preventDefault(),f(e=>g.length===0?-1:e<0?g.length-1:Math.max(e-1,0));return}if(n.key===`Enter`){n.preventDefault();let t=g[d];t?h(t.path):_&&e(_);return}n.key===`Backspace`&&v&&(n.preventDefault(),h(v))}};return window.addEventListener(`keydown`,n),()=>window.removeEventListener(`keydown`,n)},[g,_,h,d,l,t,e,v]),(0,q.jsx)(`div`,{role:`dialog`,"aria-modal":`true`,"aria-label":`Directory browser`,className:`fixed inset-0 z-[60] flex items-center justify-center bg-black/60 p-4`,onClick:e=>{e.target===e.currentTarget&&t()},"data-testid":`directory-browser`,children:(0,q.jsxs)(`div`,{className:`w-full max-w-lg border border-border bg-elevated p-4`,children:[(0,q.jsxs)(`div`,{className:`flex items-center gap-3 border-b border-border pb-2`,children:[(0,q.jsx)(`button`,{type:`button`,className:`btn`,onClick:()=>{v&&h(v)},disabled:!v||l,children:`Up`}),(0,q.jsx)(`div`,{className:`min-w-0 flex-1 truncate text-xs font-mono text-secondary`,title:_,"data-testid":`directory-current-path`,children:_})]}),(0,q.jsx)(`div`,{className:`mt-3 max-h-60 overflow-y-auto border border-border bg-surface`,children:l?(0,q.jsx)(`div`,{className:`px-3 py-4 text-xs text-muted`,"data-testid":`directory-loading`,children:`Loading directories...`}):s?(0,q.jsxs)(`div`,{className:`px-3 py-4 text-xs`,"data-testid":`directory-error`,children:[(0,q.jsx)(`p`,{className:`text-danger`,children:s}),(0,q.jsx)(`button`,{type:`button`,className:`btn mt-3`,onClick:()=>h(r),children:`Retry`})]}):g.length===0?(0,q.jsx)(`div`,{className:`px-3 py-4 text-xs text-muted`,"data-testid":`directory-empty`,children:`No subdirectories`}):(0,q.jsx)(`div`,{className:`py-1`,children:g.map((e,t)=>(0,q.jsxs)(`button`,{type:`button`,onClick:()=>h(e.path),onMouseEnter:()=>f(t),className:`flex w-full items-center gap-2 px-3 py-2 text-left text-xs ${t===d?`bg-hover text-primary`:`text-secondary`}`,"data-testid":`directory-entry`,"data-entry-name":e.name,"data-entry-path":e.path,children:[(0,q.jsx)(ve,{width:14,height:14,className:`shrink-0 text-muted`,"aria-hidden":`true`}),(0,q.jsx)(`span`,{className:`truncate`,children:e.name})]},e.path))})}),a?.truncated?(0,q.jsx)(`p`,{className:`mt-2 text-[10px] text-muted`,children:`Showing first 200 directories.`}):null,(0,q.jsxs)(`div`,{className:`mt-4 border-t border-border pt-3`,children:[(0,q.jsx)(`div`,{className:`text-[10px] uppercase tracking-wider text-secondary`,children:`Recent`}),m.length===0?(0,q.jsx)(`p`,{className:`mt-2 text-xs text-muted`,children:`No recent paths yet.`}):(0,q.jsx)(`div`,{className:`mt-2 space-y-1`,children:m.map(e=>(0,q.jsx)(`button`,{type:`button`,className:`block w-full truncate text-left text-xs text-secondary hover:text-primary`,onClick:()=>h(e),title:e,"data-testid":`directory-recent`,"data-recent-path":e,children:e},e))})]}),(0,q.jsxs)(`div`,{className:`mt-4 flex justify-end gap-2`,children:[(0,q.jsx)(`button`,{type:`button`,onClick:t,className:`btn`,children:`Cancel`}),(0,q.jsx)(`button`,{type:`button`,onClick:()=>{_&&e(_)},className:`btn btn-primary`,disabled:l||!_,children:`Select`})]})]})})}function BO({isOpen:e,onClose:t,onCreate:n,defaultProjectDir:r,commandPresets:i,defaultPresetId:a,lastProjectPath:o,activeProjectPath:s,remoteHosts:c=[],remoteAllowControl:l=!1,initialHost:u,initialPath:d,initialCommand:f}){let[p,m]=(0,x.useState)(``),[h,g]=(0,x.useState)(``),[_,v]=(0,x.useState)(null),[y,b]=(0,x.useState)(``),[S,C]=(0,x.useState)(!1),[w,T]=(0,x.useState)(``),E=(0,x.useRef)(null),D=(0,x.useRef)(null),O=(0,x.useRef)(null),k=l&&c.length>0;if((0,x.useEffect)(()=>{if(!e){m(``),g(``),v(null),b(``),C(!1),T(u??``),setTimeout(()=>{if(typeof document>`u`||typeof document.querySelector!=`function`)return;let e=document.querySelector(`.xterm-helper-textarea`);e&&(e.removeAttribute(`disabled`),e.focus())},300);return}if(typeof document<`u`&&typeof document.querySelector==`function`){let e=document.querySelector(`.xterm-helper-textarea`);e&&typeof e.setAttribute==`function`&&(typeof e.blur==`function`&&e.blur(),e.setAttribute(`disabled`,`true`))}m(d?.trim()||s?.trim()||o||r||``),g(``),T(u??``);let t=f?.trim();if(t){let e=i.find(e=>H(e)===t);e?(v(e.id),b(H(e))):(v(null),b(t))}else{let e=i.find(e=>e.id===a);e?(v(a),b(H(e))):i.length>0?(v(i[0].id),b(H(i[0]))):(v(null),b(``))}setTimeout(()=>{if(O.current?.focus(),D.current){let e=D.current;e.scrollLeft=e.scrollWidth}},50)},[s,i,a,r,e,o,u,d,f]),(0,x.useEffect)(()=>{if(!e||typeof window>`u`||typeof window.addEventListener!=`function`)return;let n=()=>E.current?Array.from(E.current.querySelectorAll(`input:not([disabled]), select:not([disabled]), button:not([disabled]):not([tabindex="-1"]), [tabindex="0"]`)):[],r=e=>{if(!S){if(e.key===`Escape`){typeof e.stopPropagation==`function`&&e.stopPropagation(),t();return}if(e.key===`Enter`){let t=document.activeElement;if(!t||t.tagName===`INPUT`||t.closest(`[data-testid="host-select"]`)||!t.closest(`[data-testid="command-select"]`))return;e.preventDefault(),typeof e.stopPropagation==`function`&&e.stopPropagation(),E.current?.requestSubmit();return}if(e.key===`Tab`){e.preventDefault(),typeof e.stopPropagation==`function`&&e.stopPropagation();let t=n();if(t.length===0)return;let r=document.activeElement,i=t.indexOf(r),a;a=i===-1?e.shiftKey?t.length-1:0:e.shiftKey?i<=0?t.length-1:i-1:i>=t.length-1?0:i+1,t[a]?.focus()}}};return window.addEventListener(`keydown`,r),()=>window.removeEventListener(`keydown`,r)},[e,t,S]),!e)return null;let A=e=>{let t=i.find(t=>t.id===e);t&&(v(e),b(H(t)))},j=()=>{v(null),b(``)},M=_===null,N=w!==``,P=e=>{e.preventDefault();let r=p.trim();if(!r)return;let i=y.trim();n(r,h.trim()||void 0,i||void 0,N?w:void 0),t()},F=[...i.map(e=>({id:e.id,label:e.label,isCustom:!1,agentType:e.agentType,command:e.command})),{id:`custom`,label:`Custom`,isCustom:!0,agentType:void 0,command:void 0}],I=[{id:``,label:`Local`,ok:!0,error:void 0},...c.map(e=>({id:e.host,label:e.host,ok:e.ok,error:e.error}))],L=p.trim()||`~`;return(0,q.jsxs)(`div`,{role:`dialog`,"aria-modal":`true`,"aria-labelledby":`new-session-title`,className:`fixed inset-0 z-50 flex items-center justify-center bg-black/60 p-4`,onClick:e=>{e.target===e.currentTarget&&t()},children:[(0,q.jsxs)(`form`,{ref:E,onSubmit:P,className:`w-full max-w-md border border-border bg-elevated p-6`,children:[(0,q.jsx)(`h2`,{id:`new-session-title`,className:`text-sm font-semibold uppercase tracking-wider text-primary text-balance`,children:`New Session`}),(0,q.jsxs)(`div`,{className:`mt-4 space-y-4`,children:[k&&(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`label`,{className:`mb-1.5 block text-xs text-secondary`,children:`Host`}),(0,q.jsx)(`div`,{className:`flex flex-wrap gap-2`,role:`radiogroup`,"aria-label":`Host`,"data-testid":`host-select`,children:I.map((e,t)=>{let n=w===e.id,r=!e.ok&&!n;return(0,q.jsx)(`button`,{type:`button`,role:`radio`,"aria-checked":n,"aria-label":e.label,title:e.ok?void 0:e.error||`Unreachable`,tabIndex:n?0:-1,onClick:()=>T(e.id),onKeyDown:e=>{let n=t;if(e.key===`ArrowRight`||e.key===`ArrowDown`)e.preventDefault(),n=(t+1)%I.length;else if(e.key===`ArrowLeft`||e.key===`ArrowUp`)e.preventDefault(),n=(t-1+I.length)%I.length;else return;let r=I[n];T(r.id),(e.currentTarget.parentElement?.querySelectorAll(`[role="radio"]`))?.[n]?.focus()},className:`btn text-xs focus:outline-none focus:ring-2 focus:ring-primary ${n?`btn-primary`:``} ${r?`opacity-60`:``}`,children:e.label},e.id||`local`)})})]}),(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`label`,{className:`mb-1.5 block text-xs text-secondary`,children:`Command`}),(0,q.jsx)(`div`,{className:`flex flex-wrap gap-2`,role:`radiogroup`,"aria-label":`Command preset`,"data-testid":`command-select`,children:F.map((e,t)=>{let n=e.isCustom?M:_===e.id;return(0,q.jsxs)(`button`,{ref:n?O:void 0,type:`button`,role:`radio`,"aria-checked":n,tabIndex:n?0:-1,onClick:()=>{e.isCustom?j():A(e.id)},onKeyDown:e=>{let n=t;if(e.key===`ArrowRight`||e.key===`ArrowDown`)e.preventDefault(),n=(t+1)%F.length;else if(e.key===`ArrowLeft`||e.key===`ArrowUp`)e.preventDefault(),n=(t-1+F.length)%F.length;else return;let r=F[n];r.isCustom?j():A(r.id),(e.currentTarget.parentElement?.querySelectorAll(`[role="radio"]`))?.[n]?.focus()},className:`btn text-xs focus:outline-none focus:ring-2 focus:ring-primary ${n?`btn-primary`:``}`,children:[(0,q.jsx)(Zm,{agentType:e.agentType,command:e.command,className:`inline-block h-3.5 w-3.5 shrink-0`}),e.label]},e.id)})}),(0,q.jsx)(`input`,{value:y,onChange:e=>b(e.target.value),placeholder:`Enter command...`,className:`input mt-2 font-mono text-xs`})]}),(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`label`,{className:`mb-1.5 block text-xs text-secondary`,children:`Project Path`}),(0,q.jsxs)(`div`,{className:`flex gap-2`,children:[(0,q.jsx)(`input`,{ref:D,value:p,onChange:e=>m(e.target.value),placeholder:N?`/home/user/project`:s||o||r||`/Users/you/code/my-project`,className:`input flex-1 text-sm`}),!N&&(0,q.jsx)(`button`,{type:`button`,className:`btn`,onClick:()=>C(!0),children:`Browse`})]})]}),(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`label`,{className:`mb-1.5 block text-xs text-secondary`,children:`Display Name`}),(0,q.jsx)(`input`,{value:h,onChange:e=>g(e.target.value),placeholder:`auto-generated`,className:`input text-sm placeholder:italic`})]})]}),(0,q.jsxs)(`div`,{className:`mt-6 flex justify-end gap-2`,children:[(0,q.jsx)(`button`,{type:`button`,onClick:t,className:`btn`,children:`Cancel`}),(0,q.jsx)(`button`,{type:`submit`,className:`btn btn-primary`,children:`Create`})]})]}),S&&!N&&(0,q.jsx)(zO,{initialPath:L,onSelect:e=>{m(e),C(!1)},onCancel:()=>C(!1)})]})}function VO({controlled:e,default:t,name:n,state:r=`value`}){let{current:i}=x.useRef(e!==void 0),[a,o]=x.useState(t);return[i?e:a,x.useCallback(e=>{i||o(e)},[])]}var HO={};function UO(e,t){let n=x.useRef(HO);return n.current===HO&&(n.current=e(t)),n}var WO=x[`useInsertionEffect${Math.random().toFixed(1)}`.slice(0,-3)],GO=WO&&WO!==x.useLayoutEffect?WO:e=>e();function KO(e){let t=UO(qO).current;return t.next=e,GO(t.effect),t.trampoline}function qO(){let e={next:void 0,callback:JO,trampoline:(...t)=>e.callback?.(...t),effect:()=>{e.callback=e.next}};return e}function JO(){}function YO(e,t,n,r){let i=UO(ZO).current;return QO(i,e,t,n,r)&&ek(i,[e,t,n,r]),i.callback}function XO(e){let t=UO(ZO).current;return $O(t,e)&&ek(t,e),t.callback}function ZO(){return{callback:null,cleanup:null,refs:[]}}function QO(e,t,n,r,i){return e.refs[0]!==t||e.refs[1]!==n||e.refs[2]!==r||e.refs[3]!==i}function $O(e,t){return e.refs.length!==t.length||e.refs.some((e,n)=>e!==t[n])}function ek(e,t){if(e.refs=t,t.every(e=>e==null)){e.callback=null;return}e.callback=n=>{if(e.cleanup&&=(e.cleanup(),null),n!=null){let r=Array(t.length).fill(null);for(let e=0;e<t.length;e+=1){let i=t[e];if(i!=null)switch(typeof i){case`function`:{let t=i(n);typeof t==`function`&&(r[e]=t);break}case`object`:i.current=n;break;default:}}e.cleanup=()=>{for(let e=0;e<t.length;e+=1){let n=t[e];if(n!=null)switch(typeof n){case`function`:{let t=r[e];typeof t==`function`?t():n(null);break}case`object`:n.current=null;break;default:}}}}}}var tk=typeof document<`u`?x.useLayoutEffect:()=>{},nk={clipPath:`inset(50%)`,overflow:`hidden`,whiteSpace:`nowrap`,border:0,padding:0,width:1,height:1,margin:-1},rk={...nk,position:`fixed`,top:0,left:0},ik={...nk,position:`absolute`};function ak(){}Object.freeze([]);var ok=Object.freeze({});function sk(e,...t){let n=new URL(`https://base-ui.com/production-error`);return n.searchParams.set(`code`,e.toString()),t.forEach(e=>n.searchParams.append(`args[]`,e)),`Base UI error #${e}; visit ${n} for the full message.`}var ck=18;function lk(e){return ck>=e}function uk(e){if(!x.isValidElement(e))return null;let t=e,n=t.props;return(lk(19)?n?.ref:t.ref)??null}function dk(e,t){if(e&&!t)return e;if(!e&&t)return t;if(e||t)return{...e,...t}}function fk(e,t){let n={};for(let r in e){let i=e[r];if(t?.hasOwnProperty(r)){let e=t[r](i);e!=null&&Object.assign(n,e);continue}i===!0?n[`data-${r.toLowerCase()}`]=``:i&&(n[`data-${r.toLowerCase()}`]=i.toString())}return n}function pk(e,t){return typeof e==`function`?e(t):e}function mk(e,t){return typeof e==`function`?e(t):e}var hk={};function gk(e,t,n,r,i){let a={...Sk(e,hk)};return t&&(a=vk(a,t)),n&&(a=vk(a,n)),r&&(a=vk(a,r)),i&&(a=vk(a,i)),a}function _k(e){if(e.length===0)return hk;if(e.length===1)return Sk(e[0],hk);let t={...Sk(e[0],hk)};for(let n=1;n<e.length;n+=1)t=vk(t,e[n]);return t}function vk(e,t){return xk(t)?t(e):yk(e,t)}function yk(e,t){if(!t)return e;for(let n in t){let r=t[n];switch(n){case`style`:e[n]=dk(e.style,r);break;case`className`:e[n]=Tk(e.className,r);break;default:bk(n,r)?e[n]=Ck(e[n],r):e[n]=r}}return e}function bk(e,t){let n=e.charCodeAt(0),r=e.charCodeAt(1),i=e.charCodeAt(2);return n===111&&r===110&&i>=65&&i<=90&&(typeof t==`function`||t===void 0)}function xk(e){return typeof e==`function`}function Sk(e,t){return xk(e)?e(t):e??hk}function Ck(e,t){return t?e?n=>{if(Ek(n)){let r=n;wk(r);let i=t(r);return r.baseUIHandlerPrevented||e?.(r),i}let r=t(n);return e?.(n),r}:t:e}function wk(e){return e.preventBaseUIHandler=()=>{e.baseUIHandlerPrevented=!0},e}function Tk(e,t){return t?e?t+` `+e:t:e}function Ek(e){return typeof e==`object`&&!!e&&`nativeEvent`in e}function Dk(e,t,n={}){let r=t.render,i=Ok(t,n);return n.enabled===!1?null:Ak(e,r,i,n.state??ok)}function Ok(e,t={}){let{className:n,style:r,render:i}=e,{state:a=ok,ref:o,props:s,stateAttributesMapping:c,enabled:l=!0}=t,u=l?pk(n,a):void 0,d=l?mk(r,a):void 0,f=l?fk(a,c):ok,p=l?dk(f,Array.isArray(s)?_k(s):s)??ok:ok;return typeof document<`u`&&(l?Array.isArray(o)?p.ref=XO([p.ref,uk(i),...o]):p.ref=YO(p.ref,uk(i),o):YO(null,null)),l?(u!==void 0&&(p.className=Tk(p.className,u)),d!==void 0&&(p.style=dk(p.style,d)),p):ok}var kk=Symbol.for(`react.lazy`);function Ak(e,t,n,r){if(t){if(typeof t==`function`)return t(n,r);let e=gk(n,t.props);e.ref=n.ref;let i=t;return i?.$$typeof===kk&&(i=x.Children.toArray(t)[0]),x.cloneElement(i,e)}if(e&&typeof e==`string`)return jk(e,n);throw Error(sk(8))}function jk(e,t){return e===`button`?(0,x.createElement)(`button`,{type:`button`,...t,key:t.key}):e===`img`?(0,x.createElement)(`img`,{alt:``,...t,key:t.key}):x.createElement(e,t)}var Mk={...x},Nk=0;function Pk(e,t=`mui`){let[n,r]=x.useState(e),i=e||n;return x.useEffect(()=>{n??(Nk+=1,r(`${t}-${Nk}`))},[n,t]),i}var Fk=Mk.useId;function Ik(e,t){if(Fk!==void 0){let n=Fk();return e??(t?`${t}-${n}`:n)}return Pk(e,t)}function Lk(e){return Ik(e,`base-ui`)}function Rk(){return typeof window<`u`}function zk(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Bk(e){return Rk()?e instanceof Element||e instanceof zk(e).Element:!1}function Vk(e){return Rk()?e instanceof HTMLElement||e instanceof zk(e).HTMLElement:!1}function Hk(e){return!Rk()||typeof ShadowRoot>`u`?!1:e instanceof ShadowRoot||e instanceof zk(e).ShadowRoot}var Uk=x.createContext(void 0);function Wk(e=!1){let t=x.useContext(Uk);if(t===void 0&&!e)throw Error(sk(16));return t}function Gk(e){let{focusableWhenDisabled:t,disabled:n,composite:r=!1,tabIndex:i=0,isNativeButton:a}=e,o=r&&t!==!1,s=r&&t===!1;return{props:x.useMemo(()=>{let e={onKeyDown(e){n&&t&&e.key!==`Tab`&&e.preventDefault()}};return r||(e.tabIndex=i,!a&&n&&(e.tabIndex=t?i:-1)),(a&&(t||o)||!a&&n)&&(e[`aria-disabled`]=n),a&&(!t||s)&&(e.disabled=n),e},[r,n,t,o,s,a,i])}}function Kk(e={}){let{disabled:t=!1,focusableWhenDisabled:n,tabIndex:r=0,native:i=!0}=e,a=x.useRef(null),o=Wk(!0)!==void 0,s=KO(()=>{let e=a.current;return!!(e?.tagName===`A`&&e?.href)}),{props:c}=Gk({focusableWhenDisabled:n,disabled:t,composite:o,tabIndex:r,isNativeButton:i}),l=x.useCallback(()=>{let e=a.current;qk(e)&&o&&t&&c.disabled===void 0&&e.disabled&&(e.disabled=!1)},[t,c.disabled,o]);return tk(l,[l]),{getButtonProps:x.useCallback((e={})=>{let{onClick:n,onMouseDown:r,onKeyUp:a,onKeyDown:o,onPointerDown:l,...u}=e;return gk({type:i?`button`:void 0,onClick(e){if(t){e.preventDefault();return}n?.(e)},onMouseDown(e){t||r?.(e)},onKeyDown(e){if(t||(wk(e),o?.(e)),e.baseUIHandlerPrevented)return;let r=e.target===e.currentTarget&&!i&&!s()&&!t,a=e.key===`Enter`,c=e.key===` `;r&&((c||a)&&e.preventDefault(),a&&n?.(e))},onKeyUp(e){t||(wk(e),a?.(e)),!e.baseUIHandlerPrevented&&e.target===e.currentTarget&&!i&&!t&&e.key===` `&&n?.(e)},onPointerDown(e){if(t){e.preventDefault();return}l?.(e)}},i?void 0:{role:`button`},c,u)},[t,c,i,s]),buttonRef:KO(e=>{a.current=e,l()})}}function qk(e){return Vk(e)&&e.tagName===`BUTTON`}var Jk=x.createContext(void 0);function Yk(){let e=x.useContext(Jk);if(e===void 0)throw Error(sk(63));return e}var Xk=function(e){return e.disabled=`data-disabled`,e.valid=`data-valid`,e.invalid=`data-invalid`,e.touched=`data-touched`,e.dirty=`data-dirty`,e.filled=`data-filled`,e.focused=`data-focused`,e}({}),Zk={badInput:!1,customError:!1,patternMismatch:!1,rangeOverflow:!1,rangeUnderflow:!1,stepMismatch:!1,tooLong:!1,tooShort:!1,typeMismatch:!1,valid:null,valueMissing:!1},Qk={valid(e){return e===null?null:e?{[Xk.valid]:``}:{[Xk.invalid]:``}}},$k=function(e){return e.checked=`data-checked`,e.unchecked=`data-unchecked`,e.disabled=`data-disabled`,e.readonly=`data-readonly`,e.required=`data-required`,e.valid=`data-valid`,e.invalid=`data-invalid`,e.touched=`data-touched`,e.dirty=`data-dirty`,e.filled=`data-filled`,e.focused=`data-focused`,e}({}),eA={...Qk,checked(e){return e?{[$k.checked]:``}:{[$k.unchecked]:``}}};function tA(e,t){return{...e,state:{...e.state,valid:!t&&e.state.valid}}}var nA=x.createContext({formRef:{current:{fields:new Map}},errors:{},clearErrors:ak,validationMode:`onSubmit`,submitAttemptedRef:{current:!1}});function rA(){return x.useContext(nA)}var iA=x.createContext({invalid:void 0,name:void 0,validityData:{state:Zk,errors:[],error:``,value:``,initialValue:null},setValidityData:ak,disabled:void 0,touched:!1,setTouched:ak,dirty:!1,setDirty:ak,filled:!1,setFilled:ak,focused:!1,setFocused:ak,validate:()=>null,validationMode:`onSubmit`,validationDebounceTime:0,shouldValidateOnChange:()=>!1,state:{disabled:!1,valid:null,touched:!1,dirty:!1,filled:!1,focused:!1},markedDirtyRef:{current:!1},validation:{getValidationProps:(e=ok)=>e,getInputValidationProps:(e=ok)=>e,inputRef:{current:null},commit:async()=>{}}});function aA(e=!0){let t=x.useContext(iA);if(t.setValidityData===ak&&!e)throw Error(sk(28));return t}function oA(e){let{enabled:t=!0,value:n,id:r,name:i,controlRef:a,commit:o}=e,{formRef:s}=rA(),{invalid:c,markedDirtyRef:l,validityData:u,setValidityData:d}=aA(),f=KO(e.getValue);tk(()=>{if(!t)return;let e=n;e===void 0&&(e=f()),u.initialValue===null&&e!==null&&d(t=>({...t,initialValue:e}))},[t,d,n,u.initialValue,f]),tk(()=>{!t||!r||s.current.fields.set(r,{getValue:f,name:i,controlRef:a,validityData:tA(u,c),validate(e=!0){let t=n;t===void 0&&(t=f()),l.current=!0,e?K.flushSync(()=>o(t)):o(t)}})},[o,a,t,s,f,r,c,l,i,u,n]),tk(()=>{let e=s.current.fields;return()=>{r&&e.delete(r)}},[s,r])}var sA=x.createContext({controlId:void 0,registerControlId:ak,labelId:void 0,setLabelId:ak,messageIds:[],setMessageIds:ak,getDescriptionProps:e=>e});function cA(){return x.useContext(sA)}function lA(e={}){let{id:t,implicit:n=!1,controlRef:r}=e,{controlId:i,registerControlId:a}=cA(),o=Lk(t),s=n?i:void 0,c=UO(()=>Symbol(`labelable-control`)),l=x.useRef(!1),u=x.useRef(t!=null),d=KO(()=>{!l.current||a===ak||(l.current=!1,a(c.current,void 0))});return tk(()=>{if(a===ak)return;let e;if(n){let n=r?.current;e=Bk(n)&&n.closest(`label`)!=null?t??null:s??o}else if(t!=null)u.current=!0,e=t;else if(u.current)e=o;else{d();return}if(e===void 0){d();return}l.current=!0,a(c.current,e)},[t,r,s,a,n,o,c,d]),x.useEffect(()=>d,[d]),i??o}var uA=`none`;function dA(e,t,n,r){let i=!1,a=!1,o=r??ok;return{reason:e,event:t??new Event(`base-ui`),cancel(){i=!0},allowPropagation(){a=!0},get isCanceled(){return i},get isPropagationAllowed(){return a},trigger:n,...o}}function fA(e,t){let n=x.useRef(e),r=KO(t);tk(()=>{n.current!==e&&r(n.current)},[e,r]),tk(()=>{n.current=e},[e])}var pA=x.forwardRef(function(e,t){let{checked:n,className:r,defaultChecked:i,id:a,inputRef:o,name:s,nativeButton:c=!1,onCheckedChange:l,readOnly:u=!1,required:d=!1,disabled:f=!1,render:p,uncheckedValue:m,value:h,...g}=e,{clearErrors:_}=rA(),{state:v,setTouched:y,setDirty:b,validityData:S,setFilled:C,setFocused:w,shouldValidateOnChange:T,validationMode:E,disabled:D,name:O,validation:k}=aA(),{labelId:A}=cA(),j=D||f,M=O??s,N=KO(l),P=x.useRef(null),F=YO(P,o,k.inputRef),I=x.useRef(null),L=Lk(),R=lA({id:a,implicit:!1,controlRef:I}),z=c?void 0:R,[B,V]=VO({controlled:n,default:!!i,name:`Switch`,state:`checked`});oA({id:L,commit:k.commit,value:B,controlRef:I,name:M,getValue:()=>B}),tk(()=>{P.current&&C(P.current.checked)},[P,C]),fA(B,()=>{_(M),b(B!==S.initialValue),C(B),T()?k.commit(B):k.commit(B,!0)});let{getButtonProps:H,buttonRef:U}=Kk({disabled:j,native:c}),W={id:c?R:L,role:`switch`,"aria-checked":B,"aria-readonly":u||void 0,"aria-required":d||void 0,"aria-labelledby":A,onFocus(){j||w(!0)},onBlur(){let e=P.current;!e||j||(y(!0),w(!1),E===`onBlur`&&k.commit(e.checked))},onClick(e){u||j||(e.preventDefault(),P.current?.dispatchEvent(new PointerEvent(`click`,{bubbles:!0,shiftKey:e.shiftKey,ctrlKey:e.ctrlKey,altKey:e.altKey,metaKey:e.metaKey})))}},G=x.useMemo(()=>gk({checked:B,disabled:j,id:z,name:M,required:d,style:M?ik:rk,tabIndex:-1,type:`checkbox`,"aria-hidden":!0,ref:F,onChange(e){if(e.nativeEvent.defaultPrevented)return;let t=e.target.checked,n=dA(uA,e.nativeEvent);N?.(t,n),!n.isCanceled&&V(t)},onFocus(){I.current?.focus()}},k.getInputValidationProps,h===void 0?ok:{value:h}),[B,j,F,z,M,N,d,V,k,h]),ee=x.useMemo(()=>({...v,checked:B,disabled:j,readOnly:u,required:d}),[v,B,j,u,d]),K=Dk(`span`,e,{state:ee,ref:[t,I,U],props:[W,k.getValidationProps,g,H],stateAttributesMapping:eA});return(0,q.jsxs)(Jk.Provider,{value:ee,children:[K,!B&&M&&m!==void 0&&(0,q.jsx)(`input`,{type:`hidden`,name:M,value:m}),(0,q.jsx)(`input`,{...G})]})}),mA=x.forwardRef(function(e,t){let{render:n,className:r,...i}=e,{state:a}=aA(),o=Yk();return Dk(`span`,e,{state:{...a,...o},ref:t,stateAttributesMapping:eA,props:i})});function hA(e){var t,n,r=``;if(typeof e==`string`||typeof e==`number`)r+=e;else if(typeof e==`object`)if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(n=hA(e[t]))&&(r&&(r+=` `),r+=n)}else for(n in e)e[n]&&(r&&(r+=` `),r+=n);return r}function gA(){for(var e,t,n=0,r=``,i=arguments.length;n<i;n++)(e=arguments[n])&&(t=hA(e))&&(r&&(r+=` `),r+=t);return r}var _A=(e,t)=>{let n=Array(e.length+t.length);for(let t=0;t<e.length;t++)n[t]=e[t];for(let r=0;r<t.length;r++)n[e.length+r]=t[r];return n},vA=(e,t)=>({classGroupId:e,validator:t}),yA=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),bA=`-`,xA=[],SA=`arbitrary..`,CA=e=>{let t=EA(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:e=>{if(e.startsWith(`[`)&&e.endsWith(`]`))return TA(e);let n=e.split(bA);return wA(n,+(n[0]===``&&n.length>1),t)},getConflictingClassGroupIds:(e,t)=>{if(t){let t=r[e],i=n[e];return t?i?_A(i,t):t:i||xA}return n[e]||xA}}},wA=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;let r=e[t],i=n.nextPart.get(r);if(i){let n=wA(e,t+1,i);if(n)return n}let a=n.validators;if(a===null)return;let o=t===0?e.join(bA):e.slice(t).join(bA),s=a.length;for(let e=0;e<s;e++){let t=a[e];if(t.validator(o))return t.classGroupId}},TA=e=>e.slice(1,-1).indexOf(`:`)===-1?void 0:(()=>{let t=e.slice(1,-1),n=t.indexOf(`:`),r=t.slice(0,n);return r?SA+r:void 0})(),EA=e=>{let{theme:t,classGroups:n}=e;return DA(n,t)},DA=(e,t)=>{let n=yA();for(let r in e){let i=e[r];OA(i,n,r,t)}return n},OA=(e,t,n,r)=>{let i=e.length;for(let a=0;a<i;a++){let i=e[a];kA(i,t,n,r)}},kA=(e,t,n,r)=>{if(typeof e==`string`){AA(e,t,n);return}if(typeof e==`function`){jA(e,t,n,r);return}MA(e,t,n,r)},AA=(e,t,n)=>{let r=e===``?t:NA(t,e);r.classGroupId=n},jA=(e,t,n,r)=>{if(PA(e)){OA(e(r),t,n,r);return}t.validators===null&&(t.validators=[]),t.validators.push(vA(n,e))},MA=(e,t,n,r)=>{let i=Object.entries(e),a=i.length;for(let e=0;e<a;e++){let[a,o]=i[e];OA(o,NA(t,a),n,r)}},NA=(e,t)=>{let n=e,r=t.split(bA),i=r.length;for(let e=0;e<i;e++){let t=r[e],i=n.nextPart.get(t);i||(i=yA(),n.nextPart.set(t,i)),n=i}return n},PA=e=>`isThemeGetter`in e&&e.isThemeGetter===!0,FA=e=>{if(e<1)return{get:()=>void 0,set:()=>{}};let t=0,n=Object.create(null),r=Object.create(null),i=(i,a)=>{n[i]=a,t++,t>e&&(t=0,r=n,n=Object.create(null))};return{get(e){let t=n[e];if(t!==void 0)return t;if((t=r[e])!==void 0)return i(e,t),t},set(e,t){e in n?n[e]=t:i(e,t)}}},IA=`!`,LA=`:`,RA=[],zA=(e,t,n,r,i)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:r,isExternal:i}),BA=e=>{let{prefix:t,experimentalParseClassName:n}=e,r=e=>{let t=[],n=0,r=0,i=0,a,o=e.length;for(let s=0;s<o;s++){let o=e[s];if(n===0&&r===0){if(o===LA){t.push(e.slice(i,s)),i=s+1;continue}if(o===`/`){a=s;continue}}o===`[`?n++:o===`]`?n--:o===`(`?r++:o===`)`&&r--}let s=t.length===0?e:e.slice(i),c=s,l=!1;s.endsWith(IA)?(c=s.slice(0,-1),l=!0):s.startsWith(IA)&&(c=s.slice(1),l=!0);let u=a&&a>i?a-i:void 0;return zA(t,l,c,u)};if(t){let e=t+LA,n=r;r=t=>t.startsWith(e)?n(t.slice(e.length)):zA(RA,!1,t,void 0,!0)}if(n){let e=r;r=t=>n({className:t,parseClassName:e})}return r},VA=e=>{let t=new Map;return e.orderSensitiveModifiers.forEach((e,n)=>{t.set(e,1e6+n)}),e=>{let n=[],r=[];for(let i=0;i<e.length;i++){let a=e[i],o=a[0]===`[`,s=t.has(a);o||s?(r.length>0&&(r.sort(),n.push(...r),r=[]),n.push(a)):r.push(a)}return r.length>0&&(r.sort(),n.push(...r)),n}},HA=e=>({cache:FA(e.cacheSize),parseClassName:BA(e),sortModifiers:VA(e),...CA(e)}),UA=/\s+/,WA=(e,t)=>{let{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:i,sortModifiers:a}=t,o=[],s=e.trim().split(UA),c=``;for(let e=s.length-1;e>=0;--e){let t=s[e],{isExternal:l,modifiers:u,hasImportantModifier:d,baseClassName:f,maybePostfixModifierPosition:p}=n(t);if(l){c=t+(c.length>0?` `+c:c);continue}let m=!!p,h=r(m?f.substring(0,p):f);if(!h){if(!m){c=t+(c.length>0?` `+c:c);continue}if(h=r(f),!h){c=t+(c.length>0?` `+c:c);continue}m=!1}let g=u.length===0?``:u.length===1?u[0]:a(u).join(`:`),_=d?g+IA:g,v=_+h;if(o.indexOf(v)>-1)continue;o.push(v);let y=i(h,m);for(let e=0;e<y.length;++e){let t=y[e];o.push(_+t)}c=t+(c.length>0?` `+c:c)}return c},GA=(...e)=>{let t=0,n,r,i=``;for(;t<e.length;)(n=e[t++])&&(r=KA(n))&&(i&&(i+=` `),i+=r);return i},KA=e=>{if(typeof e==`string`)return e;let t,n=``;for(let r=0;r<e.length;r++)e[r]&&(t=KA(e[r]))&&(n&&(n+=` `),n+=t);return n},qA=(e,...t)=>{let n,r,i,a,o=o=>(n=HA(t.reduce((e,t)=>t(e),e())),r=n.cache.get,i=n.cache.set,a=s,s(o)),s=e=>{let t=r(e);if(t)return t;let a=WA(e,n);return i(e,a),a};return a=o,(...e)=>a(GA(...e))},JA=[],YA=e=>{let t=t=>t[e]||JA;return t.isThemeGetter=!0,t},XA=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,ZA=/^\((?:(\w[\w-]*):)?(.+)\)$/i,QA=/^\d+\/\d+$/,$A=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,ej=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,tj=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,nj=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,rj=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,ij=e=>QA.test(e),aj=e=>!!e&&!Number.isNaN(Number(e)),oj=e=>!!e&&Number.isInteger(Number(e)),sj=e=>e.endsWith(`%`)&&aj(e.slice(0,-1)),cj=e=>$A.test(e),lj=()=>!0,uj=e=>ej.test(e)&&!tj.test(e),dj=()=>!1,fj=e=>nj.test(e),pj=e=>rj.test(e),mj=e=>!Q(e)&&!$(e),hj=e=>Dj(e,jj,dj),Q=e=>XA.test(e),gj=e=>Dj(e,Mj,uj),_j=e=>Dj(e,Nj,aj),vj=e=>Dj(e,kj,dj),yj=e=>Dj(e,Aj,pj),bj=e=>Dj(e,Fj,fj),$=e=>ZA.test(e),xj=e=>Oj(e,Mj),Sj=e=>Oj(e,Pj),Cj=e=>Oj(e,kj),wj=e=>Oj(e,jj),Tj=e=>Oj(e,Aj),Ej=e=>Oj(e,Fj,!0),Dj=(e,t,n)=>{let r=XA.exec(e);return r?r[1]?t(r[1]):n(r[2]):!1},Oj=(e,t,n=!1)=>{let r=ZA.exec(e);return r?r[1]?t(r[1]):n:!1},kj=e=>e===`position`||e===`percentage`,Aj=e=>e===`image`||e===`url`,jj=e=>e===`length`||e===`size`||e===`bg-size`,Mj=e=>e===`length`,Nj=e=>e===`number`,Pj=e=>e===`family-name`,Fj=e=>e===`shadow`,Ij=qA(()=>{let e=YA(`color`),t=YA(`font`),n=YA(`text`),r=YA(`font-weight`),i=YA(`tracking`),a=YA(`leading`),o=YA(`breakpoint`),s=YA(`container`),c=YA(`spacing`),l=YA(`radius`),u=YA(`shadow`),d=YA(`inset-shadow`),f=YA(`text-shadow`),p=YA(`drop-shadow`),m=YA(`blur`),h=YA(`perspective`),g=YA(`aspect`),_=YA(`ease`),v=YA(`animate`),y=()=>[`auto`,`avoid`,`all`,`avoid-page`,`page`,`left`,`right`,`column`],b=()=>[`center`,`top`,`bottom`,`left`,`right`,`top-left`,`left-top`,`top-right`,`right-top`,`bottom-right`,`right-bottom`,`bottom-left`,`left-bottom`],x=()=>[...b(),$,Q],S=()=>[`auto`,`hidden`,`clip`,`visible`,`scroll`],C=()=>[`auto`,`contain`,`none`],w=()=>[$,Q,c],T=()=>[ij,`full`,`auto`,...w()],E=()=>[oj,`none`,`subgrid`,$,Q],D=()=>[`auto`,{span:[`full`,oj,$,Q]},oj,$,Q],O=()=>[oj,`auto`,$,Q],k=()=>[`auto`,`min`,`max`,`fr`,$,Q],A=()=>[`start`,`end`,`center`,`between`,`around`,`evenly`,`stretch`,`baseline`,`center-safe`,`end-safe`],j=()=>[`start`,`end`,`center`,`stretch`,`center-safe`,`end-safe`],M=()=>[`auto`,...w()],N=()=>[ij,`auto`,`full`,`dvw`,`dvh`,`lvw`,`lvh`,`svw`,`svh`,`min`,`max`,`fit`,...w()],P=()=>[e,$,Q],F=()=>[...b(),Cj,vj,{position:[$,Q]}],I=()=>[`no-repeat`,{repeat:[``,`x`,`y`,`space`,`round`]}],L=()=>[`auto`,`cover`,`contain`,wj,hj,{size:[$,Q]}],R=()=>[sj,xj,gj],z=()=>[``,`none`,`full`,l,$,Q],B=()=>[``,aj,xj,gj],V=()=>[`solid`,`dashed`,`dotted`,`double`],H=()=>[`normal`,`multiply`,`screen`,`overlay`,`darken`,`lighten`,`color-dodge`,`color-burn`,`hard-light`,`soft-light`,`difference`,`exclusion`,`hue`,`saturation`,`color`,`luminosity`],U=()=>[aj,sj,Cj,vj],W=()=>[``,`none`,m,$,Q],G=()=>[`none`,aj,$,Q],ee=()=>[`none`,aj,$,Q],K=()=>[aj,$,Q],te=()=>[ij,`full`,...w()];return{cacheSize:500,theme:{animate:[`spin`,`ping`,`pulse`,`bounce`],aspect:[`video`],blur:[cj],breakpoint:[cj],color:[lj],container:[cj],"drop-shadow":[cj],ease:[`in`,`out`,`in-out`],font:[mj],"font-weight":[`thin`,`extralight`,`light`,`normal`,`medium`,`semibold`,`bold`,`extrabold`,`black`],"inset-shadow":[cj],leading:[`none`,`tight`,`snug`,`normal`,`relaxed`,`loose`],perspective:[`dramatic`,`near`,`normal`,`midrange`,`distant`,`none`],radius:[cj],shadow:[cj],spacing:[`px`,aj],text:[cj],"text-shadow":[cj],tracking:[`tighter`,`tight`,`normal`,`wide`,`wider`,`widest`]},classGroups:{aspect:[{aspect:[`auto`,`square`,ij,Q,$,g]}],container:[`container`],columns:[{columns:[aj,Q,$,s]}],"break-after":[{"break-after":y()}],"break-before":[{"break-before":y()}],"break-inside":[{"break-inside":[`auto`,`avoid`,`avoid-page`,`avoid-column`]}],"box-decoration":[{"box-decoration":[`slice`,`clone`]}],box:[{box:[`border`,`content`]}],display:[`block`,`inline-block`,`inline`,`flex`,`inline-flex`,`table`,`inline-table`,`table-caption`,`table-cell`,`table-column`,`table-column-group`,`table-footer-group`,`table-header-group`,`table-row-group`,`table-row`,`flow-root`,`grid`,`inline-grid`,`contents`,`list-item`,`hidden`],sr:[`sr-only`,`not-sr-only`],float:[{float:[`right`,`left`,`none`,`start`,`end`]}],clear:[{clear:[`left`,`right`,`both`,`none`,`start`,`end`]}],isolation:[`isolate`,`isolation-auto`],"object-fit":[{object:[`contain`,`cover`,`fill`,`none`,`scale-down`]}],"object-position":[{object:x()}],overflow:[{overflow:S()}],"overflow-x":[{"overflow-x":S()}],"overflow-y":[{"overflow-y":S()}],overscroll:[{overscroll:C()}],"overscroll-x":[{"overscroll-x":C()}],"overscroll-y":[{"overscroll-y":C()}],position:[`static`,`fixed`,`absolute`,`relative`,`sticky`],inset:[{inset:T()}],"inset-x":[{"inset-x":T()}],"inset-y":[{"inset-y":T()}],start:[{start:T()}],end:[{end:T()}],top:[{top:T()}],right:[{right:T()}],bottom:[{bottom:T()}],left:[{left:T()}],visibility:[`visible`,`invisible`,`collapse`],z:[{z:[oj,`auto`,$,Q]}],basis:[{basis:[ij,`full`,`auto`,s,...w()]}],"flex-direction":[{flex:[`row`,`row-reverse`,`col`,`col-reverse`]}],"flex-wrap":[{flex:[`nowrap`,`wrap`,`wrap-reverse`]}],flex:[{flex:[aj,ij,`auto`,`initial`,`none`,Q]}],grow:[{grow:[``,aj,$,Q]}],shrink:[{shrink:[``,aj,$,Q]}],order:[{order:[oj,`first`,`last`,`none`,$,Q]}],"grid-cols":[{"grid-cols":E()}],"col-start-end":[{col:D()}],"col-start":[{"col-start":O()}],"col-end":[{"col-end":O()}],"grid-rows":[{"grid-rows":E()}],"row-start-end":[{row:D()}],"row-start":[{"row-start":O()}],"row-end":[{"row-end":O()}],"grid-flow":[{"grid-flow":[`row`,`col`,`dense`,`row-dense`,`col-dense`]}],"auto-cols":[{"auto-cols":k()}],"auto-rows":[{"auto-rows":k()}],gap:[{gap:w()}],"gap-x":[{"gap-x":w()}],"gap-y":[{"gap-y":w()}],"justify-content":[{justify:[...A(),`normal`]}],"justify-items":[{"justify-items":[...j(),`normal`]}],"justify-self":[{"justify-self":[`auto`,...j()]}],"align-content":[{content:[`normal`,...A()]}],"align-items":[{items:[...j(),{baseline:[``,`last`]}]}],"align-self":[{self:[`auto`,...j(),{baseline:[``,`last`]}]}],"place-content":[{"place-content":A()}],"place-items":[{"place-items":[...j(),`baseline`]}],"place-self":[{"place-self":[`auto`,...j()]}],p:[{p:w()}],px:[{px:w()}],py:[{py:w()}],ps:[{ps:w()}],pe:[{pe:w()}],pt:[{pt:w()}],pr:[{pr:w()}],pb:[{pb:w()}],pl:[{pl:w()}],m:[{m:M()}],mx:[{mx:M()}],my:[{my:M()}],ms:[{ms:M()}],me:[{me:M()}],mt:[{mt:M()}],mr:[{mr:M()}],mb:[{mb:M()}],ml:[{ml:M()}],"space-x":[{"space-x":w()}],"space-x-reverse":[`space-x-reverse`],"space-y":[{"space-y":w()}],"space-y-reverse":[`space-y-reverse`],size:[{size:N()}],w:[{w:[s,`screen`,...N()]}],"min-w":[{"min-w":[s,`screen`,`none`,...N()]}],"max-w":[{"max-w":[s,`screen`,`none`,`prose`,{screen:[o]},...N()]}],h:[{h:[`screen`,`lh`,...N()]}],"min-h":[{"min-h":[`screen`,`lh`,`none`,...N()]}],"max-h":[{"max-h":[`screen`,`lh`,...N()]}],"font-size":[{text:[`base`,n,xj,gj]}],"font-smoothing":[`antialiased`,`subpixel-antialiased`],"font-style":[`italic`,`not-italic`],"font-weight":[{font:[r,$,_j]}],"font-stretch":[{"font-stretch":[`ultra-condensed`,`extra-condensed`,`condensed`,`semi-condensed`,`normal`,`semi-expanded`,`expanded`,`extra-expanded`,`ultra-expanded`,sj,Q]}],"font-family":[{font:[Sj,Q,t]}],"fvn-normal":[`normal-nums`],"fvn-ordinal":[`ordinal`],"fvn-slashed-zero":[`slashed-zero`],"fvn-figure":[`lining-nums`,`oldstyle-nums`],"fvn-spacing":[`proportional-nums`,`tabular-nums`],"fvn-fraction":[`diagonal-fractions`,`stacked-fractions`],tracking:[{tracking:[i,$,Q]}],"line-clamp":[{"line-clamp":[aj,`none`,$,_j]}],leading:[{leading:[a,...w()]}],"list-image":[{"list-image":[`none`,$,Q]}],"list-style-position":[{list:[`inside`,`outside`]}],"list-style-type":[{list:[`disc`,`decimal`,`none`,$,Q]}],"text-alignment":[{text:[`left`,`center`,`right`,`justify`,`start`,`end`]}],"placeholder-color":[{placeholder:P()}],"text-color":[{text:P()}],"text-decoration":[`underline`,`overline`,`line-through`,`no-underline`],"text-decoration-style":[{decoration:[...V(),`wavy`]}],"text-decoration-thickness":[{decoration:[aj,`from-font`,`auto`,$,gj]}],"text-decoration-color":[{decoration:P()}],"underline-offset":[{"underline-offset":[aj,`auto`,$,Q]}],"text-transform":[`uppercase`,`lowercase`,`capitalize`,`normal-case`],"text-overflow":[`truncate`,`text-ellipsis`,`text-clip`],"text-wrap":[{text:[`wrap`,`nowrap`,`balance`,`pretty`]}],indent:[{indent:w()}],"vertical-align":[{align:[`baseline`,`top`,`middle`,`bottom`,`text-top`,`text-bottom`,`sub`,`super`,$,Q]}],whitespace:[{whitespace:[`normal`,`nowrap`,`pre`,`pre-line`,`pre-wrap`,`break-spaces`]}],break:[{break:[`normal`,`words`,`all`,`keep`]}],wrap:[{wrap:[`break-word`,`anywhere`,`normal`]}],hyphens:[{hyphens:[`none`,`manual`,`auto`]}],content:[{content:[`none`,$,Q]}],"bg-attachment":[{bg:[`fixed`,`local`,`scroll`]}],"bg-clip":[{"bg-clip":[`border`,`padding`,`content`,`text`]}],"bg-origin":[{"bg-origin":[`border`,`padding`,`content`]}],"bg-position":[{bg:F()}],"bg-repeat":[{bg:I()}],"bg-size":[{bg:L()}],"bg-image":[{bg:[`none`,{linear:[{to:[`t`,`tr`,`r`,`br`,`b`,`bl`,`l`,`tl`]},oj,$,Q],radial:[``,$,Q],conic:[oj,$,Q]},Tj,yj]}],"bg-color":[{bg:P()}],"gradient-from-pos":[{from:R()}],"gradient-via-pos":[{via:R()}],"gradient-to-pos":[{to:R()}],"gradient-from":[{from:P()}],"gradient-via":[{via:P()}],"gradient-to":[{to:P()}],rounded:[{rounded:z()}],"rounded-s":[{"rounded-s":z()}],"rounded-e":[{"rounded-e":z()}],"rounded-t":[{"rounded-t":z()}],"rounded-r":[{"rounded-r":z()}],"rounded-b":[{"rounded-b":z()}],"rounded-l":[{"rounded-l":z()}],"rounded-ss":[{"rounded-ss":z()}],"rounded-se":[{"rounded-se":z()}],"rounded-ee":[{"rounded-ee":z()}],"rounded-es":[{"rounded-es":z()}],"rounded-tl":[{"rounded-tl":z()}],"rounded-tr":[{"rounded-tr":z()}],"rounded-br":[{"rounded-br":z()}],"rounded-bl":[{"rounded-bl":z()}],"border-w":[{border:B()}],"border-w-x":[{"border-x":B()}],"border-w-y":[{"border-y":B()}],"border-w-s":[{"border-s":B()}],"border-w-e":[{"border-e":B()}],"border-w-t":[{"border-t":B()}],"border-w-r":[{"border-r":B()}],"border-w-b":[{"border-b":B()}],"border-w-l":[{"border-l":B()}],"divide-x":[{"divide-x":B()}],"divide-x-reverse":[`divide-x-reverse`],"divide-y":[{"divide-y":B()}],"divide-y-reverse":[`divide-y-reverse`],"border-style":[{border:[...V(),`hidden`,`none`]}],"divide-style":[{divide:[...V(),`hidden`,`none`]}],"border-color":[{border:P()}],"border-color-x":[{"border-x":P()}],"border-color-y":[{"border-y":P()}],"border-color-s":[{"border-s":P()}],"border-color-e":[{"border-e":P()}],"border-color-t":[{"border-t":P()}],"border-color-r":[{"border-r":P()}],"border-color-b":[{"border-b":P()}],"border-color-l":[{"border-l":P()}],"divide-color":[{divide:P()}],"outline-style":[{outline:[...V(),`none`,`hidden`]}],"outline-offset":[{"outline-offset":[aj,$,Q]}],"outline-w":[{outline:[``,aj,xj,gj]}],"outline-color":[{outline:P()}],shadow:[{shadow:[``,`none`,u,Ej,bj]}],"shadow-color":[{shadow:P()}],"inset-shadow":[{"inset-shadow":[`none`,d,Ej,bj]}],"inset-shadow-color":[{"inset-shadow":P()}],"ring-w":[{ring:B()}],"ring-w-inset":[`ring-inset`],"ring-color":[{ring:P()}],"ring-offset-w":[{"ring-offset":[aj,gj]}],"ring-offset-color":[{"ring-offset":P()}],"inset-ring-w":[{"inset-ring":B()}],"inset-ring-color":[{"inset-ring":P()}],"text-shadow":[{"text-shadow":[`none`,f,Ej,bj]}],"text-shadow-color":[{"text-shadow":P()}],opacity:[{opacity:[aj,$,Q]}],"mix-blend":[{"mix-blend":[...H(),`plus-darker`,`plus-lighter`]}],"bg-blend":[{"bg-blend":H()}],"mask-clip":[{"mask-clip":[`border`,`padding`,`content`,`fill`,`stroke`,`view`]},`mask-no-clip`],"mask-composite":[{mask:[`add`,`subtract`,`intersect`,`exclude`]}],"mask-image-linear-pos":[{"mask-linear":[aj]}],"mask-image-linear-from-pos":[{"mask-linear-from":U()}],"mask-image-linear-to-pos":[{"mask-linear-to":U()}],"mask-image-linear-from-color":[{"mask-linear-from":P()}],"mask-image-linear-to-color":[{"mask-linear-to":P()}],"mask-image-t-from-pos":[{"mask-t-from":U()}],"mask-image-t-to-pos":[{"mask-t-to":U()}],"mask-image-t-from-color":[{"mask-t-from":P()}],"mask-image-t-to-color":[{"mask-t-to":P()}],"mask-image-r-from-pos":[{"mask-r-from":U()}],"mask-image-r-to-pos":[{"mask-r-to":U()}],"mask-image-r-from-color":[{"mask-r-from":P()}],"mask-image-r-to-color":[{"mask-r-to":P()}],"mask-image-b-from-pos":[{"mask-b-from":U()}],"mask-image-b-to-pos":[{"mask-b-to":U()}],"mask-image-b-from-color":[{"mask-b-from":P()}],"mask-image-b-to-color":[{"mask-b-to":P()}],"mask-image-l-from-pos":[{"mask-l-from":U()}],"mask-image-l-to-pos":[{"mask-l-to":U()}],"mask-image-l-from-color":[{"mask-l-from":P()}],"mask-image-l-to-color":[{"mask-l-to":P()}],"mask-image-x-from-pos":[{"mask-x-from":U()}],"mask-image-x-to-pos":[{"mask-x-to":U()}],"mask-image-x-from-color":[{"mask-x-from":P()}],"mask-image-x-to-color":[{"mask-x-to":P()}],"mask-image-y-from-pos":[{"mask-y-from":U()}],"mask-image-y-to-pos":[{"mask-y-to":U()}],"mask-image-y-from-color":[{"mask-y-from":P()}],"mask-image-y-to-color":[{"mask-y-to":P()}],"mask-image-radial":[{"mask-radial":[$,Q]}],"mask-image-radial-from-pos":[{"mask-radial-from":U()}],"mask-image-radial-to-pos":[{"mask-radial-to":U()}],"mask-image-radial-from-color":[{"mask-radial-from":P()}],"mask-image-radial-to-color":[{"mask-radial-to":P()}],"mask-image-radial-shape":[{"mask-radial":[`circle`,`ellipse`]}],"mask-image-radial-size":[{"mask-radial":[{closest:[`side`,`corner`],farthest:[`side`,`corner`]}]}],"mask-image-radial-pos":[{"mask-radial-at":b()}],"mask-image-conic-pos":[{"mask-conic":[aj]}],"mask-image-conic-from-pos":[{"mask-conic-from":U()}],"mask-image-conic-to-pos":[{"mask-conic-to":U()}],"mask-image-conic-from-color":[{"mask-conic-from":P()}],"mask-image-conic-to-color":[{"mask-conic-to":P()}],"mask-mode":[{mask:[`alpha`,`luminance`,`match`]}],"mask-origin":[{"mask-origin":[`border`,`padding`,`content`,`fill`,`stroke`,`view`]}],"mask-position":[{mask:F()}],"mask-repeat":[{mask:I()}],"mask-size":[{mask:L()}],"mask-type":[{"mask-type":[`alpha`,`luminance`]}],"mask-image":[{mask:[`none`,$,Q]}],filter:[{filter:[``,`none`,$,Q]}],blur:[{blur:W()}],brightness:[{brightness:[aj,$,Q]}],contrast:[{contrast:[aj,$,Q]}],"drop-shadow":[{"drop-shadow":[``,`none`,p,Ej,bj]}],"drop-shadow-color":[{"drop-shadow":P()}],grayscale:[{grayscale:[``,aj,$,Q]}],"hue-rotate":[{"hue-rotate":[aj,$,Q]}],invert:[{invert:[``,aj,$,Q]}],saturate:[{saturate:[aj,$,Q]}],sepia:[{sepia:[``,aj,$,Q]}],"backdrop-filter":[{"backdrop-filter":[``,`none`,$,Q]}],"backdrop-blur":[{"backdrop-blur":W()}],"backdrop-brightness":[{"backdrop-brightness":[aj,$,Q]}],"backdrop-contrast":[{"backdrop-contrast":[aj,$,Q]}],"backdrop-grayscale":[{"backdrop-grayscale":[``,aj,$,Q]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[aj,$,Q]}],"backdrop-invert":[{"backdrop-invert":[``,aj,$,Q]}],"backdrop-opacity":[{"backdrop-opacity":[aj,$,Q]}],"backdrop-saturate":[{"backdrop-saturate":[aj,$,Q]}],"backdrop-sepia":[{"backdrop-sepia":[``,aj,$,Q]}],"border-collapse":[{border:[`collapse`,`separate`]}],"border-spacing":[{"border-spacing":w()}],"border-spacing-x":[{"border-spacing-x":w()}],"border-spacing-y":[{"border-spacing-y":w()}],"table-layout":[{table:[`auto`,`fixed`]}],caption:[{caption:[`top`,`bottom`]}],transition:[{transition:[``,`all`,`colors`,`opacity`,`shadow`,`transform`,`none`,$,Q]}],"transition-behavior":[{transition:[`normal`,`discrete`]}],duration:[{duration:[aj,`initial`,$,Q]}],ease:[{ease:[`linear`,`initial`,_,$,Q]}],delay:[{delay:[aj,$,Q]}],animate:[{animate:[`none`,v,$,Q]}],backface:[{backface:[`hidden`,`visible`]}],perspective:[{perspective:[h,$,Q]}],"perspective-origin":[{"perspective-origin":x()}],rotate:[{rotate:G()}],"rotate-x":[{"rotate-x":G()}],"rotate-y":[{"rotate-y":G()}],"rotate-z":[{"rotate-z":G()}],scale:[{scale:ee()}],"scale-x":[{"scale-x":ee()}],"scale-y":[{"scale-y":ee()}],"scale-z":[{"scale-z":ee()}],"scale-3d":[`scale-3d`],skew:[{skew:K()}],"skew-x":[{"skew-x":K()}],"skew-y":[{"skew-y":K()}],transform:[{transform:[$,Q,``,`none`,`gpu`,`cpu`]}],"transform-origin":[{origin:x()}],"transform-style":[{transform:[`3d`,`flat`]}],translate:[{translate:te()}],"translate-x":[{"translate-x":te()}],"translate-y":[{"translate-y":te()}],"translate-z":[{"translate-z":te()}],"translate-none":[`translate-none`],accent:[{accent:P()}],appearance:[{appearance:[`none`,`auto`]}],"caret-color":[{caret:P()}],"color-scheme":[{scheme:[`normal`,`dark`,`light`,`light-dark`,`only-dark`,`only-light`]}],cursor:[{cursor:[`auto`,`default`,`pointer`,`wait`,`text`,`move`,`help`,`not-allowed`,`none`,`context-menu`,`progress`,`cell`,`crosshair`,`vertical-text`,`alias`,`copy`,`no-drop`,`grab`,`grabbing`,`all-scroll`,`col-resize`,`row-resize`,`n-resize`,`e-resize`,`s-resize`,`w-resize`,`ne-resize`,`nw-resize`,`se-resize`,`sw-resize`,`ew-resize`,`ns-resize`,`nesw-resize`,`nwse-resize`,`zoom-in`,`zoom-out`,$,Q]}],"field-sizing":[{"field-sizing":[`fixed`,`content`]}],"pointer-events":[{"pointer-events":[`auto`,`none`]}],resize:[{resize:[`none`,``,`y`,`x`]}],"scroll-behavior":[{scroll:[`auto`,`smooth`]}],"scroll-m":[{"scroll-m":w()}],"scroll-mx":[{"scroll-mx":w()}],"scroll-my":[{"scroll-my":w()}],"scroll-ms":[{"scroll-ms":w()}],"scroll-me":[{"scroll-me":w()}],"scroll-mt":[{"scroll-mt":w()}],"scroll-mr":[{"scroll-mr":w()}],"scroll-mb":[{"scroll-mb":w()}],"scroll-ml":[{"scroll-ml":w()}],"scroll-p":[{"scroll-p":w()}],"scroll-px":[{"scroll-px":w()}],"scroll-py":[{"scroll-py":w()}],"scroll-ps":[{"scroll-ps":w()}],"scroll-pe":[{"scroll-pe":w()}],"scroll-pt":[{"scroll-pt":w()}],"scroll-pr":[{"scroll-pr":w()}],"scroll-pb":[{"scroll-pb":w()}],"scroll-pl":[{"scroll-pl":w()}],"snap-align":[{snap:[`start`,`end`,`center`,`align-none`]}],"snap-stop":[{snap:[`normal`,`always`]}],"snap-type":[{snap:[`none`,`x`,`y`,`both`]}],"snap-strictness":[{snap:[`mandatory`,`proximity`]}],touch:[{touch:[`auto`,`none`,`manipulation`]}],"touch-x":[{"touch-pan":[`x`,`left`,`right`]}],"touch-y":[{"touch-pan":[`y`,`up`,`down`]}],"touch-pz":[`touch-pinch-zoom`],select:[{select:[`none`,`text`,`all`,`auto`]}],"will-change":[{"will-change":[`auto`,`scroll`,`contents`,`transform`,$,Q]}],fill:[{fill:[`none`,...P()]}],"stroke-w":[{stroke:[aj,xj,gj,_j]}],stroke:[{stroke:[`none`,...P()]}],"forced-color-adjust":[{"forced-color-adjust":[`auto`,`none`]}]},conflictingClassGroups:{overflow:[`overflow-x`,`overflow-y`],overscroll:[`overscroll-x`,`overscroll-y`],inset:[`inset-x`,`inset-y`,`start`,`end`,`top`,`right`,`bottom`,`left`],"inset-x":[`right`,`left`],"inset-y":[`top`,`bottom`],flex:[`basis`,`grow`,`shrink`],gap:[`gap-x`,`gap-y`],p:[`px`,`py`,`ps`,`pe`,`pt`,`pr`,`pb`,`pl`],px:[`pr`,`pl`],py:[`pt`,`pb`],m:[`mx`,`my`,`ms`,`me`,`mt`,`mr`,`mb`,`ml`],mx:[`mr`,`ml`],my:[`mt`,`mb`],size:[`w`,`h`],"font-size":[`leading`],"fvn-normal":[`fvn-ordinal`,`fvn-slashed-zero`,`fvn-figure`,`fvn-spacing`,`fvn-fraction`],"fvn-ordinal":[`fvn-normal`],"fvn-slashed-zero":[`fvn-normal`],"fvn-figure":[`fvn-normal`],"fvn-spacing":[`fvn-normal`],"fvn-fraction":[`fvn-normal`],"line-clamp":[`display`,`overflow`],rounded:[`rounded-s`,`rounded-e`,`rounded-t`,`rounded-r`,`rounded-b`,`rounded-l`,`rounded-ss`,`rounded-se`,`rounded-ee`,`rounded-es`,`rounded-tl`,`rounded-tr`,`rounded-br`,`rounded-bl`],"rounded-s":[`rounded-ss`,`rounded-es`],"rounded-e":[`rounded-se`,`rounded-ee`],"rounded-t":[`rounded-tl`,`rounded-tr`],"rounded-r":[`rounded-tr`,`rounded-br`],"rounded-b":[`rounded-br`,`rounded-bl`],"rounded-l":[`rounded-tl`,`rounded-bl`],"border-spacing":[`border-spacing-x`,`border-spacing-y`],"border-w":[`border-w-x`,`border-w-y`,`border-w-s`,`border-w-e`,`border-w-t`,`border-w-r`,`border-w-b`,`border-w-l`],"border-w-x":[`border-w-r`,`border-w-l`],"border-w-y":[`border-w-t`,`border-w-b`],"border-color":[`border-color-x`,`border-color-y`,`border-color-s`,`border-color-e`,`border-color-t`,`border-color-r`,`border-color-b`,`border-color-l`],"border-color-x":[`border-color-r`,`border-color-l`],"border-color-y":[`border-color-t`,`border-color-b`],translate:[`translate-x`,`translate-y`,`translate-none`],"translate-none":[`translate`,`translate-x`,`translate-y`,`translate-z`],"scroll-m":[`scroll-mx`,`scroll-my`,`scroll-ms`,`scroll-me`,`scroll-mt`,`scroll-mr`,`scroll-mb`,`scroll-ml`],"scroll-mx":[`scroll-mr`,`scroll-ml`],"scroll-my":[`scroll-mt`,`scroll-mb`],"scroll-p":[`scroll-px`,`scroll-py`,`scroll-ps`,`scroll-pe`,`scroll-pt`,`scroll-pr`,`scroll-pb`,`scroll-pl`],"scroll-px":[`scroll-pr`,`scroll-pl`],"scroll-py":[`scroll-pt`,`scroll-pb`],touch:[`touch-x`,`touch-y`,`touch-pz`],"touch-x":[`touch`],"touch-y":[`touch`],"touch-pz":[`touch`]},conflictingClassGroupModifiers:{"font-size":[`leading`]},orderSensitiveModifiers:[`*`,`**`,`after`,`backdrop`,`before`,`details-content`,`file`,`first-letter`,`first-line`,`marker`,`placeholder`,`selection`]}});function Lj(...e){return Ij(gA(e))}function Rj({checked:e,onCheckedChange:t,disabled:n,className:r}){return(0,q.jsx)(pA,{checked:e,onCheckedChange:t,disabled:n,className:Lj(`group relative inline-flex h-6 w-10 shrink-0 cursor-pointer items-center rounded-full transition-colors`,`bg-border data-[checked]:bg-accent`,`focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent focus-visible:ring-offset-2 focus-visible:ring-offset-bg-base`,`disabled:cursor-not-allowed disabled:opacity-50`,r),children:(0,q.jsx)(mA,{className:Lj(`pointer-events-none block size-4 rounded-full bg-white shadow-sm transition-transform`,`translate-x-1 group-data-[checked]:translate-x-5`)})})}var zj=null,Bj=!1,Vj={},Hj=500;function Uj(){if(typeof window>`u`)return null;if(zj?.state===`closed`&&(zj=null),!zj){let e=window.AudioContext??window.webkitAudioContext;if(!e)return null;zj=new e}return zj}function Wj(){zj&&=(zj.close().catch(()=>{}),null),Uj()}function Gj(){return Bj}function Kj(){zj&&(Wj(),Bj=!0)}if(typeof window<`u`){window.addEventListener(`pageshow`,e=>{e.persisted&&Kj()}),document.addEventListener(`visibilitychange`,()=>{document.visibilityState===`visible`&&Kj()});let e=Date.now();setInterval(()=>{let t=Date.now();t-e>15e3&&Kj(),e=t},5e3)}async function qj(){let e=Uj();e&&e.state===`suspended`&&await e.resume().catch(()=>{}),Bj=!1}async function Jj(e){e.state===`suspended`&&await e.resume().catch(()=>{})}async function Yj(e){let t=Uj();if(!t||(await Jj(t),t.state!==`running`))return;let{frequencies:n,durationMs:r,attackMs:i,peakGain:a,type:o=`sine`}=e,s=t.currentTime,c=r/1e3,l=i/1e3,u=t.createGain();u.connect(t.destination);let d=s+c*.7;u.gain.setValueAtTime(0,s),u.gain.linearRampToValueAtTime(a,s+l),u.gain.setValueAtTime(a,d),u.gain.linearRampToValueAtTime(0,s+c);let f=n.map(e=>{let n=t.createOscillator();return n.type=o,n.frequency.setValueAtTime(e,s),n.connect(u),n});for(let e of f)e.start(s),e.stop(s+c);let p=f[f.length-1];p.onended=()=>{for(let e of f)e.disconnect();u.disconnect()}}async function Xj(){let e=Date.now();if(!(e-(Vj.permission||0)<Hj)){Vj.permission=e;try{await Yj({frequencies:[880],durationMs:150,attackMs:5,peakGain:.15,type:`sine`})}catch{}}}async function Zj(){let e=Date.now();if(!(e-(Vj.idle||0)<Hj)){Vj.idle=e;try{await Yj({frequencies:[440,550],durationMs:300,attackMs:10,peakGain:.08,type:`sine`})}catch{}}}function Qj({isOpen:e,onClose:t}){let n=G(e=>e.defaultProjectDir),r=G(e=>e.setDefaultProjectDir),i=G(e=>e.commandPresets),a=G(e=>e.setCommandPresets),o=G(e=>e.defaultPresetId),s=G(e=>e.setDefaultPresetId),c=G(e=>e.sessionSortMode),l=G(e=>e.setSessionSortMode),u=G(e=>e.sessionSortDirection),d=G(e=>e.setSessionSortDirection),f=G(e=>e.useWebGL),p=G(e=>e.setUseWebGL),m=G(e=>e.fontSize),h=G(e=>e.setFontSize),g=G(e=>e.lineHeight),_=G(e=>e.setLineHeight),v=G(e=>e.letterSpacing),y=G(e=>e.setLetterSpacing),b=G(e=>e.fontOption),S=G(e=>e.setFontOption),C=G(e=>e.customFontFamily),w=G(e=>e.setCustomFontFamily),T=G(e=>e.shortcutModifier),E=G(e=>e.setShortcutModifier),D=G(e=>e.showProjectName),O=G(e=>e.setShowProjectName),k=G(e=>e.showLastUserMessage),A=G(e=>e.setShowLastUserMessage),j=G(e=>e.showSessionIdPrefix),M=G(e=>e.setShowSessionIdPrefix),N=ZD(e=>e.theme),F=ZD(e=>e.setTheme),I=G(e=>e.soundOnPermission),R=G(e=>e.setSoundOnPermission),z=G(e=>e.soundOnIdle),B=G(e=>e.setSoundOnIdle),[V,H]=(0,x.useState)(n),[U,W]=(0,x.useState)(i),[ee,K]=(0,x.useState)(o),[te,ne]=(0,x.useState)(c),[re,ie]=(0,x.useState)(u),[ae,oe]=(0,x.useState)(f),[se,ce]=(0,x.useState)(m),[le,ue]=(0,x.useState)(g),[de,fe]=(0,x.useState)(v),[pe,me]=(0,x.useState)(b),[he,ge]=(0,x.useState)(C),[_e,ve]=(0,x.useState)(T),[ye,be]=(0,x.useState)(D),[xe,Se]=(0,x.useState)(k),[Ce,we]=(0,x.useState)(j),[Te,Ee]=(0,x.useState)(N),[De,Oe]=(0,x.useState)(I),[ke,Ae]=(0,x.useState)(z),[je,Me]=(0,x.useState)(!0),[Ne,Pe]=(0,x.useState)(!1),[Fe,Ie]=(0,x.useState)(24),[Le,Re]=(0,x.useState)(!1),[ze,Be]=(0,x.useState)(!1),[Ve,He]=(0,x.useState)(``),[Ue,Ge]=(0,x.useState)(``),[qe,Je]=(0,x.useState)(``),Ye=(0,x.useRef)(null);if((0,x.useEffect)(()=>{if(Ye.current&&=(clearTimeout(Ye.current),null),e){if(H(n),W(i),K(o),ne(c),ie(u),oe(f),ce(m),ue(g),fe(v),me(b),ge(C),ve(T),be(D),Se(k),we(j),Ee(N),Oe(I),Ae(z),Be(!1),He(``),Ge(``),Je(``),fetch(`/api/settings/tmux-mouse-mode`).then(e=>e.json()).then(e=>Me(e.enabled)).catch(()=>{}),fetch(`/api/settings/history-max-age-hours`).then(e=>e.json()).then(e=>Ie(e.hours)).catch(()=>{}),typeof document<`u`){let e=document.querySelector(`.xterm-helper-textarea`);e&&typeof e.setAttribute==`function`&&(typeof e.blur==`function`&&e.blur(),e.setAttribute(`disabled`,`true`))}}else typeof document<`u`&&(Ye.current=setTimeout(()=>{if(typeof document>`u`)return;let e=document.querySelector(`.xterm-helper-textarea`);e&&(e.removeAttribute(`disabled`),e.focus())},300));return()=>{Ye.current&&=(clearTimeout(Ye.current),null)}},[i,o,n,c,u,f,m,g,v,b,C,T,D,k,j,N,I,z,e]),(0,x.useEffect)(()=>{if(!e||typeof window>`u`||typeof window.addEventListener!=`function`)return;let n=e=>{e.key===`Escape`&&(typeof e.stopPropagation==`function`&&e.stopPropagation(),t())};return window.addEventListener(`keydown`,n),()=>window.removeEventListener(`keydown`,n)},[e,t]),!e)return null;let Xe=e=>{e.preventDefault();let n=V.trim(),i=ae!==f;r(n||`~/Documents/GitHub`),a(U),s(ee),l(te),d(re),p(ae),h(se),_(le),y(de),S(pe),w(he),E(_e),O(ye),A(xe),M(Ce),F(Te),R(De),B(ke),t({webglChanged:i})},Ze=(e,t)=>{W(n=>n.map(n=>n.id===e?{...n,...t}:n))},Qe=e=>{let t=U.find(t=>t.id===e);if(!t||t.isBuiltIn)return;let n=U.filter(t=>t.id!==e);W(n),e===ee&&K(n[0]?.id||`claude`)},$e=()=>{if(!Ve.trim()||!Ue.trim()||U.length>=50)return;let e={id:`custom-${Date.now()}-${Math.random().toString(36).slice(2,6)}`,label:Ve.trim(),command:Ue.trim(),isBuiltIn:!1,agentType:qe||void 0};W([...U,e]),Be(!1),He(``),Ge(``),Je(``)},et=U.length<50,tt=e=>{Pe(!0),Me(e),fetch(`/api/settings/tmux-mouse-mode`,{method:`PUT`,headers:{"Content-Type":`application/json`},body:JSON.stringify({enabled:e})}).catch(()=>Me(!e)).finally(()=>Pe(!1))},nt=e=>{let t=Fe;Re(!0),Ie(e),fetch(`/api/settings/history-max-age-hours`,{method:`PUT`,headers:{"Content-Type":`application/json`},body:JSON.stringify({hours:e})}).catch(()=>Ie(t)).finally(()=>Re(!1))};return(0,q.jsx)(`div`,{className:`fixed inset-0 z-50 flex items-center justify-center bg-black/60 p-4`,onClick:e=>{e.target===e.currentTarget&&t()},children:(0,q.jsxs)(`form`,{onSubmit:Xe,className:`w-full max-w-lg max-h-[90vh] flex flex-col border border-border bg-elevated`,children:[(0,q.jsxs)(`div`,{className:`p-6 pb-0`,children:[(0,q.jsx)(`h2`,{className:`text-sm font-semibold uppercase tracking-wider text-primary text-balance`,children:`Settings`}),(0,q.jsx)(`p`,{className:`mt-2 text-xs text-muted text-pretty`,children:`Configure default directory, command presets, and display options.`})]}),(0,q.jsx)(`div`,{className:`flex-1 overflow-y-auto px-6 pb-4`,children:(0,q.jsxs)(`div`,{className:`mt-5 space-y-4`,children:[(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`label`,{className:`mb-1.5 block text-xs text-secondary`,children:`Default Project Directory`}),(0,q.jsx)(`input`,{value:V,onChange:e=>H(e.target.value),placeholder:P,className:`input`,autoFocus:!0})]}),(0,q.jsxs)(`div`,{className:`border-t border-border pt-4`,children:[(0,q.jsxs)(`div`,{className:`flex items-center justify-between mb-2`,children:[(0,q.jsx)(`label`,{className:`text-xs text-secondary`,children:`Command Presets`}),(0,q.jsx)(`select`,{value:ee,onChange:e=>K(e.target.value),className:`input text-xs py-1 px-2 w-auto`,children:U.map(e=>(0,q.jsx)(`option`,{value:e.id,children:e.label},e.id))})]}),(0,q.jsx)(`p`,{className:`text-[10px] text-muted mb-3`,children:`Default preset is pre-selected when creating new sessions.`}),(0,q.jsx)(`div`,{className:`space-y-3`,children:U.map(e=>(0,q.jsxs)(`div`,{className:`border border-border p-3 space-y-2`,children:[(0,q.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,q.jsx)(`div`,{className:`flex items-center gap-2`,children:(0,q.jsx)(`input`,{value:e.label,onChange:t=>Ze(e.id,{label:t.target.value}),className:`input text-sm py-1 px-2 w-32`,placeholder:`Label`})}),!e.isBuiltIn&&(0,q.jsx)(`button`,{type:`button`,onClick:()=>Qe(e.id),className:`btn text-xs px-2 py-1 text-error hover:bg-error/10`,children:`Delete`})]}),(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`label`,{className:`text-[10px] text-muted block mb-1`,children:`Command`}),(0,q.jsx)(`input`,{value:e.command,onChange:t=>Ze(e.id,{command:t.target.value}),className:`input text-xs py-1 px-2 font-mono w-full`,placeholder:`command --flags`})]}),!e.isBuiltIn&&(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`label`,{className:`text-[10px] text-muted block mb-1`,children:`Icon`}),(0,q.jsxs)(`select`,{value:e.agentType||``,onChange:t=>Ze(e.id,{agentType:t.target.value||void 0}),className:`input text-xs py-1 px-2 w-auto`,children:[(0,q.jsx)(`option`,{value:``,children:`Terminal`}),(0,q.jsx)(`option`,{value:`claude`,children:`Claude`}),(0,q.jsx)(`option`,{value:`codex`,children:`Codex`})]})]})]},e.id))}),ze?(0,q.jsxs)(`div`,{className:`mt-3 border border-border p-3 space-y-2`,children:[(0,q.jsx)(`div`,{className:`text-xs text-secondary mb-2`,children:`New Preset`}),(0,q.jsx)(`input`,{value:Ve,onChange:e=>He(e.target.value),className:`input text-xs py-1 px-2 w-full`,placeholder:`Label`}),(0,q.jsx)(`input`,{value:Ue,onChange:e=>Ge(e.target.value),className:`input text-xs py-1 px-2 font-mono w-full`,placeholder:`command --flags`}),(0,q.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,q.jsxs)(`select`,{value:qe,onChange:e=>Je(e.target.value),className:`input text-xs py-1 px-2 w-auto`,children:[(0,q.jsx)(`option`,{value:``,children:`Terminal Icon`}),(0,q.jsx)(`option`,{value:`claude`,children:`Claude Icon`}),(0,q.jsx)(`option`,{value:`codex`,children:`Codex Icon`})]}),(0,q.jsx)(`div`,{className:`flex-1`}),(0,q.jsx)(`button`,{type:`button`,onClick:()=>Be(!1),className:`btn text-xs px-2 py-1`,children:`Cancel`}),(0,q.jsx)(`button`,{type:`button`,onClick:$e,disabled:!Ve.trim()||!Ue.trim(),className:`btn btn-primary text-xs px-2 py-1`,children:`Add`})]})]}):(0,q.jsx)(`button`,{type:`button`,onClick:()=>Be(!0),disabled:!et,className:`btn text-xs mt-3 w-full`,children:et?`+ Add Preset`:`Max 50 presets`})]}),(0,q.jsxs)(`div`,{className:`border-t border-border pt-4`,children:[(0,q.jsx)(`label`,{className:`mb-2 block text-xs text-secondary`,children:`Session List Order`}),(0,q.jsxs)(`div`,{className:`flex gap-2`,children:[(0,q.jsx)(`button`,{type:`button`,className:`btn flex-1 ${te===`created`?`btn-primary`:``}`,onClick:()=>ne(`created`),children:`Created`}),(0,q.jsx)(`button`,{type:`button`,className:`btn flex-1 ${te===`status`?`btn-primary`:``}`,onClick:()=>ne(`status`),children:`Status`}),(0,q.jsx)(`button`,{type:`button`,className:`btn flex-1 ${te===`manual`?`btn-primary`:``}`,onClick:()=>ne(`manual`),children:`Manual`})]}),(0,q.jsx)(`p`,{className:`mt-1.5 text-[10px] text-muted`,children:te===`status`?`Sessions auto-resort by status (waiting, working, unknown)`:te===`manual`?`Drag sessions to reorder manually`:`Sessions stay in creation order`})]}),te===`created`&&(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`label`,{className:`mb-2 block text-xs text-secondary`,children:`Sort Direction`}),(0,q.jsxs)(`div`,{className:`flex gap-2`,children:[(0,q.jsx)(`button`,{type:`button`,className:`btn flex-1 ${re===`desc`?`btn-primary`:``}`,onClick:()=>ie(`desc`),children:`Newest First`}),(0,q.jsx)(`button`,{type:`button`,className:`btn flex-1 ${re===`asc`?`btn-primary`:``}`,onClick:()=>ie(`asc`),children:`Oldest First`})]})]}),(0,q.jsxs)(`div`,{className:`border-t border-border pt-4 space-y-3`,children:[(0,q.jsx)(`label`,{className:`mb-1 block text-xs text-secondary`,children:`Session List Details`}),(0,q.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`div`,{className:`text-sm text-primary`,children:`Project Name`}),(0,q.jsx)(`div`,{className:`text-[10px] text-muted`,children:`Show the project folder name under each session.`})]}),(0,q.jsx)(Rj,{checked:ye,onCheckedChange:be})]}),(0,q.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`div`,{className:`text-sm text-primary`,children:`Last User Message`}),(0,q.jsx)(`div`,{className:`text-[10px] text-muted`,children:`Show the most recent user input next to the project name.`})]}),(0,q.jsx)(Rj,{checked:xe,onCheckedChange:Se})]}),(0,q.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`div`,{className:`text-sm text-primary`,children:`Session ID Prefix`}),(0,q.jsx)(`div`,{className:`text-[10px] text-muted`,children:`Show first 5 characters of agent session IDs in the list.`})]}),(0,q.jsx)(Rj,{checked:Ce,onCheckedChange:we})]}),(0,q.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`div`,{className:`text-sm text-primary`,children:`History Sessions Lookback`}),(0,q.jsxs)(`div`,{className:`text-[10px] text-muted`,children:[`Show history sessions from the last N hours (`,1,`-`,168,`).`]})]}),(0,q.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,q.jsx)(`input`,{type:`number`,min:1,max:168,value:Fe,onChange:e=>{let t=parseInt(e.target.value,10);t>=1&&t<=168&&nt(t)},disabled:Le,className:`input text-xs py-1 px-2 w-16 text-center`}),(0,q.jsx)(`span`,{className:`text-xs text-muted`,children:`hrs`})]})]})]}),(0,q.jsxs)(`div`,{className:`border-t border-border pt-4 space-y-3`,children:[(0,q.jsx)(`label`,{className:`mb-1 block text-xs text-secondary`,children:`Notifications`}),(0,q.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,q.jsxs)(`div`,{className:`flex-1`,children:[(0,q.jsx)(`div`,{className:`text-sm text-primary`,children:`Permission Sound`}),(0,q.jsx)(`div`,{className:`text-[10px] text-muted`,children:`Play a ping when any session needs permission.`})]}),(0,q.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,q.jsx)(`button`,{type:`button`,onClick:()=>void Xj(),className:`btn text-xs px-2 py-1`,children:`Test`}),(0,q.jsx)(Rj,{checked:De,onCheckedChange:e=>{Oe(e),e&&qj()}})]})]}),(0,q.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,q.jsxs)(`div`,{className:`flex-1`,children:[(0,q.jsx)(`div`,{className:`text-sm text-primary`,children:`Idle Sound`}),(0,q.jsx)(`div`,{className:`text-[10px] text-muted`,children:`Play a chime when a session finishes working.`})]}),(0,q.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,q.jsx)(`button`,{type:`button`,onClick:()=>void Zj(),className:`btn text-xs px-2 py-1`,children:`Test`}),(0,q.jsx)(Rj,{checked:ke,onCheckedChange:e=>{Ae(e),e&&qj()}})]})]})]}),(0,q.jsxs)(`div`,{className:`border-t border-border pt-4`,children:[(0,q.jsx)(`label`,{className:`mb-2 block text-xs text-secondary`,children:`Terminal Rendering`}),(0,q.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`div`,{className:`text-sm text-primary`,children:`WebGL Acceleration`}),(0,q.jsx)(`div`,{className:`text-[10px] text-muted`,children:`GPU rendering for better performance. Turn off if text looks fuzzy or flickering.`})]}),(0,q.jsx)(Rj,{checked:ae,onCheckedChange:oe})]}),ae!==f&&(0,q.jsx)(`p`,{className:`mt-2 text-[10px] text-approval`,children:`Terminal will reload when saved`}),(0,q.jsxs)(`div`,{className:`mt-4 flex items-center justify-between`,children:[(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`div`,{className:`text-sm text-primary`,children:`Mouse Mode`}),(0,q.jsx)(`div`,{className:`text-[10px] text-muted`,children:`Enable tmux mouse mode for trackpad/scroll wheel support.`})]}),(0,q.jsx)(Rj,{checked:je,onCheckedChange:tt,disabled:Ne})]}),(0,q.jsxs)(`div`,{className:`mt-4 flex items-center justify-between`,children:[(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`div`,{className:`text-sm text-primary`,children:`Font Size`}),(0,q.jsx)(`div`,{className:`text-[10px] text-muted`,children:`Terminal text size in pixels (6-24)`})]}),(0,q.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,q.jsx)(`button`,{type:`button`,onClick:()=>ce(Math.max(6,se-1)),className:`flex h-7 w-7 items-center justify-center rounded bg-surface border border-border text-secondary hover:bg-hover`,children:(0,q.jsx)(`span`,{className:`text-sm font-bold`,children:`−`})}),(0,q.jsx)(`span`,{className:`text-sm text-secondary w-6 text-center`,children:se}),(0,q.jsx)(`button`,{type:`button`,onClick:()=>ce(Math.min(24,se+1)),className:`flex h-7 w-7 items-center justify-center rounded bg-surface border border-border text-secondary hover:bg-hover`,children:(0,q.jsx)(`span`,{className:`text-sm font-bold`,children:`+`})})]})]}),(0,q.jsxs)(`div`,{className:`mt-4 flex items-center justify-between`,children:[(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`div`,{className:`text-sm text-primary`,children:`Line Height`}),(0,q.jsx)(`div`,{className:`text-[10px] text-muted`,children:`Vertical spacing (1.0 = compact, 2.0 = spacious)`})]}),(0,q.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,q.jsx)(`input`,{type:`range`,min:`1.0`,max:`2.0`,step:`0.1`,value:le,onChange:e=>ue(parseFloat(e.target.value)),className:`w-20 h-1 bg-border rounded-lg appearance-none cursor-pointer accent-accent`}),(0,q.jsx)(`span`,{className:`text-xs text-secondary w-8 text-right`,children:le.toFixed(1)})]})]}),(0,q.jsxs)(`div`,{className:`mt-4 flex items-center justify-between`,children:[(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`div`,{className:`text-sm text-primary`,children:`Letter Spacing`}),(0,q.jsx)(`div`,{className:`text-[10px] text-muted`,children:`Horizontal spacing between characters in pixels`})]}),(0,q.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,q.jsx)(`input`,{type:`range`,min:`-3`,max:`3`,step:`1`,value:de,onChange:e=>fe(parseInt(e.target.value,10)),className:`w-20 h-1 bg-border rounded-lg appearance-none cursor-pointer accent-accent`}),(0,q.jsxs)(`span`,{className:`text-xs text-secondary w-8 text-right`,children:[de,`px`]})]})]}),(0,q.jsxs)(`div`,{className:`mt-4`,children:[(0,q.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`div`,{className:`text-sm text-primary`,children:`Font Family`}),(0,q.jsx)(`div`,{className:`text-[10px] text-muted`,children:`Terminal typeface`})]}),(0,q.jsx)(`select`,{value:pe,onChange:e=>me(e.target.value),className:`input text-xs py-1 px-2 w-auto`,children:L.map(e=>(0,q.jsx)(`option`,{value:e.id,children:e.label},e.id))})]}),pe===`custom`&&(0,q.jsx)(`input`,{value:he,onChange:e=>ge(e.target.value),placeholder:`"Fira Code", monospace`,className:`input text-xs mt-2 font-mono`})]}),(0,q.jsxs)(`div`,{className:`mt-4 flex items-center justify-between`,children:[(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`div`,{className:`text-sm text-primary`,children:`Dark Mode`}),(0,q.jsx)(`div`,{className:`text-[10px] text-muted`,children:`Switch between dark and light themes.`})]}),(0,q.jsx)(Rj,{checked:Te===`dark`,onCheckedChange:e=>Ee(e?`dark`:`light`)})]})]}),(0,q.jsxs)(`div`,{className:`border-t border-border pt-4`,children:[(0,q.jsx)(`label`,{className:`mb-2 block text-xs text-secondary`,children:`Keyboard Shortcut Modifier`}),(0,q.jsx)(`div`,{className:`grid grid-cols-5 gap-1`,children:[`auto`,`ctrl-option`,`ctrl-shift`,`cmd-option`,`cmd-shift`].map(e=>(0,q.jsx)(`button`,{type:`button`,className:`btn text-xs px-2 ${_e===e?`btn-primary`:``}`,onClick:()=>ve(e),children:e===`auto`?`Auto`:Ke(e)},e))}),(0,q.jsx)(`p`,{className:`mt-1.5 text-[10px] text-muted`,children:_e===`auto`?`Platform default: ${Ke(We(`auto`))}`:`Shortcuts: ${Ke(_e)}+[N/X/[/]]`})]})]})}),(0,q.jsxs)(`div`,{className:`flex justify-end gap-2 p-6 pt-4 border-t border-border bg-elevated`,children:[(0,q.jsx)(`button`,{type:`button`,onClick:()=>t(),className:`btn`,children:`Cancel`}),(0,q.jsx)(`button`,{type:`submit`,className:`btn btn-primary`,children:`Save`})]})]})})}var $j=[];function eM(e){x.useEffect(e,$j)}var tM=x.createContext(void 0);function nM(){let e=x.useContext(tM);if(!e)throw Error(sk(73));return e}var rM=Symbol(`NOT_FOUND`);function iM(e,t=`expected a function, instead received ${typeof e}`){if(typeof e!=`function`)throw TypeError(t)}function aM(e,t=`expected an object, instead received ${typeof e}`){if(typeof e!=`object`)throw TypeError(t)}function oM(e,t=`expected all items to be functions, instead received the following types: `){if(!e.every(e=>typeof e==`function`)){let n=e.map(e=>typeof e==`function`?`function ${e.name||`unnamed`}()`:typeof e).join(`, `);throw TypeError(`${t}[${n}]`)}}var sM=e=>Array.isArray(e)?e:[e];function cM(e){let t=Array.isArray(e[0])?e[0]:e;return oM(t,`createSelector expects all input-selectors to be functions, but received the following types: `),t}function lM(e,t){let n=[],{length:r}=e;for(let i=0;i<r;i++)n.push(e[i].apply(null,t));return n}function uM(e){let t;return{get(n){return t&&e(t.key,n)?t.value:rM},put(e,n){t={key:e,value:n}},getEntries(){return t?[t]:[]},clear(){t=void 0}}}function dM(e,t){let n=[];function r(e){let r=n.findIndex(n=>t(e,n.key));if(r>-1){let e=n[r];return r>0&&(n.splice(r,1),n.unshift(e)),e.value}return rM}function i(t,i){r(t)===rM&&(n.unshift({key:t,value:i}),n.length>e&&n.pop())}function a(){return n}function o(){n=[]}return{get:r,put:i,getEntries:a,clear:o}}var fM=(e,t)=>e===t;function pM(e){return function(t,n){if(t===null||n===null||t.length!==n.length)return!1;let{length:r}=t;for(let i=0;i<r;i++)if(!e(t[i],n[i]))return!1;return!0}}function mM(e,t){let{equalityCheck:n=fM,maxSize:r=1,resultEqualityCheck:i}=typeof t==`object`?t:{equalityCheck:t},a=pM(n),o=0,s=r<=1?uM(a):dM(r,a);function c(){let t=s.get(arguments);if(t===rM){if(t=e.apply(null,arguments),o++,i){let e=s.getEntries().find(e=>i(e.value,t));e&&(t=e.value,o!==0&&o--)}s.put(arguments,t)}return t}return c.clearCache=()=>{s.clear(),c.resetResultsCount()},c.resultsCount=()=>o,c.resetResultsCount=()=>{o=0},c}var hM=class{constructor(e){this.value=e}deref(){return this.value}},gM=typeof WeakRef<`u`?WeakRef:hM,_M=0,vM=1;function yM(){return{s:_M,v:void 0,o:null,p:null}}function bM(e,t={}){let n=yM(),{resultEqualityCheck:r}=t,i,a=0;function o(){let t=n,{length:o}=arguments;for(let e=0,n=o;e<n;e++){let n=arguments[e];if(typeof n==`function`||typeof n==`object`&&n){let e=t.o;e===null&&(t.o=e=new WeakMap);let r=e.get(n);r===void 0?(t=yM(),e.set(n,t)):t=r}else{let e=t.p;e===null&&(t.p=e=new Map);let r=e.get(n);r===void 0?(t=yM(),e.set(n,t)):t=r}}let s=t,c;if(t.s===vM)c=t.v;else if(c=e.apply(null,arguments),a++,r){let e=i?.deref?.()??i;e!=null&&r(e,c)&&(c=e,a!==0&&a--),i=typeof c==`object`&&c||typeof c==`function`?new gM(c):c}return s.s=vM,s.v=c,c}return o.clearCache=()=>{n=yM(),o.resetResultsCount()},o.resultsCount=()=>a,o.resetResultsCount=()=>{a=0},o}function xM(e,...t){let n=typeof e==`function`?{memoize:e,memoizeOptions:t}:e,r=(...e)=>{let t=0,r=0,i,a={},o=e.pop();typeof o==`object`&&(a=o,o=e.pop()),iM(o,`createSelector expects an output function after the inputs, but received: [${typeof o}]`);let{memoize:s,memoizeOptions:c=[],argsMemoize:l=bM,argsMemoizeOptions:u=[],devModeChecks:d={}}={...n,...a},f=sM(c),p=sM(u),m=cM(e),h=s(function(){return t++,o.apply(null,arguments)},...f),g=l(function(){r++;let e=lM(m,arguments);return i=h.apply(null,e),i},...p);return Object.assign(g,{resultFunc:o,memoizedResultFunc:h,dependencies:m,dependencyRecomputations:()=>r,resetDependencyRecomputations:()=>{r=0},lastResult:()=>i,recomputations:()=>t,resetRecomputations:()=>{t=0},memoize:s,argsMemoize:l})};return Object.assign(r,{withTypes:()=>r}),r}var SM=xM(bM),CM=Object.assign((e,t=SM)=>{aM(e,`createStructuredSelector expects first argument to be an object where each property is a selector, instead received a ${typeof e}`);let n=Object.keys(e);return t(n.map(t=>e[t]),(...e)=>e.reduce((e,t,r)=>(e[n[r]]=t,e),{}))},{withTypes:()=>CM}),wM=xM({memoize:mM,memoizeOptions:{maxSize:1,equalityCheck:Object.is}}),TM=(e,t,n,r,i,a,...o)=>{if(o.length>0)throw Error(sk(1));let s;if(e&&t&&n&&r&&i&&a)s=(o,s,c,l)=>a(e(o,s,c,l),t(o,s,c,l),n(o,s,c,l),r(o,s,c,l),i(o,s,c,l),s,c,l);else if(e&&t&&n&&r&&i)s=(a,o,s,c)=>i(e(a,o,s,c),t(a,o,s,c),n(a,o,s,c),r(a,o,s,c),o,s,c);else if(e&&t&&n&&r)s=(i,a,o,s)=>r(e(i,a,o,s),t(i,a,o,s),n(i,a,o,s),a,o,s);else if(e&&t&&n)s=(r,i,a,o)=>n(e(r,i,a,o),t(r,i,a,o),i,a,o);else if(e&&t)s=(n,r,i,a)=>t(e(n,r,i,a),r,i,a);else if(e)s=e;else throw Error(`Missing arguments`);return s},EM=(...e)=>{let t=new WeakMap,n=1,r=e[e.length-1],i=e.length-1||1,a=r.length-i;if(a>3)throw Error(sk(2));return(i,o,s,c)=>{let l=i.__cacheKey__;l||(l={id:n},i.__cacheKey__=l,n+=1);let u=t.get(l);if(!u){let n=e,i=[void 0,void 0,void 0];switch(a){case 0:break;case 1:n=[...e.slice(0,-1),()=>i[0],r];break;case 2:n=[...e.slice(0,-1),()=>i[0],()=>i[1],r];break;case 3:n=[...e.slice(0,-1),()=>i[0],()=>i[1],()=>i[2],r];break;default:throw Error(sk(2))}u=wM(...n),u.selectorArgs=i,t.set(l,u)}switch(u.selectorArgs[0]=o,u.selectorArgs[1]=s,u.selectorArgs[2]=c,a){case 0:return u(i);case 1:return u(i,o);case 2:return u(i,o,s);case 3:return u(i,o,s,c);default:throw Error(`unreachable`)}}},DM=s((e=>{var t=p();function n(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var r=typeof Object.is==`function`?Object.is:n,i=t.useState,a=t.useEffect,o=t.useLayoutEffect,s=t.useDebugValue;function c(e,t){var n=t(),r=i({inst:{value:n,getSnapshot:t}}),c=r[0].inst,u=r[1];return o(function(){c.value=n,c.getSnapshot=t,l(c)&&u({inst:c})},[e,n,t]),a(function(){return l(c)&&u({inst:c}),e(function(){l(c)&&u({inst:c})})},[e]),s(n),n}function l(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!r(e,n)}catch{return!0}}function u(e,t){return t()}var d=typeof window>`u`||window.document===void 0||window.document.createElement===void 0?u:c;e.useSyncExternalStore=t.useSyncExternalStore===void 0?d:t.useSyncExternalStore})),OM=s(((e,t)=>{t.exports=DM()})),kM=s((e=>{var t=p(),n=OM();function r(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var i=typeof Object.is==`function`?Object.is:r,a=n.useSyncExternalStore,o=t.useRef,s=t.useEffect,c=t.useMemo,l=t.useDebugValue;e.useSyncExternalStoreWithSelector=function(e,t,n,r,u){var d=o(null);if(d.current===null){var f={hasValue:!1,value:null};d.current=f}else f=d.current;d=c(function(){function e(e){if(!a){if(a=!0,o=e,e=r(e),u!==void 0&&f.hasValue){var t=f.value;if(u(t,e))return s=t}return s=e}if(t=s,i(o,e))return t;var n=r(e);return u!==void 0&&u(t,n)?(o=e,t):(o=e,s=n)}var a=!1,o,s,c=n===void 0?null:n;return[function(){return e(t())},c===null?void 0:function(){return e(c())}]},[t,n,r,u]);var p=a(e,d[0],d[1]);return s(function(){f.hasValue=!0,f.value=p},[p]),l(p),p}})),AM=s(((e,t)=>{t.exports=kM()})),jM=[],MM=void 0;function NM(){return MM}function PM(e){jM.push(e)}var FM=OM(),IM=AM(),LM=lk(19)?BM:VM;function RM(e,t,n,r,i){return LM(e,t,n,r,i)}function zM(e,t,n,r,i){let a=x.useCallback(()=>t(e.getSnapshot(),n,r,i),[e,t,n,r,i]);return(0,FM.useSyncExternalStore)(e.subscribe,a,a)}PM({before(e){e.syncIndex=0,e.didInitialize||(e.syncTick=1,e.syncHooks=[],e.didChangeStore=!0,e.getSnapshot=()=>{let t=!1;for(let n=0;n<e.syncHooks.length;n+=1){let r=e.syncHooks[n],i=r.selector(r.store.state,r.a1,r.a2,r.a3);(r.didChange||!Object.is(r.value,i))&&(t=!0,r.value=i,r.didChange=!1)}return t&&(e.syncTick+=1),e.syncTick})},after(e){e.syncHooks.length>0&&(e.didChangeStore&&(e.didChangeStore=!1,e.subscribe=t=>{let n=new Set;for(let t of e.syncHooks)n.add(t.store);let r=[];for(let e of n)r.push(e.subscribe(t));return()=>{for(let e of r)e()}}),(0,FM.useSyncExternalStore)(e.subscribe,e.getSnapshot,e.getSnapshot))}});function BM(e,t,n,r,i){let a=NM();if(!a)return zM(e,t,n,r,i);let o=a.syncIndex;a.syncIndex+=1;let s;return a.didInitialize?(s=a.syncHooks[o],(s.store!==e||s.selector!==t||!Object.is(s.a1,n)||!Object.is(s.a2,r)||!Object.is(s.a3,i))&&(s.store!==e&&(a.didChangeStore=!0),s.store=e,s.selector=t,s.a1=n,s.a2=r,s.a3=i,s.didChange=!0)):(s={store:e,selector:t,a1:n,a2:r,a3:i,value:t(e.getSnapshot(),n,r,i),didChange:!1},a.syncHooks.push(s)),s.value}function VM(e,t,n,r,i){return(0,IM.useSyncExternalStoreWithSelector)(e.subscribe,e.getSnapshot,e.getSnapshot,e=>t(e,n,r,i))}var HM=class{constructor(e){this.state=e,this.listeners=new Set,this.updateTick=0}subscribe=e=>(this.listeners.add(e),()=>{this.listeners.delete(e)});getSnapshot=()=>this.state;setState(e){if(this.state===e)return;this.state=e,this.updateTick+=1;let t=this.updateTick;for(let n of this.listeners){if(t!==this.updateTick)return;n(e)}}update(e){for(let t in e)if(!Object.is(this.state[t],e[t])){this.setState({...this.state,...e});return}}set(e,t){Object.is(this.state[e],t)||this.setState({...this.state,[e]:t})}notifyAll(){let e={...this.state};this.setState(e)}use(e,t,n,r){return RM(this,e,t,n,r)}},UM=class extends HM{constructor(e,t={},n){super(e),this.context=t,this.selectors=n}useSyncedValue(e,t){x.useDebugValue(e),tk(()=>{this.state[e]!==t&&this.set(e,t)},[e,t])}useSyncedValueWithCleanup(e,t){let n=this;tk(()=>(n.state[e]!==t&&n.set(e,t),()=>{n.set(e,void 0)}),[n,e,t])}useSyncedValues(e){let t=this;tk(()=>{t.update(e)},[t,...Object.values(e)])}useControlledProp(e,t){x.useDebugValue(e);let n=t!==void 0;tk(()=>{n&&!Object.is(this.state[e],t)&&super.setState({...this.state,[e]:t})},[e,t,n])}select(e,t,n,r){let i=this.selectors[e];return i(this.state,t,n,r)}useState(e,t,n,r){return x.useDebugValue(e),RM(this,this.selectors[e],t,n,r)}useContextCallback(e,t){x.useDebugValue(e);let n=KO(t??ak);this.context[e]=n}useStateSetter(e){let t=x.useRef(void 0);return t.current===void 0&&(t.current=t=>{this.set(e,t)}),t.current}observe(e,t){let n;n=typeof e==`function`?e:this.selectors[e];let r=n(this.state);return t(r,r,this),this.subscribe(e=>{let i=n(e);if(!Object.is(r,i)){let e=r;r=i,t(i,e,this)}})}},WM=null;globalThis.requestAnimationFrame;var GM=new class{callbacks=[];callbacksCount=0;nextId=1;startId=1;isScheduled=!1;tick=e=>{this.isScheduled=!1;let t=this.callbacks,n=this.callbacksCount;if(this.callbacks=[],this.callbacksCount=0,this.startId=this.nextId,n>0)for(let n=0;n<t.length;n+=1)t[n]?.(e)};request(e){let t=this.nextId;return this.nextId+=1,this.callbacks.push(e),this.callbacksCount+=1,this.isScheduled||=(requestAnimationFrame(this.tick),!0),t}cancel(e){let t=e-this.startId;t<0||t>=this.callbacks.length||(this.callbacks[t]=null,--this.callbacksCount)}},KM=class e{static create(){return new e}static request(e){return GM.request(e)}static cancel(e){return GM.cancel(e)}currentId=WM;request(e){this.cancel(),this.currentId=GM.request(()=>{this.currentId=WM,e()})}cancel=()=>{this.currentId!==WM&&(GM.cancel(this.currentId),this.currentId=WM)};disposeEffect=()=>this.cancel};function qM(){let e=UO(KM.create).current;return eM(e.disposeEffect),e}var JM=0,YM=class e{static create(){return new e}currentId=JM;start(e,t){this.clear(),this.currentId=setTimeout(()=>{this.currentId=JM,t()},e)}isStarted(){return this.currentId!==JM}clear=()=>{this.currentId!==JM&&(clearTimeout(this.currentId),this.currentId=JM)};disposeEffect=()=>this.clear};function XM(){let e=UO(YM.create).current;return eM(e.disposeEffect),e}var ZM=0;function QM(e){return ZM+=1,`${e}-${Math.random().toString(36).slice(2,6)}-${ZM}`}function $M(e){return e?.ownerDocument||document}function eN(e,t){if(typeof e==`string`)return{description:e};if(typeof e==`function`){let n=e(t);return typeof n==`string`?{description:n}:n}return e}var tN=typeof navigator<`u`,nN=sN(),rN=lN(),iN=cN();typeof CSS>`u`||!CSS.supports||CSS.supports(`-webkit-backdrop-filter:none`),nN.platform===`MacIntel`&&nN.maxTouchPoints>1||/iP(hone|ad|od)|iOS/.test(nN.platform),tN&&/firefox/i.test(iN);var aN=tN&&/apple/i.test(navigator.vendor);tN&&/Edg/i.test(iN),tN&&/android/i.test(rN)||/android/i.test(iN),tN&&rN.toLowerCase().startsWith(`mac`)&&navigator.maxTouchPoints;var oN=iN.includes(`jsdom/`);function sN(){if(!tN)return{platform:``,maxTouchPoints:-1};let e=navigator.userAgentData;return e?.platform?{platform:e.platform,maxTouchPoints:navigator.maxTouchPoints}:{platform:navigator.platform??``,maxTouchPoints:navigator.maxTouchPoints??-1}}function cN(){if(!tN)return``;let e=navigator.userAgentData;return e&&Array.isArray(e.brands)?e.brands.map(({brand:e,version:t})=>`${e}/${t}`).join(` `):navigator.userAgent}function lN(){if(!tN)return``;let e=navigator.userAgentData;return e?.platform?e.platform:navigator.platform??``}function uN(e){let t=e.activeElement;for(;t?.shadowRoot?.activeElement!=null;)t=t.shadowRoot.activeElement;return t}function dN(e,t){if(!e||!t)return!1;let n=t.getRootNode?.();if(e.contains(t))return!0;if(n&&Hk(n)){let n=t;for(;n;){if(e===n)return!0;n=n.parentNode||n.host}}return!1}function fN(e){return`composedPath`in e?e.composedPath()[0]:e.target}function pN(e){if(!e||oN)return!0;try{return e.matches(`:focus-visible`)}catch{return!0}}var mN=EM(e=>e.toasts,e=>{let t=new Map,n=0,r=0;return e.forEach((e,i)=>{let a=e.transitionStatus===`ending`;t.set(e.id,{value:e,domIndex:i,visibleIndex:a?-1:n,offsetY:r}),r+=e.height||0,a||(n+=1)}),t}),hN={toasts:TM(e=>e.toasts),isEmpty:TM(e=>e.toasts.length===0),toast:TM(mN,(e,t)=>e.get(t)?.value),toastIndex:TM(mN,(e,t)=>e.get(t)?.domIndex??-1),toastOffsetY:TM(mN,(e,t)=>e.get(t)?.offsetY??0),toastVisibleIndex:TM(mN,(e,t)=>e.get(t)?.visibleIndex??-1),hovering:TM(e=>e.hovering),focused:TM(e=>e.focused),expanded:TM(e=>e.hovering||e.focused),expandedOrOutOfFocus:TM(e=>e.hovering||e.focused||!e.isWindowFocused),prevFocusElement:TM(e=>e.prevFocusElement)},gN=class extends UM{timers=new Map;areTimersPaused=!1;constructor(e){super(e,{},hN)}setFocused(e){this.set(`focused`,e)}setHovering(e){this.set(`hovering`,e)}setIsWindowFocused(e){this.set(`isWindowFocused`,e)}setPrevFocusElement(e){this.set(`prevFocusElement`,e)}setViewport=e=>{this.set(`viewport`,e)};disposeEffect=()=>()=>{this.timers.forEach(e=>{e.timeout?.clear()}),this.timers.clear()};removeToast(e){let t=hN.toastIndex(this.state,e);if(t===-1)return;this.state.toasts[t]?.onRemove?.();let n=[...this.state.toasts];n.splice(t,1),this.setToasts(n)}addToast=e=>{let{toasts:t,timeout:n,limit:r}=this.state,i=e.id||QM(`toast`),a={...e,id:i,transitionStatus:`starting`},o=[a,...t],s=o.filter(e=>e.transitionStatus!==`ending`);if(s.length>r){let e=s.length-r,t=s.slice(-e),n=new Set(t.map(e=>e.id));this.setToasts(o.map(e=>{let t=n.has(e.id);return e.limited===t?e:{...e,limited:t}}))}else this.setToasts(o.map(e=>e.limited?{...e,limited:!1}:e));let c=a.timeout??n;return a.type!==`loading`&&c>0&&this.scheduleTimer(i,c,()=>this.closeToast(i)),hN.expandedOrOutOfFocus(this.state)&&this.pauseTimers(),i};updateToast=(e,t)=>{this.updateToastInternal(e,t)};updateToastInternal=(e,t)=>{let{timeout:n,toasts:r}=this.state,i=hN.toast(this.state,e)??null;if(!i||i.transitionStatus===`ending`)return;let a={...i,...t};this.setToasts(r.map(n=>n.id===e?{...n,...t}:n));let o=a.timeout??n,s=i?.timeout??n,c=Object.hasOwn(t,`timeout`),l=a.transitionStatus!==`ending`&&a.type!==`loading`&&o>0,u=this.timers.has(e),d=s!==o,f=i?.type===`loading`;if(!l&&u){this.timers.get(e)?.timeout?.clear(),this.timers.delete(e);return}if(l&&(!u||d||c||f)){let t=this.timers.get(e);t&&(t.timeout?.clear(),this.timers.delete(e)),this.scheduleTimer(e,o,()=>this.closeToast(e)),hN.expandedOrOutOfFocus(this.state)&&this.pauseTimers()}};closeToast=e=>{hN.toast(this.state,e)?.onClose?.();let{limit:t,toasts:n}=this.state,r=0,i=n.map(n=>{if(n.id===e)return{...n,transitionStatus:`ending`,height:0};if(n.transitionStatus===`ending`)return n;let i=r>=t;return r+=1,n.limited===i?n:{...n,limited:i}}),a=this.timers.get(e);a&&a.timeout&&(a.timeout.clear(),this.timers.delete(e)),this.handleFocusManagement(e),this.setToasts(i)};promiseToast=(e,t)=>{let n=eN(t.loading),r=this.addToast({...n,type:`loading`}),i=e.then(e=>{let n=eN(t.success,e);return this.updateToast(r,{...n,type:`success`,timeout:n.timeout}),e}).catch(e=>{let n=eN(t.error,e);return this.updateToast(r,{...n,type:`error`,timeout:n.timeout}),Promise.reject(e)});return{}.hasOwnProperty.call(t,`setPromise`)&&t.setPromise(i),i};pauseTimers(){this.areTimersPaused||(this.areTimersPaused=!0,this.timers.forEach(e=>{if(e.timeout){e.timeout.clear();let t=Date.now()-e.start,n=e.delay-t;e.remaining=n>0?n:0}}))}resumeTimers(){this.areTimersPaused&&(this.areTimersPaused=!1,this.timers.forEach((e,t)=>{e.remaining=e.remaining>0?e.remaining:e.delay,e.timeout??=YM.create(),e.timeout.start(e.remaining,()=>{this.timers.delete(t),e.callback()}),e.start=Date.now()}))}restoreFocusToPrevElement(){this.state.prevFocusElement?.focus({preventScroll:!0})}handleDocumentPointerDown=e=>{if(e.pointerType!==`touch`)return;let t=fN(e);dN(this.state.viewport,t)||(this.resumeTimers(),this.update({hovering:!1,focused:!1}))};scheduleTimer(e,t,n){let r=Date.now(),i=!hN.expandedOrOutOfFocus(this.state),a=i?YM.create():void 0;a?.start(t,()=>{this.timers.delete(e),n()}),this.timers.set(e,{timeout:a,start:i?r:0,delay:t,remaining:t,callback:n})}setToasts(e){let t={toasts:e};e.length===0&&(t.hovering=!1,t.focused=!1),this.update(t)}handleFocusManagement(e){let t=uN($M(this.state.viewport));if(!this.state.viewport||!dN(this.state.viewport,t)||!pN(t))return;let n=hN.toasts(this.state),r=hN.toastIndex(this.state,e),i=null,a=r+1;for(;a<n.length;){if(n[a].transitionStatus!==`ending`){i=n[a];break}a+=1}if(!i)for(a=r-1;a>=0;){if(n[a].transitionStatus!==`ending`){i=n[a];break}--a}i?i.ref?.current?.focus():this.restoreFocusToPrevElement()}},_N=function(e){let{children:t,timeout:n=5e3,limit:r=3,toastManager:i}=e,a=UO(()=>new gN({timeout:n,limit:r,viewport:null,toasts:[],hovering:!1,focused:!1,isWindowFocused:!0,prevFocusElement:null})).current;return eM(a.disposeEffect),x.useEffect(function(){if(i)return i[` subscribe`](({action:e,options:t})=>{let n=t.id;e===`promise`&&t.promise?a.promiseToast(t.promise,t):e===`update`&&n?a.updateToast(n,t):e===`close`&&n?a.closeToast(n):a.addToast(t)})},[a,n,i]),a.useSyncedValues({timeout:n,limit:r}),(0,q.jsx)(tM.Provider,{value:a,children:t})},vN=x.forwardRef(function(e,t){let[n,r]=x.useState();tk(()=>{aN&&r(`button`)},[]);let i={tabIndex:0,role:n};return(0,q.jsx)(`span`,{...e,ref:t,style:rk,"aria-hidden":n?void 0:!0,...i,"data-base-ui-focus-guard":``})}),yN=function(e){return e.frontmostHeight=`--toast-frontmost-height`,e}({}),bN=x.forwardRef(function(e,t){let{render:n,className:r,children:i,...a}=e,o=nM(),s=XM(),c=x.useRef(!1),l=x.useRef(!1),u=o.useState(`isEmpty`),d=o.useState(`toasts`),f=o.useState(`focused`),p=o.useState(`expanded`),m=o.useState(`prevFocusElement`),h=d[0]?.height??0,g=x.useMemo(()=>d.some(e=>e.transitionStatus===`ending`),[d]);x.useEffect(()=>{let e=o.state.viewport;if(!e)return;function t(t){u||t.key===`F6`&&t.target!==e&&(t.preventDefault(),o.setPrevFocusElement(uN($M(e))),e?.focus({preventScroll:!0}),o.pauseTimers(),o.setFocused(!0))}let n=zk(e);return n.addEventListener(`keydown`,t),()=>{n.removeEventListener(`keydown`,t)}},[o,u]),x.useEffect(()=>{let e=o.state.viewport;if(!e||u)return;let t=zk(e);function n(e){e.target===t&&(o.setIsWindowFocused(!1),o.pauseTimers())}function r(n){if(n.relatedTarget||n.target===t)return;let r=fN(n),i=uN($M(e));(!dN(e,r)||!pN(i))&&o.resumeTimers(),s.start(0,()=>o.setIsWindowFocused(!0))}return t.addEventListener(`blur`,n,!0),t.addEventListener(`focus`,r,!0),()=>{t.removeEventListener(`blur`,n,!0),t.removeEventListener(`focus`,r,!0)}},[o,s,u]),x.useEffect(()=>{let e=o.state.viewport;if(!e||u)return;let t=$M(e);return t.addEventListener(`pointerdown`,o.handleDocumentPointerDown,!0),()=>{t.removeEventListener(`pointerdown`,o.handleDocumentPointerDown,!0)}},[u,o]);function _(e){let t=o.state.viewport;t&&(c.current=!0,e.relatedTarget===t?d[0]?.ref?.current?.focus():o.restoreFocusToPrevElement())}function v(e){e.key===`Tab`&&e.shiftKey&&e.target===o.state.viewport&&(e.preventDefault(),o.restoreFocusToPrevElement(),o.resumeTimers())}x.useEffect(()=>{!o.state.isWindowFocused||g||!l.current||(o.resumeTimers(),o.setHovering(!1),l.current=!1)},[g,o]);function y(){o.pauseTimers(),o.setHovering(!0),l.current=!1}function b(){g?l.current=!0:(o.resumeTimers(),o.setHovering(!1))}function S(){if(c.current){c.current=!1;return}f||pN($M(o.state.viewport).activeElement)&&(o.setFocused(!0),o.pauseTimers())}function C(e){!f||dN(o.state.viewport,e.relatedTarget)||(o.setFocused(!1),o.resumeTimers())}let w={tabIndex:-1,role:`region`,"aria-live":`polite`,"aria-atomic":!1,"aria-relevant":`additions text`,"aria-label":`Notifications`,onMouseEnter:y,onMouseMove:y,onMouseLeave:b,onFocus:S,onBlur:C,onKeyDown:v,onClick:S},T={expanded:p},E=Dk(`div`,e,{ref:[t,o.setViewport],state:T,props:[w,{style:{[yN.frontmostHeight]:h?`${h}px`:void 0}},a,{children:(0,q.jsxs)(x.Fragment,{children:[!u&&m&&(0,q.jsx)(vN,{onFocus:_}),i,!u&&m&&(0,q.jsx)(vN,{onFocus:_})]})}]}),D=x.useMemo(()=>d.filter(e=>e.priority===`high`),[d]);return(0,q.jsxs)(x.Fragment,{children:[!u&&m&&(0,q.jsx)(vN,{onFocus:_}),E,!f&&D.length>0&&(0,q.jsx)(`div`,{style:rk,children:D.map(e=>(0,q.jsxs)(`div`,{role:`alert`,"aria-atomic":!0,children:[(0,q.jsx)(`div`,{children:e.title}),(0,q.jsx)(`div`,{children:e.description})]},e.id))})]})});function xN(e){return lk(19)?e:e?`true`:void 0}var SN=x.createContext(void 0);function CN(){let e=x.useContext(SN);if(!e)throw Error(sk(66));return e}var wN=function(e){return e.startingStyle=`data-starting-style`,e.endingStyle=`data-ending-style`,e}({}),TN={[wN.startingStyle]:``},EN={[wN.endingStyle]:``},DN={transitionStatus(e){return e===`starting`?TN:e===`ending`?EN:null}};function ON(e){return e==null?e:`current`in e?e.current:e}function kN(e,t=!1,n=!0){let r=qM();return KO((i,a=null)=>{r.cancel();function o(){K.flushSync(i)}let s=ON(e);if(s==null)return;let c=s;if(typeof c.getAnimations!=`function`||globalThis.BASE_UI_ANIMATIONS_DISABLED)i();else{function e(){let e=wN.startingStyle;if(!c.hasAttribute(e)){r.request(i);return}let t=new MutationObserver(()=>{c.hasAttribute(e)||(t.disconnect(),i())});t.observe(c,{attributes:!0,attributeFilter:[e]}),a?.addEventListener(`abort`,()=>t.disconnect(),{once:!0})}function i(){Promise.all(c.getAnimations().map(e=>e.finished)).then(()=>{a?.aborted||o()}).catch(()=>{let e=c.getAnimations();if(n){if(a?.aborted)return;o()}else e.length>0&&e.some(e=>e.pending||e.playState!==`finished`)&&i()})}if(t){e();return}r.request(i)}})}function AN(e){let{enabled:t=!0,open:n,ref:r,onComplete:i}=e,a=KO(i),o=kN(r,n,!1);x.useEffect(()=>{if(!t)return;let e=new AbortController;return o(a,e.signal),()=>{e.abort()}},[t,n,a,o])}var jN=function(e){return e.index=`--toast-index`,e.offsetY=`--toast-offset-y`,e.height=`--toast-height`,e.swipeMovementX=`--toast-swipe-movement-x`,e.swipeMovementY=`--toast-swipe-movement-y`,e}({}),MN={...DN,swipeDirection(e){return e?{"data-swipe-direction":e}:null}},NN=40,PN=10,FN=.5,IN=1;function LN(e,t,n){switch(e){case`up`:return-n;case`down`:return n;case`left`:return-t;case`right`:return t;default:return 0}}function RN(e){let t=window.getComputedStyle(e).transform,n=0,r=0,i=1;if(t&&t!==`none`){let e=t.match(/matrix(?:3d)?\(([^)]+)\)/);if(e){let t=e[1].split(`, `).map(parseFloat);t.length===6?(n=t[4],r=t[5],i=Math.sqrt(t[0]*t[0]+t[1]*t[1])):t.length===16&&(n=t[12],r=t[13],i=t[0])}}return{x:n,y:r,scale:i}}var zN=x.forwardRef(function(e,t){let{toast:n,render:r,className:i,swipeDirection:a=[`down`,`right`],...o}=e,s=n.positionerProps?.anchor!==void 0,c=[];s||(c=Array.isArray(a)?a:[a]);let l=c.length>0,u=nM(),[d,f]=x.useState(void 0),[p,m]=x.useState(!1),[h,g]=x.useState(!1),[_,v]=x.useState(!1),[y,b]=x.useState({x:0,y:0}),[S,C]=x.useState({x:0,y:0,scale:1}),[w,T]=x.useState(),[E,D]=x.useState(),[O,k]=x.useState(null),A=x.useRef(null),j=x.useRef({x:0,y:0}),M=x.useRef({x:0,y:0,scale:1}),N=x.useRef(void 0),P=x.useRef(0),F=x.useRef(!1),I=x.useRef({x:0,y:0}),L=x.useRef(!1),R=u.useState(`toastIndex`,n.id),z=u.useState(`toastVisibleIndex`,n.id),B=u.useState(`toastOffsetY`,n.id),V=u.useState(`focused`),H=u.useState(`expanded`);AN({open:n.transitionStatus!==`ending`,ref:A,onComplete(){n.transitionStatus===`ending`&&u.removeToast(n.id)}});let U=KO((e=!1)=>{let t=A.current;if(!t)return;let r=t.style.height;t.style.height=`auto`;let i=t.offsetHeight;t.style.height=r;function a(){u.updateToastInternal(n.id,{ref:A,height:i,...n.transitionStatus===`starting`?{transitionStatus:void 0}:{}})}e?K.flushSync(a):a()});tk(U,[U]);function W(e,t){let n=e,r=t;return!c.includes(`left`)&&!c.includes(`right`)?n=e>0?e**FN:-(Math.abs(e)**FN):(!c.includes(`right`)&&e>0&&(n=e**FN),!c.includes(`left`)&&e<0&&(n=-(Math.abs(e)**FN))),!c.includes(`up`)&&!c.includes(`down`)?r=t>0?t**FN:-(Math.abs(t)**FN):(!c.includes(`down`)&&t>0&&(r=t**FN),!c.includes(`up`)&&t<0&&(r=-(Math.abs(t)**FN))),{x:n,y:r}}function G(e){if(e.button!==0)return;e.pointerType===`touch`&&u.pauseTimers();let t=fN(e.nativeEvent);if(!(t&&t.closest(`button,a,input,textarea,[role="button"],[data-swipe-ignore]`))){if(F.current=!1,N.current=void 0,P.current=0,j.current={x:e.clientX,y:e.clientY},I.current=j.current,A.current){let e=RN(A.current);M.current=e,C(e),b({x:e.x,y:e.y})}u.setHovering(!0),m(!0),g(!1),k(null),L.current=!0,A.current?.setPointerCapture(e.pointerId)}}function ee(e){if(!p)return;e.preventDefault(),L.current&&=(j.current={x:e.clientX,y:e.clientY},!1);let{clientY:t,clientX:n,movementX:r,movementY:i}=e;(i<0&&t>I.current.y||i>0&&t<I.current.y)&&(I.current={x:I.current.x,y:t}),(r<0&&n>I.current.x||r>0&&n<I.current.x)&&(I.current={x:n,y:I.current.y});let a=n-j.current.x,o=t-j.current.y,s=t-I.current.y,l=n-I.current.x;if(!h&&Math.sqrt(a*a+o*o)>=IN&&(g(!0),O===null)){let e=c.includes(`left`)||c.includes(`right`),t=c.includes(`up`)||c.includes(`down`);e&&t&&k(Math.abs(a)>Math.abs(o)?`horizontal`:`vertical`)}let u;if(!N.current)O===`vertical`?o>0?u=`down`:o<0&&(u=`up`):O===`horizontal`?a>0?u=`right`:a<0&&(u=`left`):u=Math.abs(a)>=Math.abs(o)?a>0?`right`:`left`:o>0?`down`:`up`,u&&c.includes(u)&&(N.current=u,P.current=LN(u,a,o),f(u));else{let e=N.current,t=LN(e,l,s);t>NN?(F.current=!1,f(e)):!(c.includes(`left`)&&c.includes(`right`))&&!(c.includes(`up`)&&c.includes(`down`))&&P.current-t>=PN&&(F.current=!0)}let d=W(a,o),m=M.current.x,_=M.current.y;O===`horizontal`?(c.includes(`left`)||c.includes(`right`))&&(m+=d.x):(O===`vertical`||(c.includes(`left`)||c.includes(`right`))&&(m+=d.x),(c.includes(`up`)||c.includes(`down`))&&(_+=d.y)),b({x:m,y:_})}function te(e){if(!p)return;if(m(!1),g(!1),k(null),A.current?.releasePointerCapture(e.pointerId),F.current){b({x:S.x,y:S.y}),f(void 0);return}let t=!1,r=y.x-S.x,i=y.y-S.y,a;for(let e of c){switch(e){case`right`:r>NN&&(t=!0,a=`right`);break;case`left`:r<-NN&&(t=!0,a=`left`);break;case`down`:i>NN&&(t=!0,a=`down`);break;case`up`:i<-NN&&(t=!0,a=`up`);break;default:break}if(t)break}t?(f(a),v(!0),u.closeToast(n.id)):(b({x:S.x,y:S.y}),f(void 0))}function ne(e){if(e.key===`Escape`){if(!A.current||!dN(A.current,uN($M(A.current))))return;u.closeToast(n.id)}}x.useEffect(()=>{if(!l)return;let e=A.current;if(!e)return;function t(t){dN(e,t.target)&&t.preventDefault()}return e.addEventListener(`touchmove`,t,{passive:!1}),()=>{e.removeEventListener(`touchmove`,t)}},[l]);function re(){if(!p&&y.x===S.x&&y.y===S.y&&!_)return{[jN.swipeMovementX]:`0px`,[jN.swipeMovementY]:`0px`};let e=y.x-S.x,t=y.y-S.y;return{transition:p?`none`:void 0,transform:p?`translateX(${y.x}px) translateY(${y.y}px) scale(${S.scale})`:void 0,[jN.swipeMovementX]:`${e}px`,[jN.swipeMovementY]:`${t}px`}}let ie=n.priority===`high`,ae={role:ie?`alertdialog`:`dialog`,tabIndex:0,"aria-modal":!1,"aria-labelledby":w,"aria-describedby":E,"aria-hidden":ie&&!V?!0:void 0,onPointerDown:l?G:void 0,onPointerMove:l?ee:void 0,onPointerUp:l?te:void 0,onKeyDown:ne,inert:xN(n.limited),style:{...re(),[jN.index]:n.transitionStatus===`ending`?R:z,[jN.offsetY]:`${B}px`,[jN.height]:n.height?`${n.height}px`:void 0}},oe=x.useMemo(()=>({rootRef:A,toast:n,titleId:w,setTitleId:T,descriptionId:E,setDescriptionId:D,swiping:p,swipeDirection:d,recalculateHeight:U,index:R,visibleIndex:z,expanded:H}),[n,w,E,p,d,U,R,z,H]),se={transitionStatus:n.transitionStatus,expanded:H,limited:n.limited||!1,type:n.type,swiping:oe.swiping,swipeDirection:oe.swipeDirection},ce=Dk(`div`,e,{ref:[t,oe.rootRef],state:se,stateAttributesMapping:MN,props:[ae,o]});return(0,q.jsx)(SN.Provider,{value:oe,children:ce})}),BN=x.forwardRef(function(e,t){let{render:n,className:r,id:i,children:a,...o}=e,{toast:s,setDescriptionId:c}=CN(),l=a??s.description,u=!!l,d=Ik(i);tk(()=>{if(u)return c(d),()=>{c(void 0)}},[u,d,c]);let f=Dk(`p`,e,{ref:t,state:{type:s.type},props:{...o,id:d,children:l}});return u?f:null}),VN=x.forwardRef(function(e,t){let{render:n,className:r,id:i,children:a,...o}=e,{toast:s,setTitleId:c}=CN(),l=a??s.title,u=!!l,d=Ik(i);tk(()=>{if(u)return c(d),()=>{c(void 0)}},[u,d,c]);let f=Dk(`h2`,e,{ref:t,state:{type:s.type},props:{...o,id:d,children:l}});return u?f:null}),HN=x.forwardRef(function(e,t){let{render:n,className:r,disabled:i,nativeButton:a=!0,...o}=e,s=nM(),{toast:c}=CN(),l=s.useState(`expanded`),[u,d]=x.useState(!1),{getButtonProps:f,buttonRef:p}=Kk({disabled:i,native:a}),m={type:c.type};return Dk(`button`,e,{ref:[t,p],state:m,props:[{"aria-hidden":!l&&!u,onClick(){s.closeToast(c.id)},onFocus(){d(!0)},onBlur(){d(!1)}},o,f]})});function UN(){let e=x.useContext(tM);if(!e)throw Error(sk(73));let t=e.useState(`toasts`);return x.useMemo(()=>({toasts:t,add:e.addToast,close:e.closeToast,update:e.updateToast,promise:e.promiseToast}),[t,e])}function WN(){let e=new Set;function t(t){e.forEach(e=>e(t))}return{" subscribe":function(t){return e.add(t),()=>{e.delete(t)}},add(e){let n=e.id||QM(`toast`);return t({action:`add`,options:{...e,id:n,transitionStatus:`starting`}}),n},close(e){t({action:`close`,options:{id:e}})},update(e,n){t({action:`update`,options:{...n,id:e}})},promise(e,n){let r=e;return t({action:`promise`,options:{...n,promise:e,setPromise(e){r=e}}}),r}}}var GN=5e3,KN=WN();function qN({toast:e}){return(0,q.jsxs)(zN,{toast:e,className:Lj(`relative flex w-80 items-start gap-3 border bg-elevated p-4 shadow-lg`,`data-[swipe=move]:translate-x-[var(--toast-swipe-move-x)]`,`data-[ending-style]:translate-x-[var(--toast-swipe-end-x)]`,`data-[ending-style]:opacity-0`,`data-[starting-style]:translate-y-2 data-[starting-style]:opacity-0`,`transition-all duration-200`,e.type===`error`&&`border-error/50`,e.type===`success`&&`border-approval/50`,(!e.type||e.type===`info`)&&`border-border`),children:[(0,q.jsxs)(`div`,{className:`flex-1 min-w-0`,children:[(0,q.jsx)(VN,{className:Lj(`text-sm font-medium`,e.type===`error`&&`text-error`,e.type===`success`&&`text-approval`,(!e.type||e.type===`info`)&&`text-primary`),children:e.title}),e.description&&(0,q.jsx)(BN,{className:`mt-1 text-xs text-muted line-clamp-2`,children:e.description})]}),(0,q.jsx)(HN,{className:`shrink-0 text-muted hover:text-primary transition-colors`,"aria-label":`Close`,children:(0,q.jsxs)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:`16`,height:`16`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,children:[(0,q.jsx)(`line`,{x1:`18`,y1:`6`,x2:`6`,y2:`18`}),(0,q.jsx)(`line`,{x1:`6`,y1:`6`,x2:`18`,y2:`18`})]})})]})}function JN(){let{toasts:e}=UN();return(0,q.jsx)(q.Fragment,{children:e.map(e=>(0,q.jsx)(qN,{toast:e},e.id))})}function YN(){return(0,q.jsxs)(_N,{timeout:GN,toastManager:KN,children:[(0,q.jsx)(JN,{}),(0,q.jsx)(bN,{className:`fixed bottom-4 right-4 z-[100] flex flex-col gap-2`})]})}var XN=[`CONNECTING`,`OPEN`,`CLOSING`,`CLOSED`],ZN=3e3,QN=8e3,$N=15e3,eP=5e3,tP=2e4,nP=1e4,rP=1500,iP=5e3,aP=750,oP=4,sP=5e3,cP=new class{constructor(){this.ws=null,this.listeners=new Set,this.statusListeners=new Set,this.status=`connecting`,this.error=null,this.reconnectAttempts=0,this.reconnectTimer=null,this.connectTimer=null,this.manualClose=!1,this.lastTick=Date.now(),this.wakeCheckInterval=null,this.lifecycleStarted=!1,this.heartbeatTimer=null,this.pongTimer=null,this.lastForceReconnectTs=0,this.lastConnectTs=0,this.pingSeq=0,this.connectionEpoch=0,this.consecutiveFailures=0,this.isResumeAttempt=!1,this.leakedSockets=new Set,this.verifyTimer=null,this.onVisibilityChange=()=>{if(YT(`ws_visibility`,{state:document.visibilityState,...this.wsSnap()},`info`),document.visibilityState===`visible`){let e=Date.now(),t=e-this.lastTick;this.lastTick=e,YT(`ws_resume`,{gapMs:t,...this.wsSnap()},`info`),this.ws?.readyState===WebSocket.OPEN?this.verifyConnection():this.forceReconnect(`visibilitychange`,!0)}else this.stopHeartbeat(),this.cancelVerify(),this.reconnectTimer&&=(window.clearTimeout(this.reconnectTimer),null)},this.onPageShow=e=>{YT(`ws_pageshow`,{persisted:e.persisted,...this.wsSnap()},`info`),e.persisted&&(this.lastTick=Date.now(),this.forceReconnect(`pageshow`,!0))}}wsSnap(){return{status:this.status,ws:this.ws?XN[this.ws.readyState]:null,attempt:this.reconnectAttempts,failures:this.consecutiveFailures,leaked:this.leakedSockets.size,online:typeof navigator<`u`?navigator.onLine:void 0,verifying:this.verifyTimer!==null,buffered:this.ws?this.ws.bufferedAmount:void 0}}connect(){if(this.ws){let e=this.ws.readyState===WebSocket.OPEN;if(e&&this.status===`connected`){YT(`ws_connect_skip`,{reason:`already_open`,...this.wsSnap()});return}let t=Date.now();if(this.ws.readyState===WebSocket.CONNECTING&&t-this.lastConnectTs<200){YT(`ws_connect_skip`,{reason:`already_connecting`,...this.wsSnap()});return}YT(`ws_connect_destroy_zombie`,{reason:e?`open_desynced`:`not_open`,...this.wsSnap()}),this.destroySocket()}this.manualClose=!1,this.clearConnectTimer(),this.setStatus(`connecting`);let e=`${window.location.protocol===`https:`?`wss`:`ws`}://${window.location.host}/ws`;YT(`ws_connect`,{url:e,resume:this.isResumeAttempt,...this.wsSnap()},`info`);let t=new WebSocket(e);this.ws=t,this.lastConnectTs=Date.now(),this.leakedSockets.add(t);let n=this.isResumeAttempt?QN:ZN;this.isResumeAttempt=!1,this.connectTimer=window.setTimeout(()=>{this.ws===t&&(this.connectTimer=null,t.readyState===WebSocket.OPEN&&this.status===`connected`||(YT(`ws_connect_timeout`,{wsState:XN[t.readyState],managerStatus:this.status,timeoutMs:n,...this.wsSnap()},`info`),this.consecutiveFailures+=1,this.destroySocket(),this.scheduleReconnect()))},n),t.onopen=()=>{if(this.ws!==t){YT(`ws_onopen_stale`,this.wsSnap(),`info`);return}YT(`ws_onopen`,this.wsSnap(),`info`),this.clearConnectTimer(),this.reconnectAttempts=0,this.consecutiveFailures=0,this.connectionEpoch+=1,this.leakedSockets.delete(t),this.setStatus(`connected`),this.startHeartbeat()},t.onmessage=e=>{try{let t=e.data,n=performance.now(),r=JSON.parse(t),i=performance.now()-n,a=r;if(a._parseMs=Math.round(i),a._rawLength=t.length,r.type===`pong`){r.seq===this.pingSeq&&(this.clearPongTimer(),this.verifyTimer!==null&&(this.cancelVerify(),YT(`ws_verify_ok`,this.wsSnap(),`info`),this.startHeartbeat(iP)));return}this.listeners.forEach(e=>e(r))}catch{}},t.onerror=()=>{this.ws===t&&(YT(`ws_onerror`,this.wsSnap(),`info`),this.clearConnectTimer())},t.onclose=e=>{if(this.ws!==t){YT(`ws_onclose_stale`,{code:e.code,...this.wsSnap()},`info`);return}YT(`ws_onclose`,{code:e.code,reason:e.reason,clean:e.wasClean,...this.wsSnap()},`info`),this.clearConnectTimer(),this.cancelVerify(),this.consecutiveFailures+=1,this.ws=null,this.manualClose?this.setStatus(`disconnected`):this.scheduleReconnect()}}disconnect(){this.manualClose=!0,this.clearConnectTimer(),this.cancelVerify(),this.reconnectTimer&&=(window.clearTimeout(this.reconnectTimer),null),this.destroySocket(),this.setStatus(`disconnected`)}startLifecycleListeners(){this.lifecycleStarted||typeof document>`u`||typeof window>`u`||(this.lifecycleStarted=!0,document.addEventListener(`visibilitychange`,this.onVisibilityChange),window.addEventListener(`pageshow`,this.onPageShow),this.lastTick=Date.now(),this.wakeCheckInterval=window.setInterval(()=>{let e=Date.now(),t=e-this.lastTick;this.isHidden()||(t>$N&&(YT(`ws_time_jump`,{gapMs:t,...this.wsSnap()},`info`),this.forceReconnect(`time_jump`,!0)),this.lastTick=e)},eP))}stopLifecycleListeners(){this.lifecycleStarted&&(this.lifecycleStarted=!1,document.removeEventListener(`visibilitychange`,this.onVisibilityChange),window.removeEventListener(`pageshow`,this.onPageShow),this.wakeCheckInterval!==null&&(window.clearInterval(this.wakeCheckInterval),this.wakeCheckInterval=null))}send(e){if(this.ws?.readyState!==WebSocket.OPEN)return!1;try{return this.ws.send(JSON.stringify(e)),!0}catch(t){return YT(`ws_send_error`,{messageType:e.type,error:t instanceof Error?t.message:String(t),...this.wsSnap()},`info`),this.destroySocket(),this.scheduleReconnect(),!1}}subscribe(e){return this.listeners.add(e),()=>this.listeners.delete(e)}subscribeStatus(e){return this.statusListeners.add(e),e(this.status,this.error,this.connectionEpoch),()=>this.statusListeners.delete(e)}getStatus(){return this.status}getConnectionEpoch(){return this.connectionEpoch}verifyConnection(){this.cancelVerify(),this.stopHeartbeat(),this.pingSeq+=1;let e=this.pingSeq,t=this.ws;if(YT(`ws_verify`,{seq:e,...this.wsSnap()},`info`),!this.send({type:`ping`,seq:e})){YT(`ws_verify_send_fail`,this.wsSnap(),`info`),this.forceReconnect(`verify_send_fail`,!0);return}this.verifyTimer=window.setTimeout(()=>{this.verifyTimer=null,this.ws===t&&(YT(`ws_verify_timeout`,this.wsSnap(),`info`),this.forceReconnect(`verify_timeout`,!0))},rP)}cancelVerify(){this.verifyTimer!==null&&(window.clearTimeout(this.verifyTimer),this.verifyTimer=null)}forceReconnect(e=`unknown`,t=!1){if(this.manualClose){YT(`ws_force_skip`,{trigger:e,reason:`manual_close`});return}let n=Date.now(),r=t?200:500;if(n-this.lastForceReconnectTs<r){YT(`ws_force_skip`,{trigger:e,reason:`debounce`,force:t});return}if(!t&&this.ws?.readyState===WebSocket.OPEN&&this.status===`connected`){YT(`ws_force_skip`,{trigger:e,reason:`already_connected`});return}this.lastForceReconnectTs=n,YT(`ws_force_reconnect`,{trigger:e,force:t,...this.wsSnap()},`info`),this.reconnectAttempts=0,this.consecutiveFailures=0,this.reconnectTimer&&=(window.clearTimeout(this.reconnectTimer),null),this.destroySocket(),t?(this.purgeLeakedSockets(),this.isResumeAttempt=!0,this.setStatus(`reconnecting`),this.reconnectTimer=window.setTimeout(()=>{this.reconnectTimer=null,this.connect()},aP)):this.connect()}startHeartbeat(e){this.stopHeartbeat();let t=()=>{this.ws?.readyState===WebSocket.OPEN&&(this.pingSeq+=1,this.send({type:`ping`,seq:this.pingSeq})&&(this.clearPongTimer(),this.pongTimer=window.setTimeout(()=>{this.pongTimer=null,YT(`ws_pong_timeout`,this.wsSnap(),`info`),this.destroySocket(),this.scheduleReconnect()},nP)))};e!==void 0&&e<tP?this.heartbeatTimer=window.setTimeout(()=>{t(),this.heartbeatTimer=window.setInterval(t,tP)},e):this.heartbeatTimer=window.setInterval(t,tP)}stopHeartbeat(){this.heartbeatTimer!==null&&(window.clearTimeout(this.heartbeatTimer),this.heartbeatTimer=null),this.clearPongTimer()}clearPongTimer(){this.pongTimer!==null&&(window.clearTimeout(this.pongTimer),this.pongTimer=null)}setStatus(e,t=null){this.status=e,this.error=t,this.statusListeners.forEach(n=>n(e,t,this.connectionEpoch))}scheduleReconnect(){if(this.stopHeartbeat(),this.isHidden()){YT(`ws_schedule_skip`,{reason:`hidden`,...this.wsSnap()}),this.setStatus(`reconnecting`);return}if(this.consecutiveFailures>=oP){YT(`ws_stall_detected`,this.wsSnap(),`info`),this.purgeLeakedSockets(),this.consecutiveFailures=0,this.reconnectAttempts=0,this.isResumeAttempt=!0,this.setStatus(`reconnecting`),this.reconnectTimer=window.setTimeout(()=>{this.reconnectTimer=null,this.connect()},sP);return}this.reconnectAttempts+=1;let e=Math.min(1e3*2**(this.reconnectAttempts-1),3e4);YT(`ws_schedule_reconnect`,{delay:e,...this.wsSnap()}),this.setStatus(`reconnecting`),this.reconnectTimer&&window.clearTimeout(this.reconnectTimer),this.reconnectTimer=window.setTimeout(()=>{this.reconnectTimer=null,this.connect()},e)}isHidden(){return typeof document<`u`&&document.visibilityState===`hidden`}clearConnectTimer(){this.connectTimer&&=(window.clearTimeout(this.connectTimer),null)}destroySocket(){if(this.clearConnectTimer(),this.stopHeartbeat(),this.cancelVerify(),!this.ws)return;let e=this.ws;this.ws=null,this.leakedSockets.add(e),e.onopen=null,e.onmessage=null,e.onerror=null,e.onclose=null;try{e.close()}catch{}}purgeLeakedSockets(){if(this.leakedSockets.size!==0){YT(`ws_purge_leaked`,{count:this.leakedSockets.size},`info`);for(let e of this.leakedSockets)try{e.onopen=null,e.onmessage=null,e.onerror=null,e.onclose=null,e.close()}catch{}this.leakedSockets.clear()}}};function lP(){let e=Wm(e=>e.setConnectionState);return(0,x.useEffect)(()=>{cP.connect(),cP.startLifecycleListeners();let t=cP.subscribeStatus((t,n,r)=>{e(t,n,r)});return()=>{t(),cP.stopLifecycleListeners()}},[e]),{sendMessage:(0,x.useMemo)(()=>e=>{cP.send(e)},[]),subscribe:(0,x.useMemo)(()=>cP.subscribe.bind(cP),[]),getConnectionEpoch:(0,x.useMemo)(()=>()=>cP.getConnectionEpoch(),[])}}var uP=100;function dP({viewport:e,win:t,doc:n}){if(!e)return!1;let r=Math.max(0,e.offsetTop||0),i=Math.max(0,e.offsetLeft||0),a=t.innerHeight-(e.height+r),o=Math.max(0,a),s=Math.max(0,e.height||0),c=Math.max(0,e.width||0);return n.documentElement.style.setProperty(`--keyboard-inset`,`${o}px`),n.documentElement.style.setProperty(`--viewport-offset-top`,`${r}px`),n.documentElement.style.setProperty(`--viewport-offset-left`,`${i}px`),n.documentElement.style.setProperty(`--visual-viewport-height`,`${s}px`),n.documentElement.style.setProperty(`--visual-viewport-width`,`${c}px`),o>uP?n.documentElement.classList.add(`keyboard-visible`):n.documentElement.classList.remove(`keyboard-visible`),!0}function fP(e){e.documentElement.style.removeProperty(`--keyboard-inset`),e.documentElement.style.removeProperty(`--viewport-offset-top`),e.documentElement.style.removeProperty(`--viewport-offset-left`),e.documentElement.style.removeProperty(`--visual-viewport-height`),e.documentElement.style.removeProperty(`--visual-viewport-width`),e.documentElement.classList.remove(`keyboard-visible`)}function pP(){(0,x.useEffect)(()=>{let e=window.visualViewport;if(!e)return;let t=null,n=null,r=()=>{let e=document.activeElement;if(!e)return!1;let t=e.tagName?.toLowerCase();return t===`input`||t===`textarea`?!0:!!e.isContentEditable},i=()=>{dP({viewport:e,win:window,doc:document})},a=()=>{if(typeof window.requestAnimationFrame!=`function`){i();return}t!==null&&window.cancelAnimationFrame(t);let e=performance.now(),n=()=>{i(),t=performance.now()-e<1500?window.requestAnimationFrame(n):null};t=window.requestAnimationFrame(n)},o=()=>{if(!r()){c();return}i()},s=()=>{n!==null||typeof window.setInterval!=`function`||(n=window.setInterval(o,250),o())},c=()=>{n===null||typeof window.clearInterval!=`function`||(window.clearInterval(n),n=null)},l=()=>{r()?(a(),s(),i()):c()},u=()=>{l()},d=()=>{l()},f=()=>{a()};return i(),l(),e.addEventListener(`resize`,i),e.addEventListener(`scroll`,i),typeof window.addEventListener==`function`&&(window.addEventListener(`resize`,i),window.addEventListener(`orientationchange`,f)),typeof document.addEventListener==`function`&&(document.addEventListener(`focusin`,u),document.addEventListener(`focusout`,d),document.addEventListener(`focus`,u,!0),document.addEventListener(`blur`,d,!0)),()=>{e.removeEventListener(`resize`,i),e.removeEventListener(`scroll`,i),typeof window.removeEventListener==`function`&&(window.removeEventListener(`resize`,i),window.removeEventListener(`orientationchange`,f)),typeof document.removeEventListener==`function`&&(document.removeEventListener(`focusin`,u),document.removeEventListener(`focusout`,d),document.removeEventListener(`focus`,u,!0),document.removeEventListener(`blur`,d,!0)),t!==null&&typeof window.cancelAnimationFrame==`function`&&window.cancelAnimationFrame(t),c(),fP(document)}},[])}function mP(e,t,n){let r=e;return t.length>0&&(r=r.filter(e=>t.includes(e.projectPath))),n.length>0&&(r=r.filter(e=>n.includes(e.host??``))),r}function hP(){let[e,t]=(0,x.useState)(!1),[n,r]=(0,x.useState)(void 0),[i,a]=(0,x.useState)(void 0),[o,s]=(0,x.useState)(void 0),[c,l]=(0,x.useState)(!1),[u,d]=(0,x.useState)(null),[f,p]=(0,x.useState)(null),[m,h]=(0,x.useState)(null),g=Wm(e=>e.sessions),_=Wm(e=>e.agentSessions),v=Wm(e=>e.agentSessionsEpoch),y=Wm(e=>e.selectedSessionId),b=Wm(e=>e.selectedHibernatingSessionId),S=Wm(e=>e.setSessions),C=Wm(e=>e.setAgentSessions),w=Wm(e=>e.setActiveAgentSessions),T=Wm(e=>e.setHostStatuses),E=Wm(e=>e.updateSession),D=Wm(e=>e.setSelectedSessionId),O=Wm(e=>e.setSelectedHibernatingSessionId),k=Wm(e=>e.hasLoaded),A=Wm(e=>e.connectionStatus),j=Wm(e=>e.connectionError),M=Wm(e=>e.clearExitingSession),N=Wm(e=>e.markSessionExiting),P=Wm(e=>e.setRemoteAllowControl),F=Wm(e=>e.setRemoteAllowAttach),I=Wm(e=>e.setHostLabel),L=Wm(e=>e.setPreferWindowName),R=Wm(e=>e.hostStatuses),z=Wm(e=>e.remoteAllowControl),B=Wm(e=>e.hostLabel),V=ZD(e=>e.theme),H=ee(),U=G(e=>e.defaultProjectDir),W=G(e=>e.commandPresets),te=G(e=>e.defaultPresetId),ne=G(e=>e.lastProjectPath),re=G(e=>e.setLastProjectPath),ie=G(e=>e.addRecentPath),ae=G(e=>e.shortcutModifier),oe=G(e=>e.sidebarWidth),se=G(e=>e.setSidebarWidth),ce=G(e=>e.projectFilters),le=G(e=>e.hostFilters),ue=G(e=>e.soundOnPermission),de=G(e=>e.soundOnIdle),fe=Wm(e=>e.connectionEpoch),{sendMessage:pe,subscribe:me,getConnectionEpoch:he}=lP();pP(),(0,x.useEffect)(()=>{if(typeof document>`u`||!ue&&!de)return;let e=!1,t=()=>{e&&!Gj()||(e=!0,qj())};return document.addEventListener(`click`,t,{passive:!0}),document.addEventListener(`keydown`,t,{passive:!0}),document.addEventListener(`touchstart`,t,{passive:!0}),()=>{document.removeEventListener(`click`,t),document.removeEventListener(`keydown`,t),document.removeEventListener(`touchstart`,t)}},[ue,de]);let ge=(0,x.useRef)(!1),_e=(0,x.useCallback)(e=>{e.preventDefault(),ge.current=!0,document.body.style.cursor=`col-resize`,document.body.style.userSelect=`none`},[]);(0,x.useEffect)(()=>{if(typeof document>`u`||typeof document.addEventListener!=`function`)return;let e=e=>{if(!ge.current)return;let t=e.clientX;se(Math.max(180,Math.min(400,t)))},t=()=>{ge.current&&(ge.current=!1,document.body.style.cursor=``,document.body.style.userSelect=``)};return document.addEventListener(`mousemove`,e),document.addEventListener(`mouseup`,t),()=>{document.removeEventListener(`mousemove`,e),document.removeEventListener(`mouseup`,t)}},[se]),(0,x.useEffect)(()=>{let e=me(e=>{if(e.type!==`terminal-output`){if(e.type===`sessions`){let t=Wm.getState().sessions,{soundOnPermission:n,soundOnIdle:r}=G.getState();if(n||r)for(let i of e.sessions){let e=t.find(e=>e.id===i.id);e&&e.status!==i.status&&(e.status!==`permission`&&i.status===`permission`&&n&&Xj(),e.status===`working`&&i.status===`waiting`&&r&&Zj())}if(Ne.current.size>0){let e=he();for(let[t,n]of Ne.current)n.epoch!==e&&Ne.current.delete(t)}let i=Ne.current.size>0?e.sessions.filter(e=>!Ne.current.has(e.id)):e.sessions,{selectedSessionId:a,selectedHibernatingSessionId:o}=Wm.getState(),s=a!==null&&o===null&&!i.some(e=>e.id===a)?t.find(e=>e.id===a)?.agentSessionId?.trim()??null:null;s&&(ke.current=s),S(i);let c=Ae.current,{selectedSessionId:l,selectedHibernatingSessionId:u}=Wm.getState(),{projectFilters:d,hostFilters:f}=G.getState();if(c&&l===null&&u===null){let e=i.find(e=>!(e.agentSessionId?.trim()!==c||d.length>0&&!d.includes(e.projectPath)||f.length>0&&!f.includes(e.host??``)));e&&(Ae.current=null,D(e.id))}}if(e.type===`host-status`&&T(e.hosts),e.type===`server-config`&&(P(e.remoteAllowControl),F(e.remoteAllowAttach),I(e.hostLabel),L(e.preferWindowName),e.clientLogLevel&&JT(e.clientLogLevel)),e.type===`session-update`){let t=Wm.getState().sessions.find(t=>t.id===e.session.id)?.status,n=e.session.status;if(E(e.session),t){let{soundOnPermission:e,soundOnIdle:r}=G.getState();t!==`permission`&&n===`permission`&&e&&Xj(),t===`working`&&n===`waiting`&&r&&Zj()}}if(e.type===`session-created`){let t=Wm.getState().sessions;t.some(t=>t.id===e.session.id)||S([e.session,...t]),D(e.session.id),ie(e.session.projectPath);let{projectFilters:n,setProjectFilters:r}=G.getState();n.length>0&&!n.includes(e.session.projectPath)&&r([...n,e.session.projectPath])}if(e.type===`session-removed`){SD(e.sessionId);let t=Wm.getState().sessions,n=t.filter(t=>t.id!==e.sessionId);n.length!==t.length&&S(n)}if(e.type===`agent-sessions`){let t=Array.isArray(e.active)?e.active:[],n=Array.isArray(e.hibernating)?e.hibernating:[],r=Array.isArray(e.history)?e.history:[],{selectedHibernatingSessionId:i}=Wm.getState(),a=ke.current;i&&!n.some(e=>e.sessionId===i)&&(Ae.current=i),C(t,n,r),h(e=>e&&n.some(t=>t.sessionId===e.sessionId)?null:e),a&&n.some(e=>e.sessionId===a)?(ke.current=null,O(a)):a&&(ke.current=null)}if(e.type===`agent-sessions-active`&&w(Array.isArray(e.active)?e.active:[]),e.type===`session-orphaned`&&!e.supersededBy){let t=Wm.getState().sessions,n=t.filter(t=>t.agentSessionId?.trim()!==e.session.sessionId);n.length!==t.length&&S(n)}if(e.type===`session-activated`){let t=Wm.getState().sessions.find(t=>t.tmuxWindow===e.window);t&&E({...t,agentSessionId:e.session.sessionId,agentSessionName:e.session.displayName,logFilePath:e.session.logFilePath,isPinned:e.session.isPinned,lastUserMessage:e.session.lastUserMessage??t.lastUserMessage})}if(e.type===`session-wake-result`)if(e.ok&&e.session){h(t=>t?.sessionId===e.sessionId?null:t);let t=Wm.getState().sessions;t.some(t=>t.id===e.session.id)||S([e.session,...t]),D(e.session.id)}else e.ok||(d(`${e.error?.code}: ${e.error?.message}`),window.setTimeout(()=>d(null),6e3));if(e.type===`session-hibernate-result`&&(e.ok?(e.session&&h(e.session),O(e.sessionId)):(d(e.error??`Failed to hibernate session`),window.setTimeout(()=>d(null),6e3))),e.type===`terminal-error`&&(!e.sessionId||e.sessionId===y)&&(d(`${e.code}: ${e.message}`),window.setTimeout(()=>d(null),6e3)),e.type===`terminal-ready`&&e.sessionId===y&&d(null),e.type===`error`&&(d(e.message),window.setTimeout(()=>d(null),6e3)),e.type===`kill-failed`){let t=Ne.current.get(e.sessionId);if(t){let n=Wm.getState().sessions;n.some(t=>t.id===e.sessionId)||S([t.session,...n]),t.wasSelected&&D(e.sessionId),Ne.current.delete(e.sessionId)}M(e.sessionId),d(e.message),window.setTimeout(()=>d(null),6e3)}e.type===`session-move-to-history-result`&&!e.ok&&e.error&&(d(e.error),window.setTimeout(()=>d(null),6e3))}});return()=>{e()}},[y,b,ie,M,pe,D,O,h,S,C,w,T,P,F,I,L,me,E]);let ve=(0,x.useMemo)(()=>g.find(e=>e.id===y)||null,[y,g]),ye=_.hibernating??[],be=_.history??[],xe=(0,x.useMemo)(()=>mP(ye,ce,le),[ye,ce,le]),Se=(0,x.useMemo)(()=>xe.find(e=>e.sessionId===b)||(m?.sessionId===b?m:null),[xe,m,b]);(0,x.useEffect)(()=>{ve?.projectPath&&!ve.remote&&re(ve.projectPath)},[ve?.projectPath,ve?.remote,re]);let Ce=G(e=>e.sessionSortMode),we=G(e=>e.sessionSortDirection),Te=G(e=>e.manualSessionOrder),Ee=(0,x.useMemo)(()=>km(g,{mode:Ce,direction:we,manualOrder:Te}),[g,Ce,we,Te]),De=(0,x.useMemo)(()=>{let e=Ee;return ce.length>0&&(e=e.filter(e=>ce.includes(e.projectPath))),le.length>0&&(e=e.filter(e=>le.includes(e.host??``))),e},[Ee,ce,le]),Oe=(0,x.useRef)(b),ke=(0,x.useRef)(null),Ae=(0,x.useRef)(null),je=(0,x.useRef)(fe),Me=(0,x.useCallback)(()=>De.length>0?(D(De[0].id),!0):xe.length>0?(O(xe[0].sessionId),!0):!1,[De,xe,D,O]);(0,x.useEffect)(()=>{let e=Oe.current;e&&b===null&&!ye.some(t=>t.sessionId===e)?Ae.current=e:b!==null&&(Ae.current=null),Oe.current=b},[ye,b]),(0,x.useEffect)(()=>{m&&b!==m.sessionId&&h(null)},[m,b]),(0,x.useEffect)(()=>{je.current!==fe&&(je.current=fe,ke.current=null,Ae.current=null,h(null))},[fe]),(0,x.useEffect)(()=>{k&&(b||y&&(De.some(e=>e.id===y)||Me()||D(null)))},[k,y,b,Me,D]),(0,x.useEffect)(()=>{if(!b||m?.sessionId===b||v!==fe||xe.some(e=>e.sessionId===b))return;let e=De.find(e=>e.agentSessionId?.trim()===b);if(e){D(e.id);return}Me()||O(null)},[xe,De,v,m,b,Me,D,O,fe]),(0,x.useEffect)(()=>{let e=Ae.current;if(!e)return;if(b!==null){Ae.current=null;return}let t=De.find(t=>t.agentSessionId?.trim()===e);if(t){Ae.current=null,D(t.id);return}if(y!==null){Ae.current=null;return}Me()&&(Ae.current=null)},[De,y,b,Me,D]),(0,x.useEffect)(()=>{window.matchMedia(`(max-width: 767px)`).matches&&k&&y===null&&b===null&&(De.length>0||xe.length>0)&&Me()},[xe.length,De.length,k,Me,y,b]);let Ne=(0,x.useRef)(new Map),Pe=(0,x.useCallback)((e,t=`unknown`)=>{SD(e);let{sessions:n,selectedSessionId:r}=Wm.getState(),i=n.find(t=>t.id===e);i&&Ne.current.set(e,{session:i,wasSelected:r===e,epoch:he()}),(0,K.flushSync)(()=>{N(e),S(n.filter(t=>t.id!==e))}),pe({type:`session-kill`,sessionId:e,source:t})},[N,S,pe]);(0,x.useEffect)(()=>{let n=We(ae),r=r=>{if(r.defaultPrevented)return;let i=r.code,a=qe(r,n);if(a&&(i===`BracketLeft`||i===`BracketRight`)){r.preventDefault();let e=i===`BracketLeft`?-1:1,t=De;if(t.length===0){let t=xe;if(t.length===0)return;let n=t.findIndex(e=>e.sessionId===b);if(n===-1){O(t[0].sessionId);return}O(t[(n+e+t.length)%t.length].sessionId);return}let n=t.findIndex(e=>e.id===y);if(n===-1){D(t[0].id);return}D(t[(n+e+t.length)%t.length].id);return}if(a&&i===`KeyN`){r.preventDefault(),!e&&H&&t(!0);return}if(a&&i===`KeyX`){r.preventDefault(),y&&!e&&Pe(y,`keyboard_shortcut`);return}};return window.addEventListener(`keydown`,r),()=>window.removeEventListener(`keydown`,r)},[e,y,b,D,O,De,xe,Pe,ae,H]);let Fe=()=>H?(r(void 0),a(void 0),s(void 0),t(!0),!0):!1,Ie=()=>l(!0),Le=(e,t,n,r)=>{pe({type:`session-create`,projectPath:e,name:t,command:n,host:r}),r||re(e)},Re=e=>{pe({type:`session-wake`,sessionId:e})},ze=(0,x.useCallback)(e=>{pe({type:`session-hibernate`,sessionId:e})},[pe]),Be=(e,t)=>{pe({type:`session-rename`,sessionId:e,newName:t})},Ve=(0,x.useCallback)(e=>{let t=g.find(t=>t.id===e);t&&pe({type:`session-create`,projectPath:t.projectPath,command:t.command||void 0,host:t.remote&&t.host?t.host:void 0})},[g,pe]),He=(0,x.useCallback)(e=>{pe({type:`session-move-to-history`,sessionId:e})},[pe]);(0,x.useEffect)(()=>{document.documentElement.setAttribute(`data-theme`,V)},[V]),(0,x.useEffect)(()=>{fetch(`/api/server-info`).then(e=>e.json()).then(e=>p(e)).catch(()=>{})},[]);let Ue=(0,x.useMemo)(()=>B?R.filter(e=>e.host!==B):R,[R,B]);return(0,q.jsxs)(`div`,{className:`flex h-full overflow-hidden`,children:[(0,q.jsxs)(`div`,{className:`hidden h-full flex-col md:flex md:shrink-0`,style:{width:oe},children:[(0,q.jsx)(Xe,{connectionStatus:A,onNewSession:Fe,onOpenSettings:Ie,tailscaleIp:f?.tailscaleIp??null}),(0,q.jsx)(UT,{sessions:g,hibernatingSessions:ye,historySessions:be,selectedSessionId:y,selectedHibernatingSessionId:b,onSelect:D,onSelectHibernating:O,onRename:Be,onResume:Re,onHibernate:ze,onKill:Pe,onDuplicate:Ve,onMoveToHistory:He,onNewSession:Fe,loading:!k,error:j||u})]}),(0,q.jsx)(`div`,{className:`hidden md:block w-1 shrink-0 cursor-col-resize bg-transparent transition-colors hover:bg-white/10 active:bg-white/20`,onMouseDown:_e}),(0,q.jsx)(RO,{session:ve,sessions:De,hibernatingSession:Se,hibernatingSessions:ye,connectionStatus:A,connectionEpoch:fe,sendMessage:pe,subscribe:me,onClose:()=>D(null),onSelectSession:D,onSelectHibernatingSession:O,onNewSession:Fe,onKillSession:Pe,onRenameSession:Be,onOpenSettings:Ie,onResumeSession:Re,onHibernateSession:ze,onMoveToHistory:He,historySessions:be,loading:!k,error:j||u}),(0,q.jsx)(BO,{isOpen:e,onClose:()=>t(!1),onCreate:Le,defaultProjectDir:U,commandPresets:W,defaultPresetId:te,lastProjectPath:ne,activeProjectPath:ve&&!ve.remote?ve.projectPath:void 0,remoteHosts:Ue,remoteAllowControl:z,initialHost:n,initialPath:i,initialCommand:o}),(0,q.jsx)(Qj,{isOpen:c,onClose:()=>l(!1)}),(0,q.jsx)(YN,{})]})}var gP=`modulepreload`,_P=function(e){return`/`+e},vP={},yP=function(e,t,n){let r=Promise.resolve();if(t&&t.length>0){let e=document.getElementsByTagName(`link`),i=document.querySelector(`meta[property=csp-nonce]`),a=i?.nonce||i?.getAttribute(`nonce`);function o(e){return Promise.all(e.map(e=>Promise.resolve(e).then(e=>({status:`fulfilled`,value:e}),e=>({status:`rejected`,reason:e}))))}r=o(t.map(t=>{if(t=_P(t,n),t in vP)return;vP[t]=!0;let r=t.endsWith(`.css`),i=r?`[rel="stylesheet"]`:``;if(n)for(let n=e.length-1;n>=0;n--){let i=e[n];if(i.href===t&&(!r||i.rel===`stylesheet`))return}else if(document.querySelector(`link[href="${t}"]${i}`))return;let o=document.createElement(`link`);if(o.rel=r?`stylesheet`:gP,r||(o.as=`script`),o.crossOrigin=``,o.href=t,a&&o.setAttribute(`nonce`,a),document.head.appendChild(o),r)return new Promise((e,n)=>{o.addEventListener(`load`,e),o.addEventListener(`error`,()=>n(Error(`Unable to preload CSS for ${t}`)))})}))}function i(e){let t=new Event(`vite:preloadError`,{cancelable:!0});if(t.payload=e,window.dispatchEvent(t),!t.defaultPrevented)throw e}return r.then(t=>{for(let e of t||[])e.status===`rejected`&&i(e.reason);return e().catch(i)})},bP=`true`,xP=`false`,SP=bP===`true`,CP=xP===`true`;function wP(e={}){let{immediate:t=!1,onNeedRefresh:n,onOfflineReady:r,onRegistered:i,onRegisteredSW:a,onRegisterError:o}=e,s,c,l,u=async(e=!0)=>{await c,SP||l?.()};async function d(){if(`serviceWorker`in navigator){if(s=await yP(async()=>{let{Workbox:e}=await import(`./workbox-window.prod.es5-Bq4GJJid.js`);return{Workbox:e}},[]).then(({Workbox:e})=>new e(`/sw.js`,{scope:`/`,type:`classic`})).catch(e=>{o?.(e)}),!s)return;if(l=()=>{s?.messageSkipWaiting()},!CP)if(SP)s.addEventListener(`activated`,e=>{(e.isUpdate||e.isExternal)&&window.location.reload()}),s.addEventListener(`installed`,e=>{e.isUpdate||r?.()});else{let e=!1,t=()=>{e=!0,s?.addEventListener(`controlling`,e=>{e.isUpdate&&window.location.reload()}),n?.()};s.addEventListener(`installed`,n=>{n.isUpdate===void 0?n.isExternal===void 0?!e&&r?.():n.isExternal?t():!e&&r?.():n.isUpdate||r?.()}),s.addEventListener(`waiting`,t)}s.register({immediate:t}).then(e=>{a?a(`/sw.js`,e):i?.(e)}).catch(e=>{o?.(e)})}}return c=d(),u}Ve()&&document.documentElement.classList.add(`ios`),He()&&document.documentElement.classList.add(`ios-pwa`),wP({immediate:!0,onRegisteredSW(e,t){t&&(setInterval(()=>{t.update()},300*1e3),document.addEventListener(`visibilitychange`,()=>{document.visibilityState===`visible`&&t.update()}))}});var TP=document.getElementById(`root`);if(!TP)throw Error(`Root element not found`);(0,E.createRoot)(TP).render((0,q.jsx)(x.StrictMode,{children:(0,q.jsx)(hP,{})}));
229
+ `,onClick:()=>{LO(),u(t.id)},title:$e?t.name:void 0,children:i},t.id)})})]}),(0,q.jsxs)(`div`,{className:`relative flex-1`,children:[(0,q.jsx)(`div`,{ref:ye,className:`absolute inset-0`}),Ee&&e&&(0,q.jsxs)(`div`,{className:`absolute top-2 left-2 z-50 flex items-center gap-1.5 rounded-lg bg-black/60 px-2.5 py-1.5 text-xs text-white/90 shadow-lg backdrop-blur-md`,children:[(0,q.jsxs)(`svg`,{className:`h-3 w-3 animate-spin`,viewBox:`0 0 24 24`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,children:[(0,q.jsx)(`circle`,{className:`opacity-25`,cx:`12`,cy:`12`,r:`10`,stroke:`currentColor`,strokeWidth:`4`}),(0,q.jsx)(`path`,{className:`opacity-75`,fill:`currentColor`,d:`M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4z`})]}),`Loading`]}),De&&e&&(0,q.jsxs)(`div`,{className:`absolute ${j&&!N?`bottom-20`:`bottom-8`} left-1/2 z-30 flex max-w-[calc(100%-2rem)] -translate-x-1/2 items-center gap-2 rounded-lg border border-border bg-elevated/95 px-2 py-2 shadow-lg backdrop-blur-sm md:left-auto md:right-4 md:translate-x-0`,children:[(0,q.jsx)(`span`,{className:`max-w-[12rem] truncate text-xs text-secondary md:max-w-[18rem]`,children:`Selection ready`}),(0,q.jsxs)(`button`,{type:`button`,onClick:Oe,className:`flex h-8 shrink-0 items-center justify-center gap-1.5 rounded bg-accent px-2.5 text-xs font-medium text-white hover:bg-accent/90 active:scale-95 transition-all`,title:`Copy selection`,"aria-label":`Copy selection`,children:[(0,q.jsx)(ce,{width:14,height:14}),`Copy`]}),(0,q.jsx)(`button`,{type:`button`,onClick:ke,className:`flex h-8 w-8 shrink-0 items-center justify-center rounded border border-border text-secondary hover:bg-hover hover:text-primary active:scale-95 transition-all`,title:`Dismiss`,"aria-label":`Dismiss`,children:(0,q.jsx)(Be,{width:14,height:14})})]}),!e&&(0,q.jsx)(`div`,{className:`absolute inset-0 flex items-center justify-center text-sm text-muted`,children:n?null:`Select a session to view terminal`}),e&&de&&(0,q.jsx)(`div`,{className:`absolute inset-0 flex items-center justify-center text-center text-sm text-muted`,children:`Remote session (read-only). Use SSH to attach on the host.`}),n&&(0,q.jsx)(`div`,{className:`absolute inset-0 z-10 overflow-y-auto bg-base`,children:(0,q.jsxs)(`div`,{className:`mx-auto flex min-h-full w-full max-w-5xl flex-col gap-4 p-4 md:p-6`,children:[(0,q.jsx)(`div`,{className:`border-b border-border pb-4`,children:(0,q.jsxs)(`div`,{className:`flex flex-col gap-3 md:flex-row md:items-start md:justify-between`,children:[(0,q.jsxs)(`div`,{className:`min-w-0 space-y-2`,children:[(0,q.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-2 gap-y-1 text-sm`,children:[(0,q.jsx)(`h2`,{className:`min-w-0 truncate text-lg font-semibold text-primary`,children:he}),(0,q.jsx)(`span`,{className:`rounded-full bg-blue-500/15 px-2 py-0.5 text-[10px] font-semibold uppercase tracking-wide text-blue-400`,children:`Hibernating`}),ge&&(0,q.jsx)(`span`,{className:`text-muted`,children:ge}),(0,q.jsxs)(`span`,{className:`text-muted`,children:[`Last active `,_e]})]}),n.lastResumeError&&(0,q.jsxs)(`div`,{className:`inline-flex items-center gap-1 rounded bg-amber-500/15 px-2 py-1 text-xs text-amber-400`,title:`Last wake failed: ${n.lastResumeError}`,children:[(0,q.jsx)(ne,{width:12,height:12}),`Last wake failed`]}),n.lastUserMessage&&(0,q.jsx)(`p`,{className:`max-h-28 max-w-3xl overflow-y-auto whitespace-pre-wrap break-words pr-2 text-sm leading-6 text-secondary`,children:n.lastUserMessage})]}),(0,q.jsxs)(`div`,{className:`flex shrink-0 items-center gap-2`,children:[(0,q.jsx)(`button`,{type:`button`,onClick:()=>h(n.sessionId),className:`btn btn-primary hidden md:inline-flex`,children:`Wake`}),_&&(0,q.jsx)(`button`,{type:`button`,onClick:()=>_(n.sessionId),className:`btn btn-secondary`,children:`Move to History`})]})]})}),(0,q.jsx)(RT,{session:n})]})}),j&&e&&!N&&(0,q.jsxs)(`button`,{onClick:je,className:`absolute bottom-8 left-1/2 z-20 flex h-10 px-4 items-center justify-center gap-1.5 rounded-full bg-blue-600/90 text-white shadow-lg hover:bg-blue-600 active:scale-95 transition-all`,style:{transform:`translateX(-50%)`},title:`Scroll to bottom`,"aria-label":`Scroll to bottom`,children:[(0,q.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:`18`,height:`18`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2.5`,strokeLinecap:`round`,strokeLinejoin:`round`,children:(0,q.jsx)(`path`,{d:`M12 5v14M5 12l7 7 7-7`})}),(0,q.jsx)(`span`,{className:`text-sm font-medium`,children:`Jump to bottom`})]})]}),e&&(0,q.jsx)(jO,{onSendKey:Je,onPasteText:Ye,disabled:a!==`connected`||de,sessions:t.map(e=>({id:e.id,name:e.name,status:e.status})),currentSessionId:e.id,agentType:e.agentType,onSelectSession:u,hideSessionSwitcher:!0,onRefocus:Xe,isKeyboardVisible:Qe,onEnterTextMode:Ze}),(A||k)&&(0,q.jsx)(MO,{isOpen:B,onClose:()=>V(!1),sessions:t,hibernatingSessions:r,historySessions:i,selectedSessionId:e?.id??null,selectedHibernatingSessionId:n?.sessionId??null,onSelect:u,onSelectHibernating:d,onRename:m,onResume:h,onHibernate:g,onMoveToHistory:_,onNewSession:f,loading:y,error:b}),F&&e&&(0,q.jsx)(`div`,{className:`fixed inset-0 z-50 flex items-center justify-center bg-black/50`,children:(0,q.jsxs)(`div`,{className:`mx-4 w-full max-w-sm rounded-lg border border-border bg-elevated p-4 shadow-xl`,children:[(0,q.jsx)(`h3`,{className:`text-base font-medium text-primary mb-2 text-balance`,children:`Kill Session`}),(0,q.jsxs)(`p`,{className:`text-sm text-secondary mb-4 text-pretty`,children:[`Kill "`,e.agentSessionName||e.name,`"? The process will be terminated. Conversation history is preserved in logs.`]}),(0,q.jsxs)(`div`,{className:`flex justify-end gap-2`,children:[(0,q.jsx)(`button`,{onClick:()=>I(!1),className:`btn py-1.5 px-3 text-sm`,children:`Cancel`}),(0,q.jsx)(`button`,{ref:ae,onClick:Fe,className:`btn btn-danger py-1.5 px-3 text-sm`,children:`Kill Session`})]})]})})]})}function zO({onSelect:e,onCancel:t,initialPath:n}){let[r,i]=(0,x.useState)(n||`~`),[a,o]=(0,x.useState)(null),[s,c]=(0,x.useState)(null),[l,u]=(0,x.useState)(!0),[d,f]=(0,x.useState)(-1),p=(0,x.useRef)(null),m=G(e=>e.recentPaths),h=(0,x.useCallback)(async e=>{p.current?.abort();let t=new AbortController;p.current=t;let{signal:n}=t;u(!0),c(null),o(null),f(-1),i(e);try{let r=await fetch(`/api/directories?path=${encodeURIComponent(e)}`,{signal:n});if(!r.ok){let e=await r.json();throw Error(e.message||`Failed to load directory`)}let a=await r.json();if(p.current!==t)return;o(a),i(a.path)}catch(e){if(p.current!==t)return;let n=e;n?.name!==`AbortError`&&c(n?.message||`Failed to load directory`)}finally{p.current===t&&u(!1)}},[]);(0,x.useEffect)(()=>(h(n||`~`),()=>{p.current?.abort()}),[h,n]);let g=a?.directories??[],_=a?.path||r,v=a?.parent;return(0,x.useEffect)(()=>{let n=n=>{if(n.key===`Escape`){n.preventDefault(),t();return}if(!l){if(n.key===`ArrowDown`){n.preventDefault(),f(e=>g.length===0?-1:e<0?0:Math.min(e+1,g.length-1));return}if(n.key===`ArrowUp`){n.preventDefault(),f(e=>g.length===0?-1:e<0?g.length-1:Math.max(e-1,0));return}if(n.key===`Enter`){n.preventDefault();let t=g[d];t?h(t.path):_&&e(_);return}n.key===`Backspace`&&v&&(n.preventDefault(),h(v))}};return window.addEventListener(`keydown`,n),()=>window.removeEventListener(`keydown`,n)},[g,_,h,d,l,t,e,v]),(0,q.jsx)(`div`,{role:`dialog`,"aria-modal":`true`,"aria-label":`Directory browser`,className:`fixed inset-0 z-[60] flex items-center justify-center bg-black/60 p-4`,onClick:e=>{e.target===e.currentTarget&&t()},"data-testid":`directory-browser`,children:(0,q.jsxs)(`div`,{className:`w-full max-w-lg border border-border bg-elevated p-4`,children:[(0,q.jsxs)(`div`,{className:`flex items-center gap-3 border-b border-border pb-2`,children:[(0,q.jsx)(`button`,{type:`button`,className:`btn`,onClick:()=>{v&&h(v)},disabled:!v||l,children:`Up`}),(0,q.jsx)(`div`,{className:`min-w-0 flex-1 truncate text-xs font-mono text-secondary`,title:_,"data-testid":`directory-current-path`,children:_})]}),(0,q.jsx)(`div`,{className:`mt-3 max-h-60 overflow-y-auto border border-border bg-surface`,children:l?(0,q.jsx)(`div`,{className:`px-3 py-4 text-xs text-muted`,"data-testid":`directory-loading`,children:`Loading directories...`}):s?(0,q.jsxs)(`div`,{className:`px-3 py-4 text-xs`,"data-testid":`directory-error`,children:[(0,q.jsx)(`p`,{className:`text-danger`,children:s}),(0,q.jsx)(`button`,{type:`button`,className:`btn mt-3`,onClick:()=>h(r),children:`Retry`})]}):g.length===0?(0,q.jsx)(`div`,{className:`px-3 py-4 text-xs text-muted`,"data-testid":`directory-empty`,children:`No subdirectories`}):(0,q.jsx)(`div`,{className:`py-1`,children:g.map((e,t)=>(0,q.jsxs)(`button`,{type:`button`,onClick:()=>h(e.path),onMouseEnter:()=>f(t),className:`flex w-full items-center gap-2 px-3 py-2 text-left text-xs ${t===d?`bg-hover text-primary`:`text-secondary`}`,"data-testid":`directory-entry`,"data-entry-name":e.name,"data-entry-path":e.path,children:[(0,q.jsx)(ve,{width:14,height:14,className:`shrink-0 text-muted`,"aria-hidden":`true`}),(0,q.jsx)(`span`,{className:`truncate`,children:e.name})]},e.path))})}),a?.truncated?(0,q.jsx)(`p`,{className:`mt-2 text-[10px] text-muted`,children:`Showing first 200 directories.`}):null,(0,q.jsxs)(`div`,{className:`mt-4 border-t border-border pt-3`,children:[(0,q.jsx)(`div`,{className:`text-[10px] uppercase tracking-wider text-secondary`,children:`Recent`}),m.length===0?(0,q.jsx)(`p`,{className:`mt-2 text-xs text-muted`,children:`No recent paths yet.`}):(0,q.jsx)(`div`,{className:`mt-2 space-y-1`,children:m.map(e=>(0,q.jsx)(`button`,{type:`button`,className:`block w-full truncate text-left text-xs text-secondary hover:text-primary`,onClick:()=>h(e),title:e,"data-testid":`directory-recent`,"data-recent-path":e,children:e},e))})]}),(0,q.jsxs)(`div`,{className:`mt-4 flex justify-end gap-2`,children:[(0,q.jsx)(`button`,{type:`button`,onClick:t,className:`btn`,children:`Cancel`}),(0,q.jsx)(`button`,{type:`button`,onClick:()=>{_&&e(_)},className:`btn btn-primary`,disabled:l||!_,children:`Select`})]})]})})}function BO({isOpen:e,onClose:t,onCreate:n,defaultProjectDir:r,commandPresets:i,defaultPresetId:a,lastProjectPath:o,activeProjectPath:s,remoteHosts:c=[],remoteAllowControl:l=!1,initialHost:u,initialPath:d,initialCommand:f}){let[p,m]=(0,x.useState)(``),[h,g]=(0,x.useState)(``),[_,v]=(0,x.useState)(null),[y,b]=(0,x.useState)(``),[S,C]=(0,x.useState)(!1),[w,T]=(0,x.useState)(``),E=(0,x.useRef)(null),D=(0,x.useRef)(null),O=(0,x.useRef)(null),k=l&&c.length>0;if((0,x.useEffect)(()=>{if(!e){m(``),g(``),v(null),b(``),C(!1),T(u??``),setTimeout(()=>{if(typeof document>`u`||typeof document.querySelector!=`function`)return;let e=document.querySelector(`.xterm-helper-textarea`);e&&(e.removeAttribute(`disabled`),e.focus())},300);return}if(typeof document<`u`&&typeof document.querySelector==`function`){let e=document.querySelector(`.xterm-helper-textarea`);e&&typeof e.setAttribute==`function`&&(typeof e.blur==`function`&&e.blur(),e.setAttribute(`disabled`,`true`))}m(d?.trim()||s?.trim()||o||r||``),g(``),T(u??``);let t=f?.trim();if(t){let e=i.find(e=>H(e)===t);e?(v(e.id),b(H(e))):(v(null),b(t))}else{let e=i.find(e=>e.id===a);e?(v(a),b(H(e))):i.length>0?(v(i[0].id),b(H(i[0]))):(v(null),b(``))}setTimeout(()=>{if(O.current?.focus(),D.current){let e=D.current;e.scrollLeft=e.scrollWidth}},50)},[s,i,a,r,e,o,u,d,f]),(0,x.useEffect)(()=>{if(!e||typeof window>`u`||typeof window.addEventListener!=`function`)return;let n=()=>E.current?Array.from(E.current.querySelectorAll(`input:not([disabled]), select:not([disabled]), button:not([disabled]):not([tabindex="-1"]), [tabindex="0"]`)):[],r=e=>{if(!S){if(e.key===`Escape`){typeof e.stopPropagation==`function`&&e.stopPropagation(),t();return}if(e.key===`Enter`){let t=document.activeElement;if(!t||t.tagName===`INPUT`||t.closest(`[data-testid="host-select"]`)||!t.closest(`[data-testid="command-select"]`))return;e.preventDefault(),typeof e.stopPropagation==`function`&&e.stopPropagation(),E.current?.requestSubmit();return}if(e.key===`Tab`){e.preventDefault(),typeof e.stopPropagation==`function`&&e.stopPropagation();let t=n();if(t.length===0)return;let r=document.activeElement,i=t.indexOf(r),a;a=i===-1?e.shiftKey?t.length-1:0:e.shiftKey?i<=0?t.length-1:i-1:i>=t.length-1?0:i+1,t[a]?.focus()}}};return window.addEventListener(`keydown`,r),()=>window.removeEventListener(`keydown`,r)},[e,t,S]),!e)return null;let A=e=>{let t=i.find(t=>t.id===e);t&&(v(e),b(H(t)))},j=()=>{v(null),b(``)},M=_===null,N=w!==``,P=e=>{e.preventDefault();let r=p.trim();if(!r)return;let i=y.trim();n(r,h.trim()||void 0,i||void 0,N?w:void 0),t()},F=[...i.map(e=>({id:e.id,label:e.label,isCustom:!1,agentType:e.agentType,command:e.command})),{id:`custom`,label:`Custom`,isCustom:!0,agentType:void 0,command:void 0}],I=[{id:``,label:`Local`,ok:!0,error:void 0},...c.map(e=>({id:e.host,label:e.host,ok:e.ok,error:e.error}))],L=p.trim()||`~`;return(0,q.jsxs)(`div`,{role:`dialog`,"aria-modal":`true`,"aria-labelledby":`new-session-title`,className:`fixed inset-0 z-50 flex items-center justify-center bg-black/60 p-4`,onClick:e=>{e.target===e.currentTarget&&t()},children:[(0,q.jsxs)(`form`,{ref:E,onSubmit:P,className:`w-full max-w-md border border-border bg-elevated p-6`,children:[(0,q.jsx)(`h2`,{id:`new-session-title`,className:`text-sm font-semibold uppercase tracking-wider text-primary text-balance`,children:`New Session`}),(0,q.jsxs)(`div`,{className:`mt-4 space-y-4`,children:[k&&(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`label`,{className:`mb-1.5 block text-xs text-secondary`,children:`Host`}),(0,q.jsx)(`div`,{className:`flex flex-wrap gap-2`,role:`radiogroup`,"aria-label":`Host`,"data-testid":`host-select`,children:I.map((e,t)=>{let n=w===e.id,r=!e.ok&&!n;return(0,q.jsx)(`button`,{type:`button`,role:`radio`,"aria-checked":n,"aria-label":e.label,title:e.ok?void 0:e.error||`Unreachable`,tabIndex:n?0:-1,onClick:()=>T(e.id),onKeyDown:e=>{let n=t;if(e.key===`ArrowRight`||e.key===`ArrowDown`)e.preventDefault(),n=(t+1)%I.length;else if(e.key===`ArrowLeft`||e.key===`ArrowUp`)e.preventDefault(),n=(t-1+I.length)%I.length;else return;let r=I[n];T(r.id),(e.currentTarget.parentElement?.querySelectorAll(`[role="radio"]`))?.[n]?.focus()},className:`btn text-xs focus:outline-none focus:ring-2 focus:ring-primary ${n?`btn-primary`:``} ${r?`opacity-60`:``}`,children:e.label},e.id||`local`)})})]}),(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`label`,{className:`mb-1.5 block text-xs text-secondary`,children:`Command`}),(0,q.jsx)(`div`,{className:`flex flex-wrap gap-2`,role:`radiogroup`,"aria-label":`Command preset`,"data-testid":`command-select`,children:F.map((e,t)=>{let n=e.isCustom?M:_===e.id;return(0,q.jsxs)(`button`,{ref:n?O:void 0,type:`button`,role:`radio`,"aria-checked":n,tabIndex:n?0:-1,onClick:()=>{e.isCustom?j():A(e.id)},onKeyDown:e=>{let n=t;if(e.key===`ArrowRight`||e.key===`ArrowDown`)e.preventDefault(),n=(t+1)%F.length;else if(e.key===`ArrowLeft`||e.key===`ArrowUp`)e.preventDefault(),n=(t-1+F.length)%F.length;else return;let r=F[n];r.isCustom?j():A(r.id),(e.currentTarget.parentElement?.querySelectorAll(`[role="radio"]`))?.[n]?.focus()},className:`btn text-xs focus:outline-none focus:ring-2 focus:ring-primary ${n?`btn-primary`:``}`,children:[(0,q.jsx)(Zm,{agentType:e.agentType,command:e.command,className:`inline-block h-3.5 w-3.5 shrink-0`}),e.label]},e.id)})}),(0,q.jsx)(`input`,{value:y,onChange:e=>b(e.target.value),placeholder:`Enter command...`,className:`input mt-2 font-mono text-xs`})]}),(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`label`,{className:`mb-1.5 block text-xs text-secondary`,children:`Project Path`}),(0,q.jsxs)(`div`,{className:`flex gap-2`,children:[(0,q.jsx)(`input`,{ref:D,value:p,onChange:e=>m(e.target.value),placeholder:N?`/home/user/project`:s||o||r||`/Users/you/code/my-project`,className:`input flex-1 text-sm`}),!N&&(0,q.jsx)(`button`,{type:`button`,className:`btn`,onClick:()=>C(!0),children:`Browse`})]})]}),(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`label`,{className:`mb-1.5 block text-xs text-secondary`,children:`Display Name`}),(0,q.jsx)(`input`,{value:h,onChange:e=>g(e.target.value),placeholder:`auto-generated`,className:`input text-sm placeholder:italic`})]})]}),(0,q.jsxs)(`div`,{className:`mt-6 flex justify-end gap-2`,children:[(0,q.jsx)(`button`,{type:`button`,onClick:t,className:`btn`,children:`Cancel`}),(0,q.jsx)(`button`,{type:`submit`,className:`btn btn-primary`,children:`Create`})]})]}),S&&!N&&(0,q.jsx)(zO,{initialPath:L,onSelect:e=>{m(e),C(!1)},onCancel:()=>C(!1)})]})}function VO({controlled:e,default:t,name:n,state:r=`value`}){let{current:i}=x.useRef(e!==void 0),[a,o]=x.useState(t);return[i?e:a,x.useCallback(e=>{i||o(e)},[])]}var HO={};function UO(e,t){let n=x.useRef(HO);return n.current===HO&&(n.current=e(t)),n}var WO=x[`useInsertionEffect${Math.random().toFixed(1)}`.slice(0,-3)],GO=WO&&WO!==x.useLayoutEffect?WO:e=>e();function KO(e){let t=UO(qO).current;return t.next=e,GO(t.effect),t.trampoline}function qO(){let e={next:void 0,callback:JO,trampoline:(...t)=>e.callback?.(...t),effect:()=>{e.callback=e.next}};return e}function JO(){}function YO(e,t,n,r){let i=UO(ZO).current;return QO(i,e,t,n,r)&&ek(i,[e,t,n,r]),i.callback}function XO(e){let t=UO(ZO).current;return $O(t,e)&&ek(t,e),t.callback}function ZO(){return{callback:null,cleanup:null,refs:[]}}function QO(e,t,n,r,i){return e.refs[0]!==t||e.refs[1]!==n||e.refs[2]!==r||e.refs[3]!==i}function $O(e,t){return e.refs.length!==t.length||e.refs.some((e,n)=>e!==t[n])}function ek(e,t){if(e.refs=t,t.every(e=>e==null)){e.callback=null;return}e.callback=n=>{if(e.cleanup&&=(e.cleanup(),null),n!=null){let r=Array(t.length).fill(null);for(let e=0;e<t.length;e+=1){let i=t[e];if(i!=null)switch(typeof i){case`function`:{let t=i(n);typeof t==`function`&&(r[e]=t);break}case`object`:i.current=n;break;default:}}e.cleanup=()=>{for(let e=0;e<t.length;e+=1){let n=t[e];if(n!=null)switch(typeof n){case`function`:{let t=r[e];typeof t==`function`?t():n(null);break}case`object`:n.current=null;break;default:}}}}}}var tk=typeof document<`u`?x.useLayoutEffect:()=>{},nk={clipPath:`inset(50%)`,overflow:`hidden`,whiteSpace:`nowrap`,border:0,padding:0,width:1,height:1,margin:-1},rk={...nk,position:`fixed`,top:0,left:0},ik={...nk,position:`absolute`};function ak(){}Object.freeze([]);var ok=Object.freeze({});function sk(e,...t){let n=new URL(`https://base-ui.com/production-error`);return n.searchParams.set(`code`,e.toString()),t.forEach(e=>n.searchParams.append(`args[]`,e)),`Base UI error #${e}; visit ${n} for the full message.`}var ck=18;function lk(e){return ck>=e}function uk(e){if(!x.isValidElement(e))return null;let t=e,n=t.props;return(lk(19)?n?.ref:t.ref)??null}function dk(e,t){if(e&&!t)return e;if(!e&&t)return t;if(e||t)return{...e,...t}}function fk(e,t){let n={};for(let r in e){let i=e[r];if(t?.hasOwnProperty(r)){let e=t[r](i);e!=null&&Object.assign(n,e);continue}i===!0?n[`data-${r.toLowerCase()}`]=``:i&&(n[`data-${r.toLowerCase()}`]=i.toString())}return n}function pk(e,t){return typeof e==`function`?e(t):e}function mk(e,t){return typeof e==`function`?e(t):e}var hk={};function gk(e,t,n,r,i){let a={...Sk(e,hk)};return t&&(a=vk(a,t)),n&&(a=vk(a,n)),r&&(a=vk(a,r)),i&&(a=vk(a,i)),a}function _k(e){if(e.length===0)return hk;if(e.length===1)return Sk(e[0],hk);let t={...Sk(e[0],hk)};for(let n=1;n<e.length;n+=1)t=vk(t,e[n]);return t}function vk(e,t){return xk(t)?t(e):yk(e,t)}function yk(e,t){if(!t)return e;for(let n in t){let r=t[n];switch(n){case`style`:e[n]=dk(e.style,r);break;case`className`:e[n]=Tk(e.className,r);break;default:bk(n,r)?e[n]=Ck(e[n],r):e[n]=r}}return e}function bk(e,t){let n=e.charCodeAt(0),r=e.charCodeAt(1),i=e.charCodeAt(2);return n===111&&r===110&&i>=65&&i<=90&&(typeof t==`function`||t===void 0)}function xk(e){return typeof e==`function`}function Sk(e,t){return xk(e)?e(t):e??hk}function Ck(e,t){return t?e?n=>{if(Ek(n)){let r=n;wk(r);let i=t(r);return r.baseUIHandlerPrevented||e?.(r),i}let r=t(n);return e?.(n),r}:t:e}function wk(e){return e.preventBaseUIHandler=()=>{e.baseUIHandlerPrevented=!0},e}function Tk(e,t){return t?e?t+` `+e:t:e}function Ek(e){return typeof e==`object`&&!!e&&`nativeEvent`in e}function Dk(e,t,n={}){let r=t.render,i=Ok(t,n);return n.enabled===!1?null:Ak(e,r,i,n.state??ok)}function Ok(e,t={}){let{className:n,style:r,render:i}=e,{state:a=ok,ref:o,props:s,stateAttributesMapping:c,enabled:l=!0}=t,u=l?pk(n,a):void 0,d=l?mk(r,a):void 0,f=l?fk(a,c):ok,p=l?dk(f,Array.isArray(s)?_k(s):s)??ok:ok;return typeof document<`u`&&(l?Array.isArray(o)?p.ref=XO([p.ref,uk(i),...o]):p.ref=YO(p.ref,uk(i),o):YO(null,null)),l?(u!==void 0&&(p.className=Tk(p.className,u)),d!==void 0&&(p.style=dk(p.style,d)),p):ok}var kk=Symbol.for(`react.lazy`);function Ak(e,t,n,r){if(t){if(typeof t==`function`)return t(n,r);let e=gk(n,t.props);e.ref=n.ref;let i=t;return i?.$$typeof===kk&&(i=x.Children.toArray(t)[0]),x.cloneElement(i,e)}if(e&&typeof e==`string`)return jk(e,n);throw Error(sk(8))}function jk(e,t){return e===`button`?(0,x.createElement)(`button`,{type:`button`,...t,key:t.key}):e===`img`?(0,x.createElement)(`img`,{alt:``,...t,key:t.key}):x.createElement(e,t)}var Mk={...x},Nk=0;function Pk(e,t=`mui`){let[n,r]=x.useState(e),i=e||n;return x.useEffect(()=>{n??(Nk+=1,r(`${t}-${Nk}`))},[n,t]),i}var Fk=Mk.useId;function Ik(e,t){if(Fk!==void 0){let n=Fk();return e??(t?`${t}-${n}`:n)}return Pk(e,t)}function Lk(e){return Ik(e,`base-ui`)}function Rk(){return typeof window<`u`}function zk(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Bk(e){return Rk()?e instanceof Element||e instanceof zk(e).Element:!1}function Vk(e){return Rk()?e instanceof HTMLElement||e instanceof zk(e).HTMLElement:!1}function Hk(e){return!Rk()||typeof ShadowRoot>`u`?!1:e instanceof ShadowRoot||e instanceof zk(e).ShadowRoot}var Uk=x.createContext(void 0);function Wk(e=!1){let t=x.useContext(Uk);if(t===void 0&&!e)throw Error(sk(16));return t}function Gk(e){let{focusableWhenDisabled:t,disabled:n,composite:r=!1,tabIndex:i=0,isNativeButton:a}=e,o=r&&t!==!1,s=r&&t===!1;return{props:x.useMemo(()=>{let e={onKeyDown(e){n&&t&&e.key!==`Tab`&&e.preventDefault()}};return r||(e.tabIndex=i,!a&&n&&(e.tabIndex=t?i:-1)),(a&&(t||o)||!a&&n)&&(e[`aria-disabled`]=n),a&&(!t||s)&&(e.disabled=n),e},[r,n,t,o,s,a,i])}}function Kk(e={}){let{disabled:t=!1,focusableWhenDisabled:n,tabIndex:r=0,native:i=!0}=e,a=x.useRef(null),o=Wk(!0)!==void 0,s=KO(()=>{let e=a.current;return!!(e?.tagName===`A`&&e?.href)}),{props:c}=Gk({focusableWhenDisabled:n,disabled:t,composite:o,tabIndex:r,isNativeButton:i}),l=x.useCallback(()=>{let e=a.current;qk(e)&&o&&t&&c.disabled===void 0&&e.disabled&&(e.disabled=!1)},[t,c.disabled,o]);return tk(l,[l]),{getButtonProps:x.useCallback((e={})=>{let{onClick:n,onMouseDown:r,onKeyUp:a,onKeyDown:o,onPointerDown:l,...u}=e;return gk({type:i?`button`:void 0,onClick(e){if(t){e.preventDefault();return}n?.(e)},onMouseDown(e){t||r?.(e)},onKeyDown(e){if(t||(wk(e),o?.(e)),e.baseUIHandlerPrevented)return;let r=e.target===e.currentTarget&&!i&&!s()&&!t,a=e.key===`Enter`,c=e.key===` `;r&&((c||a)&&e.preventDefault(),a&&n?.(e))},onKeyUp(e){t||(wk(e),a?.(e)),!e.baseUIHandlerPrevented&&e.target===e.currentTarget&&!i&&!t&&e.key===` `&&n?.(e)},onPointerDown(e){if(t){e.preventDefault();return}l?.(e)}},i?void 0:{role:`button`},c,u)},[t,c,i,s]),buttonRef:KO(e=>{a.current=e,l()})}}function qk(e){return Vk(e)&&e.tagName===`BUTTON`}var Jk=x.createContext(void 0);function Yk(){let e=x.useContext(Jk);if(e===void 0)throw Error(sk(63));return e}var Xk=function(e){return e.disabled=`data-disabled`,e.valid=`data-valid`,e.invalid=`data-invalid`,e.touched=`data-touched`,e.dirty=`data-dirty`,e.filled=`data-filled`,e.focused=`data-focused`,e}({}),Zk={badInput:!1,customError:!1,patternMismatch:!1,rangeOverflow:!1,rangeUnderflow:!1,stepMismatch:!1,tooLong:!1,tooShort:!1,typeMismatch:!1,valid:null,valueMissing:!1},Qk={valid(e){return e===null?null:e?{[Xk.valid]:``}:{[Xk.invalid]:``}}},$k=function(e){return e.checked=`data-checked`,e.unchecked=`data-unchecked`,e.disabled=`data-disabled`,e.readonly=`data-readonly`,e.required=`data-required`,e.valid=`data-valid`,e.invalid=`data-invalid`,e.touched=`data-touched`,e.dirty=`data-dirty`,e.filled=`data-filled`,e.focused=`data-focused`,e}({}),eA={...Qk,checked(e){return e?{[$k.checked]:``}:{[$k.unchecked]:``}}};function tA(e,t){return{...e,state:{...e.state,valid:!t&&e.state.valid}}}var nA=x.createContext({formRef:{current:{fields:new Map}},errors:{},clearErrors:ak,validationMode:`onSubmit`,submitAttemptedRef:{current:!1}});function rA(){return x.useContext(nA)}var iA=x.createContext({invalid:void 0,name:void 0,validityData:{state:Zk,errors:[],error:``,value:``,initialValue:null},setValidityData:ak,disabled:void 0,touched:!1,setTouched:ak,dirty:!1,setDirty:ak,filled:!1,setFilled:ak,focused:!1,setFocused:ak,validate:()=>null,validationMode:`onSubmit`,validationDebounceTime:0,shouldValidateOnChange:()=>!1,state:{disabled:!1,valid:null,touched:!1,dirty:!1,filled:!1,focused:!1},markedDirtyRef:{current:!1},validation:{getValidationProps:(e=ok)=>e,getInputValidationProps:(e=ok)=>e,inputRef:{current:null},commit:async()=>{}}});function aA(e=!0){let t=x.useContext(iA);if(t.setValidityData===ak&&!e)throw Error(sk(28));return t}function oA(e){let{enabled:t=!0,value:n,id:r,name:i,controlRef:a,commit:o}=e,{formRef:s}=rA(),{invalid:c,markedDirtyRef:l,validityData:u,setValidityData:d}=aA(),f=KO(e.getValue);tk(()=>{if(!t)return;let e=n;e===void 0&&(e=f()),u.initialValue===null&&e!==null&&d(t=>({...t,initialValue:e}))},[t,d,n,u.initialValue,f]),tk(()=>{!t||!r||s.current.fields.set(r,{getValue:f,name:i,controlRef:a,validityData:tA(u,c),validate(e=!0){let t=n;t===void 0&&(t=f()),l.current=!0,e?K.flushSync(()=>o(t)):o(t)}})},[o,a,t,s,f,r,c,l,i,u,n]),tk(()=>{let e=s.current.fields;return()=>{r&&e.delete(r)}},[s,r])}var sA=x.createContext({controlId:void 0,registerControlId:ak,labelId:void 0,setLabelId:ak,messageIds:[],setMessageIds:ak,getDescriptionProps:e=>e});function cA(){return x.useContext(sA)}function lA(e={}){let{id:t,implicit:n=!1,controlRef:r}=e,{controlId:i,registerControlId:a}=cA(),o=Lk(t),s=n?i:void 0,c=UO(()=>Symbol(`labelable-control`)),l=x.useRef(!1),u=x.useRef(t!=null),d=KO(()=>{!l.current||a===ak||(l.current=!1,a(c.current,void 0))});return tk(()=>{if(a===ak)return;let e;if(n){let n=r?.current;e=Bk(n)&&n.closest(`label`)!=null?t??null:s??o}else if(t!=null)u.current=!0,e=t;else if(u.current)e=o;else{d();return}if(e===void 0){d();return}l.current=!0,a(c.current,e)},[t,r,s,a,n,o,c,d]),x.useEffect(()=>d,[d]),i??o}var uA=`none`;function dA(e,t,n,r){let i=!1,a=!1,o=r??ok;return{reason:e,event:t??new Event(`base-ui`),cancel(){i=!0},allowPropagation(){a=!0},get isCanceled(){return i},get isPropagationAllowed(){return a},trigger:n,...o}}function fA(e,t){let n=x.useRef(e),r=KO(t);tk(()=>{n.current!==e&&r(n.current)},[e,r]),tk(()=>{n.current=e},[e])}var pA=x.forwardRef(function(e,t){let{checked:n,className:r,defaultChecked:i,id:a,inputRef:o,name:s,nativeButton:c=!1,onCheckedChange:l,readOnly:u=!1,required:d=!1,disabled:f=!1,render:p,uncheckedValue:m,value:h,...g}=e,{clearErrors:_}=rA(),{state:v,setTouched:y,setDirty:b,validityData:S,setFilled:C,setFocused:w,shouldValidateOnChange:T,validationMode:E,disabled:D,name:O,validation:k}=aA(),{labelId:A}=cA(),j=D||f,M=O??s,N=KO(l),P=x.useRef(null),F=YO(P,o,k.inputRef),I=x.useRef(null),L=Lk(),R=lA({id:a,implicit:!1,controlRef:I}),z=c?void 0:R,[B,V]=VO({controlled:n,default:!!i,name:`Switch`,state:`checked`});oA({id:L,commit:k.commit,value:B,controlRef:I,name:M,getValue:()=>B}),tk(()=>{P.current&&C(P.current.checked)},[P,C]),fA(B,()=>{_(M),b(B!==S.initialValue),C(B),T()?k.commit(B):k.commit(B,!0)});let{getButtonProps:H,buttonRef:U}=Kk({disabled:j,native:c}),W={id:c?R:L,role:`switch`,"aria-checked":B,"aria-readonly":u||void 0,"aria-required":d||void 0,"aria-labelledby":A,onFocus(){j||w(!0)},onBlur(){let e=P.current;!e||j||(y(!0),w(!1),E===`onBlur`&&k.commit(e.checked))},onClick(e){u||j||(e.preventDefault(),P.current?.dispatchEvent(new PointerEvent(`click`,{bubbles:!0,shiftKey:e.shiftKey,ctrlKey:e.ctrlKey,altKey:e.altKey,metaKey:e.metaKey})))}},G=x.useMemo(()=>gk({checked:B,disabled:j,id:z,name:M,required:d,style:M?ik:rk,tabIndex:-1,type:`checkbox`,"aria-hidden":!0,ref:F,onChange(e){if(e.nativeEvent.defaultPrevented)return;let t=e.target.checked,n=dA(uA,e.nativeEvent);N?.(t,n),!n.isCanceled&&V(t)},onFocus(){I.current?.focus()}},k.getInputValidationProps,h===void 0?ok:{value:h}),[B,j,F,z,M,N,d,V,k,h]),ee=x.useMemo(()=>({...v,checked:B,disabled:j,readOnly:u,required:d}),[v,B,j,u,d]),K=Dk(`span`,e,{state:ee,ref:[t,I,U],props:[W,k.getValidationProps,g,H],stateAttributesMapping:eA});return(0,q.jsxs)(Jk.Provider,{value:ee,children:[K,!B&&M&&m!==void 0&&(0,q.jsx)(`input`,{type:`hidden`,name:M,value:m}),(0,q.jsx)(`input`,{...G})]})}),mA=x.forwardRef(function(e,t){let{render:n,className:r,...i}=e,{state:a}=aA(),o=Yk();return Dk(`span`,e,{state:{...a,...o},ref:t,stateAttributesMapping:eA,props:i})});function hA(e){var t,n,r=``;if(typeof e==`string`||typeof e==`number`)r+=e;else if(typeof e==`object`)if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(n=hA(e[t]))&&(r&&(r+=` `),r+=n)}else for(n in e)e[n]&&(r&&(r+=` `),r+=n);return r}function gA(){for(var e,t,n=0,r=``,i=arguments.length;n<i;n++)(e=arguments[n])&&(t=hA(e))&&(r&&(r+=` `),r+=t);return r}var _A=(e,t)=>{let n=Array(e.length+t.length);for(let t=0;t<e.length;t++)n[t]=e[t];for(let r=0;r<t.length;r++)n[e.length+r]=t[r];return n},vA=(e,t)=>({classGroupId:e,validator:t}),yA=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),bA=`-`,xA=[],SA=`arbitrary..`,CA=e=>{let t=EA(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:e=>{if(e.startsWith(`[`)&&e.endsWith(`]`))return TA(e);let n=e.split(bA);return wA(n,+(n[0]===``&&n.length>1),t)},getConflictingClassGroupIds:(e,t)=>{if(t){let t=r[e],i=n[e];return t?i?_A(i,t):t:i||xA}return n[e]||xA}}},wA=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;let r=e[t],i=n.nextPart.get(r);if(i){let n=wA(e,t+1,i);if(n)return n}let a=n.validators;if(a===null)return;let o=t===0?e.join(bA):e.slice(t).join(bA),s=a.length;for(let e=0;e<s;e++){let t=a[e];if(t.validator(o))return t.classGroupId}},TA=e=>e.slice(1,-1).indexOf(`:`)===-1?void 0:(()=>{let t=e.slice(1,-1),n=t.indexOf(`:`),r=t.slice(0,n);return r?SA+r:void 0})(),EA=e=>{let{theme:t,classGroups:n}=e;return DA(n,t)},DA=(e,t)=>{let n=yA();for(let r in e){let i=e[r];OA(i,n,r,t)}return n},OA=(e,t,n,r)=>{let i=e.length;for(let a=0;a<i;a++){let i=e[a];kA(i,t,n,r)}},kA=(e,t,n,r)=>{if(typeof e==`string`){AA(e,t,n);return}if(typeof e==`function`){jA(e,t,n,r);return}MA(e,t,n,r)},AA=(e,t,n)=>{let r=e===``?t:NA(t,e);r.classGroupId=n},jA=(e,t,n,r)=>{if(PA(e)){OA(e(r),t,n,r);return}t.validators===null&&(t.validators=[]),t.validators.push(vA(n,e))},MA=(e,t,n,r)=>{let i=Object.entries(e),a=i.length;for(let e=0;e<a;e++){let[a,o]=i[e];OA(o,NA(t,a),n,r)}},NA=(e,t)=>{let n=e,r=t.split(bA),i=r.length;for(let e=0;e<i;e++){let t=r[e],i=n.nextPart.get(t);i||(i=yA(),n.nextPart.set(t,i)),n=i}return n},PA=e=>`isThemeGetter`in e&&e.isThemeGetter===!0,FA=e=>{if(e<1)return{get:()=>void 0,set:()=>{}};let t=0,n=Object.create(null),r=Object.create(null),i=(i,a)=>{n[i]=a,t++,t>e&&(t=0,r=n,n=Object.create(null))};return{get(e){let t=n[e];if(t!==void 0)return t;if((t=r[e])!==void 0)return i(e,t),t},set(e,t){e in n?n[e]=t:i(e,t)}}},IA=`!`,LA=`:`,RA=[],zA=(e,t,n,r,i)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:r,isExternal:i}),BA=e=>{let{prefix:t,experimentalParseClassName:n}=e,r=e=>{let t=[],n=0,r=0,i=0,a,o=e.length;for(let s=0;s<o;s++){let o=e[s];if(n===0&&r===0){if(o===LA){t.push(e.slice(i,s)),i=s+1;continue}if(o===`/`){a=s;continue}}o===`[`?n++:o===`]`?n--:o===`(`?r++:o===`)`&&r--}let s=t.length===0?e:e.slice(i),c=s,l=!1;s.endsWith(IA)?(c=s.slice(0,-1),l=!0):s.startsWith(IA)&&(c=s.slice(1),l=!0);let u=a&&a>i?a-i:void 0;return zA(t,l,c,u)};if(t){let e=t+LA,n=r;r=t=>t.startsWith(e)?n(t.slice(e.length)):zA(RA,!1,t,void 0,!0)}if(n){let e=r;r=t=>n({className:t,parseClassName:e})}return r},VA=e=>{let t=new Map;return e.orderSensitiveModifiers.forEach((e,n)=>{t.set(e,1e6+n)}),e=>{let n=[],r=[];for(let i=0;i<e.length;i++){let a=e[i],o=a[0]===`[`,s=t.has(a);o||s?(r.length>0&&(r.sort(),n.push(...r),r=[]),n.push(a)):r.push(a)}return r.length>0&&(r.sort(),n.push(...r)),n}},HA=e=>({cache:FA(e.cacheSize),parseClassName:BA(e),sortModifiers:VA(e),...CA(e)}),UA=/\s+/,WA=(e,t)=>{let{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:i,sortModifiers:a}=t,o=[],s=e.trim().split(UA),c=``;for(let e=s.length-1;e>=0;--e){let t=s[e],{isExternal:l,modifiers:u,hasImportantModifier:d,baseClassName:f,maybePostfixModifierPosition:p}=n(t);if(l){c=t+(c.length>0?` `+c:c);continue}let m=!!p,h=r(m?f.substring(0,p):f);if(!h){if(!m){c=t+(c.length>0?` `+c:c);continue}if(h=r(f),!h){c=t+(c.length>0?` `+c:c);continue}m=!1}let g=u.length===0?``:u.length===1?u[0]:a(u).join(`:`),_=d?g+IA:g,v=_+h;if(o.indexOf(v)>-1)continue;o.push(v);let y=i(h,m);for(let e=0;e<y.length;++e){let t=y[e];o.push(_+t)}c=t+(c.length>0?` `+c:c)}return c},GA=(...e)=>{let t=0,n,r,i=``;for(;t<e.length;)(n=e[t++])&&(r=KA(n))&&(i&&(i+=` `),i+=r);return i},KA=e=>{if(typeof e==`string`)return e;let t,n=``;for(let r=0;r<e.length;r++)e[r]&&(t=KA(e[r]))&&(n&&(n+=` `),n+=t);return n},qA=(e,...t)=>{let n,r,i,a,o=o=>(n=HA(t.reduce((e,t)=>t(e),e())),r=n.cache.get,i=n.cache.set,a=s,s(o)),s=e=>{let t=r(e);if(t)return t;let a=WA(e,n);return i(e,a),a};return a=o,(...e)=>a(GA(...e))},JA=[],YA=e=>{let t=t=>t[e]||JA;return t.isThemeGetter=!0,t},XA=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,ZA=/^\((?:(\w[\w-]*):)?(.+)\)$/i,QA=/^\d+\/\d+$/,$A=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,ej=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,tj=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,nj=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,rj=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,ij=e=>QA.test(e),aj=e=>!!e&&!Number.isNaN(Number(e)),oj=e=>!!e&&Number.isInteger(Number(e)),sj=e=>e.endsWith(`%`)&&aj(e.slice(0,-1)),cj=e=>$A.test(e),lj=()=>!0,uj=e=>ej.test(e)&&!tj.test(e),dj=()=>!1,fj=e=>nj.test(e),pj=e=>rj.test(e),mj=e=>!Q(e)&&!$(e),hj=e=>Dj(e,jj,dj),Q=e=>XA.test(e),gj=e=>Dj(e,Mj,uj),_j=e=>Dj(e,Nj,aj),vj=e=>Dj(e,kj,dj),yj=e=>Dj(e,Aj,pj),bj=e=>Dj(e,Fj,fj),$=e=>ZA.test(e),xj=e=>Oj(e,Mj),Sj=e=>Oj(e,Pj),Cj=e=>Oj(e,kj),wj=e=>Oj(e,jj),Tj=e=>Oj(e,Aj),Ej=e=>Oj(e,Fj,!0),Dj=(e,t,n)=>{let r=XA.exec(e);return r?r[1]?t(r[1]):n(r[2]):!1},Oj=(e,t,n=!1)=>{let r=ZA.exec(e);return r?r[1]?t(r[1]):n:!1},kj=e=>e===`position`||e===`percentage`,Aj=e=>e===`image`||e===`url`,jj=e=>e===`length`||e===`size`||e===`bg-size`,Mj=e=>e===`length`,Nj=e=>e===`number`,Pj=e=>e===`family-name`,Fj=e=>e===`shadow`,Ij=qA(()=>{let e=YA(`color`),t=YA(`font`),n=YA(`text`),r=YA(`font-weight`),i=YA(`tracking`),a=YA(`leading`),o=YA(`breakpoint`),s=YA(`container`),c=YA(`spacing`),l=YA(`radius`),u=YA(`shadow`),d=YA(`inset-shadow`),f=YA(`text-shadow`),p=YA(`drop-shadow`),m=YA(`blur`),h=YA(`perspective`),g=YA(`aspect`),_=YA(`ease`),v=YA(`animate`),y=()=>[`auto`,`avoid`,`all`,`avoid-page`,`page`,`left`,`right`,`column`],b=()=>[`center`,`top`,`bottom`,`left`,`right`,`top-left`,`left-top`,`top-right`,`right-top`,`bottom-right`,`right-bottom`,`bottom-left`,`left-bottom`],x=()=>[...b(),$,Q],S=()=>[`auto`,`hidden`,`clip`,`visible`,`scroll`],C=()=>[`auto`,`contain`,`none`],w=()=>[$,Q,c],T=()=>[ij,`full`,`auto`,...w()],E=()=>[oj,`none`,`subgrid`,$,Q],D=()=>[`auto`,{span:[`full`,oj,$,Q]},oj,$,Q],O=()=>[oj,`auto`,$,Q],k=()=>[`auto`,`min`,`max`,`fr`,$,Q],A=()=>[`start`,`end`,`center`,`between`,`around`,`evenly`,`stretch`,`baseline`,`center-safe`,`end-safe`],j=()=>[`start`,`end`,`center`,`stretch`,`center-safe`,`end-safe`],M=()=>[`auto`,...w()],N=()=>[ij,`auto`,`full`,`dvw`,`dvh`,`lvw`,`lvh`,`svw`,`svh`,`min`,`max`,`fit`,...w()],P=()=>[e,$,Q],F=()=>[...b(),Cj,vj,{position:[$,Q]}],I=()=>[`no-repeat`,{repeat:[``,`x`,`y`,`space`,`round`]}],L=()=>[`auto`,`cover`,`contain`,wj,hj,{size:[$,Q]}],R=()=>[sj,xj,gj],z=()=>[``,`none`,`full`,l,$,Q],B=()=>[``,aj,xj,gj],V=()=>[`solid`,`dashed`,`dotted`,`double`],H=()=>[`normal`,`multiply`,`screen`,`overlay`,`darken`,`lighten`,`color-dodge`,`color-burn`,`hard-light`,`soft-light`,`difference`,`exclusion`,`hue`,`saturation`,`color`,`luminosity`],U=()=>[aj,sj,Cj,vj],W=()=>[``,`none`,m,$,Q],G=()=>[`none`,aj,$,Q],ee=()=>[`none`,aj,$,Q],K=()=>[aj,$,Q],te=()=>[ij,`full`,...w()];return{cacheSize:500,theme:{animate:[`spin`,`ping`,`pulse`,`bounce`],aspect:[`video`],blur:[cj],breakpoint:[cj],color:[lj],container:[cj],"drop-shadow":[cj],ease:[`in`,`out`,`in-out`],font:[mj],"font-weight":[`thin`,`extralight`,`light`,`normal`,`medium`,`semibold`,`bold`,`extrabold`,`black`],"inset-shadow":[cj],leading:[`none`,`tight`,`snug`,`normal`,`relaxed`,`loose`],perspective:[`dramatic`,`near`,`normal`,`midrange`,`distant`,`none`],radius:[cj],shadow:[cj],spacing:[`px`,aj],text:[cj],"text-shadow":[cj],tracking:[`tighter`,`tight`,`normal`,`wide`,`wider`,`widest`]},classGroups:{aspect:[{aspect:[`auto`,`square`,ij,Q,$,g]}],container:[`container`],columns:[{columns:[aj,Q,$,s]}],"break-after":[{"break-after":y()}],"break-before":[{"break-before":y()}],"break-inside":[{"break-inside":[`auto`,`avoid`,`avoid-page`,`avoid-column`]}],"box-decoration":[{"box-decoration":[`slice`,`clone`]}],box:[{box:[`border`,`content`]}],display:[`block`,`inline-block`,`inline`,`flex`,`inline-flex`,`table`,`inline-table`,`table-caption`,`table-cell`,`table-column`,`table-column-group`,`table-footer-group`,`table-header-group`,`table-row-group`,`table-row`,`flow-root`,`grid`,`inline-grid`,`contents`,`list-item`,`hidden`],sr:[`sr-only`,`not-sr-only`],float:[{float:[`right`,`left`,`none`,`start`,`end`]}],clear:[{clear:[`left`,`right`,`both`,`none`,`start`,`end`]}],isolation:[`isolate`,`isolation-auto`],"object-fit":[{object:[`contain`,`cover`,`fill`,`none`,`scale-down`]}],"object-position":[{object:x()}],overflow:[{overflow:S()}],"overflow-x":[{"overflow-x":S()}],"overflow-y":[{"overflow-y":S()}],overscroll:[{overscroll:C()}],"overscroll-x":[{"overscroll-x":C()}],"overscroll-y":[{"overscroll-y":C()}],position:[`static`,`fixed`,`absolute`,`relative`,`sticky`],inset:[{inset:T()}],"inset-x":[{"inset-x":T()}],"inset-y":[{"inset-y":T()}],start:[{start:T()}],end:[{end:T()}],top:[{top:T()}],right:[{right:T()}],bottom:[{bottom:T()}],left:[{left:T()}],visibility:[`visible`,`invisible`,`collapse`],z:[{z:[oj,`auto`,$,Q]}],basis:[{basis:[ij,`full`,`auto`,s,...w()]}],"flex-direction":[{flex:[`row`,`row-reverse`,`col`,`col-reverse`]}],"flex-wrap":[{flex:[`nowrap`,`wrap`,`wrap-reverse`]}],flex:[{flex:[aj,ij,`auto`,`initial`,`none`,Q]}],grow:[{grow:[``,aj,$,Q]}],shrink:[{shrink:[``,aj,$,Q]}],order:[{order:[oj,`first`,`last`,`none`,$,Q]}],"grid-cols":[{"grid-cols":E()}],"col-start-end":[{col:D()}],"col-start":[{"col-start":O()}],"col-end":[{"col-end":O()}],"grid-rows":[{"grid-rows":E()}],"row-start-end":[{row:D()}],"row-start":[{"row-start":O()}],"row-end":[{"row-end":O()}],"grid-flow":[{"grid-flow":[`row`,`col`,`dense`,`row-dense`,`col-dense`]}],"auto-cols":[{"auto-cols":k()}],"auto-rows":[{"auto-rows":k()}],gap:[{gap:w()}],"gap-x":[{"gap-x":w()}],"gap-y":[{"gap-y":w()}],"justify-content":[{justify:[...A(),`normal`]}],"justify-items":[{"justify-items":[...j(),`normal`]}],"justify-self":[{"justify-self":[`auto`,...j()]}],"align-content":[{content:[`normal`,...A()]}],"align-items":[{items:[...j(),{baseline:[``,`last`]}]}],"align-self":[{self:[`auto`,...j(),{baseline:[``,`last`]}]}],"place-content":[{"place-content":A()}],"place-items":[{"place-items":[...j(),`baseline`]}],"place-self":[{"place-self":[`auto`,...j()]}],p:[{p:w()}],px:[{px:w()}],py:[{py:w()}],ps:[{ps:w()}],pe:[{pe:w()}],pt:[{pt:w()}],pr:[{pr:w()}],pb:[{pb:w()}],pl:[{pl:w()}],m:[{m:M()}],mx:[{mx:M()}],my:[{my:M()}],ms:[{ms:M()}],me:[{me:M()}],mt:[{mt:M()}],mr:[{mr:M()}],mb:[{mb:M()}],ml:[{ml:M()}],"space-x":[{"space-x":w()}],"space-x-reverse":[`space-x-reverse`],"space-y":[{"space-y":w()}],"space-y-reverse":[`space-y-reverse`],size:[{size:N()}],w:[{w:[s,`screen`,...N()]}],"min-w":[{"min-w":[s,`screen`,`none`,...N()]}],"max-w":[{"max-w":[s,`screen`,`none`,`prose`,{screen:[o]},...N()]}],h:[{h:[`screen`,`lh`,...N()]}],"min-h":[{"min-h":[`screen`,`lh`,`none`,...N()]}],"max-h":[{"max-h":[`screen`,`lh`,...N()]}],"font-size":[{text:[`base`,n,xj,gj]}],"font-smoothing":[`antialiased`,`subpixel-antialiased`],"font-style":[`italic`,`not-italic`],"font-weight":[{font:[r,$,_j]}],"font-stretch":[{"font-stretch":[`ultra-condensed`,`extra-condensed`,`condensed`,`semi-condensed`,`normal`,`semi-expanded`,`expanded`,`extra-expanded`,`ultra-expanded`,sj,Q]}],"font-family":[{font:[Sj,Q,t]}],"fvn-normal":[`normal-nums`],"fvn-ordinal":[`ordinal`],"fvn-slashed-zero":[`slashed-zero`],"fvn-figure":[`lining-nums`,`oldstyle-nums`],"fvn-spacing":[`proportional-nums`,`tabular-nums`],"fvn-fraction":[`diagonal-fractions`,`stacked-fractions`],tracking:[{tracking:[i,$,Q]}],"line-clamp":[{"line-clamp":[aj,`none`,$,_j]}],leading:[{leading:[a,...w()]}],"list-image":[{"list-image":[`none`,$,Q]}],"list-style-position":[{list:[`inside`,`outside`]}],"list-style-type":[{list:[`disc`,`decimal`,`none`,$,Q]}],"text-alignment":[{text:[`left`,`center`,`right`,`justify`,`start`,`end`]}],"placeholder-color":[{placeholder:P()}],"text-color":[{text:P()}],"text-decoration":[`underline`,`overline`,`line-through`,`no-underline`],"text-decoration-style":[{decoration:[...V(),`wavy`]}],"text-decoration-thickness":[{decoration:[aj,`from-font`,`auto`,$,gj]}],"text-decoration-color":[{decoration:P()}],"underline-offset":[{"underline-offset":[aj,`auto`,$,Q]}],"text-transform":[`uppercase`,`lowercase`,`capitalize`,`normal-case`],"text-overflow":[`truncate`,`text-ellipsis`,`text-clip`],"text-wrap":[{text:[`wrap`,`nowrap`,`balance`,`pretty`]}],indent:[{indent:w()}],"vertical-align":[{align:[`baseline`,`top`,`middle`,`bottom`,`text-top`,`text-bottom`,`sub`,`super`,$,Q]}],whitespace:[{whitespace:[`normal`,`nowrap`,`pre`,`pre-line`,`pre-wrap`,`break-spaces`]}],break:[{break:[`normal`,`words`,`all`,`keep`]}],wrap:[{wrap:[`break-word`,`anywhere`,`normal`]}],hyphens:[{hyphens:[`none`,`manual`,`auto`]}],content:[{content:[`none`,$,Q]}],"bg-attachment":[{bg:[`fixed`,`local`,`scroll`]}],"bg-clip":[{"bg-clip":[`border`,`padding`,`content`,`text`]}],"bg-origin":[{"bg-origin":[`border`,`padding`,`content`]}],"bg-position":[{bg:F()}],"bg-repeat":[{bg:I()}],"bg-size":[{bg:L()}],"bg-image":[{bg:[`none`,{linear:[{to:[`t`,`tr`,`r`,`br`,`b`,`bl`,`l`,`tl`]},oj,$,Q],radial:[``,$,Q],conic:[oj,$,Q]},Tj,yj]}],"bg-color":[{bg:P()}],"gradient-from-pos":[{from:R()}],"gradient-via-pos":[{via:R()}],"gradient-to-pos":[{to:R()}],"gradient-from":[{from:P()}],"gradient-via":[{via:P()}],"gradient-to":[{to:P()}],rounded:[{rounded:z()}],"rounded-s":[{"rounded-s":z()}],"rounded-e":[{"rounded-e":z()}],"rounded-t":[{"rounded-t":z()}],"rounded-r":[{"rounded-r":z()}],"rounded-b":[{"rounded-b":z()}],"rounded-l":[{"rounded-l":z()}],"rounded-ss":[{"rounded-ss":z()}],"rounded-se":[{"rounded-se":z()}],"rounded-ee":[{"rounded-ee":z()}],"rounded-es":[{"rounded-es":z()}],"rounded-tl":[{"rounded-tl":z()}],"rounded-tr":[{"rounded-tr":z()}],"rounded-br":[{"rounded-br":z()}],"rounded-bl":[{"rounded-bl":z()}],"border-w":[{border:B()}],"border-w-x":[{"border-x":B()}],"border-w-y":[{"border-y":B()}],"border-w-s":[{"border-s":B()}],"border-w-e":[{"border-e":B()}],"border-w-t":[{"border-t":B()}],"border-w-r":[{"border-r":B()}],"border-w-b":[{"border-b":B()}],"border-w-l":[{"border-l":B()}],"divide-x":[{"divide-x":B()}],"divide-x-reverse":[`divide-x-reverse`],"divide-y":[{"divide-y":B()}],"divide-y-reverse":[`divide-y-reverse`],"border-style":[{border:[...V(),`hidden`,`none`]}],"divide-style":[{divide:[...V(),`hidden`,`none`]}],"border-color":[{border:P()}],"border-color-x":[{"border-x":P()}],"border-color-y":[{"border-y":P()}],"border-color-s":[{"border-s":P()}],"border-color-e":[{"border-e":P()}],"border-color-t":[{"border-t":P()}],"border-color-r":[{"border-r":P()}],"border-color-b":[{"border-b":P()}],"border-color-l":[{"border-l":P()}],"divide-color":[{divide:P()}],"outline-style":[{outline:[...V(),`none`,`hidden`]}],"outline-offset":[{"outline-offset":[aj,$,Q]}],"outline-w":[{outline:[``,aj,xj,gj]}],"outline-color":[{outline:P()}],shadow:[{shadow:[``,`none`,u,Ej,bj]}],"shadow-color":[{shadow:P()}],"inset-shadow":[{"inset-shadow":[`none`,d,Ej,bj]}],"inset-shadow-color":[{"inset-shadow":P()}],"ring-w":[{ring:B()}],"ring-w-inset":[`ring-inset`],"ring-color":[{ring:P()}],"ring-offset-w":[{"ring-offset":[aj,gj]}],"ring-offset-color":[{"ring-offset":P()}],"inset-ring-w":[{"inset-ring":B()}],"inset-ring-color":[{"inset-ring":P()}],"text-shadow":[{"text-shadow":[`none`,f,Ej,bj]}],"text-shadow-color":[{"text-shadow":P()}],opacity:[{opacity:[aj,$,Q]}],"mix-blend":[{"mix-blend":[...H(),`plus-darker`,`plus-lighter`]}],"bg-blend":[{"bg-blend":H()}],"mask-clip":[{"mask-clip":[`border`,`padding`,`content`,`fill`,`stroke`,`view`]},`mask-no-clip`],"mask-composite":[{mask:[`add`,`subtract`,`intersect`,`exclude`]}],"mask-image-linear-pos":[{"mask-linear":[aj]}],"mask-image-linear-from-pos":[{"mask-linear-from":U()}],"mask-image-linear-to-pos":[{"mask-linear-to":U()}],"mask-image-linear-from-color":[{"mask-linear-from":P()}],"mask-image-linear-to-color":[{"mask-linear-to":P()}],"mask-image-t-from-pos":[{"mask-t-from":U()}],"mask-image-t-to-pos":[{"mask-t-to":U()}],"mask-image-t-from-color":[{"mask-t-from":P()}],"mask-image-t-to-color":[{"mask-t-to":P()}],"mask-image-r-from-pos":[{"mask-r-from":U()}],"mask-image-r-to-pos":[{"mask-r-to":U()}],"mask-image-r-from-color":[{"mask-r-from":P()}],"mask-image-r-to-color":[{"mask-r-to":P()}],"mask-image-b-from-pos":[{"mask-b-from":U()}],"mask-image-b-to-pos":[{"mask-b-to":U()}],"mask-image-b-from-color":[{"mask-b-from":P()}],"mask-image-b-to-color":[{"mask-b-to":P()}],"mask-image-l-from-pos":[{"mask-l-from":U()}],"mask-image-l-to-pos":[{"mask-l-to":U()}],"mask-image-l-from-color":[{"mask-l-from":P()}],"mask-image-l-to-color":[{"mask-l-to":P()}],"mask-image-x-from-pos":[{"mask-x-from":U()}],"mask-image-x-to-pos":[{"mask-x-to":U()}],"mask-image-x-from-color":[{"mask-x-from":P()}],"mask-image-x-to-color":[{"mask-x-to":P()}],"mask-image-y-from-pos":[{"mask-y-from":U()}],"mask-image-y-to-pos":[{"mask-y-to":U()}],"mask-image-y-from-color":[{"mask-y-from":P()}],"mask-image-y-to-color":[{"mask-y-to":P()}],"mask-image-radial":[{"mask-radial":[$,Q]}],"mask-image-radial-from-pos":[{"mask-radial-from":U()}],"mask-image-radial-to-pos":[{"mask-radial-to":U()}],"mask-image-radial-from-color":[{"mask-radial-from":P()}],"mask-image-radial-to-color":[{"mask-radial-to":P()}],"mask-image-radial-shape":[{"mask-radial":[`circle`,`ellipse`]}],"mask-image-radial-size":[{"mask-radial":[{closest:[`side`,`corner`],farthest:[`side`,`corner`]}]}],"mask-image-radial-pos":[{"mask-radial-at":b()}],"mask-image-conic-pos":[{"mask-conic":[aj]}],"mask-image-conic-from-pos":[{"mask-conic-from":U()}],"mask-image-conic-to-pos":[{"mask-conic-to":U()}],"mask-image-conic-from-color":[{"mask-conic-from":P()}],"mask-image-conic-to-color":[{"mask-conic-to":P()}],"mask-mode":[{mask:[`alpha`,`luminance`,`match`]}],"mask-origin":[{"mask-origin":[`border`,`padding`,`content`,`fill`,`stroke`,`view`]}],"mask-position":[{mask:F()}],"mask-repeat":[{mask:I()}],"mask-size":[{mask:L()}],"mask-type":[{"mask-type":[`alpha`,`luminance`]}],"mask-image":[{mask:[`none`,$,Q]}],filter:[{filter:[``,`none`,$,Q]}],blur:[{blur:W()}],brightness:[{brightness:[aj,$,Q]}],contrast:[{contrast:[aj,$,Q]}],"drop-shadow":[{"drop-shadow":[``,`none`,p,Ej,bj]}],"drop-shadow-color":[{"drop-shadow":P()}],grayscale:[{grayscale:[``,aj,$,Q]}],"hue-rotate":[{"hue-rotate":[aj,$,Q]}],invert:[{invert:[``,aj,$,Q]}],saturate:[{saturate:[aj,$,Q]}],sepia:[{sepia:[``,aj,$,Q]}],"backdrop-filter":[{"backdrop-filter":[``,`none`,$,Q]}],"backdrop-blur":[{"backdrop-blur":W()}],"backdrop-brightness":[{"backdrop-brightness":[aj,$,Q]}],"backdrop-contrast":[{"backdrop-contrast":[aj,$,Q]}],"backdrop-grayscale":[{"backdrop-grayscale":[``,aj,$,Q]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[aj,$,Q]}],"backdrop-invert":[{"backdrop-invert":[``,aj,$,Q]}],"backdrop-opacity":[{"backdrop-opacity":[aj,$,Q]}],"backdrop-saturate":[{"backdrop-saturate":[aj,$,Q]}],"backdrop-sepia":[{"backdrop-sepia":[``,aj,$,Q]}],"border-collapse":[{border:[`collapse`,`separate`]}],"border-spacing":[{"border-spacing":w()}],"border-spacing-x":[{"border-spacing-x":w()}],"border-spacing-y":[{"border-spacing-y":w()}],"table-layout":[{table:[`auto`,`fixed`]}],caption:[{caption:[`top`,`bottom`]}],transition:[{transition:[``,`all`,`colors`,`opacity`,`shadow`,`transform`,`none`,$,Q]}],"transition-behavior":[{transition:[`normal`,`discrete`]}],duration:[{duration:[aj,`initial`,$,Q]}],ease:[{ease:[`linear`,`initial`,_,$,Q]}],delay:[{delay:[aj,$,Q]}],animate:[{animate:[`none`,v,$,Q]}],backface:[{backface:[`hidden`,`visible`]}],perspective:[{perspective:[h,$,Q]}],"perspective-origin":[{"perspective-origin":x()}],rotate:[{rotate:G()}],"rotate-x":[{"rotate-x":G()}],"rotate-y":[{"rotate-y":G()}],"rotate-z":[{"rotate-z":G()}],scale:[{scale:ee()}],"scale-x":[{"scale-x":ee()}],"scale-y":[{"scale-y":ee()}],"scale-z":[{"scale-z":ee()}],"scale-3d":[`scale-3d`],skew:[{skew:K()}],"skew-x":[{"skew-x":K()}],"skew-y":[{"skew-y":K()}],transform:[{transform:[$,Q,``,`none`,`gpu`,`cpu`]}],"transform-origin":[{origin:x()}],"transform-style":[{transform:[`3d`,`flat`]}],translate:[{translate:te()}],"translate-x":[{"translate-x":te()}],"translate-y":[{"translate-y":te()}],"translate-z":[{"translate-z":te()}],"translate-none":[`translate-none`],accent:[{accent:P()}],appearance:[{appearance:[`none`,`auto`]}],"caret-color":[{caret:P()}],"color-scheme":[{scheme:[`normal`,`dark`,`light`,`light-dark`,`only-dark`,`only-light`]}],cursor:[{cursor:[`auto`,`default`,`pointer`,`wait`,`text`,`move`,`help`,`not-allowed`,`none`,`context-menu`,`progress`,`cell`,`crosshair`,`vertical-text`,`alias`,`copy`,`no-drop`,`grab`,`grabbing`,`all-scroll`,`col-resize`,`row-resize`,`n-resize`,`e-resize`,`s-resize`,`w-resize`,`ne-resize`,`nw-resize`,`se-resize`,`sw-resize`,`ew-resize`,`ns-resize`,`nesw-resize`,`nwse-resize`,`zoom-in`,`zoom-out`,$,Q]}],"field-sizing":[{"field-sizing":[`fixed`,`content`]}],"pointer-events":[{"pointer-events":[`auto`,`none`]}],resize:[{resize:[`none`,``,`y`,`x`]}],"scroll-behavior":[{scroll:[`auto`,`smooth`]}],"scroll-m":[{"scroll-m":w()}],"scroll-mx":[{"scroll-mx":w()}],"scroll-my":[{"scroll-my":w()}],"scroll-ms":[{"scroll-ms":w()}],"scroll-me":[{"scroll-me":w()}],"scroll-mt":[{"scroll-mt":w()}],"scroll-mr":[{"scroll-mr":w()}],"scroll-mb":[{"scroll-mb":w()}],"scroll-ml":[{"scroll-ml":w()}],"scroll-p":[{"scroll-p":w()}],"scroll-px":[{"scroll-px":w()}],"scroll-py":[{"scroll-py":w()}],"scroll-ps":[{"scroll-ps":w()}],"scroll-pe":[{"scroll-pe":w()}],"scroll-pt":[{"scroll-pt":w()}],"scroll-pr":[{"scroll-pr":w()}],"scroll-pb":[{"scroll-pb":w()}],"scroll-pl":[{"scroll-pl":w()}],"snap-align":[{snap:[`start`,`end`,`center`,`align-none`]}],"snap-stop":[{snap:[`normal`,`always`]}],"snap-type":[{snap:[`none`,`x`,`y`,`both`]}],"snap-strictness":[{snap:[`mandatory`,`proximity`]}],touch:[{touch:[`auto`,`none`,`manipulation`]}],"touch-x":[{"touch-pan":[`x`,`left`,`right`]}],"touch-y":[{"touch-pan":[`y`,`up`,`down`]}],"touch-pz":[`touch-pinch-zoom`],select:[{select:[`none`,`text`,`all`,`auto`]}],"will-change":[{"will-change":[`auto`,`scroll`,`contents`,`transform`,$,Q]}],fill:[{fill:[`none`,...P()]}],"stroke-w":[{stroke:[aj,xj,gj,_j]}],stroke:[{stroke:[`none`,...P()]}],"forced-color-adjust":[{"forced-color-adjust":[`auto`,`none`]}]},conflictingClassGroups:{overflow:[`overflow-x`,`overflow-y`],overscroll:[`overscroll-x`,`overscroll-y`],inset:[`inset-x`,`inset-y`,`start`,`end`,`top`,`right`,`bottom`,`left`],"inset-x":[`right`,`left`],"inset-y":[`top`,`bottom`],flex:[`basis`,`grow`,`shrink`],gap:[`gap-x`,`gap-y`],p:[`px`,`py`,`ps`,`pe`,`pt`,`pr`,`pb`,`pl`],px:[`pr`,`pl`],py:[`pt`,`pb`],m:[`mx`,`my`,`ms`,`me`,`mt`,`mr`,`mb`,`ml`],mx:[`mr`,`ml`],my:[`mt`,`mb`],size:[`w`,`h`],"font-size":[`leading`],"fvn-normal":[`fvn-ordinal`,`fvn-slashed-zero`,`fvn-figure`,`fvn-spacing`,`fvn-fraction`],"fvn-ordinal":[`fvn-normal`],"fvn-slashed-zero":[`fvn-normal`],"fvn-figure":[`fvn-normal`],"fvn-spacing":[`fvn-normal`],"fvn-fraction":[`fvn-normal`],"line-clamp":[`display`,`overflow`],rounded:[`rounded-s`,`rounded-e`,`rounded-t`,`rounded-r`,`rounded-b`,`rounded-l`,`rounded-ss`,`rounded-se`,`rounded-ee`,`rounded-es`,`rounded-tl`,`rounded-tr`,`rounded-br`,`rounded-bl`],"rounded-s":[`rounded-ss`,`rounded-es`],"rounded-e":[`rounded-se`,`rounded-ee`],"rounded-t":[`rounded-tl`,`rounded-tr`],"rounded-r":[`rounded-tr`,`rounded-br`],"rounded-b":[`rounded-br`,`rounded-bl`],"rounded-l":[`rounded-tl`,`rounded-bl`],"border-spacing":[`border-spacing-x`,`border-spacing-y`],"border-w":[`border-w-x`,`border-w-y`,`border-w-s`,`border-w-e`,`border-w-t`,`border-w-r`,`border-w-b`,`border-w-l`],"border-w-x":[`border-w-r`,`border-w-l`],"border-w-y":[`border-w-t`,`border-w-b`],"border-color":[`border-color-x`,`border-color-y`,`border-color-s`,`border-color-e`,`border-color-t`,`border-color-r`,`border-color-b`,`border-color-l`],"border-color-x":[`border-color-r`,`border-color-l`],"border-color-y":[`border-color-t`,`border-color-b`],translate:[`translate-x`,`translate-y`,`translate-none`],"translate-none":[`translate`,`translate-x`,`translate-y`,`translate-z`],"scroll-m":[`scroll-mx`,`scroll-my`,`scroll-ms`,`scroll-me`,`scroll-mt`,`scroll-mr`,`scroll-mb`,`scroll-ml`],"scroll-mx":[`scroll-mr`,`scroll-ml`],"scroll-my":[`scroll-mt`,`scroll-mb`],"scroll-p":[`scroll-px`,`scroll-py`,`scroll-ps`,`scroll-pe`,`scroll-pt`,`scroll-pr`,`scroll-pb`,`scroll-pl`],"scroll-px":[`scroll-pr`,`scroll-pl`],"scroll-py":[`scroll-pt`,`scroll-pb`],touch:[`touch-x`,`touch-y`,`touch-pz`],"touch-x":[`touch`],"touch-y":[`touch`],"touch-pz":[`touch`]},conflictingClassGroupModifiers:{"font-size":[`leading`]},orderSensitiveModifiers:[`*`,`**`,`after`,`backdrop`,`before`,`details-content`,`file`,`first-letter`,`first-line`,`marker`,`placeholder`,`selection`]}});function Lj(...e){return Ij(gA(e))}function Rj({checked:e,onCheckedChange:t,disabled:n,className:r}){return(0,q.jsx)(pA,{checked:e,onCheckedChange:t,disabled:n,className:Lj(`group relative inline-flex h-6 w-10 shrink-0 cursor-pointer items-center rounded-full transition-colors`,`bg-border data-[checked]:bg-accent`,`focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent focus-visible:ring-offset-2 focus-visible:ring-offset-bg-base`,`disabled:cursor-not-allowed disabled:opacity-50`,r),children:(0,q.jsx)(mA,{className:Lj(`pointer-events-none block size-4 rounded-full bg-white shadow-sm transition-transform`,`translate-x-1 group-data-[checked]:translate-x-5`)})})}var zj=null,Bj=!1,Vj={},Hj=500;function Uj(){if(typeof window>`u`)return null;if(zj?.state===`closed`&&(zj=null),!zj){let e=window.AudioContext??window.webkitAudioContext;if(!e)return null;zj=new e}return zj}function Wj(){zj&&=(zj.close().catch(()=>{}),null),Uj()}function Gj(){return Bj}function Kj(){zj&&(Wj(),Bj=!0)}if(typeof window<`u`){window.addEventListener(`pageshow`,e=>{e.persisted&&Kj()}),document.addEventListener(`visibilitychange`,()=>{document.visibilityState===`visible`&&Kj()});let e=Date.now();setInterval(()=>{let t=Date.now();t-e>15e3&&Kj(),e=t},5e3)}async function qj(){let e=Uj();e&&e.state===`suspended`&&await e.resume().catch(()=>{}),Bj=!1}async function Jj(e){e.state===`suspended`&&await e.resume().catch(()=>{})}async function Yj(e){let t=Uj();if(!t||(await Jj(t),t.state!==`running`))return;let{frequencies:n,durationMs:r,attackMs:i,peakGain:a,type:o=`sine`}=e,s=t.currentTime,c=r/1e3,l=i/1e3,u=t.createGain();u.connect(t.destination);let d=s+c*.7;u.gain.setValueAtTime(0,s),u.gain.linearRampToValueAtTime(a,s+l),u.gain.setValueAtTime(a,d),u.gain.linearRampToValueAtTime(0,s+c);let f=n.map(e=>{let n=t.createOscillator();return n.type=o,n.frequency.setValueAtTime(e,s),n.connect(u),n});for(let e of f)e.start(s),e.stop(s+c);let p=f[f.length-1];p.onended=()=>{for(let e of f)e.disconnect();u.disconnect()}}async function Xj(){let e=Date.now();if(!(e-(Vj.permission||0)<Hj)){Vj.permission=e;try{await Yj({frequencies:[880],durationMs:150,attackMs:5,peakGain:.15,type:`sine`})}catch{}}}async function Zj(){let e=Date.now();if(!(e-(Vj.idle||0)<Hj)){Vj.idle=e;try{await Yj({frequencies:[440,550],durationMs:300,attackMs:10,peakGain:.08,type:`sine`})}catch{}}}function Qj({isOpen:e,onClose:t}){let n=G(e=>e.defaultProjectDir),r=G(e=>e.setDefaultProjectDir),i=G(e=>e.commandPresets),a=G(e=>e.setCommandPresets),o=G(e=>e.defaultPresetId),s=G(e=>e.setDefaultPresetId),c=G(e=>e.sessionSortMode),l=G(e=>e.setSessionSortMode),u=G(e=>e.sessionSortDirection),d=G(e=>e.setSessionSortDirection),f=G(e=>e.useWebGL),p=G(e=>e.setUseWebGL),m=G(e=>e.fontSize),h=G(e=>e.setFontSize),g=G(e=>e.lineHeight),_=G(e=>e.setLineHeight),v=G(e=>e.letterSpacing),y=G(e=>e.setLetterSpacing),b=G(e=>e.fontOption),S=G(e=>e.setFontOption),C=G(e=>e.customFontFamily),w=G(e=>e.setCustomFontFamily),T=G(e=>e.shortcutModifier),E=G(e=>e.setShortcutModifier),D=G(e=>e.showProjectName),O=G(e=>e.setShowProjectName),k=G(e=>e.showLastUserMessage),A=G(e=>e.setShowLastUserMessage),j=G(e=>e.showSessionIdPrefix),M=G(e=>e.setShowSessionIdPrefix),N=ZD(e=>e.theme),F=ZD(e=>e.setTheme),I=G(e=>e.soundOnPermission),R=G(e=>e.setSoundOnPermission),z=G(e=>e.soundOnIdle),B=G(e=>e.setSoundOnIdle),[V,H]=(0,x.useState)(n),[U,W]=(0,x.useState)(i),[ee,K]=(0,x.useState)(o),[te,ne]=(0,x.useState)(c),[re,ie]=(0,x.useState)(u),[ae,oe]=(0,x.useState)(f),[se,ce]=(0,x.useState)(m),[le,ue]=(0,x.useState)(g),[de,fe]=(0,x.useState)(v),[pe,me]=(0,x.useState)(b),[he,ge]=(0,x.useState)(C),[_e,ve]=(0,x.useState)(T),[ye,be]=(0,x.useState)(D),[xe,Se]=(0,x.useState)(k),[Ce,we]=(0,x.useState)(j),[Te,Ee]=(0,x.useState)(N),[De,Oe]=(0,x.useState)(I),[ke,Ae]=(0,x.useState)(z),[je,Me]=(0,x.useState)(!0),[Ne,Pe]=(0,x.useState)(!1),[Fe,Ie]=(0,x.useState)(!1),[Le,Re]=(0,x.useState)(!1),[ze,Be]=(0,x.useState)(24),[Ve,He]=(0,x.useState)(!1),[Ue,Ge]=(0,x.useState)(!1),[qe,Je]=(0,x.useState)(``),[Ye,Xe]=(0,x.useState)(``),[Ze,Qe]=(0,x.useState)(``),$e=(0,x.useRef)(null);if((0,x.useEffect)(()=>{if($e.current&&=(clearTimeout($e.current),null),e){if(H(n),W(i),K(o),ne(c),ie(u),oe(f),ce(m),ue(g),fe(v),me(b),ge(C),ve(T),be(D),Se(k),we(j),Ee(N),Oe(I),Ae(z),Ge(!1),Je(``),Xe(``),Qe(``),fetch(`/api/settings/tmux-mouse-mode`).then(e=>e.json()).then(e=>Me(e.enabled)).catch(()=>{}),fetch(`/api/settings/history-max-age-hours`).then(e=>e.json()).then(e=>Be(e.hours)).catch(()=>{}),fetch(`/api/settings/prefer-window-name`).then(e=>e.json()).then(e=>Ie(e.enabled)).catch(()=>{}),typeof document<`u`){let e=document.querySelector(`.xterm-helper-textarea`);e&&typeof e.setAttribute==`function`&&(typeof e.blur==`function`&&e.blur(),e.setAttribute(`disabled`,`true`))}}else typeof document<`u`&&($e.current=setTimeout(()=>{if(typeof document>`u`)return;let e=document.querySelector(`.xterm-helper-textarea`);e&&(e.removeAttribute(`disabled`),e.focus())},300));return()=>{$e.current&&=(clearTimeout($e.current),null)}},[i,o,n,c,u,f,m,g,v,b,C,T,D,k,j,N,I,z,e]),(0,x.useEffect)(()=>{if(!e||typeof window>`u`||typeof window.addEventListener!=`function`)return;let n=e=>{e.key===`Escape`&&(typeof e.stopPropagation==`function`&&e.stopPropagation(),t())};return window.addEventListener(`keydown`,n),()=>window.removeEventListener(`keydown`,n)},[e,t]),!e)return null;let et=e=>{e.preventDefault();let n=V.trim(),i=ae!==f;r(n||`~/Documents/GitHub`),a(U),s(ee),l(te),d(re),p(ae),h(se),_(le),y(de),S(pe),w(he),E(_e),O(ye),A(xe),M(Ce),F(Te),R(De),B(ke),t({webglChanged:i})},tt=(e,t)=>{W(n=>n.map(n=>n.id===e?{...n,...t}:n))},nt=e=>{let t=U.find(t=>t.id===e);if(!t||t.isBuiltIn)return;let n=U.filter(t=>t.id!==e);W(n),e===ee&&K(n[0]?.id||`claude`)},rt=()=>{if(!qe.trim()||!Ye.trim()||U.length>=50)return;let e={id:`custom-${Date.now()}-${Math.random().toString(36).slice(2,6)}`,label:qe.trim(),command:Ye.trim(),isBuiltIn:!1,agentType:Ze||void 0};W([...U,e]),Ge(!1),Je(``),Xe(``),Qe(``)},it=U.length<50,at=e=>{Pe(!0),Me(e),fetch(`/api/settings/tmux-mouse-mode`,{method:`PUT`,headers:{"Content-Type":`application/json`},body:JSON.stringify({enabled:e})}).then(e=>{if(!e.ok)throw Error(`HTTP ${e.status}`)}).catch(()=>Me(!e)).finally(()=>Pe(!1))},ot=e=>{Re(!0),Ie(e),fetch(`/api/settings/prefer-window-name`,{method:`PUT`,headers:{"Content-Type":`application/json`},body:JSON.stringify({enabled:e})}).then(e=>{if(!e.ok)throw Error(`HTTP ${e.status}`)}).catch(()=>Ie(!e)).finally(()=>Re(!1))},st=e=>{let t=ze;He(!0),Be(e),fetch(`/api/settings/history-max-age-hours`,{method:`PUT`,headers:{"Content-Type":`application/json`},body:JSON.stringify({hours:e})}).then(e=>{if(!e.ok)throw Error(`HTTP ${e.status}`)}).catch(()=>Be(t)).finally(()=>He(!1))};return(0,q.jsx)(`div`,{className:`fixed inset-0 z-50 flex items-center justify-center bg-black/60 p-4`,onClick:e=>{e.target===e.currentTarget&&t()},children:(0,q.jsxs)(`form`,{onSubmit:et,className:`w-full max-w-lg max-h-[90vh] flex flex-col border border-border bg-elevated`,children:[(0,q.jsxs)(`div`,{className:`p-6 pb-0`,children:[(0,q.jsx)(`h2`,{className:`text-sm font-semibold uppercase tracking-wider text-primary text-balance`,children:`Settings`}),(0,q.jsx)(`p`,{className:`mt-2 text-xs text-muted text-pretty`,children:`Configure default directory, command presets, and display options.`})]}),(0,q.jsx)(`div`,{className:`flex-1 overflow-y-auto px-6 pb-4`,children:(0,q.jsxs)(`div`,{className:`mt-5 space-y-4`,children:[(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`label`,{className:`mb-1.5 block text-xs text-secondary`,children:`Default Project Directory`}),(0,q.jsx)(`input`,{value:V,onChange:e=>H(e.target.value),placeholder:P,className:`input`,autoFocus:!0})]}),(0,q.jsxs)(`div`,{className:`border-t border-border pt-4`,children:[(0,q.jsxs)(`div`,{className:`flex items-center justify-between mb-2`,children:[(0,q.jsx)(`label`,{className:`text-xs text-secondary`,children:`Command Presets`}),(0,q.jsx)(`select`,{value:ee,onChange:e=>K(e.target.value),className:`input text-xs py-1 px-2 w-auto`,children:U.map(e=>(0,q.jsx)(`option`,{value:e.id,children:e.label},e.id))})]}),(0,q.jsx)(`p`,{className:`text-[10px] text-muted mb-3`,children:`Default preset is pre-selected when creating new sessions.`}),(0,q.jsx)(`div`,{className:`space-y-3`,children:U.map(e=>(0,q.jsxs)(`div`,{className:`border border-border p-3 space-y-2`,children:[(0,q.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,q.jsx)(`div`,{className:`flex items-center gap-2`,children:(0,q.jsx)(`input`,{value:e.label,onChange:t=>tt(e.id,{label:t.target.value}),className:`input text-sm py-1 px-2 w-32`,placeholder:`Label`})}),!e.isBuiltIn&&(0,q.jsx)(`button`,{type:`button`,onClick:()=>nt(e.id),className:`btn text-xs px-2 py-1 text-error hover:bg-error/10`,children:`Delete`})]}),(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`label`,{className:`text-[10px] text-muted block mb-1`,children:`Command`}),(0,q.jsx)(`input`,{value:e.command,onChange:t=>tt(e.id,{command:t.target.value}),className:`input text-xs py-1 px-2 font-mono w-full`,placeholder:`command --flags`})]}),!e.isBuiltIn&&(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`label`,{className:`text-[10px] text-muted block mb-1`,children:`Icon`}),(0,q.jsxs)(`select`,{value:e.agentType||``,onChange:t=>tt(e.id,{agentType:t.target.value||void 0}),className:`input text-xs py-1 px-2 w-auto`,children:[(0,q.jsx)(`option`,{value:``,children:`Terminal`}),(0,q.jsx)(`option`,{value:`claude`,children:`Claude`}),(0,q.jsx)(`option`,{value:`codex`,children:`Codex`})]})]})]},e.id))}),Ue?(0,q.jsxs)(`div`,{className:`mt-3 border border-border p-3 space-y-2`,children:[(0,q.jsx)(`div`,{className:`text-xs text-secondary mb-2`,children:`New Preset`}),(0,q.jsx)(`input`,{value:qe,onChange:e=>Je(e.target.value),className:`input text-xs py-1 px-2 w-full`,placeholder:`Label`}),(0,q.jsx)(`input`,{value:Ye,onChange:e=>Xe(e.target.value),className:`input text-xs py-1 px-2 font-mono w-full`,placeholder:`command --flags`}),(0,q.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,q.jsxs)(`select`,{value:Ze,onChange:e=>Qe(e.target.value),className:`input text-xs py-1 px-2 w-auto`,children:[(0,q.jsx)(`option`,{value:``,children:`Terminal Icon`}),(0,q.jsx)(`option`,{value:`claude`,children:`Claude Icon`}),(0,q.jsx)(`option`,{value:`codex`,children:`Codex Icon`})]}),(0,q.jsx)(`div`,{className:`flex-1`}),(0,q.jsx)(`button`,{type:`button`,onClick:()=>Ge(!1),className:`btn text-xs px-2 py-1`,children:`Cancel`}),(0,q.jsx)(`button`,{type:`button`,onClick:rt,disabled:!qe.trim()||!Ye.trim(),className:`btn btn-primary text-xs px-2 py-1`,children:`Add`})]})]}):(0,q.jsx)(`button`,{type:`button`,onClick:()=>Ge(!0),disabled:!it,className:`btn text-xs mt-3 w-full`,children:it?`+ Add Preset`:`Max 50 presets`})]}),(0,q.jsxs)(`div`,{className:`border-t border-border pt-4`,children:[(0,q.jsx)(`label`,{className:`mb-2 block text-xs text-secondary`,children:`Session List Order`}),(0,q.jsxs)(`div`,{className:`flex gap-2`,children:[(0,q.jsx)(`button`,{type:`button`,className:`btn flex-1 ${te===`created`?`btn-primary`:``}`,onClick:()=>ne(`created`),children:`Created`}),(0,q.jsx)(`button`,{type:`button`,className:`btn flex-1 ${te===`status`?`btn-primary`:``}`,onClick:()=>ne(`status`),children:`Status`}),(0,q.jsx)(`button`,{type:`button`,className:`btn flex-1 ${te===`manual`?`btn-primary`:``}`,onClick:()=>ne(`manual`),children:`Manual`})]}),(0,q.jsx)(`p`,{className:`mt-1.5 text-[10px] text-muted`,children:te===`status`?`Sessions auto-resort by status (waiting, working, unknown)`:te===`manual`?`Drag sessions to reorder manually`:`Sessions stay in creation order`})]}),te===`created`&&(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`label`,{className:`mb-2 block text-xs text-secondary`,children:`Sort Direction`}),(0,q.jsxs)(`div`,{className:`flex gap-2`,children:[(0,q.jsx)(`button`,{type:`button`,className:`btn flex-1 ${re===`desc`?`btn-primary`:``}`,onClick:()=>ie(`desc`),children:`Newest First`}),(0,q.jsx)(`button`,{type:`button`,className:`btn flex-1 ${re===`asc`?`btn-primary`:``}`,onClick:()=>ie(`asc`),children:`Oldest First`})]})]}),(0,q.jsxs)(`div`,{className:`border-t border-border pt-4 space-y-3`,children:[(0,q.jsx)(`label`,{className:`mb-1 block text-xs text-secondary`,children:`Session List Details`}),(0,q.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`div`,{className:`text-sm text-primary`,children:`Project Name`}),(0,q.jsx)(`div`,{className:`text-[10px] text-muted`,children:`Show the project folder name under each session.`})]}),(0,q.jsx)(Rj,{checked:ye,onCheckedChange:be})]}),(0,q.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`div`,{className:`text-sm text-primary`,children:`Last User Message`}),(0,q.jsx)(`div`,{className:`text-[10px] text-muted`,children:`Show the most recent user input next to the project name.`})]}),(0,q.jsx)(Rj,{checked:xe,onCheckedChange:Se})]}),(0,q.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`div`,{className:`text-sm text-primary`,children:`Session ID Prefix`}),(0,q.jsx)(`div`,{className:`text-[10px] text-muted`,children:`Show first 5 characters of agent session IDs in the list.`})]}),(0,q.jsx)(Rj,{checked:Ce,onCheckedChange:we})]}),(0,q.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`div`,{className:`text-sm text-primary`,children:`History Sessions Lookback`}),(0,q.jsxs)(`div`,{className:`text-[10px] text-muted`,children:[`Show history sessions from the last N hours (`,1,`-`,168,`).`]})]}),(0,q.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,q.jsx)(`input`,{type:`number`,min:1,max:168,value:ze,onChange:e=>{let t=parseInt(e.target.value,10);t>=1&&t<=168&&st(t)},disabled:Ve,className:`input text-xs py-1 px-2 w-16 text-center`}),(0,q.jsx)(`span`,{className:`text-xs text-muted`,children:`hrs`})]})]})]}),(0,q.jsxs)(`div`,{className:`border-t border-border pt-4 space-y-3`,children:[(0,q.jsx)(`label`,{className:`mb-1 block text-xs text-secondary`,children:`Notifications`}),(0,q.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,q.jsxs)(`div`,{className:`flex-1`,children:[(0,q.jsx)(`div`,{className:`text-sm text-primary`,children:`Permission Sound`}),(0,q.jsx)(`div`,{className:`text-[10px] text-muted`,children:`Play a ping when any session needs permission.`})]}),(0,q.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,q.jsx)(`button`,{type:`button`,onClick:()=>void Xj(),className:`btn text-xs px-2 py-1`,children:`Test`}),(0,q.jsx)(Rj,{checked:De,onCheckedChange:e=>{Oe(e),e&&qj()}})]})]}),(0,q.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,q.jsxs)(`div`,{className:`flex-1`,children:[(0,q.jsx)(`div`,{className:`text-sm text-primary`,children:`Idle Sound`}),(0,q.jsx)(`div`,{className:`text-[10px] text-muted`,children:`Play a chime when a session finishes working.`})]}),(0,q.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,q.jsx)(`button`,{type:`button`,onClick:()=>void Zj(),className:`btn text-xs px-2 py-1`,children:`Test`}),(0,q.jsx)(Rj,{checked:ke,onCheckedChange:e=>{Ae(e),e&&qj()}})]})]})]}),(0,q.jsxs)(`div`,{className:`border-t border-border pt-4`,children:[(0,q.jsx)(`label`,{className:`mb-2 block text-xs text-secondary`,children:`Terminal Rendering`}),(0,q.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`div`,{className:`text-sm text-primary`,children:`WebGL Acceleration`}),(0,q.jsx)(`div`,{className:`text-[10px] text-muted`,children:`GPU rendering for better performance. Turn off if text looks fuzzy or flickering.`})]}),(0,q.jsx)(Rj,{checked:ae,onCheckedChange:oe})]}),ae!==f&&(0,q.jsx)(`p`,{className:`mt-2 text-[10px] text-approval`,children:`Terminal will reload when saved`}),(0,q.jsxs)(`div`,{className:`mt-4 flex items-center justify-between`,children:[(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`div`,{className:`text-sm text-primary`,children:`Mouse Mode`}),(0,q.jsx)(`div`,{className:`text-[10px] text-muted`,children:`Enable tmux mouse mode for trackpad/scroll wheel support.`})]}),(0,q.jsx)(Rj,{checked:je,onCheckedChange:at,disabled:Ne})]}),(0,q.jsxs)(`div`,{className:`mt-4 flex items-center justify-between`,children:[(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`div`,{className:`text-sm text-primary`,children:`Prefer Window Names`}),(0,q.jsx)(`div`,{className:`text-[10px] text-muted`,children:`Label discovered sessions with their tmux window name instead of the session name. Applies immediately.`})]}),(0,q.jsx)(Rj,{checked:Fe,onCheckedChange:ot,disabled:Le})]}),(0,q.jsxs)(`div`,{className:`mt-4 flex items-center justify-between`,children:[(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`div`,{className:`text-sm text-primary`,children:`Font Size`}),(0,q.jsx)(`div`,{className:`text-[10px] text-muted`,children:`Terminal text size in pixels (6-24)`})]}),(0,q.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,q.jsx)(`button`,{type:`button`,onClick:()=>ce(Math.max(6,se-1)),className:`flex h-7 w-7 items-center justify-center rounded bg-surface border border-border text-secondary hover:bg-hover`,children:(0,q.jsx)(`span`,{className:`text-sm font-bold`,children:`−`})}),(0,q.jsx)(`span`,{className:`text-sm text-secondary w-6 text-center`,children:se}),(0,q.jsx)(`button`,{type:`button`,onClick:()=>ce(Math.min(24,se+1)),className:`flex h-7 w-7 items-center justify-center rounded bg-surface border border-border text-secondary hover:bg-hover`,children:(0,q.jsx)(`span`,{className:`text-sm font-bold`,children:`+`})})]})]}),(0,q.jsxs)(`div`,{className:`mt-4 flex items-center justify-between`,children:[(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`div`,{className:`text-sm text-primary`,children:`Line Height`}),(0,q.jsx)(`div`,{className:`text-[10px] text-muted`,children:`Vertical spacing (1.0 = compact, 2.0 = spacious)`})]}),(0,q.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,q.jsx)(`input`,{type:`range`,min:`1.0`,max:`2.0`,step:`0.1`,value:le,onChange:e=>ue(parseFloat(e.target.value)),className:`w-20 h-1 bg-border rounded-lg appearance-none cursor-pointer accent-accent`}),(0,q.jsx)(`span`,{className:`text-xs text-secondary w-8 text-right`,children:le.toFixed(1)})]})]}),(0,q.jsxs)(`div`,{className:`mt-4 flex items-center justify-between`,children:[(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`div`,{className:`text-sm text-primary`,children:`Letter Spacing`}),(0,q.jsx)(`div`,{className:`text-[10px] text-muted`,children:`Horizontal spacing between characters in pixels`})]}),(0,q.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,q.jsx)(`input`,{type:`range`,min:`-3`,max:`3`,step:`1`,value:de,onChange:e=>fe(parseInt(e.target.value,10)),className:`w-20 h-1 bg-border rounded-lg appearance-none cursor-pointer accent-accent`}),(0,q.jsxs)(`span`,{className:`text-xs text-secondary w-8 text-right`,children:[de,`px`]})]})]}),(0,q.jsxs)(`div`,{className:`mt-4`,children:[(0,q.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`div`,{className:`text-sm text-primary`,children:`Font Family`}),(0,q.jsx)(`div`,{className:`text-[10px] text-muted`,children:`Terminal typeface`})]}),(0,q.jsx)(`select`,{value:pe,onChange:e=>me(e.target.value),className:`input text-xs py-1 px-2 w-auto`,children:L.map(e=>(0,q.jsx)(`option`,{value:e.id,children:e.label},e.id))})]}),pe===`custom`&&(0,q.jsx)(`input`,{value:he,onChange:e=>ge(e.target.value),placeholder:`"Fira Code", monospace`,className:`input text-xs mt-2 font-mono`})]}),(0,q.jsxs)(`div`,{className:`mt-4 flex items-center justify-between`,children:[(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`div`,{className:`text-sm text-primary`,children:`Dark Mode`}),(0,q.jsx)(`div`,{className:`text-[10px] text-muted`,children:`Switch between dark and light themes.`})]}),(0,q.jsx)(Rj,{checked:Te===`dark`,onCheckedChange:e=>Ee(e?`dark`:`light`)})]})]}),(0,q.jsxs)(`div`,{className:`border-t border-border pt-4`,children:[(0,q.jsx)(`label`,{className:`mb-2 block text-xs text-secondary`,children:`Keyboard Shortcut Modifier`}),(0,q.jsx)(`div`,{className:`grid grid-cols-5 gap-1`,children:[`auto`,`ctrl-option`,`ctrl-shift`,`cmd-option`,`cmd-shift`].map(e=>(0,q.jsx)(`button`,{type:`button`,className:`btn text-xs px-2 ${_e===e?`btn-primary`:``}`,onClick:()=>ve(e),children:e===`auto`?`Auto`:Ke(e)},e))}),(0,q.jsx)(`p`,{className:`mt-1.5 text-[10px] text-muted`,children:_e===`auto`?`Platform default: ${Ke(We(`auto`))}`:`Shortcuts: ${Ke(_e)}+[N/X/[/]]`})]})]})}),(0,q.jsxs)(`div`,{className:`flex justify-end gap-2 p-6 pt-4 border-t border-border bg-elevated`,children:[(0,q.jsx)(`button`,{type:`button`,onClick:()=>t(),className:`btn`,children:`Cancel`}),(0,q.jsx)(`button`,{type:`submit`,className:`btn btn-primary`,children:`Save`})]})]})})}var $j=[];function eM(e){x.useEffect(e,$j)}var tM=x.createContext(void 0);function nM(){let e=x.useContext(tM);if(!e)throw Error(sk(73));return e}var rM=Symbol(`NOT_FOUND`);function iM(e,t=`expected a function, instead received ${typeof e}`){if(typeof e!=`function`)throw TypeError(t)}function aM(e,t=`expected an object, instead received ${typeof e}`){if(typeof e!=`object`)throw TypeError(t)}function oM(e,t=`expected all items to be functions, instead received the following types: `){if(!e.every(e=>typeof e==`function`)){let n=e.map(e=>typeof e==`function`?`function ${e.name||`unnamed`}()`:typeof e).join(`, `);throw TypeError(`${t}[${n}]`)}}var sM=e=>Array.isArray(e)?e:[e];function cM(e){let t=Array.isArray(e[0])?e[0]:e;return oM(t,`createSelector expects all input-selectors to be functions, but received the following types: `),t}function lM(e,t){let n=[],{length:r}=e;for(let i=0;i<r;i++)n.push(e[i].apply(null,t));return n}function uM(e){let t;return{get(n){return t&&e(t.key,n)?t.value:rM},put(e,n){t={key:e,value:n}},getEntries(){return t?[t]:[]},clear(){t=void 0}}}function dM(e,t){let n=[];function r(e){let r=n.findIndex(n=>t(e,n.key));if(r>-1){let e=n[r];return r>0&&(n.splice(r,1),n.unshift(e)),e.value}return rM}function i(t,i){r(t)===rM&&(n.unshift({key:t,value:i}),n.length>e&&n.pop())}function a(){return n}function o(){n=[]}return{get:r,put:i,getEntries:a,clear:o}}var fM=(e,t)=>e===t;function pM(e){return function(t,n){if(t===null||n===null||t.length!==n.length)return!1;let{length:r}=t;for(let i=0;i<r;i++)if(!e(t[i],n[i]))return!1;return!0}}function mM(e,t){let{equalityCheck:n=fM,maxSize:r=1,resultEqualityCheck:i}=typeof t==`object`?t:{equalityCheck:t},a=pM(n),o=0,s=r<=1?uM(a):dM(r,a);function c(){let t=s.get(arguments);if(t===rM){if(t=e.apply(null,arguments),o++,i){let e=s.getEntries().find(e=>i(e.value,t));e&&(t=e.value,o!==0&&o--)}s.put(arguments,t)}return t}return c.clearCache=()=>{s.clear(),c.resetResultsCount()},c.resultsCount=()=>o,c.resetResultsCount=()=>{o=0},c}var hM=class{constructor(e){this.value=e}deref(){return this.value}},gM=typeof WeakRef<`u`?WeakRef:hM,_M=0,vM=1;function yM(){return{s:_M,v:void 0,o:null,p:null}}function bM(e,t={}){let n=yM(),{resultEqualityCheck:r}=t,i,a=0;function o(){let t=n,{length:o}=arguments;for(let e=0,n=o;e<n;e++){let n=arguments[e];if(typeof n==`function`||typeof n==`object`&&n){let e=t.o;e===null&&(t.o=e=new WeakMap);let r=e.get(n);r===void 0?(t=yM(),e.set(n,t)):t=r}else{let e=t.p;e===null&&(t.p=e=new Map);let r=e.get(n);r===void 0?(t=yM(),e.set(n,t)):t=r}}let s=t,c;if(t.s===vM)c=t.v;else if(c=e.apply(null,arguments),a++,r){let e=i?.deref?.()??i;e!=null&&r(e,c)&&(c=e,a!==0&&a--),i=typeof c==`object`&&c||typeof c==`function`?new gM(c):c}return s.s=vM,s.v=c,c}return o.clearCache=()=>{n=yM(),o.resetResultsCount()},o.resultsCount=()=>a,o.resetResultsCount=()=>{a=0},o}function xM(e,...t){let n=typeof e==`function`?{memoize:e,memoizeOptions:t}:e,r=(...e)=>{let t=0,r=0,i,a={},o=e.pop();typeof o==`object`&&(a=o,o=e.pop()),iM(o,`createSelector expects an output function after the inputs, but received: [${typeof o}]`);let{memoize:s,memoizeOptions:c=[],argsMemoize:l=bM,argsMemoizeOptions:u=[],devModeChecks:d={}}={...n,...a},f=sM(c),p=sM(u),m=cM(e),h=s(function(){return t++,o.apply(null,arguments)},...f),g=l(function(){r++;let e=lM(m,arguments);return i=h.apply(null,e),i},...p);return Object.assign(g,{resultFunc:o,memoizedResultFunc:h,dependencies:m,dependencyRecomputations:()=>r,resetDependencyRecomputations:()=>{r=0},lastResult:()=>i,recomputations:()=>t,resetRecomputations:()=>{t=0},memoize:s,argsMemoize:l})};return Object.assign(r,{withTypes:()=>r}),r}var SM=xM(bM),CM=Object.assign((e,t=SM)=>{aM(e,`createStructuredSelector expects first argument to be an object where each property is a selector, instead received a ${typeof e}`);let n=Object.keys(e);return t(n.map(t=>e[t]),(...e)=>e.reduce((e,t,r)=>(e[n[r]]=t,e),{}))},{withTypes:()=>CM}),wM=xM({memoize:mM,memoizeOptions:{maxSize:1,equalityCheck:Object.is}}),TM=(e,t,n,r,i,a,...o)=>{if(o.length>0)throw Error(sk(1));let s;if(e&&t&&n&&r&&i&&a)s=(o,s,c,l)=>a(e(o,s,c,l),t(o,s,c,l),n(o,s,c,l),r(o,s,c,l),i(o,s,c,l),s,c,l);else if(e&&t&&n&&r&&i)s=(a,o,s,c)=>i(e(a,o,s,c),t(a,o,s,c),n(a,o,s,c),r(a,o,s,c),o,s,c);else if(e&&t&&n&&r)s=(i,a,o,s)=>r(e(i,a,o,s),t(i,a,o,s),n(i,a,o,s),a,o,s);else if(e&&t&&n)s=(r,i,a,o)=>n(e(r,i,a,o),t(r,i,a,o),i,a,o);else if(e&&t)s=(n,r,i,a)=>t(e(n,r,i,a),r,i,a);else if(e)s=e;else throw Error(`Missing arguments`);return s},EM=(...e)=>{let t=new WeakMap,n=1,r=e[e.length-1],i=e.length-1||1,a=r.length-i;if(a>3)throw Error(sk(2));return(i,o,s,c)=>{let l=i.__cacheKey__;l||(l={id:n},i.__cacheKey__=l,n+=1);let u=t.get(l);if(!u){let n=e,i=[void 0,void 0,void 0];switch(a){case 0:break;case 1:n=[...e.slice(0,-1),()=>i[0],r];break;case 2:n=[...e.slice(0,-1),()=>i[0],()=>i[1],r];break;case 3:n=[...e.slice(0,-1),()=>i[0],()=>i[1],()=>i[2],r];break;default:throw Error(sk(2))}u=wM(...n),u.selectorArgs=i,t.set(l,u)}switch(u.selectorArgs[0]=o,u.selectorArgs[1]=s,u.selectorArgs[2]=c,a){case 0:return u(i);case 1:return u(i,o);case 2:return u(i,o,s);case 3:return u(i,o,s,c);default:throw Error(`unreachable`)}}},DM=s((e=>{var t=p();function n(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var r=typeof Object.is==`function`?Object.is:n,i=t.useState,a=t.useEffect,o=t.useLayoutEffect,s=t.useDebugValue;function c(e,t){var n=t(),r=i({inst:{value:n,getSnapshot:t}}),c=r[0].inst,u=r[1];return o(function(){c.value=n,c.getSnapshot=t,l(c)&&u({inst:c})},[e,n,t]),a(function(){return l(c)&&u({inst:c}),e(function(){l(c)&&u({inst:c})})},[e]),s(n),n}function l(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!r(e,n)}catch{return!0}}function u(e,t){return t()}var d=typeof window>`u`||window.document===void 0||window.document.createElement===void 0?u:c;e.useSyncExternalStore=t.useSyncExternalStore===void 0?d:t.useSyncExternalStore})),OM=s(((e,t)=>{t.exports=DM()})),kM=s((e=>{var t=p(),n=OM();function r(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var i=typeof Object.is==`function`?Object.is:r,a=n.useSyncExternalStore,o=t.useRef,s=t.useEffect,c=t.useMemo,l=t.useDebugValue;e.useSyncExternalStoreWithSelector=function(e,t,n,r,u){var d=o(null);if(d.current===null){var f={hasValue:!1,value:null};d.current=f}else f=d.current;d=c(function(){function e(e){if(!a){if(a=!0,o=e,e=r(e),u!==void 0&&f.hasValue){var t=f.value;if(u(t,e))return s=t}return s=e}if(t=s,i(o,e))return t;var n=r(e);return u!==void 0&&u(t,n)?(o=e,t):(o=e,s=n)}var a=!1,o,s,c=n===void 0?null:n;return[function(){return e(t())},c===null?void 0:function(){return e(c())}]},[t,n,r,u]);var p=a(e,d[0],d[1]);return s(function(){f.hasValue=!0,f.value=p},[p]),l(p),p}})),AM=s(((e,t)=>{t.exports=kM()})),jM=[],MM=void 0;function NM(){return MM}function PM(e){jM.push(e)}var FM=OM(),IM=AM(),LM=lk(19)?BM:VM;function RM(e,t,n,r,i){return LM(e,t,n,r,i)}function zM(e,t,n,r,i){let a=x.useCallback(()=>t(e.getSnapshot(),n,r,i),[e,t,n,r,i]);return(0,FM.useSyncExternalStore)(e.subscribe,a,a)}PM({before(e){e.syncIndex=0,e.didInitialize||(e.syncTick=1,e.syncHooks=[],e.didChangeStore=!0,e.getSnapshot=()=>{let t=!1;for(let n=0;n<e.syncHooks.length;n+=1){let r=e.syncHooks[n],i=r.selector(r.store.state,r.a1,r.a2,r.a3);(r.didChange||!Object.is(r.value,i))&&(t=!0,r.value=i,r.didChange=!1)}return t&&(e.syncTick+=1),e.syncTick})},after(e){e.syncHooks.length>0&&(e.didChangeStore&&(e.didChangeStore=!1,e.subscribe=t=>{let n=new Set;for(let t of e.syncHooks)n.add(t.store);let r=[];for(let e of n)r.push(e.subscribe(t));return()=>{for(let e of r)e()}}),(0,FM.useSyncExternalStore)(e.subscribe,e.getSnapshot,e.getSnapshot))}});function BM(e,t,n,r,i){let a=NM();if(!a)return zM(e,t,n,r,i);let o=a.syncIndex;a.syncIndex+=1;let s;return a.didInitialize?(s=a.syncHooks[o],(s.store!==e||s.selector!==t||!Object.is(s.a1,n)||!Object.is(s.a2,r)||!Object.is(s.a3,i))&&(s.store!==e&&(a.didChangeStore=!0),s.store=e,s.selector=t,s.a1=n,s.a2=r,s.a3=i,s.didChange=!0)):(s={store:e,selector:t,a1:n,a2:r,a3:i,value:t(e.getSnapshot(),n,r,i),didChange:!1},a.syncHooks.push(s)),s.value}function VM(e,t,n,r,i){return(0,IM.useSyncExternalStoreWithSelector)(e.subscribe,e.getSnapshot,e.getSnapshot,e=>t(e,n,r,i))}var HM=class{constructor(e){this.state=e,this.listeners=new Set,this.updateTick=0}subscribe=e=>(this.listeners.add(e),()=>{this.listeners.delete(e)});getSnapshot=()=>this.state;setState(e){if(this.state===e)return;this.state=e,this.updateTick+=1;let t=this.updateTick;for(let n of this.listeners){if(t!==this.updateTick)return;n(e)}}update(e){for(let t in e)if(!Object.is(this.state[t],e[t])){this.setState({...this.state,...e});return}}set(e,t){Object.is(this.state[e],t)||this.setState({...this.state,[e]:t})}notifyAll(){let e={...this.state};this.setState(e)}use(e,t,n,r){return RM(this,e,t,n,r)}},UM=class extends HM{constructor(e,t={},n){super(e),this.context=t,this.selectors=n}useSyncedValue(e,t){x.useDebugValue(e),tk(()=>{this.state[e]!==t&&this.set(e,t)},[e,t])}useSyncedValueWithCleanup(e,t){let n=this;tk(()=>(n.state[e]!==t&&n.set(e,t),()=>{n.set(e,void 0)}),[n,e,t])}useSyncedValues(e){let t=this;tk(()=>{t.update(e)},[t,...Object.values(e)])}useControlledProp(e,t){x.useDebugValue(e);let n=t!==void 0;tk(()=>{n&&!Object.is(this.state[e],t)&&super.setState({...this.state,[e]:t})},[e,t,n])}select(e,t,n,r){let i=this.selectors[e];return i(this.state,t,n,r)}useState(e,t,n,r){return x.useDebugValue(e),RM(this,this.selectors[e],t,n,r)}useContextCallback(e,t){x.useDebugValue(e);let n=KO(t??ak);this.context[e]=n}useStateSetter(e){let t=x.useRef(void 0);return t.current===void 0&&(t.current=t=>{this.set(e,t)}),t.current}observe(e,t){let n;n=typeof e==`function`?e:this.selectors[e];let r=n(this.state);return t(r,r,this),this.subscribe(e=>{let i=n(e);if(!Object.is(r,i)){let e=r;r=i,t(i,e,this)}})}},WM=null;globalThis.requestAnimationFrame;var GM=new class{callbacks=[];callbacksCount=0;nextId=1;startId=1;isScheduled=!1;tick=e=>{this.isScheduled=!1;let t=this.callbacks,n=this.callbacksCount;if(this.callbacks=[],this.callbacksCount=0,this.startId=this.nextId,n>0)for(let n=0;n<t.length;n+=1)t[n]?.(e)};request(e){let t=this.nextId;return this.nextId+=1,this.callbacks.push(e),this.callbacksCount+=1,this.isScheduled||=(requestAnimationFrame(this.tick),!0),t}cancel(e){let t=e-this.startId;t<0||t>=this.callbacks.length||(this.callbacks[t]=null,--this.callbacksCount)}},KM=class e{static create(){return new e}static request(e){return GM.request(e)}static cancel(e){return GM.cancel(e)}currentId=WM;request(e){this.cancel(),this.currentId=GM.request(()=>{this.currentId=WM,e()})}cancel=()=>{this.currentId!==WM&&(GM.cancel(this.currentId),this.currentId=WM)};disposeEffect=()=>this.cancel};function qM(){let e=UO(KM.create).current;return eM(e.disposeEffect),e}var JM=0,YM=class e{static create(){return new e}currentId=JM;start(e,t){this.clear(),this.currentId=setTimeout(()=>{this.currentId=JM,t()},e)}isStarted(){return this.currentId!==JM}clear=()=>{this.currentId!==JM&&(clearTimeout(this.currentId),this.currentId=JM)};disposeEffect=()=>this.clear};function XM(){let e=UO(YM.create).current;return eM(e.disposeEffect),e}var ZM=0;function QM(e){return ZM+=1,`${e}-${Math.random().toString(36).slice(2,6)}-${ZM}`}function $M(e){return e?.ownerDocument||document}function eN(e,t){if(typeof e==`string`)return{description:e};if(typeof e==`function`){let n=e(t);return typeof n==`string`?{description:n}:n}return e}var tN=typeof navigator<`u`,nN=sN(),rN=lN(),iN=cN();typeof CSS>`u`||!CSS.supports||CSS.supports(`-webkit-backdrop-filter:none`),nN.platform===`MacIntel`&&nN.maxTouchPoints>1||/iP(hone|ad|od)|iOS/.test(nN.platform),tN&&/firefox/i.test(iN);var aN=tN&&/apple/i.test(navigator.vendor);tN&&/Edg/i.test(iN),tN&&/android/i.test(rN)||/android/i.test(iN),tN&&rN.toLowerCase().startsWith(`mac`)&&navigator.maxTouchPoints;var oN=iN.includes(`jsdom/`);function sN(){if(!tN)return{platform:``,maxTouchPoints:-1};let e=navigator.userAgentData;return e?.platform?{platform:e.platform,maxTouchPoints:navigator.maxTouchPoints}:{platform:navigator.platform??``,maxTouchPoints:navigator.maxTouchPoints??-1}}function cN(){if(!tN)return``;let e=navigator.userAgentData;return e&&Array.isArray(e.brands)?e.brands.map(({brand:e,version:t})=>`${e}/${t}`).join(` `):navigator.userAgent}function lN(){if(!tN)return``;let e=navigator.userAgentData;return e?.platform?e.platform:navigator.platform??``}function uN(e){let t=e.activeElement;for(;t?.shadowRoot?.activeElement!=null;)t=t.shadowRoot.activeElement;return t}function dN(e,t){if(!e||!t)return!1;let n=t.getRootNode?.();if(e.contains(t))return!0;if(n&&Hk(n)){let n=t;for(;n;){if(e===n)return!0;n=n.parentNode||n.host}}return!1}function fN(e){return`composedPath`in e?e.composedPath()[0]:e.target}function pN(e){if(!e||oN)return!0;try{return e.matches(`:focus-visible`)}catch{return!0}}var mN=EM(e=>e.toasts,e=>{let t=new Map,n=0,r=0;return e.forEach((e,i)=>{let a=e.transitionStatus===`ending`;t.set(e.id,{value:e,domIndex:i,visibleIndex:a?-1:n,offsetY:r}),r+=e.height||0,a||(n+=1)}),t}),hN={toasts:TM(e=>e.toasts),isEmpty:TM(e=>e.toasts.length===0),toast:TM(mN,(e,t)=>e.get(t)?.value),toastIndex:TM(mN,(e,t)=>e.get(t)?.domIndex??-1),toastOffsetY:TM(mN,(e,t)=>e.get(t)?.offsetY??0),toastVisibleIndex:TM(mN,(e,t)=>e.get(t)?.visibleIndex??-1),hovering:TM(e=>e.hovering),focused:TM(e=>e.focused),expanded:TM(e=>e.hovering||e.focused),expandedOrOutOfFocus:TM(e=>e.hovering||e.focused||!e.isWindowFocused),prevFocusElement:TM(e=>e.prevFocusElement)},gN=class extends UM{timers=new Map;areTimersPaused=!1;constructor(e){super(e,{},hN)}setFocused(e){this.set(`focused`,e)}setHovering(e){this.set(`hovering`,e)}setIsWindowFocused(e){this.set(`isWindowFocused`,e)}setPrevFocusElement(e){this.set(`prevFocusElement`,e)}setViewport=e=>{this.set(`viewport`,e)};disposeEffect=()=>()=>{this.timers.forEach(e=>{e.timeout?.clear()}),this.timers.clear()};removeToast(e){let t=hN.toastIndex(this.state,e);if(t===-1)return;this.state.toasts[t]?.onRemove?.();let n=[...this.state.toasts];n.splice(t,1),this.setToasts(n)}addToast=e=>{let{toasts:t,timeout:n,limit:r}=this.state,i=e.id||QM(`toast`),a={...e,id:i,transitionStatus:`starting`},o=[a,...t],s=o.filter(e=>e.transitionStatus!==`ending`);if(s.length>r){let e=s.length-r,t=s.slice(-e),n=new Set(t.map(e=>e.id));this.setToasts(o.map(e=>{let t=n.has(e.id);return e.limited===t?e:{...e,limited:t}}))}else this.setToasts(o.map(e=>e.limited?{...e,limited:!1}:e));let c=a.timeout??n;return a.type!==`loading`&&c>0&&this.scheduleTimer(i,c,()=>this.closeToast(i)),hN.expandedOrOutOfFocus(this.state)&&this.pauseTimers(),i};updateToast=(e,t)=>{this.updateToastInternal(e,t)};updateToastInternal=(e,t)=>{let{timeout:n,toasts:r}=this.state,i=hN.toast(this.state,e)??null;if(!i||i.transitionStatus===`ending`)return;let a={...i,...t};this.setToasts(r.map(n=>n.id===e?{...n,...t}:n));let o=a.timeout??n,s=i?.timeout??n,c=Object.hasOwn(t,`timeout`),l=a.transitionStatus!==`ending`&&a.type!==`loading`&&o>0,u=this.timers.has(e),d=s!==o,f=i?.type===`loading`;if(!l&&u){this.timers.get(e)?.timeout?.clear(),this.timers.delete(e);return}if(l&&(!u||d||c||f)){let t=this.timers.get(e);t&&(t.timeout?.clear(),this.timers.delete(e)),this.scheduleTimer(e,o,()=>this.closeToast(e)),hN.expandedOrOutOfFocus(this.state)&&this.pauseTimers()}};closeToast=e=>{hN.toast(this.state,e)?.onClose?.();let{limit:t,toasts:n}=this.state,r=0,i=n.map(n=>{if(n.id===e)return{...n,transitionStatus:`ending`,height:0};if(n.transitionStatus===`ending`)return n;let i=r>=t;return r+=1,n.limited===i?n:{...n,limited:i}}),a=this.timers.get(e);a&&a.timeout&&(a.timeout.clear(),this.timers.delete(e)),this.handleFocusManagement(e),this.setToasts(i)};promiseToast=(e,t)=>{let n=eN(t.loading),r=this.addToast({...n,type:`loading`}),i=e.then(e=>{let n=eN(t.success,e);return this.updateToast(r,{...n,type:`success`,timeout:n.timeout}),e}).catch(e=>{let n=eN(t.error,e);return this.updateToast(r,{...n,type:`error`,timeout:n.timeout}),Promise.reject(e)});return{}.hasOwnProperty.call(t,`setPromise`)&&t.setPromise(i),i};pauseTimers(){this.areTimersPaused||(this.areTimersPaused=!0,this.timers.forEach(e=>{if(e.timeout){e.timeout.clear();let t=Date.now()-e.start,n=e.delay-t;e.remaining=n>0?n:0}}))}resumeTimers(){this.areTimersPaused&&(this.areTimersPaused=!1,this.timers.forEach((e,t)=>{e.remaining=e.remaining>0?e.remaining:e.delay,e.timeout??=YM.create(),e.timeout.start(e.remaining,()=>{this.timers.delete(t),e.callback()}),e.start=Date.now()}))}restoreFocusToPrevElement(){this.state.prevFocusElement?.focus({preventScroll:!0})}handleDocumentPointerDown=e=>{if(e.pointerType!==`touch`)return;let t=fN(e);dN(this.state.viewport,t)||(this.resumeTimers(),this.update({hovering:!1,focused:!1}))};scheduleTimer(e,t,n){let r=Date.now(),i=!hN.expandedOrOutOfFocus(this.state),a=i?YM.create():void 0;a?.start(t,()=>{this.timers.delete(e),n()}),this.timers.set(e,{timeout:a,start:i?r:0,delay:t,remaining:t,callback:n})}setToasts(e){let t={toasts:e};e.length===0&&(t.hovering=!1,t.focused=!1),this.update(t)}handleFocusManagement(e){let t=uN($M(this.state.viewport));if(!this.state.viewport||!dN(this.state.viewport,t)||!pN(t))return;let n=hN.toasts(this.state),r=hN.toastIndex(this.state,e),i=null,a=r+1;for(;a<n.length;){if(n[a].transitionStatus!==`ending`){i=n[a];break}a+=1}if(!i)for(a=r-1;a>=0;){if(n[a].transitionStatus!==`ending`){i=n[a];break}--a}i?i.ref?.current?.focus():this.restoreFocusToPrevElement()}},_N=function(e){let{children:t,timeout:n=5e3,limit:r=3,toastManager:i}=e,a=UO(()=>new gN({timeout:n,limit:r,viewport:null,toasts:[],hovering:!1,focused:!1,isWindowFocused:!0,prevFocusElement:null})).current;return eM(a.disposeEffect),x.useEffect(function(){if(i)return i[` subscribe`](({action:e,options:t})=>{let n=t.id;e===`promise`&&t.promise?a.promiseToast(t.promise,t):e===`update`&&n?a.updateToast(n,t):e===`close`&&n?a.closeToast(n):a.addToast(t)})},[a,n,i]),a.useSyncedValues({timeout:n,limit:r}),(0,q.jsx)(tM.Provider,{value:a,children:t})},vN=x.forwardRef(function(e,t){let[n,r]=x.useState();tk(()=>{aN&&r(`button`)},[]);let i={tabIndex:0,role:n};return(0,q.jsx)(`span`,{...e,ref:t,style:rk,"aria-hidden":n?void 0:!0,...i,"data-base-ui-focus-guard":``})}),yN=function(e){return e.frontmostHeight=`--toast-frontmost-height`,e}({}),bN=x.forwardRef(function(e,t){let{render:n,className:r,children:i,...a}=e,o=nM(),s=XM(),c=x.useRef(!1),l=x.useRef(!1),u=o.useState(`isEmpty`),d=o.useState(`toasts`),f=o.useState(`focused`),p=o.useState(`expanded`),m=o.useState(`prevFocusElement`),h=d[0]?.height??0,g=x.useMemo(()=>d.some(e=>e.transitionStatus===`ending`),[d]);x.useEffect(()=>{let e=o.state.viewport;if(!e)return;function t(t){u||t.key===`F6`&&t.target!==e&&(t.preventDefault(),o.setPrevFocusElement(uN($M(e))),e?.focus({preventScroll:!0}),o.pauseTimers(),o.setFocused(!0))}let n=zk(e);return n.addEventListener(`keydown`,t),()=>{n.removeEventListener(`keydown`,t)}},[o,u]),x.useEffect(()=>{let e=o.state.viewport;if(!e||u)return;let t=zk(e);function n(e){e.target===t&&(o.setIsWindowFocused(!1),o.pauseTimers())}function r(n){if(n.relatedTarget||n.target===t)return;let r=fN(n),i=uN($M(e));(!dN(e,r)||!pN(i))&&o.resumeTimers(),s.start(0,()=>o.setIsWindowFocused(!0))}return t.addEventListener(`blur`,n,!0),t.addEventListener(`focus`,r,!0),()=>{t.removeEventListener(`blur`,n,!0),t.removeEventListener(`focus`,r,!0)}},[o,s,u]),x.useEffect(()=>{let e=o.state.viewport;if(!e||u)return;let t=$M(e);return t.addEventListener(`pointerdown`,o.handleDocumentPointerDown,!0),()=>{t.removeEventListener(`pointerdown`,o.handleDocumentPointerDown,!0)}},[u,o]);function _(e){let t=o.state.viewport;t&&(c.current=!0,e.relatedTarget===t?d[0]?.ref?.current?.focus():o.restoreFocusToPrevElement())}function v(e){e.key===`Tab`&&e.shiftKey&&e.target===o.state.viewport&&(e.preventDefault(),o.restoreFocusToPrevElement(),o.resumeTimers())}x.useEffect(()=>{!o.state.isWindowFocused||g||!l.current||(o.resumeTimers(),o.setHovering(!1),l.current=!1)},[g,o]);function y(){o.pauseTimers(),o.setHovering(!0),l.current=!1}function b(){g?l.current=!0:(o.resumeTimers(),o.setHovering(!1))}function S(){if(c.current){c.current=!1;return}f||pN($M(o.state.viewport).activeElement)&&(o.setFocused(!0),o.pauseTimers())}function C(e){!f||dN(o.state.viewport,e.relatedTarget)||(o.setFocused(!1),o.resumeTimers())}let w={tabIndex:-1,role:`region`,"aria-live":`polite`,"aria-atomic":!1,"aria-relevant":`additions text`,"aria-label":`Notifications`,onMouseEnter:y,onMouseMove:y,onMouseLeave:b,onFocus:S,onBlur:C,onKeyDown:v,onClick:S},T={expanded:p},E=Dk(`div`,e,{ref:[t,o.setViewport],state:T,props:[w,{style:{[yN.frontmostHeight]:h?`${h}px`:void 0}},a,{children:(0,q.jsxs)(x.Fragment,{children:[!u&&m&&(0,q.jsx)(vN,{onFocus:_}),i,!u&&m&&(0,q.jsx)(vN,{onFocus:_})]})}]}),D=x.useMemo(()=>d.filter(e=>e.priority===`high`),[d]);return(0,q.jsxs)(x.Fragment,{children:[!u&&m&&(0,q.jsx)(vN,{onFocus:_}),E,!f&&D.length>0&&(0,q.jsx)(`div`,{style:rk,children:D.map(e=>(0,q.jsxs)(`div`,{role:`alert`,"aria-atomic":!0,children:[(0,q.jsx)(`div`,{children:e.title}),(0,q.jsx)(`div`,{children:e.description})]},e.id))})]})});function xN(e){return lk(19)?e:e?`true`:void 0}var SN=x.createContext(void 0);function CN(){let e=x.useContext(SN);if(!e)throw Error(sk(66));return e}var wN=function(e){return e.startingStyle=`data-starting-style`,e.endingStyle=`data-ending-style`,e}({}),TN={[wN.startingStyle]:``},EN={[wN.endingStyle]:``},DN={transitionStatus(e){return e===`starting`?TN:e===`ending`?EN:null}};function ON(e){return e==null?e:`current`in e?e.current:e}function kN(e,t=!1,n=!0){let r=qM();return KO((i,a=null)=>{r.cancel();function o(){K.flushSync(i)}let s=ON(e);if(s==null)return;let c=s;if(typeof c.getAnimations!=`function`||globalThis.BASE_UI_ANIMATIONS_DISABLED)i();else{function e(){let e=wN.startingStyle;if(!c.hasAttribute(e)){r.request(i);return}let t=new MutationObserver(()=>{c.hasAttribute(e)||(t.disconnect(),i())});t.observe(c,{attributes:!0,attributeFilter:[e]}),a?.addEventListener(`abort`,()=>t.disconnect(),{once:!0})}function i(){Promise.all(c.getAnimations().map(e=>e.finished)).then(()=>{a?.aborted||o()}).catch(()=>{let e=c.getAnimations();if(n){if(a?.aborted)return;o()}else e.length>0&&e.some(e=>e.pending||e.playState!==`finished`)&&i()})}if(t){e();return}r.request(i)}})}function AN(e){let{enabled:t=!0,open:n,ref:r,onComplete:i}=e,a=KO(i),o=kN(r,n,!1);x.useEffect(()=>{if(!t)return;let e=new AbortController;return o(a,e.signal),()=>{e.abort()}},[t,n,a,o])}var jN=function(e){return e.index=`--toast-index`,e.offsetY=`--toast-offset-y`,e.height=`--toast-height`,e.swipeMovementX=`--toast-swipe-movement-x`,e.swipeMovementY=`--toast-swipe-movement-y`,e}({}),MN={...DN,swipeDirection(e){return e?{"data-swipe-direction":e}:null}},NN=40,PN=10,FN=.5,IN=1;function LN(e,t,n){switch(e){case`up`:return-n;case`down`:return n;case`left`:return-t;case`right`:return t;default:return 0}}function RN(e){let t=window.getComputedStyle(e).transform,n=0,r=0,i=1;if(t&&t!==`none`){let e=t.match(/matrix(?:3d)?\(([^)]+)\)/);if(e){let t=e[1].split(`, `).map(parseFloat);t.length===6?(n=t[4],r=t[5],i=Math.sqrt(t[0]*t[0]+t[1]*t[1])):t.length===16&&(n=t[12],r=t[13],i=t[0])}}return{x:n,y:r,scale:i}}var zN=x.forwardRef(function(e,t){let{toast:n,render:r,className:i,swipeDirection:a=[`down`,`right`],...o}=e,s=n.positionerProps?.anchor!==void 0,c=[];s||(c=Array.isArray(a)?a:[a]);let l=c.length>0,u=nM(),[d,f]=x.useState(void 0),[p,m]=x.useState(!1),[h,g]=x.useState(!1),[_,v]=x.useState(!1),[y,b]=x.useState({x:0,y:0}),[S,C]=x.useState({x:0,y:0,scale:1}),[w,T]=x.useState(),[E,D]=x.useState(),[O,k]=x.useState(null),A=x.useRef(null),j=x.useRef({x:0,y:0}),M=x.useRef({x:0,y:0,scale:1}),N=x.useRef(void 0),P=x.useRef(0),F=x.useRef(!1),I=x.useRef({x:0,y:0}),L=x.useRef(!1),R=u.useState(`toastIndex`,n.id),z=u.useState(`toastVisibleIndex`,n.id),B=u.useState(`toastOffsetY`,n.id),V=u.useState(`focused`),H=u.useState(`expanded`);AN({open:n.transitionStatus!==`ending`,ref:A,onComplete(){n.transitionStatus===`ending`&&u.removeToast(n.id)}});let U=KO((e=!1)=>{let t=A.current;if(!t)return;let r=t.style.height;t.style.height=`auto`;let i=t.offsetHeight;t.style.height=r;function a(){u.updateToastInternal(n.id,{ref:A,height:i,...n.transitionStatus===`starting`?{transitionStatus:void 0}:{}})}e?K.flushSync(a):a()});tk(U,[U]);function W(e,t){let n=e,r=t;return!c.includes(`left`)&&!c.includes(`right`)?n=e>0?e**FN:-(Math.abs(e)**FN):(!c.includes(`right`)&&e>0&&(n=e**FN),!c.includes(`left`)&&e<0&&(n=-(Math.abs(e)**FN))),!c.includes(`up`)&&!c.includes(`down`)?r=t>0?t**FN:-(Math.abs(t)**FN):(!c.includes(`down`)&&t>0&&(r=t**FN),!c.includes(`up`)&&t<0&&(r=-(Math.abs(t)**FN))),{x:n,y:r}}function G(e){if(e.button!==0)return;e.pointerType===`touch`&&u.pauseTimers();let t=fN(e.nativeEvent);if(!(t&&t.closest(`button,a,input,textarea,[role="button"],[data-swipe-ignore]`))){if(F.current=!1,N.current=void 0,P.current=0,j.current={x:e.clientX,y:e.clientY},I.current=j.current,A.current){let e=RN(A.current);M.current=e,C(e),b({x:e.x,y:e.y})}u.setHovering(!0),m(!0),g(!1),k(null),L.current=!0,A.current?.setPointerCapture(e.pointerId)}}function ee(e){if(!p)return;e.preventDefault(),L.current&&=(j.current={x:e.clientX,y:e.clientY},!1);let{clientY:t,clientX:n,movementX:r,movementY:i}=e;(i<0&&t>I.current.y||i>0&&t<I.current.y)&&(I.current={x:I.current.x,y:t}),(r<0&&n>I.current.x||r>0&&n<I.current.x)&&(I.current={x:n,y:I.current.y});let a=n-j.current.x,o=t-j.current.y,s=t-I.current.y,l=n-I.current.x;if(!h&&Math.sqrt(a*a+o*o)>=IN&&(g(!0),O===null)){let e=c.includes(`left`)||c.includes(`right`),t=c.includes(`up`)||c.includes(`down`);e&&t&&k(Math.abs(a)>Math.abs(o)?`horizontal`:`vertical`)}let u;if(!N.current)O===`vertical`?o>0?u=`down`:o<0&&(u=`up`):O===`horizontal`?a>0?u=`right`:a<0&&(u=`left`):u=Math.abs(a)>=Math.abs(o)?a>0?`right`:`left`:o>0?`down`:`up`,u&&c.includes(u)&&(N.current=u,P.current=LN(u,a,o),f(u));else{let e=N.current,t=LN(e,l,s);t>NN?(F.current=!1,f(e)):!(c.includes(`left`)&&c.includes(`right`))&&!(c.includes(`up`)&&c.includes(`down`))&&P.current-t>=PN&&(F.current=!0)}let d=W(a,o),m=M.current.x,_=M.current.y;O===`horizontal`?(c.includes(`left`)||c.includes(`right`))&&(m+=d.x):(O===`vertical`||(c.includes(`left`)||c.includes(`right`))&&(m+=d.x),(c.includes(`up`)||c.includes(`down`))&&(_+=d.y)),b({x:m,y:_})}function te(e){if(!p)return;if(m(!1),g(!1),k(null),A.current?.releasePointerCapture(e.pointerId),F.current){b({x:S.x,y:S.y}),f(void 0);return}let t=!1,r=y.x-S.x,i=y.y-S.y,a;for(let e of c){switch(e){case`right`:r>NN&&(t=!0,a=`right`);break;case`left`:r<-NN&&(t=!0,a=`left`);break;case`down`:i>NN&&(t=!0,a=`down`);break;case`up`:i<-NN&&(t=!0,a=`up`);break;default:break}if(t)break}t?(f(a),v(!0),u.closeToast(n.id)):(b({x:S.x,y:S.y}),f(void 0))}function ne(e){if(e.key===`Escape`){if(!A.current||!dN(A.current,uN($M(A.current))))return;u.closeToast(n.id)}}x.useEffect(()=>{if(!l)return;let e=A.current;if(!e)return;function t(t){dN(e,t.target)&&t.preventDefault()}return e.addEventListener(`touchmove`,t,{passive:!1}),()=>{e.removeEventListener(`touchmove`,t)}},[l]);function re(){if(!p&&y.x===S.x&&y.y===S.y&&!_)return{[jN.swipeMovementX]:`0px`,[jN.swipeMovementY]:`0px`};let e=y.x-S.x,t=y.y-S.y;return{transition:p?`none`:void 0,transform:p?`translateX(${y.x}px) translateY(${y.y}px) scale(${S.scale})`:void 0,[jN.swipeMovementX]:`${e}px`,[jN.swipeMovementY]:`${t}px`}}let ie=n.priority===`high`,ae={role:ie?`alertdialog`:`dialog`,tabIndex:0,"aria-modal":!1,"aria-labelledby":w,"aria-describedby":E,"aria-hidden":ie&&!V?!0:void 0,onPointerDown:l?G:void 0,onPointerMove:l?ee:void 0,onPointerUp:l?te:void 0,onKeyDown:ne,inert:xN(n.limited),style:{...re(),[jN.index]:n.transitionStatus===`ending`?R:z,[jN.offsetY]:`${B}px`,[jN.height]:n.height?`${n.height}px`:void 0}},oe=x.useMemo(()=>({rootRef:A,toast:n,titleId:w,setTitleId:T,descriptionId:E,setDescriptionId:D,swiping:p,swipeDirection:d,recalculateHeight:U,index:R,visibleIndex:z,expanded:H}),[n,w,E,p,d,U,R,z,H]),se={transitionStatus:n.transitionStatus,expanded:H,limited:n.limited||!1,type:n.type,swiping:oe.swiping,swipeDirection:oe.swipeDirection},ce=Dk(`div`,e,{ref:[t,oe.rootRef],state:se,stateAttributesMapping:MN,props:[ae,o]});return(0,q.jsx)(SN.Provider,{value:oe,children:ce})}),BN=x.forwardRef(function(e,t){let{render:n,className:r,id:i,children:a,...o}=e,{toast:s,setDescriptionId:c}=CN(),l=a??s.description,u=!!l,d=Ik(i);tk(()=>{if(u)return c(d),()=>{c(void 0)}},[u,d,c]);let f=Dk(`p`,e,{ref:t,state:{type:s.type},props:{...o,id:d,children:l}});return u?f:null}),VN=x.forwardRef(function(e,t){let{render:n,className:r,id:i,children:a,...o}=e,{toast:s,setTitleId:c}=CN(),l=a??s.title,u=!!l,d=Ik(i);tk(()=>{if(u)return c(d),()=>{c(void 0)}},[u,d,c]);let f=Dk(`h2`,e,{ref:t,state:{type:s.type},props:{...o,id:d,children:l}});return u?f:null}),HN=x.forwardRef(function(e,t){let{render:n,className:r,disabled:i,nativeButton:a=!0,...o}=e,s=nM(),{toast:c}=CN(),l=s.useState(`expanded`),[u,d]=x.useState(!1),{getButtonProps:f,buttonRef:p}=Kk({disabled:i,native:a}),m={type:c.type};return Dk(`button`,e,{ref:[t,p],state:m,props:[{"aria-hidden":!l&&!u,onClick(){s.closeToast(c.id)},onFocus(){d(!0)},onBlur(){d(!1)}},o,f]})});function UN(){let e=x.useContext(tM);if(!e)throw Error(sk(73));let t=e.useState(`toasts`);return x.useMemo(()=>({toasts:t,add:e.addToast,close:e.closeToast,update:e.updateToast,promise:e.promiseToast}),[t,e])}function WN(){let e=new Set;function t(t){e.forEach(e=>e(t))}return{" subscribe":function(t){return e.add(t),()=>{e.delete(t)}},add(e){let n=e.id||QM(`toast`);return t({action:`add`,options:{...e,id:n,transitionStatus:`starting`}}),n},close(e){t({action:`close`,options:{id:e}})},update(e,n){t({action:`update`,options:{...n,id:e}})},promise(e,n){let r=e;return t({action:`promise`,options:{...n,promise:e,setPromise(e){r=e}}}),r}}}var GN=5e3,KN=WN();function qN({toast:e}){return(0,q.jsxs)(zN,{toast:e,className:Lj(`relative flex w-80 items-start gap-3 border bg-elevated p-4 shadow-lg`,`data-[swipe=move]:translate-x-[var(--toast-swipe-move-x)]`,`data-[ending-style]:translate-x-[var(--toast-swipe-end-x)]`,`data-[ending-style]:opacity-0`,`data-[starting-style]:translate-y-2 data-[starting-style]:opacity-0`,`transition-all duration-200`,e.type===`error`&&`border-error/50`,e.type===`success`&&`border-approval/50`,(!e.type||e.type===`info`)&&`border-border`),children:[(0,q.jsxs)(`div`,{className:`flex-1 min-w-0`,children:[(0,q.jsx)(VN,{className:Lj(`text-sm font-medium`,e.type===`error`&&`text-error`,e.type===`success`&&`text-approval`,(!e.type||e.type===`info`)&&`text-primary`),children:e.title}),e.description&&(0,q.jsx)(BN,{className:`mt-1 text-xs text-muted line-clamp-2`,children:e.description})]}),(0,q.jsx)(HN,{className:`shrink-0 text-muted hover:text-primary transition-colors`,"aria-label":`Close`,children:(0,q.jsxs)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:`16`,height:`16`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,children:[(0,q.jsx)(`line`,{x1:`18`,y1:`6`,x2:`6`,y2:`18`}),(0,q.jsx)(`line`,{x1:`6`,y1:`6`,x2:`18`,y2:`18`})]})})]})}function JN(){let{toasts:e}=UN();return(0,q.jsx)(q.Fragment,{children:e.map(e=>(0,q.jsx)(qN,{toast:e},e.id))})}function YN(){return(0,q.jsxs)(_N,{timeout:GN,toastManager:KN,children:[(0,q.jsx)(JN,{}),(0,q.jsx)(bN,{className:`fixed bottom-4 right-4 z-[100] flex flex-col gap-2`})]})}var XN=[`CONNECTING`,`OPEN`,`CLOSING`,`CLOSED`],ZN=3e3,QN=8e3,$N=15e3,eP=5e3,tP=2e4,nP=1e4,rP=1500,iP=5e3,aP=750,oP=4,sP=5e3,cP=new class{constructor(){this.ws=null,this.listeners=new Set,this.statusListeners=new Set,this.status=`connecting`,this.error=null,this.reconnectAttempts=0,this.reconnectTimer=null,this.connectTimer=null,this.manualClose=!1,this.lastTick=Date.now(),this.wakeCheckInterval=null,this.lifecycleStarted=!1,this.heartbeatTimer=null,this.pongTimer=null,this.lastForceReconnectTs=0,this.lastConnectTs=0,this.pingSeq=0,this.connectionEpoch=0,this.consecutiveFailures=0,this.isResumeAttempt=!1,this.leakedSockets=new Set,this.verifyTimer=null,this.onVisibilityChange=()=>{if(YT(`ws_visibility`,{state:document.visibilityState,...this.wsSnap()},`info`),document.visibilityState===`visible`){let e=Date.now(),t=e-this.lastTick;this.lastTick=e,YT(`ws_resume`,{gapMs:t,...this.wsSnap()},`info`),this.ws?.readyState===WebSocket.OPEN?this.verifyConnection():this.forceReconnect(`visibilitychange`,!0)}else this.stopHeartbeat(),this.cancelVerify(),this.reconnectTimer&&=(window.clearTimeout(this.reconnectTimer),null)},this.onPageShow=e=>{YT(`ws_pageshow`,{persisted:e.persisted,...this.wsSnap()},`info`),e.persisted&&(this.lastTick=Date.now(),this.forceReconnect(`pageshow`,!0))}}wsSnap(){return{status:this.status,ws:this.ws?XN[this.ws.readyState]:null,attempt:this.reconnectAttempts,failures:this.consecutiveFailures,leaked:this.leakedSockets.size,online:typeof navigator<`u`?navigator.onLine:void 0,verifying:this.verifyTimer!==null,buffered:this.ws?this.ws.bufferedAmount:void 0}}connect(){if(this.ws){let e=this.ws.readyState===WebSocket.OPEN;if(e&&this.status===`connected`){YT(`ws_connect_skip`,{reason:`already_open`,...this.wsSnap()});return}let t=Date.now();if(this.ws.readyState===WebSocket.CONNECTING&&t-this.lastConnectTs<200){YT(`ws_connect_skip`,{reason:`already_connecting`,...this.wsSnap()});return}YT(`ws_connect_destroy_zombie`,{reason:e?`open_desynced`:`not_open`,...this.wsSnap()}),this.destroySocket()}this.manualClose=!1,this.clearConnectTimer(),this.setStatus(`connecting`);let e=`${window.location.protocol===`https:`?`wss`:`ws`}://${window.location.host}/ws`;YT(`ws_connect`,{url:e,resume:this.isResumeAttempt,...this.wsSnap()},`info`);let t=new WebSocket(e);this.ws=t,this.lastConnectTs=Date.now(),this.leakedSockets.add(t);let n=this.isResumeAttempt?QN:ZN;this.isResumeAttempt=!1,this.connectTimer=window.setTimeout(()=>{this.ws===t&&(this.connectTimer=null,t.readyState===WebSocket.OPEN&&this.status===`connected`||(YT(`ws_connect_timeout`,{wsState:XN[t.readyState],managerStatus:this.status,timeoutMs:n,...this.wsSnap()},`info`),this.consecutiveFailures+=1,this.destroySocket(),this.scheduleReconnect()))},n),t.onopen=()=>{if(this.ws!==t){YT(`ws_onopen_stale`,this.wsSnap(),`info`);return}YT(`ws_onopen`,this.wsSnap(),`info`),this.clearConnectTimer(),this.reconnectAttempts=0,this.consecutiveFailures=0,this.connectionEpoch+=1,this.leakedSockets.delete(t),this.setStatus(`connected`),this.startHeartbeat()},t.onmessage=e=>{try{let t=e.data,n=performance.now(),r=JSON.parse(t),i=performance.now()-n,a=r;if(a._parseMs=Math.round(i),a._rawLength=t.length,r.type===`pong`){r.seq===this.pingSeq&&(this.clearPongTimer(),this.verifyTimer!==null&&(this.cancelVerify(),YT(`ws_verify_ok`,this.wsSnap(),`info`),this.startHeartbeat(iP)));return}this.listeners.forEach(e=>e(r))}catch{}},t.onerror=()=>{this.ws===t&&(YT(`ws_onerror`,this.wsSnap(),`info`),this.clearConnectTimer())},t.onclose=e=>{if(this.ws!==t){YT(`ws_onclose_stale`,{code:e.code,...this.wsSnap()},`info`);return}YT(`ws_onclose`,{code:e.code,reason:e.reason,clean:e.wasClean,...this.wsSnap()},`info`),this.clearConnectTimer(),this.cancelVerify(),this.consecutiveFailures+=1,this.ws=null,this.manualClose?this.setStatus(`disconnected`):this.scheduleReconnect()}}disconnect(){this.manualClose=!0,this.clearConnectTimer(),this.cancelVerify(),this.reconnectTimer&&=(window.clearTimeout(this.reconnectTimer),null),this.destroySocket(),this.setStatus(`disconnected`)}startLifecycleListeners(){this.lifecycleStarted||typeof document>`u`||typeof window>`u`||(this.lifecycleStarted=!0,document.addEventListener(`visibilitychange`,this.onVisibilityChange),window.addEventListener(`pageshow`,this.onPageShow),this.lastTick=Date.now(),this.wakeCheckInterval=window.setInterval(()=>{let e=Date.now(),t=e-this.lastTick;this.isHidden()||(t>$N&&(YT(`ws_time_jump`,{gapMs:t,...this.wsSnap()},`info`),this.forceReconnect(`time_jump`,!0)),this.lastTick=e)},eP))}stopLifecycleListeners(){this.lifecycleStarted&&(this.lifecycleStarted=!1,document.removeEventListener(`visibilitychange`,this.onVisibilityChange),window.removeEventListener(`pageshow`,this.onPageShow),this.wakeCheckInterval!==null&&(window.clearInterval(this.wakeCheckInterval),this.wakeCheckInterval=null))}send(e){if(this.ws?.readyState!==WebSocket.OPEN)return!1;try{return this.ws.send(JSON.stringify(e)),!0}catch(t){return YT(`ws_send_error`,{messageType:e.type,error:t instanceof Error?t.message:String(t),...this.wsSnap()},`info`),this.destroySocket(),this.scheduleReconnect(),!1}}subscribe(e){return this.listeners.add(e),()=>this.listeners.delete(e)}subscribeStatus(e){return this.statusListeners.add(e),e(this.status,this.error,this.connectionEpoch),()=>this.statusListeners.delete(e)}getStatus(){return this.status}getConnectionEpoch(){return this.connectionEpoch}verifyConnection(){this.cancelVerify(),this.stopHeartbeat(),this.pingSeq+=1;let e=this.pingSeq,t=this.ws;if(YT(`ws_verify`,{seq:e,...this.wsSnap()},`info`),!this.send({type:`ping`,seq:e})){YT(`ws_verify_send_fail`,this.wsSnap(),`info`),this.forceReconnect(`verify_send_fail`,!0);return}this.verifyTimer=window.setTimeout(()=>{this.verifyTimer=null,this.ws===t&&(YT(`ws_verify_timeout`,this.wsSnap(),`info`),this.forceReconnect(`verify_timeout`,!0))},rP)}cancelVerify(){this.verifyTimer!==null&&(window.clearTimeout(this.verifyTimer),this.verifyTimer=null)}forceReconnect(e=`unknown`,t=!1){if(this.manualClose){YT(`ws_force_skip`,{trigger:e,reason:`manual_close`});return}let n=Date.now(),r=t?200:500;if(n-this.lastForceReconnectTs<r){YT(`ws_force_skip`,{trigger:e,reason:`debounce`,force:t});return}if(!t&&this.ws?.readyState===WebSocket.OPEN&&this.status===`connected`){YT(`ws_force_skip`,{trigger:e,reason:`already_connected`});return}this.lastForceReconnectTs=n,YT(`ws_force_reconnect`,{trigger:e,force:t,...this.wsSnap()},`info`),this.reconnectAttempts=0,this.consecutiveFailures=0,this.reconnectTimer&&=(window.clearTimeout(this.reconnectTimer),null),this.destroySocket(),t?(this.purgeLeakedSockets(),this.isResumeAttempt=!0,this.setStatus(`reconnecting`),this.reconnectTimer=window.setTimeout(()=>{this.reconnectTimer=null,this.connect()},aP)):this.connect()}startHeartbeat(e){this.stopHeartbeat();let t=()=>{this.ws?.readyState===WebSocket.OPEN&&(this.pingSeq+=1,this.send({type:`ping`,seq:this.pingSeq})&&(this.clearPongTimer(),this.pongTimer=window.setTimeout(()=>{this.pongTimer=null,YT(`ws_pong_timeout`,this.wsSnap(),`info`),this.destroySocket(),this.scheduleReconnect()},nP)))};e!==void 0&&e<tP?this.heartbeatTimer=window.setTimeout(()=>{t(),this.heartbeatTimer=window.setInterval(t,tP)},e):this.heartbeatTimer=window.setInterval(t,tP)}stopHeartbeat(){this.heartbeatTimer!==null&&(window.clearTimeout(this.heartbeatTimer),this.heartbeatTimer=null),this.clearPongTimer()}clearPongTimer(){this.pongTimer!==null&&(window.clearTimeout(this.pongTimer),this.pongTimer=null)}setStatus(e,t=null){this.status=e,this.error=t,this.statusListeners.forEach(n=>n(e,t,this.connectionEpoch))}scheduleReconnect(){if(this.stopHeartbeat(),this.isHidden()){YT(`ws_schedule_skip`,{reason:`hidden`,...this.wsSnap()}),this.setStatus(`reconnecting`);return}if(this.consecutiveFailures>=oP){YT(`ws_stall_detected`,this.wsSnap(),`info`),this.purgeLeakedSockets(),this.consecutiveFailures=0,this.reconnectAttempts=0,this.isResumeAttempt=!0,this.setStatus(`reconnecting`),this.reconnectTimer=window.setTimeout(()=>{this.reconnectTimer=null,this.connect()},sP);return}this.reconnectAttempts+=1;let e=Math.min(1e3*2**(this.reconnectAttempts-1),3e4);YT(`ws_schedule_reconnect`,{delay:e,...this.wsSnap()}),this.setStatus(`reconnecting`),this.reconnectTimer&&window.clearTimeout(this.reconnectTimer),this.reconnectTimer=window.setTimeout(()=>{this.reconnectTimer=null,this.connect()},e)}isHidden(){return typeof document<`u`&&document.visibilityState===`hidden`}clearConnectTimer(){this.connectTimer&&=(window.clearTimeout(this.connectTimer),null)}destroySocket(){if(this.clearConnectTimer(),this.stopHeartbeat(),this.cancelVerify(),!this.ws)return;let e=this.ws;this.ws=null,this.leakedSockets.add(e),e.onopen=null,e.onmessage=null,e.onerror=null,e.onclose=null;try{e.close()}catch{}}purgeLeakedSockets(){if(this.leakedSockets.size!==0){YT(`ws_purge_leaked`,{count:this.leakedSockets.size},`info`);for(let e of this.leakedSockets)try{e.onopen=null,e.onmessage=null,e.onerror=null,e.onclose=null,e.close()}catch{}this.leakedSockets.clear()}}};function lP(){let e=Wm(e=>e.setConnectionState);return(0,x.useEffect)(()=>{cP.connect(),cP.startLifecycleListeners();let t=cP.subscribeStatus((t,n,r)=>{e(t,n,r)});return()=>{t(),cP.stopLifecycleListeners()}},[e]),{sendMessage:(0,x.useMemo)(()=>e=>{cP.send(e)},[]),subscribe:(0,x.useMemo)(()=>cP.subscribe.bind(cP),[]),getConnectionEpoch:(0,x.useMemo)(()=>()=>cP.getConnectionEpoch(),[])}}var uP=100;function dP({viewport:e,win:t,doc:n}){if(!e)return!1;let r=Math.max(0,e.offsetTop||0),i=Math.max(0,e.offsetLeft||0),a=t.innerHeight-(e.height+r),o=Math.max(0,a),s=Math.max(0,e.height||0),c=Math.max(0,e.width||0);return n.documentElement.style.setProperty(`--keyboard-inset`,`${o}px`),n.documentElement.style.setProperty(`--viewport-offset-top`,`${r}px`),n.documentElement.style.setProperty(`--viewport-offset-left`,`${i}px`),n.documentElement.style.setProperty(`--visual-viewport-height`,`${s}px`),n.documentElement.style.setProperty(`--visual-viewport-width`,`${c}px`),o>uP?n.documentElement.classList.add(`keyboard-visible`):n.documentElement.classList.remove(`keyboard-visible`),!0}function fP(e){e.documentElement.style.removeProperty(`--keyboard-inset`),e.documentElement.style.removeProperty(`--viewport-offset-top`),e.documentElement.style.removeProperty(`--viewport-offset-left`),e.documentElement.style.removeProperty(`--visual-viewport-height`),e.documentElement.style.removeProperty(`--visual-viewport-width`),e.documentElement.classList.remove(`keyboard-visible`)}function pP(){(0,x.useEffect)(()=>{let e=window.visualViewport;if(!e)return;let t=null,n=null,r=()=>{let e=document.activeElement;if(!e)return!1;let t=e.tagName?.toLowerCase();return t===`input`||t===`textarea`?!0:!!e.isContentEditable},i=()=>{dP({viewport:e,win:window,doc:document})},a=()=>{if(typeof window.requestAnimationFrame!=`function`){i();return}t!==null&&window.cancelAnimationFrame(t);let e=performance.now(),n=()=>{i(),t=performance.now()-e<1500?window.requestAnimationFrame(n):null};t=window.requestAnimationFrame(n)},o=()=>{if(!r()){c();return}i()},s=()=>{n!==null||typeof window.setInterval!=`function`||(n=window.setInterval(o,250),o())},c=()=>{n===null||typeof window.clearInterval!=`function`||(window.clearInterval(n),n=null)},l=()=>{r()?(a(),s(),i()):c()},u=()=>{l()},d=()=>{l()},f=()=>{a()};return i(),l(),e.addEventListener(`resize`,i),e.addEventListener(`scroll`,i),typeof window.addEventListener==`function`&&(window.addEventListener(`resize`,i),window.addEventListener(`orientationchange`,f)),typeof document.addEventListener==`function`&&(document.addEventListener(`focusin`,u),document.addEventListener(`focusout`,d),document.addEventListener(`focus`,u,!0),document.addEventListener(`blur`,d,!0)),()=>{e.removeEventListener(`resize`,i),e.removeEventListener(`scroll`,i),typeof window.removeEventListener==`function`&&(window.removeEventListener(`resize`,i),window.removeEventListener(`orientationchange`,f)),typeof document.removeEventListener==`function`&&(document.removeEventListener(`focusin`,u),document.removeEventListener(`focusout`,d),document.removeEventListener(`focus`,u,!0),document.removeEventListener(`blur`,d,!0)),t!==null&&typeof window.cancelAnimationFrame==`function`&&window.cancelAnimationFrame(t),c(),fP(document)}},[])}function mP(e,t,n){let r=e;return t.length>0&&(r=r.filter(e=>t.includes(e.projectPath))),n.length>0&&(r=r.filter(e=>n.includes(e.host??``))),r}function hP(){let[e,t]=(0,x.useState)(!1),[n,r]=(0,x.useState)(void 0),[i,a]=(0,x.useState)(void 0),[o,s]=(0,x.useState)(void 0),[c,l]=(0,x.useState)(!1),[u,d]=(0,x.useState)(null),[f,p]=(0,x.useState)(null),[m,h]=(0,x.useState)(null),g=Wm(e=>e.sessions),_=Wm(e=>e.agentSessions),v=Wm(e=>e.agentSessionsEpoch),y=Wm(e=>e.selectedSessionId),b=Wm(e=>e.selectedHibernatingSessionId),S=Wm(e=>e.setSessions),C=Wm(e=>e.setAgentSessions),w=Wm(e=>e.setActiveAgentSessions),T=Wm(e=>e.setHostStatuses),E=Wm(e=>e.updateSession),D=Wm(e=>e.setSelectedSessionId),O=Wm(e=>e.setSelectedHibernatingSessionId),k=Wm(e=>e.hasLoaded),A=Wm(e=>e.connectionStatus),j=Wm(e=>e.connectionError),M=Wm(e=>e.clearExitingSession),N=Wm(e=>e.markSessionExiting),P=Wm(e=>e.setRemoteAllowControl),F=Wm(e=>e.setRemoteAllowAttach),I=Wm(e=>e.setHostLabel),L=Wm(e=>e.setPreferWindowName),R=Wm(e=>e.hostStatuses),z=Wm(e=>e.remoteAllowControl),B=Wm(e=>e.hostLabel),V=ZD(e=>e.theme),H=ee(),U=G(e=>e.defaultProjectDir),W=G(e=>e.commandPresets),te=G(e=>e.defaultPresetId),ne=G(e=>e.lastProjectPath),re=G(e=>e.setLastProjectPath),ie=G(e=>e.addRecentPath),ae=G(e=>e.shortcutModifier),oe=G(e=>e.sidebarWidth),se=G(e=>e.setSidebarWidth),ce=G(e=>e.projectFilters),le=G(e=>e.hostFilters),ue=G(e=>e.soundOnPermission),de=G(e=>e.soundOnIdle),fe=Wm(e=>e.connectionEpoch),{sendMessage:pe,subscribe:me,getConnectionEpoch:he}=lP();pP(),(0,x.useEffect)(()=>{if(typeof document>`u`||!ue&&!de)return;let e=!1,t=()=>{e&&!Gj()||(e=!0,qj())};return document.addEventListener(`click`,t,{passive:!0}),document.addEventListener(`keydown`,t,{passive:!0}),document.addEventListener(`touchstart`,t,{passive:!0}),()=>{document.removeEventListener(`click`,t),document.removeEventListener(`keydown`,t),document.removeEventListener(`touchstart`,t)}},[ue,de]);let ge=(0,x.useRef)(!1),_e=(0,x.useCallback)(e=>{e.preventDefault(),ge.current=!0,document.body.style.cursor=`col-resize`,document.body.style.userSelect=`none`},[]);(0,x.useEffect)(()=>{if(typeof document>`u`||typeof document.addEventListener!=`function`)return;let e=e=>{if(!ge.current)return;let t=e.clientX;se(Math.max(180,Math.min(400,t)))},t=()=>{ge.current&&(ge.current=!1,document.body.style.cursor=``,document.body.style.userSelect=``)};return document.addEventListener(`mousemove`,e),document.addEventListener(`mouseup`,t),()=>{document.removeEventListener(`mousemove`,e),document.removeEventListener(`mouseup`,t)}},[se]),(0,x.useEffect)(()=>{let e=me(e=>{if(e.type!==`terminal-output`){if(e.type===`sessions`){let t=Wm.getState().sessions,{soundOnPermission:n,soundOnIdle:r}=G.getState();if(n||r)for(let i of e.sessions){let e=t.find(e=>e.id===i.id);e&&e.status!==i.status&&(e.status!==`permission`&&i.status===`permission`&&n&&Xj(),e.status===`working`&&i.status===`waiting`&&r&&Zj())}if(Ne.current.size>0){let e=he();for(let[t,n]of Ne.current)n.epoch!==e&&Ne.current.delete(t)}let i=Ne.current.size>0?e.sessions.filter(e=>!Ne.current.has(e.id)):e.sessions,{selectedSessionId:a,selectedHibernatingSessionId:o}=Wm.getState(),s=a!==null&&o===null&&!i.some(e=>e.id===a)?t.find(e=>e.id===a)?.agentSessionId?.trim()??null:null;s&&(ke.current=s),S(i);let c=Ae.current,{selectedSessionId:l,selectedHibernatingSessionId:u}=Wm.getState(),{projectFilters:d,hostFilters:f}=G.getState();if(c&&l===null&&u===null){let e=i.find(e=>!(e.agentSessionId?.trim()!==c||d.length>0&&!d.includes(e.projectPath)||f.length>0&&!f.includes(e.host??``)));e&&(Ae.current=null,D(e.id))}}if(e.type===`host-status`&&T(e.hosts),e.type===`server-config`&&(P(e.remoteAllowControl),F(e.remoteAllowAttach),I(e.hostLabel),L(e.preferWindowName),e.clientLogLevel&&JT(e.clientLogLevel)),e.type===`session-update`){let t=Wm.getState().sessions.find(t=>t.id===e.session.id)?.status,n=e.session.status;if(E(e.session),t){let{soundOnPermission:e,soundOnIdle:r}=G.getState();t!==`permission`&&n===`permission`&&e&&Xj(),t===`working`&&n===`waiting`&&r&&Zj()}}if(e.type===`session-created`){let t=Wm.getState().sessions;t.some(t=>t.id===e.session.id)||S([e.session,...t]),D(e.session.id),ie(e.session.projectPath);let{projectFilters:n,setProjectFilters:r}=G.getState();n.length>0&&!n.includes(e.session.projectPath)&&r([...n,e.session.projectPath])}if(e.type===`session-removed`){SD(e.sessionId);let t=Wm.getState().sessions,n=t.filter(t=>t.id!==e.sessionId);n.length!==t.length&&S(n)}if(e.type===`agent-sessions`){let t=Array.isArray(e.active)?e.active:[],n=Array.isArray(e.hibernating)?e.hibernating:[],r=Array.isArray(e.history)?e.history:[],{selectedHibernatingSessionId:i}=Wm.getState(),a=ke.current;i&&!n.some(e=>e.sessionId===i)&&(Ae.current=i),C(t,n,r),h(e=>e&&n.some(t=>t.sessionId===e.sessionId)?null:e),a&&n.some(e=>e.sessionId===a)?(ke.current=null,O(a)):a&&(ke.current=null)}if(e.type===`agent-sessions-active`&&w(Array.isArray(e.active)?e.active:[]),e.type===`session-orphaned`&&!e.supersededBy){let t=Wm.getState().sessions,n=t.filter(t=>t.agentSessionId?.trim()!==e.session.sessionId);n.length!==t.length&&S(n)}if(e.type===`session-activated`){let t=Wm.getState().sessions.find(t=>t.tmuxWindow===e.window);t&&E({...t,agentSessionId:e.session.sessionId,agentSessionName:e.session.displayName,logFilePath:e.session.logFilePath,isPinned:e.session.isPinned,lastUserMessage:e.session.lastUserMessage??t.lastUserMessage})}if(e.type===`session-wake-result`)if(e.ok&&e.session){h(t=>t?.sessionId===e.sessionId?null:t);let t=Wm.getState().sessions;t.some(t=>t.id===e.session.id)||S([e.session,...t]),D(e.session.id)}else e.ok||(d(`${e.error?.code}: ${e.error?.message}`),window.setTimeout(()=>d(null),6e3));if(e.type===`session-hibernate-result`&&(e.ok?(e.session&&h(e.session),O(e.sessionId)):(d(e.error??`Failed to hibernate session`),window.setTimeout(()=>d(null),6e3))),e.type===`terminal-error`&&(!e.sessionId||e.sessionId===y)&&(d(`${e.code}: ${e.message}`),window.setTimeout(()=>d(null),6e3)),e.type===`terminal-ready`&&e.sessionId===y&&d(null),e.type===`error`&&(d(e.message),window.setTimeout(()=>d(null),6e3)),e.type===`kill-failed`){let t=Ne.current.get(e.sessionId);if(t){let n=Wm.getState().sessions;n.some(t=>t.id===e.sessionId)||S([t.session,...n]),t.wasSelected&&D(e.sessionId),Ne.current.delete(e.sessionId)}M(e.sessionId),d(e.message),window.setTimeout(()=>d(null),6e3)}e.type===`session-move-to-history-result`&&!e.ok&&e.error&&(d(e.error),window.setTimeout(()=>d(null),6e3))}});return()=>{e()}},[y,b,ie,M,pe,D,O,h,S,C,w,T,P,F,I,L,me,E]);let ve=(0,x.useMemo)(()=>g.find(e=>e.id===y)||null,[y,g]),ye=_.hibernating??[],be=_.history??[],xe=(0,x.useMemo)(()=>mP(ye,ce,le),[ye,ce,le]),Se=(0,x.useMemo)(()=>xe.find(e=>e.sessionId===b)||(m?.sessionId===b?m:null),[xe,m,b]);(0,x.useEffect)(()=>{ve?.projectPath&&!ve.remote&&re(ve.projectPath)},[ve?.projectPath,ve?.remote,re]);let Ce=G(e=>e.sessionSortMode),we=G(e=>e.sessionSortDirection),Te=G(e=>e.manualSessionOrder),Ee=(0,x.useMemo)(()=>km(g,{mode:Ce,direction:we,manualOrder:Te}),[g,Ce,we,Te]),De=(0,x.useMemo)(()=>{let e=Ee;return ce.length>0&&(e=e.filter(e=>ce.includes(e.projectPath))),le.length>0&&(e=e.filter(e=>le.includes(e.host??``))),e},[Ee,ce,le]),Oe=(0,x.useRef)(b),ke=(0,x.useRef)(null),Ae=(0,x.useRef)(null),je=(0,x.useRef)(fe),Me=(0,x.useCallback)(()=>De.length>0?(D(De[0].id),!0):xe.length>0?(O(xe[0].sessionId),!0):!1,[De,xe,D,O]);(0,x.useEffect)(()=>{let e=Oe.current;e&&b===null&&!ye.some(t=>t.sessionId===e)?Ae.current=e:b!==null&&(Ae.current=null),Oe.current=b},[ye,b]),(0,x.useEffect)(()=>{m&&b!==m.sessionId&&h(null)},[m,b]),(0,x.useEffect)(()=>{je.current!==fe&&(je.current=fe,ke.current=null,Ae.current=null,h(null))},[fe]),(0,x.useEffect)(()=>{k&&(b||y&&(De.some(e=>e.id===y)||Me()||D(null)))},[k,y,b,Me,D]),(0,x.useEffect)(()=>{if(!b||m?.sessionId===b||v!==fe||xe.some(e=>e.sessionId===b))return;let e=De.find(e=>e.agentSessionId?.trim()===b);if(e){D(e.id);return}Me()||O(null)},[xe,De,v,m,b,Me,D,O,fe]),(0,x.useEffect)(()=>{let e=Ae.current;if(!e)return;if(b!==null){Ae.current=null;return}let t=De.find(t=>t.agentSessionId?.trim()===e);if(t){Ae.current=null,D(t.id);return}if(y!==null){Ae.current=null;return}Me()&&(Ae.current=null)},[De,y,b,Me,D]),(0,x.useEffect)(()=>{window.matchMedia(`(max-width: 767px)`).matches&&k&&y===null&&b===null&&(De.length>0||xe.length>0)&&Me()},[xe.length,De.length,k,Me,y,b]);let Ne=(0,x.useRef)(new Map),Pe=(0,x.useCallback)((e,t=`unknown`)=>{SD(e);let{sessions:n,selectedSessionId:r}=Wm.getState(),i=n.find(t=>t.id===e);i&&Ne.current.set(e,{session:i,wasSelected:r===e,epoch:he()}),(0,K.flushSync)(()=>{N(e),S(n.filter(t=>t.id!==e))}),pe({type:`session-kill`,sessionId:e,source:t})},[N,S,pe]);(0,x.useEffect)(()=>{let n=We(ae),r=r=>{if(r.defaultPrevented)return;let i=r.code,a=qe(r,n);if(a&&(i===`BracketLeft`||i===`BracketRight`)){r.preventDefault();let e=i===`BracketLeft`?-1:1,t=De;if(t.length===0){let t=xe;if(t.length===0)return;let n=t.findIndex(e=>e.sessionId===b);if(n===-1){O(t[0].sessionId);return}O(t[(n+e+t.length)%t.length].sessionId);return}let n=t.findIndex(e=>e.id===y);if(n===-1){D(t[0].id);return}D(t[(n+e+t.length)%t.length].id);return}if(a&&i===`KeyN`){r.preventDefault(),!e&&H&&t(!0);return}if(a&&i===`KeyX`){r.preventDefault(),y&&!e&&Pe(y,`keyboard_shortcut`);return}};return window.addEventListener(`keydown`,r),()=>window.removeEventListener(`keydown`,r)},[e,y,b,D,O,De,xe,Pe,ae,H]);let Fe=()=>H?(r(void 0),a(void 0),s(void 0),t(!0),!0):!1,Ie=()=>l(!0),Le=(e,t,n,r)=>{pe({type:`session-create`,projectPath:e,name:t,command:n,host:r}),r||re(e)},Re=e=>{pe({type:`session-wake`,sessionId:e})},ze=(0,x.useCallback)(e=>{pe({type:`session-hibernate`,sessionId:e})},[pe]),Be=(e,t)=>{pe({type:`session-rename`,sessionId:e,newName:t})},Ve=(0,x.useCallback)(e=>{let t=g.find(t=>t.id===e);t&&pe({type:`session-create`,projectPath:t.projectPath,command:t.command||void 0,host:t.remote&&t.host?t.host:void 0})},[g,pe]),He=(0,x.useCallback)(e=>{pe({type:`session-move-to-history`,sessionId:e})},[pe]);(0,x.useEffect)(()=>{document.documentElement.setAttribute(`data-theme`,V)},[V]),(0,x.useEffect)(()=>{fetch(`/api/server-info`).then(e=>e.json()).then(e=>p(e)).catch(()=>{})},[]);let Ue=(0,x.useMemo)(()=>B?R.filter(e=>e.host!==B):R,[R,B]);return(0,q.jsxs)(`div`,{className:`flex h-full overflow-hidden`,children:[(0,q.jsxs)(`div`,{className:`hidden h-full flex-col md:flex md:shrink-0`,style:{width:oe},children:[(0,q.jsx)(Xe,{connectionStatus:A,onNewSession:Fe,onOpenSettings:Ie,tailscaleIp:f?.tailscaleIp??null}),(0,q.jsx)(UT,{sessions:g,hibernatingSessions:ye,historySessions:be,selectedSessionId:y,selectedHibernatingSessionId:b,onSelect:D,onSelectHibernating:O,onRename:Be,onResume:Re,onHibernate:ze,onKill:Pe,onDuplicate:Ve,onMoveToHistory:He,onNewSession:Fe,loading:!k,error:j||u})]}),(0,q.jsx)(`div`,{className:`hidden md:block w-1 shrink-0 cursor-col-resize bg-transparent transition-colors hover:bg-white/10 active:bg-white/20`,onMouseDown:_e}),(0,q.jsx)(RO,{session:ve,sessions:De,hibernatingSession:Se,hibernatingSessions:ye,connectionStatus:A,connectionEpoch:fe,sendMessage:pe,subscribe:me,onClose:()=>D(null),onSelectSession:D,onSelectHibernatingSession:O,onNewSession:Fe,onKillSession:Pe,onRenameSession:Be,onOpenSettings:Ie,onResumeSession:Re,onHibernateSession:ze,onMoveToHistory:He,historySessions:be,loading:!k,error:j||u}),(0,q.jsx)(BO,{isOpen:e,onClose:()=>t(!1),onCreate:Le,defaultProjectDir:U,commandPresets:W,defaultPresetId:te,lastProjectPath:ne,activeProjectPath:ve&&!ve.remote?ve.projectPath:void 0,remoteHosts:Ue,remoteAllowControl:z,initialHost:n,initialPath:i,initialCommand:o}),(0,q.jsx)(Qj,{isOpen:c,onClose:()=>l(!1)}),(0,q.jsx)(YN,{})]})}var gP=`modulepreload`,_P=function(e){return`/`+e},vP={},yP=function(e,t,n){let r=Promise.resolve();if(t&&t.length>0){let e=document.getElementsByTagName(`link`),i=document.querySelector(`meta[property=csp-nonce]`),a=i?.nonce||i?.getAttribute(`nonce`);function o(e){return Promise.all(e.map(e=>Promise.resolve(e).then(e=>({status:`fulfilled`,value:e}),e=>({status:`rejected`,reason:e}))))}r=o(t.map(t=>{if(t=_P(t,n),t in vP)return;vP[t]=!0;let r=t.endsWith(`.css`),i=r?`[rel="stylesheet"]`:``;if(n)for(let n=e.length-1;n>=0;n--){let i=e[n];if(i.href===t&&(!r||i.rel===`stylesheet`))return}else if(document.querySelector(`link[href="${t}"]${i}`))return;let o=document.createElement(`link`);if(o.rel=r?`stylesheet`:gP,r||(o.as=`script`),o.crossOrigin=``,o.href=t,a&&o.setAttribute(`nonce`,a),document.head.appendChild(o),r)return new Promise((e,n)=>{o.addEventListener(`load`,e),o.addEventListener(`error`,()=>n(Error(`Unable to preload CSS for ${t}`)))})}))}function i(e){let t=new Event(`vite:preloadError`,{cancelable:!0});if(t.payload=e,window.dispatchEvent(t),!t.defaultPrevented)throw e}return r.then(t=>{for(let e of t||[])e.status===`rejected`&&i(e.reason);return e().catch(i)})},bP=`true`,xP=`false`,SP=bP===`true`,CP=xP===`true`;function wP(e={}){let{immediate:t=!1,onNeedRefresh:n,onOfflineReady:r,onRegistered:i,onRegisteredSW:a,onRegisterError:o}=e,s,c,l,u=async(e=!0)=>{await c,SP||l?.()};async function d(){if(`serviceWorker`in navigator){if(s=await yP(async()=>{let{Workbox:e}=await import(`./workbox-window.prod.es5-Bq4GJJid.js`);return{Workbox:e}},[]).then(({Workbox:e})=>new e(`/sw.js`,{scope:`/`,type:`classic`})).catch(e=>{o?.(e)}),!s)return;if(l=()=>{s?.messageSkipWaiting()},!CP)if(SP)s.addEventListener(`activated`,e=>{(e.isUpdate||e.isExternal)&&window.location.reload()}),s.addEventListener(`installed`,e=>{e.isUpdate||r?.()});else{let e=!1,t=()=>{e=!0,s?.addEventListener(`controlling`,e=>{e.isUpdate&&window.location.reload()}),n?.()};s.addEventListener(`installed`,n=>{n.isUpdate===void 0?n.isExternal===void 0?!e&&r?.():n.isExternal?t():!e&&r?.():n.isUpdate||r?.()}),s.addEventListener(`waiting`,t)}s.register({immediate:t}).then(e=>{a?a(`/sw.js`,e):i?.(e)}).catch(e=>{o?.(e)})}}return c=d(),u}Ve()&&document.documentElement.classList.add(`ios`),He()&&document.documentElement.classList.add(`ios-pwa`),wP({immediate:!0,onRegisteredSW(e,t){t&&(setInterval(()=>{t.update()},300*1e3),document.addEventListener(`visibilitychange`,()=>{document.visibilityState===`visible`&&t.update()}))}});var TP=document.getElementById(`root`);if(!TP)throw Error(`Root element not found`);(0,E.createRoot)(TP).render((0,q.jsx)(x.StrictMode,{children:(0,q.jsx)(hP,{})}));