@tt-a1i/hive 2.0.2 → 2.1.1

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 +42 -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 +12 -4
  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-CTOsPurT.js +2 -0
  122. package/web/dist/assets/AddWorkspaceFlow-D_fSv-cO.js +1 -0
  123. package/web/dist/assets/FirstRunWizard-C24MUssx.js +1 -0
  124. package/web/dist/assets/{MarketplaceDrawer-Dd8WIA8T.js → MarketplaceDrawer-7gVUjgAx.js} +11 -11
  125. package/web/dist/assets/TaskGraphDrawer-Beh95yUu.js +1 -0
  126. package/web/dist/assets/WhatsNewDialog-vnShQWjg.js +1 -0
  127. package/web/dist/assets/WorkerModal-DcxIBPlu.js +1 -0
  128. package/web/dist/assets/{WorkflowsDrawer-Bjf4olbR.js → WorkflowsDrawer-C8csID1I.js} +1 -1
  129. package/web/dist/assets/WorkspaceMemoryDrawer-C_Aq9-o6.js +1 -0
  130. package/web/dist/assets/{WorkspaceTaskDrawer-BIWwISvA.js → WorkspaceTaskDrawer-CIMYzlpt.js} +1 -1
  131. package/web/dist/assets/index-3Hc1oXlt.css +1 -0
  132. package/web/dist/assets/index-D9zUE0W6.js +79 -0
  133. package/web/dist/assets/{search-Bk2HQvO7.js → search-BRQbevR2.js} +1 -1
  134. package/web/dist/assets/{square-terminal-D93m9hfY.js → square-terminal-Co4pmGzn.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-CIMYzlpt.js","assets/TaskGraphDrawer-Beh95yUu.js","assets/AddWorkerDialog-CTOsPurT.js","assets/search-BRQbevR2.js","assets/square-terminal-Co4pmGzn.js","assets/WorkflowsDrawer-C8csID1I.js","assets/WorkspaceMemoryDrawer-C_Aq9-o6.js"])))=>i.map(i=>d[i]);
2
+ function C2(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 O0(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var Wd={exports:{}},Es={};var qv;function T2(){if(qv)return Es;qv=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 Es.Fragment=r,Es.jsx=o,Es.jsxs=o,Es}var Iv;function A2(){return Iv||(Iv=1,Wd.exports=T2()),Wd.exports}var u=A2(),Ud={exports:{}},_e={};var Pv;function _2(){if(Pv)return _e;Pv=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"),x=Symbol.iterator;function S(R){return R===null||typeof R!="object"?null:(R=x&&R[x]||R["@@iterator"],typeof R=="function"?R:null)}var T={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},k=Object.assign,E={};function C(R,W,re){this.props=R,this.context=W,this.refs=E,this.updater=re||T}C.prototype.isReactComponent={},C.prototype.setState=function(R,W){if(typeof R!="object"&&typeof R!="function"&&R!=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,R,W,"setState")},C.prototype.forceUpdate=function(R){this.updater.enqueueForceUpdate(this,R,"forceUpdate")};function _(){}_.prototype=C.prototype;function j(R,W,re){this.props=R,this.context=W,this.refs=E,this.updater=re||T}var A=j.prototype=new _;A.constructor=j,k(A,C.prototype),A.isPureReactComponent=!0;var O=Array.isArray;function D(){}var L={H:null,A:null,T:null,S:null},B=Object.prototype.hasOwnProperty;function q(R,W,re){var ae=re.ref;return{$$typeof:t,type:R,key:W,ref:ae!==void 0?ae:null,props:re}}function te(R,W){return q(R.type,W,R.props)}function ee(R){return typeof R=="object"&&R!==null&&R.$$typeof===t}function V(R){var W={"=":"=0",":":"=2"};return"$"+R.replace(/[=:]/g,function(re){return W[re]})}var J=/\/+/g;function X(R,W){return typeof R=="object"&&R!==null&&R.key!=null?V(""+R.key):W.toString(36)}function $(R){switch(R.status){case"fulfilled":return R.value;case"rejected":throw R.reason;default:switch(typeof R.status=="string"?R.then(D,D):(R.status="pending",R.then(function(W){R.status==="pending"&&(R.status="fulfilled",R.value=W)},function(W){R.status==="pending"&&(R.status="rejected",R.reason=W)})),R.status){case"fulfilled":return R.value;case"rejected":throw R.reason}}throw R}function M(R,W,re,ae,fe){var me=typeof R;(me==="undefined"||me==="boolean")&&(R=null);var ce=!1;if(R===null)ce=!0;else switch(me){case"bigint":case"string":case"number":ce=!0;break;case"object":switch(R.$$typeof){case t:case r:ce=!0;break;case y:return ce=R._init,M(ce(R._payload),W,re,ae,fe)}}if(ce)return fe=fe(R),ce=ae===""?"."+X(R,0):ae,O(fe)?(re="",ce!=null&&(re=ce.replace(J,"$&/")+"/"),M(fe,W,re,"",function(ue){return ue})):fe!=null&&(ee(fe)&&(fe=te(fe,re+(fe.key==null||R&&R.key===fe.key?"":(""+fe.key).replace(J,"$&/")+"/")+ce)),W.push(fe)),1;ce=0;var le=ae===""?".":ae+":";if(O(R))for(var ie=0;ie<R.length;ie++)ae=R[ie],me=le+X(ae,ie),ce+=M(ae,W,re,me,fe);else if(ie=S(R),typeof ie=="function")for(R=ie.call(R),ie=0;!(ae=R.next()).done;)ae=ae.value,me=le+X(ae,ie++),ce+=M(ae,W,re,me,fe);else if(me==="object"){if(typeof R.then=="function")return M($(R),W,re,ae,fe);throw W=String(R),Error("Objects are not valid as a React child (found: "+(W==="[object Object]"?"object with keys {"+Object.keys(R).join(", ")+"}":W)+"). If you meant to render a collection of children, use an array instead.")}return ce}function I(R,W,re){if(R==null)return R;var ae=[],fe=0;return M(R,ae,"","",function(me){return W.call(re,me,fe++)}),ae}function P(R){if(R._status===-1){var W=R._result;W=W(),W.then(function(re){(R._status===0||R._status===-1)&&(R._status=1,R._result=re)},function(re){(R._status===0||R._status===-1)&&(R._status=2,R._result=re)}),R._status===-1&&(R._status=0,R._result=W)}if(R._status===1)return R._result.default;throw R._result}var Z=typeof reportError=="function"?reportError:function(R){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var W=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof R=="object"&&R!==null&&typeof R.message=="string"?String(R.message):String(R),error:R});if(!window.dispatchEvent(W))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",R);return}console.error(R)},K={map:I,forEach:function(R,W,re){I(R,function(){W.apply(this,arguments)},re)},count:function(R){var W=0;return I(R,function(){W++}),W},toArray:function(R){return I(R,function(W){return W})||[]},only:function(R){if(!ee(R))throw Error("React.Children.only expected to receive a single React element child.");return R}};return _e.Activity=v,_e.Children=K,_e.Component=C,_e.Fragment=o,_e.Profiler=l,_e.PureComponent=j,_e.StrictMode=i,_e.Suspense=g,_e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=L,_e.__COMPILER_RUNTIME={__proto__:null,c:function(R){return L.H.useMemoCache(R)}},_e.cache=function(R){return function(){return R.apply(null,arguments)}},_e.cacheSignal=function(){return null},_e.cloneElement=function(R,W,re){if(R==null)throw Error("The argument must be a React element, but you passed "+R+".");var ae=k({},R.props),fe=R.key;if(W!=null)for(me in W.key!==void 0&&(fe=""+W.key),W)!B.call(W,me)||me==="key"||me==="__self"||me==="__source"||me==="ref"&&W.ref===void 0||(ae[me]=W[me]);var me=arguments.length-2;if(me===1)ae.children=re;else if(1<me){for(var ce=Array(me),le=0;le<me;le++)ce[le]=arguments[le+2];ae.children=ce}return q(R.type,fe,ae)},_e.createContext=function(R){return R={$$typeof:f,_currentValue:R,_currentValue2:R,_threadCount:0,Provider:null,Consumer:null},R.Provider=R,R.Consumer={$$typeof:c,_context:R},R},_e.createElement=function(R,W,re){var ae,fe={},me=null;if(W!=null)for(ae in W.key!==void 0&&(me=""+W.key),W)B.call(W,ae)&&ae!=="key"&&ae!=="__self"&&ae!=="__source"&&(fe[ae]=W[ae]);var ce=arguments.length-2;if(ce===1)fe.children=re;else if(1<ce){for(var le=Array(ce),ie=0;ie<ce;ie++)le[ie]=arguments[ie+2];fe.children=le}if(R&&R.defaultProps)for(ae in ce=R.defaultProps,ce)fe[ae]===void 0&&(fe[ae]=ce[ae]);return q(R,me,fe)},_e.createRef=function(){return{current:null}},_e.forwardRef=function(R){return{$$typeof:h,render:R}},_e.isValidElement=ee,_e.lazy=function(R){return{$$typeof:y,_payload:{_status:-1,_result:R},_init:P}},_e.memo=function(R,W){return{$$typeof:m,type:R,compare:W===void 0?null:W}},_e.startTransition=function(R){var W=L.T,re={};L.T=re;try{var ae=R(),fe=L.S;fe!==null&&fe(re,ae),typeof ae=="object"&&ae!==null&&typeof ae.then=="function"&&ae.then(D,Z)}catch(me){Z(me)}finally{W!==null&&re.types!==null&&(W.types=re.types),L.T=W}},_e.unstable_useCacheRefresh=function(){return L.H.useCacheRefresh()},_e.use=function(R){return L.H.use(R)},_e.useActionState=function(R,W,re){return L.H.useActionState(R,W,re)},_e.useCallback=function(R,W){return L.H.useCallback(R,W)},_e.useContext=function(R){return L.H.useContext(R)},_e.useDebugValue=function(){},_e.useDeferredValue=function(R,W){return L.H.useDeferredValue(R,W)},_e.useEffect=function(R,W){return L.H.useEffect(R,W)},_e.useEffectEvent=function(R){return L.H.useEffectEvent(R)},_e.useId=function(){return L.H.useId()},_e.useImperativeHandle=function(R,W,re){return L.H.useImperativeHandle(R,W,re)},_e.useInsertionEffect=function(R,W){return L.H.useInsertionEffect(R,W)},_e.useLayoutEffect=function(R,W){return L.H.useLayoutEffect(R,W)},_e.useMemo=function(R,W){return L.H.useMemo(R,W)},_e.useOptimistic=function(R,W){return L.H.useOptimistic(R,W)},_e.useReducer=function(R,W,re){return L.H.useReducer(R,W,re)},_e.useRef=function(R){return L.H.useRef(R)},_e.useState=function(R){return L.H.useState(R)},_e.useSyncExternalStore=function(R,W,re){return L.H.useSyncExternalStore(R,W,re)},_e.useTransition=function(){return L.H.useTransition()},_e.version="19.2.5",_e}var Kv;function um(){return Kv||(Kv=1,Ud.exports=_2()),Ud.exports}var b=um();const N2=O0(b),D0=C2({__proto__:null,default:N2},[b]);var qd={exports:{}},Cs={},Id={exports:{}},Pd={};var Fv;function j2(){return Fv||(Fv=1,(function(t){function r(M,I){var P=M.length;M.push(I);e:for(;0<P;){var Z=P-1>>>1,K=M[Z];if(0<l(K,I))M[Z]=I,M[P]=K,P=Z;else break e}}function o(M){return M.length===0?null:M[0]}function i(M){if(M.length===0)return null;var I=M[0],P=M.pop();if(P!==I){M[0]=P;e:for(var Z=0,K=M.length,R=K>>>1;Z<R;){var W=2*(Z+1)-1,re=M[W],ae=W+1,fe=M[ae];if(0>l(re,P))ae<K&&0>l(fe,re)?(M[Z]=fe,M[ae]=P,Z=ae):(M[Z]=re,M[W]=P,Z=W);else if(ae<K&&0>l(fe,P))M[Z]=fe,M[ae]=P,Z=ae;else break e}}return I}function l(M,I){var P=M.sortIndex-I.sortIndex;return P!==0?P:M.id-I.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,x=3,S=!1,T=!1,k=!1,E=!1,C=typeof setTimeout=="function"?setTimeout:null,_=typeof clearTimeout=="function"?clearTimeout:null,j=typeof setImmediate<"u"?setImmediate:null;function A(M){for(var I=o(m);I!==null;){if(I.callback===null)i(m);else if(I.startTime<=M)i(m),I.sortIndex=I.expirationTime,r(g,I);else break;I=o(m)}}function O(M){if(k=!1,A(M),!T)if(o(g)!==null)T=!0,D||(D=!0,V());else{var I=o(m);I!==null&&$(O,I.startTime-M)}}var D=!1,L=-1,B=5,q=-1;function te(){return E?!0:!(t.unstable_now()-q<B)}function ee(){if(E=!1,D){var M=t.unstable_now();q=M;var I=!0;try{e:{T=!1,k&&(k=!1,_(L),L=-1),S=!0;var P=x;try{t:{for(A(M),v=o(g);v!==null&&!(v.expirationTime>M&&te());){var Z=v.callback;if(typeof Z=="function"){v.callback=null,x=v.priorityLevel;var K=Z(v.expirationTime<=M);if(M=t.unstable_now(),typeof K=="function"){v.callback=K,A(M),I=!0;break t}v===o(g)&&i(g),A(M)}else i(g);v=o(g)}if(v!==null)I=!0;else{var R=o(m);R!==null&&$(O,R.startTime-M),I=!1}}break e}finally{v=null,x=P,S=!1}I=void 0}}finally{I?V():D=!1}}}var V;if(typeof j=="function")V=function(){j(ee)};else if(typeof MessageChannel<"u"){var J=new MessageChannel,X=J.port2;J.port1.onmessage=ee,V=function(){X.postMessage(null)}}else V=function(){C(ee,0)};function $(M,I){L=C(function(){M(t.unstable_now())},I)}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 x},t.unstable_next=function(M){switch(x){case 1:case 2:case 3:var I=3;break;default:I=x}var P=x;x=I;try{return M()}finally{x=P}},t.unstable_requestPaint=function(){E=!0},t.unstable_runWithPriority=function(M,I){switch(M){case 1:case 2:case 3:case 4:case 5:break;default:M=3}var P=x;x=M;try{return I()}finally{x=P}},t.unstable_scheduleCallback=function(M,I,P){var Z=t.unstable_now();switch(typeof P=="object"&&P!==null?(P=P.delay,P=typeof P=="number"&&0<P?Z+P:Z):P=Z,M){case 1:var K=-1;break;case 2:K=250;break;case 5:K=1073741823;break;case 4:K=1e4;break;default:K=5e3}return K=P+K,M={id:y++,callback:I,priorityLevel:M,startTime:P,expirationTime:K,sortIndex:-1},P>Z?(M.sortIndex=P,r(m,M),o(g)===null&&M===o(m)&&(k?(_(L),L=-1):k=!0,$(O,P-Z))):(M.sortIndex=K,r(g,M),T||S||(T=!0,D||(D=!0,V()))),M},t.unstable_shouldYield=te,t.unstable_wrapCallback=function(M){var I=x;return function(){var P=x;x=I;try{return M.apply(this,arguments)}finally{x=P}}}})(Pd)),Pd}var Yv;function R2(){return Yv||(Yv=1,Id.exports=j2()),Id.exports}var Kd={exports:{}},xt={};var Vv;function O2(){if(Vv)return xt;Vv=1;var t=um();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 xt.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=i,xt.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)},xt.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()}},xt.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))},xt.prefetchDNS=function(g){typeof g=="string"&&i.d.D(g)},xt.preinit=function(g,m){if(typeof g=="string"&&m&&typeof m.as=="string"){var y=m.as,v=h(y,m.crossOrigin),x=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:x,fetchPriority:S}):y==="script"&&i.d.X(g,{crossOrigin:v,integrity:x,fetchPriority:S,nonce:typeof m.nonce=="string"?m.nonce:void 0})}},xt.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)},xt.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})}},xt.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)},xt.requestFormReset=function(g){i.d.r(g)},xt.unstable_batchedUpdates=function(g,m){return g(m)},xt.useFormState=function(g,m,y){return f.H.useFormState(g,m,y)},xt.useFormStatus=function(){return f.H.useHostTransitionStatus()},xt.version="19.2.5",xt}var $v;function M0(){if($v)return Kd.exports;$v=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(),Kd.exports=O2(),Kd.exports}var Gv;function D2(){if(Gv)return Cs;Gv=1;var t=R2(),r=um(),o=M0();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 d=a.return;if(d===null)break;var p=d.alternate;if(p===null){if(s=d.return,s!==null){a=s;continue}break}if(d.child===p.child){for(p=d.child;p;){if(p===a)return g(d),e;if(p===s)return g(d),n;p=p.sibling}throw Error(i(188))}if(a.return!==s.return)a=d,s=p;else{for(var w=!1,N=d.child;N;){if(N===a){w=!0,a=d,s=p;break}if(N===s){w=!0,s=d,a=p;break}N=N.sibling}if(!w){for(N=p.child;N;){if(N===a){w=!0,a=p,s=d;break}if(N===s){w=!0,s=p,a=d;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,x=Symbol.for("react.element"),S=Symbol.for("react.transitional.element"),T=Symbol.for("react.portal"),k=Symbol.for("react.fragment"),E=Symbol.for("react.strict_mode"),C=Symbol.for("react.profiler"),_=Symbol.for("react.consumer"),j=Symbol.for("react.context"),A=Symbol.for("react.forward_ref"),O=Symbol.for("react.suspense"),D=Symbol.for("react.suspense_list"),L=Symbol.for("react.memo"),B=Symbol.for("react.lazy"),q=Symbol.for("react.activity"),te=Symbol.for("react.memo_cache_sentinel"),ee=Symbol.iterator;function V(e){return e===null||typeof e!="object"?null:(e=ee&&e[ee]||e["@@iterator"],typeof e=="function"?e:null)}var J=Symbol.for("react.client.reference");function X(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===J?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case k:return"Fragment";case C:return"Profiler";case E:return"StrictMode";case O:return"Suspense";case D:return"SuspenseList";case q:return"Activity"}if(typeof e=="object")switch(e.$$typeof){case T: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:X(e.type)||"Memo";case B:n=e._payload,e=e._init;try{return X(e(n))}catch{}}return null}var $=Array.isArray,M=r.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,I=o.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,P={pending:!1,data:null,method:null,action:null},Z=[],K=-1;function R(e){return{current:e}}function W(e){0>K||(e.current=Z[K],Z[K]=null,K--)}function re(e,n){K++,Z[K]=e.current,e.current=n}var ae=R(null),fe=R(null),me=R(null),ce=R(null);function le(e,n){switch(re(me,n),re(fe,e),re(ae,null),n.nodeType){case 9:case 11:e=(e=n.documentElement)&&(e=e.namespaceURI)?uv(e):0;break;default:if(e=n.tagName,n=n.namespaceURI)n=uv(n),e=dv(n,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}W(ae),re(ae,e)}function ie(){W(ae),W(fe),W(me)}function ue(e){e.memoizedState!==null&&re(ce,e);var n=ae.current,a=dv(n,e.type);n!==a&&(re(fe,e),re(ae,a))}function pe(e){fe.current===e&&(W(ae),W(fe)),ce.current===e&&(W(ce),ws._currentValue=P)}var Ae,Ce;function Se(e){if(Ae===void 0)try{throw Error()}catch(a){var n=a.stack.trim().match(/\n( *(at )?)/);Ae=n&&n[1]||"",Ce=-1<a.stack.indexOf(`
3
+ at`)?" (<anonymous>)":-1<a.stack.indexOf("@")?"@unknown:0:0":""}return`
4
+ `+Ae+e+Ce}var Qe=!1;function ft(e,n){if(!e||Qe)return"";Qe=!0;var a=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var s={DetermineComponentFrameRoot:function(){try{if(n){var se=function(){throw Error()};if(Object.defineProperty(se.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(se,[])}catch(Q){var G=Q}Reflect.construct(e,[],se)}else{try{se.call()}catch(Q){G=Q}e.call(se.prototype)}}else{try{throw Error()}catch(Q){G=Q}(se=e())&&typeof se.catch=="function"&&se.catch(function(){})}}catch(Q){if(Q&&G&&typeof Q.stack=="string")return[Q.stack,G.stack]}return[null,null]}};s.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var d=Object.getOwnPropertyDescriptor(s.DetermineComponentFrameRoot,"name");d&&d.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
+ `),Y=N.split(`
6
+ `);for(d=s=0;s<z.length&&!z[s].includes("DetermineComponentFrameRoot");)s++;for(;d<Y.length&&!Y[d].includes("DetermineComponentFrameRoot");)d++;if(s===z.length||d===Y.length)for(s=z.length-1,d=Y.length-1;1<=s&&0<=d&&z[s]!==Y[d];)d--;for(;1<=s&&0<=d;s--,d--)if(z[s]!==Y[d]){if(s!==1||d!==1)do if(s--,d--,0>d||z[s]!==Y[d]){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<=d);break}}}finally{Qe=!1,Error.prepareStackTrace=a}return(a=e?e.displayName||e.name:"")?Se(a):""}function en(e,n){switch(e.tag){case 26:case 27:case 5:return Se(e.type);case 16:return Se("Lazy");case 13:return e.child!==n&&n!==null?Se("Suspense Fallback"):Se("Suspense");case 19:return Se("SuspenseList");case 0:case 15:return ft(e.type,!1);case 11:return ft(e.type.render,!1);case 1:return ft(e.type,!0);case 31:return Se("Activity");default:return""}}function Cn(e){try{var n="",a=null;do n+=en(e,a),a=e,e=e.return;while(e);return n}catch(s){return`
8
+ Error generating stack: `+s.message+`
9
+ `+s.stack}}var pn=Object.prototype.hasOwnProperty,Tn=t.unstable_scheduleCallback,tn=t.unstable_cancelCallback,de=t.unstable_shouldYield,Te=t.unstable_requestPaint,$e=t.unstable_now,Vr=t.unstable_getCurrentPriorityLevel,Ro=t.unstable_ImmediatePriority,xe=t.unstable_UserBlockingPriority,He=t.unstable_NormalPriority,mt=t.unstable_LowPriority,$r=t.unstable_IdlePriority,i1=t.log,l1=t.unstable_setDisableYieldValue,Oo=null,Ut=null;function ur(e){if(typeof i1=="function"&&l1(e),Ut&&typeof Ut.setStrictMode=="function")try{Ut.setStrictMode(Oo,e)}catch{}}var qt=Math.clz32?Math.clz32:d1,c1=Math.log,u1=Math.LN2;function d1(e){return e>>>=0,e===0?32:31-(c1(e)/u1|0)|0}var ai=256,oi=262144,si=4194304;function Gr(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 ii(e,n,a){var s=e.pendingLanes;if(s===0)return 0;var d=0,p=e.suspendedLanes,w=e.pingedLanes;e=e.warmLanes;var N=s&134217727;return N!==0?(s=N&~p,s!==0?d=Gr(s):(w&=N,w!==0?d=Gr(w):a||(a=N&~e,a!==0&&(d=Gr(a))))):(N=s&~p,N!==0?d=Gr(N):w!==0?d=Gr(w):a||(a=s&~e,a!==0&&(d=Gr(a)))),d===0?0:n!==0&&n!==d&&(n&p)===0&&(p=d&-d,a=n&-n,p>=a||p===32&&(a&4194048)!==0)?n:d}function Do(e,n){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&n)===0}function f1(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 Fm(){var e=si;return si<<=1,(si&62914560)===0&&(si=4194304),e}function Ac(e){for(var n=[],a=0;31>a;a++)n.push(e);return n}function Mo(e,n){e.pendingLanes|=n,n!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function m1(e,n,a,s,d,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,Y=e.hiddenUpdates;for(a=w&~a;0<a;){var ne=31-qt(a),se=1<<ne;N[ne]=0,z[ne]=-1;var G=Y[ne];if(G!==null)for(Y[ne]=null,ne=0;ne<G.length;ne++){var Q=G[ne];Q!==null&&(Q.lane&=-536870913)}a&=~se}s!==0&&Ym(e,s,0),p!==0&&d===0&&e.tag!==0&&(e.suspendedLanes|=p&~(w&~n))}function Ym(e,n,a){e.pendingLanes|=n,e.suspendedLanes&=~n;var s=31-qt(n);e.entangledLanes|=n,e.entanglements[s]=e.entanglements[s]|1073741824|a&261930}function Vm(e,n){var a=e.entangledLanes|=n;for(e=e.entanglements;a;){var s=31-qt(a),d=1<<s;d&n|e[s]&n&&(e[s]|=n),a&=~d}}function $m(e,n){var a=n&-n;return a=(a&42)!==0?1:_c(a),(a&(e.suspendedLanes|n))!==0?0:a}function _c(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 Nc(e){return e&=-e,2<e?8<e?(e&134217727)!==0?32:268435456:8:2}function Gm(){var e=I.p;return e!==0?e:(e=window.event,e===void 0?32:Mv(e.type))}function Xm(e,n){var a=I.p;try{return I.p=e,n()}finally{I.p=a}}var dr=Math.random().toString(36).slice(2),pt="__reactFiber$"+dr,_t="__reactProps$"+dr,ka="__reactContainer$"+dr,jc="__reactEvents$"+dr,p1="__reactListeners$"+dr,h1="__reactHandles$"+dr,Zm="__reactResources$"+dr,Lo="__reactMarker$"+dr;function Rc(e){delete e[pt],delete e[_t],delete e[jc],delete e[p1],delete e[h1]}function Sa(e){var n=e[pt];if(n)return n;for(var a=e.parentNode;a;){if(n=a[ka]||a[pt]){if(a=n.alternate,n.child!==null||a!==null&&a.child!==null)for(e=yv(e);e!==null;){if(a=e[pt])return a;e=yv(e)}return n}e=a,a=e.parentNode}return null}function Ea(e){if(e=e[pt]||e[ka]){var n=e.tag;if(n===5||n===6||n===13||n===31||n===26||n===27||n===3)return e}return null}function zo(e){var n=e.tag;if(n===5||n===26||n===27||n===6)return e.stateNode;throw Error(i(33))}function Ca(e){var n=e[Zm];return n||(n=e[Zm]={hoistableStyles:new Map,hoistableScripts:new Map}),n}function ut(e){e[Lo]=!0}var Qm=new Set,Jm={};function Xr(e,n){Ta(e,n),Ta(e+"Capture",n)}function Ta(e,n){for(Jm[e]=n,e=0;e<n.length;e++)Qm.add(n[e])}var g1=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]*$"),ep={},tp={};function v1(e){return pn.call(tp,e)?!0:pn.call(ep,e)?!1:g1.test(e)?tp[e]=!0:(ep[e]=!0,!1)}function li(e,n,a){if(v1(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 ci(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 Un(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 nn(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function np(e){var n=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(n==="checkbox"||n==="radio")}function y1(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 d=s.get,p=s.set;return Object.defineProperty(e,n,{configurable:!0,get:function(){return d.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 Oc(e){if(!e._valueTracker){var n=np(e)?"checked":"value";e._valueTracker=y1(e,n,""+e[n])}}function rp(e){if(!e)return!1;var n=e._valueTracker;if(!n)return!0;var a=n.getValue(),s="";return e&&(s=np(e)?e.checked?"true":"false":e.value),e=s,e!==a?(n.setValue(e),!0):!1}function ui(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 b1=/[\n"\\]/g;function rn(e){return e.replace(b1,function(n){return"\\"+n.charCodeAt(0).toString(16)+" "})}function Dc(e,n,a,s,d,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=""+nn(n)):e.value!==""+nn(n)&&(e.value=""+nn(n)):w!=="submit"&&w!=="reset"||e.removeAttribute("value"),n!=null?Mc(e,w,nn(n)):a!=null?Mc(e,w,nn(a)):s!=null&&e.removeAttribute("value"),d==null&&p!=null&&(e.defaultChecked=!!p),d!=null&&(e.checked=d&&typeof d!="function"&&typeof d!="symbol"),N!=null&&typeof N!="function"&&typeof N!="symbol"&&typeof N!="boolean"?e.name=""+nn(N):e.removeAttribute("name")}function ap(e,n,a,s,d,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)){Oc(e);return}a=a!=null?""+nn(a):"",n=n!=null?""+nn(n):a,N||n===e.value||(e.value=n),e.defaultValue=n}s=s??d,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),Oc(e)}function Mc(e,n,a){n==="number"&&ui(e.ownerDocument)===e||e.defaultValue===""+a||(e.defaultValue=""+a)}function Aa(e,n,a,s){if(e=e.options,n){n={};for(var d=0;d<a.length;d++)n["$"+a[d]]=!0;for(a=0;a<e.length;a++)d=n.hasOwnProperty("$"+e[a].value),e[a].selected!==d&&(e[a].selected=d),d&&s&&(e[a].defaultSelected=!0)}else{for(a=""+nn(a),n=null,d=0;d<e.length;d++){if(e[d].value===a){e[d].selected=!0,s&&(e[d].defaultSelected=!0);return}n!==null||e[d].disabled||(n=e[d])}n!==null&&(n.selected=!0)}}function op(e,n,a){if(n!=null&&(n=""+nn(n),n!==e.value&&(e.value=n),a==null)){e.defaultValue!==n&&(e.defaultValue=n);return}e.defaultValue=a!=null?""+nn(a):""}function sp(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=nn(n),e.defaultValue=a,s=e.textContent,s===a&&s!==""&&s!==null&&(e.value=s),Oc(e)}function _a(e,n){if(n){var a=e.firstChild;if(a&&a===e.lastChild&&a.nodeType===3){a.nodeValue=n;return}}e.textContent=n}var w1=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 ip(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||w1.has(n)?n==="float"?e.cssFloat=a:e[n]=(""+a).trim():e[n]=a+"px"}function lp(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 d in n)s=n[d],n.hasOwnProperty(d)&&a[d]!==s&&ip(e,d,s)}else for(var p in n)n.hasOwnProperty(p)&&ip(e,p,n[p])}function Lc(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 x1=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"]]),k1=/^[\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 di(e){return k1.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function qn(){}var zc=null;function Hc(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Na=null,ja=null;function cp(e){var n=Ea(e);if(n&&(e=n.stateNode)){var a=e[_t]||null;e:switch(e=n.stateNode,n.type){case"input":if(Dc(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="'+rn(""+n)+'"][type="radio"]'),n=0;n<a.length;n++){var s=a[n];if(s!==e&&s.form===e.form){var d=s[_t]||null;if(!d)throw Error(i(90));Dc(s,d.value,d.defaultValue,d.defaultValue,d.checked,d.defaultChecked,d.type,d.name)}}for(n=0;n<a.length;n++)s=a[n],s.form===e.form&&rp(s)}break e;case"textarea":op(e,a.value,a.defaultValue);break e;case"select":n=a.value,n!=null&&Aa(e,!!a.multiple,n,!1)}}}var Bc=!1;function up(e,n,a){if(Bc)return e(n,a);Bc=!0;try{var s=e(n);return s}finally{if(Bc=!1,(Na!==null||ja!==null)&&(Qi(),Na&&(n=Na,e=ja,ja=Na=null,cp(n),e)))for(n=0;n<e.length;n++)cp(e[n])}}function Ho(e,n){var a=e.stateNode;if(a===null)return null;var s=a[_t]||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 In=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Wc=!1;if(In)try{var Bo={};Object.defineProperty(Bo,"passive",{get:function(){Wc=!0}}),window.addEventListener("test",Bo,Bo),window.removeEventListener("test",Bo,Bo)}catch{Wc=!1}var fr=null,Uc=null,fi=null;function dp(){if(fi)return fi;var e,n=Uc,a=n.length,s,d="value"in fr?fr.value:fr.textContent,p=d.length;for(e=0;e<a&&n[e]===d[e];e++);var w=a-e;for(s=1;s<=w&&n[a-s]===d[p-s];s++);return fi=d.slice(e,1<s?1-s:void 0)}function mi(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 pi(){return!0}function fp(){return!1}function Nt(e){function n(a,s,d,p,w){this._reactName=a,this._targetInst=d,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)?pi:fp,this.isPropagationStopped=fp,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=pi)},stopPropagation:function(){var a=this.nativeEvent;a&&(a.stopPropagation?a.stopPropagation():typeof a.cancelBubble!="unknown"&&(a.cancelBubble=!0),this.isPropagationStopped=pi)},persist:function(){},isPersistent:pi}),n}var Zr={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},hi=Nt(Zr),Wo=v({},Zr,{view:0,detail:0}),S1=Nt(Wo),qc,Ic,Uo,gi=v({},Wo,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Kc,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!==Uo&&(Uo&&e.type==="mousemove"?(qc=e.screenX-Uo.screenX,Ic=e.screenY-Uo.screenY):Ic=qc=0,Uo=e),qc)},movementY:function(e){return"movementY"in e?e.movementY:Ic}}),mp=Nt(gi),E1=v({},gi,{dataTransfer:0}),C1=Nt(E1),T1=v({},Wo,{relatedTarget:0}),Pc=Nt(T1),A1=v({},Zr,{animationName:0,elapsedTime:0,pseudoElement:0}),_1=Nt(A1),N1=v({},Zr,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),j1=Nt(N1),R1=v({},Zr,{data:0}),pp=Nt(R1),O1={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},D1={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"},M1={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function L1(e){var n=this.nativeEvent;return n.getModifierState?n.getModifierState(e):(e=M1[e])?!!n[e]:!1}function Kc(){return L1}var z1=v({},Wo,{key:function(e){if(e.key){var n=O1[e.key]||e.key;if(n!=="Unidentified")return n}return e.type==="keypress"?(e=mi(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?D1[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Kc,charCode:function(e){return e.type==="keypress"?mi(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?mi(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),H1=Nt(z1),B1=v({},gi,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),hp=Nt(B1),W1=v({},Wo,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Kc}),U1=Nt(W1),q1=v({},Zr,{propertyName:0,elapsedTime:0,pseudoElement:0}),I1=Nt(q1),P1=v({},gi,{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}),K1=Nt(P1),F1=v({},Zr,{newState:0,oldState:0}),Y1=Nt(F1),V1=[9,13,27,32],Fc=In&&"CompositionEvent"in window,qo=null;In&&"documentMode"in document&&(qo=document.documentMode);var $1=In&&"TextEvent"in window&&!qo,gp=In&&(!Fc||qo&&8<qo&&11>=qo),vp=" ",yp=!1;function bp(e,n){switch(e){case"keyup":return V1.indexOf(n.keyCode)!==-1;case"keydown":return n.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function wp(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Ra=!1;function G1(e,n){switch(e){case"compositionend":return wp(n);case"keypress":return n.which!==32?null:(yp=!0,vp);case"textInput":return e=n.data,e===vp&&yp?null:e;default:return null}}function X1(e,n){if(Ra)return e==="compositionend"||!Fc&&bp(e,n)?(e=dp(),fi=Uc=fr=null,Ra=!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 gp&&n.locale!=="ko"?null:n.data;default:return null}}var Z1={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 xp(e){var n=e&&e.nodeName&&e.nodeName.toLowerCase();return n==="input"?!!Z1[e.type]:n==="textarea"}function kp(e,n,a,s){Na?ja?ja.push(s):ja=[s]:Na=s,n=ol(n,"onChange"),0<n.length&&(a=new hi("onChange","change",null,a,s),e.push({event:a,listeners:n}))}var Io=null,Po=null;function Q1(e){av(e,0)}function vi(e){var n=zo(e);if(rp(n))return e}function Sp(e,n){if(e==="change")return n}var Ep=!1;if(In){var Yc;if(In){var Vc="oninput"in document;if(!Vc){var Cp=document.createElement("div");Cp.setAttribute("oninput","return;"),Vc=typeof Cp.oninput=="function"}Yc=Vc}else Yc=!1;Ep=Yc&&(!document.documentMode||9<document.documentMode)}function Tp(){Io&&(Io.detachEvent("onpropertychange",Ap),Po=Io=null)}function Ap(e){if(e.propertyName==="value"&&vi(Po)){var n=[];kp(n,Po,e,Hc(e)),up(Q1,n)}}function J1(e,n,a){e==="focusin"?(Tp(),Io=n,Po=a,Io.attachEvent("onpropertychange",Ap)):e==="focusout"&&Tp()}function ek(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return vi(Po)}function tk(e,n){if(e==="click")return vi(n)}function nk(e,n){if(e==="input"||e==="change")return vi(n)}function rk(e,n){return e===n&&(e!==0||1/e===1/n)||e!==e&&n!==n}var It=typeof Object.is=="function"?Object.is:rk;function Ko(e,n){if(It(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 d=a[s];if(!pn.call(n,d)||!It(e[d],n[d]))return!1}return!0}function _p(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Np(e,n){var a=_p(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=_p(a)}}function jp(e,n){return e&&n?e===n?!0:e&&e.nodeType===3?!1:n&&n.nodeType===3?jp(e,n.parentNode):"contains"in e?e.contains(n):e.compareDocumentPosition?!!(e.compareDocumentPosition(n)&16):!1:!1}function Rp(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var n=ui(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=ui(e.document)}return n}function $c(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 ak=In&&"documentMode"in document&&11>=document.documentMode,Oa=null,Gc=null,Fo=null,Xc=!1;function Op(e,n,a){var s=a.window===a?a.document:a.nodeType===9?a:a.ownerDocument;Xc||Oa==null||Oa!==ui(s)||(s=Oa,"selectionStart"in s&&$c(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}),Fo&&Ko(Fo,s)||(Fo=s,s=ol(Gc,"onSelect"),0<s.length&&(n=new hi("onSelect","select",null,n,a),e.push({event:n,listeners:s}),n.target=Oa)))}function Qr(e,n){var a={};return a[e.toLowerCase()]=n.toLowerCase(),a["Webkit"+e]="webkit"+n,a["Moz"+e]="moz"+n,a}var Da={animationend:Qr("Animation","AnimationEnd"),animationiteration:Qr("Animation","AnimationIteration"),animationstart:Qr("Animation","AnimationStart"),transitionrun:Qr("Transition","TransitionRun"),transitionstart:Qr("Transition","TransitionStart"),transitioncancel:Qr("Transition","TransitionCancel"),transitionend:Qr("Transition","TransitionEnd")},Zc={},Dp={};In&&(Dp=document.createElement("div").style,"AnimationEvent"in window||(delete Da.animationend.animation,delete Da.animationiteration.animation,delete Da.animationstart.animation),"TransitionEvent"in window||delete Da.transitionend.transition);function Jr(e){if(Zc[e])return Zc[e];if(!Da[e])return e;var n=Da[e],a;for(a in n)if(n.hasOwnProperty(a)&&a in Dp)return Zc[e]=n[a];return e}var Mp=Jr("animationend"),Lp=Jr("animationiteration"),zp=Jr("animationstart"),ok=Jr("transitionrun"),sk=Jr("transitionstart"),ik=Jr("transitioncancel"),Hp=Jr("transitionend"),Bp=new Map,Qc="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(" ");Qc.push("scrollEnd");function hn(e,n){Bp.set(e,n),Xr(n,[e])}var yi=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)},an=[],Ma=0,Jc=0;function bi(){for(var e=Ma,n=Jc=Ma=0;n<e;){var a=an[n];an[n++]=null;var s=an[n];an[n++]=null;var d=an[n];an[n++]=null;var p=an[n];if(an[n++]=null,s!==null&&d!==null){var w=s.pending;w===null?d.next=d:(d.next=w.next,w.next=d),s.pending=d}p!==0&&Wp(a,d,p)}}function wi(e,n,a,s){an[Ma++]=e,an[Ma++]=n,an[Ma++]=a,an[Ma++]=s,Jc|=s,e.lanes|=s,e=e.alternate,e!==null&&(e.lanes|=s)}function eu(e,n,a,s){return wi(e,n,a,s),xi(e)}function ea(e,n){return wi(e,null,null,n),xi(e)}function Wp(e,n,a){e.lanes|=a;var s=e.alternate;s!==null&&(s.lanes|=a);for(var d=!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||(d=!0)),e=p,p=p.return;return e.tag===3?(p=e.stateNode,d&&n!==null&&(d=31-qt(a),e=p.hiddenUpdates,s=e[d],s===null?e[d]=[n]:s.push(n),n.lane=a|536870912),p):null}function xi(e){if(50<ms)throw ms=0,cd=null,Error(i(185));for(var n=e.return;n!==null;)e=n,n=e.return;return e.tag===3?e.stateNode:null}var La={};function lk(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 Pt(e,n,a,s){return new lk(e,n,a,s)}function tu(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Pn(e,n){var a=e.alternate;return a===null?(a=Pt(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 Up(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 ki(e,n,a,s,d,p){var w=0;if(s=e,typeof e=="function")tu(e)&&(w=1);else if(typeof e=="string")w=m2(e,a,ae.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(e){case q:return e=Pt(31,a,n,d),e.elementType=q,e.lanes=p,e;case k:return ta(a.children,d,p,n);case E:w=8,d|=24;break;case C:return e=Pt(12,a,n,d|2),e.elementType=C,e.lanes=p,e;case O:return e=Pt(13,a,n,d),e.elementType=O,e.lanes=p,e;case D:return e=Pt(19,a,n,d),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=Pt(w,a,n,d),n.elementType=e,n.type=s,n.lanes=p,n}function ta(e,n,a,s){return e=Pt(7,e,s,n),e.lanes=a,e}function nu(e,n,a){return e=Pt(6,e,null,n),e.lanes=a,e}function qp(e){var n=Pt(18,null,null,0);return n.stateNode=e,n}function ru(e,n,a){return n=Pt(4,e.children!==null?e.children:[],e.key,n),n.lanes=a,n.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},n}var Ip=new WeakMap;function on(e,n){if(typeof e=="object"&&e!==null){var a=Ip.get(e);return a!==void 0?a:(n={value:e,source:n,stack:Cn(n)},Ip.set(e,n),n)}return{value:e,source:n,stack:Cn(n)}}var za=[],Ha=0,Si=null,Yo=0,sn=[],ln=0,mr=null,An=1,_n="";function Kn(e,n){za[Ha++]=Yo,za[Ha++]=Si,Si=e,Yo=n}function Pp(e,n,a){sn[ln++]=An,sn[ln++]=_n,sn[ln++]=mr,mr=e;var s=An;e=_n;var d=32-qt(s)-1;s&=~(1<<d),a+=1;var p=32-qt(n)+d;if(30<p){var w=d-d%5;p=(s&(1<<w)-1).toString(32),s>>=w,d-=w,An=1<<32-qt(n)+d|a<<d|s,_n=p+e}else An=1<<p|a<<d|s,_n=e}function au(e){e.return!==null&&(Kn(e,1),Pp(e,1,0))}function ou(e){for(;e===Si;)Si=za[--Ha],za[Ha]=null,Yo=za[--Ha],za[Ha]=null;for(;e===mr;)mr=sn[--ln],sn[ln]=null,_n=sn[--ln],sn[ln]=null,An=sn[--ln],sn[ln]=null}function Kp(e,n){sn[ln++]=An,sn[ln++]=_n,sn[ln++]=mr,An=n.id,_n=n.overflow,mr=e}var ht=null,Ge=null,ze=!1,pr=null,cn=!1,su=Error(i(519));function hr(e){var n=Error(i(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Vo(on(n,e)),su}function Fp(e){var n=e.stateNode,a=e.type,s=e.memoizedProps;switch(n[pt]=e,n[_t]=s,a){case"dialog":De("cancel",n),De("close",n);break;case"iframe":case"object":case"embed":De("load",n);break;case"video":case"audio":for(a=0;a<hs.length;a++)De(hs[a],n);break;case"source":De("error",n);break;case"img":case"image":case"link":De("error",n),De("load",n);break;case"details":De("toggle",n);break;case"input":De("invalid",n),ap(n,s.value,s.defaultValue,s.checked,s.defaultChecked,s.type,s.name,!0);break;case"select":De("invalid",n);break;case"textarea":De("invalid",n),sp(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||lv(n.textContent,a)?(s.popover!=null&&(De("beforetoggle",n),De("toggle",n)),s.onScroll!=null&&De("scroll",n),s.onScrollEnd!=null&&De("scrollend",n),s.onClick!=null&&(n.onclick=qn),n=!0):n=!1,n||hr(e,!0)}function Yp(e){for(ht=e.return;ht;)switch(ht.tag){case 5:case 31:case 13:cn=!1;return;case 27:case 3:cn=!0;return;default:ht=ht.return}}function Ba(e){if(e!==ht)return!1;if(!ze)return Yp(e),ze=!0,!1;var n=e.tag,a;if((a=n!==3&&n!==27)&&((a=n===5)&&(a=e.type,a=!(a!=="form"&&a!=="button")||Ed(e.type,e.memoizedProps)),a=!a),a&&Ge&&hr(e),Yp(e),n===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(i(317));Ge=vv(e)}else if(n===31){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(i(317));Ge=vv(e)}else n===27?(n=Ge,Nr(e.type)?(e=Nd,Nd=null,Ge=e):Ge=n):Ge=ht?dn(e.stateNode.nextSibling):null;return!0}function na(){Ge=ht=null,ze=!1}function iu(){var e=pr;return e!==null&&(Dt===null?Dt=e:Dt.push.apply(Dt,e),pr=null),e}function Vo(e){pr===null?pr=[e]:pr.push(e)}var lu=R(null),ra=null,Fn=null;function gr(e,n,a){re(lu,n._currentValue),n._currentValue=a}function Yn(e){e._currentValue=lu.current,W(lu)}function cu(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 uu(e,n,a,s){var d=e.child;for(d!==null&&(d.return=e);d!==null;){var p=d.dependencies;if(p!==null){var w=d.child;p=p.firstContext;e:for(;p!==null;){var N=p;p=d;for(var z=0;z<n.length;z++)if(N.context===n[z]){p.lanes|=a,N=p.alternate,N!==null&&(N.lanes|=a),cu(p.return,a,e),s||(w=null);break e}p=N.next}}else if(d.tag===18){if(w=d.return,w===null)throw Error(i(341));w.lanes|=a,p=w.alternate,p!==null&&(p.lanes|=a),cu(w,a,e),w=null}else w=d.child;if(w!==null)w.return=d;else for(w=d;w!==null;){if(w===e){w=null;break}if(d=w.sibling,d!==null){d.return=w.return,w=d;break}w=w.return}d=w}}function Wa(e,n,a,s){e=null;for(var d=n,p=!1;d!==null;){if(!p){if((d.flags&524288)!==0)p=!0;else if((d.flags&262144)!==0)break}if(d.tag===10){var w=d.alternate;if(w===null)throw Error(i(387));if(w=w.memoizedProps,w!==null){var N=d.type;It(d.pendingProps.value,w.value)||(e!==null?e.push(N):e=[N])}}else if(d===ce.current){if(w=d.alternate,w===null)throw Error(i(387));w.memoizedState.memoizedState!==d.memoizedState.memoizedState&&(e!==null?e.push(ws):e=[ws])}d=d.return}e!==null&&uu(n,e,a,s),n.flags|=262144}function Ei(e){for(e=e.firstContext;e!==null;){if(!It(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function aa(e){ra=e,Fn=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function gt(e){return Vp(ra,e)}function Ci(e,n){return ra===null&&aa(e),Vp(e,n)}function Vp(e,n){var a=n._currentValue;if(n={context:n,memoizedValue:a,next:null},Fn===null){if(e===null)throw Error(i(308));Fn=n,e.dependencies={lanes:0,firstContext:n},e.flags|=524288}else Fn=Fn.next=n;return a}var ck=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()})}},uk=t.unstable_scheduleCallback,dk=t.unstable_NormalPriority,at={$$typeof:j,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function du(){return{controller:new ck,data:new Map,refCount:0}}function $o(e){e.refCount--,e.refCount===0&&uk(dk,function(){e.controller.abort()})}var Go=null,fu=0,Ua=0,qa=null;function fk(e,n){if(Go===null){var a=Go=[];fu=0,Ua=hd(),qa={status:"pending",value:void 0,then:function(s){a.push(s)}}}return fu++,n.then($p,$p),n}function $p(){if(--fu===0&&Go!==null){qa!==null&&(qa.status="fulfilled");var e=Go;Go=null,Ua=0,qa=null;for(var n=0;n<e.length;n++)(0,e[n])()}}function mk(e,n){var a=[],s={status:"pending",value:null,reason:null,then:function(d){a.push(d)}};return e.then(function(){s.status="fulfilled",s.value=n;for(var d=0;d<a.length;d++)(0,a[d])(n)},function(d){for(s.status="rejected",s.reason=d,d=0;d<a.length;d++)(0,a[d])(void 0)}),s}var Gp=M.S;M.S=function(e,n){Og=$e(),typeof n=="object"&&n!==null&&typeof n.then=="function"&&fk(e,n),Gp!==null&&Gp(e,n)};var oa=R(null);function mu(){var e=oa.current;return e!==null?e:Ye.pooledCache}function Ti(e,n){n===null?re(oa,oa.current):re(oa,n.pool)}function Xp(){var e=mu();return e===null?null:{parent:at._currentValue,pool:e}}var Ia=Error(i(460)),pu=Error(i(474)),Ai=Error(i(542)),_i={then:function(){}};function Zp(e){return e=e.status,e==="fulfilled"||e==="rejected"}function Qp(e,n,a){switch(a=e[a],a===void 0?e.push(n):a!==n&&(n.then(qn,qn),n=a),n.status){case"fulfilled":return n.value;case"rejected":throw e=n.reason,eh(e),e;default:if(typeof n.status=="string")n.then(qn,qn);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 d=n;d.status="fulfilled",d.value=s}},function(s){if(n.status==="pending"){var d=n;d.status="rejected",d.reason=s}})}switch(n.status){case"fulfilled":return n.value;case"rejected":throw e=n.reason,eh(e),e}throw ia=n,Ia}}function sa(e){try{var n=e._init;return n(e._payload)}catch(a){throw a!==null&&typeof a=="object"&&typeof a.then=="function"?(ia=a,Ia):a}}var ia=null;function Jp(){if(ia===null)throw Error(i(459));var e=ia;return ia=null,e}function eh(e){if(e===Ia||e===Ai)throw Error(i(483))}var Pa=null,Xo=0;function Ni(e){var n=Xo;return Xo+=1,Pa===null&&(Pa=[]),Qp(Pa,e,n)}function Zo(e,n){n=n.props.ref,e.ref=n!==void 0?n:null}function ji(e,n){throw n.$$typeof===x?Error(i(525)):(e=Object.prototype.toString.call(n),Error(i(31,e==="[object Object]"?"object with keys {"+Object.keys(n).join(", ")+"}":e)))}function th(e){function n(U,H){if(e){var F=U.deletions;F===null?(U.deletions=[H],U.flags|=16):F.push(H)}}function a(U,H){if(!e)return null;for(;H!==null;)n(U,H),H=H.sibling;return null}function s(U){for(var H=new Map;U!==null;)U.key!==null?H.set(U.key,U):H.set(U.index,U),U=U.sibling;return H}function d(U,H){return U=Pn(U,H),U.index=0,U.sibling=null,U}function p(U,H,F){return U.index=F,e?(F=U.alternate,F!==null?(F=F.index,F<H?(U.flags|=67108866,H):F):(U.flags|=67108866,H)):(U.flags|=1048576,H)}function w(U){return e&&U.alternate===null&&(U.flags|=67108866),U}function N(U,H,F,oe){return H===null||H.tag!==6?(H=nu(F,U.mode,oe),H.return=U,H):(H=d(H,F),H.return=U,H)}function z(U,H,F,oe){var we=F.type;return we===k?ne(U,H,F.props.children,oe,F.key):H!==null&&(H.elementType===we||typeof we=="object"&&we!==null&&we.$$typeof===B&&sa(we)===H.type)?(H=d(H,F.props),Zo(H,F),H.return=U,H):(H=ki(F.type,F.key,F.props,null,U.mode,oe),Zo(H,F),H.return=U,H)}function Y(U,H,F,oe){return H===null||H.tag!==4||H.stateNode.containerInfo!==F.containerInfo||H.stateNode.implementation!==F.implementation?(H=ru(F,U.mode,oe),H.return=U,H):(H=d(H,F.children||[]),H.return=U,H)}function ne(U,H,F,oe,we){return H===null||H.tag!==7?(H=ta(F,U.mode,oe,we),H.return=U,H):(H=d(H,F),H.return=U,H)}function se(U,H,F){if(typeof H=="string"&&H!==""||typeof H=="number"||typeof H=="bigint")return H=nu(""+H,U.mode,F),H.return=U,H;if(typeof H=="object"&&H!==null){switch(H.$$typeof){case S:return F=ki(H.type,H.key,H.props,null,U.mode,F),Zo(F,H),F.return=U,F;case T:return H=ru(H,U.mode,F),H.return=U,H;case B:return H=sa(H),se(U,H,F)}if($(H)||V(H))return H=ta(H,U.mode,F,null),H.return=U,H;if(typeof H.then=="function")return se(U,Ni(H),F);if(H.$$typeof===j)return se(U,Ci(U,H),F);ji(U,H)}return null}function G(U,H,F,oe){var we=H!==null?H.key:null;if(typeof F=="string"&&F!==""||typeof F=="number"||typeof F=="bigint")return we!==null?null:N(U,H,""+F,oe);if(typeof F=="object"&&F!==null){switch(F.$$typeof){case S:return F.key===we?z(U,H,F,oe):null;case T:return F.key===we?Y(U,H,F,oe):null;case B:return F=sa(F),G(U,H,F,oe)}if($(F)||V(F))return we!==null?null:ne(U,H,F,oe,null);if(typeof F.then=="function")return G(U,H,Ni(F),oe);if(F.$$typeof===j)return G(U,H,Ci(U,F),oe);ji(U,F)}return null}function Q(U,H,F,oe,we){if(typeof oe=="string"&&oe!==""||typeof oe=="number"||typeof oe=="bigint")return U=U.get(F)||null,N(H,U,""+oe,we);if(typeof oe=="object"&&oe!==null){switch(oe.$$typeof){case S:return U=U.get(oe.key===null?F:oe.key)||null,z(H,U,oe,we);case T:return U=U.get(oe.key===null?F:oe.key)||null,Y(H,U,oe,we);case B:return oe=sa(oe),Q(U,H,F,oe,we)}if($(oe)||V(oe))return U=U.get(F)||null,ne(H,U,oe,we,null);if(typeof oe.then=="function")return Q(U,H,F,Ni(oe),we);if(oe.$$typeof===j)return Q(U,H,F,Ci(H,oe),we);ji(H,oe)}return null}function he(U,H,F,oe){for(var we=null,Be=null,ye=H,Re=H=0,Le=null;ye!==null&&Re<F.length;Re++){ye.index>Re?(Le=ye,ye=null):Le=ye.sibling;var We=G(U,ye,F[Re],oe);if(We===null){ye===null&&(ye=Le);break}e&&ye&&We.alternate===null&&n(U,ye),H=p(We,H,Re),Be===null?we=We:Be.sibling=We,Be=We,ye=Le}if(Re===F.length)return a(U,ye),ze&&Kn(U,Re),we;if(ye===null){for(;Re<F.length;Re++)ye=se(U,F[Re],oe),ye!==null&&(H=p(ye,H,Re),Be===null?we=ye:Be.sibling=ye,Be=ye);return ze&&Kn(U,Re),we}for(ye=s(ye);Re<F.length;Re++)Le=Q(ye,U,Re,F[Re],oe),Le!==null&&(e&&Le.alternate!==null&&ye.delete(Le.key===null?Re:Le.key),H=p(Le,H,Re),Be===null?we=Le:Be.sibling=Le,Be=Le);return e&&ye.forEach(function(Mr){return n(U,Mr)}),ze&&Kn(U,Re),we}function Ee(U,H,F,oe){if(F==null)throw Error(i(151));for(var we=null,Be=null,ye=H,Re=H=0,Le=null,We=F.next();ye!==null&&!We.done;Re++,We=F.next()){ye.index>Re?(Le=ye,ye=null):Le=ye.sibling;var Mr=G(U,ye,We.value,oe);if(Mr===null){ye===null&&(ye=Le);break}e&&ye&&Mr.alternate===null&&n(U,ye),H=p(Mr,H,Re),Be===null?we=Mr:Be.sibling=Mr,Be=Mr,ye=Le}if(We.done)return a(U,ye),ze&&Kn(U,Re),we;if(ye===null){for(;!We.done;Re++,We=F.next())We=se(U,We.value,oe),We!==null&&(H=p(We,H,Re),Be===null?we=We:Be.sibling=We,Be=We);return ze&&Kn(U,Re),we}for(ye=s(ye);!We.done;Re++,We=F.next())We=Q(ye,U,Re,We.value,oe),We!==null&&(e&&We.alternate!==null&&ye.delete(We.key===null?Re:We.key),H=p(We,H,Re),Be===null?we=We:Be.sibling=We,Be=We);return e&&ye.forEach(function(E2){return n(U,E2)}),ze&&Kn(U,Re),we}function Fe(U,H,F,oe){if(typeof F=="object"&&F!==null&&F.type===k&&F.key===null&&(F=F.props.children),typeof F=="object"&&F!==null){switch(F.$$typeof){case S:e:{for(var we=F.key;H!==null;){if(H.key===we){if(we=F.type,we===k){if(H.tag===7){a(U,H.sibling),oe=d(H,F.props.children),oe.return=U,U=oe;break e}}else if(H.elementType===we||typeof we=="object"&&we!==null&&we.$$typeof===B&&sa(we)===H.type){a(U,H.sibling),oe=d(H,F.props),Zo(oe,F),oe.return=U,U=oe;break e}a(U,H);break}else n(U,H);H=H.sibling}F.type===k?(oe=ta(F.props.children,U.mode,oe,F.key),oe.return=U,U=oe):(oe=ki(F.type,F.key,F.props,null,U.mode,oe),Zo(oe,F),oe.return=U,U=oe)}return w(U);case T:e:{for(we=F.key;H!==null;){if(H.key===we)if(H.tag===4&&H.stateNode.containerInfo===F.containerInfo&&H.stateNode.implementation===F.implementation){a(U,H.sibling),oe=d(H,F.children||[]),oe.return=U,U=oe;break e}else{a(U,H);break}else n(U,H);H=H.sibling}oe=ru(F,U.mode,oe),oe.return=U,U=oe}return w(U);case B:return F=sa(F),Fe(U,H,F,oe)}if($(F))return he(U,H,F,oe);if(V(F)){if(we=V(F),typeof we!="function")throw Error(i(150));return F=we.call(F),Ee(U,H,F,oe)}if(typeof F.then=="function")return Fe(U,H,Ni(F),oe);if(F.$$typeof===j)return Fe(U,H,Ci(U,F),oe);ji(U,F)}return typeof F=="string"&&F!==""||typeof F=="number"||typeof F=="bigint"?(F=""+F,H!==null&&H.tag===6?(a(U,H.sibling),oe=d(H,F),oe.return=U,U=oe):(a(U,H),oe=nu(F,U.mode,oe),oe.return=U,U=oe),w(U)):a(U,H)}return function(U,H,F,oe){try{Xo=0;var we=Fe(U,H,F,oe);return Pa=null,we}catch(ye){if(ye===Ia||ye===Ai)throw ye;var Be=Pt(29,ye,null,U.mode);return Be.lanes=oe,Be.return=U,Be}}}var la=th(!0),nh=th(!1),vr=!1;function hu(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function gu(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 yr(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function br(e,n,a){var s=e.updateQueue;if(s===null)return null;if(s=s.shared,(Ue&2)!==0){var d=s.pending;return d===null?n.next=n:(n.next=d.next,d.next=n),s.pending=n,n=xi(e),Wp(e,null,a),n}return wi(e,s,n,a),xi(e)}function Qo(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,Vm(e,a)}}function vu(e,n){var a=e.updateQueue,s=e.alternate;if(s!==null&&(s=s.updateQueue,a===s)){var d=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?d=p=w:p=p.next=w,a=a.next}while(a!==null);p===null?d=p=n:p=p.next=n}else d=p=n;a={baseState:s.baseState,firstBaseUpdate:d,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 yu=!1;function Jo(){if(yu){var e=qa;if(e!==null)throw e}}function es(e,n,a,s){yu=!1;var d=e.updateQueue;vr=!1;var p=d.firstBaseUpdate,w=d.lastBaseUpdate,N=d.shared.pending;if(N!==null){d.shared.pending=null;var z=N,Y=z.next;z.next=null,w===null?p=Y:w.next=Y,w=z;var ne=e.alternate;ne!==null&&(ne=ne.updateQueue,N=ne.lastBaseUpdate,N!==w&&(N===null?ne.firstBaseUpdate=Y:N.next=Y,ne.lastBaseUpdate=z))}if(p!==null){var se=d.baseState;w=0,ne=Y=z=null,N=p;do{var G=N.lane&-536870913,Q=G!==N.lane;if(Q?(Me&G)===G:(s&G)===G){G!==0&&G===Ua&&(yu=!0),ne!==null&&(ne=ne.next={lane:0,tag:N.tag,payload:N.payload,callback:null,next:null});e:{var he=e,Ee=N;G=n;var Fe=a;switch(Ee.tag){case 1:if(he=Ee.payload,typeof he=="function"){se=he.call(Fe,se,G);break e}se=he;break e;case 3:he.flags=he.flags&-65537|128;case 0:if(he=Ee.payload,G=typeof he=="function"?he.call(Fe,se,G):he,G==null)break e;se=v({},se,G);break e;case 2:vr=!0}}G=N.callback,G!==null&&(e.flags|=64,Q&&(e.flags|=8192),Q=d.callbacks,Q===null?d.callbacks=[G]:Q.push(G))}else Q={lane:G,tag:N.tag,payload:N.payload,callback:N.callback,next:null},ne===null?(Y=ne=Q,z=se):ne=ne.next=Q,w|=G;if(N=N.next,N===null){if(N=d.shared.pending,N===null)break;Q=N,N=Q.next,Q.next=null,d.lastBaseUpdate=Q,d.shared.pending=null}}while(!0);ne===null&&(z=se),d.baseState=z,d.firstBaseUpdate=Y,d.lastBaseUpdate=ne,p===null&&(d.shared.lanes=0),Er|=w,e.lanes=w,e.memoizedState=se}}function rh(e,n){if(typeof e!="function")throw Error(i(191,e));e.call(n)}function ah(e,n){var a=e.callbacks;if(a!==null)for(e.callbacks=null,e=0;e<a.length;e++)rh(a[e],n)}var Ka=R(null),Ri=R(0);function oh(e,n){e=tr,re(Ri,e),re(Ka,n),tr=e|n.baseLanes}function bu(){re(Ri,tr),re(Ka,Ka.current)}function wu(){tr=Ri.current,W(Ka),W(Ri)}var Kt=R(null),un=null;function wr(e){var n=e.alternate;re(tt,tt.current&1),re(Kt,e),un===null&&(n===null||Ka.current!==null||n.memoizedState!==null)&&(un=e)}function xu(e){re(tt,tt.current),re(Kt,e),un===null&&(un=e)}function sh(e){e.tag===22?(re(tt,tt.current),re(Kt,e),un===null&&(un=e)):xr()}function xr(){re(tt,tt.current),re(Kt,Kt.current)}function Ft(e){W(Kt),un===e&&(un=null),W(tt)}var tt=R(0);function Oi(e){for(var n=e;n!==null;){if(n.tag===13){var a=n.memoizedState;if(a!==null&&(a=a.dehydrated,a===null||Ad(a)||_d(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 Vn=0,Ne=null,Pe=null,ot=null,Di=!1,Fa=!1,ca=!1,Mi=0,ts=0,Ya=null,pk=0;function Je(){throw Error(i(321))}function ku(e,n){if(n===null)return!1;for(var a=0;a<n.length&&a<e.length;a++)if(!It(e[a],n[a]))return!1;return!0}function Su(e,n,a,s,d,p){return Vn=p,Ne=n,n.memoizedState=null,n.updateQueue=null,n.lanes=0,M.H=e===null||e.memoizedState===null?Ph:Bu,ca=!1,p=a(s,d),ca=!1,Fa&&(p=lh(n,a,s,d)),ih(e),p}function ih(e){M.H=as;var n=Pe!==null&&Pe.next!==null;if(Vn=0,ot=Pe=Ne=null,Di=!1,ts=0,Ya=null,n)throw Error(i(300));e===null||st||(e=e.dependencies,e!==null&&Ei(e)&&(st=!0))}function lh(e,n,a,s){Ne=e;var d=0;do{if(Fa&&(Ya=null),ts=0,Fa=!1,25<=d)throw Error(i(301));if(d+=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=Kh,p=n(a,s)}while(Fa);return p}function hk(){var e=M.H,n=e.useState()[0];return n=typeof n.then=="function"?ns(n):n,e=e.useState()[0],(Pe!==null?Pe.memoizedState:null)!==e&&(Ne.flags|=1024),n}function Eu(){var e=Mi!==0;return Mi=0,e}function Cu(e,n,a){n.updateQueue=e.updateQueue,n.flags&=-2053,e.lanes&=~a}function Tu(e){if(Di){for(e=e.memoizedState;e!==null;){var n=e.queue;n!==null&&(n.pending=null),e=e.next}Di=!1}Vn=0,ot=Pe=Ne=null,Fa=!1,ts=Mi=0,Ya=null}function Ct(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return ot===null?Ne.memoizedState=ot=e:ot=ot.next=e,ot}function nt(){if(Pe===null){var e=Ne.alternate;e=e!==null?e.memoizedState:null}else e=Pe.next;var n=ot===null?Ne.memoizedState:ot.next;if(n!==null)ot=n,Pe=e;else{if(e===null)throw Ne.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?Ne.memoizedState=ot=e:ot=ot.next=e}return ot}function Li(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function ns(e){var n=ts;return ts+=1,Ya===null&&(Ya=[]),e=Qp(Ya,e,n),n=Ne,(ot===null?n.memoizedState:ot.next)===null&&(n=n.alternate,M.H=n===null||n.memoizedState===null?Ph:Bu),e}function zi(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return ns(e);if(e.$$typeof===j)return gt(e)}throw Error(i(438,String(e)))}function Au(e){var n=null,a=Ne.updateQueue;if(a!==null&&(n=a.memoCache),n==null){var s=Ne.alternate;s!==null&&(s=s.updateQueue,s!==null&&(s=s.memoCache,s!=null&&(n={data:s.data.map(function(d){return d.slice()}),index:0})))}if(n==null&&(n={data:[],index:0}),a===null&&(a=Li(),Ne.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 $n(e,n){return typeof n=="function"?n(e):n}function Hi(e){var n=nt();return _u(n,Pe,e)}function _u(e,n,a){var s=e.queue;if(s===null)throw Error(i(311));s.lastRenderedReducer=a;var d=e.baseQueue,p=s.pending;if(p!==null){if(d!==null){var w=d.next;d.next=p.next,p.next=w}n.baseQueue=d=p,s.pending=null}if(p=e.baseState,d===null)e.memoizedState=p;else{n=d.next;var N=w=null,z=null,Y=n,ne=!1;do{var se=Y.lane&-536870913;if(se!==Y.lane?(Me&se)===se:(Vn&se)===se){var G=Y.revertLane;if(G===0)z!==null&&(z=z.next={lane:0,revertLane:0,gesture:null,action:Y.action,hasEagerState:Y.hasEagerState,eagerState:Y.eagerState,next:null}),se===Ua&&(ne=!0);else if((Vn&G)===G){Y=Y.next,G===Ua&&(ne=!0);continue}else se={lane:0,revertLane:Y.revertLane,gesture:null,action:Y.action,hasEagerState:Y.hasEagerState,eagerState:Y.eagerState,next:null},z===null?(N=z=se,w=p):z=z.next=se,Ne.lanes|=G,Er|=G;se=Y.action,ca&&a(p,se),p=Y.hasEagerState?Y.eagerState:a(p,se)}else G={lane:se,revertLane:Y.revertLane,gesture:Y.gesture,action:Y.action,hasEagerState:Y.hasEagerState,eagerState:Y.eagerState,next:null},z===null?(N=z=G,w=p):z=z.next=G,Ne.lanes|=se,Er|=se;Y=Y.next}while(Y!==null&&Y!==n);if(z===null?w=p:z.next=N,!It(p,e.memoizedState)&&(st=!0,ne&&(a=qa,a!==null)))throw a;e.memoizedState=p,e.baseState=w,e.baseQueue=z,s.lastRenderedState=p}return d===null&&(s.lanes=0),[e.memoizedState,s.dispatch]}function Nu(e){var n=nt(),a=n.queue;if(a===null)throw Error(i(311));a.lastRenderedReducer=e;var s=a.dispatch,d=a.pending,p=n.memoizedState;if(d!==null){a.pending=null;var w=d=d.next;do p=e(p,w.action),w=w.next;while(w!==d);It(p,n.memoizedState)||(st=!0),n.memoizedState=p,n.baseQueue===null&&(n.baseState=p),a.lastRenderedState=p}return[p,s]}function ch(e,n,a){var s=Ne,d=nt(),p=ze;if(p){if(a===void 0)throw Error(i(407));a=a()}else a=n();var w=!It((Pe||d).memoizedState,a);if(w&&(d.memoizedState=a,st=!0),d=d.queue,Ou(fh.bind(null,s,d,e),[e]),d.getSnapshot!==n||w||ot!==null&&ot.memoizedState.tag&1){if(s.flags|=2048,Va(9,{destroy:void 0},dh.bind(null,s,d,a,n),null),Ye===null)throw Error(i(349));p||(Vn&127)!==0||uh(s,n,a)}return a}function uh(e,n,a){e.flags|=16384,e={getSnapshot:n,value:a},n=Ne.updateQueue,n===null?(n=Li(),Ne.updateQueue=n,n.stores=[e]):(a=n.stores,a===null?n.stores=[e]:a.push(e))}function dh(e,n,a,s){n.value=a,n.getSnapshot=s,mh(n)&&ph(e)}function fh(e,n,a){return a(function(){mh(n)&&ph(e)})}function mh(e){var n=e.getSnapshot;e=e.value;try{var a=n();return!It(e,a)}catch{return!0}}function ph(e){var n=ea(e,2);n!==null&&Mt(n,e,2)}function ju(e){var n=Ct();if(typeof e=="function"){var a=e;if(e=a(),ca){ur(!0);try{a()}finally{ur(!1)}}}return n.memoizedState=n.baseState=e,n.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:$n,lastRenderedState:e},n}function hh(e,n,a,s){return e.baseState=a,_u(e,Pe,typeof s=="function"?s:$n)}function gk(e,n,a,s,d){if(Ui(e))throw Error(i(485));if(e=n.action,e!==null){var p={payload:d,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,gh(n,p)):(p.next=a.next,n.pending=a.next=p)}}function gh(e,n){var a=n.action,s=n.payload,d=e.state;if(n.isTransition){var p=M.T,w={};M.T=w;try{var N=a(d,s),z=M.S;z!==null&&z(w,N),vh(e,n,N)}catch(Y){Ru(e,n,Y)}finally{p!==null&&w.types!==null&&(p.types=w.types),M.T=p}}else try{p=a(d,s),vh(e,n,p)}catch(Y){Ru(e,n,Y)}}function vh(e,n,a){a!==null&&typeof a=="object"&&typeof a.then=="function"?a.then(function(s){yh(e,n,s)},function(s){return Ru(e,n,s)}):yh(e,n,a)}function yh(e,n,a){n.status="fulfilled",n.value=a,bh(n),e.state=a,n=e.pending,n!==null&&(a=n.next,a===n?e.pending=null:(a=a.next,n.next=a,gh(e,a)))}function Ru(e,n,a){var s=e.pending;if(e.pending=null,s!==null){s=s.next;do n.status="rejected",n.reason=a,bh(n),n=n.next;while(n!==s)}e.action=null}function bh(e){e=e.listeners;for(var n=0;n<e.length;n++)(0,e[n])()}function wh(e,n){return n}function xh(e,n){if(ze){var a=Ye.formState;if(a!==null){e:{var s=Ne;if(ze){if(Ge){t:{for(var d=Ge,p=cn;d.nodeType!==8;){if(!p){d=null;break t}if(d=dn(d.nextSibling),d===null){d=null;break t}}p=d.data,d=p==="F!"||p==="F"?d:null}if(d){Ge=dn(d.nextSibling),s=d.data==="F!";break e}}hr(s)}s=!1}s&&(n=a[0])}}return a=Ct(),a.memoizedState=a.baseState=n,s={pending:null,lanes:0,dispatch:null,lastRenderedReducer:wh,lastRenderedState:n},a.queue=s,a=Uh.bind(null,Ne,s),s.dispatch=a,s=ju(!1),p=Hu.bind(null,Ne,!1,s.queue),s=Ct(),d={state:n,dispatch:null,action:e,pending:null},s.queue=d,a=gk.bind(null,Ne,d,p,a),d.dispatch=a,s.memoizedState=e,[n,a,!1]}function kh(e){var n=nt();return Sh(n,Pe,e)}function Sh(e,n,a){if(n=_u(e,n,wh)[0],e=Hi($n)[0],typeof n=="object"&&n!==null&&typeof n.then=="function")try{var s=ns(n)}catch(w){throw w===Ia?Ai:w}else s=n;n=nt();var d=n.queue,p=d.dispatch;return a!==n.memoizedState&&(Ne.flags|=2048,Va(9,{destroy:void 0},vk.bind(null,d,a),null)),[s,p,e]}function vk(e,n){e.action=n}function Eh(e){var n=nt(),a=Pe;if(a!==null)return Sh(n,a,e);nt(),n=n.memoizedState,a=nt();var s=a.queue.dispatch;return a.memoizedState=e,[n,s,!1]}function Va(e,n,a,s){return e={tag:e,create:a,deps:s,inst:n,next:null},n=Ne.updateQueue,n===null&&(n=Li(),Ne.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 Ch(){return nt().memoizedState}function Bi(e,n,a,s){var d=Ct();Ne.flags|=e,d.memoizedState=Va(1|n,{destroy:void 0},a,s===void 0?null:s)}function Wi(e,n,a,s){var d=nt();s=s===void 0?null:s;var p=d.memoizedState.inst;Pe!==null&&s!==null&&ku(s,Pe.memoizedState.deps)?d.memoizedState=Va(n,p,a,s):(Ne.flags|=e,d.memoizedState=Va(1|n,p,a,s))}function Th(e,n){Bi(8390656,8,e,n)}function Ou(e,n){Wi(2048,8,e,n)}function yk(e){Ne.flags|=4;var n=Ne.updateQueue;if(n===null)n=Li(),Ne.updateQueue=n,n.events=[e];else{var a=n.events;a===null?n.events=[e]:a.push(e)}}function Ah(e){var n=nt().memoizedState;return yk({ref:n,nextImpl:e}),function(){if((Ue&2)!==0)throw Error(i(440));return n.impl.apply(void 0,arguments)}}function _h(e,n){return Wi(4,2,e,n)}function Nh(e,n){return Wi(4,4,e,n)}function jh(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 Rh(e,n,a){a=a!=null?a.concat([e]):null,Wi(4,4,jh.bind(null,n,e),a)}function Du(){}function Oh(e,n){var a=nt();n=n===void 0?null:n;var s=a.memoizedState;return n!==null&&ku(n,s[1])?s[0]:(a.memoizedState=[e,n],e)}function Dh(e,n){var a=nt();n=n===void 0?null:n;var s=a.memoizedState;if(n!==null&&ku(n,s[1]))return s[0];if(s=e(),ca){ur(!0);try{e()}finally{ur(!1)}}return a.memoizedState=[s,n],s}function Mu(e,n,a){return a===void 0||(Vn&1073741824)!==0&&(Me&261930)===0?e.memoizedState=n:(e.memoizedState=a,e=Mg(),Ne.lanes|=e,Er|=e,a)}function Mh(e,n,a,s){return It(a,n)?a:Ka.current!==null?(e=Mu(e,a,s),It(e,n)||(st=!0),e):(Vn&42)===0||(Vn&1073741824)!==0&&(Me&261930)===0?(st=!0,e.memoizedState=a):(e=Mg(),Ne.lanes|=e,Er|=e,n)}function Lh(e,n,a,s,d){var p=I.p;I.p=p!==0&&8>p?p:8;var w=M.T,N={};M.T=N,Hu(e,!1,n,a);try{var z=d(),Y=M.S;if(Y!==null&&Y(N,z),z!==null&&typeof z=="object"&&typeof z.then=="function"){var ne=mk(z,s);rs(e,n,ne,$t(e))}else rs(e,n,s,$t(e))}catch(se){rs(e,n,{then:function(){},status:"rejected",reason:se},$t())}finally{I.p=p,w!==null&&N.types!==null&&(w.types=N.types),M.T=w}}function bk(){}function Lu(e,n,a,s){if(e.tag!==5)throw Error(i(476));var d=zh(e).queue;Lh(e,d,n,P,a===null?bk:function(){return Hh(e),a(s)})}function zh(e){var n=e.memoizedState;if(n!==null)return n;n={memoizedState:P,baseState:P,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:$n,lastRenderedState:P},next:null};var a={};return n.next={memoizedState:a,baseState:a,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:$n,lastRenderedState:a},next:null},e.memoizedState=n,e=e.alternate,e!==null&&(e.memoizedState=n),n}function Hh(e){var n=zh(e);n.next===null&&(n=e.alternate.memoizedState),rs(e,n.next.queue,{},$t())}function zu(){return gt(ws)}function Bh(){return nt().memoizedState}function Wh(){return nt().memoizedState}function wk(e){for(var n=e.return;n!==null;){switch(n.tag){case 24:case 3:var a=$t();e=yr(a);var s=br(n,e,a);s!==null&&(Mt(s,n,a),Qo(s,n,a)),n={cache:du()},e.payload=n;return}n=n.return}}function xk(e,n,a){var s=$t();a={lane:s,revertLane:0,gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null},Ui(e)?qh(n,a):(a=eu(e,n,a,s),a!==null&&(Mt(a,e,s),Ih(a,n,s)))}function Uh(e,n,a){var s=$t();rs(e,n,a,s)}function rs(e,n,a,s){var d={lane:s,revertLane:0,gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null};if(Ui(e))qh(n,d);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(d.hasEagerState=!0,d.eagerState=N,It(N,w))return wi(e,n,d,0),Ye===null&&bi(),!1}catch{}if(a=eu(e,n,d,s),a!==null)return Mt(a,e,s),Ih(a,n,s),!0}return!1}function Hu(e,n,a,s){if(s={lane:2,revertLane:hd(),gesture:null,action:s,hasEagerState:!1,eagerState:null,next:null},Ui(e)){if(n)throw Error(i(479))}else n=eu(e,a,s,2),n!==null&&Mt(n,e,2)}function Ui(e){var n=e.alternate;return e===Ne||n!==null&&n===Ne}function qh(e,n){Fa=Di=!0;var a=e.pending;a===null?n.next=n:(n.next=a.next,a.next=n),e.pending=n}function Ih(e,n,a){if((a&4194048)!==0){var s=n.lanes;s&=e.pendingLanes,a|=s,n.lanes=a,Vm(e,a)}}var as={readContext:gt,use:zi,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};as.useEffectEvent=Je;var Ph={readContext:gt,use:zi,useCallback:function(e,n){return Ct().memoizedState=[e,n===void 0?null:n],e},useContext:gt,useEffect:Th,useImperativeHandle:function(e,n,a){a=a!=null?a.concat([e]):null,Bi(4194308,4,jh.bind(null,n,e),a)},useLayoutEffect:function(e,n){return Bi(4194308,4,e,n)},useInsertionEffect:function(e,n){Bi(4,2,e,n)},useMemo:function(e,n){var a=Ct();n=n===void 0?null:n;var s=e();if(ca){ur(!0);try{e()}finally{ur(!1)}}return a.memoizedState=[s,n],s},useReducer:function(e,n,a){var s=Ct();if(a!==void 0){var d=a(n);if(ca){ur(!0);try{a(n)}finally{ur(!1)}}}else d=n;return s.memoizedState=s.baseState=d,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:d},s.queue=e,e=e.dispatch=xk.bind(null,Ne,e),[s.memoizedState,e]},useRef:function(e){var n=Ct();return e={current:e},n.memoizedState=e},useState:function(e){e=ju(e);var n=e.queue,a=Uh.bind(null,Ne,n);return n.dispatch=a,[e.memoizedState,a]},useDebugValue:Du,useDeferredValue:function(e,n){var a=Ct();return Mu(a,e,n)},useTransition:function(){var e=ju(!1);return e=Lh.bind(null,Ne,e.queue,!0,!1),Ct().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,n,a){var s=Ne,d=Ct();if(ze){if(a===void 0)throw Error(i(407));a=a()}else{if(a=n(),Ye===null)throw Error(i(349));(Me&127)!==0||uh(s,n,a)}d.memoizedState=a;var p={value:a,getSnapshot:n};return d.queue=p,Th(fh.bind(null,s,p,e),[e]),s.flags|=2048,Va(9,{destroy:void 0},dh.bind(null,s,p,a,n),null),a},useId:function(){var e=Ct(),n=Ye.identifierPrefix;if(ze){var a=_n,s=An;a=(s&~(1<<32-qt(s)-1)).toString(32)+a,n="_"+n+"R_"+a,a=Mi++,0<a&&(n+="H"+a.toString(32)),n+="_"}else a=pk++,n="_"+n+"r_"+a.toString(32)+"_";return e.memoizedState=n},useHostTransitionStatus:zu,useFormState:xh,useActionState:xh,useOptimistic:function(e){var n=Ct();n.memoizedState=n.baseState=e;var a={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return n.queue=a,n=Hu.bind(null,Ne,!0,a),a.dispatch=n,[e,n]},useMemoCache:Au,useCacheRefresh:function(){return Ct().memoizedState=wk.bind(null,Ne)},useEffectEvent:function(e){var n=Ct(),a={impl:e};return n.memoizedState=a,function(){if((Ue&2)!==0)throw Error(i(440));return a.impl.apply(void 0,arguments)}}},Bu={readContext:gt,use:zi,useCallback:Oh,useContext:gt,useEffect:Ou,useImperativeHandle:Rh,useInsertionEffect:_h,useLayoutEffect:Nh,useMemo:Dh,useReducer:Hi,useRef:Ch,useState:function(){return Hi($n)},useDebugValue:Du,useDeferredValue:function(e,n){var a=nt();return Mh(a,Pe.memoizedState,e,n)},useTransition:function(){var e=Hi($n)[0],n=nt().memoizedState;return[typeof e=="boolean"?e:ns(e),n]},useSyncExternalStore:ch,useId:Bh,useHostTransitionStatus:zu,useFormState:kh,useActionState:kh,useOptimistic:function(e,n){var a=nt();return hh(a,Pe,e,n)},useMemoCache:Au,useCacheRefresh:Wh};Bu.useEffectEvent=Ah;var Kh={readContext:gt,use:zi,useCallback:Oh,useContext:gt,useEffect:Ou,useImperativeHandle:Rh,useInsertionEffect:_h,useLayoutEffect:Nh,useMemo:Dh,useReducer:Nu,useRef:Ch,useState:function(){return Nu($n)},useDebugValue:Du,useDeferredValue:function(e,n){var a=nt();return Pe===null?Mu(a,e,n):Mh(a,Pe.memoizedState,e,n)},useTransition:function(){var e=Nu($n)[0],n=nt().memoizedState;return[typeof e=="boolean"?e:ns(e),n]},useSyncExternalStore:ch,useId:Bh,useHostTransitionStatus:zu,useFormState:Eh,useActionState:Eh,useOptimistic:function(e,n){var a=nt();return Pe!==null?hh(a,Pe,e,n):(a.baseState=e,[e,a.queue.dispatch])},useMemoCache:Au,useCacheRefresh:Wh};Kh.useEffectEvent=Ah;function Wu(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 Uu={enqueueSetState:function(e,n,a){e=e._reactInternals;var s=$t(),d=yr(s);d.payload=n,a!=null&&(d.callback=a),n=br(e,d,s),n!==null&&(Mt(n,e,s),Qo(n,e,s))},enqueueReplaceState:function(e,n,a){e=e._reactInternals;var s=$t(),d=yr(s);d.tag=1,d.payload=n,a!=null&&(d.callback=a),n=br(e,d,s),n!==null&&(Mt(n,e,s),Qo(n,e,s))},enqueueForceUpdate:function(e,n){e=e._reactInternals;var a=$t(),s=yr(a);s.tag=2,n!=null&&(s.callback=n),n=br(e,s,a),n!==null&&(Mt(n,e,a),Qo(n,e,a))}};function Fh(e,n,a,s,d,p,w){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(s,p,w):n.prototype&&n.prototype.isPureReactComponent?!Ko(a,s)||!Ko(d,p):!0}function Yh(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&&Uu.enqueueReplaceState(n,n.state,null)}function ua(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 d in e)a[d]===void 0&&(a[d]=e[d])}return a}function Vh(e){yi(e)}function $h(e){console.error(e)}function Gh(e){yi(e)}function qi(e,n){try{var a=e.onUncaughtError;a(n.value,{componentStack:n.stack})}catch(s){setTimeout(function(){throw s})}}function Xh(e,n,a){try{var s=e.onCaughtError;s(a.value,{componentStack:a.stack,errorBoundary:n.tag===1?n.stateNode:null})}catch(d){setTimeout(function(){throw d})}}function qu(e,n,a){return a=yr(a),a.tag=3,a.payload={element:null},a.callback=function(){qi(e,n)},a}function Zh(e){return e=yr(e),e.tag=3,e}function Qh(e,n,a,s){var d=a.type.getDerivedStateFromError;if(typeof d=="function"){var p=s.value;e.payload=function(){return d(p)},e.callback=function(){Xh(n,a,s)}}var w=a.stateNode;w!==null&&typeof w.componentDidCatch=="function"&&(e.callback=function(){Xh(n,a,s),typeof d!="function"&&(Cr===null?Cr=new Set([this]):Cr.add(this));var N=s.stack;this.componentDidCatch(s.value,{componentStack:N!==null?N:""})})}function kk(e,n,a,s,d){if(a.flags|=32768,s!==null&&typeof s=="object"&&typeof s.then=="function"){if(n=a.alternate,n!==null&&Wa(n,a,d,!0),a=Kt.current,a!==null){switch(a.tag){case 31:case 13:return un===null?Ji():a.alternate===null&&et===0&&(et=3),a.flags&=-257,a.flags|=65536,a.lanes=d,s===_i?a.flags|=16384:(n=a.updateQueue,n===null?a.updateQueue=new Set([s]):n.add(s),fd(e,s,d)),!1;case 22:return a.flags|=65536,s===_i?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)),fd(e,s,d)),!1}throw Error(i(435,a.tag))}return fd(e,s,d),Ji(),!1}if(ze)return n=Kt.current,n!==null?((n.flags&65536)===0&&(n.flags|=256),n.flags|=65536,n.lanes=d,s!==su&&(e=Error(i(422),{cause:s}),Vo(on(e,a)))):(s!==su&&(n=Error(i(423),{cause:s}),Vo(on(n,a))),e=e.current.alternate,e.flags|=65536,d&=-d,e.lanes|=d,s=on(s,a),d=qu(e.stateNode,s,d),vu(e,d),et!==4&&(et=2)),!1;var p=Error(i(520),{cause:s});if(p=on(p,a),fs===null?fs=[p]:fs.push(p),et!==4&&(et=2),n===null)return!0;s=on(s,a),a=n;do{switch(a.tag){case 3:return a.flags|=65536,e=d&-d,a.lanes|=e,e=qu(a.stateNode,s,e),vu(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"&&(Cr===null||!Cr.has(p))))return a.flags|=65536,d&=-d,a.lanes|=d,d=Zh(d),Qh(d,e,a,s),vu(a,d),!1}a=a.return}while(a!==null);return!1}var Iu=Error(i(461)),st=!1;function vt(e,n,a,s){n.child=e===null?nh(n,null,a,s):la(n,e.child,a,s)}function Jh(e,n,a,s,d){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 aa(n),s=Su(e,n,a,w,p,d),N=Eu(),e!==null&&!st?(Cu(e,n,d),Gn(e,n,d)):(ze&&N&&au(n),n.flags|=1,vt(e,n,s,d),n.child)}function eg(e,n,a,s,d){if(e===null){var p=a.type;return typeof p=="function"&&!tu(p)&&p.defaultProps===void 0&&a.compare===null?(n.tag=15,n.type=p,tg(e,n,p,s,d)):(e=ki(a.type,null,s,n,n.mode,d),e.ref=n.ref,e.return=n,n.child=e)}if(p=e.child,!Xu(e,d)){var w=p.memoizedProps;if(a=a.compare,a=a!==null?a:Ko,a(w,s)&&e.ref===n.ref)return Gn(e,n,d)}return n.flags|=1,e=Pn(p,s),e.ref=n.ref,e.return=n,n.child=e}function tg(e,n,a,s,d){if(e!==null){var p=e.memoizedProps;if(Ko(p,s)&&e.ref===n.ref)if(st=!1,n.pendingProps=s=p,Xu(e,d))(e.flags&131072)!==0&&(st=!0);else return n.lanes=e.lanes,Gn(e,n,d)}return Pu(e,n,a,s,d)}function ng(e,n,a,s){var d=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,d=0;s!==null;)d=d|s.lanes|s.childLanes,s=s.sibling;s=d&~p}else s=0,n.child=null;return rg(e,n,p,a,s)}if((a&536870912)!==0)n.memoizedState={baseLanes:0,cachePool:null},e!==null&&Ti(n,p!==null?p.cachePool:null),p!==null?oh(n,p):bu(),sh(n);else return s=n.lanes=536870912,rg(e,n,p!==null?p.baseLanes|a:a,a,s)}else p!==null?(Ti(n,p.cachePool),oh(n,p),xr(),n.memoizedState=null):(e!==null&&Ti(n,null),bu(),xr());return vt(e,n,d,a),n.child}function os(e,n){return e!==null&&e.tag===22||n.stateNode!==null||(n.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),n.sibling}function rg(e,n,a,s,d){var p=mu();return p=p===null?null:{parent:at._currentValue,pool:p},n.memoizedState={baseLanes:a,cachePool:p},e!==null&&Ti(n,null),bu(),sh(n),e!==null&&Wa(e,n,s,!0),n.childLanes=d,null}function Ii(e,n){return n=Ki({mode:n.mode,children:n.children},e.mode),n.ref=e.ref,e.child=n,n.return=e,n}function ag(e,n,a){return la(n,e.child,null,a),e=Ii(n,n.pendingProps),e.flags|=2,Ft(n),n.memoizedState=null,e}function Sk(e,n,a){var s=n.pendingProps,d=(n.flags&128)!==0;if(n.flags&=-129,e===null){if(ze){if(s.mode==="hidden")return e=Ii(n,s),n.lanes=536870912,os(null,e);if(xu(n),(e=Ge)?(e=gv(e,cn),e=e!==null&&e.data==="&"?e:null,e!==null&&(n.memoizedState={dehydrated:e,treeContext:mr!==null?{id:An,overflow:_n}:null,retryLane:536870912,hydrationErrors:null},a=qp(e),a.return=n,n.child=a,ht=n,Ge=null)):e=null,e===null)throw hr(n);return n.lanes=536870912,null}return Ii(n,s)}var p=e.memoizedState;if(p!==null){var w=p.dehydrated;if(xu(n),d)if(n.flags&256)n.flags&=-257,n=ag(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||Wa(e,n,a,!1),d=(a&e.childLanes)!==0,st||d){if(s=Ye,s!==null&&(w=$m(s,a),w!==0&&w!==p.retryLane))throw p.retryLane=w,ea(e,w),Mt(s,e,w),Iu;Ji(),n=ag(e,n,a)}else e=p.treeContext,Ge=dn(w.nextSibling),ht=n,ze=!0,pr=null,cn=!1,e!==null&&Kp(n,e),n=Ii(n,s),n.flags|=4096;return n}return e=Pn(e.child,{mode:s.mode,children:s.children}),e.ref=n.ref,n.child=e,e.return=n,e}function Pi(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 Pu(e,n,a,s,d){return aa(n),a=Su(e,n,a,s,void 0,d),s=Eu(),e!==null&&!st?(Cu(e,n,d),Gn(e,n,d)):(ze&&s&&au(n),n.flags|=1,vt(e,n,a,d),n.child)}function og(e,n,a,s,d,p){return aa(n),n.updateQueue=null,a=lh(n,s,a,d),ih(e),s=Eu(),e!==null&&!st?(Cu(e,n,p),Gn(e,n,p)):(ze&&s&&au(n),n.flags|=1,vt(e,n,a,p),n.child)}function sg(e,n,a,s,d){if(aa(n),n.stateNode===null){var p=La,w=a.contextType;typeof w=="object"&&w!==null&&(p=gt(w)),p=new a(s,p),n.memoizedState=p.state!==null&&p.state!==void 0?p.state:null,p.updater=Uu,n.stateNode=p,p._reactInternals=n,p=n.stateNode,p.props=s,p.state=n.memoizedState,p.refs={},hu(n),w=a.contextType,p.context=typeof w=="object"&&w!==null?gt(w):La,p.state=n.memoizedState,w=a.getDerivedStateFromProps,typeof w=="function"&&(Wu(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&&Uu.enqueueReplaceState(p,p.state,null),es(n,s,p,d),Jo(),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=ua(a,N);p.props=z;var Y=p.context,ne=a.contextType;w=La,typeof ne=="object"&&ne!==null&&(w=gt(ne));var se=a.getDerivedStateFromProps;ne=typeof se=="function"||typeof p.getSnapshotBeforeUpdate=="function",N=n.pendingProps!==N,ne||typeof p.UNSAFE_componentWillReceiveProps!="function"&&typeof p.componentWillReceiveProps!="function"||(N||Y!==w)&&Yh(n,p,s,w),vr=!1;var G=n.memoizedState;p.state=G,es(n,s,p,d),Jo(),Y=n.memoizedState,N||G!==Y||vr?(typeof se=="function"&&(Wu(n,a,se,s),Y=n.memoizedState),(z=vr||Fh(n,a,z,s,G,Y,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=Y),p.props=s,p.state=Y,p.context=w,s=z):(typeof p.componentDidMount=="function"&&(n.flags|=4194308),s=!1)}else{p=n.stateNode,gu(e,n),w=n.memoizedProps,ne=ua(a,w),p.props=ne,se=n.pendingProps,G=p.context,Y=a.contextType,z=La,typeof Y=="object"&&Y!==null&&(z=gt(Y)),N=a.getDerivedStateFromProps,(Y=typeof N=="function"||typeof p.getSnapshotBeforeUpdate=="function")||typeof p.UNSAFE_componentWillReceiveProps!="function"&&typeof p.componentWillReceiveProps!="function"||(w!==se||G!==z)&&Yh(n,p,s,z),vr=!1,G=n.memoizedState,p.state=G,es(n,s,p,d),Jo();var Q=n.memoizedState;w!==se||G!==Q||vr||e!==null&&e.dependencies!==null&&Ei(e.dependencies)?(typeof N=="function"&&(Wu(n,a,N,s),Q=n.memoizedState),(ne=vr||Fh(n,a,ne,s,G,Q,z)||e!==null&&e.dependencies!==null&&Ei(e.dependencies))?(Y||typeof p.UNSAFE_componentWillUpdate!="function"&&typeof p.componentWillUpdate!="function"||(typeof p.componentWillUpdate=="function"&&p.componentWillUpdate(s,Q,z),typeof p.UNSAFE_componentWillUpdate=="function"&&p.UNSAFE_componentWillUpdate(s,Q,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=Q),p.props=s,p.state=Q,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,Pi(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=la(n,e.child,null,d),n.child=la(n,null,a,d)):vt(e,n,a,d),n.memoizedState=p.state,e=n.child):e=Gn(e,n,d),e}function ig(e,n,a,s){return na(),n.flags|=256,vt(e,n,a,s),n.child}var Ku={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Fu(e){return{baseLanes:e,cachePool:Xp()}}function Yu(e,n,a){return e=e!==null?e.childLanes&~a:0,n&&(e|=Vt),e}function lg(e,n,a){var s=n.pendingProps,d=!1,p=(n.flags&128)!==0,w;if((w=p)||(w=e!==null&&e.memoizedState===null?!1:(tt.current&2)!==0),w&&(d=!0,n.flags&=-129),w=(n.flags&32)!==0,n.flags&=-33,e===null){if(ze){if(d?wr(n):xr(),(e=Ge)?(e=gv(e,cn),e=e!==null&&e.data!=="&"?e:null,e!==null&&(n.memoizedState={dehydrated:e,treeContext:mr!==null?{id:An,overflow:_n}:null,retryLane:536870912,hydrationErrors:null},a=qp(e),a.return=n,n.child=a,ht=n,Ge=null)):e=null,e===null)throw hr(n);return _d(e)?n.lanes=32:n.lanes=536870912,null}var N=s.children;return s=s.fallback,d?(xr(),d=n.mode,N=Ki({mode:"hidden",children:N},d),s=ta(s,d,a,null),N.return=n,s.return=n,N.sibling=s,n.child=N,s=n.child,s.memoizedState=Fu(a),s.childLanes=Yu(e,w,a),n.memoizedState=Ku,os(null,s)):(wr(n),Vu(n,N))}var z=e.memoizedState;if(z!==null&&(N=z.dehydrated,N!==null)){if(p)n.flags&256?(wr(n),n.flags&=-257,n=$u(e,n,a)):n.memoizedState!==null?(xr(),n.child=e.child,n.flags|=128,n=null):(xr(),N=s.fallback,d=n.mode,s=Ki({mode:"visible",children:s.children},d),N=ta(N,d,a,null),N.flags|=2,s.return=n,N.return=n,s.sibling=N,n.child=s,la(n,e.child,null,a),s=n.child,s.memoizedState=Fu(a),s.childLanes=Yu(e,w,a),n.memoizedState=Ku,n=os(null,s));else if(wr(n),_d(N)){if(w=N.nextSibling&&N.nextSibling.dataset,w)var Y=w.dgst;w=Y,s=Error(i(419)),s.stack="",s.digest=w,Vo({value:s,source:null,stack:null}),n=$u(e,n,a)}else if(st||Wa(e,n,a,!1),w=(a&e.childLanes)!==0,st||w){if(w=Ye,w!==null&&(s=$m(w,a),s!==0&&s!==z.retryLane))throw z.retryLane=s,ea(e,s),Mt(w,e,s),Iu;Ad(N)||Ji(),n=$u(e,n,a)}else Ad(N)?(n.flags|=192,n.child=e.child,n=null):(e=z.treeContext,Ge=dn(N.nextSibling),ht=n,ze=!0,pr=null,cn=!1,e!==null&&Kp(n,e),n=Vu(n,s.children),n.flags|=4096);return n}return d?(xr(),N=s.fallback,d=n.mode,z=e.child,Y=z.sibling,s=Pn(z,{mode:"hidden",children:s.children}),s.subtreeFlags=z.subtreeFlags&65011712,Y!==null?N=Pn(Y,N):(N=ta(N,d,a,null),N.flags|=2),N.return=n,s.return=n,s.sibling=N,n.child=s,os(null,s),s=n.child,N=e.child.memoizedState,N===null?N=Fu(a):(d=N.cachePool,d!==null?(z=at._currentValue,d=d.parent!==z?{parent:z,pool:z}:d):d=Xp(),N={baseLanes:N.baseLanes|a,cachePool:d}),s.memoizedState=N,s.childLanes=Yu(e,w,a),n.memoizedState=Ku,os(e.child,s)):(wr(n),a=e.child,e=a.sibling,a=Pn(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 Vu(e,n){return n=Ki({mode:"visible",children:n},e.mode),n.return=e,e.child=n}function Ki(e,n){return e=Pt(22,e,null,n),e.lanes=0,e}function $u(e,n,a){return la(n,e.child,null,a),e=Vu(n,n.pendingProps.children),e.flags|=2,n.memoizedState=null,e}function cg(e,n,a){e.lanes|=n;var s=e.alternate;s!==null&&(s.lanes|=n),cu(e.return,n,a)}function Gu(e,n,a,s,d,p){var w=e.memoizedState;w===null?e.memoizedState={isBackwards:n,rendering:null,renderingStartTime:0,last:s,tail:a,tailMode:d,treeForkCount:p}:(w.isBackwards=n,w.rendering=null,w.renderingStartTime=0,w.last=s,w.tail=a,w.tailMode=d,w.treeForkCount=p)}function ug(e,n,a){var s=n.pendingProps,d=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,re(tt,w),vt(e,n,s,a),s=ze?Yo:0,!N&&e!==null&&(e.flags&128)!==0)e:for(e=n.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&cg(e,a,n);else if(e.tag===19)cg(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(d){case"forwards":for(a=n.child,d=null;a!==null;)e=a.alternate,e!==null&&Oi(e)===null&&(d=a),a=a.sibling;a=d,a===null?(d=n.child,n.child=null):(d=a.sibling,a.sibling=null),Gu(n,!1,d,a,p,s);break;case"backwards":case"unstable_legacy-backwards":for(a=null,d=n.child,n.child=null;d!==null;){if(e=d.alternate,e!==null&&Oi(e)===null){n.child=d;break}e=d.sibling,d.sibling=a,a=d,d=e}Gu(n,!0,a,null,p,s);break;case"together":Gu(n,!1,null,null,void 0,s);break;default:n.memoizedState=null}return n.child}function Gn(e,n,a){if(e!==null&&(n.dependencies=e.dependencies),Er|=n.lanes,(a&n.childLanes)===0)if(e!==null){if(Wa(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=Pn(e,e.pendingProps),n.child=a,a.return=n;e.sibling!==null;)e=e.sibling,a=a.sibling=Pn(e,e.pendingProps),a.return=n;a.sibling=null}return n.child}function Xu(e,n){return(e.lanes&n)!==0?!0:(e=e.dependencies,!!(e!==null&&Ei(e)))}function Ek(e,n,a){switch(n.tag){case 3:le(n,n.stateNode.containerInfo),gr(n,at,e.memoizedState.cache),na();break;case 27:case 5:ue(n);break;case 4:le(n,n.stateNode.containerInfo);break;case 10:gr(n,n.type,n.memoizedProps.value);break;case 31:if(n.memoizedState!==null)return n.flags|=128,xu(n),null;break;case 13:var s=n.memoizedState;if(s!==null)return s.dehydrated!==null?(wr(n),n.flags|=128,null):(a&n.child.childLanes)!==0?lg(e,n,a):(wr(n),e=Gn(e,n,a),e!==null?e.sibling:null);wr(n);break;case 19:var d=(e.flags&128)!==0;if(s=(a&n.childLanes)!==0,s||(Wa(e,n,a,!1),s=(a&n.childLanes)!==0),d){if(s)return ug(e,n,a);n.flags|=128}if(d=n.memoizedState,d!==null&&(d.rendering=null,d.tail=null,d.lastEffect=null),re(tt,tt.current),s)break;return null;case 22:return n.lanes=0,ng(e,n,a,n.pendingProps);case 24:gr(n,at,e.memoizedState.cache)}return Gn(e,n,a)}function dg(e,n,a){if(e!==null)if(e.memoizedProps!==n.pendingProps)st=!0;else{if(!Xu(e,a)&&(n.flags&128)===0)return st=!1,Ek(e,n,a);st=(e.flags&131072)!==0}else st=!1,ze&&(n.flags&1048576)!==0&&Pp(n,Yo,n.index);switch(n.lanes=0,n.tag){case 16:e:{var s=n.pendingProps;if(e=sa(n.elementType),n.type=e,typeof e=="function")tu(e)?(s=ua(e,s),n.tag=1,n=sg(null,n,e,s,a)):(n.tag=0,n=Pu(null,n,e,s,a));else{if(e!=null){var d=e.$$typeof;if(d===A){n.tag=11,n=Jh(null,n,e,s,a);break e}else if(d===L){n.tag=14,n=eg(null,n,e,s,a);break e}}throw n=X(e)||e,Error(i(306,n,""))}}return n;case 0:return Pu(e,n,n.type,n.pendingProps,a);case 1:return s=n.type,d=ua(s,n.pendingProps),sg(e,n,s,d,a);case 3:e:{if(le(n,n.stateNode.containerInfo),e===null)throw Error(i(387));s=n.pendingProps;var p=n.memoizedState;d=p.element,gu(e,n),es(n,s,null,a);var w=n.memoizedState;if(s=w.cache,gr(n,at,s),s!==p.cache&&uu(n,[at],a,!0),Jo(),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=ig(e,n,s,a);break e}else if(s!==d){d=on(Error(i(424)),n),Vo(d),n=ig(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=dn(e.firstChild),ht=n,ze=!0,pr=null,cn=!0,a=nh(n,null,s,a),n.child=a;a;)a.flags=a.flags&-3|4096,a=a.sibling;else{if(na(),s===d){n=Gn(e,n,a);break e}vt(e,n,s,a)}n=n.child}return n;case 26:return Pi(e,n),e===null?(a=kv(n.type,null,n.pendingProps,null))?n.memoizedState=a:ze||(a=n.type,e=n.pendingProps,s=sl(me.current).createElement(a),s[pt]=n,s[_t]=e,yt(s,a,e),ut(s),n.stateNode=s):n.memoizedState=kv(n.type,e.memoizedProps,n.pendingProps,e.memoizedState),null;case 27:return ue(n),e===null&&ze&&(s=n.stateNode=bv(n.type,n.pendingProps,me.current),ht=n,cn=!0,d=Ge,Nr(n.type)?(Nd=d,Ge=dn(s.firstChild)):Ge=d),vt(e,n,n.pendingProps.children,a),Pi(e,n),e===null&&(n.flags|=4194304),n.child;case 5:return e===null&&ze&&((d=s=Ge)&&(s=e2(s,n.type,n.pendingProps,cn),s!==null?(n.stateNode=s,ht=n,Ge=dn(s.firstChild),cn=!1,d=!0):d=!1),d||hr(n)),ue(n),d=n.type,p=n.pendingProps,w=e!==null?e.memoizedProps:null,s=p.children,Ed(d,p)?s=null:w!==null&&Ed(d,w)&&(n.flags|=32),n.memoizedState!==null&&(d=Su(e,n,hk,null,null,a),ws._currentValue=d),Pi(e,n),vt(e,n,s,a),n.child;case 6:return e===null&&ze&&((e=a=Ge)&&(a=t2(a,n.pendingProps,cn),a!==null?(n.stateNode=a,ht=n,Ge=null,e=!0):e=!1),e||hr(n)),null;case 13:return lg(e,n,a);case 4:return le(n,n.stateNode.containerInfo),s=n.pendingProps,e===null?n.child=la(n,null,s,a):vt(e,n,s,a),n.child;case 11:return Jh(e,n,n.type,n.pendingProps,a);case 7:return vt(e,n,n.pendingProps,a),n.child;case 8:return vt(e,n,n.pendingProps.children,a),n.child;case 12:return vt(e,n,n.pendingProps.children,a),n.child;case 10:return s=n.pendingProps,gr(n,n.type,s.value),vt(e,n,s.children,a),n.child;case 9:return d=n.type._context,s=n.pendingProps.children,aa(n),d=gt(d),s=s(d),n.flags|=1,vt(e,n,s,a),n.child;case 14:return eg(e,n,n.type,n.pendingProps,a);case 15:return tg(e,n,n.type,n.pendingProps,a);case 19:return ug(e,n,a);case 31:return Sk(e,n,a);case 22:return ng(e,n,a,n.pendingProps);case 24:return aa(n),s=gt(at),e===null?(d=mu(),d===null&&(d=Ye,p=du(),d.pooledCache=p,p.refCount++,p!==null&&(d.pooledCacheLanes|=a),d=p),n.memoizedState={parent:s,cache:d},hu(n),gr(n,at,d)):((e.lanes&a)!==0&&(gu(e,n),es(n,null,null,a),Jo()),d=e.memoizedState,p=n.memoizedState,d.parent!==s?(d={parent:s,cache:s},n.memoizedState=d,n.lanes===0&&(n.memoizedState=n.updateQueue.baseState=d),gr(n,at,s)):(s=p.cache,gr(n,at,s),s!==d.cache&&uu(n,[at],a,!0))),vt(e,n,n.pendingProps.children,a),n.child;case 29:throw n.pendingProps}throw Error(i(156,n.tag))}function Xn(e){e.flags|=4}function Zu(e,n,a,s,d){if((n=(e.mode&32)!==0)&&(n=!1),n){if(e.flags|=16777216,(d&335544128)===d)if(e.stateNode.complete)e.flags|=8192;else if(Bg())e.flags|=8192;else throw ia=_i,pu}else e.flags&=-16777217}function fg(e,n){if(n.type!=="stylesheet"||(n.state.loading&4)!==0)e.flags&=-16777217;else if(e.flags|=16777216,!Av(n))if(Bg())e.flags|=8192;else throw ia=_i,pu}function Fi(e,n){n!==null&&(e.flags|=4),e.flags&16384&&(n=e.tag!==22?Fm():536870912,e.lanes|=n,Za|=n)}function ss(e,n){if(!ze)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 Xe(e){var n=e.alternate!==null&&e.alternate.child===e.child,a=0,s=0;if(n)for(var d=e.child;d!==null;)a|=d.lanes|d.childLanes,s|=d.subtreeFlags&65011712,s|=d.flags&65011712,d.return=e,d=d.sibling;else for(d=e.child;d!==null;)a|=d.lanes|d.childLanes,s|=d.subtreeFlags,s|=d.flags,d.return=e,d=d.sibling;return e.subtreeFlags|=s,e.childLanes=a,n}function Ck(e,n,a){var s=n.pendingProps;switch(ou(n),n.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Xe(n),null;case 1:return Xe(n),null;case 3:return a=n.stateNode,s=null,e!==null&&(s=e.memoizedState.cache),n.memoizedState.cache!==s&&(n.flags|=2048),Yn(at),ie(),a.pendingContext&&(a.context=a.pendingContext,a.pendingContext=null),(e===null||e.child===null)&&(Ba(n)?Xn(n):e===null||e.memoizedState.isDehydrated&&(n.flags&256)===0||(n.flags|=1024,iu())),Xe(n),null;case 26:var d=n.type,p=n.memoizedState;return e===null?(Xn(n),p!==null?(Xe(n),fg(n,p)):(Xe(n),Zu(n,d,null,s,a))):p?p!==e.memoizedState?(Xn(n),Xe(n),fg(n,p)):(Xe(n),n.flags&=-16777217):(e=e.memoizedProps,e!==s&&Xn(n),Xe(n),Zu(n,d,e,s,a)),null;case 27:if(pe(n),a=me.current,d=n.type,e!==null&&n.stateNode!=null)e.memoizedProps!==s&&Xn(n);else{if(!s){if(n.stateNode===null)throw Error(i(166));return Xe(n),null}e=ae.current,Ba(n)?Fp(n):(e=bv(d,s,a),n.stateNode=e,Xn(n))}return Xe(n),null;case 5:if(pe(n),d=n.type,e!==null&&n.stateNode!=null)e.memoizedProps!==s&&Xn(n);else{if(!s){if(n.stateNode===null)throw Error(i(166));return Xe(n),null}if(p=ae.current,Ba(n))Fp(n);else{var w=sl(me.current);switch(p){case 1:p=w.createElementNS("http://www.w3.org/2000/svg",d);break;case 2:p=w.createElementNS("http://www.w3.org/1998/Math/MathML",d);break;default:switch(d){case"svg":p=w.createElementNS("http://www.w3.org/2000/svg",d);break;case"math":p=w.createElementNS("http://www.w3.org/1998/Math/MathML",d);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(d,{is:s.is}):w.createElement(d)}}p[pt]=n,p[_t]=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(yt(p,d,s),d){case"button":case"input":case"select":case"textarea":s=!!s.autoFocus;break e;case"img":s=!0;break e;default:s=!1}s&&Xn(n)}}return Xe(n),Zu(n,n.type,e===null?null:e.memoizedProps,n.pendingProps,a),null;case 6:if(e&&n.stateNode!=null)e.memoizedProps!==s&&Xn(n);else{if(typeof s!="string"&&n.stateNode===null)throw Error(i(166));if(e=me.current,Ba(n)){if(e=n.stateNode,a=n.memoizedProps,s=null,d=ht,d!==null)switch(d.tag){case 27:case 5:s=d.memoizedProps}e[pt]=n,e=!!(e.nodeValue===a||s!==null&&s.suppressHydrationWarning===!0||lv(e.nodeValue,a)),e||hr(n,!0)}else e=sl(e).createTextNode(s),e[pt]=n,n.stateNode=e}return Xe(n),null;case 31:if(a=n.memoizedState,e===null||e.memoizedState!==null){if(s=Ba(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[pt]=n}else na(),(n.flags&128)===0&&(n.memoizedState=null),n.flags|=4;Xe(n),e=!1}else a=iu(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=a),e=!0;if(!e)return n.flags&256?(Ft(n),n):(Ft(n),null);if((n.flags&128)!==0)throw Error(i(558))}return Xe(n),null;case 13:if(s=n.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(d=Ba(n),s!==null&&s.dehydrated!==null){if(e===null){if(!d)throw Error(i(318));if(d=n.memoizedState,d=d!==null?d.dehydrated:null,!d)throw Error(i(317));d[pt]=n}else na(),(n.flags&128)===0&&(n.memoizedState=null),n.flags|=4;Xe(n),d=!1}else d=iu(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=d),d=!0;if(!d)return n.flags&256?(Ft(n),n):(Ft(n),null)}return Ft(n),(n.flags&128)!==0?(n.lanes=a,n):(a=s!==null,e=e!==null&&e.memoizedState!==null,a&&(s=n.child,d=null,s.alternate!==null&&s.alternate.memoizedState!==null&&s.alternate.memoizedState.cachePool!==null&&(d=s.alternate.memoizedState.cachePool.pool),p=null,s.memoizedState!==null&&s.memoizedState.cachePool!==null&&(p=s.memoizedState.cachePool.pool),p!==d&&(s.flags|=2048)),a!==e&&a&&(n.child.flags|=8192),Fi(n,n.updateQueue),Xe(n),null);case 4:return ie(),e===null&&bd(n.stateNode.containerInfo),Xe(n),null;case 10:return Yn(n.type),Xe(n),null;case 19:if(W(tt),s=n.memoizedState,s===null)return Xe(n),null;if(d=(n.flags&128)!==0,p=s.rendering,p===null)if(d)ss(s,!1);else{if(et!==0||e!==null&&(e.flags&128)!==0)for(e=n.child;e!==null;){if(p=Oi(e),p!==null){for(n.flags|=128,ss(s,!1),e=p.updateQueue,n.updateQueue=e,Fi(n,e),n.subtreeFlags=0,e=a,a=n.child;a!==null;)Up(a,e),a=a.sibling;return re(tt,tt.current&1|2),ze&&Kn(n,s.treeForkCount),n.child}e=e.sibling}s.tail!==null&&$e()>Xi&&(n.flags|=128,d=!0,ss(s,!1),n.lanes=4194304)}else{if(!d)if(e=Oi(p),e!==null){if(n.flags|=128,d=!0,e=e.updateQueue,n.updateQueue=e,Fi(n,e),ss(s,!0),s.tail===null&&s.tailMode==="hidden"&&!p.alternate&&!ze)return Xe(n),null}else 2*$e()-s.renderingStartTime>Xi&&a!==536870912&&(n.flags|=128,d=!0,ss(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=$e(),e.sibling=null,a=tt.current,re(tt,d?a&1|2:a&1),ze&&Kn(n,s.treeForkCount),e):(Xe(n),null);case 22:case 23:return Ft(n),wu(),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&&(Xe(n),n.subtreeFlags&6&&(n.flags|=8192)):Xe(n),a=n.updateQueue,a!==null&&Fi(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(oa),null;case 24:return a=null,e!==null&&(a=e.memoizedState.cache),n.memoizedState.cache!==a&&(n.flags|=2048),Yn(at),Xe(n),null;case 25:return null;case 30:return null}throw Error(i(156,n.tag))}function Tk(e,n){switch(ou(n),n.tag){case 1:return e=n.flags,e&65536?(n.flags=e&-65537|128,n):null;case 3:return Yn(at),ie(),e=n.flags,(e&65536)!==0&&(e&128)===0?(n.flags=e&-65537|128,n):null;case 26:case 27:case 5:return pe(n),null;case 31:if(n.memoizedState!==null){if(Ft(n),n.alternate===null)throw Error(i(340));na()}return e=n.flags,e&65536?(n.flags=e&-65537|128,n):null;case 13:if(Ft(n),e=n.memoizedState,e!==null&&e.dehydrated!==null){if(n.alternate===null)throw Error(i(340));na()}return e=n.flags,e&65536?(n.flags=e&-65537|128,n):null;case 19:return W(tt),null;case 4:return ie(),null;case 10:return Yn(n.type),null;case 22:case 23:return Ft(n),wu(),e!==null&&W(oa),e=n.flags,e&65536?(n.flags=e&-65537|128,n):null;case 24:return Yn(at),null;case 25:return null;default:return null}}function mg(e,n){switch(ou(n),n.tag){case 3:Yn(at),ie();break;case 26:case 27:case 5:pe(n);break;case 4:ie();break;case 31:n.memoizedState!==null&&Ft(n);break;case 13:Ft(n);break;case 19:W(tt);break;case 10:Yn(n.type);break;case 22:case 23:Ft(n),wu(),e!==null&&W(oa);break;case 24:Yn(at)}}function is(e,n){try{var a=n.updateQueue,s=a!==null?a.lastEffect:null;if(s!==null){var d=s.next;a=d;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!==d)}}catch(N){Ie(n,n.return,N)}}function kr(e,n,a){try{var s=n.updateQueue,d=s!==null?s.lastEffect:null;if(d!==null){var p=d.next;s=p;do{if((s.tag&e)===e){var w=s.inst,N=w.destroy;if(N!==void 0){w.destroy=void 0,d=n;var z=a,Y=N;try{Y()}catch(ne){Ie(d,z,ne)}}}s=s.next}while(s!==p)}}catch(ne){Ie(n,n.return,ne)}}function pg(e){var n=e.updateQueue;if(n!==null){var a=e.stateNode;try{ah(n,a)}catch(s){Ie(e,e.return,s)}}}function hg(e,n,a){a.props=ua(e.type,e.memoizedProps),a.state=e.memoizedState;try{a.componentWillUnmount()}catch(s){Ie(e,n,s)}}function ls(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(d){Ie(e,n,d)}}function Nn(e,n){var a=e.ref,s=e.refCleanup;if(a!==null)if(typeof s=="function")try{s()}catch(d){Ie(e,n,d)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof a=="function")try{a(null)}catch(d){Ie(e,n,d)}else a.current=null}function gg(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(d){Ie(e,e.return,d)}}function Qu(e,n,a){try{var s=e.stateNode;$k(s,e.type,a,n),s[_t]=n}catch(d){Ie(e,e.return,d)}}function vg(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&Nr(e.type)||e.tag===4}function Ju(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||vg(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&&Nr(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 ed(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=qn));else if(s!==4&&(s===27&&Nr(e.type)&&(a=e.stateNode,n=null),e=e.child,e!==null))for(ed(e,n,a),e=e.sibling;e!==null;)ed(e,n,a),e=e.sibling}function Yi(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&&Nr(e.type)&&(a=e.stateNode),e=e.child,e!==null))for(Yi(e,n,a),e=e.sibling;e!==null;)Yi(e,n,a),e=e.sibling}function yg(e){var n=e.stateNode,a=e.memoizedProps;try{for(var s=e.type,d=n.attributes;d.length;)n.removeAttributeNode(d[0]);yt(n,s,a),n[pt]=e,n[_t]=a}catch(p){Ie(e,e.return,p)}}var Zn=!1,it=!1,td=!1,bg=typeof WeakSet=="function"?WeakSet:Set,dt=null;function Ak(e,n){if(e=e.containerInfo,kd=ml,e=Rp(e),$c(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 d=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,Y=0,ne=0,se=e,G=null;t:for(;;){for(var Q;se!==a||d!==0&&se.nodeType!==3||(N=w+d),se!==p||s!==0&&se.nodeType!==3||(z=w+s),se.nodeType===3&&(w+=se.nodeValue.length),(Q=se.firstChild)!==null;)G=se,se=Q;for(;;){if(se===e)break t;if(G===a&&++Y===d&&(N=w),G===p&&++ne===s&&(z=w),(Q=se.nextSibling)!==null)break;se=G,G=se.parentNode}se=Q}a=N===-1||z===-1?null:{start:N,end:z}}else a=null}a=a||{start:0,end:0}}else a=null;for(Sd={focusedElem:e,selectionRange:a},ml=!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++)d=e[a],d.ref.impl=d.nextImpl;break;case 11:case 15:break;case 1:if((e&1024)!==0&&p!==null){e=void 0,a=n,d=p.memoizedProps,p=p.memoizedState,s=a.stateNode;try{var he=ua(a.type,d);e=s.getSnapshotBeforeUpdate(he,p),s.__reactInternalSnapshotBeforeUpdate=e}catch(Ee){Ie(a,a.return,Ee)}}break;case 3:if((e&1024)!==0){if(e=n.stateNode.containerInfo,a=e.nodeType,a===9)Td(e);else if(a===1)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":Td(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 wg(e,n,a){var s=a.flags;switch(a.tag){case 0:case 11:case 15:Jn(e,a),s&4&&is(5,a);break;case 1:if(Jn(e,a),s&4)if(e=a.stateNode,n===null)try{e.componentDidMount()}catch(w){Ie(a,a.return,w)}else{var d=ua(a.type,n.memoizedProps);n=n.memoizedState;try{e.componentDidUpdate(d,n,e.__reactInternalSnapshotBeforeUpdate)}catch(w){Ie(a,a.return,w)}}s&64&&pg(a),s&512&&ls(a,a.return);break;case 3:if(Jn(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{ah(e,n)}catch(w){Ie(a,a.return,w)}}break;case 27:n===null&&s&4&&yg(a);case 26:case 5:Jn(e,a),n===null&&s&4&&gg(a),s&512&&ls(a,a.return);break;case 12:Jn(e,a);break;case 31:Jn(e,a),s&4&&Sg(e,a);break;case 13:Jn(e,a),s&4&&Eg(e,a),s&64&&(e=a.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(a=zk.bind(null,a),n2(e,a))));break;case 22:if(s=a.memoizedState!==null||Zn,!s){n=n!==null&&n.memoizedState!==null||it,d=Zn;var p=it;Zn=s,(it=n)&&!p?er(e,a,(a.subtreeFlags&8772)!==0):Jn(e,a),Zn=d,it=p}break;case 30:break;default:Jn(e,a)}}function xg(e){var n=e.alternate;n!==null&&(e.alternate=null,xg(n)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(n=e.stateNode,n!==null&&Rc(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 Ze=null,jt=!1;function Qn(e,n,a){for(a=a.child;a!==null;)kg(e,n,a),a=a.sibling}function kg(e,n,a){if(Ut&&typeof Ut.onCommitFiberUnmount=="function")try{Ut.onCommitFiberUnmount(Oo,a)}catch{}switch(a.tag){case 26:it||Nn(a,n),Qn(e,n,a),a.memoizedState?a.memoizedState.count--:a.stateNode&&(a=a.stateNode,a.parentNode.removeChild(a));break;case 27:it||Nn(a,n);var s=Ze,d=jt;Nr(a.type)&&(Ze=a.stateNode,jt=!1),Qn(e,n,a),vs(a.stateNode),Ze=s,jt=d;break;case 5:it||Nn(a,n);case 6:if(s=Ze,d=jt,Ze=null,Qn(e,n,a),Ze=s,jt=d,Ze!==null)if(jt)try{(Ze.nodeType===9?Ze.body:Ze.nodeName==="HTML"?Ze.ownerDocument.body:Ze).removeChild(a.stateNode)}catch(p){Ie(a,n,p)}else try{Ze.removeChild(a.stateNode)}catch(p){Ie(a,n,p)}break;case 18:Ze!==null&&(jt?(e=Ze,pv(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,a.stateNode),oo(e)):pv(Ze,a.stateNode));break;case 4:s=Ze,d=jt,Ze=a.stateNode.containerInfo,jt=!0,Qn(e,n,a),Ze=s,jt=d;break;case 0:case 11:case 14:case 15:kr(2,a,n),it||kr(4,a,n),Qn(e,n,a);break;case 1:it||(Nn(a,n),s=a.stateNode,typeof s.componentWillUnmount=="function"&&hg(a,n,s)),Qn(e,n,a);break;case 21:Qn(e,n,a);break;case 22:it=(s=it)||a.memoizedState!==null,Qn(e,n,a),it=s;break;default:Qn(e,n,a)}}function Sg(e,n){if(n.memoizedState===null&&(e=n.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{oo(e)}catch(a){Ie(n,n.return,a)}}}function Eg(e,n){if(n.memoizedState===null&&(e=n.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{oo(e)}catch(a){Ie(n,n.return,a)}}function _k(e){switch(e.tag){case 31:case 13:case 19:var n=e.stateNode;return n===null&&(n=e.stateNode=new bg),n;case 22:return e=e.stateNode,n=e._retryCache,n===null&&(n=e._retryCache=new bg),n;default:throw Error(i(435,e.tag))}}function Vi(e,n){var a=_k(e);n.forEach(function(s){if(!a.has(s)){a.add(s);var d=Hk.bind(null,e,s);s.then(d,d)}})}function Rt(e,n){var a=n.deletions;if(a!==null)for(var s=0;s<a.length;s++){var d=a[s],p=e,w=n,N=w;e:for(;N!==null;){switch(N.tag){case 27:if(Nr(N.type)){Ze=N.stateNode,jt=!1;break e}break;case 5:Ze=N.stateNode,jt=!1;break e;case 3:case 4:Ze=N.stateNode.containerInfo,jt=!0;break e}N=N.return}if(Ze===null)throw Error(i(160));kg(p,w,d),Ze=null,jt=!1,p=d.alternate,p!==null&&(p.return=null),d.return=null}if(n.subtreeFlags&13886)for(n=n.child;n!==null;)Cg(n,e),n=n.sibling}var gn=null;function Cg(e,n){var a=e.alternate,s=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:Rt(n,e),Ot(e),s&4&&(kr(3,e,e.return),is(3,e),kr(5,e,e.return));break;case 1:Rt(n,e),Ot(e),s&512&&(it||a===null||Nn(a,a.return)),s&64&&Zn&&(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 d=gn;if(Rt(n,e),Ot(e),s&512&&(it||a===null||Nn(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,d=d.ownerDocument||d;t:switch(s){case"title":p=d.getElementsByTagName("title")[0],(!p||p[Lo]||p[pt]||p.namespaceURI==="http://www.w3.org/2000/svg"||p.hasAttribute("itemprop"))&&(p=d.createElement(s),d.head.insertBefore(p,d.querySelector("head > title"))),yt(p,s,a),p[pt]=e,ut(p),s=p;break e;case"link":var w=Cv("link","href",d).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=d.createElement(s),yt(p,s,a),d.head.appendChild(p);break;case"meta":if(w=Cv("meta","content",d).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=d.createElement(s),yt(p,s,a),d.head.appendChild(p);break;default:throw Error(i(468,s))}p[pt]=e,ut(p),s=p}e.stateNode=s}else Tv(d,e.type,e.stateNode);else e.stateNode=Ev(d,s,e.memoizedProps);else p!==s?(p===null?a.stateNode!==null&&(a=a.stateNode,a.parentNode.removeChild(a)):p.count--,s===null?Tv(d,e.type,e.stateNode):Ev(d,s,e.memoizedProps)):s===null&&e.stateNode!==null&&Qu(e,e.memoizedProps,a.memoizedProps)}break;case 27:Rt(n,e),Ot(e),s&512&&(it||a===null||Nn(a,a.return)),a!==null&&s&4&&Qu(e,e.memoizedProps,a.memoizedProps);break;case 5:if(Rt(n,e),Ot(e),s&512&&(it||a===null||Nn(a,a.return)),e.flags&32){d=e.stateNode;try{_a(d,"")}catch(he){Ie(e,e.return,he)}}s&4&&e.stateNode!=null&&(d=e.memoizedProps,Qu(e,d,a!==null?a.memoizedProps:d)),s&1024&&(td=!0);break;case 6:if(Rt(n,e),Ot(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(cl=null,d=gn,gn=il(n.containerInfo),Rt(n,e),gn=d,Ot(e),s&4&&a!==null&&a.memoizedState.isDehydrated)try{oo(n.containerInfo)}catch(he){Ie(e,e.return,he)}td&&(td=!1,Tg(e));break;case 4:s=gn,gn=il(e.stateNode.containerInfo),Rt(n,e),Ot(e),gn=s;break;case 12:Rt(n,e),Ot(e);break;case 31:Rt(n,e),Ot(e),s&4&&(s=e.updateQueue,s!==null&&(e.updateQueue=null,Vi(e,s)));break;case 13:Rt(n,e),Ot(e),e.child.flags&8192&&e.memoizedState!==null!=(a!==null&&a.memoizedState!==null)&&(Gi=$e()),s&4&&(s=e.updateQueue,s!==null&&(e.updateQueue=null,Vi(e,s)));break;case 22:d=e.memoizedState!==null;var z=a!==null&&a.memoizedState!==null,Y=Zn,ne=it;if(Zn=Y||d,it=ne||z,Rt(n,e),it=ne,Zn=Y,Ot(e),s&8192)e:for(n=e.stateNode,n._visibility=d?n._visibility&-2:n._visibility|1,d&&(a===null||z||Zn||it||da(e)),a=null,n=e;;){if(n.tag===5||n.tag===26){if(a===null){z=a=n;try{if(p=z.stateNode,d)w=p.style,typeof w.setProperty=="function"?w.setProperty("display","none","important"):w.display="none";else{N=z.stateNode;var se=z.memoizedProps.style,G=se!=null&&se.hasOwnProperty("display")?se.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=d?"":z.memoizedProps}catch(he){Ie(z,z.return,he)}}}else if(n.tag===18){if(a===null){z=n;try{var Q=z.stateNode;d?hv(Q,!0):hv(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,Vi(e,a))));break;case 19:Rt(n,e),Ot(e),s&4&&(s=e.updateQueue,s!==null&&(e.updateQueue=null,Vi(e,s)));break;case 30:break;case 21:break;default:Rt(n,e),Ot(e)}}function Ot(e){var n=e.flags;if(n&2){try{for(var a,s=e.return;s!==null;){if(vg(s)){a=s;break}s=s.return}if(a==null)throw Error(i(160));switch(a.tag){case 27:var d=a.stateNode,p=Ju(e);Yi(e,p,d);break;case 5:var w=a.stateNode;a.flags&32&&(_a(w,""),a.flags&=-33);var N=Ju(e);Yi(e,N,w);break;case 3:case 4:var z=a.stateNode.containerInfo,Y=Ju(e);ed(e,Y,z);break;default:throw Error(i(161))}}catch(ne){Ie(e,e.return,ne)}e.flags&=-3}n&4096&&(e.flags&=-4097)}function Tg(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var n=e;Tg(n),n.tag===5&&n.flags&1024&&n.stateNode.reset(),e=e.sibling}}function Jn(e,n){if(n.subtreeFlags&8772)for(n=n.child;n!==null;)wg(e,n.alternate,n),n=n.sibling}function da(e){for(e=e.child;e!==null;){var n=e;switch(n.tag){case 0:case 11:case 14:case 15:kr(4,n,n.return),da(n);break;case 1:Nn(n,n.return);var a=n.stateNode;typeof a.componentWillUnmount=="function"&&hg(n,n.return,a),da(n);break;case 27:vs(n.stateNode);case 26:case 5:Nn(n,n.return),da(n);break;case 22:n.memoizedState===null&&da(n);break;case 30:da(n);break;default:da(n)}e=e.sibling}}function er(e,n,a){for(a=a&&(n.subtreeFlags&8772)!==0,n=n.child;n!==null;){var s=n.alternate,d=e,p=n,w=p.flags;switch(p.tag){case 0:case 11:case 15:er(d,p,a),is(4,p);break;case 1:if(er(d,p,a),s=p,d=s.stateNode,typeof d.componentDidMount=="function")try{d.componentDidMount()}catch(Y){Ie(s,s.return,Y)}if(s=p,d=s.updateQueue,d!==null){var N=s.stateNode;try{var z=d.shared.hiddenCallbacks;if(z!==null)for(d.shared.hiddenCallbacks=null,d=0;d<z.length;d++)rh(z[d],N)}catch(Y){Ie(s,s.return,Y)}}a&&w&64&&pg(p),ls(p,p.return);break;case 27:yg(p);case 26:case 5:er(d,p,a),a&&s===null&&w&4&&gg(p),ls(p,p.return);break;case 12:er(d,p,a);break;case 31:er(d,p,a),a&&w&4&&Sg(d,p);break;case 13:er(d,p,a),a&&w&4&&Eg(d,p);break;case 22:p.memoizedState===null&&er(d,p,a),ls(p,p.return);break;case 30:break;default:er(d,p,a)}n=n.sibling}}function nd(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&&$o(a))}function rd(e,n){e=null,n.alternate!==null&&(e=n.alternate.memoizedState.cache),n=n.memoizedState.cache,n!==e&&(n.refCount++,e!=null&&$o(e))}function vn(e,n,a,s){if(n.subtreeFlags&10256)for(n=n.child;n!==null;)Ag(e,n,a,s),n=n.sibling}function Ag(e,n,a,s){var d=n.flags;switch(n.tag){case 0:case 11:case 15:vn(e,n,a,s),d&2048&&is(9,n);break;case 1:vn(e,n,a,s);break;case 3:vn(e,n,a,s),d&2048&&(e=null,n.alternate!==null&&(e=n.alternate.memoizedState.cache),n=n.memoizedState.cache,n!==e&&(n.refCount++,e!=null&&$o(e)));break;case 12:if(d&2048){vn(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 vn(e,n,a,s);break;case 31:vn(e,n,a,s);break;case 13:vn(e,n,a,s);break;case 23:break;case 22:p=n.stateNode,w=n.alternate,n.memoizedState!==null?p._visibility&2?vn(e,n,a,s):cs(e,n):p._visibility&2?vn(e,n,a,s):(p._visibility|=2,$a(e,n,a,s,(n.subtreeFlags&10256)!==0||!1)),d&2048&&nd(w,n);break;case 24:vn(e,n,a,s),d&2048&&rd(n.alternate,n);break;default:vn(e,n,a,s)}}function $a(e,n,a,s,d){for(d=d&&((n.subtreeFlags&10256)!==0||!1),n=n.child;n!==null;){var p=e,w=n,N=a,z=s,Y=w.flags;switch(w.tag){case 0:case 11:case 15:$a(p,w,N,z,d),is(8,w);break;case 23:break;case 22:var ne=w.stateNode;w.memoizedState!==null?ne._visibility&2?$a(p,w,N,z,d):cs(p,w):(ne._visibility|=2,$a(p,w,N,z,d)),d&&Y&2048&&nd(w.alternate,w);break;case 24:$a(p,w,N,z,d),d&&Y&2048&&rd(w.alternate,w);break;default:$a(p,w,N,z,d)}n=n.sibling}}function cs(e,n){if(n.subtreeFlags&10256)for(n=n.child;n!==null;){var a=e,s=n,d=s.flags;switch(s.tag){case 22:cs(a,s),d&2048&&nd(s.alternate,s);break;case 24:cs(a,s),d&2048&&rd(s.alternate,s);break;default:cs(a,s)}n=n.sibling}}var us=8192;function Ga(e,n,a){if(e.subtreeFlags&us)for(e=e.child;e!==null;)_g(e,n,a),e=e.sibling}function _g(e,n,a){switch(e.tag){case 26:Ga(e,n,a),e.flags&us&&e.memoizedState!==null&&p2(a,gn,e.memoizedState,e.memoizedProps);break;case 5:Ga(e,n,a);break;case 3:case 4:var s=gn;gn=il(e.stateNode.containerInfo),Ga(e,n,a),gn=s;break;case 22:e.memoizedState===null&&(s=e.alternate,s!==null&&s.memoizedState!==null?(s=us,us=16777216,Ga(e,n,a),us=s):Ga(e,n,a));break;default:Ga(e,n,a)}}function Ng(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 ds(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,Rg(s,e)}Ng(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)jg(e),e=e.sibling}function jg(e){switch(e.tag){case 0:case 11:case 15:ds(e),e.flags&2048&&kr(9,e,e.return);break;case 3:ds(e);break;case 12:ds(e);break;case 22:var n=e.stateNode;e.memoizedState!==null&&n._visibility&2&&(e.return===null||e.return.tag!==13)?(n._visibility&=-3,$i(e)):ds(e);break;default:ds(e)}}function $i(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,Rg(s,e)}Ng(e)}for(e=e.child;e!==null;){switch(n=e,n.tag){case 0:case 11:case 15:kr(8,n,n.return),$i(n);break;case 22:a=n.stateNode,a._visibility&2&&(a._visibility&=-3,$i(n));break;default:$i(n)}e=e.sibling}}function Rg(e,n){for(;dt!==null;){var a=dt;switch(a.tag){case 0:case 11:case 15:kr(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:$o(a.memoizedState.cache)}if(s=a.child,s!==null)s.return=a,dt=s;else e:for(a=e;dt!==null;){s=dt;var d=s.sibling,p=s.return;if(xg(s),s===a){dt=null;break e}if(d!==null){d.return=p,dt=d;break e}dt=p}}}var Nk={getCacheForType:function(e){var n=gt(at),a=n.data.get(e);return a===void 0&&(a=e(),n.data.set(e,a)),a},cacheSignal:function(){return gt(at).controller.signal}},jk=typeof WeakMap=="function"?WeakMap:Map,Ue=0,Ye=null,Oe=null,Me=0,qe=0,Yt=null,Sr=!1,Xa=!1,ad=!1,tr=0,et=0,Er=0,fa=0,od=0,Vt=0,Za=0,fs=null,Dt=null,sd=!1,Gi=0,Og=0,Xi=1/0,Zi=null,Cr=null,ct=0,Tr=null,Qa=null,nr=0,id=0,ld=null,Dg=null,ms=0,cd=null;function $t(){return(Ue&2)!==0&&Me!==0?Me&-Me:M.T!==null?hd():Gm()}function Mg(){if(Vt===0)if((Me&536870912)===0||ze){var e=oi;oi<<=1,(oi&3932160)===0&&(oi=262144),Vt=e}else Vt=536870912;return e=Kt.current,e!==null&&(e.flags|=32),Vt}function Mt(e,n,a){(e===Ye&&(qe===2||qe===9)||e.cancelPendingCommit!==null)&&(Ja(e,0),Ar(e,Me,Vt,!1)),Mo(e,a),((Ue&2)===0||e!==Ye)&&(e===Ye&&((Ue&2)===0&&(fa|=a),et===4&&Ar(e,Me,Vt,!1)),jn(e))}function Lg(e,n,a){if((Ue&6)!==0)throw Error(i(327));var s=!a&&(n&127)===0&&(n&e.expiredLanes)===0||Do(e,n),d=s?Dk(e,n):dd(e,n,!0),p=s;do{if(d===0){Xa&&!s&&Ar(e,n,0,!1);break}else{if(a=e.current.alternate,p&&!Rk(a)){d=dd(e,n,!1),p=!1;continue}if(d===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;d=fs;var z=N.current.memoizedState.isDehydrated;if(z&&(Ja(N,w).flags|=256),w=dd(N,w,!1),w!==2){if(ad&&!z){N.errorRecoveryDisabledLanes|=p,fa|=p,d=4;break e}p=Dt,Dt=d,p!==null&&(Dt===null?Dt=p:Dt.push.apply(Dt,p))}d=w}if(p=!1,d!==2)continue}}if(d===1){Ja(e,0),Ar(e,n,0,!0);break}e:{switch(s=e,p=d,p){case 0:case 1:throw Error(i(345));case 4:if((n&4194048)!==n)break;case 6:Ar(s,n,Vt,!Sr);break e;case 2:Dt=null;break;case 3:case 5:break;default:throw Error(i(329))}if((n&62914560)===n&&(d=Gi+300-$e(),10<d)){if(Ar(s,n,Vt,!Sr),ii(s,0,!0)!==0)break e;nr=n,s.timeoutHandle=fv(zg.bind(null,s,a,Dt,Zi,sd,n,Vt,fa,Za,Sr,p,"Throttled",-0,0),d);break e}zg(s,a,Dt,Zi,sd,n,Vt,fa,Za,Sr,p,null,-0,0)}}break}while(!0);jn(e)}function zg(e,n,a,s,d,p,w,N,z,Y,ne,se,G,Q){if(e.timeoutHandle=-1,se=n.subtreeFlags,se&8192||(se&16785408)===16785408){se={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:qn},_g(n,p,se);var he=(p&62914560)===p?Gi-$e():(p&4194048)===p?Og-$e():0;if(he=h2(se,he),he!==null){nr=p,e.cancelPendingCommit=he(Kg.bind(null,e,n,p,a,s,d,w,N,z,ne,se,null,G,Q)),Ar(e,p,w,!Y);return}}Kg(e,n,p,a,s,d,w,N,z)}function Rk(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 d=a[s],p=d.getSnapshot;d=d.value;try{if(!It(p(),d))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 Ar(e,n,a,s){n&=~od,n&=~fa,e.suspendedLanes|=n,e.pingedLanes&=~n,s&&(e.warmLanes|=n),s=e.expirationTimes;for(var d=n;0<d;){var p=31-qt(d),w=1<<p;s[p]=-1,d&=~w}a!==0&&Ym(e,a,n)}function Qi(){return(Ue&6)===0?(ps(0),!1):!0}function ud(){if(Oe!==null){if(qe===0)var e=Oe.return;else e=Oe,Fn=ra=null,Tu(e),Pa=null,Xo=0,e=Oe;for(;e!==null;)mg(e.alternate,e),e=e.return;Oe=null}}function Ja(e,n){var a=e.timeoutHandle;a!==-1&&(e.timeoutHandle=-1,Zk(a)),a=e.cancelPendingCommit,a!==null&&(e.cancelPendingCommit=null,a()),nr=0,ud(),Ye=e,Oe=a=Pn(e.current,null),Me=n,qe=0,Yt=null,Sr=!1,Xa=Do(e,n),ad=!1,Za=Vt=od=fa=Er=et=0,Dt=fs=null,sd=!1,(n&8)!==0&&(n|=n&32);var s=e.entangledLanes;if(s!==0)for(e=e.entanglements,s&=n;0<s;){var d=31-qt(s),p=1<<d;n|=e[d],s&=~p}return tr=n,bi(),a}function Hg(e,n){Ne=null,M.H=as,n===Ia||n===Ai?(n=Jp(),qe=3):n===pu?(n=Jp(),qe=4):qe=n===Iu?8:n!==null&&typeof n=="object"&&typeof n.then=="function"?6:1,Yt=n,Oe===null&&(et=1,qi(e,on(n,e.current)))}function Bg(){var e=Kt.current;return e===null?!0:(Me&4194048)===Me?un===null:(Me&62914560)===Me||(Me&536870912)!==0?e===un:!1}function Wg(){var e=M.H;return M.H=as,e===null?as:e}function Ug(){var e=M.A;return M.A=Nk,e}function Ji(){et=4,Sr||(Me&4194048)!==Me&&Kt.current!==null||(Xa=!0),(Er&134217727)===0&&(fa&134217727)===0||Ye===null||Ar(Ye,Me,Vt,!1)}function dd(e,n,a){var s=Ue;Ue|=2;var d=Wg(),p=Ug();(Ye!==e||Me!==n)&&(Zi=null,Ja(e,n)),n=!1;var w=et;e:do try{if(qe!==0&&Oe!==null){var N=Oe,z=Yt;switch(qe){case 8:ud(),w=6;break e;case 3:case 2:case 9:case 6:Kt.current===null&&(n=!0);var Y=qe;if(qe=0,Yt=null,eo(e,N,z,Y),a&&Xa){w=0;break e}break;default:Y=qe,qe=0,Yt=null,eo(e,N,z,Y)}}Ok(),w=et;break}catch(ne){Hg(e,ne)}while(!0);return n&&e.shellSuspendCounter++,Fn=ra=null,Ue=s,M.H=d,M.A=p,Oe===null&&(Ye=null,Me=0,bi()),w}function Ok(){for(;Oe!==null;)qg(Oe)}function Dk(e,n){var a=Ue;Ue|=2;var s=Wg(),d=Ug();Ye!==e||Me!==n?(Zi=null,Xi=$e()+500,Ja(e,n)):Xa=Do(e,n);e:do try{if(qe!==0&&Oe!==null){n=Oe;var p=Yt;t:switch(qe){case 1:qe=0,Yt=null,eo(e,n,p,1);break;case 2:case 9:if(Zp(p)){qe=0,Yt=null,Ig(n);break}n=function(){qe!==2&&qe!==9||Ye!==e||(qe=7),jn(e)},p.then(n,n);break e;case 3:qe=7;break e;case 4:qe=5;break e;case 7:Zp(p)?(qe=0,Yt=null,Ig(n)):(qe=0,Yt=null,eo(e,n,p,7));break;case 5:var w=null;switch(Oe.tag){case 26:w=Oe.memoizedState;case 5:case 27:var N=Oe;if(w?Av(w):N.stateNode.complete){qe=0,Yt=null;var z=N.sibling;if(z!==null)Oe=z;else{var Y=N.return;Y!==null?(Oe=Y,el(Y)):Oe=null}break t}}qe=0,Yt=null,eo(e,n,p,5);break;case 6:qe=0,Yt=null,eo(e,n,p,6);break;case 8:ud(),et=6;break e;default:throw Error(i(462))}}Mk();break}catch(ne){Hg(e,ne)}while(!0);return Fn=ra=null,M.H=s,M.A=d,Ue=a,Oe!==null?0:(Ye=null,Me=0,bi(),et)}function Mk(){for(;Oe!==null&&!de();)qg(Oe)}function qg(e){var n=dg(e.alternate,e,tr);e.memoizedProps=e.pendingProps,n===null?el(e):Oe=n}function Ig(e){var n=e,a=n.alternate;switch(n.tag){case 15:case 0:n=og(a,n,n.pendingProps,n.type,void 0,Me);break;case 11:n=og(a,n,n.pendingProps,n.type.render,n.ref,Me);break;case 5:Tu(n);default:mg(a,n),n=Oe=Up(n,tr),n=dg(a,n,tr)}e.memoizedProps=e.pendingProps,n===null?el(e):Oe=n}function eo(e,n,a,s){Fn=ra=null,Tu(n),Pa=null,Xo=0;var d=n.return;try{if(kk(e,d,n,a,Me)){et=1,qi(e,on(a,e.current)),Oe=null;return}}catch(p){if(d!==null)throw Oe=d,p;et=1,qi(e,on(a,e.current)),Oe=null;return}n.flags&32768?(ze||s===1?e=!0:Xa||(Me&536870912)!==0?e=!1:(Sr=e=!0,(s===2||s===9||s===3||s===6)&&(s=Kt.current,s!==null&&s.tag===13&&(s.flags|=16384))),Pg(n,e)):el(n)}function el(e){var n=e;do{if((n.flags&32768)!==0){Pg(n,Sr);return}e=n.return;var a=Ck(n.alternate,n,tr);if(a!==null){Oe=a;return}if(n=n.sibling,n!==null){Oe=n;return}Oe=n=e}while(n!==null);et===0&&(et=5)}function Pg(e,n){do{var a=Tk(e.alternate,e);if(a!==null){a.flags&=32767,Oe=a;return}if(a=e.return,a!==null&&(a.flags|=32768,a.subtreeFlags=0,a.deletions=null),!n&&(e=e.sibling,e!==null)){Oe=e;return}Oe=e=a}while(e!==null);et=6,Oe=null}function Kg(e,n,a,s,d,p,w,N,z){e.cancelPendingCommit=null;do tl();while(ct!==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|=Jc,m1(e,a,p,w,N,z),e===Ye&&(Oe=Ye=null,Me=0),Qa=n,Tr=e,nr=a,id=p,ld=d,Dg=s,(n.subtreeFlags&10256)!==0||(n.flags&10256)!==0?(e.callbackNode=null,e.callbackPriority=0,Bk(He,function(){return Gg(),null})):(e.callbackNode=null,e.callbackPriority=0),s=(n.flags&13878)!==0,(n.subtreeFlags&13878)!==0||s){s=M.T,M.T=null,d=I.p,I.p=2,w=Ue,Ue|=4;try{Ak(e,n,a)}finally{Ue=w,I.p=d,M.T=s}}ct=1,Fg(),Yg(),Vg()}}function Fg(){if(ct===1){ct=0;var e=Tr,n=Qa,a=(n.flags&13878)!==0;if((n.subtreeFlags&13878)!==0||a){a=M.T,M.T=null;var s=I.p;I.p=2;var d=Ue;Ue|=4;try{Cg(n,e);var p=Sd,w=Rp(e.containerInfo),N=p.focusedElem,z=p.selectionRange;if(w!==N&&N&&N.ownerDocument&&jp(N.ownerDocument.documentElement,N)){if(z!==null&&$c(N)){var Y=z.start,ne=z.end;if(ne===void 0&&(ne=Y),"selectionStart"in N)N.selectionStart=Y,N.selectionEnd=Math.min(ne,N.value.length);else{var se=N.ownerDocument||document,G=se&&se.defaultView||window;if(G.getSelection){var Q=G.getSelection(),he=N.textContent.length,Ee=Math.min(z.start,he),Fe=z.end===void 0?Ee:Math.min(z.end,he);!Q.extend&&Ee>Fe&&(w=Fe,Fe=Ee,Ee=w);var U=Np(N,Ee),H=Np(N,Fe);if(U&&H&&(Q.rangeCount!==1||Q.anchorNode!==U.node||Q.anchorOffset!==U.offset||Q.focusNode!==H.node||Q.focusOffset!==H.offset)){var F=se.createRange();F.setStart(U.node,U.offset),Q.removeAllRanges(),Ee>Fe?(Q.addRange(F),Q.extend(H.node,H.offset)):(F.setEnd(H.node,H.offset),Q.addRange(F))}}}}for(se=[],Q=N;Q=Q.parentNode;)Q.nodeType===1&&se.push({element:Q,left:Q.scrollLeft,top:Q.scrollTop});for(typeof N.focus=="function"&&N.focus(),N=0;N<se.length;N++){var oe=se[N];oe.element.scrollLeft=oe.left,oe.element.scrollTop=oe.top}}ml=!!kd,Sd=kd=null}finally{Ue=d,I.p=s,M.T=a}}e.current=n,ct=2}}function Yg(){if(ct===2){ct=0;var e=Tr,n=Qa,a=(n.flags&8772)!==0;if((n.subtreeFlags&8772)!==0||a){a=M.T,M.T=null;var s=I.p;I.p=2;var d=Ue;Ue|=4;try{wg(e,n.alternate,n)}finally{Ue=d,I.p=s,M.T=a}}ct=3}}function Vg(){if(ct===4||ct===3){ct=0,Te();var e=Tr,n=Qa,a=nr,s=Dg;(n.subtreeFlags&10256)!==0||(n.flags&10256)!==0?ct=5:(ct=0,Qa=Tr=null,$g(e,e.pendingLanes));var d=e.pendingLanes;if(d===0&&(Cr=null),Nc(a),n=n.stateNode,Ut&&typeof Ut.onCommitFiberRoot=="function")try{Ut.onCommitFiberRoot(Oo,n,void 0,(n.current.flags&128)===128)}catch{}if(s!==null){n=M.T,d=I.p,I.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,I.p=d}}(nr&3)!==0&&tl(),jn(e),d=e.pendingLanes,(a&261930)!==0&&(d&42)!==0?e===cd?ms++:(ms=0,cd=e):ms=0,ps(0)}}function $g(e,n){(e.pooledCacheLanes&=n)===0&&(n=e.pooledCache,n!=null&&(e.pooledCache=null,$o(n)))}function tl(){return Fg(),Yg(),Vg(),Gg()}function Gg(){if(ct!==5)return!1;var e=Tr,n=id;id=0;var a=Nc(nr),s=M.T,d=I.p;try{I.p=32>a?32:a,M.T=null,a=ld,ld=null;var p=Tr,w=nr;if(ct=0,Qa=Tr=null,nr=0,(Ue&6)!==0)throw Error(i(331));var N=Ue;if(Ue|=4,jg(p.current),Ag(p,p.current,w,a),Ue=N,ps(0,!1),Ut&&typeof Ut.onPostCommitFiberRoot=="function")try{Ut.onPostCommitFiberRoot(Oo,p)}catch{}return!0}finally{I.p=d,M.T=s,$g(e,n)}}function Xg(e,n,a){n=on(a,n),n=qu(e.stateNode,n,2),e=br(e,n,2),e!==null&&(Mo(e,2),jn(e))}function Ie(e,n,a){if(e.tag===3)Xg(e,e,a);else for(;n!==null;){if(n.tag===3){Xg(n,e,a);break}else if(n.tag===1){var s=n.stateNode;if(typeof n.type.getDerivedStateFromError=="function"||typeof s.componentDidCatch=="function"&&(Cr===null||!Cr.has(s))){e=on(a,e),a=Zh(2),s=br(n,a,2),s!==null&&(Qh(a,s,n,e),Mo(s,2),jn(s));break}}n=n.return}}function fd(e,n,a){var s=e.pingCache;if(s===null){s=e.pingCache=new jk;var d=new Set;s.set(n,d)}else d=s.get(n),d===void 0&&(d=new Set,s.set(n,d));d.has(a)||(ad=!0,d.add(a),e=Lk.bind(null,e,n,a),n.then(e,e))}function Lk(e,n,a){var s=e.pingCache;s!==null&&s.delete(n),e.pingedLanes|=e.suspendedLanes&a,e.warmLanes&=~a,Ye===e&&(Me&a)===a&&(et===4||et===3&&(Me&62914560)===Me&&300>$e()-Gi?(Ue&2)===0&&Ja(e,0):od|=a,Za===Me&&(Za=0)),jn(e)}function Zg(e,n){n===0&&(n=Fm()),e=ea(e,n),e!==null&&(Mo(e,n),jn(e))}function zk(e){var n=e.memoizedState,a=0;n!==null&&(a=n.retryLane),Zg(e,a)}function Hk(e,n){var a=0;switch(e.tag){case 31:case 13:var s=e.stateNode,d=e.memoizedState;d!==null&&(a=d.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),Zg(e,a)}function Bk(e,n){return Tn(e,n)}var nl=null,to=null,md=!1,rl=!1,pd=!1,_r=0;function jn(e){e!==to&&e.next===null&&(to===null?nl=to=e:to=to.next=e),rl=!0,md||(md=!0,Uk())}function ps(e,n){if(!pd&&rl){pd=!0;do for(var a=!1,s=nl;s!==null;){if(e!==0){var d=s.pendingLanes;if(d===0)var p=0;else{var w=s.suspendedLanes,N=s.pingedLanes;p=(1<<31-qt(42|e)+1)-1,p&=d&~(w&~N),p=p&201326741?p&201326741|1:p?p|2:0}p!==0&&(a=!0,tv(s,p))}else p=Me,p=ii(s,s===Ye?p:0,s.cancelPendingCommit!==null||s.timeoutHandle!==-1),(p&3)===0||Do(s,p)||(a=!0,tv(s,p));s=s.next}while(a);pd=!1}}function Wk(){Qg()}function Qg(){rl=md=!1;var e=0;_r!==0&&Xk()&&(e=_r);for(var n=$e(),a=null,s=nl;s!==null;){var d=s.next,p=Jg(s,n);p===0?(s.next=null,a===null?nl=d:a.next=d,d===null&&(to=a)):(a=s,(e!==0||(p&3)!==0)&&(rl=!0)),s=d}ct!==0&&ct!==5||ps(e),_r!==0&&(_r=0)}function Jg(e,n){for(var a=e.suspendedLanes,s=e.pingedLanes,d=e.expirationTimes,p=e.pendingLanes&-62914561;0<p;){var w=31-qt(p),N=1<<w,z=d[w];z===-1?((N&a)===0||(N&s)!==0)&&(d[w]=f1(N,n)):z<=n&&(e.expiredLanes|=N),p&=~N}if(n=Ye,a=Me,a=ii(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&&tn(s),e.callbackNode=null,e.callbackPriority=0;if((a&3)===0||Do(e,a)){if(n=a&-a,n===e.callbackPriority)return n;switch(s!==null&&tn(s),Nc(a)){case 2:case 8:a=xe;break;case 32:a=He;break;case 268435456:a=$r;break;default:a=He}return s=ev.bind(null,e),a=Tn(a,s),e.callbackPriority=n,e.callbackNode=a,n}return s!==null&&s!==null&&tn(s),e.callbackPriority=2,e.callbackNode=null,2}function ev(e,n){if(ct!==0&&ct!==5)return e.callbackNode=null,e.callbackPriority=0,null;var a=e.callbackNode;if(tl()&&e.callbackNode!==a)return null;var s=Me;return s=ii(e,e===Ye?s:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),s===0?null:(Lg(e,s,n),Jg(e,$e()),e.callbackNode!=null&&e.callbackNode===a?ev.bind(null,e):null)}function tv(e,n){if(tl())return null;Lg(e,n,!0)}function Uk(){Qk(function(){(Ue&6)!==0?Tn(Ro,Wk):Qg()})}function hd(){if(_r===0){var e=Ua;e===0&&(e=ai,ai<<=1,(ai&261888)===0&&(ai=256)),_r=e}return _r}function nv(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:di(""+e)}function rv(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 qk(e,n,a,s,d){if(n==="submit"&&a&&a.stateNode===d){var p=nv((d[_t]||null).action),w=s.submitter;w&&(n=(n=w[_t]||null)?nv(n.formAction):w.getAttribute("formAction"),n!==null&&(p=n,w=null));var N=new hi("action","action",null,s,d);e.push({event:N,listeners:[{instance:null,listener:function(){if(s.defaultPrevented){if(_r!==0){var z=w?rv(d,w):new FormData(d);Lu(a,{pending:!0,data:z,method:d.method,action:p},null,z)}}else typeof p=="function"&&(N.preventDefault(),z=w?rv(d,w):new FormData(d),Lu(a,{pending:!0,data:z,method:d.method,action:p},p,z))},currentTarget:d}]})}}for(var gd=0;gd<Qc.length;gd++){var vd=Qc[gd],Ik=vd.toLowerCase(),Pk=vd[0].toUpperCase()+vd.slice(1);hn(Ik,"on"+Pk)}hn(Mp,"onAnimationEnd"),hn(Lp,"onAnimationIteration"),hn(zp,"onAnimationStart"),hn("dblclick","onDoubleClick"),hn("focusin","onFocus"),hn("focusout","onBlur"),hn(ok,"onTransitionRun"),hn(sk,"onTransitionStart"),hn(ik,"onTransitionCancel"),hn(Hp,"onTransitionEnd"),Ta("onMouseEnter",["mouseout","mouseover"]),Ta("onMouseLeave",["mouseout","mouseover"]),Ta("onPointerEnter",["pointerout","pointerover"]),Ta("onPointerLeave",["pointerout","pointerover"]),Xr("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Xr("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Xr("onBeforeInput",["compositionend","keypress","textInput","paste"]),Xr("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Xr("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Xr("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var hs="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(" "),Kk=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(hs));function av(e,n){n=(n&4)!==0;for(var a=0;a<e.length;a++){var s=e[a],d=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,Y=N.currentTarget;if(N=N.listener,z!==p&&d.isPropagationStopped())break e;p=N,d.currentTarget=Y;try{p(d)}catch(ne){yi(ne)}d.currentTarget=null,p=z}else for(w=0;w<s.length;w++){if(N=s[w],z=N.instance,Y=N.currentTarget,N=N.listener,z!==p&&d.isPropagationStopped())break e;p=N,d.currentTarget=Y;try{p(d)}catch(ne){yi(ne)}d.currentTarget=null,p=z}}}}function De(e,n){var a=n[jc];a===void 0&&(a=n[jc]=new Set);var s=e+"__bubble";a.has(s)||(ov(n,e,2,!1),a.add(s))}function yd(e,n,a){var s=0;n&&(s|=4),ov(a,e,s,n)}var al="_reactListening"+Math.random().toString(36).slice(2);function bd(e){if(!e[al]){e[al]=!0,Qm.forEach(function(a){a!=="selectionchange"&&(Kk.has(a)||yd(a,!1,e),yd(a,!0,e))});var n=e.nodeType===9?e:e.ownerDocument;n===null||n[al]||(n[al]=!0,yd("selectionchange",!1,n))}}function ov(e,n,a,s){switch(Mv(n)){case 2:var d=y2;break;case 8:d=b2;break;default:d=Md}a=d.bind(null,n,a,e),d=void 0,!Wc||n!=="touchstart"&&n!=="touchmove"&&n!=="wheel"||(d=!0),s?d!==void 0?e.addEventListener(n,a,{capture:!0,passive:d}):e.addEventListener(n,a,!0):d!==void 0?e.addEventListener(n,a,{passive:d}):e.addEventListener(n,a,!1)}function wd(e,n,a,s,d){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===d)break;if(w===4)for(w=s.return;w!==null;){var z=w.tag;if((z===3||z===4)&&w.stateNode.containerInfo===d)return;w=w.return}for(;N!==null;){if(w=Sa(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}up(function(){var Y=p,ne=Hc(a),se=[];e:{var G=Bp.get(e);if(G!==void 0){var Q=hi,he=e;switch(e){case"keypress":if(mi(a)===0)break e;case"keydown":case"keyup":Q=H1;break;case"focusin":he="focus",Q=Pc;break;case"focusout":he="blur",Q=Pc;break;case"beforeblur":case"afterblur":Q=Pc;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":Q=mp;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":Q=C1;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":Q=U1;break;case Mp:case Lp:case zp:Q=_1;break;case Hp:Q=I1;break;case"scroll":case"scrollend":Q=S1;break;case"wheel":Q=K1;break;case"copy":case"cut":case"paste":Q=j1;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":Q=hp;break;case"toggle":case"beforetoggle":Q=Y1}var Ee=(n&4)!==0,Fe=!Ee&&(e==="scroll"||e==="scrollend"),U=Ee?G!==null?G+"Capture":null:G;Ee=[];for(var H=Y,F;H!==null;){var oe=H;if(F=oe.stateNode,oe=oe.tag,oe!==5&&oe!==26&&oe!==27||F===null||U===null||(oe=Ho(H,U),oe!=null&&Ee.push(gs(H,oe,F))),Fe)break;H=H.return}0<Ee.length&&(G=new Q(G,he,null,a,ne),se.push({event:G,listeners:Ee}))}}if((n&7)===0){e:{if(G=e==="mouseover"||e==="pointerover",Q=e==="mouseout"||e==="pointerout",G&&a!==zc&&(he=a.relatedTarget||a.fromElement)&&(Sa(he)||he[ka]))break e;if((Q||G)&&(G=ne.window===ne?ne:(G=ne.ownerDocument)?G.defaultView||G.parentWindow:window,Q?(he=a.relatedTarget||a.toElement,Q=Y,he=he?Sa(he):null,he!==null&&(Fe=c(he),Ee=he.tag,he!==Fe||Ee!==5&&Ee!==27&&Ee!==6)&&(he=null)):(Q=null,he=Y),Q!==he)){if(Ee=mp,oe="onMouseLeave",U="onMouseEnter",H="mouse",(e==="pointerout"||e==="pointerover")&&(Ee=hp,oe="onPointerLeave",U="onPointerEnter",H="pointer"),Fe=Q==null?G:zo(Q),F=he==null?G:zo(he),G=new Ee(oe,H+"leave",Q,a,ne),G.target=Fe,G.relatedTarget=F,oe=null,Sa(ne)===Y&&(Ee=new Ee(U,H+"enter",he,a,ne),Ee.target=F,Ee.relatedTarget=Fe,oe=Ee),Fe=oe,Q&&he)t:{for(Ee=Fk,U=Q,H=he,F=0,oe=U;oe;oe=Ee(oe))F++;oe=0;for(var we=H;we;we=Ee(we))oe++;for(;0<F-oe;)U=Ee(U),F--;for(;0<oe-F;)H=Ee(H),oe--;for(;F--;){if(U===H||H!==null&&U===H.alternate){Ee=U;break t}U=Ee(U),H=Ee(H)}Ee=null}else Ee=null;Q!==null&&sv(se,G,Q,Ee,!1),he!==null&&Fe!==null&&sv(se,Fe,he,Ee,!0)}}e:{if(G=Y?zo(Y):window,Q=G.nodeName&&G.nodeName.toLowerCase(),Q==="select"||Q==="input"&&G.type==="file")var Be=Sp;else if(xp(G))if(Ep)Be=nk;else{Be=ek;var ye=J1}else Q=G.nodeName,!Q||Q.toLowerCase()!=="input"||G.type!=="checkbox"&&G.type!=="radio"?Y&&Lc(Y.elementType)&&(Be=Sp):Be=tk;if(Be&&(Be=Be(e,Y))){kp(se,Be,a,ne);break e}ye&&ye(e,G,Y),e==="focusout"&&Y&&G.type==="number"&&Y.memoizedProps.value!=null&&Mc(G,"number",G.value)}switch(ye=Y?zo(Y):window,e){case"focusin":(xp(ye)||ye.contentEditable==="true")&&(Oa=ye,Gc=Y,Fo=null);break;case"focusout":Fo=Gc=Oa=null;break;case"mousedown":Xc=!0;break;case"contextmenu":case"mouseup":case"dragend":Xc=!1,Op(se,a,ne);break;case"selectionchange":if(ak)break;case"keydown":case"keyup":Op(se,a,ne)}var Re;if(Fc)e:{switch(e){case"compositionstart":var Le="onCompositionStart";break e;case"compositionend":Le="onCompositionEnd";break e;case"compositionupdate":Le="onCompositionUpdate";break e}Le=void 0}else Ra?bp(e,a)&&(Le="onCompositionEnd"):e==="keydown"&&a.keyCode===229&&(Le="onCompositionStart");Le&&(gp&&a.locale!=="ko"&&(Ra||Le!=="onCompositionStart"?Le==="onCompositionEnd"&&Ra&&(Re=dp()):(fr=ne,Uc="value"in fr?fr.value:fr.textContent,Ra=!0)),ye=ol(Y,Le),0<ye.length&&(Le=new pp(Le,e,null,a,ne),se.push({event:Le,listeners:ye}),Re?Le.data=Re:(Re=wp(a),Re!==null&&(Le.data=Re)))),(Re=$1?G1(e,a):X1(e,a))&&(Le=ol(Y,"onBeforeInput"),0<Le.length&&(ye=new pp("onBeforeInput","beforeinput",null,a,ne),se.push({event:ye,listeners:Le}),ye.data=Re)),qk(se,e,Y,a,ne)}av(se,n)})}function gs(e,n,a){return{instance:e,listener:n,currentTarget:a}}function ol(e,n){for(var a=n+"Capture",s=[];e!==null;){var d=e,p=d.stateNode;if(d=d.tag,d!==5&&d!==26&&d!==27||p===null||(d=Ho(e,a),d!=null&&s.unshift(gs(e,d,p)),d=Ho(e,n),d!=null&&s.push(gs(e,d,p))),e.tag===3)return s;e=e.return}return[]}function Fk(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function sv(e,n,a,s,d){for(var p=n._reactName,w=[];a!==null&&a!==s;){var N=a,z=N.alternate,Y=N.stateNode;if(N=N.tag,z!==null&&z===s)break;N!==5&&N!==26&&N!==27||Y===null||(z=Y,d?(Y=Ho(a,p),Y!=null&&w.unshift(gs(a,Y,z))):d||(Y=Ho(a,p),Y!=null&&w.push(gs(a,Y,z)))),a=a.return}w.length!==0&&e.push({event:n,listeners:w})}var Yk=/\r\n?/g,Vk=/\u0000|\uFFFD/g;function iv(e){return(typeof e=="string"?e:""+e).replace(Yk,`
10
+ `).replace(Vk,"")}function lv(e,n){return n=iv(n),iv(e)===n}function Ke(e,n,a,s,d,p){switch(a){case"children":typeof s=="string"?n==="body"||n==="textarea"&&s===""||_a(e,s):(typeof s=="number"||typeof s=="bigint")&&n!=="body"&&_a(e,""+s);break;case"className":ci(e,"class",s);break;case"tabIndex":ci(e,"tabindex",s);break;case"dir":case"role":case"viewBox":case"width":case"height":ci(e,a,s);break;case"style":lp(e,s,p);break;case"data":if(n!=="object"){ci(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=di(""+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",d.name,d,null),Ke(e,n,"formEncType",d.formEncType,d,null),Ke(e,n,"formMethod",d.formMethod,d,null),Ke(e,n,"formTarget",d.formTarget,d,null)):(Ke(e,n,"encType",d.encType,d,null),Ke(e,n,"method",d.method,d,null),Ke(e,n,"target",d.target,d,null)));if(s==null||typeof s=="symbol"||typeof s=="boolean"){e.removeAttribute(a);break}s=di(""+s),e.setAttribute(a,s);break;case"onClick":s!=null&&(e.onclick=qn);break;case"onScroll":s!=null&&De("scroll",e);break;case"onScrollEnd":s!=null&&De("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(d.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=di(""+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":De("beforetoggle",e),De("toggle",e),li(e,"popover",s);break;case"xlinkActuate":Un(e,"http://www.w3.org/1999/xlink","xlink:actuate",s);break;case"xlinkArcrole":Un(e,"http://www.w3.org/1999/xlink","xlink:arcrole",s);break;case"xlinkRole":Un(e,"http://www.w3.org/1999/xlink","xlink:role",s);break;case"xlinkShow":Un(e,"http://www.w3.org/1999/xlink","xlink:show",s);break;case"xlinkTitle":Un(e,"http://www.w3.org/1999/xlink","xlink:title",s);break;case"xlinkType":Un(e,"http://www.w3.org/1999/xlink","xlink:type",s);break;case"xmlBase":Un(e,"http://www.w3.org/XML/1998/namespace","xml:base",s);break;case"xmlLang":Un(e,"http://www.w3.org/XML/1998/namespace","xml:lang",s);break;case"xmlSpace":Un(e,"http://www.w3.org/XML/1998/namespace","xml:space",s);break;case"is":li(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=x1.get(a)||a,li(e,a,s))}}function xd(e,n,a,s,d,p){switch(a){case"style":lp(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(d.children!=null)throw Error(i(60));e.innerHTML=a}}break;case"children":typeof s=="string"?_a(e,s):(typeof s=="number"||typeof s=="bigint")&&_a(e,""+s);break;case"onScroll":s!=null&&De("scroll",e);break;case"onScrollEnd":s!=null&&De("scrollend",e);break;case"onClick":s!=null&&(e.onclick=qn);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!Jm.hasOwnProperty(a))e:{if(a[0]==="o"&&a[1]==="n"&&(d=a.endsWith("Capture"),n=a.slice(2,d?a.length-7:void 0),p=e[_t]||null,p=p!=null?p[a]:null,typeof p=="function"&&e.removeEventListener(n,p,d),typeof s=="function")){typeof p!="function"&&p!==null&&(a in e?e[a]=null:e.hasAttribute(a)&&e.removeAttribute(a)),e.addEventListener(n,s,d);break e}a in e?e[a]=s:s===!0?e.setAttribute(a,""):li(e,a,s)}}}function yt(e,n,a){switch(n){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":De("error",e),De("load",e);var s=!1,d=!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":d=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(i(137,n));default:Ke(e,n,p,w,a,null)}}d&&Ke(e,n,"srcSet",a.srcSet,a,null),s&&Ke(e,n,"src",a.src,a,null);return;case"input":De("invalid",e);var N=p=w=d=null,z=null,Y=null;for(s in a)if(a.hasOwnProperty(s)){var ne=a[s];if(ne!=null)switch(s){case"name":d=ne;break;case"type":w=ne;break;case"checked":z=ne;break;case"defaultChecked":Y=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)}}ap(e,p,N,z,Y,w,d,!1);return;case"select":De("invalid",e),s=w=p=null;for(d in a)if(a.hasOwnProperty(d)&&(N=a[d],N!=null))switch(d){case"value":p=N;break;case"defaultValue":w=N;break;case"multiple":s=N;default:Ke(e,n,d,N,a,null)}n=p,a=w,e.multiple=!!s,n!=null?Aa(e,!!s,n,!1):a!=null&&Aa(e,!!s,a,!0);return;case"textarea":De("invalid",e),p=d=s=null;for(w in a)if(a.hasOwnProperty(w)&&(N=a[w],N!=null))switch(w){case"value":s=N;break;case"defaultValue":d=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)}sp(e,s,d,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":De("beforetoggle",e),De("toggle",e),De("cancel",e),De("close",e);break;case"iframe":case"object":De("load",e);break;case"video":case"audio":for(s=0;s<hs.length;s++)De(hs[s],e);break;case"image":De("error",e),De("load",e);break;case"details":De("toggle",e);break;case"embed":case"source":case"link":De("error",e),De("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(Y in a)if(a.hasOwnProperty(Y)&&(s=a[Y],s!=null))switch(Y){case"children":case"dangerouslySetInnerHTML":throw Error(i(137,n));default:Ke(e,n,Y,s,a,null)}return;default:if(Lc(n)){for(ne in a)a.hasOwnProperty(ne)&&(s=a[ne],s!==void 0&&xd(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 $k(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 d=null,p=null,w=null,N=null,z=null,Y=null,ne=null;for(Q in a){var se=a[Q];if(a.hasOwnProperty(Q)&&se!=null)switch(Q){case"checked":break;case"value":break;case"defaultValue":z=se;default:s.hasOwnProperty(Q)||Ke(e,n,Q,null,s,se)}}for(var G in s){var Q=s[G];if(se=a[G],s.hasOwnProperty(G)&&(Q!=null||se!=null))switch(G){case"type":p=Q;break;case"name":d=Q;break;case"checked":Y=Q;break;case"defaultChecked":ne=Q;break;case"value":w=Q;break;case"defaultValue":N=Q;break;case"children":case"dangerouslySetInnerHTML":if(Q!=null)throw Error(i(137,n));break;default:Q!==se&&Ke(e,n,G,Q,s,se)}}Dc(e,w,N,z,Y,ne,p,d);return;case"select":Q=w=N=G=null;for(p in a)if(z=a[p],a.hasOwnProperty(p)&&z!=null)switch(p){case"value":break;case"multiple":Q=z;default:s.hasOwnProperty(p)||Ke(e,n,p,null,s,z)}for(d in s)if(p=s[d],z=a[d],s.hasOwnProperty(d)&&(p!=null||z!=null))switch(d){case"value":G=p;break;case"defaultValue":N=p;break;case"multiple":w=p;default:p!==z&&Ke(e,n,d,p,s,z)}n=N,a=w,s=Q,G!=null?Aa(e,!!a,G,!1):!!s!=!!a&&(n!=null?Aa(e,!!a,n,!0):Aa(e,!!a,a?[]:"",!1));return;case"textarea":Q=G=null;for(N in a)if(d=a[N],a.hasOwnProperty(N)&&d!=null&&!s.hasOwnProperty(N))switch(N){case"value":break;case"children":break;default:Ke(e,n,N,null,s,d)}for(w in s)if(d=s[w],p=a[w],s.hasOwnProperty(w)&&(d!=null||p!=null))switch(w){case"value":G=d;break;case"defaultValue":Q=d;break;case"children":break;case"dangerouslySetInnerHTML":if(d!=null)throw Error(i(91));break;default:d!==p&&Ke(e,n,w,d,s,p)}op(e,G,Q);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],Q=a[z],s.hasOwnProperty(z)&&G!==Q&&(G!=null||Q!=null)&&(z==="selected"?e.selected=G&&typeof G!="function"&&typeof G!="symbol":Ke(e,n,z,G,s,Q));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 Ee in a)G=a[Ee],a.hasOwnProperty(Ee)&&G!=null&&!s.hasOwnProperty(Ee)&&Ke(e,n,Ee,null,s,G);for(Y in s)if(G=s[Y],Q=a[Y],s.hasOwnProperty(Y)&&G!==Q&&(G!=null||Q!=null))switch(Y){case"children":case"dangerouslySetInnerHTML":if(G!=null)throw Error(i(137,n));break;default:Ke(e,n,Y,G,s,Q)}return;default:if(Lc(n)){for(var Fe in a)G=a[Fe],a.hasOwnProperty(Fe)&&G!==void 0&&!s.hasOwnProperty(Fe)&&xd(e,n,Fe,void 0,s,G);for(ne in s)G=s[ne],Q=a[ne],!s.hasOwnProperty(ne)||G===Q||G===void 0&&Q===void 0||xd(e,n,ne,G,s,Q);return}}for(var U in a)G=a[U],a.hasOwnProperty(U)&&G!=null&&!s.hasOwnProperty(U)&&Ke(e,n,U,null,s,G);for(se in s)G=s[se],Q=a[se],!s.hasOwnProperty(se)||G===Q||G==null&&Q==null||Ke(e,n,se,G,s,Q)}function cv(e){switch(e){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function Gk(){if(typeof performance.getEntriesByType=="function"){for(var e=0,n=0,a=performance.getEntriesByType("resource"),s=0;s<a.length;s++){var d=a[s],p=d.transferSize,w=d.initiatorType,N=d.duration;if(p&&N&&cv(w)){for(w=0,N=d.responseEnd,s+=1;s<a.length;s++){var z=a[s],Y=z.startTime;if(Y>N)break;var ne=z.transferSize,se=z.initiatorType;ne&&cv(se)&&(z=z.responseEnd,w+=ne*(z<N?1:(N-Y)/(z-Y)))}if(--s,n+=8*(p+w)/(d.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 kd=null,Sd=null;function sl(e){return e.nodeType===9?e:e.ownerDocument}function uv(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 dv(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 Ed(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 Cd=null;function Xk(){var e=window.event;return e&&e.type==="popstate"?e===Cd?!1:(Cd=e,!0):(Cd=null,!1)}var fv=typeof setTimeout=="function"?setTimeout:void 0,Zk=typeof clearTimeout=="function"?clearTimeout:void 0,mv=typeof Promise=="function"?Promise:void 0,Qk=typeof queueMicrotask=="function"?queueMicrotask:typeof mv<"u"?function(e){return mv.resolve(null).then(e).catch(Jk)}:fv;function Jk(e){setTimeout(function(){throw e})}function Nr(e){return e==="head"}function pv(e,n){var a=n,s=0;do{var d=a.nextSibling;if(e.removeChild(a),d&&d.nodeType===8)if(a=d.data,a==="/$"||a==="/&"){if(s===0){e.removeChild(d),oo(n);return}s--}else if(a==="$"||a==="$?"||a==="$~"||a==="$!"||a==="&")s++;else if(a==="html")vs(e.ownerDocument.documentElement);else if(a==="head"){a=e.ownerDocument.head,vs(a);for(var p=a.firstChild;p;){var w=p.nextSibling,N=p.nodeName;p[Lo]||N==="SCRIPT"||N==="STYLE"||N==="LINK"&&p.rel.toLowerCase()==="stylesheet"||a.removeChild(p),p=w}}else a==="body"&&vs(e.ownerDocument.body);a=d}while(a);oo(n)}function hv(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 Td(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":Td(a),Rc(a);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(a.rel.toLowerCase()==="stylesheet")continue}e.removeChild(a)}}function e2(e,n,a,s){for(;e.nodeType===1;){var d=a;if(e.nodeName.toLowerCase()!==n.toLowerCase()){if(!s&&(e.nodeName!=="INPUT"||e.type!=="hidden"))break}else if(s){if(!e[Lo])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!==d.rel||e.getAttribute("href")!==(d.href==null||d.href===""?null:d.href)||e.getAttribute("crossorigin")!==(d.crossOrigin==null?null:d.crossOrigin)||e.getAttribute("title")!==(d.title==null?null:d.title))break;return e;case"style":if(e.hasAttribute("data-precedence"))break;return e;case"script":if(p=e.getAttribute("src"),(p!==(d.src==null?null:d.src)||e.getAttribute("type")!==(d.type==null?null:d.type)||e.getAttribute("crossorigin")!==(d.crossOrigin==null?null:d.crossOrigin))&&p&&e.hasAttribute("async")&&!e.hasAttribute("itemprop"))break;return e;default:return e}}else if(n==="input"&&e.type==="hidden"){var p=d.name==null?null:""+d.name;if(d.type==="hidden"&&e.getAttribute("name")===p)return e}else return e;if(e=dn(e.nextSibling),e===null)break}return null}function t2(e,n,a){if(n==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!a||(e=dn(e.nextSibling),e===null))return null;return e}function gv(e,n){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!n||(e=dn(e.nextSibling),e===null))return null;return e}function Ad(e){return e.data==="$?"||e.data==="$~"}function _d(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState!=="loading"}function n2(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 dn(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 Nd=null;function vv(e){e=e.nextSibling;for(var n=0;e;){if(e.nodeType===8){var a=e.data;if(a==="/$"||a==="/&"){if(n===0)return dn(e.nextSibling);n--}else a!=="$"&&a!=="$!"&&a!=="$?"&&a!=="$~"&&a!=="&"||n++}e=e.nextSibling}return null}function yv(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 bv(e,n,a){switch(n=sl(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 vs(e){for(var n=e.attributes;n.length;)e.removeAttributeNode(n[0]);Rc(e)}var fn=new Map,wv=new Set;function il(e){return typeof e.getRootNode=="function"?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var rr=I.d;I.d={f:r2,r:a2,D:o2,C:s2,L:i2,m:l2,X:u2,S:c2,M:d2};function r2(){var e=rr.f(),n=Qi();return e||n}function a2(e){var n=Ea(e);n!==null&&n.tag===5&&n.type==="form"?Hh(n):rr.r(e)}var no=typeof document>"u"?null:document;function xv(e,n,a){var s=no;if(s&&typeof n=="string"&&n){var d=rn(n);d='link[rel="'+e+'"][href="'+d+'"]',typeof a=="string"&&(d+='[crossorigin="'+a+'"]'),wv.has(d)||(wv.add(d),e={rel:e,crossOrigin:a,href:n},s.querySelector(d)===null&&(n=s.createElement("link"),yt(n,"link",e),ut(n),s.head.appendChild(n)))}}function o2(e){rr.D(e),xv("dns-prefetch",e,null)}function s2(e,n){rr.C(e,n),xv("preconnect",e,n)}function i2(e,n,a){rr.L(e,n,a);var s=no;if(s&&e&&n){var d='link[rel="preload"][as="'+rn(n)+'"]';n==="image"&&a&&a.imageSrcSet?(d+='[imagesrcset="'+rn(a.imageSrcSet)+'"]',typeof a.imageSizes=="string"&&(d+='[imagesizes="'+rn(a.imageSizes)+'"]')):d+='[href="'+rn(e)+'"]';var p=d;switch(n){case"style":p=ro(e);break;case"script":p=ao(e)}fn.has(p)||(e=v({rel:"preload",href:n==="image"&&a&&a.imageSrcSet?void 0:e,as:n},a),fn.set(p,e),s.querySelector(d)!==null||n==="style"&&s.querySelector(ys(p))||n==="script"&&s.querySelector(bs(p))||(n=s.createElement("link"),yt(n,"link",e),ut(n),s.head.appendChild(n)))}}function l2(e,n){rr.m(e,n);var a=no;if(a&&e){var s=n&&typeof n.as=="string"?n.as:"script",d='link[rel="modulepreload"][as="'+rn(s)+'"][href="'+rn(e)+'"]',p=d;switch(s){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":p=ao(e)}if(!fn.has(p)&&(e=v({rel:"modulepreload",href:e},n),fn.set(p,e),a.querySelector(d)===null)){switch(s){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(a.querySelector(bs(p)))return}s=a.createElement("link"),yt(s,"link",e),ut(s),a.head.appendChild(s)}}}function c2(e,n,a){rr.S(e,n,a);var s=no;if(s&&e){var d=Ca(s).hoistableStyles,p=ro(e);n=n||"default";var w=d.get(p);if(!w){var N={loading:0,preload:null};if(w=s.querySelector(ys(p)))N.loading=5;else{e=v({rel:"stylesheet",href:e,"data-precedence":n},a),(a=fn.get(p))&&jd(e,a);var z=w=s.createElement("link");ut(z),yt(z,"link",e),z._p=new Promise(function(Y,ne){z.onload=Y,z.onerror=ne}),z.addEventListener("load",function(){N.loading|=1}),z.addEventListener("error",function(){N.loading|=2}),N.loading|=4,ll(w,n,s)}w={type:"stylesheet",instance:w,count:1,state:N},d.set(p,w)}}}function u2(e,n){rr.X(e,n);var a=no;if(a&&e){var s=Ca(a).hoistableScripts,d=ao(e),p=s.get(d);p||(p=a.querySelector(bs(d)),p||(e=v({src:e,async:!0},n),(n=fn.get(d))&&Rd(e,n),p=a.createElement("script"),ut(p),yt(p,"link",e),a.head.appendChild(p)),p={type:"script",instance:p,count:1,state:null},s.set(d,p))}}function d2(e,n){rr.M(e,n);var a=no;if(a&&e){var s=Ca(a).hoistableScripts,d=ao(e),p=s.get(d);p||(p=a.querySelector(bs(d)),p||(e=v({src:e,async:!0,type:"module"},n),(n=fn.get(d))&&Rd(e,n),p=a.createElement("script"),ut(p),yt(p,"link",e),a.head.appendChild(p)),p={type:"script",instance:p,count:1,state:null},s.set(d,p))}}function kv(e,n,a,s){var d=(d=me.current)?il(d):null;if(!d)throw Error(i(446));switch(e){case"meta":case"title":return null;case"style":return typeof a.precedence=="string"&&typeof a.href=="string"?(n=ro(a.href),a=Ca(d).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=ro(a.href);var p=Ca(d).hoistableStyles,w=p.get(e);if(w||(d=d.ownerDocument||d,w={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},p.set(e,w),(p=d.querySelector(ys(e)))&&!p._p&&(w.instance=p,w.state.loading=5),fn.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},fn.set(e,a),p||f2(d,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=ao(a),a=Ca(d).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 ro(e){return'href="'+rn(e)+'"'}function ys(e){return'link[rel="stylesheet"]['+e+"]"}function Sv(e){return v({},e,{"data-precedence":e.precedence,precedence:null})}function f2(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}),yt(n,"link",a),ut(n),e.head.appendChild(n))}function ao(e){return'[src="'+rn(e)+'"]'}function bs(e){return"script[async]"+e}function Ev(e,n,a){if(n.count++,n.instance===null)switch(n.type){case"style":var s=e.querySelector('style[data-href~="'+rn(a.href)+'"]');if(s)return n.instance=s,ut(s),s;var d=v({},a,{"data-href":a.href,"data-precedence":a.precedence,href:null,precedence:null});return s=(e.ownerDocument||e).createElement("style"),ut(s),yt(s,"style",d),ll(s,a.precedence,e),n.instance=s;case"stylesheet":d=ro(a.href);var p=e.querySelector(ys(d));if(p)return n.state.loading|=4,n.instance=p,ut(p),p;s=Sv(a),(d=fn.get(d))&&jd(s,d),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}),yt(p,"link",s),n.state.loading|=4,ll(p,a.precedence,e),n.instance=p;case"script":return p=ao(a.src),(d=e.querySelector(bs(p)))?(n.instance=d,ut(d),d):(s=a,(d=fn.get(p))&&(s=v({},a),Rd(s,d)),e=e.ownerDocument||e,d=e.createElement("script"),ut(d),yt(d,"link",s),e.head.appendChild(d),n.instance=d);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,ll(s,a.precedence,e));return n.instance}function ll(e,n,a){for(var s=a.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),d=s.length?s[s.length-1]:null,p=d,w=0;w<s.length;w++){var N=s[w];if(N.dataset.precedence===n)p=N;else if(p!==d)break}p?p.parentNode.insertBefore(e,p.nextSibling):(n=a.nodeType===9?a.head:a,n.insertBefore(e,n.firstChild))}function jd(e,n){e.crossOrigin==null&&(e.crossOrigin=n.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=n.referrerPolicy),e.title==null&&(e.title=n.title)}function Rd(e,n){e.crossOrigin==null&&(e.crossOrigin=n.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=n.referrerPolicy),e.integrity==null&&(e.integrity=n.integrity)}var cl=null;function Cv(e,n,a){if(cl===null){var s=new Map,d=cl=new Map;d.set(a,s)}else d=cl,s=d.get(a),s||(s=new Map,d.set(a,s));if(s.has(e))return s;for(s.set(e,null),a=a.getElementsByTagName(e),d=0;d<a.length;d++){var p=a[d];if(!(p[Lo]||p[pt]||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 Tv(e,n,a){e=e.ownerDocument||e,e.head.insertBefore(a,n==="title"?e.querySelector("head > title"):null)}function m2(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 Av(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function p2(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 d=ro(s.href),p=n.querySelector(ys(d));if(p){n=p._p,n!==null&&typeof n=="object"&&typeof n.then=="function"&&(e.count++,e=ul.bind(e),n.then(e,e)),a.state.loading|=4,a.instance=p,ut(p);return}p=n.ownerDocument||n,s=Sv(s),(d=fn.get(d))&&jd(s,d),p=p.createElement("link"),ut(p);var w=p;w._p=new Promise(function(N,z){w.onload=N,w.onerror=z}),yt(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=ul.bind(e),n.addEventListener("load",a),n.addEventListener("error",a))}}var Od=0;function h2(e,n){return e.stylesheets&&e.count===0&&fl(e,e.stylesheets),0<e.count||0<e.imgCount?function(a){var s=setTimeout(function(){if(e.stylesheets&&fl(e,e.stylesheets),e.unsuspend){var p=e.unsuspend;e.unsuspend=null,p()}},6e4+n);0<e.imgBytes&&Od===0&&(Od=62500*Gk());var d=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&fl(e,e.stylesheets),e.unsuspend)){var p=e.unsuspend;e.unsuspend=null,p()}},(e.imgBytes>Od?50:800)+n);return e.unsuspend=a,function(){e.unsuspend=null,clearTimeout(s),clearTimeout(d)}}:null}function ul(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)fl(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var dl=null;function fl(e,n){e.stylesheets=null,e.unsuspend!==null&&(e.count++,dl=new Map,n.forEach(g2,e),dl=null,ul.call(e))}function g2(e,n){if(!(n.state.loading&4)){var a=dl.get(e);if(a)var s=a.get(null);else{a=new Map,dl.set(e,a);for(var d=e.querySelectorAll("link[data-precedence],style[data-precedence]"),p=0;p<d.length;p++){var w=d[p];(w.nodeName==="LINK"||w.getAttribute("media")!=="not all")&&(a.set(w.dataset.precedence,w),s=w)}s&&a.set(null,s)}d=n.instance,w=d.getAttribute("data-precedence"),p=a.get(w)||s,p===s&&a.set(null,d),a.set(w,d),this.count++,s=ul.bind(this),d.addEventListener("load",s),d.addEventListener("error",s),p?p.parentNode.insertBefore(d,p.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(d,e.firstChild)),n.state.loading|=4}}var ws={$$typeof:j,Provider:null,Consumer:null,_currentValue:P,_currentValue2:P,_threadCount:0};function v2(e,n,a,s,d,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=Ac(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Ac(0),this.hiddenUpdates=Ac(null),this.identifierPrefix=s,this.onUncaughtError=d,this.onCaughtError=p,this.onRecoverableError=w,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=z,this.incompleteTransitions=new Map}function _v(e,n,a,s,d,p,w,N,z,Y,ne,se){return e=new v2(e,n,a,w,z,Y,ne,se,N),n=1,p===!0&&(n|=24),p=Pt(3,null,null,n),e.current=p,p.stateNode=e,n=du(),n.refCount++,e.pooledCache=n,n.refCount++,p.memoizedState={element:s,isDehydrated:a,cache:n},hu(p),e}function Nv(e){return e?(e=La,e):La}function jv(e,n,a,s,d,p){d=Nv(d),s.context===null?s.context=d:s.pendingContext=d,s=yr(n),s.payload={element:a},p=p===void 0?null:p,p!==null&&(s.callback=p),a=br(e,s,n),a!==null&&(Mt(a,e,n),Qo(a,e,n))}function Rv(e,n){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var a=e.retryLane;e.retryLane=a!==0&&a<n?a:n}}function Dd(e,n){Rv(e,n),(e=e.alternate)&&Rv(e,n)}function Ov(e){if(e.tag===13||e.tag===31){var n=ea(e,67108864);n!==null&&Mt(n,e,67108864),Dd(e,67108864)}}function Dv(e){if(e.tag===13||e.tag===31){var n=$t();n=_c(n);var a=ea(e,n);a!==null&&Mt(a,e,n),Dd(e,n)}}var ml=!0;function y2(e,n,a,s){var d=M.T;M.T=null;var p=I.p;try{I.p=2,Md(e,n,a,s)}finally{I.p=p,M.T=d}}function b2(e,n,a,s){var d=M.T;M.T=null;var p=I.p;try{I.p=8,Md(e,n,a,s)}finally{I.p=p,M.T=d}}function Md(e,n,a,s){if(ml){var d=Ld(s);if(d===null)wd(e,n,s,pl,a),Lv(e,s);else if(x2(d,e,n,a,s))s.stopPropagation();else if(Lv(e,s),n&4&&-1<w2.indexOf(e)){for(;d!==null;){var p=Ea(d);if(p!==null)switch(p.tag){case 3:if(p=p.stateNode,p.current.memoizedState.isDehydrated){var w=Gr(p.pendingLanes);if(w!==0){var N=p;for(N.pendingLanes|=2,N.entangledLanes|=2;w;){var z=1<<31-qt(w);N.entanglements[1]|=z,w&=~z}jn(p),(Ue&6)===0&&(Xi=$e()+500,ps(0))}}break;case 31:case 13:N=ea(p,2),N!==null&&Mt(N,p,2),Qi(),Dd(p,2)}if(p=Ld(s),p===null&&wd(e,n,s,pl,a),p===d)break;d=p}d!==null&&s.stopPropagation()}else wd(e,n,s,null,a)}}function Ld(e){return e=Hc(e),zd(e)}var pl=null;function zd(e){if(pl=null,e=Sa(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 pl=e,null}function Mv(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(Vr()){case Ro:return 2;case xe:return 8;case He:case mt:return 32;case $r:return 268435456;default:return 32}default:return 32}}var Hd=!1,jr=null,Rr=null,Or=null,xs=new Map,ks=new Map,Dr=[],w2="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 Lv(e,n){switch(e){case"focusin":case"focusout":jr=null;break;case"dragenter":case"dragleave":Rr=null;break;case"mouseover":case"mouseout":Or=null;break;case"pointerover":case"pointerout":xs.delete(n.pointerId);break;case"gotpointercapture":case"lostpointercapture":ks.delete(n.pointerId)}}function Ss(e,n,a,s,d,p){return e===null||e.nativeEvent!==p?(e={blockedOn:n,domEventName:a,eventSystemFlags:s,nativeEvent:p,targetContainers:[d]},n!==null&&(n=Ea(n),n!==null&&Ov(n)),e):(e.eventSystemFlags|=s,n=e.targetContainers,d!==null&&n.indexOf(d)===-1&&n.push(d),e)}function x2(e,n,a,s,d){switch(n){case"focusin":return jr=Ss(jr,e,n,a,s,d),!0;case"dragenter":return Rr=Ss(Rr,e,n,a,s,d),!0;case"mouseover":return Or=Ss(Or,e,n,a,s,d),!0;case"pointerover":var p=d.pointerId;return xs.set(p,Ss(xs.get(p)||null,e,n,a,s,d)),!0;case"gotpointercapture":return p=d.pointerId,ks.set(p,Ss(ks.get(p)||null,e,n,a,s,d)),!0}return!1}function zv(e){var n=Sa(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,Xm(e.priority,function(){Dv(a)});return}}else if(n===31){if(n=h(a),n!==null){e.blockedOn=n,Xm(e.priority,function(){Dv(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 hl(e){if(e.blockedOn!==null)return!1;for(var n=e.targetContainers;0<n.length;){var a=Ld(e.nativeEvent);if(a===null){a=e.nativeEvent;var s=new a.constructor(a.type,a);zc=s,a.target.dispatchEvent(s),zc=null}else return n=Ea(a),n!==null&&Ov(n),e.blockedOn=a,!1;n.shift()}return!0}function Hv(e,n,a){hl(e)&&a.delete(n)}function k2(){Hd=!1,jr!==null&&hl(jr)&&(jr=null),Rr!==null&&hl(Rr)&&(Rr=null),Or!==null&&hl(Or)&&(Or=null),xs.forEach(Hv),ks.forEach(Hv)}function gl(e,n){e.blockedOn===n&&(e.blockedOn=null,Hd||(Hd=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,k2)))}var vl=null;function Bv(e){vl!==e&&(vl=e,t.unstable_scheduleCallback(t.unstable_NormalPriority,function(){vl===e&&(vl=null);for(var n=0;n<e.length;n+=3){var a=e[n],s=e[n+1],d=e[n+2];if(typeof s!="function"){if(zd(s||a)===null)continue;break}var p=Ea(a);p!==null&&(e.splice(n,3),n-=3,Lu(p,{pending:!0,data:d,method:a.method,action:s},s,d))}}))}function oo(e){function n(z){return gl(z,e)}jr!==null&&gl(jr,e),Rr!==null&&gl(Rr,e),Or!==null&&gl(Or,e),xs.forEach(n),ks.forEach(n);for(var a=0;a<Dr.length;a++){var s=Dr[a];s.blockedOn===e&&(s.blockedOn=null)}for(;0<Dr.length&&(a=Dr[0],a.blockedOn===null);)zv(a),a.blockedOn===null&&Dr.shift();if(a=(e.ownerDocument||e).$$reactFormReplay,a!=null)for(s=0;s<a.length;s+=3){var d=a[s],p=a[s+1],w=d[_t]||null;if(typeof p=="function")w||Bv(a);else if(w){var N=null;if(p&&p.hasAttribute("formAction")){if(d=p,w=p[_t]||null)N=w.formAction;else if(zd(d)!==null)continue}else N=w.action;typeof N=="function"?a[s+1]=N:(a.splice(s,3),s-=3),Bv(a)}}}function Wv(){function e(p){p.canIntercept&&p.info==="react-transition"&&p.intercept({handler:function(){return new Promise(function(w){return d=w})},focusReset:"manual",scroll:"manual"})}function n(){d!==null&&(d(),d=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,d=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),d!==null&&(d(),d=null)}}}function Bd(e){this._internalRoot=e}yl.prototype.render=Bd.prototype.render=function(e){var n=this._internalRoot;if(n===null)throw Error(i(409));var a=n.current,s=$t();jv(a,s,e,n,null,null)},yl.prototype.unmount=Bd.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var n=e.containerInfo;jv(e.current,2,null,e,null,null),Qi(),n[ka]=null}};function yl(e){this._internalRoot=e}yl.prototype.unstable_scheduleHydration=function(e){if(e){var n=Gm();e={blockedOn:null,target:e,priority:n};for(var a=0;a<Dr.length&&n!==0&&n<Dr[a].priority;a++);Dr.splice(a,0,e),a===0&&zv(e)}};var Uv=r.version;if(Uv!=="19.2.5")throw Error(i(527,Uv,"19.2.5"));I.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 S2={bundleType:0,version:"19.2.5",rendererPackageName:"react-dom",currentDispatcherRef:M,reconcilerVersion:"19.2.5"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var bl=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!bl.isDisabled&&bl.supportsFiber)try{Oo=bl.inject(S2),Ut=bl}catch{}}return Cs.createRoot=function(e,n){if(!l(e))throw Error(i(299));var a=!1,s="",d=Vh,p=$h,w=Gh;return n!=null&&(n.unstable_strictMode===!0&&(a=!0),n.identifierPrefix!==void 0&&(s=n.identifierPrefix),n.onUncaughtError!==void 0&&(d=n.onUncaughtError),n.onCaughtError!==void 0&&(p=n.onCaughtError),n.onRecoverableError!==void 0&&(w=n.onRecoverableError)),n=_v(e,1,!1,null,null,a,s,null,d,p,w,Wv),e[ka]=n.current,bd(e),new Bd(n)},Cs.hydrateRoot=function(e,n,a){if(!l(e))throw Error(i(299));var s=!1,d="",p=Vh,w=$h,N=Gh,z=null;return a!=null&&(a.unstable_strictMode===!0&&(s=!0),a.identifierPrefix!==void 0&&(d=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=_v(e,1,!0,n,a??null,s,d,z,p,w,N,Wv),n.context=Nv(null),a=n.current,s=$t(),s=_c(s),d=yr(s),d.callback=null,br(a,d,s),a=s,n.current.lanes=a,Mo(n,a),jn(n),e[ka]=n.current,bd(e),new yl(n)},Cs.version="19.2.5",Cs}var Xv;function M2(){if(Xv)return qd.exports;Xv=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(),qd.exports=D2(),qd.exports}var L2=M2();const z2="modulepreload",H2=function(t){return"/"+t},Zv={},Tt=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=H2(m),m in Zv)return;Zv[m]=!0;const y=m.endsWith(".css"),v=y?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${m}"]${v}`))return;const x=document.createElement("link");if(x.rel=y?"stylesheet":z2,y||(x.as="script"),x.crossOrigin="",x.href=m,h&&x.setAttribute("nonce",h),document.head.appendChild(x),y)return new Promise((S,T)=>{x.addEventListener("load",S),x.addEventListener("error",()=>T(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)})},B2=b.lazy(()=>Tt(()=>import("./WorkspaceTaskDrawer-CIMYzlpt.js"),__vite__mapDeps([0,1])).then(t=>({default:t.WorkspaceTaskDrawer}))),W2=b.lazy(()=>Tt(()=>import("./AddWorkspaceFlow-D_fSv-cO.js"),[]).then(t=>({default:t.AddWorkspaceFlow}))),U2=b.lazy(()=>Tt(()=>import("./FirstRunWizard-C24MUssx.js"),[]).then(t=>({default:t.FirstRunWizard}))),q2=b.lazy(()=>Tt(()=>import("./WhatsNewDialog-vnShQWjg.js"),[]).then(t=>({default:t.WhatsNewDialog}))),I2=({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:x,workers:S,onSelectOwner:T,connectionStale:k})=>u.jsxs(u.Fragment,{children:[x?u.jsx(b.Suspense,{fallback:null,children:u.jsx(B2,{open:f,tasksFile:h,onClose:o,workspacePath:x,...S?{workers:S}:{},...T?{onSelectOwner:T}:{},...k!==void 0?{connectionStale:k}:{}})}):null,t>0?u.jsx(b.Suspense,{fallback:null,children:u.jsx(W2,{onClose:()=>{},onCreate:l,onTryDemo:c,trigger:t})}):null,g?u.jsx(b.Suspense,{fallback:null,children:u.jsx(U2,{open:g,onClose:i,onAddWorkspace:r,onTryDemo:c})}):null,m?u.jsx(b.Suspense,{fallback:null,children:u.jsx(q2,{open:m,entries:[...y],onClose:v})}):null]});const L0=(...t)=>t.filter((r,o,i)=>!!r&&r.trim()!==""&&i.indexOf(r)===o).join(" ").trim();const P2=t=>t.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();const K2=t=>t.replace(/^([A-Z])|[\s-_]+(\w)/g,(r,o,i)=>i?i.toUpperCase():o.toLowerCase());const Qv=t=>{const r=K2(t);return r.charAt(0).toUpperCase()+r.slice(1)};var Fd={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 F2=t=>{for(const r in t)if(r.startsWith("aria-")||r==="role"||r==="title")return!0;return!1},Y2=b.createContext({}),V2=()=>b.useContext(Y2),$2=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:x="currentColor",className:S=""}=V2()??{},T=i??v?Number(o??y)*24/Number(r??m):o??y;return b.createElement("svg",{ref:g,...Fd,width:r??m??Fd.width,height:r??m??Fd.height,stroke:t??x,strokeWidth:T,className:L0("lucide",S,l),...!c&&!F2(h)&&{"aria-hidden":"true"},...h},[...f.map(([k,E])=>b.createElement(k,E)),...Array.isArray(c)?c:[c]])});const be=(t,r)=>{const o=b.forwardRef(({className:i,...l},c)=>b.createElement($2,{ref:c,iconNode:r,className:L0(`lucide-${P2(Qv(t))}`,`lucide-${t}`,i),...l}));return o.displayName=Qv(t),o};const G2=[["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"}]],Wl=be("activity",G2);const X2=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]],Z2=be("arrow-right",X2);const Q2=[["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"}]],Of=be("bell",Q2);const J2=[["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"}]],eS=be("book-open-check",J2);const tS=[["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"}]],nS=be("brain",tS);const rS=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],Eo=be("check",rS);const aS=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],Co=be("chevron-down",aS);const oS=[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]],sS=be("chevron-left",oS);const iS=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],oc=be("chevron-right",iS);const lS=[["path",{d:"m11 17-5-5 5-5",key:"13zhaf"}],["path",{d:"m18 17-5-5 5-5",key:"h8a8et"}]],cS=be("chevrons-left",lS);const uS=[["path",{d:"m6 17 5-5-5-5",key:"xnjwq"}],["path",{d:"m13 17 5-5-5-5",key:"17xmmf"}]],dS=be("chevrons-right",uS);const fS=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],mS=be("circle-check",fS);const pS=[["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"}]],hS=be("circle-play",pS);const gS=[["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"}]],vS=be("circle-question-mark",gS);const yS=[["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"}]],bS=be("circle-x",yS);const wS=[["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"}]],xS=be("code-xml",wS);const kS=[["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"}]],sc=be("copy",kS);const SS=[["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"}]],dm=be("crown",SS);const ES=[["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"}]],CS=be("ellipsis-vertical",ES);const TS=[["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"}]],AS=be("external-link",TS);const _S=[["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"}]],NS=be("eye",_S);const jS=[["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"}]],RS=be("file-text",jS);const OS=[["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"}]],Ul=be("flask-conical",OS);const DS=[["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"}]],z0=be("folder-plus",DS);const MS=[["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"}]],LS=be("hammer",MS);const zS=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]],H0=be("info",zS);const HS=[["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"}]],BS=be("languages",HS);const WS=[["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"}]],Yd=be("laptop",WS);const US=[["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"}]],B0=be("list-checks",US);const qS=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],To=be("loader-circle",qS);const IS=[["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"}]],PS=be("log-out",IS);const KS=[["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"}]],FS=be("maximize-2",KS);const YS=[["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"}]],VS=be("minimize-2",YS);const $S=[["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"}]],W0=be("pencil",$S);const GS=[["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"}]],Ao=be("play",GS);const XS=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],Ds=be("plus",XS);const ZS=[["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"}]],fm=be("refresh-cw",ZS);const QS=[["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"}]],mm=be("rotate-ccw",QS);const JS=[["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"}]],eE=be("search-check",JS);const tE=[["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"}]],nE=be("send",tE);const rE=[["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"}]],aE=be("server-crash",rE);const oE=[["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"}]],Df=be("settings",oE);const sE=[["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"}]],iE=be("shield-check",sE);const lE=[["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"}]],cE=be("sliders-horizontal",lE);const uE=[["rect",{width:"14",height:"20",x:"5",y:"2",rx:"2",ry:"2",key:"1yt0o3"}],["path",{d:"M12 18h.01",key:"mhygvu"}]],U0=be("smartphone",uE);const dE=[["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"}]],q0=be("sparkles",dE);const fE=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]],pm=be("square",fE);const mE=[["path",{d:"M12 19h8",key:"baeox8"}],["path",{d:"m4 17 6-6-6-6",key:"1yngyt"}]],hm=be("terminal",mE);const pE=[["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"}]],ic=be("trash-2",pE);const hE=[["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"}]],lc=be("triangle-alert",hE);const gE=[["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"}]],Vd=be("user-plus",gE);const vE=[["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"}]],I0=be("users",vE);const yE=[["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"}]],ql=be("volume-2",yE);const bE=[["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"}]],P0=be("volume-x",bE);const wE=[["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"}]],xE=be("webhook",wE);const kE=[["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"}]],K0=be("workflow",kE);const SE=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],vo=be("x",SE),F0="hive.uiLanguage",EE=t=>t==="en"||t==="zh",Y0={"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"},CE={"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"},TE={en:Y0,zh:CE},AE=()=>{if(typeof window>"u")return"en";const t=_E();return t||(window.navigator.language.toLowerCase().startsWith("zh")?"zh":"en")},_E=()=>{try{const t=window.localStorage.getItem(F0);return EE(t)?t:null}catch{return null}},NE=t=>{try{window.localStorage.setItem(F0,t)}catch{}},V0=t=>(r,o={})=>(TE[t][r]??Y0[r]??r).replace(/\{(\w+)\}/g,(l,c)=>{const f=o[c];return f===void 0?l:String(f)}),jE={language:"en",setLanguage:()=>{},t:V0("en")},$0=b.createContext(jE),RE=({children:t})=>{const[r,o]=b.useState(AE),i=b.useMemo(()=>({language:r,setLanguage:c=>{o(c),NE(c)},t:V0(r)}),[r]);return u.jsx($0.Provider,{value:i,children:t})},ke=()=>b.useContext($0),OE=({onExit:t})=>{const{t:r}=ke();return u.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:[u.jsxs("div",{className:"flex items-center gap-2 text-pri",children:[u.jsx(q0,{size:14,"aria-hidden":!0}),u.jsx("span",{children:r("demo.banner")})]}),u.jsx("button",{type:"button",onClick:t,className:"icon-btn icon-btn--ghost",children:r("demo.exit")})]})},DE=({onExit:t})=>{const{t:r}=ke();return u.jsxs("div",{className:"flex min-h-0 min-w-0 flex-1 flex-col",children:[u.jsx(OE,{onExit:t}),u.jsx("div",{className:"flex min-h-0 flex-1 items-center justify-center px-6 py-8",style:{background:"var(--bg-crust)"},children:u.jsxs("section",{className:"flex w-full max-w-5xl flex-col gap-5","data-testid":"demo-video-panel",children:[u.jsxs("div",{className:"max-w-2xl",children:[u.jsx("p",{className:"mono text-[10px] uppercase tracking-[0.22em] text-accent",children:r("demo.videoEyebrow")}),u.jsx("h1",{className:"mt-2 text-2xl font-semibold tracking-tight text-pri",children:r("demo.videoTitle")}),u.jsx("p",{className:"mt-2 text-sm text-sec",children:r("demo.videoDescription")})]}),u.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:u.jsx("div",{className:"relative aspect-video",children:u.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"})})}),u.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")})]})})]})},ME=(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()},LE={requiresUiSession:!0,fetch(t,r){return fetch(t,r)},openWebSocket(t,r){return new WebSocket(ME(t,r))}};let yo=LE;const zE=t=>{yo=t},G0=()=>yo,X0=()=>yo.requiresUiSession!==!1,Z0=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}:{}}),je=async(t,r)=>{try{const o=await t.json();if(typeof o.error=="string"&&o.error.trim())return o.error}catch{}return r},HE=async t=>{if(t.status!==403)return!1;try{return(await t.clone().json()).error==="UI endpoint requires valid UI token"}catch{return!1}},Q0=async()=>{if(!X0())return;const t=await yo.fetch("/api/ui/session",{mode:"same-origin"});if(!t.ok)throw new Error("Failed to initialize UI session");await t.json()};let $d=null;const BE=()=>($d??=Q0().finally(()=>{$d=null}),$d),ve=async(t,r)=>{const o=await yo.fetch(t,r);return!X0()||!await HE(o)?o:(await BE(),yo.fetch(t,r))},WE=async()=>{const t=await ve("/api/workspaces");if(!t.ok)throw new Error("Failed to load workspaces");return await t.json()},UE=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}},J0=t=>({description:t.description,id:t.id,isBuiltin:t.is_builtin,name:t.name,roleType:t.role_type}),qE=t=>({name:t.name,role_type:t.roleType,description:t.description,default_command:"",default_args:[],default_env:{}}),IE=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 je(r,"Failed to create workspace"));return await r.json()},PE=async t=>{const r=await ve(`/api/workspaces/${t}`,{method:"DELETE"});if(!r.ok)throw new Error(await je(r,"Failed to delete workspace"))},Il=async(t,r)=>{const o=await ve(`/api/workspaces/${t}/agents/${r}/start`,{method:"POST"});if(!o.ok)throw new Error(await je(o,"Failed to start agent run"));return{runId:(await o.json()).run_id}},Pl=async t=>{if(!(await ve(`/api/runtime/runs/${t}/stop`,{method:"POST"})).ok)throw new Error("Failed to stop agent run")},KE=async(t,r,o)=>(await Pl(o).catch(i=>{console.error("[hive] swallowed:restartAgentRun.stop",i)}),Il(t,r)),FE=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},eb=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")},tb="notifications.webhook-url",YE=async()=>{const t=await ve(`/api/settings/app-state/${tb}`);if(!t.ok)throw new Error("Failed to load webhook URL");return(await t.json()).value??""},VE=async t=>{if(!(await ve(`/api/settings/app-state/${tb}`,{method:"PUT",headers:{"content-type":"application/json"},body:JSON.stringify({value:t.trim()})})).ok)throw new Error("Failed to save webhook URL")},RD=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()},OD=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()},$E=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()},GE=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()},XE=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()},ZE=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()},QE=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(Z0)},JE=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}))},eC=t=>`${t}:shell`,cc=(t,r)=>t.agent_id===eC(r),tC=async t=>{const r=await ve(`/api/workspaces/${t}/shell/start`,{method:"POST"});if(!r.ok)throw new Error(await je(r,"Failed to start workspace terminal"));return await r.json()},nC=async(t,r)=>{const o=await ve(`/api/workspaces/${t}/shell/${r}`,{method:"DELETE"});if(!o.ok)throw new Error(await je(o,"Failed to close workspace terminal"))},rC=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(J0)},aC=async t=>{const r=await ve("/api/settings/role-templates",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(qE(t))});if(!r.ok)throw new Error(await je(r,"Failed to create role template"));return J0(await r.json())},oC=async t=>{const r=await ve(`/api/settings/role-templates/${t}`,{method:"DELETE"});if(!r.ok)throw new Error(await je(r,"Failed to delete role template"))},DD=async t=>{const r=await ve(`/api/marketplace/manifest?lang=${t}`,{mode:"same-origin"});if(!r.ok)throw new Error(await je(r,"Failed to load marketplace manifest"));return await r.json()},MD=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 je(o,"Failed to load marketplace agent"));return await o.json()},sC=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()},iC=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 je(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:Z0(i)}},lC=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 je(i,"Failed to assemble the scenario team"));return{createdWorkers:(await i.json()).created_workers}},cC=async(t,r)=>{const o=await ve(`/api/workspaces/${t}/workers/${r}`,{method:"DELETE"});if(!o.ok)throw new Error(await je(o,"Failed to delete worker"))},uC=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 je(i,"Failed to rename worker"))},dC=async t=>{const r=await ve(`/api/workspaces/${t}/tasks`);if(!r.ok)throw new Error("Failed to load tasks");return await r.json()},wl=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()},LD=async t=>{const r=t?`?path=${encodeURIComponent(t)}`:"";return await(await ve(`/api/fs/browse${r}`,{mode:"same-origin"})).json()},zD=async t=>await(await ve(`/api/fs/probe?path=${encodeURIComponent(t)}`,{mode:"same-origin"})).json(),HD=async()=>await(await ve("/api/fs/pick-folder",{method:"POST",mode:"same-origin"})).json(),fC=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 je(o,"Failed to open workspace"))},mC=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}),uc=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(mC),status:t.status,tags:t.tags,updatedAt:t.updated_at,workspaceId:t.workspace_id}),pC=t=>({contextType:t.context_type,dispatchId:t.dispatch_id,id:t.id,injectedAt:t.injected_at,memory:uc(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 je(l,"Failed to load memory"));return(await l.json()).memories.map(uc)},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 je(i,"Failed to update memory"));const l=await i.json();return uc(l.memory)},hC=async(t,r,o)=>{const i=await ve(`/api/ui/workspaces/${t}/memory/${r}/${o}`,{method:"POST"});if(!i.ok)throw new Error(await je(i,`Failed to ${o} memory`));const l=await i.json();return uc(l.memory)},UD=(t,r)=>hC(t,r,"archive"),gm=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}),qD=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 je(l,"Failed to load dream runs"));return(await l.json()).runs.map(gm)},ID=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 je(r,"Failed to run dream"));const o=await r.json();return gm(o.run)},PD=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 je(o,"Failed to revert dream run"));const i=await o.json();return gm(i.run)},KD=async t=>{const r=await ve(`/api/ui/workspaces/${t}/memory/settings`);if(!r.ok)throw new Error(await je(r,"Failed to load memory settings"));const o=await r.json();return{dreamEnabled:o.dream_enabled,enabled:o.enabled}},FD=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 je(o,"Failed to update memory settings"));const i=await o.json();return{dreamEnabled:i.dream_enabled,enabled:i.enabled}},YD=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 je(i,"Failed to load memory injections"));return(await i.json()).injections.map(pC)},gC=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}),VD=async t=>{const r=await ve(`/api/workspaces/${t}/workflows/runs`);if(!r.ok)throw new Error(await je(r,"Failed to list workflow runs"));return(await r.json()).runs.map(gC)},nb=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}),$D=async t=>{const r=await ve(`/api/workspaces/${t}/workflow-schedules`);if(!r.ok)throw new Error(await je(r,"Failed to list workflow schedules"));return(await r.json()).schedules.map(nb)},GD=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 je(o,"Failed to update workflow schedule"));const i=await o.json();return nb(i.schedule)},vC=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}:{}}),XD=async t=>{const r=await ve(`/api/workflows/runs/${t}/stop`,{method:"POST"});if(!r.ok)throw new Error(await je(r,"Failed to stop workflow run"))},ZD=async t=>{const r=await ve(`/api/workflows/runs/${t}/dispatches`);if(!r.ok)throw new Error(await je(r,"Failed to load workflow run dispatches"));return(await r.json()).dispatches.map(vC)},QD=async t=>{const r=await ve(`/api/workflows/runs/${t}/logs`);if(!r.ok)throw new Error(await je(r,"Failed to load workflow run logs"));return(await r.json()).logs},JD=async t=>{const r=await ve(`/api/workflow-schedules/${t}`,{method:"DELETE"});if(!r.ok)throw new Error(await je(r,"Failed to delete workflow schedule"))},yC=["disabled","loggedOut","connecting","online","reconnecting","revoked"],bC=(t,r)=>typeof t=="string"&&yC.includes(t)?t:r?"online":"disabled",rb=t=>({enabled:t.enabled===!0,loggedIn:t.loggedIn===!0,gatewayUrl:t.gatewayUrl??null,connected:t.connected===!0,connection:bC(t.connection,t.connected===!0)}),wC=t=>({deviceId:t.id,name:t.name,lastActive:t.last_active,createdAt:t.created_at,revoked:t.revoked_at!==null}),xC=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}),Gd=async()=>{const t=await ve("/api/remote/status");if(!t.ok)throw new Error(await je(t,"Failed to load remote status"));return rb(await t.json())},kC=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 je(r,"Failed to update remote access"));return rb(await r.json())},SC=async()=>{const t=await ve("/api/remote/pairings",{method:"POST"});if(!t.ok)throw new Error(await je(t,"Failed to start pairing"));return await t.json()},Jv=async()=>{const t=await ve("/api/remote/pairings/pending");if(!t.ok)throw new Error(await je(t,"Failed to load pending pairing"));const o=(await t.json())[0];return o?{...o}:null},EC=async t=>{const r=await ve(`/api/remote/pairings/${t}/confirm`,{method:"POST"});if(!r.ok)throw new Error(await je(r,"Failed to confirm pairing"))},CC=async t=>{const r=await ve(`/api/remote/pairings/${t}/reject`,{method:"POST"});if(!r.ok)throw new Error(await je(r,"Failed to reject pairing"))},ab=async()=>{const t=await ve("/api/remote/devices");if(!t.ok)throw new Error(await je(t,"Failed to load devices"));return(await t.json()).map(wC)},TC=async t=>{const r=await ve(`/api/remote/devices/${t}/revoke`,{method:"POST"});if(!r.ok)throw new Error(await je(r,"Failed to revoke device"))},AC=async(t=100)=>{const r=await ve(`/api/remote/audit?limit=${t}`);if(!r.ok)throw new Error(await je(r,"Failed to load remote activity"));return(await r.json()).map(xC)},_C=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,Xd=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}),NC=t=>({attention:(t.attention??[]).map(_C),generatedAt:t.generated_at,recentActivity:t.recent_activity.map(r=>({...Xd(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?Xd(r.current_dispatch):null,id:r.id,latestReport:r.latest_report?Xd(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}),jC=async(t,r)=>{const o=await ve(`/api/ui/workspaces/${t}/action-center`,r);if(!o.ok)throw new Error(await je(o,"Failed to load action center"));return NC(await o.json())},RC=async(t,r)=>{const o=await ve(`/api/workspaces/${t}/recap`,r);if(!o.ok)throw new Error(await je(o,"Failed to load team recap"));const i=await o.json();return{generatedAt:i.generated_at,markdown:i.markdown}},OC=async()=>{const t=await ve("/api/diagnostics/support-bundle");if(!t.ok)throw new Error(await je(t,"Failed to load diagnostics"));return await t.json()},ob=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")},sb=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 ob(await t)};function zt(t,r,{checkForDefaultPrevented:o=!0}={}){return function(l){if(t?.(l),o===!1||!l.defaultPrevented)return r?.(l)}}function ey(t,r){if(typeof t=="function")return t(r);t!=null&&(t.current=r)}function ib(...t){return r=>{let o=!1;const i=t.map(l=>{const c=ey(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():ey(t[l],null)}}}}function Sn(...t){return b.useCallback(ib(...t),t)}function DC(t,r){const o=b.createContext(r),i=c=>{const{children:f,...h}=c,g=b.useMemo(()=>h,Object.values(h));return u.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 vm(t,r=[]){let o=[];function i(c,f){const h=b.createContext(f),g=o.length;o=[...o,f];const m=v=>{const{scope:x,children:S,...T}=v,k=x?.[t]?.[g]||h,E=b.useMemo(()=>T,Object.values(T));return u.jsx(k.Provider,{value:E,children:S})};m.displayName=c+"Provider";function y(v,x){const S=x?.[t]?.[g]||h,T=b.useContext(S);if(T)return T;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,MC(l,...r)]}function MC(...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 dc=M0();const LC=O0(dc);function lb(t){const r=zC(t),o=b.forwardRef((i,l)=>{const{children:c,...f}=i,h=b.Children.toArray(c),g=h.find(BC);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 u.jsx(r,{...f,ref:l,children:b.isValidElement(m)?b.cloneElement(m,void 0,y):null})}return u.jsx(r,{...f,ref:l,children:c})});return o.displayName=`${t}.Slot`,o}function zC(t){const r=b.forwardRef((o,i)=>{const{children:l,...c}=o;if(b.isValidElement(l)){const f=UC(l),h=WC(c,l.props);return l.type!==b.Fragment&&(h.ref=i?ib(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 cb=Symbol("radix.slottable");function HC(t){const r=({children:o})=>u.jsx(u.Fragment,{children:o});return r.displayName=`${t}.Slottable`,r.__radixId=cb,r}function BC(t){return b.isValidElement(t)&&typeof t.type=="function"&&"__radixId"in t.type&&t.type.__radixId===cb}function WC(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 UC(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 qC=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Wt=qC.reduce((t,r)=>{const o=lb(`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),u.jsx(g,{...h,ref:c})});return i.displayName=`Primitive.${r}`,{...t,[r]:i}},{});function IC(t,r){t&&dc.flushSync(()=>t.dispatchEvent(r))}function bo(t){const r=b.useRef(t);return b.useEffect(()=>{r.current=t}),b.useMemo(()=>(...o)=>r.current?.(...o),[])}function PC(t,r=globalThis?.document){const o=bo(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 KC="DismissableLayer",Mf="dismissableLayer.update",FC="dismissableLayer.pointerDownOutside",YC="dismissableLayer.focusOutside",ty,ub=b.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),ym=b.forwardRef((t,r)=>{const{disableOutsidePointerEvents:o=!1,onEscapeKeyDown:i,onPointerDownOutside:l,onFocusOutside:c,onInteractOutside:f,onDismiss:h,...g}=t,m=b.useContext(ub),[y,v]=b.useState(null),x=y?.ownerDocument??globalThis?.document,[,S]=b.useState({}),T=Sn(r,L=>v(L)),k=Array.from(m.layers),[E]=[...m.layersWithOutsidePointerEventsDisabled].slice(-1),C=k.indexOf(E),_=y?k.indexOf(y):-1,j=m.layersWithOutsidePointerEventsDisabled.size>0,A=_>=C,O=GC(L=>{const B=L.target,q=[...m.branches].some(te=>te.contains(B));!A||q||(l?.(L),f?.(L),L.defaultPrevented||h?.())},x),D=XC(L=>{const B=L.target;[...m.branches].some(te=>te.contains(B))||(c?.(L),f?.(L),L.defaultPrevented||h?.())},x);return PC(L=>{_===m.layers.size-1&&(i?.(L),!L.defaultPrevented&&h&&(L.preventDefault(),h()))},x),b.useEffect(()=>{if(y)return o&&(m.layersWithOutsidePointerEventsDisabled.size===0&&(ty=x.body.style.pointerEvents,x.body.style.pointerEvents="none"),m.layersWithOutsidePointerEventsDisabled.add(y)),m.layers.add(y),ny(),()=>{o&&m.layersWithOutsidePointerEventsDisabled.size===1&&(x.body.style.pointerEvents=ty)}},[y,x,o,m]),b.useEffect(()=>()=>{y&&(m.layers.delete(y),m.layersWithOutsidePointerEventsDisabled.delete(y),ny())},[y,m]),b.useEffect(()=>{const L=()=>S({});return document.addEventListener(Mf,L),()=>document.removeEventListener(Mf,L)},[]),u.jsx(Wt.div,{...g,ref:T,style:{pointerEvents:j?A?"auto":"none":void 0,...t.style},onFocusCapture:zt(t.onFocusCapture,D.onFocusCapture),onBlurCapture:zt(t.onBlurCapture,D.onBlurCapture),onPointerDownCapture:zt(t.onPointerDownCapture,O.onPointerDownCapture)})});ym.displayName=KC;var VC="DismissableLayerBranch",$C=b.forwardRef((t,r)=>{const o=b.useContext(ub),i=b.useRef(null),l=Sn(r,i);return b.useEffect(()=>{const c=i.current;if(c)return o.branches.add(c),()=>{o.branches.delete(c)}},[o.branches]),u.jsx(Wt.div,{...t,ref:l})});$C.displayName=VC;function GC(t,r=globalThis?.document){const o=bo(t),i=b.useRef(!1),l=b.useRef(()=>{});return b.useEffect(()=>{const c=h=>{if(h.target&&!i.current){let g=function(){db(FC,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 XC(t,r=globalThis?.document){const o=bo(t),i=b.useRef(!1);return b.useEffect(()=>{const l=c=>{c.target&&!i.current&&db(YC,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 ny(){const t=new CustomEvent(Mf);document.dispatchEvent(t)}function db(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?IC(l,c):l.dispatchEvent(c)}var Kr=globalThis?.document?b.useLayoutEffect:()=>{},ZC=D0[" useId ".trim().toString()]||(()=>{}),QC=0;function jl(t){const[r,o]=b.useState(ZC());return Kr(()=>{o(i=>i??String(QC++))},[t]),t||(r?`radix-${r}`:"")}const JC=["top","right","bottom","left"],Fr=Math.min,Xt=Math.max,Kl=Math.round,xl=Math.floor,zn=t=>({x:t,y:t}),eT={left:"right",right:"left",bottom:"top",top:"bottom"};function Lf(t,r,o){return Xt(t,Fr(r,o))}function sr(t,r){return typeof t=="function"?t(r):t}function ir(t){return t.split("-")[0]}function _o(t){return t.split("-")[1]}function bm(t){return t==="x"?"y":"x"}function wm(t){return t==="y"?"height":"width"}function Ln(t){const r=t[0];return r==="t"||r==="b"?"y":"x"}function xm(t){return bm(Ln(t))}function tT(t,r,o){o===void 0&&(o=!1);const i=_o(t),l=xm(t),c=wm(l);let f=l==="x"?i===(o?"end":"start")?"right":"left":i==="start"?"bottom":"top";return r.reference[c]>r.floating[c]&&(f=Fl(f)),[f,Fl(f)]}function nT(t){const r=Fl(t);return[zf(t),r,zf(r)]}function zf(t){return t.includes("start")?t.replace("start","end"):t.replace("end","start")}const ry=["left","right"],ay=["right","left"],rT=["top","bottom"],aT=["bottom","top"];function oT(t,r,o){switch(t){case"top":case"bottom":return o?r?ay:ry:r?ry:ay;case"left":case"right":return r?rT:aT;default:return[]}}function sT(t,r,o,i){const l=_o(t);let c=oT(ir(t),o==="start",i);return l&&(c=c.map(f=>f+"-"+l),r&&(c=c.concat(c.map(zf)))),c}function Fl(t){const r=ir(t);return eT[r]+t.slice(r.length)}function iT(t){return{top:0,right:0,bottom:0,left:0,...t}}function fb(t){return typeof t!="number"?iT(t):{top:t,right:t,bottom:t,left:t}}function Yl(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 oy(t,r,o){let{reference:i,floating:l}=t;const c=Ln(r),f=xm(r),h=wm(f),g=ir(r),m=c==="y",y=i.x+i.width/2-l.width/2,v=i.y+i.height/2-l.height/2,x=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(_o(r)){case"start":S[f]-=x*(o&&m?-1:1);break;case"end":S[f]+=x*(o&&m?-1:1);break}return S}async function lT(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:x=!1,padding:S=0}=sr(r,t),T=fb(S),E=h[x?v==="floating"?"reference":"floating":v],C=Yl(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},O=Yl(c.convertOffsetParentRelativeRectToViewportRelativeRect?await c.convertOffsetParentRelativeRectToViewportRelativeRect({elements:h,rect:_,offsetParent:j,strategy:g}):_);return{top:(C.top-O.top+T.top)/A.y,bottom:(O.bottom-C.bottom+T.bottom)/A.y,left:(C.left-O.left+T.left)/A.x,right:(O.right-C.right+T.right)/A.x}}const cT=50,uT=async(t,r,o)=>{const{placement:i="bottom",strategy:l="absolute",middleware:c=[],platform:f}=o,h=f.detectOverflow?f:{...f,detectOverflow:lT},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}=oy(m,i,g),x=i,S=0;const T={};for(let k=0;k<c.length;k++){const E=c[k];if(!E)continue;const{name:C,fn:_}=E,{x:j,y:A,data:O,reset:D}=await _({x:y,y:v,initialPlacement:i,placement:x,strategy:l,middlewareData:T,rects:m,platform:h,elements:{reference:t,floating:r}});y=j??y,v=A??v,T[C]={...T[C],...O},D&&S<cT&&(S++,typeof D=="object"&&(D.placement&&(x=D.placement),D.rects&&(m=D.rects===!0?await f.getElementRects({reference:t,floating:r,strategy:l}):D.rects),{x:y,y:v}=oy(m,x,g)),k=-1)}return{x:y,y:v,placement:x,strategy:l,middlewareData:T}},dT=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}=sr(t,r)||{};if(m==null)return{};const v=fb(y),x={x:o,y:i},S=xm(l),T=wm(S),k=await f.getDimensions(m),E=S==="y",C=E?"top":"left",_=E?"bottom":"right",j=E?"clientHeight":"clientWidth",A=c.reference[T]+c.reference[S]-x[S]-c.floating[T],O=x[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[T]);const B=A/2-O/2,q=L/2-k[T]/2-1,te=Fr(v[C],q),ee=Fr(v[_],q),V=te,J=L-k[T]-ee,X=L/2-k[T]/2+B,$=Lf(V,X,J),M=!g.arrow&&_o(l)!=null&&X!==$&&c.reference[T]/2-(X<V?te:ee)-k[T]/2<0,I=M?X<V?X-V:X-J:0;return{[S]:x[S]+I,data:{[S]:$,centerOffset:X-$-I,...M&&{alignmentOffset:I}},reset:M}}}),fT=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:x,fallbackStrategy:S="bestFit",fallbackAxisSideDirection:T="none",flipAlignment:k=!0,...E}=sr(t,r);if((o=c.arrow)!=null&&o.alignmentOffset)return{};const C=ir(l),_=Ln(h),j=ir(h)===h,A=await(g.isRTL==null?void 0:g.isRTL(m.floating)),O=x||(j||!k?[Fl(h)]:nT(h)),D=T!=="none";!x&&D&&O.push(...sT(h,k,T,A));const L=[h,...O],B=await g.detectOverflow(r,E),q=[];let te=((i=c.flip)==null?void 0:i.overflows)||[];if(y&&q.push(B[C]),v){const X=tT(l,f,A);q.push(B[X[0]],B[X[1]])}if(te=[...te,{placement:l,overflows:q}],!q.every(X=>X<=0)){var ee,V;const X=(((ee=c.flip)==null?void 0:ee.index)||0)+1,$=L[X];if($&&(!(v==="alignment"?_!==Ln($):!1)||te.every(P=>Ln(P.placement)===_?P.overflows[0]>0:!0)))return{data:{index:X,overflows:te},reset:{placement:$}};let M=(V=te.filter(I=>I.overflows[0]<=0).sort((I,P)=>I.overflows[1]-P.overflows[1])[0])==null?void 0:V.placement;if(!M)switch(S){case"bestFit":{var J;const I=(J=te.filter(P=>{if(D){const Z=Ln(P.placement);return Z===_||Z==="y"}return!0}).map(P=>[P.placement,P.overflows.filter(Z=>Z>0).reduce((Z,K)=>Z+K,0)]).sort((P,Z)=>P[1]-Z[1])[0])==null?void 0:J[0];I&&(M=I);break}case"initialPlacement":M=h;break}if(l!==M)return{reset:{placement:M}}}return{}}}};function sy(t,r){return{top:t.top-r.height,right:t.right-r.width,bottom:t.bottom-r.height,left:t.left-r.width}}function iy(t){return JC.some(r=>t[r]>=0)}const mT=function(t){return t===void 0&&(t={}),{name:"hide",options:t,async fn(r){const{rects:o,platform:i}=r,{strategy:l="referenceHidden",...c}=sr(t,r);switch(l){case"referenceHidden":{const f=await i.detectOverflow(r,{...c,elementContext:"reference"}),h=sy(f,o.reference);return{data:{referenceHiddenOffsets:h,referenceHidden:iy(h)}}}case"escaped":{const f=await i.detectOverflow(r,{...c,altBoundary:!0}),h=sy(f,o.floating);return{data:{escapedOffsets:h,escaped:iy(h)}}}default:return{}}}}},mb=new Set(["left","top"]);async function pT(t,r){const{placement:o,platform:i,elements:l}=t,c=await(i.isRTL==null?void 0:i.isRTL(l.floating)),f=ir(o),h=_o(o),g=Ln(o)==="y",m=mb.has(f)?-1:1,y=c&&g?-1:1,v=sr(r,t);let{mainAxis:x,crossAxis:S,alignmentAxis:T}=typeof v=="number"?{mainAxis:v,crossAxis:0,alignmentAxis:null}:{mainAxis:v.mainAxis||0,crossAxis:v.crossAxis||0,alignmentAxis:v.alignmentAxis};return h&&typeof T=="number"&&(S=h==="end"?T*-1:T),g?{x:S*y,y:x*m}:{x:x*m,y:S*y}}const hT=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 pT(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}}}}},gT=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:C=>{let{x:_,y:j}=C;return{x:_,y:j}}},...m}=sr(t,r),y={x:o,y:i},v=await c.detectOverflow(r,m),x=Ln(ir(l)),S=bm(x);let T=y[S],k=y[x];if(f){const C=S==="y"?"top":"left",_=S==="y"?"bottom":"right",j=T+v[C],A=T-v[_];T=Lf(j,T,A)}if(h){const C=x==="y"?"top":"left",_=x==="y"?"bottom":"right",j=k+v[C],A=k-v[_];k=Lf(j,k,A)}const E=g.fn({...r,[S]:T,[x]:k});return{...E,data:{x:E.x-o,y:E.y-i,enabled:{[S]:f,[x]:h}}}}}},vT=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}=sr(t,r),y={x:o,y:i},v=Ln(l),x=bm(v);let S=y[x],T=y[v];const k=sr(h,r),E=typeof k=="number"?{mainAxis:k,crossAxis:0}:{mainAxis:0,crossAxis:0,...k};if(g){const j=x==="y"?"height":"width",A=c.reference[x]-c.floating[j]+E.mainAxis,O=c.reference[x]+c.reference[j]-E.mainAxis;S<A?S=A:S>O&&(S=O)}if(m){var C,_;const j=x==="y"?"width":"height",A=mb.has(ir(l)),O=c.reference[v]-c.floating[j]+(A&&((C=f.offset)==null?void 0:C[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);T<O?T=O:T>D&&(T=D)}return{[x]:S,[v]:T}}}},yT=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}=sr(t,r),y=await f.detectOverflow(r,m),v=ir(l),x=_o(l),S=Ln(l)==="y",{width:T,height:k}=c.floating;let E,C;v==="top"||v==="bottom"?(E=v,C=x===(await(f.isRTL==null?void 0:f.isRTL(h.floating))?"start":"end")?"left":"right"):(C=v,E=x==="end"?"top":"bottom");const _=k-y.top-y.bottom,j=T-y.left-y.right,A=Fr(k-y[E],_),O=Fr(T-y[C],j),D=!r.middlewareData.shift;let L=A,B=O;if((o=r.middlewareData.shift)!=null&&o.enabled.x&&(B=j),(i=r.middlewareData.shift)!=null&&i.enabled.y&&(L=_),D&&!x){const te=Xt(y.left,0),ee=Xt(y.right,0),V=Xt(y.top,0),J=Xt(y.bottom,0);S?B=T-2*(te!==0||ee!==0?te+ee:Xt(y.left,y.right)):L=k-2*(V!==0||J!==0?V+J:Xt(y.top,y.bottom))}await g({...r,availableWidth:B,availableHeight:L});const q=await f.getDimensions(h.floating);return T!==q.width||k!==q.height?{reset:{rects:!0}}:{}}}};function fc(){return typeof window<"u"}function No(t){return pb(t)?(t.nodeName||"").toLowerCase():"#document"}function Qt(t){var r;return(t==null||(r=t.ownerDocument)==null?void 0:r.defaultView)||window}function Wn(t){var r;return(r=(pb(t)?t.ownerDocument:t.document)||window.document)==null?void 0:r.documentElement}function pb(t){return fc()?t instanceof Node||t instanceof Qt(t).Node:!1}function xn(t){return fc()?t instanceof Element||t instanceof Qt(t).Element:!1}function cr(t){return fc()?t instanceof HTMLElement||t instanceof Qt(t).HTMLElement:!1}function ly(t){return!fc()||typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof Qt(t).ShadowRoot}function $s(t){const{overflow:r,overflowX:o,overflowY:i,display:l}=kn(t);return/auto|scroll|overlay|hidden|clip/.test(r+i+o)&&l!=="inline"&&l!=="contents"}function bT(t){return/^(table|td|th)$/.test(No(t))}function mc(t){try{if(t.matches(":popover-open"))return!0}catch{}try{return t.matches(":modal")}catch{return!1}}const wT=/transform|translate|scale|rotate|perspective|filter/,xT=/paint|layout|strict|content/,ma=t=>!!t&&t!=="none";let Zd;function km(t){const r=xn(t)?kn(t):t;return ma(r.transform)||ma(r.translate)||ma(r.scale)||ma(r.rotate)||ma(r.perspective)||!Sm()&&(ma(r.backdropFilter)||ma(r.filter))||wT.test(r.willChange||"")||xT.test(r.contain||"")}function kT(t){let r=Yr(t);for(;cr(r)&&!wo(r);){if(km(r))return r;if(mc(r))return null;r=Yr(r)}return null}function Sm(){return Zd==null&&(Zd=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),Zd}function wo(t){return/^(html|body|#document)$/.test(No(t))}function kn(t){return Qt(t).getComputedStyle(t)}function pc(t){return xn(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function Yr(t){if(No(t)==="html")return t;const r=t.assignedSlot||t.parentNode||ly(t)&&t.host||Wn(t);return ly(r)?r.host:r}function hb(t){const r=Yr(t);return wo(r)?t.ownerDocument?t.ownerDocument.body:t.body:cr(r)&&$s(r)?r:hb(r)}function Ws(t,r,o){var i;r===void 0&&(r=[]),o===void 0&&(o=!0);const l=hb(t),c=l===((i=t.ownerDocument)==null?void 0:i.body),f=Qt(l);if(c){const h=Hf(f);return r.concat(f,f.visualViewport||[],$s(l)?l:[],h&&o?Ws(h):[])}else return r.concat(l,Ws(l,[],o))}function Hf(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function gb(t){const r=kn(t);let o=parseFloat(r.width)||0,i=parseFloat(r.height)||0;const l=cr(t),c=l?t.offsetWidth:o,f=l?t.offsetHeight:i,h=Kl(o)!==c||Kl(i)!==f;return h&&(o=c,i=f),{width:o,height:i,$:h}}function Em(t){return xn(t)?t:t.contextElement}function mo(t){const r=Em(t);if(!cr(r))return zn(1);const o=r.getBoundingClientRect(),{width:i,height:l,$:c}=gb(r);let f=(c?Kl(o.width):o.width)/i,h=(c?Kl(o.height):o.height)/l;return(!f||!Number.isFinite(f))&&(f=1),(!h||!Number.isFinite(h))&&(h=1),{x:f,y:h}}const ST=zn(0);function vb(t){const r=Qt(t);return!Sm()||!r.visualViewport?ST:{x:r.visualViewport.offsetLeft,y:r.visualViewport.offsetTop}}function ET(t,r,o){return r===void 0&&(r=!1),!o||r&&o!==Qt(t)?!1:r}function wa(t,r,o,i){r===void 0&&(r=!1),o===void 0&&(o=!1);const l=t.getBoundingClientRect(),c=Em(t);let f=zn(1);r&&(i?xn(i)&&(f=mo(i)):f=mo(t));const h=ET(c,o,i)?vb(c):zn(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 x=Qt(c),S=i&&xn(i)?Qt(i):i;let T=x,k=Hf(T);for(;k&&i&&S!==T;){const E=mo(k),C=k.getBoundingClientRect(),_=kn(k),j=C.left+(k.clientLeft+parseFloat(_.paddingLeft))*E.x,A=C.top+(k.clientTop+parseFloat(_.paddingTop))*E.y;g*=E.x,m*=E.y,y*=E.x,v*=E.y,g+=j,m+=A,T=Qt(k),k=Hf(T)}}return Yl({width:y,height:v,x:g,y:m})}function hc(t,r){const o=pc(t).scrollLeft;return r?r.left+o:wa(Wn(t)).left+o}function yb(t,r){const o=t.getBoundingClientRect(),i=o.left+r.scrollLeft-hc(t,o),l=o.top+r.scrollTop;return{x:i,y:l}}function CT(t){let{elements:r,rect:o,offsetParent:i,strategy:l}=t;const c=l==="fixed",f=Wn(i),h=r?mc(r.floating):!1;if(i===f||h&&c)return o;let g={scrollLeft:0,scrollTop:0},m=zn(1);const y=zn(0),v=cr(i);if((v||!v&&!c)&&((No(i)!=="body"||$s(f))&&(g=pc(i)),v)){const S=wa(i);m=mo(i),y.x=S.x+i.clientLeft,y.y=S.y+i.clientTop}const x=f&&!v&&!c?yb(f,g):zn(0);return{width:o.width*m.x,height:o.height*m.y,x:o.x*m.x-g.scrollLeft*m.x+y.x+x.x,y:o.y*m.y-g.scrollTop*m.y+y.y+x.y}}function TT(t){return Array.from(t.getClientRects())}function AT(t){const r=Wn(t),o=pc(t),i=t.ownerDocument.body,l=Xt(r.scrollWidth,r.clientWidth,i.scrollWidth,i.clientWidth),c=Xt(r.scrollHeight,r.clientHeight,i.scrollHeight,i.clientHeight);let f=-o.scrollLeft+hc(t);const h=-o.scrollTop;return kn(i).direction==="rtl"&&(f+=Xt(r.clientWidth,i.clientWidth)-l),{width:l,height:c,x:f,y:h}}const cy=25;function _T(t,r){const o=Qt(t),i=Wn(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=Sm();(!y||y&&r==="fixed")&&(h=l.offsetLeft,g=l.offsetTop)}const m=hc(i);if(m<=0){const y=i.ownerDocument,v=y.body,x=getComputedStyle(v),S=y.compatMode==="CSS1Compat"&&parseFloat(x.marginLeft)+parseFloat(x.marginRight)||0,T=Math.abs(i.clientWidth-v.clientWidth-S);T<=cy&&(c-=T)}else m<=cy&&(c+=m);return{width:c,height:f,x:h,y:g}}function NT(t,r){const o=wa(t,!0,r==="fixed"),i=o.top+t.clientTop,l=o.left+t.clientLeft,c=cr(t)?mo(t):zn(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 uy(t,r,o){let i;if(r==="viewport")i=_T(t,o);else if(r==="document")i=AT(Wn(t));else if(xn(r))i=NT(r,o);else{const l=vb(t);i={x:r.x-l.x,y:r.y-l.y,width:r.width,height:r.height}}return Yl(i)}function bb(t,r){const o=Yr(t);return o===r||!xn(o)||wo(o)?!1:kn(o).position==="fixed"||bb(o,r)}function jT(t,r){const o=r.get(t);if(o)return o;let i=Ws(t,[],!1).filter(h=>xn(h)&&No(h)!=="body"),l=null;const c=kn(t).position==="fixed";let f=c?Yr(t):t;for(;xn(f)&&!wo(f);){const h=kn(f),g=km(f);!g&&h.position==="fixed"&&(l=null),(c?!g&&!l:!g&&h.position==="static"&&!!l&&(l.position==="absolute"||l.position==="fixed")||$s(f)&&!g&&bb(t,f))?i=i.filter(y=>y!==f):l=h,f=Yr(f)}return r.set(t,i),i}function RT(t){let{element:r,boundary:o,rootBoundary:i,strategy:l}=t;const f=[...o==="clippingAncestors"?mc(r)?[]:jT(r,this._c):[].concat(o),i],h=uy(r,f[0],l);let g=h.top,m=h.right,y=h.bottom,v=h.left;for(let x=1;x<f.length;x++){const S=uy(r,f[x],l);g=Xt(S.top,g),m=Fr(S.right,m),y=Fr(S.bottom,y),v=Xt(S.left,v)}return{width:m-v,height:y-g,x:v,y:g}}function OT(t){const{width:r,height:o}=gb(t);return{width:r,height:o}}function DT(t,r,o){const i=cr(r),l=Wn(r),c=o==="fixed",f=wa(t,!0,c,r);let h={scrollLeft:0,scrollTop:0};const g=zn(0);function m(){g.x=hc(l)}if(i||!i&&!c)if((No(r)!=="body"||$s(l))&&(h=pc(r)),i){const S=wa(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?yb(l,h):zn(0),v=f.left+h.scrollLeft-g.x-y.x,x=f.top+h.scrollTop-g.y-y.y;return{x:v,y:x,width:f.width,height:f.height}}function Qd(t){return kn(t).position==="static"}function dy(t,r){if(!cr(t)||kn(t).position==="fixed")return null;if(r)return r(t);let o=t.offsetParent;return Wn(t)===o&&(o=o.ownerDocument.body),o}function wb(t,r){const o=Qt(t);if(mc(t))return o;if(!cr(t)){let l=Yr(t);for(;l&&!wo(l);){if(xn(l)&&!Qd(l))return l;l=Yr(l)}return o}let i=dy(t,r);for(;i&&bT(i)&&Qd(i);)i=dy(i,r);return i&&wo(i)&&Qd(i)&&!km(i)?o:i||kT(t)||o}const MT=async function(t){const r=this.getOffsetParent||wb,o=this.getDimensions,i=await o(t.floating);return{reference:DT(t.reference,await r(t.floating),t.strategy),floating:{x:0,y:0,width:i.width,height:i.height}}};function LT(t){return kn(t).direction==="rtl"}const zT={convertOffsetParentRelativeRectToViewportRelativeRect:CT,getDocumentElement:Wn,getClippingRect:RT,getOffsetParent:wb,getElementRects:MT,getClientRects:TT,getDimensions:OT,getScale:mo,isElement:xn,isRTL:LT};function xb(t,r){return t.x===r.x&&t.y===r.y&&t.width===r.width&&t.height===r.height}function HT(t,r){let o=null,i;const l=Wn(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:x,height:S}=m;if(h||r(),!x||!S)return;const T=xl(v),k=xl(l.clientWidth-(y+x)),E=xl(l.clientHeight-(v+S)),C=xl(y),j={rootMargin:-T+"px "+-k+"px "+-E+"px "+-C+"px",threshold:Xt(0,Fr(1,g))||1};let A=!0;function O(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&&!xb(m,t.getBoundingClientRect())&&f(),A=!1}try{o=new IntersectionObserver(O,{...j,root:l.ownerDocument})}catch{o=new IntersectionObserver(O,j)}o.observe(t)}return f(!0),c}function BT(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=Em(t),y=l||c?[...m?Ws(m):[],...r?Ws(r):[]]:[];y.forEach(C=>{l&&C.addEventListener("scroll",o,{passive:!0}),c&&C.addEventListener("resize",o)});const v=m&&h?HT(m,o):null;let x=-1,S=null;f&&(S=new ResizeObserver(C=>{let[_]=C;_&&_.target===m&&S&&r&&(S.unobserve(r),cancelAnimationFrame(x),x=requestAnimationFrame(()=>{var j;(j=S)==null||j.observe(r)})),o()}),m&&!g&&S.observe(m),r&&S.observe(r));let T,k=g?wa(t):null;g&&E();function E(){const C=wa(t);k&&!xb(k,C)&&o(),k=C,T=requestAnimationFrame(E)}return o(),()=>{var C;y.forEach(_=>{l&&_.removeEventListener("scroll",o),c&&_.removeEventListener("resize",o)}),v?.(),(C=S)==null||C.disconnect(),S=null,g&&cancelAnimationFrame(T)}}const WT=hT,UT=gT,qT=fT,IT=yT,PT=mT,fy=dT,KT=vT,FT=(t,r,o)=>{const i=new Map,l={platform:zT,...o},c={...l.platform,_c:i};return uT(t,r,{...l,platform:c})};var YT=typeof document<"u",VT=function(){},Rl=YT?b.useLayoutEffect:VT;function Vl(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(!Vl(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)&&!Vl(t[c],r[c]))return!1}return!0}return t!==t&&r!==r}function kb(t){return typeof window>"u"?1:(t.ownerDocument.defaultView||window).devicePixelRatio||1}function my(t,r){const o=kb(t);return Math.round(r*o)/o}function Jd(t){const r=b.useRef(t);return Rl(()=>{r.current=t}),r}function $T(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}),[x,S]=b.useState(i);Vl(x,i)||S(i);const[T,k]=b.useState(null),[E,C]=b.useState(null),_=b.useCallback(P=>{P!==D.current&&(D.current=P,k(P))},[]),j=b.useCallback(P=>{P!==L.current&&(L.current=P,C(P))},[]),A=c||T,O=f||E,D=b.useRef(null),L=b.useRef(null),B=b.useRef(y),q=g!=null,te=Jd(g),ee=Jd(l),V=Jd(m),J=b.useCallback(()=>{if(!D.current||!L.current)return;const P={placement:r,strategy:o,middleware:x};ee.current&&(P.platform=ee.current),FT(D.current,L.current,P).then(Z=>{const K={...Z,isPositioned:V.current!==!1};X.current&&!Vl(B.current,K)&&(B.current=K,dc.flushSync(()=>{v(K)}))})},[x,r,o,ee,V]);Rl(()=>{m===!1&&B.current.isPositioned&&(B.current.isPositioned=!1,v(P=>({...P,isPositioned:!1})))},[m]);const X=b.useRef(!1);Rl(()=>(X.current=!0,()=>{X.current=!1}),[]),Rl(()=>{if(A&&(D.current=A),O&&(L.current=O),A&&O){if(te.current)return te.current(A,O,J);J()}},[A,O,J,te,q]);const $=b.useMemo(()=>({reference:D,floating:L,setReference:_,setFloating:j}),[_,j]),M=b.useMemo(()=>({reference:A,floating:O}),[A,O]),I=b.useMemo(()=>{const P={position:o,left:0,top:0};if(!M.floating)return P;const Z=my(M.floating,y.x),K=my(M.floating,y.y);return h?{...P,transform:"translate("+Z+"px, "+K+"px)",...kb(M.floating)>=1.5&&{willChange:"transform"}}:{position:o,left:Z,top:K}},[o,h,M.floating,y.x,y.y]);return b.useMemo(()=>({...y,update:J,refs:$,elements:M,floatingStyles:I}),[y,J,$,M,I])}const GT=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?fy({element:i.current,padding:l}).fn(o):{}:i?fy({element:i,padding:l}).fn(o):{}}}},XT=(t,r)=>{const o=WT(t);return{name:o.name,fn:o.fn,options:[t,r]}},ZT=(t,r)=>{const o=UT(t);return{name:o.name,fn:o.fn,options:[t,r]}},QT=(t,r)=>({fn:KT(t).fn,options:[t,r]}),JT=(t,r)=>{const o=qT(t);return{name:o.name,fn:o.fn,options:[t,r]}},eA=(t,r)=>{const o=IT(t);return{name:o.name,fn:o.fn,options:[t,r]}},tA=(t,r)=>{const o=PT(t);return{name:o.name,fn:o.fn,options:[t,r]}},nA=(t,r)=>{const o=GT(t);return{name:o.name,fn:o.fn,options:[t,r]}};var rA="Arrow",Sb=b.forwardRef((t,r)=>{const{children:o,width:i=10,height:l=5,...c}=t;return u.jsx(Wt.svg,{...c,ref:r,width:i,height:l,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:t.asChild?o:u.jsx("polygon",{points:"0,0 30,0 15,10"})})});Sb.displayName=rA;var aA=Sb;function oA(t){const[r,o]=b.useState(void 0);return Kr(()=>{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 Cm="Popper",[Eb,Cb]=vm(Cm),[sA,Tb]=Eb(Cm),Ab=t=>{const{__scopePopper:r,children:o}=t,[i,l]=b.useState(null);return u.jsx(sA,{scope:r,anchor:i,onAnchorChange:l,children:o})};Ab.displayName=Cm;var _b="PopperAnchor",Nb=b.forwardRef((t,r)=>{const{__scopePopper:o,virtualRef:i,...l}=t,c=Tb(_b,o),f=b.useRef(null),h=Sn(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:u.jsx(Wt.div,{...l,ref:h})});Nb.displayName=_b;var Tm="PopperContent",[iA,lA]=Eb(Tm),jb=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:x=!1,updatePositionStrategy:S="optimized",onPlaced:T,...k}=t,E=Tb(Tm,o),[C,_]=b.useState(null),j=Sn(r,ce=>_(ce)),[A,O]=b.useState(null),D=oA(A),L=D?.width??0,B=D?.height??0,q=i+(c!=="center"?"-"+c:""),te=typeof y=="number"?y:{top:0,right:0,bottom:0,left:0,...y},ee=Array.isArray(m)?m:[m],V=ee.length>0,J={padding:te,boundary:ee.filter(uA),altBoundary:V},{refs:X,floatingStyles:$,placement:M,isPositioned:I,middlewareData:P}=$T({strategy:"fixed",placement:q,whileElementsMounted:(...ce)=>BT(...ce,{animationFrame:S==="always"}),elements:{reference:E.anchor},middleware:[XT({mainAxis:l+B,alignmentAxis:f}),g&&ZT({mainAxis:!0,crossAxis:!1,limiter:v==="partial"?QT():void 0,...J}),g&&JT({...J}),eA({...J,apply:({elements:ce,rects:le,availableWidth:ie,availableHeight:ue})=>{const{width:pe,height:Ae}=le.reference,Ce=ce.floating.style;Ce.setProperty("--radix-popper-available-width",`${ie}px`),Ce.setProperty("--radix-popper-available-height",`${ue}px`),Ce.setProperty("--radix-popper-anchor-width",`${pe}px`),Ce.setProperty("--radix-popper-anchor-height",`${Ae}px`)}}),A&&nA({element:A,padding:h}),dA({arrowWidth:L,arrowHeight:B}),x&&tA({strategy:"referenceHidden",...J})]}),[Z,K]=Db(M),R=bo(T);Kr(()=>{I&&R?.()},[I,R]);const W=P.arrow?.x,re=P.arrow?.y,ae=P.arrow?.centerOffset!==0,[fe,me]=b.useState();return Kr(()=>{C&&me(window.getComputedStyle(C).zIndex)},[C]),u.jsx("div",{ref:X.setFloating,"data-radix-popper-content-wrapper":"",style:{...$,transform:I?$.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:fe,"--radix-popper-transform-origin":[P.transformOrigin?.x,P.transformOrigin?.y].join(" "),...P.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:t.dir,children:u.jsx(iA,{scope:o,placedSide:Z,onArrowChange:O,arrowX:W,arrowY:re,shouldHideArrow:ae,children:u.jsx(Wt.div,{"data-side":Z,"data-align":K,...k,ref:j,style:{...k.style,animation:I?void 0:"none"}})})})});jb.displayName=Tm;var Rb="PopperArrow",cA={top:"bottom",right:"left",bottom:"top",left:"right"},Ob=b.forwardRef(function(r,o){const{__scopePopper:i,...l}=r,c=lA(Rb,i),f=cA[c.placedSide];return u.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:u.jsx(aA,{...l,ref:o,style:{...l.style,display:"block"}})})});Ob.displayName=Rb;function uA(t){return t!==null}var dA=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]=Db(o),v={start:"0%",center:"50%",end:"100%"}[y],x=(l.arrow?.x??0)+h/2,S=(l.arrow?.y??0)+g/2;let T="",k="";return m==="bottom"?(T=f?v:`${x}px`,k=`${-g}px`):m==="top"?(T=f?v:`${x}px`,k=`${i.floating.height+g}px`):m==="right"?(T=`${-g}px`,k=f?v:`${S}px`):m==="left"&&(T=`${i.floating.width+g}px`,k=f?v:`${S}px`),{data:{x:T,y:k}}}});function Db(t){const[r,o="center"]=t.split("-");return[r,o]}var fA=Ab,mA=Nb,pA=jb,hA=Ob,gA="Portal",Am=b.forwardRef((t,r)=>{const{container:o,...i}=t,[l,c]=b.useState(!1);Kr(()=>c(!0),[]);const f=o||l&&globalThis?.document?.body;return f?LC.createPortal(u.jsx(Wt.div,{...i,ref:r}),f):null});Am.displayName=gA;function vA(t,r){return b.useReducer((o,i)=>r[o][i]??o,t)}var jo=t=>{const{present:r,children:o}=t,i=yA(r),l=typeof o=="function"?o({present:i.isPresent}):b.Children.only(o),c=Sn(i.ref,bA(l));return typeof o=="function"||i.isPresent?b.cloneElement(l,{ref:c}):null};jo.displayName="Presence";function yA(t){const[r,o]=b.useState(),i=b.useRef(null),l=b.useRef(t),c=b.useRef("none"),f=t?"mounted":"unmounted",[h,g]=vA(f,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return b.useEffect(()=>{const m=kl(i.current);c.current=h==="mounted"?m:"none"},[h]),Kr(()=>{const m=i.current,y=l.current;if(y!==t){const x=c.current,S=kl(m);t?g("MOUNT"):S==="none"||m?.display==="none"?g("UNMOUNT"):g(y&&x!==S?"ANIMATION_OUT":"UNMOUNT"),l.current=t}},[t,g]),Kr(()=>{if(r){let m;const y=r.ownerDocument.defaultView??window,v=S=>{const k=kl(i.current).includes(CSS.escape(S.animationName));if(S.target===r&&k&&(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)})}},x=S=>{S.target===r&&(c.current=kl(i.current))};return r.addEventListener("animationstart",x),r.addEventListener("animationcancel",v),r.addEventListener("animationend",v),()=>{y.clearTimeout(m),r.removeEventListener("animationstart",x),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 kl(t){return t?.animationName||"none"}function bA(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 wA=D0[" useInsertionEffect ".trim().toString()]||Kr;function Mb({prop:t,defaultProp:r,onChange:o=()=>{},caller:i}){const[l,c,f]=xA({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=kA(y)?y(t):y;v!==t&&f.current?.(v)}else c(y)},[h,t,c,f]);return[g,m]}function xA({defaultProp:t,onChange:r}){const[o,i]=b.useState(t),l=b.useRef(o),c=b.useRef(r);return wA(()=>{c.current=r},[r]),b.useEffect(()=>{l.current!==o&&(c.current?.(o),l.current=o)},[o,l]),[o,i,c]}function kA(t){return typeof t=="function"}var SA=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"}),EA="VisuallyHidden",Lb=b.forwardRef((t,r)=>u.jsx(Wt.span,{...t,ref:r,style:{...SA,...t.style}}));Lb.displayName=EA;var CA=Lb,[gc]=vm("Tooltip",[Cb]),vc=Cb(),zb="TooltipProvider",TA=700,Bf="tooltip.open",[AA,_m]=gc(zb),Hb=t=>{const{__scopeTooltip:r,delayDuration:o=TA,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)},[]),u.jsx(AA,{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})};Hb.displayName=zb;var Us="Tooltip",[_A,Gs]=gc(Us),Bb=t=>{const{__scopeTooltip:r,children:o,open:i,defaultOpen:l,onOpenChange:c,disableHoverableContent:f,delayDuration:h}=t,g=_m(Us,t.__scopeTooltip),m=vc(r),[y,v]=b.useState(null),x=jl(),S=b.useRef(0),T=f??g.disableHoverableContent,k=h??g.delayDuration,E=b.useRef(!1),[C,_]=Mb({prop:i,defaultProp:l??!1,onChange:L=>{L?(g.onOpen(),document.dispatchEvent(new CustomEvent(Bf))):g.onClose(),c?.(L)},caller:Us}),j=b.useMemo(()=>C?E.current?"delayed-open":"instant-open":"closed",[C]),A=b.useCallback(()=>{window.clearTimeout(S.current),S.current=0,E.current=!1,_(!0)},[_]),O=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},k)},[k,_]);return b.useEffect(()=>()=>{S.current&&(window.clearTimeout(S.current),S.current=0)},[]),u.jsx(fA,{...m,children:u.jsx(_A,{scope:r,contentId:x,open:C,stateAttribute:j,trigger:y,onTriggerChange:v,onTriggerEnter:b.useCallback(()=>{g.isOpenDelayedRef.current?D():A()},[g.isOpenDelayedRef,D,A]),onTriggerLeave:b.useCallback(()=>{T?O():(window.clearTimeout(S.current),S.current=0)},[O,T]),onOpen:A,onClose:O,disableHoverableContent:T,children:o})})};Bb.displayName=Us;var Wf="TooltipTrigger",Wb=b.forwardRef((t,r)=>{const{__scopeTooltip:o,...i}=t,l=Gs(Wf,o),c=_m(Wf,o),f=vc(o),h=b.useRef(null),g=Sn(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]),u.jsx(mA,{asChild:!0,...f,children:u.jsx(Wt.button,{"aria-describedby":l.open?l.contentId:void 0,"data-state":l.stateAttribute,...i,ref:g,onPointerMove:zt(t.onPointerMove,x=>{x.pointerType!=="touch"&&!y.current&&!c.isPointerInTransitRef.current&&(l.onTriggerEnter(),y.current=!0)}),onPointerLeave:zt(t.onPointerLeave,()=>{l.onTriggerLeave(),y.current=!1}),onPointerDown:zt(t.onPointerDown,()=>{l.open&&l.onClose(),m.current=!0,document.addEventListener("pointerup",v,{once:!0})}),onFocus:zt(t.onFocus,()=>{m.current||l.onOpen()}),onBlur:zt(t.onBlur,l.onClose),onClick:zt(t.onClick,l.onClose)})})});Wb.displayName=Wf;var Nm="TooltipPortal",[NA,jA]=gc(Nm,{forceMount:void 0}),Ub=t=>{const{__scopeTooltip:r,forceMount:o,children:i,container:l}=t,c=Gs(Nm,r);return u.jsx(NA,{scope:r,forceMount:o,children:u.jsx(jo,{present:o||c.open,children:u.jsx(Am,{asChild:!0,container:l,children:i})})})};Ub.displayName=Nm;var xo="TooltipContent",qb=b.forwardRef((t,r)=>{const o=jA(xo,t.__scopeTooltip),{forceMount:i=o.forceMount,side:l="top",...c}=t,f=Gs(xo,t.__scopeTooltip);return u.jsx(jo,{present:i||f.open,children:f.disableHoverableContent?u.jsx(Ib,{side:l,...c,ref:r}):u.jsx(RA,{side:l,...c,ref:r})})}),RA=b.forwardRef((t,r)=>{const o=Gs(xo,t.__scopeTooltip),i=_m(xo,t.__scopeTooltip),l=b.useRef(null),c=Sn(r,l),[f,h]=b.useState(null),{trigger:g,onClose:m}=o,y=l.current,{onPointerInTransitChange:v}=i,x=b.useCallback(()=>{h(null),v(!1)},[v]),S=b.useCallback((T,k)=>{const E=T.currentTarget,C={x:T.clientX,y:T.clientY},_=zA(C,E.getBoundingClientRect()),j=HA(C,_),A=BA(k.getBoundingClientRect()),O=UA([...j,...A]);h(O),v(!0)},[v]);return b.useEffect(()=>()=>x(),[x]),b.useEffect(()=>{if(g&&y){const T=E=>S(E,y),k=E=>S(E,g);return g.addEventListener("pointerleave",T),y.addEventListener("pointerleave",k),()=>{g.removeEventListener("pointerleave",T),y.removeEventListener("pointerleave",k)}}},[g,y,S,x]),b.useEffect(()=>{if(f){const T=k=>{const E=k.target,C={x:k.clientX,y:k.clientY},_=g?.contains(E)||y?.contains(E),j=!WA(C,f);_?x():j&&(x(),m())};return document.addEventListener("pointermove",T),()=>document.removeEventListener("pointermove",T)}},[g,y,f,m,x]),u.jsx(Ib,{...t,ref:c})}),[OA,DA]=gc(Us,{isInside:!1}),MA=HC("TooltipContent"),Ib=b.forwardRef((t,r)=>{const{__scopeTooltip:o,children:i,"aria-label":l,onEscapeKeyDown:c,onPointerDownOutside:f,...h}=t,g=Gs(xo,o),m=vc(o),{onClose:y}=g;return b.useEffect(()=>(document.addEventListener(Bf,y),()=>document.removeEventListener(Bf,y)),[y]),b.useEffect(()=>{if(g.trigger){const v=x=>{x.target?.contains(g.trigger)&&y()};return window.addEventListener("scroll",v,{capture:!0}),()=>window.removeEventListener("scroll",v,{capture:!0})}},[g.trigger,y]),u.jsx(ym,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:c,onPointerDownOutside:f,onFocusOutside:v=>v.preventDefault(),onDismiss:y,children:u.jsxs(pA,{"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:[u.jsx(MA,{children:i}),u.jsx(OA,{scope:o,isInside:!0,children:u.jsx(CA,{id:g.contentId,role:"tooltip",children:l||i})})]})})});qb.displayName=xo;var Pb="TooltipArrow",LA=b.forwardRef((t,r)=>{const{__scopeTooltip:o,...i}=t,l=vc(o);return DA(Pb,o).isInside?null:u.jsx(hA,{...l,...i,ref:r})});LA.displayName=Pb;function zA(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 HA(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 BA(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 WA(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,x=g.y;y>i!=x>i&&o<(v-m)*(i-y)/(x-y)+m&&(l=!l)}return l}function UA(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),qA(r)}function qA(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 Kb=Hb,IA=Bb,PA=Wb,KA=Ub,FA=qb;const lt=({children:t,label:r,side:o="top",align:i="center"})=>r?u.jsx(Kb,{delayDuration:250,skipDelayDuration:150,children:u.jsxs(IA,{children:[u.jsx(PA,{asChild:!0,children:t}),u.jsx(KA,{children:u.jsx(FA,{className:"tooltip",side:o,align:i,sideOffset:6,children:r})})]})}):u.jsx(u.Fragment,{children:t}),Fb=b.createContext(null),Yb=b.createContext([]),ef=3,YA=t=>t==="success"?3e3:t==="warning"?5e3:0;let py=0;const VA=()=>(py+=1,`t-${py.toString(36)}-${Date.now().toString(36)}`),$A=({children:t})=>{const[r,o]=b.useState([]),i=b.useRef(new Map),l=b.useCallback(v=>{const x=i.current.get(v);x?.timer&&clearTimeout(x.timer),i.current.delete(v)},[]),c=b.useCallback(v=>{o(x=>x.filter(S=>S.id!==v)),l(v)},[l]),f=b.useCallback(({kind:v,message:x,durationMs:S})=>{const T=VA();o(E=>{const C=[...E,{id:T,kind:v,message:x}];if(C.length<=ef)return C;const _=C.slice(0,C.length-ef);for(const j of _)l(j.id);return C.slice(C.length-ef)});const k=S??YA(v);if(k>0){const E=setTimeout(()=>c(T),k);i.current.set(T,{timer:E,dueAt:Date.now()+k,durationMs:k,remainingMs:k})}return T},[c,l]),h=b.useCallback(v=>{const x=i.current.get(v);x?.timer&&(clearTimeout(x.timer),i.current.set(v,{...x,timer:null,remainingMs:Math.max(0,x.dueAt-Date.now())}))},[]),g=b.useCallback(v=>{const x=i.current.get(v);if(!x||x.timer||x.remainingMs<=0)return;const S=setTimeout(()=>c(v),x.remainingMs);i.current.set(v,{...x,timer:S,dueAt:Date.now()+x.remainingMs})},[c]),m=b.useCallback(v=>i.current.get(v)?.durationMs??0,[]);b.useEffect(()=>{const v=i.current;return()=>{for(const x of v.values())x.timer&&clearTimeout(x.timer);v.clear()}},[]);const y=b.useMemo(()=>({show:f,dismiss:c,pauseDismiss:h,resumeDismiss:g,getDuration:m}),[f,c,h,g,m]);return u.jsx(Fb.Provider,{value:y,children:u.jsx(Yb.Provider,{value:r,children:t})})},Jt=()=>{const t=b.useContext(Fb);if(!t)throw new Error("useToast must be used within ToastProvider");return t},GA=()=>b.useContext(Yb),XA=2e3,tf=()=>document.visibilityState==="hidden",ZA=(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)})},QA={cancelled:"actionCenter.activity.cancelled",queued:"actionCenter.activity.queued",reported:"actionCenter.activity.reported",submitted:"actionCenter.activity.submitted"},jm=(t,r)=>{const o=t.toWorkerName??r("actionCenter.unknownWorker");return r(QA[t.kind],{ago:ZA(t.timestamp,r),worker:o})},Vb=t=>t.reportPreview??t.taskPreview??t.label??t.phase,JA=t=>t.currentDispatch?.taskPreview??t.latestReport?.reportPreview??t.terminalHint??null,e_=(t,r)=>t.currentDispatch?r("actionCenter.currentDispatch"):t.latestReport?r("actionCenter.latestReport"):t.terminalHint?r("actionCenter.terminalHint"):r("actionCenter.workerStatus"),hy=(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"}),gy=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,$b=t=>{const[r,o]=b.useState(null),[i,l]=b.useState(!1),c=b.useCallback(async f=>jC(t,f?{signal:f}:void 0),[t]);return b.useEffect(()=>{let f=!1,h=!1,g=null,m=null;const y=async()=>{if(!(f||h||tf())){h=!0,m=new AbortController;try{const x=await c(m.signal);if(f)return;o(x),l(!1)}catch{f||l(!0)}finally{m=null,h=!1}!f&&!tf()&&(g=setTimeout(y,XA))}},v=()=>{f||tf()||(g&&(clearTimeout(g),g=null),y())};return document.addEventListener("visibilitychange",v),y(),()=>{f=!0,m?.abort(),g&&clearTimeout(g),document.removeEventListener("visibilitychange",v)}},[c]),{error:i,summary:r}},Gb=t=>{const{t:r}=ke(),o=Jt(),[i,l]=b.useState(!1);return{copyingRecap:i,handleCopyRecap:()=>{if(i)return;l(!0);const f=RC(t).then(h=>h.markdown);sb(f).then(()=>o.show({kind:"success",message:r("actionCenter.recapCopied")})).catch(()=>o.show({kind:"error",message:r("actionCenter.recapCopyFailed")})).finally(()=>l(!1))}}},Rm=t=>{const r=t?.recentActivity[0]??null,o=r?Vb(r):null,i=t?.summary.stoppedWithQueue??0,l=t?.summary.waitingReports??0,c=t?.attention.slice(0,5)??[],f=t?.workers.filter(g=>g.currentDispatch||g.latestReport||g.terminalHint||g.pendingTaskCount>0||g.status==="working").slice(0,6)??[],h=t?.recentActivity.slice(0,6)??[];return{attention:c,evidenceWorkers:f,latest:r,latestDetail:o,recentActivity:h,stoppedWithQueue:i,waitingReports:l}},Xb=({copyingRecap:t,onCopyRecap:r,onOpenWorker:o,summary:i})=>{const{t:l}=ke(),{attention:c,evidenceWorkers:f,recentActivity:h}=Rm(i);return u.jsxs("div",{className:"mt-2 grid gap-2 md:grid-cols-2","data-testid":"action-center-evidence",children:[u.jsx("div",{className:"flex min-w-0 justify-end md:col-span-2",children:u.jsxs("button",{type:"button",onClick:r,disabled:t,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:[u.jsx(sc,{size:12,"aria-hidden":!0}),l("actionCenter.copyRecap")]})}),c.length>0?u.jsxs("div",{className:"min-w-0 md:col-span-2",children:[u.jsx("div",{className:"mb-1 text-[11px] font-semibold uppercase tracking-wide text-ter",children:l("actionCenter.attention")}),u.jsx("ul",{className:"flex flex-col gap-px rounded border border-bright/40 bg-0",children:c.map(g=>u.jsx("li",{children:u.jsxs("div",{className:"flex min-w-0 items-center gap-2 px-2 py-1.5 text-xs","data-testid":`action-center-attention-${gy(g)}`,children:[u.jsx("span",{className:"inline-block h-1.5 w-1.5 shrink-0 rounded-full",style:{background:g.severity==="error"?"var(--status-red)":g.severity==="warning"?"var(--status-orange)":"var(--text-tertiary)"},"aria-hidden":!0}),u.jsx("span",{className:"min-w-0 truncate text-sec",title:hy(g,l),children:hy(g,l)})]})},gy(g)))})]}):null,u.jsxs("div",{className:"min-w-0",children:[u.jsx("div",{className:"mb-1 text-[11px] font-semibold uppercase tracking-wide text-ter",children:l("actionCenter.recent")}),h.length>0?u.jsx("ul",{className:"flex max-h-36 flex-col gap-px overflow-auto rounded border border-bright/40 bg-0",children:h.map(g=>{const m=Vb(g);return u.jsx("li",{children:u.jsxs("button",{type:"button",onClick:()=>o?.(g.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:!o,"data-testid":`action-center-activity-${g.id}`,children:[u.jsx("span",{className:"shrink-0 text-sec",children:jm(g,l)}),m?u.jsx("span",{className:"min-w-0 truncate text-ter",title:m,children:m}):null]})},g.id)})}):u.jsx("div",{className:"rounded border border-dashed border-bright/40 px-2 py-2 text-xs text-ter",children:l("actionCenter.noActivity")})]}),u.jsxs("div",{className:"min-w-0",children:[u.jsx("div",{className:"mb-1 text-[11px] font-semibold uppercase tracking-wide text-ter",children:l("actionCenter.workers")}),f.length>0?u.jsx("ul",{className:"flex max-h-36 flex-col gap-px overflow-auto rounded border border-bright/40 bg-0",children:f.map(g=>{const m=JA(g);return u.jsx("li",{children:u.jsxs("button",{type:"button",onClick:()=>o?.(g.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:!o,"data-testid":`action-center-worker-${g.id}`,children:[u.jsx("span",{className:"min-w-0 flex-1 truncate text-sec",children:g.name}),u.jsxs("span",{className:"shrink-0 text-ter",children:[e_(g,l),g.pendingTaskCount>0?` · ${l("worker.queued",{count:g.pendingTaskCount})}`:""]}),m?u.jsx("span",{className:"min-w-0 flex-[1.4] truncate text-ter",title:m,children:m}):null]})},g.id)})}):u.jsx("div",{className:"rounded border border-dashed border-bright/40 px-2 py-2 text-xs text-ter",children:l("actionCenter.noWorkerEvidence")})]})]})},t_=({onOpenWorker:t,workspaceId:r})=>{const{t:o}=ke(),{error:i,summary:l}=$b(r),{copyingRecap:c,handleCopyRecap:f}=Gb(r),[h,g]=b.useState(!1),m=b.useRef(null),{latest:y,latestDetail:v,stoppedWithQueue:x,waitingReports:S}=Rm(l),T=x+S;return b.useEffect(()=>{if(!h)return;const k=C=>{C.key==="Escape"&&g(!1)},E=C=>{const _=m.current;_&&!_.contains(C.target)&&g(!1)};return document.addEventListener("keydown",k),document.addEventListener("pointerdown",E),()=>{document.removeEventListener("keydown",k),document.removeEventListener("pointerdown",E)}},[h]),u.jsxs("div",{ref:m,className:"relative",children:[u.jsx(lt,{label:o(h?"actionCenter.collapse":"actionCenter.expand"),children:u.jsxs("button",{type:"button",onClick:()=>g(k=>!k),"aria-expanded":h,"aria-haspopup":"dialog","aria-label":o(h?"actionCenter.collapse":"actionCenter.expand"),"data-testid":"topbar-action-center",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)]",style:{borderColor:"var(--border)",background:"var(--bg-1)"},children:[u.jsx(Wl,{size:13,"aria-hidden":!0}),u.jsx("span",{children:o("actionCenter.title")}),l&&l.summary.workingWorkers>0?u.jsx("span",{className:"mono rounded bg-3 px-1 text-[11px] text-accent",children:l.summary.workingWorkers}):null,T>0?u.jsx("span",{className:"mono rounded px-1 text-[11px]",style:{background:"color-mix(in oklab, var(--status-orange) 15%, transparent)",color:"var(--status-orange)"},children:T}):null]})}),h?u.jsxs("div",{role:"dialog","aria-label":o("actionCenter.title"),className:"elev-2 absolute top-8 right-0 z-50 w-[min(560px,calc(100vw-24px))] rounded border p-3","data-testid":"action-center-popover",style:{background:"var(--bg-elevated)",borderColor:"var(--border-bright)"},children:[u.jsxs("div",{className:"flex min-w-0 flex-wrap items-center gap-2",children:[u.jsxs("span",{className:"inline-flex items-center gap-1.5 text-xs font-semibold uppercase tracking-wide text-ter",children:[u.jsx(Wl,{size:13,"aria-hidden":!0}),o("actionCenter.title")]}),u.jsx("span",{className:"pill pill--green",children:o("actionCenter.runningCount",{count:l?.summary.workingWorkers??0})}),u.jsx("span",{className:"pill pill--ghost",children:o("actionCenter.openCount",{count:l?.summary.openDispatches??0})}),u.jsx("span",{className:"pill pill--ghost",children:o("actionCenter.reportCount",{count:l?.summary.recentReports??0})})]}),u.jsx("div",{className:"mt-2 flex min-w-0 items-center gap-1.5 text-xs text-sec",children:i?u.jsx("span",{style:{color:"var(--text-error)"},children:o("actionCenter.loadFailed")}):y?u.jsxs(u.Fragment,{children:[u.jsx("span",{className:"shrink-0 text-ter",children:jm(y,o)}),v?u.jsxs("span",{className:"min-w-0 truncate text-ter",title:v,children:["· ",v]}):null]}):u.jsx("span",{className:"text-ter",children:o(l?"actionCenter.noActivity":"actionCenter.loading")})}),l?u.jsx(Xb,{copyingRecap:c,onCopyRecap:f,onOpenWorker:t,summary:l}):null]}):null]})},n_=({onOpenWorker:t,workspaceId:r})=>{const{t:o}=ke(),{error:i,summary:l}=$b(r),{copyingRecap:c,handleCopyRecap:f}=Gb(r),[h,g]=b.useState(!1),{latest:m,latestDetail:y,stoppedWithQueue:v,waitingReports:x}=Rm(l);return u.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:[u.jsxs("div",{className:"flex min-w-0 flex-wrap items-center gap-2",children:[u.jsxs("button",{type:"button",onClick:()=>g(S=>!S),"aria-expanded":h,"aria-label":o(h?"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:[h?u.jsx(Co,{size:13,"aria-hidden":!0}):u.jsx(oc,{size:13,"aria-hidden":!0}),u.jsx(Wl,{size:13,"aria-hidden":!0}),o("actionCenter.title")]}),u.jsx("span",{className:"pill pill--green",children:o("actionCenter.runningCount",{count:l?.summary.workingWorkers??0})}),u.jsx("span",{className:"pill pill--ghost",children:o("actionCenter.openCount",{count:l?.summary.openDispatches??0})}),u.jsx("span",{className:"pill pill--ghost",children:o("actionCenter.reportCount",{count:l?.summary.recentReports??0})}),v>0?u.jsxs("span",{className:"pill",style:{background:"color-mix(in oklab, var(--status-orange) 15%, transparent)",color:"var(--status-orange)"},children:[u.jsx(lc,{size:11,"aria-hidden":!0}),o("actionCenter.stoppedWithQueue",{count:v})]}):null,x>0?u.jsx("span",{className:"pill pill--ghost",children:o("actionCenter.waitingReports",{count:x})}):null]}),u.jsx("div",{className:"mt-1 flex min-w-0 items-center gap-1.5 text-xs text-sec",children:i?u.jsx("span",{style:{color:"var(--text-error)"},children:o("actionCenter.loadFailed")}):m?u.jsxs(u.Fragment,{children:[u.jsx("span",{className:"shrink-0 text-ter",children:jm(m,o)}),y?u.jsxs("span",{className:"min-w-0 truncate text-ter",title:y,children:["· ",y]}):null]}):u.jsx("span",{className:"text-ter",children:o(l?"actionCenter.noActivity":"actionCenter.loading")})}),h&&l?u.jsx(Xb,{copyingRecap:c,onCopyRecap:f,onOpenWorker:t,summary:l}):null]})};let $l=!1;const Uf=new Set,r_=()=>$l,Zb=t=>{if($l!==t){$l=t;for(const r of Uf)r()}},a_=()=>{Zb(!$l)},o_=t=>(Uf.add(t),()=>Uf.delete(t)),Qb=()=>b.useSyncExternalStore(o_,r_,()=>!1),vy="(max-width: 767px)",Jb=b.createContext({mode:"wide"}),nf={mode:"wide"},s_={mode:"mobile"},i_=(t=typeof window<"u"?window.matchMedia.bind(window):void 0)=>{const r=i=>{if(!t)return()=>{};const l=t(vy);return l.addEventListener?.("change",i),()=>l.removeEventListener?.("change",i)},o=()=>t&&t(vy).matches?s_:nf;return b.useSyncExternalStore(r,o,()=>nf)},l_=({children:t,value:r})=>{const o=i_();return u.jsx(Jb.Provider,{value:r??o,children:t})},ew=()=>b.useContext(Jb),At=()=>ew().mode==="mobile",tw="hive.notification.settings",so={desktop:!1,detail:"brief",sound:"soft"},c_={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"},u_=t=>t==="off"||t==="ping"||t==="chime"||t==="soft"||t==="cascade"||t==="beacon"||t==="resolve",d_=()=>{if(typeof window>"u")return so;try{const t=window.localStorage.getItem(tw);if(!t)return so;const r=JSON.parse(t);return{desktop:typeof r.desktop=="boolean"?r.desktop:so.desktop,detail:r.detail==="detailed"?"detailed":so.detail,sound:u_(r.sound)?r.sound:so.sound}}catch{return so}},f_=t=>{try{window.localStorage.setItem(tw,JSON.stringify(t))}catch{}},yy=t=>{if(!(t==="off"||typeof window>"u"))try{const r=new window.Audio(c_[t]);r.preload="auto",r.volume=.72,r.play()?.catch(()=>{})}catch{}},nw=b.createContext(null),m_=({children:t})=>{const r=Jt(),{t:o}=ke(),[i,l]=b.useState(()=>d_());b.useEffect(()=>{f_(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:x,title:S})=>{const T=i.detail==="detailed"&&v?v:y;if(r.show({kind:x,message:T}),yy(i.sound),i.desktop&&typeof window<"u"&&"Notification"in window&&window.Notification.permission==="granted")try{new window.Notification(S,{body:T})}catch{}},[i,r]),g=b.useCallback(y=>{yy(y)},[]),m=b.useMemo(()=>({notify:h,previewSound:g,requestDesktopNotifications:f,settings:i,updateSettings:c}),[h,g,f,i,c]);return u.jsx(nw.Provider,{value:m,children:t})},yc=()=>{const t=b.useContext(nw);if(!t)throw new Error("useNotifications must be used within NotificationProvider");return t},p_={coder:"role.coder",custom:"role.custom",reviewer:"role.reviewer",sentinel:"role.sentinel",tester:"role.tester"},h_=t=>new Map(t.map(r=>[r.id,{id:r.id,name:r.name,pendingTaskCount:r.pendingTaskCount,role:r.role,status:r.status}])),g_=({terminalRuns:t,workers:r,workspace:o})=>{const{notify:i}=yc(),{t:l}=ke(),c=b.useRef(null);return b.useEffect(()=>{if(!o){c.current=null;return}const f=h_(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(p_[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},v_=({tabs:t,activeId:r,onSelect:o,onClose:i,onClosePanel:l,onNewShell:c,newShellPending:f})=>{const{t:h}=ke();return u.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=x=>{x.stopPropagation(),i(g.id)};return u.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?u.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,u.jsxs("button",{type:"button","data-testid":`terminal-tab-select-${g.id}`,onClick:x=>{x.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:[u.jsx(hm,{size:12,"aria-hidden":!0}),u.jsx("span",{className:"truncate",children:g.label})]}),u.jsx(lt,{label:y,children:u.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:u.jsx(vo,{size:12,"aria-hidden":!0})})})]},g.id)}),u.jsxs("div",{className:"flex flex-1 items-center justify-end gap-1 px-2",children:[u.jsx(lt,{label:h("terminalPanel.closePanel"),children:u.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:u.jsx(vo,{size:12,"aria-hidden":!0})})}),u.jsx(lt,{label:h("terminalPanel.newShell"),children:u.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?u.jsx(To,{size:12,className:"animate-spin","aria-hidden":!0}):u.jsx(Ds,{size:12,"aria-hidden":!0})})})]})]})},rw="hive.terminal-panel.height",aw="hive.terminal-panel.collapsed",qf=160,y_=.35,b_=160,Ms=t=>{const r=typeof window<"u"?window.innerHeight:800,o=Math.max(qf,r-b_);return Math.min(Math.max(t,qf),o)},rf=()=>{const t=typeof window<"u"?window.innerHeight:800;return Ms(Math.floor(t*y_))},w_=()=>{try{const t=window.localStorage.getItem(rw);if(!t)return rf();const r=Number.parseInt(t,10);return Number.isFinite(r)?Ms(r):rf()}catch{return rf()}},x_=()=>{try{return window.localStorage.getItem(aw)==="1"}catch{return!1}},k_=()=>{const[t,r]=b.useState(()=>w_()),[o,i]=b.useState(()=>x_()),[l,c]=b.useState(!1);b.useEffect(()=>{try{window.localStorage.setItem(rw,String(Math.round(t)))}catch{}},[t]),b.useEffect(()=>{try{window.localStorage.setItem(aw,o?"1":"0")}catch{}},[o]),b.useEffect(()=>{const m=()=>r(y=>Ms(y));return window.addEventListener("resize",m),()=>window.removeEventListener("resize",m)},[]);const f=b.useCallback(m=>r(Ms(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 x=document.body.style.cursor,S=document.body.style.userSelect;document.body.style.cursor="ns-resize",document.body.style.userSelect="none";const T=E=>{const C=E.clientY-y;r(Ms(v-C))},k=()=>{c(!1),document.body.style.cursor=x,document.body.style.userSelect=S,document.removeEventListener("pointermove",T),document.removeEventListener("pointerup",k),document.removeEventListener("pointercancel",k)};document.addEventListener("pointermove",T),document.addEventListener("pointerup",k),document.addEventListener("pointercancel",k)},[t]);return{height:t,collapsed:o,dragging:l,setHeight:f,setCollapsed:h,beginDrag:g}},S_=(t,r)=>r?t.find(o=>o.id===r)??null:null,E_=({tabs:t,activeId:r,onSelect:o,onClose:i,onClosePanel:l,onNewShell:c,newShellPending:f,onStartWorker:h,startingWorkerId:g})=>{const{t:m}=ke(),y=k_(),v=At();if(t.length===0)return null;const x=S_(t,r)??t[0]??null;return u.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:u.jsx("div",{role:"separator","aria-orientation":"horizontal","aria-label":m("terminalPanel.resizeAria"),"aria-valuemin":qf,"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}),u.jsx(v_,{tabs:t,activeId:x?.id??null,onSelect:o,onClose:i,onClosePanel:l,onNewShell:c,newShellPending:f}),u.jsx("div",{className:"relative min-h-0 flex-1",style:{background:"var(--bg-crust)"},children:t.map(S=>u.jsx(C_,{tab:S,isActive:S.id===(x?.id??null),onStartWorker:h,startingWorkerId:g},S.id))})]})},C_=({tab:t,isActive:r,onStartWorker:o,startingWorkerId:i})=>{const{t:l}=ke(),c=r?"flex h-full w-full":"hidden";if(t.kind==="worker"){if(!t.runId){const f=i===t.workerId;return u.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:[u.jsxs("span",{className:"flex items-center gap-2",children:[u.jsx(hm,{size:14,"aria-hidden":!0}),l("terminalPanel.workerStopped",{name:t.label})]}),u.jsxs("button",{type:"button",onClick:()=>o(t.workerId),disabled:f,className:"icon-btn icon-btn--primary","data-testid":"terminal-panel-start-worker",children:[f?u.jsx(To,{size:12,className:"animate-spin","aria-hidden":!0}):u.jsx(Ao,{size:12,"aria-hidden":!0}),l(f?"common.starting":"common.start")]})]})}return u.jsx("div",{id:`worker-pty-${t.runId}`,className:c,"data-pty-slot":"worker","data-testid":`terminal-panel-slot-worker-${t.workerId}`})}return u.jsx("div",{id:`shell-pty-${t.runId}`,className:c,"data-pty-slot":"shell","data-testid":`terminal-panel-slot-shell-${t.runId}`})},af=t=>`hive.terminal-panel.tabs.${t}`,of=t=>`hive.terminal-panel.active.${t}`,T_=t=>`worker:${t}`,A_=t=>`shell:${t}`,by=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[]}},wy=t=>{try{return window.localStorage.getItem(t)??""}catch{return""}},xy=(t,r)=>{try{window.localStorage.setItem(t,r)}catch{}},__=({workspaceId:t,workers:r,terminalRuns:o})=>{const[i,l]=b.useState(()=>by(af(t))),[c,f]=b.useState(()=>{const _=wy(of(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(by(af(t)));const _=wy(of(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&&xy(af(t),JSON.stringify(i))},[i,t]),b.useEffect(()=>{m.current&&xy(of(t),c??"")},[c,t]);const y=b.useMemo(()=>new Map(r.map(_=>[_.id,_])),[r]),{runByAgentId:v,shellRunById:x}=b.useMemo(()=>{const _=new Map,j=new Map;for(const A of o)_.set(A.agent_id,A),cc(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),O=y.get(A);if(!O)continue;const D=v.get(O.id);_.push({id:j,kind:"worker",workerId:A,runId:D?.run_id??null,label:O.name})}else if(j.startsWith("shell:")){const A=j.slice(6),O=x.get(A);if(!O)continue;_.push({id:j,kind:"shell",runId:A,label:O.agent_name})}return _},[i,y,v,x]);b.useEffect(()=>{m.current&&l(_=>{const j=_.filter(A=>A.startsWith("worker:")?y.has(A.slice(7)):A.startsWith("shell:")?x.has(A.slice(6)):!1);return j.length===_.length?_:j})},[y,x]),b.useEffect(()=>{m.current&&(c&&S.some(_=>_.id===c)||f(S[0]?.id??null))},[c,S]);const T=b.useCallback(_=>{m.current=!0;const j=T_(_);l(A=>A.includes(j)?A:[...A,j]),f(j)},[]),k=b.useCallback(_=>{m.current=!0;const j=A_(_);l(A=>A.includes(j)?A:[...A,j]),f(j)},[]),E=b.useCallback(_=>{const j=h.current,A=j.filter(O=>O!==_);A.length!==j.length&&(l(A),f(O=>{if(O!==_)return O;const D=j.indexOf(_);return A[D]??A[D-1]??A[0]??null}))},[]),C=b.useCallback(_=>f(_),[]);return{tabs:S,activeId:c,openWorkerTab:T,openShellTab:k,closeTab:E,setActive:C}},ky=500,N_=2500,j_=5e3,R_=t=>t.status==="starting"||t.status==="running",O_=(t,r)=>t>0?Math.min(ky*2**t,j_):r.some(R_)?ky:N_,ow=t=>`${t}:orchestrator`,D_=(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}),M_=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,O_(l,f)))},m=()=>{c||(c=!0,sC(t).then(y=>{i||(l=0,f=y,o(v=>D_(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},L_=(t,r)=>t.find(o=>o.agent_id===ow(r)),z_=(t,r)=>t.find(o=>o.agent_id===r),H_=({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),x=b.useRef(new Map),S=b.useRef(0),T=b.useRef(new Map),k=b.useRef(new Map),E=b.useRef(new Set),C=b.useRef(c),j=(l.find(V=>V.run_id===g)??l[0]??null)?.run_id??null,A=b.useCallback((V,J)=>{const X=T.current.get(V)??new Set;X.add(J),T.current.set(V,X)},[]),O=b.useCallback((V,J,X)=>{const $=k.current.get(V)??new Map;$.set(J,X),k.current.set(V,$),X.finally(()=>{const M=k.current.get(V);M&&(M.delete(J),M.size===0&&k.current.delete(V))}).catch(()=>{})},[]),D=b.useCallback((V,J)=>{const X=T.current.get(V);X&&(X.delete(J),X.size===0&&T.current.delete(V))},[]);b.useLayoutEffect(()=>{C.current=c},[c]),b.useEffect(()=>()=>{T.current.clear(),k.current.clear(),E.current.clear()},[]),b.useEffect(()=>{h(null),m(null),v(!1)},[c]),b.useEffect(()=>{if(!c)return;const V=T.current.get(c);if(!V)return;const J=new Set(l.map($=>$.run_id)),X=k.current.get(c);for(const $ of Array.from(V))X?.has($)||J.has($)||D(c,$)},[l,D,c]);const L=()=>{if(!c||x.current.has(c))return;const V=c,J=S.current+1;S.current=J,x.current.set(V,J);const X=()=>C.current===V,$=()=>x.current.get(V)===J;h(null),v(!0),tC(V).then(M=>{o?.(V,M),X()&&(m(M.run_id),i.openShellTab(M.run_id))}).catch(M=>{X()&&h(M instanceof Error?M.message:String(M))}).finally(()=>{$()&&x.current.delete(V),X()&&v(!1)})},B=()=>{if(!c||x.current.has(c)||E.current.has(c))return;const V=c,J=Array.from(k.current.get(V)?.values()??[]);if(J.length===0){L();return}E.current.add(V),h(null),v(!0),Promise.allSettled(J).then(X=>{X.some($=>$.status==="rejected")||C.current===V&&(x.current.has(V)||L())}).finally(()=>{E.current.delete(V),C.current===V&&!x.current.has(V)&&v(!1)})};return{closeShellTab:V=>{if(!c)return;const J=l.find($=>$.run_id!==V)??null;j===V&&m(J?.run_id??null),r?.(c,V),A(c,V);const X=nC(c,V).catch($=>{throw D(c,V),t($ instanceof Error?$.message:String($)),$});O(c,V,X),X.catch(()=>{})},openShell:()=>{if(!c||x.current.has(c)||y)return;const V=i.tabs.find($=>$.kind==="shell");if(V){i.setActive(V.id);return}const J=T.current.get(c)??new Set,X=l.find($=>!J.has($.run_id));if(X){m(X.run_id),i.openShellTab(X.run_id);return}if(J.size>0){B();return}L()},shellError:f,shellStarting:y,startNewShell:()=>{if(!c||x.current.has(c)||y)return;if((T.current.get(c)??new Set).size>0){B();return}L()}}},sw="hive.split.orch-pct",Rs=.3,Os=.78,Ol=.6,Sy=.02,Dl=(t,r,o)=>Math.min(o,Math.max(r,t)),B_=()=>{try{const t=localStorage.getItem(sw);if(!t)return Ol;const r=Number.parseFloat(t);return Number.isFinite(r)?Dl(r,Rs,Os):Ol}catch{return Ol}},W_=()=>{const t=b.useRef(null),[r,o]=b.useState(()=>B_()),[i,l]=b.useState(!1);b.useEffect(()=>{try{localStorage.setItem(sw,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 T=g.getBoundingClientRect();if(T.width<=0)return;const k=(S.clientX-T.left)/T.width;o(Dl(k,Rs,Os))},x=()=>{l(!1),document.body.style.userSelect=m,document.body.style.cursor=y,document.removeEventListener("pointermove",v),document.removeEventListener("pointerup",x),document.removeEventListener("pointercancel",x)};document.addEventListener("pointermove",v),document.addEventListener("pointerup",x),document.addEventListener("pointercancel",x)},[]),f=b.useCallback(h=>{h.key==="ArrowLeft"?(h.preventDefault(),o(g=>Dl(g-Sy,Rs,Os))):h.key==="ArrowRight"?(h.preventDefault(),o(g=>Dl(g+Sy,Rs,Os))):h.key==="Home"?(h.preventDefault(),o(Rs)):h.key==="End"?(h.preventDefault(),o(Os)):h.key==="Enter"&&(h.metaKey||h.ctrlKey)&&(h.preventDefault(),o(Ol))},[]);return{containerRef:t,orchPct:r,dragging:i,beginDrag:c,onKeyDown:f}},Xs=({title:t,description:r,icon:o,action:i})=>u.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?u.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,u.jsx("div",{className:"text-lg font-semibold text-pri","data-testid":"empty-state-title",children:t}),u.jsx("div",{className:"text-sm text-ter","data-testid":"empty-state-description",children:r}),i]}),Wr=t=>r=>{console.error(`[hive] swallowed:${t}`,r)},U_={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"}},q_=t=>U_[t]??null,I_=({presetId:t,presetName:r})=>{const{t:o}=ke(),i=q_(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&&ob(i.command).then(()=>{c(!0),g.current&&clearTimeout(g.current),g.current=setTimeout(()=>{c(!1),g.current=null},1500)}).catch(Wr("cli-install-copy"))};return u.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?u.jsxs(u.Fragment,{children:[u.jsx("span",{className:"text-xs text-sec",children:o("workspace.preset.installHint",{name:r})}),u.jsxs("div",{className:"flex items-center gap-2",children:[u.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}),u.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?u.jsx(Eo,{size:13,"aria-hidden":!0}):u.jsx(sc,{size:13,"aria-hidden":!0}),u.jsx("span",{className:"text-xs",children:o(l?"common.copied":"workspace.preset.installCopy")})]})]}),u.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:[u.jsx(AS,{size:11,"aria-hidden":!0}),o("workspace.preset.installDocs")]})]}):null,u.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?u.jsx(Co,{size:12,"aria-hidden":!0}):u.jsx(oc,{size:12,"aria-hidden":!0}),o("workspace.preset.pathHelpTitle")]}),f?u.jsx("p",{className:"text-xs leading-relaxed text-ter","data-testid":"cli-install-path-help-body",children:o("workspace.preset.pathHelpBody")}):null]})},P_={"cursor-agent":"cursor"},K_=/^(\S+) CLI not found in PATH/u,F_=()=>{const{t}=ke();return u.jsx("div",{"data-testid":"orchestrator-starting-body",className:"flex flex-1",children:u.jsx(Xs,{icon:u.jsx(To,{size:24,className:"animate-spin"}),title:t("orchestrator.startingTitle"),description:t("orchestrator.startingDesc")})})},Y_=({onStart:t})=>{const{t:r}=ke();return u.jsx("div",{"data-testid":"orchestrator-stopped-body",className:"flex flex-1",children:u.jsx(Xs,{icon:u.jsx(dm,{size:24}),title:r("orchestrator.stoppedTitle"),description:r("orchestrator.stoppedDesc"),action:u.jsxs("button",{type:"button",onClick:t,className:"icon-btn icon-btn--primary","data-testid":"orchestrator-start",children:[u.jsx(Ao,{size:12,"aria-hidden":!0})," ",r("orchestrator.start")]})})})},V_=({error:t,onRemoveWorkspace:r,onRestart:o})=>{const{t:i}=ke(),[l,c]=b.useState(!1),f=()=>{navigator.clipboard?.writeText(t).then(()=>{c(!0),window.setTimeout(()=>c(!1),1500)}).catch(()=>{})},h=K_.exec(t)?.[1];return u.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:[u.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:u.jsx(dm,{size:24})}),u.jsx("div",{className:"text-lg font-semibold text-pri",children:i("orchestrator.failed")}),u.jsxs("div",{className:"relative w-full",children:[u.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}),u.jsx(lt,{label:i(l?"common.copied":"common.copyError"),children:u.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:u.jsx(sc,{size:12,"aria-hidden":!0})})})]}),h?u.jsx("div",{className:"w-full",children:u.jsx(I_,{presetId:P_[h]??h,presetName:h})}):null,u.jsxs("div",{className:"flex items-center gap-3",children:[u.jsxs("button",{type:"button",onClick:o,className:"icon-btn icon-btn--primary","data-testid":"orchestrator-retry",children:[u.jsx(mm,{size:12,"aria-hidden":!0})," ",i("common.retry")]}),u.jsx("button",{type:"button",onClick:r,className:"icon-btn icon-btn--danger","data-testid":"orchestrator-remove-workspace",children:i("orchestrator.removeWorkspace")})]}),u.jsx("span",{"data-testid":"orchestrator-retry-header",className:"sr-only",children:i("common.retry")})]})},$_=({state:t,onRemoveWorkspace:r,onRestart:o,onStart:i,onStop:l})=>{const{t:c}=ke(),f=At();return u.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"?u.jsxs(u.Fragment,{children:[u.jsx("div",{id:`orch-pty-${t.runId}`,className:"orchestrator-pty-slot relative flex h-full w-full","data-pty-slot":"orchestrator",children:u.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:u.jsx("div",{className:"mono text-xs text-ter",children:c("terminal.statusConnecting")})})}),f?null:u.jsx(lt,{label:c("orchestrator.stop"),children:u.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:u.jsx(pm,{size:13,"aria-hidden":!0})})})]}):t.kind==="failed"?u.jsx(V_,{error:t.error,onRemoveWorkspace:r,onRestart:o}):t.kind==="stopped"?u.jsx(Y_,{onStart:i}):u.jsx(F_,{})})},G_=({workspaceId:t,terminalRuns:r,autostartError:o,suppressAutostartRunId:i,onClearAutostartError:l,onAfterStart:c})=>{const f=L_(r,t),h=ow(t),[g,m]=b.useState(null),[y,v]=b.useState(null),[x,S]=b.useState(null),T=y?.workspaceId===t?y.runId:null,k=!!(x&&!f&&!T);b.useEffect(()=>{S(i??null)},[i]),b.useEffect(()=>{f&&(m(null),v(null),S(null))},[f]),b.useEffect(()=>{if(!x||f)return;const A=window.setTimeout(()=>S(null),1500);return()=>window.clearTimeout(A)},[x,f]),b.useEffect(()=>{if(!T||f)return;const A=window.setTimeout(()=>v(null),2e3);return()=>window.clearTimeout(A)},[T,f]);let E;f?E={kind:"running",runId:f.run_id}:T?E={kind:"running",runId:T}:g===t||k?E={kind:"starting"}:o?E={kind:"failed",error:o}:E={kind:"stopped"};const C=b.useCallback(()=>{!t||g===t||f||(l(),m(t),Il(t,h).then(A=>{v({workspaceId:t,runId:A.runId}),c?.({ok:!0,error:null,run_id:A.runId})}).catch(A=>{const O=A instanceof Error?A.message:"Failed to start Queen";v(null),c?.({ok:!1,error:O,run_id:null})}).finally(()=>m(A=>A===t?null:A)))},[h,c,l,f,g,t]),_=b.useCallback(()=>{f&&Pl(f.run_id).catch(A=>{console.error("[hive] swallowed:orchestrator.stop",A)})},[f]),j=b.useCallback(()=>{if(l(),f){Pl(f.run_id).catch(A=>{console.error("[hive] swallowed:orchestrator.restart.stop",A)}).then(()=>Il(t,h)).then(A=>{v({workspaceId:t,runId:A.runId}),c?.({ok:!0,error:null,run_id:A.runId})}).catch(A=>{const O=A instanceof Error?A.message:"Failed to restart Queen";c?.({ok:!1,error:O,run_id:null})});return}C()},[h,c,l,f,C,t]);return{state:E,start:C,stop:_,restart:j}},iw=["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"],lw=["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"],cw=["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"],X_=["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"],uw=["八大山人","毕昇","蔡伦","干将","顾恺之","黄道婆","李冰","柳公权","鲁班","莫邪","墨子","沈括","宋应星","唐寅","王羲之","文徵明","吴道子","颜真卿","张衡","张择端","郑板桥","祖冲之"],dw=["班固","包拯","狄仁杰","董仲舒","范仲淹","顾炎武","管仲","海瑞","韩非","韩愈","嵇康","贾谊","孔子","老子","林则徐","柳宗元","孟子","欧阳修","商鞅","司马光","司马迁","谭嗣同","王安石","王守仁","魏徵","荀子","张居正","周敦颐","朱熹","庄子"],fw=["班超","扁鹊","法显","葛洪","华佗","鉴真","郦道元","李时珍","神农","苏武","孙思邈","陶弘景","徐光启","徐霞客","玄奘","张骞","张仲景","郑和"],Z_=["白居易","蔡文姬","曹操","曹雪芹","曹植","程咬金","大禹","杜甫","杜牧","范蠡","关羽","汉武帝","韩信","忽必烈","花木兰","黄帝","霍去病","姜子牙","康熙","李白","李广","李靖","李清照","李煜","刘邦","刘备","刘伯温","柳永","陆游","罗贯中","吕布","吕不韦","孟浩然","蒙恬","努尔哈赤","庞统","蒲松龄","戚继光","乾隆","秦始皇","屈原","上官婉儿","施耐庵","司马懿","苏轼","孙膑","孙权","孙武","孙中山","唐太宗","唐玄宗","陶渊明","王维","卫青","文天祥","吴承恩","吴起","萧何","谢安","辛弃疾","杨贵妃","雍正","虞姬","岳飞","张飞","张良","张仪","赵子龙","周瑜","朱棣","诸葛亮","朱元璋","左宗棠"],Q_=[...iw,...lw,...cw,...X_],J_=[...uw,...dw,...fw,...Z_],eN=["argus","cassandra","copernicus","halley","herodotus","hypatia","kepler","ptolemy","thucydides","tycho-brahe"],tN=["班固","郭守敬","沈括","司马光","司马迁","一行","张衡","祖冲之"],nN={en:{coder:iw,reviewer:lw,tester:cw,sentinel:eN,custom:Q_},zh:{coder:uw,reviewer:dw,tester:fw,sentinel:tN,custom:J_}},rN=()=>{const t=new Uint32Array(1);return globalThis.crypto.getRandomValues(t),t[0]??0},sf=({language:t="en",role:r="coder",usedNames:o,nextUint32:i=rN}={})=>{const l=nN[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]},Ls={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
+ `)}},lf=(t,r,o)=>o==="zh"?r.find(i=>i.roleType===t)?.description??Ls.zh[t]:Ls.en[t],aN=({createWorker:t,open:r,workers:o})=>{const{language:i}=ke(),[l,c]=b.useState(""),[f,h]=b.useState("coder"),[g,m]=b.useState([]),[y,v]=b.useState(null),[x,S]=b.useState(!1),[T,k]=b.useState(null),[E,C]=b.useState(Ls[i].coder),[_,j]=b.useState([]),[A,O]=b.useState("claude"),[D,L]=b.useState(""),[B,q]=b.useState(null),[te,ee]=b.useState(!1),V=b.useRef(!1),J=b.useRef(!1),X=b.useRef(!1),$=lf(f,g,i),M=b.useMemo(()=>g.filter(ue=>!ue.isBuiltin),[g]);b.useEffect(()=>{if(!r)return;let ue=!1;return JE().then(pe=>{ue||(j(pe),O(Ae=>pe.some(Ce=>Ce.id===Ae&&Ce.available)?Ae:pe.find(Ce=>Ce.id==="claude"&&Ce.available)?.id??pe.find(Ce=>Ce.available)?.id??pe[0]?.id??""))}).catch(pe=>{ue||q(pe instanceof Error?pe.message:String(pe))}),()=>{ue=!0}},[r]),b.useEffect(()=>{if(!r)return;let ue=!1;return rC().then(pe=>{ue||m(pe)}).catch(pe=>{ue||q(pe instanceof Error?pe.message:String(pe))}),()=>{ue=!0}},[r]),b.useEffect(()=>{y===null&&(J.current||C(lf(f,g,i)))},[i,g,f,y]);const I=ue=>{J.current=!0,C(ue)},P=ue=>{V.current=!1,c(ue)},Z=b.useMemo(()=>new Set(o.map(ue=>ue.name)),[o]),K=b.useRef(Z);K.current=Z;const R=()=>{V.current=!0,c(sf({language:i,role:f,usedNames:Z}))};b.useEffect(()=>{const ue=r&&!X.current;if(X.current=r,!!r){if(ue){V.current=!0,c(sf({language:i,role:f,usedNames:K.current}));return}V.current&&c(sf({language:i,role:f,usedNames:K.current}))}},[r,i,f]);const W=ue=>{h(ue),v(null),J.current=!1,C(lf(ue,g,i))};return{commandPresets:_,commandPresetId:A,createWorkerError:B,creating:te,customTemplates:M,roleDescription:E,roleDescriptionDefault:$,selectedTemplateId:y,startupCommand:D,templateBusy:x,templateError:T,workerName:l,workerRole:f,setCommandPresetId:ue=>{O(ue)},setRoleDescription:I,setStartupCommand:L,setWorkerName:P,setWorkerRole:W,selectTemplate:ue=>{if(ue===null){h("custom"),v(null),J.current=!1,C(Ls[i].custom);return}const pe=g.find(Ae=>Ae.id===ue);!pe||pe.isBuiltin||(h("custom"),v(ue),J.current=!1,C(pe.description))},saveAsTemplate:async ue=>{const pe=ue.trim(),Ae=E.trim();if(!(!pe||!Ae)){S(!0),k(null);try{const Ce=await aC({name:pe,roleType:"custom",description:Ae});m(Se=>[...Se,Ce]),v(Ce.id),h("custom"),J.current=!1,C(Ce.description)}catch(Ce){throw k(Ce instanceof Error?Ce.message:String(Ce)),Ce}finally{S(!1)}}},deleteTemplate:async ue=>{const pe=g.find(Ae=>Ae.id===ue);if(!(!pe||pe.isBuiltin)){S(!0),k(null);try{await oC(ue),m(Ae=>Ae.filter(Ce=>Ce.id!==ue)),y===ue&&(v(null),J.current=!1,C(Ls[i].custom))}catch(Ae){throw k(Ae instanceof Error?Ae.message:String(Ae)),Ae}finally{S(!1)}}},randomizeWorkerName:R,resetRoleDescription:()=>{J.current=!1,C($)},resetError:()=>q(null),applyMarketplaceImport:({name:ue,description:pe})=>{V.current=!1,c(ue),v(null),h("custom"),J.current=!0,C(pe)},submit:(ue,pe)=>{ue.preventDefault(),ee(!0),q(null),t({commandPresetId:A,name:l,role:f,roleDescription:E,startupCommand:D}).then(({error:Ae})=>{c(""),V.current=!1,W("coder"),v(null),O("claude"),L(""),pe(),Ae&&q(Ae)}).catch(Ae=>{q(Ae instanceof Error?Ae.message:String(Ae))}).finally(()=>ee(!1))}}},oN=[{icon:u.jsx(z0,{size:16}),titleKey:"welcome.step1Title",descriptionKey:"welcome.step1Desc"},{icon:u.jsx(I0,{size:16}),titleKey:"welcome.step2Title",descriptionKey:"welcome.step2Desc"},{icon:u.jsx(nE,{size:16}),titleKey:"welcome.step3Title",descriptionKey:"welcome.step3Desc"}],sN=({onAddWorkspace:t,onTryDemo:r,heroImageSrc:o,disabledReason:i})=>{const{t:l}=ke(),c=!!i;return u.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?u.jsx("img",{src:o,alt:"",className:"h-24 w-24","aria-hidden":!0}):null,u.jsxs("div",{className:"space-y-2",children:[u.jsx("div",{className:"text-2xl font-semibold text-pri",children:l("welcome.title")}),u.jsx("div",{className:"text-sm text-sec",children:l("welcome.desc")})]}),u.jsx("ol",{className:"grid w-full grid-cols-1 gap-3 text-left md:grid-cols-3",children:oN.map((f,h)=>u.jsxs("li",{className:"rounded border bg-1 p-3",style:{borderColor:"var(--border)"},children:[u.jsxs("div",{className:"mb-1 flex items-center gap-2 text-pri",children:[u.jsx("span",{className:"font-medium text-xs text-ter",children:h+1}),f.icon]}),u.jsx("div",{className:"text-xs font-medium text-pri",children:l(f.titleKey)}),u.jsx("div",{className:"mt-1 text-xs text-ter",children:l(f.descriptionKey)})]},f.titleKey))}),c?u.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:[u.jsx(lc,{size:14,className:"mt-0.5 shrink-0","aria-hidden":!0}),u.jsx("span",{className:"break-words",children:i})]}):null,u.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:[u.jsx("span",{children:l("welcome.addWorkspace")}),u.jsx(Z2,{size:14,"aria-hidden":!0})]}),r?u.jsx("button",{type:"button",onClick:r,className:"text-xs text-sec underline hover:text-pri",children:l("welcome.demo")}):null]})};var cf="focusScope.autoFocusOnMount",uf="focusScope.autoFocusOnUnmount",Ey={bubbles:!1,cancelable:!0},iN="FocusScope",mw=b.forwardRef((t,r)=>{const{loop:o=!1,trapped:i=!1,onMountAutoFocus:l,onUnmountAutoFocus:c,...f}=t,[h,g]=b.useState(null),m=bo(l),y=bo(c),v=b.useRef(null),x=Sn(r,k=>g(k)),S=b.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;b.useEffect(()=>{if(i){let k=function(j){if(S.paused||!h)return;const A=j.target;h.contains(A)?v.current=A:Br(v.current,{select:!0})},E=function(j){if(S.paused||!h)return;const A=j.relatedTarget;A!==null&&(h.contains(A)||Br(v.current,{select:!0}))},C=function(j){if(document.activeElement===document.body)for(const O of j)O.removedNodes.length>0&&Br(h)};document.addEventListener("focusin",k),document.addEventListener("focusout",E);const _=new MutationObserver(C);return h&&_.observe(h,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",k),document.removeEventListener("focusout",E),_.disconnect()}}},[i,h,S.paused]),b.useEffect(()=>{if(h){Ty.add(S);const k=document.activeElement;if(!h.contains(k)){const C=new CustomEvent(cf,Ey);h.addEventListener(cf,m),h.dispatchEvent(C),C.defaultPrevented||(lN(mN(pw(h)),{select:!0}),document.activeElement===k&&Br(h))}return()=>{h.removeEventListener(cf,m),setTimeout(()=>{const C=new CustomEvent(uf,Ey);h.addEventListener(uf,y),h.dispatchEvent(C),C.defaultPrevented||Br(k??document.body,{select:!0}),h.removeEventListener(uf,y),Ty.remove(S)},0)}}},[h,m,y,S]);const T=b.useCallback(k=>{if(!o&&!i||S.paused)return;const E=k.key==="Tab"&&!k.altKey&&!k.ctrlKey&&!k.metaKey,C=document.activeElement;if(E&&C){const _=k.currentTarget,[j,A]=cN(_);j&&A?!k.shiftKey&&C===A?(k.preventDefault(),o&&Br(j,{select:!0})):k.shiftKey&&C===j&&(k.preventDefault(),o&&Br(A,{select:!0})):C===_&&k.preventDefault()}},[o,i,S.paused]);return u.jsx(Wt.div,{tabIndex:-1,...f,ref:x,onKeyDown:T})});mw.displayName=iN;function lN(t,{select:r=!1}={}){const o=document.activeElement;for(const i of t)if(Br(i,{select:r}),document.activeElement!==o)return}function cN(t){const r=pw(t),o=Cy(r,t),i=Cy(r.reverse(),t);return[o,i]}function pw(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 Cy(t,r){for(const o of t)if(!uN(o,{upTo:r}))return o}function uN(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 dN(t){return t instanceof HTMLInputElement&&"select"in t}function Br(t,{select:r=!1}={}){if(t&&t.focus){const o=document.activeElement;t.focus({preventScroll:!0}),t!==o&&dN(t)&&r&&t.select()}}var Ty=fN();function fN(){let t=[];return{add(r){const o=t[0];r!==o&&o?.pause(),t=Ay(t,r),t.unshift(r)},remove(r){t=Ay(t,r),t[0]?.resume()}}}function Ay(t,r){const o=[...t],i=o.indexOf(r);return i!==-1&&o.splice(i,1),o}function mN(t){return t.filter(r=>r.tagName!=="A")}var df=0;function pN(){b.useEffect(()=>{const t=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",t[0]??_y()),document.body.insertAdjacentElement("beforeend",t[1]??_y()),df++,()=>{df===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(r=>r.remove()),df--}},[])}function _y(){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 Dn=function(){return Dn=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},Dn.apply(this,arguments)};function hw(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 hN(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 Ml="right-scroll-bar-position",Ll="width-before-scroll-bar",gN="with-scroll-bars-hidden",vN="--removed-body-scroll-bar-size";function ff(t,r){return typeof t=="function"?t(r):t&&(t.current=r),t}function yN(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 bN=typeof window<"u"?b.useLayoutEffect:b.useEffect,Ny=new WeakMap;function wN(t,r){var o=yN(null,function(i){return t.forEach(function(l){return ff(l,i)})});return bN(function(){var i=Ny.get(o);if(i){var l=new Set(i),c=new Set(t),f=o.current;l.forEach(function(h){c.has(h)||ff(h,null)}),c.forEach(function(h){l.has(h)||ff(h,f)})}Ny.set(o,t)},[t]),o}function xN(t){return t}function kN(t,r){r===void 0&&(r=xN);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 SN(t){t===void 0&&(t={});var r=kN(null);return r.options=Dn({async:!0,ssr:!1},t),r}var gw=function(t){var r=t.sideCar,o=hw(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,Dn({},o))};gw.isSideCarExport=!0;function EN(t,r){return t.useMedium(r),gw}var vw=SN(),mf=function(){},bc=b.forwardRef(function(t,r){var o=b.useRef(null),i=b.useState({onScrollCapture:mf,onWheelCapture:mf,onTouchMoveCapture:mf}),l=i[0],c=i[1],f=t.forwardProps,h=t.children,g=t.className,m=t.removeScrollBar,y=t.enabled,v=t.shards,x=t.sideCar,S=t.noRelative,T=t.noIsolation,k=t.inert,E=t.allowPinchZoom,C=t.as,_=C===void 0?"div":C,j=t.gapMode,A=hw(t,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),O=x,D=wN([o,r]),L=Dn(Dn({},A),l);return b.createElement(b.Fragment,null,y&&b.createElement(O,{sideCar:vw,removeScrollBar:m,shards:v,noRelative:S,noIsolation:T,inert:k,setCallbacks:c,allowPinchZoom:!!E,lockRef:o,gapMode:j}),f?b.cloneElement(b.Children.only(h),Dn(Dn({},L),{ref:D})):b.createElement(_,Dn({},L,{className:g,ref:D}),h))});bc.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};bc.classNames={fullWidth:Ll,zeroRight:Ml};var CN=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function TN(){if(!document)return null;var t=document.createElement("style");t.type="text/css";var r=CN();return r&&t.setAttribute("nonce",r),t}function AN(t,r){t.styleSheet?t.styleSheet.cssText=r:t.appendChild(document.createTextNode(r))}function _N(t){var r=document.head||document.getElementsByTagName("head")[0];r.appendChild(t)}var NN=function(){var t=0,r=null;return{add:function(o){t==0&&(r=TN())&&(AN(r,o),_N(r)),t++},remove:function(){t--,!t&&r&&(r.parentNode&&r.parentNode.removeChild(r),r=null)}}},jN=function(){var t=NN();return function(r,o){b.useEffect(function(){return t.add(r),function(){t.remove()}},[r&&o])}},yw=function(){var t=jN(),r=function(o){var i=o.styles,l=o.dynamic;return t(i,l),null};return r},RN={left:0,top:0,right:0,gap:0},pf=function(t){return parseInt(t||"",10)||0},ON=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[pf(o),pf(i),pf(l)]},DN=function(t){if(t===void 0&&(t="margin"),typeof window>"u")return RN;var r=ON(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])}},MN=yw(),po="data-scroll-locked",LN=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(gN,` {
22
+ overflow: hidden `).concat(i,`;
23
+ padding-right: `).concat(h,"px ").concat(i,`;
24
+ }
25
+ body[`).concat(po,`] {
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(Ml,` {
39
+ right: `).concat(h,"px ").concat(i,`;
40
+ }
41
+
42
+ .`).concat(Ll,` {
43
+ margin-right: `).concat(h,"px ").concat(i,`;
44
+ }
45
+
46
+ .`).concat(Ml," .").concat(Ml,` {
47
+ right: 0 `).concat(i,`;
48
+ }
49
+
50
+ .`).concat(Ll," .").concat(Ll,` {
51
+ margin-right: 0 `).concat(i,`;
52
+ }
53
+
54
+ body[`).concat(po,`] {
55
+ `).concat(vN,": ").concat(h,`px;
56
+ }
57
+ `)},jy=function(){var t=parseInt(document.body.getAttribute(po)||"0",10);return isFinite(t)?t:0},zN=function(){b.useEffect(function(){return document.body.setAttribute(po,(jy()+1).toString()),function(){var t=jy()-1;t<=0?document.body.removeAttribute(po):document.body.setAttribute(po,t.toString())}},[])},HN=function(t){var r=t.noRelative,o=t.noImportant,i=t.gapMode,l=i===void 0?"margin":i;zN();var c=b.useMemo(function(){return DN(l)},[l]);return b.createElement(MN,{styles:LN(c,!r,l,o?"":"!important")})},If=!1;if(typeof window<"u")try{var Sl=Object.defineProperty({},"passive",{get:function(){return If=!0,!0}});window.addEventListener("test",Sl,Sl),window.removeEventListener("test",Sl,Sl)}catch{If=!1}var io=If?{passive:!1}:!1,BN=function(t){return t.tagName==="TEXTAREA"},bw=function(t,r){if(!(t instanceof Element))return!1;var o=window.getComputedStyle(t);return o[r]!=="hidden"&&!(o.overflowY===o.overflowX&&!BN(t)&&o[r]==="visible")},WN=function(t){return bw(t,"overflowY")},UN=function(t){return bw(t,"overflowX")},Ry=function(t,r){var o=r.ownerDocument,i=r;do{typeof ShadowRoot<"u"&&i instanceof ShadowRoot&&(i=i.host);var l=ww(t,i);if(l){var c=xw(t,i),f=c[1],h=c[2];if(f>h)return!0}i=i.parentNode}while(i&&i!==o.body);return!1},qN=function(t){var r=t.scrollTop,o=t.scrollHeight,i=t.clientHeight;return[r,o,i]},IN=function(t){var r=t.scrollLeft,o=t.scrollWidth,i=t.clientWidth;return[r,o,i]},ww=function(t,r){return t==="v"?WN(r):UN(r)},xw=function(t,r){return t==="v"?qN(r):IN(r)},PN=function(t,r){return t==="h"&&r==="rtl"?-1:1},KN=function(t,r,o,i,l){var c=PN(t,window.getComputedStyle(r).direction),f=c*i,h=o.target,g=r.contains(h),m=!1,y=f>0,v=0,x=0;do{if(!h)break;var S=xw(t,h),T=S[0],k=S[1],E=S[2],C=k-E-c*T;(T||C)&&ww(t,h)&&(v+=C,x+=T);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(x)<1)&&(m=!0),m},El=function(t){return"changedTouches"in t?[t.changedTouches[0].clientX,t.changedTouches[0].clientY]:[0,0]},Oy=function(t){return[t.deltaX,t.deltaY]},Dy=function(t){return t&&"current"in t?t.current:t},FN=function(t,r){return t[0]===r[0]&&t[1]===r[1]},YN=function(t){return`
58
+ .block-interactivity-`.concat(t,` {pointer-events: none;}
59
+ .allow-interactivity-`).concat(t,` {pointer-events: all;}
60
+ `)},VN=0,lo=[];function $N(t){var r=b.useRef([]),o=b.useRef([0,0]),i=b.useRef(),l=b.useState(VN++)[0],c=b.useState(yw)[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 k=hN([t.lockRef.current],(t.shards||[]).map(Dy),!0).filter(Boolean);return k.forEach(function(E){return E.classList.add("allow-interactivity-".concat(l))}),function(){document.body.classList.remove("block-interactivity-".concat(l)),k.forEach(function(E){return E.classList.remove("allow-interactivity-".concat(l))})}}},[t.inert,t.lockRef.current,t.shards]);var h=b.useCallback(function(k,E){if("touches"in k&&k.touches.length===2||k.type==="wheel"&&k.ctrlKey)return!f.current.allowPinchZoom;var C=El(k),_=o.current,j="deltaX"in k?k.deltaX:_[0]-C[0],A="deltaY"in k?k.deltaY:_[1]-C[1],O,D=k.target,L=Math.abs(j)>Math.abs(A)?"h":"v";if("touches"in k&&L==="h"&&D.type==="range")return!1;var B=window.getSelection(),q=B&&B.anchorNode,te=q?q===D||q.contains(D):!1;if(te)return!1;var ee=Ry(L,D);if(!ee)return!0;if(ee?O=L:(O=L==="v"?"h":"v",ee=Ry(L,D)),!ee)return!1;if(!i.current&&"changedTouches"in k&&(j||A)&&(i.current=O),!O)return!0;var V=i.current||O;return KN(V,E,k,V==="h"?j:A)},[]),g=b.useCallback(function(k){var E=k;if(!(!lo.length||lo[lo.length-1]!==c)){var C="deltaY"in E?Oy(E):El(E),_=r.current.filter(function(O){return O.name===E.type&&(O.target===E.target||E.target===O.shadowParent)&&FN(O.delta,C)})[0];if(_&&_.should){E.cancelable&&E.preventDefault();return}if(!_){var j=(f.current.shards||[]).map(Dy).filter(Boolean).filter(function(O){return O.contains(E.target)}),A=j.length>0?h(E,j[0]):!f.current.noIsolation;A&&E.cancelable&&E.preventDefault()}}},[]),m=b.useCallback(function(k,E,C,_){var j={name:k,delta:E,target:C,should:_,shadowParent:GN(C)};r.current.push(j),setTimeout(function(){r.current=r.current.filter(function(A){return A!==j})},1)},[]),y=b.useCallback(function(k){o.current=El(k),i.current=void 0},[]),v=b.useCallback(function(k){m(k.type,Oy(k),k.target,h(k,t.lockRef.current))},[]),x=b.useCallback(function(k){m(k.type,El(k),k.target,h(k,t.lockRef.current))},[]);b.useEffect(function(){return lo.push(c),t.setCallbacks({onScrollCapture:v,onWheelCapture:v,onTouchMoveCapture:x}),document.addEventListener("wheel",g,io),document.addEventListener("touchmove",g,io),document.addEventListener("touchstart",y,io),function(){lo=lo.filter(function(k){return k!==c}),document.removeEventListener("wheel",g,io),document.removeEventListener("touchmove",g,io),document.removeEventListener("touchstart",y,io)}},[]);var S=t.removeScrollBar,T=t.inert;return b.createElement(b.Fragment,null,T?b.createElement(c,{styles:YN(l)}):null,S?b.createElement(HN,{noRelative:t.noRelative,gapMode:t.gapMode}):null)}function GN(t){for(var r=null;t!==null;)t instanceof ShadowRoot&&(r=t.host,t=t.host),t=t.parentNode;return r}const XN=EN(vw,$N);var kw=b.forwardRef(function(t,r){return b.createElement(bc,Dn({},t,{ref:r,sideCar:XN}))});kw.classNames=bc.classNames;var ZN=function(t){if(typeof document>"u")return null;var r=Array.isArray(t)?t[0]:t;return r.ownerDocument.body},co=new WeakMap,Cl=new WeakMap,Tl={},hf=0,Sw=function(t){return t&&(t.host||Sw(t.parentNode))},QN=function(t,r){return r.map(function(o){if(t.contains(o))return o;var i=Sw(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})},JN=function(t,r,o,i){var l=QN(r,Array.isArray(t)?t:[t]);Tl[o]||(Tl[o]=new WeakMap);var c=Tl[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(x){if(h.has(x))y(x);else try{var S=x.getAttribute(i),T=S!==null&&S!=="false",k=(co.get(x)||0)+1,E=(c.get(x)||0)+1;co.set(x,k),c.set(x,E),f.push(x),k===1&&T&&Cl.set(x,!0),E===1&&x.setAttribute(o,"true"),T||x.setAttribute(i,"true")}catch(C){console.error("aria-hidden: cannot operate on ",x,C)}})};return y(r),h.clear(),hf++,function(){f.forEach(function(v){var x=co.get(v)-1,S=c.get(v)-1;co.set(v,x),c.set(v,S),x||(Cl.has(v)||v.removeAttribute(i),Cl.delete(v)),S||v.removeAttribute(o)}),hf--,hf||(co=new WeakMap,co=new WeakMap,Cl=new WeakMap,Tl={})}},ej=function(t,r,o){o===void 0&&(o="data-aria-hidden");var i=Array.from(Array.isArray(t)?t:[t]),l=ZN(t);return l?(i.push.apply(i,Array.from(l.querySelectorAll("[aria-live], script"))),JN(i,l,o,"aria-hidden")):function(){return null}},wc="Dialog",[Ew]=vm(wc),[tj,En]=Ew(wc),Cw=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]=Mb({prop:i,defaultProp:l??!1,onChange:c,caller:wc});return u.jsx(tj,{scope:r,triggerRef:h,contentRef:g,contentId:jl(),titleId:jl(),descriptionId:jl(),open:m,onOpenChange:y,onOpenToggle:b.useCallback(()=>y(v=>!v),[y]),modal:f,children:o})};Cw.displayName=wc;var Tw="DialogTrigger",Aw=b.forwardRef((t,r)=>{const{__scopeDialog:o,...i}=t,l=En(Tw,o),c=Sn(r,l.triggerRef);return u.jsx(Wt.button,{type:"button","aria-haspopup":"dialog","aria-expanded":l.open,"aria-controls":l.contentId,"data-state":Mm(l.open),...i,ref:c,onClick:zt(t.onClick,l.onOpenToggle)})});Aw.displayName=Tw;var Om="DialogPortal",[nj,_w]=Ew(Om,{forceMount:void 0}),Nw=t=>{const{__scopeDialog:r,forceMount:o,children:i,container:l}=t,c=En(Om,r);return u.jsx(nj,{scope:r,forceMount:o,children:b.Children.map(i,f=>u.jsx(jo,{present:o||c.open,children:u.jsx(Am,{asChild:!0,container:l,children:f})}))})};Nw.displayName=Om;var Gl="DialogOverlay",jw=b.forwardRef((t,r)=>{const o=_w(Gl,t.__scopeDialog),{forceMount:i=o.forceMount,...l}=t,c=En(Gl,t.__scopeDialog);return c.modal?u.jsx(jo,{present:i||c.open,children:u.jsx(aj,{...l,ref:r})}):null});jw.displayName=Gl;var rj=lb("DialogOverlay.RemoveScroll"),aj=b.forwardRef((t,r)=>{const{__scopeDialog:o,...i}=t,l=En(Gl,o);return u.jsx(kw,{as:rj,allowPinchZoom:!0,shards:[l.contentRef],children:u.jsx(Wt.div,{"data-state":Mm(l.open),...i,ref:r,style:{pointerEvents:"auto",...i.style}})})}),xa="DialogContent",Rw=b.forwardRef((t,r)=>{const o=_w(xa,t.__scopeDialog),{forceMount:i=o.forceMount,...l}=t,c=En(xa,t.__scopeDialog);return u.jsx(jo,{present:i||c.open,children:c.modal?u.jsx(oj,{...l,ref:r}):u.jsx(sj,{...l,ref:r})})});Rw.displayName=xa;var oj=b.forwardRef((t,r)=>{const o=En(xa,t.__scopeDialog),i=b.useRef(null),l=Sn(r,o.contentRef,i);return b.useEffect(()=>{const c=i.current;if(c)return ej(c)},[]),u.jsx(Ow,{...t,ref:l,trapFocus:o.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:zt(t.onCloseAutoFocus,c=>{c.preventDefault(),o.triggerRef.current?.focus()}),onPointerDownOutside:zt(t.onPointerDownOutside,c=>{const f=c.detail.originalEvent,h=f.button===0&&f.ctrlKey===!0;(f.button===2||h)&&c.preventDefault()}),onFocusOutside:zt(t.onFocusOutside,c=>c.preventDefault())})}),sj=b.forwardRef((t,r)=>{const o=En(xa,t.__scopeDialog),i=b.useRef(!1),l=b.useRef(!1);return u.jsx(Ow,{...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()}})}),Ow=b.forwardRef((t,r)=>{const{__scopeDialog:o,trapFocus:i,onOpenAutoFocus:l,onCloseAutoFocus:c,...f}=t,h=En(xa,o),g=b.useRef(null),m=Sn(r,g);return pN(),u.jsxs(u.Fragment,{children:[u.jsx(mw,{asChild:!0,loop:!0,trapped:i,onMountAutoFocus:l,onUnmountAutoFocus:c,children:u.jsx(ym,{role:"dialog",id:h.contentId,"aria-describedby":h.descriptionId,"aria-labelledby":h.titleId,"data-state":Mm(h.open),...f,ref:m,onDismiss:()=>h.onOpenChange(!1)})}),u.jsxs(u.Fragment,{children:[u.jsx(ij,{titleId:h.titleId}),u.jsx(cj,{contentRef:g,descriptionId:h.descriptionId})]})]})}),Dm="DialogTitle",Dw=b.forwardRef((t,r)=>{const{__scopeDialog:o,...i}=t,l=En(Dm,o);return u.jsx(Wt.h2,{id:l.titleId,...i,ref:r})});Dw.displayName=Dm;var Mw="DialogDescription",Lw=b.forwardRef((t,r)=>{const{__scopeDialog:o,...i}=t,l=En(Mw,o);return u.jsx(Wt.p,{id:l.descriptionId,...i,ref:r})});Lw.displayName=Mw;var zw="DialogClose",Hw=b.forwardRef((t,r)=>{const{__scopeDialog:o,...i}=t,l=En(zw,o);return u.jsx(Wt.button,{type:"button",...i,ref:r,onClick:zt(t.onClick,()=>l.onOpenChange(!1))})});Hw.displayName=zw;function Mm(t){return t?"open":"closed"}var Bw="DialogTitleWarning",[eM,Ww]=DC(Bw,{contentName:xa,titleName:Dm,docsSlug:"dialog"}),ij=({titleId:t})=>{const r=Ww(Bw),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},lj="DialogDescriptionWarning",cj=({contentRef:t,descriptionId:r})=>{const i=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${Ww(lj).contentName}}.`;return b.useEffect(()=>{const l=t.current?.getAttribute("aria-describedby");r&&l&&(document.getElementById(r)||console.warn(i))},[i,t,r]),null},Zs=Cw,uj=Aw,Qs=Nw,Js=jw,ei=Rw,ti=Dw,xc=Lw,tM=Hw;const gf=t=>t==="danger"?"var(--status-red)":"var(--accent)",ni=({open:t,onOpenChange:r,title:o,description:i,confirmLabel:l,confirmKind:c="default",cancelLabel:f,onConfirm:h})=>{const{t:g}=ke(),m=f??g("common.cancel");return u.jsx(Zs,{open:t,onOpenChange:r,children:u.jsxs(Qs,{children:[u.jsx(Js,{"data-testid":"confirm-overlay",className:"app-overlay fixed inset-0 z-[60]"}),u.jsx("div",{className:"pointer-events-none fixed inset-0 z-[70] grid place-items-center p-4",children:u.jsxs(ei,{"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:[u.jsxs("div",{className:"flex items-start gap-3",children:[u.jsx("div",{"aria-hidden":!0,className:"flex h-9 w-9 shrink-0 items-center justify-center rounded",style:{background:`color-mix(in oklab, ${gf(c)} 14%, transparent)`,color:gf(c),border:`1px solid color-mix(in oklab, ${gf(c)} 30%, transparent)`},children:c==="danger"?u.jsx(lc,{size:18}):u.jsx(vS,{size:18})}),u.jsxs("div",{className:"min-w-0 flex-1",children:[u.jsx(ti,{"data-testid":"confirm-title",className:"text-lg font-semibold text-pri",children:o}),u.jsx(xc,{"data-testid":"confirm-description",className:"mt-1.5 text-sm text-sec",children:i})]})]}),u.jsxs("div",{className:"mt-5 flex justify-end gap-2",children:[u.jsx("button",{type:"button","data-testid":"confirm-cancel",onClick:()=>r(!1),autoFocus:c==="danger",className:"icon-btn",children:m}),u.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})]})]})})]})})},dj=["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
+ `),fj=["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
+ `),mj=["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
+ `),pj=["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
+ `),hj=[{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:dj},{nameStem:"factchecker",role:"custom",descriptionOverride:fj}],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:mj},{nameStem:"doc-reviewer",role:"custom",descriptionOverride:pj}],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 审查;写明读者、范围、必备章节,以及它要描述的代码或文件。"}}],My={build_review_test:{icon:u.jsx(LS,{size:16,"aria-hidden":!0}),titleKey:"scenario.build_review_test.title",descKey:"scenario.build_review_test.desc"},research_factcheck:{icon:u.jsx(eS,{size:16,"aria-hidden":!0}),titleKey:"scenario.research_factcheck.title",descKey:"scenario.research_factcheck.desc"},docs_pipeline:{icon:u.jsx(RS,{size:16,"aria-hidden":!0}),titleKey:"scenario.docs_pipeline.title",descKey:"scenario.docs_pipeline.desc"}},gj=({workspaceId:t})=>{const{language:r,t:o}=ke(),i=Jt(),[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)},x=()=>{!l||g||!f.trim()||(m(!0),lC(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 u.jsxs("div",{className:"mx-auto mt-6 w-full max-w-[420px]","data-testid":"scenario-team-cards",children:[u.jsxs("div",{className:"mb-2 flex items-center justify-center gap-1.5 text-xs font-medium uppercase tracking-wide text-ter",children:[u.jsx(q0,{size:12,"aria-hidden":!0}),o("scenario.sectionTitle")]}),u.jsx("div",{className:"flex flex-col gap-2",children:hj.map(S=>{const T=My[S.id];return u.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:[u.jsxs("div",{className:"flex items-center gap-2 text-pri",children:[T.icon,u.jsx("span",{className:"text-sm font-medium",children:o(T.titleKey)})]}),u.jsx("div",{className:"mt-1 text-xs text-ter",children:o(T.descKey)})]},S.id)})}),u.jsx(Zs,{open:l!==null,onOpenChange:S=>{S||v()},children:u.jsxs(Qs,{children:[u.jsx(Js,{className:"app-overlay fixed inset-0 z-[60]"}),u.jsx("div",{className:"pointer-events-none fixed inset-0 z-[70] grid place-items-center p-4",children:u.jsxs(ei,{"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:[u.jsx(ti,{className:"text-lg font-semibold text-pri",children:l?o(My[l.id].titleKey):""}),u.jsx(xc,{className:"mt-1 text-xs text-ter",children:o("scenario.goalHint")}),u.jsxs("label",{className:"mt-4 block",children:[u.jsx("span",{className:"mb-1 block text-xs font-medium text-sec",children:o("scenario.goalLabel")}),u.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"})]}),u.jsxs("div",{className:"mt-4 flex justify-end gap-2",children:[u.jsx("button",{type:"button",className:"icon-btn",onClick:v,disabled:g,"data-testid":"scenario-goal-cancel",children:o("scenario.cancel")}),u.jsx("button",{type:"button",className:"icon-btn icon-btn--primary disabled:cursor-not-allowed disabled:opacity-50",onClick:x,disabled:g||!f.trim(),"data-testid":"scenario-goal-apply",children:o(g?"scenario.applying":"scenario.apply")})]})]})})]})})]})},Uw=({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 x={};if(m)for(const[S,T]of Object.entries(m))T!==void 0&&(x[`data-${S}`]=T);return u.jsxs("span",{"data-testid":g,...x,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]})},vj={orchestrator:dm,coder:xS,reviewer:eE,tester:Ul,sentinel:NS,custom:cE},yj={orchestrator:"crown",coder:"code",reviewer:"review",tester:"test",sentinel:"sentinel",custom:"custom"},bj={orchestrator:"var(--accent)",coder:"var(--status-blue)",reviewer:"var(--status-purple)",tester:"var(--status-orange)",sentinel:"var(--status-green)",custom:"var(--text-secondary)"},wj={working:"var(--status-green)",idle:"var(--text-tertiary)",stopped:"var(--status-red)"},xj=({role:t,size:r=32,statusRing:o="none"})=>{const i=vj[t];return u.jsx(Uw,{size:r,color:bj[t],ringColor:o==="none"?null:wj[o],ringSurface:"var(--bg-2)",testId:"role-avatar",data:{role:t,icon:yj[t],"status-ring":o},children:u.jsx(i,{size:Math.round(r*.56),"aria-hidden":!0})})},kj={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"}},Sj={working:"var(--status-green)",idle:"var(--text-tertiary)",stopped:"var(--status-red)"},qw=t=>t?kj[t]??null:null,nM=({commandPresetId:t,fallback:r=null,size:o=20,testId:i="cli-agent-logo"})=>{const l=qw(t);if(!l)return r;const c=Math.round(o*.78);return u.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:u.jsx("img",{src:l.src,alt:"",decoding:"sync",width:c,height:c,style:{width:`${c}px`,height:`${c}px`,objectFit:"contain"}})})},Iw=({commandPresetId:t,workerRole:r,size:o=32,statusRing:i="none"})=>{const l=qw(t);if(!l)return u.jsx(xj,{role:r,size:o,statusRing:i});const c=i==="none"?null:Sj[i],f=Math.round(o*.78);return u.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:u.jsx("img",{src:l.src,alt:"",decoding:"sync",width:f,height:f,style:{width:`${f}px`,height:`${f}px`,objectFit:"contain"}})})},Pw=({initialValue:t,saving:r,setSaving:o,onSave:i,onCancel:l,className:c})=>{const f=Jt(),[h,g]=b.useState(t),m=b.useRef(null),y=b.useRef(!1);b.useEffect(()=>{const T=setTimeout(()=>{m.current?.focus(),m.current?.select()},50);return()=>clearTimeout(T)},[]);const v=async()=>{const T=h.trim();if(!T||T===t){l();return}o(!0);try{const k=await i(T);if(k.error){f.show({kind:"error",message:k.error}),g(t),setTimeout(()=>{m.current?.focus(),m.current?.select()},50),o(!1);return}}catch(k){const E=k instanceof Error?k.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()},x=T=>{T.stopPropagation(),T.key==="Enter"?(T.preventDefault(),v()):T.key==="Escape"&&(T.preventDefault(),y.current=!0,l())},S=()=>{y.current||v()};return u.jsx("input",{ref:m,type:"text",value:h,disabled:r,onChange:T=>g(T.target.value),onKeyDown:x,onBlur:S,maxLength:64,className:c,onClick:T=>T.stopPropagation()})},Kw=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)"},rM=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)"},Fw={working:"pill--green",idle:"pill--ghost",stopped:"pill--red"},Yw=t=>`role.${t}`,Xl=t=>t==="working"?"common.running":t==="idle"?"common.idle":"common.stopped",Ej=({hasRun:t,isPending:r=!1,isEditing:o=!1,onRenameWorker:i,onStartEditing:l,onCancelEditing:c,onAction:f,onClick:h,worker:g})=>{const{t:m}=ke(),y=At(),v=Kw(g),[x,S]=b.useState(!1),T=j=>A=>{if(A.stopPropagation(),j==="rename"){l?.();return}f?.(j,g)},k=g.ephemeral===!0&&g.spawnedBy==="workflow",E=g.ephemeral===!0&&g.spawnedBy==="orchestrator",C=k?"workflow":E?"orchestrator":null;if(y)return u.jsx(Cj,{ephemeralTone:C,hasRun:t,isPending:r,onAction:f,onClick:h,status:v,worker:g,isEditing:o,onRenameWorker:i,onCancelEditing:c});const _=o?"div":"button";return u.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:[u.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:C?{borderStyle:"dashed",borderColor:C==="workflow"?"var(--accent)":"var(--border-bright)"}:void 0,children:[u.jsxs("div",{className:"flex items-start gap-2",children:[u.jsx(Iw,{commandPresetId:g.commandPresetId,workerRole:g.role,size:40,statusRing:v.kind}),C?u.jsx("span",{className:"ml-auto rounded px-1.5 py-0.5 text-[10px] font-semibold uppercase tracking-wide",style:{background:C==="workflow"?"color-mix(in oklab, var(--accent) 18%, transparent)":"color-mix(in oklab, var(--text-secondary) 14%, transparent)",color:C==="workflow"?"var(--accent)":"var(--text-secondary)"},"data-testid":"worker-card-ephemeral-badge",title:C==="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:C==="workflow"?"workflow":"temp"}):null]}),u.jsxs("div",{className:"flex min-w-0 flex-1 flex-col gap-0.5",children:[o?u.jsx(Pw,{initialValue:g.name,saving:x,setSaving:S,onSave:j=>i(g,j),onCancel:()=>c?.(),className:"worker-card-name-input"}):u.jsx("span",{className:"truncate text-base font-medium leading-tight text-pri",title:g.name,children:g.name}),u.jsx("span",{className:"worker-card__role-tag truncate leading-none mt-1",children:m(Yw(g.role))})]}),u.jsx("div",{className:"flex min-w-0 flex-col gap-1.5",children:u.jsxs("div",{className:"flex items-center gap-1.5",children:[u.jsxs("span",{className:`pill ${Fw[v.kind]} worker-card__status`,role:"status",title:v.kind==="working"?m("worker.workingLegend"):m(Xl(v.kind)),children:[u.jsx("span",{className:v.dotClass,"aria-hidden":!0}),m(Xl(v.kind))]}),g.pendingTaskCount>0?u.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?u.jsxs("div",{className:"worker-card__actions",children:[t?y?u.jsxs(u.Fragment,{children:[u.jsx(Ts,{title:m("common.stop"),onClick:T("stop"),disabled:r,variant:"danger",testId:`worker-card-stop-${g.id}`,ariaLabel:m("worker.stopAria",{name:g.name}),children:u.jsx(pm,{size:12,"aria-hidden":!0})}),u.jsx(Ts,{title:m("common.restart"),onClick:T("restart"),disabled:r,testId:`worker-card-restart-${g.id}`,ariaLabel:m("worker.restartAria",{name:g.name}),children:u.jsx(mm,{size:12,"aria-hidden":!0})})]}):null:u.jsx(Ts,{title:m("common.start"),onClick:T("start"),disabled:r,variant:"primary",testId:`worker-card-start-${g.id}`,ariaLabel:m("worker.startAria",{name:g.name}),children:u.jsx(Ao,{size:12,"aria-hidden":!0})}),u.jsx(Ts,{title:m("worker.rename"),onClick:T("rename"),disabled:r||v.kind==="working",testId:`worker-card-rename-${g.id}`,ariaLabel:m("worker.renameAria",{name:g.name}),children:u.jsx(W0,{size:12,"aria-hidden":!0})}),u.jsx(Ts,{title:m("common.delete"),onClick:T("delete"),variant:"danger",testId:`worker-card-delete-${g.id}`,ariaLabel:m("worker.deleteAria",{name:g.name}),children:u.jsx(ic,{size:12,"aria-hidden":!0})})]}):null]})},Ts=({ariaLabel:t,children:r,disabled:o,onClick:i,testId:l,title:c,variant:f="default"})=>u.jsx(lt,{label:c,children:u.jsx("button",{type:"button",onClick:i,disabled:o,"aria-label":t,"data-testid":l,"data-variant":f,className:"worker-card__action",children:r})}),Cj=({ephemeralTone:t,hasRun:r,isPending:o,onAction:i,onClick:l,status:c,worker:f,isEditing:h=!1,onRenameWorker:g,onCancelEditing:m})=>{const{t:y}=ke(),[v,x]=b.useState(!1),[S,T]=b.useState(!1),k=b.useRef(!1),E=j=>{j==="rename"&&(k.current=!0),x(!1),i?.(j,f)},C=y(Yw(f.role)),_=h?"div":"button";return u.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:[u.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:[u.jsx(Iw,{commandPresetId:f.commandPresetId,workerRole:f.role,size:40,statusRing:c.kind}),u.jsxs("span",{className:"flex min-w-0 flex-1 flex-col gap-0.5",children:[u.jsxs("span",{className:"flex min-w-0 items-center gap-1.5",children:[h?u.jsx(Pw,{initialValue:f.name,saving:S,setSaving:T,onSave:j=>g(f,j),onCancel:()=>m?.(),className:"worker-card-name-input flex-1"}):u.jsx("span",{className:"truncate text-sm font-medium text-pri",children:f.name}),t?u.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]}),u.jsx("span",{className:"truncate text-xs text-ter",children:C})]}),u.jsxs("span",{className:`pill ${Fw[c.kind]} worker-card__status shrink-0`,role:"status",children:[u.jsx("span",{className:c.dotClass,"aria-hidden":!0}),y(Xl(c.kind))]})]}),i?u.jsxs(u.Fragment,{children:[u.jsx("button",{type:"button","aria-label":y("worker.actionsAria",{name:f.name}),"data-testid":`worker-card-menu-${f.id}`,onClick:()=>x(!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:u.jsx(CS,{size:18,"aria-hidden":!0})}),u.jsx(Zs,{open:v,onOpenChange:x,children:u.jsxs(Qs,{children:[u.jsx(Js,{className:"app-overlay fixed inset-0 z-40"}),u.jsx("div",{className:"pointer-events-none fixed inset-0 z-50 grid items-end",children:u.jsxs(ei,{onCloseAutoFocus:j=>{k.current&&(j.preventDefault(),k.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:[u.jsxs(ti,{className:"flex items-center gap-2 border-b px-4 py-3 text-sm font-semibold text-pri",style:{borderColor:"var(--border)"},children:[u.jsx("span",{className:"truncate",children:f.name}),u.jsx("span",{className:"shrink-0 text-xs font-normal text-ter",children:y(Xl(c.kind))})]}),u.jsx(xc,{className:"sr-only",children:y("worker.actionsAria",{name:f.name})}),r?u.jsxs(u.Fragment,{children:[u.jsx(As,{disabled:o,icon:u.jsx(pm,{size:16,"aria-hidden":!0}),label:y("common.stop"),onSelect:()=>E("stop"),testId:`worker-card-stop-${f.id}`,danger:!0}),u.jsx(As,{disabled:o,icon:u.jsx(mm,{size:16,"aria-hidden":!0}),label:y("common.restart"),onSelect:()=>E("restart"),testId:`worker-card-restart-${f.id}`})]}):u.jsx(As,{disabled:o,icon:u.jsx(Ao,{size:16,"aria-hidden":!0}),label:y("common.start"),onSelect:()=>E("start"),testId:`worker-card-start-${f.id}`}),u.jsx(As,{disabled:o||c.kind==="working",icon:u.jsx(W0,{size:16,"aria-hidden":!0}),label:y("worker.rename"),onSelect:()=>E("rename"),testId:`worker-card-rename-${f.id}`}),u.jsx(As,{icon:u.jsx(ic,{size:16,"aria-hidden":!0}),label:y("common.delete"),onSelect:()=>E("delete"),testId:`worker-card-delete-${f.id}`,danger:!0})]})})]})})]}):null]})},As=({danger:t=!1,disabled:r=!1,icon:o,label:i,onSelect:l,testId:c})=>u.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]}),Tj=["working","idle","stopped"],Ly=t=>t==="working"?"common.running":t==="idle"?"common.idle":"common.stopped",Aj=t=>{const r={idle:[],working:[],stopped:[]};for(const o of t)r[Kw(o).kind].push(o);return{sections:Tj.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}}},_j=({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:x})=>{const{t:S}=ke(),{sections:T,summary:k}=b.useMemo(()=>Aj(v),[v]),E=b.useMemo(()=>new Map(y.map(L=>[L.agent_id,L.run_id])),[y]),[C,_]=b.useState(null),[j,A]=b.useState(null),O=(L,B)=>{if(L==="start"){h(B);return}if(L==="stop"){const q=E.get(B.id);q&&c?.(q);return}if(L==="restart"){const q=E.get(B.id);q&&f?.(B.id,q);return}if(L==="rename"){A(B.id);return}L==="delete"&&_(B)},D=()=>{C&&(r(C),_(null))};return u.jsxs("div",{className:"flex min-h-0 min-w-0 flex-1 flex-col",style:{background:"var(--bg-2)"},"data-testid":"workers-pane",children:[u.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:[u.jsxs("div",{className:"flex items-center gap-2.5",children:[u.jsx("span",{className:"text-lg font-semibold text-pri",children:S("worker.teamMembers")}),u.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}),u.jsx("div",{className:"flex-1"}),g?u.jsxs("button",{type:"button",onClick:o,className:"icon-btn icon-btn--tertiary","aria-label":S("shellTerminal.openAria"),"data-testid":"open-workspace-shell",children:[u.jsx(hm,{size:14,"aria-hidden":!0})," ",S("shellTerminal.open")]}):null,u.jsxs("button",{type:"button",onClick:t,className:"icon-btn icon-btn--primary","data-testid":"add-worker-trigger",children:[u.jsx(Vd,{size:14,"aria-hidden":!0})," ",S("addWorker.create")]})]}),v.length>0?u.jsxs("div",{className:"flex items-center gap-3 text-xs text-ter",children:[u.jsxs("span",{className:"inline-flex items-center gap-1.5",children:[u.jsx("span",{className:"status-dot status-dot--working","aria-hidden":!0}),u.jsx("span",{className:"text-sec",children:k.working})," ",S("common.running")]}),u.jsxs("span",{className:"inline-flex items-center gap-1.5",children:[u.jsx("span",{className:"status-dot status-dot--idle","aria-hidden":!0}),u.jsx("span",{className:"text-sec",children:k.idle})," ",S("common.idle")]}),u.jsxs("span",{className:"inline-flex items-center gap-1.5",children:[u.jsx("span",{className:"status-dot status-dot--stopped","aria-hidden":!0}),u.jsx("span",{className:"text-sec",children:k.stopped})," ",S("common.stopped")]})]}):null]}),u.jsx("div",{className:"workers-pane-body scroll-y min-h-0 min-w-0 flex-1 px-2 py-2",children:v.length===0?u.jsxs(u.Fragment,{children:[u.jsx(Xs,{icon:u.jsx(Vd,{size:28}),title:S("worker.emptyTitle"),description:S("worker.emptyDesc"),action:u.jsxs("button",{type:"button",onClick:t,className:"icon-btn icon-btn--primary","data-testid":"add-worker-empty",children:[u.jsx(Vd,{size:14,"aria-hidden":!0})," ",S("worker.emptyAdd")]})}),x?u.jsx(gj,{workspaceId:x}):null]}):u.jsx("div",{"data-testid":"worker-grid",children:T.map(L=>u.jsxs("section",{className:"mb-3 last:mb-0",children:[u.jsxs("div",{className:"flex items-center gap-1.5 px-2 py-1 text-xs font-medium uppercase tracking-wide text-ter",children:[S(Ly(L.kind)),u.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})]}),u.jsx("ul",{"aria-label":`${S(Ly(L.kind))} team members`,className:"worker-card-grid",children:L.workers.map(B=>u.jsx("li",{children:u.jsx(Ej,{hasRun:E.has(B.id),isPending:m===B.id,isEditing:j===B.id,onRenameWorker:async(q,te)=>v.some(V=>V.id!==q.id&&V.name.toLowerCase()===te.toLowerCase())?{error:S("addWorker.agentExists")}:l(q,te),onStartEditing:()=>A(B.id),onCancelEditing:()=>A(null),onAction:O,onClick:i,worker:B})},B.id))})]},L.kind))})}),u.jsx(ni,{open:C!==null,onOpenChange:L=>{L||_(null)},title:C?S("worker.deleteConfirm",{name:C.name}):"",description:C?S("worker.deleteDescription",{name:C.name}):"",confirmLabel:S("worker.deleteMember"),confirmKind:"danger",onConfirm:D})]})},Nj=b.lazy(()=>Tt(()=>import("./AddWorkerDialog-CTOsPurT.js"),__vite__mapDeps([2,3,4])).then(t=>({default:t.AddWorkerDialog}))),jj=b.lazy(()=>Tt(()=>import("./WorkerModal-DcxIBPlu.js"),[]).then(t=>({default:t.WorkerModal}))),Rj=({activeWorkerId:t,onCreateWorker:r,onDeleteWorker:o,onDeleteWorkspace:i,onStartWorker:l,onStopWorker:c,onRestartWorker:f,onOrchestratorResult:h,onRequestAddWorkspace:g,onShellRunClosed:m,onShellRunStarted:y,onTryDemo:v,welcomeDisabledReason:x,orchestratorAutostartError:S,orchestratorAutostartRunId:T,terminalRuns:k,workers:E,workspace:C,onActiveWorkerChange:_,showInlineActionCenter:j=!0})=>{const{t:A}=ke(),O=At(),[D,L]=b.useState(null),B=t===void 0?D:t,q=b.useCallback(xe=>{_?_(xe):L(xe)},[_]),[te,ee]=b.useState(!1),[V,J]=b.useState("orchestrator"),X=Qb();b.useEffect(()=>()=>Zb(!1),[]);const[$,M]=b.useState(null),[I,P]=b.useState(null),[Z,K]=b.useState(null),[R,W]=b.useState(!1),re=Jt(),ae=aN({createWorker:r,open:te,workers:E}),fe=G_({workspaceId:C?.id??"",terminalRuns:k,autostartError:S,suppressAutostartRunId:T,onClearAutostartError:()=>{C&&h(C.id,{ok:!0,error:null,run_id:null})},onAfterStart:xe=>{C&&h(C.id,xe)}}),me=W_(),ce=E.find(xe=>xe.id===B)??null;b.useEffect(()=>{B&&!ce&&q(null)},[B,ce,q]);const le=__({workspaceId:C?.id??"",workers:E,terminalRuns:k}),ie=le.tabs.filter(xe=>xe.kind==="shell"),ue=C?k.filter(xe=>cc(xe,C.id)):[],{closeShellTab:pe,openShell:Ae,shellError:Ce,shellStarting:Se,startNewShell:Qe}=H_({onCloseFailed:xe=>re.show({kind:"error",message:A("shellTerminal.closeFailed",{message:xe})}),onShellRunClosed:m,onShellRunStarted:y,panelTabs:le,shellRuns:ue,workspaceId:C?.id??null});if(b.useEffect(()=>{ae.createWorkerError&&re.show({kind:"error",message:ae.createWorkerError})},[ae.createWorkerError,re]),b.useEffect(()=>{$&&re.show({kind:"error",message:$})},[$,re]),b.useEffect(()=>{I&&re.show({kind:"error",message:I})},[I,re]),b.useEffect(()=>{Ce&&re.show({kind:"error",message:Ce})},[Ce,re]),b.useEffect(()=>{q(null),M(null),P(null),K(null),W(!1),J("orchestrator")},[C?.id,q]),!C){const xe={onAddWorkspace:g};return v&&(xe.onTryDemo=v),x&&(xe.disabledReason=x),u.jsx(sN,{...xe})}const ft=ce?z_(k,ce.id):void 0,en=xe=>{M(null),o(xe.id).then(()=>q(null)).catch(He=>{M(He instanceof Error?He.message:String(He))})},Cn=xe=>{P(null),K(xe.id),l(xe.id).then(({error:He})=>{He&&P(He)}).catch(He=>{P(He instanceof Error?He.message:String(He))}).finally(()=>K(null))},pn=xe=>{c(xe).then(({error:He})=>{He&&re.show({kind:"error",message:He})})},Tn=(xe,He)=>{P(null),K(xe),f(xe,He).then(({error:mt})=>{mt&&P(mt)}).catch(mt=>{P(mt instanceof Error?mt.message:String(mt))}).finally(()=>K(null))},tn=async(xe,He)=>{try{return await uC(C.id,xe.id,He),re.show({kind:"success",message:A("worker.renameSuccess",{name:He})}),{error:null}}catch(mt){const $r=mt instanceof Error?mt.message:String(mt);return re.show({kind:"error",message:A("worker.renameFailed",{message:$r})}),{error:$r}}},de=`${(me.orchPct*100).toFixed(2)}%`,Te=()=>{W(!1),Ae()},$e=()=>{W(!1),Qe()},Vr=u.jsx($_,{state:fe.state,onStop:fe.stop,onRemoveWorkspace:()=>{i(C).catch(xe=>{const He=xe instanceof Error?xe.message:String(xe);re.show({kind:"error",message:`Delete failed: ${He}`})})},onStart:fe.start,onRestart:fe.restart}),Ro=u.jsxs("div",{className:"relative flex min-h-0 min-w-0 flex-1 flex-col",children:[u.jsx(_j,{onAddWorkerClick:()=>ee(!0),onDeleteWorker:en,onOpenShellTerminal:Te,onOpenWorker:xe=>q(xe.id),onRenameWorker:tn,onStartWorker:Cn,onStopWorker:pn,onRestartWorker:Tn,startingWorkerId:Z,terminalRuns:k,workers:E,workspaceId:C.id}),R?null:u.jsx(E_,{tabs:ie,activeId:le.activeId,scopeKey:C.id,onSelect:le.setActive,onClose:xe=>{xe.startsWith("shell:")&&pe(xe.slice(6)),le.closeTab(xe)},onClosePanel:()=>W(!0),onNewShell:$e,newShellPending:Se,onStartWorker:xe=>{const He=E.find(mt=>mt.id===xe);He&&Cn(He)},startingWorkerId:Z})]});return u.jsxs("div",{className:"flex min-h-0 min-w-0 flex-1 flex-col",style:{background:"var(--bg-2)"},children:[u.jsx(g_,{terminalRuns:k,workers:E,workspace:C}),j?u.jsx(n_,{workspaceId:C.id,onOpenWorker:q},C.id):null,O?u.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:[u.jsxs("div",{role:"tablist","aria-label":A("mobile.nav.team"),className:"flex shrink-0 items-center gap-1 border-b p-2",style:{borderColor:"var(--border)"},children:[["orchestrator","workers"].map(xe=>{const He=V===xe,mt=`mobile-team-tab-${xe}`,$r=`mobile-team-panel-${xe}`;return u.jsxs("button",{id:mt,type:"button",role:"tab","aria-selected":He,"aria-controls":$r,tabIndex:He?0:-1,"data-active":He||void 0,"data-testid":mt,onClick:()=>J(xe),className:"flex min-h-11 flex-1 items-center justify-center gap-1.5 rounded-md text-sm font-medium",style:He?{background:"var(--accent)",color:"var(--bg-0)"}:{background:"var(--bg-3)",color:"var(--text-secondary)"},children:[u.jsx("span",{children:A(xe==="orchestrator"?"mobile.team.orchestrator":"mobile.team.workers")}),xe==="workers"&&E.length>0?u.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:He?{background:"var(--bg-0)",color:"var(--accent)"}:{background:"var(--bg-1)",color:"var(--text-secondary)"},children:E.length}):null]},xe)}),u.jsx("button",{type:"button",onClick:a_,"aria-pressed":X,"aria-label":A(X?"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:X?u.jsx(VS,{size:16,"aria-hidden":!0}):u.jsx(FS,{size:16,"aria-hidden":!0})})]}),u.jsxs("div",{className:"relative min-h-0 min-w-0 flex-1 overflow-hidden","data-testid":"mobile-team-panel",children:[u.jsx("div",{id:"mobile-team-panel-orchestrator",role:"tabpanel","aria-labelledby":"mobile-team-tab-orchestrator","aria-hidden":V!=="orchestrator",className:"mobile-team-pane flex min-h-0 min-w-0 flex-col","data-active":V==="orchestrator"?"true":"false",children:Vr}),u.jsx("div",{id:"mobile-team-panel-workers",role:"tabpanel","aria-labelledby":"mobile-team-tab-workers","aria-hidden":V!=="workers",className:"mobile-team-pane flex min-h-0 min-w-0 flex-col","data-active":V==="workers"?"true":"false",children:Ro})]})]}):u.jsxs("div",{ref:me.containerRef,className:"relative flex min-h-0 min-w-0 flex-1 overflow-hidden","data-testid":"workspace-detail-panes",children:[u.jsx("div",{className:"flex min-w-[480px] shrink-0 flex-col overflow-hidden",style:{width:de},"data-testid":"orchestrator-pane-shell",children:Vr}),u.jsx("div",{role:"separator","aria-orientation":"vertical","aria-label":A("workerPane.resize"),"aria-valuenow":Math.round(me.orchPct*100),"aria-valuemin":30,"aria-valuemax":78,tabIndex:0,className:"pane-splitter",style:{left:`calc(${de} - 4px)`},"data-dragging":me.dragging||void 0,"data-testid":"pane-splitter",onPointerDown:me.beginDrag,onKeyDown:me.onKeyDown}),Ro]}),ce?u.jsx(b.Suspense,{fallback:null,children:u.jsx(jj,{onClose:()=>q(null),onStart:Cn,runId:ft?.run_id??null,startError:I,starting:Z===ce.id,worker:ce})}):null,te?u.jsx(b.Suspense,{fallback:null,children:u.jsx(Nj,{commandPresets:ae.commandPresets,commandPresetId:ae.commandPresetId,creating:ae.creating,customTemplates:ae.customTemplates,onApplyMarketplaceImport:ae.applyMarketplaceImport,onClose:()=>ee(!1),onDeleteTemplate:ae.deleteTemplate,onNameChange:ae.setWorkerName,onPresetChange:ae.setCommandPresetId,onRandomName:ae.randomizeWorkerName,onRoleDescriptionChange:ae.setRoleDescription,onRoleDescriptionReset:ae.resetRoleDescription,onRoleChange:ae.setWorkerRole,onSaveAsTemplate:ae.saveAsTemplate,onSubmit:xe=>ae.submit(xe,()=>ee(!1)),onStartupCommandChange:ae.setStartupCommand,onTemplateChange:ae.selectTemplate,roleDescription:ae.roleDescription,roleDescriptionDefault:ae.roleDescriptionDefault,selectedTemplateId:ae.selectedTemplateId,startupCommand:ae.startupCommand,templateBusy:ae.templateBusy,workerName:ae.workerName,workerRole:ae.workerRole})}):null]})},Oj=({activeId:t,activeWorkspace:r,activeWorkerId:o,bootstrapError:i,demoMode:l,onActiveWorkerChange:c,onDeleteWorkspace:f,onExitDemo:h,onRequestAddWorkspace:g,onShellRunClosed:m,onShellRunStarted:y,onTryDemo:v,orchestratorAutostartErrors:x,orchestratorAutostartRunIds:S,recordOrchestratorResult:T,terminalRuns:k,workerActions:E,workers:C,workspacesLoading:_,showInlineActionCenter:j})=>l?u.jsx(DE,{onExit:h}):_&&!r?u.jsx("div",{className:"flex flex-1 items-center justify-center",children:u.jsx(To,{size:24,className:"animate-spin text-ter"})}):u.jsx(Rj,{activeWorkerId:o,onCreateWorker:E.createWorker,onDeleteWorker:E.deleteWorker,onDeleteWorkspace:f,onStartWorker:E.startWorker,onStopWorker:E.stopWorkerRun,onRestartWorker:E.restartWorkerRun,onOrchestratorResult:T,onRequestAddWorkspace:g,onShellRunClosed:m,onShellRunStarted:y,onTryDemo:v,onActiveWorkerChange:c,welcomeDisabledReason:i??void 0,orchestratorAutostartError:t?x[t]??null:null,orchestratorAutostartRunId:t?S[t]??null:null,terminalRuns:k,workers:C,workspace:r,showInlineActionCenter:j}),Al={id:"demo-workspace",name:"demo-todo-app",path:"/Users/you/demo-todo-app"},Dj=[{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"}],Mj=`# 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
+ `,Lj=()=>{const[t,r]=b.useState(!1);return{demoMode:t,enableDemo:()=>r(!0),exitDemo:()=>r(!1)}},zj=t=>{const{demoMode:r,workspaces:o,activeWorkspaceId:i,workersByWorkspaceId:l}=t,c=r?[Al]:o,f=r?{[Al.id]:Dj}:l,h=r?Al.id:i,g=r?Al:o?.find(y=>y.id===i);return{effectiveActiveWorkspaceId:h,effectiveWorkspaces:c,effectiveWorkersByWorkspaceId:f,effectiveActiveWorkspace:g,pollWorkspaceId:r?null:i}},Hj=[{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"}],Bj=[{descriptionKey:"notifications.detail.brief.description",labelKey:"notifications.detail.brief.label",value:"brief"},{descriptionKey:"notifications.detail.detailed.description",labelKey:"notifications.detail.detailed.label",value:"detailed"}],Wj=()=>{const{t}=ke(),r=At(),[o,i]=b.useState(!1),l=b.useRef(null),c=b.useRef(null),{notify:f,previewSound:h,requestDesktopNotifications:g,settings:m,updateSettings:y}=yc(),v=typeof window<"u"&&!("Notification"in window),x=b.useMemo(()=>Hj.map(k=>({...k,description:t(k.descriptionKey),label:t(k.labelKey)})),[t]),S=b.useMemo(()=>Bj.map(k=>({...k,description:t(k.descriptionKey),label:t(k.labelKey)})),[t]),T=k=>{if(!k){y({desktop:!1});return}g()};return b.useEffect(()=>{if(!o)return;const k=C=>{C.key==="Escape"&&(i(!1),c.current?.focus())},E=C=>{const _=l.current;_&&!_.contains(C.target)&&i(!1)};return document.addEventListener("keydown",k),document.addEventListener("pointerdown",E),()=>{document.removeEventListener("keydown",k),document.removeEventListener("pointerdown",E)}},[o]),u.jsxs("div",{ref:l,className:"relative",children:[u.jsx(lt,{label:t("notifications.settings.tooltip"),children:u.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(k=>!k),children:u.jsx(Of,{size:14,"aria-hidden":!0})})}),o?u.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:[u.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:[u.jsx("div",{className:"flex h-8 w-8 shrink-0 items-center justify-center rounded bg-3 text-sec",children:u.jsx(Of,{size:16,"aria-hidden":!0})}),u.jsxs("div",{className:r?"min-w-0 flex-1":"min-w-0",children:[u.jsx("div",{className:"text-sm font-semibold text-pri",children:t("notifications.settings.heading")}),r?null:u.jsx("div",{className:"text-ter text-xs",children:t("notifications.settings.subtitle")})]}),r?u.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:u.jsx(vo,{size:20,"aria-hidden":!0})}):null]}),u.jsxs("div",{className:r?"flex-1 overflow-y-auto p-4":"contents",children:[u.jsxs("section",{className:"mb-3",children:[u.jsxs("div",{className:"mb-2 flex items-center gap-1.5 text-ter text-xs uppercase tracking-wider",children:[u.jsx(ql,{size:12,"aria-hidden":!0}),t("notifications.sound.sectionLabel")]}),u.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:x.map(k=>u.jsxs("div",{className:"relative min-h-[78px] rounded border transition-colors",style:{background:m.sound===k.value?`color-mix(in oklab, ${k.accent} 10%, var(--bg-2))`:"var(--bg-2)",borderColor:m.sound===k.value?`color-mix(in oklab, ${k.accent} 54%, var(--border-bright))`:"var(--border)"},children:[u.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:[u.jsx("input",{type:"radio",name:"notification-sound",value:k.value,checked:m.sound===k.value,className:"sr-only",onChange:()=>y({sound:k.value})}),u.jsxs("span",{className:"mb-1 flex items-center gap-2",children:[u.jsx("span",{className:"flex h-5 w-5 items-center justify-center rounded",style:{background:`color-mix(in oklab, ${k.accent} 16%, transparent)`,color:k.accent},children:k.value==="off"?u.jsx(P0,{size:12,"aria-hidden":!0}):u.jsx(ql,{size:12,"aria-hidden":!0})}),u.jsx("span",{className:"font-medium text-pri text-xs",children:k.label}),k.length==="long"?u.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===k.value?u.jsx(Eo,{size:12,className:"ml-auto text-pri","aria-hidden":!0}):null]}),u.jsx("span",{className:"block text-ter text-xs",children:k.description})]}),k.value!=="off"?u.jsx("button",{type:"button","aria-label":t("notifications.sound.previewAria",{label:k.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(k.value),children:u.jsx(Ao,{size:12,"aria-hidden":!0})}):null]},k.value))})]}),u.jsxs("section",{className:"mb-3",children:[u.jsxs("div",{className:"mb-2 flex items-center gap-1.5 text-ter text-xs uppercase tracking-wider",children:[u.jsx(H0,{size:12,"aria-hidden":!0}),t("notifications.detail.sectionLabel")]}),u.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(k=>u.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===k.value?"var(--bg-3)":"transparent",color:m.detail===k.value?"var(--text-primary)":"var(--text-secondary)"},children:[u.jsx("input",{type:"radio",name:"notification-detail",value:k.value,checked:m.detail===k.value,className:"sr-only",onChange:()=>y({detail:k.value})}),u.jsx("span",{className:"block font-medium text-xs",children:k.label}),u.jsx("span",{className:"block text-ter text-xs",children:k.description})]},k.value))})]}),u.jsxs("label",{className:"mb-3 flex items-start gap-2 rounded border p-2 text-sec text-xs",children:[u.jsx("input",{type:"checkbox","aria-label":t("notifications.desktop.aria"),checked:m.desktop,disabled:v,className:"mt-0.5",onChange:k=>T(k.currentTarget.checked)}),u.jsxs("span",{children:[u.jsx("span",{className:"block font-medium text-pri",children:t("notifications.desktop.label")}),u.jsx("span",{className:"text-ter",children:t(v?"notifications.desktop.unsupported":"notifications.desktop.helper")})]})]}),u.jsxs("div",{className:"flex justify-end gap-2 border-t pt-3",style:{borderColor:"var(--border)"},children:[u.jsx("button",{type:"button",className:"icon-btn",onClick:()=>i(!1),children:t("common.close")}),u.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]})},Vw=({checked:t,disabled:r,onChange:o,...i})=>u.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:u.jsx("span",{className:"settings-switch__thumb"})}),Uj=t=>Math.max(0,Math.ceil((t-Date.now())/1e3)),qj=()=>{const{t}=ke(),[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 x=window.setInterval(()=>g(Date.now()),1e3);return()=>window.clearInterval(x)},[r]);const m=async()=>{f(!1),l(!0);try{const x=await SC();o(x),g(Date.now())}catch{f(!0)}finally{l(!1)}};if(!r)return u.jsxs("div",{className:"p-1.5",children:[u.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:[u.jsx(U0,{size:14,"aria-hidden":!0}),t("remote.addDevice")]}),c?u.jsx("div",{className:"mt-1 text-xs",style:{color:"var(--text-error)"},role:"alert",children:t("remote.qr.startFailed")}):null]});const y=Uj(r.expiresAt),v=y<=0||h>=r.expiresAt;return u.jsxs("div",{className:"p-1.5","data-testid":"remote-qr-panel",children:[u.jsx("div",{className:"text-sm font-medium text-pri",children:t("remote.qr.title")}),u.jsx("p",{className:"mt-0.5 mb-2 text-xs text-ter",children:t("remote.qr.instructions")}),u.jsxs("div",{className:"flex flex-col items-center gap-2",children:[v?u.jsx("div",{className:"text-xs",style:{color:"var(--text-error)"},"data-testid":"remote-qr-expired",children:t("remote.qr.expired")}):u.jsxs(u.Fragment,{children:[u.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}),u.jsx("div",{className:"text-xs text-ter","data-testid":"remote-qr-countdown",children:t("remote.qr.expiresIn",{seconds:y})})]}),u.jsxs("div",{className:"flex gap-2",children:[v?u.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,u.jsx("button",{type:"button","data-testid":"remote-qr-cancel",onClick:()=>o(null),className:"icon-btn",children:t("remote.qr.cancel")})]})]})]})},Ij={ok:"remote.audit.result.ok",rejected:"remote.audit.result.rejected",error:"remote.audit.result.error"},Pj=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`},Kj=()=>{const{t}=ke(),[r,o]=b.useState(!1),[i,l]=b.useState(null),[c,f]=b.useState(!1),h=b.useCallback(async()=>{f(!1);try{l(await AC(100))}catch{f(!0)}},[]);return b.useEffect(()=>{r&&h()},[r,h]),u.jsxs("div",{className:"mt-2","data-testid":"remote-audit-view",children:[u.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:[u.jsx(Wl,{size:12,"aria-hidden":!0,className:"shrink-0"}),u.jsx("span",{className:"flex-1 text-left",children:t(r?"remote.audit.hide":"remote.audit.show")}),r?u.jsx(Co,{size:12,"aria-hidden":!0,className:"shrink-0 text-ter"}):u.jsx(oc,{size:12,"aria-hidden":!0,className:"shrink-0 text-ter"})]}),r?u.jsx("div",{className:"mt-1.5",children:c?u.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?u.jsx("div",{className:"px-2 py-2 text-xs text-ter",children:t("remote.audit.empty")}):u.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 u.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:[u.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}),u.jsxs("span",{className:"min-w-0 flex-1 truncate",children:[u.jsx("span",{className:"font-medium text-pri",children:g.action}),g.endpoint?u.jsx("span",{className:"ml-1 text-ter",children:g.endpoint}):null,g.preview?u.jsxs("span",{className:"ml-1 text-ter",children:["· ",g.preview]}):null,typeof g.byteCount=="number"?u.jsxs("span",{className:"ml-1 text-ter",children:["· ",t("remote.audit.bytes",{count:g.byteCount})]}):null]}),m?u.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(Ij[g.result]),g.rejectReason?` · ${g.rejectReason}`:""]}):null,u.jsx("span",{className:"shrink-0 tabular-nums text-ter",children:Pj(g.ts)})]},g.id)})})}):null]})},zy=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`},Fj=({reloadKey:t=0})=>{const{t:r}=ke(),o=Jt(),[i,l]=b.useState(null),[c,f]=b.useState(!1),[h,g]=b.useState(null),m=b.useCallback(async()=>{f(!1);try{const x=await ab();l(x)}catch{f(!0)}},[]);b.useEffect(()=>{m()},[m,t]);const y=async x=>{try{await TC(x.deviceId),o.show({kind:"success",message:r("remote.devices.revoked",{name:x.name})}),await m()}catch{o.show({kind:"error",message:r("remote.devices.revokeFailed")})}},v=(i??[]).filter(x=>!x.revoked);return u.jsxs("div",{className:"p-1.5","data-testid":"remote-device-list",children:[u.jsx("div",{className:"mb-1 text-xs font-medium uppercase tracking-wider text-ter",children:r("remote.devices.heading")}),c?u.jsx("div",{className:"text-xs",style:{color:"var(--text-error)"},role:"alert",children:r("remote.devices.loadFailed")}):v.length===0?u.jsx("div",{className:"text-xs text-ter",children:r("remote.devices.empty")}):u.jsx("ul",{className:"flex flex-col gap-1",children:v.map(x=>u.jsxs("li",{className:"flex items-center justify-between gap-2 rounded p-1.5 hover:bg-3","data-testid":`remote-device-${x.deviceId}`,children:[u.jsxs("span",{className:"min-w-0",children:[u.jsx("span",{className:"block truncate text-sm text-pri",children:x.name}),u.jsx("span",{className:"block text-xs text-ter",children:x.lastActive===null?r("remote.devices.neverActive"):zy(x.lastActive)==="<1m"?r("remote.devices.activeNow"):r("remote.devices.lastActive",{ago:zy(x.lastActive)})})]}),u.jsx("button",{type:"button","data-testid":`remote-device-revoke-${x.deviceId}`,"aria-label":r("remote.devices.revokeAria",{name:x.name}),onClick:()=>g(x),className:"icon-btn icon-btn--danger shrink-0",children:r("remote.devices.revoke")})]},x.deviceId))}),u.jsx(ni,{open:h!==null,onOpenChange:x=>{x||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)}})]})},Yj=2e3,Pf={enabled:!1,loggedIn:!1,gatewayUrl:null,connected:!1,connection:"disabled"},$w=b.createContext({status:Pf,loading:!0,setEnabled:async()=>{},pending:null,refresh:async()=>{}}),Vj=({children:t})=>{const r=At(),[o,i]=b.useState(Pf),[l,c]=b.useState(!0),[f,h]=b.useState(null);b.useEffect(()=>{let v=!1;return Gd().then(x=>{v||i(x)}).catch(()=>{}).finally(()=>{v||c(!1)}),()=>{v=!0}},[]);const g=b.useCallback(async v=>{const x=await kC(v);i(x),x.enabled||h(null)},[]),m=b.useCallback(async()=>{const v=await Gd().catch(()=>Pf);i(v),v.enabled&&v.loggedIn&&!r?h(await Jv().catch(()=>null)):h(null)},[r]),y=o.enabled&&o.loggedIn&&!r;return b.useEffect(()=>{if(!y){h(null);return}let v=!1;const x=()=>{Gd().then(T=>{v||i(T)}).catch(()=>{}),Jv().then(T=>{v||h(T)}).catch(()=>{})};x();const S=window.setInterval(x,Yj);return()=>{v=!0,window.clearInterval(S)}},[y]),u.jsx($w.Provider,{value:{status:o,loading:l,setEnabled:g,pending:f,refresh:m},children:t})},Lm=()=>b.useContext($w),$j={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)"},Gj={connecting:"remote.status.connecting",reconnecting:"remote.status.reconnecting",revoked:"remote.status.revoked"},Xj=()=>{const{t}=ke(),r=Jt(),o=At(),{status:i,loading:l,setEnabled:c,pending:f}=Lm(),h=$j[i.connection],g=Gj[i.connection],[m,y]=b.useState(!1),[v,x]=b.useState(!1),[S,T]=b.useState(!1),[k,E]=b.useState(!1),[C,_]=b.useState(!1),j=b.useRef(null),[A,O]=b.useState(0),D=b.useRef(!1);b.useEffect(()=>{f?D.current=!0:D.current&&(D.current=!1,O(te=>te+1))},[f]),b.useEffect(()=>()=>{j.current&&clearTimeout(j.current)},[]);const L=async te=>{x(!1),y(!0);try{await c(te)}catch{x(!0)}finally{y(!1)}},B=te=>{if(!te&&o){T(!0);return}L(te)},q=async()=>{if(!k){E(!0);try{const te=OC().then(ee=>JSON.stringify(ee,null,2));await sb(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 u.jsxs("div",{className:"settings-section","data-testid":"remote-access-section",children:[u.jsxs("div",{className:"settings-section__heading",children:[u.jsx(U0,{size:12,"aria-hidden":!0}),u.jsx("span",{children:t("remote.section")})]}),u.jsxs("div",{className:"settings-toggle-row",onClick:()=>{!l&&!m&&B(!i.enabled)},children:[u.jsxs("span",{className:"min-w-0 flex-1 text-left",children:[u.jsx("span",{className:"block text-sm font-medium text-pri",children:t("remote.enable.label")}),u.jsx("span",{className:"mt-0.5 block text-xs text-ter leading-relaxed",children:t("remote.enable.description")})]}),u.jsx("div",{className:"mt-0.5 shrink-0",children:u.jsx(Vw,{checked:i.enabled,disabled:l||m,onChange:B,"data-testid":"settings-toggle-remote","aria-label":t("remote.enable.label")})})]}),v?u.jsx("div",{className:"mt-1 ml-2 text-xs",style:{color:"var(--text-error)"},role:"alert",children:t("settings.saveError")}):null,u.jsxs("button",{type:"button","data-testid":"remote-copy-diagnostics",onClick:q,disabled:k,className:"icon-btn mt-2 w-full justify-center pointer-coarse:min-h-11",children:[C?u.jsx(Eo,{size:12,"aria-hidden":!0}):u.jsx(sc,{size:12,"aria-hidden":!0}),u.jsx("span",{children:t(k?"remote.diagnostics.copying":C?"remote.diagnostics.copied":"remote.diagnostics.copy")})]}),i.enabled?u.jsxs("div",{className:"mt-2 border-t pt-2",style:{borderColor:"var(--border)"},children:[u.jsxs("div",{className:"flex items-center gap-2 rounded px-2 py-1.5 text-xs","data-testid":"remote-login-status",children:[u.jsx("span",{"aria-hidden":!0,"data-connection":i.connection,className:"inline-block h-2 w-2 rounded-full",style:{background:h}}),u.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?u.jsx(qj,{}):null,u.jsx(Fj,{reloadKey:A}),u.jsx(Kj,{})]}):null,u.jsx(ni,{open:S,onOpenChange:te=>{te||T(!1)},title:t("remote.disable.confirmTitle"),description:t("remote.disable.confirmBody"),confirmLabel:t("common.stop"),confirmKind:"danger",onConfirm:()=>{L(!1)}})]})},Gw=b.createContext({enabled:!0,loading:!0,setEnabled:async()=>{}}),Zj=({children:t})=>{const[r,o]=b.useState(!0),[i,l]=b.useState(!0);b.useEffect(()=>{let f=!1;return XE().then(h=>{f||o(h.enabled)}).catch(()=>{}).finally(()=>{f||l(!1)}),()=>{f=!0}},[]);const c=b.useCallback(async f=>{const h=await ZE(f);o(h.enabled)},[]);return u.jsx(Gw.Provider,{value:{enabled:r,loading:i,setEnabled:c},children:t})},Qj=()=>b.useContext(Gw),Xw=b.createContext({enabled:!1,loading:!0,setEnabled:async()=>{}}),Jj=({children:t})=>{const[r,o]=b.useState(!1),[i,l]=b.useState(!0);b.useEffect(()=>{let f=!1;return $E().then(h=>{f||o(h.enabled)}).catch(()=>{}).finally(()=>{f||l(!1)}),()=>{f=!0}},[]);const c=b.useCallback(async f=>{const h=await GE(f);o(h.enabled)},[]);return u.jsx(Xw.Provider,{value:{enabled:r,loading:i,setEnabled:c},children:t})},Zw=()=>b.useContext(Xw),e3=()=>{const{language:t,setLanguage:r,t:o}=ke();return u.jsxs("div",{className:"settings-section",children:[u.jsxs("div",{className:"settings-section__heading",children:[u.jsx(BS,{size:12,"aria-hidden":!0}),u.jsx("span",{children:o("settings.language")})]}),u.jsxs("div",{className:"flex gap-1 p-1 rounded border",style:{background:"var(--bg-1)",borderColor:"var(--border)"},children:[u.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:"中文"}),u.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"})]})]})},Hy=({feature:t,label:r,description:o,testId:i})=>{const{t:l}=ke(),[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 u.jsxs("div",{className:"settings-toggle-row",onClick:()=>{!t.loading&&!c&&m(!t.enabled)},children:[u.jsxs("span",{className:"min-w-0 flex-1 text-left",children:[u.jsx("span",{className:"block text-sm font-medium text-pri",children:r}),u.jsx("span",{className:"mt-0.5 block text-xs text-ter leading-relaxed",children:o}),h?u.jsx("span",{className:"mt-1 block text-xs",style:{color:"var(--text-error)"},role:"alert",children:l("settings.saveError")}):null]}),u.jsx("div",{className:"mt-0.5 shrink-0",children:u.jsx(Vw,{checked:t.enabled,disabled:t.loading||c,onChange:y=>{m(y)},"data-testid":i,"aria-label":r})})]})},t3=()=>{const{t}=ke(),[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 YE().then(v=>{y||(o(v),l(!0))}).catch(()=>{y||l(!0)}),()=>{y=!0}},[]);const m=async()=>{g(null),f(!0);try{await VE(r),g("saved")}catch{g("error")}finally{f(!1)}};return u.jsxs("div",{children:[u.jsx("label",{className:"mb-1.5 block text-sm font-medium text-pri",htmlFor:"settings-webhook-url",children:t("settings.webhook.label")}),u.jsx("span",{className:"mb-2 block text-xs text-ter leading-relaxed",children:t("settings.webhook.description")}),u.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"?u.jsxs("span",{className:"mt-1.5 block text-xs",style:{color:"var(--status-green)"},children:["✓ ",t("settings.webhook.saved")]}):null,h==="error"?u.jsx("span",{className:"mt-1.5 block text-xs",style:{color:"var(--text-error)"},role:"alert",children:t("settings.saveError")}):null]})},Qw=()=>{const{t}=ke(),r=Zw(),o=Qj();return u.jsxs("div",{className:"flex flex-col gap-2.5",children:[u.jsx(e3,{}),u.jsxs("div",{className:"settings-section",children:[u.jsxs("div",{className:"settings-section__heading",children:[u.jsx(Ul,{size:12,"aria-hidden":!0}),u.jsx("span",{children:t("settings.experimental")})]}),u.jsx(Hy,{feature:r,label:t("settings.workflows.label"),description:t("settings.workflows.description"),testId:"settings-toggle-workflows"}),u.jsx(Hy,{feature:o,label:t("settings.autostaff.label"),description:t("settings.autostaff.description"),testId:"settings-toggle-autostaff"})]}),u.jsx(Xj,{}),u.jsxs("div",{className:"settings-section",children:[u.jsxs("div",{className:"settings-section__heading",children:[u.jsx(xE,{size:12,"aria-hidden":!0}),u.jsx("span",{children:t("settings.webhook.label")})]}),u.jsx(t3,{})]})]})},Jw=()=>{const{t}=ke(),r=At(),[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]),u.jsxs("div",{ref:l,className:"relative",children:[u.jsx(lt,{label:t("settings.tooltip"),children:u.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:u.jsx(Df,{size:14,"aria-hidden":!0})})}),o?u.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:[u.jsxs("div",{className:"mb-4 flex items-start gap-3",children:[u.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:u.jsx(Df,{size:18,"aria-hidden":!0})}),u.jsxs("div",{className:r?"min-w-0 flex-1":"min-w-0",children:[u.jsx("div",{className:"text-sm font-semibold text-pri",children:t("settings.heading")}),u.jsx("div",{className:"text-xs text-ter",children:t("settings.subtitle")})]}),r?u.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:u.jsx(vo,{size:16,"aria-hidden":!0})}):null]}),u.jsx(Qw,{})]}):null]})},n3=t=>{const[r,o]=b.useState(null);return b.useEffect(()=>{if(t)return;let i=!0;return UE().then(l=>{i&&o(l)}).catch(()=>{i&&o(null)}),()=>{i=!1}},[t]),t??r},r3="2.1.1",a3={version:r3},ex=a3.version,o3=({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=ex,versionInfo:y})=>{const{t:v}=ke(),x=n3(y),S=x?.updateAvailable&&x.latestVersion!==m?x:null,T=c>0,k=f?v("topbar.hideTodo"):T?v("topbar.todoOpen",{count:c}):v("topbar.showTodo");return u.jsxs("header",{className:"flex h-11 shrink-0 items-center px-4",style:{background:"var(--bg-0)",borderBottom:"1px solid var(--border)"},children:[u.jsxs("div",{className:"flex items-center gap-2",children:[u.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:[u.jsx("img",{src:"/logo.png",alt:"","aria-hidden":!0,className:"h-5 w-5 rounded-md","data-testid":"topbar-logo"}),u.jsx("span",{className:"font-semibold text-pri",children:"Hive"}),u.jsxs("span",{className:"text-ter text-xs tabular-nums",children:["v",m]})]}),S?u.jsxs("div",{className:"flex items-center gap-2 text-xs","data-testid":"topbar-update-badge",children:[u.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")}),u.jsxs("span",{className:"text-ter",children:["v",m," → v",S.latestVersion]}),u.jsx("code",{className:"mono text-ter",children:S.installHint})]}):null]}),u.jsx("div",{className:"flex-1"}),r?null:u.jsxs("div",{className:"flex items-center gap-1",children:[t,i?u.jsx(lt,{label:v(o?"topbar.hideMemory":"topbar.showMemory"),children:u.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:[u.jsx(nS,{size:13}),u.jsx("span",{children:v("topbar.memory")})]})}):null,l?u.jsx(lt,{label:k,children:u.jsxs("button",{type:"button",onClick:l,"aria-pressed":f,"aria-label":k,"data-has-tasks":T?"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:[u.jsx(B0,{size:13,className:T?"text-accent":void 0}),u.jsx("span",{children:v("topbar.todo")})]})}):null,h?u.jsx(lt,{label:v(g?"topbar.hideWorkflows":"topbar.showWorkflows"),children:u.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:[u.jsx(K0,{size:13}),u.jsx("span",{children:v("topbar.workflows")})]})}):null,u.jsx(Wj,{}),u.jsx(Jw,{})]})]})},tx="hive.workspace-sidebar.width",qs=56,zm=280,vf=qs,By=16,s3=240,Wy=96,zl=t=>Math.min(zm,Math.max(qs,t)),i3=()=>{try{const t=localStorage.getItem(tx);if(!t)return vf;const r=Number.parseInt(t,10);return Number.isFinite(r)?zl(r):vf}catch{return vf}},l3=()=>{const[t,r]=b.useState(i3),[o,i]=b.useState(!1);b.useEffect(()=>{try{localStorage.setItem(tx,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,x=document.body.style.userSelect;document.body.style.cursor="col-resize",document.body.style.userSelect="none";const S=k=>{r(zl(y+k.clientX-m))},T=()=>{i(!1),document.body.style.cursor=v,document.body.style.userSelect=x,document.removeEventListener("mousemove",S),document.removeEventListener("mouseup",T)};document.addEventListener("mousemove",S),document.addEventListener("mouseup",T)},[t]),c=t<=Wy,f=b.useCallback(()=>{r(g=>g<=Wy?s3:qs)},[]),h=b.useCallback(g=>{g.key==="ArrowLeft"?(g.preventDefault(),r(m=>zl(m-By))):g.key==="ArrowRight"?(g.preventDefault(),r(m=>zl(m+By))):g.key==="Home"?(g.preventDefault(),r(qs)):g.key==="End"&&(g.preventDefault(),r(zm))},[]);return{beginResize:l,collapsed:c,onResizeKeyDown:h,resizing:o,toggleCollapsed:f,width:t}},c3=({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:x}=ke();return u.jsxs("div",{className:"flex h-screen w-full flex-col overflow-hidden",style:{background:"var(--bg-0)",color:"var(--text-primary)"},children:[u.jsx(o3,{actions:v,hideActions:r,memoryOpen:o,onToggleMemory:i,onToggleTaskGraph:l,openTaskCount:c,taskGraphOpen:y,onToggleWorkflows:f,workflowsOpen:h}),u.jsxs("div",{className:"flex min-h-0 min-w-0 flex-1 overflow-hidden",children:[u.jsxs("aside",{"aria-label":x("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,u.jsx("hr",{"aria-label":x("layout.sidebarResizeAria"),"aria-orientation":"vertical","aria-valuemin":qs,"aria-valuemax":zm,"aria-valuenow":Math.round(m.width),tabIndex:0,className:"workspace-sidebar-resizer","data-resizing":m.resizing?"true":"false",onMouseDown:m.beginResize,onKeyDown:m.onResizeKeyDown})]}),u.jsx("section",{className:"relative flex min-w-0 flex-1 overflow-hidden",children:t})]})]})},u3={disconnected:"mobile.reconnect.disconnected",reconnecting:"mobile.reconnect.reconnecting",revoked:"mobile.reconnect.revoked"},d3=({status:t})=>{const{t:r}=ke();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 u.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:[u.jsx("span",{children:r(u3[t.state])}),i?u.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]})},f3=[{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"}],m3=[{descriptionKey:"notifications.detail.brief.description",labelKey:"notifications.detail.brief.label",value:"brief"},{descriptionKey:"notifications.detail.detailed.description",labelKey:"notifications.detail.detailed.label",value:"detailed"}],p3=()=>{const{t}=ke(),r=At(),{notify:o,previewSound:i,requestDesktopNotifications:l,settings:c,updateSettings:f}=yc(),h=typeof window<"u"&&!("Notification"in window),g=b.useMemo(()=>f3.map(v=>({...v,description:t(v.descriptionKey),label:t(v.labelKey)})),[t]),m=b.useMemo(()=>m3.map(v=>({...v,description:t(v.descriptionKey),label:t(v.labelKey)})),[t]),y=v=>{if(!v){f({desktop:!1});return}l()};return u.jsxs("details",{className:"settings-details group",children:[u.jsxs("summary",{className:"settings-details__summary",children:[u.jsxs("div",{className:"settings-section__heading !mb-0",children:[u.jsx(Of,{size:12,"aria-hidden":!0}),u.jsx("span",{children:t("notifications.settings.heading")})]}),u.jsx(Co,{size:14,className:"text-sec transition-transform group-open:rotate-180","aria-hidden":!0})]}),u.jsxs("div",{className:"settings-details__content flex flex-col gap-3.5",children:[u.jsxs("section",{children:[u.jsxs("div",{className:"mb-2 flex items-center gap-1.5 text-ter text-[10px] font-semibold uppercase tracking-wider",children:[u.jsx(ql,{size:12,"aria-hidden":!0}),t("notifications.sound.sectionLabel")]}),u.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=>u.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:[u.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:[u.jsx("input",{type:"radio",name:"notification-sound",value:v.value,checked:c.sound===v.value,className:"sr-only",onChange:()=>f({sound:v.value})}),u.jsxs("span",{className:"mb-1 flex items-center gap-2",children:[u.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"?u.jsx(P0,{size:12,"aria-hidden":!0}):u.jsx(ql,{size:12,"aria-hidden":!0})}),u.jsx("span",{className:"font-medium text-pri text-xs",children:v.label}),v.length==="long"?u.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?u.jsx(Eo,{size:12,className:"ml-auto text-pri","aria-hidden":!0}):null]}),u.jsx("span",{className:"block text-ter text-[11px] leading-relaxed",children:v.description})]}),v.value!=="off"?u.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:u.jsx(Ao,{size:12,"aria-hidden":!0})}):null]},v.value))})]}),u.jsxs("section",{children:[u.jsxs("div",{className:"mb-2 flex items-center gap-1.5 text-ter text-[10px] font-semibold uppercase tracking-wider",children:[u.jsx(H0,{size:12,"aria-hidden":!0}),t("notifications.detail.sectionLabel")]}),u.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=>u.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:[u.jsx("input",{type:"radio",name:"notification-detail",value:v.value,checked:c.detail===v.value,className:"sr-only",onChange:()=>f({detail:v.value})}),u.jsx("span",{className:"block font-medium text-xs",children:v.label}),u.jsx("span",{className:"block text-ter text-[11px] leading-relaxed",children:v.description})]},v.value))})]}),u.jsxs("label",{className:"flex items-start gap-2 rounded border p-2 text-sec text-xs cursor-pointer",children:[u.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)}),u.jsxs("span",{children:[u.jsx("span",{className:"block font-medium text-pri",children:t("notifications.desktop.label")}),u.jsx("span",{className:"text-ter leading-relaxed",children:t(h?"notifications.desktop.unsupported":"notifications.desktop.helper")})]})]}),u.jsx("div",{className:"flex justify-end gap-2 border-t pt-3",style:{borderColor:"var(--border)"},children:u.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")})})]})]})},h3=({demoMode:t,onTryDemo:r,onExitDemo:o})=>{const{t:i}=ke();return u.jsxs("div",{className:"mobile-settings-section flex min-h-full flex-col p-4","data-testid":"mobile-settings-section",children:[u.jsx("h1",{className:"mb-4 text-base font-semibold text-pri",children:i("mobile.section.settings")}),u.jsx(Qw,{}),u.jsx(p3,{}),u.jsxs("div",{className:"settings-section mt-3",children:[u.jsxs("div",{className:"settings-section__heading",children:[u.jsx(Ul,{size:12,"aria-hidden":!0}),u.jsx("span",{children:i("mobile.section.demo")})]}),t?u.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:[u.jsx(PS,{size:16,"aria-hidden":!0,className:"text-ter"}),u.jsx("span",{className:"min-w-0 flex-1 truncate",children:i("demo.exit")})]}):u.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:[u.jsx(Ul,{size:16,"aria-hidden":!0,className:"text-ter"}),u.jsx("span",{className:"min-w-0 flex-1 truncate",children:i("mobile.section.demo")})]})]})]})},g3={team:I0,tasks:B0,flows:K0,settings:Df},v3={team:"mobile.nav.team",tasks:"mobile.nav.tasks",flows:"mobile.nav.flows",settings:"mobile.nav.settings"},y3=({active:t,onSelect:r,sections:o,openTaskCount:i=0,workingCount:l=0})=>{const{t:c}=ke();return u.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=g3[f],g=c(v3[f]),m=f===t,y=f==="tasks"&&i>0?i:f==="team"&&l>0?l:0;return u.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?u.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,u.jsx(h,{size:20,"aria-hidden":!0}),u.jsx("span",{children:g}),y>0?u.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)})})},b3=({workspaceSwitcher:t,actions:r,banner:o})=>u.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:[u.jsxs("div",{className:"flex h-12 items-center gap-2 px-3",children:[u.jsx("div",{className:"min-w-0 flex-1",children:t??u.jsx("span",{className:"font-semibold text-pri",children:"Hive"})}),u.jsx("div",{className:"flex shrink-0 items-center gap-1",children:r})]}),o]}),w3=()=>typeof navigator<"u"&&/iP(hone|ad|od)/.test(navigator.platform??navigator.userAgent),x3=()=>{const[t,r]=b.useState(null);return b.useEffect(()=>{if(!w3())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},k3={team:"mobile-section-team",tasks:"mobile-section-tasks",flows:"mobile-section-flows",settings:"mobile-section-settings"},S3=({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:x,onSectionChange:S})=>{const[T,k]=b.useState("team"),E=x??T,C=x3(),_=B=>{k(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 O=A.includes(E)?E:"team",L=Qb()&&O==="team"&&i==null;return u.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)",...C!=null?{height:`${C}px`}:{}},children:[L?o:u.jsx(b3,{workspaceSwitcher:t,actions:r,banner:o}),u.jsx("main",{className:"relative min-h-0 min-w-0 flex-1 overflow-hidden",children:i??u.jsx("div",{className:O==="team"?"flex h-full min-w-0 flex-col overflow-hidden":"flex h-full min-w-0 flex-col overflow-y-auto","data-testid":k3[O],"data-mobile-section":O,children:j[O]})}),g,i!=null||L?null:u.jsx(y3,{active:O,onSelect:_,sections:A,openTaskCount:y,workingCount:v}),m]})},E3=[],C3=b.lazy(()=>Tt(()=>import("./TaskGraphDrawer-Beh95yUu.js"),[]).then(t=>({default:t.TaskGraphContent}))),T3=({tasksFile:t,workspacePath:r,workers:o,onSelectOwner:i,onAddWorkspace:l,demoMode:c=!1})=>{const{t:f}=ke(),h=o??E3,g=b.useMemo(()=>h.length?h.map(m=>m.name):void 0,[h]);return r?u.jsxs("div",{className:"flex h-full min-h-0 flex-col",children:[c?u.jsx("div",{className:"flex shrink-0 items-center justify-end px-3 py-1",children:u.jsx("span",{className:"pill pill--neutral text-xs",children:f("demo.readOnlyBadge")})}):null,u.jsx("div",{className:"min-h-0 flex-1",children:u.jsx(b.Suspense,{fallback:null,children:u.jsx(C3,{content:t.content,hasConflict:t.hasConflict,onContentChange:t.onChange,onKeepLocal:t.onKeepLocal,onReload:t.onReload,onSave:t.onSave,onToggleTaskLine:m=>{t.toggleTaskAtLine(m).catch(Wr("tasks.toggleTaskAtLine"))},onAppendTask:m=>{t.appendTask(m).catch(Wr("tasks.appendTask"))},onAppendSubtask:(m,y)=>{t.appendSubtask(m,y).catch(Wr("tasks.appendSubtask"))},onUpdateTaskText:(m,y)=>{t.updateTaskText(m,y).catch(Wr("tasks.updateTaskText"))},onDeleteTask:m=>{t.deleteTask(m).catch(Wr("tasks.deleteTask"))},workspacePath:r,...g?{knownWorkerNames:g}:{},...i?{onSelectOwner:i}:{}})})})]}):u.jsx("div",{className:"flex h-full flex-col","data-testid":"mobile-tasks-empty",children:u.jsx(Xs,{title:f("mobile.tasks.noWorkspaceTitle"),description:f("mobile.tasks.noWorkspaceDesc"),action:l?u.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})})},Uy=[{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"}],A3=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)%Uy.length;return Uy[o]},_3=t=>{const r=t.trim();if(r.length===0)return"?";const o=r.codePointAt(0);return o===void 0?"?":String.fromCodePoint(o).toUpperCase()},Kf=({workspaceId:t,name:r,isActive:o,working:i,workingCount:l,size:c=32})=>{const{token:f,label:h}=A3(t),g=_3(r),m=l&&l>1?l:null;return u.jsx(Uw,{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?u.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?u.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})},qy=(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})},N3=({activeWorkspaceId:t,workspaces:r,workersByWorkspaceId:o,createDisabledReason:i,onSelectWorkspace:l,onCreateClick:c,onDeleteWorkspace:f})=>{const{t:h}=ke(),g=Jt(),[m,y]=b.useState(!1),[v,x]=b.useState(null),[S,T]=b.useState(!1),k=r?.find(C=>C.id===t)?.name??h("mobile.section.workspaces"),E=()=>{if(!v||S)return;const C=v;T(!0),Promise.resolve(f(C)).then(()=>{g.show({kind:"success",message:h("sidebar.removed",{name:C.name})})}).catch(_=>{const j=_ instanceof Error?_.message:String(_);g.show({kind:"error",message:h("sidebar.deleteFailed",{message:j})})}).finally(()=>{T(!1),x(null)})};return u.jsxs(Zs,{open:m,onOpenChange:y,children:[u.jsx(uj,{asChild:!0,children:u.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:[u.jsx("span",{className:"min-w-0 flex-1 truncate text-sm font-medium text-pri",children:k}),u.jsx(Co,{size:16,"aria-hidden":!0,className:"shrink-0 text-ter"})]})}),u.jsxs(Qs,{children:[u.jsx(Js,{"data-testid":"mobile-workspace-switcher-overlay",className:"app-overlay fixed inset-0 z-40"}),u.jsx("div",{className:"pointer-events-none fixed inset-0 z-50 grid items-end",children:u.jsxs(ei,{"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:[u.jsx(ti,{asChild:!0,children:u.jsxs("div",{className:"flex shrink-0 items-baseline gap-2 border-b px-4 py-3",style:{borderColor:"var(--border)"},children:[u.jsx("span",{className:"text-base font-semibold text-pri",children:h("sidebar.workspaces")}),r&&r.length>0?u.jsx("span",{className:"text-xs text-ter tabular-nums",children:r.length}):null]})}),u.jsx("div",{className:"min-h-0 flex-1 overflow-y-auto py-1",children:!r||r.length===0?u.jsxs("div",{className:"flex flex-col items-center gap-1 px-6 py-8 text-center",children:[u.jsx("span",{className:"text-sm font-medium text-sec",children:h("sidebar.noWorkspaces")}),u.jsx("span",{className:"text-xs text-ter",children:i??h("sidebar.noWorkspacesDesc")})]}):r.map(C=>{const _=C.id===t,j=o[C.id],A=j?.filter(O=>O.status==="working").length??0;return u.jsxs("div",{className:"flex items-center gap-1 pr-2",children:[u.jsxs("button",{type:"button","data-testid":`mobile-ws-row-${C.id}`,onClick:()=>{y(!1),l(C.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:[u.jsx(Kf,{workspaceId:C.id,name:C.name,isActive:_,working:A>0,workingCount:A,size:36}),u.jsxs("span",{className:"flex min-w-0 flex-1 flex-col",children:[u.jsx("span",{className:"truncate text-sm font-medium text-pri",children:C.name}),u.jsx("span",{className:"truncate text-xs text-ter",children:qy(j,h)})]}),_?u.jsx(Eo,{size:18,className:"shrink-0 text-accent","aria-hidden":!0}):null]}),u.jsx("button",{type:"button","aria-label":h("sidebar.deleteAria",{name:C.name}),"data-testid":`mobile-ws-delete-${C.id}`,onClick:()=>x(C),className:"flex h-10 w-10 shrink-0 items-center justify-center rounded-md text-ter",children:u.jsx(ic,{size:16,"aria-hidden":!0})})]},C.id)})}),u.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:u.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:[u.jsx(Ds,{size:16,"aria-hidden":!0}),h("sidebar.newWorkspace")]})})]})})]}),u.jsx(ni,{open:v!==null,onOpenChange:C=>{!C&&!S&&x(null)},title:v?h("sidebar.deleteConfirm",{name:v.name}):h("sidebar.deleteLabel"),description:v?h("sidebar.deleteDescription",{path:v.path,summary:qy(o[v.id],h)}):"",confirmLabel:h(S?"sidebar.deleting":"sidebar.deleteLabel"),confirmKind:"danger",onConfirm:E})]})},j3=4e3,R3=t=>{const[r,o]=b.useState([]);return b.useEffect(()=>{if(!t){o([]);return}let i=!1;const l=()=>{ab().then(f=>{i||o(f)}).catch(()=>{})};l();const c=window.setInterval(l,j3);return()=>{i=!0,window.clearInterval(c)}},[t]),r},O3=({devices:t,enabled:r})=>{const{notify:o}=yc(),{t:i}=ke(),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},D3=()=>{const{status:t}=Lm(),r=t.enabled&&t.loggedIn,o=R3(r);return u.jsx(O3,{devices:o,enabled:r})};let Ff=!1;const nx=()=>{Ff=!0,window.location.reload()},M3=t=>{b.useEffect(()=>{const r=o=>{if(Ff){Ff=!1;return}o.preventDefault(),o.returnValue=""};return window.addEventListener("beforeunload",r),()=>window.removeEventListener("beforeunload",r)},[t])},L3=3e3,z3=({onTryDemo:t}={})=>{const{t:r}=ke(),[o,i]=b.useState(!1),l=b.useRef(!0),c=b.useCallback(()=>{typeof window>"u"||nx()},[]),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()},L3);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 u.jsx("div",{className:"flex flex-1 items-center justify-center p-8","data-testid":"runtime-offline-page",children:u.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:[u.jsx("div",{className:"flex h-12 w-12 items-center justify-center rounded-full",style:{background:"var(--bg-3)",color:"var(--status-orange)"},children:u.jsx(aE,{size:24,"aria-hidden":!0})}),u.jsx("div",{className:"font-semibold text-pri",children:r("pwa.runtimeOffline.title")}),u.jsx("div",{className:"text-sec text-sm leading-relaxed",children:r("pwa.runtimeOffline.body")}),u.jsxs("div",{className:"mt-2 flex flex-wrap items-center justify-center gap-2",children:[u.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?u.jsx(To,{size:12,className:"animate-spin","aria-hidden":!0}):u.jsx(fm,{size:12,"aria-hidden":!0}),r(o?"pwa.runtimeOffline.retrying":"pwa.runtimeOffline.retry")]}),t?u.jsxs("button",{type:"button",className:"icon-btn flex items-center gap-2","data-testid":"runtime-offline-try-demo",onClick:t,children:[u.jsx(hS,{size:12,"aria-hidden":!0}),r("pwa.runtimeOffline.tryDemo")]}):null]}),u.jsx("div",{className:"text-ter text-xs",children:r("pwa.runtimeOffline.autoReconnect")})]})})},Yf=new Set;let rx=null;const H3=t=>{rx=t;for(const r of Yf)r(t)},B3=t=>(Yf.add(t),t(rx),()=>{Yf.delete(t)}),W3=2e3,U3=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&&H3(()=>{l.postMessage({type:"SKIP_WAITING"}),setTimeout(t.reload,W3)})};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())})},q3=()=>typeof navigator>"u"||typeof window>"u"?Promise.resolve():U3({isProd:!0,serviceWorker:"serviceWorker"in navigator?navigator.serviceWorker:null,reload:nx}),Iy=({terminalRuns:t})=>{const{t:r}=ke(),o=At(),[i,l]=b.useState(null),[c,f]=b.useState(!1);if(b.useEffect(()=>B3(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 u.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:[u.jsx(fm,{size:14,className:"text-sec","aria-hidden":!0}),u.jsxs("div",{className:"flex flex-col",children:[u.jsx("span",{className:"font-medium text-pri text-xs",children:r("pwa.appShellUpdated")}),u.jsx("span",{className:"text-ter text-xs",children:r(h?"pwa.reloadToActivate":"pwa.waitForAgents")})]}),u.jsx("button",{type:"button",className:"icon-btn icon-btn--primary","data-testid":"update-available-reload",disabled:g,onClick:()=>{f(!0),i()},children:m})]})},I3=new Set(["add-workspace","try-demo"]),P3=t=>t!==null&&I3.has(t),K3=({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");P3(c)&&(i.current=!0,window.history.replaceState({},"",window.location.pathname),c==="add-workspace"?t():c==="try-demo"&&r())},[o,t,r])},Py=()=>{const{t}=ke(),r=Jt(),o=At(),{pending:i,refresh:l}=Lm(),[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 EC(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]),x=b.useCallback(async S=>{if(!(!m||h.current)){h.current=!0;try{await CC(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){x("expired");return}const T=window.setTimeout(()=>{x("expired")},S);return()=>window.clearTimeout(T)},[y,x]),!i||o?null:u.jsx(Zs,{open:!0,onOpenChange:S=>{S||x("rejected")},children:u.jsxs(Qs,{children:[u.jsx(Js,{"data-testid":"remote-pairing-confirm-overlay",className:"app-overlay fixed inset-0 z-[80]"}),u.jsx("div",{className:"pointer-events-none fixed inset-0 z-[90] grid place-items-center p-4",children:u.jsxs(ei,{"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:[u.jsxs("div",{className:"flex items-start gap-3",children:[u.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:u.jsx(iE,{size:18})}),u.jsxs("div",{className:"min-w-0 flex-1",children:[u.jsx(ti,{className:"text-lg font-semibold text-pri",children:t("remote.confirm.title")}),u.jsx(xc,{className:"mt-1.5 text-sm text-sec",children:t("remote.confirm.description",{name:g})})]})]}),u.jsxs("div",{className:"mt-4",children:[u.jsx("div",{className:"mb-1 text-xs font-medium uppercase tracking-wider text-ter",children:t("remote.confirm.sasLabel")}),u.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}),u.jsx("p",{className:"mt-2 text-xs text-ter",children:t("remote.confirm.warning")})]}),u.jsxs("div",{className:"mt-5 flex justify-end gap-2",children:[u.jsx("button",{type:"button","data-testid":"remote-pairing-reject",onClick:()=>{x("rejected")},disabled:c,className:"icon-btn",children:t("remote.confirm.reject")}),u.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")})]})]})})]})})},F3=t=>!!t?.some(r=>r.status==="working"),Y3=t=>t?.filter(r=>r.status==="working").length??0,V3=(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})},ax="hive.sidebar.githubDismissed",$3="https://www.bilibili.com/video/BV1UHLp6nEQR",G3=()=>{if(typeof window>"u")return!1;try{return window.localStorage.getItem(ax)==="1"}catch{return!1}},X3=({activeWorkspaceId:t,collapsed:r=!1,createDisabledReason:o,onCreateClick:i,onDeleteWorkspace:l,onSelectWorkspace:c,onToggleCollapse:f,workersByWorkspaceId:h,workspaces:g})=>{const{t:m}=ke(),[y,v]=b.useState(null),[x,S]=b.useState(!1),[T,k]=b.useState(G3),E=Jt(),C=()=>{k(!0);try{window.localStorage.setItem(ax,"1")}catch{}},_=!!o,j=D=>{v(D)},A=()=>{if(!y||x)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)})},O=u.jsx(ni,{open:y!==null,onOpenChange:D=>{!D&&!x&&v(null)},title:y?m("sidebar.deleteConfirm",{name:y.name}):m("sidebar.deleteLabel"),description:y?m("sidebar.deleteDescription",{path:y.path,summary:V3(h[y.id],m)}):"",confirmLabel:m(x?"sidebar.deleting":"sidebar.deleteLabel"),confirmKind:"danger",onConfirm:A});return u.jsxs("nav",{"aria-label":"Workspaces",className:"flex h-full flex-col",children:[u.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:[u.jsxs("div",{className:"ws-sidebar-title flex min-w-0 items-center gap-2",children:[u.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?u.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?u.jsx(lt,{side:"right",label:m(r?"layout.sidebarExpand":"layout.sidebarCollapse"),children:u.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?u.jsx(dS,{size:16,"aria-hidden":!0}):u.jsx(cS,{size:16,"aria-hidden":!0})})}):null]}),g===null?u.jsx("p",{className:"px-3 py-2 text-xs text-ter",children:m("common.loading")}):g.length===0?u.jsxs("div",{className:"ws-empty flex-1 px-2 py-4",children:[u.jsx("div",{className:"ws-empty__wide",children:u.jsx(Xs,{title:m("sidebar.noWorkspaces"),description:o??m("sidebar.noWorkspacesDesc"),icon:u.jsx(z0,{size:20}),action:u.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:[u.jsx(Ds,{size:14,"aria-hidden":!0}),m("sidebar.newWorkspace")]})})}),u.jsx(lt,{side:"right",label:o??m("sidebar.newWorkspace"),children:u.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:u.jsx(Ds,{size:16,"aria-hidden":!0})})})]}):u.jsxs("ul",{className:"flex-1 scroll-y pb-2",children:[g.map(D=>{const L=h[D.id],B=D.id===t,q=F3(L),te=Y3(L);return u.jsxs("li",{className:"group relative",children:[u.jsx(lt,{side:"right",label:u.jsxs("span",{className:"flex flex-col gap-0.5",children:[u.jsx("span",{className:"font-medium",children:D.name}),u.jsx("span",{className:"mono text-ter",children:D.path})]}),children:u.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:[u.jsx(Kf,{workspaceId:D.id,name:D.name,isActive:!1,working:q,workingCount:te}),u.jsx("span",{className:`min-w-0 flex-1 truncate text-sm ${B?"font-medium text-pri":"text-pri"}`,children:D.name})]})}),u.jsx(lt,{side:"right",label:u.jsxs("span",{className:"flex flex-col gap-0.5",children:[u.jsx("span",{className:"font-medium",children:D.name}),u.jsx("span",{className:"mono text-ter",children:D.path})]}),children:u.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:u.jsx(Kf,{workspaceId:D.id,name:D.name,isActive:B,working:q,workingCount:te})})}),u.jsx(lt,{label:m("sidebar.deleteAria",{name:D.name}),children:u.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:u.jsx(ic,{size:14,"aria-hidden":!0})})})]},D.id)}),u.jsx("li",{children:u.jsx(lt,{label:o??m("sidebar.newWorkspace"),children:u.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:[u.jsx(Ds,{size:14,"aria-hidden":!0}),u.jsx("span",{className:"ws-add__label",children:m("sidebar.newWorkspace")})]})})})]}),T?null:u.jsxs("div",{className:"ws-sidebar-footer group relative",children:[u.jsxs("a",{href:$3,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:[u.jsx("img",{src:"/bilibili.ico",alt:"","aria-hidden":"true",className:"h-[18px] w-[18px] rounded-[4px] object-cover",draggable:!1}),u.jsx("span",{className:"ws-sidebar-footer__label",children:m("sidebar.demoVideo")})]}),u.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:[u.jsx("svg",{width:"18",height:"18",viewBox:"0 0 16 16",fill:"currentColor","aria-hidden":"true",children:u.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"})}),u.jsx("span",{className:"ws-sidebar-footer__label",children:"GitHub"})]}),u.jsx("button",{type:"button","aria-label":m("sidebar.dismissRepository"),title:m("sidebar.dismissRepository"),onClick:C,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:u.jsx(vo,{size:10,"aria-hidden":!0})})]}),O]})},Bn=/^(\s*)-\s+\[( |x|X)\]\s+(.*)$/,Z3=/(?:^|[\s\p{P}])(@[A-Za-z0-9_-]+)/gu,Q3=t=>{const r=[];for(const o of t.matchAll(Z3))o[1]&&r.push(o[1]);return r},J3=t=>{const r=new Map;for(const o of t){const i=o.trim();i&&r.set(i.toLowerCase(),i)}return r},aM=(t,r={})=>{const o=[],i=[],l=t.split(/\r?\n/),c=r.knownWorkerNames?J3(r.knownWorkerNames):null;for(let f=0;f<l.length;f++){const h=l[f];if(!h)continue;const g=h.match(Bn);if(!g)continue;const[,m="",y=" ",v=""]=g,x=m.replace(/\t/g," ").length,S=Q3(v);let T;if(c){T=[];for(const _ of S){const j=c.get(_.slice(1).toLowerCase());j&&T.push(`@${j}`)}}else T=S;let k=v;for(const _ of T){const j=_.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");k=k.replace(new RegExp(`(?:^|(?<=\\s|\\p{P}))${j}(?!\\w)`,"u"),"")}k=k.replace(/\s+/g," ").trim();const E={checked:y.toLowerCase()==="x",children:[],indent:x,line:f,mentions:T,text:k};for(;i.length>0;){const _=i[i.length-1];if(_&&_.indent<x)break;i.pop()}const C=i[i.length-1];C?C.children.push(E):o.push(E),i.push(E)}return o},eR=t=>{let r=0;const o=[],i=t.split(/\r?\n/);for(const l of i){if(!l)continue;const c=l.match(Bn);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},oM=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}},ri=t=>t.includes(`\r
76
+ `)?`\r
77
+ `:`
78
+ `,tR=(t,r)=>{const o=ri(t),i=t.length>0&&!t.endsWith(`
79
+ `);return`${t}${i?o:""}- [ ] ${r}${o}`},nR=(t,r)=>{const o=t.split(/\r?\n/),i=o[r];if(i===void 0)return t;const l=i.match(Bn);if(!l)return t;const c=(l[2]??" ").toLowerCase()==="x",f=i.replace(Bn,(h,g,m,y)=>`${g}- [${c?" ":"x"}] ${y}`);return o[r]=f,o.join(ri(t))},ox=t=>t.replace(/\r?\n/g," ").replace(/\s+/g," ").trim(),rR=(t,r,o)=>{const i=t.split(/\r?\n/),l=i[r];if(l===void 0||!l.match(Bn))return t;const f=ox(o);if(!f)return t;const h=l.replace(Bn,(g,m,y)=>`${m}- [${y}] ${f}`);return i[r]=h,i.join(ri(t))},aR=(t,r)=>{const o=t.split(/\r?\n/),i=o[r];if(i===void 0)return t;const l=i.match(Bn);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(Bn);if(!g||(g[1]??"").replace(/\t/g," ").length<=c)break;f+=1}return o.splice(r,f-r),o.join(ri(t))},oR=(t,r,o)=>{const i=ox(o);if(!i)return t;const l=t.split(/\r?\n/),c=l[r];if(c===void 0)return t;const f=c.match(Bn);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 x=v.match(Bn);if(!x||(x[1]??"").replace(/\t/g," ").length<=g)break;m+=1}const y=`${h} `;return l.splice(m,0,`${y}- [ ] ${i}`),l.join(ri(t))},sR=(t,r,o)=>t===r||t===o,iR=(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(""),x=b.useRef(""),S=b.useCallback((k,E)=>{if(!y.current){v.current=k,x.current=k,i(k),h(!1),m(null);return}sR(k,v.current,E)||(m(k),h(!0))},[]);if(b.useEffect(()=>{if(!t){i(""),c(!1),h(!1),m(null),y.current=!1,v.current="",x.current="";return}let k=!1;return i(""),c(!1),h(!1),m(null),y.current=!1,v.current="",x.current="",dC(t).then(({content:E})=>{k||(v.current=E,y.current=!1,x.current=E,i(E),c(!0),h(!1),m(null))}).catch(E=>{k||(v.current="",y.current=!1,x.current="",i(""),c(!0),h(!1),console.error("[hive] swallowed:tasks.initialLoad",E),m(null))}),()=>{k=!0}},[t]),b.useEffect(()=>{if(!t)return;let k=!1,E=null,C=0,_=null;const j=()=>{if(k)return;const A=G0().openWebSocket(`/ws/tasks/${t}`);_=A,A.onmessage=O=>{if(k)return;const D=JSON.parse(String(O.data));D.type!=="tasks-snapshot"&&D.type!=="tasks-updated"||typeof D.content=="string"&&(C=0,S(D.content,x.current))},A.onclose=()=>{if(k)return;C+=1;const O=Math.min(3e4,500*2**(C-1));E=setTimeout(j,O)}};return j(),()=>{k=!0,E!==null&&(clearTimeout(E),E=null),_?.close()}},[S,t]),r!==void 0)return{content:r,hasConflict:!1,loaded:!0,onChange:k=>{},onKeepLocal:()=>{},onReload:()=>{},onSave:async()=>{},toggleTaskAtLine:async k=>{},appendTask:async k=>{},appendSubtask:async(k,E)=>{},updateTaskText:async(k,E)=>{},deleteTask:async k=>{}};const T=async(k,E)=>{if(!t)return;const C=x.current,_=k(C);if(_!==C){v.current=_,x.current=_,y.current=!1,i(_);try{const j=await wl(t,{content:_});v.current=j.content,x.current=j.content,i(j.content)}catch(j){throw v.current=C,x.current=C,i(C),console.error(`[hive] swallowed:tasks.${E}`,j),j}}};return{content:o,hasConflict:f,loaded:l,onChange:k=>{y.current=k!==v.current,x.current=k,i(k)},onKeepLocal:()=>{h(!1),m(null)},onReload:()=>{const k=g??v.current;v.current=k,y.current=!1,x.current=k,i(k),h(!1),m(null)},onSave:async()=>{if(!t)return;const k=await wl(t,{content:o});v.current=k.content,y.current=!1,x.current=k.content,i(k.content),h(!1),m(null)},toggleTaskAtLine:async k=>{if(!t)return;const E=x.current,C=nR(E,k);if(C!==E){v.current=C,x.current=C,y.current=!1,i(C);try{const _=await wl(t,{content:C});v.current=_.content,x.current=_.content,i(_.content)}catch(_){throw v.current=E,x.current=E,i(E),_}}},appendTask:async k=>{const E=k.trim();if(!t||!E)return;const C=x.current,_=tR(C,E);v.current=_,x.current=_,y.current=!1,i(_);try{const j=await wl(t,{content:_});v.current=j.content,x.current=j.content,i(j.content)}catch(j){throw v.current=C,x.current=C,i(C),j}},appendSubtask:async(k,E)=>{const C=E.trim();C&&await T(_=>oR(_,k,C),"appendSubtask")},updateTaskText:async(k,E)=>{const C=E.trim();C&&await T(_=>rR(_,k,C),"updateTaskText")},deleteTask:async k=>{await T(E=>aR(E,k),"deleteTask")}}},lR=3e3,sx=(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&&cc(c,o)?!0:!l.has(c.agent_id))]},cR=(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(x=>x.agent_id!==y)}))},[]),f=b.useCallback((m,y)=>{const v=l.current.get(y);v&&window.clearTimeout(v),l.current.delete(y),i(x=>({...x,[m]:(x[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]??[],x=v.filter(S=>{if(!m.has(S.run_id))return!0;const T=l.current.get(S.run_id);return T&&window.clearTimeout(T),l.current.delete(S.run_id),!1});return x.length===v.length?y:{...y,[t]:x}})},[r,t]);const h=b.useCallback(({agentId:m,agentName:y,runId:v,status:x="starting",terminalInputProfile:S="default",workspaceId:T})=>{const k={agent_id:m,agent_name:y,run_id:v,status:x,terminal_input_profile:S};i(_=>{const j=cc(k,T),A=(_[T]??[]).filter(O=>O.run_id===k.run_id?!1:j?!0:O.agent_id!==k.agent_id);return{..._,[T]:[...A,k]}});const E=l.current.get(v);E&&window.clearTimeout(E);const C=window.setTimeout(()=>{i(_=>({..._,[T]:(_[T]??[]).filter(j=>j.run_id!==v)})),l.current.delete(v)},lR);l.current.set(v,C)},[]),g=b.useMemo(()=>sx(r,t?o[t]??[]:[],t),[r,o,t]);return{forgetOptimisticAgent:c,forgetOptimisticRun:f,optimisticRunsByWorkspaceId:o,recordOptimisticRun:h,terminalRuns:g}};let ix=null;const Vf=new Set,uR=t=>{ix=t;for(const r of Vf)r()},dR=t=>(Vf.add(t),()=>Vf.delete(t)),fR=()=>ix,mR=(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,pR=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"))},hR=typeof navigator<"u"&&/Mac|iPhone|iPad/.test(navigator.platform),gR=(t,r)=>r?t.metaKey:t.ctrlKey,vR=(t,r,o=hR)=>!(t.key.toLowerCase()!==r.key||(r.mod??!1)!==gR(t,o)||(r.alt??!1)!==t.altKey||(r.shift??!1)!==t.shiftKey),yR=t=>{b.useEffect(()=>{const r=o=>{if(!pR(o.target))for(const i of t){if(!vR(o,i))continue;i.handler(o)!==!1&&o.preventDefault();return}};return window.addEventListener("keydown",r),()=>window.removeEventListener("keydown",r)},[t])},bR=({bootstrapError:t,onSelectWorkspace:r,onTriggerAddDialog:o,workspaces:i})=>{const l=b.useMemo(()=>{if(!mR())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]);yR(l)},wR=1100,xR=1e3,Ky="worker-card-shell--dispatch-pulse",Fy="orchestrator-pane--dispatch",kR=t=>typeof CSS<"u"&&typeof CSS.escape=="function"?CSS.escape(t):t.replace(/"/g,'\\"'),SR=(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(Ky,Fy);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="${kR(g.name)}"]`));for(const y of m)f(y,Ky,wR)}const h=document.querySelector(".orchestrator-pane-root");h&&f(h,Fy,xR)},[t,r])},ER=15e3,CR=async(t,r=ER)=>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))})}),TR=(t,r)=>r&&t.some(o=>o.id===r)?r:t[0]?.id??null,AR=(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())},_R=(t,r,o)=>{b.useEffect(()=>{let i=!1;const l=Q0().then(async()=>{const[c,f]=await Promise.all([WE(),FE().catch(()=>null)]);return{items:c,persistedId:f}});return CR(l).then(({items:c,persistedId:f})=>{i||t(h=>{const g=AR(h,c),m=TR(g,f);return r(m),f!==m&&eb(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])},NR=()=>{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))},[])},jR=({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 IE({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}},RR=(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},OR=({activeWorkspaceId:t,onActiveDeleted:r,selectWorkspace:o,setWorkersByWorkspaceId:i,setWorkspaces:l,workspaces:c})=>async f=>{const g=RR(c??[],f.id);await PE(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))},DR=()=>{const[t,r]=b.useState(null),o=b.useRef(Promise.resolve());return{activeWorkspaceId:t,selectWorkspace:l=>{r(l),o.current=o.current.catch(Wr("selectWorkspace.prevQueue")).then(()=>eb(l)).catch(Wr("selectWorkspace.save"))},setActiveWorkspaceId:r}},lx=500,MR=5e3,LR=5e3,zR=()=>({failureCount:0,inFlight:!1,lastSettledAt:null}),HR=(t,r)=>Math.min((r?lx:MR)*2**t,LR),BR=(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}),Yy=(t,r)=>{const o=Object.keys(t),i=Object.keys(r);return o.length!==i.length?!1:i.every(l=>Object.hasOwn(t,l)&&BR(t[l]??[],r[l]??[]))},WR=(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 C of l.current.keys())v.has(C)||l.current.delete(C);h(C=>{const _={};for(const j of y)_[j]=C[j]??[];return Yy(C,_)?C:_});const x=C=>{let _=l.current.get(C);return _||(_=zR(),l.current.set(C,_)),_},S=C=>i.current===C,T=C=>{const _=x(C);_.inFlight||(_.inFlight=!0,QE(C).then(j=>{g||(_.failureCount=0,h(A=>{if(!v.has(C))return A;const O={};for(const D of y)O[D]=D===C?j:A[D]??[];return Yy(A,O)?A:O}))}).catch(j=>{g||(_.failureCount=Math.min(_.failureCount+1,4),console.error("[hive] swallowed:workspaceWorkers.list",j))}).finally(()=>{_.inFlight=!1,_.lastSettledAt=g?null:Date.now()}))},k=()=>{const C=Date.now();for(const _ of y){const j=x(_);if(j.inFlight)continue;if(j.lastSettledAt===null){T(_);continue}const A=HR(j.failureCount,S(_));C-j.lastSettledAt>=A&&T(_)}},E=(C=lx)=>{g||(m!==void 0&&window.clearTimeout(m),m=window.setTimeout(()=>{m=void 0,k(),E()},C))};return c.current=()=>{m!==void 0&&(window.clearTimeout(m),m=void 0),k(),E()},k(),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]},$f="hive:terminal-visible-resize",UR=t=>new CustomEvent($f,{detail:{runId:t}}),qR="\x1B[200~",Vy="\x1B[201~",IR=(t,r)=>{const o=t.split(Vy).join("");return r?.modes?.bracketedPasteMode===!1?o:`${qR}${o}${Vy}`},Hn="\x1B",$y="\x07",PR=new RegExp(`${Hn}\\[[0-?]*[ -/]*[@-~]`,"gu"),KR=new RegExp(`${Hn}\\][^${$y}${Hn}]*(?:${$y}|${Hn}\\\\)`,"gu"),FR=new RegExp("[\0-]","gu"),YR=new RegExp(`${Hn}\\[([0135]) q`,"gu"),VR=new RegExp(`${Hn}\\[[0135] q`,"u"),$R=new RegExp(`${Hn}\\[[0-?]*K`,"u"),GR=t=>{switch(t){case"3":return"4";case"5":return"6";default:return"2"}},XR=t=>t.replace(KR,"").replace(PR,"").replace(FR,""),ZR=t=>XR(t).trim().length>0,QR=t=>!ZR(t)&&t.includes(`${Hn}[?2026`)&&t.includes(`${Hn}[?25`)&&VR.test(t)&&$R.test(t),Gy=t=>({chunk:t.replace(YR,(r,o)=>`${Hn}[${GR(o)} q`),suppress:QR(t)}),JR=(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=T=>T.data||t.value,g=T=>T.inputType==="insertText"||T.inputType==="insertFromComposition"||T.inputType==="insertReplacementText"||T.inputType==="insertDictationResult",m=()=>{i=!0,l=!1,r.setComposing(!0)},y=()=>{i=!0,r.setComposing(!0)},v=T=>{const E=T.data||t.value;!l&&E&&r.commit(E),c(),f()},x=T=>{const k=T;if(i||k.isComposing){if(g(k)){const E=h(k);E&&(r.commit(E),l=!0),c()}return}k.defaultPrevented&&g(k)&&c()},S={capture:!0};return t.addEventListener("compositionstart",m,S),t.addEventListener("compositionupdate",y,S),t.addEventListener("compositionend",v,S),t.addEventListener("input",x,S),()=>{o!==void 0&&clearTimeout(o),t.removeEventListener("compositionstart",m,S),t.removeEventListener("compositionupdate",y,S),t.removeEventListener("compositionend",v,S),t.removeEventListener("input",x,S)}},e4=()=>typeof navigator>"u"?!1:/Mac|iPhone|iPad/.test(navigator.platform),On={killToLineStart:"",lineStart:"",lineEnd:"",killWordBack:"\x1B",wordBack:"\x1Bb",wordForward:"\x1Bf",shiftEnter:"\x1B[13;2u"},t4=(t,r={})=>{const o=r.isMac??e4();if(t.key==="Enter"&&t.shiftKey)return t.type==="keypress"?{kind:"send",bytes:On.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:On.killToLineStart};case"ArrowLeft":return{kind:"send",bytes:On.lineStart};case"ArrowRight":return{kind:"send",bytes:On.lineEnd};case"k":case"K":return{kind:"clear"}}if(l)switch(t.key){case"Backspace":return{kind:"send",bytes:On.killWordBack};case"ArrowLeft":return{kind:"send",bytes:On.wordBack};case"ArrowRight":return{kind:"send",bytes:On.wordForward}}return{kind:"passthrough"}},n4=16,r4=.3,a4={up:"A",down:"B",right:"C",left:"D"},Gf=(t,r)=>{const o=a4[r];return t?`\x1BO${o}`:`\x1B[${o}`},o4=(t,r,o)=>r==="codex"||r==="grok"||r==="opencode"?o==="up"?"\x1B[5~":"\x1B[6~":Gf(t.modes?.applicationCursorKeysMode,o),s4=t=>t==="codex"||t==="grok"||t==="opencode",cx=(t,r="default")=>{let o=0;return i=>{if(t.buffer?.active?.type!=="alternate")return o=0,{handled:!1,input:null};if(!s4(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/=n4,Math.abs(i.deltaY)<50&&(l*=r4),o+=l,l=Math.trunc(o),o%=1):o=0,l===0?{handled:!0,input:null}:{handled:!0,input:o4(t,r,l<0?"up":"down")}}},i4=({element:t,profile:r="default",sendInput:o,terminal:i})=>{const l=cx(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})},l4=(t,r={})=>{switch(t){case"esc":return"\x1B";case"tab":return" ";case"enter":return"\r";case"arrowUp":return Gf(r.applicationCursorKeys,"up");case"arrowDown":return Gf(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 On.killToLineStart;case"ctrlA":return On.lineStart;case"ctrlE":return On.lineEnd;case"ctrlW":return""}},c4="Invalid terminal control message",u4=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},d4=({initialSize:t,onError:r,onExit:o,onOutput:i,onRestore:l,onClose:c,runId:f})=>{const h=crypto.randomUUID(),g={...t,clientId:h},m=G0(),y=m.openWebSocket(`/ws/terminal/${f}/io`,g),v=m.openWebSocket(`/ws/terminal/${f}/control`,g);let x=!1,S=!1,T=!1;const k=[];let E=null;const C=()=>{S||T||(T=!0,c?.())};y.onclose=C,v.onclose=C;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:"",O=D=>{v.readyState===v.OPEN&&v.send(JSON.stringify({type:"output_ack",bytes:D}))};if(!x){k.push({chunk:A,acknowledge:O});return}i(A,O)},v.onopen=()=>{_()},v.onmessage=j=>{const A=u4(j.data);if(!A){r(c4);return}if(A.type==="exit"&&o(A.code),A.type==="error"&&r(A.message),A.type==="restore"){l(A.snapshot),x=!0,v.readyState===v.OPEN&&v.send(JSON.stringify({type:"restore_complete"}));for(const O of k.splice(0))i(O.chunk,O.acknowledge)}},{dispose(){S=!0,y.close(),v.close()},resize(j,A,O,D){E={cols:j,rows:A},O!==void 0&&(E.pixelWidth=O),D!==void 0&&(E.pixelHeight=D),_()},sendBinaryInput(j){if(y.readyState!==y.OPEN)return;const A=new Uint8Array(j.length);for(let O=0;O<j.length;O++)A[O]=j.charCodeAt(O)&255;y.send(A)},sendInput(j){y.readyState===y.OPEN&&y.send(j)}}},f4=16,m4=.08,p4=.96,h4=.025,Xy=5,g4=100,v4=8,y4=6,b4=4,w4=.5,x4=250,k4=24,S4=2,E4=".xterm-viewport",C4=".xterm-screen";function T4({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,x=null,S=null,T=f4,k=0,E=0,C=null,_=[];const j=cx(i,r),A=()=>{m!==null&&(window.cancelAnimationFrame(m),m=null)},O=()=>{C!==null&&(window.cancelAnimationFrame(C),C=null)},D=()=>(x?.isConnected||(x=t.querySelector(E4)),x),L=()=>(S?.isConnected||(S=t.querySelector(C4)),S),B=()=>{const le=D(),ie=i.rows;if(!le||!ie||ie<=0)return;const ue=le.clientHeight/ie;ue>=6&&ue<=64&&(T=ue)},q=()=>{const le=L();le&&(le.style.transform=k!==0?`translateY(${-k}px)`:"")},te=()=>{k!==0&&(k=0,q())},ee=()=>{if(Math.abs(k)>=T/2){const le=D();if(le){const ie=le.scrollHeight-le.clientHeight,ue=k>0?T:-T;le.scrollTop=Math.min(ie,Math.max(0,le.scrollTop+ue))}}te()},V=le=>{const ie=D();if(!ie)return"missing";const ue=ie.scrollHeight-ie.clientHeight;if(ue<=0)return te(),"stuck";const pe=k+le,Ae=Math.trunc(pe/T);let Ce=pe-Ae*T;const Se=ie.scrollTop,Qe=Math.min(ue,Math.max(0,Se+Ae*T)),ft=Qe!==Se;ft&&(ie.scrollTop=Qe),(Qe<=0&&pe<0||Qe>=ue&&pe>0)&&(Ce=0);const en=Ce!==k;return k=Ce,en&&q(),ft||en?"moved":"stuck"},J=le=>{c+=le/T;const ie=Math.trunc(c);return c%=1,ie===0||i.scrollLines?.(ie),!0},X=(le,ie)=>{const ue=[];for(let pe=0;pe<ie;pe++){const{handled:Ae,input:Ce}=j({deltaMode:WheelEvent.DOM_DELTA_LINE,deltaY:le,shiftKey:!1});if(!Ae)break;Ce&&ue.push(Ce)}return ue.length>0&&o(ue.join("")),ue.length},$=le=>{f+=le/T;const ie=Math.trunc(f);if(f%=1,ie===0)return!1;const ue=r==="codex"||r==="opencode"?b4:y4;return X(ie<0?-1:1,Math.min(Math.abs(ie),ue))>0},M=le=>{const ie=i.buffer?.active?.type;return ie!==h&&(c=0,f=0,h=ie,te()),ie==="alternate"?{moved:$(le),normalBuffer:!1}:{moved:V(le)==="moved"||J(le),normalBuffer:!0}},I=()=>{C=null;const le=E;E=0,le!==0&&(v=M(le).normalBuffer)},P=()=>{C===null&&(C=window.requestAnimationFrame(I))},Z=(le,ie)=>{_.push({t:le,y:ie}),_.length>v4&&_.shift()},K=le=>{const ie=le-g4,ue=_.filter(Qe=>Qe.t>=ie),pe=ue[0],Ae=ue[ue.length-1];if(!pe||!Ae||pe===Ae)return 0;const Ce=Ae.t-pe.t;if(Ce<=0)return 0;const Se=(pe.y-Ae.y)/Ce;return Math.max(-Xy,Math.min(Xy,Se))};let R=0;const W=()=>{if(m=null,R===0)return;if(i.buffer?.active?.type!=="alternate"){R=0;return}const le=R>0?1:-1,ie=Math.min(Math.abs(R),S4);if(X(le,ie)<ie){R=0;return}R-=le*ie,R!==0&&(m=window.requestAnimationFrame(W))},re=le=>{const ie=Math.min(32,Math.max(1,le-y));y=le;const{moved:ue,normalBuffer:pe}=M(g*ie);if(!ue||!pe){m=null,c=0,g=0,ee();return}if(g*=p4**(ie/16.67),Math.abs(g)<h4){m=null,c=0,ee();return}m=window.requestAnimationFrame(re)},ae=le=>{A(),R=0,O(),E=0,_=[],l=le.touches.length===1?le.touches[0]?.clientY??null:null,l!==null&&Z(le.timeStamp,l),g=0,v=!1,D(),B()},fe=le=>{if(l===null||le.touches.length!==1)return;const ie=le.touches[0]?.clientY??l,ue=l-ie;Math.abs(ue)<1||(l=ie,le.preventDefault(),E+=ue,Z(le.timeStamp,ie),P())},me=le=>{l=null,O(),I();const ie=K(le.timeStamp);if(_=[],v&&Math.abs(ie)>=m4){g=ie,y=performance.now(),m=window.requestAnimationFrame(re);return}if(!v&&r!=="opencode"&&Math.abs(ie)>=w4&&i.buffer?.active?.type==="alternate"){const ue=Math.min(k4,Math.round(Math.abs(ie)*x4/T));if(ue>0){R=ie>0?ue:-ue,m=window.requestAnimationFrame(W);return}}g=0,c=0,ee()},ce=()=>{A(),R=0,O(),E=0,_=[],l=null,c=0,f=0,g=0,v=!1,te()};return t.addEventListener("touchstart",ae,{passive:!0}),t.addEventListener("touchmove",fe,{passive:!1}),t.addEventListener("touchend",me,{passive:!0}),t.addEventListener("touchcancel",ce,{passive:!0}),()=>{t.removeEventListener("touchstart",ae),t.removeEventListener("touchmove",fe),t.removeEventListener("touchend",me),t.removeEventListener("touchcancel",ce),A(),O(),te()}}const A4=(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}},_4=t=>t instanceof Error&&t.message?`Terminal failed to load: ${t.message}`:"Terminal failed to load. Refresh this page and try again.",N4=new RegExp("\x1B\\[M([\\s\\S])([\\s\\S])([\\s\\S])","g"),j4=new TextEncoder,R4=(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}`},O4=(t,r)=>{if(r!=="grok"&&r!=="opencode")return{binary:!0,chunk:t};const o=t.replace(N4,R4);return{binary:o===t,chunk:o}},D4=(t,r="default")=>{const o=At(),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),x=b.useRef(null),S=b.useRef(!1),[T,k]=b.useState("canvas"),[E,C]=b.useState(!1),_=b.useRef(!1),j=b.useCallback(B=>{k(B);const q=i.current;q&&(q.dataset.renderer=B)},[]),A=b.useCallback(B=>{S.current||v.current?.sendInput(B)},[]),O=b.useCallback(B=>{const q=x.current?.modes?.applicationCursorKeysMode;A(l4(B,q===void 0?{}:{applicationCursorKeys:q}))},[A]),D=b.useCallback(B=>{const q=IR(B,x.current??void 0);return v.current?.sendInput(q),q},[]),L=b.useCallback(()=>{const B=()=>{x.current?.scrollToBottom();const q=i.current?.querySelector(".xterm-viewport");q&&(q.scrollTop=q.scrollHeight)};B(),window.requestAnimationFrame(()=>{B(),window.requestAnimationFrame(B)}),window.setTimeout(B,80),_.current=!1,C(!1)},[]);return b.useEffect(()=>{if(!i.current)return;let B=!1,q,te,ee,V,J,X,$,M,I,P,Z,K=null,R,W,re,ae,fe;c(null),g.current="connecting",h("connecting"),_.current=!1,C(!1);const me=ce=>{g.current!==ce&&(g.current=ce,h(ce))};return Promise.all([Tt(()=>import("./xterm-B-qIQCd3.js"),[]),Tt(()=>import("./addon-fit-DX4qG4td.js"),[]),Tt(()=>import("./addon-unicode11-Bt8F3D7-.js"),[]),Tt(()=>import("./addon-clipboard-wHJhZAA4.js"),[])]).then(([ce,le,ie,ue])=>{if(B||!i.current)return;const pe=typeof window<"u"?getComputedStyle(document.documentElement):null,Ae=pe?.getPropertyValue("--bg-crust").trim()||"#0e0e0e",Ce=pe?.getPropertyValue("--text-primary").trim()||"#ebebeb",Se=new ce.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:Ae,foreground:Ce}}),Qe=new le.FitAddon;Se.loadAddon(Qe),Se.loadAddon(new ie.Unicode11Addon),Se.unicode.activeVersion="11",Se.loadAddon(new ue.ClipboardAddon),Se.open(i.current),j("canvas"),Qe.fit(),X=Se,x.current=Se,$=Qe;const ft=()=>{const de=Se.buffer.active,Te=de.viewportY<de.baseY;_.current!==Te&&(_.current=Te,C(Te))},en=()=>{ae===void 0&&(ae=window.requestAnimationFrame(()=>{ae=void 0,ft()}))};W=Se.onScroll(en),re=Se.buffer.onBufferChange(en),P=i4({element:i.current,profile:r,sendInput:de=>J?.sendInput(de),terminal:Se}),o&&(Z=T4({element:i.current,profile:r,sendInput:de=>J?.sendInput(de),terminal:Se})),K=i.current.querySelector(".xterm-helper-textarea"),K&&(R=JR(K,{setComposing:de=>{S.current=de},commit:de=>J?.sendInput(de)})),typeof Se.attachCustomKeyEventHandler=="function"&&Se.attachCustomKeyEventHandler(de=>{const Te=t4(de,{hasSelection:Se.hasSelection()});switch(Te.kind){case"send":return de.preventDefault(),J?.sendInput(Te.bytes),!1;case"clear":return de.preventDefault(),Se.clear(),!1;case"copy":{de.preventDefault();const $e=Se.getSelection();return $e&&navigator.clipboard?.writeText($e).catch(()=>{}),Se.clearSelection(),!1}case"block":return!1;case"passthrough":return!0}});const Cn=()=>{const de=i.current;return de?.isConnected?!de.closest('[data-terminal-host-parked="true"]'):!1},pn=()=>{if(!i.current)return{};const de=i.current.clientWidth,Te=i.current.clientHeight,$e={};return Te>0&&($e.pixelHeight=Te),de>0&&($e.pixelWidth=de),$e},Tn=()=>{if(!i.current||!Cn())return;const de=pn();if(!de.pixelHeight||!de.pixelWidth||fe&&fe.pixelHeight===de.pixelHeight&&fe.pixelWidth===de.pixelWidth)return;$?.fit();const Te={cols:X?.cols??80,rows:X?.rows??24,...pn()};fe&&fe.cols===Te.cols&&fe.rows===Te.rows&&fe.pixelHeight===Te.pixelHeight&&fe.pixelWidth===Te.pixelWidth||(fe=Te,J?.resize(Te.cols,Te.rows,Te.pixelWidth,Te.pixelHeight))},tn=()=>{I&&window.clearTimeout(I),I=window.setTimeout(()=>{I=void 0,Tn()},50)};Tt(()=>import("./addon-web-links-DIbG5aQx.js"),[]).then(de=>{B||X!==Se||Se.loadAddon(new de.WebLinksAddon)}).catch(()=>{}),A4()&&Tt(()=>import("./addon-webgl-DCtw1yLn.js"),[]).then(de=>{if(!(B||X!==Se))try{const Te=new de.WebglAddon;Te.onContextLoss(()=>{Te.dispose(),j("canvas")}),Se.loadAddon(Te),j("webgl"),tn()}catch{j("canvas")}}).catch(()=>{j("canvas")}),J=d4({initialSize:{cols:Se.cols,rows:Se.rows,...pn()},onError(de){c(de)},onExit(){me("stopped")},onOutput(de,Te){me("running");const $e=j4.encode(de).byteLength;if(r==="codex"){const Vr=Gy(de);if(Vr.suppress){Te($e);return}Se.write(Vr.chunk,()=>Te($e));return}Se.write(de,()=>Te($e))},onRestore(de){me("running"),Se.write(r==="codex"?Gy(de).chunk:de)},onClose(){B||y(de=>de+1)},runId:t}),v.current=J,V=Se.onData(de=>{S.current||J?.sendInput(de)}),typeof Se.onBinary=="function"&&(ee=Se.onBinary(de=>{const Te=O4(de,r);Te.binary?J?.sendBinaryInput(Te.chunk):J?.sendInput(Te.chunk)})),Tn(),typeof ResizeObserver<"u"&&i.current&&(M=new ResizeObserver(tn),M.observe(i.current)),q=de=>{de.detail?.runId===t&&tn()},te=()=>tn(),window.addEventListener($f,q),window.addEventListener("resize",te)}).catch(ce=>{B||(c(_4(ce)),me("stopped"))}),()=>{B=!0,q&&window.removeEventListener($f,q),te&&window.removeEventListener("resize",te),M?.disconnect(),I&&window.clearTimeout(I),P?.(),Z?.(),R?.(),ae!==void 0&&window.cancelAnimationFrame(ae),W?.dispose(),re?.dispose(),ee?.dispose(),V?.dispose(),J?.dispose(),X?.dispose(),$?.dispose(),v.current=null,x.current=null}},[t,r,m]),{containerRef:i,error:l,status:f,sendInput:A,sendKey:O,beginPaste:D,renderer:T,isScrolledUp:E,scrollToBottom:L}},M4={connecting:"terminal.statusConnecting",running:"terminal.statusRunning",stopped:"common.stopped"},Xf="hive-terminal-parking-lot",L4=500,z4=t=>[`worker-pty-${t}`,`orch-pty-${t}`,`shell-pty-${t}`],H4=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&&!H4(o));return r[r.length-1]??null},W4=()=>{let t=document.getElementById(Xf);return t||(t=document.createElement("div"),t.id=Xf,t.hidden=!0,t.style.display="none",(document.body??document.documentElement).appendChild(t)),t},yf=()=>{const t=document.getElementById(Xf);t&&t.childElementCount===0&&t.remove()},Hl=new Set;let zs,Hs;const Zy=()=>{for(const t of Hl)t()},U4=()=>{zs?.disconnect(),zs=void 0,Hs!==void 0&&(window.clearInterval(Hs),Hs=void 0)},q4=()=>{if(zs||Hs!==void 0)return;const t=document.body??document.documentElement;if(typeof MutationObserver<"u"&&t){zs=new MutationObserver(Zy),zs.observe(t,{attributeFilter:["aria-hidden","class","data-pty-slot","hidden","id","style"],attributes:!0,childList:!0,subtree:!0});return}Hs=window.setInterval(Zy,100)},I4=t=>(Hl.add(t),q4(),()=>{Hl.delete(t),Hl.size===0&&U4()}),P4=[50,150,300],K4=t=>{const r=[],o=[],i=()=>window.dispatchEvent(UR(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 P4)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}},F4=t=>{const[r,o]=b.useState(null);return b.useEffect(()=>{const i=z4(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(),I4(c)},[t]),r},Y4=(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,yf()}},[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)},L4),m},[o,m,r]),b.useLayoutEffect(()=>{const v=h.current;if(!v)return;if(!o){y(),v.remove(),v.dataset.terminalHostParked="false",yf();return}const x=r??W4();if(v.parentElement===x)return;const S=v.parentElement!==null,T=document.activeElement;r||y(),!r&&T instanceof HTMLElement&&v.contains(T)&&T.blur(),v.dataset.terminalHostParked=r?"false":"true",x.appendChild(v),yf(),r&&S&&(y(),g.current=K4(t))},[o,y,t,r]),o?l:null},V4=({inputProfile:t="default",runId:r,title:o})=>{const i=F4(r),l=Y4(r,i);return l?dc.createPortal(u.jsx($4,{inputProfile:t,runId:r,title:o}),l):null},$4=({inputProfile:t,runId:r,title:o})=>{const{t:i}=ke(),l=At(),{containerRef:c,error:f,status:h,isScrolledUp:g,scrollToBottom:m}=D4(r,t),y=M4[h],v=b.useCallback(()=>{c.current?.querySelector(".xterm-helper-textarea")?.blur(),m()},[c,m]);return u.jsxs("div",{className:"flex h-full min-h-0 w-full min-w-0 flex-col overflow-hidden",children:[u.jsx("p",{className:"sr-only",children:y?i(y):h}),f?u.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,u.jsxs("div",{className:"relative h-full min-h-0 w-full min-w-0 flex-1 overflow-hidden",children:[u.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"?u.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?u.jsx(G4,{label:i("terminal.scrollToBottom"),onJump:v}):null]})]})},G4=({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]),u.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})},X4=({hidden:t=!1,optimisticRuns:r=[],terminalRuns:o,workspaceId:i})=>{const{t:l}=ke(),c=sx(o,r,i);return u.jsx("section",{hidden:t,"aria-hidden":t||void 0,"aria-label":l("terminalPanels.aria"),children:c.map(f=>u.jsx(V4,{inputProfile:f.terminal_input_profile??"default",runId:f.run_id,title:`${f.agent_name} (${f.status})`},f.run_id))})},Z4=[{version:"2.1.1",date:"2026-06-14",en:["Codex terminal input is smoother and more reliable when prompts are pasted or injected for an agent.","Action Center layout and interaction details are cleaner on narrow and mobile-sized screens."],zh:["Codex 终端在粘贴或注入 prompt 时输入更顺、更可靠。","活动中心在窄屏和手机尺寸下的布局与交互细节更干净。"]},{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 对原子保存编辑器也更宽容。"]}],Qy=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}},bf=(t,r)=>{const o=Qy(t),i=Qy(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},Q4=(t,r,o=Z4)=>{if(r===null)return{show:!1,entries:[],seedOnly:!0};if(bf(t,r)<=0)return{show:!1,entries:[],seedOnly:!1};const i=o.filter(l=>bf(l.version,r)>0&&bf(l.version,t)<=0);return i.length===0?{show:!1,entries:[],seedOnly:!0}:{show:!0,entries:i,seedOnly:!1}},ux="hive.last-seen-version",J4="1.7.0",e5=(t,r)=>{try{const o=window.localStorage.getItem(ux);return o||(r?J4:null)}catch{return t}},Jy=t=>{try{window.localStorage.setItem(ux,t)}catch{}},t5=({hasExistingWorkspace:t,wizardOpen:r})=>{const o=ex,[i,l]=b.useState(void 0);b.useEffect(()=>{i!==void 0||t===null||l(e5(o,t))},[t,i]);const c=b.useMemo(()=>i===void 0?{show:!1,entries:[],seedOnly:!1}:Q4(o,i),[i]),[f,h]=b.useState(!1);b.useEffect(()=>{c.seedOnly&&Jy(o)},[c.seedOnly]);const g=b.useCallback(()=>{Jy(o),h(!0)},[]);return{open:c.show&&!f&&!r,entries:c.entries,close:g}},e0="hive.first-run-seen",n5=()=>{const[t,r]=b.useState(()=>{try{return window.localStorage.getItem(e0)==="1"}catch{return!0}}),o=b.useCallback(()=>{try{window.localStorage.setItem(e0,"1")}catch{}r(!0)},[]);return{seen:t,markSeen:o}},r5=t=>{const{seen:r,markSeen:o}=n5(),[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}},a5=(t,r)=>t.findIndex(i=>i.id===r.id)===-1?[...t,r]:t.map(i=>i.id===r.id?r:i),dx=t=>t==="codex"?"codex":t==="grok"?"grok":t==="opencode"?"opencode":"default",t0=(t,r)=>dx(t.find(o=>o.id===r)?.commandPresetId),o5=({activeWorkspaceId:t,onWorkerDeleted:r,onWorkerRunStarted:o,setWorkersByWorkspaceId:i,workers:l})=>{const c=b.useCallback(async({commandPresetId:y,name:v,role:x,roleDescription:S,startupCommand:T})=>{if(!t)return{error:"No active workspace",runId:null};const k=T.trim(),E=await iC(t,{autostart:!0,command_preset_id:y||null,description:S.trim(),name:v,role:x,startup_command:k||null});return i(C=>({...C,[t]:a5(C[t]??[],E.worker)})),E.agentStart.ok&&E.agentStart.runId&&o?.({agentId:E.worker.id,agentName:E.worker.name,runId:E.agentStart.runId,terminalInputProfile:dx(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 cC(t,y),i(v=>({...v,[t]:(v[t]??[]).filter(x=>x.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 Il(t,y);return o?.({agentId:y,agentName:y,runId:v.runId,terminalInputProfile:t0(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 Pl(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 x=await KE(t,y,v);return o?.({agentId:y,agentName:y,runId:x.runId,terminalInputProfile:t0(l,y),workspaceId:t}),{error:null,runId:x.runId}}catch(x){return{error:x instanceof Error?x.message:String(x),runId:null}}},[t,o,l]);return{createWorker:c,deleteWorker:f,startWorker:h,stopWorkerRun:g,restartWorkerRun:m}},Hm={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"]},s5=new Set(Hm.mac),i5=t=>typeof t=="string"&&s5.has(t),fx=(t,r)=>Hm[r].includes(t),mx=t=>t==="mac"||t==="windows"||t==="linux"?"finder":"vscode",l5="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",wf="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",px="/assets/finder-C4Jmsb0B.png",c5="/assets/ghostty-D-Js4rdm.png",u5="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",d5="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",f5="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",m5="/assets/zed-C5BQT8X3.png",p5={mac:"openWorkspace.target.finder.mac",windows:"openWorkspace.target.finder.windows",linux:"openWorkspace.target.finder.linux",other:"openWorkspace.target.finder.linux"},h5={mac:px,windows:wf,linux:wf,other:wf},kc={vscode:{labelKey:"openWorkspace.target.vscode",iconSrc:d5},"vscode-insiders":{labelKey:"openWorkspace.target.vscodeInsiders",iconSrc:f5},cursor:{labelKey:"openWorkspace.target.cursor",iconSrc:l5},finder:{labelKey:"openWorkspace.target.finder.mac",iconSrc:px},terminal:{labelKey:"openWorkspace.target.terminal",iconSrc:u5},ghostty:{labelKey:"openWorkspace.target.ghostty",iconSrc:c5,iconScale:1.2},zed:{labelKey:"openWorkspace.target.zed",iconSrc:m5}},hx=(t,r)=>t==="finder"?p5[r]:kc[t].labelKey,gx=(t,r)=>t==="finder"?h5[r]:kc[t].iconSrc,xf=(t,r)=>{const o=fx(t,r)?t:mx(r),i=kc[o];return{id:o,iconSrc:gx(o,r),labelKey:hx(o,r),...i.iconScale!==void 0?{iconScale:i.iconScale}:{}}},g5=t=>Hm[t].map(r=>{const o=kc[r];return{id:r,iconSrc:gx(r,t),labelKey:hx(r,t),...o.iconScale!==void 0?{iconScale:o.iconScale}:{}}}),v5=()=>{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"},vx="hive.openTarget.preferred",y5=()=>{try{return window.localStorage.getItem(vx)}catch{return null}},b5=t=>{const r=mx(t);if(typeof window>"u")return r;const o=y5();if(!o)return r;const i=o==="ghostie"?"ghostty":o;return i5(i)&&fx(i,t)?i:r},w5=t=>{try{window.localStorage.setItem(vx,t)}catch{}},x5={"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"},k5=({workspace:t})=>{const{t:r}=ke(),{mode:o}=ew(),i=Jt(),l=b.useMemo(()=>v5(),[]),c=g5(l),[f,h]=b.useState(()=>b5(l)),[g,m]=b.useState(!1),[y,v]=b.useState(!1),x=b.useRef(null),S=b.useRef(null),T=xf(f,l),k=r(T.labelKey);b.useEffect(()=>{if(!g)return;const D=B=>{B.key==="Escape"&&m(!1)},L=B=>{const q=x.current;q&&!q.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),w5(D),m(!1),S.current?.focus()},[]),C=b.useCallback(async()=>{if(!(!t||y)){v(!0);try{const D=await fC(t.id,f);if(D.ok){if(o==="mobile"){const L=xf(D.effectiveTargetId,l).labelKey;i.show({kind:"success",message:r("openWorkspace.opened",{app:r(L),workspace:t.name})})}}else{const L=xf(D.effectiveTargetId,l).labelKey;i.show({kind:"error",message:r(x5[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:k,workspace:t.name}):j,O=t?r("openWorkspace.openInAria",{app:k,workspace:t.name}):j;return u.jsxs("div",{ref:x,className:"open-workspace relative flex",children:[u.jsx(lt,{label:A,children:u.jsx("span",{className:"flex",children:u.jsxs("button",{ref:S,type:"button","aria-label":O,"data-testid":"topbar-open-workspace",disabled:_||y,onClick:()=>{C()},className:"open-workspace__main",children:[u.jsx("span",{className:"open-workspace__trigger-icon","aria-hidden":!0,children:y?u.jsx(To,{size:13,className:"animate-spin"}):u.jsx("img",{src:T.iconSrc,alt:"",className:"open-workspace__trigger-img",style:{transform:T.iconScale?`scale(${T.iconScale})`:void 0}})}),u.jsx("span",{children:r("openWorkspace.open")})]})})}),u.jsx(lt,{label:r("openWorkspace.selectTarget"),children:u.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:u.jsx(Co,{size:12,"aria-hidden":!0})})}),g?u.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 u.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:[u.jsx("span",{className:"open-workspace__option-icon","aria-hidden":!0,children:u.jsx("img",{src:D.iconSrc,alt:"",className:"open-workspace__option-img",style:{transform:D.iconScale?`scale(${D.iconScale})`:void 0}})}),u.jsx("span",{className:"flex-1",children:r(D.labelKey)}),u.jsx("span",{className:"open-workspace__check","aria-hidden":!0,children:L?u.jsx(Eo,{size:13}):null})]},D.id)})}):null]})},S5=b.lazy(()=>Tt(()=>import("./WorkflowsDrawer-C8csID1I.js"),__vite__mapDeps([5,4])).then(t=>({default:t.WorkflowsDrawer}))),E5=b.lazy(()=>Tt(()=>import("./WorkspaceMemoryDrawer-C_Aq9-o6.js"),__vite__mapDeps([6,3])).then(t=>({default:t.WorkspaceMemoryDrawer}))),C5=()=>{const[t,r]=b.useState(null),{activeWorkspaceId:o,selectWorkspace:i,setActiveWorkspaceId:l}=DR(),{demoMode:c,enableDemo:f,exitDemo:h}=Lj(),g=c||!t?[]:t.map(({id:de})=>de),[m,y]=WR(g,{activeWorkspaceId:o}),[v,x]=b.useState(0),[S,T]=b.useState(!1),[k,E]=b.useState(!1),[C,_]=b.useState(!1),[j,A]=b.useState(null),[O,D]=b.useState("team"),L=l3(),B=Jt(),{wizardOpen:q,closeWizard:te}=r5(t),ee=t5({hasExistingWorkspace:t===null?null:t.length>0,wizardOpen:q}),J=Zw().enabled;b.useEffect(()=>{J||(_(!1),D(de=>de==="flows"?"team":de))},[J]);const X=b.useCallback(()=>x(de=>de+1),[]),[$,M]=b.useState(null),I=b.useCallback(de=>{M(de),B.show({kind:"error",message:de})},[B]);_R(r,l,I);const P=jR({onWorkspaceCreated:de=>{r(Te=>Te===null?[de]:[...Te,de]),i(de.id),y(Te=>({...Te,[de.id]:[]}))},onError:de=>B.show({kind:"error",message:de})}),K=zj({demoMode:c,workspaces:t,activeWorkspaceId:o,workersByWorkspaceId:m}),R=K.effectiveActiveWorkspace?.id,W=R?K.effectiveWorkersByWorkspaceId[R]??[]:[];b.useEffect(()=>{A(de=>de&&W.some(Te=>Te.id===de)?de:null)},[W]);const re=cR(K.pollWorkspaceId,M_(K.pollWorkspaceId));M3(!0);const ae=iR(c?null:o??null,c?Mj:void 0),fe=b.useMemo(()=>K.effectiveActiveWorkspace?eR(ae.content):0,[K.effectiveActiveWorkspace,ae.content]),me=o5({activeWorkspaceId:o,onWorkerDeleted:re.forgetOptimisticAgent,onWorkerRunStarted:re.recordOptimisticRun,setWorkersByWorkspaceId:y,workers:W}),ce=OR({activeWorkspaceId:o,onActiveDeleted:()=>{E(!1),T(!1),_(!1)},selectWorkspace:i,setWorkersByWorkspaceId:y,setWorkspaces:r,workspaces:t});bR({bootstrapError:$,onSelectWorkspace:i,onTriggerAddDialog:X,workspaces:K.effectiveWorkspaces}),K3({onAddWorkspace:X,onTryDemo:f,ready:c||t!==null||$!==null});const le=NR();SR(R,W);const ie=$!==null&&!c&&t===null,ue=At(),pe=b.useSyncExternalStore(dR,fR),Ae=ue?u.jsx(d3,{status:pe}):null,Ce=R?re.optimisticRunsByWorkspaceId[R]??[]:[],Qe=!ie&&!c&&R!==void 0&&(re.terminalRuns.length>0||Ce.length>0)?u.jsx(X4,{optimisticRuns:Ce,terminalRuns:re.terminalRuns,workspaceId:R},`terminal-${R}`):null,ft=ie?u.jsx(z3,{onTryDemo:f}):u.jsx(Oj,{activeId:R,activeWorkspace:K.effectiveActiveWorkspace,activeWorkerId:j,bootstrapError:$,demoMode:c,workspacesLoading:!c&&t===null,onActiveWorkerChange:A,onDeleteWorkspace:ce,onExitDemo:h,onRequestAddWorkspace:X,onShellRunClosed:re.forgetOptimisticRun,onShellRunStarted:(de,Te)=>re.recordOptimisticRun({agentId:Te.agent_id,agentName:Te.agent_name,runId:Te.run_id,status:Te.status,terminalInputProfile:Te.terminal_input_profile??"default",workspaceId:de}),onTryDemo:f,orchestratorAutostartErrors:P.orchestratorAutostartErrors,orchestratorAutostartRunIds:P.orchestratorAutostartRunIds,recordOrchestratorResult:P.recordOrchestratorResult,terminalRuns:re.terminalRuns,workerActions:me,workers:W,showInlineActionCenter:ue}),en=u.jsx(I2,{addDialogTrigger:v,wizardOpen:q,whatsNewOpen:ee.open,whatsNewEntries:ee.entries,onCloseWhatsNew:ee.close,onAddWorkspace:X,onCloseTaskGraph:()=>T(!1),onCloseWizard:te,onCreateWorkspace:P.createNewWorkspace,onTryDemo:f,taskGraphOpen:S,tasksFile:ae,workspacePath:K.effectiveActiveWorkspace?.path??null,workers:W,onSelectOwner:le}),Cn=C&&!c&&J?u.jsx(b.Suspense,{fallback:null,children:u.jsx(S5,{open:!0,onClose:()=>_(!1),workspaceId:o??null})}):null,pn=k&&!c?u.jsx(b.Suspense,{fallback:null,children:u.jsx(E5,{open:!0,onClose:()=>E(!1),workspaceId:o??null})}):null,Tn=u.jsx(X3,{activeWorkspaceId:K.effectiveActiveWorkspaceId,collapsed:L.collapsed,createDisabledReason:$??void 0,onCreateClick:X,onDeleteWorkspace:ce,onSelectWorkspace:i,onToggleCollapse:L.toggleCollapsed,workersByWorkspaceId:K.effectiveWorkersByWorkspaceId,workspaces:K.effectiveWorkspaces}),tn=u.jsxs(u.Fragment,{children:[u.jsx(k5,{workspace:K.effectiveActiveWorkspace}),ie||c||!R?null:u.jsx(t_,{workspaceId:R,onOpenWorker:A},R)]});return ue?u.jsxs(u.Fragment,{children:[u.jsx(S3,{workspaceSwitcher:ie?void 0:u.jsx(N3,{activeWorkspaceId:K.effectiveActiveWorkspaceId,workspaces:K.effectiveWorkspaces,workersByWorkspaceId:K.effectiveWorkersByWorkspaceId,createDisabledReason:$??void 0,onCreateClick:X,onDeleteWorkspace:ce,onSelectWorkspace:i}),topbarActions:ie?void 0:u.jsx(u.Fragment,{children:u.jsx(Jw,{})}),openTaskCount:fe,workingCount:W.filter(de=>de.status==="working").length,banner:Ae,terminalPanels:Qe,fullBleed:ie?ft:void 0,team:ie?null:ft,tasks:ie?null:u.jsx(T3,{tasksFile:ae,workspacePath:K.effectiveActiveWorkspace?.path??null,workers:W,onSelectOwner:le,onAddWorkspace:X,demoMode:c}),settings:ie||!c?void 0:u.jsx(h3,{demoMode:c,onTryDemo:f,onExitDemo:h}),activeSection:O,onSectionChange:D,overlays:en}),u.jsx(Iy,{terminalRuns:re.terminalRuns}),u.jsx(Py,{})]}):u.jsxs(u.Fragment,{children:[u.jsxs(c3,{hideTopbarActions:!K.effectiveActiveWorkspace,memoryOpen:k,onToggleMemory:c?void 0:()=>E(de=>!de),onToggleTaskGraph:()=>T(de=>!de),openTaskCount:fe,topbarActions:tn,taskGraphOpen:S,onToggleWorkflows:c||!J?void 0:()=>_(de=>!de),workflowsOpen:C,sidebarResize:L,sidebar:Tn,children:[ft,Qe,en,pn,Cn]}),u.jsx(Iy,{terminalRuns:re.terminalRuns}),u.jsx(Py,{}),u.jsx(D3,{})]})},T5={success:mS,warning:lc,error:bS},kf={success:"var(--status-green)",warning:"var(--status-orange)",error:"var(--status-red)"},n0=({toast:t,api:r})=>{const{t:o}=ke(),i=T5[t.kind],l=r.getDuration(t.id);return u.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, ${kf[t.kind]} 35%, var(--border))`},children:[u.jsx("span",{className:"mt-0.5 shrink-0",style:{color:kf[t.kind]},"aria-hidden":!0,children:u.jsx(i,{size:14})}),u.jsx("div",{className:"min-w-0 flex-1 break-words text-sm text-pri",children:t.message}),u.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:u.jsx(vo,{size:14,"aria-hidden":!0})}),l>0?u.jsx("span",{className:"toast-progress-bar",style:{background:kf[t.kind],animationDuration:`${l}ms`},"aria-hidden":!0}):null]})},A5=()=>{const t=GA(),r=Jt(),o=At();if(t.length===0)return null;const i=t.filter(c=>c.kind==="error"),l=t.filter(c=>c.kind!=="error");return u.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:[u.jsx("div",{role:"status","aria-live":"polite",className:"flex flex-col gap-2",children:l.map(c=>u.jsx(n0,{toast:c,api:r},c.id))}),u.jsx("div",{role:"alert","aria-live":"assertive",className:"flex flex-col gap-2",children:i.map(c=>u.jsx(n0,{toast:c,api:r},c.id))})]})},_5=({children:t})=>u.jsx(Kb,{delayDuration:250,skipDelayDuration:150,children:u.jsx(RE,{children:u.jsx($A,{children:u.jsx(m_,{children:u.jsx(Jj,{children:u.jsx(Zj,{children:u.jsxs(Vj,{children:[t,u.jsx(A5,{})]})})})})})})}),N5=()=>u.jsx(l_,{children:u.jsx(_5,{children:u.jsx(C5,{})})}),r0="\0gw:",ya={Unauthorized:4401,Forbidden:4403,DaemonOffline:4404,Revoked:4410,InternalError:4500},yx="hb:ping",bx="hb:pong",j5=t=>t===ya.Unauthorized||t===ya.Revoked;function R5(t){return t instanceof Uint8Array||ArrayBuffer.isView(t)&&t.constructor.name==="Uint8Array"&&"BYTES_PER_ELEMENT"in t&&t.BYTES_PER_ELEMENT===1}function Zf(t){if(typeof t!="boolean")throw new TypeError(`boolean expected, not ${t}`)}function ho(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 St(t,r,o=""){const i=R5(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 a0(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 O5(t,r,o=!1){St(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&&!Is(t))throw new Error("invalid output, must be aligned")}function or(t){return new Uint32Array(t.buffer,t.byteOffset,Math.floor(t.byteLength/4))}function Ir(...t){for(let r=0;r<t.length;r++)t[r].fill(0)}function D5(t){return new DataView(t.buffer,t.byteOffset,t.byteLength)}const ba=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68,wx=t=>t<<24&4278190080|t<<8&16711680|t>>>8&65280|t>>>24&255,kt=ba?t=>t:t=>wx(t)>>>0,M5=t=>{for(let r=0;r<t.length;r++)t[r]=wx(t[r]);return t},Ur=ba?t=>t:M5;function L5(t,r){if(r==null||typeof r!="object")throw new Error("options must be defined");return Object.assign(t,r)}function z5(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 H5(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(St(i,void 0,"key"),t.nonceLength!==void 0){const y=l[0];St(y,t.varSizeNonce?void 0:t.nonceLength,"nonce")}const c=t.tagLength;c&&l[1]!==void 0&&St(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");St(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,St(y),h(f.encrypt.length,v),f.encrypt(y,v)},decrypt(y,v){if(St(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 Qf(t,r,o=!0){if(r===void 0)return new Uint8Array(t);if(St(r,void 0,"output"),r.length!==t)throw new Error('"output" expected Uint8Array of length '+t+", got: "+r.length);if(o&&!Is(r))throw new Error("invalid output, must be aligned");return r}function W5(t,r,o){ho(t),ho(r),Zf(o);const i=new Uint8Array(16),l=D5(i);return l.setBigUint64(0,BigInt(r),o),l.setBigUint64(8,BigInt(t),o),i}function Is(t){return t.byteOffset%4===0}function Zl(t){return Uint8Array.from(St(t))}function xx(t=32){ho(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 kx=t=>Uint8Array.from(t.split(""),r=>r.charCodeAt(0)),U5=Ur(or(kx("expand 16-byte k"))),q5=Ur(or(kx("expand 32-byte k")));function ge(t,r){return t<<r|t>>>32-r}const _s=64,I5=16,Jf=2**32-1,o0=Uint32Array.of();function P5(t,r,o,i,l,c,f,h){const g=l.length,m=new Uint8Array(_s),y=or(m),v=ba&&Is(l)&&Is(c),x=v?or(l):o0,S=v?or(c):o0;if(!ba){for(let T=0;T<g;f++){if(t(r,o,i,y,f,h),Ur(y),f>=Jf)throw new Error("arx: counter overflow");const k=Math.min(_s,g-T);for(let E=0,C;E<k;E++)C=T+E,c[C]=l[C]^m[E];T+=k}return}for(let T=0;T<g;f++){if(t(r,o,i,y,f,h),f>=Jf)throw new Error("arx: counter overflow");const k=Math.min(_s,g-T);if(v&&k===_s){const E=T/4;if(T%4!==0)throw new Error("arx: invalid block position");for(let C=0,_;C<I5;C++)_=E+C,S[_]=x[_]^y[C];T+=_s;continue}for(let E=0,C;E<k;E++)C=T+E,c[C]=l[C]^m[E];T+=k}}function K5(t,r){const{allowShortKeys:o,extendNonceFn:i,counterLength:l,counterRight:c,rounds:f}=L5({allowShortKeys:!1,counterLength:8,counterRight:!1,rounds:20},r);if(typeof t!="function")throw new Error("core must be a function");return ho(l),ho(f),Zf(c),Zf(o),(h,g,m,y,v=0)=>{St(h,void 0,"key"),St(g,void 0,"nonce"),St(m,void 0,"data");const x=m.length;if(y=Qf(x,y,!1),ho(v),v<0||v>=Jf)throw new Error("arx: counter overflow");const S=[];let T=h.length,k,E;if(T===32)S.push(k=Zl(h)),E=q5;else if(T===16&&o)k=new Uint8Array(32),k.set(h),k.set(h,16),E=U5,S.push(k);else throw St(h,32,"arx key"),new Error("invalid key size");(!ba||!Is(g))&&S.push(g=Zl(g));let C=or(k);if(i){if(g.length!==24)throw new Error("arx: extended nonce must be 24 bytes");const A=g.subarray(0,16);if(ba)i(E,C,or(A),C);else{const O=Ur(Uint32Array.from(E));i(O,C,or(A),C),Ir(O),Ur(C)}g=g.subarray(16)}else ba||Ur(C);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=Ur(or(g));try{return P5(t,E,C,j,m,y,v,f),y}finally{Ir(...S)}}}function bt(t,r){return t[r++]&255|(t[r++]&255)<<8}class F5{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=Zl(St(r,32,"key"));const o=bt(r,0),i=bt(r,2),l=bt(r,4),c=bt(r,6),f=bt(r,8),h=bt(r,10),g=bt(r,12),m=bt(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]=bt(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],x=f[5],S=f[6],T=f[7],k=f[8],E=f[9],C=bt(r,o+0),_=bt(r,o+2),j=bt(r,o+4),A=bt(r,o+6),O=bt(r,o+8),D=bt(r,o+10),L=bt(r,o+12),B=bt(r,o+14);let q=c[0]+(C&8191),te=c[1]+((C>>>13|_<<3)&8191),ee=c[2]+((_>>>10|j<<6)&8191),V=c[3]+((j>>>7|A<<9)&8191),J=c[4]+((A>>>4|O<<12)&8191),X=c[5]+(O>>>1&8191),$=c[6]+((O>>>14|D<<2)&8191),M=c[7]+((D>>>11|L<<5)&8191),I=c[8]+((L>>>8|B<<8)&8191),P=c[9]+(B>>>5|l),Z=0,K=Z+q*h+te*(5*E)+ee*(5*k)+V*(5*T)+J*(5*S);Z=K>>>13,K&=8191,K+=X*(5*x)+$*(5*v)+M*(5*y)+I*(5*m)+P*(5*g),Z+=K>>>13,K&=8191;let R=Z+q*g+te*h+ee*(5*E)+V*(5*k)+J*(5*T);Z=R>>>13,R&=8191,R+=X*(5*S)+$*(5*x)+M*(5*v)+I*(5*y)+P*(5*m),Z+=R>>>13,R&=8191;let W=Z+q*m+te*g+ee*h+V*(5*E)+J*(5*k);Z=W>>>13,W&=8191,W+=X*(5*T)+$*(5*S)+M*(5*x)+I*(5*v)+P*(5*y),Z+=W>>>13,W&=8191;let re=Z+q*y+te*m+ee*g+V*h+J*(5*E);Z=re>>>13,re&=8191,re+=X*(5*k)+$*(5*T)+M*(5*S)+I*(5*x)+P*(5*v),Z+=re>>>13,re&=8191;let ae=Z+q*v+te*y+ee*m+V*g+J*h;Z=ae>>>13,ae&=8191,ae+=X*(5*E)+$*(5*k)+M*(5*T)+I*(5*S)+P*(5*x),Z+=ae>>>13,ae&=8191;let fe=Z+q*x+te*v+ee*y+V*m+J*g;Z=fe>>>13,fe&=8191,fe+=X*h+$*(5*E)+M*(5*k)+I*(5*T)+P*(5*S),Z+=fe>>>13,fe&=8191;let me=Z+q*S+te*x+ee*v+V*y+J*m;Z=me>>>13,me&=8191,me+=X*g+$*h+M*(5*E)+I*(5*k)+P*(5*T),Z+=me>>>13,me&=8191;let ce=Z+q*T+te*S+ee*x+V*v+J*y;Z=ce>>>13,ce&=8191,ce+=X*m+$*g+M*h+I*(5*E)+P*(5*k),Z+=ce>>>13,ce&=8191;let le=Z+q*k+te*T+ee*S+V*x+J*v;Z=le>>>13,le&=8191,le+=X*y+$*m+M*g+I*h+P*(5*E),Z+=le>>>13,le&=8191;let ie=Z+q*E+te*k+ee*T+V*S+J*x;Z=ie>>>13,ie&=8191,ie+=X*v+$*y+M*m+I*g+P*h,Z+=ie>>>13,ie&=8191,Z=(Z<<2)+Z|0,Z=Z+K|0,K=Z&8191,Z=Z>>>13,R+=Z,c[0]=K,c[1]=R,c[2]=W,c[3]=re,c[4]=ae,c[5]=fe,c[6]=me,c[7]=ce,c[8]=le,c[9]=ie}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;Ir(i)}update(r){a0(this),St(r),r=Zl(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,Ir(this.h,this.r,this.buffer,this.pad)}digestInto(r){a0(this),O5(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 Y5=H5(32,t=>new F5(t));function V5(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],x=r[2],S=r[3],T=r[4],k=r[5],E=r[6],C=r[7],_=l,j=o[0],A=o[1],O=o[2],D=f,L=h,B=g,q=m,te=y,ee=v,V=x,J=S,X=T,$=k,M=E,I=C,P=_,Z=j,K=A,R=O;for(let re=0;re<c;re+=2)D=D+te|0,P=ge(P^D,16),X=X+P|0,te=ge(te^X,12),D=D+te|0,P=ge(P^D,8),X=X+P|0,te=ge(te^X,7),L=L+ee|0,Z=ge(Z^L,16),$=$+Z|0,ee=ge(ee^$,12),L=L+ee|0,Z=ge(Z^L,8),$=$+Z|0,ee=ge(ee^$,7),B=B+V|0,K=ge(K^B,16),M=M+K|0,V=ge(V^M,12),B=B+V|0,K=ge(K^B,8),M=M+K|0,V=ge(V^M,7),q=q+J|0,R=ge(R^q,16),I=I+R|0,J=ge(J^I,12),q=q+J|0,R=ge(R^q,8),I=I+R|0,J=ge(J^I,7),D=D+ee|0,R=ge(R^D,16),M=M+R|0,ee=ge(ee^M,12),D=D+ee|0,R=ge(R^D,8),M=M+R|0,ee=ge(ee^M,7),L=L+V|0,P=ge(P^L,16),I=I+P|0,V=ge(V^I,12),L=L+V|0,P=ge(P^L,8),I=I+P|0,V=ge(V^I,7),B=B+J|0,Z=ge(Z^B,16),X=X+Z|0,J=ge(J^X,12),B=B+J|0,Z=ge(Z^B,8),X=X+Z|0,J=ge(J^X,7),q=q+te|0,K=ge(K^q,16),$=$+K|0,te=ge(te^$,12),q=q+te|0,K=ge(K^q,8),$=$+K|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+q|0,i[W++]=y+te|0,i[W++]=v+ee|0,i[W++]=x+V|0,i[W++]=S+J|0,i[W++]=T+X|0,i[W++]=k+$|0,i[W++]=E+M|0,i[W++]=C+I|0,i[W++]=_+P|0,i[W++]=j+Z|0,i[W++]=A+K|0,i[W++]=O+R|0}function $5(t,r,o,i){let l=kt(t[0]),c=kt(t[1]),f=kt(t[2]),h=kt(t[3]),g=kt(r[0]),m=kt(r[1]),y=kt(r[2]),v=kt(r[3]),x=kt(r[4]),S=kt(r[5]),T=kt(r[6]),k=kt(r[7]),E=kt(o[0]),C=kt(o[1]),_=kt(o[2]),j=kt(o[3]);for(let O=0;O<20;O+=2)l=l+g|0,E=ge(E^l,16),x=x+E|0,g=ge(g^x,12),l=l+g|0,E=ge(E^l,8),x=x+E|0,g=ge(g^x,7),c=c+m|0,C=ge(C^c,16),S=S+C|0,m=ge(m^S,12),c=c+m|0,C=ge(C^c,8),S=S+C|0,m=ge(m^S,7),f=f+y|0,_=ge(_^f,16),T=T+_|0,y=ge(y^T,12),f=f+y|0,_=ge(_^f,8),T=T+_|0,y=ge(y^T,7),h=h+v|0,j=ge(j^h,16),k=k+j|0,v=ge(v^k,12),h=h+v|0,j=ge(j^h,8),k=k+j|0,v=ge(v^k,7),l=l+m|0,j=ge(j^l,16),T=T+j|0,m=ge(m^T,12),l=l+m|0,j=ge(j^l,8),T=T+j|0,m=ge(m^T,7),c=c+y|0,E=ge(E^c,16),k=k+E|0,y=ge(y^k,12),c=c+y|0,E=ge(E^c,8),k=k+E|0,y=ge(y^k,7),f=f+v|0,C=ge(C^f,16),x=x+C|0,v=ge(v^x,12),f=f+v|0,C=ge(C^f,8),x=x+C|0,v=ge(v^x,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++]=C,i[A++]=_,i[A++]=j,Ur(i)}const G5=K5(V5,{counterRight:!1,counterLength:8,extendNonceFn:$5,allowShortKeys:!1}),X5=new Uint8Array(16),s0=(t,r)=>{t.update(r);const o=r.length%16;o&&t.update(X5.subarray(o))},Z5=new Uint8Array(32);function i0(t,r,o,i,l){l!==void 0&&St(l,void 0,"AAD");const c=t(r,o,Z5),f=W5(i.length,l?l.length:0,!0),h=Y5.create(c);l&&s0(h,l),s0(h,i),h.update(f);const g=h.digest();return Ir(c,f),g}const Q5=t=>(r,o,i)=>({encrypt(c,f){const h=c.length;f=Qf(h+16,f,!1),f.set(c);const g=f.subarray(0,-16);t(r,o,g,g,1);const m=i0(t,r,o,g,i);return f.set(m,h),Ir(m),f},decrypt(c,f){f=Qf(c.length-16,f,!1);const h=c.subarray(0,-16),g=c.subarray(-16),m=i0(t,r,o,h,i);if(!z5(g,m))throw Ir(m),new Error("invalid tag");return f.set(c.subarray(0,-16)),t(r,o,f,f,1),Ir(m),f}}),Sx=B5({blockSize:64,nonceLength:24,tagLength:16},Q5(G5));function J5(t){return t instanceof Uint8Array||ArrayBuffer.isView(t)&&t.constructor.name==="Uint8Array"&&"BYTES_PER_ELEMENT"in t&&t.BYTES_PER_ELEMENT===1}function ko(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 lr(t,r,o=""){const i=J5(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 Bm(t){if(typeof t!="function"||typeof t.create!="function")throw new TypeError("Hash must wrapped by utils.createHasher");if(ko(t.outputLen),ko(t.blockLen),t.outputLen<1)throw new Error('"outputLen" must be >= 1');if(t.blockLen<1)throw new Error('"blockLen" must be >= 1')}function Ql(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 Ex(t,r){lr(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 Ps(...t){for(let r=0;r<t.length;r++)t[r].fill(0)}function Sf(t){return new DataView(t.buffer,t.byteOffset,t.byteLength)}function Rn(t,r){return t<<32-r|t>>>r}const Cx=typeof Uint8Array.from([]).toHex=="function"&&typeof Uint8Array.fromHex=="function",eO=Array.from({length:256},(t,r)=>r.toString(16).padStart(2,"0"));function Wm(t){if(lr(t),Cx)return t.toHex();let r="";for(let o=0;o<t.length;o++)r+=eO[t[o]];return r}const ar={_0:48,_9:57,A:65,F:70,a:97,f:102};function l0(t){if(t>=ar._0&&t<=ar._9)return t-ar._0;if(t>=ar.A&&t<=ar.F)return t-(ar.A-10);if(t>=ar.a&&t<=ar.f)return t-(ar.a-10)}function Um(t){if(typeof t!="string")throw new TypeError("hex string expected, got "+typeof t);if(Cx)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=l0(t.charCodeAt(c)),h=l0(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 tO(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 nO(t=32){ko(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 rO=t=>({oid:Uint8Array.from([6,9,96,134,72,1,101,3,4,2,t])});function aO(t,r,o){return t&r^~t&o}function oO(t,r,o){return t&r^t&o^r&o}class sO{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=Sf(this.buffer)}update(r){Ql(this),lr(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=Sf(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){Ql(this),Ex(r,this),this.finished=!0;const{buffer:o,view:i,blockLen:l,isLE:c}=this;let{pos:f}=this;o[f++]=128,Ps(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=Sf(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 Lr=Uint32Array.from([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),iO=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]),zr=new Uint32Array(64);class lO extends sO{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)zr[v]=r.getUint32(o,!1);for(let v=16;v<64;v++){const x=zr[v-15],S=zr[v-2],T=Rn(x,7)^Rn(x,18)^x>>>3,k=Rn(S,17)^Rn(S,19)^S>>>10;zr[v]=k+zr[v-7]+T+zr[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 x=Rn(h,6)^Rn(h,11)^Rn(h,25),S=y+x+aO(h,g,m)+iO[v]+zr[v]|0,k=(Rn(i,2)^Rn(i,13)^Rn(i,22))+oO(i,l,c)|0;y=m,m=g,g=h,h=f+S|0,f=c,c=l,l=i,i=S+k|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(){Ps(zr)}destroy(){this.destroyed=!0,this.set(0,0,0,0,0,0,0,0),Ps(this.buffer)}}class cO extends lO{A=Lr[0]|0;B=Lr[1]|0;C=Lr[2]|0;D=Lr[3]|0;E=Lr[4]|0;F=Lr[5]|0;G=Lr[6]|0;H=Lr[7]|0;constructor(){super(32)}}const go=tO(()=>new cO,rO(1));const Pr=(t,r,o)=>lr(t,r,o),Tx=ko,Ax=Wm,uO=t=>Um(t),dO=t=>nO(t),Jl=BigInt(0),em=BigInt(1);function _x(t,r=""){if(typeof t!="boolean"){const o=r&&`"${r}" `;throw new TypeError(o+"expected boolean, got type="+typeof t)}return t}function fO(t){if(typeof t=="bigint"){if(!Bl(t))throw new RangeError("positive bigint expected, got "+t)}else Tx(t);return t}function c0(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 Nx(t){if(typeof t!="string")throw new TypeError("hex string expected, got "+typeof t);return t===""?Jl:BigInt("0x"+t)}function mO(t){return Nx(Wm(t))}function Ks(t){return Nx(Wm(Fs(lr(t)).reverse()))}function jx(t,r){if(ko(r),r===0)throw new RangeError("zero length");t=fO(t);const o=t.toString(16);if(o.length>r*2)throw new RangeError("number too large");return Um(o.padStart(r*2,"0"))}function Rx(t,r){return jx(t,r).reverse()}function pO(t,r){if(t=Pr(t),r=Pr(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 Fs(t){return Uint8Array.from(Pr(t))}const Bl=t=>typeof t=="bigint"&&Jl<=t;function hO(t,r,o){return Bl(t)&&Bl(r)&&Bl(o)&&r<=t&&t<o}function ec(t,r,o,i){if(!hO(r,o,i))throw new RangeError("expected valid "+t+": "+o+" <= n < "+i+", got "+r)}function gO(t){if(t<Jl)throw new Error("expected non-negative bigint, got "+t);let r;for(r=0;t>Jl;t>>=em,r+=1);return r}const vO=t=>(em<<BigInt(t))-em;function qm(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 u0=()=>{throw new Error("not implemented")};const Et=BigInt(0),wt=BigInt(1),ga=BigInt(2),Ox=BigInt(3),Dx=BigInt(4),Mx=BigInt(5),yO=BigInt(7),Lx=BigInt(8),bO=BigInt(9),zx=BigInt(16);function rt(t,r){if(r<=Et)throw new Error("mod: expected positive modulus, got "+r);const o=t%r;return o>=Et?o:r+o}function yn(t,r,o){if(r<Et)throw new Error("pow2: expected non-negative exponent, got "+r);let i=t;for(;r-- >Et;)i*=i,i%=o;return i}function d0(t,r){if(t===Et)throw new Error("invert: expected non-zero number");if(r<=Et)throw new Error("invert: expected positive modulus, got "+r);let o=rt(t,r),i=r,l=Et,c=wt;for(;o!==Et;){const h=i/o,g=i-o*h,m=l-c*h;i=o,o=g,l=c,c=m}if(i!==wt)throw new Error("invert: does not exist");return rt(l,r)}function Im(t,r,o){const i=t;if(!i.eql(i.sqr(r),o))throw new Error("Cannot find square root")}function Hx(t,r){const o=t,i=(o.ORDER+wt)/Dx,l=o.pow(r,i);return Im(o,l,r),l}function wO(t,r){const o=t,i=(o.ORDER-Mx)/Lx,l=o.mul(r,ga),c=o.pow(l,i),f=o.mul(r,c),h=o.mul(o.mul(f,ga),c),g=o.mul(f,o.sub(h,o.ONE));return Im(o,g,r),g}function xO(t){const r=Pm(t),o=Bx(t),i=o(r,r.neg(r.ONE)),l=o(r,i),c=o(r,r.neg(i)),f=(t+yO)/zx;return((h,g)=>{const m=h;let y=m.pow(g,f),v=m.mul(y,i);const x=m.mul(y,l),S=m.mul(y,c),T=m.eql(m.sqr(v),g),k=m.eql(m.sqr(x),g);y=m.cmov(y,v,T),v=m.cmov(S,x,k);const E=m.eql(m.sqr(v),g),C=m.cmov(y,v,E);return Im(m,C,g),C})}function Bx(t){if(t<Ox)throw new Error("sqrt is not defined for small field");let r=t-wt,o=0;for(;r%ga===Et;)r/=ga,o++;let i=ga;const l=Pm(t);for(;f0(l,i)===1;)if(i++>1e3)throw new Error("Cannot find square root: probably non-prime P");if(o===1)return Hx;let c=l.pow(i,r);const f=(r+wt)/ga;return function(g,m){const y=g;if(y.is0(m))return m;if(f0(y,m)!==1)throw new Error("Cannot find square root");let v=o,x=y.mul(y.ONE,c),S=y.pow(m,r),T=y.pow(m,f);for(;!y.eql(S,y.ONE);){if(y.is0(S))return y.ZERO;let k=1,E=y.sqr(S);for(;!y.eql(E,y.ONE);)if(k++,E=y.sqr(E),k===v)throw new Error("Cannot find square root");const C=wt<<BigInt(v-k-1),_=y.pow(x,C);v=k,x=y.sqr(_),S=y.mul(S,x),T=y.mul(T,_)}return T}}function kO(t){return t%Dx===Ox?Hx:t%Lx===Mx?wO:t%zx===bO?xO(t):Bx(t)}const pa=(t,r)=>(rt(t,r)&wt)===wt,SO=["create","isValid","is0","neg","inv","sqrt","sqr","eql","add","sub","mul","pow","div","addN","subN","mulN","sqrN"];function EO(t){const r={ORDER:"bigint",BYTES:"number",BITS:"number"},o=SO.reduce((i,l)=>(i[l]="function",i),r);if(qm(t,o),c0(t.BYTES,"BYTES"),c0(t.BITS,"BITS"),t.BYTES<1||t.BITS<1)throw new Error("invalid field: expected BYTES/BITS > 0");if(t.ORDER<=wt)throw new Error("invalid field: expected ORDER > 1, got "+t.ORDER);return t}function CO(t,r,o){const i=t;if(o<Et)throw new Error("invalid exponent, negatives unsupported");if(o===Et)return i.ONE;if(o===wt)return r;let l=i.ONE,c=r;for(;o>Et;)o&wt&&(l=i.mul(l,c)),c=i.sqr(c),o>>=wt;return l}function Wx(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 f0(t,r){const o=t,i=(o.ORDER-wt)/ga,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 TO(t,r){if(r!==void 0&&Tx(r),t<=Et)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=gO(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 m0=new WeakMap;class Ux{ORDER;BITS;BYTES;isLE;ZERO=Et;ONE=wt;_lengths;_mod;constructor(r,o={}){if(r<=wt)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}=TO(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 Et<=r&&r<this.ORDER}is0(r){return r===Et}isValidNot0(r){return!this.is0(r)&&this.isValid(r)}isOdd(r){return(r&wt)===wt}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 CO(this,r,o)}div(r,o){return rt(r*d0(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 d0(r,this.ORDER)}sqrt(r){let o=m0.get(this);return o||m0.set(this,o=kO(this.ORDER)),o(this,r)}toBytes(r){return this.isLE?Rx(r,this.BYTES):jx(r,this.BYTES)}fromBytes(r,o=!1){Pr(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?Ks(r):mO(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 Wx(this,r)}cmov(r,o,i){return _x(i,"condition"),i?o:r}}Object.freeze(Ux.prototype);function Pm(t,r={}){return new Ux(t,r)}const tc=BigInt(0),tm=BigInt(1);function p0(t,r){const o=r.negate();return t?o:r}function Ef(t,r){const o=Wx(t.Fp,r.map(i=>i.Z));return r.map((i,l)=>t.fromAffine(i.toAffine(o[l])))}function qx(t,r){if(!Number.isSafeInteger(t)||t<=0||t>r)throw new Error("invalid window size, expected [1.."+r+"], got W="+t)}function Cf(t,r){qx(t,r);const o=Math.ceil(r/t)+1,i=2**(t-1),l=2**t,c=vO(t),f=BigInt(t);return{windows:o,windowSize:i,mask:c,maxNumber:l,shiftBy:f}}function h0(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+=tm);const m=r*i,y=m+Math.abs(h)-1,v=h===0,x=h<0,S=r%2!==0;return{nextN:g,offset:y,isZero:v,isNeg:x,isNegF:S,offsetF:m}}const Tf=new WeakMap,Ix=new WeakMap;function Af(t){return Ix.get(t)||1}function g0(t){if(t!==tc)throw new Error("invalid wNAF")}class AO{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>tc;)o&tm&&(i=i.add(l)),l=l.double(),o>>=tm;return i}precomputeWindow(r,o){const{windows:i,windowSize:l}=Cf(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=Cf(r,this.bits);for(let h=0;h<f.windows;h++){const{nextN:g,offset:m,isZero:y,isNeg:v,isNegF:x,offsetF:S}=h0(i,h,f);i=g,y?c=c.add(p0(x,o[S])):l=l.add(p0(v,o[m]))}return g0(i),{p:l,f:c}}wNAFUnsafe(r,o,i,l=this.ZERO){const c=Cf(r,this.bits);for(let f=0;f<c.windows&&i!==tc;f++){const{nextN:h,offset:g,isZero:m,isNeg:y}=h0(i,f,c);if(i=h,!m){const v=o[g];l=l.add(y?v.negate():v)}}return g0(i),l}getPrecomputes(r,o,i){let l=Tf.get(o);return l||(l=this.precomputeWindow(o,r),r!==1&&(typeof i=="function"&&(l=i(l)),Tf.set(o,l))),l}cached(r,o,i){const l=Af(r);return this.wNAF(l,this.getPrecomputes(l,r,i),o)}unsafe(r,o,i,l){const c=Af(r);return c===1?this._unsafeLadder(r,o,l):this.wNAFUnsafe(c,this.getPrecomputes(c,r,i),o,l)}createCache(r,o){qx(o,this.bits),Ix.set(r,o),Tf.delete(r)}hasCache(r){return Af(r)!==1}}function v0(t,r,o){if(r){if(r.ORDER!==t)throw new Error("Field.ORDER must match order: Fp == p, Fn == n");return EO(r),r}else return Pm(t,{isLE:o})}function _O(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>tc))throw new Error(`CURVE.${g} must be positive bigint`)}const l=v0(r.p,o.Fp,i),c=v0(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 NO(t,r){return function(i){const l=t(i);return{secretKey:l,publicKey:r(l)}}}const Hr=BigInt(0),Lt=BigInt(1),_f=BigInt(2),jO=BigInt(8);function RO(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 OO(t,r={}){const o=r,i=_O("edwards",t,o,o.FpFnLE),{Fp:l,Fn:c}=i;let f=i.CURVE;const{h}=f;qm(o,{},{uvRatio:"function"});const g=_f<<BigInt(c.BYTES*8)-Lt,m=k=>l.create(k),y=o.uvRatio===void 0?(k,E)=>{try{return{isValid:!0,value:l.sqrt(l.div(k,E))}}catch{return{isValid:!1,value:Hr}}}:o.uvRatio;if(!RO(l,f,f.Gx,f.Gy))throw new Error("bad curve params: generator point");function v(k,E,C=!1){const _=C?Lt:Hr;return ec("coordinate "+k,E,_,g),E}function x(k){if(!(k instanceof S))throw new Error("EdwardsPoint expected")}class S{static BASE=new S(f.Gx,f.Gy,Lt,m(f.Gx*f.Gy));static ZERO=new S(Hr,Lt,Lt,Hr);static Fp=l;static Fn=c;X;Y;Z;T;constructor(E,C,_,j){this.X=v("x",E),this.Y=v("y",C),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:C,y:_}=E||{};return v("x",C),v("y",_),new S(C,_,Lt,m(C*_))}static fromBytes(E,C=!1){const _=l.BYTES,{a:j,d:A}=f;E=Fs(Pr(E,_,"point")),_x(C,"zip215");const O=Fs(E),D=E[_-1];O[_-1]=D&-129;const L=Ks(O),B=C?g:l.ORDER;ec("point.y",L,Hr,B);const q=m(L*L),te=m(q-Lt),ee=m(A*q-j);let{isValid:V,value:J}=y(te,ee);if(!V)throw new Error("bad point: invalid y coordinate");const X=(J&Lt)===Lt,$=(D&128)!==0;if(!C&&J===Hr&&$)throw new Error("bad point: x=0 and x_0=1");return $!==X&&(J=m(-J)),S.fromAffine({x:J,y:L})}static fromHex(E,C=!1){return S.fromBytes(uO(E),C)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}precompute(E=8,C=!0){return T.createCache(this,E),C||this.multiply(_f),this}assertValidity(){const E=this,{a:C,d:_}=f;if(E.is0())throw new Error("bad point: ZERO");const{X:j,Y:A,Z:O,T:D}=E,L=m(j*j),B=m(A*A),q=m(O*O),te=m(q*q),ee=m(L*C),V=m(q*m(ee+B)),J=m(te+m(_*m(L*B)));if(V!==J)throw new Error("bad point: equation left != right (1)");const X=m(j*A),$=m(O*D);if(X!==$)throw new Error("bad point: equation left != right (2)")}equals(E){x(E);const{X:C,Y:_,Z:j}=this,{X:A,Y:O,Z:D}=E,L=m(C*D),B=m(A*j),q=m(_*D),te=m(O*j);return L===B&&q===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:C,Y:_,Z:j}=this,A=m(C*C),O=m(_*_),D=m(_f*m(j*j)),L=m(E*A),B=C+_,q=m(m(B*B)-A-O),te=L+O,ee=te-D,V=L-O,J=m(q*ee),X=m(te*V),$=m(q*V),M=m(ee*te);return new S(J,X,M,$)}add(E){x(E);const{a:C,d:_}=f,{X:j,Y:A,Z:O,T:D}=this,{X:L,Y:B,Z:q,T:te}=E,ee=m(j*L),V=m(A*B),J=m(D*_*te),X=m(O*q),$=m((j+A)*(L+B)-ee-V),M=X-J,I=X+J,P=m(V-C*ee),Z=m($*M),K=m(I*P),R=m($*P),W=m(M*I);return new S(Z,K,W,R)}subtract(E){return x(E),this.add(E.negate())}multiply(E){if(!c.isValidNot0(E))throw new RangeError("invalid scalar: expected 1 <= sc < curve.n");const{p:C,f:_}=T.cached(this,E,j=>Ef(S,j));return Ef(S,[C,_])[0]}multiplyUnsafe(E){if(!c.isValid(E))throw new RangeError("invalid scalar: expected 0 <= sc < curve.n");return E===Hr?S.ZERO:this.is0()||E===Lt?this:T.unsafe(this,E,C=>Ef(S,C))}isSmallOrder(){return this.clearCofactor().is0()}isTorsionFree(){return T.unsafe(this,f.n).is0()}toAffine(E){const C=this;let _=E;const{X:j,Y:A,Z:O}=C,D=C.is0();_==null&&(_=D?jO:l.inv(O));const L=m(j*_),B=m(A*_),q=l.mul(O,_);if(D)return{x:Hr,y:Lt};if(q!==Lt)throw new Error("invZ was invalid");return{x:L,y:B}}clearCofactor(){return h===Lt?this:this.multiplyUnsafe(h)}toBytes(){const{x:E,y:C}=this.toAffine(),_=l.toBytes(C);return _[_.length-1]|=E&Lt?128:0,_}toHex(){return Ax(this.toBytes())}toString(){return`<Point ${this.is0()?"ZERO":this.toHex()}>`}}const T=new AO(S,c.BITS);return c.BITS>=8&&S.BASE.precompute(8),Object.freeze(S.prototype),Object.freeze(S),S}class DO{static BASE;static ZERO;static Fp;static Fn;ep;constructor(r){this.ep=r}static fromBytes(r){u0()}static fromHex(r){u0()}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 Ax(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 Ns=BigInt(0),uo=BigInt(1),_l=BigInt(2);function MO(t){return qm(t,{P:"bigint",type:"string",adjustScalarBytes:"function",powPminus2:"function"},{randomBytes:"function"}),Object.freeze({...t})}function LO(t){const r=MO(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?dO:f,m=h?255:448,y=h?32:56,v=BigInt(h?9:5),x=BigInt(h?121665:39081),S=h?_l**BigInt(254):_l**BigInt(447),T=h?BigInt(8)*_l**BigInt(251)-uo:BigInt(4)*_l**BigInt(445)-uo,k=S+T+uo,E=X=>rt(X,o),C=_(v);function _(X){return Rx(E(X),y)}function j(X){const $=Fs(Pr(X,y,"uCoordinate"));return h&&($[31]&=127),E(Ks($))}function A(X){return Ks(l(Fs(Pr(X,y,"scalar"))))}function O(X,$){const M=te(j($),A(X));if(M===Ns)throw new Error("invalid private or public key received");return _(M)}function D(X){return O(X,C)}const L=D,B=O;function q(X,$,M){const I=E(X*($-M));return $=E($-I),M=E(M+I),{x_2:$,x_3:M}}function te(X,$){ec("u",X,Ns,o),ec("scalar",$,S,k);const M=$,I=X;let P=uo,Z=Ns,K=X,R=uo,W=Ns;for(let ae=BigInt(m-1);ae>=Ns;ae--){const fe=M>>ae&uo;W^=fe,{x_2:P,x_3:K}=q(W,P,K),{x_2:Z,x_3:R}=q(W,Z,R),W=fe;const me=P+Z,ce=E(me*me),le=P-Z,ie=E(le*le),ue=ce-ie,pe=K+R,Ae=K-R,Ce=E(Ae*me),Se=E(pe*le),Qe=Ce+Se,ft=Ce-Se;K=E(Qe*Qe),R=E(I*E(ft*ft)),P=E(ce*ie),Z=E(ue*(ce+E(x*ue)))}({x_2:P,x_3:K}=q(W,P,K)),{x_2:Z,x_3:R}=q(W,Z,R);const re=c(Z);return E(P*re)}const ee={secretKey:y,publicKey:y,seed:y},V=X=>(X=X===void 0?g(y):X,Pr(X,ee.seed,"seed"),X),J={randomSecretKey:V};return Object.freeze(ee),Object.freeze(J),Object.freeze({keygen:NO(V,L),getSharedSecret:B,getPublicKey:L,scalarMult:O,scalarMultBase:D,utils:J,GuBytes:C.slice(),lengths:ee})}const zO=BigInt(0),Bs=BigInt(1),y0=BigInt(2),HO=BigInt(3),BO=BigInt(5),WO=BigInt(8),So=BigInt("0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffed"),Px={p:So,n:BigInt("0x1000000000000000000000000000000014def9dea2f79cd65812631a5cf5d3ed"),h:WO,a:BigInt("0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffec"),d:BigInt("0x52036cee2b6ffe738cc740797779e89800700a4d4141d8ab75eb4dca135978a3"),Gx:BigInt("0x216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a"),Gy:BigInt("0x6666666666666666666666666666666666666666666666666666666666666658")};function Kx(t){const r=BigInt(10),o=BigInt(20),i=BigInt(40),l=BigInt(80),c=So,h=t*t%c*t%c,g=yn(h,y0,c)*h%c,m=yn(g,Bs,c)*t%c,y=yn(m,BO,c)*m%c,v=yn(y,r,c)*y%c,x=yn(v,o,c)*v%c,S=yn(x,i,c)*x%c,T=yn(S,l,c)*S%c,k=yn(T,l,c)*S%c,E=yn(k,r,c)*y%c;return{pow_p_5_8:yn(E,y0,c)*t%c,b2:h}}function UO(t){return t[0]&=248,t[31]&=127,t[31]|=64,t}const nm=BigInt("19681161376707505956807079304988542015446066515923890162744021073123829784752");function Fx(t,r){const o=So,i=rt(r*r*r,o),l=rt(i*i*r,o),c=Kx(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*nm,o),y=h===t,v=h===rt(-t,o),x=h===rt(-t*nm,o);return y&&(f=g),(v||x)&&(f=m),pa(f,o)&&(f=rt(-f,o)),{isValid:y||v,value:f}}const fo=OO(Px,{uvRatio:Fx}),ha=fo.Fp,qO=fo.Fn,rm=(()=>{const t=So;return LO({P:t,type:"x25519",powPminus2:r=>{const{pow_p_5_8:o,b2:i}=Kx(r);return rt(yn(o,HO,t)*i,t)},adjustScalarBytes:UO})})(),b0=nm,IO=BigInt("54469307008909316920995813868745141605393597292927456921205312896311721017578"),w0=t=>Fx(Bs,t),PO=BigInt("0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"),KO=t=>ha.create(Ks(t)&PO);class Gt extends DO{static BASE=new Gt(fo.BASE);static ZERO=new Gt(fo.ZERO);static Fp=ha;static Fn=qO;constructor(r){super(r)}static fromAffine(r){return new Gt(fo.fromAffine(r))}assertSame(r){if(!(r instanceof Gt))throw new Error("RistrettoPoint expected")}init(r){return new Gt(r)}static fromBytes(r){lr(r,32);const{a:o,d:i}=Px,l=So,c=A=>ha.create(A),f=KO(r);if(!pO(ha.toBytes(f),r)||pa(f,l))throw new Error("invalid ristretto255 encoding 1");const h=c(f*f),g=c(Bs+o*h),m=c(Bs-o*h),y=c(g*g),v=c(m*m),x=c(o*i*y-v),{isValid:S,value:T}=w0(c(x*v)),k=c(T*m),E=c(T*k*x);let C=c((f+f)*k);pa(C,l)&&(C=c(-C));const _=c(g*E),j=c(C*_);if(!S||pa(j,l)||_===zO)throw new Error("invalid ristretto255 encoding 2");return new Gt(new fo(C,_,Bs,j))}static fromHex(r){return Gt.fromBytes(Um(r))}toBytes(){let{X:r,Y:o,Z:i,T:l}=this.ep;const c=So,f=E=>ha.create(E),h=f(f(i+o)*f(i-o)),g=f(r*o),m=f(g*g),{value:y}=w0(f(h*m)),v=f(y*h),x=f(y*g),S=f(v*x*l);let T;if(pa(l*S,c)){let E=f(o*b0),C=f(r*b0);r=E,o=C,T=f(v*IO)}else T=x;pa(r*S,c)&&(o=f(-o));let k=f((i-o)*T);return pa(k,c)&&(k=f(-k)),ha.toBytes(k)}equals(r){this.assertSame(r);const{X:o,Y:i}=this.ep,{X:l,Y:c}=r.ep,f=m=>ha.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 x0{oHash;iHash;blockLen;outputLen;canXOF=!1;finished=!1;destroyed=!1;constructor(r,o){if(Bm(r),lr(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),Ps(l)}update(r){return Ql(this),this.iHash.update(r),this}digestInto(r){Ql(this),Ex(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 Yx=(()=>{const t=((r,o,i)=>new x0(r,o).update(i).digest());return t.create=(r,o)=>new x0(r,o),t})();function FO(t,r,o){return Bm(t),o===void 0&&(o=new Uint8Array(t.outputLen)),Yx(t,o,r)}const Nf=Uint8Array.of(0),k0=Uint8Array.of();function YO(t,r,o,i=32){Bm(t),ko(i,"length"),lr(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=k0:lr(o,void 0,"info");const f=new Uint8Array(c*l),h=Yx.create(t,r),g=h._cloneInto(),m=new Uint8Array(h.outputLen);for(let y=0;y<c;y++)Nf[0]=y+1,g.update(y===0?k0:m).update(o).update(Nf).digestInto(m),f.set(m,l*y),h._cloneInto(g);return h.destroy(),g.destroy(),Ps(m,Nf),f.slice(0,i)}const Ys=(t,r,o,i,l)=>YO(t,FO(t,r,o),i,l),wn=2,S0=32,VO=32,qr=32,$O=24,am=32,Vx=32,GO=6,om=32,$x="hive/remote/v1/pair",XO="hive/remote/v1/key/daemon->device",ZO="hive/remote/v1/key/device->daemon",QO="hive/remote/v1/sas",JO="hive/remote/v1/transcript",e6="hive/remote/v2/conn/daemon->device",t6="hive/remote/v2/conn/device->daemon",n6="hive/remote/v2/conn-salt",r6=1,a6=2,o6=4,s6=8,Gx=12,i6=new TextEncoder;function Zt(t){return i6.encode(t)}function Mn(...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 Sc(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 Km(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 l6(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 nc(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 mn(t,r,o){if(t.length!==r)throw new RangeError(`${o} must be ${r} bytes, got ${t.length}`)}const bn="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",c6=(()=>{const t=new Int16Array(128).fill(-1);for(let r=0;r<bn.length;r++)t[bn.charCodeAt(r)]=r;return t})();function va(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+=bn[l>>2],r+=bn[(l&3)<<4|c>>4],r+=bn[(c&15)<<2|f>>6],r+=bn[f&63]}const i=t.length-o;if(i===1){const l=t[o];r+=bn[l>>2],r+=bn[(l&3)<<4]}else if(i===2){const l=t[o],c=t[o+1];r+=bn[l>>2],r+=bn[(l&3)<<4|c>>4],r+=bn[(c&15)<<2]}return r}function Vs(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=c6[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 u6(t){return JSON.stringify(t)}function d6(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!==wn)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(Vs(o.pairingSecret).length!==am)throw new RangeError(`pairingSecret must be ${am} bytes`);return{v:o.v,gatewayUrl:o.gatewayUrl,daemonId:o.daemonId,pairingSecret:o.pairingSecret}}function f6(){const t=rm.utils.randomSecretKey(),r=rm.getPublicKey(t);return{secretKey:t,publicKey:r}}function m6(t){return{secretKey:va(t.secretKey),publicKey:va(t.publicKey)}}function p6(){return xx(Vx)}function h6(t){mn(t.pairingSecret,am,"pairingSecret"),mn(t.sessionSalt,Vx,"sessionSalt"),mn(t.daemonPublicKey,S0,"daemonPublicKey"),mn(t.devicePublicKey,S0,"devicePublicKey");const r=rm.getSharedSecret(t.localSecretKey,t.peerPublicKey);mn(r,VO,"sharedSecret");const o=Mn(t.pairingSecret,r),i=Mn(Zt(JO),Uint8Array.of(0),Sc(t.ids.protocolVersion),nc(Zt(t.ids.daemonId)),nc(Zt(t.ids.deviceId)),t.daemonPublicKey,t.devicePublicKey,t.sessionSalt),l=go(i),c=Mn(Zt($x),t.sessionSalt),f=Ys(go,o,c,Mn(Zt(XO),Uint8Array.of(0),l),qr),h=Ys(go,o,c,Mn(Zt(ZO),Uint8Array.of(0),l),qr),g=b6(l,t.ids);return{d2p:f,p2d:h,sas:g,transcriptHash:l}}function g6(t){return h6({localSecretKey:t.deviceSecretKey,peerPublicKey:t.daemonPublicKey,daemonPublicKey:t.daemonPublicKey,devicePublicKey:t.devicePublicKey,pairingSecret:t.pairingSecret,sessionSalt:t.sessionSalt,ids:t.ids})}function v6(){return xx(om)}function y6(t){mn(t.rootD2p,qr,"rootD2p"),mn(t.rootP2d,qr,"rootP2d"),mn(t.phoneConnSalt,om,"phoneConnSalt"),mn(t.daemonConnSalt,om,"daemonConnSalt");const r=Mn(Zt(n6),t.phoneConnSalt,t.daemonConnSalt),o=Mn(Uint8Array.of(0),Sc(t.ids.protocolVersion),nc(Zt(t.ids.daemonId)),nc(Zt(t.ids.deviceId)),t.phoneConnSalt,t.daemonConnSalt),i=Ys(go,t.rootD2p,r,Mn(Zt(e6),o),qr),l=Ys(go,t.rootP2d,r,Mn(Zt(t6),o),qr);return{d2p:i,p2d:l}}function b6(t,r){mn(t,32,"transcriptHash");const o=Ys(go,t,Zt($x),Mn(Zt(QO),Uint8Array.of(0),Sc(r.protocolVersion)),4);return(Km(o)%1e6).toString().padStart(GO,"0")}function Xx(t,r,o){if(!Number.isInteger(r)||r<0||r>4294967295)throw new RangeError(`streamId out of range: ${r}`);const i=new Uint8Array($O);return i[0]=t==="d2p"?r6:a6,i.set(Sc(r),1),i.set(l6(o),8),i}function Zx(t){if(t.length<Gx)throw new RangeError("headerBytes too short");return Km(t,o6)}function Ec(t){if(t.length<Gx)throw new RangeError("headerBytes too short");return Km(t,s6)}function w6(t){mn(t.key,qr,"key");const r=Zx(t.headerBytes),o=Ec(t.headerBytes),i=Xx(t.direction,r,o);return Sx(t.key,i,t.headerBytes).encrypt(t.payload)}function x6(t){mn(t.key,qr,"key");const r=Zx(t.headerBytes),o=Ec(t.headerBytes),i=Xx(t.direction,r,o);return Sx(t.key,i,t.headerBytes).decrypt(t.ciphertext)}function k6(t){return{direction:t,nextSeq:0}}function S6(t){return{direction:t,lastSeq:-1}}function E6(t,r){const o=Ec(r.headerBytes);if(o!==t.nextSeq)throw new RangeError(`header seq ${o} does not match sealer.nextSeq ${t.nextSeq}`);const i=w6({key:r.key,direction:t.direction,headerBytes:r.headerBytes,payload:r.payload}),l=t.nextSeq;return t.nextSeq+=1,{seq:l,ciphertext:i}}function C6(t,r){if(r.seq!==t.lastSeq+1)throw new RangeError("out-of-order or replayed frame");if(Ec(r.headerBytes)!==r.seq)throw new RangeError("out-of-order or replayed frame");const i=x6({key:r.key,direction:t.direction,headerBytes:r.headerBytes,ciphertext:r.ciphertext});return t.lastSeq=r.seq,i}const T6=(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)}`},A6=t=>typeof t=="object"&&t!==null&&typeof t.t=="string",_6=2e4,N6=1e4;function j6(t,r,o){const i=o.generateKeyPair??f6,l=o.generateSalt??p6,c=o.heartbeatMs??_6,f=o.heartbeatDeadlineMs??N6;let h="idle",g=null,m=null,y=null,v=!1,x=null,S=null,T=null,k=null,E=null,C=null,_="",j="",A=null;const O=K=>{h=K,r.onPhase(K)},D=()=>{S!==null&&(clearTimeout(S),S=null)},L=()=>{x!==null&&(clearInterval(x),x=null),D()},B=K=>{L(),x=setInterval(()=>{if(!v){try{K.send(yx)}catch{}S===null&&(S=setTimeout(()=>{if(S=null,!v){try{K.close()}catch{}$()}},f))}},c)},q=()=>{T?.secretKey.fill(0),k?.fill(0),E&&(E.d2p.fill(0),E.p2d.fill(0),E.transcriptHash.fill(0)),T=null,k=null,E=null},te=K=>{if(!v){v=!0,L(),q();try{y?.close()}catch{}y=null,A?.(K)}},ee=(K,R)=>{if(v)return;const W={code:K,message:R};O(K==="rejected"?"rejected":K==="expired"?"expired":"error"),r.onFailure(W),te({ok:!1,failure:W})},V=K=>{if(h!=="connecting"&&h!=="handshaking")return;if(K.protocolVersion!==wn){ee("protocol_version",`unsupported pairing protocol version ${K.protocolVersion}`);return}if(!T||!k){ee("pair_ack_invalid","pair-ack arrived before the phone keypair was ready");return}let R;try{R=Vs(K.daemonPublicKey)}catch{ee("pair_ack_invalid","pair-ack daemonPublicKey is not valid base64url");return}const W={daemonId:K.daemonId,deviceId:K.deviceId,protocolVersion:K.protocolVersion};try{E=g6({deviceSecretKey:T.secretKey,daemonPublicKey:R,devicePublicKey:T.publicKey,pairingSecret:P,sessionSalt:k,ids:W})}catch(re){ee("pair_ack_invalid",`handshake derivation failed: ${re.message}`);return}m=K.deviceId,j=K.daemonId,C=K.daemonPublicKey,g=E.sas,O("awaiting_confirm"),r.onSas(g)},J=()=>{if(!v){if(!E||!T||!m){ee("pair_ack_invalid","cannot mint before the handshake produced a session");return}O("minting"),o.mintSession(_,{daemonId:j,deviceId:m}).then(()=>{if(v||!T||!C||!m||!E)return;const K={v:2,gatewayUrl:_,daemonId:j,deviceId:m,deviceKeyPair:m6(T),daemonPublicKey:C,rootKeys:{d2p:va(E.d2p),p2d:va(E.p2d)},protocolVersion:wn,pairedAt:(o.now??Date.now)()};o.store.save(K);const R=m;O("paired"),te({ok:!0,deviceId:R})}).catch(K=>{K.status===403?ee("mint_forbidden","gateway refused to mint a device session (not confirmed)"):ee("mint_failed",`device session mint failed: ${K.message??"unknown"}`)})}},X=K=>{if(h==="awaiting_confirm"){if(!E||!T||!m||K.deviceId!==m){ee("pair_ack_invalid","confirmed for an unexpected device");return}J()}},$=()=>{if(!v){if(h==="awaiting_confirm"){J();return}h!=="minting"&&ee("socket_closed","pairing socket closed before the device was paired")}},M=K=>{if(v||typeof K!="string")return;if(K===bx){D();return}let R;try{R=JSON.parse(K)}catch{return}if(A6(R))switch(h==="connecting"&&R.t==="pair-ack"&&O("handshaking"),R.t){case"pair-ack":V(R);break;case"confirmed":X(R);break;case"rejected":{const W=R.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}},I=d6(t),P=Vs(I.pairingSecret);return _=I.gatewayUrl,j=I.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(K=>{A=K,T=i(),k=l(),O("connecting");const R=T6(I.gatewayUrl,I.daemonId);try{y=o.openSocket(R)}catch(W){ee("socket_closed",`failed to open pairing socket: ${W.message}`);return}y.addEventListener("open",()=>{if(v||!y||!T||!k)return;B(y);const W={t:"hello",devicePublicKey:va(T.publicKey),sessionSalt:va(k),...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||(O("rejected"),ee("cancelled","pairing cancelled"))},dispose:()=>{v?q():te({ok:!1,failure:{code:"cancelled",message:"disposed"}})}}}const R6=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 O6(t){const r=t.fetchImpl??globalThis.fetch.bind(globalThis),o=t.gatewayBaseUrl??window.location.origin,i=t.redirect??(T=>window.location.assign(T)),l=t.createPairing??j6,c=t.mintSession??R6(r);let f=t.authProvider??"github",h="login",g=null;const m=T=>{h=T,t.onPhase?.(T)},y=T=>t.store.load(o,T),v=async T=>{T&&(f=T);const k=await r(`${o}/pair/machines`,{credentials:"include"});if(k.status===401){const _=encodeURIComponent(window.location.pathname+window.location.search);return m("login"),i(`${o}/auth/${f}?redirect=${_}`),{daemons:[],selfDeviceId:null}}if(!k.ok)throw new Error(`Failed to load machines: ${k.status}`);const E=await k.json(),C=E.daemons.map(_=>({id:_.id,name:_.name,lastSeen:_.lastSeen,revoked:_.revoked,online:_.online}));return m("machines"),{daemons:C,selfDeviceId:E.self.deviceId}},x=T=>{m("pairing");const E=l(T,{onPhase:C=>t.onPairingPhase?.(C),onSas:C=>t.onPairingSas?.(C),onFailure:C=>t.onPairingFailure?.(C)},{openSocket:(C,_)=>new WebSocket(C,_),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(T,k)=>{g=null;const E=y(T);if(E&&!k){const A=await t.connectTransport({daemonId:T,deviceId:E.deviceId,stored:E});return A.ok?(m("connected"),A):(!A.ok&&A.failure.code==="relay_revoked"&&t.store.clear(o,T),m("selecting"),A)}if(m("selecting"),!k)return{ok:!1,failure:{code:"needs_pairing",message:"this device is not paired with that computer — enter its pairing code first"}};const C=await x(k);if(!C.ok)return C;const _=y(T),j=await t.connectTransport({daemonId:T,deviceId:C.deviceId,stored:_});return j.ok?(m("connected"),j):(j.failure.code==="relay_revoked"&&t.store.clear(o,T),m("selecting"),j)}}}const Qx="0123456789ABCDEFGHJKMNPQRSTVWXYZ",D6=12,M6="hive-remote-pairing-code-v1:",L6=t=>{const r=t.trim().toUpperCase().replace(/[\s-]+/g,"").replace(/O/g,"0").replace(/[IL]/g,"1");if(r.length!==D6)return null;for(const o of r)if(!Qx.includes(o))return null;return r},z6=new TextEncoder,H6=t=>new URL(t).origin,B6=async t=>{const r=L6(t.code);if(!r)return null;const o=await crypto.subtle.digest("SHA-256",z6.encode(`${M6}${r}`));return u6({v:wn,gatewayUrl:H6(t.gatewayUrl),daemonId:t.daemonId,pairingSecret:va(new Uint8Array(o))})},W6="hive.device-session.v2",U6="hive.device-session.v1",jf=(t,r)=>`${W6}:${t}:${r}`,E0=(t,r)=>`${U6}:${t}:${r}`,q6=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"},I6=(t=globalThis.localStorage??null)=>({load:(r,o)=>{if(!t)return null;t.getItem(E0(r,o))!==null&&t.removeItem(E0(r,o));const i=t.getItem(jf(r,o));if(i===null)return null;try{const l=JSON.parse(i);return q6(l)?l:null}catch{return null}},save:r=>{t&&t.setItem(jf(r.gatewayUrl,r.daemonId),JSON.stringify(r))},clear:(r,o)=>{t&&t.removeItem(jf(r,o))}}),Jx=()=>{const t=window.location.hostname;return!(t==="127.0.0.1"||t==="localhost"||t==="[::1]"||t==="::1")},e1=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}},P6=(t,r)=>{const o=e1(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}},K6=t=>t==="select_failed"?"connect.error.selectFailed":t==="invalid_code"?"connect.error.invalidCode":t==="relay_revoked"?"connect.machines.revokedHint":null,F6=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`},Y6={O:"0",I:"1",L:"1"},V6=t=>{const r=t.toUpperCase();let o="";for(const l of r){const c=Y6[l]??l;if(Qx.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("-")},$6=t=>t==="minting"||t==="paired",Nl=({children:t,className:r="",testId:o})=>u.jsx("div",{"data-testid":o,className:`connect-screen flex min-h-full flex-col p-6 ${r}`,children:t}),js=({primary:t,children:r,disabled:o,onClick:i,testId:l,type:c="button"})=>u.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}),G6=({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:x,onSelectProvider:S,onSelectMachine:T,onSubmitCode:k,onCancelPairing:E,onGoBack:C})=>{const{t:_}=ke(),[j,A]=b.useState(""),O=b.useRef(!1),D=P6(l,c),L=K6(f),B=e1(c)!=null,q=$6(l),te=h!=null&&h.length>0&&(l==="awaiting_confirm"||q),ee=$=>{const M=V6($);A(M),M.replace(/-/g,"").length===12&&i&&!O.current&&(O.current=!0,k(i,M.trim()))},V=j.replace(/-/g,"").length===12,J=!!i&&V,X=v?"/brand/icon-192.png":"/logo.png";if(r==="login")return u.jsxs(Nl,{testId:"connect-login",className:"justify-center gap-6",children:[u.jsxs("div",{className:"mb-2 flex flex-col items-center gap-3 text-center",children:[u.jsx("img",{src:X,width:72,height:72,alt:"",style:{filter:"drop-shadow(0 8px 28px rgba(51,88,212,.38))"}}),u.jsx("span",{className:"text-2xl font-bold tracking-tight",style:{color:"var(--text-primary)"},children:"Hive"})]}),u.jsxs("div",{className:"text-center",children:[u.jsx("h1",{className:"text-xl font-semibold text-pri",children:_("connect.login.heading")}),u.jsx("p",{className:"mt-2 text-sm text-ter",children:_("connect.login.subtitle")})]}),y?u.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,u.jsx("div",{className:"flex flex-col gap-3",children:g?u.jsx("div",{className:"flex items-center justify-center text-sm text-ter",style:{minHeight:"44px"},children:_("connect.login.signingIn")}):u.jsxs(u.Fragment,{children:[u.jsx(js,{primary:!0,testId:"connect-login-github",onClick:()=>S("github"),children:_("connect.login.github")}),u.jsx(js,{testId:"connect-login-google",onClick:()=>S("google"),children:_("connect.login.google")})]})})]});if(r==="machines"){const $=m!=null;return u.jsxs(Nl,{testId:"connect-machines",className:"gap-4",children:[u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx("img",{src:X,width:20,height:20,alt:"",className:"shrink-0"}),u.jsx("span",{className:"text-sm font-semibold text-sec",children:"Hive"})]}),u.jsxs("div",{className:"flex items-center justify-between gap-2",children:[u.jsx("h1",{className:"text-xl font-semibold text-pri",children:_("connect.machines.heading")}),x?u.jsx("button",{type:"button","aria-label":_("common.refresh"),"data-testid":"connect-machines-refresh",onClick:x,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:u.jsx(fm,{size:16,"aria-hidden":!0})}):null]}),L?u.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?u.jsxs("div",{className:"flex flex-1 flex-col items-center justify-center gap-4 px-4 text-center",children:[u.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:u.jsx(Yd,{size:28})}),u.jsx("p",{"data-testid":"connect-machines-empty",className:"max-w-[280px] text-sm text-ter",children:_("connect.machines.empty")}),u.jsx("div",{className:"flex w-full max-w-[320px] flex-col gap-3 pt-2",children:u.jsx(js,{testId:"connect-machines-back",...C?{onClick:C}:{},children:_("connect.machines.back")})})]}):u.jsx("ul",{className:"flex flex-col gap-2.5",children:o.map(M=>{const I=m===M.id,P=!M.online||M.revoked||$;let Z,K="var(--text-tertiary)";if(M.revoked)Z=_("connect.machines.revoked"),K="var(--status-red)";else if(M.online)I?(Z=_("connect.machines.connecting"),K="var(--text-secondary)"):(Z=_("connect.machines.online"),K="var(--status-green)");else{const W=M.lastSeen!=null?F6(M.lastSeen):null;Z=W!=null?_("connect.machines.lastSeen",{ago:W}):_("connect.machines.offline")}const R=M.revoked?"var(--status-red)":M.online?"var(--status-green)":"var(--text-tertiary)";return u.jsx("li",{children:u.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:I?"var(--bg-2)":"var(--bg-1)",opacity:P&&!I?.55:1,cursor:P?"not-allowed":"pointer"},disabled:P,"aria-disabled":P,onClick:()=>T(M.id),children:[u.jsxs("span",{className:"relative shrink-0","aria-hidden":!0,children:[u.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:u.jsx(Yd,{size:20})}),u.jsx("span",{className:"absolute -right-0.5 -bottom-0.5 h-3 w-3 rounded-full border-2",style:{background:R,borderColor:"var(--bg-1)"}})]}),u.jsxs("span",{className:"min-w-0 flex-1",children:[u.jsx("span",{className:"block truncate text-[15px] font-medium text-pri",children:M.name}),u.jsx("span",{className:"mt-0.5 block text-xs",style:{color:K},children:Z})]}),I?u.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)"}}):P?null:u.jsx(oc,{size:18,className:"shrink-0 text-ter","aria-hidden":!0})]})},M.id)})}),v?u.jsx("div",{className:"mt-auto pt-4 text-center",children:u.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 u.jsxs(Nl,{testId:"connect-pair-guide",className:"gap-4",children:[u.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:C,children:[u.jsx(sS,{size:16,"aria-hidden":!0}),_("connect.pair.back")]}),u.jsxs("div",{children:[u.jsx("h1",{className:"text-xl font-semibold text-pri",children:_("connect.pair.guideHeading")}),$?u.jsxs("p",{className:"mt-1 flex items-center gap-1.5 text-sm text-ter",children:[u.jsx(Yd,{size:14,"aria-hidden":!0,className:"shrink-0"}),u.jsx("span",{className:"truncate",children:$.name})]}):null]}),L?u.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,u.jsx("ol",{className:"flex flex-col gap-3",children:["connect.pair.guideStep1","connect.pair.guideStep2","connect.pair.guideStep3"].map((M,I)=>u.jsxs("li",{className:"flex items-start gap-3 text-sm text-sec",children:[u.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:I+1}),u.jsx("span",{className:"min-w-0 leading-relaxed",children:_(M)})]},M))}),u.jsxs("label",{className:"flex flex-col gap-2 text-xs uppercase tracking-wider text-ter",children:[_("connect.pair.qrLabel"),u.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=>{O.current=!1,ee(M.target.value)},style:{fontSize:"18px",letterSpacing:"0.12em",minHeight:"52px"}})]}),u.jsx(js,{primary:!0,testId:"connect-code-submit",disabled:!J,onClick:()=>{i&&!O.current&&(O.current=!0,k(i,j.trim()))},children:_("connect.pair.submit")})]})}if(r==="pairing"){const $=B;return u.jsxs(Nl,{testId:"connect-pairing",className:"justify-center gap-6",children:[te&&!$?u.jsxs("div",{className:"flex flex-col items-center gap-4",children:[u.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}),u.jsx("p",{className:"text-center text-sm text-ter",style:{maxWidth:"280px"},children:_(q?"connect.pair.finalizing":"connect.pair.sasInstruction")}),q?u.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&&!$?u.jsx("p",{"data-testid":"connect-pairing-phase",className:"text-center text-sm text-ter",children:_(D)}):null,$&&D?u.jsx("p",{"data-testid":"connect-pairing-phase",className:"text-center text-sm",style:{color:"var(--status-red)"},children:_(D)}):null,q?null:u.jsx("div",{className:"flex flex-col gap-3",children:u.jsx(js,{primary:$,testId:"connect-pairing-cancel",onClick:()=>{A(""),O.current=!1,E?E():t.pairingClient?.cancel()},children:_($?"connect.pair.startOver":"common.cancel")})})]})}return null},X6=()=>{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)},Z6=({children:t,connectTransport:r,createFlow:o=O6,store:i,gatewayBaseUrl:l,isGateway:c=Jx})=>{const f=c(),[h,g]=b.useState("login"),[m,y]=b.useState([]),[v,x]=b.useState(null),[S,T]=b.useState(void 0),[k,E]=b.useState(null),[C,_]=b.useState(null),[j,A]=b.useState(null),[O,D]=b.useState(null),[L,B]=b.useState(!1),[q,te]=b.useState(null),[ee,V]=b.useState(!1),[J,X]=b.useState(!0),$=b.useMemo(()=>o({store:i??I6(),connectTransport:r,...l?{gatewayBaseUrl:l}:{},proposedName:X6(),onPhase:g,onPairingPhase:ce=>{E(ce),ce!=="error"&&ce!=="expired"&&ce!=="rejected"&&_(null)},onPairingSas:D,onPairingFailure:ce=>_(ce.code)}),[o,i,r,l]),M=b.useRef($);M.current=$;const I=b.useRef(0),P=b.useCallback(()=>{E(null),_(null),D(null)},[]),Z=b.useCallback(()=>(I.current+=1,I.current),[]),K=b.useCallback(ce=>I.current===ce,[]);b.useEffect(()=>{let ce=!1;return M.current.loadMachines().then(({daemons:le,selfDeviceId:ie})=>{ce||(y(le),x(ie))}).catch(()=>{}).finally(()=>{ce||X(!1)}),()=>{ce=!0}},[]);const R=b.useCallback(()=>{const ce=Z();A(null),P(),B(!0),M.current.loadMachines().then(({daemons:le,selfDeviceId:ie})=>{K(ce)&&(y(le),x(ie))}).finally(()=>{K(ce)&&B(!1)})},[P,K,Z]),W=b.useCallback(ce=>{const le=Z();A(null),P(),V(!1),B(!0),M.current.loadMachines(ce).then(({daemons:ie,selfDeviceId:ue})=>{K(le)&&(y(ie),x(ue))}).catch(()=>{K(le)&&V(!0)}).finally(()=>{K(le)&&B(!1)})},[P,K,Z]),re=b.useCallback(ce=>{const le=Z();T(ce),A(null),P(),te(ce),(async()=>{const ie=await M.current.selectDaemon(ce);K(le)&&(te(null),!ie.ok&&ie.failure.code==="select_failed"&&A("select_failed"),!ie.ok&&ie.failure.code==="relay_revoked"&&A("relay_revoked"))})()},[P,K,Z]),ae=b.useCallback((ce,le)=>{const ie=Z();A(null),P(),(async()=>{const ue=await B6({code:le,daemonId:ce,gatewayUrl:l??window.location.origin});if(!K(ie))return;if(!ue){A("invalid_code");return}const pe=await M.current.selectDaemon(ce,ue);K(ie)&&(!pe.ok&&pe.failure.code==="select_failed"&&A("select_failed"),!pe.ok&&pe.failure.code==="relay_revoked"&&A("relay_revoked"))})()},[P,l,K,Z]),fe=b.useCallback(()=>{Z(),M.current.pairingClient?.cancel(),P(),A(null),g(S?"selecting":"machines")},[P,Z,S]),me=b.useCallback(()=>{Z(),A(null),P(),g("machines")},[P,Z]);return h==="connected"?(typeof history<"u"&&history.replaceState(null,"","/app"),u.jsx(u.Fragment,{children:t})):J?u.jsxs("div",{className:"connect-screen flex min-h-full flex-col items-center justify-center gap-3 p-6",children:[u.jsx("img",{src:f?"/brand/icon-192.png":"/logo.png",width:56,height:56,alt:"",className:"animate-pulse"}),u.jsx("span",{className:"sr-only","aria-live":"polite",children:"…"})]}):u.jsx(G6,{flow:$,phase:h,machines:m,selfDeviceId:v,...S?{selectedMachineId:S}:{},pairingPhase:k,pairingFailureCode:C,connectError:j,sas:O,isSigningIn:L,pendingMachineId:q,loginError:ee,isGatewayBundle:f,onRefreshMachines:R,onSelectProvider:W,onSelectMachine:re,onSubmitCode:ae,onCancelPairing:fe,onGoBack:me})},Q6=(t,r,o)=>t.mode==="tunnel"?u.jsx(o,{connectTransport:t.connectTransport,children:u.jsx(r,{})}):u.jsx(r,{}),Ve={Open:1,Data:2,End:3,Reset:4,Ping:5,Ack:6},rc={Http:1,Ws:2},Ht={ProtocolError:1,VersionMismatch:4},C0={INITIAL_WINDOW:256*1024,ACK_THRESHOLD:32*1024},ac=12,T0=0,sm=4294967295,t1=4294967295,J6=0,n1=1;class Bt extends Error{code;constructor(r,o){super(r),this.name="ProtocolError",this.code=o}}const eD=new TextEncoder,tD=new TextDecoder;function r1(t){return eD.encode(t)}function Cc(t){return new DataView(t.buffer,t.byteOffset,t.byteLength)}function im(t,r){if(!Number.isInteger(t)||t<0||t>t1)throw new RangeError(`${r} out of u32 range: ${t}`)}function a1(t){return t===Ve.Open||t===Ve.Data||t===Ve.End||t===Ve.Reset||t===Ve.Ping||t===Ve.Ack}function o1(t){return(t&-2)===0}function A0(t){if(t.version!==wn)throw new RangeError(`version must be ${wn}`);if(!a1(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(!o1(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");im(t.streamId,"streamId"),im(t.seq,"seq");const r=new Uint8Array(ac),o=Cc(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 nD(t){if(t.length<ac)throw new Bt("header too short",Ht.ProtocolError);const r=Cc(t),o=r.getUint8(0);if(o!==wn)throw new Bt(`bad version ${o}`,Ht.VersionMismatch);const i=r.getUint8(1);if(!a1(i))throw new Bt(`unknown kind ${i}`,Ht.ProtocolError);const l=r.getUint16(2);if(i===Ve.Data){if(!o1(l))throw new Bt("reserved flag bits set on Data frame",Ht.ProtocolError)}else if(l!==0)throw new Bt("flags must be 0 on a non-Data frame",Ht.ProtocolError);const c=r.getUint32(4),f=r.getUint32(8);return{version:o,kind:i,flags:l,streamId:c,seq:f}}function _0(t){let r;if(t.transport===rc.Http){if(!t.http)throw new RangeError("http meta required for Http transport");r=t.http}else if(t.transport===rc.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=r1(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,Cc(i).setUint16(1,o.length),i.set(o,3),i}function rD(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 Tc={ConnSalt:1,Hello:2},lm={daemon:1,device:2},aD=34;function oD(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]=Tc.ConnSalt,r[1]=lm.device,r.set(t.salt,2),r}function sD(t){if(t.length!==aD)throw new Bt("conn salt must be 34 bytes",Ht.ProtocolError);if(t[0]!==Tc.ConnSalt)throw new Bt("not a ConnSalt frame",Ht.ProtocolError);const r=t[1],o=r===lm.daemon?"daemon":r===lm.device?"device":null;if(o===null)throw new Bt("bad conn salt role",Ht.ProtocolError);return{role:o,salt:t.slice(2)}}function iD(t){return t.length>=1&&t[0]===Tc.ConnSalt}function lD(t){if(t.role!=="daemon"&&t.role!=="device")throw new RangeError(`bad role: ${t.role}`);const r=r1(JSON.stringify(t)),o=new Uint8Array(1+r.length);return o[0]=Tc.Hello,o.set(r,1),o}function cD(t){im(t,"cumulativeBytes");const r=new Uint8Array(4);return Cc(r).setUint32(0,t),r}function uD(t,r){const o=new Uint8Array(1+t.length);return o[0]=r?1:0,o.set(t,1),o}function dD(t){if(t.length<1)throw new Bt("ws message too short",Ht.ProtocolError);const r=t[0];if(r!==0&&r!==1)throw new Bt("bad ws isText flag",Ht.ProtocolError);return{data:t.slice(1),isText:r===1}}function N0(t){const r=new Uint8Array(1+t.length);return r[0]=n1,r.set(t,1),r}function fD(t){if(t.length<1)throw new Bt("http data too short",Ht.ProtocolError);const r=t[0];if(r===J6){let o;try{o=JSON.parse(tD.decode(t.subarray(1)))}catch{throw new Bt("http head not JSON",Ht.ProtocolError)}const i=o;if(typeof i.status!="number"||!rD(i.headers))throw new Bt("bad http head",Ht.ProtocolError);return{kind:"head",head:{status:i.status,headers:i.headers}}}if(r===n1)return{kind:"body",data:t.slice(1)};throw new Bt(`unknown http disc ${r}`,Ht.ProtocolError)}function j0(t){let r=1;return()=>{r===sm&&(r+=2);const o=r;if(r+=2,r>t1)throw new RangeError("stream id space exhausted; re-handshake required");return o}}const mD={ok:!0};function R0(t=C0.INITIAL_WINDOW,r=C0.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,mD)},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 pD=1,Rf=256*1024,cm=new TextEncoder,hD=new TextDecoder,gD=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},vD=t=>{if(typeof t=="string")return{bytes:cm.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}},yD=t=>{const r=t.generateConnSalt??v6;let o=null,i=null,l=null,c=null,f=null,h=j0();const g=new Map,m=(j,A)=>{if(j.length!==A.length)return!1;for(let O=0;O<j.length;O++)if(j[O]!==A[O])return!1;return!0},y=(j,A,O,D=0)=>{if(!i||!o)throw new Error("frame-mux: seal before channel handshake complete");const L=A0({version:wn,kind:j,flags:D,streamId:A,seq:i.nextSeq});t.onSeal?.({key:o.p2d,direction:"p2d",headerBytes:L});const{ciphertext:B}=E6(i,{key:o.p2d,headerBytes:L,payload:O}),q=new Uint8Array(L.length+B.length);return q.set(L,0),q.set(B,L.length),q},v=()=>{t.send(y(Ve.Data,T0,lD({protocolVersion:wn,role:"device",daemonId:t.daemonId,deviceId:t.deviceId})))},x=j=>{c&&(f&&m(f,j)||(o=y6({rootD2p:t.roots.d2p,rootP2d:t.roots.p2d,phoneConnSalt:c,daemonConnSalt:j,ids:{daemonId:t.daemonId,deviceId:t.deviceId,protocolVersion:wn}}),i=k6("p2d"),l=S6("d2p"),f=Uint8Array.from(j),v(),t.onReady?.()))},S=(j,A)=>{t.send(y(Ve.Ack,j,cD(A)))},T=(j,A)=>{if(!o)return Promise.reject(new Error("tunnel: channel not ready"));const O=h(),D=(A?.method??"GET").toUpperCase(),L=[];A?.headers&&new Headers(A.headers).forEach((ee,V)=>{L.push([V,ee])});const B=A?.body===void 0||A.body===null?void 0:bD(A.body),q=B!==void 0&&B.length>0;return new Promise((te,ee)=>{const V={kind:"http",body:[],recvFlow:R0(),resolve:te,reject:ee,settled:!1};g.set(O,V),t.send(y(Ve.Open,O,_0({transport:rc.Http,http:{method:D,path:j,headers:L,hasBody:q}}))),q&&B?B.length<=Rf?(t.send(y(Ve.Data,O,N0(B))),t.send(y(Ve.End,O,new Uint8Array(0)))):k(O,V,B):t.send(y(Ve.End,O,new Uint8Array(0)))})},k=async(j,A,O)=>{try{for(let D=0;D<O.length;D+=Rf){if(D>0&&t.awaitDrain&&await t.awaitDrain(),A.settled)return;t.send(y(Ve.Data,j,N0(O.subarray(D,D+Rf))))}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 O=A.head,D=gD(A.body);if(!O){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:O.status,headers:O.headers}))};class C{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:O,isText:D}=vD(A);t.send(y(Ve.Data,this.streamId,uD(O,D)))}close(A,O){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,O){this.onmessage&&this.onmessage({data:O?hD.decode(A):A})}_remoteClose(A,O){this.readyState!==3&&(this.readyState=3,g.delete(this.streamId),this.onclose?.(O===void 0?{code:A}:{code:A,reason:O}))}}return{beginChannel(){c=r(),o=null,i=null,l=null,f=null,this.resetAll("rekey"),h=j0();const j=A0({version:wn,kind:Ve.Data,flags:0,streamId:sm,seq:0}),A=oD({salt:c}),O=new Uint8Array(j.length+A.length);O.set(j,0),O.set(A,j.length),t.send(O)},onFrame(j){const A=j.subarray(0,ac),O=j.subarray(ac),D=nD(A);if(D.streamId===sm&&iD(O)){const{role:q,salt:te}=sD(O);q==="daemon"&&x(te);return}if(!l||!o)return;const L=C6(l,{key:o.d2p,headerBytes:A,ciphertext:O,seq:D.seq});if(D.streamId===T0)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 q=fD(L);if(q.kind==="head")B.head=q.head;else{B.body.push(q.data);const te=B.recvFlow.onConsume(q.data.length);te&&S(D.streamId,te.ackCumulative)}(D.flags&pD)!==0&&E(D.streamId,B);return}if(D.kind===Ve.End){E(D.streamId,B);return}return}if(D.kind===Ve.Data){const q=dD(L),te=B.recvFlow.onConsume(q.data.length);te&&S(D.streamId,te.ackCumulative),B.socket._deliver(q.data,q.isText);return}if(D.kind===Ve.End||D.kind===Ve.Reset){B.socket._remoteClose(D.kind===Ve.Reset?1011:1e3);return}}},fetch:T,openWebSocket:(j,A)=>{if(!o){const B=new C(-1);return queueMicrotask(()=>B._remoteClose(1011,"tunnel: channel not ready")),B}const O=h(),D=[];if(A)for(const[B,q]of Object.entries(A))q!==void 0&&D.push([B,String(q)]);const L=new C(O);return g.set(O,{kind:"ws",recvFlow:R0(),socket:L}),t.send(y(Ve.Open,O,_0({transport:rc.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,O]of[...g.entries()])g.delete(A),O.kind==="http"?O.settled||(O.settled=!0,O.reject(new Error(`tunnel: connection lost (${j})`))):O.socket._remoteClose(1006,j)}}},bD=t=>typeof t=="string"?cm.encode(t):t instanceof Uint8Array?t:t instanceof ArrayBuffer?new Uint8Array(t):ArrayBuffer.isView(t)?new Uint8Array(t.buffer,t.byteOffset,t.byteLength):cm.encode(String(t)),wD=2e4,xD=1e4,kD=6,SD=()=>{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}}},ED=(t,r)=>!r&&(t===ya.Forbidden||t===ya.Unauthorized),CD=(t,r)=>{const o=t.WebSocketImpl??WebSocket,i=t.setTimer??((ee,V)=>setTimeout(ee,V)),l=t.clearTimer??(ee=>clearTimeout(ee)),c=t.backoff??SD(),f=t.heartbeatMs??wD,h=t.heartbeatDeadlineMs??xD,g=t.maxOfflineRetries??kD;let m=null,y=0,v=!1,x=!1,S=!1,T=0,k=null,E=null,C=null;const _=`${t.gatewayUrl}/relay?daemonId=${encodeURIComponent(t.daemonId)}`,j=()=>{C!==null&&(l(C),C=null)},A=()=>{E!==null&&(clearInterval(E),E=null),j()},O=(ee,V)=>{A(),E=setInterval(()=>{if(ee.readyState===ee.OPEN){try{ee.send(yx)}catch{}C===null&&(C=i(()=>{if(C=null,!(V!==y||x)){A();try{ee.close()}catch{}}},h))}},f)},D=()=>{if(x||v||S)return;const ee=++y;let V=!1;const J=new o(_,[`bearer.${t.phoneSessionToken}`]);J.binaryType="arraybuffer",m=J,J.onopen=()=>{ee!==y||x||(V=!0,c.reset(),T=0,O(J,ee),r.onUp())},J.onmessage=X=>{if(ee!==y||x)return;const $=X.data;if(typeof $=="string"){if($.startsWith(r0)){let I;try{I=JSON.parse($.slice(r0.length))}catch{return}if(I.t==="revoked"){L(ya.Revoked),r.onControl(I);return}r.onControl(I);return}$===bx&&j();return}const M=$ instanceof ArrayBuffer?new Uint8Array($):new Uint8Array($);r.onFrame(M)},J.onerror=()=>{},J.onclose=X=>{if(ee!==y||x)return;A(),m=null;const $=X.code??ya.InternalError;if(j5($)||ED($,V)){L($);return}if($===ya.DaemonOffline){if(T+=1,T>=g){S=!0,r.onDown({code:$,authFatal:!1,daemonOffline:!0});return}}else T=0;const M=c.next();r.onDown({code:$,authFatal:!1,nextRetryInMs:M}),k=i(()=>{k=null,D()},M)}},L=ee=>{v||(v=!0,A(),k!==null&&(l(k),k=null),r.onDown({code:ee,authFatal:!0}))},B=()=>{x||v||S||m!==null&&(m.readyState===m.OPEN||m.readyState===WebSocket.CONNECTING)||(k!==null&&(l(k),k=null),D())},q=()=>{typeof document<"u"&&document.visibilityState==="visible"&&B()},te=()=>B();return typeof document<"u"&&document.addEventListener("visibilitychange",q),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(){x||v||!S||(S=!1,T=0,c.reset(),D())},close(){if(x=!0,y+=1,A(),k!==null&&(l(k),k=null),m){try{m.close()}catch{}m=null}typeof document<"u"&&document.removeEventListener("visibilitychange",q),typeof window<"u"&&window.removeEventListener("online",te)}}};function TD(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,O)=>{o={state:A,...O?.reason?{reason:O.reason}:{},...O?.nextRetryInMs!==void 0?{nextRetryInMs:O.nextRetryInMs}:{},...O?.retry?{retry:O.retry}:{}},t.onStatus(o)};let l=null,c=!1,f=!1,h=!1;const g=new Set,m=t.setTimer??((A,O)=>setTimeout(A,O)),y=t.clearTimer??(A=>clearTimeout(A)),v=()=>{for(const A of g)A.timer!==null&&y(A.timer),A.resolve();g.clear()},x=A=>{for(const O of g)O.timer!==null&&y(O.timer),O.reject(new Error(`tunnel: ${A}`));g.clear()},S=()=>{c=!1},T=()=>{c||(h=!1,f=!1,c=!0,i("online"),v())},k=()=>{h=!0,c=!1,j.beginChannel()},E=4*1024*1024,C=50,_=()=>new Promise(A=>{const O=()=>{if(!l||l.bufferedAmount()<=E){A();return}m(O,C)};O()}),j=yD({roots:r.roots,daemonId:r.daemonId,deviceId:r.deviceId,send:A=>l?.send(A),onReady:T,awaitDrain:_});return l=CD({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,k()}else A.t==="revoked"&&(f=!1,h=!1,S(),j.resetAll("revoked"),x(A.reason??"revoked"),i("revoked",{reason:A.reason}))},onUp:()=>{f=!1,k()},onDown:A=>{f=!1,h=!1,S(),j.resetAll(A.authFatal?"auth_fatal":A.daemonOffline?"daemon_offline":"transient"),A.authFatal?(x("auth_fatal"),i("revoked")):A.daemonOffline?(x("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,O)=>j.fetch(A,O),openWebSocket:(A,O)=>j.openWebSocket(A,O),status:()=>o,ready:(A={})=>{if(c)return Promise.resolve();const O=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"))},O),g.add(B)})},dispose:()=>{f=!1,h=!1,S(),l?.close(),l=null,j.resetAll("disposed"),x("disposed")}}}const AD=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=TD({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 zE(f),{ok:!0}}},_D=(t={})=>{if(!(t.isGateway??Jx)())return{mode:"direct"};if(!t.resolveSession)throw new Error("bootTransport: a gateway bundle requires resolveSession to build the tunnel");return{mode:"tunnel",connectTransport:AD({resolveSession:t.resolveSession,...t.onStatus?{onStatus:t.onStatus}:{},...t.WebSocketImpl?{WebSocketImpl:t.WebSocketImpl}:{},...t.readyTimeoutMs!==void 0?{readyTimeoutMs:t.readyTimeoutMs}:{}})}},ND=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:Vs(t.rootKeys.d2p),p2d:Vs(t.rootKeys.p2d)},deviceId:t.deviceId,daemonId:t.daemonId,gatewayUrl:o,phoneSessionToken:l}},s1=document.getElementById("root");if(!s1)throw new Error("Root element not found");const jD=_D({resolveSession:ND,onStatus:uR});L2.createRoot(s1).render(u.jsx(b.StrictMode,{children:Q6(jD,N5,Z6)}));q3();export{hm as $,Wl as A,YD as B,Co as C,KD as D,Xs as E,BD as F,qD as G,q0 as H,H0 as I,ni as J,ID as K,To as L,FS as M,FD as N,Js as O,Qs as P,mm as Q,Zs as R,iE as S,lt as T,NS as U,PD as V,K0 as W,vo as X,WD as Y,UD as Z,Wr as _,$D as a,xc as a0,I_ as a1,LD as a2,zD as a3,JE as a4,HD as a5,lc as a6,ew as a7,fm as a8,aM as a9,B0 as aa,RS as ab,Ds as ac,oM as ad,W0 as ae,xj as af,nM as ag,Tt as ah,Zb as ai,Iw as aj,rM as ak,r_ as al,AS as am,DD as an,MD as ao,sS as ap,oc as b,be as c,mS as d,Jt as e,XD as f,RD as g,cE as h,At as i,u as j,ei as k,VD as l,ti as m,bS as n,ZD as o,QD as p,Ao as q,b as r,OD as s,ic as t,ke as u,JD as v,GD as w,Eo as x,sc as y,tM as z};