@shanesaravia/hive 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (47) hide show
  1. package/CHANGELOG.md +17 -0
  2. package/LICENSE +21 -0
  3. package/README.md +417 -0
  4. package/dist/bin/hive-emit.js +75 -0
  5. package/dist/bin/hive.js +506 -0
  6. package/node_modules/@hive/shared/dist/index.d.ts +2 -0
  7. package/node_modules/@hive/shared/dist/index.js +2 -0
  8. package/node_modules/@hive/shared/dist/status.d.ts +12 -0
  9. package/node_modules/@hive/shared/dist/status.js +52 -0
  10. package/node_modules/@hive/shared/dist/types.d.ts +384 -0
  11. package/node_modules/@hive/shared/dist/types.js +14 -0
  12. package/node_modules/@hive/shared/package.json +18 -0
  13. package/package.json +72 -0
  14. package/packages/server/dist/api/rest.js +793 -0
  15. package/packages/server/dist/api/ws.js +37 -0
  16. package/packages/server/dist/config.js +24 -0
  17. package/packages/server/dist/control/codexRuntime.js +169 -0
  18. package/packages/server/dist/control/killer.js +25 -0
  19. package/packages/server/dist/control/launcher.js +114 -0
  20. package/packages/server/dist/control/messaging.js +75 -0
  21. package/packages/server/dist/control/nativeCommands.js +29 -0
  22. package/packages/server/dist/control/permissionPark.js +23 -0
  23. package/packages/server/dist/control/providerModels.js +53 -0
  24. package/packages/server/dist/events/eventsStore.js +55 -0
  25. package/packages/server/dist/health/deriveAlerts.js +55 -0
  26. package/packages/server/dist/hooks/hookIngest.js +90 -0
  27. package/packages/server/dist/hooks/hookSpool.js +33 -0
  28. package/packages/server/dist/hooks/setupHooks.js +102 -0
  29. package/packages/server/dist/index.js +88 -0
  30. package/packages/server/dist/messages/messagesStore.js +211 -0
  31. package/packages/server/dist/missions/missionsStore.js +283 -0
  32. package/packages/server/dist/paths/pathResolver.js +167 -0
  33. package/packages/server/dist/plans/plansStore.js +212 -0
  34. package/packages/server/dist/policies/policiesStore.js +61 -0
  35. package/packages/server/dist/reports/githubPublisher.js +21 -0
  36. package/packages/server/dist/reports/missionReport.js +16 -0
  37. package/packages/server/dist/roster/rosterBuilder.js +243 -0
  38. package/packages/server/dist/security/originPolicy.js +31 -0
  39. package/packages/server/dist/skills/skillDiscovery.js +69 -0
  40. package/packages/server/dist/templates/templateDiscovery.js +97 -0
  41. package/packages/server/dist/watch/jobsWatcher.js +224 -0
  42. package/packages/server/dist/watch/sessionsWatcher.js +65 -0
  43. package/packages/web/dist/assets/index-CrKMFCkZ.js +11 -0
  44. package/packages/web/dist/assets/index-gEGU_lr3.css +2 -0
  45. package/packages/web/dist/favicon.svg +12 -0
  46. package/packages/web/dist/index.html +14 -0
  47. package/templates/agents/hive-orchestrator.md +42 -0
@@ -0,0 +1,11 @@
1
+ var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t),e=null),t.exports),s=(e,i,o,s)=>{if(i&&typeof i==`object`||typeof i==`function`)for(var c=r(i),l=0,u=c.length,d;l<u;l++)d=c[l],!a.call(e,d)&&d!==o&&t(e,d,{get:(e=>i[e]).bind(null,d),enumerable:!(s=n(i,d))||s.enumerable});return e},c=(n,r,o)=>(o=n==null?{}:e(i(n)),s(r||!n||!n.__esModule||!a.call(n,`default`)?t(o,`default`,{value:n,enumerable:!0}):o,n));(function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),t.credentials=e.crossOrigin===`use-credentials`?`include`:e.crossOrigin===`anonymous`?`omit`:`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();var l=o((e=>{var t=Symbol.for(`react.element`),n=Symbol.for(`react.portal`),r=Symbol.for(`react.fragment`),i=Symbol.for(`react.strict_mode`),a=Symbol.for(`react.profiler`),o=Symbol.for(`react.provider`),s=Symbol.for(`react.context`),c=Symbol.for(`react.forward_ref`),l=Symbol.for(`react.suspense`),u=Symbol.for(`react.memo`),d=Symbol.for(`react.lazy`),f=Symbol.iterator;function p(e){return typeof e!=`object`||!e?null:(e=f&&e[f]||e[`@@iterator`],typeof e==`function`?e:null)}var m={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},h=Object.assign,g={};function _(e,t,n){this.props=e,this.context=t,this.refs=g,this.updater=n||m}_.prototype.isReactComponent={},_.prototype.setState=function(e,t){if(typeof e!=`object`&&typeof e!=`function`&&e!=null)throw Error(`setState(...): takes an object of state variables to update or a function which returns an object of state variables.`);this.updater.enqueueSetState(this,e,t,`setState`)},_.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,`forceUpdate`)};function v(){}v.prototype=_.prototype;function y(e,t,n){this.props=e,this.context=t,this.refs=g,this.updater=n||m}var b=y.prototype=new v;b.constructor=y,h(b,_.prototype),b.isPureReactComponent=!0;var x=Array.isArray,S=Object.prototype.hasOwnProperty,C={current:null},w={key:!0,ref:!0,__self:!0,__source:!0};function T(e,n,r){var i,a={},o=null,s=null;if(n!=null)for(i in n.ref!==void 0&&(s=n.ref),n.key!==void 0&&(o=``+n.key),n)S.call(n,i)&&!w.hasOwnProperty(i)&&(a[i]=n[i]);var c=arguments.length-2;if(c===1)a.children=r;else if(1<c){for(var l=Array(c),u=0;u<c;u++)l[u]=arguments[u+2];a.children=l}if(e&&e.defaultProps)for(i in c=e.defaultProps,c)a[i]===void 0&&(a[i]=c[i]);return{$$typeof:t,type:e,key:o,ref:s,props:a,_owner:C.current}}function E(e,n){return{$$typeof:t,type:e.type,key:n,ref:e.ref,props:e.props,_owner:e._owner}}function D(e){return typeof e==`object`&&!!e&&e.$$typeof===t}function O(e){var t={"=":`=0`,":":`=2`};return`$`+e.replace(/[=:]/g,function(e){return t[e]})}var k=/\/+/g;function A(e,t){return typeof e==`object`&&e&&e.key!=null?O(``+e.key):t.toString(36)}function j(e,r,i,a,o){var s=typeof e;(s===`undefined`||s===`boolean`)&&(e=null);var c=!1;if(e===null)c=!0;else switch(s){case`string`:case`number`:c=!0;break;case`object`:switch(e.$$typeof){case t:case n:c=!0}}if(c)return c=e,o=o(c),e=a===``?`.`+A(c,0):a,x(o)?(i=``,e!=null&&(i=e.replace(k,`$&/`)+`/`),j(o,r,i,``,function(e){return e})):o!=null&&(D(o)&&(o=E(o,i+(!o.key||c&&c.key===o.key?``:(``+o.key).replace(k,`$&/`)+`/`)+e)),r.push(o)),1;if(c=0,a=a===``?`.`:a+`:`,x(e))for(var l=0;l<e.length;l++){s=e[l];var u=a+A(s,l);c+=j(s,r,i,u,o)}else if(u=p(e),typeof u==`function`)for(e=u.call(e),l=0;!(s=e.next()).done;)s=s.value,u=a+A(s,l++),c+=j(s,r,i,u,o);else if(s===`object`)throw r=String(e),Error(`Objects are not valid as a React child (found: `+(r===`[object Object]`?`object with keys {`+Object.keys(e).join(`, `)+`}`:r)+`). If you meant to render a collection of children, use an array instead.`);return c}function M(e,t,n){if(e==null)return e;var r=[],i=0;return j(e,r,``,``,function(e){return t.call(n,e,i++)}),r}function ee(e){if(e._status===-1){var t=e._result;t=t(),t.then(function(t){(e._status===0||e._status===-1)&&(e._status=1,e._result=t)},function(t){(e._status===0||e._status===-1)&&(e._status=2,e._result=t)}),e._status===-1&&(e._status=0,e._result=t)}if(e._status===1)return e._result.default;throw e._result}var N={current:null},P={transition:null},te={ReactCurrentDispatcher:N,ReactCurrentBatchConfig:P,ReactCurrentOwner:C};function ne(){throw Error(`act(...) is not supported in production builds of React.`)}e.Children={map:M,forEach:function(e,t,n){M(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return M(e,function(){t++}),t},toArray:function(e){return M(e,function(e){return e})||[]},only:function(e){if(!D(e))throw Error(`React.Children.only expected to receive a single React element child.`);return e}},e.Component=_,e.Fragment=r,e.Profiler=a,e.PureComponent=y,e.StrictMode=i,e.Suspense=l,e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=te,e.act=ne,e.cloneElement=function(e,n,r){if(e==null)throw Error(`React.cloneElement(...): The argument must be a React element, but you passed `+e+`.`);var i=h({},e.props),a=e.key,o=e.ref,s=e._owner;if(n!=null){if(n.ref!==void 0&&(o=n.ref,s=C.current),n.key!==void 0&&(a=``+n.key),e.type&&e.type.defaultProps)var c=e.type.defaultProps;for(l in n)S.call(n,l)&&!w.hasOwnProperty(l)&&(i[l]=n[l]===void 0&&c!==void 0?c[l]:n[l])}var l=arguments.length-2;if(l===1)i.children=r;else if(1<l){c=Array(l);for(var u=0;u<l;u++)c[u]=arguments[u+2];i.children=c}return{$$typeof:t,type:e.type,key:a,ref:o,props:i,_owner:s}},e.createContext=function(e){return e={$$typeof:s,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},e.Provider={$$typeof:o,_context:e},e.Consumer=e},e.createElement=T,e.createFactory=function(e){var t=T.bind(null,e);return t.type=e,t},e.createRef=function(){return{current:null}},e.forwardRef=function(e){return{$$typeof:c,render:e}},e.isValidElement=D,e.lazy=function(e){return{$$typeof:d,_payload:{_status:-1,_result:e},_init:ee}},e.memo=function(e,t){return{$$typeof:u,type:e,compare:t===void 0?null:t}},e.startTransition=function(e){var t=P.transition;P.transition={};try{e()}finally{P.transition=t}},e.unstable_act=ne,e.useCallback=function(e,t){return N.current.useCallback(e,t)},e.useContext=function(e){return N.current.useContext(e)},e.useDebugValue=function(){},e.useDeferredValue=function(e){return N.current.useDeferredValue(e)},e.useEffect=function(e,t){return N.current.useEffect(e,t)},e.useId=function(){return N.current.useId()},e.useImperativeHandle=function(e,t,n){return N.current.useImperativeHandle(e,t,n)},e.useInsertionEffect=function(e,t){return N.current.useInsertionEffect(e,t)},e.useLayoutEffect=function(e,t){return N.current.useLayoutEffect(e,t)},e.useMemo=function(e,t){return N.current.useMemo(e,t)},e.useReducer=function(e,t,n){return N.current.useReducer(e,t,n)},e.useRef=function(e){return N.current.useRef(e)},e.useState=function(e){return N.current.useState(e)},e.useSyncExternalStore=function(e,t,n){return N.current.useSyncExternalStore(e,t,n)},e.useTransition=function(){return N.current.useTransition()},e.version=`18.3.1`})),u=o(((e,t)=>{t.exports=l()})),d=o((e=>{function t(e,t){var n=e.length;e.push(t);a:for(;0<n;){var r=n-1>>>1,a=e[r];if(0<i(a,t))e[r]=t,e[n]=a,n=r;else break a}}function n(e){return e.length===0?null:e[0]}function r(e){if(e.length===0)return null;var t=e[0],n=e.pop();if(n!==t){e[0]=n;a:for(var r=0,a=e.length,o=a>>>1;r<o;){var s=2*(r+1)-1,c=e[s],l=s+1,u=e[l];if(0>i(c,n))l<a&&0>i(u,c)?(e[r]=u,e[l]=n,r=l):(e[r]=c,e[s]=n,r=s);else if(l<a&&0>i(u,n))e[r]=u,e[l]=n,r=l;else break a}}return t}function i(e,t){var n=e.sortIndex-t.sortIndex;return n===0?e.id-t.id:n}if(typeof performance==`object`&&typeof performance.now==`function`){var a=performance;e.unstable_now=function(){return a.now()}}else{var o=Date,s=o.now();e.unstable_now=function(){return o.now()-s}}var c=[],l=[],u=1,d=null,f=3,p=!1,m=!1,h=!1,g=typeof setTimeout==`function`?setTimeout:null,_=typeof clearTimeout==`function`?clearTimeout:null,v=typeof setImmediate<`u`?setImmediate:null;typeof navigator<`u`&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function y(e){for(var i=n(l);i!==null;){if(i.callback===null)r(l);else if(i.startTime<=e)r(l),i.sortIndex=i.expirationTime,t(c,i);else break;i=n(l)}}function b(e){if(h=!1,y(e),!m){if(n(c)!==null)m=!0,M(x);else{var t=n(l);t!==null&&ee(b,t.startTime-e)}}}function x(t,i){m=!1,h&&(h=!1,_(w),w=-1),p=!0;var a=f;try{for(y(i),d=n(c);d!==null&&(!(d.expirationTime>i)||t&&!D());){var o=d.callback;if(typeof o==`function`){d.callback=null,f=d.priorityLevel;var s=o(d.expirationTime<=i);i=e.unstable_now(),typeof s==`function`?d.callback=s:d===n(c)&&r(c),y(i)}else r(c);d=n(c)}if(d!==null)var u=!0;else{var g=n(l);g!==null&&ee(b,g.startTime-i),u=!1}return u}finally{d=null,f=a,p=!1}}var S=!1,C=null,w=-1,T=5,E=-1;function D(){return!(e.unstable_now()-E<T)}function O(){if(C!==null){var t=e.unstable_now();E=t;var n=!0;try{n=C(!0,t)}finally{n?k():(S=!1,C=null)}}else S=!1}var k;if(typeof v==`function`)k=function(){v(O)};else if(typeof MessageChannel<`u`){var A=new MessageChannel,j=A.port2;A.port1.onmessage=O,k=function(){j.postMessage(null)}}else k=function(){g(O,0)};function M(e){C=e,S||(S=!0,k())}function ee(t,n){w=g(function(){t(e.unstable_now())},n)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(e){e.callback=null},e.unstable_continueExecution=function(){m||p||(m=!0,M(x))},e.unstable_forceFrameRate=function(e){0>e||125<e?console.error(`forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported`):T=0<e?Math.floor(1e3/e):5},e.unstable_getCurrentPriorityLevel=function(){return f},e.unstable_getFirstCallbackNode=function(){return n(c)},e.unstable_next=function(e){switch(f){case 1:case 2:case 3:var t=3;break;default:t=f}var n=f;f=t;try{return e()}finally{f=n}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var n=f;f=e;try{return t()}finally{f=n}},e.unstable_scheduleCallback=function(r,i,a){var o=e.unstable_now();switch(typeof a==`object`&&a?(a=a.delay,a=typeof a==`number`&&0<a?o+a:o):a=o,r){case 1:var s=-1;break;case 2:s=250;break;case 5:s=1073741823;break;case 4:s=1e4;break;default:s=5e3}return s=a+s,r={id:u++,callback:i,priorityLevel:r,startTime:a,expirationTime:s,sortIndex:-1},a>o?(r.sortIndex=a,t(l,r),n(c)===null&&r===n(l)&&(h?(_(w),w=-1):h=!0,ee(b,a-o))):(r.sortIndex=s,t(c,r),m||p||(m=!0,M(x))),r},e.unstable_shouldYield=D,e.unstable_wrapCallback=function(e){var t=f;return function(){var n=f;f=t;try{return e.apply(this,arguments)}finally{f=n}}}})),f=o(((e,t)=>{t.exports=d()})),p=o((e=>{var t=u(),n=f();function r(e){for(var t=`https://reactjs.org/docs/error-decoder.html?invariant=`+e,n=1;n<arguments.length;n++)t+=`&args[]=`+encodeURIComponent(arguments[n]);return`Minified React error #`+e+`; visit `+t+` for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`}var i=new Set,a={};function o(e,t){s(e,t),s(e+`Capture`,t)}function s(e,t){for(a[e]=t,e=0;e<t.length;e++)i.add(t[e])}var c=!(typeof window>`u`||window.document===void 0||window.document.createElement===void 0),l=Object.prototype.hasOwnProperty,d=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,p={},m={};function h(e){return l.call(m,e)?!0:l.call(p,e)?!1:d.test(e)?m[e]=!0:(p[e]=!0,!1)}function g(e,t,n,r){if(n!==null&&n.type===0)return!1;switch(typeof t){case`function`:case`symbol`:return!0;case`boolean`:return r?!1:n===null?(e=e.toLowerCase().slice(0,5),e!==`data-`&&e!==`aria-`):!n.acceptsBooleans;default:return!1}}function _(e,t,n,r){if(t==null||g(e,t,n,r))return!0;if(r)return!1;if(n!==null)switch(n.type){case 3:return!t;case 4:return!1===t;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function v(e,t,n,r,i,a,o){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=r,this.attributeNamespace=i,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=a,this.removeEmptyString=o}var y={};`children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style`.split(` `).forEach(function(e){y[e]=new v(e,0,!1,e,null,!1,!1)}),[[`acceptCharset`,`accept-charset`],[`className`,`class`],[`htmlFor`,`for`],[`httpEquiv`,`http-equiv`]].forEach(function(e){var t=e[0];y[t]=new v(t,1,!1,e[1],null,!1,!1)}),[`contentEditable`,`draggable`,`spellCheck`,`value`].forEach(function(e){y[e]=new v(e,2,!1,e.toLowerCase(),null,!1,!1)}),[`autoReverse`,`externalResourcesRequired`,`focusable`,`preserveAlpha`].forEach(function(e){y[e]=new v(e,2,!1,e,null,!1,!1)}),`allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope`.split(` `).forEach(function(e){y[e]=new v(e,3,!1,e.toLowerCase(),null,!1,!1)}),[`checked`,`multiple`,`muted`,`selected`].forEach(function(e){y[e]=new v(e,3,!0,e,null,!1,!1)}),[`capture`,`download`].forEach(function(e){y[e]=new v(e,4,!1,e,null,!1,!1)}),[`cols`,`rows`,`size`,`span`].forEach(function(e){y[e]=new v(e,6,!1,e,null,!1,!1)}),[`rowSpan`,`start`].forEach(function(e){y[e]=new v(e,5,!1,e.toLowerCase(),null,!1,!1)});var b=/[\-:]([a-z])/g;function x(e){return e[1].toUpperCase()}`accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height`.split(` `).forEach(function(e){var t=e.replace(b,x);y[t]=new v(t,1,!1,e,null,!1,!1)}),`xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type`.split(` `).forEach(function(e){var t=e.replace(b,x);y[t]=new v(t,1,!1,e,`http://www.w3.org/1999/xlink`,!1,!1)}),[`xml:base`,`xml:lang`,`xml:space`].forEach(function(e){var t=e.replace(b,x);y[t]=new v(t,1,!1,e,`http://www.w3.org/XML/1998/namespace`,!1,!1)}),[`tabIndex`,`crossOrigin`].forEach(function(e){y[e]=new v(e,1,!1,e.toLowerCase(),null,!1,!1)}),y.xlinkHref=new v(`xlinkHref`,1,!1,`xlink:href`,`http://www.w3.org/1999/xlink`,!0,!1),[`src`,`href`,`action`,`formAction`].forEach(function(e){y[e]=new v(e,1,!1,e.toLowerCase(),null,!0,!0)});function S(e,t,n,r){var i=y.hasOwnProperty(t)?y[t]:null;(i===null?r||!(2<t.length)||t[0]!==`o`&&t[0]!==`O`||t[1]!==`n`&&t[1]!==`N`:i.type!==0)&&(_(t,n,i,r)&&(n=null),r||i===null?h(t)&&(n===null?e.removeAttribute(t):e.setAttribute(t,``+n)):i.mustUseProperty?e[i.propertyName]=n===null?i.type!==3&&``:n:(t=i.attributeName,r=i.attributeNamespace,n===null?e.removeAttribute(t):(i=i.type,n=i===3||i===4&&!0===n?``:``+n,r?e.setAttributeNS(r,t,n):e.setAttribute(t,n))))}var C=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,w=Symbol.for(`react.element`),T=Symbol.for(`react.portal`),E=Symbol.for(`react.fragment`),D=Symbol.for(`react.strict_mode`),O=Symbol.for(`react.profiler`),k=Symbol.for(`react.provider`),A=Symbol.for(`react.context`),j=Symbol.for(`react.forward_ref`),M=Symbol.for(`react.suspense`),ee=Symbol.for(`react.suspense_list`),N=Symbol.for(`react.memo`),P=Symbol.for(`react.lazy`),te=Symbol.for(`react.offscreen`),ne=Symbol.iterator;function re(e){return typeof e!=`object`||!e?null:(e=ne&&e[ne]||e[`@@iterator`],typeof e==`function`?e:null)}var F=Object.assign,ie;function ae(e){if(ie===void 0)try{throw Error()}catch(e){var t=e.stack.trim().match(/\n( *(at )?)/);ie=t&&t[1]||``}return`
2
+ `+ie+e}var oe=!1;function se(e,t){if(!e||oe)return``;oe=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(t){if(t=function(){throw Error()},Object.defineProperty(t.prototype,"props",{set:function(){throw Error()}}),typeof Reflect==`object`&&Reflect.construct){try{Reflect.construct(t,[])}catch(e){var r=e}Reflect.construct(e,[],t)}else{try{t.call()}catch(e){r=e}e.call(t.prototype)}}else{try{throw Error()}catch(e){r=e}e()}}catch(t){if(t&&r&&typeof t.stack==`string`){for(var i=t.stack.split(`
3
+ `),a=r.stack.split(`
4
+ `),o=i.length-1,s=a.length-1;1<=o&&0<=s&&i[o]!==a[s];)s--;for(;1<=o&&0<=s;o--,s--)if(i[o]!==a[s]){if(o!==1||s!==1)do if(o--,s--,0>s||i[o]!==a[s]){var c=`
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{oe=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:``)?ae(e):``}function ce(e){switch(e.tag){case 5:return ae(e.type);case 16:return ae(`Lazy`);case 13:return ae(`Suspense`);case 19:return ae(`SuspenseList`);case 0:case 2:case 15:return e=se(e.type,!1),e;case 11:return e=se(e.type.render,!1),e;case 1:return e=se(e.type,!0),e;default:return``}}function le(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 ee: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 N:return t=e.displayName||null,t===null?le(e.type)||`Memo`:t;case P:t=e._payload,e=e._init;try{return le(e(t))}catch{}}return null}function ue(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 le(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 de(e){switch(typeof e){case`boolean`:case`number`:case`string`:case`undefined`:return e;case`object`:return e;default:return``}}function fe(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()===`input`&&(t===`checkbox`||t===`radio`)}function pe(e){var t=fe(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 me(e){e._valueTracker||=pe(e)}function he(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r=``;return e&&(r=fe(e)?e.checked?`true`:`false`:e.value),e=r,e!==n&&(t.setValue(e),!0)}function ge(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 _e(e,t){var n=t.checked;return F({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function ve(e,t){var n=t.defaultValue==null?``:t.defaultValue,r=t.checked==null?t.defaultChecked:t.checked;n=de(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 ye(e,t){t=t.checked,t!=null&&S(e,`checked`,t,!1)}function be(e,t){ye(e,t);var n=de(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`)?Se(e,t.type,n):t.hasOwnProperty(`defaultValue`)&&Se(e,t.type,de(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function xe(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 Se(e,t,n){(t!==`number`||ge(e.ownerDocument)!==e)&&(n==null?e.defaultValue=``+e._wrapperState.initialValue:e.defaultValue!==``+n&&(e.defaultValue=``+n))}var Ce=Array.isArray;function we(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=``+de(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 Te(e,t){if(t.dangerouslySetInnerHTML!=null)throw Error(r(91));return F({},t,{value:void 0,defaultValue:void 0,children:``+e._wrapperState.initialValue})}function Ee(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(Ce(n)){if(1<n.length)throw Error(r(93));n=n[0]}t=n}t??=``,n=t}e._wrapperState={initialValue:de(n)}}function De(e,t){var n=de(t.value),r=de(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 Oe(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==``&&t!==null&&(e.value=t)}function ke(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 Ae(e,t){return e==null||e===`http://www.w3.org/1999/xhtml`?ke(t):e===`http://www.w3.org/2000/svg`&&t===`foreignObject`?`http://www.w3.org/1999/xhtml`:e}var je,Me=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(je||=document.createElement(`div`),je.innerHTML=`<svg>`+t.valueOf().toString()+`</svg>`,t=je.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function Ne(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Pe={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},Fe=[`Webkit`,`ms`,`Moz`,`O`];Object.keys(Pe).forEach(function(e){Fe.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),Pe[t]=Pe[e]})});function Ie(e,t,n){return t==null||typeof t==`boolean`||t===``?``:n||typeof t!=`number`||t===0||Pe.hasOwnProperty(e)&&Pe[e]?(``+t).trim():t+`px`}function Le(e,t){for(var n in e=e.style,t)if(t.hasOwnProperty(n)){var r=n.indexOf(`--`)===0,i=Ie(n,t[n],r);n===`float`&&(n=`cssFloat`),r?e.setProperty(n,i):e[n]=i}}var Re=F({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 ze(e,t){if(t){if(Re[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 Be(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 Ve=null;function He(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Ue=null,We=null,Ge=null;function Ke(e){if(e=Wi(e)){if(typeof Ue!=`function`)throw Error(r(280));var t=e.stateNode;t&&(t=Ki(t),Ue(e.stateNode,e.type,t))}}function qe(e){We?Ge?Ge.push(e):Ge=[e]:We=e}function Je(){if(We){var e=We,t=Ge;if(Ge=We=null,Ke(e),t)for(e=0;e<t.length;e++)Ke(t[e])}}function Ye(e,t){return e(t)}function Xe(){}var Ze=!1;function Qe(e,t,n){if(Ze)return e(t,n);Ze=!0;try{return Ye(e,t,n)}finally{Ze=!1,(We!==null||Ge!==null)&&(Xe(),Je())}}function $e(e,t){var n=e.stateNode;if(n===null)return null;var i=Ki(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 et=!1;if(c)try{var tt={};Object.defineProperty(tt,"passive",{get:function(){et=!0}}),window.addEventListener(`test`,tt,tt),window.removeEventListener(`test`,tt,tt)}catch{et=!1}function nt(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 rt=!1,it=null,at=!1,ot=null,st={onError:function(e){rt=!0,it=e}};function ct(e,t,n,r,i,a,o,s,c){rt=!1,it=null,nt.apply(st,arguments)}function lt(e,t,n,i,a,o,s,c,l){if(ct.apply(this,arguments),rt){if(rt){var u=it;rt=!1,it=null}else throw Error(r(198));at||(at=!0,ot=u)}}function ut(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 dt(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 ft(e){if(ut(e)!==e)throw Error(r(188))}function pt(e){var t=e.alternate;if(!t){if(t=ut(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 ft(a),e;if(o===i)return ft(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 mt(e){return e=pt(e),e===null?null:ht(e)}function ht(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=ht(e);if(t!==null)return t;e=e.sibling}return null}var gt=n.unstable_scheduleCallback,_t=n.unstable_cancelCallback,vt=n.unstable_shouldYield,yt=n.unstable_requestPaint,I=n.unstable_now,bt=n.unstable_getCurrentPriorityLevel,xt=n.unstable_ImmediatePriority,St=n.unstable_UserBlockingPriority,Ct=n.unstable_NormalPriority,wt=n.unstable_LowPriority,Tt=n.unstable_IdlePriority,Et=null,Dt=null;function Ot(e){if(Dt&&typeof Dt.onCommitFiberRoot==`function`)try{Dt.onCommitFiberRoot(Et,e,void 0,(e.current.flags&128)==128)}catch{}}var kt=Math.clz32?Math.clz32:Mt,At=Math.log,jt=Math.LN2;function Mt(e){return e>>>=0,e===0?32:31-(At(e)/jt|0)|0}var Nt=64,Pt=4194304;function Ft(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 It(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=Ft(a))):r=Ft(s)}else o=n&~i,o===0?a!==0&&(r=Ft(a)):r=Ft(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-kt(t),i=1<<n,r|=e[n],t&=~i;return r}function Lt(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 Rt(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,i=e.expirationTimes,a=e.pendingLanes;0<a;){var o=31-kt(a),s=1<<o,c=i[o];c===-1?((s&n)===0||(s&r)!==0)&&(i[o]=Lt(s,t)):c<=t&&(e.expiredLanes|=s),a&=~s}}function zt(e){return e=e.pendingLanes&-1073741825,e===0?e&1073741824?1073741824:0:e}function Bt(){var e=Nt;return Nt<<=1,!(Nt&4194240)&&(Nt=64),e}function Vt(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function Ht(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-kt(t),e[t]=n}function Ut(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-kt(n),a=1<<i;t[i]=0,r[i]=-1,e[i]=-1,n&=~a}}function Wt(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-kt(n),i=1<<r;i&t|e[r]&t&&(e[r]|=t),n&=~i}}var L=0;function Gt(e){return e&=-e,1<e?4<e?e&268435455?16:536870912:4:1}var Kt,qt,Jt,Yt,Xt,Zt=!1,Qt=[],$t=null,en=null,tn=null,nn=new Map,rn=new Map,an=[],on=`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 sn(e,t){switch(e){case`focusin`:case`focusout`:$t=null;break;case`dragenter`:case`dragleave`:en=null;break;case`mouseover`:case`mouseout`:tn=null;break;case`pointerover`:case`pointerout`:nn.delete(t.pointerId);break;case`gotpointercapture`:case`lostpointercapture`:rn.delete(t.pointerId)}}function cn(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=Wi(t),t!==null&&qt(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,i!==null&&t.indexOf(i)===-1&&t.push(i),e)}function ln(e,t,n,r,i){switch(t){case`focusin`:return $t=cn($t,e,t,n,r,i),!0;case`dragenter`:return en=cn(en,e,t,n,r,i),!0;case`mouseover`:return tn=cn(tn,e,t,n,r,i),!0;case`pointerover`:var a=i.pointerId;return nn.set(a,cn(nn.get(a)||null,e,t,n,r,i)),!0;case`gotpointercapture`:return a=i.pointerId,rn.set(a,cn(rn.get(a)||null,e,t,n,r,i)),!0}return!1}function un(e){var t=Ui(e.target);if(t!==null){var n=ut(t);if(n!==null){if(t=n.tag,t===13){if(t=dt(n),t!==null){e.blockedOn=t,Xt(e.priority,function(){Jt(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 dn(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=Sn(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);Ve=r,n.target.dispatchEvent(r),Ve=null}else return t=Wi(n),t!==null&&qt(t),e.blockedOn=n,!1;t.shift()}return!0}function fn(e,t,n){dn(e)&&n.delete(t)}function pn(){Zt=!1,$t!==null&&dn($t)&&($t=null),en!==null&&dn(en)&&(en=null),tn!==null&&dn(tn)&&(tn=null),nn.forEach(fn),rn.forEach(fn)}function mn(e,t){e.blockedOn===t&&(e.blockedOn=null,Zt||(Zt=!0,n.unstable_scheduleCallback(n.unstable_NormalPriority,pn)))}function hn(e){function t(t){return mn(t,e)}if(0<Qt.length){mn(Qt[0],e);for(var n=1;n<Qt.length;n++){var r=Qt[n];r.blockedOn===e&&(r.blockedOn=null)}}for($t!==null&&mn($t,e),en!==null&&mn(en,e),tn!==null&&mn(tn,e),nn.forEach(t),rn.forEach(t),n=0;n<an.length;n++)r=an[n],r.blockedOn===e&&(r.blockedOn=null);for(;0<an.length&&(n=an[0],n.blockedOn===null);)un(n),n.blockedOn===null&&an.shift()}var gn=C.ReactCurrentBatchConfig,_n=!0;function vn(e,t,n,r){var i=L,a=gn.transition;gn.transition=null;try{L=1,bn(e,t,n,r)}finally{L=i,gn.transition=a}}function yn(e,t,n,r){var i=L,a=gn.transition;gn.transition=null;try{L=4,bn(e,t,n,r)}finally{L=i,gn.transition=a}}function bn(e,t,n,r){if(_n){var i=Sn(e,t,n,r);if(i===null)hi(e,t,r,xn,n),sn(e,r);else if(ln(i,e,t,n,r))r.stopPropagation();else if(sn(e,r),t&4&&-1<on.indexOf(e)){for(;i!==null;){var a=Wi(i);if(a!==null&&Kt(a),a=Sn(e,t,n,r),a===null&&hi(e,t,r,xn,n),a===i)break;i=a}i!==null&&r.stopPropagation()}else hi(e,t,r,null,n)}}var xn=null;function Sn(e,t,n,r){if(xn=null,e=He(r),e=Ui(e),e!==null){if(t=ut(e),t===null)e=null;else if(n=t.tag,n===13){if(e=dt(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 xn=e,null}function Cn(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(bt()){case xt:return 1;case St:return 4;case Ct:case wt:return 16;case Tt:return 536870912;default:return 16}default:return 16}}var wn=null,Tn=null,En=null;function Dn(){if(En)return En;var e,t=Tn,n=t.length,r,i=`value`in wn?wn.value:wn.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 En=i.slice(e,1<r?1-r:void 0)}function On(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 kn(){return!0}function An(){return!1}function jn(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)?kn:An,this.isPropagationStopped=An,this}return F(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=kn)},stopPropagation:function(){var e=this.nativeEvent;e&&(e.stopPropagation?e.stopPropagation():typeof e.cancelBubble!=`unknown`&&(e.cancelBubble=!0),this.isPropagationStopped=kn)},persist:function(){},isPersistent:kn}),t}var Mn={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Nn=jn(Mn),Pn=F({},Mn,{view:0,detail:0}),Fn=jn(Pn),In,Ln,Rn,zn=F({},Pn,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Xn,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!==Rn&&(Rn&&e.type===`mousemove`?(In=e.screenX-Rn.screenX,Ln=e.screenY-Rn.screenY):Ln=In=0,Rn=e),In)},movementY:function(e){return`movementY`in e?e.movementY:Ln}}),Bn=jn(zn),Vn=jn(F({},zn,{dataTransfer:0})),Hn=jn(F({},Pn,{relatedTarget:0})),Un=jn(F({},Mn,{animationName:0,elapsedTime:0,pseudoElement:0})),Wn=jn(F({},Mn,{clipboardData:function(e){return`clipboardData`in e?e.clipboardData:window.clipboardData}})),Gn=jn(F({},Mn,{data:0})),Kn={Esc:`Escape`,Spacebar:` `,Left:`ArrowLeft`,Up:`ArrowUp`,Right:`ArrowRight`,Down:`ArrowDown`,Del:`Delete`,Win:`OS`,Menu:`ContextMenu`,Apps:`ContextMenu`,Scroll:`ScrollLock`,MozPrintableKey:`Unidentified`},qn={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`},Jn={Alt:`altKey`,Control:`ctrlKey`,Meta:`metaKey`,Shift:`shiftKey`};function Yn(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=Jn[e])?!!t[e]:!1}function Xn(){return Yn}var Zn=jn(F({},Pn,{key:function(e){if(e.key){var t=Kn[e.key]||e.key;if(t!==`Unidentified`)return t}return e.type===`keypress`?(e=On(e),e===13?`Enter`:String.fromCharCode(e)):e.type===`keydown`||e.type===`keyup`?qn[e.keyCode]||`Unidentified`:``},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Xn,charCode:function(e){return e.type===`keypress`?On(e):0},keyCode:function(e){return e.type===`keydown`||e.type===`keyup`?e.keyCode:0},which:function(e){return e.type===`keypress`?On(e):e.type===`keydown`||e.type===`keyup`?e.keyCode:0}})),Qn=jn(F({},zn,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0})),$n=jn(F({},Pn,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Xn})),er=jn(F({},Mn,{propertyName:0,elapsedTime:0,pseudoElement:0})),tr=jn(F({},zn,{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})),nr=[9,13,27,32],rr=c&&`CompositionEvent`in window,ir=null;c&&`documentMode`in document&&(ir=document.documentMode);var ar=c&&`TextEvent`in window&&!ir,or=c&&(!rr||ir&&8<ir&&11>=ir),sr=` `,cr=!1;function lr(e,t){switch(e){case`keyup`:return nr.indexOf(t.keyCode)!==-1;case`keydown`:return t.keyCode!==229;case`keypress`:case`mousedown`:case`focusout`:return!0;default:return!1}}function ur(e){return e=e.detail,typeof e==`object`&&`data`in e?e.data:null}var dr=!1;function fr(e,t){switch(e){case`compositionend`:return ur(t);case`keypress`:return t.which===32?(cr=!0,sr):null;case`textInput`:return e=t.data,e===sr&&cr?null:e;default:return null}}function pr(e,t){if(dr)return e===`compositionend`||!rr&&lr(e,t)?(e=Dn(),En=Tn=wn=null,dr=!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 or&&t.locale!==`ko`?null:t.data;default:return null}}var mr={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 hr(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t===`input`?!!mr[e.type]:t===`textarea`}function gr(e,t,n,r){qe(r),t=_i(t,`onChange`),0<t.length&&(n=new Nn(`onChange`,`change`,null,n,r),e.push({event:n,listeners:t}))}var _r=null,vr=null;function yr(e){ui(e,0)}function br(e){if(he(Gi(e)))return e}function xr(e,t){if(e===`change`)return t}var Sr=!1;if(c){var Cr;if(c){var wr=`oninput`in document;if(!wr){var Tr=document.createElement(`div`);Tr.setAttribute(`oninput`,`return;`),wr=typeof Tr.oninput==`function`}Cr=wr}else Cr=!1;Sr=Cr&&(!document.documentMode||9<document.documentMode)}function Er(){_r&&(_r.detachEvent(`onpropertychange`,Dr),vr=_r=null)}function Dr(e){if(e.propertyName===`value`&&br(vr)){var t=[];gr(t,vr,e,He(e)),Qe(yr,t)}}function Or(e,t,n){e===`focusin`?(Er(),_r=t,vr=n,_r.attachEvent(`onpropertychange`,Dr)):e===`focusout`&&Er()}function kr(e){if(e===`selectionchange`||e===`keyup`||e===`keydown`)return br(vr)}function Ar(e,t){if(e===`click`)return br(t)}function jr(e,t){if(e===`input`||e===`change`)return br(t)}function Mr(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var Nr=typeof Object.is==`function`?Object.is:Mr;function Pr(e,t){if(Nr(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)||!Nr(e[i],t[i]))return!1}return!0}function Fr(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Ir(e,t){var n=Fr(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=Fr(n)}}function Lr(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Lr(e,t.parentNode):`contains`in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Rr(){for(var e=window,t=ge();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href==`string`}catch{n=!1}if(n)e=t.contentWindow;else break;t=ge(e.document)}return t}function zr(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 Br(e){var t=Rr(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&Lr(n.ownerDocument.documentElement,n)){if(r!==null&&zr(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=Ir(n,a);var o=Ir(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 Vr=c&&`documentMode`in document&&11>=document.documentMode,Hr=null,Ur=null,Wr=null,Gr=!1;function Kr(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Gr||Hr==null||Hr!==ge(r)||(r=Hr,`selectionStart`in r&&zr(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}),Wr&&Pr(Wr,r)||(Wr=r,r=_i(Ur,`onSelect`),0<r.length&&(t=new Nn(`onSelect`,`select`,null,t,n),e.push({event:t,listeners:r}),t.target=Hr)))}function qr(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n[`Webkit`+e]=`webkit`+t,n[`Moz`+e]=`moz`+t,n}var Jr={animationend:qr(`Animation`,`AnimationEnd`),animationiteration:qr(`Animation`,`AnimationIteration`),animationstart:qr(`Animation`,`AnimationStart`),transitionend:qr(`Transition`,`TransitionEnd`)},Yr={},Xr={};c&&(Xr=document.createElement(`div`).style,`AnimationEvent`in window||(delete Jr.animationend.animation,delete Jr.animationiteration.animation,delete Jr.animationstart.animation),`TransitionEvent`in window||delete Jr.transitionend.transition);function Zr(e){if(Yr[e])return Yr[e];if(!Jr[e])return e;var t=Jr[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in Xr)return Yr[e]=t[n];return e}var Qr=Zr(`animationend`),$r=Zr(`animationiteration`),ei=Zr(`animationstart`),ti=Zr(`transitionend`),ni=new Map,ri=`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 ii(e,t){ni.set(e,t),o(t,[e])}for(var ai=0;ai<ri.length;ai++){var oi=ri[ai];ii(oi.toLowerCase(),`on`+(oi[0].toUpperCase()+oi.slice(1)))}ii(Qr,`onAnimationEnd`),ii($r,`onAnimationIteration`),ii(ei,`onAnimationStart`),ii(`dblclick`,`onDoubleClick`),ii(`focusin`,`onFocus`),ii(`focusout`,`onBlur`),ii(ti,`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 si=`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(` `),ci=new Set(`cancel close invalid load scroll toggle`.split(` `).concat(si));function li(e,t,n){var r=e.type||`unknown-event`;e.currentTarget=n,lt(r,t,void 0,e),e.currentTarget=null}function ui(e,t){t=!!(t&4);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;li(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;li(i,s,l),a=c}}}if(at)throw e=ot,at=!1,ot=null,e}function R(e,t){var n=t[Bi];n===void 0&&(n=t[Bi]=new Set);var r=e+`__bubble`;n.has(r)||(mi(t,e,2,!1),n.add(r))}function di(e,t,n){var r=0;t&&(r|=4),mi(n,e,r,t)}var fi=`_reactListening`+Math.random().toString(36).slice(2);function pi(e){if(!e[fi]){e[fi]=!0,i.forEach(function(t){t!==`selectionchange`&&(ci.has(t)||di(t,!1,e),di(t,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[fi]||(t[fi]=!0,di(`selectionchange`,!1,t))}}function mi(e,t,n,r){switch(Cn(t)){case 1:var i=vn;break;case 4:i=yn;break;default:i=bn}n=i.bind(null,t,n,e),i=void 0,!et||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 hi(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=Ui(s),o===null)return;if(c=o.tag,c===5||c===6){r=a=o;continue a}s=s.parentNode}}r=r.return}Qe(function(){var r=a,i=He(n),o=[];a:{var s=ni.get(e);if(s!==void 0){var c=Nn,l=e;switch(e){case`keypress`:if(On(n)===0)break a;case`keydown`:case`keyup`:c=Zn;break;case`focusin`:l=`focus`,c=Hn;break;case`focusout`:l=`blur`,c=Hn;break;case`beforeblur`:case`afterblur`:c=Hn;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=Bn;break;case`drag`:case`dragend`:case`dragenter`:case`dragexit`:case`dragleave`:case`dragover`:case`dragstart`:case`drop`:c=Vn;break;case`touchcancel`:case`touchend`:case`touchmove`:case`touchstart`:c=$n;break;case Qr:case $r:case ei:c=Un;break;case ti:c=er;break;case`scroll`:c=Fn;break;case`wheel`:c=tr;break;case`copy`:case`cut`:case`paste`:c=Wn;break;case`gotpointercapture`:case`lostpointercapture`:case`pointercancel`:case`pointerdown`:case`pointermove`:case`pointerout`:case`pointerover`:case`pointerup`:c=Qn}var u=!!(t&4),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=$e(p,f),h!=null&&u.push(gi(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!==Ve&&(l=n.relatedTarget||n.fromElement)&&(Ui(l)||l[zi]))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?Ui(l):null,l!==null&&(d=ut(l),l!==d||l.tag!==5&&l.tag!==6)&&(l=null)):(c=null,l=r),c!==l)){if(u=Bn,h=`onMouseLeave`,f=`onMouseEnter`,p=`mouse`,(e===`pointerout`||e===`pointerover`)&&(u=Qn,h=`onPointerLeave`,f=`onPointerEnter`,p=`pointer`),d=c==null?s:Gi(c),m=l==null?s:Gi(l),s=new u(h,p+`leave`,c,n,i),s.target=d,s.relatedTarget=m,h=null,Ui(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=vi(m))p++;for(m=0,h=f;h;h=vi(h))m++;for(;0<p-m;)u=vi(u),p--;for(;0<m-p;)f=vi(f),m--;for(;p--;){if(u===f||f!==null&&u===f.alternate)break b;u=vi(u),f=vi(f)}u=null}else u=null;c!==null&&yi(o,s,c,u,!1),l!==null&&d!==null&&yi(o,d,l,u,!0)}}a:{if(s=r?Gi(r):window,c=s.nodeName&&s.nodeName.toLowerCase(),c===`select`||c===`input`&&s.type===`file`)var g=xr;else if(hr(s)){if(Sr)g=jr;else{g=kr;var _=Or}}else(c=s.nodeName)&&c.toLowerCase()===`input`&&(s.type===`checkbox`||s.type===`radio`)&&(g=Ar);if(g&&=g(e,r)){gr(o,g,n,i);break a}_&&_(e,s,r),e===`focusout`&&(_=s._wrapperState)&&_.controlled&&s.type===`number`&&Se(s,`number`,s.value)}switch(_=r?Gi(r):window,e){case`focusin`:(hr(_)||_.contentEditable===`true`)&&(Hr=_,Ur=r,Wr=null);break;case`focusout`:Wr=Ur=Hr=null;break;case`mousedown`:Gr=!0;break;case`contextmenu`:case`mouseup`:case`dragend`:Gr=!1,Kr(o,n,i);break;case`selectionchange`:if(Vr)break;case`keydown`:case`keyup`:Kr(o,n,i)}var v;if(rr)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 dr?lr(e,n)&&(y=`onCompositionEnd`):e===`keydown`&&n.keyCode===229&&(y=`onCompositionStart`);y&&(or&&n.locale!==`ko`&&(dr||y!==`onCompositionStart`?y===`onCompositionEnd`&&dr&&(v=Dn()):(wn=i,Tn=`value`in wn?wn.value:wn.textContent,dr=!0)),_=_i(r,y),0<_.length&&(y=new Gn(y,e,null,n,i),o.push({event:y,listeners:_}),v?y.data=v:(v=ur(n),v!==null&&(y.data=v)))),(v=ar?fr(e,n):pr(e,n))&&(r=_i(r,`onBeforeInput`),0<r.length&&(i=new Gn(`onBeforeInput`,`beforeinput`,null,n,i),o.push({event:i,listeners:r}),i.data=v))}ui(o,t)})}function gi(e,t,n){return{instance:e,listener:t,currentTarget:n}}function _i(e,t){for(var n=t+`Capture`,r=[];e!==null;){var i=e,a=i.stateNode;i.tag===5&&a!==null&&(i=a,a=$e(e,n),a!=null&&r.unshift(gi(e,a,i)),a=$e(e,t),a!=null&&r.push(gi(e,a,i))),e=e.return}return r}function vi(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function yi(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=$e(n,a),c!=null&&o.unshift(gi(n,c,s))):i||(c=$e(n,a),c!=null&&o.push(gi(n,c,s)))),n=n.return}o.length!==0&&e.push({event:t,listeners:o})}var bi=/\r\n?/g,xi=/\u0000|\uFFFD/g;function Si(e){return(typeof e==`string`?e:``+e).replace(bi,`
6
+ `).replace(xi,``)}function Ci(e,t,n){if(t=Si(t),Si(e)!==t&&n)throw Error(r(425))}function wi(){}var Ti=null,Ei=null;function Di(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 Oi=typeof setTimeout==`function`?setTimeout:void 0,ki=typeof clearTimeout==`function`?clearTimeout:void 0,Ai=typeof Promise==`function`?Promise:void 0,ji=typeof queueMicrotask==`function`?queueMicrotask:Ai===void 0?Oi:function(e){return Ai.resolve(null).then(e).catch(Mi)};function Mi(e){setTimeout(function(){throw e})}function Ni(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),hn(t);return}r--}else n!==`$`&&n!==`$?`&&n!==`$!`||r++}n=i}while(n);hn(t)}function Pi(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 Fi(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 Ii=Math.random().toString(36).slice(2),Li=`__reactFiber$`+Ii,Ri=`__reactProps$`+Ii,zi=`__reactContainer$`+Ii,Bi=`__reactEvents$`+Ii,Vi=`__reactListeners$`+Ii,Hi=`__reactHandles$`+Ii;function Ui(e){var t=e[Li];if(t)return t;for(var n=e.parentNode;n;){if(t=n[zi]||n[Li]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=Fi(e);e!==null;){if(n=e[Li])return n;e=Fi(e)}return t}e=n,n=e.parentNode}return null}function Wi(e){return e=e[Li]||e[zi],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function Gi(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(r(33))}function Ki(e){return e[Ri]||null}var qi=[],Ji=-1;function Yi(e){return{current:e}}function z(e){0>Ji||(e.current=qi[Ji],qi[Ji]=null,Ji--)}function B(e,t){Ji++,qi[Ji]=e.current,e.current=t}var Xi={},Zi=Yi(Xi),Qi=Yi(!1),$i=Xi;function ea(e,t){var n=e.type.contextTypes;if(!n)return Xi;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 ta(e){return e=e.childContextTypes,e!=null}function na(){z(Qi),z(Zi)}function ra(e,t,n){if(Zi.current!==Xi)throw Error(r(168));B(Zi,t),B(Qi,n)}function ia(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,ue(e)||`Unknown`,a));return F({},n,i)}function aa(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Xi,$i=Zi.current,B(Zi,e),B(Qi,Qi.current),!0}function oa(e,t,n){var i=e.stateNode;if(!i)throw Error(r(169));n?(e=ia(e,t,$i),i.__reactInternalMemoizedMergedChildContext=e,z(Qi),z(Zi),B(Zi,e)):z(Qi),B(Qi,n)}var sa=null,ca=!1,la=!1;function ua(e){sa===null?sa=[e]:sa.push(e)}function da(e){ca=!0,ua(e)}function fa(){if(!la&&sa!==null){la=!0;var e=0,t=L;try{var n=sa;for(L=1;e<n.length;e++){var r=n[e];do r=r(!0);while(r!==null)}sa=null,ca=!1}catch(t){throw sa!==null&&(sa=sa.slice(e+1)),gt(xt,fa),t}finally{L=t,la=!1}}return null}var pa=[],ma=0,ha=null,ga=0,_a=[],va=0,ya=null,ba=1,xa=``;function Sa(e,t){pa[ma++]=ga,pa[ma++]=ha,ha=e,ga=t}function Ca(e,t,n){_a[va++]=ba,_a[va++]=xa,_a[va++]=ya,ya=e;var r=ba;e=xa;var i=32-kt(r)-1;r&=~(1<<i),n+=1;var a=32-kt(t)+i;if(30<a){var o=i-i%5;a=(r&(1<<o)-1).toString(32),r>>=o,i-=o,ba=1<<32-kt(t)+i|n<<i|r,xa=a+e}else ba=1<<a|n<<i|r,xa=e}function wa(e){e.return!==null&&(Sa(e,1),Ca(e,1,0))}function Ta(e){for(;e===ha;)ha=pa[--ma],pa[ma]=null,ga=pa[--ma],pa[ma]=null;for(;e===ya;)ya=_a[--va],_a[va]=null,xa=_a[--va],_a[va]=null,ba=_a[--va],_a[va]=null}var Ea=null,Da=null,V=!1,Oa=null;function ka(e,t){var n=Kl(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 Aa(e,t){switch(e.tag){case 5:var n=e.type;return t=t.nodeType!==1||n.toLowerCase()!==t.nodeName.toLowerCase()?null:t,t!==null&&(e.stateNode=t,Ea=e,Da=Pi(t.firstChild),!0);case 6:return t=e.pendingProps===``||t.nodeType!==3?null:t,t!==null&&(e.stateNode=t,Ea=e,Da=null,!0);case 13:return t=t.nodeType===8?t:null,t!==null&&(n=ya===null?null:{id:ba,overflow:xa},e.memoizedState={dehydrated:t,treeContext:n,retryLane:1073741824},n=Kl(18,null,null,0),n.stateNode=t,n.return=e,e.child=n,Ea=e,Da=null,!0);default:return!1}}function ja(e){return!!(e.mode&1)&&!(e.flags&128)}function Ma(e){if(V){var t=Da;if(t){var n=t;if(!Aa(e,t)){if(ja(e))throw Error(r(418));t=Pi(n.nextSibling);var i=Ea;t&&Aa(e,t)?ka(i,n):(e.flags=e.flags&-4097|2,V=!1,Ea=e)}}else{if(ja(e))throw Error(r(418));e.flags=e.flags&-4097|2,V=!1,Ea=e}}}function Na(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;Ea=e}function Pa(e){if(e!==Ea)return!1;if(!V)return Na(e),V=!0,!1;var t;if((t=e.tag!==3)&&!(t=e.tag!==5)&&(t=e.type,t=t!==`head`&&t!==`body`&&!Di(e.type,e.memoizedProps)),t&&=Da){if(ja(e))throw Fa(),Error(r(418));for(;t;)ka(e,t),t=Pi(t.nextSibling)}if(Na(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){Da=Pi(e.nextSibling);break a}t--}else n!==`$`&&n!==`$!`&&n!==`$?`||t++}e=e.nextSibling}Da=null}}else Da=Ea?Pi(e.stateNode.nextSibling):null;return!0}function Fa(){for(var e=Da;e;)e=Pi(e.nextSibling)}function Ia(){Da=Ea=null,V=!1}function La(e){Oa===null?Oa=[e]:Oa.push(e)}var Ra=C.ReactCurrentBatchConfig;function za(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 Ba(e,t){throw e=Object.prototype.toString.call(t),Error(r(31,e===`[object Object]`?`object with keys {`+Object.keys(t).join(`, `)+`}`:e))}function Va(e){var t=e._init;return t(e._payload)}function Ha(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=Yl(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=$l(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===P&&Va(i)===t.type)?(r=a(t,n.props),r.ref=za(e,t,n),r.return=e,r):(r=Xl(n.type,n.key,n.props,null,e.mode,r),r.ref=za(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=eu(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=Zl(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=$l(``+t,e.mode,n),t.return=e,t;if(typeof t==`object`&&t){switch(t.$$typeof){case w:return n=Xl(t.type,t.key,t.props,null,e.mode,n),n.ref=za(e,null,t),n.return=e,n;case T:return t=eu(t,e.mode,n),t.return=e,t;case P:var r=t._init;return f(e,r(t._payload),n)}if(Ce(t)||re(t))return t=Zl(t,e.mode,n,null),t.return=e,t;Ba(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 P:return i=n._init,p(e,t,i(n._payload),r)}if(Ce(n)||re(n))return i===null?d(e,t,n,r,null):null;Ba(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 P:var a=r._init;return m(e,t,n,a(r._payload),i)}if(Ce(r)||re(r))return e=e.get(n)||null,d(t,e,r,i,null);Ba(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),V&&Sa(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 V&&Sa(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)}),V&&Sa(r,h),l}function g(a,s,c,l){var u=re(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),V&&Sa(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 V&&Sa(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)}),V&&Sa(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===P&&Va(c)===l.type){n(e,l.sibling),r=a(l,i.props),r.ref=za(e,l,i),r.return=e,e=r;break a}n(e,l);break}t(e,l),l=l.sibling}i.type===E?(r=Zl(i.props.children,e.mode,o,i.key),r.return=e,e=r):(o=Xl(i.type,i.key,i.props,null,e.mode,o),o.ref=za(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}n(e,r);break}t(e,r),r=r.sibling}r=eu(i,e.mode,o),r.return=e,e=r}return s(e);case P:return l=i._init,_(e,r,l(i._payload),o)}if(Ce(i))return h(e,r,i,o);if(re(i))return g(e,r,i,o);Ba(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=$l(i,e.mode,o),r.return=e,e=r),s(e)):n(e,r)}return _}var Ua=Ha(!0),Wa=Ha(!1),Ga=Yi(null),Ka=null,qa=null,Ja=null;function Ya(){Ja=qa=Ka=null}function Xa(e){var t=Ga.current;z(Ga),e._currentValue=t}function Za(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 Qa(e,t){Ka=e,Ja=qa=null,e=e.dependencies,e!==null&&e.firstContext!==null&&((e.lanes&t)!==0&&(Rs=!0),e.firstContext=null)}function $a(e){var t=e._currentValue;if(Ja!==e){if(e={context:e,memoizedValue:t,next:null},qa===null){if(Ka===null)throw Error(r(308));qa=e,Ka.dependencies={lanes:0,firstContext:e}}else qa=qa.next=e}return t}var eo=null;function to(e){eo===null?eo=[e]:eo.push(e)}function no(e,t,n,r){var i=t.interleaved;return i===null?(n.next=n,to(t)):(n.next=i.next,i.next=n),t.interleaved=n,ro(e,r)}function ro(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 io=!1;function ao(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function oo(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 so(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function co(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,J&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,ro(e,n)}return i=r.interleaved,i===null?(t.next=t,to(r)):(t.next=i.next,i.next=t),r.interleaved=t,ro(e,n)}function lo(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,Wt(e,n)}}function uo(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 fo(e,t,n,r){var i=e.updateQueue;io=!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=F({},d,f);break a;case 2:io=!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);Yc|=o,e.lanes=o,e.memoizedState=d}}function po(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 mo={},ho=Yi(mo),go=Yi(mo),_o=Yi(mo);function vo(e){if(e===mo)throw Error(r(174));return e}function yo(e,t){switch(B(_o,t),B(go,e),B(ho,mo),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:Ae(null,``);break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=Ae(t,e)}z(ho),B(ho,t)}function bo(){z(ho),z(go),z(_o)}function xo(e){vo(_o.current);var t=vo(ho.current),n=Ae(t,e.type);t!==n&&(B(go,e),B(ho,n))}function So(e){go.current===e&&(z(ho),z(go))}var H=Yi(0);function Co(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 wo=[];function To(){for(var e=0;e<wo.length;e++)wo[e]._workInProgressVersionPrimary=null;wo.length=0}var Eo=C.ReactCurrentDispatcher,Do=C.ReactCurrentBatchConfig,Oo=0,U=null,W=null,G=null,ko=!1,Ao=!1,jo=0,Mo=0;function No(){throw Error(r(321))}function Po(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!Nr(e[n],t[n]))return!1;return!0}function Fo(e,t,n,i,a,o){if(Oo=o,U=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,Eo.current=e===null||e.memoizedState===null?vs:ys,e=n(i,a),Ao){o=0;do{if(Ao=!1,jo=0,25<=o)throw Error(r(301));o+=1,G=W=null,t.updateQueue=null,Eo.current=bs,e=n(i,a)}while(Ao)}if(Eo.current=_s,t=W!==null&&W.next!==null,Oo=0,G=W=U=null,ko=!1,t)throw Error(r(300));return e}function Io(){var e=jo!==0;return jo=0,e}function Lo(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return G===null?U.memoizedState=G=e:G=G.next=e,G}function Ro(){if(W===null){var e=U.alternate;e=e===null?null:e.memoizedState}else e=W.next;var t=G===null?U.memoizedState:G.next;if(t!==null)G=t,W=e;else{if(e===null)throw Error(r(310));W=e,e={memoizedState:W.memoizedState,baseState:W.baseState,baseQueue:W.baseQueue,queue:W.queue,next:null},G===null?U.memoizedState=G=e:G=G.next=e}return G}function zo(e,t){return typeof t==`function`?t(e):t}function Bo(e){var t=Ro(),n=t.queue;if(n===null)throw Error(r(311));n.lastRenderedReducer=e;var i=W,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((Oo&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,U.lanes|=d,Yc|=d}u=u.next}while(u!==null&&u!==o);l===null?s=i:l.next=c,Nr(i,t.memoizedState)||(Rs=!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,U.lanes|=o,Yc|=o,a=a.next;while(a!==e)}else a===null&&(n.lanes=0);return[t.memoizedState,n.dispatch]}function Vo(e){var t=Ro(),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);Nr(o,t.memoizedState)||(Rs=!0),t.memoizedState=o,t.baseQueue===null&&(t.baseState=o),n.lastRenderedState=o}return[o,i]}function Ho(){}function Uo(e,t){var n=U,i=Ro(),a=t(),o=!Nr(i.memoizedState,a);if(o&&(i.memoizedState=a,Rs=!0),i=i.queue,ts(Ko.bind(null,n,i,e),[e]),i.getSnapshot!==t||o||G!==null&&G.memoizedState.tag&1){if(n.flags|=2048,Xo(9,Go.bind(null,n,i,a,t),void 0,null),Y===null)throw Error(r(349));Oo&30||Wo(n,t,a)}return a}function Wo(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=U.updateQueue,t===null?(t={lastEffect:null,stores:null},U.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function Go(e,t,n,r){t.value=n,t.getSnapshot=r,qo(t)&&Jo(e)}function Ko(e,t,n){return n(function(){qo(t)&&Jo(e)})}function qo(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!Nr(e,n)}catch{return!0}}function Jo(e){var t=ro(e,1);t!==null&&hl(t,e,1,-1)}function Yo(e){var t=Lo();return typeof e==`function`&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:zo,lastRenderedState:e},t.queue=e,e=e.dispatch=ps.bind(null,U,e),[t.memoizedState,e]}function Xo(e,t,n,r){return e={tag:e,create:t,destroy:n,deps:r,next:null},t=U.updateQueue,t===null?(t={lastEffect:null,stores:null},U.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 Zo(){return Ro().memoizedState}function Qo(e,t,n,r){var i=Lo();U.flags|=e,i.memoizedState=Xo(1|t,n,void 0,r===void 0?null:r)}function $o(e,t,n,r){var i=Ro();r=r===void 0?null:r;var a=void 0;if(W!==null){var o=W.memoizedState;if(a=o.destroy,r!==null&&Po(r,o.deps)){i.memoizedState=Xo(t,n,a,r);return}}U.flags|=e,i.memoizedState=Xo(1|t,n,a,r)}function es(e,t){return Qo(8390656,8,e,t)}function ts(e,t){return $o(2048,8,e,t)}function ns(e,t){return $o(4,2,e,t)}function rs(e,t){return $o(4,4,e,t)}function is(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 as(e,t,n){return n=n==null?null:n.concat([e]),$o(4,4,is.bind(null,t,e),n)}function os(){}function ss(e,t){var n=Ro();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&Po(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function cs(e,t){var n=Ro();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&Po(t,r[1])?r[0]:(e=e(),n.memoizedState=[e,t],e)}function ls(e,t,n){return Oo&21?(Nr(n,t)||(n=Bt(),U.lanes|=n,Yc|=n,e.baseState=!0),t):(e.baseState&&(e.baseState=!1,Rs=!0),e.memoizedState=n)}function us(e,t){var n=L;L=n!==0&&4>n?n:4,e(!0);var r=Do.transition;Do.transition={};try{e(!1),t()}finally{L=n,Do.transition=r}}function ds(){return Ro().memoizedState}function fs(e,t,n){var r=ml(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},ms(e))hs(t,n);else if(n=no(e,t,n,r),n!==null){var i=pl();hl(n,e,r,i),gs(n,t,r)}}function ps(e,t,n){var r=ml(e),i={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(ms(e))hs(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,Nr(s,o)){var c=t.interleaved;c===null?(i.next=i,to(t)):(i.next=c.next,c.next=i),t.interleaved=i;return}}catch{}n=no(e,t,i,r),n!==null&&(i=pl(),hl(n,e,r,i),gs(n,t,r))}}function ms(e){var t=e.alternate;return e===U||t!==null&&t===U}function hs(e,t){Ao=ko=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function gs(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Wt(e,n)}}var _s={readContext:$a,useCallback:No,useContext:No,useEffect:No,useImperativeHandle:No,useInsertionEffect:No,useLayoutEffect:No,useMemo:No,useReducer:No,useRef:No,useState:No,useDebugValue:No,useDeferredValue:No,useTransition:No,useMutableSource:No,useSyncExternalStore:No,useId:No,unstable_isNewReconciler:!1},vs={readContext:$a,useCallback:function(e,t){return Lo().memoizedState=[e,t===void 0?null:t],e},useContext:$a,useEffect:es,useImperativeHandle:function(e,t,n){return n=n==null?null:n.concat([e]),Qo(4194308,4,is.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Qo(4194308,4,e,t)},useInsertionEffect:function(e,t){return Qo(4,2,e,t)},useMemo:function(e,t){var n=Lo();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=Lo();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=fs.bind(null,U,e),[r.memoizedState,e]},useRef:function(e){var t=Lo();return e={current:e},t.memoizedState=e},useState:Yo,useDebugValue:os,useDeferredValue:function(e){return Lo().memoizedState=e},useTransition:function(){var e=Yo(!1),t=e[0];return e=us.bind(null,e[1]),Lo().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var i=U,a=Lo();if(V){if(n===void 0)throw Error(r(407));n=n()}else{if(n=t(),Y===null)throw Error(r(349));Oo&30||Wo(i,t,n)}a.memoizedState=n;var o={value:n,getSnapshot:t};return a.queue=o,es(Ko.bind(null,i,o,e),[e]),i.flags|=2048,Xo(9,Go.bind(null,i,o,n,t),void 0,null),n},useId:function(){var e=Lo(),t=Y.identifierPrefix;if(V){var n=xa,r=ba;n=(r&~(1<<32-kt(r)-1)).toString(32)+n,t=`:`+t+`R`+n,n=jo++,0<n&&(t+=`H`+n.toString(32)),t+=`:`}else n=Mo++,t=`:`+t+`r`+n.toString(32)+`:`;return e.memoizedState=t},unstable_isNewReconciler:!1},ys={readContext:$a,useCallback:ss,useContext:$a,useEffect:ts,useImperativeHandle:as,useInsertionEffect:ns,useLayoutEffect:rs,useMemo:cs,useReducer:Bo,useRef:Zo,useState:function(){return Bo(zo)},useDebugValue:os,useDeferredValue:function(e){return ls(Ro(),W.memoizedState,e)},useTransition:function(){return[Bo(zo)[0],Ro().memoizedState]},useMutableSource:Ho,useSyncExternalStore:Uo,useId:ds,unstable_isNewReconciler:!1},bs={readContext:$a,useCallback:ss,useContext:$a,useEffect:ts,useImperativeHandle:as,useInsertionEffect:ns,useLayoutEffect:rs,useMemo:cs,useReducer:Vo,useRef:Zo,useState:function(){return Vo(zo)},useDebugValue:os,useDeferredValue:function(e){var t=Ro();return W===null?t.memoizedState=e:ls(t,W.memoizedState,e)},useTransition:function(){return[Vo(zo)[0],Ro().memoizedState]},useMutableSource:Ho,useSyncExternalStore:Uo,useId:ds,unstable_isNewReconciler:!1};function xs(e,t){if(e&&e.defaultProps){for(var n in t=F({},t),e=e.defaultProps,e)t[n]===void 0&&(t[n]=e[n]);return t}return t}function Ss(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:F({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var Cs={isMounted:function(e){return(e=e._reactInternals)?ut(e)===e:!1},enqueueSetState:function(e,t,n){e=e._reactInternals;var r=pl(),i=ml(e),a=so(r,i);a.payload=t,n!=null&&(a.callback=n),t=co(e,a,i),t!==null&&(hl(t,e,i,r),lo(t,e,i))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=pl(),i=ml(e),a=so(r,i);a.tag=1,a.payload=t,n!=null&&(a.callback=n),t=co(e,a,i),t!==null&&(hl(t,e,i,r),lo(t,e,i))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=pl(),r=ml(e),i=so(n,r);i.tag=2,t!=null&&(i.callback=t),t=co(e,i,r),t!==null&&(hl(t,e,r,n),lo(t,e,r))}};function ws(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?!Pr(n,r)||!Pr(i,a):!0}function Ts(e,t,n){var r=!1,i=Xi,a=t.contextType;return typeof a==`object`&&a?a=$a(a):(i=ta(t)?$i:Zi.current,r=t.contextTypes,a=(r=r!=null)?ea(e,i):Xi),t=new t(n,a),e.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=Cs,e.stateNode=t,t._reactInternals=e,r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=i,e.__reactInternalMemoizedMaskedChildContext=a),t}function Es(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&&Cs.enqueueReplaceState(t,t.state,null)}function Ds(e,t,n,r){var i=e.stateNode;i.props=n,i.state=e.memoizedState,i.refs={},ao(e);var a=t.contextType;typeof a==`object`&&a?i.context=$a(a):(a=ta(t)?$i:Zi.current,i.context=ea(e,a)),i.state=e.memoizedState,a=t.getDerivedStateFromProps,typeof a==`function`&&(Ss(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&&Cs.enqueueReplaceState(i,i.state,null),fo(e,n,i,r),i.state=e.memoizedState),typeof i.componentDidMount==`function`&&(e.flags|=4194308)}function Os(e,t){try{var n=``,r=t;do n+=ce(r),r=r.return;while(r);var i=n}catch(e){i=`
7
+ Error generating stack: `+e.message+`
8
+ `+e.stack}return{value:e,source:t,stack:i,digest:null}}function ks(e,t,n){return{value:e,source:null,stack:n??null,digest:t??null}}function As(e,t){try{console.error(t.value)}catch(e){setTimeout(function(){throw e})}}var js=typeof WeakMap==`function`?WeakMap:Map;function Ms(e,t,n){n=so(-1,n),n.tag=3,n.payload={element:null};var r=t.value;return n.callback=function(){rl||(rl=!0,il=r),As(e,t)},n}function Ns(e,t,n){n=so(-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(){As(e,t)}}var a=e.stateNode;return a!==null&&typeof a.componentDidCatch==`function`&&(n.callback=function(){As(e,t),typeof r!=`function`&&(al===null?al=new Set([this]):al.add(this));var n=t.stack;this.componentDidCatch(t.value,{componentStack:n===null?``:n})}),n}function Ps(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new js;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=zl.bind(null,e,t,n),t.then(e,e))}function Fs(e){do{var t;if((t=e.tag===13)&&(t=e.memoizedState,t=t===null||t.dehydrated!==null),t)return e;e=e.return}while(e!==null);return null}function Is(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=so(-1,1),t.tag=2,co(n,t,1))),n.lanes|=1),e)}var Ls=C.ReactCurrentOwner,Rs=!1;function zs(e,t,n,r){t.child=e===null?Wa(t,null,n,r):Ua(t,e.child,n,r)}function Bs(e,t,n,r,i){n=n.render;var a=t.ref;return Qa(t,i),r=Fo(e,t,n,r,a,i),n=Io(),e!==null&&!Rs?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i,oc(e,t,i)):(V&&n&&wa(t),t.flags|=1,zs(e,t,r,i),t.child)}function Vs(e,t,n,r,i){if(e===null){var a=n.type;return typeof a==`function`&&!ql(a)&&a.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(t.tag=15,t.type=a,Hs(e,t,a,r,i)):(e=Xl(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?Pr:n,n(o,r)&&e.ref===t.ref)return oc(e,t,i)}return t.flags|=1,e=Yl(a,r),e.ref=t.ref,e.return=t,t.child=e}function Hs(e,t,n,r,i){if(e!==null){var a=e.memoizedProps;if(Pr(a,r)&&e.ref===t.ref){if(Rs=!1,t.pendingProps=r=a,(e.lanes&i)!==0)e.flags&131072&&(Rs=!0);else return t.lanes=e.lanes,oc(e,t,i)}}return Gs(e,t,n,r,i)}function Us(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},B(qc,Kc),Kc|=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,B(qc,Kc),Kc|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=a===null?n:a.baseLanes,B(qc,Kc),Kc|=r}}else a===null?r=n:(r=a.baseLanes|n,t.memoizedState=null),B(qc,Kc),Kc|=r;return zs(e,t,i,n),t.child}function Ws(e,t){var n=t.ref;(e===null&&n!==null||e!==null&&e.ref!==n)&&(t.flags|=512,t.flags|=2097152)}function Gs(e,t,n,r,i){var a=ta(n)?$i:Zi.current;return a=ea(t,a),Qa(t,i),n=Fo(e,t,n,r,a,i),r=Io(),e!==null&&!Rs?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i,oc(e,t,i)):(V&&r&&wa(t),t.flags|=1,zs(e,t,n,i),t.child)}function Ks(e,t,n,r,i){if(ta(n)){var a=!0;aa(t)}else a=!1;if(Qa(t,i),t.stateNode===null)ac(e,t),Ts(t,n,r),Ds(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=$a(l):(l=ta(n)?$i:Zi.current,l=ea(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)&&Es(t,o,r,l),io=!1;var f=t.memoizedState;o.state=f,fo(t,r,o,i),c=t.memoizedState,s!==r||f!==c||Qi.current||io?(typeof u==`function`&&(Ss(t,n,u,r),c=t.memoizedState),(s=io||ws(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,oo(e,t),s=t.memoizedProps,l=t.type===t.elementType?s:xs(t.type,s),o.props=l,d=t.pendingProps,f=o.context,c=n.contextType,typeof c==`object`&&c?c=$a(c):(c=ta(n)?$i:Zi.current,c=ea(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)&&Es(t,o,r,c),io=!1,f=t.memoizedState,o.state=f,fo(t,r,o,i);var m=t.memoizedState;s!==d||f!==m||Qi.current||io?(typeof p==`function`&&(Ss(t,n,p,r),m=t.memoizedState),(l=io||ws(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 qs(e,t,n,r,a,i)}function qs(e,t,n,r,i,a){Ws(e,t);var o=!!(t.flags&128);if(!r&&!o)return i&&oa(t,n,!1),oc(e,t,a);r=t.stateNode,Ls.current=t;var s=o&&typeof n.getDerivedStateFromError!=`function`?null:r.render();return t.flags|=1,e!==null&&o?(t.child=Ua(t,e.child,null,a),t.child=Ua(t,null,s,a)):zs(e,t,s,a),t.memoizedState=r.state,i&&oa(t,n,!0),t.child}function Js(e){var t=e.stateNode;t.pendingContext?ra(e,t.pendingContext,t.pendingContext!==t.context):t.context&&ra(e,t.context,!1),yo(e,t.containerInfo)}function Ys(e,t,n,r,i){return Ia(),La(i),t.flags|=256,zs(e,t,n,r),t.child}var Xs={dehydrated:null,treeContext:null,retryLane:0};function Zs(e){return{baseLanes:e,cachePool:null,transitions:null}}function Qs(e,t,n){var r=t.pendingProps,i=H.current,a=!1,o=!!(t.flags&128),s;if((s=o)||(s=e!==null&&e.memoizedState===null?!1:!!(i&2)),s?(a=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(i|=1),B(H,i&1),e===null)return Ma(t),e=t.memoizedState,e!==null&&(e=e.dehydrated,e!==null)?(t.lanes=t.mode&1?e.data===`$!`?8:1073741824: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=Ql(o,r,0,null),e=Zl(e,r,n,null),a.return=t,e.return=t,a.sibling=e,t.child=a,t.child.memoizedState=Zs(n),t.memoizedState=Xs,e):$s(t,o));if(i=e.memoizedState,i!==null&&(s=i.dehydrated,s!==null))return tc(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=Yl(i,c),r.subtreeFlags=i.subtreeFlags&14680064),s===null?(a=Zl(a,o,n,null),a.flags|=2):a=Yl(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?Zs(n):{baseLanes:o.baseLanes|n,cachePool:null,transitions:o.transitions},a.memoizedState=o,a.childLanes=e.childLanes&~n,t.memoizedState=Xs,r}return a=e.child,e=a.sibling,r=Yl(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 $s(e,t){return t=Ql({mode:`visible`,children:t},e.mode,0,null),t.return=e,e.child=t}function ec(e,t,n,r){return r!==null&&La(r),Ua(t,e.child,null,n),e=$s(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function tc(e,t,n,i,a,o,s){if(n)return t.flags&256?(t.flags&=-257,i=ks(Error(r(422))),ec(e,t,s,i)):t.memoizedState===null?(o=i.fallback,a=t.mode,i=Ql({mode:`visible`,children:i.children},a,0,null),o=Zl(o,a,s,null),o.flags|=2,i.return=t,o.return=t,i.sibling=o,t.child=i,t.mode&1&&Ua(t,e.child,null,s),t.child.memoizedState=Zs(s),t.memoizedState=Xs,o):(t.child=e.child,t.flags|=128,null);if(!(t.mode&1))return ec(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=ks(o,i,void 0),ec(e,t,s,i)}if(c=(s&e.childLanes)!==0,Rs||c){if(i=Y,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,ro(e,a),hl(i,e,a,-1))}return kl(),i=ks(Error(r(421))),ec(e,t,s,i)}return a.data===`$?`?(t.flags|=128,t.child=e.child,t=Vl.bind(null,e),a._reactRetry=t,null):(e=o.treeContext,Da=Pi(a.nextSibling),Ea=t,V=!0,Oa=null,e!==null&&(_a[va++]=ba,_a[va++]=xa,_a[va++]=ya,ba=e.id,xa=e.overflow,ya=t),t=$s(t,i.children),t.flags|=4096,t)}function nc(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),Za(e.return,t,n)}function rc(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 ic(e,t,n){var r=t.pendingProps,i=r.revealOrder,a=r.tail;if(zs(e,t,r.children,n),r=H.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&&nc(e,n,t);else if(e.tag===19)nc(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(B(H,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&&Co(e)===null&&(i=n),n=n.sibling;n=i,n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null),rc(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&&Co(e)===null){t.child=i;break}e=i.sibling,i.sibling=n,n=i,i=e}rc(t,!0,n,null,a);break;case`together`:rc(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function ac(e,t){!(t.mode&1)&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function oc(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),Yc|=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=Yl(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=Yl(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function sc(e,t,n){switch(t.tag){case 3:Js(t),Ia();break;case 5:xo(t);break;case 1:ta(t.type)&&aa(t);break;case 4:yo(t,t.stateNode.containerInfo);break;case 10:var r=t.type._context,i=t.memoizedProps.value;B(Ga,r._currentValue),r._currentValue=i;break;case 13:if(r=t.memoizedState,r!==null)return r.dehydrated===null?(n&t.child.childLanes)===0?(B(H,H.current&1),e=oc(e,t,n),e===null?null:e.sibling):Qs(e,t,n):(B(H,H.current&1),t.flags|=128,null);B(H,H.current&1);break;case 19:if(r=(n&t.childLanes)!==0,e.flags&128){if(r)return ic(e,t,n);t.flags|=128}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),B(H,H.current),r)break;return null;case 22:case 23:return t.lanes=0,Us(e,t,n)}return oc(e,t,n)}var cc=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}},lc=function(e,t,n,r){var i=e.memoizedProps;if(i!==r){e=t.stateNode,vo(ho.current);var o=null;switch(n){case`input`:i=_e(e,i),r=_e(e,r),o=[];break;case`select`:i=F({},i,{value:void 0}),r=F({},r,{value:void 0}),o=[];break;case`textarea`:i=Te(e,i),r=Te(e,r),o=[];break;default:typeof i.onClick!=`function`&&typeof r.onClick==`function`&&(e.onclick=wi)}ze(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`&&R(`scroll`,e),o||c===l||(o=[])):(o||=[]).push(u,l))}}n&&(o||=[]).push(`style`,n);var u=o;(t.updateQueue=u)&&(t.flags|=4)}},uc=function(e,t,n,r){n!==r&&(t.flags|=4)};function dc(e,t){if(!V)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 fc(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 pc(e,t,n){var i=t.pendingProps;switch(Ta(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return fc(t),null;case 1:return ta(t.type)&&na(),fc(t),null;case 3:return i=t.stateNode,bo(),z(Qi),z(Zi),To(),i.pendingContext&&(i.context=i.pendingContext,i.pendingContext=null),(e===null||e.child===null)&&(Pa(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,Oa!==null&&(yl(Oa),Oa=null))),fc(t),null;case 5:So(t);var o=vo(_o.current);if(n=t.type,e!==null&&t.stateNode!=null)lc(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 fc(t),null}if(e=vo(ho.current),Pa(t)){i=t.stateNode,n=t.type;var s=t.memoizedProps;switch(i[Li]=t,i[Ri]=s,e=!!(t.mode&1),n){case`dialog`:R(`cancel`,i),R(`close`,i);break;case`iframe`:case`object`:case`embed`:R(`load`,i);break;case`video`:case`audio`:for(o=0;o<si.length;o++)R(si[o],i);break;case`source`:R(`error`,i);break;case`img`:case`image`:case`link`:R(`error`,i),R(`load`,i);break;case`details`:R(`toggle`,i);break;case`input`:ve(i,s),R(`invalid`,i);break;case`select`:i._wrapperState={wasMultiple:!!s.multiple},R(`invalid`,i);break;case`textarea`:Ee(i,s),R(`invalid`,i)}for(var c in ze(n,s),o=null,s)if(s.hasOwnProperty(c)){var l=s[c];c===`children`?typeof l==`string`?i.textContent!==l&&(!0!==s.suppressHydrationWarning&&Ci(i.textContent,l,e),o=[`children`,l]):typeof l==`number`&&i.textContent!==``+l&&(!0!==s.suppressHydrationWarning&&Ci(i.textContent,l,e),o=[`children`,``+l]):a.hasOwnProperty(c)&&l!=null&&c===`onScroll`&&R(`scroll`,i)}switch(n){case`input`:me(i),xe(i,s,!0);break;case`textarea`:me(i),Oe(i);break;case`select`:case`option`:break;default:typeof s.onClick==`function`&&(i.onclick=wi)}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=ke(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[Li]=t,e[Ri]=i,cc(e,t,!1,!1),t.stateNode=e;a:{switch(c=Be(n,i),n){case`dialog`:R(`cancel`,e),R(`close`,e),o=i;break;case`iframe`:case`object`:case`embed`:R(`load`,e),o=i;break;case`video`:case`audio`:for(o=0;o<si.length;o++)R(si[o],e);o=i;break;case`source`:R(`error`,e),o=i;break;case`img`:case`image`:case`link`:R(`error`,e),R(`load`,e),o=i;break;case`details`:R(`toggle`,e),o=i;break;case`input`:ve(e,i),o=_e(e,i),R(`invalid`,e);break;case`option`:o=i;break;case`select`:e._wrapperState={wasMultiple:!!i.multiple},o=F({},i,{value:void 0}),R(`invalid`,e);break;case`textarea`:Ee(e,i),o=Te(e,i),R(`invalid`,e);break;default:o=i}for(s in ze(n,o),l=o,l)if(l.hasOwnProperty(s)){var u=l[s];s===`style`?Le(e,u):s===`dangerouslySetInnerHTML`?(u=u?u.__html:void 0,u!=null&&Me(e,u)):s===`children`?typeof u==`string`?(n!==`textarea`||u!==``)&&Ne(e,u):typeof u==`number`&&Ne(e,``+u):s!==`suppressContentEditableWarning`&&s!==`suppressHydrationWarning`&&s!==`autoFocus`&&(a.hasOwnProperty(s)?u!=null&&s===`onScroll`&&R(`scroll`,e):u!=null&&S(e,s,u,c))}switch(n){case`input`:me(e),xe(e,i,!1);break;case`textarea`:me(e),Oe(e);break;case`option`:i.value!=null&&e.setAttribute(`value`,``+de(i.value));break;case`select`:e.multiple=!!i.multiple,s=i.value,s==null?i.defaultValue!=null&&we(e,!!i.multiple,i.defaultValue,!0):we(e,!!i.multiple,s,!1);break;default:typeof o.onClick==`function`&&(e.onclick=wi)}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 fc(t),null;case 6:if(e&&t.stateNode!=null)uc(e,t,e.memoizedProps,i);else{if(typeof i!=`string`&&t.stateNode===null)throw Error(r(166));if(n=vo(_o.current),vo(ho.current),Pa(t)){if(i=t.stateNode,n=t.memoizedProps,i[Li]=t,(s=i.nodeValue!==n)&&(e=Ea,e!==null))switch(e.tag){case 3:Ci(i.nodeValue,n,!!(e.mode&1));break;case 5:!0!==e.memoizedProps.suppressHydrationWarning&&Ci(i.nodeValue,n,!!(e.mode&1))}s&&(t.flags|=4)}else i=(n.nodeType===9?n:n.ownerDocument).createTextNode(i),i[Li]=t,t.stateNode=i}return fc(t),null;case 13:if(z(H),i=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(V&&Da!==null&&t.mode&1&&!(t.flags&128))Fa(),Ia(),t.flags|=98560,s=!1;else if(s=Pa(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[Li]=t}else Ia(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;fc(t),s=!1}else Oa!==null&&(yl(Oa),Oa=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||H.current&1?Q===0&&(Q=3):kl())),t.updateQueue!==null&&(t.flags|=4),fc(t),null);case 4:return bo(),e===null&&pi(t.stateNode.containerInfo),fc(t),null;case 10:return Xa(t.type._context),fc(t),null;case 17:return ta(t.type)&&na(),fc(t),null;case 19:if(z(H),s=t.memoizedState,s===null)return fc(t),null;if(i=!!(t.flags&128),c=s.rendering,c===null){if(i)dc(s,!1);else{if(Q!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(c=Co(e),c!==null){for(t.flags|=128,dc(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 B(H,H.current&1|2),t.child}e=e.sibling}s.tail!==null&&I()>tl&&(t.flags|=128,i=!0,dc(s,!1),t.lanes=4194304)}}else{if(!i){if(e=Co(c),e!==null){if(t.flags|=128,i=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),dc(s,!0),s.tail===null&&s.tailMode===`hidden`&&!c.alternate&&!V)return fc(t),null}else 2*I()-s.renderingStartTime>tl&&n!==1073741824&&(t.flags|=128,i=!0,dc(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?(fc(t),null):(t=s.tail,s.rendering=t,s.tail=t.sibling,s.renderingStartTime=I(),t.sibling=null,n=H.current,B(H,i?n&1|2:n&1),t);case 22:case 23:return Tl(),i=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==i&&(t.flags|=8192),i&&t.mode&1?Kc&1073741824&&(fc(t),t.subtreeFlags&6&&(t.flags|=8192)):fc(t),null;case 24:return null;case 25:return null}throw Error(r(156,t.tag))}function mc(e,t){switch(Ta(t),t.tag){case 1:return ta(t.type)&&na(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return bo(),z(Qi),z(Zi),To(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return So(t),null;case 13:if(z(H),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(r(340));Ia()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return z(H),null;case 4:return bo(),null;case 10:return Xa(t.type._context),null;case 22:case 23:return Tl(),null;case 24:return null;default:return null}}var hc=!1,gc=!1,_c=typeof WeakSet==`function`?WeakSet:Set,K=null;function vc(e,t){var n=e.ref;if(n!==null){if(typeof n==`function`)try{n(null)}catch(n){$(e,t,n)}else n.current=null}}function yc(e,t,n){try{n()}catch(n){$(e,t,n)}}var bc=!1;function xc(e,t){if(Ti=_n,e=Rr(),zr(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(Ei={focusedElem:e,selectionRange:n},_n=!1,K=t;K!==null;)if(t=K,e=t.child,t.subtreeFlags&1028&&e!==null)e.return=t,K=e;else for(;K!==null;){t=K;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:xs(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){$(t,t.return,e)}if(e=t.sibling,e!==null){e.return=t.return,K=e;break}K=t.return}return h=bc,bc=!1,h}function Sc(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&&yc(t,n,a)}i=i.next}while(i!==r)}}function Cc(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 wc(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 Tc(e){var t=e.alternate;t!==null&&(e.alternate=null,Tc(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[Li],delete t[Ri],delete t[Bi],delete t[Vi],delete t[Hi])),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 Ec(e){return e.tag===5||e.tag===3||e.tag===4}function Dc(e){a:for(;;){for(;e.sibling===null;){if(e.return===null||Ec(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 Oc(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=wi));else if(r!==4&&(e=e.child,e!==null))for(Oc(e,t,n),e=e.sibling;e!==null;)Oc(e,t,n),e=e.sibling}function kc(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(kc(e,t,n),e=e.sibling;e!==null;)kc(e,t,n),e=e.sibling}var q=null,Ac=!1;function jc(e,t,n){for(n=n.child;n!==null;)Mc(e,t,n),n=n.sibling}function Mc(e,t,n){if(Dt&&typeof Dt.onCommitFiberUnmount==`function`)try{Dt.onCommitFiberUnmount(Et,n)}catch{}switch(n.tag){case 5:gc||vc(n,t);case 6:var r=q,i=Ac;q=null,jc(e,t,n),q=r,Ac=i,q!==null&&(Ac?(e=q,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):q.removeChild(n.stateNode));break;case 18:q!==null&&(Ac?(e=q,n=n.stateNode,e.nodeType===8?Ni(e.parentNode,n):e.nodeType===1&&Ni(e,n),hn(e)):Ni(q,n.stateNode));break;case 4:r=q,i=Ac,q=n.stateNode.containerInfo,Ac=!0,jc(e,t,n),q=r,Ac=i;break;case 0:case 11:case 14:case 15:if(!gc&&(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)&&yc(n,t,o),i=i.next}while(i!==r)}jc(e,t,n);break;case 1:if(!gc&&(vc(n,t),r=n.stateNode,typeof r.componentWillUnmount==`function`))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(e){$(n,t,e)}jc(e,t,n);break;case 21:jc(e,t,n);break;case 22:n.mode&1?(gc=(r=gc)||n.memoizedState!==null,jc(e,t,n),gc=r):jc(e,t,n);break;default:jc(e,t,n)}}function Nc(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new _c),t.forEach(function(t){var r=Hl.bind(null,e,t);n.has(t)||(n.add(t),t.then(r,r))})}}function Pc(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:q=c.stateNode,Ac=!1;break a;case 3:q=c.stateNode.containerInfo,Ac=!0;break a;case 4:q=c.stateNode.containerInfo,Ac=!0;break a}c=c.return}if(q===null)throw Error(r(160));Mc(o,s,a),q=null,Ac=!1;var l=a.alternate;l!==null&&(l.return=null),a.return=null}catch(e){$(a,t,e)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)Fc(t,e),t=t.sibling}function Fc(e,t){var n=e.alternate,i=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(Pc(t,e),Ic(e),i&4){try{Sc(3,e,e.return),Cc(3,e)}catch(t){$(e,e.return,t)}try{Sc(5,e,e.return)}catch(t){$(e,e.return,t)}}break;case 1:Pc(t,e),Ic(e),i&512&&n!==null&&vc(n,n.return);break;case 5:if(Pc(t,e),Ic(e),i&512&&n!==null&&vc(n,n.return),e.flags&32){var a=e.stateNode;try{Ne(a,``)}catch(t){$(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&&ye(a,o),Be(c,s);var u=Be(c,o);for(s=0;s<l.length;s+=2){var d=l[s],f=l[s+1];d===`style`?Le(a,f):d===`dangerouslySetInnerHTML`?Me(a,f):d===`children`?Ne(a,f):S(a,d,f,u)}switch(c){case`input`:be(a,o);break;case`textarea`:De(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?we(a,!!o.multiple,o.multiple?[]:``,!1):we(a,!!o.multiple,o.defaultValue,!0)):we(a,!!o.multiple,m,!1)}a[Ri]=o}catch(t){$(e,e.return,t)}}break;case 6:if(Pc(t,e),Ic(e),i&4){if(e.stateNode===null)throw Error(r(162));a=e.stateNode,o=e.memoizedProps;try{a.nodeValue=o}catch(t){$(e,e.return,t)}}break;case 3:if(Pc(t,e),Ic(e),i&4&&n!==null&&n.memoizedState.isDehydrated)try{hn(t.containerInfo)}catch(t){$(e,e.return,t)}break;case 4:Pc(t,e),Ic(e);break;case 13:Pc(t,e),Ic(e),a=e.child,a.flags&8192&&(o=a.memoizedState!==null,a.stateNode.isHidden=o,!o||a.alternate!==null&&a.alternate.memoizedState!==null||(el=I())),i&4&&Nc(e);break;case 22:if(d=n!==null&&n.memoizedState!==null,e.mode&1?(gc=(u=gc)||d,Pc(t,e),gc=u):Pc(t,e),Ic(e),i&8192){if(u=e.memoizedState!==null,(e.stateNode.isHidden=u)&&!d&&e.mode&1)for(K=e,d=e.child;d!==null;){for(f=K=d;K!==null;){switch(p=K,m=p.child,p.tag){case 0:case 11:case 14:case 15:Sc(4,p,p.return);break;case 1:vc(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){$(i,n,e)}}break;case 5:vc(p,p.return);break;case 22:if(p.memoizedState!==null){Bc(f);continue}}m===null?Bc(f):(m.return=p,K=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=Ie(`display`,s))}catch(t){$(e,e.return,t)}}}else if(f.tag===6){if(d===null)try{f.stateNode.nodeValue=u?``:f.memoizedProps}catch(t){$(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:Pc(t,e),Ic(e),i&4&&Nc(e);break;case 21:break;default:Pc(t,e),Ic(e)}}function Ic(e){var t=e.flags;if(t&2){try{a:{for(var n=e.return;n!==null;){if(Ec(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&&(Ne(a,``),i.flags&=-33),kc(e,Dc(e),a);break;case 3:case 4:var o=i.stateNode.containerInfo;Oc(e,Dc(e),o);break;default:throw Error(r(161))}}catch(t){$(e,e.return,t)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function Lc(e,t,n){K=e,Rc(e,t,n)}function Rc(e,t,n){for(var r=!!(e.mode&1);K!==null;){var i=K,a=i.child;if(i.tag===22&&r){var o=i.memoizedState!==null||hc;if(!o){var s=i.alternate,c=s!==null&&s.memoizedState!==null||gc;s=hc;var l=gc;if(hc=o,(gc=c)&&!l)for(K=i;K!==null;)o=K,c=o.child,o.tag===22&&o.memoizedState!==null||c===null?Vc(i):(c.return=o,K=c);for(;a!==null;)K=a,Rc(a,t,n),a=a.sibling;K=i,hc=s,gc=l}zc(e,t,n)}else i.subtreeFlags&8772&&a!==null?(a.return=i,K=a):zc(e,t,n)}}function zc(e){for(;K!==null;){var t=K;if(t.flags&8772){var n=t.alternate;try{if(t.flags&8772)switch(t.tag){case 0:case 11:case 15:gc||Cc(5,t);break;case 1:var i=t.stateNode;if(t.flags&4&&!gc){if(n===null)i.componentDidMount();else{var a=t.elementType===t.type?n.memoizedProps:xs(t.type,n.memoizedProps);i.componentDidUpdate(a,n.memoizedState,i.__reactInternalSnapshotBeforeUpdate)}}var o=t.updateQueue;o!==null&&po(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}po(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&&hn(f)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(r(163))}gc||t.flags&512&&wc(t)}catch(e){$(t,t.return,e)}}if(t===e){K=null;break}if(n=t.sibling,n!==null){n.return=t.return,K=n;break}K=t.return}}function Bc(e){for(;K!==null;){var t=K;if(t===e){K=null;break}var n=t.sibling;if(n!==null){n.return=t.return,K=n;break}K=t.return}}function Vc(e){for(;K!==null;){var t=K;try{switch(t.tag){case 0:case 11:case 15:var n=t.return;try{Cc(4,t)}catch(e){$(t,n,e)}break;case 1:var r=t.stateNode;if(typeof r.componentDidMount==`function`){var i=t.return;try{r.componentDidMount()}catch(e){$(t,i,e)}}var a=t.return;try{wc(t)}catch(e){$(t,a,e)}break;case 5:var o=t.return;try{wc(t)}catch(e){$(t,o,e)}}}catch(e){$(t,t.return,e)}if(t===e){K=null;break}var s=t.sibling;if(s!==null){s.return=t.return,K=s;break}K=t.return}}var Hc=Math.ceil,Uc=C.ReactCurrentDispatcher,Wc=C.ReactCurrentOwner,Gc=C.ReactCurrentBatchConfig,J=0,Y=null,X=null,Z=0,Kc=0,qc=Yi(0),Q=0,Jc=null,Yc=0,Xc=0,Zc=0,Qc=null,$c=null,el=0,tl=1/0,nl=null,rl=!1,il=null,al=null,ol=!1,sl=null,cl=0,ll=0,ul=null,dl=-1,fl=0;function pl(){return J&6?I():dl===-1?dl=I():dl}function ml(e){return e.mode&1?J&2&&Z!==0?Z&-Z:Ra.transition===null?(e=L,e===0?(e=window.event,e=e===void 0?16:Cn(e.type),e):e):(fl===0&&(fl=Bt()),fl):1}function hl(e,t,n,i){if(50<ll)throw ll=0,ul=null,Error(r(185));Ht(e,n,i),(!(J&2)||e!==Y)&&(e===Y&&(!(J&2)&&(Xc|=n),Q===4&&xl(e,Z)),gl(e,i),n===1&&J===0&&!(t.mode&1)&&(tl=I()+500,ca&&fa()))}function gl(e,t){var n=e.callbackNode;Rt(e,t);var r=It(e,e===Y?Z:0);if(r===0)n!==null&&_t(n),e.callbackNode=null,e.callbackPriority=0;else if(t=r&-r,e.callbackPriority!==t){if(n!=null&&_t(n),t===1)e.tag===0?da(Sl.bind(null,e)):ua(Sl.bind(null,e)),ji(function(){!(J&6)&&fa()}),n=null;else{switch(Gt(r)){case 1:n=xt;break;case 4:n=St;break;case 16:n=Ct;break;case 536870912:n=Tt;break;default:n=Ct}n=Wl(n,_l.bind(null,e))}e.callbackPriority=t,e.callbackNode=n}}function _l(e,t){if(dl=-1,fl=0,J&6)throw Error(r(327));var n=e.callbackNode;if(Ll()&&e.callbackNode!==n)return null;var i=It(e,e===Y?Z:0);if(i===0)return null;if(i&30||(i&e.expiredLanes)!==0||t)t=Al(e,i);else{t=i;var a=J;J|=2;var o=Ol();(Y!==e||Z!==t)&&(nl=null,tl=I()+500,El(e,t));do try{Ml();break}catch(t){Dl(e,t)}while(1);Ya(),Uc.current=o,J=a,X===null?(Y=null,Z=0,t=Q):t=0}if(t!==0){if(t===2&&(a=zt(e),a!==0&&(i=a,t=vl(e,a))),t===1)throw n=Jc,El(e,0),xl(e,i),gl(e,I()),n;if(t===6)xl(e,i);else{if(a=e.current.alternate,!(i&30)&&!bl(a)&&(t=Al(e,i),t===2&&(o=zt(e),o!==0&&(i=o,t=vl(e,o))),t===1))throw n=Jc,El(e,0),xl(e,i),gl(e,I()),n;switch(e.finishedWork=a,e.finishedLanes=i,t){case 0:case 1:throw Error(r(345));case 2:Fl(e,$c,nl);break;case 3:if(xl(e,i),(i&130023424)===i&&(t=el+500-I(),10<t)){if(It(e,0)!==0)break;if(a=e.suspendedLanes,(a&i)!==i){pl(),e.pingedLanes|=e.suspendedLanes&a;break}e.timeoutHandle=Oi(Fl.bind(null,e,$c,nl),t);break}Fl(e,$c,nl);break;case 4:if(xl(e,i),(i&4194240)===i)break;for(t=e.eventTimes,a=-1;0<i;){var s=31-kt(i);o=1<<s,s=t[s],s>a&&(a=s),i&=~o}if(i=a,i=I()-i,i=(120>i?120:480>i?480:1080>i?1080:1920>i?1920:3e3>i?3e3:4320>i?4320:1960*Hc(i/1960))-i,10<i){e.timeoutHandle=Oi(Fl.bind(null,e,$c,nl),i);break}Fl(e,$c,nl);break;case 5:Fl(e,$c,nl);break;default:throw Error(r(329))}}}return gl(e,I()),e.callbackNode===n?_l.bind(null,e):null}function vl(e,t){var n=Qc;return e.current.memoizedState.isDehydrated&&(El(e,t).flags|=256),e=Al(e,t),e!==2&&(t=$c,$c=n,t!==null&&yl(t)),e}function yl(e){$c===null?$c=e:$c.push.apply($c,e)}function bl(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(!Nr(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 xl(e,t){for(t&=~Zc,t&=~Xc,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var n=31-kt(t),r=1<<n;e[n]=-1,t&=~r}}function Sl(e){if(J&6)throw Error(r(327));Ll();var t=It(e,0);if(!(t&1))return gl(e,I()),null;var n=Al(e,t);if(e.tag!==0&&n===2){var i=zt(e);i!==0&&(t=i,n=vl(e,i))}if(n===1)throw n=Jc,El(e,0),xl(e,t),gl(e,I()),n;if(n===6)throw Error(r(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,Fl(e,$c,nl),gl(e,I()),null}function Cl(e,t){var n=J;J|=1;try{return e(t)}finally{J=n,J===0&&(tl=I()+500,ca&&fa())}}function wl(e){sl!==null&&sl.tag===0&&!(J&6)&&Ll();var t=J;J|=1;var n=Gc.transition,r=L;try{if(Gc.transition=null,L=1,e)return e()}finally{L=r,Gc.transition=n,J=t,!(J&6)&&fa()}}function Tl(){Kc=qc.current,z(qc)}function El(e,t){e.finishedWork=null,e.finishedLanes=0;var n=e.timeoutHandle;if(n!==-1&&(e.timeoutHandle=-1,ki(n)),X!==null)for(n=X.return;n!==null;){var r=n;switch(Ta(r),r.tag){case 1:r=r.type.childContextTypes,r!=null&&na();break;case 3:bo(),z(Qi),z(Zi),To();break;case 5:So(r);break;case 4:bo();break;case 13:z(H);break;case 19:z(H);break;case 10:Xa(r.type._context);break;case 22:case 23:Tl()}n=n.return}if(Y=e,X=e=Yl(e.current,null),Z=Kc=t,Q=0,Jc=null,Zc=Xc=Yc=0,$c=Qc=null,eo!==null){for(t=0;t<eo.length;t++)if(n=eo[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}eo=null}return e}function Dl(e,t){do{var n=X;try{if(Ya(),Eo.current=_s,ko){for(var i=U.memoizedState;i!==null;){var a=i.queue;a!==null&&(a.pending=null),i=i.next}ko=!1}if(Oo=0,G=W=U=null,Ao=!1,jo=0,Wc.current=null,n===null||n.return===null){Q=1,Jc=t,X=null;break}a:{var o=e,s=n.return,c=n,l=t;if(t=Z,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=Fs(s);if(m!==null){m.flags&=-257,Is(m,s,c,o,t),m.mode&1&&Ps(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}if(!(t&1)){Ps(o,u,t),kl();break a}l=Error(r(426))}else if(V&&c.mode&1){var _=Fs(s);if(_!==null){!(_.flags&65536)&&(_.flags|=256),Is(_,s,c,o,t),La(Os(l,c));break a}}o=l=Os(l,c),Q!==4&&(Q=2),Qc===null?Qc=[o]:Qc.push(o),o=s;do{switch(o.tag){case 3:o.flags|=65536,t&=-t,o.lanes|=t;var v=Ms(o,l,t);uo(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`&&(al===null||!al.has(b)))){o.flags|=65536,t&=-t,o.lanes|=t;var x=Ns(o,c,t);uo(o,x);break a}}o=o.return}while(o!==null)}Pl(n)}catch(e){t=e,X===n&&n!==null&&(X=n=n.return);continue}break}while(1)}function Ol(){var e=Uc.current;return Uc.current=_s,e===null?_s:e}function kl(){(Q===0||Q===3||Q===2)&&(Q=4),Y===null||!(Yc&268435455)&&!(Xc&268435455)||xl(Y,Z)}function Al(e,t){var n=J;J|=2;var i=Ol();(Y!==e||Z!==t)&&(nl=null,El(e,t));do try{jl();break}catch(t){Dl(e,t)}while(1);if(Ya(),J=n,Uc.current=i,X!==null)throw Error(r(261));return Y=null,Z=0,Q}function jl(){for(;X!==null;)Nl(X)}function Ml(){for(;X!==null&&!vt();)Nl(X)}function Nl(e){var t=Ul(e.alternate,e,Kc);e.memoizedProps=e.pendingProps,t===null?Pl(e):X=t,Wc.current=null}function Pl(e){var t=e;do{var n=t.alternate;if(e=t.return,t.flags&32768){if(n=mc(n,t),n!==null){n.flags&=32767,X=n;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{Q=6,X=null;return}}else if(n=pc(n,t,Kc),n!==null){X=n;return}if(t=t.sibling,t!==null){X=t;return}X=t=e}while(t!==null);Q===0&&(Q=5)}function Fl(e,t,n){var r=L,i=Gc.transition;try{Gc.transition=null,L=1,Il(e,t,n,r)}finally{Gc.transition=i,L=r}return null}function Il(e,t,n,i){do Ll();while(sl!==null);if(J&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(Ut(e,o),e===Y&&(X=Y=null,Z=0),!(n.subtreeFlags&2064)&&!(n.flags&2064)||ol||(ol=!0,Wl(Ct,function(){return Ll(),null})),o=!!(n.flags&15990),n.subtreeFlags&15990||o){o=Gc.transition,Gc.transition=null;var s=L;L=1;var c=J;J|=4,Wc.current=null,xc(e,n),Fc(n,e),Br(Ei),_n=!!Ti,Ei=Ti=null,e.current=n,Lc(n,e,a),yt(),J=c,L=s,Gc.transition=o}else e.current=n;if(ol&&(ol=!1,sl=e,cl=a),o=e.pendingLanes,o===0&&(al=null),Ot(n.stateNode,i),gl(e,I()),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(rl)throw rl=!1,e=il,il=null,e;return cl&1&&e.tag!==0&&Ll(),o=e.pendingLanes,o&1?e===ul?ll++:(ll=0,ul=e):ll=0,fa(),null}function Ll(){if(sl!==null){var e=Gt(cl),t=Gc.transition,n=L;try{if(Gc.transition=null,L=16>e?16:e,sl===null)var i=!1;else{if(e=sl,sl=null,cl=0,J&6)throw Error(r(331));var a=J;for(J|=4,K=e.current;K!==null;){var o=K,s=o.child;if(K.flags&16){var c=o.deletions;if(c!==null){for(var l=0;l<c.length;l++){var u=c[l];for(K=u;K!==null;){var d=K;switch(d.tag){case 0:case 11:case 15:Sc(8,d,o)}var f=d.child;if(f!==null)f.return=d,K=f;else for(;K!==null;){d=K;var p=d.sibling,m=d.return;if(Tc(d),d===u){K=null;break}if(p!==null){p.return=m,K=p;break}K=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)}}K=o}}if(o.subtreeFlags&2064&&s!==null)s.return=o,K=s;else b:for(;K!==null;){if(o=K,o.flags&2048)switch(o.tag){case 0:case 11:case 15:Sc(9,o,o.return)}var v=o.sibling;if(v!==null){v.return=o.return,K=v;break b}K=o.return}}var y=e.current;for(K=y;K!==null;){s=K;var b=s.child;if(s.subtreeFlags&2064&&b!==null)b.return=s,K=b;else b:for(s=y;K!==null;){if(c=K,c.flags&2048)try{switch(c.tag){case 0:case 11:case 15:Cc(9,c)}}catch(e){$(c,c.return,e)}if(c===s){K=null;break b}var x=c.sibling;if(x!==null){x.return=c.return,K=x;break b}K=c.return}}if(J=a,fa(),Dt&&typeof Dt.onPostCommitFiberRoot==`function`)try{Dt.onPostCommitFiberRoot(Et,e)}catch{}i=!0}return i}finally{L=n,Gc.transition=t}}return!1}function Rl(e,t,n){t=Os(n,t),t=Ms(e,t,1),e=co(e,t,1),t=pl(),e!==null&&(Ht(e,1,t),gl(e,t))}function $(e,t,n){if(e.tag===3)Rl(e,e,n);else for(;t!==null;){if(t.tag===3){Rl(t,e,n);break}if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError==`function`||typeof r.componentDidCatch==`function`&&(al===null||!al.has(r))){e=Os(n,e),e=Ns(t,e,1),t=co(t,e,1),e=pl(),t!==null&&(Ht(t,1,e),gl(t,e));break}}t=t.return}}function zl(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),t=pl(),e.pingedLanes|=e.suspendedLanes&n,Y===e&&(Z&n)===n&&(Q===4||Q===3&&(Z&130023424)===Z&&500>I()-el?El(e,0):Zc|=n),gl(e,t)}function Bl(e,t){t===0&&(e.mode&1?(t=Pt,Pt<<=1,!(Pt&130023424)&&(Pt=4194304)):t=1);var n=pl();e=ro(e,t),e!==null&&(Ht(e,t,n),gl(e,n))}function Vl(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),Bl(e,n)}function Hl(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),Bl(e,n)}var Ul=function(e,t,n){if(e!==null){if(e.memoizedProps!==t.pendingProps||Qi.current)Rs=!0;else{if((e.lanes&n)===0&&!(t.flags&128))return Rs=!1,sc(e,t,n);Rs=!!(e.flags&131072)}}else Rs=!1,V&&t.flags&1048576&&Ca(t,ga,t.index);switch(t.lanes=0,t.tag){case 2:var i=t.type;ac(e,t),e=t.pendingProps;var a=ea(t,Zi.current);Qa(t,n),a=Fo(null,t,i,e,a,n);var o=Io();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,ta(i)?(o=!0,aa(t)):o=!1,t.memoizedState=a.state!==null&&a.state!==void 0?a.state:null,ao(t),a.updater=Cs,t.stateNode=a,a._reactInternals=t,Ds(t,i,e,n),t=qs(null,t,i,!0,o,n)):(t.tag=0,V&&o&&wa(t),zs(null,t,a,n),t=t.child),t;case 16:i=t.elementType;a:{switch(ac(e,t),e=t.pendingProps,a=i._init,i=a(i._payload),t.type=i,a=t.tag=Jl(i),e=xs(i,e),a){case 0:t=Gs(null,t,i,e,n);break a;case 1:t=Ks(null,t,i,e,n);break a;case 11:t=Bs(null,t,i,e,n);break a;case 14:t=Vs(null,t,i,xs(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:xs(i,a),Gs(e,t,i,a,n);case 1:return i=t.type,a=t.pendingProps,a=t.elementType===i?a:xs(i,a),Ks(e,t,i,a,n);case 3:a:{if(Js(t),e===null)throw Error(r(387));i=t.pendingProps,o=t.memoizedState,a=o.element,oo(e,t),fo(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=Os(Error(r(423)),t),t=Ys(e,t,i,n,a);break a}if(i!==a){a=Os(Error(r(424)),t),t=Ys(e,t,i,n,a);break a}for(Da=Pi(t.stateNode.containerInfo.firstChild),Ea=t,V=!0,Oa=null,n=Wa(t,null,i,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling}else{if(Ia(),i===a){t=oc(e,t,n);break a}zs(e,t,i,n)}t=t.child}return t;case 5:return xo(t),e===null&&Ma(t),i=t.type,a=t.pendingProps,o=e===null?null:e.memoizedProps,s=a.children,Di(i,a)?s=null:o!==null&&Di(i,o)&&(t.flags|=32),Ws(e,t),zs(e,t,s,n),t.child;case 6:return e===null&&Ma(t),null;case 13:return Qs(e,t,n);case 4:return yo(t,t.stateNode.containerInfo),i=t.pendingProps,e===null?t.child=Ua(t,null,i,n):zs(e,t,i,n),t.child;case 11:return i=t.type,a=t.pendingProps,a=t.elementType===i?a:xs(i,a),Bs(e,t,i,a,n);case 7:return zs(e,t,t.pendingProps,n),t.child;case 8:return zs(e,t,t.pendingProps.children,n),t.child;case 12:return zs(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,B(Ga,i._currentValue),i._currentValue=s,o!==null){if(Nr(o.value,s)){if(o.children===a.children&&!Qi.current){t=oc(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=so(-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),Za(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),Za(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}}zs(e,t,a.children,n),t=t.child}return t;case 9:return a=t.type,i=t.pendingProps.children,Qa(t,n),a=$a(a),i=i(a),t.flags|=1,zs(e,t,i,n),t.child;case 14:return i=t.type,a=xs(i,t.pendingProps),a=xs(i.type,a),Vs(e,t,i,a,n);case 15:return Hs(e,t,t.type,t.pendingProps,n);case 17:return i=t.type,a=t.pendingProps,a=t.elementType===i?a:xs(i,a),ac(e,t),t.tag=1,ta(i)?(e=!0,aa(t)):e=!1,Qa(t,n),Ts(t,i,a),Ds(t,i,a,n),qs(null,t,i,!0,e,n);case 19:return ic(e,t,n);case 22:return Us(e,t,n)}throw Error(r(156,t.tag))};function Wl(e,t){return gt(e,t)}function Gl(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 Kl(e,t,n,r){return new Gl(e,t,n,r)}function ql(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Jl(e){if(typeof e==`function`)return+!!ql(e);if(e!=null){if(e=e.$$typeof,e===j)return 11;if(e===N)return 14}return 2}function Yl(e,t){var n=e.alternate;return n===null?(n=Kl(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 Xl(e,t,n,i,a,o){var s=2;if(i=e,typeof e==`function`)ql(e)&&(s=1);else if(typeof e==`string`)s=5;else a:switch(e){case E:return Zl(n.children,a,o,t);case D:s=8,a|=8;break;case O:return e=Kl(12,n,t,a|2),e.elementType=O,e.lanes=o,e;case M:return e=Kl(13,n,t,a),e.elementType=M,e.lanes=o,e;case ee:return e=Kl(19,n,t,a),e.elementType=ee,e.lanes=o,e;case te:return Ql(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 N:s=14;break a;case P:s=16,i=null;break a}throw Error(r(130,e==null?e:typeof e,``))}return t=Kl(s,n,t,a),t.elementType=e,t.type=i,t.lanes=o,t}function Zl(e,t,n,r){return e=Kl(7,e,r,t),e.lanes=n,e}function Ql(e,t,n,r){return e=Kl(22,e,r,t),e.elementType=te,e.lanes=n,e.stateNode={isHidden:!1},e}function $l(e,t,n){return e=Kl(6,e,null,t),e.lanes=n,e}function eu(e,t,n){return t=Kl(4,e.children===null?[]:e.children,e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function tu(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=Vt(0),this.expirationTimes=Vt(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Vt(0),this.identifierPrefix=r,this.onRecoverableError=i,this.mutableSourceEagerHydrationData=null}function nu(e,t,n,r,i,a,o,s,c){return e=new tu(e,t,n,s,c),t===1?(t=1,!0===a&&(t|=8)):t=0,a=Kl(3,null,null,t),e.current=a,a.stateNode=e,a.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},ao(a),e}function ru(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 iu(e){if(!e)return Xi;e=e._reactInternals;a:{if(ut(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(ta(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(ta(n))return ia(e,n,t)}return t}function au(e,t,n,r,i,a,o,s,c){return e=nu(n,r,!0,e,i,a,o,s,c),e.context=iu(null),n=e.current,r=pl(),i=ml(n),a=so(r,i),a.callback=t??null,co(n,a,i),e.current.lanes=i,Ht(e,i,r),gl(e,r),e}function ou(e,t,n,r){var i=t.current,a=pl(),o=ml(i);return n=iu(n),t.context===null?t.context=n:t.pendingContext=n,t=so(a,o),t.payload={element:e},r=r===void 0?null:r,r!==null&&(t.callback=r),e=co(i,t,o),e!==null&&(hl(e,i,o,a),lo(e,i,o)),o}function su(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 cu(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function lu(e,t){cu(e,t),(e=e.alternate)&&cu(e,t)}function uu(){return null}var du=typeof reportError==`function`?reportError:function(e){console.error(e)};function fu(e){this._internalRoot=e}pu.prototype.render=fu.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(r(409));ou(e,t,null,null)},pu.prototype.unmount=fu.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;wl(function(){ou(null,e,null,null)}),t[zi]=null}};function pu(e){this._internalRoot=e}pu.prototype.unstable_scheduleHydration=function(e){if(e){var t=Yt();e={blockedOn:null,target:e,priority:t};for(var n=0;n<an.length&&t!==0&&t<an[n].priority;n++);an.splice(n,0,e),n===0&&un(e)}};function mu(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function hu(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==` react-mount-point-unstable `))}function gu(){}function _u(e,t,n,r,i){if(i){if(typeof r==`function`){var a=r;r=function(){var e=su(o);a.call(e)}}var o=au(t,r,e,0,null,!1,!1,``,gu);return e._reactRootContainer=o,e[zi]=o.current,pi(e.nodeType===8?e.parentNode:e),wl(),o}for(;i=e.lastChild;)e.removeChild(i);if(typeof r==`function`){var s=r;r=function(){var e=su(c);s.call(e)}}var c=nu(e,0,!1,null,null,!1,!1,``,gu);return e._reactRootContainer=c,e[zi]=c.current,pi(e.nodeType===8?e.parentNode:e),wl(function(){ou(t,c,n,r)}),c}function vu(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=su(o);s.call(e)}}ou(t,o,e,i)}else o=_u(n,t,e,i,r);return su(o)}Kt=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var n=Ft(t.pendingLanes);n!==0&&(Wt(t,n|1),gl(t,I()),!(J&6)&&(tl=I()+500,fa()))}break;case 13:wl(function(){var t=ro(e,1);t!==null&&hl(t,e,1,pl())}),lu(e,1)}},qt=function(e){if(e.tag===13){var t=ro(e,134217728);t!==null&&hl(t,e,134217728,pl()),lu(e,134217728)}},Jt=function(e){if(e.tag===13){var t=ml(e),n=ro(e,t);n!==null&&hl(n,e,t,pl()),lu(e,t)}},Yt=function(){return L},Xt=function(e,t){var n=L;try{return L=e,t()}finally{L=n}},Ue=function(e,t,n){switch(t){case`input`:if(be(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=Ki(i);if(!a)throw Error(r(90));he(i),be(i,a)}}}break;case`textarea`:De(e,n);break;case`select`:t=n.value,t!=null&&we(e,!!n.multiple,t,!1)}},Ye=Cl,Xe=wl;var yu={usingClientEntryPoint:!1,Events:[Wi,Gi,Ki,qe,Je,Cl]},bu={findFiberByHostInstance:Ui,bundleType:0,version:`18.3.1`,rendererPackageName:`react-dom`},xu={bundleType:bu.bundleType,version:bu.version,rendererPackageName:bu.rendererPackageName,rendererConfig:bu.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=mt(e),e===null?null:e.stateNode},findFiberByHostInstance:bu.findFiberByHostInstance||uu,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 Su=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Su.isDisabled&&Su.supportsFiber)try{Et=Su.inject(xu),Dt=Su}catch{}}e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=yu,e.createPortal=function(e,t){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!mu(t))throw Error(r(200));return ru(e,t,null,n)},e.createRoot=function(e,t){if(!mu(e))throw Error(r(299));var n=!1,i=``,a=du;return t!=null&&(!0===t.unstable_strictMode&&(n=!0),t.identifierPrefix!==void 0&&(i=t.identifierPrefix),t.onRecoverableError!==void 0&&(a=t.onRecoverableError)),t=nu(e,1,!1,null,null,n,!1,i,a),e[zi]=t.current,pi(e.nodeType===8?e.parentNode:e),new fu(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=mt(t),e=e===null?null:e.stateNode,e},e.flushSync=function(e){return wl(e)},e.hydrate=function(e,t,n){if(!hu(t))throw Error(r(200));return vu(null,e,t,!0,n)},e.hydrateRoot=function(e,t,n){if(!mu(e))throw Error(r(405));var i=n!=null&&n.hydratedSources||null,a=!1,o=``,s=du;if(n!=null&&(!0===n.unstable_strictMode&&(a=!0),n.identifierPrefix!==void 0&&(o=n.identifierPrefix),n.onRecoverableError!==void 0&&(s=n.onRecoverableError)),t=au(t,null,e,1,n??null,a,!1,o,s),e[zi]=t.current,pi(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 pu(t)},e.render=function(e,t,n){if(!hu(t))throw Error(r(200));return vu(null,e,t,!1,n)},e.unmountComponentAtNode=function(e){if(!hu(e))throw Error(r(40));return e._reactRootContainer?(wl(function(){vu(null,null,e,!1,function(){e._reactRootContainer=null,e[zi]=null})}),!0):!1},e.unstable_batchedUpdates=Cl,e.unstable_renderSubtreeIntoContainer=function(e,t,n,i){if(!hu(n))throw Error(r(200));if(e==null||e._reactInternals===void 0)throw Error(r(38));return vu(e,t,n,!1,i)},e.version=`18.3.1-next-f1338f8080-20240426`})),m=o(((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=p()})),h=c(o((e=>{var t=m();e.createRoot=t.createRoot,e.hydrateRoot=t.hydrateRoot}))(),1),g=c(u(),1);function _(){let e=window.location;return`${e.protocol===`https:`?`wss:`:`ws:`}//${e.host}/ws`}function v(){let[e,t]=(0,g.useState)(null),[n,r]=(0,g.useState)(!1),[i,a]=(0,g.useState)(),o=(0,g.useRef)(),s=(0,g.useRef)(()=>void 0);return(0,g.useEffect)(()=>{let e=!1,n;function i(){o.current&&clearTimeout(o.current),n=new WebSocket(_()),n.onopen=()=>{r(!0),a(void 0)},n.onclose=()=>{r(!1),a(Date.now()),e||(o.current=setTimeout(i,1500))},n.onmessage=e=>{let n=JSON.parse(e.data);n.type===`roster`&&n.snapshot&&t(n.snapshot)}}return s.current=()=>{n?.readyState===WebSocket.OPEN||n?.readyState===WebSocket.CONNECTING?n.close():i()},i(),()=>{e=!0,o.current&&clearTimeout(o.current),n?.close()}},[]),{snapshot:e,connected:n,lastDisconnectedAt:i,reconnect:()=>s.current()}}var y=o((e=>{var t=u(),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})),b=o(((e,t)=>{t.exports=y()}))(),x={working:{label:`Working`,className:`bg-amber-500/15 text-amber-400 ring-amber-500/30`,pulse:!0},idle:{label:`Idle`,className:`bg-slate-500/15 text-slate-400 ring-slate-500/30`,pulse:!1},stalled:{label:`Stalled`,className:`bg-orange-500/10 text-orange-400 ring-orange-500/50 ring-2 ring-dashed`,pulse:!0},offline:{label:`Offline`,className:`bg-slate-700/20 text-slate-500 ring-slate-600/30`,pulse:!1},waiting_on_you:{label:`Needs you`,className:`bg-rose-500/15 text-rose-400 ring-rose-500/40`,pulse:!0},done:{label:`Done`,className:`bg-emerald-500/15 text-emerald-400 ring-emerald-500/30`,pulse:!1},error:{label:`Stale`,className:`bg-red-500/10 text-red-400 ring-red-500/50 ring-2 ring-dashed`,pulse:!1}};function S({status:e}){let t=x[e];return(0,b.jsxs)(`span`,{className:`inline-flex items-center gap-1.5 rounded-full px-2.5 py-1 text-xs font-medium ring-1 ${t.className}`,children:[(0,b.jsx)(`span`,{className:`h-1.5 w-1.5 rounded-full bg-current ${t.pulse?`hive-pulse`:``}`}),t.label]})}function C(e){let t=Math.max(0,Math.floor(e/1e3));if(t<60)return`${t}s`;let n=Math.floor(t/60);return n<60?`${n}m ${t%60}s`:`${Math.floor(n/60)}h ${n%60}m`}function w(e){return e.doneAt?`complete`:e.jobState===`working`||e.jobState===`busy`?`working`:`ended`}function T({workers:e,compact:t=!1,onSelect:n}){let[r,i]=(0,g.useState)(Date.now());if((0,g.useEffect)(()=>{let e=setInterval(()=>i(Date.now()),1e3);return()=>clearInterval(e)},[]),!e.length)return t?null:(0,b.jsxs)(`div`,{className:`rounded-xl border border-dashed border-white/10 py-10 text-center`,children:[(0,b.jsx)(`p`,{className:`text-sm text-white/35`,children:`No workers have been delegated yet.`}),(0,b.jsx)(`p`,{className:`mt-1 text-xs text-white/20`,children:`Workers appear here as the orchestrator fans out work.`})]});if(t){let t=e.filter(e=>w(e)===`working`).length,n=e.filter(e=>w(e)===`complete`).length;return(0,b.jsxs)(`div`,{className:`mt-4 flex items-center gap-3 text-xs text-white/40`,children:[(0,b.jsxs)(`span`,{children:[e.length,` worker`,e.length===1?``:`s`]}),t>0&&(0,b.jsxs)(`span`,{className:`text-amber-300`,children:[`● `,t,` active`]}),n>0&&(0,b.jsxs)(`span`,{className:`text-emerald-300`,children:[`✓ `,n,` done`]})]})}return(0,b.jsx)(`div`,{className:`space-y-2`,children:e.map(e=>{let t=w(e),i=e.doneAt??(t===`working`?r:e.jobUpdatedAt??r),a=Math.max(e.updatedAt??0,e.jobUpdatedAt??0);return(0,b.jsx)(`button`,{type:`button`,onClick:()=>n?.(e),className:`group w-full rounded-xl border border-white/8 bg-white/[0.025] px-4 py-3.5 text-left transition hover:-translate-y-px hover:border-amber-300/20 hover:bg-white/[0.045] hover:shadow-lg hover:shadow-black/15`,children:(0,b.jsxs)(`div`,{className:`flex items-start justify-between gap-4`,children:[(0,b.jsxs)(`div`,{className:`min-w-0`,children:[(0,b.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,b.jsx)(`span`,{className:`h-2 w-2 shrink-0 rounded-full ${t===`working`?`hive-pulse bg-amber-400`:t===`complete`?`bg-emerald-400`:`bg-white/25`}`}),(0,b.jsx)(`p`,{className:`truncate text-sm font-medium text-white/85`,title:e.label,children:e.label})]}),(0,b.jsxs)(`div`,{className:`ml-4 mt-1.5 flex items-center gap-2 text-[11px] text-white/30`,children:[(0,b.jsx)(`span`,{className:`rounded bg-white/5 px-1.5 py-0.5 uppercase tracking-wide`,children:e.kind}),(0,b.jsx)(`span`,{className:`mono`,children:e.id.slice(0,8)}),e.tokens!==void 0&&(0,b.jsxs)(`span`,{children:[e.tokens.toLocaleString(),` tokens`]}),a>0&&(0,b.jsxs)(`span`,{title:new Date(a).toLocaleString(),children:[`updated `,C(r-a),` ago`]})]})]}),(0,b.jsxs)(`div`,{className:`shrink-0 text-right`,children:[(0,b.jsx)(`p`,{className:`text-xs font-medium capitalize ${t===`working`?`text-amber-300`:t===`complete`?`text-emerald-300`:`text-white/35`}`,children:t}),(0,b.jsx)(`p`,{className:`mono mt-1 text-[11px] text-white/30`,children:C(i-e.startedAt)})]})]})},`${e.jobId}:${e.id}`)})})}var E=``;async function D(e){let t=await fetch(`${E}${e}`),n=await t.json();if(!t.ok)throw Error(n.error??`Request failed: ${t.status}`);return n}async function O(e,t){let n=await fetch(`${E}${e}`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(t)}),r=await n.json();if(!n.ok)throw Error(r.error??`Request failed: ${n.status}`);return r}async function k(e){let t=await fetch(`${E}${e}`,{method:`DELETE`}),n=await t.json();if(!t.ok)throw Error(n.error??`Request failed: ${t.status}`);return n}async function A(e,t){let n=await fetch(`${E}${e}`,{method:`PUT`,headers:{"Content-Type":`application/json`},body:JSON.stringify(t)}),r=await n.json();if(!n.ok)throw Error(r.error??`Request failed: ${n.status}`);return r}function j(e){return O(`/api/orchestrator/start`,e)}function M(e){return O(`/api/skills/discover`,{cwd:e})}function ee(e){return O(`/api/templates/discover`,{cwd:e})}function N(e,t,n){return O(`/api/templates`,{template:e,source:t,cwd:n})}function P(e,t){if(e.source===`built-in`)throw Error(`built-in templates are read-only`);return A(`/api/templates/${e.source}/${encodeURIComponent(e.id)}`,{template:e,cwd:t})}function te(e,t){if(e.source===`built-in`)throw Error(`built-in templates cannot be deleted`);let n=t?`?cwd=${encodeURIComponent(t)}`:``;return k(`/api/templates/${e.source}/${encodeURIComponent(e.id)}${n}`)}function ne(e){return O(`/api/directories/suggest`,{input:e})}function re(e){return O(`/api/paths/inspect`,{input:e})}function F(e,t){return O(`/api/mission/${encodeURIComponent(e)}/message`,{text:t})}function ie(e,t,n){return O(`/api/mission/${encodeURIComponent(e)}/decision/${encodeURIComponent(t)}/answer`,{answer:n})}function ae(e,t){return O(`/api/mission/${encodeURIComponent(e)}/rename`,{name:t})}function oe(e,t){return O(`/api/mission/${encodeURIComponent(e)}/status`,{status:t})}function se(e){return k(`/api/mission/${encodeURIComponent(e)}`)}function ce(e,t){return O(`/api/mission/${encodeURIComponent(e)}/action`,{action:t})}function le(e,t,n){return O(`/api/mission/${encodeURIComponent(e)}/gate/${encodeURIComponent(t)}/waive`,{reason:n})}function ue(e){return D(`/api/mission/${encodeURIComponent(e)}/plan/revisions`)}function de(e,t,n){return O(`/api/mission/${encodeURIComponent(e)}/plan/approval`,{status:t,reason:n})}function fe(e,t,n,r){return O(`/api/mission/${encodeURIComponent(e)}/task/${encodeURIComponent(t)}/action`,{action:n,detail:r})}function pe(e,t){return O(`/api/mission/${encodeURIComponent(e)}/task`,{description:t})}function me(e,t={}){let n=new URLSearchParams;t.before!==void 0&&n.set(`before`,String(t.before)),t.limit!==void 0&&n.set(`limit`,String(t.limit));let r=n.size?`?${n}`:``;return D(`/api/mission/${encodeURIComponent(e)}/messages${r}`)}function he(e){return D(`/api/mission/${encodeURIComponent(e)}/context`)}function ge(e){return O(`/api/mission/${encodeURIComponent(e)}/handoff`,{})}function _e(e,t){return`${E}/api/mission/${encodeURIComponent(e)}/report?format=${t}`}function ve(e,t,n){return O(`/api/mission/${encodeURIComponent(e)}/report/github`,{kind:t,target:n,confirmed:!0})}function ye(){return D(`/api/policies`)}function be(e){return A(`/api/policies`,e)}function xe(e,t){return A(`/api/mission/${encodeURIComponent(e)}/policy`,{policy:t,confirmed:!0})}function Se(){return D(`/api/providers/models`)}function Ce(e,t=!1){return O(`/api/session/${e}/stop`,{force:t})}function we(e,t){return O(`/api/session/${encodeURIComponent(e)}/adopt`,{name:t})}function Te({missionId:e,name:t,large:n=!1}){let[r,i]=(0,g.useState)(!1),[a,o]=(0,g.useState)(t),[s,c]=(0,g.useState)(!1),l=(0,g.useRef)(null);(0,g.useEffect)(()=>o(t),[t]),(0,g.useEffect)(()=>{r&&l.current?.select()},[r]);async function u(){let n=a.trim();if(!n||n===t){o(t),i(!1);return}c(!0);try{await ae(e,n),i(!1)}finally{c(!1)}}return r?(0,b.jsx)(`input`,{ref:l,value:a,disabled:s,onChange:e=>o(e.target.value),onClick:e=>e.stopPropagation(),onBlur:u,onKeyDown:e=>{e.stopPropagation(),e.key===`Enter`&&u(),e.key===`Escape`&&(o(t),i(!1))},className:`${n?`text-xl`:`text-sm`} min-w-0 max-w-full rounded border border-violet-400/40 bg-black/30 px-1.5 py-0.5 font-semibold text-white outline-none`}):(0,b.jsxs)(`div`,{className:`group/name flex min-w-0 items-center gap-1.5`,children:[(0,b.jsx)(`span`,{className:`${n?`text-xl`:`text-sm`} truncate font-semibold text-white`,children:t}),(0,b.jsx)(`button`,{type:`button`,title:`Rename mission`,onClick:e=>{e.stopPropagation(),i(!0)},className:`shrink-0 rounded p-1 text-white/25 opacity-0 transition hover:bg-white/10 hover:text-white/70 group-hover/name:opacity-100`,children:`✎`})]})}var Ee={active:`bg-violet-500/10 text-violet-300 ring-violet-500/25`,ready_for_review:`bg-amber-500/10 text-amber-300 ring-amber-500/30`,paused:`bg-sky-500/10 text-sky-300 ring-sky-500/25`,completed:`bg-emerald-500/10 text-emerald-300 ring-emerald-500/25`,failed:`bg-red-500/10 text-red-300 ring-red-500/25`,archived:`bg-slate-500/10 text-slate-400 ring-slate-500/25`};function De({status:e}){return(0,b.jsx)(`span`,{className:`inline-flex items-center justify-center whitespace-nowrap rounded-full px-2.5 py-1 text-center text-xs font-medium capitalize ring-1 ${Ee[e]}`,children:e===`ready_for_review`?`Awaiting acceptance`:e})}function Oe(e){let t=Math.max(0,Math.floor(e/6e4));return t<1?`<1m`:t<60?`${t}m`:`${Math.floor(t/60)}h ${t%60}m`}function ke({node:e,onSelect:t}){let[n,r]=(0,g.useState)(Date.now());(0,g.useEffect)(()=>{let e=setInterval(()=>r(Date.now()),3e4);return()=>clearInterval(e)},[]);let i={critical:0,warning:1,info:2},a=[...e.alerts??[]].sort((e,t)=>i[e.severity]-i[t.severity]),o=a[0],s=e.lifecycleStatus===`ready_for_review`?{text:`Ready for your acceptance · review the evidence, accept completion, or request changes.`,tone:`acceptance`,more:0}:o?{text:`${o.title}${o.id===`idle-after-workers`?` · ${Oe(e.inactiveForMs)}`:``}`,tone:o.severity===`critical`?`critical`:`warning`,more:a.length-1}:e.waitingFor?{text:`Waiting: ${e.waitingFor}`,tone:`critical`,more:0}:e.activityStatus===`stalled`?{text:`Expected work has had no meaningful activity for ${Oe(e.inactiveForMs)}. Open for recovery options.`,tone:`warning`,more:0}:e.activityStatus===`idle`&&e.lifecycleStatus===`active`?{text:e.turnCompleted?`Latest turn finished · mission remains open for follow-up.`:`Mission is open with no current orchestrator or worker activity.`,tone:`idle`,more:0}:void 0;return(0,b.jsxs)(`div`,{role:`button`,tabIndex:0,onClick:t,onKeyDown:e=>{(e.key===`Enter`||e.key===` `)&&t()},className:`group flex w-full cursor-pointer flex-col rounded-2xl border border-white/10 bg-gradient-to-br from-white/[0.05] via-white/[0.025] to-amber-300/[0.018] p-5 text-left transition hover:-translate-y-0.5 hover:border-amber-300/20 hover:shadow-xl hover:shadow-amber-950/10`,children:[(0,b.jsxs)(`div`,{className:`flex items-start justify-between gap-3`,children:[(0,b.jsxs)(`div`,{className:`min-w-0`,children:[(0,b.jsx)(Te,{missionId:e.missionId,name:e.name}),(0,b.jsxs)(`div`,{className:`mt-1 flex min-w-0 items-center gap-1.5`,children:[(0,b.jsx)(`span`,{className:`rounded px-1.5 py-0.5 text-[9px] font-semibold uppercase tracking-wide ${e.mission.provider===`codex`?`bg-emerald-300/[0.09] text-emerald-200/60`:`bg-violet-300/[0.09] text-violet-200/60`}`,children:e.mission.provider??`claude`}),(0,b.jsx)(`span`,{className:`mono truncate rounded bg-white/[0.04] px-1.5 py-0.5 text-[9px] text-white/35`,children:e.mission.model??`CLI default`}),(0,b.jsxs)(`span`,{className:`mono truncate text-[11px] text-white/25`,children:[e.mission.mode,` · `,e.jobIds.length,` turn`,e.jobIds.length===1?``:`s`]})]})]}),(0,b.jsxs)(`div`,{className:`flex flex-wrap justify-end gap-2`,children:[(0,b.jsx)(De,{status:e.lifecycleStatus}),(0,b.jsx)(S,{status:e.activityStatus})]})]}),(0,b.jsx)(`p`,{className:`mt-4 line-clamp-2 min-h-10 text-sm leading-relaxed text-white/50`,children:e.detail??e.intent??`Waiting for activity`}),e.plan&&(0,b.jsxs)(`div`,{className:`mt-3`,children:[(0,b.jsxs)(`div`,{className:`mb-1.5 flex items-center justify-between text-[10px] uppercase tracking-wide text-white/25`,children:[(0,b.jsx)(`span`,{children:`Plan progress`}),(0,b.jsxs)(`span`,{className:`text-amber-200/60`,children:[e.plan.progress.percent??`—`,e.plan.progress.percent!==void 0&&`%`]})]}),(0,b.jsx)(`div`,{className:`h-1 overflow-hidden rounded-full bg-white/[0.06]`,children:(0,b.jsx)(`div`,{className:`h-full rounded-full bg-gradient-to-r from-amber-400 to-violet-400`,style:{width:`${e.plan.progress.percent??0}%`}})})]}),(0,b.jsxs)(`div`,{className:`mt-4 grid grid-cols-3 gap-2 border-y border-white/7 py-3 text-center`,children:[(0,b.jsxs)(`div`,{children:[(0,b.jsx)(`p`,{className:`text-sm font-semibold text-white/80`,children:Oe((e.status===`working`?n:e.updatedAt)-e.runStartedAt)}),(0,b.jsx)(`p`,{className:`text-[10px] uppercase tracking-wide text-white/25`,children:`this turn`})]}),(0,b.jsxs)(`div`,{children:[(0,b.jsx)(`p`,{className:`text-sm font-semibold text-white/80`,children:e.workers.length}),(0,b.jsx)(`p`,{className:`text-[10px] uppercase tracking-wide text-white/25`,children:`workers`})]}),(0,b.jsxs)(`div`,{children:[(0,b.jsx)(`p`,{className:`text-sm font-semibold text-white/80`,children:e.tokens.toLocaleString()}),(0,b.jsx)(`p`,{className:`text-[10px] uppercase tracking-wide text-white/25`,children:`tokens`})]})]}),(0,b.jsx)(T,{workers:e.workers,compact:!0}),s&&(0,b.jsxs)(`p`,{className:`mt-3 rounded-lg border px-3 py-2 text-xs ${s.tone===`acceptance`?`border-amber-300/20 bg-amber-300/[0.06] text-amber-100/75`:s.tone===`critical`?`border-rose-400/20 bg-rose-400/[0.06] text-rose-200/75`:s.tone===`warning`?`border-orange-400/15 bg-orange-400/[0.05] text-orange-200/70`:`border-slate-400/10 bg-slate-400/[0.04] text-slate-300/65`}`,children:[s.text,s.more>0&&(0,b.jsxs)(`span`,{className:`ml-1 text-white/30`,children:[`+`,s.more,` more`]})]})]})}function Ae({value:e,onChange:t,skills:n,placeholder:r,rows:i=3,onSubmit:a,className:o=``,suggestionsPlacement:s=`above`,autoFocus:c=!1}){let l=(0,g.useMemo)(()=>new Map(n.map(e=>[e.name,e.source])),[n]),u=e=>l.get(e)===`claude`?`text-sky-300`:`text-violet-300`,[d,f]=(0,g.useState)(0),[p,m]=(0,g.useState)(0),h=(0,g.useRef)(null),_=e.slice(0,d).match(/(?:^|\s)\/([\w:-]*)$/),v=_?n.filter(e=>e.name.toLowerCase().startsWith(_[1].toLowerCase())).slice(0,8):[];function y(n){if(!_)return;let r=d-_[1].length-1,i=`${e.slice(0,r)}/${n.name} ${e.slice(d)}`,a=r+n.name.length+2;t(i),f(a),m(0),requestAnimationFrame(()=>{h.current?.focus(),h.current?.setSelectionRange(a,a)})}return(0,b.jsxs)(`div`,{className:`relative ${o}`,children:[(0,b.jsx)(`div`,{"aria-hidden":!0,className:`pointer-events-none absolute inset-0 whitespace-pre-wrap break-words overflow-hidden rounded-lg border border-transparent px-2 py-1.5 text-sm leading-5`,children:e.split(/(\/[\w:-]+)/g).map((e,t)=>e.startsWith(`/`)&&l.has(e.slice(1))?(0,b.jsx)(`span`,{className:u(e.slice(1)),children:e},t):(0,b.jsx)(`span`,{className:`text-white`,children:e},t))}),(0,b.jsx)(`textarea`,{ref:h,value:e,onChange:e=>{t(e.target.value),f(e.target.selectionStart),m(0)},onClick:e=>f(e.currentTarget.selectionStart),onKeyUp:e=>f(e.currentTarget.selectionStart),onKeyDown:e=>{if(v.length){if(e.key===`ArrowDown`){e.preventDefault(),m((p+1)%v.length);return}if(e.key===`ArrowUp`){e.preventDefault(),m((p-1+v.length)%v.length);return}if(e.key===`Enter`||e.key===`Tab`){e.preventDefault(),y(v[p]);return}}a&&e.key===`Enter`&&!e.shiftKey&&(e.preventDefault(),a())},rows:i,placeholder:r,autoFocus:c,className:`relative w-full resize-none bg-transparent px-2 py-1.5 text-sm leading-5 text-transparent caret-white outline-none placeholder:text-white/25`}),v.length>0&&(0,b.jsx)(`div`,{className:`absolute left-0 right-0 z-30 overflow-hidden rounded-lg border border-white/10 bg-[#17171c] shadow-2xl ${s===`above`?`bottom-full mb-2`:`top-full mt-2`}`,children:v.map((e,t)=>(0,b.jsxs)(`button`,{type:`button`,onMouseDown:t=>{t.preventDefault(),y(e)},className:`flex w-full items-start justify-between gap-4 px-3 py-2 text-left ${t===p?`bg-violet-400/10`:`hover:bg-white/5`}`,children:[(0,b.jsxs)(`span`,{className:`min-w-0`,children:[(0,b.jsxs)(`span`,{className:`text-sm ${e.source===`claude`?`text-sky-300`:`text-violet-300`}`,children:[`/`,e.name]}),e.argumentHint&&(0,b.jsx)(`span`,{className:`ml-1.5 font-mono text-[10px] text-amber-200/45`,children:e.argumentHint}),e.description&&(0,b.jsx)(`span`,{className:`mt-0.5 block line-clamp-1 text-[11px] text-white/35`,children:e.description})]}),(0,b.jsx)(`span`,{className:`shrink-0 text-[10px] uppercase text-white/20`,children:e.source})]},`${e.source}:${e.name}`))})]})}function je(e){let t=(0,g.useRef)(!1);return{onMouseDown:e=>{t.current=e.target===e.currentTarget},onClick:n=>{t.current&&n.target===n.currentTarget&&e(),t.current=!1}}}var Me=e=>typeof window>`u`?null:localStorage.getItem(e);function Ne({onClose:e}){let t=je(e),[n,r]=(0,g.useState)(``),[i,a]=(0,g.useState)(``),[o,s]=(0,g.useState)(()=>Me(`hive:last-cwd`)??``),[c,l]=(0,g.useState)(()=>Me(`hive:last-mode`)||`direct`),[u,d]=(0,g.useState)(`claude`),[f,p]=(0,g.useState)(``),[m,h]=(0,g.useState)(()=>(Me(`hive:last-mode`)||`direct`)===`orchestrated`),_=(0,g.useRef)(!1);function v(e){l(e),_.current||h(e===`orchestrated`)}let[y,x]=(0,g.useState)(!1),[S,C]=(0,g.useState)(null),[w,T]=(0,g.useState)([]),[E,D]=(0,g.useState)(null),[O,k]=(0,g.useState)([]),[A,N]=(0,g.useState)(!1),[P,te]=(0,g.useState)(),[F,ie]=(0,g.useState)(!1),[ae,oe]=(0,g.useState)({}),[se,ce]=(0,g.useState)([]),[le,ue]=(0,g.useState)(``),[de,fe]=(0,g.useState)([]);(0,g.useEffect)(()=>{let t=t=>{t.key===`Escape`&&e()};return document.addEventListener(`keydown`,t),()=>document.removeEventListener(`keydown`,t)},[e]),(0,g.useEffect)(()=>{Se().then(({providers:e})=>fe(e)).catch(()=>fe([]))},[]),(0,g.useEffect)(()=>{let e=setTimeout(()=>{Promise.allSettled([M(o.trim()||void 0),ne(o),re(o.trim()||void 0),ee(o.trim()||void 0)]).then(([e,t,n,r])=>{e.status===`fulfilled`?(T(e.value.skills),D(null)):(T([]),D(e.reason.message)),t.status===`fulfilled`&&k(t.value.directories),n.status===`fulfilled`&&te(n.value),r.status===`fulfilled`&&ce(r.value.templates)})},250);return()=>clearTimeout(e)},[o]);async function pe(){if(n.trim()){x(!0),C(null);try{await j({task:n,name:i.trim()||void 0,worktree:u===`claude`&&m,cwd:o.trim()||void 0,mode:c,budgets:ae,templateId:le||void 0,provider:u,model:f.trim()||void 0});try{o.trim()&&localStorage.setItem(`hive:last-cwd`,o.trim()),localStorage.setItem(`hive:last-mode`,c)}catch{}e()}catch(e){C(e.message)}finally{x(!1)}}}return(0,b.jsx)(`div`,{className:`fixed inset-0 z-50 flex items-center justify-center bg-black/60 p-4`,...t,children:(0,b.jsxs)(`div`,{role:`dialog`,"aria-modal":`true`,"aria-labelledby":`new-mission-title`,className:`relative max-h-[calc(100dvh-2rem)] w-full max-w-xl overflow-y-auto overscroll-contain rounded-xl border border-white/10 bg-[#0f0f12] p-5 shadow-2xl shadow-black/40`,onClick:e=>e.stopPropagation(),children:[(0,b.jsxs)(`div`,{className:`mb-4 flex items-center justify-between`,children:[(0,b.jsx)(`h2`,{id:`new-mission-title`,className:`text-sm font-medium text-white`,children:`New mission`}),(0,b.jsx)(`button`,{type:`button`,onClick:e,"aria-label":`Close new mission dialog`,className:`rounded-lg border border-transparent px-2.5 py-1.5 text-sm text-white/35 transition hover:border-white/10 hover:bg-white/5 hover:text-white/75`,children:`×`})]}),(0,b.jsx)(`label`,{className:`mb-1 block text-xs text-white/40`,children:`Task`}),(0,b.jsx)(`div`,{className:`rounded-lg border border-white/10 bg-transparent p-1 focus-within:border-white/25`,children:(0,b.jsx)(Ae,{value:n,onChange:r,skills:w,rows:4,suggestionsPlacement:`below`,placeholder:`What should this mission accomplish? Type / to use a skill.`,autoFocus:!0,onSubmit:pe})}),(0,b.jsx)(`p`,{className:`mb-3 mt-1.5 text-[10px] text-white/25`,children:`Enter starts the mission with the settings below · Shift+Enter for a new line`}),(0,b.jsx)(`label`,{className:`mb-1 block text-xs text-white/40`,children:`Name (optional)`}),(0,b.jsx)(`input`,{value:i,onChange:e=>a(e.target.value),placeholder:`e.g. billing-refactor`,className:`mb-4 w-full rounded-lg border border-white/10 bg-white/[0.03] p-2.5 text-sm text-white placeholder:text-white/30 focus:border-white/25 focus:outline-none`}),(0,b.jsxs)(`div`,{className:`mb-1 flex items-center justify-between`,children:[(0,b.jsx)(`label`,{className:`block text-xs text-white/40`,children:`Working directory`}),(0,b.jsx)(`button`,{type:`button`,onClick:()=>{s(``),N(!0)},className:`text-[10px] text-violet-300/45 hover:text-violet-200`,children:`Recent repositories`})]}),(0,b.jsxs)(`div`,{className:`relative`,children:[(0,b.jsx)(`input`,{value:o,onFocus:()=>N(!0),onBlur:()=>setTimeout(()=>N(!1),120),onChange:e=>s(e.target.value),placeholder:`~/Development/project or /absolute/path`,className:`w-full rounded-lg border border-white/10 bg-white/[0.03] p-2.5 font-mono text-xs text-white placeholder:text-white/25 focus:border-white/25 focus:outline-none`}),A&&O.length>0&&(0,b.jsx)(`div`,{className:`absolute left-0 right-0 top-full z-20 mt-1 max-h-56 overflow-y-auto rounded-lg border border-white/10 bg-[#17171c] p-1 shadow-2xl`,children:O.map(e=>(0,b.jsxs)(`button`,{type:`button`,onMouseDown:e=>e.preventDefault(),onClick:()=>{s(e.path),N(!1)},className:`block w-full rounded-md px-3 py-2 text-left hover:bg-white/5`,children:[(0,b.jsx)(`span`,{className:`block font-mono text-xs text-white/75`,children:e.path}),e.path!==e.resolvedPath&&(0,b.jsx)(`span`,{className:`mt-0.5 block truncate font-mono text-[10px] text-white/25`,children:e.resolvedPath})]},e.resolvedPath))})]}),P&&(0,b.jsx)(`div`,{className:`mt-2 rounded-lg border px-3 py-2.5 ${P.exists?`border-white/[0.06] bg-white/[0.018]`:`border-rose-400/15 bg-rose-400/[0.04]`}`,children:P.exists?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-3 gap-y-1 text-[10px]`,children:[(0,b.jsx)(`span`,{className:`font-mono text-white/45`,children:P.resolvedPath}),P.repositoryRoot?(0,b.jsx)(`span`,{className:`text-emerald-300/45`,children:`Git repository`}):(0,b.jsx)(`span`,{className:`text-amber-200/45`,children:`Directory is not a Git repository`}),P.branch&&(0,b.jsxs)(`span`,{className:`text-violet-300/50`,children:[`branch: `,P.branch]}),P.isWorktree&&(0,b.jsx)(`span`,{className:`text-sky-300/45`,children:`existing worktree`})]}),(0,b.jsx)(`div`,{className:`mt-2 flex flex-wrap gap-1.5`,children:P.configuration.map(e=>(0,b.jsxs)(`span`,{className:`rounded px-1.5 py-0.5 text-[9px] ${e.available?`bg-emerald-300/[0.07] text-emerald-200/45`:`bg-white/[0.025] text-white/18`}`,children:[e.available?`✓`:`—`,` `,e.label]},e.label))}),(0,b.jsx)(`p`,{className:`mt-2 text-[10px] text-white/25`,children:m?P.repositoryRoot?`Hive will create a new isolated Git worktree for this mission.`:`Worktree creation is unavailable outside a Git repository; launch will use this directory.`:P.isWorktree?`The mission will run inside this existing worktree.`:`The mission will run directly in this directory.`})]}):(0,b.jsxs)(`p`,{className:`text-[11px] text-rose-300/70`,children:[`Directory not found: `,(0,b.jsx)(`span`,{className:`font-mono`,children:P.resolvedPath}),`. Choose a suggestion or enter an existing absolute path.`]})}),(0,b.jsx)(`p`,{className:`mb-4 mt-2 text-[11px] ${E?`text-rose-400`:`text-white/25`}`,children:E??`${w.length} project/user skill${w.length===1?``:`s`} available`}),(0,b.jsx)(`label`,{className:`mb-2 block text-xs text-white/40`,children:`Provider`}),(0,b.jsx)(`div`,{className:`mb-4 grid grid-cols-2 gap-2`,children:[`claude`,`codex`].map(e=>{let t=de.find(t=>t.provider===e)?.available===!1;return(0,b.jsxs)(`button`,{type:`button`,disabled:t,"aria-pressed":u===e,onClick:()=>{d(e),p(``)},className:`rounded-lg border p-3 text-left transition hover:-translate-y-0.5 disabled:cursor-not-allowed disabled:opacity-35 ${u===e?e===`codex`?`border-emerald-300/35 bg-emerald-300/[0.08]`:`border-violet-300/35 bg-violet-300/[0.08]`:`border-white/10 bg-white/[0.02] hover:bg-white/[0.04]`}`,children:[(0,b.jsxs)(`span`,{className:`flex items-center justify-between text-sm font-medium capitalize text-white/85`,children:[(0,b.jsx)(`span`,{children:e}),t&&(0,b.jsx)(`span`,{className:`text-[9px] font-normal uppercase text-rose-300/60`,children:`Not detected`})]}),(0,b.jsxs)(`span`,{className:`mt-1 block text-[10px] text-white/30`,children:[`Uses your locally authenticated `,e===`codex`?`Codex`:`Claude Code`,` CLI.`]})]},e)})}),(0,b.jsx)(`label`,{className:`mb-1 block text-xs text-white/40`,children:`Model`}),(0,b.jsxs)(`select`,{value:f,onChange:e=>p(e.target.value),className:`mb-1 w-full rounded-lg border border-white/10 bg-[#151519] p-2.5 font-mono text-xs text-white/70 outline-none focus:border-white/25`,children:[(0,b.jsxs)(`option`,{value:``,children:[`CLI default`,de.find(e=>e.provider===u)?.defaultModel?` (${de.find(e=>e.provider===u).defaultModel.label})`:``,` · recommended`]}),(de.find(e=>e.provider===u)?.models??[]).map(e=>(0,b.jsxs)(`option`,{value:e.id,children:[e.label,` · `,e.description??e.id]},e.id))]}),(0,b.jsx)(`p`,{className:`mb-4 text-[10px] text-white/25`,children:de.find(e=>e.provider===u)?.detection===`cli-catalog`?`Detected from this Codex CLI's current model catalog.`:de.find(e=>e.provider===u)?.detection===`cli-advertised`?`Matches the installed Claude Code model picker; account access and usage credits are still enforced by Claude.`:`No model catalog was detected. Hive will use the CLI's configured default.`}),(0,b.jsx)(`label`,{className:`mb-2 block text-xs text-white/40`,children:`Execution mode`}),(0,b.jsx)(`div`,{className:`mb-4 grid grid-cols-2 gap-2`,children:[`direct`,`orchestrated`].map(e=>(0,b.jsxs)(`button`,{type:`button`,"aria-pressed":c===e,onClick:()=>v(e),className:`group rounded-lg border p-3 text-left transition duration-150 hover:-translate-y-0.5 hover:border-violet-300/30 hover:bg-violet-300/[0.07] hover:shadow-lg hover:shadow-violet-950/15 ${c===e?`border-violet-400/40 bg-violet-400/10 shadow-inner shadow-violet-400/[0.04]`:`border-white/10 bg-white/[0.02]`}`,children:[(0,b.jsx)(`span`,{className:`block text-sm font-medium capitalize text-white/85 transition group-hover:text-white`,children:e}),(0,b.jsx)(`span`,{className:`mt-1 block text-[11px] leading-relaxed text-white/35 transition group-hover:text-white/50`,children:e===`direct`?`One agent works directly; best for small tasks.`:`A manager delegates work to parallel workers.`})]},e))}),(0,b.jsx)(`label`,{className:`mb-1 block text-xs text-white/40`,children:`Mission template`}),(0,b.jsxs)(`select`,{value:le,onChange:e=>{let t=e.target.value;ue(t);let n=se.find(e=>e.id===t);n&&(l(n.mode),_.current=!0,h(n.worktree),oe(n.budgets??{}))},className:`mb-2 w-full rounded-lg border border-white/10 bg-[#151519] px-3 py-2 text-xs text-white/60`,children:[(0,b.jsx)(`option`,{value:``,children:`No template`}),se.map(e=>(0,b.jsxs)(`option`,{value:e.id,children:[e.name,` · v`,e.version,` · `,e.source]},`${e.source}:${e.id}`))]}),le&&(()=>{let e=se.find(e=>e.id===le);return e?(0,b.jsxs)(`div`,{className:`mb-4 rounded-lg border border-violet-300/10 bg-violet-300/[0.035] p-3`,children:[(0,b.jsx)(`p`,{className:`text-xs text-white/55`,children:e.description}),(0,b.jsxs)(`p`,{className:`mt-2 text-[10px] text-white/30`,children:[`Stages: `,e.stages.map(e=>e.title).join(` → `)]}),(0,b.jsxs)(`p`,{className:`mt-1 text-[10px] text-white/30`,children:[`Required: `,e.gates.map(e=>e.label).join(`, `)]}),(0,b.jsxs)(`p`,{className:`mt-1 text-[10px] text-white/22`,children:[`External actions: pushes `,e.permissions.pushes?`allowed`:`approval`,`, PRs `,e.permissions.pullRequests?`allowed`:`approval`,`, destructive actions `,e.permissions.destructiveActions?`allowed`:`approval`,`.`]})]}):null})(),(0,b.jsxs)(`label`,{className:`mb-4 flex items-center gap-2 text-sm ${u===`codex`?`text-white/25`:`text-white/70`}`,children:[(0,b.jsx)(`input`,{type:`checkbox`,checked:u===`claude`&&m,disabled:u===`codex`,onChange:e=>{_.current=!0,h(e.target.checked)}}),`Run in a new git worktree`]}),u===`codex`&&(0,b.jsx)(`p`,{className:`-mt-3 mb-4 text-[10px] text-white/25`,children:`Codex runs in the selected repository with its workspace-write sandbox. Native Hive-created worktrees for Codex are not yet available.`}),(0,b.jsxs)(`div`,{className:`mb-4 rounded-lg border border-white/[0.06] bg-white/[0.015]`,children:[(0,b.jsxs)(`button`,{type:`button`,onClick:()=>ie(!F),className:`flex w-full items-center justify-between px-3 py-2.5 text-left`,children:[(0,b.jsxs)(`span`,{children:[(0,b.jsx)(`span`,{className:`block text-xs font-medium text-white/55`,children:`Mission budgets`}),(0,b.jsx)(`span`,{className:`mt-0.5 block text-[10px] text-white/25`,children:`Optional soft limits; approval is requested before exceeding them.`})]}),(0,b.jsx)(`span`,{className:`text-xs text-white/25`,children:F?`−`:`+`})]}),F&&(0,b.jsx)(`div`,{className:`grid grid-cols-2 gap-2 border-t border-white/[0.05] p-3`,children:[[`maxWorkers`,`Maximum workers`,`e.g. 8`],[`maxConcurrentWorkers`,`Concurrent workers`,`e.g. 4`],[`maxTokens`,`Token budget`,`e.g. 100000`],[`maxElapsedMinutes`,`Time budget (minutes)`,`e.g. 120`]].map(([e,t,n])=>(0,b.jsxs)(`label`,{className:`text-[10px] text-white/35`,children:[t,(0,b.jsx)(`input`,{type:`number`,min:`1`,value:ae[e]??``,onChange:t=>oe(n=>({...n,[e]:t.target.value?Math.max(1,Number(t.target.value)):void 0})),placeholder:n,className:`mt-1 w-full rounded-md border border-white/10 bg-black/20 px-2 py-1.5 text-xs text-white/65 outline-none focus:border-amber-300/25`})]},e))})]}),S&&(0,b.jsx)(`p`,{className:`mb-3 text-xs text-rose-400`,children:S}),(0,b.jsxs)(`div`,{className:`flex justify-end gap-2`,children:[(0,b.jsx)(`button`,{onClick:e,className:`rounded-lg px-3 py-1.5 text-sm text-white/50 hover:text-white/80`,children:`Cancel`}),(0,b.jsx)(`button`,{onClick:pe,disabled:y||!n.trim()||!!E||P?.exists===!1,className:`rounded-lg bg-white/90 px-3 py-1.5 text-sm font-medium text-black disabled:opacity-40`,children:y?`Starting…`:`Start ${c} mission`})]})]})})}function Pe({compact:e=!1}){return(0,b.jsx)(`div`,{className:`hive-mark ${e?`h-8 w-8`:`h-10 w-10`}`,"aria-hidden":`true`,children:(0,b.jsxs)(`svg`,{viewBox:`0 0 48 48`,fill:`none`,className:`h-full w-full`,children:[(0,b.jsx)(`path`,{d:`M24 3.5 41.75 13.75v20.5L24 44.5 6.25 34.25v-20.5L24 3.5Z`,fill:`url(#hive-fill)`,stroke:`url(#hive-stroke)`,strokeWidth:`1.5`}),(0,b.jsx)(`path`,{d:`M17.5 19.2c-4.8-4.4-8.7.4-4.5 4.3 1.7 1.6 4 1.8 6.2 1M30.5 19.2c4.8-4.4 8.7.4 4.5 4.3-1.7 1.6-4 1.8-6.2 1`,fill:`#f7b93e`,fillOpacity:`.2`,stroke:`#f7c65a`,strokeWidth:`1.4`,strokeLinecap:`round`}),(0,b.jsx)(`path`,{d:`M18.5 22.5c0-3 2.45-5.5 5.5-5.5s5.5 2.5 5.5 5.5v4c0 3.6-2.45 6.5-5.5 6.5s-5.5-2.9-5.5-6.5v-4Z`,fill:`#f7b93e`}),(0,b.jsx)(`path`,{d:`M19 23h10M18.7 27.5h10.6`,stroke:`#30230b`,strokeWidth:`2.4`}),(0,b.jsx)(`path`,{d:`m21 32.1 3 3 3-3`,fill:`#f7b93e`}),(0,b.jsx)(`circle`,{cx:`22`,cy:`20.5`,r:`.8`,fill:`#30230b`}),(0,b.jsx)(`circle`,{cx:`26`,cy:`20.5`,r:`.8`,fill:`#30230b`}),(0,b.jsxs)(`defs`,{children:[(0,b.jsxs)(`linearGradient`,{id:`hive-fill`,x1:`9`,y1:`7`,x2:`39`,y2:`42`,gradientUnits:`userSpaceOnUse`,children:[(0,b.jsx)(`stop`,{stopColor:`#F9C74F`,stopOpacity:`.22`}),(0,b.jsx)(`stop`,{offset:`1`,stopColor:`#7C3AED`,stopOpacity:`.1`})]}),(0,b.jsxs)(`linearGradient`,{id:`hive-stroke`,x1:`8`,y1:`8`,x2:`40`,y2:`41`,gradientUnits:`userSpaceOnUse`,children:[(0,b.jsx)(`stop`,{stopColor:`#FFD875`}),(0,b.jsx)(`stop`,{offset:`1`,stopColor:`#A78BFA`,stopOpacity:`.55`})]})]})]})})}function Fe({subtitle:e}){return(0,b.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,b.jsx)(Pe,{}),(0,b.jsxs)(`div`,{children:[(0,b.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,b.jsx)(`h1`,{className:`hive-wordmark text-xl text-white`,children:`Hive`}),(0,b.jsx)(`span`,{className:`rounded-full border border-amber-300/15 bg-amber-300/[0.06] px-1.5 py-0.5 text-[8px] font-bold uppercase tracking-[0.18em] text-amber-200/55`,children:`Mission control`})]}),e&&(0,b.jsx)(`p`,{className:`mt-0.5 text-xs text-white/35`,children:e})]})]})}function Ie({decisions:e,onOpenMission:t,showMission:n=!0}){let[r,i]=(0,g.useState)({}),[a,o]=(0,g.useState)(null),[s,c]=(0,g.useState)({});if(!e.length)return null;async function l(e,t){let n=(t??r[e.id]??``).trim();if(!(!n||a)){o(e.id),c(t=>({...t,[e.id]:``}));try{await ie(e.missionId,e.id,n)}catch(t){c(n=>({...n,[e.id]:t.message}))}finally{o(null)}}}return(0,b.jsxs)(`section`,{className:`mb-8 overflow-hidden rounded-2xl border border-amber-300/15 bg-amber-300/[0.035]`,children:[(0,b.jsxs)(`div`,{className:`flex items-center justify-between border-b border-amber-300/10 px-5 py-4`,children:[(0,b.jsxs)(`div`,{children:[(0,b.jsx)(`h2`,{className:`text-sm font-semibold text-amber-100/85`,children:`Needs you`}),(0,b.jsx)(`p`,{className:`mt-0.5 text-xs text-white/35`,children:`Answer orchestrator decisions without leaving the fleet.`})]}),(0,b.jsxs)(`span`,{className:`rounded-full bg-amber-300/10 px-2.5 py-1 text-[10px] font-semibold text-amber-200/70`,children:[e.length,` pending`]})]}),(0,b.jsx)(`div`,{className:`divide-y divide-amber-300/10`,children:e.map(e=>(0,b.jsxs)(`article`,{className:`p-5`,children:[n&&(0,b.jsxs)(`div`,{className:`mb-2.5 rounded-lg border border-violet-300/10 bg-violet-300/[0.03] px-3 py-2`,children:[(0,b.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,b.jsxs)(`button`,{onClick:()=>t(e.missionId),className:`text-xs font-semibold text-violet-300/80 hover:text-violet-200`,children:[e.missionName,` ↗`]}),e.repository&&(0,b.jsx)(`span`,{className:`mono rounded bg-white/[0.04] px-1.5 py-0.5 text-[9px] text-white/35`,title:e.repository,children:e.repository.split(`/`).at(-1)})]}),e.missionObjective&&(0,b.jsxs)(`p`,{className:`mt-1 truncate text-[11px] text-white/40`,title:e.missionObjective,children:[(0,b.jsx)(`span`,{className:`text-white/20`,children:`Mission goal:`}),` `,e.missionObjective]})]}),(0,b.jsxs)(`div`,{className:`flex flex-wrap items-start justify-between gap-3`,children:[(0,b.jsxs)(`div`,{className:`min-w-0`,children:[(0,b.jsx)(`h3`,{className:`text-sm font-medium leading-relaxed text-white/80`,children:e.question}),e.context&&(0,b.jsx)(`p`,{className:`mt-1.5 text-xs leading-relaxed text-white/35`,children:e.context})]}),(0,b.jsx)(`span`,{className:`rounded-md border border-white/8 px-2 py-1 text-[9px] uppercase tracking-wide text-white/30`,children:e.kind})]}),(e.recommendation||e.impact)&&(0,b.jsxs)(`div`,{className:`mt-3 grid gap-2 sm:grid-cols-2`,children:[e.recommendation&&(0,b.jsxs)(`p`,{className:`rounded-lg bg-emerald-300/[0.04] px-3 py-2 text-[11px] text-emerald-100/50`,children:[(0,b.jsx)(`span`,{className:`font-medium`,children:`Recommended:`}),` `,e.recommendation]}),e.impact&&(0,b.jsxs)(`p`,{className:`rounded-lg bg-white/[0.025] px-3 py-2 text-[11px] text-white/35`,children:[(0,b.jsx)(`span`,{className:`font-medium text-white/45`,children:`While waiting:`}),` `,e.impact]})]}),e.choices.length>0&&(0,b.jsx)(`div`,{className:`mt-3 flex flex-wrap gap-2`,children:e.choices.map(t=>(0,b.jsx)(`button`,{disabled:!!a,onClick:()=>l(e,t),className:`rounded-lg border border-amber-200/15 bg-amber-200/[0.06] px-3 py-1.5 text-xs text-amber-100/65 hover:bg-amber-200/10 disabled:opacity-40`,children:t},t))}),(0,b.jsxs)(`div`,{className:`mt-3 flex gap-2`,children:[(0,b.jsx)(`input`,{value:r[e.id]??``,onChange:t=>i(n=>({...n,[e.id]:t.target.value})),onKeyDown:t=>{t.key===`Enter`&&l(e)},placeholder:`Or write a custom answer…`,className:`min-w-0 flex-1 rounded-lg border border-white/10 bg-black/15 px-3 py-2 text-xs text-white/70 outline-none placeholder:text-white/20 focus:border-amber-300/25`}),(0,b.jsx)(`button`,{onClick:()=>l(e),disabled:!r[e.id]?.trim()||!!a,className:`rounded-lg bg-amber-300 px-3 py-2 text-xs font-semibold text-[#291b05] disabled:opacity-35`,children:a===e.id?`Sending…`:`Answer`})]}),s[e.id]&&(0,b.jsx)(`p`,{className:`mt-2 text-[10px] text-rose-400`,children:s[e.id]})]},e.id))})]})}function Le({pid:e,status:t,force:n=!1,label:r=`Stop`}){let[i,a]=(0,g.useState)(!1),[o,s]=(0,g.useState)(!1),[c,l]=(0,g.useState)(null),[u,d]=(0,g.useState)(!1);if(e<0||t===`done`||t===`offline`)return null;async function f(){if(!i){a(!0),setTimeout(()=>a(!1),3e3);return}s(!0),l(null);let t=n||u;try{await Ce(e,t),a(!1)}catch(e){l(e.message),a(!1),t||d(!0)}finally{s(!1)}}let p=u&&!n?`Force stop`:r;return(0,b.jsxs)(`span`,{className:`relative inline-flex`,children:[(0,b.jsx)(`button`,{disabled:o,onClick:f,title:n||u?`Force stops this local Claude process after confirmation`:`Gracefully stops the Claude job while preserving its conversation`,className:`rounded-lg border px-3 py-1.5 text-xs font-medium transition disabled:opacity-40 ${i||u?`border-rose-500/40 bg-rose-500/10 text-rose-300`:`border-white/10 text-white/40 hover:bg-white/5 hover:text-white/70`}`,children:o?`Stopping…`:i?`Confirm ${p.toLowerCase()}`:p}),c&&(0,b.jsxs)(`span`,{className:`absolute right-0 top-full z-20 mt-1 whitespace-nowrap rounded bg-[#18181d] px-2 py-1 text-[10px] text-rose-400 shadow-xl`,children:[c,u&&!n?` · Force stop is now available.`:``]})]})}var Re={queued:`Queued`,working:`In progress`,blocked:`Blocked`,reviewing:`Reviewing`,completed:`Complete`,failed:`Failed`,cancelled:`Cancelled`};function ze(e){return Re[e]??e}function Be(e){return e.flatMap(e=>[e,...Be(e.subtasks??[])])}function Ve(e){return e.flatMap(e=>e.subtasks?.length?Ve(e.subtasks):[e])}function He(e){return e?.phases.flatMap(e=>Be(e.tasks))??[]}var Ue=[`investigation`,`implementation`,`testing`,`review`,`browser_qa`,`documentation`,`custom`],We=[`test`,`typecheck`,`lint`,`ci`,`review`,`pr`,`screenshot`,`documentation`,`user_approval`,`custom`],Ge=[`commits`,`pushes`,`pullRequests`,`releases`,`destructiveActions`,`network`],Ke=e=>e.toLowerCase().trim().replace(/[^a-z0-9]+/g,`-`).replace(/^-|-$/g,``).slice(0,63);function qe(e){return{id:`new-template`,name:`New template`,description:`Describe when this workflow should be used.`,version:1,source:e,mode:`orchestrated`,worktree:!0,managerInstructions:`Delegate independent work, report evidence, and stop for approval before external or destructive actions.`,stages:[{id:`stage-1`,title:`Investigation`,role:`investigation`}],gates:[{id:`gate-review`,label:`Review complete`,type:`review`,status:`pending`,required:!0,evidence:[]}],budgets:{maxWorkers:8,maxConcurrentWorkers:4},permissions:{commits:!0,pushes:!1,pullRequests:!1,releases:!1,destructiveActions:!1,network:!0}}}function Je({initial:e,cwd:t,onCancel:n,onSaved:r}){let i=!!e,[a,o]=(0,g.useState)(()=>e?structuredClone(e):qe(`user`)),[s,c]=(0,g.useState)(!1),[l,u]=(0,g.useState)(null),d=(0,g.useMemo)(()=>{let e=[];return a.id.match(/^[a-z0-9][a-z0-9-]{1,62}$/)||e.push(`Use a 2–63 character lowercase template ID.`),(!a.name.trim()||!a.description.trim()||!a.managerInstructions.trim())&&e.push(`Name, description, and manager instructions are required.`),a.stages.length||e.push(`Add at least one mission stage.`),new Set(a.stages.map(e=>e.id)).size!==a.stages.length&&e.push(`Stage IDs must be unique.`),e},[a]),f=`w-full rounded-lg border border-white/10 bg-black/20 px-3 py-2 text-xs text-white/65 outline-none focus:border-amber-300/20`;async function p(){if(!(d.length||s)){c(!0),u(null);try{r((i?await P(a,t):await N(a,a.source,t)).template)}catch(e){u(e.message)}finally{c(!1)}}}return(0,b.jsxs)(`div`,{className:`min-w-0 flex-1 overflow-y-auto p-6`,children:[(0,b.jsxs)(`div`,{className:`flex items-start justify-between gap-4`,children:[(0,b.jsxs)(`div`,{children:[(0,b.jsx)(`p`,{className:`text-[10px] font-medium uppercase tracking-[0.16em] text-amber-300/55`,children:i?`Edit workflow`:`Create workflow`}),(0,b.jsx)(`h2`,{className:`mt-1 text-xl font-semibold text-white`,children:a.name||`Untitled template`})]}),(0,b.jsxs)(`div`,{className:`flex gap-2`,children:[(0,b.jsx)(`button`,{onClick:n,className:`rounded-lg px-3 py-2 text-xs text-white/40 hover:text-white/70`,children:`Cancel`}),(0,b.jsx)(`button`,{onClick:()=>void p(),disabled:s||d.length>0||a.source===`repository`&&!t,className:`rounded-lg bg-amber-300 px-3 py-2 text-xs font-semibold text-[#291a04] hover:bg-amber-200 disabled:opacity-35`,children:s?`Saving…`:i?`Save template`:`Create template`})]})]}),(l||d.length>0)&&(0,b.jsx)(`div`,{className:`mt-4 rounded-lg border border-rose-300/10 bg-rose-300/[0.035] px-3 py-2 text-xs text-rose-200/60`,children:l??d.join(` `)}),(0,b.jsxs)(`div`,{className:`mt-5 grid gap-3 sm:grid-cols-2`,children:[(0,b.jsxs)(`label`,{className:`text-[10px] text-white/35`,children:[`Name`,(0,b.jsx)(`input`,{className:f,value:a.name,onChange:e=>o({...a,name:e.target.value,...!i&&a.id===`new-template`?{id:Ke(e.target.value)}:{}})})]}),(0,b.jsxs)(`label`,{className:`text-[10px] text-white/35`,children:[`Template ID`,(0,b.jsx)(`input`,{disabled:i,className:`${f} font-mono disabled:opacity-40`,value:a.id,onChange:e=>o({...a,id:Ke(e.target.value)})})]}),(0,b.jsxs)(`label`,{className:`text-[10px] text-white/35`,children:[`Version`,(0,b.jsx)(`input`,{type:`number`,min:`1`,className:f,value:a.version,onChange:e=>o({...a,version:Math.max(1,Number(e.target.value))})})]}),(0,b.jsxs)(`label`,{className:`text-[10px] text-white/35`,children:[`Ownership`,(0,b.jsxs)(`select`,{disabled:i,className:`${f} disabled:opacity-40`,value:a.source,onChange:e=>o({...a,source:e.target.value}),children:[(0,b.jsx)(`option`,{value:`user`,children:`My templates`}),(0,b.jsx)(`option`,{value:`repository`,children:`This repository`})]})]})]}),a.source===`repository`&&(0,b.jsxs)(`p`,{className:`mt-2 text-[10px] text-violet-200/40`,children:[`Repository scope: `,t||`Select a repository in the library first.`]}),(0,b.jsxs)(`label`,{className:`mt-4 block text-[10px] text-white/35`,children:[`Purpose`,(0,b.jsx)(`textarea`,{rows:2,className:f,value:a.description,onChange:e=>o({...a,description:e.target.value})})]}),(0,b.jsxs)(`label`,{className:`mt-3 block text-[10px] text-white/35`,children:[`Manager instructions`,(0,b.jsx)(`textarea`,{rows:4,className:f,value:a.managerInstructions,onChange:e=>o({...a,managerInstructions:e.target.value})})]}),(0,b.jsxs)(`div`,{className:`mt-4 grid gap-3 sm:grid-cols-3`,children:[(0,b.jsxs)(`label`,{className:`text-[10px] text-white/35`,children:[`Execution mode`,(0,b.jsxs)(`select`,{className:f,value:a.mode,onChange:e=>o({...a,mode:e.target.value}),children:[(0,b.jsx)(`option`,{value:`orchestrated`,children:`Orchestrated`}),(0,b.jsx)(`option`,{value:`direct`,children:`Direct`})]})]}),(0,b.jsxs)(`label`,{className:`flex items-end gap-2 pb-2 text-xs text-white/50`,children:[(0,b.jsx)(`input`,{type:`checkbox`,checked:a.worktree,onChange:e=>o({...a,worktree:e.target.checked})}),`Create a worktree`]})]}),(0,b.jsxs)(`section`,{className:`mt-5 rounded-xl border border-white/8 bg-white/[0.018] p-4`,children:[(0,b.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,b.jsxs)(`div`,{children:[(0,b.jsx)(`h3`,{className:`text-xs font-semibold text-white/60`,children:`Mission stages`}),(0,b.jsx)(`p`,{className:`mt-0.5 text-[10px] text-white/25`,children:`Stages become the initial phased plan; dependencies control which may start in parallel.`})]}),(0,b.jsx)(`button`,{onClick:()=>o({...a,stages:[...a.stages,{id:`stage-${a.stages.length+1}`,title:`New stage`,role:`implementation`,dependsOn:a.stages.length?[a.stages.at(-1).id]:[]}]}),className:`rounded-lg border border-white/10 px-2.5 py-1.5 text-[10px] text-white/40 hover:bg-white/5`,children:`+ Stage`})]}),(0,b.jsx)(`div`,{className:`mt-3 space-y-2`,children:a.stages.map((e,t)=>(0,b.jsxs)(`div`,{className:`grid grid-cols-[1fr_1fr_1fr_34px] gap-2`,children:[(0,b.jsx)(`input`,{"aria-label":`Stage title`,className:f,value:e.title,onChange:n=>{let r=[...a.stages],s=e.id,c=i?e.id:Ke(n.target.value)||`stage-${t+1}`;if(r[t]={...e,title:n.target.value,id:c},c!==s)for(let e=0;e<r.length;e++)r[e]={...r[e],dependsOn:r[e].dependsOn?.map(e=>e===s?c:e)};o({...a,stages:r})}}),(0,b.jsx)(`select`,{"aria-label":`Worker role`,className:f,value:e.role,onChange:n=>{let r=[...a.stages];r[t]={...e,role:n.target.value},o({...a,stages:r})},children:Ue.map(e=>(0,b.jsx)(`option`,{value:e,children:e.replaceAll(`_`,` `)},e))}),(0,b.jsxs)(`select`,{"aria-label":`Stage dependency`,className:f,value:e.dependsOn?.[0]??``,onChange:n=>{let r=[...a.stages];r[t]={...e,dependsOn:n.target.value?[n.target.value]:[]},o({...a,stages:r})},children:[(0,b.jsx)(`option`,{value:``,children:`No dependency`}),a.stages.filter(t=>t.id!==e.id).map(e=>(0,b.jsxs)(`option`,{value:e.id,children:[`After `,e.title]},e.id))]}),(0,b.jsx)(`button`,{"aria-label":`Remove stage`,onClick:()=>{let n=e.id;o({...a,stages:a.stages.filter((e,n)=>n!==t).map(e=>({...e,dependsOn:e.dependsOn?.filter(e=>e!==n)}))})},className:`rounded-lg border border-white/8 text-white/25 hover:bg-rose-300/[0.05] hover:text-rose-200`,children:`×`})]},t))})]}),(0,b.jsxs)(`section`,{className:`mt-4 rounded-xl border border-white/8 bg-white/[0.018] p-4`,children:[(0,b.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,b.jsxs)(`div`,{children:[(0,b.jsx)(`h3`,{className:`text-xs font-semibold text-white/60`,children:`Completion gates`}),(0,b.jsx)(`p`,{className:`mt-0.5 text-[10px] text-white/25`,children:`Required evidence before the mission can appear complete.`})]}),(0,b.jsx)(`button`,{onClick:()=>o({...a,gates:[...a.gates,{id:`gate-${a.gates.length+1}`,label:`New gate`,type:`custom`,status:`pending`,required:!0,evidence:[]}]}),className:`rounded-lg border border-white/10 px-2.5 py-1.5 text-[10px] text-white/40 hover:bg-white/5`,children:`+ Gate`})]}),(0,b.jsx)(`div`,{className:`mt-3 space-y-2`,children:a.gates.map((e,t)=>(0,b.jsxs)(`div`,{className:`grid grid-cols-[1fr_1fr_auto_34px] gap-2`,children:[(0,b.jsx)(`input`,{"aria-label":`Gate label`,className:f,value:e.label,onChange:n=>{let r=[...a.gates];r[t]={...e,label:n.target.value,id:i?e.id:`gate-${Ke(n.target.value)||t+1}`},o({...a,gates:r})}}),(0,b.jsx)(`select`,{"aria-label":`Gate type`,className:f,value:e.type,onChange:n=>{let r=[...a.gates];r[t]={...e,type:n.target.value},o({...a,gates:r})},children:We.map(e=>(0,b.jsx)(`option`,{value:e,children:e.replaceAll(`_`,` `)},e))}),(0,b.jsxs)(`label`,{className:`flex items-center gap-1 text-[10px] text-white/35`,children:[(0,b.jsx)(`input`,{type:`checkbox`,checked:e.required,onChange:n=>{let r=[...a.gates];r[t]={...e,required:n.target.checked},o({...a,gates:r})}}),`Required`]}),(0,b.jsx)(`button`,{"aria-label":`Remove gate`,onClick:()=>o({...a,gates:a.gates.filter((e,n)=>n!==t)}),className:`rounded-lg border border-white/8 text-white/25 hover:bg-rose-300/[0.05] hover:text-rose-200`,children:`×`})]},t))})]}),(0,b.jsxs)(`div`,{className:`mt-4 grid gap-4 lg:grid-cols-2`,children:[(0,b.jsxs)(`section`,{className:`rounded-xl border border-white/8 bg-white/[0.018] p-4`,children:[(0,b.jsx)(`h3`,{className:`text-xs font-semibold text-white/60`,children:`Budgets`}),(0,b.jsx)(`div`,{className:`mt-3 grid grid-cols-2 gap-2`,children:[`maxWorkers`,`maxConcurrentWorkers`,`maxTokens`,`maxElapsedMinutes`].map(e=>(0,b.jsxs)(`label`,{className:`text-[9px] text-white/30`,children:[e.replace(/([A-Z])/g,` $1`),(0,b.jsx)(`input`,{type:`number`,min:`1`,className:f,value:a.budgets?.[e]??``,onChange:t=>o({...a,budgets:{...a.budgets,[e]:t.target.value?Number(t.target.value):void 0}})})]},e))})]}),(0,b.jsxs)(`section`,{className:`rounded-xl border border-white/8 bg-white/[0.018] p-4`,children:[(0,b.jsx)(`h3`,{className:`text-xs font-semibold text-white/60`,children:`Permissions`}),(0,b.jsx)(`div`,{className:`mt-3 grid grid-cols-2 gap-2`,children:Ge.map(e=>(0,b.jsxs)(`label`,{className:`flex items-center gap-2 rounded-lg border border-white/[0.06] px-2 py-2 text-[10px] text-white/40`,children:[(0,b.jsx)(`input`,{type:`checkbox`,checked:a.permissions[e],onChange:t=>o({...a,permissions:{...a.permissions,[e]:t.target.checked}})}),`Allow `,e.replace(/([A-Z])/g,` $1`)]},e))})]})]}),(0,b.jsxs)(`section`,{className:`mt-4 rounded-xl border border-violet-300/10 bg-violet-300/[0.025] p-4`,children:[(0,b.jsx)(`h3`,{className:`text-[10px] font-semibold uppercase tracking-wider text-violet-200/45`,children:`Live mission preview`}),(0,b.jsx)(`p`,{className:`mt-2 text-xs leading-relaxed text-white/50`,children:a.managerInstructions||`Manager instructions will appear here.`}),(0,b.jsx)(`div`,{className:`mt-3 flex flex-wrap items-center gap-2`,children:a.stages.map((e,t)=>(0,b.jsxs)(`span`,{className:`text-[10px] text-white/40`,children:[(0,b.jsxs)(`span`,{className:`rounded bg-white/[0.05] px-2 py-1`,children:[e.title||`Untitled stage`,e.dependsOn?.length?` · after ${e.dependsOn.join(`, `)}`:` · parallel-ready`]}),t<a.stages.length-1&&(0,b.jsx)(`span`,{className:`ml-2 text-white/15`,children:`→`})]},`${e.id}:${t}`))}),(0,b.jsxs)(`p`,{className:`mt-3 text-[10px] text-white/25`,children:[`Completion requires: `,a.gates.filter(e=>e.required).map(e=>e.label).join(`, `)||`no required gates`,`.`]})]})]})}function Ye(e){return e.replaceAll(`_`,` `).replace(/^./,e=>e.toUpperCase())}function Xe({template:e,repository:t,onDuplicate:n,onEdit:r,onDelete:i}){return(0,b.jsxs)(`div`,{className:`min-w-0 flex-1 overflow-y-auto p-6`,children:[(0,b.jsxs)(`div`,{className:`flex flex-wrap items-start justify-between gap-3`,children:[(0,b.jsxs)(`div`,{children:[(0,b.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,b.jsx)(`h2`,{className:`text-xl font-semibold text-white`,children:e.name}),(0,b.jsx)(`span`,{className:`rounded-full border border-white/10 px-2 py-0.5 text-[9px] uppercase text-white/35`,children:e.source}),(0,b.jsxs)(`span`,{className:`text-[10px] text-white/25`,children:[`v`,e.version]})]}),(0,b.jsx)(`p`,{className:`mt-2 max-w-2xl text-sm leading-relaxed text-white/50`,children:e.description}),(0,b.jsxs)(`p`,{className:`mt-2 text-[10px] text-white/25`,children:[e.source===`built-in`?`Built into Hive · read-only`:e.source===`user`?`Owned by you · available across repositories`:`Owned by repository · ${t??`current repository`}`,`. Repository templates override personal templates with the same ID; personal templates override built-ins. Existing missions retain their original version.`]})]}),(0,b.jsxs)(`div`,{className:`flex gap-2`,children:[e.source!==`built-in`&&(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(`button`,{onClick:r,className:`rounded-lg border border-white/10 px-3 py-2 text-xs text-white/45 transition hover:bg-white/5 hover:text-white/70`,children:`Edit`}),(0,b.jsx)(`button`,{onClick:i,className:`rounded-lg border border-rose-300/10 px-3 py-2 text-xs text-rose-200/40 transition hover:bg-rose-300/[0.05] hover:text-rose-200/65`,children:`Delete`})]}),(0,b.jsx)(`button`,{onClick:n,className:`rounded-lg border border-amber-300/15 bg-amber-300/[0.05] px-3 py-2 text-xs text-amber-200/65 transition hover:border-amber-300/30 hover:bg-amber-300/[0.09]`,children:`Duplicate template`})]})]}),(0,b.jsxs)(`div`,{className:`mt-6 grid gap-4 lg:grid-cols-2`,children:[(0,b.jsxs)(`section`,{className:`rounded-xl border border-white/8 bg-white/[0.02] p-4`,children:[(0,b.jsx)(`h3`,{className:`text-[10px] font-semibold uppercase tracking-wider text-white/30`,children:`Manager instructions`}),(0,b.jsx)(`p`,{className:`mt-3 whitespace-pre-wrap text-xs leading-relaxed text-white/55`,children:e.managerInstructions})]}),(0,b.jsxs)(`section`,{className:`rounded-xl border border-white/8 bg-white/[0.02] p-4`,children:[(0,b.jsx)(`h3`,{className:`text-[10px] font-semibold uppercase tracking-wider text-white/30`,children:`Launch configuration`}),(0,b.jsxs)(`dl`,{className:`mt-3 grid grid-cols-[110px_1fr] gap-y-2 text-xs`,children:[(0,b.jsx)(`dt`,{className:`text-white/25`,children:`Mode`}),(0,b.jsx)(`dd`,{className:`capitalize text-white/55`,children:e.mode}),(0,b.jsx)(`dt`,{className:`text-white/25`,children:`Worktree`}),(0,b.jsx)(`dd`,{className:`text-white/55`,children:e.worktree?`Create isolated worktree`:`Use working directory`}),(0,b.jsx)(`dt`,{className:`text-white/25`,children:`Source`}),(0,b.jsx)(`dd`,{className:`capitalize text-white/55`,children:e.source}),(0,b.jsx)(`dt`,{className:`text-white/25`,children:`Template ID`}),(0,b.jsx)(`dd`,{className:`font-mono text-white/45`,children:e.id})]})]})]}),(0,b.jsxs)(`section`,{className:`mt-4 rounded-xl border border-white/8 bg-white/[0.02] p-4`,children:[(0,b.jsx)(`h3`,{className:`text-[10px] font-semibold uppercase tracking-wider text-white/30`,children:`Mission stages`}),(0,b.jsx)(`div`,{className:`mt-3 flex flex-wrap items-center gap-2`,children:e.stages.map((t,n)=>(0,b.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,b.jsxs)(`div`,{className:`rounded-lg border border-violet-300/10 bg-violet-300/[0.035] px-3 py-2`,children:[(0,b.jsx)(`p`,{className:`text-xs font-medium text-white/65`,children:t.title}),(0,b.jsx)(`p`,{className:`mt-0.5 text-[9px] uppercase text-violet-300/45`,children:Ye(t.role)})]}),n<e.stages.length-1&&(0,b.jsx)(`span`,{className:`text-white/15`,children:`→`})]},t.id))})]}),(0,b.jsxs)(`div`,{className:`mt-4 grid gap-4 lg:grid-cols-2`,children:[(0,b.jsxs)(`section`,{className:`rounded-xl border border-white/8 bg-white/[0.02] p-4`,children:[(0,b.jsx)(`h3`,{className:`text-[10px] font-semibold uppercase tracking-wider text-white/30`,children:`Completion gates`}),(0,b.jsx)(`div`,{className:`mt-3 space-y-2`,children:e.gates.length?e.gates.map(e=>(0,b.jsxs)(`div`,{className:`flex items-center justify-between rounded-lg border border-white/[0.06] px-3 py-2`,children:[(0,b.jsx)(`span`,{className:`text-xs text-white/55`,children:e.label}),(0,b.jsxs)(`span`,{className:`text-[9px] uppercase text-white/25`,children:[Ye(e.type),e.required?` · required`:``]})]},e.id)):(0,b.jsx)(`p`,{className:`text-xs text-white/25`,children:`No completion gates.`})})]}),(0,b.jsxs)(`section`,{className:`rounded-xl border border-white/8 bg-white/[0.02] p-4`,children:[(0,b.jsx)(`h3`,{className:`text-[10px] font-semibold uppercase tracking-wider text-white/30`,children:`Budgets and permissions`}),(0,b.jsx)(`div`,{className:`mt-3 flex flex-wrap gap-1.5`,children:Object.entries(e.budgets??{}).map(([e,t])=>(0,b.jsxs)(`span`,{className:`rounded bg-white/[0.04] px-2 py-1 text-[10px] text-white/40`,children:[Ye(e),`: `,t?.toLocaleString()]},e))}),(0,b.jsx)(`div`,{className:`mt-3 grid grid-cols-2 gap-2`,children:Object.entries(e.permissions).map(([e,t])=>(0,b.jsxs)(`div`,{className:`rounded-lg border px-2.5 py-2 text-[10px] ${t?`border-emerald-300/10 bg-emerald-300/[0.035] text-emerald-200/50`:`border-amber-300/10 bg-amber-300/[0.025] text-amber-200/45`}`,children:[t?`✓ Allowed`:`Approval required`,` · `,Ye(e)]},e))})]})]})]})}function Ze({repositories:e,onClose:t}){let n=je(t),[r,i]=(0,g.useState)(e[0]??``),[a,o]=(0,g.useState)([]),[s,c]=(0,g.useState)(``),[l,u]=(0,g.useState)(!0),[d,f]=(0,g.useState)(null),[p,m]=(0,g.useState)(!1),[h,_]=(0,g.useState)(``),[v,y]=(0,g.useState)(``),[x,S]=(0,g.useState)(`user`),[C,w]=(0,g.useState)(!1),[T,E]=(0,g.useState)(null),[D,O]=(0,g.useState)([]),k=(0,g.useMemo)(()=>a.find(e=>e.id===s)??a[0],[a,s]);async function A(){u(!0),f(null);try{let e=await ee(r||void 0);o(e.templates),O(e.diagnostics??[]),c(t=>e.templates.some(e=>e.id===t)?t:e.templates[0]?.id??``)}catch(e){f(e.message),O([])}finally{u(!1)}}(0,g.useEffect)(()=>{A()},[r]),(0,g.useEffect)(()=>{let e=e=>{e.key===`Escape`&&t()};return document.addEventListener(`keydown`,e),()=>document.removeEventListener(`keydown`,e)},[t]);function j(){k&&(_(`${k.name} copy`),y(`${k.id}-copy`),m(!0),f(null))}async function M(){if(!(!k||!h.trim()||!v.trim())){w(!0),f(null);try{let e={...k,id:v.trim().toLowerCase().replace(/[^a-z0-9-]+/g,`-`),name:h.trim(),version:1,source:x};await N(e,x,r||void 0),m(!1),await A(),c(e.id)}catch(e){f(e.message)}finally{w(!1)}}}async function P(){if(!(!k||k.source===`built-in`||!window.confirm(`Delete ${k.name}? Existing missions will keep their retained template configuration, but this template will no longer be available for new missions.`))){f(null);try{await te(k,r||void 0),c(``),await A()}catch(e){f(e.message)}}}return(0,b.jsx)(`div`,{className:`fixed inset-0 z-50 flex items-center justify-center bg-black/70 p-4`,...n,children:(0,b.jsxs)(`div`,{role:`dialog`,"aria-modal":`true`,"aria-label":`Template library`,onMouseDown:e=>e.stopPropagation(),className:`flex h-[min(820px,92vh)] w-full max-w-6xl flex-col overflow-hidden rounded-2xl border border-white/10 bg-[#0e0e12] shadow-2xl`,children:[(0,b.jsxs)(`header`,{className:`flex flex-wrap items-center justify-between gap-3 border-b border-white/8 px-5 py-4`,children:[(0,b.jsxs)(`div`,{children:[(0,b.jsx)(`p`,{className:`text-[10px] font-medium uppercase tracking-[0.18em] text-amber-300/55`,children:`Hive workflows`}),(0,b.jsx)(`h1`,{className:`mt-0.5 text-lg font-semibold text-white`,children:`Template library`})]}),(0,b.jsxs)(`div`,{className:`flex items-center gap-2`,children:[e.length>0&&(0,b.jsxs)(`select`,{value:r,onChange:e=>{i(e.target.value),E(null)},className:`max-w-64 rounded-lg border border-white/10 bg-[#17171c] px-3 py-2 text-xs text-white/50`,children:[(0,b.jsx)(`option`,{value:``,children:`Current Hive repository`}),e.map(e=>(0,b.jsxs)(`option`,{value:e,children:[e.split(`/`).at(-1),` · `,e]},e))]}),(0,b.jsx)(`button`,{onClick:()=>{E(`new`),m(!1)},className:`rounded-lg border border-amber-300/15 bg-amber-300/[0.05] px-3 py-2 text-xs text-amber-200/60 hover:bg-amber-300/[0.09]`,children:`+ New template`}),(0,b.jsx)(`button`,{onClick:t,"aria-label":`Close template library`,className:`rounded-lg border border-white/10 px-2.5 py-1.5 text-white/40 hover:bg-white/5 hover:text-white`,children:`×`})]})]}),d&&(0,b.jsxs)(`div`,{className:`border-b border-rose-300/10 bg-rose-300/[0.04] px-5 py-2.5 text-xs text-rose-200/65`,children:[d,` `,(0,b.jsx)(`button`,{onClick:()=>void A(),className:`ml-2 underline hover:text-white`,children:`Retry`})]}),D.length>0&&(0,b.jsxs)(`details`,{className:`border-b border-amber-300/10 bg-amber-300/[0.035] px-5 py-2.5 text-xs text-amber-100/55`,children:[(0,b.jsxs)(`summary`,{className:`cursor-pointer`,children:[D.length,` malformed template file`,D.length===1?` was`:`s were`,` skipped · View recovery details`]}),(0,b.jsx)(`div`,{className:`mt-2 space-y-1`,children:D.map(e=>(0,b.jsxs)(`p`,{children:[(0,b.jsx)(`span`,{className:`font-mono text-amber-200/45`,children:e.file}),` — `,e.error,`. Fix or remove this JSON file, then reload.`]},e.file))})]}),(0,b.jsxs)(`div`,{className:`flex min-h-0 flex-1`,children:[(0,b.jsx)(`aside`,{className:`w-64 shrink-0 overflow-y-auto border-r border-white/8 p-3`,children:l?(0,b.jsx)(`p`,{className:`p-3 text-xs text-white/25`,children:`Loading templates…`}):a.length?a.map(e=>(0,b.jsxs)(`button`,{onClick:()=>{c(e.id),m(!1),E(null)},className:`mb-1 w-full rounded-lg border px-3 py-2.5 text-left transition ${k?.id===e.id&&!T?`border-amber-300/15 bg-amber-300/[0.06]`:`border-transparent hover:border-white/8 hover:bg-white/[0.03]`}`,children:[(0,b.jsx)(`p`,{className:`truncate text-xs font-medium text-white/65`,children:e.name}),(0,b.jsxs)(`p`,{className:`mt-1 text-[9px] uppercase tracking-wide text-white/25`,children:[e.source,` · v`,e.version]})]},`${e.source}:${e.id}`)):(0,b.jsx)(`p`,{className:`rounded-lg border border-dashed border-white/8 p-4 text-center text-xs text-white/25`,children:`No templates found for this repository.`})}),T?(0,b.jsx)(Je,{initial:T===`edit`?k:void 0,cwd:r||void 0,onCancel:()=>E(null),onSaved:e=>{E(null),A().then(()=>c(e.id))}}):k?(0,b.jsx)(Xe,{template:k,repository:r||void 0,onDuplicate:j,onEdit:()=>E(`edit`),onDelete:()=>void P()}):!l&&(0,b.jsx)(`div`,{className:`flex flex-1 items-center justify-center text-sm text-white/25`,children:`Choose a repository or create its first template.`})]}),p&&k&&(0,b.jsxs)(`div`,{className:`border-t border-white/8 bg-[#121217] p-4`,children:[(0,b.jsxs)(`div`,{className:`flex flex-wrap items-end gap-3`,children:[(0,b.jsxs)(`label`,{className:`min-w-48 flex-1 text-[10px] text-white/35`,children:[`Template name`,(0,b.jsx)(`input`,{value:h,onChange:e=>_(e.target.value),className:`mt-1 w-full rounded-lg border border-white/10 bg-black/20 px-3 py-2 text-xs text-white/65 outline-none focus:border-amber-300/20`})]}),(0,b.jsxs)(`label`,{className:`min-w-40 flex-1 text-[10px] text-white/35`,children:[`Template ID`,(0,b.jsx)(`input`,{value:v,onChange:e=>y(e.target.value),className:`mt-1 w-full rounded-lg border border-white/10 bg-black/20 px-3 py-2 font-mono text-xs text-white/65 outline-none focus:border-amber-300/20`})]}),(0,b.jsxs)(`label`,{className:`text-[10px] text-white/35`,children:[`Save to`,(0,b.jsxs)(`select`,{value:x,onChange:e=>S(e.target.value),className:`mt-1 block rounded-lg border border-white/10 bg-[#17171c] px-3 py-2 text-xs text-white/55`,children:[(0,b.jsx)(`option`,{value:`user`,children:`My templates`}),(0,b.jsx)(`option`,{value:`repository`,children:`This repository`})]})]}),(0,b.jsx)(`button`,{onClick:()=>m(!1),className:`rounded-lg px-3 py-2 text-xs text-white/35 hover:text-white/65`,children:`Cancel`}),(0,b.jsx)(`button`,{onClick:()=>void M(),disabled:C||!h.trim()||!v.trim()||x===`repository`&&!r,className:`rounded-lg bg-amber-300 px-3 py-2 text-xs font-semibold text-[#2a1a04] hover:bg-amber-200 disabled:opacity-35`,children:C?`Saving…`:`Create copy`})]}),x===`repository`&&!r&&(0,b.jsx)(`p`,{className:`mt-2 text-[10px] text-amber-200/45`,children:`Select a repository before saving a repository template.`})]})]})})}function Qe({value:e,onChange:t}){return(0,b.jsxs)(`div`,{className:`space-y-3`,children:[(0,b.jsx)(`div`,{className:`grid grid-cols-2 gap-2`,children:[[`networkAccess`,`Network access`],[`commits`,`Git commits`],[`pushes`,`Git pushes`],[`pullRequests`,`Pull requests`],[`releases`,`Releases / publishing`],[`destructiveActions`,`Destructive commands`]].map(([n,r])=>(0,b.jsxs)(`label`,{className:`flex items-center gap-2 rounded-lg border border-white/[0.07] px-3 py-2 text-xs text-white/45`,children:[(0,b.jsx)(`input`,{type:`checkbox`,checked:!!e[n],onChange:r=>t({...e,[n]:r.target.checked})}),r]},n))}),(0,b.jsxs)(`label`,{className:`block text-[10px] text-white/35`,children:[`Allowed repository roots `,(0,b.jsx)(`span`,{className:`text-white/20`,children:`(one per line; blank allows any directory)`}),(0,b.jsx)(`textarea`,{rows:2,value:e.allowedRoots.join(`
9
+ `),onChange:n=>t({...e,allowedRoots:n.target.value.split(`
10
+ `).map(e=>e.trim()).filter(Boolean)}),className:`mt-1 w-full rounded-lg border border-white/10 bg-black/20 p-2 font-mono text-xs text-white/60 outline-none`})]}),(0,b.jsxs)(`label`,{className:`block text-[10px] text-white/35`,children:[`Allowed Claude tools `,(0,b.jsx)(`span`,{className:`text-white/20`,children:`(comma separated; blank uses normal CLI availability)`}),(0,b.jsx)(`input`,{value:e.allowedTools.join(`, `),onChange:n=>t({...e,allowedTools:n.target.value.split(`,`).map(e=>e.trim()).filter(Boolean)}),className:`mt-1 w-full rounded-lg border border-white/10 bg-black/20 p-2 font-mono text-xs text-white/60 outline-none`})]})]})}function $e({onClose:e}){let t=je(e),[n,r]=(0,g.useState)(),[i,a]=(0,g.useState)(),[o,s]=(0,g.useState)(!1);(0,g.useEffect)(()=>{ye().then(({policy:e})=>r(e)).catch(e=>a(e.message))},[]),(0,g.useEffect)(()=>{let t=t=>{t.key===`Escape`&&e()};return document.addEventListener(`keydown`,t),()=>document.removeEventListener(`keydown`,t)},[e]);async function c(){if(n){s(!0);try{await be(n),e()}catch(e){a(e.message)}finally{s(!1)}}}return(0,b.jsx)(`div`,{className:`fixed inset-0 z-50 flex items-center justify-center bg-black/65 p-4`,...t,children:(0,b.jsxs)(`div`,{className:`w-full max-w-xl rounded-2xl border border-white/10 bg-[#101014] p-5`,onClick:e=>e.stopPropagation(),children:[(0,b.jsxs)(`div`,{className:`mb-4 flex items-center justify-between`,children:[(0,b.jsxs)(`div`,{children:[(0,b.jsx)(`h2`,{className:`text-sm font-semibold text-white`,children:`Workspace policy`}),(0,b.jsx)(`p`,{className:`mt-1 text-[10px] text-white/30`,children:`Defaults copied into every new mission. Mission overrides remain durable.`})]}),(0,b.jsx)(`button`,{onClick:e,className:`px-2 text-white/40`,children:`×`})]}),n&&(0,b.jsx)(Qe,{value:n,onChange:r}),i&&(0,b.jsx)(`p`,{className:`mt-3 text-xs text-rose-300`,children:i}),(0,b.jsx)(`p`,{className:`mt-3 text-[10px] text-amber-100/35`,children:`Disabled tools and actions are passed to Claude CLI as hard restrictions where supported. The manager requests your approval before a policy boundary is expanded.`}),(0,b.jsxs)(`div`,{className:`mt-4 flex justify-end gap-2`,children:[(0,b.jsx)(`button`,{onClick:e,className:`px-3 py-2 text-xs text-white/40`,children:`Cancel`}),(0,b.jsx)(`button`,{disabled:!n||o,onClick:()=>void c(),className:`rounded-lg bg-amber-300 px-3 py-2 text-xs font-semibold text-black disabled:opacity-40`,children:o?`Saving…`:`Save defaults`})]})]})})}function et({title:e,description:t,missions:n,onSelect:r,collapsedByDefault:i=!1}){let[a,o]=(0,g.useState)(i);return n.length?(0,b.jsxs)(`section`,{className:`mb-8`,children:[(0,b.jsxs)(`button`,{type:`button`,onClick:()=>o(!a),className:`mb-3 flex w-full items-center justify-between text-left`,children:[(0,b.jsxs)(`div`,{children:[(0,b.jsxs)(`h2`,{className:`text-sm font-medium uppercase tracking-wide text-white/40`,children:[e,` `,(0,b.jsx)(`span`,{className:`ml-1 text-white/20`,children:n.length})]}),t&&(0,b.jsx)(`p`,{className:`mt-1 text-xs text-white/25`,children:t})]}),(0,b.jsx)(`span`,{className:`rounded-md border border-white/8 px-2 py-1 text-xs text-white/30`,children:a?`+`:`−`})]}),!a&&(0,b.jsx)(`div`,{className:`grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-3`,children:n.map(e=>(0,b.jsx)(ke,{node:e,onSelect:()=>r(e.missionId)},e.missionId))})]}):null}function tt({session:e,onHide:t}){let[n,r]=(0,g.useState)(!1),[i,a]=(0,g.useState)(null);async function o(){r(!0),a(null);try{await we(e.sessionId,e.name)}catch(e){a(e.message)}finally{r(!1)}}return(0,b.jsxs)(`div`,{className:`rounded-lg border border-white/10 bg-white/[0.02] px-4 py-3`,children:[(0,b.jsxs)(`div`,{className:`flex items-center justify-between gap-4`,children:[(0,b.jsxs)(`div`,{className:`min-w-0`,children:[(0,b.jsx)(Te,{missionId:`session:${e.sessionId}`,name:e.name}),(0,b.jsx)(`p`,{className:`mono truncate text-xs text-white/30`,children:e.cwd})]}),(0,b.jsxs)(`div`,{className:`flex shrink-0 items-center gap-2`,children:[(0,b.jsx)(S,{status:e.status}),e.jobId&&(0,b.jsx)(`button`,{disabled:n,onClick:o,className:`rounded-lg border border-violet-300/15 px-3 py-1.5 text-xs text-violet-200/60 hover:bg-violet-300/[0.06] disabled:opacity-40`,children:n?`Adopting…`:`Adopt`}),(0,b.jsx)(`button`,{onClick:t,className:`rounded-lg border border-white/8 px-3 py-1.5 text-xs text-white/35 hover:bg-white/5`,children:`Hide`}),(0,b.jsx)(Le,{pid:e.pid,status:e.status,force:!e.jobId,label:`End`})]})]}),i&&(0,b.jsx)(`p`,{className:`mt-2 text-[10px] text-rose-400`,children:i}),!e.jobId&&(0,b.jsx)(`p`,{className:`mt-2 text-[10px] text-white/20`,children:`Interactive process · no background-job identity to adopt safely`})]})}function nt({onStarted:e}){let[t,n]=(0,g.useState)(``),[r,i]=(0,g.useState)(!1),[a,o]=(0,g.useState)(null),[s,c]=(0,g.useState)([]),l=typeof window>`u`?null:localStorage.getItem(`hive:last-cwd`);(0,g.useEffect)(()=>{M(l??void 0).then(({skills:e})=>c(e)).catch(()=>c([]))},[l]);async function u(){let a=t.trim();if(!(!a||r)){i(!0),o(null);try{let t=await j({task:a,mode:`direct`,worktree:!1,cwd:l??void 0});n(``),e(t.missionId)}catch(e){o(e.message)}finally{i(!1)}}}return(0,b.jsxs)(`div`,{className:`mb-4 rounded-xl border border-violet-300/15 bg-violet-300/[0.03] p-3`,children:[(0,b.jsxs)(`div`,{className:`flex items-end gap-2`,children:[(0,b.jsx)(`div`,{className:`min-w-0 flex-1 rounded-lg border border-white/10 bg-black/20 p-1 focus-within:border-violet-300/35`,children:(0,b.jsx)(Ae,{value:t,onChange:n,skills:s,onSubmit:u,rows:1,suggestionsPlacement:`below`,placeholder:`Ask anything — Enter starts a direct mission, / for skills…`,className:`min-h-9`})}),(0,b.jsx)(`button`,{onClick:()=>void u(),disabled:r||!t.trim(),className:`shrink-0 rounded-lg bg-violet-500 px-4 py-2 text-sm font-semibold text-white transition hover:bg-violet-400 disabled:opacity-35`,children:r?`Starting…`:`Ask`})]}),(0,b.jsxs)(`p`,{className:`mt-1.5 px-1 text-[10px] text-white/25`,children:[`Runs directly in `,(0,b.jsx)(`span`,{className:`font-mono text-white/40`,children:l?l.split(`/`).at(-1):`the Hive repository`}),` · no worktree · use + New mission for orchestration, templates, or another repo`]}),a&&(0,b.jsx)(`p`,{className:`mt-1 px-1 text-xs text-rose-400`,children:a})]})}function rt({snapshot:e,onSelectOrchestrator:t,notifications:n,sounds:r}){let[i,a]=(0,g.useState)(!1),[o,s]=(0,g.useState)(!1),[c,l]=(0,g.useState)(!1),[u,d]=(0,g.useState)(!1),[f,p]=(0,g.useState)(``),[m,h]=(0,g.useState)(`all`),[_,v]=(0,g.useState)(`all`),[y,x]=(0,g.useState)(`all`),[S,C]=(0,g.useState)(`all`),[w,T]=(0,g.useState)(()=>{try{return new Set(JSON.parse(localStorage.getItem(`hive:hidden-sessions`)??`[]`))}catch{return new Set}}),E=e=>T(t=>{let n=new Set(t).add(e);return localStorage.setItem(`hive:hidden-sessions`,JSON.stringify([...n])),n}),D=e.other.filter(e=>!w.has(e.sessionId)),O=[...new Set(e.orchestrators.map(e=>e.mission.repository).filter(e=>!!e))].sort(),k=[...new Map(e.orchestrators.flatMap(e=>e.mission.template?[[e.mission.template.id,e.mission.template.name]]:[])).entries()],A=t=>{let n=He(t.plan),r=e.decisions.filter(e=>e.missionId===t.missionId);return[t.name,t.mission.provider,t.mission.model,t.mission.objective,t.mission.compactSummary,t.mission.currentState,t.mission.repository,t.mission.template?.name,...t.messages.map(e=>e.text),...t.workers.flatMap(e=>[e.id,e.label]),...n.flatMap(e=>[e.title,e.description,e.assignment,e.context,e.owner,e.workerId,e.branch,e.worktree,...e.changedFiles??[],...e.evidence]),...t.recentEvents.flatMap(e=>[e.detail,e.filePath,e.command,e.artifactPath,e.targetWorker,e.targetTask]),...t.alerts.flatMap(e=>[e.title,e.explanation,e.evidence]),...t.prs.flatMap(e=>[e.id,e.href,e.kind]),...r.flatMap(e=>[e.question,e.context,e.answer,e.recommendation])].filter(Boolean).join(` `).toLowerCase()},j=S===`24h`?Date.now()-864e5:S===`7d`?Date.now()-6048e5:S===`30d`?Date.now()-2592e6:0,M=e.orchestrators.filter(e=>(!f.trim()||f.toLowerCase().split(/\s+/).every(t=>A(e).includes(t)))&&(m===`all`||e.lifecycleStatus===m||e.activityStatus===m)&&(_===`all`||e.mission.repository===_)&&(y===`all`||e.mission.template?.id===y)&&(!j||e.updatedAt>=j)),ee={waiting_on_you:0,error:1,working:2,stalled:3,idle:4,offline:5,done:6},N=M.filter(e=>e.lifecycleStatus===`active`||e.lifecycleStatus===`failed`).sort((e,t)=>ee[e.activityStatus]-ee[t.activityStatus]||t.updatedAt-e.updatedAt),P=M.filter(e=>e.lifecycleStatus===`ready_for_review`),te=M.filter(e=>e.lifecycleStatus===`paused`),ne=M.filter(e=>e.lifecycleStatus===`completed`),re=M.filter(e=>e.lifecycleStatus===`archived`);return(0,b.jsxs)(`div`,{className:`mx-auto max-w-6xl px-6 py-10`,children:[(0,b.jsxs)(`header`,{className:`mb-8 flex items-center justify-between`,children:[(0,b.jsx)(Fe,{subtitle:`${N.length+P.length} operational · ${e.orchestrators.length} total missions`}),(0,b.jsxs)(`div`,{className:`flex items-center gap-2`,children:[r&&(0,b.jsx)(`button`,{onClick:r.toggle,title:`Sound alerts: one chime when a mission needs your input, another when work awaits your acceptance`,"aria-label":r.enabled?`Disable sound alerts`:`Enable sound alerts`,className:`rounded-lg border px-3 py-2 text-xs ${r.enabled?`border-amber-300/20 bg-amber-300/[0.07] text-amber-200/65`:`border-white/10 text-white/35 hover:text-white/60`}`,children:r.enabled?`🔊`:`🔇`}),n.supported&&(0,b.jsx)(`button`,{onClick:()=>void n.toggle(),title:`Desktop notifications for new decisions`,className:`rounded-lg border px-3 py-2 text-xs ${n.enabled?`border-amber-300/20 bg-amber-300/[0.07] text-amber-200/65`:`border-white/10 text-white/35 hover:text-white/60`}`,children:n.enabled?`Notifications on`:`Notifications off`}),(0,b.jsx)(`button`,{onClick:()=>l(!0),className:`rounded-lg border border-white/10 px-3 py-2 text-xs text-white/45 transition hover:border-amber-300/15 hover:bg-amber-300/[0.04] hover:text-amber-100/70`,children:`Policies`}),(0,b.jsx)(`button`,{onClick:()=>s(!0),className:`rounded-lg border border-white/10 px-3 py-2 text-xs text-white/45 transition hover:border-amber-300/15 hover:bg-amber-300/[0.04] hover:text-amber-100/70`,children:`Templates`}),(0,b.jsx)(`button`,{onClick:()=>a(!0),className:`rounded-lg border border-amber-200/20 bg-gradient-to-b from-amber-200 to-amber-400 px-3.5 py-2 text-sm font-semibold text-[#241704] shadow-lg shadow-amber-950/15 transition hover:-translate-y-px hover:from-amber-100 hover:to-amber-300`,children:`+ New mission`})]})]}),i&&(0,b.jsx)(Ne,{onClose:()=>a(!1)}),o&&(0,b.jsx)(Ze,{repositories:O,onClose:()=>s(!1)}),c&&(0,b.jsx)($e,{onClose:()=>l(!1)}),(0,b.jsx)(nt,{onStarted:t}),(0,b.jsxs)(`div`,{className:`mb-6 rounded-xl border border-white/[0.07] bg-white/[0.018] p-3`,children:[(0,b.jsxs)(`div`,{className:`flex flex-col gap-2 sm:flex-row sm:flex-wrap`,children:[(0,b.jsx)(`input`,{value:f,onChange:e=>p(e.target.value),placeholder:`Search missions, messages, workers, files, errors, PRs…`,className:`min-w-0 flex-1 rounded-lg border border-white/10 bg-black/15 px-3 py-2 text-xs text-white/70 outline-none placeholder:text-white/20 focus:border-amber-300/25`}),(0,b.jsxs)(`select`,{value:m,onChange:e=>h(e.target.value),className:`rounded-lg border border-white/10 bg-[#141418] px-2.5 py-2 text-xs text-white/45`,children:[(0,b.jsx)(`option`,{value:`all`,children:`All statuses`}),[`active`,`waiting_on_you`,`working`,`stalled`,`failed`,`ready_for_review`,`paused`,`completed`,`archived`].map(e=>(0,b.jsx)(`option`,{value:e,children:e===`ready_for_review`?`awaiting acceptance`:e.replaceAll(`_`,` `)},e))]}),(0,b.jsxs)(`select`,{value:_,onChange:e=>v(e.target.value),className:`max-w-52 rounded-lg border border-white/10 bg-[#141418] px-2.5 py-2 text-xs text-white/45`,children:[(0,b.jsx)(`option`,{value:`all`,children:`All repositories`}),O.map(e=>(0,b.jsx)(`option`,{value:e,children:e.split(`/`).at(-1)},e))]}),(0,b.jsxs)(`select`,{value:y,onChange:e=>x(e.target.value),className:`rounded-lg border border-white/10 bg-[#141418] px-2.5 py-2 text-xs text-white/45`,children:[(0,b.jsx)(`option`,{value:`all`,children:`All templates`}),k.map(([e,t])=>(0,b.jsx)(`option`,{value:e,children:t},e))]}),(0,b.jsxs)(`select`,{value:S,onChange:e=>C(e.target.value),className:`rounded-lg border border-white/10 bg-[#141418] px-2.5 py-2 text-xs text-white/45`,children:[(0,b.jsx)(`option`,{value:`all`,children:`Any date`}),(0,b.jsx)(`option`,{value:`24h`,children:`Last 24 hours`}),(0,b.jsx)(`option`,{value:`7d`,children:`Last 7 days`}),(0,b.jsx)(`option`,{value:`30d`,children:`Last 30 days`})]})]}),M.length!==e.orchestrators.length&&(0,b.jsxs)(`p`,{className:`mt-2 text-[10px] text-white/25`,children:[`Showing `,M.length,` of `,e.orchestrators.length,` missions.`]})]}),(0,b.jsx)(Ie,{decisions:e.decisions??[],onOpenMission:t}),e.orchestrators.length===0&&(0,b.jsx)(`p`,{className:`mb-8 rounded-xl border border-dashed border-white/10 py-8 text-center text-sm text-white/35`,children:`No Hive missions yet. Start one above or adopt a discovered background job.`}),e.orchestrators.length>0&&M.length===0&&(0,b.jsx)(`p`,{className:`mb-8 rounded-xl border border-dashed border-white/10 py-8 text-center text-sm text-white/35`,children:`No missions match these filters.`}),(0,b.jsx)(et,{title:`Awaiting acceptance`,description:`The orchestrator reports that work and required verification are complete. Accept the result or request changes.`,missions:P,onSelect:t}),(0,b.jsx)(et,{title:`Active missions`,description:`Work in progress, idle, stalled, or failed.`,missions:N,onSelect:t}),(0,b.jsx)(et,{title:`Paused`,missions:te,onSelect:t}),(0,b.jsx)(et,{title:`Completed`,description:`Finished work retained for review, follow-ups, or reopening.`,missions:ne,onSelect:t,collapsedByDefault:!0}),(0,b.jsx)(et,{title:`Archive`,description:`Missions intentionally removed from the operational fleet.`,missions:re,onSelect:t,collapsedByDefault:!0}),e.other.length>0&&(0,b.jsxs)(`section`,{className:`mt-10 border-t border-white/[0.06] pt-6`,children:[(0,b.jsxs)(`button`,{onClick:()=>d(!u),className:`flex w-full items-center justify-between text-left`,children:[(0,b.jsxs)(`div`,{children:[(0,b.jsxs)(`h2`,{className:`text-sm font-medium uppercase tracking-wide text-white/30`,children:[`Discovered local sessions `,(0,b.jsx)(`span`,{className:`ml-1 text-white/15`,children:D.length})]}),(0,b.jsx)(`p`,{className:`mt-1 text-xs text-white/20`,children:`Claude processes started outside Hive. Adopt a background job, end it, or hide it locally.`})]}),(0,b.jsx)(`span`,{className:`rounded-md border border-white/8 px-2 py-1 text-xs text-white/30`,children:u?`−`:`+`})]}),u&&(0,b.jsxs)(`div`,{className:`mt-3 flex flex-col gap-2`,children:[w.size>0&&(0,b.jsx)(`div`,{className:`flex justify-end`,children:(0,b.jsxs)(`button`,{onClick:()=>{T(new Set),localStorage.removeItem(`hive:hidden-sessions`)},className:`text-[10px] text-white/25 hover:text-white/50`,children:[`Restore `,w.size,` hidden session`,w.size===1?``:`s`]})}),D.map(e=>(0,b.jsx)(tt,{session:e,onHide:()=>E(e.sessionId)},e.sessionId)),!D.length&&(0,b.jsx)(`p`,{className:`rounded-lg border border-dashed border-white/8 py-5 text-center text-xs text-white/25`,children:`All discovered sessions are hidden.`})]})]})]})}var it=/https:\/\/claude\.ai\/code\/artifact\/[\w-]+/g,at=/https?:\/\/[^\s<>"')\]]+\/-\/merge_requests\/(\d+)/g,ot=/https?:\/\/github\.com\/[^\s<>"')\]]+\/pull\/(\d+)/g,st=/https?:\/\/[\w.-]+(?:\.atlassian\.net|\/jira)\/browse\/([A-Z][A-Z0-9]*-\d+)/g;function ct(e){let t=e.match(/\/-\/merge_requests\/(\d+)/);if(t)return`MR !${t[1]}`;let n=e.match(/github\.com\/.+\/pull\/(\d+)/);if(n)return`PR #${n[1]}`;if(/claude\.ai\/code\/artifact\//.test(e))return`Artifact`}function lt(e,t){let n=new Map;for(let t of e)n.set(t.href,ct(t.href)??`${(t.kind||`PR`).toUpperCase()} ${t.id}`);let r=t.map(e=>e.text).join(`
11
+ `);for(let e of r.matchAll(at))n.set(e[0],`MR !${e[1]}`);for(let e of r.matchAll(ot))n.set(e[0],`PR #${e[1]}`);for(let e of r.matchAll(st))n.set(e[0],e[1]);let i=[...new Set([...r.matchAll(it)].map(e=>e[0]))];return i.forEach((e,t)=>n.set(e,i.length>1?`Artifact ${t+1}`:`Artifact`)),[...n.entries()].map(([e,t])=>({href:e,label:t}))}function ut({prs:e,messages:t}){let n=(0,g.useMemo)(()=>lt(e,t),[e,t]);return n.length?(0,b.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2 rounded-xl border border-emerald-300/10 bg-emerald-300/[0.025] px-3 py-2.5`,children:[(0,b.jsx)(`span`,{className:`text-[9px] font-semibold uppercase tracking-[0.16em] text-emerald-200/50`,children:`Outputs`}),n.map(e=>(0,b.jsxs)(`a`,{href:e.href,target:`_blank`,rel:`noopener noreferrer`,title:e.href,className:`rounded-lg border border-white/10 bg-white/[0.03] px-2.5 py-1 text-[11px] text-violet-300 transition hover:border-violet-400/30 hover:text-violet-200`,children:[e.label,` ↗`]},e.href))]}):null}var dt=[{id:`all`,label:`All`},{id:`manager`,label:`Manager`},{id:`worker`,label:`Workers`},{id:`task`,label:`Tasks`},{id:`tool`,label:`Tools`},{id:`errors`,label:`Errors`},{id:`outputs`,label:`Outputs`}];function ft(e){return new Date(e).toLocaleTimeString([],{hour:`2-digit`,minute:`2-digit`,second:`2-digit`})}function pt(e){return e.activityKind?e.activityKind:e.source===`custom`?e.phase===`delegating`||e.phase===`worker_started`||e.phase===`worker_reported`?`agent`:e.phase===`ready_for_review`?`output`:e.phase===`blocked_on_user`?`decision`:`lifecycle`:`tool`}function mt(e){let t=pt(e);return t===`file_read`?`Read file`:t===`file_write`?`Changed file`:t===`command`?`Ran command`:t===`test`?`Ran tests`:t===`output`?`Produced output`:e.phase===`delegating`?`Manager delegated`:e.phase===`worker_started`?`Worker started`:e.phase===`worker_reported`?`Worker reported`:e.phase===`reviewing`?`Manager reviewing`:e.phase===`plan_updated`?`Plan revised`:e.phase===`ready_for_review`?`Awaiting acceptance`:e.hookEventName===`TaskCreated`?`Task created`:e.hookEventName===`TaskCompleted`?`Task completed`:e.hookEventName===`TeammateIdle`?`Worker became idle`:e.hookEventName===`PermissionRequest`?`Permission requested`:e.hookEventName===`PermissionDenied`?`Permission denied`:e.hookEventName===`PostToolUseFailure`?`Tool failed`:e.hookEventName===`StopFailure`?`Turn failed`:e.hookEventName===`PreCompact`?`Compacting context`:e.hookEventName===`PostCompact`?`Context compacted`:e.hookEventName===`WorktreeCreate`?`Worktree created`:e.hookEventName===`WorktreeRemove`?`Worktree removed`:e.hookEventName===`InstructionsLoaded`?`Instructions loaded`:e.hookEventName===`ConfigChange`?`Configuration changed`:e.hookEventName===`CwdChanged`?`Working directory changed`:e.hookEventName===`Elicitation`?`MCP needs input`:e.hookEventName===`ElicitationResult`?`MCP input answered`:t===`agent`?`Worker activity`:t===`decision`?e.phase===`decision_resolved`?`Decision answered`:`Needs you`:e.outcome===`failure`?`Tool failed`:e.phase?.replaceAll(`_`,` `)??e.hookEventName??`Activity`}function ht(e,t){return t===`all`?!0:t===`manager`?e.source===`custom`&&!e.targetWorker&&e.phase!==`worker_started`&&e.phase!==`worker_reported`:t===`worker`?!!e.targetWorker||e.phase===`worker_started`||e.phase===`worker_reported`||e.phase===`delegating`:t===`task`?!!e.targetTask||e.phase===`plan_updated`:t===`tool`?e.source===`hook`&&!!e.toolName:t===`errors`?e.outcome===`failure`:pt(e)===`output`||e.phase===`ready_for_review`}function gt(e){let t=Math.floor(e/6e4);return t<60?`${t}m`:`${Math.floor(t/60)}h ${t%60}m`}function _t(e){return[pt(e),e.targetWorker,e.filePath,e.command,e.artifactPath,e.phase,e.detail].join(`|`)}function vt(e){let t=[];for(let n of[...e].sort((e,t)=>t.ts-e.ts)){let e=t.at(-1);e&&_t(e.event)===_t(n)&&Math.abs(e.event.ts-n.ts)<1e4?e.count+=1:t.push({event:n,count:1})}return t}function yt({events:e}){let[t,n]=(0,g.useState)(`all`),r=(0,g.useMemo)(()=>vt(e.filter(e=>ht(e,t))),[e,t]);return e.length?(0,b.jsxs)(`div`,{children:[(0,b.jsx)(`div`,{className:`mb-3 flex flex-wrap gap-1.5`,role:`group`,"aria-label":`Activity filters`,children:dt.map(e=>(0,b.jsx)(`button`,{type:`button`,onClick:()=>n(e.id),className:`rounded-full border px-2.5 py-1 text-[10px] transition ${t===e.id?`border-amber-300/25 bg-amber-300/10 text-amber-100/75`:`border-white/8 text-white/30 hover:bg-white/5 hover:text-white/55`}`,children:e.label},e.id))}),r.length?(0,b.jsx)(`ul`,{className:`flex flex-col gap-1.5`,children:r.map(({event:e,count:t},n)=>(0,b.jsxs)(g.Fragment,{children:[(0,b.jsxs)(`li`,{className:`flex items-start gap-2 rounded-lg px-1 py-1.5 text-sm hover:bg-white/[0.02]`,children:[(0,b.jsx)(`span`,{className:`mono mt-0.5 shrink-0 text-xs text-white/25`,children:ft(e.ts)}),(0,b.jsx)(`span`,{className:`mt-1.5 h-1.5 w-1.5 shrink-0 rounded-full ${e.source===`custom`?`bg-violet-400`:pt(e)===`test`?`bg-emerald-400`:pt(e)===`decision`?`bg-amber-400`:`bg-white/25`}`}),(0,b.jsxs)(`span`,{className:`min-w-0 text-white/65`,children:[(0,b.jsx)(`span`,{className:`font-medium text-white/45`,children:mt(e)}),e.targetWorker&&(0,b.jsxs)(`span`,{className:`ml-1 text-violet-300/55`,children:[`· `,e.targetWorker]}),e.targetTask&&(0,b.jsxs)(`span`,{className:`ml-1 text-sky-300/50`,children:[`· task `,e.targetTask]}),t>1&&(0,b.jsxs)(`span`,{className:`ml-1 rounded bg-white/5 px-1 text-[10px] text-white/25`,children:[`×`,t]}),(0,b.jsx)(`span`,{className:`ml-1 break-words`,children:e.filePath??e.command??e.artifactPath??e.detail}),e.rawPayload!==void 0&&(0,b.jsxs)(`details`,{className:`mt-1.5 rounded border border-white/[0.06] bg-black/20 px-2 py-1`,children:[(0,b.jsx)(`summary`,{className:`cursor-pointer text-[9px] uppercase tracking-wider text-white/25 hover:text-white/45`,children:`Raw event`}),(0,b.jsx)(`pre`,{className:`mono mt-2 max-h-64 overflow-auto whitespace-pre-wrap break-all text-[9px] leading-relaxed text-white/35`,children:JSON.stringify(e.rawPayload,null,2)})]})]})]}),r[n+1]&&e.ts-r[n+1].event.ts>=3e5&&(0,b.jsxs)(`li`,{className:`ml-16 flex items-center gap-2 py-1 text-[9px] uppercase tracking-wider text-white/18`,children:[(0,b.jsx)(`span`,{className:`h-px w-8 bg-white/8`}),`Idle gap · `,gt(e.ts-r[n+1].event.ts)]})]},`${e.ts}:${n}`))}):(0,b.jsx)(`p`,{className:`rounded-lg border border-dashed border-white/8 py-5 text-center text-xs text-white/25`,children:`No activity in this category.`})]}):(0,b.jsx)(`p`,{className:`text-sm text-white/40`,children:`No activity yet.`})}var I=[{name:`usage`,description:`Show subscription usage limits and what is consuming them`,scope:`account`},{name:`cost`,description:`Show the cost and duration breakdown for Claude usage`,scope:`account`},{name:`context`,description:`Show this mission session's context window usage`,scope:`session`}].map(e=>({name:e.name,description:e.description,source:`claude`})),bt=typeof window>`u`?g.useEffect:g.useLayoutEffect;function xt(e){return new Date(e).toLocaleTimeString([],{hour:`numeric`,minute:`2-digit`})}var St=/https?:\/\/[^\s<>"')\]]+/g,Ct=/\b(MR|PR)\s*[#!]\s*(\d+)\b/g;function wt(e,t){return e.find(e=>e.id===t||RegExp(`/(merge_requests|pull)/${t}$`).test(e.href))?.href}function Tt(e,t,n){if(!t.length)return[e];let r=[],i=0;for(let a of e.matchAll(Ct)){let o=wt(t,a[2]);o&&(a.index>i&&r.push(e.slice(i,a.index)),r.push((0,b.jsx)(`a`,{href:o,target:`_blank`,rel:`noopener noreferrer`,className:`underline underline-offset-2 transition-colors ${n}`,children:a[0]},`${o}:${a.index}`)),i=a.index+a[0].length)}return i<e.length&&r.push(e.slice(i)),r}function Et({text:e,role:t,prs:n=[]}){let r=t===`user`?`text-sky-200 hover:text-white`:`text-violet-300 hover:text-violet-200`,i=[],a=0;for(let t of e.matchAll(St)){let n=t[0].replace(/[.,;:!?*]+$/,``);t.index>a&&i.push(e.slice(a,t.index)),i.push({url:n}),a=t.index+n.length}return a<e.length&&i.push(e.slice(a)),(0,b.jsx)(`p`,{className:`whitespace-pre-wrap`,children:i.map((e,t)=>typeof e==`string`?(0,b.jsx)(`span`,{children:Tt(e,n,r)},t):(0,b.jsx)(`a`,{href:e.url,target:`_blank`,rel:`noopener noreferrer`,className:`break-all underline underline-offset-2 transition-colors ${r}`,children:e.url},t))})}function Dt({missionId:e,messages:t,hasMoreMessages:n,repository:r,live:i}){let[a,o]=(0,g.useState)(``),[s,c]=(0,g.useState)(!1),[l,u]=(0,g.useState)(null),[d,f]=(0,g.useState)(null),[p,m]=(0,g.useState)([]),[h,_]=(0,g.useState)(!!n),[v,y]=(0,g.useState)(!1),[x,S]=(0,g.useState)([]),C=(0,g.useRef)(null),w=(0,g.useRef)(null),T=Array.isArray(t)?t:[],E=[...p,...T].filter((e,t,n)=>n.findIndex(t=>t.id===e.id)===t);(0,g.useEffect)(()=>{m([]),_(!!n)},[e]),(0,g.useEffect)(()=>{M(r).then(({skills:e})=>S(e)).catch(()=>S([]))},[r]),(0,g.useEffect)(()=>{n&&_(!0)},[n]),(0,g.useEffect)(()=>{d&&E.some(e=>e.text===d.text)&&f(null)},[E,d]);async function D(){let t=E[0];if(!(!t||v)){y(!0),u(null);try{let n=await me(e,{before:t.createdAt,limit:30});m(e=>[...n.messages,...e]),_(n.hasMore)}catch(e){u(e.message)}finally{y(!1)}}}async function O(){let t=a.trim();if(!(!t||s)){c(!0),u(null),f({id:`pending:${Date.now()}`,role:`user`,text:t,createdAt:Date.now(),jobId:`pending`}),o(``);try{await F(e,t)}catch(e){f(null),o(t),u(e.message)}finally{c(!1)}}}let k=d?[...E,d]:E,A=k.at(-1)?.id,j=i?.workers.filter(e=>!e.doneAt)??[],ee=i?.status===`working`||!!d,N=!ee&&i?.status===`waiting_on_you`,P=d?`Delivering your message…`:i?.detail?.trim()||`Orchestrator is working…`;return bt(()=>{let t=C.current;if(w.current!==e){w.current=e,t&&(t.scrollTop=t.scrollHeight);return}t&&A&&t.scrollTo({top:t.scrollHeight,behavior:`smooth`})},[e,A,ee,N]),(0,b.jsxs)(`div`,{className:`overflow-hidden rounded-2xl border border-white/10 bg-[#101014]`,children:[(0,b.jsxs)(`div`,{className:`flex items-center justify-between border-b border-white/8 px-5 py-3.5`,children:[(0,b.jsxs)(`div`,{children:[(0,b.jsx)(`h2`,{className:`text-sm font-semibold text-white`,children:`Conversation`}),(0,b.jsx)(`p`,{className:`mt-0.5 text-xs text-white/35`,children:`Context carries forward across every follow-up`})]}),(0,b.jsxs)(`span`,{className:`rounded-full bg-violet-400/10 px-2 py-1 text-[10px] font-medium uppercase tracking-wider text-violet-300`,children:[E.filter(e=>e.role===`user`).length,` visible turns`]})]}),(0,b.jsxs)(`div`,{ref:C,className:`max-h-[460px] min-h-48 space-y-4 overflow-y-auto px-5 py-5`,children:[h&&(0,b.jsx)(`div`,{className:`text-center`,children:(0,b.jsx)(`button`,{onClick:D,disabled:v,className:`rounded-full border border-white/10 px-3 py-1.5 text-xs text-white/40 hover:bg-white/5 hover:text-white/70 disabled:opacity-40`,children:v?`Loading…`:`Load older messages`})}),k.length===0&&(0,b.jsx)(`p`,{className:`py-12 text-center text-sm text-white/30`,children:`Send a message to continue this mission.`}),k.map(e=>(0,b.jsx)(`div`,{className:`flex ${e.role===`user`?`justify-end`:`justify-start`}`,children:(0,b.jsxs)(`div`,{className:`max-w-[85%] rounded-2xl px-4 py-3 text-sm leading-relaxed ${e.role===`user`?`rounded-br-md bg-violet-500 text-white`:`rounded-bl-md border border-white/8 bg-white/[0.045] text-white/80`} ${e.jobId===`pending`?`opacity-70`:``}`,children:[(0,b.jsx)(Et,{text:e.text,role:e.role,prs:i?.prs}),(0,b.jsx)(`p`,{className:`mt-1.5 text-[10px] ${e.role===`user`?`text-white/55`:`text-white/25`}`,children:e.jobId===`pending`?`Sending…`:xt(e.createdAt)})]})},e.id)),ee&&(0,b.jsx)(`div`,{className:`flex justify-start`,children:(0,b.jsxs)(`div`,{className:`max-w-[85%] rounded-2xl rounded-bl-md border border-violet-300/15 bg-violet-400/[0.06] px-4 py-3`,children:[(0,b.jsxs)(`div`,{className:`flex items-center gap-2.5`,children:[(0,b.jsx)(`span`,{className:`flex gap-1`,children:[0,1,2].map(e=>(0,b.jsx)(`span`,{className:`h-1.5 w-1.5 animate-bounce rounded-full bg-violet-300/80`,style:{animationDelay:`${e*.18}s`}},e))}),(0,b.jsx)(`span`,{className:`text-xs text-violet-200/75`,children:P})]}),(j.length>0||(i?.inFlight.tasks??0)>0)&&(0,b.jsx)(`p`,{className:`mt-1.5 text-[11px] text-white/35`,children:j.length>0?`${j.length} worker${j.length===1?``:`s`} running: ${j.slice(0,3).map(e=>e.label).join(`, `)}${j.length>3?`…`:``}`:`${i.inFlight.tasks} task${i.inFlight.tasks===1?``:`s`} in flight${i.inFlight.queued?`, ${i.inFlight.queued} queued`:``}`})]})}),N&&(0,b.jsx)(`div`,{className:`flex justify-center`,children:i?.lifecycle===`ready_for_review`?(0,b.jsxs)(`span`,{className:`inline-flex items-center gap-1.5 rounded-full border border-emerald-300/20 bg-emerald-300/[0.06] px-3 py-1 text-[11px] text-emerald-200/75`,children:[(0,b.jsx)(`span`,{className:`h-1.5 w-1.5 rounded-full bg-emerald-300/80`}),`Work complete — awaiting your acceptance`]}):(0,b.jsxs)(`span`,{className:`inline-flex items-center gap-1.5 rounded-full border border-amber-300/20 bg-amber-300/[0.06] px-3 py-1 text-[11px] text-amber-200/70`,children:[(0,b.jsx)(`span`,{className:`h-1.5 w-1.5 rounded-full bg-amber-300/80`}),`Needs you — waiting on your reply`]})})]}),(0,b.jsxs)(`div`,{className:`border-t border-white/8 p-3`,children:[(0,b.jsxs)(`div`,{className:`flex items-end gap-2 rounded-xl border border-white/10 bg-white/[0.035] p-2 focus-within:border-violet-400/35`,children:[(0,b.jsx)(Ae,{value:a,onChange:o,skills:[...I,...x],onSubmit:O,rows:2,placeholder:`Ask a follow-up, request a change, or type / for skills…`,className:`min-h-12 flex-1`}),(0,b.jsx)(`button`,{onClick:O,disabled:s||!a.trim(),className:`rounded-lg bg-violet-500 px-4 py-2 text-sm font-semibold text-white transition hover:bg-violet-400 disabled:opacity-35`,children:s?`Sending…`:`Send`})]}),l&&(0,b.jsx)(`p`,{className:`mt-2 px-2 text-xs text-rose-400`,children:l})]})]})}function Ot({missionId:e,status:t,onDeleted:n}){let[r,i]=(0,g.useState)(null),[a,o]=(0,g.useState)(!1),[s,c]=(0,g.useState)(null),[l,u]=(0,g.useState)(!1),d=(0,g.useRef)(null);(0,g.useEffect)(()=>{if(!a)return;let e=e=>{d.current?.contains(e.target)||(o(!1),u(!1))},t=e=>{e.key===`Escape`&&(o(!1),u(!1))};return document.addEventListener(`pointerdown`,e),document.addEventListener(`keydown`,t),()=>{document.removeEventListener(`pointerdown`,e),document.removeEventListener(`keydown`,t)}},[a]);async function f(t){i(t),c(null);try{await oe(e,t),o(!1)}catch(e){c(e.message)}finally{i(null)}}async function p(t){i(t),c(null);try{await ce(e,t),o(!1)}catch(e){c(e.message)}finally{i(null)}}async function m(){i(`archived`),c(null);try{await se(e),n?.()}catch(e){c(e.message)}finally{i(null),u(!1)}}let h=t===`ready_for_review`?{label:`Accept & complete`,status:`completed`}:t===`paused`?{label:`Resume mission`,status:`active`}:t===`completed`||t===`failed`||t===`archived`?{label:`Reopen mission`,status:`active`}:{label:`Pause mission`,status:`paused`};return(0,b.jsxs)(`div`,{ref:d,className:`relative flex items-center gap-1.5`,children:[(0,b.jsx)(`button`,{disabled:!!r,onClick:()=>f(h.status),className:`rounded-lg border border-white/10 bg-white/[0.035] px-3 py-1.5 text-xs font-medium text-white/55 transition hover:border-amber-300/20 hover:text-amber-200 disabled:opacity-40`,children:r===h.status?`Updating…`:h.label}),(0,b.jsx)(`button`,{"aria-label":`More mission actions`,"aria-expanded":a,onClick:()=>o(!a),className:`rounded-lg border border-white/10 bg-white/[0.035] px-2.5 py-1.5 text-xs text-white/45 hover:text-white`,children:`•••`}),a&&(0,b.jsxs)(`div`,{role:`menu`,className:`absolute right-0 top-full z-30 mt-1 min-w-56 rounded-lg border border-white/10 bg-[#18181d] p-1 shadow-2xl`,children:[(t===`active`||t===`ready_for_review`)&&(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(`p`,{className:`px-3 pb-1 pt-2 text-[9px] font-medium uppercase tracking-wider text-white/20`,children:`Ask orchestrator`}),[[`status_summary`,`Request status summary`],[`plan_revision`,`Revise plan`],[`review`,`Request fresh review`],[`test_pass`,`Run verification pass`]].map(([e,t])=>(0,b.jsx)(`button`,{disabled:!!r,onClick:()=>p(e),className:`block w-full rounded-md px-3 py-2 text-left text-xs text-white/60 hover:bg-white/5 hover:text-white disabled:opacity-35`,children:r===e?`Sending…`:t},e)),(0,b.jsx)(`div`,{className:`my-1 border-t border-white/[0.06]`})]}),t===`ready_for_review`&&(0,b.jsx)(`button`,{onClick:()=>f(`active`),className:`block w-full rounded-md px-3 py-2 text-left text-xs text-white/60 hover:bg-white/5 hover:text-white`,children:`Request changes`}),t===`active`&&(0,b.jsx)(`button`,{onClick:()=>f(`completed`),className:`block w-full rounded-md px-3 py-2 text-left text-xs text-white/60 hover:bg-white/5 hover:text-white`,children:`Mark complete`}),t!==`archived`&&(0,b.jsx)(`button`,{onClick:()=>f(`archived`),className:`block w-full rounded-md px-3 py-2 text-left text-xs text-white/60 hover:bg-white/5 hover:text-white`,children:`Archive mission`}),(0,b.jsx)(`div`,{className:`my-1 border-t border-white/[0.06]`}),l?(0,b.jsxs)(`div`,{className:`p-2`,children:[(0,b.jsx)(`p`,{className:`text-[10px] leading-relaxed text-rose-200/60`,children:`Permanently remove this mission, its conversation, and plan? Claude jobs are hidden but not deleted from disk.`}),(0,b.jsxs)(`div`,{className:`mt-2 flex justify-end gap-2`,children:[(0,b.jsx)(`button`,{onClick:()=>u(!1),className:`px-2 py-1 text-[10px] text-white/35`,children:`Cancel`}),(0,b.jsx)(`button`,{disabled:!!r,onClick:m,className:`rounded-md bg-rose-500/70 px-2 py-1 text-[10px] text-white`,children:`Delete permanently`})]})]}):(0,b.jsx)(`button`,{onClick:()=>u(!0),className:`block w-full rounded-md px-3 py-2 text-left text-xs text-rose-300/55 hover:bg-rose-400/[0.06] hover:text-rose-200`,children:`Delete mission…`})]}),s&&(0,b.jsx)(`span`,{className:`absolute right-0 top-full mt-2 whitespace-nowrap text-[10px] text-rose-400`,children:s})]})}var kt={pending:`text-amber-200/65 bg-amber-300/[0.06]`,satisfied:`text-emerald-200/65 bg-emerald-300/[0.06]`,failed:`text-rose-200/70 bg-rose-300/[0.06]`,waived:`text-slate-300/50 bg-slate-300/[0.05]`};function At({missionId:e,gates:t}){let[n,r]=(0,g.useState)(null),[i,a]=(0,g.useState)(``),[o,s]=(0,g.useState)(!1),[c,l]=(0,g.useState)(null);if(!t.length)return null;async function u(t){if(i.trim()){s(!0),l(null);try{await le(e,t,i),r(null),a(``)}catch(e){l(e.message)}finally{s(!1)}}}return(0,b.jsxs)(`div`,{className:`border-t border-white/[0.06] px-5 py-4`,children:[(0,b.jsxs)(`div`,{className:`mb-3 flex items-center justify-between`,children:[(0,b.jsxs)(`div`,{children:[(0,b.jsx)(`h3`,{className:`text-xs font-semibold uppercase tracking-wide text-white/40`,children:`Completion gates`}),(0,b.jsx)(`p`,{className:`mt-1 text-[10px] text-white/22`,children:`Verification gates must be resolved before completion. User-approval gates are satisfied when you accept the mission.`})]}),(0,b.jsxs)(`span`,{className:`text-[10px] text-white/25`,children:[t.filter(e=>e.status===`satisfied`||e.status===`waived`).length,`/`,t.length,` resolved`]})]}),(0,b.jsx)(`div`,{className:`space-y-2`,children:t.map(e=>(0,b.jsxs)(`div`,{className:`rounded-lg border border-white/[0.06] bg-black/10 px-3 py-2.5`,children:[(0,b.jsxs)(`div`,{className:`flex items-start justify-between gap-3`,children:[(0,b.jsxs)(`div`,{children:[(0,b.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,b.jsx)(`p`,{className:`text-xs font-medium text-white/65`,children:e.label}),e.required&&(0,b.jsx)(`span`,{className:`text-[8px] uppercase tracking-wider text-white/20`,children:`required`})]}),(0,b.jsx)(`p`,{className:`mt-1 text-[9px] uppercase tracking-wide text-white/22`,children:e.type.replaceAll(`_`,` `)})]}),(0,b.jsx)(`span`,{className:`rounded-full px-2 py-1 text-[9px] font-medium uppercase ${kt[e.status]}`,children:e.status})]}),e.evidence.length>0&&(0,b.jsx)(`ul`,{className:`mt-2 space-y-1 border-t border-white/[0.05] pt-2`,children:e.evidence.map((e,t)=>(0,b.jsxs)(`li`,{className:`text-[10px] text-emerald-100/40`,children:[`✓ `,e]},t))}),e.waiver&&(0,b.jsxs)(`p`,{className:`mt-2 text-[10px] text-white/30`,children:[`Waived: `,e.waiver.reason]}),e.type===`user_approval`&&e.status!==`satisfied`&&e.status!==`waived`&&(0,b.jsx)(`p`,{className:`mt-2 text-[10px] text-amber-100/45`,children:`This resolves automatically when you choose Accept & complete.`}),e.type!==`user_approval`&&e.required&&e.status!==`satisfied`&&e.status!==`waived`&&(n===e.id?(0,b.jsxs)(`div`,{className:`mt-2`,children:[(0,b.jsxs)(`div`,{className:`flex gap-2`,children:[(0,b.jsx)(`input`,{autoFocus:!0,value:i,onChange:e=>a(e.target.value),placeholder:`Required reason…`,className:`min-w-0 flex-1 rounded-md border border-white/10 bg-black/20 px-2 py-1.5 text-[10px] text-white/60 outline-none`}),(0,b.jsx)(`button`,{disabled:!i.trim()||o,onClick:()=>u(e.id),className:`rounded-md bg-slate-600 px-2 py-1.5 text-[10px] text-white disabled:opacity-35`,children:`Confirm waiver`}),(0,b.jsx)(`button`,{onClick:()=>{r(null),a(``)},className:`text-[10px] text-white/25`,children:`Cancel`})]}),c&&(0,b.jsx)(`p`,{className:`mt-1 text-[10px] text-rose-400`,children:c})]}):(0,b.jsx)(`button`,{onClick:()=>{r(e.id),l(null)},className:`mt-2 text-[10px] text-white/25 hover:text-white/50`,children:`Waive with reason`}))]},e.id))})]})}function jt(e,t){if(!t)return[`Initial plan: ${e.phases.length} phase${e.phases.length===1?``:`s`}, ${e.progress.totalTasks} task${e.progress.totalTasks===1?``:`s`}`];let n=[],r=e=>new Map(e.phases.flatMap((e,t)=>[[e.id,{label:e.title,status:e.status,description:e.description,order:t,kind:`phase`}],...Be(e.tasks).map((e,n)=>[e.id,{label:e.title,status:e.status,description:e.description??e.assignment,order:t*1e3+n,kind:`task`}])])),i=r(t),a=r(e);for(let[e,t]of a){let r=i.get(e);r?((r.label!==t.label||r.description!==t.description)&&n.push(`Rescoped ${t.kind}: ${r.label} → ${t.label}`),r.status!==t.status&&n.push(`${t.label}: ${ze(r.status).toLowerCase()} → ${ze(t.status).toLowerCase()}`),r.order!==t.order&&n.push(`Reordered ${t.kind}: ${t.label}`)):n.push(`Added ${t.kind}: ${t.label}`)}for(let[e,t]of i)a.has(e)||n.push(`Removed ${t.kind}: ${t.label}`);let o=new Map((t.gates??[]).map(e=>[e.id,e]));for(let t of e.gates??[]){let e=o.get(t.id);e?e.status!==t.status&&n.push(`${t.label}: ${e.status} → ${t.status}`):n.push(`Added gate: ${t.label}`)}return(t.approvalStatus??`proposed`)!==(e.approvalStatus??`proposed`)&&n.push(`Plan approval: ${t.approvalStatus??`proposed`} → ${e.approvalStatus}`),n.length?n:[`Metadata-only revision; no task, phase, or gate changes.`]}function Mt({missionId:e,currentRevision:t}){let[n,r]=(0,g.useState)(!1),[i,a]=(0,g.useState)([]),[o,s]=(0,g.useState)(null),[c,l]=(0,g.useState)(!1);async function u(){if(n){r(!1);return}if(r(!0),!i.length){l(!0);try{a((await ue(e)).revisions)}catch(e){s(e.message)}finally{l(!1)}}}return(0,b.jsxs)(`div`,{children:[(0,b.jsxs)(`button`,{onClick:u,className:`rounded-full border border-white/8 px-2 py-0.5 text-[9px] uppercase tracking-wider text-white/30 hover:text-white/55`,children:[`Revision `,t,` · `,n?`hide history`:`history`]}),n&&(0,b.jsxs)(`div`,{className:`mt-3 max-h-72 space-y-2 overflow-y-auto rounded-xl border border-white/[0.06] bg-black/15 p-3`,children:[c&&(0,b.jsx)(`p`,{className:`text-xs text-white/25`,children:`Loading revisions…`}),o&&(0,b.jsx)(`p`,{className:`text-xs text-rose-400`,children:o}),i.map((e,t)=>(0,b.jsxs)(`div`,{className:`rounded-lg border border-white/[0.05] bg-white/[0.018] p-3`,children:[(0,b.jsxs)(`div`,{className:`flex justify-between text-[10px]`,children:[(0,b.jsxs)(`span`,{className:`font-medium text-white/50`,children:[`Revision `,e.revision]}),(0,b.jsx)(`span`,{className:`text-white/20`,children:new Date(e.updatedAt).toLocaleString()})]}),(0,b.jsx)(`ul`,{className:`mt-2 space-y-1`,children:jt(e,i[t+1]).map((e,t)=>(0,b.jsxs)(`li`,{className:`text-[10px] leading-relaxed text-white/35`,children:[`• `,e]},t))})]},e.revision))]})]})}function Nt({missionId:e,plan:t}){let n=t.approvalStatus??`proposed`,r=t.phases.some(e=>e.status!==`queued`||e.tasks.some(function e(t){return t.status!==`queued`||(t.subtasks??[]).some(e)})),[i,a]=(0,g.useState)(!1),[o,s]=(0,g.useState)(``),[c,l]=(0,g.useState)(!1),[u,d]=(0,g.useState)(null);async function f(t){l(!0),d(null);try{await de(e,t,t===`rejected`?o:void 0),a(!1),s(``)}catch(e){d(e.message)}finally{l(!1)}}return r&&n===`proposed`?null:(0,b.jsxs)(`div`,{className:`mt-3 flex flex-wrap items-center gap-2`,children:[(0,b.jsx)(`span`,{className:`rounded-full px-2 py-1 text-[9px] font-medium uppercase ${n===`approved`?`bg-emerald-300/10 text-emerald-200/60`:n===`rejected`?`bg-rose-300/10 text-rose-200/65`:`bg-amber-300/10 text-amber-200/60`}`,children:n===`approved`?`Plan approved`:n===`rejected`?`Plan changes requested`:`Optional plan checkpoint`}),n===`proposed`&&(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(`span`,{className:`text-[10px] text-white/25`,children:`Approve the approach before implementation, or let the autonomous mission continue.`}),(0,b.jsx)(`button`,{disabled:c,onClick:()=>f(`approved`),className:`cursor-pointer rounded-md border border-emerald-300/15 px-2 py-1 text-[10px] text-emerald-200/55 hover:bg-emerald-300/[0.06]`,children:`Approve approach`}),(0,b.jsx)(`button`,{onClick:()=>a(!i),className:`cursor-pointer rounded-md border border-rose-300/15 px-2 py-1 text-[10px] text-rose-200/50 hover:bg-rose-300/[0.05]`,children:`Request changes`})]}),t.approvalReason&&(0,b.jsx)(`span`,{className:`text-[10px] text-white/30`,children:t.approvalReason}),i&&(0,b.jsxs)(`div`,{className:`flex w-full gap-2`,children:[(0,b.jsx)(`input`,{autoFocus:!0,value:o,onChange:e=>s(e.target.value),placeholder:`What should change before implementation?`,className:`min-w-0 flex-1 rounded-md border border-white/10 bg-black/20 px-2 py-1.5 text-[10px] text-white/60 outline-none`}),(0,b.jsx)(`button`,{disabled:!o.trim()||c,onClick:()=>f(`rejected`),className:`cursor-pointer rounded-md bg-rose-500/60 px-2 py-1.5 text-[10px] text-white disabled:opacity-35`,children:`Request plan revision`})]}),u&&(0,b.jsx)(`p`,{className:`w-full text-[10px] text-rose-400`,children:u})]})}function Pt({missionId:e,task:t}){let[n,r]=(0,g.useState)(!1),[i,a]=(0,g.useState)(null),[o,s]=(0,g.useState)(``),[c,l]=(0,g.useState)(!1),[u,d]=(0,g.useState)(null);if(t.status===`completed`||t.status===`cancelled`)return null;async function f(n=i){if(n){l(!0),d(null);try{await fe(e,t.id,n,o),r(!1),a(null),s(``)}catch(e){d(e.message)}finally{l(!1)}}}let p=e=>{e===`retry`?(a(e),f(e)):(a(e),s(e===`priority`?`high`:``))},m=[[`retry`,`Retry remaining work`],[`cancel`,`Cancel task / worker`],[`replace_worker`,`Replace worker`],[`reassign`,`Reassign`],[`priority`,`Change priority`]];return(0,b.jsxs)(`div`,{className:`relative ml-auto`,children:[(0,b.jsx)(`button`,{onClick:()=>r(!n),"aria-label":`Task controls for ${t.title}`,className:`rounded-md border border-white/8 px-1.5 py-0.5 text-[10px] text-white/25 hover:text-white/55`,children:`•••`}),n&&(0,b.jsxs)(`div`,{className:`absolute right-0 top-full z-30 mt-1 w-64 rounded-lg border border-white/10 bg-[#18181d] p-1 shadow-2xl`,children:[!i&&m.filter(([e])=>e!==`retry`||t.status===`failed`).map(([e,t])=>(0,b.jsx)(`button`,{disabled:c,onClick:()=>p(e),className:`block w-full rounded-md px-3 py-2 text-left text-xs hover:bg-white/5 ${e===`cancel`?`text-rose-300/60`:`text-white/60`}`,children:t},e)),i&&i!==`retry`&&(0,b.jsxs)(`div`,{className:`p-2`,children:[(0,b.jsx)(`p`,{className:`mb-2 text-[10px] font-medium uppercase tracking-wide text-white/30`,children:m.find(([e])=>e===i)?.[1]}),i===`priority`?(0,b.jsxs)(`select`,{value:o,onChange:e=>s(e.target.value),className:`w-full rounded-md border border-white/10 bg-black/30 px-2 py-1.5 text-xs text-white/60`,children:[(0,b.jsx)(`option`,{value:`high`,children:`High`}),(0,b.jsx)(`option`,{value:`normal`,children:`Normal`}),(0,b.jsx)(`option`,{value:`low`,children:`Low`})]}):(0,b.jsx)(`textarea`,{autoFocus:!0,value:o,onChange:e=>s(e.target.value),rows:2,placeholder:i===`reassign`?`New owner or assignment guidance…`:i===`cancel`?`Reason for cancellation…`:`Context for the replacement worker…`,className:`w-full resize-none rounded-md border border-white/10 bg-black/20 p-2 text-xs text-white/60 outline-none placeholder:text-white/20`}),(0,b.jsxs)(`div`,{className:`mt-2 flex justify-end gap-2`,children:[(0,b.jsx)(`button`,{onClick:()=>{a(null),s(``)},className:`text-[10px] text-white/30`,children:`Back`}),(0,b.jsx)(`button`,{disabled:c||i===`reassign`&&!o.trim(),onClick:()=>f(),className:`rounded-md px-2 py-1.5 text-[10px] text-white disabled:opacity-35 ${i===`cancel`?`bg-rose-500/60`:`bg-violet-500/70`}`,children:c?`Sending…`:i===`cancel`?`Confirm cancel`:`Send control`})]})]}),u&&(0,b.jsx)(`p`,{className:`px-3 py-2 text-[10px] text-rose-400`,children:u})]})]})}function Ft({missionId:e}){let[t,n]=(0,g.useState)(!1),[r,i]=(0,g.useState)(``),[a,o]=(0,g.useState)(!1),[s,c]=(0,g.useState)(null);async function l(){if(r.trim()){o(!0),c(null);try{await pe(e,r),n(!1),i(``)}catch(e){c(e.message)}finally{o(!1)}}}return(0,b.jsxs)(`div`,{className:`relative`,children:[(0,b.jsx)(`button`,{onClick:()=>n(!t),className:`rounded-md border border-white/8 px-2 py-1 text-[10px] text-white/35 hover:text-white/60`,children:`+ Add task`}),t&&(0,b.jsxs)(`div`,{className:`absolute left-0 top-full z-30 mt-1 w-72 rounded-lg border border-white/10 bg-[#18181d] p-3 shadow-2xl`,children:[(0,b.jsx)(`textarea`,{autoFocus:!0,value:r,onChange:e=>i(e.target.value),rows:3,placeholder:`Describe the task, outcome, or changed priority…`,className:`w-full resize-none rounded-md border border-white/10 bg-black/20 p-2 text-xs text-white/60 outline-none placeholder:text-white/20`}),(0,b.jsxs)(`div`,{className:`mt-2 flex justify-end gap-2`,children:[(0,b.jsx)(`button`,{onClick:()=>n(!1),className:`text-[10px] text-white/30`,children:`Cancel`}),(0,b.jsx)(`button`,{disabled:!r.trim()||a,onClick:l,className:`rounded-md bg-violet-500/70 px-2 py-1.5 text-[10px] text-white disabled:opacity-35`,children:a?`Sending…`:`Add through orchestrator`})]}),s&&(0,b.jsx)(`p`,{className:`mt-2 text-[10px] text-rose-400`,children:s})]})]})}var It={queued:`#64748b`,working:`#fbbf24`,blocked:`#fb7185`,reviewing:`#a78bfa`,completed:`#34d399`,failed:`#ef4444`,cancelled:`#475569`};function Lt(e){return e.phases.flatMap(e=>Be(e.tasks).map(t=>({id:t.id,title:t.title,status:t.status,dependsOn:t.dependsOn,worker:t.owner??t.workerId,weight:t.weight,phase:e.title})))}function Rt({plan:e}){let t=(0,g.useMemo)(()=>Lt(e),[e]),[n,r]=(0,g.useState)(),i=(0,g.useMemo)(()=>{let e=new Map(t.map(e=>[e.id,e])),n=new Map,r=new Set,i=t=>{if(n.has(t))return n.get(t);if(r.has(t))return 0;r.add(t);let a=e.get(t),o=a?.dependsOn.length?1+Math.max(0,...a.dependsOn.filter(t=>e.has(t)).map(i)):0;return r.delete(t),n.set(t,o),o},a=new Map;t.forEach(e=>{let t=i(e.id);a.set(t,[...a.get(t)??[],e])});let o=new Map;[...a].sort(([e],[t])=>e-t).forEach(([e,t])=>t.forEach((t,n)=>o.set(t.id,{x:30+e*230,y:30+n*92})));let s=new Map,c=new Map;[...t].sort((e,t)=>i(e.id)-i(t.id)).forEach(e=>{let t=0;for(let n of e.dependsOn)(s.get(n)??0)>t&&(t=s.get(n),c.set(e.id,n));s.set(e.id,t+Math.max(1,e.weight))});let l=[...t].sort((e,t)=>(s.get(t.id)??0)-(s.get(e.id)??0))[0]?.id,u=new Set;for(;l;)u.add(l),l=c.get(l);return{byId:e,positions:o,critical:u,width:Math.max(480,60+(Math.max(0,...a.keys())+1)*230),height:Math.max(160,60+Math.max(1,...[...a.values()].map(e=>e.length))*92)}},[t]),a=n?i.byId.get(n):void 0;return t.length?(0,b.jsxs)(`div`,{className:`px-5 py-4`,children:[(0,b.jsxs)(`div`,{className:`mb-2 flex flex-wrap gap-3 text-[9px] text-white/25`,children:[(0,b.jsxs)(`span`,{children:[(0,b.jsx)(`span`,{className:`text-amber-300`,children:`━`}),` critical path`]}),(0,b.jsx)(`span`,{children:`Click a task for details`})]}),(0,b.jsx)(`div`,{className:`overflow-x-auto rounded-xl border border-white/[0.06] bg-black/15`,children:(0,b.jsxs)(`svg`,{width:i.width,height:i.height,role:`img`,"aria-label":`Task dependency graph`,children:[t.flatMap(e=>e.dependsOn.map(t=>{let n=i.positions.get(t),r=i.positions.get(e.id);if(!n||!r)return null;let a=i.critical.has(t)&&i.critical.has(e.id);return(0,b.jsx)(`path`,{d:`M ${n.x+174} ${n.y+26} C ${n.x+202} ${n.y+26}, ${r.x-28} ${r.y+26}, ${r.x} ${r.y+26}`,fill:`none`,stroke:a?`#fbbf24`:`rgba(255,255,255,.12)`,strokeWidth:a?2:1},`${t}:${e.id}`)})),t.map(e=>{let t=i.positions.get(e.id),a=n===e.id;return(0,b.jsxs)(`g`,{transform:`translate(${t.x} ${t.y})`,onClick:()=>r(e.id),className:`cursor-pointer`,children:[(0,b.jsx)(`rect`,{width:`174`,height:`54`,rx:`10`,fill:a?`rgba(255,255,255,.08)`:`#15151a`,stroke:i.critical.has(e.id)?`#fbbf24`:a?`#a78bfa`:`rgba(255,255,255,.1)`}),(0,b.jsx)(`circle`,{cx:`12`,cy:`16`,r:`3`,fill:It[e.status]}),(0,b.jsx)(`text`,{x:`21`,y:`19`,fill:`rgba(255,255,255,.72)`,fontSize:`11`,children:e.title.length>22?`${e.title.slice(0,21)}…`:e.title}),(0,b.jsxs)(`text`,{x:`12`,y:`39`,fill:`rgba(255,255,255,.25)`,fontSize:`9`,children:[e.worker?`${e.worker} · `:``,ze(e.status).toLowerCase()]})]},e.id)})]})}),a&&(0,b.jsxs)(`div`,{className:`mt-3 rounded-lg border border-violet-300/10 bg-violet-300/[0.025] px-3 py-2 text-[10px] text-white/40`,children:[(0,b.jsx)(`span`,{className:`font-medium text-white/65`,children:a.title}),` · `,a.phase,` · weight `,a.weight,a.worker?` · ${a.worker}`:``,a.dependsOn.length?` · blocked by ${a.dependsOn.map(e=>i.byId.get(e)?.title??e).join(`, `)}`:` · no dependencies`,i.critical.has(a.id)?` · critical path`:``]})]}):(0,b.jsx)(`p`,{className:`px-5 py-8 text-center text-xs text-white/25`,children:`Add tasks to see their dependency graph.`})}var zt={queued:`bg-slate-500`,working:`bg-amber-400`,blocked:`bg-rose-400`,reviewing:`bg-violet-400`,completed:`bg-emerald-400`,failed:`bg-red-500`,cancelled:`bg-slate-600`},Bt={queued:`border-l-slate-500/45`,working:`border-l-amber-400/70`,blocked:`border-l-rose-400/70`,reviewing:`border-l-violet-400/70`,completed:`border-l-emerald-400/45`,failed:`border-l-red-500/70`,cancelled:`border-l-slate-600/45`};function Vt({status:e}){return(0,b.jsxs)(`span`,{className:`inline-flex shrink-0 items-center gap-1.5 text-[10px] font-medium uppercase tracking-wide text-white/35`,children:[(0,b.jsx)(`span`,{className:`h-1.5 w-1.5 rounded-full ${zt[e]}`}),ze(e)]})}function Ht(e){let t=Ve(e.tasks).filter(e=>e.status!==`cancelled`),n=t.reduce((e,t)=>e+t.weight,0),r=t.filter(e=>e.status===`completed`).reduce((e,t)=>e+t.weight,0);return{completed:t.filter(e=>e.status===`completed`).length,total:t.length,percent:n?Math.round(r/n*100):void 0}}function Ut(e){if(!e.startedAt)return;let t=e.updatedAt??Date.now(),n=Math.max(0,Math.floor((t-e.startedAt)/6e4));return n<60?`${n}m`:`${Math.floor(n/60)}h ${n%60}m`}function Wt(e){let t=Math.max(0,Math.floor((Date.now()-e)/1e3));if(t<60)return`just now`;let n=Math.floor(t/60);if(n<60)return`${n}m ago`;let r=Math.floor(n/60);return r<24?`${r}h ago`:`${Math.floor(r/24)}d ago`}function L(e,t){return t.get(e)?.title??e}function Gt({id:e,lookup:t,indexById:n}){let r=t.get(e),i=r?.status===`completed`||r?.status===`cancelled`,a=n.get(e);return(0,b.jsxs)(`span`,{title:r?.title??e,className:`inline-flex items-center gap-1 rounded px-1.5 py-0.5 font-mono text-[9px] ${i?`bg-emerald-300/[0.06] text-emerald-200/45`:`bg-white/[0.05] text-white/45`}`,children:[i?`✓`:`○`,` `,a===void 0?e:`#${a}`]})}function Kt({missionId:e,task:t,lookup:n,indexById:r}){let i=Ut(t),a=[...n.values()].filter(e=>e.dependsOn.includes(t.id)),o=t.assignment??t.description,s=t.dependsOn.filter(e=>{let t=n.get(e);return t&&t.status!==`completed`&&t.status!==`cancelled`}).length,c=!!(t.role||i||t.updatedAt||t.branch||t.worktree||t.testState||t.dependsOn.length||a.length||t.changedFiles?.length||t.evidence.length);return(0,b.jsxs)(`div`,{children:[(0,b.jsxs)(`div`,{className:`rounded-lg border border-l-2 px-3 py-2.5 ${Bt[t.status]} ${t.status===`blocked`||t.status===`failed`?`border-rose-400/15 bg-rose-400/[0.025]`:`border-white/[0.06] bg-white/[0.018]`}`,children:[(0,b.jsxs)(`div`,{className:`flex items-start justify-between gap-3`,children:[(0,b.jsxs)(`div`,{className:`min-w-0`,children:[(0,b.jsxs)(`p`,{className:`text-xs font-medium ${t.status===`completed`?`text-white/35 line-through`:`text-white/70`}`,children:[(0,b.jsxs)(`span`,{className:`mr-1.5 font-mono text-[9px] font-normal text-white/25`,children:[`#`,r.get(t.id)]}),t.title]}),o&&(0,b.jsxs)(`p`,{className:`mt-1 text-[11px] leading-relaxed text-white/32`,children:[(0,b.jsx)(`span`,{className:`text-white/20`,children:`Deliverable:`}),` `,o]})]}),(0,b.jsxs)(`div`,{className:`flex shrink-0 items-center gap-2`,children:[(0,b.jsx)(Vt,{status:t.status}),(0,b.jsx)(Pt,{missionId:e,task:t})]})]}),(0,b.jsxs)(`div`,{className:`mt-2 flex flex-wrap items-center gap-x-3 gap-y-1 text-[10px] text-white/30`,children:[t.owner||t.workerId?(0,b.jsxs)(`span`,{className:`text-violet-200/55`,children:[`Owner: `,t.owner??t.workerId]}):(0,b.jsx)(`span`,{children:`Unassigned`}),t.dependsOn.length>0&&(0,b.jsxs)(`span`,{className:`inline-flex flex-wrap items-center gap-1`,children:[t.status!==`completed`&&s>0?`Waiting on ${s} of`:`After`,t.dependsOn.map(e=>(0,b.jsx)(Gt,{id:e,lookup:n,indexById:r},e))]}),a.length>0&&(0,b.jsxs)(`span`,{className:`inline-flex flex-wrap items-center gap-1`,children:[`Unblocks →`,a.map(e=>(0,b.jsx)(Gt,{id:e.id,lookup:n,indexById:r},e.id))]}),t.updatedAt&&(0,b.jsxs)(`span`,{children:[`Updated `,Wt(t.updatedAt)]})]}),t.status===`blocked`&&(0,b.jsxs)(`div`,{className:`mt-2 rounded-md border border-rose-400/10 bg-rose-400/[0.04] px-2.5 py-2 text-[10px] leading-relaxed`,children:[(0,b.jsx)(`p`,{className:`text-rose-200/65`,children:t.blocker??`This task is blocked.`}),t.unblock&&(0,b.jsxs)(`p`,{className:`mt-1 text-white/35`,children:[`To unblock: `,t.unblock]})]}),c&&(0,b.jsxs)(`details`,{className:`mt-2 border-t border-white/[0.05] pt-2`,children:[(0,b.jsx)(`summary`,{className:`cursor-pointer select-none text-[10px] text-white/25 transition hover:text-white/50`,children:`Operational details`}),(0,b.jsxs)(`div`,{className:`mt-2 flex flex-wrap gap-x-3 gap-y-1 text-[9px] text-white/28`,children:[t.role&&(0,b.jsxs)(`span`,{children:[`Role: `,t.role.replaceAll(`_`,` `)]}),i&&(0,b.jsxs)(`span`,{children:[`Duration: `,i]}),t.branch&&(0,b.jsxs)(`span`,{className:`mono`,children:[`Branch: `,t.branch]}),t.worktree&&(0,b.jsxs)(`span`,{className:`mono truncate`,title:t.worktree,children:[`Worktree: `,t.worktree]}),t.testState&&(0,b.jsxs)(`span`,{className:t.testState===`passed`?`text-emerald-300/50`:t.testState===`failed`?`text-rose-300/55`:``,children:[`Tests: `,t.testState.replaceAll(`_`,` `)]})]}),t.changedFiles?.length?(0,b.jsx)(`div`,{className:`mono mt-2 flex flex-wrap gap-1`,children:t.changedFiles.map(e=>(0,b.jsx)(`span`,{title:e,className:`max-w-56 truncate rounded bg-white/[0.035] px-1.5 py-1 text-[9px] text-white/30`,children:e},e))}):null,t.evidence.length>0&&(0,b.jsx)(`ul`,{className:`mt-2 space-y-1`,children:t.evidence.map((e,t)=>(0,b.jsxs)(`li`,{className:`text-[10px] text-emerald-100/45`,children:[`✓ `,e]},t))})]})]}),t.subtasks?.length?(0,b.jsx)(`div`,{className:`ml-4 mt-1 space-y-1 border-l border-white/[0.07] pl-3`,children:t.subtasks.map(t=>(0,b.jsx)(Kt,{missionId:e,task:t,lookup:n,indexById:r},t.id))}):null]})}function qt({title:e,tone:t,empty:n,tasks:r,lookup:i}){return(0,b.jsxs)(`div`,{className:`min-w-0 rounded-xl border p-3 ${{amber:`border-amber-300/10 bg-amber-300/[0.025] text-amber-200/60`,violet:`border-violet-300/10 bg-violet-300/[0.025] text-violet-200/60`,rose:`border-rose-300/10 bg-rose-300/[0.025] text-rose-200/65`}[t]}`,children:[(0,b.jsx)(`p`,{className:`text-[9px] font-semibold uppercase tracking-[0.16em]`,children:e}),r.length?(0,b.jsx)(`ul`,{className:`mt-2 space-y-2`,children:r.slice(0,3).map(e=>(0,b.jsxs)(`li`,{className:`text-[11px] leading-snug text-white/60`,children:[(0,b.jsx)(`span`,{className:`font-medium text-white/75`,children:e.title}),(e.owner||e.workerId)&&(0,b.jsx)(`span`,{className:`block text-[9px] text-white/28`,children:e.owner??e.workerId}),t===`rose`&&(0,b.jsx)(`span`,{className:`block text-[9px] text-rose-200/45`,children:e.blocker??(e.status===`failed`?`Task failed`:e.dependsOn.length?`Waiting for ${e.dependsOn.map(e=>L(e,i)).join(`, `)}`:`Needs intervention`)})]},e.id))}):(0,b.jsx)(`p`,{className:`mt-2 text-[10px] text-white/25`,children:n}),r.length>3&&(0,b.jsxs)(`p`,{className:`mt-2 text-[9px] text-white/20`,children:[`+`,r.length-3,` more`]})]})}function Jt({missionId:e,plan:t,objective:n,missionAcceptanceCriteria:r=[],workers:i=[],missionUpdatedAt:a}){let[o,s]=(0,g.useState)(()=>new Set(t?.phases.filter(e=>e.status===`completed`||e.status===`queued`).map(e=>e.id)??[])),[c,l]=(0,g.useState)(`plan`),u=(0,g.useMemo)(()=>He(t),[t]),d=(0,g.useMemo)(()=>new Map(u.map(e=>[e.id,e])),[u]),f=(0,g.useMemo)(()=>new Map(u.map((e,t)=>[e.id,t+1])),[u]);if(!t)return(0,b.jsx)(`section`,{className:`mb-6 rounded-2xl border border-dashed border-white/10 bg-white/[0.018] px-5 py-5`,children:(0,b.jsxs)(`div`,{className:`flex items-center justify-between gap-4`,children:[(0,b.jsxs)(`div`,{children:[(0,b.jsx)(`h2`,{className:`text-sm font-semibold text-white/75`,children:`Mission plan`}),(0,b.jsx)(`p`,{className:`mt-1 text-xs text-white/30`,children:`Waiting for the orchestrator to publish a structured plan.`}),n&&(0,b.jsxs)(`p`,{className:`mt-3 text-sm leading-relaxed text-white/55`,children:[(0,b.jsx)(`span`,{className:`text-white/25`,children:`Goal:`}),` `,n]})]}),(0,b.jsx)(`span`,{className:`rounded-full bg-white/[0.04] px-2.5 py-1 text-[10px] uppercase tracking-wider text-white/25`,children:`Not published`})]})});let p=t.phases.find(e=>e.status===`working`||e.status===`reviewing`||e.status===`blocked`),m=t.phases.find(e=>e.status===`queued`),h=u.filter(e=>e.status===`working`||e.status===`reviewing`),_=u.filter(e=>e.status===`queued`&&e.dependsOn.every(e=>d.get(e)?.status===`completed`)),v=u.filter(e=>e.status===`blocked`||e.status===`failed`),y=t.phases.filter(e=>e.status===`completed`).length,x=(t.gates??[]).filter(e=>e.status===`satisfied`||e.status===`waived`).length,S=i.filter(e=>!e.doneAt&&(e.jobState===`working`||e.jobState===`busy`)),C=new Set(h.flatMap(e=>[e.workerId,e.owner].filter(Boolean))),w=S.filter(e=>!C.has(e.id)&&!C.has(e.jobId)),T=S.length>0&&a&&a>t.updatedAt+3e5,E=w.length>0?`${w.length} active worker${w.length===1?` is`:`s are`} not represented in current plan activity.`:T?`Mission activity is newer than this plan; a revision may be needed.`:void 0,D=u.flatMap(e=>e.evidence.map(t=>({task:e.title,item:t}))).slice(-5).reverse();return(0,b.jsxs)(`section`,{className:`mb-6 overflow-hidden rounded-2xl border border-white/10 bg-[#101014]`,children:[(0,b.jsxs)(`div`,{className:`border-b border-white/8 px-5 py-4`,children:[(0,b.jsxs)(`div`,{className:`flex flex-wrap items-start justify-between gap-4`,children:[(0,b.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,b.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,b.jsx)(`h2`,{className:`text-sm font-semibold text-white`,children:`Plan at a glance`}),(0,b.jsx)(Mt,{missionId:e,currentRevision:t.revision}),(0,b.jsx)(Ft,{missionId:e})]}),(0,b.jsxs)(`p`,{className:`mt-3 max-w-4xl text-sm leading-relaxed text-white/65`,children:[(0,b.jsx)(`span`,{className:`mr-2 text-[10px] font-semibold uppercase tracking-wider text-amber-200/45`,children:`Goal`}),n??`No mission objective has been recorded.`]}),(0,b.jsx)(Nt,{missionId:e,plan:t})]}),(0,b.jsxs)(`div`,{className:`shrink-0 text-right`,children:[(0,b.jsxs)(`p`,{className:`text-2xl font-semibold text-amber-300`,children:[t.progress.percent??`—`,t.progress.percent!==void 0&&`%`]}),(0,b.jsx)(`p`,{className:`text-[9px] uppercase tracking-wider text-white/25`,children:`weighted progress`})]})]}),(0,b.jsx)(`div`,{className:`mt-4 h-1.5 overflow-hidden rounded-full bg-white/[0.06]`,children:(0,b.jsx)(`div`,{className:`h-full rounded-full bg-gradient-to-r from-amber-400 to-violet-400 transition-all`,style:{width:`${t.progress.percent??0}%`}})}),(0,b.jsxs)(`div`,{className:`mt-2 flex flex-wrap items-center gap-x-4 gap-y-1 text-[10px] text-white/30`,children:[(0,b.jsxs)(`span`,{children:[t.progress.completedTasks,`/`,t.progress.totalTasks,` tasks`]}),(0,b.jsxs)(`span`,{children:[y,`/`,t.phases.length,` phases`]}),(0,b.jsxs)(`span`,{children:[x,`/`,t.gates?.length??0,` gates`]}),(0,b.jsxs)(`span`,{children:[`Current: `,p?.title??(t.progress.percent===100?`Complete`:`None active`)]}),(0,b.jsxs)(`span`,{children:[`Next: `,m?.milestone??m?.title??`Not scheduled`]})]}),(0,b.jsxs)(`div`,{className:`mt-3 flex flex-wrap items-center justify-between gap-3`,children:[(0,b.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2 text-[10px] text-white/25`,children:[(0,b.jsxs)(`span`,{children:[`Updated `,Wt(t.updatedAt)]}),(0,b.jsx)(`span`,{children:`·`}),(0,b.jsxs)(`span`,{children:[`Revision `,t.revision]}),E&&(0,b.jsxs)(`span`,{className:`rounded-md border border-amber-300/10 bg-amber-300/[0.04] px-2 py-1 text-amber-100/50`,children:[`⚠ `,E]})]}),(0,b.jsx)(`div`,{className:`inline-flex rounded-lg border border-white/[0.06] bg-black/15 p-0.5`,children:[[`plan`,`Plan`],[`dependencies`,`Dependencies`]].map(([e,t])=>(0,b.jsx)(`button`,{onClick:()=>l(e),className:`cursor-pointer rounded-md px-2.5 py-1 text-[9px] font-medium uppercase tracking-wider transition ${c===e?`bg-white/[0.08] text-white/65`:`text-white/25 hover:bg-white/[0.03] hover:text-white/45`}`,children:t},e))})]})]}),(0,b.jsxs)(`div`,{className:`grid gap-2 border-b border-white/[0.06] p-4 md:grid-cols-3`,children:[(0,b.jsx)(qt,{title:`Now`,tone:`amber`,tasks:h,empty:`No task is actively running.`,lookup:d}),(0,b.jsx)(qt,{title:`Next`,tone:`violet`,tasks:_,empty:t.progress.percent===100?`All planned work is complete.`:`No unblocked task is queued.`,lookup:d}),(0,b.jsx)(qt,{title:`Needs attention`,tone:`rose`,tasks:v,empty:`No blockers or failed tasks.`,lookup:d})]}),c===`dependencies`&&(0,b.jsx)(Rt,{plan:t}),c===`plan`&&(0,b.jsx)(`div`,{className:`divide-y divide-white/[0.06]`,children:t.phases.map((n,r)=>{let i=o.has(n.id),a=Ht(n);return t.layout===`flat`?(0,b.jsxs)(`div`,{className:`space-y-1 px-5 py-4`,children:[n.tasks.map(t=>(0,b.jsx)(Kt,{missionId:e,task:t,lookup:d,indexById:f},t.id)),n.tasks.length===0&&(0,b.jsx)(`p`,{className:`py-2 text-xs text-white/25`,children:`No tasks yet.`})]},n.id):(0,b.jsxs)(`div`,{children:[(0,b.jsxs)(`button`,{onClick:()=>s(e=>{let t=new Set(e);return t.has(n.id)?t.delete(n.id):t.add(n.id),t}),className:`flex w-full cursor-pointer items-center justify-between gap-4 px-5 py-3.5 text-left transition hover:bg-white/[0.025]`,children:[(0,b.jsxs)(`div`,{className:`flex min-w-0 items-center gap-3`,children:[(0,b.jsx)(`span`,{className:`flex h-6 w-6 shrink-0 items-center justify-center rounded-md bg-amber-300/[0.07] text-[10px] font-semibold text-amber-200/60`,children:r+1}),(0,b.jsxs)(`div`,{className:`min-w-0`,children:[(0,b.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,b.jsx)(`p`,{className:`truncate text-sm font-medium text-white/80`,children:n.title}),n.milestone&&(0,b.jsxs)(`span`,{className:`truncate rounded-full border border-amber-300/10 bg-amber-300/[0.04] px-2 py-0.5 text-[9px] text-amber-200/45`,children:[`◆ `,n.milestone]})]}),(0,b.jsxs)(`div`,{className:`mt-1 flex items-center gap-2`,children:[(0,b.jsx)(`div`,{className:`h-1 w-20 overflow-hidden rounded-full bg-white/[0.06]`,children:(0,b.jsx)(`div`,{className:`h-full rounded-full bg-amber-300/60`,style:{width:`${a.percent??0}%`}})}),(0,b.jsxs)(`p`,{className:`text-[10px] text-white/25`,children:[a.completed,`/`,a.total,` tasks`,a.percent===void 0?``:` · ${a.percent}%`]})]})]})]}),(0,b.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,b.jsx)(Vt,{status:n.status}),(0,b.jsx)(`span`,{className:`text-xs text-white/25`,children:i?`+`:`−`})]})]}),!i&&(0,b.jsxs)(`div`,{className:`px-5 pb-4 pl-14`,children:[n.description&&(0,b.jsx)(`p`,{className:`mb-3 text-xs leading-relaxed text-white/40`,children:n.description}),n.acceptanceCriteria.length>0&&(0,b.jsxs)(`div`,{className:`mb-3 rounded-lg border border-emerald-300/10 bg-emerald-300/[0.02] p-3`,children:[(0,b.jsx)(`p`,{className:`text-[9px] font-semibold uppercase tracking-wider text-emerald-200/45`,children:`Definition of done`}),(0,b.jsx)(`ul`,{className:`mt-2 space-y-1.5`,children:n.acceptanceCriteria.map((e,t)=>(0,b.jsxs)(`li`,{className:`flex gap-2 text-[10px] leading-relaxed text-white/45`,children:[(0,b.jsx)(`span`,{className:n.status===`completed`?`text-emerald-300/70`:`text-white/20`,children:n.status===`completed`?`✓`:`○`}),e]},t))})]}),(0,b.jsxs)(`div`,{className:`space-y-1`,children:[n.tasks.map(t=>(0,b.jsx)(Kt,{missionId:e,task:t,lookup:d,indexById:f},t.id)),n.tasks.length===0&&(0,b.jsx)(`p`,{className:`py-2 text-xs text-white/25`,children:`No tasks in this phase.`})]})]})]},n.id)})}),r.length>0&&(0,b.jsxs)(`div`,{className:`border-t border-white/[0.06] px-5 py-4`,children:[(0,b.jsx)(`h3`,{className:`text-[10px] font-semibold uppercase tracking-wider text-white/35`,children:`Mission acceptance criteria`}),(0,b.jsx)(`ul`,{className:`mt-2 grid gap-1.5 sm:grid-cols-2`,children:r.map((e,t)=>(0,b.jsxs)(`li`,{className:`flex gap-2 text-[11px] text-white/45`,children:[(0,b.jsx)(`span`,{className:`text-amber-200/40`,children:`◇`}),e]},t))})]}),(0,b.jsx)(At,{missionId:e,gates:t.gates??[]}),D.length>0&&(0,b.jsxs)(`div`,{className:`border-t border-white/[0.06] px-5 py-4`,children:[(0,b.jsxs)(`div`,{className:`mb-2 flex items-center justify-between`,children:[(0,b.jsx)(`h3`,{className:`text-[10px] font-semibold uppercase tracking-wider text-emerald-300/50`,children:`Recent evidence`}),(0,b.jsx)(`span`,{className:`text-[9px] text-white/20`,children:`Reported by the plan`})]}),(0,b.jsx)(`ul`,{className:`space-y-1.5`,children:D.map(({task:e,item:t},n)=>(0,b.jsxs)(`li`,{className:`flex gap-2 text-[11px] leading-relaxed text-white/45`,children:[(0,b.jsx)(`span`,{className:`text-emerald-400/70`,children:`✓`}),(0,b.jsxs)(`span`,{children:[(0,b.jsxs)(`span`,{className:`text-white/25`,children:[e,`:`]}),` `,t]})]},`${e}:${t}:${n}`))})]})]})}function Yt(e){let t=Math.max(0,Math.floor(e/1e3));if(t<60)return`${t}s`;let n=Math.floor(t/60);return n<60?`${n}m ${t%60}s`:`${Math.floor(n/60)}h ${n%60}m`}function Xt(e,t){if(!e)return!1;let n=e.toLowerCase();return n===t.id.toLowerCase()||n===t.label.toLowerCase()||t.id.toLowerCase().startsWith(n)||t.label.toLowerCase().includes(n)}function Zt(e,t){let n=He(e);return n.find(e=>Xt(e.workerId,t))??n.find(e=>e.title.toLowerCase()===t.label.toLowerCase())}function Qt({missionId:e,worker:t,plan:n,events:r,onClose:i}){let a=je(i),[o,s]=(0,g.useState)(Date.now()),[c,l]=(0,g.useState)(``),[u,d]=(0,g.useState)(!1),[f,p]=(0,g.useState)(null);(0,g.useEffect)(()=>{let e=setInterval(()=>s(Date.now()),1e3);return()=>clearInterval(e)},[]),(0,g.useEffect)(()=>{let e=e=>{e.key===`Escape`&&i()};return document.addEventListener(`keydown`,e),()=>document.removeEventListener(`keydown`,e)},[i]);let m=(0,g.useMemo)(()=>Zt(n,t),[n,t]),h=(0,g.useMemo)(()=>r.filter(e=>Xt(e.targetWorker,t)).sort((e,t)=>t.ts-e.ts),[r,t]),_=(0,g.useMemo)(()=>({filesRead:[...new Set(h.filter(e=>e.activityKind===`file_read`).map(e=>e.filePath).filter(e=>!!e))],filesChanged:[...new Set(h.filter(e=>e.activityKind===`file_write`).map(e=>e.filePath).filter(e=>!!e))],commands:[...new Set(h.filter(e=>e.activityKind===`command`).map(e=>e.command).filter(e=>!!e))],tests:[...new Set(h.filter(e=>e.activityKind===`test`).map(e=>e.command).filter(e=>!!e))],outputs:[...new Set(h.filter(e=>e.activityKind===`output`).map(e=>e.artifactPath??e.detail).filter(Boolean))]}),[h]),v=h[0],y=t.doneAt??(t.jobState===`working`||t.jobState===`busy`?o:t.jobUpdatedAt??o),x=t.doneAt?`Completed`:t.jobState===`working`||t.jobState===`busy`?`Working`:`Ended`,S=Math.max(t.updatedAt??0,t.jobUpdatedAt??0,v?.ts??0),C=t.terminationReason??(t.doneAt?`Worker reported completion`:x===`Working`?`Still running`:`Parent job ended with state: ${t.jobState}`);async function w(){let n=c.trim();if(!n||u)return;d(!0),p(null);let r=m?`worker ${t.label} on plan task ${m.id} (${m.title})`:`worker ${t.label} (${t.id})`;try{await F(e,`Guidance for ${r}:\n\n${n}`),l(``)}catch(e){p(e.message)}finally{d(!1)}}return(0,b.jsx)(`div`,{className:`fixed inset-0 z-50 flex justify-end bg-black/55`,...a,children:(0,b.jsxs)(`aside`,{role:`dialog`,"aria-modal":`true`,"aria-label":`Worker details: ${t.label}`,onMouseDown:e=>e.stopPropagation(),className:`h-full w-full max-w-xl overflow-y-auto border-l border-white/10 bg-[#0d0d10] shadow-2xl`,children:[(0,b.jsxs)(`div`,{className:`sticky top-0 z-10 flex items-start justify-between border-b border-white/8 bg-[#0d0d10]/95 px-6 py-5 backdrop-blur`,children:[(0,b.jsxs)(`div`,{children:[(0,b.jsx)(`p`,{className:`text-[10px] font-medium uppercase tracking-[0.16em] text-amber-300/55`,children:`Worker inspection`}),(0,b.jsx)(`h2`,{className:`mt-1 text-lg font-semibold text-white`,children:t.label}),(0,b.jsxs)(`p`,{className:`mono mt-1 text-[11px] text-white/25`,children:[t.id,` · job `,t.jobId.slice(0,8)]})]}),(0,b.jsx)(`button`,{onClick:i,"aria-label":`Close worker details`,className:`rounded-lg border border-white/10 px-2.5 py-1.5 text-sm text-white/40 hover:bg-white/5 hover:text-white`,children:`×`})]}),(0,b.jsxs)(`div`,{className:`space-y-5 p-6`,children:[(0,b.jsx)(`div`,{className:`grid grid-cols-3 gap-2`,children:[[`State`,x],[`Elapsed`,Yt(y-t.startedAt)],[`Role`,m?.role?.replaceAll(`_`,` `)??t.kind]].map(([e,t])=>(0,b.jsxs)(`div`,{className:`rounded-xl border border-white/8 bg-white/[0.025] p-3`,children:[(0,b.jsx)(`p`,{className:`truncate text-sm font-semibold capitalize text-white/75`,title:t,children:t}),(0,b.jsx)(`p`,{className:`mt-1 text-[9px] uppercase tracking-wider text-white/25`,children:e})]},e))}),(0,b.jsxs)(`section`,{className:`rounded-xl border border-white/8 bg-white/[0.02] p-4`,children:[(0,b.jsx)(`h3`,{className:`text-xs font-semibold uppercase tracking-wide text-white/40`,children:`Assignment`}),m?(0,b.jsxs)(`div`,{className:`mt-3`,children:[(0,b.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,b.jsx)(`p`,{className:`text-xs font-medium text-violet-200/75`,children:m.title}),(0,b.jsx)(`span`,{className:`text-[9px] uppercase text-white/25`,children:m.status})]}),(0,b.jsx)(`p`,{className:`mt-2 text-xs leading-relaxed text-white/55`,children:m.assignment??m.description??t.label}),m.context&&(0,b.jsxs)(`div`,{className:`mt-3 border-t border-white/[0.06] pt-3`,children:[(0,b.jsx)(`p`,{className:`text-[9px] uppercase tracking-wide text-white/25`,children:`Delegated context`}),(0,b.jsx)(`p`,{className:`mt-1.5 text-xs leading-relaxed text-white/40`,children:m.context})]}),m.status===`blocked`&&(m.blocker||m.unblock)&&(0,b.jsxs)(`div`,{className:`mt-3 rounded-lg border border-rose-400/10 bg-rose-400/[0.04] p-2.5`,children:[(0,b.jsx)(`p`,{className:`text-xs text-rose-200/60`,children:m.blocker??`Task is blocked`}),m.unblock&&(0,b.jsxs)(`p`,{className:`mt-1 text-[10px] text-white/35`,children:[`Unblock by: `,m.unblock]})]}),m.dependsOn.length>0&&(0,b.jsxs)(`p`,{className:`mt-2 text-[10px] text-white/25`,children:[`Depends on: `,m.dependsOn.join(`, `)]})]}):(0,b.jsx)(`p`,{className:`mt-3 text-xs text-white/25`,children:`No structured plan task is linked to this worker yet.`})]}),(0,b.jsxs)(`section`,{className:`rounded-xl border border-white/8 bg-white/[0.02] p-4`,children:[(0,b.jsx)(`h3`,{className:`text-xs font-semibold uppercase tracking-wide text-white/40`,children:`Runtime`}),(0,b.jsxs)(`dl`,{className:`mt-3 grid grid-cols-[110px_1fr] gap-y-2 text-xs`,children:[(0,b.jsx)(`dt`,{className:`text-white/25`,children:`Started`}),(0,b.jsx)(`dd`,{className:`text-white/55`,children:new Date(t.startedAt).toLocaleString()}),(0,b.jsx)(`dt`,{className:`text-white/25`,children:`Elapsed`}),(0,b.jsx)(`dd`,{className:`text-white/55`,children:Yt(y-t.startedAt)}),(0,b.jsx)(`dt`,{className:`text-white/25`,children:`Last update`}),(0,b.jsx)(`dd`,{className:`text-white/55`,children:S?`${new Date(S).toLocaleString()} · ${Yt(o-S)} ago`:`Not reported`}),(0,b.jsx)(`dt`,{className:`text-white/25`,children:`Latest activity`}),(0,b.jsx)(`dd`,{className:`text-white/55`,children:v?v.command??v.filePath??v.detail:`No targeted report`}),(0,b.jsx)(`dt`,{className:`text-white/25`,children:`Termination`}),(0,b.jsx)(`dd`,{className:`text-white/55`,children:C}),(0,b.jsx)(`dt`,{className:`text-white/25`,children:`Token usage`}),(0,b.jsx)(`dd`,{className:t.tokens===void 0?`text-white/30`:`text-white/55`,children:t.tokens===void 0?`Not exposed per worker by this Claude CLI record`:t.tokens.toLocaleString()})]})]}),m?.evidence.length?(0,b.jsxs)(`section`,{className:`rounded-xl border border-emerald-400/10 bg-emerald-400/[0.025] p-4`,children:[(0,b.jsx)(`h3`,{className:`text-xs font-semibold uppercase tracking-wide text-emerald-300/55`,children:`Evidence`}),(0,b.jsx)(`ul`,{className:`mt-3 space-y-2`,children:m.evidence.map((e,t)=>(0,b.jsxs)(`li`,{className:`flex gap-2 text-xs leading-relaxed text-white/55`,children:[(0,b.jsx)(`span`,{className:`text-emerald-400`,children:`✓`}),e]},t))})]}):null,(0,b.jsxs)(`section`,{className:`rounded-xl border border-white/8 bg-white/[0.02] p-4`,children:[(0,b.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,b.jsx)(`h3`,{className:`text-xs font-semibold uppercase tracking-wide text-white/40`,children:`Observed work`}),(0,b.jsx)(`span`,{className:`text-[10px] text-white/20`,children:`From attributed hooks`})]}),(0,b.jsx)(`div`,{className:`mt-3 grid grid-cols-2 gap-2`,children:[[`Files read`,_.filesRead],[`Files changed`,_.filesChanged],[`Commands`,_.commands],[`Tests`,_.tests],[`Outputs`,_.outputs]].map(([e,t])=>(0,b.jsxs)(`div`,{className:`${e===`Outputs`?`col-span-2`:``} rounded-lg border border-white/[0.06] bg-black/10 p-3`,children:[(0,b.jsxs)(`p`,{className:`text-[9px] font-medium uppercase tracking-wide text-white/25`,children:[e,` · `,t.length]}),t.length?(0,b.jsx)(`ul`,{className:`mt-2 space-y-1.5`,children:t.slice(0,6).map(e=>(0,b.jsx)(`li`,{title:e,className:`mono truncate text-[10px] text-white/50`,children:e},e))}):(0,b.jsx)(`p`,{className:`mt-2 text-[10px] text-white/18`,children:`None reported`})]},e))})]}),(0,b.jsxs)(`section`,{children:[(0,b.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,b.jsx)(`h3`,{className:`text-xs font-semibold uppercase tracking-wide text-white/40`,children:`Worker activity`}),(0,b.jsxs)(`span`,{className:`text-[10px] text-white/20`,children:[h.length,` events`]})]}),h.length?(0,b.jsx)(`div`,{className:`mt-3 space-y-2`,children:h.map((e,t)=>(0,b.jsxs)(`div`,{className:`rounded-lg border border-white/[0.06] bg-white/[0.018] p-3`,children:[(0,b.jsxs)(`div`,{className:`flex items-center justify-between text-[9px] uppercase tracking-wide text-white/25`,children:[(0,b.jsx)(`span`,{children:e.phase??e.hookEventName??`activity`}),(0,b.jsx)(`span`,{children:new Date(e.ts).toLocaleTimeString()})]}),(0,b.jsx)(`p`,{className:`mt-1.5 text-xs leading-relaxed text-white/55`,children:e.detail})]},`${e.ts}:${t}`))}):(0,b.jsx)(`p`,{className:`mt-3 rounded-lg border border-dashed border-white/8 px-3 py-5 text-center text-xs text-white/25`,children:`No targeted activity reports were recorded for this worker.`})]}),(0,b.jsxs)(`section`,{className:`rounded-xl border border-violet-400/10 bg-violet-400/[0.025] p-4`,children:[(0,b.jsx)(`h3`,{className:`text-xs font-semibold uppercase tracking-wide text-violet-300/55`,children:`Guide this worker`}),(0,b.jsx)(`p`,{className:`mt-1 text-[11px] leading-relaxed text-white/30`,children:`Guidance is sent through the orchestrator, which remains responsible for relaying or revising the task.`}),(0,b.jsx)(`textarea`,{value:c,onChange:e=>l(e.target.value),rows:3,placeholder:`Clarify scope, suggest an approach, or change a requirement…`,className:`mt-3 w-full resize-none rounded-lg border border-white/10 bg-black/20 p-2.5 text-xs text-white/70 outline-none placeholder:text-white/20 focus:border-violet-400/25`}),(0,b.jsxs)(`div`,{className:`mt-2 flex items-center justify-between gap-3`,children:[f?(0,b.jsx)(`p`,{className:`text-[10px] text-rose-400`,children:f}):(0,b.jsx)(`span`,{}),(0,b.jsx)(`button`,{onClick:w,disabled:!c.trim()||u,className:`rounded-lg bg-violet-500 px-3 py-1.5 text-xs font-semibold text-white hover:bg-violet-400 disabled:opacity-35`,children:u?`Sending…`:`Send through orchestrator`})]})]})]})]})})}var $t={info:`border-sky-400/15 bg-sky-400/[0.04] text-sky-200/75`,warning:`border-orange-400/20 bg-orange-400/[0.055] text-orange-200/80`,critical:`border-rose-400/25 bg-rose-400/[0.06] text-rose-200/85`};function en({alerts:e}){return e.length?(0,b.jsx)(`section`,{className:`mb-5 space-y-2`,"aria-label":`Mission health alerts`,children:e.map(e=>(0,b.jsxs)(`details`,{className:`rounded-xl border px-4 py-3 ${$t[e.severity]}`,children:[(0,b.jsxs)(`summary`,{className:`cursor-pointer text-sm font-medium`,children:[(0,b.jsx)(`span`,{className:`mr-2 text-[9px] uppercase tracking-wider opacity-60`,children:e.severity}),e.title]}),(0,b.jsxs)(`div`,{className:`mt-2 space-y-1.5 pl-12 text-xs leading-relaxed`,children:[(0,b.jsx)(`p`,{className:`text-white/50`,children:e.explanation}),(0,b.jsxs)(`p`,{className:`text-white/30`,children:[(0,b.jsx)(`span`,{className:`font-medium text-white/40`,children:`Evidence:`}),` `,e.evidence]}),(0,b.jsxs)(`p`,{className:`text-white/40`,children:[(0,b.jsx)(`span`,{className:`font-medium text-white/50`,children:`Suggested recovery:`}),` `,e.recovery]})]})]},e.id))}):null}function tn(e){let t=Math.max(0,Math.round(e/6e4));return t<60?`${t}m`:`${Math.floor(t/60)}h ${t%60}m`}function nn({events:e,workers:t,plan:n}){let r=(0,g.useMemo)(()=>{let r=Date.now(),i=[...e.map(e=>e.ts),...t.flatMap(e=>[e.startedAt,e.doneAt??e.jobUpdatedAt??r])],a=Math.min(...i),o=Math.max(...i,a+6e4),s=Math.max(1,o-a),c=e=>Math.max(0,Math.min(100,(e-a)/s*100)),l=[...e].sort((e,t)=>e.ts-t.ts),u=l.slice(1).map((e,t)=>({start:l[t].ts,end:e.ts})).filter(e=>e.end-e.start>=3e5),d=He(n),f=new Map(d.map(e=>[e.id,e])),p=new Map,m=new Map,h=[...d];for(let e=0;e<d.length+1&&h.length;e+=1)for(let e=h.length-1;e>=0;--e){let t=h[e],n=t.dependsOn.filter(e=>f.has(e));if(n.some(e=>!p.has(e)))continue;let r=0;for(let e of n)(p.get(e)??0)>r&&(r=p.get(e),m.set(t.id,e));p.set(t.id,r+t.weight),h.splice(e,1)}let g=[...d].sort((e,t)=>(p.get(t.id)??0)-(p.get(e.id)??0))[0]?.id,_=new Set;for(;g;)_.add(g),g=m.get(g);return{start:a,end:o,span:s,x:c,gaps:u,criticalWorkers:new Set(d.filter(e=>_.has(e.id)).map(e=>e.workerId??e.owner).filter(e=>!!e))}},[e,t,n]);if(!e.length&&!t.length)return(0,b.jsx)(`p`,{className:`text-sm text-white/40`,children:`No runtime data yet.`});let i=[{id:`manager`,label:`Manager`,events:e.filter(e=>!e.targetWorker)},...t.map(t=>({id:`${t.jobId}:${t.id}`,label:t.label,worker:t,events:e.filter(e=>e.targetWorker&&(e.targetWorker===t.id||t.label.toLowerCase().includes(e.targetWorker.toLowerCase())))}))];return(0,b.jsxs)(`div`,{children:[(0,b.jsxs)(`div`,{className:`mb-3 flex flex-wrap gap-3 text-[9px] text-white/25`,children:[(0,b.jsxs)(`span`,{children:[(0,b.jsx)(`span`,{className:`text-amber-300`,children:`━`}),` critical path worker`]}),(0,b.jsxs)(`span`,{children:[(0,b.jsx)(`span`,{className:`text-rose-300`,children:`▧`}),` blocked/bottleneck`]}),(0,b.jsxs)(`span`,{children:[(0,b.jsx)(`span`,{className:`text-white/20`,children:`▧`}),` idle gap ≥5m`]})]}),(0,b.jsx)(`div`,{className:`overflow-x-auto rounded-xl border border-white/[0.06] bg-black/15`,children:(0,b.jsxs)(`div`,{className:`min-w-[680px]`,children:[(0,b.jsxs)(`div`,{className:`grid grid-cols-[150px_1fr] border-b border-white/[0.06] px-3 py-2 text-[9px] text-white/20`,children:[(0,b.jsx)(`span`,{children:`Lane`}),(0,b.jsxs)(`div`,{className:`flex justify-between`,children:[(0,b.jsx)(`span`,{children:new Date(r.start).toLocaleTimeString()}),(0,b.jsx)(`span`,{children:tn(r.span)}),(0,b.jsx)(`span`,{children:new Date(r.end).toLocaleTimeString()})]})]}),i.map(e=>{let t=`worker`in e?e.worker:void 0,n=t?t.doneAt??t.jobUpdatedAt??Date.now():void 0,i=t?r.criticalWorkers.has(t.id)||r.criticalWorkers.has(t.label):!1,a=t?.jobState===`blocked`||e.events.some(e=>e.outcome===`failure`);return(0,b.jsxs)(`div`,{className:`grid min-h-12 grid-cols-[150px_1fr] border-b border-white/[0.04] px-3 last:border-0`,children:[(0,b.jsxs)(`div`,{className:`flex min-w-0 items-center pr-3`,children:[(0,b.jsx)(`span`,{className:`truncate text-[10px] text-white/45`,title:e.label,children:e.label}),i&&(0,b.jsx)(`span`,{className:`ml-1 text-amber-300`,children:`◆`})]}),(0,b.jsxs)(`div`,{className:`relative my-2 overflow-hidden rounded bg-white/[0.015]`,children:[r.gaps.map((e,t)=>(0,b.jsx)(`span`,{className:`absolute inset-y-0 bg-white/[0.025]`,style:{left:`${r.x(e.start)}%`,width:`${r.x(e.end)-r.x(e.start)}%`},title:`Idle gap ${tn(e.end-e.start)}`},t)),t&&(0,b.jsx)(`span`,{className:`absolute top-1/2 h-2 -translate-y-1/2 rounded-full ${a?`bg-rose-400/60`:i?`bg-amber-300/65`:t.doneAt?`bg-emerald-400/45`:`bg-violet-400/50`}`,style:{left:`${r.x(t.startedAt)}%`,width:`${Math.max(.7,r.x(n)-r.x(t.startedAt))}%`},title:`${t.label}: ${tn(n-t.startedAt)}`}),e.events.map((e,t)=>(0,b.jsx)(`span`,{className:`absolute top-1/2 h-2 w-2 -translate-x-1/2 -translate-y-1/2 rounded-full border border-black/40 ${e.outcome===`failure`?`bg-rose-400`:e.source===`custom`?`bg-violet-400`:`bg-white/45`}`,style:{left:`${r.x(e.ts)}%`},title:`${new Date(e.ts).toLocaleTimeString()} · ${e.detail}`},`${e.ts}:${t}`))]})]},e.id)})]})})]})}var rn=/(?:^|\s)\/([\w:-]+)/g;function an(e){return e?[...e.matchAll(rn)].map(e=>e[1]):[]}function on({messages:e,plan:t}){let n=[...new Map(e.flatMap(e=>an(e.text).map(t=>[`${e.role}:${t}`,{skill:t,role:e.role}]))).values()],r=He(t).flatMap(e=>[...new Set([...an(e.assignment),...an(e.context),...an(e.description)])].map(t=>({skill:t,task:e.title,worker:e.owner??e.workerId})));return!n.length&&!r.length?null:(0,b.jsxs)(`section`,{className:`rounded-2xl border border-white/10 bg-[#101014] p-4`,children:[(0,b.jsxs)(`div`,{className:`mb-3`,children:[(0,b.jsx)(`h2`,{className:`text-sm font-semibold text-white`,children:`Skills`}),(0,b.jsx)(`p`,{className:`mt-0.5 text-xs text-white/30`,children:`Explicit slash skills observed in requests and assignments`})]}),n.length>0&&(0,b.jsxs)(`div`,{children:[(0,b.jsx)(`p`,{className:`text-[9px] font-medium uppercase tracking-wider text-white/20`,children:`Invoked in conversation`}),(0,b.jsx)(`div`,{className:`mt-1.5 flex flex-wrap gap-1.5`,children:n.map(e=>(0,b.jsxs)(`span`,{className:`rounded-md border border-violet-300/10 bg-violet-300/[0.05] px-2 py-1 font-mono text-[10px] text-violet-200/55`,children:[`/`,e.skill,` `,(0,b.jsx)(`span`,{className:`ml-1 font-sans uppercase text-white/20`,children:e.role===`assistant`?`manager`:`you`})]},`${e.role}:${e.skill}`))})]}),r.length>0&&(0,b.jsxs)(`div`,{className:n.length?`mt-3`:``,children:[(0,b.jsx)(`p`,{className:`text-[9px] font-medium uppercase tracking-wider text-white/20`,children:`Assigned to workers`}),(0,b.jsx)(`ul`,{className:`mt-1.5 space-y-1.5`,children:r.map((e,t)=>(0,b.jsxs)(`li`,{className:`flex items-center gap-2 rounded-md bg-white/[0.02] px-2 py-1.5 text-[10px]`,children:[(0,b.jsxs)(`span`,{className:`font-mono text-violet-200/55`,children:[`/`,e.skill]}),(0,b.jsx)(`span`,{className:`truncate text-white/35`,children:e.task}),e.worker&&(0,b.jsx)(`span`,{className:`ml-auto shrink-0 text-amber-200/35`,children:e.worker})]},`${e.skill}:${e.task}:${t}`))})]})]})}function sn(e){return e>=100?`bg-rose-400`:e>=80?`bg-amber-400`:`bg-emerald-400`}function cn(e){return e<60?`${Math.round(e)}m`:`${Math.floor(e/60)}h ${Math.round(e%60)}m`}function ln({budgets:e,tokens:t,workers:n,elapsedMs:r}){if(!e||!Object.values(e).some(Boolean))return null;let i=n.filter(e=>!e.doneAt&&(e.jobState===`working`||e.jobState===`busy`)).length,a=[e.maxTokens?{label:`Tokens`,used:t,limit:e.maxTokens,display:`${t.toLocaleString()} / ${e.maxTokens.toLocaleString()}`}:void 0,e.maxElapsedMinutes?{label:`Elapsed`,used:r/6e4,limit:e.maxElapsedMinutes,display:`${cn(r/6e4)} / ${cn(e.maxElapsedMinutes)}`}:void 0,e.maxWorkers?{label:`Workers`,used:n.length,limit:e.maxWorkers,display:`${n.length} / ${e.maxWorkers}`}:void 0,e.maxConcurrentWorkers?{label:`Concurrent`,used:i,limit:e.maxConcurrentWorkers,display:`${i} / ${e.maxConcurrentWorkers}`}:void 0].filter(e=>!!e),o=r>6e4?t/(r/6e4):0,s=e.maxTokens&&o>0?Math.max(0,(e.maxTokens-t)/o):void 0;return(0,b.jsxs)(`section`,{className:`rounded-2xl border border-white/10 bg-[#101014] p-4`,children:[(0,b.jsxs)(`div`,{className:`mb-3 flex items-start justify-between gap-3`,children:[(0,b.jsxs)(`div`,{children:[(0,b.jsx)(`h2`,{className:`text-sm font-semibold text-white`,children:`Mission budgets`}),(0,b.jsx)(`p`,{className:`mt-0.5 text-xs text-white/30`,children:`Soft limits requiring approval to exceed`})]}),a.some(e=>e.used>=e.limit)&&(0,b.jsx)(`span`,{className:`rounded-full bg-rose-400/10 px-2 py-1 text-[9px] uppercase text-rose-200/65`,children:`Limit reached`})]}),(0,b.jsx)(`div`,{className:`space-y-3`,children:a.map(e=>{let t=Math.round(e.used/e.limit*100);return(0,b.jsxs)(`div`,{children:[(0,b.jsxs)(`div`,{className:`mb-1 flex justify-between text-[10px]`,children:[(0,b.jsx)(`span`,{className:`text-white/35`,children:e.label}),(0,b.jsxs)(`span`,{className:t>=100?`text-rose-300/70`:`text-white/45`,children:[e.display,` · `,t,`%`]})]}),(0,b.jsx)(`div`,{className:`h-1.5 overflow-hidden rounded-full bg-white/[0.06]`,children:(0,b.jsx)(`div`,{className:`h-full rounded-full ${sn(t)}`,style:{width:`${Math.min(100,t)}%`}})})]},e.label)})}),s!==void 0&&(0,b.jsxs)(`p`,{className:`mt-3 border-t border-white/[0.05] pt-2 text-[10px] text-white/25`,children:[`At the current average rate, the token budget has about `,cn(s),` remaining.`]})]})}function un({jobs:e}){return e?.length?(0,b.jsxs)(`details`,{className:`rounded-2xl border border-white/10 bg-[#101014] p-4`,children:[(0,b.jsxs)(`summary`,{className:`flex items-center justify-between text-sm font-semibold text-white/65`,children:[(0,b.jsx)(`span`,{children:`Claude job history`}),(0,b.jsxs)(`span`,{className:`font-normal text-[10px] text-white/25`,children:[e.length,` turn`,e.length===1?``:`s`]})]}),(0,b.jsx)(`p`,{className:`mt-2 text-[10px] leading-relaxed text-white/25`,children:`Advanced runtime lineage. Each follow-up creates a new Claude job while remaining part of this Hive mission.`}),(0,b.jsx)(`ol`,{className:`mt-3 space-y-2 border-l border-white/[0.07] pl-3`,children:e.map((e,t)=>(0,b.jsxs)(`li`,{className:`relative rounded-lg border border-white/[0.05] bg-black/10 px-3 py-2 before:absolute before:-left-[17px] before:top-3 before:h-2 before:w-2 before:rounded-full before:bg-violet-400/60`,children:[(0,b.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,b.jsxs)(`span`,{className:`font-mono text-[10px] text-white/50`,children:[t+1,`. `,e.jobId.slice(0,12)]}),(0,b.jsx)(`span`,{className:`text-[9px] uppercase text-white/25`,children:e.state})]}),(0,b.jsxs)(`div`,{className:`mt-1 flex flex-wrap gap-x-3 gap-y-1 text-[9px] text-white/22`,children:[e.createdAt&&(0,b.jsx)(`span`,{children:new Date(e.createdAt).toLocaleString()}),(0,b.jsxs)(`span`,{children:[e.tokens.toLocaleString(),` tokens`]}),e.sessionId&&(0,b.jsxs)(`span`,{className:`font-mono`,children:[`session `,e.sessionId.slice(0,8)]}),e.resumedFrom&&(0,b.jsxs)(`span`,{className:`font-mono text-violet-300/35`,children:[`resumed `,e.resumedFrom.slice(0,8)]})]})]},e.jobId))})]}):null}function dn({missionId:e}){let[t,n]=(0,g.useState)(!1),[r,i]=(0,g.useState)(),[a,o]=(0,g.useState)(!1),[s,c]=(0,g.useState)(),[l,u]=(0,g.useState)(!1),[d,f]=(0,g.useState)(!1);async function p(){if(t){n(!1);return}if(n(!0),!r){o(!0);try{i(await he(e))}catch(e){c(e.message)}finally{o(!1)}}}async function m(){f(!0),c(void 0);try{await ge(e),u(!1),i(void 0)}catch(e){c(e.message)}finally{f(!1)}}return(0,b.jsxs)(`section`,{className:`rounded-2xl border border-white/10 bg-[#101014] p-4`,children:[(0,b.jsxs)(`button`,{onClick:p,className:`flex w-full items-center justify-between text-left`,children:[(0,b.jsxs)(`span`,{children:[(0,b.jsx)(`span`,{className:`block text-sm font-semibold text-white/65`,children:`Manager handoff context`}),(0,b.jsx)(`span`,{className:`mt-0.5 block text-xs text-white/30`,children:`Preview the bounded history a replacement manager receives`})]}),(0,b.jsx)(`span`,{className:`text-xs text-white/25`,children:t?`−`:`+`})]}),t&&(0,b.jsxs)(`div`,{className:`mt-3 border-t border-white/[0.06] pt-3`,children:[a&&(0,b.jsx)(`p`,{className:`text-xs text-white/25`,children:`Building preview…`}),s&&(0,b.jsx)(`p`,{className:`text-xs text-rose-400`,children:s}),r&&(0,b.jsxs)(`div`,{className:`space-y-3`,children:[(0,b.jsx)(`div`,{className:`grid grid-cols-3 gap-2`,children:[[`Summary`,r.estimatedTokens.summary,r.budgets.summaryTokens],[`Recent`,r.estimatedTokens.recent,r.budgets.recentTokens],[`Retrieved`,r.estimatedTokens.retrieved,r.budgets.retrievedTokens]].map(([e,t,n])=>(0,b.jsxs)(`div`,{className:`rounded-lg bg-white/[0.025] p-2`,children:[(0,b.jsxs)(`p`,{className:`text-xs font-medium text-white/55`,children:[`~`,t,` / `,n]}),(0,b.jsxs)(`p`,{className:`mt-0.5 text-[8px] uppercase tracking-wider text-white/20`,children:[e,` tokens`]})]},e))}),(0,b.jsxs)(`div`,{children:[(0,b.jsx)(`p`,{className:`text-[9px] uppercase tracking-wider text-white/20`,children:`Compact mission state`}),(0,b.jsxs)(`p`,{className:`mt-1.5 whitespace-pre-wrap text-[10px] leading-relaxed text-white/40`,children:[r.mission.compactSummary??`No checkpoint summary published yet.`,r.mission.currentState?`\nCurrent state: ${r.mission.currentState}`:``]})]}),(0,b.jsxs)(`div`,{children:[(0,b.jsxs)(`p`,{className:`text-[9px] uppercase tracking-wider text-white/20`,children:[`Recent messages · `,r.recentMessages.length]}),(0,b.jsx)(`ul`,{className:`mt-1 space-y-1`,children:r.recentMessages.map(e=>(0,b.jsxs)(`li`,{className:`line-clamp-2 text-[10px] text-white/30`,children:[(0,b.jsxs)(`span`,{className:`text-white/18`,children:[e.role,`:`]}),` `,e.text]},e.id))})]}),(0,b.jsxs)(`div`,{children:[(0,b.jsxs)(`p`,{className:`text-[9px] uppercase tracking-wider text-white/20`,children:[`Relevant older messages · `,r.retrievedMessages.length]}),r.retrievedMessages.length?(0,b.jsx)(`ul`,{className:`mt-1 space-y-1`,children:r.retrievedMessages.map(e=>(0,b.jsxs)(`li`,{className:`line-clamp-2 text-[10px] text-white/30`,children:[(0,b.jsxs)(`span`,{className:`text-white/18`,children:[e.role,`:`]}),` `,e.text]},e.id))}):(0,b.jsx)(`p`,{className:`mt-1 text-[10px] text-white/20`,children:`No older messages were relevant enough to include.`})]}),(0,b.jsx)(`div`,{className:`border-t border-white/[0.06] pt-3`,children:l?(0,b.jsxs)(`div`,{className:`rounded-lg border border-amber-300/10 bg-amber-300/[0.035] p-2.5`,children:[(0,b.jsx)(`p`,{className:`text-[10px] leading-relaxed text-amber-100/55`,children:`Gracefully stop the current manager if it is active and start a fresh manager with exactly the context shown above? Mission identity, plan, conversation, and outputs remain unchanged.`}),(0,b.jsxs)(`div`,{className:`mt-2 flex justify-end gap-2`,children:[(0,b.jsx)(`button`,{onClick:()=>u(!1),className:`px-2 py-1 text-[10px] text-white/35`,children:`Cancel`}),(0,b.jsx)(`button`,{disabled:d,onClick:m,className:`rounded-md bg-amber-300 px-2 py-1.5 text-[10px] font-semibold text-[#291b05] disabled:opacity-40`,children:d?`Replacing…`:`Confirm handoff`})]})]}):(0,b.jsx)(`button`,{onClick:()=>u(!0),className:`rounded-md border border-amber-300/15 px-2.5 py-1.5 text-[10px] text-amber-200/55 hover:bg-amber-300/[0.05]`,children:`Replace manager with this context`})})]})]})]})}function fn({missionId:e}){let[t,n]=(0,g.useState)(!1),[r,i]=(0,g.useState)(!1),[a,o]=(0,g.useState)(`pr`),[s,c]=(0,g.useState)(``),[l,u]=(0,g.useState)(null),[d,f]=(0,g.useState)(!1);async function p(){if(!(!s.trim()||t)){n(!0),u(null),f(!1);try{await ve(e,a,s.trim()),f(!0),i(!1)}catch(e){u(e.message)}finally{n(!1)}}}return(0,b.jsxs)(`section`,{className:`rounded-2xl border border-white/10 bg-[#101014] p-4`,children:[(0,b.jsx)(`h2`,{className:`text-sm font-semibold text-white`,children:`Mission report`}),(0,b.jsx)(`p`,{className:`mt-1 text-xs leading-relaxed text-white/30`,children:`Export the request, plan, decisions, workers, changes, verification, outputs, usage, conversation, and remaining risks. Reports include a deep link back to this mission.`}),(0,b.jsxs)(`div`,{className:`mt-3 flex flex-wrap gap-2`,children:[(0,b.jsx)(`a`,{href:_e(e,`markdown`),download:!0,className:`rounded-lg border border-white/10 bg-white/[0.025] px-3 py-2 text-xs text-white/50 hover:border-amber-300/15 hover:text-amber-200`,children:`Download Markdown`}),(0,b.jsx)(`a`,{href:_e(e,`json`),download:!0,className:`rounded-lg border border-white/10 bg-white/[0.025] px-3 py-2 text-xs text-white/50 hover:border-violet-300/15 hover:text-violet-200`,children:`Download JSON`}),(0,b.jsx)(`button`,{onClick:()=>{i(!r),u(null),f(!1)},className:`rounded-lg border border-sky-300/10 bg-sky-300/[0.025] px-3 py-2 text-xs text-sky-200/50 hover:border-sky-300/20 hover:text-sky-200/75`,children:`Post to GitHub…`})]}),r&&(0,b.jsxs)(`div`,{className:`mt-3 rounded-xl border border-amber-300/10 bg-amber-300/[0.025] p-3`,children:[(0,b.jsxs)(`p`,{className:`text-[10px] leading-relaxed text-amber-100/50`,children:[`This is externally visible. Hive will use your locally authenticated `,(0,b.jsx)(`span`,{className:`font-mono`,children:`gh`}),` CLI and record both approval and outcome in the mission timeline.`]}),(0,b.jsxs)(`div`,{className:`mt-2 flex gap-2`,children:[(0,b.jsxs)(`select`,{value:a,onChange:e=>o(e.target.value),className:`rounded-lg border border-white/10 bg-[#17171c] px-2 py-2 text-xs text-white/55`,children:[(0,b.jsx)(`option`,{value:`pr`,children:`Pull request`}),(0,b.jsx)(`option`,{value:`issue`,children:`Issue`})]}),(0,b.jsx)(`input`,{value:s,onChange:e=>c(e.target.value),placeholder:`#123 or GitHub URL`,className:`min-w-0 flex-1 rounded-lg border border-white/10 bg-black/20 px-3 py-2 text-xs text-white/65 outline-none placeholder:text-white/20 focus:border-amber-300/20`}),(0,b.jsx)(`button`,{onClick:()=>i(!1),className:`px-2 text-xs text-white/30`,children:`Cancel`}),(0,b.jsx)(`button`,{onClick:()=>void p(),disabled:!s.trim()||t,className:`rounded-lg bg-amber-300 px-3 py-2 text-xs font-semibold text-[#291a04] disabled:opacity-35`,children:t?`Publishing…`:`Confirm publish`})]})]}),l&&(0,b.jsxs)(`p`,{className:`mt-2 text-[10px] text-rose-400`,children:[`Publish failed: `,l,`. Verify `,(0,b.jsx)(`span`,{className:`font-mono`,children:`gh auth status`}),`, the target, and repository access, then retry.`]}),d&&(0,b.jsx)(`p`,{className:`mt-2 text-[10px] text-emerald-300/60`,children:`Report published and recorded in the mission timeline.`})]})}function pn({missionId:e,initial:t}){let[n,r]=(0,g.useState)(t),[i,a]=(0,g.useState)(!1),[o,s]=(0,g.useState)();if(!n)return(0,b.jsxs)(`section`,{className:`rounded-2xl border border-white/10 bg-[#101014] p-4`,children:[(0,b.jsx)(`h2`,{className:`text-sm font-semibold text-white`,children:`Permission policy`}),(0,b.jsx)(`p`,{className:`mt-2 text-xs text-white/30`,children:`This recovered mission predates mission policies. Its next handoff can adopt the workspace defaults.`})]});async function c(){if(window.confirm(`Apply these permission changes to future turns of this mission? Expanding access is an explicit approval.`))try{let t=await xe(e,n);r(t.policy),a(!1)}catch(e){s(e.message)}}let l=[[`Network`,n.networkAccess],[`Commits`,n.commits],[`Pushes`,n.pushes],[`PRs`,n.pullRequests],[`Releases`,n.releases],[`Destructive`,n.destructiveActions]];return(0,b.jsxs)(`section`,{className:`rounded-2xl border border-white/10 bg-[#101014] p-4`,children:[(0,b.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,b.jsx)(`h2`,{className:`text-sm font-semibold text-white`,children:`Permission policy`}),(0,b.jsx)(`button`,{onClick:()=>a(!i),className:`rounded-lg border border-white/10 px-2.5 py-1 text-[10px] text-white/45 hover:bg-white/5`,children:i?`Cancel`:`Edit override`})]}),i?(0,b.jsxs)(`div`,{className:`mt-4`,children:[(0,b.jsx)(Qe,{value:n,onChange:r}),o&&(0,b.jsx)(`p`,{className:`mt-2 text-xs text-rose-300`,children:o}),(0,b.jsx)(`button`,{onClick:()=>void c(),className:`mt-3 rounded-lg bg-amber-300 px-3 py-2 text-xs font-semibold text-black`,children:`Review and apply`})]}):(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(`div`,{className:`mt-3 flex flex-wrap gap-1.5`,children:l.map(([e,t])=>(0,b.jsxs)(`span`,{className:`rounded px-2 py-1 text-[10px] ${t?`bg-emerald-300/[0.07] text-emerald-200/50`:`bg-white/[0.03] text-white/25`}`,children:[e,`: `,t?`allowed`:`blocked`]},e))}),(0,b.jsxs)(`p`,{className:`mt-3 text-[10px] text-white/25`,children:[n.allowedRoots.length?`Restricted to ${n.allowedRoots.join(`, `)}`:`Any working directory`,` · `,n.allowedTools.length?`${n.allowedTools.length} explicitly allowed tools`:`normal tool set`]})]})]})}function mn(e){let t=Math.max(0,Math.floor(e/1e3)),n=Math.floor(t/3600),r=Math.floor(t%3600/60);return n?`${n}h ${r}m`:`${r}m ${t%60}s`}function hn({label:e,value:t,accent:n}){return(0,b.jsxs)(`div`,{className:`rounded-xl border border-white/8 bg-white/[0.025] px-4 py-3`,children:[(0,b.jsx)(`p`,{className:`text-lg font-semibold ${n??`text-white/85`}`,children:t}),(0,b.jsx)(`p`,{className:`mt-0.5 text-[10px] font-medium uppercase tracking-wider text-white/25`,children:e})]})}function gn(e){return e.split(`/.claude/worktrees/`)[0].split(`/`).at(-1)??e}function _n({node:e,decisions:t=[],onBack:n}){let[r,i]=(0,g.useState)({});(0,g.useEffect)(()=>{Se().then(({providers:e})=>i(Object.fromEntries(e.flatMap(e=>e.defaultModel?[[e.provider,e.defaultModel.label]]:[])))).catch(()=>i({}))},[]);let a=r[e.mission.provider??`claude`],[o,s]=(0,g.useState)(Date.now()),[c,l]=(0,g.useState)(null),[u,d]=(0,g.useState)(`feed`),[f,p]=(0,g.useState)(`conversation`);(0,g.useEffect)(()=>{let e=setInterval(()=>s(Date.now()),1e3);return()=>clearInterval(e)},[]);let m=e.workers.filter(e=>!e.doneAt&&(e.jobState===`working`||e.jobState===`busy`)).length,h=e.status===`working`?o:e.updatedAt;return(0,b.jsx)(`div`,{className:`min-h-screen bg-[radial-gradient(circle_at_top_left,rgba(124,58,237,0.08),transparent_35%)]`,children:(0,b.jsxs)(`div`,{className:`mx-auto max-w-7xl px-5 py-8 lg:px-8`,children:[(0,b.jsxs)(`button`,{onClick:n,className:`mb-6 flex items-center gap-2 text-sm text-white/35 transition hover:text-amber-200/80`,children:[(0,b.jsx)(Pe,{compact:!0}),(0,b.jsx)(`span`,{children:`← Fleet`})]}),(0,b.jsxs)(`header`,{className:`mb-6 flex flex-wrap items-start justify-between gap-4`,children:[(0,b.jsxs)(`div`,{className:`min-w-0`,children:[(0,b.jsx)(Te,{missionId:e.missionId,name:e.name,large:!0}),(0,b.jsxs)(`div`,{className:`mt-2 flex flex-wrap items-center gap-2 text-xs text-white/30`,children:[(0,b.jsxs)(`span`,{className:`mono`,children:[`mission `,e.missionId.slice(0,8)]}),(0,b.jsx)(`span`,{children:`·`}),(0,b.jsx)(`span`,{className:`capitalize`,children:e.mission.mode}),(0,b.jsx)(`span`,{className:`rounded px-1.5 py-0.5 text-[9px] font-semibold uppercase ${e.mission.provider===`codex`?`bg-emerald-300/[0.09] text-emerald-200/60`:`bg-violet-300/[0.09] text-violet-200/60`}`,children:e.mission.provider??`claude`}),(0,b.jsx)(`span`,{className:`mono rounded bg-white/[0.04] px-1.5 py-0.5 text-[10px] text-white/40`,children:e.mission.model??(a?`CLI default (${a})`:`CLI default`)}),e.mission.repository&&(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(`span`,{children:`·`}),(0,b.jsx)(`span`,{className:`mono text-white/40`,title:e.mission.repository,children:gn(e.mission.repository)})]}),e.mission.additionalRepositories?.map(e=>(0,b.jsxs)(`span`,{className:`mono rounded bg-sky-300/[0.06] px-1.5 py-0.5 text-[10px] text-sky-200/50`,title:e,children:[`+ `,gn(e)]},e)),e.mission.template&&(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(`span`,{children:`·`}),(0,b.jsxs)(`span`,{className:`text-amber-200/50`,children:[e.mission.template.name,` v`,e.mission.template.version,` · `,e.mission.template.source]})]}),e.worktreeBranch&&(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(`span`,{children:`·`}),(0,b.jsx)(`span`,{className:`mono text-violet-300/60`,children:e.worktreeBranch})]})]})]}),(0,b.jsxs)(`div`,{className:`flex flex-wrap items-center justify-end gap-2`,children:[(0,b.jsx)(De,{status:e.lifecycleStatus}),(0,b.jsx)(S,{status:e.activityStatus}),(0,b.jsx)(Le,{pid:e.pid,status:e.activityStatus}),(0,b.jsx)(Ot,{missionId:e.missionId,status:e.lifecycleStatus,onDeleted:n})]})]}),e.activityStatus===`stalled`&&(0,b.jsxs)(`div`,{className:`mb-5 rounded-xl border border-orange-400/20 bg-orange-400/[0.06] px-4 py-3 text-sm text-orange-200/80`,children:[`Hive expected work to continue, but there has been no meaningful activity for `,mn(e.inactiveForMs),`. Check the health evidence, request status, or pause the mission if the inactivity is intentional.`]}),e.activityStatus===`idle`&&e.lifecycleStatus===`active`&&(0,b.jsx)(`div`,{className:`mb-5 rounded-xl border border-slate-400/10 bg-slate-400/[0.04] px-4 py-3 text-sm text-slate-300/70`,children:e.turnCompleted?`The latest ${e.mission.provider===`codex`?`Codex`:`Claude`} turn finished normally. This mission remains open for follow-up or manual completion.`:`The mission is open, but no orchestrator or worker is currently doing work.`}),e.lifecycleStatus===`ready_for_review`&&(0,b.jsxs)(`div`,{className:`mb-5 rounded-xl border border-amber-300/20 bg-amber-300/[0.06] px-4 py-3`,children:[(0,b.jsx)(`p`,{className:`text-sm font-medium text-amber-100/80`,children:`Ready for your acceptance`}),(0,b.jsx)(`p`,{className:`mt-1 text-xs leading-relaxed text-amber-100/55`,children:`The orchestrator reports that the planned work and required verification are complete. Review the plan evidence, then accept completion or request changes from the mission actions.`})]}),(0,b.jsx)(en,{alerts:e.alerts??[]}),(0,b.jsxs)(`div`,{className:`mb-6 grid grid-cols-2 gap-3 sm:grid-cols-4`,children:[(0,b.jsx)(hn,{label:`This turn`,value:mn(h-e.runStartedAt)}),(0,b.jsx)(hn,{label:`Workers`,value:`${e.workers.length}`,accent:m?`text-amber-300`:void 0}),(0,b.jsx)(hn,{label:`Active now`,value:`${m}`,accent:m?`text-amber-300`:void 0}),(0,b.jsx)(hn,{label:`Tokens`,value:e.tokens.toLocaleString()})]}),(0,b.jsx)(`nav`,{"aria-label":`Mission views`,className:`mb-6 flex w-fit max-w-full overflow-x-auto rounded-xl border border-white/[0.07] bg-black/15 p-1`,children:[[`conversation`,`Conversation`],[`work`,`Plan & workers`],[`activity`,`Activity`],[`technical`,`Technical`]].map(([e,t])=>(0,b.jsxs)(`button`,{onClick:()=>p(e),"aria-current":f===e?`page`:void 0,className:`whitespace-nowrap rounded-lg px-4 py-2 text-xs font-medium transition ${f===e?`bg-amber-300/[0.1] text-amber-100/75 shadow-inner`:`text-white/30 hover:bg-white/[0.035] hover:text-white/55`}`,children:[t,e===`work`&&m>0?` · ${m} active`:``]},e))}),f===`conversation`&&(0,b.jsxs)(`div`,{className:`space-y-4`,children:[(0,b.jsx)(Ie,{decisions:t,onOpenMission:()=>void 0,showMission:!1}),(0,b.jsx)(ut,{prs:e.prs,messages:e.messages}),e.detail&&(0,b.jsxs)(`details`,{className:`rounded-xl border border-white/[0.07] bg-white/[0.018] px-4 py-3`,children:[(0,b.jsx)(`summary`,{className:`cursor-pointer text-xs font-medium text-white/35`,children:`Orchestrator note · narrative, not progress evidence`}),(0,b.jsx)(`p`,{className:`mt-2 text-sm leading-relaxed text-white/50`,children:e.detail}),(0,b.jsx)(`p`,{className:`mt-2 text-[10px] text-white/20`,children:`Use Plan & workers for structured status, completion gates, and verification evidence.`})]}),(0,b.jsx)(Dt,{missionId:e.missionId,repository:e.mission.repository,messages:e.messages,hasMoreMessages:e.hasMoreMessages,live:{status:e.activityStatus,lifecycle:e.lifecycleStatus,detail:e.detail,waitingFor:e.waitingFor,workers:e.workers,inFlight:e.inFlight,prs:e.prs}})]}),f===`work`&&(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(Jt,{missionId:e.missionId,plan:e.plan,objective:e.mission.objective,missionAcceptanceCriteria:e.mission.acceptanceCriteria,workers:e.workers,missionUpdatedAt:e.updatedAt}),(0,b.jsxs)(`div`,{className:`grid items-start gap-6 lg:grid-cols-2`,children:[(0,b.jsxs)(`div`,{className:`space-y-6`,children:[(0,b.jsx)(ln,{budgets:e.mission.budgets,tokens:e.tokens,workers:e.workers,elapsedMs:Math.max(0,h-e.createdAt)}),(0,b.jsxs)(`section`,{className:`rounded-2xl border border-white/10 bg-[#101014] p-4`,children:[(0,b.jsxs)(`div`,{className:`mb-4 flex items-center justify-between`,children:[(0,b.jsxs)(`div`,{children:[(0,b.jsx)(`h2`,{className:`text-sm font-semibold text-white`,children:`Workers`}),(0,b.jsx)(`p`,{className:`mt-0.5 text-xs text-white/30`,children:`Delegated tasks and runtime`})]}),m>0&&(0,b.jsxs)(`span`,{className:`rounded-full bg-amber-400/10 px-2 py-1 text-[10px] font-medium text-amber-300`,children:[m,` active`]})]}),(0,b.jsx)(T,{workers:e.workers,onSelect:l}),(e.inFlight.tasks>0||e.inFlight.queued>0)&&(0,b.jsxs)(`div`,{className:`mt-3 flex gap-3 rounded-lg bg-white/[0.03] px-3 py-2 text-xs text-white/35`,children:[(0,b.jsxs)(`span`,{children:[e.inFlight.tasks,` in flight`]}),(0,b.jsxs)(`span`,{children:[e.inFlight.queued,` queued`]})]})]})]}),(0,b.jsxs)(`div`,{className:`space-y-6`,children:[(0,b.jsx)(ut,{prs:e.prs,messages:e.messages}),(0,b.jsx)(on,{messages:e.messages,plan:e.plan})]})]})]}),f===`activity`&&(0,b.jsxs)(`section`,{className:`rounded-2xl border border-white/10 bg-[#101014] p-5`,children:[(0,b.jsxs)(`div`,{className:`mb-4 flex flex-wrap items-start justify-between gap-3`,children:[(0,b.jsxs)(`div`,{children:[(0,b.jsx)(`h2`,{className:`text-sm font-semibold text-white`,children:`Activity timeline`}),(0,b.jsx)(`p`,{className:`mt-0.5 text-xs text-white/30`,children:`Orchestrator transitions, tools, workers, gaps, and bottlenecks`})]}),(0,b.jsx)(`div`,{className:`inline-flex rounded-lg border border-white/[0.06] bg-black/15 p-0.5`,children:[`feed`,`parallel`].map(e=>(0,b.jsx)(`button`,{onClick:()=>d(e),className:`rounded-md px-2.5 py-1 text-[9px] font-medium uppercase tracking-wider ${u===e?`bg-white/[0.08] text-white/65`:`text-white/25 hover:text-white/45`}`,children:e},e))})]}),u===`feed`?(0,b.jsx)(yt,{events:e.recentEvents}):(0,b.jsx)(nn,{events:e.recentEvents,workers:e.workers,plan:e.plan})]}),f===`technical`&&(0,b.jsxs)(`div`,{className:`grid items-start gap-6 lg:grid-cols-2`,children:[(0,b.jsxs)(`div`,{className:`space-y-6`,children:[(0,b.jsxs)(`section`,{className:`rounded-2xl border border-white/10 bg-[#101014] p-4`,children:[(0,b.jsx)(`h2`,{className:`text-sm font-semibold text-white`,children:`Runtime identity`}),(0,b.jsx)(`p`,{className:`mt-2 text-xs leading-relaxed text-white/35`,children:`Hive keeps one durable mission while Claude creates a new background job for each follow-up turn. These identifiers are diagnostic details and do not change the conversation.`}),(0,b.jsxs)(`dl`,{className:`mt-3 grid grid-cols-[110px_1fr] gap-y-2 text-xs`,children:[(0,b.jsx)(`dt`,{className:`text-white/25`,children:`Mission ID`}),(0,b.jsx)(`dd`,{className:`font-mono text-white/50`,children:e.missionId}),(0,b.jsx)(`dt`,{className:`text-white/25`,children:`Current job`}),(0,b.jsx)(`dd`,{className:`font-mono text-white/50`,children:e.jobId}),(0,b.jsx)(`dt`,{className:`text-white/25`,children:`Process ID`}),(0,b.jsx)(`dd`,{className:`font-mono text-white/50`,children:e.pid>=0?e.pid:`not running`}),(0,b.jsx)(`dt`,{className:`text-white/25`,children:`Job turns`}),(0,b.jsx)(`dd`,{className:`text-white/50`,children:e.jobIds.length})]})]}),(0,b.jsx)(pn,{missionId:e.missionId,initial:e.mission.policy}),(0,b.jsx)(un,{jobs:e.jobHistory})]}),(0,b.jsxs)(`div`,{className:`space-y-6`,children:[(0,b.jsx)(dn,{missionId:e.missionId}),(0,b.jsx)(fn,{missionId:e.missionId})]})]}),c&&(0,b.jsx)(Qt,{missionId:e.missionId,worker:e.workers.find(e=>e.id===c.id&&e.jobId===c.jobId)??c,plan:e.plan,events:e.recentEvents,onClose:()=>l(null)})]})})}function vn(e){let t=typeof Notification<`u`,[n,r]=(0,g.useState)(()=>t&&Notification.permission===`granted`&&localStorage.getItem(`hive:decision-notifications`)===`on`),i=(0,g.useRef)(null);(0,g.useEffect)(()=>{if(!i.current){i.current=new Set(e.map(e=>e.id));return}for(let t of e)i.current.has(t.id)||(i.current.add(t.id),n&&Notification.permission===`granted`&&new Notification(`Hive · ${t.missionName}`,{body:t.question,tag:`hive-decision:${t.id}`}))},[e,n]);async function a(){if(t){if(n){r(!1),localStorage.setItem(`hive:decision-notifications`,`off`);return}(Notification.permission===`granted`?`granted`:await Notification.requestPermission())===`granted`&&(r(!0),localStorage.setItem(`hive:decision-notifications`,`on`))}}return{supported:t,enabled:n,toggle:a}}var yn;function bn(){try{return yn??=new AudioContext,yn.state===`suspended`&&yn.resume(),yn}catch{return}}function xn(e,t,n,r){let i=e.createOscillator(),a=e.createGain();i.type=`sine`,i.frequency.value=t,a.gain.setValueAtTime(0,n),a.gain.linearRampToValueAtTime(.07,n+.015),a.gain.exponentialRampToValueAtTime(5e-4,n+r),i.connect(a).connect(e.destination),i.start(n),i.stop(n+r+.05)}function Sn(){let e=bn();if(!e)return;let t=e.currentTime;xn(e,659.25,t,.16),xn(e,880,t+.14,.22)}function Cn(){let e=bn();if(!e)return;let t=e.currentTime;xn(e,523.25,t,.18),xn(e,659.25,t+.13,.18),xn(e,783.99,t+.26,.3)}function wn(e){let[t,n]=(0,g.useState)(()=>typeof window<`u`&&localStorage.getItem(`hive:sounds`)===`on`),r=(0,g.useRef)(null);return(0,g.useEffect)(()=>{if(!e)return;let n=new Map(e.orchestrators.map(e=>[e.missionId,{activity:e.activityStatus,lifecycle:e.lifecycleStatus}])),i=r.current;if(r.current=n,!i||!t)return;let a=!1,o=!1;for(let[e,t]of n){let n=i.get(e);t.lifecycle===`ready_for_review`&&n?.lifecycle!==`ready_for_review`?o=!0:t.activity===`waiting_on_you`&&n?.activity!==`waiting_on_you`&&(a=!0)}o&&Cn(),a&&window.setTimeout(Sn,o?700:0)},[e,t]),{enabled:t,toggle:()=>n(e=>{let t=!e;try{localStorage.setItem(`hive:sounds`,t?`on`:`off`)}catch{}return t&&Sn(),t})}}function Tn(){let{snapshot:e,connected:t,lastDisconnectedAt:n,reconnect:r}=v(),[i,a]=(0,g.useState)(()=>typeof window>`u`?null:new URLSearchParams(window.location.search).get(`mission`)),o=vn(e?.decisions??[]),s=wn(e??void 0),c=e=>{if(a(e),typeof window<`u`){let t=new URL(window.location.href);e?t.searchParams.set(`mission`,e):t.searchParams.delete(`mission`),window.history.replaceState({},``,t)}};if(!e)return(0,b.jsx)(`div`,{className:`flex h-screen items-center justify-center px-6`,children:(0,b.jsxs)(`div`,{className:`max-w-md rounded-2xl border border-white/10 bg-white/[0.025] p-6 text-center`,children:[(0,b.jsx)(`p`,{className:`text-sm font-medium text-white/55`,children:t?`Loading fleet…`:`Connecting to Hive…`}),(0,b.jsx)(`p`,{className:`mt-2 text-xs leading-relaxed text-white/25`,children:t?`The server is connected and preparing the durable mission snapshot.`:`Make sure npm run dev is running. Hive will retry automatically.`}),!t&&(0,b.jsx)(`button`,{onClick:r,className:`mt-4 rounded-lg border border-amber-300/15 bg-amber-300/[0.05] px-3 py-2 text-xs text-amber-200/60 hover:bg-amber-300/[0.09]`,children:`Retry now`})]})});let l=i?e.orchestrators.find(e=>e.missionId===i):void 0;return l?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(En,{connected:t,lastDisconnectedAt:n,reconnect:r}),(0,b.jsx)(_n,{node:l,decisions:(e.decisions??[]).filter(e=>e.missionId===l.missionId),onBack:()=>c(null)})]}):(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(En,{connected:t,lastDisconnectedAt:n,reconnect:r}),(0,b.jsx)(rt,{snapshot:e,onSelectOrchestrator:e=>c(e),notifications:o,sounds:s})]})}function En({connected:e,lastDisconnectedAt:t,reconnect:n}){return e?null:(0,b.jsxs)(`div`,{role:`status`,className:`sticky top-0 z-40 flex flex-wrap items-center justify-center gap-2 border-b border-orange-300/15 bg-[#261a0f]/95 px-4 py-2 text-xs text-orange-100/65 backdrop-blur`,children:[(0,b.jsxs)(`span`,{children:[`Live updates disconnected`,t?` at ${new Date(t).toLocaleTimeString()}`:``,`. Showing the last durable snapshot.`]}),(0,b.jsx)(`button`,{onClick:n,className:`rounded-md border border-orange-200/15 px-2 py-1 text-[10px] font-medium text-orange-100/70 hover:bg-orange-200/[0.08]`,children:`Reconnect now`}),(0,b.jsx)(`span`,{className:`text-orange-100/30`,children:`If this persists, restart npm run dev; mission data remains on disk.`})]})}h.createRoot(document.getElementById(`root`)).render((0,b.jsx)(g.StrictMode,{children:(0,b.jsx)(Tn,{})}));