cli-jaw 2.0.16 → 2.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 (30) hide show
  1. package/README.md +8 -8
  2. package/dist/bin/cli-jaw.js +5 -1
  3. package/dist/bin/cli-jaw.js.map +1 -1
  4. package/dist/bin/commands/goal.js +146 -0
  5. package/dist/bin/commands/goal.js.map +1 -0
  6. package/dist/src/agent/lifecycle-handler.js +3 -3
  7. package/dist/src/agent/lifecycle-handler.js.map +1 -1
  8. package/dist/src/goal/heartbeat.js +2 -2
  9. package/dist/src/goal/heartbeat.js.map +1 -1
  10. package/dist/src/prompt/templates/a1-system.md +12 -0
  11. package/package.json +1 -1
  12. package/public/dist/assets/{BrowserPanel-weeCb2qu.js → BrowserPanel-C15ysPhL.js} +1 -1
  13. package/public/dist/assets/{TerminalPanel-AKKXu8dJ.js → TerminalPanel-DFmSkwGU.js} +1 -1
  14. package/public/dist/assets/manager-CfyZloIP.js +12 -0
  15. package/public/dist/assets/manager-DyrwJLZr.css +1 -0
  16. package/public/dist/manager/index.html +2 -2
  17. package/public/manager/src/App.tsx +43 -0
  18. package/public/manager/src/browser-panel/BrowserPanel.tsx +28 -0
  19. package/public/manager/src/components/WorkspaceLayout.tsx +3 -9
  20. package/public/manager/src/manager-layout.css +3 -3
  21. package/public/manager/src/manager-shortcuts.ts +31 -1
  22. package/public/manager/src/panels/PanelLayoutProvider.tsx +6 -1
  23. package/public/manager/src/panels/panel-shortcut-bus.ts +4 -2
  24. package/public/manager/src/panels/panels.css +0 -1
  25. package/public/manager/src/panels/types.ts +2 -2
  26. package/public/manager/src/terminal/TerminalPanel.tsx +16 -0
  27. package/public/manager/src/types.ts +16 -1
  28. package/scripts/release.sh +34 -13
  29. package/public/dist/assets/manager-CFxbpg7j.css +0 -1
  30. package/public/dist/assets/manager-wAHlX68t.js +0 -12
@@ -1,12 +0,0 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/vendor-render-Bjnw0wQ6.css","assets/TerminalPanel-DdE69MNo.css","assets/DiffPanel-BHvC0wCX.css","assets/FolderPanel-XCno5AI9.css","assets/DocPanel-CL1scIfq.css","assets/BrowserPanel-BN01Lfc5.css"])))=>i.map(i=>d[i]);
2
- import{r as e,t}from"./rolldown-runtime-XQCOJYun.js";import"./vendor-render-DCb9B75Q.js";import{t as n}from"./preload-helper-DuH3-WbD.js";import{a as r,i,n as a,r as o,t as s}from"./esm-BmJkIat2.js";import{n as c,t as l}from"./jsx-runtime-BZmCptaP.js";import{C as u,D as d,E as f,O as p,S as m,T as h,_ as g,a as _,b as v,c as y,d as b,f as x,g as S,h as ee,i as te,l as C,m as w,n as T,o as ne,p as E,r as re,s as ie,t as ae,u as oe,v as D,w as O,x as se,y as ce}from"./api-30EcU_Lb.js";import{n as le}from"./settings-client-DPuJroyk.js";import{t as ue}from"./error-normalize-CNbPE4lO.js";import{n as k,t as A}from"./desktop-bridge-CrqidwSb.js";import{N as de}from"./wiki-link-resolver-CQwLeKpN.js";import{$ as fe,At as pe,Ct as me,D as he,Et as ge,It as _e,L as j,N as ve,Ot as ye,Q as be,St as xe,Y as Se,Z as Ce,_t as we,a as M,at as N,c as Te,ct as Ee,dt as De,et as P,ft as Oe,ht as ke,it as Ae,jt as je,k as Me,lt as Ne,nt as Pe,o as Fe,ot as Ie,p as F,q as Le,st as Re,t as ze,u as Be,vt as Ve,wt as He,x as Ue,y as We}from"./dist-DCefgfkj.js";import{d as Ge,f as Ke,g as qe,i as Je,r as Ye,u as Xe}from"./dist-P76w4V8t.js";import{c as Ze,i as Qe,l as $e,n as et,o as tt,r as nt}from"./dist-CG0XIeov.js";import{a as rt}from"./dist-BSF2Z7j1.js";import{t as it}from"./MarkdownRenderer-CS6jvLpf.js";import{a as at,i as ot,n as st,r as ct,t as lt}from"./wiki-link-suggestions-DnVtu7Jb.js";import{i as ut,t as dt}from"./notes-graph-settings-CznA-Qu0.js";var ft=t((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(e.unstable_now=void 0,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=!1,_=typeof setTimeout==`function`?setTimeout:null,v=typeof clearTimeout==`function`?clearTimeout:null,y=typeof setImmediate<`u`?setImmediate:null;function b(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 x(e){if(h=!1,b(e),!m)if(n(c)!==null)m=!0,S||(S=!0,ne());else{var t=n(l);t!==null&&ie(x,t.startTime-e)}}var S=!1,ee=-1,te=5,C=-1;function w(){return g?!0:!(e.unstable_now()-C<te)}function T(){if(g=!1,S){var t=e.unstable_now();C=t;var i=!0;try{a:{m=!1,h&&(h=!1,v(ee),ee=-1),p=!0;var a=f;try{b:{for(b(t),d=n(c);d!==null&&!(d.expirationTime>t&&w());){var o=d.callback;if(typeof o==`function`){d.callback=null,f=d.priorityLevel;var s=o(d.expirationTime<=t);if(t=e.unstable_now(),typeof s==`function`){d.callback=s,b(t),i=!0;break b}d===n(c)&&r(c),b(t)}else r(c);d=n(c)}if(d!==null)i=!0;else{var u=n(l);u!==null&&ie(x,u.startTime-t),i=!1}}break a}finally{d=null,f=a,p=!1}i=void 0}}finally{i?ne():S=!1}}}var ne;if(typeof y==`function`)ne=function(){y(T)};else if(typeof MessageChannel<`u`){var E=new MessageChannel,re=E.port2;E.port1.onmessage=T,ne=function(){re.postMessage(null)}}else ne=function(){_(T,0)};function ie(t,n){ee=_(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_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`):te=0<e?Math.floor(1e3/e):5},e.unstable_getCurrentPriorityLevel=function(){return f},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_requestPaint=function(){g=!0},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?(v(ee),ee=-1):h=!0,ie(x,a-o))):(r.sortIndex=s,t(c,r),m||p||(m=!0,S||(S=!0,ne()))),r},e.unstable_shouldYield=w,e.unstable_wrapCallback=function(e){var t=f;return function(){var n=f;f=t;try{return e.apply(this,arguments)}finally{f=n}}}})),pt=t(((e,t)=>{t.exports=ft()})),mt=t((e=>{var t=c();function n(e){var t=`https://react.dev/errors/`+e;if(1<arguments.length){t+=`?args[]=`+encodeURIComponent(arguments[1]);for(var n=2;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.`}function r(){}var i={d:{f:r,r:function(){throw Error(n(522))},D:r,C:r,L:r,m:r,X:r,S:r,M:r},p:0,findDOMNode:null},a=Symbol.for(`react.portal`);function o(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:a,key:r==null?null:``+r,children:e,containerInfo:t,implementation:n}}var s=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function l(e,t){if(e===`font`)return``;if(typeof t==`string`)return t===`use-credentials`?t:``}e.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=i,e.createPortal=function(e,t){var r=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)throw Error(n(299));return o(e,t,null,r)},e.flushSync=function(e){var t=s.T,n=i.p;try{if(s.T=null,i.p=2,e)return e()}finally{s.T=t,i.p=n,i.d.f()}},e.preconnect=function(e,t){typeof e==`string`&&(t?(t=t.crossOrigin,t=typeof t==`string`?t===`use-credentials`?t:``:void 0):t=null,i.d.C(e,t))},e.prefetchDNS=function(e){typeof e==`string`&&i.d.D(e)},e.preinit=function(e,t){if(typeof e==`string`&&t&&typeof t.as==`string`){var n=t.as,r=l(n,t.crossOrigin),a=typeof t.integrity==`string`?t.integrity:void 0,o=typeof t.fetchPriority==`string`?t.fetchPriority:void 0;n===`style`?i.d.S(e,typeof t.precedence==`string`?t.precedence:void 0,{crossOrigin:r,integrity:a,fetchPriority:o}):n===`script`&&i.d.X(e,{crossOrigin:r,integrity:a,fetchPriority:o,nonce:typeof t.nonce==`string`?t.nonce:void 0})}},e.preinitModule=function(e,t){if(typeof e==`string`)if(typeof t==`object`&&t){if(t.as==null||t.as===`script`){var n=l(t.as,t.crossOrigin);i.d.M(e,{crossOrigin:n,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0})}}else t??i.d.M(e)},e.preload=function(e,t){if(typeof e==`string`&&typeof t==`object`&&t&&typeof t.as==`string`){var n=t.as,r=l(n,t.crossOrigin);i.d.L(e,n,{crossOrigin:r,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0,type:typeof t.type==`string`?t.type:void 0,fetchPriority:typeof t.fetchPriority==`string`?t.fetchPriority:void 0,referrerPolicy:typeof t.referrerPolicy==`string`?t.referrerPolicy:void 0,imageSrcSet:typeof t.imageSrcSet==`string`?t.imageSrcSet:void 0,imageSizes:typeof t.imageSizes==`string`?t.imageSizes:void 0,media:typeof t.media==`string`?t.media:void 0})}},e.preloadModule=function(e,t){if(typeof e==`string`)if(t){var n=l(t.as,t.crossOrigin);i.d.m(e,{as:typeof t.as==`string`&&t.as!==`script`?t.as:void 0,crossOrigin:n,integrity:typeof t.integrity==`string`?t.integrity:void 0})}else i.d.m(e)},e.requestFormReset=function(e){i.d.r(e)},e.unstable_batchedUpdates=function(e,t){return e(t)},e.useFormState=function(e,t,n){return s.H.useFormState(e,t,n)},e.useFormStatus=function(){return s.H.useHostTransitionStatus()},e.version=`19.2.5`})),ht=t(((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=mt()})),gt=t((e=>{var t=pt(),n=c(),r=ht();function i(e){var t=`https://react.dev/errors/`+e;if(1<arguments.length){t+=`?args[]=`+encodeURIComponent(arguments[1]);for(var n=2;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.`}function a(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function o(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 s(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 l(e){if(e.tag===31){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function u(e){if(o(e)!==e)throw Error(i(188))}function d(e){var t=e.alternate;if(!t){if(t=o(e),t===null)throw Error(i(188));return t===e?e:null}for(var n=e,r=t;;){var a=n.return;if(a===null)break;var s=a.alternate;if(s===null){if(r=a.return,r!==null){n=r;continue}break}if(a.child===s.child){for(s=a.child;s;){if(s===n)return u(a),e;if(s===r)return u(a),t;s=s.sibling}throw Error(i(188))}if(n.return!==r.return)n=a,r=s;else{for(var c=!1,l=a.child;l;){if(l===n){c=!0,n=a,r=s;break}if(l===r){c=!0,r=a,n=s;break}l=l.sibling}if(!c){for(l=s.child;l;){if(l===n){c=!0,n=s,r=a;break}if(l===r){c=!0,r=s,n=a;break}l=l.sibling}if(!c)throw Error(i(189))}}if(n.alternate!==r)throw Error(i(190))}if(n.tag!==3)throw Error(i(188));return n.stateNode.current===n?e:t}function f(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=f(e),t!==null)return t;e=e.sibling}return null}var p=Object.assign,m=Symbol.for(`react.element`),h=Symbol.for(`react.transitional.element`),g=Symbol.for(`react.portal`),_=Symbol.for(`react.fragment`),v=Symbol.for(`react.strict_mode`),y=Symbol.for(`react.profiler`),b=Symbol.for(`react.consumer`),x=Symbol.for(`react.context`),S=Symbol.for(`react.forward_ref`),ee=Symbol.for(`react.suspense`),te=Symbol.for(`react.suspense_list`),C=Symbol.for(`react.memo`),w=Symbol.for(`react.lazy`),T=Symbol.for(`react.activity`),ne=Symbol.for(`react.memo_cache_sentinel`),E=Symbol.iterator;function re(e){return typeof e!=`object`||!e?null:(e=E&&e[E]||e[`@@iterator`],typeof e==`function`?e:null)}var ie=Symbol.for(`react.client.reference`);function ae(e){if(e==null)return null;if(typeof e==`function`)return e.$$typeof===ie?null:e.displayName||e.name||null;if(typeof e==`string`)return e;switch(e){case _:return`Fragment`;case y:return`Profiler`;case v:return`StrictMode`;case ee:return`Suspense`;case te:return`SuspenseList`;case T:return`Activity`}if(typeof e==`object`)switch(e.$$typeof){case g:return`Portal`;case x:return e.displayName||`Context`;case b:return(e._context.displayName||`Context`)+`.Consumer`;case S:var t=e.render;return e=e.displayName,e||=(e=t.displayName||t.name||``,e===``?`ForwardRef`:`ForwardRef(`+e+`)`),e;case C:return t=e.displayName||null,t===null?ae(e.type)||`Memo`:t;case w:t=e._payload,e=e._init;try{return ae(e(t))}catch{}}return null}var oe=Array.isArray,D=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,O=r.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,se={pending:!1,data:null,method:null,action:null},ce=[],le=-1;function ue(e){return{current:e}}function k(e){0>le||(e.current=ce[le],ce[le]=null,le--)}function A(e,t){le++,ce[le]=e.current,e.current=t}var de=ue(null),fe=ue(null),pe=ue(null),me=ue(null);function he(e,t){switch(A(pe,t),A(fe,e),A(de,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?Vd(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=Vd(t),e=Hd(t,e);else switch(e){case`svg`:e=1;break;case`math`:e=2;break;default:e=0}}k(de),A(de,e)}function ge(){k(de),k(fe),k(pe)}function _e(e){e.memoizedState!==null&&A(me,e);var t=de.current,n=Hd(t,e.type);t!==n&&(A(fe,e),A(de,n))}function j(e){fe.current===e&&(k(de),k(fe)),me.current===e&&(k(me),Qf._currentValue=se)}var ve,ye;function be(e){if(ve===void 0)try{throw Error()}catch(e){var t=e.stack.trim().match(/\n( *(at )?)/);ve=t&&t[1]||``,ye=-1<e.stack.indexOf(`
3
- at`)?` (<anonymous>)`:-1<e.stack.indexOf(`@`)?`@unknown:0:0`:``}return`
4
- `+ve+e+ye}var xe=!1;function Se(e,t){if(!e||xe)return``;xe=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var r={DetermineComponentFrameRoot:function(){try{if(t){var n=function(){throw Error()};if(Object.defineProperty(n.prototype,`props`,{set:function(){throw Error()}}),typeof Reflect==`object`&&Reflect.construct){try{Reflect.construct(n,[])}catch(e){var r=e}Reflect.construct(e,[],n)}else{try{n.call()}catch(e){r=e}e.call(n.prototype)}}else{try{throw Error()}catch(e){r=e}(n=e())&&typeof n.catch==`function`&&n.catch(function(){})}}catch(e){if(e&&r&&typeof e.stack==`string`)return[e.stack,r.stack]}return[null,null]}};r.DetermineComponentFrameRoot.displayName=`DetermineComponentFrameRoot`;var i=Object.getOwnPropertyDescriptor(r.DetermineComponentFrameRoot,`name`);i&&i.configurable&&Object.defineProperty(r.DetermineComponentFrameRoot,`name`,{value:`DetermineComponentFrameRoot`});var a=r.DetermineComponentFrameRoot(),o=a[0],s=a[1];if(o&&s){var c=o.split(`
5
- `),l=s.split(`
6
- `);for(i=r=0;r<c.length&&!c[r].includes(`DetermineComponentFrameRoot`);)r++;for(;i<l.length&&!l[i].includes(`DetermineComponentFrameRoot`);)i++;if(r===c.length||i===l.length)for(r=c.length-1,i=l.length-1;1<=r&&0<=i&&c[r]!==l[i];)i--;for(;1<=r&&0<=i;r--,i--)if(c[r]!==l[i]){if(r!==1||i!==1)do if(r--,i--,0>i||c[r]!==l[i]){var u=`
7
- `+c[r].replace(` at new `,` at `);return e.displayName&&u.includes(`<anonymous>`)&&(u=u.replace(`<anonymous>`,e.displayName)),u}while(1<=r&&0<=i);break}}}finally{xe=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:``)?be(n):``}function Ce(e,t){switch(e.tag){case 26:case 27:case 5:return be(e.type);case 16:return be(`Lazy`);case 13:return e.child!==t&&t!==null?be(`Suspense Fallback`):be(`Suspense`);case 19:return be(`SuspenseList`);case 0:case 15:return Se(e.type,!1);case 11:return Se(e.type.render,!1);case 1:return Se(e.type,!0);case 31:return be(`Activity`);default:return``}}function we(e){try{var t=``,n=null;do t+=Ce(e,n),n=e,e=e.return;while(e);return t}catch(e){return`
8
- Error generating stack: `+e.message+`
9
- `+e.stack}}var M=Object.prototype.hasOwnProperty,N=t.unstable_scheduleCallback,Te=t.unstable_cancelCallback,Ee=t.unstable_shouldYield,De=t.unstable_requestPaint,P=t.unstable_now,Oe=t.unstable_getCurrentPriorityLevel,ke=t.unstable_ImmediatePriority,Ae=t.unstable_UserBlockingPriority,je=t.unstable_NormalPriority,Me=t.unstable_LowPriority,Ne=t.unstable_IdlePriority,Pe=t.log,Fe=t.unstable_setDisableYieldValue,Ie=null,F=null;function Le(e){if(typeof Pe==`function`&&Fe(e),F&&typeof F.setStrictMode==`function`)try{F.setStrictMode(Ie,e)}catch{}}var Re=Math.clz32?Math.clz32:Ve,ze=Math.log,Be=Math.LN2;function Ve(e){return e>>>=0,e===0?32:31-(ze(e)/Be|0)|0}var He=256,Ue=262144,We=4194304;function Ge(e){var t=e&42;if(t!==0)return t;switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return e&261888;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function Ke(e,t,n){var r=e.pendingLanes;if(r===0)return 0;var i=0,a=e.suspendedLanes,o=e.pingedLanes;e=e.warmLanes;var s=r&134217727;return s===0?(s=r&~a,s===0?o===0?n||(n=r&~e,n!==0&&(i=Ge(n))):i=Ge(o):i=Ge(s)):(r=s&~a,r===0?(o&=s,o===0?n||(n=s&~e,n!==0&&(i=Ge(n))):i=Ge(o)):i=Ge(r)),i===0?0:t!==0&&t!==i&&(t&a)===0&&(a=i&-i,n=t&-t,a>=n||a===32&&n&4194048)?t:i}function qe(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function Je(e,t){switch(e){case 1:case 2:case 4:case 8:case 64:return t+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function Ye(){var e=We;return We<<=1,!(We&62914560)&&(We=4194304),e}function Xe(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function Ze(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function Qe(e,t,n,r,i,a){var o=e.pendingLanes;e.pendingLanes=n,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=n,e.entangledLanes&=n,e.errorRecoveryDisabledLanes&=n,e.shellSuspendCounter=0;var s=e.entanglements,c=e.expirationTimes,l=e.hiddenUpdates;for(n=o&~n;0<n;){var u=31-Re(n),d=1<<u;s[u]=0,c[u]=-1;var f=l[u];if(f!==null)for(l[u]=null,u=0;u<f.length;u++){var p=f[u];p!==null&&(p.lane&=-536870913)}n&=~d}r!==0&&$e(e,r,0),a!==0&&i===0&&e.tag!==0&&(e.suspendedLanes|=a&~(o&~t))}function $e(e,t,n){e.pendingLanes|=t,e.suspendedLanes&=~t;var r=31-Re(t);e.entangledLanes|=t,e.entanglements[r]=e.entanglements[r]|1073741824|n&261930}function et(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-Re(n),i=1<<r;i&t|e[r]&t&&(e[r]|=t),n&=~i}}function tt(e,t){var n=t&-t;return n=n&42?1:nt(n),(n&(e.suspendedLanes|t))===0?n:0}function nt(e){switch(e){case 2:e=1;break;case 8:e=4;break;case 32:e=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:e=128;break;case 268435456:e=134217728;break;default:e=0}return e}function rt(e){return e&=-e,2<e?8<e?e&134217727?32:268435456:8:2}function it(){var e=O.p;return e===0?(e=window.event,e===void 0?32:mp(e.type)):e}function at(e,t){var n=O.p;try{return O.p=e,t()}finally{O.p=n}}var ot=Math.random().toString(36).slice(2),st=`__reactFiber$`+ot,ct=`__reactProps$`+ot,lt=`__reactContainer$`+ot,ut=`__reactEvents$`+ot,dt=`__reactListeners$`+ot,ft=`__reactHandles$`+ot,mt=`__reactResources$`+ot,gt=`__reactMarker$`+ot;function _t(e){delete e[st],delete e[ct],delete e[ut],delete e[dt],delete e[ft]}function I(e){var t=e[st];if(t)return t;for(var n=e.parentNode;n;){if(t=n[lt]||n[st]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=df(e);e!==null;){if(n=e[st])return n;e=df(e)}return t}e=n,n=e.parentNode}return null}function vt(e){if(e=e[st]||e[lt]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function yt(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(i(33))}function bt(e){var t=e[mt];return t||=e[mt]={hoistableStyles:new Map,hoistableScripts:new Map},t}function xt(e){e[gt]=!0}var L=new Set,St={};function Ct(e,t){wt(e,t),wt(e+`Capture`,t)}function wt(e,t){for(St[e]=t,e=0;e<t.length;e++)L.add(t[e])}var Tt=RegExp(`^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$`),Et={},Dt={};function Ot(e){return M.call(Dt,e)?!0:M.call(Et,e)?!1:Tt.test(e)?Dt[e]=!0:(Et[e]=!0,!1)}function kt(e,t,n){if(Ot(t))if(n===null)e.removeAttribute(t);else{switch(typeof n){case`undefined`:case`function`:case`symbol`:e.removeAttribute(t);return;case`boolean`:var r=t.toLowerCase().slice(0,5);if(r!==`data-`&&r!==`aria-`){e.removeAttribute(t);return}}e.setAttribute(t,``+n)}}function At(e,t,n){if(n===null)e.removeAttribute(t);else{switch(typeof n){case`undefined`:case`function`:case`symbol`:case`boolean`:e.removeAttribute(t);return}e.setAttribute(t,``+n)}}function jt(e,t,n,r){if(r===null)e.removeAttribute(n);else{switch(typeof r){case`undefined`:case`function`:case`symbol`:case`boolean`:e.removeAttribute(n);return}e.setAttributeNS(t,n,``+r)}}function Mt(e){switch(typeof e){case`bigint`:case`boolean`:case`number`:case`string`:case`undefined`:return e;case`object`:return e;default:return``}}function Nt(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()===`input`&&(t===`checkbox`||t===`radio`)}function Pt(e,t,n){var r=Object.getOwnPropertyDescriptor(e.constructor.prototype,t);if(!e.hasOwnProperty(t)&&r!==void 0&&typeof r.get==`function`&&typeof r.set==`function`){var i=r.get,a=r.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(e){n=``+e,a.call(this,e)}}),Object.defineProperty(e,t,{enumerable:r.enumerable}),{getValue:function(){return n},setValue:function(e){n=``+e},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Ft(e){if(!e._valueTracker){var t=Nt(e)?`checked`:`value`;e._valueTracker=Pt(e,t,``+e[t])}}function It(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r=``;return e&&(r=Nt(e)?e.checked?`true`:`false`:e.value),e=r,e===n?!1:(t.setValue(e),!0)}function Lt(e){if(e||=typeof document<`u`?document:void 0,e===void 0)return null;try{return e.activeElement||e.body}catch{return e.body}}var Rt=/[\n"\\]/g;function zt(e){return e.replace(Rt,function(e){return`\\`+e.charCodeAt(0).toString(16)+` `})}function Bt(e,t,n,r,i,a,o,s){e.name=``,o!=null&&typeof o!=`function`&&typeof o!=`symbol`&&typeof o!=`boolean`?e.type=o:e.removeAttribute(`type`),t==null?o!==`submit`&&o!==`reset`||e.removeAttribute(`value`):o===`number`?(t===0&&e.value===``||e.value!=t)&&(e.value=``+Mt(t)):e.value!==``+Mt(t)&&(e.value=``+Mt(t)),t==null?n==null?r!=null&&e.removeAttribute(`value`):Ht(e,o,Mt(n)):Ht(e,o,Mt(t)),i==null&&a!=null&&(e.defaultChecked=!!a),i!=null&&(e.checked=i&&typeof i!=`function`&&typeof i!=`symbol`),s!=null&&typeof s!=`function`&&typeof s!=`symbol`&&typeof s!=`boolean`?e.name=``+Mt(s):e.removeAttribute(`name`)}function Vt(e,t,n,r,i,a,o,s){if(a!=null&&typeof a!=`function`&&typeof a!=`symbol`&&typeof a!=`boolean`&&(e.type=a),t!=null||n!=null){if(!(a!==`submit`&&a!==`reset`||t!=null)){Ft(e);return}n=n==null?``:``+Mt(n),t=t==null?n:``+Mt(t),s||t===e.value||(e.value=t),e.defaultValue=t}r??=i,r=typeof r!=`function`&&typeof r!=`symbol`&&!!r,e.checked=s?e.checked:!!r,e.defaultChecked=!!r,o!=null&&typeof o!=`function`&&typeof o!=`symbol`&&typeof o!=`boolean`&&(e.name=o),Ft(e)}function Ht(e,t,n){t===`number`&&Lt(e.ownerDocument)===e||e.defaultValue===``+n||(e.defaultValue=``+n)}function Ut(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=``+Mt(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 Wt(e,t,n){if(t!=null&&(t=``+Mt(t),t!==e.value&&(e.value=t),n==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=n==null?``:``+Mt(n)}function Gt(e,t,n,r){if(t==null){if(r!=null){if(n!=null)throw Error(i(92));if(oe(r)){if(1<r.length)throw Error(i(93));r=r[0]}n=r}n??=``,t=n}n=Mt(t),e.defaultValue=n,r=e.textContent,r===n&&r!==``&&r!==null&&(e.value=r),Ft(e)}function Kt(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var qt=new Set(`animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp`.split(` `));function Jt(e,t,n){var r=t.indexOf(`--`)===0;n==null||typeof n==`boolean`||n===``?r?e.setProperty(t,``):t===`float`?e.cssFloat=``:e[t]=``:r?e.setProperty(t,n):typeof n!=`number`||n===0||qt.has(t)?t===`float`?e.cssFloat=n:e[t]=(``+n).trim():e[t]=n+`px`}function Yt(e,t,n){if(t!=null&&typeof t!=`object`)throw Error(i(62));if(e=e.style,n!=null){for(var r in n)!n.hasOwnProperty(r)||t!=null&&t.hasOwnProperty(r)||(r.indexOf(`--`)===0?e.setProperty(r,``):r===`float`?e.cssFloat=``:e[r]=``);for(var a in t)r=t[a],t.hasOwnProperty(a)&&n[a]!==r&&Jt(e,a,r)}else for(var o in t)t.hasOwnProperty(o)&&Jt(e,o,t[o])}function Xt(e){if(e.indexOf(`-`)===-1)return!1;switch(e){case`annotation-xml`:case`color-profile`:case`font-face`:case`font-face-src`:case`font-face-uri`:case`font-face-format`:case`font-face-name`:case`missing-glyph`:return!1;default:return!0}}var Zt=new Map([[`acceptCharset`,`accept-charset`],[`htmlFor`,`for`],[`httpEquiv`,`http-equiv`],[`crossOrigin`,`crossorigin`],[`accentHeight`,`accent-height`],[`alignmentBaseline`,`alignment-baseline`],[`arabicForm`,`arabic-form`],[`baselineShift`,`baseline-shift`],[`capHeight`,`cap-height`],[`clipPath`,`clip-path`],[`clipRule`,`clip-rule`],[`colorInterpolation`,`color-interpolation`],[`colorInterpolationFilters`,`color-interpolation-filters`],[`colorProfile`,`color-profile`],[`colorRendering`,`color-rendering`],[`dominantBaseline`,`dominant-baseline`],[`enableBackground`,`enable-background`],[`fillOpacity`,`fill-opacity`],[`fillRule`,`fill-rule`],[`floodColor`,`flood-color`],[`floodOpacity`,`flood-opacity`],[`fontFamily`,`font-family`],[`fontSize`,`font-size`],[`fontSizeAdjust`,`font-size-adjust`],[`fontStretch`,`font-stretch`],[`fontStyle`,`font-style`],[`fontVariant`,`font-variant`],[`fontWeight`,`font-weight`],[`glyphName`,`glyph-name`],[`glyphOrientationHorizontal`,`glyph-orientation-horizontal`],[`glyphOrientationVertical`,`glyph-orientation-vertical`],[`horizAdvX`,`horiz-adv-x`],[`horizOriginX`,`horiz-origin-x`],[`imageRendering`,`image-rendering`],[`letterSpacing`,`letter-spacing`],[`lightingColor`,`lighting-color`],[`markerEnd`,`marker-end`],[`markerMid`,`marker-mid`],[`markerStart`,`marker-start`],[`overlinePosition`,`overline-position`],[`overlineThickness`,`overline-thickness`],[`paintOrder`,`paint-order`],[`panose-1`,`panose-1`],[`pointerEvents`,`pointer-events`],[`renderingIntent`,`rendering-intent`],[`shapeRendering`,`shape-rendering`],[`stopColor`,`stop-color`],[`stopOpacity`,`stop-opacity`],[`strikethroughPosition`,`strikethrough-position`],[`strikethroughThickness`,`strikethrough-thickness`],[`strokeDasharray`,`stroke-dasharray`],[`strokeDashoffset`,`stroke-dashoffset`],[`strokeLinecap`,`stroke-linecap`],[`strokeLinejoin`,`stroke-linejoin`],[`strokeMiterlimit`,`stroke-miterlimit`],[`strokeOpacity`,`stroke-opacity`],[`strokeWidth`,`stroke-width`],[`textAnchor`,`text-anchor`],[`textDecoration`,`text-decoration`],[`textRendering`,`text-rendering`],[`transformOrigin`,`transform-origin`],[`underlinePosition`,`underline-position`],[`underlineThickness`,`underline-thickness`],[`unicodeBidi`,`unicode-bidi`],[`unicodeRange`,`unicode-range`],[`unitsPerEm`,`units-per-em`],[`vAlphabetic`,`v-alphabetic`],[`vHanging`,`v-hanging`],[`vIdeographic`,`v-ideographic`],[`vMathematical`,`v-mathematical`],[`vectorEffect`,`vector-effect`],[`vertAdvY`,`vert-adv-y`],[`vertOriginX`,`vert-origin-x`],[`vertOriginY`,`vert-origin-y`],[`wordSpacing`,`word-spacing`],[`writingMode`,`writing-mode`],[`xmlnsXlink`,`xmlns:xlink`],[`xHeight`,`x-height`]]),Qt=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function $t(e){return Qt.test(``+e)?`javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')`:e}function en(){}var tn=null;function nn(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var rn=null,an=null;function on(e){var t=vt(e);if(t&&(e=t.stateNode)){var n=e[ct]||null;a:switch(e=t.stateNode,t.type){case`input`:if(Bt(e,n.value,n.defaultValue,n.defaultValue,n.checked,n.defaultChecked,n.type,n.name),t=n.name,n.type===`radio`&&t!=null){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll(`input[name="`+zt(``+t)+`"][type="radio"]`),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var a=r[ct]||null;if(!a)throw Error(i(90));Bt(r,a.value,a.defaultValue,a.defaultValue,a.checked,a.defaultChecked,a.type,a.name)}}for(t=0;t<n.length;t++)r=n[t],r.form===e.form&&It(r)}break a;case`textarea`:Wt(e,n.value,n.defaultValue);break a;case`select`:t=n.value,t!=null&&Ut(e,!!n.multiple,t,!1)}}}var sn=!1;function cn(e,t,n){if(sn)return e(t,n);sn=!0;try{return e(t)}finally{if(sn=!1,(rn!==null||an!==null)&&(bu(),rn&&(t=rn,e=an,an=rn=null,on(t),e)))for(t=0;t<e.length;t++)on(e[t])}}function ln(e,t){var n=e.stateNode;if(n===null)return null;var r=n[ct]||null;if(r===null)return null;n=r[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`:(r=!r.disabled)||(e=e.type,r=!(e===`button`||e===`input`||e===`select`||e===`textarea`)),e=!r;break a;default:e=!1}if(e)return null;if(n&&typeof n!=`function`)throw Error(i(231,t,typeof n));return n}var un=!(typeof window>`u`||window.document===void 0||window.document.createElement===void 0),dn=!1;if(un)try{var fn={};Object.defineProperty(fn,`passive`,{get:function(){dn=!0}}),window.addEventListener(`test`,fn,fn),window.removeEventListener(`test`,fn,fn)}catch{dn=!1}var pn=null,mn=null,hn=null;function gn(){if(hn)return hn;var e,t=mn,n=t.length,r,i=`value`in pn?pn.value:pn.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 hn=i.slice(e,1<r?1-r:void 0)}function _n(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 vn(){return!0}function yn(){return!1}function bn(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)?vn:yn,this.isPropagationStopped=yn,this}return p(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=vn)},stopPropagation:function(){var e=this.nativeEvent;e&&(e.stopPropagation?e.stopPropagation():typeof e.cancelBubble!=`unknown`&&(e.cancelBubble=!0),this.isPropagationStopped=vn)},persist:function(){},isPersistent:vn}),t}var xn={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Sn=bn(xn),Cn=p({},xn,{view:0,detail:0}),wn=bn(Cn),Tn,En,Dn,On=p({},Cn,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:zn,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return`movementX`in e?e.movementX:(e!==Dn&&(Dn&&e.type===`mousemove`?(Tn=e.screenX-Dn.screenX,En=e.screenY-Dn.screenY):En=Tn=0,Dn=e),Tn)},movementY:function(e){return`movementY`in e?e.movementY:En}}),kn=bn(On),An=bn(p({},On,{dataTransfer:0})),jn=bn(p({},Cn,{relatedTarget:0})),Mn=bn(p({},xn,{animationName:0,elapsedTime:0,pseudoElement:0})),Nn=bn(p({},xn,{clipboardData:function(e){return`clipboardData`in e?e.clipboardData:window.clipboardData}})),Pn=bn(p({},xn,{data:0})),Fn={Esc:`Escape`,Spacebar:` `,Left:`ArrowLeft`,Up:`ArrowUp`,Right:`ArrowRight`,Down:`ArrowDown`,Del:`Delete`,Win:`OS`,Menu:`ContextMenu`,Apps:`ContextMenu`,Scroll:`ScrollLock`,MozPrintableKey:`Unidentified`},In={8:`Backspace`,9:`Tab`,12:`Clear`,13:`Enter`,16:`Shift`,17:`Control`,18:`Alt`,19:`Pause`,20:`CapsLock`,27:`Escape`,32:` `,33:`PageUp`,34:`PageDown`,35:`End`,36:`Home`,37:`ArrowLeft`,38:`ArrowUp`,39:`ArrowRight`,40:`ArrowDown`,45:`Insert`,46:`Delete`,112:`F1`,113:`F2`,114:`F3`,115:`F4`,116:`F5`,117:`F6`,118:`F7`,119:`F8`,120:`F9`,121:`F10`,122:`F11`,123:`F12`,144:`NumLock`,145:`ScrollLock`,224:`Meta`},Ln={Alt:`altKey`,Control:`ctrlKey`,Meta:`metaKey`,Shift:`shiftKey`};function Rn(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=Ln[e])?!!t[e]:!1}function zn(){return Rn}var Bn=bn(p({},Cn,{key:function(e){if(e.key){var t=Fn[e.key]||e.key;if(t!==`Unidentified`)return t}return e.type===`keypress`?(e=_n(e),e===13?`Enter`:String.fromCharCode(e)):e.type===`keydown`||e.type===`keyup`?In[e.keyCode]||`Unidentified`:``},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:zn,charCode:function(e){return e.type===`keypress`?_n(e):0},keyCode:function(e){return e.type===`keydown`||e.type===`keyup`?e.keyCode:0},which:function(e){return e.type===`keypress`?_n(e):e.type===`keydown`||e.type===`keyup`?e.keyCode:0}})),Vn=bn(p({},On,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0})),Hn=bn(p({},Cn,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:zn})),Un=bn(p({},xn,{propertyName:0,elapsedTime:0,pseudoElement:0})),Wn=bn(p({},On,{deltaX:function(e){return`deltaX`in e?e.deltaX:`wheelDeltaX`in e?-e.wheelDeltaX:0},deltaY:function(e){return`deltaY`in e?e.deltaY:`wheelDeltaY`in e?-e.wheelDeltaY:`wheelDelta`in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0})),Gn=bn(p({},xn,{newState:0,oldState:0})),Kn=[9,13,27,32],qn=un&&`CompositionEvent`in window,Jn=null;un&&`documentMode`in document&&(Jn=document.documentMode);var Yn=un&&`TextEvent`in window&&!Jn,Xn=un&&(!qn||Jn&&8<Jn&&11>=Jn),Zn=` `,Qn=!1;function $n(e,t){switch(e){case`keyup`:return Kn.indexOf(t.keyCode)!==-1;case`keydown`:return t.keyCode!==229;case`keypress`:case`mousedown`:case`focusout`:return!0;default:return!1}}function er(e){return e=e.detail,typeof e==`object`&&`data`in e?e.data:null}var tr=!1;function nr(e,t){switch(e){case`compositionend`:return er(t);case`keypress`:return t.which===32?(Qn=!0,Zn):null;case`textInput`:return e=t.data,e===Zn&&Qn?null:e;default:return null}}function rr(e,t){if(tr)return e===`compositionend`||!qn&&$n(e,t)?(e=gn(),hn=mn=pn=null,tr=!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 Xn&&t.locale!==`ko`?null:t.data;default:return null}}var ir={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 ar(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t===`input`?!!ir[e.type]:t===`textarea`}function or(e,t,n,r){rn?an?an.push(r):an=[r]:rn=r,t=Ed(t,`onChange`),0<t.length&&(n=new Sn(`onChange`,`change`,null,n,r),e.push({event:n,listeners:t}))}var sr=null,cr=null;function lr(e){yd(e,0)}function ur(e){if(It(yt(e)))return e}function dr(e,t){if(e===`change`)return t}var fr=!1;if(un){var pr;if(un){var mr=`oninput`in document;if(!mr){var hr=document.createElement(`div`);hr.setAttribute(`oninput`,`return;`),mr=typeof hr.oninput==`function`}pr=mr}else pr=!1;fr=pr&&(!document.documentMode||9<document.documentMode)}function gr(){sr&&(sr.detachEvent(`onpropertychange`,_r),cr=sr=null)}function _r(e){if(e.propertyName===`value`&&ur(cr)){var t=[];or(t,cr,e,nn(e)),cn(lr,t)}}function vr(e,t,n){e===`focusin`?(gr(),sr=t,cr=n,sr.attachEvent(`onpropertychange`,_r)):e===`focusout`&&gr()}function yr(e){if(e===`selectionchange`||e===`keyup`||e===`keydown`)return ur(cr)}function br(e,t){if(e===`click`)return ur(t)}function xr(e,t){if(e===`input`||e===`change`)return ur(t)}function Sr(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var Cr=typeof Object.is==`function`?Object.is:Sr;function wr(e,t){if(Cr(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(!M.call(t,i)||!Cr(e[i],t[i]))return!1}return!0}function Tr(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Er(e,t){var n=Tr(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=Tr(n)}}function Dr(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Dr(e,t.parentNode):`contains`in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Or(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=Lt(e.document);t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href==`string`}catch{n=!1}if(n)e=t.contentWindow;else break;t=Lt(e.document)}return t}function kr(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t===`input`&&(e.type===`text`||e.type===`search`||e.type===`tel`||e.type===`url`||e.type===`password`)||t===`textarea`||e.contentEditable===`true`)}var Ar=un&&`documentMode`in document&&11>=document.documentMode,jr=null,Mr=null,Nr=null,Pr=!1;function Fr(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Pr||jr==null||jr!==Lt(r)||(r=jr,`selectionStart`in r&&kr(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),Nr&&wr(Nr,r)||(Nr=r,r=Ed(Mr,`onSelect`),0<r.length&&(t=new Sn(`onSelect`,`select`,null,t,n),e.push({event:t,listeners:r}),t.target=jr)))}function Ir(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n[`Webkit`+e]=`webkit`+t,n[`Moz`+e]=`moz`+t,n}var Lr={animationend:Ir(`Animation`,`AnimationEnd`),animationiteration:Ir(`Animation`,`AnimationIteration`),animationstart:Ir(`Animation`,`AnimationStart`),transitionrun:Ir(`Transition`,`TransitionRun`),transitionstart:Ir(`Transition`,`TransitionStart`),transitioncancel:Ir(`Transition`,`TransitionCancel`),transitionend:Ir(`Transition`,`TransitionEnd`)},Rr={},zr={};un&&(zr=document.createElement(`div`).style,`AnimationEvent`in window||(delete Lr.animationend.animation,delete Lr.animationiteration.animation,delete Lr.animationstart.animation),`TransitionEvent`in window||delete Lr.transitionend.transition);function Br(e){if(Rr[e])return Rr[e];if(!Lr[e])return e;var t=Lr[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in zr)return Rr[e]=t[n];return e}var Vr=Br(`animationend`),Hr=Br(`animationiteration`),Ur=Br(`animationstart`),Wr=Br(`transitionrun`),Gr=Br(`transitionstart`),Kr=Br(`transitioncancel`),qr=Br(`transitionend`),Jr=new Map,Yr=`abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel`.split(` `);Yr.push(`scrollEnd`);function Xr(e,t){Jr.set(e,t),Ct(t,[e])}var Zr=typeof reportError==`function`?reportError:function(e){if(typeof window==`object`&&typeof window.ErrorEvent==`function`){var t=new window.ErrorEvent(`error`,{bubbles:!0,cancelable:!0,message:typeof e==`object`&&e&&typeof e.message==`string`?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process==`object`&&typeof process.emit==`function`){process.emit(`uncaughtException`,e);return}console.error(e)},Qr=[],$r=0,ei=0;function ti(){for(var e=$r,t=ei=$r=0;t<e;){var n=Qr[t];Qr[t++]=null;var r=Qr[t];Qr[t++]=null;var i=Qr[t];Qr[t++]=null;var a=Qr[t];if(Qr[t++]=null,r!==null&&i!==null){var o=r.pending;o===null?i.next=i:(i.next=o.next,o.next=i),r.pending=i}a!==0&&ai(n,i,a)}}function ni(e,t,n,r){Qr[$r++]=e,Qr[$r++]=t,Qr[$r++]=n,Qr[$r++]=r,ei|=r,e.lanes|=r,e=e.alternate,e!==null&&(e.lanes|=r)}function ri(e,t,n,r){return ni(e,t,n,r),oi(e)}function ii(e,t){return ni(e,null,null,t),oi(e)}function ai(e,t,n){e.lanes|=n;var r=e.alternate;r!==null&&(r.lanes|=n);for(var i=!1,a=e.return;a!==null;)a.childLanes|=n,r=a.alternate,r!==null&&(r.childLanes|=n),a.tag===22&&(e=a.stateNode,e===null||e._visibility&1||(i=!0)),e=a,a=a.return;return e.tag===3?(a=e.stateNode,i&&t!==null&&(i=31-Re(n),e=a.hiddenUpdates,r=e[i],r===null?e[i]=[t]:r.push(t),t.lane=n|536870912),a):null}function oi(e){if(50<du)throw du=0,fu=null,Error(i(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var si={};function ci(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.refCleanup=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 li(e,t,n,r){return new ci(e,t,n,r)}function ui(e){return e=e.prototype,!(!e||!e.isReactComponent)}function di(e,t){var n=e.alternate;return n===null?(n=li(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&65011712,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.refCleanup=e.refCleanup,n}function fi(e,t){e.flags&=65011714;var n=e.alternate;return n===null?(e.childLanes=0,e.lanes=t,e.child=null,e.subtreeFlags=0,e.memoizedProps=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.stateNode=null):(e.childLanes=n.childLanes,e.lanes=n.lanes,e.child=n.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=n.memoizedProps,e.memoizedState=n.memoizedState,e.updateQueue=n.updateQueue,e.type=n.type,t=n.dependencies,e.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function pi(e,t,n,r,a,o){var s=0;if(r=e,typeof e==`function`)ui(e)&&(s=1);else if(typeof e==`string`)s=Uf(e,n,de.current)?26:e===`html`||e===`head`||e===`body`?27:5;else a:switch(e){case T:return e=li(31,n,t,a),e.elementType=T,e.lanes=o,e;case _:return mi(n.children,a,o,t);case v:s=8,a|=24;break;case y:return e=li(12,n,t,a|2),e.elementType=y,e.lanes=o,e;case ee:return e=li(13,n,t,a),e.elementType=ee,e.lanes=o,e;case te:return e=li(19,n,t,a),e.elementType=te,e.lanes=o,e;default:if(typeof e==`object`&&e)switch(e.$$typeof){case x:s=10;break a;case b:s=9;break a;case S:s=11;break a;case C:s=14;break a;case w:s=16,r=null;break a}s=29,n=Error(i(130,e===null?`null`:typeof e,``)),r=null}return t=li(s,n,t,a),t.elementType=e,t.type=r,t.lanes=o,t}function mi(e,t,n,r){return e=li(7,e,r,t),e.lanes=n,e}function hi(e,t,n){return e=li(6,e,null,t),e.lanes=n,e}function gi(e){var t=li(18,null,null,0);return t.stateNode=e,t}function _i(e,t,n){return t=li(4,e.children===null?[]:e.children,e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var vi=new WeakMap;function yi(e,t){if(typeof e==`object`&&e){var n=vi.get(e);return n===void 0?(t={value:e,source:t,stack:we(t)},vi.set(e,t),t):n}return{value:e,source:t,stack:we(t)}}var bi=[],xi=0,Si=null,Ci=0,wi=[],Ti=0,Ei=null,Di=1,Oi=``;function ki(e,t){bi[xi++]=Ci,bi[xi++]=Si,Si=e,Ci=t}function Ai(e,t,n){wi[Ti++]=Di,wi[Ti++]=Oi,wi[Ti++]=Ei,Ei=e;var r=Di;e=Oi;var i=32-Re(r)-1;r&=~(1<<i),n+=1;var a=32-Re(t)+i;if(30<a){var o=i-i%5;a=(r&(1<<o)-1).toString(32),r>>=o,i-=o,Di=1<<32-Re(t)+i|n<<i|r,Oi=a+e}else Di=1<<a|n<<i|r,Oi=e}function ji(e){e.return!==null&&(ki(e,1),Ai(e,1,0))}function Mi(e){for(;e===Si;)Si=bi[--xi],bi[xi]=null,Ci=bi[--xi],bi[xi]=null;for(;e===Ei;)Ei=wi[--Ti],wi[Ti]=null,Oi=wi[--Ti],wi[Ti]=null,Di=wi[--Ti],wi[Ti]=null}function Ni(e,t){wi[Ti++]=Di,wi[Ti++]=Oi,wi[Ti++]=Ei,Di=t.id,Oi=t.overflow,Ei=e}var Pi=null,R=null,z=!1,Fi=null,Ii=!1,Li=Error(i(519));function Ri(e){throw Wi(yi(Error(i(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?`text`:`HTML`,``)),e)),Li}function zi(e){var t=e.stateNode,n=e.type,r=e.memoizedProps;switch(t[st]=e,t[ct]=r,n){case`dialog`:Q(`cancel`,t),Q(`close`,t);break;case`iframe`:case`object`:case`embed`:Q(`load`,t);break;case`video`:case`audio`:for(n=0;n<_d.length;n++)Q(_d[n],t);break;case`source`:Q(`error`,t);break;case`img`:case`image`:case`link`:Q(`error`,t),Q(`load`,t);break;case`details`:Q(`toggle`,t);break;case`input`:Q(`invalid`,t),Vt(t,r.value,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name,!0);break;case`select`:Q(`invalid`,t);break;case`textarea`:Q(`invalid`,t),Gt(t,r.value,r.defaultValue,r.children)}n=r.children,typeof n!=`string`&&typeof n!=`number`&&typeof n!=`bigint`||t.textContent===``+n||!0===r.suppressHydrationWarning||Md(t.textContent,n)?(r.popover!=null&&(Q(`beforetoggle`,t),Q(`toggle`,t)),r.onScroll!=null&&Q(`scroll`,t),r.onScrollEnd!=null&&Q(`scrollend`,t),r.onClick!=null&&(t.onclick=en),t=!0):t=!1,t||Ri(e,!0)}function Bi(e){for(Pi=e.return;Pi;)switch(Pi.tag){case 5:case 31:case 13:Ii=!1;return;case 27:case 3:Ii=!0;return;default:Pi=Pi.return}}function Vi(e){if(e!==Pi)return!1;if(!z)return Bi(e),z=!0,!1;var t=e.tag,n;if((n=t!==3&&t!==27)&&((n=t===5)&&(n=e.type,n=!(n!==`form`&&n!==`button`)||Ud(e.type,e.memoizedProps)),n=!n),n&&R&&Ri(e),Bi(e),t===13){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(317));R=uf(e)}else if(t===31){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(317));R=uf(e)}else t===27?(t=R,Zd(e.type)?(e=lf,lf=null,R=e):R=t):R=Pi?cf(e.stateNode.nextSibling):null;return!0}function Hi(){R=Pi=null,z=!1}function Ui(){var e=Fi;return e!==null&&(Zl===null?Zl=e:Zl.push.apply(Zl,e),Fi=null),e}function Wi(e){Fi===null?Fi=[e]:Fi.push(e)}var Gi=ue(null),Ki=null,qi=null;function Ji(e,t,n){A(Gi,t._currentValue),t._currentValue=n}function Yi(e){e._currentValue=Gi.current,k(Gi)}function Xi(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 Zi(e,t,n,r){var a=e.child;for(a!==null&&(a.return=e);a!==null;){var o=a.dependencies;if(o!==null){var s=a.child;o=o.firstContext;a:for(;o!==null;){var c=o;o=a;for(var l=0;l<t.length;l++)if(c.context===t[l]){o.lanes|=n,c=o.alternate,c!==null&&(c.lanes|=n),Xi(o.return,n,e),r||(s=null);break a}o=c.next}}else if(a.tag===18){if(s=a.return,s===null)throw Error(i(341));s.lanes|=n,o=s.alternate,o!==null&&(o.lanes|=n),Xi(s,n,e),s=null}else s=a.child;if(s!==null)s.return=a;else for(s=a;s!==null;){if(s===e){s=null;break}if(a=s.sibling,a!==null){a.return=s.return,s=a;break}s=s.return}a=s}}function Qi(e,t,n,r){e=null;for(var a=t,o=!1;a!==null;){if(!o){if(a.flags&524288)o=!0;else if(a.flags&262144)break}if(a.tag===10){var s=a.alternate;if(s===null)throw Error(i(387));if(s=s.memoizedProps,s!==null){var c=a.type;Cr(a.pendingProps.value,s.value)||(e===null?e=[c]:e.push(c))}}else if(a===me.current){if(s=a.alternate,s===null)throw Error(i(387));s.memoizedState.memoizedState!==a.memoizedState.memoizedState&&(e===null?e=[Qf]:e.push(Qf))}a=a.return}e!==null&&Zi(t,e,n,r),t.flags|=262144}function $i(e){for(e=e.firstContext;e!==null;){if(!Cr(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function ea(e){Ki=e,qi=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function ta(e){return ra(Ki,e)}function na(e,t){return Ki===null&&ea(e),ra(e,t)}function ra(e,t){var n=t._currentValue;if(t={context:t,memoizedValue:n,next:null},qi===null){if(e===null)throw Error(i(308));qi=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else qi=qi.next=t;return n}var ia=typeof AbortController<`u`?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(t,n){e.push(n)}};this.abort=function(){t.aborted=!0,e.forEach(function(e){return e()})}},aa=t.unstable_scheduleCallback,oa=t.unstable_NormalPriority,sa={$$typeof:x,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function ca(){return{controller:new ia,data:new Map,refCount:0}}function la(e){e.refCount--,e.refCount===0&&aa(oa,function(){e.controller.abort()})}var ua=null,da=0,fa=0,pa=null;function ma(e,t){if(ua===null){var n=ua=[];da=0,fa=dd(),pa={status:`pending`,value:void 0,then:function(e){n.push(e)}}}return da++,t.then(ha,ha),t}function ha(){if(--da===0&&ua!==null){pa!==null&&(pa.status=`fulfilled`);var e=ua;ua=null,fa=0,pa=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function ga(e,t){var n=[],r={status:`pending`,value:null,reason:null,then:function(e){n.push(e)}};return e.then(function(){r.status=`fulfilled`,r.value=t;for(var e=0;e<n.length;e++)(0,n[e])(t)},function(e){for(r.status=`rejected`,r.reason=e,e=0;e<n.length;e++)(0,n[e])(void 0)}),r}var _a=D.S;D.S=function(e,t){eu=P(),typeof t==`object`&&t&&typeof t.then==`function`&&ma(e,t),_a!==null&&_a(e,t)};var va=ue(null);function ya(){var e=va.current;return e===null?q.pooledCache:e}function ba(e,t){t===null?A(va,va.current):A(va,t.pool)}function xa(){var e=ya();return e===null?null:{parent:sa._currentValue,pool:e}}var Sa=Error(i(460)),Ca=Error(i(474)),wa=Error(i(542)),Ta={then:function(){}};function Ea(e){return e=e.status,e===`fulfilled`||e===`rejected`}function Da(e,t,n){switch(n=e[n],n===void 0?e.push(t):n!==t&&(t.then(en,en),t=n),t.status){case`fulfilled`:return t.value;case`rejected`:throw e=t.reason,ja(e),e;default:if(typeof t.status==`string`)t.then(en,en);else{if(e=q,e!==null&&100<e.shellSuspendCounter)throw Error(i(482));e=t,e.status=`pending`,e.then(function(e){if(t.status===`pending`){var n=t;n.status=`fulfilled`,n.value=e}},function(e){if(t.status===`pending`){var n=t;n.status=`rejected`,n.reason=e}})}switch(t.status){case`fulfilled`:return t.value;case`rejected`:throw e=t.reason,ja(e),e}throw ka=t,Sa}}function Oa(e){try{var t=e._init;return t(e._payload)}catch(e){throw typeof e==`object`&&e&&typeof e.then==`function`?(ka=e,Sa):e}}var ka=null;function Aa(){if(ka===null)throw Error(i(459));var e=ka;return ka=null,e}function ja(e){if(e===Sa||e===wa)throw Error(i(483))}var Ma=null,Na=0;function Pa(e){var t=Na;return Na+=1,Ma===null&&(Ma=[]),Da(Ma,e,t)}function Fa(e,t){t=t.props.ref,e.ref=t===void 0?null:t}function Ia(e,t){throw t.$$typeof===m?Error(i(525)):(e=Object.prototype.toString.call(t),Error(i(31,e===`[object Object]`?`object with keys {`+Object.keys(t).join(`, `)+`}`:e)))}function La(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 r(e){for(var t=new Map;e!==null;)e.key===null?t.set(e.index,e):t.set(e.key,e),e=e.sibling;return t}function a(e,t){return e=di(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|=67108866,n):(r=r.index,r<n?(t.flags|=67108866,n):r)):(t.flags|=1048576,n)}function s(t){return e&&t.alternate===null&&(t.flags|=67108866),t}function c(e,t,n,r){return t===null||t.tag!==6?(t=hi(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===_?d(e,t,n.props.children,r,n.key):t!==null&&(t.elementType===i||typeof i==`object`&&i&&i.$$typeof===w&&Oa(i)===t.type)?(t=a(t,n.props),Fa(t,n),t.return=e,t):(t=pi(n.type,n.key,n.props,null,e.mode,r),Fa(t,n),t.return=e,t)}function u(e,t,n,r){return t===null||t.tag!==4||t.stateNode.containerInfo!==n.containerInfo||t.stateNode.implementation!==n.implementation?(t=_i(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=mi(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`||typeof t==`bigint`)return t=hi(``+t,e.mode,n),t.return=e,t;if(typeof t==`object`&&t){switch(t.$$typeof){case h:return n=pi(t.type,t.key,t.props,null,e.mode,n),Fa(n,t),n.return=e,n;case g:return t=_i(t,e.mode,n),t.return=e,t;case w:return t=Oa(t),f(e,t,n)}if(oe(t)||re(t))return t=mi(t,e.mode,n,null),t.return=e,t;if(typeof t.then==`function`)return f(e,Pa(t),n);if(t.$$typeof===x)return f(e,na(e,t),n);Ia(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`||typeof n==`bigint`)return i===null?c(e,t,``+n,r):null;if(typeof n==`object`&&n){switch(n.$$typeof){case h:return n.key===i?l(e,t,n,r):null;case g:return n.key===i?u(e,t,n,r):null;case w:return n=Oa(n),p(e,t,n,r)}if(oe(n)||re(n))return i===null?d(e,t,n,r,null):null;if(typeof n.then==`function`)return p(e,t,Pa(n),r);if(n.$$typeof===x)return p(e,t,na(e,n),r);Ia(e,n)}return null}function m(e,t,n,r,i){if(typeof r==`string`&&r!==``||typeof r==`number`||typeof r==`bigint`)return e=e.get(n)||null,c(t,e,``+r,i);if(typeof r==`object`&&r){switch(r.$$typeof){case h:return e=e.get(r.key===null?n:r.key)||null,l(t,e,r,i);case g:return e=e.get(r.key===null?n:r.key)||null,u(t,e,r,i);case w:return r=Oa(r),m(e,t,n,r,i)}if(oe(r)||re(r))return e=e.get(n)||null,d(t,e,r,i,null);if(typeof r.then==`function`)return m(e,t,n,Pa(r),i);if(r.$$typeof===x)return m(e,t,n,na(t,r),i);Ia(t,r)}return null}function v(i,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(i,d,s[h],c);if(_===null){d===null&&(d=g);break}e&&d&&_.alternate===null&&t(i,d),a=o(_,a,h),u===null?l=_:u.sibling=_,u=_,d=g}if(h===s.length)return n(i,d),z&&ki(i,h),l;if(d===null){for(;h<s.length;h++)d=f(i,s[h],c),d!==null&&(a=o(d,a,h),u===null?l=d:u.sibling=d,u=d);return z&&ki(i,h),l}for(d=r(d);h<s.length;h++)g=m(d,i,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(i,e)}),z&&ki(i,h),l}function y(a,s,c,l){if(c==null)throw Error(i(151));for(var u=null,d=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),z&&ki(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 z&&ki(a,g),u}for(h=r(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)}),z&&ki(a,g),u}function b(e,r,o,c){if(typeof o==`object`&&o&&o.type===_&&o.key===null&&(o=o.props.children),typeof o==`object`&&o){switch(o.$$typeof){case h:a:{for(var l=o.key;r!==null;){if(r.key===l){if(l=o.type,l===_){if(r.tag===7){n(e,r.sibling),c=a(r,o.props.children),c.return=e,e=c;break a}}else if(r.elementType===l||typeof l==`object`&&l&&l.$$typeof===w&&Oa(l)===r.type){n(e,r.sibling),c=a(r,o.props),Fa(c,o),c.return=e,e=c;break a}n(e,r);break}else t(e,r);r=r.sibling}o.type===_?(c=mi(o.props.children,e.mode,c,o.key),c.return=e,e=c):(c=pi(o.type,o.key,o.props,null,e.mode,c),Fa(c,o),c.return=e,e=c)}return s(e);case g:a:{for(l=o.key;r!==null;){if(r.key===l)if(r.tag===4&&r.stateNode.containerInfo===o.containerInfo&&r.stateNode.implementation===o.implementation){n(e,r.sibling),c=a(r,o.children||[]),c.return=e,e=c;break a}else{n(e,r);break}else t(e,r);r=r.sibling}c=_i(o,e.mode,c),c.return=e,e=c}return s(e);case w:return o=Oa(o),b(e,r,o,c)}if(oe(o))return v(e,r,o,c);if(re(o)){if(l=re(o),typeof l!=`function`)throw Error(i(150));return o=l.call(o),y(e,r,o,c)}if(typeof o.then==`function`)return b(e,r,Pa(o),c);if(o.$$typeof===x)return b(e,r,na(e,o),c);Ia(e,o)}return typeof o==`string`&&o!==``||typeof o==`number`||typeof o==`bigint`?(o=``+o,r!==null&&r.tag===6?(n(e,r.sibling),c=a(r,o),c.return=e,e=c):(n(e,r),c=hi(o,e.mode,c),c.return=e,e=c),s(e)):n(e,r)}return function(e,t,n,r){try{Na=0;var i=b(e,t,n,r);return Ma=null,i}catch(t){if(t===Sa||t===wa)throw t;var a=li(29,t,null,e.mode);return a.lanes=r,a.return=e,a}}}var Ra=La(!0),za=La(!1),Ba=!1;function Va(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Ha(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function Ua(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function Wa(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,K&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,t=oi(e),ai(e,null,n),t}return ni(e,r,t,n),oi(e)}function Ga(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,n&4194048)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,et(e,n)}}function Ka(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={lane:n.lane,tag:n.tag,payload:n.payload,callback:null,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,callbacks:r.callbacks},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}var qa=!1;function Ja(){if(qa){var e=pa;if(e!==null)throw e}}function Ya(e,t,n,r){qa=!1;var i=e.updateQueue;Ba=!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&-536870913,m=f!==s.lane;if(m?(Y&f)===f:(r&f)===f){f!==0&&f===fa&&(qa=!0),u!==null&&(u=u.next={lane:0,tag:s.tag,payload:s.payload,callback:null,next:null});a:{var h=e,g=s;f=t;var _=n;switch(g.tag){case 1:if(h=g.payload,typeof h==`function`){d=h.call(_,d,f);break a}d=h;break a;case 3:h.flags=h.flags&-65537|128;case 0:if(h=g.payload,f=typeof h==`function`?h.call(_,d,f):h,f==null)break a;d=p({},d,f);break a;case 2:Ba=!0}}f=s.callback,f!==null&&(e.flags|=64,m&&(e.flags|=8192),m=i.callbacks,m===null?i.callbacks=[f]:m.push(f))}else m={lane:f,tag:s.tag,payload:s.payload,callback:s.callback,next:null},u===null?(l=u=m,c=d):u=u.next=m,o|=f;if(s=s.next,s===null){if(s=i.shared.pending,s===null)break;m=s,s=m.next,m.next=null,i.lastBaseUpdate=m,i.shared.pending=null}}while(1);u===null&&(c=d),i.baseState=c,i.firstBaseUpdate=l,i.lastBaseUpdate=u,a===null&&(i.shared.lanes=0),Gl|=o,e.lanes=o,e.memoizedState=d}}function Xa(e,t){if(typeof e!=`function`)throw Error(i(191,e));e.call(t)}function Za(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;e<n.length;e++)Xa(n[e],t)}var Qa=ue(null),$a=ue(0);function eo(e,t){e=Ul,A($a,e),A(Qa,t),Ul=e|t.baseLanes}function to(){A($a,Ul),A(Qa,Qa.current)}function no(){Ul=$a.current,k(Qa),k($a)}var ro=ue(null),io=null;function ao(e){var t=e.alternate;A(uo,uo.current&1),A(ro,e),io===null&&(t===null||Qa.current!==null||t.memoizedState!==null)&&(io=e)}function oo(e){A(uo,uo.current),A(ro,e),io===null&&(io=e)}function so(e){e.tag===22?(A(uo,uo.current),A(ro,e),io===null&&(io=e)):co(e)}function co(){A(uo,uo.current),A(ro,ro.current)}function lo(e){k(ro),io===e&&(io=null),k(uo)}var uo=ue(0);function fo(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||af(n)||of(n)))return t}else if(t.tag===19&&(t.memoizedProps.revealOrder===`forwards`||t.memoizedProps.revealOrder===`backwards`||t.memoizedProps.revealOrder===`unstable_legacy-backwards`||t.memoizedProps.revealOrder===`together`)){if(t.flags&128)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 po=0,B=null,V=null,mo=null,ho=!1,go=!1,_o=!1,vo=0,yo=0,bo=null,xo=0;function H(){throw Error(i(321))}function So(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!Cr(e[n],t[n]))return!1;return!0}function Co(e,t,n,r,i,a){return po=a,B=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,D.H=e===null||e.memoizedState===null?zs:Bs,_o=!1,a=n(r,i),_o=!1,go&&(a=To(t,n,r,i)),wo(e),a}function wo(e){D.H=Rs;var t=V!==null&&V.next!==null;if(po=0,mo=V=B=null,ho=!1,yo=0,bo=null,t)throw Error(i(300));e===null||rc||(e=e.dependencies,e!==null&&$i(e)&&(rc=!0))}function To(e,t,n,r){B=e;var a=0;do{if(go&&(bo=null),yo=0,go=!1,25<=a)throw Error(i(301));if(a+=1,mo=V=null,e.updateQueue!=null){var o=e.updateQueue;o.lastEffect=null,o.events=null,o.stores=null,o.memoCache!=null&&(o.memoCache.index=0)}D.H=Vs,o=t(n,r)}while(go);return o}function Eo(){var e=D.H,t=e.useState()[0];return t=typeof t.then==`function`?No(t):t,e=e.useState()[0],(V===null?null:V.memoizedState)!==e&&(B.flags|=1024),t}function Do(){var e=vo!==0;return vo=0,e}function Oo(e,t,n){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~n}function ko(e){if(ho){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}ho=!1}po=0,mo=V=B=null,go=!1,yo=vo=0,bo=null}function Ao(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return mo===null?B.memoizedState=mo=e:mo=mo.next=e,mo}function jo(){if(V===null){var e=B.alternate;e=e===null?null:e.memoizedState}else e=V.next;var t=mo===null?B.memoizedState:mo.next;if(t!==null)mo=t,V=e;else{if(e===null)throw B.alternate===null?Error(i(467)):Error(i(310));V=e,e={memoizedState:V.memoizedState,baseState:V.baseState,baseQueue:V.baseQueue,queue:V.queue,next:null},mo===null?B.memoizedState=mo=e:mo=mo.next=e}return mo}function Mo(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function No(e){var t=yo;return yo+=1,bo===null&&(bo=[]),e=Da(bo,e,t),t=B,(mo===null?t.memoizedState:mo.next)===null&&(t=t.alternate,D.H=t===null||t.memoizedState===null?zs:Bs),e}function Po(e){if(typeof e==`object`&&e){if(typeof e.then==`function`)return No(e);if(e.$$typeof===x)return ta(e)}throw Error(i(438,String(e)))}function Fo(e){var t=null,n=B.updateQueue;if(n!==null&&(t=n.memoCache),t==null){var r=B.alternate;r!==null&&(r=r.updateQueue,r!==null&&(r=r.memoCache,r!=null&&(t={data:r.data.map(function(e){return e.slice()}),index:0})))}if(t??={data:[],index:0},n===null&&(n=Mo(),B.updateQueue=n),n.memoCache=t,n=t.data[t.index],n===void 0)for(n=t.data[t.index]=Array(e),r=0;r<e;r++)n[r]=ne;return t.index++,n}function Io(e,t){return typeof t==`function`?t(e):t}function Lo(e){return Ro(jo(),V,e)}function Ro(e,t,n){var r=e.queue;if(r===null)throw Error(i(311));r.lastRenderedReducer=n;var a=e.baseQueue,o=r.pending;if(o!==null){if(a!==null){var s=a.next;a.next=o.next,o.next=s}t.baseQueue=a=o,r.pending=null}if(o=e.baseState,a===null)e.memoizedState=o;else{t=a.next;var c=s=null,l=null,u=t,d=!1;do{var f=u.lane&-536870913;if(f===u.lane?(po&f)===f:(Y&f)===f){var p=u.revertLane;if(p===0)l!==null&&(l=l.next={lane:0,revertLane:0,gesture:null,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null}),f===fa&&(d=!0);else if((po&p)===p){u=u.next,p===fa&&(d=!0);continue}else f={lane:0,revertLane:u.revertLane,gesture:null,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null},l===null?(c=l=f,s=o):l=l.next=f,B.lanes|=p,Gl|=p;f=u.action,_o&&n(o,f),o=u.hasEagerState?u.eagerState:n(o,f)}else p={lane:f,revertLane:u.revertLane,gesture:u.gesture,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null},l===null?(c=l=p,s=o):l=l.next=p,B.lanes|=f,Gl|=f;u=u.next}while(u!==null&&u!==t);if(l===null?s=o:l.next=c,!Cr(o,e.memoizedState)&&(rc=!0,d&&(n=pa,n!==null)))throw n;e.memoizedState=o,e.baseState=s,e.baseQueue=l,r.lastRenderedState=o}return a===null&&(r.lanes=0),[e.memoizedState,r.dispatch]}function zo(e){var t=jo(),n=t.queue;if(n===null)throw Error(i(311));n.lastRenderedReducer=e;var r=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);Cr(o,t.memoizedState)||(rc=!0),t.memoizedState=o,t.baseQueue===null&&(t.baseState=o),n.lastRenderedState=o}return[o,r]}function Bo(e,t,n){var r=B,a=jo(),o=z;if(o){if(n===void 0)throw Error(i(407));n=n()}else n=t();var s=!Cr((V||a).memoizedState,n);if(s&&(a.memoizedState=n,rc=!0),a=a.queue,us(Ho.bind(null,r,a,e),[e]),a.getSnapshot!==t||s||mo!==null&&mo.memoizedState.tag&1){if(r.flags|=2048,as(9,{destroy:void 0},U.bind(null,r,a,n,t),null),q===null)throw Error(i(349));o||po&127||Vo(r,t,n)}return n}function Vo(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=B.updateQueue,t===null?(t=Mo(),B.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function U(e,t,n,r){t.value=n,t.getSnapshot=r,Uo(t)&&Wo(e)}function Ho(e,t,n){return n(function(){Uo(t)&&Wo(e)})}function Uo(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!Cr(e,n)}catch{return!0}}function Wo(e){var t=ii(e,2);t!==null&&hu(t,e,2)}function Go(e){var t=Ao();if(typeof e==`function`){var n=e;if(e=n(),_o){Le(!0);try{n()}finally{Le(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Io,lastRenderedState:e},t}function Ko(e,t,n,r){return e.baseState=n,Ro(e,V,typeof r==`function`?r:Io)}function qo(e,t,n,r,a){if(Fs(e))throw Error(i(485));if(e=t.action,e!==null){var o={payload:a,action:e,next:null,isTransition:!0,status:`pending`,value:null,reason:null,listeners:[],then:function(e){o.listeners.push(e)}};D.T===null?o.isTransition=!1:n(!0),r(o),n=t.pending,n===null?(o.next=t.pending=o,Jo(t,o)):(o.next=n.next,t.pending=n.next=o)}}function Jo(e,t){var n=t.action,r=t.payload,i=e.state;if(t.isTransition){var a=D.T,o={};D.T=o;try{var s=n(i,r),c=D.S;c!==null&&c(o,s),Yo(e,t,s)}catch(n){Zo(e,t,n)}finally{a!==null&&o.types!==null&&(a.types=o.types),D.T=a}}else try{a=n(i,r),Yo(e,t,a)}catch(n){Zo(e,t,n)}}function Yo(e,t,n){typeof n==`object`&&n&&typeof n.then==`function`?n.then(function(n){Xo(e,t,n)},function(n){return Zo(e,t,n)}):Xo(e,t,n)}function Xo(e,t,n){t.status=`fulfilled`,t.value=n,Qo(t),e.state=n,t=e.pending,t!==null&&(n=t.next,n===t?e.pending=null:(n=n.next,t.next=n,Jo(e,n)))}function Zo(e,t,n){var r=e.pending;if(e.pending=null,r!==null){r=r.next;do t.status=`rejected`,t.reason=n,Qo(t),t=t.next;while(t!==r)}e.action=null}function Qo(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function $o(e,t){return t}function es(e,t){if(z){var n=q.formState;if(n!==null){a:{var r=B;if(z){if(R){b:{for(var i=R,a=Ii;i.nodeType!==8;){if(!a){i=null;break b}if(i=cf(i.nextSibling),i===null){i=null;break b}}a=i.data,i=a===`F!`||a===`F`?i:null}if(i){R=cf(i.nextSibling),r=i.data===`F!`;break a}}Ri(r)}r=!1}r&&(t=n[0])}}return n=Ao(),n.memoizedState=n.baseState=t,r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:$o,lastRenderedState:t},n.queue=r,n=Ms.bind(null,B,r),r.dispatch=n,r=Go(!1),a=Ps.bind(null,B,!1,r.queue),r=Ao(),i={state:t,dispatch:null,action:e,pending:null},r.queue=i,n=qo.bind(null,B,i,a,n),i.dispatch=n,r.memoizedState=e,[t,n,!1]}function ts(e){return ns(jo(),V,e)}function ns(e,t,n){if(t=Ro(e,t,$o)[0],e=Lo(Io)[0],typeof t==`object`&&t&&typeof t.then==`function`)try{var r=No(t)}catch(e){throw e===Sa?wa:e}else r=t;t=jo();var i=t.queue,a=i.dispatch;return n!==t.memoizedState&&(B.flags|=2048,as(9,{destroy:void 0},rs.bind(null,i,n),null)),[r,a,e]}function rs(e,t){e.action=t}function is(e){var t=jo(),n=V;if(n!==null)return ns(t,n,e);jo(),t=t.memoizedState,n=jo();var r=n.queue.dispatch;return n.memoizedState=e,[t,r,!1]}function as(e,t,n,r){return e={tag:e,create:n,deps:r,inst:t,next:null},t=B.updateQueue,t===null&&(t=Mo(),B.updateQueue=t),n=t.lastEffect,n===null?t.lastEffect=e.next=e:(r=n.next,n.next=e,e.next=r,t.lastEffect=e),e}function os(){return jo().memoizedState}function ss(e,t,n,r){var i=Ao();B.flags|=e,i.memoizedState=as(1|t,{destroy:void 0},n,r===void 0?null:r)}function cs(e,t,n,r){var i=jo();r=r===void 0?null:r;var a=i.memoizedState.inst;V!==null&&r!==null&&So(r,V.memoizedState.deps)?i.memoizedState=as(t,a,n,r):(B.flags|=e,i.memoizedState=as(1|t,a,n,r))}function ls(e,t){ss(8390656,8,e,t)}function us(e,t){cs(2048,8,e,t)}function ds(e){B.flags|=4;var t=B.updateQueue;if(t===null)t=Mo(),B.updateQueue=t,t.events=[e];else{var n=t.events;n===null?t.events=[e]:n.push(e)}}function fs(e){var t=jo().memoizedState;return ds({ref:t,nextImpl:e}),function(){if(K&2)throw Error(i(440));return t.impl.apply(void 0,arguments)}}function ps(e,t){return cs(4,2,e,t)}function ms(e,t){return cs(4,4,e,t)}function hs(e,t){if(typeof t==`function`){e=e();var n=t(e);return function(){typeof n==`function`?n():t(null)}}if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function gs(e,t,n){n=n==null?null:n.concat([e]),cs(4,4,hs.bind(null,t,e),n)}function _s(){}function vs(e,t){var n=jo();t=t===void 0?null:t;var r=n.memoizedState;return t!==null&&So(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function ys(e,t){var n=jo();t=t===void 0?null:t;var r=n.memoizedState;if(t!==null&&So(t,r[1]))return r[0];if(r=e(),_o){Le(!0);try{e()}finally{Le(!1)}}return n.memoizedState=[r,t],r}function bs(e,t,n){return n===void 0||po&1073741824&&!(Y&261930)?e.memoizedState=t:(e.memoizedState=n,e=mu(),B.lanes|=e,Gl|=e,n)}function xs(e,t,n,r){return Cr(n,t)?n:Qa.current===null?!(po&42)||po&1073741824&&!(Y&261930)?(rc=!0,e.memoizedState=n):(e=mu(),B.lanes|=e,Gl|=e,t):(e=bs(e,n,r),Cr(e,t)||(rc=!0),e)}function Ss(e,t,n,r,i){var a=O.p;O.p=a!==0&&8>a?a:8;var o=D.T,s={};D.T=s,Ps(e,!1,t,n);try{var c=i(),l=D.S;l!==null&&l(s,c),typeof c==`object`&&c&&typeof c.then==`function`?Ns(e,t,ga(c,r),pu(e)):Ns(e,t,r,pu(e))}catch(n){Ns(e,t,{then:function(){},status:`rejected`,reason:n},pu())}finally{O.p=a,o!==null&&s.types!==null&&(o.types=s.types),D.T=o}}function Cs(){}function ws(e,t,n,r){if(e.tag!==5)throw Error(i(476));var a=Ts(e).queue;Ss(e,a,t,se,n===null?Cs:function(){return Es(e),n(r)})}function Ts(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:se,baseState:se,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Io,lastRenderedState:se},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Io,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function Es(e){var t=Ts(e);t.next===null&&(t=e.alternate.memoizedState),Ns(e,t.next.queue,{},pu())}function Ds(){return ta(Qf)}function Os(){return jo().memoizedState}function ks(){return jo().memoizedState}function As(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=pu();e=Ua(n);var r=Wa(t,e,n);r!==null&&(hu(r,t,n),Ga(r,t,n)),t={cache:ca()},e.payload=t;return}t=t.return}}function js(e,t,n){var r=pu();n={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},Fs(e)?Is(t,n):(n=ri(e,t,n,r),n!==null&&(hu(n,e,r),Ls(n,t,r)))}function Ms(e,t,n){Ns(e,t,n,pu())}function Ns(e,t,n,r){var i={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(Fs(e))Is(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,Cr(s,o))return ni(e,t,i,0),q===null&&ti(),!1}catch{}if(n=ri(e,t,i,r),n!==null)return hu(n,e,r),Ls(n,t,r),!0}return!1}function Ps(e,t,n,r){if(r={lane:2,revertLane:dd(),gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null},Fs(e)){if(t)throw Error(i(479))}else t=ri(e,n,r,2),t!==null&&hu(t,e,2)}function Fs(e){var t=e.alternate;return e===B||t!==null&&t===B}function Is(e,t){go=ho=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function Ls(e,t,n){if(n&4194048){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,et(e,n)}}var Rs={readContext:ta,use:Po,useCallback:H,useContext:H,useEffect:H,useImperativeHandle:H,useLayoutEffect:H,useInsertionEffect:H,useMemo:H,useReducer:H,useRef:H,useState:H,useDebugValue:H,useDeferredValue:H,useTransition:H,useSyncExternalStore:H,useId:H,useHostTransitionStatus:H,useFormState:H,useActionState:H,useOptimistic:H,useMemoCache:H,useCacheRefresh:H};Rs.useEffectEvent=H;var zs={readContext:ta,use:Po,useCallback:function(e,t){return Ao().memoizedState=[e,t===void 0?null:t],e},useContext:ta,useEffect:ls,useImperativeHandle:function(e,t,n){n=n==null?null:n.concat([e]),ss(4194308,4,hs.bind(null,t,e),n)},useLayoutEffect:function(e,t){return ss(4194308,4,e,t)},useInsertionEffect:function(e,t){ss(4,2,e,t)},useMemo:function(e,t){var n=Ao();t=t===void 0?null:t;var r=e();if(_o){Le(!0);try{e()}finally{Le(!1)}}return n.memoizedState=[r,t],r},useReducer:function(e,t,n){var r=Ao();if(n!==void 0){var i=n(t);if(_o){Le(!0);try{n(t)}finally{Le(!1)}}}else i=t;return r.memoizedState=r.baseState=i,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:i},r.queue=e,e=e.dispatch=js.bind(null,B,e),[r.memoizedState,e]},useRef:function(e){var t=Ao();return e={current:e},t.memoizedState=e},useState:function(e){e=Go(e);var t=e.queue,n=Ms.bind(null,B,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:_s,useDeferredValue:function(e,t){return bs(Ao(),e,t)},useTransition:function(){var e=Go(!1);return e=Ss.bind(null,B,e.queue,!0,!1),Ao().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var r=B,a=Ao();if(z){if(n===void 0)throw Error(i(407));n=n()}else{if(n=t(),q===null)throw Error(i(349));Y&127||Vo(r,t,n)}a.memoizedState=n;var o={value:n,getSnapshot:t};return a.queue=o,ls(Ho.bind(null,r,o,e),[e]),r.flags|=2048,as(9,{destroy:void 0},U.bind(null,r,o,n,t),null),n},useId:function(){var e=Ao(),t=q.identifierPrefix;if(z){var n=Oi,r=Di;n=(r&~(1<<32-Re(r)-1)).toString(32)+n,t=`_`+t+`R_`+n,n=vo++,0<n&&(t+=`H`+n.toString(32)),t+=`_`}else n=xo++,t=`_`+t+`r_`+n.toString(32)+`_`;return e.memoizedState=t},useHostTransitionStatus:Ds,useFormState:es,useActionState:es,useOptimistic:function(e){var t=Ao();t.memoizedState=t.baseState=e;var n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=n,t=Ps.bind(null,B,!0,n),n.dispatch=t,[e,t]},useMemoCache:Fo,useCacheRefresh:function(){return Ao().memoizedState=As.bind(null,B)},useEffectEvent:function(e){var t=Ao(),n={impl:e};return t.memoizedState=n,function(){if(K&2)throw Error(i(440));return n.impl.apply(void 0,arguments)}}},Bs={readContext:ta,use:Po,useCallback:vs,useContext:ta,useEffect:us,useImperativeHandle:gs,useInsertionEffect:ps,useLayoutEffect:ms,useMemo:ys,useReducer:Lo,useRef:os,useState:function(){return Lo(Io)},useDebugValue:_s,useDeferredValue:function(e,t){return xs(jo(),V.memoizedState,e,t)},useTransition:function(){var e=Lo(Io)[0],t=jo().memoizedState;return[typeof e==`boolean`?e:No(e),t]},useSyncExternalStore:Bo,useId:Os,useHostTransitionStatus:Ds,useFormState:ts,useActionState:ts,useOptimistic:function(e,t){return Ko(jo(),V,e,t)},useMemoCache:Fo,useCacheRefresh:ks};Bs.useEffectEvent=fs;var Vs={readContext:ta,use:Po,useCallback:vs,useContext:ta,useEffect:us,useImperativeHandle:gs,useInsertionEffect:ps,useLayoutEffect:ms,useMemo:ys,useReducer:zo,useRef:os,useState:function(){return zo(Io)},useDebugValue:_s,useDeferredValue:function(e,t){var n=jo();return V===null?bs(n,e,t):xs(n,V.memoizedState,e,t)},useTransition:function(){var e=zo(Io)[0],t=jo().memoizedState;return[typeof e==`boolean`?e:No(e),t]},useSyncExternalStore:Bo,useId:Os,useHostTransitionStatus:Ds,useFormState:is,useActionState:is,useOptimistic:function(e,t){var n=jo();return V===null?(n.baseState=e,[e,n.queue.dispatch]):Ko(n,V,e,t)},useMemoCache:Fo,useCacheRefresh:ks};Vs.useEffectEvent=fs;function Hs(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:p({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var Us={enqueueSetState:function(e,t,n){e=e._reactInternals;var r=pu(),i=Ua(r);i.payload=t,n!=null&&(i.callback=n),t=Wa(e,i,r),t!==null&&(hu(t,e,r),Ga(t,e,r))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=pu(),i=Ua(r);i.tag=1,i.payload=t,n!=null&&(i.callback=n),t=Wa(e,i,r),t!==null&&(hu(t,e,r),Ga(t,e,r))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=pu(),r=Ua(n);r.tag=2,t!=null&&(r.callback=t),t=Wa(e,r,n),t!==null&&(hu(t,e,n),Ga(t,e,n))}};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?!wr(n,r)||!wr(i,a):!0}function Gs(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&&Us.enqueueReplaceState(t,t.state,null)}function Ks(e,t){var n=t;if(`ref`in t)for(var r in n={},t)r!==`ref`&&(n[r]=t[r]);if(e=e.defaultProps)for(var i in n===t&&(n=p({},n)),e)n[i]===void 0&&(n[i]=e[i]);return n}function qs(e){Zr(e)}function Js(e){console.error(e)}function Ys(e){Zr(e)}function Xs(e,t){try{var n=e.onUncaughtError;n(t.value,{componentStack:t.stack})}catch(e){setTimeout(function(){throw e})}}function Zs(e,t,n){try{var r=e.onCaughtError;r(n.value,{componentStack:n.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(e){setTimeout(function(){throw e})}}function Qs(e,t,n){return n=Ua(n),n.tag=3,n.payload={element:null},n.callback=function(){Xs(e,t)},n}function $s(e){return e=Ua(e),e.tag=3,e}function ec(e,t,n,r){var i=n.type.getDerivedStateFromError;if(typeof i==`function`){var a=r.value;e.payload=function(){return i(a)},e.callback=function(){Zs(t,n,r)}}var o=n.stateNode;o!==null&&typeof o.componentDidCatch==`function`&&(e.callback=function(){Zs(t,n,r),typeof i!=`function`&&(ru===null?ru=new Set([this]):ru.add(this));var e=r.stack;this.componentDidCatch(r.value,{componentStack:e===null?``:e})})}function tc(e,t,n,r,a){if(n.flags|=32768,typeof r==`object`&&r&&typeof r.then==`function`){if(t=n.alternate,t!==null&&Qi(t,n,a,!0),n=ro.current,n!==null){switch(n.tag){case 31:case 13:return io===null?Du():n.alternate===null&&Wl===0&&(Wl=3),n.flags&=-257,n.flags|=65536,n.lanes=a,r===Ta?n.flags|=16384:(t=n.updateQueue,t===null?n.updateQueue=new Set([r]):t.add(r),Gu(e,r,a)),!1;case 22:return n.flags|=65536,r===Ta?n.flags|=16384:(t=n.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([r])},n.updateQueue=t):(n=t.retryQueue,n===null?t.retryQueue=new Set([r]):n.add(r)),Gu(e,r,a)),!1}throw Error(i(435,n.tag))}return Gu(e,r,a),Du(),!1}if(z)return t=ro.current,t===null?(r!==Li&&(t=Error(i(423),{cause:r}),Wi(yi(t,n))),e=e.current.alternate,e.flags|=65536,a&=-a,e.lanes|=a,r=yi(r,n),a=Qs(e.stateNode,r,a),Ka(e,a),Wl!==4&&(Wl=2)):(!(t.flags&65536)&&(t.flags|=256),t.flags|=65536,t.lanes=a,r!==Li&&(e=Error(i(422),{cause:r}),Wi(yi(e,n)))),!1;var o=Error(i(520),{cause:r});if(o=yi(o,n),Xl===null?Xl=[o]:Xl.push(o),Wl!==4&&(Wl=2),t===null)return!0;r=yi(r,n),n=t;do{switch(n.tag){case 3:return n.flags|=65536,e=a&-a,n.lanes|=e,e=Qs(n.stateNode,r,e),Ka(n,e),!1;case 1:if(t=n.type,o=n.stateNode,!(n.flags&128)&&(typeof t.getDerivedStateFromError==`function`||o!==null&&typeof o.componentDidCatch==`function`&&(ru===null||!ru.has(o))))return n.flags|=65536,a&=-a,n.lanes|=a,a=$s(a),ec(a,e,n,r),Ka(n,a),!1}n=n.return}while(n!==null);return!1}var nc=Error(i(461)),rc=!1;function ic(e,t,n,r){t.child=e===null?za(t,null,n,r):Ra(t,e.child,n,r)}function ac(e,t,n,r,i){n=n.render;var a=t.ref;if(`ref`in r){var o={};for(var s in r)s!==`ref`&&(o[s]=r[s])}else o=r;return ea(t),r=Co(e,t,n,o,a,i),s=Do(),e!==null&&!rc?(Oo(e,t,i),kc(e,t,i)):(z&&s&&ji(t),t.flags|=1,ic(e,t,r,i),t.child)}function oc(e,t,n,r,i){if(e===null){var a=n.type;return typeof a==`function`&&!ui(a)&&a.defaultProps===void 0&&n.compare===null?(t.tag=15,t.type=a,sc(e,t,a,r,i)):(e=pi(n.type,null,r,t,t.mode,i),e.ref=t.ref,e.return=t,t.child=e)}if(a=e.child,!Ac(e,i)){var o=a.memoizedProps;if(n=n.compare,n=n===null?wr:n,n(o,r)&&e.ref===t.ref)return kc(e,t,i)}return t.flags|=1,e=di(a,r),e.ref=t.ref,e.return=t,t.child=e}function sc(e,t,n,r,i){if(e!==null){var a=e.memoizedProps;if(wr(a,r)&&e.ref===t.ref)if(rc=!1,t.pendingProps=r=a,Ac(e,i))e.flags&131072&&(rc=!0);else return t.lanes=e.lanes,kc(e,t,i)}return hc(e,t,n,r,i)}function cc(e,t,n,r){var i=r.children,a=e===null?null:e.memoizedState;if(e===null&&t.stateNode===null&&(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),r.mode===`hidden`){if(t.flags&128){if(a=a===null?n:a.baseLanes|n,e!==null){for(r=t.child=e.child,i=0;r!==null;)i=i|r.lanes|r.childLanes,r=r.sibling;r=i&~a}else r=0,t.child=null;return uc(e,t,a,n,r)}if(n&536870912)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&ba(t,a===null?null:a.cachePool),a===null?to():eo(t,a),so(t);else return r=t.lanes=536870912,uc(e,t,a===null?n:a.baseLanes|n,n,r)}else a===null?(e!==null&&ba(t,null),to(),co(t)):(ba(t,a.cachePool),eo(t,a),co(t),t.memoizedState=null);return ic(e,t,i,n),t.child}function lc(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function uc(e,t,n,r,i){var a=ya();return a=a===null?null:{parent:sa._currentValue,pool:a},t.memoizedState={baseLanes:n,cachePool:a},e!==null&&ba(t,null),to(),so(t),e!==null&&Qi(e,t,r,!0),t.childLanes=i,null}function dc(e,t){return t=wc({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function fc(e,t,n){return Ra(t,e.child,null,n),e=dc(t,t.pendingProps),e.flags|=2,lo(t),t.memoizedState=null,e}function pc(e,t,n){var r=t.pendingProps,a=(t.flags&128)!=0;if(t.flags&=-129,e===null){if(z){if(r.mode===`hidden`)return e=dc(t,r),t.lanes=536870912,lc(null,e);if(oo(t),(e=R)?(e=rf(e,Ii),e=e!==null&&e.data===`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Ei===null?null:{id:Di,overflow:Oi},retryLane:536870912,hydrationErrors:null},n=gi(e),n.return=t,t.child=n,Pi=t,R=null)):e=null,e===null)throw Ri(t);return t.lanes=536870912,null}return dc(t,r)}var o=e.memoizedState;if(o!==null){var s=o.dehydrated;if(oo(t),a)if(t.flags&256)t.flags&=-257,t=fc(e,t,n);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(i(558));else if(rc||Qi(e,t,n,!1),a=(n&e.childLanes)!==0,rc||a){if(r=q,r!==null&&(s=tt(r,n),s!==0&&s!==o.retryLane))throw o.retryLane=s,ii(e,s),hu(r,e,s),nc;Du(),t=fc(e,t,n)}else e=o.treeContext,R=cf(s.nextSibling),Pi=t,z=!0,Fi=null,Ii=!1,e!==null&&Ni(t,e),t=dc(t,r),t.flags|=4096;return t}return e=di(e.child,{mode:r.mode,children:r.children}),e.ref=t.ref,t.child=e,e.return=t,e}function mc(e,t){var n=t.ref;if(n===null)e!==null&&e.ref!==null&&(t.flags|=4194816);else{if(typeof n!=`function`&&typeof n!=`object`)throw Error(i(284));(e===null||e.ref!==n)&&(t.flags|=4194816)}}function hc(e,t,n,r,i){return ea(t),n=Co(e,t,n,r,void 0,i),r=Do(),e!==null&&!rc?(Oo(e,t,i),kc(e,t,i)):(z&&r&&ji(t),t.flags|=1,ic(e,t,n,i),t.child)}function gc(e,t,n,r,i,a){return ea(t),t.updateQueue=null,n=To(t,r,n,i),wo(e),r=Do(),e!==null&&!rc?(Oo(e,t,a),kc(e,t,a)):(z&&r&&ji(t),t.flags|=1,ic(e,t,n,a),t.child)}function _c(e,t,n,r,i){if(ea(t),t.stateNode===null){var a=si,o=n.contextType;typeof o==`object`&&o&&(a=ta(o)),a=new n(r,a),t.memoizedState=a.state!==null&&a.state!==void 0?a.state:null,a.updater=Us,t.stateNode=a,a._reactInternals=t,a=t.stateNode,a.props=r,a.state=t.memoizedState,a.refs={},Va(t),o=n.contextType,a.context=typeof o==`object`&&o?ta(o):si,a.state=t.memoizedState,o=n.getDerivedStateFromProps,typeof o==`function`&&(Hs(t,n,o,r),a.state=t.memoizedState),typeof n.getDerivedStateFromProps==`function`||typeof a.getSnapshotBeforeUpdate==`function`||typeof a.UNSAFE_componentWillMount!=`function`&&typeof a.componentWillMount!=`function`||(o=a.state,typeof a.componentWillMount==`function`&&a.componentWillMount(),typeof a.UNSAFE_componentWillMount==`function`&&a.UNSAFE_componentWillMount(),o!==a.state&&Us.enqueueReplaceState(a,a.state,null),Ya(t,r,a,i),Ja(),a.state=t.memoizedState),typeof a.componentDidMount==`function`&&(t.flags|=4194308),r=!0}else if(e===null){a=t.stateNode;var s=t.memoizedProps,c=Ks(n,s);a.props=c;var l=a.context,u=n.contextType;o=si,typeof u==`object`&&u&&(o=ta(u));var d=n.getDerivedStateFromProps;u=typeof d==`function`||typeof a.getSnapshotBeforeUpdate==`function`,s=t.pendingProps!==s,u||typeof a.UNSAFE_componentWillReceiveProps!=`function`&&typeof a.componentWillReceiveProps!=`function`||(s||l!==o)&&Gs(t,a,r,o),Ba=!1;var f=t.memoizedState;a.state=f,Ya(t,r,a,i),Ja(),l=t.memoizedState,s||f!==l||Ba?(typeof d==`function`&&(Hs(t,n,d,r),l=t.memoizedState),(c=Ba||Ws(t,n,c,r,f,l,o))?(u||typeof a.UNSAFE_componentWillMount!=`function`&&typeof a.componentWillMount!=`function`||(typeof a.componentWillMount==`function`&&a.componentWillMount(),typeof a.UNSAFE_componentWillMount==`function`&&a.UNSAFE_componentWillMount()),typeof a.componentDidMount==`function`&&(t.flags|=4194308)):(typeof a.componentDidMount==`function`&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=l),a.props=r,a.state=l,a.context=o,r=c):(typeof a.componentDidMount==`function`&&(t.flags|=4194308),r=!1)}else{a=t.stateNode,Ha(e,t),o=t.memoizedProps,u=Ks(n,o),a.props=u,d=t.pendingProps,f=a.context,l=n.contextType,c=si,typeof l==`object`&&l&&(c=ta(l)),s=n.getDerivedStateFromProps,(l=typeof s==`function`||typeof a.getSnapshotBeforeUpdate==`function`)||typeof a.UNSAFE_componentWillReceiveProps!=`function`&&typeof a.componentWillReceiveProps!=`function`||(o!==d||f!==c)&&Gs(t,a,r,c),Ba=!1,f=t.memoizedState,a.state=f,Ya(t,r,a,i),Ja();var p=t.memoizedState;o!==d||f!==p||Ba||e!==null&&e.dependencies!==null&&$i(e.dependencies)?(typeof s==`function`&&(Hs(t,n,s,r),p=t.memoizedState),(u=Ba||Ws(t,n,u,r,f,p,c)||e!==null&&e.dependencies!==null&&$i(e.dependencies))?(l||typeof a.UNSAFE_componentWillUpdate!=`function`&&typeof a.componentWillUpdate!=`function`||(typeof a.componentWillUpdate==`function`&&a.componentWillUpdate(r,p,c),typeof a.UNSAFE_componentWillUpdate==`function`&&a.UNSAFE_componentWillUpdate(r,p,c)),typeof a.componentDidUpdate==`function`&&(t.flags|=4),typeof a.getSnapshotBeforeUpdate==`function`&&(t.flags|=1024)):(typeof a.componentDidUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=p),a.props=r,a.state=p,a.context=c,r=u):(typeof a.componentDidUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),r=!1)}return a=r,mc(e,t),r=(t.flags&128)!=0,a||r?(a=t.stateNode,n=r&&typeof n.getDerivedStateFromError!=`function`?null:a.render(),t.flags|=1,e!==null&&r?(t.child=Ra(t,e.child,null,i),t.child=Ra(t,null,n,i)):ic(e,t,n,i),t.memoizedState=a.state,e=t.child):e=kc(e,t,i),e}function vc(e,t,n,r){return Hi(),t.flags|=256,ic(e,t,n,r),t.child}var yc={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function bc(e){return{baseLanes:e,cachePool:xa()}}function xc(e,t,n){return e=e===null?0:e.childLanes&~n,t&&(e|=Jl),e}function Sc(e,t,n){var r=t.pendingProps,a=!1,o=(t.flags&128)!=0,s;if((s=o)||(s=e!==null&&e.memoizedState===null?!1:(uo.current&2)!=0),s&&(a=!0,t.flags&=-129),s=(t.flags&32)!=0,t.flags&=-33,e===null){if(z){if(a?ao(t):co(t),(e=R)?(e=rf(e,Ii),e=e!==null&&e.data!==`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Ei===null?null:{id:Di,overflow:Oi},retryLane:536870912,hydrationErrors:null},n=gi(e),n.return=t,t.child=n,Pi=t,R=null)):e=null,e===null)throw Ri(t);return of(e)?t.lanes=32:t.lanes=536870912,null}var c=r.children;return r=r.fallback,a?(co(t),a=t.mode,c=wc({mode:`hidden`,children:c},a),r=mi(r,a,n,null),c.return=t,r.return=t,c.sibling=r,t.child=c,r=t.child,r.memoizedState=bc(n),r.childLanes=xc(e,s,n),t.memoizedState=yc,lc(null,r)):(ao(t),Cc(t,c))}var l=e.memoizedState;if(l!==null&&(c=l.dehydrated,c!==null)){if(o)t.flags&256?(ao(t),t.flags&=-257,t=Tc(e,t,n)):t.memoizedState===null?(co(t),c=r.fallback,a=t.mode,r=wc({mode:`visible`,children:r.children},a),c=mi(c,a,n,null),c.flags|=2,r.return=t,c.return=t,r.sibling=c,t.child=r,Ra(t,e.child,null,n),r=t.child,r.memoizedState=bc(n),r.childLanes=xc(e,s,n),t.memoizedState=yc,t=lc(null,r)):(co(t),t.child=e.child,t.flags|=128,t=null);else if(ao(t),of(c)){if(s=c.nextSibling&&c.nextSibling.dataset,s)var u=s.dgst;s=u,r=Error(i(419)),r.stack=``,r.digest=s,Wi({value:r,source:null,stack:null}),t=Tc(e,t,n)}else if(rc||Qi(e,t,n,!1),s=(n&e.childLanes)!==0,rc||s){if(s=q,s!==null&&(r=tt(s,n),r!==0&&r!==l.retryLane))throw l.retryLane=r,ii(e,r),hu(s,e,r),nc;af(c)||Du(),t=Tc(e,t,n)}else af(c)?(t.flags|=192,t.child=e.child,t=null):(e=l.treeContext,R=cf(c.nextSibling),Pi=t,z=!0,Fi=null,Ii=!1,e!==null&&Ni(t,e),t=Cc(t,r.children),t.flags|=4096);return t}return a?(co(t),c=r.fallback,a=t.mode,l=e.child,u=l.sibling,r=di(l,{mode:`hidden`,children:r.children}),r.subtreeFlags=l.subtreeFlags&65011712,u===null?(c=mi(c,a,n,null),c.flags|=2):c=di(u,c),c.return=t,r.return=t,r.sibling=c,t.child=r,lc(null,r),r=t.child,c=e.child.memoizedState,c===null?c=bc(n):(a=c.cachePool,a===null?a=xa():(l=sa._currentValue,a=a.parent===l?a:{parent:l,pool:l}),c={baseLanes:c.baseLanes|n,cachePool:a}),r.memoizedState=c,r.childLanes=xc(e,s,n),t.memoizedState=yc,lc(e.child,r)):(ao(t),n=e.child,e=n.sibling,n=di(n,{mode:`visible`,children:r.children}),n.return=t,n.sibling=null,e!==null&&(s=t.deletions,s===null?(t.deletions=[e],t.flags|=16):s.push(e)),t.child=n,t.memoizedState=null,n)}function Cc(e,t){return t=wc({mode:`visible`,children:t},e.mode),t.return=e,e.child=t}function wc(e,t){return e=li(22,e,null,t),e.lanes=0,e}function Tc(e,t,n){return Ra(t,e.child,null,n),e=Cc(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function Ec(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),Xi(e.return,t,n)}function Dc(e,t,n,r,i,a){var o=e.memoizedState;o===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:i,treeForkCount:a}:(o.isBackwards=t,o.rendering=null,o.renderingStartTime=0,o.last=r,o.tail=n,o.tailMode=i,o.treeForkCount=a)}function Oc(e,t,n){var r=t.pendingProps,i=r.revealOrder,a=r.tail;r=r.children;var o=uo.current,s=(o&2)!=0;if(s?(o=o&1|2,t.flags|=128):o&=1,A(uo,o),ic(e,t,r,n),r=z?Ci:0,!s&&e!==null&&e.flags&128)a:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&Ec(e,n,t);else if(e.tag===19)Ec(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}switch(i){case`forwards`:for(n=t.child,i=null;n!==null;)e=n.alternate,e!==null&&fo(e)===null&&(i=n),n=n.sibling;n=i,n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null),Dc(t,!1,i,n,a,r);break;case`backwards`:case`unstable_legacy-backwards`:for(n=null,i=t.child,t.child=null;i!==null;){if(e=i.alternate,e!==null&&fo(e)===null){t.child=i;break}e=i.sibling,i.sibling=n,n=i,i=e}Dc(t,!0,n,null,a,r);break;case`together`:Dc(t,!1,null,null,void 0,r);break;default:t.memoizedState=null}return t.child}function kc(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),Gl|=t.lanes,(n&t.childLanes)===0)if(e!==null){if(Qi(e,t,n,!1),(n&t.childLanes)===0)return null}else return null;if(e!==null&&t.child!==e.child)throw Error(i(153));if(t.child!==null){for(e=t.child,n=di(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=di(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function Ac(e,t){return(e.lanes&t)===0?(e=e.dependencies,!!(e!==null&&$i(e))):!0}function jc(e,t,n){switch(t.tag){case 3:he(t,t.stateNode.containerInfo),Ji(t,sa,e.memoizedState.cache),Hi();break;case 27:case 5:_e(t);break;case 4:he(t,t.stateNode.containerInfo);break;case 10:Ji(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,oo(t),null;break;case 13:var r=t.memoizedState;if(r!==null)return r.dehydrated===null?(n&t.child.childLanes)===0?(ao(t),e=kc(e,t,n),e===null?null:e.sibling):Sc(e,t,n):(ao(t),t.flags|=128,null);ao(t);break;case 19:var i=(e.flags&128)!=0;if(r=(n&t.childLanes)!==0,r||=(Qi(e,t,n,!1),(n&t.childLanes)!==0),i){if(r)return Oc(e,t,n);t.flags|=128}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),A(uo,uo.current),r)break;return null;case 22:return t.lanes=0,cc(e,t,n,t.pendingProps);case 24:Ji(t,sa,e.memoizedState.cache)}return kc(e,t,n)}function Mc(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps)rc=!0;else{if(!Ac(e,n)&&!(t.flags&128))return rc=!1,jc(e,t,n);rc=!!(e.flags&131072)}else rc=!1,z&&t.flags&1048576&&Ai(t,Ci,t.index);switch(t.lanes=0,t.tag){case 16:a:{var r=t.pendingProps;if(e=Oa(t.elementType),t.type=e,typeof e==`function`)ui(e)?(r=Ks(e,r),t.tag=1,t=_c(null,t,e,r,n)):(t.tag=0,t=hc(null,t,e,r,n));else{if(e!=null){var a=e.$$typeof;if(a===S){t.tag=11,t=ac(null,t,e,r,n);break a}else if(a===C){t.tag=14,t=oc(null,t,e,r,n);break a}}throw t=ae(e)||e,Error(i(306,t,``))}}return t;case 0:return hc(e,t,t.type,t.pendingProps,n);case 1:return r=t.type,a=Ks(r,t.pendingProps),_c(e,t,r,a,n);case 3:a:{if(he(t,t.stateNode.containerInfo),e===null)throw Error(i(387));r=t.pendingProps;var o=t.memoizedState;a=o.element,Ha(e,t),Ya(t,r,null,n);var s=t.memoizedState;if(r=s.cache,Ji(t,sa,r),r!==o.cache&&Zi(t,[sa],n,!0),Ja(),r=s.element,o.isDehydrated)if(o={element:r,isDehydrated:!1,cache:s.cache},t.updateQueue.baseState=o,t.memoizedState=o,t.flags&256){t=vc(e,t,r,n);break a}else if(r!==a){a=yi(Error(i(424)),t),Wi(a),t=vc(e,t,r,n);break a}else{switch(e=t.stateNode.containerInfo,e.nodeType){case 9:e=e.body;break;default:e=e.nodeName===`HTML`?e.ownerDocument.body:e}for(R=cf(e.firstChild),Pi=t,z=!0,Fi=null,Ii=!0,n=za(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling}else{if(Hi(),r===a){t=kc(e,t,n);break a}ic(e,t,r,n)}t=t.child}return t;case 26:return mc(e,t),e===null?(n=kf(t.type,null,t.pendingProps,null))?t.memoizedState=n:z||(n=t.type,e=t.pendingProps,r=Bd(pe.current).createElement(n),r[st]=t,r[ct]=e,Pd(r,n,e),xt(r),t.stateNode=r):t.memoizedState=kf(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return _e(t),e===null&&z&&(r=t.stateNode=ff(t.type,t.pendingProps,pe.current),Pi=t,Ii=!0,a=R,Zd(t.type)?(lf=a,R=cf(r.firstChild)):R=a),ic(e,t,t.pendingProps.children,n),mc(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&z&&((a=r=R)&&(r=tf(r,t.type,t.pendingProps,Ii),r===null?a=!1:(t.stateNode=r,Pi=t,R=cf(r.firstChild),Ii=!1,a=!0)),a||Ri(t)),_e(t),a=t.type,o=t.pendingProps,s=e===null?null:e.memoizedProps,r=o.children,Ud(a,o)?r=null:s!==null&&Ud(a,s)&&(t.flags|=32),t.memoizedState!==null&&(a=Co(e,t,Eo,null,null,n),Qf._currentValue=a),mc(e,t),ic(e,t,r,n),t.child;case 6:return e===null&&z&&((e=n=R)&&(n=nf(n,t.pendingProps,Ii),n===null?e=!1:(t.stateNode=n,Pi=t,R=null,e=!0)),e||Ri(t)),null;case 13:return Sc(e,t,n);case 4:return he(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=Ra(t,null,r,n):ic(e,t,r,n),t.child;case 11:return ac(e,t,t.type,t.pendingProps,n);case 7:return ic(e,t,t.pendingProps,n),t.child;case 8:return ic(e,t,t.pendingProps.children,n),t.child;case 12:return ic(e,t,t.pendingProps.children,n),t.child;case 10:return r=t.pendingProps,Ji(t,t.type,r.value),ic(e,t,r.children,n),t.child;case 9:return a=t.type._context,r=t.pendingProps.children,ea(t),a=ta(a),r=r(a),t.flags|=1,ic(e,t,r,n),t.child;case 14:return oc(e,t,t.type,t.pendingProps,n);case 15:return sc(e,t,t.type,t.pendingProps,n);case 19:return Oc(e,t,n);case 31:return pc(e,t,n);case 22:return cc(e,t,n,t.pendingProps);case 24:return ea(t),r=ta(sa),e===null?(a=ya(),a===null&&(a=q,o=ca(),a.pooledCache=o,o.refCount++,o!==null&&(a.pooledCacheLanes|=n),a=o),t.memoizedState={parent:r,cache:a},Va(t),Ji(t,sa,a)):((e.lanes&n)!==0&&(Ha(e,t),Ya(t,null,null,n),Ja()),a=e.memoizedState,o=t.memoizedState,a.parent===r?(r=o.cache,Ji(t,sa,r),r!==a.cache&&Zi(t,[sa],n,!0)):(a={parent:r,cache:r},t.memoizedState=a,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=a),Ji(t,sa,r))),ic(e,t,t.pendingProps.children,n),t.child;case 29:throw t.pendingProps}throw Error(i(156,t.tag))}function Nc(e){e.flags|=4}function Pc(e,t,n,r,i){if((t=(e.mode&32)!=0)&&(t=!1),t){if(e.flags|=16777216,(i&335544128)===i)if(e.stateNode.complete)e.flags|=8192;else if(wu())e.flags|=8192;else throw ka=Ta,Ca}else e.flags&=-16777217}function Fc(e,t){if(t.type!==`stylesheet`||t.state.loading&4)e.flags&=-16777217;else if(e.flags|=16777216,!Wf(t))if(wu())e.flags|=8192;else throw ka=Ta,Ca}function Ic(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag===22?536870912:Ye(),e.lanes|=t,Yl|=t)}function Lc(e,t){if(!z)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 W(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&65011712,r|=i.flags&65011712,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 Rc(e,t,n){var r=t.pendingProps;switch(Mi(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return W(t),null;case 1:return W(t),null;case 3:return n=t.stateNode,r=null,e!==null&&(r=e.memoizedState.cache),t.memoizedState.cache!==r&&(t.flags|=2048),Yi(sa),ge(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(Vi(t)?Nc(t):e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,Ui())),W(t),null;case 26:var a=t.type,o=t.memoizedState;return e===null?(Nc(t),o===null?(W(t),Pc(t,a,null,r,n)):(W(t),Fc(t,o))):o?o===e.memoizedState?(W(t),t.flags&=-16777217):(Nc(t),W(t),Fc(t,o)):(e=e.memoizedProps,e!==r&&Nc(t),W(t),Pc(t,a,e,r,n)),null;case 27:if(j(t),n=pe.current,a=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&Nc(t);else{if(!r){if(t.stateNode===null)throw Error(i(166));return W(t),null}e=de.current,Vi(t)?zi(t,e):(e=ff(a,r,n),t.stateNode=e,Nc(t))}return W(t),null;case 5:if(j(t),a=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&Nc(t);else{if(!r){if(t.stateNode===null)throw Error(i(166));return W(t),null}if(o=de.current,Vi(t))zi(t,o);else{var s=Bd(pe.current);switch(o){case 1:o=s.createElementNS(`http://www.w3.org/2000/svg`,a);break;case 2:o=s.createElementNS(`http://www.w3.org/1998/Math/MathML`,a);break;default:switch(a){case`svg`:o=s.createElementNS(`http://www.w3.org/2000/svg`,a);break;case`math`:o=s.createElementNS(`http://www.w3.org/1998/Math/MathML`,a);break;case`script`:o=s.createElement(`div`),o.innerHTML=`<script><\/script>`,o=o.removeChild(o.firstChild);break;case`select`:o=typeof r.is==`string`?s.createElement(`select`,{is:r.is}):s.createElement(`select`),r.multiple?o.multiple=!0:r.size&&(o.size=r.size);break;default:o=typeof r.is==`string`?s.createElement(a,{is:r.is}):s.createElement(a)}}o[st]=t,o[ct]=r;a:for(s=t.child;s!==null;){if(s.tag===5||s.tag===6)o.appendChild(s.stateNode);else if(s.tag!==4&&s.tag!==27&&s.child!==null){s.child.return=s,s=s.child;continue}if(s===t)break a;for(;s.sibling===null;){if(s.return===null||s.return===t)break a;s=s.return}s.sibling.return=s.return,s=s.sibling}t.stateNode=o;a:switch(Pd(o,a,r),a){case`button`:case`input`:case`select`:case`textarea`:r=!!r.autoFocus;break a;case`img`:r=!0;break a;default:r=!1}r&&Nc(t)}}return W(t),Pc(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==r&&Nc(t);else{if(typeof r!=`string`&&t.stateNode===null)throw Error(i(166));if(e=pe.current,Vi(t)){if(e=t.stateNode,n=t.memoizedProps,r=null,a=Pi,a!==null)switch(a.tag){case 27:case 5:r=a.memoizedProps}e[st]=t,e=!!(e.nodeValue===n||r!==null&&!0===r.suppressHydrationWarning||Md(e.nodeValue,n)),e||Ri(t,!0)}else e=Bd(e).createTextNode(r),e[st]=t,t.stateNode=e}return W(t),null;case 31:if(n=t.memoizedState,e===null||e.memoizedState!==null){if(r=Vi(t),n!==null){if(e===null){if(!r)throw Error(i(318));if(e=t.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(557));e[st]=t}else Hi(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;W(t),e=!1}else n=Ui(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return t.flags&256?(lo(t),t):(lo(t),null);if(t.flags&128)throw Error(i(558))}return W(t),null;case 13:if(r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(a=Vi(t),r!==null&&r.dehydrated!==null){if(e===null){if(!a)throw Error(i(318));if(a=t.memoizedState,a=a===null?null:a.dehydrated,!a)throw Error(i(317));a[st]=t}else Hi(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;W(t),a=!1}else a=Ui(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=a),a=!0;if(!a)return t.flags&256?(lo(t),t):(lo(t),null)}return lo(t),t.flags&128?(t.lanes=n,t):(n=r!==null,e=e!==null&&e.memoizedState!==null,n&&(r=t.child,a=null,r.alternate!==null&&r.alternate.memoizedState!==null&&r.alternate.memoizedState.cachePool!==null&&(a=r.alternate.memoizedState.cachePool.pool),o=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(o=r.memoizedState.cachePool.pool),o!==a&&(r.flags|=2048)),n!==e&&n&&(t.child.flags|=8192),Ic(t,t.updateQueue),W(t),null);case 4:return ge(),e===null&&Sd(t.stateNode.containerInfo),W(t),null;case 10:return Yi(t.type),W(t),null;case 19:if(k(uo),r=t.memoizedState,r===null)return W(t),null;if(a=(t.flags&128)!=0,o=r.rendering,o===null)if(a)Lc(r,!1);else{if(Wl!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(o=fo(e),o!==null){for(t.flags|=128,Lc(r,!1),e=o.updateQueue,t.updateQueue=e,Ic(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)fi(n,e),n=n.sibling;return A(uo,uo.current&1|2),z&&ki(t,r.treeForkCount),t.child}e=e.sibling}r.tail!==null&&P()>tu&&(t.flags|=128,a=!0,Lc(r,!1),t.lanes=4194304)}else{if(!a)if(e=fo(o),e!==null){if(t.flags|=128,a=!0,e=e.updateQueue,t.updateQueue=e,Ic(t,e),Lc(r,!0),r.tail===null&&r.tailMode===`hidden`&&!o.alternate&&!z)return W(t),null}else 2*P()-r.renderingStartTime>tu&&n!==536870912&&(t.flags|=128,a=!0,Lc(r,!1),t.lanes=4194304);r.isBackwards?(o.sibling=t.child,t.child=o):(e=r.last,e===null?t.child=o:e.sibling=o,r.last=o)}return r.tail===null?(W(t),null):(e=r.tail,r.rendering=e,r.tail=e.sibling,r.renderingStartTime=P(),e.sibling=null,n=uo.current,A(uo,a?n&1|2:n&1),z&&ki(t,r.treeForkCount),e);case 22:case 23:return lo(t),no(),r=t.memoizedState!==null,e===null?r&&(t.flags|=8192):e.memoizedState!==null!==r&&(t.flags|=8192),r?n&536870912&&!(t.flags&128)&&(W(t),t.subtreeFlags&6&&(t.flags|=8192)):W(t),n=t.updateQueue,n!==null&&Ic(t,n.retryQueue),n=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),r=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(r=t.memoizedState.cachePool.pool),r!==n&&(t.flags|=2048),e!==null&&k(va),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),Yi(sa),W(t),null;case 25:return null;case 30:return null}throw Error(i(156,t.tag))}function zc(e,t){switch(Mi(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Yi(sa),ge(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return j(t),null;case 31:if(t.memoizedState!==null){if(lo(t),t.alternate===null)throw Error(i(340));Hi()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(lo(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(i(340));Hi()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return k(uo),null;case 4:return ge(),null;case 10:return Yi(t.type),null;case 22:case 23:return lo(t),no(),e!==null&&k(va),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return Yi(sa),null;case 25:return null;default:return null}}function Bc(e,t){switch(Mi(t),t.tag){case 3:Yi(sa),ge();break;case 26:case 27:case 5:j(t);break;case 4:ge();break;case 31:t.memoizedState!==null&&lo(t);break;case 13:lo(t);break;case 19:k(uo);break;case 10:Yi(t.type);break;case 22:case 23:lo(t),no(),e!==null&&k(va);break;case 24:Yi(sa)}}function Vc(e,t){try{var n=t.updateQueue,r=n===null?null:n.lastEffect;if(r!==null){var i=r.next;n=i;do{if((n.tag&e)===e){r=void 0;var a=n.create,o=n.inst;r=a(),o.destroy=r}n=n.next}while(n!==i)}}catch(e){Z(t,t.return,e)}}function Hc(e,t,n){try{var r=t.updateQueue,i=r===null?null:r.lastEffect;if(i!==null){var a=i.next;r=a;do{if((r.tag&e)===e){var o=r.inst,s=o.destroy;if(s!==void 0){o.destroy=void 0,i=t;var c=n,l=s;try{l()}catch(e){Z(i,c,e)}}}r=r.next}while(r!==a)}}catch(e){Z(t,t.return,e)}}function Uc(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{Za(t,n)}catch(t){Z(e,e.return,t)}}}function Wc(e,t,n){n.props=Ks(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(n){Z(e,t,n)}}function Gc(e,t){try{var n=e.ref;if(n!==null){switch(e.tag){case 26:case 27:case 5:var r=e.stateNode;break;case 30:r=e.stateNode;break;default:r=e.stateNode}typeof n==`function`?e.refCleanup=n(r):n.current=r}}catch(n){Z(e,t,n)}}function Kc(e,t){var n=e.ref,r=e.refCleanup;if(n!==null)if(typeof r==`function`)try{r()}catch(n){Z(e,t,n)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof n==`function`)try{n(null)}catch(n){Z(e,t,n)}else n.current=null}function qc(e){var t=e.type,n=e.memoizedProps,r=e.stateNode;try{a:switch(t){case`button`:case`input`:case`select`:case`textarea`:n.autoFocus&&r.focus();break a;case`img`:n.src?r.src=n.src:n.srcSet&&(r.srcset=n.srcSet)}}catch(t){Z(e,e.return,t)}}function Jc(e,t,n){try{var r=e.stateNode;Fd(r,e.type,n,t),r[ct]=t}catch(t){Z(e,e.return,t)}}function Yc(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&Zd(e.type)||e.tag===4}function Xc(e){a:for(;;){for(;e.sibling===null;){if(e.return===null||Yc(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.tag===27&&Zd(e.type)||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 Zc(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?(n.nodeType===9?n.body:n.nodeName===`HTML`?n.ownerDocument.body:n).insertBefore(e,t):(t=n.nodeType===9?n.body:n.nodeName===`HTML`?n.ownerDocument.body:n,t.appendChild(e),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=en));else if(r!==4&&(r===27&&Zd(e.type)&&(n=e.stateNode,t=null),e=e.child,e!==null))for(Zc(e,t,n),e=e.sibling;e!==null;)Zc(e,t,n),e=e.sibling}function Qc(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&&(r===27&&Zd(e.type)&&(n=e.stateNode),e=e.child,e!==null))for(Qc(e,t,n),e=e.sibling;e!==null;)Qc(e,t,n),e=e.sibling}function $c(e){var t=e.stateNode,n=e.memoizedProps;try{for(var r=e.type,i=t.attributes;i.length;)t.removeAttributeNode(i[0]);Pd(t,r,n),t[st]=e,t[ct]=n}catch(t){Z(e,e.return,t)}}var el=!1,tl=!1,nl=!1,rl=typeof WeakSet==`function`?WeakSet:Set,il=null;function al(e,t){if(e=e.containerInfo,Rd=sp,e=Or(e),kr(e)){if(`selectionStart`in e)var n={start:e.selectionStart,end:e.selectionEnd};else a:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var a=r.anchorOffset,o=r.focusNode;r=r.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||r!==0&&f.nodeType!==3||(l=s+r),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===r&&(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(zd={focusedElem:e,selectionRange:n},sp=!1,il=t;il!==null;)if(t=il,e=t.child,t.subtreeFlags&1028&&e!==null)e.return=t,il=e;else for(;il!==null;){switch(t=il,o=t.alternate,e=t.flags,t.tag){case 0:if(e&4&&(e=t.updateQueue,e=e===null?null:e.events,e!==null))for(n=0;n<e.length;n++)a=e[n],a.ref.impl=a.nextImpl;break;case 11:case 15:break;case 1:if(e&1024&&o!==null){e=void 0,n=t,a=o.memoizedProps,o=o.memoizedState,r=n.stateNode;try{var h=Ks(n.type,a);e=r.getSnapshotBeforeUpdate(h,o),r.__reactInternalSnapshotBeforeUpdate=e}catch(e){Z(n,n.return,e)}}break;case 3:if(e&1024){if(e=t.stateNode.containerInfo,n=e.nodeType,n===9)ef(e);else if(n===1)switch(e.nodeName){case`HEAD`:case`HTML`:case`BODY`:ef(e);break;default:e.textContent=``}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if(e&1024)throw Error(i(163))}if(e=t.sibling,e!==null){e.return=t.return,il=e;break}il=t.return}}function ol(e,t,n){var r=n.flags;switch(n.tag){case 0:case 11:case 15:bl(e,n),r&4&&Vc(5,n);break;case 1:if(bl(e,n),r&4)if(e=n.stateNode,t===null)try{e.componentDidMount()}catch(e){Z(n,n.return,e)}else{var i=Ks(n.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(i,t,e.__reactInternalSnapshotBeforeUpdate)}catch(e){Z(n,n.return,e)}}r&64&&Uc(n),r&512&&Gc(n,n.return);break;case 3:if(bl(e,n),r&64&&(e=n.updateQueue,e!==null)){if(t=null,n.child!==null)switch(n.child.tag){case 27:case 5:t=n.child.stateNode;break;case 1:t=n.child.stateNode}try{Za(e,t)}catch(e){Z(n,n.return,e)}}break;case 27:t===null&&r&4&&$c(n);case 26:case 5:bl(e,n),t===null&&r&4&&qc(n),r&512&&Gc(n,n.return);break;case 12:bl(e,n);break;case 31:bl(e,n),r&4&&dl(e,n);break;case 13:bl(e,n),r&4&&fl(e,n),r&64&&(e=n.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(n=Ju.bind(null,n),sf(e,n))));break;case 22:if(r=n.memoizedState!==null||el,!r){t=t!==null&&t.memoizedState!==null||tl,i=el;var a=tl;el=r,(tl=t)&&!a?Sl(e,n,(n.subtreeFlags&8772)!=0):bl(e,n),el=i,tl=a}break;case 30:break;default:bl(e,n)}}function sl(e){var t=e.alternate;t!==null&&(e.alternate=null,sl(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&_t(t)),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}var G=null,cl=!1;function ll(e,t,n){for(n=n.child;n!==null;)ul(e,t,n),n=n.sibling}function ul(e,t,n){if(F&&typeof F.onCommitFiberUnmount==`function`)try{F.onCommitFiberUnmount(Ie,n)}catch{}switch(n.tag){case 26:tl||Kc(n,t),ll(e,t,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&(n=n.stateNode,n.parentNode.removeChild(n));break;case 27:tl||Kc(n,t);var r=G,i=cl;Zd(n.type)&&(G=n.stateNode,cl=!1),ll(e,t,n),pf(n.stateNode),G=r,cl=i;break;case 5:tl||Kc(n,t);case 6:if(r=G,i=cl,G=null,ll(e,t,n),G=r,cl=i,G!==null)if(cl)try{(G.nodeType===9?G.body:G.nodeName===`HTML`?G.ownerDocument.body:G).removeChild(n.stateNode)}catch(e){Z(n,t,e)}else try{G.removeChild(n.stateNode)}catch(e){Z(n,t,e)}break;case 18:G!==null&&(cl?(e=G,Qd(e.nodeType===9?e.body:e.nodeName===`HTML`?e.ownerDocument.body:e,n.stateNode),Np(e)):Qd(G,n.stateNode));break;case 4:r=G,i=cl,G=n.stateNode.containerInfo,cl=!0,ll(e,t,n),G=r,cl=i;break;case 0:case 11:case 14:case 15:Hc(2,n,t),tl||Hc(4,n,t),ll(e,t,n);break;case 1:tl||(Kc(n,t),r=n.stateNode,typeof r.componentWillUnmount==`function`&&Wc(n,t,r)),ll(e,t,n);break;case 21:ll(e,t,n);break;case 22:tl=(r=tl)||n.memoizedState!==null,ll(e,t,n),tl=r;break;default:ll(e,t,n)}}function dl(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{Np(e)}catch(e){Z(t,t.return,e)}}}function fl(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{Np(e)}catch(e){Z(t,t.return,e)}}function pl(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new rl),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new rl),t;default:throw Error(i(435,e.tag))}}function ml(e,t){var n=pl(e);t.forEach(function(t){if(!n.has(t)){n.add(t);var r=Yu.bind(null,e,t);t.then(r,r)}})}function hl(e,t){var n=t.deletions;if(n!==null)for(var r=0;r<n.length;r++){var a=n[r],o=e,s=t,c=s;a:for(;c!==null;){switch(c.tag){case 27:if(Zd(c.type)){G=c.stateNode,cl=!1;break a}break;case 5:G=c.stateNode,cl=!1;break a;case 3:case 4:G=c.stateNode.containerInfo,cl=!0;break a}c=c.return}if(G===null)throw Error(i(160));ul(o,s,a),G=null,cl=!1,o=a.alternate,o!==null&&(o.return=null),a.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)_l(t,e),t=t.sibling}var gl=null;function _l(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:hl(t,e),vl(e),r&4&&(Hc(3,e,e.return),Vc(3,e),Hc(5,e,e.return));break;case 1:hl(t,e),vl(e),r&512&&(tl||n===null||Kc(n,n.return)),r&64&&el&&(e=e.updateQueue,e!==null&&(r=e.callbacks,r!==null&&(n=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=n===null?r:n.concat(r))));break;case 26:var a=gl;if(hl(t,e),vl(e),r&512&&(tl||n===null||Kc(n,n.return)),r&4){var o=n===null?null:n.memoizedState;if(r=e.memoizedState,n===null)if(r===null)if(e.stateNode===null){a:{r=e.type,n=e.memoizedProps,a=a.ownerDocument||a;b:switch(r){case`title`:o=a.getElementsByTagName(`title`)[0],(!o||o[gt]||o[st]||o.namespaceURI===`http://www.w3.org/2000/svg`||o.hasAttribute(`itemprop`))&&(o=a.createElement(r),a.head.insertBefore(o,a.querySelector(`head > title`))),Pd(o,r,n),o[st]=e,xt(o),r=o;break a;case`link`:var s=Vf(`link`,`href`,a).get(r+(n.href||``));if(s){for(var c=0;c<s.length;c++)if(o=s[c],o.getAttribute(`href`)===(n.href==null||n.href===``?null:n.href)&&o.getAttribute(`rel`)===(n.rel==null?null:n.rel)&&o.getAttribute(`title`)===(n.title==null?null:n.title)&&o.getAttribute(`crossorigin`)===(n.crossOrigin==null?null:n.crossOrigin)){s.splice(c,1);break b}}o=a.createElement(r),Pd(o,r,n),a.head.appendChild(o);break;case`meta`:if(s=Vf(`meta`,`content`,a).get(r+(n.content||``))){for(c=0;c<s.length;c++)if(o=s[c],o.getAttribute(`content`)===(n.content==null?null:``+n.content)&&o.getAttribute(`name`)===(n.name==null?null:n.name)&&o.getAttribute(`property`)===(n.property==null?null:n.property)&&o.getAttribute(`http-equiv`)===(n.httpEquiv==null?null:n.httpEquiv)&&o.getAttribute(`charset`)===(n.charSet==null?null:n.charSet)){s.splice(c,1);break b}}o=a.createElement(r),Pd(o,r,n),a.head.appendChild(o);break;default:throw Error(i(468,r))}o[st]=e,xt(o),r=o}e.stateNode=r}else Hf(a,e.type,e.stateNode);else e.stateNode=If(a,r,e.memoizedProps);else o===r?r===null&&e.stateNode!==null&&Jc(e,e.memoizedProps,n.memoizedProps):(o===null?n.stateNode!==null&&(n=n.stateNode,n.parentNode.removeChild(n)):o.count--,r===null?Hf(a,e.type,e.stateNode):If(a,r,e.memoizedProps))}break;case 27:hl(t,e),vl(e),r&512&&(tl||n===null||Kc(n,n.return)),n!==null&&r&4&&Jc(e,e.memoizedProps,n.memoizedProps);break;case 5:if(hl(t,e),vl(e),r&512&&(tl||n===null||Kc(n,n.return)),e.flags&32){a=e.stateNode;try{Kt(a,``)}catch(t){Z(e,e.return,t)}}r&4&&e.stateNode!=null&&(a=e.memoizedProps,Jc(e,a,n===null?a:n.memoizedProps)),r&1024&&(nl=!0);break;case 6:if(hl(t,e),vl(e),r&4){if(e.stateNode===null)throw Error(i(162));r=e.memoizedProps,n=e.stateNode;try{n.nodeValue=r}catch(t){Z(e,e.return,t)}}break;case 3:if(Bf=null,a=gl,gl=gf(t.containerInfo),hl(t,e),gl=a,vl(e),r&4&&n!==null&&n.memoizedState.isDehydrated)try{Np(t.containerInfo)}catch(t){Z(e,e.return,t)}nl&&(nl=!1,yl(e));break;case 4:r=gl,gl=gf(e.stateNode.containerInfo),hl(t,e),vl(e),gl=r;break;case 12:hl(t,e),vl(e);break;case 31:hl(t,e),vl(e),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,ml(e,r)));break;case 13:hl(t,e),vl(e),e.child.flags&8192&&e.memoizedState!==null!=(n!==null&&n.memoizedState!==null)&&($l=P()),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,ml(e,r)));break;case 22:a=e.memoizedState!==null;var l=n!==null&&n.memoizedState!==null,u=el,d=tl;if(el=u||a,tl=d||l,hl(t,e),tl=d,el=u,vl(e),r&8192)a:for(t=e.stateNode,t._visibility=a?t._visibility&-2:t._visibility|1,a&&(n===null||l||el||tl||xl(e)),n=null,t=e;;){if(t.tag===5||t.tag===26){if(n===null){l=n=t;try{if(o=l.stateNode,a)s=o.style,typeof s.setProperty==`function`?s.setProperty(`display`,`none`,`important`):s.display=`none`;else{c=l.stateNode;var f=l.memoizedProps.style,p=f!=null&&f.hasOwnProperty(`display`)?f.display:null;c.style.display=p==null||typeof p==`boolean`?``:(``+p).trim()}}catch(e){Z(l,l.return,e)}}}else if(t.tag===6){if(n===null){l=t;try{l.stateNode.nodeValue=a?``:l.memoizedProps}catch(e){Z(l,l.return,e)}}}else if(t.tag===18){if(n===null){l=t;try{var m=l.stateNode;a?$d(m,!0):$d(l.stateNode,!1)}catch(e){Z(l,l.return,e)}}}else if((t.tag!==22&&t.tag!==23||t.memoizedState===null||t===e)&&t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break a;for(;t.sibling===null;){if(t.return===null||t.return===e)break a;n===t&&(n=null),t=t.return}n===t&&(n=null),t.sibling.return=t.return,t=t.sibling}r&4&&(r=e.updateQueue,r!==null&&(n=r.retryQueue,n!==null&&(r.retryQueue=null,ml(e,n))));break;case 19:hl(t,e),vl(e),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,ml(e,r)));break;case 30:break;case 21:break;default:hl(t,e),vl(e)}}function vl(e){var t=e.flags;if(t&2){try{for(var n,r=e.return;r!==null;){if(Yc(r)){n=r;break}r=r.return}if(n==null)throw Error(i(160));switch(n.tag){case 27:var a=n.stateNode;Qc(e,Xc(e),a);break;case 5:var o=n.stateNode;n.flags&32&&(Kt(o,``),n.flags&=-33),Qc(e,Xc(e),o);break;case 3:case 4:var s=n.stateNode.containerInfo;Zc(e,Xc(e),s);break;default:throw Error(i(161))}}catch(t){Z(e,e.return,t)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function yl(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;yl(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function bl(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)ol(e,t.alternate,t),t=t.sibling}function xl(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:Hc(4,t,t.return),xl(t);break;case 1:Kc(t,t.return);var n=t.stateNode;typeof n.componentWillUnmount==`function`&&Wc(t,t.return,n),xl(t);break;case 27:pf(t.stateNode);case 26:case 5:Kc(t,t.return),xl(t);break;case 22:t.memoizedState===null&&xl(t);break;case 30:xl(t);break;default:xl(t)}e=e.sibling}}function Sl(e,t,n){for(n&&=(t.subtreeFlags&8772)!=0,t=t.child;t!==null;){var r=t.alternate,i=e,a=t,o=a.flags;switch(a.tag){case 0:case 11:case 15:Sl(i,a,n),Vc(4,a);break;case 1:if(Sl(i,a,n),r=a,i=r.stateNode,typeof i.componentDidMount==`function`)try{i.componentDidMount()}catch(e){Z(r,r.return,e)}if(r=a,i=r.updateQueue,i!==null){var s=r.stateNode;try{var c=i.shared.hiddenCallbacks;if(c!==null)for(i.shared.hiddenCallbacks=null,i=0;i<c.length;i++)Xa(c[i],s)}catch(e){Z(r,r.return,e)}}n&&o&64&&Uc(a),Gc(a,a.return);break;case 27:$c(a);case 26:case 5:Sl(i,a,n),n&&r===null&&o&4&&qc(a),Gc(a,a.return);break;case 12:Sl(i,a,n);break;case 31:Sl(i,a,n),n&&o&4&&dl(i,a);break;case 13:Sl(i,a,n),n&&o&4&&fl(i,a);break;case 22:a.memoizedState===null&&Sl(i,a,n),Gc(a,a.return);break;case 30:break;default:Sl(i,a,n)}t=t.sibling}}function Cl(e,t){var n=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),e=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(e=t.memoizedState.cachePool.pool),e!==n&&(e!=null&&e.refCount++,n!=null&&la(n))}function wl(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&la(e))}function Tl(e,t,n,r){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)El(e,t,n,r),t=t.sibling}function El(e,t,n,r){var i=t.flags;switch(t.tag){case 0:case 11:case 15:Tl(e,t,n,r),i&2048&&Vc(9,t);break;case 1:Tl(e,t,n,r);break;case 3:Tl(e,t,n,r),i&2048&&(e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&la(e)));break;case 12:if(i&2048){Tl(e,t,n,r),e=t.stateNode;try{var a=t.memoizedProps,o=a.id,s=a.onPostCommit;typeof s==`function`&&s(o,t.alternate===null?`mount`:`update`,e.passiveEffectDuration,-0)}catch(e){Z(t,t.return,e)}}else Tl(e,t,n,r);break;case 31:Tl(e,t,n,r);break;case 13:Tl(e,t,n,r);break;case 23:break;case 22:a=t.stateNode,o=t.alternate,t.memoizedState===null?a._visibility&2?Tl(e,t,n,r):(a._visibility|=2,Dl(e,t,n,r,(t.subtreeFlags&10256)!=0||!1)):a._visibility&2?Tl(e,t,n,r):Ol(e,t),i&2048&&Cl(o,t);break;case 24:Tl(e,t,n,r),i&2048&&wl(t.alternate,t);break;default:Tl(e,t,n,r)}}function Dl(e,t,n,r,i){for(i&&=(t.subtreeFlags&10256)!=0||!1,t=t.child;t!==null;){var a=e,o=t,s=n,c=r,l=o.flags;switch(o.tag){case 0:case 11:case 15:Dl(a,o,s,c,i),Vc(8,o);break;case 23:break;case 22:var u=o.stateNode;o.memoizedState===null?(u._visibility|=2,Dl(a,o,s,c,i)):u._visibility&2?Dl(a,o,s,c,i):Ol(a,o),i&&l&2048&&Cl(o.alternate,o);break;case 24:Dl(a,o,s,c,i),i&&l&2048&&wl(o.alternate,o);break;default:Dl(a,o,s,c,i)}t=t.sibling}}function Ol(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var n=e,r=t,i=r.flags;switch(r.tag){case 22:Ol(n,r),i&2048&&Cl(r.alternate,r);break;case 24:Ol(n,r),i&2048&&wl(r.alternate,r);break;default:Ol(n,r)}t=t.sibling}}var kl=8192;function Al(e,t,n){if(e.subtreeFlags&kl)for(e=e.child;e!==null;)jl(e,t,n),e=e.sibling}function jl(e,t,n){switch(e.tag){case 26:Al(e,t,n),e.flags&kl&&e.memoizedState!==null&&Gf(n,gl,e.memoizedState,e.memoizedProps);break;case 5:Al(e,t,n);break;case 3:case 4:var r=gl;gl=gf(e.stateNode.containerInfo),Al(e,t,n),gl=r;break;case 22:e.memoizedState===null&&(r=e.alternate,r!==null&&r.memoizedState!==null?(r=kl,kl=16777216,Al(e,t,n),kl=r):Al(e,t,n));break;default:Al(e,t,n)}}function Ml(e){var t=e.alternate;if(t!==null&&(e=t.child,e!==null)){t.child=null;do t=e.sibling,e.sibling=null,e=t;while(e!==null)}}function Nl(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];il=r,Il(r,e)}Ml(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)Pl(e),e=e.sibling}function Pl(e){switch(e.tag){case 0:case 11:case 15:Nl(e),e.flags&2048&&Hc(9,e,e.return);break;case 3:Nl(e);break;case 12:Nl(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,Fl(e)):Nl(e);break;default:Nl(e)}}function Fl(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];il=r,Il(r,e)}Ml(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:Hc(8,t,t.return),Fl(t);break;case 22:n=t.stateNode,n._visibility&2&&(n._visibility&=-3,Fl(t));break;default:Fl(t)}e=e.sibling}}function Il(e,t){for(;il!==null;){var n=il;switch(n.tag){case 0:case 11:case 15:Hc(8,n,t);break;case 23:case 22:if(n.memoizedState!==null&&n.memoizedState.cachePool!==null){var r=n.memoizedState.cachePool.pool;r!=null&&r.refCount++}break;case 24:la(n.memoizedState.cache)}if(r=n.child,r!==null)r.return=n,il=r;else a:for(n=e;il!==null;){r=il;var i=r.sibling,a=r.return;if(sl(r),r===n){il=null;break a}if(i!==null){i.return=a,il=i;break a}il=a}}}var Ll={getCacheForType:function(e){var t=ta(sa),n=t.data.get(e);return n===void 0&&(n=e(),t.data.set(e,n)),n},cacheSignal:function(){return ta(sa).controller.signal}},Rl=typeof WeakMap==`function`?WeakMap:Map,K=0,q=null,J=null,Y=0,X=0,zl=null,Bl=!1,Vl=!1,Hl=!1,Ul=0,Wl=0,Gl=0,Kl=0,ql=0,Jl=0,Yl=0,Xl=null,Zl=null,Ql=!1,$l=0,eu=0,tu=1/0,nu=null,ru=null,iu=0,au=null,ou=null,su=0,cu=0,lu=null,uu=null,du=0,fu=null;function pu(){return K&2&&Y!==0?Y&-Y:D.T===null?it():dd()}function mu(){if(Jl===0)if(!(Y&536870912)||z){var e=Ue;Ue<<=1,!(Ue&3932160)&&(Ue=262144),Jl=e}else Jl=536870912;return e=ro.current,e!==null&&(e.flags|=32),Jl}function hu(e,t,n){(e===q&&(X===2||X===9)||e.cancelPendingCommit!==null)&&(Su(e,0),yu(e,Y,Jl,!1)),Ze(e,n),(!(K&2)||e!==q)&&(e===q&&(!(K&2)&&(Kl|=n),Wl===4&&yu(e,Y,Jl,!1)),rd(e))}function gu(e,t,n){if(K&6)throw Error(i(327));var r=!n&&(t&127)==0&&(t&e.expiredLanes)===0||qe(e,t),a=r?Au(e,t):Ou(e,t,!0),o=r;do{if(a===0){Vl&&!r&&yu(e,t,0,!1);break}else{if(n=e.current.alternate,o&&!vu(n)){a=Ou(e,t,!1),o=!1;continue}if(a===2){if(o=t,e.errorRecoveryDisabledLanes&o)var s=0;else s=e.pendingLanes&-536870913,s=s===0?s&536870912?536870912:0:s;if(s!==0){t=s;a:{var c=e;a=Xl;var l=c.current.memoizedState.isDehydrated;if(l&&(Su(c,s).flags|=256),s=Ou(c,s,!1),s!==2){if(Hl&&!l){c.errorRecoveryDisabledLanes|=o,Kl|=o,a=4;break a}o=Zl,Zl=a,o!==null&&(Zl===null?Zl=o:Zl.push.apply(Zl,o))}a=s}if(o=!1,a!==2)continue}}if(a===1){Su(e,0),yu(e,t,0,!0);break}a:{switch(r=e,o=a,o){case 0:case 1:throw Error(i(345));case 4:if((t&4194048)!==t)break;case 6:yu(r,t,Jl,!Bl);break a;case 2:Zl=null;break;case 3:case 5:break;default:throw Error(i(329))}if((t&62914560)===t&&(a=$l+300-P(),10<a)){if(yu(r,t,Jl,!Bl),Ke(r,0,!0)!==0)break a;su=t,r.timeoutHandle=Kd(_u.bind(null,r,n,Zl,nu,Ql,t,Jl,Kl,Yl,Bl,o,`Throttled`,-0,0),a);break a}_u(r,n,Zl,nu,Ql,t,Jl,Kl,Yl,Bl,o,null,-0,0)}}break}while(1);rd(e)}function _u(e,t,n,r,i,a,o,s,c,l,u,d,f,p){if(e.timeoutHandle=-1,d=t.subtreeFlags,d&8192||(d&16785408)==16785408){d={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:en},jl(t,a,d);var m=(a&62914560)===a?$l-P():(a&4194048)===a?eu-P():0;if(m=qf(d,m),m!==null){su=a,e.cancelPendingCommit=m(Lu.bind(null,e,t,a,n,r,i,o,s,c,u,d,null,f,p)),yu(e,a,o,!l);return}}Lu(e,t,a,n,r,i,o,s,c)}function vu(e){for(var t=e;;){var n=t.tag;if((n===0||n===11||n===15)&&t.flags&16384&&(n=t.updateQueue,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(!Cr(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 yu(e,t,n,r){t&=~ql,t&=~Kl,e.suspendedLanes|=t,e.pingedLanes&=~t,r&&(e.warmLanes|=t),r=e.expirationTimes;for(var i=t;0<i;){var a=31-Re(i),o=1<<a;r[a]=-1,i&=~o}n!==0&&$e(e,n,t)}function bu(){return K&6?!0:(id(0,!1),!1)}function xu(){if(J!==null){if(X===0)var e=J.return;else e=J,qi=Ki=null,ko(e),Ma=null,Na=0,e=J;for(;e!==null;)Bc(e.alternate,e),e=e.return;J=null}}function Su(e,t){var n=e.timeoutHandle;n!==-1&&(e.timeoutHandle=-1,qd(n)),n=e.cancelPendingCommit,n!==null&&(e.cancelPendingCommit=null,n()),su=0,xu(),q=e,J=n=di(e.current,null),Y=t,X=0,zl=null,Bl=!1,Vl=qe(e,t),Hl=!1,Yl=Jl=ql=Kl=Gl=Wl=0,Zl=Xl=null,Ql=!1,t&8&&(t|=t&32);var r=e.entangledLanes;if(r!==0)for(e=e.entanglements,r&=t;0<r;){var i=31-Re(r),a=1<<i;t|=e[i],r&=~a}return Ul=t,ti(),n}function Cu(e,t){B=null,D.H=Rs,t===Sa||t===wa?(t=Aa(),X=3):t===Ca?(t=Aa(),X=4):X=t===nc?8:typeof t==`object`&&t&&typeof t.then==`function`?6:1,zl=t,J===null&&(Wl=1,Xs(e,yi(t,e.current)))}function wu(){var e=ro.current;return e===null?!0:(Y&4194048)===Y?io===null:(Y&62914560)===Y||Y&536870912?e===io:!1}function Tu(){var e=D.H;return D.H=Rs,e===null?Rs:e}function Eu(){var e=D.A;return D.A=Ll,e}function Du(){Wl=4,Bl||(Y&4194048)!==Y&&ro.current!==null||(Vl=!0),!(Gl&134217727)&&!(Kl&134217727)||q===null||yu(q,Y,Jl,!1)}function Ou(e,t,n){var r=K;K|=2;var i=Tu(),a=Eu();(q!==e||Y!==t)&&(nu=null,Su(e,t)),t=!1;var o=Wl;a:do try{if(X!==0&&J!==null){var s=J,c=zl;switch(X){case 8:xu(),o=6;break a;case 3:case 2:case 9:case 6:ro.current===null&&(t=!0);var l=X;if(X=0,zl=null,Pu(e,s,c,l),n&&Vl){o=0;break a}break;default:l=X,X=0,zl=null,Pu(e,s,c,l)}}ku(),o=Wl;break}catch(t){Cu(e,t)}while(1);return t&&e.shellSuspendCounter++,qi=Ki=null,K=r,D.H=i,D.A=a,J===null&&(q=null,Y=0,ti()),o}function ku(){for(;J!==null;)Mu(J)}function Au(e,t){var n=K;K|=2;var r=Tu(),a=Eu();q!==e||Y!==t?(nu=null,tu=P()+500,Su(e,t)):Vl=qe(e,t);a:do try{if(X!==0&&J!==null){t=J;var o=zl;b:switch(X){case 1:X=0,zl=null,Pu(e,t,o,1);break;case 2:case 9:if(Ea(o)){X=0,zl=null,Nu(t);break}t=function(){X!==2&&X!==9||q!==e||(X=7),rd(e)},o.then(t,t);break a;case 3:X=7;break a;case 4:X=5;break a;case 7:Ea(o)?(X=0,zl=null,Nu(t)):(X=0,zl=null,Pu(e,t,o,7));break;case 5:var s=null;switch(J.tag){case 26:s=J.memoizedState;case 5:case 27:var c=J;if(s?Wf(s):c.stateNode.complete){X=0,zl=null;var l=c.sibling;if(l!==null)J=l;else{var u=c.return;u===null?J=null:(J=u,Fu(u))}break b}}X=0,zl=null,Pu(e,t,o,5);break;case 6:X=0,zl=null,Pu(e,t,o,6);break;case 8:xu(),Wl=6;break a;default:throw Error(i(462))}}ju();break}catch(t){Cu(e,t)}while(1);return qi=Ki=null,D.H=r,D.A=a,K=n,J===null?(q=null,Y=0,ti(),Wl):0}function ju(){for(;J!==null&&!Ee();)Mu(J)}function Mu(e){var t=Mc(e.alternate,e,Ul);e.memoizedProps=e.pendingProps,t===null?Fu(e):J=t}function Nu(e){var t=e,n=t.alternate;switch(t.tag){case 15:case 0:t=gc(n,t,t.pendingProps,t.type,void 0,Y);break;case 11:t=gc(n,t,t.pendingProps,t.type.render,t.ref,Y);break;case 5:ko(t);default:Bc(n,t),t=J=fi(t,Ul),t=Mc(n,t,Ul)}e.memoizedProps=e.pendingProps,t===null?Fu(e):J=t}function Pu(e,t,n,r){qi=Ki=null,ko(t),Ma=null,Na=0;var i=t.return;try{if(tc(e,i,t,n,Y)){Wl=1,Xs(e,yi(n,e.current)),J=null;return}}catch(t){if(i!==null)throw J=i,t;Wl=1,Xs(e,yi(n,e.current)),J=null;return}t.flags&32768?(z||r===1?e=!0:Vl||Y&536870912?e=!1:(Bl=e=!0,(r===2||r===9||r===3||r===6)&&(r=ro.current,r!==null&&r.tag===13&&(r.flags|=16384))),Iu(t,e)):Fu(t)}function Fu(e){var t=e;do{if(t.flags&32768){Iu(t,Bl);return}e=t.return;var n=Rc(t.alternate,t,Ul);if(n!==null){J=n;return}if(t=t.sibling,t!==null){J=t;return}J=t=e}while(t!==null);Wl===0&&(Wl=5)}function Iu(e,t){do{var n=zc(e.alternate,e);if(n!==null){n.flags&=32767,J=n;return}if(n=e.return,n!==null&&(n.flags|=32768,n.subtreeFlags=0,n.deletions=null),!t&&(e=e.sibling,e!==null)){J=e;return}J=e=n}while(e!==null);Wl=6,J=null}function Lu(e,t,n,r,a,o,s,c,l){e.cancelPendingCommit=null;do Hu();while(iu!==0);if(K&6)throw Error(i(327));if(t!==null){if(t===e.current)throw Error(i(177));if(o=t.lanes|t.childLanes,o|=ei,Qe(e,n,o,s,c,l),e===q&&(J=q=null,Y=0),ou=t,au=e,su=n,cu=o,lu=a,uu=r,t.subtreeFlags&10256||t.flags&10256?(e.callbackNode=null,e.callbackPriority=0,Xu(je,function(){return Uu(),null})):(e.callbackNode=null,e.callbackPriority=0),r=(t.flags&13878)!=0,t.subtreeFlags&13878||r){r=D.T,D.T=null,a=O.p,O.p=2,s=K,K|=4;try{al(e,t,n)}finally{K=s,O.p=a,D.T=r}}iu=1,Ru(),zu(),Bu()}}function Ru(){if(iu===1){iu=0;var e=au,t=ou,n=(t.flags&13878)!=0;if(t.subtreeFlags&13878||n){n=D.T,D.T=null;var r=O.p;O.p=2;var i=K;K|=4;try{_l(t,e);var a=zd,o=Or(e.containerInfo),s=a.focusedElem,c=a.selectionRange;if(o!==s&&s&&s.ownerDocument&&Dr(s.ownerDocument.documentElement,s)){if(c!==null&&kr(s)){var l=c.start,u=c.end;if(u===void 0&&(u=l),`selectionStart`in s)s.selectionStart=l,s.selectionEnd=Math.min(u,s.value.length);else{var d=s.ownerDocument||document,f=d&&d.defaultView||window;if(f.getSelection){var p=f.getSelection(),m=s.textContent.length,h=Math.min(c.start,m),g=c.end===void 0?h:Math.min(c.end,m);!p.extend&&h>g&&(o=g,g=h,h=o);var _=Er(s,h),v=Er(s,g);if(_&&v&&(p.rangeCount!==1||p.anchorNode!==_.node||p.anchorOffset!==_.offset||p.focusNode!==v.node||p.focusOffset!==v.offset)){var y=d.createRange();y.setStart(_.node,_.offset),p.removeAllRanges(),h>g?(p.addRange(y),p.extend(v.node,v.offset)):(y.setEnd(v.node,v.offset),p.addRange(y))}}}}for(d=[],p=s;p=p.parentNode;)p.nodeType===1&&d.push({element:p,left:p.scrollLeft,top:p.scrollTop});for(typeof s.focus==`function`&&s.focus(),s=0;s<d.length;s++){var b=d[s];b.element.scrollLeft=b.left,b.element.scrollTop=b.top}}sp=!!Rd,zd=Rd=null}finally{K=i,O.p=r,D.T=n}}e.current=t,iu=2}}function zu(){if(iu===2){iu=0;var e=au,t=ou,n=(t.flags&8772)!=0;if(t.subtreeFlags&8772||n){n=D.T,D.T=null;var r=O.p;O.p=2;var i=K;K|=4;try{ol(e,t.alternate,t)}finally{K=i,O.p=r,D.T=n}}iu=3}}function Bu(){if(iu===4||iu===3){iu=0,De();var e=au,t=ou,n=su,r=uu;t.subtreeFlags&10256||t.flags&10256?iu=5:(iu=0,ou=au=null,Vu(e,e.pendingLanes));var i=e.pendingLanes;if(i===0&&(ru=null),rt(n),t=t.stateNode,F&&typeof F.onCommitFiberRoot==`function`)try{F.onCommitFiberRoot(Ie,t,void 0,(t.current.flags&128)==128)}catch{}if(r!==null){t=D.T,i=O.p,O.p=2,D.T=null;try{for(var a=e.onRecoverableError,o=0;o<r.length;o++){var s=r[o];a(s.value,{componentStack:s.stack})}}finally{D.T=t,O.p=i}}su&3&&Hu(),rd(e),i=e.pendingLanes,n&261930&&i&42?e===fu?du++:(du=0,fu=e):du=0,id(0,!1)}}function Vu(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,la(t)))}function Hu(){return Ru(),zu(),Bu(),Uu()}function Uu(){if(iu!==5)return!1;var e=au,t=cu;cu=0;var n=rt(su),r=D.T,a=O.p;try{O.p=32>n?32:n,D.T=null,n=lu,lu=null;var o=au,s=su;if(iu=0,ou=au=null,su=0,K&6)throw Error(i(331));var c=K;if(K|=4,Pl(o.current),El(o,o.current,s,n),K=c,id(0,!1),F&&typeof F.onPostCommitFiberRoot==`function`)try{F.onPostCommitFiberRoot(Ie,o)}catch{}return!0}finally{O.p=a,D.T=r,Vu(e,t)}}function Wu(e,t,n){t=yi(n,t),t=Qs(e.stateNode,t,2),e=Wa(e,t,2),e!==null&&(Ze(e,2),rd(e))}function Z(e,t,n){if(e.tag===3)Wu(e,e,n);else for(;t!==null;){if(t.tag===3){Wu(t,e,n);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError==`function`||typeof r.componentDidCatch==`function`&&(ru===null||!ru.has(r))){e=yi(n,e),n=$s(2),r=Wa(t,n,2),r!==null&&(ec(n,r,t,e),Ze(r,2),rd(r));break}}t=t.return}}function Gu(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new Rl;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)||(Hl=!0,i.add(n),e=Ku.bind(null,e,t,n),t.then(e,e))}function Ku(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,q===e&&(Y&n)===n&&(Wl===4||Wl===3&&(Y&62914560)===Y&&300>P()-$l?!(K&2)&&Su(e,0):ql|=n,Yl===Y&&(Yl=0)),rd(e)}function qu(e,t){t===0&&(t=Ye()),e=ii(e,t),e!==null&&(Ze(e,t),rd(e))}function Ju(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),qu(e,n)}function Yu(e,t){var n=0;switch(e.tag){case 31:case 13:var r=e.stateNode,a=e.memoizedState;a!==null&&(n=a.retryLane);break;case 19:r=e.stateNode;break;case 22:r=e.stateNode._retryCache;break;default:throw Error(i(314))}r!==null&&r.delete(t),qu(e,n)}function Xu(e,t){return N(e,t)}var Zu=null,Qu=null,$u=!1,ed=!1,td=!1,nd=0;function rd(e){e!==Qu&&e.next===null&&(Qu===null?Zu=Qu=e:Qu=Qu.next=e),ed=!0,$u||($u=!0,ud())}function id(e,t){if(!td&&ed){td=!0;do for(var n=!1,r=Zu;r!==null;){if(!t)if(e!==0){var i=r.pendingLanes;if(i===0)var a=0;else{var o=r.suspendedLanes,s=r.pingedLanes;a=(1<<31-Re(42|e)+1)-1,a&=i&~(o&~s),a=a&201326741?a&201326741|1:a?a|2:0}a!==0&&(n=!0,ld(r,a))}else a=Y,a=Ke(r,r===q?a:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),!(a&3)||qe(r,a)||(n=!0,ld(r,a));r=r.next}while(n);td=!1}}function ad(){od()}function od(){ed=$u=!1;var e=0;nd!==0&&Gd()&&(e=nd);for(var t=P(),n=null,r=Zu;r!==null;){var i=r.next,a=sd(r,t);a===0?(r.next=null,n===null?Zu=i:n.next=i,i===null&&(Qu=n)):(n=r,(e!==0||a&3)&&(ed=!0)),r=i}iu!==0&&iu!==5||id(e,!1),nd!==0&&(nd=0)}function sd(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,i=e.expirationTimes,a=e.pendingLanes&-62914561;0<a;){var o=31-Re(a),s=1<<o,c=i[o];c===-1?((s&n)===0||(s&r)!==0)&&(i[o]=Je(s,t)):c<=t&&(e.expiredLanes|=s),a&=~s}if(t=q,n=Y,n=Ke(e,e===t?n:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r=e.callbackNode,n===0||e===t&&(X===2||X===9)||e.cancelPendingCommit!==null)return r!==null&&r!==null&&Te(r),e.callbackNode=null,e.callbackPriority=0;if(!(n&3)||qe(e,n)){if(t=n&-n,t===e.callbackPriority)return t;switch(r!==null&&Te(r),rt(n)){case 2:case 8:n=Ae;break;case 32:n=je;break;case 268435456:n=Ne;break;default:n=je}return r=cd.bind(null,e),n=N(n,r),e.callbackPriority=t,e.callbackNode=n,t}return r!==null&&r!==null&&Te(r),e.callbackPriority=2,e.callbackNode=null,2}function cd(e,t){if(iu!==0&&iu!==5)return e.callbackNode=null,e.callbackPriority=0,null;var n=e.callbackNode;if(Hu()&&e.callbackNode!==n)return null;var r=Y;return r=Ke(e,e===q?r:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r===0?null:(gu(e,r,t),sd(e,P()),e.callbackNode!=null&&e.callbackNode===n?cd.bind(null,e):null)}function ld(e,t){if(Hu())return null;gu(e,t,!0)}function ud(){Yd(function(){K&6?N(ke,ad):od()})}function dd(){if(nd===0){var e=fa;e===0&&(e=He,He<<=1,!(He&261888)&&(He=256)),nd=e}return nd}function fd(e){return e==null||typeof e==`symbol`||typeof e==`boolean`?null:typeof e==`function`?e:$t(``+e)}function pd(e,t){var n=t.ownerDocument.createElement(`input`);return n.name=t.name,n.value=t.value,e.id&&n.setAttribute(`form`,e.id),t.parentNode.insertBefore(n,t),e=new FormData(e),n.parentNode.removeChild(n),e}function md(e,t,n,r,i){if(t===`submit`&&n&&n.stateNode===i){var a=fd((i[ct]||null).action),o=r.submitter;o&&(t=(t=o[ct]||null)?fd(t.formAction):o.getAttribute(`formAction`),t!==null&&(a=t,o=null));var s=new Sn(`action`,`action`,null,r,i);e.push({event:s,listeners:[{instance:null,listener:function(){if(r.defaultPrevented){if(nd!==0){var e=o?pd(i,o):new FormData(i);ws(n,{pending:!0,data:e,method:i.method,action:a},null,e)}}else typeof a==`function`&&(s.preventDefault(),e=o?pd(i,o):new FormData(i),ws(n,{pending:!0,data:e,method:i.method,action:a},a,e))},currentTarget:i}]})}}for(var hd=0;hd<Yr.length;hd++){var gd=Yr[hd];Xr(gd.toLowerCase(),`on`+(gd[0].toUpperCase()+gd.slice(1)))}Xr(Vr,`onAnimationEnd`),Xr(Hr,`onAnimationIteration`),Xr(Ur,`onAnimationStart`),Xr(`dblclick`,`onDoubleClick`),Xr(`focusin`,`onFocus`),Xr(`focusout`,`onBlur`),Xr(Wr,`onTransitionRun`),Xr(Gr,`onTransitionStart`),Xr(Kr,`onTransitionCancel`),Xr(qr,`onTransitionEnd`),wt(`onMouseEnter`,[`mouseout`,`mouseover`]),wt(`onMouseLeave`,[`mouseout`,`mouseover`]),wt(`onPointerEnter`,[`pointerout`,`pointerover`]),wt(`onPointerLeave`,[`pointerout`,`pointerover`]),Ct(`onChange`,`change click focusin focusout input keydown keyup selectionchange`.split(` `)),Ct(`onSelect`,`focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange`.split(` `)),Ct(`onBeforeInput`,[`compositionend`,`keypress`,`textInput`,`paste`]),Ct(`onCompositionEnd`,`compositionend focusout keydown keypress keyup mousedown`.split(` `)),Ct(`onCompositionStart`,`compositionstart focusout keydown keypress keyup mousedown`.split(` `)),Ct(`onCompositionUpdate`,`compositionupdate focusout keydown keypress keyup mousedown`.split(` `));var _d=`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(` `),vd=new Set(`beforetoggle cancel close invalid load scroll scrollend toggle`.split(` `).concat(_d));function yd(e,t){t=(t&4)!=0;for(var n=0;n<e.length;n++){var r=e[n],i=r.event;r=r.listeners;a:{var a=void 0;if(t)for(var o=r.length-1;0<=o;o--){var s=r[o],c=s.instance,l=s.currentTarget;if(s=s.listener,c!==a&&i.isPropagationStopped())break a;a=s,i.currentTarget=l;try{a(i)}catch(e){Zr(e)}i.currentTarget=null,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;a=s,i.currentTarget=l;try{a(i)}catch(e){Zr(e)}i.currentTarget=null,a=c}}}}function Q(e,t){var n=t[ut];n===void 0&&(n=t[ut]=new Set);var r=e+`__bubble`;n.has(r)||(Cd(t,e,2,!1),n.add(r))}function bd(e,t,n){var r=0;t&&(r|=4),Cd(n,e,r,t)}var xd=`_reactListening`+Math.random().toString(36).slice(2);function Sd(e){if(!e[xd]){e[xd]=!0,L.forEach(function(t){t!==`selectionchange`&&(vd.has(t)||bd(t,!1,e),bd(t,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[xd]||(t[xd]=!0,bd(`selectionchange`,!1,t))}}function Cd(e,t,n,r){switch(mp(t)){case 2:var i=cp;break;case 8:i=lp;break;default:i=up}n=i.bind(null,t,n,e),i=void 0,!dn||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 wd(e,t,n,r,i){var a=r;if(!(t&1)&&!(t&2)&&r!==null)a:for(;;){if(r===null)return;var s=r.tag;if(s===3||s===4){var c=r.stateNode.containerInfo;if(c===i)break;if(s===4)for(s=r.return;s!==null;){var l=s.tag;if((l===3||l===4)&&s.stateNode.containerInfo===i)return;s=s.return}for(;c!==null;){if(s=I(c),s===null)return;if(l=s.tag,l===5||l===6||l===26||l===27){r=a=s;continue a}c=c.parentNode}}r=r.return}cn(function(){var r=a,i=nn(n),s=[];a:{var c=Jr.get(e);if(c!==void 0){var l=Sn,u=e;switch(e){case`keypress`:if(_n(n)===0)break a;case`keydown`:case`keyup`:l=Bn;break;case`focusin`:u=`focus`,l=jn;break;case`focusout`:u=`blur`,l=jn;break;case`beforeblur`:case`afterblur`:l=jn;break;case`click`:if(n.button===2)break a;case`auxclick`:case`dblclick`:case`mousedown`:case`mousemove`:case`mouseup`:case`mouseout`:case`mouseover`:case`contextmenu`:l=kn;break;case`drag`:case`dragend`:case`dragenter`:case`dragexit`:case`dragleave`:case`dragover`:case`dragstart`:case`drop`:l=An;break;case`touchcancel`:case`touchend`:case`touchmove`:case`touchstart`:l=Hn;break;case Vr:case Hr:case Ur:l=Mn;break;case qr:l=Un;break;case`scroll`:case`scrollend`:l=wn;break;case`wheel`:l=Wn;break;case`copy`:case`cut`:case`paste`:l=Nn;break;case`gotpointercapture`:case`lostpointercapture`:case`pointercancel`:case`pointerdown`:case`pointermove`:case`pointerout`:case`pointerover`:case`pointerup`:l=Vn;break;case`toggle`:case`beforetoggle`:l=Gn}var d=(t&4)!=0,f=!d&&(e===`scroll`||e===`scrollend`),p=d?c===null?null:c+`Capture`:c;d=[];for(var m=r,h;m!==null;){var g=m;if(h=g.stateNode,g=g.tag,g!==5&&g!==26&&g!==27||h===null||p===null||(g=ln(m,p),g!=null&&d.push(Td(m,g,h))),f)break;m=m.return}0<d.length&&(c=new l(c,u,null,n,i),s.push({event:c,listeners:d}))}}if(!(t&7)){a:{if(c=e===`mouseover`||e===`pointerover`,l=e===`mouseout`||e===`pointerout`,c&&n!==tn&&(u=n.relatedTarget||n.fromElement)&&(I(u)||u[lt]))break a;if((l||c)&&(c=i.window===i?i:(c=i.ownerDocument)?c.defaultView||c.parentWindow:window,l?(u=n.relatedTarget||n.toElement,l=r,u=u?I(u):null,u!==null&&(f=o(u),d=u.tag,u!==f||d!==5&&d!==27&&d!==6)&&(u=null)):(l=null,u=r),l!==u)){if(d=kn,g=`onMouseLeave`,p=`onMouseEnter`,m=`mouse`,(e===`pointerout`||e===`pointerover`)&&(d=Vn,g=`onPointerLeave`,p=`onPointerEnter`,m=`pointer`),f=l==null?c:yt(l),h=u==null?c:yt(u),c=new d(g,m+`leave`,l,n,i),c.target=f,c.relatedTarget=h,g=null,I(i)===r&&(d=new d(p,m+`enter`,u,n,i),d.target=h,d.relatedTarget=f,g=d),f=g,l&&u)b:{for(d=Dd,p=l,m=u,h=0,g=p;g;g=d(g))h++;g=0;for(var _=m;_;_=d(_))g++;for(;0<h-g;)p=d(p),h--;for(;0<g-h;)m=d(m),g--;for(;h--;){if(p===m||m!==null&&p===m.alternate){d=p;break b}p=d(p),m=d(m)}d=null}else d=null;l!==null&&Od(s,c,l,d,!1),u!==null&&f!==null&&Od(s,f,u,d,!0)}}a:{if(c=r?yt(r):window,l=c.nodeName&&c.nodeName.toLowerCase(),l===`select`||l===`input`&&c.type===`file`)var v=dr;else if(ar(c))if(fr)v=xr;else{v=yr;var y=vr}else l=c.nodeName,!l||l.toLowerCase()!==`input`||c.type!==`checkbox`&&c.type!==`radio`?r&&Xt(r.elementType)&&(v=dr):v=br;if(v&&=v(e,r)){or(s,v,n,i);break a}y&&y(e,c,r),e===`focusout`&&r&&c.type===`number`&&r.memoizedProps.value!=null&&Ht(c,`number`,c.value)}switch(y=r?yt(r):window,e){case`focusin`:(ar(y)||y.contentEditable===`true`)&&(jr=y,Mr=r,Nr=null);break;case`focusout`:Nr=Mr=jr=null;break;case`mousedown`:Pr=!0;break;case`contextmenu`:case`mouseup`:case`dragend`:Pr=!1,Fr(s,n,i);break;case`selectionchange`:if(Ar)break;case`keydown`:case`keyup`:Fr(s,n,i)}var b;if(qn)b:{switch(e){case`compositionstart`:var x=`onCompositionStart`;break b;case`compositionend`:x=`onCompositionEnd`;break b;case`compositionupdate`:x=`onCompositionUpdate`;break b}x=void 0}else tr?$n(e,n)&&(x=`onCompositionEnd`):e===`keydown`&&n.keyCode===229&&(x=`onCompositionStart`);x&&(Xn&&n.locale!==`ko`&&(tr||x!==`onCompositionStart`?x===`onCompositionEnd`&&tr&&(b=gn()):(pn=i,mn=`value`in pn?pn.value:pn.textContent,tr=!0)),y=Ed(r,x),0<y.length&&(x=new Pn(x,e,null,n,i),s.push({event:x,listeners:y}),b?x.data=b:(b=er(n),b!==null&&(x.data=b)))),(b=Yn?nr(e,n):rr(e,n))&&(x=Ed(r,`onBeforeInput`),0<x.length&&(y=new Pn(`onBeforeInput`,`beforeinput`,null,n,i),s.push({event:y,listeners:x}),y.data=b)),md(s,e,r,n,i)}yd(s,t)})}function Td(e,t,n){return{instance:e,listener:t,currentTarget:n}}function Ed(e,t){for(var n=t+`Capture`,r=[];e!==null;){var i=e,a=i.stateNode;if(i=i.tag,i!==5&&i!==26&&i!==27||a===null||(i=ln(e,n),i!=null&&r.unshift(Td(e,i,a)),i=ln(e,t),i!=null&&r.push(Td(e,i,a))),e.tag===3)return r;e=e.return}return[]}function Dd(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function Od(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(s=s.tag,c!==null&&c===r)break;s!==5&&s!==26&&s!==27||l===null||(c=l,i?(l=ln(n,a),l!=null&&o.unshift(Td(n,l,c))):i||(l=ln(n,a),l!=null&&o.push(Td(n,l,c)))),n=n.return}o.length!==0&&e.push({event:t,listeners:o})}var kd=/\r\n?/g,Ad=/\u0000|\uFFFD/g;function jd(e){return(typeof e==`string`?e:``+e).replace(kd,`
10
- `).replace(Ad,``)}function Md(e,t){return t=jd(t),jd(e)===t}function $(e,t,n,r,a,o){switch(n){case`children`:typeof r==`string`?t===`body`||t===`textarea`&&r===``||Kt(e,r):(typeof r==`number`||typeof r==`bigint`)&&t!==`body`&&Kt(e,``+r);break;case`className`:At(e,`class`,r);break;case`tabIndex`:At(e,`tabindex`,r);break;case`dir`:case`role`:case`viewBox`:case`width`:case`height`:At(e,n,r);break;case`style`:Yt(e,r,o);break;case`data`:if(t!==`object`){At(e,`data`,r);break}case`src`:case`href`:if(r===``&&(t!==`a`||n!==`href`)){e.removeAttribute(n);break}if(r==null||typeof r==`function`||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=$t(``+r),e.setAttribute(n,r);break;case`action`:case`formAction`:if(typeof r==`function`){e.setAttribute(n,`javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')`);break}else typeof o==`function`&&(n===`formAction`?(t!==`input`&&$(e,t,`name`,a.name,a,null),$(e,t,`formEncType`,a.formEncType,a,null),$(e,t,`formMethod`,a.formMethod,a,null),$(e,t,`formTarget`,a.formTarget,a,null)):($(e,t,`encType`,a.encType,a,null),$(e,t,`method`,a.method,a,null),$(e,t,`target`,a.target,a,null)));if(r==null||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=$t(``+r),e.setAttribute(n,r);break;case`onClick`:r!=null&&(e.onclick=en);break;case`onScroll`:r!=null&&Q(`scroll`,e);break;case`onScrollEnd`:r!=null&&Q(`scrollend`,e);break;case`dangerouslySetInnerHTML`:if(r!=null){if(typeof r!=`object`||!(`__html`in r))throw Error(i(61));if(n=r.__html,n!=null){if(a.children!=null)throw Error(i(60));e.innerHTML=n}}break;case`multiple`:e.multiple=r&&typeof r!=`function`&&typeof r!=`symbol`;break;case`muted`:e.muted=r&&typeof r!=`function`&&typeof r!=`symbol`;break;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`defaultValue`:case`defaultChecked`:case`innerHTML`:case`ref`:break;case`autoFocus`:break;case`xlinkHref`:if(r==null||typeof r==`function`||typeof r==`boolean`||typeof r==`symbol`){e.removeAttribute(`xlink:href`);break}n=$t(``+r),e.setAttributeNS(`http://www.w3.org/1999/xlink`,`xlink:href`,n);break;case`contentEditable`:case`spellCheck`:case`draggable`:case`value`:case`autoReverse`:case`externalResourcesRequired`:case`focusable`:case`preserveAlpha`:r!=null&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,``+r):e.removeAttribute(n);break;case`inert`:case`allowFullScreen`:case`async`:case`autoPlay`:case`controls`:case`default`:case`defer`:case`disabled`:case`disablePictureInPicture`:case`disableRemotePlayback`:case`formNoValidate`:case`hidden`:case`loop`:case`noModule`:case`noValidate`:case`open`:case`playsInline`:case`readOnly`:case`required`:case`reversed`:case`scoped`:case`seamless`:case`itemScope`:r&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,``):e.removeAttribute(n);break;case`capture`:case`download`:!0===r?e.setAttribute(n,``):!1!==r&&r!=null&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,r):e.removeAttribute(n);break;case`cols`:case`rows`:case`size`:case`span`:r!=null&&typeof r!=`function`&&typeof r!=`symbol`&&!isNaN(r)&&1<=r?e.setAttribute(n,r):e.removeAttribute(n);break;case`rowSpan`:case`start`:r==null||typeof r==`function`||typeof r==`symbol`||isNaN(r)?e.removeAttribute(n):e.setAttribute(n,r);break;case`popover`:Q(`beforetoggle`,e),Q(`toggle`,e),kt(e,`popover`,r);break;case`xlinkActuate`:jt(e,`http://www.w3.org/1999/xlink`,`xlink:actuate`,r);break;case`xlinkArcrole`:jt(e,`http://www.w3.org/1999/xlink`,`xlink:arcrole`,r);break;case`xlinkRole`:jt(e,`http://www.w3.org/1999/xlink`,`xlink:role`,r);break;case`xlinkShow`:jt(e,`http://www.w3.org/1999/xlink`,`xlink:show`,r);break;case`xlinkTitle`:jt(e,`http://www.w3.org/1999/xlink`,`xlink:title`,r);break;case`xlinkType`:jt(e,`http://www.w3.org/1999/xlink`,`xlink:type`,r);break;case`xmlBase`:jt(e,`http://www.w3.org/XML/1998/namespace`,`xml:base`,r);break;case`xmlLang`:jt(e,`http://www.w3.org/XML/1998/namespace`,`xml:lang`,r);break;case`xmlSpace`:jt(e,`http://www.w3.org/XML/1998/namespace`,`xml:space`,r);break;case`is`:kt(e,`is`,r);break;case`innerText`:case`textContent`:break;default:(!(2<n.length)||n[0]!==`o`&&n[0]!==`O`||n[1]!==`n`&&n[1]!==`N`)&&(n=Zt.get(n)||n,kt(e,n,r))}}function Nd(e,t,n,r,a,o){switch(n){case`style`:Yt(e,r,o);break;case`dangerouslySetInnerHTML`:if(r!=null){if(typeof r!=`object`||!(`__html`in r))throw Error(i(61));if(n=r.__html,n!=null){if(a.children!=null)throw Error(i(60));e.innerHTML=n}}break;case`children`:typeof r==`string`?Kt(e,r):(typeof r==`number`||typeof r==`bigint`)&&Kt(e,``+r);break;case`onScroll`:r!=null&&Q(`scroll`,e);break;case`onScrollEnd`:r!=null&&Q(`scrollend`,e);break;case`onClick`:r!=null&&(e.onclick=en);break;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`innerHTML`:case`ref`:break;case`innerText`:case`textContent`:break;default:if(!St.hasOwnProperty(n))a:{if(n[0]===`o`&&n[1]===`n`&&(a=n.endsWith(`Capture`),t=n.slice(2,a?n.length-7:void 0),o=e[ct]||null,o=o==null?null:o[n],typeof o==`function`&&e.removeEventListener(t,o,a),typeof r==`function`)){typeof o!=`function`&&o!==null&&(n in e?e[n]=null:e.hasAttribute(n)&&e.removeAttribute(n)),e.addEventListener(t,r,a);break a}n in e?e[n]=r:!0===r?e.setAttribute(n,``):kt(e,n,r)}}}function Pd(e,t,n){switch(t){case`div`:case`span`:case`svg`:case`path`:case`a`:case`g`:case`p`:case`li`:break;case`img`:Q(`error`,e),Q(`load`,e);var r=!1,a=!1,o;for(o in n)if(n.hasOwnProperty(o)){var s=n[o];if(s!=null)switch(o){case`src`:r=!0;break;case`srcSet`:a=!0;break;case`children`:case`dangerouslySetInnerHTML`:throw Error(i(137,t));default:$(e,t,o,s,n,null)}}a&&$(e,t,`srcSet`,n.srcSet,n,null),r&&$(e,t,`src`,n.src,n,null);return;case`input`:Q(`invalid`,e);var c=o=s=a=null,l=null,u=null;for(r in n)if(n.hasOwnProperty(r)){var d=n[r];if(d!=null)switch(r){case`name`:a=d;break;case`type`:s=d;break;case`checked`:l=d;break;case`defaultChecked`:u=d;break;case`value`:o=d;break;case`defaultValue`:c=d;break;case`children`:case`dangerouslySetInnerHTML`:if(d!=null)throw Error(i(137,t));break;default:$(e,t,r,d,n,null)}}Vt(e,o,c,l,u,s,a,!1);return;case`select`:for(a in Q(`invalid`,e),r=s=o=null,n)if(n.hasOwnProperty(a)&&(c=n[a],c!=null))switch(a){case`value`:o=c;break;case`defaultValue`:s=c;break;case`multiple`:r=c;default:$(e,t,a,c,n,null)}t=o,n=s,e.multiple=!!r,t==null?n!=null&&Ut(e,!!r,n,!0):Ut(e,!!r,t,!1);return;case`textarea`:for(s in Q(`invalid`,e),o=a=r=null,n)if(n.hasOwnProperty(s)&&(c=n[s],c!=null))switch(s){case`value`:r=c;break;case`defaultValue`:a=c;break;case`children`:o=c;break;case`dangerouslySetInnerHTML`:if(c!=null)throw Error(i(91));break;default:$(e,t,s,c,n,null)}Gt(e,r,a,o);return;case`option`:for(l in n)if(n.hasOwnProperty(l)&&(r=n[l],r!=null))switch(l){case`selected`:e.selected=r&&typeof r!=`function`&&typeof r!=`symbol`;break;default:$(e,t,l,r,n,null)}return;case`dialog`:Q(`beforetoggle`,e),Q(`toggle`,e),Q(`cancel`,e),Q(`close`,e);break;case`iframe`:case`object`:Q(`load`,e);break;case`video`:case`audio`:for(r=0;r<_d.length;r++)Q(_d[r],e);break;case`image`:Q(`error`,e),Q(`load`,e);break;case`details`:Q(`toggle`,e);break;case`embed`:case`source`:case`link`:Q(`error`,e),Q(`load`,e);case`area`:case`base`:case`br`:case`col`:case`hr`:case`keygen`:case`meta`:case`param`:case`track`:case`wbr`:case`menuitem`:for(u in n)if(n.hasOwnProperty(u)&&(r=n[u],r!=null))switch(u){case`children`:case`dangerouslySetInnerHTML`:throw Error(i(137,t));default:$(e,t,u,r,n,null)}return;default:if(Xt(t)){for(d in n)n.hasOwnProperty(d)&&(r=n[d],r!==void 0&&Nd(e,t,d,r,n,void 0));return}}for(c in n)n.hasOwnProperty(c)&&(r=n[c],r!=null&&$(e,t,c,r,n,null))}function Fd(e,t,n,r){switch(t){case`div`:case`span`:case`svg`:case`path`:case`a`:case`g`:case`p`:case`li`:break;case`input`:var a=null,o=null,s=null,c=null,l=null,u=null,d=null;for(m in n){var f=n[m];if(n.hasOwnProperty(m)&&f!=null)switch(m){case`checked`:break;case`value`:break;case`defaultValue`:l=f;default:r.hasOwnProperty(m)||$(e,t,m,null,r,f)}}for(var p in r){var m=r[p];if(f=n[p],r.hasOwnProperty(p)&&(m!=null||f!=null))switch(p){case`type`:o=m;break;case`name`:a=m;break;case`checked`:u=m;break;case`defaultChecked`:d=m;break;case`value`:s=m;break;case`defaultValue`:c=m;break;case`children`:case`dangerouslySetInnerHTML`:if(m!=null)throw Error(i(137,t));break;default:m!==f&&$(e,t,p,m,r,f)}}Bt(e,s,c,l,u,d,o,a);return;case`select`:for(o in m=s=c=p=null,n)if(l=n[o],n.hasOwnProperty(o)&&l!=null)switch(o){case`value`:break;case`multiple`:m=l;default:r.hasOwnProperty(o)||$(e,t,o,null,r,l)}for(a in r)if(o=r[a],l=n[a],r.hasOwnProperty(a)&&(o!=null||l!=null))switch(a){case`value`:p=o;break;case`defaultValue`:c=o;break;case`multiple`:s=o;default:o!==l&&$(e,t,a,o,r,l)}t=c,n=s,r=m,p==null?!!r!=!!n&&(t==null?Ut(e,!!n,n?[]:``,!1):Ut(e,!!n,t,!0)):Ut(e,!!n,p,!1);return;case`textarea`:for(c in m=p=null,n)if(a=n[c],n.hasOwnProperty(c)&&a!=null&&!r.hasOwnProperty(c))switch(c){case`value`:break;case`children`:break;default:$(e,t,c,null,r,a)}for(s in r)if(a=r[s],o=n[s],r.hasOwnProperty(s)&&(a!=null||o!=null))switch(s){case`value`:p=a;break;case`defaultValue`:m=a;break;case`children`:break;case`dangerouslySetInnerHTML`:if(a!=null)throw Error(i(91));break;default:a!==o&&$(e,t,s,a,r,o)}Wt(e,p,m);return;case`option`:for(var h in n)if(p=n[h],n.hasOwnProperty(h)&&p!=null&&!r.hasOwnProperty(h))switch(h){case`selected`:e.selected=!1;break;default:$(e,t,h,null,r,p)}for(l in r)if(p=r[l],m=n[l],r.hasOwnProperty(l)&&p!==m&&(p!=null||m!=null))switch(l){case`selected`:e.selected=p&&typeof p!=`function`&&typeof p!=`symbol`;break;default:$(e,t,l,p,r,m)}return;case`img`:case`link`:case`area`:case`base`:case`br`:case`col`:case`embed`:case`hr`:case`keygen`:case`meta`:case`param`:case`source`:case`track`:case`wbr`:case`menuitem`:for(var g in n)p=n[g],n.hasOwnProperty(g)&&p!=null&&!r.hasOwnProperty(g)&&$(e,t,g,null,r,p);for(u in r)if(p=r[u],m=n[u],r.hasOwnProperty(u)&&p!==m&&(p!=null||m!=null))switch(u){case`children`:case`dangerouslySetInnerHTML`:if(p!=null)throw Error(i(137,t));break;default:$(e,t,u,p,r,m)}return;default:if(Xt(t)){for(var _ in n)p=n[_],n.hasOwnProperty(_)&&p!==void 0&&!r.hasOwnProperty(_)&&Nd(e,t,_,void 0,r,p);for(d in r)p=r[d],m=n[d],!r.hasOwnProperty(d)||p===m||p===void 0&&m===void 0||Nd(e,t,d,p,r,m);return}}for(var v in n)p=n[v],n.hasOwnProperty(v)&&p!=null&&!r.hasOwnProperty(v)&&$(e,t,v,null,r,p);for(f in r)p=r[f],m=n[f],!r.hasOwnProperty(f)||p===m||p==null&&m==null||$(e,t,f,p,r,m)}function Id(e){switch(e){case`css`:case`script`:case`font`:case`img`:case`image`:case`input`:case`link`:return!0;default:return!1}}function Ld(){if(typeof performance.getEntriesByType==`function`){for(var e=0,t=0,n=performance.getEntriesByType(`resource`),r=0;r<n.length;r++){var i=n[r],a=i.transferSize,o=i.initiatorType,s=i.duration;if(a&&s&&Id(o)){for(o=0,s=i.responseEnd,r+=1;r<n.length;r++){var c=n[r],l=c.startTime;if(l>s)break;var u=c.transferSize,d=c.initiatorType;u&&Id(d)&&(c=c.responseEnd,o+=u*(c<s?1:(s-l)/(c-l)))}if(--r,t+=8*(a+o)/(i.duration/1e3),e++,10<e)break}}if(0<e)return t/e/1e6}return navigator.connection&&(e=navigator.connection.downlink,typeof e==`number`)?e:5}var Rd=null,zd=null;function Bd(e){return e.nodeType===9?e:e.ownerDocument}function Vd(e){switch(e){case`http://www.w3.org/2000/svg`:return 1;case`http://www.w3.org/1998/Math/MathML`:return 2;default:return 0}}function Hd(e,t){if(e===0)switch(t){case`svg`:return 1;case`math`:return 2;default:return 0}return e===1&&t===`foreignObject`?0:e}function Ud(e,t){return e===`textarea`||e===`noscript`||typeof t.children==`string`||typeof t.children==`number`||typeof t.children==`bigint`||typeof t.dangerouslySetInnerHTML==`object`&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var Wd=null;function Gd(){var e=window.event;return e&&e.type===`popstate`?e===Wd?!1:(Wd=e,!0):(Wd=null,!1)}var Kd=typeof setTimeout==`function`?setTimeout:void 0,qd=typeof clearTimeout==`function`?clearTimeout:void 0,Jd=typeof Promise==`function`?Promise:void 0,Yd=typeof queueMicrotask==`function`?queueMicrotask:Jd===void 0?Kd:function(e){return Jd.resolve(null).then(e).catch(Xd)};function Xd(e){setTimeout(function(){throw e})}function Zd(e){return e===`head`}function Qd(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===`/$`||n===`/&`){if(r===0){e.removeChild(i),Np(t);return}r--}else if(n===`$`||n===`$?`||n===`$~`||n===`$!`||n===`&`)r++;else if(n===`html`)pf(e.ownerDocument.documentElement);else if(n===`head`){n=e.ownerDocument.head,pf(n);for(var a=n.firstChild;a;){var o=a.nextSibling,s=a.nodeName;a[gt]||s===`SCRIPT`||s===`STYLE`||s===`LINK`&&a.rel.toLowerCase()===`stylesheet`||n.removeChild(a),a=o}}else n===`body`&&pf(e.ownerDocument.body);n=i}while(n);Np(t)}function $d(e,t){var n=e;e=0;do{var r=n.nextSibling;if(n.nodeType===1?t?(n._stashedDisplay=n.style.display,n.style.display=`none`):(n.style.display=n._stashedDisplay||``,n.getAttribute(`style`)===``&&n.removeAttribute(`style`)):n.nodeType===3&&(t?(n._stashedText=n.nodeValue,n.nodeValue=``):n.nodeValue=n._stashedText||``),r&&r.nodeType===8)if(n=r.data,n===`/$`){if(e===0)break;e--}else n!==`$`&&n!==`$?`&&n!==`$~`&&n!==`$!`||e++;n=r}while(n)}function ef(e){var t=e.firstChild;for(t&&t.nodeType===10&&(t=t.nextSibling);t;){var n=t;switch(t=t.nextSibling,n.nodeName){case`HTML`:case`HEAD`:case`BODY`:ef(n),_t(n);continue;case`SCRIPT`:case`STYLE`:continue;case`LINK`:if(n.rel.toLowerCase()===`stylesheet`)continue}e.removeChild(n)}}function tf(e,t,n,r){for(;e.nodeType===1;){var i=n;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!r&&(e.nodeName!==`INPUT`||e.type!==`hidden`))break}else if(!r)if(t===`input`&&e.type===`hidden`){var a=i.name==null?null:``+i.name;if(i.type===`hidden`&&e.getAttribute(`name`)===a)return e}else return e;else if(!e[gt])switch(t){case`meta`:if(!e.hasAttribute(`itemprop`))break;return e;case`link`:if(a=e.getAttribute(`rel`),a===`stylesheet`&&e.hasAttribute(`data-precedence`)||a!==i.rel||e.getAttribute(`href`)!==(i.href==null||i.href===``?null:i.href)||e.getAttribute(`crossorigin`)!==(i.crossOrigin==null?null:i.crossOrigin)||e.getAttribute(`title`)!==(i.title==null?null:i.title))break;return e;case`style`:if(e.hasAttribute(`data-precedence`))break;return e;case`script`:if(a=e.getAttribute(`src`),(a!==(i.src==null?null:i.src)||e.getAttribute(`type`)!==(i.type==null?null:i.type)||e.getAttribute(`crossorigin`)!==(i.crossOrigin==null?null:i.crossOrigin))&&a&&e.hasAttribute(`async`)&&!e.hasAttribute(`itemprop`))break;return e;default:return e}if(e=cf(e.nextSibling),e===null)break}return null}function nf(e,t,n){if(t===``)return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!n||(e=cf(e.nextSibling),e===null))return null;return e}function rf(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!t||(e=cf(e.nextSibling),e===null))return null;return e}function af(e){return e.data===`$?`||e.data===`$~`}function of(e){return e.data===`$!`||e.data===`$?`&&e.ownerDocument.readyState!==`loading`}function sf(e,t){var n=e.ownerDocument;if(e.data===`$~`)e._reactRetry=t;else if(e.data!==`$?`||n.readyState!==`loading`)t();else{var r=function(){t(),n.removeEventListener(`DOMContentLoaded`,r)};n.addEventListener(`DOMContentLoaded`,r),e._reactRetry=r}}function cf(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t===`$`||t===`$!`||t===`$?`||t===`$~`||t===`&`||t===`F!`||t===`F`)break;if(t===`/$`||t===`/&`)return null}}return e}var lf=null;function uf(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`/$`||n===`/&`){if(t===0)return cf(e.nextSibling);t--}else n!==`$`&&n!==`$!`&&n!==`$?`&&n!==`$~`&&n!==`&`||t++}e=e.nextSibling}return null}function df(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`$`||n===`$!`||n===`$?`||n===`$~`||n===`&`){if(t===0)return e;t--}else n!==`/$`&&n!==`/&`||t++}e=e.previousSibling}return null}function ff(e,t,n){switch(t=Bd(n),e){case`html`:if(e=t.documentElement,!e)throw Error(i(452));return e;case`head`:if(e=t.head,!e)throw Error(i(453));return e;case`body`:if(e=t.body,!e)throw Error(i(454));return e;default:throw Error(i(451))}}function pf(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);_t(e)}var mf=new Map,hf=new Set;function gf(e){return typeof e.getRootNode==`function`?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var _f=O.d;O.d={f:vf,r:yf,D:Sf,C:Cf,L:wf,m:Tf,X:Df,S:Ef,M:Of};function vf(){var e=_f.f(),t=bu();return e||t}function yf(e){var t=vt(e);t!==null&&t.tag===5&&t.type===`form`?Es(t):_f.r(e)}var bf=typeof document>`u`?null:document;function xf(e,t,n){var r=bf;if(r&&typeof t==`string`&&t){var i=zt(t);i=`link[rel="`+e+`"][href="`+i+`"]`,typeof n==`string`&&(i+=`[crossorigin="`+n+`"]`),hf.has(i)||(hf.add(i),e={rel:e,crossOrigin:n,href:t},r.querySelector(i)===null&&(t=r.createElement(`link`),Pd(t,`link`,e),xt(t),r.head.appendChild(t)))}}function Sf(e){_f.D(e),xf(`dns-prefetch`,e,null)}function Cf(e,t){_f.C(e,t),xf(`preconnect`,e,t)}function wf(e,t,n){_f.L(e,t,n);var r=bf;if(r&&e&&t){var i=`link[rel="preload"][as="`+zt(t)+`"]`;t===`image`&&n&&n.imageSrcSet?(i+=`[imagesrcset="`+zt(n.imageSrcSet)+`"]`,typeof n.imageSizes==`string`&&(i+=`[imagesizes="`+zt(n.imageSizes)+`"]`)):i+=`[href="`+zt(e)+`"]`;var a=i;switch(t){case`style`:a=Af(e);break;case`script`:a=Pf(e)}mf.has(a)||(e=p({rel:`preload`,href:t===`image`&&n&&n.imageSrcSet?void 0:e,as:t},n),mf.set(a,e),r.querySelector(i)!==null||t===`style`&&r.querySelector(jf(a))||t===`script`&&r.querySelector(Ff(a))||(t=r.createElement(`link`),Pd(t,`link`,e),xt(t),r.head.appendChild(t)))}}function Tf(e,t){_f.m(e,t);var n=bf;if(n&&e){var r=t&&typeof t.as==`string`?t.as:`script`,i=`link[rel="modulepreload"][as="`+zt(r)+`"][href="`+zt(e)+`"]`,a=i;switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:a=Pf(e)}if(!mf.has(a)&&(e=p({rel:`modulepreload`,href:e},t),mf.set(a,e),n.querySelector(i)===null)){switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:if(n.querySelector(Ff(a)))return}r=n.createElement(`link`),Pd(r,`link`,e),xt(r),n.head.appendChild(r)}}}function Ef(e,t,n){_f.S(e,t,n);var r=bf;if(r&&e){var i=bt(r).hoistableStyles,a=Af(e);t||=`default`;var o=i.get(a);if(!o){var s={loading:0,preload:null};if(o=r.querySelector(jf(a)))s.loading=5;else{e=p({rel:`stylesheet`,href:e,"data-precedence":t},n),(n=mf.get(a))&&Rf(e,n);var c=o=r.createElement(`link`);xt(c),Pd(c,`link`,e),c._p=new Promise(function(e,t){c.onload=e,c.onerror=t}),c.addEventListener(`load`,function(){s.loading|=1}),c.addEventListener(`error`,function(){s.loading|=2}),s.loading|=4,Lf(o,t,r)}o={type:`stylesheet`,instance:o,count:1,state:s},i.set(a,o)}}}function Df(e,t){_f.X(e,t);var n=bf;if(n&&e){var r=bt(n).hoistableScripts,i=Pf(e),a=r.get(i);a||(a=n.querySelector(Ff(i)),a||(e=p({src:e,async:!0},t),(t=mf.get(i))&&zf(e,t),a=n.createElement(`script`),xt(a),Pd(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Of(e,t){_f.M(e,t);var n=bf;if(n&&e){var r=bt(n).hoistableScripts,i=Pf(e),a=r.get(i);a||(a=n.querySelector(Ff(i)),a||(e=p({src:e,async:!0,type:`module`},t),(t=mf.get(i))&&zf(e,t),a=n.createElement(`script`),xt(a),Pd(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function kf(e,t,n,r){var a=(a=pe.current)?gf(a):null;if(!a)throw Error(i(446));switch(e){case`meta`:case`title`:return null;case`style`:return typeof n.precedence==`string`&&typeof n.href==`string`?(t=Af(n.href),n=bt(a).hoistableStyles,r=n.get(t),r||(r={type:`style`,instance:null,count:0,state:null},n.set(t,r)),r):{type:`void`,instance:null,count:0,state:null};case`link`:if(n.rel===`stylesheet`&&typeof n.href==`string`&&typeof n.precedence==`string`){e=Af(n.href);var o=bt(a).hoistableStyles,s=o.get(e);if(s||(a=a.ownerDocument||a,s={type:`stylesheet`,instance:null,count:0,state:{loading:0,preload:null}},o.set(e,s),(o=a.querySelector(jf(e)))&&!o._p&&(s.instance=o,s.state.loading=5),mf.has(e)||(n={rel:`preload`,as:`style`,href:n.href,crossOrigin:n.crossOrigin,integrity:n.integrity,media:n.media,hrefLang:n.hrefLang,referrerPolicy:n.referrerPolicy},mf.set(e,n),o||Nf(a,e,n,s.state))),t&&r===null)throw Error(i(528,``));return s}if(t&&r!==null)throw Error(i(529,``));return null;case`script`:return t=n.async,n=n.src,typeof n==`string`&&t&&typeof t!=`function`&&typeof t!=`symbol`?(t=Pf(n),n=bt(a).hoistableScripts,r=n.get(t),r||(r={type:`script`,instance:null,count:0,state:null},n.set(t,r)),r):{type:`void`,instance:null,count:0,state:null};default:throw Error(i(444,e))}}function Af(e){return`href="`+zt(e)+`"`}function jf(e){return`link[rel="stylesheet"][`+e+`]`}function Mf(e){return p({},e,{"data-precedence":e.precedence,precedence:null})}function Nf(e,t,n,r){e.querySelector(`link[rel="preload"][as="style"][`+t+`]`)?r.loading=1:(t=e.createElement(`link`),r.preload=t,t.addEventListener(`load`,function(){return r.loading|=1}),t.addEventListener(`error`,function(){return r.loading|=2}),Pd(t,`link`,n),xt(t),e.head.appendChild(t))}function Pf(e){return`[src="`+zt(e)+`"]`}function Ff(e){return`script[async]`+e}function If(e,t,n){if(t.count++,t.instance===null)switch(t.type){case`style`:var r=e.querySelector(`style[data-href~="`+zt(n.href)+`"]`);if(r)return t.instance=r,xt(r),r;var a=p({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return r=(e.ownerDocument||e).createElement(`style`),xt(r),Pd(r,`style`,a),Lf(r,n.precedence,e),t.instance=r;case`stylesheet`:a=Af(n.href);var o=e.querySelector(jf(a));if(o)return t.state.loading|=4,t.instance=o,xt(o),o;r=Mf(n),(a=mf.get(a))&&Rf(r,a),o=(e.ownerDocument||e).createElement(`link`),xt(o);var s=o;return s._p=new Promise(function(e,t){s.onload=e,s.onerror=t}),Pd(o,`link`,r),t.state.loading|=4,Lf(o,n.precedence,e),t.instance=o;case`script`:return o=Pf(n.src),(a=e.querySelector(Ff(o)))?(t.instance=a,xt(a),a):(r=n,(a=mf.get(o))&&(r=p({},n),zf(r,a)),e=e.ownerDocument||e,a=e.createElement(`script`),xt(a),Pd(a,`link`,r),e.head.appendChild(a),t.instance=a);case`void`:return null;default:throw Error(i(443,t.type))}else t.type===`stylesheet`&&!(t.state.loading&4)&&(r=t.instance,t.state.loading|=4,Lf(r,n.precedence,e));return t.instance}function Lf(e,t,n){for(var r=n.querySelectorAll(`link[rel="stylesheet"][data-precedence],style[data-precedence]`),i=r.length?r[r.length-1]:null,a=i,o=0;o<r.length;o++){var s=r[o];if(s.dataset.precedence===t)a=s;else if(a!==i)break}a?a.parentNode.insertBefore(e,a.nextSibling):(t=n.nodeType===9?n.head:n,t.insertBefore(e,t.firstChild))}function Rf(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.title??=t.title}function zf(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.integrity??=t.integrity}var Bf=null;function Vf(e,t,n){if(Bf===null){var r=new Map,i=Bf=new Map;i.set(n,r)}else i=Bf,r=i.get(n),r||(r=new Map,i.set(n,r));if(r.has(e))return r;for(r.set(e,null),n=n.getElementsByTagName(e),i=0;i<n.length;i++){var a=n[i];if(!(a[gt]||a[st]||e===`link`&&a.getAttribute(`rel`)===`stylesheet`)&&a.namespaceURI!==`http://www.w3.org/2000/svg`){var o=a.getAttribute(t)||``;o=e+o;var s=r.get(o);s?s.push(a):r.set(o,[a])}}return r}function Hf(e,t,n){e=e.ownerDocument||e,e.head.insertBefore(n,t===`title`?e.querySelector(`head > title`):null)}function Uf(e,t,n){if(n===1||t.itemProp!=null)return!1;switch(e){case`meta`:case`title`:return!0;case`style`:if(typeof t.precedence!=`string`||typeof t.href!=`string`||t.href===``)break;return!0;case`link`:if(typeof t.rel!=`string`||typeof t.href!=`string`||t.href===``||t.onLoad||t.onError)break;switch(t.rel){case`stylesheet`:return e=t.disabled,typeof t.precedence==`string`&&e==null;default:return!0}case`script`:if(t.async&&typeof t.async!=`function`&&typeof t.async!=`symbol`&&!t.onLoad&&!t.onError&&t.src&&typeof t.src==`string`)return!0}return!1}function Wf(e){return!(e.type===`stylesheet`&&!(e.state.loading&3))}function Gf(e,t,n,r){if(n.type===`stylesheet`&&(typeof r.media!=`string`||!1!==matchMedia(r.media).matches)&&!(n.state.loading&4)){if(n.instance===null){var i=Af(r.href),a=t.querySelector(jf(i));if(a){t=a._p,typeof t==`object`&&t&&typeof t.then==`function`&&(e.count++,e=Jf.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=a,xt(a);return}a=t.ownerDocument||t,r=Mf(r),(i=mf.get(i))&&Rf(r,i),a=a.createElement(`link`),xt(a);var o=a;o._p=new Promise(function(e,t){o.onload=e,o.onerror=t}),Pd(a,`link`,r),n.instance=a}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(n,t),(t=n.state.preload)&&!(n.state.loading&3)&&(e.count++,n=Jf.bind(e),t.addEventListener(`load`,n),t.addEventListener(`error`,n))}}var Kf=0;function qf(e,t){return e.stylesheets&&e.count===0&&Xf(e,e.stylesheets),0<e.count||0<e.imgCount?function(n){var r=setTimeout(function(){if(e.stylesheets&&Xf(e,e.stylesheets),e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}},6e4+t);0<e.imgBytes&&Kf===0&&(Kf=62500*Ld());var i=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&Xf(e,e.stylesheets),e.unsuspend)){var t=e.unsuspend;e.unsuspend=null,t()}},(e.imgBytes>Kf?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(r),clearTimeout(i)}}:null}function Jf(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Xf(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var Yf=null;function Xf(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,Yf=new Map,t.forEach(Zf,e),Yf=null,Jf.call(e))}function Zf(e,t){if(!(t.state.loading&4)){var n=Yf.get(e);if(n)var r=n.get(null);else{n=new Map,Yf.set(e,n);for(var i=e.querySelectorAll(`link[data-precedence],style[data-precedence]`),a=0;a<i.length;a++){var o=i[a];(o.nodeName===`LINK`||o.getAttribute(`media`)!==`not all`)&&(n.set(o.dataset.precedence,o),r=o)}r&&n.set(null,r)}i=t.instance,o=i.getAttribute(`data-precedence`),a=n.get(o)||r,a===r&&n.set(null,i),n.set(o,i),this.count++,r=Jf.bind(this),i.addEventListener(`load`,r),i.addEventListener(`error`,r),a?a.parentNode.insertBefore(i,a.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(i,e.firstChild)),t.state.loading|=4}}var Qf={$$typeof:x,Provider:null,Consumer:null,_currentValue:se,_currentValue2:se,_threadCount:0};function $f(e,t,n,r,i,a,o,s,c){this.tag=1,this.containerInfo=e,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=Xe(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Xe(0),this.hiddenUpdates=Xe(null),this.identifierPrefix=r,this.onUncaughtError=i,this.onCaughtError=a,this.onRecoverableError=o,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=c,this.incompleteTransitions=new Map}function ep(e,t,n,r,i,a,o,s,c,l,u,d){return e=new $f(e,t,n,o,c,l,u,d,s),t=1,!0===a&&(t|=24),a=li(3,null,null,t),e.current=a,a.stateNode=e,t=ca(),t.refCount++,e.pooledCache=t,t.refCount++,a.memoizedState={element:r,isDehydrated:n,cache:t},Va(a),e}function tp(e){return e?(e=si,e):si}function np(e,t,n,r,i,a){i=tp(i),r.context===null?r.context=i:r.pendingContext=i,r=Ua(t),r.payload={element:n},a=a===void 0?null:a,a!==null&&(r.callback=a),n=Wa(e,r,t),n!==null&&(hu(n,e,t),Ga(n,e,t))}function rp(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function ip(e,t){rp(e,t),(e=e.alternate)&&rp(e,t)}function ap(e){if(e.tag===13||e.tag===31){var t=ii(e,67108864);t!==null&&hu(t,e,67108864),ip(e,67108864)}}function op(e){if(e.tag===13||e.tag===31){var t=pu();t=nt(t);var n=ii(e,t);n!==null&&hu(n,e,t),ip(e,t)}}var sp=!0;function cp(e,t,n,r){var i=D.T;D.T=null;var a=O.p;try{O.p=2,up(e,t,n,r)}finally{O.p=a,D.T=i}}function lp(e,t,n,r){var i=D.T;D.T=null;var a=O.p;try{O.p=8,up(e,t,n,r)}finally{O.p=a,D.T=i}}function up(e,t,n,r){if(sp){var i=dp(r);if(i===null)wd(e,t,r,fp,n),Cp(e,r);else if(Tp(i,e,t,n,r))r.stopPropagation();else if(Cp(e,r),t&4&&-1<Sp.indexOf(e)){for(;i!==null;){var a=vt(i);if(a!==null)switch(a.tag){case 3:if(a=a.stateNode,a.current.memoizedState.isDehydrated){var o=Ge(a.pendingLanes);if(o!==0){var s=a;for(s.pendingLanes|=2,s.entangledLanes|=2;o;){var c=1<<31-Re(o);s.entanglements[1]|=c,o&=~c}rd(a),!(K&6)&&(tu=P()+500,id(0,!1))}}break;case 31:case 13:s=ii(a,2),s!==null&&hu(s,a,2),bu(),ip(a,2)}if(a=dp(r),a===null&&wd(e,t,r,fp,n),a===i)break;i=a}i!==null&&r.stopPropagation()}else wd(e,t,r,null,n)}}function dp(e){return e=nn(e),pp(e)}var fp=null;function pp(e){if(fp=null,e=I(e),e!==null){var t=o(e);if(t===null)e=null;else{var n=t.tag;if(n===13){if(e=s(t),e!==null)return e;e=null}else if(n===31){if(e=l(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 fp=e,null}function mp(e){switch(e){case`beforetoggle`:case`cancel`:case`click`:case`close`:case`contextmenu`:case`copy`:case`cut`:case`auxclick`:case`dblclick`:case`dragend`:case`dragstart`:case`drop`:case`focusin`:case`focusout`:case`input`:case`invalid`:case`keydown`:case`keypress`:case`keyup`:case`mousedown`:case`mouseup`:case`paste`:case`pause`:case`play`:case`pointercancel`:case`pointerdown`:case`pointerup`:case`ratechange`:case`reset`:case`resize`:case`seeked`:case`submit`:case`toggle`:case`touchcancel`:case`touchend`:case`touchstart`:case`volumechange`:case`change`:case`selectionchange`:case`textInput`:case`compositionstart`:case`compositionend`:case`compositionupdate`:case`beforeblur`:case`afterblur`:case`beforeinput`:case`blur`:case`fullscreenchange`:case`focus`:case`hashchange`:case`popstate`:case`select`:case`selectstart`:return 2;case`drag`:case`dragenter`:case`dragexit`:case`dragleave`:case`dragover`:case`mousemove`:case`mouseout`:case`mouseover`:case`pointermove`:case`pointerout`:case`pointerover`:case`scroll`:case`touchmove`:case`wheel`:case`mouseenter`:case`mouseleave`:case`pointerenter`:case`pointerleave`:return 8;case`message`:switch(Oe()){case ke:return 2;case Ae:return 8;case je:case Me:return 32;case Ne:return 268435456;default:return 32}default:return 32}}var hp=!1,gp=null,_p=null,vp=null,yp=new Map,bp=new Map,xp=[],Sp=`mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset`.split(` `);function Cp(e,t){switch(e){case`focusin`:case`focusout`:gp=null;break;case`dragenter`:case`dragleave`:_p=null;break;case`mouseover`:case`mouseout`:vp=null;break;case`pointerover`:case`pointerout`:yp.delete(t.pointerId);break;case`gotpointercapture`:case`lostpointercapture`:bp.delete(t.pointerId)}}function wp(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=vt(t),t!==null&&ap(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,i!==null&&t.indexOf(i)===-1&&t.push(i),e)}function Tp(e,t,n,r,i){switch(t){case`focusin`:return gp=wp(gp,e,t,n,r,i),!0;case`dragenter`:return _p=wp(_p,e,t,n,r,i),!0;case`mouseover`:return vp=wp(vp,e,t,n,r,i),!0;case`pointerover`:var a=i.pointerId;return yp.set(a,wp(yp.get(a)||null,e,t,n,r,i)),!0;case`gotpointercapture`:return a=i.pointerId,bp.set(a,wp(bp.get(a)||null,e,t,n,r,i)),!0}return!1}function Ep(e){var t=I(e.target);if(t!==null){var n=o(t);if(n!==null){if(t=n.tag,t===13){if(t=s(n),t!==null){e.blockedOn=t,at(e.priority,function(){op(n)});return}}else if(t===31){if(t=l(n),t!==null){e.blockedOn=t,at(e.priority,function(){op(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 Dp(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=dp(e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);tn=r,n.target.dispatchEvent(r),tn=null}else return t=vt(n),t!==null&&ap(t),e.blockedOn=n,!1;t.shift()}return!0}function Op(e,t,n){Dp(e)&&n.delete(t)}function kp(){hp=!1,gp!==null&&Dp(gp)&&(gp=null),_p!==null&&Dp(_p)&&(_p=null),vp!==null&&Dp(vp)&&(vp=null),yp.forEach(Op),bp.forEach(Op)}function Ap(e,n){e.blockedOn===n&&(e.blockedOn=null,hp||(hp=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,kp)))}var jp=null;function Mp(e){jp!==e&&(jp=e,t.unstable_scheduleCallback(t.unstable_NormalPriority,function(){jp===e&&(jp=null);for(var t=0;t<e.length;t+=3){var n=e[t],r=e[t+1],i=e[t+2];if(typeof r!=`function`){if(pp(r||n)===null)continue;break}var a=vt(n);a!==null&&(e.splice(t,3),t-=3,ws(a,{pending:!0,data:i,method:n.method,action:r},r,i))}}))}function Np(e){function t(t){return Ap(t,e)}gp!==null&&Ap(gp,e),_p!==null&&Ap(_p,e),vp!==null&&Ap(vp,e),yp.forEach(t),bp.forEach(t);for(var n=0;n<xp.length;n++){var r=xp[n];r.blockedOn===e&&(r.blockedOn=null)}for(;0<xp.length&&(n=xp[0],n.blockedOn===null);)Ep(n),n.blockedOn===null&&xp.shift();if(n=(e.ownerDocument||e).$$reactFormReplay,n!=null)for(r=0;r<n.length;r+=3){var i=n[r],a=n[r+1],o=i[ct]||null;if(typeof a==`function`)o||Mp(n);else if(o){var s=null;if(a&&a.hasAttribute(`formAction`)){if(i=a,o=a[ct]||null)s=o.formAction;else if(pp(i)!==null)continue}else s=o.action;typeof s==`function`?n[r+1]=s:(n.splice(r,3),r-=3),Mp(n)}}}function Pp(){function e(e){e.canIntercept&&e.info===`react-transition`&&e.intercept({handler:function(){return new Promise(function(e){return i=e})},focusReset:`manual`,scroll:`manual`})}function t(){i!==null&&(i(),i=null),r||setTimeout(n,20)}function n(){if(!r&&!navigation.transition){var e=navigation.currentEntry;e&&e.url!=null&&navigation.navigate(e.url,{state:e.getState(),info:`react-transition`,history:`replace`})}}if(typeof navigation==`object`){var r=!1,i=null;return navigation.addEventListener(`navigate`,e),navigation.addEventListener(`navigatesuccess`,t),navigation.addEventListener(`navigateerror`,t),setTimeout(n,100),function(){r=!0,navigation.removeEventListener(`navigate`,e),navigation.removeEventListener(`navigatesuccess`,t),navigation.removeEventListener(`navigateerror`,t),i!==null&&(i(),i=null)}}}function Fp(e){this._internalRoot=e}Ip.prototype.render=Fp.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(i(409));var n=t.current;np(n,pu(),e,t,null,null)},Ip.prototype.unmount=Fp.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;np(e.current,2,null,e,null,null),bu(),t[lt]=null}};function Ip(e){this._internalRoot=e}Ip.prototype.unstable_scheduleHydration=function(e){if(e){var t=it();e={blockedOn:null,target:e,priority:t};for(var n=0;n<xp.length&&t!==0&&t<xp[n].priority;n++);xp.splice(n,0,e),n===0&&Ep(e)}};var Lp=n.version;if(Lp!==`19.2.5`)throw Error(i(527,Lp,`19.2.5`));O.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render==`function`?Error(i(188)):(e=Object.keys(e).join(`,`),Error(i(268,e)));return e=d(t),e=e===null?null:f(e),e=e===null?null:e.stateNode,e};var Rp={bundleType:0,version:`19.2.5`,rendererPackageName:`react-dom`,currentDispatcherRef:D,reconcilerVersion:`19.2.5`};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`){var zp=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!zp.isDisabled&&zp.supportsFiber)try{Ie=zp.inject(Rp),F=zp}catch{}}e.createRoot=function(e,t){if(!a(e))throw Error(i(299));var n=!1,r=``,o=qs,s=Js,c=Ys;return t!=null&&(!0===t.unstable_strictMode&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onUncaughtError!==void 0&&(o=t.onUncaughtError),t.onCaughtError!==void 0&&(s=t.onCaughtError),t.onRecoverableError!==void 0&&(c=t.onRecoverableError)),t=ep(e,1,!1,null,null,n,r,null,o,s,c,Pp),e[lt]=t.current,Sd(e),new Fp(t)}})),_t=t(((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=gt()})),I=e(c(),1),vt=_t();async function yt(e){let t=Math.max(1,e.maxAttempts??16),n=Math.max(50,e.intervalMs??500),r=null;for(let i=1;i<=t;i+=1){if(e.signal?.aborted)return{settled:!1,attempts:i-1,instance:r};let a=new AbortController,o=()=>a.abort();e.signal?.addEventListener(`abort`,o,{once:!0});try{r=await e.fetchOnce(e.port,a.signal)}catch{r=null}finally{e.signal?.removeEventListener(`abort`,o)}if(e.onAttempt?.(r,i),bt(r,e))return{settled:!0,attempts:i,instance:r};if(i===t)break;await xt(n,e.signal)}return{settled:!1,attempts:t,instance:r}}function bt(e,t){return t.expected===`online`?e?.status===`online`:t.expected===`offline`?e?e.status!==`online`:!0:t.expected===`restart-detected`?!e||e.status!==`online`||typeof e.uptime!=`number`?!1:typeof t.previousUptime==`number`?e.uptime<t.previousUptime:!0:!1}function xt(e,t){return new Promise(n=>{let r=setTimeout(()=>{i(),n()},e);function i(){clearTimeout(r),t?.removeEventListener(`abort`,a)}function a(){i(),n()}if(t?.aborted){i(),n();return}t?.addEventListener(`abort`,a,{once:!0})})}var L=l();function St({value:e,onChange:t}){return(0,L.jsx)(`div`,{className:`settings-sidebar-search`,children:(0,L.jsx)(`input`,{type:`search`,value:e,onChange:e=>t(e.target.value),placeholder:`Search settings…`,"aria-label":`Search settings`,spellCheck:!1,autoComplete:`off`})})}var Ct=[`runtime`,`identity`,`channels`,`automation`,`integrations`,`network-security`,`advanced`],wt={runtime:`Runtime`,identity:`Identity`,channels:`Channels`,automation:`Automation`,integrations:`Integrations`,"network-security":`Network & security`,advanced:`Advanced`};function Tt(e,t){let n=t.trim().toLowerCase();return n?e.filter(e=>e.label.toLowerCase().includes(n)||e.id.toLowerCase().includes(n)):e.slice()}function Et(e){let t=new Map;for(let n of e){let e=t.get(n.group)||[];e.push(n),t.set(n.group,e)}return Ct.filter(e=>(t.get(e)?.length??0)>0).map(e=>({group:e,label:wt[e],items:t.get(e)??[]}))}var Dt=[{id:`agent`,label:`Agent`,group:`runtime`},{id:`model`,label:`Model defaults`,group:`runtime`},{id:`profile`,label:`Profile`,group:`identity`},{id:`display`,label:`Display`,group:`identity`},{id:`channels-telegram`,label:`Channels — Telegram`,group:`channels`},{id:`channels-discord`,label:`Channels — Discord`,group:`channels`},{id:`heartbeat`,label:`Heartbeat & schedules`,group:`automation`},{id:`memory`,label:`Memory`,group:`automation`},{id:`speech`,label:`Speech & keys`,group:`integrations`},{id:`prompts`,label:`Prompts`,group:`integrations`},{id:`mcp`,label:`MCP servers`,group:`integrations`},{id:`browser`,label:`Browser / CDP`,group:`integrations`},{id:`network`,label:`Network`,group:`network-security`},{id:`permissions`,label:`Permissions`,group:`network-security`},{id:`dashboard-meta`,label:`Dashboard meta`,group:`advanced`},{id:`advanced-export`,label:`Export / import`,group:`advanced`}];function Ot({activeId:e,onSelect:t}){let[n,r]=(0,I.useState)(``),[i,a]=(0,I.useState)(new Set),o=Et(Tt(Dt,n)),s=(0,I.useCallback)(e=>{a(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},[]);return(0,L.jsxs)(`nav`,{className:`settings-sidebar`,"aria-label":`Settings categories`,children:[(0,L.jsx)(St,{value:n,onChange:r}),o.length===0?(0,L.jsx)(`p`,{className:`settings-sidebar-empty`,children:`No matches.`}):null,o.map(({group:n,label:r,items:a})=>{let o=i.has(n);return(0,L.jsxs)(`section`,{className:`settings-sidebar-group`,children:[(0,L.jsxs)(`button`,{type:`button`,className:`settings-sidebar-group-header`,"aria-expanded":!o,"aria-controls":`settings-sidebar-group-${n}`,onClick:()=>s(n),children:[(0,L.jsx)(`span`,{className:`settings-sidebar-group-caret`,"aria-hidden":`true`,children:o?`▸`:`▾`}),(0,L.jsx)(`span`,{className:`settings-sidebar-group-label`,children:r})]}),o?null:(0,L.jsx)(`div`,{id:`settings-sidebar-group-${n}`,role:`tablist`,className:`settings-sidebar-group-items`,children:a.map(n=>{let r=n.id===e;return(0,L.jsx)(`button`,{type:`button`,role:`tab`,"aria-selected":r,"aria-current":r?`page`:void 0,className:`settings-sidebar-item${r?` is-active`:``}`,onClick:()=>t(n.id),children:n.label},n.id)})})]},n)})]})}function kt(){let e=new Map,t=new Set;function n(){for(let e of t)e()}return{pending:e,isDirty:()=>Array.from(e.values()).some(e=>!At(e.value,e.original)),set(t,r){if(At(r.value,r.original)){e.has(t)&&(e.delete(t),n());return}e.set(t,r),n()},remove(t){e.delete(t)&&n()},clear(){e.size!==0&&(e.clear(),n())},saveBundle(){let t={};for(let[n,r]of e)r.valid&&(t[n]=r.value);return t},subscribe(e){return t.add(e),()=>{t.delete(e)}}}}function At(e,t){return e===t?!0:typeof e!=`object`||typeof t!=`object`||e===null||t===null?!1:Array.isArray(e)&&Array.isArray(t)?e.length===t.length&&e.every((e,n)=>e===t[n]):JSON.stringify(e)===JSON.stringify(t)}function jt({isDirty:e,saving:t,pendingCount:n,error:r,onDiscard:i,onSave:a}){return!e&&!t&&!r?null:(0,L.jsxs)(`div`,{className:`settings-save-bar`,role:`region`,"aria-label":`Save changes`,"data-testid":`settings-save-bar`,children:[r?(0,L.jsx)(`span`,{className:`settings-save-bar-error`,role:`alert`,children:r}):(0,L.jsx)(`span`,{className:`settings-save-bar-status muted`,children:n===0?`No pending changes.`:`${n} pending change${n===1?``:`s`}`}),(0,L.jsx)(`button`,{type:`button`,className:`settings-action settings-action-discard`,onClick:i,disabled:t||!e,children:`Discard`}),(0,L.jsx)(`button`,{type:`button`,className:`settings-action settings-action-save`,onClick:a,disabled:t||!e,"aria-keyshortcuts":`Meta+S Control+S`,children:t?`Saving…`:`Save`})]})}function Mt({kind:e,message:t,onDismiss:n,timeoutMs:r=3500}){return(0,I.useEffect)(()=>{if(r<=0)return;let e=setTimeout(n,r);return()=>clearTimeout(e)},[n,r]),(0,L.jsxs)(`div`,{className:`settings-toast settings-toast-${e}`,role:`status`,"aria-live":`polite`,children:[(0,L.jsx)(`span`,{className:`settings-toast-message`,children:t}),(0,L.jsx)(`button`,{type:`button`,className:`settings-toast-dismiss`,"aria-label":`Dismiss notification`,onClick:n,children:`×`})]})}function Nt({enabled:e,containerRef:t,onSave:n}){(0,I.useEffect)(()=>{if(!e)return;function r(e){if(e.key!==`s`&&e.key!==`S`||!(e.metaKey||e.ctrlKey)||e.altKey||e.shiftKey)return;let r=t.current;if(!r)return;let i=e.target,a=i instanceof Node?i:null;a&&!r.contains(a)||(e.preventDefault(),n())}return document.addEventListener(`keydown`,r),()=>document.removeEventListener(`keydown`,r)},[e,t,n])}var Pt={agent:(0,I.lazy)(()=>n(()=>import(`./Agent-CIUGaUVn.js`),[])),profile:(0,I.lazy)(()=>n(()=>import(`./Profile-D_6kFj73.js`),[])),display:(0,I.lazy)(()=>n(()=>import(`./Display-BPbCVOoi.js`),[])),model:(0,I.lazy)(()=>n(()=>import(`./ModelProvider-DHQ1Zvw0.js`),[])),"channels-telegram":(0,I.lazy)(()=>n(()=>import(`./ChannelsTelegram-xjA3-Mr8.js`),[])),"channels-discord":(0,I.lazy)(()=>n(()=>import(`./ChannelsDiscord-Bwt2-Jva.js`),[])),speech:(0,I.lazy)(()=>n(()=>import(`./SpeechKeys-Cx4_SXTM.js`),[])),heartbeat:(0,I.lazy)(()=>n(()=>import(`./Heartbeat-D64JCg4t.js`),[])),memory:(0,I.lazy)(()=>n(()=>import(`./Memory-BgN8djV4.js`),[])),employees:(0,I.lazy)(()=>n(()=>import(`./Employees-BL9MAzzx.js`),[])),network:(0,I.lazy)(()=>n(()=>import(`./Network-B-WvB6R5.js`),[])),permissions:(0,I.lazy)(()=>n(()=>import(`./Permissions-QxvByCop.js`),[])),prompts:(0,I.lazy)(()=>n(()=>import(`./Prompts--4CM3enz.js`),[])),mcp:(0,I.lazy)(()=>n(()=>import(`./Mcp-wYwJA_61.js`),[])),browser:(0,I.lazy)(()=>n(()=>import(`./Browser-C4TCAhKR.js`),[])),"dashboard-meta":(0,I.lazy)(()=>n(()=>import(`./DashboardMeta-CBckkL_V.js`),[])),"advanced-export":(0,I.lazy)(()=>n(()=>import(`./AdvancedExport-DLCgT_ZP.js`),[]))};function Ft(){let e=(0,I.useRef)(null);return e.current===null&&(e.current=kt()),e.current}function It(e){return(0,I.useSyncExternalStore)((0,I.useCallback)(t=>e.subscribe(t),[e]),(0,I.useCallback)(()=>e.isDirty(),[e]),(0,I.useCallback)(()=>!1,[]))}function Lt(e){return(0,I.useSyncExternalStore)((0,I.useCallback)(t=>e.subscribe(t),[e]),(0,I.useCallback)(()=>e.pending.size,[e]),(0,I.useCallback)(()=>0,[]))}function Rt({port:e,instanceUrl:t,onDirtyChange:n,onSaved:r}){let[i,a]=(0,I.useState)(`agent`),o=Ft(),s=It(o),c=Lt(o),l=(0,I.useMemo)(()=>le(e),[e]),u=(0,I.useRef)(null),[d,f]=(0,I.useState)(!1),[p,m]=(0,I.useState)(null),[h,g]=(0,I.useState)(null),_=(0,I.useRef)(null),v=(0,I.useCallback)(e=>{u.current=e},[]);(0,I.useEffect)(()=>{o.clear(),u.current=null,m(null),g(null)},[e,o]),(0,I.useEffect)(()=>{n?.(s)},[s,n]),(0,I.useEffect)(()=>()=>n?.(!1),[n]);let y=(0,I.useCallback)(e=>{e!==i&&(d||o.isDirty()&&!window.confirm(`Discard unsaved changes?`)||(o.clear(),m(null),g(null),u.current=null,a(e)))},[i,o,d]),b=(0,I.useCallback)(()=>{d||(o.clear(),m(null))},[o,d]),x=(0,I.useCallback)(async()=>{if(d)return;let e=u.current;if(m(null),!e){o.clear();return}f(!0);try{await e(),r?.(),g({kind:`ok`,message:`Saved.`})}catch(e){let t=ue(e);m(t),g({kind:`err`,message:`Failed: ${t}`})}finally{f(!1)}},[o,r,d]);Nt({enabled:s&&!d,containerRef:_,onSave:()=>{x()}});let S=Pt[i];return(0,L.jsxs)(`div`,{className:`settings-shell`,ref:_,children:[(0,L.jsx)(Ot,{activeId:i,onSelect:y}),(0,L.jsxs)(`section`,{className:`settings-page`,"aria-live":`polite`,children:[(0,L.jsx)(I.Suspense,{fallback:(0,L.jsx)(`div`,{className:`settings-loading`,children:`Loading…`}),children:S?(0,L.jsx)(S,{port:e,instanceUrl:t,client:l,dirty:o,registerSave:v}):(0,L.jsx)(`div`,{className:`settings-placeholder`,children:`This page lands in a later phase.`})}),(0,L.jsx)(jt,{isDirty:s,saving:d,pendingCount:c,error:p,onDiscard:b,onSave:()=>void x()}),h?(0,L.jsx)(Mt,{kind:h.kind,message:h.message,onDismiss:()=>g(null)}):null]})]})}function zt(){let[e,t]=(0,I.useState)(null),[n,r]=(0,I.useState)(null),[i,a]=(0,I.useState)(null),o=e?.managed.length||0;(0,I.useEffect)(()=>{s()},[]);async function s(){try{t(await g())}catch(e){a(e.message)}}async function c(e,n){r(e),a(null);try{t(await n()),a(`${e} complete.`)}catch(e){a(e.message)}finally{r(null)}}function l(){o!==0&&window.confirm(`Stop ${o} dashboard-managed server${o===1?``:`s`}?`)&&c(`Stop all managed`,f)}return(0,L.jsxs)(`section`,{className:`process-control-panel`,"aria-label":`Process control`,children:[(0,L.jsxs)(`div`,{className:`process-control-header`,children:[(0,L.jsxs)(`div`,{children:[(0,L.jsx)(`span`,{children:`Process control`}),(0,L.jsxs)(`strong`,{children:[o,` managed`]})]}),(0,L.jsx)(`button`,{type:`button`,onClick:s,disabled:n!=null,children:`Refresh`})]}),(0,L.jsxs)(`div`,{className:`process-control-actions`,children:[(0,L.jsx)(`button`,{type:`button`,onClick:l,disabled:n!=null||o===0,children:`Stop all managed`}),(0,L.jsx)(`button`,{type:`button`,onClick:()=>void c(`Adopt/recover managed`,T),disabled:n!=null,children:`Adopt/recover`}),(0,L.jsx)(`button`,{type:`button`,disabled:!0,title:e?.unsupported.reason||`Planned`,children:`Force release port`})]}),(0,L.jsx)(`p`,{className:`process-control-hint`,children:`Stop all affects only dashboard-managed servers. Adopt/recover reconnects known managed process records without stopping external instances.`}),(0,L.jsxs)(`div`,{className:`process-control-list`,children:[e?.managed.map(e=>(0,L.jsxs)(`div`,{className:`process-control-row`,children:[(0,L.jsxs)(`span`,{children:[`:`,e.port]}),(0,L.jsx)(`strong`,{children:e.pid?`pid ${e.pid}`:`pid n/a`}),(0,L.jsx)(`em`,{children:e.proof})]},e.port)),o===0&&(0,L.jsx)(`p`,{children:`No dashboard-managed servers are registered.`})]}),i&&(0,L.jsx)(`p`,{className:`process-control-message`,children:i})]})}var Bt=4e3,Vt={info:`log-level-info`,warn:`log-level-warn`,error:`log-level-error`};function Ht(e){try{return new Date(e).toLocaleTimeString(`en-GB`,{hour12:!1})}catch{return e.slice(11,19)}}function Ut({port:e}){let[t,n]=(0,I.useState)(null),[r,i]=(0,I.useState)(null),[a,o]=(0,I.useState)(!0),[s,c]=(0,I.useState)(`all`),l=(0,I.useRef)(null),u=(0,I.useRef)(null),d=(0,I.useCallback)(async()=>{try{let t=await fetch(`/api/manager/instance-logs/${e}`);if(!t.ok){i(`HTTP ${t.status}`);return}let r=await t.json();r.ok&&r.snapshot?(n(r.snapshot),i(null)):i(r.error||`Unknown error`)}catch(e){i(e.message)}},[e]);(0,I.useEffect)(()=>(d(),u.current=setInterval(d,Bt),()=>{u.current&&clearInterval(u.current)}),[d]),(0,I.useEffect)(()=>{a&&l.current&&(l.current.scrollTop=l.current.scrollHeight)},[t,a]);let f=t?.lines.filter(e=>s===`all`||e.level===s)??[];return r&&!t?(0,L.jsxs)(`div`,{className:`detail-empty`,children:[`Failed to load logs: `,r]}):t?.source===`none`?(0,L.jsx)(`div`,{className:`detail-empty`,children:t.reason||`No log source reachable for this instance.`}):(0,L.jsxs)(`div`,{className:`logs-panel`,children:[(0,L.jsxs)(`div`,{className:`logs-toolbar`,children:[(0,L.jsxs)(`select`,{className:`logs-filter`,value:s,onChange:e=>c(e.target.value),children:[(0,L.jsx)(`option`,{value:`all`,children:`All levels`}),(0,L.jsx)(`option`,{value:`info`,children:`Info`}),(0,L.jsx)(`option`,{value:`warn`,children:`Warn`}),(0,L.jsx)(`option`,{value:`error`,children:`Error`})]}),(0,L.jsxs)(`label`,{className:`logs-autoscroll`,children:[(0,L.jsx)(`input`,{type:`checkbox`,checked:a,onChange:e=>o(e.target.checked)}),`Auto-scroll`]}),(0,L.jsxs)(`span`,{className:`logs-meta`,children:[t?`${t.lines.length} lines · source: ${t.source}`:`Loading…`,t?.truncated&&` · truncated`]})]}),(0,L.jsx)(`div`,{className:`logs-container`,ref:l,children:f.length===0?(0,L.jsx)(`div`,{className:`logs-empty`,children:`No log lines available.`}):f.map((e,t)=>(0,L.jsxs)(`div`,{className:`log-line ${Vt[e.level]}`,children:[(0,L.jsx)(`span`,{className:`log-ts`,children:Ht(e.ts)}),(0,L.jsx)(`span`,{className:`log-level`,children:e.level.toUpperCase()}),(0,L.jsx)(`span`,{className:`log-text`,children:e.text})]},t))})]})}function Wt(e){let t=e.instance;return(0,L.jsxs)(`section`,{className:`detail-panel`,"aria-label":`Selected instance detail`,children:[e.activeTab===`overview`&&(0,L.jsxs)(L.Fragment,{children:[(0,L.jsxs)(`div`,{className:`overview-grid`,children:[(0,L.jsxs)(`div`,{children:[(0,L.jsx)(`span`,{children:`Status`}),(0,L.jsx)(`strong`,{children:t?.status||`n/a`})]}),(0,L.jsxs)(`div`,{children:[(0,L.jsx)(`span`,{children:`CLI`}),(0,L.jsx)(`strong`,{children:t?.currentCli||`n/a`})]}),(0,L.jsxs)(`div`,{children:[(0,L.jsx)(`span`,{children:`Model`}),(0,L.jsx)(`strong`,{children:t?.currentModel||`n/a`})]}),(0,L.jsxs)(`div`,{children:[(0,L.jsx)(`span`,{children:`Owner`}),(0,L.jsx)(`strong`,{children:t?.lifecycle?.owner||`n/a`})]}),(0,L.jsxs)(`div`,{children:[(0,L.jsx)(`span`,{children:`Version`}),(0,L.jsx)(`strong`,{children:t?.version||`n/a`})]}),(0,L.jsxs)(`div`,{children:[(0,L.jsx)(`span`,{children:`Group`}),(0,L.jsx)(`strong`,{children:t?.group||`ungrouped`})]}),(0,L.jsxs)(`div`,{children:[(0,L.jsx)(`span`,{children:`Reason`}),(0,L.jsx)(`strong`,{children:t?.lifecycle?.reason||t?.healthReason||`ok`})]})]}),(0,L.jsx)(zt,{})]}),e.activeTab===`logs`&&t&&(0,L.jsx)(Ut,{port:t.port}),e.activeTab===`logs`&&!t&&(0,L.jsx)(`div`,{className:`detail-empty`,children:`Select an instance to view its logs.`}),e.activeTab===`settings`&&t&&(0,L.jsx)(Rt,{port:t.port,instanceUrl:`http://localhost:${t.port}`,...e.onSettingsDirtyChange===void 0?{}:{onDirtyChange:e.onSettingsDirtyChange},...e.onSettingsSaved===void 0?{}:{onSaved:e.onSettingsSaved}},t.port),e.activeTab===`settings`&&!t&&(0,L.jsx)(`div`,{className:`detail-empty`,children:`Select an instance to configure it.`})]})}function Gt(e){return(0,L.jsxs)(`div`,{className:`empty-navigator`,role:`status`,"aria-live":`polite`,children:[(0,L.jsx)(`p`,{className:`empty-navigator-headline`,children:`No Jaw instances detected on the scanned range.`}),(0,L.jsxs)(`p`,{className:`empty-navigator-subline`,children:[`Currently scanning ports `,e.rangeFrom,`–`,e.rangeTo,`. Try widening the range, or start a Jaw with the command below.`]}),(0,L.jsxs)(`code`,{className:`empty-navigator-code`,"aria-label":`Suggested command`,children:[`jaw serve --port `,e.rangeFrom]})]})}var Kt={start:`starting…`,stop:`stopping…`,restart:`restarting…`,perm:`registering…`,unperm:`unregistering…`};function qt(e){return`instance-status status-${e}`}var Jt=()=>(0,L.jsx)(`svg`,{viewBox:`0 0 16 16`,width:`12`,height:`12`,fill:`currentColor`,"aria-hidden":`true`,children:(0,L.jsx)(`rect`,{x:`3`,y:`3`,width:`10`,height:`10`,rx:`1.5`})}),Yt=()=>(0,L.jsxs)(`svg`,{viewBox:`0 0 16 16`,width:`12`,height:`12`,stroke:`currentColor`,strokeWidth:`1.5`,fill:`none`,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":`true`,children:[(0,L.jsx)(`path`,{d:`M6.5 3.5H4a1 1 0 0 0-1 1V12a1 1 0 0 0 1 1h7.5a1 1 0 0 0 1-1V9.5`}),(0,L.jsx)(`path`,{d:`M9.5 2.5h4v4`}),(0,L.jsx)(`path`,{d:`M13.5 2.5 8 8`})]});function Xt(e){let t=e.instance.lifecycle,n=t?.reason||e.instance.healthReason||`ok`,[r,i]=(0,I.useState)(!1),[a,o]=(0,I.useState)(e.instance.label||e.profile?.label||e.label),[s,c]=(0,I.useState)(!1),[l,u]=(0,I.useState)(null);function d(e){e.stopPropagation()}let f=e.transitioning?Kt[e.transitioning]:null,p=`${qt(e.instance.status)}${f?` is-transitioning`:``}${e.agentBusy?` is-busy`:``}`,m=e.instance.label||e.profile?.label||e.label;async function h(t){t.preventDefault(),t.stopPropagation(),c(!0),u(null);try{await e.onInstanceLabelSave(e.instance.port,a),i(!1)}catch(e){u(e.message)}finally{c(!1)}}return(0,L.jsxs)(`article`,{className:`instance-row density-${e.density||`comfortable`} priority-${e.priority||`normal`} ${e.selected?`is-selected`:``}${f?` is-transitioning-row`:``}`,children:[(0,L.jsxs)(`button`,{className:`instance-row-select`,type:`button`,"aria-pressed":e.selected,onClick:()=>{e.onSelect(e.instance)},children:[(0,L.jsxs)(`div`,{className:`instance-row-main`,children:[(0,L.jsx)(`span`,{className:p,"aria-label":e.instance.status}),(0,L.jsxs)(`div`,{className:`instance-row-title`,children:[(0,L.jsxs)(`div`,{className:`instance-row-title-line`,children:[(0,L.jsx)(`strong`,{children:e.instance.favorite?`Pinned ${m}`:m}),e.activityUnreadCount?(0,L.jsxs)(`span`,{className:`instance-unread-badge`,"aria-label":`${e.activityUnreadCount} unread activity`,children:[`(`,e.activityUnreadCount>99?`99+`:e.activityUnreadCount,`)`]}):null]}),f&&(0,L.jsx)(`span`,{children:(0,L.jsx)(`em`,{className:`instance-row-transition`,children:f})})]}),(0,L.jsxs)(`div`,{className:`instance-row-quick`,onClick:d,children:[(0,L.jsx)(`button`,{type:`button`,className:`quick-btn action-stop`,onClick:t=>{d(t),e.onLifecycle(`stop`,e.instance)},disabled:!t?.canStop||e.busy,title:`Stop`,"aria-label":`Stop`,children:(0,L.jsx)(Jt,{})}),(0,L.jsx)(`a`,{className:`quick-btn action-open${e.instance.ok?``:` is-disabled`}`,href:e.instance.ok?e.instance.url:void 0,target:e.instance.ok?`_blank`:void 0,rel:e.instance.ok?`noreferrer`:void 0,title:`Open in new tab`,"aria-label":`Open`,"aria-disabled":!e.instance.ok||void 0,tabIndex:e.instance.ok?void 0:-1,onClick:t=>{if(!e.instance.ok){t.preventDefault();return}d(t),e.onMarkActivitySeen(e.instance.port)},children:(0,L.jsx)(Yt,{})}),(0,L.jsxs)(`span`,{className:`port`,children:[`:`,e.instance.port]})]})]}),(0,L.jsxs)(`div`,{className:`instance-row-meta`,children:[e.showLatestActivityTitle!==!1&&e.latestActivityTitle&&(0,L.jsx)(`span`,{className:`instance-row-activity-title`,children:e.latestActivityTitle}),e.showRuntimeLine!==!1&&(0,L.jsxs)(`span`,{className:`instance-row-runtime`,children:[e.instance.currentCli||`cli n/a`,` / `,e.instance.currentModel||`model n/a`]}),(0,L.jsxs)(`span`,{className:`instance-row-version`,children:[`v`,e.instance.version||`n/a`,` · `,e.uptime]}),(0,L.jsxs)(`span`,{className:`instance-row-reason`,children:[new Date(e.instance.lastCheckedAt).toLocaleTimeString(),` · `,n]})]})]}),e.showInlineLabelEditor!==!1&&r?(0,L.jsxs)(`form`,{className:`instance-label-edit-form`,onSubmit:e=>void h(e),onClick:d,children:[(0,L.jsx)(`input`,{className:`instance-label-input`,value:a,maxLength:120,"aria-label":`Rename ${m}`,onChange:e=>o(e.target.value)}),(0,L.jsx)(`button`,{className:`instance-label-save`,type:`submit`,disabled:s,children:`Save`}),(0,L.jsx)(`button`,{className:`instance-label-cancel`,type:`button`,disabled:s,onClick:()=>{o(e.instance.label||e.profile?.label||e.label),u(null),i(!1)},children:`Cancel`}),l&&(0,L.jsx)(`span`,{className:`instance-label-error`,children:l})]}):e.showInlineLabelEditor===!1?null:(0,L.jsx)(`button`,{className:`instance-label-edit-button`,type:`button`,"aria-label":`Rename ${m}`,title:`Rename`,onClick:t=>{d(t),o(e.instance.label||e.profile?.label||e.label),u(null),i(!0)},children:(0,L.jsxs)(`svg`,{viewBox:`0 0 24 24`,width:`13`,height:`13`,stroke:`currentColor`,strokeWidth:`2`,fill:`none`,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":`true`,children:[(0,L.jsx)(`path`,{d:`M12 20h9`}),(0,L.jsx)(`path`,{d:`M16.5 3.5a2.12 2.12 0 0 1 3 3L7 19l-4 1 1-4Z`})]})}),e.showSelectedActions!==!1&&(0,L.jsxs)(`div`,{className:`instance-actions`,children:[(0,L.jsx)(`button`,{type:`button`,onClick:t=>{d(t),e.onPreview(e.instance)},disabled:!e.instance.ok,children:`Preview`}),(0,L.jsx)(`button`,{type:`button`,className:`action-start`,onClick:t=>{d(t),e.onLifecycle(`start`,e.instance)},disabled:!t?.canStart||e.busy,title:t?.commandPreview?.join(` `),children:`Start`}),(0,L.jsx)(`button`,{type:`button`,onClick:t=>{d(t),e.onLifecycle(`perm`,e.instance)},disabled:!t?.canPerm||e.busy,title:`Register as persistent service`,children:`Perm`}),(0,L.jsx)(`button`,{type:`button`,onClick:t=>{d(t),e.onLifecycle(`restart`,e.instance)},disabled:!t?.canRestart||e.busy,children:`Restart`})]})]})}function Zt(e,t){return e.filter(e=>!t.has(e.port))}function Qt(e,t){let n=new Set,r=t==null?[]:e.filter(e=>e.port===t),i=Zt(e,n).filter(e=>e.favorite);i.forEach(e=>n.add(e.port));let a=new Map;for(let t of Zt(e,n)){if(!t.group)continue;let e=a.get(t.group)||[];e.push(t),a.set(t.group,e),n.add(t.port)}let o=Zt(e,n),s=o.filter(e=>e.status===`online`),c=o.filter(e=>[`timeout`,`error`,`unknown`].includes(e.status)),l=o.filter(e=>e.status===`offline`);return[{id:`active`,label:`Active`,instances:r},{id:`favorites`,label:`Pinned`,instances:i},...Array.from(a.entries()).map(([e,t])=>({id:`group-${e}`,label:e,instances:t})),{id:`running`,label:`Running`,instances:s},{id:`attention`,label:`Attention`,instances:c},{id:`offline`,label:`Offline`,instances:l}].filter(e=>e.instances.length>0)}function $t(e,t,n){return(0,L.jsx)(Xt,{instance:t,...n===void 0?{}:{profile:n},selected:e.selectedPort===t.port,busy:e.lifecycleBusyPort===t.port,transitioning:e.transitioningPort===t.port&&e.transitionAction||null,activityUnreadCount:e.activityUnreadByPort?.[t.port]||0,latestActivityTitle:e.latestTitleByPort?.[t.port]||null,agentBusy:e.busyPorts?.has(t.port)||!1,...e.showLatestActivityTitles===void 0?{}:{showLatestActivityTitle:e.showLatestActivityTitles},...e.showInlineLabelEditor===void 0?{}:{showInlineLabelEditor:e.showInlineLabelEditor},...e.showSidebarRuntimeLine===void 0?{}:{showRuntimeLine:e.showSidebarRuntimeLine},...e.showSelectedRowActions===void 0?{}:{showSelectedActions:e.showSelectedRowActions},label:e.getLabel(t),uptime:e.formatUptime(t.uptime),onSelect:e.onSelect,onPreview:e.onPreview,onMarkActivitySeen:e.onMarkActivitySeen,onInstanceLabelSave:e.onInstanceLabelSave,onLifecycle:e.onLifecycle},t.port)}function en(e,t,n=new Map){return Qt(t,e.selectedPort).map(t=>(0,L.jsxs)(`section`,{className:`instance-group`,"aria-label":`${t.label} instances`,children:[(0,L.jsxs)(`div`,{className:`instance-group-header`,children:[(0,L.jsx)(`span`,{children:t.label}),(0,L.jsx)(`strong`,{children:t.instances.length})]}),t.instances.map(t=>$t(e,t,t.profileId?n.get(t.profileId):void 0))]},t.id))}function tn(e){let t=Qt(e.instances,e.selectedPort),n=new Map((e.profiles||[]).map(e=>[e.profileId,e]));return t.length===0&&n.size===0?(0,L.jsx)(`section`,{className:`state`,children:`No matching instances found.`}):n.size>0?(0,L.jsx)(`div`,{className:`instance-groups profile-instance-groups is-profile-merged`,children:en(e,e.instances,n)}):(0,L.jsx)(`div`,{className:`instance-groups`,children:en(e,e.instances)})}function nn(e){let t=!e.error&&!e.loading&&e.instances.length===0&&!e.instances.some(e=>e.hidden),n=e.selectedInstance&&!e.filtered.some(t=>t.port===e.selectedInstance?.port)?[e.selectedInstance,...e.filtered]:e.filtered;return(0,L.jsxs)(L.Fragment,{children:[e.error&&(0,L.jsxs)(`section`,{className:`state error-state`,children:[`Scan failed: `,e.error]}),!e.error&&e.loading&&(0,L.jsx)(`section`,{className:`state`,children:`Scanning local Jaw instances...`}),t&&e.data?.manager&&(0,L.jsx)(Gt,{rangeFrom:e.data.manager.rangeFrom,rangeTo:e.data.manager.rangeTo}),!e.error&&!t&&(0,L.jsx)(tn,{instances:n,selectedPort:e.selectedInstance?.port||null,lifecycleBusyPort:e.lifecycleBusyPort,transitioningPort:e.transitioningPort,transitionAction:e.transitionAction,activityUnreadByPort:e.activityUnreadByPort,latestTitleByPort:e.latestTitleByPort,...e.busyPorts===void 0?{}:{busyPorts:e.busyPorts},showLatestActivityTitles:e.showLatestActivityTitles,showInlineLabelEditor:e.showInlineLabelEditor,showSidebarRuntimeLine:e.showSidebarRuntimeLine,showSelectedRowActions:e.showSelectedRowActions,profiles:e.profiles,getLabel:e.getLabel,formatUptime:e.formatUptime,onSelect:e.onSelect,onPreview:e.onPreview,onMarkActivitySeen:e.onMarkActivitySeen,onInstanceLabelSave:e.onInstanceLabelSave,onLifecycle:e.onLifecycle})]})}function rn(e){let t=e.count==null?``:` ${e.count}`;return(0,L.jsxs)(`button`,{type:`button`,className:`profile-chip ${e.active?`is-active`:``}`,onClick:()=>e.onToggle(e.profile.profileId),"aria-pressed":e.active,title:e.profile.homePath,children:[(0,L.jsx)(`span`,{children:e.profile.label}),t&&(0,L.jsx)(`strong`,{children:t})]})}async function an(){let e=await fetch(`/api/dashboard/desktop-status`);if(!e.ok)throw Error(`desktop status failed: ${e.status}`);return await e.json()}function on(){let e=window.location.pathname+window.location.search;window.location.href=`jaw://open?path=${encodeURIComponent(e)}`}function sn(){let e=k(),[t,n]=(0,I.useState)(null),[r,i]=(0,I.useState)(!1);return(0,I.useEffect)(()=>{if(e)return;let t=!1;return an().then(e=>{t||n(e)}).catch(()=>{t||i(!0)}),()=>{t=!0}},[e]),e?null:t?.inDesktop?(0,L.jsx)(`span`,{className:`desktop-status-badge`,title:`cli-jaw Desktop ${t.version}`,children:`Running in cli-jaw Desktop`}):!t&&!r?null:(0,L.jsx)(`button`,{type:`button`,className:`desktop-open-button`,onClick:on,title:t?.downloadUrl||`Open this dashboard path in cli-jaw Desktop`,children:`Open in Desktop App`})}function cn(e){return(0,L.jsx)(`div`,{className:`command-center command-bar${k()?` is-electron-titlebar`:``}`,children:(0,L.jsxs)(`div`,{className:`command-primary`,children:[e.mobileMenuButton,(0,L.jsx)(`div`,{className:`command-title`,children:e.title}),(0,L.jsx)(`div`,{className:`command-search`,children:e.search}),(0,L.jsx)(`div`,{className:`command-actions`,children:e.actions})]})})}var ln=null,un={register(e){return ln=e,()=>{ln===e&&(ln=null)}},dispatch(e){return ln?.(e)??!1}},dn=[`folder`,`doc`,`diff`,`browser`],fn=[`terminal`,`browser`,`logs`,`activity`],pn=1200,mn=.3,hn=.7;function gn(e){return typeof e!=`number`||!Number.isFinite(e)?360:Math.min(pn,Math.max(260,Math.round(e)))}function _n(e){return typeof e!=`number`||!Number.isFinite(e)?320:Math.min(520,Math.max(180,Math.round(e)))}function vn(e){return typeof e!=`number`||!Number.isFinite(e)?.5:Math.min(hn,Math.max(mn,e))}function yn(e){let t={...e};return t.width=gn(t.width),t.splitRatio=vn(t.splitRatio),t.topMode!==null&&!dn.includes(t.topMode)&&(t.topMode=null),t.bottomMode!==null&&!dn.includes(t.bottomMode)&&(t.bottomMode=null),t.topMode===null&&t.bottomMode!==null&&(t.topMode=t.bottomMode,t.bottomMode=null),t.topMode!==null&&t.topMode===t.bottomMode&&(t.bottomMode=null),t.topMode===null&&t.bottomMode===null&&(t.open=!1),t}function bn(e,t){switch(t.type){case`SET_RIGHT_OPEN`:return{...e,rightPanel:{...e.rightPanel,open:t.open}};case`SET_RIGHT_WIDTH`:return{...e,rightPanel:{...e.rightPanel,width:gn(t.width)}};case`SET_RIGHT_TOP_MODE`:return{...e,rightPanel:{...e.rightPanel,topMode:t.mode}};case`SET_RIGHT_BOTTOM_MODE`:return{...e,rightPanel:{...e.rightPanel,bottomMode:t.mode}};case`SET_RIGHT_SPLIT_RATIO`:return{...e,rightPanel:{...e.rightPanel,splitRatio:vn(t.ratio)}};case`OPEN_RIGHT_PANEL`:{let n=e.rightPanel,r=t.slot??(n.topMode===null?`top`:`bottom`);return{...e,rightPanel:yn({...n,open:!0,[r===`top`?`topMode`:`bottomMode`]:t.mode})}}case`CLOSE_RIGHT_SUB`:{let n={...e.rightPanel,[t.slot===`top`?`topMode`:`bottomMode`]:null};return n.topMode===null&&n.bottomMode!==null&&(n.topMode=n.bottomMode,n.bottomMode=null),n.topMode===null&&n.bottomMode===null&&(n.open=!1),{...e,rightPanel:n}}case`SOLO_RIGHT_SUB`:{let n=e.rightPanel,r=t.slot===`top`?n.topMode:n.bottomMode;return r===null?e:{...e,rightPanel:{...n,open:!0,topMode:r,bottomMode:null,splitRatio:.5}}}case`SET_BOTTOM_OPEN`:return{...e,bottomPanel:{...e.bottomPanel,open:t.open}};case`SET_BOTTOM_HEIGHT`:return{...e,bottomPanel:{...e.bottomPanel,height:_n(t.height)}};case`OPEN_BOTTOM_TAB`:{let n=e.bottomPanel,r=n.tabs.includes(t.tab)?n.tabs:[...n.tabs,t.tab];return{...e,bottomPanel:{...n,open:!0,tabs:r,activeTab:t.tab}}}case`CLOSE_BOTTOM_TAB`:{let n=e.bottomPanel,r=n.tabs.filter(e=>e!==t.tab),i=n.activeTab===t.tab?r[0]??null:n.activeTab,a=r.length>0;return{...e,bottomPanel:{...n,tabs:r,activeTab:i,open:a}}}case`SET_BOTTOM_ACTIVE_TAB`:return{...e,bottomPanel:{...e.bottomPanel,activeTab:t.tab}};case`HYDRATE`:{let n=t.state,r=yn({...e.rightPanel,...n.rightPanel}),i={...e.bottomPanel,...n.bottomPanel};return i.height=_n(i.height),i.tabs=(i.tabs??[]).filter(e=>fn.includes(e)),i.activeTab!==null&&!i.tabs.includes(i.activeTab)&&(i.activeTab=i.tabs[0]??null),{rightPanel:r,bottomPanel:i}}default:return e}}var xn={rightPanel:{open:!1,width:360,topMode:null,bottomMode:null,splitRatio:.5},bottomPanel:{open:!1,height:320,tabs:[],activeTab:null}},Sn=(0,I.createContext)(null);function Cn(e){let[t,n]=(0,I.useReducer)(bn,xn),r=(0,I.useRef)(!1);(0,I.useEffect)(()=>{!e.initialPanelState||r.current||(r.current=!0,n({type:`HYDRATE`,state:e.initialPanelState}))},[e.initialPanelState]);let i=(0,I.useRef)(e.onStateChange);i.current=e.onStateChange,(0,I.useEffect)(()=>{if(!i.current)return;let e=setTimeout(()=>i.current?.(t),300);return()=>clearTimeout(e)},[t]);let a=t.rightPanel.open&&(t.rightPanel.topMode!==null||t.rightPanel.bottomMode!==null),o=t.rightPanel.topMode!==null&&t.rightPanel.bottomMode!==null;(0,I.useEffect)(()=>un.register(e=>{switch(e){case`toggleBottomPanel`:return t.bottomPanel.open?n({type:`SET_BOTTOM_OPEN`,open:!1}):n({type:`OPEN_BOTTOM_TAB`,tab:`terminal`}),!0;case`toggleRightPanel`:return t.rightPanel.open&&(t.rightPanel.topMode!==null||t.rightPanel.bottomMode!==null)?n({type:`SET_RIGHT_OPEN`,open:!1}):n({type:`OPEN_RIGHT_PANEL`,mode:`folder`,slot:`top`}),!0;case`focusTerminal`:return n({type:`OPEN_BOTTOM_TAB`,tab:`terminal`}),!0;case`openDiff`:return n({type:`OPEN_RIGHT_PANEL`,mode:`diff`}),!0;case`openFolderTree`:return n({type:`OPEN_RIGHT_PANEL`,mode:`folder`}),!0;default:return!1}}),[t.bottomPanel.open,t.rightPanel.open]);let s=(0,I.useMemo)(()=>({state:t,dispatch:n,effectiveRightOpen:a,rightPanelSplit:o}),[t,a,o]);return(0,L.jsx)(Sn.Provider,{value:s,children:e.children})}function wn(){let e=(0,I.useContext)(Sn);if(!e)throw Error(`usePanelLayout must be used within PanelLayoutProvider`);return e}function Tn(){let{dispatch:e,state:t}=wn();return(0,I.useMemo)(()=>({openRightPanel:(t,n)=>e({type:`OPEN_RIGHT_PANEL`,mode:t,slot:n}),closeRightSub:t=>e({type:`CLOSE_RIGHT_SUB`,slot:t}),soloRightSub:t=>e({type:`SOLO_RIGHT_SUB`,slot:t}),setRightWidth:t=>e({type:`SET_RIGHT_WIDTH`,width:t}),setRightSplitRatio:t=>e({type:`SET_RIGHT_SPLIT_RATIO`,ratio:t}),toggleRightPanel:()=>t.rightPanel.open&&(t.rightPanel.topMode!==null||t.rightPanel.bottomMode!==null)?e({type:`SET_RIGHT_OPEN`,open:!1}):e({type:`OPEN_RIGHT_PANEL`,mode:`folder`,slot:`top`}),openBottomTab:t=>e({type:`OPEN_BOTTOM_TAB`,tab:t}),closeBottomTab:t=>e({type:`CLOSE_BOTTOM_TAB`,tab:t}),setBottomActiveTab:t=>e({type:`SET_BOTTOM_ACTIVE_TAB`,tab:t}),setBottomHeight:t=>e({type:`SET_BOTTOM_HEIGHT`,height:t}),toggleBottomPanel:()=>t.bottomPanel.open?e({type:`SET_BOTTOM_OPEN`,open:!1}):e({type:`OPEN_BOTTOM_TAB`,tab:`terminal`}),hydrate:t=>e({type:`HYDRATE`,state:t})}),[e,t.rightPanel.open,t.bottomPanel.open])}function En(e,t,n){return{feature:e,state:t,...n?{reason:n}:{}}}function Dn(){return k()?`electron`:`web`}function On(e){return e===`electron`?{terminal:En(`terminal`,`enabled`),browser:En(`browser`,`enabled`),folder:En(`folder`,`enabled`),doc:En(`doc`,`enabled`),diff:En(`diff`,`enabled`)}:{terminal:En(`terminal`,`disabled`,`Terminal requires the desktop PTY bridge.`),browser:En(`browser`,`disabled`,`Browser side panel is available in the desktop app.`),folder:En(`folder`,`disabled`,`Folder side panel is available in the desktop app; use the Jawsidian Notes tab on web.`),doc:En(`doc`,`disabled`,`Document side panel is available in the desktop app; use the Jawsidian document tab on web.`),diff:En(`diff`,`disabled`,`Diff side panel is available in the desktop app.`)}}function kn(e){return e.state===`enabled`||e.state===`limited`}function An(){return(0,L.jsxs)(`svg`,{viewBox:`0 0 20 20`,width:`16`,height:`16`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.6`,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":`true`,focusable:`false`,children:[(0,L.jsx)(`rect`,{x:`3`,y:`4`,width:`14`,height:`12`,rx:`1.5`}),(0,L.jsx)(`path`,{d:`M6 9l3 2-3 2`}),(0,L.jsx)(`path`,{d:`M11 13h3`})]})}function jn(){return(0,L.jsxs)(`svg`,{viewBox:`0 0 20 20`,width:`16`,height:`16`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.6`,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":`true`,focusable:`false`,children:[(0,L.jsx)(`rect`,{x:`3`,y:`4`,width:`14`,height:`12`,rx:`1.5`}),(0,L.jsx)(`path`,{d:`M13 4v12`})]})}function Mn(){let e=wn(),t=Tn(),n=Dn();if(n!==`electron`)return null;let r=On(n),i=r.terminal,a=r.folder,o=kn(i),s=kn(a),c=e.state.bottomPanel.open,l=e.effectiveRightOpen;return(0,L.jsxs)(`div`,{className:`command-panel-controls`,"aria-label":`Desktop panels`,children:[(0,L.jsx)(`button`,{className:`command-panel-toggle${c?` is-active`:``}`,type:`button`,disabled:!o,onClick:()=>{o&&(c?t.toggleBottomPanel():t.openBottomTab(`terminal`))},"aria-label":`Toggle terminal panel`,"aria-pressed":c,title:i.reason??"Terminal (Ctrl+Shift+`)",children:(0,L.jsx)(An,{})}),(0,L.jsx)(`button`,{className:`command-panel-toggle${l?` is-active`:``}`,type:`button`,disabled:!s,onClick:()=>{s&&(l?t.toggleRightPanel():t.openRightPanel(`folder`))},"aria-label":`Toggle right panel`,"aria-pressed":l,title:a.reason??`Side panel (Command+B)`,children:(0,L.jsx)(jn,{})})]})}var Nn=[{value:`auto`,label:`Auto`,hint:`Follow OS preference`},{value:`light`,label:`Light`,hint:`Always light theme`},{value:`dark`,label:`Dark`,hint:`Always dark theme`}];function Pn(e){return(0,L.jsx)(`div`,{className:`theme-switch`,role:`radiogroup`,"aria-label":`Theme`,children:Nn.map(t=>{let n=e.theme===t.value;return(0,L.jsx)(`button`,{type:`button`,role:`radio`,"aria-checked":n,title:t.hint,className:n?`is-active`:``,onClick:()=>e.onChange(t.value),children:t.label},t.value)})})}function Fn(e){return(0,L.jsx)(cn,{mobileMenuButton:(0,L.jsx)(`button`,{className:`drawer-trigger`,type:`button`,onClick:e.onOpenDrawer,"aria-label":`Open sidebar`,children:`☰`}),title:(0,L.jsxs)(`h1`,{className:`manager-brand-heading`,"aria-label":`CLI-JAW Dashboard`,children:[(0,L.jsx)(`span`,{className:`manager-brand-wordmark`,children:`CLI-JAW`}),(0,L.jsx)(`span`,{className:`manager-brand-dash`,children:`DASH`})]}),search:(0,L.jsxs)(`div`,{className:`search-input-wrapper`,children:[(0,L.jsxs)(`svg`,{viewBox:`0 0 24 24`,width:`14`,height:`14`,stroke:`currentColor`,strokeWidth:`2`,fill:`none`,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":`true`,children:[(0,L.jsx)(`circle`,{cx:`11`,cy:`11`,r:`8`}),(0,L.jsx)(`line`,{x1:`21`,y1:`21`,x2:`16.65`,y2:`16.65`})]}),(0,L.jsx)(`input`,{value:e.query,onChange:t=>e.onQueryChange(t.target.value),placeholder:`Search port, home, CLI, model`,"aria-label":`Search instances`})]}),actions:(0,L.jsxs)(`div`,{className:`command-actions-group`,children:[(0,L.jsx)(Mn,{}),(0,L.jsx)(sn,{}),(0,L.jsx)(`button`,{type:`button`,className:`command-palette-trigger`,onClick:e.onOpenPalette,"aria-label":`Open command palette`,title:`Open command palette (⌘K / Ctrl+K)`,children:(0,L.jsx)(`span`,{"aria-hidden":`true`,children:`⌘K`})}),(0,L.jsx)(Pn,{theme:e.theme,onChange:e.onThemeChange}),(0,L.jsx)(`button`,{type:`button`,onClick:e.onRefresh,disabled:e.loading,children:e.loading?`Scanning`:`Refresh`})]})})}var In=8,Ln=5;function Rn(e,t,n){if(!n)return!0;let r=n.toLowerCase();return[String(e.port),t,e.url,e.workingDir,e.currentCli].some(e=>{if(!e)return!1;let t=String(e).toLowerCase();return t.startsWith(r)?!0:RegExp(`(^|[^\\p{L}\\p{N}])${zn(r)}`,`u`).test(t)})}function zn(e){return e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}function Bn(e){let[t,n]=(0,I.useState)(``),[r,i]=(0,I.useState)(0),a=(0,I.useRef)(null),o=(0,I.useRef)(null);(0,I.useEffect)(()=>{e.open&&(n(``),i(0),requestAnimationFrame(()=>a.current?.focus()))},[e.open]),(0,I.useEffect)(()=>{if(!e.open)return;function t(t){t.key===`Escape`&&(t.preventDefault(),e.onClose())}return document.addEventListener(`keydown`,t),()=>document.removeEventListener(`keydown`,t)},[e.open,e.onClose]);let s=(0,I.useMemo)(()=>e.instances.filter(n=>Rn(n,e.getLabel(n),t)).slice(0,In),[e.instances,e.getLabel,t]),c=(0,I.useMemo)(()=>[{id:`refresh`,label:`Refresh scan`,hint:`Re-scan local ports`,run:e.onRefresh},{id:`theme`,label:`Theme: cycle (current ${e.theme})`,hint:`Auto → Light → Dark`,run:e.onCycleTheme},{id:`hidden`,label:e.showHidden?`Hide hidden instances`:`Show hidden instances`,run:e.onToggleHidden},...e.selectedInstance?[{id:`open`,label:`Open ${e.selectedInstance.url} in new tab`,run:e.onOpenSelected}]:[]].slice(0,Ln),[e.onRefresh,e.theme,e.onCycleTheme,e.showHidden,e.onToggleHidden,e.selectedInstance,e.onOpenSelected]),l=(0,I.useMemo)(()=>{let e=[];for(let t of s)e.push({kind:`instance`,instance:t});for(let t of c)e.push({kind:`action`,action:t});return e},[s,c]);(0,I.useEffect)(()=>{r>=l.length&&i(Math.max(0,l.length-1))},[l.length,r]);function u(t){let n=l[t];n&&(n.kind===`instance`?e.onSelectInstance(n.instance):n.action.run(),e.onClose())}function d(e){e.key===`ArrowDown`?(e.preventDefault(),i(e=>Math.min(l.length-1,e+1))):e.key===`ArrowUp`?(e.preventDefault(),i(e=>Math.max(0,e-1))):e.key===`Enter`&&(e.preventDefault(),u(r))}return e.open?(0,L.jsx)(`div`,{className:`command-palette-backdrop`,role:`presentation`,onClick:e.onClose,children:(0,L.jsxs)(`div`,{className:`command-palette`,role:`dialog`,"aria-modal":`true`,"aria-label":`Command palette`,onClick:e=>e.stopPropagation(),children:[(0,L.jsx)(`input`,{ref:a,className:`command-palette-input`,placeholder:`Go to instance, or run an action…`,value:t,onChange:e=>{n(e.target.value),i(0)},onKeyDown:d,"aria-label":`Command query`}),(0,L.jsxs)(`div`,{className:`command-palette-list`,ref:o,children:[s.length>0&&(0,L.jsxs)(`div`,{className:`command-palette-section`,role:`group`,"aria-label":`Go to instance`,children:[(0,L.jsx)(`header`,{className:`command-palette-section-header`,children:`Go to instance`}),s.map((t,n)=>{let a=n;return(0,L.jsxs)(`button`,{type:`button`,className:a===r?`command-palette-item is-active`:`command-palette-item`,onMouseEnter:()=>i(a),onClick:()=>u(a),children:[(0,L.jsxs)(`span`,{className:`command-palette-port`,children:[`:`,t.port]}),(0,L.jsx)(`span`,{className:`command-palette-label`,children:e.getLabel(t)})]},t.port)})]}),c.length>0&&(0,L.jsxs)(`div`,{className:`command-palette-section`,role:`group`,"aria-label":`Actions`,children:[(0,L.jsx)(`header`,{className:`command-palette-section-header`,children:`Actions`}),c.map((e,t)=>{let n=s.length+t;return(0,L.jsxs)(`button`,{type:`button`,className:n===r?`command-palette-item is-active`:`command-palette-item`,onMouseEnter:()=>i(n),onClick:()=>u(n),children:[(0,L.jsx)(`span`,{className:`command-palette-label`,children:e.label}),e.hint&&(0,L.jsx)(`span`,{className:`command-palette-hint`,children:e.hint})]},e.id)})]}),l.length===0&&(0,L.jsx)(`p`,{className:`command-palette-empty`,children:`No matches.`})]}),(0,L.jsxs)(`footer`,{className:`command-palette-footer`,children:[(0,L.jsxs)(`span`,{children:[(0,L.jsx)(`kbd`,{children:`↑↓`}),` navigate`]}),(0,L.jsxs)(`span`,{children:[(0,L.jsx)(`kbd`,{children:`Enter`}),` select`]}),(0,L.jsxs)(`span`,{children:[(0,L.jsx)(`kbd`,{children:`Esc`}),` close`]})]})]})}):null}function Vn(e){let t={"--activity-dock-height":`${e.activityHeight}px`};return(0,L.jsxs)(`main`,{className:`dashboard-shell manager-shell${e.sidebarCollapsed?` is-sidebar-collapsed`:``}`,style:t,children:[(0,L.jsx)(`header`,{className:`manager-command`,children:e.commandBar}),e.workspace]})}var Hn=[`focusInstances`,`focusActiveSession`,`focusNotes`,`previousInstance`,`nextInstance`,`toggleBottomPanel`,`toggleRightPanel`,`focusTerminal`,`openDiff`,`openFolderTree`],Un={focusInstances:`Alt+I`,focusActiveSession:`Alt+P`,focusNotes:`Alt+N`,previousInstance:`Alt+K`,nextInstance:`Alt+J`,toggleBottomPanel:`Meta+J`,toggleRightPanel:`Meta+B`,focusTerminal:"Ctrl+Shift+`",openDiff:`Meta+Shift+D`,openFolderTree:`Meta+Shift+E`},Wn={toggleRightPanel:[`Meta+B`,`Meta+Shift+B`],focusTerminal:["Ctrl+Shift+`","Meta+`"]};function Gn(e){let t=e.trim().toLowerCase();return t?t===`space`?` `:t.length===1?t:t===`arrowup`?`arrowup`:t===`arrowdown`?`arrowdown`:t===`arrowleft`?`arrowleft`:t===`arrowright`?`arrowright`:t:``}function Kn(e){let t=e.split(`+`).map(e=>e.trim()).filter(Boolean);if(t.length===0)return null;let n={key:``,altKey:!1,ctrlKey:!1,metaKey:!1,shiftKey:!1};for(let e of t){let t=e.toLowerCase();t===`alt`||t===`option`?n.altKey=!0:t===`ctrl`||t===`control`?n.ctrlKey=!0:t===`meta`||t===`cmd`||t===`command`?n.metaKey=!0:t===`shift`?n.shiftKey=!0:n.key=Gn(e)}return n.key?n:null}function qn(e){let t=e&&typeof e==`object`?e:{},n={...Un};for(let e of Hn){let r=t[e];n[e]=typeof r==`string`&&r.trim()?r:Un[e]}return n}function Jn(e){if(e.code===`Backquote`)return"`";let t=Gn(e.key);return t.length===1?t:e.altKey&&e.code?.startsWith(`Key`)?e.code.slice(3).toLowerCase():t}function Yn(e,t){let n=Kn(t);return n?e.altKey===n.altKey&&e.ctrlKey===n.ctrlKey&&e.metaKey===n.metaKey&&e.shiftKey===n.shiftKey&&Jn(e)===n.key:!1}function Xn(e,t){let n=qn(t);for(let t of Hn)if(Yn(e,n[t])||Wn[t]?.some(t=>Yn(e,t)))return t;return null}function Zn(e){return e.split(`+`).map(e=>e.trim()).filter(Boolean).join(` + `)}function Qn(e){if(!(e instanceof HTMLElement))return!1;if(e.isContentEditable)return!0;let t=e.tagName.toLowerCase();return t===`input`||t===`textarea`||t===`select`?!0:!!e.closest(`[contenteditable="true"], .cm-editor, .ProseMirror, [data-milkdown-root]`)}var $n=(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(`p`,{className:`help-lead`,children:`실행 중인 jaw 인스턴스를 보고, 미리보기·로그·설정을 다루는 곳이에요.`}),(0,L.jsxs)(`ul`,{className:`help-bullets`,children:[(0,L.jsx)(`li`,{children:`좌측 네비게이터에서 인스턴스를 골라 우측 Workbench(Overview / Preview / Logs / Settings)에서 작업하실 수 있어요.`}),(0,L.jsx)(`li`,{children:`우측 상단 상태 점이 초록이면 온라인, 회색이면 오프라인이에요.`}),(0,L.jsx)(`li`,{children:`인스턴스에 직접 메시지를 보내실 땐 Preview 탭의 채팅 입력을 쓰세요.`}),(0,L.jsx)(`li`,{children:`Preview 채팅에 나온 Notes vault 경로를 클릭하면 Notes workspace로 이동해 해당 파일을 열 수 있어요.`})]}),(0,L.jsxs)(`div`,{className:`help-deep`,children:[(0,L.jsx)(`h4`,{children:`빠른 판단 기준`}),(0,L.jsx)(`table`,{className:`help-table`,children:(0,L.jsxs)(`tbody`,{children:[(0,L.jsxs)(`tr`,{children:[(0,L.jsx)(`th`,{children:`Preview`}),(0,L.jsx)(`td`,{children:`실제 인스턴스 화면을 보거나 메시지를 보낼 때`})]}),(0,L.jsxs)(`tr`,{children:[(0,L.jsx)(`th`,{children:`Logs`}),(0,L.jsx)(`td`,{children:`응답이 멈췄거나 dispatch 실패 원인을 확인할 때`})]}),(0,L.jsxs)(`tr`,{children:[(0,L.jsx)(`th`,{children:`Settings`}),(0,L.jsx)(`td`,{children:`해당 인스턴스의 CLI, 모델, 권한을 조정할 때`})]})]})})]}),(0,L.jsxs)(`p`,{className:`help-tip`,children:[`인스턴스가 안 보이시면 터미널에서 `,(0,L.jsx)(`code`,{children:`cli-jaw start`}),`로 새 jaw를 띄워보세요. 자동으로 목록에 떠요.`]})]}),er=(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(`p`,{className:`help-lead`,children:`사람이 먼저 일반 칸반 블럭을 만들고, 실행 인스턴스 블럭을 그 안에 붙이는 계층형 보드예요.`}),(0,L.jsxs)(`ul`,{className:`help-bullets`,children:[(0,L.jsxs)(`li`,{children:[`레인 5개는 `,(0,L.jsx)(`strong`,{children:`Backlog / Ready / In Progress / Review / Done`}),` 순서예요. Backlog는 아직 commit 전 옵션, Ready는 바로 pull 가능한 작업이에요.`]}),(0,L.jsxs)(`li`,{children:[(0,L.jsx)(`strong`,{children:`Overall`}),`은 5열 전체 보드이고, 사이드바에서 각 레인을 누르면 해당 레인만 보는 detail 화면으로 전환돼요.`]}),(0,L.jsxs)(`li`,{children:[(0,L.jsx)(`strong`,{children:`Done`}),`은 Overall에서 최근 4개만 full card로 보여주고, 나머지는 `,(0,L.jsx)(`strong`,{children:`+ N more`}),`를 눌러 Done detail 화면에서 2줄 row로 확인해요.`]}),(0,L.jsxs)(`li`,{children:[`각 레인 하단의 `,(0,L.jsx)(`strong`,{children:`+ Add task`}),`로 일반 칸반 블럭을 만들고, 그 블럭 제목에 쿼리나 작업 메모를 적으시면 돼요.`]}),(0,L.jsxs)(`li`,{children:[`좌측 `,(0,L.jsx)(`strong`,{children:`Running`}),` 섹션에는 현재 실행 중인 인스턴스만 인스턴스 블럭으로 보여요.`]}),(0,L.jsx)(`li`,{children:`인스턴스 블럭을 일반 칸반 블럭 안의 드롭 영역으로 끌어 넣으면 내부 자식 블럭으로 병합돼요. 인스턴스 실행에는 영향 없어요.`}),(0,L.jsxs)(`li`,{children:[`일반 칸반 블럭은 직접 드래그해서 다른 레인으로 옮길 수 있고, `,(0,L.jsx)(`strong`,{children:`Move`}),` / `,(0,L.jsx)(`strong`,{children:`Delete`}),`도 유지돼요.`]})]}),(0,L.jsxs)(`div`,{className:`help-deep`,children:[(0,L.jsx)(`h4`,{children:`상태를 나눠 쓰는 법`}),(0,L.jsx)(`table`,{className:`help-table`,children:(0,L.jsxs)(`tbody`,{children:[(0,L.jsxs)(`tr`,{children:[(0,L.jsx)(`th`,{children:`Ready`}),(0,L.jsx)(`td`,{children:`바로 구현하거나 검증할 수 있는 작업`})]}),(0,L.jsxs)(`tr`,{children:[(0,L.jsx)(`th`,{children:`Review`}),(0,L.jsx)(`td`,{children:`직원 감사, Pro 검증, 수동 smoke가 필요한 작업`})]}),(0,L.jsxs)(`tr`,{children:[(0,L.jsx)(`th`,{children:`Done`}),(0,L.jsx)(`td`,{children:`커밋, 푸시, 이슈 close까지 끝난 작업`})]})]})})]}),(0,L.jsx)(`p`,{className:`help-tip`,children:`인스턴스가 없어도 일반 칸반 블럭은 계속 남아요. 쿼리·아이디어·작업 단위를 먼저 적고, 필요할 때만 실행 인스턴스를 붙이면 돼요.`})]}),tr=(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(`p`,{className:`help-lead`,children:`매니저가 1분마다 틱을 돌면서 대시보드에 등록된 자동화 작업을 일괄 dispatch 해주는 곳이에요.`}),(0,L.jsxs)(`ul`,{className:`help-bullets`,children:[(0,L.jsxs)(`li`,{children:[(0,L.jsx)(`strong`,{children:`Today / Upcoming / Recurring / Blocked`}),` 그룹으로 정리되고, `,(0,L.jsx)(`code`,{children:`cron`}),`·`,(0,L.jsx)(`code`,{children:`runAt`}),`·target port를 함께 저장해요.`]}),(0,L.jsx)(`li`,{children:`Run 버튼으로 즉시 dispatch, 대상 인스턴스가 바쁘면 자동 큐잉이에요. last/next 컬럼으로 실행 이력이 보여요.`}),(0,L.jsxs)(`li`,{children:[`예전엔 인스턴스마다 자기 `,(0,L.jsx)(`code`,{children:`heartbeat.json`}),`을 setInterval로 돌리던 구조였는데, 지금은 `,(0,L.jsx)(`strong`,{children:`매니저가 단일 ticker`}),`로 돌려요. heartbeat.json은 legacy로만 표시되고 자동 실행은 안 돼요.`]})]}),(0,L.jsxs)(`div`,{className:`help-deep`,children:[(0,L.jsx)(`h4`,{children:`실패를 볼 때`}),(0,L.jsx)(`table`,{className:`help-table`,children:(0,L.jsxs)(`tbody`,{children:[(0,L.jsxs)(`tr`,{children:[(0,L.jsx)(`th`,{children:`queued`}),(0,L.jsx)(`td`,{children:`대상 인스턴스가 바빠서 대기 중`})]}),(0,L.jsxs)(`tr`,{children:[(0,L.jsx)(`th`,{children:`blocked`}),(0,L.jsx)(`td`,{children:`비활성화했거나 실행 조건이 아직 맞지 않음`})]}),(0,L.jsxs)(`tr`,{children:[(0,L.jsx)(`th`,{children:`last/next`}),(0,L.jsx)(`td`,{children:`최근 실행 결과와 다음 실행 예측을 확인하는 기준`})]})]})})]}),(0,L.jsx)(`p`,{className:`help-tip`,children:`새 작업은 여기서 만들고, 기존 heartbeat job은 같은 cron으로 옮겨 등록하시면 돼요. 마이그레이션 자동화는 추후 추가됩니다.`})]}),nr=(0,L.jsxs)(L.Fragment,{children:[(0,L.jsxs)(`p`,{className:`help-lead`,children:[(0,L.jsx)(`code`,{children:`~/.cli-jaw-dashboard/notes/`}),`의 마크다운 파일을 직접 편집하는 노트장이에요.`]}),(0,L.jsxs)(`ul`,{className:`help-bullets`,children:[(0,L.jsxs)(`li`,{children:[`좌측 트리에서 파일 선택, 우측에서 `,(0,L.jsx)(`strong`,{children:`Raw / Preview / WYSIWYG`}),` 모드로 편집하실 수 있어요.`]}),(0,L.jsxs)(`li`,{children:[`Instances Preview 채팅에서 vault 경로(예: `,(0,L.jsx)(`code`,{children:`~/.cli-jaw-dashboard/notes/foo.md`}),` 또는 `,(0,L.jsx)(`code`,{children:`daily/foo.md`}),`)를 `,(0,L.jsx)(`strong`,{children:`클릭`}),`하면 Notes 탭으로 이동하고 해당 파일이 열려요. 자동 전환은 없고 클릭할 때만 이동합니다.`]}),(0,L.jsxs)(`li`,{children:[`vault 밖 경로(예: 프로젝트 `,(0,L.jsx)(`code`,{children:`.ts`}),` 파일)는 기존처럼 Finder로 열려요.`]}),(0,L.jsxs)(`li`,{children:[(0,L.jsx)(`kbd`,{children:`⌘/Ctrl + S`}),`로 저장, `,(0,L.jsx)(`kbd`,{children:`⌘/Ctrl + E`}),`로 모드 순환 전환이에요.`]}),(0,L.jsx)(`li`,{children:`파일이 외부에서 바뀌면 충돌 알림이 떠요 — Reload / Overwrite / Keep local 중 선택하세요.`})]}),(0,L.jsxs)(`p`,{className:`help-tip`,children:[`💡 좌측 트리 상단 `,(0,L.jsx)(`strong`,{children:`+ New`}),`로 첫 노트를 만들어 보세요. 폴더는 `,(0,L.jsx)(`code`,{children:`folder/note.md`}),` 처럼 한 번에 만드실 수 있어요.`]})]}),rr=(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(`p`,{className:`help-lead`,children:`Jaw Reminders 스냅샷을 대시보드에서 읽고 확인하는 미러 화면이에요.`}),(0,L.jsxs)(`ul`,{className:`help-bullets`,children:[(0,L.jsxs)(`li`,{children:[(0,L.jsx)(`strong`,{children:`All / Focused / Scheduled / High / Done`}),` 보기로 현재 reminder 상태를 훑어볼 수 있어요.`]}),(0,L.jsx)(`li`,{children:`Refresh는 외부 Jaw Reminders 스냅샷을 다시 읽어서 대시보드용 row로 반영해요.`}),(0,L.jsx)(`li`,{children:`원본 reminder 저장소가 없거나 형식이 맞지 않아도 대시보드는 기존 미러 데이터를 유지하고 상태 메시지만 보여줘요.`})]}),(0,L.jsxs)(`div`,{className:`help-deep`,children:[(0,L.jsx)(`h4`,{children:`Matrix 보기`}),(0,L.jsx)(`table`,{className:`help-table`,children:(0,L.jsxs)(`tbody`,{children:[(0,L.jsxs)(`tr`,{children:[(0,L.jsx)(`th`,{children:`Top Priority`}),(0,L.jsx)(`td`,{children:`지금 먼저 처리할 3개를 따로 고정`})]}),(0,L.jsxs)(`tr`,{children:[(0,L.jsx)(`th`,{children:`Important`}),(0,L.jsx)(`td`,{children:`중요하지만 급하지 않은 장기 작업`})]}),(0,L.jsxs)(`tr`,{children:[(0,L.jsx)(`th`,{children:`Waiting`}),(0,L.jsx)(`td`,{children:`다른 사람, 직원, 외부 검증을 기다리는 작업`})]})]})})]}),(0,L.jsx)(`p`,{className:`help-tip`,children:`Reminders는 실험 기능이라 개발 모드 또는 실험 플래그가 켜진 빌드에서만 보여요.`})]}),ir=(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(`p`,{className:`help-lead`,children:`대시보드 외형과 동작 옵션을 조정하는 곳이에요.`}),(0,L.jsxs)(`ul`,{className:`help-bullets`,children:[(0,L.jsx)(`li`,{children:`사이드바 폭, 워드랩, 테마 같은 표시 옵션을 바꾸실 수 있어요.`}),(0,L.jsxs)(`li`,{children:[`인스턴스 자체 설정이 아니라 `,(0,L.jsx)(`strong`,{children:`이 대시보드 UI의 환경설정`}),`이에요.`]}),(0,L.jsx)(`li`,{children:`변경 사항은 즉시 저장돼요.`})]}),(0,L.jsxs)(`div`,{className:`help-deep`,children:[(0,L.jsx)(`h4`,{children:`설정 범위`}),(0,L.jsx)(`table`,{className:`help-table`,children:(0,L.jsxs)(`tbody`,{children:[(0,L.jsxs)(`tr`,{children:[(0,L.jsx)(`th`,{children:`Display`}),(0,L.jsx)(`td`,{children:`목록, 언어, 단축키 같은 dashboard UI 선호도`})]}),(0,L.jsxs)(`tr`,{children:[(0,L.jsx)(`th`,{children:`Activity`}),(0,L.jsx)(`td`,{children:`최근 작업 제목이 어떤 인스턴스에서 준비됐는지 확인`})]}),(0,L.jsxs)(`tr`,{children:[(0,L.jsx)(`th`,{children:`Instance settings`}),(0,L.jsx)(`td`,{children:`개별 인스턴스 동작은 Instances workspace에서 수정`})]})]})})]}),(0,L.jsxs)(`p`,{className:`help-tip`,children:[`인스턴스 동작을 바꾸시려면 여기가 아니라 `,(0,L.jsx)(`strong`,{children:`Instances → 해당 인스턴스 → Settings 탭`}),`으로 가세요.`]})]}),ar=(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(`p`,{className:`help-lead`,children:`반복 작업을 줄이는 Manager 전역 단축키예요.`}),(0,L.jsxs)(`ul`,{className:`help-bullets`,children:[(0,L.jsxs)(`li`,{children:[(0,L.jsx)(`kbd`,{children:`?`}),`는 이 도움말을 열어요. 입력창, 노트 에디터, WYSIWYG 편집 중에는 글자 입력을 방해하지 않아요.`]}),(0,L.jsxs)(`li`,{children:[(0,L.jsx)(`kbd`,{children:Zn(Un.focusInstances)}),`는 Instances workspace로 이동해요.`]}),(0,L.jsxs)(`li`,{children:[(0,L.jsx)(`kbd`,{children:Zn(Un.focusActiveSession)}),`는 선택된 인스턴스의 Preview 탭으로 이동해요.`]}),(0,L.jsxs)(`li`,{children:[(0,L.jsx)(`kbd`,{children:Zn(Un.focusNotes)}),`는 Notes workspace로 이동해요.`]}),(0,L.jsxs)(`li`,{children:[(0,L.jsx)(`kbd`,{children:Zn(Un.previousInstance)}),` / `,(0,L.jsx)(`kbd`,{children:Zn(Un.nextInstance)}),`는 현재 필터된 인스턴스 목록에서 이전/다음 행을 선택해요.`]}),(0,L.jsxs)(`li`,{children:[(0,L.jsx)(`kbd`,{children:`⌘/Ctrl + S`}),`는 Notes와 Settings처럼 저장 가능한 화면에서 현재 편집 내용을 저장해요.`]}),(0,L.jsxs)(`li`,{children:[(0,L.jsx)(`kbd`,{children:`⌘/Ctrl + E`}),`는 Notes 편집 모드를 순환해요.`]}),(0,L.jsx)(`li`,{children:`Manager 단축키는 Dashboard settings에서 켜고 끄거나 keymap을 바꿀 수 있어요.`}),(0,L.jsx)(`li`,{children:`Preview 탭을 보는 동안 새 activity는 읽음으로 처리되고, 다른 탭에 있을 때는 Activity Dock에 쌓여요.`})]}),(0,L.jsxs)(`div`,{className:`help-deep`,children:[(0,L.jsx)(`h4`,{children:`충돌이 날 때`}),(0,L.jsx)(`table`,{className:`help-table`,children:(0,L.jsxs)(`tbody`,{children:[(0,L.jsxs)(`tr`,{children:[(0,L.jsx)(`th`,{children:`입력 중`}),(0,L.jsx)(`td`,{children:`글자 입력을 우선하고 전역 shortcut은 실행하지 않음`})]}),(0,L.jsxs)(`tr`,{children:[(0,L.jsx)(`th`,{children:`브라우저 충돌`}),(0,L.jsx)(`td`,{children:`Dashboard settings에서 keymap을 바꾸는 것이 안전함`})]}),(0,L.jsxs)(`tr`,{children:[(0,L.jsx)(`th`,{children:`도움말`}),(0,L.jsxs)(`td`,{children:[(0,L.jsx)(`kbd`,{children:`?`}),`는 현재 workspace 도움말과 shortcut 도움말의 진입점`]})]})]})})]}),(0,L.jsx)(`p`,{className:`help-tip`,children:`단축키는 브라우저 기본 단축키와 에디터 입력을 우선합니다.`})]}),or=(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(`p`,{className:`help-lead`,children:`jaw는 Boss가 직접 처리할지, Employee에게 보낼지 상황에 따라 나눠요.`}),(0,L.jsxs)(`ul`,{className:`help-bullets`,children:[(0,L.jsxs)(`li`,{children:[(0,L.jsx)(`strong`,{children:`Boss`}),`는 현재 대화의 주 작업자예요. 단일 파일 수정, 상태 확인, GitHub 정리는 보통 Boss가 직접 처리해요.`]}),(0,L.jsxs)(`li`,{children:[(0,L.jsx)(`strong`,{children:`Employee`}),`는 `,(0,L.jsx)(`code`,{children:`cli-jaw dispatch`}),`로 보내는 독립 작업자예요. Backend, Frontend, Docs 같은 역할별 검증에 씁니다.`]}),(0,L.jsxs)(`li`,{children:[(0,L.jsx)(`strong`,{children:`PABCD`}),`에서는 A phase가 plan audit, B phase가 read-only verification 중심이에요. 구현은 Boss가 직접 합니다.`]}),(0,L.jsxs)(`li`,{children:[(0,L.jsx)(`strong`,{children:`$computer-use`}),` 요청은 desktop-control 규칙을 따라 real desktop 또는 browser automation 경로로 라우팅돼요.`]})]}),(0,L.jsx)(`p`,{className:`help-tip`,children:`직원이 다른 repo로 착각하지 않도록 dispatch task에는 현재 repo 절대경로를 함께 넣는 게 원칙이에요.`})]}),sr=(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(`p`,{className:`help-lead`,children:`Process 상태는 인스턴스 실행과 Manager가 관리하는 preview/runtime 상태를 구분해서 봐야 해요.`}),(0,L.jsxs)(`ul`,{className:`help-bullets`,children:[(0,L.jsxs)(`li`,{children:[(0,L.jsx)(`strong`,{children:`online`}),`은 인스턴스 health check가 통과한 상태예요.`]}),(0,L.jsxs)(`li`,{children:[(0,L.jsx)(`strong`,{children:`offline / timeout / error`}),`는 프로세스가 없거나, 응답이 늦거나, health check가 실패한 상태예요.`]}),(0,L.jsxs)(`li`,{children:[(0,L.jsx)(`strong`,{children:`managed`}),`는 Manager가 띄우거나 복구 대상으로 추적하는 서버예요.`]}),(0,L.jsx)(`li`,{children:`탭 전환 후 Preview가 다시 붙을 수 있지만, 인스턴스의 실제 실행 여부는 health/status 쪽을 기준으로 보세요.`})]}),(0,L.jsx)(`p`,{className:`help-tip`,children:`Process UI가 비어 보이면 먼저 Refresh로 registry와 health 상태를 다시 읽어보세요.`})]}),cr=(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(`p`,{className:`help-lead`,children:`실행 상태를 바꾸는 버튼은 현재 선택한 인스턴스나 Manager-managed 프로세스에 영향을 줘요.`}),(0,L.jsxs)(`ul`,{className:`help-bullets`,children:[(0,L.jsxs)(`li`,{children:[(0,L.jsx)(`strong`,{children:`Stop`}),`은 대상 인스턴스를 중지해요. service-owned 인스턴스는 persistent service 제거까지 포함될 수 있어요.`]}),(0,L.jsxs)(`li`,{children:[(0,L.jsx)(`strong`,{children:`Restart`}),`는 새 실행으로 바뀌므로 uptime과 elapsed time 판단 기준이 다시 시작돼요.`]}),(0,L.jsxs)(`li`,{children:[(0,L.jsx)(`strong`,{children:`Stop all managed`}),`는 Manager가 추적 중인 서버들을 한 번에 중지해요. 외부에서 직접 띄운 프로세스는 대상으로 삼지 않아요.`]}),(0,L.jsxs)(`li`,{children:[(0,L.jsx)(`strong`,{children:`Adopt/recover`}),`는 남아 있는 managed process 기록을 다시 연결하려는 복구 작업이에요.`]})]}),(0,L.jsx)(`p`,{className:`help-tip`,children:`위험 작업은 가능한 한 확인창을 거치며, 진행 후 상태가 애매하면 Refresh로 실제 health를 확인하세요.`})]}),lr={instances:{title:`Instances`,subtitle:`인스턴스 운영`,body:$n},board:{title:`Board`,subtitle:`Cross-instance Kanban`,body:er},schedule:{title:`Schedule`,subtitle:`시간 기반 작업`,body:tr},reminders:{title:`Reminders`,subtitle:`Jaw Reminders mirror`,body:rr},notes:{title:`Notes`,subtitle:`마크다운 노트`,body:nr},settings:{title:`Settings`,subtitle:`대시보드 설정`,body:ir},shortcuts:{title:`Shortcuts`,subtitle:`전역 키보드 도움말`,body:ar},routing:{title:`Routing`,subtitle:`Boss / Employee 작업 흐름`,body:or},processLifecycle:{title:`Process lifecycle`,subtitle:`인스턴스와 managed process 상태`,body:sr},dangerousActions:{title:`Dangerous actions`,subtitle:`중지·재시작·복구 작업 영향`,body:cr}};function ur({open:e,topic:t,onClose:n}){let r=(0,I.useRef)(null);if((0,I.useEffect)(()=>{if(!e)return;let t=e=>{e.key===`Escape`&&n()};return document.addEventListener(`keydown`,t),r.current?.focus(),()=>document.removeEventListener(`keydown`,t)},[e,n]),!e)return null;let i=lr[t];return(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(`div`,{className:`help-drawer-overlay`,onClick:n,"aria-hidden":`true`}),(0,L.jsxs)(`aside`,{className:`help-drawer`,role:`dialog`,"aria-modal":`true`,"aria-label":`${i.title} help`,children:[(0,L.jsxs)(`header`,{className:`help-drawer-header`,children:[(0,L.jsxs)(`div`,{className:`help-drawer-title`,children:[(0,L.jsx)(`span`,{className:`help-drawer-eyebrow`,children:`현재 모드`}),(0,L.jsx)(`h3`,{children:i.title}),(0,L.jsx)(`span`,{className:`help-drawer-subtitle`,children:i.subtitle})]}),(0,L.jsx)(`button`,{ref:r,type:`button`,className:`help-drawer-close`,onClick:n,"aria-label":`Close help`,children:`×`})]}),(0,L.jsx)(`div`,{className:`help-drawer-body`,children:i.body}),(0,L.jsx)(`footer`,{className:`help-drawer-footer`,children:(0,L.jsx)(`span`,{children:`사이드바 도움말은 현재 모드를 따르고, ? 키는 단축키 도움말을 열어요.`})})]})]})}function dr(e){switch(e.kind){case`scan-completed`:return{at:e.at,source:`scan`,message:`range ${e.from}-${e.to}, ${e.reachable} reachable`};case`scan-failed`:return{at:e.at,source:`error`,message:e.reason};case`lifecycle-result`:return{at:e.at,source:e.action,message:`:${e.port} ${e.status}`};case`health-changed`:return{at:e.at,source:`health`,message:`:${e.port} ${e.from} → ${e.to}`};case`instance-message`:{let t=e.title?.trim();return{at:e.at,source:`:${e.port}`,message:`${e.role}: ${t||`message #${e.messageId}`}`}}case`version-mismatch`:return{at:e.at,source:`version`,message:`:${e.port} ${e.expected||`?`} → ${e.seen}`};case`port-collision`:return{at:e.at,source:`collision`,message:`:${e.port} pids ${e.pids.join(`, `)}`};default:return{at:new Date().toISOString(),source:`event`,message:`unknown event`}}}var fr={now:`Now`,earlier:`Earlier today`,yesterday:`Yesterday`,older:`Older`},pr=[`now`,`earlier`,`yesterday`,`older`],mr=300*1e3;function hr(e,t){return typeof e==`string`?{at:t,message:e}:`kind`in e?dr(e):e}function gr(e,t){let n=Date.parse(e);if(Number.isNaN(n))return`older`;if(t.getTime()-n<=mr)return`now`;let r=new Date(t);if(r.setHours(0,0,0,0),n>=r.getTime())return`earlier`;let i=new Date(r);return i.setDate(i.getDate()-1),n>=i.getTime()?`yesterday`:`older`}function _r(e,t){let n=new Date(e);return Number.isNaN(n.getTime())?`—`:t===`now`||t===`earlier`?n.toLocaleTimeString([],{hour:`2-digit`,minute:`2-digit`}):t===`yesterday`?`Yesterday ${n.toLocaleTimeString([],{hour:`2-digit`,minute:`2-digit`})}`:n.toLocaleDateString([],{month:`short`,day:`numeric`})}function vr(e){let t=(0,I.useMemo)(()=>{let t=new Date,n=t.toISOString(),r={now:[],earlier:[],yesterday:[],older:[]};for(let i of e.entries){let e=hr(i,n),a=gr(e.at,t);r[a].push({...e,_bucket:a})}return r},[e.entries]);return e.entries.length===0?(0,L.jsx)(`div`,{className:`activity-list activity-list-empty`,role:`status`,children:(0,L.jsx)(`p`,{children:e.emptyMessage||`Activity will appear here as scans, lifecycle changes, and registry updates happen.`})}):(0,L.jsx)(`div`,{className:`activity-list`,role:`list`,"aria-label":`Recent activity grouped by time`,children:pr.map(e=>{let n=t[e];return n.length===0?null:(0,L.jsxs)(`section`,{className:`activity-group`,"aria-label":fr[e],children:[(0,L.jsx)(`header`,{className:`activity-group-header`,children:fr[e]}),n.map((t,n)=>(0,L.jsxs)(`article`,{className:`activity-entry`,role:`listitem`,children:[(0,L.jsx)(`time`,{className:`activity-entry-time`,dateTime:t.at,children:_r(t.at,t._bucket)}),t.source&&(0,L.jsx)(`span`,{className:`activity-entry-source`,children:t.source}),(0,L.jsx)(`p`,{className:`activity-entry-message`,children:t.message})]},`${e}-${n}`))]},e)})})}var yr=88,br=320;function xr(e){return Math.min(br,Math.max(yr,Math.round(e)))}function Sr(e){let t=(0,I.useRef)(null),{onHeightChange:n}=e,r=Cr(e);(0,I.useEffect)(()=>{function e(e){let r=t.current;r&&n(xr(r.startHeight+r.startY-e.clientY))}function r(){t.current=null,document.body.classList.remove(`is-resizing-activity`)}return document.addEventListener(`pointermove`,e),document.addEventListener(`pointerup`,r),()=>{document.removeEventListener(`pointermove`,e),document.removeEventListener(`pointerup`,r),document.body.classList.remove(`is-resizing-activity`)}},[n]);function i(n){e.collapsed||(n.preventDefault(),t.current={startY:n.clientY,startHeight:e.height},document.body.classList.add(`is-resizing-activity`))}return(0,L.jsxs)(`aside`,{className:`activity-dock ${e.collapsed?`is-collapsed`:``}`,"aria-label":`Activity dock`,children:[(0,L.jsx)(`button`,{className:`activity-resize-handle`,type:`button`,"aria-label":`Resize activity dock`,title:`Resize activity dock`,onPointerDown:i,disabled:e.collapsed}),(0,L.jsxs)(`div`,{className:`activity-header`,children:[(0,L.jsx)(`span`,{children:`Activity`}),(0,L.jsx)(`button`,{type:`button`,onClick:e.onToggle,children:e.collapsed?`Expand`:`Collapse`})]}),!e.collapsed&&(0,L.jsx)(vr,{entries:r})]})}function Cr(e){return(0,I.useMemo)(()=>{let t=[];if(e.events&&e.events.length>0)for(let n of e.events)t.push(n);let n=new Date().toISOString();return e.error&&t.push({at:n,source:`error`,message:e.error}),e.registryMessage&&t.push({at:n,source:`registry`,message:e.registryMessage}),e.lifecycleMessage&&t.push({at:n,source:`lifecycle`,message:e.lifecycleMessage}),t.length===0&&t.push({at:n,source:`scan`,message:e.loading?`scanning local ports`:`no recent activity`}),t},[e.events,e.loading,e.error,e.registryMessage,e.lifecycleMessage])}function wr(e){let{children:t,onClose:n,open:r}=e,i=(0,I.useRef)(null),a=(0,I.useRef)(null);return(0,I.useEffect)(()=>{if(r)return a.current=document.activeElement,i.current?.focus(),()=>a.current?.focus()},[r]),(0,I.useEffect)(()=>{if(!r)return;function e(e){e.key===`Escape`&&n()}return document.addEventListener(`keydown`,e),()=>document.removeEventListener(`keydown`,e)},[n,r]),r?(0,L.jsx)(`div`,{className:`drawer-backdrop`,onClick:n,children:(0,L.jsxs)(`aside`,{className:`instance-drawer`,role:`dialog`,"aria-modal":`true`,"aria-label":`Instance drawer`,onClick:e=>e.stopPropagation(),children:[(0,L.jsxs)(`div`,{className:`drawer-header`,children:[(0,L.jsx)(`span`,{children:`Instances`}),(0,L.jsx)(`button`,{ref:i,type:`button`,onClick:n,children:`Close`})]}),(0,L.jsxs)(`div`,{className:`drawer-body`,children:[e.profileFilters&&(0,L.jsx)(`div`,{className:`drawer-profile-filters`,children:e.profileFilters}),t]})]})}):null}function Tr(e){return e.collapsed?(0,L.jsx)(`div`,{className:`instance-navigator is-collapsed`,children:e.children}):(0,L.jsxs)(`section`,{className:`instance-navigator`,"aria-label":`Instance navigator`,children:[(0,L.jsxs)(`header`,{className:`instance-navigator-header`,children:[(0,L.jsxs)(`div`,{children:[(0,L.jsx)(`p`,{className:`eyebrow`,children:`Navigator`}),(0,L.jsx)(`strong`,{children:e.active?`:${e.active.port}`:`No active target`})]}),(0,L.jsxs)(`span`,{children:[e.hiddenCount,` hidden`]})]}),(0,L.jsx)(`div`,{className:`instance-navigator-scroll`,children:e.children})]})}function Er(e){return(0,L.jsxs)(`div`,{className:`mobile-nav-actions`,children:[(0,L.jsx)(`button`,{type:`button`,onClick:e.onOpenInstances,children:`Instances`}),(0,L.jsx)(`button`,{type:`button`,className:e.activeTab===`preview`?`is-active`:``,onClick:()=>e.onSelectTab(`preview`),children:`Preview`}),(0,L.jsx)(`button`,{type:`button`,onClick:e.onToggleActivity,children:`Activity`}),(0,L.jsx)(`button`,{type:`button`,className:e.activeTab===`settings`?`is-active`:``,onClick:()=>e.onSelectTab(`settings`),children:`More`})]})}function Dr({direction:e}){return(0,L.jsx)(`svg`,{className:`rail-collapse-chevron`,viewBox:`0 0 16 20`,width:`14`,height:`14`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.6`,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":`true`,focusable:`false`,children:(0,L.jsx)(`polyline`,{points:e===`left`?`11 4 5 10 11 16`:`5 4 11 10 5 16`})})}function Or(){return(0,L.jsxs)(`svg`,{viewBox:`0 0 20 20`,width:`16`,height:`16`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.6`,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":`true`,focusable:`false`,children:[(0,L.jsx)(`rect`,{x:`3`,y:`4`,width:`14`,height:`10`,rx:`1.5`}),(0,L.jsx)(`path`,{d:`M8 17h4M10 14v3`})]})}function kr(){return(0,L.jsxs)(`svg`,{viewBox:`0 0 20 20`,width:`16`,height:`16`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.6`,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":`true`,focusable:`false`,children:[(0,L.jsx)(`path`,{d:`M6 3h6l3 3v11H6z`}),(0,L.jsx)(`path`,{d:`M12 3v4h3M8 10h5M8 13h5`})]})}function Ar(){return(0,L.jsxs)(`svg`,{viewBox:`0 0 20 20`,width:`16`,height:`16`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.6`,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":`true`,focusable:`false`,children:[(0,L.jsx)(`rect`,{x:`3`,y:`4`,width:`14`,height:`12`,rx:`1.5`}),(0,L.jsx)(`path`,{d:`M7 4v12M13 4v12`})]})}function jr(){return(0,L.jsxs)(`svg`,{viewBox:`0 0 20 20`,width:`16`,height:`16`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.6`,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":`true`,focusable:`false`,children:[(0,L.jsx)(`rect`,{x:`3`,y:`5`,width:`14`,height:`12`,rx:`1.5`}),(0,L.jsx)(`path`,{d:`M3 9h14M7 3v4M13 3v4`})]})}function Mr(){return(0,L.jsxs)(`svg`,{viewBox:`0 0 20 20`,width:`16`,height:`16`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.6`,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":`true`,focusable:`false`,children:[(0,L.jsx)(`path`,{d:`M5 4h10v13H5z`}),(0,L.jsx)(`path`,{d:`M8 2v4M12 2v4M8 10h4M8 13h3`})]})}function Nr(){return(0,L.jsxs)(`svg`,{viewBox:`0 0 24 24`,width:`16`,height:`16`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.8`,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":`true`,focusable:`false`,children:[(0,L.jsx)(`path`,{d:`M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915`}),(0,L.jsx)(`circle`,{cx:`12`,cy:`12`,r:`3`})]})}function Pr(){return(0,L.jsxs)(`svg`,{viewBox:`0 0 20 20`,width:`16`,height:`16`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.6`,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":`true`,focusable:`false`,children:[(0,L.jsx)(`circle`,{cx:`10`,cy:`10`,r:`7`}),(0,L.jsx)(`path`,{d:`M7.6 7.6a2.4 2.4 0 0 1 4.8 0c0 1.4-1.6 1.7-2.2 2.5-.3.4-.3.8-.3 1.2`}),(0,L.jsx)(`circle`,{cx:`10`,cy:`14.2`,r:`0.6`,fill:`currentColor`,stroke:`none`})]})}function Fr(e){let t=!e.collapsed,n=t?`Collapse navigation`:`Expand navigation`;return(0,L.jsxs)(`div`,{className:`sidebar-rail`,children:[(0,L.jsx)(`button`,{className:`rail-collapse-button`,type:`button`,onClick:e.onToggleSidebar,"aria-label":n,"aria-expanded":t,"aria-pressed":e.collapsed,"aria-controls":`manager-sidebar-list`,title:n,children:(0,L.jsx)(Dr,{direction:t?`left`:`right`})}),(0,L.jsx)(`button`,{className:`rail-button rail-workspace-button${e.mode===`instances`?` is-active`:``}`,type:`button`,onClick:()=>e.onModeChange(`instances`),"aria-label":`Instances`,"aria-pressed":e.mode===`instances`,title:`Instances`,children:(0,L.jsx)(Or,{})}),(0,L.jsx)(`button`,{className:`rail-button rail-workspace-button${e.mode===`board`?` is-active`:``}`,type:`button`,onClick:()=>e.onModeChange(`board`),"aria-label":`Board`,"aria-pressed":e.mode===`board`,title:`Board`,children:(0,L.jsx)(Ar,{})}),e.scheduleWorkspaceEnabled?(0,L.jsx)(`button`,{className:`rail-button rail-workspace-button${e.mode===`schedule`?` is-active`:``}`,type:`button`,onClick:()=>e.onModeChange(`schedule`),"aria-label":`Schedule`,"aria-pressed":e.mode===`schedule`,title:`Schedule`,children:(0,L.jsx)(jr,{})}):null,e.remindersWorkspaceEnabled?(0,L.jsx)(`button`,{className:`rail-button rail-workspace-button${e.mode===`reminders`?` is-active`:``}`,type:`button`,onClick:()=>e.onModeChange(`reminders`),"aria-label":`Reminders`,"aria-pressed":e.mode===`reminders`,title:`Reminders`,children:(0,L.jsx)(Mr,{})}):null,(0,L.jsx)(`button`,{className:`rail-button rail-workspace-button${e.mode===`notes`?` is-active`:``}`,type:`button`,onClick:()=>e.onModeChange(`notes`),"aria-label":`Notes`,"aria-pressed":e.mode===`notes`,title:`Notes`,children:(0,L.jsx)(kr,{})}),(0,L.jsx)(`button`,{className:`rail-button rail-workspace-button${e.mode===`settings`?` is-active`:``}`,type:`button`,onClick:()=>e.onModeChange(`settings`),"aria-label":`Dashboard settings`,"aria-pressed":e.mode===`settings`,title:`Dashboard settings`,children:(0,L.jsx)(Nr,{})}),(0,L.jsx)(`div`,{className:`rail-spacer`,"aria-hidden":`true`}),(0,L.jsx)(`button`,{className:`rail-button rail-help-button${e.helpOpen?` is-active`:``}`,type:`button`,onClick:e.onToggleHelp,"aria-label":`Help guide`,"aria-pressed":e.helpOpen,"aria-expanded":e.helpOpen,title:`Help (?)`,children:(0,L.jsx)(Pr,{})}),(0,L.jsx)(`span`,{className:`rail-status-dot`,"aria-label":`${e.onlineCount} online instances`})]})}var Ir=[`overview`,`preview`,`logs`,`settings`];function Lr(e){return e[0].toUpperCase()+e.slice(1)}function Rr(e){return(0,L.jsxs)(`section`,{className:`workbench workbench-${e.mode}`,"aria-label":`Selected instance workbench`,children:[(0,L.jsxs)(`div`,{className:`workbench-header`,children:[e.header,(0,L.jsxs)(`div`,{className:`workbench-mode-bar`,children:[(0,L.jsx)(`div`,{className:`workbench-mode-tabs`,role:`tablist`,"aria-label":`Workbench modes`,children:Ir.map(t=>(0,L.jsx)(`button`,{type:`button`,role:`tab`,"aria-selected":e.mode===t,className:e.mode===t?`is-active`:``,onClick:()=>e.onModeChange(t),children:Lr(t)},t))}),e.modeActions]})]}),(0,L.jsxs)(`div`,{className:`workbench-body`,children:[e.mode===`overview`&&(0,L.jsx)(`div`,{className:`workbench-panel workbench-panel-overview`,children:e.overview},`overview`),(0,L.jsx)(`div`,{className:`workbench-panel workbench-panel-preview`,hidden:e.mode!==`preview`,"aria-hidden":e.mode!==`preview`,"data-preview-host":`persistent`,children:e.preview},`preview`),e.mode===`logs`&&(0,L.jsx)(`div`,{className:`workbench-panel workbench-panel-logs`,children:e.logs},`logs`),e.mode===`settings`&&(0,L.jsx)(`div`,{className:`workbench-panel workbench-panel-settings`,children:e.settings},`settings`)]})]})}var zr=260,Br=520,Vr=360;function Hr(){return typeof window>`u`?1440:window.innerWidth}function Ur(){let[e,t]=(0,I.useState)(Hr);return(0,I.useEffect)(()=>{let e=()=>t(Hr());return window.addEventListener(`resize`,e),()=>window.removeEventListener(`resize`,e)},[]),e}function Wr(e,t,n){let r=typeof e==`number`&&Number.isFinite(e)?Math.round(e):Br,i=Math.max(zr,n-(t?56:n>=1440?360:300)-Vr),a=Math.min(Br,Math.floor(n*.48),i);return Math.max(zr,Math.min(r,a))}function Gr(e){let t=Ur(),n=e.rightPanelOpen?Wr(e.rightPanelWidth,e.sidebarCollapsed,t):0,r={"--activity-dock-height":`${e.inspectorHeight}px`,"--sidebar-width":e.sidebarCollapsed?`56px`:void 0,"--right-panel-width":e.rightPanelOpen?`${n}px`:e.sidePanel?void 0:`0px`,"--bottom-panel-height":e.bottomPanelOpen?`${e.bottomPanelHeight??0}px`:void 0};return(0,L.jsxs)(`div`,{className:[`manager-workspace`,e.sidebarCollapsed&&`is-sidebar-collapsed`,e.inspectorCollapsed&&`is-inspector-collapsed`,e.rightPanelOpen&&`is-right-panel-open`,!e.rightPanelOpen&&!e.sidePanel&&`is-right-panel-closed`,e.bottomPanelOpen&&`is-bottom-panel-open`,!e.bottomPanelOpen&&`is-bottom-panel-closed`,e.sidePanel&&`is-side-panel-open`,e.drawerOpen&&`is-drawer-open`].filter(Boolean).join(` `),style:r,children:[e.drawerOpen&&(0,L.jsx)(`div`,{className:`drawer-backdrop`,onClick:e.onCloseDrawer}),(0,L.jsx)(`aside`,{className:`manager-sidebar`,"aria-label":`Jaw instances`,children:e.navigator}),(0,L.jsx)(`section`,{className:`manager-detail`,"aria-label":`Manager workbench`,children:e.workbench}),(0,L.jsx)(`section`,{className:`manager-activity`,"aria-label":`Manager inspector`,children:e.inspector}),e.sidePanel&&(0,L.jsx)(`aside`,{className:`manager-ceo-panel`,"aria-label":`Jaw CEO console`,children:e.sidePanel}),e.rightPanelContent,e.bottomPanelContent,(0,L.jsx)(`nav`,{className:`manager-mobile-nav`,"aria-label":`Mobile dashboard navigation`,children:e.mobileNav}),e.drawer]})}function Kr(e){let t=(0,I.useRef)(!1),n=(0,I.useRef)(0),{direction:r,onDelta:i,onEnd:a}=e,o=(0,I.useCallback)(e=>{if(!t.current)return;let a=r===`horizontal`?e.clientX:e.clientY,o=a-n.current;n.current=a,o!==0&&i(o)},[r,i]),s=(0,I.useCallback)(()=>{t.current&&(t.current=!1,document.body.classList.remove(`is-resizing-horizontal`,`is-resizing-vertical`),a?.())},[a]);(0,I.useEffect)(()=>(document.addEventListener(`pointermove`,o),document.addEventListener(`pointerup`,s),document.addEventListener(`pointercancel`,s),()=>{document.removeEventListener(`pointermove`,o),document.removeEventListener(`pointerup`,s),document.removeEventListener(`pointercancel`,s),document.body.classList.remove(`is-resizing-horizontal`,`is-resizing-vertical`)}),[o,s]);function c(e){e.preventDefault(),e.target.setPointerCapture(e.pointerId),t.current=!0,n.current=r===`horizontal`?e.clientX:e.clientY,document.body.classList.add(r===`horizontal`?`is-resizing-horizontal`:`is-resizing-vertical`)}function l(e){r===`horizontal`?e.key===`ArrowLeft`?(e.preventDefault(),i(-10)):e.key===`ArrowRight`&&(e.preventDefault(),i(10)):e.key===`ArrowUp`?(e.preventDefault(),i(-10)):e.key===`ArrowDown`&&(e.preventDefault(),i(10))}return(0,L.jsx)(`button`,{type:`button`,className:`panel-resizer panel-resizer-${r} ${e.className??``}`,"aria-label":`Resize ${r===`horizontal`?`width`:`height`}`,onPointerDown:c,onKeyDown:l})}var qr={folder:`Folders`,doc:`Document preview`,diff:`Diff`,browser:`Browser`};function Jr(){return(0,L.jsxs)(`svg`,{viewBox:`0 0 20 20`,width:`16`,height:`16`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.6`,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":`true`,focusable:`false`,children:[(0,L.jsx)(`path`,{d:`M3 6.5h5l1.5 2H17v6.5a1.5 1.5 0 0 1-1.5 1.5h-11A1.5 1.5 0 0 1 3 15V6.5Z`}),(0,L.jsx)(`path`,{d:`M3 6.5V5a1.5 1.5 0 0 1 1.5-1.5h3L9 5.5h6.5A1.5 1.5 0 0 1 17 7v1.5`})]})}function Yr(){return(0,L.jsxs)(`svg`,{viewBox:`0 0 20 20`,width:`16`,height:`16`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.6`,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":`true`,focusable:`false`,children:[(0,L.jsx)(`path`,{d:`M5 3.5h6l4 4V16a1.5 1.5 0 0 1-1.5 1.5h-7A1.5 1.5 0 0 1 5 16v-12.5Z`}),(0,L.jsx)(`path`,{d:`M11 3.5v4h4M7.5 11h5M7.5 14h4`})]})}function Xr(){return(0,L.jsx)(`svg`,{viewBox:`0 0 20 20`,width:`16`,height:`16`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.6`,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":`true`,focusable:`false`,children:(0,L.jsx)(`path`,{d:`M6 4v12M14 4v12M4 7h4M4 13h4M12 10h4M14 8v4`})})}function Zr(){return(0,L.jsxs)(`svg`,{viewBox:`0 0 20 20`,width:`16`,height:`16`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.6`,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":`true`,focusable:`false`,children:[(0,L.jsx)(`rect`,{x:`3`,y:`4`,width:`14`,height:`12`,rx:`2`}),(0,L.jsx)(`path`,{d:`M3 7.5h14M6 6h.01M8.5 6h.01`})]})}var Qr={folder:(0,L.jsx)(Jr,{}),doc:(0,L.jsx)(Yr,{}),diff:(0,L.jsx)(Xr,{}),browser:(0,L.jsx)(Zr,{})},$r=[`folder`,`doc`,`diff`,`browser`],ei=[`browser`],ti=180;function ni(e){let{state:t,dispatch:n,effectiveRightOpen:r,rightPanelSplit:i}=wn(),a=t.rightPanel,o=(0,I.useRef)(null),s=(0,I.useCallback)(e=>{n({type:`SET_RIGHT_WIDTH`,width:a.width-e})},[n,a.width]),c=(0,I.useCallback)(()=>{},[]),l=(0,I.useCallback)(e=>{let t=o.current;if(!t)return;let r=t.clientHeight;r!==0&&n({type:`SET_RIGHT_SPLIT_RATIO`,ratio:a.splitRatio+e/r})},[n,a.splitRatio]),u=(0,I.useCallback)(e=>{n({type:`SET_RIGHT_BOTTOM_MODE`,mode:null}),n({type:`OPEN_RIGHT_PANEL`,mode:e,slot:`top`})},[n]),d=(0,I.useCallback)(e=>{n({type:`SOLO_RIGHT_SUB`,slot:e})},[n]);if(!r)return null;let f=i,p=f?a.splitRatio:1,m=f?1-a.splitRatio:0,h=a.topMode??a.bottomMode,g=f?`minmax(${ti}px, ${p}fr) auto minmax(${ti}px, ${m}fr)`:void 0;function _(t,r){let i=qr[r],a=!f&&ei.includes(r);return(0,L.jsxs)(`div`,{className:`right-sub-panel${a?` has-content-owned-chrome`:``}`,"aria-label":i,children:[!a&&(0,L.jsxs)(`div`,{className:`right-sub-header`,children:[(0,L.jsx)(`span`,{className:`right-sub-title`,children:i}),(0,L.jsxs)(`div`,{className:`right-sub-actions`,children:[f?(0,L.jsx)(`button`,{type:`button`,className:`right-sub-action`,"aria-label":`Show only ${i}`,title:`Show only ${i}`,onClick:()=>d(t),children:`Only`}):null,(0,L.jsx)(`button`,{type:`button`,className:`right-sub-action right-sub-close`,"aria-label":`Close ${i}`,title:`Close ${i}`,onClick:()=>n({type:`CLOSE_RIGHT_SUB`,slot:t}),children:`×`})]})]}),(0,L.jsx)(`div`,{className:`right-sub-content`,children:e.renderPanel(r)})]},`${t}-${r}`)}return(0,L.jsxs)(`aside`,{className:`right-panel`,"aria-label":`Right sidebar`,children:[(0,L.jsx)(Kr,{direction:`horizontal`,onDelta:s,onEnd:c}),(0,L.jsxs)(`div`,{className:`right-panel-shell`,children:[(0,L.jsxs)(`div`,{className:`right-panel-toolbar`,"aria-label":`Right sidebar panels`,children:[$r.map(e=>(0,L.jsx)(`button`,{type:`button`,className:`right-panel-mode-button${h===e?` is-active`:``}`,"aria-label":qr[e],"aria-pressed":h===e,title:qr[e],onClick:()=>u(e),children:Qr[e]},e)),(0,L.jsx)(`button`,{type:`button`,className:`right-panel-close`,"aria-label":`Close right sidebar`,title:`Close`,onClick:()=>n({type:`SET_RIGHT_OPEN`,open:!1}),children:`×`})]}),(0,L.jsxs)(`div`,{ref:o,className:`right-panel-body ${f?`is-split-panel`:`is-single-panel`}`,style:f?{gridTemplateRows:g}:void 0,children:[a.topMode&&_(`top`,a.topMode),f&&(0,L.jsx)(Kr,{direction:`vertical`,onDelta:l,className:`right-split-resizer`}),a.bottomMode&&_(`bottom`,a.bottomMode)]})]})]})}var ri={activity:`Activity`,terminal:`Terminal`,browser:`Browser`,logs:`Logs`};function ii(e){function t(t){let n=e.tabs,r=e.activeTab?n.indexOf(e.activeTab):-1;if(t.key===`ArrowRight`||t.key===`ArrowLeft`){t.preventDefault();let i=n[(r+(t.key===`ArrowRight`?1:-1)+n.length)%n.length];i&&e.onActivate(i)}else if(t.key===`Home`)t.preventDefault(),n[0]&&e.onActivate(n[0]);else if(t.key===`End`){t.preventDefault();let r=n[n.length-1];r&&e.onActivate(r)}}return(0,L.jsxs)(`div`,{className:`bottom-tab-bar`,role:`tablist`,onKeyDown:t,children:[e.tabs.map(t=>(0,L.jsxs)(`div`,{className:`bottom-tab-item ${t===e.activeTab?`is-active`:``}`,role:`presentation`,children:[(0,L.jsx)(`button`,{type:`button`,role:`tab`,className:`bottom-tab ${t===e.activeTab?`is-active`:``}`,"aria-selected":t===e.activeTab,tabIndex:t===e.activeTab?0:-1,onClick:()=>e.onActivate(t),children:(0,L.jsx)(`span`,{children:ri[t]})}),(0,L.jsx)(`button`,{type:`button`,className:`bottom-tab-close`,"aria-label":`Close ${ri[t]}`,title:`Close ${ri[t]}`,onClick:()=>e.onClose(t),children:`×`})]},t)),(0,L.jsx)(`button`,{type:`button`,className:`bottom-collapse-button`,"aria-label":`Collapse panel`,onClick:e.onCollapse,children:`▼`})]})}var ai=[`terminal`,`browser`];function oi(e){let{state:t,dispatch:n}=wn(),r=t.bottomPanel,i=(0,I.useCallback)(e=>{n({type:`SET_BOTTOM_HEIGHT`,height:r.height-e})},[n,r.height]),a=(0,I.useCallback)(()=>{n({type:`SET_BOTTOM_OPEN`,open:!1})},[n]),o=r.activeTab??r.tabs[0]??null,s=o!==null&&ai.includes(o);return r.tabs.length===0?null:(0,L.jsxs)(`div`,{className:`bottom-panel ${s?`has-content-owned-chrome`:``}`,"aria-label":`Bottom panel`,"aria-hidden":!r.open,children:[(0,L.jsx)(Kr,{direction:`vertical`,onDelta:i}),!s&&(0,L.jsx)(ii,{tabs:r.tabs,activeTab:r.activeTab,onActivate:e=>n({type:`SET_BOTTOM_ACTIVE_TAB`,tab:e}),onClose:e=>n({type:`CLOSE_BOTTOM_TAB`,tab:e}),onCollapse:a}),(0,L.jsx)(`div`,{className:`bottom-panel-content`,children:o&&e.renderTab(o,{onCollapse:a,onCloseTab:()=>n({type:`CLOSE_BOTTOM_TAB`,tab:o}),ownsChrome:s})})]})}function si(e){return e===`127.0.0.1`||e===`localhost`||e===`::1`||e===`[::1]`}function ci(e=typeof navigator<`u`?navigator.userAgent:``){return/Safari/i.test(e)&&!/Chrome|Chromium|CriOS|Edg|OPR|Android/i.test(e)}function li(e){return e===`dark`||e===`light`}function ui(e){return e&&typeof e==`object`?{theme:e.theme===`dark`||e.theme===`light`?e.theme:null,transport:e.transport===`legacy-path`||e.transport===`origin-port`?e.transport:null}:{theme:li(e)?e:null,transport:e===`proxy`?`legacy-path`:null}}function di(e,t){let n=t||(typeof window<`u`?window.location.href:``);if(!n||e.startsWith(`/`))return e;try{let t=new URL(e),r=new URL(n);return si(t.hostname)&&si(r.hostname)&&(t.hostname=r.hostname),t.toString()}catch{return e}}function fi(e,t){if(!t)return e;let n=e.startsWith(`/`),r=new URL(e,`http://jaw.local`);return r.searchParams.set(`jawTheme`,t),n?`${r.pathname}${r.search}${r.hash}`:r.toString()}function pi(e,t,n){if(!e)return{canPreview:!1,src:null,reason:`Select an online instance to preview.`,transport:`none`,warning:null};if(!e.ok)return{canPreview:!1,src:null,reason:`Preview is only available for online instances.`,transport:`none`,warning:null};let r=t?.manager.proxy;if(!r?.enabled)return{canPreview:!1,src:null,reason:`Proxy preview is not available.`,transport:`none`,warning:null};if(e.port<r.allowedFrom||e.port>r.allowedTo)return{canPreview:!1,src:null,reason:`This port is outside the proxy allowlist.`,transport:`none`,warning:null};let i=r.preview?.instances[String(e.port)],{theme:a,transport:o}=ui(n);return o!==`legacy-path`&&r.preview?.enabled&&i?.status===`ready`&&i.url&&!ci()?{canPreview:!0,src:fi(di(i.url),a),reason:null,transport:`origin-port`,warning:`origin proxy ready`}:{canPreview:!0,src:fi(`${r.basePath||`/i`}/${e.port}/`,a),reason:null,transport:`legacy-path`,warning:`legacy proxy fallback`}}function mi(e){return e.replace(/^\[|\]$/g,``).toLowerCase()}function hi(e){let t=mi(e);return t===`127.0.0.1`||t===`localhost`||t===`::1`}function gi(e,t){if(e===t)return!0;try{let n=new URL(e),r=new URL(t);return n.protocol!==r.protocol||n.port!==r.port?!1:hi(n.hostname)&&hi(r.hostname)}catch{return!1}}function _i(e,t,n){if(!e||e===`null`)return!1;let r=yi(t,n);return!!(r&&gi(r,e))}function vi(e,t,n,r){if(!(!e||!t||t===`null`))try{e.postMessage({type:`jaw-preview-send-result`,requestId:n,...r},t)}catch(e){console.warn(`[manager-preview] send relay result skipped`,e)}}function yi(e,t){if(typeof window>`u`)return`http://localhost`;try{let e=t?.contentWindow?.location.origin;if(e&&e!==`null`)return e}catch{}let n=new URL(e,window.location.href).origin;return n===`null`?null:n}function bi(e,t,n){let r=e?.contentWindow;if(!r)return;let i=yi(t,e);if(!(!i||i===`null`))try{r.postMessage({type:`jaw-preview-theme-sync`,theme:n},i)}catch(e){console.warn(`[manager-preview] theme sync skipped`,e)}}function xi(e,t){let n=e?.contentWindow;if(!n)return;let r=yi(t,e);if(!(!r||r===`null`))try{n.postMessage({type:`jaw-preview-stt-toggle`},r)}catch(e){console.warn(`[manager-preview] STT shortcut sync skipped`,e)}}function Si(e){if(!(e instanceof HTMLElement))return!1;if(e.isContentEditable)return!0;let t=e.tagName.toLowerCase();return t===`input`||t===`textarea`||t===`select`?!0:!!e.closest(`[contenteditable="true"], .cm-editor, .ProseMirror, [data-milkdown-root]`)}function Ci(e){let t=(e.ctrlKey||e.metaKey)&&e.shiftKey&&e.code===`Space`,n=e.altKey&&!e.ctrlKey&&!e.metaKey&&!e.shiftKey&&e.code===`KeyM`;return t||n}function wi(e){let t=(0,I.useRef)(null),n=(0,I.useRef)(null),r=pi(e.instance,e.data,{theme:e.theme}),i=e.instance?.ok?`Preview is off. Turn it on from the header to mount the iframe.`:r.reason,a=(0,I.useCallback)(()=>{!e.enabled||!r.canPreview||!r.src||n.current===r.src&&bi(t.current,r.src,e.theme)},[e.enabled,e.theme,r.canPreview,r.src]);(0,I.useEffect)(()=>{a()},[a]),(0,I.useEffect)(()=>{if(!e.enabled||!r.canPreview||!r.src||!e.instance?.ok)return;function n(n){if(n.source!==t.current?.contentWindow||!r.src||!_i(n.origin,r.src,t.current))return;let i=n.data;if(!i||i.type!==`jaw-preview-send-message`)return;let a=typeof i.requestId==`string`?i.requestId:``,o=typeof i.prompt==`string`?i.prompt.trim():``;if(a){if(!o){vi(n.source,n.origin,a,{ok:!1,status:400,error:`prompt must be a non-empty string`});return}O(e.instance.port,o).then(e=>{vi(n.source,n.origin,a,{ok:e.ok,status:e.status,data:e.data,...e.data.error?{error:e.data.error}:{}})}).catch(e=>{vi(n.source,n.origin,a,{ok:!1,status:502,error:e.message})})}}window.addEventListener(`message`,n);function i(n){if(n.source!==t.current?.contentWindow||!r.src||!_i(n.origin,r.src,t.current))return;let i=n.data;if(!i||i.type!==`jaw-preview-open-notes`)return;let a=typeof i.path==`string`?i.path.trim():``;a&&e.onOpenNotesFromPreview?.(a)}return window.addEventListener(`message`,i),()=>{window.removeEventListener(`message`,n),window.removeEventListener(`message`,i)}},[e.enabled,e.instance,e.onOpenNotesFromPreview,r.canPreview,r.src]),(0,I.useEffect)(()=>{if(!e.active||!e.enabled||!r.canPreview||!r.src)return;function n(e){e.defaultPrevented||Si(e.target)||Ci(e)&&(e.preventDefault(),xi(t.current,r.src||``))}return document.addEventListener(`keydown`,n,!0),()=>document.removeEventListener(`keydown`,n,!0)},[e.active,e.enabled,r.canPreview,r.src]);let o=(0,I.useRef)(!1);return(0,I.useEffect)(()=>{let n=o.current;if(o.current=e.active,!n&&e.active&&t.current?.contentWindow&&r.src){let e=yi(r.src,t.current);if(e&&e!==`null`)try{t.current.contentWindow.postMessage({type:`jaw-preview-visibility`,visible:!0},e)}catch{}}},[e.active,r.src]),(0,L.jsxs)(`aside`,{className:`preview-panel`,"aria-label":`Instance preview`,children:[(!e.enabled||!r.canPreview)&&(0,L.jsx)(`div`,{className:`preview-empty`,children:i}),e.enabled&&r.canPreview&&r.src&&(0,L.jsx)(`iframe`,{title:`Jaw instance ${e.instance?.port} preview`,ref:t,className:`preview-frame`,src:r.src,sandbox:`allow-forms allow-modals allow-popups allow-popups-to-escape-sandbox allow-same-origin allow-scripts allow-downloads`,allow:`clipboard-read; clipboard-write; microphone`,onLoad:()=>{n.current=r.src,a()}},`${e.instance?.port||`none`}:${e.refreshKey}`)]})}var Ti={ko:{navLabel:`대시보드 설정 섹션`,eyebrow:`대시보드`,title:`설정`,sections:{display:{label:`사이드바 행`,hint:`밀도와 행 안 컨트롤`},activity:{label:`미리보기와 활동`,hint:`제목 출처와 기본값`},developer:{label:`개발 도구`,hint:`Git diff 기본값`},embedding:{label:`임베딩 검색`,hint:`Provider와 벡터 인덱스`}}},en:{navLabel:`Dashboard settings sections`,eyebrow:`Dashboard`,title:`Settings`,sections:{display:{label:`Sidebar rows`,hint:`Density and inline controls`},activity:{label:`Preview & activity`,hint:`Title source and defaults`},developer:{label:`Developer tools`,hint:`Git diff defaults`},embedding:{label:`Embedding search`,hint:`Provider and vector index`}}},zh:{navLabel:`仪表盘设置分区`,eyebrow:`仪表盘`,title:`设置`,sections:{display:{label:`侧边栏列表`,hint:`密度与行内控件`},activity:{label:`预览与活动`,hint:`标题来源与默认值`},developer:{label:`开发工具`,hint:`Git diff 默认值`},embedding:{label:`嵌入搜索`,hint:`Provider 与向量索引`}}},ja:{navLabel:`ダッシュボード設定セクション`,eyebrow:`ダッシュボード`,title:`設定`,sections:{display:{label:`サイドバーの行`,hint:`密度と行内コントロール`},activity:{label:`プレビューとアクティビティ`,hint:`タイトルの取得元と既定値`},developer:{label:`開発ツール`,hint:`Git diff の既定値`},embedding:{label:`エンベディング検索`,hint:`Provider とベクトルインデックス`}}}},Ei=[`display`,`activity`,`developer`,`embedding`];function Di(e){let t=Ti[e.locale]||Ti.ko;return(0,L.jsxs)(`nav`,{className:`dashboard-settings-sidebar`,"aria-label":t.navLabel,children:[(0,L.jsxs)(`div`,{className:`dashboard-settings-sidebar-header`,children:[(0,L.jsx)(`span`,{className:`eyebrow`,children:t.eyebrow}),(0,L.jsx)(`strong`,{children:t.title})]}),(0,L.jsx)(`div`,{className:`dashboard-settings-sidebar-list`,children:Ei.map(n=>(0,L.jsxs)(`button`,{className:`dashboard-settings-sidebar-button${e.activeSection===n?` is-active`:``}`,type:`button`,"aria-pressed":e.activeSection===n,onClick:()=>e.onSectionChange(n),children:[(0,L.jsx)(`span`,{children:t.sections[n].label}),(0,L.jsx)(`small`,{children:t.sections[n].hint})]},n))})]})}var Oi={ko:{title:`개발 도구`,description:`Diff 패널이 선택된 인스턴스의 repo root와 기본 비교 방식을 고르는 기준입니다.`,rootPolicy:[`Repo root 우선순위`,`Diff panel`,`선택된 인스턴스에서 어떤 경로를 먼저 git repo로 볼지 정합니다.`],diffMode:[`기본 diff 모드`,`Diff panel`,`처음 열 때 사용할 비교 범위입니다.`],baseRef:[`기본 base ref`,`Base ref 모드`,`origin/master, main, HEAD 같은 기준 ref입니다.`],untracked:[`Untracked 포함`,`Diff summary`,`아직 git에 추가되지 않은 파일도 목록에 표시합니다.`]},en:{title:`Developer tools`,description:`Defaults used by the Diff panel when it resolves a repo root from the selected instance.`,rootPolicy:[`Repo root priority`,`Diff panel`,`Choose which selected-instance path is tried first as a git repository.`],diffMode:[`Default diff mode`,`Diff panel`,`Comparison scope used when the panel opens.`],baseRef:[`Default base ref`,`Base ref mode`,`Reference used for base comparisons, such as origin/master, main, or HEAD.`],untracked:[`Include untracked`,`Diff summary`,`Show files that are not yet tracked by git.`]},zh:{title:`开发工具`,description:`Diff 面板从已选实例解析 repo root 与默认比较方式时使用的设置。`,rootPolicy:[`Repo root 优先级`,`Diff panel`,`决定优先把已选实例中的哪个路径当作 git repo。`],diffMode:[`默认 diff 模式`,`Diff panel`,`面板打开时使用的比较范围。`],baseRef:[`默认 base ref`,`Base ref 模式`,`例如 origin/master、main 或 HEAD。`],untracked:[`包含 untracked`,`Diff summary`,`显示尚未被 git 跟踪的文件。`]},ja:{title:`開発ツール`,description:`Diff パネルが選択中インスタンスから repo root と比較方式を決めるときの既定値です。`,rootPolicy:[`Repo root の優先順位`,`Diff panel`,`選択中インスタンスのどのパスを先に git repo として扱うかを決めます。`],diffMode:[`既定の diff モード`,`Diff panel`,`パネルを開いたときの比較範囲です。`],baseRef:[`既定の base ref`,`Base ref モード`,`origin/master、main、HEAD などの基準 ref です。`],untracked:[`Untracked を含める`,`Diff summary`,`git で未追跡のファイルも一覧に表示します。`]}},ki=[{value:`project-first`,label:`Project dirs first`},{value:`working-dir-first`,label:`Working dir first`},{value:`manual`,label:`Pinned root first`}],Ai=[{value:`unstaged`,label:`Unstaged`},{value:`staged`,label:`Staged`},{value:`head`,label:`HEAD`},{value:`base`,label:`Base ref`}];function ji(e,t,n){return(0,L.jsxs)(`div`,{className:`dashboard-settings-row`,children:[(0,L.jsxs)(`div`,{className:`dashboard-settings-row-main`,children:[(0,L.jsxs)(`label`,{className:`dashboard-settings-row-heading`,htmlFor:e,children:[(0,L.jsx)(`span`,{children:t[0]}),(0,L.jsx)(`span`,{className:`dashboard-settings-row-scope`,children:t[1]})]}),(0,L.jsx)(`p`,{className:`dashboard-settings-row-description`,children:t[2]})]}),(0,L.jsx)(`div`,{className:`dashboard-settings-row-control`,children:n})]})}function Mi(e){let t=Oi[e.locale]||Oi.ko;return(0,L.jsxs)(`section`,{className:`dashboard-settings-section`,children:[(0,L.jsxs)(`header`,{children:[(0,L.jsx)(`h3`,{children:t.title}),(0,L.jsx)(`p`,{children:t.description})]}),(0,L.jsxs)(`div`,{className:`dashboard-settings-field-list`,children:[ji(`dashboard-diff-root-policy`,t.rootPolicy,(0,L.jsx)(`select`,{id:`dashboard-diff-root-policy`,className:`dashboard-settings-select`,value:e.ui.diffRootPolicy,onChange:t=>e.onUiPatch({diffRootPolicy:t.currentTarget.value}),children:ki.map(e=>(0,L.jsx)(`option`,{value:e.value,children:e.label},e.value))})),ji(`dashboard-diff-default-mode`,t.diffMode,(0,L.jsx)(`select`,{id:`dashboard-diff-default-mode`,className:`dashboard-settings-select`,value:e.ui.diffDefaultMode,onChange:t=>e.onUiPatch({diffDefaultMode:t.currentTarget.value}),children:Ai.map(e=>(0,L.jsx)(`option`,{value:e.value,children:e.label},e.value))})),ji(`dashboard-diff-base-ref`,t.baseRef,(0,L.jsx)(`input`,{id:`dashboard-diff-base-ref`,className:`dashboard-settings-shortcut-input`,type:`text`,value:e.ui.diffBaseRef,onChange:t=>e.onUiPatch({diffBaseRef:t.currentTarget.value})})),ji(`dashboard-diff-include-untracked`,t.untracked,(0,L.jsx)(`input`,{id:`dashboard-diff-include-untracked`,className:`dashboard-settings-toggle`,type:`checkbox`,checked:e.ui.diffIncludeUntracked,onChange:t=>e.onUiPatch({diffIncludeUntracked:t.currentTarget.checked})}))]})]})}function Ni(e){return(0,L.jsx)(`button`,{type:`button`,className:e.className?`help-topic-button ${e.className}`:`help-topic-button`,"aria-label":e.label,title:e.label,onClick:()=>e.onOpen(e.topic),children:`?`})}var Pi=(0,I.lazy)(()=>n(()=>import(`./DashboardEmbeddingSection-ChF63KXJ.js`).then(e=>({default:e.DashboardEmbeddingSection})),[])),R=[{value:`ko`,label:`한국어 (ko)`},{value:`en`,label:`English (en)`},{value:`zh`,label:`中文 (zh)`},{value:`ja`,label:`日本語 (ja)`}];function z(e){return R.find(t=>t.value===e)?.value??`ko`}var Fi={ko:{ariaLabel:`대시보드 설정`,eyebrow:`매니저 환경설정`,title:`대시보드 설정`,displayTitle:`인스턴스 목록 표시`,displayDescription:`이 설정은 왼쪽 인스턴스 목록과 저장된 매니저 UI 환경설정에만 적용됩니다.`,activityTitle:`미리보기와 활동`,activityDescription:`최근 작업 제목은 각 인스턴스 서버의 endpoint 버전에 따라 달라집니다.`,embeddingTitle:`임베딩 검색`,embeddingDescription:`벡터 임베딩 provider를 설정하고 메모리 인덱스를 관리합니다.`,fields:{activity:{label:`최근 작업 미리보기`,scope:`왼쪽 인스턴스 목록`,description:`요약 endpoint를 지원하는 인스턴스에서 최신 user 또는 assistant 메시지를 정리한 한 줄을 표시합니다.`},rename:{label:`이름 변경 컨트롤`,scope:`왼쪽 인스턴스 목록`,description:`대시보드 전용 인스턴스 이름을 편집하는 연필 버튼을 표시합니다.`},runtime:{label:`런타임 줄`,scope:`왼쪽 인스턴스 목록`,description:`각 인스턴스 이름 아래에 codex / gpt-5.5 같은 CLI와 모델 정보를 표시합니다.`},actions:{label:`확장 행 액션`,scope:`선택된 인스턴스 행`,description:`선택된 인스턴스 행에 Preview, Open, Start, Stop, Restart 버튼을 표시합니다.`},language:{label:`언어`,scope:`전체 Jaw UI`,description:`i18n을 지원하는 매니저 대시보드 화면에 사용할 언어를 저장합니다.`},shortcuts:{label:`전역 단축키`,scope:`Manager dashboard`,description:`입력창과 에디터 바깥에서만 작동하는 Manager 이동 단축키를 켭니다.`},shortcutFocusInstances:{label:`인스턴스 목록`,scope:`단축키`,description:`Instances workspace로 이동합니다.`},shortcutFocusActiveSession:{label:`활성 세션`,scope:`단축키`,description:`선택된 인스턴스의 Preview 탭으로 이동합니다.`},shortcutFocusNotes:{label:`노트`,scope:`단축키`,description:`Notes workspace로 이동합니다.`},shortcutPreviousInstance:{label:`이전 인스턴스`,scope:`단축키`,description:`현재 필터 목록에서 이전 인스턴스를 선택합니다.`},shortcutNextInstance:{label:`다음 인스턴스`,scope:`단축키`,description:`현재 필터 목록에서 다음 인스턴스를 선택합니다.`}},support:{ariaLabel:`작업 제목 출처 준비 상태`,ready:`준비됨`,legacy:`레거시 endpoint`,offline:`오프라인`,empty:`현재 표시할 인스턴스가 없습니다.`,restart:`최근 작업 제목을 사용하려면 레거시 인스턴스를 재시작하세요.`}},en:{ariaLabel:`Dashboard settings`,eyebrow:`Manager preferences`,title:`Dashboard settings`,displayTitle:`Instance list display`,displayDescription:`These controls only affect the left instance list and saved manager UI preferences.`,activityTitle:`Preview & activity`,activityDescription:`Latest activity titles depend on each instance server endpoint version.`,embeddingTitle:`Embedding search`,embeddingDescription:`Configure a vector embedding provider and manage the memory index.`,fields:{activity:{label:`Recent activity preview`,scope:`Left instance list`,description:`Show one cleaned line from the latest user or assistant message when the instance supports the summary endpoint.`},rename:{label:`Rename control`,scope:`Left instance list`,description:`Show the pencil button for editing the dashboard-only instance label.`},runtime:{label:`Runtime line`,scope:`Left instance list`,description:`Show CLI and model text, for example codex / gpt-5.5, under each instance label.`},actions:{label:`Expanded row actions`,scope:`Selected instance row`,description:`Show Preview, Open, Start, Stop, and Restart buttons on the selected instance row.`},language:{label:`Language`,scope:`Global Jaw UI`,description:`Sets the saved manager dashboard locale for i18n-aware surfaces.`},shortcuts:{label:`Global shortcuts`,scope:`Manager dashboard`,description:`Enable Manager navigation shortcuts outside inputs and editors.`},shortcutFocusInstances:{label:`Instance list`,scope:`Shortcut`,description:`Move to the Instances workspace.`},shortcutFocusActiveSession:{label:`Active session`,scope:`Shortcut`,description:`Move to the selected instance Preview tab.`},shortcutFocusNotes:{label:`Notes`,scope:`Shortcut`,description:`Move to the Notes workspace.`},shortcutPreviousInstance:{label:`Previous instance`,scope:`Shortcut`,description:`Select the previous instance in the current filtered list.`},shortcutNextInstance:{label:`Next instance`,scope:`Shortcut`,description:`Select the next instance in the current filtered list.`}},support:{ariaLabel:`Activity title source readiness`,ready:`Ready`,legacy:`Legacy endpoint`,offline:`Offline`,empty:`No instances are currently visible.`,restart:`Restart legacy instances to enable latest activity titles.`}},zh:{ariaLabel:`仪表盘设置`,eyebrow:`管理器偏好`,title:`仪表盘设置`,displayTitle:`实例列表显示`,displayDescription:`这些设置只影响左侧实例列表与已保存的管理器界面偏好。`,activityTitle:`预览与活动`,activityDescription:`最近活动标题取决于各实例服务器的 endpoint 版本。`,embeddingTitle:`嵌入搜索`,embeddingDescription:`向量嵌入 Provider 设置与内存索引管理。`,fields:{activity:{label:`最近活动预览`,scope:`左侧实例列表`,description:`当实例支持摘要 endpoint 时,显示最近一条 user 或 assistant 消息整理后的单行内容。`},rename:{label:`重命名控件`,scope:`左侧实例列表`,description:`显示用于编辑仪表盘内实例标签的铅笔按钮。`},runtime:{label:`运行时信息行`,scope:`左侧实例列表`,description:`在每个实例标签下方显示 CLI 与模型信息,例如 codex / gpt-5.5。`},actions:{label:`展开行操作`,scope:`已选中的实例行`,description:`在已选中的实例行上显示 Preview、Open、Start、Stop、Restart 按钮。`},language:{label:`语言`,scope:`整个 Jaw 界面`,description:`为支持 i18n 的管理器仪表盘界面设置已保存的语言。`},shortcuts:{label:`全局快捷键`,scope:`Manager dashboard`,description:`在输入框和编辑器外启用 Manager 导航快捷键。`},shortcutFocusInstances:{label:`实例列表`,scope:`快捷键`,description:`切换到 Instances 工作区。`},shortcutFocusActiveSession:{label:`活动会话`,scope:`快捷键`,description:`切换到已选实例的 Preview 标签。`},shortcutFocusNotes:{label:`Notes`,scope:`快捷键`,description:`切换到 Notes 工作区。`},shortcutPreviousInstance:{label:`上一个实例`,scope:`快捷键`,description:`选择当前筛选列表中的上一个实例。`},shortcutNextInstance:{label:`下一个实例`,scope:`快捷键`,description:`选择当前筛选列表中的下一个实例。`}},support:{ariaLabel:`活动标题来源就绪状态`,ready:`就绪`,legacy:`旧版 endpoint`,offline:`离线`,empty:`当前没有可显示的实例。`,restart:`请重启旧版实例以启用最近活动标题。`}},ja:{ariaLabel:`ダッシュボード設定`,eyebrow:`マネージャー環境設定`,title:`ダッシュボード設定`,displayTitle:`インスタンス一覧の表示`,displayDescription:`これらの設定は左側のインスタンス一覧と保存済みのマネージャー UI 設定にのみ反映されます。`,activityTitle:`プレビューとアクティビティ`,activityDescription:`最近のアクティビティタイトルは各インスタンスサーバーの endpoint バージョンによって変わります。`,embeddingTitle:`エンベディング検索`,embeddingDescription:`ベクトルエンベディング Provider の設定とメモリインデックスの管理。`,fields:{activity:{label:`最近のアクティビティのプレビュー`,scope:`左側のインスタンス一覧`,description:`サマリ endpoint をサポートするインスタンスでは、直近の user または assistant メッセージを整形した 1 行を表示します。`},rename:{label:`名前変更コントロール`,scope:`左側のインスタンス一覧`,description:`ダッシュボード専用のインスタンス表示名を編集する鉛筆ボタンを表示します。`},runtime:{label:`ランタイム行`,scope:`左側のインスタンス一覧`,description:`各インスタンス名の下に codex / gpt-5.5 のような CLI とモデル情報を表示します。`},actions:{label:`展開行アクション`,scope:`選択中のインスタンス行`,description:`選択中のインスタンス行に Preview、Open、Start、Stop、Restart のボタンを表示します。`},language:{label:`言語`,scope:`Jaw UI 全体`,description:`i18n 対応のマネージャーダッシュボード画面で使用する言語を保存します。`},shortcuts:{label:`グローバルショートカット`,scope:`Manager dashboard`,description:`入力欄とエディタ外で Manager ナビゲーションショートカットを有効にします。`},shortcutFocusInstances:{label:`インスタンス一覧`,scope:`ショートカット`,description:`Instances ワークスペースへ移動します。`},shortcutFocusActiveSession:{label:`アクティブセッション`,scope:`ショートカット`,description:`選択中インスタンスの Preview タブへ移動します。`},shortcutFocusNotes:{label:`Notes`,scope:`ショートカット`,description:`Notes ワークスペースへ移動します。`},shortcutPreviousInstance:{label:`前のインスタンス`,scope:`ショートカット`,description:`現在のフィルタ一覧で前のインスタンスを選択します。`},shortcutNextInstance:{label:`次のインスタンス`,scope:`ショートカット`,description:`現在のフィルタ一覧で次のインスタンスを選択します。`}},support:{ariaLabel:`アクティビティタイトル取得元の準備状態`,ready:`準備完了`,legacy:`旧 endpoint`,offline:`オフライン`,empty:`現在表示できるインスタンスはありません。`,restart:`最新のアクティビティタイトルを使うには、旧バージョンのインスタンスを再起動してください。`}}};function Ii(e){return(0,L.jsxs)(`div`,{className:`dashboard-settings-row`,children:[(0,L.jsxs)(`div`,{className:`dashboard-settings-row-main`,children:[(0,L.jsxs)(`label`,{className:`dashboard-settings-row-heading`,htmlFor:e.id,children:[(0,L.jsx)(`span`,{children:e.label}),(0,L.jsx)(`span`,{className:`dashboard-settings-row-scope`,children:e.scope})]}),(0,L.jsx)(`p`,{className:`dashboard-settings-row-description`,children:e.description})]}),(0,L.jsx)(`div`,{className:`dashboard-settings-row-control`,children:e.children})]})}function Li(e){return(0,L.jsx)(Ii,{id:e.id,label:e.label,scope:e.scope,description:e.description,children:(0,L.jsx)(`input`,{id:e.id,className:`dashboard-settings-toggle`,type:`checkbox`,checked:e.value,onChange:t=>e.onChange(t.currentTarget.checked)})})}function Ri(e){return(0,L.jsx)(Ii,{id:e.id,label:e.label,scope:e.scope,description:e.description,children:(0,L.jsx)(`select`,{id:e.id,className:`dashboard-settings-select`,value:e.value,onChange:t=>e.onChange(z(t.currentTarget.value)),children:e.options.map(e=>(0,L.jsx)(`option`,{value:e.value,children:e.label},e.value))})})}function zi(e){return(0,L.jsx)(Ii,{id:`dashboard-shortcut-${e.action}`,label:e.label,scope:e.scope,description:e.description,children:(0,L.jsx)(`input`,{id:`dashboard-shortcut-${e.action}`,className:`dashboard-settings-shortcut-input`,type:`text`,value:e.value,"aria-label":`${e.label} shortcut`,placeholder:`Alt+I`,onChange:t=>e.onChange(e.action,t.currentTarget.value)})})}function Bi(e){return e===`focusInstances`?`shortcutFocusInstances`:e===`focusActiveSession`?`shortcutFocusActiveSession`:e===`focusNotes`?`shortcutFocusNotes`:e===`previousInstance`?`shortcutPreviousInstance`:`shortcutNextInstance`}function Vi({support:e,locale:t}){let n=e.ready+e.legacy+e.offline,r=Fi[t].support;return(0,L.jsxs)(`div`,{className:`dashboard-settings-status-grid`,"aria-label":r.ariaLabel,children:[(0,L.jsxs)(`div`,{children:[(0,L.jsx)(`span`,{children:r.ready}),(0,L.jsx)(`strong`,{children:e.ready})]}),(0,L.jsxs)(`div`,{children:[(0,L.jsx)(`span`,{children:r.legacy}),(0,L.jsx)(`strong`,{children:e.legacy})]}),(0,L.jsxs)(`div`,{children:[(0,L.jsx)(`span`,{children:r.offline}),(0,L.jsx)(`strong`,{children:e.offline})]}),(0,L.jsx)(`p`,{children:n===0?r.empty:r.restart})]})}function Hi(e){let t=z(e.ui.locale),n=Fi[t];(0,I.useEffect)(()=>{document.documentElement.lang=t},[t]);function r(t,n){e.onUiPatch({dashboardShortcutKeymap:{...e.ui.dashboardShortcutKeymap,[t]:n}})}return(0,L.jsxs)(`main`,{className:`dashboard-settings-workspace`,"aria-label":n.ariaLabel,children:[(0,L.jsxs)(`header`,{className:`dashboard-settings-header`,children:[(0,L.jsxs)(`div`,{children:[(0,L.jsx)(`span`,{className:`eyebrow`,children:n.eyebrow}),(0,L.jsx)(`h2`,{children:n.title})]}),(0,L.jsx)(Ni,{topic:`settings`,label:`Open Settings help`,onOpen:e.onOpenHelpTopic})]}),e.activeSection===`display`?(0,L.jsxs)(`section`,{className:`dashboard-settings-section`,children:[(0,L.jsxs)(`header`,{children:[(0,L.jsx)(`h3`,{children:n.displayTitle}),(0,L.jsx)(`p`,{children:n.displayDescription})]}),(0,L.jsxs)(`div`,{className:`dashboard-settings-field-list`,children:[(0,L.jsx)(Li,{id:`dashboard-show-activity-title`,label:n.fields.activity.label,scope:n.fields.activity.scope,value:e.ui.showLatestActivityTitles,description:n.fields.activity.description,onChange:t=>e.onUiPatch({showLatestActivityTitles:t})}),(0,L.jsx)(Li,{id:`dashboard-show-label-editor`,label:n.fields.rename.label,scope:n.fields.rename.scope,value:e.ui.showInlineLabelEditor,description:n.fields.rename.description,onChange:t=>e.onUiPatch({showInlineLabelEditor:t})}),(0,L.jsx)(Li,{id:`dashboard-show-runtime-line`,label:n.fields.runtime.label,scope:n.fields.runtime.scope,value:e.ui.showSidebarRuntimeLine,description:n.fields.runtime.description,onChange:t=>e.onUiPatch({showSidebarRuntimeLine:t})}),(0,L.jsx)(Li,{id:`dashboard-show-row-actions`,label:n.fields.actions.label,scope:n.fields.actions.scope,value:e.ui.showSelectedRowActions,description:n.fields.actions.description,onChange:t=>e.onUiPatch({showSelectedRowActions:t})}),(0,L.jsx)(Ri,{id:`dashboard-locale`,label:n.fields.language.label,scope:n.fields.language.scope,value:t,options:R,description:n.fields.language.description,onChange:t=>e.onUiPatch({locale:t})}),(0,L.jsx)(Li,{id:`dashboard-shortcuts-enabled`,label:n.fields.shortcuts.label,scope:n.fields.shortcuts.scope,value:e.ui.dashboardShortcutsEnabled,description:n.fields.shortcuts.description,onChange:t=>e.onUiPatch({dashboardShortcutsEnabled:t})}),Hn.map(t=>{let i=n.fields[Bi(t)];return(0,L.jsx)(zi,{action:t,label:i.label,scope:i.scope,value:e.ui.dashboardShortcutKeymap[t],description:`${i.description} Current: ${Zn(e.ui.dashboardShortcutKeymap[t])}`,onChange:r},t)})]})]}):e.activeSection===`activity`?(0,L.jsxs)(`section`,{className:`dashboard-settings-section`,children:[(0,L.jsxs)(`header`,{children:[(0,L.jsx)(`h3`,{children:n.activityTitle}),(0,L.jsx)(`p`,{children:n.activityDescription})]}),(0,L.jsx)(Vi,{support:e.titleSupport,locale:t})]}):e.activeSection===`developer`?(0,L.jsx)(Mi,{locale:t,ui:e.ui,onUiPatch:e.onUiPatch}):(0,L.jsxs)(`section`,{className:`dashboard-settings-section`,children:[(0,L.jsxs)(`header`,{children:[(0,L.jsx)(`h3`,{children:n.embeddingTitle}),(0,L.jsx)(`p`,{children:n.embeddingDescription})]}),(0,L.jsx)(I.Suspense,{fallback:(0,L.jsx)(`p`,{children:`Loading...`}),children:(0,L.jsx)(Pi,{})})]})]})}var Ui=/\{\{(\w+)\}\}/g;function Wi(){let e=new Date,t=e=>String(e).padStart(2,`0`),n=e.getFullYear(),r=t(e.getMonth()+1),i=t(e.getDate()),a=t(e.getHours()),o=t(e.getMinutes());return{date:`${n}-${r}-${i}`,time:`${a}:${o}`,year:String(n),month:r,day:i}}function Gi(e,t={}){let n={...Wi(),...t};return e.replace(Ui,(e,t)=>Object.hasOwn(n,t)?n[t]:e)}function Ki({expanded:e}){return(0,L.jsx)(`svg`,{viewBox:`0 0 16 16`,"aria-hidden":`true`,className:`notes-tree-chevron`,children:(0,L.jsx)(`path`,{d:e?`M4 6l4 4 4-4`:`M6 4l4 4-4 4`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.8`,strokeLinecap:`round`,strokeLinejoin:`round`})})}function qi({open:e}){return(0,L.jsxs)(`svg`,{viewBox:`0 0 18 18`,"aria-hidden":`true`,className:`notes-tree-icon`,children:[(0,L.jsx)(`path`,{d:`M2.5 5.2h5.1l1.2 1.5h6.7v6.7a1.4 1.4 0 0 1-1.4 1.4H3.9a1.4 1.4 0 0 1-1.4-1.4V5.2Z`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.5`,strokeLinejoin:`round`}),(0,L.jsx)(`path`,{d:e?`M2.8 7.1h12.7`:`M2.8 5.2h4.8`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.5`,strokeLinecap:`round`})]})}function Ji(){return(0,L.jsxs)(`svg`,{viewBox:`0 0 18 18`,"aria-hidden":`true`,className:`notes-tree-icon`,children:[(0,L.jsx)(`path`,{d:`M5 2.8h5.2L13.5 6v9.2H5V2.8Z`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.5`,strokeLinejoin:`round`}),(0,L.jsx)(`path`,{d:`M10.2 2.8V6h3.3M6.9 9h4.4M6.9 11.5h3.3`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.5`,strokeLinecap:`round`})]})}function Yi(){return(0,L.jsxs)(`svg`,{viewBox:`0 0 18 18`,"aria-hidden":`true`,className:`notes-tree-action-icon`,children:[(0,L.jsx)(`path`,{d:`M5 2.8h5.2L13.5 6v9.2H5V2.8Z`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.5`,strokeLinejoin:`round`}),(0,L.jsx)(`path`,{d:`M9.2 8.1v4.2M7.1 10.2h4.2`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.5`,strokeLinecap:`round`})]})}function Xi(){return(0,L.jsxs)(`svg`,{viewBox:`0 0 18 18`,"aria-hidden":`true`,className:`notes-tree-action-icon`,children:[(0,L.jsx)(`path`,{d:`M2.5 5.2h5.1l1.2 1.5h6.7v6.7a1.4 1.4 0 0 1-1.4 1.4H3.9a1.4 1.4 0 0 1-1.4-1.4V5.2Z`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.5`,strokeLinejoin:`round`}),(0,L.jsx)(`path`,{d:`M9 8.3v4M7 10.3h4`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.5`,strokeLinecap:`round`})]})}function Zi(){return(0,L.jsxs)(`svg`,{viewBox:`0 0 18 18`,"aria-hidden":`true`,className:`notes-tree-action-icon`,children:[(0,L.jsx)(`path`,{d:`M14.2 6.3A5.5 5.5 0 0 0 4 5.2L3 6.6M3.8 11.7A5.5 5.5 0 0 0 14 12.8l1-1.4`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.5`,strokeLinecap:`round`,strokeLinejoin:`round`}),(0,L.jsx)(`path`,{d:`M3 3.5v3.1h3.1M15 14.5v-3.1h-3.1`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.5`,strokeLinecap:`round`,strokeLinejoin:`round`})]})}function Qi(){return(0,L.jsxs)(`svg`,{viewBox:`0 0 18 18`,"aria-hidden":`true`,className:`notes-tree-action-icon`,children:[(0,L.jsx)(`path`,{d:`M4 12.8 3.5 15l2.2-.5 7.7-7.7-1.7-1.7L4 12.8Z`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.5`,strokeLinecap:`round`,strokeLinejoin:`round`}),(0,L.jsx)(`path`,{d:`m10.9 5.9 1.7 1.7`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.5`,strokeLinecap:`round`})]})}function $i(e){return e.dataTransfer.getData(`application/x-cli-jaw-note-path`)||e.dataTransfer.getData(`text/plain`)||null}function ea(e){return Array.from(e.dataTransfer.types).some(e=>e===`application/x-cli-jaw-note-path`||e===`text/plain`)}function ta(e,t){let n=[];for(let r of e)n.push(r.path),r.kind===`folder`&&t.has(r.path)&&r.children&&n.push(...ta(r.children,t));return n}function na(e,t){for(let n of e)t.set(n.path,n.kind),n.kind===`folder`&&n.children&&na(n.children,t)}function ra(e,t){let n=[];for(let r of e){let e=t.get(r);e&&n.push({path:r,kind:e})}return n}function ia(e){if(!(e instanceof HTMLElement))return!1;let t=e.tagName.toLowerCase();return e.isContentEditable||t===`input`||t===`textarea`||t===`select`}function aa(e,t,n){let r=e.indexOf(t),i=e.indexOf(n);if(r===-1||i===-1)return new Set([n]);let a=Math.min(r,i),o=Math.max(r,i);return new Set(e.slice(a,o+1))}function oa(e,t,n){if(e.key===`F2`){e.preventDefault(),n.onRenamePath(t.path,t.kind);return}if(e.key===`Delete`||e.key===`Backspace`){if(e.preventDefault(),n.multiSelected.size>1&&n.multiSelected.has(t.path)){let e=ra(n.multiSelected,n.pathKindLookup);e.length>0&&n.onTrashPaths(e);return}n.onTrashPath(t.path,t.kind);return}if(e.key===`Enter`){if(e.preventDefault(),t.kind===`folder`){n.onSelectFolder?.(t.path),n.toggleFolder?.(t.path);return}n.onSelectPath(t.path)}}function sa(e,t,n,r,i,a,o,s,c){let l=e.path===t.selectedPath,u=o.has(e.path);if(e.kind===`folder`){let l=n.has(e.path),d=e.path===t.selectedFolderPath,f=e.children||[];return(0,L.jsxs)(`li`,{className:`notes-tree-folder`,children:[(0,L.jsxs)(`div`,{className:`notes-tree-folder-row ${d?`is-folder-selected`:``} ${i===e.path?`is-drop-target`:``} ${u?`is-multi-selected`:``}`,children:[(0,L.jsxs)(`button`,{type:`button`,className:`notes-tree-folder-button`,"aria-expanded":l,draggable:!0,onDragStart:t=>{t.dataTransfer.effectAllowed=`move`,t.dataTransfer.setData(`application/x-cli-jaw-note-path`,e.path),t.dataTransfer.setData(`text/plain`,e.path)},onClick:n=>{if(n.shiftKey||n.metaKey||n.ctrlKey){c(e.path,n);return}c(e.path,n),t.onSelectFolder(e.path),r(e.path)},onDragOver:t=>{t.preventDefault(),t.stopPropagation(),a(e.path)},onDragLeave:e=>{e.stopPropagation(),a(null)},onDrop:n=>{n.preventDefault(),n.stopPropagation();let r=$i(n);a(null),r&&r!==e.path&&!e.path.startsWith(`${r}/`)&&t.onMovePath(r,e.path)},onKeyDown:n=>{if(n.key===`ArrowRight`&&!l){n.preventDefault(),r(e.path);return}if(n.key===`ArrowLeft`&&l){n.preventDefault(),r(e.path);return}oa(n,e,{toggleFolder:r,onSelectPath:t.onSelectPath,onSelectFolder:t.onSelectFolder,onRenamePath:t.onRenamePath,onTrashPath:t.onTrashPath,onTrashPaths:t.onTrashPaths,multiSelected:o,pathKindLookup:s})},children:[(0,L.jsx)(Ki,{expanded:l}),(0,L.jsx)(qi,{open:l}),(0,L.jsx)(`span`,{children:e.name})]}),(0,L.jsx)(`button`,{type:`button`,className:`notes-tree-inline-action`,title:`Rename folder`,"aria-label":`Rename folder ${e.name}`,onClick:n=>{n.stopPropagation(),t.onRenamePath(e.path,e.kind)},children:(0,L.jsx)(Qi,{})})]}),l&&f.length>0&&(0,L.jsx)(`ul`,{children:f.map(e=>sa(e,t,n,r,i,a,o,s,c))})]},e.path)}let d=e.path===t.dirtyPath,f=e.path===t.highlightedPath;return(0,L.jsx)(`li`,{children:(0,L.jsxs)(`div`,{className:`notes-tree-file-row ${l?`is-selected`:``} ${d?`is-dirty`:``} ${u?`is-multi-selected`:``} ${f?`is-highlighted`:``}`,children:[(0,L.jsxs)(`button`,{type:`button`,className:`notes-tree-file-button`,"aria-current":l?`page`:void 0,draggable:!0,onDragStart:t=>{t.dataTransfer.effectAllowed=`move`,t.dataTransfer.setData(`application/x-cli-jaw-note-path`,e.path),t.dataTransfer.setData(`text/plain`,e.path)},onClick:n=>{if(n.shiftKey||n.metaKey||n.ctrlKey){c(e.path,n);return}c(e.path,n),t.onSelectPath(e.path)},onKeyDown:n=>oa(n,e,{onSelectPath:t.onSelectPath,onRenamePath:t.onRenamePath,onTrashPath:t.onTrashPath,onTrashPaths:t.onTrashPaths,multiSelected:o,pathKindLookup:s}),children:[(0,L.jsx)(Ji,{}),(0,L.jsx)(`span`,{children:e.name}),d&&(0,L.jsx)(`span`,{className:`notes-tree-dirty-dot`,"aria-label":`Unsaved changes`})]}),(0,L.jsx)(`button`,{type:`button`,className:`notes-tree-inline-action`,title:`Rename`,"aria-label":`Rename ${e.name}`,onClick:n=>{n.stopPropagation(),t.onRenamePath(e.path,e.kind)},children:(0,L.jsx)(Qi,{})})]})},e.path)}function ca(e){let[t,n]=(0,I.useState)(()=>new Set),[r,i]=(0,I.useState)(null),[a,o]=(0,I.useState)(()=>new Set),[s,c]=(0,I.useState)(null),[l,u]=(0,I.useState)(null);(0,I.useEffect)(()=>{let t=e.externalFocusPath??e.highlightedPath;if(!t)return;let r=t.split(`/`).filter(Boolean);if(r.length<=1)return;let i=[];for(let e=1;e<r.length;e++)i.push(r.slice(0,e).join(`/`));n(e=>{let t=new Set(e);for(let e of i)t.add(e);return t})},[e.externalFocusPath,e.highlightedPath]);function d(e){n(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})}let f=ta(e.entries,t),p=(0,I.useMemo)(()=>{let t=new Map;return na(e.entries,t),t},[e.entries]);function m(){if(a.size===0)return;let t=ra(a,p);t.length!==0&&e.onTrashPaths(t)}let h=(0,I.useCallback)((t,n)=>{u(t),n.shiftKey&&s?o(aa(f,s,t)):n.metaKey||n.ctrlKey?(o(n=>{let r=new Set(n);return r.size===0&&e.selectedPath&&r.add(e.selectedPath),r.has(t)?r.delete(t):r.add(t),r}),c(t)):(a.size>0&&o(new Set),c(t))},[s,f,a.size,e.selectedPath]);return(0,I.useEffect)(()=>{e.selectedPath&&c(e.selectedPath)},[e.selectedPath]),(0,I.useEffect)(()=>{l&&!p.has(l)&&u(null),a.size!==0&&o(e=>{let t=!1,n=new Set;for(let r of e)p.has(r)?n.add(r):t=!0;return t?n:e})},[l,a.size,p]),(0,I.useEffect)(()=>{function t(t){if(!(t.metaKey||t.ctrlKey)||!t.shiftKey||t.key.toLowerCase()!==`c`||ia(t.target))return;let n=e.notesRoot;if(!n)return;let r=a.size>0?Array.from(a):l&&p.has(l)?[l]:e.selectedPath?[e.selectedPath]:[];r.length!==0&&(t.preventDefault(),de(r.map(e=>`${n}/${e}`).join(`
11
- `)).then(e=>{e.ok||console.error(`[notes:path-copy]`,e.error)}))}return window.addEventListener(`keydown`,t),()=>window.removeEventListener(`keydown`,t)},[l,a,p,e.selectedPath,e.notesRoot]),(0,I.useEffect)(()=>{function t(t){if(t.defaultPrevented||!(t.metaKey||t.ctrlKey)||t.key!==`Delete`&&t.key!==`Backspace`||ia(t.target))return;let n=a.size>0?ra(a,p):e.selectedFolderPath&&p.get(e.selectedFolderPath)===`folder`?[{path:e.selectedFolderPath,kind:`folder`}]:e.selectedPath&&p.get(e.selectedPath)===`file`?[{path:e.selectedPath,kind:`file`}]:[];n.length!==0&&(t.preventDefault(),n.length>1?e.onTrashPaths(n):e.onTrashPath(n[0].path,n[0].kind))}return window.addEventListener(`keydown`,t),()=>window.removeEventListener(`keydown`,t)},[a,p,e]),(0,L.jsxs)(`div`,{className:`notes-tree-body ${r===null?`is-root-drop-target`:``}`,onDragOver:e=>{ea(e)&&(e.preventDefault(),i(null))},onDrop:t=>{let n=$i(t);n&&(t.preventDefault(),e.onMovePath(n,null))},children:[a.size>0&&(0,L.jsxs)(`div`,{className:`notes-tree-selection-info`,children:[a.size,` selected`,(0,L.jsx)(`button`,{type:`button`,className:`notes-tree-selection-delete`,onClick:m,disabled:a.size===0,children:`Delete`}),(0,L.jsx)(`button`,{type:`button`,className:`notes-tree-clear-selection`,onClick:()=>o(new Set),children:`Clear`})]}),e.loading&&(0,L.jsx)(`div`,{className:`notes-tree-state`,children:`Loading notes...`}),!e.loading&&e.entries.length===0&&(0,L.jsx)(`div`,{className:`notes-tree-state`,children:`No notes or folders`}),!e.loading&&e.entries.length>0&&(0,L.jsx)(`ul`,{className:`notes-tree-list`,children:e.entries.map(n=>sa(n,e,t,d,r,i,a,p,h))})]})}var la=2,ua=275,da=20;function fa(e){return e instanceof DOMException&&e.name===`AbortError`}function pa(e){let[t,n]=(0,I.useState)(``),[r,i]=(0,I.useState)([]),[a,o]=(0,I.useState)(!1),[s,c]=(0,I.useState)(null),l=(0,I.useRef)(null),d=(0,I.useRef)(null),f=(0,I.useRef)(null),p=(0,I.useCallback)(()=>{d.current&&clearTimeout(d.current),d.current=null,f.current?.abort(),f.current=null},[]);(0,I.useEffect)(()=>{l.current?.focus()},[e.focusToken]),(0,I.useEffect)(()=>()=>p(),[p]);let m=(0,I.useCallback)(e=>{let t=e.trim();if(p(),c(null),t.length<la){i([]),o(!1);return}let n=new AbortController;f.current=n,o(!0),u(t,{limit:da,signal:n.signal}).then(e=>{n.signal.aborted||i(e)}).catch(e=>{n.signal.aborted||fa(e)||(i([]),c(e.message||`Search failed`))}).finally(()=>{n.signal.aborted||o(!1)})},[p]);function h(e){n(e),d.current&&clearTimeout(d.current),d.current=setTimeout(()=>m(e),ua)}function g(t){t.key===`Escape`&&(t.preventDefault(),e.onModeChange(`files`))}return(0,L.jsxs)(`section`,{className:`notes-search-sidebar`,"aria-label":`Search notes`,onKeyDown:g,children:[(0,L.jsx)(`div`,{className:`notes-search-sidebar-header`,children:(0,L.jsx)(`input`,{ref:l,className:`notes-search-input`,type:`search`,placeholder:`Search notes`,value:t,onChange:e=>h(e.currentTarget.value),"aria-label":`Search notes`})}),(0,L.jsxs)(`div`,{className:`notes-search-sidebar-results`,"aria-live":`polite`,children:[a&&(0,L.jsx)(`div`,{className:`notes-search-loading`,children:`Searching...`}),s&&(0,L.jsx)(`div`,{className:`notes-search-error`,children:s}),!s&&r.map(t=>(0,L.jsxs)(`button`,{type:`button`,className:`notes-search-result`,onClick:()=>e.onSelect(t.path),children:[(0,L.jsx)(`span`,{className:`notes-search-result-path`,children:t.path}),(0,L.jsx)(`span`,{className:`notes-search-result-line`,children:t.kind===`path`?`Path match`:`Line ${t.line}`}),(0,L.jsx)(`span`,{className:`notes-search-result-context`,children:t.context})]},`${t.kind}:${t.path}:${t.line}:${t.context}`)),!a&&!s&&t.trim().length>=la&&r.length===0&&(0,L.jsx)(`div`,{className:`notes-search-empty`,children:`No results`})]})]})}var ma=(0,I.createContext)(null);function ha(e){let[t,n]=(0,I.useState)(()=>new Map),r=(0,I.useCallback)(e=>{let t=new Map(e.map(e=>[e.id,e]));return n(t=>{let n=new Map(t);for(let t of e){let e=n.get(t.id);e&&e!==t&&console.warn(`[notes-command-palette] duplicate command id: ${t.id}`),n.set(t.id,t)}return n}),()=>{n(e=>{let n=new Map(e);for(let[e,r]of t)n.get(e)===r&&n.delete(e);return n})}},[]),i=(0,I.useMemo)(()=>[...t.values()].sort((e,t)=>{let n=e.section.localeCompare(t.section);return n===0?e.label.localeCompare(t.label):n}),[t]),a=(0,I.useMemo)(()=>({commands:i,register:r}),[i,r]);return(0,L.jsx)(ma.Provider,{value:a,children:e.children})}function ga(){let e=(0,I.useContext)(ma);if(!e)throw Error(`useNoteCommands must be used inside NotesCommandProvider`);return e.commands}function _a(e,t=!0){let n=(0,I.useContext)(ma);if(!n)throw Error(`useRegisterNoteCommands must be used inside NotesCommandProvider`);let r=n.register;(0,I.useEffect)(()=>{if(!(!t||e.length===0))return r(e)},[t,e,r])}var va=new EventTarget,ya=`dashboard:invalidate`;function ba(e){va.dispatchEvent(new CustomEvent(ya,{detail:e}))}function xa(e,t,n){function r(r){let i=r.detail;i.topics.includes(e)&&(n&&i.sourceId===n||t(i))}return va.addEventListener(ya,r),()=>va.removeEventListener(ya,r)}function Sa(e,t){let n=e.split(`/`).filter(Boolean),r=n[n.length-1];return r?t?`${t}/${r}`:r:e}function Ca(e){let t=e.split(`/`).filter(Boolean);return t[t.length-1]||e}function wa(e){let t=e.split(`/`).filter(Boolean);return t.length<=1?null:t.slice(0,-1).join(`/`)}function Ta(e,t,n){let r=n===`file`&&!t.endsWith(`.md`)?`${t}.md`:t;if(r.includes(`/`))return r;let i=wa(e);return i?`${i}/${r}`:r}function Ea(e,t,n){return e?e===t?n:e.startsWith(`${t}/`)?`${n}/${e.slice(t.length+1)}`:e:null}function Da(e,t){return t?t===e||t.startsWith(`${e}/`):!1}function Oa(e,t,n){return n?t===`folder`?Da(e,n):n===e:!1}function ka(e,t,n){let r=t===`folder`?`Move folder "${e}" and all child notes to trash?`:`Move note "${e}" to trash?`;return n?`${r}\n\nThere are unsaved changes inside this target.`:r}function Aa(e,t){let n=e.filter(e=>e.kind===`file`).length,r=e.length-n,i=[];r>0&&i.push(`${r} folder${r===1?``:`s`}`),n>0&&i.push(`${n} note${n===1?``:`s`}`);let a=`Move ${i.length>0?i.join(` + `):`${e.length} items`} to trash?`;return t?`${a}\n\nThere are unsaved changes inside this selection.`:a}function ja(){return(0,L.jsxs)(`svg`,{viewBox:`0 0 18 18`,"aria-hidden":`true`,className:`notes-tree-action-icon`,children:[(0,L.jsx)(`path`,{d:`M7.8 3.2a4.6 4.6 0 1 1 0 9.2 4.6 4.6 0 0 1 0-9.2Z`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.5`}),(0,L.jsx)(`path`,{d:`m11.3 11.3 3.2 3.2`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.5`,strokeLinecap:`round`})]})}function Ma(e,t){return e.some(e=>e.kind===`file`&&e.name===t)}function Na(e){let t={"--notes-tree-width":`${e.treeWidth}px`},[n,r]=(0,I.useState)(null),[i,a]=(0,I.useState)(null),[o,s]=(0,I.useState)(null),[c,l]=(0,I.useState)([]),[u,d]=(0,I.useState)(`pending`),[f,m]=(0,I.useState)(null);(0,I.useEffect)(()=>{x().then(e=>{l(e),d(`ok`)}).catch(()=>{d(`error`)})},[]);async function h(){let t=new Date,n=e=>String(e).padStart(2,`0`),i=`${t.getFullYear()}-${n(t.getMonth()+1)}-${n(t.getDate())}.md`;if(Ma(e.tree,i)){e.onSelectedPathChange(i),r(null);return}if(u===`pending`){r(`Templates are still loading. Please try again.`);return}if(u===`error`){r(`Template list failed to load. Cannot determine daily template.`);return}try{a(null),r(null);let t=c.find(e=>e.name===`daily`),n=``;if(t)try{n=Gi((await b(t.name)).content,{title:i.replace(/\.md$/,``)})}catch{r(`Daily template failed to load. Note was not created.`);return}let o=await re(i,n);e.onSelectedPathChange(o.path),await e.onRefreshTree(o.path),ba({topics:[`notes`],reason:`note:created`,source:`ui`,sourceId:`notes-sidebar`})}catch(t){if(t instanceof ae&&t.status===409&&t.code===`note_path_exists`){r(null),e.onSelectedPathChange(i),await e.onRefreshTree(i);return}r(t.message)}}async function g(){if(u===`pending`){r(`Templates are still loading. Please try again.`);return}if(u===`error`){r(`Template list failed to load. Cannot offer template picker.`);return}let e=o?`${o}/untitled.md`:`untitled.md`,t=window.prompt(`Note path`,e);if(!t)return;let n=t.endsWith(`.md`)?t:`${t}.md`;if(c.length>0){m(n);return}await _(n,null)}async function _(t,n){m(null);let i=``;if(n)try{let e=await b(n),r=(t.endsWith(`.md`)?t.slice(0,-3):t).split(`/`).pop()??``;i=Gi(e.content,{title:r})}catch{r(`Template "${n}" failed to load. Note was not created.`);return}try{a(null),r(null);let n=await re(t,i);e.onSelectedPathChange(n.path),await e.onRefreshTree(n.path),ba({topics:[`notes`],reason:`note:created`,source:`ui`,sourceId:`notes-sidebar`})}catch(e){r(e.message)}}(0,I.useEffect)(()=>{function e(e){!e.altKey||e.metaKey||e.ctrlKey||e.shiftKey||e.key.toLowerCase()!==`n`||(e.preventDefault(),g())}return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)});async function y(){let t=o?`${o}/new-folder`:`new-folder`,n=window.prompt(`Folder path`,t);if(n)try{a(null),s((await te(n)).path),await e.onRefreshTree(),ba({topics:[`notes`],reason:`folder:created`,source:`ui`,sourceId:`notes-sidebar`})}catch(e){r(e.message)}}async function S(t,n){let i=Sa(t,n);if(t!==i)try{a(null);let n=await v(t,i);e.selectedPath===t&&e.onSelectedPathChange(n.to),await e.onRefreshTree(n.to),ba({topics:[`notes`],reason:`note:moved`,source:`ui`,sourceId:`notes-sidebar`})}catch(e){r(e.message)}}async function ee(t,n){let i=n===`folder`?`Rename folder`:`Rename note`,c=window.prompt(i,Ca(t));if(!c)return;let l=Ta(t,c,n);if(l!==t)try{a(null);let n=await v(t,l),r=Ea(e.selectedPath,n.from,n.to),i=Ea(o,n.from,n.to);i!==o&&s(i),r!==e.selectedPath&&e.onSelectedPathChange(r),await e.onRefreshTree(r),ba({topics:[`notes`],reason:`note:renamed`,source:`ui`,sourceId:`notes-sidebar`})}catch(e){r(e.message)}}async function C(t){if(t.length===0)return;if(t.length===1){await w(t[0].path,t[0].kind);return}let n=t.some(t=>Oa(t.path,t.kind,e.dirtyPath));if(!window.confirm(Aa(t,n)))return;a(null);let i=0,c=!1,l=!1,u=null;for(let n of t)try{await p(n.path,n.kind),i+=1,c||(n.kind===`folder`?Da(n.path,e.selectedPath):e.selectedPath===n.path)&&(c=!0),!l&&n.kind===`folder`&&Da(n.path,o)&&(l=!0)}catch(e){u=`Failed at ${n.path}: ${e.message}`;break}c&&e.onSelectedPathChange(null),l&&s(null),u?(r(u),a(i>0?`Moved ${i} of ${t.length} to trash before stopping.`:null)):a(`Moved ${i} item${i===1?``:`s`} to trash.`),await e.onRefreshTree(c?null:e.selectedPath),ba({topics:[`notes`],reason:`notes:batch-trashed`,source:`ui`,sourceId:`notes-sidebar`})}async function w(t,n){let i=Oa(t,n,e.dirtyPath);if(window.confirm(ka(t,n,i)))try{a(null);let r=await p(t,n),i=n===`folder`?Da(t,e.selectedPath):e.selectedPath===t,c=n===`folder`?Da(t,o):!1;i&&e.onSelectedPathChange(null),c&&s(null);let l=r.deletedTo===`os-trash`?`OS trash`:`dashboard trash`,u=r.deletedTo===`dashboard-trash`&&r.restoreHint?` Restore from: ${r.restoreHint}`:``;a(`Moved ${r.path} to ${l}.${u}`),await e.onRefreshTree(i?null:e.selectedPath),ba({topics:[`notes`],reason:`note:trashed`,source:`ui`,sourceId:`notes-sidebar`})}catch(e){r(e.message)}}let T=u===`pending`?`Templates are still loading`:u===`error`?`Templates failed to load`:void 0;return _a((0,I.useMemo)(()=>[{id:`sidebar:new-note`,section:`Create`,label:`New note`,shortcut:`Alt+N`,keywords:[`create`,`file`],disabled:u!==`ok`,disabledReason:T,run:()=>void g()},{id:`sidebar:new-folder`,section:`Create`,label:`New folder`,keywords:[`directory`],run:()=>void y()},{id:`sidebar:today`,section:`Create`,label:`Open today`,keywords:[`daily`,`journal`],disabled:u!==`ok`,disabledReason:T,run:()=>void h()},{id:`sidebar:search`,section:`Navigate`,label:`Search notes`,shortcut:`Cmd+Shift+F`,run:e.onOpenSearch},{id:`sidebar:refresh`,section:`File`,label:`Refresh notes`,disabled:e.loading,disabledReason:`Refresh already running`,run:()=>void e.onRefreshTree()},{id:`sidebar:clear-tag-filter`,section:`Navigate`,label:`Clear tag filter`,disabled:!e.tagFilter,disabledReason:`No active tag filter`,run:e.onClearTagFilter}],[e.loading,e.onClearTagFilter,e.onOpenSearch,e.onRefreshTree,e.onSelectedPathChange,e.selectedPath,e.tagFilter,e.tree,o,T,c,u])),(0,L.jsxs)(`aside`,{className:`notes-tree`,style:t,children:[(e.error||n)&&(0,L.jsx)(`section`,{className:`state error-state`,children:e.error||n}),i&&(0,L.jsx)(`section`,{className:`state notes-status-state`,children:i}),(0,L.jsxs)(`div`,{className:`notes-tree-header`,children:[(0,L.jsx)(`strong`,{children:`Notes`}),(0,L.jsxs)(`div`,{className:`notes-tree-actions`,children:[(0,L.jsx)(`button`,{type:`button`,className:e.mode===`search`?`is-active`:``,onClick:()=>{e.mode===`search`?e.onModeChange(`files`):e.onOpenSearch()},title:`Search notes`,"aria-label":`Search notes`,"aria-pressed":e.mode===`search`,children:(0,L.jsx)(ja,{})}),(0,L.jsx)(`button`,{type:`button`,onClick:()=>void g(),title:`New note`,"aria-label":`New note`,children:(0,L.jsx)(Yi,{})}),(0,L.jsx)(`button`,{type:`button`,onClick:()=>void y(),title:`New folder`,"aria-label":`New folder`,children:(0,L.jsx)(Xi,{})}),(0,L.jsx)(`button`,{type:`button`,onClick:()=>void e.onRefreshTree(),disabled:e.loading,title:`Refresh notes`,"aria-label":`Refresh notes`,children:(0,L.jsx)(Zi,{})})]})]}),e.mode===`files`?(0,L.jsxs)(L.Fragment,{children:[e.tagFilter&&(0,L.jsxs)(`div`,{className:`notes-tag-filter-banner`,role:`status`,children:[(0,L.jsxs)(`span`,{className:`notes-tag-filter-banner-meta`,children:[(0,L.jsxs)(`span`,{children:[`Tag: #`,e.tagFilter]}),e.selectedHiddenByFilter&&(0,L.jsx)(`span`,{className:`notes-tag-filter-banner-hint`,children:`Selected note hidden by filter`})]}),(0,L.jsx)(`button`,{type:`button`,className:`notes-tag-filter-clear`,onClick:e.onClearTagFilter,children:`Clear`})]}),f&&(0,L.jsxs)(`div`,{className:`notes-template-picker`,children:[(0,L.jsxs)(`div`,{className:`notes-template-picker-label`,children:[`Template for `,Ca(f)]}),(0,L.jsxs)(`div`,{className:`notes-template-picker-options`,children:[(0,L.jsx)(`button`,{type:`button`,className:`notes-template-picker-option`,onClick:()=>void _(f,null),children:`Blank`}),c.map(e=>(0,L.jsx)(`button`,{type:`button`,className:`notes-template-picker-option`,onClick:()=>void _(f,e.name),children:e.name},e.name))]}),(0,L.jsx)(`button`,{type:`button`,className:`notes-template-picker-cancel`,onClick:()=>m(null),children:`Cancel`})]}),(0,L.jsx)(`div`,{className:`notes-today-bar`,children:(0,L.jsx)(`button`,{type:`button`,className:`notes-today-button`,onClick:()=>void h(),children:`Today`})}),(0,L.jsx)(ca,{entries:e.tree,selectedPath:e.selectedPath,selectedFolderPath:o,dirtyPath:e.dirtyPath,highlightedPath:e.highlightedPath??null,externalFocusPath:e.externalFocusPath??null,loading:e.loading,notesRoot:e.notesRoot,onSelectPath:e.onSelectedPathChange,onSelectFolder:s,onMovePath:(e,t)=>void S(e,t),onRenamePath:(e,t)=>void ee(e,t),onTrashPath:(e,t)=>void w(e,t),onTrashPaths:e=>void C(e)})]}):(0,L.jsx)(pa,{focusToken:e.searchFocusToken,onSelect:e.onSelectedPathChange,onModeChange:e.onModeChange})]})}var Pa=[`default`,`sepia`,`nord`,`solarized-dark`];function Fa(){let[e,t]=(0,I.useState)([]),[n,r]=(0,I.useState)(null),[i,a]=(0,I.useState)(!0);(0,I.useEffect)(()=>{oe().then(e=>{t(e.snippets),r(e.activeTheme),a(!1)}).catch(()=>a(!1))},[]);async function o(e){let t=e===`default`?null:e;r(t),await h(t)}async function s(e,n){t(t=>t.map(t=>t.name===e?{...t,enabled:n}:t)),await d(e,n)}return i?(0,L.jsx)(`div`,{className:`notes-theme-loading`,children:`Loading theme settings...`}):(0,L.jsxs)(`div`,{className:`notes-theme-settings`,children:[(0,L.jsxs)(`fieldset`,{className:`notes-theme-fieldset`,children:[(0,L.jsx)(`legend`,{children:`Theme`}),(0,L.jsx)(`select`,{value:n??`default`,onChange:e=>void o(e.target.value),children:Pa.map(e=>(0,L.jsx)(`option`,{value:e,children:e},e))})]}),e.length>0&&(0,L.jsxs)(`fieldset`,{className:`notes-theme-fieldset`,children:[(0,L.jsx)(`legend`,{children:`CSS Snippets`}),(0,L.jsx)(`div`,{className:`notes-theme-warning`,children:`CSS snippets run trusted local code.`}),e.map(e=>(0,L.jsxs)(`label`,{className:`notes-snippet-toggle`,children:[(0,L.jsx)(`input`,{type:`checkbox`,checked:e.enabled,onChange:t=>void s(e.name,t.target.checked)}),e.name]},e.name))]})]})}function Ia(){let[e,t]=(0,I.useState)(null),[n,r]=(0,I.useState)([]),[i,a]=(0,I.useState)(new Map);(0,I.useEffect)(()=>{oe().then(e=>{t(e.activeTheme),r(e.snippets.filter(e=>e.enabled).map(e=>e.name))})},[]),(0,I.useEffect)(()=>{for(let e of n)i.has(e)||C(e).then(t=>{a(n=>new Map(n).set(e,t))})},[n]),(0,I.useEffect)(()=>{let t=document.documentElement;return e?t.setAttribute(`data-notes-theme`,e):t.removeAttribute(`data-notes-theme`),()=>t.removeAttribute(`data-notes-theme`)},[e]);let o=n.map(e=>i.get(e)).filter(e=>!!e).join(`
12
- `);return o?(0,L.jsx)(`style`,{dangerouslySetInnerHTML:{__html:o}}):null}function La(){return La=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},La.apply(null,arguments)}function Ra(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var za=class{constructor(e,t,n){this.from=e,this.to=t,this.diagnostic=n}},Ba=class e{constructor(e,t,n){this.diagnostics=e,this.panel=t,this.selected=n}static init(t,n,r){let i=r.facet(eo).markerFilter;i&&(t=i(t,r));let a=t.slice().sort((e,t)=>e.from-t.from||e.to-t.to),o=new ye,s=[],c=0,l=r.doc.iter(),u=0,d=r.doc.length;for(let e=0;;){let t=e==a.length?null:a[e];if(!t&&!s.length)break;let n,r;if(s.length)n=c,r=s.reduce((e,t)=>Math.min(e,t.to),t&&t.from>n?t.from:1e8);else{if(n=t.from,n>d)break;r=t.to,s.push(t),e++}for(;e<a.length;){let t=a[e];if(t.from==n&&(t.to>t.from||t.to==n))s.push(t),e++,r=Math.min(t.to,r);else{r=Math.min(t.from,r);break}}r=Math.min(r,d);let i=!1;if(s.some(e=>e.from==n&&(e.to==r||r==d))&&(i=n==r,!i&&r-n<10)){let e=n-(u+l.value.length);e>0&&(l.next(e),u=n);for(let e=n;;){if(e>=r){i=!0;break}if(!l.lineBreak&&u+l.value.length>e)break;e=u+l.value.length,u+=l.value.length,l.next()}}let f=fo(s);if(i)o.add(n,n,Le.widget({widget:new io(f),diagnostics:s.slice()}));else{let e=s.reduce((e,t)=>t.markClass?e+` `+t.markClass:e,``);o.add(n,r,Le.mark({class:`cm-lintRange cm-lintRange-`+f+e,diagnostics:s.slice(),inclusiveEnd:s.some(e=>e.to>r)}))}if(c=r,c==d)break;for(let e=0;e<s.length;e++)s[e].to<=c&&s.splice(e--,1)}let f=o.finish();return new e(f,n,Va(f))}};function Va(e,t=null,n=0){let r=null;return e.between(n,1e9,(e,n,{spec:i})=>{if(!(t&&i.diagnostics.indexOf(t)<0))if(!r)r=new za(e,n,t||i.diagnostics[0]);else if(i.diagnostics.indexOf(r.diagnostic)<0)return!1;else r=new za(r.from,n,r.diagnostic)}),r}function Ha(e,t){let n=t.pos,r=t.end||n,i=e.state.facet(eo).hideOn(e,n,r);if(i!=null)return i;let a=e.startState.doc.lineAt(t.pos);return!!(e.effects.some(e=>e.is(Wa))||e.changes.touchesRange(a.from,Math.max(a.to,r)))}function Ua(e,t){return e.field(qa,!1)?t:t.concat(pe.appendConfig.of(po))}var Wa=pe.define(),Ga=pe.define(),Ka=pe.define(),qa=je.define({create(){return new Ba(Le.none,null,null)},update(e,t){if(t.docChanged&&e.diagnostics.size){let n=e.diagnostics.map(t.changes),r=null,i=e.panel;if(e.selected){let i=t.changes.mapPos(e.selected.from,1);r=Va(n,e.selected.diagnostic,i)||Va(n,null,i)}!n.size&&i&&t.state.facet(eo).autoPanel&&(i=null),e=new Ba(n,i,r)}for(let n of t.effects)if(n.is(Wa)){let r=t.state.facet(eo).autoPanel?n.value.length?oo.open:null:e.panel;e=Ba.init(n.value,r,t.state)}else n.is(Ga)?e=new Ba(e.diagnostics,n.value?oo.open:null,e.selected):n.is(Ka)&&(e=new Ba(e.diagnostics,e.panel,n.value));return e},provide:e=>[ke.from(e,e=>e.panel),Se.decorations.from(e,e=>e.diagnostics)]}),Ja=Le.mark({class:`cm-lintRange cm-lintRange-active`});function Ya(e,t,n){let{diagnostics:r}=e.state.field(qa),i,a=-1,o=-1;r.between(t-+(n<0),t+ +(n>0),(e,r,{spec:s})=>{if(t>=e&&t<=r&&(e==r||(t>e||n>0)&&(t<r||n<0)))return i=s.diagnostics,a=e,o=r,!1});let s=e.state.facet(eo).tooltipFilter;return i&&s&&(i=s(i,e.state)),i?{pos:a,end:o,above:e.state.doc.lineAt(a).to<o,create(){return{dom:Xa(e,i)}}}:null}function Xa(e,t){return we(`ul`,{class:`cm-tooltip-lint`},t.map(t=>ro(e,t,!1)))}var Za=e=>{let t=e.state.field(qa,!1);(!t||!t.panel)&&e.dispatch({effects:Ua(e.state,[Ga.of(!0)])});let n=Pe(e,oo.open);return n&&n.dom.querySelector(`.cm-panel-lint ul`).focus(),!0},Qa=e=>{let t=e.state.field(qa,!1);return!t||!t.panel?!1:(e.dispatch({effects:Ga.of(!1)}),!0)},$a=[{key:`Mod-Shift-m`,run:Za,preventDefault:!0},{key:`F8`,run:e=>{let t=e.state.field(qa,!1);if(!t)return!1;let n=e.state.selection.main,r=Va(t.diagnostics,null,n.to+1);return!r&&(r=Va(t.diagnostics,null,0),!r||r.from==n.from&&r.to==n.to)?!1:(e.dispatch({selection:{anchor:r.from,head:r.to},scrollIntoView:!0}),!0)}}],eo=He.define({combine(e){return{sources:e.map(e=>e.source).filter(e=>e!=null),..._e(e.map(e=>e.config),{delay:750,markerFilter:null,tooltipFilter:null,needsRefresh:null,hideOn:()=>null},{delay:Math.max,markerFilter:to,tooltipFilter:to,needsRefresh:(e,t)=>e?t?n=>e(n)||t(n):e:t,hideOn:(e,t)=>e?t?(n,r,i)=>e(n,r,i)||t(n,r,i):e:t,autoPanel:(e,t)=>e||t})}}});function to(e,t){return e?t?(n,r)=>t(e(n,r),r):e:t}function no(e){let t=[];if(e)actions:for(let{name:n}of e){for(let e=0;e<n.length;e++){let r=n[e];if(/[a-zA-Z]/.test(r)&&!t.some(e=>e.toLowerCase()==r.toLowerCase())){t.push(r);continue actions}}t.push(``)}return t}function ro(e,t,n){let r=n?no(t.actions):[];return we(`li`,{class:`cm-diagnostic cm-diagnostic-`+t.severity},we(`span`,{class:`cm-diagnosticText`},t.renderMessage?t.renderMessage(e):t.message),t.actions?.map((n,i)=>{let a=!1,o=r=>{if(r.preventDefault(),a)return;a=!0;let i=Va(e.state.field(qa).diagnostics,t);i&&n.apply(e,i.from,i.to)},{name:s}=n,c=r[i]?s.indexOf(r[i]):-1,l=c<0?s:[s.slice(0,c),we(`u`,s.slice(c,c+1)),s.slice(c+1)];return we(`button`,{type:`button`,class:`cm-diagnosticAction`+(n.markClass?` `+n.markClass:``),onclick:o,onmousedown:o,"aria-label":` Action: ${s}${c<0?``:` (access key "${r[i]})"`}.`},l)}),t.source&&we(`div`,{class:`cm-diagnosticSource`},t.source))}var io=class extends Ce{constructor(e){super(),this.sev=e}eq(e){return e.sev==this.sev}toDOM(){return we(`span`,{class:`cm-lintPoint cm-lintPoint-`+this.sev})}},ao=class{constructor(e,t){this.diagnostic=t,this.id=`item_`+Math.floor(Math.random()*4294967295).toString(16),this.dom=ro(e,t,!0),this.dom.id=this.id,this.dom.setAttribute(`role`,`option`)}},oo=class e{constructor(e){this.view=e,this.items=[],this.list=we(`ul`,{tabIndex:0,role:`listbox`,"aria-label":this.view.state.phrase(`Diagnostics`),onkeydown:t=>{if(!(t.ctrlKey||t.altKey||t.metaKey)){if(t.keyCode==27)Qa(this.view),this.view.focus();else if(t.keyCode==38||t.keyCode==33)this.moveSelection((this.selectedIndex-1+this.items.length)%this.items.length);else if(t.keyCode==40||t.keyCode==34)this.moveSelection((this.selectedIndex+1)%this.items.length);else if(t.keyCode==36)this.moveSelection(0);else if(t.keyCode==35)this.moveSelection(this.items.length-1);else if(t.keyCode==13)this.view.focus();else if(t.keyCode>=65&&t.keyCode<=90&&this.selectedIndex>=0){let{diagnostic:n}=this.items[this.selectedIndex],r=no(n.actions);for(let i=0;i<r.length;i++)if(r[i].toUpperCase().charCodeAt(0)==t.keyCode){let t=Va(this.view.state.field(qa).diagnostics,n);t&&n.actions[i].apply(e,t.from,t.to)}}else return;t.preventDefault()}},onclick:e=>{for(let t=0;t<this.items.length;t++)this.items[t].dom.contains(e.target)&&this.moveSelection(t)}}),this.dom=we(`div`,{class:`cm-panel-lint`},this.list,we(`button`,{type:`button`,name:`close`,"aria-label":this.view.state.phrase(`close`),onclick:()=>Qa(this.view)},`×`)),this.update()}get selectedIndex(){let e=this.view.state.field(qa).selected;if(!e)return-1;for(let t=0;t<this.items.length;t++)if(this.items[t].diagnostic==e.diagnostic)return t;return-1}update(){let{diagnostics:e,selected:t}=this.view.state.field(qa),n=0,r=!1,i=null,a=new Set;for(e.between(0,this.view.state.doc.length,(e,o,{spec:s})=>{for(let e of s.diagnostics){if(a.has(e))continue;a.add(e);let o=-1,s;for(let t=n;t<this.items.length;t++)if(this.items[t].diagnostic==e){o=t;break}o<0?(s=new ao(this.view,e),this.items.splice(n,0,s),r=!0):(s=this.items[o],o>n&&(this.items.splice(n,o-n),r=!0)),t&&s.diagnostic==t.diagnostic?s.dom.hasAttribute(`aria-selected`)||(s.dom.setAttribute(`aria-selected`,`true`),i=s):s.dom.hasAttribute(`aria-selected`)&&s.dom.removeAttribute(`aria-selected`),n++}});n<this.items.length&&!(this.items.length==1&&this.items[0].diagnostic.from<0);)r=!0,this.items.pop();this.items.length==0&&(this.items.push(new ao(this.view,{from:-1,to:-1,severity:`info`,message:this.view.state.phrase(`No diagnostics`)})),r=!0),i?(this.list.setAttribute(`aria-activedescendant`,i.id),this.view.requestMeasure({key:this,read:()=>({sel:i.dom.getBoundingClientRect(),panel:this.list.getBoundingClientRect()}),write:({sel:e,panel:t})=>{let n=t.height/this.list.offsetHeight;e.top<t.top?this.list.scrollTop-=(t.top-e.top)/n:e.bottom>t.bottom&&(this.list.scrollTop+=(e.bottom-t.bottom)/n)}})):this.selectedIndex<0&&this.list.removeAttribute(`aria-activedescendant`),r&&this.sync()}sync(){let e=this.list.firstChild;function t(){let t=e;e=t.nextSibling,t.remove()}for(let n of this.items)if(n.dom.parentNode==this.list){for(;e!=n.dom;)t();e=n.dom.nextSibling}else this.list.insertBefore(n.dom,e);for(;e;)t()}moveSelection(e){if(this.selectedIndex<0)return;let t=Va(this.view.state.field(qa).diagnostics,this.items[e].diagnostic);t&&this.view.dispatch({selection:{anchor:t.from,head:t.to},scrollIntoView:!0,effects:Ka.of(t)})}static open(t){return new e(t)}};function so(e,t=`viewBox="0 0 40 40"`){return`url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" ${t}>${encodeURIComponent(e)}</svg>')`}function co(e){return so(`<path d="m0 2.5 l2 -1.5 l1 0 l2 1.5 l1 0" stroke="${e}" fill="none" stroke-width=".7"/>`,`width="6" height="3"`)}var lo=Se.baseTheme({".cm-diagnostic":{padding:`3px 6px 3px 8px`,marginLeft:`-1px`,display:`block`,whiteSpace:`pre-wrap`},".cm-diagnostic-error":{borderLeft:`5px solid #d11`},".cm-diagnostic-warning":{borderLeft:`5px solid orange`},".cm-diagnostic-info":{borderLeft:`5px solid #999`},".cm-diagnostic-hint":{borderLeft:`5px solid #66d`},".cm-diagnosticAction":{font:`inherit`,border:`none`,padding:`2px 4px`,backgroundColor:`#444`,color:`white`,borderRadius:`3px`,marginLeft:`8px`,cursor:`pointer`},".cm-diagnosticSource":{fontSize:`70%`,opacity:.7},".cm-lintRange":{backgroundPosition:`left bottom`,backgroundRepeat:`repeat-x`,paddingBottom:`0.7px`},".cm-lintRange-error":{backgroundImage:co(`#d11`)},".cm-lintRange-warning":{backgroundImage:co(`orange`)},".cm-lintRange-info":{backgroundImage:co(`#999`)},".cm-lintRange-hint":{backgroundImage:co(`#66d`)},".cm-lintRange-active":{backgroundColor:`#ffdd9980`},".cm-tooltip-lint":{padding:0,margin:0},".cm-lintPoint":{position:`relative`,"&:after":{content:`""`,position:`absolute`,bottom:0,left:`-2px`,borderLeft:`3px solid transparent`,borderRight:`3px solid transparent`,borderBottom:`4px solid #d11`}},".cm-lintPoint-warning":{"&:after":{borderBottomColor:`orange`}},".cm-lintPoint-info":{"&:after":{borderBottomColor:`#999`}},".cm-lintPoint-hint":{"&:after":{borderBottomColor:`#66d`}},".cm-panel.cm-panel-lint":{position:`relative`,"& ul":{maxHeight:`100px`,overflowY:`auto`,"& [aria-selected]":{backgroundColor:`#ddd`,"& u":{textDecoration:`underline`}},"&:focus [aria-selected]":{background_fallback:`#bdf`,backgroundColor:`Highlight`,color_fallback:`white`,color:`HighlightText`},"& u":{textDecoration:`none`},padding:0,margin:0},"& [name=close]":{position:`absolute`,top:`0`,right:`2px`,background:`inherit`,border:`none`,font:`inherit`,padding:0,margin:0}},"&dark .cm-lintRange-active":{backgroundColor:`#86714a80`},"&dark .cm-panel.cm-panel-lint ul":{"& [aria-selected]":{backgroundColor:`#2e343e`}}});function uo(e){return e==`error`?4:e==`warning`?3:e==`info`?2:1}function fo(e){let t=`hint`,n=1;for(let r of e){let e=uo(r.severity);e>n&&(n=e,t=r.severity)}return t}var po=[qa,Se.decorations.compute([qa],e=>{let{selected:t,panel:n}=e.field(qa);return!t||!n||t.from==t.to?Le.none:Le.set([Ja.range(t.from,t.to)])}),Re(Ya,{hideOn:Ha}),lo],B=function(e){e===void 0&&(e={});var{crosshairCursor:t=!1}=e,n=[];e.closeBracketsKeymap!==!1&&(n=n.concat(Qe)),e.defaultKeymap!==!1&&(n=n.concat(Xe)),e.searchKeymap!==!1&&(n=n.concat(Je)),e.historyKeymap!==!1&&(n=n.concat(Ke)),e.foldKeymap!==!1&&(n=n.concat(Ue)),e.completionKeymap!==!1&&(n=n.concat(tt)),e.lintKeymap!==!1&&(n=n.concat($a));var r=[];return e.lineNumbers!==!1&&r.push(Ne()),e.highlightActiveLineGutter!==!1&&r.push(N()),e.highlightSpecialChars!==!1&&r.push(Ie()),e.history!==!1&&r.push(Ge()),e.foldGutter!==!1&&r.push(We()),e.drawSelection!==!1&&r.push(fe()),e.dropCursor!==!1&&r.push(P()),e.allowMultipleSelections!==!1&&r.push(me.allowMultipleSelections.of(!0)),e.indentOnInput!==!1&&r.push(he()),e.syntaxHighlighting!==!1&&r.push(ve(F,{fallback:!0})),e.bracketMatching!==!1&&r.push(Be()),e.closeBrackets!==!1&&r.push(nt()),e.autocompletion!==!1&&r.push(et()),e.rectangularSelection!==!1&&r.push(Oe()),t!==!1&&r.push(be()),e.highlightActiveLine!==!1&&r.push(Ae()),e.highlightSelectionMatches!==!1&&r.push(Ye()),e.tabSize&&typeof e.tabSize==`number`&&r.push(Me.of(` `.repeat(e.tabSize))),r.concat([Ee.of(n.flat())]).filter(Boolean)},V=`#e5c07b`,mo=`#e06c75`,ho=`#56b6c2`,go=`#ffffff`,_o=`#abb2bf`,vo=`#7d8799`,yo=`#61afef`,bo=`#98c379`,xo=`#d19a66`,H=`#c678dd`,So=`#21252b`,Co=`#2c313a`,wo=`#282c34`,To=`#353a42`,Eo=`#3E4451`,Do=`#528bff`,Oo=[Se.theme({"&":{color:_o,backgroundColor:wo},".cm-content":{caretColor:Do},".cm-cursor, .cm-dropCursor":{borderLeftColor:Do},"&.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection":{backgroundColor:Eo},".cm-panels":{backgroundColor:So,color:_o},".cm-panels.cm-panels-top":{borderBottom:`2px solid black`},".cm-panels.cm-panels-bottom":{borderTop:`2px solid black`},".cm-searchMatch":{backgroundColor:`#72a1ff59`,outline:`1px solid #457dff`},".cm-searchMatch.cm-searchMatch-selected":{backgroundColor:`#6199ff2f`},".cm-activeLine":{backgroundColor:`#6699ff0b`},".cm-selectionMatch":{backgroundColor:`#aafe661a`},"&.cm-focused .cm-matchingBracket, &.cm-focused .cm-nonmatchingBracket":{backgroundColor:`#bad0f847`},".cm-gutters":{backgroundColor:wo,color:vo,border:`none`},".cm-activeLineGutter":{backgroundColor:Co},".cm-foldPlaceholder":{backgroundColor:`transparent`,border:`none`,color:`#ddd`},".cm-tooltip":{border:`none`,backgroundColor:To},".cm-tooltip .cm-tooltip-arrow:before":{borderTopColor:`transparent`,borderBottomColor:`transparent`},".cm-tooltip .cm-tooltip-arrow:after":{borderTopColor:To,borderBottomColor:To},".cm-tooltip-autocomplete":{"& > ul > li[aria-selected]":{backgroundColor:Co,color:_o}}},{dark:!0}),ve(ze.define([{tag:j.keyword,color:H},{tag:[j.name,j.deleted,j.character,j.propertyName,j.macroName],color:mo},{tag:[j.function(j.variableName),j.labelName],color:yo},{tag:[j.color,j.constant(j.name),j.standard(j.name)],color:xo},{tag:[j.definition(j.name),j.separator],color:_o},{tag:[j.typeName,j.className,j.number,j.changed,j.annotation,j.modifier,j.self,j.namespace],color:V},{tag:[j.operator,j.operatorKeyword,j.url,j.escape,j.regexp,j.link,j.special(j.string)],color:ho},{tag:[j.meta,j.comment],color:vo},{tag:j.strong,fontWeight:`bold`},{tag:j.emphasis,fontStyle:`italic`},{tag:j.strikethrough,textDecoration:`line-through`},{tag:j.link,color:vo,textDecoration:`underline`},{tag:j.heading,fontWeight:`bold`,color:mo},{tag:[j.atom,j.bool,j.special(j.variableName)],color:xo},{tag:[j.processingInstruction,j.string,j.inserted],color:bo},{tag:j.invalid,color:go}]))],ko=Se.theme({"&":{backgroundColor:`#fff`}},{dark:!1}),Ao=function(e){e===void 0&&(e={});var{indentWithTab:t=!0,editable:n=!0,readOnly:r=!1,theme:i=`light`,placeholder:a=``,basicSetup:o=!0}=e,s=[];switch(t&&s.unshift(Ee.of([qe])),o&&(typeof o==`boolean`?s.unshift(B()):s.unshift(B(o))),a&&s.unshift(De(a)),i){case`light`:s.push(ko);break;case`dark`:s.push(Oo);break;case`none`:break;default:s.push(i);break}return n===!1&&s.push(Se.editable.of(!1)),r&&s.push(me.readOnly.of(!0)),[...s]},jo=e=>({line:e.state.doc.lineAt(e.state.selection.main.from),lineCount:e.state.doc.lines,lineBreak:e.state.lineBreak,length:e.state.doc.length,readOnly:e.state.readOnly,tabSize:e.state.tabSize,selection:e.state.selection,selectionAsSingle:e.state.selection.asSingle().main,ranges:e.state.selection.ranges,selectionCode:e.state.sliceDoc(e.state.selection.main.from,e.state.selection.main.to),selections:e.state.selection.ranges.map(t=>e.state.sliceDoc(t.from,t.to)),selectedText:e.state.selection.ranges.some(e=>!e.empty)}),Mo=class{constructor(e,t){this.timeLeftMS=void 0,this.timeoutMS=void 0,this.isCancelled=!1,this.isTimeExhausted=!1,this.callbacks=[],this.timeLeftMS=t,this.timeoutMS=t,this.callbacks.push(e)}tick(){if(!this.isCancelled&&!this.isTimeExhausted&&(this.timeLeftMS--,this.timeLeftMS<=0)){this.isTimeExhausted=!0;var e=this.callbacks.slice();this.callbacks.length=0,e.forEach(e=>{try{e()}catch(e){console.error(`TimeoutLatch callback error:`,e)}})}}cancel(){this.isCancelled=!0,this.callbacks.length=0}reset(){this.timeLeftMS=this.timeoutMS,this.isCancelled=!1,this.isTimeExhausted=!1}get isDone(){return this.isCancelled||this.isTimeExhausted}},No=class{constructor(){this.interval=null,this.latches=new Set}add(e){this.latches.add(e),this.start()}remove(e){this.latches.delete(e),this.latches.size===0&&this.stop()}start(){this.interval===null&&(this.interval=setInterval(()=>{this.latches.forEach(e=>{e.tick(),e.isDone&&this.remove(e)})},1))}stop(){this.interval!==null&&(clearInterval(this.interval),this.interval=null)}},Po=null,Fo=()=>typeof window>`u`?new No:(Po||=new No,Po),Io=Ve.define(),Lo=200,Ro=[];function zo(e){var{value:t,selection:n,onChange:r,onStatistics:i,onCreateEditor:a,onUpdate:o,extensions:s=Ro,autoFocus:c,theme:l=`light`,height:u=null,minHeight:d=null,maxHeight:f=null,width:p=null,minWidth:m=null,maxWidth:h=null,placeholder:g=``,editable:_=!0,readOnly:v=!1,indentWithTab:y=!0,basicSetup:b=!0,root:x,initialState:S}=e,[ee,te]=(0,I.useState)(),[C,w]=(0,I.useState)(),[T,ne]=(0,I.useState)(),E=(0,I.useState)(()=>({current:null}))[0],re=(0,I.useState)(()=>({current:null}))[0],ie=Se.theme({"&":{height:u,minHeight:d,maxHeight:f,width:p,minWidth:m,maxWidth:h},"& .cm-scroller":{height:`100% !important`}}),ae=[Se.updateListener.of(e=>{e.docChanged&&typeof r==`function`&&!e.transactions.some(e=>e.annotation(Io))&&(E.current?E.current.reset():(E.current=new Mo(()=>{if(re.current){var e=re.current;re.current=null,e()}E.current=null},Lo),Fo().add(E.current)),r(e.state.doc.toString(),e)),i&&i(jo(e))}),ie,...Ao({theme:l,editable:_,readOnly:v,placeholder:g,indentWithTab:y,basicSetup:b})];return o&&typeof o==`function`&&ae.push(Se.updateListener.of(o)),ae=ae.concat(s),(0,I.useLayoutEffect)(()=>{if(ee&&!T){var e={doc:t,selection:n,extensions:ae},r=S?me.fromJSON(S.json,e,S.fields):me.create(e);if(ne(r),!C){var i=new Se({state:r,parent:ee,root:x});w(i),a&&a(i,r)}}return()=>{C&&(ne(void 0),w(void 0))}},[ee,T]),(0,I.useEffect)(()=>{e.container&&te(e.container)},[e.container]),(0,I.useEffect)(()=>()=>{C&&(C.destroy(),w(void 0)),E.current&&=(E.current.cancel(),null)},[C]),(0,I.useEffect)(()=>{c&&C&&C.focus()},[c,C]),(0,I.useEffect)(()=>{C&&C.dispatch({effects:pe.reconfigure.of(ae)})},[l,s,u,d,f,p,m,h,g,_,v,y,b,r,o]),(0,I.useEffect)(()=>{if(t!==void 0){var e=C?C.state.doc.toString():``;if(C&&t!==e){var n=E.current&&!E.current.isDone,r=()=>{C&&t!==C.state.doc.toString()&&C.dispatch({changes:{from:0,to:C.state.doc.toString().length,insert:t||``},annotations:[Io.of(!0)]})};n?re.current=r:r()}}},[t,C]),{state:T,setState:ne,view:C,setView:w,container:ee,setContainer:te}}var Bo=[`className`,`value`,`selection`,`extensions`,`onChange`,`onStatistics`,`onCreateEditor`,`onUpdate`,`autoFocus`,`theme`,`height`,`minHeight`,`maxHeight`,`width`,`minWidth`,`maxWidth`,`basicSetup`,`placeholder`,`indentWithTab`,`editable`,`readOnly`,`root`,`initialState`],Vo=(0,I.forwardRef)((e,t)=>{var{className:n,value:r=``,selection:i,extensions:a=[],onChange:o,onStatistics:s,onCreateEditor:c,onUpdate:l,autoFocus:u,theme:d=`light`,height:f,minHeight:p,maxHeight:m,width:h,minWidth:g,maxWidth:_,basicSetup:v,placeholder:y,indentWithTab:b,editable:x,readOnly:S,root:ee,initialState:te}=e,C=Ra(e,Bo),w=(0,I.useRef)(null),{state:T,view:ne,container:E,setContainer:re}=zo({root:ee,value:r,autoFocus:u,theme:d,height:f,minHeight:p,maxHeight:m,width:h,minWidth:g,maxWidth:_,basicSetup:v,placeholder:y,indentWithTab:b,editable:x,readOnly:S,selection:i,onChange:o,onStatistics:s,onCreateEditor:c,onUpdate:l,extensions:a,initialState:te});(0,I.useImperativeHandle)(t,()=>({editor:w.current,state:T,view:ne}),[w,E,T,ne]);var ie=(0,I.useCallback)(e=>{w.current=e,re(e)},[re]);if(typeof r!=`string`)throw Error(`value must be typeof string but got `+typeof r);return(0,L.jsx)(`div`,La({ref:ie,className:(typeof d==`string`?`cm-theme-`+d:`cm-theme`)+(n?` `+n:``)},C))});Vo.displayName=`CodeMirror`;function U(e){return new Fe(Te.define(e))}function Ho(e){return n(()=>import(`./dist-SWkyI5gN.js`).then(t=>t.sql({dialect:t[e]})),[])}var Uo=[M.of({name:`C`,extensions:[`c`,`h`,`ino`],load(){return n(()=>import(`./dist-HtoUbUb4.js`).then(e=>e.cpp()),[])}}),M.of({name:`C++`,alias:[`cpp`],extensions:[`cpp`,`c++`,`cc`,`cxx`,`hpp`,`h++`,`hh`,`hxx`],load(){return n(()=>import(`./dist-HtoUbUb4.js`).then(e=>e.cpp()),[])}}),M.of({name:`CQL`,alias:[`cassandra`],extensions:[`cql`],load(){return Ho(`Cassandra`)}}),M.of({name:`CSS`,extensions:[`css`],load(){return n(()=>import(`./dist-B2d2NOJ3.js`).then(e=>e.css()),[])}}),M.of({name:`Go`,extensions:[`go`],load(){return n(()=>import(`./dist-H3yurMdo.js`).then(e=>e.go()),[])}}),M.of({name:`HTML`,alias:[`xhtml`],extensions:[`html`,`htm`,`handlebars`,`hbs`],load(){return n(()=>import(`./dist-D0mdXpwq.js`).then(e=>e.html()),[])}}),M.of({name:`Java`,extensions:[`java`],load(){return n(()=>import(`./dist-CuNACpdD.js`).then(e=>e.java()),[])}}),M.of({name:`JavaScript`,alias:[`ecmascript`,`js`,`node`],extensions:[`js`,`mjs`,`cjs`],load(){return n(()=>import(`./dist-D_ULP6ER.js`).then(e=>e.javascript()),[])}}),M.of({name:`Jinja`,extensions:[`j2`,`jinja`,`jinja2`],load(){return n(()=>import(`./dist-CU9b0vPA.js`).then(e=>e.jinja()),[])}}),M.of({name:`JSON`,alias:[`json5`],extensions:[`json`,`map`],load(){return n(()=>import(`./dist-DLSl_Nbu.js`).then(e=>e.json()),[])}}),M.of({name:`JSX`,extensions:[`jsx`],load(){return n(()=>import(`./dist-D_ULP6ER.js`).then(e=>e.javascript({jsx:!0})),[])}}),M.of({name:`LESS`,extensions:[`less`],load(){return n(()=>import(`./dist-BaazPVzw.js`).then(e=>e.less()),[])}}),M.of({name:`Liquid`,extensions:[`liquid`],load(){return n(()=>import(`./dist-Dgo6P711.js`).then(e=>e.liquid()),[])}}),M.of({name:`MariaDB SQL`,load(){return Ho(`MariaSQL`)}}),M.of({name:`Markdown`,extensions:[`md`,`markdown`,`mkd`],load(){return n(()=>import(`./dist-w85EQGWO.js`).then(e=>e.markdown()),[])}}),M.of({name:`MS SQL`,load(){return Ho(`MSSQL`)}}),M.of({name:`MySQL`,load(){return Ho(`MySQL`)}}),M.of({name:`PHP`,extensions:[`php`,`php3`,`php4`,`php5`,`php7`,`phtml`],load(){return n(()=>import(`./dist-CsK9fYYW.js`).then(e=>e.php()),[])}}),M.of({name:`PLSQL`,extensions:[`pls`],load(){return Ho(`PLSQL`)}}),M.of({name:`PostgreSQL`,load(){return Ho(`PostgreSQL`)}}),M.of({name:`Python`,extensions:[`BUILD`,`bzl`,`py`,`pyw`],filename:/^(BUCK|BUILD)$/,load(){return n(()=>import(`./dist-DtkJvqbT.js`).then(e=>e.python()),[])}}),M.of({name:`Rust`,extensions:[`rs`],load(){return n(()=>import(`./dist-DJ5byDHS2.js`).then(e=>e.rust()),[])}}),M.of({name:`Sass`,extensions:[`sass`],load(){return n(()=>import(`./dist-CzDHA1yv.js`).then(e=>e.sass({indented:!0})),[])}}),M.of({name:`SCSS`,extensions:[`scss`],load(){return n(()=>import(`./dist-CzDHA1yv.js`).then(e=>e.sass()),[])}}),M.of({name:`SQL`,extensions:[`sql`],load(){return Ho(`StandardSQL`)}}),M.of({name:`SQLite`,load(){return Ho(`SQLite`)}}),M.of({name:`TSX`,extensions:[`tsx`],load(){return n(()=>import(`./dist-D_ULP6ER.js`).then(e=>e.javascript({jsx:!0,typescript:!0})),[])}}),M.of({name:`TypeScript`,alias:[`ts`],extensions:[`ts`,`mts`,`cts`],load(){return n(()=>import(`./dist-D_ULP6ER.js`).then(e=>e.javascript({typescript:!0})),[])}}),M.of({name:`WebAssembly`,extensions:[`wat`,`wast`],load(){return n(()=>import(`./dist-CB1fgeSN.js`).then(e=>e.wast()),[])}}),M.of({name:`XML`,alias:[`rss`,`wsdl`,`xsd`],extensions:[`xml`,`xsl`,`xsd`,`svg`],load(){return n(()=>import(`./dist-BZh7LRrp.js`).then(e=>e.xml()),[])}}),M.of({name:`YAML`,alias:[`yml`],extensions:[`yaml`,`yml`],load(){return n(()=>import(`./dist-CG65f_qI.js`).then(e=>e.yaml()),[])}}),M.of({name:`APL`,extensions:[`dyalog`,`apl`],load(){return n(()=>import(`./apl-CQGZdmVU.js`).then(e=>U(e.apl)),[])}}),M.of({name:`PGP`,alias:[`asciiarmor`],extensions:[`asc`,`pgp`,`sig`],load(){return n(()=>import(`./asciiarmor-6rdc1JOx.js`).then(e=>U(e.asciiArmor)),[])}}),M.of({name:`ASN.1`,extensions:[`asn`,`asn1`],load(){return n(()=>import(`./asn1-D8iCH-On.js`).then(e=>U(e.asn1({}))),[])}}),M.of({name:`Asterisk`,filename:/^extensions\.conf$/i,load(){return n(()=>import(`./asterisk-ChqZLgq_.js`).then(e=>U(e.asterisk)),[])}}),M.of({name:`Brainfuck`,extensions:[`b`,`bf`],load(){return n(()=>import(`./brainfuck-CDmGO_27.js`).then(e=>U(e.brainfuck)),[])}}),M.of({name:`Cobol`,extensions:[`cob`,`cpy`],load(){return n(()=>import(`./cobol-Ck6DkJOz.js`).then(e=>U(e.cobol)),[])}}),M.of({name:`C#`,alias:[`csharp`,`cs`],extensions:[`cs`],load(){return n(()=>import(`./clike-CSGpadKW.js`).then(e=>U(e.csharp)),[])}}),M.of({name:`Clojure`,extensions:[`clj`,`cljc`,`cljx`],load(){return n(()=>import(`./clojure-CST35Ic-.js`).then(e=>U(e.clojure)),[])}}),M.of({name:`ClojureScript`,extensions:[`cljs`],load(){return n(()=>import(`./clojure-CST35Ic-.js`).then(e=>U(e.clojure)),[])}}),M.of({name:`Closure Stylesheets (GSS)`,extensions:[`gss`],load(){return n(()=>import(`./css-BLiiJuyL.js`).then(e=>U(e.gss)),[])}}),M.of({name:`CMake`,extensions:[`cmake`,`cmake.in`],filename:/^CMakeLists\.txt$/,load(){return n(()=>import(`./cmake-BVvLLL-M.js`).then(e=>U(e.cmake)),[])}}),M.of({name:`CoffeeScript`,alias:[`coffee`,`coffee-script`],extensions:[`coffee`],load(){return n(()=>import(`./coffeescript-D_Wxovbg.js`).then(e=>U(e.coffeeScript)),[])}}),M.of({name:`Common Lisp`,alias:[`lisp`],extensions:[`cl`,`lisp`,`el`],load(){return n(()=>import(`./commonlisp-B8ANOF1p.js`).then(e=>U(e.commonLisp)),[])}}),M.of({name:`Cypher`,extensions:[`cyp`,`cypher`],load(){return n(()=>import(`./cypher-BMqftmWo.js`).then(e=>U(e.cypher)),[])}}),M.of({name:`Cython`,extensions:[`pyx`,`pxd`,`pxi`],load(){return n(()=>import(`./python-txj4co98.js`).then(e=>U(e.cython)),[])}}),M.of({name:`Crystal`,extensions:[`cr`],load(){return n(()=>import(`./crystal-Daoo63FI.js`).then(e=>U(e.crystal)),[])}}),M.of({name:`D`,extensions:[`d`],load(){return n(()=>import(`./d-DOGkwbDi.js`).then(e=>U(e.d)),[])}}),M.of({name:`Dart`,extensions:[`dart`],load(){return n(()=>import(`./clike-CSGpadKW.js`).then(e=>U(e.dart)),[])}}),M.of({name:`diff`,extensions:[`diff`,`patch`],load(){return n(()=>import(`./diff-VsLDmRbo.js`).then(e=>U(e.diff)),[])}}),M.of({name:`Dockerfile`,filename:/^Dockerfile$/,load(){return n(()=>import(`./dockerfile-O79f3xVO.js`).then(e=>U(e.dockerFile)),[])}}),M.of({name:`DTD`,extensions:[`dtd`],load(){return n(()=>import(`./dtd-CxrLPib8.js`).then(e=>U(e.dtd)),[])}}),M.of({name:`Dylan`,extensions:[`dylan`,`dyl`,`intr`],load(){return n(()=>import(`./dylan-QB82VE9N.js`).then(e=>U(e.dylan)),[])}}),M.of({name:`EBNF`,load(){return n(()=>import(`./ebnf-B6cp6Red.js`).then(e=>U(e.ebnf)),[])}}),M.of({name:`ECL`,extensions:[`ecl`],load(){return n(()=>import(`./ecl-zYbBq-k7.js`).then(e=>U(e.ecl)),[])}}),M.of({name:`edn`,extensions:[`edn`],load(){return n(()=>import(`./clojure-CST35Ic-.js`).then(e=>U(e.clojure)),[])}}),M.of({name:`Eiffel`,extensions:[`e`],load(){return n(()=>import(`./eiffel-DnQZC9e4.js`).then(e=>U(e.eiffel)),[])}}),M.of({name:`Elm`,extensions:[`elm`],load(){return n(()=>import(`./elm-Cx44SA5e.js`).then(e=>U(e.elm)),[])}}),M.of({name:`Erlang`,extensions:[`erl`],load(){return n(()=>import(`./erlang-CEHBsR_g.js`).then(e=>U(e.erlang)),[])}}),M.of({name:`Esper`,load(){return n(()=>import(`./sql-CnA4GIza.js`).then(e=>U(e.esper)),[])}}),M.of({name:`Factor`,extensions:[`factor`],load(){return n(()=>import(`./factor-2MJ0aFHQ.js`).then(e=>U(e.factor)),[])}}),M.of({name:`FCL`,load(){return n(()=>import(`./fcl-D0vOEWq5.js`).then(e=>U(e.fcl)),[])}}),M.of({name:`Forth`,extensions:[`forth`,`fth`,`4th`],load(){return n(()=>import(`./forth-KL0mdDBU.js`).then(e=>U(e.forth)),[])}}),M.of({name:`Fortran`,extensions:[`f`,`for`,`f77`,`f90`,`f95`],load(){return n(()=>import(`./fortran-Dq4mvV2Z.js`).then(e=>U(e.fortran)),[])}}),M.of({name:`F#`,alias:[`fsharp`],extensions:[`fs`],load(){return n(()=>import(`./mllike-DDa-ra-x.js`).then(e=>U(e.fSharp)),[])}}),M.of({name:`Gas`,extensions:[`s`],load(){return n(()=>import(`./gas-C1IQIiP2.js`).then(e=>U(e.gas)),[])}}),M.of({name:`Gherkin`,extensions:[`feature`],load(){return n(()=>import(`./gherkin-DJavHCGq.js`).then(e=>U(e.gherkin)),[])}}),M.of({name:`Groovy`,extensions:[`groovy`,`gradle`],filename:/^Jenkinsfile$/,load(){return n(()=>import(`./groovy-DYXu3zX-.js`).then(e=>U(e.groovy)),[])}}),M.of({name:`Haskell`,extensions:[`hs`],load(){return n(()=>import(`./haskell-CEbLR9qt.js`).then(e=>U(e.haskell)),[])}}),M.of({name:`Haxe`,extensions:[`hx`],load(){return n(()=>import(`./haxe-BpJF7A4A.js`).then(e=>U(e.haxe)),[])}}),M.of({name:`HXML`,extensions:[`hxml`],load(){return n(()=>import(`./haxe-BpJF7A4A.js`).then(e=>U(e.hxml)),[])}}),M.of({name:`HTTP`,load(){return n(()=>import(`./http-DWdENtd1.js`).then(e=>U(e.http)),[])}}),M.of({name:`IDL`,extensions:[`pro`],load(){return n(()=>import(`./idl-CE1kS3NQ.js`).then(e=>U(e.idl)),[])}}),M.of({name:`JSON-LD`,alias:[`jsonld`],extensions:[`jsonld`],load(){return n(()=>import(`./javascript-BIzwdG_f.js`).then(e=>U(e.jsonld)),[])}}),M.of({name:`Julia`,extensions:[`jl`],load(){return n(()=>import(`./julia-BJgPYrDa.js`).then(e=>U(e.julia)),[])}}),M.of({name:`Kotlin`,extensions:[`kt`,`kts`],load(){return n(()=>import(`./clike-CSGpadKW.js`).then(e=>U(e.kotlin)),[])}}),M.of({name:`LiveScript`,alias:[`ls`],extensions:[`ls`],load(){return n(()=>import(`./livescript-DsrJVqPX.js`).then(e=>U(e.liveScript)),[])}}),M.of({name:`Lua`,extensions:[`lua`],load(){return n(()=>import(`./lua-C7UuQSXZ.js`).then(e=>U(e.lua)),[])}}),M.of({name:`mIRC`,extensions:[`mrc`],load(){return n(()=>import(`./mirc-Bs-bacTk.js`).then(e=>U(e.mirc)),[])}}),M.of({name:`Mathematica`,extensions:[`m`,`nb`,`wl`,`wls`],load(){return n(()=>import(`./mathematica-DUerNKxF.js`).then(e=>U(e.mathematica)),[])}}),M.of({name:`Modelica`,extensions:[`mo`],load(){return n(()=>import(`./modelica-DorVekoh.js`).then(e=>U(e.modelica)),[])}}),M.of({name:`MUMPS`,extensions:[`mps`],load(){return n(()=>import(`./mumps-BERv0OoY.js`).then(e=>U(e.mumps)),[])}}),M.of({name:`Mbox`,extensions:[`mbox`],load(){return n(()=>import(`./mbox-l0MV8RAb.js`).then(e=>U(e.mbox)),[])}}),M.of({name:`Nginx`,filename:/nginx.*\.conf$/i,load(){return n(()=>import(`./nginx-Bsa-KRWy.js`).then(e=>U(e.nginx)),[])}}),M.of({name:`NSIS`,extensions:[`nsh`,`nsi`],load(){return n(()=>import(`./nsis-CVYtDIFk.js`).then(e=>U(e.nsis)),[])}}),M.of({name:`NTriples`,extensions:[`nt`,`nq`],load(){return n(()=>import(`./ntriples-CQMTRhrZ.js`).then(e=>U(e.ntriples)),[])}}),M.of({name:`Objective-C`,alias:[`objective-c`,`objc`],extensions:[`m`],load(){return n(()=>import(`./clike-CSGpadKW.js`).then(e=>U(e.objectiveC)),[])}}),M.of({name:`Objective-C++`,alias:[`objective-c++`,`objc++`],extensions:[`mm`],load(){return n(()=>import(`./clike-CSGpadKW.js`).then(e=>U(e.objectiveCpp)),[])}}),M.of({name:`OCaml`,extensions:[`ml`,`mli`,`mll`,`mly`],load(){return n(()=>import(`./mllike-DDa-ra-x.js`).then(e=>U(e.oCaml)),[])}}),M.of({name:`Octave`,extensions:[`m`],load(){return n(()=>import(`./octave-Bl83K6Ag.js`).then(e=>U(e.octave)),[])}}),M.of({name:`Oz`,extensions:[`oz`],load(){return n(()=>import(`./oz-CCTboWOh.js`).then(e=>U(e.oz)),[])}}),M.of({name:`Pascal`,extensions:[`p`,`pas`],load(){return n(()=>import(`./pascal-D-i7gVLf.js`).then(e=>U(e.pascal)),[])}}),M.of({name:`Perl`,extensions:[`pl`,`pm`],load(){return n(()=>import(`./perl-BiLLXF9c.js`).then(e=>U(e.perl)),[])}}),M.of({name:`Pig`,extensions:[`pig`],load(){return n(()=>import(`./pig-D_F2azNe.js`).then(e=>U(e.pig)),[])}}),M.of({name:`PowerShell`,extensions:[`ps1`,`psd1`,`psm1`],load(){return n(()=>import(`./powershell-AJ59gf0u.js`).then(e=>U(e.powerShell)),[])}}),M.of({name:`Properties files`,alias:[`ini`,`properties`],extensions:[`properties`,`ini`,`in`],load(){return n(()=>import(`./properties-CPYgUZZu.js`).then(e=>U(e.properties)),[])}}),M.of({name:`ProtoBuf`,extensions:[`proto`],load(){return n(()=>import(`./protobuf-BTkGCn64.js`).then(e=>U(e.protobuf)),[])}}),M.of({name:`Pug`,alias:[`jade`],extensions:[`pug`,`jade`],load(){return n(()=>import(`./pug-DplZiQL-.js`).then(e=>U(e.pug)),[])}}),M.of({name:`Puppet`,extensions:[`pp`],load(){return n(()=>import(`./puppet-CQcFSvge.js`).then(e=>U(e.puppet)),[])}}),M.of({name:`Q`,extensions:[`q`],load(){return n(()=>import(`./q-D48iiS-J.js`).then(e=>U(e.q)),[])}}),M.of({name:`R`,alias:[`rscript`],extensions:[`r`,`R`],load(){return n(()=>import(`./r-KvgSjvcw.js`).then(e=>U(e.r)),[])}}),M.of({name:`RPM Changes`,load(){return n(()=>import(`./rpm-BcHYZFkz.js`).then(e=>U(e.rpmChanges)),[])}}),M.of({name:`RPM Spec`,extensions:[`spec`],load(){return n(()=>import(`./rpm-BcHYZFkz.js`).then(e=>U(e.rpmSpec)),[])}}),M.of({name:`Ruby`,alias:[`jruby`,`macruby`,`rake`,`rb`,`rbx`],extensions:[`rb`],filename:/^(Gemfile|Rakefile)$/,load(){return n(()=>import(`./ruby-C_Hj_59H.js`).then(e=>U(e.ruby)),[])}}),M.of({name:`SAS`,extensions:[`sas`],load(){return n(()=>import(`./sas-iqYBvleh.js`).then(e=>U(e.sas)),[])}}),M.of({name:`Scala`,extensions:[`scala`],load(){return n(()=>import(`./clike-CSGpadKW.js`).then(e=>U(e.scala)),[])}}),M.of({name:`Scheme`,extensions:[`scm`,`ss`],load(){return n(()=>import(`./scheme-BIcb4en6.js`).then(e=>U(e.scheme)),[])}}),M.of({name:`Shell`,alias:[`bash`,`sh`,`zsh`],extensions:[`sh`,`ksh`,`bash`],filename:/^PKGBUILD$/,load(){return n(()=>import(`./shell-CJbQRqgD.js`).then(e=>U(e.shell)),[])}}),M.of({name:`Sieve`,extensions:[`siv`,`sieve`],load(){return n(()=>import(`./sieve-CEVqHONw.js`).then(e=>U(e.sieve)),[])}}),M.of({name:`Smalltalk`,extensions:[`st`],load(){return n(()=>import(`./smalltalk-CzJ9RPAW.js`).then(e=>U(e.smalltalk)),[])}}),M.of({name:`Solr`,load(){return n(()=>import(`./solr-DhrIF5tD.js`).then(e=>U(e.solr)),[])}}),M.of({name:`SML`,extensions:[`sml`,`sig`,`fun`,`smackspec`],load(){return n(()=>import(`./mllike-DDa-ra-x.js`).then(e=>U(e.sml)),[])}}),M.of({name:`SPARQL`,alias:[`sparul`],extensions:[`rq`,`sparql`],load(){return n(()=>import(`./sparql-p9uHdCLs.js`).then(e=>U(e.sparql)),[])}}),M.of({name:`Spreadsheet`,alias:[`excel`,`formula`],load(){return n(()=>import(`./spreadsheet-BEYojJ7u.js`).then(e=>U(e.spreadsheet)),[])}}),M.of({name:`Squirrel`,extensions:[`nut`],load(){return n(()=>import(`./clike-CSGpadKW.js`).then(e=>U(e.squirrel)),[])}}),M.of({name:`Stylus`,extensions:[`styl`],load(){return n(()=>import(`./stylus-fqPouKsv.js`).then(e=>U(e.stylus)),[])}}),M.of({name:`Swift`,extensions:[`swift`],load(){return n(()=>import(`./swift-DHXFQ55a.js`).then(e=>U(e.swift)),[])}}),M.of({name:`sTeX`,load(){return n(()=>import(`./stex-6IVJg-2X.js`).then(e=>U(e.stex)),[])}}),M.of({name:`LaTeX`,alias:[`tex`],extensions:[`text`,`ltx`,`tex`],load(){return n(()=>import(`./stex-6IVJg-2X.js`).then(e=>U(e.stex)),[])}}),M.of({name:`SystemVerilog`,extensions:[`v`,`sv`,`svh`],load(){return n(()=>import(`./verilog-B1kgqsBR.js`).then(e=>U(e.verilog)),[])}}),M.of({name:`Tcl`,extensions:[`tcl`],load(){return n(()=>import(`./tcl-DI621_2I.js`).then(e=>U(e.tcl)),[])}}),M.of({name:`Textile`,extensions:[`textile`],load(){return n(()=>import(`./textile-CpiPRB46.js`).then(e=>U(e.textile)),[])}}),M.of({name:`TiddlyWiki`,load(){return n(()=>import(`./tiddlywiki-DASPoia0.js`).then(e=>U(e.tiddlyWiki)),[])}}),M.of({name:`Tiki wiki`,load(){return n(()=>import(`./tiki-H2_-xfcb.js`).then(e=>U(e.tiki)),[])}}),M.of({name:`TOML`,extensions:[`toml`],load(){return n(()=>import(`./toml-BLGegqRu.js`).then(e=>U(e.toml)),[])}}),M.of({name:`Troff`,extensions:[`1`,`2`,`3`,`4`,`5`,`6`,`7`,`8`,`9`],load(){return n(()=>import(`./troff-BH_j1MPi.js`).then(e=>U(e.troff)),[])}}),M.of({name:`TTCN`,extensions:[`ttcn`,`ttcn3`,`ttcnpp`],load(){return n(()=>import(`./ttcn-q84VxP8I.js`).then(e=>U(e.ttcn)),[])}}),M.of({name:`TTCN_CFG`,extensions:[`cfg`],load(){return n(()=>import(`./ttcn-cfg-kxhuYjqY.js`).then(e=>U(e.ttcnCfg)),[])}}),M.of({name:`Turtle`,extensions:[`ttl`],load(){return n(()=>import(`./turtle-COu2Ajrp.js`).then(e=>U(e.turtle)),[])}}),M.of({name:`Web IDL`,extensions:[`webidl`],load(){return n(()=>import(`./webidl-Bpu8XQq2.js`).then(e=>U(e.webIDL)),[])}}),M.of({name:`VB.NET`,extensions:[`vb`],load(){return n(()=>import(`./vb-7GRadaxb.js`).then(e=>U(e.vb)),[])}}),M.of({name:`VBScript`,extensions:[`vbs`],load(){return n(()=>import(`./vbscript-Bibo3Rcb.js`).then(e=>U(e.vbScript)),[])}}),M.of({name:`Velocity`,extensions:[`vtl`],load(){return n(()=>import(`./velocity-CRfDkZn8.js`).then(e=>U(e.velocity)),[])}}),M.of({name:`Verilog`,extensions:[`v`],load(){return n(()=>import(`./verilog-B1kgqsBR.js`).then(e=>U(e.verilog)),[])}}),M.of({name:`VHDL`,extensions:[`vhd`,`vhdl`],load(){return n(()=>import(`./vhdl-qL7iOc7c.js`).then(e=>U(e.vhdl)),[])}}),M.of({name:`XQuery`,extensions:[`xy`,`xquery`,`xq`,`xqm`,`xqy`],load(){return n(()=>import(`./xquery-C_ocxvPR.js`).then(e=>U(e.xQuery)),[])}}),M.of({name:`Yacas`,extensions:[`ys`],load(){return n(()=>import(`./yacas-DByFiVRK.js`).then(e=>U(e.yacas)),[])}}),M.of({name:`Z80`,extensions:[`z80`],load(){return n(()=>import(`./z80-CKuzqVbN.js`).then(e=>U(e.z80)),[])}}),M.of({name:`MscGen`,extensions:[`mscgen`,`mscin`,`msc`],load(){return n(()=>import(`./mscgen-Bu9Rmf5j.js`).then(e=>U(e.mscgen)),[])}}),M.of({name:`Xù`,extensions:[`xu`],load(){return n(()=>import(`./mscgen-Bu9Rmf5j.js`).then(e=>U(e.xu)),[])}}),M.of({name:`MsGenny`,extensions:[`msgenny`],load(){return n(()=>import(`./mscgen-Bu9Rmf5j.js`).then(e=>U(e.msgenny)),[])}}),M.of({name:`Vue`,extensions:[`vue`],load(){return n(()=>import(`./dist-DwzmyMDC.js`).then(e=>e.vue()),[])}}),M.of({name:`Angular Template`,load(){return n(()=>import(`./dist-Bn4kv_Se.js`).then(e=>e.angular()),[])}})],Wo=Se.theme({"&":{height:`100%`,color:`var(--text-primary)`,backgroundColor:`var(--canvas-deep)`},".cm-editor":{height:`100%`,color:`var(--text-primary)`,backgroundColor:`var(--canvas-deep)`},".cm-scroller":{fontFamily:`ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace`,backgroundColor:`var(--canvas-deep)`},".cm-content":{caretColor:`var(--text-primary)`},".cm-gutters":{color:`var(--text-tertiary, var(--text-secondary))`,backgroundColor:`var(--canvas-deep)`,borderRight:`1px solid var(--border-subtle)`},".cm-activeLine":{backgroundColor:`var(--canvas-soft)`},".cm-activeLineGutter":{color:`var(--text-primary)`,backgroundColor:`var(--canvas-soft)`},".cm-cursor, .cm-dropCursor":{borderLeftColor:`var(--text-primary)`},"&.cm-focused .cm-selectionBackground, .cm-selectionBackground, ::selection":{backgroundColor:`var(--selection-bg)`},"&.cm-focused":{outline:`1px solid var(--border-strong)`},".cm-line":{color:`var(--text-primary)`},".cm-panels":{color:`var(--text-primary)`,backgroundColor:`var(--bg-panel)`,borderColor:`var(--border-subtle)`},".cm-tooltip":{color:`var(--text-primary)`,backgroundColor:`var(--bg-panel)`,border:`1px solid var(--border-subtle)`},".cm-matchingBracket, .cm-nonmatchingBracket":{outline:`1px solid var(--accent)`,backgroundColor:`var(--accent-soft)`},".cm-rich-widget":{color:`var(--text-primary)`,backgroundColor:`var(--canvas-soft)`,border:`1px solid var(--border-subtle)`,borderRadius:`6px`},".cm-rich-block":{display:`block`,margin:`6px 0`,padding:`8px 10px`,overflowX:`auto`},".cm-rich-inline":{display:`inline-flex`,alignItems:`center`,maxWidth:`100%`,padding:`0 4px`,verticalAlign:`baseline`},".cm-rich-source-muted":{color:`var(--text-tertiary, var(--text-secondary))`},".cm-rich-widget-error":{color:`var(--danger-strong, var(--text-primary))`,borderColor:`var(--danger-strong, var(--border-subtle))`}},{dark:!0}),Go=ve(ze.define([{tag:j.heading,color:`var(--text-primary)`,fontWeight:`650`},{tag:[j.strong,j.emphasis],color:`var(--text-primary)`},{tag:j.link,color:`var(--accent-strong, var(--accent))`,textDecoration:`underline`},{tag:j.url,color:`var(--accent-strong, var(--accent))`},{tag:[j.keyword,j.atom,j.bool],color:`var(--accent-strong, var(--accent))`},{tag:[j.string,j.special(j.string)],color:`var(--success-strong, var(--text-primary))`},{tag:[j.comment,j.quote],color:`var(--text-tertiary, var(--text-secondary))`},{tag:[j.number,j.integer,j.float],color:`var(--warning-strong, var(--text-primary))`},{tag:[j.variableName,j.propertyName],color:`var(--text-primary)`},{tag:[j.definition(j.variableName),j.function(j.variableName)],color:`var(--accent)`},{tag:[j.punctuation,j.bracket],color:`var(--text-secondary)`},{tag:j.invalid,color:`var(--danger-strong, var(--text-primary))`}]));function Ko(e,t=e){return n=>{let{state:r}=n,i=!1,a=r.changeByRange(n=>{i=!0;let a=r.sliceDoc(n.from,n.to),o=`${e}${a}${t}`,s=n.from+e.length,c=s+a.length;return{changes:{from:n.from,to:n.to,insert:o},range:n.empty?xe.cursor(s):xe.range(s,c)}});return i?(n.dispatch(a),!0):!1}}var qo=[{key:`Mod-b`,run:Ko(`**`),preventDefault:!0},{key:`Mod-i`,run:Ko(`*`),preventDefault:!0},{key:`Mod-e`,run:Ko("`"),preventDefault:!0},{key:`Mod-k`,run:e=>{let{state:t}=e,n=!1,r=t.changeByRange(e=>{n=!0;let r=t.sliceDoc(e.from,e.to);if(e.empty)return{changes:{from:e.from,insert:`[](url)`},range:xe.cursor(e.from+1)};let i=`[${r}](url)`,a=e.from+1+r.length+2,o=a+3;return{changes:{from:e.from,to:e.to,insert:i},range:xe.range(a,o)}});return n?(e.dispatch(r),!0):!1},preventDefault:!0}],Jo=ht();function Yo(e){return(0,L.jsx)(L.Fragment,{children:e.widgets.map(e=>(0,Jo.createPortal)((0,L.jsx)(it,{markdown:e.markdown}),e.shell,e.id))})}function Xo(e,t,n){return n.selectionFrom<=t&&n.selectionTo>=e}function Zo(e,t){return new TextEncoder().encode(e).byteLength<=t.maxSnippetBytes}function Qo(e,t,n){e.length>=n.maxWidgets||Xo(t.from,t.to,n)||Zo(t.markdown,n)&&e.push(t)}function $o(e,t){if(e.length>t.largeNoteDisableThreshold)return[];let n=[],r=0;for(let i of e.matchAll(/^```([^\n`]*)\n[\s\S]*?\n```[ \t]*$/gm)){if(n.length>=t.maxWidgets)break;let e=i.index||0,a=e+i[0].length,o=(i[1]||``).trim().toLowerCase();if(o===`mermaid`){if(r>=t.maxMermaidWidgets)continue;r+=1}Qo(n,{from:e,to:a,kind:o===`mermaid`?`mermaid`:`code`,markdown:i[0],block:!0},t)}for(let r of e.matchAll(/^\$\$\n[\s\S]*?\n\$\$[ \t]*$/gm)){if(n.length>=t.maxWidgets)break;let e=r.index||0;Qo(n,{from:e,to:e+r[0].length,kind:`math-block`,markdown:r[0],block:!0},t)}for(let r of e.matchAll(/(^|[^$\\])(\$[^$\n]+\$)/g)){if(n.length>=t.maxWidgets)break;let e=r[1].length,i=(r.index||0)+e,a=r[2];Qo(n,{from:i,to:i+a.length,kind:`math-inline`,markdown:a,block:!1},t)}return n.sort((e,t)=>e.from-t.from||e.to-t.to)}var es=class e extends Ce{constructor(e){super(),this.options=e}eq(t){return t instanceof e?this.options.id===t.options.id&&this.options.kind===t.options.kind&&this.options.markdown===t.options.markdown:!1}toDOM(){let e=document.createElement(this.options.block?`div`:`span`);return e.className=this.options.block?`cm-rich-widget cm-rich-block`:`cm-rich-widget cm-rich-inline`,e.dataset.richWidgetId=this.options.id,e.dataset.richWidgetKind=this.options.kind,this.options.registerWidget({id:this.options.id,kind:this.options.kind,markdown:this.options.markdown,shell:e}),queueMicrotask(this.options.requestMeasure),e}updateDOM(e){return this.options.registerWidget({id:this.options.id,kind:this.options.kind,markdown:this.options.markdown,shell:e}),queueMicrotask(this.options.requestMeasure),!0}destroy(){this.options.unregisterWidget(this.options.id)}get estimatedHeight(){return this.options.block?96:20}ignoreEvent(){return!1}},ts=50,ns=100,rs=5e4,is=5,as=1e6,os=/^([ \t]*[-*+][ \t]+)\[([ xX])\]([ \t]*)(.*)$/,ss=class e extends Ce{constructor(e){super(),this.range=e}eq(t){return t instanceof e&&t.range.markerFrom===this.range.markerFrom&&t.range.checked===this.range.checked&&t.range.text===this.range.text}toDOM(e){let t=document.createElement(`label`);t.className=`cm-rich-task-widget`;let n=document.createElement(`input`);n.type=`checkbox`;let r=document.createElement(`span`);return t.append(n,r),this.syncDOM(t,e),t}updateDOM(e,t){return e.classList.contains(`cm-rich-task-widget`)?(this.syncDOM(e,t),!0):!1}destroy(e){let t=e.querySelector(`input[type="checkbox"]`);t&&(t.onchange=null)}ignoreEvent(e){return e.type===`mousedown`||e.type===`click`||e.type===`change`||e.type===`input`||e.type===`keydown`}syncDOM(e,t){let n=e.querySelector(`input[type="checkbox"]`),r=e.querySelector(`span`);!n||!r||(n.checked=this.range.checked,n.setAttribute(`aria-label`,this.range.text||(this.range.checked?`Checked task`:`Unchecked task`)),n.setAttribute(`aria-checked`,this.range.checked?`true`:`false`),n.onchange=()=>{t.dispatch({changes:{from:this.range.markerFrom,to:this.range.markerFrom+3,insert:n.checked?`[x]`:`[ ]`},userEvent:`input.task-toggle`})},r.textContent=this.range.text||`Task`)}};function cs(e){return`rich-${e.kind}-${e.from}-${e.to}-${e.markdown.length}`}function ls(e){let t=[],n=e.selection.main,r=!1;for(let i=1;i<=e.doc.lines&&!(t.length>=ns);i+=1){let a=e.doc.line(i);if(/^```/.test(a.text.trim())){r=!r;continue}if(r||n.from<=a.to&&n.to>=a.from)continue;let o=a.text.match(os);o&&t.push({from:a.from,to:a.to,markerFrom:a.from+o[1].length,checked:o[2].toLowerCase()===`x`,text:o[4].trim()})}return t}function us(e,t){if(!t.enabled||!t.active)return Le.none;let n=e.selection.main,r=$o(e.doc.toString(),{selectionFrom:n.from,selectionTo:n.to,maxWidgets:ts,maxSnippetBytes:rs,maxMermaidWidgets:is,largeNoteDisableThreshold:as}),i=[];for(let t of ls(e))i.push({from:t.from,to:t.to,decoration:Le.replace({widget:new ss(t)})});for(let e of r)i.push({from:e.from,to:e.to,decoration:Le.replace({block:e.block,widget:new es({id:cs(e),kind:e.kind,markdown:e.markdown,block:e.block,registerWidget:t.registerWidget,unregisterWidget:t.unregisterWidget,requestMeasure:t.requestMeasure})})});i.sort((e,t)=>{let n=e.from-t.from;if(n!==0)return n;let r=e.decoration.startSide-t.decoration.startSide;return r===0?e.to-t.to:r});let a=new ye;for(let e of i)a.add(e.from,e.to,e.decoration);return a.finish()}function ds(e){return je.define({create(t){return us(t,e)},update(t,n){return n.docChanged||n.selection?us(n.state,e):t.map(n.changes)},provide(e){return[Se.decorations.from(e),Se.atomicRanges.of(t=>t.state.field(e,!1)??Le.none)]}})}function fs(e){let t=document.createElement(`template`);return t.innerHTML=e,t.content.textContent||``}function ps(e){return Se.domEventHandlers({paste(t,n){if(e&&ot(t,n,e))return!0;if(t.clipboardData?.getData(`text/plain`))return!1;let r=t.clipboardData?.getData(`text/html`);return r?(t.preventDefault(),n.dispatch(n.state.replaceSelection(fs(r))),!0):!1},drop(t,n){return!!(e&&at(t,n,e))}})}function ms(e){return(t,n,r,i)=>{let a=t.state.sliceDoc(i,i+2)===`]]`?i+2:i;t.dispatch({...Ze(t.state,lt(e),r,a),annotations:$e.of(n)})}}function hs(e){function t(t){let n=t.state.doc.lineAt(t.pos),r=st(t.state.sliceDoc(n.from,n.to),t.pos-n.from);if(!r)return null;let i=n.from+r.to-(r.hasClosingSuffix?2:0),a=ct(e,r.query).map(e=>({label:e.title||e.path,detail:e.path,info:e.matchKind===`alias`?`Alias: ${e.aliases.join(`, `)}`:e.matchKind,type:`text`,apply:ms(e),boost:e.score}));return a.length===0?null:{from:n.from+r.from,to:i,options:a,validFor:/^[^\]\n]*$/}}return et({activateOnTyping:!0,override:[t]})}var gs=null;async function _s(){if(gs)return gs;let{vim:e}=await n(async()=>{let{vim:e}=await import(`./dist-CJwXuDux.js`);return{vim:e}},[]);return gs=e(),gs}var vs=(0,I.lazy)(async()=>({default:(await n(()=>import(`./MilkdownWysiwygEditor-Btwmr5Re.js`),__vite__mapDeps([0]))).MilkdownWysiwygEditor}));function ys(e){let[t,n]=(0,I.useState)(()=>new Map),[r,i]=(0,I.useState)(null),a=e.authoringMode===`wysiwyg`;(0,I.useEffect)(()=>{if(!e.vimMode){i(null);return}let t=!1;return _s().then(e=>{t||i(e)}),()=>{t=!0}},[e.vimMode]);let o=(0,I.useCallback)(e=>{n(t=>{let n=new Map(t);return n.set(e.id,e),n})},[]),s=(0,I.useCallback)(e=>{n(t=>{if(!t.has(e))return t;let n=new Map(t);return n.delete(e),n})},[]),c=(0,I.useCallback)(()=>{window.dispatchEvent(new Event(`resize`))},[]),l=(0,I.useMemo)(()=>{let t=[ge.highest(Ee.of(qo)),Wo,Go,rt({codeLanguages:Uo}),hs(e.notes),ps({notePath:e.notePath,onError:e=>console.warn(`[notes-image-paste]`,e)}),ds({enabled:e.authoringMode===`rich`||e.authoringMode===`wysiwyg`,active:e.active,registerWidget:o,unregisterWidget:s,requestMeasure:c})];return e.wordWrap&&t.push(Se.lineWrapping),r&&t.unshift(r),t},[e.active,e.authoringMode,e.notePath,e.notes,e.wordWrap,r,o,c,s]);return a?(0,L.jsx)(`div`,{className:`notes-editor notes-wysiwyg-editor`,children:(0,L.jsx)(I.Suspense,{fallback:(0,L.jsx)(`div`,{className:`notes-wysiwyg-loading`,children:`Loading WYSIWYG editor...`}),children:(0,L.jsx)(vs,{active:e.active,content:e.content,notePath:e.notePath,outgoing:e.outgoing,notes:e.notes,activeTag:e.activeTag,onChange:e.onChange,onTagSelect:e.onTagSelect,onWikiLinkNavigate:e.onWikiLinkNavigate})})}):(0,L.jsxs)(`div`,{className:`notes-editor`,children:[(0,L.jsx)(Yo,{widgets:[...t.values()]}),(0,L.jsx)(Vo,{value:e.content,extensions:l,onChange:e.onChange,height:`100%`,basicSetup:{lineNumbers:!0,foldGutter:!0,highlightActiveLine:!0}})]})}function bs(e){return(0,L.jsx)(`article`,{className:`notes-preview`,children:(0,L.jsx)(it,{markdown:e.markdown,outgoing:e.outgoing,notes:e.notes,onWikiLinkNavigate:e.onWikiLinkNavigate})})}function xs(e){let t=e.split(`/`).pop()??e;return t.endsWith(`.md`)?t.slice(0,-3):t}function Ss(e){let t=[],n=/\[\[([^\]]+)\]\]/g,r=0,i,a=0;for(;(i=n.exec(e))!==null;)i.index>r&&t.push(e.slice(r,i.index)),t.push((0,L.jsx)(`mark`,{className:`backlink-highlight`,children:`[[`+i[1]+`]]`},a++)),r=n.lastIndex;return r<e.length&&t.push(e.slice(r)),t}function Cs(e){let[t,n]=(0,I.useState)(!1),r=(0,I.useCallback)(t=>{e.onNavigate(t)},[e.onNavigate]),i=e.backlinks.length;return(0,L.jsxs)(`div`,{className:`notes-backlinks-panel`,children:[(0,L.jsxs)(`button`,{className:`notes-backlinks-header`,onClick:()=>n(e=>!e),children:[(0,L.jsx)(`span`,{className:`notes-backlinks-chevron`,children:t?`▶`:`▼`}),(0,L.jsx)(`span`,{children:`Backlinks`}),(0,L.jsx)(`span`,{className:`notes-backlinks-count`,children:i})]}),!t&&(0,L.jsxs)(`div`,{className:`notes-backlinks-list`,children:[i===0&&(0,L.jsx)(`div`,{className:`notes-backlinks-empty`,children:`No backlinks found`}),e.backlinks.map((e,t)=>{let n=e.raw.length>120?e.raw.slice(0,120)+`...`:e.raw;return(0,L.jsxs)(`button`,{className:`notes-backlink-entry`,onClick:()=>r(e.sourcePath),children:[(0,L.jsx)(`span`,{className:`notes-backlink-title`,children:xs(e.sourcePath)}),(0,L.jsxs)(`span`,{className:`notes-backlink-line`,children:[`L`,e.line]}),(0,L.jsx)(`span`,{className:`notes-backlink-context`,children:Ss(n)})]},`${e.sourcePath}:${e.line}:${t}`)})]})]})}function ws(){return(0,L.jsxs)(`section`,{className:`notes-empty-state`,children:[(0,L.jsx)(`strong`,{children:`No notes yet`}),(0,L.jsx)(`span`,{children:`Create a markdown note from the file tree.`})]})}function Ts(e){let t=e.note;if(!t)return null;let n=t.aliases||[],r=t.tags||[],i=t.created,a=t.frontmatterError;return!a&&n.length===0&&r.length===0&&!i?null:(0,L.jsxs)(`div`,{className:`notes-frontmatter-strip`,"aria-label":`Note frontmatter`,children:[a&&(0,L.jsxs)(`span`,{className:`notes-frontmatter-error`,role:`alert`,children:[`Frontmatter: `,a]}),n.length>0&&(0,L.jsxs)(`span`,{className:`notes-frontmatter-section`,children:[(0,L.jsx)(`span`,{className:`notes-frontmatter-label`,children:`Aliases`}),(0,L.jsx)(`span`,{className:`notes-frontmatter-value`,children:n.join(`, `)})]}),i&&(0,L.jsxs)(`span`,{className:`notes-frontmatter-section`,children:[(0,L.jsx)(`span`,{className:`notes-frontmatter-label`,children:`Created`}),(0,L.jsx)(`span`,{className:`notes-frontmatter-value`,children:i})]}),r.length>0&&(0,L.jsx)(`span`,{className:`notes-frontmatter-section notes-frontmatter-tags`,children:r.map(t=>{let n=t===e.activeTag;return(0,L.jsxs)(`button`,{type:`button`,className:n?`notes-tag-chip is-active`:`notes-tag-chip`,"aria-pressed":n,title:n?`Clear filter: #${t}`:`Filter notes by #${t}`,onClick:()=>e.onTagClick(n?null:t),children:[`#`,t]},t)})})]})}var Es=50;function Ds(e){return e.trim().toLowerCase()}function Os(e,t){let n=Ds(e),r=Ds(t);if(!r)return 1;if(n.startsWith(r))return 1e3-n.length;let i=n.indexOf(r);if(i>=0)return 700-i;let a=-1,o=0,s=0;for(let e of r){let t=n.indexOf(e,a+1);if(t<0)return null;o=t===a+1?o+1:0,s+=4+o*3-Math.min(t,40)*.1,a=t}return s}function ks(e,t){let n=[{value:e.title,reason:`title`,boost:120},{value:e.path,reason:`path`,boost:40},...e.aliases.map(e=>({value:e,reason:`alias`,boost:80}))],r=null;for(let i of n){let n=Os(i.value,t);if(n==null)continue;let a=n+i.boost;(!r||a>r.score)&&(r={note:e,score:a,reason:i.reason})}return r}function As(e,t,n=Es){let r=t.trim();return e.map(e=>ks(e,r)).filter(e=>!!e).sort((e,t)=>t.score===e.score?e.note.path.localeCompare(t.note.path):t.score-e.score).slice(0,n)}function js(e){let[t,n]=(0,I.useState)(``),[r,i]=(0,I.useState)(0),a=(0,I.useRef)(null),o=(0,I.useRef)(null),s=(0,I.useMemo)(()=>As(e.notes,t),[e.notes,t]),c=s[r]?`notes-quick-switcher-option-${r}`:void 0;(0,I.useEffect)(()=>{e.open&&(n(``),i(0),requestAnimationFrame(()=>a.current?.focus()))},[e.open]),(0,I.useEffect)(()=>{r>=s.length&&i(Math.max(0,s.length-1))},[r,s.length]),(0,I.useEffect)(()=>{(c?document.getElementById(c):null)?.scrollIntoView({block:`nearest`})},[c]);function l(){let t=s[r];t&&e.onSelect(t.note.path)}function u(t){t.key===`ArrowDown`?(t.preventDefault(),i(e=>Math.min(s.length-1,e+1))):t.key===`ArrowUp`?(t.preventDefault(),i(e=>Math.max(0,e-1))):t.key===`Enter`?(t.preventDefault(),l()):t.key===`Escape`&&(t.preventDefault(),e.onClose())}return e.open?(0,L.jsx)(`div`,{className:`notes-quick-switcher-backdrop`,role:`presentation`,onClick:e.onClose,children:(0,L.jsxs)(`section`,{className:`notes-quick-switcher`,role:`dialog`,"aria-modal":`true`,"aria-label":`Quick switch note`,onClick:e=>e.stopPropagation(),children:[(0,L.jsx)(`input`,{ref:a,className:`notes-quick-switcher-input`,type:`search`,placeholder:`Go to note`,value:t,onChange:e=>{n(e.currentTarget.value),i(0)},onKeyDown:u,"aria-label":`Quick switch note`,"aria-controls":`notes-quick-switcher-results`,"aria-activedescendant":c}),(0,L.jsxs)(`div`,{id:`notes-quick-switcher-results`,className:`notes-quick-switcher-list`,role:`listbox`,"aria-label":`Matching notes`,ref:o,children:[s.map((t,n)=>{let a=n===r,o=t.note.path===e.selectedPath;return(0,L.jsxs)(`button`,{id:`notes-quick-switcher-option-${n}`,type:`button`,role:`option`,"aria-selected":a,className:`notes-quick-switcher-item${a?` is-active`:``}${o?` is-current`:``}`,onMouseEnter:()=>i(n),onClick:()=>e.onSelect(t.note.path),children:[(0,L.jsx)(`span`,{className:`notes-quick-switcher-title`,children:t.note.title||t.note.path}),(0,L.jsx)(`span`,{className:`notes-quick-switcher-path`,children:t.note.path}),(0,L.jsx)(`span`,{className:`notes-quick-switcher-alias`,children:o?`Current note`:t.reason===`alias`?`Alias match`:t.reason===`path`?`Path match`:`Title match`})]},t.note.path)}),s.length===0&&(0,L.jsx)(`p`,{className:`notes-quick-switcher-empty`,children:`No matching notes.`})]}),(0,L.jsxs)(`footer`,{className:`notes-quick-switcher-footer`,children:[(0,L.jsxs)(`span`,{children:[(0,L.jsx)(`kbd`,{children:`Up/Down`}),` move`]}),(0,L.jsxs)(`span`,{children:[(0,L.jsx)(`kbd`,{children:`Enter`}),` open`]}),(0,L.jsxs)(`span`,{children:[(0,L.jsx)(`kbd`,{children:`Esc`}),` close`]})]})]})}):null}function Ms(e){return e instanceof ae&&e.status===409&&e.code===`note_revision_conflict`}function Ns(e){return e?e.split(`/`).filter(Boolean).at(-1)||e:`No note selected`}function Ps(e,t,n){return!!e&&t&&!n}var Fs=[`raw`,`split`,`preview`,`wysiwyg`,`graph`];function Is(e){return e===`raw`?`Raw`:e===`split`?`Split`:e===`preview`?`Preview`:e===`graph`?`Graph`:`WYSIWYG`}function Ls(e,t){return e===`settings`?null:e===`graph`?`graph`:e===`split`?`split`:e===`preview`?`preview`:t===`wysiwyg`?`wysiwyg`:`raw`}function Rs(e){function t(t){if(t===`graph`){e.onViewModeChange(`graph`);return}if(t===`split`){e.onViewModeChange(`split`),e.onAuthoringModeChange(`plain`);return}if(t===`preview`){e.onViewModeChange(`preview`);return}e.onViewModeChange(`raw`),e.onAuthoringModeChange(t===`wysiwyg`?`wysiwyg`:`plain`)}let n=Ls(e.viewMode,e.authoringMode);return(0,L.jsxs)(`div`,{className:`notes-toolbar`,children:[(0,L.jsxs)(`div`,{className:`notes-toolbar-title`,children:[(0,L.jsx)(`strong`,{children:Ns(e.selectedPath)}),(0,L.jsx)(`span`,{children:e.conflict?`Conflict`:e.dirty?`Unsaved`:`Saved`})]}),(0,L.jsxs)(`div`,{className:`notes-toolbar-actions`,children:[(0,L.jsx)(`div`,{className:`notes-view-tabs`,role:`tablist`,"aria-label":`Notes view`,children:Fs.map(r=>(0,L.jsx)(`button`,{type:`button`,role:`tab`,"aria-selected":n===r,className:n===r?`is-active`:``,disabled:r===`graph`?!1:!e.selectedPath,onClick:()=>t(r),children:Is(r)},r))}),(0,L.jsx)(`button`,{type:`button`,className:e.viewMode===`settings`?`is-active`:``,onClick:()=>e.onViewModeChange(`settings`),children:`Settings`}),(0,L.jsx)(`button`,{type:`button`,onClick:e.onReload,disabled:!e.selectedPath||e.loading,children:`Refresh`}),(0,L.jsx)(`button`,{type:`button`,className:`notes-save-button`,onClick:e.onSave,disabled:!Ps(e.selectedPath,e.dirty,e.saving),children:e.saving?`Saving`:`Save`})]})]})}function zs(e){return(e.metaKey||e.ctrlKey)&&!e.altKey}function Bs(e){return typeof HTMLElement>`u`||!(e instanceof HTMLElement)?!1:!!e.closest(`[data-notes-palette]`)}function Vs(e){return zs(e)&&!e.shiftKey&&e.key.toLowerCase()===`p`&&!Bs(e.target)}function Hs(e){return zs(e)&&e.shiftKey&&e.key.toLowerCase()===`p`}async function Us(){await Promise.resolve(),await new Promise(e=>setTimeout(e,0))}function Ws(){let[e,t]=(0,I.useState)(null),[n,r]=(0,I.useState)(``),[i,a]=(0,I.useState)(!1),[o,s]=(0,I.useState)(!1),[c,l]=(0,I.useState)(!1),[u,d]=(0,I.useState)(null),[f,p]=(0,I.useState)(null),h=(0,I.useRef)(``),g=(0,I.useRef)(!1),_=(0,I.useRef)(!1),v=(0,I.useCallback)(async e=>{s(!0),d(null),p(null);try{let n=await y(e);t(n),h.current=n.content,g.current=!1,r(n.content),a(!1)}catch(e){d(e.message)}finally{s(!1)}},[]);function b(e){h.current=e,g.current=!0,r(e),a(!0)}return{file:e,content:n,dirty:i,loading:o,saving:c,error:u,conflict:f,setContent:b,load:v,save:(0,I.useCallback)(async()=>{if(await Us(),!e||!g.current||_.current)return;let n=h.current;_.current=!0,l(!0),d(null),p(null);try{let i=await m({path:e.path,content:n,baseRevision:e.revision});t(i),h.current===n&&(h.current=i.content,g.current=!1,r(i.content),a(!1))}catch(r){if(Ms(r)){let i=e.revision;try{let n=await y(e.path);i=n.revision,t(n)}catch{i=e.revision}p({localContent:n,remoteRevision:i,message:r.message})}else d(r.message)}finally{_.current=!1,l(!1)}},[e]),reloadFromDisk:(0,I.useCallback)(async()=>{e&&await v(e.path)},[e,v]),overwrite:(0,I.useCallback)(async()=>{if(await Us(),!e||_.current)return;let n=h.current;_.current=!0,l(!0),d(null);try{let i=await m({path:e.path,content:n});t(i),h.current===n&&(h.current=i.content,g.current=!1,r(i.content),a(!1)),p(null)}catch(e){d(e.message)}finally{_.current=!1,l(!1)}},[e]),clearConflict:()=>p(null)}}var Gs=(0,I.lazy)(async()=>({default:(await n(()=>import(`./NotesGraphWorkspace-CK8kKY8A.js`),[])).NotesGraphWorkspace})),Ks=[`raw`,`preview`,`wysiwyg`],qs=/[/\\]/g;function Js(e){let t=e.split(`/`).pop()??e;return t.endsWith(`.md`)?t.slice(0,-3):t}function Ys(e,t){return e===`preview`?`preview`:t===`wysiwyg`?`wysiwyg`:`raw`}function Xs(e){let t=Ws(),n=(0,I.useRef)(!1),[r,i]=(0,I.useState)(!1);(0,I.useEffect)(()=>{e.selectedPath&&t.load(e.selectedPath)},[e.selectedPath]),(0,I.useEffect)(()=>{e.onDirtyPathChange(t.dirty?e.selectedPath:null)},[t.dirty,e.selectedPath]),(0,I.useEffect)(()=>{if(!e.active)return;function n(e){!(e.metaKey||e.ctrlKey)||e.key.toLowerCase()!==`s`||(e.preventDefault(),t.save())}return window.addEventListener(`keydown`,n),()=>window.removeEventListener(`keydown`,n)},[t.save,e.active]),(0,I.useEffect)(()=>{if(!e.active)return;function t(t){if(!(t.metaKey||t.ctrlKey)||t.key.toLowerCase()!==`e`)return;t.preventDefault();let n=Ys(e.viewMode,e.authoringMode),r=Ks[(Ks.indexOf(n)+1)%Ks.length];if(r===`preview`){e.onViewModeChange(`preview`);return}e.onViewModeChange(`raw`),e.onAuthoringModeChange(r===`wysiwyg`?`wysiwyg`:`plain`)}return window.addEventListener(`keydown`,t),()=>window.removeEventListener(`keydown`,t)},[e.active,e.viewMode,e.authoringMode,e.onViewModeChange,e.onAuthoringModeChange]),(0,I.useEffect)(()=>{if(!e.active)return;function t(t){!(t.metaKey||t.ctrlKey)||!t.shiftKey||t.key.toLowerCase()!==`f`||(t.preventDefault(),e.onOpenSidebarSearch())}return window.addEventListener(`keydown`,t),()=>window.removeEventListener(`keydown`,t)},[e.active,e.onOpenSidebarSearch]),(0,I.useEffect)(()=>{if(!e.active)return;function t(e){Vs(e)&&(e.preventDefault(),i(e=>!e))}return window.addEventListener(`keydown`,t),()=>window.removeEventListener(`keydown`,t)},[e.active]);let a=e.selectedPath?t.saving?`Save in progress`:t.dirty?void 0:`No unsaved changes`:`No note selected`;_a((0,I.useMemo)(()=>[{id:`workspace:save`,section:`File`,label:`Save note`,shortcut:`Cmd+S`,disabled:!Ps(e.selectedPath,t.dirty,t.saving),disabledReason:a,keywords:[`write`,`persist`],run:()=>void t.save()},{id:`workspace:reload`,section:`File`,label:`Reload note from disk`,keywords:[`refresh`,`discard`],disabled:!e.selectedPath,disabledReason:`No note selected`,run:()=>void t.reloadFromDisk()},{id:`workspace:view-raw`,section:`View`,label:`Switch to raw editor`,run:()=>{e.onViewModeChange(`raw`),e.onAuthoringModeChange(`plain`)}},{id:`workspace:view-split`,section:`View`,label:`Switch to split view`,run:()=>{e.onViewModeChange(`split`),e.onAuthoringModeChange(`plain`)}},{id:`workspace:view-preview`,section:`View`,label:`Switch to preview`,shortcut:`Cmd+E`,run:()=>e.onViewModeChange(`preview`)},{id:`workspace:view-wysiwyg`,section:`View`,label:`Switch to WYSIWYG editor`,run:()=>{e.onViewModeChange(`raw`),e.onAuthoringModeChange(`wysiwyg`)}},{id:`workspace:view-graph`,section:`View`,label:`Open graph view`,run:()=>e.onViewModeChange(`graph`)},{id:`workspace:open-settings`,section:`View`,label:`Open Notes settings`,run:()=>e.onViewModeChange(`settings`)},{id:`workspace:toggle-word-wrap`,section:`Editor`,label:e.wordWrap?`Disable word wrap`:`Enable word wrap`,run:()=>e.onWordWrapChange(!e.wordWrap)},{id:`workspace:toggle-vim-mode`,section:`Editor`,label:e.vimMode?`Disable Vim mode`:`Enable Vim mode`,keywords:[`vim`,`keybindings`,`editor`],run:()=>e.onVimModeChange(!e.vimMode)},{id:`workspace:open-search`,section:`Navigate`,label:`Search notes`,shortcut:`Cmd+Shift+F`,run:e.onOpenSidebarSearch},{id:`workspace:quick-switch-note`,section:`Navigate`,label:`Quick switch note`,shortcut:`Cmd+P`,run:()=>i(!0)}],[t.dirty,t.reloadFromDisk,t.save,t.saving,e.onAuthoringModeChange,e.onOpenSidebarSearch,e.onViewModeChange,e.onVimModeChange,e.onWordWrapChange,e.selectedPath,e.vimMode,e.wordWrap,a]),e.active);async function o(t){if(n.current||!e.selectedPath)return;let r=t.currentTarget.value.trim().replace(qs,``),i=Js(e.selectedPath);if(!r||r===i){t.currentTarget.value=i;return}let a=e.selectedPath.split(`/`);a[a.length-1]=r.endsWith(`.md`)?r:`${r}.md`;let o=a.join(`/`);if(o===e.selectedPath){t.currentTarget.value=i;return}n.current=!0;try{await v(e.selectedPath,o),e.onSelectedPathChange(o),ba({topics:[`notes`],reason:`note:title-renamed`,source:`ui`})}catch(e){console.warn(`[notes-rename]`,e),t.currentTarget.value=i}finally{n.current=!1}}let s=e.viewMode===`raw`||e.viewMode===`split`,c=e.viewMode===`preview`||e.viewMode===`split`,l=e.selectedPath&&e.vaultIndex?.outgoingLinks?.[e.selectedPath]||[],u=e.selectedPath&&e.vaultIndex?.backlinks?.[e.selectedPath]||[],d=e.vaultIndex?.notes||[],f=e.authoringMode===`wysiwyg`&&s;return(0,L.jsxs)(`section`,{className:`notes-workspace`,"aria-label":`Notes workspace`,children:[(0,L.jsx)(Ia,{}),(0,L.jsxs)(`main`,{className:`notes-main notes-mode-${e.viewMode}`,children:[(0,L.jsx)(Rs,{selectedPath:e.selectedPath,viewMode:e.viewMode,authoringMode:e.authoringMode,dirty:t.dirty,saving:t.saving,loading:t.loading,conflict:!!t.conflict,onViewModeChange:e.onViewModeChange,onAuthoringModeChange:e.onAuthoringModeChange,onSave:()=>void t.save(),onReload:()=>void t.reloadFromDisk()}),(0,L.jsxs)(`div`,{className:`notes-content`,children:[t.error&&(0,L.jsx)(`section`,{className:`state error-state`,children:t.error}),t.conflict&&(0,L.jsxs)(`section`,{className:`notes-conflict`,children:[(0,L.jsx)(`span`,{children:t.conflict.message}),(0,L.jsx)(`button`,{type:`button`,onClick:()=>void t.reloadFromDisk(),children:`Reload`}),(0,L.jsx)(`button`,{type:`button`,onClick:()=>void t.overwrite(),children:`Overwrite`}),(0,L.jsx)(`button`,{type:`button`,onClick:t.clearConflict,children:`Keep local`})]}),e.viewMode===`settings`&&(0,L.jsxs)(`section`,{className:`notes-settings`,children:[(0,L.jsxs)(`label`,{children:[(0,L.jsx)(`input`,{type:`checkbox`,checked:e.wordWrap,onChange:t=>e.onWordWrapChange(t.currentTarget.checked)}),`Word wrap`]}),(0,L.jsxs)(`label`,{children:[(0,L.jsx)(`input`,{type:`checkbox`,checked:e.vimMode,onChange:t=>e.onVimModeChange(t.currentTarget.checked)}),`Vim mode`]}),(0,L.jsxs)(`label`,{children:[`Tree width`,(0,L.jsx)(`input`,{type:`range`,min:`220`,max:`420`,value:e.treeWidth,onChange:t=>e.onTreeWidthChange(Number(t.currentTarget.value))})]}),(0,L.jsx)(Fa,{})]}),e.viewMode===`graph`&&(0,L.jsx)(I.Suspense,{fallback:(0,L.jsx)(`div`,{className:`notes-graph-loading`,children:`Loading graph...`}),children:(0,L.jsx)(Gs,{vaultIndex:e.vaultIndex,selectedPath:e.selectedPath,settings:e.notesGraphSettings,onSettingsChange:e.onNotesGraphSettingsChange,onNavigate:t=>{e.onSelectedPathChange(t),e.onViewModeChange(`raw`)}})}),!e.selectedPath&&e.viewMode!==`settings`&&e.viewMode!==`graph`&&(0,L.jsx)(ws,{}),e.selectedPath&&e.viewMode!==`settings`&&e.viewMode!==`graph`&&(0,L.jsxs)(`div`,{className:`notes-document-grid`,children:[(0,L.jsx)(`input`,{className:`notes-inline-title`,defaultValue:Js(e.selectedPath),onBlur:o,onKeyDown:e=>{e.key===`Enter`&&e.currentTarget.blur()},spellCheck:!1,"aria-label":`Note title`},e.selectedPath),!f&&(0,L.jsx)(Ts,{note:e.selectedNote,activeTag:e.tagFilter,onTagClick:e.onTagSelect}),s&&(0,L.jsx)(`div`,{className:`notes-editor-pane`,children:(0,L.jsx)(ys,{active:e.active&&s,authoringMode:e.authoringMode,content:t.content,notePath:e.selectedPath,outgoing:l,notes:d,activeTag:e.tagFilter,wordWrap:e.wordWrap,vimMode:e.vimMode,onChange:t.setContent,onTagSelect:e.onTagSelect,onWikiLinkNavigate:e.onWikiLinkNavigate},e.selectedPath)}),c&&(0,L.jsx)(bs,{markdown:t.content,outgoing:l,notes:d,onWikiLinkNavigate:e.onWikiLinkNavigate})]})]}),e.viewMode!==`graph`&&e.viewMode!==`settings`&&e.selectedPath&&(0,L.jsx)(Cs,{backlinks:u,onNavigate:e.onWikiLinkNavigate})]}),(0,L.jsx)(js,{open:r,notes:e.vaultIndex?.notes||[],selectedPath:e.selectedPath,onClose:()=>i(!1),onSelect:t=>{e.onSelectedPathChange(t),i(!1)}})]})}var Zs=`application/x-jaw-running-chip`;function Qs(e,t,n){let r=[],i=new Set;for(let a of e){if(a.hidden)continue;let e=a.port;if(i.has(e))continue;i.add(e);let o=n.has(e),s=a.status===`online`,c=a.status===`error`;!o&&!s&&!c||r.push({port:e,label:a.label||a.instanceId||`Port ${e}`,activity:t[e]||null,state:o?`busy`:c?`error`:`online`})}return r}function $s(e){return JSON.stringify({port:e.port,label:e.label,activity:e.activity,state:e.state})}function ec(e){let t=e.dataTransfer.getData(Zs);if(!t)return null;try{let e=JSON.parse(t);return typeof e.port==`number`?{port:e.port,label:typeof e.label==`string`?e.label:`Port ${e.port}`,activity:typeof e.activity==`string`?e.activity:null,state:e.state===`busy`||e.state===`error`?e.state:`online`}:null}catch{return null}}var tc=[{id:`backlog`,label:`Backlog`,policy:`Options not yet committed`},{id:`ready`,label:`Ready`,policy:`Pullable, clear enough to start`},{id:`active`,label:`In Progress`,policy:`Current WIP, keep starts limited`},{id:`review`,label:`Review`,policy:`Check output before delivery`},{id:`done`,label:`Done`,policy:`Delivered or no longer active`}];function nc(e){let t=(0,I.useMemo)(()=>Qs(e.instances,e.titlesByPort,e.busyPorts),[e.instances,e.titlesByPort,e.busyPorts]);return(0,L.jsxs)(`nav`,{className:`dashboard-board-sidebar`,"aria-label":`Board lanes`,children:[(0,L.jsxs)(`header`,{className:`dashboard-board-sidebar-header`,children:[(0,L.jsx)(`span`,{className:`dashboard-board-sidebar-title`,children:`Board`}),(0,L.jsxs)(`span`,{className:`dashboard-board-sidebar-count`,children:[t.length,` running`]})]}),(0,L.jsxs)(`section`,{className:`dashboard-board-sidebar-running`,"aria-label":`Running instances`,children:[(0,L.jsx)(`div`,{className:`dashboard-board-sidebar-section-title`,children:`Running`}),t.length===0?(0,L.jsx)(`p`,{className:`dashboard-board-sidebar-empty`,children:`No running instances`}):(0,L.jsx)(`div`,{className:`dashboard-board-sidebar-running-list`,children:t.map(e=>(0,L.jsxs)(`div`,{className:`dashboard-board-running-chip`,"data-state":e.state,draggable:!0,onDragStart:t=>{t.dataTransfer.effectAllowed=`copy`,t.dataTransfer.setData(Zs,$s(e))},"aria-label":e.activity?`${e.label} — ${e.activity}`:e.label,children:[(0,L.jsxs)(`span`,{className:`dashboard-board-running-chip-port`,children:[`:`,e.port]}),(0,L.jsx)(`span`,{className:`dashboard-board-running-chip-label`,children:e.label}),e.activity?(0,L.jsx)(`span`,{className:`dashboard-board-running-chip-activity`,children:e.activity}):null,(0,L.jsx)(`span`,{className:`dashboard-board-running-chip-state`,"data-state":e.state,children:e.state})]},e.port))})]}),(0,L.jsx)(`div`,{className:`dashboard-board-sidebar-section-title`,children:`Lanes`}),(0,L.jsxs)(`ul`,{className:`dashboard-board-sidebar-list`,children:[(0,L.jsx)(`li`,{children:(0,L.jsxs)(`button`,{type:`button`,className:`dashboard-board-sidebar-item${e.view.kind===`overall`?` is-active`:``}`,onClick:()=>e.onViewChange({kind:`overall`}),"aria-pressed":e.view.kind===`overall`,children:[(0,L.jsx)(`span`,{children:`Overall`}),(0,L.jsx)(`small`,{children:`Five-column workflow`})]})}),tc.map(t=>(0,L.jsx)(`li`,{children:(0,L.jsxs)(`button`,{type:`button`,className:`dashboard-board-sidebar-item${e.view.kind===`lane`&&e.view.lane===t.id?` is-active`:``}`,onClick:()=>e.onViewChange({kind:`lane`,lane:t.id}),"aria-pressed":e.view.kind===`lane`&&e.view.lane===t.id,children:[(0,L.jsx)(`span`,{children:t.label}),(0,L.jsx)(`small`,{children:t.policy})]})},t.id))]})]})}function rc(e,t){if(e.port===null)return`no instance`;let n=t.get(e.port);return n?`:${n.port} ${n.label}`:`:${e.port}`}function ic(e){let t=tc.find(t=>t.id===e.lane),n=t?.label??`Lane`,r=t?.policy??``,i=e.cards.filter(e=>e.port!==null).length,a=e.cards.length-i;return(0,L.jsxs)(`div`,{className:`dashboard-board-lane-detail-shell`,"data-lane":e.lane,children:[(0,L.jsxs)(`aside`,{className:`dashboard-board-lane-detail-sidebar`,"aria-label":`${n} filters`,children:[(0,L.jsxs)(`header`,{children:[(0,L.jsx)(`span`,{children:n}),(0,L.jsx)(`small`,{children:r})]}),(0,L.jsxs)(`div`,{className:`dashboard-board-lane-detail-counts`,children:[(0,L.jsxs)(`span`,{children:[(0,L.jsx)(`strong`,{children:e.cards.length}),` all`]}),(0,L.jsxs)(`span`,{children:[(0,L.jsx)(`strong`,{children:i}),` with instance`]}),(0,L.jsxs)(`span`,{children:[(0,L.jsx)(`strong`,{children:a}),` no instance`]})]}),(0,L.jsx)(`button`,{type:`button`,onClick:e.onBackToOverall,children:`Overall`})]}),(0,L.jsxs)(`section`,{className:`dashboard-board-lane-detail-content`,"aria-label":`${n} cards`,children:[(0,L.jsxs)(`header`,{className:`dashboard-board-lane-detail-header`,children:[(0,L.jsxs)(`div`,{children:[(0,L.jsxs)(`h2`,{children:[`Board / `,n]}),(0,L.jsx)(`p`,{children:e.lane===`done`?`Done archive, shown as compact two-line rows.`:`Lane detail, shown as compact rows for scan and reuse.`})]}),(0,L.jsx)(`button`,{type:`button`,onClick:e.onBackToOverall,children:`Close`})]}),e.cards.length===0?(0,L.jsx)(`p`,{className:`dashboard-board-lane-detail-empty`,children:`No items in this lane`}):(0,L.jsx)(`ul`,{className:`dashboard-board-compact-list`,children:e.cards.map(t=>(0,L.jsx)(`li`,{children:(0,L.jsxs)(`button`,{type:`button`,className:`dashboard-board-compact-row`,onClick:()=>e.onOpenCard(t.id),children:[(0,L.jsx)(`span`,{className:`dashboard-board-compact-row-title`,children:t.summary||t.title}),(0,L.jsx)(`span`,{className:`dashboard-board-compact-row-instance`,children:rc(t,e.runningChipByPort)})]})},t.id))})]})]})}var ac=`/api/dashboard/board`;function oc(e){return{...e,summary:e.summary??null,detail:e.detail??null}}async function sc(e){if(!e.ok){let t=await e.text().catch(()=>``);throw Error(`${e.status} ${t||e.statusText}`)}return await e.json()}async function cc(){let e=await sc(await fetch(`${ac}/tasks`,{credentials:`same-origin`,cache:`no-store`}));return Array.isArray(e.tasks)?e.tasks.map(oc):[]}async function lc(e){return oc((await sc(await fetch(`${ac}/tasks`,{method:`POST`,headers:{"content-type":`application/json`},credentials:`same-origin`,body:JSON.stringify(e)}))).task)}async function uc(e,t){return oc((await sc(await fetch(`${ac}/tasks/${encodeURIComponent(e)}`,{method:`PATCH`,headers:{"content-type":`application/json`},credentials:`same-origin`,body:JSON.stringify(t)}))).task)}async function dc(e){await sc(await fetch(`${ac}/tasks/${encodeURIComponent(e)}`,{method:`DELETE`,credentials:`same-origin`}))}function fc(e){let[t,n]=(0,I.useState)(``),[r,i]=(0,I.useState)(``),[a,o]=(0,I.useState)(``);if((0,I.useEffect)(()=>{n(e.card?.title??``),i(e.card?.summary??``),o(e.card?.detail??``)},[e.card]),!e.card)return null;function s(n){if(n.preventDefault(),!e.card)return;let i=t.trim();i&&e.onSave(e.card.id,{title:i,summary:r,detail:a})}return(0,L.jsx)(`div`,{className:`dashboard-board-dialog-backdrop`,role:`presentation`,onMouseDown:t=>{t.target===t.currentTarget&&e.onClose()},children:(0,L.jsxs)(`form`,{className:`dashboard-board-dialog`,role:`dialog`,"aria-modal":`true`,"aria-labelledby":`dashboard-board-dialog-title`,onSubmit:s,onKeyDown:t=>{t.key===`Escape`&&e.onClose()},children:[(0,L.jsxs)(`header`,{className:`dashboard-board-dialog-header`,children:[(0,L.jsxs)(`div`,{children:[(0,L.jsx)(`p`,{className:`dashboard-board-dialog-kicker`,children:`Kanban block`}),(0,L.jsx)(`h3`,{id:`dashboard-board-dialog-title`,children:`Edit card`})]}),(0,L.jsx)(`button`,{type:`button`,className:`dashboard-board-dialog-icon-button`,onClick:e.onClose,"aria-label":`Close card editor`,children:`×`})]}),(0,L.jsxs)(`label`,{className:`dashboard-board-dialog-field`,children:[(0,L.jsx)(`span`,{children:`Title`}),(0,L.jsx)(`input`,{autoFocus:!0,type:`text`,value:t,onChange:e=>n(e.currentTarget.value),maxLength:500,required:!0})]}),(0,L.jsxs)(`label`,{className:`dashboard-board-dialog-field`,children:[(0,L.jsx)(`span`,{children:`One-line note`}),(0,L.jsx)(`input`,{type:`text`,value:r,onChange:e=>i(e.currentTarget.value),maxLength:500,placeholder:`Short visible memo for the card`})]}),(0,L.jsxs)(`label`,{className:`dashboard-board-dialog-field`,children:[(0,L.jsx)(`span`,{children:`Details`}),(0,L.jsx)(`textarea`,{value:a,onChange:e=>o(e.currentTarget.value),maxLength:2e4,rows:10,placeholder:`Write Markdown here. It is stored as raw text for now.`})]}),(0,L.jsxs)(`footer`,{className:`dashboard-board-dialog-footer`,children:[(0,L.jsx)(`span`,{className:`dashboard-board-dialog-storage`,children:`Markdown`}),(0,L.jsxs)(`div`,{className:`dashboard-board-dialog-actions`,children:[(0,L.jsx)(`button`,{type:`button`,onClick:e.onClose,children:`Cancel`}),(0,L.jsx)(`button`,{type:`submit`,disabled:e.busy||!t.trim(),children:`Save`})]})]})]})})}var pc=`application/x-jaw-board-task`;function mc(e){return e.kind===`open`?(0,L.jsxs)(`svg`,{viewBox:`0 0 20 20`,width:`14`,height:`14`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.7`,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":`true`,focusable:`false`,children:[(0,L.jsx)(`path`,{d:`M7 4h-2.5a1.5 1.5 0 0 0-1.5 1.5v10a1.5 1.5 0 0 0 1.5 1.5h10a1.5 1.5 0 0 0 1.5-1.5V13`}),(0,L.jsx)(`path`,{d:`M10 3h7v7`}),(0,L.jsx)(`path`,{d:`M9 11 17 3`})]}):e.kind===`move`?(0,L.jsxs)(`svg`,{viewBox:`0 0 20 20`,width:`14`,height:`14`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.7`,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":`true`,focusable:`false`,children:[(0,L.jsx)(`path`,{d:`M10 2v16`}),(0,L.jsx)(`path`,{d:`M6 6 10 2l4 4`}),(0,L.jsx)(`path`,{d:`m6 14 4 4 4-4`}),(0,L.jsx)(`path`,{d:`M2 10h16`}),(0,L.jsx)(`path`,{d:`m6 6-4 4 4 4`}),(0,L.jsx)(`path`,{d:`m14 6 4 4-4 4`})]}):(0,L.jsxs)(`svg`,{viewBox:`0 0 20 20`,width:`14`,height:`14`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.7`,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":`true`,focusable:`false`,children:[(0,L.jsx)(`path`,{d:`M3 5h14`}),(0,L.jsx)(`path`,{d:`M8 5V3h4v2`}),(0,L.jsx)(`path`,{d:`M6 8v8`}),(0,L.jsx)(`path`,{d:`M10 8v8`}),(0,L.jsx)(`path`,{d:`M14 8v8`}),(0,L.jsx)(`path`,{d:`M5 5l1 13h8l1-13`})]})}function hc(e){return JSON.stringify({id:e.id,lane:e.lane})}function gc(e){let t=e.dataTransfer.getData(pc);if(!t)return null;try{let e=JSON.parse(t);if(typeof e.id!=`string`)return null;let n=tc.find(t=>t.id===e.lane)?.id;return n?{id:e.id,lane:n}:null}catch{return null}}function _c(e,t){return Array.from(e.dataTransfer.types).includes(t)}function vc(e){return{id:e.id,title:e.title,summary:e.summary??null,detail:e.detail??null,lane:e.lane,port:e.port,source:e.source,persisted:!0}}function yc(e){return e==null?null:e.trim()||null}function bc(e){let[t,n]=(0,I.useState)([]),[r,i]=(0,I.useState)(null),[a,o]=(0,I.useState)(``),[s,c]=(0,I.useState)(!1),[l,u]=(0,I.useState)(null),[d,f]=(0,I.useState)(null),[p,m]=(0,I.useState)(null),[h,g]=(0,I.useState)(null),[_,v]=(0,I.useState)(!1),y=(0,I.useRef)(null),b=(0,I.useCallback)(async()=>{try{n(await cc())}catch{}},[]);(0,I.useEffect)(()=>{e.active&&b()},[e.active,b]),(0,I.useEffect)(()=>{if(!l)return;let e=e=>{y.current&&(y.current.contains(e.target)||u(null))};return document.addEventListener(`mousedown`,e),()=>document.removeEventListener(`mousedown`,e)},[l]);let x=(0,I.useCallback)(async e=>{let t=a.trim();if(!(!t||s)){c(!0);try{await lc({title:t,lane:e}),o(``),i(null),await b()}catch{}finally{c(!1)}}},[a,s,b]),S=(0,I.useCallback)(async(e,t)=>{u(null);try{await uc(e,{lane:t}),await b()}catch{}},[b]),ee=(0,I.useCallback)(async e=>{try{await dc(e),await b()}catch{}},[b]),te=(0,I.useCallback)(async(e,t)=>{if(!_){v(!0);try{let r=await uc(e,t);n(n=>n.map(n=>n.id===e?{...n,...r,summary:t.summary===void 0?r.summary??n.summary:yc(t.summary),detail:t.detail===void 0?r.detail??n.detail:yc(t.detail)}:n)),g(null)}catch{}finally{v(!1)}}},[_]),C=(0,I.useCallback)(async(e,t)=>{try{await uc(e,{port:t}),await b()}catch{}},[b]),w=(0,I.useCallback)(async e=>{try{await uc(e,{port:null}),await b()}catch{}},[b]),T=(0,I.useCallback)((e,t)=>{t.preventDefault(),f(null);let n=gc(t);!n||n.lane===e||S(n.id,e)},[S]),ne=(0,I.useCallback)((e,t)=>{if(!_c(t,`application/x-jaw-running-chip`))return;t.preventDefault(),t.stopPropagation(),m(null);let n=ec(t);n&&C(e,n.port)},[C]),E=(0,I.useMemo)(()=>t.map(vc),[t]),re=(0,I.useMemo)(()=>{let e=h?E.find(e=>e.id===h):null;return e?{id:e.id,title:e.title,summary:e.summary,detail:e.detail}:null},[E,h]),ie=(0,I.useMemo)(()=>Qs(e.instances,e.titlesByPort,e.busyPorts),[e.instances,e.titlesByPort,e.busyPorts]),ae=(0,I.useMemo)(()=>new Map(ie.map(e=>[e.port,e])),[ie]),oe=e.view.kind===`lane`?e.view.lane:null;return(0,L.jsxs)(`section`,{className:`dashboard-board-workspace`,"aria-hidden":!e.active,children:[(0,L.jsxs)(`header`,{className:`dashboard-board-workspace-header`,children:[(0,L.jsxs)(`div`,{className:`dashboard-board-workspace-header-text`,children:[(0,L.jsx)(`h2`,{children:`Board`}),(0,L.jsx)(`p`,{className:`dashboard-board-workspace-subtitle`,children:`Create human-owned kanban blocks, then drag running instance blocks into a card to attach context without touching the instance itself.`})]}),(0,L.jsx)(`div`,{className:`dashboard-board-workspace-controls`,children:(0,L.jsx)(Ni,{topic:`board`,label:`Open Board help`,onOpen:e.onOpenHelpTopic})})]}),oe===null?(0,L.jsx)(`div`,{className:`dashboard-board-lanes`,children:tc.map(t=>{let n=E.filter(e=>e.lane===t.id),c=t.id===`done`?n.slice(0,4):n,h=t.id===`done`?Math.max(0,n.length-4):0,_=r===t.id;return(0,L.jsxs)(`div`,{className:`dashboard-board-lane${d===t.id?` is-drop-target`:``}`,"data-lane":t.id,onDragOver:e=>{_c(e,pc)&&(e.preventDefault(),e.dataTransfer.dropEffect=`move`,d!==t.id&&f(t.id))},onDragLeave:()=>{d===t.id&&f(null)},onDrop:e=>T(t.id,e),children:[(0,L.jsxs)(`header`,{className:`dashboard-board-lane-header`,children:[(0,L.jsx)(`span`,{className:`dashboard-board-lane-title`,children:t.label}),(0,L.jsx)(`span`,{className:`dashboard-board-lane-policy`,children:t.policy}),(0,L.jsx)(`span`,{className:`dashboard-board-lane-count`,children:n.length})]}),(0,L.jsxs)(`ul`,{className:`dashboard-board-lane-cards`,children:[n.length===0?(0,L.jsx)(`li`,{className:`dashboard-board-lane-empty`,children:`No items`}):c.map(e=>{let t=e.port===null?null:ae.get(e.port)??null;return(0,L.jsxs)(`li`,{className:`dashboard-board-card${p===e.id?` is-instance-drop-target`:``}`,"data-lane":e.lane,"data-source":e.source,"data-persisted":e.persisted?`true`:`false`,draggable:!0,onDragStart:t=>{t.dataTransfer.effectAllowed=`move`,t.dataTransfer.setData(pc,hc(e))},onDragOver:t=>{_c(t,`application/x-jaw-running-chip`)&&(t.preventDefault(),t.stopPropagation(),t.dataTransfer.dropEffect=`copy`,p!==e.id&&m(e.id))},onDragLeave:()=>{p===e.id&&m(null)},onDrop:t=>ne(e.id,t),children:[(0,L.jsx)(`span`,{className:`dashboard-board-card-title`,children:e.title}),e.summary?(0,L.jsx)(`span`,{className:`dashboard-board-card-summary`,title:e.summary,children:e.summary}):null,(0,L.jsx)(`div`,{className:`dashboard-board-card-instance-slot`,"data-empty":t?`false`:`true`,children:t?(0,L.jsxs)(`div`,{className:`dashboard-board-card-instance`,"data-state":t.state,draggable:!0,onDragStart:e=>{e.stopPropagation(),e.dataTransfer.effectAllowed=`copy`,e.dataTransfer.setData(Zs,$s(t))},title:t.activity?`${t.label} — ${t.activity}`:t.label,children:[(0,L.jsxs)(`span`,{className:`dashboard-board-card-instance-port`,children:[`:`,t.port]}),(0,L.jsx)(`span`,{className:`dashboard-board-card-instance-label`,children:t.label}),(0,L.jsx)(`button`,{type:`button`,className:`dashboard-board-card-instance-detach`,onClick:()=>void w(e.id),"aria-label":`Detach :${t.port} from card`,title:`Detach instance`,children:`-`}),t.activity?(0,L.jsx)(`span`,{className:`dashboard-board-card-instance-activity`,title:t.activity,children:t.activity}):null]}):(0,L.jsx)(`span`,{className:`dashboard-board-card-instance-empty`,children:`Drop a running instance here`})}),e.persisted?(0,L.jsxs)(`span`,{className:`dashboard-board-card-actions`,"data-open":l===e.id?`true`:`false`,children:[(0,L.jsx)(`button`,{type:`button`,className:`dashboard-board-card-action`,onMouseDown:e=>e.stopPropagation(),onClick:()=>g(e.id),"aria-label":`Open card details`,title:`Open`,children:(0,L.jsx)(mc,{kind:`open`})}),(0,L.jsx)(`button`,{type:`button`,className:`dashboard-board-card-action`,onMouseDown:e=>e.stopPropagation(),onClick:()=>u(t=>t===e.id?null:e.id),"aria-haspopup":`menu`,"aria-expanded":l===e.id,"aria-label":`Move card`,title:`Move`,children:(0,L.jsx)(mc,{kind:`move`})}),(0,L.jsx)(`button`,{type:`button`,className:`dashboard-board-card-action`,"data-danger":`true`,onClick:()=>void ee(e.id),"aria-label":`Delete card`,title:`Delete`,children:(0,L.jsx)(mc,{kind:`delete`})}),l===e.id&&(0,L.jsx)(`div`,{ref:y,className:`dashboard-board-popover`,role:`menu`,children:tc.map(t=>(0,L.jsxs)(`button`,{type:`button`,className:`dashboard-board-popover-item${t.id===e.lane?` is-current`:``}`,role:`menuitem`,disabled:t.id===e.lane,onClick:()=>void S(e.id,t.id),children:[t.label,t.id===e.lane?` ✓`:``]},t.id))})]}):null]},e.id)}),h>0?(0,L.jsx)(`li`,{children:(0,L.jsxs)(`button`,{type:`button`,className:`dashboard-board-done-more`,onClick:()=>e.onViewChange({kind:`lane`,lane:`done`}),children:[(0,L.jsxs)(`span`,{children:[`+ `,h,` more done`]}),(0,L.jsx)(`small`,{children:`Open archive`})]})}):null]}),(0,L.jsx)(`div`,{className:`dashboard-board-lane-add`,children:_?(0,L.jsxs)(`form`,{className:`dashboard-board-add-composer`,onSubmit:e=>{e.preventDefault(),x(t.id)},children:[(0,L.jsx)(`input`,{autoFocus:!0,type:`text`,value:a,onChange:e=>o(e.target.value),placeholder:`New ${t.label} task`,disabled:s,"aria-label":`New task for ${t.label}`,onKeyDown:e=>{e.key===`Escape`&&(i(null),o(``))}}),(0,L.jsx)(`button`,{type:`submit`,disabled:s||!a.trim(),children:`Add`}),(0,L.jsx)(`button`,{type:`button`,onClick:()=>{i(null),o(``)},"aria-label":`Cancel`,children:`×`})]}):(0,L.jsx)(`button`,{type:`button`,className:`dashboard-board-add-trigger`,onClick:()=>{i(t.id),o(``)},children:`+ Add task`})})]},t.id)})}):(0,L.jsx)(ic,{lane:oe,cards:E.filter(e=>e.lane===oe),runningChipByPort:ae,onBackToOverall:()=>e.onViewChange({kind:`overall`}),onOpenCard:g}),(0,L.jsx)(fc,{card:re,busy:_,onClose:()=>g(null),onSave:te})]})}var xc=[{id:`today`,label:`Today`},{id:`upcoming`,label:`Upcoming`},{id:`recurring`,label:`Recurring`},{id:`blocked`,label:`Blocked`}];function Sc(e){return(0,L.jsxs)(`nav`,{className:`dashboard-schedule-sidebar`,"aria-label":`Schedule groups`,children:[(0,L.jsx)(`header`,{className:`dashboard-schedule-sidebar-header`,children:(0,L.jsx)(`span`,{className:`dashboard-schedule-sidebar-title`,children:`Schedule`})}),(0,L.jsx)(`ul`,{className:`dashboard-schedule-sidebar-list`,children:xc.map(t=>(0,L.jsx)(`li`,{children:(0,L.jsx)(`button`,{type:`button`,className:`dashboard-schedule-sidebar-item${e.activeGroup===t.id?` is-active`:``}`,onClick:()=>e.onGroupChange(t.id),"aria-pressed":e.activeGroup===t.id,children:(0,L.jsx)(`span`,{children:t.label})})},t.id))})]})}var Cc=`/api/dashboard/schedule`;async function wc(e){if(!e.ok){let t=await e.text().catch(()=>``);throw Error(`${e.status} ${t||e.statusText}`)}return await e.json()}async function Tc(){let e=await wc(await fetch(`${Cc}/work`,{credentials:`same-origin`}));return Array.isArray(e.items)?e.items:[]}async function Ec(e){return(await wc(await fetch(`${Cc}/work`,{method:`POST`,headers:{"content-type":`application/json`},credentials:`same-origin`,body:JSON.stringify(e)}))).item}async function Dc(e,t){return(await wc(await fetch(`${Cc}/work/${encodeURIComponent(e)}`,{method:`PATCH`,headers:{"content-type":`application/json`},credentials:`same-origin`,body:JSON.stringify(t)}))).item}async function Oc(e){await wc(await fetch(`${Cc}/work/${encodeURIComponent(e)}`,{method:`DELETE`,credentials:`same-origin`}))}async function kc(e,t=[]){let n=await wc(await fetch(`${Cc}/work/${encodeURIComponent(e)}/dispatch`,{method:`POST`,headers:{"content-type":`application/json`},credentials:`same-origin`,body:JSON.stringify({busyPorts:t})}));return{result:n.result,item:n.item}}async function Ac(){try{let e=await fetch(`/api/heartbeat`,{credentials:`same-origin`});if(!e.ok)return[];let t=await e.json();return Array.isArray(t.jobs)?t.jobs:[]}catch{return[]}}function jc(e){return e.cron?`cron ${e.cron}`:e.runAt?`at ${e.runAt}`:e.enabled?`manual`:`disabled`}function Mc(e){let[t,n]=(0,I.useState)([]),[r,i]=(0,I.useState)([]),[a,o]=(0,I.useState)(!1),[s,c]=(0,I.useState)(null),[l,u]=(0,I.useState)(``),[d,f]=(0,I.useState)(!1),[p,m]=(0,I.useState)({}),[h,g]=(0,I.useState)(null),_=(0,I.useRef)(null),v=(0,I.useCallback)(async()=>{try{i(await Tc())}catch{}},[]);(0,I.useEffect)(()=>{if(!e.active)return;let t=!1;return Promise.all([Ac(),Tc().catch(()=>[])]).then(([e,r])=>{t||(n(e),i(r),o(!0))}),()=>{t=!0}},[e.active]),(0,I.useEffect)(()=>{if(!h)return;let e=e=>{_.current&&(_.current.contains(e.target)||g(null))};return document.addEventListener(`mousedown`,e),()=>document.removeEventListener(`mousedown`,e)},[h]);let y=(0,I.useCallback)(async e=>{let t=l.trim();if(!(!t||d)){f(!0);try{await Ec({title:t,group:e}),u(``),c(null),await v()}catch{}finally{f(!1)}}},[l,d,v]),b=(0,I.useCallback)(async(e,t)=>{g(null);try{await Dc(e,{group:t}),await v()}catch{}},[v]),x=(0,I.useCallback)(async e=>{try{await Oc(e),await v()}catch{}},[v]),S=(0,I.useCallback)(async t=>{try{let n=e.busyPorts,{result:r}=await kc(t,Array.isArray(n)?n:n?Array.from(n):[]);m(e=>({...e,[t]:r})),await v()}catch{}},[e.busyPorts,v]);return(0,L.jsxs)(`section`,{className:`dashboard-schedule-workspace`,"aria-hidden":!e.active,children:[(0,L.jsxs)(`header`,{className:`dashboard-schedule-workspace-header`,children:[(0,L.jsxs)(`div`,{children:[(0,L.jsx)(`h2`,{children:`Automations`}),(0,L.jsx)(`p`,{className:`dashboard-schedule-workspace-subtitle`,children:`Manager-owned scheduled work. The dashboard ticks once a minute and dispatches due items.`})]}),(0,L.jsx)(Ni,{topic:`schedule`,label:`Open Automations help`,onOpen:e.onOpenHelpTopic}),t.length>0?(0,L.jsxs)(`p`,{className:`dashboard-schedule-legacy-notice`,role:`note`,children:[`⚠️ `,t.length,` legacy heartbeat job(s) detected in this instance's `,(0,L.jsx)(`code`,{children:`heartbeat.json`}),`. They are no longer auto-fired by the manager — migrate them into Automations.`]}):null]}),(0,L.jsx)(`div`,{className:`dashboard-schedule-groups`,children:xc.map(t=>{let n=r.filter(e=>e.group===t.id).filter(e=>e.enabled),i=n.length,o=s===t.id;return(0,L.jsxs)(`div`,{className:`dashboard-schedule-group${e.activeGroup===t.id?` is-focused`:``}`,children:[(0,L.jsxs)(`header`,{className:`dashboard-schedule-group-header`,children:[(0,L.jsx)(`span`,{className:`dashboard-schedule-group-title`,children:t.label}),(0,L.jsx)(`span`,{className:`dashboard-schedule-group-count`,children:i})]}),(0,L.jsx)(`ul`,{className:`dashboard-schedule-items`,children:a?i===0?(0,L.jsx)(`li`,{className:`dashboard-schedule-empty`,children:`No items`}):(0,L.jsx)(L.Fragment,{children:n.map(e=>{let t=p[e.id],n=e.lastRunAt?`last ${e.lastRunAt.slice(11,16)}`:null,r=e.lastStatus||null;return(0,L.jsxs)(`li`,{className:`dashboard-schedule-item`,"data-persisted":`true`,"data-dispatch-status":t?.status||``,children:[(0,L.jsx)(`span`,{className:`dashboard-schedule-item-name`,children:e.title}),(0,L.jsxs)(`span`,{className:`dashboard-schedule-item-meta`,children:[jc(e),` • saved`,e.targetPort==null?``:` • :${e.targetPort}`,n?` • ${n}`:``,r?` • ${r}`:``,t?` • ${t.status}`:``]}),(0,L.jsxs)(`span`,{className:`dashboard-schedule-item-actions`,"data-open":h===e.id?`true`:`false`,children:[(0,L.jsx)(`button`,{type:`button`,className:`dashboard-schedule-run-now`,onClick:()=>void S(e.id),"aria-label":`Run now`,title:`Dispatch to target instance (queued if busy)`,children:`Run`}),(0,L.jsx)(`button`,{type:`button`,className:`dashboard-schedule-item-action`,onMouseDown:e=>e.stopPropagation(),onClick:()=>g(t=>t===e.id?null:e.id),"aria-haspopup":`menu`,"aria-expanded":h===e.id,"aria-label":`Move scheduled work`,children:`Move`}),(0,L.jsx)(`button`,{type:`button`,className:`dashboard-schedule-item-action`,"data-danger":`true`,onClick:()=>void x(e.id),"aria-label":`Delete`,children:`Delete`}),h===e.id&&(0,L.jsx)(`div`,{ref:_,className:`dashboard-schedule-popover`,role:`menu`,children:xc.map(t=>(0,L.jsxs)(`button`,{type:`button`,className:`dashboard-schedule-popover-item${t.id===e.group?` is-current`:``}`,role:`menuitem`,disabled:t.id===e.group,onClick:()=>void b(e.id,t.id),children:[t.label,t.id===e.group?` ✓`:``]},t.id))})]})]},e.id)})}):(0,L.jsx)(`li`,{className:`dashboard-schedule-empty`,children:`Loading…`})}),(0,L.jsx)(`div`,{className:`dashboard-schedule-group-add`,children:o?(0,L.jsxs)(`form`,{className:`dashboard-schedule-add-composer`,onSubmit:e=>{e.preventDefault(),y(t.id)},children:[(0,L.jsx)(`input`,{autoFocus:!0,type:`text`,value:l,onChange:e=>u(e.target.value),placeholder:`New ${t.label} item`,disabled:d,"aria-label":`New scheduled work for ${t.label}`,onKeyDown:e=>{e.key===`Escape`&&(c(null),u(``))}}),(0,L.jsx)(`button`,{type:`submit`,disabled:d||!l.trim(),children:`Add`}),(0,L.jsx)(`button`,{type:`button`,onClick:()=>{c(null),u(``)},"aria-label":`Cancel`,children:`×`})]}):(0,L.jsx)(`button`,{type:`button`,className:`dashboard-schedule-add-trigger`,onClick:()=>{c(t.id),u(``)},children:`+ Add scheduled work`})})]},t.id)})})]})}var Nc=1e3;function Pc(e,t){return Ic(e)-Ic(t)||Rc(e)-Rc(t)||Lc(e)-Lc(t)||W(e)-W(t)||Date.parse(e.sourceCreatedAt)-Date.parse(t.sourceCreatedAt)}function Fc(e,t){let n=e?.manualRank??null,r=t?.manualRank??null;return n===null&&r===null?Nc:n===null&&r!==null?r-Nc:n!==null&&r===null?n+Nc:n!==null&&r!==null?(n+r)/2:Nc}function Ic(e){return e.status===`focused`?0:1}function Lc(e){return e.manualRank??2**53-1}function W(e){let t=[e.remindAt,e.dueAt].filter(e=>!!e).map(e=>Date.parse(e)).filter(e=>Number.isFinite(e));return t.length>0?Math.min(...t):2**53-1}function Rc(e){return e.priority===`high`?0:e.priority===`normal`?1:2}var zc=[{id:`urgentImportant`,title:`Important and Urgent`,tone:`red`},{id:`important`,title:`Important, Not Urgent`,tone:`green`},{id:`waiting`,title:`Waiting / Delegated`,tone:`amber`},{id:`later`,title:`Later`,tone:`blue`}],Bc={urgentImportant:{listId:`today`,status:`open`,priority:`high`},important:{listId:`today`,status:`open`,priority:`normal`},waiting:{listId:`waiting`,status:`waiting`,priority:`normal`},later:{listId:`later`,status:`open`,priority:`low`}};function Vc(e){return Bc[e]}function Hc(e){return e.status===`done`?null:e.status===`focused`?`urgentImportant`:e.status===`waiting`?`waiting`:e.listId===`later`||e.priority===`low`?`later`:e.priority===`high`?`urgentImportant`:`important`}function Uc(e,t){return t.filter(t=>Hc(t)===e).sort(Pc)}function Wc(e,t){return e===`matrix`?t.filter(e=>e.status!==`done`).sort(Pc):e===`done`?t.filter(e=>e.status===`done`).sort(Pc):e===`focused`?Uc(`urgentImportant`,t):e===`important`?Uc(`important`,t):e===`waiting`?Uc(`waiting`,t):e===`later`?Uc(`later`,t):t.filter(e=>e.status!==`done`).sort(Pc)}function Gc(e,t){return Wc(e,t).length}function Kc(e,t=3){return e.filter(e=>e.status!==`done`).sort(Pc).slice(0,t)}var qc=`application/x-jaw-dashboard-reminder`;function Jc(e){return Array.from(e.dataTransfer.types).includes(qc)}function Yc(e){let[t,n]=(0,I.useState)(null),[r,i]=(0,I.useState)(null);function a(e,t){if(t.target instanceof HTMLElement&&t.target.closest(`input, textarea, button, [data-reminder-inline-edit="true"]`)){t.preventDefault();return}t.dataTransfer.effectAllowed=`move`,t.dataTransfer.setData(qc,e.id),n(e.id)}function o(e,t){Jc(t)&&(t.preventDefault(),t.dataTransfer.dropEffect=`move`,i(e))}function s(){i(null)}function c(t,r){if(!Jc(r))return;r.preventDefault();let a=r.dataTransfer.getData(qc);n(null),i(null),a&&e(a,t)}function l(){n(null),i(null)}return{draggedId:t,dropTarget:r,start:a,over:o,leave:s,drop:c,end:l}}var Xc=[{id:`matrix`,label:`Matrix`,detail:`Priority board`},{id:`focused`,label:`Focus`,detail:`Current item`},{id:`important`,label:`Important`,detail:`Not urgent`},{id:`waiting`,label:`Waiting`,detail:`Delegated`},{id:`later`,label:`Later`,detail:`Low urgency`},{id:`done`,label:`Done`,detail:`Completed items`}];function Zc(e,t){return!!(e&&e.kind===t.kind&&e.beforeId===t.beforeId&&e.afterId===t.afterId)}function Qc(e){return e.length>0?e[e.length-1]??null:null}function $c(e,t){return{kind:`priority`,beforeId:e[t-1]?.id??null,afterId:e[t]?.id??null}}function el(e){return{kind:`priority`,beforeId:Qc(e)?.id??null,afterId:null}}function tl(e,t,n){let r=e.filter(e=>e.id!==t),i=n.beforeId?r.find(e=>e.id===n.beforeId)??null:null,a=n.afterId?r.find(e=>e.id===n.afterId)??null:null;return i||a?{previous:i,next:a}:n.beforeId&&!n.afterId?{previous:Qc(r),next:null}:!n.beforeId&&n.afterId?{previous:null,next:r[0]??null}:{previous:Qc(r),next:null}}function nl(e){let t=el(e.items),n=(t,n)=>e.drag.over(t,n),r=(t,n)=>e.drag.drop(t,n);return(0,L.jsxs)(`section`,{className:`dashboard-reminders-sidebar-priority`,"data-drop-target":e.drag.dropTarget?.kind===`priority`?`true`:`false`,onDragOver:e=>n(t,e),onDragLeave:e.drag.leave,onDrop:e=>r(t,e),children:[(0,L.jsxs)(`header`,{children:[(0,L.jsx)(`span`,{children:`Priority Order`}),(0,L.jsx)(`small`,{children:`drag to rank`})]}),(0,L.jsxs)(`ol`,{children:[e.items.map((t,i)=>{let a=$c(e.items,i);return(0,L.jsxs)(`li`,{draggable:!e.loading&&t.status!==`done`,"data-drop-target":Zc(e.drag.dropTarget,a)?`true`:void 0,"data-reminder-drop-before-id":a.beforeId??void 0,"data-reminder-drop-after-id":a.afterId??void 0,onDragStart:n=>e.drag.start(t,n),onDragEnd:e.drag.end,onDragOver:e=>{e.stopPropagation(),n(a,e)},onDragLeave:t=>{t.stopPropagation(),e.drag.leave()},onDrop:e=>{e.stopPropagation(),r(a,e)},children:[(0,L.jsx)(`span`,{className:`dashboard-reminders-sidebar-priority-index`,children:i+1}),(0,L.jsxs)(`span`,{children:[(0,L.jsx)(`b`,{children:t.title}),(0,L.jsxs)(`small`,{children:[t.status,` • `,t.priority]})]})]},t.id)}),e.items.length===0?(0,L.jsx)(`li`,{className:`dashboard-reminders-sidebar-priority-empty`,children:`No open reminders`}):null]})]})}function rl(e){let t=e.items.filter(e=>e.status!==`done`).length,n=Kc(e.items,5),r=Yc((t,n)=>{if(n.kind!==`priority`)return;let{previous:r,next:i}=tl(Kc(e.items,e.items.length),t,n);e.onUpdate(t,{manualRank:Fc(r,i)})});return(0,L.jsxs)(`nav`,{className:`dashboard-reminders-sidebar`,"aria-label":`Reminders views`,children:[(0,L.jsxs)(`header`,{className:`dashboard-reminders-sidebar-header`,children:[(0,L.jsx)(`span`,{className:`dashboard-reminders-sidebar-title`,children:`Reminders`}),(0,L.jsx)(`button`,{type:`button`,className:`dashboard-reminders-refresh`,onClick:e.onRefresh,disabled:e.loading,children:e.loading?`Loading`:`Refresh`})]}),(0,L.jsxs)(`div`,{className:`dashboard-reminders-source`,"data-state":`ok`,children:[t,` open / `,e.items.length,` total`]}),(0,L.jsx)(nl,{items:n,loading:e.loading,drag:r}),(0,L.jsx)(`ul`,{className:`dashboard-reminders-sidebar-list`,children:Xc.map(t=>(0,L.jsx)(`li`,{children:(0,L.jsxs)(`button`,{type:`button`,className:`dashboard-reminders-sidebar-item${e.view===t.id?` is-active`:``}`,onClick:()=>e.onViewChange(t.id),"aria-pressed":e.view===t.id,children:[(0,L.jsx)(`span`,{children:t.label}),(0,L.jsx)(`small`,{children:t.detail}),(0,L.jsx)(`b`,{children:Gc(t.id,e.items)})]})},t.id))})]})}function il(e){let[t,n]=(0,I.useState)(!1),[r,i]=(0,I.useState)(e.item.title),a=(0,I.useRef)(null);(0,I.useEffect)(()=>{t||i(e.item.title)},[t,e.item.title]),(0,I.useEffect)(()=>{t&&a.current?.select()},[t]);function o(){let t=r.trim();if(n(!1),!t||t===e.item.title){i(e.item.title);return}e.onRename(e.item.id,t)}function s(){i(e.item.title),n(!1)}function c(e){e.key===`Enter`?(e.preventDefault(),o()):e.key===`Escape`&&(e.preventDefault(),s())}return t?(0,L.jsx)(`input`,{ref:a,"data-reminder-inline-edit":`true`,className:`dashboard-reminders-inline-title-input`,"aria-label":`Reminder title`,disabled:e.busy,value:r,onChange:e=>i(e.target.value),onBlur:o,onClick:e=>e.stopPropagation(),onDoubleClick:e=>e.stopPropagation(),onKeyDown:c}):(0,L.jsx)(`span`,{className:`dashboard-reminders-inline-title`,onDoubleClick:e=>{e.preventDefault(),e.stopPropagation(),n(!0)},children:e.item.title})}function al(e){let[t,n]=(0,I.useState)(``),[r,i]=(0,I.useState)(``),[a,o]=(0,I.useState)(``),[s,c]=(0,I.useState)(``);(0,I.useEffect)(()=>{n(e.item?.title??``),i(e.item?.notes??``),o(ol(e.item?.dueAt??null)),c(ol(e.item?.remindAt??null))},[e.item]),(0,I.useEffect)(()=>{if(!e.item)return;let t=t=>{t.key===`Escape`&&e.onClose()};return document.addEventListener(`keydown`,t),()=>document.removeEventListener(`keydown`,t)},[e]);let l=(0,I.useMemo)(()=>e.item?t.trim()!==e.item.title||r!==e.item.notes||a!==ol(e.item.dueAt)||s!==ol(e.item.remindAt):!1,[a,r,e.item,s,t]);if(!e.item)return null;let u=e.item;return(0,L.jsx)(`div`,{className:`dashboard-reminder-popover-scrim`,role:`presentation`,onMouseDown:e.onClose,children:(0,L.jsx)(`section`,{className:`dashboard-reminder-popover`,role:`dialog`,"aria-modal":`true`,"aria-label":`Reminder details`,onMouseDown:e=>e.stopPropagation(),children:(0,L.jsxs)(`form`,{onSubmit:n=>{if(n.preventDefault(),!u)return;let i=t.trim();if(!i)return;let o={};if(i!==u.title&&(o.title=i),r!==u.notes&&(o.notes=r),a!==ol(u.dueAt)&&(o.dueAt=sl(a)),s!==ol(u.remindAt)&&(o.remindAt=sl(s)),Object.keys(o).length===0){e.onClose();return}e.onSave(u.id,o)},children:[(0,L.jsxs)(`header`,{children:[(0,L.jsx)(`span`,{children:`Reminder details`}),(0,L.jsx)(`button`,{type:`button`,"aria-label":`Close reminder details`,onClick:e.onClose,children:`×`})]}),(0,L.jsxs)(`label`,{children:[(0,L.jsx)(`span`,{children:`Title`}),(0,L.jsx)(`input`,{value:t,onChange:e=>n(e.target.value),"aria-label":`Reminder title`})]}),(0,L.jsxs)(`label`,{children:[(0,L.jsx)(`span`,{children:`Notes`}),(0,L.jsx)(`textarea`,{value:r,onChange:e=>i(e.target.value),"aria-label":`Reminder notes`,rows:6})]}),(0,L.jsxs)(`div`,{className:`dashboard-reminder-popover-grid`,children:[(0,L.jsxs)(`label`,{children:[(0,L.jsx)(`span`,{children:`Due`}),(0,L.jsx)(`input`,{type:`datetime-local`,value:a,onChange:e=>o(e.target.value),"aria-label":`Reminder due date`})]}),(0,L.jsxs)(`label`,{children:[(0,L.jsx)(`span`,{children:`Remind`}),(0,L.jsx)(`input`,{type:`datetime-local`,value:s,onChange:e=>c(e.target.value),"aria-label":`Reminder notification date`})]})]}),(0,L.jsxs)(`footer`,{children:[(0,L.jsx)(`button`,{type:`button`,onClick:e.onClose,children:`Cancel`}),(0,L.jsx)(`button`,{type:`submit`,disabled:e.busy||!t.trim()||!l,children:`Save`})]})]})})})}function ol(e){if(!e)return``;let t=new Date(e);if(Number.isNaN(t.getTime()))return``;let n=t.getTimezoneOffset()*6e4;return new Date(t.getTime()-n).toISOString().slice(0,16)}function sl(e){if(!e.trim())return null;let t=new Date(e);return Number.isNaN(t.getTime())?null:t.toISOString()}var G={matrix:`Priority Matrix`,focused:`Focus`,important:`Important, Not Urgent`,waiting:`Waiting / Delegated`,later:`Later`,done:`Done`};function cl(e){if(!e)return null;let t=new Date(e);return Number.isNaN(t.getTime())?e:t.toLocaleString([],{month:`short`,day:`numeric`,hour:`2-digit`,minute:`2-digit`})}function ll(e){let t=[e.status,e.priority],n=cl(e.remindAt),r=cl(e.dueAt);return r&&t.push(`due ${r}`),n&&t.push(`remind ${n}`),e.linkedInstance&&t.push(e.linkedInstance),e.notificationStatus!==`pending`&&t.push(e.notificationStatus),t.join(` • `)}function ul(e,t){return!e||e.kind!==t.kind||e.beforeId!==t.beforeId||e.afterId!==t.afterId?!1:e.kind===`bucket`&&t.kind===`bucket`?e.bucket===t.bucket:!0}function dl(e,t,n){return{kind:`bucket`,bucket:e,beforeId:t[n-1]?.id??null,afterId:t[n]?.id??null}}function fl(e,t,n){return{kind:`bucket`,bucket:e,beforeId:t[n]?.id??null,afterId:t[n+1]?.id??null}}function pl(e,t){return{kind:`bucket`,bucket:e,beforeId:yl(t)?.id??null,afterId:null}}function ml(e,t){return{kind:`priority`,beforeId:e[t-1]?.id??null,afterId:e[t]?.id??null}}function hl(e,t){return{kind:`priority`,beforeId:e[t]?.id??null,afterId:e[t+1]?.id??null}}function gl(e){return{kind:`priority`,beforeId:yl(e)?.id??null,afterId:null}}function _l(e){let t=e.currentTarget.getBoundingClientRect();return e.clientY>t.top+t.height/2}function vl(e,t){return t.kind===`priority`?Kc(e,e.length):Uc(t.bucket,e)}function yl(e){return e.length>0?e[e.length-1]??null:null}function bl(e,t,n){let r=e.filter(e=>e.id!==t),i=n.beforeId?r.find(e=>e.id===n.beforeId)??null:null,a=n.afterId?r.find(e=>e.id===n.afterId)??null:null;return i||a?{previous:i,next:a}:n.beforeId&&!n.afterId?{previous:yl(r),next:null}:!n.beforeId&&n.afterId?{previous:null,next:r[0]??null}:{previous:yl(r),next:null}}function xl(e){return e.feed.error?(0,L.jsx)(`p`,{className:`dashboard-reminders-status`,"data-state":`error`,children:e.feed.error}):(0,L.jsxs)(`p`,{className:`dashboard-reminders-status`,children:[e.feed.items.length,` reminder(s) stored in the dashboard database`]})}function Sl(e){let t=e.item.status===`done`,n=e.dropTarget?ul(e.activeDropTarget??null,e.dropTarget):!1;return(0,L.jsxs)(`li`,{className:`dashboard-reminders-row`,"data-priority":e.item.priority,"data-status":e.item.status,"data-drop-target":n?`true`:void 0,"data-reminder-drop-before-id":e.dropTarget?.beforeId??void 0,"data-reminder-drop-after-id":e.dropTarget?.afterId??void 0,draggable:!t&&!e.busy,onDragStart:t=>e.onDragStart?.(e.item,t),onDragEnd:e.onDragEnd,onDragOver:t=>{let n=e.resolveDropTarget?.(t)??e.dropTarget;n&&(t.stopPropagation(),e.onDragOverTarget?.(n,t))},onDragLeave:t=>{e.dropTarget&&(t.stopPropagation(),e.onDragLeaveTarget?.())},onDrop:t=>{let n=e.resolveDropTarget?.(t)??e.dropTarget;n&&(t.stopPropagation(),e.onDropTarget?.(n,t))},children:[(0,L.jsx)(`button`,{type:`button`,className:`dashboard-reminders-row-check`,"aria-label":t?`Mark open`:`Mark done`,onClick:()=>e.onToggleDone(e.item),children:t?`✓`:``}),(0,L.jsxs)(`span`,{className:`dashboard-reminders-row-content`,children:[(0,L.jsx)(il,{item:e.item,busy:e.busy,onRename:e.onRename}),(0,L.jsx)(`small`,{children:ll(e.item)})]}),(0,L.jsx)(`button`,{type:`button`,className:`dashboard-reminders-row-more`,"aria-label":`Open reminder details`,onClick:()=>e.onOpenDetails(e.item),children:`•••`}),e.item.priority===`high`?(0,L.jsx)(`span`,{className:`dashboard-reminders-row-flag`,"aria-label":`high priority`,children:`!`}):null]})}function Cl(e){let[t,n]=(0,I.useState)(``);return(0,L.jsxs)(`li`,{className:`dashboard-reminders-create-row`,children:[(0,L.jsx)(`span`,{"aria-hidden":`true`}),(0,L.jsx)(`form`,{onSubmit:r=>{r.preventDefault();let i=t.trim();i&&(e.onCreate({title:i,...Bc[e.bucket]}),n(``))},children:(0,L.jsx)(`input`,{"aria-label":`Create ${e.bucket} reminder`,placeholder:`New reminder`,value:t,onChange:e=>n(e.target.value)})})]})}function wl(e){let t=pl(e.section.id,e.items);return(0,L.jsxs)(`section`,{className:`dashboard-reminders-quadrant`,"data-tone":e.section.tone,"data-drop-target":e.dropTarget?.kind===`bucket`&&e.dropTarget.bucket===e.section.id?`true`:`false`,onDragOver:n=>e.onDragOver(t,n),onDragLeave:e.onDragLeave,onDrop:n=>e.onDrop(t,n),children:[(0,L.jsxs)(`header`,{children:[(0,L.jsx)(`h3`,{children:e.section.title}),(0,L.jsx)(`span`,{children:e.items.length})]}),(0,L.jsxs)(`ul`,{children:[e.items.map((t,n)=>{let r=dl(e.section.id,e.items,n);return(0,L.jsx)(Sl,{item:t,busy:e.busy,onToggleDone:e.onToggleDone,onRename:e.onRename,onOpenDetails:e.onOpenDetails,onDragStart:e.onDragStart,onDragEnd:e.onDragEnd,dropTarget:r,resolveDropTarget:t=>_l(t)?fl(e.section.id,e.items,n):r,activeDropTarget:e.dropTarget,onDragOverTarget:e.onDragOver,onDragLeaveTarget:e.onDragLeave,onDropTarget:e.onDrop},t.id)}),(0,L.jsx)(Cl,{bucket:e.section.id,onCreate:e.onCreate}),e.items.length===0?(0,L.jsx)(`li`,{className:`dashboard-reminders-empty-row`,children:`No reminders`}):null]})]})}function Tl(e){return(0,L.jsxs)(`div`,{className:`dashboard-reminders-matrix-wrap`,children:[(0,L.jsx)(`span`,{className:`dashboard-reminders-axis dashboard-reminders-axis-importance`,children:`Importance`}),(0,L.jsx)(`span`,{className:`dashboard-reminders-axis dashboard-reminders-axis-urgency`,children:`Urgency`}),(0,L.jsx)(`div`,{className:`dashboard-reminders-matrix-board`,children:zc.map(t=>(0,L.jsx)(wl,{section:t,items:Uc(t.id,e.items),busy:e.busy,dropTarget:e.dropTarget,onCreate:e.onCreate,onToggleDone:e.onToggleDone,onRename:e.onRename,onOpenDetails:e.onOpenDetails,onDragStart:e.onDragStart,onDragEnd:e.onDragEnd,onDragOver:e.onDragOver,onDragLeave:e.onDragLeave,onDrop:e.onDrop},t.id))})]})}function El(e){let t=gl(e.items);return(0,L.jsxs)(`section`,{className:`dashboard-reminders-top-priority`,"aria-label":`Top priority reminders`,"data-drop-target":e.dropTarget?.kind===`priority`?`true`:`false`,onDragOver:n=>e.onDragOver(t,n),onDragLeave:e.onDragLeave,onDrop:n=>e.onDrop(t,n),children:[(0,L.jsxs)(`header`,{children:[(0,L.jsx)(`span`,{children:`Top Priority 3`}),(0,L.jsxs)(`small`,{children:[e.items.length,`/3`]})]}),(0,L.jsxs)(`ol`,{children:[e.items.map((t,n)=>{let r=ml(e.items,n);return(0,L.jsxs)(`li`,{children:[(0,L.jsx)(`span`,{className:`dashboard-reminders-top-index`,children:n+1}),(0,L.jsx)(Sl,{item:t,busy:e.busy,onToggleDone:e.onToggleDone,onRename:e.onRename,onOpenDetails:e.onOpenDetails,onDragStart:e.onDragStart,onDragEnd:e.onDragEnd,dropTarget:r,resolveDropTarget:t=>_l(t)?hl(e.items,n):r,activeDropTarget:e.dropTarget,onDragOverTarget:e.onDragOver,onDragLeaveTarget:e.onDragLeave,onDropTarget:e.onDrop})]},t.id)}),e.items.length===0?(0,L.jsx)(`li`,{className:`dashboard-reminders-top-empty`,children:`No top priority reminders`}):null]})]})}function Dl(e){return(0,L.jsxs)(`div`,{className:`dashboard-reminders-smart-list`,"aria-busy":e.loading,children:[(0,L.jsxs)(`header`,{children:[(0,L.jsx)(`h3`,{children:e.title}),(0,L.jsx)(`span`,{children:e.items.length})]}),(0,L.jsx)(`ul`,{children:e.loading&&e.items.length===0?(0,L.jsx)(`li`,{className:`dashboard-reminders-empty-row`,children:`Loading reminders...`}):e.items.length===0?(0,L.jsx)(`li`,{className:`dashboard-reminders-empty-row`,children:`No reminders`}):e.items.map(t=>(0,L.jsx)(Sl,{item:t,busy:e.loading,onToggleDone:e.onToggleDone,onRename:e.onRename,onOpenDetails:e.onOpenDetails,onDragStart:e.onDragStart,onDragEnd:e.onDragEnd},t.id))})]})}function Ol(e){let[t,n]=(0,I.useState)(null),r=Wc(e.view,e.feed.items),i=G[e.view],a=Kc(e.feed.items,3),o=Yc((t,n)=>{let r=e.feed.items.find(e=>e.id===t);if(!r)return;let{previous:i,next:a}=bl(vl(e.feed.items,n),t,n),o=Fc(i,a);if(n.kind===`priority`){e.onUpdate(t,{manualRank:o});return}let s=Hc(r)===n.bucket?{}:Vc(n.bucket);e.onUpdate(t,{...s,manualRank:o})}),s=t=>{e.onUpdate(t.id,{status:t.status===`done`?`open`:`done`})},c=(t,n)=>{e.onUpdate(t,{title:n})};return(0,L.jsxs)(`section`,{className:`dashboard-reminders-workspace`,"aria-hidden":!e.active,children:[(0,L.jsxs)(`header`,{className:`dashboard-reminders-workspace-header`,children:[(0,L.jsxs)(`div`,{children:[(0,L.jsx)(`h2`,{children:i}),(0,L.jsx)(xl,{feed:e.feed})]}),(0,L.jsxs)(`div`,{className:`dashboard-reminders-workspace-actions`,children:[(0,L.jsx)(Ni,{topic:`reminders`,label:`Open Reminders help`,onOpen:e.onOpenHelpTopic}),(0,L.jsx)(`button`,{type:`button`,className:`dashboard-reminders-sync-button`,onClick:e.onRefresh,disabled:e.feed.loading,children:e.feed.loading?`Loading...`:`Refresh`})]})]}),e.view===`matrix`?(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(El,{items:a,busy:e.feed.loading,dropTarget:o.dropTarget,onToggleDone:s,onRename:c,onOpenDetails:n,onDragStart:o.start,onDragEnd:o.end,onDragOver:o.over,onDragLeave:o.leave,onDrop:o.drop}),(0,L.jsx)(Tl,{items:r,busy:e.feed.loading,dropTarget:o.dropTarget,onCreate:e.onCreate,onToggleDone:s,onRename:c,onOpenDetails:n,onDragStart:o.start,onDragEnd:o.end,onDragOver:o.over,onDragLeave:o.leave,onDrop:o.drop})]}):(0,L.jsx)(Dl,{title:i,items:r,loading:e.feed.loading,onToggleDone:s,onRename:c,onOpenDetails:n,onDragStart:o.start,onDragEnd:o.end}),(0,L.jsx)(al,{item:t,busy:e.feed.loading,onClose:()=>n(null),onSave:(t,r)=>{e.onUpdate(t,r),n(null)}})]})}var kl=`/api/dashboard/reminders`;async function Al(e){if(!e.ok){let t=await e.text().catch(()=>``);throw Error(`${e.status} ${t||e.statusText}`)}if(!(e.headers.get(`content-type`)||``).includes(`application/json`))throw Error(`Reminders API is not available in the running dashboard server. Rebuild and restart the dashboard backend to enable sync.`);return await e.json()}function jl(e){return{...e,notes:e.notes??``,manualRank:typeof e.manualRank==`number`&&Number.isFinite(e.manualRank)?e.manualRank:null,dueAt:e.dueAt??null,remindAt:e.remindAt??null,linkedInstance:e.linkedInstance??null,subtasks:Array.isArray(e.subtasks)?e.subtasks:[],notificationAttemptedAt:e.notificationAttemptedAt??null,notificationError:e.notificationError??null,instanceId:e.instanceId??null,messageId:e.messageId??null,turnIndex:e.turnIndex??null,port:e.port??null,threadKey:e.threadKey??null,sourceText:e.sourceText??null}}function Ml(e,t){if(`manualRank`in e&&!Object.hasOwn(t,`manualRank`))throw Error(`Manual reminder ordering requires the dashboard backend to be rebuilt and restarted.`)}async function Nl(){let e=await Al(await fetch(kl,{credentials:`same-origin`,cache:`no-store`}));return{...e,items:Array.isArray(e.items)?e.items.map(jl):[]}}async function Pl(e){return jl((await Al(await fetch(kl,{method:`POST`,credentials:`same-origin`,headers:{"content-type":`application/json`},body:JSON.stringify(e)}))).item)}async function Fl(e,t){let n=await Al(await fetch(`${kl}/${encodeURIComponent(e)}`,{method:`PATCH`,credentials:`same-origin`,headers:{"content-type":`application/json`},body:JSON.stringify(t)}));return Ml(t,n.item),jl(n.item)}function Il(e){let[t,n]=(0,I.useState)([]),[r,i]=(0,I.useState)(!1),[a,o]=(0,I.useState)(null),s=(0,I.useCallback)(async()=>{i(!0),o(null);try{n((await Nl()).items||[])}catch(e){o(e.message)}finally{i(!1)}},[]),c=(0,I.useCallback)(async()=>{await s()},[s]),l=(0,I.useCallback)(async e=>{o(null);try{let t=await Pl(e);n(e=>[t,...e.filter(e=>e.id!==t.id)])}catch(e){o(e.message)}},[]),u=(0,I.useCallback)(async(e,t)=>{o(null);try{let r=await Fl(e,t);n(t=>t.map(t=>t.id===e?r:t))}catch(e){o(e.message)}},[]);return(0,I.useEffect)(()=>{e.active&&s()},[e.active,s]),{items:t,loading:r,error:a,refresh:c,create:l,update:u}}function Ll(e){return e.trim().toLowerCase()}function Rl(e,t){let n=Ll(e),r=Ll(t);if(!r)return 1;if(n.startsWith(r))return 1e3-n.length;let i=n.indexOf(r);if(i>=0)return 700-i;let a=-1,o=0,s=0;for(let e of r){let t=n.indexOf(e,a+1);if(t<0)return null;o=t===a+1?o+1:0,s+=4+o*3-Math.min(t,40)*.1,a=t}return s}function K(e,t){let n=[{value:e.label,boost:120},{value:e.section,boost:40},...(e.keywords||[]).map(e=>({value:e,boost:80}))],r=null;for(let i of n){let n=Rl(i.value,t);if(n==null)continue;let a=n+i.boost;(!r||a>r.score)&&(r={command:e,score:a})}return r}function q(e,t){return e.map(e=>K(e,t.trim())).filter(e=>!!e).sort((e,t)=>{if(t.score!==e.score)return t.score-e.score;let n=e.command.section.localeCompare(t.command.section);return n===0?e.command.label.localeCompare(t.command.label):n})}function J(e,t,n){return n<=0?0:Math.max(0,Math.min(n-1,e+t))}function Y(e){let t=ga(),[n,r]=(0,I.useState)(!1),[i,a]=(0,I.useState)(``),[o,s]=(0,I.useState)(0),c=(0,I.useRef)(null),l=(0,I.useMemo)(()=>q(t,i),[t,i]),u=l[o]?`notes-command-palette-option-${o}`:void 0;(0,I.useEffect)(()=>{if(!e.active){r(!1);return}function t(e){Hs(e)&&(e.preventDefault(),r(e=>!e))}return window.addEventListener(`keydown`,t),()=>window.removeEventListener(`keydown`,t)},[e.active]),(0,I.useEffect)(()=>{n&&(a(``),s(0),requestAnimationFrame(()=>c.current?.focus()))},[n]),(0,I.useEffect)(()=>{o>=l.length&&s(Math.max(0,l.length-1))},[o,l.length]),(0,I.useEffect)(()=>{(u?document.getElementById(u):null)?.scrollIntoView({block:`nearest`})},[u]);function d(e){if(!e.disabled){r(!1);try{Promise.resolve(e.run()).catch(e=>{console.warn(`[notes-command-palette]`,e)})}catch(e){console.warn(`[notes-command-palette]`,e)}}}function f(){let e=l[o]?.command;e&&d(e)}function p(e){if((e.metaKey||e.ctrlKey)&&e.key.toLowerCase()===`p`){e.preventDefault(),e.stopPropagation();return}e.key===`ArrowDown`?(e.preventDefault(),s(e=>J(e,1,l.length))):e.key===`ArrowUp`?(e.preventDefault(),s(e=>J(e,-1,l.length))):e.key===`Enter`?(e.preventDefault(),f()):e.key===`Escape`&&(e.preventDefault(),r(!1))}return n?(0,L.jsx)(`div`,{className:`notes-command-palette-backdrop`,role:`presentation`,onClick:()=>r(!1),"data-notes-palette":!0,children:(0,L.jsxs)(`section`,{className:`notes-command-palette`,role:`dialog`,"aria-modal":`true`,"aria-label":`Notes command palette`,onClick:e=>e.stopPropagation(),onKeyDown:e=>e.stopPropagation(),children:[(0,L.jsx)(`input`,{ref:c,className:`notes-command-palette-input`,type:`search`,placeholder:`Run command`,value:i,onChange:e=>{a(e.currentTarget.value),s(0)},onKeyDown:p,"aria-label":`Run Notes command`,"aria-controls":`notes-command-palette-results`,"aria-activedescendant":u}),(0,L.jsxs)(`div`,{id:`notes-command-palette-results`,className:`notes-command-palette-list`,role:`listbox`,"aria-label":`Matching commands`,children:[l.map((e,t)=>{let n=e.command,r=t===o;return(0,L.jsxs)(`button`,{id:`notes-command-palette-option-${t}`,type:`button`,role:`option`,"aria-selected":r,"aria-disabled":n.disabled||void 0,className:`notes-command-palette-item${r?` is-active`:``}${n.disabled?` is-disabled`:``}`,onMouseEnter:()=>s(t),onClick:()=>d(n),children:[(0,L.jsx)(`span`,{className:`notes-command-palette-title`,children:n.label}),(0,L.jsx)(`span`,{className:`notes-command-palette-meta`,children:n.disabledReason||n.section}),n.shortcut&&(0,L.jsx)(`kbd`,{className:`notes-command-palette-shortcut`,children:n.shortcut})]},n.id)}),l.length===0&&(0,L.jsx)(`p`,{className:`notes-command-palette-empty`,children:`No matching commands.`})]}),(0,L.jsxs)(`footer`,{className:`notes-command-palette-footer`,children:[(0,L.jsxs)(`span`,{children:[(0,L.jsx)(`kbd`,{children:`Up/Down`}),` move`]}),(0,L.jsxs)(`span`,{children:[(0,L.jsx)(`kbd`,{children:`Enter`}),` run`]}),(0,L.jsxs)(`span`,{children:[(0,L.jsx)(`kbd`,{children:`Esc`}),` close`]})]})]})}):null}var X=(0,I.lazy)(()=>n(()=>import(`./TerminalPanel-AKKXu8dJ.js`).then(e=>({default:e.TerminalPanel})),__vite__mapDeps([1]))),zl=(0,I.lazy)(()=>n(()=>import(`./DiffPanel-DZ4-3QSH.js`).then(e=>({default:e.DiffPanel})),__vite__mapDeps([2]))),Bl=(0,I.lazy)(()=>n(()=>import(`./FolderPanel-DSkanaGN.js`).then(e=>({default:e.FolderPanel})),__vite__mapDeps([3]))),Vl=(0,I.lazy)(()=>n(()=>import(`./DocPanel-C1pGgE-S.js`).then(e=>({default:e.DocPanel})),__vite__mapDeps([0,4]))),Hl=(0,I.lazy)(()=>n(()=>import(`./BrowserPanel-weeCb2qu.js`).then(e=>({default:e.BrowserPanel})),__vite__mapDeps([5])));function Ul(e){return(0,L.jsx)(`section`,{className:`workspace-surface${e.active?` is-active`:``}`,hidden:!e.active,"aria-hidden":!e.active,children:e.children})}function Wl(e,t,n,r,i,a,o){let s=(0,L.jsx)(`div`,{style:{padding:`12px`,color:`var(--text-dim)`,fontSize:`12px`},children:`Loading...`});switch(e){case`diff`:return(0,L.jsx)(I.Suspense,{fallback:s,children:(0,L.jsx)(zl,{selectedInstance:r,settings:i,onSettingsPatch:a})});case`folder`:return(0,L.jsx)(I.Suspense,{fallback:s,children:(0,L.jsx)(Bl,{selectedFilePath:t,notesTree:o.tree,notesRoot:o.notesRoot,onPreviewFile:n})});case`doc`:return(0,L.jsx)(I.Suspense,{fallback:s,children:(0,L.jsx)(Vl,{filePath:t??void 0})});case`browser`:return(0,L.jsx)(I.Suspense,{fallback:s,children:(0,L.jsx)(Hl,{})});default:return null}}function Gl(e,t){let n=(0,L.jsx)(`div`,{style:{padding:`12px`,color:`var(--text-dim)`,fontSize:`12px`},children:`Loading...`});switch(e){case`terminal`:return(0,L.jsx)(I.Suspense,{fallback:n,children:(0,L.jsx)(X,{onCollapse:t.onCollapse,onEmptySessions:t.onCloseTab})});case`browser`:return(0,L.jsx)(I.Suspense,{fallback:n,children:(0,L.jsx)(Hl,{onCollapse:t.onCollapse})});default:return null}}function Kl(e){let t=wn(),[n,r]=(0,I.useState)(null),[i,a]=(0,I.useState)(`matrix`),o=Il({active:e.sidebarMode===`reminders`}),s=Dn()===`electron`,c=s&&t.effectiveRightOpen,l=s&&t.state.bottomPanel.open,u=!!(e.notesModel.tagFilter&&e.notesSelectedPath&&e.notesSelectedNote&&!e.notesSelectedNote.tags?.includes(e.notesModel.tagFilter));function d(e){r(e),t.dispatch({type:`OPEN_RIGHT_PANEL`,mode:`doc`,slot:`bottom`})}return(0,L.jsxs)(ha,{children:[e.jawCeoVoiceOverlay,(0,L.jsx)(Gr,{sidebarCollapsed:e.sidebarCollapsed,inspectorCollapsed:e.activityDockCollapsed,inspectorHeight:e.activityDockCollapsed?48:e.activityDockHeight,drawerOpen:e.drawerOpen,onCloseDrawer:e.onCloseDrawer,rightPanelOpen:c,rightPanelWidth:t.state.rightPanel.width,rightPanelContent:c?(0,L.jsx)(ni,{renderPanel:t=>Wl(t,n,d,e.selectedInstance,e.dashboardSettingsUi,e.onDashboardSettingsPatch,e.notesModel)}):void 0,bottomPanelOpen:l,bottomPanelHeight:t.state.bottomPanel.height,bottomPanelContent:l&&t.state.bottomPanel.tabs.length>0?(0,L.jsx)(oi,{renderTab:Gl}):void 0,navigator:(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(Fr,{onlineCount:e.onlineCount,collapsed:e.sidebarCollapsed,mode:e.sidebarMode,scheduleWorkspaceEnabled:e.scheduleWorkspaceEnabled,remindersWorkspaceEnabled:e.remindersWorkspaceEnabled,onModeChange:e.onSidebarModeChange,onToggleSidebar:e.onToggleSidebar,helpOpen:e.helpOpen,onToggleHelp:e.onToggleHelp}),(0,L.jsx)(`div`,{id:`manager-sidebar-list`,className:`manager-sidebar-list`,children:e.sidebarMode===`settings`?(0,L.jsx)(Di,{activeSection:e.settingsSection,locale:e.locale,onSectionChange:e.onSettingsSectionChange}):e.sidebarMode===`notes`?(0,L.jsx)(Na,{tree:e.notesModel.filteredTree,loading:e.notesModel.loading,error:e.notesModel.error,notesRoot:e.notesModel.notesRoot,selectedPath:e.notesSelectedPath,dirtyPath:e.notesDirtyPath,highlightedPath:e.notesHighlightedPath,externalFocusPath:e.notesSelectedPath,treeWidth:e.notesTreeWidth,mode:e.notesSidebarMode,searchFocusToken:e.notesSearchFocusToken,tagFilter:e.notesModel.tagFilter,selectedHiddenByFilter:u,onModeChange:e.onNotesSidebarModeChange,onOpenSearch:e.onOpenNotesSearch,onSelectedPathChange:e.onNotesSelectedPathChange,onRefreshTree:e.notesModel.refresh,onClearTagFilter:()=>e.notesModel.setTagFilter(null)}):e.sidebarMode===`board`?(0,L.jsx)(nc,{view:e.boardView,onViewChange:e.onBoardViewChange,instances:e.instances,titlesByPort:e.titlesByPort,busyPorts:e.busyPorts}):e.scheduleWorkspaceEnabled&&e.sidebarMode===`schedule`?(0,L.jsx)(Sc,{activeGroup:e.scheduleGroup,onGroupChange:e.onScheduleGroupChange}):e.remindersWorkspaceEnabled&&e.sidebarMode===`reminders`?(0,L.jsx)(rl,{view:i,onViewChange:a,items:o.items,loading:o.loading,onRefresh:()=>void o.refresh(),onUpdate:(e,t)=>void o.update(e,t)}):(0,L.jsx)(Tr,{active:e.selectedInstance,hiddenCount:e.instances.filter(e=>e.hidden).length,collapsed:e.sidebarCollapsed,children:e.instanceListContent})})]}),workbench:(0,L.jsxs)(`div`,{className:`workspace-surface-stack`,children:[(0,L.jsx)(Y,{active:e.sidebarMode===`notes`}),e.lifecycleMessage&&(0,L.jsxs)(`section`,{className:`state lifecycle-state`,role:`status`,children:[(0,L.jsx)(`span`,{children:e.lifecycleMessage}),(0,L.jsx)(`button`,{type:`button`,className:`state-dismiss`,"aria-label":`Dismiss lifecycle message`,onClick:e.onDismissLifecycleMessage,children:`X`})]}),(0,L.jsxs)(`div`,{className:`workspace-surface-layer`,children:[(0,L.jsx)(Ul,{active:e.sidebarMode===`instances`,children:(0,L.jsx)(Rr,{mode:e.activeDetailTab,onModeChange:e.onDetailTabChange,header:e.workbenchHeader,modeActions:e.jawCeoWorkbenchButton,overview:e.detailContent(`overview`),preview:(0,L.jsx)(wi,{instance:e.selectedInstance,data:e.data,enabled:e.previewEnabled,active:e.sidebarMode===`instances`&&e.activeDetailTab===`preview`,refreshKey:e.previewRefreshKey,theme:e.previewTheme,...e.onOpenNotesFromPreview?{onOpenNotesFromPreview:e.onOpenNotesFromPreview}:{}}),logs:e.detailContent(`logs`),settings:e.detailContent(`settings`)})}),(0,L.jsx)(Ul,{active:e.sidebarMode===`notes`,children:(0,L.jsx)(Xs,{active:e.sidebarMode===`notes`,selectedPath:e.notesSelectedPath,selectedNote:e.notesSelectedNote,vaultIndex:e.notesModel.index,viewMode:e.notesViewMode,authoringMode:e.notesAuthoringMode,wordWrap:e.notesWordWrap,vimMode:e.notesVimMode,treeWidth:e.notesTreeWidth,notesGraphSettings:e.notesGraphSettings,tagFilter:e.notesModel.tagFilter,onOpenSidebarSearch:e.onOpenNotesSearch,onSelectedPathChange:e.onNotesSelectedPathChange,onDirtyPathChange:e.onNotesDirtyPathChange,onViewModeChange:e.onNotesViewModeChange,onAuthoringModeChange:e.onNotesAuthoringModeChange,onWordWrapChange:e.onNotesWordWrapChange,onVimModeChange:e.onNotesVimModeChange,onTreeWidthChange:e.onNotesTreeWidthChange,onNotesGraphSettingsChange:e.onNotesGraphSettingsChange,onTagSelect:e.notesModel.setTagFilter,onWikiLinkNavigate:e.onNotesSelectedPathChange})}),(0,L.jsx)(Ul,{active:e.sidebarMode===`settings`,children:(0,L.jsx)(Hi,{activeSection:e.settingsSection,ui:e.dashboardSettingsUi,titleSupport:e.titleSupport,onUiPatch:e.onDashboardSettingsPatch,onOpenHelpTopic:e.onOpenHelpTopic})}),(0,L.jsx)(Ul,{active:e.sidebarMode===`board`,children:(0,L.jsx)(bc,{active:e.sidebarMode===`board`,view:e.boardView,onViewChange:e.onBoardViewChange,instances:e.instances,selectedPort:e.selectedInstance?.port??null,titlesByPort:e.titlesByPort,busyPorts:e.busyPorts,onOpenHelpTopic:e.onOpenHelpTopic})}),e.scheduleWorkspaceEnabled?(0,L.jsx)(Ul,{active:e.sidebarMode===`schedule`,children:(0,L.jsx)(Mc,{active:e.sidebarMode===`schedule`,activeGroup:e.scheduleGroup,busyPorts:e.busyPorts,onOpenHelpTopic:e.onOpenHelpTopic})}):null,e.remindersWorkspaceEnabled?(0,L.jsx)(Ul,{active:e.sidebarMode===`reminders`,children:(0,L.jsx)(Ol,{active:e.sidebarMode===`reminders`,view:i,feed:o,onRefresh:()=>void o.refresh(),onCreate:e=>void o.create(e),onUpdate:(e,t)=>void o.update(e,t),onOpenHelpTopic:e.onOpenHelpTopic})}):null]})]}),inspector:(0,L.jsx)(Sr,{collapsed:e.activityDockCollapsed,height:e.activityDockHeight,loading:e.loading,error:e.error,lifecycleMessage:e.lifecycleMessage,selectedInstance:e.selectedInstance,registryMessage:e.registryMessage,events:e.managerEvents,onToggle:e.onToggleActivity,onHeightChange:e.onActivityHeightChange}),sidePanel:e.jawCeoConsoleContent,mobileNav:(0,L.jsx)(Er,{activeTab:e.activeDetailTab,onOpenInstances:e.onOpenDrawer,onSelectTab:e.onSelectTab,onToggleActivity:e.onToggleActivityFromMobile}),drawer:(0,L.jsx)(wr,{open:e.drawerOpen,profileFilters:e.drawerProfileFilters,onClose:e.onCloseDrawer,children:e.instanceListContent})})]})}var ql=5e3,Jl=1572864,Yl=24,Xl=`jaw.metricsPanelCollapsed`;async function Zl(){let e=await fetch(`/api/dashboard/electron-metrics`);if(!e.ok)throw Error(`electron-metrics failed: ${e.status}`);return await e.json()}function Ql(e){return e>=1024*1024?`${(e/1024/1024).toFixed(2)} GB`:`${(e/1024).toFixed(1)} MB`}function $l(e){return e.length>Yl?`${e.slice(0,Yl-1)}…`:e}function eu(){if(typeof localStorage>`u`)return!1;try{return localStorage.getItem(Xl)===`true`}catch{return!1}}function tu(e){if(!(typeof localStorage>`u`))try{localStorage.setItem(Xl,e?`true`:`false`)}catch{}}function nu(e={}){let[t,n]=(0,I.useState)(null),[r,i]=(0,I.useState)(null),[a,o]=(0,I.useState)(()=>eu());if((0,I.useEffect)(()=>{tu(a)},[a]),(0,I.useEffect)(()=>{let e=!1,t=null,r=async()=>{try{let t=await Zl();if(e)return;t.available?(n(!0),i(t.snapshot)):(n(!1),i(null))}catch{e||n(!1)}e||(t=setTimeout(r,ql))};return r(),()=>{e=!0,t&&clearTimeout(t)}},[]),t!==!0)return null;if(!r)return(0,L.jsxs)(`div`,{className:`electron-metrics-panel electron-metrics-panel--empty`,"aria-label":`Electron process metrics`,children:[(0,L.jsx)(`div`,{className:`electron-metrics-header`,children:(0,L.jsx)(`span`,{className:`electron-metrics-title`,children:`Desktop metrics`})}),(0,L.jsx)(`div`,{className:`electron-metrics-empty`,children:`awaiting first sample…`})]});let s=[...r.processes].sort((e,t)=>t.rssKb-e.rssKb).slice(0,3),c=r.rssTotalKb>=Jl;return(0,L.jsxs)(`div`,{className:`electron-metrics-panel${c?` electron-metrics-panel--warn`:``}`,"aria-label":`Electron process metrics`,children:[(0,L.jsxs)(`div`,{className:`electron-metrics-header`,children:[(0,L.jsx)(`span`,{className:`electron-metrics-title`,children:`Desktop metrics`}),(0,L.jsx)(`button`,{type:`button`,className:`electron-metrics-toggle`,onClick:()=>o(e=>!e),"aria-expanded":!a,"aria-label":a?`Expand metrics panel`:`Collapse metrics panel`,children:a?`▸`:`▾`})]}),!a&&(0,L.jsxs)(`div`,{className:`electron-metrics-body`,children:[c&&(0,L.jsxs)(`div`,{className:`electron-metrics-warn`,children:[(0,L.jsxs)(`span`,{role:`alert`,children:[`Electron RSS total exceeds `,Ql(1572864),`.`]}),e.onUnloadPreview&&(0,L.jsx)(`button`,{type:`button`,className:`electron-metrics-unload-btn`,onClick:()=>e.onUnloadPreview?.(),children:`Unload preview`})]}),(0,L.jsxs)(`div`,{className:`electron-metrics-row`,children:[(0,L.jsx)(`span`,{children:`renderers`}),(0,L.jsx)(`span`,{children:r.rendererCount})]}),(0,L.jsxs)(`div`,{className:`electron-metrics-row`,children:[(0,L.jsx)(`span`,{children:`processes`}),(0,L.jsx)(`span`,{children:r.processes.length})]}),(0,L.jsxs)(`div`,{className:`electron-metrics-row`,children:[(0,L.jsx)(`span`,{children:`RSS total`}),(0,L.jsx)(`span`,{children:Ql(r.rssTotalKb)})]}),(0,L.jsx)(`div`,{className:`electron-metrics-divider`,"aria-hidden":`true`}),(0,L.jsx)(`div`,{className:`electron-metrics-subtitle`,children:`top by RSS`}),(0,L.jsx)(`ul`,{className:`electron-metrics-list`,children:s.map(e=>(0,L.jsxs)(`li`,{children:[(0,L.jsx)(`span`,{className:`electron-metrics-proc`,children:$l(e.name?`${e.type} · ${e.name}`:e.type)}),(0,L.jsx)(`span`,{className:`electron-metrics-proc-rss`,children:Ql(e.rssKb)})]},e.pid))})]})]})}var ru=new Set([`notes`,`instances`]);function iu(e){let t=e;return t?.type===`dashboard.invalidate`&&Array.isArray(t.topics)&&t.topics.every(e=>ru.has(e))}function au(){return(0,I.useEffect)(()=>{function e(e){iu(e.data)&&ba({...e.data,source:`iframe`})}return window.addEventListener(`message`,e),()=>window.removeEventListener(`message`,e)},[]),null}var ou=3e4;function su(){let e=(0,I.useRef)(Date.now());return(0,I.useEffect)(()=>{function t(){document.visibilityState===`visible`&&(Date.now()-e.current<ou||(e.current=Date.now(),ba({topics:[`notes`,`instances`],reason:`visibility:tab-returned`,source:`visibility`})))}return document.addEventListener(`visibilitychange`,t),()=>document.removeEventListener(`visibilitychange`,t)},[]),null}function cu(e,t){return(e.split(`/`).filter(Boolean).pop()||e).replace(/^\.?cli-jaw-(\d+)-[a-f0-9]{7,}$/i,`cli-jaw $1`).replace(/^\.?cli-jaw-(\d+)$/i,`cli-jaw $1`)||`cli-jaw ${t}`}function lu(e){if(e.label)return e.label;let t=e.instanceId||e.homeDisplay||``;return cu(t.split(`/`).filter(Boolean).pop()||t,e.port)}function uu(e){if(e==null)return`n/a`;let t=Math.floor(e/60);if(t<1)return`${Math.round(e)}s`;let n=Math.floor(t/60);return n<1?`${t}m`:`${n}h ${t%60}m`}var du=new Set([`schedule`]),fu={BASE_URL:`/dist/`,DEV:!1,MODE:`production`,PROD:!0,SSR:!1}.VITE_CLI_JAW_EXPERIMENTAL_DASHBOARD===`1`;function pu(e){return du.has(e)}function mu(e){return e===`schedule`&&fu||e===`reminders`?e:pu(e)?`instances`:e}function hu(e){return(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(au,{}),(0,L.jsx)(su,{}),(0,L.jsx)(Cn,{initialPanelState:e.panelInitialState,onStateChange:e.onPanelStateChange,children:(0,L.jsx)(Vn,{sidebarCollapsed:e.view.sidebarCollapsed,commandBar:(0,L.jsx)(Fn,{query:e.query,loading:e.loading,onQueryChange:e.setQuery,onRefresh:()=>void e.load(),onOpenDrawer:()=>e.view.setDrawerOpen(!0),theme:e.theme.theme,onThemeChange:e.theme.setTheme,onOpenPalette:e.palette.toggle}),workspace:(0,L.jsx)(Kl,{sidebarCollapsed:e.view.sidebarCollapsed,activityDockCollapsed:e.view.activityDockCollapsed,activityDockHeight:e.view.activityDockHeight,drawerOpen:e.view.drawerOpen,onCloseDrawer:()=>e.view.setDrawerOpen(!1),onlineCount:e.summary.online||0,sidebarMode:e.view.sidebarMode,scheduleWorkspaceEnabled:fu,remindersWorkspaceEnabled:!0,onSidebarModeChange:e.handleSidebarModeChange,onToggleSidebar:e.handleSidebarToggle,helpOpen:e.helpOpen,onToggleHelp:()=>{e.setHelpTopic(null),e.setHelpOpen(e=>!e)},onOpenHelpTopic:e.onOpenHelpTopic,settingsSection:e.settingsSection,locale:e.view.locale,onSettingsSectionChange:e.setDashboardSettingsSection,notesModel:e.notesModel,notesSelectedPath:e.view.notesSelectedPath,notesSelectedNote:e.notesSelectedNote,notesDirtyPath:e.notesDirtyPath,notesHighlightedPath:e.notesHighlightedPath,notesTreeWidth:e.view.notesTreeWidth,notesGraphSettings:e.view.notesGraphSettings,notesSidebarMode:e.notesSidebarMode,notesSearchFocusToken:e.notesSearchFocusToken,notesViewMode:e.view.notesViewMode,notesAuthoringMode:e.view.notesAuthoringMode,notesWordWrap:e.view.notesWordWrap,notesVimMode:e.view.notesVimMode,onNotesSidebarModeChange:e.setNotesSidebarMode,onOpenNotesSearch:e.openNotesSidebarSearch,onNotesSelectedPathChange:e.handleNotesSelectedPathChange,onNotesDirtyPathChange:e.setNotesDirtyPath,onNotesViewModeChange:e.handleNotesViewModeChange,onNotesAuthoringModeChange:e.handleNotesAuthoringModeChange,onNotesWordWrapChange:e.handleNotesWordWrapChange,onNotesVimModeChange:e.handleNotesVimModeChange,onNotesTreeWidthChange:e.handleNotesTreeWidthChange,onNotesGraphSettingsChange:e.handleNotesGraphSettingsChange,boardView:e.boardView,onBoardViewChange:e.setBoardView,scheduleGroup:e.scheduleGroup,onScheduleGroupChange:e.setScheduleGroup,instances:e.instances,selectedInstance:e.selectedInstance,data:e.data,titlesByPort:e.titlesByPort,busyPorts:e.busyPorts,activeDetailTab:e.view.activeDetailTab,onDetailTabChange:e.handleTabChange,workbenchHeader:e.workbenchHeader,detailContent:e.detailContent,previewEnabled:e.previewEnabled,previewRefreshKey:e.previewRefreshKey,previewTheme:e.theme.resolved,onOpenNotesFromPreview:e.openNotesFromPreview,lifecycleMessage:e.lifecycleMessage,onDismissLifecycleMessage:e.onDismissLifecycleMessage,instanceListContent:e.instanceListContent,loading:e.loading,jawCeoWorkbenchButton:e.jawCeoWorkbenchButton,jawCeoVoiceOverlay:e.jawCeoVoiceOverlay,jawCeoConsoleContent:e.jawCeoConsoleContent,error:e.error,registryMessage:e.registryMessage,managerEvents:e.activityEvents,onToggleActivity:e.handleActivityToggle,onActivityHeightChange:e.handleActivityHeight,onOpenDrawer:()=>e.view.setDrawerOpen(!0),onSelectTab:e.handleTabChange,onToggleActivityFromMobile:e.activityUnreadOpenAndMarkSeen,drawerProfileFilters:e.drawerProfileFilters,dashboardSettingsUi:e.dashboardSettingsUi,titleSupport:e.titleSupport,onDashboardSettingsPatch:e.handleDashboardSettingsPatch}),activityHeight:e.view.activityDockCollapsed?48:e.view.activityDockHeight})}),(0,L.jsx)(Bn,{open:e.palette.open,onClose:e.palette.close,instances:e.instances,getLabel:lu,onSelectInstance:e.handleSelectInstance,theme:e.theme.theme,onCycleTheme:e.cycleTheme,onRefresh:()=>void e.load(),onToggleHidden:()=>{let t=!e.showHidden;e.setShowHidden(t),e.load(t)},showHidden:e.showHidden,onOpenSelected:e.openSelectedInBrowser,selectedInstance:e.selectedInstance}),(0,L.jsx)(nu,{onUnloadPreview:()=>e.setPreviewEnabled(!1)}),(0,L.jsx)(ur,{open:e.helpOpen,topic:e.helpTopic??e.view.sidebarMode,onClose:()=>e.setHelpOpen(!1)}),e.autoUnloadNotice&&(0,L.jsxs)(`div`,{className:`preview-auto-unload-notice`,role:`status`,children:[`Preview was unloaded after 5 minutes of inactivity. Toggle the preview switch to re-enable.`,(0,L.jsx)(`button`,{type:`button`,className:`preview-auto-unload-dismiss`,"aria-label":`Dismiss preview auto-unload notice`,onClick:()=>e.setAutoUnloadNotice(!1),children:`x`})]})]})}function gu(e){if(!(e instanceof HTMLElement))return!1;if(e.isContentEditable)return!0;let t=e.tagName.toLowerCase();return t===`input`||t===`textarea`||t===`select`?!0:!!e.closest(`[contenteditable="true"], .cm-editor, .ProseMirror, [data-milkdown-root]`)}function _u(e){let t=e.instance,n=!!t?.ok,r=e.previewEnabled?`Preview on`:`Preview off`,i=!!(t||e.onOpenHelpTopic);return(0,L.jsxs)(`div`,{className:`detail-header`,children:[(0,L.jsxs)(`div`,{children:[(0,L.jsx)(`p`,{className:`eyebrow`,children:`Selected instance`}),(0,L.jsx)(`h2`,{children:t?lu(t):`No instance selected`}),(0,L.jsx)(`span`,{children:t?.workingDir||t?.url||`Select an online instance to inspect it.`}),t?.projectDirs&&t.projectDirs.length>0&&(0,L.jsxs)(`div`,{className:`project-dirs`,children:[(0,L.jsx)(`span`,{className:`label`,children:`Projects:`}),t.projectDirs.map((e,t)=>(0,L.jsx)(`span`,{className:`project-dir`,title:e,children:e.split(/[/\\]/).slice(-2).join(`/`)},t))]})]}),i&&(0,L.jsxs)(`div`,{className:`detail-header-actions`,children:[e.onOpenHelpTopic?(0,L.jsx)(Ni,{topic:`instances`,label:`Open Instances help`,onOpen:e.onOpenHelpTopic}):null,t?(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(`span`,{className:`preview-inline-status ${t.ok&&e.previewEnabled?`is-ready`:`is-unavailable`}`,"aria-label":t.ok&&e.previewEnabled?`Preview ready`:`Preview unavailable`,title:t.ok&&e.previewEnabled?`Preview ready`:`Preview unavailable`}),(0,L.jsxs)(`button`,{type:`button`,className:`preview-switch ${e.previewEnabled?`is-on`:`is-off`}`,role:`switch`,"aria-checked":e.previewEnabled,disabled:!n,onClick:()=>e.onPreviewEnabledChange(!e.previewEnabled),children:[(0,L.jsx)(`span`,{className:`preview-switch-track`,"aria-hidden":`true`}),(0,L.jsx)(`span`,{children:r})]}),(0,L.jsx)(`button`,{type:`button`,className:`preview-refresh-button`,disabled:!n||!e.previewEnabled,onClick:e.onPreviewRefresh,children:`Refresh`}),(0,L.jsxs)(`a`,{className:`open-link`,href:t.url,target:`_blank`,rel:`noreferrer`,children:[(0,L.jsxs)(`svg`,{viewBox:`0 0 24 24`,width:`12`,height:`12`,stroke:`currentColor`,strokeWidth:`2`,fill:`none`,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":`true`,children:[(0,L.jsx)(`path`,{d:`M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6`}),(0,L.jsx)(`polyline`,{points:`15 3 21 3 21 9`}),(0,L.jsx)(`line`,{x1:`10`,y1:`14`,x2:`21`,y2:`3`})]}),`Open`]})]}):null]})]})}var vu=`jaw.previewEnabled`;function yu(){if(typeof localStorage>`u`)return!1;try{let e=localStorage.getItem(vu);return e===null?!1:e===`true`}catch{return!1}}function bu(e){if(!(typeof localStorage>`u`))try{localStorage.setItem(vu,e?`true`:`false`)}catch{}}var xu=300*1e3;function Su(e){let{onUnload:t,idleMs:n,doc:r,setTimeout:i,clearTimeout:a,now:o}=e,s=null,c=null,l=!1,u=()=>{l||(l=!0,t())},d=()=>{c=o(),s=i(()=>{s=null,u()},n)},f=()=>{s!==null&&(a(s),s=null)},p=()=>{if(l)return;if(r.hidden){c===null&&d();return}let e=c===null?0:o()-c;f(),c=null,e>=n&&u()};return r.hidden&&d(),r.addEventListener(`visibilitychange`,p),r.addEventListener(`resume`,p),()=>{r.removeEventListener(`visibilitychange`,p),r.removeEventListener(`resume`,p),f()}}function Cu(e){let{enabled:t,onUnload:n,idleMs:r=xu}=e,i=(0,I.useRef)(n);i.current=n,(0,I.useEffect)(()=>{if(t&&!(typeof document>`u`))return Su({onUnload:()=>i.current(),idleMs:r,doc:document,setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),now:()=>Date.now()})},[t,r])}function wu(e){let t={ready:0,legacy:0,offline:0,byPort:e};for(let n of Object.values(e))t[n]+=1;return t}function Tu(e,t){return{selectedPort:e.selectedPort,selectedTab:e.activeDetailTab,sidebarCollapsed:e.sidebarCollapsed,activityDockCollapsed:e.activityDockCollapsed,activityDockHeight:e.activityDockHeight,activitySeenAt:null,activitySeenByPort:{},uiTheme:t,locale:e.locale,sidebarMode:e.sidebarMode,notesSelectedPath:e.notesSelectedPath,notesViewMode:e.notesViewMode,notesAuthoringMode:e.notesAuthoringMode,notesWordWrap:e.notesWordWrap,notesVimMode:e.notesVimMode,notesTreeWidth:e.notesTreeWidth,notesGraphSettings:e.notesGraphSettings??ut(dt),showLatestActivityTitles:e.showLatestActivityTitles,showInlineLabelEditor:e.showInlineLabelEditor,showSidebarRuntimeLine:e.showSidebarRuntimeLine,showSelectedRowActions:e.showSelectedRowActions,dashboardShortcutsEnabled:e.dashboardShortcutsEnabled,dashboardShortcutKeymap:e.dashboardShortcutKeymap,diffRootPolicy:e.diffRootPolicy,diffPinnedRootByPort:e.diffPinnedRootByPort,diffDefaultMode:e.diffDefaultMode,diffBaseRef:e.diffBaseRef,diffIncludeUntracked:e.diffIncludeUntracked}}function Eu(e,t,n){let r=(0,I.useRef)(t);r.current=t;let i=(0,I.useRef)(void 0);(0,I.useEffect)(()=>xa(e,()=>{clearTimeout(i.current),i.current=setTimeout(()=>r.current(),100)},n),[e,n])}var Du=5e3;function Ou(e){let t=(0,I.useRef)(null);(0,I.useEffect)(()=>{if(!e)return;let n=!1;async function r(){try{let e=await S();if(n)return;t.current!==null&&e!==t.current&&ba({topics:[`notes`],reason:`notes:external-change`,source:`visibility`,sourceId:`external-sync`}),t.current=e}catch{}}r();let i=setInterval(()=>void r(),Du);return()=>{n=!0,clearInterval(i)}},[e])}function ku(e){for(let t of e){if(t.kind===`file`)return t.path;let e=ku(t.children||[]);if(e)return e}return null}function Au(e,t){for(let n of e)if(n.kind===`file`&&n.path===t||Au(n.children||[],t))return!0;return!1}function ju(e,t){let n=[];for(let r of e){if(r.kind===`file`){t.has(r.path)&&n.push(r);continue}let e=ju(r.children||[],t);e.length>0&&n.push({...r,children:e})}return n}function Mu(e){let[t,n]=(0,I.useState)([]),[r,i]=(0,I.useState)(null),[a,o]=(0,I.useState)(!1),[s,c]=(0,I.useState)(null),[l,u]=(0,I.useState)(null),[d,f]=(0,I.useState)(null),p=(0,I.useRef)(0),m=(0,I.useRef)(e.selectedPath),h=(0,I.useRef)(e.onSelectedPathChange);m.current=e.selectedPath,h.current=e.onSelectedPathChange,Ou(e.active),(0,I.useEffect)(()=>{!e.active||l||w().then(e=>u(e.root)).catch(()=>{})},[e.active,l]);let g=(0,I.useCallback)(async(e=m.current)=>{let t=p.current+1;p.current=t,o(!0),c(null);try{let[r,a]=await Promise.all([ee(),E()]);if(t!==p.current)return;n(r),i(a);let o=e&&Au(r,e)?e:ku(r);o!==m.current&&h.current(o)}catch(e){t===p.current&&c(e.message)}finally{t===p.current&&o(!1)}},[]);return Eu(`notes`,()=>{e.active&&g()},`notes-sidebar`),(0,I.useEffect)(()=>{e.active&&g()},[e.active,g]),{tree:t,filteredTree:(0,I.useMemo)(()=>{if(!d||!r)return t;let e=new Set;for(let t of r.notes)t.tags&&t.tags.includes(d)&&e.add(t.path);return e.size===0?[]:ju(t,e)},[d,t,r]),index:r,loading:a,error:s,notesRoot:l,tagFilter:d,setTagFilter:f,refresh:g}}var Nu=new Set([`instances`,`board`,`schedule`,`reminders`,`notes`,`settings`]);function Pu(e){let t=new URLSearchParams(e).get(`sidebar`);return Nu.has(t)?t:null}function Fu(){let[e,t]=(0,I.useState)(null),[n,r]=(0,I.useState)(null),[i,a]=(0,I.useState)(!1),[o,s]=(0,I.useState)(null),c=(0,I.useCallback)(e=>(t(e.registry),r(e.status),s(e.status.error),e),[]);return{registry:e,status:n,saving:i,error:o,apply:c,refresh:(0,I.useCallback)(async()=>{try{return c(await D())}catch(e){throw s(e.message),e}},[c]),save:(0,I.useCallback)(async e=>{a(!0);try{return c(await ce(e))}catch(e){return s(e.message),null}finally{a(!1)}},[c])}}function Iu(){let[e,t]=(0,I.useState)(null),[n,r]=(0,I.useState)(`overview`),[i,a]=(0,I.useState)(!1),[o,s]=(0,I.useState)(!1),[c,l]=(0,I.useState)(!1),[u,d]=(0,I.useState)(150),[f,p]=(0,I.useState)(`instances`),[m,h]=(0,I.useState)(null),[g,_]=(0,I.useState)(`raw`),[v,y]=(0,I.useState)(`plain`),[b,x]=(0,I.useState)(!0),[S,ee]=(0,I.useState)(!1),[te,C]=(0,I.useState)(280),[w,T]=(0,I.useState)(void 0),[ne,E]=(0,I.useState)(!0),[re,ie]=(0,I.useState)(!0),[ae,oe]=(0,I.useState)(!0),[D,O]=(0,I.useState)(!0),[se,ce]=(0,I.useState)(!0),[le,ue]=(0,I.useState)({...Un}),[k,A]=(0,I.useState)(`project-first`),[de,fe]=(0,I.useState)({}),[pe,me]=(0,I.useState)(`unstaged`),[he,ge]=(0,I.useState)(`HEAD`),[_e,j]=(0,I.useState)(!0),[ve,ye]=(0,I.useState)(`ko`);function be(e){ue(qn(e))}return{selectedPort:e,setSelectedPort:t,activeDetailTab:n,setActiveDetailTab:r,drawerOpen:i,setDrawerOpen:a,sidebarCollapsed:o,setSidebarCollapsed:s,activityDockCollapsed:c,setActivityDockCollapsed:l,activityDockHeight:u,setActivityDockHeight:d,sidebarMode:f,setSidebarMode:p,notesSelectedPath:m,setNotesSelectedPath:h,notesViewMode:g,setNotesViewMode:_,notesAuthoringMode:v,setNotesAuthoringMode:y,notesWordWrap:b,setNotesWordWrap:x,notesVimMode:S,setNotesVimMode:ee,notesTreeWidth:te,setNotesTreeWidth:C,notesGraphSettings:w,setNotesGraphSettings:T,showLatestActivityTitles:ne,setShowLatestActivityTitles:E,showInlineLabelEditor:re,setShowInlineLabelEditor:ie,showSidebarRuntimeLine:ae,setShowSidebarRuntimeLine:oe,showSelectedRowActions:D,setShowSelectedRowActions:O,dashboardShortcutsEnabled:se,setDashboardShortcutsEnabled:ce,dashboardShortcutKeymap:le,setDashboardShortcutKeymap:be,diffRootPolicy:k,setDiffRootPolicy:A,diffPinnedRootByPort:de,setDiffPinnedRootByPort:fe,diffDefaultMode:pe,setDiffDefaultMode:me,diffBaseRef:he,setDiffBaseRef:ge,diffIncludeUntracked:_e,setDiffIncludeUntracked:j,locale:ve,setLocale:ye}}function Lu(e){return e.kind===`instance-message`&&e.role===`assistant`}function Ru(e){if(e.kind===`instance-message`)return[e.kind,e.port,e.messageId].join(`|`);let t=`port`in e?String(e.port):``,n=`message`in e?e.message:`reason`in e&&typeof e.reason==`string`?e.reason:``;return[e.kind,t,e.at,n].join(`|`)}function zu(e){return e.reduce((e,t)=>e?Date.parse(t.at)>Date.parse(e)?t.at:e:t.at,null)}function Bu(e,t){return zu(e.filter(e=>`port`in e&&e.port===t))}function Vu(e,t,n={},r=null){let i=new Set,a={};for(let t of e){if(!(`port`in t)||r!=null&&t.port===r||!Lu(t))continue;let e=n[t.port]||null;if(e&&Date.parse(t.at)<=Date.parse(e))continue;let o=Ru(t);i.has(o)||(i.add(o),a[t.port]=(a[t.port]||0)+1)}return a}function Hu(e){let[t,n]=(0,I.useState)(null),[r,i]=(0,I.useState)({}),a=(0,I.useMemo)(()=>Vu(e.events,t,r,e.activePreviewPort),[e.events,t,r,e.activePreviewPort]);function o(e,t){n(e),i(Object.fromEntries(Object.entries(t).map(([e,t])=>[Number(e),t])))}function s(t){let n=Bu(e.events,t);if(!n)return;let a=r[t]||null;if(a&&Date.parse(n)<=Date.parse(a))return;let o={...r,[t]:n};i(o),e.saveUi({activitySeenByPort:Object.fromEntries(Object.entries(o).map(([e,t])=>[String(e),t]))})}function c(){let t=zu(e.events),a={...r};for(let t of e.events){if(!(`port`in t))continue;let e=a[t.port];(!e||Date.parse(t.at)>Date.parse(e))&&(a[t.port]=t.at)}n(t),i(a),e.setActivityDockCollapsed(!1),e.saveUi({activityDockCollapsed:!1,activitySeenAt:t,activitySeenByPort:Object.fromEntries(Object.entries(a).map(([e,t])=>[String(e),t]))})}function l(){e.setActivityDockCollapsed(!0),e.saveUi({activityDockCollapsed:!0,activitySeenAt:t,activitySeenByPort:Object.fromEntries(Object.entries(r).map(([e,t])=>[String(e),t]))})}return{unreadByPort:a,hydrateSeenAt:o,markPortSeen:s,openAndMarkSeen:c,closeAndPersistSeen:l}}var Uu=[`auto`,`dark`,`light`];function Wu(e){return typeof e==`string`&&Uu.includes(e)}function Z(){if(typeof document>`u`)return`auto`;let e=document.documentElement.getAttribute(`data-theme`);return Wu(e)?e:`auto`}var Gu=`jaw.uiTheme`;function Ku(e){if(!(typeof document>`u`)){document.documentElement.setAttribute(`data-theme`,e);try{typeof localStorage<`u`&&localStorage.setItem(Gu,e)}catch{}}}function qu(e){let[t,n]=(0,I.useState)(Z),[r,i]=(0,I.useState)(()=>Ju(t));return(0,I.useEffect)(()=>{Ku(t),i(Ju(t))},[t]),(0,I.useEffect)(()=>{if(t!==`auto`||typeof window>`u`||!window.matchMedia)return;let e=window.matchMedia(`(prefers-color-scheme: light)`),n=()=>i(e.matches?`light`:`dark`);return typeof e.addEventListener==`function`?(e.addEventListener(`change`,n),()=>e.removeEventListener(`change`,n)):(e.addListener(n),()=>e.removeListener(n))},[t]),{theme:t,resolved:r,setTheme:(0,I.useCallback)(t=>{Wu(t)&&(n(t),Ku(t),i(Ju(t)),e(t))},[e]),syncFromRegistry:(0,I.useCallback)(e=>{Wu(e)&&(n(e),Ku(e),i(Ju(e)))},[])}}function Ju(e){return e===`dark`?`dark`:e===`light`||typeof window<`u`&&window.matchMedia&&window.matchMedia(`(prefers-color-scheme: light)`).matches?`light`:`dark`}function Yu(){return typeof navigator>`u`?!1:/Mac|iPod|iPhone|iPad/.test(navigator.platform||``)}function Xu(e){return e.key!==`k`&&e.key!==`K`?!1:Yu()?e.metaKey:e.ctrlKey}function Zu(){let[e,t]=(0,I.useState)(!1),n=(0,I.useCallback)(()=>t(e=>!e),[]),r=(0,I.useCallback)(()=>t(!1),[]);return(0,I.useEffect)(()=>{function e(e){Xu(e)&&(e.preventDefault(),t(e=>!e))}return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[]),{open:e,setOpen:t,toggle:n,close:r}}function Qu(e,t){let[n,r]=(0,I.useState)(null);return{error:n,saveInstanceLabel:(0,I.useCallback)(async(n,i)=>{let a=i?.trim()||null;if(!await e({instances:{[String(n)]:{label:a}}})){let e=`instance label save failed`;throw r(e),Error(e)}r(null),t(e=>e&&{...e,instances:e.instances.map(e=>e.port===n?{...e,label:a}:e)})},[e,t])}}var $u=5e3,ed=200;function td(e){if(!e)return null;if(`latestAssistant`in e){let t=e.latestAssistant,n=e.activity;return!t||!n||n.role!==`assistant`||n.messageId!==t.id?null:t}return e.role===`assistant`&&Number.isInteger(e.id)?e:null}function nd(e){return!e||!(`activity`in e)?null:e.activity?.title||null}function rd(e){return e&&(`activity`in e||`latestAssistant`in e)?`ready`:`legacy`}var id=120*6e4;function ad(e){let t=e.includes(`T`)?e:e.replace(` `,`T`);return Date.parse(t.endsWith(`Z`)?t:t+`Z`)}function od(e){if(!e||!(`activity`in e))return!1;let t=e.activity;if(!t||t.role!==`user`)return!1;let n=ad(t.updatedAt);return Number.isNaN(n)?!1:Date.now()-n<id}async function sd(e){let t=await fetch(`/i/${e}/api/messages/latest?includeContent=1`);if(!t.ok)return{latest:null,title:null,support:`offline`,busy:!1};let n=await t.json();return{latest:td(n.data),title:nd(n.data),support:rd(n.data),busy:od(n.data)}}function cd(e){let[t,n]=(0,I.useState)([]),[r,i]=(0,I.useState)({}),[a,o]=(0,I.useState)({}),[s,c]=(0,I.useState)(new Set),l=(0,I.useRef)({}),u=(0,I.useMemo)(()=>e.filter(e=>e.ok).map(e=>e.port).sort((e,t)=>e-t),[e]);return(0,I.useEffect)(()=>{let t=!1,r=null;async function a(){if(t)return;let r=new Set(e.map(e=>e.port)),a={};for(let t of e)t.ok||(a[t.port]=`offline`);if(u.length===0){o(a),i(e=>Object.fromEntries(Object.entries(e).filter(([e])=>r.has(Number(e)))));return}let s=await Promise.allSettled(u.map(async e=>({port:e,...await sd(e)}))),d=[],f={},p=new Set;for(let e of s){if(e.status!==`fulfilled`)continue;let{port:t,latest:n,title:r,support:i,busy:o}=e.value;if(o&&p.add(t),a[t]=i,r&&(f[t]=r),!n)continue;let s=l.current[t];l.current[t]=n.id,!(s==null||n.id<=s)&&d.push({kind:`instance-message`,port:t,messageId:n.id,role:n.role,at:n.created_at&&!Number.isNaN(Date.parse(n.created_at))?n.created_at:new Date().toISOString(),...r?{title:r}:{}})}if(!t){for(let e of u)a[e]||(a[e]=`offline`);o(a),c(p),i(e=>{let t={};for(let[n,i]of Object.entries(e)){let e=Number(n);r.has(e)&&a[e]===`ready`&&(t[e]=i)}return{...t,...f}}),d.length>0&&n(e=>{let t=[...e,...d];return t.length>ed&&t.splice(0,t.length-ed),t})}}function s(){r||=setInterval(()=>{a()},$u)}function d(){r&&clearInterval(r),r=null}function f(){document.visibilityState===`visible`?(a(),s()):d()}return a(),s(),document.addEventListener(`visibilitychange`,f),()=>{t=!0,d(),document.removeEventListener(`visibilitychange`,f)}},[u.join(`,`),(0,I.useMemo)(()=>e.map(e=>`${e.port}:${e.ok?`online`:`offline`}`).sort().join(`,`),[e])]),{events:t,titlesByPort:r,titleSupportByPort:a,busyPorts:s}}var ld=1e4,ud=200;function dd(){let[e,t]=(0,I.useState)([]),[n,r]=(0,I.useState)(null),i=(0,I.useRef)(null);async function a(){try{let e=await ie(i.current);if(r(null),e.length===0)return;i.current=e[e.length-1].at,t(t=>{let n=[...t,...e];return n.length>ud&&n.splice(0,n.length-ud),n})}catch(e){r(e.message)}}return(0,I.useEffect)(()=>{let e=!1,t=null;async function n(){e||await a()}function r(){t||=setInterval(()=>{n()},ld)}function i(){t&&clearInterval(t),t=null}function o(){document.visibilityState===`visible`?(n(),r()):i()}return n(),r(),document.addEventListener(`visibilitychange`,o),()=>{e=!0,i(),document.removeEventListener(`visibilitychange`,o)}},[]),{events:e,error:n,refresh:a}}function fd(e){if(e===window.location.origin)return!0;try{let t=new URL(e).hostname;return t===`localhost`||t===`127.0.0.1`||t===`::1`||t===`[::1]`}catch{return!1}}function pd(e){(0,I.useEffect)(()=>{function t(t){let n=t.data;n?.type===`jaw-preview-stt-recording`&&n.action===`request`&&fd(t.origin)&&(e.status===`active`||e.status===`silent`||e.status===`paused`||e.status===`connecting`)&&e.end()}return window.addEventListener(`message`,t),()=>window.removeEventListener(`message`,t)},[e.status,e.end])}function md(e){(0,I.useEffect)(()=>{function t(t){if(!e.enabled)return;let n=t.data;if(!n||n.type!==`jaw-preview-shortcut`)return;let r=Xn({key:n.key,code:n.code,altKey:!!n.altKey,ctrlKey:!!n.ctrlKey,metaKey:!!n.metaKey,shiftKey:!!n.shiftKey},e.keymap);r&&e.onAction(r)}return window.addEventListener(`message`,t),()=>window.removeEventListener(`message`,t)},[e])}var hd=76,gd=8,_d=96;function vd(e){return e?e.scrollHeight-e.scrollTop-e.clientHeight<_d:!0}function yd(e){let t=(0,I.useRef)(null),n=(0,I.useRef)(!0),c=(0,I.useRef)(e.count),[{virtualItems:l,totalSize:u},d]=(0,I.useState)({virtualItems:[],totalSize:0}),f=(0,I.useRef)(null);f.current||=new s({count:e.count,getScrollElement:()=>t.current,estimateSize:e.estimateSize||(()=>hd),overscan:gd,getItemKey:e.getItemKey,indexAttribute:`data-jaw-ceo-idx`,useAnimationFrameWithResizeObserver:!0,observeElementRect:r,observeElementOffset:i,scrollToFn:a,measureElement:o,onChange:e=>{d({virtualItems:e.getVirtualItems(),totalSize:e.getTotalSize()})}});let p=f.current,m=(0,I.useCallback)(e=>{t.current=e,n.current=vd(e),p._willUpdate()},[p]),h=(0,I.useCallback)(()=>{n.current=vd(t.current)},[]),g=(0,I.useCallback)(e=>{e&&p.measureElement(e)},[p]);return(0,I.useEffect)(()=>p._didMount(),[p]),(0,I.useLayoutEffect)(()=>{p.setOptions({...p.options,count:e.count,getItemKey:e.getItemKey,estimateSize:e.estimateSize||(()=>hd)}),p._willUpdate(),d({virtualItems:p.getVirtualItems(),totalSize:p.getTotalSize()})},[e.count,e.estimateSize,e.getItemKey,p]),(0,I.useLayoutEffect)(()=>{let t=c.current;c.current=e.count,e.count!==0&&(t>0&&!n.current||requestAnimationFrame(()=>{p.scrollToIndex(e.count-1,{align:`end`})}))},[e.count,p]),{scrollRef:m,onScroll:h,measureElement:g,virtualItems:l,totalSize:u}}async function Q(e,t){let n=await e.text(),r=null;if(n.trim())try{r=JSON.parse(n)}catch{throw Error(`${t}: endpoint returned non-JSON; restart the dashboard server to load the Jaw CEO API`)}if(!e.ok||!r||r.ok===!1){let e=r&&r.ok===!1&&(r.error||r.message)||t;throw Error(e)}return r.data}async function bd(e,t){return await Q(await fetch(e),t)}async function xd(e,t={},n=`Jaw CEO request failed`){return await Q(await fetch(e,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify(t)}),n)}async function Sd(e,t={},n=`Jaw CEO request failed`){return await Q(await fetch(e,{method:`PUT`,headers:{"content-type":`application/json`},body:JSON.stringify(t)}),n)}async function Cd(){return await bd(`/api/jaw-ceo/state`,`Jaw CEO state fetch failed`)}async function wd(){return await bd(`/api/jaw-ceo/settings`,`Jaw CEO settings fetch failed`)}async function Td(e){return await Sd(`/api/jaw-ceo/settings`,e,`Jaw CEO settings save failed`)}async function Ed(e){let t={text:e.text,selectedPort:e.selectedPort,inputMode:e.inputMode||`text`,responseMode:e.responseMode||`text`};return e.sessionId&&(t.sessionId=e.sessionId),await xd(`/api/jaw-ceo/message`,t,`Jaw CEO message failed`)}async function Dd(e){let t={};return e.ports!==void 0&&(t.ports=e.ports),e.events!==void 0&&(t.events=e.events),e.sinceCursor!==void 0&&(t.sinceCursor=e.sinceCursor),await xd(`/api/jaw-ceo/events/refresh`,t,`Jaw CEO event refresh failed`)}async function Od(e,t){return await xd(`/api/jaw-ceo/pending/${encodeURIComponent(e)}/continue`,{mode:t},`Jaw CEO continue failed`)}async function kd(e,t=`short`){return await xd(`/api/jaw-ceo/pending/${encodeURIComponent(e)}/summarize`,{format:t},`Jaw CEO summarize failed`)}async function Ad(e,t){return await xd(`/api/jaw-ceo/pending/${encodeURIComponent(e)}/${t}`,{},`Jaw CEO pending update failed`)}async function jd(e){let t={offerSdp:e.offerSdp,selectedPort:e.selectedPort,responseMode:e.responseMode||`voice`};return e.sessionId&&(t.sessionId=e.sessionId),await xd(`/api/jaw-ceo/voice/connect`,t,`Jaw CEO voice connect failed`)}async function Md(e){return await xd(`/api/jaw-ceo/voice/${encodeURIComponent(e)}/close`,{},`Jaw CEO voice close failed`)}function $(e){if(e?.openaiKeyInvalid)return`Invalid saved key`;if(!e?.openaiKeySet)return`No key saved`;let t=e.openaiKeyLast4?`•••• ${e.openaiKeyLast4}`:`saved`;return e.openaiKeySource===`env`?`Env key ${t}`:e.openaiKeySource===`deps`?`Runtime key ${t}`:`Saved key ${t}`}function Nd(){let[e,t]=(0,I.useState)(null),[n,r]=(0,I.useState)(``),[i,a]=(0,I.useState)(!1),[o,s]=(0,I.useState)(null),c=!!(e?.openaiKeyInvalid||e?.openaiKeySet&&e.openaiKeySource!==`env`);(0,I.useEffect)(()=>{let e=!1;return wd().then(n=>{e||t(n)}).catch(t=>{e||s(t.message)}),()=>{e=!0}},[]);async function l(){let e=n.trim();if(e){a(!0);try{t(await Td({openaiApiKey:e})),r(``),s(null)}catch(e){s(e.message)}finally{a(!1)}}}async function u(){a(!0);try{t(await Td({clearOpenAiApiKey:!0})),r(``),s(null)}catch(e){s(e.message)}finally{a(!1)}}return(0,L.jsx)(`section`,{className:`jaw-ceo-settings-panel`,"aria-label":`Jaw CEO settings`,children:(0,L.jsxs)(`form`,{className:`jaw-ceo-settings-form`,onSubmit:e=>{e.preventDefault(),l()},children:[(0,L.jsxs)(`div`,{className:`jaw-ceo-settings-status`,children:[(0,L.jsx)(`strong`,{children:`Realtime voice`}),(0,L.jsx)(`span`,{children:$(e)})]}),(0,L.jsxs)(`label`,{children:[(0,L.jsx)(`span`,{children:`OpenAI API key`}),(0,L.jsx)(`input`,{value:n,type:`password`,autoComplete:`off`,spellCheck:!1,placeholder:e?.openaiKeySet?`sk-... replace saved key`:`sk-...`,onChange:e=>r(e.target.value)})]}),(0,L.jsxs)(`div`,{className:`jaw-ceo-settings-meta`,children:[(0,L.jsx)(`span`,{children:e?.model||`gpt-realtime-2`}),(0,L.jsx)(`span`,{children:e?.voice||`marin`})]}),e?.openaiKeyInvalid?(0,L.jsx)(`p`,{className:`jaw-ceo-inline-error`,children:`Saved value is not an OpenAI API key. Paste a key that starts with sk-.`}):null,o?(0,L.jsx)(`p`,{className:`jaw-ceo-inline-error`,children:o}):null,(0,L.jsxs)(`div`,{className:`jaw-ceo-form-row`,children:[(0,L.jsx)(`button`,{type:`button`,disabled:i||!c,onClick:()=>void u(),children:`Clear saved`}),(0,L.jsx)(`button`,{type:`submit`,disabled:i||!n.trim(),children:i?`Saving`:`Save key`})]})]})})}function Pd(e){let t=new Date(e);return Number.isNaN(t.getTime())?e:t.toLocaleTimeString()}function Fd(e){return e.summary||`Worker :${e.port} has a result ready.`}function Id(e){return[{label:e==null?`Inspect dashboard`:`Inspect :${e}`,text:e==null?`What needs attention on this dashboard right now?`:`What is worker :${e} doing right now?`},{label:`Summarize results`,text:`Summarize the worker results and tell me what needs action.`},{label:e==null?`Route work`:`Send to :${e}`,text:e==null?`Create or choose the right worker for this task: `:`Send this task to worker :${e}: `}]}function Ld(e){let t=Array.isArray(e.ceo.state.transcript)?e.ceo.state.transcript:[],n=Array.isArray(e.ceo.state.watches)?e.ceo.state.watches:[],r=Array.isArray(e.ceo.audit)?e.ceo.audit:[],i=[...t.map(e=>({kind:`chat`,id:e.id,at:e.at,role:e.role,text:e.text})),...e.ceo.pending.filter(e=>e.status===`pending`||e.status===`spoken`).map(e=>({kind:`result`,id:`result-${e.completionKey}`,at:e.detectedAt,completion:e})),...n.map(e=>({kind:`watch`,id:`watch-${e.watchId}`,at:e.createdAt,watch:e})),...r.slice(-24).map(e=>({kind:`tool`,id:`audit-${e.id}`,at:e.at,record:e}))];return i.sort((e,t)=>{let n=Date.parse(e.at)-Date.parse(t.at);return n===0?e.id.localeCompare(t.id):n}),e.voice.lastTranscript&&i.push({kind:`live`,id:`live-voice-transcript`,at:new Date().toISOString(),text:e.voice.lastTranscript,eventType:e.voice.lastEventType}),i}function Rd(e){if(!e)return 76;if(e.kind===`activity-group`)return 52;let t=Math.max(1,e.text.split(/\r?\n/).filter(Boolean).length);return Math.min(220,54+t*18)}function zd(e){let t=[],n=[];function r(){n.length!==0&&(t.push({kind:`activity-group`,id:`activity-${n[0].id}-${n.length}`,at:n[0].at,entries:n}),n=[])}for(let i of e)i.kind===`chat`||i.kind===`live`?(r(),t.push(i)):n.push(i);return r(),t}function Bd(e){return e.kind===`result`?`subagent`:e.kind===`watch`?`thinking`:e.record.kind===`tool`?`tool`:e.record.kind===`completion`?`subagent`:`thinking`}function Vd(e){return e.kind===`result`?`Worker :${e.completion.port} result`:e.kind===`watch`?`Listening to worker :${e.watch.port}`:e.record.kind===`completion`?`Worker completion`:e.record.kind===`docs_edit`?`Docs edit`:e.record.kind===`lifecycle`?`Lifecycle`:e.record.kind===`policy`?`Policy check`:e.record.action||`Tool use`}function Hd(e){return e.kind===`result`?e.completion.resultText||Fd(e.completion):e.kind===`watch`?`${e.watch.reason} · fallback ${e.watch.latestMessageFallback.mode}`:e.record.message}function Ud(e){return e.kind===`result`?e.completion.detectedAt:e.kind===`watch`?e.watch.createdAt:e.record.at}function Wd(e){return e.kind===`tool`&&!e.record.ok}function Gd(e){let t=e.reduce((e,t)=>(e[Bd(t)]+=1,e),{tool:0,thinking:0,subagent:0});return[t.tool>0?`Tool×${t.tool}`:null,t.thinking>0?`Thinking×${t.thinking}`:null,t.subagent>0?`Subagent×${t.subagent}`:null].filter(Boolean).join(` + `)}function Kd(e){let t=e.text.split(/\r?\n/).map(e=>e.trim()).filter(Boolean);if(t.length===0)return(0,L.jsx)(`p`,{children:`...`});let n=[],r=[];function i(){r.length!==0&&(n.push((0,L.jsx)(`ul`,{children:r.map((e,t)=>(0,L.jsx)(`li`,{children:e},`${e}-${t}`))},`ul-${n.length}`)),r=[])}return t.forEach((e,t)=>{let a=e.match(/^[-*]\s+(.+)$/);if(a){r.push(a[1]);return}i(),n.push((0,L.jsx)(`p`,{children:e},`p-${t}`))}),i(),(0,L.jsx)(L.Fragment,{children:n})}function qd(e){return e.tone===`tool`?(0,L.jsx)(`svg`,{viewBox:`0 0 16 16`,"aria-hidden":`true`,children:(0,L.jsx)(`path`,{d:`M10.5 2.5 13 5l-2.4 2.4-1.2-1.2-4.8 4.8-1.7.2.2-1.7 4.8-4.8-1.1-1.1L9.2 1.2l1.3 1.3Z`})}):e.tone===`subagent`?(0,L.jsxs)(`svg`,{viewBox:`0 0 16 16`,"aria-hidden":`true`,children:[(0,L.jsx)(`path`,{d:`M3 4.5h10v7H3z`}),(0,L.jsx)(`path`,{d:`M6 4.5V3h4v1.5M5.2 8h.1M10.7 8h.1`})]}):(0,L.jsx)(`svg`,{viewBox:`0 0 16 16`,"aria-hidden":`true`,children:(0,L.jsx)(`path`,{d:`M3 4.5h10v7H5.7L3 13.4z`})})}function Jd(e){return(0,L.jsxs)(`section`,{className:`jaw-ceo-activity-shell`,"aria-label":`CEO activity`,children:[(0,L.jsx)(`span`,{className:`jaw-ceo-activity-avatar`,"aria-hidden":`true`,children:`CEO`}),(0,L.jsxs)(`details`,{className:`jaw-ceo-activity-group`,children:[(0,L.jsxs)(`summary`,{children:[(0,L.jsx)(`span`,{className:`jaw-ceo-activity-status`,"aria-hidden":`true`}),(0,L.jsx)(`strong`,{children:Gd(e.entries)||`Activity`})]}),(0,L.jsx)(`div`,{className:`jaw-ceo-activity-list`,children:e.entries.map(t=>{let n=Bd(t);return(0,L.jsxs)(`article`,{className:`jaw-ceo-activity-row tone-${n}${Wd(t)?` is-error`:``}`,children:[(0,L.jsx)(`span`,{className:`jaw-ceo-activity-dot`,"aria-hidden":`true`}),(0,L.jsx)(`span`,{className:`jaw-ceo-activity-icon`,children:(0,L.jsx)(qd,{tone:n})}),(0,L.jsx)(`span`,{className:`jaw-ceo-activity-badge`,children:n}),(0,L.jsxs)(`div`,{className:`jaw-ceo-activity-copy`,children:[(0,L.jsx)(`strong`,{children:Vd(t)}),(0,L.jsx)(`p`,{children:Hd(t)}),(0,L.jsx)(`small`,{children:Pd(Ud(t))})]}),t.kind===`result`?(0,L.jsxs)(`div`,{className:`jaw-ceo-activity-actions`,children:[(0,L.jsx)(`button`,{type:`button`,onClick:()=>e.onOpenWorker(t.completion.port,t.completion.messageId),children:`Open`}),(0,L.jsx)(`button`,{type:`button`,onClick:()=>void e.model.summarize(t.completion),children:`Summary`}),(0,L.jsx)(`button`,{type:`button`,onClick:()=>void e.model.continueCompletion(t.completion),children:`Continue`}),(0,L.jsx)(`button`,{type:`button`,onClick:()=>void e.voice.speakCompletion(t.completion),children:`Speak`}),(0,L.jsx)(`button`,{type:`button`,onClick:()=>void e.ceo.ackCompletion(t.completion.completionKey),children:`Ack`})]}):(0,L.jsx)(`span`,{className:`jaw-ceo-trace-chip`,children:`Trace`})]},t.id)})})]})]})}function Yd(e){let t=e.entry;return t.kind===`activity-group`?(0,L.jsx)(Jd,{entries:t.entries,model:e.model,ceo:e.ceo,voice:e.voice,onOpenWorker:e.onOpenWorker}):t.kind===`chat`?(0,L.jsxs)(`article`,{className:`jaw-ceo-message-row role-${t.role}`,children:[(0,L.jsx)(`span`,{className:`jaw-ceo-message-avatar`,"aria-hidden":`true`,children:t.role===`user`?`You`:t.role===`ceo`?`CEO`:`Log`}),(0,L.jsxs)(`div`,{className:`jaw-ceo-message-bubble`,children:[(0,L.jsxs)(`div`,{className:`jaw-ceo-message-meta`,children:[(0,L.jsx)(`strong`,{children:t.role===`user`?`You`:t.role===`ceo`?`Jaw CEO`:`Tool output`}),(0,L.jsx)(`small`,{children:Pd(t.at)})]}),(0,L.jsx)(`div`,{className:`jaw-ceo-message-text`,children:(0,L.jsx)(Kd,{text:t.text})})]})]}):t.kind===`live`?(0,L.jsxs)(`article`,{className:`jaw-ceo-message-row role-ceo is-live`,"aria-live":`polite`,children:[(0,L.jsx)(`span`,{className:`jaw-ceo-message-avatar is-live`,"aria-hidden":`true`,children:`CEO`}),(0,L.jsxs)(`div`,{className:`jaw-ceo-message-bubble`,children:[(0,L.jsxs)(`div`,{className:`jaw-ceo-message-meta`,children:[(0,L.jsx)(`strong`,{children:`Jaw CEO live`}),(0,L.jsx)(`small`,{children:t.eventType||`realtime`})]}),(0,L.jsx)(`div`,{className:`jaw-ceo-message-text`,children:(0,L.jsx)(Kd,{text:t.text})})]})]}):null}function Xd(e){let t=(0,I.useMemo)(()=>zd(Ld({model:e.model,ceo:e.ceo,voice:e.voice})),[e.model,e.ceo.state.transcript,e.ceo.pending,e.ceo.state.watches,e.ceo.audit,e.voice.lastTranscript,e.voice.lastEventType]),n=(0,I.useCallback)(e=>t[e]?.id||e,[t]),r=(0,I.useCallback)(e=>Rd(t[e]),[t]),i=yd({count:t.length,getItemKey:n,estimateSize:r});return(0,L.jsxs)(`section`,{className:`jaw-ceo-chat-panel`,"aria-label":`Jaw CEO chat`,children:[(0,L.jsx)(`div`,{ref:i.scrollRef,onScroll:i.onScroll,className:`jaw-ceo-chat-log jaw-ceo-timeline is-virtual`,"aria-live":`polite`,children:t.length===0?(0,L.jsxs)(`div`,{className:`jaw-ceo-empty-state`,children:[(0,L.jsx)(`span`,{className:`jaw-ceo-empty-kicker`,children:`Ready`}),(0,L.jsx)(`strong`,{children:e.selectedPort==null?`Dashboard context`:`Worker :${e.selectedPort} selected`}),(0,L.jsx)(`div`,{className:`jaw-ceo-quick-prompts`,children:Id(e.selectedPort).map(t=>(0,L.jsx)(`button`,{type:`button`,onClick:()=>e.model.setMessage(t.text),children:t.label},t.label))})]}):(0,L.jsx)(`div`,{className:`jaw-ceo-virtual-spacer`,style:{height:`${i.totalSize}px`},children:i.virtualItems.map(n=>{let r=t[n.index];return r?(0,L.jsx)(`div`,{ref:i.measureElement,className:`jaw-ceo-virtual-row`,"data-jaw-ceo-idx":n.index,style:{transform:`translateY(${n.start}px)`},children:(0,L.jsx)(Yd,{entry:r,model:e.model,ceo:e.ceo,voice:e.voice,onOpenWorker:e.onOpenWorker})},n.key):null})})}),(0,L.jsxs)(`form`,{className:`jaw-ceo-message-form`,onSubmit:t=>void e.model.submitMessage(t),children:[(0,L.jsx)(`textarea`,{value:e.model.message,rows:3,placeholder:`Send a task to the selected worker or ask about the dashboard.`,onChange:t=>e.model.setMessage(t.target.value)}),(0,L.jsxs)(`div`,{className:`jaw-ceo-form-row`,children:[(0,L.jsxs)(`select`,{value:e.model.responseMode,"aria-label":`Response mode`,onChange:t=>e.model.setResponseMode(t.target.value),children:[(0,L.jsx)(`option`,{value:`text`,children:`Text`}),(0,L.jsx)(`option`,{value:`voice`,children:`Voice`}),(0,L.jsx)(`option`,{value:`both`,children:`Both`}),(0,L.jsx)(`option`,{value:`silent`,children:`Silent`})]}),(0,L.jsx)(`button`,{type:`submit`,disabled:e.ceo.busy||!e.model.message.trim(),children:`Send`})]})]})]})}function Zd(e){return e.model.tab===`settings`?(0,L.jsx)(Nd,{}):(0,L.jsx)(Xd,{model:e.model,ceo:e.ceo,voice:e.voice,selectedPort:e.selectedPort,onOpenWorker:e.onOpenWorker})}var Qd=[{id:`chat`,label:`Chat`},{id:`settings`,label:`Settings`}];function $d(e){return(0,L.jsx)(`div`,{className:`jaw-ceo-tabs`,role:`tablist`,"aria-label":`Jaw CEO console tabs`,children:Qd.map(t=>(0,L.jsx)(`button`,{type:`button`,role:`tab`,className:e.active===t.id?`is-active`:``,"aria-selected":e.active===t.id,onClick:()=>e.onChange(t.id),children:(0,L.jsx)(`span`,{children:t.label})},t.id))})}function ef(e){return async t=>{t.preventDefault();let n=e.message.trim();if(n){e.setMessage(``);try{await e.ceo.sendText(n,e.responseMode),e.setTab(`chat`)}catch{}}}}function tf(e){return{summarize:async t=>{await e.ceo.summarizeCompletion(t.completionKey,`short`),await e.ceo.refresh(),e.setTab(`chat`)},continueCompletion:async t=>{let n=e.responseMode===`voice`||e.responseMode===`both`||e.responseMode===`silent`?e.responseMode:`text`;await e.ceo.continueCompletion(t.completionKey,n),await e.ceo.refresh(),e.setTab(`chat`)}}}function nf(e){let[t,n]=(0,I.useState)(`chat`),[r,i]=(0,I.useState)(``),[a,o]=(0,I.useState)(`text`),s=tf({ceo:e.ceo,responseMode:a,setTab:n});return{tab:t,setTab:n,message:r,setMessage:i,responseMode:a,setResponseMode:o,submitMessage:ef({ceo:e.ceo,message:r,responseMode:a,setMessage:i,setTab:n}),...s}}var rf=()=>(0,L.jsxs)(`svg`,{viewBox:`0 0 16 16`,width:`16`,height:`16`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.7`,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":`true`,children:[(0,L.jsx)(`path`,{d:`M13.2 8a5.2 5.2 0 1 1-1.5-3.7`}),(0,L.jsx)(`path`,{d:`M13.2 3.2v3.2H10`})]}),af=()=>(0,L.jsx)(`svg`,{viewBox:`0 0 16 16`,width:`17`,height:`17`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.8`,strokeLinecap:`round`,"aria-hidden":`true`,children:(0,L.jsx)(`path`,{d:`M4 4l8 8M12 4l-8 8`})});function of(e){return e===`connecting`?`connecting`:e===`active`?`listening`:e===`silent`?`silent`:e===`paused`?`paused`:e===`sleeping`?`sleeping`:e===`disabled`?`disabled`:e===`error`?`error`:`idle`}function sf(e){return e===`active`||e===`connecting`||e===`silent`}function cf(e){return e===`active`||e===`connecting`||e===`silent`?`live`:e===`paused`||e===`sleeping`?`paused`:e===`disabled`||e===`error`?`issue`:`idle`}function lf(e){let t=(0,I.useRef)(null),n=nf({ceo:e.ceo});if((0,I.useEffect)(()=>{if(!e.open)return;t.current?.focus();function n(t){if(t.key===`Escape`){if(sf(e.voice.status)){t.preventDefault(),e.voice.stop();return}e.onClose()}}return document.addEventListener(`keydown`,n),()=>document.removeEventListener(`keydown`,n)},[e]),!e.open)return null;let r=e.selectedPort==null?`Dashboard`:`Worker :${e.selectedPort}`,i=of(e.voice.status);return(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(`div`,{className:`jaw-ceo-console-overlay`,onClick:e.onClose,"aria-hidden":`true`}),(0,L.jsxs)(`aside`,{className:`jaw-ceo-console`,role:`dialog`,"aria-modal":`true`,"aria-label":`Jaw CEO console`,children:[(0,L.jsxs)(`header`,{className:`jaw-ceo-console-header`,children:[(0,L.jsxs)(`div`,{className:`jaw-ceo-console-titlebar`,children:[(0,L.jsx)(`span`,{className:`jaw-ceo-console-mark status-${e.voice.status}`,"aria-hidden":`true`,children:`CEO`}),(0,L.jsxs)(`div`,{className:`jaw-ceo-console-heading`,children:[(0,L.jsx)(`span`,{children:`Dashboard coordinator`}),(0,L.jsx)(`h3`,{children:`Jaw CEO`})]})]}),(0,L.jsxs)(`div`,{className:`jaw-ceo-console-header-actions`,children:[(0,L.jsx)(`button`,{type:`button`,className:`jaw-ceo-icon-btn`,onClick:()=>void e.ceo.refresh(),"aria-label":`Refresh Jaw CEO`,children:(0,L.jsx)(rf,{})}),(0,L.jsx)(`button`,{ref:t,type:`button`,className:`jaw-ceo-console-close`,onClick:e.onClose,"aria-label":`Close Jaw CEO`,children:(0,L.jsx)(af,{})})]}),(0,L.jsxs)(`div`,{className:`jaw-ceo-console-summary`,"aria-label":`Jaw CEO status summary`,children:[(0,L.jsx)(`span`,{children:r}),(0,L.jsx)(`span`,{children:`Single session`}),(0,L.jsxs)(`span`,{className:`voice-tone-${cf(e.voice.status)}`,children:[`Voice `,i]})]})]}),(0,L.jsx)($d,{active:n.tab,onChange:n.setTab}),(0,L.jsx)(`div`,{className:`jaw-ceo-console-body`,children:(0,L.jsx)(Zd,{model:n,ceo:e.ceo,voice:e.voice,selectedPort:e.selectedPort,onOpenWorker:e.onOpenWorker})}),(0,L.jsxs)(`footer`,{className:`jaw-ceo-console-footer voice-${e.voice.status}`,children:[(0,L.jsxs)(`div`,{className:`jaw-ceo-realtime-status`,children:[(0,L.jsx)(`span`,{className:`jaw-ceo-realtime-dot`,"aria-hidden":`true`}),(0,L.jsxs)(`span`,{children:[`Voice: `,i,e.voice.error?` - ${e.voice.error}`:``]}),e.voice.lastTranscript?(0,L.jsx)(`small`,{children:e.voice.lastTranscript}):e.voice.lastEventType?(0,L.jsx)(`small`,{children:e.voice.lastEventType}):null]}),(0,L.jsx)(`button`,{type:`button`,className:`jaw-ceo-voice-action`,onClick:()=>sf(e.voice.status)?void e.voice.stop():void e.voice.talk(),children:sf(e.voice.status)?`Stop voice`:`Start voice`})]})]})]})}var uf=()=>(0,L.jsxs)(`svg`,{viewBox:`0 0 16 16`,width:`13`,height:`13`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.6`,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":`true`,children:[(0,L.jsx)(`path`,{d:`M8 2.5a2 2 0 0 0-2 2v3a2 2 0 0 0 4 0v-3a2 2 0 0 0-2-2Z`}),(0,L.jsx)(`path`,{d:`M3.8 7.2a4.2 4.2 0 0 0 8.4 0`}),(0,L.jsx)(`path`,{d:`M8 11.4v2.1`})]});function df(e){return e===`active`?`voice`:e===`connecting`?`joining`:e===`silent`?`listening`:e===`paused`?`paused`:e===`sleeping`?`sleep`:e===`disabled`?`off`:e===`error`?`error`:`ready`}function ff(e){let t=e.voiceStatus===`active`||e.voiceStatus===`connecting`||e.voiceStatus===`silent`,n=e.error?`error`:df(e.voiceStatus),r=e.error?`Jaw CEO error: ${e.error}`:`Open Jaw CEO. Single chat session, voice ${df(e.voiceStatus)}.`;return(0,L.jsxs)(`div`,{className:`jaw-ceo-workbench-launcher${e.open?` is-open`:``}${t?` is-active`:``}${e.error?` is-error`:``}`,"aria-label":`Jaw CEO launcher`,children:[(0,L.jsxs)(`button`,{type:`button`,className:`jaw-ceo-workbench-button`,"aria-expanded":e.open,title:r,onClick:e.onOpenConsole,children:[(0,L.jsx)(`span`,{className:`jaw-ceo-avatar status-${e.voiceStatus}`,"aria-hidden":`true`,children:`CEO`}),(0,L.jsx)(`span`,{className:`jaw-ceo-workbench-label`,children:`CEO`}),(0,L.jsx)(`span`,{className:`jaw-ceo-workbench-status`,children:n})]}),(0,L.jsx)(`button`,{type:`button`,className:`jaw-ceo-workbench-icon`,"aria-label":t?`Stop Jaw CEO voice`:`Start Jaw CEO voice`,title:t?`Stop voice`:`Start voice`,disabled:e.busy,onClick:e.onToggleVoice,children:(0,L.jsx)(uf,{})})]})}function pf(e){return e===`connecting`?`Connecting voice`:e===`silent`?`Listening`:`Voice active`}function mf(e){if(e.status!==`connecting`&&e.status!==`active`&&e.status!==`silent`)return null;let t=pf(e.status),n=e.selectedPort==null?`Dashboard`:`Worker :${e.selectedPort}`;return(0,L.jsx)(`div`,{className:`jaw-ceo-voice-overlay status-${e.status}`,role:`status`,"aria-live":`polite`,children:(0,L.jsxs)(`div`,{className:`jaw-ceo-voice-overlay-card`,children:[(0,L.jsxs)(`div`,{className:`jaw-ceo-voice-wave`,"aria-hidden":`true`,children:[(0,L.jsx)(`span`,{}),(0,L.jsx)(`span`,{}),(0,L.jsx)(`span`,{})]}),(0,L.jsxs)(`div`,{className:`jaw-ceo-voice-overlay-copy`,children:[(0,L.jsx)(`strong`,{children:t}),(0,L.jsx)(`span`,{children:e.status===`silent`?`No speech detected. Session is still open.`:n}),e.lastTranscript?(0,L.jsx)(`small`,{children:e.lastTranscript}):e.lastEventType?(0,L.jsx)(`small`,{children:e.lastEventType}):null]}),(0,L.jsx)(`button`,{type:`button`,className:`jaw-ceo-voice-stop`,"aria-label":`Stop Jaw CEO voice`,onClick:e.onStop,children:`Stop`})]})})}var hf=5e3;function gf(){return new Date().toISOString()}function _f(e){return{session:{sessionId:`pending`,inputMode:`text`,responseMode:`text`,selectedPort:e,openedAt:gf(),lastUserActivityAt:gf(),voiceArmed:!1,frontendPresence:`visible`,autoRead:!1},transcript:[],watches:[],pending:[],auditTail:[],voice:{status:`idle`,sessionId:null,model:`gpt-realtime-2`,voice:`marin`,error:null}}}function vf(e,t){let n=_f(t);return{...n,...e,session:{...n.session,...e.session??{},selectedPort:e.session?.selectedPort??t},transcript:Array.isArray(e.transcript)?e.transcript:[],watches:Array.isArray(e.watches)?e.watches:[],pending:Array.isArray(e.pending)?e.pending:[],auditTail:Array.isArray(e.auditTail)?e.auditTail:[],voice:{...n.voice,...e.voice??{}}}}function yf(e){return e.kind===`instance-completed`?`${e.kind}:${e.port}:${e.requestId||``}:${e.messageId||``}:${e.at}`:`${e.kind}:${e.port}:${e.messageId}:${e.role}:${e.at}`}function bf(e){return e.kind===`instance-message`?{kind:`instance-message`,port:e.port,messageId:e.messageId,role:e.role,at:e.at}:null}function xf(e){let[t,n]=(0,I.useState)(()=>_f(e.selectedPort)),[r,i]=(0,I.useState)(null),[a,o]=(0,I.useState)(null),[s,c]=(0,I.useState)(null),l=(0,I.useRef)(new Set),u=(0,I.useRef)(t);(0,I.useEffect)(()=>{u.current=t},[t]);let d=(0,I.useCallback)(async()=>{i(e=>e||`refresh`);try{let t=vf(await Cd(),e.selectedPort),r=Array.from(new Set(t.watches.map(e=>e.port)));r.length>0&&await Dd({ports:r}),n(vf(await Cd(),e.selectedPort)),o(null)}catch(e){o(e.message)}finally{i(e=>e===`refresh`?null:e)}},[e.selectedPort]);(0,I.useEffect)(()=>{if(!e.documentVisible)return;let t=!1,n=null;async function r(){t||await d()}return r(),n=setInterval(()=>{r()},hf),()=>{t=!0,n&&clearInterval(n)}},[e.documentVisible,d]),(0,I.useEffect)(()=>{let t=[];for(let n of e.managerEvents){let e=bf(n);if(!e)continue;let r=yf(e);l.current.has(r)||(l.current.add(r),t.push(e))}t.length!==0&&(async()=>{try{await Dd({events:t}),await d()}catch(e){o(e.message)}})()},[e.managerEvents,d]);let f=(0,I.useCallback)(async(t,n=`text`)=>{i(`message`);try{let r=await Ed({text:t,responseMode:n,selectedPort:e.selectedPort,...u.current.session.sessionId===`pending`?{}:{sessionId:u.current.session.sessionId}});return c(r.data?.response||r.error?.message||r.message||`Jaw CEO message completed.`),await d(),r}catch(e){let t=e.message;throw o(t),e}finally{i(null)}},[e.selectedPort,d]),p=(0,I.useCallback)(async e=>{i(`ack:${e}`);try{await Ad(e,`ack`),await d()}finally{i(null)}},[d]),m=(0,I.useCallback)(async e=>{i(`dismiss:${e}`);try{await Ad(e,`dismiss`),await d()}finally{i(null)}},[d]);return{state:t,pending:t.pending,audit:t.auditTail,busy:r!==null,error:a,lastResponse:s,refresh:d,sendText:f,continueCompletion:Od,summarizeCompletion:kd,ackCompletion:p,dismissCompletion:m}}var Sf={start:[523.25,659.25],silent:[392],stop:[659.25,392],error:[220,196]};function Cf(e){let t=window.AudioContext||window.webkitAudioContext;if(t)try{let n=new t,r=n.currentTime;Sf[e].forEach((t,i)=>{let a=n.createOscillator(),o=n.createGain(),s=r+i*.085;a.type=e===`silent`?`sine`:`triangle`,a.frequency.setValueAtTime(t,s),o.gain.setValueAtTime(1e-4,s),o.gain.exponentialRampToValueAtTime(e===`silent`?.015:.024,s+.012),o.gain.exponentialRampToValueAtTime(1e-4,s+.105),a.connect(o),o.connect(n.destination),a.start(s),a.stop(s+.12)}),window.setTimeout(()=>void n.close().catch(()=>void 0),420)}catch{}}async function wf(e){if(!navigator.mediaDevices?.getUserMedia)throw Error(`Microphone capture is not available in this browser.`);let t=new RTCPeerConnection,n=t.createDataChannel(`oai-events`);n.onmessage=t=>{try{e.onRealtimeEvent(JSON.parse(t.data))}catch{e.onRealtimeEvent({type:`raw`,text:String(t.data)})}};let r=new MediaStream,i=document.createElement(`audio`);i.autoplay=!0,i.setAttribute(`playsinline`,``),i.srcObject=r,i.className=`jaw-ceo-voice-audio`,i.setAttribute(`aria-hidden`,`true`),document.body.appendChild(i),t.ontrack=e=>{for(let t of e.streams[0]?.getTracks()||[e.track])r.getTracks().includes(t)||r.addTrack(t)};let a=await navigator.mediaDevices.getUserMedia({audio:{noiseSuppression:!0,echoCancellation:!0,autoGainControl:!0}});for(let e of a.getTracks())t.addTrack(e,a);let o=await t.createOffer();if(await t.setLocalDescription(o),!o.sdp)throw Error(`Browser did not create a voice SDP offer.`);let s=await jd({offerSdp:o.sdp,selectedPort:e.selectedPort,...e.sessionId?{sessionId:e.sessionId}:{},responseMode:`voice`});await t.setRemoteDescription({type:`answer`,sdp:s.answerSdp});function c(){n.close();for(let e of a.getTracks())e.stop();t.close(),i.remove()}function l(e){for(let t of a.getAudioTracks())t.enabled=e}return{sessionId:s.sessionId,peer:t,dataChannel:n,micStream:a,audio:i,setMicEnabled:l,close:c}}var Tf=4e3,Ef=3e4;function Df(e){if(!e||typeof e!=`object`)return null;let t=e,n=String(t.type||``);return typeof t.delta==`string`&&(n===`response.audio_transcript.delta`||n===`response.text.delta`||n===`response.output_text.delta`)?t.delta:typeof t.transcript==`string`?t.transcript:typeof t.text==`string`&&(n.includes(`transcript`)||n.includes(`text`))?t.text:typeof t.output==`string`?t.output:null}function Of(e){return e===`response.audio_transcript.delta`||e===`response.text.delta`||e===`response.output_text.delta`}function kf(e){if(!e||typeof e!=`object`)return null;let t=e.type;return typeof t==`string`?t:null}function Af(e){let[t,n]=(0,I.useState)(`idle`),[r,i]=(0,I.useState)(null),[a,o]=(0,I.useState)(null),[s,c]=(0,I.useState)(null),l=(0,I.useRef)(null),u=(0,I.useRef)(e),d=(0,I.useRef)(0),f=(0,I.useRef)(Date.now()),p=(0,I.useRef)(0),m=(0,I.useRef)(``);(0,I.useEffect)(()=>{u.current=e},[e]);function h(e,t){f.current=Date.now(),e&&o(e),t&&c(t.length>180?`${t.slice(0,177)}...`:t),n(e=>e===`silent`?`active`:e)}let g=(0,I.useCallback)(async()=>{d.current+=1;let e=l.current;l.current=null,e&&(e.close(),await Md(e.sessionId).catch(()=>void 0)),n(`sleeping`)},[]),_=(0,I.useCallback)(async()=>{if(t===`connecting`&&!l.current){d.current+=1,Cf(`stop`),n(`paused`);return}l.current?.setMicEnabled(!1),Cf(`stop`),n(`paused`)},[t]),v=(0,I.useCallback)(async()=>{await g(),Cf(`stop`)},[g]),y=(0,I.useCallback)(async()=>{if(l.current){l.current.setMicEnabled(!0),f.current=Date.now(),i(null),Cf(`start`),n(`active`);return}if(t===`connecting`)return;let e=d.current+1;d.current=e,n(`connecting`),i(null),o(null),c(null),m.current=``,Cf(`start`);try{let t=await wf({selectedPort:u.current.selectedPort,...u.current.sessionId?{sessionId:u.current.sessionId}:{},onRealtimeEvent:e=>{let t=kf(e),n=Df(e),r=n&&Of(t)?`${m.current}${n}`:n;n&&Of(t)&&(m.current=r||``),t===`response.created`&&(m.current=``),h(t,r),r&&u.current.onTranscript(r)}});if(d.current!==e){t.close(),await Md(t.sessionId).catch(()=>void 0);return}l.current=t,f.current=Date.now(),n(`active`)}catch(t){if(d.current!==e)return;i(t.message),Cf(`error`),n(t.message.includes(`OPENAI_API_KEY`)?`disabled`:`error`),l.current?.close(),l.current=null}},[t]),b=(0,I.useCallback)(async(e,t)=>{let n=e.trim();n&&await Ed({text:n,selectedPort:u.current.selectedPort,...u.current.sessionId?{sessionId:u.current.sessionId}:{},inputMode:`voice`,responseMode:t})},[]),x=(0,I.useCallback)(async e=>{await Od(e.completionKey,`voice`),u.current.onSpokenCompletion(e.completionKey)},[]);return(0,I.useEffect)(()=>()=>{d.current+=1;let e=l.current;l.current=null,e&&(e.close(),Md(e.sessionId).catch(()=>void 0))},[]),(0,I.useEffect)(()=>{if(e.documentVisible)return;let t=l.current;t&&(d.current+=1,l.current=null,t.close(),Md(t.sessionId).catch(()=>void 0),n(`sleeping`))},[e.documentVisible]),(0,I.useEffect)(()=>{if(t!==`active`&&t!==`silent`)return;let e=window.setInterval(()=>{if(!l.current)return;let e=Date.now();e-f.current<Tf||(n(`silent`),e-p.current>=Ef&&(Cf(`silent`),p.current=e))},1e3);return()=>window.clearInterval(e)},[t]),e.autoRead,{status:t,error:r,lastEventType:a,lastTranscript:s,talk:y,stop:_,end:v,sendText:b,speakCompletion:x}}function jf(){let[e,t]=(0,I.useState)(()=>typeof document>`u`||document.visibilityState===`visible`);return(0,I.useEffect)(()=>{function e(){t(document.visibilityState===`visible`)}return document.addEventListener(`visibilitychange`,e),()=>document.removeEventListener(`visibilitychange`,e)},[]),e}function Mf(e){let[t,n]=(0,I.useState)(!1),r=jf(),i=(0,I.useMemo)(()=>[...e.managerEvents,...e.messageEvents],[e.managerEvents,e.messageEvents]),a=xf({selectedPort:e.selectedPort,documentVisible:r,managerEvents:i}),o=a.state.session.sessionId===`pending`?null:a.state.session.sessionId,s=Af({selectedPort:e.selectedPort,...o?{sessionId:o}:{},autoRead:a.state.session.autoRead,documentVisible:r,onTranscript:()=>void 0,onSpokenCompletion:e=>{a.ackCompletion(e)}}),c=s.status===`active`||s.status===`connecting`||s.status===`silent`;return{voice:s,workbenchButton:(0,L.jsx)(ff,{open:t,voiceStatus:s.status,busy:a.busy,error:a.error||s.error,onOpenConsole:()=>n(!0),onToggleVoice:()=>{c?s.stop():s.talk()}}),voiceOverlay:(0,L.jsx)(mf,{status:s.status,selectedPort:e.selectedPort,lastEventType:s.lastEventType,lastTranscript:s.lastTranscript,onStop:()=>void s.stop()}),consoleContent:t?(0,L.jsx)(lf,{open:!0,selectedPort:e.selectedPort,ceo:a,voice:s,onClose:()=>n(!1),onOpenWorker:e.onOpenWorker}):null}}function Nf(e,t){if(e.length===0)return e;let n=new Set(t.map(e=>e.profileId)),r=e.filter(e=>n.has(e));return r.length===e.length?e:r}function Pf(e){return e.panelLayoutVersion?{rightPanel:{open:e.rightPanelOpen??!1,width:e.rightPanelWidth??360,topMode:e.rightPanelTopMode??null,bottomMode:e.rightPanelBottomMode??null,splitRatio:e.rightPanelSplitRatio??.5},bottomPanel:{open:e.bottomPanelOpen??!1,height:e.bottomPanelHeight??320,tabs:e.bottomPanelTabs??[],activeTab:e.bottomPanelActiveTab??null}}:{}}function Ff(e){return{panelLayoutVersion:1,rightPanelOpen:e.rightPanel.open,rightPanelWidth:e.rightPanel.width,rightPanelTopMode:e.rightPanel.topMode,rightPanelBottomMode:e.rightPanel.bottomMode,rightPanelSplitRatio:e.rightPanel.splitRatio,bottomPanelOpen:e.bottomPanel.open,bottomPanelHeight:e.bottomPanel.height,bottomPanelTabs:e.bottomPanel.tabs,bottomPanelActiveTab:e.bottomPanel.activeTab}}function If(){let[e,t]=(0,I.useState)(null),[n,r]=(0,I.useState)(!0),[i,a]=(0,I.useState)(null),[o,s]=(0,I.useState)(``),[c,l]=(0,I.useState)(`all`),[u,d]=(0,I.useState)(``),[f,p]=(0,I.useState)(!1),[m,h]=(0,I.useState)(!1),[g,v]=(0,I.useState)(void 0),[y,b]=(0,I.useState)(null),[x,S]=(0,I.useState)(null),[ee,te]=(0,I.useState)(null),[C,w]=(0,I.useState)(null),[T,E]=(0,I.useState)([]),[re,ie]=(0,I.useState)(!1),[ae,oe]=(0,I.useState)(null),[D,O]=(0,I.useState)(`files`),[ce,le]=(0,I.useState)(0),[ue,k]=(0,I.useState)(`display`),[de,fe]=(0,I.useState)({kind:`overall`}),[pe,me]=(0,I.useState)(`today`),[he,ge]=(0,I.useState)(()=>yu()),[_e,j]=(0,I.useState)(0),[ve,ye]=(0,I.useState)(!1),[be,xe]=(0,I.useState)(!1),[Se,Ce]=(0,I.useState)(null),we=(0,I.useCallback)(e=>{Ce(e),xe(!0)},[]);(0,I.useEffect)(()=>{bu(he)},[he]),Cu({enabled:he,onUnload:()=>{ge(!1),ye(!0)}}),(0,I.useEffect)(()=>{if(!ve||typeof document>`u`||document.hidden)return;let e=setTimeout(()=>ye(!1),8e3);return()=>clearTimeout(e)},[ve]);let M=Fu(),N=Iu(),Te=qu(e=>{m&&M.save({ui:{uiTheme:e}})}),Ee=Zu(),De=dd(),P=e?.instances||[],Oe=cd(P),ke=Qu(M.save,t),Ae=(0,I.useMemo)(()=>e?.manager.profiles||[],[e]),je=(0,I.useMemo)(()=>{let e=new Set(Ae.map(e=>e.profileId));return T.filter(t=>e.has(t))},[T,Ae]),Me=(0,I.useMemo)(()=>{let e=o.trim().toLowerCase();return P.filter(t=>c!==`all`&&t.status!==c||je.length>0&&(!t.profileId||!je.includes(t.profileId))?!1:e?[String(t.port),t.url,lu(t),t.version,t.workingDir,t.currentCli,t.currentModel,t.healthReason,t.label,t.group,t.profileId].some(t=>String(t||``).toLowerCase().includes(e)):!0)},[je,P,o,c]),Ne=(0,I.useMemo)(()=>N.selectedPort==null?Me.find(e=>e.ok)||null:P.find(e=>e.port===N.selectedPort)||null,[Me,P,N.selectedPort]),Pe=Mf({selectedPort:Ne?.port??N.selectedPort??null,managerEvents:De.events,messageEvents:Oe.events,onOpenWorker:Je});pd(Pe.voice),md({enabled:N.dashboardShortcutsEnabled,keymap:N.dashboardShortcutKeymap,onAction:vt});let Fe=N.activeDetailTab===`preview`&&N.sidebarMode===`instances`?Ne?.port??null:null,Ie=(0,I.useMemo)(()=>[...De.events,...Oe.events],[De.events,Oe.events]),F=Hu({events:Ie,activityDockCollapsed:N.activityDockCollapsed,setActivityDockCollapsed:N.setActivityDockCollapsed,saveUi:Ve,activePreviewPort:Fe});function Le(){let e=[`auto`,`light`,`dark`],t=e[(e.indexOf(Te.theme)+1)%e.length];Te.setTheme(t)}function Re(){Ne&&window.open(Ne.url,`_blank`,`noopener,noreferrer`)}(0,I.useEffect)(()=>{document.documentElement.lang=N.locale},[N.locale]),(0,I.useEffect)(()=>{function e(e){e.key!==`?`||e.metaKey||e.ctrlKey||e.altKey||gu(e.target)||(e.preventDefault(),we(`shortcuts`))}return document.addEventListener(`keydown`,e),()=>document.removeEventListener(`keydown`,e)},[we]);async function ze(e=f){r(!0),a(null);try{let n=await ne(e),r=Nf(T,n.manager.profiles||[]);r!==T&&(E(r),M.save({activeProfileFilter:r})),t(n)}catch(e){a(e.message)}finally{r(!1)}}async function Be(e){let n=await _(e);n&&t(t=>t&&{...t,instances:t.instances.map(t=>t.port===e?n:t)})}Eu(`instances`,()=>void ze(),`app`),(0,I.useEffect)(()=>{async function e(){try{let e=await M.refresh(),t=e.registry.ui;N.setSelectedPort(t.selectedPort),N.setActiveDetailTab(t.selectedTab),N.setSidebarCollapsed(t.sidebarCollapsed),N.setActivityDockCollapsed(t.activityDockCollapsed),N.setActivityDockHeight(t.activityDockHeight);let n=mu(Pu(window.location.search)??t.sidebarMode);N.setSidebarMode(n),n!==t.sidebarMode&&Ve({sidebarMode:n}),N.setNotesSelectedPath(t.notesSelectedPath),N.setNotesViewMode(t.notesViewMode),N.setNotesAuthoringMode(t.notesAuthoringMode??`plain`),N.setNotesWordWrap(t.notesWordWrap),N.setNotesVimMode(t.notesVimMode),N.setNotesTreeWidth(t.notesTreeWidth),N.setNotesGraphSettings(t.notesGraphSettings),N.setShowLatestActivityTitles(t.showLatestActivityTitles),N.setShowInlineLabelEditor(t.showInlineLabelEditor),N.setShowSidebarRuntimeLine(t.showSidebarRuntimeLine),N.setShowSelectedRowActions(t.showSelectedRowActions),N.setDashboardShortcutsEnabled(t.dashboardShortcutsEnabled),N.setDashboardShortcutKeymap(t.dashboardShortcutKeymap),N.setDiffRootPolicy(t.diffRootPolicy),N.setDiffPinnedRootByPort(t.diffPinnedRootByPort),N.setDiffDefaultMode(t.diffDefaultMode),N.setDiffBaseRef(t.diffBaseRef),N.setDiffIncludeUntracked(t.diffIncludeUntracked),N.setLocale(t.locale),F.hydrateSeenAt(t.activitySeenAt??null,t.activitySeenByPort||{}),E(e.registry.activeProfileFilter||[]),Te.syncFromRegistry(t.uiTheme),v(Pf(t))}finally{h(!0),await ze()}}e()},[]);async function Ve(e){!m||e===void 0||await M.save({ui:e})}function He(e){Ve(Ff(e))}let Ue=(0,I.useMemo)(()=>P.reduce((e,t)=>(t.profileId&&(e[t.profileId]=(e[t.profileId]||0)+1),e),{}),[P]),We=(0,I.useMemo)(()=>P.reduce((e,t)=>(e.total+=1,e[t.status]=(e[t.status]||0)+1,e),{total:0}),[P]);function Ge(e){let t=T.includes(e)?T.filter(t=>t!==e):[...T,e];E(t),M.save({activeProfileFilter:t})}function Ke(){return N.activeDetailTab!==`settings`||!re?!0:window.confirm(`Discard unsaved Settings changes?`)}function qe(e){Ke()&&(ie(!1),F.markPortSeen(e.port),N.setSelectedPort(e.port),N.setActiveDetailTab(`preview`),N.setActivityDockCollapsed(!0),N.setDrawerOpen(!1),Ve({selectedPort:e.port,selectedTab:`preview`,activityDockCollapsed:!0}))}function Je(e){let t=P.find(t=>t.port===e);t&&qe(t)}function Ye(e){Ke()&&(ie(!1),F.markPortSeen(e.port),N.setSelectedPort(e.port),N.setDrawerOpen(!1),Ve({selectedPort:e.port}))}function Xe(e){if(!(e!==`settings`&&!Ke())){if(e!==`settings`&&ie(!1),N.activeDetailTab===`preview`&&e!==`preview`){let e=N.selectedPort;e!=null&&F.markPortSeen(e)}if(N.setActiveDetailTab(e),e===`preview`){let t=N.selectedPort;t!=null&&F.markPortSeen(t),N.setActivityDockCollapsed(!0),Ve({selectedTab:e,activityDockCollapsed:!0});return}Ve({selectedTab:e})}}function Ze(){let e=!N.sidebarCollapsed;N.setSidebarCollapsed(e),Ve({sidebarCollapsed:e})}function Qe(){if(N.activityDockCollapsed){F.openAndMarkSeen();return}F.closeAndPersistSeen()}function $e(e){N.setActivityDockHeight(e),Ve({activityDockHeight:e})}function et(e){if(N.sidebarMode===`instances`&&e!==`instances`&&N.activeDetailTab===`preview`){let e=N.selectedPort;e!=null&&F.markPortSeen(e)}let t=mu(e);N.setSidebarMode(t),Ve({sidebarMode:t})}function tt(e){N.setNotesSelectedPath(e),Ve({notesSelectedPath:e})}let[nt,rt]=(0,I.useState)(null),it=(0,I.useRef)(null);function at(e){rt(e),it.current&&clearTimeout(it.current),it.current=setTimeout(()=>rt(null),2500)}function ot(e){let t=e.trim();t&&(N.sidebarMode!==`notes`&&et(`notes`),tt(t),at(t))}(0,I.useEffect)(()=>()=>{it.current&&clearTimeout(it.current)},[]);function st(){O(`search`),le(e=>e+1)}function ct(e){N.setNotesViewMode(e),Ve({notesViewMode:e})}function lt(e){N.setNotesAuthoringMode(e),Ve({notesAuthoringMode:e})}function ut(e){N.setNotesWordWrap(e),Ve({notesWordWrap:e})}function dt(e){N.setNotesVimMode(e),Ve({notesVimMode:e})}function ft(e){N.setNotesTreeWidth(e),Ve({notesTreeWidth:e})}function pt(e){N.setNotesGraphSettings(e),Ve({notesGraphSettings:e})}let mt=Mu({active:N.sidebarMode===`notes`,selectedPath:N.notesSelectedPath,onSelectedPathChange:tt}),ht=N.notesSelectedPath?mt.index?.notes.find(e=>e.path===N.notesSelectedPath)??null:null;function gt(e){e.showLatestActivityTitles!==void 0&&N.setShowLatestActivityTitles(e.showLatestActivityTitles),e.showInlineLabelEditor!==void 0&&N.setShowInlineLabelEditor(e.showInlineLabelEditor),e.showSidebarRuntimeLine!==void 0&&N.setShowSidebarRuntimeLine(e.showSidebarRuntimeLine),e.showSelectedRowActions!==void 0&&N.setShowSelectedRowActions(e.showSelectedRowActions),e.dashboardShortcutsEnabled!==void 0&&N.setDashboardShortcutsEnabled(e.dashboardShortcutsEnabled),e.dashboardShortcutKeymap!==void 0&&N.setDashboardShortcutKeymap(e.dashboardShortcutKeymap),e.diffRootPolicy!==void 0&&N.setDiffRootPolicy(e.diffRootPolicy),e.diffPinnedRootByPort!==void 0&&N.setDiffPinnedRootByPort(e.diffPinnedRootByPort),e.diffDefaultMode!==void 0&&N.setDiffDefaultMode(e.diffDefaultMode),e.diffBaseRef!==void 0&&N.setDiffBaseRef(e.diffBaseRef),e.diffIncludeUntracked!==void 0&&N.setDiffIncludeUntracked(e.diffIncludeUntracked),e.locale!==void 0&&N.setLocale(e.locale),Ve(e)}function _t(e){if(Me.length===0)return;let t=Ne?.port??null,n=t==null?-1:Me.findIndex(e=>e.port===t),r=Me[((n>=0?n:e>0?-1:0)+e+Me.length)%Me.length];r&&Ye(r)}function vt(e){if(!un.dispatch(e)){if(e===`focusInstances`){et(`instances`),N.setDrawerOpen(!1);return}if(e===`focusActiveSession`){let e=Ne?.ok?Ne:Me.find(e=>e.ok)||null;e?qe(e):et(`instances`);return}if(e===`focusNotes`){et(`notes`),N.setDrawerOpen(!1);return}if(e===`previousInstance`){_t(-1);return}e===`nextInstance`&&_t(1)}}(0,I.useEffect)(()=>{if(N.dashboardShortcutsEnabled)return A()?.shortcuts?.onAction?.(e=>{vt(e)})},[Me,Ne,N.dashboardShortcutsEnabled,N.sidebarMode,N.activeDetailTab,re]),(0,I.useEffect)(()=>{function e(e){if((e.ctrlKey||e.metaKey)&&e.key===`f`){let t=document.querySelector(`.preview-frame`);if(t?.contentWindow){e.preventDefault(),t.contentWindow.postMessage({type:`jaw-preview-search`},`*`);return}}if(!N.dashboardShortcutsEnabled||Qn(e.target))return;let t=Xn(e,N.dashboardShortcutKeymap);t&&(e.preventDefault(),vt(t))}return document.addEventListener(`keydown`,e),()=>document.removeEventListener(`keydown`,e)},[Me,Ne,N.dashboardShortcutsEnabled,N.dashboardShortcutKeymap,N.sidebarMode,N.activeDetailTab,re]);async function bt(e,t){let n=t.lifecycle;if(!n||e===`perm`&&!window.confirm(`Register :${t.port} as a persistent system service? It will auto-start on login and auto-restart on crash.`)||e===`unperm`&&!window.confirm(`Remove persistent service for :${t.port}? The instance will stop and won't auto-start.`))return;if(e===`stop`&&n.owner===`service`){if(!window.confirm(`Stop :${t.port}? This will also remove the persistent service.`))return}else if((e===`stop`||e===`restart`)&&!window.confirm(`${e} :${t.port}?`))return;if(!Ke())return;ie(!1);let r=t.uptime;b(t.port),S(null),te(t.port),w(e);try{let n=e===`start`?u:void 0,i=await se(e,t.port,n),a=i.expectedStateAfter||(e===`start`||e===`perm`?`online`:e===`stop`||e===`unperm`?`offline`:`restart-detected`);(await yt({port:t.port,expected:a,previousUptime:r,fetchOnce:(e,t)=>_(e,{signal:t})})).settled||S(`${i.message} (not yet reachable, refresh manually if needed)`),await ze(),ba({topics:[`instances`],reason:`instance:lifecycle`,source:`ui`,sourceId:`app`}),N.setSelectedPort(t.port)}catch(e){S(e.message)}finally{b(null),te(null),w(null)}}let xt=(0,L.jsx)(nn,{error:i,loading:n,instances:P,filtered:Me,selectedInstance:Ne,data:e,lifecycleBusyPort:y,transitioningPort:ee,transitionAction:C,activityUnreadByPort:F.unreadByPort,latestTitleByPort:Oe.titlesByPort,busyPorts:Oe.busyPorts,showLatestActivityTitles:N.showLatestActivityTitles,showInlineLabelEditor:N.showInlineLabelEditor,showSidebarRuntimeLine:N.showSidebarRuntimeLine,showSelectedRowActions:N.showSelectedRowActions,profiles:Ae,getLabel:lu,formatUptime:uu,onSelect:Ye,onPreview:qe,onMarkActivitySeen:F.markPortSeen,onInstanceLabelSave:ke.saveInstanceLabel,onLifecycle:(e,t)=>void bt(e,t)}),St=(0,L.jsx)(_u,{instance:Ne,previewEnabled:he,onPreviewEnabledChange:ge,onPreviewRefresh:()=>j(e=>e+1),onOpenHelpTopic:we}),Ct=Tu(N,Te.theme),wt=wu(Oe.titleSupportByPort);return(0,L.jsx)(hu,{view:N,palette:Ee,theme:Te,query:o,loading:n,showHidden:f,instances:P,selectedInstance:Ne,data:e,summary:We,scheduleGroup:pe,boardView:de,notesModel:mt,notesSelectedNote:ht,notesDirtyPath:ae,notesHighlightedPath:nt,notesSidebarMode:D,notesSearchFocusToken:ce,settingsSection:ue,dashboardSettingsUi:Ct,titleSupport:wt,activityEvents:Ie,busyPorts:Oe.busyPorts,titlesByPort:Oe.titlesByPort,lifecycleMessage:x,error:i,registryMessage:M.error||ke.error||De.error,workbenchHeader:St,detailContent:t=>(0,L.jsx)(Wt,{instance:Ne,data:e,activeTab:t,onSettingsDirtyChange:ie,onSettingsSaved:()=>{Ne&&Be(Ne.port),ba({topics:[`instances`],reason:`instance:settings-saved`,source:`ui`,sourceId:`app`})},onRegistryPatch:(e,t)=>{M.save({instances:{[String(e)]:t}}).then(()=>{ze(),ba({topics:[`instances`],reason:`instance:registry-patched`,source:`ui`,sourceId:`app`})})}}),instanceListContent:xt,drawerProfileFilters:(e=>e.length>0?(0,L.jsx)(`div`,{className:`profile-chip-strip drawer-chip-strip`,"aria-label":`Profile filters`,children:e.map(e=>(0,L.jsx)(rn,{profile:e,active:T.includes(e.profileId),count:Ue[e.profileId]||0,onToggle:Ge},e.profileId))}):null)(Ae),jawCeoWorkbenchButton:Pe.workbenchButton,jawCeoVoiceOverlay:Pe.voiceOverlay,jawCeoConsoleContent:Pe.consoleContent,previewEnabled:he,previewRefreshKey:_e,autoUnloadNotice:ve,helpOpen:be,helpTopic:Se,setQuery:s,setShowHidden:p,setPreviewEnabled:ge,setAutoUnloadNotice:ye,setHelpOpen:xe,setHelpTopic:Ce,onOpenHelpTopic:we,setNotesSidebarMode:O,setBoardView:fe,setScheduleGroup:me,setDashboardSettingsSection:k,load:ze,cycleTheme:Le,openSelectedInBrowser:Re,handleSelectInstance:Ye,handleSidebarModeChange:et,handleSidebarToggle:Ze,handleNotesSelectedPathChange:tt,openNotesFromPreview:ot,handleNotesViewModeChange:ct,handleNotesAuthoringModeChange:lt,handleNotesWordWrapChange:ut,handleNotesVimModeChange:dt,handleNotesTreeWidthChange:ft,handleNotesGraphSettingsChange:pt,openNotesSidebarSearch:st,setNotesDirtyPath:oe,handleTabChange:Xe,handleActivityToggle:Qe,handleActivityHeight:$e,onDismissLifecycleMessage:()=>S(null),handleDashboardSettingsPatch:gt,activityUnreadOpenAndMarkSeen:F.openAndMarkSeen,panelInitialState:g,onPanelStateChange:He})}var Lf=document.getElementById(`manager-root`);if(!Lf)throw Error(`manager-root not found`);(0,vt.createRoot)(Lf).render((0,L.jsx)(If,{}));