@tt-a1i/hive 2.0.2 → 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 (147) hide show
  1. package/CHANGELOG.md +33 -0
  2. package/README.en.md +15 -6
  3. package/README.md +26 -4
  4. package/dist/src/cli/hive.d.ts +4 -0
  5. package/dist/src/cli/hive.js +25 -3
  6. package/dist/src/cli/team.d.ts +8 -1
  7. package/dist/src/cli/team.js +111 -11
  8. package/dist/src/server/action-center-summary.d.ts +193 -0
  9. package/dist/src/server/action-center-summary.js +188 -0
  10. package/dist/src/server/agent-command-resolver.d.ts +6 -0
  11. package/dist/src/server/agent-command-resolver.js +16 -0
  12. package/dist/src/server/agent-manager.js +11 -1
  13. package/dist/src/server/agent-run-starter.js +47 -6
  14. package/dist/src/server/agent-runtime-types.d.ts +4 -0
  15. package/dist/src/server/agent-startup-instructions.d.ts +4 -0
  16. package/dist/src/server/agent-startup-instructions.js +35 -9
  17. package/dist/src/server/agent-stdin-dispatcher.js +17 -9
  18. package/dist/src/server/diagnostics-support-bundle.d.ts +288 -0
  19. package/dist/src/server/diagnostics-support-bundle.js +179 -0
  20. package/dist/src/server/dispatch-ledger-store.d.ts +4 -1
  21. package/dist/src/server/dispatch-ledger-store.js +46 -6
  22. package/dist/src/server/hive-envelope-escape.d.ts +2 -0
  23. package/dist/src/server/hive-envelope-escape.js +2 -0
  24. package/dist/src/server/hive-team-guidance.d.ts +1 -1
  25. package/dist/src/server/hive-team-guidance.js +67 -25
  26. package/dist/src/server/message-log-store.d.ts +1 -1
  27. package/dist/src/server/post-start-input-writer.js +8 -2
  28. package/dist/src/server/preset-launch-support.d.ts +2 -0
  29. package/dist/src/server/preset-launch-support.js +65 -2
  30. package/dist/src/server/protocol-event-stats.d.ts +39 -0
  31. package/dist/src/server/protocol-event-stats.js +84 -0
  32. package/dist/src/server/recovery-summary.js +19 -14
  33. package/dist/src/server/role-template-store.d.ts +1 -1
  34. package/dist/src/server/role-templates.d.ts +1 -0
  35. package/dist/src/server/role-templates.js +43 -29
  36. package/dist/src/server/routes-action-center.d.ts +2 -0
  37. package/dist/src/server/routes-action-center.js +37 -0
  38. package/dist/src/server/routes-diagnostics.d.ts +2 -0
  39. package/dist/src/server/routes-diagnostics.js +17 -0
  40. package/dist/src/server/routes-scenarios.d.ts +25 -0
  41. package/dist/src/server/routes-scenarios.js +89 -0
  42. package/dist/src/server/routes-settings.js +2 -11
  43. package/dist/src/server/routes-team-memory.js +52 -0
  44. package/dist/src/server/routes-team.js +40 -20
  45. package/dist/src/server/routes-workspace-memory-dreams.js +8 -0
  46. package/dist/src/server/routes-workspace-uploads.d.ts +2 -0
  47. package/dist/src/server/routes-workspace-uploads.js +154 -0
  48. package/dist/src/server/routes-workspaces.js +29 -3
  49. package/dist/src/server/routes.js +8 -0
  50. package/dist/src/server/runtime-message-builders.d.ts +0 -1
  51. package/dist/src/server/runtime-message-builders.js +0 -8
  52. package/dist/src/server/runtime-store-contract.d.ts +15 -0
  53. package/dist/src/server/runtime-store-dream.d.ts +14 -1
  54. package/dist/src/server/runtime-store-dream.js +49 -1
  55. package/dist/src/server/runtime-store-helpers.d.ts +7 -0
  56. package/dist/src/server/runtime-store-helpers.js +85 -22
  57. package/dist/src/server/runtime-store-worker-mutations.d.ts +11 -0
  58. package/dist/src/server/runtime-store-worker-mutations.js +46 -0
  59. package/dist/src/server/runtime-store-workflows.js +10 -6
  60. package/dist/src/server/runtime-store.js +34 -42
  61. package/dist/src/server/scenario-presets.d.ts +25 -0
  62. package/dist/src/server/scenario-presets.js +35 -0
  63. package/dist/src/server/sentinel-heartbeat.d.ts +30 -0
  64. package/dist/src/server/sentinel-heartbeat.js +145 -0
  65. package/dist/src/server/spawn-cli-resolver.d.ts +37 -0
  66. package/dist/src/server/spawn-cli-resolver.js +70 -0
  67. package/dist/src/server/spawn-worker-defaults.d.ts +13 -0
  68. package/dist/src/server/spawn-worker-defaults.js +45 -0
  69. package/dist/src/server/sqlite-schema-v32.d.ts +2 -0
  70. package/dist/src/server/sqlite-schema-v32.js +17 -0
  71. package/dist/src/server/sqlite-schema-v33.d.ts +3 -0
  72. package/dist/src/server/sqlite-schema-v33.js +18 -0
  73. package/dist/src/server/sqlite-schema-v34.d.ts +11 -0
  74. package/dist/src/server/sqlite-schema-v34.js +19 -0
  75. package/dist/src/server/sqlite-schema-v35.d.ts +3 -0
  76. package/dist/src/server/sqlite-schema-v35.js +23 -0
  77. package/dist/src/server/sqlite-schema.d.ts +1 -1
  78. package/dist/src/server/sqlite-schema.js +35 -1
  79. package/dist/src/server/system-message.d.ts +5 -2
  80. package/dist/src/server/system-message.js +5 -2
  81. package/dist/src/server/tasks-file-watcher.d.ts +8 -0
  82. package/dist/src/server/tasks-file-watcher.js +31 -2
  83. package/dist/src/server/team-authz.d.ts +9 -1
  84. package/dist/src/server/team-authz.js +24 -0
  85. package/dist/src/server/team-list-serializer.d.ts +2 -2
  86. package/dist/src/server/team-list-serializer.js +2 -1
  87. package/dist/src/server/team-memory-digest.js +4 -4
  88. package/dist/src/server/team-memory-dream-applier.js +24 -3
  89. package/dist/src/server/team-memory-dream-prompt.d.ts +13 -0
  90. package/dist/src/server/team-memory-dream-prompt.js +91 -0
  91. package/dist/src/server/team-memory-dream-run-store.d.ts +2 -0
  92. package/dist/src/server/team-memory-dream-run-store.js +14 -4
  93. package/dist/src/server/team-memory-dream-runner.d.ts +2 -21
  94. package/dist/src/server/team-memory-dream-runner.js +3 -148
  95. package/dist/src/server/team-memory-dream-store.d.ts +1 -1
  96. package/dist/src/server/team-memory-dream-store.js +1 -1
  97. package/dist/src/server/team-operations.d.ts +18 -2
  98. package/dist/src/server/team-operations.js +222 -33
  99. package/dist/src/server/team-recap.d.ts +10 -0
  100. package/dist/src/server/team-recap.js +73 -0
  101. package/dist/src/server/terminal-input-profile.js +88 -9
  102. package/dist/src/server/upload-limits.d.ts +2 -0
  103. package/dist/src/server/upload-limits.js +2 -0
  104. package/dist/src/server/workflow-cli-policy.d.ts +7 -2
  105. package/dist/src/server/workflow-cli-policy.js +15 -3
  106. package/dist/src/server/workflow-run-store.d.ts +1 -0
  107. package/dist/src/server/workflow-run-store.js +11 -1
  108. package/dist/src/server/workflow-runner.d.ts +4 -1
  109. package/dist/src/server/workflow-runner.js +418 -118
  110. package/dist/src/server/workflow-script-loader.d.ts +3 -2
  111. package/dist/src/server/workflow-script-loader.js +161 -0
  112. package/dist/src/server/workspace-store-contract.d.ts +2 -0
  113. package/dist/src/server/workspace-store.d.ts +1 -1
  114. package/dist/src/server/workspace-store.js +40 -30
  115. package/dist/src/server/workspace-upload-store.d.ts +40 -0
  116. package/dist/src/server/workspace-upload-store.js +295 -0
  117. package/dist/src/shared/scenario-presets.d.ts +32 -0
  118. package/dist/src/shared/scenario-presets.js +69 -0
  119. package/dist/src/shared/types.d.ts +12 -1
  120. package/package.json +1 -1
  121. package/web/dist/assets/AddWorkerDialog-DBLhwb91.js +2 -0
  122. package/web/dist/assets/AddWorkspaceFlow-cxvhVAsT.js +1 -0
  123. package/web/dist/assets/FirstRunWizard-DlEPnWWw.js +1 -0
  124. package/web/dist/assets/{MarketplaceDrawer-Dd8WIA8T.js → MarketplaceDrawer-CfSiRi8e.js} +11 -11
  125. package/web/dist/assets/TaskGraphDrawer-C2JufcPs.js +1 -0
  126. package/web/dist/assets/WhatsNewDialog-vP7buLos.js +1 -0
  127. package/web/dist/assets/WorkerModal-CSorwcdP.js +1 -0
  128. package/web/dist/assets/{WorkflowsDrawer-Bjf4olbR.js → WorkflowsDrawer-BXS3w9Uq.js} +1 -1
  129. package/web/dist/assets/WorkspaceMemoryDrawer-D71ivohr.js +1 -0
  130. package/web/dist/assets/{WorkspaceTaskDrawer-BIWwISvA.js → WorkspaceTaskDrawer-CGCTSHKa.js} +1 -1
  131. package/web/dist/assets/index-BcwN8cCw.js +79 -0
  132. package/web/dist/assets/index-StXTPHls.css +1 -0
  133. package/web/dist/assets/{search-Bk2HQvO7.js → search-BZw4T67h.js} +1 -1
  134. package/web/dist/assets/{square-terminal-D93m9hfY.js → square-terminal-B7E57In1.js} +1 -1
  135. package/web/dist/index.html +2 -2
  136. package/web/dist/sw.js +1 -1
  137. package/dist/src/server/env-sync-message.d.ts +0 -9
  138. package/dist/src/server/env-sync-message.js +0 -29
  139. package/web/dist/assets/AddWorkerDialog-CbV75qUX.js +0 -2
  140. package/web/dist/assets/AddWorkspaceFlow-CwV-7wPx.js +0 -1
  141. package/web/dist/assets/FirstRunWizard-a6PWIK3x.js +0 -1
  142. package/web/dist/assets/TaskGraphDrawer-Bk5WFIk_.js +0 -1
  143. package/web/dist/assets/WhatsNewDialog-C2VZaip0.js +0 -1
  144. package/web/dist/assets/WorkerModal-DucW-9YT.js +0 -1
  145. package/web/dist/assets/WorkspaceMemoryDrawer-DglCy_5f.js +0 -1
  146. package/web/dist/assets/index-BAiLYajK.css +0 -1
  147. package/web/dist/assets/index-BV2k9Dts.js +0 -73
@@ -0,0 +1,79 @@
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/WorkspaceTaskDrawer-CGCTSHKa.js","assets/TaskGraphDrawer-C2JufcPs.js","assets/AddWorkerDialog-DBLhwb91.js","assets/search-BZw4T67h.js","assets/square-terminal-B7E57In1.js","assets/WorkflowsDrawer-BXS3w9Uq.js","assets/WorkspaceMemoryDrawer-D71ivohr.js"])))=>i.map(i=>d[i]);
2
+ function y2(t,r){for(var o=0;o<r.length;o++){const i=r[o];if(typeof i!="string"&&!Array.isArray(i)){for(const l in i)if(l!=="default"&&!(l in t)){const c=Object.getOwnPropertyDescriptor(i,l);c&&Object.defineProperty(t,l,c.get?c:{enumerable:!0,get:()=>i[l]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}(function(){const r=document.createElement("link").relList;if(r&&r.supports&&r.supports("modulepreload"))return;for(const l of document.querySelectorAll('link[rel="modulepreload"]'))i(l);new MutationObserver(l=>{for(const c of l)if(c.type==="childList")for(const f of c.addedNodes)f.tagName==="LINK"&&f.rel==="modulepreload"&&i(f)}).observe(document,{childList:!0,subtree:!0});function o(l){const c={};return l.integrity&&(c.integrity=l.integrity),l.referrerPolicy&&(c.referrerPolicy=l.referrerPolicy),l.crossOrigin==="use-credentials"?c.credentials="include":l.crossOrigin==="anonymous"?c.credentials="omit":c.credentials="same-origin",c}function i(l){if(l.ep)return;l.ep=!0;const c=o(l);fetch(l.href,c)}})();function A0(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var Dd={exports:{}},ys={};var zv;function b2(){if(zv)return ys;zv=1;var t=Symbol.for("react.transitional.element"),r=Symbol.for("react.fragment");function o(i,l,c){var f=null;if(c!==void 0&&(f=""+c),l.key!==void 0&&(f=""+l.key),"key"in l){c={};for(var h in l)h!=="key"&&(c[h]=l[h])}else c=l;return l=c.ref,{$$typeof:t,type:i,key:f,ref:l!==void 0?l:null,props:c}}return ys.Fragment=r,ys.jsx=o,ys.jsxs=o,ys}var Hv;function w2(){return Hv||(Hv=1,Dd.exports=b2()),Dd.exports}var d=w2(),Md={exports:{}},Ae={};var Bv;function x2(){if(Bv)return Ae;Bv=1;var t=Symbol.for("react.transitional.element"),r=Symbol.for("react.portal"),o=Symbol.for("react.fragment"),i=Symbol.for("react.strict_mode"),l=Symbol.for("react.profiler"),c=Symbol.for("react.consumer"),f=Symbol.for("react.context"),h=Symbol.for("react.forward_ref"),g=Symbol.for("react.suspense"),m=Symbol.for("react.memo"),y=Symbol.for("react.lazy"),v=Symbol.for("react.activity"),k=Symbol.iterator;function S(O){return O===null||typeof O!="object"?null:(O=k&&O[k]||O["@@iterator"],typeof O=="function"?O:null)}var C={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},x=Object.assign,E={};function T(O,W,oe){this.props=O,this.context=W,this.refs=E,this.updater=oe||C}T.prototype.isReactComponent={},T.prototype.setState=function(O,W){if(typeof O!="object"&&typeof O!="function"&&O!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,O,W,"setState")},T.prototype.forceUpdate=function(O){this.updater.enqueueForceUpdate(this,O,"forceUpdate")};function _(){}_.prototype=T.prototype;function j(O,W,oe){this.props=O,this.context=W,this.refs=E,this.updater=oe||C}var A=j.prototype=new _;A.constructor=j,x(A,T.prototype),A.isPureReactComponent=!0;var R=Array.isArray;function D(){}var L={H:null,A:null,T:null,S:null},B=Object.prototype.hasOwnProperty;function P(O,W,oe){var ue=oe.ref;return{$$typeof:t,type:O,key:W,ref:ue!==void 0?ue:null,props:oe}}function te(O,W){return P(O.type,W,O.props)}function ee(O){return typeof O=="object"&&O!==null&&O.$$typeof===t}function F(O){var W={"=":"=0",":":"=2"};return"$"+O.replace(/[=:]/g,function(oe){return W[oe]})}var Q=/\/+/g;function Z(O,W){return typeof O=="object"&&O!==null&&O.key!=null?F(""+O.key):W.toString(36)}function $(O){switch(O.status){case"fulfilled":return O.value;case"rejected":throw O.reason;default:switch(typeof O.status=="string"?O.then(D,D):(O.status="pending",O.then(function(W){O.status==="pending"&&(O.status="fulfilled",O.value=W)},function(W){O.status==="pending"&&(O.status="rejected",O.reason=W)})),O.status){case"fulfilled":return O.value;case"rejected":throw O.reason}}throw O}function M(O,W,oe,ue,fe){var pe=typeof O;(pe==="undefined"||pe==="boolean")&&(O=null);var le=!1;if(O===null)le=!0;else switch(pe){case"bigint":case"string":case"number":le=!0;break;case"object":switch(O.$$typeof){case t:case r:le=!0;break;case y:return le=O._init,M(le(O._payload),W,oe,ue,fe)}}if(le)return fe=fe(O),le=ue===""?"."+Z(O,0):ue,R(fe)?(oe="",le!=null&&(oe=le.replace(Q,"$&/")+"/"),M(fe,W,oe,"",function(de){return de})):fe!=null&&(ee(fe)&&(fe=te(fe,oe+(fe.key==null||O&&O.key===fe.key?"":(""+fe.key).replace(Q,"$&/")+"/")+le)),W.push(fe)),1;le=0;var ie=ue===""?".":ue+":";if(R(O))for(var se=0;se<O.length;se++)ue=O[se],pe=ie+Z(ue,se),le+=M(ue,W,oe,pe,fe);else if(se=S(O),typeof se=="function")for(O=se.call(O),se=0;!(ue=O.next()).done;)ue=ue.value,pe=ie+Z(ue,se++),le+=M(ue,W,oe,pe,fe);else if(pe==="object"){if(typeof O.then=="function")return M($(O),W,oe,ue,fe);throw W=String(O),Error("Objects are not valid as a React child (found: "+(W==="[object Object]"?"object with keys {"+Object.keys(O).join(", ")+"}":W)+"). If you meant to render a collection of children, use an array instead.")}return le}function K(O,W,oe){if(O==null)return O;var ue=[],fe=0;return M(O,ue,"","",function(pe){return W.call(oe,pe,fe++)}),ue}function U(O){if(O._status===-1){var W=O._result;W=W(),W.then(function(oe){(O._status===0||O._status===-1)&&(O._status=1,O._result=oe)},function(oe){(O._status===0||O._status===-1)&&(O._status=2,O._result=oe)}),O._status===-1&&(O._status=0,O._result=W)}if(O._status===1)return O._result.default;throw O._result}var I=typeof reportError=="function"?reportError:function(O){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var W=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof O=="object"&&O!==null&&typeof O.message=="string"?String(O.message):String(O),error:O});if(!window.dispatchEvent(W))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",O);return}console.error(O)},X={map:K,forEach:function(O,W,oe){K(O,function(){W.apply(this,arguments)},oe)},count:function(O){var W=0;return K(O,function(){W++}),W},toArray:function(O){return K(O,function(W){return W})||[]},only:function(O){if(!ee(O))throw Error("React.Children.only expected to receive a single React element child.");return O}};return Ae.Activity=v,Ae.Children=X,Ae.Component=T,Ae.Fragment=o,Ae.Profiler=l,Ae.PureComponent=j,Ae.StrictMode=i,Ae.Suspense=g,Ae.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=L,Ae.__COMPILER_RUNTIME={__proto__:null,c:function(O){return L.H.useMemoCache(O)}},Ae.cache=function(O){return function(){return O.apply(null,arguments)}},Ae.cacheSignal=function(){return null},Ae.cloneElement=function(O,W,oe){if(O==null)throw Error("The argument must be a React element, but you passed "+O+".");var ue=x({},O.props),fe=O.key;if(W!=null)for(pe in W.key!==void 0&&(fe=""+W.key),W)!B.call(W,pe)||pe==="key"||pe==="__self"||pe==="__source"||pe==="ref"&&W.ref===void 0||(ue[pe]=W[pe]);var pe=arguments.length-2;if(pe===1)ue.children=oe;else if(1<pe){for(var le=Array(pe),ie=0;ie<pe;ie++)le[ie]=arguments[ie+2];ue.children=le}return P(O.type,fe,ue)},Ae.createContext=function(O){return O={$$typeof:f,_currentValue:O,_currentValue2:O,_threadCount:0,Provider:null,Consumer:null},O.Provider=O,O.Consumer={$$typeof:c,_context:O},O},Ae.createElement=function(O,W,oe){var ue,fe={},pe=null;if(W!=null)for(ue in W.key!==void 0&&(pe=""+W.key),W)B.call(W,ue)&&ue!=="key"&&ue!=="__self"&&ue!=="__source"&&(fe[ue]=W[ue]);var le=arguments.length-2;if(le===1)fe.children=oe;else if(1<le){for(var ie=Array(le),se=0;se<le;se++)ie[se]=arguments[se+2];fe.children=ie}if(O&&O.defaultProps)for(ue in le=O.defaultProps,le)fe[ue]===void 0&&(fe[ue]=le[ue]);return P(O,pe,fe)},Ae.createRef=function(){return{current:null}},Ae.forwardRef=function(O){return{$$typeof:h,render:O}},Ae.isValidElement=ee,Ae.lazy=function(O){return{$$typeof:y,_payload:{_status:-1,_result:O},_init:U}},Ae.memo=function(O,W){return{$$typeof:m,type:O,compare:W===void 0?null:W}},Ae.startTransition=function(O){var W=L.T,oe={};L.T=oe;try{var ue=O(),fe=L.S;fe!==null&&fe(oe,ue),typeof ue=="object"&&ue!==null&&typeof ue.then=="function"&&ue.then(D,I)}catch(pe){I(pe)}finally{W!==null&&oe.types!==null&&(W.types=oe.types),L.T=W}},Ae.unstable_useCacheRefresh=function(){return L.H.useCacheRefresh()},Ae.use=function(O){return L.H.use(O)},Ae.useActionState=function(O,W,oe){return L.H.useActionState(O,W,oe)},Ae.useCallback=function(O,W){return L.H.useCallback(O,W)},Ae.useContext=function(O){return L.H.useContext(O)},Ae.useDebugValue=function(){},Ae.useDeferredValue=function(O,W){return L.H.useDeferredValue(O,W)},Ae.useEffect=function(O,W){return L.H.useEffect(O,W)},Ae.useEffectEvent=function(O){return L.H.useEffectEvent(O)},Ae.useId=function(){return L.H.useId()},Ae.useImperativeHandle=function(O,W,oe){return L.H.useImperativeHandle(O,W,oe)},Ae.useInsertionEffect=function(O,W){return L.H.useInsertionEffect(O,W)},Ae.useLayoutEffect=function(O,W){return L.H.useLayoutEffect(O,W)},Ae.useMemo=function(O,W){return L.H.useMemo(O,W)},Ae.useOptimistic=function(O,W){return L.H.useOptimistic(O,W)},Ae.useReducer=function(O,W,oe){return L.H.useReducer(O,W,oe)},Ae.useRef=function(O){return L.H.useRef(O)},Ae.useState=function(O){return L.H.useState(O)},Ae.useSyncExternalStore=function(O,W,oe){return L.H.useSyncExternalStore(O,W,oe)},Ae.useTransition=function(){return L.H.useTransition()},Ae.version="19.2.5",Ae}var Wv;function am(){return Wv||(Wv=1,Md.exports=x2()),Md.exports}var b=am();const k2=A0(b),_0=y2({__proto__:null,default:k2},[b]);var Ld={exports:{}},bs={},zd={exports:{}},Hd={};var Uv;function S2(){return Uv||(Uv=1,(function(t){function r(M,K){var U=M.length;M.push(K);e:for(;0<U;){var I=U-1>>>1,X=M[I];if(0<l(X,K))M[I]=K,M[U]=X,U=I;else break e}}function o(M){return M.length===0?null:M[0]}function i(M){if(M.length===0)return null;var K=M[0],U=M.pop();if(U!==K){M[0]=U;e:for(var I=0,X=M.length,O=X>>>1;I<O;){var W=2*(I+1)-1,oe=M[W],ue=W+1,fe=M[ue];if(0>l(oe,U))ue<X&&0>l(fe,oe)?(M[I]=fe,M[ue]=U,I=ue):(M[I]=oe,M[W]=U,I=W);else if(ue<X&&0>l(fe,U))M[I]=fe,M[ue]=U,I=ue;else break e}}return K}function l(M,K){var U=M.sortIndex-K.sortIndex;return U!==0?U:M.id-K.id}if(t.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var c=performance;t.unstable_now=function(){return c.now()}}else{var f=Date,h=f.now();t.unstable_now=function(){return f.now()-h}}var g=[],m=[],y=1,v=null,k=3,S=!1,C=!1,x=!1,E=!1,T=typeof setTimeout=="function"?setTimeout:null,_=typeof clearTimeout=="function"?clearTimeout:null,j=typeof setImmediate<"u"?setImmediate:null;function A(M){for(var K=o(m);K!==null;){if(K.callback===null)i(m);else if(K.startTime<=M)i(m),K.sortIndex=K.expirationTime,r(g,K);else break;K=o(m)}}function R(M){if(x=!1,A(M),!C)if(o(g)!==null)C=!0,D||(D=!0,F());else{var K=o(m);K!==null&&$(R,K.startTime-M)}}var D=!1,L=-1,B=5,P=-1;function te(){return E?!0:!(t.unstable_now()-P<B)}function ee(){if(E=!1,D){var M=t.unstable_now();P=M;var K=!0;try{e:{C=!1,x&&(x=!1,_(L),L=-1),S=!0;var U=k;try{t:{for(A(M),v=o(g);v!==null&&!(v.expirationTime>M&&te());){var I=v.callback;if(typeof I=="function"){v.callback=null,k=v.priorityLevel;var X=I(v.expirationTime<=M);if(M=t.unstable_now(),typeof X=="function"){v.callback=X,A(M),K=!0;break t}v===o(g)&&i(g),A(M)}else i(g);v=o(g)}if(v!==null)K=!0;else{var O=o(m);O!==null&&$(R,O.startTime-M),K=!1}}break e}finally{v=null,k=U,S=!1}K=void 0}}finally{K?F():D=!1}}}var F;if(typeof j=="function")F=function(){j(ee)};else if(typeof MessageChannel<"u"){var Q=new MessageChannel,Z=Q.port2;Q.port1.onmessage=ee,F=function(){Z.postMessage(null)}}else F=function(){T(ee,0)};function $(M,K){L=T(function(){M(t.unstable_now())},K)}t.unstable_IdlePriority=5,t.unstable_ImmediatePriority=1,t.unstable_LowPriority=4,t.unstable_NormalPriority=3,t.unstable_Profiling=null,t.unstable_UserBlockingPriority=2,t.unstable_cancelCallback=function(M){M.callback=null},t.unstable_forceFrameRate=function(M){0>M||125<M?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):B=0<M?Math.floor(1e3/M):5},t.unstable_getCurrentPriorityLevel=function(){return k},t.unstable_next=function(M){switch(k){case 1:case 2:case 3:var K=3;break;default:K=k}var U=k;k=K;try{return M()}finally{k=U}},t.unstable_requestPaint=function(){E=!0},t.unstable_runWithPriority=function(M,K){switch(M){case 1:case 2:case 3:case 4:case 5:break;default:M=3}var U=k;k=M;try{return K()}finally{k=U}},t.unstable_scheduleCallback=function(M,K,U){var I=t.unstable_now();switch(typeof U=="object"&&U!==null?(U=U.delay,U=typeof U=="number"&&0<U?I+U:I):U=I,M){case 1:var X=-1;break;case 2:X=250;break;case 5:X=1073741823;break;case 4:X=1e4;break;default:X=5e3}return X=U+X,M={id:y++,callback:K,priorityLevel:M,startTime:U,expirationTime:X,sortIndex:-1},U>I?(M.sortIndex=U,r(m,M),o(g)===null&&M===o(m)&&(x?(_(L),L=-1):x=!0,$(R,U-I))):(M.sortIndex=X,r(g,M),C||S||(C=!0,D||(D=!0,F()))),M},t.unstable_shouldYield=te,t.unstable_wrapCallback=function(M){var K=k;return function(){var U=k;k=K;try{return M.apply(this,arguments)}finally{k=U}}}})(Hd)),Hd}var qv;function E2(){return qv||(qv=1,zd.exports=S2()),zd.exports}var Bd={exports:{}},bt={};var Iv;function C2(){if(Iv)return bt;Iv=1;var t=am();function r(g){var m="https://react.dev/errors/"+g;if(1<arguments.length){m+="?args[]="+encodeURIComponent(arguments[1]);for(var y=2;y<arguments.length;y++)m+="&args[]="+encodeURIComponent(arguments[y])}return"Minified React error #"+g+"; visit "+m+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function o(){}var i={d:{f:o,r:function(){throw Error(r(522))},D:o,C:o,L:o,m:o,X:o,S:o,M:o},p:0,findDOMNode:null},l=Symbol.for("react.portal");function c(g,m,y){var v=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:l,key:v==null?null:""+v,children:g,containerInfo:m,implementation:y}}var f=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function h(g,m){if(g==="font")return"";if(typeof m=="string")return m==="use-credentials"?m:""}return bt.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=i,bt.createPortal=function(g,m){var y=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!m||m.nodeType!==1&&m.nodeType!==9&&m.nodeType!==11)throw Error(r(299));return c(g,m,null,y)},bt.flushSync=function(g){var m=f.T,y=i.p;try{if(f.T=null,i.p=2,g)return g()}finally{f.T=m,i.p=y,i.d.f()}},bt.preconnect=function(g,m){typeof g=="string"&&(m?(m=m.crossOrigin,m=typeof m=="string"?m==="use-credentials"?m:"":void 0):m=null,i.d.C(g,m))},bt.prefetchDNS=function(g){typeof g=="string"&&i.d.D(g)},bt.preinit=function(g,m){if(typeof g=="string"&&m&&typeof m.as=="string"){var y=m.as,v=h(y,m.crossOrigin),k=typeof m.integrity=="string"?m.integrity:void 0,S=typeof m.fetchPriority=="string"?m.fetchPriority:void 0;y==="style"?i.d.S(g,typeof m.precedence=="string"?m.precedence:void 0,{crossOrigin:v,integrity:k,fetchPriority:S}):y==="script"&&i.d.X(g,{crossOrigin:v,integrity:k,fetchPriority:S,nonce:typeof m.nonce=="string"?m.nonce:void 0})}},bt.preinitModule=function(g,m){if(typeof g=="string")if(typeof m=="object"&&m!==null){if(m.as==null||m.as==="script"){var y=h(m.as,m.crossOrigin);i.d.M(g,{crossOrigin:y,integrity:typeof m.integrity=="string"?m.integrity:void 0,nonce:typeof m.nonce=="string"?m.nonce:void 0})}}else m==null&&i.d.M(g)},bt.preload=function(g,m){if(typeof g=="string"&&typeof m=="object"&&m!==null&&typeof m.as=="string"){var y=m.as,v=h(y,m.crossOrigin);i.d.L(g,y,{crossOrigin:v,integrity:typeof m.integrity=="string"?m.integrity:void 0,nonce:typeof m.nonce=="string"?m.nonce:void 0,type:typeof m.type=="string"?m.type:void 0,fetchPriority:typeof m.fetchPriority=="string"?m.fetchPriority:void 0,referrerPolicy:typeof m.referrerPolicy=="string"?m.referrerPolicy:void 0,imageSrcSet:typeof m.imageSrcSet=="string"?m.imageSrcSet:void 0,imageSizes:typeof m.imageSizes=="string"?m.imageSizes:void 0,media:typeof m.media=="string"?m.media:void 0})}},bt.preloadModule=function(g,m){if(typeof g=="string")if(m){var y=h(m.as,m.crossOrigin);i.d.m(g,{as:typeof m.as=="string"&&m.as!=="script"?m.as:void 0,crossOrigin:y,integrity:typeof m.integrity=="string"?m.integrity:void 0})}else i.d.m(g)},bt.requestFormReset=function(g){i.d.r(g)},bt.unstable_batchedUpdates=function(g,m){return g(m)},bt.useFormState=function(g,m,y){return f.H.useFormState(g,m,y)},bt.useFormStatus=function(){return f.H.useHostTransitionStatus()},bt.version="19.2.5",bt}var Pv;function N0(){if(Pv)return Bd.exports;Pv=1;function t(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(t)}catch(r){console.error(r)}}return t(),Bd.exports=C2(),Bd.exports}var Kv;function T2(){if(Kv)return bs;Kv=1;var t=E2(),r=am(),o=N0();function i(e){var n="https://react.dev/errors/"+e;if(1<arguments.length){n+="?args[]="+encodeURIComponent(arguments[1]);for(var a=2;a<arguments.length;a++)n+="&args[]="+encodeURIComponent(arguments[a])}return"Minified React error #"+e+"; visit "+n+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function l(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function c(e){var n=e,a=e;if(e.alternate)for(;n.return;)n=n.return;else{e=n;do n=e,(n.flags&4098)!==0&&(a=n.return),e=n.return;while(e)}return n.tag===3?a:null}function f(e){if(e.tag===13){var n=e.memoizedState;if(n===null&&(e=e.alternate,e!==null&&(n=e.memoizedState)),n!==null)return n.dehydrated}return null}function h(e){if(e.tag===31){var n=e.memoizedState;if(n===null&&(e=e.alternate,e!==null&&(n=e.memoizedState)),n!==null)return n.dehydrated}return null}function g(e){if(c(e)!==e)throw Error(i(188))}function m(e){var n=e.alternate;if(!n){if(n=c(e),n===null)throw Error(i(188));return n!==e?null:e}for(var a=e,s=n;;){var u=a.return;if(u===null)break;var p=u.alternate;if(p===null){if(s=u.return,s!==null){a=s;continue}break}if(u.child===p.child){for(p=u.child;p;){if(p===a)return g(u),e;if(p===s)return g(u),n;p=p.sibling}throw Error(i(188))}if(a.return!==s.return)a=u,s=p;else{for(var w=!1,N=u.child;N;){if(N===a){w=!0,a=u,s=p;break}if(N===s){w=!0,s=u,a=p;break}N=N.sibling}if(!w){for(N=p.child;N;){if(N===a){w=!0,a=p,s=u;break}if(N===s){w=!0,s=p,a=u;break}N=N.sibling}if(!w)throw Error(i(189))}}if(a.alternate!==s)throw Error(i(190))}if(a.tag!==3)throw Error(i(188));return a.stateNode.current===a?e:n}function y(e){var n=e.tag;if(n===5||n===26||n===27||n===6)return e;for(e=e.child;e!==null;){if(n=y(e),n!==null)return n;e=e.sibling}return null}var v=Object.assign,k=Symbol.for("react.element"),S=Symbol.for("react.transitional.element"),C=Symbol.for("react.portal"),x=Symbol.for("react.fragment"),E=Symbol.for("react.strict_mode"),T=Symbol.for("react.profiler"),_=Symbol.for("react.consumer"),j=Symbol.for("react.context"),A=Symbol.for("react.forward_ref"),R=Symbol.for("react.suspense"),D=Symbol.for("react.suspense_list"),L=Symbol.for("react.memo"),B=Symbol.for("react.lazy"),P=Symbol.for("react.activity"),te=Symbol.for("react.memo_cache_sentinel"),ee=Symbol.iterator;function F(e){return e===null||typeof e!="object"?null:(e=ee&&e[ee]||e["@@iterator"],typeof e=="function"?e:null)}var Q=Symbol.for("react.client.reference");function Z(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===Q?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case x:return"Fragment";case T:return"Profiler";case E:return"StrictMode";case R:return"Suspense";case D:return"SuspenseList";case P:return"Activity"}if(typeof e=="object")switch(e.$$typeof){case C:return"Portal";case j:return e.displayName||"Context";case _:return(e._context.displayName||"Context")+".Consumer";case A:var n=e.render;return e=e.displayName,e||(e=n.displayName||n.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case L:return n=e.displayName||null,n!==null?n:Z(e.type)||"Memo";case B:n=e._payload,e=e._init;try{return Z(e(n))}catch{}}return null}var $=Array.isArray,M=r.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,K=o.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,U={pending:!1,data:null,method:null,action:null},I=[],X=-1;function O(e){return{current:e}}function W(e){0>X||(e.current=I[X],I[X]=null,X--)}function oe(e,n){X++,I[X]=e.current,e.current=n}var ue=O(null),fe=O(null),pe=O(null),le=O(null);function ie(e,n){switch(oe(pe,n),oe(fe,e),oe(ue,null),n.nodeType){case 9:case 11:e=(e=n.documentElement)&&(e=e.namespaceURI)?ov(e):0;break;default:if(e=n.tagName,n=n.namespaceURI)n=ov(n),e=sv(n,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}W(ue),oe(ue,e)}function se(){W(ue),W(fe),W(pe)}function de(e){e.memoizedState!==null&&oe(le,e);var n=ue.current,a=sv(n,e.type);n!==a&&(oe(fe,e),oe(ue,a))}function me(e){fe.current===e&&(W(ue),W(fe)),le.current===e&&(W(le),ps._currentValue=U)}var Te,Ce;function ke(e){if(Te===void 0)try{throw Error()}catch(a){var n=a.stack.trim().match(/\n( *(at )?)/);Te=n&&n[1]||"",Ce=-1<a.stack.indexOf(`
3
+ at`)?" (<anonymous>)":-1<a.stack.indexOf("@")?"@unknown:0:0":""}return`
4
+ `+Te+e+Ce}var Ze=!1;function St(e,n){if(!e||Ze)return"";Ze=!0;var a=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var s={DetermineComponentFrameRoot:function(){try{if(n){var ae=function(){throw Error()};if(Object.defineProperty(ae.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(ae,[])}catch(J){var G=J}Reflect.construct(e,[],ae)}else{try{ae.call()}catch(J){G=J}e.call(ae.prototype)}}else{try{throw Error()}catch(J){G=J}(ae=e())&&typeof ae.catch=="function"&&ae.catch(function(){})}}catch(J){if(J&&G&&typeof J.stack=="string")return[J.stack,G.stack]}return[null,null]}};s.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var u=Object.getOwnPropertyDescriptor(s.DetermineComponentFrameRoot,"name");u&&u.configurable&&Object.defineProperty(s.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var p=s.DetermineComponentFrameRoot(),w=p[0],N=p[1];if(w&&N){var z=w.split(`
5
+ `),V=N.split(`
6
+ `);for(u=s=0;s<z.length&&!z[s].includes("DetermineComponentFrameRoot");)s++;for(;u<V.length&&!V[u].includes("DetermineComponentFrameRoot");)u++;if(s===z.length||u===V.length)for(s=z.length-1,u=V.length-1;1<=s&&0<=u&&z[s]!==V[u];)u--;for(;1<=s&&0<=u;s--,u--)if(z[s]!==V[u]){if(s!==1||u!==1)do if(s--,u--,0>u||z[s]!==V[u]){var ne=`
7
+ `+z[s].replace(" at new "," at ");return e.displayName&&ne.includes("<anonymous>")&&(ne=ne.replace("<anonymous>",e.displayName)),ne}while(1<=s&&0<=u);break}}}finally{Ze=!1,Error.prepareStackTrace=a}return(a=e?e.displayName||e.name:"")?ke(a):""}function Jt(e,n){switch(e.tag){case 26:case 27:case 5:return ke(e.type);case 16:return ke("Lazy");case 13:return e.child!==n&&n!==null?ke("Suspense Fallback"):ke("Suspense");case 19:return ke("SuspenseList");case 0:case 15:return St(e.type,!1);case 11:return St(e.type.render,!1);case 1:return St(e.type,!0);case 31:return ke("Activity");default:return""}}function or(e){try{var n="",a=null;do n+=Jt(e,a),a=e,e=e.return;while(e);return n}catch(s){return`
8
+ Error generating stack: `+s.message+`
9
+ `+s.stack}}var fn=Object.prototype.hasOwnProperty,De=t.unstable_scheduleCallback,Qe=t.unstable_cancelCallback,ce=t.unstable_shouldYield,ye=t.unstable_requestPaint,Me=t.unstable_now,ga=t.unstable_getCurrentPriorityLevel,Hm=t.unstable_ImmediatePriority,Bm=t.unstable_UserBlockingPriority,Qs=t.unstable_NormalPriority,Jx=t.unstable_LowPriority,Wm=t.unstable_IdlePriority,e1=t.log,t1=t.unstable_setDisableYieldValue,To=null,Wt=null;function sr(e){if(typeof e1=="function"&&t1(e),Wt&&typeof Wt.setStrictMode=="function")try{Wt.setStrictMode(To,e)}catch{}}var Ut=Math.clz32?Math.clz32:a1,n1=Math.log,r1=Math.LN2;function a1(e){return e>>>=0,e===0?32:31-(n1(e)/r1|0)|0}var Js=256,ei=262144,ti=4194304;function Pr(e){var n=e&42;if(n!==0)return n;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 ni(e,n,a){var s=e.pendingLanes;if(s===0)return 0;var u=0,p=e.suspendedLanes,w=e.pingedLanes;e=e.warmLanes;var N=s&134217727;return N!==0?(s=N&~p,s!==0?u=Pr(s):(w&=N,w!==0?u=Pr(w):a||(a=N&~e,a!==0&&(u=Pr(a))))):(N=s&~p,N!==0?u=Pr(N):w!==0?u=Pr(w):a||(a=s&~e,a!==0&&(u=Pr(a)))),u===0?0:n!==0&&n!==u&&(n&p)===0&&(p=u&-u,a=n&-n,p>=a||p===32&&(a&4194048)!==0)?n:u}function Ao(e,n){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&n)===0}function o1(e,n){switch(e){case 1:case 2:case 4:case 8:case 64:return n+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 n+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 Um(){var e=ti;return ti<<=1,(ti&62914560)===0&&(ti=4194304),e}function xc(e){for(var n=[],a=0;31>a;a++)n.push(e);return n}function _o(e,n){e.pendingLanes|=n,n!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function s1(e,n,a,s,u,p){var w=e.pendingLanes;e.pendingLanes=a,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=a,e.entangledLanes&=a,e.errorRecoveryDisabledLanes&=a,e.shellSuspendCounter=0;var N=e.entanglements,z=e.expirationTimes,V=e.hiddenUpdates;for(a=w&~a;0<a;){var ne=31-Ut(a),ae=1<<ne;N[ne]=0,z[ne]=-1;var G=V[ne];if(G!==null)for(V[ne]=null,ne=0;ne<G.length;ne++){var J=G[ne];J!==null&&(J.lane&=-536870913)}a&=~ae}s!==0&&qm(e,s,0),p!==0&&u===0&&e.tag!==0&&(e.suspendedLanes|=p&~(w&~n))}function qm(e,n,a){e.pendingLanes|=n,e.suspendedLanes&=~n;var s=31-Ut(n);e.entangledLanes|=n,e.entanglements[s]=e.entanglements[s]|1073741824|a&261930}function Im(e,n){var a=e.entangledLanes|=n;for(e=e.entanglements;a;){var s=31-Ut(a),u=1<<s;u&n|e[s]&n&&(e[s]|=n),a&=~u}}function Pm(e,n){var a=n&-n;return a=(a&42)!==0?1:kc(a),(a&(e.suspendedLanes|n))!==0?0:a}function kc(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 Sc(e){return e&=-e,2<e?8<e?(e&134217727)!==0?32:268435456:8:2}function Km(){var e=K.p;return e!==0?e:(e=window.event,e===void 0?32:Nv(e.type))}function Fm(e,n){var a=K.p;try{return K.p=e,n()}finally{K.p=a}}var ir=Math.random().toString(36).slice(2),ft="__reactFiber$"+ir,At="__reactProps$"+ir,va="__reactContainer$"+ir,Ec="__reactEvents$"+ir,i1="__reactListeners$"+ir,l1="__reactHandles$"+ir,Ym="__reactResources$"+ir,No="__reactMarker$"+ir;function Cc(e){delete e[ft],delete e[At],delete e[Ec],delete e[i1],delete e[l1]}function ya(e){var n=e[ft];if(n)return n;for(var a=e.parentNode;a;){if(n=a[va]||a[ft]){if(a=n.alternate,n.child!==null||a!==null&&a.child!==null)for(e=mv(e);e!==null;){if(a=e[ft])return a;e=mv(e)}return n}e=a,a=e.parentNode}return null}function ba(e){if(e=e[ft]||e[va]){var n=e.tag;if(n===5||n===6||n===13||n===31||n===26||n===27||n===3)return e}return null}function jo(e){var n=e.tag;if(n===5||n===26||n===27||n===6)return e.stateNode;throw Error(i(33))}function wa(e){var n=e[Ym];return n||(n=e[Ym]={hoistableStyles:new Map,hoistableScripts:new Map}),n}function ut(e){e[No]=!0}var Vm=new Set,Gm={};function Kr(e,n){xa(e,n),xa(e+"Capture",n)}function xa(e,n){for(Gm[e]=n,e=0;e<n.length;e++)Vm.add(n[e])}var c1=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]*$"),$m={},Xm={};function u1(e){return fn.call(Xm,e)?!0:fn.call($m,e)?!1:c1.test(e)?Xm[e]=!0:($m[e]=!0,!1)}function ri(e,n,a){if(u1(n))if(a===null)e.removeAttribute(n);else{switch(typeof a){case"undefined":case"function":case"symbol":e.removeAttribute(n);return;case"boolean":var s=n.toLowerCase().slice(0,5);if(s!=="data-"&&s!=="aria-"){e.removeAttribute(n);return}}e.setAttribute(n,""+a)}}function ai(e,n,a){if(a===null)e.removeAttribute(n);else{switch(typeof a){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(n);return}e.setAttribute(n,""+a)}}function Ln(e,n,a,s){if(s===null)e.removeAttribute(a);else{switch(typeof s){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(a);return}e.setAttributeNS(n,a,""+s)}}function en(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Zm(e){var n=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(n==="checkbox"||n==="radio")}function d1(e,n,a){var s=Object.getOwnPropertyDescriptor(e.constructor.prototype,n);if(!e.hasOwnProperty(n)&&typeof s<"u"&&typeof s.get=="function"&&typeof s.set=="function"){var u=s.get,p=s.set;return Object.defineProperty(e,n,{configurable:!0,get:function(){return u.call(this)},set:function(w){a=""+w,p.call(this,w)}}),Object.defineProperty(e,n,{enumerable:s.enumerable}),{getValue:function(){return a},setValue:function(w){a=""+w},stopTracking:function(){e._valueTracker=null,delete e[n]}}}}function Tc(e){if(!e._valueTracker){var n=Zm(e)?"checked":"value";e._valueTracker=d1(e,n,""+e[n])}}function Qm(e){if(!e)return!1;var n=e._valueTracker;if(!n)return!0;var a=n.getValue(),s="";return e&&(s=Zm(e)?e.checked?"true":"false":e.value),e=s,e!==a?(n.setValue(e),!0):!1}function oi(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}var f1=/[\n"\\]/g;function tn(e){return e.replace(f1,function(n){return"\\"+n.charCodeAt(0).toString(16)+" "})}function Ac(e,n,a,s,u,p,w,N){e.name="",w!=null&&typeof w!="function"&&typeof w!="symbol"&&typeof w!="boolean"?e.type=w:e.removeAttribute("type"),n!=null?w==="number"?(n===0&&e.value===""||e.value!=n)&&(e.value=""+en(n)):e.value!==""+en(n)&&(e.value=""+en(n)):w!=="submit"&&w!=="reset"||e.removeAttribute("value"),n!=null?_c(e,w,en(n)):a!=null?_c(e,w,en(a)):s!=null&&e.removeAttribute("value"),u==null&&p!=null&&(e.defaultChecked=!!p),u!=null&&(e.checked=u&&typeof u!="function"&&typeof u!="symbol"),N!=null&&typeof N!="function"&&typeof N!="symbol"&&typeof N!="boolean"?e.name=""+en(N):e.removeAttribute("name")}function Jm(e,n,a,s,u,p,w,N){if(p!=null&&typeof p!="function"&&typeof p!="symbol"&&typeof p!="boolean"&&(e.type=p),n!=null||a!=null){if(!(p!=="submit"&&p!=="reset"||n!=null)){Tc(e);return}a=a!=null?""+en(a):"",n=n!=null?""+en(n):a,N||n===e.value||(e.value=n),e.defaultValue=n}s=s??u,s=typeof s!="function"&&typeof s!="symbol"&&!!s,e.checked=N?e.checked:!!s,e.defaultChecked=!!s,w!=null&&typeof w!="function"&&typeof w!="symbol"&&typeof w!="boolean"&&(e.name=w),Tc(e)}function _c(e,n,a){n==="number"&&oi(e.ownerDocument)===e||e.defaultValue===""+a||(e.defaultValue=""+a)}function ka(e,n,a,s){if(e=e.options,n){n={};for(var u=0;u<a.length;u++)n["$"+a[u]]=!0;for(a=0;a<e.length;a++)u=n.hasOwnProperty("$"+e[a].value),e[a].selected!==u&&(e[a].selected=u),u&&s&&(e[a].defaultSelected=!0)}else{for(a=""+en(a),n=null,u=0;u<e.length;u++){if(e[u].value===a){e[u].selected=!0,s&&(e[u].defaultSelected=!0);return}n!==null||e[u].disabled||(n=e[u])}n!==null&&(n.selected=!0)}}function ep(e,n,a){if(n!=null&&(n=""+en(n),n!==e.value&&(e.value=n),a==null)){e.defaultValue!==n&&(e.defaultValue=n);return}e.defaultValue=a!=null?""+en(a):""}function tp(e,n,a,s){if(n==null){if(s!=null){if(a!=null)throw Error(i(92));if($(s)){if(1<s.length)throw Error(i(93));s=s[0]}a=s}a==null&&(a=""),n=a}a=en(n),e.defaultValue=a,s=e.textContent,s===a&&s!==""&&s!==null&&(e.value=s),Tc(e)}function Sa(e,n){if(n){var a=e.firstChild;if(a&&a===e.lastChild&&a.nodeType===3){a.nodeValue=n;return}}e.textContent=n}var m1=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 np(e,n,a){var s=n.indexOf("--")===0;a==null||typeof a=="boolean"||a===""?s?e.setProperty(n,""):n==="float"?e.cssFloat="":e[n]="":s?e.setProperty(n,a):typeof a!="number"||a===0||m1.has(n)?n==="float"?e.cssFloat=a:e[n]=(""+a).trim():e[n]=a+"px"}function rp(e,n,a){if(n!=null&&typeof n!="object")throw Error(i(62));if(e=e.style,a!=null){for(var s in a)!a.hasOwnProperty(s)||n!=null&&n.hasOwnProperty(s)||(s.indexOf("--")===0?e.setProperty(s,""):s==="float"?e.cssFloat="":e[s]="");for(var u in n)s=n[u],n.hasOwnProperty(u)&&a[u]!==s&&np(e,u,s)}else for(var p in n)n.hasOwnProperty(p)&&np(e,p,n[p])}function Nc(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 p1=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"]]),h1=/^[\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 si(e){return h1.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function zn(){}var jc=null;function Rc(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Ea=null,Ca=null;function ap(e){var n=ba(e);if(n&&(e=n.stateNode)){var a=e[At]||null;e:switch(e=n.stateNode,n.type){case"input":if(Ac(e,a.value,a.defaultValue,a.defaultValue,a.checked,a.defaultChecked,a.type,a.name),n=a.name,a.type==="radio"&&n!=null){for(a=e;a.parentNode;)a=a.parentNode;for(a=a.querySelectorAll('input[name="'+tn(""+n)+'"][type="radio"]'),n=0;n<a.length;n++){var s=a[n];if(s!==e&&s.form===e.form){var u=s[At]||null;if(!u)throw Error(i(90));Ac(s,u.value,u.defaultValue,u.defaultValue,u.checked,u.defaultChecked,u.type,u.name)}}for(n=0;n<a.length;n++)s=a[n],s.form===e.form&&Qm(s)}break e;case"textarea":ep(e,a.value,a.defaultValue);break e;case"select":n=a.value,n!=null&&ka(e,!!a.multiple,n,!1)}}}var Oc=!1;function op(e,n,a){if(Oc)return e(n,a);Oc=!0;try{var s=e(n);return s}finally{if(Oc=!1,(Ea!==null||Ca!==null)&&(Vi(),Ea&&(n=Ea,e=Ca,Ca=Ea=null,ap(n),e)))for(n=0;n<e.length;n++)ap(e[n])}}function Ro(e,n){var a=e.stateNode;if(a===null)return null;var s=a[At]||null;if(s===null)return null;a=s[n];e:switch(n){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(s=!s.disabled)||(e=e.type,s=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!s;break e;default:e=!1}if(e)return null;if(a&&typeof a!="function")throw Error(i(231,n,typeof a));return a}var Hn=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Dc=!1;if(Hn)try{var Oo={};Object.defineProperty(Oo,"passive",{get:function(){Dc=!0}}),window.addEventListener("test",Oo,Oo),window.removeEventListener("test",Oo,Oo)}catch{Dc=!1}var lr=null,Mc=null,ii=null;function sp(){if(ii)return ii;var e,n=Mc,a=n.length,s,u="value"in lr?lr.value:lr.textContent,p=u.length;for(e=0;e<a&&n[e]===u[e];e++);var w=a-e;for(s=1;s<=w&&n[a-s]===u[p-s];s++);return ii=u.slice(e,1<s?1-s:void 0)}function li(e){var n=e.keyCode;return"charCode"in e?(e=e.charCode,e===0&&n===13&&(e=13)):e=n,e===10&&(e=13),32<=e||e===13?e:0}function ci(){return!0}function ip(){return!1}function _t(e){function n(a,s,u,p,w){this._reactName=a,this._targetInst=u,this.type=s,this.nativeEvent=p,this.target=w,this.currentTarget=null;for(var N in e)e.hasOwnProperty(N)&&(a=e[N],this[N]=a?a(p):p[N]);return this.isDefaultPrevented=(p.defaultPrevented!=null?p.defaultPrevented:p.returnValue===!1)?ci:ip,this.isPropagationStopped=ip,this}return v(n.prototype,{preventDefault:function(){this.defaultPrevented=!0;var a=this.nativeEvent;a&&(a.preventDefault?a.preventDefault():typeof a.returnValue!="unknown"&&(a.returnValue=!1),this.isDefaultPrevented=ci)},stopPropagation:function(){var a=this.nativeEvent;a&&(a.stopPropagation?a.stopPropagation():typeof a.cancelBubble!="unknown"&&(a.cancelBubble=!0),this.isPropagationStopped=ci)},persist:function(){},isPersistent:ci}),n}var Fr={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},ui=_t(Fr),Do=v({},Fr,{view:0,detail:0}),g1=_t(Do),Lc,zc,Mo,di=v({},Do,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Bc,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!==Mo&&(Mo&&e.type==="mousemove"?(Lc=e.screenX-Mo.screenX,zc=e.screenY-Mo.screenY):zc=Lc=0,Mo=e),Lc)},movementY:function(e){return"movementY"in e?e.movementY:zc}}),lp=_t(di),v1=v({},di,{dataTransfer:0}),y1=_t(v1),b1=v({},Do,{relatedTarget:0}),Hc=_t(b1),w1=v({},Fr,{animationName:0,elapsedTime:0,pseudoElement:0}),x1=_t(w1),k1=v({},Fr,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),S1=_t(k1),E1=v({},Fr,{data:0}),cp=_t(E1),C1={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},T1={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"},A1={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function _1(e){var n=this.nativeEvent;return n.getModifierState?n.getModifierState(e):(e=A1[e])?!!n[e]:!1}function Bc(){return _1}var N1=v({},Do,{key:function(e){if(e.key){var n=C1[e.key]||e.key;if(n!=="Unidentified")return n}return e.type==="keypress"?(e=li(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?T1[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Bc,charCode:function(e){return e.type==="keypress"?li(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?li(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),j1=_t(N1),R1=v({},di,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),up=_t(R1),O1=v({},Do,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Bc}),D1=_t(O1),M1=v({},Fr,{propertyName:0,elapsedTime:0,pseudoElement:0}),L1=_t(M1),z1=v({},di,{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}),H1=_t(z1),B1=v({},Fr,{newState:0,oldState:0}),W1=_t(B1),U1=[9,13,27,32],Wc=Hn&&"CompositionEvent"in window,Lo=null;Hn&&"documentMode"in document&&(Lo=document.documentMode);var q1=Hn&&"TextEvent"in window&&!Lo,dp=Hn&&(!Wc||Lo&&8<Lo&&11>=Lo),fp=" ",mp=!1;function pp(e,n){switch(e){case"keyup":return U1.indexOf(n.keyCode)!==-1;case"keydown":return n.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function hp(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Ta=!1;function I1(e,n){switch(e){case"compositionend":return hp(n);case"keypress":return n.which!==32?null:(mp=!0,fp);case"textInput":return e=n.data,e===fp&&mp?null:e;default:return null}}function P1(e,n){if(Ta)return e==="compositionend"||!Wc&&pp(e,n)?(e=sp(),ii=Mc=lr=null,Ta=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(n.ctrlKey||n.altKey||n.metaKey)||n.ctrlKey&&n.altKey){if(n.char&&1<n.char.length)return n.char;if(n.which)return String.fromCharCode(n.which)}return null;case"compositionend":return dp&&n.locale!=="ko"?null:n.data;default:return null}}var K1={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 gp(e){var n=e&&e.nodeName&&e.nodeName.toLowerCase();return n==="input"?!!K1[e.type]:n==="textarea"}function vp(e,n,a,s){Ea?Ca?Ca.push(s):Ca=[s]:Ea=s,n=el(n,"onChange"),0<n.length&&(a=new ui("onChange","change",null,a,s),e.push({event:a,listeners:n}))}var zo=null,Ho=null;function F1(e){Jg(e,0)}function fi(e){var n=jo(e);if(Qm(n))return e}function yp(e,n){if(e==="change")return n}var bp=!1;if(Hn){var Uc;if(Hn){var qc="oninput"in document;if(!qc){var wp=document.createElement("div");wp.setAttribute("oninput","return;"),qc=typeof wp.oninput=="function"}Uc=qc}else Uc=!1;bp=Uc&&(!document.documentMode||9<document.documentMode)}function xp(){zo&&(zo.detachEvent("onpropertychange",kp),Ho=zo=null)}function kp(e){if(e.propertyName==="value"&&fi(Ho)){var n=[];vp(n,Ho,e,Rc(e)),op(F1,n)}}function Y1(e,n,a){e==="focusin"?(xp(),zo=n,Ho=a,zo.attachEvent("onpropertychange",kp)):e==="focusout"&&xp()}function V1(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return fi(Ho)}function G1(e,n){if(e==="click")return fi(n)}function $1(e,n){if(e==="input"||e==="change")return fi(n)}function X1(e,n){return e===n&&(e!==0||1/e===1/n)||e!==e&&n!==n}var qt=typeof Object.is=="function"?Object.is:X1;function Bo(e,n){if(qt(e,n))return!0;if(typeof e!="object"||e===null||typeof n!="object"||n===null)return!1;var a=Object.keys(e),s=Object.keys(n);if(a.length!==s.length)return!1;for(s=0;s<a.length;s++){var u=a[s];if(!fn.call(n,u)||!qt(e[u],n[u]))return!1}return!0}function Sp(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Ep(e,n){var a=Sp(e);e=0;for(var s;a;){if(a.nodeType===3){if(s=e+a.textContent.length,e<=n&&s>=n)return{node:a,offset:n-e};e=s}e:{for(;a;){if(a.nextSibling){a=a.nextSibling;break e}a=a.parentNode}a=void 0}a=Sp(a)}}function Cp(e,n){return e&&n?e===n?!0:e&&e.nodeType===3?!1:n&&n.nodeType===3?Cp(e,n.parentNode):"contains"in e?e.contains(n):e.compareDocumentPosition?!!(e.compareDocumentPosition(n)&16):!1:!1}function Tp(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var n=oi(e.document);n instanceof e.HTMLIFrameElement;){try{var a=typeof n.contentWindow.location.href=="string"}catch{a=!1}if(a)e=n.contentWindow;else break;n=oi(e.document)}return n}function Ic(e){var n=e&&e.nodeName&&e.nodeName.toLowerCase();return n&&(n==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||n==="textarea"||e.contentEditable==="true")}var Z1=Hn&&"documentMode"in document&&11>=document.documentMode,Aa=null,Pc=null,Wo=null,Kc=!1;function Ap(e,n,a){var s=a.window===a?a.document:a.nodeType===9?a:a.ownerDocument;Kc||Aa==null||Aa!==oi(s)||(s=Aa,"selectionStart"in s&&Ic(s)?s={start:s.selectionStart,end:s.selectionEnd}:(s=(s.ownerDocument&&s.ownerDocument.defaultView||window).getSelection(),s={anchorNode:s.anchorNode,anchorOffset:s.anchorOffset,focusNode:s.focusNode,focusOffset:s.focusOffset}),Wo&&Bo(Wo,s)||(Wo=s,s=el(Pc,"onSelect"),0<s.length&&(n=new ui("onSelect","select",null,n,a),e.push({event:n,listeners:s}),n.target=Aa)))}function Yr(e,n){var a={};return a[e.toLowerCase()]=n.toLowerCase(),a["Webkit"+e]="webkit"+n,a["Moz"+e]="moz"+n,a}var _a={animationend:Yr("Animation","AnimationEnd"),animationiteration:Yr("Animation","AnimationIteration"),animationstart:Yr("Animation","AnimationStart"),transitionrun:Yr("Transition","TransitionRun"),transitionstart:Yr("Transition","TransitionStart"),transitioncancel:Yr("Transition","TransitionCancel"),transitionend:Yr("Transition","TransitionEnd")},Fc={},_p={};Hn&&(_p=document.createElement("div").style,"AnimationEvent"in window||(delete _a.animationend.animation,delete _a.animationiteration.animation,delete _a.animationstart.animation),"TransitionEvent"in window||delete _a.transitionend.transition);function Vr(e){if(Fc[e])return Fc[e];if(!_a[e])return e;var n=_a[e],a;for(a in n)if(n.hasOwnProperty(a)&&a in _p)return Fc[e]=n[a];return e}var Np=Vr("animationend"),jp=Vr("animationiteration"),Rp=Vr("animationstart"),Q1=Vr("transitionrun"),J1=Vr("transitionstart"),ek=Vr("transitioncancel"),Op=Vr("transitionend"),Dp=new Map,Yc="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(" ");Yc.push("scrollEnd");function mn(e,n){Dp.set(e,n),Kr(n,[e])}var mi=typeof reportError=="function"?reportError:function(e){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var n=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof e=="object"&&e!==null&&typeof e.message=="string"?String(e.message):String(e),error:e});if(!window.dispatchEvent(n))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",e);return}console.error(e)},nn=[],Na=0,Vc=0;function pi(){for(var e=Na,n=Vc=Na=0;n<e;){var a=nn[n];nn[n++]=null;var s=nn[n];nn[n++]=null;var u=nn[n];nn[n++]=null;var p=nn[n];if(nn[n++]=null,s!==null&&u!==null){var w=s.pending;w===null?u.next=u:(u.next=w.next,w.next=u),s.pending=u}p!==0&&Mp(a,u,p)}}function hi(e,n,a,s){nn[Na++]=e,nn[Na++]=n,nn[Na++]=a,nn[Na++]=s,Vc|=s,e.lanes|=s,e=e.alternate,e!==null&&(e.lanes|=s)}function Gc(e,n,a,s){return hi(e,n,a,s),gi(e)}function Gr(e,n){return hi(e,null,null,n),gi(e)}function Mp(e,n,a){e.lanes|=a;var s=e.alternate;s!==null&&(s.lanes|=a);for(var u=!1,p=e.return;p!==null;)p.childLanes|=a,s=p.alternate,s!==null&&(s.childLanes|=a),p.tag===22&&(e=p.stateNode,e===null||e._visibility&1||(u=!0)),e=p,p=p.return;return e.tag===3?(p=e.stateNode,u&&n!==null&&(u=31-Ut(a),e=p.hiddenUpdates,s=e[u],s===null?e[u]=[n]:s.push(n),n.lane=a|536870912),p):null}function gi(e){if(50<is)throw is=0,rd=null,Error(i(185));for(var n=e.return;n!==null;)e=n,n=e.return;return e.tag===3?e.stateNode:null}var ja={};function tk(e,n,a,s){this.tag=e,this.key=a,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=n,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=s,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function It(e,n,a,s){return new tk(e,n,a,s)}function $c(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Bn(e,n){var a=e.alternate;return a===null?(a=It(e.tag,n,e.key,e.mode),a.elementType=e.elementType,a.type=e.type,a.stateNode=e.stateNode,a.alternate=e,e.alternate=a):(a.pendingProps=n,a.type=e.type,a.flags=0,a.subtreeFlags=0,a.deletions=null),a.flags=e.flags&65011712,a.childLanes=e.childLanes,a.lanes=e.lanes,a.child=e.child,a.memoizedProps=e.memoizedProps,a.memoizedState=e.memoizedState,a.updateQueue=e.updateQueue,n=e.dependencies,a.dependencies=n===null?null:{lanes:n.lanes,firstContext:n.firstContext},a.sibling=e.sibling,a.index=e.index,a.ref=e.ref,a.refCleanup=e.refCleanup,a}function Lp(e,n){e.flags&=65011714;var a=e.alternate;return a===null?(e.childLanes=0,e.lanes=n,e.child=null,e.subtreeFlags=0,e.memoizedProps=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.stateNode=null):(e.childLanes=a.childLanes,e.lanes=a.lanes,e.child=a.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=a.memoizedProps,e.memoizedState=a.memoizedState,e.updateQueue=a.updateQueue,e.type=a.type,n=a.dependencies,e.dependencies=n===null?null:{lanes:n.lanes,firstContext:n.firstContext}),e}function vi(e,n,a,s,u,p){var w=0;if(s=e,typeof e=="function")$c(e)&&(w=1);else if(typeof e=="string")w=s2(e,a,ue.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(e){case P:return e=It(31,a,n,u),e.elementType=P,e.lanes=p,e;case x:return $r(a.children,u,p,n);case E:w=8,u|=24;break;case T:return e=It(12,a,n,u|2),e.elementType=T,e.lanes=p,e;case R:return e=It(13,a,n,u),e.elementType=R,e.lanes=p,e;case D:return e=It(19,a,n,u),e.elementType=D,e.lanes=p,e;default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case j:w=10;break e;case _:w=9;break e;case A:w=11;break e;case L:w=14;break e;case B:w=16,s=null;break e}w=29,a=Error(i(130,e===null?"null":typeof e,"")),s=null}return n=It(w,a,n,u),n.elementType=e,n.type=s,n.lanes=p,n}function $r(e,n,a,s){return e=It(7,e,s,n),e.lanes=a,e}function Xc(e,n,a){return e=It(6,e,null,n),e.lanes=a,e}function zp(e){var n=It(18,null,null,0);return n.stateNode=e,n}function Zc(e,n,a){return n=It(4,e.children!==null?e.children:[],e.key,n),n.lanes=a,n.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},n}var Hp=new WeakMap;function rn(e,n){if(typeof e=="object"&&e!==null){var a=Hp.get(e);return a!==void 0?a:(n={value:e,source:n,stack:or(n)},Hp.set(e,n),n)}return{value:e,source:n,stack:or(n)}}var Ra=[],Oa=0,yi=null,Uo=0,an=[],on=0,cr=null,Sn=1,En="";function Wn(e,n){Ra[Oa++]=Uo,Ra[Oa++]=yi,yi=e,Uo=n}function Bp(e,n,a){an[on++]=Sn,an[on++]=En,an[on++]=cr,cr=e;var s=Sn;e=En;var u=32-Ut(s)-1;s&=~(1<<u),a+=1;var p=32-Ut(n)+u;if(30<p){var w=u-u%5;p=(s&(1<<w)-1).toString(32),s>>=w,u-=w,Sn=1<<32-Ut(n)+u|a<<u|s,En=p+e}else Sn=1<<p|a<<u|s,En=e}function Qc(e){e.return!==null&&(Wn(e,1),Bp(e,1,0))}function Jc(e){for(;e===yi;)yi=Ra[--Oa],Ra[Oa]=null,Uo=Ra[--Oa],Ra[Oa]=null;for(;e===cr;)cr=an[--on],an[on]=null,En=an[--on],an[on]=null,Sn=an[--on],an[on]=null}function Wp(e,n){an[on++]=Sn,an[on++]=En,an[on++]=cr,Sn=n.id,En=n.overflow,cr=e}var mt=null,Ge=null,He=!1,ur=null,sn=!1,eu=Error(i(519));function dr(e){var n=Error(i(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw qo(rn(n,e)),eu}function Up(e){var n=e.stateNode,a=e.type,s=e.memoizedProps;switch(n[ft]=e,n[At]=s,a){case"dialog":Oe("cancel",n),Oe("close",n);break;case"iframe":case"object":case"embed":Oe("load",n);break;case"video":case"audio":for(a=0;a<cs.length;a++)Oe(cs[a],n);break;case"source":Oe("error",n);break;case"img":case"image":case"link":Oe("error",n),Oe("load",n);break;case"details":Oe("toggle",n);break;case"input":Oe("invalid",n),Jm(n,s.value,s.defaultValue,s.checked,s.defaultChecked,s.type,s.name,!0);break;case"select":Oe("invalid",n);break;case"textarea":Oe("invalid",n),tp(n,s.value,s.defaultValue,s.children)}a=s.children,typeof a!="string"&&typeof a!="number"&&typeof a!="bigint"||n.textContent===""+a||s.suppressHydrationWarning===!0||rv(n.textContent,a)?(s.popover!=null&&(Oe("beforetoggle",n),Oe("toggle",n)),s.onScroll!=null&&Oe("scroll",n),s.onScrollEnd!=null&&Oe("scrollend",n),s.onClick!=null&&(n.onclick=zn),n=!0):n=!1,n||dr(e,!0)}function qp(e){for(mt=e.return;mt;)switch(mt.tag){case 5:case 31:case 13:sn=!1;return;case 27:case 3:sn=!0;return;default:mt=mt.return}}function Da(e){if(e!==mt)return!1;if(!He)return qp(e),He=!0,!1;var n=e.tag,a;if((a=n!==3&&n!==27)&&((a=n===5)&&(a=e.type,a=!(a!=="form"&&a!=="button")||yd(e.type,e.memoizedProps)),a=!a),a&&Ge&&dr(e),qp(e),n===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(i(317));Ge=fv(e)}else if(n===31){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(i(317));Ge=fv(e)}else n===27?(n=Ge,Cr(e.type)?(e=Sd,Sd=null,Ge=e):Ge=n):Ge=mt?cn(e.stateNode.nextSibling):null;return!0}function Xr(){Ge=mt=null,He=!1}function tu(){var e=ur;return e!==null&&(Ot===null?Ot=e:Ot.push.apply(Ot,e),ur=null),e}function qo(e){ur===null?ur=[e]:ur.push(e)}var nu=O(null),Zr=null,Un=null;function fr(e,n,a){oe(nu,n._currentValue),n._currentValue=a}function qn(e){e._currentValue=nu.current,W(nu)}function ru(e,n,a){for(;e!==null;){var s=e.alternate;if((e.childLanes&n)!==n?(e.childLanes|=n,s!==null&&(s.childLanes|=n)):s!==null&&(s.childLanes&n)!==n&&(s.childLanes|=n),e===a)break;e=e.return}}function au(e,n,a,s){var u=e.child;for(u!==null&&(u.return=e);u!==null;){var p=u.dependencies;if(p!==null){var w=u.child;p=p.firstContext;e:for(;p!==null;){var N=p;p=u;for(var z=0;z<n.length;z++)if(N.context===n[z]){p.lanes|=a,N=p.alternate,N!==null&&(N.lanes|=a),ru(p.return,a,e),s||(w=null);break e}p=N.next}}else if(u.tag===18){if(w=u.return,w===null)throw Error(i(341));w.lanes|=a,p=w.alternate,p!==null&&(p.lanes|=a),ru(w,a,e),w=null}else w=u.child;if(w!==null)w.return=u;else for(w=u;w!==null;){if(w===e){w=null;break}if(u=w.sibling,u!==null){u.return=w.return,w=u;break}w=w.return}u=w}}function Ma(e,n,a,s){e=null;for(var u=n,p=!1;u!==null;){if(!p){if((u.flags&524288)!==0)p=!0;else if((u.flags&262144)!==0)break}if(u.tag===10){var w=u.alternate;if(w===null)throw Error(i(387));if(w=w.memoizedProps,w!==null){var N=u.type;qt(u.pendingProps.value,w.value)||(e!==null?e.push(N):e=[N])}}else if(u===le.current){if(w=u.alternate,w===null)throw Error(i(387));w.memoizedState.memoizedState!==u.memoizedState.memoizedState&&(e!==null?e.push(ps):e=[ps])}u=u.return}e!==null&&au(n,e,a,s),n.flags|=262144}function bi(e){for(e=e.firstContext;e!==null;){if(!qt(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function Qr(e){Zr=e,Un=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function pt(e){return Ip(Zr,e)}function wi(e,n){return Zr===null&&Qr(e),Ip(e,n)}function Ip(e,n){var a=n._currentValue;if(n={context:n,memoizedValue:a,next:null},Un===null){if(e===null)throw Error(i(308));Un=n,e.dependencies={lanes:0,firstContext:n},e.flags|=524288}else Un=Un.next=n;return a}var nk=typeof AbortController<"u"?AbortController:function(){var e=[],n=this.signal={aborted:!1,addEventListener:function(a,s){e.push(s)}};this.abort=function(){n.aborted=!0,e.forEach(function(a){return a()})}},rk=t.unstable_scheduleCallback,ak=t.unstable_NormalPriority,at={$$typeof:j,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function ou(){return{controller:new nk,data:new Map,refCount:0}}function Io(e){e.refCount--,e.refCount===0&&rk(ak,function(){e.controller.abort()})}var Po=null,su=0,La=0,za=null;function ok(e,n){if(Po===null){var a=Po=[];su=0,La=cd(),za={status:"pending",value:void 0,then:function(s){a.push(s)}}}return su++,n.then(Pp,Pp),n}function Pp(){if(--su===0&&Po!==null){za!==null&&(za.status="fulfilled");var e=Po;Po=null,La=0,za=null;for(var n=0;n<e.length;n++)(0,e[n])()}}function sk(e,n){var a=[],s={status:"pending",value:null,reason:null,then:function(u){a.push(u)}};return e.then(function(){s.status="fulfilled",s.value=n;for(var u=0;u<a.length;u++)(0,a[u])(n)},function(u){for(s.status="rejected",s.reason=u,u=0;u<a.length;u++)(0,a[u])(void 0)}),s}var Kp=M.S;M.S=function(e,n){Ag=Me(),typeof n=="object"&&n!==null&&typeof n.then=="function"&&ok(e,n),Kp!==null&&Kp(e,n)};var Jr=O(null);function iu(){var e=Jr.current;return e!==null?e:Ye.pooledCache}function xi(e,n){n===null?oe(Jr,Jr.current):oe(Jr,n.pool)}function Fp(){var e=iu();return e===null?null:{parent:at._currentValue,pool:e}}var Ha=Error(i(460)),lu=Error(i(474)),ki=Error(i(542)),Si={then:function(){}};function Yp(e){return e=e.status,e==="fulfilled"||e==="rejected"}function Vp(e,n,a){switch(a=e[a],a===void 0?e.push(n):a!==n&&(n.then(zn,zn),n=a),n.status){case"fulfilled":return n.value;case"rejected":throw e=n.reason,$p(e),e;default:if(typeof n.status=="string")n.then(zn,zn);else{if(e=Ye,e!==null&&100<e.shellSuspendCounter)throw Error(i(482));e=n,e.status="pending",e.then(function(s){if(n.status==="pending"){var u=n;u.status="fulfilled",u.value=s}},function(s){if(n.status==="pending"){var u=n;u.status="rejected",u.reason=s}})}switch(n.status){case"fulfilled":return n.value;case"rejected":throw e=n.reason,$p(e),e}throw ta=n,Ha}}function ea(e){try{var n=e._init;return n(e._payload)}catch(a){throw a!==null&&typeof a=="object"&&typeof a.then=="function"?(ta=a,Ha):a}}var ta=null;function Gp(){if(ta===null)throw Error(i(459));var e=ta;return ta=null,e}function $p(e){if(e===Ha||e===ki)throw Error(i(483))}var Ba=null,Ko=0;function Ei(e){var n=Ko;return Ko+=1,Ba===null&&(Ba=[]),Vp(Ba,e,n)}function Fo(e,n){n=n.props.ref,e.ref=n!==void 0?n:null}function Ci(e,n){throw n.$$typeof===k?Error(i(525)):(e=Object.prototype.toString.call(n),Error(i(31,e==="[object Object]"?"object with keys {"+Object.keys(n).join(", ")+"}":e)))}function Xp(e){function n(q,H){if(e){var Y=q.deletions;Y===null?(q.deletions=[H],q.flags|=16):Y.push(H)}}function a(q,H){if(!e)return null;for(;H!==null;)n(q,H),H=H.sibling;return null}function s(q){for(var H=new Map;q!==null;)q.key!==null?H.set(q.key,q):H.set(q.index,q),q=q.sibling;return H}function u(q,H){return q=Bn(q,H),q.index=0,q.sibling=null,q}function p(q,H,Y){return q.index=Y,e?(Y=q.alternate,Y!==null?(Y=Y.index,Y<H?(q.flags|=67108866,H):Y):(q.flags|=67108866,H)):(q.flags|=1048576,H)}function w(q){return e&&q.alternate===null&&(q.flags|=67108866),q}function N(q,H,Y,re){return H===null||H.tag!==6?(H=Xc(Y,q.mode,re),H.return=q,H):(H=u(H,Y),H.return=q,H)}function z(q,H,Y,re){var xe=Y.type;return xe===x?ne(q,H,Y.props.children,re,Y.key):H!==null&&(H.elementType===xe||typeof xe=="object"&&xe!==null&&xe.$$typeof===B&&ea(xe)===H.type)?(H=u(H,Y.props),Fo(H,Y),H.return=q,H):(H=vi(Y.type,Y.key,Y.props,null,q.mode,re),Fo(H,Y),H.return=q,H)}function V(q,H,Y,re){return H===null||H.tag!==4||H.stateNode.containerInfo!==Y.containerInfo||H.stateNode.implementation!==Y.implementation?(H=Zc(Y,q.mode,re),H.return=q,H):(H=u(H,Y.children||[]),H.return=q,H)}function ne(q,H,Y,re,xe){return H===null||H.tag!==7?(H=$r(Y,q.mode,re,xe),H.return=q,H):(H=u(H,Y),H.return=q,H)}function ae(q,H,Y){if(typeof H=="string"&&H!==""||typeof H=="number"||typeof H=="bigint")return H=Xc(""+H,q.mode,Y),H.return=q,H;if(typeof H=="object"&&H!==null){switch(H.$$typeof){case S:return Y=vi(H.type,H.key,H.props,null,q.mode,Y),Fo(Y,H),Y.return=q,Y;case C:return H=Zc(H,q.mode,Y),H.return=q,H;case B:return H=ea(H),ae(q,H,Y)}if($(H)||F(H))return H=$r(H,q.mode,Y,null),H.return=q,H;if(typeof H.then=="function")return ae(q,Ei(H),Y);if(H.$$typeof===j)return ae(q,wi(q,H),Y);Ci(q,H)}return null}function G(q,H,Y,re){var xe=H!==null?H.key:null;if(typeof Y=="string"&&Y!==""||typeof Y=="number"||typeof Y=="bigint")return xe!==null?null:N(q,H,""+Y,re);if(typeof Y=="object"&&Y!==null){switch(Y.$$typeof){case S:return Y.key===xe?z(q,H,Y,re):null;case C:return Y.key===xe?V(q,H,Y,re):null;case B:return Y=ea(Y),G(q,H,Y,re)}if($(Y)||F(Y))return xe!==null?null:ne(q,H,Y,re,null);if(typeof Y.then=="function")return G(q,H,Ei(Y),re);if(Y.$$typeof===j)return G(q,H,wi(q,Y),re);Ci(q,Y)}return null}function J(q,H,Y,re,xe){if(typeof re=="string"&&re!==""||typeof re=="number"||typeof re=="bigint")return q=q.get(Y)||null,N(H,q,""+re,xe);if(typeof re=="object"&&re!==null){switch(re.$$typeof){case S:return q=q.get(re.key===null?Y:re.key)||null,z(H,q,re,xe);case C:return q=q.get(re.key===null?Y:re.key)||null,V(H,q,re,xe);case B:return re=ea(re),J(q,H,Y,re,xe)}if($(re)||F(re))return q=q.get(Y)||null,ne(H,q,re,xe,null);if(typeof re.then=="function")return J(q,H,Y,Ei(re),xe);if(re.$$typeof===j)return J(q,H,Y,wi(H,re),xe);Ci(H,re)}return null}function he(q,H,Y,re){for(var xe=null,Be=null,be=H,je=H=0,ze=null;be!==null&&je<Y.length;je++){be.index>je?(ze=be,be=null):ze=be.sibling;var We=G(q,be,Y[je],re);if(We===null){be===null&&(be=ze);break}e&&be&&We.alternate===null&&n(q,be),H=p(We,H,je),Be===null?xe=We:Be.sibling=We,Be=We,be=ze}if(je===Y.length)return a(q,be),He&&Wn(q,je),xe;if(be===null){for(;je<Y.length;je++)be=ae(q,Y[je],re),be!==null&&(H=p(be,H,je),Be===null?xe=be:Be.sibling=be,Be=be);return He&&Wn(q,je),xe}for(be=s(be);je<Y.length;je++)ze=J(be,q,je,Y[je],re),ze!==null&&(e&&ze.alternate!==null&&be.delete(ze.key===null?je:ze.key),H=p(ze,H,je),Be===null?xe=ze:Be.sibling=ze,Be=ze);return e&&be.forEach(function(jr){return n(q,jr)}),He&&Wn(q,je),xe}function Se(q,H,Y,re){if(Y==null)throw Error(i(151));for(var xe=null,Be=null,be=H,je=H=0,ze=null,We=Y.next();be!==null&&!We.done;je++,We=Y.next()){be.index>je?(ze=be,be=null):ze=be.sibling;var jr=G(q,be,We.value,re);if(jr===null){be===null&&(be=ze);break}e&&be&&jr.alternate===null&&n(q,be),H=p(jr,H,je),Be===null?xe=jr:Be.sibling=jr,Be=jr,be=ze}if(We.done)return a(q,be),He&&Wn(q,je),xe;if(be===null){for(;!We.done;je++,We=Y.next())We=ae(q,We.value,re),We!==null&&(H=p(We,H,je),Be===null?xe=We:Be.sibling=We,Be=We);return He&&Wn(q,je),xe}for(be=s(be);!We.done;je++,We=Y.next())We=J(be,q,je,We.value,re),We!==null&&(e&&We.alternate!==null&&be.delete(We.key===null?je:We.key),H=p(We,H,je),Be===null?xe=We:Be.sibling=We,Be=We);return e&&be.forEach(function(v2){return n(q,v2)}),He&&Wn(q,je),xe}function Fe(q,H,Y,re){if(typeof Y=="object"&&Y!==null&&Y.type===x&&Y.key===null&&(Y=Y.props.children),typeof Y=="object"&&Y!==null){switch(Y.$$typeof){case S:e:{for(var xe=Y.key;H!==null;){if(H.key===xe){if(xe=Y.type,xe===x){if(H.tag===7){a(q,H.sibling),re=u(H,Y.props.children),re.return=q,q=re;break e}}else if(H.elementType===xe||typeof xe=="object"&&xe!==null&&xe.$$typeof===B&&ea(xe)===H.type){a(q,H.sibling),re=u(H,Y.props),Fo(re,Y),re.return=q,q=re;break e}a(q,H);break}else n(q,H);H=H.sibling}Y.type===x?(re=$r(Y.props.children,q.mode,re,Y.key),re.return=q,q=re):(re=vi(Y.type,Y.key,Y.props,null,q.mode,re),Fo(re,Y),re.return=q,q=re)}return w(q);case C:e:{for(xe=Y.key;H!==null;){if(H.key===xe)if(H.tag===4&&H.stateNode.containerInfo===Y.containerInfo&&H.stateNode.implementation===Y.implementation){a(q,H.sibling),re=u(H,Y.children||[]),re.return=q,q=re;break e}else{a(q,H);break}else n(q,H);H=H.sibling}re=Zc(Y,q.mode,re),re.return=q,q=re}return w(q);case B:return Y=ea(Y),Fe(q,H,Y,re)}if($(Y))return he(q,H,Y,re);if(F(Y)){if(xe=F(Y),typeof xe!="function")throw Error(i(150));return Y=xe.call(Y),Se(q,H,Y,re)}if(typeof Y.then=="function")return Fe(q,H,Ei(Y),re);if(Y.$$typeof===j)return Fe(q,H,wi(q,Y),re);Ci(q,Y)}return typeof Y=="string"&&Y!==""||typeof Y=="number"||typeof Y=="bigint"?(Y=""+Y,H!==null&&H.tag===6?(a(q,H.sibling),re=u(H,Y),re.return=q,q=re):(a(q,H),re=Xc(Y,q.mode,re),re.return=q,q=re),w(q)):a(q,H)}return function(q,H,Y,re){try{Ko=0;var xe=Fe(q,H,Y,re);return Ba=null,xe}catch(be){if(be===Ha||be===ki)throw be;var Be=It(29,be,null,q.mode);return Be.lanes=re,Be.return=q,Be}}}var na=Xp(!0),Zp=Xp(!1),mr=!1;function cu(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function uu(e,n){e=e.updateQueue,n.updateQueue===e&&(n.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function pr(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function hr(e,n,a){var s=e.updateQueue;if(s===null)return null;if(s=s.shared,(Ue&2)!==0){var u=s.pending;return u===null?n.next=n:(n.next=u.next,u.next=n),s.pending=n,n=gi(e),Mp(e,null,a),n}return hi(e,s,n,a),gi(e)}function Yo(e,n,a){if(n=n.updateQueue,n!==null&&(n=n.shared,(a&4194048)!==0)){var s=n.lanes;s&=e.pendingLanes,a|=s,n.lanes=a,Im(e,a)}}function du(e,n){var a=e.updateQueue,s=e.alternate;if(s!==null&&(s=s.updateQueue,a===s)){var u=null,p=null;if(a=a.firstBaseUpdate,a!==null){do{var w={lane:a.lane,tag:a.tag,payload:a.payload,callback:null,next:null};p===null?u=p=w:p=p.next=w,a=a.next}while(a!==null);p===null?u=p=n:p=p.next=n}else u=p=n;a={baseState:s.baseState,firstBaseUpdate:u,lastBaseUpdate:p,shared:s.shared,callbacks:s.callbacks},e.updateQueue=a;return}e=a.lastBaseUpdate,e===null?a.firstBaseUpdate=n:e.next=n,a.lastBaseUpdate=n}var fu=!1;function Vo(){if(fu){var e=za;if(e!==null)throw e}}function Go(e,n,a,s){fu=!1;var u=e.updateQueue;mr=!1;var p=u.firstBaseUpdate,w=u.lastBaseUpdate,N=u.shared.pending;if(N!==null){u.shared.pending=null;var z=N,V=z.next;z.next=null,w===null?p=V:w.next=V,w=z;var ne=e.alternate;ne!==null&&(ne=ne.updateQueue,N=ne.lastBaseUpdate,N!==w&&(N===null?ne.firstBaseUpdate=V:N.next=V,ne.lastBaseUpdate=z))}if(p!==null){var ae=u.baseState;w=0,ne=V=z=null,N=p;do{var G=N.lane&-536870913,J=G!==N.lane;if(J?(Le&G)===G:(s&G)===G){G!==0&&G===La&&(fu=!0),ne!==null&&(ne=ne.next={lane:0,tag:N.tag,payload:N.payload,callback:null,next:null});e:{var he=e,Se=N;G=n;var Fe=a;switch(Se.tag){case 1:if(he=Se.payload,typeof he=="function"){ae=he.call(Fe,ae,G);break e}ae=he;break e;case 3:he.flags=he.flags&-65537|128;case 0:if(he=Se.payload,G=typeof he=="function"?he.call(Fe,ae,G):he,G==null)break e;ae=v({},ae,G);break e;case 2:mr=!0}}G=N.callback,G!==null&&(e.flags|=64,J&&(e.flags|=8192),J=u.callbacks,J===null?u.callbacks=[G]:J.push(G))}else J={lane:G,tag:N.tag,payload:N.payload,callback:N.callback,next:null},ne===null?(V=ne=J,z=ae):ne=ne.next=J,w|=G;if(N=N.next,N===null){if(N=u.shared.pending,N===null)break;J=N,N=J.next,J.next=null,u.lastBaseUpdate=J,u.shared.pending=null}}while(!0);ne===null&&(z=ae),u.baseState=z,u.firstBaseUpdate=V,u.lastBaseUpdate=ne,p===null&&(u.shared.lanes=0),wr|=w,e.lanes=w,e.memoizedState=ae}}function Qp(e,n){if(typeof e!="function")throw Error(i(191,e));e.call(n)}function Jp(e,n){var a=e.callbacks;if(a!==null)for(e.callbacks=null,e=0;e<a.length;e++)Qp(a[e],n)}var Wa=O(null),Ti=O(0);function eh(e,n){e=Xn,oe(Ti,e),oe(Wa,n),Xn=e|n.baseLanes}function mu(){oe(Ti,Xn),oe(Wa,Wa.current)}function pu(){Xn=Ti.current,W(Wa),W(Ti)}var Pt=O(null),ln=null;function gr(e){var n=e.alternate;oe(tt,tt.current&1),oe(Pt,e),ln===null&&(n===null||Wa.current!==null||n.memoizedState!==null)&&(ln=e)}function hu(e){oe(tt,tt.current),oe(Pt,e),ln===null&&(ln=e)}function th(e){e.tag===22?(oe(tt,tt.current),oe(Pt,e),ln===null&&(ln=e)):vr()}function vr(){oe(tt,tt.current),oe(Pt,Pt.current)}function Kt(e){W(Pt),ln===e&&(ln=null),W(tt)}var tt=O(0);function Ai(e){for(var n=e;n!==null;){if(n.tag===13){var a=n.memoizedState;if(a!==null&&(a=a.dehydrated,a===null||xd(a)||kd(a)))return n}else if(n.tag===19&&(n.memoizedProps.revealOrder==="forwards"||n.memoizedProps.revealOrder==="backwards"||n.memoizedProps.revealOrder==="unstable_legacy-backwards"||n.memoizedProps.revealOrder==="together")){if((n.flags&128)!==0)return n}else if(n.child!==null){n.child.return=n,n=n.child;continue}if(n===e)break;for(;n.sibling===null;){if(n.return===null||n.return===e)return null;n=n.return}n.sibling.return=n.return,n=n.sibling}return null}var In=0,_e=null,Pe=null,ot=null,_i=!1,Ua=!1,ra=!1,Ni=0,$o=0,qa=null,ik=0;function Je(){throw Error(i(321))}function gu(e,n){if(n===null)return!1;for(var a=0;a<n.length&&a<e.length;a++)if(!qt(e[a],n[a]))return!1;return!0}function vu(e,n,a,s,u,p){return In=p,_e=n,n.memoizedState=null,n.updateQueue=null,n.lanes=0,M.H=e===null||e.memoizedState===null?Bh:Ou,ra=!1,p=a(s,u),ra=!1,Ua&&(p=rh(n,a,s,u)),nh(e),p}function nh(e){M.H=Qo;var n=Pe!==null&&Pe.next!==null;if(In=0,ot=Pe=_e=null,_i=!1,$o=0,qa=null,n)throw Error(i(300));e===null||st||(e=e.dependencies,e!==null&&bi(e)&&(st=!0))}function rh(e,n,a,s){_e=e;var u=0;do{if(Ua&&(qa=null),$o=0,Ua=!1,25<=u)throw Error(i(301));if(u+=1,ot=Pe=null,e.updateQueue!=null){var p=e.updateQueue;p.lastEffect=null,p.events=null,p.stores=null,p.memoCache!=null&&(p.memoCache.index=0)}M.H=Wh,p=n(a,s)}while(Ua);return p}function lk(){var e=M.H,n=e.useState()[0];return n=typeof n.then=="function"?Xo(n):n,e=e.useState()[0],(Pe!==null?Pe.memoizedState:null)!==e&&(_e.flags|=1024),n}function yu(){var e=Ni!==0;return Ni=0,e}function bu(e,n,a){n.updateQueue=e.updateQueue,n.flags&=-2053,e.lanes&=~a}function wu(e){if(_i){for(e=e.memoizedState;e!==null;){var n=e.queue;n!==null&&(n.pending=null),e=e.next}_i=!1}In=0,ot=Pe=_e=null,Ua=!1,$o=Ni=0,qa=null}function Et(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return ot===null?_e.memoizedState=ot=e:ot=ot.next=e,ot}function nt(){if(Pe===null){var e=_e.alternate;e=e!==null?e.memoizedState:null}else e=Pe.next;var n=ot===null?_e.memoizedState:ot.next;if(n!==null)ot=n,Pe=e;else{if(e===null)throw _e.alternate===null?Error(i(467)):Error(i(310));Pe=e,e={memoizedState:Pe.memoizedState,baseState:Pe.baseState,baseQueue:Pe.baseQueue,queue:Pe.queue,next:null},ot===null?_e.memoizedState=ot=e:ot=ot.next=e}return ot}function ji(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Xo(e){var n=$o;return $o+=1,qa===null&&(qa=[]),e=Vp(qa,e,n),n=_e,(ot===null?n.memoizedState:ot.next)===null&&(n=n.alternate,M.H=n===null||n.memoizedState===null?Bh:Ou),e}function Ri(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return Xo(e);if(e.$$typeof===j)return pt(e)}throw Error(i(438,String(e)))}function xu(e){var n=null,a=_e.updateQueue;if(a!==null&&(n=a.memoCache),n==null){var s=_e.alternate;s!==null&&(s=s.updateQueue,s!==null&&(s=s.memoCache,s!=null&&(n={data:s.data.map(function(u){return u.slice()}),index:0})))}if(n==null&&(n={data:[],index:0}),a===null&&(a=ji(),_e.updateQueue=a),a.memoCache=n,a=n.data[n.index],a===void 0)for(a=n.data[n.index]=Array(e),s=0;s<e;s++)a[s]=te;return n.index++,a}function Pn(e,n){return typeof n=="function"?n(e):n}function Oi(e){var n=nt();return ku(n,Pe,e)}function ku(e,n,a){var s=e.queue;if(s===null)throw Error(i(311));s.lastRenderedReducer=a;var u=e.baseQueue,p=s.pending;if(p!==null){if(u!==null){var w=u.next;u.next=p.next,p.next=w}n.baseQueue=u=p,s.pending=null}if(p=e.baseState,u===null)e.memoizedState=p;else{n=u.next;var N=w=null,z=null,V=n,ne=!1;do{var ae=V.lane&-536870913;if(ae!==V.lane?(Le&ae)===ae:(In&ae)===ae){var G=V.revertLane;if(G===0)z!==null&&(z=z.next={lane:0,revertLane:0,gesture:null,action:V.action,hasEagerState:V.hasEagerState,eagerState:V.eagerState,next:null}),ae===La&&(ne=!0);else if((In&G)===G){V=V.next,G===La&&(ne=!0);continue}else ae={lane:0,revertLane:V.revertLane,gesture:null,action:V.action,hasEagerState:V.hasEagerState,eagerState:V.eagerState,next:null},z===null?(N=z=ae,w=p):z=z.next=ae,_e.lanes|=G,wr|=G;ae=V.action,ra&&a(p,ae),p=V.hasEagerState?V.eagerState:a(p,ae)}else G={lane:ae,revertLane:V.revertLane,gesture:V.gesture,action:V.action,hasEagerState:V.hasEagerState,eagerState:V.eagerState,next:null},z===null?(N=z=G,w=p):z=z.next=G,_e.lanes|=ae,wr|=ae;V=V.next}while(V!==null&&V!==n);if(z===null?w=p:z.next=N,!qt(p,e.memoizedState)&&(st=!0,ne&&(a=za,a!==null)))throw a;e.memoizedState=p,e.baseState=w,e.baseQueue=z,s.lastRenderedState=p}return u===null&&(s.lanes=0),[e.memoizedState,s.dispatch]}function Su(e){var n=nt(),a=n.queue;if(a===null)throw Error(i(311));a.lastRenderedReducer=e;var s=a.dispatch,u=a.pending,p=n.memoizedState;if(u!==null){a.pending=null;var w=u=u.next;do p=e(p,w.action),w=w.next;while(w!==u);qt(p,n.memoizedState)||(st=!0),n.memoizedState=p,n.baseQueue===null&&(n.baseState=p),a.lastRenderedState=p}return[p,s]}function ah(e,n,a){var s=_e,u=nt(),p=He;if(p){if(a===void 0)throw Error(i(407));a=a()}else a=n();var w=!qt((Pe||u).memoizedState,a);if(w&&(u.memoizedState=a,st=!0),u=u.queue,Tu(ih.bind(null,s,u,e),[e]),u.getSnapshot!==n||w||ot!==null&&ot.memoizedState.tag&1){if(s.flags|=2048,Ia(9,{destroy:void 0},sh.bind(null,s,u,a,n),null),Ye===null)throw Error(i(349));p||(In&127)!==0||oh(s,n,a)}return a}function oh(e,n,a){e.flags|=16384,e={getSnapshot:n,value:a},n=_e.updateQueue,n===null?(n=ji(),_e.updateQueue=n,n.stores=[e]):(a=n.stores,a===null?n.stores=[e]:a.push(e))}function sh(e,n,a,s){n.value=a,n.getSnapshot=s,lh(n)&&ch(e)}function ih(e,n,a){return a(function(){lh(n)&&ch(e)})}function lh(e){var n=e.getSnapshot;e=e.value;try{var a=n();return!qt(e,a)}catch{return!0}}function ch(e){var n=Gr(e,2);n!==null&&Dt(n,e,2)}function Eu(e){var n=Et();if(typeof e=="function"){var a=e;if(e=a(),ra){sr(!0);try{a()}finally{sr(!1)}}}return n.memoizedState=n.baseState=e,n.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Pn,lastRenderedState:e},n}function uh(e,n,a,s){return e.baseState=a,ku(e,Pe,typeof s=="function"?s:Pn)}function ck(e,n,a,s,u){if(Li(e))throw Error(i(485));if(e=n.action,e!==null){var p={payload:u,action:e,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(w){p.listeners.push(w)}};M.T!==null?a(!0):p.isTransition=!1,s(p),a=n.pending,a===null?(p.next=n.pending=p,dh(n,p)):(p.next=a.next,n.pending=a.next=p)}}function dh(e,n){var a=n.action,s=n.payload,u=e.state;if(n.isTransition){var p=M.T,w={};M.T=w;try{var N=a(u,s),z=M.S;z!==null&&z(w,N),fh(e,n,N)}catch(V){Cu(e,n,V)}finally{p!==null&&w.types!==null&&(p.types=w.types),M.T=p}}else try{p=a(u,s),fh(e,n,p)}catch(V){Cu(e,n,V)}}function fh(e,n,a){a!==null&&typeof a=="object"&&typeof a.then=="function"?a.then(function(s){mh(e,n,s)},function(s){return Cu(e,n,s)}):mh(e,n,a)}function mh(e,n,a){n.status="fulfilled",n.value=a,ph(n),e.state=a,n=e.pending,n!==null&&(a=n.next,a===n?e.pending=null:(a=a.next,n.next=a,dh(e,a)))}function Cu(e,n,a){var s=e.pending;if(e.pending=null,s!==null){s=s.next;do n.status="rejected",n.reason=a,ph(n),n=n.next;while(n!==s)}e.action=null}function ph(e){e=e.listeners;for(var n=0;n<e.length;n++)(0,e[n])()}function hh(e,n){return n}function gh(e,n){if(He){var a=Ye.formState;if(a!==null){e:{var s=_e;if(He){if(Ge){t:{for(var u=Ge,p=sn;u.nodeType!==8;){if(!p){u=null;break t}if(u=cn(u.nextSibling),u===null){u=null;break t}}p=u.data,u=p==="F!"||p==="F"?u:null}if(u){Ge=cn(u.nextSibling),s=u.data==="F!";break e}}dr(s)}s=!1}s&&(n=a[0])}}return a=Et(),a.memoizedState=a.baseState=n,s={pending:null,lanes:0,dispatch:null,lastRenderedReducer:hh,lastRenderedState:n},a.queue=s,a=Lh.bind(null,_e,s),s.dispatch=a,s=Eu(!1),p=Ru.bind(null,_e,!1,s.queue),s=Et(),u={state:n,dispatch:null,action:e,pending:null},s.queue=u,a=ck.bind(null,_e,u,p,a),u.dispatch=a,s.memoizedState=e,[n,a,!1]}function vh(e){var n=nt();return yh(n,Pe,e)}function yh(e,n,a){if(n=ku(e,n,hh)[0],e=Oi(Pn)[0],typeof n=="object"&&n!==null&&typeof n.then=="function")try{var s=Xo(n)}catch(w){throw w===Ha?ki:w}else s=n;n=nt();var u=n.queue,p=u.dispatch;return a!==n.memoizedState&&(_e.flags|=2048,Ia(9,{destroy:void 0},uk.bind(null,u,a),null)),[s,p,e]}function uk(e,n){e.action=n}function bh(e){var n=nt(),a=Pe;if(a!==null)return yh(n,a,e);nt(),n=n.memoizedState,a=nt();var s=a.queue.dispatch;return a.memoizedState=e,[n,s,!1]}function Ia(e,n,a,s){return e={tag:e,create:a,deps:s,inst:n,next:null},n=_e.updateQueue,n===null&&(n=ji(),_e.updateQueue=n),a=n.lastEffect,a===null?n.lastEffect=e.next=e:(s=a.next,a.next=e,e.next=s,n.lastEffect=e),e}function wh(){return nt().memoizedState}function Di(e,n,a,s){var u=Et();_e.flags|=e,u.memoizedState=Ia(1|n,{destroy:void 0},a,s===void 0?null:s)}function Mi(e,n,a,s){var u=nt();s=s===void 0?null:s;var p=u.memoizedState.inst;Pe!==null&&s!==null&&gu(s,Pe.memoizedState.deps)?u.memoizedState=Ia(n,p,a,s):(_e.flags|=e,u.memoizedState=Ia(1|n,p,a,s))}function xh(e,n){Di(8390656,8,e,n)}function Tu(e,n){Mi(2048,8,e,n)}function dk(e){_e.flags|=4;var n=_e.updateQueue;if(n===null)n=ji(),_e.updateQueue=n,n.events=[e];else{var a=n.events;a===null?n.events=[e]:a.push(e)}}function kh(e){var n=nt().memoizedState;return dk({ref:n,nextImpl:e}),function(){if((Ue&2)!==0)throw Error(i(440));return n.impl.apply(void 0,arguments)}}function Sh(e,n){return Mi(4,2,e,n)}function Eh(e,n){return Mi(4,4,e,n)}function Ch(e,n){if(typeof n=="function"){e=e();var a=n(e);return function(){typeof a=="function"?a():n(null)}}if(n!=null)return e=e(),n.current=e,function(){n.current=null}}function Th(e,n,a){a=a!=null?a.concat([e]):null,Mi(4,4,Ch.bind(null,n,e),a)}function Au(){}function Ah(e,n){var a=nt();n=n===void 0?null:n;var s=a.memoizedState;return n!==null&&gu(n,s[1])?s[0]:(a.memoizedState=[e,n],e)}function _h(e,n){var a=nt();n=n===void 0?null:n;var s=a.memoizedState;if(n!==null&&gu(n,s[1]))return s[0];if(s=e(),ra){sr(!0);try{e()}finally{sr(!1)}}return a.memoizedState=[s,n],s}function _u(e,n,a){return a===void 0||(In&1073741824)!==0&&(Le&261930)===0?e.memoizedState=n:(e.memoizedState=a,e=Ng(),_e.lanes|=e,wr|=e,a)}function Nh(e,n,a,s){return qt(a,n)?a:Wa.current!==null?(e=_u(e,a,s),qt(e,n)||(st=!0),e):(In&42)===0||(In&1073741824)!==0&&(Le&261930)===0?(st=!0,e.memoizedState=a):(e=Ng(),_e.lanes|=e,wr|=e,n)}function jh(e,n,a,s,u){var p=K.p;K.p=p!==0&&8>p?p:8;var w=M.T,N={};M.T=N,Ru(e,!1,n,a);try{var z=u(),V=M.S;if(V!==null&&V(N,z),z!==null&&typeof z=="object"&&typeof z.then=="function"){var ne=sk(z,s);Zo(e,n,ne,Vt(e))}else Zo(e,n,s,Vt(e))}catch(ae){Zo(e,n,{then:function(){},status:"rejected",reason:ae},Vt())}finally{K.p=p,w!==null&&N.types!==null&&(w.types=N.types),M.T=w}}function fk(){}function Nu(e,n,a,s){if(e.tag!==5)throw Error(i(476));var u=Rh(e).queue;jh(e,u,n,U,a===null?fk:function(){return Oh(e),a(s)})}function Rh(e){var n=e.memoizedState;if(n!==null)return n;n={memoizedState:U,baseState:U,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Pn,lastRenderedState:U},next:null};var a={};return n.next={memoizedState:a,baseState:a,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Pn,lastRenderedState:a},next:null},e.memoizedState=n,e=e.alternate,e!==null&&(e.memoizedState=n),n}function Oh(e){var n=Rh(e);n.next===null&&(n=e.alternate.memoizedState),Zo(e,n.next.queue,{},Vt())}function ju(){return pt(ps)}function Dh(){return nt().memoizedState}function Mh(){return nt().memoizedState}function mk(e){for(var n=e.return;n!==null;){switch(n.tag){case 24:case 3:var a=Vt();e=pr(a);var s=hr(n,e,a);s!==null&&(Dt(s,n,a),Yo(s,n,a)),n={cache:ou()},e.payload=n;return}n=n.return}}function pk(e,n,a){var s=Vt();a={lane:s,revertLane:0,gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null},Li(e)?zh(n,a):(a=Gc(e,n,a,s),a!==null&&(Dt(a,e,s),Hh(a,n,s)))}function Lh(e,n,a){var s=Vt();Zo(e,n,a,s)}function Zo(e,n,a,s){var u={lane:s,revertLane:0,gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null};if(Li(e))zh(n,u);else{var p=e.alternate;if(e.lanes===0&&(p===null||p.lanes===0)&&(p=n.lastRenderedReducer,p!==null))try{var w=n.lastRenderedState,N=p(w,a);if(u.hasEagerState=!0,u.eagerState=N,qt(N,w))return hi(e,n,u,0),Ye===null&&pi(),!1}catch{}if(a=Gc(e,n,u,s),a!==null)return Dt(a,e,s),Hh(a,n,s),!0}return!1}function Ru(e,n,a,s){if(s={lane:2,revertLane:cd(),gesture:null,action:s,hasEagerState:!1,eagerState:null,next:null},Li(e)){if(n)throw Error(i(479))}else n=Gc(e,a,s,2),n!==null&&Dt(n,e,2)}function Li(e){var n=e.alternate;return e===_e||n!==null&&n===_e}function zh(e,n){Ua=_i=!0;var a=e.pending;a===null?n.next=n:(n.next=a.next,a.next=n),e.pending=n}function Hh(e,n,a){if((a&4194048)!==0){var s=n.lanes;s&=e.pendingLanes,a|=s,n.lanes=a,Im(e,a)}}var Qo={readContext:pt,use:Ri,useCallback:Je,useContext:Je,useEffect:Je,useImperativeHandle:Je,useLayoutEffect:Je,useInsertionEffect:Je,useMemo:Je,useReducer:Je,useRef:Je,useState:Je,useDebugValue:Je,useDeferredValue:Je,useTransition:Je,useSyncExternalStore:Je,useId:Je,useHostTransitionStatus:Je,useFormState:Je,useActionState:Je,useOptimistic:Je,useMemoCache:Je,useCacheRefresh:Je};Qo.useEffectEvent=Je;var Bh={readContext:pt,use:Ri,useCallback:function(e,n){return Et().memoizedState=[e,n===void 0?null:n],e},useContext:pt,useEffect:xh,useImperativeHandle:function(e,n,a){a=a!=null?a.concat([e]):null,Di(4194308,4,Ch.bind(null,n,e),a)},useLayoutEffect:function(e,n){return Di(4194308,4,e,n)},useInsertionEffect:function(e,n){Di(4,2,e,n)},useMemo:function(e,n){var a=Et();n=n===void 0?null:n;var s=e();if(ra){sr(!0);try{e()}finally{sr(!1)}}return a.memoizedState=[s,n],s},useReducer:function(e,n,a){var s=Et();if(a!==void 0){var u=a(n);if(ra){sr(!0);try{a(n)}finally{sr(!1)}}}else u=n;return s.memoizedState=s.baseState=u,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:u},s.queue=e,e=e.dispatch=pk.bind(null,_e,e),[s.memoizedState,e]},useRef:function(e){var n=Et();return e={current:e},n.memoizedState=e},useState:function(e){e=Eu(e);var n=e.queue,a=Lh.bind(null,_e,n);return n.dispatch=a,[e.memoizedState,a]},useDebugValue:Au,useDeferredValue:function(e,n){var a=Et();return _u(a,e,n)},useTransition:function(){var e=Eu(!1);return e=jh.bind(null,_e,e.queue,!0,!1),Et().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,n,a){var s=_e,u=Et();if(He){if(a===void 0)throw Error(i(407));a=a()}else{if(a=n(),Ye===null)throw Error(i(349));(Le&127)!==0||oh(s,n,a)}u.memoizedState=a;var p={value:a,getSnapshot:n};return u.queue=p,xh(ih.bind(null,s,p,e),[e]),s.flags|=2048,Ia(9,{destroy:void 0},sh.bind(null,s,p,a,n),null),a},useId:function(){var e=Et(),n=Ye.identifierPrefix;if(He){var a=En,s=Sn;a=(s&~(1<<32-Ut(s)-1)).toString(32)+a,n="_"+n+"R_"+a,a=Ni++,0<a&&(n+="H"+a.toString(32)),n+="_"}else a=ik++,n="_"+n+"r_"+a.toString(32)+"_";return e.memoizedState=n},useHostTransitionStatus:ju,useFormState:gh,useActionState:gh,useOptimistic:function(e){var n=Et();n.memoizedState=n.baseState=e;var a={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return n.queue=a,n=Ru.bind(null,_e,!0,a),a.dispatch=n,[e,n]},useMemoCache:xu,useCacheRefresh:function(){return Et().memoizedState=mk.bind(null,_e)},useEffectEvent:function(e){var n=Et(),a={impl:e};return n.memoizedState=a,function(){if((Ue&2)!==0)throw Error(i(440));return a.impl.apply(void 0,arguments)}}},Ou={readContext:pt,use:Ri,useCallback:Ah,useContext:pt,useEffect:Tu,useImperativeHandle:Th,useInsertionEffect:Sh,useLayoutEffect:Eh,useMemo:_h,useReducer:Oi,useRef:wh,useState:function(){return Oi(Pn)},useDebugValue:Au,useDeferredValue:function(e,n){var a=nt();return Nh(a,Pe.memoizedState,e,n)},useTransition:function(){var e=Oi(Pn)[0],n=nt().memoizedState;return[typeof e=="boolean"?e:Xo(e),n]},useSyncExternalStore:ah,useId:Dh,useHostTransitionStatus:ju,useFormState:vh,useActionState:vh,useOptimistic:function(e,n){var a=nt();return uh(a,Pe,e,n)},useMemoCache:xu,useCacheRefresh:Mh};Ou.useEffectEvent=kh;var Wh={readContext:pt,use:Ri,useCallback:Ah,useContext:pt,useEffect:Tu,useImperativeHandle:Th,useInsertionEffect:Sh,useLayoutEffect:Eh,useMemo:_h,useReducer:Su,useRef:wh,useState:function(){return Su(Pn)},useDebugValue:Au,useDeferredValue:function(e,n){var a=nt();return Pe===null?_u(a,e,n):Nh(a,Pe.memoizedState,e,n)},useTransition:function(){var e=Su(Pn)[0],n=nt().memoizedState;return[typeof e=="boolean"?e:Xo(e),n]},useSyncExternalStore:ah,useId:Dh,useHostTransitionStatus:ju,useFormState:bh,useActionState:bh,useOptimistic:function(e,n){var a=nt();return Pe!==null?uh(a,Pe,e,n):(a.baseState=e,[e,a.queue.dispatch])},useMemoCache:xu,useCacheRefresh:Mh};Wh.useEffectEvent=kh;function Du(e,n,a,s){n=e.memoizedState,a=a(s,n),a=a==null?n:v({},n,a),e.memoizedState=a,e.lanes===0&&(e.updateQueue.baseState=a)}var Mu={enqueueSetState:function(e,n,a){e=e._reactInternals;var s=Vt(),u=pr(s);u.payload=n,a!=null&&(u.callback=a),n=hr(e,u,s),n!==null&&(Dt(n,e,s),Yo(n,e,s))},enqueueReplaceState:function(e,n,a){e=e._reactInternals;var s=Vt(),u=pr(s);u.tag=1,u.payload=n,a!=null&&(u.callback=a),n=hr(e,u,s),n!==null&&(Dt(n,e,s),Yo(n,e,s))},enqueueForceUpdate:function(e,n){e=e._reactInternals;var a=Vt(),s=pr(a);s.tag=2,n!=null&&(s.callback=n),n=hr(e,s,a),n!==null&&(Dt(n,e,a),Yo(n,e,a))}};function Uh(e,n,a,s,u,p,w){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(s,p,w):n.prototype&&n.prototype.isPureReactComponent?!Bo(a,s)||!Bo(u,p):!0}function qh(e,n,a,s){e=n.state,typeof n.componentWillReceiveProps=="function"&&n.componentWillReceiveProps(a,s),typeof n.UNSAFE_componentWillReceiveProps=="function"&&n.UNSAFE_componentWillReceiveProps(a,s),n.state!==e&&Mu.enqueueReplaceState(n,n.state,null)}function aa(e,n){var a=n;if("ref"in n){a={};for(var s in n)s!=="ref"&&(a[s]=n[s])}if(e=e.defaultProps){a===n&&(a=v({},a));for(var u in e)a[u]===void 0&&(a[u]=e[u])}return a}function Ih(e){mi(e)}function Ph(e){console.error(e)}function Kh(e){mi(e)}function zi(e,n){try{var a=e.onUncaughtError;a(n.value,{componentStack:n.stack})}catch(s){setTimeout(function(){throw s})}}function Fh(e,n,a){try{var s=e.onCaughtError;s(a.value,{componentStack:a.stack,errorBoundary:n.tag===1?n.stateNode:null})}catch(u){setTimeout(function(){throw u})}}function Lu(e,n,a){return a=pr(a),a.tag=3,a.payload={element:null},a.callback=function(){zi(e,n)},a}function Yh(e){return e=pr(e),e.tag=3,e}function Vh(e,n,a,s){var u=a.type.getDerivedStateFromError;if(typeof u=="function"){var p=s.value;e.payload=function(){return u(p)},e.callback=function(){Fh(n,a,s)}}var w=a.stateNode;w!==null&&typeof w.componentDidCatch=="function"&&(e.callback=function(){Fh(n,a,s),typeof u!="function"&&(xr===null?xr=new Set([this]):xr.add(this));var N=s.stack;this.componentDidCatch(s.value,{componentStack:N!==null?N:""})})}function hk(e,n,a,s,u){if(a.flags|=32768,s!==null&&typeof s=="object"&&typeof s.then=="function"){if(n=a.alternate,n!==null&&Ma(n,a,u,!0),a=Pt.current,a!==null){switch(a.tag){case 31:case 13:return ln===null?Gi():a.alternate===null&&et===0&&(et=3),a.flags&=-257,a.flags|=65536,a.lanes=u,s===Si?a.flags|=16384:(n=a.updateQueue,n===null?a.updateQueue=new Set([s]):n.add(s),sd(e,s,u)),!1;case 22:return a.flags|=65536,s===Si?a.flags|=16384:(n=a.updateQueue,n===null?(n={transitions:null,markerInstances:null,retryQueue:new Set([s])},a.updateQueue=n):(a=n.retryQueue,a===null?n.retryQueue=new Set([s]):a.add(s)),sd(e,s,u)),!1}throw Error(i(435,a.tag))}return sd(e,s,u),Gi(),!1}if(He)return n=Pt.current,n!==null?((n.flags&65536)===0&&(n.flags|=256),n.flags|=65536,n.lanes=u,s!==eu&&(e=Error(i(422),{cause:s}),qo(rn(e,a)))):(s!==eu&&(n=Error(i(423),{cause:s}),qo(rn(n,a))),e=e.current.alternate,e.flags|=65536,u&=-u,e.lanes|=u,s=rn(s,a),u=Lu(e.stateNode,s,u),du(e,u),et!==4&&(et=2)),!1;var p=Error(i(520),{cause:s});if(p=rn(p,a),ss===null?ss=[p]:ss.push(p),et!==4&&(et=2),n===null)return!0;s=rn(s,a),a=n;do{switch(a.tag){case 3:return a.flags|=65536,e=u&-u,a.lanes|=e,e=Lu(a.stateNode,s,e),du(a,e),!1;case 1:if(n=a.type,p=a.stateNode,(a.flags&128)===0&&(typeof n.getDerivedStateFromError=="function"||p!==null&&typeof p.componentDidCatch=="function"&&(xr===null||!xr.has(p))))return a.flags|=65536,u&=-u,a.lanes|=u,u=Yh(u),Vh(u,e,a,s),du(a,u),!1}a=a.return}while(a!==null);return!1}var zu=Error(i(461)),st=!1;function ht(e,n,a,s){n.child=e===null?Zp(n,null,a,s):na(n,e.child,a,s)}function Gh(e,n,a,s,u){a=a.render;var p=n.ref;if("ref"in s){var w={};for(var N in s)N!=="ref"&&(w[N]=s[N])}else w=s;return Qr(n),s=vu(e,n,a,w,p,u),N=yu(),e!==null&&!st?(bu(e,n,u),Kn(e,n,u)):(He&&N&&Qc(n),n.flags|=1,ht(e,n,s,u),n.child)}function $h(e,n,a,s,u){if(e===null){var p=a.type;return typeof p=="function"&&!$c(p)&&p.defaultProps===void 0&&a.compare===null?(n.tag=15,n.type=p,Xh(e,n,p,s,u)):(e=vi(a.type,null,s,n,n.mode,u),e.ref=n.ref,e.return=n,n.child=e)}if(p=e.child,!Ku(e,u)){var w=p.memoizedProps;if(a=a.compare,a=a!==null?a:Bo,a(w,s)&&e.ref===n.ref)return Kn(e,n,u)}return n.flags|=1,e=Bn(p,s),e.ref=n.ref,e.return=n,n.child=e}function Xh(e,n,a,s,u){if(e!==null){var p=e.memoizedProps;if(Bo(p,s)&&e.ref===n.ref)if(st=!1,n.pendingProps=s=p,Ku(e,u))(e.flags&131072)!==0&&(st=!0);else return n.lanes=e.lanes,Kn(e,n,u)}return Hu(e,n,a,s,u)}function Zh(e,n,a,s){var u=s.children,p=e!==null?e.memoizedState:null;if(e===null&&n.stateNode===null&&(n.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),s.mode==="hidden"){if((n.flags&128)!==0){if(p=p!==null?p.baseLanes|a:a,e!==null){for(s=n.child=e.child,u=0;s!==null;)u=u|s.lanes|s.childLanes,s=s.sibling;s=u&~p}else s=0,n.child=null;return Qh(e,n,p,a,s)}if((a&536870912)!==0)n.memoizedState={baseLanes:0,cachePool:null},e!==null&&xi(n,p!==null?p.cachePool:null),p!==null?eh(n,p):mu(),th(n);else return s=n.lanes=536870912,Qh(e,n,p!==null?p.baseLanes|a:a,a,s)}else p!==null?(xi(n,p.cachePool),eh(n,p),vr(),n.memoizedState=null):(e!==null&&xi(n,null),mu(),vr());return ht(e,n,u,a),n.child}function Jo(e,n){return e!==null&&e.tag===22||n.stateNode!==null||(n.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),n.sibling}function Qh(e,n,a,s,u){var p=iu();return p=p===null?null:{parent:at._currentValue,pool:p},n.memoizedState={baseLanes:a,cachePool:p},e!==null&&xi(n,null),mu(),th(n),e!==null&&Ma(e,n,s,!0),n.childLanes=u,null}function Hi(e,n){return n=Wi({mode:n.mode,children:n.children},e.mode),n.ref=e.ref,e.child=n,n.return=e,n}function Jh(e,n,a){return na(n,e.child,null,a),e=Hi(n,n.pendingProps),e.flags|=2,Kt(n),n.memoizedState=null,e}function gk(e,n,a){var s=n.pendingProps,u=(n.flags&128)!==0;if(n.flags&=-129,e===null){if(He){if(s.mode==="hidden")return e=Hi(n,s),n.lanes=536870912,Jo(null,e);if(hu(n),(e=Ge)?(e=dv(e,sn),e=e!==null&&e.data==="&"?e:null,e!==null&&(n.memoizedState={dehydrated:e,treeContext:cr!==null?{id:Sn,overflow:En}:null,retryLane:536870912,hydrationErrors:null},a=zp(e),a.return=n,n.child=a,mt=n,Ge=null)):e=null,e===null)throw dr(n);return n.lanes=536870912,null}return Hi(n,s)}var p=e.memoizedState;if(p!==null){var w=p.dehydrated;if(hu(n),u)if(n.flags&256)n.flags&=-257,n=Jh(e,n,a);else if(n.memoizedState!==null)n.child=e.child,n.flags|=128,n=null;else throw Error(i(558));else if(st||Ma(e,n,a,!1),u=(a&e.childLanes)!==0,st||u){if(s=Ye,s!==null&&(w=Pm(s,a),w!==0&&w!==p.retryLane))throw p.retryLane=w,Gr(e,w),Dt(s,e,w),zu;Gi(),n=Jh(e,n,a)}else e=p.treeContext,Ge=cn(w.nextSibling),mt=n,He=!0,ur=null,sn=!1,e!==null&&Wp(n,e),n=Hi(n,s),n.flags|=4096;return n}return e=Bn(e.child,{mode:s.mode,children:s.children}),e.ref=n.ref,n.child=e,e.return=n,e}function Bi(e,n){var a=n.ref;if(a===null)e!==null&&e.ref!==null&&(n.flags|=4194816);else{if(typeof a!="function"&&typeof a!="object")throw Error(i(284));(e===null||e.ref!==a)&&(n.flags|=4194816)}}function Hu(e,n,a,s,u){return Qr(n),a=vu(e,n,a,s,void 0,u),s=yu(),e!==null&&!st?(bu(e,n,u),Kn(e,n,u)):(He&&s&&Qc(n),n.flags|=1,ht(e,n,a,u),n.child)}function eg(e,n,a,s,u,p){return Qr(n),n.updateQueue=null,a=rh(n,s,a,u),nh(e),s=yu(),e!==null&&!st?(bu(e,n,p),Kn(e,n,p)):(He&&s&&Qc(n),n.flags|=1,ht(e,n,a,p),n.child)}function tg(e,n,a,s,u){if(Qr(n),n.stateNode===null){var p=ja,w=a.contextType;typeof w=="object"&&w!==null&&(p=pt(w)),p=new a(s,p),n.memoizedState=p.state!==null&&p.state!==void 0?p.state:null,p.updater=Mu,n.stateNode=p,p._reactInternals=n,p=n.stateNode,p.props=s,p.state=n.memoizedState,p.refs={},cu(n),w=a.contextType,p.context=typeof w=="object"&&w!==null?pt(w):ja,p.state=n.memoizedState,w=a.getDerivedStateFromProps,typeof w=="function"&&(Du(n,a,w,s),p.state=n.memoizedState),typeof a.getDerivedStateFromProps=="function"||typeof p.getSnapshotBeforeUpdate=="function"||typeof p.UNSAFE_componentWillMount!="function"&&typeof p.componentWillMount!="function"||(w=p.state,typeof p.componentWillMount=="function"&&p.componentWillMount(),typeof p.UNSAFE_componentWillMount=="function"&&p.UNSAFE_componentWillMount(),w!==p.state&&Mu.enqueueReplaceState(p,p.state,null),Go(n,s,p,u),Vo(),p.state=n.memoizedState),typeof p.componentDidMount=="function"&&(n.flags|=4194308),s=!0}else if(e===null){p=n.stateNode;var N=n.memoizedProps,z=aa(a,N);p.props=z;var V=p.context,ne=a.contextType;w=ja,typeof ne=="object"&&ne!==null&&(w=pt(ne));var ae=a.getDerivedStateFromProps;ne=typeof ae=="function"||typeof p.getSnapshotBeforeUpdate=="function",N=n.pendingProps!==N,ne||typeof p.UNSAFE_componentWillReceiveProps!="function"&&typeof p.componentWillReceiveProps!="function"||(N||V!==w)&&qh(n,p,s,w),mr=!1;var G=n.memoizedState;p.state=G,Go(n,s,p,u),Vo(),V=n.memoizedState,N||G!==V||mr?(typeof ae=="function"&&(Du(n,a,ae,s),V=n.memoizedState),(z=mr||Uh(n,a,z,s,G,V,w))?(ne||typeof p.UNSAFE_componentWillMount!="function"&&typeof p.componentWillMount!="function"||(typeof p.componentWillMount=="function"&&p.componentWillMount(),typeof p.UNSAFE_componentWillMount=="function"&&p.UNSAFE_componentWillMount()),typeof p.componentDidMount=="function"&&(n.flags|=4194308)):(typeof p.componentDidMount=="function"&&(n.flags|=4194308),n.memoizedProps=s,n.memoizedState=V),p.props=s,p.state=V,p.context=w,s=z):(typeof p.componentDidMount=="function"&&(n.flags|=4194308),s=!1)}else{p=n.stateNode,uu(e,n),w=n.memoizedProps,ne=aa(a,w),p.props=ne,ae=n.pendingProps,G=p.context,V=a.contextType,z=ja,typeof V=="object"&&V!==null&&(z=pt(V)),N=a.getDerivedStateFromProps,(V=typeof N=="function"||typeof p.getSnapshotBeforeUpdate=="function")||typeof p.UNSAFE_componentWillReceiveProps!="function"&&typeof p.componentWillReceiveProps!="function"||(w!==ae||G!==z)&&qh(n,p,s,z),mr=!1,G=n.memoizedState,p.state=G,Go(n,s,p,u),Vo();var J=n.memoizedState;w!==ae||G!==J||mr||e!==null&&e.dependencies!==null&&bi(e.dependencies)?(typeof N=="function"&&(Du(n,a,N,s),J=n.memoizedState),(ne=mr||Uh(n,a,ne,s,G,J,z)||e!==null&&e.dependencies!==null&&bi(e.dependencies))?(V||typeof p.UNSAFE_componentWillUpdate!="function"&&typeof p.componentWillUpdate!="function"||(typeof p.componentWillUpdate=="function"&&p.componentWillUpdate(s,J,z),typeof p.UNSAFE_componentWillUpdate=="function"&&p.UNSAFE_componentWillUpdate(s,J,z)),typeof p.componentDidUpdate=="function"&&(n.flags|=4),typeof p.getSnapshotBeforeUpdate=="function"&&(n.flags|=1024)):(typeof p.componentDidUpdate!="function"||w===e.memoizedProps&&G===e.memoizedState||(n.flags|=4),typeof p.getSnapshotBeforeUpdate!="function"||w===e.memoizedProps&&G===e.memoizedState||(n.flags|=1024),n.memoizedProps=s,n.memoizedState=J),p.props=s,p.state=J,p.context=z,s=ne):(typeof p.componentDidUpdate!="function"||w===e.memoizedProps&&G===e.memoizedState||(n.flags|=4),typeof p.getSnapshotBeforeUpdate!="function"||w===e.memoizedProps&&G===e.memoizedState||(n.flags|=1024),s=!1)}return p=s,Bi(e,n),s=(n.flags&128)!==0,p||s?(p=n.stateNode,a=s&&typeof a.getDerivedStateFromError!="function"?null:p.render(),n.flags|=1,e!==null&&s?(n.child=na(n,e.child,null,u),n.child=na(n,null,a,u)):ht(e,n,a,u),n.memoizedState=p.state,e=n.child):e=Kn(e,n,u),e}function ng(e,n,a,s){return Xr(),n.flags|=256,ht(e,n,a,s),n.child}var Bu={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Wu(e){return{baseLanes:e,cachePool:Fp()}}function Uu(e,n,a){return e=e!==null?e.childLanes&~a:0,n&&(e|=Yt),e}function rg(e,n,a){var s=n.pendingProps,u=!1,p=(n.flags&128)!==0,w;if((w=p)||(w=e!==null&&e.memoizedState===null?!1:(tt.current&2)!==0),w&&(u=!0,n.flags&=-129),w=(n.flags&32)!==0,n.flags&=-33,e===null){if(He){if(u?gr(n):vr(),(e=Ge)?(e=dv(e,sn),e=e!==null&&e.data!=="&"?e:null,e!==null&&(n.memoizedState={dehydrated:e,treeContext:cr!==null?{id:Sn,overflow:En}:null,retryLane:536870912,hydrationErrors:null},a=zp(e),a.return=n,n.child=a,mt=n,Ge=null)):e=null,e===null)throw dr(n);return kd(e)?n.lanes=32:n.lanes=536870912,null}var N=s.children;return s=s.fallback,u?(vr(),u=n.mode,N=Wi({mode:"hidden",children:N},u),s=$r(s,u,a,null),N.return=n,s.return=n,N.sibling=s,n.child=N,s=n.child,s.memoizedState=Wu(a),s.childLanes=Uu(e,w,a),n.memoizedState=Bu,Jo(null,s)):(gr(n),qu(n,N))}var z=e.memoizedState;if(z!==null&&(N=z.dehydrated,N!==null)){if(p)n.flags&256?(gr(n),n.flags&=-257,n=Iu(e,n,a)):n.memoizedState!==null?(vr(),n.child=e.child,n.flags|=128,n=null):(vr(),N=s.fallback,u=n.mode,s=Wi({mode:"visible",children:s.children},u),N=$r(N,u,a,null),N.flags|=2,s.return=n,N.return=n,s.sibling=N,n.child=s,na(n,e.child,null,a),s=n.child,s.memoizedState=Wu(a),s.childLanes=Uu(e,w,a),n.memoizedState=Bu,n=Jo(null,s));else if(gr(n),kd(N)){if(w=N.nextSibling&&N.nextSibling.dataset,w)var V=w.dgst;w=V,s=Error(i(419)),s.stack="",s.digest=w,qo({value:s,source:null,stack:null}),n=Iu(e,n,a)}else if(st||Ma(e,n,a,!1),w=(a&e.childLanes)!==0,st||w){if(w=Ye,w!==null&&(s=Pm(w,a),s!==0&&s!==z.retryLane))throw z.retryLane=s,Gr(e,s),Dt(w,e,s),zu;xd(N)||Gi(),n=Iu(e,n,a)}else xd(N)?(n.flags|=192,n.child=e.child,n=null):(e=z.treeContext,Ge=cn(N.nextSibling),mt=n,He=!0,ur=null,sn=!1,e!==null&&Wp(n,e),n=qu(n,s.children),n.flags|=4096);return n}return u?(vr(),N=s.fallback,u=n.mode,z=e.child,V=z.sibling,s=Bn(z,{mode:"hidden",children:s.children}),s.subtreeFlags=z.subtreeFlags&65011712,V!==null?N=Bn(V,N):(N=$r(N,u,a,null),N.flags|=2),N.return=n,s.return=n,s.sibling=N,n.child=s,Jo(null,s),s=n.child,N=e.child.memoizedState,N===null?N=Wu(a):(u=N.cachePool,u!==null?(z=at._currentValue,u=u.parent!==z?{parent:z,pool:z}:u):u=Fp(),N={baseLanes:N.baseLanes|a,cachePool:u}),s.memoizedState=N,s.childLanes=Uu(e,w,a),n.memoizedState=Bu,Jo(e.child,s)):(gr(n),a=e.child,e=a.sibling,a=Bn(a,{mode:"visible",children:s.children}),a.return=n,a.sibling=null,e!==null&&(w=n.deletions,w===null?(n.deletions=[e],n.flags|=16):w.push(e)),n.child=a,n.memoizedState=null,a)}function qu(e,n){return n=Wi({mode:"visible",children:n},e.mode),n.return=e,e.child=n}function Wi(e,n){return e=It(22,e,null,n),e.lanes=0,e}function Iu(e,n,a){return na(n,e.child,null,a),e=qu(n,n.pendingProps.children),e.flags|=2,n.memoizedState=null,e}function ag(e,n,a){e.lanes|=n;var s=e.alternate;s!==null&&(s.lanes|=n),ru(e.return,n,a)}function Pu(e,n,a,s,u,p){var w=e.memoizedState;w===null?e.memoizedState={isBackwards:n,rendering:null,renderingStartTime:0,last:s,tail:a,tailMode:u,treeForkCount:p}:(w.isBackwards=n,w.rendering=null,w.renderingStartTime=0,w.last=s,w.tail=a,w.tailMode=u,w.treeForkCount=p)}function og(e,n,a){var s=n.pendingProps,u=s.revealOrder,p=s.tail;s=s.children;var w=tt.current,N=(w&2)!==0;if(N?(w=w&1|2,n.flags|=128):w&=1,oe(tt,w),ht(e,n,s,a),s=He?Uo:0,!N&&e!==null&&(e.flags&128)!==0)e:for(e=n.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&ag(e,a,n);else if(e.tag===19)ag(e,a,n);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===n)break e;for(;e.sibling===null;){if(e.return===null||e.return===n)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}switch(u){case"forwards":for(a=n.child,u=null;a!==null;)e=a.alternate,e!==null&&Ai(e)===null&&(u=a),a=a.sibling;a=u,a===null?(u=n.child,n.child=null):(u=a.sibling,a.sibling=null),Pu(n,!1,u,a,p,s);break;case"backwards":case"unstable_legacy-backwards":for(a=null,u=n.child,n.child=null;u!==null;){if(e=u.alternate,e!==null&&Ai(e)===null){n.child=u;break}e=u.sibling,u.sibling=a,a=u,u=e}Pu(n,!0,a,null,p,s);break;case"together":Pu(n,!1,null,null,void 0,s);break;default:n.memoizedState=null}return n.child}function Kn(e,n,a){if(e!==null&&(n.dependencies=e.dependencies),wr|=n.lanes,(a&n.childLanes)===0)if(e!==null){if(Ma(e,n,a,!1),(a&n.childLanes)===0)return null}else return null;if(e!==null&&n.child!==e.child)throw Error(i(153));if(n.child!==null){for(e=n.child,a=Bn(e,e.pendingProps),n.child=a,a.return=n;e.sibling!==null;)e=e.sibling,a=a.sibling=Bn(e,e.pendingProps),a.return=n;a.sibling=null}return n.child}function Ku(e,n){return(e.lanes&n)!==0?!0:(e=e.dependencies,!!(e!==null&&bi(e)))}function vk(e,n,a){switch(n.tag){case 3:ie(n,n.stateNode.containerInfo),fr(n,at,e.memoizedState.cache),Xr();break;case 27:case 5:de(n);break;case 4:ie(n,n.stateNode.containerInfo);break;case 10:fr(n,n.type,n.memoizedProps.value);break;case 31:if(n.memoizedState!==null)return n.flags|=128,hu(n),null;break;case 13:var s=n.memoizedState;if(s!==null)return s.dehydrated!==null?(gr(n),n.flags|=128,null):(a&n.child.childLanes)!==0?rg(e,n,a):(gr(n),e=Kn(e,n,a),e!==null?e.sibling:null);gr(n);break;case 19:var u=(e.flags&128)!==0;if(s=(a&n.childLanes)!==0,s||(Ma(e,n,a,!1),s=(a&n.childLanes)!==0),u){if(s)return og(e,n,a);n.flags|=128}if(u=n.memoizedState,u!==null&&(u.rendering=null,u.tail=null,u.lastEffect=null),oe(tt,tt.current),s)break;return null;case 22:return n.lanes=0,Zh(e,n,a,n.pendingProps);case 24:fr(n,at,e.memoizedState.cache)}return Kn(e,n,a)}function sg(e,n,a){if(e!==null)if(e.memoizedProps!==n.pendingProps)st=!0;else{if(!Ku(e,a)&&(n.flags&128)===0)return st=!1,vk(e,n,a);st=(e.flags&131072)!==0}else st=!1,He&&(n.flags&1048576)!==0&&Bp(n,Uo,n.index);switch(n.lanes=0,n.tag){case 16:e:{var s=n.pendingProps;if(e=ea(n.elementType),n.type=e,typeof e=="function")$c(e)?(s=aa(e,s),n.tag=1,n=tg(null,n,e,s,a)):(n.tag=0,n=Hu(null,n,e,s,a));else{if(e!=null){var u=e.$$typeof;if(u===A){n.tag=11,n=Gh(null,n,e,s,a);break e}else if(u===L){n.tag=14,n=$h(null,n,e,s,a);break e}}throw n=Z(e)||e,Error(i(306,n,""))}}return n;case 0:return Hu(e,n,n.type,n.pendingProps,a);case 1:return s=n.type,u=aa(s,n.pendingProps),tg(e,n,s,u,a);case 3:e:{if(ie(n,n.stateNode.containerInfo),e===null)throw Error(i(387));s=n.pendingProps;var p=n.memoizedState;u=p.element,uu(e,n),Go(n,s,null,a);var w=n.memoizedState;if(s=w.cache,fr(n,at,s),s!==p.cache&&au(n,[at],a,!0),Vo(),s=w.element,p.isDehydrated)if(p={element:s,isDehydrated:!1,cache:w.cache},n.updateQueue.baseState=p,n.memoizedState=p,n.flags&256){n=ng(e,n,s,a);break e}else if(s!==u){u=rn(Error(i(424)),n),qo(u),n=ng(e,n,s,a);break e}else for(e=n.stateNode.containerInfo,e.nodeType===9?e=e.body:e=e.nodeName==="HTML"?e.ownerDocument.body:e,Ge=cn(e.firstChild),mt=n,He=!0,ur=null,sn=!0,a=Zp(n,null,s,a),n.child=a;a;)a.flags=a.flags&-3|4096,a=a.sibling;else{if(Xr(),s===u){n=Kn(e,n,a);break e}ht(e,n,s,a)}n=n.child}return n;case 26:return Bi(e,n),e===null?(a=vv(n.type,null,n.pendingProps,null))?n.memoizedState=a:He||(a=n.type,e=n.pendingProps,s=tl(pe.current).createElement(a),s[ft]=n,s[At]=e,gt(s,a,e),ut(s),n.stateNode=s):n.memoizedState=vv(n.type,e.memoizedProps,n.pendingProps,e.memoizedState),null;case 27:return de(n),e===null&&He&&(s=n.stateNode=pv(n.type,n.pendingProps,pe.current),mt=n,sn=!0,u=Ge,Cr(n.type)?(Sd=u,Ge=cn(s.firstChild)):Ge=u),ht(e,n,n.pendingProps.children,a),Bi(e,n),e===null&&(n.flags|=4194304),n.child;case 5:return e===null&&He&&((u=s=Ge)&&(s=Vk(s,n.type,n.pendingProps,sn),s!==null?(n.stateNode=s,mt=n,Ge=cn(s.firstChild),sn=!1,u=!0):u=!1),u||dr(n)),de(n),u=n.type,p=n.pendingProps,w=e!==null?e.memoizedProps:null,s=p.children,yd(u,p)?s=null:w!==null&&yd(u,w)&&(n.flags|=32),n.memoizedState!==null&&(u=vu(e,n,lk,null,null,a),ps._currentValue=u),Bi(e,n),ht(e,n,s,a),n.child;case 6:return e===null&&He&&((e=a=Ge)&&(a=Gk(a,n.pendingProps,sn),a!==null?(n.stateNode=a,mt=n,Ge=null,e=!0):e=!1),e||dr(n)),null;case 13:return rg(e,n,a);case 4:return ie(n,n.stateNode.containerInfo),s=n.pendingProps,e===null?n.child=na(n,null,s,a):ht(e,n,s,a),n.child;case 11:return Gh(e,n,n.type,n.pendingProps,a);case 7:return ht(e,n,n.pendingProps,a),n.child;case 8:return ht(e,n,n.pendingProps.children,a),n.child;case 12:return ht(e,n,n.pendingProps.children,a),n.child;case 10:return s=n.pendingProps,fr(n,n.type,s.value),ht(e,n,s.children,a),n.child;case 9:return u=n.type._context,s=n.pendingProps.children,Qr(n),u=pt(u),s=s(u),n.flags|=1,ht(e,n,s,a),n.child;case 14:return $h(e,n,n.type,n.pendingProps,a);case 15:return Xh(e,n,n.type,n.pendingProps,a);case 19:return og(e,n,a);case 31:return gk(e,n,a);case 22:return Zh(e,n,a,n.pendingProps);case 24:return Qr(n),s=pt(at),e===null?(u=iu(),u===null&&(u=Ye,p=ou(),u.pooledCache=p,p.refCount++,p!==null&&(u.pooledCacheLanes|=a),u=p),n.memoizedState={parent:s,cache:u},cu(n),fr(n,at,u)):((e.lanes&a)!==0&&(uu(e,n),Go(n,null,null,a),Vo()),u=e.memoizedState,p=n.memoizedState,u.parent!==s?(u={parent:s,cache:s},n.memoizedState=u,n.lanes===0&&(n.memoizedState=n.updateQueue.baseState=u),fr(n,at,s)):(s=p.cache,fr(n,at,s),s!==u.cache&&au(n,[at],a,!0))),ht(e,n,n.pendingProps.children,a),n.child;case 29:throw n.pendingProps}throw Error(i(156,n.tag))}function Fn(e){e.flags|=4}function Fu(e,n,a,s,u){if((n=(e.mode&32)!==0)&&(n=!1),n){if(e.flags|=16777216,(u&335544128)===u)if(e.stateNode.complete)e.flags|=8192;else if(Dg())e.flags|=8192;else throw ta=Si,lu}else e.flags&=-16777217}function ig(e,n){if(n.type!=="stylesheet"||(n.state.loading&4)!==0)e.flags&=-16777217;else if(e.flags|=16777216,!kv(n))if(Dg())e.flags|=8192;else throw ta=Si,lu}function Ui(e,n){n!==null&&(e.flags|=4),e.flags&16384&&(n=e.tag!==22?Um():536870912,e.lanes|=n,Ya|=n)}function es(e,n){if(!He)switch(e.tailMode){case"hidden":n=e.tail;for(var a=null;n!==null;)n.alternate!==null&&(a=n),n=n.sibling;a===null?e.tail=null:a.sibling=null;break;case"collapsed":a=e.tail;for(var s=null;a!==null;)a.alternate!==null&&(s=a),a=a.sibling;s===null?n||e.tail===null?e.tail=null:e.tail.sibling=null:s.sibling=null}}function $e(e){var n=e.alternate!==null&&e.alternate.child===e.child,a=0,s=0;if(n)for(var u=e.child;u!==null;)a|=u.lanes|u.childLanes,s|=u.subtreeFlags&65011712,s|=u.flags&65011712,u.return=e,u=u.sibling;else for(u=e.child;u!==null;)a|=u.lanes|u.childLanes,s|=u.subtreeFlags,s|=u.flags,u.return=e,u=u.sibling;return e.subtreeFlags|=s,e.childLanes=a,n}function yk(e,n,a){var s=n.pendingProps;switch(Jc(n),n.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return $e(n),null;case 1:return $e(n),null;case 3:return a=n.stateNode,s=null,e!==null&&(s=e.memoizedState.cache),n.memoizedState.cache!==s&&(n.flags|=2048),qn(at),se(),a.pendingContext&&(a.context=a.pendingContext,a.pendingContext=null),(e===null||e.child===null)&&(Da(n)?Fn(n):e===null||e.memoizedState.isDehydrated&&(n.flags&256)===0||(n.flags|=1024,tu())),$e(n),null;case 26:var u=n.type,p=n.memoizedState;return e===null?(Fn(n),p!==null?($e(n),ig(n,p)):($e(n),Fu(n,u,null,s,a))):p?p!==e.memoizedState?(Fn(n),$e(n),ig(n,p)):($e(n),n.flags&=-16777217):(e=e.memoizedProps,e!==s&&Fn(n),$e(n),Fu(n,u,e,s,a)),null;case 27:if(me(n),a=pe.current,u=n.type,e!==null&&n.stateNode!=null)e.memoizedProps!==s&&Fn(n);else{if(!s){if(n.stateNode===null)throw Error(i(166));return $e(n),null}e=ue.current,Da(n)?Up(n):(e=pv(u,s,a),n.stateNode=e,Fn(n))}return $e(n),null;case 5:if(me(n),u=n.type,e!==null&&n.stateNode!=null)e.memoizedProps!==s&&Fn(n);else{if(!s){if(n.stateNode===null)throw Error(i(166));return $e(n),null}if(p=ue.current,Da(n))Up(n);else{var w=tl(pe.current);switch(p){case 1:p=w.createElementNS("http://www.w3.org/2000/svg",u);break;case 2:p=w.createElementNS("http://www.w3.org/1998/Math/MathML",u);break;default:switch(u){case"svg":p=w.createElementNS("http://www.w3.org/2000/svg",u);break;case"math":p=w.createElementNS("http://www.w3.org/1998/Math/MathML",u);break;case"script":p=w.createElement("div"),p.innerHTML="<script><\/script>",p=p.removeChild(p.firstChild);break;case"select":p=typeof s.is=="string"?w.createElement("select",{is:s.is}):w.createElement("select"),s.multiple?p.multiple=!0:s.size&&(p.size=s.size);break;default:p=typeof s.is=="string"?w.createElement(u,{is:s.is}):w.createElement(u)}}p[ft]=n,p[At]=s;e:for(w=n.child;w!==null;){if(w.tag===5||w.tag===6)p.appendChild(w.stateNode);else if(w.tag!==4&&w.tag!==27&&w.child!==null){w.child.return=w,w=w.child;continue}if(w===n)break e;for(;w.sibling===null;){if(w.return===null||w.return===n)break e;w=w.return}w.sibling.return=w.return,w=w.sibling}n.stateNode=p;e:switch(gt(p,u,s),u){case"button":case"input":case"select":case"textarea":s=!!s.autoFocus;break e;case"img":s=!0;break e;default:s=!1}s&&Fn(n)}}return $e(n),Fu(n,n.type,e===null?null:e.memoizedProps,n.pendingProps,a),null;case 6:if(e&&n.stateNode!=null)e.memoizedProps!==s&&Fn(n);else{if(typeof s!="string"&&n.stateNode===null)throw Error(i(166));if(e=pe.current,Da(n)){if(e=n.stateNode,a=n.memoizedProps,s=null,u=mt,u!==null)switch(u.tag){case 27:case 5:s=u.memoizedProps}e[ft]=n,e=!!(e.nodeValue===a||s!==null&&s.suppressHydrationWarning===!0||rv(e.nodeValue,a)),e||dr(n,!0)}else e=tl(e).createTextNode(s),e[ft]=n,n.stateNode=e}return $e(n),null;case 31:if(a=n.memoizedState,e===null||e.memoizedState!==null){if(s=Da(n),a!==null){if(e===null){if(!s)throw Error(i(318));if(e=n.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(i(557));e[ft]=n}else Xr(),(n.flags&128)===0&&(n.memoizedState=null),n.flags|=4;$e(n),e=!1}else a=tu(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=a),e=!0;if(!e)return n.flags&256?(Kt(n),n):(Kt(n),null);if((n.flags&128)!==0)throw Error(i(558))}return $e(n),null;case 13:if(s=n.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(u=Da(n),s!==null&&s.dehydrated!==null){if(e===null){if(!u)throw Error(i(318));if(u=n.memoizedState,u=u!==null?u.dehydrated:null,!u)throw Error(i(317));u[ft]=n}else Xr(),(n.flags&128)===0&&(n.memoizedState=null),n.flags|=4;$e(n),u=!1}else u=tu(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=u),u=!0;if(!u)return n.flags&256?(Kt(n),n):(Kt(n),null)}return Kt(n),(n.flags&128)!==0?(n.lanes=a,n):(a=s!==null,e=e!==null&&e.memoizedState!==null,a&&(s=n.child,u=null,s.alternate!==null&&s.alternate.memoizedState!==null&&s.alternate.memoizedState.cachePool!==null&&(u=s.alternate.memoizedState.cachePool.pool),p=null,s.memoizedState!==null&&s.memoizedState.cachePool!==null&&(p=s.memoizedState.cachePool.pool),p!==u&&(s.flags|=2048)),a!==e&&a&&(n.child.flags|=8192),Ui(n,n.updateQueue),$e(n),null);case 4:return se(),e===null&&md(n.stateNode.containerInfo),$e(n),null;case 10:return qn(n.type),$e(n),null;case 19:if(W(tt),s=n.memoizedState,s===null)return $e(n),null;if(u=(n.flags&128)!==0,p=s.rendering,p===null)if(u)es(s,!1);else{if(et!==0||e!==null&&(e.flags&128)!==0)for(e=n.child;e!==null;){if(p=Ai(e),p!==null){for(n.flags|=128,es(s,!1),e=p.updateQueue,n.updateQueue=e,Ui(n,e),n.subtreeFlags=0,e=a,a=n.child;a!==null;)Lp(a,e),a=a.sibling;return oe(tt,tt.current&1|2),He&&Wn(n,s.treeForkCount),n.child}e=e.sibling}s.tail!==null&&Me()>Fi&&(n.flags|=128,u=!0,es(s,!1),n.lanes=4194304)}else{if(!u)if(e=Ai(p),e!==null){if(n.flags|=128,u=!0,e=e.updateQueue,n.updateQueue=e,Ui(n,e),es(s,!0),s.tail===null&&s.tailMode==="hidden"&&!p.alternate&&!He)return $e(n),null}else 2*Me()-s.renderingStartTime>Fi&&a!==536870912&&(n.flags|=128,u=!0,es(s,!1),n.lanes=4194304);s.isBackwards?(p.sibling=n.child,n.child=p):(e=s.last,e!==null?e.sibling=p:n.child=p,s.last=p)}return s.tail!==null?(e=s.tail,s.rendering=e,s.tail=e.sibling,s.renderingStartTime=Me(),e.sibling=null,a=tt.current,oe(tt,u?a&1|2:a&1),He&&Wn(n,s.treeForkCount),e):($e(n),null);case 22:case 23:return Kt(n),pu(),s=n.memoizedState!==null,e!==null?e.memoizedState!==null!==s&&(n.flags|=8192):s&&(n.flags|=8192),s?(a&536870912)!==0&&(n.flags&128)===0&&($e(n),n.subtreeFlags&6&&(n.flags|=8192)):$e(n),a=n.updateQueue,a!==null&&Ui(n,a.retryQueue),a=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(a=e.memoizedState.cachePool.pool),s=null,n.memoizedState!==null&&n.memoizedState.cachePool!==null&&(s=n.memoizedState.cachePool.pool),s!==a&&(n.flags|=2048),e!==null&&W(Jr),null;case 24:return a=null,e!==null&&(a=e.memoizedState.cache),n.memoizedState.cache!==a&&(n.flags|=2048),qn(at),$e(n),null;case 25:return null;case 30:return null}throw Error(i(156,n.tag))}function bk(e,n){switch(Jc(n),n.tag){case 1:return e=n.flags,e&65536?(n.flags=e&-65537|128,n):null;case 3:return qn(at),se(),e=n.flags,(e&65536)!==0&&(e&128)===0?(n.flags=e&-65537|128,n):null;case 26:case 27:case 5:return me(n),null;case 31:if(n.memoizedState!==null){if(Kt(n),n.alternate===null)throw Error(i(340));Xr()}return e=n.flags,e&65536?(n.flags=e&-65537|128,n):null;case 13:if(Kt(n),e=n.memoizedState,e!==null&&e.dehydrated!==null){if(n.alternate===null)throw Error(i(340));Xr()}return e=n.flags,e&65536?(n.flags=e&-65537|128,n):null;case 19:return W(tt),null;case 4:return se(),null;case 10:return qn(n.type),null;case 22:case 23:return Kt(n),pu(),e!==null&&W(Jr),e=n.flags,e&65536?(n.flags=e&-65537|128,n):null;case 24:return qn(at),null;case 25:return null;default:return null}}function lg(e,n){switch(Jc(n),n.tag){case 3:qn(at),se();break;case 26:case 27:case 5:me(n);break;case 4:se();break;case 31:n.memoizedState!==null&&Kt(n);break;case 13:Kt(n);break;case 19:W(tt);break;case 10:qn(n.type);break;case 22:case 23:Kt(n),pu(),e!==null&&W(Jr);break;case 24:qn(at)}}function ts(e,n){try{var a=n.updateQueue,s=a!==null?a.lastEffect:null;if(s!==null){var u=s.next;a=u;do{if((a.tag&e)===e){s=void 0;var p=a.create,w=a.inst;s=p(),w.destroy=s}a=a.next}while(a!==u)}}catch(N){Ie(n,n.return,N)}}function yr(e,n,a){try{var s=n.updateQueue,u=s!==null?s.lastEffect:null;if(u!==null){var p=u.next;s=p;do{if((s.tag&e)===e){var w=s.inst,N=w.destroy;if(N!==void 0){w.destroy=void 0,u=n;var z=a,V=N;try{V()}catch(ne){Ie(u,z,ne)}}}s=s.next}while(s!==p)}}catch(ne){Ie(n,n.return,ne)}}function cg(e){var n=e.updateQueue;if(n!==null){var a=e.stateNode;try{Jp(n,a)}catch(s){Ie(e,e.return,s)}}}function ug(e,n,a){a.props=aa(e.type,e.memoizedProps),a.state=e.memoizedState;try{a.componentWillUnmount()}catch(s){Ie(e,n,s)}}function ns(e,n){try{var a=e.ref;if(a!==null){switch(e.tag){case 26:case 27:case 5:var s=e.stateNode;break;case 30:s=e.stateNode;break;default:s=e.stateNode}typeof a=="function"?e.refCleanup=a(s):a.current=s}}catch(u){Ie(e,n,u)}}function Cn(e,n){var a=e.ref,s=e.refCleanup;if(a!==null)if(typeof s=="function")try{s()}catch(u){Ie(e,n,u)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof a=="function")try{a(null)}catch(u){Ie(e,n,u)}else a.current=null}function dg(e){var n=e.type,a=e.memoizedProps,s=e.stateNode;try{e:switch(n){case"button":case"input":case"select":case"textarea":a.autoFocus&&s.focus();break e;case"img":a.src?s.src=a.src:a.srcSet&&(s.srcset=a.srcSet)}}catch(u){Ie(e,e.return,u)}}function Yu(e,n,a){try{var s=e.stateNode;qk(s,e.type,a,n),s[At]=n}catch(u){Ie(e,e.return,u)}}function fg(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&Cr(e.type)||e.tag===4}function Vu(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||fg(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&&Cr(e.type)||e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function Gu(e,n,a){var s=e.tag;if(s===5||s===6)e=e.stateNode,n?(a.nodeType===9?a.body:a.nodeName==="HTML"?a.ownerDocument.body:a).insertBefore(e,n):(n=a.nodeType===9?a.body:a.nodeName==="HTML"?a.ownerDocument.body:a,n.appendChild(e),a=a._reactRootContainer,a!=null||n.onclick!==null||(n.onclick=zn));else if(s!==4&&(s===27&&Cr(e.type)&&(a=e.stateNode,n=null),e=e.child,e!==null))for(Gu(e,n,a),e=e.sibling;e!==null;)Gu(e,n,a),e=e.sibling}function qi(e,n,a){var s=e.tag;if(s===5||s===6)e=e.stateNode,n?a.insertBefore(e,n):a.appendChild(e);else if(s!==4&&(s===27&&Cr(e.type)&&(a=e.stateNode),e=e.child,e!==null))for(qi(e,n,a),e=e.sibling;e!==null;)qi(e,n,a),e=e.sibling}function mg(e){var n=e.stateNode,a=e.memoizedProps;try{for(var s=e.type,u=n.attributes;u.length;)n.removeAttributeNode(u[0]);gt(n,s,a),n[ft]=e,n[At]=a}catch(p){Ie(e,e.return,p)}}var Yn=!1,it=!1,$u=!1,pg=typeof WeakSet=="function"?WeakSet:Set,dt=null;function wk(e,n){if(e=e.containerInfo,gd=ll,e=Tp(e),Ic(e)){if("selectionStart"in e)var a={start:e.selectionStart,end:e.selectionEnd};else e:{a=(a=e.ownerDocument)&&a.defaultView||window;var s=a.getSelection&&a.getSelection();if(s&&s.rangeCount!==0){a=s.anchorNode;var u=s.anchorOffset,p=s.focusNode;s=s.focusOffset;try{a.nodeType,p.nodeType}catch{a=null;break e}var w=0,N=-1,z=-1,V=0,ne=0,ae=e,G=null;t:for(;;){for(var J;ae!==a||u!==0&&ae.nodeType!==3||(N=w+u),ae!==p||s!==0&&ae.nodeType!==3||(z=w+s),ae.nodeType===3&&(w+=ae.nodeValue.length),(J=ae.firstChild)!==null;)G=ae,ae=J;for(;;){if(ae===e)break t;if(G===a&&++V===u&&(N=w),G===p&&++ne===s&&(z=w),(J=ae.nextSibling)!==null)break;ae=G,G=ae.parentNode}ae=J}a=N===-1||z===-1?null:{start:N,end:z}}else a=null}a=a||{start:0,end:0}}else a=null;for(vd={focusedElem:e,selectionRange:a},ll=!1,dt=n;dt!==null;)if(n=dt,e=n.child,(n.subtreeFlags&1028)!==0&&e!==null)e.return=n,dt=e;else for(;dt!==null;){switch(n=dt,p=n.alternate,e=n.flags,n.tag){case 0:if((e&4)!==0&&(e=n.updateQueue,e=e!==null?e.events:null,e!==null))for(a=0;a<e.length;a++)u=e[a],u.ref.impl=u.nextImpl;break;case 11:case 15:break;case 1:if((e&1024)!==0&&p!==null){e=void 0,a=n,u=p.memoizedProps,p=p.memoizedState,s=a.stateNode;try{var he=aa(a.type,u);e=s.getSnapshotBeforeUpdate(he,p),s.__reactInternalSnapshotBeforeUpdate=e}catch(Se){Ie(a,a.return,Se)}}break;case 3:if((e&1024)!==0){if(e=n.stateNode.containerInfo,a=e.nodeType,a===9)wd(e);else if(a===1)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":wd(e);break;default:e.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((e&1024)!==0)throw Error(i(163))}if(e=n.sibling,e!==null){e.return=n.return,dt=e;break}dt=n.return}}function hg(e,n,a){var s=a.flags;switch(a.tag){case 0:case 11:case 15:Gn(e,a),s&4&&ts(5,a);break;case 1:if(Gn(e,a),s&4)if(e=a.stateNode,n===null)try{e.componentDidMount()}catch(w){Ie(a,a.return,w)}else{var u=aa(a.type,n.memoizedProps);n=n.memoizedState;try{e.componentDidUpdate(u,n,e.__reactInternalSnapshotBeforeUpdate)}catch(w){Ie(a,a.return,w)}}s&64&&cg(a),s&512&&ns(a,a.return);break;case 3:if(Gn(e,a),s&64&&(e=a.updateQueue,e!==null)){if(n=null,a.child!==null)switch(a.child.tag){case 27:case 5:n=a.child.stateNode;break;case 1:n=a.child.stateNode}try{Jp(e,n)}catch(w){Ie(a,a.return,w)}}break;case 27:n===null&&s&4&&mg(a);case 26:case 5:Gn(e,a),n===null&&s&4&&dg(a),s&512&&ns(a,a.return);break;case 12:Gn(e,a);break;case 31:Gn(e,a),s&4&&yg(e,a);break;case 13:Gn(e,a),s&4&&bg(e,a),s&64&&(e=a.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(a=Nk.bind(null,a),$k(e,a))));break;case 22:if(s=a.memoizedState!==null||Yn,!s){n=n!==null&&n.memoizedState!==null||it,u=Yn;var p=it;Yn=s,(it=n)&&!p?$n(e,a,(a.subtreeFlags&8772)!==0):Gn(e,a),Yn=u,it=p}break;case 30:break;default:Gn(e,a)}}function gg(e){var n=e.alternate;n!==null&&(e.alternate=null,gg(n)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(n=e.stateNode,n!==null&&Cc(n)),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 Xe=null,Nt=!1;function Vn(e,n,a){for(a=a.child;a!==null;)vg(e,n,a),a=a.sibling}function vg(e,n,a){if(Wt&&typeof Wt.onCommitFiberUnmount=="function")try{Wt.onCommitFiberUnmount(To,a)}catch{}switch(a.tag){case 26:it||Cn(a,n),Vn(e,n,a),a.memoizedState?a.memoizedState.count--:a.stateNode&&(a=a.stateNode,a.parentNode.removeChild(a));break;case 27:it||Cn(a,n);var s=Xe,u=Nt;Cr(a.type)&&(Xe=a.stateNode,Nt=!1),Vn(e,n,a),ds(a.stateNode),Xe=s,Nt=u;break;case 5:it||Cn(a,n);case 6:if(s=Xe,u=Nt,Xe=null,Vn(e,n,a),Xe=s,Nt=u,Xe!==null)if(Nt)try{(Xe.nodeType===9?Xe.body:Xe.nodeName==="HTML"?Xe.ownerDocument.body:Xe).removeChild(a.stateNode)}catch(p){Ie(a,n,p)}else try{Xe.removeChild(a.stateNode)}catch(p){Ie(a,n,p)}break;case 18:Xe!==null&&(Nt?(e=Xe,cv(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,a.stateNode),eo(e)):cv(Xe,a.stateNode));break;case 4:s=Xe,u=Nt,Xe=a.stateNode.containerInfo,Nt=!0,Vn(e,n,a),Xe=s,Nt=u;break;case 0:case 11:case 14:case 15:yr(2,a,n),it||yr(4,a,n),Vn(e,n,a);break;case 1:it||(Cn(a,n),s=a.stateNode,typeof s.componentWillUnmount=="function"&&ug(a,n,s)),Vn(e,n,a);break;case 21:Vn(e,n,a);break;case 22:it=(s=it)||a.memoizedState!==null,Vn(e,n,a),it=s;break;default:Vn(e,n,a)}}function yg(e,n){if(n.memoizedState===null&&(e=n.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{eo(e)}catch(a){Ie(n,n.return,a)}}}function bg(e,n){if(n.memoizedState===null&&(e=n.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{eo(e)}catch(a){Ie(n,n.return,a)}}function xk(e){switch(e.tag){case 31:case 13:case 19:var n=e.stateNode;return n===null&&(n=e.stateNode=new pg),n;case 22:return e=e.stateNode,n=e._retryCache,n===null&&(n=e._retryCache=new pg),n;default:throw Error(i(435,e.tag))}}function Ii(e,n){var a=xk(e);n.forEach(function(s){if(!a.has(s)){a.add(s);var u=jk.bind(null,e,s);s.then(u,u)}})}function jt(e,n){var a=n.deletions;if(a!==null)for(var s=0;s<a.length;s++){var u=a[s],p=e,w=n,N=w;e:for(;N!==null;){switch(N.tag){case 27:if(Cr(N.type)){Xe=N.stateNode,Nt=!1;break e}break;case 5:Xe=N.stateNode,Nt=!1;break e;case 3:case 4:Xe=N.stateNode.containerInfo,Nt=!0;break e}N=N.return}if(Xe===null)throw Error(i(160));vg(p,w,u),Xe=null,Nt=!1,p=u.alternate,p!==null&&(p.return=null),u.return=null}if(n.subtreeFlags&13886)for(n=n.child;n!==null;)wg(n,e),n=n.sibling}var pn=null;function wg(e,n){var a=e.alternate,s=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:jt(n,e),Rt(e),s&4&&(yr(3,e,e.return),ts(3,e),yr(5,e,e.return));break;case 1:jt(n,e),Rt(e),s&512&&(it||a===null||Cn(a,a.return)),s&64&&Yn&&(e=e.updateQueue,e!==null&&(s=e.callbacks,s!==null&&(a=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=a===null?s:a.concat(s))));break;case 26:var u=pn;if(jt(n,e),Rt(e),s&512&&(it||a===null||Cn(a,a.return)),s&4){var p=a!==null?a.memoizedState:null;if(s=e.memoizedState,a===null)if(s===null)if(e.stateNode===null){e:{s=e.type,a=e.memoizedProps,u=u.ownerDocument||u;t:switch(s){case"title":p=u.getElementsByTagName("title")[0],(!p||p[No]||p[ft]||p.namespaceURI==="http://www.w3.org/2000/svg"||p.hasAttribute("itemprop"))&&(p=u.createElement(s),u.head.insertBefore(p,u.querySelector("head > title"))),gt(p,s,a),p[ft]=e,ut(p),s=p;break e;case"link":var w=wv("link","href",u).get(s+(a.href||""));if(w){for(var N=0;N<w.length;N++)if(p=w[N],p.getAttribute("href")===(a.href==null||a.href===""?null:a.href)&&p.getAttribute("rel")===(a.rel==null?null:a.rel)&&p.getAttribute("title")===(a.title==null?null:a.title)&&p.getAttribute("crossorigin")===(a.crossOrigin==null?null:a.crossOrigin)){w.splice(N,1);break t}}p=u.createElement(s),gt(p,s,a),u.head.appendChild(p);break;case"meta":if(w=wv("meta","content",u).get(s+(a.content||""))){for(N=0;N<w.length;N++)if(p=w[N],p.getAttribute("content")===(a.content==null?null:""+a.content)&&p.getAttribute("name")===(a.name==null?null:a.name)&&p.getAttribute("property")===(a.property==null?null:a.property)&&p.getAttribute("http-equiv")===(a.httpEquiv==null?null:a.httpEquiv)&&p.getAttribute("charset")===(a.charSet==null?null:a.charSet)){w.splice(N,1);break t}}p=u.createElement(s),gt(p,s,a),u.head.appendChild(p);break;default:throw Error(i(468,s))}p[ft]=e,ut(p),s=p}e.stateNode=s}else xv(u,e.type,e.stateNode);else e.stateNode=bv(u,s,e.memoizedProps);else p!==s?(p===null?a.stateNode!==null&&(a=a.stateNode,a.parentNode.removeChild(a)):p.count--,s===null?xv(u,e.type,e.stateNode):bv(u,s,e.memoizedProps)):s===null&&e.stateNode!==null&&Yu(e,e.memoizedProps,a.memoizedProps)}break;case 27:jt(n,e),Rt(e),s&512&&(it||a===null||Cn(a,a.return)),a!==null&&s&4&&Yu(e,e.memoizedProps,a.memoizedProps);break;case 5:if(jt(n,e),Rt(e),s&512&&(it||a===null||Cn(a,a.return)),e.flags&32){u=e.stateNode;try{Sa(u,"")}catch(he){Ie(e,e.return,he)}}s&4&&e.stateNode!=null&&(u=e.memoizedProps,Yu(e,u,a!==null?a.memoizedProps:u)),s&1024&&($u=!0);break;case 6:if(jt(n,e),Rt(e),s&4){if(e.stateNode===null)throw Error(i(162));s=e.memoizedProps,a=e.stateNode;try{a.nodeValue=s}catch(he){Ie(e,e.return,he)}}break;case 3:if(al=null,u=pn,pn=nl(n.containerInfo),jt(n,e),pn=u,Rt(e),s&4&&a!==null&&a.memoizedState.isDehydrated)try{eo(n.containerInfo)}catch(he){Ie(e,e.return,he)}$u&&($u=!1,xg(e));break;case 4:s=pn,pn=nl(e.stateNode.containerInfo),jt(n,e),Rt(e),pn=s;break;case 12:jt(n,e),Rt(e);break;case 31:jt(n,e),Rt(e),s&4&&(s=e.updateQueue,s!==null&&(e.updateQueue=null,Ii(e,s)));break;case 13:jt(n,e),Rt(e),e.child.flags&8192&&e.memoizedState!==null!=(a!==null&&a.memoizedState!==null)&&(Ki=Me()),s&4&&(s=e.updateQueue,s!==null&&(e.updateQueue=null,Ii(e,s)));break;case 22:u=e.memoizedState!==null;var z=a!==null&&a.memoizedState!==null,V=Yn,ne=it;if(Yn=V||u,it=ne||z,jt(n,e),it=ne,Yn=V,Rt(e),s&8192)e:for(n=e.stateNode,n._visibility=u?n._visibility&-2:n._visibility|1,u&&(a===null||z||Yn||it||oa(e)),a=null,n=e;;){if(n.tag===5||n.tag===26){if(a===null){z=a=n;try{if(p=z.stateNode,u)w=p.style,typeof w.setProperty=="function"?w.setProperty("display","none","important"):w.display="none";else{N=z.stateNode;var ae=z.memoizedProps.style,G=ae!=null&&ae.hasOwnProperty("display")?ae.display:null;N.style.display=G==null||typeof G=="boolean"?"":(""+G).trim()}}catch(he){Ie(z,z.return,he)}}}else if(n.tag===6){if(a===null){z=n;try{z.stateNode.nodeValue=u?"":z.memoizedProps}catch(he){Ie(z,z.return,he)}}}else if(n.tag===18){if(a===null){z=n;try{var J=z.stateNode;u?uv(J,!0):uv(z.stateNode,!1)}catch(he){Ie(z,z.return,he)}}}else if((n.tag!==22&&n.tag!==23||n.memoizedState===null||n===e)&&n.child!==null){n.child.return=n,n=n.child;continue}if(n===e)break e;for(;n.sibling===null;){if(n.return===null||n.return===e)break e;a===n&&(a=null),n=n.return}a===n&&(a=null),n.sibling.return=n.return,n=n.sibling}s&4&&(s=e.updateQueue,s!==null&&(a=s.retryQueue,a!==null&&(s.retryQueue=null,Ii(e,a))));break;case 19:jt(n,e),Rt(e),s&4&&(s=e.updateQueue,s!==null&&(e.updateQueue=null,Ii(e,s)));break;case 30:break;case 21:break;default:jt(n,e),Rt(e)}}function Rt(e){var n=e.flags;if(n&2){try{for(var a,s=e.return;s!==null;){if(fg(s)){a=s;break}s=s.return}if(a==null)throw Error(i(160));switch(a.tag){case 27:var u=a.stateNode,p=Vu(e);qi(e,p,u);break;case 5:var w=a.stateNode;a.flags&32&&(Sa(w,""),a.flags&=-33);var N=Vu(e);qi(e,N,w);break;case 3:case 4:var z=a.stateNode.containerInfo,V=Vu(e);Gu(e,V,z);break;default:throw Error(i(161))}}catch(ne){Ie(e,e.return,ne)}e.flags&=-3}n&4096&&(e.flags&=-4097)}function xg(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var n=e;xg(n),n.tag===5&&n.flags&1024&&n.stateNode.reset(),e=e.sibling}}function Gn(e,n){if(n.subtreeFlags&8772)for(n=n.child;n!==null;)hg(e,n.alternate,n),n=n.sibling}function oa(e){for(e=e.child;e!==null;){var n=e;switch(n.tag){case 0:case 11:case 14:case 15:yr(4,n,n.return),oa(n);break;case 1:Cn(n,n.return);var a=n.stateNode;typeof a.componentWillUnmount=="function"&&ug(n,n.return,a),oa(n);break;case 27:ds(n.stateNode);case 26:case 5:Cn(n,n.return),oa(n);break;case 22:n.memoizedState===null&&oa(n);break;case 30:oa(n);break;default:oa(n)}e=e.sibling}}function $n(e,n,a){for(a=a&&(n.subtreeFlags&8772)!==0,n=n.child;n!==null;){var s=n.alternate,u=e,p=n,w=p.flags;switch(p.tag){case 0:case 11:case 15:$n(u,p,a),ts(4,p);break;case 1:if($n(u,p,a),s=p,u=s.stateNode,typeof u.componentDidMount=="function")try{u.componentDidMount()}catch(V){Ie(s,s.return,V)}if(s=p,u=s.updateQueue,u!==null){var N=s.stateNode;try{var z=u.shared.hiddenCallbacks;if(z!==null)for(u.shared.hiddenCallbacks=null,u=0;u<z.length;u++)Qp(z[u],N)}catch(V){Ie(s,s.return,V)}}a&&w&64&&cg(p),ns(p,p.return);break;case 27:mg(p);case 26:case 5:$n(u,p,a),a&&s===null&&w&4&&dg(p),ns(p,p.return);break;case 12:$n(u,p,a);break;case 31:$n(u,p,a),a&&w&4&&yg(u,p);break;case 13:$n(u,p,a),a&&w&4&&bg(u,p);break;case 22:p.memoizedState===null&&$n(u,p,a),ns(p,p.return);break;case 30:break;default:$n(u,p,a)}n=n.sibling}}function Xu(e,n){var a=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(a=e.memoizedState.cachePool.pool),e=null,n.memoizedState!==null&&n.memoizedState.cachePool!==null&&(e=n.memoizedState.cachePool.pool),e!==a&&(e!=null&&e.refCount++,a!=null&&Io(a))}function Zu(e,n){e=null,n.alternate!==null&&(e=n.alternate.memoizedState.cache),n=n.memoizedState.cache,n!==e&&(n.refCount++,e!=null&&Io(e))}function hn(e,n,a,s){if(n.subtreeFlags&10256)for(n=n.child;n!==null;)kg(e,n,a,s),n=n.sibling}function kg(e,n,a,s){var u=n.flags;switch(n.tag){case 0:case 11:case 15:hn(e,n,a,s),u&2048&&ts(9,n);break;case 1:hn(e,n,a,s);break;case 3:hn(e,n,a,s),u&2048&&(e=null,n.alternate!==null&&(e=n.alternate.memoizedState.cache),n=n.memoizedState.cache,n!==e&&(n.refCount++,e!=null&&Io(e)));break;case 12:if(u&2048){hn(e,n,a,s),e=n.stateNode;try{var p=n.memoizedProps,w=p.id,N=p.onPostCommit;typeof N=="function"&&N(w,n.alternate===null?"mount":"update",e.passiveEffectDuration,-0)}catch(z){Ie(n,n.return,z)}}else hn(e,n,a,s);break;case 31:hn(e,n,a,s);break;case 13:hn(e,n,a,s);break;case 23:break;case 22:p=n.stateNode,w=n.alternate,n.memoizedState!==null?p._visibility&2?hn(e,n,a,s):rs(e,n):p._visibility&2?hn(e,n,a,s):(p._visibility|=2,Pa(e,n,a,s,(n.subtreeFlags&10256)!==0||!1)),u&2048&&Xu(w,n);break;case 24:hn(e,n,a,s),u&2048&&Zu(n.alternate,n);break;default:hn(e,n,a,s)}}function Pa(e,n,a,s,u){for(u=u&&((n.subtreeFlags&10256)!==0||!1),n=n.child;n!==null;){var p=e,w=n,N=a,z=s,V=w.flags;switch(w.tag){case 0:case 11:case 15:Pa(p,w,N,z,u),ts(8,w);break;case 23:break;case 22:var ne=w.stateNode;w.memoizedState!==null?ne._visibility&2?Pa(p,w,N,z,u):rs(p,w):(ne._visibility|=2,Pa(p,w,N,z,u)),u&&V&2048&&Xu(w.alternate,w);break;case 24:Pa(p,w,N,z,u),u&&V&2048&&Zu(w.alternate,w);break;default:Pa(p,w,N,z,u)}n=n.sibling}}function rs(e,n){if(n.subtreeFlags&10256)for(n=n.child;n!==null;){var a=e,s=n,u=s.flags;switch(s.tag){case 22:rs(a,s),u&2048&&Xu(s.alternate,s);break;case 24:rs(a,s),u&2048&&Zu(s.alternate,s);break;default:rs(a,s)}n=n.sibling}}var as=8192;function Ka(e,n,a){if(e.subtreeFlags&as)for(e=e.child;e!==null;)Sg(e,n,a),e=e.sibling}function Sg(e,n,a){switch(e.tag){case 26:Ka(e,n,a),e.flags&as&&e.memoizedState!==null&&i2(a,pn,e.memoizedState,e.memoizedProps);break;case 5:Ka(e,n,a);break;case 3:case 4:var s=pn;pn=nl(e.stateNode.containerInfo),Ka(e,n,a),pn=s;break;case 22:e.memoizedState===null&&(s=e.alternate,s!==null&&s.memoizedState!==null?(s=as,as=16777216,Ka(e,n,a),as=s):Ka(e,n,a));break;default:Ka(e,n,a)}}function Eg(e){var n=e.alternate;if(n!==null&&(e=n.child,e!==null)){n.child=null;do n=e.sibling,e.sibling=null,e=n;while(e!==null)}}function os(e){var n=e.deletions;if((e.flags&16)!==0){if(n!==null)for(var a=0;a<n.length;a++){var s=n[a];dt=s,Tg(s,e)}Eg(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)Cg(e),e=e.sibling}function Cg(e){switch(e.tag){case 0:case 11:case 15:os(e),e.flags&2048&&yr(9,e,e.return);break;case 3:os(e);break;case 12:os(e);break;case 22:var n=e.stateNode;e.memoizedState!==null&&n._visibility&2&&(e.return===null||e.return.tag!==13)?(n._visibility&=-3,Pi(e)):os(e);break;default:os(e)}}function Pi(e){var n=e.deletions;if((e.flags&16)!==0){if(n!==null)for(var a=0;a<n.length;a++){var s=n[a];dt=s,Tg(s,e)}Eg(e)}for(e=e.child;e!==null;){switch(n=e,n.tag){case 0:case 11:case 15:yr(8,n,n.return),Pi(n);break;case 22:a=n.stateNode,a._visibility&2&&(a._visibility&=-3,Pi(n));break;default:Pi(n)}e=e.sibling}}function Tg(e,n){for(;dt!==null;){var a=dt;switch(a.tag){case 0:case 11:case 15:yr(8,a,n);break;case 23:case 22:if(a.memoizedState!==null&&a.memoizedState.cachePool!==null){var s=a.memoizedState.cachePool.pool;s!=null&&s.refCount++}break;case 24:Io(a.memoizedState.cache)}if(s=a.child,s!==null)s.return=a,dt=s;else e:for(a=e;dt!==null;){s=dt;var u=s.sibling,p=s.return;if(gg(s),s===a){dt=null;break e}if(u!==null){u.return=p,dt=u;break e}dt=p}}}var kk={getCacheForType:function(e){var n=pt(at),a=n.data.get(e);return a===void 0&&(a=e(),n.data.set(e,a)),a},cacheSignal:function(){return pt(at).controller.signal}},Sk=typeof WeakMap=="function"?WeakMap:Map,Ue=0,Ye=null,Re=null,Le=0,qe=0,Ft=null,br=!1,Fa=!1,Qu=!1,Xn=0,et=0,wr=0,sa=0,Ju=0,Yt=0,Ya=0,ss=null,Ot=null,ed=!1,Ki=0,Ag=0,Fi=1/0,Yi=null,xr=null,lt=0,kr=null,Va=null,Zn=0,td=0,nd=null,_g=null,is=0,rd=null;function Vt(){return(Ue&2)!==0&&Le!==0?Le&-Le:M.T!==null?cd():Km()}function Ng(){if(Yt===0)if((Le&536870912)===0||He){var e=ei;ei<<=1,(ei&3932160)===0&&(ei=262144),Yt=e}else Yt=536870912;return e=Pt.current,e!==null&&(e.flags|=32),Yt}function Dt(e,n,a){(e===Ye&&(qe===2||qe===9)||e.cancelPendingCommit!==null)&&(Ga(e,0),Sr(e,Le,Yt,!1)),_o(e,a),((Ue&2)===0||e!==Ye)&&(e===Ye&&((Ue&2)===0&&(sa|=a),et===4&&Sr(e,Le,Yt,!1)),Tn(e))}function jg(e,n,a){if((Ue&6)!==0)throw Error(i(327));var s=!a&&(n&127)===0&&(n&e.expiredLanes)===0||Ao(e,n),u=s?Tk(e,n):od(e,n,!0),p=s;do{if(u===0){Fa&&!s&&Sr(e,n,0,!1);break}else{if(a=e.current.alternate,p&&!Ek(a)){u=od(e,n,!1),p=!1;continue}if(u===2){if(p=n,e.errorRecoveryDisabledLanes&p)var w=0;else w=e.pendingLanes&-536870913,w=w!==0?w:w&536870912?536870912:0;if(w!==0){n=w;e:{var N=e;u=ss;var z=N.current.memoizedState.isDehydrated;if(z&&(Ga(N,w).flags|=256),w=od(N,w,!1),w!==2){if(Qu&&!z){N.errorRecoveryDisabledLanes|=p,sa|=p,u=4;break e}p=Ot,Ot=u,p!==null&&(Ot===null?Ot=p:Ot.push.apply(Ot,p))}u=w}if(p=!1,u!==2)continue}}if(u===1){Ga(e,0),Sr(e,n,0,!0);break}e:{switch(s=e,p=u,p){case 0:case 1:throw Error(i(345));case 4:if((n&4194048)!==n)break;case 6:Sr(s,n,Yt,!br);break e;case 2:Ot=null;break;case 3:case 5:break;default:throw Error(i(329))}if((n&62914560)===n&&(u=Ki+300-Me(),10<u)){if(Sr(s,n,Yt,!br),ni(s,0,!0)!==0)break e;Zn=n,s.timeoutHandle=iv(Rg.bind(null,s,a,Ot,Yi,ed,n,Yt,sa,Ya,br,p,"Throttled",-0,0),u);break e}Rg(s,a,Ot,Yi,ed,n,Yt,sa,Ya,br,p,null,-0,0)}}break}while(!0);Tn(e)}function Rg(e,n,a,s,u,p,w,N,z,V,ne,ae,G,J){if(e.timeoutHandle=-1,ae=n.subtreeFlags,ae&8192||(ae&16785408)===16785408){ae={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:zn},Sg(n,p,ae);var he=(p&62914560)===p?Ki-Me():(p&4194048)===p?Ag-Me():0;if(he=l2(ae,he),he!==null){Zn=p,e.cancelPendingCommit=he(Wg.bind(null,e,n,p,a,s,u,w,N,z,ne,ae,null,G,J)),Sr(e,p,w,!V);return}}Wg(e,n,p,a,s,u,w,N,z)}function Ek(e){for(var n=e;;){var a=n.tag;if((a===0||a===11||a===15)&&n.flags&16384&&(a=n.updateQueue,a!==null&&(a=a.stores,a!==null)))for(var s=0;s<a.length;s++){var u=a[s],p=u.getSnapshot;u=u.value;try{if(!qt(p(),u))return!1}catch{return!1}}if(a=n.child,n.subtreeFlags&16384&&a!==null)a.return=n,n=a;else{if(n===e)break;for(;n.sibling===null;){if(n.return===null||n.return===e)return!0;n=n.return}n.sibling.return=n.return,n=n.sibling}}return!0}function Sr(e,n,a,s){n&=~Ju,n&=~sa,e.suspendedLanes|=n,e.pingedLanes&=~n,s&&(e.warmLanes|=n),s=e.expirationTimes;for(var u=n;0<u;){var p=31-Ut(u),w=1<<p;s[p]=-1,u&=~w}a!==0&&qm(e,a,n)}function Vi(){return(Ue&6)===0?(ls(0),!1):!0}function ad(){if(Re!==null){if(qe===0)var e=Re.return;else e=Re,Un=Zr=null,wu(e),Ba=null,Ko=0,e=Re;for(;e!==null;)lg(e.alternate,e),e=e.return;Re=null}}function Ga(e,n){var a=e.timeoutHandle;a!==-1&&(e.timeoutHandle=-1,Kk(a)),a=e.cancelPendingCommit,a!==null&&(e.cancelPendingCommit=null,a()),Zn=0,ad(),Ye=e,Re=a=Bn(e.current,null),Le=n,qe=0,Ft=null,br=!1,Fa=Ao(e,n),Qu=!1,Ya=Yt=Ju=sa=wr=et=0,Ot=ss=null,ed=!1,(n&8)!==0&&(n|=n&32);var s=e.entangledLanes;if(s!==0)for(e=e.entanglements,s&=n;0<s;){var u=31-Ut(s),p=1<<u;n|=e[u],s&=~p}return Xn=n,pi(),a}function Og(e,n){_e=null,M.H=Qo,n===Ha||n===ki?(n=Gp(),qe=3):n===lu?(n=Gp(),qe=4):qe=n===zu?8:n!==null&&typeof n=="object"&&typeof n.then=="function"?6:1,Ft=n,Re===null&&(et=1,zi(e,rn(n,e.current)))}function Dg(){var e=Pt.current;return e===null?!0:(Le&4194048)===Le?ln===null:(Le&62914560)===Le||(Le&536870912)!==0?e===ln:!1}function Mg(){var e=M.H;return M.H=Qo,e===null?Qo:e}function Lg(){var e=M.A;return M.A=kk,e}function Gi(){et=4,br||(Le&4194048)!==Le&&Pt.current!==null||(Fa=!0),(wr&134217727)===0&&(sa&134217727)===0||Ye===null||Sr(Ye,Le,Yt,!1)}function od(e,n,a){var s=Ue;Ue|=2;var u=Mg(),p=Lg();(Ye!==e||Le!==n)&&(Yi=null,Ga(e,n)),n=!1;var w=et;e:do try{if(qe!==0&&Re!==null){var N=Re,z=Ft;switch(qe){case 8:ad(),w=6;break e;case 3:case 2:case 9:case 6:Pt.current===null&&(n=!0);var V=qe;if(qe=0,Ft=null,$a(e,N,z,V),a&&Fa){w=0;break e}break;default:V=qe,qe=0,Ft=null,$a(e,N,z,V)}}Ck(),w=et;break}catch(ne){Og(e,ne)}while(!0);return n&&e.shellSuspendCounter++,Un=Zr=null,Ue=s,M.H=u,M.A=p,Re===null&&(Ye=null,Le=0,pi()),w}function Ck(){for(;Re!==null;)zg(Re)}function Tk(e,n){var a=Ue;Ue|=2;var s=Mg(),u=Lg();Ye!==e||Le!==n?(Yi=null,Fi=Me()+500,Ga(e,n)):Fa=Ao(e,n);e:do try{if(qe!==0&&Re!==null){n=Re;var p=Ft;t:switch(qe){case 1:qe=0,Ft=null,$a(e,n,p,1);break;case 2:case 9:if(Yp(p)){qe=0,Ft=null,Hg(n);break}n=function(){qe!==2&&qe!==9||Ye!==e||(qe=7),Tn(e)},p.then(n,n);break e;case 3:qe=7;break e;case 4:qe=5;break e;case 7:Yp(p)?(qe=0,Ft=null,Hg(n)):(qe=0,Ft=null,$a(e,n,p,7));break;case 5:var w=null;switch(Re.tag){case 26:w=Re.memoizedState;case 5:case 27:var N=Re;if(w?kv(w):N.stateNode.complete){qe=0,Ft=null;var z=N.sibling;if(z!==null)Re=z;else{var V=N.return;V!==null?(Re=V,$i(V)):Re=null}break t}}qe=0,Ft=null,$a(e,n,p,5);break;case 6:qe=0,Ft=null,$a(e,n,p,6);break;case 8:ad(),et=6;break e;default:throw Error(i(462))}}Ak();break}catch(ne){Og(e,ne)}while(!0);return Un=Zr=null,M.H=s,M.A=u,Ue=a,Re!==null?0:(Ye=null,Le=0,pi(),et)}function Ak(){for(;Re!==null&&!ce();)zg(Re)}function zg(e){var n=sg(e.alternate,e,Xn);e.memoizedProps=e.pendingProps,n===null?$i(e):Re=n}function Hg(e){var n=e,a=n.alternate;switch(n.tag){case 15:case 0:n=eg(a,n,n.pendingProps,n.type,void 0,Le);break;case 11:n=eg(a,n,n.pendingProps,n.type.render,n.ref,Le);break;case 5:wu(n);default:lg(a,n),n=Re=Lp(n,Xn),n=sg(a,n,Xn)}e.memoizedProps=e.pendingProps,n===null?$i(e):Re=n}function $a(e,n,a,s){Un=Zr=null,wu(n),Ba=null,Ko=0;var u=n.return;try{if(hk(e,u,n,a,Le)){et=1,zi(e,rn(a,e.current)),Re=null;return}}catch(p){if(u!==null)throw Re=u,p;et=1,zi(e,rn(a,e.current)),Re=null;return}n.flags&32768?(He||s===1?e=!0:Fa||(Le&536870912)!==0?e=!1:(br=e=!0,(s===2||s===9||s===3||s===6)&&(s=Pt.current,s!==null&&s.tag===13&&(s.flags|=16384))),Bg(n,e)):$i(n)}function $i(e){var n=e;do{if((n.flags&32768)!==0){Bg(n,br);return}e=n.return;var a=yk(n.alternate,n,Xn);if(a!==null){Re=a;return}if(n=n.sibling,n!==null){Re=n;return}Re=n=e}while(n!==null);et===0&&(et=5)}function Bg(e,n){do{var a=bk(e.alternate,e);if(a!==null){a.flags&=32767,Re=a;return}if(a=e.return,a!==null&&(a.flags|=32768,a.subtreeFlags=0,a.deletions=null),!n&&(e=e.sibling,e!==null)){Re=e;return}Re=e=a}while(e!==null);et=6,Re=null}function Wg(e,n,a,s,u,p,w,N,z){e.cancelPendingCommit=null;do Xi();while(lt!==0);if((Ue&6)!==0)throw Error(i(327));if(n!==null){if(n===e.current)throw Error(i(177));if(p=n.lanes|n.childLanes,p|=Vc,s1(e,a,p,w,N,z),e===Ye&&(Re=Ye=null,Le=0),Va=n,kr=e,Zn=a,td=p,nd=u,_g=s,(n.subtreeFlags&10256)!==0||(n.flags&10256)!==0?(e.callbackNode=null,e.callbackPriority=0,Rk(Qs,function(){return Kg(),null})):(e.callbackNode=null,e.callbackPriority=0),s=(n.flags&13878)!==0,(n.subtreeFlags&13878)!==0||s){s=M.T,M.T=null,u=K.p,K.p=2,w=Ue,Ue|=4;try{wk(e,n,a)}finally{Ue=w,K.p=u,M.T=s}}lt=1,Ug(),qg(),Ig()}}function Ug(){if(lt===1){lt=0;var e=kr,n=Va,a=(n.flags&13878)!==0;if((n.subtreeFlags&13878)!==0||a){a=M.T,M.T=null;var s=K.p;K.p=2;var u=Ue;Ue|=4;try{wg(n,e);var p=vd,w=Tp(e.containerInfo),N=p.focusedElem,z=p.selectionRange;if(w!==N&&N&&N.ownerDocument&&Cp(N.ownerDocument.documentElement,N)){if(z!==null&&Ic(N)){var V=z.start,ne=z.end;if(ne===void 0&&(ne=V),"selectionStart"in N)N.selectionStart=V,N.selectionEnd=Math.min(ne,N.value.length);else{var ae=N.ownerDocument||document,G=ae&&ae.defaultView||window;if(G.getSelection){var J=G.getSelection(),he=N.textContent.length,Se=Math.min(z.start,he),Fe=z.end===void 0?Se:Math.min(z.end,he);!J.extend&&Se>Fe&&(w=Fe,Fe=Se,Se=w);var q=Ep(N,Se),H=Ep(N,Fe);if(q&&H&&(J.rangeCount!==1||J.anchorNode!==q.node||J.anchorOffset!==q.offset||J.focusNode!==H.node||J.focusOffset!==H.offset)){var Y=ae.createRange();Y.setStart(q.node,q.offset),J.removeAllRanges(),Se>Fe?(J.addRange(Y),J.extend(H.node,H.offset)):(Y.setEnd(H.node,H.offset),J.addRange(Y))}}}}for(ae=[],J=N;J=J.parentNode;)J.nodeType===1&&ae.push({element:J,left:J.scrollLeft,top:J.scrollTop});for(typeof N.focus=="function"&&N.focus(),N=0;N<ae.length;N++){var re=ae[N];re.element.scrollLeft=re.left,re.element.scrollTop=re.top}}ll=!!gd,vd=gd=null}finally{Ue=u,K.p=s,M.T=a}}e.current=n,lt=2}}function qg(){if(lt===2){lt=0;var e=kr,n=Va,a=(n.flags&8772)!==0;if((n.subtreeFlags&8772)!==0||a){a=M.T,M.T=null;var s=K.p;K.p=2;var u=Ue;Ue|=4;try{hg(e,n.alternate,n)}finally{Ue=u,K.p=s,M.T=a}}lt=3}}function Ig(){if(lt===4||lt===3){lt=0,ye();var e=kr,n=Va,a=Zn,s=_g;(n.subtreeFlags&10256)!==0||(n.flags&10256)!==0?lt=5:(lt=0,Va=kr=null,Pg(e,e.pendingLanes));var u=e.pendingLanes;if(u===0&&(xr=null),Sc(a),n=n.stateNode,Wt&&typeof Wt.onCommitFiberRoot=="function")try{Wt.onCommitFiberRoot(To,n,void 0,(n.current.flags&128)===128)}catch{}if(s!==null){n=M.T,u=K.p,K.p=2,M.T=null;try{for(var p=e.onRecoverableError,w=0;w<s.length;w++){var N=s[w];p(N.value,{componentStack:N.stack})}}finally{M.T=n,K.p=u}}(Zn&3)!==0&&Xi(),Tn(e),u=e.pendingLanes,(a&261930)!==0&&(u&42)!==0?e===rd?is++:(is=0,rd=e):is=0,ls(0)}}function Pg(e,n){(e.pooledCacheLanes&=n)===0&&(n=e.pooledCache,n!=null&&(e.pooledCache=null,Io(n)))}function Xi(){return Ug(),qg(),Ig(),Kg()}function Kg(){if(lt!==5)return!1;var e=kr,n=td;td=0;var a=Sc(Zn),s=M.T,u=K.p;try{K.p=32>a?32:a,M.T=null,a=nd,nd=null;var p=kr,w=Zn;if(lt=0,Va=kr=null,Zn=0,(Ue&6)!==0)throw Error(i(331));var N=Ue;if(Ue|=4,Cg(p.current),kg(p,p.current,w,a),Ue=N,ls(0,!1),Wt&&typeof Wt.onPostCommitFiberRoot=="function")try{Wt.onPostCommitFiberRoot(To,p)}catch{}return!0}finally{K.p=u,M.T=s,Pg(e,n)}}function Fg(e,n,a){n=rn(a,n),n=Lu(e.stateNode,n,2),e=hr(e,n,2),e!==null&&(_o(e,2),Tn(e))}function Ie(e,n,a){if(e.tag===3)Fg(e,e,a);else for(;n!==null;){if(n.tag===3){Fg(n,e,a);break}else if(n.tag===1){var s=n.stateNode;if(typeof n.type.getDerivedStateFromError=="function"||typeof s.componentDidCatch=="function"&&(xr===null||!xr.has(s))){e=rn(a,e),a=Yh(2),s=hr(n,a,2),s!==null&&(Vh(a,s,n,e),_o(s,2),Tn(s));break}}n=n.return}}function sd(e,n,a){var s=e.pingCache;if(s===null){s=e.pingCache=new Sk;var u=new Set;s.set(n,u)}else u=s.get(n),u===void 0&&(u=new Set,s.set(n,u));u.has(a)||(Qu=!0,u.add(a),e=_k.bind(null,e,n,a),n.then(e,e))}function _k(e,n,a){var s=e.pingCache;s!==null&&s.delete(n),e.pingedLanes|=e.suspendedLanes&a,e.warmLanes&=~a,Ye===e&&(Le&a)===a&&(et===4||et===3&&(Le&62914560)===Le&&300>Me()-Ki?(Ue&2)===0&&Ga(e,0):Ju|=a,Ya===Le&&(Ya=0)),Tn(e)}function Yg(e,n){n===0&&(n=Um()),e=Gr(e,n),e!==null&&(_o(e,n),Tn(e))}function Nk(e){var n=e.memoizedState,a=0;n!==null&&(a=n.retryLane),Yg(e,a)}function jk(e,n){var a=0;switch(e.tag){case 31:case 13:var s=e.stateNode,u=e.memoizedState;u!==null&&(a=u.retryLane);break;case 19:s=e.stateNode;break;case 22:s=e.stateNode._retryCache;break;default:throw Error(i(314))}s!==null&&s.delete(n),Yg(e,a)}function Rk(e,n){return De(e,n)}var Zi=null,Xa=null,id=!1,Qi=!1,ld=!1,Er=0;function Tn(e){e!==Xa&&e.next===null&&(Xa===null?Zi=Xa=e:Xa=Xa.next=e),Qi=!0,id||(id=!0,Dk())}function ls(e,n){if(!ld&&Qi){ld=!0;do for(var a=!1,s=Zi;s!==null;){if(e!==0){var u=s.pendingLanes;if(u===0)var p=0;else{var w=s.suspendedLanes,N=s.pingedLanes;p=(1<<31-Ut(42|e)+1)-1,p&=u&~(w&~N),p=p&201326741?p&201326741|1:p?p|2:0}p!==0&&(a=!0,Xg(s,p))}else p=Le,p=ni(s,s===Ye?p:0,s.cancelPendingCommit!==null||s.timeoutHandle!==-1),(p&3)===0||Ao(s,p)||(a=!0,Xg(s,p));s=s.next}while(a);ld=!1}}function Ok(){Vg()}function Vg(){Qi=id=!1;var e=0;Er!==0&&Pk()&&(e=Er);for(var n=Me(),a=null,s=Zi;s!==null;){var u=s.next,p=Gg(s,n);p===0?(s.next=null,a===null?Zi=u:a.next=u,u===null&&(Xa=a)):(a=s,(e!==0||(p&3)!==0)&&(Qi=!0)),s=u}lt!==0&&lt!==5||ls(e),Er!==0&&(Er=0)}function Gg(e,n){for(var a=e.suspendedLanes,s=e.pingedLanes,u=e.expirationTimes,p=e.pendingLanes&-62914561;0<p;){var w=31-Ut(p),N=1<<w,z=u[w];z===-1?((N&a)===0||(N&s)!==0)&&(u[w]=o1(N,n)):z<=n&&(e.expiredLanes|=N),p&=~N}if(n=Ye,a=Le,a=ni(e,e===n?a:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),s=e.callbackNode,a===0||e===n&&(qe===2||qe===9)||e.cancelPendingCommit!==null)return s!==null&&s!==null&&Qe(s),e.callbackNode=null,e.callbackPriority=0;if((a&3)===0||Ao(e,a)){if(n=a&-a,n===e.callbackPriority)return n;switch(s!==null&&Qe(s),Sc(a)){case 2:case 8:a=Bm;break;case 32:a=Qs;break;case 268435456:a=Wm;break;default:a=Qs}return s=$g.bind(null,e),a=De(a,s),e.callbackPriority=n,e.callbackNode=a,n}return s!==null&&s!==null&&Qe(s),e.callbackPriority=2,e.callbackNode=null,2}function $g(e,n){if(lt!==0&&lt!==5)return e.callbackNode=null,e.callbackPriority=0,null;var a=e.callbackNode;if(Xi()&&e.callbackNode!==a)return null;var s=Le;return s=ni(e,e===Ye?s:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),s===0?null:(jg(e,s,n),Gg(e,Me()),e.callbackNode!=null&&e.callbackNode===a?$g.bind(null,e):null)}function Xg(e,n){if(Xi())return null;jg(e,n,!0)}function Dk(){Fk(function(){(Ue&6)!==0?De(Hm,Ok):Vg()})}function cd(){if(Er===0){var e=La;e===0&&(e=Js,Js<<=1,(Js&261888)===0&&(Js=256)),Er=e}return Er}function Zg(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:si(""+e)}function Qg(e,n){var a=n.ownerDocument.createElement("input");return a.name=n.name,a.value=n.value,e.id&&a.setAttribute("form",e.id),n.parentNode.insertBefore(a,n),e=new FormData(e),a.parentNode.removeChild(a),e}function Mk(e,n,a,s,u){if(n==="submit"&&a&&a.stateNode===u){var p=Zg((u[At]||null).action),w=s.submitter;w&&(n=(n=w[At]||null)?Zg(n.formAction):w.getAttribute("formAction"),n!==null&&(p=n,w=null));var N=new ui("action","action",null,s,u);e.push({event:N,listeners:[{instance:null,listener:function(){if(s.defaultPrevented){if(Er!==0){var z=w?Qg(u,w):new FormData(u);Nu(a,{pending:!0,data:z,method:u.method,action:p},null,z)}}else typeof p=="function"&&(N.preventDefault(),z=w?Qg(u,w):new FormData(u),Nu(a,{pending:!0,data:z,method:u.method,action:p},p,z))},currentTarget:u}]})}}for(var ud=0;ud<Yc.length;ud++){var dd=Yc[ud],Lk=dd.toLowerCase(),zk=dd[0].toUpperCase()+dd.slice(1);mn(Lk,"on"+zk)}mn(Np,"onAnimationEnd"),mn(jp,"onAnimationIteration"),mn(Rp,"onAnimationStart"),mn("dblclick","onDoubleClick"),mn("focusin","onFocus"),mn("focusout","onBlur"),mn(Q1,"onTransitionRun"),mn(J1,"onTransitionStart"),mn(ek,"onTransitionCancel"),mn(Op,"onTransitionEnd"),xa("onMouseEnter",["mouseout","mouseover"]),xa("onMouseLeave",["mouseout","mouseover"]),xa("onPointerEnter",["pointerout","pointerover"]),xa("onPointerLeave",["pointerout","pointerover"]),Kr("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Kr("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Kr("onBeforeInput",["compositionend","keypress","textInput","paste"]),Kr("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Kr("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Kr("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var cs="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(" "),Hk=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(cs));function Jg(e,n){n=(n&4)!==0;for(var a=0;a<e.length;a++){var s=e[a],u=s.event;s=s.listeners;e:{var p=void 0;if(n)for(var w=s.length-1;0<=w;w--){var N=s[w],z=N.instance,V=N.currentTarget;if(N=N.listener,z!==p&&u.isPropagationStopped())break e;p=N,u.currentTarget=V;try{p(u)}catch(ne){mi(ne)}u.currentTarget=null,p=z}else for(w=0;w<s.length;w++){if(N=s[w],z=N.instance,V=N.currentTarget,N=N.listener,z!==p&&u.isPropagationStopped())break e;p=N,u.currentTarget=V;try{p(u)}catch(ne){mi(ne)}u.currentTarget=null,p=z}}}}function Oe(e,n){var a=n[Ec];a===void 0&&(a=n[Ec]=new Set);var s=e+"__bubble";a.has(s)||(ev(n,e,2,!1),a.add(s))}function fd(e,n,a){var s=0;n&&(s|=4),ev(a,e,s,n)}var Ji="_reactListening"+Math.random().toString(36).slice(2);function md(e){if(!e[Ji]){e[Ji]=!0,Vm.forEach(function(a){a!=="selectionchange"&&(Hk.has(a)||fd(a,!1,e),fd(a,!0,e))});var n=e.nodeType===9?e:e.ownerDocument;n===null||n[Ji]||(n[Ji]=!0,fd("selectionchange",!1,n))}}function ev(e,n,a,s){switch(Nv(n)){case 2:var u=d2;break;case 8:u=f2;break;default:u=_d}a=u.bind(null,n,a,e),u=void 0,!Dc||n!=="touchstart"&&n!=="touchmove"&&n!=="wheel"||(u=!0),s?u!==void 0?e.addEventListener(n,a,{capture:!0,passive:u}):e.addEventListener(n,a,!0):u!==void 0?e.addEventListener(n,a,{passive:u}):e.addEventListener(n,a,!1)}function pd(e,n,a,s,u){var p=s;if((n&1)===0&&(n&2)===0&&s!==null)e:for(;;){if(s===null)return;var w=s.tag;if(w===3||w===4){var N=s.stateNode.containerInfo;if(N===u)break;if(w===4)for(w=s.return;w!==null;){var z=w.tag;if((z===3||z===4)&&w.stateNode.containerInfo===u)return;w=w.return}for(;N!==null;){if(w=ya(N),w===null)return;if(z=w.tag,z===5||z===6||z===26||z===27){s=p=w;continue e}N=N.parentNode}}s=s.return}op(function(){var V=p,ne=Rc(a),ae=[];e:{var G=Dp.get(e);if(G!==void 0){var J=ui,he=e;switch(e){case"keypress":if(li(a)===0)break e;case"keydown":case"keyup":J=j1;break;case"focusin":he="focus",J=Hc;break;case"focusout":he="blur",J=Hc;break;case"beforeblur":case"afterblur":J=Hc;break;case"click":if(a.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":J=lp;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":J=y1;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":J=D1;break;case Np:case jp:case Rp:J=x1;break;case Op:J=L1;break;case"scroll":case"scrollend":J=g1;break;case"wheel":J=H1;break;case"copy":case"cut":case"paste":J=S1;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":J=up;break;case"toggle":case"beforetoggle":J=W1}var Se=(n&4)!==0,Fe=!Se&&(e==="scroll"||e==="scrollend"),q=Se?G!==null?G+"Capture":null:G;Se=[];for(var H=V,Y;H!==null;){var re=H;if(Y=re.stateNode,re=re.tag,re!==5&&re!==26&&re!==27||Y===null||q===null||(re=Ro(H,q),re!=null&&Se.push(us(H,re,Y))),Fe)break;H=H.return}0<Se.length&&(G=new J(G,he,null,a,ne),ae.push({event:G,listeners:Se}))}}if((n&7)===0){e:{if(G=e==="mouseover"||e==="pointerover",J=e==="mouseout"||e==="pointerout",G&&a!==jc&&(he=a.relatedTarget||a.fromElement)&&(ya(he)||he[va]))break e;if((J||G)&&(G=ne.window===ne?ne:(G=ne.ownerDocument)?G.defaultView||G.parentWindow:window,J?(he=a.relatedTarget||a.toElement,J=V,he=he?ya(he):null,he!==null&&(Fe=c(he),Se=he.tag,he!==Fe||Se!==5&&Se!==27&&Se!==6)&&(he=null)):(J=null,he=V),J!==he)){if(Se=lp,re="onMouseLeave",q="onMouseEnter",H="mouse",(e==="pointerout"||e==="pointerover")&&(Se=up,re="onPointerLeave",q="onPointerEnter",H="pointer"),Fe=J==null?G:jo(J),Y=he==null?G:jo(he),G=new Se(re,H+"leave",J,a,ne),G.target=Fe,G.relatedTarget=Y,re=null,ya(ne)===V&&(Se=new Se(q,H+"enter",he,a,ne),Se.target=Y,Se.relatedTarget=Fe,re=Se),Fe=re,J&&he)t:{for(Se=Bk,q=J,H=he,Y=0,re=q;re;re=Se(re))Y++;re=0;for(var xe=H;xe;xe=Se(xe))re++;for(;0<Y-re;)q=Se(q),Y--;for(;0<re-Y;)H=Se(H),re--;for(;Y--;){if(q===H||H!==null&&q===H.alternate){Se=q;break t}q=Se(q),H=Se(H)}Se=null}else Se=null;J!==null&&tv(ae,G,J,Se,!1),he!==null&&Fe!==null&&tv(ae,Fe,he,Se,!0)}}e:{if(G=V?jo(V):window,J=G.nodeName&&G.nodeName.toLowerCase(),J==="select"||J==="input"&&G.type==="file")var Be=yp;else if(gp(G))if(bp)Be=$1;else{Be=V1;var be=Y1}else J=G.nodeName,!J||J.toLowerCase()!=="input"||G.type!=="checkbox"&&G.type!=="radio"?V&&Nc(V.elementType)&&(Be=yp):Be=G1;if(Be&&(Be=Be(e,V))){vp(ae,Be,a,ne);break e}be&&be(e,G,V),e==="focusout"&&V&&G.type==="number"&&V.memoizedProps.value!=null&&_c(G,"number",G.value)}switch(be=V?jo(V):window,e){case"focusin":(gp(be)||be.contentEditable==="true")&&(Aa=be,Pc=V,Wo=null);break;case"focusout":Wo=Pc=Aa=null;break;case"mousedown":Kc=!0;break;case"contextmenu":case"mouseup":case"dragend":Kc=!1,Ap(ae,a,ne);break;case"selectionchange":if(Z1)break;case"keydown":case"keyup":Ap(ae,a,ne)}var je;if(Wc)e:{switch(e){case"compositionstart":var ze="onCompositionStart";break e;case"compositionend":ze="onCompositionEnd";break e;case"compositionupdate":ze="onCompositionUpdate";break e}ze=void 0}else Ta?pp(e,a)&&(ze="onCompositionEnd"):e==="keydown"&&a.keyCode===229&&(ze="onCompositionStart");ze&&(dp&&a.locale!=="ko"&&(Ta||ze!=="onCompositionStart"?ze==="onCompositionEnd"&&Ta&&(je=sp()):(lr=ne,Mc="value"in lr?lr.value:lr.textContent,Ta=!0)),be=el(V,ze),0<be.length&&(ze=new cp(ze,e,null,a,ne),ae.push({event:ze,listeners:be}),je?ze.data=je:(je=hp(a),je!==null&&(ze.data=je)))),(je=q1?I1(e,a):P1(e,a))&&(ze=el(V,"onBeforeInput"),0<ze.length&&(be=new cp("onBeforeInput","beforeinput",null,a,ne),ae.push({event:be,listeners:ze}),be.data=je)),Mk(ae,e,V,a,ne)}Jg(ae,n)})}function us(e,n,a){return{instance:e,listener:n,currentTarget:a}}function el(e,n){for(var a=n+"Capture",s=[];e!==null;){var u=e,p=u.stateNode;if(u=u.tag,u!==5&&u!==26&&u!==27||p===null||(u=Ro(e,a),u!=null&&s.unshift(us(e,u,p)),u=Ro(e,n),u!=null&&s.push(us(e,u,p))),e.tag===3)return s;e=e.return}return[]}function Bk(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function tv(e,n,a,s,u){for(var p=n._reactName,w=[];a!==null&&a!==s;){var N=a,z=N.alternate,V=N.stateNode;if(N=N.tag,z!==null&&z===s)break;N!==5&&N!==26&&N!==27||V===null||(z=V,u?(V=Ro(a,p),V!=null&&w.unshift(us(a,V,z))):u||(V=Ro(a,p),V!=null&&w.push(us(a,V,z)))),a=a.return}w.length!==0&&e.push({event:n,listeners:w})}var Wk=/\r\n?/g,Uk=/\u0000|\uFFFD/g;function nv(e){return(typeof e=="string"?e:""+e).replace(Wk,`
10
+ `).replace(Uk,"")}function rv(e,n){return n=nv(n),nv(e)===n}function Ke(e,n,a,s,u,p){switch(a){case"children":typeof s=="string"?n==="body"||n==="textarea"&&s===""||Sa(e,s):(typeof s=="number"||typeof s=="bigint")&&n!=="body"&&Sa(e,""+s);break;case"className":ai(e,"class",s);break;case"tabIndex":ai(e,"tabindex",s);break;case"dir":case"role":case"viewBox":case"width":case"height":ai(e,a,s);break;case"style":rp(e,s,p);break;case"data":if(n!=="object"){ai(e,"data",s);break}case"src":case"href":if(s===""&&(n!=="a"||a!=="href")){e.removeAttribute(a);break}if(s==null||typeof s=="function"||typeof s=="symbol"||typeof s=="boolean"){e.removeAttribute(a);break}s=si(""+s),e.setAttribute(a,s);break;case"action":case"formAction":if(typeof s=="function"){e.setAttribute(a,"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 p=="function"&&(a==="formAction"?(n!=="input"&&Ke(e,n,"name",u.name,u,null),Ke(e,n,"formEncType",u.formEncType,u,null),Ke(e,n,"formMethod",u.formMethod,u,null),Ke(e,n,"formTarget",u.formTarget,u,null)):(Ke(e,n,"encType",u.encType,u,null),Ke(e,n,"method",u.method,u,null),Ke(e,n,"target",u.target,u,null)));if(s==null||typeof s=="symbol"||typeof s=="boolean"){e.removeAttribute(a);break}s=si(""+s),e.setAttribute(a,s);break;case"onClick":s!=null&&(e.onclick=zn);break;case"onScroll":s!=null&&Oe("scroll",e);break;case"onScrollEnd":s!=null&&Oe("scrollend",e);break;case"dangerouslySetInnerHTML":if(s!=null){if(typeof s!="object"||!("__html"in s))throw Error(i(61));if(a=s.__html,a!=null){if(u.children!=null)throw Error(i(60));e.innerHTML=a}}break;case"multiple":e.multiple=s&&typeof s!="function"&&typeof s!="symbol";break;case"muted":e.muted=s&&typeof s!="function"&&typeof s!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(s==null||typeof s=="function"||typeof s=="boolean"||typeof s=="symbol"){e.removeAttribute("xlink:href");break}a=si(""+s),e.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",a);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":s!=null&&typeof s!="function"&&typeof s!="symbol"?e.setAttribute(a,""+s):e.removeAttribute(a);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":s&&typeof s!="function"&&typeof s!="symbol"?e.setAttribute(a,""):e.removeAttribute(a);break;case"capture":case"download":s===!0?e.setAttribute(a,""):s!==!1&&s!=null&&typeof s!="function"&&typeof s!="symbol"?e.setAttribute(a,s):e.removeAttribute(a);break;case"cols":case"rows":case"size":case"span":s!=null&&typeof s!="function"&&typeof s!="symbol"&&!isNaN(s)&&1<=s?e.setAttribute(a,s):e.removeAttribute(a);break;case"rowSpan":case"start":s==null||typeof s=="function"||typeof s=="symbol"||isNaN(s)?e.removeAttribute(a):e.setAttribute(a,s);break;case"popover":Oe("beforetoggle",e),Oe("toggle",e),ri(e,"popover",s);break;case"xlinkActuate":Ln(e,"http://www.w3.org/1999/xlink","xlink:actuate",s);break;case"xlinkArcrole":Ln(e,"http://www.w3.org/1999/xlink","xlink:arcrole",s);break;case"xlinkRole":Ln(e,"http://www.w3.org/1999/xlink","xlink:role",s);break;case"xlinkShow":Ln(e,"http://www.w3.org/1999/xlink","xlink:show",s);break;case"xlinkTitle":Ln(e,"http://www.w3.org/1999/xlink","xlink:title",s);break;case"xlinkType":Ln(e,"http://www.w3.org/1999/xlink","xlink:type",s);break;case"xmlBase":Ln(e,"http://www.w3.org/XML/1998/namespace","xml:base",s);break;case"xmlLang":Ln(e,"http://www.w3.org/XML/1998/namespace","xml:lang",s);break;case"xmlSpace":Ln(e,"http://www.w3.org/XML/1998/namespace","xml:space",s);break;case"is":ri(e,"is",s);break;case"innerText":case"textContent":break;default:(!(2<a.length)||a[0]!=="o"&&a[0]!=="O"||a[1]!=="n"&&a[1]!=="N")&&(a=p1.get(a)||a,ri(e,a,s))}}function hd(e,n,a,s,u,p){switch(a){case"style":rp(e,s,p);break;case"dangerouslySetInnerHTML":if(s!=null){if(typeof s!="object"||!("__html"in s))throw Error(i(61));if(a=s.__html,a!=null){if(u.children!=null)throw Error(i(60));e.innerHTML=a}}break;case"children":typeof s=="string"?Sa(e,s):(typeof s=="number"||typeof s=="bigint")&&Sa(e,""+s);break;case"onScroll":s!=null&&Oe("scroll",e);break;case"onScrollEnd":s!=null&&Oe("scrollend",e);break;case"onClick":s!=null&&(e.onclick=zn);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!Gm.hasOwnProperty(a))e:{if(a[0]==="o"&&a[1]==="n"&&(u=a.endsWith("Capture"),n=a.slice(2,u?a.length-7:void 0),p=e[At]||null,p=p!=null?p[a]:null,typeof p=="function"&&e.removeEventListener(n,p,u),typeof s=="function")){typeof p!="function"&&p!==null&&(a in e?e[a]=null:e.hasAttribute(a)&&e.removeAttribute(a)),e.addEventListener(n,s,u);break e}a in e?e[a]=s:s===!0?e.setAttribute(a,""):ri(e,a,s)}}}function gt(e,n,a){switch(n){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Oe("error",e),Oe("load",e);var s=!1,u=!1,p;for(p in a)if(a.hasOwnProperty(p)){var w=a[p];if(w!=null)switch(p){case"src":s=!0;break;case"srcSet":u=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(i(137,n));default:Ke(e,n,p,w,a,null)}}u&&Ke(e,n,"srcSet",a.srcSet,a,null),s&&Ke(e,n,"src",a.src,a,null);return;case"input":Oe("invalid",e);var N=p=w=u=null,z=null,V=null;for(s in a)if(a.hasOwnProperty(s)){var ne=a[s];if(ne!=null)switch(s){case"name":u=ne;break;case"type":w=ne;break;case"checked":z=ne;break;case"defaultChecked":V=ne;break;case"value":p=ne;break;case"defaultValue":N=ne;break;case"children":case"dangerouslySetInnerHTML":if(ne!=null)throw Error(i(137,n));break;default:Ke(e,n,s,ne,a,null)}}Jm(e,p,N,z,V,w,u,!1);return;case"select":Oe("invalid",e),s=w=p=null;for(u in a)if(a.hasOwnProperty(u)&&(N=a[u],N!=null))switch(u){case"value":p=N;break;case"defaultValue":w=N;break;case"multiple":s=N;default:Ke(e,n,u,N,a,null)}n=p,a=w,e.multiple=!!s,n!=null?ka(e,!!s,n,!1):a!=null&&ka(e,!!s,a,!0);return;case"textarea":Oe("invalid",e),p=u=s=null;for(w in a)if(a.hasOwnProperty(w)&&(N=a[w],N!=null))switch(w){case"value":s=N;break;case"defaultValue":u=N;break;case"children":p=N;break;case"dangerouslySetInnerHTML":if(N!=null)throw Error(i(91));break;default:Ke(e,n,w,N,a,null)}tp(e,s,u,p);return;case"option":for(z in a)a.hasOwnProperty(z)&&(s=a[z],s!=null)&&(z==="selected"?e.selected=s&&typeof s!="function"&&typeof s!="symbol":Ke(e,n,z,s,a,null));return;case"dialog":Oe("beforetoggle",e),Oe("toggle",e),Oe("cancel",e),Oe("close",e);break;case"iframe":case"object":Oe("load",e);break;case"video":case"audio":for(s=0;s<cs.length;s++)Oe(cs[s],e);break;case"image":Oe("error",e),Oe("load",e);break;case"details":Oe("toggle",e);break;case"embed":case"source":case"link":Oe("error",e),Oe("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(V in a)if(a.hasOwnProperty(V)&&(s=a[V],s!=null))switch(V){case"children":case"dangerouslySetInnerHTML":throw Error(i(137,n));default:Ke(e,n,V,s,a,null)}return;default:if(Nc(n)){for(ne in a)a.hasOwnProperty(ne)&&(s=a[ne],s!==void 0&&hd(e,n,ne,s,a,void 0));return}}for(N in a)a.hasOwnProperty(N)&&(s=a[N],s!=null&&Ke(e,n,N,s,a,null))}function qk(e,n,a,s){switch(n){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var u=null,p=null,w=null,N=null,z=null,V=null,ne=null;for(J in a){var ae=a[J];if(a.hasOwnProperty(J)&&ae!=null)switch(J){case"checked":break;case"value":break;case"defaultValue":z=ae;default:s.hasOwnProperty(J)||Ke(e,n,J,null,s,ae)}}for(var G in s){var J=s[G];if(ae=a[G],s.hasOwnProperty(G)&&(J!=null||ae!=null))switch(G){case"type":p=J;break;case"name":u=J;break;case"checked":V=J;break;case"defaultChecked":ne=J;break;case"value":w=J;break;case"defaultValue":N=J;break;case"children":case"dangerouslySetInnerHTML":if(J!=null)throw Error(i(137,n));break;default:J!==ae&&Ke(e,n,G,J,s,ae)}}Ac(e,w,N,z,V,ne,p,u);return;case"select":J=w=N=G=null;for(p in a)if(z=a[p],a.hasOwnProperty(p)&&z!=null)switch(p){case"value":break;case"multiple":J=z;default:s.hasOwnProperty(p)||Ke(e,n,p,null,s,z)}for(u in s)if(p=s[u],z=a[u],s.hasOwnProperty(u)&&(p!=null||z!=null))switch(u){case"value":G=p;break;case"defaultValue":N=p;break;case"multiple":w=p;default:p!==z&&Ke(e,n,u,p,s,z)}n=N,a=w,s=J,G!=null?ka(e,!!a,G,!1):!!s!=!!a&&(n!=null?ka(e,!!a,n,!0):ka(e,!!a,a?[]:"",!1));return;case"textarea":J=G=null;for(N in a)if(u=a[N],a.hasOwnProperty(N)&&u!=null&&!s.hasOwnProperty(N))switch(N){case"value":break;case"children":break;default:Ke(e,n,N,null,s,u)}for(w in s)if(u=s[w],p=a[w],s.hasOwnProperty(w)&&(u!=null||p!=null))switch(w){case"value":G=u;break;case"defaultValue":J=u;break;case"children":break;case"dangerouslySetInnerHTML":if(u!=null)throw Error(i(91));break;default:u!==p&&Ke(e,n,w,u,s,p)}ep(e,G,J);return;case"option":for(var he in a)G=a[he],a.hasOwnProperty(he)&&G!=null&&!s.hasOwnProperty(he)&&(he==="selected"?e.selected=!1:Ke(e,n,he,null,s,G));for(z in s)G=s[z],J=a[z],s.hasOwnProperty(z)&&G!==J&&(G!=null||J!=null)&&(z==="selected"?e.selected=G&&typeof G!="function"&&typeof G!="symbol":Ke(e,n,z,G,s,J));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 Se in a)G=a[Se],a.hasOwnProperty(Se)&&G!=null&&!s.hasOwnProperty(Se)&&Ke(e,n,Se,null,s,G);for(V in s)if(G=s[V],J=a[V],s.hasOwnProperty(V)&&G!==J&&(G!=null||J!=null))switch(V){case"children":case"dangerouslySetInnerHTML":if(G!=null)throw Error(i(137,n));break;default:Ke(e,n,V,G,s,J)}return;default:if(Nc(n)){for(var Fe in a)G=a[Fe],a.hasOwnProperty(Fe)&&G!==void 0&&!s.hasOwnProperty(Fe)&&hd(e,n,Fe,void 0,s,G);for(ne in s)G=s[ne],J=a[ne],!s.hasOwnProperty(ne)||G===J||G===void 0&&J===void 0||hd(e,n,ne,G,s,J);return}}for(var q in a)G=a[q],a.hasOwnProperty(q)&&G!=null&&!s.hasOwnProperty(q)&&Ke(e,n,q,null,s,G);for(ae in s)G=s[ae],J=a[ae],!s.hasOwnProperty(ae)||G===J||G==null&&J==null||Ke(e,n,ae,G,s,J)}function av(e){switch(e){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function Ik(){if(typeof performance.getEntriesByType=="function"){for(var e=0,n=0,a=performance.getEntriesByType("resource"),s=0;s<a.length;s++){var u=a[s],p=u.transferSize,w=u.initiatorType,N=u.duration;if(p&&N&&av(w)){for(w=0,N=u.responseEnd,s+=1;s<a.length;s++){var z=a[s],V=z.startTime;if(V>N)break;var ne=z.transferSize,ae=z.initiatorType;ne&&av(ae)&&(z=z.responseEnd,w+=ne*(z<N?1:(N-V)/(z-V)))}if(--s,n+=8*(p+w)/(u.duration/1e3),e++,10<e)break}}if(0<e)return n/e/1e6}return navigator.connection&&(e=navigator.connection.downlink,typeof e=="number")?e:5}var gd=null,vd=null;function tl(e){return e.nodeType===9?e:e.ownerDocument}function ov(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 sv(e,n){if(e===0)switch(n){case"svg":return 1;case"math":return 2;default:return 0}return e===1&&n==="foreignObject"?0:e}function yd(e,n){return e==="textarea"||e==="noscript"||typeof n.children=="string"||typeof n.children=="number"||typeof n.children=="bigint"||typeof n.dangerouslySetInnerHTML=="object"&&n.dangerouslySetInnerHTML!==null&&n.dangerouslySetInnerHTML.__html!=null}var bd=null;function Pk(){var e=window.event;return e&&e.type==="popstate"?e===bd?!1:(bd=e,!0):(bd=null,!1)}var iv=typeof setTimeout=="function"?setTimeout:void 0,Kk=typeof clearTimeout=="function"?clearTimeout:void 0,lv=typeof Promise=="function"?Promise:void 0,Fk=typeof queueMicrotask=="function"?queueMicrotask:typeof lv<"u"?function(e){return lv.resolve(null).then(e).catch(Yk)}:iv;function Yk(e){setTimeout(function(){throw e})}function Cr(e){return e==="head"}function cv(e,n){var a=n,s=0;do{var u=a.nextSibling;if(e.removeChild(a),u&&u.nodeType===8)if(a=u.data,a==="/$"||a==="/&"){if(s===0){e.removeChild(u),eo(n);return}s--}else if(a==="$"||a==="$?"||a==="$~"||a==="$!"||a==="&")s++;else if(a==="html")ds(e.ownerDocument.documentElement);else if(a==="head"){a=e.ownerDocument.head,ds(a);for(var p=a.firstChild;p;){var w=p.nextSibling,N=p.nodeName;p[No]||N==="SCRIPT"||N==="STYLE"||N==="LINK"&&p.rel.toLowerCase()==="stylesheet"||a.removeChild(p),p=w}}else a==="body"&&ds(e.ownerDocument.body);a=u}while(a);eo(n)}function uv(e,n){var a=e;e=0;do{var s=a.nextSibling;if(a.nodeType===1?n?(a._stashedDisplay=a.style.display,a.style.display="none"):(a.style.display=a._stashedDisplay||"",a.getAttribute("style")===""&&a.removeAttribute("style")):a.nodeType===3&&(n?(a._stashedText=a.nodeValue,a.nodeValue=""):a.nodeValue=a._stashedText||""),s&&s.nodeType===8)if(a=s.data,a==="/$"){if(e===0)break;e--}else a!=="$"&&a!=="$?"&&a!=="$~"&&a!=="$!"||e++;a=s}while(a)}function wd(e){var n=e.firstChild;for(n&&n.nodeType===10&&(n=n.nextSibling);n;){var a=n;switch(n=n.nextSibling,a.nodeName){case"HTML":case"HEAD":case"BODY":wd(a),Cc(a);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(a.rel.toLowerCase()==="stylesheet")continue}e.removeChild(a)}}function Vk(e,n,a,s){for(;e.nodeType===1;){var u=a;if(e.nodeName.toLowerCase()!==n.toLowerCase()){if(!s&&(e.nodeName!=="INPUT"||e.type!=="hidden"))break}else if(s){if(!e[No])switch(n){case"meta":if(!e.hasAttribute("itemprop"))break;return e;case"link":if(p=e.getAttribute("rel"),p==="stylesheet"&&e.hasAttribute("data-precedence"))break;if(p!==u.rel||e.getAttribute("href")!==(u.href==null||u.href===""?null:u.href)||e.getAttribute("crossorigin")!==(u.crossOrigin==null?null:u.crossOrigin)||e.getAttribute("title")!==(u.title==null?null:u.title))break;return e;case"style":if(e.hasAttribute("data-precedence"))break;return e;case"script":if(p=e.getAttribute("src"),(p!==(u.src==null?null:u.src)||e.getAttribute("type")!==(u.type==null?null:u.type)||e.getAttribute("crossorigin")!==(u.crossOrigin==null?null:u.crossOrigin))&&p&&e.hasAttribute("async")&&!e.hasAttribute("itemprop"))break;return e;default:return e}}else if(n==="input"&&e.type==="hidden"){var p=u.name==null?null:""+u.name;if(u.type==="hidden"&&e.getAttribute("name")===p)return e}else return e;if(e=cn(e.nextSibling),e===null)break}return null}function Gk(e,n,a){if(n==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!a||(e=cn(e.nextSibling),e===null))return null;return e}function dv(e,n){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!n||(e=cn(e.nextSibling),e===null))return null;return e}function xd(e){return e.data==="$?"||e.data==="$~"}function kd(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState!=="loading"}function $k(e,n){var a=e.ownerDocument;if(e.data==="$~")e._reactRetry=n;else if(e.data!=="$?"||a.readyState!=="loading")n();else{var s=function(){n(),a.removeEventListener("DOMContentLoaded",s)};a.addEventListener("DOMContentLoaded",s),e._reactRetry=s}}function cn(e){for(;e!=null;e=e.nextSibling){var n=e.nodeType;if(n===1||n===3)break;if(n===8){if(n=e.data,n==="$"||n==="$!"||n==="$?"||n==="$~"||n==="&"||n==="F!"||n==="F")break;if(n==="/$"||n==="/&")return null}}return e}var Sd=null;function fv(e){e=e.nextSibling;for(var n=0;e;){if(e.nodeType===8){var a=e.data;if(a==="/$"||a==="/&"){if(n===0)return cn(e.nextSibling);n--}else a!=="$"&&a!=="$!"&&a!=="$?"&&a!=="$~"&&a!=="&"||n++}e=e.nextSibling}return null}function mv(e){e=e.previousSibling;for(var n=0;e;){if(e.nodeType===8){var a=e.data;if(a==="$"||a==="$!"||a==="$?"||a==="$~"||a==="&"){if(n===0)return e;n--}else a!=="/$"&&a!=="/&"||n++}e=e.previousSibling}return null}function pv(e,n,a){switch(n=tl(a),e){case"html":if(e=n.documentElement,!e)throw Error(i(452));return e;case"head":if(e=n.head,!e)throw Error(i(453));return e;case"body":if(e=n.body,!e)throw Error(i(454));return e;default:throw Error(i(451))}}function ds(e){for(var n=e.attributes;n.length;)e.removeAttributeNode(n[0]);Cc(e)}var un=new Map,hv=new Set;function nl(e){return typeof e.getRootNode=="function"?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var Qn=K.d;K.d={f:Xk,r:Zk,D:Qk,C:Jk,L:e2,m:t2,X:r2,S:n2,M:a2};function Xk(){var e=Qn.f(),n=Vi();return e||n}function Zk(e){var n=ba(e);n!==null&&n.tag===5&&n.type==="form"?Oh(n):Qn.r(e)}var Za=typeof document>"u"?null:document;function gv(e,n,a){var s=Za;if(s&&typeof n=="string"&&n){var u=tn(n);u='link[rel="'+e+'"][href="'+u+'"]',typeof a=="string"&&(u+='[crossorigin="'+a+'"]'),hv.has(u)||(hv.add(u),e={rel:e,crossOrigin:a,href:n},s.querySelector(u)===null&&(n=s.createElement("link"),gt(n,"link",e),ut(n),s.head.appendChild(n)))}}function Qk(e){Qn.D(e),gv("dns-prefetch",e,null)}function Jk(e,n){Qn.C(e,n),gv("preconnect",e,n)}function e2(e,n,a){Qn.L(e,n,a);var s=Za;if(s&&e&&n){var u='link[rel="preload"][as="'+tn(n)+'"]';n==="image"&&a&&a.imageSrcSet?(u+='[imagesrcset="'+tn(a.imageSrcSet)+'"]',typeof a.imageSizes=="string"&&(u+='[imagesizes="'+tn(a.imageSizes)+'"]')):u+='[href="'+tn(e)+'"]';var p=u;switch(n){case"style":p=Qa(e);break;case"script":p=Ja(e)}un.has(p)||(e=v({rel:"preload",href:n==="image"&&a&&a.imageSrcSet?void 0:e,as:n},a),un.set(p,e),s.querySelector(u)!==null||n==="style"&&s.querySelector(fs(p))||n==="script"&&s.querySelector(ms(p))||(n=s.createElement("link"),gt(n,"link",e),ut(n),s.head.appendChild(n)))}}function t2(e,n){Qn.m(e,n);var a=Za;if(a&&e){var s=n&&typeof n.as=="string"?n.as:"script",u='link[rel="modulepreload"][as="'+tn(s)+'"][href="'+tn(e)+'"]',p=u;switch(s){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":p=Ja(e)}if(!un.has(p)&&(e=v({rel:"modulepreload",href:e},n),un.set(p,e),a.querySelector(u)===null)){switch(s){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(a.querySelector(ms(p)))return}s=a.createElement("link"),gt(s,"link",e),ut(s),a.head.appendChild(s)}}}function n2(e,n,a){Qn.S(e,n,a);var s=Za;if(s&&e){var u=wa(s).hoistableStyles,p=Qa(e);n=n||"default";var w=u.get(p);if(!w){var N={loading:0,preload:null};if(w=s.querySelector(fs(p)))N.loading=5;else{e=v({rel:"stylesheet",href:e,"data-precedence":n},a),(a=un.get(p))&&Ed(e,a);var z=w=s.createElement("link");ut(z),gt(z,"link",e),z._p=new Promise(function(V,ne){z.onload=V,z.onerror=ne}),z.addEventListener("load",function(){N.loading|=1}),z.addEventListener("error",function(){N.loading|=2}),N.loading|=4,rl(w,n,s)}w={type:"stylesheet",instance:w,count:1,state:N},u.set(p,w)}}}function r2(e,n){Qn.X(e,n);var a=Za;if(a&&e){var s=wa(a).hoistableScripts,u=Ja(e),p=s.get(u);p||(p=a.querySelector(ms(u)),p||(e=v({src:e,async:!0},n),(n=un.get(u))&&Cd(e,n),p=a.createElement("script"),ut(p),gt(p,"link",e),a.head.appendChild(p)),p={type:"script",instance:p,count:1,state:null},s.set(u,p))}}function a2(e,n){Qn.M(e,n);var a=Za;if(a&&e){var s=wa(a).hoistableScripts,u=Ja(e),p=s.get(u);p||(p=a.querySelector(ms(u)),p||(e=v({src:e,async:!0,type:"module"},n),(n=un.get(u))&&Cd(e,n),p=a.createElement("script"),ut(p),gt(p,"link",e),a.head.appendChild(p)),p={type:"script",instance:p,count:1,state:null},s.set(u,p))}}function vv(e,n,a,s){var u=(u=pe.current)?nl(u):null;if(!u)throw Error(i(446));switch(e){case"meta":case"title":return null;case"style":return typeof a.precedence=="string"&&typeof a.href=="string"?(n=Qa(a.href),a=wa(u).hoistableStyles,s=a.get(n),s||(s={type:"style",instance:null,count:0,state:null},a.set(n,s)),s):{type:"void",instance:null,count:0,state:null};case"link":if(a.rel==="stylesheet"&&typeof a.href=="string"&&typeof a.precedence=="string"){e=Qa(a.href);var p=wa(u).hoistableStyles,w=p.get(e);if(w||(u=u.ownerDocument||u,w={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},p.set(e,w),(p=u.querySelector(fs(e)))&&!p._p&&(w.instance=p,w.state.loading=5),un.has(e)||(a={rel:"preload",as:"style",href:a.href,crossOrigin:a.crossOrigin,integrity:a.integrity,media:a.media,hrefLang:a.hrefLang,referrerPolicy:a.referrerPolicy},un.set(e,a),p||o2(u,e,a,w.state))),n&&s===null)throw Error(i(528,""));return w}if(n&&s!==null)throw Error(i(529,""));return null;case"script":return n=a.async,a=a.src,typeof a=="string"&&n&&typeof n!="function"&&typeof n!="symbol"?(n=Ja(a),a=wa(u).hoistableScripts,s=a.get(n),s||(s={type:"script",instance:null,count:0,state:null},a.set(n,s)),s):{type:"void",instance:null,count:0,state:null};default:throw Error(i(444,e))}}function Qa(e){return'href="'+tn(e)+'"'}function fs(e){return'link[rel="stylesheet"]['+e+"]"}function yv(e){return v({},e,{"data-precedence":e.precedence,precedence:null})}function o2(e,n,a,s){e.querySelector('link[rel="preload"][as="style"]['+n+"]")?s.loading=1:(n=e.createElement("link"),s.preload=n,n.addEventListener("load",function(){return s.loading|=1}),n.addEventListener("error",function(){return s.loading|=2}),gt(n,"link",a),ut(n),e.head.appendChild(n))}function Ja(e){return'[src="'+tn(e)+'"]'}function ms(e){return"script[async]"+e}function bv(e,n,a){if(n.count++,n.instance===null)switch(n.type){case"style":var s=e.querySelector('style[data-href~="'+tn(a.href)+'"]');if(s)return n.instance=s,ut(s),s;var u=v({},a,{"data-href":a.href,"data-precedence":a.precedence,href:null,precedence:null});return s=(e.ownerDocument||e).createElement("style"),ut(s),gt(s,"style",u),rl(s,a.precedence,e),n.instance=s;case"stylesheet":u=Qa(a.href);var p=e.querySelector(fs(u));if(p)return n.state.loading|=4,n.instance=p,ut(p),p;s=yv(a),(u=un.get(u))&&Ed(s,u),p=(e.ownerDocument||e).createElement("link"),ut(p);var w=p;return w._p=new Promise(function(N,z){w.onload=N,w.onerror=z}),gt(p,"link",s),n.state.loading|=4,rl(p,a.precedence,e),n.instance=p;case"script":return p=Ja(a.src),(u=e.querySelector(ms(p)))?(n.instance=u,ut(u),u):(s=a,(u=un.get(p))&&(s=v({},a),Cd(s,u)),e=e.ownerDocument||e,u=e.createElement("script"),ut(u),gt(u,"link",s),e.head.appendChild(u),n.instance=u);case"void":return null;default:throw Error(i(443,n.type))}else n.type==="stylesheet"&&(n.state.loading&4)===0&&(s=n.instance,n.state.loading|=4,rl(s,a.precedence,e));return n.instance}function rl(e,n,a){for(var s=a.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),u=s.length?s[s.length-1]:null,p=u,w=0;w<s.length;w++){var N=s[w];if(N.dataset.precedence===n)p=N;else if(p!==u)break}p?p.parentNode.insertBefore(e,p.nextSibling):(n=a.nodeType===9?a.head:a,n.insertBefore(e,n.firstChild))}function Ed(e,n){e.crossOrigin==null&&(e.crossOrigin=n.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=n.referrerPolicy),e.title==null&&(e.title=n.title)}function Cd(e,n){e.crossOrigin==null&&(e.crossOrigin=n.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=n.referrerPolicy),e.integrity==null&&(e.integrity=n.integrity)}var al=null;function wv(e,n,a){if(al===null){var s=new Map,u=al=new Map;u.set(a,s)}else u=al,s=u.get(a),s||(s=new Map,u.set(a,s));if(s.has(e))return s;for(s.set(e,null),a=a.getElementsByTagName(e),u=0;u<a.length;u++){var p=a[u];if(!(p[No]||p[ft]||e==="link"&&p.getAttribute("rel")==="stylesheet")&&p.namespaceURI!=="http://www.w3.org/2000/svg"){var w=p.getAttribute(n)||"";w=e+w;var N=s.get(w);N?N.push(p):s.set(w,[p])}}return s}function xv(e,n,a){e=e.ownerDocument||e,e.head.insertBefore(a,n==="title"?e.querySelector("head > title"):null)}function s2(e,n,a){if(a===1||n.itemProp!=null)return!1;switch(e){case"meta":case"title":return!0;case"style":if(typeof n.precedence!="string"||typeof n.href!="string"||n.href==="")break;return!0;case"link":if(typeof n.rel!="string"||typeof n.href!="string"||n.href===""||n.onLoad||n.onError)break;return n.rel==="stylesheet"?(e=n.disabled,typeof n.precedence=="string"&&e==null):!0;case"script":if(n.async&&typeof n.async!="function"&&typeof n.async!="symbol"&&!n.onLoad&&!n.onError&&n.src&&typeof n.src=="string")return!0}return!1}function kv(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function i2(e,n,a,s){if(a.type==="stylesheet"&&(typeof s.media!="string"||matchMedia(s.media).matches!==!1)&&(a.state.loading&4)===0){if(a.instance===null){var u=Qa(s.href),p=n.querySelector(fs(u));if(p){n=p._p,n!==null&&typeof n=="object"&&typeof n.then=="function"&&(e.count++,e=ol.bind(e),n.then(e,e)),a.state.loading|=4,a.instance=p,ut(p);return}p=n.ownerDocument||n,s=yv(s),(u=un.get(u))&&Ed(s,u),p=p.createElement("link"),ut(p);var w=p;w._p=new Promise(function(N,z){w.onload=N,w.onerror=z}),gt(p,"link",s),a.instance=p}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(a,n),(n=a.state.preload)&&(a.state.loading&3)===0&&(e.count++,a=ol.bind(e),n.addEventListener("load",a),n.addEventListener("error",a))}}var Td=0;function l2(e,n){return e.stylesheets&&e.count===0&&il(e,e.stylesheets),0<e.count||0<e.imgCount?function(a){var s=setTimeout(function(){if(e.stylesheets&&il(e,e.stylesheets),e.unsuspend){var p=e.unsuspend;e.unsuspend=null,p()}},6e4+n);0<e.imgBytes&&Td===0&&(Td=62500*Ik());var u=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&il(e,e.stylesheets),e.unsuspend)){var p=e.unsuspend;e.unsuspend=null,p()}},(e.imgBytes>Td?50:800)+n);return e.unsuspend=a,function(){e.unsuspend=null,clearTimeout(s),clearTimeout(u)}}:null}function ol(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)il(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var sl=null;function il(e,n){e.stylesheets=null,e.unsuspend!==null&&(e.count++,sl=new Map,n.forEach(c2,e),sl=null,ol.call(e))}function c2(e,n){if(!(n.state.loading&4)){var a=sl.get(e);if(a)var s=a.get(null);else{a=new Map,sl.set(e,a);for(var u=e.querySelectorAll("link[data-precedence],style[data-precedence]"),p=0;p<u.length;p++){var w=u[p];(w.nodeName==="LINK"||w.getAttribute("media")!=="not all")&&(a.set(w.dataset.precedence,w),s=w)}s&&a.set(null,s)}u=n.instance,w=u.getAttribute("data-precedence"),p=a.get(w)||s,p===s&&a.set(null,u),a.set(w,u),this.count++,s=ol.bind(this),u.addEventListener("load",s),u.addEventListener("error",s),p?p.parentNode.insertBefore(u,p.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(u,e.firstChild)),n.state.loading|=4}}var ps={$$typeof:j,Provider:null,Consumer:null,_currentValue:U,_currentValue2:U,_threadCount:0};function u2(e,n,a,s,u,p,w,N,z){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=xc(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=xc(0),this.hiddenUpdates=xc(null),this.identifierPrefix=s,this.onUncaughtError=u,this.onCaughtError=p,this.onRecoverableError=w,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=z,this.incompleteTransitions=new Map}function Sv(e,n,a,s,u,p,w,N,z,V,ne,ae){return e=new u2(e,n,a,w,z,V,ne,ae,N),n=1,p===!0&&(n|=24),p=It(3,null,null,n),e.current=p,p.stateNode=e,n=ou(),n.refCount++,e.pooledCache=n,n.refCount++,p.memoizedState={element:s,isDehydrated:a,cache:n},cu(p),e}function Ev(e){return e?(e=ja,e):ja}function Cv(e,n,a,s,u,p){u=Ev(u),s.context===null?s.context=u:s.pendingContext=u,s=pr(n),s.payload={element:a},p=p===void 0?null:p,p!==null&&(s.callback=p),a=hr(e,s,n),a!==null&&(Dt(a,e,n),Yo(a,e,n))}function Tv(e,n){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var a=e.retryLane;e.retryLane=a!==0&&a<n?a:n}}function Ad(e,n){Tv(e,n),(e=e.alternate)&&Tv(e,n)}function Av(e){if(e.tag===13||e.tag===31){var n=Gr(e,67108864);n!==null&&Dt(n,e,67108864),Ad(e,67108864)}}function _v(e){if(e.tag===13||e.tag===31){var n=Vt();n=kc(n);var a=Gr(e,n);a!==null&&Dt(a,e,n),Ad(e,n)}}var ll=!0;function d2(e,n,a,s){var u=M.T;M.T=null;var p=K.p;try{K.p=2,_d(e,n,a,s)}finally{K.p=p,M.T=u}}function f2(e,n,a,s){var u=M.T;M.T=null;var p=K.p;try{K.p=8,_d(e,n,a,s)}finally{K.p=p,M.T=u}}function _d(e,n,a,s){if(ll){var u=Nd(s);if(u===null)pd(e,n,s,cl,a),jv(e,s);else if(p2(u,e,n,a,s))s.stopPropagation();else if(jv(e,s),n&4&&-1<m2.indexOf(e)){for(;u!==null;){var p=ba(u);if(p!==null)switch(p.tag){case 3:if(p=p.stateNode,p.current.memoizedState.isDehydrated){var w=Pr(p.pendingLanes);if(w!==0){var N=p;for(N.pendingLanes|=2,N.entangledLanes|=2;w;){var z=1<<31-Ut(w);N.entanglements[1]|=z,w&=~z}Tn(p),(Ue&6)===0&&(Fi=Me()+500,ls(0))}}break;case 31:case 13:N=Gr(p,2),N!==null&&Dt(N,p,2),Vi(),Ad(p,2)}if(p=Nd(s),p===null&&pd(e,n,s,cl,a),p===u)break;u=p}u!==null&&s.stopPropagation()}else pd(e,n,s,null,a)}}function Nd(e){return e=Rc(e),jd(e)}var cl=null;function jd(e){if(cl=null,e=ya(e),e!==null){var n=c(e);if(n===null)e=null;else{var a=n.tag;if(a===13){if(e=f(n),e!==null)return e;e=null}else if(a===31){if(e=h(n),e!==null)return e;e=null}else if(a===3){if(n.stateNode.current.memoizedState.isDehydrated)return n.tag===3?n.stateNode.containerInfo:null;e=null}else n!==e&&(e=null)}}return cl=e,null}function Nv(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(ga()){case Hm:return 2;case Bm:return 8;case Qs:case Jx:return 32;case Wm:return 268435456;default:return 32}default:return 32}}var Rd=!1,Tr=null,Ar=null,_r=null,hs=new Map,gs=new Map,Nr=[],m2="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 jv(e,n){switch(e){case"focusin":case"focusout":Tr=null;break;case"dragenter":case"dragleave":Ar=null;break;case"mouseover":case"mouseout":_r=null;break;case"pointerover":case"pointerout":hs.delete(n.pointerId);break;case"gotpointercapture":case"lostpointercapture":gs.delete(n.pointerId)}}function vs(e,n,a,s,u,p){return e===null||e.nativeEvent!==p?(e={blockedOn:n,domEventName:a,eventSystemFlags:s,nativeEvent:p,targetContainers:[u]},n!==null&&(n=ba(n),n!==null&&Av(n)),e):(e.eventSystemFlags|=s,n=e.targetContainers,u!==null&&n.indexOf(u)===-1&&n.push(u),e)}function p2(e,n,a,s,u){switch(n){case"focusin":return Tr=vs(Tr,e,n,a,s,u),!0;case"dragenter":return Ar=vs(Ar,e,n,a,s,u),!0;case"mouseover":return _r=vs(_r,e,n,a,s,u),!0;case"pointerover":var p=u.pointerId;return hs.set(p,vs(hs.get(p)||null,e,n,a,s,u)),!0;case"gotpointercapture":return p=u.pointerId,gs.set(p,vs(gs.get(p)||null,e,n,a,s,u)),!0}return!1}function Rv(e){var n=ya(e.target);if(n!==null){var a=c(n);if(a!==null){if(n=a.tag,n===13){if(n=f(a),n!==null){e.blockedOn=n,Fm(e.priority,function(){_v(a)});return}}else if(n===31){if(n=h(a),n!==null){e.blockedOn=n,Fm(e.priority,function(){_v(a)});return}}else if(n===3&&a.stateNode.current.memoizedState.isDehydrated){e.blockedOn=a.tag===3?a.stateNode.containerInfo:null;return}}}e.blockedOn=null}function ul(e){if(e.blockedOn!==null)return!1;for(var n=e.targetContainers;0<n.length;){var a=Nd(e.nativeEvent);if(a===null){a=e.nativeEvent;var s=new a.constructor(a.type,a);jc=s,a.target.dispatchEvent(s),jc=null}else return n=ba(a),n!==null&&Av(n),e.blockedOn=a,!1;n.shift()}return!0}function Ov(e,n,a){ul(e)&&a.delete(n)}function h2(){Rd=!1,Tr!==null&&ul(Tr)&&(Tr=null),Ar!==null&&ul(Ar)&&(Ar=null),_r!==null&&ul(_r)&&(_r=null),hs.forEach(Ov),gs.forEach(Ov)}function dl(e,n){e.blockedOn===n&&(e.blockedOn=null,Rd||(Rd=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,h2)))}var fl=null;function Dv(e){fl!==e&&(fl=e,t.unstable_scheduleCallback(t.unstable_NormalPriority,function(){fl===e&&(fl=null);for(var n=0;n<e.length;n+=3){var a=e[n],s=e[n+1],u=e[n+2];if(typeof s!="function"){if(jd(s||a)===null)continue;break}var p=ba(a);p!==null&&(e.splice(n,3),n-=3,Nu(p,{pending:!0,data:u,method:a.method,action:s},s,u))}}))}function eo(e){function n(z){return dl(z,e)}Tr!==null&&dl(Tr,e),Ar!==null&&dl(Ar,e),_r!==null&&dl(_r,e),hs.forEach(n),gs.forEach(n);for(var a=0;a<Nr.length;a++){var s=Nr[a];s.blockedOn===e&&(s.blockedOn=null)}for(;0<Nr.length&&(a=Nr[0],a.blockedOn===null);)Rv(a),a.blockedOn===null&&Nr.shift();if(a=(e.ownerDocument||e).$$reactFormReplay,a!=null)for(s=0;s<a.length;s+=3){var u=a[s],p=a[s+1],w=u[At]||null;if(typeof p=="function")w||Dv(a);else if(w){var N=null;if(p&&p.hasAttribute("formAction")){if(u=p,w=p[At]||null)N=w.formAction;else if(jd(u)!==null)continue}else N=w.action;typeof N=="function"?a[s+1]=N:(a.splice(s,3),s-=3),Dv(a)}}}function Mv(){function e(p){p.canIntercept&&p.info==="react-transition"&&p.intercept({handler:function(){return new Promise(function(w){return u=w})},focusReset:"manual",scroll:"manual"})}function n(){u!==null&&(u(),u=null),s||setTimeout(a,20)}function a(){if(!s&&!navigation.transition){var p=navigation.currentEntry;p&&p.url!=null&&navigation.navigate(p.url,{state:p.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var s=!1,u=null;return navigation.addEventListener("navigate",e),navigation.addEventListener("navigatesuccess",n),navigation.addEventListener("navigateerror",n),setTimeout(a,100),function(){s=!0,navigation.removeEventListener("navigate",e),navigation.removeEventListener("navigatesuccess",n),navigation.removeEventListener("navigateerror",n),u!==null&&(u(),u=null)}}}function Od(e){this._internalRoot=e}ml.prototype.render=Od.prototype.render=function(e){var n=this._internalRoot;if(n===null)throw Error(i(409));var a=n.current,s=Vt();Cv(a,s,e,n,null,null)},ml.prototype.unmount=Od.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var n=e.containerInfo;Cv(e.current,2,null,e,null,null),Vi(),n[va]=null}};function ml(e){this._internalRoot=e}ml.prototype.unstable_scheduleHydration=function(e){if(e){var n=Km();e={blockedOn:null,target:e,priority:n};for(var a=0;a<Nr.length&&n!==0&&n<Nr[a].priority;a++);Nr.splice(a,0,e),a===0&&Rv(e)}};var Lv=r.version;if(Lv!=="19.2.5")throw Error(i(527,Lv,"19.2.5"));K.findDOMNode=function(e){var n=e._reactInternals;if(n===void 0)throw typeof e.render=="function"?Error(i(188)):(e=Object.keys(e).join(","),Error(i(268,e)));return e=m(n),e=e!==null?y(e):null,e=e===null?null:e.stateNode,e};var g2={bundleType:0,version:"19.2.5",rendererPackageName:"react-dom",currentDispatcherRef:M,reconcilerVersion:"19.2.5"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var pl=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!pl.isDisabled&&pl.supportsFiber)try{To=pl.inject(g2),Wt=pl}catch{}}return bs.createRoot=function(e,n){if(!l(e))throw Error(i(299));var a=!1,s="",u=Ih,p=Ph,w=Kh;return n!=null&&(n.unstable_strictMode===!0&&(a=!0),n.identifierPrefix!==void 0&&(s=n.identifierPrefix),n.onUncaughtError!==void 0&&(u=n.onUncaughtError),n.onCaughtError!==void 0&&(p=n.onCaughtError),n.onRecoverableError!==void 0&&(w=n.onRecoverableError)),n=Sv(e,1,!1,null,null,a,s,null,u,p,w,Mv),e[va]=n.current,md(e),new Od(n)},bs.hydrateRoot=function(e,n,a){if(!l(e))throw Error(i(299));var s=!1,u="",p=Ih,w=Ph,N=Kh,z=null;return a!=null&&(a.unstable_strictMode===!0&&(s=!0),a.identifierPrefix!==void 0&&(u=a.identifierPrefix),a.onUncaughtError!==void 0&&(p=a.onUncaughtError),a.onCaughtError!==void 0&&(w=a.onCaughtError),a.onRecoverableError!==void 0&&(N=a.onRecoverableError),a.formState!==void 0&&(z=a.formState)),n=Sv(e,1,!0,n,a??null,s,u,z,p,w,N,Mv),n.context=Ev(null),a=n.current,s=Vt(),s=kc(s),u=pr(s),u.callback=null,hr(a,u,s),a=s,n.current.lanes=a,_o(n,a),Tn(n),e[va]=n.current,md(e),new ml(n)},bs.version="19.2.5",bs}var Fv;function A2(){if(Fv)return Ld.exports;Fv=1;function t(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(t)}catch(r){console.error(r)}}return t(),Ld.exports=T2(),Ld.exports}var _2=A2();const N2="modulepreload",j2=function(t){return"/"+t},Yv={},Ct=function(r,o,i){let l=Promise.resolve();if(o&&o.length>0){let g=function(m){return Promise.all(m.map(y=>Promise.resolve(y).then(v=>({status:"fulfilled",value:v}),v=>({status:"rejected",reason:v}))))};document.getElementsByTagName("link");const f=document.querySelector("meta[property=csp-nonce]"),h=f?.nonce||f?.getAttribute("nonce");l=g(o.map(m=>{if(m=j2(m),m in Yv)return;Yv[m]=!0;const y=m.endsWith(".css"),v=y?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${m}"]${v}`))return;const k=document.createElement("link");if(k.rel=y?"stylesheet":N2,y||(k.as="script"),k.crossOrigin="",k.href=m,h&&k.setAttribute("nonce",h),document.head.appendChild(k),y)return new Promise((S,C)=>{k.addEventListener("load",S),k.addEventListener("error",()=>C(new Error(`Unable to preload CSS for ${m}`)))})}))}function c(f){const h=new Event("vite:preloadError",{cancelable:!0});if(h.payload=f,window.dispatchEvent(h),!h.defaultPrevented)throw f}return l.then(f=>{for(const h of f||[])h.status==="rejected"&&c(h.reason);return r().catch(c)})},R2=b.lazy(()=>Ct(()=>import("./WorkspaceTaskDrawer-CGCTSHKa.js"),__vite__mapDeps([0,1])).then(t=>({default:t.WorkspaceTaskDrawer}))),O2=b.lazy(()=>Ct(()=>import("./AddWorkspaceFlow-cxvhVAsT.js"),[]).then(t=>({default:t.AddWorkspaceFlow}))),D2=b.lazy(()=>Ct(()=>import("./FirstRunWizard-DlEPnWWw.js"),[]).then(t=>({default:t.FirstRunWizard}))),M2=b.lazy(()=>Ct(()=>import("./WhatsNewDialog-vP7buLos.js"),[]).then(t=>({default:t.WhatsNewDialog}))),L2=({addDialogTrigger:t,onAddWorkspace:r,onCloseTaskGraph:o,onCloseWizard:i,onCreateWorkspace:l,onTryDemo:c,taskGraphOpen:f,tasksFile:h,wizardOpen:g,whatsNewOpen:m,whatsNewEntries:y,onCloseWhatsNew:v,workspacePath:k,workers:S,onSelectOwner:C,connectionStale:x})=>d.jsxs(d.Fragment,{children:[k?d.jsx(b.Suspense,{fallback:null,children:d.jsx(R2,{open:f,tasksFile:h,onClose:o,workspacePath:k,...S?{workers:S}:{},...C?{onSelectOwner:C}:{},...x!==void 0?{connectionStale:x}:{}})}):null,t>0?d.jsx(b.Suspense,{fallback:null,children:d.jsx(O2,{onClose:()=>{},onCreate:l,onTryDemo:c,trigger:t})}):null,g?d.jsx(b.Suspense,{fallback:null,children:d.jsx(D2,{open:g,onClose:i,onAddWorkspace:r,onTryDemo:c})}):null,m?d.jsx(b.Suspense,{fallback:null,children:d.jsx(M2,{open:m,entries:[...y],onClose:v})}):null]});const j0=(...t)=>t.filter((r,o,i)=>!!r&&r.trim()!==""&&i.indexOf(r)===o).join(" ").trim();const z2=t=>t.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();const H2=t=>t.replace(/^([A-Z])|[\s-_]+(\w)/g,(r,o,i)=>i?i.toUpperCase():o.toLowerCase());const Vv=t=>{const r=H2(t);return r.charAt(0).toUpperCase()+r.slice(1)};var Wd={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};const B2=t=>{for(const r in t)if(r.startsWith("aria-")||r==="role"||r==="title")return!0;return!1},W2=b.createContext({}),U2=()=>b.useContext(W2),q2=b.forwardRef(({color:t,size:r,strokeWidth:o,absoluteStrokeWidth:i,className:l="",children:c,iconNode:f,...h},g)=>{const{size:m=24,strokeWidth:y=2,absoluteStrokeWidth:v=!1,color:k="currentColor",className:S=""}=U2()??{},C=i??v?Number(o??y)*24/Number(r??m):o??y;return b.createElement("svg",{ref:g,...Wd,width:r??m??Wd.width,height:r??m??Wd.height,stroke:t??k,strokeWidth:C,className:j0("lucide",S,l),...!c&&!B2(h)&&{"aria-hidden":"true"},...h},[...f.map(([x,E])=>b.createElement(x,E)),...Array.isArray(c)?c:[c]])});const we=(t,r)=>{const o=b.forwardRef(({className:i,...l},c)=>b.createElement(q2,{ref:c,iconNode:r,className:j0(`lucide-${z2(Vv(t))}`,`lucide-${t}`,i),...l}));return o.displayName=Vv(t),o};const I2=[["path",{d:"M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2",key:"169zse"}]],R0=we("activity",I2);const P2=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]],K2=we("arrow-right",P2);const F2=[["path",{d:"M10.268 21a2 2 0 0 0 3.464 0",key:"vwvbt9"}],["path",{d:"M3.262 15.326A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.673C19.41 13.956 18 12.499 18 8A6 6 0 0 0 6 8c0 4.499-1.411 5.956-2.738 7.326",key:"11g9vi"}]],Tf=we("bell",F2);const Y2=[["path",{d:"M12 21V7",key:"gj6g52"}],["path",{d:"m16 12 2 2 4-4",key:"mdajum"}],["path",{d:"M22 6V4a1 1 0 0 0-1-1h-5a4 4 0 0 0-4 4 4 4 0 0 0-4-4H3a1 1 0 0 0-1 1v13a1 1 0 0 0 1 1h6a3 3 0 0 1 3 3 3 3 0 0 1 3-3h6a1 1 0 0 0 1-1v-1.3",key:"8arnkb"}]],V2=we("book-open-check",Y2);const G2=[["path",{d:"M12 18V5",key:"adv99a"}],["path",{d:"M15 13a4.17 4.17 0 0 1-3-4 4.17 4.17 0 0 1-3 4",key:"1e3is1"}],["path",{d:"M17.598 6.5A3 3 0 1 0 12 5a3 3 0 1 0-5.598 1.5",key:"1gqd8o"}],["path",{d:"M17.997 5.125a4 4 0 0 1 2.526 5.77",key:"iwvgf7"}],["path",{d:"M18 18a4 4 0 0 0 2-7.464",key:"efp6ie"}],["path",{d:"M19.967 17.483A4 4 0 1 1 12 18a4 4 0 1 1-7.967-.517",key:"1gq6am"}],["path",{d:"M6 18a4 4 0 0 1-2-7.464",key:"k1g0md"}],["path",{d:"M6.003 5.125a4 4 0 0 0-2.526 5.77",key:"q97ue3"}]],$2=we("brain",G2);const X2=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],bo=we("check",X2);const Z2=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],wo=we("chevron-down",Z2);const Q2=[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]],J2=we("chevron-left",Q2);const eS=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],Jl=we("chevron-right",eS);const tS=[["path",{d:"m11 17-5-5 5-5",key:"13zhaf"}],["path",{d:"m18 17-5-5 5-5",key:"h8a8et"}]],nS=we("chevrons-left",tS);const rS=[["path",{d:"m6 17 5-5-5-5",key:"xnjwq"}],["path",{d:"m13 17 5-5-5-5",key:"17xmmf"}]],aS=we("chevrons-right",rS);const oS=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],sS=we("circle-check",oS);const iS=[["path",{d:"M9 9.003a1 1 0 0 1 1.517-.859l4.997 2.997a1 1 0 0 1 0 1.718l-4.997 2.997A1 1 0 0 1 9 14.996z",key:"kmsa83"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],lS=we("circle-play",iS);const cS=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3",key:"1u773s"}],["path",{d:"M12 17h.01",key:"p32p05"}]],uS=we("circle-question-mark",cS);const dS=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]],fS=we("circle-x",dS);const mS=[["path",{d:"m18 16 4-4-4-4",key:"1inbqp"}],["path",{d:"m6 8-4 4 4 4",key:"15zrgr"}],["path",{d:"m14.5 4-5 16",key:"e7oirm"}]],pS=we("code-xml",mS);const hS=[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]],ec=we("copy",hS);const gS=[["path",{d:"M11.562 3.266a.5.5 0 0 1 .876 0L15.39 8.87a1 1 0 0 0 1.516.294L21.183 5.5a.5.5 0 0 1 .798.519l-2.834 10.246a1 1 0 0 1-.956.734H5.81a1 1 0 0 1-.957-.734L2.02 6.02a.5.5 0 0 1 .798-.519l4.276 3.664a1 1 0 0 0 1.516-.294z",key:"1vdc57"}],["path",{d:"M5 21h14",key:"11awu3"}]],om=we("crown",gS);const vS=[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"12",cy:"5",r:"1",key:"gxeob9"}],["circle",{cx:"12",cy:"19",r:"1",key:"lyex9k"}]],yS=we("ellipsis-vertical",vS);const bS=[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]],wS=we("external-link",bS);const xS=[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],kS=we("eye",xS);const SS=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]],ES=we("file-text",SS);const CS=[["path",{d:"M14 2v6a2 2 0 0 0 .245.96l5.51 10.08A2 2 0 0 1 18 22H6a2 2 0 0 1-1.755-2.96l5.51-10.08A2 2 0 0 0 10 8V2",key:"18mbvz"}],["path",{d:"M6.453 15h11.094",key:"3shlmq"}],["path",{d:"M8.5 2h7",key:"csnxdl"}]],Ml=we("flask-conical",CS);const TS=[["path",{d:"M12 10v6",key:"1bos4e"}],["path",{d:"M9 13h6",key:"1uhe8q"}],["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]],O0=we("folder-plus",TS);const AS=[["path",{d:"m15 12-9.373 9.373a1 1 0 0 1-3.001-3L12 9",key:"1hayfq"}],["path",{d:"m18 15 4-4",key:"16gjal"}],["path",{d:"m21.5 11.5-1.914-1.914A2 2 0 0 1 19 8.172v-.344a2 2 0 0 0-.586-1.414l-1.657-1.657A6 6 0 0 0 12.516 3H9l1.243 1.243A6 6 0 0 1 12 8.485V10l2 2h1.172a2 2 0 0 1 1.414.586L18.5 14.5",key:"15ts47"}]],_S=we("hammer",AS);const NS=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]],D0=we("info",NS);const jS=[["path",{d:"m5 8 6 6",key:"1wu5hv"}],["path",{d:"m4 14 6-6 2-3",key:"1k1g8d"}],["path",{d:"M2 5h12",key:"or177f"}],["path",{d:"M7 2h1",key:"1t2jsx"}],["path",{d:"m22 22-5-10-5 10",key:"don7ne"}],["path",{d:"M14 18h6",key:"1m8k6r"}]],RS=we("languages",jS);const OS=[["path",{d:"M18 5a2 2 0 0 1 2 2v8.526a2 2 0 0 0 .212.897l1.068 2.127a1 1 0 0 1-.9 1.45H3.62a1 1 0 0 1-.9-1.45l1.068-2.127A2 2 0 0 0 4 15.526V7a2 2 0 0 1 2-2z",key:"1pdavp"}],["path",{d:"M20.054 15.987H3.946",key:"14rxg9"}]],Ud=we("laptop",OS);const DS=[["path",{d:"M13 5h8",key:"a7qcls"}],["path",{d:"M13 12h8",key:"h98zly"}],["path",{d:"M13 19h8",key:"c3s6r1"}],["path",{d:"m3 17 2 2 4-4",key:"1jhpwq"}],["path",{d:"m3 7 2 2 4-4",key:"1obspn"}]],M0=we("list-checks",DS);const MS=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],xo=we("loader-circle",MS);const LS=[["path",{d:"m16 17 5-5-5-5",key:"1bji2h"}],["path",{d:"M21 12H9",key:"dn1m92"}],["path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4",key:"1uf3rs"}]],zS=we("log-out",LS);const HS=[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"m21 3-7 7",key:"1l2asr"}],["path",{d:"m3 21 7-7",key:"tjx5ai"}],["path",{d:"M9 21H3v-6",key:"wtvkvv"}]],BS=we("maximize-2",HS);const WS=[["path",{d:"m14 10 7-7",key:"oa77jy"}],["path",{d:"M20 10h-6V4",key:"mjg0md"}],["path",{d:"m3 21 7-7",key:"tjx5ai"}],["path",{d:"M4 14h6v6",key:"rmj7iw"}]],US=we("minimize-2",WS);const qS=[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]],L0=we("pencil",qS);const IS=[["path",{d:"M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z",key:"10ikf1"}]],ko=we("play",IS);const PS=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],As=we("plus",PS);const KS=[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]],sm=we("refresh-cw",KS);const FS=[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]],im=we("rotate-ccw",FS);const YS=[["path",{d:"m8 11 2 2 4-4",key:"1sed1v"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]],VS=we("search-check",YS);const GS=[["path",{d:"M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z",key:"1ffxy3"}],["path",{d:"m21.854 2.147-10.94 10.939",key:"12cjpa"}]],$S=we("send",GS);const XS=[["path",{d:"M6 10H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2v4a2 2 0 0 1-2 2h-2",key:"4b9dqc"}],["path",{d:"M6 14H4a2 2 0 0 0-2 2v4a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-4a2 2 0 0 0-2-2h-2",key:"22nnkd"}],["path",{d:"M6 6h.01",key:"1utrut"}],["path",{d:"M6 18h.01",key:"uhywen"}],["path",{d:"m13 6-4 6h6l-4 6",key:"14hqih"}]],ZS=we("server-crash",XS);const QS=[["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",key:"1i5ecw"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],Af=we("settings",QS);const JS=[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],eE=we("shield-check",JS);const tE=[["path",{d:"M10 5H3",key:"1qgfaw"}],["path",{d:"M12 19H3",key:"yhmn1j"}],["path",{d:"M14 3v4",key:"1sua03"}],["path",{d:"M16 17v4",key:"1q0r14"}],["path",{d:"M21 12h-9",key:"1o4lsq"}],["path",{d:"M21 19h-5",key:"1rlt1p"}],["path",{d:"M21 5h-7",key:"1oszz2"}],["path",{d:"M8 10v4",key:"tgpxqk"}],["path",{d:"M8 12H3",key:"a7s4jb"}]],nE=we("sliders-horizontal",tE);const rE=[["rect",{width:"14",height:"20",x:"5",y:"2",rx:"2",ry:"2",key:"1yt0o3"}],["path",{d:"M12 18h.01",key:"mhygvu"}]],z0=we("smartphone",rE);const aE=[["path",{d:"M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z",key:"1s2grr"}],["path",{d:"M20 2v4",key:"1rf3ol"}],["path",{d:"M22 4h-4",key:"gwowj6"}],["circle",{cx:"4",cy:"20",r:"2",key:"6kqj1y"}]],H0=we("sparkles",aE);const oE=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]],lm=we("square",oE);const sE=[["path",{d:"M12 19h8",key:"baeox8"}],["path",{d:"m4 17 6-6-6-6",key:"1yngyt"}]],cm=we("terminal",sE);const iE=[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]],tc=we("trash-2",iE);const lE=[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]],nc=we("triangle-alert",lE);const cE=[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["line",{x1:"19",x2:"19",y1:"8",y2:"14",key:"1bvyxn"}],["line",{x1:"22",x2:"16",y1:"11",y2:"11",key:"1shjgl"}]],qd=we("user-plus",cE);const uE=[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["path",{d:"M16 3.128a4 4 0 0 1 0 7.744",key:"16gr8j"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}]],B0=we("users",uE);const dE=[["path",{d:"M11 4.702a.705.705 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.705.705 0 0 0 11 19.298z",key:"uqj9uw"}],["path",{d:"M16 9a5 5 0 0 1 0 6",key:"1q6k2b"}],["path",{d:"M19.364 18.364a9 9 0 0 0 0-12.728",key:"ijwkga"}]],Ll=we("volume-2",dE);const fE=[["path",{d:"M11 4.702a.705.705 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.705.705 0 0 0 11 19.298z",key:"uqj9uw"}],["line",{x1:"22",x2:"16",y1:"9",y2:"15",key:"1ewh16"}],["line",{x1:"16",x2:"22",y1:"9",y2:"15",key:"5ykzw1"}]],W0=we("volume-x",fE);const mE=[["path",{d:"M18 16.98h-5.99c-1.1 0-1.95.94-2.48 1.9A4 4 0 0 1 2 17c.01-.7.2-1.4.57-2",key:"q3hayz"}],["path",{d:"m6 17 3.13-5.78c.53-.97.1-2.18-.5-3.1a4 4 0 1 1 6.89-4.06",key:"1go1hn"}],["path",{d:"m12 6 3.13 5.73C15.66 12.7 16.9 13 18 13a4 4 0 0 1 0 8",key:"qlwsc0"}]],pE=we("webhook",mE);const hE=[["rect",{width:"8",height:"8",x:"3",y:"3",rx:"2",key:"by2w9f"}],["path",{d:"M7 11v4a2 2 0 0 0 2 2h4",key:"xkn7yn"}],["rect",{width:"8",height:"8",x:"13",y:"13",rx:"2",key:"1cgmvn"}]],U0=we("workflow",hE);const gE=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],fo=we("x",gE),q0="hive.uiLanguage",vE=t=>t==="en"||t==="zh",I0={"addWorker.agentCli":"Agent CLI","addWorker.agentNotFound":"not found","addWorker.agentExists":"Member name already exists","addWorker.cancel":"Cancel","addWorker.create":"Add Member","addWorker.creating":"Creating…","addWorker.customPlaceholder":"You are a security reviewer focused on auth and input validation. Use team report to hand findings back to the orchestrator.","addWorker.description":"Pick a role and a CLI agent. The orchestrator dispatches work via {command}.","addWorker.enterName":"Enter a name","addWorker.genericAgent":"Generic command","addWorker.genericCommand":"startup command only","addWorker.loadingPresets":"Loading presets…","addWorker.name":"Name","addWorker.namePlaceholder":"e.g. Alice","addWorker.modifiedFrom":"Modified from {role} default","addWorker.pickCliOrStartup":"Pick a CLI agent or enter a startup command","addWorker.random":"Random","addWorker.randomAria":"Generate random member name","addWorker.randomTooltip":"Suggest a random name","addWorker.role":"Role","addWorker.roleInstructions":"Role instructions","addWorker.roleInstructionsTitle":"Injected into the agent's startup prompt and every dispatch. Hive's team protocol stays fixed; this only steers role behavior.","addWorker.reset":"Reset","addWorker.saveAsTemplate":"Save as template","addWorker.startupCommand":"Startup command","addWorker.startupHelp":"Optional. Runs through your shell in this Workspace (bash/zsh/fish on POSIX, cmd.exe on Windows). Use it for custom agents or native resume commands such as {example}.","addWorker.startupOverrides":"overrides CLI launch","addWorker.template":"Saved templates","addWorker.templateClear":"Use blank Custom (no template)","addWorker.templateDeleteAria":"Delete template {name}","addWorker.templateDeleteConfirm":'Delete the saved template "{name}"? This cannot be undone.',"addWorker.templateDeleteConfirmLabel":"Delete","addWorker.templateDeleteTitle":"Delete role template","addWorker.templateEmpty":"No saved templates yet. Fill in role instructions and save one.","addWorker.templateNamePlaceholder":"Template name","addWorker.templateNoMatch":"No templates match this search.","addWorker.templatePickPlaceholder":"Choose a saved template…","addWorker.templateSaveConfirm":"Save","addWorker.templateSearchPlaceholder":"Search templates","addWorker.title":"Add team member","addWorker.unavailable":"{name} is not installed","addWorker.emptyInstructions":"Add role instructions","actionCenter.activity.cancelled":"{worker} cancelled {ago}","actionCenter.activity.queued":"{worker} queued {ago}","actionCenter.activity.reported":"{worker} reported {ago}","actionCenter.activity.submitted":"{worker} started {ago}","actionCenter.attention":"Attention","actionCenter.attention.noWorkers":"No team members yet.","actionCenter.attention.remoteError":"Remote request errored at {endpoint}.","actionCenter.attention.remoteRejected":"Remote request rejected at {endpoint}: {reason}.","actionCenter.attention.stoppedWithQueue":"{worker} is stopped with {count} queued.","actionCenter.attention.waitingReport":"{worker} has been waiting to report for {minutes}m.","actionCenter.collapse":"Collapse Action Center","actionCenter.copyRecap":"Copy recap","actionCenter.currentDispatch":"Current","actionCenter.expand":"Expand Action Center","actionCenter.latestReport":"Report","actionCenter.loadFailed":"Could not load team activity.","actionCenter.loading":"Loading team activity...","actionCenter.noActivity":"No recent team activity.","actionCenter.noWorkerEvidence":"No active worker evidence.","actionCenter.openCount":"{count} open","actionCenter.recapCopied":"Recap copied to clipboard.","actionCenter.recapCopyFailed":"Could not copy recap.","actionCenter.recent":"Recent","actionCenter.reportCount":"{count} reports","actionCenter.runningCount":"{count} running","actionCenter.stoppedWithQueue":"{count} stopped with queue","actionCenter.terminalHint":"Terminal","actionCenter.title":"Action Center","actionCenter.unknownWorker":"Unknown member","actionCenter.waitingReports":"{count} waiting report","actionCenter.workerStatus":"Status","actionCenter.workers":"Workers","common.cancel":"Cancel","common.close":"Close","common.never":"Never","common.error":"Error","common.closeDialog":"Close dialog","common.time.sAgo":"{count}s ago","common.time.mAgo":"{count}m ago","common.time.hAgo":"{count}h ago","common.time.dAgo":"{count}d ago","common.copied":"Copied","common.copyError":"Copy error","common.delete":"Delete","common.idle":"idle","common.loading":"Loading…","common.refresh":"Refresh","common.restart":"Restart","common.retry":"Retry","common.running":"running","common.save":"Save","common.saving":"Saving…","common.start":"Start","common.starting":"Starting…","common.stop":"Stop","common.stopped":"stopped","common.working":"working","connect.login.failed":"Sign-in failed — check your connection and try again.","connect.login.heading":"Connect to your Hive","connect.login.subtitle":"Sign in to reach the computers running Hive on your account.","connect.login.github":"Continue with GitHub","connect.login.google":"Continue with Google","connect.login.signingIn":"Signing in…","connect.machines.back":"Back","connect.machines.connecting":"Connecting…","connect.machines.heading":"Your computers","connect.machines.empty":"No computers yet. Run Hive on a computer and enable remote access.","connect.machines.lastSeen":"Last seen {ago} ago","connect.machines.manageDevices":"Manage devices","connect.machines.offline":"Offline","connect.machines.online":"Online","connect.machines.revoked":"Access revoked","connect.machines.revokedHint":"This device's access was revoked — enter a new pairing code to connect again.","connect.machines.select":"Connect","connect.pair.back":"Back","connect.pair.finalizing":"Confirmed — preparing your session…","connect.pair.guideHeading":"Pair this phone","connect.pair.guideStep1":"On that computer, open Settings → Remote access.","connect.pair.guideStep2":"Click Add device and keep the pairing code visible.","connect.pair.guideStep3":"Enter that pairing code below.","connect.pair.qrLabel":"Pairing code","connect.pair.sasInstruction":"On your computer, open Settings → Remote access and tap Confirm if this code matches.","connect.pair.sasPrompt":"Confirm this code matches the one shown on your computer:","connect.pair.startOver":"Start over","connect.pair.submit":"Pair","connect.error.selectFailed":"Couldn't reach that computer. Your saved session may have expired, or it's offline — pair again below.","connect.error.invalidCode":"That pairing code doesn't look right. Check it and try again.","demo.banner":"Demo mode — watch the product walkthrough.","demo.exit":"Exit demo","demo.videoDescription":"A full walkthrough of starting Hive, adding agents, and watching the team coordinate in one browser workspace.","demo.videoEyebrow":"Demo video","demo.videoOpen":"Open on Bilibili","demo.videoTitle":"See Hive run end to end","firstRun.addWorkspace":"Add Workspace","firstRun.back":"Back","firstRun.desc":"Coordinate multiple CLI coding agents — locally.","firstRun.getStarted":"Get started","firstRun.howItWorks":"How it works","firstRun.next":"Next","firstRun.optionDesc":"Choose how you want to begin.","firstRun.slide1Desc":"Pick a project folder.","firstRun.slide1Title":"Add a Workspace","firstRun.slide2Desc":"Antigravity CLI, Claude Code, Codex, Gemini, OpenCode, Hermes, Qwen Code — your choice.","firstRun.slide2Title":"Pick an Orchestrator","firstRun.slide3Desc":"The Orchestrator dispatches `team send <worker> <task>` to team members.","firstRun.slide3Title":"Dispatch tasks","firstRun.skip":"Skip","firstRun.skipForNow":"Skip for now","firstRun.step":"Step {current} of {total}","firstRun.subtitle":"Each Workspace runs an Orchestrator that dispatches tasks to team members.","firstRun.title":"Welcome to Hive","firstRun.tryDemo":"Try Demo","language.aria":"Switch language","language.currentEn":"EN","language.currentZh":"中","language.en":"EN","language.switchToEn":"Switch language to English","language.switchToZh":"Switch language to 中文","language.tooltip":"Language","language.zh":"中文","marketplace.allCategories":"All","marketplace.backToList":"Back to list","marketplace.close":"Close marketplace","marketplace.empty":"No matching agents","marketplace.importButton":"Fill into form","marketplace.importedBadge":"You have a saved template with this name","marketplace.loading":"Loading…","marketplace.imported":"Filled the form from {name}","marketplace.loadFailed":"Failed to load marketplace","marketplace.openFromAddWorker":"Browse marketplace","marketplace.searchPlaceholder":"Search agents…","marketplace.showAllCategories":"Show {count} more categories","marketplace.showCoreOnly":"Show core only","marketplace.sourceLabel":"Curated from {repo}","marketplace.title":"Template marketplace","marketplace.viewSource":"View on GitHub","mobile.nav.aria":"Main navigation","mobile.focus.enter":"Focus the terminal (hide navigation)","mobile.focus.exit":"Show navigation","mobile.nav.flows":"Flows","mobile.nav.more":"More","mobile.nav.settings":"Settings","mobile.nav.tasks":"Tasks","mobile.nav.team":"Team","mobile.reconnect.disconnected":"Disconnected.","mobile.reconnect.reconnecting":"Reconnecting…","mobile.reconnect.retry":"Retry","mobile.reconnect.revoked":"Access revoked — re-pair this device from your computer.","mobile.section.about":"About","mobile.section.demo":"Demo","mobile.section.devices":"Devices","mobile.section.settings":"Settings","mobile.section.workflows":"Workflows","mobile.section.workspaces":"Workspaces","mobile.tasks.noWorkspaceDesc":"Pick or add a workspace to see its task graph.","mobile.tasks.noWorkspaceTitle":"No workspace selected","mobile.team.orchestrator":"Orchestrator","mobile.team.workers":"Workers","mobile.workspaces.switch":"Switch workspace","openWorkspace.error.appNotInstalled":"Couldn't find {app}. Make sure it's installed and reachable.","openWorkspace.error.commandNotInPath":"Couldn't run the launcher for {app}. Add its CLI to your PATH and retry.","openWorkspace.error.invalidPath":"The workspace path contains characters that are unsafe to launch.","openWorkspace.error.invalidTarget":"That app is no longer a supported open target.","openWorkspace.error.unknown":"Couldn't open in {app}.","openWorkspace.noWorkspace":"Select a workspace to enable","openWorkspace.open":"Open","openWorkspace.opened":"Opened {workspace} in {app} on your computer","openWorkspace.openIn":"Open {workspace} in {app}","openWorkspace.openInAria":"Open workspace {workspace} in {app}","openWorkspace.selectTarget":"Choose app","openWorkspace.target.cursor":"Cursor","openWorkspace.target.finder.linux":"File Manager","openWorkspace.target.finder.mac":"Finder","openWorkspace.target.finder.windows":"File Explorer","openWorkspace.target.ghostty":"Ghostty","openWorkspace.target.terminal":"Terminal","openWorkspace.target.vscode":"VS Code","openWorkspace.target.vscodeInsiders":"VS Code Insiders","openWorkspace.target.zed":"Zed","orchestrator.copyErrorAria":"Copy error message","orchestrator.failed":"Orchestrator failed to start","orchestrator.removeWorkspace":"Remove workspace","orchestrator.start":"Start Orchestrator","orchestrator.stop":"Stop Orchestrator","orchestrator.startingDesc":"Preparing the Orchestrator terminal.","orchestrator.startingTitle":"Starting Orchestrator","orchestrator.stoppedDesc":"Start the Orchestrator to plan tasks and dispatch them to team members.","orchestrator.stoppedTitle":"Orchestrator is stopped","role.coder":"Coder","role.custom":"Custom","role.reviewer":"Reviewer","role.sentinel":"Sentinel","role.tester":"Tester","runtime.retryNow":"Retry now","runtime.staleBody":"Writes are paused until Hive reconnects to the local runtime.","runtime.staleTitle":"Hive runtime connection lost","runtime.writeDisabled":"Hive runtime connection lost; retry once it is back.","sidebar.deleteAria":"Delete Workspace {name}","sidebar.deleteConfirm":'Delete Workspace "{name}"?',"sidebar.deleteDescription":"This stops its agents and removes it from Hive. The folder on disk ({path}) is left untouched. {summary}.","sidebar.deleteFailed":"Failed to delete: {message}","sidebar.deleteLabel":"Delete Workspace","sidebar.deleting":"Deleting…","sidebar.dismissRepository":"Hide the GitHub link","sidebar.noMembers":"no team members yet","sidebar.newWorkspace":"New Workspace","sidebar.noWorkspaces":"No Workspaces","sidebar.noWorkspacesDesc":"Add one to start. Hive will load .hive/tasks.md and start the Orchestrator.","sidebar.oneWorking":"One team member working","sidebar.demoVideo":"Demo video","sidebar.openDemoVideo":"Watch the Hive demo video","sidebar.openRepository":"Open the Hive GitHub repository","sidebar.removed":'Removed Workspace "{name}".',"sidebar.teamMemberCount":"{count} team members","sidebar.workingCount":"{working} of {total} working","sidebar.workingMembers":"{count} team members working","sidebar.workspaces":"Workspaces","shellTerminal.closeFailed":"Failed to close shell: {message}","shellTerminal.open":"Terminal","shellTerminal.openAria":"Open workspace terminal","pairing.awaitingConfirm":"Confirm on your computer to finish pairing.","pairing.cancel":"Cancel","pairing.connecting":"Connecting to your computer…","pairing.failed.expired":"Pairing expired — start again.","pairing.failed.mintForbidden":"Pairing was not confirmed on your computer.","pairing.failed.rejected":"Pairing was rejected.","pairing.failed.socket":"Lost the connection before pairing finished.","pairing.failed.version":"This phone and computer are on different versions.","pairing.handshaking":"Verifying…","pairing.paired":"Paired.","pairing.sasPrompt":"Check that this code matches the one on your computer:","pwa.appShellUpdated":"Web UI updated","pwa.reloadToActivate":"Reload to activate","pwa.reloading":"Reloading…","pwa.runtimeOffline.autoReconnect":"Auto-reconnect on — Hive will reload when the runtime is back.","pwa.runtimeOffline.body":"Start the Hive daemon by running `hive` in a terminal.","pwa.runtimeOffline.retry":"Retry now","pwa.runtimeOffline.retrying":"Retrying…","pwa.runtimeOffline.title":"Hive runtime is not running","pwa.runtimeOffline.tryDemo":"Try Demo instead","pwa.waitForAgents":"Wait for agents to finish","remote.addDevice":"Add device","remote.audit.bytes":"{count} bytes","remote.audit.empty":"No remote activity yet.","remote.audit.heading":"Remote activity","remote.audit.hide":"Hide activity","remote.audit.loadFailed":"Could not load activity.","remote.audit.result.error":"error","remote.audit.result.ok":"ok","remote.audit.result.rejected":"rejected","remote.audit.show":"Show activity","remote.connect.connecting":"Connecting…","remote.connect.disconnected":"Disconnected","remote.connect.online":"Connected","remote.connect.reconnecting":"Reconnecting…","remote.connect.sessionExpired":"Session expired — sign in again.","remote.confirm.confirm":"Confirm","remote.confirm.confirming":"Confirming…","remote.confirm.description":"A phone is trying to pair as “{name}”. Compare this code with the one shown on the phone — they must match.","remote.confirm.expired":"Pairing request expired.","remote.confirm.failed":"Could not complete — try pairing again.","remote.confirm.paired":"Paired “{name}”.","remote.confirm.reject":"Reject","remote.confirm.rejected":"Pairing rejected.","remote.confirm.sasLabel":"Verification code","remote.confirm.title":"Confirm new device","remote.confirm.warning":"Only confirm if you started this and the codes match.","remote.devices.activeNow":"Active just now","remote.devices.empty":"No paired devices yet.","remote.devices.heading":"Paired devices","remote.devices.lastActive":"Active {ago} ago","remote.devices.loadFailed":"Could not load devices.","remote.devices.neverActive":"Not active yet","remote.devices.revoke":"Revoke","remote.devices.revokeAria":"Revoke device {name}","remote.devices.revokeConfirm":"Revoke “{name}”? Its open sessions close immediately and it must pair again.","remote.devices.revokeFailed":"Could not revoke — try again.","remote.devices.revokeTitle":"Revoke device","remote.devices.revoked":"Revoked “{name}”.","remote.diagnostics.copy":"Copy diagnostics","remote.diagnostics.copied":"Diagnostics copied","remote.diagnostics.copyFailed":"Could not copy diagnostics.","remote.diagnostics.copying":"Copying...","remote.disable.confirmBody":"Remote devices (including this one) will disconnect immediately. You can only re-enable it from the desktop.","remote.disable.confirmTitle":"Turn off remote access?","remote.enable.description":"Reach this machine from your phone over an end-to-end encrypted tunnel. Off by default.","remote.enable.label":"Remote access","remote.qr.cancel":"Cancel","remote.qr.expired":"Code expired — generate a new one.","remote.qr.expiresIn":"Expires in {seconds}s","remote.qr.instructions":"Enter this code on your phone. Keep this open until you confirm here.","remote.qr.regenerate":"New code","remote.qr.startFailed":"Could not start pairing — try again.","remote.qr.title":"Pairing code","remote.section":"Remote access","remote.status.connected":"Tunnel connected","remote.status.disconnected":"Tunnel offline","remote.status.linked":"Linked to {gateway}","remote.status.notLinked":"Not linked — run `hive remote login` in a terminal.","remote.status.connecting":"Connecting to the gateway…","remote.status.reconnecting":"Reconnecting…","remote.status.revoked":"Access revoked — re-link to restore remote access.","scenario.applied":"Team assembled — the goal is with the Orchestrator","scenario.apply":"Assemble team & start","scenario.applying":"Assembling…","scenario.build_review_test.desc":"Coder + Reviewer + Tester running a build–review–verify loop.","scenario.build_review_test.title":"Build · Review · Test","scenario.cancel":"Cancel","scenario.docs_pipeline.desc":"A drafter writes the doc, a doc reviewer checks facts and flow.","scenario.docs_pipeline.title":"Docs pipeline","scenario.goalHint":"Sent to the Orchestrator — it dispatches with team send/team spawn, or uses team workflow for staged or 3+ worker work.","scenario.goalLabel":"Goal","scenario.research_factcheck.desc":"A researcher gathers sourced findings, a fact-checker verifies them.","scenario.research_factcheck.title":"Research & Fact-check","scenario.sectionTitle":"Or start with a scenario team","settings.aria":"Settings","settings.autostaff.description":"Let the orchestrator size the team to each task — spawn the right mix of coders / testers / reviewers. On by default.","settings.autostaff.label":"Auto-staff team","settings.experimental":"Experimental","settings.language":"Language","settings.heading":"Settings","settings.notifications":"Notifications","settings.subtitle":"Features, webhooks, and remote access.","settings.saveError":"Could not save — check the runtime connection and try again.","settings.tooltip":"Settings","settings.webhook.description":"POST a small JSON payload to this URL when a worker reports or a workflow finishes — wire it to Slack, ntfy, Feishu, etc. Best-effort; the runtime sends to whatever URL you set, so keep it private.","settings.webhook.label":"Completion webhook","settings.webhook.saved":"Saved","settings.workflows.description":"Let the orchestrator author and run multi-agent workflows (`team workflow`). Off by default.","settings.workflows.label":"Workflows","topbar.hideTodo":"Hide Tasks","topbar.openWebsite":"Open hivehq.dev","topbar.showTodo":"Show Tasks (.hive/tasks.md)","topbar.todo":"Tasks","topbar.todoOpen":"Tasks — {count} open tasks","topbar.updateAvailable":"Update available","topbar.hideMemory":"Hide Memory","topbar.showMemory":"Show Memory","topbar.memory":"Memory","topbar.hideWorkflows":"Hide Workflows","topbar.showWorkflows":"Show Workflows","topbar.workflows":"Workflows","memory.title":"Memory","memory.subtitle":"Workspace knowledge, Dream runs, and injection controls","memory.searchPlaceholder":"Search...","memory.tabActive":"Active","memory.tabArchived":"Archived","memory.tabDreams":"Dreams","memory.runNow":"Run now","memory.injection":"Memory injection","memory.dreamProcessing":"Dream processing","memory.emptyActive":"No memory entries","memory.emptyActiveDesc":"Entries appear here after the orchestrator adds memory or Dream extracts it.","memory.emptyDreams":"No dream runs yet","memory.emptyDreamsDesc":"Run history appears after a manual or scheduled Dream pass.","memory.archiveTitle":"Archive Memory","memory.archiveDesc":"Archived memory stops appearing in startup, recovery, and dispatch injection.","memory.archiveButton":"Archive","memory.revertTitle":"Revert Dream Run","memory.revertDesc":"This restores the memory rows changed by the selected Dream run and archives entries it added.","memory.revertButton":"Revert","memory.sources":"Sources","memory.noSources":"No source evidence.","memory.updated":"Updated {time}","memory.injected":"Injected {time}","memory.started":"Started {time}","memory.finished":"Finished {time}","memory.revertTooltip":"Revert dream run","memory.status.pending":"pending","memory.status.running":"running","memory.status.completed":"completed","memory.status.failed":"failed","memory.status.reverted":"reverted","memory.trigger.manual":"manual","memory.trigger.cron":"scheduled","memory.trigger.scheduled":"scheduled","memory.noReport":"No report","memory.noInput":"No input","memory.seq":"Seq","memory.reportAdded":"added","memory.reportRewritten":"rewritten","memory.reportArchived":"archived","memory.reportMerged":"merged","memory.diff.added":"Added","memory.diff.rewritten":"Rewritten","memory.diff.archived":"Archived","memory.diff.merged":"Merged","memory.pinned":"Pinned","memory.disabled":"Disabled","memory.unpinTooltip":"Unpin","memory.pinTooltip":"Pin","memory.enableTooltip":"Enable","memory.disableTooltip":"Disable","memory.entries":"entries","memory.runs":"runs","memory.kind.decision":"Decision","memory.kind.fact":"Fact","memory.kind.pitfall":"Pitfall","memory.kind.preference":"Preference","memory.kind.procedure_ref":"Procedure","tasks.title":"Tasks","tasks.subtitle":"Project todo list parsed from .hive/tasks.md","tasks.editMarkdown":"Edit Markdown","tasks.save":"Save","tasks.local":"Keep Local","tasks.reload":"Reload","tasks.noTasks":"No task entries","tasks.noTasksDesc":"Orchestrators parse task items formatted as checkboxes from tasks.md.","workflows.title":"Workflows","workflows.subtitle":"Multi-agent workflows, dispatches, and logs","workflows.description":"Hive workflows are authored and run by the Orchestrator via team workflow run --stdin (recurring runs go through team workflow schedule). Native CLI subagents/workflows do not appear here; this panel observes Hive phases, workers, logs, and schedule controls.","workflows.recentRuns":"Recent runs","workflows.filterAll":"All","workflows.filterRunning":"Running","workflows.filterFailed":"Failed","workflows.emptyRuns":"No runs yet","workflows.emptyRunsDesc":"Ask the Orchestrator to run a Hive workflow for work that fans out across multiple workers.","workflows.emptyFilter":"No runs matching this filter.","workflows.schedules":"Schedules","workflows.noAgents":"No agent() calls in this run.","workflows.narrator":"Narrator ({count} lines)","workflows.narratorOne":"Narrator (1 line)","workflows.runError":"Run error: {error}","workflows.stopTooltip":"Stop run","workflows.deleteScheduleTooltip":"Delete schedule","workflows.pauseTooltip":"Pause","workflows.resumeTooltip":"Resume","workflows.loading":"Loading…","workflows.status.pending":"pending","workflows.status.running":"running","workflows.status.completed":"completed","workflows.status.failed":"failed","workflows.status.interrupted":"interrupted","workflows.status.stopped":"stopped","workflows.dispatchStatus.queued":"queued","workflows.dispatchStatus.submitted":"submitted","workflows.dispatchStatus.reported":"reported","workflows.dispatchStatus.cancelled":"cancelled","workflows.dispatchStatus.awaitingReport":"awaiting report…","workflows.cli.title":"Workflow agent CLI","workflows.cli.desc":"Which CLI a workflow agent launches when its script doesn't name one, and which CLIs are allowed. Custom role templates keep their own CLI.","workflows.cli.default":"Default","workflows.cli.allowed":"Allowed","workflows.cli.saving":"Saving…","workflows.cli.save":"Save","workflows.cli.pickOne":"Pick at least one CLI","workflows.cli.saved":"Saved","workflows.cli.failed":"Failed to save","welcome.addWorkspace":"Add your first Workspace","welcome.demo":"or try the demo (no install needed)","welcome.desc":"Coordinate Antigravity CLI, Claude Code, Codex, Gemini, OpenCode, Hermes, Qwen Code — locally.","welcome.step1Desc":"Pick a project folder.","welcome.step1Title":"Add a Workspace","welcome.step2Desc":"Antigravity / Claude / Codex / Gemini / OpenCode / Hermes / Qwen.","welcome.step2Title":"Choose an Orchestrator","welcome.step3Desc":"The Orchestrator routes work via team send.","welcome.step3Title":"Dispatch tasks","welcome.title":"Welcome to Hive","worker.deleteAria":"Delete team member {name}","worker.deleteConfirm":"Delete {name}?","worker.deleteDescription":"This stops {name}'s terminal and removes it from the workspace. All queued dispatches are dropped.","worker.deleteMember":"Delete member","worker.detail":"{name} detail","worker.emptyAdd":"Add your first member","worker.emptyDesc":"Add team members (Antigravity CLI, Claude Code, Codex, Gemini, OpenCode, Hermes, Qwen Code) and the Orchestrator will route tasks to them.","worker.emptyTitle":"No team members yet","worker.actionsAria":"Actions for {name}","worker.lastActivity":"Latest terminal output (a hint, not a reported reply).","worker.open":"Open {name}","worker.pendingResume":"{count} pending tasks will resume after restart.","worker.queued":"{count} queued","worker.queuedAria":"{count} pending dispatches in this worker’s queue.","worker.rename":"Rename","worker.renameAria":"Rename {name}","worker.restartAria":"Restart {name}","worker.renameDesc":"Pick a new display name. The agent's id and PTY are unchanged.","worker.renameFailed":"Rename failed: {message}","worker.renameSuccess":'Renamed to "{name}".',"worker.renameTitle":"Rename team member","worker.startAgent":"Start the agent to begin receiving dispatches.","worker.startAria":"Start {name}","worker.stopAria":"Stop {name}","worker.teamMembers":"Team members","worker.terminalNotStarted":"PTY not started yet — ","worker.terminalStopped":"PTY stopped — ","worker.widthResize":"Resize worker detail width","worker.workingLegend":"Working = busy or waiting for input. Hive doesn’t detect stalls automatically — open the terminal to check.","workerPane.resize":"Resize Orchestrator and Team Members panes","tasks.action.addSubtask":"Add subtask","tasks.action.backToList":"Back to list","tasks.action.closeTodo":"Close Tasks","tasks.action.copied":"Copied","tasks.action.copyLine":"Copy line","tasks.action.delete":"Delete","tasks.action.edit":"Edit","tasks.action.viewSource":"View source","tasks.aria.addSubtask":"Add subtask","tasks.aria.collapseSubtasks":"Collapse {count} subtasks","tasks.aria.copiedTaskLine":"Copied task line","tasks.aria.copyTaskLine":"Copy task line","tasks.aria.deleteTask":"Delete task","tasks.aria.drawer":"Tasks","tasks.aria.editTask":"Edit task","tasks.aria.expandSubtasks":"Expand {count} subtasks","tasks.aria.progress":"Task completion","tasks.button.addTask":"Add task","tasks.completed.toggle":"{count} completed","tasks.empty.description":"Ask the Orchestrator to split the work via team send/team spawn, or team workflow for staged or 3+ worker work — or add your first task to bootstrap .hive/tasks.md.","tasks.empty.title":"No tasks yet","tasks.placeholder.editTask":"Edit task","tasks.placeholder.newSubtask":"New subtask","tasks.placeholder.newTask":"What needs to be done?","tasks.progress.subtaskTitle":"{done} of {total} direct subtasks complete","tasks.raw.conflictDescription":"Reloading will discard the current draft; Keep local will continue editing it.","tasks.raw.conflictTitle":"File changed externally","tasks.raw.keepLocal":"Keep local","tasks.raw.label":"Tasks Markdown","tasks.raw.lineCount":"{count} lines","tasks.raw.reload":"Reload","tasks.raw.save":"Save tasks","tasks.title.todo":"Tasks","notifications.desktop.aria":"Browser notifications","notifications.desktop.helper":"Use system notifications when permission is granted.","notifications.desktop.label":"Browser notifications","notifications.desktop.unsupported":"Not supported in this browser.","notifications.detail.brief.description":"Compact status line","notifications.detail.brief.label":"Brief","notifications.detail.detailed.description":"Workspace and queue context","notifications.detail.detailed.label":"Detailed","notifications.detail.sectionLabel":"Information","notifications.settings.aria":"Notification settings","notifications.settings.heading":"Notifications","notifications.settings.subtitle":"Choose how Hive alerts you when team members report or stop.","notifications.settings.tooltip":"Notifications","notifications.sound.beacon.description":"Distinct question tone","notifications.sound.beacon.label":"Signal","notifications.sound.cascade.description":"Layered success tone","notifications.sound.cascade.label":"Cascade","notifications.sound.chime.description":"Clean glass tap","notifications.sound.chime.label":"Glass","notifications.sound.longerBadge":"longer","notifications.sound.off.description":"Mute sounds","notifications.sound.off.label":"Off","notifications.sound.ping.description":"Tiny UI tick","notifications.sound.ping.label":"Tap","notifications.sound.previewAria":"Preview {label} sound","notifications.sound.resolve.description":"Longer completion cue","notifications.sound.resolve.label":"Done","notifications.sound.sectionLabel":"Sound","notifications.sound.soft.description":"Warm default chime","notifications.sound.soft.label":"Soft","notifications.test.brief":"Hive notifications are working.","notifications.test.button":"Test","notifications.test.detail":"Hive notifications are working with your selected sound and detail level.","notifications.test.title":"Hive notification test","notifications.remoteSession.brief":"{name} connected","notifications.remoteSession.detail":"{name} established a remote session.","notifications.remoteSession.title":"Remote device connected","notifications.toast.blocked":"Browser notifications are blocked.","notifications.toast.declined":"Browser notifications were not enabled.","notifications.toast.unsupported":"This browser does not support notifications.","notifications.workerReported.brief":"{name} reported","notifications.workerReported.detail":"{name} reported in {workspace}; {count} queued tasks remain.","notifications.workerReported.title":"Team member report","notifications.workerStarted.brief":"{name} started","notifications.workerStarted.detail":"{name} started in {workspace} as {role}.","notifications.workerStarted.title":"Team member started","notifications.workerStopped.brief":"{name} stopped","notifications.workerStopped.detail":"{name} stopped in {workspace}; {count} queued tasks remain.","notifications.workerStopped.title":"Team member stopped","workspace.add.manualHint":"Type or paste the absolute path to a project folder on your computer.","workspace.advanced.browse":"Advanced: browse server filesystem","workspace.advanced.pastePath":"Advanced: paste path","workspace.advanced.settings":"Advanced Options","workspace.advanced.startup":"Advanced: custom startup command","workspace.browse.breadcrumb":"Breadcrumb","workspace.browse.drivesAria":"Show all drives","workspace.browse.drivesRoot":"This PC","workspace.browse.empty":"This directory is empty.","workspace.browse.gitBadge":"git","workspace.browse.openAria":"Open {name}","workspace.browse.parentAria":"Go to parent directory","workspace.browse.root":"root: {path}","workspace.browse.rootLoading":"(loading)","workspace.browse.selected":"Selected","workspace.browse.title":"Browse server filesystem","workspace.browse.up":"up","workspace.confirm.create":"Create Workspace","workspace.confirm.description":"Hive will load .hive/tasks.md and start the Orchestrator here.","workspace.confirm.title":"Add Workspace","workspace.error.createFailed":"Failed to create workspace","workspace.error.createTitle":"Could not create workspace","workspace.error.outsideSandbox":"Picked folder is not inside the Hive sandbox. Use paste path.","workspace.error.pastePathInstead":"Paste path instead","workspace.error.pickerFailed":"Folder picker failed","workspace.field.absolutePath":"Absolute path","workspace.field.absolutePathPlaceholder":"C:\\path\\to\\project or /absolute/path","workspace.field.name":"Workspace name","workspace.field.nameDefaultPlaceholder":"my-project","workspace.field.path":"Path","workspace.field.pathEmptyPlaceholder":"(no folder picked — use paste path below)","workspace.field.startup":"Startup command","workspace.field.startupPlaceholder":"claude --resume <session-id>","workspace.git.detached":"detached","workspace.git.detected":"git repository detected","workspace.git.none":"No git repository at this path.","workspace.git.noneShort":"no git","workspace.git.short":"git · {branch}","workspace.picking.message":"Opening system folder picker…","workspace.picking.title":"Opening folder picker","workspace.preset.label":"Orchestrator CLI","workspace.preset.generic":"Generic command","workspace.preset.genericPreview":"custom startup command only","workspace.preset.genericRequiresStartup":"Generic command requires a startup command.","workspace.preset.installCopy":"Copy","workspace.preset.installCopyAria":"Copy install command","workspace.preset.installDocs":"Install guide","workspace.preset.installHint":"Install {name}:","workspace.preset.loadFailed":"Failed to load CLI presets; using server default.","workspace.preset.loading":"Loading CLI presets…","workspace.preset.noneAvailable":"No supported CLI agent was found on this machine. You can watch the demo first — no install needed.","workspace.preset.notFoundSuffix":" (not found)","workspace.preset.notInstalled":"{name} is not installed. Choose another CLI or add a custom startup command.","workspace.preset.optionsAria":"Orchestrator CLI options","workspace.preset.pathHelpBody":"Hive detects CLIs using the PATH of the shell that launched it. With nvm or a GUI launcher, that PATH can differ from your terminal. Quit Hive and re-run `hive` from a terminal where this CLI works.","workspace.preset.pathHelpTitle":"Installed it, but still shown as not found?","workspace.preset.tryDemo":"Try the demo first","workspace.yolo.notice":"Agents start in auto-approve mode: CLI permission prompts are skipped (e.g. `--dangerously-skip-permissions`), so an agent can run commands and edit files as you. The Stop button on each card halts a runaway agent.","workspace.startup.hint":"Overrides the preset for this Orchestrator. Runs in the workspace directory through your shell (bash/zsh/fish on POSIX, cmd.exe on Windows), so only paste commands you trust.","workspace.startup.hintShort":"Runs through your shell in the workspace directory. Only paste commands you trust.","demo.orchestratorLabel":"Orchestrator — pre-recorded","demo.readOnlyBadge":"DEMO read-only","layout.sidebarAria":"Workspace sidebar","layout.sidebarResizeAria":"Resize Workspace sidebar","layout.sidebarCollapse":"Collapse sidebar","layout.sidebarExpand":"Expand sidebar","terminal.composer.placeholder":"Type a command…","terminal.composer.send":"Send","terminal.composer.sendEnter":"Send ⏎","terminal.paste.button":"Paste","terminal.paste.cancel":"Cancel","terminal.paste.confirm":"Paste","terminal.paste.denied":"Clipboard access was denied — long-press the input to paste instead.","terminal.paste.lengthChars":"{count} characters","terminal.paste.preview":"Preview","terminal.paste.title":"Paste into terminal?","terminal.renderer.canvasFallbackNotice":"WebGL unavailable — using the canvas renderer.","terminal.scrollToBottom":"Jump to latest","terminal.statusConnecting":"Connecting","terminal.statusRunning":"Running","terminalPanel.closePanel":"Close terminal panel","terminalPanel.closeTab":"Close {name}","terminalPanel.maximize":"Maximize terminal panel","terminalPanel.newShell":"New shell","terminalPanel.resizeAria":"Resize terminal panel height","terminalPanel.restore":"Restore terminal panel","terminalPanel.tablistAria":"Workspace terminal tabs","terminalPanel.workerStopped":"{name} is stopped — start the member to attach a terminal.","terminalPanels.aria":"Terminal panels","toast.dismissAria":"Dismiss","whatsNew.gotIt":"Got it","whatsNew.subtitle":"Updates since you were last here","whatsNew.title":"What's New","whatsNew.versionLabel":"Version {version}","workspaceList.empty":"No Workspaces yet"},yE={"addWorker.agentCli":"Agent CLI","addWorker.agentNotFound":"未找到","addWorker.agentExists":"成员名字已存在","addWorker.cancel":"取消","addWorker.create":"添加成员","addWorker.creating":"创建中…","addWorker.customPlaceholder":"你是安全审查成员,重点关注鉴权和输入校验。用 team report 把发现交还给 Orchestrator。","addWorker.description":"选择角色和 CLI Agent。Orchestrator 会通过 {command} 分派任务。","addWorker.emptyInstructions":"补充角色说明","addWorker.enterName":"请输入名称","addWorker.genericAgent":"通用命令","addWorker.genericCommand":"仅使用启动命令","addWorker.loadingPresets":"正在加载预设…","addWorker.name":"名称","addWorker.namePlaceholder":"例如 鲁班","addWorker.modifiedFrom":"已修改 {role} 默认说明","addWorker.pickCliOrStartup":"请选择 CLI Agent,或填写启动命令","addWorker.random":"随机","addWorker.randomAria":"生成随机成员名","addWorker.randomTooltip":"随机来一个","addWorker.role":"角色","addWorker.roleInstructions":"角色说明","addWorker.roleInstructionsTitle":"会注入到 Agent 启动提示和每次派单中。Hive 的 team 协议保持不变,这里只影响角色行为。","addWorker.reset":"重置","addWorker.saveAsTemplate":"保存为模板","addWorker.startupCommand":"启动命令","addWorker.startupHelp":"可选。会在当前 Workspace 里通过当前 shell 运行(POSIX 上是 bash/zsh/fish,Windows 上是 cmd.exe)。适合自定义 Agent 或原生命令恢复会话,例如 {example}。","addWorker.startupOverrides":"覆盖 CLI 启动","addWorker.template":"已保存的模板","addWorker.templateClear":"不使用模板(空白 Custom)","addWorker.templateDeleteAria":"删除模板 {name}","addWorker.templateDeleteConfirm":'删除已保存的模板"{name}"?该操作无法撤销。',"addWorker.templateDeleteConfirmLabel":"删除","addWorker.templateDeleteTitle":"删除角色模板","addWorker.templateEmpty":"还没有已保存的模板。在下方填写角色说明并保存。","addWorker.templateNamePlaceholder":"模板名称","addWorker.templateNoMatch":"没有匹配的模板。","addWorker.templatePickPlaceholder":"选择已保存的模板…","addWorker.templateSaveConfirm":"保存","addWorker.templateSearchPlaceholder":"搜索模板","addWorker.title":"添加团队成员","addWorker.unavailable":"{name} 未安装","actionCenter.activity.cancelled":"{worker} 已取消 · {ago}","actionCenter.activity.queued":"{worker} 已排队 · {ago}","actionCenter.activity.reported":"{worker} 已汇报 · {ago}","actionCenter.activity.submitted":"{worker} 已开始 · {ago}","actionCenter.attention":"注意","actionCenter.attention.noWorkers":"还没有团队成员。","actionCenter.attention.remoteError":"远程请求在 {endpoint} 出错。","actionCenter.attention.remoteRejected":"远程请求在 {endpoint} 被拒绝:{reason}。","actionCenter.attention.stoppedWithQueue":"{worker} 已停止,但还有 {count} 个排队任务。","actionCenter.attention.waitingReport":"{worker} 已等待汇报 {minutes} 分钟。","actionCenter.collapse":"收起 Action Center","actionCenter.copyRecap":"复制战报","actionCenter.currentDispatch":"当前","actionCenter.expand":"展开 Action Center","actionCenter.latestReport":"汇报","actionCenter.loadFailed":"无法加载团队动态。","actionCenter.loading":"正在加载团队动态...","actionCenter.noActivity":"暂无团队动态。","actionCenter.noWorkerEvidence":"暂无活跃成员证据。","actionCenter.openCount":"{count} 个进行中","actionCenter.recapCopied":"战报已复制到剪贴板。","actionCenter.recapCopyFailed":"复制战报失败。","actionCenter.recent":"最近","actionCenter.reportCount":"{count} 条汇报","actionCenter.runningCount":"{count} 个运行中","actionCenter.stoppedWithQueue":"{count} 个停止但有队列","actionCenter.terminalHint":"终端","actionCenter.title":"Action Center","actionCenter.unknownWorker":"未知成员","actionCenter.waitingReports":"{count} 个等待汇报","actionCenter.workerStatus":"状态","actionCenter.workers":"成员","common.cancel":"取消","common.close":"关闭","common.never":"从未","common.error":"错误","common.closeDialog":"关闭对话框","common.time.sAgo":"{count} 秒前","common.time.mAgo":"{count} 分钟前","common.time.hAgo":"{count} 小时前","common.time.dAgo":"{count} 天前","common.copied":"已复制","common.copyError":"复制错误","common.delete":"删除","common.idle":"空闲","common.loading":"加载中…","common.refresh":"刷新","common.restart":"重启","common.retry":"重试","common.running":"运行中","common.save":"保存","common.saving":"保存中…","common.start":"启动","common.starting":"启动中…","common.stop":"停止","common.stopped":"已停止","common.working":"工作中","connect.login.failed":"登录失败——请检查网络后重试。","connect.login.heading":"连接到你的 Hive","connect.login.subtitle":"登录后即可访问你账号下正在运行 Hive 的电脑。","connect.login.github":"使用 GitHub 登录","connect.login.google":"使用 Google 登录","connect.login.signingIn":"登录中…","connect.machines.back":"返回","connect.machines.connecting":"连接中…","connect.machines.heading":"你的电脑","connect.machines.empty":"还没有电脑。在电脑上运行 Hive 并开启远程访问。","connect.machines.lastSeen":"{ago}前在线","connect.machines.manageDevices":"管理设备","connect.machines.offline":"离线","connect.machines.online":"在线","connect.machines.revoked":"访问已被吊销","connect.machines.revokedHint":"此设备的访问已被吊销——请输入新的配对码重新连接。","connect.machines.select":"连接","connect.pair.back":"返回","connect.pair.finalizing":"已确认——正在准备会话…","connect.pair.guideHeading":"配对这台手机","connect.pair.guideStep1":"在那台电脑上,打开 设置 → 远程访问。","connect.pair.guideStep2":"点击添加设备,并保持配对码可见。","connect.pair.guideStep3":"在下面输入那个配对码。","connect.pair.qrLabel":"配对码","connect.pair.sasInstruction":"在你的电脑上,打开 设置 → 远程访问,确认验证码一致后点击确认。","connect.pair.sasPrompt":"确认此验证码与电脑上显示的一致:","connect.pair.startOver":"重新开始","connect.pair.submit":"配对","connect.error.selectFailed":"无法连接那台电脑。你保存的会话可能已失效,或它已离线 —— 请在下方重新配对。","connect.error.invalidCode":"这个配对码看起来不对,请检查后重试。","demo.banner":"演示模式 — 观看完整产品演示。","demo.exit":"退出演示","demo.videoDescription":"从启动 Hive、添加 Agent,到观察团队在浏览器工作台里协作,一镜到底看完整流程。","demo.videoEyebrow":"演示视频","demo.videoOpen":"在 Bilibili 打开","demo.videoTitle":"一镜到底,看 Hive 跑起来","firstRun.addWorkspace":"添加 Workspace","firstRun.back":"返回","firstRun.desc":"在本地协调多个 CLI 编码 Agent。","firstRun.getStarted":"开始使用","firstRun.howItWorks":"工作方式","firstRun.next":"下一步","firstRun.optionDesc":"选择一个开始方式。","firstRun.slide1Desc":"选择一个项目目录。","firstRun.slide1Title":"添加 Workspace","firstRun.slide2Desc":"Antigravity CLI、Claude Code、Codex、Gemini、OpenCode、Hermes、Qwen Code,任选。","firstRun.slide2Title":"选择 Orchestrator","firstRun.slide3Desc":"Orchestrator 通过 `team send <worker> <task>` 向团队成员派单。","firstRun.slide3Title":"分派任务","firstRun.skip":"跳过","firstRun.skipForNow":"暂时跳过","firstRun.step":"第 {current} / {total} 步","firstRun.subtitle":"每个 Workspace 运行一个 Orchestrator,再把任务派给团队成员。","firstRun.title":"欢迎使用 Hive","firstRun.tryDemo":"试用演示","language.aria":"切换语言","language.currentEn":"EN","language.currentZh":"中","language.en":"EN","language.switchToEn":"切换语言到 English","language.switchToZh":"切换语言到中文","language.tooltip":"语言","language.zh":"中文","marketplace.allCategories":"全部","marketplace.backToList":"返回列表","marketplace.close":"关闭模板市场","marketplace.empty":"没有匹配的角色","marketplace.importButton":"填入表单","marketplace.importedBadge":"本地已有同名模板","marketplace.loading":"加载中…","marketplace.imported":"已把 {name} 填入表单","marketplace.loadFailed":"加载失败","marketplace.openFromAddWorker":"从模板市场选择","marketplace.searchPlaceholder":"搜索角色…","marketplace.showAllCategories":"显示其他 {count} 个分类","marketplace.showCoreOnly":"只看核心分类","marketplace.sourceLabel":"由 {repo} 提供","marketplace.title":"模板市场","marketplace.viewSource":"在 GitHub 查看","mobile.nav.aria":"主导航","mobile.focus.enter":"专注终端(隐藏导航)","mobile.focus.exit":"显示导航","mobile.nav.flows":"工作流","mobile.nav.more":"更多","mobile.nav.settings":"设置","mobile.nav.tasks":"任务","mobile.nav.team":"团队","mobile.reconnect.disconnected":"已断开。","mobile.reconnect.reconnecting":"正在重新连接…","mobile.reconnect.retry":"重试","mobile.reconnect.revoked":"访问已被吊销——请在电脑上重新配对此设备。","mobile.section.about":"关于","mobile.section.demo":"演示","mobile.section.devices":"设备","mobile.section.settings":"设置","mobile.section.workflows":"工作流","mobile.section.workspaces":"工作区","mobile.tasks.noWorkspaceDesc":"选择或添加一个工作区即可查看其任务图。","mobile.tasks.noWorkspaceTitle":"未选择工作区","mobile.team.orchestrator":"Orchestrator","mobile.team.workers":"成员","mobile.workspaces.switch":"切换工作区","openWorkspace.error.appNotInstalled":"未找到 {app},请确认已安装并可启动。","openWorkspace.error.commandNotInPath":"{app} 的命令行入口不可用,请把它的 CLI 加入 PATH 后重试。","openWorkspace.error.invalidPath":"workspace 路径包含无法安全启动的字符。","openWorkspace.error.invalidTarget":"该应用已不在支持的打开目标列表里。","openWorkspace.error.unknown":"在 {app} 中打开失败。","openWorkspace.noWorkspace":"请先选择一个 workspace","openWorkspace.open":"打开","openWorkspace.opened":"已在你的电脑上用 {app} 打开 {workspace}","openWorkspace.openIn":"用 {app} 打开 {workspace}","openWorkspace.openInAria":"用 {app} 打开 workspace {workspace}","openWorkspace.selectTarget":"选择应用","openWorkspace.target.cursor":"Cursor","openWorkspace.target.finder.linux":"文件管理器","openWorkspace.target.finder.mac":"访达","openWorkspace.target.finder.windows":"文件资源管理器","openWorkspace.target.ghostty":"Ghostty","openWorkspace.target.terminal":"终端","openWorkspace.target.vscode":"VS Code","openWorkspace.target.vscodeInsiders":"VS Code Insiders","openWorkspace.target.zed":"Zed","orchestrator.copyErrorAria":"复制错误信息","orchestrator.failed":"Orchestrator 启动失败","orchestrator.removeWorkspace":"移除 workspace","orchestrator.start":"启动 Orchestrator","orchestrator.stop":"停止 Orchestrator","orchestrator.startingDesc":"正在准备 Orchestrator 终端。","orchestrator.startingTitle":"Orchestrator 启动中","orchestrator.stoppedDesc":"启动 Orchestrator 后才能规划任务并分派给团队成员。","orchestrator.stoppedTitle":"Orchestrator 已停止","role.coder":"开发","role.custom":"自定义","role.reviewer":"审查","role.sentinel":"巡检","role.tester":"测试","runtime.retryNow":"立即重试","runtime.staleBody":"重新连接本地后端前,写操作已暂停。","runtime.staleTitle":"Hive 后端连接已断开","runtime.writeDisabled":"Hive 后端连接已断开,恢复后再重试。","sidebar.deleteAria":"删除 Workspace {name}","sidebar.deleteConfirm":'删除 Workspace "{name}"?',"sidebar.deleteDescription":"这会停止其中的 Agent,并从 Hive 移除它。磁盘目录({path})不会被删除。{summary}。","sidebar.deleteFailed":"删除失败:{message}","sidebar.deleteLabel":"删除 Workspace","sidebar.deleting":"删除中…","sidebar.dismissRepository":"隐藏 GitHub 链接","sidebar.noMembers":"还没有团队成员","sidebar.newWorkspace":"新建 Workspace","sidebar.noWorkspaces":"还没有 Workspace","sidebar.noWorkspacesDesc":"添加一个开始使用。Hive 会加载 .hive/tasks.md 并启动 Orchestrator。","sidebar.oneWorking":"1 个团队成员工作中","sidebar.demoVideo":"演示视频","sidebar.openDemoVideo":"观看 Hive 演示视频","sidebar.openRepository":"打开 Hive GitHub 仓库","sidebar.removed":'已移除 Workspace "{name}"。',"sidebar.teamMemberCount":"{count} 个团队成员","sidebar.workingCount":"{working} / {total} 工作中","sidebar.workingMembers":"{count} 个团队成员工作中","sidebar.workspaces":"Workspaces","shellTerminal.closeFailed":"关闭 shell 失败:{message}","shellTerminal.open":"终端","shellTerminal.openAria":"打开 workspace 终端","pairing.awaitingConfirm":"在电脑上确认以完成配对。","pairing.cancel":"取消","pairing.connecting":"正在连接你的电脑…","pairing.failed.expired":"配对已过期——请重新开始。","pairing.failed.mintForbidden":"电脑端尚未确认此次配对。","pairing.failed.rejected":"配对被拒绝。","pairing.failed.socket":"配对完成前连接已断开。","pairing.failed.version":"手机与电脑版本不一致。","pairing.handshaking":"校验中…","pairing.paired":"已配对。","pairing.sasPrompt":"请核对此验证码与电脑上显示的一致:","pwa.appShellUpdated":"Web UI 已更新","pwa.reloadToActivate":"刷新以应用","pwa.reloading":"正在刷新…","pwa.runtimeOffline.autoReconnect":"已开启自动重连——后端恢复后会自动刷新。","pwa.runtimeOffline.body":"在终端运行 `hive` 启动后端。","pwa.runtimeOffline.retry":"立即重试","pwa.runtimeOffline.retrying":"重试中…","pwa.runtimeOffline.title":"Hive 后端未启动","pwa.runtimeOffline.tryDemo":"改试用演示","pwa.waitForAgents":"等待 Agent 完成","remote.addDevice":"添加设备","remote.audit.bytes":"{count} 字节","remote.audit.empty":"还没有远程活动。","remote.audit.heading":"远程活动","remote.audit.hide":"隐藏活动","remote.audit.loadFailed":"无法加载活动记录。","remote.audit.result.error":"错误","remote.audit.result.ok":"成功","remote.audit.result.rejected":"已拒绝","remote.audit.show":"查看活动","remote.connect.connecting":"连接中…","remote.connect.disconnected":"已断开","remote.connect.online":"已连接","remote.connect.reconnecting":"重连中…","remote.connect.sessionExpired":"会话已过期 —— 请重新登录。","remote.confirm.confirm":"确认","remote.confirm.confirming":"确认中…","remote.confirm.description":"一台手机正尝试以“{name}”配对。请把这个码和手机上显示的对比 —— 两者必须一致。","remote.confirm.expired":"配对请求已过期。","remote.confirm.failed":"无法完成 —— 请重新配对。","remote.confirm.paired":"已配对“{name}”。","remote.confirm.reject":"拒绝","remote.confirm.rejected":"已拒绝配对。","remote.confirm.sasLabel":"校验码","remote.confirm.title":"确认新设备","remote.confirm.warning":"仅在你发起配对且两个码一致时确认。","remote.devices.activeNow":"刚刚活跃","remote.devices.empty":"还没有已配对的设备。","remote.devices.heading":"已配对设备","remote.devices.lastActive":"{ago}前活跃","remote.devices.loadFailed":"无法加载设备列表。","remote.devices.neverActive":"尚未活跃","remote.devices.revoke":"吊销","remote.devices.revokeAria":"吊销设备 {name}","remote.devices.revokeConfirm":"吊销“{name}”?它的会话会立即断开,需要重新配对。","remote.devices.revokeFailed":"吊销失败 —— 请重试。","remote.devices.revokeTitle":"吊销设备","remote.devices.revoked":"已吊销“{name}”。","remote.diagnostics.copy":"复制诊断信息","remote.diagnostics.copied":"诊断信息已复制","remote.diagnostics.copyFailed":"无法复制诊断信息。","remote.diagnostics.copying":"正在复制...","remote.disable.confirmBody":"远程设备(包括本设备)将立即断开。只能在桌面端重新开启。","remote.disable.confirmTitle":"关闭远程访问?","remote.enable.description":"通过端到端加密隧道从手机访问这台机器。默认关闭。","remote.enable.label":"远程访问","remote.qr.cancel":"取消","remote.qr.expired":"配对码已过期 —— 请重新生成。","remote.qr.expiresIn":"{seconds} 秒后过期","remote.qr.instructions":"在手机上输入这个配对码。在这里确认前请保持打开。","remote.qr.regenerate":"重新生成","remote.qr.startFailed":"无法开始配对 —— 请重试。","remote.qr.title":"配对码","remote.section":"远程访问","remote.status.connected":"隧道已连接","remote.status.disconnected":"隧道离线","remote.status.linked":"已连接到 {gateway}","remote.status.notLinked":"未连接 —— 在终端运行 `hive remote login`。","remote.status.connecting":"正在连接网关…","remote.status.reconnecting":"正在重连…","remote.status.revoked":"访问已被吊销 —— 重新连接以恢复远程访问。","scenario.applied":"团队已组建,目标已交给 Orchestrator","scenario.apply":"组队并开工","scenario.applying":"组队中…","scenario.build_review_test.desc":"Coder + Reviewer + Tester,实现—审查—验证闭环。","scenario.build_review_test.title":"开发 · 审查 · 测试","scenario.cancel":"取消","scenario.docs_pipeline.desc":"起草成员成文,审稿成员核对事实与表达。","scenario.docs_pipeline.title":"文档流水线","scenario.goalHint":"将以你的名义发给 Orchestrator——由它拆解任务并用 team send 派单。","scenario.goalLabel":"目标","scenario.research_factcheck.desc":"调研员收集带出处的发现,核查员逐条复核。","scenario.research_factcheck.title":"调研与核查","scenario.sectionTitle":"或从场景一键组队","settings.aria":"设置","settings.autostaff.description":"让 Orchestrator 按任务自动配置团队规模,动态补充合适的开发、测试和审查成员。默认开启。","settings.autostaff.label":"自动组队","settings.experimental":"实验性功能","settings.language":"语言","settings.heading":"设置","settings.notifications":"通知","settings.subtitle":"功能开关、Webhook 和远程访问。","settings.saveError":"保存失败 —— 检查 runtime 连接后重试。","settings.tooltip":"设置","settings.webhook.description":"worker 汇报或 workflow 完成时,向此 URL POST 一小段 JSON —— 可接入 Slack、ntfy、飞书等。尽力投递;runtime 会发往你填的任意 URL,请妥善保管。","settings.webhook.label":"完成通知 Webhook","settings.webhook.saved":"已保存","settings.workflows.description":"允许 orchestrator 编写并运行多 agent 工作流(team workflow)。默认关闭。","settings.workflows.label":"工作流","topbar.hideTodo":"隐藏任务","topbar.openWebsite":"访问官网 hivehq.dev","topbar.showTodo":"显示任务 (.hive/tasks.md)","topbar.todo":"任务","topbar.todoOpen":"任务 — {count} 个未完成","topbar.updateAvailable":"有新版本","topbar.hideMemory":"隐藏记忆","topbar.showMemory":"显示记忆","topbar.memory":"记忆","topbar.hideWorkflows":"隐藏工作流","topbar.showWorkflows":"显示工作流","topbar.workflows":"工作流","memory.title":"记忆","memory.subtitle":"工作区知识积累、Dream运行记录及注入配置","memory.searchPlaceholder":"搜索记忆...","memory.tabActive":"活跃中","memory.tabArchived":"已归档","memory.tabDreams":"Dream 运行记录","memory.runNow":"立即运行","memory.injection":"记忆注入","memory.dreamProcessing":"Dream 优化处理","memory.emptyActive":"暂无记忆条目","memory.emptyActiveDesc":"当 Orchestrator 添加记忆或 Dream 提取出知识后,此处会显示记录。","memory.emptyDreams":"暂无 Dream 运行记录","memory.emptyDreamsDesc":"在执行手动或定时的 Dream 优化后,此处将展示运行历史。","memory.archiveTitle":"归档记忆","memory.archiveDesc":"归档后的记忆将不再注入到启动、恢复以及 dispatch 阶段。","memory.archiveButton":"归档","memory.revertTitle":"撤销 Dream 运行","memory.revertDesc":"这将恢复由选定的 Dream 运行所修改的记忆行,并归档其新添加的条目。","memory.revertButton":"撤销","memory.sources":"来源证据","memory.noSources":"暂无来源证据。","memory.updated":"更新于 {time}","memory.injected":"注入于 {time}","memory.started":"启动于 {time}","memory.finished":"结束于 {time}","memory.revertTooltip":"撤销 Dream 运行效果","memory.status.pending":"排队中","memory.status.running":"进行中","memory.status.completed":"已完成","memory.status.failed":"已失败","memory.status.reverted":"已撤销","memory.trigger.manual":"手动触发","memory.trigger.cron":"定时计划","memory.trigger.scheduled":"定时计划","memory.noReport":"无报告","memory.noInput":"无输入","memory.seq":"序列号","memory.reportAdded":"新增","memory.reportRewritten":"已重写","memory.reportArchived":"已归档","memory.reportMerged":"已合并","memory.diff.added":"新增知识","memory.diff.rewritten":"重写知识","memory.diff.archived":"归档知识","memory.diff.merged":"合并知识","memory.pinned":"已置顶","memory.disabled":"已禁用","memory.unpinTooltip":"取消置顶","memory.pinTooltip":"置顶","memory.enableTooltip":"启用","memory.disableTooltip":"禁用","memory.entries":"条记录","memory.runs":"次运行记录","memory.kind.decision":"决议","memory.kind.fact":"事实","memory.kind.pitfall":"踩坑避雷","memory.kind.preference":"偏好","memory.kind.procedure_ref":"流程步骤","tasks.title":"任务清单","tasks.subtitle":"解析自项目内 .hive/tasks.md 的代办任务图","tasks.editMarkdown":"编辑 Markdown","tasks.save":"保存","tasks.local":"保留本地","tasks.reload":"重新加载","tasks.noTasks":"暂无任务条目","tasks.noTasksDesc":"Orchestrator 会从 tasks.md 中解析出复选框格式的任务项。","workflows.title":"工作流","workflows.subtitle":"多 Agent 工作流、分派任务与运行日志","workflows.description":"Hive 工作流由 Orchestrator 通过 team workflow run --stdin 编写并运行(循环任务会经过 team workflow schedule)。当前 CLI 内建的 subagent/workflow 不会出现在这里;此面板只观察 Hive 阶段、成员、日志和定时计划。","workflows.recentRuns":"最近运行","workflows.filterAll":"全部","workflows.filterRunning":"运行中","workflows.filterFailed":"已失败","workflows.emptyRuns":"暂无运行记录","workflows.emptyRunsDesc":"让 Orchestrator 为需要多个成员并行的任务启动 Hive workflow。","workflows.emptyFilter":"没有与此过滤条件匹配的运行记录。","workflows.schedules":"定时计划","workflows.noAgents":"本次运行没有调用任何 agent()。","workflows.narrator":"叙述器(共 {count} 行)","workflows.narratorOne":"叙述器(共 1 行)","workflows.runError":"运行错误:{error}","workflows.stopTooltip":"停止运行","workflows.deleteScheduleTooltip":"删除定时计划","workflows.pauseTooltip":"暂停","workflows.resumeTooltip":"恢复","workflows.loading":"加载中…","workflows.status.pending":"排队中","workflows.status.running":"运行中","workflows.status.completed":"已完成","workflows.status.failed":"已失败","workflows.status.interrupted":"已中断","workflows.status.stopped":"已停止","workflows.dispatchStatus.queued":"排队","workflows.dispatchStatus.submitted":"提交中","workflows.dispatchStatus.reported":"已报告","workflows.dispatchStatus.cancelled":"已取消","workflows.dispatchStatus.awaitingReport":"等待报告…","workflows.cli.title":"工作流 Agent 运行环境 (CLI)","workflows.cli.desc":"设置工作流中未指定运行环境的 Agent 默认使用的 CLI,以及允许被工作流调用的 CLI 列表。自定义成员模板使用其自身的 CLI 设定。","workflows.cli.default":"默认运行环境","workflows.cli.allowed":"允许调用的环境","workflows.cli.saving":"保存中…","workflows.cli.save":"保存","workflows.cli.pickOne":"请至少选择一个 CLI","workflows.cli.saved":"保存成功","workflows.cli.failed":"保存失败","welcome.addWorkspace":"添加第一个 Workspace","welcome.demo":"或试用演示(无需安装 CLI)","welcome.desc":"在本地协调 Antigravity CLI、Claude Code、Codex、Gemini、OpenCode、Hermes、Qwen Code。","welcome.step1Desc":"选择一个项目目录。","welcome.step1Title":"添加 Workspace","welcome.step2Desc":"Antigravity / Claude / Codex / Gemini / OpenCode / Hermes / Qwen。","welcome.step2Title":"选择 Orchestrator","welcome.step3Desc":"Orchestrator 通过 team send 分派任务。","welcome.step3Title":"分派任务","welcome.title":"欢迎使用 Hive","worker.deleteAria":"删除团队成员 {name}","worker.deleteConfirm":"删除 {name}?","worker.deleteDescription":"这会停止 {name} 的终端,并从 workspace 中移除它。排队任务会被丢弃。","worker.deleteMember":"删除成员","worker.detail":"{name} 详情","worker.emptyAdd":"添加第一个成员","worker.emptyDesc":"添加团队成员(Antigravity CLI、Claude Code、Codex、Gemini、OpenCode、Hermes、Qwen Code),Orchestrator 会分派任务。","worker.emptyTitle":"还没有团队成员","worker.actionsAria":"{name} 的操作","worker.lastActivity":"终端最新输出(仅供参考,不是汇报内容)。","worker.open":"打开 {name}","worker.pendingResume":"重启后会继续 {count} 个排队任务。","worker.queued":"{count} 个排队","worker.queuedAria":"该成员队列中有 {count} 个待处理派单。","worker.rename":"重命名","worker.renameAria":"重命名 {name}","worker.restartAria":"重启 {name}","worker.renameDesc":"选择新的显示名称。Agent id 和终端不会变化。","worker.renameFailed":"重命名失败:{message}","worker.renameSuccess":'已重命名为 "{name}"。',"worker.renameTitle":"重命名团队成员","worker.startAgent":"启动 Agent 后即可接收派单。","worker.startAria":"启动 {name}","worker.stopAria":"停止 {name}","worker.teamMembers":"团队成员","worker.terminalNotStarted":"终端未启动 — ","worker.terminalStopped":"终端已停止 — ","worker.widthResize":"调整成员详情宽度","worker.workingLegend":"工作中 = 忙碌或等待输入。Hive 不会自动检测卡死 —— 打开终端查看。","workerPane.resize":"调整 Orchestrator 和团队成员面板宽度","tasks.action.addSubtask":"添加子任务","tasks.action.backToList":"返回列表","tasks.action.closeTodo":"关闭任务清单","tasks.action.copied":"已复制","tasks.action.copyLine":"复制行","tasks.action.delete":"删除","tasks.action.edit":"编辑","tasks.action.viewSource":"查看源码","tasks.aria.addSubtask":"添加子任务","tasks.aria.collapseSubtasks":"折叠 {count} 个子任务","tasks.aria.copiedTaskLine":"已复制任务行","tasks.aria.copyTaskLine":"复制任务行","tasks.aria.deleteTask":"删除任务","tasks.aria.drawer":"任务清单","tasks.aria.editTask":"编辑任务","tasks.aria.expandSubtasks":"展开 {count} 个子任务","tasks.aria.progress":"任务完成度","tasks.button.addTask":"添加任务","tasks.completed.toggle":"{count} 个已完成","tasks.empty.description":"让 Orchestrator 拆分任务并用 team send/team spawn 派给成员,或手动加第一条任务来创建 .hive/tasks.md。","tasks.empty.title":"还没有任务","tasks.placeholder.editTask":"编辑任务","tasks.placeholder.newSubtask":"新建子任务","tasks.placeholder.newTask":"下一步要做什么?","tasks.progress.subtaskTitle":"已完成 {done} / {total} 个直接子任务","tasks.raw.conflictDescription":"重新载入会丢弃当前草稿;保留本地会继续编辑当前内容。","tasks.raw.conflictTitle":"文件已在外部变化","tasks.raw.keepLocal":"保留本地","tasks.raw.label":"任务 Markdown","tasks.raw.lineCount":"{count} 行","tasks.raw.reload":"重新载入","tasks.raw.save":"保存任务","tasks.title.todo":"任务","notifications.desktop.aria":"浏览器通知","notifications.desktop.helper":"授权后使用系统通知。","notifications.desktop.label":"浏览器通知","notifications.desktop.unsupported":"此浏览器不支持。","notifications.detail.brief.description":"一行状态摘要","notifications.detail.brief.label":"简略","notifications.detail.detailed.description":"包含 Workspace 和队列信息","notifications.detail.detailed.label":"详细","notifications.detail.sectionLabel":"信息","notifications.settings.aria":"通知设置","notifications.settings.heading":"通知","notifications.settings.subtitle":"选择团队成员汇报或停止时 Hive 的提醒方式。","notifications.settings.tooltip":"通知","notifications.sound.beacon.description":"清晰的提示音","notifications.sound.beacon.label":"信号","notifications.sound.cascade.description":"层次更丰富的完成音","notifications.sound.cascade.label":"瀑布","notifications.sound.chime.description":"干净的玻璃轻点","notifications.sound.chime.label":"玻璃","notifications.sound.longerBadge":"更长","notifications.sound.off.description":"静音","notifications.sound.off.label":"关闭","notifications.sound.ping.description":"很短的界面轻点","notifications.sound.ping.label":"轻点","notifications.sound.previewAria":"试听 {label} 声音","notifications.sound.resolve.description":"更长的完成提示","notifications.sound.resolve.label":"完成","notifications.sound.sectionLabel":"声音","notifications.sound.soft.description":"温和的默认提示","notifications.sound.soft.label":"轻柔","notifications.test.brief":"Hive 通知正常工作。","notifications.test.button":"测试","notifications.test.detail":"Hive 通知按你选择的声音和详情级别正常工作。","notifications.test.title":"Hive 通知测试","notifications.remoteSession.brief":"{name} 已连接","notifications.remoteSession.detail":"{name} 建立了远程会话。","notifications.remoteSession.title":"远程设备已连接","notifications.toast.blocked":"浏览器通知被屏蔽。","notifications.toast.declined":"未启用浏览器通知。","notifications.toast.unsupported":"此浏览器不支持通知。","notifications.workerReported.brief":"{name} 已汇报","notifications.workerReported.detail":"{name} 已在 {workspace} 汇报;还有 {count} 个排队任务。","notifications.workerReported.title":"团队成员汇报","notifications.workerStarted.brief":"{name} 已启动","notifications.workerStarted.detail":"{name} 已在 {workspace} 以 {role} 角色启动。","notifications.workerStarted.title":"团队成员已启动","notifications.workerStopped.brief":"{name} 已停止","notifications.workerStopped.detail":"{name} 已在 {workspace} 停止;还有 {count} 个排队任务。","notifications.workerStopped.title":"团队成员已停止","workspace.add.manualHint":"输入或粘贴你电脑上某个项目文件夹的绝对路径。","workspace.advanced.browse":"高级:浏览服务器文件系统","workspace.advanced.pastePath":"高级:粘贴路径","workspace.advanced.settings":"高级选项","workspace.advanced.startup":"高级:自定义启动命令","workspace.browse.breadcrumb":"面包屑","workspace.browse.drivesAria":"显示所有磁盘","workspace.browse.drivesRoot":"此电脑","workspace.browse.empty":"此目录为空。","workspace.browse.gitBadge":"git","workspace.browse.openAria":"打开 {name}","workspace.browse.parentAria":"返回上级目录","workspace.browse.root":"根目录:{path}","workspace.browse.rootLoading":"(加载中)","workspace.browse.selected":"已选择","workspace.browse.title":"浏览服务器文件系统","workspace.browse.up":"上级","workspace.confirm.create":"创建 Workspace","workspace.confirm.description":"Hive 会在此加载 .hive/tasks.md 并启动 Orchestrator。","workspace.confirm.title":"添加 Workspace","workspace.error.createFailed":"创建 Workspace 失败","workspace.error.createTitle":"无法创建 Workspace","workspace.error.outsideSandbox":"所选目录不在 Hive 沙盒内,请改用粘贴路径。","workspace.error.pastePathInstead":"改为粘贴路径","workspace.error.pickerFailed":"目录选择失败","workspace.field.absolutePath":"绝对路径","workspace.field.absolutePathPlaceholder":"C:\\path\\to\\project 或 /absolute/path","workspace.field.name":"Workspace 名称","workspace.field.nameDefaultPlaceholder":"my-project","workspace.field.path":"路径","workspace.field.pathEmptyPlaceholder":"(未选择目录 — 请使用下方粘贴路径)","workspace.field.startup":"启动命令","workspace.field.startupPlaceholder":"claude --resume <session-id>","workspace.git.detached":"游离 HEAD","workspace.git.detected":"检测到 git 仓库","workspace.git.none":"此路径下没有 git 仓库。","workspace.git.noneShort":"无 git","workspace.git.short":"git · {branch}","workspace.picking.message":"正在打开系统目录选择器…","workspace.picking.title":"正在打开目录选择器","workspace.preset.label":"Orchestrator CLI","workspace.preset.generic":"通用命令","workspace.preset.genericPreview":"仅使用自定义启动命令","workspace.preset.genericRequiresStartup":"通用命令需要填写启动命令。","workspace.preset.installCopy":"复制","workspace.preset.installCopyAria":"复制安装命令","workspace.preset.installDocs":"安装指南","workspace.preset.installHint":"安装 {name}:","workspace.preset.loadFailed":"加载 CLI 预设失败,使用服务器默认值。","workspace.preset.loading":"正在加载 CLI 预设…","workspace.preset.noneAvailable":"本机未检测到任何支持的 CLI agent。可以先看演示,无需安装。","workspace.preset.notFoundSuffix":"(未找到)","workspace.preset.notInstalled":"{name} 未安装。请选择其他 CLI 或填写启动命令。","workspace.preset.optionsAria":"Orchestrator CLI 选项","workspace.preset.pathHelpBody":"Hive 用启动它的那个 shell 的 PATH 探测 CLI。使用 nvm 或从图形界面启动时,该 PATH 可能与你的终端不同。请退出 Hive,在装有该 CLI 的终端里重新运行 `hive`。","workspace.preset.pathHelpTitle":"装了却显示未找到?","workspace.preset.tryDemo":"先看演示","workspace.yolo.notice":"Agent 默认以自动批准模式运行:CLI 的权限确认会被跳过(如 `--dangerously-skip-permissions`),agent 可以像你本人一样执行命令、修改文件。每张卡片上的 Stop 按钮可随时叫停失控的 agent。","workspace.startup.hint":"覆盖该 Orchestrator 的预设。通过当前 shell(POSIX 上是 bash/zsh/fish,Windows 上是 cmd.exe)在 Workspace 目录中运行,请只粘贴你信任的命令。","workspace.startup.hintShort":"通过当前 shell 在 Workspace 目录中运行。请只粘贴你信任的命令。","demo.orchestratorLabel":"Orchestrator — 预录数据","demo.readOnlyBadge":"演示 只读","layout.sidebarAria":"Workspace 侧栏","layout.sidebarResizeAria":"调整 Workspace 侧栏宽度","layout.sidebarCollapse":"收起侧栏","layout.sidebarExpand":"展开侧栏","terminal.composer.placeholder":"输入命令…","terminal.composer.send":"发送","terminal.composer.sendEnter":"发送 ⏎","terminal.paste.button":"粘贴","terminal.paste.cancel":"取消","terminal.paste.confirm":"粘贴","terminal.paste.denied":"剪贴板访问被拒绝——请长按输入框粘贴。","terminal.paste.lengthChars":"共 {count} 个字符","terminal.paste.preview":"预览","terminal.paste.title":"粘贴到终端?","terminal.renderer.canvasFallbackNotice":"WebGL 不可用——已改用 canvas 渲染器。","terminal.scrollToBottom":"回到底部","terminal.statusConnecting":"连接中","terminal.statusRunning":"运行中","terminalPanel.closePanel":"关闭终端面板","terminalPanel.closeTab":"关闭 {name}","terminalPanel.maximize":"最大化终端面板","terminalPanel.newShell":"新建 shell","terminalPanel.resizeAria":"调整终端面板高度","terminalPanel.restore":"还原终端面板","terminalPanel.tablistAria":"Workspace 终端标签","terminalPanel.workerStopped":"{name} 已停止——启动该成员后会自动连接终端。","terminalPanels.aria":"终端面板","toast.dismissAria":"关闭","whatsNew.gotIt":"知道了","whatsNew.subtitle":"上次使用以来的更新","whatsNew.title":"更新内容","whatsNew.versionLabel":"版本 {version}","workspaceList.empty":"还没有 Workspace"},bE={en:I0,zh:yE},wE=()=>{if(typeof window>"u")return"en";const t=xE();return t||(window.navigator.language.toLowerCase().startsWith("zh")?"zh":"en")},xE=()=>{try{const t=window.localStorage.getItem(q0);return vE(t)?t:null}catch{return null}},kE=t=>{try{window.localStorage.setItem(q0,t)}catch{}},P0=t=>(r,o={})=>(bE[t][r]??I0[r]??r).replace(/\{(\w+)\}/g,(l,c)=>{const f=o[c];return f===void 0?l:String(f)}),SE={language:"en",setLanguage:()=>{},t:P0("en")},K0=b.createContext(SE),EE=({children:t})=>{const[r,o]=b.useState(wE),i=b.useMemo(()=>({language:r,setLanguage:c=>{o(c),kE(c)},t:P0(r)}),[r]);return d.jsx(K0.Provider,{value:i,children:t})},Ee=()=>b.useContext(K0),CE=({onExit:t})=>{const{t:r}=Ee();return d.jsxs("section",{"aria-label":"Demo mode","data-testid":"demo-banner",className:"flex shrink-0 items-center justify-between border-b px-4 py-2 text-xs",style:{background:"var(--status-yellow-bg, #3a2c1c)",borderColor:"var(--border)"},children:[d.jsxs("div",{className:"flex items-center gap-2 text-pri",children:[d.jsx(H0,{size:14,"aria-hidden":!0}),d.jsx("span",{children:r("demo.banner")})]}),d.jsx("button",{type:"button",onClick:t,className:"icon-btn icon-btn--ghost",children:r("demo.exit")})]})},TE=({onExit:t})=>{const{t:r}=Ee();return d.jsxs("div",{className:"flex min-h-0 min-w-0 flex-1 flex-col",children:[d.jsx(CE,{onExit:t}),d.jsx("div",{className:"flex min-h-0 flex-1 items-center justify-center px-6 py-8",style:{background:"var(--bg-crust)"},children:d.jsxs("section",{className:"flex w-full max-w-5xl flex-col gap-5","data-testid":"demo-video-panel",children:[d.jsxs("div",{className:"max-w-2xl",children:[d.jsx("p",{className:"mono text-[10px] uppercase tracking-[0.22em] text-accent",children:r("demo.videoEyebrow")}),d.jsx("h1",{className:"mt-2 text-2xl font-semibold tracking-tight text-pri",children:r("demo.videoTitle")}),d.jsx("p",{className:"mt-2 text-sm text-sec",children:r("demo.videoDescription")})]}),d.jsx("div",{className:"overflow-hidden rounded-xl border shadow-[0_28px_90px_-42px_rgba(0,0,0,0.8)]",style:{borderColor:"var(--border-bright)",background:"var(--bg-0)"},children:d.jsx("div",{className:"relative aspect-video",children:d.jsx("iframe",{src:"https://player.bilibili.com/player.html?bvid=BV1UHLp6nEQR&page=1&as_wide=1&high_quality=1&danmaku=0&autoplay=0",title:r("demo.videoTitle"),allowFullScreen:!0,loading:"lazy",scrolling:"no",frameBorder:"0",className:"absolute inset-0 h-full w-full","data-testid":"demo-video-frame"})})}),d.jsx("a",{href:"https://www.bilibili.com/video/BV1UHLp6nEQR",target:"_blank",rel:"noreferrer",className:"self-center text-xs text-sec underline underline-offset-4 hover:text-pri",children:r("demo.videoOpen")})]})})]})},AE=(t,r={})=>{const o=new URL(t,window.location.href);o.protocol=o.protocol==="https:"?"wss:":"ws:";for(const[i,l]of Object.entries(r))l!==void 0&&o.searchParams.set(i,String(l));return o.toString()},_E={requiresUiSession:!0,fetch(t,r){return fetch(t,r)},openWebSocket(t,r){return new WebSocket(AE(t,r))}};let mo=_E;const NE=t=>{mo=t},F0=()=>mo,Y0=()=>mo.requiresUiSession!==!1,V0=t=>({id:t.id,name:t.name,role:t.role,status:t.status,pendingTaskCount:t.pending_task_count,...t.last_pty_line?{lastPtyLine:t.last_pty_line}:{},...t.command_preset_id?{commandPresetId:t.command_preset_id}:{},...t.ephemeral===!0?{ephemeral:!0}:{},...t.spawned_by?{spawnedBy:t.spawned_by}:{}}),Ne=async(t,r)=>{try{const o=await t.json();if(typeof o.error=="string"&&o.error.trim())return o.error}catch{}return r},jE=async t=>{if(t.status!==403)return!1;try{return(await t.clone().json()).error==="UI endpoint requires valid UI token"}catch{return!1}},G0=async()=>{if(!Y0())return;const t=await mo.fetch("/api/ui/session",{mode:"same-origin"});if(!t.ok)throw new Error("Failed to initialize UI session");await t.json()};let Id=null;const RE=()=>(Id??=G0().finally(()=>{Id=null}),Id),ve=async(t,r)=>{const o=await mo.fetch(t,r);return!Y0()||!await jE(o)?o:(await RE(),mo.fetch(t,r))},OE=async()=>{const t=await ve("/api/workspaces");if(!t.ok)throw new Error("Failed to load workspaces");return await t.json()},DE=async()=>{const t=await ve("/api/version");if(!t.ok)throw new Error("Failed to load version info");const r=await t.json();return{currentVersion:r.current_version,installHint:r.install_hint,latestVersion:r.latest_version,packageName:r.package_name,releaseUrl:r.release_url,updateAvailable:r.update_available}},$0=t=>({description:t.description,id:t.id,isBuiltin:t.is_builtin,name:t.name,roleType:t.role_type}),ME=t=>({name:t.name,role_type:t.roleType,description:t.description,default_command:"",default_args:[],default_env:{}}),LE=async t=>{const r=await ve("/api/workspaces",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(t)});if(!r.ok)throw new Error(await Ne(r,"Failed to create workspace"));return await r.json()},zE=async t=>{const r=await ve(`/api/workspaces/${t}`,{method:"DELETE"});if(!r.ok)throw new Error(await Ne(r,"Failed to delete workspace"))},zl=async(t,r)=>{const o=await ve(`/api/workspaces/${t}/agents/${r}/start`,{method:"POST"});if(!o.ok)throw new Error(await Ne(o,"Failed to start agent run"));return{runId:(await o.json()).run_id}},Hl=async t=>{if(!(await ve(`/api/runtime/runs/${t}/stop`,{method:"POST"})).ok)throw new Error("Failed to stop agent run")},HE=async(t,r,o)=>(await Hl(o).catch(i=>{console.error("[hive] swallowed:restartAgentRun.stop",i)}),zl(t,r)),BE=async()=>{const t=await ve("/api/settings/app-state/active_workspace_id");if(!t.ok)throw new Error("Failed to load active workspace");return(await t.json()).value},X0=async t=>{if(!(await ve("/api/settings/app-state/active_workspace_id",{method:"PUT",headers:{"content-type":"application/json"},body:JSON.stringify({value:t})})).ok)throw new Error("Failed to save active workspace")},Z0="notifications.webhook-url",WE=async()=>{const t=await ve(`/api/settings/app-state/${Z0}`);if(!t.ok)throw new Error("Failed to load webhook URL");return(await t.json()).value??""},UE=async t=>{if(!(await ve(`/api/settings/app-state/${Z0}`,{method:"PUT",headers:{"content-type":"application/json"},body:JSON.stringify({value:t.trim()})})).ok)throw new Error("Failed to save webhook URL")},fD=async()=>{const t=await ve("/api/settings/workflow-cli-policy");if(!t.ok)throw new Error("Failed to load workflow CLI policy");return await t.json()},mD=async t=>{const r=await ve("/api/settings/workflow-cli-policy",{method:"PUT",headers:{"content-type":"application/json"},body:JSON.stringify(t)});if(!r.ok)throw new Error("Failed to save workflow CLI policy");return await r.json()},qE=async()=>{const t=await ve("/api/settings/workflow-feature");if(!t.ok)throw new Error("Failed to load workflow feature flag");return await t.json()},IE=async t=>{const r=await ve("/api/settings/workflow-feature",{method:"PUT",headers:{"content-type":"application/json"},body:JSON.stringify({enabled:t})});if(!r.ok)throw new Error("Failed to save workflow feature flag");return await r.json()},PE=async()=>{const t=await ve("/api/settings/team-autostaff");if(!t.ok)throw new Error("Failed to load auto-staff feature flag");return await t.json()},KE=async t=>{const r=await ve("/api/settings/team-autostaff",{method:"PUT",headers:{"content-type":"application/json"},body:JSON.stringify({enabled:t})});if(!r.ok)throw new Error("Failed to save auto-staff feature flag");return await r.json()},FE=async t=>{const r=await ve(`/api/ui/workspaces/${t}/team`,{mode:"same-origin"});if(!r.ok)throw new Error("Failed to load workers");return(await r.json()).map(V0)},YE=async()=>{const t=await ve("/api/settings/command-presets");if(!t.ok)throw new Error("Failed to load command presets");return(await t.json()).map(r=>({args:r.args,available:r.available,command:r.command,displayName:r.display_name,id:r.id}))},VE=t=>`${t}:shell`,rc=(t,r)=>t.agent_id===VE(r),GE=async t=>{const r=await ve(`/api/workspaces/${t}/shell/start`,{method:"POST"});if(!r.ok)throw new Error(await Ne(r,"Failed to start workspace terminal"));return await r.json()},$E=async(t,r)=>{const o=await ve(`/api/workspaces/${t}/shell/${r}`,{method:"DELETE"});if(!o.ok)throw new Error(await Ne(o,"Failed to close workspace terminal"))},XE=async()=>{const t=await ve("/api/settings/role-templates",{mode:"same-origin"});if(!t.ok)throw new Error("Failed to load role templates");return(await t.json()).map($0)},ZE=async t=>{const r=await ve("/api/settings/role-templates",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(ME(t))});if(!r.ok)throw new Error(await Ne(r,"Failed to create role template"));return $0(await r.json())},QE=async t=>{const r=await ve(`/api/settings/role-templates/${t}`,{method:"DELETE"});if(!r.ok)throw new Error(await Ne(r,"Failed to delete role template"))},pD=async t=>{const r=await ve(`/api/marketplace/manifest?lang=${t}`,{mode:"same-origin"});if(!r.ok)throw new Error(await Ne(r,"Failed to load marketplace manifest"));return await r.json()},hD=async(t,r)=>{const o=await ve(`/api/marketplace/agent?lang=${t}&path=${encodeURIComponent(r)}`,{mode:"same-origin"});if(!o.ok)throw new Error(await Ne(o,"Failed to load marketplace agent"));return await o.json()},JE=async t=>{const r=await ve(`/api/ui/workspaces/${t}/runs`,{mode:"same-origin"});if(!r.ok)throw new Error("Failed to load terminal runs");return await r.json()},eC=async(t,r)=>{const o=await ve(`/api/workspaces/${t}/workers`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(r)});if(!o.ok)throw new Error(await Ne(o,"Failed to create worker"));const i=await o.json();return{agentStart:{error:i.agent_start?.error??null,ok:i.agent_start?.ok??!1,runId:i.agent_start?.run_id??null},worker:V0(i)}},tC=async(t,r,o)=>{const i=await ve(`/api/workspaces/${t}/scenarios/${encodeURIComponent(r)}/apply`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({goal:o})});if(!i.ok)throw new Error(await Ne(i,"Failed to assemble the scenario team"));return{createdWorkers:(await i.json()).created_workers}},nC=async(t,r)=>{const o=await ve(`/api/workspaces/${t}/workers/${r}`,{method:"DELETE"});if(!o.ok)throw new Error(await Ne(o,"Failed to delete worker"))},rC=async(t,r,o)=>{const i=await ve(`/api/workspaces/${t}/workers/${r}`,{body:JSON.stringify({name:o}),headers:{"content-type":"application/json"},method:"PATCH"});if(!i.ok)throw new Error(await Ne(i,"Failed to rename worker"))},aC=async t=>{const r=await ve(`/api/workspaces/${t}/tasks`);if(!r.ok)throw new Error("Failed to load tasks");return await r.json()},hl=async(t,r)=>{const o=await ve(`/api/workspaces/${t}/tasks`,{method:"PUT",headers:{"content-type":"application/json"},body:JSON.stringify(r)});if(!o.ok)throw new Error("Failed to save tasks");return await o.json()},gD=async t=>{const r=t?`?path=${encodeURIComponent(t)}`:"";return await(await ve(`/api/fs/browse${r}`,{mode:"same-origin"})).json()},vD=async t=>await(await ve(`/api/fs/probe?path=${encodeURIComponent(t)}`,{mode:"same-origin"})).json(),yD=async()=>await(await ve("/api/fs/pick-folder",{method:"POST",mode:"same-origin"})).json(),oC=async(t,r)=>{const o=await ve(`/api/workspaces/${t}/open`,{body:JSON.stringify({target_id:r}),headers:{"content-type":"application/json"},method:"POST"});if(o.status===200)return{ok:!0,effectiveTargetId:(await o.json()).effective_target_id};if(o.status===502){const i=await o.json();return{ok:!1,effectiveTargetId:i.effective_target_id,errorCode:i.error_code}}throw new Error(await Ne(o,"Failed to open workspace"))},sC=t=>({actorAgentIdSnapshot:t.actor_agent_id_snapshot,actorNameSnapshot:t.actor_name_snapshot,actorRoleSnapshot:t.actor_role_snapshot,createdAt:t.created_at,excerpt:t.excerpt,id:t.id,memoryId:t.memory_id,sourceId:t.source_id,sourceSequence:t.source_sequence,sourceType:t.source_type,textHash:t.text_hash}),ac=t=>({archivedAt:t.archived_at,body:t.body,confidence:t.confidence,createdAt:t.created_at,disabled:t.disabled,id:t.id,kind:t.kind,lastInjectedAt:t.last_injected_at,pinned:t.pinned,scope:t.scope,source:t.source,sources:t.sources.map(sC),status:t.status,tags:t.tags,updatedAt:t.updated_at,workspaceId:t.workspace_id}),iC=t=>({contextType:t.context_type,dispatchId:t.dispatch_id,id:t.id,injectedAt:t.injected_at,memory:ac(t.memory),memoryId:t.memory_id,targetAgentIdSnapshot:t.target_agent_id_snapshot,workspaceId:t.workspace_id}),bD=async(t,r={})=>{const o=new URLSearchParams;r.status&&o.set("status",r.status),r.query?.trim()&&o.set("query",r.query.trim()),r.limit!==void 0&&o.set("limit",String(r.limit));const i=o.size>0?`?${o}`:"",l=await ve(`/api/ui/workspaces/${t}/memory${i}`);if(!l.ok)throw new Error(await Ne(l,"Failed to load memory"));return(await l.json()).memories.map(ac)},wD=async(t,r,o)=>{const i=await ve(`/api/ui/workspaces/${t}/memory/${r}`,{body:JSON.stringify(o),headers:{"content-type":"application/json"},method:"PATCH"});if(!i.ok)throw new Error(await Ne(i,"Failed to update memory"));const l=await i.json();return ac(l.memory)},lC=async(t,r,o)=>{const i=await ve(`/api/ui/workspaces/${t}/memory/${r}/${o}`,{method:"POST"});if(!i.ok)throw new Error(await Ne(i,`Failed to ${o} memory`));const l=await i.json();return ac(l.memory)},xD=(t,r)=>lC(t,r,"archive"),um=t=>({error:t.error,finishedAt:t.finished_at,id:t.id,inputSeqFrom:t.input_seq_from,inputSeqTo:t.input_seq_to,report:t.report,startedAt:t.started_at,status:t.status,trigger:t.trigger,workspaceId:t.workspace_id}),kD=async(t,r={})=>{const o=new URLSearchParams;r.limit!==void 0&&o.set("limit",String(r.limit));const i=o.size>0?`?${o}`:"",l=await ve(`/api/ui/workspaces/${t}/memory/dream-runs${i}`);if(!l.ok)throw new Error(await Ne(l,"Failed to load dream runs"));return(await l.json()).runs.map(um)},SD=async t=>{const r=await ve(`/api/ui/workspaces/${t}/memory/dream-runs`,{body:JSON.stringify({}),headers:{"content-type":"application/json"},method:"POST"});if(!r.ok)throw new Error(await Ne(r,"Failed to run dream"));const o=await r.json();return um(o.run)},ED=async(t,r)=>{const o=await ve(`/api/ui/workspaces/${t}/memory/dream-runs/${r}/revert`,{body:JSON.stringify({}),headers:{"content-type":"application/json"},method:"POST"});if(!o.ok)throw new Error(await Ne(o,"Failed to revert dream run"));const i=await o.json();return um(i.run)},CD=async t=>{const r=await ve(`/api/ui/workspaces/${t}/memory/settings`);if(!r.ok)throw new Error(await Ne(r,"Failed to load memory settings"));const o=await r.json();return{dreamEnabled:o.dream_enabled,enabled:o.enabled}},TD=async(t,r)=>{const o=await ve(`/api/ui/workspaces/${t}/memory/settings`,{body:JSON.stringify({...r.dreamEnabled===void 0?{}:{dream_enabled:r.dreamEnabled},...r.enabled===void 0?{}:{enabled:r.enabled}}),headers:{"content-type":"application/json"},method:"PUT"});if(!o.ok)throw new Error(await Ne(o,"Failed to update memory settings"));const i=await o.json();return{dreamEnabled:i.dream_enabled,enabled:i.enabled}},AD=async(t,r)=>{const o=new URLSearchParams({dispatch_id:r}),i=await ve(`/api/ui/workspaces/${t}/memory/injections?${o}`);if(!i.ok)throw new Error(await Ne(i,"Failed to load memory injections"));return(await i.json()).injections.map(iC)},cC=t=>({id:t.id,workspaceId:t.workspace_id,scriptPath:t.script_path,name:t.name,status:t.status,startedAt:t.started_at,finishedAt:t.finished_at,error:t.error,phase:t.phase,result:t.result??null,args:t.args??null,agentCount:typeof t.agent_count=="number"?t.agent_count:0,parentRunId:t.parent_run_id??null}),_D=async t=>{const r=await ve(`/api/workspaces/${t}/workflows/runs`);if(!r.ok)throw new Error(await Ne(r,"Failed to list workflow runs"));return(await r.json()).runs.map(cC)},Q0=t=>({id:t.id,workspaceId:t.workspace_id,scriptPath:t.script_path,cron:t.cron,args:t.args,enabled:t.enabled,lastRunAt:t.last_run_at,nextRunAt:t.next_run_at,createdAt:t.created_at,updatedAt:t.updated_at}),ND=async t=>{const r=await ve(`/api/workspaces/${t}/workflow-schedules`);if(!r.ok)throw new Error(await Ne(r,"Failed to list workflow schedules"));return(await r.json()).schedules.map(Q0)},jD=async(t,r)=>{const o=await ve(`/api/workflow-schedules/${t}`,{body:JSON.stringify(r),headers:{"content-type":"application/json"},method:"PATCH"});if(!o.ok)throw new Error(await Ne(o,"Failed to update workflow schedule"));const i=await o.json();return Q0(i.schedule)},uC=t=>({id:t.id,workspaceId:t.workspace_id,fromAgentId:t.from_agent_id,toAgentId:t.to_agent_id,text:t.text,status:t.status,reportText:t.report_text,reportedAt:t.reported_at,createdAt:t.created_at,workflowRunId:t.workflow_run_id,stepIndex:t.step_index,phase:t.phase,label:t.label,...t.last_pty_line?{lastPtyLine:t.last_pty_line}:{}}),RD=async t=>{const r=await ve(`/api/workflows/runs/${t}/stop`,{method:"POST"});if(!r.ok)throw new Error(await Ne(r,"Failed to stop workflow run"))},OD=async t=>{const r=await ve(`/api/workflows/runs/${t}/dispatches`);if(!r.ok)throw new Error(await Ne(r,"Failed to load workflow run dispatches"));return(await r.json()).dispatches.map(uC)},DD=async t=>{const r=await ve(`/api/workflows/runs/${t}/logs`);if(!r.ok)throw new Error(await Ne(r,"Failed to load workflow run logs"));return(await r.json()).logs},MD=async t=>{const r=await ve(`/api/workflow-schedules/${t}`,{method:"DELETE"});if(!r.ok)throw new Error(await Ne(r,"Failed to delete workflow schedule"))},dC=["disabled","loggedOut","connecting","online","reconnecting","revoked"],fC=(t,r)=>typeof t=="string"&&dC.includes(t)?t:r?"online":"disabled",J0=t=>({enabled:t.enabled===!0,loggedIn:t.loggedIn===!0,gatewayUrl:t.gatewayUrl??null,connected:t.connected===!0,connection:fC(t.connection,t.connected===!0)}),mC=t=>({deviceId:t.id,name:t.name,lastActive:t.last_active,createdAt:t.created_at,revoked:t.revoked_at!==null}),pC=t=>({id:t.id,deviceId:t.device_id,ts:t.ts,workspaceId:t.workspace_id,action:t.action,endpoint:t.endpoint,result:t.result,rejectReason:t.reject_reason,byteCount:t.byte_count,preview:t.preview}),Pd=async()=>{const t=await ve("/api/remote/status");if(!t.ok)throw new Error(await Ne(t,"Failed to load remote status"));return J0(await t.json())},hC=async t=>{const r=await ve("/api/remote/enabled",{method:"PUT",headers:{"content-type":"application/json"},body:JSON.stringify({enabled:t})});if(!r.ok)throw new Error(await Ne(r,"Failed to update remote access"));return J0(await r.json())},gC=async()=>{const t=await ve("/api/remote/pairings",{method:"POST"});if(!t.ok)throw new Error(await Ne(t,"Failed to start pairing"));return await t.json()},Gv=async()=>{const t=await ve("/api/remote/pairings/pending");if(!t.ok)throw new Error(await Ne(t,"Failed to load pending pairing"));const o=(await t.json())[0];return o?{...o}:null},vC=async t=>{const r=await ve(`/api/remote/pairings/${t}/confirm`,{method:"POST"});if(!r.ok)throw new Error(await Ne(r,"Failed to confirm pairing"))},yC=async t=>{const r=await ve(`/api/remote/pairings/${t}/reject`,{method:"POST"});if(!r.ok)throw new Error(await Ne(r,"Failed to reject pairing"))},eb=async()=>{const t=await ve("/api/remote/devices");if(!t.ok)throw new Error(await Ne(t,"Failed to load devices"));return(await t.json()).map(mC)},bC=async t=>{const r=await ve(`/api/remote/devices/${t}/revoke`,{method:"POST"});if(!r.ok)throw new Error(await Ne(r,"Failed to revoke device"))},wC=async(t=100)=>{const r=await ve(`/api/remote/audit?limit=${t}`);if(!r.ok)throw new Error(await Ne(r,"Failed to load remote activity"));return(await r.json()).map(pC)},xC=t=>t.kind==="stopped_with_queue"?{kind:t.kind,openDispatches:t.open_dispatches,pendingTaskCount:t.pending_task_count,severity:t.severity,workerId:t.worker_id,workerName:t.worker_name}:t.kind==="dispatch_waiting_report"?{dispatchId:t.dispatch_id,kind:t.kind,minutesAgo:t.minutes_ago,severity:t.severity,submittedAt:t.submitted_at,workerId:t.worker_id,workerName:t.worker_name}:t,Kd=t=>({createdAt:t.created_at,id:t.id,label:t.label,phase:t.phase,reportPreview:t.report_preview??null,status:t.status,submittedAt:t.submitted_at,taskPreview:t.task_preview??null,timestamp:t.timestamp,toAgentId:t.to_agent_id,toWorkerName:t.to_worker_name,workflowRunId:t.workflow_run_id}),kC=t=>({attention:(t.attention??[]).map(xC),generatedAt:t.generated_at,recentActivity:t.recent_activity.map(r=>({...Kd(r),kind:r.kind})),summary:{idleWorkers:t.summary.idle_workers,openDispatches:t.summary.open_dispatches,recentReports:t.summary.recent_reports,stoppedWithQueue:t.summary.stopped_with_queue,stoppedWorkers:t.summary.stopped_workers,totalWorkers:t.summary.total_workers,waitingReports:t.summary.waiting_reports??0,workingWorkers:t.summary.working_workers},workers:t.workers.map(r=>({currentDispatch:r.current_dispatch?Kd(r.current_dispatch):null,id:r.id,latestReport:r.latest_report?Kd(r.latest_report):null,name:r.name,pendingTaskCount:r.pending_task_count,role:r.role,status:r.status,terminalHint:r.terminal_hint??null})),workspaceId:t.workspace_id}),SC=async(t,r)=>{const o=await ve(`/api/ui/workspaces/${t}/action-center`,r);if(!o.ok)throw new Error(await Ne(o,"Failed to load action center"));return kC(await o.json())},EC=async(t,r)=>{const o=await ve(`/api/workspaces/${t}/recap`,r);if(!o.ok)throw new Error(await Ne(o,"Failed to load team recap"));const i=await o.json();return{generatedAt:i.generated_at,markdown:i.markdown}},CC=async()=>{const t=await ve("/api/diagnostics/support-bundle");if(!t.ok)throw new Error(await Ne(t,"Failed to load diagnostics"));return await t.json()},tb=async t=>{if(navigator.clipboard?.writeText)try{await navigator.clipboard.writeText(t);return}catch{}const r=document.createElement("textarea");r.value=t,r.setAttribute("readonly",""),r.style.position="fixed",r.style.top="0",r.style.left="-9999px",r.style.opacity="0";const o=document.activeElement instanceof HTMLElement?document.activeElement:null;let i=!1;try{document.body.appendChild(r),r.focus(),r.select(),r.setSelectionRange(0,r.value.length),i=document.execCommand("copy")}finally{r.remove(),o?.focus()}if(!i)throw new Error("Clipboard copy failed")},nb=async t=>{if(navigator.clipboard?.write&&typeof ClipboardItem<"u"){const r=t.then(o=>new Blob([o],{type:"text/plain"}));r.catch(()=>{});try{await navigator.clipboard.write([new ClipboardItem({"text/plain":r})]);return}catch{}}await tb(await t)},rb=b.createContext(null),ab=b.createContext([]),Fd=3,TC=t=>t==="success"?3e3:t==="warning"?5e3:0;let $v=0;const AC=()=>($v+=1,`t-${$v.toString(36)}-${Date.now().toString(36)}`),_C=({children:t})=>{const[r,o]=b.useState([]),i=b.useRef(new Map),l=b.useCallback(v=>{const k=i.current.get(v);k?.timer&&clearTimeout(k.timer),i.current.delete(v)},[]),c=b.useCallback(v=>{o(k=>k.filter(S=>S.id!==v)),l(v)},[l]),f=b.useCallback(({kind:v,message:k,durationMs:S})=>{const C=AC();o(E=>{const T=[...E,{id:C,kind:v,message:k}];if(T.length<=Fd)return T;const _=T.slice(0,T.length-Fd);for(const j of _)l(j.id);return T.slice(T.length-Fd)});const x=S??TC(v);if(x>0){const E=setTimeout(()=>c(C),x);i.current.set(C,{timer:E,dueAt:Date.now()+x,durationMs:x,remainingMs:x})}return C},[c,l]),h=b.useCallback(v=>{const k=i.current.get(v);k?.timer&&(clearTimeout(k.timer),i.current.set(v,{...k,timer:null,remainingMs:Math.max(0,k.dueAt-Date.now())}))},[]),g=b.useCallback(v=>{const k=i.current.get(v);if(!k||k.timer||k.remainingMs<=0)return;const S=setTimeout(()=>c(v),k.remainingMs);i.current.set(v,{...k,timer:S,dueAt:Date.now()+k.remainingMs})},[c]),m=b.useCallback(v=>i.current.get(v)?.durationMs??0,[]);b.useEffect(()=>{const v=i.current;return()=>{for(const k of v.values())k.timer&&clearTimeout(k.timer);v.clear()}},[]);const y=b.useMemo(()=>({show:f,dismiss:c,pauseDismiss:h,resumeDismiss:g,getDuration:m}),[f,c,h,g,m]);return d.jsx(rb.Provider,{value:y,children:d.jsx(ab.Provider,{value:r,children:t})})},Qt=()=>{const t=b.useContext(rb);if(!t)throw new Error("useToast must be used within ToastProvider");return t},NC=()=>b.useContext(ab),jC=2e3,Yd=()=>document.visibilityState==="hidden",RC=(t,r)=>{const o=Math.max(0,Math.floor((Date.now()-t)/1e3));return o<60?r("common.time.sAgo",{count:o}):o<3600?r("common.time.mAgo",{count:Math.floor(o/60)}):o<86400?r("common.time.hAgo",{count:Math.floor(o/3600)}):r("common.time.dAgo",{count:Math.floor(o/86400)})},OC={cancelled:"actionCenter.activity.cancelled",queued:"actionCenter.activity.queued",reported:"actionCenter.activity.reported",submitted:"actionCenter.activity.submitted"},Xv=(t,r)=>{const o=t.toWorkerName??r("actionCenter.unknownWorker");return r(OC[t.kind],{ago:RC(t.timestamp,r),worker:o})},Zv=t=>t.reportPreview??t.taskPreview??t.label??t.phase,DC=t=>t.currentDispatch?.taskPreview??t.latestReport?.reportPreview??t.terminalHint??null,MC=(t,r)=>t.currentDispatch?r("actionCenter.currentDispatch"):t.latestReport?r("actionCenter.latestReport"):t.terminalHint?r("actionCenter.terminalHint"):r("actionCenter.workerStatus"),Qv=(t,r)=>t.kind==="no_workers"?r("actionCenter.attention.noWorkers"):t.kind==="stopped_with_queue"?r("actionCenter.attention.stoppedWithQueue",{count:t.pendingTaskCount,worker:t.workerName}):t.kind==="dispatch_waiting_report"?r("actionCenter.attention.waitingReport",{minutes:t.minutesAgo,worker:t.workerName??r("actionCenter.unknownWorker")}):r(t.kind==="remote_error"?"actionCenter.attention.remoteError":"actionCenter.attention.remoteRejected",{endpoint:t.endpoint??t.action,reason:t.reason??"unknown"}),Jv=t=>t.kind==="stopped_with_queue"?`${t.kind}-${t.workerId}`:t.kind==="dispatch_waiting_report"?`${t.kind}-${t.dispatchId}`:t.kind==="remote_error"||t.kind==="remote_rejected"?`${t.kind}-${t.ts}-${t.action}-${t.endpoint??""}-${t.reason??""}`:t.kind,LC=({onOpenWorker:t,workspaceId:r})=>{const{t:o}=Ee(),i=Qt(),[l,c]=b.useState(null),[f,h]=b.useState(!1),[g,m]=b.useState(!1),[y,v]=b.useState(!1),k=()=>{if(y)return;v(!0);const R=EC(r).then(D=>D.markdown);nb(R).then(()=>i.show({kind:"success",message:o("actionCenter.recapCopied")})).catch(()=>i.show({kind:"error",message:o("actionCenter.recapCopyFailed")})).finally(()=>v(!1))},S=b.useCallback(async R=>SC(r,R?{signal:R}:void 0),[r]);b.useEffect(()=>{let R=!1,D=!1,L=null,B=null;const P=async()=>{if(!(R||D||Yd())){D=!0,B=new AbortController;try{const ee=await S(B.signal);if(R)return;c(ee),h(!1)}catch{R||h(!0)}finally{B=null,D=!1}!R&&!Yd()&&(L=setTimeout(P,jC))}},te=()=>{R||Yd()||(L&&(clearTimeout(L),L=null),P())};return document.addEventListener("visibilitychange",te),P(),()=>{R=!0,B?.abort(),L&&clearTimeout(L),document.removeEventListener("visibilitychange",te)}},[S]);const C=l?.recentActivity[0]??null,x=C?Zv(C):null,E=l?.summary.stoppedWithQueue??0,T=l?.summary.waitingReports??0,_=l?.attention.slice(0,5)??[],j=l?.workers.filter(R=>R.currentDispatch||R.latestReport||R.terminalHint||R.pendingTaskCount>0||R.status==="working").slice(0,6)??[],A=l?.recentActivity.slice(0,6)??[];return d.jsxs("section",{className:"shrink-0 border-b px-4 py-2","data-testid":"action-center-strip",style:{background:"var(--bg-1)",borderColor:"var(--border)"},children:[d.jsxs("div",{className:"flex min-w-0 flex-wrap items-center gap-2",children:[d.jsxs("button",{type:"button",onClick:()=>m(R=>!R),"aria-expanded":g,"aria-label":o(g?"actionCenter.collapse":"actionCenter.expand"),className:"inline-flex items-center gap-1.5 rounded px-1 py-0.5 text-xs font-semibold uppercase tracking-wide text-ter hover:bg-3 hover:text-pri",children:[g?d.jsx(wo,{size:13,"aria-hidden":!0}):d.jsx(Jl,{size:13,"aria-hidden":!0}),d.jsx(R0,{size:13,"aria-hidden":!0}),o("actionCenter.title")]}),d.jsx("span",{className:"pill pill--green",children:o("actionCenter.runningCount",{count:l?.summary.workingWorkers??0})}),d.jsx("span",{className:"pill pill--ghost",children:o("actionCenter.openCount",{count:l?.summary.openDispatches??0})}),d.jsx("span",{className:"pill pill--ghost",children:o("actionCenter.reportCount",{count:l?.summary.recentReports??0})}),E>0?d.jsxs("span",{className:"pill",style:{background:"color-mix(in oklab, var(--status-orange) 15%, transparent)",color:"var(--status-orange)"},children:[d.jsx(nc,{size:11,"aria-hidden":!0}),o("actionCenter.stoppedWithQueue",{count:E})]}):null,T>0?d.jsx("span",{className:"pill pill--ghost",children:o("actionCenter.waitingReports",{count:T})}):null]}),d.jsx("div",{className:"mt-1 flex min-w-0 items-center gap-1.5 text-xs text-sec",children:f?d.jsx("span",{style:{color:"var(--text-error)"},children:o("actionCenter.loadFailed")}):C?d.jsxs(d.Fragment,{children:[d.jsx("span",{className:"shrink-0 text-ter",children:Xv(C,o)}),x?d.jsxs("span",{className:"min-w-0 truncate text-ter",title:x,children:["· ",x]}):null]}):d.jsx("span",{className:"text-ter",children:o(l?"actionCenter.noActivity":"actionCenter.loading")})}),g&&l?d.jsxs("div",{className:"mt-2 grid gap-2 md:grid-cols-2","data-testid":"action-center-evidence",children:[d.jsx("div",{className:"flex min-w-0 justify-end md:col-span-2",children:d.jsxs("button",{type:"button",onClick:k,disabled:y,className:"inline-flex items-center gap-1.5 rounded border border-bright/40 px-2 py-1 text-xs text-sec hover:bg-2 hover:text-pri disabled:cursor-default disabled:opacity-60","data-testid":"action-center-copy-recap",children:[d.jsx(ec,{size:12,"aria-hidden":!0}),o("actionCenter.copyRecap")]})}),_.length>0?d.jsxs("div",{className:"min-w-0 md:col-span-2",children:[d.jsx("div",{className:"mb-1 text-[11px] font-semibold uppercase tracking-wide text-ter",children:o("actionCenter.attention")}),d.jsx("ul",{className:"flex flex-col gap-px rounded border border-bright/40 bg-0",children:_.map(R=>d.jsx("li",{children:d.jsxs("div",{className:"flex min-w-0 items-center gap-2 px-2 py-1.5 text-xs","data-testid":`action-center-attention-${Jv(R)}`,children:[d.jsx("span",{className:"inline-block h-1.5 w-1.5 shrink-0 rounded-full",style:{background:R.severity==="error"?"var(--status-red)":R.severity==="warning"?"var(--status-orange)":"var(--text-tertiary)"},"aria-hidden":!0}),d.jsx("span",{className:"min-w-0 truncate text-sec",title:Qv(R,o),children:Qv(R,o)})]})},Jv(R)))})]}):null,d.jsxs("div",{className:"min-w-0",children:[d.jsx("div",{className:"mb-1 text-[11px] font-semibold uppercase tracking-wide text-ter",children:o("actionCenter.recent")}),A.length>0?d.jsx("ul",{className:"flex max-h-36 flex-col gap-px overflow-auto rounded border border-bright/40 bg-0",children:A.map(R=>{const D=Zv(R);return d.jsx("li",{children:d.jsxs("button",{type:"button",onClick:()=>t?.(R.toAgentId),className:"flex w-full min-w-0 items-center gap-2 px-2 py-1.5 text-left text-xs hover:bg-2 disabled:cursor-default disabled:hover:bg-transparent",disabled:!t,"data-testid":`action-center-activity-${R.id}`,children:[d.jsx("span",{className:"shrink-0 text-sec",children:Xv(R,o)}),D?d.jsx("span",{className:"min-w-0 truncate text-ter",title:D,children:D}):null]})},R.id)})}):d.jsx("div",{className:"rounded border border-dashed border-bright/40 px-2 py-2 text-xs text-ter",children:o("actionCenter.noActivity")})]}),d.jsxs("div",{className:"min-w-0",children:[d.jsx("div",{className:"mb-1 text-[11px] font-semibold uppercase tracking-wide text-ter",children:o("actionCenter.workers")}),j.length>0?d.jsx("ul",{className:"flex max-h-36 flex-col gap-px overflow-auto rounded border border-bright/40 bg-0",children:j.map(R=>{const D=DC(R);return d.jsx("li",{children:d.jsxs("button",{type:"button",onClick:()=>t?.(R.id),className:"flex w-full min-w-0 items-center gap-2 px-2 py-1.5 text-left text-xs hover:bg-2 disabled:cursor-default disabled:hover:bg-transparent",disabled:!t,"data-testid":`action-center-worker-${R.id}`,children:[d.jsx("span",{className:"min-w-0 flex-1 truncate text-sec",children:R.name}),d.jsxs("span",{className:"shrink-0 text-ter",children:[MC(R,o),R.pendingTaskCount>0?` · ${o("worker.queued",{count:R.pendingTaskCount})}`:""]}),D?d.jsx("span",{className:"min-w-0 flex-[1.4] truncate text-ter",title:D,children:D}):null]})},R.id)})}):d.jsx("div",{className:"rounded border border-dashed border-bright/40 px-2 py-2 text-xs text-ter",children:o("actionCenter.noWorkerEvidence")})]})]}):null]})};let Bl=!1;const _f=new Set,zC=()=>Bl,ob=t=>{if(Bl!==t){Bl=t;for(const r of _f)r()}},HC=()=>{ob(!Bl)},BC=t=>(_f.add(t),()=>_f.delete(t)),sb=()=>b.useSyncExternalStore(BC,zC,()=>!1),ey="(max-width: 767px)",ib=b.createContext({mode:"wide"}),Vd={mode:"wide"},WC={mode:"mobile"},UC=(t=typeof window<"u"?window.matchMedia.bind(window):void 0)=>{const r=i=>{if(!t)return()=>{};const l=t(ey);return l.addEventListener?.("change",i),()=>l.removeEventListener?.("change",i)},o=()=>t&&t(ey).matches?WC:Vd;return b.useSyncExternalStore(r,o,()=>Vd)},qC=({children:t,value:r})=>{const o=UC();return d.jsx(ib.Provider,{value:r??o,children:t})},lb=()=>b.useContext(ib),Tt=()=>lb().mode==="mobile",cb="hive.notification.settings",to={desktop:!1,detail:"brief",sound:"soft"},IC={beacon:"/sounds/hive-beacon.ogg",cascade:"/sounds/hive-cascade.ogg",chime:"/sounds/hive-chime.ogg",ping:"/sounds/hive-ping.ogg",resolve:"/sounds/hive-resolve.ogg",soft:"/sounds/hive-soft.ogg"},PC=t=>t==="off"||t==="ping"||t==="chime"||t==="soft"||t==="cascade"||t==="beacon"||t==="resolve",KC=()=>{if(typeof window>"u")return to;try{const t=window.localStorage.getItem(cb);if(!t)return to;const r=JSON.parse(t);return{desktop:typeof r.desktop=="boolean"?r.desktop:to.desktop,detail:r.detail==="detailed"?"detailed":to.detail,sound:PC(r.sound)?r.sound:to.sound}}catch{return to}},FC=t=>{try{window.localStorage.setItem(cb,JSON.stringify(t))}catch{}},ty=t=>{if(!(t==="off"||typeof window>"u"))try{const r=new window.Audio(IC[t]);r.preload="auto",r.volume=.72,r.play()?.catch(()=>{})}catch{}},ub=b.createContext(null),YC=({children:t})=>{const r=Qt(),{t:o}=Ee(),[i,l]=b.useState(()=>KC());b.useEffect(()=>{FC(i)},[i]);const c=b.useCallback(y=>{l(v=>({...v,...y}))},[]),f=b.useCallback(async()=>{if(typeof window>"u"||!("Notification"in window))return c({desktop:!1}),r.show({kind:"warning",message:o("notifications.toast.unsupported")}),!1;if(window.Notification.permission==="granted")return c({desktop:!0}),!0;if(window.Notification.permission==="denied")return c({desktop:!1}),r.show({kind:"warning",message:o("notifications.toast.blocked")}),!1;const v=await window.Notification.requestPermission()==="granted";return c({desktop:v}),v||r.show({kind:"warning",message:o("notifications.toast.declined")}),v},[o,r,c]),h=b.useCallback(({brief:y,detail:v,kind:k,title:S})=>{const C=i.detail==="detailed"&&v?v:y;if(r.show({kind:k,message:C}),ty(i.sound),i.desktop&&typeof window<"u"&&"Notification"in window&&window.Notification.permission==="granted")try{new window.Notification(S,{body:C})}catch{}},[i,r]),g=b.useCallback(y=>{ty(y)},[]),m=b.useMemo(()=>({notify:h,previewSound:g,requestDesktopNotifications:f,settings:i,updateSettings:c}),[h,g,f,i,c]);return d.jsx(ub.Provider,{value:m,children:t})},oc=()=>{const t=b.useContext(ub);if(!t)throw new Error("useNotifications must be used within NotificationProvider");return t},VC={coder:"role.coder",custom:"role.custom",reviewer:"role.reviewer",sentinel:"role.sentinel",tester:"role.tester"},GC=t=>new Map(t.map(r=>[r.id,{id:r.id,name:r.name,pendingTaskCount:r.pendingTaskCount,role:r.role,status:r.status}])),$C=({terminalRuns:t,workers:r,workspace:o})=>{const{notify:i}=oc(),{t:l}=Ee(),c=b.useRef(null);return b.useEffect(()=>{if(!o){c.current=null;return}const f=GC(r),h=c.current;if(c.current={workers:f,workspaceId:o.id},!(!h||h.workspaceId!==o.id))for(const g of f.values()){const m=h.workers.get(g.id);if(!m)continue;if(m.status!=="stopped"&&g.status==="stopped"){i({brief:l("notifications.workerStopped.brief",{name:g.name}),detail:l("notifications.workerStopped.detail",{name:g.name,workspace:o.name,count:g.pendingTaskCount}),kind:"error",title:l("notifications.workerStopped.title")});continue}if(m.status==="stopped"&&g.status!=="stopped"){i({brief:l("notifications.workerStarted.brief",{name:g.name}),detail:l("notifications.workerStarted.detail",{name:g.name,workspace:o.name,role:l(VC[g.role])}),kind:"success",title:l("notifications.workerStarted.title")});continue}(g.pendingTaskCount<m.pendingTaskCount||m.status==="working"&&g.status==="idle")&&i({brief:l("notifications.workerReported.brief",{name:g.name}),detail:l("notifications.workerReported.detail",{name:g.name,workspace:o.name,count:g.pendingTaskCount}),kind:"success",title:l("notifications.workerReported.title")})}},[i,l,r,o]),null};function Lt(t,r,{checkForDefaultPrevented:o=!0}={}){return function(l){if(t?.(l),o===!1||!l.defaultPrevented)return r?.(l)}}function ny(t,r){if(typeof t=="function")return t(r);t!=null&&(t.current=r)}function db(...t){return r=>{let o=!1;const i=t.map(l=>{const c=ny(l,r);return!o&&typeof c=="function"&&(o=!0),c});if(o)return()=>{for(let l=0;l<i.length;l++){const c=i[l];typeof c=="function"?c():ny(t[l],null)}}}}function xn(...t){return b.useCallback(db(...t),t)}function XC(t,r){const o=b.createContext(r),i=c=>{const{children:f,...h}=c,g=b.useMemo(()=>h,Object.values(h));return d.jsx(o.Provider,{value:g,children:f})};i.displayName=t+"Provider";function l(c){const f=b.useContext(o);if(f)return f;if(r!==void 0)return r;throw new Error(`\`${c}\` must be used within \`${t}\``)}return[i,l]}function dm(t,r=[]){let o=[];function i(c,f){const h=b.createContext(f),g=o.length;o=[...o,f];const m=v=>{const{scope:k,children:S,...C}=v,x=k?.[t]?.[g]||h,E=b.useMemo(()=>C,Object.values(C));return d.jsx(x.Provider,{value:E,children:S})};m.displayName=c+"Provider";function y(v,k){const S=k?.[t]?.[g]||h,C=b.useContext(S);if(C)return C;if(f!==void 0)return f;throw new Error(`\`${v}\` must be used within \`${c}\``)}return[m,y]}const l=()=>{const c=o.map(f=>b.createContext(f));return function(h){const g=h?.[t]||c;return b.useMemo(()=>({[`__scope${t}`]:{...h,[t]:g}}),[h,g])}};return l.scopeName=t,[i,ZC(l,...r)]}function ZC(...t){const r=t[0];if(t.length===1)return r;const o=()=>{const i=t.map(l=>({useScope:l(),scopeName:l.scopeName}));return function(c){const f=i.reduce((h,{useScope:g,scopeName:m})=>{const v=g(c)[`__scope${m}`];return{...h,...v}},{});return b.useMemo(()=>({[`__scope${r.scopeName}`]:f}),[f])}};return o.scopeName=r.scopeName,o}var sc=N0();const QC=A0(sc);function fb(t){const r=JC(t),o=b.forwardRef((i,l)=>{const{children:c,...f}=i,h=b.Children.toArray(c),g=h.find(tT);if(g){const m=g.props.children,y=h.map(v=>v===g?b.Children.count(m)>1?b.Children.only(null):b.isValidElement(m)?m.props.children:null:v);return d.jsx(r,{...f,ref:l,children:b.isValidElement(m)?b.cloneElement(m,void 0,y):null})}return d.jsx(r,{...f,ref:l,children:c})});return o.displayName=`${t}.Slot`,o}function JC(t){const r=b.forwardRef((o,i)=>{const{children:l,...c}=o;if(b.isValidElement(l)){const f=rT(l),h=nT(c,l.props);return l.type!==b.Fragment&&(h.ref=i?db(i,f):f),b.cloneElement(l,h)}return b.Children.count(l)>1?b.Children.only(null):null});return r.displayName=`${t}.SlotClone`,r}var mb=Symbol("radix.slottable");function eT(t){const r=({children:o})=>d.jsx(d.Fragment,{children:o});return r.displayName=`${t}.Slottable`,r.__radixId=mb,r}function tT(t){return b.isValidElement(t)&&typeof t.type=="function"&&"__radixId"in t.type&&t.type.__radixId===mb}function nT(t,r){const o={...r};for(const i in r){const l=t[i],c=r[i];/^on[A-Z]/.test(i)?l&&c?o[i]=(...h)=>{const g=c(...h);return l(...h),g}:l&&(o[i]=l):i==="style"?o[i]={...l,...c}:i==="className"&&(o[i]=[l,c].filter(Boolean).join(" "))}return{...t,...o}}function rT(t){let r=Object.getOwnPropertyDescriptor(t.props,"ref")?.get,o=r&&"isReactWarning"in r&&r.isReactWarning;return o?t.ref:(r=Object.getOwnPropertyDescriptor(t,"ref")?.get,o=r&&"isReactWarning"in r&&r.isReactWarning,o?t.props.ref:t.props.ref||t.ref)}var aT=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Bt=aT.reduce((t,r)=>{const o=fb(`Primitive.${r}`),i=b.forwardRef((l,c)=>{const{asChild:f,...h}=l,g=f?o:r;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),d.jsx(g,{...h,ref:c})});return i.displayName=`Primitive.${r}`,{...t,[r]:i}},{});function oT(t,r){t&&sc.flushSync(()=>t.dispatchEvent(r))}function po(t){const r=b.useRef(t);return b.useEffect(()=>{r.current=t}),b.useMemo(()=>(...o)=>r.current?.(...o),[])}function sT(t,r=globalThis?.document){const o=po(t);b.useEffect(()=>{const i=l=>{l.key==="Escape"&&o(l)};return r.addEventListener("keydown",i,{capture:!0}),()=>r.removeEventListener("keydown",i,{capture:!0})},[o,r])}var iT="DismissableLayer",Nf="dismissableLayer.update",lT="dismissableLayer.pointerDownOutside",cT="dismissableLayer.focusOutside",ry,pb=b.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),fm=b.forwardRef((t,r)=>{const{disableOutsidePointerEvents:o=!1,onEscapeKeyDown:i,onPointerDownOutside:l,onFocusOutside:c,onInteractOutside:f,onDismiss:h,...g}=t,m=b.useContext(pb),[y,v]=b.useState(null),k=y?.ownerDocument??globalThis?.document,[,S]=b.useState({}),C=xn(r,L=>v(L)),x=Array.from(m.layers),[E]=[...m.layersWithOutsidePointerEventsDisabled].slice(-1),T=x.indexOf(E),_=y?x.indexOf(y):-1,j=m.layersWithOutsidePointerEventsDisabled.size>0,A=_>=T,R=fT(L=>{const B=L.target,P=[...m.branches].some(te=>te.contains(B));!A||P||(l?.(L),f?.(L),L.defaultPrevented||h?.())},k),D=mT(L=>{const B=L.target;[...m.branches].some(te=>te.contains(B))||(c?.(L),f?.(L),L.defaultPrevented||h?.())},k);return sT(L=>{_===m.layers.size-1&&(i?.(L),!L.defaultPrevented&&h&&(L.preventDefault(),h()))},k),b.useEffect(()=>{if(y)return o&&(m.layersWithOutsidePointerEventsDisabled.size===0&&(ry=k.body.style.pointerEvents,k.body.style.pointerEvents="none"),m.layersWithOutsidePointerEventsDisabled.add(y)),m.layers.add(y),ay(),()=>{o&&m.layersWithOutsidePointerEventsDisabled.size===1&&(k.body.style.pointerEvents=ry)}},[y,k,o,m]),b.useEffect(()=>()=>{y&&(m.layers.delete(y),m.layersWithOutsidePointerEventsDisabled.delete(y),ay())},[y,m]),b.useEffect(()=>{const L=()=>S({});return document.addEventListener(Nf,L),()=>document.removeEventListener(Nf,L)},[]),d.jsx(Bt.div,{...g,ref:C,style:{pointerEvents:j?A?"auto":"none":void 0,...t.style},onFocusCapture:Lt(t.onFocusCapture,D.onFocusCapture),onBlurCapture:Lt(t.onBlurCapture,D.onBlurCapture),onPointerDownCapture:Lt(t.onPointerDownCapture,R.onPointerDownCapture)})});fm.displayName=iT;var uT="DismissableLayerBranch",dT=b.forwardRef((t,r)=>{const o=b.useContext(pb),i=b.useRef(null),l=xn(r,i);return b.useEffect(()=>{const c=i.current;if(c)return o.branches.add(c),()=>{o.branches.delete(c)}},[o.branches]),d.jsx(Bt.div,{...t,ref:l})});dT.displayName=uT;function fT(t,r=globalThis?.document){const o=po(t),i=b.useRef(!1),l=b.useRef(()=>{});return b.useEffect(()=>{const c=h=>{if(h.target&&!i.current){let g=function(){hb(lT,o,m,{discrete:!0})};const m={originalEvent:h};h.pointerType==="touch"?(r.removeEventListener("click",l.current),l.current=g,r.addEventListener("click",l.current,{once:!0})):g()}else r.removeEventListener("click",l.current);i.current=!1},f=window.setTimeout(()=>{r.addEventListener("pointerdown",c)},0);return()=>{window.clearTimeout(f),r.removeEventListener("pointerdown",c),r.removeEventListener("click",l.current)}},[r,o]),{onPointerDownCapture:()=>i.current=!0}}function mT(t,r=globalThis?.document){const o=po(t),i=b.useRef(!1);return b.useEffect(()=>{const l=c=>{c.target&&!i.current&&hb(cT,o,{originalEvent:c},{discrete:!1})};return r.addEventListener("focusin",l),()=>r.removeEventListener("focusin",l)},[r,o]),{onFocusCapture:()=>i.current=!0,onBlurCapture:()=>i.current=!1}}function ay(){const t=new CustomEvent(Nf);document.dispatchEvent(t)}function hb(t,r,o,{discrete:i}){const l=o.originalEvent.target,c=new CustomEvent(t,{bubbles:!1,cancelable:!0,detail:o});r&&l.addEventListener(t,r,{once:!0}),i?oT(l,c):l.dispatchEvent(c)}var Ur=globalThis?.document?b.useLayoutEffect:()=>{},pT=_0[" useId ".trim().toString()]||(()=>{}),hT=0;function Cl(t){const[r,o]=b.useState(pT());return Ur(()=>{o(i=>i??String(hT++))},[t]),t||(r?`radix-${r}`:"")}const gT=["top","right","bottom","left"],qr=Math.min,$t=Math.max,Wl=Math.round,gl=Math.floor,On=t=>({x:t,y:t}),vT={left:"right",right:"left",bottom:"top",top:"bottom"};function jf(t,r,o){return $t(t,qr(r,o))}function tr(t,r){return typeof t=="function"?t(r):t}function nr(t){return t.split("-")[0]}function So(t){return t.split("-")[1]}function mm(t){return t==="x"?"y":"x"}function pm(t){return t==="y"?"height":"width"}function Rn(t){const r=t[0];return r==="t"||r==="b"?"y":"x"}function hm(t){return mm(Rn(t))}function yT(t,r,o){o===void 0&&(o=!1);const i=So(t),l=hm(t),c=pm(l);let f=l==="x"?i===(o?"end":"start")?"right":"left":i==="start"?"bottom":"top";return r.reference[c]>r.floating[c]&&(f=Ul(f)),[f,Ul(f)]}function bT(t){const r=Ul(t);return[Rf(t),r,Rf(r)]}function Rf(t){return t.includes("start")?t.replace("start","end"):t.replace("end","start")}const oy=["left","right"],sy=["right","left"],wT=["top","bottom"],xT=["bottom","top"];function kT(t,r,o){switch(t){case"top":case"bottom":return o?r?sy:oy:r?oy:sy;case"left":case"right":return r?wT:xT;default:return[]}}function ST(t,r,o,i){const l=So(t);let c=kT(nr(t),o==="start",i);return l&&(c=c.map(f=>f+"-"+l),r&&(c=c.concat(c.map(Rf)))),c}function Ul(t){const r=nr(t);return vT[r]+t.slice(r.length)}function ET(t){return{top:0,right:0,bottom:0,left:0,...t}}function gb(t){return typeof t!="number"?ET(t):{top:t,right:t,bottom:t,left:t}}function ql(t){const{x:r,y:o,width:i,height:l}=t;return{width:i,height:l,top:o,left:r,right:r+i,bottom:o+l,x:r,y:o}}function iy(t,r,o){let{reference:i,floating:l}=t;const c=Rn(r),f=hm(r),h=pm(f),g=nr(r),m=c==="y",y=i.x+i.width/2-l.width/2,v=i.y+i.height/2-l.height/2,k=i[h]/2-l[h]/2;let S;switch(g){case"top":S={x:y,y:i.y-l.height};break;case"bottom":S={x:y,y:i.y+i.height};break;case"right":S={x:i.x+i.width,y:v};break;case"left":S={x:i.x-l.width,y:v};break;default:S={x:i.x,y:i.y}}switch(So(r)){case"start":S[f]-=k*(o&&m?-1:1);break;case"end":S[f]+=k*(o&&m?-1:1);break}return S}async function CT(t,r){var o;r===void 0&&(r={});const{x:i,y:l,platform:c,rects:f,elements:h,strategy:g}=t,{boundary:m="clippingAncestors",rootBoundary:y="viewport",elementContext:v="floating",altBoundary:k=!1,padding:S=0}=tr(r,t),C=gb(S),E=h[k?v==="floating"?"reference":"floating":v],T=ql(await c.getClippingRect({element:(o=await(c.isElement==null?void 0:c.isElement(E)))==null||o?E:E.contextElement||await(c.getDocumentElement==null?void 0:c.getDocumentElement(h.floating)),boundary:m,rootBoundary:y,strategy:g})),_=v==="floating"?{x:i,y:l,width:f.floating.width,height:f.floating.height}:f.reference,j=await(c.getOffsetParent==null?void 0:c.getOffsetParent(h.floating)),A=await(c.isElement==null?void 0:c.isElement(j))?await(c.getScale==null?void 0:c.getScale(j))||{x:1,y:1}:{x:1,y:1},R=ql(c.convertOffsetParentRelativeRectToViewportRelativeRect?await c.convertOffsetParentRelativeRectToViewportRelativeRect({elements:h,rect:_,offsetParent:j,strategy:g}):_);return{top:(T.top-R.top+C.top)/A.y,bottom:(R.bottom-T.bottom+C.bottom)/A.y,left:(T.left-R.left+C.left)/A.x,right:(R.right-T.right+C.right)/A.x}}const TT=50,AT=async(t,r,o)=>{const{placement:i="bottom",strategy:l="absolute",middleware:c=[],platform:f}=o,h=f.detectOverflow?f:{...f,detectOverflow:CT},g=await(f.isRTL==null?void 0:f.isRTL(r));let m=await f.getElementRects({reference:t,floating:r,strategy:l}),{x:y,y:v}=iy(m,i,g),k=i,S=0;const C={};for(let x=0;x<c.length;x++){const E=c[x];if(!E)continue;const{name:T,fn:_}=E,{x:j,y:A,data:R,reset:D}=await _({x:y,y:v,initialPlacement:i,placement:k,strategy:l,middlewareData:C,rects:m,platform:h,elements:{reference:t,floating:r}});y=j??y,v=A??v,C[T]={...C[T],...R},D&&S<TT&&(S++,typeof D=="object"&&(D.placement&&(k=D.placement),D.rects&&(m=D.rects===!0?await f.getElementRects({reference:t,floating:r,strategy:l}):D.rects),{x:y,y:v}=iy(m,k,g)),x=-1)}return{x:y,y:v,placement:k,strategy:l,middlewareData:C}},_T=t=>({name:"arrow",options:t,async fn(r){const{x:o,y:i,placement:l,rects:c,platform:f,elements:h,middlewareData:g}=r,{element:m,padding:y=0}=tr(t,r)||{};if(m==null)return{};const v=gb(y),k={x:o,y:i},S=hm(l),C=pm(S),x=await f.getDimensions(m),E=S==="y",T=E?"top":"left",_=E?"bottom":"right",j=E?"clientHeight":"clientWidth",A=c.reference[C]+c.reference[S]-k[S]-c.floating[C],R=k[S]-c.reference[S],D=await(f.getOffsetParent==null?void 0:f.getOffsetParent(m));let L=D?D[j]:0;(!L||!await(f.isElement==null?void 0:f.isElement(D)))&&(L=h.floating[j]||c.floating[C]);const B=A/2-R/2,P=L/2-x[C]/2-1,te=qr(v[T],P),ee=qr(v[_],P),F=te,Q=L-x[C]-ee,Z=L/2-x[C]/2+B,$=jf(F,Z,Q),M=!g.arrow&&So(l)!=null&&Z!==$&&c.reference[C]/2-(Z<F?te:ee)-x[C]/2<0,K=M?Z<F?Z-F:Z-Q:0;return{[S]:k[S]+K,data:{[S]:$,centerOffset:Z-$-K,...M&&{alignmentOffset:K}},reset:M}}}),NT=function(t){return t===void 0&&(t={}),{name:"flip",options:t,async fn(r){var o,i;const{placement:l,middlewareData:c,rects:f,initialPlacement:h,platform:g,elements:m}=r,{mainAxis:y=!0,crossAxis:v=!0,fallbackPlacements:k,fallbackStrategy:S="bestFit",fallbackAxisSideDirection:C="none",flipAlignment:x=!0,...E}=tr(t,r);if((o=c.arrow)!=null&&o.alignmentOffset)return{};const T=nr(l),_=Rn(h),j=nr(h)===h,A=await(g.isRTL==null?void 0:g.isRTL(m.floating)),R=k||(j||!x?[Ul(h)]:bT(h)),D=C!=="none";!k&&D&&R.push(...ST(h,x,C,A));const L=[h,...R],B=await g.detectOverflow(r,E),P=[];let te=((i=c.flip)==null?void 0:i.overflows)||[];if(y&&P.push(B[T]),v){const Z=yT(l,f,A);P.push(B[Z[0]],B[Z[1]])}if(te=[...te,{placement:l,overflows:P}],!P.every(Z=>Z<=0)){var ee,F;const Z=(((ee=c.flip)==null?void 0:ee.index)||0)+1,$=L[Z];if($&&(!(v==="alignment"?_!==Rn($):!1)||te.every(U=>Rn(U.placement)===_?U.overflows[0]>0:!0)))return{data:{index:Z,overflows:te},reset:{placement:$}};let M=(F=te.filter(K=>K.overflows[0]<=0).sort((K,U)=>K.overflows[1]-U.overflows[1])[0])==null?void 0:F.placement;if(!M)switch(S){case"bestFit":{var Q;const K=(Q=te.filter(U=>{if(D){const I=Rn(U.placement);return I===_||I==="y"}return!0}).map(U=>[U.placement,U.overflows.filter(I=>I>0).reduce((I,X)=>I+X,0)]).sort((U,I)=>U[1]-I[1])[0])==null?void 0:Q[0];K&&(M=K);break}case"initialPlacement":M=h;break}if(l!==M)return{reset:{placement:M}}}return{}}}};function ly(t,r){return{top:t.top-r.height,right:t.right-r.width,bottom:t.bottom-r.height,left:t.left-r.width}}function cy(t){return gT.some(r=>t[r]>=0)}const jT=function(t){return t===void 0&&(t={}),{name:"hide",options:t,async fn(r){const{rects:o,platform:i}=r,{strategy:l="referenceHidden",...c}=tr(t,r);switch(l){case"referenceHidden":{const f=await i.detectOverflow(r,{...c,elementContext:"reference"}),h=ly(f,o.reference);return{data:{referenceHiddenOffsets:h,referenceHidden:cy(h)}}}case"escaped":{const f=await i.detectOverflow(r,{...c,altBoundary:!0}),h=ly(f,o.floating);return{data:{escapedOffsets:h,escaped:cy(h)}}}default:return{}}}}},vb=new Set(["left","top"]);async function RT(t,r){const{placement:o,platform:i,elements:l}=t,c=await(i.isRTL==null?void 0:i.isRTL(l.floating)),f=nr(o),h=So(o),g=Rn(o)==="y",m=vb.has(f)?-1:1,y=c&&g?-1:1,v=tr(r,t);let{mainAxis:k,crossAxis:S,alignmentAxis:C}=typeof v=="number"?{mainAxis:v,crossAxis:0,alignmentAxis:null}:{mainAxis:v.mainAxis||0,crossAxis:v.crossAxis||0,alignmentAxis:v.alignmentAxis};return h&&typeof C=="number"&&(S=h==="end"?C*-1:C),g?{x:S*y,y:k*m}:{x:k*m,y:S*y}}const OT=function(t){return t===void 0&&(t=0),{name:"offset",options:t,async fn(r){var o,i;const{x:l,y:c,placement:f,middlewareData:h}=r,g=await RT(r,t);return f===((o=h.offset)==null?void 0:o.placement)&&(i=h.arrow)!=null&&i.alignmentOffset?{}:{x:l+g.x,y:c+g.y,data:{...g,placement:f}}}}},DT=function(t){return t===void 0&&(t={}),{name:"shift",options:t,async fn(r){const{x:o,y:i,placement:l,platform:c}=r,{mainAxis:f=!0,crossAxis:h=!1,limiter:g={fn:T=>{let{x:_,y:j}=T;return{x:_,y:j}}},...m}=tr(t,r),y={x:o,y:i},v=await c.detectOverflow(r,m),k=Rn(nr(l)),S=mm(k);let C=y[S],x=y[k];if(f){const T=S==="y"?"top":"left",_=S==="y"?"bottom":"right",j=C+v[T],A=C-v[_];C=jf(j,C,A)}if(h){const T=k==="y"?"top":"left",_=k==="y"?"bottom":"right",j=x+v[T],A=x-v[_];x=jf(j,x,A)}const E=g.fn({...r,[S]:C,[k]:x});return{...E,data:{x:E.x-o,y:E.y-i,enabled:{[S]:f,[k]:h}}}}}},MT=function(t){return t===void 0&&(t={}),{options:t,fn(r){const{x:o,y:i,placement:l,rects:c,middlewareData:f}=r,{offset:h=0,mainAxis:g=!0,crossAxis:m=!0}=tr(t,r),y={x:o,y:i},v=Rn(l),k=mm(v);let S=y[k],C=y[v];const x=tr(h,r),E=typeof x=="number"?{mainAxis:x,crossAxis:0}:{mainAxis:0,crossAxis:0,...x};if(g){const j=k==="y"?"height":"width",A=c.reference[k]-c.floating[j]+E.mainAxis,R=c.reference[k]+c.reference[j]-E.mainAxis;S<A?S=A:S>R&&(S=R)}if(m){var T,_;const j=k==="y"?"width":"height",A=vb.has(nr(l)),R=c.reference[v]-c.floating[j]+(A&&((T=f.offset)==null?void 0:T[v])||0)+(A?0:E.crossAxis),D=c.reference[v]+c.reference[j]+(A?0:((_=f.offset)==null?void 0:_[v])||0)-(A?E.crossAxis:0);C<R?C=R:C>D&&(C=D)}return{[k]:S,[v]:C}}}},LT=function(t){return t===void 0&&(t={}),{name:"size",options:t,async fn(r){var o,i;const{placement:l,rects:c,platform:f,elements:h}=r,{apply:g=()=>{},...m}=tr(t,r),y=await f.detectOverflow(r,m),v=nr(l),k=So(l),S=Rn(l)==="y",{width:C,height:x}=c.floating;let E,T;v==="top"||v==="bottom"?(E=v,T=k===(await(f.isRTL==null?void 0:f.isRTL(h.floating))?"start":"end")?"left":"right"):(T=v,E=k==="end"?"top":"bottom");const _=x-y.top-y.bottom,j=C-y.left-y.right,A=qr(x-y[E],_),R=qr(C-y[T],j),D=!r.middlewareData.shift;let L=A,B=R;if((o=r.middlewareData.shift)!=null&&o.enabled.x&&(B=j),(i=r.middlewareData.shift)!=null&&i.enabled.y&&(L=_),D&&!k){const te=$t(y.left,0),ee=$t(y.right,0),F=$t(y.top,0),Q=$t(y.bottom,0);S?B=C-2*(te!==0||ee!==0?te+ee:$t(y.left,y.right)):L=x-2*(F!==0||Q!==0?F+Q:$t(y.top,y.bottom))}await g({...r,availableWidth:B,availableHeight:L});const P=await f.getDimensions(h.floating);return C!==P.width||x!==P.height?{reset:{rects:!0}}:{}}}};function ic(){return typeof window<"u"}function Eo(t){return yb(t)?(t.nodeName||"").toLowerCase():"#document"}function Zt(t){var r;return(t==null||(r=t.ownerDocument)==null?void 0:r.defaultView)||window}function Mn(t){var r;return(r=(yb(t)?t.ownerDocument:t.document)||window.document)==null?void 0:r.documentElement}function yb(t){return ic()?t instanceof Node||t instanceof Zt(t).Node:!1}function bn(t){return ic()?t instanceof Element||t instanceof Zt(t).Element:!1}function ar(t){return ic()?t instanceof HTMLElement||t instanceof Zt(t).HTMLElement:!1}function uy(t){return!ic()||typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof Zt(t).ShadowRoot}function Is(t){const{overflow:r,overflowX:o,overflowY:i,display:l}=wn(t);return/auto|scroll|overlay|hidden|clip/.test(r+i+o)&&l!=="inline"&&l!=="contents"}function zT(t){return/^(table|td|th)$/.test(Eo(t))}function lc(t){try{if(t.matches(":popover-open"))return!0}catch{}try{return t.matches(":modal")}catch{return!1}}const HT=/transform|translate|scale|rotate|perspective|filter/,BT=/paint|layout|strict|content/,ia=t=>!!t&&t!=="none";let Gd;function gm(t){const r=bn(t)?wn(t):t;return ia(r.transform)||ia(r.translate)||ia(r.scale)||ia(r.rotate)||ia(r.perspective)||!vm()&&(ia(r.backdropFilter)||ia(r.filter))||HT.test(r.willChange||"")||BT.test(r.contain||"")}function WT(t){let r=Ir(t);for(;ar(r)&&!ho(r);){if(gm(r))return r;if(lc(r))return null;r=Ir(r)}return null}function vm(){return Gd==null&&(Gd=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),Gd}function ho(t){return/^(html|body|#document)$/.test(Eo(t))}function wn(t){return Zt(t).getComputedStyle(t)}function cc(t){return bn(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function Ir(t){if(Eo(t)==="html")return t;const r=t.assignedSlot||t.parentNode||uy(t)&&t.host||Mn(t);return uy(r)?r.host:r}function bb(t){const r=Ir(t);return ho(r)?t.ownerDocument?t.ownerDocument.body:t.body:ar(r)&&Is(r)?r:bb(r)}function Ds(t,r,o){var i;r===void 0&&(r=[]),o===void 0&&(o=!0);const l=bb(t),c=l===((i=t.ownerDocument)==null?void 0:i.body),f=Zt(l);if(c){const h=Of(f);return r.concat(f,f.visualViewport||[],Is(l)?l:[],h&&o?Ds(h):[])}else return r.concat(l,Ds(l,[],o))}function Of(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function wb(t){const r=wn(t);let o=parseFloat(r.width)||0,i=parseFloat(r.height)||0;const l=ar(t),c=l?t.offsetWidth:o,f=l?t.offsetHeight:i,h=Wl(o)!==c||Wl(i)!==f;return h&&(o=c,i=f),{width:o,height:i,$:h}}function ym(t){return bn(t)?t:t.contextElement}function io(t){const r=ym(t);if(!ar(r))return On(1);const o=r.getBoundingClientRect(),{width:i,height:l,$:c}=wb(r);let f=(c?Wl(o.width):o.width)/i,h=(c?Wl(o.height):o.height)/l;return(!f||!Number.isFinite(f))&&(f=1),(!h||!Number.isFinite(h))&&(h=1),{x:f,y:h}}const UT=On(0);function xb(t){const r=Zt(t);return!vm()||!r.visualViewport?UT:{x:r.visualViewport.offsetLeft,y:r.visualViewport.offsetTop}}function qT(t,r,o){return r===void 0&&(r=!1),!o||r&&o!==Zt(t)?!1:r}function pa(t,r,o,i){r===void 0&&(r=!1),o===void 0&&(o=!1);const l=t.getBoundingClientRect(),c=ym(t);let f=On(1);r&&(i?bn(i)&&(f=io(i)):f=io(t));const h=qT(c,o,i)?xb(c):On(0);let g=(l.left+h.x)/f.x,m=(l.top+h.y)/f.y,y=l.width/f.x,v=l.height/f.y;if(c){const k=Zt(c),S=i&&bn(i)?Zt(i):i;let C=k,x=Of(C);for(;x&&i&&S!==C;){const E=io(x),T=x.getBoundingClientRect(),_=wn(x),j=T.left+(x.clientLeft+parseFloat(_.paddingLeft))*E.x,A=T.top+(x.clientTop+parseFloat(_.paddingTop))*E.y;g*=E.x,m*=E.y,y*=E.x,v*=E.y,g+=j,m+=A,C=Zt(x),x=Of(C)}}return ql({width:y,height:v,x:g,y:m})}function uc(t,r){const o=cc(t).scrollLeft;return r?r.left+o:pa(Mn(t)).left+o}function kb(t,r){const o=t.getBoundingClientRect(),i=o.left+r.scrollLeft-uc(t,o),l=o.top+r.scrollTop;return{x:i,y:l}}function IT(t){let{elements:r,rect:o,offsetParent:i,strategy:l}=t;const c=l==="fixed",f=Mn(i),h=r?lc(r.floating):!1;if(i===f||h&&c)return o;let g={scrollLeft:0,scrollTop:0},m=On(1);const y=On(0),v=ar(i);if((v||!v&&!c)&&((Eo(i)!=="body"||Is(f))&&(g=cc(i)),v)){const S=pa(i);m=io(i),y.x=S.x+i.clientLeft,y.y=S.y+i.clientTop}const k=f&&!v&&!c?kb(f,g):On(0);return{width:o.width*m.x,height:o.height*m.y,x:o.x*m.x-g.scrollLeft*m.x+y.x+k.x,y:o.y*m.y-g.scrollTop*m.y+y.y+k.y}}function PT(t){return Array.from(t.getClientRects())}function KT(t){const r=Mn(t),o=cc(t),i=t.ownerDocument.body,l=$t(r.scrollWidth,r.clientWidth,i.scrollWidth,i.clientWidth),c=$t(r.scrollHeight,r.clientHeight,i.scrollHeight,i.clientHeight);let f=-o.scrollLeft+uc(t);const h=-o.scrollTop;return wn(i).direction==="rtl"&&(f+=$t(r.clientWidth,i.clientWidth)-l),{width:l,height:c,x:f,y:h}}const dy=25;function FT(t,r){const o=Zt(t),i=Mn(t),l=o.visualViewport;let c=i.clientWidth,f=i.clientHeight,h=0,g=0;if(l){c=l.width,f=l.height;const y=vm();(!y||y&&r==="fixed")&&(h=l.offsetLeft,g=l.offsetTop)}const m=uc(i);if(m<=0){const y=i.ownerDocument,v=y.body,k=getComputedStyle(v),S=y.compatMode==="CSS1Compat"&&parseFloat(k.marginLeft)+parseFloat(k.marginRight)||0,C=Math.abs(i.clientWidth-v.clientWidth-S);C<=dy&&(c-=C)}else m<=dy&&(c+=m);return{width:c,height:f,x:h,y:g}}function YT(t,r){const o=pa(t,!0,r==="fixed"),i=o.top+t.clientTop,l=o.left+t.clientLeft,c=ar(t)?io(t):On(1),f=t.clientWidth*c.x,h=t.clientHeight*c.y,g=l*c.x,m=i*c.y;return{width:f,height:h,x:g,y:m}}function fy(t,r,o){let i;if(r==="viewport")i=FT(t,o);else if(r==="document")i=KT(Mn(t));else if(bn(r))i=YT(r,o);else{const l=xb(t);i={x:r.x-l.x,y:r.y-l.y,width:r.width,height:r.height}}return ql(i)}function Sb(t,r){const o=Ir(t);return o===r||!bn(o)||ho(o)?!1:wn(o).position==="fixed"||Sb(o,r)}function VT(t,r){const o=r.get(t);if(o)return o;let i=Ds(t,[],!1).filter(h=>bn(h)&&Eo(h)!=="body"),l=null;const c=wn(t).position==="fixed";let f=c?Ir(t):t;for(;bn(f)&&!ho(f);){const h=wn(f),g=gm(f);!g&&h.position==="fixed"&&(l=null),(c?!g&&!l:!g&&h.position==="static"&&!!l&&(l.position==="absolute"||l.position==="fixed")||Is(f)&&!g&&Sb(t,f))?i=i.filter(y=>y!==f):l=h,f=Ir(f)}return r.set(t,i),i}function GT(t){let{element:r,boundary:o,rootBoundary:i,strategy:l}=t;const f=[...o==="clippingAncestors"?lc(r)?[]:VT(r,this._c):[].concat(o),i],h=fy(r,f[0],l);let g=h.top,m=h.right,y=h.bottom,v=h.left;for(let k=1;k<f.length;k++){const S=fy(r,f[k],l);g=$t(S.top,g),m=qr(S.right,m),y=qr(S.bottom,y),v=$t(S.left,v)}return{width:m-v,height:y-g,x:v,y:g}}function $T(t){const{width:r,height:o}=wb(t);return{width:r,height:o}}function XT(t,r,o){const i=ar(r),l=Mn(r),c=o==="fixed",f=pa(t,!0,c,r);let h={scrollLeft:0,scrollTop:0};const g=On(0);function m(){g.x=uc(l)}if(i||!i&&!c)if((Eo(r)!=="body"||Is(l))&&(h=cc(r)),i){const S=pa(r,!0,c,r);g.x=S.x+r.clientLeft,g.y=S.y+r.clientTop}else l&&m();c&&!i&&l&&m();const y=l&&!i&&!c?kb(l,h):On(0),v=f.left+h.scrollLeft-g.x-y.x,k=f.top+h.scrollTop-g.y-y.y;return{x:v,y:k,width:f.width,height:f.height}}function $d(t){return wn(t).position==="static"}function my(t,r){if(!ar(t)||wn(t).position==="fixed")return null;if(r)return r(t);let o=t.offsetParent;return Mn(t)===o&&(o=o.ownerDocument.body),o}function Eb(t,r){const o=Zt(t);if(lc(t))return o;if(!ar(t)){let l=Ir(t);for(;l&&!ho(l);){if(bn(l)&&!$d(l))return l;l=Ir(l)}return o}let i=my(t,r);for(;i&&zT(i)&&$d(i);)i=my(i,r);return i&&ho(i)&&$d(i)&&!gm(i)?o:i||WT(t)||o}const ZT=async function(t){const r=this.getOffsetParent||Eb,o=this.getDimensions,i=await o(t.floating);return{reference:XT(t.reference,await r(t.floating),t.strategy),floating:{x:0,y:0,width:i.width,height:i.height}}};function QT(t){return wn(t).direction==="rtl"}const JT={convertOffsetParentRelativeRectToViewportRelativeRect:IT,getDocumentElement:Mn,getClippingRect:GT,getOffsetParent:Eb,getElementRects:ZT,getClientRects:PT,getDimensions:$T,getScale:io,isElement:bn,isRTL:QT};function Cb(t,r){return t.x===r.x&&t.y===r.y&&t.width===r.width&&t.height===r.height}function eA(t,r){let o=null,i;const l=Mn(t);function c(){var h;clearTimeout(i),(h=o)==null||h.disconnect(),o=null}function f(h,g){h===void 0&&(h=!1),g===void 0&&(g=1),c();const m=t.getBoundingClientRect(),{left:y,top:v,width:k,height:S}=m;if(h||r(),!k||!S)return;const C=gl(v),x=gl(l.clientWidth-(y+k)),E=gl(l.clientHeight-(v+S)),T=gl(y),j={rootMargin:-C+"px "+-x+"px "+-E+"px "+-T+"px",threshold:$t(0,qr(1,g))||1};let A=!0;function R(D){const L=D[0].intersectionRatio;if(L!==g){if(!A)return f();L?f(!1,L):i=setTimeout(()=>{f(!1,1e-7)},1e3)}L===1&&!Cb(m,t.getBoundingClientRect())&&f(),A=!1}try{o=new IntersectionObserver(R,{...j,root:l.ownerDocument})}catch{o=new IntersectionObserver(R,j)}o.observe(t)}return f(!0),c}function tA(t,r,o,i){i===void 0&&(i={});const{ancestorScroll:l=!0,ancestorResize:c=!0,elementResize:f=typeof ResizeObserver=="function",layoutShift:h=typeof IntersectionObserver=="function",animationFrame:g=!1}=i,m=ym(t),y=l||c?[...m?Ds(m):[],...r?Ds(r):[]]:[];y.forEach(T=>{l&&T.addEventListener("scroll",o,{passive:!0}),c&&T.addEventListener("resize",o)});const v=m&&h?eA(m,o):null;let k=-1,S=null;f&&(S=new ResizeObserver(T=>{let[_]=T;_&&_.target===m&&S&&r&&(S.unobserve(r),cancelAnimationFrame(k),k=requestAnimationFrame(()=>{var j;(j=S)==null||j.observe(r)})),o()}),m&&!g&&S.observe(m),r&&S.observe(r));let C,x=g?pa(t):null;g&&E();function E(){const T=pa(t);x&&!Cb(x,T)&&o(),x=T,C=requestAnimationFrame(E)}return o(),()=>{var T;y.forEach(_=>{l&&_.removeEventListener("scroll",o),c&&_.removeEventListener("resize",o)}),v?.(),(T=S)==null||T.disconnect(),S=null,g&&cancelAnimationFrame(C)}}const nA=OT,rA=DT,aA=NT,oA=LT,sA=jT,py=_T,iA=MT,lA=(t,r,o)=>{const i=new Map,l={platform:JT,...o},c={...l.platform,_c:i};return AT(t,r,{...l,platform:c})};var cA=typeof document<"u",uA=function(){},Tl=cA?b.useLayoutEffect:uA;function Il(t,r){if(t===r)return!0;if(typeof t!=typeof r)return!1;if(typeof t=="function"&&t.toString()===r.toString())return!0;let o,i,l;if(t&&r&&typeof t=="object"){if(Array.isArray(t)){if(o=t.length,o!==r.length)return!1;for(i=o;i--!==0;)if(!Il(t[i],r[i]))return!1;return!0}if(l=Object.keys(t),o=l.length,o!==Object.keys(r).length)return!1;for(i=o;i--!==0;)if(!{}.hasOwnProperty.call(r,l[i]))return!1;for(i=o;i--!==0;){const c=l[i];if(!(c==="_owner"&&t.$$typeof)&&!Il(t[c],r[c]))return!1}return!0}return t!==t&&r!==r}function Tb(t){return typeof window>"u"?1:(t.ownerDocument.defaultView||window).devicePixelRatio||1}function hy(t,r){const o=Tb(t);return Math.round(r*o)/o}function Xd(t){const r=b.useRef(t);return Tl(()=>{r.current=t}),r}function dA(t){t===void 0&&(t={});const{placement:r="bottom",strategy:o="absolute",middleware:i=[],platform:l,elements:{reference:c,floating:f}={},transform:h=!0,whileElementsMounted:g,open:m}=t,[y,v]=b.useState({x:0,y:0,strategy:o,placement:r,middlewareData:{},isPositioned:!1}),[k,S]=b.useState(i);Il(k,i)||S(i);const[C,x]=b.useState(null),[E,T]=b.useState(null),_=b.useCallback(U=>{U!==D.current&&(D.current=U,x(U))},[]),j=b.useCallback(U=>{U!==L.current&&(L.current=U,T(U))},[]),A=c||C,R=f||E,D=b.useRef(null),L=b.useRef(null),B=b.useRef(y),P=g!=null,te=Xd(g),ee=Xd(l),F=Xd(m),Q=b.useCallback(()=>{if(!D.current||!L.current)return;const U={placement:r,strategy:o,middleware:k};ee.current&&(U.platform=ee.current),lA(D.current,L.current,U).then(I=>{const X={...I,isPositioned:F.current!==!1};Z.current&&!Il(B.current,X)&&(B.current=X,sc.flushSync(()=>{v(X)}))})},[k,r,o,ee,F]);Tl(()=>{m===!1&&B.current.isPositioned&&(B.current.isPositioned=!1,v(U=>({...U,isPositioned:!1})))},[m]);const Z=b.useRef(!1);Tl(()=>(Z.current=!0,()=>{Z.current=!1}),[]),Tl(()=>{if(A&&(D.current=A),R&&(L.current=R),A&&R){if(te.current)return te.current(A,R,Q);Q()}},[A,R,Q,te,P]);const $=b.useMemo(()=>({reference:D,floating:L,setReference:_,setFloating:j}),[_,j]),M=b.useMemo(()=>({reference:A,floating:R}),[A,R]),K=b.useMemo(()=>{const U={position:o,left:0,top:0};if(!M.floating)return U;const I=hy(M.floating,y.x),X=hy(M.floating,y.y);return h?{...U,transform:"translate("+I+"px, "+X+"px)",...Tb(M.floating)>=1.5&&{willChange:"transform"}}:{position:o,left:I,top:X}},[o,h,M.floating,y.x,y.y]);return b.useMemo(()=>({...y,update:Q,refs:$,elements:M,floatingStyles:K}),[y,Q,$,M,K])}const fA=t=>{function r(o){return{}.hasOwnProperty.call(o,"current")}return{name:"arrow",options:t,fn(o){const{element:i,padding:l}=typeof t=="function"?t(o):t;return i&&r(i)?i.current!=null?py({element:i.current,padding:l}).fn(o):{}:i?py({element:i,padding:l}).fn(o):{}}}},mA=(t,r)=>{const o=nA(t);return{name:o.name,fn:o.fn,options:[t,r]}},pA=(t,r)=>{const o=rA(t);return{name:o.name,fn:o.fn,options:[t,r]}},hA=(t,r)=>({fn:iA(t).fn,options:[t,r]}),gA=(t,r)=>{const o=aA(t);return{name:o.name,fn:o.fn,options:[t,r]}},vA=(t,r)=>{const o=oA(t);return{name:o.name,fn:o.fn,options:[t,r]}},yA=(t,r)=>{const o=sA(t);return{name:o.name,fn:o.fn,options:[t,r]}},bA=(t,r)=>{const o=fA(t);return{name:o.name,fn:o.fn,options:[t,r]}};var wA="Arrow",Ab=b.forwardRef((t,r)=>{const{children:o,width:i=10,height:l=5,...c}=t;return d.jsx(Bt.svg,{...c,ref:r,width:i,height:l,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:t.asChild?o:d.jsx("polygon",{points:"0,0 30,0 15,10"})})});Ab.displayName=wA;var xA=Ab;function kA(t){const[r,o]=b.useState(void 0);return Ur(()=>{if(t){o({width:t.offsetWidth,height:t.offsetHeight});const i=new ResizeObserver(l=>{if(!Array.isArray(l)||!l.length)return;const c=l[0];let f,h;if("borderBoxSize"in c){const g=c.borderBoxSize,m=Array.isArray(g)?g[0]:g;f=m.inlineSize,h=m.blockSize}else f=t.offsetWidth,h=t.offsetHeight;o({width:f,height:h})});return i.observe(t,{box:"border-box"}),()=>i.unobserve(t)}else o(void 0)},[t]),r}var bm="Popper",[_b,Nb]=dm(bm),[SA,jb]=_b(bm),Rb=t=>{const{__scopePopper:r,children:o}=t,[i,l]=b.useState(null);return d.jsx(SA,{scope:r,anchor:i,onAnchorChange:l,children:o})};Rb.displayName=bm;var Ob="PopperAnchor",Db=b.forwardRef((t,r)=>{const{__scopePopper:o,virtualRef:i,...l}=t,c=jb(Ob,o),f=b.useRef(null),h=xn(r,f),g=b.useRef(null);return b.useEffect(()=>{const m=g.current;g.current=i?.current||f.current,m!==g.current&&c.onAnchorChange(g.current)}),i?null:d.jsx(Bt.div,{...l,ref:h})});Db.displayName=Ob;var wm="PopperContent",[EA,CA]=_b(wm),Mb=b.forwardRef((t,r)=>{const{__scopePopper:o,side:i="bottom",sideOffset:l=0,align:c="center",alignOffset:f=0,arrowPadding:h=0,avoidCollisions:g=!0,collisionBoundary:m=[],collisionPadding:y=0,sticky:v="partial",hideWhenDetached:k=!1,updatePositionStrategy:S="optimized",onPlaced:C,...x}=t,E=jb(wm,o),[T,_]=b.useState(null),j=xn(r,le=>_(le)),[A,R]=b.useState(null),D=kA(A),L=D?.width??0,B=D?.height??0,P=i+(c!=="center"?"-"+c:""),te=typeof y=="number"?y:{top:0,right:0,bottom:0,left:0,...y},ee=Array.isArray(m)?m:[m],F=ee.length>0,Q={padding:te,boundary:ee.filter(AA),altBoundary:F},{refs:Z,floatingStyles:$,placement:M,isPositioned:K,middlewareData:U}=dA({strategy:"fixed",placement:P,whileElementsMounted:(...le)=>tA(...le,{animationFrame:S==="always"}),elements:{reference:E.anchor},middleware:[mA({mainAxis:l+B,alignmentAxis:f}),g&&pA({mainAxis:!0,crossAxis:!1,limiter:v==="partial"?hA():void 0,...Q}),g&&gA({...Q}),vA({...Q,apply:({elements:le,rects:ie,availableWidth:se,availableHeight:de})=>{const{width:me,height:Te}=ie.reference,Ce=le.floating.style;Ce.setProperty("--radix-popper-available-width",`${se}px`),Ce.setProperty("--radix-popper-available-height",`${de}px`),Ce.setProperty("--radix-popper-anchor-width",`${me}px`),Ce.setProperty("--radix-popper-anchor-height",`${Te}px`)}}),A&&bA({element:A,padding:h}),_A({arrowWidth:L,arrowHeight:B}),k&&yA({strategy:"referenceHidden",...Q})]}),[I,X]=Hb(M),O=po(C);Ur(()=>{K&&O?.()},[K,O]);const W=U.arrow?.x,oe=U.arrow?.y,ue=U.arrow?.centerOffset!==0,[fe,pe]=b.useState();return Ur(()=>{T&&pe(window.getComputedStyle(T).zIndex)},[T]),d.jsx("div",{ref:Z.setFloating,"data-radix-popper-content-wrapper":"",style:{...$,transform:K?$.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:fe,"--radix-popper-transform-origin":[U.transformOrigin?.x,U.transformOrigin?.y].join(" "),...U.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:t.dir,children:d.jsx(EA,{scope:o,placedSide:I,onArrowChange:R,arrowX:W,arrowY:oe,shouldHideArrow:ue,children:d.jsx(Bt.div,{"data-side":I,"data-align":X,...x,ref:j,style:{...x.style,animation:K?void 0:"none"}})})})});Mb.displayName=wm;var Lb="PopperArrow",TA={top:"bottom",right:"left",bottom:"top",left:"right"},zb=b.forwardRef(function(r,o){const{__scopePopper:i,...l}=r,c=CA(Lb,i),f=TA[c.placedSide];return d.jsx("span",{ref:c.onArrowChange,style:{position:"absolute",left:c.arrowX,top:c.arrowY,[f]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[c.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[c.placedSide],visibility:c.shouldHideArrow?"hidden":void 0},children:d.jsx(xA,{...l,ref:o,style:{...l.style,display:"block"}})})});zb.displayName=Lb;function AA(t){return t!==null}var _A=t=>({name:"transformOrigin",options:t,fn(r){const{placement:o,rects:i,middlewareData:l}=r,f=l.arrow?.centerOffset!==0,h=f?0:t.arrowWidth,g=f?0:t.arrowHeight,[m,y]=Hb(o),v={start:"0%",center:"50%",end:"100%"}[y],k=(l.arrow?.x??0)+h/2,S=(l.arrow?.y??0)+g/2;let C="",x="";return m==="bottom"?(C=f?v:`${k}px`,x=`${-g}px`):m==="top"?(C=f?v:`${k}px`,x=`${i.floating.height+g}px`):m==="right"?(C=`${-g}px`,x=f?v:`${S}px`):m==="left"&&(C=`${i.floating.width+g}px`,x=f?v:`${S}px`),{data:{x:C,y:x}}}});function Hb(t){const[r,o="center"]=t.split("-");return[r,o]}var NA=Rb,jA=Db,RA=Mb,OA=zb,DA="Portal",xm=b.forwardRef((t,r)=>{const{container:o,...i}=t,[l,c]=b.useState(!1);Ur(()=>c(!0),[]);const f=o||l&&globalThis?.document?.body;return f?QC.createPortal(d.jsx(Bt.div,{...i,ref:r}),f):null});xm.displayName=DA;function MA(t,r){return b.useReducer((o,i)=>r[o][i]??o,t)}var Co=t=>{const{present:r,children:o}=t,i=LA(r),l=typeof o=="function"?o({present:i.isPresent}):b.Children.only(o),c=xn(i.ref,zA(l));return typeof o=="function"||i.isPresent?b.cloneElement(l,{ref:c}):null};Co.displayName="Presence";function LA(t){const[r,o]=b.useState(),i=b.useRef(null),l=b.useRef(t),c=b.useRef("none"),f=t?"mounted":"unmounted",[h,g]=MA(f,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return b.useEffect(()=>{const m=vl(i.current);c.current=h==="mounted"?m:"none"},[h]),Ur(()=>{const m=i.current,y=l.current;if(y!==t){const k=c.current,S=vl(m);t?g("MOUNT"):S==="none"||m?.display==="none"?g("UNMOUNT"):g(y&&k!==S?"ANIMATION_OUT":"UNMOUNT"),l.current=t}},[t,g]),Ur(()=>{if(r){let m;const y=r.ownerDocument.defaultView??window,v=S=>{const x=vl(i.current).includes(CSS.escape(S.animationName));if(S.target===r&&x&&(g("ANIMATION_END"),!l.current)){const E=r.style.animationFillMode;r.style.animationFillMode="forwards",m=y.setTimeout(()=>{r.style.animationFillMode==="forwards"&&(r.style.animationFillMode=E)})}},k=S=>{S.target===r&&(c.current=vl(i.current))};return r.addEventListener("animationstart",k),r.addEventListener("animationcancel",v),r.addEventListener("animationend",v),()=>{y.clearTimeout(m),r.removeEventListener("animationstart",k),r.removeEventListener("animationcancel",v),r.removeEventListener("animationend",v)}}else g("ANIMATION_END")},[r,g]),{isPresent:["mounted","unmountSuspended"].includes(h),ref:b.useCallback(m=>{i.current=m?getComputedStyle(m):null,o(m)},[])}}function vl(t){return t?.animationName||"none"}function zA(t){let r=Object.getOwnPropertyDescriptor(t.props,"ref")?.get,o=r&&"isReactWarning"in r&&r.isReactWarning;return o?t.ref:(r=Object.getOwnPropertyDescriptor(t,"ref")?.get,o=r&&"isReactWarning"in r&&r.isReactWarning,o?t.props.ref:t.props.ref||t.ref)}var HA=_0[" useInsertionEffect ".trim().toString()]||Ur;function Bb({prop:t,defaultProp:r,onChange:o=()=>{},caller:i}){const[l,c,f]=BA({defaultProp:r,onChange:o}),h=t!==void 0,g=h?t:l;{const y=b.useRef(t!==void 0);b.useEffect(()=>{const v=y.current;v!==h&&console.warn(`${i} is changing from ${v?"controlled":"uncontrolled"} to ${h?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),y.current=h},[h,i])}const m=b.useCallback(y=>{if(h){const v=WA(y)?y(t):y;v!==t&&f.current?.(v)}else c(y)},[h,t,c,f]);return[g,m]}function BA({defaultProp:t,onChange:r}){const[o,i]=b.useState(t),l=b.useRef(o),c=b.useRef(r);return HA(()=>{c.current=r},[r]),b.useEffect(()=>{l.current!==o&&(c.current?.(o),l.current=o)},[o,l]),[o,i,c]}function WA(t){return typeof t=="function"}var UA=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),qA="VisuallyHidden",Wb=b.forwardRef((t,r)=>d.jsx(Bt.span,{...t,ref:r,style:{...UA,...t.style}}));Wb.displayName=qA;var IA=Wb,[dc]=dm("Tooltip",[Nb]),fc=Nb(),Ub="TooltipProvider",PA=700,Df="tooltip.open",[KA,km]=dc(Ub),qb=t=>{const{__scopeTooltip:r,delayDuration:o=PA,skipDelayDuration:i=300,disableHoverableContent:l=!1,children:c}=t,f=b.useRef(!0),h=b.useRef(!1),g=b.useRef(0);return b.useEffect(()=>{const m=g.current;return()=>window.clearTimeout(m)},[]),d.jsx(KA,{scope:r,isOpenDelayedRef:f,delayDuration:o,onOpen:b.useCallback(()=>{window.clearTimeout(g.current),f.current=!1},[]),onClose:b.useCallback(()=>{window.clearTimeout(g.current),g.current=window.setTimeout(()=>f.current=!0,i)},[i]),isPointerInTransitRef:h,onPointerInTransitChange:b.useCallback(m=>{h.current=m},[]),disableHoverableContent:l,children:c})};qb.displayName=Ub;var Ms="Tooltip",[FA,Ps]=dc(Ms),Ib=t=>{const{__scopeTooltip:r,children:o,open:i,defaultOpen:l,onOpenChange:c,disableHoverableContent:f,delayDuration:h}=t,g=km(Ms,t.__scopeTooltip),m=fc(r),[y,v]=b.useState(null),k=Cl(),S=b.useRef(0),C=f??g.disableHoverableContent,x=h??g.delayDuration,E=b.useRef(!1),[T,_]=Bb({prop:i,defaultProp:l??!1,onChange:L=>{L?(g.onOpen(),document.dispatchEvent(new CustomEvent(Df))):g.onClose(),c?.(L)},caller:Ms}),j=b.useMemo(()=>T?E.current?"delayed-open":"instant-open":"closed",[T]),A=b.useCallback(()=>{window.clearTimeout(S.current),S.current=0,E.current=!1,_(!0)},[_]),R=b.useCallback(()=>{window.clearTimeout(S.current),S.current=0,_(!1)},[_]),D=b.useCallback(()=>{window.clearTimeout(S.current),S.current=window.setTimeout(()=>{E.current=!0,_(!0),S.current=0},x)},[x,_]);return b.useEffect(()=>()=>{S.current&&(window.clearTimeout(S.current),S.current=0)},[]),d.jsx(NA,{...m,children:d.jsx(FA,{scope:r,contentId:k,open:T,stateAttribute:j,trigger:y,onTriggerChange:v,onTriggerEnter:b.useCallback(()=>{g.isOpenDelayedRef.current?D():A()},[g.isOpenDelayedRef,D,A]),onTriggerLeave:b.useCallback(()=>{C?R():(window.clearTimeout(S.current),S.current=0)},[R,C]),onOpen:A,onClose:R,disableHoverableContent:C,children:o})})};Ib.displayName=Ms;var Mf="TooltipTrigger",Pb=b.forwardRef((t,r)=>{const{__scopeTooltip:o,...i}=t,l=Ps(Mf,o),c=km(Mf,o),f=fc(o),h=b.useRef(null),g=xn(r,h,l.onTriggerChange),m=b.useRef(!1),y=b.useRef(!1),v=b.useCallback(()=>m.current=!1,[]);return b.useEffect(()=>()=>document.removeEventListener("pointerup",v),[v]),d.jsx(jA,{asChild:!0,...f,children:d.jsx(Bt.button,{"aria-describedby":l.open?l.contentId:void 0,"data-state":l.stateAttribute,...i,ref:g,onPointerMove:Lt(t.onPointerMove,k=>{k.pointerType!=="touch"&&!y.current&&!c.isPointerInTransitRef.current&&(l.onTriggerEnter(),y.current=!0)}),onPointerLeave:Lt(t.onPointerLeave,()=>{l.onTriggerLeave(),y.current=!1}),onPointerDown:Lt(t.onPointerDown,()=>{l.open&&l.onClose(),m.current=!0,document.addEventListener("pointerup",v,{once:!0})}),onFocus:Lt(t.onFocus,()=>{m.current||l.onOpen()}),onBlur:Lt(t.onBlur,l.onClose),onClick:Lt(t.onClick,l.onClose)})})});Pb.displayName=Mf;var Sm="TooltipPortal",[YA,VA]=dc(Sm,{forceMount:void 0}),Kb=t=>{const{__scopeTooltip:r,forceMount:o,children:i,container:l}=t,c=Ps(Sm,r);return d.jsx(YA,{scope:r,forceMount:o,children:d.jsx(Co,{present:o||c.open,children:d.jsx(xm,{asChild:!0,container:l,children:i})})})};Kb.displayName=Sm;var go="TooltipContent",Fb=b.forwardRef((t,r)=>{const o=VA(go,t.__scopeTooltip),{forceMount:i=o.forceMount,side:l="top",...c}=t,f=Ps(go,t.__scopeTooltip);return d.jsx(Co,{present:i||f.open,children:f.disableHoverableContent?d.jsx(Yb,{side:l,...c,ref:r}):d.jsx(GA,{side:l,...c,ref:r})})}),GA=b.forwardRef((t,r)=>{const o=Ps(go,t.__scopeTooltip),i=km(go,t.__scopeTooltip),l=b.useRef(null),c=xn(r,l),[f,h]=b.useState(null),{trigger:g,onClose:m}=o,y=l.current,{onPointerInTransitChange:v}=i,k=b.useCallback(()=>{h(null),v(!1)},[v]),S=b.useCallback((C,x)=>{const E=C.currentTarget,T={x:C.clientX,y:C.clientY},_=JA(T,E.getBoundingClientRect()),j=e_(T,_),A=t_(x.getBoundingClientRect()),R=r_([...j,...A]);h(R),v(!0)},[v]);return b.useEffect(()=>()=>k(),[k]),b.useEffect(()=>{if(g&&y){const C=E=>S(E,y),x=E=>S(E,g);return g.addEventListener("pointerleave",C),y.addEventListener("pointerleave",x),()=>{g.removeEventListener("pointerleave",C),y.removeEventListener("pointerleave",x)}}},[g,y,S,k]),b.useEffect(()=>{if(f){const C=x=>{const E=x.target,T={x:x.clientX,y:x.clientY},_=g?.contains(E)||y?.contains(E),j=!n_(T,f);_?k():j&&(k(),m())};return document.addEventListener("pointermove",C),()=>document.removeEventListener("pointermove",C)}},[g,y,f,m,k]),d.jsx(Yb,{...t,ref:c})}),[$A,XA]=dc(Ms,{isInside:!1}),ZA=eT("TooltipContent"),Yb=b.forwardRef((t,r)=>{const{__scopeTooltip:o,children:i,"aria-label":l,onEscapeKeyDown:c,onPointerDownOutside:f,...h}=t,g=Ps(go,o),m=fc(o),{onClose:y}=g;return b.useEffect(()=>(document.addEventListener(Df,y),()=>document.removeEventListener(Df,y)),[y]),b.useEffect(()=>{if(g.trigger){const v=k=>{k.target?.contains(g.trigger)&&y()};return window.addEventListener("scroll",v,{capture:!0}),()=>window.removeEventListener("scroll",v,{capture:!0})}},[g.trigger,y]),d.jsx(fm,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:c,onPointerDownOutside:f,onFocusOutside:v=>v.preventDefault(),onDismiss:y,children:d.jsxs(RA,{"data-state":g.stateAttribute,...m,...h,ref:r,style:{...h.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[d.jsx(ZA,{children:i}),d.jsx($A,{scope:o,isInside:!0,children:d.jsx(IA,{id:g.contentId,role:"tooltip",children:l||i})})]})})});Fb.displayName=go;var Vb="TooltipArrow",QA=b.forwardRef((t,r)=>{const{__scopeTooltip:o,...i}=t,l=fc(o);return XA(Vb,o).isInside?null:d.jsx(OA,{...l,...i,ref:r})});QA.displayName=Vb;function JA(t,r){const o=Math.abs(r.top-t.y),i=Math.abs(r.bottom-t.y),l=Math.abs(r.right-t.x),c=Math.abs(r.left-t.x);switch(Math.min(o,i,l,c)){case c:return"left";case l:return"right";case o:return"top";case i:return"bottom";default:throw new Error("unreachable")}}function e_(t,r,o=5){const i=[];switch(r){case"top":i.push({x:t.x-o,y:t.y+o},{x:t.x+o,y:t.y+o});break;case"bottom":i.push({x:t.x-o,y:t.y-o},{x:t.x+o,y:t.y-o});break;case"left":i.push({x:t.x+o,y:t.y-o},{x:t.x+o,y:t.y+o});break;case"right":i.push({x:t.x-o,y:t.y-o},{x:t.x-o,y:t.y+o});break}return i}function t_(t){const{top:r,right:o,bottom:i,left:l}=t;return[{x:l,y:r},{x:o,y:r},{x:o,y:i},{x:l,y:i}]}function n_(t,r){const{x:o,y:i}=t;let l=!1;for(let c=0,f=r.length-1;c<r.length;f=c++){const h=r[c],g=r[f],m=h.x,y=h.y,v=g.x,k=g.y;y>i!=k>i&&o<(v-m)*(i-y)/(k-y)+m&&(l=!l)}return l}function r_(t){const r=t.slice();return r.sort((o,i)=>o.x<i.x?-1:o.x>i.x?1:o.y<i.y?-1:o.y>i.y?1:0),a_(r)}function a_(t){if(t.length<=1)return t.slice();const r=[];for(let i=0;i<t.length;i++){const l=t[i];for(;r.length>=2;){const c=r[r.length-1],f=r[r.length-2];if((c.x-f.x)*(l.y-f.y)>=(c.y-f.y)*(l.x-f.x))r.pop();else break}r.push(l)}r.pop();const o=[];for(let i=t.length-1;i>=0;i--){const l=t[i];for(;o.length>=2;){const c=o[o.length-1],f=o[o.length-2];if((c.x-f.x)*(l.y-f.y)>=(c.y-f.y)*(l.x-f.x))o.pop();else break}o.push(l)}return o.pop(),r.length===1&&o.length===1&&r[0].x===o[0].x&&r[0].y===o[0].y?r:r.concat(o)}var Gb=qb,o_=Ib,s_=Pb,i_=Kb,l_=Fb;const ct=({children:t,label:r,side:o="top",align:i="center"})=>r?d.jsx(Gb,{delayDuration:250,skipDelayDuration:150,children:d.jsxs(o_,{children:[d.jsx(s_,{asChild:!0,children:t}),d.jsx(i_,{children:d.jsx(l_,{className:"tooltip",side:o,align:i,sideOffset:6,children:r})})]})}):d.jsx(d.Fragment,{children:t}),c_=({tabs:t,activeId:r,onSelect:o,onClose:i,onClosePanel:l,onNewShell:c,newShellPending:f})=>{const{t:h}=Ee();return d.jsxs("div",{role:"tablist","aria-label":h("terminalPanel.tablistAria"),className:"scrollbar-thin flex h-9 min-h-9 w-full items-stretch overflow-x-auto pointer-coarse:h-12 pointer-coarse:min-h-12",style:{background:"var(--bg-2)",borderBottom:"1px solid var(--border)"},"data-testid":"terminal-tab-strip",children:[t.map(g=>{const m=g.id===r,y=h("terminalPanel.closeTab",{name:g.label}),v=k=>{k.stopPropagation(),i(g.id)};return d.jsxs("div",{role:"tab","aria-selected":m,"data-testid":`terminal-tab-${g.id}`,onClick:()=>o(g.id),className:"group relative flex max-w-[200px] shrink-0 cursor-pointer items-center gap-1.5 border-r text-xs",style:{background:m?"var(--bg-1)":"transparent",borderRightColor:"var(--border)",color:m?"var(--text-primary)":"var(--text-secondary)"},children:[m?d.jsx("span",{"data-tab-accent":!0,"aria-hidden":!0,className:"pointer-events-none absolute top-0 right-0 left-0 h-0.5",style:{background:"var(--accent)"}}):null,d.jsxs("button",{type:"button","data-testid":`terminal-tab-select-${g.id}`,onClick:k=>{k.stopPropagation(),o(g.id)},className:"flex min-w-0 flex-1 items-center gap-1.5 py-2 pr-1 pl-3 text-left",style:{color:"inherit"},children:[d.jsx(cm,{size:12,"aria-hidden":!0}),d.jsx("span",{className:"truncate",children:g.label})]}),d.jsx(ct,{label:y,children:d.jsx("button",{type:"button","aria-label":y,"data-testid":`terminal-tab-close-${g.id}`,onClick:v,className:`mr-1 rounded p-0.5 pointer-coarse:p-2 transition ${m?"opacity-100":"opacity-0 group-hover:opacity-100 pointer-coarse:opacity-100"}`,style:{color:"var(--text-secondary)"},children:d.jsx(fo,{size:12,"aria-hidden":!0})})})]},g.id)}),d.jsxs("div",{className:"flex flex-1 items-center justify-end gap-1 px-2",children:[d.jsx(ct,{label:h("terminalPanel.closePanel"),children:d.jsx("button",{type:"button","aria-label":h("terminalPanel.closePanel"),"data-testid":"terminal-panel-close",onClick:l,className:"flex h-6 w-6 shrink-0 items-center justify-center rounded border text-sec transition hover:text-pri disabled:opacity-50 pointer-coarse:h-10 pointer-coarse:w-10",style:{borderColor:"var(--border)",background:"var(--bg-1)"},children:d.jsx(fo,{size:12,"aria-hidden":!0})})}),d.jsx(ct,{label:h("terminalPanel.newShell"),children:d.jsx("button",{type:"button","aria-label":h("terminalPanel.newShell"),"data-testid":"terminal-tab-new-shell",onClick:c,disabled:f,className:"flex h-6 w-6 shrink-0 items-center justify-center rounded border text-sec transition hover:text-pri disabled:opacity-50 pointer-coarse:h-10 pointer-coarse:w-10",style:{borderColor:"var(--border)",background:"var(--bg-1)"},children:f?d.jsx(xo,{size:12,className:"animate-spin","aria-hidden":!0}):d.jsx(As,{size:12,"aria-hidden":!0})})})]})]})},$b="hive.terminal-panel.height",Xb="hive.terminal-panel.collapsed",Lf=160,u_=.35,d_=160,_s=t=>{const r=typeof window<"u"?window.innerHeight:800,o=Math.max(Lf,r-d_);return Math.min(Math.max(t,Lf),o)},Zd=()=>{const t=typeof window<"u"?window.innerHeight:800;return _s(Math.floor(t*u_))},f_=()=>{try{const t=window.localStorage.getItem($b);if(!t)return Zd();const r=Number.parseInt(t,10);return Number.isFinite(r)?_s(r):Zd()}catch{return Zd()}},m_=()=>{try{return window.localStorage.getItem(Xb)==="1"}catch{return!1}},p_=()=>{const[t,r]=b.useState(()=>f_()),[o,i]=b.useState(()=>m_()),[l,c]=b.useState(!1);b.useEffect(()=>{try{window.localStorage.setItem($b,String(Math.round(t)))}catch{}},[t]),b.useEffect(()=>{try{window.localStorage.setItem(Xb,o?"1":"0")}catch{}},[o]),b.useEffect(()=>{const m=()=>r(y=>_s(y));return window.addEventListener("resize",m),()=>window.removeEventListener("resize",m)},[]);const f=b.useCallback(m=>r(_s(m)),[]),h=b.useCallback(m=>i(m),[]),g=b.useCallback(m=>{m.preventDefault();const y=m.clientY;let v=t;r(E=>(v=E,E)),c(!0);const k=document.body.style.cursor,S=document.body.style.userSelect;document.body.style.cursor="ns-resize",document.body.style.userSelect="none";const C=E=>{const T=E.clientY-y;r(_s(v-T))},x=()=>{c(!1),document.body.style.cursor=k,document.body.style.userSelect=S,document.removeEventListener("pointermove",C),document.removeEventListener("pointerup",x),document.removeEventListener("pointercancel",x)};document.addEventListener("pointermove",C),document.addEventListener("pointerup",x),document.addEventListener("pointercancel",x)},[t]);return{height:t,collapsed:o,dragging:l,setHeight:f,setCollapsed:h,beginDrag:g}},h_=(t,r)=>r?t.find(o=>o.id===r)??null:null,g_=({tabs:t,activeId:r,onSelect:o,onClose:i,onClosePanel:l,onNewShell:c,newShellPending:f,onStartWorker:h,startingWorkerId:g})=>{const{t:m}=Ee(),y=p_(),v=Tt();if(t.length===0)return null;const k=h_(t,r)??t[0]??null;return d.jsxs("div",{"data-testid":"terminal-bottom-panel",className:"relative flex shrink-0 flex-col",style:{height:v?"45%":y.height,minHeight:v?"min(160px, 60%)":void 0,background:"var(--bg-1)",borderTop:"1px solid var(--border)"},tabIndex:-1,onKeyDown:S=>{(S.metaKey||S.ctrlKey)&&!S.altKey&&!S.shiftKey&&S.key.toLowerCase()==="w"&&r&&(S.preventDefault(),i(r))},children:[v?null:d.jsx("div",{role:"separator","aria-orientation":"horizontal","aria-label":m("terminalPanel.resizeAria"),"aria-valuemin":Lf,"aria-valuenow":Math.round(y.height),className:"absolute top-0 right-0 left-0 z-10 h-2 -translate-y-1 cursor-ns-resize",tabIndex:-1,"data-resizing":y.dragging||void 0,"data-testid":"terminal-panel-resize-handle",onPointerDown:y.beginDrag}),d.jsx(c_,{tabs:t,activeId:k?.id??null,onSelect:o,onClose:i,onClosePanel:l,onNewShell:c,newShellPending:f}),d.jsx("div",{className:"relative min-h-0 flex-1",style:{background:"var(--bg-crust)"},children:t.map(S=>d.jsx(v_,{tab:S,isActive:S.id===(k?.id??null),onStartWorker:h,startingWorkerId:g},S.id))})]})},v_=({tab:t,isActive:r,onStartWorker:o,startingWorkerId:i})=>{const{t:l}=Ee(),c=r?"flex h-full w-full":"hidden";if(t.kind==="worker"){if(!t.runId){const f=i===t.workerId;return d.jsxs("div",{className:r?"flex h-full w-full flex-col items-center justify-center gap-3 px-6 text-center text-xs text-ter":"hidden","data-testid":"terminal-panel-stopped-worker",children:[d.jsxs("span",{className:"flex items-center gap-2",children:[d.jsx(cm,{size:14,"aria-hidden":!0}),l("terminalPanel.workerStopped",{name:t.label})]}),d.jsxs("button",{type:"button",onClick:()=>o(t.workerId),disabled:f,className:"icon-btn icon-btn--primary","data-testid":"terminal-panel-start-worker",children:[f?d.jsx(xo,{size:12,className:"animate-spin","aria-hidden":!0}):d.jsx(ko,{size:12,"aria-hidden":!0}),l(f?"common.starting":"common.start")]})]})}return d.jsx("div",{id:`worker-pty-${t.runId}`,className:c,"data-pty-slot":"worker","data-testid":`terminal-panel-slot-worker-${t.workerId}`})}return d.jsx("div",{id:`shell-pty-${t.runId}`,className:c,"data-pty-slot":"shell","data-testid":`terminal-panel-slot-shell-${t.runId}`})},Qd=t=>`hive.terminal-panel.tabs.${t}`,Jd=t=>`hive.terminal-panel.active.${t}`,y_=t=>`worker:${t}`,b_=t=>`shell:${t}`,gy=t=>{try{const r=window.localStorage.getItem(t);if(!r)return[];const o=JSON.parse(r);return Array.isArray(o)?o.filter(i=>typeof i=="string"):[]}catch{return[]}},vy=t=>{try{return window.localStorage.getItem(t)??""}catch{return""}},yy=(t,r)=>{try{window.localStorage.setItem(t,r)}catch{}},w_=({workspaceId:t,workers:r,terminalRuns:o})=>{const[i,l]=b.useState(()=>gy(Qd(t))),[c,f]=b.useState(()=>{const _=vy(Jd(t));return _.length>0?_:null}),h=b.useRef(i);h.current=i;const g=b.useRef(t);b.useEffect(()=>{if(g.current===t)return;g.current=t,l(gy(Qd(t)));const _=vy(Jd(t));f(_.length>0?_:null)},[t]);const m=b.useRef(!1);b.useEffect(()=>{m.current=r.length>0||o.length>0},[t]),b.useEffect(()=>{(r.length>0||o.length>0)&&(m.current=!0)},[r,o]),b.useEffect(()=>{m.current&&yy(Qd(t),JSON.stringify(i))},[i,t]),b.useEffect(()=>{m.current&&yy(Jd(t),c??"")},[c,t]);const y=b.useMemo(()=>new Map(r.map(_=>[_.id,_])),[r]),{runByAgentId:v,shellRunById:k}=b.useMemo(()=>{const _=new Map,j=new Map;for(const A of o)_.set(A.agent_id,A),rc(A,t)&&j.set(A.run_id,A);return{runByAgentId:_,shellRunById:j}},[o,t]),S=b.useMemo(()=>{const _=[];for(const j of i)if(j.startsWith("worker:")){const A=j.slice(7),R=y.get(A);if(!R)continue;const D=v.get(R.id);_.push({id:j,kind:"worker",workerId:A,runId:D?.run_id??null,label:R.name})}else if(j.startsWith("shell:")){const A=j.slice(6),R=k.get(A);if(!R)continue;_.push({id:j,kind:"shell",runId:A,label:R.agent_name})}return _},[i,y,v,k]);b.useEffect(()=>{m.current&&l(_=>{const j=_.filter(A=>A.startsWith("worker:")?y.has(A.slice(7)):A.startsWith("shell:")?k.has(A.slice(6)):!1);return j.length===_.length?_:j})},[y,k]),b.useEffect(()=>{m.current&&(c&&S.some(_=>_.id===c)||f(S[0]?.id??null))},[c,S]);const C=b.useCallback(_=>{m.current=!0;const j=y_(_);l(A=>A.includes(j)?A:[...A,j]),f(j)},[]),x=b.useCallback(_=>{m.current=!0;const j=b_(_);l(A=>A.includes(j)?A:[...A,j]),f(j)},[]),E=b.useCallback(_=>{const j=h.current,A=j.filter(R=>R!==_);A.length!==j.length&&(l(A),f(R=>{if(R!==_)return R;const D=j.indexOf(_);return A[D]??A[D-1]??A[0]??null}))},[]),T=b.useCallback(_=>f(_),[]);return{tabs:S,activeId:c,openWorkerTab:C,openShellTab:x,closeTab:E,setActive:T}},by=500,x_=2500,k_=5e3,S_=t=>t.status==="starting"||t.status==="running",E_=(t,r)=>t>0?Math.min(by*2**t,k_):r.some(S_)?by:x_,Zb=t=>`${t}:orchestrator`,C_=(t,r)=>t.length!==r.length?!1:t.every((o,i)=>{const l=r[i];return l!==void 0&&o.agent_id===l.agent_id&&o.agent_name===l.agent_name&&o.run_id===l.run_id&&o.status===l.status&&o.terminal_input_profile===l.terminal_input_profile}),T_=t=>{const[r,o]=b.useState([]);return b.useEffect(()=>{if(!t){o([]);return}let i=!1,l=0,c=!1,f=[],h;const g=()=>{i||(h=window.setTimeout(m,E_(l,f)))},m=()=>{c||(c=!0,JE(t).then(y=>{i||(l=0,f=y,o(v=>C_(v,y)?v:y))}).catch(y=>{i||(l=Math.min(l+1,4),o(v=>v.length===0?v:[])),console.error("[hive] swallowed:terminalRuns.list",y)}).finally(()=>{c=!1,g()}))};return m(),()=>{i=!0,h!==void 0&&window.clearTimeout(h)}},[t]),r},A_=(t,r)=>t.find(o=>o.agent_id===Zb(r)),__=(t,r)=>t.find(o=>o.agent_id===r),N_=({onCloseFailed:t,onShellRunClosed:r,onShellRunStarted:o,panelTabs:i,shellRuns:l,workspaceId:c})=>{const[f,h]=b.useState(null),[g,m]=b.useState(null),[y,v]=b.useState(!1),k=b.useRef(new Map),S=b.useRef(0),C=b.useRef(new Map),x=b.useRef(new Map),E=b.useRef(new Set),T=b.useRef(c),j=(l.find(F=>F.run_id===g)??l[0]??null)?.run_id??null,A=b.useCallback((F,Q)=>{const Z=C.current.get(F)??new Set;Z.add(Q),C.current.set(F,Z)},[]),R=b.useCallback((F,Q,Z)=>{const $=x.current.get(F)??new Map;$.set(Q,Z),x.current.set(F,$),Z.finally(()=>{const M=x.current.get(F);M&&(M.delete(Q),M.size===0&&x.current.delete(F))}).catch(()=>{})},[]),D=b.useCallback((F,Q)=>{const Z=C.current.get(F);Z&&(Z.delete(Q),Z.size===0&&C.current.delete(F))},[]);b.useLayoutEffect(()=>{T.current=c},[c]),b.useEffect(()=>()=>{C.current.clear(),x.current.clear(),E.current.clear()},[]),b.useEffect(()=>{h(null),m(null),v(!1)},[c]),b.useEffect(()=>{if(!c)return;const F=C.current.get(c);if(!F)return;const Q=new Set(l.map($=>$.run_id)),Z=x.current.get(c);for(const $ of Array.from(F))Z?.has($)||Q.has($)||D(c,$)},[l,D,c]);const L=()=>{if(!c||k.current.has(c))return;const F=c,Q=S.current+1;S.current=Q,k.current.set(F,Q);const Z=()=>T.current===F,$=()=>k.current.get(F)===Q;h(null),v(!0),GE(F).then(M=>{o?.(F,M),Z()&&(m(M.run_id),i.openShellTab(M.run_id))}).catch(M=>{Z()&&h(M instanceof Error?M.message:String(M))}).finally(()=>{$()&&k.current.delete(F),Z()&&v(!1)})},B=()=>{if(!c||k.current.has(c)||E.current.has(c))return;const F=c,Q=Array.from(x.current.get(F)?.values()??[]);if(Q.length===0){L();return}E.current.add(F),h(null),v(!0),Promise.allSettled(Q).then(Z=>{Z.some($=>$.status==="rejected")||T.current===F&&(k.current.has(F)||L())}).finally(()=>{E.current.delete(F),T.current===F&&!k.current.has(F)&&v(!1)})};return{closeShellTab:F=>{if(!c)return;const Q=l.find($=>$.run_id!==F)??null;j===F&&m(Q?.run_id??null),r?.(c,F),A(c,F);const Z=$E(c,F).catch($=>{throw D(c,F),t($ instanceof Error?$.message:String($)),$});R(c,F,Z),Z.catch(()=>{})},openShell:()=>{if(!c||k.current.has(c)||y)return;const F=i.tabs.find($=>$.kind==="shell");if(F){i.setActive(F.id);return}const Q=C.current.get(c)??new Set,Z=l.find($=>!Q.has($.run_id));if(Z){m(Z.run_id),i.openShellTab(Z.run_id);return}if(Q.size>0){B();return}L()},shellError:f,shellStarting:y,startNewShell:()=>{if(!c||k.current.has(c)||y)return;if((C.current.get(c)??new Set).size>0){B();return}L()}}},Qb="hive.split.orch-pct",Cs=.3,Ts=.78,Al=.6,wy=.02,_l=(t,r,o)=>Math.min(o,Math.max(r,t)),j_=()=>{try{const t=localStorage.getItem(Qb);if(!t)return Al;const r=Number.parseFloat(t);return Number.isFinite(r)?_l(r,Cs,Ts):Al}catch{return Al}},R_=()=>{const t=b.useRef(null),[r,o]=b.useState(()=>j_()),[i,l]=b.useState(!1);b.useEffect(()=>{try{localStorage.setItem(Qb,r.toFixed(4))}catch{}},[r]);const c=b.useCallback(h=>{h.preventDefault();const g=t.current;if(!g)return;l(!0);const m=document.body.style.userSelect,y=document.body.style.cursor;document.body.style.userSelect="none",document.body.style.cursor="col-resize";const v=S=>{const C=g.getBoundingClientRect();if(C.width<=0)return;const x=(S.clientX-C.left)/C.width;o(_l(x,Cs,Ts))},k=()=>{l(!1),document.body.style.userSelect=m,document.body.style.cursor=y,document.removeEventListener("pointermove",v),document.removeEventListener("pointerup",k),document.removeEventListener("pointercancel",k)};document.addEventListener("pointermove",v),document.addEventListener("pointerup",k),document.addEventListener("pointercancel",k)},[]),f=b.useCallback(h=>{h.key==="ArrowLeft"?(h.preventDefault(),o(g=>_l(g-wy,Cs,Ts))):h.key==="ArrowRight"?(h.preventDefault(),o(g=>_l(g+wy,Cs,Ts))):h.key==="Home"?(h.preventDefault(),o(Cs)):h.key==="End"?(h.preventDefault(),o(Ts)):h.key==="Enter"&&(h.metaKey||h.ctrlKey)&&(h.preventDefault(),o(Al))},[]);return{containerRef:t,orchPct:r,dragging:i,beginDrag:c,onKeyDown:f}},Ks=({title:t,description:r,icon:o,action:i})=>d.jsxs("div",{className:"m-auto flex max-w-[380px] flex-col items-center gap-3 px-6 py-8 text-center","data-testid":"empty-state",children:[o?d.jsx("div",{"data-testid":"empty-state-icon","aria-hidden":!0,className:"flex h-12 w-12 items-center justify-center rounded text-sec",style:{background:"var(--bg-2)",border:"1px solid var(--border-bright)"},children:o}):null,d.jsx("div",{className:"text-lg font-semibold text-pri","data-testid":"empty-state-title",children:t}),d.jsx("div",{className:"text-sm text-ter","data-testid":"empty-state-description",children:r}),i]}),Lr=t=>r=>{console.error(`[hive] swallowed:${t}`,r)},O_={agy:{command:"curl -fsSL https://antigravity.google/cli/install.sh | bash",docsUrl:"https://antigravity.google/docs/cli-getting-started"},claude:{command:"npm install -g @anthropic-ai/claude-code",docsUrl:"https://github.com/anthropics/claude-code"},codex:{command:"npm install -g @openai/codex",docsUrl:"https://github.com/openai/codex"},cursor:{command:"curl https://cursor.com/install -fsS | bash",docsUrl:"https://cursor.com/docs/cli/installation"},gemini:{command:"npm install -g @google/gemini-cli",docsUrl:"https://github.com/google-gemini/gemini-cli"},grok:{command:"curl -fsSL https://x.ai/cli/install.sh | bash",docsUrl:"https://x.ai/cli"},hermes:{command:"curl -fsSL https://hermes-agent.nousresearch.com/install.sh | bash",docsUrl:"https://github.com/NousResearch/hermes-agent"},opencode:{command:"npm install -g opencode-ai",docsUrl:"https://opencode.ai/docs"},qwen:{command:"npm install -g @qwen-code/qwen-code@latest",docsUrl:"https://github.com/QwenLM/qwen-code"}},D_=t=>O_[t]??null,M_=({presetId:t,presetName:r})=>{const{t:o}=Ee(),i=D_(t),[l,c]=b.useState(!1),[f,h]=b.useState(!1),g=b.useRef(null);b.useEffect(()=>()=>{g.current&&clearTimeout(g.current)},[]);const m=()=>{i&&tb(i.command).then(()=>{c(!0),g.current&&clearTimeout(g.current),g.current=setTimeout(()=>{c(!1),g.current=null},1500)}).catch(Lr("cli-install-copy"))};return d.jsxs("div",{className:"flex flex-col gap-2 rounded-lg border p-3",style:{background:"var(--bg-2)",borderColor:"var(--border)"},"data-testid":"cli-install-guidance",children:[i?d.jsxs(d.Fragment,{children:[d.jsx("span",{className:"text-xs text-sec",children:o("workspace.preset.installHint",{name:r})}),d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx("code",{className:"mono min-w-0 flex-1 truncate rounded border px-2 py-1.5 text-xs text-pri",style:{background:"var(--bg-1)",borderColor:"var(--border)"},title:i.command,children:i.command}),d.jsxs("button",{type:"button",onClick:m,className:"icon-btn shrink-0 inline-flex items-center gap-1.5","aria-label":o("workspace.preset.installCopyAria"),"data-testid":"cli-install-copy",children:[l?d.jsx(bo,{size:13,"aria-hidden":!0}):d.jsx(ec,{size:13,"aria-hidden":!0}),d.jsx("span",{className:"text-xs",children:o(l?"common.copied":"workspace.preset.installCopy")})]})]}),d.jsxs("a",{href:i.docsUrl,target:"_blank",rel:"noreferrer",className:"inline-flex items-center gap-1 self-start text-xs text-sec underline hover:text-pri","data-testid":"cli-install-docs",children:[d.jsx(wS,{size:11,"aria-hidden":!0}),o("workspace.preset.installDocs")]})]}):null,d.jsxs("button",{type:"button",onClick:()=>h(y=>!y),"aria-expanded":f,className:"flex items-center gap-1 text-left text-xs text-sec hover:text-pri cursor-pointer","data-testid":"cli-install-path-help-toggle",children:[f?d.jsx(wo,{size:12,"aria-hidden":!0}):d.jsx(Jl,{size:12,"aria-hidden":!0}),o("workspace.preset.pathHelpTitle")]}),f?d.jsx("p",{className:"text-xs leading-relaxed text-ter","data-testid":"cli-install-path-help-body",children:o("workspace.preset.pathHelpBody")}):null]})},L_={"cursor-agent":"cursor"},z_=/^(\S+) CLI not found in PATH/u,H_=()=>{const{t}=Ee();return d.jsx("div",{"data-testid":"orchestrator-starting-body",className:"flex flex-1",children:d.jsx(Ks,{icon:d.jsx(xo,{size:24,className:"animate-spin"}),title:t("orchestrator.startingTitle"),description:t("orchestrator.startingDesc")})})},B_=({onStart:t})=>{const{t:r}=Ee();return d.jsx("div",{"data-testid":"orchestrator-stopped-body",className:"flex flex-1",children:d.jsx(Ks,{icon:d.jsx(om,{size:24}),title:r("orchestrator.stoppedTitle"),description:r("orchestrator.stoppedDesc"),action:d.jsxs("button",{type:"button",onClick:t,className:"icon-btn icon-btn--primary","data-testid":"orchestrator-start",children:[d.jsx(ko,{size:12,"aria-hidden":!0})," ",r("orchestrator.start")]})})})},W_=({error:t,onRemoveWorkspace:r,onRestart:o})=>{const{t:i}=Ee(),[l,c]=b.useState(!1),f=()=>{navigator.clipboard?.writeText(t).then(()=>{c(!0),window.setTimeout(()=>c(!1),1500)}).catch(()=>{})},h=z_.exec(t)?.[1];return d.jsxs("div",{"data-testid":"orchestrator-failed-body",className:"m-auto flex max-w-[480px] flex-col items-center gap-3 px-6 py-8",children:[d.jsx("div",{"aria-hidden":!0,className:"flex h-12 w-12 items-center justify-center rounded text-sec",style:{background:"var(--bg-2)",border:"1px solid var(--border-bright)"},children:d.jsx(om,{size:24})}),d.jsx("div",{className:"text-lg font-semibold text-pri",children:i("orchestrator.failed")}),d.jsxs("div",{className:"relative w-full",children:[d.jsx("pre",{"data-testid":"orchestrator-error-message",className:"mono w-full max-h-40 overflow-auto whitespace-pre-wrap break-all rounded p-3 text-left text-xs",style:{background:"color-mix(in oklab, var(--status-red) 8%, var(--bg-2))",border:"1px solid color-mix(in oklab, var(--status-red) 24%, transparent)",color:"var(--text-secondary)"},children:t}),d.jsx(ct,{label:i(l?"common.copied":"common.copyError"),children:d.jsx("button",{type:"button",onClick:f,"aria-label":i("orchestrator.copyErrorAria"),className:"icon-btn icon-btn--ghost absolute right-1 top-1 h-6 px-1.5","data-testid":"orchestrator-copy-error",children:d.jsx(ec,{size:12,"aria-hidden":!0})})})]}),h?d.jsx("div",{className:"w-full",children:d.jsx(M_,{presetId:L_[h]??h,presetName:h})}):null,d.jsxs("div",{className:"flex items-center gap-3",children:[d.jsxs("button",{type:"button",onClick:o,className:"icon-btn icon-btn--primary","data-testid":"orchestrator-retry",children:[d.jsx(im,{size:12,"aria-hidden":!0})," ",i("common.retry")]}),d.jsx("button",{type:"button",onClick:r,className:"icon-btn icon-btn--danger","data-testid":"orchestrator-remove-workspace",children:i("orchestrator.removeWorkspace")})]}),d.jsx("span",{"data-testid":"orchestrator-retry-header",className:"sr-only",children:i("common.retry")})]})},U_=({state:t,onRemoveWorkspace:r,onRestart:o,onStart:i,onStop:l})=>{const{t:c}=Ee(),f=Tt();return d.jsx("div",{className:"orchestrator-pane-root relative flex h-full w-full min-w-0 flex-col",style:{background:"var(--bg-crust)",...f?{}:{borderRight:"1px solid var(--border)"}},"data-testid":"orchestrator-terminal-slot",children:t.kind==="running"?d.jsxs(d.Fragment,{children:[d.jsx("div",{id:`orch-pty-${t.runId}`,className:"orchestrator-pty-slot relative flex h-full w-full","data-pty-slot":"orchestrator",children:d.jsx("div",{className:"orchestrator-pty-placeholder pointer-events-none absolute inset-0 flex items-center justify-center px-4 text-center","data-testid":"orchestrator-running-placeholder",children:d.jsx("div",{className:"mono text-xs text-ter",children:c("terminal.statusConnecting")})})}),f?null:d.jsx(ct,{label:c("orchestrator.stop"),children:d.jsx("button",{type:"button",onClick:l,"aria-label":c("orchestrator.stop"),"data-testid":"orchestrator-stop",className:"icon-btn icon-btn--ghost absolute right-2 top-2 z-10 h-7 w-7 justify-center hover:text-status-red",style:{background:"var(--bg-2)",border:"1px solid var(--border)"},children:d.jsx(lm,{size:13,"aria-hidden":!0})})})]}):t.kind==="failed"?d.jsx(W_,{error:t.error,onRemoveWorkspace:r,onRestart:o}):t.kind==="stopped"?d.jsx(B_,{onStart:i}):d.jsx(H_,{})})},q_=({workspaceId:t,terminalRuns:r,autostartError:o,suppressAutostartRunId:i,onClearAutostartError:l,onAfterStart:c})=>{const f=A_(r,t),h=Zb(t),[g,m]=b.useState(null),[y,v]=b.useState(null),[k,S]=b.useState(null),C=y?.workspaceId===t?y.runId:null,x=!!(k&&!f&&!C);b.useEffect(()=>{S(i??null)},[i]),b.useEffect(()=>{f&&(m(null),v(null),S(null))},[f]),b.useEffect(()=>{if(!k||f)return;const A=window.setTimeout(()=>S(null),1500);return()=>window.clearTimeout(A)},[k,f]),b.useEffect(()=>{if(!C||f)return;const A=window.setTimeout(()=>v(null),2e3);return()=>window.clearTimeout(A)},[C,f]);let E;f?E={kind:"running",runId:f.run_id}:C?E={kind:"running",runId:C}:g===t||x?E={kind:"starting"}:o?E={kind:"failed",error:o}:E={kind:"stopped"};const T=b.useCallback(()=>{!t||g===t||f||(l(),m(t),zl(t,h).then(A=>{v({workspaceId:t,runId:A.runId}),c?.({ok:!0,error:null,run_id:A.runId})}).catch(A=>{const R=A instanceof Error?A.message:"Failed to start Queen";v(null),c?.({ok:!1,error:R,run_id:null})}).finally(()=>m(A=>A===t?null:A)))},[h,c,l,f,g,t]),_=b.useCallback(()=>{f&&Hl(f.run_id).catch(A=>{console.error("[hive] swallowed:orchestrator.stop",A)})},[f]),j=b.useCallback(()=>{if(l(),f){Hl(f.run_id).catch(A=>{console.error("[hive] swallowed:orchestrator.restart.stop",A)}).then(()=>zl(t,h)).then(A=>{v({workspaceId:t,runId:A.runId}),c?.({ok:!0,error:null,run_id:A.runId})}).catch(A=>{const R=A instanceof Error?A.message:"Failed to restart Queen";c?.({ok:!1,error:R,run_id:null})});return}T()},[h,c,l,f,T,t]);return{state:E,start:T,stop:_,restart:j}},Jb=["ada-lovelace","archimedes","babbage","bell","da-vinci","edison","eiffel","euclid","euler","fermat","fibonacci","gutenberg","leibniz","marconi","morse","nobel","pascal","pythagoras","tesla","turing","watt","wright-brothers"],ew=["adam-smith","aquinas","aristotle","augustine","bacon","calvin","cicero","democritus","descartes","epicurus","hegel","herodotus","hobbes","hume","kant","kierkegaard","locke","luther","machiavelli","marcus-aurelius","montesquieu","nietzsche","plato","rousseau","seneca","socrates","spinoza","voltaire"],tw=["amundsen","boyle","cook","copernicus","curie","da-gama","darwin","drake","faraday","fleming","galileo","halley","hippocrates","kepler","magellan","marco-polo","mendel","mendeleev","newton","pasteur","planck","ptolemy","rutherford","volta"],I_=["alexander","augustus","austen","bach","beethoven","brahms","byron","caesar","cervantes","charlemagne","chopin","cleopatra","dante","dickens","dostoevsky","dumas","einstein","elizabeth-i","franklin","goethe","goya","handel","hannibal","henry-viii","homer","hugo","jefferson","joan-of-arc","keats","leonidas","lincoln","liszt","louis-xiv","michelangelo","milton","monet","mozart","napoleon","nightingale","orwell","picasso","poe","raphael","rembrandt","schubert","shakespeare","sophocles","tchaikovsky","titian","tolstoy","twain","van-gogh","velazquez","verdi","vermeer","virgil","vivaldi","wagner","washington","whitman","wilde","woolf","wordsworth"],nw=["八大山人","毕昇","蔡伦","干将","顾恺之","黄道婆","李冰","柳公权","鲁班","莫邪","墨子","沈括","宋应星","唐寅","王羲之","文徵明","吴道子","颜真卿","张衡","张择端","郑板桥","祖冲之"],rw=["班固","包拯","狄仁杰","董仲舒","范仲淹","顾炎武","管仲","海瑞","韩非","韩愈","嵇康","贾谊","孔子","老子","林则徐","柳宗元","孟子","欧阳修","商鞅","司马光","司马迁","谭嗣同","王安石","王守仁","魏徵","荀子","张居正","周敦颐","朱熹","庄子"],aw=["班超","扁鹊","法显","葛洪","华佗","鉴真","郦道元","李时珍","神农","苏武","孙思邈","陶弘景","徐光启","徐霞客","玄奘","张骞","张仲景","郑和"],P_=["白居易","蔡文姬","曹操","曹雪芹","曹植","程咬金","大禹","杜甫","杜牧","范蠡","关羽","汉武帝","韩信","忽必烈","花木兰","黄帝","霍去病","姜子牙","康熙","李白","李广","李靖","李清照","李煜","刘邦","刘备","刘伯温","柳永","陆游","罗贯中","吕布","吕不韦","孟浩然","蒙恬","努尔哈赤","庞统","蒲松龄","戚继光","乾隆","秦始皇","屈原","上官婉儿","施耐庵","司马懿","苏轼","孙膑","孙权","孙武","孙中山","唐太宗","唐玄宗","陶渊明","王维","卫青","文天祥","吴承恩","吴起","萧何","谢安","辛弃疾","杨贵妃","雍正","虞姬","岳飞","张飞","张良","张仪","赵子龙","周瑜","朱棣","诸葛亮","朱元璋","左宗棠"],K_=[...Jb,...ew,...tw,...I_],F_=[...nw,...rw,...aw,...P_],Y_=["argus","cassandra","copernicus","halley","herodotus","hypatia","kepler","ptolemy","thucydides","tycho-brahe"],V_=["班固","郭守敬","沈括","司马光","司马迁","一行","张衡","祖冲之"],G_={en:{coder:Jb,reviewer:ew,tester:tw,sentinel:Y_,custom:K_},zh:{coder:nw,reviewer:rw,tester:aw,sentinel:V_,custom:F_}},$_=()=>{const t=new Uint32Array(1);return globalThis.crypto.getRandomValues(t),t[0]??0},ef=({language:t="en",role:r="coder",usedNames:o,nextUint32:i=$_}={})=>{const l=G_[t][r],c=o&&o.size>0?l.filter(h=>!o.has(h)):l,f=c.length>0?c:l;return f[i()%f.length]},Ns={en:{coder:["You are a Coder. Turn clearly scoped tasks into the smallest correct code change.","Working style:","- Read the relevant files and local patterns before editing.","- Prefer small changes; avoid unrelated refactors and scope creep.","- Run validation that covers the risk. If you cannot validate, explain why.","Report changed files, verification, remaining risk, and blockers."].join(`
11
+ `),custom:["You are a custom team member. Rewrite this into the member's operating contract.","Recommended shape:","- Goal: what this member owns.","- Boundaries: what to do and what to avoid.","- Working style: how to inspect, edit, verify, or review.","- Done means: what results, risks, and blockers to report."].join(`
12
+ `),reviewer:["You are a Reviewer. Focus on quality review; do not replace the Orchestrator or edit by default.","Working style:","- Prioritize real bugs, regressions, edge cases, and test gaps.","- For each issue, include severity, file/line, trigger condition, and minimal fix.","- If no high-risk issue exists, state residual risk and unverified scope.","Report blocking issues first, ordered by severity."].join(`
13
+ `),sentinel:["You are a Sentinel: a read-only patrol observer. You never execute tasks or modify anything.","Working style:","- The runtime periodically injects a workspace snapshot (worker states, open dispatches, possible orphans).","- Cross-check it against your own observations; surface only what deserves a human glance.","- A long-quiet dispatch is not necessarily stuck — big tasks are slow by nature.","Hard boundaries:","- Observe only: no file edits, no side-effecting commands, no dispatching.",'- You take no dispatches and have no `team report`; report findings via `team status "<finding>"`.',"- When nothing is unusual, stay quiet."].join(`
14
+ `),tester:["You are a Tester. Reproduce, test, and produce concrete verification evidence.","Working style:","- Clarify the behavior, entry point, and failure condition under test.","- Prefer real commands or real paths. Add a minimal test when useful.","- Record commands, results, key output, and uncovered scenarios.","Report pass/fail/unverified separately, then suggest the next step."].join(`
15
+ `)},zh:{coder:["你是实现型 Coder,负责把明确任务落成最小正确代码改动。","工作方式:","- 先阅读相关文件和现有模式,再动手。","- 优先小步修改,避免无关重构和范围扩张。","- 改动后运行能覆盖风险的验证命令;不能验证时说明原因。","交付说明要包含:改动文件、验证结果、剩余风险或阻塞。"].join(`
16
+ `),custom:["你是自定义成员。请把这段改成该成员的行为契约。","建议包含:","- 目标:这个成员主要负责什么。","- 边界:哪些事可以做,哪些事不要做。","- 工作方式:如何调查、修改、验证或审查。","- 完成标准:交付时需要说明哪些结果、风险和阻塞。"].join(`
17
+ `),reviewer:["你是监工型 Reviewer,负责质量审查,不替代 Orchestrator,也不默认改代码。","工作方式:","- 优先找真实 bug、回归风险、边界条件和测试缺口。","- 发现问题时给出严重度、文件/行号、触发条件和最小修复建议。","- 没有高风险问题时明确说清剩余风险和未验证范围。","交付说明按严重度排序,先列 blocking 问题。"].join(`
18
+ `),sentinel:["你是只读巡检型 Sentinel,负责观察团队运行状态,不执行任务、不修改任何东西。","工作方式:","- 系统会定期向你注入工作区快照(成员状态、未关闭派单、疑似孤儿单)。",'- 把快照与你自己的观察对照,只把"值得人看一眼"的事项报上去。',"- 长时间无汇报不等于卡死——正常的大任务本来就慢。","硬性边界:","- 只观察:不改文件、不跑有副作用的命令、不派活。",'- 你不接派单,也没有 `team report`;发现统一用 `team status "<巡检发现>"` 汇报。',"- 没有异常时保持安静。"].join(`
19
+ `),tester:["你是验证型 Tester,负责复现、测试和证据化验证。","工作方式:","- 先明确要验证的行为、入口和失败条件。","- 优先跑真实命令或真实链路;必要时补充最小测试。","- 记录命令、结果、关键输出和不能覆盖的场景。","交付说明要区分通过、失败、未验证和建议下一步。"].join(`
20
+ `)}},tf=(t,r,o)=>o==="zh"?r.find(i=>i.roleType===t)?.description??Ns.zh[t]:Ns.en[t],X_=({createWorker:t,open:r,workers:o})=>{const{language:i}=Ee(),[l,c]=b.useState(""),[f,h]=b.useState("coder"),[g,m]=b.useState([]),[y,v]=b.useState(null),[k,S]=b.useState(!1),[C,x]=b.useState(null),[E,T]=b.useState(Ns[i].coder),[_,j]=b.useState([]),[A,R]=b.useState("claude"),[D,L]=b.useState(""),[B,P]=b.useState(null),[te,ee]=b.useState(!1),F=b.useRef(!1),Q=b.useRef(!1),Z=b.useRef(!1),$=tf(f,g,i),M=b.useMemo(()=>g.filter(de=>!de.isBuiltin),[g]);b.useEffect(()=>{if(!r)return;let de=!1;return YE().then(me=>{de||(j(me),R(Te=>me.some(Ce=>Ce.id===Te&&Ce.available)?Te:me.find(Ce=>Ce.id==="claude"&&Ce.available)?.id??me.find(Ce=>Ce.available)?.id??me[0]?.id??""))}).catch(me=>{de||P(me instanceof Error?me.message:String(me))}),()=>{de=!0}},[r]),b.useEffect(()=>{if(!r)return;let de=!1;return XE().then(me=>{de||m(me)}).catch(me=>{de||P(me instanceof Error?me.message:String(me))}),()=>{de=!0}},[r]),b.useEffect(()=>{y===null&&(Q.current||T(tf(f,g,i)))},[i,g,f,y]);const K=de=>{Q.current=!0,T(de)},U=de=>{F.current=!1,c(de)},I=b.useMemo(()=>new Set(o.map(de=>de.name)),[o]),X=b.useRef(I);X.current=I;const O=()=>{F.current=!0,c(ef({language:i,role:f,usedNames:I}))};b.useEffect(()=>{const de=r&&!Z.current;if(Z.current=r,!!r){if(de){F.current=!0,c(ef({language:i,role:f,usedNames:X.current}));return}F.current&&c(ef({language:i,role:f,usedNames:X.current}))}},[r,i,f]);const W=de=>{h(de),v(null),Q.current=!1,T(tf(de,g,i))};return{commandPresets:_,commandPresetId:A,createWorkerError:B,creating:te,customTemplates:M,roleDescription:E,roleDescriptionDefault:$,selectedTemplateId:y,startupCommand:D,templateBusy:k,templateError:C,workerName:l,workerRole:f,setCommandPresetId:de=>{R(de)},setRoleDescription:K,setStartupCommand:L,setWorkerName:U,setWorkerRole:W,selectTemplate:de=>{if(de===null){h("custom"),v(null),Q.current=!1,T(Ns[i].custom);return}const me=g.find(Te=>Te.id===de);!me||me.isBuiltin||(h("custom"),v(de),Q.current=!1,T(me.description))},saveAsTemplate:async de=>{const me=de.trim(),Te=E.trim();if(!(!me||!Te)){S(!0),x(null);try{const Ce=await ZE({name:me,roleType:"custom",description:Te});m(ke=>[...ke,Ce]),v(Ce.id),h("custom"),Q.current=!1,T(Ce.description)}catch(Ce){throw x(Ce instanceof Error?Ce.message:String(Ce)),Ce}finally{S(!1)}}},deleteTemplate:async de=>{const me=g.find(Te=>Te.id===de);if(!(!me||me.isBuiltin)){S(!0),x(null);try{await QE(de),m(Te=>Te.filter(Ce=>Ce.id!==de)),y===de&&(v(null),Q.current=!1,T(Ns[i].custom))}catch(Te){throw x(Te instanceof Error?Te.message:String(Te)),Te}finally{S(!1)}}},randomizeWorkerName:O,resetRoleDescription:()=>{Q.current=!1,T($)},resetError:()=>P(null),applyMarketplaceImport:({name:de,description:me})=>{F.current=!1,c(de),v(null),h("custom"),Q.current=!0,T(me)},submit:(de,me)=>{de.preventDefault(),ee(!0),P(null),t({commandPresetId:A,name:l,role:f,roleDescription:E,startupCommand:D}).then(({error:Te})=>{c(""),F.current=!1,W("coder"),v(null),R("claude"),L(""),me(),Te&&P(Te)}).catch(Te=>{P(Te instanceof Error?Te.message:String(Te))}).finally(()=>ee(!1))}}},Z_=[{icon:d.jsx(O0,{size:16}),titleKey:"welcome.step1Title",descriptionKey:"welcome.step1Desc"},{icon:d.jsx(B0,{size:16}),titleKey:"welcome.step2Title",descriptionKey:"welcome.step2Desc"},{icon:d.jsx($S,{size:16}),titleKey:"welcome.step3Title",descriptionKey:"welcome.step3Desc"}],Q_=({onAddWorkspace:t,onTryDemo:r,heroImageSrc:o,disabledReason:i})=>{const{t:l}=Ee(),c=!!i;return d.jsxs("div",{"data-testid":"welcome-pane",className:"m-auto flex w-full flex-col items-center gap-6 px-6 py-12 text-center",style:{maxWidth:"540px"},children:[o?d.jsx("img",{src:o,alt:"",className:"h-24 w-24","aria-hidden":!0}):null,d.jsxs("div",{className:"space-y-2",children:[d.jsx("div",{className:"text-2xl font-semibold text-pri",children:l("welcome.title")}),d.jsx("div",{className:"text-sm text-sec",children:l("welcome.desc")})]}),d.jsx("ol",{className:"grid w-full grid-cols-1 gap-3 text-left md:grid-cols-3",children:Z_.map((f,h)=>d.jsxs("li",{className:"rounded border bg-1 p-3",style:{borderColor:"var(--border)"},children:[d.jsxs("div",{className:"mb-1 flex items-center gap-2 text-pri",children:[d.jsx("span",{className:"font-medium text-xs text-ter",children:h+1}),f.icon]}),d.jsx("div",{className:"text-xs font-medium text-pri",children:l(f.titleKey)}),d.jsx("div",{className:"mt-1 text-xs text-ter",children:l(f.descriptionKey)})]},f.titleKey))}),c?d.jsxs("div",{role:"alert","data-testid":"welcome-pane-disabled-reason",className:"flex items-start gap-2 rounded px-3 py-2 text-left text-xs",style:{background:"color-mix(in oklab, var(--status-red) 10%, transparent)",border:"1px solid color-mix(in oklab, var(--status-red) 28%, transparent)",color:"var(--status-red)"},children:[d.jsx(nc,{size:14,className:"mt-0.5 shrink-0","aria-hidden":!0}),d.jsx("span",{className:"break-words",children:i})]}):null,d.jsxs("button",{type:"button",disabled:c,onClick:c?void 0:t,"aria-disabled":c||void 0,title:i,className:"icon-btn icon-btn--primary inline-flex items-center gap-2 disabled:cursor-not-allowed disabled:opacity-50","data-testid":"welcome-pane-add",children:[d.jsx("span",{children:l("welcome.addWorkspace")}),d.jsx(K2,{size:14,"aria-hidden":!0})]}),r?d.jsx("button",{type:"button",onClick:r,className:"text-xs text-sec underline hover:text-pri",children:l("welcome.demo")}):null]})};var nf="focusScope.autoFocusOnMount",rf="focusScope.autoFocusOnUnmount",xy={bubbles:!1,cancelable:!0},J_="FocusScope",ow=b.forwardRef((t,r)=>{const{loop:o=!1,trapped:i=!1,onMountAutoFocus:l,onUnmountAutoFocus:c,...f}=t,[h,g]=b.useState(null),m=po(l),y=po(c),v=b.useRef(null),k=xn(r,x=>g(x)),S=b.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;b.useEffect(()=>{if(i){let x=function(j){if(S.paused||!h)return;const A=j.target;h.contains(A)?v.current=A:Mr(v.current,{select:!0})},E=function(j){if(S.paused||!h)return;const A=j.relatedTarget;A!==null&&(h.contains(A)||Mr(v.current,{select:!0}))},T=function(j){if(document.activeElement===document.body)for(const R of j)R.removedNodes.length>0&&Mr(h)};document.addEventListener("focusin",x),document.addEventListener("focusout",E);const _=new MutationObserver(T);return h&&_.observe(h,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",x),document.removeEventListener("focusout",E),_.disconnect()}}},[i,h,S.paused]),b.useEffect(()=>{if(h){Sy.add(S);const x=document.activeElement;if(!h.contains(x)){const T=new CustomEvent(nf,xy);h.addEventListener(nf,m),h.dispatchEvent(T),T.defaultPrevented||(eN(oN(sw(h)),{select:!0}),document.activeElement===x&&Mr(h))}return()=>{h.removeEventListener(nf,m),setTimeout(()=>{const T=new CustomEvent(rf,xy);h.addEventListener(rf,y),h.dispatchEvent(T),T.defaultPrevented||Mr(x??document.body,{select:!0}),h.removeEventListener(rf,y),Sy.remove(S)},0)}}},[h,m,y,S]);const C=b.useCallback(x=>{if(!o&&!i||S.paused)return;const E=x.key==="Tab"&&!x.altKey&&!x.ctrlKey&&!x.metaKey,T=document.activeElement;if(E&&T){const _=x.currentTarget,[j,A]=tN(_);j&&A?!x.shiftKey&&T===A?(x.preventDefault(),o&&Mr(j,{select:!0})):x.shiftKey&&T===j&&(x.preventDefault(),o&&Mr(A,{select:!0})):T===_&&x.preventDefault()}},[o,i,S.paused]);return d.jsx(Bt.div,{tabIndex:-1,...f,ref:k,onKeyDown:C})});ow.displayName=J_;function eN(t,{select:r=!1}={}){const o=document.activeElement;for(const i of t)if(Mr(i,{select:r}),document.activeElement!==o)return}function tN(t){const r=sw(t),o=ky(r,t),i=ky(r.reverse(),t);return[o,i]}function sw(t){const r=[],o=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT,{acceptNode:i=>{const l=i.tagName==="INPUT"&&i.type==="hidden";return i.disabled||i.hidden||l?NodeFilter.FILTER_SKIP:i.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;o.nextNode();)r.push(o.currentNode);return r}function ky(t,r){for(const o of t)if(!nN(o,{upTo:r}))return o}function nN(t,{upTo:r}){if(getComputedStyle(t).visibility==="hidden")return!0;for(;t;){if(r!==void 0&&t===r)return!1;if(getComputedStyle(t).display==="none")return!0;t=t.parentElement}return!1}function rN(t){return t instanceof HTMLInputElement&&"select"in t}function Mr(t,{select:r=!1}={}){if(t&&t.focus){const o=document.activeElement;t.focus({preventScroll:!0}),t!==o&&rN(t)&&r&&t.select()}}var Sy=aN();function aN(){let t=[];return{add(r){const o=t[0];r!==o&&o?.pause(),t=Ey(t,r),t.unshift(r)},remove(r){t=Ey(t,r),t[0]?.resume()}}}function Ey(t,r){const o=[...t],i=o.indexOf(r);return i!==-1&&o.splice(i,1),o}function oN(t){return t.filter(r=>r.tagName!=="A")}var af=0;function sN(){b.useEffect(()=>{const t=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",t[0]??Cy()),document.body.insertAdjacentElement("beforeend",t[1]??Cy()),af++,()=>{af===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(r=>r.remove()),af--}},[])}function Cy(){const t=document.createElement("span");return t.setAttribute("data-radix-focus-guard",""),t.tabIndex=0,t.style.outline="none",t.style.opacity="0",t.style.position="fixed",t.style.pointerEvents="none",t}var Nn=function(){return Nn=Object.assign||function(r){for(var o,i=1,l=arguments.length;i<l;i++){o=arguments[i];for(var c in o)Object.prototype.hasOwnProperty.call(o,c)&&(r[c]=o[c])}return r},Nn.apply(this,arguments)};function iw(t,r){var o={};for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&r.indexOf(i)<0&&(o[i]=t[i]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var l=0,i=Object.getOwnPropertySymbols(t);l<i.length;l++)r.indexOf(i[l])<0&&Object.prototype.propertyIsEnumerable.call(t,i[l])&&(o[i[l]]=t[i[l]]);return o}function iN(t,r,o){if(o||arguments.length===2)for(var i=0,l=r.length,c;i<l;i++)(c||!(i in r))&&(c||(c=Array.prototype.slice.call(r,0,i)),c[i]=r[i]);return t.concat(c||Array.prototype.slice.call(r))}var Nl="right-scroll-bar-position",jl="width-before-scroll-bar",lN="with-scroll-bars-hidden",cN="--removed-body-scroll-bar-size";function of(t,r){return typeof t=="function"?t(r):t&&(t.current=r),t}function uN(t,r){var o=b.useState(function(){return{value:t,callback:r,facade:{get current(){return o.value},set current(i){var l=o.value;l!==i&&(o.value=i,o.callback(i,l))}}}})[0];return o.callback=r,o.facade}var dN=typeof window<"u"?b.useLayoutEffect:b.useEffect,Ty=new WeakMap;function fN(t,r){var o=uN(null,function(i){return t.forEach(function(l){return of(l,i)})});return dN(function(){var i=Ty.get(o);if(i){var l=new Set(i),c=new Set(t),f=o.current;l.forEach(function(h){c.has(h)||of(h,null)}),c.forEach(function(h){l.has(h)||of(h,f)})}Ty.set(o,t)},[t]),o}function mN(t){return t}function pN(t,r){r===void 0&&(r=mN);var o=[],i=!1,l={read:function(){if(i)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return o.length?o[o.length-1]:t},useMedium:function(c){var f=r(c,i);return o.push(f),function(){o=o.filter(function(h){return h!==f})}},assignSyncMedium:function(c){for(i=!0;o.length;){var f=o;o=[],f.forEach(c)}o={push:function(h){return c(h)},filter:function(){return o}}},assignMedium:function(c){i=!0;var f=[];if(o.length){var h=o;o=[],h.forEach(c),f=o}var g=function(){var y=f;f=[],y.forEach(c)},m=function(){return Promise.resolve().then(g)};m(),o={push:function(y){f.push(y),m()},filter:function(y){return f=f.filter(y),o}}}};return l}function hN(t){t===void 0&&(t={});var r=pN(null);return r.options=Nn({async:!0,ssr:!1},t),r}var lw=function(t){var r=t.sideCar,o=iw(t,["sideCar"]);if(!r)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var i=r.read();if(!i)throw new Error("Sidecar medium not found");return b.createElement(i,Nn({},o))};lw.isSideCarExport=!0;function gN(t,r){return t.useMedium(r),lw}var cw=hN(),sf=function(){},mc=b.forwardRef(function(t,r){var o=b.useRef(null),i=b.useState({onScrollCapture:sf,onWheelCapture:sf,onTouchMoveCapture:sf}),l=i[0],c=i[1],f=t.forwardProps,h=t.children,g=t.className,m=t.removeScrollBar,y=t.enabled,v=t.shards,k=t.sideCar,S=t.noRelative,C=t.noIsolation,x=t.inert,E=t.allowPinchZoom,T=t.as,_=T===void 0?"div":T,j=t.gapMode,A=iw(t,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),R=k,D=fN([o,r]),L=Nn(Nn({},A),l);return b.createElement(b.Fragment,null,y&&b.createElement(R,{sideCar:cw,removeScrollBar:m,shards:v,noRelative:S,noIsolation:C,inert:x,setCallbacks:c,allowPinchZoom:!!E,lockRef:o,gapMode:j}),f?b.cloneElement(b.Children.only(h),Nn(Nn({},L),{ref:D})):b.createElement(_,Nn({},L,{className:g,ref:D}),h))});mc.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};mc.classNames={fullWidth:jl,zeroRight:Nl};var vN=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function yN(){if(!document)return null;var t=document.createElement("style");t.type="text/css";var r=vN();return r&&t.setAttribute("nonce",r),t}function bN(t,r){t.styleSheet?t.styleSheet.cssText=r:t.appendChild(document.createTextNode(r))}function wN(t){var r=document.head||document.getElementsByTagName("head")[0];r.appendChild(t)}var xN=function(){var t=0,r=null;return{add:function(o){t==0&&(r=yN())&&(bN(r,o),wN(r)),t++},remove:function(){t--,!t&&r&&(r.parentNode&&r.parentNode.removeChild(r),r=null)}}},kN=function(){var t=xN();return function(r,o){b.useEffect(function(){return t.add(r),function(){t.remove()}},[r&&o])}},uw=function(){var t=kN(),r=function(o){var i=o.styles,l=o.dynamic;return t(i,l),null};return r},SN={left:0,top:0,right:0,gap:0},lf=function(t){return parseInt(t||"",10)||0},EN=function(t){var r=window.getComputedStyle(document.body),o=r[t==="padding"?"paddingLeft":"marginLeft"],i=r[t==="padding"?"paddingTop":"marginTop"],l=r[t==="padding"?"paddingRight":"marginRight"];return[lf(o),lf(i),lf(l)]},CN=function(t){if(t===void 0&&(t="margin"),typeof window>"u")return SN;var r=EN(t),o=document.documentElement.clientWidth,i=window.innerWidth;return{left:r[0],top:r[1],right:r[2],gap:Math.max(0,i-o+r[2]-r[0])}},TN=uw(),lo="data-scroll-locked",AN=function(t,r,o,i){var l=t.left,c=t.top,f=t.right,h=t.gap;return o===void 0&&(o="margin"),`
21
+ .`.concat(lN,` {
22
+ overflow: hidden `).concat(i,`;
23
+ padding-right: `).concat(h,"px ").concat(i,`;
24
+ }
25
+ body[`).concat(lo,`] {
26
+ overflow: hidden `).concat(i,`;
27
+ overscroll-behavior: contain;
28
+ `).concat([r&&"position: relative ".concat(i,";"),o==="margin"&&`
29
+ padding-left: `.concat(l,`px;
30
+ padding-top: `).concat(c,`px;
31
+ padding-right: `).concat(f,`px;
32
+ margin-left:0;
33
+ margin-top:0;
34
+ margin-right: `).concat(h,"px ").concat(i,`;
35
+ `),o==="padding"&&"padding-right: ".concat(h,"px ").concat(i,";")].filter(Boolean).join(""),`
36
+ }
37
+
38
+ .`).concat(Nl,` {
39
+ right: `).concat(h,"px ").concat(i,`;
40
+ }
41
+
42
+ .`).concat(jl,` {
43
+ margin-right: `).concat(h,"px ").concat(i,`;
44
+ }
45
+
46
+ .`).concat(Nl," .").concat(Nl,` {
47
+ right: 0 `).concat(i,`;
48
+ }
49
+
50
+ .`).concat(jl," .").concat(jl,` {
51
+ margin-right: 0 `).concat(i,`;
52
+ }
53
+
54
+ body[`).concat(lo,`] {
55
+ `).concat(cN,": ").concat(h,`px;
56
+ }
57
+ `)},Ay=function(){var t=parseInt(document.body.getAttribute(lo)||"0",10);return isFinite(t)?t:0},_N=function(){b.useEffect(function(){return document.body.setAttribute(lo,(Ay()+1).toString()),function(){var t=Ay()-1;t<=0?document.body.removeAttribute(lo):document.body.setAttribute(lo,t.toString())}},[])},NN=function(t){var r=t.noRelative,o=t.noImportant,i=t.gapMode,l=i===void 0?"margin":i;_N();var c=b.useMemo(function(){return CN(l)},[l]);return b.createElement(TN,{styles:AN(c,!r,l,o?"":"!important")})},zf=!1;if(typeof window<"u")try{var yl=Object.defineProperty({},"passive",{get:function(){return zf=!0,!0}});window.addEventListener("test",yl,yl),window.removeEventListener("test",yl,yl)}catch{zf=!1}var no=zf?{passive:!1}:!1,jN=function(t){return t.tagName==="TEXTAREA"},dw=function(t,r){if(!(t instanceof Element))return!1;var o=window.getComputedStyle(t);return o[r]!=="hidden"&&!(o.overflowY===o.overflowX&&!jN(t)&&o[r]==="visible")},RN=function(t){return dw(t,"overflowY")},ON=function(t){return dw(t,"overflowX")},_y=function(t,r){var o=r.ownerDocument,i=r;do{typeof ShadowRoot<"u"&&i instanceof ShadowRoot&&(i=i.host);var l=fw(t,i);if(l){var c=mw(t,i),f=c[1],h=c[2];if(f>h)return!0}i=i.parentNode}while(i&&i!==o.body);return!1},DN=function(t){var r=t.scrollTop,o=t.scrollHeight,i=t.clientHeight;return[r,o,i]},MN=function(t){var r=t.scrollLeft,o=t.scrollWidth,i=t.clientWidth;return[r,o,i]},fw=function(t,r){return t==="v"?RN(r):ON(r)},mw=function(t,r){return t==="v"?DN(r):MN(r)},LN=function(t,r){return t==="h"&&r==="rtl"?-1:1},zN=function(t,r,o,i,l){var c=LN(t,window.getComputedStyle(r).direction),f=c*i,h=o.target,g=r.contains(h),m=!1,y=f>0,v=0,k=0;do{if(!h)break;var S=mw(t,h),C=S[0],x=S[1],E=S[2],T=x-E-c*C;(C||T)&&fw(t,h)&&(v+=T,k+=C);var _=h.parentNode;h=_&&_.nodeType===Node.DOCUMENT_FRAGMENT_NODE?_.host:_}while(!g&&h!==document.body||g&&(r.contains(h)||r===h));return(y&&Math.abs(v)<1||!y&&Math.abs(k)<1)&&(m=!0),m},bl=function(t){return"changedTouches"in t?[t.changedTouches[0].clientX,t.changedTouches[0].clientY]:[0,0]},Ny=function(t){return[t.deltaX,t.deltaY]},jy=function(t){return t&&"current"in t?t.current:t},HN=function(t,r){return t[0]===r[0]&&t[1]===r[1]},BN=function(t){return`
58
+ .block-interactivity-`.concat(t,` {pointer-events: none;}
59
+ .allow-interactivity-`).concat(t,` {pointer-events: all;}
60
+ `)},WN=0,ro=[];function UN(t){var r=b.useRef([]),o=b.useRef([0,0]),i=b.useRef(),l=b.useState(WN++)[0],c=b.useState(uw)[0],f=b.useRef(t);b.useEffect(function(){f.current=t},[t]),b.useEffect(function(){if(t.inert){document.body.classList.add("block-interactivity-".concat(l));var x=iN([t.lockRef.current],(t.shards||[]).map(jy),!0).filter(Boolean);return x.forEach(function(E){return E.classList.add("allow-interactivity-".concat(l))}),function(){document.body.classList.remove("block-interactivity-".concat(l)),x.forEach(function(E){return E.classList.remove("allow-interactivity-".concat(l))})}}},[t.inert,t.lockRef.current,t.shards]);var h=b.useCallback(function(x,E){if("touches"in x&&x.touches.length===2||x.type==="wheel"&&x.ctrlKey)return!f.current.allowPinchZoom;var T=bl(x),_=o.current,j="deltaX"in x?x.deltaX:_[0]-T[0],A="deltaY"in x?x.deltaY:_[1]-T[1],R,D=x.target,L=Math.abs(j)>Math.abs(A)?"h":"v";if("touches"in x&&L==="h"&&D.type==="range")return!1;var B=window.getSelection(),P=B&&B.anchorNode,te=P?P===D||P.contains(D):!1;if(te)return!1;var ee=_y(L,D);if(!ee)return!0;if(ee?R=L:(R=L==="v"?"h":"v",ee=_y(L,D)),!ee)return!1;if(!i.current&&"changedTouches"in x&&(j||A)&&(i.current=R),!R)return!0;var F=i.current||R;return zN(F,E,x,F==="h"?j:A)},[]),g=b.useCallback(function(x){var E=x;if(!(!ro.length||ro[ro.length-1]!==c)){var T="deltaY"in E?Ny(E):bl(E),_=r.current.filter(function(R){return R.name===E.type&&(R.target===E.target||E.target===R.shadowParent)&&HN(R.delta,T)})[0];if(_&&_.should){E.cancelable&&E.preventDefault();return}if(!_){var j=(f.current.shards||[]).map(jy).filter(Boolean).filter(function(R){return R.contains(E.target)}),A=j.length>0?h(E,j[0]):!f.current.noIsolation;A&&E.cancelable&&E.preventDefault()}}},[]),m=b.useCallback(function(x,E,T,_){var j={name:x,delta:E,target:T,should:_,shadowParent:qN(T)};r.current.push(j),setTimeout(function(){r.current=r.current.filter(function(A){return A!==j})},1)},[]),y=b.useCallback(function(x){o.current=bl(x),i.current=void 0},[]),v=b.useCallback(function(x){m(x.type,Ny(x),x.target,h(x,t.lockRef.current))},[]),k=b.useCallback(function(x){m(x.type,bl(x),x.target,h(x,t.lockRef.current))},[]);b.useEffect(function(){return ro.push(c),t.setCallbacks({onScrollCapture:v,onWheelCapture:v,onTouchMoveCapture:k}),document.addEventListener("wheel",g,no),document.addEventListener("touchmove",g,no),document.addEventListener("touchstart",y,no),function(){ro=ro.filter(function(x){return x!==c}),document.removeEventListener("wheel",g,no),document.removeEventListener("touchmove",g,no),document.removeEventListener("touchstart",y,no)}},[]);var S=t.removeScrollBar,C=t.inert;return b.createElement(b.Fragment,null,C?b.createElement(c,{styles:BN(l)}):null,S?b.createElement(NN,{noRelative:t.noRelative,gapMode:t.gapMode}):null)}function qN(t){for(var r=null;t!==null;)t instanceof ShadowRoot&&(r=t.host,t=t.host),t=t.parentNode;return r}const IN=gN(cw,UN);var pw=b.forwardRef(function(t,r){return b.createElement(mc,Nn({},t,{ref:r,sideCar:IN}))});pw.classNames=mc.classNames;var PN=function(t){if(typeof document>"u")return null;var r=Array.isArray(t)?t[0]:t;return r.ownerDocument.body},ao=new WeakMap,wl=new WeakMap,xl={},cf=0,hw=function(t){return t&&(t.host||hw(t.parentNode))},KN=function(t,r){return r.map(function(o){if(t.contains(o))return o;var i=hw(o);return i&&t.contains(i)?i:(console.error("aria-hidden",o,"in not contained inside",t,". Doing nothing"),null)}).filter(function(o){return!!o})},FN=function(t,r,o,i){var l=KN(r,Array.isArray(t)?t:[t]);xl[o]||(xl[o]=new WeakMap);var c=xl[o],f=[],h=new Set,g=new Set(l),m=function(v){!v||h.has(v)||(h.add(v),m(v.parentNode))};l.forEach(m);var y=function(v){!v||g.has(v)||Array.prototype.forEach.call(v.children,function(k){if(h.has(k))y(k);else try{var S=k.getAttribute(i),C=S!==null&&S!=="false",x=(ao.get(k)||0)+1,E=(c.get(k)||0)+1;ao.set(k,x),c.set(k,E),f.push(k),x===1&&C&&wl.set(k,!0),E===1&&k.setAttribute(o,"true"),C||k.setAttribute(i,"true")}catch(T){console.error("aria-hidden: cannot operate on ",k,T)}})};return y(r),h.clear(),cf++,function(){f.forEach(function(v){var k=ao.get(v)-1,S=c.get(v)-1;ao.set(v,k),c.set(v,S),k||(wl.has(v)||v.removeAttribute(i),wl.delete(v)),S||v.removeAttribute(o)}),cf--,cf||(ao=new WeakMap,ao=new WeakMap,wl=new WeakMap,xl={})}},YN=function(t,r,o){o===void 0&&(o="data-aria-hidden");var i=Array.from(Array.isArray(t)?t:[t]),l=PN(t);return l?(i.push.apply(i,Array.from(l.querySelectorAll("[aria-live], script"))),FN(i,l,o,"aria-hidden")):function(){return null}},pc="Dialog",[gw]=dm(pc),[VN,kn]=gw(pc),vw=t=>{const{__scopeDialog:r,children:o,open:i,defaultOpen:l,onOpenChange:c,modal:f=!0}=t,h=b.useRef(null),g=b.useRef(null),[m,y]=Bb({prop:i,defaultProp:l??!1,onChange:c,caller:pc});return d.jsx(VN,{scope:r,triggerRef:h,contentRef:g,contentId:Cl(),titleId:Cl(),descriptionId:Cl(),open:m,onOpenChange:y,onOpenToggle:b.useCallback(()=>y(v=>!v),[y]),modal:f,children:o})};vw.displayName=pc;var yw="DialogTrigger",bw=b.forwardRef((t,r)=>{const{__scopeDialog:o,...i}=t,l=kn(yw,o),c=xn(r,l.triggerRef);return d.jsx(Bt.button,{type:"button","aria-haspopup":"dialog","aria-expanded":l.open,"aria-controls":l.contentId,"data-state":Tm(l.open),...i,ref:c,onClick:Lt(t.onClick,l.onOpenToggle)})});bw.displayName=yw;var Em="DialogPortal",[GN,ww]=gw(Em,{forceMount:void 0}),xw=t=>{const{__scopeDialog:r,forceMount:o,children:i,container:l}=t,c=kn(Em,r);return d.jsx(GN,{scope:r,forceMount:o,children:b.Children.map(i,f=>d.jsx(Co,{present:o||c.open,children:d.jsx(xm,{asChild:!0,container:l,children:f})}))})};xw.displayName=Em;var Pl="DialogOverlay",kw=b.forwardRef((t,r)=>{const o=ww(Pl,t.__scopeDialog),{forceMount:i=o.forceMount,...l}=t,c=kn(Pl,t.__scopeDialog);return c.modal?d.jsx(Co,{present:i||c.open,children:d.jsx(XN,{...l,ref:r})}):null});kw.displayName=Pl;var $N=fb("DialogOverlay.RemoveScroll"),XN=b.forwardRef((t,r)=>{const{__scopeDialog:o,...i}=t,l=kn(Pl,o);return d.jsx(pw,{as:$N,allowPinchZoom:!0,shards:[l.contentRef],children:d.jsx(Bt.div,{"data-state":Tm(l.open),...i,ref:r,style:{pointerEvents:"auto",...i.style}})})}),ha="DialogContent",Sw=b.forwardRef((t,r)=>{const o=ww(ha,t.__scopeDialog),{forceMount:i=o.forceMount,...l}=t,c=kn(ha,t.__scopeDialog);return d.jsx(Co,{present:i||c.open,children:c.modal?d.jsx(ZN,{...l,ref:r}):d.jsx(QN,{...l,ref:r})})});Sw.displayName=ha;var ZN=b.forwardRef((t,r)=>{const o=kn(ha,t.__scopeDialog),i=b.useRef(null),l=xn(r,o.contentRef,i);return b.useEffect(()=>{const c=i.current;if(c)return YN(c)},[]),d.jsx(Ew,{...t,ref:l,trapFocus:o.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Lt(t.onCloseAutoFocus,c=>{c.preventDefault(),o.triggerRef.current?.focus()}),onPointerDownOutside:Lt(t.onPointerDownOutside,c=>{const f=c.detail.originalEvent,h=f.button===0&&f.ctrlKey===!0;(f.button===2||h)&&c.preventDefault()}),onFocusOutside:Lt(t.onFocusOutside,c=>c.preventDefault())})}),QN=b.forwardRef((t,r)=>{const o=kn(ha,t.__scopeDialog),i=b.useRef(!1),l=b.useRef(!1);return d.jsx(Ew,{...t,ref:r,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:c=>{t.onCloseAutoFocus?.(c),c.defaultPrevented||(i.current||o.triggerRef.current?.focus(),c.preventDefault()),i.current=!1,l.current=!1},onInteractOutside:c=>{t.onInteractOutside?.(c),c.defaultPrevented||(i.current=!0,c.detail.originalEvent.type==="pointerdown"&&(l.current=!0));const f=c.target;o.triggerRef.current?.contains(f)&&c.preventDefault(),c.detail.originalEvent.type==="focusin"&&l.current&&c.preventDefault()}})}),Ew=b.forwardRef((t,r)=>{const{__scopeDialog:o,trapFocus:i,onOpenAutoFocus:l,onCloseAutoFocus:c,...f}=t,h=kn(ha,o),g=b.useRef(null),m=xn(r,g);return sN(),d.jsxs(d.Fragment,{children:[d.jsx(ow,{asChild:!0,loop:!0,trapped:i,onMountAutoFocus:l,onUnmountAutoFocus:c,children:d.jsx(fm,{role:"dialog",id:h.contentId,"aria-describedby":h.descriptionId,"aria-labelledby":h.titleId,"data-state":Tm(h.open),...f,ref:m,onDismiss:()=>h.onOpenChange(!1)})}),d.jsxs(d.Fragment,{children:[d.jsx(JN,{titleId:h.titleId}),d.jsx(tj,{contentRef:g,descriptionId:h.descriptionId})]})]})}),Cm="DialogTitle",Cw=b.forwardRef((t,r)=>{const{__scopeDialog:o,...i}=t,l=kn(Cm,o);return d.jsx(Bt.h2,{id:l.titleId,...i,ref:r})});Cw.displayName=Cm;var Tw="DialogDescription",Aw=b.forwardRef((t,r)=>{const{__scopeDialog:o,...i}=t,l=kn(Tw,o);return d.jsx(Bt.p,{id:l.descriptionId,...i,ref:r})});Aw.displayName=Tw;var _w="DialogClose",Nw=b.forwardRef((t,r)=>{const{__scopeDialog:o,...i}=t,l=kn(_w,o);return d.jsx(Bt.button,{type:"button",...i,ref:r,onClick:Lt(t.onClick,()=>l.onOpenChange(!1))})});Nw.displayName=_w;function Tm(t){return t?"open":"closed"}var jw="DialogTitleWarning",[LD,Rw]=XC(jw,{contentName:ha,titleName:Cm,docsSlug:"dialog"}),JN=({titleId:t})=>{const r=Rw(jw),o=`\`${r.contentName}\` requires a \`${r.titleName}\` for the component to be accessible for screen reader users.
61
+
62
+ If you want to hide the \`${r.titleName}\`, you can wrap it with our VisuallyHidden component.
63
+
64
+ For more information, see https://radix-ui.com/primitives/docs/components/${r.docsSlug}`;return b.useEffect(()=>{t&&(document.getElementById(t)||console.error(o))},[o,t]),null},ej="DialogDescriptionWarning",tj=({contentRef:t,descriptionId:r})=>{const i=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${Rw(ej).contentName}}.`;return b.useEffect(()=>{const l=t.current?.getAttribute("aria-describedby");r&&l&&(document.getElementById(r)||console.warn(i))},[i,t,r]),null},Fs=vw,nj=bw,Ys=xw,Vs=kw,Gs=Sw,$s=Cw,hc=Aw,zD=Nw;const uf=t=>t==="danger"?"var(--status-red)":"var(--accent)",Xs=({open:t,onOpenChange:r,title:o,description:i,confirmLabel:l,confirmKind:c="default",cancelLabel:f,onConfirm:h})=>{const{t:g}=Ee(),m=f??g("common.cancel");return d.jsx(Fs,{open:t,onOpenChange:r,children:d.jsxs(Ys,{children:[d.jsx(Vs,{"data-testid":"confirm-overlay",className:"app-overlay fixed inset-0 z-[60]"}),d.jsx("div",{className:"pointer-events-none fixed inset-0 z-[70] grid place-items-center p-4",children:d.jsxs(Gs,{"data-testid":"confirm-content",className:"dialog-scale-pop elev-2 pointer-events-auto w-[440px] max-w-[calc(100vw-32px)] rounded-lg border p-5",style:{background:"var(--bg-elevated)",borderColor:"var(--border-bright)"},children:[d.jsxs("div",{className:"flex items-start gap-3",children:[d.jsx("div",{"aria-hidden":!0,className:"flex h-9 w-9 shrink-0 items-center justify-center rounded",style:{background:`color-mix(in oklab, ${uf(c)} 14%, transparent)`,color:uf(c),border:`1px solid color-mix(in oklab, ${uf(c)} 30%, transparent)`},children:c==="danger"?d.jsx(nc,{size:18}):d.jsx(uS,{size:18})}),d.jsxs("div",{className:"min-w-0 flex-1",children:[d.jsx($s,{"data-testid":"confirm-title",className:"text-lg font-semibold text-pri",children:o}),d.jsx(hc,{"data-testid":"confirm-description",className:"mt-1.5 text-sm text-sec",children:i})]})]}),d.jsxs("div",{className:"mt-5 flex justify-end gap-2",children:[d.jsx("button",{type:"button","data-testid":"confirm-cancel",onClick:()=>r(!1),autoFocus:c==="danger",className:"icon-btn",children:m}),d.jsx("button",{type:"button","data-testid":"confirm-action",onClick:()=>{h(),r(!1)},autoFocus:c!=="danger",className:c==="danger"?"icon-btn icon-btn--danger-solid":"icon-btn icon-btn--primary",children:l})]})]})})]})})},rj=["You are a Researcher. Collect facts, data, and sources for the assigned topic.","工作方式 / How to work:","- Break the topic into key questions first, then investigate each one. / 先拆出要回答的关键问题,再逐项调查。","- Prefer primary sources and real project files; attach a source or file path to every conclusion. / 优先一手来源和项目内真实文件;每个结论都附上来源或文件路径。","- Separate facts, inferences, and unknowns; never present guesses as facts. / 区分事实、推断和未知,不把猜测写成结论。","Delivery / 交付说明: include findings by topic, source list, and unresolved questions."].join(`
65
+ `),aj=["You are a Fact-checker. Verify research claims and evidence strength without expanding the scope by default.","工作方式 / How to work:","- Check every claim against its source and mark supported, uncertain, or unsupported. / 逐条核对结论与其来源,标注支持、存疑或不支持。","- Cross-check critical claims with a second source, command, or direct file read. / 对关键结论做交叉验证。","- When a claim is wrong, provide the corrected wording and evidence. / 发现错误时给出纠正后的表述和依据。","Delivery / 交付说明: group by confidence and list refuted or uncertain claims first."].join(`
66
+ `),oj=["You are a Drafter. Turn goals and source material into a clear first-draft document.","工作方式 / How to work:","- Confirm audience, purpose, and scope before outlining and writing. / 先确认读者、目的和范围,再列提纲,后成文。","- Use real project code and files as the source of truth; do not invent behavior or APIs. / 以项目内真实代码和文件为准,不编造行为或接口。","- Mark missing material and points that need confirmation. / 标注待确认和缺素材的位置。","Delivery / 交付说明: include document path, structure overview, and confirmation checklist."].join(`
67
+ `),sj=["You are a Document Reviewer. Check a draft for accuracy and readability; do not rewrite the whole document by default.","工作方式 / How to work:","- Verify technical details against real code and files first. / 先对照项目真实代码和文件核对技术细节。","- Check structure, terminology consistency, and whether readers can follow the document. / 检查结构、术语一致性,以及读者能否按文档完成操作。","- List issues by severity with concrete edits or rewrite examples. / 问题按严重度列出,给出具体修改建议或改写示例。","Delivery / 交付说明: list factual errors first, then structure and wording issues."].join(`
68
+ `),ij=[{id:"build_review_test",workers:[{nameStem:"coder",role:"coder"},{nameStem:"reviewer",role:"reviewer"},{nameStem:"tester",role:"tester"}],goalTemplate:{en:"Implement <feature>: have the Coder implement, Reviewer audit, and Tester verify; describe what to build, key constraints, and validation commands or acceptance criteria.",zh:"实现 X 功能:让 Coder 实现、Reviewer 审查、Tester 验证;写清楚要做什么、关键约束,以及验证命令或验收标准。"}},{id:"research_factcheck",workers:[{nameStem:"researcher",role:"custom",descriptionOverride:rj},{nameStem:"factchecker",role:"custom",descriptionOverride:aj}],goalTemplate:{en:"Research <topic>: have the Researcher gather evidence and the Factchecker verify it; list questions, trusted sources, and the decision this research should support.",zh:"调研 X 主题:让 Researcher 收集证据、Factchecker 复核;列出要回答的问题、可信来源要求,以及这次调研要支撑的决策。"}},{id:"docs_pipeline",workers:[{nameStem:"drafter",role:"custom",descriptionOverride:oj},{nameStem:"doc-reviewer",role:"custom",descriptionOverride:sj}],goalTemplate:{en:"Write <doc>: have the Drafter write and the Doc Reviewer review; state the audience, scope, required sections, and code or files it should describe.",zh:"撰写 X 文档:让 Drafter 撰写、Doc Reviewer 审查;写明读者、范围、必备章节,以及它要描述的代码或文件。"}}],Ry={build_review_test:{icon:d.jsx(_S,{size:16,"aria-hidden":!0}),titleKey:"scenario.build_review_test.title",descKey:"scenario.build_review_test.desc"},research_factcheck:{icon:d.jsx(V2,{size:16,"aria-hidden":!0}),titleKey:"scenario.research_factcheck.title",descKey:"scenario.research_factcheck.desc"},docs_pipeline:{icon:d.jsx(ES,{size:16,"aria-hidden":!0}),titleKey:"scenario.docs_pipeline.title",descKey:"scenario.docs_pipeline.desc"}},lj=({workspaceId:t})=>{const{language:r,t:o}=Ee(),i=Qt(),[l,c]=b.useState(null),[f,h]=b.useState(""),[g,m]=b.useState(!1),y=S=>{h(S.goalTemplate[r]),c(S)},v=()=>{g||c(null)},k=()=>{!l||g||!f.trim()||(m(!0),tC(t,l.id,f).then(()=>{i.show({kind:"success",message:o("scenario.applied")}),c(null)}).catch(S=>{i.show({kind:"error",message:S instanceof Error?S.message:String(S)})}).finally(()=>m(!1)))};return d.jsxs("div",{className:"mx-auto mt-6 w-full max-w-[420px]","data-testid":"scenario-team-cards",children:[d.jsxs("div",{className:"mb-2 flex items-center justify-center gap-1.5 text-xs font-medium uppercase tracking-wide text-ter",children:[d.jsx(H0,{size:12,"aria-hidden":!0}),o("scenario.sectionTitle")]}),d.jsx("div",{className:"flex flex-col gap-2",children:ij.map(S=>{const C=Ry[S.id];return d.jsxs("button",{type:"button",onClick:()=>y(S),className:"rounded border bg-1 p-3 text-left transition-colors hover:bg-3",style:{borderColor:"var(--border)"},"data-testid":`scenario-card-${S.id}`,children:[d.jsxs("div",{className:"flex items-center gap-2 text-pri",children:[C.icon,d.jsx("span",{className:"text-sm font-medium",children:o(C.titleKey)})]}),d.jsx("div",{className:"mt-1 text-xs text-ter",children:o(C.descKey)})]},S.id)})}),d.jsx(Fs,{open:l!==null,onOpenChange:S=>{S||v()},children:d.jsxs(Ys,{children:[d.jsx(Vs,{className:"app-overlay fixed inset-0 z-[60]"}),d.jsx("div",{className:"pointer-events-none fixed inset-0 z-[70] grid place-items-center p-4",children:d.jsxs(Gs,{"data-testid":"scenario-goal-dialog",className:"dialog-scale-pop elev-2 pointer-events-auto w-[480px] max-w-[calc(100vw-32px)] rounded-lg border p-5",style:{background:"var(--bg-elevated)",borderColor:"var(--border-bright)"},onEscapeKeyDown:S=>{g&&S.preventDefault()},onPointerDownOutside:S=>{g&&S.preventDefault()},children:[d.jsx($s,{className:"text-lg font-semibold text-pri",children:l?o(Ry[l.id].titleKey):""}),d.jsx(hc,{className:"mt-1 text-xs text-ter",children:o("scenario.goalHint")}),d.jsxs("label",{className:"mt-4 block",children:[d.jsx("span",{className:"mb-1 block text-xs font-medium text-sec",children:o("scenario.goalLabel")}),d.jsx("textarea",{value:f,onChange:S=>h(S.target.value),rows:5,className:"w-full resize-y rounded border bg-1 p-2 text-sm text-pri outline-none focus:border-[var(--accent)]",style:{borderColor:"var(--border)"},disabled:g,"data-testid":"scenario-goal-input"})]}),d.jsxs("div",{className:"mt-4 flex justify-end gap-2",children:[d.jsx("button",{type:"button",className:"icon-btn",onClick:v,disabled:g,"data-testid":"scenario-goal-cancel",children:o("scenario.cancel")}),d.jsx("button",{type:"button",className:"icon-btn icon-btn--primary disabled:cursor-not-allowed disabled:opacity-50",onClick:k,disabled:g||!f.trim(),"data-testid":"scenario-goal-apply",children:o(g?"scenario.applying":"scenario.apply")})]})]})})]})})]})},Ow=({size:t,children:r,color:o,fontRatio:i=.4,ringColor:l=null,ringSurface:c="var(--bg-1)",mono:f=!1,decoration:h,testId:g,data:m,className:y="",style:v={}})=>{const k={};if(m)for(const[S,C]of Object.entries(m))C!==void 0&&(k[`data-${S}`]=C);return d.jsxs("span",{"data-testid":g,...k,className:`relative inline-flex shrink-0 items-center justify-center rounded font-semibold ${f?"mono ":""}${y}`.trim(),style:{width:`${t}px`,height:`${t}px`,fontSize:`${Math.round(t*i)}px`,color:o,background:`color-mix(in oklab, ${o} 14%, transparent)`,border:`1px solid color-mix(in oklab, ${o} 35%, transparent)`,boxShadow:l?`0 0 0 2px ${c}, 0 0 0 4px ${l}`:void 0,...v},"aria-hidden":!0,children:[r,h]})},cj={orchestrator:om,coder:pS,reviewer:VS,tester:Ml,sentinel:kS,custom:nE},uj={orchestrator:"crown",coder:"code",reviewer:"review",tester:"test",sentinel:"sentinel",custom:"custom"},dj={orchestrator:"var(--accent)",coder:"var(--status-blue)",reviewer:"var(--status-purple)",tester:"var(--status-orange)",sentinel:"var(--status-green)",custom:"var(--text-secondary)"},fj={working:"var(--status-green)",idle:"var(--text-tertiary)",stopped:"var(--status-red)"},mj=({role:t,size:r=32,statusRing:o="none"})=>{const i=cj[t];return d.jsx(Ow,{size:r,color:dj[t],ringColor:o==="none"?null:fj[o],ringSurface:"var(--bg-2)",testId:"role-avatar",data:{role:t,icon:uj[t],"status-ring":o},children:d.jsx(i,{size:Math.round(r*.56),"aria-hidden":!0})})},pj={agy:{src:"/cli-icons/agy.png",surface:"#f4f4f4"},claude:{src:"/cli-icons/claude.png",surface:"#f7f5f2"},codex:{src:"/cli-icons/codex.png",surface:"#f4f4f4"},cursor:{src:"/cli-icons/cursor.ico",surface:"#ffffff"},gemini:{src:"/cli-icons/gemini.png",surface:"#f4f4f4"},grok:{src:"/cli-icons/grok.ico",surface:"#ffffff"},hermes:{src:"/cli-icons/hermes.png",surface:"#ffffff"},opencode:{src:"/cli-icons/opencode.svg",surface:"#f4f4f4"},qwen:{src:"/cli-icons/qwen.png",surface:"#f4f8ff"}},hj={working:"var(--status-green)",idle:"var(--text-tertiary)",stopped:"var(--status-red)"},Dw=t=>t?pj[t]??null:null,HD=({commandPresetId:t,fallback:r=null,size:o=20,testId:i="cli-agent-logo"})=>{const l=Dw(t);if(!l)return r;const c=Math.round(o*.78);return d.jsx("span",{"data-testid":i,"data-command-preset":t,className:"inline-flex shrink-0 items-center justify-center overflow-hidden rounded","aria-hidden":!0,style:{width:`${o}px`,height:`${o}px`,background:l.surface,border:"1px solid color-mix(in oklab, var(--text-primary) 12%, transparent)"},children:d.jsx("img",{src:l.src,alt:"",decoding:"sync",width:c,height:c,style:{width:`${c}px`,height:`${c}px`,objectFit:"contain"}})})},Mw=({commandPresetId:t,workerRole:r,size:o=32,statusRing:i="none"})=>{const l=Dw(t);if(!l)return d.jsx(mj,{role:r,size:o,statusRing:i});const c=i==="none"?null:hj[i],f=Math.round(o*.78);return d.jsx("span",{"data-testid":"cli-agent-avatar","data-command-preset":t,"data-status-ring":i,className:"relative inline-flex shrink-0 items-center justify-center overflow-hidden rounded","aria-hidden":!0,style:{width:`${o}px`,height:`${o}px`,background:l.surface,border:"1px solid color-mix(in oklab, var(--text-primary) 12%, transparent)",boxShadow:c?`0 0 0 2px var(--bg-1), 0 0 0 4px ${c}`:void 0},children:d.jsx("img",{src:l.src,alt:"",decoding:"sync",width:f,height:f,style:{width:`${f}px`,height:`${f}px`,objectFit:"contain"}})})},Lw=({initialValue:t,saving:r,setSaving:o,onSave:i,onCancel:l,className:c})=>{const f=Qt(),[h,g]=b.useState(t),m=b.useRef(null),y=b.useRef(!1);b.useEffect(()=>{const C=setTimeout(()=>{m.current?.focus(),m.current?.select()},50);return()=>clearTimeout(C)},[]);const v=async()=>{const C=h.trim();if(!C||C===t){l();return}o(!0);try{const x=await i(C);if(x.error){f.show({kind:"error",message:x.error}),g(t),setTimeout(()=>{m.current?.focus(),m.current?.select()},50),o(!1);return}}catch(x){const E=x instanceof Error?x.message:"Failed to rename worker";f.show({kind:"error",message:E}),g(t),setTimeout(()=>{m.current?.focus(),m.current?.select()},50),o(!1);return}o(!1),l()},k=C=>{C.stopPropagation(),C.key==="Enter"?(C.preventDefault(),v()):C.key==="Escape"&&(C.preventDefault(),y.current=!0,l())},S=()=>{y.current||v()};return d.jsx("input",{ref:m,type:"text",value:h,disabled:r,onChange:C=>g(C.target.value),onKeyDown:k,onBlur:S,maxLength:64,className:c,onClick:C=>C.stopPropagation()})},zw=t=>t.status==="working"?{kind:"working",label:"working",dotClass:"status-dot status-dot--working",tone:"var(--status-green)"}:t.status==="stopped"?{kind:"stopped",label:"stopped",dotClass:"status-dot status-dot--stopped",tone:"var(--status-red)"}:{kind:"idle",label:"idle",dotClass:"status-dot status-dot--idle",tone:"var(--text-tertiary)"},BD=t=>t?{kind:"working",label:"running",dotClass:"status-dot status-dot--working",tone:"var(--status-green)"}:{kind:"stopped",label:"stopped",dotClass:"status-dot status-dot--stopped",tone:"var(--status-red)"},Hw={working:"pill--green",idle:"pill--ghost",stopped:"pill--red"},Bw=t=>`role.${t}`,Kl=t=>t==="working"?"common.running":t==="idle"?"common.idle":"common.stopped",gj=({hasRun:t,isPending:r=!1,isEditing:o=!1,onRenameWorker:i,onStartEditing:l,onCancelEditing:c,onAction:f,onClick:h,worker:g})=>{const{t:m}=Ee(),y=Tt(),v=zw(g),[k,S]=b.useState(!1),C=j=>A=>{if(A.stopPropagation(),j==="rename"){l?.();return}f?.(j,g)},x=g.ephemeral===!0&&g.spawnedBy==="workflow",E=g.ephemeral===!0&&g.spawnedBy==="orchestrator",T=x?"workflow":E?"orchestrator":null;if(y)return d.jsx(vj,{ephemeralTone:T,hasRun:t,isPending:r,onAction:f,onClick:h,status:v,worker:g,isEditing:o,onRenameWorker:i,onCancelEditing:c});const _=o?"div":"button";return d.jsxs("div",{className:"worker-card-shell relative","data-status":v.kind,"data-worker-name":g.name,"data-role":g.role,"data-ephemeral":g.ephemeral===!0?"true":void 0,"data-spawned-by":g.spawnedBy??void 0,"data-mobile":y?"true":void 0,children:[d.jsxs(_,{type:o?void 0:"button",onClick:o?void 0:()=>h(g),"aria-label":o?void 0:m("worker.open",{name:g.name}),className:`card worker-card relative flex w-full flex-col gap-3 overflow-hidden p-4 text-left ${o?"":"card--interactive"}`,"data-testid":`worker-card-${g.id}`,"data-status":v.kind,style:T?{borderStyle:"dashed",borderColor:T==="workflow"?"var(--accent)":"var(--border-bright)"}:void 0,children:[d.jsxs("div",{className:"flex items-start gap-2",children:[d.jsx(Mw,{commandPresetId:g.commandPresetId,workerRole:g.role,size:40,statusRing:v.kind}),T?d.jsx("span",{className:"ml-auto rounded px-1.5 py-0.5 text-[10px] font-semibold uppercase tracking-wide",style:{background:T==="workflow"?"color-mix(in oklab, var(--accent) 18%, transparent)":"color-mix(in oklab, var(--text-secondary) 14%, transparent)",color:T==="workflow"?"var(--accent)":"var(--text-secondary)"},"data-testid":"worker-card-ephemeral-badge",title:T==="workflow"?"Spawned by a workflow run — auto-dismissed when its dispatch reports back.":"Spawned by the orchestrator via `team spawn` — auto-dismissed when the orchestrator exits.",children:T==="workflow"?"workflow":"temp"}):null]}),d.jsxs("div",{className:"flex min-w-0 flex-1 flex-col gap-0.5",children:[o?d.jsx(Lw,{initialValue:g.name,saving:k,setSaving:S,onSave:j=>i(g,j),onCancel:()=>c?.(),className:"worker-card-name-input"}):d.jsx("span",{className:"truncate text-base font-medium leading-tight text-pri",title:g.name,children:g.name}),d.jsx("span",{className:"worker-card__role-tag truncate leading-none mt-1",children:m(Bw(g.role))})]}),d.jsx("div",{className:"flex min-w-0 flex-col gap-1.5",children:d.jsxs("div",{className:"flex items-center gap-1.5",children:[d.jsxs("span",{className:`pill ${Hw[v.kind]} worker-card__status`,role:"status",title:v.kind==="working"?m("worker.workingLegend"):m(Kl(v.kind)),children:[d.jsx("span",{className:v.dotClass,"aria-hidden":!0}),m(Kl(v.kind))]}),g.pendingTaskCount>0?d.jsx("span",{className:"pill pill--ghost","data-testid":`worker-card-queue-${g.id}`,title:m("worker.queuedAria",{count:g.pendingTaskCount}),children:m("worker.queued",{count:g.pendingTaskCount})}):null]})})]}),f?d.jsxs("div",{className:"worker-card__actions",children:[t?y?d.jsxs(d.Fragment,{children:[d.jsx(ws,{title:m("common.stop"),onClick:C("stop"),disabled:r,variant:"danger",testId:`worker-card-stop-${g.id}`,ariaLabel:m("worker.stopAria",{name:g.name}),children:d.jsx(lm,{size:12,"aria-hidden":!0})}),d.jsx(ws,{title:m("common.restart"),onClick:C("restart"),disabled:r,testId:`worker-card-restart-${g.id}`,ariaLabel:m("worker.restartAria",{name:g.name}),children:d.jsx(im,{size:12,"aria-hidden":!0})})]}):null:d.jsx(ws,{title:m("common.start"),onClick:C("start"),disabled:r,variant:"primary",testId:`worker-card-start-${g.id}`,ariaLabel:m("worker.startAria",{name:g.name}),children:d.jsx(ko,{size:12,"aria-hidden":!0})}),d.jsx(ws,{title:m("worker.rename"),onClick:C("rename"),disabled:r||v.kind==="working",testId:`worker-card-rename-${g.id}`,ariaLabel:m("worker.renameAria",{name:g.name}),children:d.jsx(L0,{size:12,"aria-hidden":!0})}),d.jsx(ws,{title:m("common.delete"),onClick:C("delete"),variant:"danger",testId:`worker-card-delete-${g.id}`,ariaLabel:m("worker.deleteAria",{name:g.name}),children:d.jsx(tc,{size:12,"aria-hidden":!0})})]}):null]})},ws=({ariaLabel:t,children:r,disabled:o,onClick:i,testId:l,title:c,variant:f="default"})=>d.jsx(ct,{label:c,children:d.jsx("button",{type:"button",onClick:i,disabled:o,"aria-label":t,"data-testid":l,"data-variant":f,className:"worker-card__action",children:r})}),vj=({ephemeralTone:t,hasRun:r,isPending:o,onAction:i,onClick:l,status:c,worker:f,isEditing:h=!1,onRenameWorker:g,onCancelEditing:m})=>{const{t:y}=Ee(),[v,k]=b.useState(!1),[S,C]=b.useState(!1),x=b.useRef(!1),E=j=>{j==="rename"&&(x.current=!0),k(!1),i?.(j,f)},T=y(Bw(f.role)),_=h?"div":"button";return d.jsxs("div",{className:"worker-card-shell relative","data-status":c.kind,"data-worker-name":f.name,"data-role":f.role,"data-ephemeral":f.ephemeral===!0?"true":void 0,"data-spawned-by":f.spawnedBy??void 0,"data-mobile":"true",children:[d.jsxs(_,{type:h?void 0:"button",onClick:h?void 0:()=>l(f),"aria-label":h?void 0:y("worker.open",{name:f.name}),className:`card worker-card flex w-full items-center gap-3 p-3 pr-12 text-left ${h?"":"card--interactive"}`,"data-testid":`worker-card-${f.id}`,"data-status":c.kind,style:t?{borderStyle:"dashed",borderColor:t==="workflow"?"var(--accent)":"var(--border-bright)"}:void 0,children:[d.jsx(Mw,{commandPresetId:f.commandPresetId,workerRole:f.role,size:40,statusRing:c.kind}),d.jsxs("span",{className:"flex min-w-0 flex-1 flex-col gap-0.5",children:[d.jsxs("span",{className:"flex min-w-0 items-center gap-1.5",children:[h?d.jsx(Lw,{initialValue:f.name,saving:S,setSaving:C,onSave:j=>g(f,j),onCancel:()=>m?.(),className:"worker-card-name-input flex-1"}):d.jsx("span",{className:"truncate text-sm font-medium text-pri",children:f.name}),t?d.jsx("span",{className:"shrink-0 rounded px-1.5 py-0.5 text-[10px] font-semibold uppercase tracking-wide",style:{background:t==="workflow"?"color-mix(in oklab, var(--accent) 18%, transparent)":"color-mix(in oklab, var(--text-secondary) 14%, transparent)",color:t==="workflow"?"var(--accent)":"var(--text-secondary)"},"data-testid":"worker-card-ephemeral-badge",children:t==="workflow"?"workflow":"temp"}):null]}),d.jsx("span",{className:"truncate text-xs text-ter",children:T})]}),d.jsxs("span",{className:`pill ${Hw[c.kind]} worker-card__status shrink-0`,role:"status",children:[d.jsx("span",{className:c.dotClass,"aria-hidden":!0}),y(Kl(c.kind))]})]}),i?d.jsxs(d.Fragment,{children:[d.jsx("button",{type:"button","aria-label":y("worker.actionsAria",{name:f.name}),"data-testid":`worker-card-menu-${f.id}`,onClick:()=>k(!0),className:"absolute top-1/2 right-1 z-[2] flex h-11 w-11 -translate-y-1/2 items-center justify-center rounded-md text-ter",children:d.jsx(yS,{size:18,"aria-hidden":!0})}),d.jsx(Fs,{open:v,onOpenChange:k,children:d.jsxs(Ys,{children:[d.jsx(Vs,{className:"app-overlay fixed inset-0 z-40"}),d.jsx("div",{className:"pointer-events-none fixed inset-0 z-50 grid items-end",children:d.jsxs(Gs,{onCloseAutoFocus:j=>{x.current&&(j.preventDefault(),x.current=!1)},"data-testid":`worker-action-sheet-${f.id}`,className:"dialog-slide-up elev-2 pointer-events-auto flex w-full flex-col overflow-hidden rounded-t-xl border-t pb-[max(8px,env(safe-area-inset-bottom))]",style:{background:"var(--bg-elevated)",borderColor:"var(--border-bright)"},children:[d.jsxs($s,{className:"flex items-center gap-2 border-b px-4 py-3 text-sm font-semibold text-pri",style:{borderColor:"var(--border)"},children:[d.jsx("span",{className:"truncate",children:f.name}),d.jsx("span",{className:"shrink-0 text-xs font-normal text-ter",children:y(Kl(c.kind))})]}),d.jsx(hc,{className:"sr-only",children:y("worker.actionsAria",{name:f.name})}),r?d.jsxs(d.Fragment,{children:[d.jsx(xs,{disabled:o,icon:d.jsx(lm,{size:16,"aria-hidden":!0}),label:y("common.stop"),onSelect:()=>E("stop"),testId:`worker-card-stop-${f.id}`,danger:!0}),d.jsx(xs,{disabled:o,icon:d.jsx(im,{size:16,"aria-hidden":!0}),label:y("common.restart"),onSelect:()=>E("restart"),testId:`worker-card-restart-${f.id}`})]}):d.jsx(xs,{disabled:o,icon:d.jsx(ko,{size:16,"aria-hidden":!0}),label:y("common.start"),onSelect:()=>E("start"),testId:`worker-card-start-${f.id}`}),d.jsx(xs,{disabled:o||c.kind==="working",icon:d.jsx(L0,{size:16,"aria-hidden":!0}),label:y("worker.rename"),onSelect:()=>E("rename"),testId:`worker-card-rename-${f.id}`}),d.jsx(xs,{icon:d.jsx(tc,{size:16,"aria-hidden":!0}),label:y("common.delete"),onSelect:()=>E("delete"),testId:`worker-card-delete-${f.id}`,danger:!0})]})})]})})]}):null]})},xs=({danger:t=!1,disabled:r=!1,icon:o,label:i,onSelect:l,testId:c})=>d.jsxs("button",{type:"button",disabled:r,"data-testid":c,onClick:l,className:"flex min-h-12 w-full items-center gap-3 px-4 text-left text-sm disabled:opacity-50",style:{color:t?"var(--status-red)":"var(--text-primary)"},children:[o,i]}),yj=["working","idle","stopped"],Oy=t=>t==="working"?"common.running":t==="idle"?"common.idle":"common.stopped",bj=t=>{const r={idle:[],working:[],stopped:[]};for(const o of t)r[zw(o).kind].push(o);return{sections:yj.filter(o=>r[o].length>0).map(o=>({kind:o,workers:r[o]})),summary:{idle:r.idle.length,stopped:r.stopped.length,working:r.working.length}}},wj=({onAddWorkerClick:t,onDeleteWorker:r,onOpenShellTerminal:o,onOpenWorker:i,onRenameWorker:l,onStopWorker:c,onRestartWorker:f,onStartWorker:h,shellTerminalAvailable:g=!0,startingWorkerId:m,terminalRuns:y,workers:v,workspaceId:k})=>{const{t:S}=Ee(),{sections:C,summary:x}=b.useMemo(()=>bj(v),[v]),E=b.useMemo(()=>new Map(y.map(L=>[L.agent_id,L.run_id])),[y]),[T,_]=b.useState(null),[j,A]=b.useState(null),R=(L,B)=>{if(L==="start"){h(B);return}if(L==="stop"){const P=E.get(B.id);P&&c?.(P);return}if(L==="restart"){const P=E.get(B.id);P&&f?.(B.id,P);return}if(L==="rename"){A(B.id);return}L==="delete"&&_(B)},D=()=>{T&&(r(T),_(null))};return d.jsxs("div",{className:"flex min-h-0 min-w-0 flex-1 flex-col",style:{background:"var(--bg-2)"},"data-testid":"workers-pane",children:[d.jsxs("div",{className:"flex shrink-0 flex-col gap-1 px-4 pt-3 pb-2.5",style:{boxShadow:"inset 0 -1px 0 var(--border)"},children:[d.jsxs("div",{className:"flex items-center gap-2.5",children:[d.jsx("span",{className:"text-lg font-semibold text-pri",children:S("worker.teamMembers")}),d.jsx("span",{className:"mono inline-flex h-[18px] min-w-[18px] items-center justify-center rounded-full bg-3 px-1 text-[11px] font-medium tabular-nums leading-none text-sec",children:v.length}),d.jsx("div",{className:"flex-1"}),g?d.jsxs("button",{type:"button",onClick:o,className:"icon-btn icon-btn--tertiary","aria-label":S("shellTerminal.openAria"),"data-testid":"open-workspace-shell",children:[d.jsx(cm,{size:14,"aria-hidden":!0})," ",S("shellTerminal.open")]}):null,d.jsxs("button",{type:"button",onClick:t,className:"icon-btn icon-btn--primary","data-testid":"add-worker-trigger",children:[d.jsx(qd,{size:14,"aria-hidden":!0})," ",S("addWorker.create")]})]}),v.length>0?d.jsxs("div",{className:"flex items-center gap-3 text-xs text-ter",children:[d.jsxs("span",{className:"inline-flex items-center gap-1.5",children:[d.jsx("span",{className:"status-dot status-dot--working","aria-hidden":!0}),d.jsx("span",{className:"text-sec",children:x.working})," ",S("common.running")]}),d.jsxs("span",{className:"inline-flex items-center gap-1.5",children:[d.jsx("span",{className:"status-dot status-dot--idle","aria-hidden":!0}),d.jsx("span",{className:"text-sec",children:x.idle})," ",S("common.idle")]}),d.jsxs("span",{className:"inline-flex items-center gap-1.5",children:[d.jsx("span",{className:"status-dot status-dot--stopped","aria-hidden":!0}),d.jsx("span",{className:"text-sec",children:x.stopped})," ",S("common.stopped")]})]}):null]}),d.jsx("div",{className:"workers-pane-body scroll-y min-h-0 min-w-0 flex-1 px-2 py-2",children:v.length===0?d.jsxs(d.Fragment,{children:[d.jsx(Ks,{icon:d.jsx(qd,{size:28}),title:S("worker.emptyTitle"),description:S("worker.emptyDesc"),action:d.jsxs("button",{type:"button",onClick:t,className:"icon-btn icon-btn--primary","data-testid":"add-worker-empty",children:[d.jsx(qd,{size:14,"aria-hidden":!0})," ",S("worker.emptyAdd")]})}),k?d.jsx(lj,{workspaceId:k}):null]}):d.jsx("div",{"data-testid":"worker-grid",children:C.map(L=>d.jsxs("section",{className:"mb-3 last:mb-0",children:[d.jsxs("div",{className:"flex items-center gap-1.5 px-2 py-1 text-xs font-medium uppercase tracking-wide text-ter",children:[S(Oy(L.kind)),d.jsx("span",{className:"mono inline-flex h-[18px] min-w-[18px] items-center justify-center rounded-full px-1 text-[11px] font-medium tabular-nums leading-none",children:L.workers.length})]}),d.jsx("ul",{"aria-label":`${S(Oy(L.kind))} team members`,className:"worker-card-grid",children:L.workers.map(B=>d.jsx("li",{children:d.jsx(gj,{hasRun:E.has(B.id),isPending:m===B.id,isEditing:j===B.id,onRenameWorker:async(P,te)=>v.some(F=>F.id!==P.id&&F.name.toLowerCase()===te.toLowerCase())?{error:S("addWorker.agentExists")}:l(P,te),onStartEditing:()=>A(B.id),onCancelEditing:()=>A(null),onAction:R,onClick:i,worker:B})},B.id))})]},L.kind))})}),d.jsx(Xs,{open:T!==null,onOpenChange:L=>{L||_(null)},title:T?S("worker.deleteConfirm",{name:T.name}):"",description:T?S("worker.deleteDescription",{name:T.name}):"",confirmLabel:S("worker.deleteMember"),confirmKind:"danger",onConfirm:D})]})},xj=b.lazy(()=>Ct(()=>import("./AddWorkerDialog-DBLhwb91.js"),__vite__mapDeps([2,3,4])).then(t=>({default:t.AddWorkerDialog}))),kj=b.lazy(()=>Ct(()=>import("./WorkerModal-CSorwcdP.js"),[]).then(t=>({default:t.WorkerModal}))),Sj=({onCreateWorker:t,onDeleteWorker:r,onDeleteWorkspace:o,onStartWorker:i,onStopWorker:l,onRestartWorker:c,onOrchestratorResult:f,onRequestAddWorkspace:h,onShellRunClosed:g,onShellRunStarted:m,onTryDemo:y,welcomeDisabledReason:v,orchestratorAutostartError:k,orchestratorAutostartRunId:S,terminalRuns:C,workers:x,workspace:E})=>{const{t:T}=Ee(),_=Tt(),[j,A]=b.useState(null),[R,D]=b.useState(!1),[L,B]=b.useState("orchestrator"),P=sb();b.useEffect(()=>()=>ob(!1),[]);const[te,ee]=b.useState(null),[F,Q]=b.useState(null),[Z,$]=b.useState(null),[M,K]=b.useState(!1),U=Qt(),I=X_({createWorker:t,open:R,workers:x}),X=q_({workspaceId:E?.id??"",terminalRuns:C,autostartError:k,suppressAutostartRunId:S,onClearAutostartError:()=>{E&&f(E.id,{ok:!0,error:null,run_id:null})},onAfterStart:ce=>{E&&f(E.id,ce)}}),O=R_(),W=x.find(ce=>ce.id===j)??null;b.useEffect(()=>{j&&!W&&A(null)},[j,W]);const oe=w_({workspaceId:E?.id??"",workers:x,terminalRuns:C}),ue=oe.tabs.filter(ce=>ce.kind==="shell"),fe=E?C.filter(ce=>rc(ce,E.id)):[],{closeShellTab:pe,openShell:le,shellError:ie,shellStarting:se,startNewShell:de}=N_({onCloseFailed:ce=>U.show({kind:"error",message:T("shellTerminal.closeFailed",{message:ce})}),onShellRunClosed:g,onShellRunStarted:m,panelTabs:oe,shellRuns:fe,workspaceId:E?.id??null});if(b.useEffect(()=>{I.createWorkerError&&U.show({kind:"error",message:I.createWorkerError})},[I.createWorkerError,U]),b.useEffect(()=>{te&&U.show({kind:"error",message:te})},[te,U]),b.useEffect(()=>{F&&U.show({kind:"error",message:F})},[F,U]),b.useEffect(()=>{ie&&U.show({kind:"error",message:ie})},[ie,U]),b.useEffect(()=>{A(null),ee(null),Q(null),$(null),K(!1),B("orchestrator")},[E?.id]),!E){const ce={onAddWorkspace:h};return y&&(ce.onTryDemo=y),v&&(ce.disabledReason=v),d.jsx(Q_,{...ce})}const me=W?__(C,W.id):void 0,Te=ce=>{ee(null),r(ce.id).then(()=>A(null)).catch(ye=>{ee(ye instanceof Error?ye.message:String(ye))})},Ce=ce=>{Q(null),$(ce.id),i(ce.id).then(({error:ye})=>{ye&&Q(ye)}).catch(ye=>{Q(ye instanceof Error?ye.message:String(ye))}).finally(()=>$(null))},ke=ce=>{l(ce).then(({error:ye})=>{ye&&U.show({kind:"error",message:ye})})},Ze=(ce,ye)=>{Q(null),$(ce),c(ce,ye).then(({error:Me})=>{Me&&Q(Me)}).catch(Me=>{Q(Me instanceof Error?Me.message:String(Me))}).finally(()=>$(null))},St=async(ce,ye)=>{try{return await rC(E.id,ce.id,ye),U.show({kind:"success",message:T("worker.renameSuccess",{name:ye})}),{error:null}}catch(Me){const ga=Me instanceof Error?Me.message:String(Me);return U.show({kind:"error",message:T("worker.renameFailed",{message:ga})}),{error:ga}}},Jt=`${(O.orchPct*100).toFixed(2)}%`,or=()=>{K(!1),le()},fn=()=>{K(!1),de()},De=d.jsx(U_,{state:X.state,onStop:X.stop,onRemoveWorkspace:()=>{o(E).catch(ce=>{const ye=ce instanceof Error?ce.message:String(ce);U.show({kind:"error",message:`Delete failed: ${ye}`})})},onStart:X.start,onRestart:X.restart}),Qe=d.jsxs("div",{className:"relative flex min-h-0 min-w-0 flex-1 flex-col",children:[d.jsx(wj,{onAddWorkerClick:()=>D(!0),onDeleteWorker:Te,onOpenShellTerminal:or,onOpenWorker:ce=>A(ce.id),onRenameWorker:St,onStartWorker:Ce,onStopWorker:ke,onRestartWorker:Ze,startingWorkerId:Z,terminalRuns:C,workers:x,workspaceId:E.id}),M?null:d.jsx(g_,{tabs:ue,activeId:oe.activeId,scopeKey:E.id,onSelect:oe.setActive,onClose:ce=>{ce.startsWith("shell:")&&pe(ce.slice(6)),oe.closeTab(ce)},onClosePanel:()=>K(!0),onNewShell:fn,newShellPending:se,onStartWorker:ce=>{const ye=x.find(Me=>Me.id===ce);ye&&Ce(ye)},startingWorkerId:Z})]});return d.jsxs("div",{className:"flex min-h-0 min-w-0 flex-1 flex-col",style:{background:"var(--bg-2)"},children:[d.jsx($C,{terminalRuns:C,workers:x,workspace:E}),d.jsx(LC,{workspaceId:E.id,onOpenWorker:A}),_?d.jsxs("div",{className:"relative flex min-h-0 min-w-0 flex-1 flex-col overflow-hidden","data-mobile":"true","data-testid":"workspace-detail-panes",children:[d.jsxs("div",{role:"tablist","aria-label":T("mobile.nav.team"),className:"flex shrink-0 items-center gap-1 border-b p-2",style:{borderColor:"var(--border)"},children:[["orchestrator","workers"].map(ce=>{const ye=L===ce,Me=`mobile-team-tab-${ce}`,ga=`mobile-team-panel-${ce}`;return d.jsxs("button",{id:Me,type:"button",role:"tab","aria-selected":ye,"aria-controls":ga,tabIndex:ye?0:-1,"data-active":ye||void 0,"data-testid":Me,onClick:()=>B(ce),className:"flex min-h-11 flex-1 items-center justify-center gap-1.5 rounded-md text-sm font-medium",style:ye?{background:"var(--accent)",color:"var(--bg-0)"}:{background:"var(--bg-3)",color:"var(--text-secondary)"},children:[d.jsx("span",{children:T(ce==="orchestrator"?"mobile.team.orchestrator":"mobile.team.workers")}),ce==="workers"&&x.length>0?d.jsx("span",{className:"inline-flex items-center justify-center rounded-full min-w-[18px] h-[18px] px-1 text-[11px] font-medium tabular-nums leading-none",style:ye?{background:"var(--bg-0)",color:"var(--accent)"}:{background:"var(--bg-1)",color:"var(--text-secondary)"},children:x.length}):null]},ce)}),d.jsx("button",{type:"button",onClick:HC,"aria-pressed":P,"aria-label":T(P?"mobile.focus.exit":"mobile.focus.enter"),"data-testid":"mobile-focus-toggle",className:"flex h-11 w-11 shrink-0 items-center justify-center rounded-md",style:{background:"var(--bg-3)",color:"var(--text-secondary)"},children:P?d.jsx(US,{size:16,"aria-hidden":!0}):d.jsx(BS,{size:16,"aria-hidden":!0})})]}),d.jsxs("div",{className:"relative min-h-0 min-w-0 flex-1 overflow-hidden","data-testid":"mobile-team-panel",children:[d.jsx("div",{id:"mobile-team-panel-orchestrator",role:"tabpanel","aria-labelledby":"mobile-team-tab-orchestrator","aria-hidden":L!=="orchestrator",className:"mobile-team-pane flex min-h-0 min-w-0 flex-col","data-active":L==="orchestrator"?"true":"false",children:De}),d.jsx("div",{id:"mobile-team-panel-workers",role:"tabpanel","aria-labelledby":"mobile-team-tab-workers","aria-hidden":L!=="workers",className:"mobile-team-pane flex min-h-0 min-w-0 flex-col","data-active":L==="workers"?"true":"false",children:Qe})]})]}):d.jsxs("div",{ref:O.containerRef,className:"relative flex min-h-0 min-w-0 flex-1 overflow-hidden","data-testid":"workspace-detail-panes",children:[d.jsx("div",{className:"flex min-w-[480px] shrink-0 flex-col overflow-hidden",style:{width:Jt},"data-testid":"orchestrator-pane-shell",children:De}),d.jsx("div",{role:"separator","aria-orientation":"vertical","aria-label":T("workerPane.resize"),"aria-valuenow":Math.round(O.orchPct*100),"aria-valuemin":30,"aria-valuemax":78,tabIndex:0,className:"pane-splitter",style:{left:`calc(${Jt} - 4px)`},"data-dragging":O.dragging||void 0,"data-testid":"pane-splitter",onPointerDown:O.beginDrag,onKeyDown:O.onKeyDown}),Qe]}),W?d.jsx(b.Suspense,{fallback:null,children:d.jsx(kj,{onClose:()=>A(null),onStart:Ce,runId:me?.run_id??null,startError:F,starting:Z===W.id,worker:W})}):null,R?d.jsx(b.Suspense,{fallback:null,children:d.jsx(xj,{commandPresets:I.commandPresets,commandPresetId:I.commandPresetId,creating:I.creating,customTemplates:I.customTemplates,onApplyMarketplaceImport:I.applyMarketplaceImport,onClose:()=>D(!1),onDeleteTemplate:I.deleteTemplate,onNameChange:I.setWorkerName,onPresetChange:I.setCommandPresetId,onRandomName:I.randomizeWorkerName,onRoleDescriptionChange:I.setRoleDescription,onRoleDescriptionReset:I.resetRoleDescription,onRoleChange:I.setWorkerRole,onSaveAsTemplate:I.saveAsTemplate,onSubmit:ce=>I.submit(ce,()=>D(!1)),onStartupCommandChange:I.setStartupCommand,onTemplateChange:I.selectTemplate,roleDescription:I.roleDescription,roleDescriptionDefault:I.roleDescriptionDefault,selectedTemplateId:I.selectedTemplateId,startupCommand:I.startupCommand,templateBusy:I.templateBusy,workerName:I.workerName,workerRole:I.workerRole})}):null]})},Ej=({activeId:t,activeWorkspace:r,bootstrapError:o,demoMode:i,onDeleteWorkspace:l,onExitDemo:c,onRequestAddWorkspace:f,onShellRunClosed:h,onShellRunStarted:g,onTryDemo:m,orchestratorAutostartErrors:y,orchestratorAutostartRunIds:v,recordOrchestratorResult:k,terminalRuns:S,workerActions:C,workers:x,workspacesLoading:E})=>i?d.jsx(TE,{onExit:c}):E&&!r?d.jsx("div",{className:"flex flex-1 items-center justify-center",children:d.jsx(xo,{size:24,className:"animate-spin text-ter"})}):d.jsx(Sj,{onCreateWorker:C.createWorker,onDeleteWorker:C.deleteWorker,onDeleteWorkspace:l,onStartWorker:C.startWorker,onStopWorker:C.stopWorkerRun,onRestartWorker:C.restartWorkerRun,onOrchestratorResult:k,onRequestAddWorkspace:f,onShellRunClosed:h,onShellRunStarted:g,onTryDemo:m,welcomeDisabledReason:o??void 0,orchestratorAutostartError:t?y[t]??null:null,orchestratorAutostartRunId:t?v[t]??null:null,terminalRuns:S,workers:x,workspace:r}),kl={id:"demo-workspace",name:"demo-todo-app",path:"/Users/you/demo-todo-app"},Cj=[{id:"demo-coder",name:"ada-lovelace",role:"coder",status:"working",pendingTaskCount:1,lastPtyLine:"Editing src/routes/todos.ts (line 42)",commandPresetId:"claude"},{id:"demo-reviewer",name:"socrates",role:"reviewer",status:"idle",pendingTaskCount:0,commandPresetId:"gemini"}],Tj=`# Todo app
69
+
70
+ - [x] Set up Express server
71
+ - [x] Add /todos GET endpoint
72
+ - [ ] Add /todos POST endpoint
73
+ - [ ] Write Vitest for both endpoints
74
+ - [ ] Wire up SQLite for persistence
75
+ `,Aj=()=>{const[t,r]=b.useState(!1);return{demoMode:t,enableDemo:()=>r(!0),exitDemo:()=>r(!1)}},_j=t=>{const{demoMode:r,workspaces:o,activeWorkspaceId:i,workersByWorkspaceId:l}=t,c=r?[kl]:o,f=r?{[kl.id]:Cj}:l,h=r?kl.id:i,g=r?kl:o?.find(y=>y.id===i);return{effectiveActiveWorkspaceId:h,effectiveWorkspaces:c,effectiveWorkersByWorkspaceId:f,effectiveActiveWorkspace:g,pollWorkspaceId:r?null:i}},Nj=[{accent:"var(--status-green)",descriptionKey:"notifications.sound.soft.description",labelKey:"notifications.sound.soft.label",length:"short",value:"soft"},{accent:"var(--status-blue)",descriptionKey:"notifications.sound.ping.description",labelKey:"notifications.sound.ping.label",length:"short",value:"ping"},{accent:"var(--status-gold)",descriptionKey:"notifications.sound.chime.description",labelKey:"notifications.sound.chime.label",length:"short",value:"chime"},{accent:"var(--accent)",descriptionKey:"notifications.sound.cascade.description",labelKey:"notifications.sound.cascade.label",length:"long",value:"cascade"},{accent:"var(--status-orange)",descriptionKey:"notifications.sound.beacon.description",labelKey:"notifications.sound.beacon.label",length:"long",value:"beacon"},{accent:"var(--status-purple)",descriptionKey:"notifications.sound.resolve.description",labelKey:"notifications.sound.resolve.label",length:"long",value:"resolve"},{accent:"var(--text-tertiary)",descriptionKey:"notifications.sound.off.description",labelKey:"notifications.sound.off.label",length:"silent",value:"off"}],jj=[{descriptionKey:"notifications.detail.brief.description",labelKey:"notifications.detail.brief.label",value:"brief"},{descriptionKey:"notifications.detail.detailed.description",labelKey:"notifications.detail.detailed.label",value:"detailed"}],Rj=()=>{const{t}=Ee(),r=Tt(),[o,i]=b.useState(!1),l=b.useRef(null),c=b.useRef(null),{notify:f,previewSound:h,requestDesktopNotifications:g,settings:m,updateSettings:y}=oc(),v=typeof window<"u"&&!("Notification"in window),k=b.useMemo(()=>Nj.map(x=>({...x,description:t(x.descriptionKey),label:t(x.labelKey)})),[t]),S=b.useMemo(()=>jj.map(x=>({...x,description:t(x.descriptionKey),label:t(x.labelKey)})),[t]),C=x=>{if(!x){y({desktop:!1});return}g()};return b.useEffect(()=>{if(!o)return;const x=T=>{T.key==="Escape"&&(i(!1),c.current?.focus())},E=T=>{const _=l.current;_&&!_.contains(T.target)&&i(!1)};return document.addEventListener("keydown",x),document.addEventListener("pointerdown",E),()=>{document.removeEventListener("keydown",x),document.removeEventListener("pointerdown",E)}},[o]),d.jsxs("div",{ref:l,className:"relative",children:[d.jsx(ct,{label:t("notifications.settings.tooltip"),children:d.jsx("button",{ref:c,type:"button","aria-expanded":o,"aria-haspopup":"dialog","aria-label":t("notifications.settings.aria"),className:"flex h-7 w-7 max-md:min-w-11 cursor-pointer items-center justify-center rounded text-sec hover:bg-3 hover:text-pri","data-testid":"topbar-settings",onClick:()=>i(x=>!x),children:d.jsx(Tf,{size:14,"aria-hidden":!0})})}),o?d.jsxs("div",{role:"dialog","aria-modal":r?"true":void 0,"aria-label":t("notifications.settings.aria"),className:r?"fixed inset-0 z-50 flex flex-col overflow-y-auto":"elev-2 absolute top-8 right-0 z-50 w-[380px] rounded border p-3",style:r?{background:"var(--bg-0)"}:{background:"var(--bg-elevated)",borderColor:"var(--border-bright)"},"data-testid":"notification-settings",children:[d.jsxs("div",{className:r?"flex shrink-0 items-center gap-2 border-b px-4 py-3":"mb-3 flex items-start gap-2",style:r?{borderColor:"var(--border)"}:void 0,children:[d.jsx("div",{className:"flex h-8 w-8 shrink-0 items-center justify-center rounded bg-3 text-sec",children:d.jsx(Tf,{size:16,"aria-hidden":!0})}),d.jsxs("div",{className:r?"min-w-0 flex-1":"min-w-0",children:[d.jsx("div",{className:"text-sm font-semibold text-pri",children:t("notifications.settings.heading")}),r?null:d.jsx("div",{className:"text-ter text-xs",children:t("notifications.settings.subtitle")})]}),r?d.jsx("button",{type:"button","aria-label":t("common.close"),className:"flex h-11 w-11 shrink-0 items-center justify-center rounded text-sec hover:bg-3 hover:text-pri",onClick:()=>i(!1),children:d.jsx(fo,{size:20,"aria-hidden":!0})}):null]}),d.jsxs("div",{className:r?"flex-1 overflow-y-auto p-4":"contents",children:[d.jsxs("section",{className:"mb-3",children:[d.jsxs("div",{className:"mb-2 flex items-center gap-1.5 text-ter text-xs uppercase tracking-wider",children:[d.jsx(Ll,{size:12,"aria-hidden":!0}),t("notifications.sound.sectionLabel")]}),d.jsx("div",{role:"radiogroup","aria-label":t("notifications.sound.sectionLabel"),className:r?"grid grid-cols-1 gap-2":"grid grid-cols-2 gap-2",children:k.map(x=>d.jsxs("div",{className:"relative min-h-[78px] rounded border transition-colors",style:{background:m.sound===x.value?`color-mix(in oklab, ${x.accent} 10%, var(--bg-2))`:"var(--bg-2)",borderColor:m.sound===x.value?`color-mix(in oklab, ${x.accent} 54%, var(--border-bright))`:"var(--border)"},children:[d.jsxs("label",{className:"block h-full w-full cursor-pointer rounded px-3 py-2 pr-10 text-left transition-colors hover:bg-3 focus-within:outline-none focus-within:ring-2 focus-within:ring-[var(--ring-focus)]",children:[d.jsx("input",{type:"radio",name:"notification-sound",value:x.value,checked:m.sound===x.value,className:"sr-only",onChange:()=>y({sound:x.value})}),d.jsxs("span",{className:"mb-1 flex items-center gap-2",children:[d.jsx("span",{className:"flex h-5 w-5 items-center justify-center rounded",style:{background:`color-mix(in oklab, ${x.accent} 16%, transparent)`,color:x.accent},children:x.value==="off"?d.jsx(W0,{size:12,"aria-hidden":!0}):d.jsx(Ll,{size:12,"aria-hidden":!0})}),d.jsx("span",{className:"font-medium text-pri text-xs",children:x.label}),x.length==="long"?d.jsx("span",{className:"rounded border border-[var(--border-bright)] px-1.5 py-0.5 text-xs text-ter uppercase",children:t("notifications.sound.longerBadge")}):null,m.sound===x.value?d.jsx(bo,{size:12,className:"ml-auto text-pri","aria-hidden":!0}):null]}),d.jsx("span",{className:"block text-ter text-xs",children:x.description})]}),x.value!=="off"?d.jsx("button",{type:"button","aria-label":t("notifications.sound.previewAria",{label:x.label}),className:"absolute right-2 bottom-2 flex h-6 w-6 pointer-coarse:h-10 pointer-coarse:w-10 items-center justify-center rounded border text-sec transition-colors hover:bg-3 hover:text-pri",style:{borderColor:"var(--border-bright)"},onClick:()=>h(x.value),children:d.jsx(ko,{size:12,"aria-hidden":!0})}):null]},x.value))})]}),d.jsxs("section",{className:"mb-3",children:[d.jsxs("div",{className:"mb-2 flex items-center gap-1.5 text-ter text-xs uppercase tracking-wider",children:[d.jsx(D0,{size:12,"aria-hidden":!0}),t("notifications.detail.sectionLabel")]}),d.jsx("div",{role:"radiogroup","aria-label":t("notifications.detail.sectionLabel"),className:"grid grid-cols-2 rounded border p-1",style:{background:"var(--bg-1)",borderColor:"var(--border)"},children:S.map(x=>d.jsxs("label",{className:"cursor-pointer rounded px-3 py-2 text-left transition-colors hover:bg-3 focus-within:outline-none focus-within:ring-2 focus-within:ring-[var(--ring-focus)]",style:{background:m.detail===x.value?"var(--bg-3)":"transparent",color:m.detail===x.value?"var(--text-primary)":"var(--text-secondary)"},children:[d.jsx("input",{type:"radio",name:"notification-detail",value:x.value,checked:m.detail===x.value,className:"sr-only",onChange:()=>y({detail:x.value})}),d.jsx("span",{className:"block font-medium text-xs",children:x.label}),d.jsx("span",{className:"block text-ter text-xs",children:x.description})]},x.value))})]}),d.jsxs("label",{className:"mb-3 flex items-start gap-2 rounded border p-2 text-sec text-xs",children:[d.jsx("input",{type:"checkbox","aria-label":t("notifications.desktop.aria"),checked:m.desktop,disabled:v,className:"mt-0.5",onChange:x=>C(x.currentTarget.checked)}),d.jsxs("span",{children:[d.jsx("span",{className:"block font-medium text-pri",children:t("notifications.desktop.label")}),d.jsx("span",{className:"text-ter",children:t(v?"notifications.desktop.unsupported":"notifications.desktop.helper")})]})]}),d.jsxs("div",{className:"flex justify-end gap-2 border-t pt-3",style:{borderColor:"var(--border)"},children:[d.jsx("button",{type:"button",className:"icon-btn",onClick:()=>i(!1),children:t("common.close")}),d.jsx("button",{type:"button",className:"icon-btn icon-btn--primary",onClick:()=>f({brief:t("notifications.test.brief"),detail:t("notifications.test.detail"),kind:"success",title:t("notifications.test.title")}),children:t("notifications.test.button")})]})]})]}):null]})},Ww=({checked:t,disabled:r,onChange:o,...i})=>d.jsx("button",{type:"button",role:"switch","aria-checked":t,"aria-label":i["aria-label"],disabled:r,className:"settings-switch","data-checked":t||void 0,"data-testid":i["data-testid"],onClick:l=>{l.stopPropagation(),o(!t)},children:d.jsx("span",{className:"settings-switch__thumb"})}),Oj=t=>Math.max(0,Math.ceil((t-Date.now())/1e3)),Dj=()=>{const{t}=Ee(),[r,o]=b.useState(null),[i,l]=b.useState(!1),[c,f]=b.useState(!1),[h,g]=b.useState(()=>Date.now());b.useEffect(()=>{if(!r)return;const k=window.setInterval(()=>g(Date.now()),1e3);return()=>window.clearInterval(k)},[r]);const m=async()=>{f(!1),l(!0);try{const k=await gC();o(k),g(Date.now())}catch{f(!0)}finally{l(!1)}};if(!r)return d.jsxs("div",{className:"p-1.5",children:[d.jsxs("button",{type:"button","data-testid":"settings-remote-add-device",onClick:()=>{m()},disabled:i,className:"icon-btn icon-btn--primary flex items-center gap-1.5",children:[d.jsx(z0,{size:14,"aria-hidden":!0}),t("remote.addDevice")]}),c?d.jsx("div",{className:"mt-1 text-xs",style:{color:"var(--text-error)"},role:"alert",children:t("remote.qr.startFailed")}):null]});const y=Oj(r.expiresAt),v=y<=0||h>=r.expiresAt;return d.jsxs("div",{className:"p-1.5","data-testid":"remote-qr-panel",children:[d.jsx("div",{className:"text-sm font-medium text-pri",children:t("remote.qr.title")}),d.jsx("p",{className:"mt-0.5 mb-2 text-xs text-ter",children:t("remote.qr.instructions")}),d.jsxs("div",{className:"flex flex-col items-center gap-2",children:[v?d.jsx("div",{className:"text-xs",style:{color:"var(--text-error)"},"data-testid":"remote-qr-expired",children:t("remote.qr.expired")}):d.jsxs(d.Fragment,{children:[d.jsx("div",{"data-testid":"remote-pair-code",className:"mono rounded-lg border px-4 py-3 text-center text-2xl font-semibold tracking-[0.18em] text-pri",style:{borderColor:"var(--border)"},children:r.code}),d.jsx("div",{className:"text-xs text-ter","data-testid":"remote-qr-countdown",children:t("remote.qr.expiresIn",{seconds:y})})]}),d.jsxs("div",{className:"flex gap-2",children:[v?d.jsx("button",{type:"button","data-testid":"remote-qr-regenerate",onClick:()=>{m()},disabled:i,className:"icon-btn icon-btn--primary",children:t("remote.qr.regenerate")}):null,d.jsx("button",{type:"button","data-testid":"remote-qr-cancel",onClick:()=>o(null),className:"icon-btn",children:t("remote.qr.cancel")})]})]})]})},Mj={ok:"remote.audit.result.ok",rejected:"remote.audit.result.rejected",error:"remote.audit.result.error"},Lj=t=>{const r=Math.max(0,Date.now()-t),o=Math.floor(r/1e3);if(o<60)return"<1m";const i=Math.floor(o/60);if(i<60)return`${i}m`;const l=Math.floor(i/60);return l<24?`${l}h`:`${Math.floor(l/24)}d`},zj=()=>{const{t}=Ee(),[r,o]=b.useState(!1),[i,l]=b.useState(null),[c,f]=b.useState(!1),h=b.useCallback(async()=>{f(!1);try{l(await wC(100))}catch{f(!0)}},[]);return b.useEffect(()=>{r&&h()},[r,h]),d.jsxs("div",{className:"mt-2","data-testid":"remote-audit-view",children:[d.jsxs("button",{type:"button","data-testid":"remote-audit-toggle",onClick:()=>o(g=>!g),className:"flex w-full items-center gap-1.5 rounded px-2 py-1.5 text-xs font-medium text-sec transition-colors hover:bg-3 hover:text-pri","aria-expanded":r,children:[d.jsx(R0,{size:12,"aria-hidden":!0,className:"shrink-0"}),d.jsx("span",{className:"flex-1 text-left",children:t(r?"remote.audit.hide":"remote.audit.show")}),r?d.jsx(wo,{size:12,"aria-hidden":!0,className:"shrink-0 text-ter"}):d.jsx(Jl,{size:12,"aria-hidden":!0,className:"shrink-0 text-ter"})]}),r?d.jsx("div",{className:"mt-1.5",children:c?d.jsx("div",{className:"rounded px-2 py-2 text-xs",style:{color:"var(--text-error)",background:"color-mix(in oklab, var(--status-red) 8%, transparent)"},role:"alert",children:t("remote.audit.loadFailed")}):!i||i.length===0?d.jsx("div",{className:"px-2 py-2 text-xs text-ter",children:t("remote.audit.empty")}):d.jsx("ul",{className:"scroll-y flex max-h-[160px] flex-col gap-px rounded border",style:{borderColor:"var(--border)",background:"var(--bg-0)"},children:i.map(g=>{const m=g.result!=="ok";return d.jsxs("li",{className:"flex items-center gap-2 px-2.5 py-1.5 text-xs","data-testid":`remote-audit-row-${g.id}`,style:m?{background:"color-mix(in oklab, var(--status-red) 6%, transparent)"}:void 0,children:[d.jsx("span",{className:"inline-block h-1.5 w-1.5 shrink-0 rounded-full",style:{background:m?"var(--status-red)":"var(--status-green)"},"aria-hidden":!0}),d.jsxs("span",{className:"min-w-0 flex-1 truncate",children:[d.jsx("span",{className:"font-medium text-pri",children:g.action}),g.endpoint?d.jsx("span",{className:"ml-1 text-ter",children:g.endpoint}):null,g.preview?d.jsxs("span",{className:"ml-1 text-ter",children:["· ",g.preview]}):null,typeof g.byteCount=="number"?d.jsxs("span",{className:"ml-1 text-ter",children:["· ",t("remote.audit.bytes",{count:g.byteCount})]}):null]}),m?d.jsxs("span",{className:"shrink-0 rounded px-1.5 py-0.5 text-[10px] font-medium",style:{color:"color-mix(in oklab, var(--status-red) 55%, white)",background:"color-mix(in oklab, var(--status-red) 14%, transparent)"},children:[t(Mj[g.result]),g.rejectReason?` · ${g.rejectReason}`:""]}):null,d.jsx("span",{className:"shrink-0 tabular-nums text-ter",children:Lj(g.ts)})]},g.id)})})}):null]})},Dy=t=>{const r=Math.max(0,Date.now()-t),o=Math.floor(r/6e4);if(o<1)return"<1m";if(o<60)return`${o}m`;const i=Math.floor(o/60);return i<24?`${i}h`:`${Math.floor(i/24)}d`},Hj=({reloadKey:t=0})=>{const{t:r}=Ee(),o=Qt(),[i,l]=b.useState(null),[c,f]=b.useState(!1),[h,g]=b.useState(null),m=b.useCallback(async()=>{f(!1);try{const k=await eb();l(k)}catch{f(!0)}},[]);b.useEffect(()=>{m()},[m,t]);const y=async k=>{try{await bC(k.deviceId),o.show({kind:"success",message:r("remote.devices.revoked",{name:k.name})}),await m()}catch{o.show({kind:"error",message:r("remote.devices.revokeFailed")})}},v=(i??[]).filter(k=>!k.revoked);return d.jsxs("div",{className:"p-1.5","data-testid":"remote-device-list",children:[d.jsx("div",{className:"mb-1 text-xs font-medium uppercase tracking-wider text-ter",children:r("remote.devices.heading")}),c?d.jsx("div",{className:"text-xs",style:{color:"var(--text-error)"},role:"alert",children:r("remote.devices.loadFailed")}):v.length===0?d.jsx("div",{className:"text-xs text-ter",children:r("remote.devices.empty")}):d.jsx("ul",{className:"flex flex-col gap-1",children:v.map(k=>d.jsxs("li",{className:"flex items-center justify-between gap-2 rounded p-1.5 hover:bg-3","data-testid":`remote-device-${k.deviceId}`,children:[d.jsxs("span",{className:"min-w-0",children:[d.jsx("span",{className:"block truncate text-sm text-pri",children:k.name}),d.jsx("span",{className:"block text-xs text-ter",children:k.lastActive===null?r("remote.devices.neverActive"):Dy(k.lastActive)==="<1m"?r("remote.devices.activeNow"):r("remote.devices.lastActive",{ago:Dy(k.lastActive)})})]}),d.jsx("button",{type:"button","data-testid":`remote-device-revoke-${k.deviceId}`,"aria-label":r("remote.devices.revokeAria",{name:k.name}),onClick:()=>g(k),className:"icon-btn icon-btn--danger shrink-0",children:r("remote.devices.revoke")})]},k.deviceId))}),d.jsx(Xs,{open:h!==null,onOpenChange:k=>{k||g(null)},title:r("remote.devices.revokeTitle"),description:h?r("remote.devices.revokeConfirm",{name:h.name}):"",confirmLabel:r("remote.devices.revoke"),confirmKind:"danger",onConfirm:()=>{h&&y(h)}})]})},Bj=2e3,Hf={enabled:!1,loggedIn:!1,gatewayUrl:null,connected:!1,connection:"disabled"},Uw=b.createContext({status:Hf,loading:!0,setEnabled:async()=>{},pending:null,refresh:async()=>{}}),Wj=({children:t})=>{const r=Tt(),[o,i]=b.useState(Hf),[l,c]=b.useState(!0),[f,h]=b.useState(null);b.useEffect(()=>{let v=!1;return Pd().then(k=>{v||i(k)}).catch(()=>{}).finally(()=>{v||c(!1)}),()=>{v=!0}},[]);const g=b.useCallback(async v=>{const k=await hC(v);i(k),k.enabled||h(null)},[]),m=b.useCallback(async()=>{const v=await Pd().catch(()=>Hf);i(v),v.enabled&&v.loggedIn&&!r?h(await Gv().catch(()=>null)):h(null)},[r]),y=o.enabled&&o.loggedIn&&!r;return b.useEffect(()=>{if(!y){h(null);return}let v=!1;const k=()=>{Pd().then(C=>{v||i(C)}).catch(()=>{}),Gv().then(C=>{v||h(C)}).catch(()=>{})};k();const S=window.setInterval(k,Bj);return()=>{v=!0,window.clearInterval(S)}},[y]),d.jsx(Uw.Provider,{value:{status:o,loading:l,setEnabled:g,pending:f,refresh:m},children:t})},Am=()=>b.useContext(Uw),Uj={online:"var(--status-green)",connecting:"var(--status-amber, #d29922)",reconnecting:"var(--status-amber, #d29922)",revoked:"var(--status-red, #f85149)",loggedOut:"var(--text-ter)",disabled:"var(--text-ter)"},qj={connecting:"remote.status.connecting",reconnecting:"remote.status.reconnecting",revoked:"remote.status.revoked"},Ij=()=>{const{t}=Ee(),r=Qt(),o=Tt(),{status:i,loading:l,setEnabled:c,pending:f}=Am(),h=Uj[i.connection],g=qj[i.connection],[m,y]=b.useState(!1),[v,k]=b.useState(!1),[S,C]=b.useState(!1),[x,E]=b.useState(!1),[T,_]=b.useState(!1),j=b.useRef(null),[A,R]=b.useState(0),D=b.useRef(!1);b.useEffect(()=>{f?D.current=!0:D.current&&(D.current=!1,R(te=>te+1))},[f]),b.useEffect(()=>()=>{j.current&&clearTimeout(j.current)},[]);const L=async te=>{k(!1),y(!0);try{await c(te)}catch{k(!0)}finally{y(!1)}},B=te=>{if(!te&&o){C(!0);return}L(te)},P=async()=>{if(!x){E(!0);try{const te=CC().then(ee=>JSON.stringify(ee,null,2));await nb(te),_(!0),j.current&&clearTimeout(j.current),j.current=setTimeout(()=>{_(!1),j.current=null},1200),r.show({kind:"success",message:t("remote.diagnostics.copied")})}catch{r.show({kind:"error",message:t("remote.diagnostics.copyFailed")})}finally{E(!1)}}};return d.jsxs("div",{className:"settings-section","data-testid":"remote-access-section",children:[d.jsxs("div",{className:"settings-section__heading",children:[d.jsx(z0,{size:12,"aria-hidden":!0}),d.jsx("span",{children:t("remote.section")})]}),d.jsxs("div",{className:"settings-toggle-row",onClick:()=>{!l&&!m&&B(!i.enabled)},children:[d.jsxs("span",{className:"min-w-0 flex-1 text-left",children:[d.jsx("span",{className:"block text-sm font-medium text-pri",children:t("remote.enable.label")}),d.jsx("span",{className:"mt-0.5 block text-xs text-ter leading-relaxed",children:t("remote.enable.description")})]}),d.jsx("div",{className:"mt-0.5 shrink-0",children:d.jsx(Ww,{checked:i.enabled,disabled:l||m,onChange:B,"data-testid":"settings-toggle-remote","aria-label":t("remote.enable.label")})})]}),v?d.jsx("div",{className:"mt-1 ml-2 text-xs",style:{color:"var(--text-error)"},role:"alert",children:t("settings.saveError")}):null,d.jsxs("button",{type:"button","data-testid":"remote-copy-diagnostics",onClick:P,disabled:x,className:"icon-btn mt-2 w-full justify-center pointer-coarse:min-h-11",children:[T?d.jsx(bo,{size:12,"aria-hidden":!0}):d.jsx(ec,{size:12,"aria-hidden":!0}),d.jsx("span",{children:t(x?"remote.diagnostics.copying":T?"remote.diagnostics.copied":"remote.diagnostics.copy")})]}),i.enabled?d.jsxs("div",{className:"mt-2 border-t pt-2",style:{borderColor:"var(--border)"},children:[d.jsxs("div",{className:"flex items-center gap-2 rounded px-2 py-1.5 text-xs","data-testid":"remote-login-status",children:[d.jsx("span",{"aria-hidden":!0,"data-connection":i.connection,className:"inline-block h-2 w-2 rounded-full",style:{background:h}}),d.jsx("span",{className:"min-w-0 text-sec",children:g?t(g):i.loggedIn?t("remote.status.linked",{gateway:i.gatewayUrl??""}):t("remote.status.notLinked")})]}),i.loggedIn&&!o?d.jsx(Dj,{}):null,d.jsx(Hj,{reloadKey:A}),d.jsx(zj,{})]}):null,d.jsx(Xs,{open:S,onOpenChange:te=>{te||C(!1)},title:t("remote.disable.confirmTitle"),description:t("remote.disable.confirmBody"),confirmLabel:t("common.stop"),confirmKind:"danger",onConfirm:()=>{L(!1)}})]})},qw=b.createContext({enabled:!0,loading:!0,setEnabled:async()=>{}}),Pj=({children:t})=>{const[r,o]=b.useState(!0),[i,l]=b.useState(!0);b.useEffect(()=>{let f=!1;return PE().then(h=>{f||o(h.enabled)}).catch(()=>{}).finally(()=>{f||l(!1)}),()=>{f=!0}},[]);const c=b.useCallback(async f=>{const h=await KE(f);o(h.enabled)},[]);return d.jsx(qw.Provider,{value:{enabled:r,loading:i,setEnabled:c},children:t})},Kj=()=>b.useContext(qw),Iw=b.createContext({enabled:!1,loading:!0,setEnabled:async()=>{}}),Fj=({children:t})=>{const[r,o]=b.useState(!1),[i,l]=b.useState(!0);b.useEffect(()=>{let f=!1;return qE().then(h=>{f||o(h.enabled)}).catch(()=>{}).finally(()=>{f||l(!1)}),()=>{f=!0}},[]);const c=b.useCallback(async f=>{const h=await IE(f);o(h.enabled)},[]);return d.jsx(Iw.Provider,{value:{enabled:r,loading:i,setEnabled:c},children:t})},Pw=()=>b.useContext(Iw),Yj=()=>{const{language:t,setLanguage:r,t:o}=Ee();return d.jsxs("div",{className:"settings-section",children:[d.jsxs("div",{className:"settings-section__heading",children:[d.jsx(RS,{size:12,"aria-hidden":!0}),d.jsx("span",{children:o("settings.language")})]}),d.jsxs("div",{className:"flex gap-1 p-1 rounded border",style:{background:"var(--bg-1)",borderColor:"var(--border)"},children:[d.jsx("button",{type:"button",className:"flex-1 py-1 px-2 rounded text-xs font-medium transition-colors cursor-pointer",style:{background:t==="zh"?"var(--bg-3)":"transparent",color:t==="zh"?"var(--text-primary)":"var(--text-secondary)",border:"none"},onClick:()=>r("zh"),"data-testid":"language-zh-btn",children:"中文"}),d.jsx("button",{type:"button",className:"flex-1 py-1 px-2 rounded text-xs font-medium transition-colors cursor-pointer",style:{background:t==="en"?"var(--bg-3)":"transparent",color:t==="en"?"var(--text-primary)":"var(--text-secondary)",border:"none"},onClick:()=>r("en"),"data-testid":"language-en-btn",children:"English"})]})]})},My=({feature:t,label:r,description:o,testId:i})=>{const{t:l}=Ee(),[c,f]=b.useState(!1),[h,g]=b.useState(!1),m=async y=>{g(!1),f(!0);try{await t.setEnabled(y)}catch{g(!0)}finally{f(!1)}};return d.jsxs("div",{className:"settings-toggle-row",onClick:()=>{!t.loading&&!c&&m(!t.enabled)},children:[d.jsxs("span",{className:"min-w-0 flex-1 text-left",children:[d.jsx("span",{className:"block text-sm font-medium text-pri",children:r}),d.jsx("span",{className:"mt-0.5 block text-xs text-ter leading-relaxed",children:o}),h?d.jsx("span",{className:"mt-1 block text-xs",style:{color:"var(--text-error)"},role:"alert",children:l("settings.saveError")}):null]}),d.jsx("div",{className:"mt-0.5 shrink-0",children:d.jsx(Ww,{checked:t.enabled,disabled:t.loading||c,onChange:y=>{m(y)},"data-testid":i,"aria-label":r})})]})},Vj=()=>{const{t}=Ee(),[r,o]=b.useState(""),[i,l]=b.useState(!1),[c,f]=b.useState(!1),[h,g]=b.useState(null);b.useEffect(()=>{let y=!1;return WE().then(v=>{y||(o(v),l(!0))}).catch(()=>{y||l(!0)}),()=>{y=!0}},[]);const m=async()=>{g(null),f(!0);try{await UE(r),g("saved")}catch{g("error")}finally{f(!1)}};return d.jsxs("div",{children:[d.jsx("label",{className:"mb-1.5 block text-sm font-medium text-pri",htmlFor:"settings-webhook-url",children:t("settings.webhook.label")}),d.jsx("span",{className:"mb-2 block text-xs text-ter leading-relaxed",children:t("settings.webhook.description")}),d.jsx("input",{id:"settings-webhook-url",type:"url",inputMode:"url",placeholder:"https://…",className:"input",value:r,disabled:!i||c,onChange:y=>{g(null),o(y.target.value)},onBlur:()=>{m()},onKeyDown:y=>{if(y.key==="Enter"){if(y.nativeEvent.isComposing||y.keyCode===229)return;y.currentTarget.blur()}},"data-testid":"settings-webhook-url"}),h==="saved"?d.jsxs("span",{className:"mt-1.5 block text-xs",style:{color:"var(--status-green)"},children:["✓ ",t("settings.webhook.saved")]}):null,h==="error"?d.jsx("span",{className:"mt-1.5 block text-xs",style:{color:"var(--text-error)"},role:"alert",children:t("settings.saveError")}):null]})},Kw=()=>{const{t}=Ee(),r=Pw(),o=Kj();return d.jsxs("div",{className:"flex flex-col gap-2.5",children:[d.jsx(Yj,{}),d.jsxs("div",{className:"settings-section",children:[d.jsxs("div",{className:"settings-section__heading",children:[d.jsx(Ml,{size:12,"aria-hidden":!0}),d.jsx("span",{children:t("settings.experimental")})]}),d.jsx(My,{feature:r,label:t("settings.workflows.label"),description:t("settings.workflows.description"),testId:"settings-toggle-workflows"}),d.jsx(My,{feature:o,label:t("settings.autostaff.label"),description:t("settings.autostaff.description"),testId:"settings-toggle-autostaff"})]}),d.jsx(Ij,{}),d.jsxs("div",{className:"settings-section",children:[d.jsxs("div",{className:"settings-section__heading",children:[d.jsx(pE,{size:12,"aria-hidden":!0}),d.jsx("span",{children:t("settings.webhook.label")})]}),d.jsx(Vj,{})]})]})},Fw=()=>{const{t}=Ee(),r=Tt(),[o,i]=b.useState(!1),l=b.useRef(null),c=b.useRef(null);return b.useEffect(()=>{if(!o)return;const f=g=>{g.key==="Escape"&&(i(!1),c.current?.focus())},h=g=>{const m=l.current;m&&!m.contains(g.target)&&i(!1)};return document.addEventListener("keydown",f),document.addEventListener("pointerdown",h),()=>{document.removeEventListener("keydown",f),document.removeEventListener("pointerdown",h)}},[o]),d.jsxs("div",{ref:l,className:"relative",children:[d.jsx(ct,{label:t("settings.tooltip"),children:d.jsx("button",{ref:c,type:"button","aria-expanded":o,"aria-haspopup":"dialog","aria-label":t("settings.aria"),className:"flex h-7 w-7 cursor-pointer items-center justify-center rounded text-sec hover:bg-3 hover:text-pri","data-testid":"topbar-app-settings",onClick:()=>i(f=>!f),children:d.jsx(Af,{size:14,"aria-hidden":!0})})}),o?d.jsxs("div",{role:"dialog","aria-label":t("settings.aria"),className:r?"settings-sheet fixed inset-0 z-50 flex flex-col overflow-y-auto p-4":"settings-popover elev-2 absolute top-8 right-0 z-50 w-[380px] max-h-[calc(100vh-64px)] overflow-y-auto scroll-y rounded-lg border p-4","data-mobile":r||void 0,style:r?{background:"var(--bg-0)"}:{background:"var(--bg-elevated)",borderColor:"var(--border-bright)"},"data-testid":"app-settings-menu",children:[d.jsxs("div",{className:"mb-4 flex items-start gap-3",children:[d.jsx("div",{className:"flex h-9 w-9 shrink-0 items-center justify-center rounded-lg",style:{background:"color-mix(in oklab, var(--accent) 12%, transparent)",color:"var(--accent)"},children:d.jsx(Af,{size:18,"aria-hidden":!0})}),d.jsxs("div",{className:r?"min-w-0 flex-1":"min-w-0",children:[d.jsx("div",{className:"text-sm font-semibold text-pri",children:t("settings.heading")}),d.jsx("div",{className:"text-xs text-ter",children:t("settings.subtitle")})]}),r?d.jsx("button",{type:"button",onClick:()=>i(!1),"aria-label":t("common.close"),"data-testid":"mobile-settings-close",className:"icon-btn icon-btn--ghost shrink-0",children:d.jsx(fo,{size:16,"aria-hidden":!0})}):null]}),d.jsx(Kw,{})]}):null]})},Gj=t=>{const[r,o]=b.useState(null);return b.useEffect(()=>{if(t)return;let i=!0;return DE().then(l=>{i&&o(l)}).catch(()=>{i&&o(null)}),()=>{i=!1}},[t]),t??r},$j="2.1.0",Xj={version:$j},Yw=Xj.version,Zj=({actions:t,hideActions:r=!1,memoryOpen:o=!1,onToggleMemory:i,onToggleTaskGraph:l,openTaskCount:c=0,taskGraphOpen:f=!1,onToggleWorkflows:h,workflowsOpen:g=!1,version:m=Yw,versionInfo:y})=>{const{t:v}=Ee(),k=Gj(y),S=k?.updateAvailable&&k.latestVersion!==m?k:null,C=c>0,x=f?v("topbar.hideTodo"):C?v("topbar.todoOpen",{count:c}):v("topbar.showTodo");return d.jsxs("header",{className:"flex h-11 shrink-0 items-center px-4",style:{background:"var(--bg-0)",borderBottom:"1px solid var(--border)"},children:[d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsxs("a",{href:"https://hivehq.dev",target:"_blank",rel:"noopener noreferrer","aria-label":v("topbar.openWebsite"),title:v("topbar.openWebsite"),className:"-mx-1 flex items-center gap-2 rounded px-1 transition-opacity hover:opacity-80 focus-visible:outline focus-visible:outline-1 focus-visible:outline-offset-2 focus-visible:outline-[var(--accent)]","data-testid":"topbar-brand-link",children:[d.jsx("img",{src:"/logo.png",alt:"","aria-hidden":!0,className:"h-5 w-5 rounded-md","data-testid":"topbar-logo"}),d.jsx("span",{className:"font-semibold text-pri",children:"Hive"}),d.jsxs("span",{className:"text-ter text-xs tabular-nums",children:["v",m]})]}),S?d.jsxs("div",{className:"flex items-center gap-2 text-xs","data-testid":"topbar-update-badge",children:[d.jsx("span",{className:"rounded border px-2 py-0.5 font-medium",style:{background:"color-mix(in oklab, var(--accent) 10%, transparent)",borderColor:"color-mix(in oklab, var(--accent) 30%, transparent)",color:"var(--accent)"},children:v("topbar.updateAvailable")}),d.jsxs("span",{className:"text-ter",children:["v",m," → v",S.latestVersion]}),d.jsx("code",{className:"mono text-ter",children:S.installHint})]}):null]}),d.jsx("div",{className:"flex-1"}),r?null:d.jsxs("div",{className:"flex items-center gap-1",children:[t,i?d.jsx(ct,{label:v(o?"topbar.hideMemory":"topbar.showMemory"),children:d.jsxs("button",{type:"button",onClick:i,"aria-pressed":o,"aria-label":v(o?"topbar.hideMemory":"topbar.showMemory"),className:"flex h-7 cursor-pointer items-center gap-1 rounded border px-2 text-xs font-medium text-ter transition-colors hover:bg-3 hover:text-pri focus-visible:outline focus-visible:outline-1 focus-visible:outline-offset-2 focus-visible:outline-[var(--accent)]","data-testid":"topbar-memory",style:{borderColor:"var(--border)",background:"var(--bg-1)"},children:[d.jsx($2,{size:13}),d.jsx("span",{children:v("topbar.memory")})]})}):null,l?d.jsx(ct,{label:x,children:d.jsxs("button",{type:"button",onClick:l,"aria-pressed":f,"aria-label":x,"data-has-tasks":C?"true":void 0,className:"flex h-7 cursor-pointer items-center gap-1 rounded border px-2 text-xs font-medium text-ter transition-colors hover:bg-3 hover:text-pri focus-visible:outline focus-visible:outline-1 focus-visible:outline-offset-2 focus-visible:outline-[var(--accent)]","data-testid":"topbar-blueprint",style:{borderColor:"var(--border)",background:"var(--bg-1)"},children:[d.jsx(M0,{size:13,className:C?"text-accent":void 0}),d.jsx("span",{children:v("topbar.todo")})]})}):null,h?d.jsx(ct,{label:v(g?"topbar.hideWorkflows":"topbar.showWorkflows"),children:d.jsxs("button",{type:"button",onClick:h,"aria-pressed":g,"aria-label":v(g?"topbar.hideWorkflows":"topbar.showWorkflows"),className:"flex h-7 cursor-pointer items-center gap-1 rounded border px-2 text-xs font-medium text-ter transition-colors hover:bg-3 hover:text-pri focus-visible:outline focus-visible:outline-1 focus-visible:outline-offset-2 focus-visible:outline-[var(--accent)]","data-testid":"topbar-workflows",style:{borderColor:"var(--border)",background:"var(--bg-1)"},children:[d.jsx(U0,{size:13}),d.jsx("span",{children:v("topbar.workflows")})]})}):null,d.jsx(Rj,{}),d.jsx(Fw,{})]})]})},Vw="hive.workspace-sidebar.width",Ls=56,_m=280,df=Ls,Ly=16,Qj=240,zy=96,Rl=t=>Math.min(_m,Math.max(Ls,t)),Jj=()=>{try{const t=localStorage.getItem(Vw);if(!t)return df;const r=Number.parseInt(t,10);return Number.isFinite(r)?Rl(r):df}catch{return df}},e3=()=>{const[t,r]=b.useState(Jj),[o,i]=b.useState(!1);b.useEffect(()=>{try{localStorage.setItem(Vw,String(Math.round(t)))}catch{}},[t]);const l=b.useCallback(g=>{g.preventDefault();const m=g.clientX,y=t;i(!0);const v=document.body.style.cursor,k=document.body.style.userSelect;document.body.style.cursor="col-resize",document.body.style.userSelect="none";const S=x=>{r(Rl(y+x.clientX-m))},C=()=>{i(!1),document.body.style.cursor=v,document.body.style.userSelect=k,document.removeEventListener("mousemove",S),document.removeEventListener("mouseup",C)};document.addEventListener("mousemove",S),document.addEventListener("mouseup",C)},[t]),c=t<=zy,f=b.useCallback(()=>{r(g=>g<=zy?Qj:Ls)},[]),h=b.useCallback(g=>{g.key==="ArrowLeft"?(g.preventDefault(),r(m=>Rl(m-Ly))):g.key==="ArrowRight"?(g.preventDefault(),r(m=>Rl(m+Ly))):g.key==="Home"?(g.preventDefault(),r(Ls)):g.key==="End"&&(g.preventDefault(),r(_m))},[]);return{beginResize:l,collapsed:c,onResizeKeyDown:h,resizing:o,toggleCollapsed:f,width:t}},t3=({children:t,hideTopbarActions:r=!1,memoryOpen:o=!1,onToggleMemory:i,onToggleTaskGraph:l,openTaskCount:c=0,onToggleWorkflows:f,workflowsOpen:h=!1,sidebar:g,sidebarResize:m,taskGraphOpen:y=!1,topbarActions:v})=>{const{t:k}=Ee();return d.jsxs("div",{className:"flex h-screen w-full flex-col overflow-hidden",style:{background:"var(--bg-0)",color:"var(--text-primary)"},children:[d.jsx(Zj,{actions:v,hideActions:r,memoryOpen:o,onToggleMemory:i,onToggleTaskGraph:l,openTaskCount:c,taskGraphOpen:y,onToggleWorkflows:f,workflowsOpen:h}),d.jsxs("div",{className:"flex min-h-0 min-w-0 flex-1 overflow-hidden",children:[d.jsxs("aside",{"aria-label":k("layout.sidebarAria"),className:"workspace-sidebar relative flex shrink-0 flex-col","data-resizing":m.resizing?"true":"false",style:{background:"var(--bg-0)",boxShadow:"inset -1px 0 0 var(--border)",width:`${m.width}px`},children:[g,d.jsx("hr",{"aria-label":k("layout.sidebarResizeAria"),"aria-orientation":"vertical","aria-valuemin":Ls,"aria-valuemax":_m,"aria-valuenow":Math.round(m.width),tabIndex:0,className:"workspace-sidebar-resizer","data-resizing":m.resizing?"true":"false",onMouseDown:m.beginResize,onKeyDown:m.onResizeKeyDown})]}),d.jsx("section",{className:"relative flex min-w-0 flex-1 overflow-hidden",children:t})]})]})},n3={disconnected:"mobile.reconnect.disconnected",reconnecting:"mobile.reconnect.reconnecting",revoked:"mobile.reconnect.revoked"},r3=({status:t})=>{const{t:r}=Ee();if(!t||t.state!=="reconnecting"&&t.state!=="disconnected"&&t.state!=="revoked")return null;const o=t.state==="revoked"?"var(--status-red)":"var(--status-orange)",i=t.state==="disconnected"?t.retry:void 0;return d.jsxs("div",{role:"status","data-testid":"mobile-reconnect-banner",className:"flex items-center justify-center gap-2 px-3 py-1.5 text-center text-xs",style:{background:`color-mix(in oklab, ${o} 18%, var(--bg-0))`,color:o},children:[d.jsx("span",{children:r(n3[t.state])}),i?d.jsx("button",{type:"button","data-testid":"mobile-reconnect-retry",className:"rounded border px-2 py-0.5 font-medium",style:{borderColor:"currentColor",color:"currentColor"},onClick:i,children:r("mobile.reconnect.retry")}):null]})},a3=[{accent:"var(--status-green)",descriptionKey:"notifications.sound.soft.description",labelKey:"notifications.sound.soft.label",length:"short",value:"soft"},{accent:"var(--status-blue)",descriptionKey:"notifications.sound.ping.description",labelKey:"notifications.sound.ping.label",length:"short",value:"ping"},{accent:"var(--status-gold)",descriptionKey:"notifications.sound.chime.description",labelKey:"notifications.sound.chime.label",length:"short",value:"chime"},{accent:"var(--accent)",descriptionKey:"notifications.sound.cascade.description",labelKey:"notifications.sound.cascade.label",length:"long",value:"cascade"},{accent:"var(--status-orange)",descriptionKey:"notifications.sound.beacon.description",labelKey:"notifications.sound.beacon.label",length:"long",value:"beacon"},{accent:"var(--status-purple)",descriptionKey:"notifications.sound.resolve.description",labelKey:"notifications.sound.resolve.label",length:"long",value:"resolve"},{accent:"var(--text-tertiary)",descriptionKey:"notifications.sound.off.description",labelKey:"notifications.sound.off.label",length:"silent",value:"off"}],o3=[{descriptionKey:"notifications.detail.brief.description",labelKey:"notifications.detail.brief.label",value:"brief"},{descriptionKey:"notifications.detail.detailed.description",labelKey:"notifications.detail.detailed.label",value:"detailed"}],s3=()=>{const{t}=Ee(),r=Tt(),{notify:o,previewSound:i,requestDesktopNotifications:l,settings:c,updateSettings:f}=oc(),h=typeof window<"u"&&!("Notification"in window),g=b.useMemo(()=>a3.map(v=>({...v,description:t(v.descriptionKey),label:t(v.labelKey)})),[t]),m=b.useMemo(()=>o3.map(v=>({...v,description:t(v.descriptionKey),label:t(v.labelKey)})),[t]),y=v=>{if(!v){f({desktop:!1});return}l()};return d.jsxs("details",{className:"settings-details group",children:[d.jsxs("summary",{className:"settings-details__summary",children:[d.jsxs("div",{className:"settings-section__heading !mb-0",children:[d.jsx(Tf,{size:12,"aria-hidden":!0}),d.jsx("span",{children:t("notifications.settings.heading")})]}),d.jsx(wo,{size:14,className:"text-sec transition-transform group-open:rotate-180","aria-hidden":!0})]}),d.jsxs("div",{className:"settings-details__content flex flex-col gap-3.5",children:[d.jsxs("section",{children:[d.jsxs("div",{className:"mb-2 flex items-center gap-1.5 text-ter text-[10px] font-semibold uppercase tracking-wider",children:[d.jsx(Ll,{size:12,"aria-hidden":!0}),t("notifications.sound.sectionLabel")]}),d.jsx("div",{role:"radiogroup","aria-label":t("notifications.sound.sectionLabel"),className:r?"grid grid-cols-1 gap-2":"grid grid-cols-2 gap-2",children:g.map(v=>d.jsxs("div",{className:"relative min-h-[78px] rounded border transition-colors",style:{background:c.sound===v.value?`color-mix(in oklab, ${v.accent} 10%, var(--bg-2))`:"var(--bg-2)",borderColor:c.sound===v.value?`color-mix(in oklab, ${v.accent} 54%, var(--border-bright))`:"var(--border)"},children:[d.jsxs("label",{className:"block h-full w-full cursor-pointer rounded px-3 py-2 pr-10 text-left transition-colors hover:bg-3 focus-within:outline-none focus-within:ring-2 focus-within:ring-[var(--ring-focus)]",children:[d.jsx("input",{type:"radio",name:"notification-sound",value:v.value,checked:c.sound===v.value,className:"sr-only",onChange:()=>f({sound:v.value})}),d.jsxs("span",{className:"mb-1 flex items-center gap-2",children:[d.jsx("span",{className:"flex h-5 w-5 items-center justify-center rounded",style:{background:`color-mix(in oklab, ${v.accent} 16%, transparent)`,color:v.accent},children:v.value==="off"?d.jsx(W0,{size:12,"aria-hidden":!0}):d.jsx(Ll,{size:12,"aria-hidden":!0})}),d.jsx("span",{className:"font-medium text-pri text-xs",children:v.label}),v.length==="long"?d.jsx("span",{className:"rounded border border-[var(--border-bright)] px-1.5 py-0.5 text-[10px] text-ter uppercase",children:t("notifications.sound.longerBadge")}):null,c.sound===v.value?d.jsx(bo,{size:12,className:"ml-auto text-pri","aria-hidden":!0}):null]}),d.jsx("span",{className:"block text-ter text-[11px] leading-relaxed",children:v.description})]}),v.value!=="off"?d.jsx("button",{type:"button","aria-label":t("notifications.sound.previewAria",{label:v.label}),className:"absolute right-2 bottom-2 flex h-6 w-6 pointer-coarse:h-10 pointer-coarse:w-10 items-center justify-center rounded border text-sec transition-colors hover:bg-3 hover:text-pri cursor-pointer",style:{borderColor:"var(--border-bright)"},onClick:()=>i(v.value),children:d.jsx(ko,{size:12,"aria-hidden":!0})}):null]},v.value))})]}),d.jsxs("section",{children:[d.jsxs("div",{className:"mb-2 flex items-center gap-1.5 text-ter text-[10px] font-semibold uppercase tracking-wider",children:[d.jsx(D0,{size:12,"aria-hidden":!0}),t("notifications.detail.sectionLabel")]}),d.jsx("div",{role:"radiogroup","aria-label":t("notifications.detail.sectionLabel"),className:"grid grid-cols-2 rounded border p-1",style:{background:"var(--bg-1)",borderColor:"var(--border)"},children:m.map(v=>d.jsxs("label",{className:"cursor-pointer rounded px-3 py-2 text-left transition-colors hover:bg-3 focus-within:outline-none focus-within:ring-2 focus-within:ring-[var(--ring-focus)]",style:{background:c.detail===v.value?"var(--bg-3)":"transparent",color:c.detail===v.value?"var(--text-primary)":"var(--text-secondary)"},children:[d.jsx("input",{type:"radio",name:"notification-detail",value:v.value,checked:c.detail===v.value,className:"sr-only",onChange:()=>f({detail:v.value})}),d.jsx("span",{className:"block font-medium text-xs",children:v.label}),d.jsx("span",{className:"block text-ter text-[11px] leading-relaxed",children:v.description})]},v.value))})]}),d.jsxs("label",{className:"flex items-start gap-2 rounded border p-2 text-sec text-xs cursor-pointer",children:[d.jsx("input",{type:"checkbox","aria-label":t("notifications.desktop.aria"),checked:c.desktop,disabled:h,className:"mt-0.5 cursor-pointer",onChange:v=>y(v.currentTarget.checked)}),d.jsxs("span",{children:[d.jsx("span",{className:"block font-medium text-pri",children:t("notifications.desktop.label")}),d.jsx("span",{className:"text-ter leading-relaxed",children:t(h?"notifications.desktop.unsupported":"notifications.desktop.helper")})]})]}),d.jsx("div",{className:"flex justify-end gap-2 border-t pt-3",style:{borderColor:"var(--border)"},children:d.jsx("button",{type:"button",className:"icon-btn icon-btn--primary ml-auto cursor-pointer",onClick:()=>o({brief:t("notifications.test.brief"),detail:t("notifications.test.detail"),kind:"success",title:t("notifications.test.title")}),children:t("notifications.test.button")})})]})]})},i3=({demoMode:t,onTryDemo:r,onExitDemo:o})=>{const{t:i}=Ee();return d.jsxs("div",{className:"mobile-settings-section flex min-h-full flex-col p-4","data-testid":"mobile-settings-section",children:[d.jsx("h1",{className:"mb-4 text-base font-semibold text-pri",children:i("mobile.section.settings")}),d.jsx(Kw,{}),d.jsx(s3,{}),d.jsxs("div",{className:"settings-section mt-3",children:[d.jsxs("div",{className:"settings-section__heading",children:[d.jsx(Ml,{size:12,"aria-hidden":!0}),d.jsx("span",{children:i("mobile.section.demo")})]}),t?d.jsxs("button",{type:"button","data-testid":"mobile-settings-exit-demo",onClick:o,className:"flex w-full items-center gap-3 rounded p-2 text-left text-sm text-pri hover:bg-3",children:[d.jsx(zS,{size:16,"aria-hidden":!0,className:"text-ter"}),d.jsx("span",{className:"min-w-0 flex-1 truncate",children:i("demo.exit")})]}):d.jsxs("button",{type:"button","data-testid":"mobile-settings-demo",onClick:r,className:"flex w-full items-center gap-3 rounded p-2 text-left text-sm text-pri hover:bg-3",children:[d.jsx(Ml,{size:16,"aria-hidden":!0,className:"text-ter"}),d.jsx("span",{className:"min-w-0 flex-1 truncate",children:i("mobile.section.demo")})]})]})]})},l3={team:B0,tasks:M0,flows:U0,settings:Af},c3={team:"mobile.nav.team",tasks:"mobile.nav.tasks",flows:"mobile.nav.flows",settings:"mobile.nav.settings"},u3=({active:t,onSelect:r,sections:o,openTaskCount:i=0,workingCount:l=0})=>{const{t:c}=Ee();return d.jsx("nav",{"aria-label":c("mobile.nav.aria"),className:"mobile-bottom-nav flex shrink-0 items-stretch","data-testid":"mobile-bottom-nav",style:{background:"var(--bg-0)",borderTop:"1px solid var(--border)"},children:o.map(f=>{const h=l3[f],g=c(c3[f]),m=f===t,y=f==="tasks"&&i>0?i:f==="team"&&l>0?l:0;return d.jsxs("button",{type:"button","aria-label":g,"aria-current":m?"page":void 0,"data-testid":`mobile-nav-${f}`,"data-active":m?"true":void 0,onClick:()=>r(f),className:"mobile-bottom-nav__tab relative flex flex-1 cursor-pointer flex-col items-center justify-center gap-0.5 py-2 text-xs",style:{color:m?"var(--text-primary)":"var(--text-tertiary)"},children:[m?d.jsx("span",{"aria-hidden":!0,className:"absolute top-0 left-1/2 h-0.5 w-8 -translate-x-1/2 rounded-b",style:{background:"var(--accent)"}}):null,d.jsx(h,{size:20,"aria-hidden":!0}),d.jsx("span",{children:g}),y>0?d.jsx("span",{className:"absolute top-1 right-[calc(50%-18px)] inline-flex h-[18px] min-w-[18px] items-center justify-center rounded-full px-1 text-[11px] font-medium tabular-nums leading-none","data-testid":`mobile-nav-${f}-badge`,style:{background:"var(--accent)",color:"#ffffff"},children:y}):null]},f)})})},d3=({workspaceSwitcher:t,actions:r,banner:o})=>d.jsxs("header",{className:"mobile-topbar flex shrink-0 flex-col","data-testid":"mobile-topbar",style:{background:"var(--bg-0)",borderBottom:"1px solid var(--border)"},children:[d.jsxs("div",{className:"flex h-12 items-center gap-2 px-3",children:[d.jsx("div",{className:"min-w-0 flex-1",children:t??d.jsx("span",{className:"font-semibold text-pri",children:"Hive"})}),d.jsx("div",{className:"flex shrink-0 items-center gap-1",children:r})]}),o]}),f3=()=>typeof navigator<"u"&&/iP(hone|ad|od)/.test(navigator.platform??navigator.userAgent),m3=()=>{const[t,r]=b.useState(null);return b.useEffect(()=>{if(!f3())return;const o=typeof window<"u"?window.visualViewport:null;if(!o)return;const i=()=>{const l=Math.abs(o.height-window.innerHeight)<10;r(l?null:o.height)};return i(),o.addEventListener("resize",i),()=>{o.removeEventListener("resize",i)}},[]),t},p3={team:"mobile-section-team",tasks:"mobile-section-tasks",flows:"mobile-section-flows",settings:"mobile-section-settings"},h3=({workspaceSwitcher:t,topbarActions:r,banner:o,fullBleed:i,team:l,tasks:c,flows:f,settings:h,terminalPanels:g,overlays:m,openTaskCount:y=0,workingCount:v=0,activeSection:k,onSectionChange:S})=>{const[C,x]=b.useState("team"),E=k??C,T=m3(),_=B=>{x(B),S?.(B)},j={team:l,tasks:c,flows:f,settings:h},A=["team","tasks"];f!=null&&A.push("flows"),h!=null&&A.push("settings");const R=A.includes(E)?E:"team",L=sb()&&R==="team"&&i==null;return d.jsxs("div",{className:`mobile-shell flex h-dvh w-full max-w-[100vw] min-w-0 flex-col overflow-hidden${L?" mobile-shell--focus":""}`,"data-mobile-shell":"true","data-testid":"mobile-shell","data-focus-mode":L?"true":void 0,style:{background:"var(--bg-0)",color:"var(--text-primary)",...T!=null?{height:`${T}px`}:{}},children:[L?o:d.jsx(d3,{workspaceSwitcher:t,actions:r,banner:o}),d.jsx("main",{className:"relative min-h-0 min-w-0 flex-1 overflow-hidden",children:i??d.jsx("div",{className:R==="team"?"flex h-full min-w-0 flex-col overflow-hidden":"flex h-full min-w-0 flex-col overflow-y-auto","data-testid":p3[R],"data-mobile-section":R,children:j[R]})}),g,i!=null||L?null:d.jsx(u3,{active:R,onSelect:_,sections:A,openTaskCount:y,workingCount:v}),m]})},g3=[],v3=b.lazy(()=>Ct(()=>import("./TaskGraphDrawer-C2JufcPs.js"),[]).then(t=>({default:t.TaskGraphContent}))),y3=({tasksFile:t,workspacePath:r,workers:o,onSelectOwner:i,onAddWorkspace:l,demoMode:c=!1})=>{const{t:f}=Ee(),h=o??g3,g=b.useMemo(()=>h.length?h.map(m=>m.name):void 0,[h]);return r?d.jsxs("div",{className:"flex h-full min-h-0 flex-col",children:[c?d.jsx("div",{className:"flex shrink-0 items-center justify-end px-3 py-1",children:d.jsx("span",{className:"pill pill--neutral text-xs",children:f("demo.readOnlyBadge")})}):null,d.jsx("div",{className:"min-h-0 flex-1",children:d.jsx(b.Suspense,{fallback:null,children:d.jsx(v3,{content:t.content,hasConflict:t.hasConflict,onContentChange:t.onChange,onKeepLocal:t.onKeepLocal,onReload:t.onReload,onSave:t.onSave,onToggleTaskLine:m=>{t.toggleTaskAtLine(m).catch(Lr("tasks.toggleTaskAtLine"))},onAppendTask:m=>{t.appendTask(m).catch(Lr("tasks.appendTask"))},onAppendSubtask:(m,y)=>{t.appendSubtask(m,y).catch(Lr("tasks.appendSubtask"))},onUpdateTaskText:(m,y)=>{t.updateTaskText(m,y).catch(Lr("tasks.updateTaskText"))},onDeleteTask:m=>{t.deleteTask(m).catch(Lr("tasks.deleteTask"))},workspacePath:r,...g?{knownWorkerNames:g}:{},...i?{onSelectOwner:i}:{}})})})]}):d.jsx("div",{className:"flex h-full flex-col","data-testid":"mobile-tasks-empty",children:d.jsx(Ks,{title:f("mobile.tasks.noWorkspaceTitle"),description:f("mobile.tasks.noWorkspaceDesc"),action:l?d.jsx("button",{type:"button",onClick:l,className:"icon-btn icon-btn--primary mt-1 flex min-h-11 items-center gap-1.5 px-4 py-2 text-xs font-medium",children:f("firstRun.addWorkspace")}):void 0})})},Hy=[{token:"var(--accent)",label:"accent"},{token:"var(--status-blue)",label:"blue"},{token:"var(--status-purple)",label:"purple"},{token:"var(--status-orange)",label:"orange"},{token:"var(--status-green)",label:"green"},{token:"var(--status-gold)",label:"gold"}],b3=t=>{let r=0;for(let i=0;i<t.length;i+=1)r=r*31+t.charCodeAt(i)|0;const o=Math.abs(r)%Hy.length;return Hy[o]},w3=t=>{const r=t.trim();if(r.length===0)return"?";const o=r.codePointAt(0);return o===void 0?"?":String.fromCodePoint(o).toUpperCase()},Bf=({workspaceId:t,name:r,isActive:o,working:i,workingCount:l,size:c=32})=>{const{token:f,label:h}=b3(t),g=w3(r),m=l&&l>1?l:null;return d.jsx(Ow,{size:c,color:f,fontRatio:.45,ringColor:o?f:null,testId:"workspace-avatar",data:{"workspace-id":t,active:o?"true":void 0,"color-label":h},decoration:m!==null?d.jsx("span",{className:"absolute flex h-[16px] min-w-[16px] items-center justify-center rounded-full px-1 font-medium text-xs tabular-nums leading-none",style:{right:"-4px",bottom:"-4px",background:"var(--status-green)",color:"#0a1f0a",boxShadow:"0 0 0 2px var(--bg-1)"},"data-testid":"workspace-avatar-working-count","aria-hidden":!0,children:m>9?"9+":m}):i?d.jsx("span",{className:"status-dot status-dot--working absolute",style:{right:"-2px",bottom:"-2px",boxShadow:"0 0 0 2px var(--bg-1)"},"aria-hidden":!0}):null,children:g})},By=(t,r)=>{if(!t||t.length===0)return r("sidebar.noMembers");const o=t.filter(i=>i.status==="working").length;return o>0?r("sidebar.workingCount",{working:o,total:t.length}):r("sidebar.teamMemberCount",{count:t.length})},x3=({activeWorkspaceId:t,workspaces:r,workersByWorkspaceId:o,createDisabledReason:i,onSelectWorkspace:l,onCreateClick:c,onDeleteWorkspace:f})=>{const{t:h}=Ee(),g=Qt(),[m,y]=b.useState(!1),[v,k]=b.useState(null),[S,C]=b.useState(!1),x=r?.find(T=>T.id===t)?.name??h("mobile.section.workspaces"),E=()=>{if(!v||S)return;const T=v;C(!0),Promise.resolve(f(T)).then(()=>{g.show({kind:"success",message:h("sidebar.removed",{name:T.name})})}).catch(_=>{const j=_ instanceof Error?_.message:String(_);g.show({kind:"error",message:h("sidebar.deleteFailed",{message:j})})}).finally(()=>{C(!1),k(null)})};return d.jsxs(Fs,{open:m,onOpenChange:y,children:[d.jsx(nj,{asChild:!0,children:d.jsxs("button",{type:"button","data-testid":"mobile-workspace-switcher-trigger","aria-label":h("mobile.workspaces.switch"),className:"mobile-ws-switcher flex min-h-11 w-full items-center gap-1.5 rounded-md px-2 py-1.5 text-left hover:bg-2",children:[d.jsx("span",{className:"min-w-0 flex-1 truncate text-sm font-medium text-pri",children:x}),d.jsx(wo,{size:16,"aria-hidden":!0,className:"shrink-0 text-ter"})]})}),d.jsxs(Ys,{children:[d.jsx(Vs,{"data-testid":"mobile-workspace-switcher-overlay",className:"app-overlay fixed inset-0 z-40"}),d.jsx("div",{className:"pointer-events-none fixed inset-0 z-50 grid items-end",children:d.jsxs(Gs,{"data-testid":"mobile-workspace-switcher-sheet",className:"dialog-slide-up elev-2 pointer-events-auto flex max-h-[70dvh] w-full flex-col overflow-hidden rounded-t-xl border-t",style:{background:"var(--bg-elevated)",borderColor:"var(--border-bright)"},children:[d.jsx($s,{asChild:!0,children:d.jsxs("div",{className:"flex shrink-0 items-baseline gap-2 border-b px-4 py-3",style:{borderColor:"var(--border)"},children:[d.jsx("span",{className:"text-base font-semibold text-pri",children:h("sidebar.workspaces")}),r&&r.length>0?d.jsx("span",{className:"text-xs text-ter tabular-nums",children:r.length}):null]})}),d.jsx("div",{className:"min-h-0 flex-1 overflow-y-auto py-1",children:!r||r.length===0?d.jsxs("div",{className:"flex flex-col items-center gap-1 px-6 py-8 text-center",children:[d.jsx("span",{className:"text-sm font-medium text-sec",children:h("sidebar.noWorkspaces")}),d.jsx("span",{className:"text-xs text-ter",children:i??h("sidebar.noWorkspacesDesc")})]}):r.map(T=>{const _=T.id===t,j=o[T.id],A=j?.filter(R=>R.status==="working").length??0;return d.jsxs("div",{className:"flex items-center gap-1 pr-2",children:[d.jsxs("button",{type:"button","data-testid":`mobile-ws-row-${T.id}`,onClick:()=>{y(!1),l(T.id)},className:"flex min-h-14 min-w-0 flex-1 items-center gap-3 px-4 py-2 text-left",style:_?{background:"color-mix(in oklab, var(--accent) 10%, transparent)"}:void 0,children:[d.jsx(Bf,{workspaceId:T.id,name:T.name,isActive:_,working:A>0,workingCount:A,size:36}),d.jsxs("span",{className:"flex min-w-0 flex-1 flex-col",children:[d.jsx("span",{className:"truncate text-sm font-medium text-pri",children:T.name}),d.jsx("span",{className:"truncate text-xs text-ter",children:By(j,h)})]}),_?d.jsx(bo,{size:18,className:"shrink-0 text-accent","aria-hidden":!0}):null]}),d.jsx("button",{type:"button","aria-label":h("sidebar.deleteAria",{name:T.name}),"data-testid":`mobile-ws-delete-${T.id}`,onClick:()=>k(T),className:"flex h-10 w-10 shrink-0 items-center justify-center rounded-md text-ter",children:d.jsx(tc,{size:16,"aria-hidden":!0})})]},T.id)})}),d.jsx("div",{className:"shrink-0 border-t px-4 pt-3 pb-[max(12px,env(safe-area-inset-bottom))]",style:{borderColor:"var(--border)",background:"var(--bg-2)"},children:d.jsxs("button",{type:"button",disabled:!!i,title:i,"data-testid":"mobile-ws-create",onClick:()=>{y(!1),c()},className:"icon-btn icon-btn--primary flex w-full min-h-11 items-center justify-center gap-1.5",children:[d.jsx(As,{size:16,"aria-hidden":!0}),h("sidebar.newWorkspace")]})})]})})]}),d.jsx(Xs,{open:v!==null,onOpenChange:T=>{!T&&!S&&k(null)},title:v?h("sidebar.deleteConfirm",{name:v.name}):h("sidebar.deleteLabel"),description:v?h("sidebar.deleteDescription",{path:v.path,summary:By(o[v.id],h)}):"",confirmLabel:h(S?"sidebar.deleting":"sidebar.deleteLabel"),confirmKind:"danger",onConfirm:E})]})},k3=4e3,S3=t=>{const[r,o]=b.useState([]);return b.useEffect(()=>{if(!t){o([]);return}let i=!1;const l=()=>{eb().then(f=>{i||o(f)}).catch(()=>{})};l();const c=window.setInterval(l,k3);return()=>{i=!0,window.clearInterval(c)}},[t]),r},E3=({devices:t,enabled:r})=>{const{notify:o}=oc(),{t:i}=Ee(),l=b.useRef(null);return b.useEffect(()=>{if(!r){l.current=null;return}const c=new Map(t.filter(h=>!h.revoked).map(h=>[h.deviceId,h])),f=l.current;if(l.current=new Set(c.keys()),!!f)for(const[h,g]of c)f.has(h)||o({brief:i("notifications.remoteSession.brief",{name:g.name}),detail:i("notifications.remoteSession.detail",{name:g.name}),kind:"success",title:i("notifications.remoteSession.title")})},[t,r,o,i]),null},C3=()=>{const{status:t}=Am(),r=t.enabled&&t.loggedIn,o=S3(r);return d.jsx(E3,{devices:o,enabled:r})};let Wf=!1;const Gw=()=>{Wf=!0,window.location.reload()},T3=t=>{b.useEffect(()=>{const r=o=>{if(Wf){Wf=!1;return}o.preventDefault(),o.returnValue=""};return window.addEventListener("beforeunload",r),()=>window.removeEventListener("beforeunload",r)},[t])},A3=3e3,_3=({onTryDemo:t}={})=>{const{t:r}=Ee(),[o,i]=b.useState(!1),l=b.useRef(!0),c=b.useCallback(()=>{typeof window>"u"||Gw()},[]),f=b.useCallback(async()=>{try{return(await fetch("/api/version",{credentials:"include"})).ok}catch{return!1}},[]);b.useEffect(()=>{l.current=!0;const g=window.setInterval(async()=>{l.current&&await f()&&c()},A3);return()=>{l.current=!1,window.clearInterval(g)}},[f,c]);const h=async()=>{i(!0);try{if(await f()){c();return}}finally{window.setTimeout(()=>{l.current&&i(!1)},400)}};return d.jsx("div",{className:"flex flex-1 items-center justify-center p-8","data-testid":"runtime-offline-page",children:d.jsxs("div",{className:"elev-1 flex max-w-md flex-col items-center gap-3 rounded border p-6 text-center",style:{background:"var(--bg-elevated)",borderColor:"var(--border)"},children:[d.jsx("div",{className:"flex h-12 w-12 items-center justify-center rounded-full",style:{background:"var(--bg-3)",color:"var(--status-orange)"},children:d.jsx(ZS,{size:24,"aria-hidden":!0})}),d.jsx("div",{className:"font-semibold text-pri",children:r("pwa.runtimeOffline.title")}),d.jsx("div",{className:"text-sec text-sm leading-relaxed",children:r("pwa.runtimeOffline.body")}),d.jsxs("div",{className:"mt-2 flex flex-wrap items-center justify-center gap-2",children:[d.jsxs("button",{type:"button",className:"icon-btn icon-btn--primary flex items-center gap-2","data-testid":"runtime-offline-retry",disabled:o,onClick:()=>{h()},children:[o?d.jsx(xo,{size:12,className:"animate-spin","aria-hidden":!0}):d.jsx(sm,{size:12,"aria-hidden":!0}),r(o?"pwa.runtimeOffline.retrying":"pwa.runtimeOffline.retry")]}),t?d.jsxs("button",{type:"button",className:"icon-btn flex items-center gap-2","data-testid":"runtime-offline-try-demo",onClick:t,children:[d.jsx(lS,{size:12,"aria-hidden":!0}),r("pwa.runtimeOffline.tryDemo")]}):null]}),d.jsx("div",{className:"text-ter text-xs",children:r("pwa.runtimeOffline.autoReconnect")})]})})},Uf=new Set;let $w=null;const N3=t=>{$w=t;for(const r of Uf)r(t)},j3=t=>(Uf.add(t),t($w),()=>{Uf.delete(t)}),R3=2e3,O3=async t=>{if(!t.serviceWorker)return;let r;try{r=await t.serviceWorker.register("/sw.js")}catch{return}const o=l=>{const c=()=>{l.state==="installed"&&t.serviceWorker?.controller&&N3(()=>{l.postMessage({type:"SKIP_WAITING"}),setTimeout(t.reload,R3)})};l.addEventListener("statechange",c)};r.waiting&&t.serviceWorker.controller&&o(r.waiting),r.installing&&o(r.installing),r.addEventListener("updatefound",()=>{r.installing&&o(r.installing)});let i=!1;t.serviceWorker.addEventListener("controllerchange",()=>{i||(i=!0,t.reload())})},D3=()=>typeof navigator>"u"||typeof window>"u"?Promise.resolve():O3({isProd:!0,serviceWorker:"serviceWorker"in navigator?navigator.serviceWorker:null,reload:Gw}),Wy=({terminalRuns:t})=>{const{t:r}=Ee(),o=Tt(),[i,l]=b.useState(null),[c,f]=b.useState(!1);if(b.useEffect(()=>j3(y=>{l(()=>y)}),[]),!i)return null;const h=t.every(y=>y.status==="stopped"),g=!h||c,m=r(c?"pwa.reloading":h?"pwa.reloadToActivate":"pwa.waitForAgents");return d.jsxs("div",{className:"update-toast elev-2 fixed right-4 bottom-8 z-50 flex items-center gap-3 rounded border px-3 py-2",style:{background:"var(--bg-elevated)",borderColor:"var(--border-bright)"},"data-mobile":o||void 0,"data-testid":"update-available-toast",role:"status","aria-live":"polite",children:[d.jsx(sm,{size:14,className:"text-sec","aria-hidden":!0}),d.jsxs("div",{className:"flex flex-col",children:[d.jsx("span",{className:"font-medium text-pri text-xs",children:r("pwa.appShellUpdated")}),d.jsx("span",{className:"text-ter text-xs",children:r(h?"pwa.reloadToActivate":"pwa.waitForAgents")})]}),d.jsx("button",{type:"button",className:"icon-btn icon-btn--primary","data-testid":"update-available-reload",disabled:g,onClick:()=>{f(!0),i()},children:m})]})},M3=new Set(["add-workspace","try-demo"]),L3=t=>t!==null&&M3.has(t),z3=({onAddWorkspace:t,onTryDemo:r,ready:o})=>{const i=b.useRef(!1);b.useEffect(()=>{if(!o||i.current||typeof window>"u")return;const c=new URLSearchParams(window.location.search).get("action");L3(c)&&(i.current=!0,window.history.replaceState({},"",window.location.pathname),c==="add-workspace"?t():c==="try-demo"&&r())},[o,t,r])},Uy=()=>{const{t}=Ee(),r=Qt(),o=Tt(),{pending:i,refresh:l}=Am(),[c,f]=b.useState(!1),h=b.useRef(!1),g=i?.deviceName??"",m=i?.pairingId??null,y=i?.expiresAt??null;b.useEffect(()=>{m!==null&&(h.current=!1)},[m]);const v=b.useCallback(async()=>{if(!(!m||c||h.current)){h.current=!0,f(!0);try{await vC(m),r.show({kind:"success",message:t("remote.confirm.paired",{name:g})})}catch{h.current=!1,r.show({kind:"error",message:t("remote.confirm.failed")})}finally{f(!1),await l()}}},[m,c,g,l,t,r]),k=b.useCallback(async S=>{if(!(!m||h.current)){h.current=!0;try{await yC(m)}catch{}r.show({kind:S==="expired"?"warning":"success",message:t(S==="expired"?"remote.confirm.expired":"remote.confirm.rejected")}),f(!1),await l()}},[m,l,t,r]);return b.useEffect(()=>{if(y===null)return;const S=y-Date.now();if(S<=0){k("expired");return}const C=window.setTimeout(()=>{k("expired")},S);return()=>window.clearTimeout(C)},[y,k]),!i||o?null:d.jsx(Fs,{open:!0,onOpenChange:S=>{S||k("rejected")},children:d.jsxs(Ys,{children:[d.jsx(Vs,{"data-testid":"remote-pairing-confirm-overlay",className:"app-overlay fixed inset-0 z-[80]"}),d.jsx("div",{className:"pointer-events-none fixed inset-0 z-[90] grid place-items-center p-4",children:d.jsxs(Gs,{"data-testid":"remote-pairing-confirm",className:"dialog-scale-pop elev-2 pointer-events-auto w-[440px] max-w-[calc(100vw-32px)] rounded-lg border p-5",style:{background:"var(--bg-elevated)",borderColor:"var(--border-bright)"},children:[d.jsxs("div",{className:"flex items-start gap-3",children:[d.jsx("div",{"aria-hidden":!0,className:"flex h-9 w-9 shrink-0 items-center justify-center rounded",style:{background:"color-mix(in oklab, var(--accent) 14%, transparent)",color:"var(--accent)",border:"1px solid color-mix(in oklab, var(--accent) 30%, transparent)"},children:d.jsx(eE,{size:18})}),d.jsxs("div",{className:"min-w-0 flex-1",children:[d.jsx($s,{className:"text-lg font-semibold text-pri",children:t("remote.confirm.title")}),d.jsx(hc,{className:"mt-1.5 text-sm text-sec",children:t("remote.confirm.description",{name:g})})]})]}),d.jsxs("div",{className:"mt-4",children:[d.jsx("div",{className:"mb-1 text-xs font-medium uppercase tracking-wider text-ter",children:t("remote.confirm.sasLabel")}),d.jsx("div",{"data-testid":"remote-pairing-sas",className:"rounded border bg-2 py-3 text-center font-mono text-3xl tracking-[0.4em] text-pri",style:{borderColor:"var(--border)"},children:i.sas}),d.jsx("p",{className:"mt-2 text-xs text-ter",children:t("remote.confirm.warning")})]}),d.jsxs("div",{className:"mt-5 flex justify-end gap-2",children:[d.jsx("button",{type:"button","data-testid":"remote-pairing-reject",onClick:()=>{k("rejected")},disabled:c,className:"icon-btn",children:t("remote.confirm.reject")}),d.jsx("button",{type:"button","data-testid":"remote-pairing-confirm-action",onClick:()=>{v()},disabled:c,className:"icon-btn icon-btn--primary",children:t(c?"remote.confirm.confirming":"remote.confirm.confirm")})]})]})})]})})},H3=t=>!!t?.some(r=>r.status==="working"),B3=t=>t?.filter(r=>r.status==="working").length??0,W3=(t,r)=>{if(!t||t.length===0)return r("sidebar.noMembers");const o=t.filter(i=>i.status==="working").length;return o>0?r("sidebar.workingCount",{working:o,total:t.length}):r("sidebar.teamMemberCount",{count:t.length})},Xw="hive.sidebar.githubDismissed",U3="https://www.bilibili.com/video/BV1UHLp6nEQR",q3=()=>{if(typeof window>"u")return!1;try{return window.localStorage.getItem(Xw)==="1"}catch{return!1}},I3=({activeWorkspaceId:t,collapsed:r=!1,createDisabledReason:o,onCreateClick:i,onDeleteWorkspace:l,onSelectWorkspace:c,onToggleCollapse:f,workersByWorkspaceId:h,workspaces:g})=>{const{t:m}=Ee(),[y,v]=b.useState(null),[k,S]=b.useState(!1),[C,x]=b.useState(q3),E=Qt(),T=()=>{x(!0);try{window.localStorage.setItem(Xw,"1")}catch{}},_=!!o,j=D=>{v(D)},A=()=>{if(!y||k)return;const D=y;S(!0),Promise.resolve(l(D)).then(()=>{E.show({kind:"success",message:m("sidebar.removed",{name:D.name})})}).catch(L=>{const B=L instanceof Error?L.message:String(L);E.show({kind:"error",message:m("sidebar.deleteFailed",{message:B})})}).finally(()=>{S(!1),v(null)})},R=d.jsx(Xs,{open:y!==null,onOpenChange:D=>{!D&&!k&&v(null)},title:y?m("sidebar.deleteConfirm",{name:y.name}):m("sidebar.deleteLabel"),description:y?m("sidebar.deleteDescription",{path:y.path,summary:W3(h[y.id],m)}):"",confirmLabel:m(k?"sidebar.deleting":"sidebar.deleteLabel"),confirmKind:"danger",onConfirm:A});return d.jsxs("nav",{"aria-label":"Workspaces",className:"flex h-full flex-col",children:[d.jsxs("div",{className:"ws-sidebar-header flex items-center justify-between gap-2 px-3 pt-3 pb-2",style:{boxShadow:"inset 0 -1px 0 var(--border)"},children:[d.jsxs("div",{className:"ws-sidebar-title flex min-w-0 items-center gap-2",children:[d.jsx("span",{className:"ws-sidebar-title__text text-xs font-medium text-ter","data-testid":"workspace-sidebar-title",children:m("sidebar.workspaces")}),g&&g.length>0?d.jsx("span",{className:"ws-sidebar-count mono rounded bg-2 px-1.5 py-0.5 text-xs text-ter",children:g.length}):null]}),f?d.jsx(ct,{side:"right",label:m(r?"layout.sidebarExpand":"layout.sidebarCollapse"),children:d.jsx("button",{type:"button","aria-label":m(r?"layout.sidebarExpand":"layout.sidebarCollapse"),"aria-expanded":!r,"data-testid":"workspace-sidebar-toggle",onClick:f,className:"ws-collapse-toggle",children:r?d.jsx(aS,{size:16,"aria-hidden":!0}):d.jsx(nS,{size:16,"aria-hidden":!0})})}):null]}),g===null?d.jsx("p",{className:"px-3 py-2 text-xs text-ter",children:m("common.loading")}):g.length===0?d.jsxs("div",{className:"ws-empty flex-1 px-2 py-4",children:[d.jsx("div",{className:"ws-empty__wide",children:d.jsx(Ks,{title:m("sidebar.noWorkspaces"),description:o??m("sidebar.noWorkspacesDesc"),icon:d.jsx(O0,{size:20}),action:d.jsxs("button",{type:"button",onClick:_?void 0:i,disabled:_,"aria-label":m("sidebar.newWorkspace"),title:o??m("sidebar.newWorkspace"),className:"icon-btn icon-btn--primary mt-1 flex items-center gap-1.5 px-4 py-2 text-xs font-medium disabled:cursor-not-allowed disabled:opacity-50",children:[d.jsx(As,{size:14,"aria-hidden":!0}),m("sidebar.newWorkspace")]})})}),d.jsx(ct,{side:"right",label:o??m("sidebar.newWorkspace"),children:d.jsx("button",{type:"button",onClick:_?void 0:i,disabled:_,"aria-label":m("sidebar.newWorkspace"),title:o??m("sidebar.newWorkspace"),"data-testid":"sidebar-empty-compact-add",className:"ws-empty__compact icon-btn icon-btn--primary hidden h-8 w-8 items-center justify-center disabled:cursor-not-allowed disabled:opacity-50",children:d.jsx(As,{size:16,"aria-hidden":!0})})})]}):d.jsxs("ul",{className:"flex-1 scroll-y pb-2",children:[g.map(D=>{const L=h[D.id],B=D.id===t,P=H3(L),te=B3(L);return d.jsxs("li",{className:"group relative",children:[d.jsx(ct,{side:"right",label:d.jsxs("span",{className:"flex flex-col gap-0.5",children:[d.jsx("span",{className:"font-medium",children:D.name}),d.jsx("span",{className:"mono text-ter",children:D.path})]}),children:d.jsxs("button",{type:"button","aria-label":D.name,"aria-current":B?"true":void 0,"data-workspace-path":D.path,onClick:()=>c(D.id),className:`ws-row flex w-full items-center gap-2.5 py-1.5 pr-7 pl-2 text-left pointer-coarse:min-h-11${B?" active":""}`,children:[d.jsx(Bf,{workspaceId:D.id,name:D.name,isActive:!1,working:P,workingCount:te}),d.jsx("span",{className:`min-w-0 flex-1 truncate text-sm ${B?"font-medium text-pri":"text-pri"}`,children:D.name})]})}),d.jsx(ct,{side:"right",label:d.jsxs("span",{className:"flex flex-col gap-0.5",children:[d.jsx("span",{className:"font-medium",children:D.name}),d.jsx("span",{className:"mono text-ter",children:D.path})]}),children:d.jsx("button",{type:"button","aria-label":D.name,"aria-current":B?"true":void 0,onClick:()=>c(D.id),className:"ws-avatar-cell hidden w-full justify-center py-2","data-testid":"ws-avatar-cell",children:d.jsx(Bf,{workspaceId:D.id,name:D.name,isActive:B,working:P,workingCount:te})})}),d.jsx(ct,{label:m("sidebar.deleteAria",{name:D.name}),children:d.jsx("button",{type:"button","aria-label":m("sidebar.deleteAria",{name:D.name}),onClick:()=>j(D),className:"ws-row-delete absolute top-2 right-2 flex h-6 w-6 items-center justify-center rounded text-ter opacity-0 transition-colors pointer-coarse:h-10 pointer-coarse:w-10 hover:text-status-red focus:opacity-100 group-hover:opacity-100",children:d.jsx(tc,{size:14,"aria-hidden":!0})})})]},D.id)}),d.jsx("li",{children:d.jsx(ct,{label:o??m("sidebar.newWorkspace"),children:d.jsxs("button",{type:"button",onClick:_?void 0:i,disabled:_,"aria-label":m("sidebar.newWorkspace"),title:o??void 0,className:"ws-add ws-add--inline flex items-center justify-center gap-1.5 rounded border border-dashed px-3 py-2 text-xs font-medium text-sec transition-colors disabled:cursor-not-allowed disabled:opacity-50",style:{borderColor:"var(--border-bright)"},children:[d.jsx(As,{size:14,"aria-hidden":!0}),d.jsx("span",{className:"ws-add__label",children:m("sidebar.newWorkspace")})]})})})]}),C?null:d.jsxs("div",{className:"ws-sidebar-footer group relative",children:[d.jsxs("a",{href:U3,target:"_blank",rel:"noopener noreferrer","aria-label":m("sidebar.openDemoVideo"),title:m("sidebar.openDemoVideo"),className:"ws-sidebar-footer__link flex items-center gap-2.5 px-3 py-3 text-sm text-ter transition-colors hover:text-pri",children:[d.jsx("img",{src:"/bilibili.ico",alt:"","aria-hidden":"true",className:"h-[18px] w-[18px] rounded-[4px] object-cover",draggable:!1}),d.jsx("span",{className:"ws-sidebar-footer__label",children:m("sidebar.demoVideo")})]}),d.jsxs("a",{href:"https://github.com/tt-a1i/hive",target:"_blank",rel:"noopener noreferrer","aria-label":m("sidebar.openRepository"),title:m("sidebar.openRepository"),className:"ws-sidebar-footer__link flex items-center gap-2.5 px-3 py-3 text-sm text-ter transition-colors hover:text-pri",children:[d.jsx("svg",{width:"18",height:"18",viewBox:"0 0 16 16",fill:"currentColor","aria-hidden":"true",children:d.jsx("path",{d:"M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27.68 0 1.36.09 2 .27 1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.013 8.013 0 0016 8c0-4.42-3.58-8-8-8z"})}),d.jsx("span",{className:"ws-sidebar-footer__label",children:"GitHub"})]}),d.jsx("button",{type:"button","aria-label":m("sidebar.dismissRepository"),title:m("sidebar.dismissRepository"),onClick:T,className:"ws-sidebar-footer__dismiss absolute top-1.5 right-1.5 flex h-4 w-4 items-center justify-center rounded text-ter opacity-0 transition-opacity pointer-coarse:h-8 pointer-coarse:w-8 hover:bg-3 hover:text-pri focus:opacity-100 group-hover:opacity-100",children:d.jsx(fo,{size:10,"aria-hidden":!0})})]}),R]})},Dn=/^(\s*)-\s+\[( |x|X)\]\s+(.*)$/,P3=/(?:^|[\s\p{P}])(@[A-Za-z0-9_-]+)/gu,K3=t=>{const r=[];for(const o of t.matchAll(P3))o[1]&&r.push(o[1]);return r},F3=t=>{const r=new Map;for(const o of t){const i=o.trim();i&&r.set(i.toLowerCase(),i)}return r},WD=(t,r={})=>{const o=[],i=[],l=t.split(/\r?\n/),c=r.knownWorkerNames?F3(r.knownWorkerNames):null;for(let f=0;f<l.length;f++){const h=l[f];if(!h)continue;const g=h.match(Dn);if(!g)continue;const[,m="",y=" ",v=""]=g,k=m.replace(/\t/g," ").length,S=K3(v);let C;if(c){C=[];for(const _ of S){const j=c.get(_.slice(1).toLowerCase());j&&C.push(`@${j}`)}}else C=S;let x=v;for(const _ of C){const j=_.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");x=x.replace(new RegExp(`(?:^|(?<=\\s|\\p{P}))${j}(?!\\w)`,"u"),"")}x=x.replace(/\s+/g," ").trim();const E={checked:y.toLowerCase()==="x",children:[],indent:k,line:f,mentions:C,text:x};for(;i.length>0;){const _=i[i.length-1];if(_&&_.indent<k)break;i.pop()}const T=i[i.length-1];T?T.children.push(E):o.push(E),i.push(E)}return o},Y3=t=>{let r=0;const o=[],i=t.split(/\r?\n/);for(const l of i){if(!l)continue;const c=l.match(Dn);if(!c)continue;const[,f="",h=" "]=c,g=f.replace(/\t/g," ").length;for(;o.length>0;){const m=o[o.length-1];if(m&&m.indent<g)break;o.pop()}!o[o.length-1]&&h.toLowerCase()!=="x"&&(r+=1),o.push({indent:g})}return r},UD=t=>{if(t.children.length===0)return null;let r=0;for(const o of t.children)o.checked&&(r+=1);return{done:r,total:t.children.length}},Zs=t=>t.includes(`\r
76
+ `)?`\r
77
+ `:`
78
+ `,V3=(t,r)=>{const o=Zs(t),i=t.length>0&&!t.endsWith(`
79
+ `);return`${t}${i?o:""}- [ ] ${r}${o}`},G3=(t,r)=>{const o=t.split(/\r?\n/),i=o[r];if(i===void 0)return t;const l=i.match(Dn);if(!l)return t;const c=(l[2]??" ").toLowerCase()==="x",f=i.replace(Dn,(h,g,m,y)=>`${g}- [${c?" ":"x"}] ${y}`);return o[r]=f,o.join(Zs(t))},Zw=t=>t.replace(/\r?\n/g," ").replace(/\s+/g," ").trim(),$3=(t,r,o)=>{const i=t.split(/\r?\n/),l=i[r];if(l===void 0||!l.match(Dn))return t;const f=Zw(o);if(!f)return t;const h=l.replace(Dn,(g,m,y)=>`${m}- [${y}] ${f}`);return i[r]=h,i.join(Zs(t))},X3=(t,r)=>{const o=t.split(/\r?\n/),i=o[r];if(i===void 0)return t;const l=i.match(Dn);if(!l)return t;const c=(l[1]??"").replace(/\t/g," ").length;let f=r+1;for(;f<o.length;){const h=o[f];if(h===void 0)break;const g=h.match(Dn);if(!g||(g[1]??"").replace(/\t/g," ").length<=c)break;f+=1}return o.splice(r,f-r),o.join(Zs(t))},Z3=(t,r,o)=>{const i=Zw(o);if(!i)return t;const l=t.split(/\r?\n/),c=l[r];if(c===void 0)return t;const f=c.match(Dn);if(!f)return t;const h=f[1]??"",g=h.replace(/\t/g," ").length;let m=r+1;for(;m<l.length;){const v=l[m];if(v===void 0)break;const k=v.match(Dn);if(!k||(k[1]??"").replace(/\t/g," ").length<=g)break;m+=1}const y=`${h} `;return l.splice(m,0,`${y}- [ ] ${i}`),l.join(Zs(t))},Q3=(t,r,o)=>t===r||t===o,J3=(t,r)=>{const[o,i]=b.useState(""),[l,c]=b.useState(!1),[f,h]=b.useState(!1),[g,m]=b.useState(null),y=b.useRef(!1),v=b.useRef(""),k=b.useRef(""),S=b.useCallback((x,E)=>{if(!y.current){v.current=x,k.current=x,i(x),h(!1),m(null);return}Q3(x,v.current,E)||(m(x),h(!0))},[]);if(b.useEffect(()=>{if(!t){i(""),c(!1),h(!1),m(null),y.current=!1,v.current="",k.current="";return}let x=!1;return i(""),c(!1),h(!1),m(null),y.current=!1,v.current="",k.current="",aC(t).then(({content:E})=>{x||(v.current=E,y.current=!1,k.current=E,i(E),c(!0),h(!1),m(null))}).catch(E=>{x||(v.current="",y.current=!1,k.current="",i(""),c(!0),h(!1),console.error("[hive] swallowed:tasks.initialLoad",E),m(null))}),()=>{x=!0}},[t]),b.useEffect(()=>{if(!t)return;let x=!1,E=null,T=0,_=null;const j=()=>{if(x)return;const A=F0().openWebSocket(`/ws/tasks/${t}`);_=A,A.onmessage=R=>{if(x)return;const D=JSON.parse(String(R.data));D.type!=="tasks-snapshot"&&D.type!=="tasks-updated"||typeof D.content=="string"&&(T=0,S(D.content,k.current))},A.onclose=()=>{if(x)return;T+=1;const R=Math.min(3e4,500*2**(T-1));E=setTimeout(j,R)}};return j(),()=>{x=!0,E!==null&&(clearTimeout(E),E=null),_?.close()}},[S,t]),r!==void 0)return{content:r,hasConflict:!1,loaded:!0,onChange:x=>{},onKeepLocal:()=>{},onReload:()=>{},onSave:async()=>{},toggleTaskAtLine:async x=>{},appendTask:async x=>{},appendSubtask:async(x,E)=>{},updateTaskText:async(x,E)=>{},deleteTask:async x=>{}};const C=async(x,E)=>{if(!t)return;const T=k.current,_=x(T);if(_!==T){v.current=_,k.current=_,y.current=!1,i(_);try{const j=await hl(t,{content:_});v.current=j.content,k.current=j.content,i(j.content)}catch(j){throw v.current=T,k.current=T,i(T),console.error(`[hive] swallowed:tasks.${E}`,j),j}}};return{content:o,hasConflict:f,loaded:l,onChange:x=>{y.current=x!==v.current,k.current=x,i(x)},onKeepLocal:()=>{h(!1),m(null)},onReload:()=>{const x=g??v.current;v.current=x,y.current=!1,k.current=x,i(x),h(!1),m(null)},onSave:async()=>{if(!t)return;const x=await hl(t,{content:o});v.current=x.content,y.current=!1,k.current=x.content,i(x.content),h(!1),m(null)},toggleTaskAtLine:async x=>{if(!t)return;const E=k.current,T=G3(E,x);if(T!==E){v.current=T,k.current=T,y.current=!1,i(T);try{const _=await hl(t,{content:T});v.current=_.content,k.current=_.content,i(_.content)}catch(_){throw v.current=E,k.current=E,i(E),_}}},appendTask:async x=>{const E=x.trim();if(!t||!E)return;const T=k.current,_=V3(T,E);v.current=_,k.current=_,y.current=!1,i(_);try{const j=await hl(t,{content:_});v.current=j.content,k.current=j.content,i(j.content)}catch(j){throw v.current=T,k.current=T,i(T),j}},appendSubtask:async(x,E)=>{const T=E.trim();T&&await C(_=>Z3(_,x,T),"appendSubtask")},updateTaskText:async(x,E)=>{const T=E.trim();T&&await C(_=>$3(_,x,T),"updateTaskText")},deleteTask:async x=>{await C(E=>X3(E,x),"deleteTask")}}},eR=3e3,Qw=(t,r,o)=>{const i=new Set(t.map(c=>c.run_id)),l=new Set(t.map(c=>c.agent_id));return[...t,...r.filter(c=>i.has(c.run_id)?!1:o&&rc(c,o)?!0:!l.has(c.agent_id))]},tR=(t,r)=>{const[o,i]=b.useState({}),l=b.useRef(new Map);b.useEffect(()=>()=>{for(const m of l.current.values())window.clearTimeout(m);l.current.clear()},[]);const c=b.useCallback((m,y)=>{i(v=>({...v,[m]:(v[m]??[]).filter(k=>k.agent_id!==y)}))},[]),f=b.useCallback((m,y)=>{const v=l.current.get(y);v&&window.clearTimeout(v),l.current.delete(y),i(k=>({...k,[m]:(k[m]??[]).filter(S=>S.run_id!==y)}))},[]);b.useEffect(()=>{if(!t||r.length===0)return;const m=new Set(r.map(y=>y.run_id));i(y=>{const v=y[t]??[],k=v.filter(S=>{if(!m.has(S.run_id))return!0;const C=l.current.get(S.run_id);return C&&window.clearTimeout(C),l.current.delete(S.run_id),!1});return k.length===v.length?y:{...y,[t]:k}})},[r,t]);const h=b.useCallback(({agentId:m,agentName:y,runId:v,status:k="starting",terminalInputProfile:S="default",workspaceId:C})=>{const x={agent_id:m,agent_name:y,run_id:v,status:k,terminal_input_profile:S};i(_=>{const j=rc(x,C),A=(_[C]??[]).filter(R=>R.run_id===x.run_id?!1:j?!0:R.agent_id!==x.agent_id);return{..._,[C]:[...A,x]}});const E=l.current.get(v);E&&window.clearTimeout(E);const T=window.setTimeout(()=>{i(_=>({..._,[C]:(_[C]??[]).filter(j=>j.run_id!==v)})),l.current.delete(v)},eR);l.current.set(v,T)},[]),g=b.useMemo(()=>Qw(r,t?o[t]??[]:[],t),[r,o,t]);return{forgetOptimisticAgent:c,forgetOptimisticRun:f,optimisticRunsByWorkspaceId:o,recordOptimisticRun:h,terminalRuns:g}};let Jw=null;const qf=new Set,nR=t=>{Jw=t;for(const r of qf)r()},rR=t=>(qf.add(t),()=>qf.delete(t)),aR=()=>Jw,oR=(t=typeof window<"u"?window.matchMedia.bind(window):void 0,r=typeof navigator<"u"?navigator.standalone:void 0)=>t?.("(display-mode: standalone)").matches?!0:r===!0,sR=t=>{if(!t||!(t instanceof HTMLElement))return!1;const r=t.tagName.toLowerCase();return!!(r==="input"||r==="textarea"||r==="select"||t.isContentEditable||t.closest(".xterm"))},iR=typeof navigator<"u"&&/Mac|iPhone|iPad/.test(navigator.platform),lR=(t,r)=>r?t.metaKey:t.ctrlKey,cR=(t,r,o=iR)=>!(t.key.toLowerCase()!==r.key||(r.mod??!1)!==lR(t,o)||(r.alt??!1)!==t.altKey||(r.shift??!1)!==t.shiftKey),uR=t=>{b.useEffect(()=>{const r=o=>{if(!sR(o.target))for(const i of t){if(!cR(o,i))continue;i.handler(o)!==!1&&o.preventDefault();return}};return window.addEventListener("keydown",r),()=>window.removeEventListener("keydown",r)},[t])},dR=({bootstrapError:t,onSelectWorkspace:r,onTriggerAddDialog:o,workspaces:i})=>{const l=b.useMemo(()=>{if(!oR())return[];const c=(i??[]).slice(0,9).map((f,h)=>({key:String(h+1),mod:!0,handler:()=>r(f.id)}));return[{key:"n",mod:!0,shift:!0,handler:()=>{t||o()}},...c]},[t,r,o,i]);uR(l)},fR=1100,mR=1e3,qy="worker-card-shell--dispatch-pulse",Iy="orchestrator-pane--dispatch",pR=t=>typeof CSS<"u"&&typeof CSS.escape=="function"?CSS.escape(t):t.replace(/"/g,'\\"'),hR=(t,r)=>{const o=b.useRef(null),i=b.useRef(new Map);b.useEffect(()=>{const l=i.current;return()=>{for(const[c,f]of l)clearTimeout(f),c.classList.remove(qy,Iy);l.clear()}},[]),b.useEffect(()=>{const l=o.current;if(t===void 0){o.current=null;return}if(o.current={workspaceId:t,pendingByWorkerId:new Map(r.map(g=>[g.id,g.pendingTaskCount]))},!l||l.workspaceId!==t||typeof document>"u")return;const c=r.filter(g=>{const m=l.pendingByWorkerId.get(g.id);return m!==void 0&&g.pendingTaskCount>m});if(c.length===0)return;const f=(g,m,y)=>{g.classList.remove(m),g.offsetWidth,g.classList.add(m);const v=i.current.get(g);v&&clearTimeout(v),i.current.set(g,setTimeout(()=>{g.classList.remove(m),i.current.delete(g)},y))};for(const g of c){const m=Array.from(document.querySelectorAll(`.worker-card-shell[data-worker-name="${pR(g.name)}"]`));for(const y of m)f(y,qy,fR)}const h=document.querySelector(".orchestrator-pane-root");h&&f(h,Iy,mR)},[t,r])},gR=15e3,vR=async(t,r=gR)=>new Promise((o,i)=>{let l=!1;const c=window.setTimeout(()=>{l=!0,i(new Error("Hive runtime bootstrap timed out"))},r);t.then(f=>{l||(l=!0,window.clearTimeout(c),o(f))},f=>{l||(l=!0,window.clearTimeout(c),i(f))})}),yR=(t,r)=>r&&t.some(o=>o.id===r)?r:t[0]?.id??null,bR=(t,r)=>{if(t===null)return r;const o=new Map(t.map(i=>[i.id,i]));for(const i of r)o.set(i.id,i);return Array.from(o.values())},wR=(t,r,o)=>{b.useEffect(()=>{let i=!1;const l=G0().then(async()=>{const[c,f]=await Promise.all([OE(),BE().catch(()=>null)]);return{items:c,persistedId:f}});return vR(l).then(({items:c,persistedId:f})=>{i||t(h=>{const g=bR(h,c),m=yR(g,f);return r(m),f!==m&&X0(m).catch(y=>{console.error("[hive] swallowed:initSession.save",y)}),g})}).catch(c=>{i||(r(null),o&&o("Could not reach Hive runtime. Refresh once the runtime is back up.")),console.error("[hive] swallowed:initSession.bootstrap",c)}),()=>{i=!0}},[r,t,o])},xR=()=>{const t=b.useRef(null);return b.useCallback(r=>{if(typeof document>"u")return;const o=typeof CSS<"u"&&typeof CSS.escape=="function"?CSS.escape(r):r.replace(/"/g,'\\"'),i=document.querySelector(`[data-worker-name="${o}"]`);i&&(i.scrollIntoView({behavior:"smooth",block:"nearest",inline:"nearest"}),i.classList.add("worker-card-shell--highlight"),t.current&&clearTimeout(t.current),t.current=setTimeout(()=>{i.classList.remove("worker-card-shell--highlight"),t.current=null},1e3))},[])},kR=({onWorkspaceCreated:t,onError:r})=>{const[o,i]=b.useState({}),[l,c]=b.useState({}),f=b.useCallback((g,m)=>{i(y=>({...y,[g]:m.ok?null:m.error})),c(y=>({...y,[g]:m.ok?m.run_id:null}))},[]),h=b.useCallback(async g=>{try{const m=await LE({name:g.name,path:g.path,autostart_orchestrator:!0,command_preset_id:g.commandPresetId,startup_command:g.startupCommand??null});return f(m.id,m.orchestrator_start),t({id:m.id,name:m.name,path:m.path}),m}catch(m){const y=m instanceof Error?m.message:"Failed to create workspace";throw r?.(y),m}},[t,r,f]);return{orchestratorAutostartErrors:o,orchestratorAutostartRunIds:l,recordOrchestratorResult:f,createNewWorkspace:h}},SR=(t,r)=>{const o=t.findIndex(l=>l.id===r),i=t.filter(l=>l.id!==r);return o<0?i[0]?.id??null:i[Math.min(o,i.length-1)]?.id??null},ER=({activeWorkspaceId:t,onActiveDeleted:r,selectWorkspace:o,setWorkersByWorkspaceId:i,setWorkspaces:l,workspaces:c})=>async f=>{const g=SR(c??[],f.id);await zE(f.id),l(m=>m?.filter(y=>y.id!==f.id)??m),i(m=>{const y={...m};return delete y[f.id],y}),f.id===t&&(r(),o(g))},CR=()=>{const[t,r]=b.useState(null),o=b.useRef(Promise.resolve());return{activeWorkspaceId:t,selectWorkspace:l=>{r(l),o.current=o.current.catch(Lr("selectWorkspace.prevQueue")).then(()=>X0(l)).catch(Lr("selectWorkspace.save"))},setActiveWorkspaceId:r}},ex=500,TR=5e3,AR=5e3,_R=()=>({failureCount:0,inFlight:!1,lastSettledAt:null}),NR=(t,r)=>Math.min((r?ex:TR)*2**t,AR),jR=(t,r)=>t.length!==r.length?!1:t.every((o,i)=>{const l=r[i];return l!==void 0&&o.commandPresetId===l.commandPresetId&&o.id===l.id&&o.lastPtyLine===l.lastPtyLine&&o.name===l.name&&o.pendingTaskCount===l.pendingTaskCount&&o.role===l.role&&o.status===l.status}),Py=(t,r)=>{const o=Object.keys(t),i=Object.keys(r);return o.length!==i.length?!1:i.every(l=>Object.hasOwn(t,l)&&jR(t[l]??[],r[l]??[]))},RR=(t,r={})=>{const o=t.join("\0"),i=b.useRef(r.activeWorkspaceId),l=b.useRef(new Map),c=b.useRef(null),[f,h]=b.useState({});return i.current=r.activeWorkspaceId,b.useEffect(()=>{if(!o){h({}),l.current.clear();return}let g=!1,m;const y=o.split("\0"),v=new Set(y);for(const T of l.current.keys())v.has(T)||l.current.delete(T);h(T=>{const _={};for(const j of y)_[j]=T[j]??[];return Py(T,_)?T:_});const k=T=>{let _=l.current.get(T);return _||(_=_R(),l.current.set(T,_)),_},S=T=>i.current===T,C=T=>{const _=k(T);_.inFlight||(_.inFlight=!0,FE(T).then(j=>{g||(_.failureCount=0,h(A=>{if(!v.has(T))return A;const R={};for(const D of y)R[D]=D===T?j:A[D]??[];return Py(A,R)?A:R}))}).catch(j=>{g||(_.failureCount=Math.min(_.failureCount+1,4),console.error("[hive] swallowed:workspaceWorkers.list",j))}).finally(()=>{_.inFlight=!1,_.lastSettledAt=g?null:Date.now()}))},x=()=>{const T=Date.now();for(const _ of y){const j=k(_);if(j.inFlight)continue;if(j.lastSettledAt===null){C(_);continue}const A=NR(j.failureCount,S(_));T-j.lastSettledAt>=A&&C(_)}},E=(T=ex)=>{g||(m!==void 0&&window.clearTimeout(m),m=window.setTimeout(()=>{m=void 0,x(),E()},T))};return c.current=()=>{m!==void 0&&(window.clearTimeout(m),m=void 0),x(),E()},x(),E(),()=>{g=!0,m!==void 0&&window.clearTimeout(m),c.current&&(c.current=null)}},[o]),b.useEffect(()=>{const g=r.activeWorkspaceId;if(!g||!o.split("\0").includes(g))return;const m=l.current.get(g);m&&!m.inFlight&&(m.lastSettledAt=null,m.failureCount=0),c.current?.()},[r.activeWorkspaceId,o]),[f,h]},If="hive:terminal-visible-resize",OR=t=>new CustomEvent(If,{detail:{runId:t}}),DR="\x1B[200~",Ky="\x1B[201~",MR=(t,r)=>{const o=t.split(Ky).join("");return r?.modes?.bracketedPasteMode===!1?o:`${DR}${o}${Ky}`},LR=(t,r)=>{let o,i=!1,l=!1;const c=()=>{t.value="",t.scrollLeft=0,t.scrollTop=0},f=()=>{o!==void 0&&clearTimeout(o),o=setTimeout(()=>{o=void 0,i=!1,l=!1,r.setComposing(!1)},0)},h=C=>C.data||t.value,g=C=>C.inputType==="insertText"||C.inputType==="insertFromComposition"||C.inputType==="insertReplacementText"||C.inputType==="insertDictationResult",m=()=>{i=!0,l=!1,r.setComposing(!0)},y=()=>{i=!0,r.setComposing(!0)},v=C=>{const E=C.data||t.value;!l&&E&&r.commit(E),c(),f()},k=C=>{const x=C;if(i||x.isComposing){if(g(x)){const E=h(x);E&&(r.commit(E),l=!0),c()}return}x.defaultPrevented&&g(x)&&c()},S={capture:!0};return t.addEventListener("compositionstart",m,S),t.addEventListener("compositionupdate",y,S),t.addEventListener("compositionend",v,S),t.addEventListener("input",k,S),()=>{o!==void 0&&clearTimeout(o),t.removeEventListener("compositionstart",m,S),t.removeEventListener("compositionupdate",y,S),t.removeEventListener("compositionend",v,S),t.removeEventListener("input",k,S)}},zR=()=>typeof navigator>"u"?!1:/Mac|iPhone|iPad/.test(navigator.platform),_n={killToLineStart:"",lineStart:"",lineEnd:"",killWordBack:"\x1B",wordBack:"\x1Bb",wordForward:"\x1Bf",shiftEnter:"\x1B[13;2u"},HR=(t,r={})=>{const o=r.isMac??zR();if(t.key==="Enter"&&t.shiftKey)return t.type==="keypress"?{kind:"send",bytes:_n.shiftEnter}:{kind:"block"};if(!o&&t.type==="keydown"&&t.ctrlKey&&!t.shiftKey&&!t.altKey&&!t.metaKey&&(t.key==="c"||t.key==="C")&&r.hasSelection)return{kind:"copy"};if(!o||t.type!=="keydown")return{kind:"passthrough"};const i=t.metaKey&&!t.ctrlKey&&!t.altKey&&!t.shiftKey,l=t.altKey&&!t.metaKey&&!t.ctrlKey;if(i)switch(t.key){case"Backspace":return{kind:"send",bytes:_n.killToLineStart};case"ArrowLeft":return{kind:"send",bytes:_n.lineStart};case"ArrowRight":return{kind:"send",bytes:_n.lineEnd};case"k":case"K":return{kind:"clear"}}if(l)switch(t.key){case"Backspace":return{kind:"send",bytes:_n.killWordBack};case"ArrowLeft":return{kind:"send",bytes:_n.wordBack};case"ArrowRight":return{kind:"send",bytes:_n.wordForward}}return{kind:"passthrough"}},BR=16,WR=.3,UR={up:"A",down:"B",right:"C",left:"D"},Pf=(t,r)=>{const o=UR[r];return t?`\x1BO${o}`:`\x1B[${o}`},qR=(t,r,o)=>r==="codex"||r==="grok"||r==="opencode"?o==="up"?"\x1B[5~":"\x1B[6~":Pf(t.modes?.applicationCursorKeysMode,o),IR=t=>t==="codex"||t==="grok"||t==="opencode",tx=(t,r="default")=>{let o=0;return i=>{if(t.buffer?.active?.type!=="alternate")return o=0,{handled:!1,input:null};if(!IR(r)&&t.modes?.mouseTrackingMode&&t.modes.mouseTrackingMode!=="none")return o=0,{handled:!1,input:null};if(i.deltaY===0||i.shiftKey)return{handled:!1,input:null};let l=i.deltaY;return i.deltaMode===WheelEvent.DOM_DELTA_PIXEL?(l/=BR,Math.abs(i.deltaY)<50&&(l*=WR),o+=l,l=Math.trunc(o),o%=1):o=0,l===0?{handled:!0,input:null}:{handled:!0,input:qR(t,r,l<0?"up":"down")}}},PR=({element:t,profile:r="default",sendInput:o,terminal:i})=>{const l=tx(i,r),c=h=>{const{handled:g,input:m}=l(h);return g?(h.preventDefault(),h.stopPropagation(),m&&o(m),!1):!0};if(typeof i.attachCustomWheelEventHandler=="function")return i.attachCustomWheelEventHandler(c),()=>{};const f=h=>{c(h)||h.stopImmediatePropagation()};return t.addEventListener("wheel",f,{capture:!0,passive:!1}),()=>t.removeEventListener("wheel",f,{capture:!0})},KR=(t,r={})=>{switch(t){case"esc":return"\x1B";case"tab":return" ";case"enter":return"\r";case"arrowUp":return Pf(r.applicationCursorKeys,"up");case"arrowDown":return Pf(r.applicationCursorKeys,"down");case"arrowRight":return r.applicationCursorKeys?"\x1BOC":"\x1B[C";case"arrowLeft":return r.applicationCursorKeys?"\x1BOD":"\x1B[D";case"home":return"\x1B[H";case"end":return"\x1B[F";case"ctrlC":return"";case"ctrlD":return"";case"ctrlZ":return"";case"ctrlL":return"\f";case"ctrlR":return"";case"ctrlU":return _n.killToLineStart;case"ctrlA":return _n.lineStart;case"ctrlE":return _n.lineEnd;case"ctrlW":return""}},FR="Invalid terminal control message",YR=t=>{let r;try{r=JSON.parse(String(t))}catch{return null}if(!r||typeof r!="object")return null;const o=r;return o.type==="error"&&typeof o.message=="string"?{type:"error",message:o.message}:o.type==="exit"&&(o.code===null||typeof o.code=="number")?{type:"exit",code:o.code}:o.type==="restore"&&typeof o.snapshot=="string"?{type:"restore",snapshot:o.snapshot}:null},VR=({initialSize:t,onError:r,onExit:o,onOutput:i,onRestore:l,onClose:c,runId:f})=>{const h=crypto.randomUUID(),g={...t,clientId:h},m=F0(),y=m.openWebSocket(`/ws/terminal/${f}/io`,g),v=m.openWebSocket(`/ws/terminal/${f}/control`,g);let k=!1,S=!1,C=!1;const x=[];let E=null;const T=()=>{S||C||(C=!0,c?.())};y.onclose=T,v.onclose=T;const _=()=>{!E||v.readyState!==v.OPEN||(v.send(JSON.stringify({type:"resize",...E})),E=null)};return y.onmessage=j=>{const A=typeof j.data=="string"?j.data:"",R=D=>{v.readyState===v.OPEN&&v.send(JSON.stringify({type:"output_ack",bytes:D}))};if(!k){x.push({chunk:A,acknowledge:R});return}i(A,R)},v.onopen=()=>{_()},v.onmessage=j=>{const A=YR(j.data);if(!A){r(FR);return}if(A.type==="exit"&&o(A.code),A.type==="error"&&r(A.message),A.type==="restore"){l(A.snapshot),k=!0,v.readyState===v.OPEN&&v.send(JSON.stringify({type:"restore_complete"}));for(const R of x.splice(0))i(R.chunk,R.acknowledge)}},{dispose(){S=!0,y.close(),v.close()},resize(j,A,R,D){E={cols:j,rows:A},R!==void 0&&(E.pixelWidth=R),D!==void 0&&(E.pixelHeight=D),_()},sendBinaryInput(j){if(y.readyState!==y.OPEN)return;const A=new Uint8Array(j.length);for(let R=0;R<j.length;R++)A[R]=j.charCodeAt(R)&255;y.send(A)},sendInput(j){y.readyState===y.OPEN&&y.send(j)}}},GR=16,$R=.08,XR=.96,ZR=.025,Fy=5,QR=100,JR=8,e4=6,t4=4,n4=.5,r4=250,a4=24,o4=2,s4=".xterm-viewport",i4=".xterm-screen";function l4({element:t,profile:r="default",sendInput:o,terminal:i}){let l=null,c=0,f=0,h,g=0,m=null,y=0,v=!1,k=null,S=null,C=GR,x=0,E=0,T=null,_=[];const j=tx(i,r),A=()=>{m!==null&&(window.cancelAnimationFrame(m),m=null)},R=()=>{T!==null&&(window.cancelAnimationFrame(T),T=null)},D=()=>(k?.isConnected||(k=t.querySelector(s4)),k),L=()=>(S?.isConnected||(S=t.querySelector(i4)),S),B=()=>{const ie=D(),se=i.rows;if(!ie||!se||se<=0)return;const de=ie.clientHeight/se;de>=6&&de<=64&&(C=de)},P=()=>{const ie=L();ie&&(ie.style.transform=x!==0?`translateY(${-x}px)`:"")},te=()=>{x!==0&&(x=0,P())},ee=()=>{if(Math.abs(x)>=C/2){const ie=D();if(ie){const se=ie.scrollHeight-ie.clientHeight,de=x>0?C:-C;ie.scrollTop=Math.min(se,Math.max(0,ie.scrollTop+de))}}te()},F=ie=>{const se=D();if(!se)return"missing";const de=se.scrollHeight-se.clientHeight;if(de<=0)return te(),"stuck";const me=x+ie,Te=Math.trunc(me/C);let Ce=me-Te*C;const ke=se.scrollTop,Ze=Math.min(de,Math.max(0,ke+Te*C)),St=Ze!==ke;St&&(se.scrollTop=Ze),(Ze<=0&&me<0||Ze>=de&&me>0)&&(Ce=0);const Jt=Ce!==x;return x=Ce,Jt&&P(),St||Jt?"moved":"stuck"},Q=ie=>{c+=ie/C;const se=Math.trunc(c);return c%=1,se===0||i.scrollLines?.(se),!0},Z=(ie,se)=>{const de=[];for(let me=0;me<se;me++){const{handled:Te,input:Ce}=j({deltaMode:WheelEvent.DOM_DELTA_LINE,deltaY:ie,shiftKey:!1});if(!Te)break;Ce&&de.push(Ce)}return de.length>0&&o(de.join("")),de.length},$=ie=>{f+=ie/C;const se=Math.trunc(f);if(f%=1,se===0)return!1;const de=r==="codex"||r==="opencode"?t4:e4;return Z(se<0?-1:1,Math.min(Math.abs(se),de))>0},M=ie=>{const se=i.buffer?.active?.type;return se!==h&&(c=0,f=0,h=se,te()),se==="alternate"?{moved:$(ie),normalBuffer:!1}:{moved:F(ie)==="moved"||Q(ie),normalBuffer:!0}},K=()=>{T=null;const ie=E;E=0,ie!==0&&(v=M(ie).normalBuffer)},U=()=>{T===null&&(T=window.requestAnimationFrame(K))},I=(ie,se)=>{_.push({t:ie,y:se}),_.length>JR&&_.shift()},X=ie=>{const se=ie-QR,de=_.filter(Ze=>Ze.t>=se),me=de[0],Te=de[de.length-1];if(!me||!Te||me===Te)return 0;const Ce=Te.t-me.t;if(Ce<=0)return 0;const ke=(me.y-Te.y)/Ce;return Math.max(-Fy,Math.min(Fy,ke))};let O=0;const W=()=>{if(m=null,O===0)return;if(i.buffer?.active?.type!=="alternate"){O=0;return}const ie=O>0?1:-1,se=Math.min(Math.abs(O),o4);if(Z(ie,se)<se){O=0;return}O-=ie*se,O!==0&&(m=window.requestAnimationFrame(W))},oe=ie=>{const se=Math.min(32,Math.max(1,ie-y));y=ie;const{moved:de,normalBuffer:me}=M(g*se);if(!de||!me){m=null,c=0,g=0,ee();return}if(g*=XR**(se/16.67),Math.abs(g)<ZR){m=null,c=0,ee();return}m=window.requestAnimationFrame(oe)},ue=ie=>{A(),O=0,R(),E=0,_=[],l=ie.touches.length===1?ie.touches[0]?.clientY??null:null,l!==null&&I(ie.timeStamp,l),g=0,v=!1,D(),B()},fe=ie=>{if(l===null||ie.touches.length!==1)return;const se=ie.touches[0]?.clientY??l,de=l-se;Math.abs(de)<1||(l=se,ie.preventDefault(),E+=de,I(ie.timeStamp,se),U())},pe=ie=>{l=null,R(),K();const se=X(ie.timeStamp);if(_=[],v&&Math.abs(se)>=$R){g=se,y=performance.now(),m=window.requestAnimationFrame(oe);return}if(!v&&r!=="opencode"&&Math.abs(se)>=n4&&i.buffer?.active?.type==="alternate"){const de=Math.min(a4,Math.round(Math.abs(se)*r4/C));if(de>0){O=se>0?de:-de,m=window.requestAnimationFrame(W);return}}g=0,c=0,ee()},le=()=>{A(),O=0,R(),E=0,_=[],l=null,c=0,f=0,g=0,v=!1,te()};return t.addEventListener("touchstart",ue,{passive:!0}),t.addEventListener("touchmove",fe,{passive:!1}),t.addEventListener("touchend",pe,{passive:!0}),t.addEventListener("touchcancel",le,{passive:!0}),()=>{t.removeEventListener("touchstart",ue),t.removeEventListener("touchmove",fe),t.removeEventListener("touchend",pe),t.removeEventListener("touchcancel",le),A(),R(),te()}}const c4=(t=()=>typeof document<"u"?document.createElement("canvas"):null)=>{const r=t();if(!r||typeof r.getContext!="function")return!1;try{return!!(r.getContext("webgl2")||r.getContext("webgl"))}catch{return!1}},u4=t=>t instanceof Error&&t.message?`Terminal failed to load: ${t.message}`:"Terminal failed to load. Refresh this page and try again.",d4=new RegExp("\x1B\\[M([\\s\\S])([\\s\\S])([\\s\\S])","g"),f4=(t,r,o,i)=>{const l=r.charCodeAt(0)-32,c=o.charCodeAt(0)-32,f=i.charCodeAt(0)-32;if(l<0||c<1||f<1)return t;const g=(l&3)===3&&(l&32)===0&&(l&64)===0?"m":"M";return`\x1B[<${l};${c};${f}${g}`},m4=(t,r)=>{if(r!=="grok"&&r!=="opencode")return{binary:!0,chunk:t};const o=t.replace(d4,f4);return{binary:o===t,chunk:o}},p4=(t,r="default")=>{const o=Tt(),i=b.useRef(null),[l,c]=b.useState(null),[f,h]=b.useState("connecting"),g=b.useRef("connecting"),[m,y]=b.useState(0),v=b.useRef(null),k=b.useRef(null),S=b.useRef(!1),[C,x]=b.useState("canvas"),[E,T]=b.useState(!1),_=b.useRef(!1),j=b.useCallback(B=>{x(B);const P=i.current;P&&(P.dataset.renderer=B)},[]),A=b.useCallback(B=>{S.current||v.current?.sendInput(B)},[]),R=b.useCallback(B=>{const P=k.current?.modes?.applicationCursorKeysMode;A(KR(B,P===void 0?{}:{applicationCursorKeys:P}))},[A]),D=b.useCallback(B=>{const P=MR(B,k.current??void 0);return v.current?.sendInput(P),P},[]),L=b.useCallback(()=>{const B=()=>{k.current?.scrollToBottom();const P=i.current?.querySelector(".xterm-viewport");P&&(P.scrollTop=P.scrollHeight)};B(),window.requestAnimationFrame(()=>{B(),window.requestAnimationFrame(B)}),window.setTimeout(B,80),_.current=!1,T(!1)},[]);return b.useEffect(()=>{if(!i.current)return;let B=!1,P,te,ee,F,Q,Z,$,M,K,U,I,X=null,O,W,oe,ue,fe;c(null),g.current="connecting",h("connecting"),_.current=!1,T(!1);const pe=le=>{g.current!==le&&(g.current=le,h(le))};return Promise.all([Ct(()=>import("./xterm-B-qIQCd3.js"),[]),Ct(()=>import("./addon-fit-DX4qG4td.js"),[]),Ct(()=>import("./addon-unicode11-Bt8F3D7-.js"),[]),Ct(()=>import("./addon-clipboard-wHJhZAA4.js"),[])]).then(([le,ie,se,de])=>{if(B||!i.current)return;const me=typeof window<"u"?getComputedStyle(document.documentElement):null,Te=me?.getPropertyValue("--bg-crust").trim()||"#0e0e0e",Ce=me?.getPropertyValue("--text-primary").trim()||"#ebebeb",ke=new le.Terminal({allowProposedApi:!0,convertEol:!1,fontFamily:"'DM Mono', ui-monospace, SFMono-Regular, Menlo, monospace",fontSize:o?12:13,letterSpacing:0,lineHeight:1,scrollback:1e4,theme:{background:Te,foreground:Ce}}),Ze=new ie.FitAddon;ke.loadAddon(Ze),ke.loadAddon(new se.Unicode11Addon),ke.unicode.activeVersion="11",ke.loadAddon(new de.ClipboardAddon),ke.open(i.current),j("canvas"),Ze.fit(),Z=ke,k.current=ke,$=Ze;const St=()=>{const ce=ke.buffer.active,ye=ce.viewportY<ce.baseY;_.current!==ye&&(_.current=ye,T(ye))},Jt=()=>{ue===void 0&&(ue=window.requestAnimationFrame(()=>{ue=void 0,St()}))};W=ke.onScroll(Jt),oe=ke.buffer.onBufferChange(Jt),U=PR({element:i.current,profile:r,sendInput:ce=>Q?.sendInput(ce),terminal:ke}),o&&(I=l4({element:i.current,profile:r,sendInput:ce=>Q?.sendInput(ce),terminal:ke})),X=i.current.querySelector(".xterm-helper-textarea"),X&&(O=LR(X,{setComposing:ce=>{S.current=ce},commit:ce=>Q?.sendInput(ce)})),typeof ke.attachCustomKeyEventHandler=="function"&&ke.attachCustomKeyEventHandler(ce=>{const ye=HR(ce,{hasSelection:ke.hasSelection()});switch(ye.kind){case"send":return ce.preventDefault(),Q?.sendInput(ye.bytes),!1;case"clear":return ce.preventDefault(),ke.clear(),!1;case"copy":{ce.preventDefault();const Me=ke.getSelection();return Me&&navigator.clipboard?.writeText(Me).catch(()=>{}),ke.clearSelection(),!1}case"block":return!1;case"passthrough":return!0}});const or=()=>{const ce=i.current;return ce?.isConnected?!ce.closest('[data-terminal-host-parked="true"]'):!1},fn=()=>{if(!i.current)return{};const ce=i.current.clientWidth,ye=i.current.clientHeight,Me={};return ye>0&&(Me.pixelHeight=ye),ce>0&&(Me.pixelWidth=ce),Me},De=()=>{if(!i.current||!or())return;const ce=fn();if(!ce.pixelHeight||!ce.pixelWidth||fe&&fe.pixelHeight===ce.pixelHeight&&fe.pixelWidth===ce.pixelWidth)return;$?.fit();const ye={cols:Z?.cols??80,rows:Z?.rows??24,...fn()};fe&&fe.cols===ye.cols&&fe.rows===ye.rows&&fe.pixelHeight===ye.pixelHeight&&fe.pixelWidth===ye.pixelWidth||(fe=ye,Q?.resize(ye.cols,ye.rows,ye.pixelWidth,ye.pixelHeight))},Qe=()=>{K&&window.clearTimeout(K),K=window.setTimeout(()=>{K=void 0,De()},50)};Ct(()=>import("./addon-web-links-DIbG5aQx.js"),[]).then(ce=>{B||Z!==ke||ke.loadAddon(new ce.WebLinksAddon)}).catch(()=>{}),c4()&&Ct(()=>import("./addon-webgl-DCtw1yLn.js"),[]).then(ce=>{if(!(B||Z!==ke))try{const ye=new ce.WebglAddon;ye.onContextLoss(()=>{ye.dispose(),j("canvas")}),ke.loadAddon(ye),j("webgl"),Qe()}catch{j("canvas")}}).catch(()=>{j("canvas")}),Q=VR({initialSize:{cols:ke.cols,rows:ke.rows,...fn()},onError(ce){c(ce)},onExit(){pe("stopped")},onOutput(ce,ye){pe("running"),ke.write(ce,()=>ye(new TextEncoder().encode(ce).byteLength))},onRestore(ce){pe("running"),ke.write(ce)},onClose(){B||y(ce=>ce+1)},runId:t}),v.current=Q,F=ke.onData(ce=>{S.current||Q?.sendInput(ce)}),typeof ke.onBinary=="function"&&(ee=ke.onBinary(ce=>{const ye=m4(ce,r);ye.binary?Q?.sendBinaryInput(ye.chunk):Q?.sendInput(ye.chunk)})),De(),typeof ResizeObserver<"u"&&i.current&&(M=new ResizeObserver(Qe),M.observe(i.current)),P=ce=>{ce.detail?.runId===t&&Qe()},te=()=>Qe(),window.addEventListener(If,P),window.addEventListener("resize",te)}).catch(le=>{B||(c(u4(le)),pe("stopped"))}),()=>{B=!0,P&&window.removeEventListener(If,P),te&&window.removeEventListener("resize",te),M?.disconnect(),K&&window.clearTimeout(K),U?.(),I?.(),O?.(),ue!==void 0&&window.cancelAnimationFrame(ue),W?.dispose(),oe?.dispose(),ee?.dispose(),F?.dispose(),Q?.dispose(),Z?.dispose(),$?.dispose(),v.current=null,k.current=null}},[t,r,m]),{containerRef:i,error:l,status:f,sendInput:A,sendKey:R,beginPaste:D,renderer:C,isScrolledUp:E,scrollToBottom:L}},h4={connecting:"terminal.statusConnecting",running:"terminal.statusRunning",stopped:"common.stopped"},Kf="hive-terminal-parking-lot",g4=500,v4=t=>[`worker-pty-${t}`,`orch-pty-${t}`,`shell-pty-${t}`],y4=t=>{for(let r=t;r;r=r.parentElement){if(r.hidden||r.getAttribute("aria-hidden")==="true"||r.classList.contains("hidden"))return!0;const o=window.getComputedStyle?.(r);if(o?.display==="none"||o?.visibility==="hidden")return!0}return!1},b4=t=>{const r=Array.from(document.querySelectorAll("[data-pty-slot]")).filter(o=>o.id===t&&o.isConnected&&!y4(o));return r[r.length-1]??null},w4=()=>{let t=document.getElementById(Kf);return t||(t=document.createElement("div"),t.id=Kf,t.hidden=!0,t.style.display="none",(document.body??document.documentElement).appendChild(t)),t},ff=()=>{const t=document.getElementById(Kf);t&&t.childElementCount===0&&t.remove()},Ol=new Set;let js,Rs;const Yy=()=>{for(const t of Ol)t()},x4=()=>{js?.disconnect(),js=void 0,Rs!==void 0&&(window.clearInterval(Rs),Rs=void 0)},k4=()=>{if(js||Rs!==void 0)return;const t=document.body??document.documentElement;if(typeof MutationObserver<"u"&&t){js=new MutationObserver(Yy),js.observe(t,{attributeFilter:["aria-hidden","class","data-pty-slot","hidden","id","style"],attributes:!0,childList:!0,subtree:!0});return}Rs=window.setInterval(Yy,100)},S4=t=>(Ol.add(t),k4(),()=>{Ol.delete(t),Ol.size===0&&x4()}),E4=[50,150,300],C4=t=>{const r=[],o=[],i=()=>window.dispatchEvent(OR(t)),l=(c,f)=>{const h=window.setTimeout(()=>{const g=o.indexOf(h);g>=0&&o.splice(g,1),f()},c);o.push(h)};if(typeof window.requestAnimationFrame=="function"){const c=window.requestAnimationFrame(()=>{i();const f=window.requestAnimationFrame(i);r.push(f)});r.push(c)}else l(0,i);for(const c of E4)l(c,i);return()=>{for(const c of r)window.cancelAnimationFrame?.(c);for(const c of o)window.clearTimeout(c);r.length=0,o.length=0}},T4=t=>{const[r,o]=b.useState(null);return b.useEffect(()=>{const i=v4(t),l=()=>{for(const f of i){const h=b4(f);if(h)return h}return null},c=()=>{const f=l();o(h=>h===f?h:f)};return c(),S4(c)},[t]),r},A4=(t,r)=>{const[o,i]=b.useState(!1),[l,c]=b.useState(null),f=b.useRef(void 0),h=b.useRef(null),g=b.useRef(void 0),m=b.useCallback(()=>{f.current!==void 0&&(window.clearTimeout(f.current),f.current=void 0)},[]),y=b.useCallback(()=>{g.current?.(),g.current=void 0},[]);return b.useLayoutEffect(()=>{const v=document.createElement("div");return v.dataset.terminalHostRunId=t,v.dataset.terminalHostParked="false",v.className="h-full min-h-0 w-full min-w-0",h.current=v,c(v),()=>{m(),y(),v.remove(),h.current=null,ff()}},[m,y,t]),b.useLayoutEffect(()=>{if(r){m(),i(!0);return}if(!(!o||f.current!==void 0))return f.current=window.setTimeout(()=>{f.current=void 0,i(!1)},g4),m},[o,m,r]),b.useLayoutEffect(()=>{const v=h.current;if(!v)return;if(!o){y(),v.remove(),v.dataset.terminalHostParked="false",ff();return}const k=r??w4();if(v.parentElement===k)return;const S=v.parentElement!==null,C=document.activeElement;r||y(),!r&&C instanceof HTMLElement&&v.contains(C)&&C.blur(),v.dataset.terminalHostParked=r?"false":"true",k.appendChild(v),ff(),r&&S&&(y(),g.current=C4(t))},[o,y,t,r]),o?l:null},_4=({inputProfile:t="default",runId:r,title:o})=>{const i=T4(r),l=A4(r,i);return l?sc.createPortal(d.jsx(N4,{inputProfile:t,runId:r,title:o}),l):null},N4=({inputProfile:t,runId:r,title:o})=>{const{t:i}=Ee(),l=Tt(),{containerRef:c,error:f,status:h,isScrolledUp:g,scrollToBottom:m}=p4(r,t),y=h4[h],v=b.useCallback(()=>{c.current?.querySelector(".xterm-helper-textarea")?.blur(),m()},[c,m]);return d.jsxs("div",{className:"flex h-full min-h-0 w-full min-w-0 flex-col overflow-hidden",children:[d.jsx("p",{className:"sr-only",children:y?i(y):h}),f?d.jsx("p",{role:"alert",className:"mono shrink-0 break-words px-3 py-2 text-xs",style:{background:"color-mix(in oklab, var(--status-red) 12%, transparent)",borderBottom:"1px solid color-mix(in oklab, var(--status-red) 30%, transparent)",color:"var(--status-red)"},children:f}):null,d.jsxs("div",{className:"relative h-full min-h-0 w-full min-w-0 flex-1 overflow-hidden",children:[d.jsx("div",{"data-testid":`terminal-${r}`,ref:c,className:"bg-crust h-full min-h-0 w-full min-w-0 overflow-hidden"}),!f&&h==="connecting"?d.jsx("div",{role:"status",className:"mono pointer-events-none absolute inset-0 flex items-center justify-center px-4 text-center text-xs",style:{color:"var(--text-muted)"},children:i("terminal.statusConnecting")}):null,l&&g?d.jsx(j4,{label:i("terminal.scrollToBottom"),onJump:v}):null]})]})},j4=({label:t,onJump:r})=>{const o=b.useRef(null),i=b.useRef(Number.NEGATIVE_INFINITY),l=b.useCallback(c=>{c.preventDefault?.(),c.stopPropagation?.();const f=c.timeStamp??performance.now();f-i.current<250||(i.current=f,r())},[r]);return b.useEffect(()=>{const c=o.current;if(!c)return;const f=h=>{h.cancelable&&h.preventDefault(),h.stopImmediatePropagation(),l(h)};return c.addEventListener("touchstart",f,{capture:!0,passive:!1}),c.addEventListener("pointerdown",f,{capture:!0}),c.addEventListener("mousedown",f,{capture:!0}),()=>{c.removeEventListener("touchstart",f,{capture:!0}),c.removeEventListener("pointerdown",f,{capture:!0}),c.removeEventListener("mousedown",f,{capture:!0})}},[l]),d.jsx("button",{ref:o,type:"button","aria-label":t,className:"icon-btn icon-btn--primary mobile-terminal-jump-button absolute bottom-2 left-1/2 -translate-x-1/2",tabIndex:-1,onClick:l,onFocus:c=>c.currentTarget.blur(),children:t})},R4=({hidden:t=!1,optimisticRuns:r=[],terminalRuns:o,workspaceId:i})=>{const{t:l}=Ee(),c=Qw(o,r,i);return d.jsx("section",{hidden:t,"aria-hidden":t||void 0,"aria-label":l("terminalPanels.aria"),children:c.map(f=>d.jsx(_4,{inputProfile:f.terminal_input_profile??"default",runId:f.run_id,title:`${f.agent_name} (${f.status})`},f.run_id))})},O4=[{version:"2.1.0",date:"2026-06-13",en:["New Sentinel role: a read-only patrol member that watches the team and flags stalled or orphaned work, without taking dispatches or editing memory itself.","One-click scenario team assembly — spin up a ready-made team from a preset instead of adding members one by one.",'Team memory "Dream" consolidation now runs through your Orchestrator where you can see and review it, instead of a hidden background pass. Workers can be asked to review proposed changes, but only the Orchestrator commits them — and every run can be reverted in one step.',"Action Center adds a one-click copyable team recap and a diagnostics bundle, so sharing status and getting support is faster.","Dispatch pulse: a team send now visibly flows from the Orchestrator to the worker, so you can watch work being handed off.","The add-workspace dialog now guides you to install any missing CLI before you start.","More reliable dispatching: queued tasks replay when a worker starts, delivery failures notify the issuer instead of being lost, and team list shows open dispatches.","Remote/mobile fixes: large uploads over the tunnel no longer fail, and terminal scrolling is restored for CLIs launched through wrapper or legacy commands (such as Codex on Windows).","Hardened prompts and workflow runtime against prompt-injection, with clearer protocol errors and onboarding."],zh:["新增 Sentinel 巡检角色:只读巡检成员,盯团队进度、提示停滞或孤儿任务,自己不接派单、不改记忆。","一键场景组队:从预设模板直接拉起一支现成团队,不用逐个添加成员。","团队记忆 Dream 整理改为经由 Orchestrator 执行,你能看到也能复核,不再后台静默处理。可让 worker 协助评审建议,但只有 Orchestrator 能提交,且每次整理都可一键回滚。","活动中心新增一键复制团队战报与诊断信息包,分享状态、寻求支持更快。","派单脉冲:team send 现在会从蜂后可视化地流向工蜂,派单交接一目了然。","添加 workspace 时,若缺少对应 CLI 会引导你先安装。","派单更可靠:worker 启动时重放排队任务、投递失败会通知发起方而不再丢失、team list 会列出未完成派单。","远程/移动端修复:隧道大文件上传不再失败;经包装或旧版命令启动的 CLI(如 Windows 上的 Codex)终端滚动已恢复。","强化了提示词与 workflow 运行时对提示注入的防护,协议报错与新手引导更清晰。"]},{version:"2.0.2",date:"2026-06-10",en:["Windows Codex terminals now keep the Codex-specific wheel scrolling behavior even when an older saved launch command points through node.exe and @openai/codex/bin/codex.js."],zh:["Windows 上的 Codex 终端滚轮修复:即使旧配置还通过 node.exe 和 @openai/codex/bin/codex.js 启动,Hive 也会继续使用 Codex 专用的滚轮翻页行为。"]},{version:"2.0.1",date:"2026-06-09",en:["Team memory is now available: Hive can keep useful workspace context and bring back prior decisions, constraints, and project notes when your team needs them.","The Memory and Workflows drawers have cleaner desktop and mobile layouts, clearer tabs, and a search field that stays out of the way on wide screens.","Worker cards are easier to scan, with clearer status styling, higher contrast, cleaner role text, and in-place rename instead of a separate edit dialog.","Pending dispatch status is clearer while the Orchestrator is coordinating queued or waiting worker activity.","The current remote/mobile build is now published under the original official @tt-a1i/hive package name."],zh:["团队记忆上线:Hive 可以保留有用的 workspace 上下文,并在团队需要时重新带回之前的决策、约束和项目笔记。","Memory 和 Workflows 抽屉做了桌面端与移动端布局优化,tab 更清楚,宽屏上的搜索框也更不挡内容。","Worker 卡片更容易扫读:状态样式更清晰、对比度更高、角色文字更干净,并改成卡片内直接重命名。","Orchestrator 协调排队或等待中的 worker 活动时,pending dispatch 状态显示更明确。","当前远程访问和移动端构建已通过原来的官方 @tt-a1i/hive 包名发布。"]},{version:"2.0.0",date:"2026-06-07",en:["Remote access is here, off by default: open your running Hive from a phone browser over an end-to-end encrypted tunnel, with the same authority as your local desktop browser.","The new gateway handles identity and routing only. It supports GitHub/Google sign-in, version-pinned mobile bundles, and self-hosting; your agents, terminals, workspaces, and project data stay on your computer.","Pairing is desktop-confirmed: create a short-lived pairing code on the computer, enter it on the phone, compare the 6-digit SAS code on both screens, then confirm on the desktop before the device is trusted.","Manage paired devices from Settings or the CLI: list devices, revoke one, drop a live remote session, and review the audit trail for remote requests and denials.","New CLI commands: hive remote login / status / logout / devices / revoke link the machine to a gateway account and manage trusted devices from the host.","The phone UI is the same Hive reflowed for a small screen: sign-in and machine selection, bottom navigation, workspace switching, full-screen Team / Tasks panels, reconnect banners, and update prompts.","Mobile terminals are writable directly in xterm. Worker terminals open full-screen, focus mode hides surrounding chrome while you work, and touch scrolling is smoother for shell output and faster in full-screen TUI agents.","Local-first behavior stays intact: Hive still works on 127.0.0.1 without any gateway, the tunnel is limited to Hive /api/* and /ws/*, and phones cannot approve new devices or turn Remote access back on."],zh:["远程访问上线,默认关闭:用手机浏览器通过端到端加密隧道打开正在本机运行的 Hive,权限与本地桌面浏览器等同。","新网关只做身份和路由:支持 GitHub / Google 登录、按版本固定的手机端 bundle、以及 self-host;Agent、终端、Workspace 和项目数据都留在你的电脑上。","配对必须由桌面确认:电脑生成短时配对码,手机输入后,两边显示同一个 6 位 SAS 短码;只有在电脑上确认后,新设备才会被信任。","可以在 Settings 或 CLI 里管理已配对设备:查看列表、吊销设备、立即断开正在连接的远程会话,并查看远程请求和拒绝记录的审计流水。","新增 CLI:hive remote login / status / logout / devices / revoke,可在本机完成网关联动和受信设备管理。","手机 UI 是同一个 Hive 的小屏重排:登录与机器选择、底部导航、Workspace 切换、全屏 Team / Tasks 面板、重连提示和更新提示。","移动端终端可以直接在 xterm 里输入。成员终端全屏打开,focus mode 会隐藏周边 chrome;shell 输出滚动更顺,全屏 TUI agent 里的触摸滚动也更跟手。","本地优先不变:没有网关时 Hive 仍照常运行在 127.0.0.1;隧道只允许访问 Hive 自己的 /api/* 和 /ws/*;手机不能批准新设备,也不能在关闭远程后自行重新开启。"]},{version:"1.7.0",date:"2026-06-05",en:["Hermes is now a built-in CLI agent preset alongside Claude Code, Codex, OpenCode, and Gemini — usable as Orchestrator or Worker, via team spawn --cli hermes, and in workflows.","Hermes sessions survive crashes: Hive captures the session id from the CLI startup output and resumes with --resume on restart.","Existing installs get the new preset automatically — just have hermes on your PATH."],zh:["Hermes 成为第五个内置 CLI agent preset,与 Claude Code、Codex、OpenCode、Gemini 并列 —— 可当 Orchestrator 或 Worker,支持 team spawn --cli hermes 和 workflow。","Hermes 会话可在崩溃后恢复:Hive 从 CLI 启动输出捕获 session id,重启时用 --resume 续上。","已有安装会自动获得新 preset —— 只要 PATH 里有 hermes 即可。"]},{version:"1.6.0",date:"2026-06-02",en:["A Stop button on the running Orchestrator lets you halt a runaway agent straight from the UI.","Worker cards now show queue depth and the latest activity line, and the working badge explains that Hive does not auto-detect stalls — check the terminal.","Worker reports are no longer lost when the Orchestrator is down or restarting; they are queued and redelivered automatically.","Deliberately stopping and restarting the Orchestrator no longer replays a stale crash-recovery handover.","A new completion webhook can POST to a URL you choose (Slack, ntfy, Feishu, …) when a worker reports or a workflow finishes.","Workflow agent() gains opt-in structured output via outputSchema, and the new team next lists tasks unblocked by [needs:] dependencies in tasks.md."],zh:["运行中的 Orchestrator 面板新增 Stop 按钮,可以直接在 UI 里停掉跑飞的 agent。","Worker 卡片现在显示队列数和最近活动行;working 状态会说明 Hive 不会自动检测卡死 —— 以终端为准。","Orchestrator 掉线或重启时,Worker 的汇报不再丢失,会自动排队并补投。","手动停止后再重启 Orchestrator,不会再灌入陈旧的崩溃恢复接管。","新增完成通知 Webhook:Worker 汇报或 Workflow 完成时,向你设置的 URL POST(可接 Slack、ntfy、飞书等)。","Workflow 的 agent() 支持 outputSchema 结构化输出;新增 team next 可列出 tasks.md 里被 [needs:] 解除阻塞、当前可做的任务。"]},{version:"1.5.0",date:"2026-05-31",en:["Experimental Workflows let the Orchestrator run multi-agent plans across real Hive workers, with run details, logs, stop controls, and schedules in the Workflows drawer.","Workflow-created agents can now follow your selected default CLI and allowed CLI policy instead of always falling back to Claude Code.","Experimental auto-staff can let the Orchestrator size the worker roster to the task and create task-scoped coders, testers, or reviewers.","Codex dispatches stay reliable for long pasted tasks, while short worker reports now submit quickly instead of waiting several seconds in the input box.","Runtime hardening covers malformed WebSocket frames, Windows Codex startup paths, and workflow worker cleanup edge cases."],zh:["实验性的 Workflows 可以让 Orchestrator 用真实 Hive Worker 执行多 Agent 计划,并在 Workflows 抽屉里查看详情、日志、停止控制和定时任务。","Workflow 创建的 Agent 现在会遵守你选择的默认 CLI 和允许列表,不再总是回退到 Claude Code。","实验性的自动组队可以让 Orchestrator 按任务规模创建临时 coder、tester 或 reviewer。","Codex 的长任务粘贴仍保持可靠;短的 Worker 汇报现在会快速提交,不再在输入框里等好几秒。","运行时加固覆盖了异常 WebSocket 帧、Windows Codex 启动路径和 Workflow Worker 清理等边界情况。"]},{version:"1.4.4",date:"2026-05-30",en:["Windows .cmd and .bat startup commands now launch reliably, including quoted nvm4w and Program Files paths.","Worker shutdown is more robust on Windows, with process-tree cleanup before PTY termination.","Folder picking, filesystem browsing, editor launch, hive update, and port recovery are friendlier on Windows.","Task files keep CRLF line endings, and the watcher handles atomic-save editors more gracefully."],zh:["Windows 上的 .cmd / .bat 启动命令更可靠,包括带引号的 nvm4w 和 Program Files 路径。","Windows 下 Worker 关闭更稳,会先清理进程树再终止 PTY。","文件夹选择、文件浏览、编辑器打开、hive update 和端口占用恢复在 Windows 上更顺手。","任务文件会保留 CRLF 换行,watcher 对原子保存编辑器也更宽容。"]}],Vy=t=>{const[r="",o=""]=t.split("-",2),[i=0,l=0,c=0]=r.split(".").map(f=>Number.parseInt(f,10)||0);return{core:[i,l,c],prerelease:o}},mf=(t,r)=>{const o=Vy(t),i=Vy(r);for(let l=0;l<3;l+=1){const c=(o.core[l]??0)-(i.core[l]??0);if(c!==0)return c}return o.prerelease===i.prerelease?0:o.prerelease?i.prerelease?o.prerelease.localeCompare(i.prerelease,void 0,{numeric:!0}):-1:1},D4=(t,r,o=O4)=>{if(r===null)return{show:!1,entries:[],seedOnly:!0};if(mf(t,r)<=0)return{show:!1,entries:[],seedOnly:!1};const i=o.filter(l=>mf(l.version,r)>0&&mf(l.version,t)<=0);return i.length===0?{show:!1,entries:[],seedOnly:!0}:{show:!0,entries:i,seedOnly:!1}},nx="hive.last-seen-version",M4="1.7.0",L4=(t,r)=>{try{const o=window.localStorage.getItem(nx);return o||(r?M4:null)}catch{return t}},Gy=t=>{try{window.localStorage.setItem(nx,t)}catch{}},z4=({hasExistingWorkspace:t,wizardOpen:r})=>{const o=Yw,[i,l]=b.useState(void 0);b.useEffect(()=>{i!==void 0||t===null||l(L4(o,t))},[t,i]);const c=b.useMemo(()=>i===void 0?{show:!1,entries:[],seedOnly:!1}:D4(o,i),[i]),[f,h]=b.useState(!1);b.useEffect(()=>{c.seedOnly&&Gy(o)},[c.seedOnly]);const g=b.useCallback(()=>{Gy(o),h(!0)},[]);return{open:c.show&&!f&&!r,entries:c.entries,close:g}},$y="hive.first-run-seen",H4=()=>{const[t,r]=b.useState(()=>{try{return window.localStorage.getItem($y)==="1"}catch{return!0}}),o=b.useCallback(()=>{try{window.localStorage.setItem($y,"1")}catch{}r(!0)},[]);return{seen:t,markSeen:o}},B4=t=>{const{seen:r,markSeen:o}=H4(),[i,l]=b.useState(!1);b.useEffect(()=>{!r&&t!==null&&t.length===0&&l(!0)},[r,t]);const c=b.useCallback((f=!0)=>{f&&o(),l(!1)},[o]);return{wizardOpen:i,closeWizard:c}},W4=(t,r)=>t.findIndex(i=>i.id===r.id)===-1?[...t,r]:t.map(i=>i.id===r.id?r:i),rx=t=>t==="codex"?"codex":t==="grok"?"grok":t==="opencode"?"opencode":"default",Xy=(t,r)=>rx(t.find(o=>o.id===r)?.commandPresetId),U4=({activeWorkspaceId:t,onWorkerDeleted:r,onWorkerRunStarted:o,setWorkersByWorkspaceId:i,workers:l})=>{const c=b.useCallback(async({commandPresetId:y,name:v,role:k,roleDescription:S,startupCommand:C})=>{if(!t)return{error:"No active workspace",runId:null};const x=C.trim(),E=await eC(t,{autostart:!0,command_preset_id:y||null,description:S.trim(),name:v,role:k,startup_command:x||null});return i(T=>({...T,[t]:W4(T[t]??[],E.worker)})),E.agentStart.ok&&E.agentStart.runId&&o?.({agentId:E.worker.id,agentName:E.worker.name,runId:E.agentStart.runId,terminalInputProfile:rx(y),workspaceId:t}),{error:E.agentStart.ok?null:E.agentStart.error,runId:E.agentStart.ok?E.agentStart.runId:null}},[t,o,i]),f=b.useCallback(async y=>{if(!t)throw new Error("No active workspace");await nC(t,y),i(v=>({...v,[t]:(v[t]??[]).filter(k=>k.id!==y)})),r?.(t,y)},[t,r,i]),h=b.useCallback(async y=>{if(!t)return{error:"No active workspace",runId:null};try{const v=await zl(t,y);return o?.({agentId:y,agentName:y,runId:v.runId,terminalInputProfile:Xy(l,y),workspaceId:t}),{error:null,runId:v.runId}}catch(v){return{error:v instanceof Error?v.message:String(v),runId:null}}},[t,o,l]),g=b.useCallback(async y=>{try{return await Hl(y),{error:null}}catch(v){return{error:v instanceof Error?v.message:String(v)}}},[]),m=b.useCallback(async(y,v)=>{if(!t)return{error:"No active workspace",runId:null};try{const k=await HE(t,y,v);return o?.({agentId:y,agentName:y,runId:k.runId,terminalInputProfile:Xy(l,y),workspaceId:t}),{error:null,runId:k.runId}}catch(k){return{error:k instanceof Error?k.message:String(k),runId:null}}},[t,o,l]);return{createWorker:c,deleteWorker:f,startWorker:h,stopWorkerRun:g,restartWorkerRun:m}},Nm={mac:["vscode","vscode-insiders","cursor","finder","terminal","ghostty","zed"],windows:["vscode","vscode-insiders","cursor","finder","zed"],linux:["vscode","vscode-insiders","cursor","finder","zed"],other:["vscode","vscode-insiders","finder"]},q4=new Set(Nm.mac),I4=t=>typeof t=="string"&&q4.has(t),ax=(t,r)=>Nm[r].includes(t),ox=t=>t==="mac"||t==="windows"||t==="linux"?"finder":"vscode",P4="data:image/svg+xml,%3csvg%20viewBox='0%200%2024%2024'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20fill='%23FFFFFF'%20d='M11.503.131%201.891%205.678a.84.84%200%200%200-.42.726v11.188c0%20.3.162.575.42.724l9.609%205.55a1%201%200%200%200%20.998%200l9.61-5.55a.84.84%200%200%200%20.42-.724V6.404a.84.84%200%200%200-.42-.726L12.497.131a1.01%201.01%200%200%200-.996%200M2.657%206.338h18.55c.263%200%20.43.287.297.515L12.23%2022.918c-.062.107-.229.064-.229-.06V12.335a.59.59%200%200%200-.295-.51l-9.11-5.257c-.109-.063-.064-.23.061-.23'/%3e%3c/svg%3e",pf="data:image/svg+xml,%3csvg%20width='64'%20height='64'%20viewBox='0%200%2064%2064'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3crect%20x='5'%20y='13'%20width='54'%20height='40'%20rx='8'%20fill='%23F2B73B'/%3e%3cpath%20d='M5%2021C5%2016.58%208.58%2013%2013%2013H25.2C27.2%2013%2029.1%2013.94%2030.3%2015.54L33.2%2019.4H51C55.42%2019.4%2059%2022.98%2059%2027.4V31H5V21Z'%20fill='%23FFD565'/%3e%3cpath%20d='M8%2027H56C58.76%2027%2061%2029.24%2061%2032V49C61%2051.76%2058.76%2054%2056%2054H8C5.24%2054%203%2051.76%203%2049V32C3%2029.24%205.24%2027%208%2027Z'%20fill='%23F8C344'/%3e%3cpath%20d='M8%2032C8%2030.9%208.9%2030%2010%2030H54C55.1%2030%2056%2030.9%2056%2032V48C56%2049.1%2055.1%2050%2054%2050H10C8.9%2050%208%2049.1%208%2048V32Z'%20fill='%23F4B43B'/%3e%3cpath%20d='M10%2031H54C55.1%2031%2056%2031.9%2056%2033V36H8V33C8%2031.9%208.9%2031%2010%2031Z'%20fill='%23FFE082'/%3e%3cpath%20d='M12%2037H52C53.1%2037%2054%2037.9%2054%2039V47C54%2048.1%2053.1%2049%2052%2049H12C10.9%2049%2010%2048.1%2010%2047V39C10%2037.9%2010.9%2037%2012%2037Z'%20fill='%23F0A82F'/%3e%3c/svg%3e",sx="/assets/finder-C4Jmsb0B.png",K4="/assets/ghostty-D-Js4rdm.png",F4="data:image/svg+xml,%3csvg%20viewBox='0%200%2024%2024'%20xmlns='http://www.w3.org/2000/svg'%3e%3crect%20width='24'%20height='24'%20rx='4'%20fill='%232D2D2E'/%3e%3cpath%20d='M6.5%209%20L10%2012%20L6.5%2015'%20stroke='%23FFFFFF'%20stroke-width='1.7'%20fill='none'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3cline%20x1='12.5'%20y1='15.5'%20x2='17.5'%20y2='15.5'%20stroke='%23FFFFFF'%20stroke-width='1.7'%20stroke-linecap='round'/%3e%3c/svg%3e",Y4="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%3e%3cpath%20fill='%23007ACC'%20d='M22%205.75v12.48c0%20.49-.28.94-.72%201.15-.91.43-2.46%201.18-3.33%201.59.03-.16.05-.33.05-.5V3.53C18%203.3%2017.97%203.12%2017.94%203c.94.46%202.44%201.18%203.33%201.6C21.72%204.81%2022%205.26%2022%205.75zM3.91%2013.35c.89.8%201.73%201.56%202.51%202.28l-1.48%201.12c-.37.28-.89.27-1.25-.03l-.94-.79c-.46-.39-.48-1.09-.03-1.5C3.05%2014.13%203.46%2013.76%203.91%2013.35zM16%203.53v4.81l-3.16%202.4-3.3-2.5c2.29-2.07%204.46-4.05%205.59-5.1.23-.22.56-.16.74.04.05.06.09.13.11.22C15.99%203.44%2016%203.48%2016%203.53zM16%2020.47v-4.81L4.938%207.252c-.372-.283-.889-.27-1.247.03L2.754%208.066C2.289%208.456%202.271%209.162%202.72%209.569c2.747%202.488%209.998%209.06%2012.41%2011.291C15.462%2021.167%2016%2020.93%2016%2020.47z'/%3e%3c/svg%3e",V4="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%3e%3cpath%20fill='%2324BFA5'%20d='M22%205.75v12.48c0%20.49-.28.94-.72%201.15-.91.43-2.46%201.18-3.33%201.59.03-.16.05-.33.05-.5V3.53C18%203.3%2017.97%203.12%2017.94%203c.94.46%202.44%201.18%203.33%201.6C21.72%204.81%2022%205.26%2022%205.75zM3.91%2013.35c.89.8%201.73%201.56%202.51%202.28l-1.48%201.12c-.37.28-.89.27-1.25-.03l-.94-.79c-.46-.39-.48-1.09-.03-1.5C3.05%2014.13%203.46%2013.76%203.91%2013.35zM16%203.53v4.81l-3.16%202.4-3.3-2.5c2.29-2.07%204.46-4.05%205.59-5.1.23-.22.56-.16.74.04.05.06.09.13.11.22C15.99%203.44%2016%203.48%2016%203.53zM16%2020.47v-4.81L4.938%207.252c-.372-.283-.889-.27-1.247.03L2.754%208.066C2.289%208.456%202.271%209.162%202.72%209.569c2.747%202.488%209.998%209.06%2012.41%2011.291C15.462%2021.167%2016%2020.93%2016%2020.47z'/%3e%3c/svg%3e",G4="/assets/zed-C5BQT8X3.png",$4={mac:"openWorkspace.target.finder.mac",windows:"openWorkspace.target.finder.windows",linux:"openWorkspace.target.finder.linux",other:"openWorkspace.target.finder.linux"},X4={mac:sx,windows:pf,linux:pf,other:pf},gc={vscode:{labelKey:"openWorkspace.target.vscode",iconSrc:Y4},"vscode-insiders":{labelKey:"openWorkspace.target.vscodeInsiders",iconSrc:V4},cursor:{labelKey:"openWorkspace.target.cursor",iconSrc:P4},finder:{labelKey:"openWorkspace.target.finder.mac",iconSrc:sx},terminal:{labelKey:"openWorkspace.target.terminal",iconSrc:F4},ghostty:{labelKey:"openWorkspace.target.ghostty",iconSrc:K4,iconScale:1.2},zed:{labelKey:"openWorkspace.target.zed",iconSrc:G4}},ix=(t,r)=>t==="finder"?$4[r]:gc[t].labelKey,lx=(t,r)=>t==="finder"?X4[r]:gc[t].iconSrc,hf=(t,r)=>{const o=ax(t,r)?t:ox(r),i=gc[o];return{id:o,iconSrc:lx(o,r),labelKey:ix(o,r),...i.iconScale!==void 0?{iconScale:i.iconScale}:{}}},Z4=t=>Nm[t].map(r=>{const o=gc[r];return{id:r,iconSrc:lx(r,t),labelKey:ix(r,t),...o.iconScale!==void 0?{iconScale:o.iconScale}:{}}}),Q4=()=>{if(typeof navigator>"u")return"other";const t=`${navigator.userAgent} ${navigator.platform}`.toLowerCase();return t.includes("mac")||t.includes("darwin")?"mac":t.includes("win")?"windows":t.includes("linux")||t.includes("x11")?"linux":"other"},cx="hive.openTarget.preferred",J4=()=>{try{return window.localStorage.getItem(cx)}catch{return null}},e5=t=>{const r=ox(t);if(typeof window>"u")return r;const o=J4();if(!o)return r;const i=o==="ghostie"?"ghostty":o;return I4(i)&&ax(i,t)?i:r},t5=t=>{try{window.localStorage.setItem(cx,t)}catch{}},n5={"app-not-installed":"openWorkspace.error.appNotInstalled","command-not-in-path":"openWorkspace.error.commandNotInPath","invalid-path":"openWorkspace.error.invalidPath","invalid-target":"openWorkspace.error.invalidTarget",unknown:"openWorkspace.error.unknown"},r5=({workspace:t})=>{const{t:r}=Ee(),{mode:o}=lb(),i=Qt(),l=b.useMemo(()=>Q4(),[]),c=Z4(l),[f,h]=b.useState(()=>e5(l)),[g,m]=b.useState(!1),[y,v]=b.useState(!1),k=b.useRef(null),S=b.useRef(null),C=hf(f,l),x=r(C.labelKey);b.useEffect(()=>{if(!g)return;const D=B=>{B.key==="Escape"&&m(!1)},L=B=>{const P=k.current;P&&!P.contains(B.target)&&m(!1)};return document.addEventListener("keydown",D),document.addEventListener("pointerdown",L),()=>{document.removeEventListener("keydown",D),document.removeEventListener("pointerdown",L)}},[g]);const E=b.useCallback(D=>{h(D),t5(D),m(!1),S.current?.focus()},[]),T=b.useCallback(async()=>{if(!(!t||y)){v(!0);try{const D=await oC(t.id,f);if(D.ok){if(o==="mobile"){const L=hf(D.effectiveTargetId,l).labelKey;i.show({kind:"success",message:r("openWorkspace.opened",{app:r(L),workspace:t.name})})}}else{const L=hf(D.effectiveTargetId,l).labelKey;i.show({kind:"error",message:r(n5[D.errorCode],{app:r(L)})})}}catch(D){const L=D instanceof Error?D.message:String(D);i.show({kind:"error",message:L})}finally{v(!1)}}},[y,o,l,f,r,i,t]),_=!t,j=r("openWorkspace.noWorkspace"),A=t?r("openWorkspace.openIn",{app:x,workspace:t.name}):j,R=t?r("openWorkspace.openInAria",{app:x,workspace:t.name}):j;return d.jsxs("div",{ref:k,className:"open-workspace relative flex",children:[d.jsx(ct,{label:A,children:d.jsx("span",{className:"flex",children:d.jsxs("button",{ref:S,type:"button","aria-label":R,"data-testid":"topbar-open-workspace",disabled:_||y,onClick:()=>{T()},className:"open-workspace__main",children:[d.jsx("span",{className:"open-workspace__trigger-icon","aria-hidden":!0,children:y?d.jsx(xo,{size:13,className:"animate-spin"}):d.jsx("img",{src:C.iconSrc,alt:"",className:"open-workspace__trigger-img",style:{transform:C.iconScale?`scale(${C.iconScale})`:void 0}})}),d.jsx("span",{children:r("openWorkspace.open")})]})})}),d.jsx(ct,{label:r("openWorkspace.selectTarget"),children:d.jsx("button",{type:"button","aria-label":r("openWorkspace.selectTarget"),"aria-haspopup":"menu","aria-expanded":g,"data-testid":"topbar-open-workspace-chevron",disabled:_,onClick:()=>m(D=>!D),className:"open-workspace__chevron",children:d.jsx(wo,{size:12,"aria-hidden":!0})})}),g?d.jsx("div",{role:"menu","aria-label":r("openWorkspace.selectTarget"),className:"open-workspace__menu elev-2","data-testid":"topbar-open-workspace-menu",children:c.map(D=>{const L=D.id===f;return d.jsxs("button",{role:"menuitemradio","aria-checked":L,type:"button",onClick:()=>E(D.id),className:"open-workspace__option","data-selected":L?"true":void 0,"data-testid":`topbar-open-workspace-option-${D.id}`,children:[d.jsx("span",{className:"open-workspace__option-icon","aria-hidden":!0,children:d.jsx("img",{src:D.iconSrc,alt:"",className:"open-workspace__option-img",style:{transform:D.iconScale?`scale(${D.iconScale})`:void 0}})}),d.jsx("span",{className:"flex-1",children:r(D.labelKey)}),d.jsx("span",{className:"open-workspace__check","aria-hidden":!0,children:L?d.jsx(bo,{size:13}):null})]},D.id)})}):null]})},a5=b.lazy(()=>Ct(()=>import("./WorkflowsDrawer-BXS3w9Uq.js"),__vite__mapDeps([5,4])).then(t=>({default:t.WorkflowsDrawer}))),o5=b.lazy(()=>Ct(()=>import("./WorkspaceMemoryDrawer-D71ivohr.js"),__vite__mapDeps([6,3])).then(t=>({default:t.WorkspaceMemoryDrawer}))),s5=()=>{const[t,r]=b.useState(null),{activeWorkspaceId:o,selectWorkspace:i,setActiveWorkspaceId:l}=CR(),{demoMode:c,enableDemo:f,exitDemo:h}=Aj(),g=c||!t?[]:t.map(({id:De})=>De),[m,y]=RR(g,{activeWorkspaceId:o}),[v,k]=b.useState(0),[S,C]=b.useState(!1),[x,E]=b.useState(!1),[T,_]=b.useState(!1),[j,A]=b.useState("team"),R=e3(),D=Qt(),{wizardOpen:L,closeWizard:B}=B4(t),P=z4({hasExistingWorkspace:t===null?null:t.length>0,wizardOpen:L}),ee=Pw().enabled;b.useEffect(()=>{ee||(_(!1),A(De=>De==="flows"?"team":De))},[ee]);const F=b.useCallback(()=>k(De=>De+1),[]),[Q,Z]=b.useState(null),$=b.useCallback(De=>{Z(De),D.show({kind:"error",message:De})},[D]);wR(r,l,$);const M=kR({onWorkspaceCreated:De=>{r(Qe=>Qe===null?[De]:[...Qe,De]),i(De.id),y(Qe=>({...Qe,[De.id]:[]}))},onError:De=>D.show({kind:"error",message:De})}),U=_j({demoMode:c,workspaces:t,activeWorkspaceId:o,workersByWorkspaceId:m}),I=U.effectiveActiveWorkspace?.id,X=I?U.effectiveWorkersByWorkspaceId[I]??[]:[],O=tR(U.pollWorkspaceId,T_(U.pollWorkspaceId));T3(!0);const W=J3(c?null:o??null,c?Tj:void 0),oe=b.useMemo(()=>U.effectiveActiveWorkspace?Y3(W.content):0,[U.effectiveActiveWorkspace,W.content]),ue=U4({activeWorkspaceId:o,onWorkerDeleted:O.forgetOptimisticAgent,onWorkerRunStarted:O.recordOptimisticRun,setWorkersByWorkspaceId:y,workers:X}),fe=ER({activeWorkspaceId:o,onActiveDeleted:()=>{E(!1),C(!1),_(!1)},selectWorkspace:i,setWorkersByWorkspaceId:y,setWorkspaces:r,workspaces:t});dR({bootstrapError:Q,onSelectWorkspace:i,onTriggerAddDialog:F,workspaces:U.effectiveWorkspaces}),z3({onAddWorkspace:F,onTryDemo:f,ready:c||t!==null||Q!==null});const pe=xR();hR(I,X);const le=Q!==null&&!c&&t===null,ie=Tt(),se=b.useSyncExternalStore(rR,aR),de=ie?d.jsx(r3,{status:se}):null,me=I?O.optimisticRunsByWorkspaceId[I]??[]:[],Ce=!le&&!c&&I!==void 0&&(O.terminalRuns.length>0||me.length>0)?d.jsx(R4,{optimisticRuns:me,terminalRuns:O.terminalRuns,workspaceId:I},`terminal-${I}`):null,ke=le?d.jsx(_3,{onTryDemo:f}):d.jsx(Ej,{activeId:I,activeWorkspace:U.effectiveActiveWorkspace,bootstrapError:Q,demoMode:c,workspacesLoading:!c&&t===null,onDeleteWorkspace:fe,onExitDemo:h,onRequestAddWorkspace:F,onShellRunClosed:O.forgetOptimisticRun,onShellRunStarted:(De,Qe)=>O.recordOptimisticRun({agentId:Qe.agent_id,agentName:Qe.agent_name,runId:Qe.run_id,status:Qe.status,terminalInputProfile:Qe.terminal_input_profile??"default",workspaceId:De}),onTryDemo:f,orchestratorAutostartErrors:M.orchestratorAutostartErrors,orchestratorAutostartRunIds:M.orchestratorAutostartRunIds,recordOrchestratorResult:M.recordOrchestratorResult,terminalRuns:O.terminalRuns,workerActions:ue,workers:X}),Ze=d.jsx(L2,{addDialogTrigger:v,wizardOpen:L,whatsNewOpen:P.open,whatsNewEntries:P.entries,onCloseWhatsNew:P.close,onAddWorkspace:F,onCloseTaskGraph:()=>C(!1),onCloseWizard:B,onCreateWorkspace:M.createNewWorkspace,onTryDemo:f,taskGraphOpen:S,tasksFile:W,workspacePath:U.effectiveActiveWorkspace?.path??null,workers:X,onSelectOwner:pe}),St=T&&!c&&ee?d.jsx(b.Suspense,{fallback:null,children:d.jsx(a5,{open:!0,onClose:()=>_(!1),workspaceId:o??null})}):null,Jt=x&&!c?d.jsx(b.Suspense,{fallback:null,children:d.jsx(o5,{open:!0,onClose:()=>E(!1),workspaceId:o??null})}):null,or=d.jsx(I3,{activeWorkspaceId:U.effectiveActiveWorkspaceId,collapsed:R.collapsed,createDisabledReason:Q??void 0,onCreateClick:F,onDeleteWorkspace:fe,onSelectWorkspace:i,onToggleCollapse:R.toggleCollapsed,workersByWorkspaceId:U.effectiveWorkersByWorkspaceId,workspaces:U.effectiveWorkspaces}),fn=d.jsx(r5,{workspace:U.effectiveActiveWorkspace});return ie?d.jsxs(d.Fragment,{children:[d.jsx(h3,{workspaceSwitcher:le?void 0:d.jsx(x3,{activeWorkspaceId:U.effectiveActiveWorkspaceId,workspaces:U.effectiveWorkspaces,workersByWorkspaceId:U.effectiveWorkersByWorkspaceId,createDisabledReason:Q??void 0,onCreateClick:F,onDeleteWorkspace:fe,onSelectWorkspace:i}),topbarActions:le?void 0:d.jsx(d.Fragment,{children:d.jsx(Fw,{})}),openTaskCount:oe,workingCount:X.filter(De=>De.status==="working").length,banner:de,terminalPanels:Ce,fullBleed:le?ke:void 0,team:le?null:ke,tasks:le?null:d.jsx(y3,{tasksFile:W,workspacePath:U.effectiveActiveWorkspace?.path??null,workers:X,onSelectOwner:pe,onAddWorkspace:F,demoMode:c}),settings:le||!c?void 0:d.jsx(i3,{demoMode:c,onTryDemo:f,onExitDemo:h}),activeSection:j,onSectionChange:A,overlays:Ze}),d.jsx(Wy,{terminalRuns:O.terminalRuns}),d.jsx(Uy,{})]}):d.jsxs(d.Fragment,{children:[d.jsxs(t3,{hideTopbarActions:!U.effectiveActiveWorkspace,memoryOpen:x,onToggleMemory:c?void 0:()=>E(De=>!De),onToggleTaskGraph:()=>C(De=>!De),openTaskCount:oe,topbarActions:fn,taskGraphOpen:S,onToggleWorkflows:c||!ee?void 0:()=>_(De=>!De),workflowsOpen:T,sidebarResize:R,sidebar:or,children:[ke,Ce,Ze,Jt,St]}),d.jsx(Wy,{terminalRuns:O.terminalRuns}),d.jsx(Uy,{}),d.jsx(C3,{})]})},i5={success:sS,warning:nc,error:fS},gf={success:"var(--status-green)",warning:"var(--status-orange)",error:"var(--status-red)"},Zy=({toast:t,api:r})=>{const{t:o}=Ee(),i=i5[t.kind],l=r.getDuration(t.id);return d.jsxs("div",{"data-testid":"toast","data-kind":t.kind,onMouseEnter:()=>r.pauseDismiss(t.id),onMouseLeave:()=>r.resumeDismiss(t.id),className:"toast elev-2 toast-pop pointer-events-auto relative flex min-w-[260px] max-w-[400px] items-start gap-3 overflow-hidden rounded-lg border px-3 py-2.5",style:{background:"var(--bg-elevated)",borderColor:`color-mix(in oklab, ${gf[t.kind]} 35%, var(--border))`},children:[d.jsx("span",{className:"mt-0.5 shrink-0",style:{color:gf[t.kind]},"aria-hidden":!0,children:d.jsx(i,{size:14})}),d.jsx("div",{className:"min-w-0 flex-1 break-words text-sm text-pri",children:t.message}),d.jsx("button",{type:"button","data-testid":"toast-close",onClick:()=>r.dismiss(t.id),className:"-mt-0.5 -mr-1 flex h-6 w-6 shrink-0 cursor-pointer items-center justify-center rounded text-ter transition-colors hover:bg-3 hover:text-pri","aria-label":o("toast.dismissAria"),children:d.jsx(fo,{size:14,"aria-hidden":!0})}),l>0?d.jsx("span",{className:"toast-progress-bar",style:{background:gf[t.kind],animationDuration:`${l}ms`},"aria-hidden":!0}):null]})},l5=()=>{const t=NC(),r=Qt(),o=Tt();if(t.length===0)return null;const i=t.filter(c=>c.kind==="error"),l=t.filter(c=>c.kind!=="error");return d.jsxs("div",{className:"toaster pointer-events-none fixed right-4 bottom-8 z-50 flex flex-col gap-2","data-mobile":o||void 0,"data-testid":"toaster",children:[d.jsx("div",{role:"status","aria-live":"polite",className:"flex flex-col gap-2",children:l.map(c=>d.jsx(Zy,{toast:c,api:r},c.id))}),d.jsx("div",{role:"alert","aria-live":"assertive",className:"flex flex-col gap-2",children:i.map(c=>d.jsx(Zy,{toast:c,api:r},c.id))})]})},c5=({children:t})=>d.jsx(Gb,{delayDuration:250,skipDelayDuration:150,children:d.jsx(EE,{children:d.jsx(_C,{children:d.jsx(YC,{children:d.jsx(Fj,{children:d.jsx(Pj,{children:d.jsxs(Wj,{children:[t,d.jsx(l5,{})]})})})})})})}),u5=()=>d.jsx(qC,{children:d.jsx(c5,{children:d.jsx(s5,{})})}),Qy="\0gw:",fa={Unauthorized:4401,Forbidden:4403,DaemonOffline:4404,Revoked:4410,InternalError:4500},ux="hb:ping",dx="hb:pong",d5=t=>t===fa.Unauthorized||t===fa.Revoked;function f5(t){return t instanceof Uint8Array||ArrayBuffer.isView(t)&&t.constructor.name==="Uint8Array"&&"BYTES_PER_ELEMENT"in t&&t.BYTES_PER_ELEMENT===1}function Ff(t){if(typeof t!="boolean")throw new TypeError(`boolean expected, not ${t}`)}function co(t){if(typeof t!="number")throw new TypeError("number expected, got "+typeof t);if(!Number.isSafeInteger(t)||t<0)throw new RangeError("positive integer expected, got "+t)}function xt(t,r,o=""){const i=f5(t),l=t?.length,c=r!==void 0;if(!i||c&&l!==r){const f=o&&`"${o}" `,h=c?` of length ${r}`:"",g=i?`length=${l}`:`type=${typeof t}`,m=f+"expected Uint8Array"+h+", got "+g;throw i?new RangeError(m):new TypeError(m)}return t}function Jy(t,r=!0){if(t.destroyed)throw new Error("Hash instance has been destroyed");if(r&&t.finished)throw new Error("Hash#digest() has already been called")}function m5(t,r,o=!1){xt(t,void 0,"output");const i=r.outputLen;if(t.length<i)throw new RangeError("digestInto() expects output buffer of length at least "+i);if(o&&!zs(t))throw new Error("invalid output, must be aligned")}function er(t){return new Uint32Array(t.buffer,t.byteOffset,Math.floor(t.byteLength/4))}function Br(...t){for(let r=0;r<t.length;r++)t[r].fill(0)}function p5(t){return new DataView(t.buffer,t.byteOffset,t.byteLength)}const ma=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68,fx=t=>t<<24&4278190080|t<<8&16711680|t>>>8&65280|t>>>24&255,wt=ma?t=>t:t=>fx(t)>>>0,h5=t=>{for(let r=0;r<t.length;r++)t[r]=fx(t[r]);return t},zr=ma?t=>t:h5;function g5(t,r){if(r==null||typeof r!="object")throw new Error("options must be defined");return Object.assign(t,r)}function v5(t,r){if(t.length!==r.length)return!1;let o=0;for(let i=0;i<t.length;i++)o|=t[i]^r[i];return o===0}function y5(t,r,o){const i=r,l=(()=>[]),c=(h,g)=>i(g,...l(h)).update(h).digest(),f=i(new Uint8Array(t),...l(new Uint8Array(0)));return c.outputLen=f.outputLen,c.blockLen=f.blockLen,c.create=(h,...g)=>i(h,...g),c}const b5=(t,r)=>{function o(i,...l){if(xt(i,void 0,"key"),t.nonceLength!==void 0){const y=l[0];xt(y,t.varSizeNonce?void 0:t.nonceLength,"nonce")}const c=t.tagLength;c&&l[1]!==void 0&&xt(l[1],void 0,"AAD");const f=r(i,...l),h=(y,v)=>{if(v!==void 0){if(y!==2)throw new Error("cipher output not supported");xt(v,void 0,"output")}};let g=!1;return{encrypt(y,v){if(g)throw new Error("cannot encrypt() twice with same key + nonce");return g=!0,xt(y),h(f.encrypt.length,v),f.encrypt(y,v)},decrypt(y,v){if(xt(y),c&&y.length<c)throw new Error('"ciphertext" expected length bigger than tagLength='+c);return h(f.decrypt.length,v),f.decrypt(y,v)}}}return Object.assign(o,t),o};function Yf(t,r,o=!0){if(r===void 0)return new Uint8Array(t);if(xt(r,void 0,"output"),r.length!==t)throw new Error('"output" expected Uint8Array of length '+t+", got: "+r.length);if(o&&!zs(r))throw new Error("invalid output, must be aligned");return r}function w5(t,r,o){co(t),co(r),Ff(o);const i=new Uint8Array(16),l=p5(i);return l.setBigUint64(0,BigInt(r),o),l.setBigUint64(8,BigInt(t),o),i}function zs(t){return t.byteOffset%4===0}function Fl(t){return Uint8Array.from(xt(t))}function mx(t=32){co(t);const r=typeof globalThis=="object"?globalThis.crypto:null;if(typeof r?.getRandomValues!="function")throw new Error("crypto.getRandomValues must be defined");return r.getRandomValues(new Uint8Array(t))}const px=t=>Uint8Array.from(t.split(""),r=>r.charCodeAt(0)),x5=zr(er(px("expand 16-byte k"))),k5=zr(er(px("expand 32-byte k")));function ge(t,r){return t<<r|t>>>32-r}const ks=64,S5=16,Vf=2**32-1,e0=Uint32Array.of();function E5(t,r,o,i,l,c,f,h){const g=l.length,m=new Uint8Array(ks),y=er(m),v=ma&&zs(l)&&zs(c),k=v?er(l):e0,S=v?er(c):e0;if(!ma){for(let C=0;C<g;f++){if(t(r,o,i,y,f,h),zr(y),f>=Vf)throw new Error("arx: counter overflow");const x=Math.min(ks,g-C);for(let E=0,T;E<x;E++)T=C+E,c[T]=l[T]^m[E];C+=x}return}for(let C=0;C<g;f++){if(t(r,o,i,y,f,h),f>=Vf)throw new Error("arx: counter overflow");const x=Math.min(ks,g-C);if(v&&x===ks){const E=C/4;if(C%4!==0)throw new Error("arx: invalid block position");for(let T=0,_;T<S5;T++)_=E+T,S[_]=k[_]^y[T];C+=ks;continue}for(let E=0,T;E<x;E++)T=C+E,c[T]=l[T]^m[E];C+=x}}function C5(t,r){const{allowShortKeys:o,extendNonceFn:i,counterLength:l,counterRight:c,rounds:f}=g5({allowShortKeys:!1,counterLength:8,counterRight:!1,rounds:20},r);if(typeof t!="function")throw new Error("core must be a function");return co(l),co(f),Ff(c),Ff(o),(h,g,m,y,v=0)=>{xt(h,void 0,"key"),xt(g,void 0,"nonce"),xt(m,void 0,"data");const k=m.length;if(y=Yf(k,y,!1),co(v),v<0||v>=Vf)throw new Error("arx: counter overflow");const S=[];let C=h.length,x,E;if(C===32)S.push(x=Fl(h)),E=k5;else if(C===16&&o)x=new Uint8Array(32),x.set(h),x.set(h,16),E=x5,S.push(x);else throw xt(h,32,"arx key"),new Error("invalid key size");(!ma||!zs(g))&&S.push(g=Fl(g));let T=er(x);if(i){if(g.length!==24)throw new Error("arx: extended nonce must be 24 bytes");const A=g.subarray(0,16);if(ma)i(E,T,er(A),T);else{const R=zr(Uint32Array.from(E));i(R,T,er(A),T),Br(R),zr(T)}g=g.subarray(16)}else ma||zr(T);const _=16-l;if(_!==g.length)throw new Error(`arx: nonce must be ${_} or 16 bytes`);if(_!==12){const A=new Uint8Array(12);A.set(g,c?0:12-g.length),g=A,S.push(g)}const j=zr(er(g));try{return E5(t,E,T,j,m,y,v,f),y}finally{Br(...S)}}}function vt(t,r){return t[r++]&255|(t[r++]&255)<<8}class T5{blockLen=16;outputLen=16;buffer=new Uint8Array(16);r=new Uint16Array(10);h=new Uint16Array(10);pad=new Uint16Array(8);pos=0;finished=!1;destroyed=!1;constructor(r){r=Fl(xt(r,32,"key"));const o=vt(r,0),i=vt(r,2),l=vt(r,4),c=vt(r,6),f=vt(r,8),h=vt(r,10),g=vt(r,12),m=vt(r,14);this.r[0]=o&8191,this.r[1]=(o>>>13|i<<3)&8191,this.r[2]=(i>>>10|l<<6)&7939,this.r[3]=(l>>>7|c<<9)&8191,this.r[4]=(c>>>4|f<<12)&255,this.r[5]=f>>>1&8190,this.r[6]=(f>>>14|h<<2)&8191,this.r[7]=(h>>>11|g<<5)&8065,this.r[8]=(g>>>8|m<<8)&8191,this.r[9]=m>>>5&127;for(let y=0;y<8;y++)this.pad[y]=vt(r,16+2*y)}process(r,o,i=!1){const l=i?0:2048,{h:c,r:f}=this,h=f[0],g=f[1],m=f[2],y=f[3],v=f[4],k=f[5],S=f[6],C=f[7],x=f[8],E=f[9],T=vt(r,o+0),_=vt(r,o+2),j=vt(r,o+4),A=vt(r,o+6),R=vt(r,o+8),D=vt(r,o+10),L=vt(r,o+12),B=vt(r,o+14);let P=c[0]+(T&8191),te=c[1]+((T>>>13|_<<3)&8191),ee=c[2]+((_>>>10|j<<6)&8191),F=c[3]+((j>>>7|A<<9)&8191),Q=c[4]+((A>>>4|R<<12)&8191),Z=c[5]+(R>>>1&8191),$=c[6]+((R>>>14|D<<2)&8191),M=c[7]+((D>>>11|L<<5)&8191),K=c[8]+((L>>>8|B<<8)&8191),U=c[9]+(B>>>5|l),I=0,X=I+P*h+te*(5*E)+ee*(5*x)+F*(5*C)+Q*(5*S);I=X>>>13,X&=8191,X+=Z*(5*k)+$*(5*v)+M*(5*y)+K*(5*m)+U*(5*g),I+=X>>>13,X&=8191;let O=I+P*g+te*h+ee*(5*E)+F*(5*x)+Q*(5*C);I=O>>>13,O&=8191,O+=Z*(5*S)+$*(5*k)+M*(5*v)+K*(5*y)+U*(5*m),I+=O>>>13,O&=8191;let W=I+P*m+te*g+ee*h+F*(5*E)+Q*(5*x);I=W>>>13,W&=8191,W+=Z*(5*C)+$*(5*S)+M*(5*k)+K*(5*v)+U*(5*y),I+=W>>>13,W&=8191;let oe=I+P*y+te*m+ee*g+F*h+Q*(5*E);I=oe>>>13,oe&=8191,oe+=Z*(5*x)+$*(5*C)+M*(5*S)+K*(5*k)+U*(5*v),I+=oe>>>13,oe&=8191;let ue=I+P*v+te*y+ee*m+F*g+Q*h;I=ue>>>13,ue&=8191,ue+=Z*(5*E)+$*(5*x)+M*(5*C)+K*(5*S)+U*(5*k),I+=ue>>>13,ue&=8191;let fe=I+P*k+te*v+ee*y+F*m+Q*g;I=fe>>>13,fe&=8191,fe+=Z*h+$*(5*E)+M*(5*x)+K*(5*C)+U*(5*S),I+=fe>>>13,fe&=8191;let pe=I+P*S+te*k+ee*v+F*y+Q*m;I=pe>>>13,pe&=8191,pe+=Z*g+$*h+M*(5*E)+K*(5*x)+U*(5*C),I+=pe>>>13,pe&=8191;let le=I+P*C+te*S+ee*k+F*v+Q*y;I=le>>>13,le&=8191,le+=Z*m+$*g+M*h+K*(5*E)+U*(5*x),I+=le>>>13,le&=8191;let ie=I+P*x+te*C+ee*S+F*k+Q*v;I=ie>>>13,ie&=8191,ie+=Z*y+$*m+M*g+K*h+U*(5*E),I+=ie>>>13,ie&=8191;let se=I+P*E+te*x+ee*C+F*S+Q*k;I=se>>>13,se&=8191,se+=Z*v+$*y+M*m+K*g+U*h,I+=se>>>13,se&=8191,I=(I<<2)+I|0,I=I+X|0,X=I&8191,I=I>>>13,O+=I,c[0]=X,c[1]=O,c[2]=W,c[3]=oe,c[4]=ue,c[5]=fe,c[6]=pe,c[7]=le,c[8]=ie,c[9]=se}finalize(){const{h:r,pad:o}=this,i=new Uint16Array(10);let l=r[1]>>>13;r[1]&=8191;for(let h=2;h<10;h++)r[h]+=l,l=r[h]>>>13,r[h]&=8191;r[0]+=l*5,l=r[0]>>>13,r[0]&=8191,r[1]+=l,l=r[1]>>>13,r[1]&=8191,r[2]+=l,i[0]=r[0]+5,l=i[0]>>>13,i[0]&=8191;for(let h=1;h<10;h++)i[h]=r[h]+l,l=i[h]>>>13,i[h]&=8191;i[9]-=8192;let c=(l^1)-1;for(let h=0;h<10;h++)i[h]&=c;c=~c;for(let h=0;h<10;h++)r[h]=r[h]&c|i[h];r[0]=(r[0]|r[1]<<13)&65535,r[1]=(r[1]>>>3|r[2]<<10)&65535,r[2]=(r[2]>>>6|r[3]<<7)&65535,r[3]=(r[3]>>>9|r[4]<<4)&65535,r[4]=(r[4]>>>12|r[5]<<1|r[6]<<14)&65535,r[5]=(r[6]>>>2|r[7]<<11)&65535,r[6]=(r[7]>>>5|r[8]<<8)&65535,r[7]=(r[8]>>>8|r[9]<<5)&65535;let f=r[0]+o[0];r[0]=f&65535;for(let h=1;h<8;h++)f=(r[h]+o[h]|0)+(f>>>16)|0,r[h]=f&65535;Br(i)}update(r){Jy(this),xt(r),r=Fl(r);const{buffer:o,blockLen:i}=this,l=r.length;for(let c=0;c<l;){const f=Math.min(i-this.pos,l-c);if(f===i){for(;i<=l-c;c+=i)this.process(r,c);continue}o.set(r.subarray(c,c+f),this.pos),this.pos+=f,c+=f,this.pos===i&&(this.process(o,0,!1),this.pos=0)}return this}destroy(){this.destroyed=!0,Br(this.h,this.r,this.buffer,this.pad)}digestInto(r){Jy(this),m5(r,this),this.finished=!0;const{buffer:o,h:i}=this;let{pos:l}=this;if(l){for(o[l++]=1;l<16;l++)o[l]=0;this.process(o,0,!0)}this.finalize();let c=0;for(let f=0;f<8;f++)r[c++]=i[f]>>>0,r[c++]=i[f]>>>8}digest(){const{buffer:r,outputLen:o}=this;this.digestInto(r);const i=r.slice(0,o);return this.destroy(),i}}const A5=y5(32,t=>new T5(t));function _5(t,r,o,i,l,c=20){let f=t[0],h=t[1],g=t[2],m=t[3],y=r[0],v=r[1],k=r[2],S=r[3],C=r[4],x=r[5],E=r[6],T=r[7],_=l,j=o[0],A=o[1],R=o[2],D=f,L=h,B=g,P=m,te=y,ee=v,F=k,Q=S,Z=C,$=x,M=E,K=T,U=_,I=j,X=A,O=R;for(let oe=0;oe<c;oe+=2)D=D+te|0,U=ge(U^D,16),Z=Z+U|0,te=ge(te^Z,12),D=D+te|0,U=ge(U^D,8),Z=Z+U|0,te=ge(te^Z,7),L=L+ee|0,I=ge(I^L,16),$=$+I|0,ee=ge(ee^$,12),L=L+ee|0,I=ge(I^L,8),$=$+I|0,ee=ge(ee^$,7),B=B+F|0,X=ge(X^B,16),M=M+X|0,F=ge(F^M,12),B=B+F|0,X=ge(X^B,8),M=M+X|0,F=ge(F^M,7),P=P+Q|0,O=ge(O^P,16),K=K+O|0,Q=ge(Q^K,12),P=P+Q|0,O=ge(O^P,8),K=K+O|0,Q=ge(Q^K,7),D=D+ee|0,O=ge(O^D,16),M=M+O|0,ee=ge(ee^M,12),D=D+ee|0,O=ge(O^D,8),M=M+O|0,ee=ge(ee^M,7),L=L+F|0,U=ge(U^L,16),K=K+U|0,F=ge(F^K,12),L=L+F|0,U=ge(U^L,8),K=K+U|0,F=ge(F^K,7),B=B+Q|0,I=ge(I^B,16),Z=Z+I|0,Q=ge(Q^Z,12),B=B+Q|0,I=ge(I^B,8),Z=Z+I|0,Q=ge(Q^Z,7),P=P+te|0,X=ge(X^P,16),$=$+X|0,te=ge(te^$,12),P=P+te|0,X=ge(X^P,8),$=$+X|0,te=ge(te^$,7);let W=0;i[W++]=f+D|0,i[W++]=h+L|0,i[W++]=g+B|0,i[W++]=m+P|0,i[W++]=y+te|0,i[W++]=v+ee|0,i[W++]=k+F|0,i[W++]=S+Q|0,i[W++]=C+Z|0,i[W++]=x+$|0,i[W++]=E+M|0,i[W++]=T+K|0,i[W++]=_+U|0,i[W++]=j+I|0,i[W++]=A+X|0,i[W++]=R+O|0}function N5(t,r,o,i){let l=wt(t[0]),c=wt(t[1]),f=wt(t[2]),h=wt(t[3]),g=wt(r[0]),m=wt(r[1]),y=wt(r[2]),v=wt(r[3]),k=wt(r[4]),S=wt(r[5]),C=wt(r[6]),x=wt(r[7]),E=wt(o[0]),T=wt(o[1]),_=wt(o[2]),j=wt(o[3]);for(let R=0;R<20;R+=2)l=l+g|0,E=ge(E^l,16),k=k+E|0,g=ge(g^k,12),l=l+g|0,E=ge(E^l,8),k=k+E|0,g=ge(g^k,7),c=c+m|0,T=ge(T^c,16),S=S+T|0,m=ge(m^S,12),c=c+m|0,T=ge(T^c,8),S=S+T|0,m=ge(m^S,7),f=f+y|0,_=ge(_^f,16),C=C+_|0,y=ge(y^C,12),f=f+y|0,_=ge(_^f,8),C=C+_|0,y=ge(y^C,7),h=h+v|0,j=ge(j^h,16),x=x+j|0,v=ge(v^x,12),h=h+v|0,j=ge(j^h,8),x=x+j|0,v=ge(v^x,7),l=l+m|0,j=ge(j^l,16),C=C+j|0,m=ge(m^C,12),l=l+m|0,j=ge(j^l,8),C=C+j|0,m=ge(m^C,7),c=c+y|0,E=ge(E^c,16),x=x+E|0,y=ge(y^x,12),c=c+y|0,E=ge(E^c,8),x=x+E|0,y=ge(y^x,7),f=f+v|0,T=ge(T^f,16),k=k+T|0,v=ge(v^k,12),f=f+v|0,T=ge(T^f,8),k=k+T|0,v=ge(v^k,7),h=h+g|0,_=ge(_^h,16),S=S+_|0,g=ge(g^S,12),h=h+g|0,_=ge(_^h,8),S=S+_|0,g=ge(g^S,7);let A=0;i[A++]=l,i[A++]=c,i[A++]=f,i[A++]=h,i[A++]=E,i[A++]=T,i[A++]=_,i[A++]=j,zr(i)}const j5=C5(_5,{counterRight:!1,counterLength:8,extendNonceFn:N5,allowShortKeys:!1}),R5=new Uint8Array(16),t0=(t,r)=>{t.update(r);const o=r.length%16;o&&t.update(R5.subarray(o))},O5=new Uint8Array(32);function n0(t,r,o,i,l){l!==void 0&&xt(l,void 0,"AAD");const c=t(r,o,O5),f=w5(i.length,l?l.length:0,!0),h=A5.create(c);l&&t0(h,l),t0(h,i),h.update(f);const g=h.digest();return Br(c,f),g}const D5=t=>(r,o,i)=>({encrypt(c,f){const h=c.length;f=Yf(h+16,f,!1),f.set(c);const g=f.subarray(0,-16);t(r,o,g,g,1);const m=n0(t,r,o,g,i);return f.set(m,h),Br(m),f},decrypt(c,f){f=Yf(c.length-16,f,!1);const h=c.subarray(0,-16),g=c.subarray(-16),m=n0(t,r,o,h,i);if(!v5(g,m))throw Br(m),new Error("invalid tag");return f.set(c.subarray(0,-16)),t(r,o,f,f,1),Br(m),f}}),hx=b5({blockSize:64,nonceLength:24,tagLength:16},D5(j5));function M5(t){return t instanceof Uint8Array||ArrayBuffer.isView(t)&&t.constructor.name==="Uint8Array"&&"BYTES_PER_ELEMENT"in t&&t.BYTES_PER_ELEMENT===1}function vo(t,r=""){if(typeof t!="number"){const o=r&&`"${r}" `;throw new TypeError(`${o}expected number, got ${typeof t}`)}if(!Number.isSafeInteger(t)||t<0){const o=r&&`"${r}" `;throw new RangeError(`${o}expected integer >= 0, got ${t}`)}}function rr(t,r,o=""){const i=M5(t),l=t?.length,c=r!==void 0;if(!i||c&&l!==r){const f=o&&`"${o}" `,h=c?` of length ${r}`:"",g=i?`length=${l}`:`type=${typeof t}`,m=f+"expected Uint8Array"+h+", got "+g;throw i?new RangeError(m):new TypeError(m)}return t}function jm(t){if(typeof t!="function"||typeof t.create!="function")throw new TypeError("Hash must wrapped by utils.createHasher");if(vo(t.outputLen),vo(t.blockLen),t.outputLen<1)throw new Error('"outputLen" must be >= 1');if(t.blockLen<1)throw new Error('"blockLen" must be >= 1')}function Yl(t,r=!0){if(t.destroyed)throw new Error("Hash instance has been destroyed");if(r&&t.finished)throw new Error("Hash#digest() has already been called")}function gx(t,r){rr(t,void 0,"digestInto() output");const o=r.outputLen;if(t.length<o)throw new RangeError('"digestInto() output" expected to be of length >='+o)}function Hs(...t){for(let r=0;r<t.length;r++)t[r].fill(0)}function vf(t){return new DataView(t.buffer,t.byteOffset,t.byteLength)}function An(t,r){return t<<32-r|t>>>r}const vx=typeof Uint8Array.from([]).toHex=="function"&&typeof Uint8Array.fromHex=="function",L5=Array.from({length:256},(t,r)=>r.toString(16).padStart(2,"0"));function Rm(t){if(rr(t),vx)return t.toHex();let r="";for(let o=0;o<t.length;o++)r+=L5[t[o]];return r}const Jn={_0:48,_9:57,A:65,F:70,a:97,f:102};function r0(t){if(t>=Jn._0&&t<=Jn._9)return t-Jn._0;if(t>=Jn.A&&t<=Jn.F)return t-(Jn.A-10);if(t>=Jn.a&&t<=Jn.f)return t-(Jn.a-10)}function Om(t){if(typeof t!="string")throw new TypeError("hex string expected, got "+typeof t);if(vx)try{return Uint8Array.fromHex(t)}catch(l){throw l instanceof SyntaxError?new RangeError(l.message):l}const r=t.length,o=r/2;if(r%2)throw new RangeError("hex string expected, got unpadded hex of length "+r);const i=new Uint8Array(o);for(let l=0,c=0;l<o;l++,c+=2){const f=r0(t.charCodeAt(c)),h=r0(t.charCodeAt(c+1));if(f===void 0||h===void 0){const g=t[c]+t[c+1];throw new RangeError('hex string expected, got non-hex character "'+g+'" at index '+c)}i[l]=f*16+h}return i}function z5(t,r={}){const o=(l,c)=>t(c).update(l).digest(),i=t(void 0);return o.outputLen=i.outputLen,o.blockLen=i.blockLen,o.canXOF=i.canXOF,o.create=l=>t(l),Object.assign(o,r),Object.freeze(o)}function H5(t=32){vo(t,"bytesLength");const r=typeof globalThis=="object"?globalThis.crypto:null;if(typeof r?.getRandomValues!="function")throw new Error("crypto.getRandomValues must be defined");if(t>65536)throw new RangeError(`"bytesLength" expected <= 65536, got ${t}`);return r.getRandomValues(new Uint8Array(t))}const B5=t=>({oid:Uint8Array.from([6,9,96,134,72,1,101,3,4,2,t])});function W5(t,r,o){return t&r^~t&o}function U5(t,r,o){return t&r^t&o^r&o}class q5{blockLen;outputLen;canXOF=!1;padOffset;isLE;buffer;view;finished=!1;length=0;pos=0;destroyed=!1;constructor(r,o,i,l){this.blockLen=r,this.outputLen=o,this.padOffset=i,this.isLE=l,this.buffer=new Uint8Array(r),this.view=vf(this.buffer)}update(r){Yl(this),rr(r);const{view:o,buffer:i,blockLen:l}=this,c=r.length;for(let f=0;f<c;){const h=Math.min(l-this.pos,c-f);if(h===l){const g=vf(r);for(;l<=c-f;f+=l)this.process(g,f);continue}i.set(r.subarray(f,f+h),this.pos),this.pos+=h,f+=h,this.pos===l&&(this.process(o,0),this.pos=0)}return this.length+=r.length,this.roundClean(),this}digestInto(r){Yl(this),gx(r,this),this.finished=!0;const{buffer:o,view:i,blockLen:l,isLE:c}=this;let{pos:f}=this;o[f++]=128,Hs(this.buffer.subarray(f)),this.padOffset>l-f&&(this.process(i,0),f=0);for(let v=f;v<l;v++)o[v]=0;i.setBigUint64(l-8,BigInt(this.length*8),c),this.process(i,0);const h=vf(r),g=this.outputLen;if(g%4)throw new Error("_sha2: outputLen must be aligned to 32bit");const m=g/4,y=this.get();if(m>y.length)throw new Error("_sha2: outputLen bigger than state");for(let v=0;v<m;v++)h.setUint32(4*v,y[v],c)}digest(){const{buffer:r,outputLen:o}=this;this.digestInto(r);const i=r.slice(0,o);return this.destroy(),i}_cloneInto(r){r||=new this.constructor,r.set(...this.get());const{blockLen:o,buffer:i,length:l,finished:c,destroyed:f,pos:h}=this;return r.destroyed=f,r.finished=c,r.length=l,r.pos=h,l%o&&r.buffer.set(i),r}clone(){return this._cloneInto()}}const Rr=Uint32Array.from([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),I5=Uint32Array.from([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),Or=new Uint32Array(64);class P5 extends q5{constructor(r){super(64,r,8,!1)}get(){const{A:r,B:o,C:i,D:l,E:c,F:f,G:h,H:g}=this;return[r,o,i,l,c,f,h,g]}set(r,o,i,l,c,f,h,g){this.A=r|0,this.B=o|0,this.C=i|0,this.D=l|0,this.E=c|0,this.F=f|0,this.G=h|0,this.H=g|0}process(r,o){for(let v=0;v<16;v++,o+=4)Or[v]=r.getUint32(o,!1);for(let v=16;v<64;v++){const k=Or[v-15],S=Or[v-2],C=An(k,7)^An(k,18)^k>>>3,x=An(S,17)^An(S,19)^S>>>10;Or[v]=x+Or[v-7]+C+Or[v-16]|0}let{A:i,B:l,C:c,D:f,E:h,F:g,G:m,H:y}=this;for(let v=0;v<64;v++){const k=An(h,6)^An(h,11)^An(h,25),S=y+k+W5(h,g,m)+I5[v]+Or[v]|0,x=(An(i,2)^An(i,13)^An(i,22))+U5(i,l,c)|0;y=m,m=g,g=h,h=f+S|0,f=c,c=l,l=i,i=S+x|0}i=i+this.A|0,l=l+this.B|0,c=c+this.C|0,f=f+this.D|0,h=h+this.E|0,g=g+this.F|0,m=m+this.G|0,y=y+this.H|0,this.set(i,l,c,f,h,g,m,y)}roundClean(){Hs(Or)}destroy(){this.destroyed=!0,this.set(0,0,0,0,0,0,0,0),Hs(this.buffer)}}class K5 extends P5{A=Rr[0]|0;B=Rr[1]|0;C=Rr[2]|0;D=Rr[3]|0;E=Rr[4]|0;F=Rr[5]|0;G=Rr[6]|0;H=Rr[7]|0;constructor(){super(32)}}const uo=z5(()=>new K5,B5(1));const Wr=(t,r,o)=>rr(t,r,o),yx=vo,bx=Rm,F5=t=>Om(t),Y5=t=>H5(t),Vl=BigInt(0),Gf=BigInt(1);function wx(t,r=""){if(typeof t!="boolean"){const o=r&&`"${r}" `;throw new TypeError(o+"expected boolean, got type="+typeof t)}return t}function V5(t){if(typeof t=="bigint"){if(!Dl(t))throw new RangeError("positive bigint expected, got "+t)}else yx(t);return t}function a0(t,r=""){if(typeof t!="number"){const o=r&&`"${r}" `;throw new TypeError(o+"expected number, got type="+typeof t)}if(!Number.isSafeInteger(t)){const o=r&&`"${r}" `;throw new RangeError(o+"expected safe integer, got "+t)}}function xx(t){if(typeof t!="string")throw new TypeError("hex string expected, got "+typeof t);return t===""?Vl:BigInt("0x"+t)}function G5(t){return xx(Rm(t))}function Bs(t){return xx(Rm(Ws(rr(t)).reverse()))}function kx(t,r){if(vo(r),r===0)throw new RangeError("zero length");t=V5(t);const o=t.toString(16);if(o.length>r*2)throw new RangeError("number too large");return Om(o.padStart(r*2,"0"))}function Sx(t,r){return kx(t,r).reverse()}function $5(t,r){if(t=Wr(t),r=Wr(r),t.length!==r.length)return!1;let o=0;for(let i=0;i<t.length;i++)o|=t[i]^r[i];return o===0}function Ws(t){return Uint8Array.from(Wr(t))}const Dl=t=>typeof t=="bigint"&&Vl<=t;function X5(t,r,o){return Dl(t)&&Dl(r)&&Dl(o)&&r<=t&&t<o}function Gl(t,r,o,i){if(!X5(r,o,i))throw new RangeError("expected valid "+t+": "+o+" <= n < "+i+", got "+r)}function Z5(t){if(t<Vl)throw new Error("expected non-negative bigint, got "+t);let r;for(r=0;t>Vl;t>>=Gf,r+=1);return r}const Q5=t=>(Gf<<BigInt(t))-Gf;function Dm(t,r={},o={}){if(Object.prototype.toString.call(t)!=="[object Object]")throw new TypeError("expected valid options object");function i(c,f,h){if(!h&&f!=="function"&&!Object.hasOwn(t,c))throw new TypeError(`param "${c}" is invalid: expected own property`);const g=t[c];if(h&&g===void 0)return;const m=typeof g;if(m!==f||g===null)throw new TypeError(`param "${c}" is invalid: expected ${f}, got ${m}`)}const l=(c,f)=>Object.entries(c).forEach(([h,g])=>i(h,g,f));l(r,!1),l(o,!0)}const o0=()=>{throw new Error("not implemented")};const kt=BigInt(0),yt=BigInt(1),ua=BigInt(2),Ex=BigInt(3),Cx=BigInt(4),Tx=BigInt(5),J5=BigInt(7),Ax=BigInt(8),eO=BigInt(9),_x=BigInt(16);function rt(t,r){if(r<=kt)throw new Error("mod: expected positive modulus, got "+r);const o=t%r;return o>=kt?o:r+o}function gn(t,r,o){if(r<kt)throw new Error("pow2: expected non-negative exponent, got "+r);let i=t;for(;r-- >kt;)i*=i,i%=o;return i}function s0(t,r){if(t===kt)throw new Error("invert: expected non-zero number");if(r<=kt)throw new Error("invert: expected positive modulus, got "+r);let o=rt(t,r),i=r,l=kt,c=yt;for(;o!==kt;){const h=i/o,g=i-o*h,m=l-c*h;i=o,o=g,l=c,c=m}if(i!==yt)throw new Error("invert: does not exist");return rt(l,r)}function Mm(t,r,o){const i=t;if(!i.eql(i.sqr(r),o))throw new Error("Cannot find square root")}function Nx(t,r){const o=t,i=(o.ORDER+yt)/Cx,l=o.pow(r,i);return Mm(o,l,r),l}function tO(t,r){const o=t,i=(o.ORDER-Tx)/Ax,l=o.mul(r,ua),c=o.pow(l,i),f=o.mul(r,c),h=o.mul(o.mul(f,ua),c),g=o.mul(f,o.sub(h,o.ONE));return Mm(o,g,r),g}function nO(t){const r=Lm(t),o=jx(t),i=o(r,r.neg(r.ONE)),l=o(r,i),c=o(r,r.neg(i)),f=(t+J5)/_x;return((h,g)=>{const m=h;let y=m.pow(g,f),v=m.mul(y,i);const k=m.mul(y,l),S=m.mul(y,c),C=m.eql(m.sqr(v),g),x=m.eql(m.sqr(k),g);y=m.cmov(y,v,C),v=m.cmov(S,k,x);const E=m.eql(m.sqr(v),g),T=m.cmov(y,v,E);return Mm(m,T,g),T})}function jx(t){if(t<Ex)throw new Error("sqrt is not defined for small field");let r=t-yt,o=0;for(;r%ua===kt;)r/=ua,o++;let i=ua;const l=Lm(t);for(;i0(l,i)===1;)if(i++>1e3)throw new Error("Cannot find square root: probably non-prime P");if(o===1)return Nx;let c=l.pow(i,r);const f=(r+yt)/ua;return function(g,m){const y=g;if(y.is0(m))return m;if(i0(y,m)!==1)throw new Error("Cannot find square root");let v=o,k=y.mul(y.ONE,c),S=y.pow(m,r),C=y.pow(m,f);for(;!y.eql(S,y.ONE);){if(y.is0(S))return y.ZERO;let x=1,E=y.sqr(S);for(;!y.eql(E,y.ONE);)if(x++,E=y.sqr(E),x===v)throw new Error("Cannot find square root");const T=yt<<BigInt(v-x-1),_=y.pow(k,T);v=x,k=y.sqr(_),S=y.mul(S,k),C=y.mul(C,_)}return C}}function rO(t){return t%Cx===Ex?Nx:t%Ax===Tx?tO:t%_x===eO?nO(t):jx(t)}const la=(t,r)=>(rt(t,r)&yt)===yt,aO=["create","isValid","is0","neg","inv","sqrt","sqr","eql","add","sub","mul","pow","div","addN","subN","mulN","sqrN"];function oO(t){const r={ORDER:"bigint",BYTES:"number",BITS:"number"},o=aO.reduce((i,l)=>(i[l]="function",i),r);if(Dm(t,o),a0(t.BYTES,"BYTES"),a0(t.BITS,"BITS"),t.BYTES<1||t.BITS<1)throw new Error("invalid field: expected BYTES/BITS > 0");if(t.ORDER<=yt)throw new Error("invalid field: expected ORDER > 1, got "+t.ORDER);return t}function sO(t,r,o){const i=t;if(o<kt)throw new Error("invalid exponent, negatives unsupported");if(o===kt)return i.ONE;if(o===yt)return r;let l=i.ONE,c=r;for(;o>kt;)o&yt&&(l=i.mul(l,c)),c=i.sqr(c),o>>=yt;return l}function Rx(t,r,o=!1){const i=t,l=new Array(r.length).fill(o?i.ZERO:void 0),c=r.reduce((h,g,m)=>i.is0(g)?h:(l[m]=h,i.mul(h,g)),i.ONE),f=i.inv(c);return r.reduceRight((h,g,m)=>i.is0(g)?h:(l[m]=i.mul(h,l[m]),i.mul(h,g)),f),l}function i0(t,r){const o=t,i=(o.ORDER-yt)/ua,l=o.pow(r,i),c=o.eql(l,o.ONE),f=o.eql(l,o.ZERO),h=o.eql(l,o.neg(o.ONE));if(!c&&!f&&!h)throw new Error("invalid Legendre symbol result");return c?1:f?0:-1}function iO(t,r){if(r!==void 0&&yx(r),t<=kt)throw new Error("invalid n length: expected positive n, got "+t);if(r!==void 0&&r<1)throw new Error("invalid n length: expected positive bit length, got "+r);const o=Z5(t);if(r!==void 0&&r<o)throw new Error(`invalid n length: expected bit length (${o}) >= n.length (${r})`);const i=r!==void 0?r:o,l=Math.ceil(i/8);return{nBitLength:i,nByteLength:l}}const l0=new WeakMap;class Ox{ORDER;BITS;BYTES;isLE;ZERO=kt;ONE=yt;_lengths;_mod;constructor(r,o={}){if(r<=yt)throw new Error("invalid field: expected ORDER > 1, got "+r);let i;this.isLE=!1,o!=null&&typeof o=="object"&&(typeof o.BITS=="number"&&(i=o.BITS),typeof o.sqrt=="function"&&Object.defineProperty(this,"sqrt",{value:o.sqrt,enumerable:!0}),typeof o.isLE=="boolean"&&(this.isLE=o.isLE),o.allowedLengths&&(this._lengths=Object.freeze(o.allowedLengths.slice())),typeof o.modFromBytes=="boolean"&&(this._mod=o.modFromBytes));const{nBitLength:l,nByteLength:c}=iO(r,i);if(c>2048)throw new Error("invalid field: expected ORDER of <= 2048 bytes");this.ORDER=r,this.BITS=l,this.BYTES=c,Object.freeze(this)}create(r){return rt(r,this.ORDER)}isValid(r){if(typeof r!="bigint")throw new TypeError("invalid field element: expected bigint, got "+typeof r);return kt<=r&&r<this.ORDER}is0(r){return r===kt}isValidNot0(r){return!this.is0(r)&&this.isValid(r)}isOdd(r){return(r&yt)===yt}neg(r){return rt(-r,this.ORDER)}eql(r,o){return r===o}sqr(r){return rt(r*r,this.ORDER)}add(r,o){return rt(r+o,this.ORDER)}sub(r,o){return rt(r-o,this.ORDER)}mul(r,o){return rt(r*o,this.ORDER)}pow(r,o){return sO(this,r,o)}div(r,o){return rt(r*s0(o,this.ORDER),this.ORDER)}sqrN(r){return r*r}addN(r,o){return r+o}subN(r,o){return r-o}mulN(r,o){return r*o}inv(r){return s0(r,this.ORDER)}sqrt(r){let o=l0.get(this);return o||l0.set(this,o=rO(this.ORDER)),o(this,r)}toBytes(r){return this.isLE?Sx(r,this.BYTES):kx(r,this.BYTES)}fromBytes(r,o=!1){Wr(r);const{_lengths:i,BYTES:l,isLE:c,ORDER:f,_mod:h}=this;if(i){if(r.length<1||!i.includes(r.length)||r.length>l)throw new Error("Field.fromBytes: expected "+i+" bytes, got "+r.length);const m=new Uint8Array(l);m.set(r,c?0:m.length-r.length),r=m}if(r.length!==l)throw new Error("Field.fromBytes: expected "+l+" bytes, got "+r.length);let g=c?Bs(r):G5(r);if(h&&(g=rt(g,f)),!o&&!this.isValid(g))throw new Error("invalid field element: outside of range 0..ORDER");return g}invertBatch(r){return Rx(this,r)}cmov(r,o,i){return wx(i,"condition"),i?o:r}}Object.freeze(Ox.prototype);function Lm(t,r={}){return new Ox(t,r)}const $l=BigInt(0),$f=BigInt(1);function c0(t,r){const o=r.negate();return t?o:r}function yf(t,r){const o=Rx(t.Fp,r.map(i=>i.Z));return r.map((i,l)=>t.fromAffine(i.toAffine(o[l])))}function Dx(t,r){if(!Number.isSafeInteger(t)||t<=0||t>r)throw new Error("invalid window size, expected [1.."+r+"], got W="+t)}function bf(t,r){Dx(t,r);const o=Math.ceil(r/t)+1,i=2**(t-1),l=2**t,c=Q5(t),f=BigInt(t);return{windows:o,windowSize:i,mask:c,maxNumber:l,shiftBy:f}}function u0(t,r,o){const{windowSize:i,mask:l,maxNumber:c,shiftBy:f}=o;let h=Number(t&l),g=t>>f;h>i&&(h-=c,g+=$f);const m=r*i,y=m+Math.abs(h)-1,v=h===0,k=h<0,S=r%2!==0;return{nextN:g,offset:y,isZero:v,isNeg:k,isNegF:S,offsetF:m}}const wf=new WeakMap,Mx=new WeakMap;function xf(t){return Mx.get(t)||1}function d0(t){if(t!==$l)throw new Error("invalid wNAF")}class lO{BASE;ZERO;Fn;bits;constructor(r,o){this.BASE=r.BASE,this.ZERO=r.ZERO,this.Fn=r.Fn,this.bits=o}_unsafeLadder(r,o,i=this.ZERO){let l=r;for(;o>$l;)o&$f&&(i=i.add(l)),l=l.double(),o>>=$f;return i}precomputeWindow(r,o){const{windows:i,windowSize:l}=bf(o,this.bits),c=[];let f=r,h=f;for(let g=0;g<i;g++){h=f,c.push(h);for(let m=1;m<l;m++)h=h.add(f),c.push(h);f=h.double()}return c}wNAF(r,o,i){if(!this.Fn.isValid(i))throw new Error("invalid scalar");let l=this.ZERO,c=this.BASE;const f=bf(r,this.bits);for(let h=0;h<f.windows;h++){const{nextN:g,offset:m,isZero:y,isNeg:v,isNegF:k,offsetF:S}=u0(i,h,f);i=g,y?c=c.add(c0(k,o[S])):l=l.add(c0(v,o[m]))}return d0(i),{p:l,f:c}}wNAFUnsafe(r,o,i,l=this.ZERO){const c=bf(r,this.bits);for(let f=0;f<c.windows&&i!==$l;f++){const{nextN:h,offset:g,isZero:m,isNeg:y}=u0(i,f,c);if(i=h,!m){const v=o[g];l=l.add(y?v.negate():v)}}return d0(i),l}getPrecomputes(r,o,i){let l=wf.get(o);return l||(l=this.precomputeWindow(o,r),r!==1&&(typeof i=="function"&&(l=i(l)),wf.set(o,l))),l}cached(r,o,i){const l=xf(r);return this.wNAF(l,this.getPrecomputes(l,r,i),o)}unsafe(r,o,i,l){const c=xf(r);return c===1?this._unsafeLadder(r,o,l):this.wNAFUnsafe(c,this.getPrecomputes(c,r,i),o,l)}createCache(r,o){Dx(o,this.bits),Mx.set(r,o),wf.delete(r)}hasCache(r){return xf(r)!==1}}function f0(t,r,o){if(r){if(r.ORDER!==t)throw new Error("Field.ORDER must match order: Fp == p, Fn == n");return oO(r),r}else return Lm(t,{isLE:o})}function cO(t,r,o={},i){if(i===void 0&&(i=t==="edwards"),!r||typeof r!="object")throw new Error(`expected valid ${t} CURVE object`);for(const g of["p","n","h"]){const m=r[g];if(!(typeof m=="bigint"&&m>$l))throw new Error(`CURVE.${g} must be positive bigint`)}const l=f0(r.p,o.Fp,i),c=f0(r.n,o.Fn,i),h=["Gx","Gy","a","d"];for(const g of h)if(!l.isValid(r[g]))throw new Error(`CURVE.${g} must be valid field element of CURVE.Fp`);return r=Object.freeze(Object.assign({},r)),{CURVE:r,Fp:l,Fn:c}}function uO(t,r){return function(i){const l=t(i);return{secretKey:l,publicKey:r(l)}}}const Dr=BigInt(0),Mt=BigInt(1),kf=BigInt(2),dO=BigInt(8);function fO(t,r,o,i){const l=t.sqr(o),c=t.sqr(i),f=t.add(t.mul(r.a,l),c),h=t.add(t.ONE,t.mul(r.d,t.mul(l,c)));return t.eql(f,h)}function mO(t,r={}){const o=r,i=cO("edwards",t,o,o.FpFnLE),{Fp:l,Fn:c}=i;let f=i.CURVE;const{h}=f;Dm(o,{},{uvRatio:"function"});const g=kf<<BigInt(c.BYTES*8)-Mt,m=x=>l.create(x),y=o.uvRatio===void 0?(x,E)=>{try{return{isValid:!0,value:l.sqrt(l.div(x,E))}}catch{return{isValid:!1,value:Dr}}}:o.uvRatio;if(!fO(l,f,f.Gx,f.Gy))throw new Error("bad curve params: generator point");function v(x,E,T=!1){const _=T?Mt:Dr;return Gl("coordinate "+x,E,_,g),E}function k(x){if(!(x instanceof S))throw new Error("EdwardsPoint expected")}class S{static BASE=new S(f.Gx,f.Gy,Mt,m(f.Gx*f.Gy));static ZERO=new S(Dr,Mt,Mt,Dr);static Fp=l;static Fn=c;X;Y;Z;T;constructor(E,T,_,j){this.X=v("x",E),this.Y=v("y",T),this.Z=v("z",_,!0),this.T=v("t",j),Object.freeze(this)}static CURVE(){return f}static fromAffine(E){if(E instanceof S)throw new Error("extended point not allowed");const{x:T,y:_}=E||{};return v("x",T),v("y",_),new S(T,_,Mt,m(T*_))}static fromBytes(E,T=!1){const _=l.BYTES,{a:j,d:A}=f;E=Ws(Wr(E,_,"point")),wx(T,"zip215");const R=Ws(E),D=E[_-1];R[_-1]=D&-129;const L=Bs(R),B=T?g:l.ORDER;Gl("point.y",L,Dr,B);const P=m(L*L),te=m(P-Mt),ee=m(A*P-j);let{isValid:F,value:Q}=y(te,ee);if(!F)throw new Error("bad point: invalid y coordinate");const Z=(Q&Mt)===Mt,$=(D&128)!==0;if(!T&&Q===Dr&&$)throw new Error("bad point: x=0 and x_0=1");return $!==Z&&(Q=m(-Q)),S.fromAffine({x:Q,y:L})}static fromHex(E,T=!1){return S.fromBytes(F5(E),T)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}precompute(E=8,T=!0){return C.createCache(this,E),T||this.multiply(kf),this}assertValidity(){const E=this,{a:T,d:_}=f;if(E.is0())throw new Error("bad point: ZERO");const{X:j,Y:A,Z:R,T:D}=E,L=m(j*j),B=m(A*A),P=m(R*R),te=m(P*P),ee=m(L*T),F=m(P*m(ee+B)),Q=m(te+m(_*m(L*B)));if(F!==Q)throw new Error("bad point: equation left != right (1)");const Z=m(j*A),$=m(R*D);if(Z!==$)throw new Error("bad point: equation left != right (2)")}equals(E){k(E);const{X:T,Y:_,Z:j}=this,{X:A,Y:R,Z:D}=E,L=m(T*D),B=m(A*j),P=m(_*D),te=m(R*j);return L===B&&P===te}is0(){return this.equals(S.ZERO)}negate(){return new S(m(-this.X),this.Y,this.Z,m(-this.T))}double(){const{a:E}=f,{X:T,Y:_,Z:j}=this,A=m(T*T),R=m(_*_),D=m(kf*m(j*j)),L=m(E*A),B=T+_,P=m(m(B*B)-A-R),te=L+R,ee=te-D,F=L-R,Q=m(P*ee),Z=m(te*F),$=m(P*F),M=m(ee*te);return new S(Q,Z,M,$)}add(E){k(E);const{a:T,d:_}=f,{X:j,Y:A,Z:R,T:D}=this,{X:L,Y:B,Z:P,T:te}=E,ee=m(j*L),F=m(A*B),Q=m(D*_*te),Z=m(R*P),$=m((j+A)*(L+B)-ee-F),M=Z-Q,K=Z+Q,U=m(F-T*ee),I=m($*M),X=m(K*U),O=m($*U),W=m(M*K);return new S(I,X,W,O)}subtract(E){return k(E),this.add(E.negate())}multiply(E){if(!c.isValidNot0(E))throw new RangeError("invalid scalar: expected 1 <= sc < curve.n");const{p:T,f:_}=C.cached(this,E,j=>yf(S,j));return yf(S,[T,_])[0]}multiplyUnsafe(E){if(!c.isValid(E))throw new RangeError("invalid scalar: expected 0 <= sc < curve.n");return E===Dr?S.ZERO:this.is0()||E===Mt?this:C.unsafe(this,E,T=>yf(S,T))}isSmallOrder(){return this.clearCofactor().is0()}isTorsionFree(){return C.unsafe(this,f.n).is0()}toAffine(E){const T=this;let _=E;const{X:j,Y:A,Z:R}=T,D=T.is0();_==null&&(_=D?dO:l.inv(R));const L=m(j*_),B=m(A*_),P=l.mul(R,_);if(D)return{x:Dr,y:Mt};if(P!==Mt)throw new Error("invZ was invalid");return{x:L,y:B}}clearCofactor(){return h===Mt?this:this.multiplyUnsafe(h)}toBytes(){const{x:E,y:T}=this.toAffine(),_=l.toBytes(T);return _[_.length-1]|=E&Mt?128:0,_}toHex(){return bx(this.toBytes())}toString(){return`<Point ${this.is0()?"ZERO":this.toHex()}>`}}const C=new lO(S,c.BITS);return c.BITS>=8&&S.BASE.precompute(8),Object.freeze(S.prototype),Object.freeze(S),S}class pO{static BASE;static ZERO;static Fp;static Fn;ep;constructor(r){this.ep=r}static fromBytes(r){o0()}static fromHex(r){o0()}get x(){return this.toAffine().x}get y(){return this.toAffine().y}clearCofactor(){return this}assertValidity(){this.ep.assertValidity()}toAffine(r){return this.ep.toAffine(r)}toHex(){return bx(this.toBytes())}toString(){return this.toHex()}isTorsionFree(){return!0}isSmallOrder(){return!1}add(r){return this.assertSame(r),this.init(this.ep.add(r.ep))}subtract(r){return this.assertSame(r),this.init(this.ep.subtract(r.ep))}multiply(r){return this.init(this.ep.multiply(r))}multiplyUnsafe(r){return this.init(this.ep.multiplyUnsafe(r))}double(){return this.init(this.ep.double())}negate(){return this.init(this.ep.negate())}precompute(r,o){return this.ep.precompute(r,o),this}}const Ss=BigInt(0),oo=BigInt(1),Sl=BigInt(2);function hO(t){return Dm(t,{P:"bigint",type:"string",adjustScalarBytes:"function",powPminus2:"function"},{randomBytes:"function"}),Object.freeze({...t})}function gO(t){const r=hO(t),{P:o,type:i,adjustScalarBytes:l,powPminus2:c,randomBytes:f}=r,h=i==="x25519";if(!h&&i!=="x448")throw new Error("invalid type");const g=f===void 0?Y5:f,m=h?255:448,y=h?32:56,v=BigInt(h?9:5),k=BigInt(h?121665:39081),S=h?Sl**BigInt(254):Sl**BigInt(447),C=h?BigInt(8)*Sl**BigInt(251)-oo:BigInt(4)*Sl**BigInt(445)-oo,x=S+C+oo,E=Z=>rt(Z,o),T=_(v);function _(Z){return Sx(E(Z),y)}function j(Z){const $=Ws(Wr(Z,y,"uCoordinate"));return h&&($[31]&=127),E(Bs($))}function A(Z){return Bs(l(Ws(Wr(Z,y,"scalar"))))}function R(Z,$){const M=te(j($),A(Z));if(M===Ss)throw new Error("invalid private or public key received");return _(M)}function D(Z){return R(Z,T)}const L=D,B=R;function P(Z,$,M){const K=E(Z*($-M));return $=E($-K),M=E(M+K),{x_2:$,x_3:M}}function te(Z,$){Gl("u",Z,Ss,o),Gl("scalar",$,S,x);const M=$,K=Z;let U=oo,I=Ss,X=Z,O=oo,W=Ss;for(let ue=BigInt(m-1);ue>=Ss;ue--){const fe=M>>ue&oo;W^=fe,{x_2:U,x_3:X}=P(W,U,X),{x_2:I,x_3:O}=P(W,I,O),W=fe;const pe=U+I,le=E(pe*pe),ie=U-I,se=E(ie*ie),de=le-se,me=X+O,Te=X-O,Ce=E(Te*pe),ke=E(me*ie),Ze=Ce+ke,St=Ce-ke;X=E(Ze*Ze),O=E(K*E(St*St)),U=E(le*se),I=E(de*(le+E(k*de)))}({x_2:U,x_3:X}=P(W,U,X)),{x_2:I,x_3:O}=P(W,I,O);const oe=c(I);return E(U*oe)}const ee={secretKey:y,publicKey:y,seed:y},F=Z=>(Z=Z===void 0?g(y):Z,Wr(Z,ee.seed,"seed"),Z),Q={randomSecretKey:F};return Object.freeze(ee),Object.freeze(Q),Object.freeze({keygen:uO(F,L),getSharedSecret:B,getPublicKey:L,scalarMult:R,scalarMultBase:D,utils:Q,GuBytes:T.slice(),lengths:ee})}const vO=BigInt(0),Os=BigInt(1),m0=BigInt(2),yO=BigInt(3),bO=BigInt(5),wO=BigInt(8),yo=BigInt("0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffed"),Lx={p:yo,n:BigInt("0x1000000000000000000000000000000014def9dea2f79cd65812631a5cf5d3ed"),h:wO,a:BigInt("0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffec"),d:BigInt("0x52036cee2b6ffe738cc740797779e89800700a4d4141d8ab75eb4dca135978a3"),Gx:BigInt("0x216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a"),Gy:BigInt("0x6666666666666666666666666666666666666666666666666666666666666658")};function zx(t){const r=BigInt(10),o=BigInt(20),i=BigInt(40),l=BigInt(80),c=yo,h=t*t%c*t%c,g=gn(h,m0,c)*h%c,m=gn(g,Os,c)*t%c,y=gn(m,bO,c)*m%c,v=gn(y,r,c)*y%c,k=gn(v,o,c)*v%c,S=gn(k,i,c)*k%c,C=gn(S,l,c)*S%c,x=gn(C,l,c)*S%c,E=gn(x,r,c)*y%c;return{pow_p_5_8:gn(E,m0,c)*t%c,b2:h}}function xO(t){return t[0]&=248,t[31]&=127,t[31]|=64,t}const Xf=BigInt("19681161376707505956807079304988542015446066515923890162744021073123829784752");function Hx(t,r){const o=yo,i=rt(r*r*r,o),l=rt(i*i*r,o),c=zx(t*l).pow_p_5_8;let f=rt(t*i*c,o);const h=rt(r*f*f,o),g=f,m=rt(f*Xf,o),y=h===t,v=h===rt(-t,o),k=h===rt(-t*Xf,o);return y&&(f=g),(v||k)&&(f=m),la(f,o)&&(f=rt(-f,o)),{isValid:y||v,value:f}}const so=mO(Lx,{uvRatio:Hx}),ca=so.Fp,kO=so.Fn,Zf=(()=>{const t=yo;return gO({P:t,type:"x25519",powPminus2:r=>{const{pow_p_5_8:o,b2:i}=zx(r);return rt(gn(o,yO,t)*i,t)},adjustScalarBytes:xO})})(),p0=Xf,SO=BigInt("54469307008909316920995813868745141605393597292927456921205312896311721017578"),h0=t=>Hx(Os,t),EO=BigInt("0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"),CO=t=>ca.create(Bs(t)&EO);class Gt extends pO{static BASE=new Gt(so.BASE);static ZERO=new Gt(so.ZERO);static Fp=ca;static Fn=kO;constructor(r){super(r)}static fromAffine(r){return new Gt(so.fromAffine(r))}assertSame(r){if(!(r instanceof Gt))throw new Error("RistrettoPoint expected")}init(r){return new Gt(r)}static fromBytes(r){rr(r,32);const{a:o,d:i}=Lx,l=yo,c=A=>ca.create(A),f=CO(r);if(!$5(ca.toBytes(f),r)||la(f,l))throw new Error("invalid ristretto255 encoding 1");const h=c(f*f),g=c(Os+o*h),m=c(Os-o*h),y=c(g*g),v=c(m*m),k=c(o*i*y-v),{isValid:S,value:C}=h0(c(k*v)),x=c(C*m),E=c(C*x*k);let T=c((f+f)*x);la(T,l)&&(T=c(-T));const _=c(g*E),j=c(T*_);if(!S||la(j,l)||_===vO)throw new Error("invalid ristretto255 encoding 2");return new Gt(new so(T,_,Os,j))}static fromHex(r){return Gt.fromBytes(Om(r))}toBytes(){let{X:r,Y:o,Z:i,T:l}=this.ep;const c=yo,f=E=>ca.create(E),h=f(f(i+o)*f(i-o)),g=f(r*o),m=f(g*g),{value:y}=h0(f(h*m)),v=f(y*h),k=f(y*g),S=f(v*k*l);let C;if(la(l*S,c)){let E=f(o*p0),T=f(r*p0);r=E,o=T,C=f(v*SO)}else C=k;la(r*S,c)&&(o=f(-o));let x=f((i-o)*C);return la(x,c)&&(x=f(-x)),ca.toBytes(x)}equals(r){this.assertSame(r);const{X:o,Y:i}=this.ep,{X:l,Y:c}=r.ep,f=m=>ca.create(m),h=f(o*c)===f(i*l),g=f(i*c)===f(o*l);return h||g}is0(){return this.equals(Gt.ZERO)}}Object.freeze(Gt.BASE);Object.freeze(Gt.ZERO);Object.freeze(Gt.prototype);Object.freeze(Gt);class g0{oHash;iHash;blockLen;outputLen;canXOF=!1;finished=!1;destroyed=!1;constructor(r,o){if(jm(r),rr(o,void 0,"key"),this.iHash=r.create(),typeof this.iHash.update!="function")throw new Error("Expected instance of class which extends utils.Hash");this.blockLen=this.iHash.blockLen,this.outputLen=this.iHash.outputLen;const i=this.blockLen,l=new Uint8Array(i);l.set(o.length>i?r.create().update(o).digest():o);for(let c=0;c<l.length;c++)l[c]^=54;this.iHash.update(l),this.oHash=r.create();for(let c=0;c<l.length;c++)l[c]^=106;this.oHash.update(l),Hs(l)}update(r){return Yl(this),this.iHash.update(r),this}digestInto(r){Yl(this),gx(r,this),this.finished=!0;const o=r.subarray(0,this.outputLen);this.iHash.digestInto(o),this.oHash.update(o),this.oHash.digestInto(o),this.destroy()}digest(){const r=new Uint8Array(this.oHash.outputLen);return this.digestInto(r),r}_cloneInto(r){r||=Object.create(Object.getPrototypeOf(this),{});const{oHash:o,iHash:i,finished:l,destroyed:c,blockLen:f,outputLen:h}=this;return r=r,r.finished=l,r.destroyed=c,r.blockLen=f,r.outputLen=h,r.oHash=o._cloneInto(r.oHash),r.iHash=i._cloneInto(r.iHash),r}clone(){return this._cloneInto()}destroy(){this.destroyed=!0,this.oHash.destroy(),this.iHash.destroy()}}const Bx=(()=>{const t=((r,o,i)=>new g0(r,o).update(i).digest());return t.create=(r,o)=>new g0(r,o),t})();function TO(t,r,o){return jm(t),o===void 0&&(o=new Uint8Array(t.outputLen)),Bx(t,o,r)}const Sf=Uint8Array.of(0),v0=Uint8Array.of();function AO(t,r,o,i=32){jm(t),vo(i,"length"),rr(r,void 0,"prk");const l=t.outputLen;if(r.length<l)throw new Error('"prk" must be at least HashLen octets');if(i>255*l)throw new Error("Length must be <= 255*HashLen");const c=Math.ceil(i/l);o===void 0?o=v0:rr(o,void 0,"info");const f=new Uint8Array(c*l),h=Bx.create(t,r),g=h._cloneInto(),m=new Uint8Array(h.outputLen);for(let y=0;y<c;y++)Sf[0]=y+1,g.update(y===0?v0:m).update(o).update(Sf).digestInto(m),f.set(m,l*y),h._cloneInto(g);return h.destroy(),g.destroy(),Hs(m,Sf),f.slice(0,i)}const Us=(t,r,o,i,l)=>AO(t,TO(t,r,o),i,l),yn=2,y0=32,_O=32,Hr=32,NO=24,Qf=32,Wx=32,jO=6,Jf=32,Ux="hive/remote/v1/pair",RO="hive/remote/v1/key/daemon->device",OO="hive/remote/v1/key/device->daemon",DO="hive/remote/v1/sas",MO="hive/remote/v1/transcript",LO="hive/remote/v2/conn/daemon->device",zO="hive/remote/v2/conn/device->daemon",HO="hive/remote/v2/conn-salt",BO=1,WO=2,UO=4,qO=8,qx=12,IO=new TextEncoder;function Xt(t){return IO.encode(t)}function jn(...t){let r=0;for(const l of t)r+=l.length;const o=new Uint8Array(r);let i=0;for(const l of t)o.set(l,i),i+=l.length;return o}function vc(t){if(!Number.isInteger(t)||t<0||t>4294967295)throw new RangeError(`u32be out of range: ${t}`);const r=new Uint8Array(4);return new DataView(r.buffer).setUint32(0,t),r}function zm(t,r=0){if(t.length<r+4)throw new RangeError("u32beRead: buffer too short");return new DataView(t.buffer,t.byteOffset,t.byteLength).getUint32(r)}function PO(t){if(!Number.isSafeInteger(t)||t<0)throw new RangeError(`u64be out of range: ${t}`);const r=new Uint8Array(8),o=Math.floor(t/4294967296),i=t>>>0,l=new DataView(r.buffer);return l.setUint32(0,o),l.setUint32(4,i),r}function Xl(t){if(t.length>65535)throw new RangeError("lp: value too long for u16 length prefix");const r=new Uint8Array(2+t.length);return new DataView(r.buffer).setUint16(0,t.length),r.set(t,2),r}function dn(t,r,o){if(t.length!==r)throw new RangeError(`${o} must be ${r} bytes, got ${t.length}`)}const vn="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",KO=(()=>{const t=new Int16Array(128).fill(-1);for(let r=0;r<vn.length;r++)t[vn.charCodeAt(r)]=r;return t})();function da(t){let r="",o=0;for(;o+3<=t.length;o+=3){const l=t[o],c=t[o+1],f=t[o+2];r+=vn[l>>2],r+=vn[(l&3)<<4|c>>4],r+=vn[(c&15)<<2|f>>6],r+=vn[f&63]}const i=t.length-o;if(i===1){const l=t[o];r+=vn[l>>2],r+=vn[(l&3)<<4]}else if(i===2){const l=t[o],c=t[o+1];r+=vn[l>>2],r+=vn[(l&3)<<4|c>>4],r+=vn[(c&15)<<2]}return r}function qs(t){if(t.length%4===1)throw new RangeError("invalid base64url");const r=t.length>>2,o=t.length&3,i=r*3+(o===0?0:o-1),l=new Uint8Array(i),c=g=>{if(g>=128)throw new RangeError("invalid base64url");const m=KO[g];if(m<0)throw new RangeError("invalid base64url");return m};let f=0,h=0;for(;h+4<=t.length;h+=4){const g=c(t.charCodeAt(h)),m=c(t.charCodeAt(h+1)),y=c(t.charCodeAt(h+2)),v=c(t.charCodeAt(h+3));l[f++]=g<<2|m>>4,l[f++]=(m&15)<<4|y>>2,l[f++]=(y&3)<<6|v}if(o===2){const g=c(t.charCodeAt(h)),m=c(t.charCodeAt(h+1));l[f++]=g<<2|m>>4}else if(o===3){const g=c(t.charCodeAt(h)),m=c(t.charCodeAt(h+1)),y=c(t.charCodeAt(h+2));l[f++]=g<<2|m>>4,l[f++]=(m&15)<<4|y>>2}return l}function FO(t){return JSON.stringify(t)}function YO(t){let r;try{r=JSON.parse(t)}catch{throw new RangeError("invalid pairing payload: not JSON")}if(typeof r!="object"||r===null)throw new RangeError("invalid pairing payload: not an object");const o=r;if(o.v!==yn)throw new RangeError(`unsupported pairing version: ${String(o.v)}`);if(typeof o.gatewayUrl!="string"||o.gatewayUrl.length===0)throw new RangeError("invalid pairing payload: gatewayUrl");if(typeof o.daemonId!="string"||o.daemonId.length===0)throw new RangeError("invalid pairing payload: daemonId");if(typeof o.pairingSecret!="string")throw new RangeError("invalid pairing payload: pairingSecret");if(qs(o.pairingSecret).length!==Qf)throw new RangeError(`pairingSecret must be ${Qf} bytes`);return{v:o.v,gatewayUrl:o.gatewayUrl,daemonId:o.daemonId,pairingSecret:o.pairingSecret}}function VO(){const t=Zf.utils.randomSecretKey(),r=Zf.getPublicKey(t);return{secretKey:t,publicKey:r}}function GO(t){return{secretKey:da(t.secretKey),publicKey:da(t.publicKey)}}function $O(){return mx(Wx)}function XO(t){dn(t.pairingSecret,Qf,"pairingSecret"),dn(t.sessionSalt,Wx,"sessionSalt"),dn(t.daemonPublicKey,y0,"daemonPublicKey"),dn(t.devicePublicKey,y0,"devicePublicKey");const r=Zf.getSharedSecret(t.localSecretKey,t.peerPublicKey);dn(r,_O,"sharedSecret");const o=jn(t.pairingSecret,r),i=jn(Xt(MO),Uint8Array.of(0),vc(t.ids.protocolVersion),Xl(Xt(t.ids.daemonId)),Xl(Xt(t.ids.deviceId)),t.daemonPublicKey,t.devicePublicKey,t.sessionSalt),l=uo(i),c=jn(Xt(Ux),t.sessionSalt),f=Us(uo,o,c,jn(Xt(RO),Uint8Array.of(0),l),Hr),h=Us(uo,o,c,jn(Xt(OO),Uint8Array.of(0),l),Hr),g=e6(l,t.ids);return{d2p:f,p2d:h,sas:g,transcriptHash:l}}function ZO(t){return XO({localSecretKey:t.deviceSecretKey,peerPublicKey:t.daemonPublicKey,daemonPublicKey:t.daemonPublicKey,devicePublicKey:t.devicePublicKey,pairingSecret:t.pairingSecret,sessionSalt:t.sessionSalt,ids:t.ids})}function QO(){return mx(Jf)}function JO(t){dn(t.rootD2p,Hr,"rootD2p"),dn(t.rootP2d,Hr,"rootP2d"),dn(t.phoneConnSalt,Jf,"phoneConnSalt"),dn(t.daemonConnSalt,Jf,"daemonConnSalt");const r=jn(Xt(HO),t.phoneConnSalt,t.daemonConnSalt),o=jn(Uint8Array.of(0),vc(t.ids.protocolVersion),Xl(Xt(t.ids.daemonId)),Xl(Xt(t.ids.deviceId)),t.phoneConnSalt,t.daemonConnSalt),i=Us(uo,t.rootD2p,r,jn(Xt(LO),o),Hr),l=Us(uo,t.rootP2d,r,jn(Xt(zO),o),Hr);return{d2p:i,p2d:l}}function e6(t,r){dn(t,32,"transcriptHash");const o=Us(uo,t,Xt(Ux),jn(Xt(DO),Uint8Array.of(0),vc(r.protocolVersion)),4);return(zm(o)%1e6).toString().padStart(jO,"0")}function Ix(t,r,o){if(!Number.isInteger(r)||r<0||r>4294967295)throw new RangeError(`streamId out of range: ${r}`);const i=new Uint8Array(NO);return i[0]=t==="d2p"?BO:WO,i.set(vc(r),1),i.set(PO(o),8),i}function Px(t){if(t.length<qx)throw new RangeError("headerBytes too short");return zm(t,UO)}function yc(t){if(t.length<qx)throw new RangeError("headerBytes too short");return zm(t,qO)}function t6(t){dn(t.key,Hr,"key");const r=Px(t.headerBytes),o=yc(t.headerBytes),i=Ix(t.direction,r,o);return hx(t.key,i,t.headerBytes).encrypt(t.payload)}function n6(t){dn(t.key,Hr,"key");const r=Px(t.headerBytes),o=yc(t.headerBytes),i=Ix(t.direction,r,o);return hx(t.key,i,t.headerBytes).decrypt(t.ciphertext)}function r6(t){return{direction:t,nextSeq:0}}function a6(t){return{direction:t,lastSeq:-1}}function o6(t,r){const o=yc(r.headerBytes);if(o!==t.nextSeq)throw new RangeError(`header seq ${o} does not match sealer.nextSeq ${t.nextSeq}`);const i=t6({key:r.key,direction:t.direction,headerBytes:r.headerBytes,payload:r.payload}),l=t.nextSeq;return t.nextSeq+=1,{seq:l,ciphertext:i}}function s6(t,r){if(r.seq!==t.lastSeq+1)throw new RangeError("out-of-order or replayed frame");if(yc(r.headerBytes)!==r.seq)throw new RangeError("out-of-order or replayed frame");const i=n6({key:r.key,direction:t.direction,headerBytes:r.headerBytes,ciphertext:r.ciphertext});return t.lastSeq=r.seq,i}const i6=(t,r)=>{const o=new URL(t);if(o.protocol==="https:"?o.protocol="wss:":o.protocol==="http:"&&(o.protocol="ws:"),o.protocol!=="wss:"&&o.protocol!=="ws:")throw new Error(`unsupported pairing gateway protocol: ${o.protocol}`);return`${o.toString().replace(/\/+$/,"")}/relay/pair?daemonId=${encodeURIComponent(r)}`},l6=t=>typeof t=="object"&&t!==null&&typeof t.t=="string",c6=2e4,u6=1e4;function d6(t,r,o){const i=o.generateKeyPair??VO,l=o.generateSalt??$O,c=o.heartbeatMs??c6,f=o.heartbeatDeadlineMs??u6;let h="idle",g=null,m=null,y=null,v=!1,k=null,S=null,C=null,x=null,E=null,T=null,_="",j="",A=null;const R=X=>{h=X,r.onPhase(X)},D=()=>{S!==null&&(clearTimeout(S),S=null)},L=()=>{k!==null&&(clearInterval(k),k=null),D()},B=X=>{L(),k=setInterval(()=>{if(!v){try{X.send(ux)}catch{}S===null&&(S=setTimeout(()=>{if(S=null,!v){try{X.close()}catch{}$()}},f))}},c)},P=()=>{C?.secretKey.fill(0),x?.fill(0),E&&(E.d2p.fill(0),E.p2d.fill(0),E.transcriptHash.fill(0)),C=null,x=null,E=null},te=X=>{if(!v){v=!0,L(),P();try{y?.close()}catch{}y=null,A?.(X)}},ee=(X,O)=>{if(v)return;const W={code:X,message:O};R(X==="rejected"?"rejected":X==="expired"?"expired":"error"),r.onFailure(W),te({ok:!1,failure:W})},F=X=>{if(h!=="connecting"&&h!=="handshaking")return;if(X.protocolVersion!==yn){ee("protocol_version",`unsupported pairing protocol version ${X.protocolVersion}`);return}if(!C||!x){ee("pair_ack_invalid","pair-ack arrived before the phone keypair was ready");return}let O;try{O=qs(X.daemonPublicKey)}catch{ee("pair_ack_invalid","pair-ack daemonPublicKey is not valid base64url");return}const W={daemonId:X.daemonId,deviceId:X.deviceId,protocolVersion:X.protocolVersion};try{E=ZO({deviceSecretKey:C.secretKey,daemonPublicKey:O,devicePublicKey:C.publicKey,pairingSecret:U,sessionSalt:x,ids:W})}catch(oe){ee("pair_ack_invalid",`handshake derivation failed: ${oe.message}`);return}m=X.deviceId,j=X.daemonId,T=X.daemonPublicKey,g=E.sas,R("awaiting_confirm"),r.onSas(g)},Q=()=>{if(!v){if(!E||!C||!m){ee("pair_ack_invalid","cannot mint before the handshake produced a session");return}R("minting"),o.mintSession(_,{daemonId:j,deviceId:m}).then(()=>{if(v||!C||!T||!m||!E)return;const X={v:2,gatewayUrl:_,daemonId:j,deviceId:m,deviceKeyPair:GO(C),daemonPublicKey:T,rootKeys:{d2p:da(E.d2p),p2d:da(E.p2d)},protocolVersion:yn,pairedAt:(o.now??Date.now)()};o.store.save(X);const O=m;R("paired"),te({ok:!0,deviceId:O})}).catch(X=>{X.status===403?ee("mint_forbidden","gateway refused to mint a device session (not confirmed)"):ee("mint_failed",`device session mint failed: ${X.message??"unknown"}`)})}},Z=X=>{if(h==="awaiting_confirm"){if(!E||!C||!m||X.deviceId!==m){ee("pair_ack_invalid","confirmed for an unexpected device");return}Q()}},$=()=>{if(!v){if(h==="awaiting_confirm"){Q();return}h!=="minting"&&ee("socket_closed","pairing socket closed before the device was paired")}},M=X=>{if(v||typeof X!="string")return;if(X===dx){D();return}let O;try{O=JSON.parse(X)}catch{return}if(l6(O))switch(h==="connecting"&&O.t==="pair-ack"&&R("handshaking"),O.t){case"pair-ack":F(O);break;case"confirmed":Z(O);break;case"rejected":{const W=O.reason;W==="expired"||W==="pairing_expired"?ee("expired","pairing code expired; generate a new pairing code"):ee("rejected",W??"pairing rejected at the desktop")}break}},K=YO(t),U=qs(K.pairingSecret);return _=K.gatewayUrl,j=K.daemonId,{get phase(){return h},get sas(){return g},get deviceId(){return m},start:()=>v?Promise.resolve({ok:!1,failure:{code:"cancelled",message:"already settled"}}):new Promise(X=>{A=X,C=i(),x=l(),R("connecting");const O=i6(K.gatewayUrl,K.daemonId);try{y=o.openSocket(O)}catch(W){ee("socket_closed",`failed to open pairing socket: ${W.message}`);return}y.addEventListener("open",()=>{if(v||!y||!C||!x)return;B(y);const W={t:"hello",devicePublicKey:da(C.publicKey),sessionSalt:da(x),...o.proposedName?{proposedName:o.proposedName}:{},...o.boundJti?{boundJti:o.boundJti}:{}};y?.send(JSON.stringify(W))}),y.addEventListener("message",W=>{M(W.data)}),y.addEventListener("close",$),y.addEventListener("error",$)}),cancel:()=>{v||(R("rejected"),ee("cancelled","pairing cancelled"))},dispose:()=>{v?P():te({ok:!1,failure:{code:"cancelled",message:"disposed"}})}}}const f6=t=>async(r,o)=>{const i=await t(`${r}/pair/session`,{method:"POST",credentials:"include",headers:{"content-type":"application/json"},body:JSON.stringify(o)});if(!i.ok)throw Object.assign(new Error(`mint failed: ${i.status}`),{status:i.status})};function m6(t){const r=t.fetchImpl??globalThis.fetch.bind(globalThis),o=t.gatewayBaseUrl??window.location.origin,i=t.redirect??(C=>window.location.assign(C)),l=t.createPairing??d6,c=t.mintSession??f6(r);let f=t.authProvider??"github",h="login",g=null;const m=C=>{h=C,t.onPhase?.(C)},y=C=>t.store.load(o,C),v=async C=>{C&&(f=C);const x=await r(`${o}/pair/machines`,{credentials:"include"});if(x.status===401){const _=encodeURIComponent(window.location.pathname+window.location.search);return m("login"),i(`${o}/auth/${f}?redirect=${_}`),{daemons:[],selfDeviceId:null}}if(!x.ok)throw new Error(`Failed to load machines: ${x.status}`);const E=await x.json(),T=E.daemons.map(_=>({id:_.id,name:_.name,lastSeen:_.lastSeen,revoked:_.revoked,online:_.online}));return m("machines"),{daemons:T,selfDeviceId:E.self.deviceId}},k=C=>{m("pairing");const E=l(C,{onPhase:T=>t.onPairingPhase?.(T),onSas:T=>t.onPairingSas?.(T),onFailure:T=>t.onPairingFailure?.(T)},{openSocket:(T,_)=>new WebSocket(T,_),store:t.store,mintSession:c,...t.proposedName?{proposedName:t.proposedName}:{},...t.boundJti?{boundJti:t.boundJti}:{}});return g=E,E.start()};return{get phase(){return h},get pairingClient(){return g},loadMachines:v,selectDaemon:async(C,x)=>{g=null;const E=y(C);if(E&&!x){const A=await t.connectTransport({daemonId:C,deviceId:E.deviceId,stored:E});return A.ok?(m("connected"),A):(!A.ok&&A.failure.code==="relay_revoked"&&t.store.clear(o,C),m("selecting"),A)}if(m("selecting"),!x)return{ok:!1,failure:{code:"needs_pairing",message:"this device is not paired with that computer — enter its pairing code first"}};const T=await k(x);if(!T.ok)return T;const _=y(C),j=await t.connectTransport({daemonId:C,deviceId:T.deviceId,stored:_});return j.ok?(m("connected"),j):(j.failure.code==="relay_revoked"&&t.store.clear(o,C),m("selecting"),j)}}}const Kx="0123456789ABCDEFGHJKMNPQRSTVWXYZ",p6=12,h6="hive-remote-pairing-code-v1:",g6=t=>{const r=t.trim().toUpperCase().replace(/[\s-]+/g,"").replace(/O/g,"0").replace(/[IL]/g,"1");if(r.length!==p6)return null;for(const o of r)if(!Kx.includes(o))return null;return r},v6=new TextEncoder,y6=t=>new URL(t).origin,b6=async t=>{const r=g6(t.code);if(!r)return null;const o=await crypto.subtle.digest("SHA-256",v6.encode(`${h6}${r}`));return FO({v:yn,gatewayUrl:y6(t.gatewayUrl),daemonId:t.daemonId,pairingSecret:da(new Uint8Array(o))})},w6="hive.device-session.v2",x6="hive.device-session.v1",Ef=(t,r)=>`${w6}:${t}:${r}`,b0=(t,r)=>`${x6}:${t}:${r}`,k6=t=>{if(typeof t!="object"||t===null)return!1;const r=t;if(r.v!==2||typeof r.gatewayUrl!="string"||typeof r.daemonId!="string"||typeof r.deviceId!="string"||typeof r.daemonPublicKey!="string"||typeof r.protocolVersion!="number"||typeof r.pairedAt!="number")return!1;const o=r.deviceKeyPair;if(typeof o!="object"||o===null)return!1;const i=o;if(typeof i.secretKey!="string"||typeof i.publicKey!="string")return!1;const l=r.rootKeys;if(typeof l!="object"||l===null)return!1;const c=l;return typeof c.d2p=="string"&&typeof c.p2d=="string"},S6=(t=globalThis.localStorage??null)=>({load:(r,o)=>{if(!t)return null;t.getItem(b0(r,o))!==null&&t.removeItem(b0(r,o));const i=t.getItem(Ef(r,o));if(i===null)return null;try{const l=JSON.parse(i);return k6(l)?l:null}catch{return null}},save:r=>{t&&t.setItem(Ef(r.gatewayUrl,r.daemonId),JSON.stringify(r))},clear:(r,o)=>{t&&t.removeItem(Ef(r,o))}}),Fx=()=>{const t=window.location.hostname;return!(t==="127.0.0.1"||t==="localhost"||t==="[::1]"||t==="::1")},Yx=t=>{switch(t){case"rejected":case"cancelled":return"pairing.failed.rejected";case"expired":return"pairing.failed.expired";case"mint_forbidden":return"pairing.failed.mintForbidden";case"protocol_version":return"pairing.failed.version";case"socket_closed":case"pair_ack_invalid":case"mint_failed":return"pairing.failed.socket";default:return null}},E6=(t,r)=>{const o=Yx(r);if(o)return o;switch(t){case"connecting":return"pairing.connecting";case"handshaking":case"minting":return"pairing.handshaking";case"awaiting_confirm":return null;case"paired":return"pairing.paired";case"rejected":return"pairing.failed.rejected";case"expired":return"pairing.failed.expired";case"error":return"pairing.failed.socket";default:return null}},C6=t=>t==="select_failed"?"connect.error.selectFailed":t==="invalid_code"?"connect.error.invalidCode":t==="relay_revoked"?"connect.machines.revokedHint":null,T6=t=>{const r=Math.floor((Date.now()-t)/1e3);if(r<60)return null;const o=Math.floor(r/60);if(o<60)return`${o}m`;const i=Math.floor(o/60);return i<24?`${i}h`:`${Math.floor(i/24)}d`},A6={O:"0",I:"1",L:"1"},_6=t=>{const r=t.toUpperCase();let o="";for(const l of r){const c=A6[l]??l;if(Kx.includes(c)&&(o+=c,o.length===12))break}const i=[];for(let l=0;l<o.length;l+=4)i.push(o.slice(l,l+4));return i.join("-")},N6=t=>t==="minting"||t==="paired",El=({children:t,className:r="",testId:o})=>d.jsx("div",{"data-testid":o,className:`connect-screen flex min-h-full flex-col p-6 ${r}`,children:t}),Es=({primary:t,children:r,disabled:o,onClick:i,testId:l,type:c="button"})=>d.jsx("button",{type:c,"data-testid":l,disabled:o,onClick:i,className:"flex w-full items-center justify-center rounded-lg px-4 text-sm font-semibold transition-colors",style:{minHeight:"44px",background:t?"var(--accent)":"var(--bg-2)",color:t?"#ffffff":"var(--text-secondary)",border:`1px solid ${t?"var(--accent)":"var(--border-bright)"}`,opacity:o?.4:1,cursor:o?"not-allowed":"pointer"},children:r}),j6=({flow:t,phase:r,machines:o,selectedMachineId:i,pairingPhase:l,pairingFailureCode:c,connectError:f,sas:h,isSigningIn:g=!1,pendingMachineId:m,loginError:y=!1,isGatewayBundle:v=!1,onRefreshMachines:k,onSelectProvider:S,onSelectMachine:C,onSubmitCode:x,onCancelPairing:E,onGoBack:T})=>{const{t:_}=Ee(),[j,A]=b.useState(""),R=b.useRef(!1),D=E6(l,c),L=C6(f),B=Yx(c)!=null,P=N6(l),te=h!=null&&h.length>0&&(l==="awaiting_confirm"||P),ee=$=>{const M=_6($);A(M),M.replace(/-/g,"").length===12&&i&&!R.current&&(R.current=!0,x(i,M.trim()))},F=j.replace(/-/g,"").length===12,Q=!!i&&F,Z=v?"/brand/icon-192.png":"/logo.png";if(r==="login")return d.jsxs(El,{testId:"connect-login",className:"justify-center gap-6",children:[d.jsxs("div",{className:"mb-2 flex flex-col items-center gap-3 text-center",children:[d.jsx("img",{src:Z,width:72,height:72,alt:"",style:{filter:"drop-shadow(0 8px 28px rgba(51,88,212,.38))"}}),d.jsx("span",{className:"text-2xl font-bold tracking-tight",style:{color:"var(--text-primary)"},children:"Hive"})]}),d.jsxs("div",{className:"text-center",children:[d.jsx("h1",{className:"text-xl font-semibold text-pri",children:_("connect.login.heading")}),d.jsx("p",{className:"mt-2 text-sm text-ter",children:_("connect.login.subtitle")})]}),y?d.jsx("p",{"data-testid":"connect-login-error",className:"rounded-lg px-3 py-2 text-center text-sm",style:{background:"color-mix(in oklab, var(--status-red) 12%, transparent)",color:"var(--status-red)"},children:_("connect.login.failed")}):null,d.jsx("div",{className:"flex flex-col gap-3",children:g?d.jsx("div",{className:"flex items-center justify-center text-sm text-ter",style:{minHeight:"44px"},children:_("connect.login.signingIn")}):d.jsxs(d.Fragment,{children:[d.jsx(Es,{primary:!0,testId:"connect-login-github",onClick:()=>S("github"),children:_("connect.login.github")}),d.jsx(Es,{testId:"connect-login-google",onClick:()=>S("google"),children:_("connect.login.google")})]})})]});if(r==="machines"){const $=m!=null;return d.jsxs(El,{testId:"connect-machines",className:"gap-4",children:[d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx("img",{src:Z,width:20,height:20,alt:"",className:"shrink-0"}),d.jsx("span",{className:"text-sm font-semibold text-sec",children:"Hive"})]}),d.jsxs("div",{className:"flex items-center justify-between gap-2",children:[d.jsx("h1",{className:"text-xl font-semibold text-pri",children:_("connect.machines.heading")}),k?d.jsx("button",{type:"button","aria-label":_("common.refresh"),"data-testid":"connect-machines-refresh",onClick:k,className:"flex h-10 w-10 shrink-0 items-center justify-center rounded-md text-sec",style:{background:"var(--bg-2)",border:"1px solid var(--border-bright)"},children:d.jsx(sm,{size:16,"aria-hidden":!0})}):null]}),L?d.jsx("p",{"data-testid":"connect-error",className:"rounded-lg px-3 py-2 text-sm",style:{background:"color-mix(in oklab, var(--status-red) 12%, transparent)",color:"var(--status-red)"},children:_(L)}):null,o.length===0?d.jsxs("div",{className:"flex flex-1 flex-col items-center justify-center gap-4 px-4 text-center",children:[d.jsx("span",{className:"flex h-16 w-16 items-center justify-center rounded-2xl",style:{background:"color-mix(in oklab, var(--accent) 12%, transparent)",color:"var(--accent-hover, var(--accent))"},"aria-hidden":!0,children:d.jsx(Ud,{size:28})}),d.jsx("p",{"data-testid":"connect-machines-empty",className:"max-w-[280px] text-sm text-ter",children:_("connect.machines.empty")}),d.jsx("div",{className:"flex w-full max-w-[320px] flex-col gap-3 pt-2",children:d.jsx(Es,{testId:"connect-machines-back",...T?{onClick:T}:{},children:_("connect.machines.back")})})]}):d.jsx("ul",{className:"flex flex-col gap-2.5",children:o.map(M=>{const K=m===M.id,U=!M.online||M.revoked||$;let I,X="var(--text-tertiary)";if(M.revoked)I=_("connect.machines.revoked"),X="var(--status-red)";else if(M.online)K?(I=_("connect.machines.connecting"),X="var(--text-secondary)"):(I=_("connect.machines.online"),X="var(--status-green)");else{const W=M.lastSeen!=null?T6(M.lastSeen):null;I=W!=null?_("connect.machines.lastSeen",{ago:W}):_("connect.machines.offline")}const O=M.revoked?"var(--status-red)":M.online?"var(--status-green)":"var(--text-tertiary)";return d.jsx("li",{children:d.jsxs("button",{type:"button","data-testid":`connect-machine-${M.id}`,className:"flex w-full items-center gap-3 rounded-xl border px-3.5 py-3 text-left transition-colors",style:{minHeight:"64px",borderColor:"var(--border-bright)",background:K?"var(--bg-2)":"var(--bg-1)",opacity:U&&!K?.55:1,cursor:U?"not-allowed":"pointer"},disabled:U,"aria-disabled":U,onClick:()=>C(M.id),children:[d.jsxs("span",{className:"relative shrink-0","aria-hidden":!0,children:[d.jsx("span",{className:"flex h-10 w-10 items-center justify-center rounded-lg",style:{background:"color-mix(in oklab, var(--accent) 12%, transparent)",color:"var(--accent-hover, var(--accent))"},children:d.jsx(Ud,{size:20})}),d.jsx("span",{className:"absolute -right-0.5 -bottom-0.5 h-3 w-3 rounded-full border-2",style:{background:O,borderColor:"var(--bg-1)"}})]}),d.jsxs("span",{className:"min-w-0 flex-1",children:[d.jsx("span",{className:"block truncate text-[15px] font-medium text-pri",children:M.name}),d.jsx("span",{className:"mt-0.5 block text-xs",style:{color:X},children:I})]}),K?d.jsx("span",{"aria-hidden":!0,className:"h-4 w-4 shrink-0 animate-spin rounded-full border-2",style:{borderColor:"var(--border-bright)",borderTopColor:"var(--accent)"}}):U?null:d.jsx(Jl,{size:18,className:"shrink-0 text-ter","aria-hidden":!0})]})},M.id)})}),v?d.jsx("div",{className:"mt-auto pt-4 text-center",children:d.jsx("a",{href:"/machines",className:"text-xs underline-offset-2 hover:underline",style:{color:"var(--text-tertiary)"},children:_("connect.machines.manageDevices")})}):null]})}if(r==="selecting"){const $=o.find(M=>M.id===i);return d.jsxs(El,{testId:"connect-pair-guide",className:"gap-4",children:[d.jsxs("button",{type:"button",className:"-ml-2 flex items-center gap-1 self-start rounded-md px-2 text-sm text-sec",style:{minHeight:"44px"},onClick:T,children:[d.jsx(J2,{size:16,"aria-hidden":!0}),_("connect.pair.back")]}),d.jsxs("div",{children:[d.jsx("h1",{className:"text-xl font-semibold text-pri",children:_("connect.pair.guideHeading")}),$?d.jsxs("p",{className:"mt-1 flex items-center gap-1.5 text-sm text-ter",children:[d.jsx(Ud,{size:14,"aria-hidden":!0,className:"shrink-0"}),d.jsx("span",{className:"truncate",children:$.name})]}):null]}),L?d.jsx("p",{"data-testid":"connect-error",className:"rounded-lg px-3 py-2 text-sm",style:{background:"color-mix(in oklab, var(--status-red) 12%, transparent)",color:"var(--status-red)"},children:_(L)}):null,d.jsx("ol",{className:"flex flex-col gap-3",children:["connect.pair.guideStep1","connect.pair.guideStep2","connect.pair.guideStep3"].map((M,K)=>d.jsxs("li",{className:"flex items-start gap-3 text-sm text-sec",children:[d.jsx("span",{"aria-hidden":!0,className:"mt-px flex h-[22px] w-[22px] shrink-0 items-center justify-center rounded-lg text-xs font-semibold",style:{background:"color-mix(in oklab, var(--accent) 13%, transparent)",border:"1px solid color-mix(in oklab, var(--accent) 34%, transparent)",color:"var(--accent-hover)"},children:K+1}),d.jsx("span",{className:"min-w-0 leading-relaxed",children:_(M)})]},M))}),d.jsxs("label",{className:"flex flex-col gap-2 text-xs uppercase tracking-wider text-ter",children:[_("connect.pair.qrLabel"),d.jsx("input",{type:"text","data-testid":"connect-code-input",className:"input mono text-center",inputMode:"text",autoCapitalize:"characters",autoCorrect:"off",autoComplete:"off",spellCheck:!1,placeholder:"XXXX-XXXX-XXXX",maxLength:14,value:j,onChange:M=>{R.current=!1,ee(M.target.value)},style:{fontSize:"18px",letterSpacing:"0.12em",minHeight:"52px"}})]}),d.jsx(Es,{primary:!0,testId:"connect-code-submit",disabled:!Q,onClick:()=>{i&&!R.current&&(R.current=!0,x(i,j.trim()))},children:_("connect.pair.submit")})]})}if(r==="pairing"){const $=B;return d.jsxs(El,{testId:"connect-pairing",className:"justify-center gap-6",children:[te&&!$?d.jsxs("div",{className:"flex flex-col items-center gap-4",children:[d.jsx("div",{"data-testid":"connect-pairing-sas",className:"mono rounded-2xl border px-7 py-5 font-bold text-pri","aria-live":"polite",style:{fontSize:"2.5rem",letterSpacing:"0.25em",paddingRight:"calc(1.75rem - 0.25em)",background:"var(--bg-1)",borderColor:"var(--border-bright)"},children:h}),d.jsx("p",{className:"text-center text-sm text-ter",style:{maxWidth:"280px"},children:_(P?"connect.pair.finalizing":"connect.pair.sasInstruction")}),P?d.jsx("span",{"aria-hidden":!0,className:"h-5 w-5 animate-spin rounded-full border-2",style:{borderColor:"var(--border-bright)",borderTopColor:"var(--accent)"}}):null]}):null,D&&!te&&!$?d.jsx("p",{"data-testid":"connect-pairing-phase",className:"text-center text-sm text-ter",children:_(D)}):null,$&&D?d.jsx("p",{"data-testid":"connect-pairing-phase",className:"text-center text-sm",style:{color:"var(--status-red)"},children:_(D)}):null,P?null:d.jsx("div",{className:"flex flex-col gap-3",children:d.jsx(Es,{primary:$,testId:"connect-pairing-cancel",onClick:()=>{A(""),R.current=!1,E?E():t.pairingClient?.cancel()},children:_($?"connect.pair.startOver":"common.cancel")})})]})}return null},R6=()=>{if(typeof navigator>"u")return"Phone";const t=navigator.userAgent??"";let r="Phone";/iPad/.test(t)?r="iPad":/iPhone/.test(t)?r="iPhone":/Android/.test(t)&&(r="Android");let o="Browser";return/EdgA?\//.test(t)?o="Edge":/SamsungBrowser\//.test(t)?o="Samsung":/OPR\/|OPT\//.test(t)?o="Opera":/Firefox\//.test(t)?o="Firefox":/Chrome\//.test(t)?o="Chrome":/Safari\//.test(t)&&(o="Safari"),`${r} · ${o}`.slice(0,48)},O6=({children:t,connectTransport:r,createFlow:o=m6,store:i,gatewayBaseUrl:l,isGateway:c=Fx})=>{const f=c(),[h,g]=b.useState("login"),[m,y]=b.useState([]),[v,k]=b.useState(null),[S,C]=b.useState(void 0),[x,E]=b.useState(null),[T,_]=b.useState(null),[j,A]=b.useState(null),[R,D]=b.useState(null),[L,B]=b.useState(!1),[P,te]=b.useState(null),[ee,F]=b.useState(!1),[Q,Z]=b.useState(!0),$=b.useMemo(()=>o({store:i??S6(),connectTransport:r,...l?{gatewayBaseUrl:l}:{},proposedName:R6(),onPhase:g,onPairingPhase:le=>{E(le),le!=="error"&&le!=="expired"&&le!=="rejected"&&_(null)},onPairingSas:D,onPairingFailure:le=>_(le.code)}),[o,i,r,l]),M=b.useRef($);M.current=$;const K=b.useRef(0),U=b.useCallback(()=>{E(null),_(null),D(null)},[]),I=b.useCallback(()=>(K.current+=1,K.current),[]),X=b.useCallback(le=>K.current===le,[]);b.useEffect(()=>{let le=!1;return M.current.loadMachines().then(({daemons:ie,selfDeviceId:se})=>{le||(y(ie),k(se))}).catch(()=>{}).finally(()=>{le||Z(!1)}),()=>{le=!0}},[]);const O=b.useCallback(()=>{const le=I();A(null),U(),B(!0),M.current.loadMachines().then(({daemons:ie,selfDeviceId:se})=>{X(le)&&(y(ie),k(se))}).finally(()=>{X(le)&&B(!1)})},[U,X,I]),W=b.useCallback(le=>{const ie=I();A(null),U(),F(!1),B(!0),M.current.loadMachines(le).then(({daemons:se,selfDeviceId:de})=>{X(ie)&&(y(se),k(de))}).catch(()=>{X(ie)&&F(!0)}).finally(()=>{X(ie)&&B(!1)})},[U,X,I]),oe=b.useCallback(le=>{const ie=I();C(le),A(null),U(),te(le),(async()=>{const se=await M.current.selectDaemon(le);X(ie)&&(te(null),!se.ok&&se.failure.code==="select_failed"&&A("select_failed"),!se.ok&&se.failure.code==="relay_revoked"&&A("relay_revoked"))})()},[U,X,I]),ue=b.useCallback((le,ie)=>{const se=I();A(null),U(),(async()=>{const de=await b6({code:ie,daemonId:le,gatewayUrl:l??window.location.origin});if(!X(se))return;if(!de){A("invalid_code");return}const me=await M.current.selectDaemon(le,de);X(se)&&(!me.ok&&me.failure.code==="select_failed"&&A("select_failed"),!me.ok&&me.failure.code==="relay_revoked"&&A("relay_revoked"))})()},[U,l,X,I]),fe=b.useCallback(()=>{I(),M.current.pairingClient?.cancel(),U(),A(null),g(S?"selecting":"machines")},[U,I,S]),pe=b.useCallback(()=>{I(),A(null),U(),g("machines")},[U,I]);return h==="connected"?(typeof history<"u"&&history.replaceState(null,"","/app"),d.jsx(d.Fragment,{children:t})):Q?d.jsxs("div",{className:"connect-screen flex min-h-full flex-col items-center justify-center gap-3 p-6",children:[d.jsx("img",{src:f?"/brand/icon-192.png":"/logo.png",width:56,height:56,alt:"",className:"animate-pulse"}),d.jsx("span",{className:"sr-only","aria-live":"polite",children:"…"})]}):d.jsx(j6,{flow:$,phase:h,machines:m,selfDeviceId:v,...S?{selectedMachineId:S}:{},pairingPhase:x,pairingFailureCode:T,connectError:j,sas:R,isSigningIn:L,pendingMachineId:P,loginError:ee,isGatewayBundle:f,onRefreshMachines:O,onSelectProvider:W,onSelectMachine:oe,onSubmitCode:ue,onCancelPairing:fe,onGoBack:pe})},D6=(t,r,o)=>t.mode==="tunnel"?d.jsx(o,{connectTransport:t.connectTransport,children:d.jsx(r,{})}):d.jsx(r,{}),Ve={Open:1,Data:2,End:3,Reset:4,Ping:5,Ack:6},Zl={Http:1,Ws:2},zt={ProtocolError:1,VersionMismatch:4},w0={INITIAL_WINDOW:256*1024,ACK_THRESHOLD:32*1024},Ql=12,x0=0,em=4294967295,Vx=4294967295,M6=0,Gx=1;class Ht extends Error{code;constructor(r,o){super(r),this.name="ProtocolError",this.code=o}}const L6=new TextEncoder,z6=new TextDecoder;function $x(t){return L6.encode(t)}function bc(t){return new DataView(t.buffer,t.byteOffset,t.byteLength)}function tm(t,r){if(!Number.isInteger(t)||t<0||t>Vx)throw new RangeError(`${r} out of u32 range: ${t}`)}function Xx(t){return t===Ve.Open||t===Ve.Data||t===Ve.End||t===Ve.Reset||t===Ve.Ping||t===Ve.Ack}function Zx(t){return(t&-2)===0}function k0(t){if(t.version!==yn)throw new RangeError(`version must be ${yn}`);if(!Xx(t.kind))throw new RangeError(`unknown kind: ${t.kind}`);if(!Number.isInteger(t.flags)||t.flags<0||t.flags>65535)throw new RangeError(`flags out of u16 range: ${t.flags}`);if(t.kind===Ve.Data){if(!Zx(t.flags))throw new RangeError("reserved flag bits set on Data frame")}else if(t.flags!==0)throw new RangeError("flags must be 0 on a non-Data frame");tm(t.streamId,"streamId"),tm(t.seq,"seq");const r=new Uint8Array(Ql),o=bc(r);return o.setUint8(0,t.version),o.setUint8(1,t.kind),o.setUint16(2,t.flags),o.setUint32(4,t.streamId),o.setUint32(8,t.seq),r}function H6(t){if(t.length<Ql)throw new Ht("header too short",zt.ProtocolError);const r=bc(t),o=r.getUint8(0);if(o!==yn)throw new Ht(`bad version ${o}`,zt.VersionMismatch);const i=r.getUint8(1);if(!Xx(i))throw new Ht(`unknown kind ${i}`,zt.ProtocolError);const l=r.getUint16(2);if(i===Ve.Data){if(!Zx(l))throw new Ht("reserved flag bits set on Data frame",zt.ProtocolError)}else if(l!==0)throw new Ht("flags must be 0 on a non-Data frame",zt.ProtocolError);const c=r.getUint32(4),f=r.getUint32(8);return{version:o,kind:i,flags:l,streamId:c,seq:f}}function S0(t){let r;if(t.transport===Zl.Http){if(!t.http)throw new RangeError("http meta required for Http transport");r=t.http}else if(t.transport===Zl.Ws){if(!t.ws)throw new RangeError("ws meta required for Ws transport");r=t.ws}else throw new RangeError(`unknown transport: ${t.transport}`);const o=$x(JSON.stringify(r));if(o.length>65535)throw new RangeError("open meta too large");const i=new Uint8Array(3+o.length);return i[0]=t.transport,bc(i).setUint16(1,o.length),i.set(o,3),i}function B6(t){if(!Array.isArray(t))return!1;for(const r of t)if(!Array.isArray(r)||r.length!==2||typeof r[0]!="string"||typeof r[1]!="string")return!1;return!0}const wc={ConnSalt:1,Hello:2},nm={daemon:1,device:2},W6=34;function U6(t){if(t.salt.length!==32)throw new RangeError(`conn salt must be 32 bytes, got ${t.salt.length}`);const r=new Uint8Array(34);return r[0]=wc.ConnSalt,r[1]=nm.device,r.set(t.salt,2),r}function q6(t){if(t.length!==W6)throw new Ht("conn salt must be 34 bytes",zt.ProtocolError);if(t[0]!==wc.ConnSalt)throw new Ht("not a ConnSalt frame",zt.ProtocolError);const r=t[1],o=r===nm.daemon?"daemon":r===nm.device?"device":null;if(o===null)throw new Ht("bad conn salt role",zt.ProtocolError);return{role:o,salt:t.slice(2)}}function I6(t){return t.length>=1&&t[0]===wc.ConnSalt}function P6(t){if(t.role!=="daemon"&&t.role!=="device")throw new RangeError(`bad role: ${t.role}`);const r=$x(JSON.stringify(t)),o=new Uint8Array(1+r.length);return o[0]=wc.Hello,o.set(r,1),o}function K6(t){tm(t,"cumulativeBytes");const r=new Uint8Array(4);return bc(r).setUint32(0,t),r}function F6(t,r){const o=new Uint8Array(1+t.length);return o[0]=r?1:0,o.set(t,1),o}function Y6(t){if(t.length<1)throw new Ht("ws message too short",zt.ProtocolError);const r=t[0];if(r!==0&&r!==1)throw new Ht("bad ws isText flag",zt.ProtocolError);return{data:t.slice(1),isText:r===1}}function E0(t){const r=new Uint8Array(1+t.length);return r[0]=Gx,r.set(t,1),r}function V6(t){if(t.length<1)throw new Ht("http data too short",zt.ProtocolError);const r=t[0];if(r===M6){let o;try{o=JSON.parse(z6.decode(t.subarray(1)))}catch{throw new Ht("http head not JSON",zt.ProtocolError)}const i=o;if(typeof i.status!="number"||!B6(i.headers))throw new Ht("bad http head",zt.ProtocolError);return{kind:"head",head:{status:i.status,headers:i.headers}}}if(r===Gx)return{kind:"body",data:t.slice(1)};throw new Ht(`unknown http disc ${r}`,zt.ProtocolError)}function C0(t){let r=1;return()=>{r===em&&(r+=2);const o=r;if(r+=2,r>Vx)throw new RangeError("stream id space exhausted; re-handshake required");return o}}const G6={ok:!0};function T0(t=w0.INITIAL_WINDOW,r=w0.ACK_THRESHOLD){let o=0,i=0,l=0,c=0;const f=()=>o-i,h=()=>f()>=t;return{trySend(g){return f()+g>t?{ok:!1,reason:"WindowExhausted"}:(o+=g,G6)},applyAck(g){const m=h();return g<=i?{resumed:!1}:(i=Math.min(g,o),{resumed:m&&!h()})},onConsume(g){return l+=g,l-c>=r?(c=l,{ackCumulative:l}):null},flushAck(){return c=l,{ackCumulative:l}},isPaused:()=>h()}}const $6=1,Cf=256*1024,rm=new TextEncoder,X6=new TextDecoder,Z6=t=>{let r=0;for(const l of t)r+=l.length;const o=new Uint8Array(r);let i=0;for(const l of t)o.set(l,i),i+=l.length;return o},Q6=t=>{if(typeof t=="string")return{bytes:rm.encode(t),isText:!0};if(t instanceof Uint8Array)return{bytes:t,isText:!1};if(t instanceof ArrayBuffer)return{bytes:new Uint8Array(t),isText:!1};const r=t;return{bytes:new Uint8Array(r.buffer,r.byteOffset,r.byteLength),isText:!1}},J6=t=>{const r=t.generateConnSalt??QO;let o=null,i=null,l=null,c=null,f=null,h=C0();const g=new Map,m=(j,A)=>{if(j.length!==A.length)return!1;for(let R=0;R<j.length;R++)if(j[R]!==A[R])return!1;return!0},y=(j,A,R,D=0)=>{if(!i||!o)throw new Error("frame-mux: seal before channel handshake complete");const L=k0({version:yn,kind:j,flags:D,streamId:A,seq:i.nextSeq});t.onSeal?.({key:o.p2d,direction:"p2d",headerBytes:L});const{ciphertext:B}=o6(i,{key:o.p2d,headerBytes:L,payload:R}),P=new Uint8Array(L.length+B.length);return P.set(L,0),P.set(B,L.length),P},v=()=>{t.send(y(Ve.Data,x0,P6({protocolVersion:yn,role:"device",daemonId:t.daemonId,deviceId:t.deviceId})))},k=j=>{c&&(f&&m(f,j)||(o=JO({rootD2p:t.roots.d2p,rootP2d:t.roots.p2d,phoneConnSalt:c,daemonConnSalt:j,ids:{daemonId:t.daemonId,deviceId:t.deviceId,protocolVersion:yn}}),i=r6("p2d"),l=a6("d2p"),f=Uint8Array.from(j),v(),t.onReady?.()))},S=(j,A)=>{t.send(y(Ve.Ack,j,K6(A)))},C=(j,A)=>{if(!o)return Promise.reject(new Error("tunnel: channel not ready"));const R=h(),D=(A?.method??"GET").toUpperCase(),L=[];A?.headers&&new Headers(A.headers).forEach((ee,F)=>{L.push([F,ee])});const B=A?.body===void 0||A.body===null?void 0:eD(A.body),P=B!==void 0&&B.length>0;return new Promise((te,ee)=>{const F={kind:"http",body:[],recvFlow:T0(),resolve:te,reject:ee,settled:!1};g.set(R,F),t.send(y(Ve.Open,R,S0({transport:Zl.Http,http:{method:D,path:j,headers:L,hasBody:P}}))),P&&B?B.length<=Cf?(t.send(y(Ve.Data,R,E0(B))),t.send(y(Ve.End,R,new Uint8Array(0)))):x(R,F,B):t.send(y(Ve.End,R,new Uint8Array(0)))})},x=async(j,A,R)=>{try{for(let D=0;D<R.length;D+=Cf){if(D>0&&t.awaitDrain&&await t.awaitDrain(),A.settled)return;t.send(y(Ve.Data,j,E0(R.subarray(D,D+Cf))))}if(A.settled)return;t.send(y(Ve.End,j,new Uint8Array(0)))}catch(D){if(A.settled)return;A.settled=!0,g.delete(j),A.reject(D)}},E=(j,A)=>{if(A.settled)return;A.settled=!0,g.delete(j);const R=A.head,D=Z6(A.body);if(!R){A.reject(new Error("tunnel: stream ended without an HTTP head"));return}let L=null;if(D.length>0){const B=new ArrayBuffer(D.length);new Uint8Array(B).set(D),L=B}A.resolve(new Response(L,{status:R.status,headers:R.headers}))};class T{OPEN=1;readyState=0;onopen=null;onmessage=null;onclose=null;onerror=null;streamId;constructor(A){this.streamId=A}send(A){if(this.readyState!==this.OPEN)return;const{bytes:R,isText:D}=Q6(A);t.send(y(Ve.Data,this.streamId,F6(R,D)))}close(A,R){if(this.readyState===3)return;const D=this.readyState===this.OPEN;this.readyState=3,D&&t.send(y(Ve.End,this.streamId,new Uint8Array(0))),g.delete(this.streamId)}_deliver(A,R){this.onmessage&&this.onmessage({data:R?X6.decode(A):A})}_remoteClose(A,R){this.readyState!==3&&(this.readyState=3,g.delete(this.streamId),this.onclose?.(R===void 0?{code:A}:{code:A,reason:R}))}}return{beginChannel(){c=r(),o=null,i=null,l=null,f=null,this.resetAll("rekey"),h=C0();const j=k0({version:yn,kind:Ve.Data,flags:0,streamId:em,seq:0}),A=U6({salt:c}),R=new Uint8Array(j.length+A.length);R.set(j,0),R.set(A,j.length),t.send(R)},onFrame(j){const A=j.subarray(0,Ql),R=j.subarray(Ql),D=H6(A);if(D.streamId===em&&I6(R)){const{role:P,salt:te}=q6(R);P==="daemon"&&k(te);return}if(!l||!o)return;const L=s6(l,{key:o.d2p,headerBytes:A,ciphertext:R,seq:D.seq});if(D.streamId===x0)return;const B=g.get(D.streamId);if(B){if(B.kind==="http"){if(D.kind===Ve.Reset){B.settled||(B.settled=!0,g.delete(D.streamId),B.reject(new Error("tunnel: HTTP stream reset by daemon")));return}if(D.kind===Ve.Data){const P=V6(L);if(P.kind==="head")B.head=P.head;else{B.body.push(P.data);const te=B.recvFlow.onConsume(P.data.length);te&&S(D.streamId,te.ackCumulative)}(D.flags&$6)!==0&&E(D.streamId,B);return}if(D.kind===Ve.End){E(D.streamId,B);return}return}if(D.kind===Ve.Data){const P=Y6(L),te=B.recvFlow.onConsume(P.data.length);te&&S(D.streamId,te.ackCumulative),B.socket._deliver(P.data,P.isText);return}if(D.kind===Ve.End||D.kind===Ve.Reset){B.socket._remoteClose(D.kind===Ve.Reset?1011:1e3);return}}},fetch:C,openWebSocket:(j,A)=>{if(!o){const B=new T(-1);return queueMicrotask(()=>B._remoteClose(1011,"tunnel: channel not ready")),B}const R=h(),D=[];if(A)for(const[B,P]of Object.entries(A))P!==void 0&&D.push([B,String(P)]);const L=new T(R);return g.set(R,{kind:"ws",recvFlow:T0(),socket:L}),t.send(y(Ve.Open,R,S0({transport:Zl.Ws,ws:D.length>0?{path:j,query:D}:{path:j}}))),queueMicrotask(()=>{L.readyState===0&&(L.readyState=L.OPEN,L.onopen?.())}),L},resetAll(j){for(const[A,R]of[...g.entries()])g.delete(A),R.kind==="http"?R.settled||(R.settled=!0,R.reject(new Error(`tunnel: connection lost (${j})`))):R.socket._remoteClose(1006,j)}}},eD=t=>typeof t=="string"?rm.encode(t):t instanceof Uint8Array?t:t instanceof ArrayBuffer?new Uint8Array(t):ArrayBuffer.isView(t)?new Uint8Array(t.buffer,t.byteOffset,t.byteLength):rm.encode(String(t)),tD=2e4,nD=1e4,rD=6,aD=()=>{let t=0;return{next(){t+=1;const r=Math.min(3e4,500*2**(t-1));return Math.floor(r/2+Math.random()*(r/2))},reset(){t=0}}},oD=(t,r)=>!r&&(t===fa.Forbidden||t===fa.Unauthorized),sD=(t,r)=>{const o=t.WebSocketImpl??WebSocket,i=t.setTimer??((ee,F)=>setTimeout(ee,F)),l=t.clearTimer??(ee=>clearTimeout(ee)),c=t.backoff??aD(),f=t.heartbeatMs??tD,h=t.heartbeatDeadlineMs??nD,g=t.maxOfflineRetries??rD;let m=null,y=0,v=!1,k=!1,S=!1,C=0,x=null,E=null,T=null;const _=`${t.gatewayUrl}/relay?daemonId=${encodeURIComponent(t.daemonId)}`,j=()=>{T!==null&&(l(T),T=null)},A=()=>{E!==null&&(clearInterval(E),E=null),j()},R=(ee,F)=>{A(),E=setInterval(()=>{if(ee.readyState===ee.OPEN){try{ee.send(ux)}catch{}T===null&&(T=i(()=>{if(T=null,!(F!==y||k)){A();try{ee.close()}catch{}}},h))}},f)},D=()=>{if(k||v||S)return;const ee=++y;let F=!1;const Q=new o(_,[`bearer.${t.phoneSessionToken}`]);Q.binaryType="arraybuffer",m=Q,Q.onopen=()=>{ee!==y||k||(F=!0,c.reset(),C=0,R(Q,ee),r.onUp())},Q.onmessage=Z=>{if(ee!==y||k)return;const $=Z.data;if(typeof $=="string"){if($.startsWith(Qy)){let K;try{K=JSON.parse($.slice(Qy.length))}catch{return}if(K.t==="revoked"){L(fa.Revoked),r.onControl(K);return}r.onControl(K);return}$===dx&&j();return}const M=$ instanceof ArrayBuffer?new Uint8Array($):new Uint8Array($);r.onFrame(M)},Q.onerror=()=>{},Q.onclose=Z=>{if(ee!==y||k)return;A(),m=null;const $=Z.code??fa.InternalError;if(d5($)||oD($,F)){L($);return}if($===fa.DaemonOffline){if(C+=1,C>=g){S=!0,r.onDown({code:$,authFatal:!1,daemonOffline:!0});return}}else C=0;const M=c.next();r.onDown({code:$,authFatal:!1,nextRetryInMs:M}),x=i(()=>{x=null,D()},M)}},L=ee=>{v||(v=!0,A(),x!==null&&(l(x),x=null),r.onDown({code:ee,authFatal:!0}))},B=()=>{k||v||S||m!==null&&(m.readyState===m.OPEN||m.readyState===WebSocket.CONNECTING)||(x!==null&&(l(x),x=null),D())},P=()=>{typeof document<"u"&&document.visibilityState==="visible"&&B()},te=()=>B();return typeof document<"u"&&document.addEventListener("visibilitychange",P),typeof window<"u"&&window.addEventListener("online",te),D(),{send(ee){m&&m.readyState===m.OPEN&&m.send(ee)},bufferedAmount:()=>m&&m.readyState===m.OPEN?m.bufferedAmount:0,isOpen:()=>m!==null&&m.readyState===m.OPEN,resume(){k||v||!S||(S=!1,C=0,c.reset(),D())},close(){if(k=!0,y+=1,A(),x!==null&&(l(x),x=null),m){try{m.close()}catch{}m=null}typeof document<"u"&&document.removeEventListener("visibilitychange",P),typeof window<"u"&&window.removeEventListener("online",te)}}};function iD(t){const r=t.session??t.persistedSession?.()??null;if(!r)throw new Error("createTunnelTransport: no session and persistedSession() returned null");let o={state:"connecting"};const i=(A,R)=>{o={state:A,...R?.reason?{reason:R.reason}:{},...R?.nextRetryInMs!==void 0?{nextRetryInMs:R.nextRetryInMs}:{},...R?.retry?{retry:R.retry}:{}},t.onStatus(o)};let l=null,c=!1,f=!1,h=!1;const g=new Set,m=t.setTimer??((A,R)=>setTimeout(A,R)),y=t.clearTimer??(A=>clearTimeout(A)),v=()=>{for(const A of g)A.timer!==null&&y(A.timer),A.resolve();g.clear()},k=A=>{for(const R of g)R.timer!==null&&y(R.timer),R.reject(new Error(`tunnel: ${A}`));g.clear()},S=()=>{c=!1},C=()=>{c||(h=!1,f=!1,c=!0,i("online"),v())},x=()=>{h=!0,c=!1,j.beginChannel()},E=4*1024*1024,T=50,_=()=>new Promise(A=>{const R=()=>{if(!l||l.bufferedAmount()<=E){A();return}m(R,T)};R()}),j=J6({roots:r.roots,daemonId:r.daemonId,deviceId:r.deviceId,send:A=>l?.send(A),onReady:C,awaitDrain:_});return l=sD({gatewayUrl:r.gatewayUrl,daemonId:r.daemonId,phoneSessionToken:r.phoneSessionToken,...t.WebSocketImpl?{WebSocketImpl:t.WebSocketImpl}:{},...t.setTimer?{setTimer:t.setTimer}:{},...t.clearTimer?{clearTimer:t.clearTimer}:{},...t.backoff?{backoff:t.backoff}:{}},{onFrame:A=>{try{j.onFrame(A)}catch{j.resetAll("frame_open_failed"),l?.close(),i("disconnected",{reason:"integrity"})}},onControl:A=>{if(A.t==="peer-offline"&&A.role==="daemon")f=!0,h=!1,S(),j.resetAll("peer_offline"),i("reconnecting");else if(A.t==="peer-online"&&A.role==="daemon"){if(c||h||!f)return;f=!1,x()}else A.t==="revoked"&&(f=!1,h=!1,S(),j.resetAll("revoked"),k(A.reason??"revoked"),i("revoked",{reason:A.reason}))},onUp:()=>{f=!1,x()},onDown:A=>{f=!1,h=!1,S(),j.resetAll(A.authFatal?"auth_fatal":A.daemonOffline?"daemon_offline":"transient"),A.authFatal?(k("auth_fatal"),i("revoked")):A.daemonOffline?(k("daemon_offline"),i("disconnected",{reason:"daemon_offline",retry:()=>l?.resume()})):i("reconnecting",A.nextRetryInMs!==void 0?{nextRetryInMs:A.nextRetryInMs}:void 0)}}),{requiresUiSession:!1,fetch:(A,R)=>j.fetch(A,R),openWebSocket:(A,R)=>j.openWebSocket(A,R),status:()=>o,ready:(A={})=>{if(c)return Promise.resolve();const R=A.timeoutMs??1e4;return new Promise((D,L)=>{const B={resolve:D,reject:L,timer:null};B.timer=m(()=>{g.delete(B),L(new Error("tunnel: channel ready timed out"))},R),g.add(B)})},dispose:()=>{f=!1,h=!1,S(),l?.close(),l=null,j.resetAll("disposed"),k("disposed")}}}const lD=t=>{const r=t.onStatus??(()=>{});return async({daemonId:o,deviceId:i,stored:l})=>{let c;try{c=await t.resolveSession({daemonId:o,deviceId:i,stored:l})}catch(h){return h.relayTokenStatus===403?{ok:!1,failure:{code:"relay_revoked",message:`device session revoked for ${o}`}}:{ok:!1,failure:{code:"select_failed",message:`could not establish a session for ${o}: ${h.message}`}}}const f=iD({session:c,onStatus:r,...t.WebSocketImpl?{WebSocketImpl:t.WebSocketImpl}:{}});try{await f.ready({timeoutMs:t.readyTimeoutMs??1e4})}catch(h){return f.dispose(),{ok:!1,failure:{code:"select_failed",message:`could not open a ready tunnel for ${o}: ${h.message}`}}}return NE(f),{ok:!0}}},cD=(t={})=>{if(!(t.isGateway??Fx)())return{mode:"direct"};if(!t.resolveSession)throw new Error("bootTransport: a gateway bundle requires resolveSession to build the tunnel");return{mode:"tunnel",connectTransport:lD({resolveSession:t.resolveSession,...t.onStatus?{onStatus:t.onStatus}:{},...t.WebSocketImpl?{WebSocketImpl:t.WebSocketImpl}:{},...t.readyTimeoutMs!==void 0?{readyTimeoutMs:t.readyTimeoutMs}:{}})}},uD=async({stored:t})=>{if(!t)throw new Error("mobileResolveSession: no persisted device session for the selected daemon");const r=window.location.origin,o=r.replace(/^http/,"ws"),i=await fetch(`${r}/pair/relay-token`,{method:"POST",credentials:"include"});if(!i.ok)throw Object.assign(new Error(`mobileResolveSession: relay-token request failed (${i.status})`),{relayTokenStatus:i.status});const{token:l}=await i.json();return{roots:{d2p:qs(t.rootKeys.d2p),p2d:qs(t.rootKeys.p2d)},deviceId:t.deviceId,daemonId:t.daemonId,gatewayUrl:o,phoneSessionToken:l}},Qx=document.getElementById("root");if(!Qx)throw new Error("Root element not found");const dD=cD({resolveSession:uD,onStatus:nR});_2.createRoot(Qx).render(d.jsx(b.StrictMode,{children:D6(dD,u5,O6)}));D3();export{cm as $,R0 as A,AD as B,wo as C,CD as D,Ks as E,bD as F,kD as G,H0 as H,D0 as I,Xs as J,SD as K,xo as L,BS as M,TD as N,Vs as O,Ys as P,im as Q,Fs as R,eE as S,ct as T,kS as U,ED as V,U0 as W,fo as X,wD as Y,xD as Z,Lr as _,ND as a,hc as a0,M_ as a1,gD as a2,vD as a3,YE as a4,yD as a5,nc as a6,lb as a7,sm as a8,WD as a9,M0 as aa,ES as ab,As as ac,UD as ad,L0 as ae,mj as af,HD as ag,Ct as ah,ob as ai,Mw as aj,BD as ak,zC as al,wS as am,pD as an,hD as ao,J2 as ap,Jl as b,we as c,sS as d,Qt as e,RD as f,fD as g,nE as h,Tt as i,d as j,Gs as k,_D as l,$s as m,fS as n,OD as o,DD as p,ko as q,b as r,mD as s,tc as t,Ee as u,MD as v,jD as w,bo as x,ec as y,zD as z};