syntaur 0.6.0 → 0.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (83) hide show
  1. package/README.md +2 -2
  2. package/dashboard/dist/assets/{_basePickBy-BQIP1Ca7.js → _basePickBy-DTYUlCEg.js} +1 -1
  3. package/dashboard/dist/assets/{_baseUniq-BnBWRwT7.js → _baseUniq-C0Y4HRd5.js} +1 -1
  4. package/dashboard/dist/assets/{arc-BYWL4eq0.js → arc-BFx2eqN9.js} +1 -1
  5. package/dashboard/dist/assets/{architectureDiagram-2XIMDMQ5-CD_SWPSa.js → architectureDiagram-2XIMDMQ5-Erol1JD6.js} +1 -1
  6. package/dashboard/dist/assets/{blockDiagram-WCTKOSBZ-BS1ZbFBU.js → blockDiagram-WCTKOSBZ-kSkh6VkS.js} +1 -1
  7. package/dashboard/dist/assets/{c4Diagram-IC4MRINW-D99yg-l2.js → c4Diagram-IC4MRINW-C04oKzvX.js} +1 -1
  8. package/dashboard/dist/assets/channel-C82tBKZ7.js +1 -0
  9. package/dashboard/dist/assets/{chunk-4BX2VUAB-BkN9IORC.js → chunk-4BX2VUAB-C3t0tXt-.js} +1 -1
  10. package/dashboard/dist/assets/{chunk-55IACEB6-BQPHWefV.js → chunk-55IACEB6-2cnyEL0b.js} +1 -1
  11. package/dashboard/dist/assets/{chunk-FMBD7UC4-CNcExMdx.js → chunk-FMBD7UC4-DIY9MTNi.js} +1 -1
  12. package/dashboard/dist/assets/{chunk-JSJVCQXG-LXBmftkC.js → chunk-JSJVCQXG-Cw8fpqpE.js} +1 -1
  13. package/dashboard/dist/assets/{chunk-KX2RTZJC-Tqi7zNqq.js → chunk-KX2RTZJC-BAhd66XV.js} +1 -1
  14. package/dashboard/dist/assets/{chunk-NQ4KR5QH-DkMbx-rW.js → chunk-NQ4KR5QH-RzXwoxk3.js} +1 -1
  15. package/dashboard/dist/assets/{chunk-QZHKN3VN-BlrRCfkJ.js → chunk-QZHKN3VN-Dgri4sGz.js} +1 -1
  16. package/dashboard/dist/assets/{chunk-WL4C6EOR-of3XBzMu.js → chunk-WL4C6EOR-DYLj9JRa.js} +1 -1
  17. package/dashboard/dist/assets/classDiagram-VBA2DB6C-STOZ51tg.js +1 -0
  18. package/dashboard/dist/assets/classDiagram-v2-RAHNMMFH-STOZ51tg.js +1 -0
  19. package/dashboard/dist/assets/clone-TzhWk-Bj.js +1 -0
  20. package/dashboard/dist/assets/{cose-bilkent-S5V4N54A-BlIiyO76.js → cose-bilkent-S5V4N54A-DfY_Fnfu.js} +1 -1
  21. package/dashboard/dist/assets/{dagre-KLK3FWXG-CYQjSI9N.js → dagre-KLK3FWXG-CyTKIVSK.js} +1 -1
  22. package/dashboard/dist/assets/{diagram-E7M64L7V-BZHzTKct.js → diagram-E7M64L7V-Krub7Xxo.js} +1 -1
  23. package/dashboard/dist/assets/{diagram-IFDJBPK2-kMP3WqBV.js → diagram-IFDJBPK2-giUl9uHz.js} +1 -1
  24. package/dashboard/dist/assets/{diagram-P4PSJMXO-BWSHyFOv.js → diagram-P4PSJMXO-oAtnO3C9.js} +1 -1
  25. package/dashboard/dist/assets/{erDiagram-INFDFZHY-B5HrvsPP.js → erDiagram-INFDFZHY-eYaVjXqo.js} +1 -1
  26. package/dashboard/dist/assets/{flowDiagram-PKNHOUZH-Dm4ewP7w.js → flowDiagram-PKNHOUZH-or5S0_Sb.js} +1 -1
  27. package/dashboard/dist/assets/{ganttDiagram-A5KZAMGK-DB3k27zu.js → ganttDiagram-A5KZAMGK-C9R1lsme.js} +1 -1
  28. package/dashboard/dist/assets/{gitGraphDiagram-K3NZZRJ6-G7y6Ey-m.js → gitGraphDiagram-K3NZZRJ6-BQwsDzvp.js} +1 -1
  29. package/dashboard/dist/assets/{graph-CaM4i6vq.js → graph-EQOX1wg8.js} +1 -1
  30. package/dashboard/dist/assets/index-Cy7yjuqO.js +500 -0
  31. package/dashboard/dist/assets/index-u80fISp0.css +1 -0
  32. package/dashboard/dist/assets/{infoDiagram-LFFYTUFH-JNTUbTjg.js → infoDiagram-LFFYTUFH-BjLlQWxk.js} +1 -1
  33. package/dashboard/dist/assets/{ishikawaDiagram-PHBUUO56-BZJt1ht8.js → ishikawaDiagram-PHBUUO56-BNjydh4j.js} +1 -1
  34. package/dashboard/dist/assets/{journeyDiagram-4ABVD52K-DPcqvl9A.js → journeyDiagram-4ABVD52K-DNzE7TgQ.js} +1 -1
  35. package/dashboard/dist/assets/{kanban-definition-K7BYSVSG-D1D7AuOV.js → kanban-definition-K7BYSVSG-FbNvGx6i.js} +1 -1
  36. package/dashboard/dist/assets/{layout-BTOh3EDT.js → layout-B2yZvlWs.js} +1 -1
  37. package/dashboard/dist/assets/{linear-MbCpC_Cg.js → linear-p68yY_14.js} +1 -1
  38. package/dashboard/dist/assets/{mermaid.core-CYbhqlNy.js → mermaid.core-D558akcW.js} +4 -4
  39. package/dashboard/dist/assets/{mindmap-definition-YRQLILUH-CwYCISFH.js → mindmap-definition-YRQLILUH-CZPgesSK.js} +1 -1
  40. package/dashboard/dist/assets/{pieDiagram-SKSYHLDU-5qfZ73SG.js → pieDiagram-SKSYHLDU-CdXMWspp.js} +1 -1
  41. package/dashboard/dist/assets/{quadrantDiagram-337W2JSQ-WI8y1sQ_.js → quadrantDiagram-337W2JSQ-D7tq22ZY.js} +1 -1
  42. package/dashboard/dist/assets/{requirementDiagram-Z7DCOOCP-BFlD0ZTS.js → requirementDiagram-Z7DCOOCP-ByZxUSmd.js} +1 -1
  43. package/dashboard/dist/assets/{sankeyDiagram-WA2Y5GQK-Bdckv1Se.js → sankeyDiagram-WA2Y5GQK-CZon9rRY.js} +1 -1
  44. package/dashboard/dist/assets/{sequenceDiagram-2WXFIKYE-DgzxKAlZ.js → sequenceDiagram-2WXFIKYE-nbELB6rb.js} +1 -1
  45. package/dashboard/dist/assets/{stateDiagram-RAJIS63D-DO4OXahC.js → stateDiagram-RAJIS63D-D_OPKr5B.js} +1 -1
  46. package/dashboard/dist/assets/stateDiagram-v2-FVOUBMTO-4pLM5B3m.js +1 -0
  47. package/dashboard/dist/assets/{timeline-definition-YZTLITO2-BBB01JWw.js → timeline-definition-YZTLITO2-Cxuvk1D2.js} +1 -1
  48. package/dashboard/dist/assets/{treemap-KZPCXAKY-Dr0jb8op.js → treemap-KZPCXAKY-C0CRpL92.js} +1 -1
  49. package/dashboard/dist/assets/{vennDiagram-LZ73GAT5-D40KFl2o.js → vennDiagram-LZ73GAT5-DijCj6M3.js} +1 -1
  50. package/dashboard/dist/assets/{xychartDiagram-JWTSCODW-DBUmWQfT.js → xychartDiagram-JWTSCODW-CdpE0oRi.js} +1 -1
  51. package/dashboard/dist/index.html +2 -2
  52. package/dist/dashboard/server.js +429 -39
  53. package/dist/dashboard/server.js.map +1 -1
  54. package/dist/index.js +658 -134
  55. package/dist/index.js.map +1 -1
  56. package/package.json +1 -1
  57. package/platforms/claude-code/README.md +3 -3
  58. package/platforms/claude-code/agents/syntaur-expert.md +12 -4
  59. package/platforms/claude-code/commands/save-session-summary/save-session-summary.md +24 -0
  60. package/platforms/claude-code/hooks/hooks.json +10 -0
  61. package/platforms/claude-code/hooks/session-start.sh +26 -1
  62. package/platforms/claude-code/references/file-ownership.md +2 -1
  63. package/platforms/claude-code/references/protocol-summary.md +6 -1
  64. package/platforms/claude-code/skills/track-session/SKILL.md +86 -0
  65. package/platforms/codex/README.md +2 -2
  66. package/platforms/codex/agents/syntaur-operator.md +6 -4
  67. package/platforms/codex/commands/save-session-summary.md +23 -0
  68. package/platforms/codex/references/file-ownership.md +2 -1
  69. package/platforms/codex/references/protocol-summary.md +6 -1
  70. package/vendor/syntaur-skills/skills/complete-assignment/SKILL.md +2 -0
  71. package/vendor/syntaur-skills/skills/grab-assignment/SKILL.md +7 -2
  72. package/vendor/syntaur-skills/skills/plan-assignment/SKILL.md +3 -1
  73. package/vendor/syntaur-skills/skills/save-session-summary/SKILL.md +113 -0
  74. package/vendor/syntaur-skills/skills/syntaur-protocol/SKILL.md +23 -4
  75. package/vendor/syntaur-skills/skills/syntaur-protocol/references/file-ownership.md +2 -1
  76. package/vendor/syntaur-skills/skills/syntaur-protocol/references/protocol-summary.md +6 -1
  77. package/dashboard/dist/assets/channel-Df6VrFK5.js +0 -1
  78. package/dashboard/dist/assets/classDiagram-VBA2DB6C-CyfzumTY.js +0 -1
  79. package/dashboard/dist/assets/classDiagram-v2-RAHNMMFH-CyfzumTY.js +0 -1
  80. package/dashboard/dist/assets/clone-CMs4Aqrx.js +0 -1
  81. package/dashboard/dist/assets/index-B4QMu-Oq.css +0 -1
  82. package/dashboard/dist/assets/index-BBWZjPBC.js +0 -495
  83. package/dashboard/dist/assets/stateDiagram-v2-FVOUBMTO-o8bgX-J3.js +0 -1
@@ -0,0 +1,500 @@
1
+ function fS(e,t){for(var n=0;n<t.length;n++){const o=t[n];if(typeof o!="string"&&!Array.isArray(o)){for(const a in o)if(a!=="default"&&!(a in e)){const l=Object.getOwnPropertyDescriptor(o,a);l&&Object.defineProperty(e,a,l.get?l:{enumerable:!0,get:()=>o[a]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const a of document.querySelectorAll('link[rel="modulepreload"]'))o(a);new MutationObserver(a=>{for(const l of a)if(l.type==="childList")for(const c of l.addedNodes)c.tagName==="LINK"&&c.rel==="modulepreload"&&o(c)}).observe(document,{childList:!0,subtree:!0});function n(a){const l={};return a.integrity&&(l.integrity=a.integrity),a.referrerPolicy&&(l.referrerPolicy=a.referrerPolicy),a.crossOrigin==="use-credentials"?l.credentials="include":a.crossOrigin==="anonymous"?l.credentials="omit":l.credentials="same-origin",l}function o(a){if(a.ep)return;a.ep=!0;const l=n(a);fetch(a.href,l)}})();function Rc(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function f_(e){if(Object.prototype.hasOwnProperty.call(e,"__esModule"))return e;var t=e.default;if(typeof t=="function"){var n=function o(){return this instanceof o?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};n.prototype=t.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(e).forEach(function(o){var a=Object.getOwnPropertyDescriptor(e,o);Object.defineProperty(n,o,a.get?a:{enumerable:!0,get:function(){return e[o]}})}),n}var qd={exports:{}},Ui={},Kd={exports:{}},Ke={};/**
2
+ * @license React
3
+ * react.production.min.js
4
+ *
5
+ * Copyright (c) Facebook, Inc. and its affiliates.
6
+ *
7
+ * This source code is licensed under the MIT license found in the
8
+ * LICENSE file in the root directory of this source tree.
9
+ */var bx;function pS(){if(bx)return Ke;bx=1;var e=Symbol.for("react.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),o=Symbol.for("react.strict_mode"),a=Symbol.for("react.profiler"),l=Symbol.for("react.provider"),c=Symbol.for("react.context"),d=Symbol.for("react.forward_ref"),p=Symbol.for("react.suspense"),m=Symbol.for("react.memo"),h=Symbol.for("react.lazy"),x=Symbol.iterator;function v(M){return M===null||typeof M!="object"?null:(M=x&&M[x]||M["@@iterator"],typeof M=="function"?M:null)}var b={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},C=Object.assign,k={};function j(M,Q,I){this.props=M,this.context=Q,this.refs=k,this.updater=I||b}j.prototype.isReactComponent={},j.prototype.setState=function(M,Q){if(typeof M!="object"&&typeof M!="function"&&M!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,M,Q,"setState")},j.prototype.forceUpdate=function(M){this.updater.enqueueForceUpdate(this,M,"forceUpdate")};function S(){}S.prototype=j.prototype;function R(M,Q,I){this.props=M,this.context=Q,this.refs=k,this.updater=I||b}var N=R.prototype=new S;N.constructor=R,C(N,j.prototype),N.isPureReactComponent=!0;var A=Array.isArray,O=Object.prototype.hasOwnProperty,T={current:null},D={key:!0,ref:!0,__self:!0,__source:!0};function L(M,Q,I){var ge,Se={},te=null,fe=null;if(Q!=null)for(ge in Q.ref!==void 0&&(fe=Q.ref),Q.key!==void 0&&(te=""+Q.key),Q)O.call(Q,ge)&&!D.hasOwnProperty(ge)&&(Se[ge]=Q[ge]);var ve=arguments.length-2;if(ve===1)Se.children=I;else if(1<ve){for(var we=Array(ve),be=0;be<ve;be++)we[be]=arguments[be+2];Se.children=we}if(M&&M.defaultProps)for(ge in ve=M.defaultProps,ve)Se[ge]===void 0&&(Se[ge]=ve[ge]);return{$$typeof:e,type:M,key:te,ref:fe,props:Se,_owner:T.current}}function G(M,Q){return{$$typeof:e,type:M.type,key:Q,ref:M.ref,props:M.props,_owner:M._owner}}function re(M){return typeof M=="object"&&M!==null&&M.$$typeof===e}function z(M){var Q={"=":"=0",":":"=2"};return"$"+M.replace(/[=:]/g,function(I){return Q[I]})}var K=/\/+/g;function q(M,Q){return typeof M=="object"&&M!==null&&M.key!=null?z(""+M.key):Q.toString(36)}function J(M,Q,I,ge,Se){var te=typeof M;(te==="undefined"||te==="boolean")&&(M=null);var fe=!1;if(M===null)fe=!0;else switch(te){case"string":case"number":fe=!0;break;case"object":switch(M.$$typeof){case e:case t:fe=!0}}if(fe)return fe=M,Se=Se(fe),M=ge===""?"."+q(fe,0):ge,A(Se)?(I="",M!=null&&(I=M.replace(K,"$&/")+"/"),J(Se,Q,I,"",function(be){return be})):Se!=null&&(re(Se)&&(Se=G(Se,I+(!Se.key||fe&&fe.key===Se.key?"":(""+Se.key).replace(K,"$&/")+"/")+M)),Q.push(Se)),1;if(fe=0,ge=ge===""?".":ge+":",A(M))for(var ve=0;ve<M.length;ve++){te=M[ve];var we=ge+q(te,ve);fe+=J(te,Q,I,we,Se)}else if(we=v(M),typeof we=="function")for(M=we.call(M),ve=0;!(te=M.next()).done;)te=te.value,we=ge+q(te,ve++),fe+=J(te,Q,I,we,Se);else if(te==="object")throw Q=String(M),Error("Objects are not valid as a React child (found: "+(Q==="[object Object]"?"object with keys {"+Object.keys(M).join(", ")+"}":Q)+"). If you meant to render a collection of children, use an array instead.");return fe}function _(M,Q,I){if(M==null)return M;var ge=[],Se=0;return J(M,ge,"","",function(te){return Q.call(I,te,Se++)}),ge}function F(M){if(M._status===-1){var Q=M._result;Q=Q(),Q.then(function(I){(M._status===0||M._status===-1)&&(M._status=1,M._result=I)},function(I){(M._status===0||M._status===-1)&&(M._status=2,M._result=I)}),M._status===-1&&(M._status=0,M._result=Q)}if(M._status===1)return M._result.default;throw M._result}var B={current:null},U={transition:null},Z={ReactCurrentDispatcher:B,ReactCurrentBatchConfig:U,ReactCurrentOwner:T};function P(){throw Error("act(...) is not supported in production builds of React.")}return Ke.Children={map:_,forEach:function(M,Q,I){_(M,function(){Q.apply(this,arguments)},I)},count:function(M){var Q=0;return _(M,function(){Q++}),Q},toArray:function(M){return _(M,function(Q){return Q})||[]},only:function(M){if(!re(M))throw Error("React.Children.only expected to receive a single React element child.");return M}},Ke.Component=j,Ke.Fragment=n,Ke.Profiler=a,Ke.PureComponent=R,Ke.StrictMode=o,Ke.Suspense=p,Ke.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=Z,Ke.act=P,Ke.cloneElement=function(M,Q,I){if(M==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+M+".");var ge=C({},M.props),Se=M.key,te=M.ref,fe=M._owner;if(Q!=null){if(Q.ref!==void 0&&(te=Q.ref,fe=T.current),Q.key!==void 0&&(Se=""+Q.key),M.type&&M.type.defaultProps)var ve=M.type.defaultProps;for(we in Q)O.call(Q,we)&&!D.hasOwnProperty(we)&&(ge[we]=Q[we]===void 0&&ve!==void 0?ve[we]:Q[we])}var we=arguments.length-2;if(we===1)ge.children=I;else if(1<we){ve=Array(we);for(var be=0;be<we;be++)ve[be]=arguments[be+2];ge.children=ve}return{$$typeof:e,type:M.type,key:Se,ref:te,props:ge,_owner:fe}},Ke.createContext=function(M){return M={$$typeof:c,_currentValue:M,_currentValue2:M,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},M.Provider={$$typeof:l,_context:M},M.Consumer=M},Ke.createElement=L,Ke.createFactory=function(M){var Q=L.bind(null,M);return Q.type=M,Q},Ke.createRef=function(){return{current:null}},Ke.forwardRef=function(M){return{$$typeof:d,render:M}},Ke.isValidElement=re,Ke.lazy=function(M){return{$$typeof:h,_payload:{_status:-1,_result:M},_init:F}},Ke.memo=function(M,Q){return{$$typeof:m,type:M,compare:Q===void 0?null:Q}},Ke.startTransition=function(M){var Q=U.transition;U.transition={};try{M()}finally{U.transition=Q}},Ke.unstable_act=P,Ke.useCallback=function(M,Q){return B.current.useCallback(M,Q)},Ke.useContext=function(M){return B.current.useContext(M)},Ke.useDebugValue=function(){},Ke.useDeferredValue=function(M){return B.current.useDeferredValue(M)},Ke.useEffect=function(M,Q){return B.current.useEffect(M,Q)},Ke.useId=function(){return B.current.useId()},Ke.useImperativeHandle=function(M,Q,I){return B.current.useImperativeHandle(M,Q,I)},Ke.useInsertionEffect=function(M,Q){return B.current.useInsertionEffect(M,Q)},Ke.useLayoutEffect=function(M,Q){return B.current.useLayoutEffect(M,Q)},Ke.useMemo=function(M,Q){return B.current.useMemo(M,Q)},Ke.useReducer=function(M,Q,I){return B.current.useReducer(M,Q,I)},Ke.useRef=function(M){return B.current.useRef(M)},Ke.useState=function(M){return B.current.useState(M)},Ke.useSyncExternalStore=function(M,Q,I){return B.current.useSyncExternalStore(M,Q,I)},Ke.useTransition=function(){return B.current.useTransition()},Ke.version="18.3.1",Ke}var wx;function Cp(){return wx||(wx=1,Kd.exports=pS()),Kd.exports}/**
10
+ * @license React
11
+ * react-jsx-runtime.production.min.js
12
+ *
13
+ * Copyright (c) Facebook, Inc. and its affiliates.
14
+ *
15
+ * This source code is licensed under the MIT license found in the
16
+ * LICENSE file in the root directory of this source tree.
17
+ */var kx;function hS(){if(kx)return Ui;kx=1;var e=Cp(),t=Symbol.for("react.element"),n=Symbol.for("react.fragment"),o=Object.prototype.hasOwnProperty,a=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,l={key:!0,ref:!0,__self:!0,__source:!0};function c(d,p,m){var h,x={},v=null,b=null;m!==void 0&&(v=""+m),p.key!==void 0&&(v=""+p.key),p.ref!==void 0&&(b=p.ref);for(h in p)o.call(p,h)&&!l.hasOwnProperty(h)&&(x[h]=p[h]);if(d&&d.defaultProps)for(h in p=d.defaultProps,p)x[h]===void 0&&(x[h]=p[h]);return{$$typeof:t,type:d,key:v,ref:b,props:x,_owner:a.current}}return Ui.Fragment=n,Ui.jsx=c,Ui.jsxs=c,Ui}var jx;function mS(){return jx||(jx=1,qd.exports=hS()),qd.exports}var i=mS(),g=Cp();const Ct=Rc(g),Bv=fS({__proto__:null,default:Ct},[g]);var Bl={},Gd={exports:{}},Nn={},Yd={exports:{}},Xd={};/**
18
+ * @license React
19
+ * scheduler.production.min.js
20
+ *
21
+ * Copyright (c) Facebook, Inc. and its affiliates.
22
+ *
23
+ * This source code is licensed under the MIT license found in the
24
+ * LICENSE file in the root directory of this source tree.
25
+ */var Sx;function gS(){return Sx||(Sx=1,(function(e){function t(U,Z){var P=U.length;U.push(Z);e:for(;0<P;){var M=P-1>>>1,Q=U[M];if(0<a(Q,Z))U[M]=Z,U[P]=Q,P=M;else break e}}function n(U){return U.length===0?null:U[0]}function o(U){if(U.length===0)return null;var Z=U[0],P=U.pop();if(P!==Z){U[0]=P;e:for(var M=0,Q=U.length,I=Q>>>1;M<I;){var ge=2*(M+1)-1,Se=U[ge],te=ge+1,fe=U[te];if(0>a(Se,P))te<Q&&0>a(fe,Se)?(U[M]=fe,U[te]=P,M=te):(U[M]=Se,U[ge]=P,M=ge);else if(te<Q&&0>a(fe,P))U[M]=fe,U[te]=P,M=te;else break e}}return Z}function a(U,Z){var P=U.sortIndex-Z.sortIndex;return P!==0?P:U.id-Z.id}if(typeof performance=="object"&&typeof performance.now=="function"){var l=performance;e.unstable_now=function(){return l.now()}}else{var c=Date,d=c.now();e.unstable_now=function(){return c.now()-d}}var p=[],m=[],h=1,x=null,v=3,b=!1,C=!1,k=!1,j=typeof setTimeout=="function"?setTimeout:null,S=typeof clearTimeout=="function"?clearTimeout:null,R=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function N(U){for(var Z=n(m);Z!==null;){if(Z.callback===null)o(m);else if(Z.startTime<=U)o(m),Z.sortIndex=Z.expirationTime,t(p,Z);else break;Z=n(m)}}function A(U){if(k=!1,N(U),!C)if(n(p)!==null)C=!0,F(O);else{var Z=n(m);Z!==null&&B(A,Z.startTime-U)}}function O(U,Z){C=!1,k&&(k=!1,S(L),L=-1),b=!0;var P=v;try{for(N(Z),x=n(p);x!==null&&(!(x.expirationTime>Z)||U&&!z());){var M=x.callback;if(typeof M=="function"){x.callback=null,v=x.priorityLevel;var Q=M(x.expirationTime<=Z);Z=e.unstable_now(),typeof Q=="function"?x.callback=Q:x===n(p)&&o(p),N(Z)}else o(p);x=n(p)}if(x!==null)var I=!0;else{var ge=n(m);ge!==null&&B(A,ge.startTime-Z),I=!1}return I}finally{x=null,v=P,b=!1}}var T=!1,D=null,L=-1,G=5,re=-1;function z(){return!(e.unstable_now()-re<G)}function K(){if(D!==null){var U=e.unstable_now();re=U;var Z=!0;try{Z=D(!0,U)}finally{Z?q():(T=!1,D=null)}}else T=!1}var q;if(typeof R=="function")q=function(){R(K)};else if(typeof MessageChannel<"u"){var J=new MessageChannel,_=J.port2;J.port1.onmessage=K,q=function(){_.postMessage(null)}}else q=function(){j(K,0)};function F(U){D=U,T||(T=!0,q())}function B(U,Z){L=j(function(){U(e.unstable_now())},Z)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(U){U.callback=null},e.unstable_continueExecution=function(){C||b||(C=!0,F(O))},e.unstable_forceFrameRate=function(U){0>U||125<U?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):G=0<U?Math.floor(1e3/U):5},e.unstable_getCurrentPriorityLevel=function(){return v},e.unstable_getFirstCallbackNode=function(){return n(p)},e.unstable_next=function(U){switch(v){case 1:case 2:case 3:var Z=3;break;default:Z=v}var P=v;v=Z;try{return U()}finally{v=P}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(U,Z){switch(U){case 1:case 2:case 3:case 4:case 5:break;default:U=3}var P=v;v=U;try{return Z()}finally{v=P}},e.unstable_scheduleCallback=function(U,Z,P){var M=e.unstable_now();switch(typeof P=="object"&&P!==null?(P=P.delay,P=typeof P=="number"&&0<P?M+P:M):P=M,U){case 1:var Q=-1;break;case 2:Q=250;break;case 5:Q=1073741823;break;case 4:Q=1e4;break;default:Q=5e3}return Q=P+Q,U={id:h++,callback:Z,priorityLevel:U,startTime:P,expirationTime:Q,sortIndex:-1},P>M?(U.sortIndex=P,t(m,U),n(p)===null&&U===n(m)&&(k?(S(L),L=-1):k=!0,B(A,P-M))):(U.sortIndex=Q,t(p,U),C||b||(C=!0,F(O))),U},e.unstable_shouldYield=z,e.unstable_wrapCallback=function(U){var Z=v;return function(){var P=v;v=Z;try{return U.apply(this,arguments)}finally{v=P}}}})(Xd)),Xd}var Nx;function xS(){return Nx||(Nx=1,Yd.exports=gS()),Yd.exports}/**
26
+ * @license React
27
+ * react-dom.production.min.js
28
+ *
29
+ * Copyright (c) Facebook, Inc. and its affiliates.
30
+ *
31
+ * This source code is licensed under the MIT license found in the
32
+ * LICENSE file in the root directory of this source tree.
33
+ */var Cx;function yS(){if(Cx)return Nn;Cx=1;var e=Cp(),t=xS();function n(r){for(var s="https://reactjs.org/docs/error-decoder.html?invariant="+r,u=1;u<arguments.length;u++)s+="&args[]="+encodeURIComponent(arguments[u]);return"Minified React error #"+r+"; visit "+s+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var o=new Set,a={};function l(r,s){c(r,s),c(r+"Capture",s)}function c(r,s){for(a[r]=s,r=0;r<s.length;r++)o.add(s[r])}var d=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),p=Object.prototype.hasOwnProperty,m=/^[: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]*$/,h={},x={};function v(r){return p.call(x,r)?!0:p.call(h,r)?!1:m.test(r)?x[r]=!0:(h[r]=!0,!1)}function b(r,s,u,f){if(u!==null&&u.type===0)return!1;switch(typeof s){case"function":case"symbol":return!0;case"boolean":return f?!1:u!==null?!u.acceptsBooleans:(r=r.toLowerCase().slice(0,5),r!=="data-"&&r!=="aria-");default:return!1}}function C(r,s,u,f){if(s===null||typeof s>"u"||b(r,s,u,f))return!0;if(f)return!1;if(u!==null)switch(u.type){case 3:return!s;case 4:return s===!1;case 5:return isNaN(s);case 6:return isNaN(s)||1>s}return!1}function k(r,s,u,f,y,w,E){this.acceptsBooleans=s===2||s===3||s===4,this.attributeName=f,this.attributeNamespace=y,this.mustUseProperty=u,this.propertyName=r,this.type=s,this.sanitizeURL=w,this.removeEmptyString=E}var j={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(r){j[r]=new k(r,0,!1,r,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(r){var s=r[0];j[s]=new k(s,1,!1,r[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(r){j[r]=new k(r,2,!1,r.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(r){j[r]=new k(r,2,!1,r,null,!1,!1)}),"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(r){j[r]=new k(r,3,!1,r.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(r){j[r]=new k(r,3,!0,r,null,!1,!1)}),["capture","download"].forEach(function(r){j[r]=new k(r,4,!1,r,null,!1,!1)}),["cols","rows","size","span"].forEach(function(r){j[r]=new k(r,6,!1,r,null,!1,!1)}),["rowSpan","start"].forEach(function(r){j[r]=new k(r,5,!1,r.toLowerCase(),null,!1,!1)});var S=/[\-:]([a-z])/g;function R(r){return r[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(r){var s=r.replace(S,R);j[s]=new k(s,1,!1,r,null,!1,!1)}),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(r){var s=r.replace(S,R);j[s]=new k(s,1,!1,r,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(function(r){var s=r.replace(S,R);j[s]=new k(s,1,!1,r,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(r){j[r]=new k(r,1,!1,r.toLowerCase(),null,!1,!1)}),j.xlinkHref=new k("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(r){j[r]=new k(r,1,!1,r.toLowerCase(),null,!0,!0)});function N(r,s,u,f){var y=j.hasOwnProperty(s)?j[s]:null;(y!==null?y.type!==0:f||!(2<s.length)||s[0]!=="o"&&s[0]!=="O"||s[1]!=="n"&&s[1]!=="N")&&(C(s,u,y,f)&&(u=null),f||y===null?v(s)&&(u===null?r.removeAttribute(s):r.setAttribute(s,""+u)):y.mustUseProperty?r[y.propertyName]=u===null?y.type===3?!1:"":u:(s=y.attributeName,f=y.attributeNamespace,u===null?r.removeAttribute(s):(y=y.type,u=y===3||y===4&&u===!0?"":""+u,f?r.setAttributeNS(f,s,u):r.setAttribute(s,u))))}var A=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,O=Symbol.for("react.element"),T=Symbol.for("react.portal"),D=Symbol.for("react.fragment"),L=Symbol.for("react.strict_mode"),G=Symbol.for("react.profiler"),re=Symbol.for("react.provider"),z=Symbol.for("react.context"),K=Symbol.for("react.forward_ref"),q=Symbol.for("react.suspense"),J=Symbol.for("react.suspense_list"),_=Symbol.for("react.memo"),F=Symbol.for("react.lazy"),B=Symbol.for("react.offscreen"),U=Symbol.iterator;function Z(r){return r===null||typeof r!="object"?null:(r=U&&r[U]||r["@@iterator"],typeof r=="function"?r:null)}var P=Object.assign,M;function Q(r){if(M===void 0)try{throw Error()}catch(u){var s=u.stack.trim().match(/\n( *(at )?)/);M=s&&s[1]||""}return`
34
+ `+M+r}var I=!1;function ge(r,s){if(!r||I)return"";I=!0;var u=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(s)if(s=function(){throw Error()},Object.defineProperty(s.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(s,[])}catch(oe){var f=oe}Reflect.construct(r,[],s)}else{try{s.call()}catch(oe){f=oe}r.call(s.prototype)}else{try{throw Error()}catch(oe){f=oe}r()}}catch(oe){if(oe&&f&&typeof oe.stack=="string"){for(var y=oe.stack.split(`
35
+ `),w=f.stack.split(`
36
+ `),E=y.length-1,$=w.length-1;1<=E&&0<=$&&y[E]!==w[$];)$--;for(;1<=E&&0<=$;E--,$--)if(y[E]!==w[$]){if(E!==1||$!==1)do if(E--,$--,0>$||y[E]!==w[$]){var H=`
37
+ `+y[E].replace(" at new "," at ");return r.displayName&&H.includes("<anonymous>")&&(H=H.replace("<anonymous>",r.displayName)),H}while(1<=E&&0<=$);break}}}finally{I=!1,Error.prepareStackTrace=u}return(r=r?r.displayName||r.name:"")?Q(r):""}function Se(r){switch(r.tag){case 5:return Q(r.type);case 16:return Q("Lazy");case 13:return Q("Suspense");case 19:return Q("SuspenseList");case 0:case 2:case 15:return r=ge(r.type,!1),r;case 11:return r=ge(r.type.render,!1),r;case 1:return r=ge(r.type,!0),r;default:return""}}function te(r){if(r==null)return null;if(typeof r=="function")return r.displayName||r.name||null;if(typeof r=="string")return r;switch(r){case D:return"Fragment";case T:return"Portal";case G:return"Profiler";case L:return"StrictMode";case q:return"Suspense";case J:return"SuspenseList"}if(typeof r=="object")switch(r.$$typeof){case z:return(r.displayName||"Context")+".Consumer";case re:return(r._context.displayName||"Context")+".Provider";case K:var s=r.render;return r=r.displayName,r||(r=s.displayName||s.name||"",r=r!==""?"ForwardRef("+r+")":"ForwardRef"),r;case _:return s=r.displayName||null,s!==null?s:te(r.type)||"Memo";case F:s=r._payload,r=r._init;try{return te(r(s))}catch{}}return null}function fe(r){var s=r.type;switch(r.tag){case 24:return"Cache";case 9:return(s.displayName||"Context")+".Consumer";case 10:return(s._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return r=s.render,r=r.displayName||r.name||"",s.displayName||(r!==""?"ForwardRef("+r+")":"ForwardRef");case 7:return"Fragment";case 5:return s;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return te(s);case 8:return s===L?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof s=="function")return s.displayName||s.name||null;if(typeof s=="string")return s}return null}function ve(r){switch(typeof r){case"boolean":case"number":case"string":case"undefined":return r;case"object":return r;default:return""}}function we(r){var s=r.type;return(r=r.nodeName)&&r.toLowerCase()==="input"&&(s==="checkbox"||s==="radio")}function be(r){var s=we(r)?"checked":"value",u=Object.getOwnPropertyDescriptor(r.constructor.prototype,s),f=""+r[s];if(!r.hasOwnProperty(s)&&typeof u<"u"&&typeof u.get=="function"&&typeof u.set=="function"){var y=u.get,w=u.set;return Object.defineProperty(r,s,{configurable:!0,get:function(){return y.call(this)},set:function(E){f=""+E,w.call(this,E)}}),Object.defineProperty(r,s,{enumerable:u.enumerable}),{getValue:function(){return f},setValue:function(E){f=""+E},stopTracking:function(){r._valueTracker=null,delete r[s]}}}}function Ye(r){r._valueTracker||(r._valueTracker=be(r))}function Xe(r){if(!r)return!1;var s=r._valueTracker;if(!s)return!0;var u=s.getValue(),f="";return r&&(f=we(r)?r.checked?"true":"false":r.value),r=f,r!==u?(s.setValue(r),!0):!1}function ne(r){if(r=r||(typeof document<"u"?document:void 0),typeof r>"u")return null;try{return r.activeElement||r.body}catch{return r.body}}function Y(r,s){var u=s.checked;return P({},s,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:u??r._wrapperState.initialChecked})}function ae(r,s){var u=s.defaultValue==null?"":s.defaultValue,f=s.checked!=null?s.checked:s.defaultChecked;u=ve(s.value!=null?s.value:u),r._wrapperState={initialChecked:f,initialValue:u,controlled:s.type==="checkbox"||s.type==="radio"?s.checked!=null:s.value!=null}}function xe(r,s){s=s.checked,s!=null&&N(r,"checked",s,!1)}function qe(r,s){xe(r,s);var u=ve(s.value),f=s.type;if(u!=null)f==="number"?(u===0&&r.value===""||r.value!=u)&&(r.value=""+u):r.value!==""+u&&(r.value=""+u);else if(f==="submit"||f==="reset"){r.removeAttribute("value");return}s.hasOwnProperty("value")?Be(r,s.type,u):s.hasOwnProperty("defaultValue")&&Be(r,s.type,ve(s.defaultValue)),s.checked==null&&s.defaultChecked!=null&&(r.defaultChecked=!!s.defaultChecked)}function Oe(r,s,u){if(s.hasOwnProperty("value")||s.hasOwnProperty("defaultValue")){var f=s.type;if(!(f!=="submit"&&f!=="reset"||s.value!==void 0&&s.value!==null))return;s=""+r._wrapperState.initialValue,u||s===r.value||(r.value=s),r.defaultValue=s}u=r.name,u!==""&&(r.name=""),r.defaultChecked=!!r._wrapperState.initialChecked,u!==""&&(r.name=u)}function Be(r,s,u){(s!=="number"||ne(r.ownerDocument)!==r)&&(u==null?r.defaultValue=""+r._wrapperState.initialValue:r.defaultValue!==""+u&&(r.defaultValue=""+u))}var Ge=Array.isArray;function jt(r,s,u,f){if(r=r.options,s){s={};for(var y=0;y<u.length;y++)s["$"+u[y]]=!0;for(u=0;u<r.length;u++)y=s.hasOwnProperty("$"+r[u].value),r[u].selected!==y&&(r[u].selected=y),y&&f&&(r[u].defaultSelected=!0)}else{for(u=""+ve(u),s=null,y=0;y<r.length;y++){if(r[y].value===u){r[y].selected=!0,f&&(r[y].defaultSelected=!0);return}s!==null||r[y].disabled||(s=r[y])}s!==null&&(s.selected=!0)}}function St(r,s){if(s.dangerouslySetInnerHTML!=null)throw Error(n(91));return P({},s,{value:void 0,defaultValue:void 0,children:""+r._wrapperState.initialValue})}function Dt(r,s){var u=s.value;if(u==null){if(u=s.children,s=s.defaultValue,u!=null){if(s!=null)throw Error(n(92));if(Ge(u)){if(1<u.length)throw Error(n(93));u=u[0]}s=u}s==null&&(s=""),u=s}r._wrapperState={initialValue:ve(u)}}function Qt(r,s){var u=ve(s.value),f=ve(s.defaultValue);u!=null&&(u=""+u,u!==r.value&&(r.value=u),s.defaultValue==null&&r.defaultValue!==u&&(r.defaultValue=u)),f!=null&&(r.defaultValue=""+f)}function Et(r){var s=r.textContent;s===r._wrapperState.initialValue&&s!==""&&s!==null&&(r.value=s)}function ie(r){switch(r){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function ce(r,s){return r==null||r==="http://www.w3.org/1999/xhtml"?ie(s):r==="http://www.w3.org/2000/svg"&&s==="foreignObject"?"http://www.w3.org/1999/xhtml":r}var ye,se=(function(r){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(s,u,f,y){MSApp.execUnsafeLocalFunction(function(){return r(s,u,f,y)})}:r})(function(r,s){if(r.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in r)r.innerHTML=s;else{for(ye=ye||document.createElement("div"),ye.innerHTML="<svg>"+s.valueOf().toString()+"</svg>",s=ye.firstChild;r.firstChild;)r.removeChild(r.firstChild);for(;s.firstChild;)r.appendChild(s.firstChild)}});function Ne(r,s){if(s){var u=r.firstChild;if(u&&u===r.lastChild&&u.nodeType===3){u.nodeValue=s;return}}r.textContent=s}var Re={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},Ht=["Webkit","ms","Moz","O"];Object.keys(Re).forEach(function(r){Ht.forEach(function(s){s=s+r.charAt(0).toUpperCase()+r.substring(1),Re[s]=Re[r]})});function rn(r,s,u){return s==null||typeof s=="boolean"||s===""?"":u||typeof s!="number"||s===0||Re.hasOwnProperty(r)&&Re[r]?(""+s).trim():s+"px"}function Jt(r,s){r=r.style;for(var u in s)if(s.hasOwnProperty(u)){var f=u.indexOf("--")===0,y=rn(u,s[u],f);u==="float"&&(u="cssFloat"),f?r.setProperty(u,y):r[u]=y}}var V=P({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function pe(r,s){if(s){if(V[r]&&(s.children!=null||s.dangerouslySetInnerHTML!=null))throw Error(n(137,r));if(s.dangerouslySetInnerHTML!=null){if(s.children!=null)throw Error(n(60));if(typeof s.dangerouslySetInnerHTML!="object"||!("__html"in s.dangerouslySetInnerHTML))throw Error(n(61))}if(s.style!=null&&typeof s.style!="object")throw Error(n(62))}}function Ce(r,s){if(r.indexOf("-")===-1)return typeof s.is=="string";switch(r){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 ze=null;function Hn(r){return r=r.target||r.srcElement||window,r.correspondingUseElement&&(r=r.correspondingUseElement),r.nodeType===3?r.parentNode:r}var on=null,xt=null,Ve=null;function ot(r){if(r=Ei(r)){if(typeof on!="function")throw Error(n(280));var s=r.stateNode;s&&(s=nl(s),on(r.stateNode,r.type,s))}}function Pt(r){xt?Ve?Ve.push(r):Ve=[r]:xt=r}function Wt(){if(xt){var r=xt,s=Ve;if(Ve=xt=null,ot(r),s)for(r=0;r<s.length;r++)ot(s[r])}}function Zt(r,s){return r(s)}function sn(){}var vn=!1;function Lr(r,s,u){if(vn)return r(s,u);vn=!0;try{return Zt(r,s,u)}finally{vn=!1,(xt!==null||Ve!==null)&&(sn(),Wt())}}function yt(r,s){var u=r.stateNode;if(u===null)return null;var f=nl(u);if(f===null)return null;u=f[s];e:switch(s){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(f=!f.disabled)||(r=r.type,f=!(r==="button"||r==="input"||r==="select"||r==="textarea")),r=!f;break e;default:r=!1}if(r)return null;if(u&&typeof u!="function")throw Error(n(231,s,typeof u));return u}var Wn=!1;if(d)try{var an={};Object.defineProperty(an,"passive",{get:function(){Wn=!0}}),window.addEventListener("test",an,an),window.removeEventListener("test",an,an)}catch{Wn=!1}function er(r,s,u,f,y,w,E,$,H){var oe=Array.prototype.slice.call(arguments,3);try{s.apply(u,oe)}catch(ue){this.onError(ue)}}var tr=!1,gr=null,Dn=!1,Mr=null,li={onError:function(r){tr=!0,gr=r}};function b1(r,s,u,f,y,w,E,$,H){tr=!1,gr=null,er.apply(li,arguments)}function w1(r,s,u,f,y,w,E,$,H){if(b1.apply(this,arguments),tr){if(tr){var oe=gr;tr=!1,gr=null}else throw Error(n(198));Dn||(Dn=!0,Mr=oe)}}function Io(r){var s=r,u=r;if(r.alternate)for(;s.return;)s=s.return;else{r=s;do s=r,(s.flags&4098)!==0&&(u=s.return),r=s.return;while(r)}return s.tag===3?u:null}function Hh(r){if(r.tag===13){var s=r.memoizedState;if(s===null&&(r=r.alternate,r!==null&&(s=r.memoizedState)),s!==null)return s.dehydrated}return null}function Wh(r){if(Io(r)!==r)throw Error(n(188))}function k1(r){var s=r.alternate;if(!s){if(s=Io(r),s===null)throw Error(n(188));return s!==r?null:r}for(var u=r,f=s;;){var y=u.return;if(y===null)break;var w=y.alternate;if(w===null){if(f=y.return,f!==null){u=f;continue}break}if(y.child===w.child){for(w=y.child;w;){if(w===u)return Wh(y),r;if(w===f)return Wh(y),s;w=w.sibling}throw Error(n(188))}if(u.return!==f.return)u=y,f=w;else{for(var E=!1,$=y.child;$;){if($===u){E=!0,u=y,f=w;break}if($===f){E=!0,f=y,u=w;break}$=$.sibling}if(!E){for($=w.child;$;){if($===u){E=!0,u=w,f=y;break}if($===f){E=!0,f=w,u=y;break}$=$.sibling}if(!E)throw Error(n(189))}}if(u.alternate!==f)throw Error(n(190))}if(u.tag!==3)throw Error(n(188));return u.stateNode.current===u?r:s}function Vh(r){return r=k1(r),r!==null?qh(r):null}function qh(r){if(r.tag===5||r.tag===6)return r;for(r=r.child;r!==null;){var s=qh(r);if(s!==null)return s;r=r.sibling}return null}var Kh=t.unstable_scheduleCallback,Gh=t.unstable_cancelCallback,j1=t.unstable_shouldYield,S1=t.unstable_requestPaint,Tt=t.unstable_now,N1=t.unstable_getCurrentPriorityLevel,fu=t.unstable_ImmediatePriority,Yh=t.unstable_UserBlockingPriority,Ma=t.unstable_NormalPriority,C1=t.unstable_LowPriority,Xh=t.unstable_IdlePriority,_a=null,xr=null;function E1(r){if(xr&&typeof xr.onCommitFiberRoot=="function")try{xr.onCommitFiberRoot(_a,r,void 0,(r.current.flags&128)===128)}catch{}}var nr=Math.clz32?Math.clz32:R1,P1=Math.log,T1=Math.LN2;function R1(r){return r>>>=0,r===0?32:31-(P1(r)/T1|0)|0}var $a=64,Fa=4194304;function ci(r){switch(r&-r){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return r&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return r&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return r}}function za(r,s){var u=r.pendingLanes;if(u===0)return 0;var f=0,y=r.suspendedLanes,w=r.pingedLanes,E=u&268435455;if(E!==0){var $=E&~y;$!==0?f=ci($):(w&=E,w!==0&&(f=ci(w)))}else E=u&~y,E!==0?f=ci(E):w!==0&&(f=ci(w));if(f===0)return 0;if(s!==0&&s!==f&&(s&y)===0&&(y=f&-f,w=s&-s,y>=w||y===16&&(w&4194240)!==0))return s;if((f&4)!==0&&(f|=u&16),s=r.entangledLanes,s!==0)for(r=r.entanglements,s&=f;0<s;)u=31-nr(s),y=1<<u,f|=r[u],s&=~y;return f}function A1(r,s){switch(r){case 1:case 2:case 4:return s+250;case 8:case 16:case 32:case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return s+5e3;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return-1;case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function D1(r,s){for(var u=r.suspendedLanes,f=r.pingedLanes,y=r.expirationTimes,w=r.pendingLanes;0<w;){var E=31-nr(w),$=1<<E,H=y[E];H===-1?(($&u)===0||($&f)!==0)&&(y[E]=A1($,s)):H<=s&&(r.expiredLanes|=$),w&=~$}}function pu(r){return r=r.pendingLanes&-1073741825,r!==0?r:r&1073741824?1073741824:0}function Qh(){var r=$a;return $a<<=1,($a&4194240)===0&&($a=64),r}function hu(r){for(var s=[],u=0;31>u;u++)s.push(r);return s}function ui(r,s,u){r.pendingLanes|=s,s!==536870912&&(r.suspendedLanes=0,r.pingedLanes=0),r=r.eventTimes,s=31-nr(s),r[s]=u}function I1(r,s){var u=r.pendingLanes&~s;r.pendingLanes=s,r.suspendedLanes=0,r.pingedLanes=0,r.expiredLanes&=s,r.mutableReadLanes&=s,r.entangledLanes&=s,s=r.entanglements;var f=r.eventTimes;for(r=r.expirationTimes;0<u;){var y=31-nr(u),w=1<<y;s[y]=0,f[y]=-1,r[y]=-1,u&=~w}}function mu(r,s){var u=r.entangledLanes|=s;for(r=r.entanglements;u;){var f=31-nr(u),y=1<<f;y&s|r[f]&s&&(r[f]|=s),u&=~y}}var tt=0;function Jh(r){return r&=-r,1<r?4<r?(r&268435455)!==0?16:536870912:4:1}var Zh,gu,em,tm,nm,xu=!1,Ba=[],Jr=null,Zr=null,eo=null,di=new Map,fi=new Map,to=[],O1="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset submit".split(" ");function rm(r,s){switch(r){case"focusin":case"focusout":Jr=null;break;case"dragenter":case"dragleave":Zr=null;break;case"mouseover":case"mouseout":eo=null;break;case"pointerover":case"pointerout":di.delete(s.pointerId);break;case"gotpointercapture":case"lostpointercapture":fi.delete(s.pointerId)}}function pi(r,s,u,f,y,w){return r===null||r.nativeEvent!==w?(r={blockedOn:s,domEventName:u,eventSystemFlags:f,nativeEvent:w,targetContainers:[y]},s!==null&&(s=Ei(s),s!==null&&gu(s)),r):(r.eventSystemFlags|=f,s=r.targetContainers,y!==null&&s.indexOf(y)===-1&&s.push(y),r)}function L1(r,s,u,f,y){switch(s){case"focusin":return Jr=pi(Jr,r,s,u,f,y),!0;case"dragenter":return Zr=pi(Zr,r,s,u,f,y),!0;case"mouseover":return eo=pi(eo,r,s,u,f,y),!0;case"pointerover":var w=y.pointerId;return di.set(w,pi(di.get(w)||null,r,s,u,f,y)),!0;case"gotpointercapture":return w=y.pointerId,fi.set(w,pi(fi.get(w)||null,r,s,u,f,y)),!0}return!1}function om(r){var s=Oo(r.target);if(s!==null){var u=Io(s);if(u!==null){if(s=u.tag,s===13){if(s=Hh(u),s!==null){r.blockedOn=s,nm(r.priority,function(){em(u)});return}}else if(s===3&&u.stateNode.current.memoizedState.isDehydrated){r.blockedOn=u.tag===3?u.stateNode.containerInfo:null;return}}}r.blockedOn=null}function Ua(r){if(r.blockedOn!==null)return!1;for(var s=r.targetContainers;0<s.length;){var u=vu(r.domEventName,r.eventSystemFlags,s[0],r.nativeEvent);if(u===null){u=r.nativeEvent;var f=new u.constructor(u.type,u);ze=f,u.target.dispatchEvent(f),ze=null}else return s=Ei(u),s!==null&&gu(s),r.blockedOn=u,!1;s.shift()}return!0}function sm(r,s,u){Ua(r)&&u.delete(s)}function M1(){xu=!1,Jr!==null&&Ua(Jr)&&(Jr=null),Zr!==null&&Ua(Zr)&&(Zr=null),eo!==null&&Ua(eo)&&(eo=null),di.forEach(sm),fi.forEach(sm)}function hi(r,s){r.blockedOn===s&&(r.blockedOn=null,xu||(xu=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,M1)))}function mi(r){function s(y){return hi(y,r)}if(0<Ba.length){hi(Ba[0],r);for(var u=1;u<Ba.length;u++){var f=Ba[u];f.blockedOn===r&&(f.blockedOn=null)}}for(Jr!==null&&hi(Jr,r),Zr!==null&&hi(Zr,r),eo!==null&&hi(eo,r),di.forEach(s),fi.forEach(s),u=0;u<to.length;u++)f=to[u],f.blockedOn===r&&(f.blockedOn=null);for(;0<to.length&&(u=to[0],u.blockedOn===null);)om(u),u.blockedOn===null&&to.shift()}var ss=A.ReactCurrentBatchConfig,Ha=!0;function _1(r,s,u,f){var y=tt,w=ss.transition;ss.transition=null;try{tt=1,yu(r,s,u,f)}finally{tt=y,ss.transition=w}}function $1(r,s,u,f){var y=tt,w=ss.transition;ss.transition=null;try{tt=4,yu(r,s,u,f)}finally{tt=y,ss.transition=w}}function yu(r,s,u,f){if(Ha){var y=vu(r,s,u,f);if(y===null)Mu(r,s,f,Wa,u),rm(r,f);else if(L1(y,r,s,u,f))f.stopPropagation();else if(rm(r,f),s&4&&-1<O1.indexOf(r)){for(;y!==null;){var w=Ei(y);if(w!==null&&Zh(w),w=vu(r,s,u,f),w===null&&Mu(r,s,f,Wa,u),w===y)break;y=w}y!==null&&f.stopPropagation()}else Mu(r,s,f,null,u)}}var Wa=null;function vu(r,s,u,f){if(Wa=null,r=Hn(f),r=Oo(r),r!==null)if(s=Io(r),s===null)r=null;else if(u=s.tag,u===13){if(r=Hh(s),r!==null)return r;r=null}else if(u===3){if(s.stateNode.current.memoizedState.isDehydrated)return s.tag===3?s.stateNode.containerInfo:null;r=null}else s!==r&&(r=null);return Wa=r,null}function im(r){switch(r){case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 1;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"toggle":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 4;case"message":switch(N1()){case fu:return 1;case Yh:return 4;case Ma:case C1:return 16;case Xh:return 536870912;default:return 16}default:return 16}}var no=null,bu=null,Va=null;function am(){if(Va)return Va;var r,s=bu,u=s.length,f,y="value"in no?no.value:no.textContent,w=y.length;for(r=0;r<u&&s[r]===y[r];r++);var E=u-r;for(f=1;f<=E&&s[u-f]===y[w-f];f++);return Va=y.slice(r,1<f?1-f:void 0)}function qa(r){var s=r.keyCode;return"charCode"in r?(r=r.charCode,r===0&&s===13&&(r=13)):r=s,r===10&&(r=13),32<=r||r===13?r:0}function Ka(){return!0}function lm(){return!1}function In(r){function s(u,f,y,w,E){this._reactName=u,this._targetInst=y,this.type=f,this.nativeEvent=w,this.target=E,this.currentTarget=null;for(var $ in r)r.hasOwnProperty($)&&(u=r[$],this[$]=u?u(w):w[$]);return this.isDefaultPrevented=(w.defaultPrevented!=null?w.defaultPrevented:w.returnValue===!1)?Ka:lm,this.isPropagationStopped=lm,this}return P(s.prototype,{preventDefault:function(){this.defaultPrevented=!0;var u=this.nativeEvent;u&&(u.preventDefault?u.preventDefault():typeof u.returnValue!="unknown"&&(u.returnValue=!1),this.isDefaultPrevented=Ka)},stopPropagation:function(){var u=this.nativeEvent;u&&(u.stopPropagation?u.stopPropagation():typeof u.cancelBubble!="unknown"&&(u.cancelBubble=!0),this.isPropagationStopped=Ka)},persist:function(){},isPersistent:Ka}),s}var is={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(r){return r.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},wu=In(is),gi=P({},is,{view:0,detail:0}),F1=In(gi),ku,ju,xi,Ga=P({},gi,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Nu,button:0,buttons:0,relatedTarget:function(r){return r.relatedTarget===void 0?r.fromElement===r.srcElement?r.toElement:r.fromElement:r.relatedTarget},movementX:function(r){return"movementX"in r?r.movementX:(r!==xi&&(xi&&r.type==="mousemove"?(ku=r.screenX-xi.screenX,ju=r.screenY-xi.screenY):ju=ku=0,xi=r),ku)},movementY:function(r){return"movementY"in r?r.movementY:ju}}),cm=In(Ga),z1=P({},Ga,{dataTransfer:0}),B1=In(z1),U1=P({},gi,{relatedTarget:0}),Su=In(U1),H1=P({},is,{animationName:0,elapsedTime:0,pseudoElement:0}),W1=In(H1),V1=P({},is,{clipboardData:function(r){return"clipboardData"in r?r.clipboardData:window.clipboardData}}),q1=In(V1),K1=P({},is,{data:0}),um=In(K1),G1={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Y1={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"},X1={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Q1(r){var s=this.nativeEvent;return s.getModifierState?s.getModifierState(r):(r=X1[r])?!!s[r]:!1}function Nu(){return Q1}var J1=P({},gi,{key:function(r){if(r.key){var s=G1[r.key]||r.key;if(s!=="Unidentified")return s}return r.type==="keypress"?(r=qa(r),r===13?"Enter":String.fromCharCode(r)):r.type==="keydown"||r.type==="keyup"?Y1[r.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Nu,charCode:function(r){return r.type==="keypress"?qa(r):0},keyCode:function(r){return r.type==="keydown"||r.type==="keyup"?r.keyCode:0},which:function(r){return r.type==="keypress"?qa(r):r.type==="keydown"||r.type==="keyup"?r.keyCode:0}}),Z1=In(J1),ej=P({},Ga,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),dm=In(ej),tj=P({},gi,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Nu}),nj=In(tj),rj=P({},is,{propertyName:0,elapsedTime:0,pseudoElement:0}),oj=In(rj),sj=P({},Ga,{deltaX:function(r){return"deltaX"in r?r.deltaX:"wheelDeltaX"in r?-r.wheelDeltaX:0},deltaY:function(r){return"deltaY"in r?r.deltaY:"wheelDeltaY"in r?-r.wheelDeltaY:"wheelDelta"in r?-r.wheelDelta:0},deltaZ:0,deltaMode:0}),ij=In(sj),aj=[9,13,27,32],Cu=d&&"CompositionEvent"in window,yi=null;d&&"documentMode"in document&&(yi=document.documentMode);var lj=d&&"TextEvent"in window&&!yi,fm=d&&(!Cu||yi&&8<yi&&11>=yi),pm=" ",hm=!1;function mm(r,s){switch(r){case"keyup":return aj.indexOf(s.keyCode)!==-1;case"keydown":return s.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function gm(r){return r=r.detail,typeof r=="object"&&"data"in r?r.data:null}var as=!1;function cj(r,s){switch(r){case"compositionend":return gm(s);case"keypress":return s.which!==32?null:(hm=!0,pm);case"textInput":return r=s.data,r===pm&&hm?null:r;default:return null}}function uj(r,s){if(as)return r==="compositionend"||!Cu&&mm(r,s)?(r=am(),Va=bu=no=null,as=!1,r):null;switch(r){case"paste":return null;case"keypress":if(!(s.ctrlKey||s.altKey||s.metaKey)||s.ctrlKey&&s.altKey){if(s.char&&1<s.char.length)return s.char;if(s.which)return String.fromCharCode(s.which)}return null;case"compositionend":return fm&&s.locale!=="ko"?null:s.data;default:return null}}var dj={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 xm(r){var s=r&&r.nodeName&&r.nodeName.toLowerCase();return s==="input"?!!dj[r.type]:s==="textarea"}function ym(r,s,u,f){Pt(f),s=Za(s,"onChange"),0<s.length&&(u=new wu("onChange","change",null,u,f),r.push({event:u,listeners:s}))}var vi=null,bi=null;function fj(r){Mm(r,0)}function Ya(r){var s=fs(r);if(Xe(s))return r}function pj(r,s){if(r==="change")return s}var vm=!1;if(d){var Eu;if(d){var Pu="oninput"in document;if(!Pu){var bm=document.createElement("div");bm.setAttribute("oninput","return;"),Pu=typeof bm.oninput=="function"}Eu=Pu}else Eu=!1;vm=Eu&&(!document.documentMode||9<document.documentMode)}function wm(){vi&&(vi.detachEvent("onpropertychange",km),bi=vi=null)}function km(r){if(r.propertyName==="value"&&Ya(bi)){var s=[];ym(s,bi,r,Hn(r)),Lr(fj,s)}}function hj(r,s,u){r==="focusin"?(wm(),vi=s,bi=u,vi.attachEvent("onpropertychange",km)):r==="focusout"&&wm()}function mj(r){if(r==="selectionchange"||r==="keyup"||r==="keydown")return Ya(bi)}function gj(r,s){if(r==="click")return Ya(s)}function xj(r,s){if(r==="input"||r==="change")return Ya(s)}function yj(r,s){return r===s&&(r!==0||1/r===1/s)||r!==r&&s!==s}var rr=typeof Object.is=="function"?Object.is:yj;function wi(r,s){if(rr(r,s))return!0;if(typeof r!="object"||r===null||typeof s!="object"||s===null)return!1;var u=Object.keys(r),f=Object.keys(s);if(u.length!==f.length)return!1;for(f=0;f<u.length;f++){var y=u[f];if(!p.call(s,y)||!rr(r[y],s[y]))return!1}return!0}function jm(r){for(;r&&r.firstChild;)r=r.firstChild;return r}function Sm(r,s){var u=jm(r);r=0;for(var f;u;){if(u.nodeType===3){if(f=r+u.textContent.length,r<=s&&f>=s)return{node:u,offset:s-r};r=f}e:{for(;u;){if(u.nextSibling){u=u.nextSibling;break e}u=u.parentNode}u=void 0}u=jm(u)}}function Nm(r,s){return r&&s?r===s?!0:r&&r.nodeType===3?!1:s&&s.nodeType===3?Nm(r,s.parentNode):"contains"in r?r.contains(s):r.compareDocumentPosition?!!(r.compareDocumentPosition(s)&16):!1:!1}function Cm(){for(var r=window,s=ne();s instanceof r.HTMLIFrameElement;){try{var u=typeof s.contentWindow.location.href=="string"}catch{u=!1}if(u)r=s.contentWindow;else break;s=ne(r.document)}return s}function Tu(r){var s=r&&r.nodeName&&r.nodeName.toLowerCase();return s&&(s==="input"&&(r.type==="text"||r.type==="search"||r.type==="tel"||r.type==="url"||r.type==="password")||s==="textarea"||r.contentEditable==="true")}function vj(r){var s=Cm(),u=r.focusedElem,f=r.selectionRange;if(s!==u&&u&&u.ownerDocument&&Nm(u.ownerDocument.documentElement,u)){if(f!==null&&Tu(u)){if(s=f.start,r=f.end,r===void 0&&(r=s),"selectionStart"in u)u.selectionStart=s,u.selectionEnd=Math.min(r,u.value.length);else if(r=(s=u.ownerDocument||document)&&s.defaultView||window,r.getSelection){r=r.getSelection();var y=u.textContent.length,w=Math.min(f.start,y);f=f.end===void 0?w:Math.min(f.end,y),!r.extend&&w>f&&(y=f,f=w,w=y),y=Sm(u,w);var E=Sm(u,f);y&&E&&(r.rangeCount!==1||r.anchorNode!==y.node||r.anchorOffset!==y.offset||r.focusNode!==E.node||r.focusOffset!==E.offset)&&(s=s.createRange(),s.setStart(y.node,y.offset),r.removeAllRanges(),w>f?(r.addRange(s),r.extend(E.node,E.offset)):(s.setEnd(E.node,E.offset),r.addRange(s)))}}for(s=[],r=u;r=r.parentNode;)r.nodeType===1&&s.push({element:r,left:r.scrollLeft,top:r.scrollTop});for(typeof u.focus=="function"&&u.focus(),u=0;u<s.length;u++)r=s[u],r.element.scrollLeft=r.left,r.element.scrollTop=r.top}}var bj=d&&"documentMode"in document&&11>=document.documentMode,ls=null,Ru=null,ki=null,Au=!1;function Em(r,s,u){var f=u.window===u?u.document:u.nodeType===9?u:u.ownerDocument;Au||ls==null||ls!==ne(f)||(f=ls,"selectionStart"in f&&Tu(f)?f={start:f.selectionStart,end:f.selectionEnd}:(f=(f.ownerDocument&&f.ownerDocument.defaultView||window).getSelection(),f={anchorNode:f.anchorNode,anchorOffset:f.anchorOffset,focusNode:f.focusNode,focusOffset:f.focusOffset}),ki&&wi(ki,f)||(ki=f,f=Za(Ru,"onSelect"),0<f.length&&(s=new wu("onSelect","select",null,s,u),r.push({event:s,listeners:f}),s.target=ls)))}function Xa(r,s){var u={};return u[r.toLowerCase()]=s.toLowerCase(),u["Webkit"+r]="webkit"+s,u["Moz"+r]="moz"+s,u}var cs={animationend:Xa("Animation","AnimationEnd"),animationiteration:Xa("Animation","AnimationIteration"),animationstart:Xa("Animation","AnimationStart"),transitionend:Xa("Transition","TransitionEnd")},Du={},Pm={};d&&(Pm=document.createElement("div").style,"AnimationEvent"in window||(delete cs.animationend.animation,delete cs.animationiteration.animation,delete cs.animationstart.animation),"TransitionEvent"in window||delete cs.transitionend.transition);function Qa(r){if(Du[r])return Du[r];if(!cs[r])return r;var s=cs[r],u;for(u in s)if(s.hasOwnProperty(u)&&u in Pm)return Du[r]=s[u];return r}var Tm=Qa("animationend"),Rm=Qa("animationiteration"),Am=Qa("animationstart"),Dm=Qa("transitionend"),Im=new Map,Om="abort auxClick cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");function ro(r,s){Im.set(r,s),l(s,[r])}for(var Iu=0;Iu<Om.length;Iu++){var Ou=Om[Iu],wj=Ou.toLowerCase(),kj=Ou[0].toUpperCase()+Ou.slice(1);ro(wj,"on"+kj)}ro(Tm,"onAnimationEnd"),ro(Rm,"onAnimationIteration"),ro(Am,"onAnimationStart"),ro("dblclick","onDoubleClick"),ro("focusin","onFocus"),ro("focusout","onBlur"),ro(Dm,"onTransitionEnd"),c("onMouseEnter",["mouseout","mouseover"]),c("onMouseLeave",["mouseout","mouseover"]),c("onPointerEnter",["pointerout","pointerover"]),c("onPointerLeave",["pointerout","pointerover"]),l("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),l("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),l("onBeforeInput",["compositionend","keypress","textInput","paste"]),l("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),l("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),l("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var ji="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(" "),jj=new Set("cancel close invalid load scroll toggle".split(" ").concat(ji));function Lm(r,s,u){var f=r.type||"unknown-event";r.currentTarget=u,w1(f,s,void 0,r),r.currentTarget=null}function Mm(r,s){s=(s&4)!==0;for(var u=0;u<r.length;u++){var f=r[u],y=f.event;f=f.listeners;e:{var w=void 0;if(s)for(var E=f.length-1;0<=E;E--){var $=f[E],H=$.instance,oe=$.currentTarget;if($=$.listener,H!==w&&y.isPropagationStopped())break e;Lm(y,$,oe),w=H}else for(E=0;E<f.length;E++){if($=f[E],H=$.instance,oe=$.currentTarget,$=$.listener,H!==w&&y.isPropagationStopped())break e;Lm(y,$,oe),w=H}}}if(Dn)throw r=Mr,Dn=!1,Mr=null,r}function ct(r,s){var u=s[Uu];u===void 0&&(u=s[Uu]=new Set);var f=r+"__bubble";u.has(f)||(_m(s,r,2,!1),u.add(f))}function Lu(r,s,u){var f=0;s&&(f|=4),_m(u,r,f,s)}var Ja="_reactListening"+Math.random().toString(36).slice(2);function Si(r){if(!r[Ja]){r[Ja]=!0,o.forEach(function(u){u!=="selectionchange"&&(jj.has(u)||Lu(u,!1,r),Lu(u,!0,r))});var s=r.nodeType===9?r:r.ownerDocument;s===null||s[Ja]||(s[Ja]=!0,Lu("selectionchange",!1,s))}}function _m(r,s,u,f){switch(im(s)){case 1:var y=_1;break;case 4:y=$1;break;default:y=yu}u=y.bind(null,s,u,r),y=void 0,!Wn||s!=="touchstart"&&s!=="touchmove"&&s!=="wheel"||(y=!0),f?y!==void 0?r.addEventListener(s,u,{capture:!0,passive:y}):r.addEventListener(s,u,!0):y!==void 0?r.addEventListener(s,u,{passive:y}):r.addEventListener(s,u,!1)}function Mu(r,s,u,f,y){var w=f;if((s&1)===0&&(s&2)===0&&f!==null)e:for(;;){if(f===null)return;var E=f.tag;if(E===3||E===4){var $=f.stateNode.containerInfo;if($===y||$.nodeType===8&&$.parentNode===y)break;if(E===4)for(E=f.return;E!==null;){var H=E.tag;if((H===3||H===4)&&(H=E.stateNode.containerInfo,H===y||H.nodeType===8&&H.parentNode===y))return;E=E.return}for(;$!==null;){if(E=Oo($),E===null)return;if(H=E.tag,H===5||H===6){f=w=E;continue e}$=$.parentNode}}f=f.return}Lr(function(){var oe=w,ue=Hn(u),de=[];e:{var le=Im.get(r);if(le!==void 0){var ke=wu,Pe=r;switch(r){case"keypress":if(qa(u)===0)break e;case"keydown":case"keyup":ke=Z1;break;case"focusin":Pe="focus",ke=Su;break;case"focusout":Pe="blur",ke=Su;break;case"beforeblur":case"afterblur":ke=Su;break;case"click":if(u.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":ke=cm;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":ke=B1;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":ke=nj;break;case Tm:case Rm:case Am:ke=W1;break;case Dm:ke=oj;break;case"scroll":ke=F1;break;case"wheel":ke=ij;break;case"copy":case"cut":case"paste":ke=q1;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":ke=dm}var Te=(s&4)!==0,Rt=!Te&&r==="scroll",X=Te?le!==null?le+"Capture":null:le;Te=[];for(var W=oe,ee;W!==null;){ee=W;var me=ee.stateNode;if(ee.tag===5&&me!==null&&(ee=me,X!==null&&(me=yt(W,X),me!=null&&Te.push(Ni(W,me,ee)))),Rt)break;W=W.return}0<Te.length&&(le=new ke(le,Pe,null,u,ue),de.push({event:le,listeners:Te}))}}if((s&7)===0){e:{if(le=r==="mouseover"||r==="pointerover",ke=r==="mouseout"||r==="pointerout",le&&u!==ze&&(Pe=u.relatedTarget||u.fromElement)&&(Oo(Pe)||Pe[_r]))break e;if((ke||le)&&(le=ue.window===ue?ue:(le=ue.ownerDocument)?le.defaultView||le.parentWindow:window,ke?(Pe=u.relatedTarget||u.toElement,ke=oe,Pe=Pe?Oo(Pe):null,Pe!==null&&(Rt=Io(Pe),Pe!==Rt||Pe.tag!==5&&Pe.tag!==6)&&(Pe=null)):(ke=null,Pe=oe),ke!==Pe)){if(Te=cm,me="onMouseLeave",X="onMouseEnter",W="mouse",(r==="pointerout"||r==="pointerover")&&(Te=dm,me="onPointerLeave",X="onPointerEnter",W="pointer"),Rt=ke==null?le:fs(ke),ee=Pe==null?le:fs(Pe),le=new Te(me,W+"leave",ke,u,ue),le.target=Rt,le.relatedTarget=ee,me=null,Oo(ue)===oe&&(Te=new Te(X,W+"enter",Pe,u,ue),Te.target=ee,Te.relatedTarget=Rt,me=Te),Rt=me,ke&&Pe)t:{for(Te=ke,X=Pe,W=0,ee=Te;ee;ee=us(ee))W++;for(ee=0,me=X;me;me=us(me))ee++;for(;0<W-ee;)Te=us(Te),W--;for(;0<ee-W;)X=us(X),ee--;for(;W--;){if(Te===X||X!==null&&Te===X.alternate)break t;Te=us(Te),X=us(X)}Te=null}else Te=null;ke!==null&&$m(de,le,ke,Te,!1),Pe!==null&&Rt!==null&&$m(de,Rt,Pe,Te,!0)}}e:{if(le=oe?fs(oe):window,ke=le.nodeName&&le.nodeName.toLowerCase(),ke==="select"||ke==="input"&&le.type==="file")var Ae=pj;else if(xm(le))if(vm)Ae=xj;else{Ae=mj;var Le=hj}else(ke=le.nodeName)&&ke.toLowerCase()==="input"&&(le.type==="checkbox"||le.type==="radio")&&(Ae=gj);if(Ae&&(Ae=Ae(r,oe))){ym(de,Ae,u,ue);break e}Le&&Le(r,le,oe),r==="focusout"&&(Le=le._wrapperState)&&Le.controlled&&le.type==="number"&&Be(le,"number",le.value)}switch(Le=oe?fs(oe):window,r){case"focusin":(xm(Le)||Le.contentEditable==="true")&&(ls=Le,Ru=oe,ki=null);break;case"focusout":ki=Ru=ls=null;break;case"mousedown":Au=!0;break;case"contextmenu":case"mouseup":case"dragend":Au=!1,Em(de,u,ue);break;case"selectionchange":if(bj)break;case"keydown":case"keyup":Em(de,u,ue)}var Me;if(Cu)e:{switch(r){case"compositionstart":var $e="onCompositionStart";break e;case"compositionend":$e="onCompositionEnd";break e;case"compositionupdate":$e="onCompositionUpdate";break e}$e=void 0}else as?mm(r,u)&&($e="onCompositionEnd"):r==="keydown"&&u.keyCode===229&&($e="onCompositionStart");$e&&(fm&&u.locale!=="ko"&&(as||$e!=="onCompositionStart"?$e==="onCompositionEnd"&&as&&(Me=am()):(no=ue,bu="value"in no?no.value:no.textContent,as=!0)),Le=Za(oe,$e),0<Le.length&&($e=new um($e,r,null,u,ue),de.push({event:$e,listeners:Le}),Me?$e.data=Me:(Me=gm(u),Me!==null&&($e.data=Me)))),(Me=lj?cj(r,u):uj(r,u))&&(oe=Za(oe,"onBeforeInput"),0<oe.length&&(ue=new um("onBeforeInput","beforeinput",null,u,ue),de.push({event:ue,listeners:oe}),ue.data=Me))}Mm(de,s)})}function Ni(r,s,u){return{instance:r,listener:s,currentTarget:u}}function Za(r,s){for(var u=s+"Capture",f=[];r!==null;){var y=r,w=y.stateNode;y.tag===5&&w!==null&&(y=w,w=yt(r,u),w!=null&&f.unshift(Ni(r,w,y)),w=yt(r,s),w!=null&&f.push(Ni(r,w,y))),r=r.return}return f}function us(r){if(r===null)return null;do r=r.return;while(r&&r.tag!==5);return r||null}function $m(r,s,u,f,y){for(var w=s._reactName,E=[];u!==null&&u!==f;){var $=u,H=$.alternate,oe=$.stateNode;if(H!==null&&H===f)break;$.tag===5&&oe!==null&&($=oe,y?(H=yt(u,w),H!=null&&E.unshift(Ni(u,H,$))):y||(H=yt(u,w),H!=null&&E.push(Ni(u,H,$)))),u=u.return}E.length!==0&&r.push({event:s,listeners:E})}var Sj=/\r\n?/g,Nj=/\u0000|\uFFFD/g;function Fm(r){return(typeof r=="string"?r:""+r).replace(Sj,`
38
+ `).replace(Nj,"")}function el(r,s,u){if(s=Fm(s),Fm(r)!==s&&u)throw Error(n(425))}function tl(){}var _u=null,$u=null;function Fu(r,s){return r==="textarea"||r==="noscript"||typeof s.children=="string"||typeof s.children=="number"||typeof s.dangerouslySetInnerHTML=="object"&&s.dangerouslySetInnerHTML!==null&&s.dangerouslySetInnerHTML.__html!=null}var zu=typeof setTimeout=="function"?setTimeout:void 0,Cj=typeof clearTimeout=="function"?clearTimeout:void 0,zm=typeof Promise=="function"?Promise:void 0,Ej=typeof queueMicrotask=="function"?queueMicrotask:typeof zm<"u"?function(r){return zm.resolve(null).then(r).catch(Pj)}:zu;function Pj(r){setTimeout(function(){throw r})}function Bu(r,s){var u=s,f=0;do{var y=u.nextSibling;if(r.removeChild(u),y&&y.nodeType===8)if(u=y.data,u==="/$"){if(f===0){r.removeChild(y),mi(s);return}f--}else u!=="$"&&u!=="$?"&&u!=="$!"||f++;u=y}while(u);mi(s)}function oo(r){for(;r!=null;r=r.nextSibling){var s=r.nodeType;if(s===1||s===3)break;if(s===8){if(s=r.data,s==="$"||s==="$!"||s==="$?")break;if(s==="/$")return null}}return r}function Bm(r){r=r.previousSibling;for(var s=0;r;){if(r.nodeType===8){var u=r.data;if(u==="$"||u==="$!"||u==="$?"){if(s===0)return r;s--}else u==="/$"&&s++}r=r.previousSibling}return null}var ds=Math.random().toString(36).slice(2),yr="__reactFiber$"+ds,Ci="__reactProps$"+ds,_r="__reactContainer$"+ds,Uu="__reactEvents$"+ds,Tj="__reactListeners$"+ds,Rj="__reactHandles$"+ds;function Oo(r){var s=r[yr];if(s)return s;for(var u=r.parentNode;u;){if(s=u[_r]||u[yr]){if(u=s.alternate,s.child!==null||u!==null&&u.child!==null)for(r=Bm(r);r!==null;){if(u=r[yr])return u;r=Bm(r)}return s}r=u,u=r.parentNode}return null}function Ei(r){return r=r[yr]||r[_r],!r||r.tag!==5&&r.tag!==6&&r.tag!==13&&r.tag!==3?null:r}function fs(r){if(r.tag===5||r.tag===6)return r.stateNode;throw Error(n(33))}function nl(r){return r[Ci]||null}var Hu=[],ps=-1;function so(r){return{current:r}}function ut(r){0>ps||(r.current=Hu[ps],Hu[ps]=null,ps--)}function st(r,s){ps++,Hu[ps]=r.current,r.current=s}var io={},ln=so(io),bn=so(!1),Lo=io;function hs(r,s){var u=r.type.contextTypes;if(!u)return io;var f=r.stateNode;if(f&&f.__reactInternalMemoizedUnmaskedChildContext===s)return f.__reactInternalMemoizedMaskedChildContext;var y={},w;for(w in u)y[w]=s[w];return f&&(r=r.stateNode,r.__reactInternalMemoizedUnmaskedChildContext=s,r.__reactInternalMemoizedMaskedChildContext=y),y}function wn(r){return r=r.childContextTypes,r!=null}function rl(){ut(bn),ut(ln)}function Um(r,s,u){if(ln.current!==io)throw Error(n(168));st(ln,s),st(bn,u)}function Hm(r,s,u){var f=r.stateNode;if(s=s.childContextTypes,typeof f.getChildContext!="function")return u;f=f.getChildContext();for(var y in f)if(!(y in s))throw Error(n(108,fe(r)||"Unknown",y));return P({},u,f)}function ol(r){return r=(r=r.stateNode)&&r.__reactInternalMemoizedMergedChildContext||io,Lo=ln.current,st(ln,r),st(bn,bn.current),!0}function Wm(r,s,u){var f=r.stateNode;if(!f)throw Error(n(169));u?(r=Hm(r,s,Lo),f.__reactInternalMemoizedMergedChildContext=r,ut(bn),ut(ln),st(ln,r)):ut(bn),st(bn,u)}var $r=null,sl=!1,Wu=!1;function Vm(r){$r===null?$r=[r]:$r.push(r)}function Aj(r){sl=!0,Vm(r)}function ao(){if(!Wu&&$r!==null){Wu=!0;var r=0,s=tt;try{var u=$r;for(tt=1;r<u.length;r++){var f=u[r];do f=f(!0);while(f!==null)}$r=null,sl=!1}catch(y){throw $r!==null&&($r=$r.slice(r+1)),Kh(fu,ao),y}finally{tt=s,Wu=!1}}return null}var ms=[],gs=0,il=null,al=0,Vn=[],qn=0,Mo=null,Fr=1,zr="";function _o(r,s){ms[gs++]=al,ms[gs++]=il,il=r,al=s}function qm(r,s,u){Vn[qn++]=Fr,Vn[qn++]=zr,Vn[qn++]=Mo,Mo=r;var f=Fr;r=zr;var y=32-nr(f)-1;f&=~(1<<y),u+=1;var w=32-nr(s)+y;if(30<w){var E=y-y%5;w=(f&(1<<E)-1).toString(32),f>>=E,y-=E,Fr=1<<32-nr(s)+y|u<<y|f,zr=w+r}else Fr=1<<w|u<<y|f,zr=r}function Vu(r){r.return!==null&&(_o(r,1),qm(r,1,0))}function qu(r){for(;r===il;)il=ms[--gs],ms[gs]=null,al=ms[--gs],ms[gs]=null;for(;r===Mo;)Mo=Vn[--qn],Vn[qn]=null,zr=Vn[--qn],Vn[qn]=null,Fr=Vn[--qn],Vn[qn]=null}var On=null,Ln=null,ft=!1,or=null;function Km(r,s){var u=Xn(5,null,null,0);u.elementType="DELETED",u.stateNode=s,u.return=r,s=r.deletions,s===null?(r.deletions=[u],r.flags|=16):s.push(u)}function Gm(r,s){switch(r.tag){case 5:var u=r.type;return s=s.nodeType!==1||u.toLowerCase()!==s.nodeName.toLowerCase()?null:s,s!==null?(r.stateNode=s,On=r,Ln=oo(s.firstChild),!0):!1;case 6:return s=r.pendingProps===""||s.nodeType!==3?null:s,s!==null?(r.stateNode=s,On=r,Ln=null,!0):!1;case 13:return s=s.nodeType!==8?null:s,s!==null?(u=Mo!==null?{id:Fr,overflow:zr}:null,r.memoizedState={dehydrated:s,treeContext:u,retryLane:1073741824},u=Xn(18,null,null,0),u.stateNode=s,u.return=r,r.child=u,On=r,Ln=null,!0):!1;default:return!1}}function Ku(r){return(r.mode&1)!==0&&(r.flags&128)===0}function Gu(r){if(ft){var s=Ln;if(s){var u=s;if(!Gm(r,s)){if(Ku(r))throw Error(n(418));s=oo(u.nextSibling);var f=On;s&&Gm(r,s)?Km(f,u):(r.flags=r.flags&-4097|2,ft=!1,On=r)}}else{if(Ku(r))throw Error(n(418));r.flags=r.flags&-4097|2,ft=!1,On=r}}}function Ym(r){for(r=r.return;r!==null&&r.tag!==5&&r.tag!==3&&r.tag!==13;)r=r.return;On=r}function ll(r){if(r!==On)return!1;if(!ft)return Ym(r),ft=!0,!1;var s;if((s=r.tag!==3)&&!(s=r.tag!==5)&&(s=r.type,s=s!=="head"&&s!=="body"&&!Fu(r.type,r.memoizedProps)),s&&(s=Ln)){if(Ku(r))throw Xm(),Error(n(418));for(;s;)Km(r,s),s=oo(s.nextSibling)}if(Ym(r),r.tag===13){if(r=r.memoizedState,r=r!==null?r.dehydrated:null,!r)throw Error(n(317));e:{for(r=r.nextSibling,s=0;r;){if(r.nodeType===8){var u=r.data;if(u==="/$"){if(s===0){Ln=oo(r.nextSibling);break e}s--}else u!=="$"&&u!=="$!"&&u!=="$?"||s++}r=r.nextSibling}Ln=null}}else Ln=On?oo(r.stateNode.nextSibling):null;return!0}function Xm(){for(var r=Ln;r;)r=oo(r.nextSibling)}function xs(){Ln=On=null,ft=!1}function Yu(r){or===null?or=[r]:or.push(r)}var Dj=A.ReactCurrentBatchConfig;function Pi(r,s,u){if(r=u.ref,r!==null&&typeof r!="function"&&typeof r!="object"){if(u._owner){if(u=u._owner,u){if(u.tag!==1)throw Error(n(309));var f=u.stateNode}if(!f)throw Error(n(147,r));var y=f,w=""+r;return s!==null&&s.ref!==null&&typeof s.ref=="function"&&s.ref._stringRef===w?s.ref:(s=function(E){var $=y.refs;E===null?delete $[w]:$[w]=E},s._stringRef=w,s)}if(typeof r!="string")throw Error(n(284));if(!u._owner)throw Error(n(290,r))}return r}function cl(r,s){throw r=Object.prototype.toString.call(s),Error(n(31,r==="[object Object]"?"object with keys {"+Object.keys(s).join(", ")+"}":r))}function Qm(r){var s=r._init;return s(r._payload)}function Jm(r){function s(X,W){if(r){var ee=X.deletions;ee===null?(X.deletions=[W],X.flags|=16):ee.push(W)}}function u(X,W){if(!r)return null;for(;W!==null;)s(X,W),W=W.sibling;return null}function f(X,W){for(X=new Map;W!==null;)W.key!==null?X.set(W.key,W):X.set(W.index,W),W=W.sibling;return X}function y(X,W){return X=go(X,W),X.index=0,X.sibling=null,X}function w(X,W,ee){return X.index=ee,r?(ee=X.alternate,ee!==null?(ee=ee.index,ee<W?(X.flags|=2,W):ee):(X.flags|=2,W)):(X.flags|=1048576,W)}function E(X){return r&&X.alternate===null&&(X.flags|=2),X}function $(X,W,ee,me){return W===null||W.tag!==6?(W=zd(ee,X.mode,me),W.return=X,W):(W=y(W,ee),W.return=X,W)}function H(X,W,ee,me){var Ae=ee.type;return Ae===D?ue(X,W,ee.props.children,me,ee.key):W!==null&&(W.elementType===Ae||typeof Ae=="object"&&Ae!==null&&Ae.$$typeof===F&&Qm(Ae)===W.type)?(me=y(W,ee.props),me.ref=Pi(X,W,ee),me.return=X,me):(me=Il(ee.type,ee.key,ee.props,null,X.mode,me),me.ref=Pi(X,W,ee),me.return=X,me)}function oe(X,W,ee,me){return W===null||W.tag!==4||W.stateNode.containerInfo!==ee.containerInfo||W.stateNode.implementation!==ee.implementation?(W=Bd(ee,X.mode,me),W.return=X,W):(W=y(W,ee.children||[]),W.return=X,W)}function ue(X,W,ee,me,Ae){return W===null||W.tag!==7?(W=Vo(ee,X.mode,me,Ae),W.return=X,W):(W=y(W,ee),W.return=X,W)}function de(X,W,ee){if(typeof W=="string"&&W!==""||typeof W=="number")return W=zd(""+W,X.mode,ee),W.return=X,W;if(typeof W=="object"&&W!==null){switch(W.$$typeof){case O:return ee=Il(W.type,W.key,W.props,null,X.mode,ee),ee.ref=Pi(X,null,W),ee.return=X,ee;case T:return W=Bd(W,X.mode,ee),W.return=X,W;case F:var me=W._init;return de(X,me(W._payload),ee)}if(Ge(W)||Z(W))return W=Vo(W,X.mode,ee,null),W.return=X,W;cl(X,W)}return null}function le(X,W,ee,me){var Ae=W!==null?W.key:null;if(typeof ee=="string"&&ee!==""||typeof ee=="number")return Ae!==null?null:$(X,W,""+ee,me);if(typeof ee=="object"&&ee!==null){switch(ee.$$typeof){case O:return ee.key===Ae?H(X,W,ee,me):null;case T:return ee.key===Ae?oe(X,W,ee,me):null;case F:return Ae=ee._init,le(X,W,Ae(ee._payload),me)}if(Ge(ee)||Z(ee))return Ae!==null?null:ue(X,W,ee,me,null);cl(X,ee)}return null}function ke(X,W,ee,me,Ae){if(typeof me=="string"&&me!==""||typeof me=="number")return X=X.get(ee)||null,$(W,X,""+me,Ae);if(typeof me=="object"&&me!==null){switch(me.$$typeof){case O:return X=X.get(me.key===null?ee:me.key)||null,H(W,X,me,Ae);case T:return X=X.get(me.key===null?ee:me.key)||null,oe(W,X,me,Ae);case F:var Le=me._init;return ke(X,W,ee,Le(me._payload),Ae)}if(Ge(me)||Z(me))return X=X.get(ee)||null,ue(W,X,me,Ae,null);cl(W,me)}return null}function Pe(X,W,ee,me){for(var Ae=null,Le=null,Me=W,$e=W=0,Kt=null;Me!==null&&$e<ee.length;$e++){Me.index>$e?(Kt=Me,Me=null):Kt=Me.sibling;var Je=le(X,Me,ee[$e],me);if(Je===null){Me===null&&(Me=Kt);break}r&&Me&&Je.alternate===null&&s(X,Me),W=w(Je,W,$e),Le===null?Ae=Je:Le.sibling=Je,Le=Je,Me=Kt}if($e===ee.length)return u(X,Me),ft&&_o(X,$e),Ae;if(Me===null){for(;$e<ee.length;$e++)Me=de(X,ee[$e],me),Me!==null&&(W=w(Me,W,$e),Le===null?Ae=Me:Le.sibling=Me,Le=Me);return ft&&_o(X,$e),Ae}for(Me=f(X,Me);$e<ee.length;$e++)Kt=ke(Me,X,$e,ee[$e],me),Kt!==null&&(r&&Kt.alternate!==null&&Me.delete(Kt.key===null?$e:Kt.key),W=w(Kt,W,$e),Le===null?Ae=Kt:Le.sibling=Kt,Le=Kt);return r&&Me.forEach(function(xo){return s(X,xo)}),ft&&_o(X,$e),Ae}function Te(X,W,ee,me){var Ae=Z(ee);if(typeof Ae!="function")throw Error(n(150));if(ee=Ae.call(ee),ee==null)throw Error(n(151));for(var Le=Ae=null,Me=W,$e=W=0,Kt=null,Je=ee.next();Me!==null&&!Je.done;$e++,Je=ee.next()){Me.index>$e?(Kt=Me,Me=null):Kt=Me.sibling;var xo=le(X,Me,Je.value,me);if(xo===null){Me===null&&(Me=Kt);break}r&&Me&&xo.alternate===null&&s(X,Me),W=w(xo,W,$e),Le===null?Ae=xo:Le.sibling=xo,Le=xo,Me=Kt}if(Je.done)return u(X,Me),ft&&_o(X,$e),Ae;if(Me===null){for(;!Je.done;$e++,Je=ee.next())Je=de(X,Je.value,me),Je!==null&&(W=w(Je,W,$e),Le===null?Ae=Je:Le.sibling=Je,Le=Je);return ft&&_o(X,$e),Ae}for(Me=f(X,Me);!Je.done;$e++,Je=ee.next())Je=ke(Me,X,$e,Je.value,me),Je!==null&&(r&&Je.alternate!==null&&Me.delete(Je.key===null?$e:Je.key),W=w(Je,W,$e),Le===null?Ae=Je:Le.sibling=Je,Le=Je);return r&&Me.forEach(function(dS){return s(X,dS)}),ft&&_o(X,$e),Ae}function Rt(X,W,ee,me){if(typeof ee=="object"&&ee!==null&&ee.type===D&&ee.key===null&&(ee=ee.props.children),typeof ee=="object"&&ee!==null){switch(ee.$$typeof){case O:e:{for(var Ae=ee.key,Le=W;Le!==null;){if(Le.key===Ae){if(Ae=ee.type,Ae===D){if(Le.tag===7){u(X,Le.sibling),W=y(Le,ee.props.children),W.return=X,X=W;break e}}else if(Le.elementType===Ae||typeof Ae=="object"&&Ae!==null&&Ae.$$typeof===F&&Qm(Ae)===Le.type){u(X,Le.sibling),W=y(Le,ee.props),W.ref=Pi(X,Le,ee),W.return=X,X=W;break e}u(X,Le);break}else s(X,Le);Le=Le.sibling}ee.type===D?(W=Vo(ee.props.children,X.mode,me,ee.key),W.return=X,X=W):(me=Il(ee.type,ee.key,ee.props,null,X.mode,me),me.ref=Pi(X,W,ee),me.return=X,X=me)}return E(X);case T:e:{for(Le=ee.key;W!==null;){if(W.key===Le)if(W.tag===4&&W.stateNode.containerInfo===ee.containerInfo&&W.stateNode.implementation===ee.implementation){u(X,W.sibling),W=y(W,ee.children||[]),W.return=X,X=W;break e}else{u(X,W);break}else s(X,W);W=W.sibling}W=Bd(ee,X.mode,me),W.return=X,X=W}return E(X);case F:return Le=ee._init,Rt(X,W,Le(ee._payload),me)}if(Ge(ee))return Pe(X,W,ee,me);if(Z(ee))return Te(X,W,ee,me);cl(X,ee)}return typeof ee=="string"&&ee!==""||typeof ee=="number"?(ee=""+ee,W!==null&&W.tag===6?(u(X,W.sibling),W=y(W,ee),W.return=X,X=W):(u(X,W),W=zd(ee,X.mode,me),W.return=X,X=W),E(X)):u(X,W)}return Rt}var ys=Jm(!0),Zm=Jm(!1),ul=so(null),dl=null,vs=null,Xu=null;function Qu(){Xu=vs=dl=null}function Ju(r){var s=ul.current;ut(ul),r._currentValue=s}function Zu(r,s,u){for(;r!==null;){var f=r.alternate;if((r.childLanes&s)!==s?(r.childLanes|=s,f!==null&&(f.childLanes|=s)):f!==null&&(f.childLanes&s)!==s&&(f.childLanes|=s),r===u)break;r=r.return}}function bs(r,s){dl=r,Xu=vs=null,r=r.dependencies,r!==null&&r.firstContext!==null&&((r.lanes&s)!==0&&(kn=!0),r.firstContext=null)}function Kn(r){var s=r._currentValue;if(Xu!==r)if(r={context:r,memoizedValue:s,next:null},vs===null){if(dl===null)throw Error(n(308));vs=r,dl.dependencies={lanes:0,firstContext:r}}else vs=vs.next=r;return s}var $o=null;function ed(r){$o===null?$o=[r]:$o.push(r)}function eg(r,s,u,f){var y=s.interleaved;return y===null?(u.next=u,ed(s)):(u.next=y.next,y.next=u),s.interleaved=u,Br(r,f)}function Br(r,s){r.lanes|=s;var u=r.alternate;for(u!==null&&(u.lanes|=s),u=r,r=r.return;r!==null;)r.childLanes|=s,u=r.alternate,u!==null&&(u.childLanes|=s),u=r,r=r.return;return u.tag===3?u.stateNode:null}var lo=!1;function td(r){r.updateQueue={baseState:r.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function tg(r,s){r=r.updateQueue,s.updateQueue===r&&(s.updateQueue={baseState:r.baseState,firstBaseUpdate:r.firstBaseUpdate,lastBaseUpdate:r.lastBaseUpdate,shared:r.shared,effects:r.effects})}function Ur(r,s){return{eventTime:r,lane:s,tag:0,payload:null,callback:null,next:null}}function co(r,s,u){var f=r.updateQueue;if(f===null)return null;if(f=f.shared,(Qe&2)!==0){var y=f.pending;return y===null?s.next=s:(s.next=y.next,y.next=s),f.pending=s,Br(r,u)}return y=f.interleaved,y===null?(s.next=s,ed(f)):(s.next=y.next,y.next=s),f.interleaved=s,Br(r,u)}function fl(r,s,u){if(s=s.updateQueue,s!==null&&(s=s.shared,(u&4194240)!==0)){var f=s.lanes;f&=r.pendingLanes,u|=f,s.lanes=u,mu(r,u)}}function ng(r,s){var u=r.updateQueue,f=r.alternate;if(f!==null&&(f=f.updateQueue,u===f)){var y=null,w=null;if(u=u.firstBaseUpdate,u!==null){do{var E={eventTime:u.eventTime,lane:u.lane,tag:u.tag,payload:u.payload,callback:u.callback,next:null};w===null?y=w=E:w=w.next=E,u=u.next}while(u!==null);w===null?y=w=s:w=w.next=s}else y=w=s;u={baseState:f.baseState,firstBaseUpdate:y,lastBaseUpdate:w,shared:f.shared,effects:f.effects},r.updateQueue=u;return}r=u.lastBaseUpdate,r===null?u.firstBaseUpdate=s:r.next=s,u.lastBaseUpdate=s}function pl(r,s,u,f){var y=r.updateQueue;lo=!1;var w=y.firstBaseUpdate,E=y.lastBaseUpdate,$=y.shared.pending;if($!==null){y.shared.pending=null;var H=$,oe=H.next;H.next=null,E===null?w=oe:E.next=oe,E=H;var ue=r.alternate;ue!==null&&(ue=ue.updateQueue,$=ue.lastBaseUpdate,$!==E&&($===null?ue.firstBaseUpdate=oe:$.next=oe,ue.lastBaseUpdate=H))}if(w!==null){var de=y.baseState;E=0,ue=oe=H=null,$=w;do{var le=$.lane,ke=$.eventTime;if((f&le)===le){ue!==null&&(ue=ue.next={eventTime:ke,lane:0,tag:$.tag,payload:$.payload,callback:$.callback,next:null});e:{var Pe=r,Te=$;switch(le=s,ke=u,Te.tag){case 1:if(Pe=Te.payload,typeof Pe=="function"){de=Pe.call(ke,de,le);break e}de=Pe;break e;case 3:Pe.flags=Pe.flags&-65537|128;case 0:if(Pe=Te.payload,le=typeof Pe=="function"?Pe.call(ke,de,le):Pe,le==null)break e;de=P({},de,le);break e;case 2:lo=!0}}$.callback!==null&&$.lane!==0&&(r.flags|=64,le=y.effects,le===null?y.effects=[$]:le.push($))}else ke={eventTime:ke,lane:le,tag:$.tag,payload:$.payload,callback:$.callback,next:null},ue===null?(oe=ue=ke,H=de):ue=ue.next=ke,E|=le;if($=$.next,$===null){if($=y.shared.pending,$===null)break;le=$,$=le.next,le.next=null,y.lastBaseUpdate=le,y.shared.pending=null}}while(!0);if(ue===null&&(H=de),y.baseState=H,y.firstBaseUpdate=oe,y.lastBaseUpdate=ue,s=y.shared.interleaved,s!==null){y=s;do E|=y.lane,y=y.next;while(y!==s)}else w===null&&(y.shared.lanes=0);Bo|=E,r.lanes=E,r.memoizedState=de}}function rg(r,s,u){if(r=s.effects,s.effects=null,r!==null)for(s=0;s<r.length;s++){var f=r[s],y=f.callback;if(y!==null){if(f.callback=null,f=u,typeof y!="function")throw Error(n(191,y));y.call(f)}}}var Ti={},vr=so(Ti),Ri=so(Ti),Ai=so(Ti);function Fo(r){if(r===Ti)throw Error(n(174));return r}function nd(r,s){switch(st(Ai,s),st(Ri,r),st(vr,Ti),r=s.nodeType,r){case 9:case 11:s=(s=s.documentElement)?s.namespaceURI:ce(null,"");break;default:r=r===8?s.parentNode:s,s=r.namespaceURI||null,r=r.tagName,s=ce(s,r)}ut(vr),st(vr,s)}function ws(){ut(vr),ut(Ri),ut(Ai)}function og(r){Fo(Ai.current);var s=Fo(vr.current),u=ce(s,r.type);s!==u&&(st(Ri,r),st(vr,u))}function rd(r){Ri.current===r&&(ut(vr),ut(Ri))}var vt=so(0);function hl(r){for(var s=r;s!==null;){if(s.tag===13){var u=s.memoizedState;if(u!==null&&(u=u.dehydrated,u===null||u.data==="$?"||u.data==="$!"))return s}else if(s.tag===19&&s.memoizedProps.revealOrder!==void 0){if((s.flags&128)!==0)return s}else if(s.child!==null){s.child.return=s,s=s.child;continue}if(s===r)break;for(;s.sibling===null;){if(s.return===null||s.return===r)return null;s=s.return}s.sibling.return=s.return,s=s.sibling}return null}var od=[];function sd(){for(var r=0;r<od.length;r++)od[r]._workInProgressVersionPrimary=null;od.length=0}var ml=A.ReactCurrentDispatcher,id=A.ReactCurrentBatchConfig,zo=0,bt=null,_t=null,Vt=null,gl=!1,Di=!1,Ii=0,Ij=0;function cn(){throw Error(n(321))}function ad(r,s){if(s===null)return!1;for(var u=0;u<s.length&&u<r.length;u++)if(!rr(r[u],s[u]))return!1;return!0}function ld(r,s,u,f,y,w){if(zo=w,bt=s,s.memoizedState=null,s.updateQueue=null,s.lanes=0,ml.current=r===null||r.memoizedState===null?_j:$j,r=u(f,y),Di){w=0;do{if(Di=!1,Ii=0,25<=w)throw Error(n(301));w+=1,Vt=_t=null,s.updateQueue=null,ml.current=Fj,r=u(f,y)}while(Di)}if(ml.current=vl,s=_t!==null&&_t.next!==null,zo=0,Vt=_t=bt=null,gl=!1,s)throw Error(n(300));return r}function cd(){var r=Ii!==0;return Ii=0,r}function br(){var r={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Vt===null?bt.memoizedState=Vt=r:Vt=Vt.next=r,Vt}function Gn(){if(_t===null){var r=bt.alternate;r=r!==null?r.memoizedState:null}else r=_t.next;var s=Vt===null?bt.memoizedState:Vt.next;if(s!==null)Vt=s,_t=r;else{if(r===null)throw Error(n(310));_t=r,r={memoizedState:_t.memoizedState,baseState:_t.baseState,baseQueue:_t.baseQueue,queue:_t.queue,next:null},Vt===null?bt.memoizedState=Vt=r:Vt=Vt.next=r}return Vt}function Oi(r,s){return typeof s=="function"?s(r):s}function ud(r){var s=Gn(),u=s.queue;if(u===null)throw Error(n(311));u.lastRenderedReducer=r;var f=_t,y=f.baseQueue,w=u.pending;if(w!==null){if(y!==null){var E=y.next;y.next=w.next,w.next=E}f.baseQueue=y=w,u.pending=null}if(y!==null){w=y.next,f=f.baseState;var $=E=null,H=null,oe=w;do{var ue=oe.lane;if((zo&ue)===ue)H!==null&&(H=H.next={lane:0,action:oe.action,hasEagerState:oe.hasEagerState,eagerState:oe.eagerState,next:null}),f=oe.hasEagerState?oe.eagerState:r(f,oe.action);else{var de={lane:ue,action:oe.action,hasEagerState:oe.hasEagerState,eagerState:oe.eagerState,next:null};H===null?($=H=de,E=f):H=H.next=de,bt.lanes|=ue,Bo|=ue}oe=oe.next}while(oe!==null&&oe!==w);H===null?E=f:H.next=$,rr(f,s.memoizedState)||(kn=!0),s.memoizedState=f,s.baseState=E,s.baseQueue=H,u.lastRenderedState=f}if(r=u.interleaved,r!==null){y=r;do w=y.lane,bt.lanes|=w,Bo|=w,y=y.next;while(y!==r)}else y===null&&(u.lanes=0);return[s.memoizedState,u.dispatch]}function dd(r){var s=Gn(),u=s.queue;if(u===null)throw Error(n(311));u.lastRenderedReducer=r;var f=u.dispatch,y=u.pending,w=s.memoizedState;if(y!==null){u.pending=null;var E=y=y.next;do w=r(w,E.action),E=E.next;while(E!==y);rr(w,s.memoizedState)||(kn=!0),s.memoizedState=w,s.baseQueue===null&&(s.baseState=w),u.lastRenderedState=w}return[w,f]}function sg(){}function ig(r,s){var u=bt,f=Gn(),y=s(),w=!rr(f.memoizedState,y);if(w&&(f.memoizedState=y,kn=!0),f=f.queue,fd(cg.bind(null,u,f,r),[r]),f.getSnapshot!==s||w||Vt!==null&&Vt.memoizedState.tag&1){if(u.flags|=2048,Li(9,lg.bind(null,u,f,y,s),void 0,null),qt===null)throw Error(n(349));(zo&30)!==0||ag(u,s,y)}return y}function ag(r,s,u){r.flags|=16384,r={getSnapshot:s,value:u},s=bt.updateQueue,s===null?(s={lastEffect:null,stores:null},bt.updateQueue=s,s.stores=[r]):(u=s.stores,u===null?s.stores=[r]:u.push(r))}function lg(r,s,u,f){s.value=u,s.getSnapshot=f,ug(s)&&dg(r)}function cg(r,s,u){return u(function(){ug(s)&&dg(r)})}function ug(r){var s=r.getSnapshot;r=r.value;try{var u=s();return!rr(r,u)}catch{return!0}}function dg(r){var s=Br(r,1);s!==null&&lr(s,r,1,-1)}function fg(r){var s=br();return typeof r=="function"&&(r=r()),s.memoizedState=s.baseState=r,r={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:Oi,lastRenderedState:r},s.queue=r,r=r.dispatch=Mj.bind(null,bt,r),[s.memoizedState,r]}function Li(r,s,u,f){return r={tag:r,create:s,destroy:u,deps:f,next:null},s=bt.updateQueue,s===null?(s={lastEffect:null,stores:null},bt.updateQueue=s,s.lastEffect=r.next=r):(u=s.lastEffect,u===null?s.lastEffect=r.next=r:(f=u.next,u.next=r,r.next=f,s.lastEffect=r)),r}function pg(){return Gn().memoizedState}function xl(r,s,u,f){var y=br();bt.flags|=r,y.memoizedState=Li(1|s,u,void 0,f===void 0?null:f)}function yl(r,s,u,f){var y=Gn();f=f===void 0?null:f;var w=void 0;if(_t!==null){var E=_t.memoizedState;if(w=E.destroy,f!==null&&ad(f,E.deps)){y.memoizedState=Li(s,u,w,f);return}}bt.flags|=r,y.memoizedState=Li(1|s,u,w,f)}function hg(r,s){return xl(8390656,8,r,s)}function fd(r,s){return yl(2048,8,r,s)}function mg(r,s){return yl(4,2,r,s)}function gg(r,s){return yl(4,4,r,s)}function xg(r,s){if(typeof s=="function")return r=r(),s(r),function(){s(null)};if(s!=null)return r=r(),s.current=r,function(){s.current=null}}function yg(r,s,u){return u=u!=null?u.concat([r]):null,yl(4,4,xg.bind(null,s,r),u)}function pd(){}function vg(r,s){var u=Gn();s=s===void 0?null:s;var f=u.memoizedState;return f!==null&&s!==null&&ad(s,f[1])?f[0]:(u.memoizedState=[r,s],r)}function bg(r,s){var u=Gn();s=s===void 0?null:s;var f=u.memoizedState;return f!==null&&s!==null&&ad(s,f[1])?f[0]:(r=r(),u.memoizedState=[r,s],r)}function wg(r,s,u){return(zo&21)===0?(r.baseState&&(r.baseState=!1,kn=!0),r.memoizedState=u):(rr(u,s)||(u=Qh(),bt.lanes|=u,Bo|=u,r.baseState=!0),s)}function Oj(r,s){var u=tt;tt=u!==0&&4>u?u:4,r(!0);var f=id.transition;id.transition={};try{r(!1),s()}finally{tt=u,id.transition=f}}function kg(){return Gn().memoizedState}function Lj(r,s,u){var f=ho(r);if(u={lane:f,action:u,hasEagerState:!1,eagerState:null,next:null},jg(r))Sg(s,u);else if(u=eg(r,s,u,f),u!==null){var y=gn();lr(u,r,f,y),Ng(u,s,f)}}function Mj(r,s,u){var f=ho(r),y={lane:f,action:u,hasEagerState:!1,eagerState:null,next:null};if(jg(r))Sg(s,y);else{var w=r.alternate;if(r.lanes===0&&(w===null||w.lanes===0)&&(w=s.lastRenderedReducer,w!==null))try{var E=s.lastRenderedState,$=w(E,u);if(y.hasEagerState=!0,y.eagerState=$,rr($,E)){var H=s.interleaved;H===null?(y.next=y,ed(s)):(y.next=H.next,H.next=y),s.interleaved=y;return}}catch{}finally{}u=eg(r,s,y,f),u!==null&&(y=gn(),lr(u,r,f,y),Ng(u,s,f))}}function jg(r){var s=r.alternate;return r===bt||s!==null&&s===bt}function Sg(r,s){Di=gl=!0;var u=r.pending;u===null?s.next=s:(s.next=u.next,u.next=s),r.pending=s}function Ng(r,s,u){if((u&4194240)!==0){var f=s.lanes;f&=r.pendingLanes,u|=f,s.lanes=u,mu(r,u)}}var vl={readContext:Kn,useCallback:cn,useContext:cn,useEffect:cn,useImperativeHandle:cn,useInsertionEffect:cn,useLayoutEffect:cn,useMemo:cn,useReducer:cn,useRef:cn,useState:cn,useDebugValue:cn,useDeferredValue:cn,useTransition:cn,useMutableSource:cn,useSyncExternalStore:cn,useId:cn,unstable_isNewReconciler:!1},_j={readContext:Kn,useCallback:function(r,s){return br().memoizedState=[r,s===void 0?null:s],r},useContext:Kn,useEffect:hg,useImperativeHandle:function(r,s,u){return u=u!=null?u.concat([r]):null,xl(4194308,4,xg.bind(null,s,r),u)},useLayoutEffect:function(r,s){return xl(4194308,4,r,s)},useInsertionEffect:function(r,s){return xl(4,2,r,s)},useMemo:function(r,s){var u=br();return s=s===void 0?null:s,r=r(),u.memoizedState=[r,s],r},useReducer:function(r,s,u){var f=br();return s=u!==void 0?u(s):s,f.memoizedState=f.baseState=s,r={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:r,lastRenderedState:s},f.queue=r,r=r.dispatch=Lj.bind(null,bt,r),[f.memoizedState,r]},useRef:function(r){var s=br();return r={current:r},s.memoizedState=r},useState:fg,useDebugValue:pd,useDeferredValue:function(r){return br().memoizedState=r},useTransition:function(){var r=fg(!1),s=r[0];return r=Oj.bind(null,r[1]),br().memoizedState=r,[s,r]},useMutableSource:function(){},useSyncExternalStore:function(r,s,u){var f=bt,y=br();if(ft){if(u===void 0)throw Error(n(407));u=u()}else{if(u=s(),qt===null)throw Error(n(349));(zo&30)!==0||ag(f,s,u)}y.memoizedState=u;var w={value:u,getSnapshot:s};return y.queue=w,hg(cg.bind(null,f,w,r),[r]),f.flags|=2048,Li(9,lg.bind(null,f,w,u,s),void 0,null),u},useId:function(){var r=br(),s=qt.identifierPrefix;if(ft){var u=zr,f=Fr;u=(f&~(1<<32-nr(f)-1)).toString(32)+u,s=":"+s+"R"+u,u=Ii++,0<u&&(s+="H"+u.toString(32)),s+=":"}else u=Ij++,s=":"+s+"r"+u.toString(32)+":";return r.memoizedState=s},unstable_isNewReconciler:!1},$j={readContext:Kn,useCallback:vg,useContext:Kn,useEffect:fd,useImperativeHandle:yg,useInsertionEffect:mg,useLayoutEffect:gg,useMemo:bg,useReducer:ud,useRef:pg,useState:function(){return ud(Oi)},useDebugValue:pd,useDeferredValue:function(r){var s=Gn();return wg(s,_t.memoizedState,r)},useTransition:function(){var r=ud(Oi)[0],s=Gn().memoizedState;return[r,s]},useMutableSource:sg,useSyncExternalStore:ig,useId:kg,unstable_isNewReconciler:!1},Fj={readContext:Kn,useCallback:vg,useContext:Kn,useEffect:fd,useImperativeHandle:yg,useInsertionEffect:mg,useLayoutEffect:gg,useMemo:bg,useReducer:dd,useRef:pg,useState:function(){return dd(Oi)},useDebugValue:pd,useDeferredValue:function(r){var s=Gn();return _t===null?s.memoizedState=r:wg(s,_t.memoizedState,r)},useTransition:function(){var r=dd(Oi)[0],s=Gn().memoizedState;return[r,s]},useMutableSource:sg,useSyncExternalStore:ig,useId:kg,unstable_isNewReconciler:!1};function sr(r,s){if(r&&r.defaultProps){s=P({},s),r=r.defaultProps;for(var u in r)s[u]===void 0&&(s[u]=r[u]);return s}return s}function hd(r,s,u,f){s=r.memoizedState,u=u(f,s),u=u==null?s:P({},s,u),r.memoizedState=u,r.lanes===0&&(r.updateQueue.baseState=u)}var bl={isMounted:function(r){return(r=r._reactInternals)?Io(r)===r:!1},enqueueSetState:function(r,s,u){r=r._reactInternals;var f=gn(),y=ho(r),w=Ur(f,y);w.payload=s,u!=null&&(w.callback=u),s=co(r,w,y),s!==null&&(lr(s,r,y,f),fl(s,r,y))},enqueueReplaceState:function(r,s,u){r=r._reactInternals;var f=gn(),y=ho(r),w=Ur(f,y);w.tag=1,w.payload=s,u!=null&&(w.callback=u),s=co(r,w,y),s!==null&&(lr(s,r,y,f),fl(s,r,y))},enqueueForceUpdate:function(r,s){r=r._reactInternals;var u=gn(),f=ho(r),y=Ur(u,f);y.tag=2,s!=null&&(y.callback=s),s=co(r,y,f),s!==null&&(lr(s,r,f,u),fl(s,r,f))}};function Cg(r,s,u,f,y,w,E){return r=r.stateNode,typeof r.shouldComponentUpdate=="function"?r.shouldComponentUpdate(f,w,E):s.prototype&&s.prototype.isPureReactComponent?!wi(u,f)||!wi(y,w):!0}function Eg(r,s,u){var f=!1,y=io,w=s.contextType;return typeof w=="object"&&w!==null?w=Kn(w):(y=wn(s)?Lo:ln.current,f=s.contextTypes,w=(f=f!=null)?hs(r,y):io),s=new s(u,w),r.memoizedState=s.state!==null&&s.state!==void 0?s.state:null,s.updater=bl,r.stateNode=s,s._reactInternals=r,f&&(r=r.stateNode,r.__reactInternalMemoizedUnmaskedChildContext=y,r.__reactInternalMemoizedMaskedChildContext=w),s}function Pg(r,s,u,f){r=s.state,typeof s.componentWillReceiveProps=="function"&&s.componentWillReceiveProps(u,f),typeof s.UNSAFE_componentWillReceiveProps=="function"&&s.UNSAFE_componentWillReceiveProps(u,f),s.state!==r&&bl.enqueueReplaceState(s,s.state,null)}function md(r,s,u,f){var y=r.stateNode;y.props=u,y.state=r.memoizedState,y.refs={},td(r);var w=s.contextType;typeof w=="object"&&w!==null?y.context=Kn(w):(w=wn(s)?Lo:ln.current,y.context=hs(r,w)),y.state=r.memoizedState,w=s.getDerivedStateFromProps,typeof w=="function"&&(hd(r,s,w,u),y.state=r.memoizedState),typeof s.getDerivedStateFromProps=="function"||typeof y.getSnapshotBeforeUpdate=="function"||typeof y.UNSAFE_componentWillMount!="function"&&typeof y.componentWillMount!="function"||(s=y.state,typeof y.componentWillMount=="function"&&y.componentWillMount(),typeof y.UNSAFE_componentWillMount=="function"&&y.UNSAFE_componentWillMount(),s!==y.state&&bl.enqueueReplaceState(y,y.state,null),pl(r,u,y,f),y.state=r.memoizedState),typeof y.componentDidMount=="function"&&(r.flags|=4194308)}function ks(r,s){try{var u="",f=s;do u+=Se(f),f=f.return;while(f);var y=u}catch(w){y=`
39
+ Error generating stack: `+w.message+`
40
+ `+w.stack}return{value:r,source:s,stack:y,digest:null}}function gd(r,s,u){return{value:r,source:null,stack:u??null,digest:s??null}}function xd(r,s){try{console.error(s.value)}catch(u){setTimeout(function(){throw u})}}var zj=typeof WeakMap=="function"?WeakMap:Map;function Tg(r,s,u){u=Ur(-1,u),u.tag=3,u.payload={element:null};var f=s.value;return u.callback=function(){El||(El=!0,Dd=f),xd(r,s)},u}function Rg(r,s,u){u=Ur(-1,u),u.tag=3;var f=r.type.getDerivedStateFromError;if(typeof f=="function"){var y=s.value;u.payload=function(){return f(y)},u.callback=function(){xd(r,s)}}var w=r.stateNode;return w!==null&&typeof w.componentDidCatch=="function"&&(u.callback=function(){xd(r,s),typeof f!="function"&&(fo===null?fo=new Set([this]):fo.add(this));var E=s.stack;this.componentDidCatch(s.value,{componentStack:E!==null?E:""})}),u}function Ag(r,s,u){var f=r.pingCache;if(f===null){f=r.pingCache=new zj;var y=new Set;f.set(s,y)}else y=f.get(s),y===void 0&&(y=new Set,f.set(s,y));y.has(u)||(y.add(u),r=eS.bind(null,r,s,u),s.then(r,r))}function Dg(r){do{var s;if((s=r.tag===13)&&(s=r.memoizedState,s=s!==null?s.dehydrated!==null:!0),s)return r;r=r.return}while(r!==null);return null}function Ig(r,s,u,f,y){return(r.mode&1)===0?(r===s?r.flags|=65536:(r.flags|=128,u.flags|=131072,u.flags&=-52805,u.tag===1&&(u.alternate===null?u.tag=17:(s=Ur(-1,1),s.tag=2,co(u,s,1))),u.lanes|=1),r):(r.flags|=65536,r.lanes=y,r)}var Bj=A.ReactCurrentOwner,kn=!1;function mn(r,s,u,f){s.child=r===null?Zm(s,null,u,f):ys(s,r.child,u,f)}function Og(r,s,u,f,y){u=u.render;var w=s.ref;return bs(s,y),f=ld(r,s,u,f,w,y),u=cd(),r!==null&&!kn?(s.updateQueue=r.updateQueue,s.flags&=-2053,r.lanes&=~y,Hr(r,s,y)):(ft&&u&&Vu(s),s.flags|=1,mn(r,s,f,y),s.child)}function Lg(r,s,u,f,y){if(r===null){var w=u.type;return typeof w=="function"&&!Fd(w)&&w.defaultProps===void 0&&u.compare===null&&u.defaultProps===void 0?(s.tag=15,s.type=w,Mg(r,s,w,f,y)):(r=Il(u.type,null,f,s,s.mode,y),r.ref=s.ref,r.return=s,s.child=r)}if(w=r.child,(r.lanes&y)===0){var E=w.memoizedProps;if(u=u.compare,u=u!==null?u:wi,u(E,f)&&r.ref===s.ref)return Hr(r,s,y)}return s.flags|=1,r=go(w,f),r.ref=s.ref,r.return=s,s.child=r}function Mg(r,s,u,f,y){if(r!==null){var w=r.memoizedProps;if(wi(w,f)&&r.ref===s.ref)if(kn=!1,s.pendingProps=f=w,(r.lanes&y)!==0)(r.flags&131072)!==0&&(kn=!0);else return s.lanes=r.lanes,Hr(r,s,y)}return yd(r,s,u,f,y)}function _g(r,s,u){var f=s.pendingProps,y=f.children,w=r!==null?r.memoizedState:null;if(f.mode==="hidden")if((s.mode&1)===0)s.memoizedState={baseLanes:0,cachePool:null,transitions:null},st(Ss,Mn),Mn|=u;else{if((u&1073741824)===0)return r=w!==null?w.baseLanes|u:u,s.lanes=s.childLanes=1073741824,s.memoizedState={baseLanes:r,cachePool:null,transitions:null},s.updateQueue=null,st(Ss,Mn),Mn|=r,null;s.memoizedState={baseLanes:0,cachePool:null,transitions:null},f=w!==null?w.baseLanes:u,st(Ss,Mn),Mn|=f}else w!==null?(f=w.baseLanes|u,s.memoizedState=null):f=u,st(Ss,Mn),Mn|=f;return mn(r,s,y,u),s.child}function $g(r,s){var u=s.ref;(r===null&&u!==null||r!==null&&r.ref!==u)&&(s.flags|=512,s.flags|=2097152)}function yd(r,s,u,f,y){var w=wn(u)?Lo:ln.current;return w=hs(s,w),bs(s,y),u=ld(r,s,u,f,w,y),f=cd(),r!==null&&!kn?(s.updateQueue=r.updateQueue,s.flags&=-2053,r.lanes&=~y,Hr(r,s,y)):(ft&&f&&Vu(s),s.flags|=1,mn(r,s,u,y),s.child)}function Fg(r,s,u,f,y){if(wn(u)){var w=!0;ol(s)}else w=!1;if(bs(s,y),s.stateNode===null)kl(r,s),Eg(s,u,f),md(s,u,f,y),f=!0;else if(r===null){var E=s.stateNode,$=s.memoizedProps;E.props=$;var H=E.context,oe=u.contextType;typeof oe=="object"&&oe!==null?oe=Kn(oe):(oe=wn(u)?Lo:ln.current,oe=hs(s,oe));var ue=u.getDerivedStateFromProps,de=typeof ue=="function"||typeof E.getSnapshotBeforeUpdate=="function";de||typeof E.UNSAFE_componentWillReceiveProps!="function"&&typeof E.componentWillReceiveProps!="function"||($!==f||H!==oe)&&Pg(s,E,f,oe),lo=!1;var le=s.memoizedState;E.state=le,pl(s,f,E,y),H=s.memoizedState,$!==f||le!==H||bn.current||lo?(typeof ue=="function"&&(hd(s,u,ue,f),H=s.memoizedState),($=lo||Cg(s,u,$,f,le,H,oe))?(de||typeof E.UNSAFE_componentWillMount!="function"&&typeof E.componentWillMount!="function"||(typeof E.componentWillMount=="function"&&E.componentWillMount(),typeof E.UNSAFE_componentWillMount=="function"&&E.UNSAFE_componentWillMount()),typeof E.componentDidMount=="function"&&(s.flags|=4194308)):(typeof E.componentDidMount=="function"&&(s.flags|=4194308),s.memoizedProps=f,s.memoizedState=H),E.props=f,E.state=H,E.context=oe,f=$):(typeof E.componentDidMount=="function"&&(s.flags|=4194308),f=!1)}else{E=s.stateNode,tg(r,s),$=s.memoizedProps,oe=s.type===s.elementType?$:sr(s.type,$),E.props=oe,de=s.pendingProps,le=E.context,H=u.contextType,typeof H=="object"&&H!==null?H=Kn(H):(H=wn(u)?Lo:ln.current,H=hs(s,H));var ke=u.getDerivedStateFromProps;(ue=typeof ke=="function"||typeof E.getSnapshotBeforeUpdate=="function")||typeof E.UNSAFE_componentWillReceiveProps!="function"&&typeof E.componentWillReceiveProps!="function"||($!==de||le!==H)&&Pg(s,E,f,H),lo=!1,le=s.memoizedState,E.state=le,pl(s,f,E,y);var Pe=s.memoizedState;$!==de||le!==Pe||bn.current||lo?(typeof ke=="function"&&(hd(s,u,ke,f),Pe=s.memoizedState),(oe=lo||Cg(s,u,oe,f,le,Pe,H)||!1)?(ue||typeof E.UNSAFE_componentWillUpdate!="function"&&typeof E.componentWillUpdate!="function"||(typeof E.componentWillUpdate=="function"&&E.componentWillUpdate(f,Pe,H),typeof E.UNSAFE_componentWillUpdate=="function"&&E.UNSAFE_componentWillUpdate(f,Pe,H)),typeof E.componentDidUpdate=="function"&&(s.flags|=4),typeof E.getSnapshotBeforeUpdate=="function"&&(s.flags|=1024)):(typeof E.componentDidUpdate!="function"||$===r.memoizedProps&&le===r.memoizedState||(s.flags|=4),typeof E.getSnapshotBeforeUpdate!="function"||$===r.memoizedProps&&le===r.memoizedState||(s.flags|=1024),s.memoizedProps=f,s.memoizedState=Pe),E.props=f,E.state=Pe,E.context=H,f=oe):(typeof E.componentDidUpdate!="function"||$===r.memoizedProps&&le===r.memoizedState||(s.flags|=4),typeof E.getSnapshotBeforeUpdate!="function"||$===r.memoizedProps&&le===r.memoizedState||(s.flags|=1024),f=!1)}return vd(r,s,u,f,w,y)}function vd(r,s,u,f,y,w){$g(r,s);var E=(s.flags&128)!==0;if(!f&&!E)return y&&Wm(s,u,!1),Hr(r,s,w);f=s.stateNode,Bj.current=s;var $=E&&typeof u.getDerivedStateFromError!="function"?null:f.render();return s.flags|=1,r!==null&&E?(s.child=ys(s,r.child,null,w),s.child=ys(s,null,$,w)):mn(r,s,$,w),s.memoizedState=f.state,y&&Wm(s,u,!0),s.child}function zg(r){var s=r.stateNode;s.pendingContext?Um(r,s.pendingContext,s.pendingContext!==s.context):s.context&&Um(r,s.context,!1),nd(r,s.containerInfo)}function Bg(r,s,u,f,y){return xs(),Yu(y),s.flags|=256,mn(r,s,u,f),s.child}var bd={dehydrated:null,treeContext:null,retryLane:0};function wd(r){return{baseLanes:r,cachePool:null,transitions:null}}function Ug(r,s,u){var f=s.pendingProps,y=vt.current,w=!1,E=(s.flags&128)!==0,$;if(($=E)||($=r!==null&&r.memoizedState===null?!1:(y&2)!==0),$?(w=!0,s.flags&=-129):(r===null||r.memoizedState!==null)&&(y|=1),st(vt,y&1),r===null)return Gu(s),r=s.memoizedState,r!==null&&(r=r.dehydrated,r!==null)?((s.mode&1)===0?s.lanes=1:r.data==="$!"?s.lanes=8:s.lanes=1073741824,null):(E=f.children,r=f.fallback,w?(f=s.mode,w=s.child,E={mode:"hidden",children:E},(f&1)===0&&w!==null?(w.childLanes=0,w.pendingProps=E):w=Ol(E,f,0,null),r=Vo(r,f,u,null),w.return=s,r.return=s,w.sibling=r,s.child=w,s.child.memoizedState=wd(u),s.memoizedState=bd,r):kd(s,E));if(y=r.memoizedState,y!==null&&($=y.dehydrated,$!==null))return Uj(r,s,E,f,$,y,u);if(w){w=f.fallback,E=s.mode,y=r.child,$=y.sibling;var H={mode:"hidden",children:f.children};return(E&1)===0&&s.child!==y?(f=s.child,f.childLanes=0,f.pendingProps=H,s.deletions=null):(f=go(y,H),f.subtreeFlags=y.subtreeFlags&14680064),$!==null?w=go($,w):(w=Vo(w,E,u,null),w.flags|=2),w.return=s,f.return=s,f.sibling=w,s.child=f,f=w,w=s.child,E=r.child.memoizedState,E=E===null?wd(u):{baseLanes:E.baseLanes|u,cachePool:null,transitions:E.transitions},w.memoizedState=E,w.childLanes=r.childLanes&~u,s.memoizedState=bd,f}return w=r.child,r=w.sibling,f=go(w,{mode:"visible",children:f.children}),(s.mode&1)===0&&(f.lanes=u),f.return=s,f.sibling=null,r!==null&&(u=s.deletions,u===null?(s.deletions=[r],s.flags|=16):u.push(r)),s.child=f,s.memoizedState=null,f}function kd(r,s){return s=Ol({mode:"visible",children:s},r.mode,0,null),s.return=r,r.child=s}function wl(r,s,u,f){return f!==null&&Yu(f),ys(s,r.child,null,u),r=kd(s,s.pendingProps.children),r.flags|=2,s.memoizedState=null,r}function Uj(r,s,u,f,y,w,E){if(u)return s.flags&256?(s.flags&=-257,f=gd(Error(n(422))),wl(r,s,E,f)):s.memoizedState!==null?(s.child=r.child,s.flags|=128,null):(w=f.fallback,y=s.mode,f=Ol({mode:"visible",children:f.children},y,0,null),w=Vo(w,y,E,null),w.flags|=2,f.return=s,w.return=s,f.sibling=w,s.child=f,(s.mode&1)!==0&&ys(s,r.child,null,E),s.child.memoizedState=wd(E),s.memoizedState=bd,w);if((s.mode&1)===0)return wl(r,s,E,null);if(y.data==="$!"){if(f=y.nextSibling&&y.nextSibling.dataset,f)var $=f.dgst;return f=$,w=Error(n(419)),f=gd(w,f,void 0),wl(r,s,E,f)}if($=(E&r.childLanes)!==0,kn||$){if(f=qt,f!==null){switch(E&-E){case 4:y=2;break;case 16:y=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:y=32;break;case 536870912:y=268435456;break;default:y=0}y=(y&(f.suspendedLanes|E))!==0?0:y,y!==0&&y!==w.retryLane&&(w.retryLane=y,Br(r,y),lr(f,r,y,-1))}return $d(),f=gd(Error(n(421))),wl(r,s,E,f)}return y.data==="$?"?(s.flags|=128,s.child=r.child,s=tS.bind(null,r),y._reactRetry=s,null):(r=w.treeContext,Ln=oo(y.nextSibling),On=s,ft=!0,or=null,r!==null&&(Vn[qn++]=Fr,Vn[qn++]=zr,Vn[qn++]=Mo,Fr=r.id,zr=r.overflow,Mo=s),s=kd(s,f.children),s.flags|=4096,s)}function Hg(r,s,u){r.lanes|=s;var f=r.alternate;f!==null&&(f.lanes|=s),Zu(r.return,s,u)}function jd(r,s,u,f,y){var w=r.memoizedState;w===null?r.memoizedState={isBackwards:s,rendering:null,renderingStartTime:0,last:f,tail:u,tailMode:y}:(w.isBackwards=s,w.rendering=null,w.renderingStartTime=0,w.last=f,w.tail=u,w.tailMode=y)}function Wg(r,s,u){var f=s.pendingProps,y=f.revealOrder,w=f.tail;if(mn(r,s,f.children,u),f=vt.current,(f&2)!==0)f=f&1|2,s.flags|=128;else{if(r!==null&&(r.flags&128)!==0)e:for(r=s.child;r!==null;){if(r.tag===13)r.memoizedState!==null&&Hg(r,u,s);else if(r.tag===19)Hg(r,u,s);else if(r.child!==null){r.child.return=r,r=r.child;continue}if(r===s)break e;for(;r.sibling===null;){if(r.return===null||r.return===s)break e;r=r.return}r.sibling.return=r.return,r=r.sibling}f&=1}if(st(vt,f),(s.mode&1)===0)s.memoizedState=null;else switch(y){case"forwards":for(u=s.child,y=null;u!==null;)r=u.alternate,r!==null&&hl(r)===null&&(y=u),u=u.sibling;u=y,u===null?(y=s.child,s.child=null):(y=u.sibling,u.sibling=null),jd(s,!1,y,u,w);break;case"backwards":for(u=null,y=s.child,s.child=null;y!==null;){if(r=y.alternate,r!==null&&hl(r)===null){s.child=y;break}r=y.sibling,y.sibling=u,u=y,y=r}jd(s,!0,u,null,w);break;case"together":jd(s,!1,null,null,void 0);break;default:s.memoizedState=null}return s.child}function kl(r,s){(s.mode&1)===0&&r!==null&&(r.alternate=null,s.alternate=null,s.flags|=2)}function Hr(r,s,u){if(r!==null&&(s.dependencies=r.dependencies),Bo|=s.lanes,(u&s.childLanes)===0)return null;if(r!==null&&s.child!==r.child)throw Error(n(153));if(s.child!==null){for(r=s.child,u=go(r,r.pendingProps),s.child=u,u.return=s;r.sibling!==null;)r=r.sibling,u=u.sibling=go(r,r.pendingProps),u.return=s;u.sibling=null}return s.child}function Hj(r,s,u){switch(s.tag){case 3:zg(s),xs();break;case 5:og(s);break;case 1:wn(s.type)&&ol(s);break;case 4:nd(s,s.stateNode.containerInfo);break;case 10:var f=s.type._context,y=s.memoizedProps.value;st(ul,f._currentValue),f._currentValue=y;break;case 13:if(f=s.memoizedState,f!==null)return f.dehydrated!==null?(st(vt,vt.current&1),s.flags|=128,null):(u&s.child.childLanes)!==0?Ug(r,s,u):(st(vt,vt.current&1),r=Hr(r,s,u),r!==null?r.sibling:null);st(vt,vt.current&1);break;case 19:if(f=(u&s.childLanes)!==0,(r.flags&128)!==0){if(f)return Wg(r,s,u);s.flags|=128}if(y=s.memoizedState,y!==null&&(y.rendering=null,y.tail=null,y.lastEffect=null),st(vt,vt.current),f)break;return null;case 22:case 23:return s.lanes=0,_g(r,s,u)}return Hr(r,s,u)}var Vg,Sd,qg,Kg;Vg=function(r,s){for(var u=s.child;u!==null;){if(u.tag===5||u.tag===6)r.appendChild(u.stateNode);else if(u.tag!==4&&u.child!==null){u.child.return=u,u=u.child;continue}if(u===s)break;for(;u.sibling===null;){if(u.return===null||u.return===s)return;u=u.return}u.sibling.return=u.return,u=u.sibling}},Sd=function(){},qg=function(r,s,u,f){var y=r.memoizedProps;if(y!==f){r=s.stateNode,Fo(vr.current);var w=null;switch(u){case"input":y=Y(r,y),f=Y(r,f),w=[];break;case"select":y=P({},y,{value:void 0}),f=P({},f,{value:void 0}),w=[];break;case"textarea":y=St(r,y),f=St(r,f),w=[];break;default:typeof y.onClick!="function"&&typeof f.onClick=="function"&&(r.onclick=tl)}pe(u,f);var E;u=null;for(oe in y)if(!f.hasOwnProperty(oe)&&y.hasOwnProperty(oe)&&y[oe]!=null)if(oe==="style"){var $=y[oe];for(E in $)$.hasOwnProperty(E)&&(u||(u={}),u[E]="")}else oe!=="dangerouslySetInnerHTML"&&oe!=="children"&&oe!=="suppressContentEditableWarning"&&oe!=="suppressHydrationWarning"&&oe!=="autoFocus"&&(a.hasOwnProperty(oe)?w||(w=[]):(w=w||[]).push(oe,null));for(oe in f){var H=f[oe];if($=y!=null?y[oe]:void 0,f.hasOwnProperty(oe)&&H!==$&&(H!=null||$!=null))if(oe==="style")if($){for(E in $)!$.hasOwnProperty(E)||H&&H.hasOwnProperty(E)||(u||(u={}),u[E]="");for(E in H)H.hasOwnProperty(E)&&$[E]!==H[E]&&(u||(u={}),u[E]=H[E])}else u||(w||(w=[]),w.push(oe,u)),u=H;else oe==="dangerouslySetInnerHTML"?(H=H?H.__html:void 0,$=$?$.__html:void 0,H!=null&&$!==H&&(w=w||[]).push(oe,H)):oe==="children"?typeof H!="string"&&typeof H!="number"||(w=w||[]).push(oe,""+H):oe!=="suppressContentEditableWarning"&&oe!=="suppressHydrationWarning"&&(a.hasOwnProperty(oe)?(H!=null&&oe==="onScroll"&&ct("scroll",r),w||$===H||(w=[])):(w=w||[]).push(oe,H))}u&&(w=w||[]).push("style",u);var oe=w;(s.updateQueue=oe)&&(s.flags|=4)}},Kg=function(r,s,u,f){u!==f&&(s.flags|=4)};function Mi(r,s){if(!ft)switch(r.tailMode){case"hidden":s=r.tail;for(var u=null;s!==null;)s.alternate!==null&&(u=s),s=s.sibling;u===null?r.tail=null:u.sibling=null;break;case"collapsed":u=r.tail;for(var f=null;u!==null;)u.alternate!==null&&(f=u),u=u.sibling;f===null?s||r.tail===null?r.tail=null:r.tail.sibling=null:f.sibling=null}}function un(r){var s=r.alternate!==null&&r.alternate.child===r.child,u=0,f=0;if(s)for(var y=r.child;y!==null;)u|=y.lanes|y.childLanes,f|=y.subtreeFlags&14680064,f|=y.flags&14680064,y.return=r,y=y.sibling;else for(y=r.child;y!==null;)u|=y.lanes|y.childLanes,f|=y.subtreeFlags,f|=y.flags,y.return=r,y=y.sibling;return r.subtreeFlags|=f,r.childLanes=u,s}function Wj(r,s,u){var f=s.pendingProps;switch(qu(s),s.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return un(s),null;case 1:return wn(s.type)&&rl(),un(s),null;case 3:return f=s.stateNode,ws(),ut(bn),ut(ln),sd(),f.pendingContext&&(f.context=f.pendingContext,f.pendingContext=null),(r===null||r.child===null)&&(ll(s)?s.flags|=4:r===null||r.memoizedState.isDehydrated&&(s.flags&256)===0||(s.flags|=1024,or!==null&&(Ld(or),or=null))),Sd(r,s),un(s),null;case 5:rd(s);var y=Fo(Ai.current);if(u=s.type,r!==null&&s.stateNode!=null)qg(r,s,u,f,y),r.ref!==s.ref&&(s.flags|=512,s.flags|=2097152);else{if(!f){if(s.stateNode===null)throw Error(n(166));return un(s),null}if(r=Fo(vr.current),ll(s)){f=s.stateNode,u=s.type;var w=s.memoizedProps;switch(f[yr]=s,f[Ci]=w,r=(s.mode&1)!==0,u){case"dialog":ct("cancel",f),ct("close",f);break;case"iframe":case"object":case"embed":ct("load",f);break;case"video":case"audio":for(y=0;y<ji.length;y++)ct(ji[y],f);break;case"source":ct("error",f);break;case"img":case"image":case"link":ct("error",f),ct("load",f);break;case"details":ct("toggle",f);break;case"input":ae(f,w),ct("invalid",f);break;case"select":f._wrapperState={wasMultiple:!!w.multiple},ct("invalid",f);break;case"textarea":Dt(f,w),ct("invalid",f)}pe(u,w),y=null;for(var E in w)if(w.hasOwnProperty(E)){var $=w[E];E==="children"?typeof $=="string"?f.textContent!==$&&(w.suppressHydrationWarning!==!0&&el(f.textContent,$,r),y=["children",$]):typeof $=="number"&&f.textContent!==""+$&&(w.suppressHydrationWarning!==!0&&el(f.textContent,$,r),y=["children",""+$]):a.hasOwnProperty(E)&&$!=null&&E==="onScroll"&&ct("scroll",f)}switch(u){case"input":Ye(f),Oe(f,w,!0);break;case"textarea":Ye(f),Et(f);break;case"select":case"option":break;default:typeof w.onClick=="function"&&(f.onclick=tl)}f=y,s.updateQueue=f,f!==null&&(s.flags|=4)}else{E=y.nodeType===9?y:y.ownerDocument,r==="http://www.w3.org/1999/xhtml"&&(r=ie(u)),r==="http://www.w3.org/1999/xhtml"?u==="script"?(r=E.createElement("div"),r.innerHTML="<script><\/script>",r=r.removeChild(r.firstChild)):typeof f.is=="string"?r=E.createElement(u,{is:f.is}):(r=E.createElement(u),u==="select"&&(E=r,f.multiple?E.multiple=!0:f.size&&(E.size=f.size))):r=E.createElementNS(r,u),r[yr]=s,r[Ci]=f,Vg(r,s,!1,!1),s.stateNode=r;e:{switch(E=Ce(u,f),u){case"dialog":ct("cancel",r),ct("close",r),y=f;break;case"iframe":case"object":case"embed":ct("load",r),y=f;break;case"video":case"audio":for(y=0;y<ji.length;y++)ct(ji[y],r);y=f;break;case"source":ct("error",r),y=f;break;case"img":case"image":case"link":ct("error",r),ct("load",r),y=f;break;case"details":ct("toggle",r),y=f;break;case"input":ae(r,f),y=Y(r,f),ct("invalid",r);break;case"option":y=f;break;case"select":r._wrapperState={wasMultiple:!!f.multiple},y=P({},f,{value:void 0}),ct("invalid",r);break;case"textarea":Dt(r,f),y=St(r,f),ct("invalid",r);break;default:y=f}pe(u,y),$=y;for(w in $)if($.hasOwnProperty(w)){var H=$[w];w==="style"?Jt(r,H):w==="dangerouslySetInnerHTML"?(H=H?H.__html:void 0,H!=null&&se(r,H)):w==="children"?typeof H=="string"?(u!=="textarea"||H!=="")&&Ne(r,H):typeof H=="number"&&Ne(r,""+H):w!=="suppressContentEditableWarning"&&w!=="suppressHydrationWarning"&&w!=="autoFocus"&&(a.hasOwnProperty(w)?H!=null&&w==="onScroll"&&ct("scroll",r):H!=null&&N(r,w,H,E))}switch(u){case"input":Ye(r),Oe(r,f,!1);break;case"textarea":Ye(r),Et(r);break;case"option":f.value!=null&&r.setAttribute("value",""+ve(f.value));break;case"select":r.multiple=!!f.multiple,w=f.value,w!=null?jt(r,!!f.multiple,w,!1):f.defaultValue!=null&&jt(r,!!f.multiple,f.defaultValue,!0);break;default:typeof y.onClick=="function"&&(r.onclick=tl)}switch(u){case"button":case"input":case"select":case"textarea":f=!!f.autoFocus;break e;case"img":f=!0;break e;default:f=!1}}f&&(s.flags|=4)}s.ref!==null&&(s.flags|=512,s.flags|=2097152)}return un(s),null;case 6:if(r&&s.stateNode!=null)Kg(r,s,r.memoizedProps,f);else{if(typeof f!="string"&&s.stateNode===null)throw Error(n(166));if(u=Fo(Ai.current),Fo(vr.current),ll(s)){if(f=s.stateNode,u=s.memoizedProps,f[yr]=s,(w=f.nodeValue!==u)&&(r=On,r!==null))switch(r.tag){case 3:el(f.nodeValue,u,(r.mode&1)!==0);break;case 5:r.memoizedProps.suppressHydrationWarning!==!0&&el(f.nodeValue,u,(r.mode&1)!==0)}w&&(s.flags|=4)}else f=(u.nodeType===9?u:u.ownerDocument).createTextNode(f),f[yr]=s,s.stateNode=f}return un(s),null;case 13:if(ut(vt),f=s.memoizedState,r===null||r.memoizedState!==null&&r.memoizedState.dehydrated!==null){if(ft&&Ln!==null&&(s.mode&1)!==0&&(s.flags&128)===0)Xm(),xs(),s.flags|=98560,w=!1;else if(w=ll(s),f!==null&&f.dehydrated!==null){if(r===null){if(!w)throw Error(n(318));if(w=s.memoizedState,w=w!==null?w.dehydrated:null,!w)throw Error(n(317));w[yr]=s}else xs(),(s.flags&128)===0&&(s.memoizedState=null),s.flags|=4;un(s),w=!1}else or!==null&&(Ld(or),or=null),w=!0;if(!w)return s.flags&65536?s:null}return(s.flags&128)!==0?(s.lanes=u,s):(f=f!==null,f!==(r!==null&&r.memoizedState!==null)&&f&&(s.child.flags|=8192,(s.mode&1)!==0&&(r===null||(vt.current&1)!==0?$t===0&&($t=3):$d())),s.updateQueue!==null&&(s.flags|=4),un(s),null);case 4:return ws(),Sd(r,s),r===null&&Si(s.stateNode.containerInfo),un(s),null;case 10:return Ju(s.type._context),un(s),null;case 17:return wn(s.type)&&rl(),un(s),null;case 19:if(ut(vt),w=s.memoizedState,w===null)return un(s),null;if(f=(s.flags&128)!==0,E=w.rendering,E===null)if(f)Mi(w,!1);else{if($t!==0||r!==null&&(r.flags&128)!==0)for(r=s.child;r!==null;){if(E=hl(r),E!==null){for(s.flags|=128,Mi(w,!1),f=E.updateQueue,f!==null&&(s.updateQueue=f,s.flags|=4),s.subtreeFlags=0,f=u,u=s.child;u!==null;)w=u,r=f,w.flags&=14680066,E=w.alternate,E===null?(w.childLanes=0,w.lanes=r,w.child=null,w.subtreeFlags=0,w.memoizedProps=null,w.memoizedState=null,w.updateQueue=null,w.dependencies=null,w.stateNode=null):(w.childLanes=E.childLanes,w.lanes=E.lanes,w.child=E.child,w.subtreeFlags=0,w.deletions=null,w.memoizedProps=E.memoizedProps,w.memoizedState=E.memoizedState,w.updateQueue=E.updateQueue,w.type=E.type,r=E.dependencies,w.dependencies=r===null?null:{lanes:r.lanes,firstContext:r.firstContext}),u=u.sibling;return st(vt,vt.current&1|2),s.child}r=r.sibling}w.tail!==null&&Tt()>Ns&&(s.flags|=128,f=!0,Mi(w,!1),s.lanes=4194304)}else{if(!f)if(r=hl(E),r!==null){if(s.flags|=128,f=!0,u=r.updateQueue,u!==null&&(s.updateQueue=u,s.flags|=4),Mi(w,!0),w.tail===null&&w.tailMode==="hidden"&&!E.alternate&&!ft)return un(s),null}else 2*Tt()-w.renderingStartTime>Ns&&u!==1073741824&&(s.flags|=128,f=!0,Mi(w,!1),s.lanes=4194304);w.isBackwards?(E.sibling=s.child,s.child=E):(u=w.last,u!==null?u.sibling=E:s.child=E,w.last=E)}return w.tail!==null?(s=w.tail,w.rendering=s,w.tail=s.sibling,w.renderingStartTime=Tt(),s.sibling=null,u=vt.current,st(vt,f?u&1|2:u&1),s):(un(s),null);case 22:case 23:return _d(),f=s.memoizedState!==null,r!==null&&r.memoizedState!==null!==f&&(s.flags|=8192),f&&(s.mode&1)!==0?(Mn&1073741824)!==0&&(un(s),s.subtreeFlags&6&&(s.flags|=8192)):un(s),null;case 24:return null;case 25:return null}throw Error(n(156,s.tag))}function Vj(r,s){switch(qu(s),s.tag){case 1:return wn(s.type)&&rl(),r=s.flags,r&65536?(s.flags=r&-65537|128,s):null;case 3:return ws(),ut(bn),ut(ln),sd(),r=s.flags,(r&65536)!==0&&(r&128)===0?(s.flags=r&-65537|128,s):null;case 5:return rd(s),null;case 13:if(ut(vt),r=s.memoizedState,r!==null&&r.dehydrated!==null){if(s.alternate===null)throw Error(n(340));xs()}return r=s.flags,r&65536?(s.flags=r&-65537|128,s):null;case 19:return ut(vt),null;case 4:return ws(),null;case 10:return Ju(s.type._context),null;case 22:case 23:return _d(),null;case 24:return null;default:return null}}var jl=!1,dn=!1,qj=typeof WeakSet=="function"?WeakSet:Set,Ee=null;function js(r,s){var u=r.ref;if(u!==null)if(typeof u=="function")try{u(null)}catch(f){Nt(r,s,f)}else u.current=null}function Nd(r,s,u){try{u()}catch(f){Nt(r,s,f)}}var Gg=!1;function Kj(r,s){if(_u=Ha,r=Cm(),Tu(r)){if("selectionStart"in r)var u={start:r.selectionStart,end:r.selectionEnd};else e:{u=(u=r.ownerDocument)&&u.defaultView||window;var f=u.getSelection&&u.getSelection();if(f&&f.rangeCount!==0){u=f.anchorNode;var y=f.anchorOffset,w=f.focusNode;f=f.focusOffset;try{u.nodeType,w.nodeType}catch{u=null;break e}var E=0,$=-1,H=-1,oe=0,ue=0,de=r,le=null;t:for(;;){for(var ke;de!==u||y!==0&&de.nodeType!==3||($=E+y),de!==w||f!==0&&de.nodeType!==3||(H=E+f),de.nodeType===3&&(E+=de.nodeValue.length),(ke=de.firstChild)!==null;)le=de,de=ke;for(;;){if(de===r)break t;if(le===u&&++oe===y&&($=E),le===w&&++ue===f&&(H=E),(ke=de.nextSibling)!==null)break;de=le,le=de.parentNode}de=ke}u=$===-1||H===-1?null:{start:$,end:H}}else u=null}u=u||{start:0,end:0}}else u=null;for($u={focusedElem:r,selectionRange:u},Ha=!1,Ee=s;Ee!==null;)if(s=Ee,r=s.child,(s.subtreeFlags&1028)!==0&&r!==null)r.return=s,Ee=r;else for(;Ee!==null;){s=Ee;try{var Pe=s.alternate;if((s.flags&1024)!==0)switch(s.tag){case 0:case 11:case 15:break;case 1:if(Pe!==null){var Te=Pe.memoizedProps,Rt=Pe.memoizedState,X=s.stateNode,W=X.getSnapshotBeforeUpdate(s.elementType===s.type?Te:sr(s.type,Te),Rt);X.__reactInternalSnapshotBeforeUpdate=W}break;case 3:var ee=s.stateNode.containerInfo;ee.nodeType===1?ee.textContent="":ee.nodeType===9&&ee.documentElement&&ee.removeChild(ee.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(n(163))}}catch(me){Nt(s,s.return,me)}if(r=s.sibling,r!==null){r.return=s.return,Ee=r;break}Ee=s.return}return Pe=Gg,Gg=!1,Pe}function _i(r,s,u){var f=s.updateQueue;if(f=f!==null?f.lastEffect:null,f!==null){var y=f=f.next;do{if((y.tag&r)===r){var w=y.destroy;y.destroy=void 0,w!==void 0&&Nd(s,u,w)}y=y.next}while(y!==f)}}function Sl(r,s){if(s=s.updateQueue,s=s!==null?s.lastEffect:null,s!==null){var u=s=s.next;do{if((u.tag&r)===r){var f=u.create;u.destroy=f()}u=u.next}while(u!==s)}}function Cd(r){var s=r.ref;if(s!==null){var u=r.stateNode;switch(r.tag){case 5:r=u;break;default:r=u}typeof s=="function"?s(r):s.current=r}}function Yg(r){var s=r.alternate;s!==null&&(r.alternate=null,Yg(s)),r.child=null,r.deletions=null,r.sibling=null,r.tag===5&&(s=r.stateNode,s!==null&&(delete s[yr],delete s[Ci],delete s[Uu],delete s[Tj],delete s[Rj])),r.stateNode=null,r.return=null,r.dependencies=null,r.memoizedProps=null,r.memoizedState=null,r.pendingProps=null,r.stateNode=null,r.updateQueue=null}function Xg(r){return r.tag===5||r.tag===3||r.tag===4}function Qg(r){e:for(;;){for(;r.sibling===null;){if(r.return===null||Xg(r.return))return null;r=r.return}for(r.sibling.return=r.return,r=r.sibling;r.tag!==5&&r.tag!==6&&r.tag!==18;){if(r.flags&2||r.child===null||r.tag===4)continue e;r.child.return=r,r=r.child}if(!(r.flags&2))return r.stateNode}}function Ed(r,s,u){var f=r.tag;if(f===5||f===6)r=r.stateNode,s?u.nodeType===8?u.parentNode.insertBefore(r,s):u.insertBefore(r,s):(u.nodeType===8?(s=u.parentNode,s.insertBefore(r,u)):(s=u,s.appendChild(r)),u=u._reactRootContainer,u!=null||s.onclick!==null||(s.onclick=tl));else if(f!==4&&(r=r.child,r!==null))for(Ed(r,s,u),r=r.sibling;r!==null;)Ed(r,s,u),r=r.sibling}function Pd(r,s,u){var f=r.tag;if(f===5||f===6)r=r.stateNode,s?u.insertBefore(r,s):u.appendChild(r);else if(f!==4&&(r=r.child,r!==null))for(Pd(r,s,u),r=r.sibling;r!==null;)Pd(r,s,u),r=r.sibling}var en=null,ir=!1;function uo(r,s,u){for(u=u.child;u!==null;)Jg(r,s,u),u=u.sibling}function Jg(r,s,u){if(xr&&typeof xr.onCommitFiberUnmount=="function")try{xr.onCommitFiberUnmount(_a,u)}catch{}switch(u.tag){case 5:dn||js(u,s);case 6:var f=en,y=ir;en=null,uo(r,s,u),en=f,ir=y,en!==null&&(ir?(r=en,u=u.stateNode,r.nodeType===8?r.parentNode.removeChild(u):r.removeChild(u)):en.removeChild(u.stateNode));break;case 18:en!==null&&(ir?(r=en,u=u.stateNode,r.nodeType===8?Bu(r.parentNode,u):r.nodeType===1&&Bu(r,u),mi(r)):Bu(en,u.stateNode));break;case 4:f=en,y=ir,en=u.stateNode.containerInfo,ir=!0,uo(r,s,u),en=f,ir=y;break;case 0:case 11:case 14:case 15:if(!dn&&(f=u.updateQueue,f!==null&&(f=f.lastEffect,f!==null))){y=f=f.next;do{var w=y,E=w.destroy;w=w.tag,E!==void 0&&((w&2)!==0||(w&4)!==0)&&Nd(u,s,E),y=y.next}while(y!==f)}uo(r,s,u);break;case 1:if(!dn&&(js(u,s),f=u.stateNode,typeof f.componentWillUnmount=="function"))try{f.props=u.memoizedProps,f.state=u.memoizedState,f.componentWillUnmount()}catch($){Nt(u,s,$)}uo(r,s,u);break;case 21:uo(r,s,u);break;case 22:u.mode&1?(dn=(f=dn)||u.memoizedState!==null,uo(r,s,u),dn=f):uo(r,s,u);break;default:uo(r,s,u)}}function Zg(r){var s=r.updateQueue;if(s!==null){r.updateQueue=null;var u=r.stateNode;u===null&&(u=r.stateNode=new qj),s.forEach(function(f){var y=nS.bind(null,r,f);u.has(f)||(u.add(f),f.then(y,y))})}}function ar(r,s){var u=s.deletions;if(u!==null)for(var f=0;f<u.length;f++){var y=u[f];try{var w=r,E=s,$=E;e:for(;$!==null;){switch($.tag){case 5:en=$.stateNode,ir=!1;break e;case 3:en=$.stateNode.containerInfo,ir=!0;break e;case 4:en=$.stateNode.containerInfo,ir=!0;break e}$=$.return}if(en===null)throw Error(n(160));Jg(w,E,y),en=null,ir=!1;var H=y.alternate;H!==null&&(H.return=null),y.return=null}catch(oe){Nt(y,s,oe)}}if(s.subtreeFlags&12854)for(s=s.child;s!==null;)ex(s,r),s=s.sibling}function ex(r,s){var u=r.alternate,f=r.flags;switch(r.tag){case 0:case 11:case 14:case 15:if(ar(s,r),wr(r),f&4){try{_i(3,r,r.return),Sl(3,r)}catch(Te){Nt(r,r.return,Te)}try{_i(5,r,r.return)}catch(Te){Nt(r,r.return,Te)}}break;case 1:ar(s,r),wr(r),f&512&&u!==null&&js(u,u.return);break;case 5:if(ar(s,r),wr(r),f&512&&u!==null&&js(u,u.return),r.flags&32){var y=r.stateNode;try{Ne(y,"")}catch(Te){Nt(r,r.return,Te)}}if(f&4&&(y=r.stateNode,y!=null)){var w=r.memoizedProps,E=u!==null?u.memoizedProps:w,$=r.type,H=r.updateQueue;if(r.updateQueue=null,H!==null)try{$==="input"&&w.type==="radio"&&w.name!=null&&xe(y,w),Ce($,E);var oe=Ce($,w);for(E=0;E<H.length;E+=2){var ue=H[E],de=H[E+1];ue==="style"?Jt(y,de):ue==="dangerouslySetInnerHTML"?se(y,de):ue==="children"?Ne(y,de):N(y,ue,de,oe)}switch($){case"input":qe(y,w);break;case"textarea":Qt(y,w);break;case"select":var le=y._wrapperState.wasMultiple;y._wrapperState.wasMultiple=!!w.multiple;var ke=w.value;ke!=null?jt(y,!!w.multiple,ke,!1):le!==!!w.multiple&&(w.defaultValue!=null?jt(y,!!w.multiple,w.defaultValue,!0):jt(y,!!w.multiple,w.multiple?[]:"",!1))}y[Ci]=w}catch(Te){Nt(r,r.return,Te)}}break;case 6:if(ar(s,r),wr(r),f&4){if(r.stateNode===null)throw Error(n(162));y=r.stateNode,w=r.memoizedProps;try{y.nodeValue=w}catch(Te){Nt(r,r.return,Te)}}break;case 3:if(ar(s,r),wr(r),f&4&&u!==null&&u.memoizedState.isDehydrated)try{mi(s.containerInfo)}catch(Te){Nt(r,r.return,Te)}break;case 4:ar(s,r),wr(r);break;case 13:ar(s,r),wr(r),y=r.child,y.flags&8192&&(w=y.memoizedState!==null,y.stateNode.isHidden=w,!w||y.alternate!==null&&y.alternate.memoizedState!==null||(Ad=Tt())),f&4&&Zg(r);break;case 22:if(ue=u!==null&&u.memoizedState!==null,r.mode&1?(dn=(oe=dn)||ue,ar(s,r),dn=oe):ar(s,r),wr(r),f&8192){if(oe=r.memoizedState!==null,(r.stateNode.isHidden=oe)&&!ue&&(r.mode&1)!==0)for(Ee=r,ue=r.child;ue!==null;){for(de=Ee=ue;Ee!==null;){switch(le=Ee,ke=le.child,le.tag){case 0:case 11:case 14:case 15:_i(4,le,le.return);break;case 1:js(le,le.return);var Pe=le.stateNode;if(typeof Pe.componentWillUnmount=="function"){f=le,u=le.return;try{s=f,Pe.props=s.memoizedProps,Pe.state=s.memoizedState,Pe.componentWillUnmount()}catch(Te){Nt(f,u,Te)}}break;case 5:js(le,le.return);break;case 22:if(le.memoizedState!==null){rx(de);continue}}ke!==null?(ke.return=le,Ee=ke):rx(de)}ue=ue.sibling}e:for(ue=null,de=r;;){if(de.tag===5){if(ue===null){ue=de;try{y=de.stateNode,oe?(w=y.style,typeof w.setProperty=="function"?w.setProperty("display","none","important"):w.display="none"):($=de.stateNode,H=de.memoizedProps.style,E=H!=null&&H.hasOwnProperty("display")?H.display:null,$.style.display=rn("display",E))}catch(Te){Nt(r,r.return,Te)}}}else if(de.tag===6){if(ue===null)try{de.stateNode.nodeValue=oe?"":de.memoizedProps}catch(Te){Nt(r,r.return,Te)}}else if((de.tag!==22&&de.tag!==23||de.memoizedState===null||de===r)&&de.child!==null){de.child.return=de,de=de.child;continue}if(de===r)break e;for(;de.sibling===null;){if(de.return===null||de.return===r)break e;ue===de&&(ue=null),de=de.return}ue===de&&(ue=null),de.sibling.return=de.return,de=de.sibling}}break;case 19:ar(s,r),wr(r),f&4&&Zg(r);break;case 21:break;default:ar(s,r),wr(r)}}function wr(r){var s=r.flags;if(s&2){try{e:{for(var u=r.return;u!==null;){if(Xg(u)){var f=u;break e}u=u.return}throw Error(n(160))}switch(f.tag){case 5:var y=f.stateNode;f.flags&32&&(Ne(y,""),f.flags&=-33);var w=Qg(r);Pd(r,w,y);break;case 3:case 4:var E=f.stateNode.containerInfo,$=Qg(r);Ed(r,$,E);break;default:throw Error(n(161))}}catch(H){Nt(r,r.return,H)}r.flags&=-3}s&4096&&(r.flags&=-4097)}function Gj(r,s,u){Ee=r,tx(r)}function tx(r,s,u){for(var f=(r.mode&1)!==0;Ee!==null;){var y=Ee,w=y.child;if(y.tag===22&&f){var E=y.memoizedState!==null||jl;if(!E){var $=y.alternate,H=$!==null&&$.memoizedState!==null||dn;$=jl;var oe=dn;if(jl=E,(dn=H)&&!oe)for(Ee=y;Ee!==null;)E=Ee,H=E.child,E.tag===22&&E.memoizedState!==null?ox(y):H!==null?(H.return=E,Ee=H):ox(y);for(;w!==null;)Ee=w,tx(w),w=w.sibling;Ee=y,jl=$,dn=oe}nx(r)}else(y.subtreeFlags&8772)!==0&&w!==null?(w.return=y,Ee=w):nx(r)}}function nx(r){for(;Ee!==null;){var s=Ee;if((s.flags&8772)!==0){var u=s.alternate;try{if((s.flags&8772)!==0)switch(s.tag){case 0:case 11:case 15:dn||Sl(5,s);break;case 1:var f=s.stateNode;if(s.flags&4&&!dn)if(u===null)f.componentDidMount();else{var y=s.elementType===s.type?u.memoizedProps:sr(s.type,u.memoizedProps);f.componentDidUpdate(y,u.memoizedState,f.__reactInternalSnapshotBeforeUpdate)}var w=s.updateQueue;w!==null&&rg(s,w,f);break;case 3:var E=s.updateQueue;if(E!==null){if(u=null,s.child!==null)switch(s.child.tag){case 5:u=s.child.stateNode;break;case 1:u=s.child.stateNode}rg(s,E,u)}break;case 5:var $=s.stateNode;if(u===null&&s.flags&4){u=$;var H=s.memoizedProps;switch(s.type){case"button":case"input":case"select":case"textarea":H.autoFocus&&u.focus();break;case"img":H.src&&(u.src=H.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(s.memoizedState===null){var oe=s.alternate;if(oe!==null){var ue=oe.memoizedState;if(ue!==null){var de=ue.dehydrated;de!==null&&mi(de)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(n(163))}dn||s.flags&512&&Cd(s)}catch(le){Nt(s,s.return,le)}}if(s===r){Ee=null;break}if(u=s.sibling,u!==null){u.return=s.return,Ee=u;break}Ee=s.return}}function rx(r){for(;Ee!==null;){var s=Ee;if(s===r){Ee=null;break}var u=s.sibling;if(u!==null){u.return=s.return,Ee=u;break}Ee=s.return}}function ox(r){for(;Ee!==null;){var s=Ee;try{switch(s.tag){case 0:case 11:case 15:var u=s.return;try{Sl(4,s)}catch(H){Nt(s,u,H)}break;case 1:var f=s.stateNode;if(typeof f.componentDidMount=="function"){var y=s.return;try{f.componentDidMount()}catch(H){Nt(s,y,H)}}var w=s.return;try{Cd(s)}catch(H){Nt(s,w,H)}break;case 5:var E=s.return;try{Cd(s)}catch(H){Nt(s,E,H)}}}catch(H){Nt(s,s.return,H)}if(s===r){Ee=null;break}var $=s.sibling;if($!==null){$.return=s.return,Ee=$;break}Ee=s.return}}var Yj=Math.ceil,Nl=A.ReactCurrentDispatcher,Td=A.ReactCurrentOwner,Yn=A.ReactCurrentBatchConfig,Qe=0,qt=null,It=null,tn=0,Mn=0,Ss=so(0),$t=0,$i=null,Bo=0,Cl=0,Rd=0,Fi=null,jn=null,Ad=0,Ns=1/0,Wr=null,El=!1,Dd=null,fo=null,Pl=!1,po=null,Tl=0,zi=0,Id=null,Rl=-1,Al=0;function gn(){return(Qe&6)!==0?Tt():Rl!==-1?Rl:Rl=Tt()}function ho(r){return(r.mode&1)===0?1:(Qe&2)!==0&&tn!==0?tn&-tn:Dj.transition!==null?(Al===0&&(Al=Qh()),Al):(r=tt,r!==0||(r=window.event,r=r===void 0?16:im(r.type)),r)}function lr(r,s,u,f){if(50<zi)throw zi=0,Id=null,Error(n(185));ui(r,u,f),((Qe&2)===0||r!==qt)&&(r===qt&&((Qe&2)===0&&(Cl|=u),$t===4&&mo(r,tn)),Sn(r,f),u===1&&Qe===0&&(s.mode&1)===0&&(Ns=Tt()+500,sl&&ao()))}function Sn(r,s){var u=r.callbackNode;D1(r,s);var f=za(r,r===qt?tn:0);if(f===0)u!==null&&Gh(u),r.callbackNode=null,r.callbackPriority=0;else if(s=f&-f,r.callbackPriority!==s){if(u!=null&&Gh(u),s===1)r.tag===0?Aj(ix.bind(null,r)):Vm(ix.bind(null,r)),Ej(function(){(Qe&6)===0&&ao()}),u=null;else{switch(Jh(f)){case 1:u=fu;break;case 4:u=Yh;break;case 16:u=Ma;break;case 536870912:u=Xh;break;default:u=Ma}u=hx(u,sx.bind(null,r))}r.callbackPriority=s,r.callbackNode=u}}function sx(r,s){if(Rl=-1,Al=0,(Qe&6)!==0)throw Error(n(327));var u=r.callbackNode;if(Cs()&&r.callbackNode!==u)return null;var f=za(r,r===qt?tn:0);if(f===0)return null;if((f&30)!==0||(f&r.expiredLanes)!==0||s)s=Dl(r,f);else{s=f;var y=Qe;Qe|=2;var w=lx();(qt!==r||tn!==s)&&(Wr=null,Ns=Tt()+500,Ho(r,s));do try{Jj();break}catch($){ax(r,$)}while(!0);Qu(),Nl.current=w,Qe=y,It!==null?s=0:(qt=null,tn=0,s=$t)}if(s!==0){if(s===2&&(y=pu(r),y!==0&&(f=y,s=Od(r,y))),s===1)throw u=$i,Ho(r,0),mo(r,f),Sn(r,Tt()),u;if(s===6)mo(r,f);else{if(y=r.current.alternate,(f&30)===0&&!Xj(y)&&(s=Dl(r,f),s===2&&(w=pu(r),w!==0&&(f=w,s=Od(r,w))),s===1))throw u=$i,Ho(r,0),mo(r,f),Sn(r,Tt()),u;switch(r.finishedWork=y,r.finishedLanes=f,s){case 0:case 1:throw Error(n(345));case 2:Wo(r,jn,Wr);break;case 3:if(mo(r,f),(f&130023424)===f&&(s=Ad+500-Tt(),10<s)){if(za(r,0)!==0)break;if(y=r.suspendedLanes,(y&f)!==f){gn(),r.pingedLanes|=r.suspendedLanes&y;break}r.timeoutHandle=zu(Wo.bind(null,r,jn,Wr),s);break}Wo(r,jn,Wr);break;case 4:if(mo(r,f),(f&4194240)===f)break;for(s=r.eventTimes,y=-1;0<f;){var E=31-nr(f);w=1<<E,E=s[E],E>y&&(y=E),f&=~w}if(f=y,f=Tt()-f,f=(120>f?120:480>f?480:1080>f?1080:1920>f?1920:3e3>f?3e3:4320>f?4320:1960*Yj(f/1960))-f,10<f){r.timeoutHandle=zu(Wo.bind(null,r,jn,Wr),f);break}Wo(r,jn,Wr);break;case 5:Wo(r,jn,Wr);break;default:throw Error(n(329))}}}return Sn(r,Tt()),r.callbackNode===u?sx.bind(null,r):null}function Od(r,s){var u=Fi;return r.current.memoizedState.isDehydrated&&(Ho(r,s).flags|=256),r=Dl(r,s),r!==2&&(s=jn,jn=u,s!==null&&Ld(s)),r}function Ld(r){jn===null?jn=r:jn.push.apply(jn,r)}function Xj(r){for(var s=r;;){if(s.flags&16384){var u=s.updateQueue;if(u!==null&&(u=u.stores,u!==null))for(var f=0;f<u.length;f++){var y=u[f],w=y.getSnapshot;y=y.value;try{if(!rr(w(),y))return!1}catch{return!1}}}if(u=s.child,s.subtreeFlags&16384&&u!==null)u.return=s,s=u;else{if(s===r)break;for(;s.sibling===null;){if(s.return===null||s.return===r)return!0;s=s.return}s.sibling.return=s.return,s=s.sibling}}return!0}function mo(r,s){for(s&=~Rd,s&=~Cl,r.suspendedLanes|=s,r.pingedLanes&=~s,r=r.expirationTimes;0<s;){var u=31-nr(s),f=1<<u;r[u]=-1,s&=~f}}function ix(r){if((Qe&6)!==0)throw Error(n(327));Cs();var s=za(r,0);if((s&1)===0)return Sn(r,Tt()),null;var u=Dl(r,s);if(r.tag!==0&&u===2){var f=pu(r);f!==0&&(s=f,u=Od(r,f))}if(u===1)throw u=$i,Ho(r,0),mo(r,s),Sn(r,Tt()),u;if(u===6)throw Error(n(345));return r.finishedWork=r.current.alternate,r.finishedLanes=s,Wo(r,jn,Wr),Sn(r,Tt()),null}function Md(r,s){var u=Qe;Qe|=1;try{return r(s)}finally{Qe=u,Qe===0&&(Ns=Tt()+500,sl&&ao())}}function Uo(r){po!==null&&po.tag===0&&(Qe&6)===0&&Cs();var s=Qe;Qe|=1;var u=Yn.transition,f=tt;try{if(Yn.transition=null,tt=1,r)return r()}finally{tt=f,Yn.transition=u,Qe=s,(Qe&6)===0&&ao()}}function _d(){Mn=Ss.current,ut(Ss)}function Ho(r,s){r.finishedWork=null,r.finishedLanes=0;var u=r.timeoutHandle;if(u!==-1&&(r.timeoutHandle=-1,Cj(u)),It!==null)for(u=It.return;u!==null;){var f=u;switch(qu(f),f.tag){case 1:f=f.type.childContextTypes,f!=null&&rl();break;case 3:ws(),ut(bn),ut(ln),sd();break;case 5:rd(f);break;case 4:ws();break;case 13:ut(vt);break;case 19:ut(vt);break;case 10:Ju(f.type._context);break;case 22:case 23:_d()}u=u.return}if(qt=r,It=r=go(r.current,null),tn=Mn=s,$t=0,$i=null,Rd=Cl=Bo=0,jn=Fi=null,$o!==null){for(s=0;s<$o.length;s++)if(u=$o[s],f=u.interleaved,f!==null){u.interleaved=null;var y=f.next,w=u.pending;if(w!==null){var E=w.next;w.next=y,f.next=E}u.pending=f}$o=null}return r}function ax(r,s){do{var u=It;try{if(Qu(),ml.current=vl,gl){for(var f=bt.memoizedState;f!==null;){var y=f.queue;y!==null&&(y.pending=null),f=f.next}gl=!1}if(zo=0,Vt=_t=bt=null,Di=!1,Ii=0,Td.current=null,u===null||u.return===null){$t=1,$i=s,It=null;break}e:{var w=r,E=u.return,$=u,H=s;if(s=tn,$.flags|=32768,H!==null&&typeof H=="object"&&typeof H.then=="function"){var oe=H,ue=$,de=ue.tag;if((ue.mode&1)===0&&(de===0||de===11||de===15)){var le=ue.alternate;le?(ue.updateQueue=le.updateQueue,ue.memoizedState=le.memoizedState,ue.lanes=le.lanes):(ue.updateQueue=null,ue.memoizedState=null)}var ke=Dg(E);if(ke!==null){ke.flags&=-257,Ig(ke,E,$,w,s),ke.mode&1&&Ag(w,oe,s),s=ke,H=oe;var Pe=s.updateQueue;if(Pe===null){var Te=new Set;Te.add(H),s.updateQueue=Te}else Pe.add(H);break e}else{if((s&1)===0){Ag(w,oe,s),$d();break e}H=Error(n(426))}}else if(ft&&$.mode&1){var Rt=Dg(E);if(Rt!==null){(Rt.flags&65536)===0&&(Rt.flags|=256),Ig(Rt,E,$,w,s),Yu(ks(H,$));break e}}w=H=ks(H,$),$t!==4&&($t=2),Fi===null?Fi=[w]:Fi.push(w),w=E;do{switch(w.tag){case 3:w.flags|=65536,s&=-s,w.lanes|=s;var X=Tg(w,H,s);ng(w,X);break e;case 1:$=H;var W=w.type,ee=w.stateNode;if((w.flags&128)===0&&(typeof W.getDerivedStateFromError=="function"||ee!==null&&typeof ee.componentDidCatch=="function"&&(fo===null||!fo.has(ee)))){w.flags|=65536,s&=-s,w.lanes|=s;var me=Rg(w,$,s);ng(w,me);break e}}w=w.return}while(w!==null)}ux(u)}catch(Ae){s=Ae,It===u&&u!==null&&(It=u=u.return);continue}break}while(!0)}function lx(){var r=Nl.current;return Nl.current=vl,r===null?vl:r}function $d(){($t===0||$t===3||$t===2)&&($t=4),qt===null||(Bo&268435455)===0&&(Cl&268435455)===0||mo(qt,tn)}function Dl(r,s){var u=Qe;Qe|=2;var f=lx();(qt!==r||tn!==s)&&(Wr=null,Ho(r,s));do try{Qj();break}catch(y){ax(r,y)}while(!0);if(Qu(),Qe=u,Nl.current=f,It!==null)throw Error(n(261));return qt=null,tn=0,$t}function Qj(){for(;It!==null;)cx(It)}function Jj(){for(;It!==null&&!j1();)cx(It)}function cx(r){var s=px(r.alternate,r,Mn);r.memoizedProps=r.pendingProps,s===null?ux(r):It=s,Td.current=null}function ux(r){var s=r;do{var u=s.alternate;if(r=s.return,(s.flags&32768)===0){if(u=Wj(u,s,Mn),u!==null){It=u;return}}else{if(u=Vj(u,s),u!==null){u.flags&=32767,It=u;return}if(r!==null)r.flags|=32768,r.subtreeFlags=0,r.deletions=null;else{$t=6,It=null;return}}if(s=s.sibling,s!==null){It=s;return}It=s=r}while(s!==null);$t===0&&($t=5)}function Wo(r,s,u){var f=tt,y=Yn.transition;try{Yn.transition=null,tt=1,Zj(r,s,u,f)}finally{Yn.transition=y,tt=f}return null}function Zj(r,s,u,f){do Cs();while(po!==null);if((Qe&6)!==0)throw Error(n(327));u=r.finishedWork;var y=r.finishedLanes;if(u===null)return null;if(r.finishedWork=null,r.finishedLanes=0,u===r.current)throw Error(n(177));r.callbackNode=null,r.callbackPriority=0;var w=u.lanes|u.childLanes;if(I1(r,w),r===qt&&(It=qt=null,tn=0),(u.subtreeFlags&2064)===0&&(u.flags&2064)===0||Pl||(Pl=!0,hx(Ma,function(){return Cs(),null})),w=(u.flags&15990)!==0,(u.subtreeFlags&15990)!==0||w){w=Yn.transition,Yn.transition=null;var E=tt;tt=1;var $=Qe;Qe|=4,Td.current=null,Kj(r,u),ex(u,r),vj($u),Ha=!!_u,$u=_u=null,r.current=u,Gj(u),S1(),Qe=$,tt=E,Yn.transition=w}else r.current=u;if(Pl&&(Pl=!1,po=r,Tl=y),w=r.pendingLanes,w===0&&(fo=null),E1(u.stateNode),Sn(r,Tt()),s!==null)for(f=r.onRecoverableError,u=0;u<s.length;u++)y=s[u],f(y.value,{componentStack:y.stack,digest:y.digest});if(El)throw El=!1,r=Dd,Dd=null,r;return(Tl&1)!==0&&r.tag!==0&&Cs(),w=r.pendingLanes,(w&1)!==0?r===Id?zi++:(zi=0,Id=r):zi=0,ao(),null}function Cs(){if(po!==null){var r=Jh(Tl),s=Yn.transition,u=tt;try{if(Yn.transition=null,tt=16>r?16:r,po===null)var f=!1;else{if(r=po,po=null,Tl=0,(Qe&6)!==0)throw Error(n(331));var y=Qe;for(Qe|=4,Ee=r.current;Ee!==null;){var w=Ee,E=w.child;if((Ee.flags&16)!==0){var $=w.deletions;if($!==null){for(var H=0;H<$.length;H++){var oe=$[H];for(Ee=oe;Ee!==null;){var ue=Ee;switch(ue.tag){case 0:case 11:case 15:_i(8,ue,w)}var de=ue.child;if(de!==null)de.return=ue,Ee=de;else for(;Ee!==null;){ue=Ee;var le=ue.sibling,ke=ue.return;if(Yg(ue),ue===oe){Ee=null;break}if(le!==null){le.return=ke,Ee=le;break}Ee=ke}}}var Pe=w.alternate;if(Pe!==null){var Te=Pe.child;if(Te!==null){Pe.child=null;do{var Rt=Te.sibling;Te.sibling=null,Te=Rt}while(Te!==null)}}Ee=w}}if((w.subtreeFlags&2064)!==0&&E!==null)E.return=w,Ee=E;else e:for(;Ee!==null;){if(w=Ee,(w.flags&2048)!==0)switch(w.tag){case 0:case 11:case 15:_i(9,w,w.return)}var X=w.sibling;if(X!==null){X.return=w.return,Ee=X;break e}Ee=w.return}}var W=r.current;for(Ee=W;Ee!==null;){E=Ee;var ee=E.child;if((E.subtreeFlags&2064)!==0&&ee!==null)ee.return=E,Ee=ee;else e:for(E=W;Ee!==null;){if($=Ee,($.flags&2048)!==0)try{switch($.tag){case 0:case 11:case 15:Sl(9,$)}}catch(Ae){Nt($,$.return,Ae)}if($===E){Ee=null;break e}var me=$.sibling;if(me!==null){me.return=$.return,Ee=me;break e}Ee=$.return}}if(Qe=y,ao(),xr&&typeof xr.onPostCommitFiberRoot=="function")try{xr.onPostCommitFiberRoot(_a,r)}catch{}f=!0}return f}finally{tt=u,Yn.transition=s}}return!1}function dx(r,s,u){s=ks(u,s),s=Tg(r,s,1),r=co(r,s,1),s=gn(),r!==null&&(ui(r,1,s),Sn(r,s))}function Nt(r,s,u){if(r.tag===3)dx(r,r,u);else for(;s!==null;){if(s.tag===3){dx(s,r,u);break}else if(s.tag===1){var f=s.stateNode;if(typeof s.type.getDerivedStateFromError=="function"||typeof f.componentDidCatch=="function"&&(fo===null||!fo.has(f))){r=ks(u,r),r=Rg(s,r,1),s=co(s,r,1),r=gn(),s!==null&&(ui(s,1,r),Sn(s,r));break}}s=s.return}}function eS(r,s,u){var f=r.pingCache;f!==null&&f.delete(s),s=gn(),r.pingedLanes|=r.suspendedLanes&u,qt===r&&(tn&u)===u&&($t===4||$t===3&&(tn&130023424)===tn&&500>Tt()-Ad?Ho(r,0):Rd|=u),Sn(r,s)}function fx(r,s){s===0&&((r.mode&1)===0?s=1:(s=Fa,Fa<<=1,(Fa&130023424)===0&&(Fa=4194304)));var u=gn();r=Br(r,s),r!==null&&(ui(r,s,u),Sn(r,u))}function tS(r){var s=r.memoizedState,u=0;s!==null&&(u=s.retryLane),fx(r,u)}function nS(r,s){var u=0;switch(r.tag){case 13:var f=r.stateNode,y=r.memoizedState;y!==null&&(u=y.retryLane);break;case 19:f=r.stateNode;break;default:throw Error(n(314))}f!==null&&f.delete(s),fx(r,u)}var px;px=function(r,s,u){if(r!==null)if(r.memoizedProps!==s.pendingProps||bn.current)kn=!0;else{if((r.lanes&u)===0&&(s.flags&128)===0)return kn=!1,Hj(r,s,u);kn=(r.flags&131072)!==0}else kn=!1,ft&&(s.flags&1048576)!==0&&qm(s,al,s.index);switch(s.lanes=0,s.tag){case 2:var f=s.type;kl(r,s),r=s.pendingProps;var y=hs(s,ln.current);bs(s,u),y=ld(null,s,f,r,y,u);var w=cd();return s.flags|=1,typeof y=="object"&&y!==null&&typeof y.render=="function"&&y.$$typeof===void 0?(s.tag=1,s.memoizedState=null,s.updateQueue=null,wn(f)?(w=!0,ol(s)):w=!1,s.memoizedState=y.state!==null&&y.state!==void 0?y.state:null,td(s),y.updater=bl,s.stateNode=y,y._reactInternals=s,md(s,f,r,u),s=vd(null,s,f,!0,w,u)):(s.tag=0,ft&&w&&Vu(s),mn(null,s,y,u),s=s.child),s;case 16:f=s.elementType;e:{switch(kl(r,s),r=s.pendingProps,y=f._init,f=y(f._payload),s.type=f,y=s.tag=oS(f),r=sr(f,r),y){case 0:s=yd(null,s,f,r,u);break e;case 1:s=Fg(null,s,f,r,u);break e;case 11:s=Og(null,s,f,r,u);break e;case 14:s=Lg(null,s,f,sr(f.type,r),u);break e}throw Error(n(306,f,""))}return s;case 0:return f=s.type,y=s.pendingProps,y=s.elementType===f?y:sr(f,y),yd(r,s,f,y,u);case 1:return f=s.type,y=s.pendingProps,y=s.elementType===f?y:sr(f,y),Fg(r,s,f,y,u);case 3:e:{if(zg(s),r===null)throw Error(n(387));f=s.pendingProps,w=s.memoizedState,y=w.element,tg(r,s),pl(s,f,null,u);var E=s.memoizedState;if(f=E.element,w.isDehydrated)if(w={element:f,isDehydrated:!1,cache:E.cache,pendingSuspenseBoundaries:E.pendingSuspenseBoundaries,transitions:E.transitions},s.updateQueue.baseState=w,s.memoizedState=w,s.flags&256){y=ks(Error(n(423)),s),s=Bg(r,s,f,u,y);break e}else if(f!==y){y=ks(Error(n(424)),s),s=Bg(r,s,f,u,y);break e}else for(Ln=oo(s.stateNode.containerInfo.firstChild),On=s,ft=!0,or=null,u=Zm(s,null,f,u),s.child=u;u;)u.flags=u.flags&-3|4096,u=u.sibling;else{if(xs(),f===y){s=Hr(r,s,u);break e}mn(r,s,f,u)}s=s.child}return s;case 5:return og(s),r===null&&Gu(s),f=s.type,y=s.pendingProps,w=r!==null?r.memoizedProps:null,E=y.children,Fu(f,y)?E=null:w!==null&&Fu(f,w)&&(s.flags|=32),$g(r,s),mn(r,s,E,u),s.child;case 6:return r===null&&Gu(s),null;case 13:return Ug(r,s,u);case 4:return nd(s,s.stateNode.containerInfo),f=s.pendingProps,r===null?s.child=ys(s,null,f,u):mn(r,s,f,u),s.child;case 11:return f=s.type,y=s.pendingProps,y=s.elementType===f?y:sr(f,y),Og(r,s,f,y,u);case 7:return mn(r,s,s.pendingProps,u),s.child;case 8:return mn(r,s,s.pendingProps.children,u),s.child;case 12:return mn(r,s,s.pendingProps.children,u),s.child;case 10:e:{if(f=s.type._context,y=s.pendingProps,w=s.memoizedProps,E=y.value,st(ul,f._currentValue),f._currentValue=E,w!==null)if(rr(w.value,E)){if(w.children===y.children&&!bn.current){s=Hr(r,s,u);break e}}else for(w=s.child,w!==null&&(w.return=s);w!==null;){var $=w.dependencies;if($!==null){E=w.child;for(var H=$.firstContext;H!==null;){if(H.context===f){if(w.tag===1){H=Ur(-1,u&-u),H.tag=2;var oe=w.updateQueue;if(oe!==null){oe=oe.shared;var ue=oe.pending;ue===null?H.next=H:(H.next=ue.next,ue.next=H),oe.pending=H}}w.lanes|=u,H=w.alternate,H!==null&&(H.lanes|=u),Zu(w.return,u,s),$.lanes|=u;break}H=H.next}}else if(w.tag===10)E=w.type===s.type?null:w.child;else if(w.tag===18){if(E=w.return,E===null)throw Error(n(341));E.lanes|=u,$=E.alternate,$!==null&&($.lanes|=u),Zu(E,u,s),E=w.sibling}else E=w.child;if(E!==null)E.return=w;else for(E=w;E!==null;){if(E===s){E=null;break}if(w=E.sibling,w!==null){w.return=E.return,E=w;break}E=E.return}w=E}mn(r,s,y.children,u),s=s.child}return s;case 9:return y=s.type,f=s.pendingProps.children,bs(s,u),y=Kn(y),f=f(y),s.flags|=1,mn(r,s,f,u),s.child;case 14:return f=s.type,y=sr(f,s.pendingProps),y=sr(f.type,y),Lg(r,s,f,y,u);case 15:return Mg(r,s,s.type,s.pendingProps,u);case 17:return f=s.type,y=s.pendingProps,y=s.elementType===f?y:sr(f,y),kl(r,s),s.tag=1,wn(f)?(r=!0,ol(s)):r=!1,bs(s,u),Eg(s,f,y),md(s,f,y,u),vd(null,s,f,!0,r,u);case 19:return Wg(r,s,u);case 22:return _g(r,s,u)}throw Error(n(156,s.tag))};function hx(r,s){return Kh(r,s)}function rS(r,s,u,f){this.tag=r,this.key=u,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=s,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=f,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Xn(r,s,u,f){return new rS(r,s,u,f)}function Fd(r){return r=r.prototype,!(!r||!r.isReactComponent)}function oS(r){if(typeof r=="function")return Fd(r)?1:0;if(r!=null){if(r=r.$$typeof,r===K)return 11;if(r===_)return 14}return 2}function go(r,s){var u=r.alternate;return u===null?(u=Xn(r.tag,s,r.key,r.mode),u.elementType=r.elementType,u.type=r.type,u.stateNode=r.stateNode,u.alternate=r,r.alternate=u):(u.pendingProps=s,u.type=r.type,u.flags=0,u.subtreeFlags=0,u.deletions=null),u.flags=r.flags&14680064,u.childLanes=r.childLanes,u.lanes=r.lanes,u.child=r.child,u.memoizedProps=r.memoizedProps,u.memoizedState=r.memoizedState,u.updateQueue=r.updateQueue,s=r.dependencies,u.dependencies=s===null?null:{lanes:s.lanes,firstContext:s.firstContext},u.sibling=r.sibling,u.index=r.index,u.ref=r.ref,u}function Il(r,s,u,f,y,w){var E=2;if(f=r,typeof r=="function")Fd(r)&&(E=1);else if(typeof r=="string")E=5;else e:switch(r){case D:return Vo(u.children,y,w,s);case L:E=8,y|=8;break;case G:return r=Xn(12,u,s,y|2),r.elementType=G,r.lanes=w,r;case q:return r=Xn(13,u,s,y),r.elementType=q,r.lanes=w,r;case J:return r=Xn(19,u,s,y),r.elementType=J,r.lanes=w,r;case B:return Ol(u,y,w,s);default:if(typeof r=="object"&&r!==null)switch(r.$$typeof){case re:E=10;break e;case z:E=9;break e;case K:E=11;break e;case _:E=14;break e;case F:E=16,f=null;break e}throw Error(n(130,r==null?r:typeof r,""))}return s=Xn(E,u,s,y),s.elementType=r,s.type=f,s.lanes=w,s}function Vo(r,s,u,f){return r=Xn(7,r,f,s),r.lanes=u,r}function Ol(r,s,u,f){return r=Xn(22,r,f,s),r.elementType=B,r.lanes=u,r.stateNode={isHidden:!1},r}function zd(r,s,u){return r=Xn(6,r,null,s),r.lanes=u,r}function Bd(r,s,u){return s=Xn(4,r.children!==null?r.children:[],r.key,s),s.lanes=u,s.stateNode={containerInfo:r.containerInfo,pendingChildren:null,implementation:r.implementation},s}function sS(r,s,u,f,y){this.tag=s,this.containerInfo=r,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=hu(0),this.expirationTimes=hu(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=hu(0),this.identifierPrefix=f,this.onRecoverableError=y,this.mutableSourceEagerHydrationData=null}function Ud(r,s,u,f,y,w,E,$,H){return r=new sS(r,s,u,$,H),s===1?(s=1,w===!0&&(s|=8)):s=0,w=Xn(3,null,null,s),r.current=w,w.stateNode=r,w.memoizedState={element:f,isDehydrated:u,cache:null,transitions:null,pendingSuspenseBoundaries:null},td(w),r}function iS(r,s,u){var f=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:T,key:f==null?null:""+f,children:r,containerInfo:s,implementation:u}}function mx(r){if(!r)return io;r=r._reactInternals;e:{if(Io(r)!==r||r.tag!==1)throw Error(n(170));var s=r;do{switch(s.tag){case 3:s=s.stateNode.context;break e;case 1:if(wn(s.type)){s=s.stateNode.__reactInternalMemoizedMergedChildContext;break e}}s=s.return}while(s!==null);throw Error(n(171))}if(r.tag===1){var u=r.type;if(wn(u))return Hm(r,u,s)}return s}function gx(r,s,u,f,y,w,E,$,H){return r=Ud(u,f,!0,r,y,w,E,$,H),r.context=mx(null),u=r.current,f=gn(),y=ho(u),w=Ur(f,y),w.callback=s??null,co(u,w,y),r.current.lanes=y,ui(r,y,f),Sn(r,f),r}function Ll(r,s,u,f){var y=s.current,w=gn(),E=ho(y);return u=mx(u),s.context===null?s.context=u:s.pendingContext=u,s=Ur(w,E),s.payload={element:r},f=f===void 0?null:f,f!==null&&(s.callback=f),r=co(y,s,E),r!==null&&(lr(r,y,E,w),fl(r,y,E)),E}function Ml(r){if(r=r.current,!r.child)return null;switch(r.child.tag){case 5:return r.child.stateNode;default:return r.child.stateNode}}function xx(r,s){if(r=r.memoizedState,r!==null&&r.dehydrated!==null){var u=r.retryLane;r.retryLane=u!==0&&u<s?u:s}}function Hd(r,s){xx(r,s),(r=r.alternate)&&xx(r,s)}function aS(){return null}var yx=typeof reportError=="function"?reportError:function(r){console.error(r)};function Wd(r){this._internalRoot=r}_l.prototype.render=Wd.prototype.render=function(r){var s=this._internalRoot;if(s===null)throw Error(n(409));Ll(r,s,null,null)},_l.prototype.unmount=Wd.prototype.unmount=function(){var r=this._internalRoot;if(r!==null){this._internalRoot=null;var s=r.containerInfo;Uo(function(){Ll(null,r,null,null)}),s[_r]=null}};function _l(r){this._internalRoot=r}_l.prototype.unstable_scheduleHydration=function(r){if(r){var s=tm();r={blockedOn:null,target:r,priority:s};for(var u=0;u<to.length&&s!==0&&s<to[u].priority;u++);to.splice(u,0,r),u===0&&om(r)}};function Vd(r){return!(!r||r.nodeType!==1&&r.nodeType!==9&&r.nodeType!==11)}function $l(r){return!(!r||r.nodeType!==1&&r.nodeType!==9&&r.nodeType!==11&&(r.nodeType!==8||r.nodeValue!==" react-mount-point-unstable "))}function vx(){}function lS(r,s,u,f,y){if(y){if(typeof f=="function"){var w=f;f=function(){var oe=Ml(E);w.call(oe)}}var E=gx(s,f,r,0,null,!1,!1,"",vx);return r._reactRootContainer=E,r[_r]=E.current,Si(r.nodeType===8?r.parentNode:r),Uo(),E}for(;y=r.lastChild;)r.removeChild(y);if(typeof f=="function"){var $=f;f=function(){var oe=Ml(H);$.call(oe)}}var H=Ud(r,0,!1,null,null,!1,!1,"",vx);return r._reactRootContainer=H,r[_r]=H.current,Si(r.nodeType===8?r.parentNode:r),Uo(function(){Ll(s,H,u,f)}),H}function Fl(r,s,u,f,y){var w=u._reactRootContainer;if(w){var E=w;if(typeof y=="function"){var $=y;y=function(){var H=Ml(E);$.call(H)}}Ll(s,E,r,y)}else E=lS(u,s,r,y,f);return Ml(E)}Zh=function(r){switch(r.tag){case 3:var s=r.stateNode;if(s.current.memoizedState.isDehydrated){var u=ci(s.pendingLanes);u!==0&&(mu(s,u|1),Sn(s,Tt()),(Qe&6)===0&&(Ns=Tt()+500,ao()))}break;case 13:Uo(function(){var f=Br(r,1);if(f!==null){var y=gn();lr(f,r,1,y)}}),Hd(r,1)}},gu=function(r){if(r.tag===13){var s=Br(r,134217728);if(s!==null){var u=gn();lr(s,r,134217728,u)}Hd(r,134217728)}},em=function(r){if(r.tag===13){var s=ho(r),u=Br(r,s);if(u!==null){var f=gn();lr(u,r,s,f)}Hd(r,s)}},tm=function(){return tt},nm=function(r,s){var u=tt;try{return tt=r,s()}finally{tt=u}},on=function(r,s,u){switch(s){case"input":if(qe(r,u),s=u.name,u.type==="radio"&&s!=null){for(u=r;u.parentNode;)u=u.parentNode;for(u=u.querySelectorAll("input[name="+JSON.stringify(""+s)+'][type="radio"]'),s=0;s<u.length;s++){var f=u[s];if(f!==r&&f.form===r.form){var y=nl(f);if(!y)throw Error(n(90));Xe(f),qe(f,y)}}}break;case"textarea":Qt(r,u);break;case"select":s=u.value,s!=null&&jt(r,!!u.multiple,s,!1)}},Zt=Md,sn=Uo;var cS={usingClientEntryPoint:!1,Events:[Ei,fs,nl,Pt,Wt,Md]},Bi={findFiberByHostInstance:Oo,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},uS={bundleType:Bi.bundleType,version:Bi.version,rendererPackageName:Bi.rendererPackageName,rendererConfig:Bi.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:A.ReactCurrentDispatcher,findHostInstanceByFiber:function(r){return r=Vh(r),r===null?null:r.stateNode},findFiberByHostInstance:Bi.findFiberByHostInstance||aS,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1-next-f1338f8080-20240426"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var zl=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!zl.isDisabled&&zl.supportsFiber)try{_a=zl.inject(uS),xr=zl}catch{}}return Nn.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=cS,Nn.createPortal=function(r,s){var u=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!Vd(s))throw Error(n(200));return iS(r,s,null,u)},Nn.createRoot=function(r,s){if(!Vd(r))throw Error(n(299));var u=!1,f="",y=yx;return s!=null&&(s.unstable_strictMode===!0&&(u=!0),s.identifierPrefix!==void 0&&(f=s.identifierPrefix),s.onRecoverableError!==void 0&&(y=s.onRecoverableError)),s=Ud(r,1,!1,null,null,u,!1,f,y),r[_r]=s.current,Si(r.nodeType===8?r.parentNode:r),new Wd(s)},Nn.findDOMNode=function(r){if(r==null)return null;if(r.nodeType===1)return r;var s=r._reactInternals;if(s===void 0)throw typeof r.render=="function"?Error(n(188)):(r=Object.keys(r).join(","),Error(n(268,r)));return r=Vh(s),r=r===null?null:r.stateNode,r},Nn.flushSync=function(r){return Uo(r)},Nn.hydrate=function(r,s,u){if(!$l(s))throw Error(n(200));return Fl(null,r,s,!0,u)},Nn.hydrateRoot=function(r,s,u){if(!Vd(r))throw Error(n(405));var f=u!=null&&u.hydratedSources||null,y=!1,w="",E=yx;if(u!=null&&(u.unstable_strictMode===!0&&(y=!0),u.identifierPrefix!==void 0&&(w=u.identifierPrefix),u.onRecoverableError!==void 0&&(E=u.onRecoverableError)),s=gx(s,null,r,1,u??null,y,!1,w,E),r[_r]=s.current,Si(r),f)for(r=0;r<f.length;r++)u=f[r],y=u._getVersion,y=y(u._source),s.mutableSourceEagerHydrationData==null?s.mutableSourceEagerHydrationData=[u,y]:s.mutableSourceEagerHydrationData.push(u,y);return new _l(s)},Nn.render=function(r,s,u){if(!$l(s))throw Error(n(200));return Fl(null,r,s,!1,u)},Nn.unmountComponentAtNode=function(r){if(!$l(r))throw Error(n(40));return r._reactRootContainer?(Uo(function(){Fl(null,null,r,!1,function(){r._reactRootContainer=null,r[_r]=null})}),!0):!1},Nn.unstable_batchedUpdates=Md,Nn.unstable_renderSubtreeIntoContainer=function(r,s,u,f){if(!$l(u))throw Error(n(200));if(r==null||r._reactInternals===void 0)throw Error(n(38));return Fl(r,s,u,!1,f)},Nn.version="18.3.1-next-f1338f8080-20240426",Nn}var Ex;function Uv(){if(Ex)return Gd.exports;Ex=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),Gd.exports=yS(),Gd.exports}var Px;function vS(){if(Px)return Bl;Px=1;var e=Uv();return Bl.createRoot=e.createRoot,Bl.hydrateRoot=e.hydrateRoot,Bl}var bS=vS();/**
41
+ * react-router v7.13.1
42
+ *
43
+ * Copyright (c) Remix Software Inc.
44
+ *
45
+ * This source code is licensed under the MIT license found in the
46
+ * LICENSE.md file in the root directory of this source tree.
47
+ *
48
+ * @license MIT
49
+ */var Tx="popstate";function Rx(e){return typeof e=="object"&&e!=null&&"pathname"in e&&"search"in e&&"hash"in e&&"state"in e&&"key"in e}function wS(e={}){function t(o,a){var m;let l=(m=a.state)==null?void 0:m.masked,{pathname:c,search:d,hash:p}=l||o.location;return Uf("",{pathname:c,search:d,hash:p},a.state&&a.state.usr||null,a.state&&a.state.key||"default",l?{pathname:o.location.pathname,search:o.location.search,hash:o.location.hash}:void 0)}function n(o,a){return typeof a=="string"?a:ha(a)}return jS(t,n,null,e)}function wt(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function ur(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function kS(){return Math.random().toString(36).substring(2,10)}function Ax(e,t){return{usr:e.state,key:e.key,idx:t,masked:e.unstable_mask?{pathname:e.pathname,search:e.search,hash:e.hash}:void 0}}function Uf(e,t,n=null,o,a){return{pathname:typeof e=="string"?e:e.pathname,search:"",hash:"",...typeof t=="string"?Gs(t):t,state:n,key:t&&t.key||o||kS(),unstable_mask:a}}function ha({pathname:e="/",search:t="",hash:n=""}){return t&&t!=="?"&&(e+=t.charAt(0)==="?"?t:"?"+t),n&&n!=="#"&&(e+=n.charAt(0)==="#"?n:"#"+n),e}function Gs(e){let t={};if(e){let n=e.indexOf("#");n>=0&&(t.hash=e.substring(n),e=e.substring(0,n));let o=e.indexOf("?");o>=0&&(t.search=e.substring(o),e=e.substring(0,o)),e&&(t.pathname=e)}return t}function jS(e,t,n,o={}){let{window:a=document.defaultView,v5Compat:l=!1}=o,c=a.history,d="POP",p=null,m=h();m==null&&(m=0,c.replaceState({...c.state,idx:m},""));function h(){return(c.state||{idx:null}).idx}function x(){d="POP";let j=h(),S=j==null?null:j-m;m=j,p&&p({action:d,location:k.location,delta:S})}function v(j,S){d="PUSH";let R=Rx(j)?j:Uf(k.location,j,S);m=h()+1;let N=Ax(R,m),A=k.createHref(R.unstable_mask||R);try{c.pushState(N,"",A)}catch(O){if(O instanceof DOMException&&O.name==="DataCloneError")throw O;a.location.assign(A)}l&&p&&p({action:d,location:k.location,delta:1})}function b(j,S){d="REPLACE";let R=Rx(j)?j:Uf(k.location,j,S);m=h();let N=Ax(R,m),A=k.createHref(R.unstable_mask||R);c.replaceState(N,"",A),l&&p&&p({action:d,location:k.location,delta:0})}function C(j){return SS(j)}let k={get action(){return d},get location(){return e(a,c)},listen(j){if(p)throw new Error("A history only accepts one active listener");return a.addEventListener(Tx,x),p=j,()=>{a.removeEventListener(Tx,x),p=null}},createHref(j){return t(a,j)},createURL:C,encodeLocation(j){let S=C(j);return{pathname:S.pathname,search:S.search,hash:S.hash}},push:v,replace:b,go(j){return c.go(j)}};return k}function SS(e,t=!1){let n="http://localhost";typeof window<"u"&&(n=window.location.origin!=="null"?window.location.origin:window.location.href),wt(n,"No window.location.(origin|href) available to create URL");let o=typeof e=="string"?e:ha(e);return o=o.replace(/ $/,"%20"),!t&&o.startsWith("//")&&(o=n+o),new URL(o,n)}function Hv(e,t,n="/"){return NS(e,t,n,!1)}function NS(e,t,n,o){let a=typeof t=="string"?Gs(t):t,l=Kr(a.pathname||"/",n);if(l==null)return null;let c=Wv(e);CS(c);let d=null;for(let p=0;d==null&&p<c.length;++p){let m=_S(l);d=LS(c[p],m,o)}return d}function Wv(e,t=[],n=[],o="",a=!1){let l=(c,d,p=a,m)=>{let h={relativePath:m===void 0?c.path||"":m,caseSensitive:c.caseSensitive===!0,childrenIndex:d,route:c};if(h.relativePath.startsWith("/")){if(!h.relativePath.startsWith(o)&&p)return;wt(h.relativePath.startsWith(o),`Absolute route path "${h.relativePath}" nested under path "${o}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),h.relativePath=h.relativePath.slice(o.length)}let x=Cr([o,h.relativePath]),v=n.concat(h);c.children&&c.children.length>0&&(wt(c.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${x}".`),Wv(c.children,t,v,x,p)),!(c.path==null&&!c.index)&&t.push({path:x,score:IS(x,c.index),routesMeta:v})};return e.forEach((c,d)=>{var p;if(c.path===""||!((p=c.path)!=null&&p.includes("?")))l(c,d);else for(let m of Vv(c.path))l(c,d,!0,m)}),t}function Vv(e){let t=e.split("/");if(t.length===0)return[];let[n,...o]=t,a=n.endsWith("?"),l=n.replace(/\?$/,"");if(o.length===0)return a?[l,""]:[l];let c=Vv(o.join("/")),d=[];return d.push(...c.map(p=>p===""?l:[l,p].join("/"))),a&&d.push(...c),d.map(p=>e.startsWith("/")&&p===""?"/":p)}function CS(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:OS(t.routesMeta.map(o=>o.childrenIndex),n.routesMeta.map(o=>o.childrenIndex)))}var ES=/^:[\w-]+$/,PS=3,TS=2,RS=1,AS=10,DS=-2,Dx=e=>e==="*";function IS(e,t){let n=e.split("/"),o=n.length;return n.some(Dx)&&(o+=DS),t&&(o+=TS),n.filter(a=>!Dx(a)).reduce((a,l)=>a+(ES.test(l)?PS:l===""?RS:AS),o)}function OS(e,t){return e.length===t.length&&e.slice(0,-1).every((o,a)=>o===t[a])?e[e.length-1]-t[t.length-1]:0}function LS(e,t,n=!1){let{routesMeta:o}=e,a={},l="/",c=[];for(let d=0;d<o.length;++d){let p=o[d],m=d===o.length-1,h=l==="/"?t:t.slice(l.length)||"/",x=pc({path:p.relativePath,caseSensitive:p.caseSensitive,end:m},h),v=p.route;if(!x&&m&&n&&!o[o.length-1].route.index&&(x=pc({path:p.relativePath,caseSensitive:p.caseSensitive,end:!1},h)),!x)return null;Object.assign(a,x.params),c.push({params:a,pathname:Cr([l,x.pathname]),pathnameBase:BS(Cr([l,x.pathnameBase])),route:v}),x.pathnameBase!=="/"&&(l=Cr([l,x.pathnameBase]))}return c}function pc(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[n,o]=MS(e.path,e.caseSensitive,e.end),a=t.match(n);if(!a)return null;let l=a[0],c=l.replace(/(.)\/+$/,"$1"),d=a.slice(1);return{params:o.reduce((m,{paramName:h,isOptional:x},v)=>{if(h==="*"){let C=d[v]||"";c=l.slice(0,l.length-C.length).replace(/(.)\/+$/,"$1")}const b=d[v];return x&&!b?m[h]=void 0:m[h]=(b||"").replace(/%2F/g,"/"),m},{}),pathname:l,pathnameBase:c,pattern:e}}function MS(e,t=!1,n=!0){ur(e==="*"||!e.endsWith("*")||e.endsWith("/*"),`Route path "${e}" will be treated as if it were "${e.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${e.replace(/\*$/,"/*")}".`);let o=[],a="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(c,d,p,m,h)=>{if(o.push({paramName:d,isOptional:p!=null}),p){let x=h.charAt(m+c.length);return x&&x!=="/"?"/([^\\/]*)":"(?:/([^\\/]*))?"}return"/([^\\/]+)"}).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return e.endsWith("*")?(o.push({paramName:"*"}),a+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?a+="\\/*$":e!==""&&e!=="/"&&(a+="(?:(?=\\/|$))"),[new RegExp(a,t?void 0:"i"),o]}function _S(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return ur(!1,`The URL path "${e}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${t}).`),e}}function Kr(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith("/")?t.length-1:t.length,o=e.charAt(n);return o&&o!=="/"?null:e.slice(n)||"/"}var $S=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i;function FS(e,t="/"){let{pathname:n,search:o="",hash:a=""}=typeof e=="string"?Gs(e):e,l;return n?(n=n.replace(/\/\/+/g,"/"),n.startsWith("/")?l=Ix(n.substring(1),"/"):l=Ix(n,t)):l=t,{pathname:l,search:US(o),hash:HS(a)}}function Ix(e,t){let n=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(a=>{a===".."?n.length>1&&n.pop():a!=="."&&n.push(a)}),n.length>1?n.join("/"):"/"}function Qd(e,t,n,o){return`Cannot include a '${e}' character in a manually specified \`to.${t}\` field [${JSON.stringify(o)}]. Please separate it out to the \`to.${n}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function zS(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function qv(e){let t=zS(e);return t.map((n,o)=>o===t.length-1?n.pathname:n.pathnameBase)}function Ep(e,t,n,o=!1){let a;typeof e=="string"?a=Gs(e):(a={...e},wt(!a.pathname||!a.pathname.includes("?"),Qd("?","pathname","search",a)),wt(!a.pathname||!a.pathname.includes("#"),Qd("#","pathname","hash",a)),wt(!a.search||!a.search.includes("#"),Qd("#","search","hash",a)));let l=e===""||a.pathname==="",c=l?"/":a.pathname,d;if(c==null)d=n;else{let x=t.length-1;if(!o&&c.startsWith("..")){let v=c.split("/");for(;v[0]==="..";)v.shift(),x-=1;a.pathname=v.join("/")}d=x>=0?t[x]:"/"}let p=FS(a,d),m=c&&c!=="/"&&c.endsWith("/"),h=(l||c===".")&&n.endsWith("/");return!p.pathname.endsWith("/")&&(m||h)&&(p.pathname+="/"),p}var Cr=e=>e.join("/").replace(/\/\/+/g,"/"),BS=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),US=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,HS=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e,WS=class{constructor(e,t,n,o=!1){this.status=e,this.statusText=t||"",this.internal=o,n instanceof Error?(this.data=n.toString(),this.error=n):this.data=n}};function VS(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}function qS(e){return e.map(t=>t.route.path).filter(Boolean).join("/").replace(/\/\/*/g,"/")||"/"}var Kv=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function Gv(e,t){let n=e;if(typeof n!="string"||!$S.test(n))return{absoluteURL:void 0,isExternal:!1,to:n};let o=n,a=!1;if(Kv)try{let l=new URL(window.location.href),c=n.startsWith("//")?new URL(l.protocol+n):new URL(n),d=Kr(c.pathname,t);c.origin===l.origin&&d!=null?n=d+c.search+c.hash:a=!0}catch{ur(!1,`<Link to="${n}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:o,isExternal:a,to:n}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");var Yv=["POST","PUT","PATCH","DELETE"];new Set(Yv);var KS=["GET",...Yv];new Set(KS);var Ys=g.createContext(null);Ys.displayName="DataRouter";var Ac=g.createContext(null);Ac.displayName="DataRouterState";var GS=g.createContext(!1),Xv=g.createContext({isTransitioning:!1});Xv.displayName="ViewTransition";var YS=g.createContext(new Map);YS.displayName="Fetchers";var XS=g.createContext(null);XS.displayName="Await";var Zn=g.createContext(null);Zn.displayName="Navigation";var wa=g.createContext(null);wa.displayName="Location";var hr=g.createContext({outlet:null,matches:[],isDataRoute:!1});hr.displayName="Route";var Pp=g.createContext(null);Pp.displayName="RouteError";var Qv="REACT_ROUTER_ERROR",QS="REDIRECT",JS="ROUTE_ERROR_RESPONSE";function ZS(e){if(e.startsWith(`${Qv}:${QS}:{`))try{let t=JSON.parse(e.slice(28));if(typeof t=="object"&&t&&typeof t.status=="number"&&typeof t.statusText=="string"&&typeof t.location=="string"&&typeof t.reloadDocument=="boolean"&&typeof t.replace=="boolean")return t}catch{}}function eN(e){if(e.startsWith(`${Qv}:${JS}:{`))try{let t=JSON.parse(e.slice(40));if(typeof t=="object"&&t&&typeof t.status=="number"&&typeof t.statusText=="string")return new WS(t.status,t.statusText,t.data)}catch{}}function tN(e,{relative:t}={}){wt(ka(),"useHref() may be used only in the context of a <Router> component.");let{basename:n,navigator:o}=g.useContext(Zn),{hash:a,pathname:l,search:c}=ja(e,{relative:t}),d=l;return n!=="/"&&(d=l==="/"?n:Cr([n,l])),o.createHref({pathname:d,search:c,hash:a})}function ka(){return g.useContext(wa)!=null}function xn(){return wt(ka(),"useLocation() may be used only in the context of a <Router> component."),g.useContext(wa).location}var Jv="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function Zv(e){g.useContext(Zn).static||g.useLayoutEffect(e)}function Ut(){let{isDataRoute:e}=g.useContext(hr);return e?gN():nN()}function nN(){wt(ka(),"useNavigate() may be used only in the context of a <Router> component.");let e=g.useContext(Ys),{basename:t,navigator:n}=g.useContext(Zn),{matches:o}=g.useContext(hr),{pathname:a}=xn(),l=JSON.stringify(qv(o)),c=g.useRef(!1);return Zv(()=>{c.current=!0}),g.useCallback((p,m={})=>{if(ur(c.current,Jv),!c.current)return;if(typeof p=="number"){n.go(p);return}let h=Ep(p,JSON.parse(l),a,m.relative==="path");e==null&&t!=="/"&&(h.pathname=h.pathname==="/"?t:Cr([t,h.pathname])),(m.replace?n.replace:n.push)(h,m.state,m)},[t,n,l,a,e])}var rN=g.createContext(null);function oN(e){let t=g.useContext(hr).outlet;return g.useMemo(()=>t&&g.createElement(rN.Provider,{value:e},t),[t,e])}function At(){let{matches:e}=g.useContext(hr),t=e[e.length-1];return t?t.params:{}}function ja(e,{relative:t}={}){let{matches:n}=g.useContext(hr),{pathname:o}=xn(),a=JSON.stringify(qv(n));return g.useMemo(()=>Ep(e,JSON.parse(a),o,t==="path"),[e,a,o,t])}function sN(e,t){return eb(e,t)}function eb(e,t,n){var j;wt(ka(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:o}=g.useContext(Zn),{matches:a}=g.useContext(hr),l=a[a.length-1],c=l?l.params:{},d=l?l.pathname:"/",p=l?l.pathnameBase:"/",m=l&&l.route;{let S=m&&m.path||"";nb(d,!m||S.endsWith("*")||S.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${d}" (under <Route path="${S}">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render.
50
+
51
+ Please change the parent <Route path="${S}"> to <Route path="${S==="/"?"*":`${S}/*`}">.`)}let h=xn(),x;if(t){let S=typeof t=="string"?Gs(t):t;wt(p==="/"||((j=S.pathname)==null?void 0:j.startsWith(p)),`When overriding the location using \`<Routes location>\` or \`useRoutes(routes, location)\`, the location pathname must begin with the portion of the URL pathname that was matched by all parent routes. The current pathname base is "${p}" but pathname "${S.pathname}" was given in the \`location\` prop.`),x=S}else x=h;let v=x.pathname||"/",b=v;if(p!=="/"){let S=p.replace(/^\//,"").split("/");b="/"+v.replace(/^\//,"").split("/").slice(S.length).join("/")}let C=Hv(e,{pathname:b});ur(m||C!=null,`No routes matched location "${x.pathname}${x.search}${x.hash}" `),ur(C==null||C[C.length-1].route.element!==void 0||C[C.length-1].route.Component!==void 0||C[C.length-1].route.lazy!==void 0,`Matched leaf route at location "${x.pathname}${x.search}${x.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`);let k=uN(C&&C.map(S=>Object.assign({},S,{params:Object.assign({},c,S.params),pathname:Cr([p,o.encodeLocation?o.encodeLocation(S.pathname.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:S.pathname]),pathnameBase:S.pathnameBase==="/"?p:Cr([p,o.encodeLocation?o.encodeLocation(S.pathnameBase.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:S.pathnameBase])})),a,n);return t&&k?g.createElement(wa.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",unstable_mask:void 0,...x},navigationType:"POP"}},k):k}function iN(){let e=mN(),t=VS(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,o="rgba(200,200,200, 0.5)",a={padding:"0.5rem",backgroundColor:o},l={padding:"2px 4px",backgroundColor:o},c=null;return console.error("Error handled by React Router default ErrorBoundary:",e),c=g.createElement(g.Fragment,null,g.createElement("p",null,"💿 Hey developer 👋"),g.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",g.createElement("code",{style:l},"ErrorBoundary")," or"," ",g.createElement("code",{style:l},"errorElement")," prop on your route.")),g.createElement(g.Fragment,null,g.createElement("h2",null,"Unexpected Application Error!"),g.createElement("h3",{style:{fontStyle:"italic"}},t),n?g.createElement("pre",{style:a},n):null,c)}var aN=g.createElement(iN,null),tb=class extends g.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location!==e.location||t.revalidation!=="idle"&&e.revalidation==="idle"?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error!==void 0?e.error:t.error,location:t.location,revalidation:e.revalidation||t.revalidation}}componentDidCatch(e,t){this.props.onError?this.props.onError(e,t):console.error("React Router caught the following error during render",e)}render(){let e=this.state.error;if(this.context&&typeof e=="object"&&e&&"digest"in e&&typeof e.digest=="string"){const n=eN(e.digest);n&&(e=n)}let t=e!==void 0?g.createElement(hr.Provider,{value:this.props.routeContext},g.createElement(Pp.Provider,{value:e,children:this.props.component})):this.props.children;return this.context?g.createElement(lN,{error:e},t):t}};tb.contextType=GS;var Jd=new WeakMap;function lN({children:e,error:t}){let{basename:n}=g.useContext(Zn);if(typeof t=="object"&&t&&"digest"in t&&typeof t.digest=="string"){let o=ZS(t.digest);if(o){let a=Jd.get(t);if(a)throw a;let l=Gv(o.location,n);if(Kv&&!Jd.get(t))if(l.isExternal||o.reloadDocument)window.location.href=l.absoluteURL||l.to;else{const c=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(l.to,{replace:o.replace}));throw Jd.set(t,c),c}return g.createElement("meta",{httpEquiv:"refresh",content:`0;url=${l.absoluteURL||l.to}`})}}return e}function cN({routeContext:e,match:t,children:n}){let o=g.useContext(Ys);return o&&o.static&&o.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(o.staticContext._deepestRenderedBoundaryId=t.route.id),g.createElement(hr.Provider,{value:e},n)}function uN(e,t=[],n){let o=n==null?void 0:n.state;if(e==null){if(!o)return null;if(o.errors)e=o.matches;else if(t.length===0&&!o.initialized&&o.matches.length>0)e=o.matches;else return null}let a=e,l=o==null?void 0:o.errors;if(l!=null){let h=a.findIndex(x=>x.route.id&&(l==null?void 0:l[x.route.id])!==void 0);wt(h>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(l).join(",")}`),a=a.slice(0,Math.min(a.length,h+1))}let c=!1,d=-1;if(n&&o){c=o.renderFallback;for(let h=0;h<a.length;h++){let x=a[h];if((x.route.HydrateFallback||x.route.hydrateFallbackElement)&&(d=h),x.route.id){let{loaderData:v,errors:b}=o,C=x.route.loader&&!v.hasOwnProperty(x.route.id)&&(!b||b[x.route.id]===void 0);if(x.route.lazy||C){n.isStatic&&(c=!0),d>=0?a=a.slice(0,d+1):a=[a[0]];break}}}}let p=n==null?void 0:n.onError,m=o&&p?(h,x)=>{var v,b;p(h,{location:o.location,params:((b=(v=o.matches)==null?void 0:v[0])==null?void 0:b.params)??{},unstable_pattern:qS(o.matches),errorInfo:x})}:void 0;return a.reduceRight((h,x,v)=>{let b,C=!1,k=null,j=null;o&&(b=l&&x.route.id?l[x.route.id]:void 0,k=x.route.errorElement||aN,c&&(d<0&&v===0?(nb("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),C=!0,j=null):d===v&&(C=!0,j=x.route.hydrateFallbackElement||null)));let S=t.concat(a.slice(0,v+1)),R=()=>{let N;return b?N=k:C?N=j:x.route.Component?N=g.createElement(x.route.Component,null):x.route.element?N=x.route.element:N=h,g.createElement(cN,{match:x,routeContext:{outlet:h,matches:S,isDataRoute:o!=null},children:N})};return o&&(x.route.ErrorBoundary||x.route.errorElement||v===0)?g.createElement(tb,{location:o.location,revalidation:o.revalidation,component:k,error:b,children:R(),routeContext:{outlet:null,matches:S,isDataRoute:!0},onError:m}):R()},null)}function Tp(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function dN(e){let t=g.useContext(Ys);return wt(t,Tp(e)),t}function fN(e){let t=g.useContext(Ac);return wt(t,Tp(e)),t}function pN(e){let t=g.useContext(hr);return wt(t,Tp(e)),t}function Rp(e){let t=pN(e),n=t.matches[t.matches.length-1];return wt(n.route.id,`${e} can only be used on routes that contain a unique "id"`),n.route.id}function hN(){return Rp("useRouteId")}function mN(){var o;let e=g.useContext(Pp),t=fN("useRouteError"),n=Rp("useRouteError");return e!==void 0?e:(o=t.errors)==null?void 0:o[n]}function gN(){let{router:e}=dN("useNavigate"),t=Rp("useNavigate"),n=g.useRef(!1);return Zv(()=>{n.current=!0}),g.useCallback(async(a,l={})=>{ur(n.current,Jv),n.current&&(typeof a=="number"?await e.navigate(a):await e.navigate(a,{fromRouteId:t,...l}))},[e,t])}var Ox={};function nb(e,t,n){!t&&!Ox[e]&&(Ox[e]=!0,ur(!1,n))}g.memo(xN);function xN({routes:e,future:t,state:n,isStatic:o,onError:a}){return eb(e,void 0,{state:n,isStatic:o,onError:a})}function yN(e){return oN(e.context)}function _e(e){wt(!1,"A <Route> is only ever to be used as the child of <Routes> element, never rendered directly. Please wrap your <Route> in a <Routes>.")}function vN({basename:e="/",children:t=null,location:n,navigationType:o="POP",navigator:a,static:l=!1,unstable_useTransitions:c}){wt(!ka(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let d=e.replace(/^\/*/,"/"),p=g.useMemo(()=>({basename:d,navigator:a,static:l,unstable_useTransitions:c,future:{}}),[d,a,l,c]);typeof n=="string"&&(n=Gs(n));let{pathname:m="/",search:h="",hash:x="",state:v=null,key:b="default",unstable_mask:C}=n,k=g.useMemo(()=>{let j=Kr(m,d);return j==null?null:{location:{pathname:j,search:h,hash:x,state:v,key:b,unstable_mask:C},navigationType:o}},[d,m,h,x,v,b,o,C]);return ur(k!=null,`<Router basename="${d}"> is not able to match the URL "${m}${h}${x}" because it does not start with the basename, so the <Router> won't render anything.`),k==null?null:g.createElement(Zn.Provider,{value:p},g.createElement(wa.Provider,{children:t,value:k}))}function bN({children:e,location:t}){return sN(Hf(e),t)}function Hf(e,t=[]){let n=[];return g.Children.forEach(e,(o,a)=>{if(!g.isValidElement(o))return;let l=[...t,a];if(o.type===g.Fragment){n.push.apply(n,Hf(o.props.children,l));return}wt(o.type===_e,`[${typeof o.type=="string"?o.type:o.type.name}] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>`),wt(!o.props.index||!o.props.children,"An index route cannot have child routes.");let c={id:o.props.id||l.join("-"),caseSensitive:o.props.caseSensitive,element:o.props.element,Component:o.props.Component,index:o.props.index,path:o.props.path,middleware:o.props.middleware,loader:o.props.loader,action:o.props.action,hydrateFallbackElement:o.props.hydrateFallbackElement,HydrateFallback:o.props.HydrateFallback,errorElement:o.props.errorElement,ErrorBoundary:o.props.ErrorBoundary,hasErrorBoundary:o.props.hasErrorBoundary===!0||o.props.ErrorBoundary!=null||o.props.errorElement!=null,shouldRevalidate:o.props.shouldRevalidate,handle:o.props.handle,lazy:o.props.lazy};o.props.children&&(c.children=Hf(o.props.children,l)),n.push(c)}),n}var nc="get",rc="application/x-www-form-urlencoded";function Dc(e){return typeof HTMLElement<"u"&&e instanceof HTMLElement}function wN(e){return Dc(e)&&e.tagName.toLowerCase()==="button"}function kN(e){return Dc(e)&&e.tagName.toLowerCase()==="form"}function jN(e){return Dc(e)&&e.tagName.toLowerCase()==="input"}function SN(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function NN(e,t){return e.button===0&&(!t||t==="_self")&&!SN(e)}function Wf(e=""){return new URLSearchParams(typeof e=="string"||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((t,n)=>{let o=e[n];return t.concat(Array.isArray(o)?o.map(a=>[n,a]):[[n,o]])},[]))}function CN(e,t){let n=Wf(e);return t&&t.forEach((o,a)=>{n.has(a)||t.getAll(a).forEach(l=>{n.append(a,l)})}),n}var Ul=null;function EN(){if(Ul===null)try{new FormData(document.createElement("form"),0),Ul=!1}catch{Ul=!0}return Ul}var PN=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function Zd(e){return e!=null&&!PN.has(e)?(ur(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${rc}"`),null):e}function TN(e,t){let n,o,a,l,c;if(kN(e)){let d=e.getAttribute("action");o=d?Kr(d,t):null,n=e.getAttribute("method")||nc,a=Zd(e.getAttribute("enctype"))||rc,l=new FormData(e)}else if(wN(e)||jN(e)&&(e.type==="submit"||e.type==="image")){let d=e.form;if(d==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let p=e.getAttribute("formaction")||d.getAttribute("action");if(o=p?Kr(p,t):null,n=e.getAttribute("formmethod")||d.getAttribute("method")||nc,a=Zd(e.getAttribute("formenctype"))||Zd(d.getAttribute("enctype"))||rc,l=new FormData(d,e),!EN()){let{name:m,type:h,value:x}=e;if(h==="image"){let v=m?`${m}.`:"";l.append(`${v}x`,"0"),l.append(`${v}y`,"0")}else m&&l.append(m,x)}}else{if(Dc(e))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');n=nc,o=null,a=rc,c=e}return l&&a==="text/plain"&&(c=l,l=void 0),{action:o,method:n.toLowerCase(),encType:a,formData:l,body:c}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function Ap(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function RN(e,t,n,o){let a=typeof e=="string"?new URL(e,typeof window>"u"?"server://singlefetch/":window.location.origin):e;return n?a.pathname.endsWith("/")?a.pathname=`${a.pathname}_.${o}`:a.pathname=`${a.pathname}.${o}`:a.pathname==="/"?a.pathname=`_root.${o}`:t&&Kr(a.pathname,t)==="/"?a.pathname=`${t.replace(/\/$/,"")}/_root.${o}`:a.pathname=`${a.pathname.replace(/\/$/,"")}.${o}`,a}async function AN(e,t){if(e.id in t)return t[e.id];try{let n=await import(e.module);return t[e.id]=n,n}catch(n){return console.error(`Error loading route module \`${e.module}\`, reloading page...`),console.error(n),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function DN(e){return e==null?!1:e.href==null?e.rel==="preload"&&typeof e.imageSrcSet=="string"&&typeof e.imageSizes=="string":typeof e.rel=="string"&&typeof e.href=="string"}async function IN(e,t,n){let o=await Promise.all(e.map(async a=>{let l=t.routes[a.route.id];if(l){let c=await AN(l,n);return c.links?c.links():[]}return[]}));return _N(o.flat(1).filter(DN).filter(a=>a.rel==="stylesheet"||a.rel==="preload").map(a=>a.rel==="stylesheet"?{...a,rel:"prefetch",as:"style"}:{...a,rel:"prefetch"}))}function Lx(e,t,n,o,a,l){let c=(p,m)=>n[m]?p.route.id!==n[m].route.id:!0,d=(p,m)=>{var h;return n[m].pathname!==p.pathname||((h=n[m].route.path)==null?void 0:h.endsWith("*"))&&n[m].params["*"]!==p.params["*"]};return l==="assets"?t.filter((p,m)=>c(p,m)||d(p,m)):l==="data"?t.filter((p,m)=>{var x;let h=o.routes[p.route.id];if(!h||!h.hasLoader)return!1;if(c(p,m)||d(p,m))return!0;if(p.route.shouldRevalidate){let v=p.route.shouldRevalidate({currentUrl:new URL(a.pathname+a.search+a.hash,window.origin),currentParams:((x=n[0])==null?void 0:x.params)||{},nextUrl:new URL(e,window.origin),nextParams:p.params,defaultShouldRevalidate:!0});if(typeof v=="boolean")return v}return!0}):[]}function ON(e,t,{includeHydrateFallback:n}={}){return LN(e.map(o=>{let a=t.routes[o.route.id];if(!a)return[];let l=[a.module];return a.clientActionModule&&(l=l.concat(a.clientActionModule)),a.clientLoaderModule&&(l=l.concat(a.clientLoaderModule)),n&&a.hydrateFallbackModule&&(l=l.concat(a.hydrateFallbackModule)),a.imports&&(l=l.concat(a.imports)),l}).flat(1))}function LN(e){return[...new Set(e)]}function MN(e){let t={},n=Object.keys(e).sort();for(let o of n)t[o]=e[o];return t}function _N(e,t){let n=new Set;return new Set(t),e.reduce((o,a)=>{let l=JSON.stringify(MN(a));return n.has(l)||(n.add(l),o.push({key:l,link:a})),o},[])}function rb(){let e=g.useContext(Ys);return Ap(e,"You must render this element inside a <DataRouterContext.Provider> element"),e}function $N(){let e=g.useContext(Ac);return Ap(e,"You must render this element inside a <DataRouterStateContext.Provider> element"),e}var Dp=g.createContext(void 0);Dp.displayName="FrameworkContext";function ob(){let e=g.useContext(Dp);return Ap(e,"You must render this element inside a <HydratedRouter> element"),e}function FN(e,t){let n=g.useContext(Dp),[o,a]=g.useState(!1),[l,c]=g.useState(!1),{onFocus:d,onBlur:p,onMouseEnter:m,onMouseLeave:h,onTouchStart:x}=t,v=g.useRef(null);g.useEffect(()=>{if(e==="render"&&c(!0),e==="viewport"){let k=S=>{S.forEach(R=>{c(R.isIntersecting)})},j=new IntersectionObserver(k,{threshold:.5});return v.current&&j.observe(v.current),()=>{j.disconnect()}}},[e]),g.useEffect(()=>{if(o){let k=setTimeout(()=>{c(!0)},100);return()=>{clearTimeout(k)}}},[o]);let b=()=>{a(!0)},C=()=>{a(!1),c(!1)};return n?e!=="intent"?[l,v,{}]:[l,v,{onFocus:Hi(d,b),onBlur:Hi(p,C),onMouseEnter:Hi(m,b),onMouseLeave:Hi(h,C),onTouchStart:Hi(x,b)}]:[!1,v,{}]}function Hi(e,t){return n=>{e&&e(n),n.defaultPrevented||t(n)}}function zN({page:e,...t}){let{router:n}=rb(),o=g.useMemo(()=>Hv(n.routes,e,n.basename),[n.routes,e,n.basename]);return o?g.createElement(UN,{page:e,matches:o,...t}):null}function BN(e){let{manifest:t,routeModules:n}=ob(),[o,a]=g.useState([]);return g.useEffect(()=>{let l=!1;return IN(e,t,n).then(c=>{l||a(c)}),()=>{l=!0}},[e,t,n]),o}function UN({page:e,matches:t,...n}){let o=xn(),{future:a,manifest:l,routeModules:c}=ob(),{basename:d}=rb(),{loaderData:p,matches:m}=$N(),h=g.useMemo(()=>Lx(e,t,m,l,o,"data"),[e,t,m,l,o]),x=g.useMemo(()=>Lx(e,t,m,l,o,"assets"),[e,t,m,l,o]),v=g.useMemo(()=>{if(e===o.pathname+o.search+o.hash)return[];let k=new Set,j=!1;if(t.forEach(R=>{var A;let N=l.routes[R.route.id];!N||!N.hasLoader||(!h.some(O=>O.route.id===R.route.id)&&R.route.id in p&&((A=c[R.route.id])!=null&&A.shouldRevalidate)||N.hasClientLoader?j=!0:k.add(R.route.id))}),k.size===0)return[];let S=RN(e,d,a.unstable_trailingSlashAwareDataRequests,"data");return j&&k.size>0&&S.searchParams.set("_routes",t.filter(R=>k.has(R.route.id)).map(R=>R.route.id).join(",")),[S.pathname+S.search]},[d,a.unstable_trailingSlashAwareDataRequests,p,o,l,h,t,e,c]),b=g.useMemo(()=>ON(x,l),[x,l]),C=BN(x);return g.createElement(g.Fragment,null,v.map(k=>g.createElement("link",{key:k,rel:"prefetch",as:"fetch",href:k,...n})),b.map(k=>g.createElement("link",{key:k,rel:"modulepreload",href:k,...n})),C.map(({key:k,link:j})=>g.createElement("link",{key:k,nonce:n.nonce,...j,crossOrigin:j.crossOrigin??n.crossOrigin})))}function HN(...e){return t=>{e.forEach(n=>{typeof n=="function"?n(t):n!=null&&(n.current=t)})}}var WN=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{WN&&(window.__reactRouterVersion="7.13.1")}catch{}function VN({basename:e,children:t,unstable_useTransitions:n,window:o}){let a=g.useRef();a.current==null&&(a.current=wS({window:o,v5Compat:!0}));let l=a.current,[c,d]=g.useState({action:l.action,location:l.location}),p=g.useCallback(m=>{n===!1?d(m):g.startTransition(()=>d(m))},[n]);return g.useLayoutEffect(()=>l.listen(p),[l,p]),g.createElement(vN,{basename:e,children:t,location:c.location,navigationType:c.action,navigator:l,unstable_useTransitions:n})}var sb=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,De=g.forwardRef(function({onClick:t,discover:n="render",prefetch:o="none",relative:a,reloadDocument:l,replace:c,unstable_mask:d,state:p,target:m,to:h,preventScrollReset:x,viewTransition:v,unstable_defaultShouldRevalidate:b,...C},k){let{basename:j,navigator:S,unstable_useTransitions:R}=g.useContext(Zn),N=typeof h=="string"&&sb.test(h),A=Gv(h,j);h=A.to;let O=tN(h,{relative:a}),T=xn(),D=null;if(d){let _=Ep(d,[],T.unstable_mask?T.unstable_mask.pathname:"/",!0);j!=="/"&&(_.pathname=_.pathname==="/"?j:Cr([j,_.pathname])),D=S.createHref(_)}let[L,G,re]=FN(o,C),z=YN(h,{replace:c,unstable_mask:d,state:p,target:m,preventScrollReset:x,relative:a,viewTransition:v,unstable_defaultShouldRevalidate:b,unstable_useTransitions:R});function K(_){t&&t(_),_.defaultPrevented||z(_)}let q=!(A.isExternal||l),J=g.createElement("a",{...C,...re,href:(q?D:void 0)||A.absoluteURL||O,onClick:q?K:t,ref:HN(k,G),target:m,"data-discover":!N&&n==="render"?"true":void 0});return L&&!N?g.createElement(g.Fragment,null,J,g.createElement(zN,{page:O})):J});De.displayName="Link";var qN=g.forwardRef(function({"aria-current":t="page",caseSensitive:n=!1,className:o="",end:a=!1,style:l,to:c,viewTransition:d,children:p,...m},h){let x=ja(c,{relative:m.relative}),v=xn(),b=g.useContext(Ac),{navigator:C,basename:k}=g.useContext(Zn),j=b!=null&&eC(x)&&d===!0,S=C.encodeLocation?C.encodeLocation(x).pathname:x.pathname,R=v.pathname,N=b&&b.navigation&&b.navigation.location?b.navigation.location.pathname:null;n||(R=R.toLowerCase(),N=N?N.toLowerCase():null,S=S.toLowerCase()),N&&k&&(N=Kr(N,k)||N);const A=S!=="/"&&S.endsWith("/")?S.length-1:S.length;let O=R===S||!a&&R.startsWith(S)&&R.charAt(A)==="/",T=N!=null&&(N===S||!a&&N.startsWith(S)&&N.charAt(S.length)==="/"),D={isActive:O,isPending:T,isTransitioning:j},L=O?t:void 0,G;typeof o=="function"?G=o(D):G=[o,O?"active":null,T?"pending":null,j?"transitioning":null].filter(Boolean).join(" ");let re=typeof l=="function"?l(D):l;return g.createElement(De,{...m,"aria-current":L,className:G,ref:h,style:re,to:c,viewTransition:d},typeof p=="function"?p(D):p)});qN.displayName="NavLink";var KN=g.forwardRef(({discover:e="render",fetcherKey:t,navigate:n,reloadDocument:o,replace:a,state:l,method:c=nc,action:d,onSubmit:p,relative:m,preventScrollReset:h,viewTransition:x,unstable_defaultShouldRevalidate:v,...b},C)=>{let{unstable_useTransitions:k}=g.useContext(Zn),j=JN(),S=ZN(d,{relative:m}),R=c.toLowerCase()==="get"?"get":"post",N=typeof d=="string"&&sb.test(d),A=O=>{if(p&&p(O),O.defaultPrevented)return;O.preventDefault();let T=O.nativeEvent.submitter,D=(T==null?void 0:T.getAttribute("formmethod"))||c,L=()=>j(T||O.currentTarget,{fetcherKey:t,method:D,navigate:n,replace:a,state:l,relative:m,preventScrollReset:h,viewTransition:x,unstable_defaultShouldRevalidate:v});k&&n!==!1?g.startTransition(()=>L()):L()};return g.createElement("form",{ref:C,method:R,action:S,onSubmit:o?p:A,...b,"data-discover":!N&&e==="render"?"true":void 0})});KN.displayName="Form";function GN(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function ib(e){let t=g.useContext(Ys);return wt(t,GN(e)),t}function YN(e,{target:t,replace:n,unstable_mask:o,state:a,preventScrollReset:l,relative:c,viewTransition:d,unstable_defaultShouldRevalidate:p,unstable_useTransitions:m}={}){let h=Ut(),x=xn(),v=ja(e,{relative:c});return g.useCallback(b=>{if(NN(b,t)){b.preventDefault();let C=n!==void 0?n:ha(x)===ha(v),k=()=>h(e,{replace:C,unstable_mask:o,state:a,preventScrollReset:l,relative:c,viewTransition:d,unstable_defaultShouldRevalidate:p});m?g.startTransition(()=>k()):k()}},[x,h,v,n,o,a,t,e,l,c,d,p,m])}function To(e){ur(typeof URLSearchParams<"u","You cannot use the `useSearchParams` hook in a browser that does not support the URLSearchParams API. If you need to support Internet Explorer 11, we recommend you load a polyfill such as https://github.com/ungap/url-search-params.");let t=g.useRef(Wf(e)),n=g.useRef(!1),o=xn(),a=g.useMemo(()=>CN(o.search,n.current?null:t.current),[o.search]),l=Ut(),c=g.useCallback((d,p)=>{const m=Wf(typeof d=="function"?d(new URLSearchParams(a)):d);n.current=!0,l("?"+m,p)},[l,a]);return[a,c]}var XN=0,QN=()=>`__${String(++XN)}__`;function JN(){let{router:e}=ib("useSubmit"),{basename:t}=g.useContext(Zn),n=hN(),o=e.fetch,a=e.navigate;return g.useCallback(async(l,c={})=>{let{action:d,method:p,encType:m,formData:h,body:x}=TN(l,t);if(c.navigate===!1){let v=c.fetcherKey||QN();await o(v,n,c.action||d,{unstable_defaultShouldRevalidate:c.unstable_defaultShouldRevalidate,preventScrollReset:c.preventScrollReset,formData:h,body:x,formMethod:c.method||p,formEncType:c.encType||m,flushSync:c.flushSync})}else await a(c.action||d,{unstable_defaultShouldRevalidate:c.unstable_defaultShouldRevalidate,preventScrollReset:c.preventScrollReset,formData:h,body:x,formMethod:c.method||p,formEncType:c.encType||m,replace:c.replace,state:c.state,fromRouteId:n,flushSync:c.flushSync,viewTransition:c.viewTransition})},[o,a,t,n])}function ZN(e,{relative:t}={}){let{basename:n}=g.useContext(Zn),o=g.useContext(hr);wt(o,"useFormAction must be used inside a RouteContext");let[a]=o.matches.slice(-1),l={...ja(e||".",{relative:t})},c=xn();if(e==null){l.search=c.search;let d=new URLSearchParams(l.search),p=d.getAll("index");if(p.some(h=>h==="")){d.delete("index"),p.filter(x=>x).forEach(x=>d.append("index",x));let h=d.toString();l.search=h?`?${h}`:""}}return(!e||e===".")&&a.route.index&&(l.search=l.search?l.search.replace(/^\?/,"?index&"):"?index"),n!=="/"&&(l.pathname=l.pathname==="/"?n:Cr([n,l.pathname])),ha(l)}function eC(e,{relative:t}={}){let n=g.useContext(Xv);wt(n!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:o}=ib("useViewTransitionState"),a=ja(e,{relative:t});if(!n.isTransitioning)return!1;let l=Kr(n.currentLocation.pathname,o)||n.currentLocation.pathname,c=Kr(n.nextLocation.pathname,o)||n.nextLocation.pathname;return pc(a.pathname,c)!=null||pc(a.pathname,l)!=null}var So=Uv();const tC=Rc(So);/**
52
+ * @license lucide-react v0.460.0 - ISC
53
+ *
54
+ * This source code is licensed under the ISC license.
55
+ * See the LICENSE file in the root directory of this source tree.
56
+ */const nC=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),ab=(...e)=>e.filter((t,n,o)=>!!t&&t.trim()!==""&&o.indexOf(t)===n).join(" ").trim();/**
57
+ * @license lucide-react v0.460.0 - ISC
58
+ *
59
+ * This source code is licensed under the ISC license.
60
+ * See the LICENSE file in the root directory of this source tree.
61
+ */var rC={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"};/**
62
+ * @license lucide-react v0.460.0 - ISC
63
+ *
64
+ * This source code is licensed under the ISC license.
65
+ * See the LICENSE file in the root directory of this source tree.
66
+ */const oC=g.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:o,className:a="",children:l,iconNode:c,...d},p)=>g.createElement("svg",{ref:p,...rC,width:t,height:t,stroke:e,strokeWidth:o?Number(n)*24/Number(t):n,className:ab("lucide",a),...d},[...c.map(([m,h])=>g.createElement(m,h)),...Array.isArray(l)?l:[l]]));/**
67
+ * @license lucide-react v0.460.0 - ISC
68
+ *
69
+ * This source code is licensed under the ISC license.
70
+ * See the LICENSE file in the root directory of this source tree.
71
+ */const je=(e,t)=>{const n=g.forwardRef(({className:o,...a},l)=>g.createElement(oC,{ref:l,iconNode:t,className:ab(`lucide-${nC(e)}`,o),...a}));return n.displayName=`${e}`,n};/**
72
+ * @license lucide-react v0.460.0 - ISC
73
+ *
74
+ * This source code is licensed under the ISC license.
75
+ * See the LICENSE file in the root directory of this source tree.
76
+ */const Ic=je("Activity",[["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"}]]);/**
77
+ * @license lucide-react v0.460.0 - ISC
78
+ *
79
+ * This source code is licensed under the ISC license.
80
+ * See the LICENSE file in the root directory of this source tree.
81
+ */const lb=je("ArrowLeft",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]);/**
82
+ * @license lucide-react v0.460.0 - ISC
83
+ *
84
+ * This source code is licensed under the ISC license.
85
+ * See the LICENSE file in the root directory of this source tree.
86
+ */const cb=je("ArrowRightLeft",[["path",{d:"m16 3 4 4-4 4",key:"1x1c3m"}],["path",{d:"M20 7H4",key:"zbl0bi"}],["path",{d:"m8 21-4-4 4-4",key:"h9nckh"}],["path",{d:"M4 17h16",key:"g4d7ey"}]]);/**
87
+ * @license lucide-react v0.460.0 - ISC
88
+ *
89
+ * This source code is licensed under the ISC license.
90
+ * See the LICENSE file in the root directory of this source tree.
91
+ */const sC=je("ArrowRight",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]]);/**
92
+ * @license lucide-react v0.460.0 - ISC
93
+ *
94
+ * This source code is licensed under the ISC license.
95
+ * See the LICENSE file in the root directory of this source tree.
96
+ */const hc=je("ArrowUpRight",[["path",{d:"M7 7h10v10",key:"1tivn9"}],["path",{d:"M7 17 17 7",key:"1vkiza"}]]);/**
97
+ * @license lucide-react v0.460.0 - ISC
98
+ *
99
+ * This source code is licensed under the ISC license.
100
+ * See the LICENSE file in the root directory of this source tree.
101
+ */const iC=je("BookOpenText",[["path",{d:"M12 7v14",key:"1akyts"}],["path",{d:"M16 12h2",key:"7q9ll5"}],["path",{d:"M16 8h2",key:"msurwy"}],["path",{d:"M3 18a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h5a4 4 0 0 1 4 4 4 4 0 0 1 4-4h5a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1h-6a3 3 0 0 0-3 3 3 3 0 0 0-3-3z",key:"ruj8y"}],["path",{d:"M6 12h2",key:"32wvfc"}],["path",{d:"M6 8h2",key:"30oboj"}]]);/**
102
+ * @license lucide-react v0.460.0 - ISC
103
+ *
104
+ * This source code is licensed under the ISC license.
105
+ * See the LICENSE file in the root directory of this source tree.
106
+ */const ub=je("BookOpen",[["path",{d:"M12 7v14",key:"1akyts"}],["path",{d:"M3 18a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h5a4 4 0 0 1 4 4 4 4 0 0 1 4-4h5a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1h-6a3 3 0 0 0-3 3 3 3 0 0 0-3-3z",key:"ruj8y"}]]);/**
107
+ * @license lucide-react v0.460.0 - ISC
108
+ *
109
+ * This source code is licensed under the ISC license.
110
+ * See the LICENSE file in the root directory of this source tree.
111
+ */const Sa=je("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/**
112
+ * @license lucide-react v0.460.0 - ISC
113
+ *
114
+ * This source code is licensed under the ISC license.
115
+ * See the LICENSE file in the root directory of this source tree.
116
+ */const ma=je("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/**
117
+ * @license lucide-react v0.460.0 - ISC
118
+ *
119
+ * This source code is licensed under the ISC license.
120
+ * See the LICENSE file in the root directory of this source tree.
121
+ */const aC=je("ChevronLeft",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]);/**
122
+ * @license lucide-react v0.460.0 - ISC
123
+ *
124
+ * This source code is licensed under the ISC license.
125
+ * See the LICENSE file in the root directory of this source tree.
126
+ */const db=je("ChevronUp",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);/**
127
+ * @license lucide-react v0.460.0 - ISC
128
+ *
129
+ * This source code is licensed under the ISC license.
130
+ * See the LICENSE file in the root directory of this source tree.
131
+ */const Vf=je("CircleAlert",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]]);/**
132
+ * @license lucide-react v0.460.0 - ISC
133
+ *
134
+ * This source code is licensed under the ISC license.
135
+ * See the LICENSE file in the root directory of this source tree.
136
+ */const Ip=je("CircleCheck",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);/**
137
+ * @license lucide-react v0.460.0 - ISC
138
+ *
139
+ * This source code is licensed under the ISC license.
140
+ * See the LICENSE file in the root directory of this source tree.
141
+ */const qf=je("CircleDot",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}]]);/**
142
+ * @license lucide-react v0.460.0 - ISC
143
+ *
144
+ * This source code is licensed under the ISC license.
145
+ * See the LICENSE file in the root directory of this source tree.
146
+ */const lC=je("CircleStop",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["rect",{x:"9",y:"9",width:"6",height:"6",rx:"1",key:"1ssd4o"}]]);/**
147
+ * @license lucide-react v0.460.0 - ISC
148
+ *
149
+ * This source code is licensed under the ISC license.
150
+ * See the LICENSE file in the root directory of this source tree.
151
+ */const cC=je("Circle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);/**
152
+ * @license lucide-react v0.460.0 - ISC
153
+ *
154
+ * This source code is licensed under the ISC license.
155
+ * See the LICENSE file in the root directory of this source tree.
156
+ */const uC=je("ClipboardCheck",[["rect",{width:"8",height:"4",x:"8",y:"2",rx:"1",ry:"1",key:"tgr4d6"}],["path",{d:"M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2",key:"116196"}],["path",{d:"m9 14 2 2 4-4",key:"df797q"}]]);/**
157
+ * @license lucide-react v0.460.0 - ISC
158
+ *
159
+ * This source code is licensed under the ISC license.
160
+ * See the LICENSE file in the root directory of this source tree.
161
+ */const dC=je("Clock3",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16.5 12",key:"1aq6pp"}]]);/**
162
+ * @license lucide-react v0.460.0 - ISC
163
+ *
164
+ * This source code is licensed under the ISC license.
165
+ * See the LICENSE file in the root directory of this source tree.
166
+ */const fC=je("Cloud",[["path",{d:"M17.5 19H9a7 7 0 1 1 6.71-9h1.79a4.5 4.5 0 1 1 0 9Z",key:"p7xjir"}]]);/**
167
+ * @license lucide-react v0.460.0 - ISC
168
+ *
169
+ * This source code is licensed under the ISC license.
170
+ * See the LICENSE file in the root directory of this source tree.
171
+ */const pC=je("Compass",[["path",{d:"m16.24 7.76-1.804 5.411a2 2 0 0 1-1.265 1.265L7.76 16.24l1.804-5.411a2 2 0 0 1 1.265-1.265z",key:"9ktpf1"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);/**
172
+ * @license lucide-react v0.460.0 - ISC
173
+ *
174
+ * This source code is licensed under the ISC license.
175
+ * See the LICENSE file in the root directory of this source tree.
176
+ */const Oc=je("Copy",[["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"}]]);/**
177
+ * @license lucide-react v0.460.0 - ISC
178
+ *
179
+ * This source code is licensed under the ISC license.
180
+ * See the LICENSE file in the root directory of this source tree.
181
+ */const hC=je("Download",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"7 10 12 15 17 10",key:"2ggqvy"}],["line",{x1:"12",x2:"12",y1:"15",y2:"3",key:"1vk2je"}]]);/**
182
+ * @license lucide-react v0.460.0 - ISC
183
+ *
184
+ * This source code is licensed under the ISC license.
185
+ * See the LICENSE file in the root directory of this source tree.
186
+ */const mC=je("Ellipsis",[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"19",cy:"12",r:"1",key:"1wjl8i"}],["circle",{cx:"5",cy:"12",r:"1",key:"1pcz8c"}]]);/**
187
+ * @license lucide-react v0.460.0 - ISC
188
+ *
189
+ * This source code is licensed under the ISC license.
190
+ * See the LICENSE file in the root directory of this source tree.
191
+ */const fb=je("ExternalLink",[["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"}]]);/**
192
+ * @license lucide-react v0.460.0 - ISC
193
+ *
194
+ * This source code is licensed under the ISC license.
195
+ * See the LICENSE file in the root directory of this source tree.
196
+ */const Mx=je("Eye",[["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"}]]);/**
197
+ * @license lucide-react v0.460.0 - ISC
198
+ *
199
+ * This source code is licensed under the ISC license.
200
+ * See the LICENSE file in the root directory of this source tree.
201
+ */const gC=je("FileCode2",[["path",{d:"M4 22h14a2 2 0 0 0 2-2V7l-5-5H6a2 2 0 0 0-2 2v4",key:"1pf5j1"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"m5 12-3 3 3 3",key:"oke12k"}],["path",{d:"m9 18 3-3-3-3",key:"112psh"}]]);/**
202
+ * @license lucide-react v0.460.0 - ISC
203
+ *
204
+ * This source code is licensed under the ISC license.
205
+ * See the LICENSE file in the root directory of this source tree.
206
+ */const xC=je("FilePenLine",[["path",{d:"m18 5-2.414-2.414A2 2 0 0 0 14.172 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2",key:"142zxg"}],["path",{d:"M21.378 12.626a1 1 0 0 0-3.004-3.004l-4.01 4.012a2 2 0 0 0-.506.854l-.837 2.87a.5.5 0 0 0 .62.62l2.87-.837a2 2 0 0 0 .854-.506z",key:"2t3380"}],["path",{d:"M8 18h1",key:"13wk12"}]]);/**
207
+ * @license lucide-react v0.460.0 - ISC
208
+ *
209
+ * This source code is licensed under the ISC license.
210
+ * See the LICENSE file in the root directory of this source tree.
211
+ */const pb=je("FileText",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]]);/**
212
+ * @license lucide-react v0.460.0 - ISC
213
+ *
214
+ * This source code is licensed under the ISC license.
215
+ * See the LICENSE file in the root directory of this source tree.
216
+ */const yC=je("Flame",[["path",{d:"M8.5 14.5A2.5 2.5 0 0 0 11 12c0-1.38-.5-2-1-3-1.072-2.143-.224-4.054 2-6 .5 2.5 2 4.9 4 6.5 2 1.6 3 3.5 3 5.5a7 7 0 1 1-14 0c0-1.153.433-2.294 1-3a2.5 2.5 0 0 0 2.5 2.5z",key:"96xj49"}]]);/**
217
+ * @license lucide-react v0.460.0 - ISC
218
+ *
219
+ * This source code is licensed under the ISC license.
220
+ * See the LICENSE file in the root directory of this source tree.
221
+ */const Op=je("FolderKanban",[["path",{d:"M4 20h16a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.93a2 2 0 0 1-1.66-.9l-.82-1.2A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13c0 1.1.9 2 2 2Z",key:"1fr9dc"}],["path",{d:"M8 10v4",key:"tgpxqk"}],["path",{d:"M12 10v2",key:"hh53o1"}],["path",{d:"M16 10v6",key:"1d6xys"}]]);/**
222
+ * @license lucide-react v0.460.0 - ISC
223
+ *
224
+ * This source code is licensed under the ISC license.
225
+ * See the LICENSE file in the root directory of this source tree.
226
+ */const vC=je("Gauge",[["path",{d:"m12 14 4-4",key:"9kzdfg"}],["path",{d:"M3.34 19a10 10 0 1 1 17.32 0",key:"19p75a"}]]);/**
227
+ * @license lucide-react v0.460.0 - ISC
228
+ *
229
+ * This source code is licensed under the ISC license.
230
+ * See the LICENSE file in the root directory of this source tree.
231
+ */const Lp=je("GitBranch",[["line",{x1:"6",x2:"6",y1:"3",y2:"15",key:"17qcm7"}],["circle",{cx:"18",cy:"6",r:"3",key:"1h7g24"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}],["path",{d:"M18 9a9 9 0 0 1-9 9",key:"n2h4wq"}]]);/**
232
+ * @license lucide-react v0.460.0 - ISC
233
+ *
234
+ * This source code is licensed under the ISC license.
235
+ * See the LICENSE file in the root directory of this source tree.
236
+ */const hb=je("GripVertical",[["circle",{cx:"9",cy:"12",r:"1",key:"1vctgf"}],["circle",{cx:"9",cy:"5",r:"1",key:"hp0tcf"}],["circle",{cx:"9",cy:"19",r:"1",key:"fkjjf6"}],["circle",{cx:"15",cy:"12",r:"1",key:"1tmaij"}],["circle",{cx:"15",cy:"5",r:"1",key:"19l28e"}],["circle",{cx:"15",cy:"19",r:"1",key:"f4zoj3"}]]);/**
237
+ * @license lucide-react v0.460.0 - ISC
238
+ *
239
+ * This source code is licensed under the ISC license.
240
+ * See the LICENSE file in the root directory of this source tree.
241
+ */const bC=je("Hammer",[["path",{d:"m15 12-8.373 8.373a1 1 0 1 1-3-3L12 9",key:"eefl8a"}],["path",{d:"m18 15 4-4",key:"16gjal"}],["path",{d:"m21.5 11.5-1.914-1.914A2 2 0 0 1 19 8.172V7l-2.26-2.26a6 6 0 0 0-4.202-1.756L9 2.96l.92.82A6.18 6.18 0 0 1 12 8.4V10l2 2h1.172a2 2 0 0 1 1.414.586L18.5 14.5",key:"b7pghm"}]]);/**
242
+ * @license lucide-react v0.460.0 - ISC
243
+ *
244
+ * This source code is licensed under the ISC license.
245
+ * See the LICENSE file in the root directory of this source tree.
246
+ */const wC=je("Hourglass",[["path",{d:"M5 22h14",key:"ehvnwv"}],["path",{d:"M5 2h14",key:"pdyrp9"}],["path",{d:"M17 22v-4.172a2 2 0 0 0-.586-1.414L12 12l-4.414 4.414A2 2 0 0 0 7 17.828V22",key:"1d314k"}],["path",{d:"M7 2v4.172a2 2 0 0 0 .586 1.414L12 12l4.414-4.414A2 2 0 0 0 17 6.172V2",key:"1vvvr6"}]]);/**
247
+ * @license lucide-react v0.460.0 - ISC
248
+ *
249
+ * This source code is licensed under the ISC license.
250
+ * See the LICENSE file in the root directory of this source tree.
251
+ */const mb=je("Info",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]]);/**
252
+ * @license lucide-react v0.460.0 - ISC
253
+ *
254
+ * This source code is licensed under the ISC license.
255
+ * See the LICENSE file in the root directory of this source tree.
256
+ */const Kf=je("Keyboard",[["path",{d:"M10 8h.01",key:"1r9ogq"}],["path",{d:"M12 12h.01",key:"1mp3jc"}],["path",{d:"M14 8h.01",key:"1primd"}],["path",{d:"M16 12h.01",key:"1l6xoz"}],["path",{d:"M18 8h.01",key:"emo2bl"}],["path",{d:"M6 8h.01",key:"x9i8wu"}],["path",{d:"M7 16h10",key:"wp8him"}],["path",{d:"M8 12h.01",key:"czm47f"}],["rect",{width:"20",height:"16",x:"2",y:"4",rx:"2",key:"18n3k1"}]]);/**
257
+ * @license lucide-react v0.460.0 - ISC
258
+ *
259
+ * This source code is licensed under the ISC license.
260
+ * See the LICENSE file in the root directory of this source tree.
261
+ */const kC=je("LifeBuoy",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m4.93 4.93 4.24 4.24",key:"1ymg45"}],["path",{d:"m14.83 9.17 4.24-4.24",key:"1cb5xl"}],["path",{d:"m14.83 14.83 4.24 4.24",key:"q42g0n"}],["path",{d:"m9.17 14.83-4.24 4.24",key:"bqpfvv"}],["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}]]);/**
262
+ * @license lucide-react v0.460.0 - ISC
263
+ *
264
+ * This source code is licensed under the ISC license.
265
+ * See the LICENSE file in the root directory of this source tree.
266
+ */const jC=je("Link",[["path",{d:"M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71",key:"1cjeqo"}],["path",{d:"M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71",key:"19qd67"}]]);/**
267
+ * @license lucide-react v0.460.0 - ISC
268
+ *
269
+ * This source code is licensed under the ISC license.
270
+ * See the LICENSE file in the root directory of this source tree.
271
+ */const SC=je("ListTodo",[["rect",{x:"3",y:"5",width:"6",height:"6",rx:"1",key:"1defrl"}],["path",{d:"m3 17 2 2 4-4",key:"1jhpwq"}],["path",{d:"M13 6h8",key:"15sg57"}],["path",{d:"M13 12h8",key:"h98zly"}],["path",{d:"M13 18h8",key:"oe0vm4"}]]);/**
272
+ * @license lucide-react v0.460.0 - ISC
273
+ *
274
+ * This source code is licensed under the ISC license.
275
+ * See the LICENSE file in the root directory of this source tree.
276
+ */const gb=je("LoaderCircle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);/**
277
+ * @license lucide-react v0.460.0 - ISC
278
+ *
279
+ * This source code is licensed under the ISC license.
280
+ * See the LICENSE file in the root directory of this source tree.
281
+ */const NC=je("Menu",[["line",{x1:"4",x2:"20",y1:"12",y2:"12",key:"1e0a9i"}],["line",{x1:"4",x2:"20",y1:"6",y2:"6",key:"1owob3"}],["line",{x1:"4",x2:"20",y1:"18",y2:"18",key:"yk5zj1"}]]);/**
282
+ * @license lucide-react v0.460.0 - ISC
283
+ *
284
+ * This source code is licensed under the ISC license.
285
+ * See the LICENSE file in the root directory of this source tree.
286
+ */const Mp=je("Monitor",[["rect",{width:"20",height:"14",x:"2",y:"3",rx:"2",key:"48i651"}],["line",{x1:"8",x2:"16",y1:"21",y2:"21",key:"1svkeh"}],["line",{x1:"12",x2:"12",y1:"17",y2:"21",key:"vw1qmm"}]]);/**
287
+ * @license lucide-react v0.460.0 - ISC
288
+ *
289
+ * This source code is licensed under the ISC license.
290
+ * See the LICENSE file in the root directory of this source tree.
291
+ */const CC=je("MoonStar",[["path",{d:"M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9",key:"4ay0iu"}],["path",{d:"M20 3v4",key:"1olli1"}],["path",{d:"M22 5h-4",key:"1gvqau"}]]);/**
292
+ * @license lucide-react v0.460.0 - ISC
293
+ *
294
+ * This source code is licensed under the ISC license.
295
+ * See the LICENSE file in the root directory of this source tree.
296
+ */const ef=je("NotebookPen",[["path",{d:"M13.4 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-7.4",key:"re6nr2"}],["path",{d:"M2 6h4",key:"aawbzj"}],["path",{d:"M2 10h4",key:"l0bgd4"}],["path",{d:"M2 14h4",key:"1gsvsf"}],["path",{d:"M2 18h4",key:"1bu2t1"}],["path",{d:"M21.378 5.626a1 1 0 1 0-3.004-3.004l-5.01 5.012a2 2 0 0 0-.506.854l-.837 2.87a.5.5 0 0 0 .62.62l2.87-.837a2 2 0 0 0 .854-.506z",key:"pqwjuv"}]]);/**
297
+ * @license lucide-react v0.460.0 - ISC
298
+ *
299
+ * This source code is licensed under the ISC license.
300
+ * See the LICENSE file in the root directory of this source tree.
301
+ */const EC=je("OctagonX",[["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"M2.586 16.726A2 2 0 0 1 2 15.312V8.688a2 2 0 0 1 .586-1.414l4.688-4.688A2 2 0 0 1 8.688 2h6.624a2 2 0 0 1 1.414.586l4.688 4.688A2 2 0 0 1 22 8.688v6.624a2 2 0 0 1-.586 1.414l-4.688 4.688a2 2 0 0 1-1.414.586H8.688a2 2 0 0 1-1.414-.586z",key:"2d38gg"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]]);/**
302
+ * @license lucide-react v0.460.0 - ISC
303
+ *
304
+ * This source code is licensed under the ISC license.
305
+ * See the LICENSE file in the root directory of this source tree.
306
+ */const PC=je("Pencil",[["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"}]]);/**
307
+ * @license lucide-react v0.460.0 - ISC
308
+ *
309
+ * This source code is licensed under the ISC license.
310
+ * See the LICENSE file in the root directory of this source tree.
311
+ */const Un=je("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);/**
312
+ * @license lucide-react v0.460.0 - ISC
313
+ *
314
+ * This source code is licensed under the ISC license.
315
+ * See the LICENSE file in the root directory of this source tree.
316
+ */const xb=je("RefreshCw",[["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"}]]);/**
317
+ * @license lucide-react v0.460.0 - ISC
318
+ *
319
+ * This source code is licensed under the ISC license.
320
+ * See the LICENSE file in the root directory of this source tree.
321
+ */const TC=je("Reply",[["polyline",{points:"9 17 4 12 9 7",key:"hvgpf2"}],["path",{d:"M20 18v-2a4 4 0 0 0-4-4H4",key:"5vmcpk"}]]);/**
322
+ * @license lucide-react v0.460.0 - ISC
323
+ *
324
+ * This source code is licensed under the ISC license.
325
+ * See the LICENSE file in the root directory of this source tree.
326
+ */const Gf=je("RotateCcw",[["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"}]]);/**
327
+ * @license lucide-react v0.460.0 - ISC
328
+ *
329
+ * This source code is licensed under the ISC license.
330
+ * See the LICENSE file in the root directory of this source tree.
331
+ */const _p=je("Save",[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",key:"1ydtos"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7",key:"t51u73"}]]);/**
332
+ * @license lucide-react v0.460.0 - ISC
333
+ *
334
+ * This source code is licensed under the ISC license.
335
+ * See the LICENSE file in the root directory of this source tree.
336
+ */const RC=je("SearchCheck",[["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"}]]);/**
337
+ * @license lucide-react v0.460.0 - ISC
338
+ *
339
+ * This source code is licensed under the ISC license.
340
+ * See the LICENSE file in the root directory of this source tree.
341
+ */const Xs=je("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);/**
342
+ * @license lucide-react v0.460.0 - ISC
343
+ *
344
+ * This source code is licensed under the ISC license.
345
+ * See the LICENSE file in the root directory of this source tree.
346
+ */const AC=je("SendToBack",[["rect",{x:"14",y:"14",width:"8",height:"8",rx:"2",key:"1b0bso"}],["rect",{x:"2",y:"2",width:"8",height:"8",rx:"2",key:"1x09vl"}],["path",{d:"M7 14v1a2 2 0 0 0 2 2h1",key:"pao6x6"}],["path",{d:"M14 7h1a2 2 0 0 1 2 2v1",key:"19tdru"}]]);/**
347
+ * @license lucide-react v0.460.0 - ISC
348
+ *
349
+ * This source code is licensed under the ISC license.
350
+ * See the LICENSE file in the root directory of this source tree.
351
+ */const DC=je("ServerOff",[["path",{d:"M7 2h13a2 2 0 0 1 2 2v4a2 2 0 0 1-2 2h-5",key:"bt2siv"}],["path",{d:"M10 10 2.5 2.5C2 2 2 2.5 2 5v3a2 2 0 0 0 2 2h6z",key:"1hjrv1"}],["path",{d:"M22 17v-1a2 2 0 0 0-2-2h-1",key:"1iynyr"}],["path",{d:"M4 14a2 2 0 0 0-2 2v4a2 2 0 0 0 2 2h16.5l1-.5.5.5-8-8H4z",key:"161ggg"}],["path",{d:"M6 18h.01",key:"uhywen"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]]);/**
352
+ * @license lucide-react v0.460.0 - ISC
353
+ *
354
+ * This source code is licensed under the ISC license.
355
+ * See the LICENSE file in the root directory of this source tree.
356
+ */const IC=je("Settings",[["path",{d:"M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z",key:"1qme2f"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);/**
357
+ * @license lucide-react v0.460.0 - ISC
358
+ *
359
+ * This source code is licensed under the ISC license.
360
+ * See the LICENSE file in the root directory of this source tree.
361
+ */const OC=je("ShieldX",[["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:"m14.5 9.5-5 5",key:"17q4r4"}],["path",{d:"m9.5 9.5 5 5",key:"18nt4w"}]]);/**
362
+ * @license lucide-react v0.460.0 - ISC
363
+ *
364
+ * This source code is licensed under the ISC license.
365
+ * See the LICENSE file in the root directory of this source tree.
366
+ */const zn=je("SquareCheckBig",[["path",{d:"M21 10.5V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h12.5",key:"1uzm8b"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]]);/**
367
+ * @license lucide-react v0.460.0 - ISC
368
+ *
369
+ * This source code is licensed under the ISC license.
370
+ * See the LICENSE file in the root directory of this source tree.
371
+ */const _x=je("SquarePen",[["path",{d:"M12 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7",key:"1m0v6g"}],["path",{d:"M18.375 2.625a1 1 0 0 1 3 3l-9.013 9.014a2 2 0 0 1-.853.505l-2.873.84a.5.5 0 0 1-.62-.62l.84-2.873a2 2 0 0 1 .506-.852z",key:"ohrbg2"}]]);/**
372
+ * @license lucide-react v0.460.0 - ISC
373
+ *
374
+ * This source code is licensed under the ISC license.
375
+ * See the LICENSE file in the root directory of this source tree.
376
+ */const yb=je("Square",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]]);/**
377
+ * @license lucide-react v0.460.0 - ISC
378
+ *
379
+ * This source code is licensed under the ISC license.
380
+ * See the LICENSE file in the root directory of this source tree.
381
+ */const LC=je("SunMedium",[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 3v1",key:"1asbbs"}],["path",{d:"M12 20v1",key:"1wcdkc"}],["path",{d:"M3 12h1",key:"lp3yf2"}],["path",{d:"M20 12h1",key:"1vloll"}],["path",{d:"m18.364 5.636-.707.707",key:"1hakh0"}],["path",{d:"m6.343 17.657-.707.707",key:"18m9nf"}],["path",{d:"m5.636 5.636.707.707",key:"1xv1c5"}],["path",{d:"m17.657 17.657.707.707",key:"vl76zb"}]]);/**
382
+ * @license lucide-react v0.460.0 - ISC
383
+ *
384
+ * This source code is licensed under the ISC license.
385
+ * See the LICENSE file in the root directory of this source tree.
386
+ */const vb=je("Tag",[["path",{d:"M12.586 2.586A2 2 0 0 0 11.172 2H4a2 2 0 0 0-2 2v7.172a2 2 0 0 0 .586 1.414l8.704 8.704a2.426 2.426 0 0 0 3.42 0l6.58-6.58a2.426 2.426 0 0 0 0-3.42z",key:"vktsd0"}],["circle",{cx:"7.5",cy:"7.5",r:".5",fill:"currentColor",key:"kqv944"}]]);/**
387
+ * @license lucide-react v0.460.0 - ISC
388
+ *
389
+ * This source code is licensed under the ISC license.
390
+ * See the LICENSE file in the root directory of this source tree.
391
+ */const MC=je("Terminal",[["polyline",{points:"4 17 10 11 4 5",key:"akl6gq"}],["line",{x1:"12",x2:"20",y1:"19",y2:"19",key:"q2wloq"}]]);/**
392
+ * @license lucide-react v0.460.0 - ISC
393
+ *
394
+ * This source code is licensed under the ISC license.
395
+ * See the LICENSE file in the root directory of this source tree.
396
+ */const Ro=je("Trash2",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]]);/**
397
+ * @license lucide-react v0.460.0 - ISC
398
+ *
399
+ * This source code is licensed under the ISC license.
400
+ * See the LICENSE file in the root directory of this source tree.
401
+ */const Qs=je("TriangleAlert",[["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"}]]);/**
402
+ * @license lucide-react v0.460.0 - ISC
403
+ *
404
+ * This source code is licensed under the ISC license.
405
+ * See the LICENSE file in the root directory of this source tree.
406
+ */const _C=je("Upload",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"17 8 12 3 7 8",key:"t8dd8p"}],["line",{x1:"12",x2:"12",y1:"3",y2:"15",key:"widbto"}]]);/**
407
+ * @license lucide-react v0.460.0 - ISC
408
+ *
409
+ * This source code is licensed under the ISC license.
410
+ * See the LICENSE file in the root directory of this source tree.
411
+ */const $p=je("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);function bb(e){var t,n,o="";if(typeof e=="string"||typeof e=="number")o+=e;else if(typeof e=="object")if(Array.isArray(e)){var a=e.length;for(t=0;t<a;t++)e[t]&&(n=bb(e[t]))&&(o&&(o+=" "),o+=n)}else for(n in e)e[n]&&(o&&(o+=" "),o+=n);return o}function $C(){for(var e,t,n=0,o="",a=arguments.length;n<a;n++)(e=arguments[n])&&(t=bb(e))&&(o&&(o+=" "),o+=t);return o}const Fp="-",FC=e=>{const t=BC(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:o}=e;return{getClassGroupId:c=>{const d=c.split(Fp);return d[0]===""&&d.length!==1&&d.shift(),wb(d,t)||zC(c)},getConflictingClassGroupIds:(c,d)=>{const p=n[c]||[];return d&&o[c]?[...p,...o[c]]:p}}},wb=(e,t)=>{var c;if(e.length===0)return t.classGroupId;const n=e[0],o=t.nextPart.get(n),a=o?wb(e.slice(1),o):void 0;if(a)return a;if(t.validators.length===0)return;const l=e.join(Fp);return(c=t.validators.find(({validator:d})=>d(l)))==null?void 0:c.classGroupId},$x=/^\[(.+)\]$/,zC=e=>{if($x.test(e)){const t=$x.exec(e)[1],n=t==null?void 0:t.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}},BC=e=>{const{theme:t,prefix:n}=e,o={nextPart:new Map,validators:[]};return HC(Object.entries(e.classGroups),n).forEach(([l,c])=>{Yf(c,o,l,t)}),o},Yf=(e,t,n,o)=>{e.forEach(a=>{if(typeof a=="string"){const l=a===""?t:Fx(t,a);l.classGroupId=n;return}if(typeof a=="function"){if(UC(a)){Yf(a(o),t,n,o);return}t.validators.push({validator:a,classGroupId:n});return}Object.entries(a).forEach(([l,c])=>{Yf(c,Fx(t,l),n,o)})})},Fx=(e,t)=>{let n=e;return t.split(Fp).forEach(o=>{n.nextPart.has(o)||n.nextPart.set(o,{nextPart:new Map,validators:[]}),n=n.nextPart.get(o)}),n},UC=e=>e.isThemeGetter,HC=(e,t)=>t?e.map(([n,o])=>{const a=o.map(l=>typeof l=="string"?t+l:typeof l=="object"?Object.fromEntries(Object.entries(l).map(([c,d])=>[t+c,d])):l);return[n,a]}):e,WC=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=new Map,o=new Map;const a=(l,c)=>{n.set(l,c),t++,t>e&&(t=0,o=n,n=new Map)};return{get(l){let c=n.get(l);if(c!==void 0)return c;if((c=o.get(l))!==void 0)return a(l,c),c},set(l,c){n.has(l)?n.set(l,c):a(l,c)}}},kb="!",VC=e=>{const{separator:t,experimentalParseClassName:n}=e,o=t.length===1,a=t[0],l=t.length,c=d=>{const p=[];let m=0,h=0,x;for(let j=0;j<d.length;j++){let S=d[j];if(m===0){if(S===a&&(o||d.slice(j,j+l)===t)){p.push(d.slice(h,j)),h=j+l;continue}if(S==="/"){x=j;continue}}S==="["?m++:S==="]"&&m--}const v=p.length===0?d:d.substring(h),b=v.startsWith(kb),C=b?v.substring(1):v,k=x&&x>h?x-h:void 0;return{modifiers:p,hasImportantModifier:b,baseClassName:C,maybePostfixModifierPosition:k}};return n?d=>n({className:d,parseClassName:c}):c},qC=e=>{if(e.length<=1)return e;const t=[];let n=[];return e.forEach(o=>{o[0]==="["?(t.push(...n.sort(),o),n=[]):n.push(o)}),t.push(...n.sort()),t},KC=e=>({cache:WC(e.cacheSize),parseClassName:VC(e),...FC(e)}),GC=/\s+/,YC=(e,t)=>{const{parseClassName:n,getClassGroupId:o,getConflictingClassGroupIds:a}=t,l=[],c=e.trim().split(GC);let d="";for(let p=c.length-1;p>=0;p-=1){const m=c[p],{modifiers:h,hasImportantModifier:x,baseClassName:v,maybePostfixModifierPosition:b}=n(m);let C=!!b,k=o(C?v.substring(0,b):v);if(!k){if(!C){d=m+(d.length>0?" "+d:d);continue}if(k=o(v),!k){d=m+(d.length>0?" "+d:d);continue}C=!1}const j=qC(h).join(":"),S=x?j+kb:j,R=S+k;if(l.includes(R))continue;l.push(R);const N=a(k,C);for(let A=0;A<N.length;++A){const O=N[A];l.push(S+O)}d=m+(d.length>0?" "+d:d)}return d};function XC(){let e=0,t,n,o="";for(;e<arguments.length;)(t=arguments[e++])&&(n=jb(t))&&(o&&(o+=" "),o+=n);return o}const jb=e=>{if(typeof e=="string")return e;let t,n="";for(let o=0;o<e.length;o++)e[o]&&(t=jb(e[o]))&&(n&&(n+=" "),n+=t);return n};function QC(e,...t){let n,o,a,l=c;function c(p){const m=t.reduce((h,x)=>x(h),e());return n=KC(m),o=n.cache.get,a=n.cache.set,l=d,d(p)}function d(p){const m=o(p);if(m)return m;const h=YC(p,n);return a(p,h),h}return function(){return l(XC.apply(null,arguments))}}const dt=e=>{const t=n=>n[e]||[];return t.isThemeGetter=!0,t},Sb=/^\[(?:([a-z-]+):)?(.+)\]$/i,JC=/^\d+\/\d+$/,ZC=new Set(["px","full","screen"]),eE=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,tE=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,nE=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,rE=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,oE=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Vr=e=>Ls(e)||ZC.has(e)||JC.test(e),yo=e=>Js(e,"length",fE),Ls=e=>!!e&&!Number.isNaN(Number(e)),tf=e=>Js(e,"number",Ls),Wi=e=>!!e&&Number.isInteger(Number(e)),sE=e=>e.endsWith("%")&&Ls(e.slice(0,-1)),He=e=>Sb.test(e),vo=e=>eE.test(e),iE=new Set(["length","size","percentage"]),aE=e=>Js(e,iE,Nb),lE=e=>Js(e,"position",Nb),cE=new Set(["image","url"]),uE=e=>Js(e,cE,hE),dE=e=>Js(e,"",pE),Vi=()=>!0,Js=(e,t,n)=>{const o=Sb.exec(e);return o?o[1]?typeof t=="string"?o[1]===t:t.has(o[1]):n(o[2]):!1},fE=e=>tE.test(e)&&!nE.test(e),Nb=()=>!1,pE=e=>rE.test(e),hE=e=>oE.test(e),mE=()=>{const e=dt("colors"),t=dt("spacing"),n=dt("blur"),o=dt("brightness"),a=dt("borderColor"),l=dt("borderRadius"),c=dt("borderSpacing"),d=dt("borderWidth"),p=dt("contrast"),m=dt("grayscale"),h=dt("hueRotate"),x=dt("invert"),v=dt("gap"),b=dt("gradientColorStops"),C=dt("gradientColorStopPositions"),k=dt("inset"),j=dt("margin"),S=dt("opacity"),R=dt("padding"),N=dt("saturate"),A=dt("scale"),O=dt("sepia"),T=dt("skew"),D=dt("space"),L=dt("translate"),G=()=>["auto","contain","none"],re=()=>["auto","hidden","clip","visible","scroll"],z=()=>["auto",He,t],K=()=>[He,t],q=()=>["",Vr,yo],J=()=>["auto",Ls,He],_=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],F=()=>["solid","dashed","dotted","double","none"],B=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],U=()=>["start","end","center","between","around","evenly","stretch"],Z=()=>["","0",He],P=()=>["auto","avoid","all","avoid-page","page","left","right","column"],M=()=>[Ls,He];return{cacheSize:500,separator:":",theme:{colors:[Vi],spacing:[Vr,yo],blur:["none","",vo,He],brightness:M(),borderColor:[e],borderRadius:["none","","full",vo,He],borderSpacing:K(),borderWidth:q(),contrast:M(),grayscale:Z(),hueRotate:M(),invert:Z(),gap:K(),gradientColorStops:[e],gradientColorStopPositions:[sE,yo],inset:z(),margin:z(),opacity:M(),padding:K(),saturate:M(),scale:M(),sepia:Z(),skew:M(),space:K(),translate:K()},classGroups:{aspect:[{aspect:["auto","square","video",He]}],container:["container"],columns:[{columns:[vo]}],"break-after":[{"break-after":P()}],"break-before":[{"break-before":P()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:[..._(),He]}],overflow:[{overflow:re()}],"overflow-x":[{"overflow-x":re()}],"overflow-y":[{"overflow-y":re()}],overscroll:[{overscroll:G()}],"overscroll-x":[{"overscroll-x":G()}],"overscroll-y":[{"overscroll-y":G()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[k]}],"inset-x":[{"inset-x":[k]}],"inset-y":[{"inset-y":[k]}],start:[{start:[k]}],end:[{end:[k]}],top:[{top:[k]}],right:[{right:[k]}],bottom:[{bottom:[k]}],left:[{left:[k]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",Wi,He]}],basis:[{basis:z()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",He]}],grow:[{grow:Z()}],shrink:[{shrink:Z()}],order:[{order:["first","last","none",Wi,He]}],"grid-cols":[{"grid-cols":[Vi]}],"col-start-end":[{col:["auto",{span:["full",Wi,He]},He]}],"col-start":[{"col-start":J()}],"col-end":[{"col-end":J()}],"grid-rows":[{"grid-rows":[Vi]}],"row-start-end":[{row:["auto",{span:[Wi,He]},He]}],"row-start":[{"row-start":J()}],"row-end":[{"row-end":J()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",He]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",He]}],gap:[{gap:[v]}],"gap-x":[{"gap-x":[v]}],"gap-y":[{"gap-y":[v]}],"justify-content":[{justify:["normal",...U()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...U(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...U(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[R]}],px:[{px:[R]}],py:[{py:[R]}],ps:[{ps:[R]}],pe:[{pe:[R]}],pt:[{pt:[R]}],pr:[{pr:[R]}],pb:[{pb:[R]}],pl:[{pl:[R]}],m:[{m:[j]}],mx:[{mx:[j]}],my:[{my:[j]}],ms:[{ms:[j]}],me:[{me:[j]}],mt:[{mt:[j]}],mr:[{mr:[j]}],mb:[{mb:[j]}],ml:[{ml:[j]}],"space-x":[{"space-x":[D]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[D]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",He,t]}],"min-w":[{"min-w":[He,t,"min","max","fit"]}],"max-w":[{"max-w":[He,t,"none","full","min","max","fit","prose",{screen:[vo]},vo]}],h:[{h:[He,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[He,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[He,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[He,t,"auto","min","max","fit"]}],"font-size":[{text:["base",vo,yo]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",tf]}],"font-family":[{font:[Vi]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",He]}],"line-clamp":[{"line-clamp":["none",Ls,tf]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",Vr,He]}],"list-image":[{"list-image":["none",He]}],"list-style-type":[{list:["none","disc","decimal",He]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[S]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[S]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...F(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",Vr,yo]}],"underline-offset":[{"underline-offset":["auto",Vr,He]}],"text-decoration-color":[{decoration:[e]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:K()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",He]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",He]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[S]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[..._(),lE]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",aE]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},uE]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[C]}],"gradient-via-pos":[{via:[C]}],"gradient-to-pos":[{to:[C]}],"gradient-from":[{from:[b]}],"gradient-via":[{via:[b]}],"gradient-to":[{to:[b]}],rounded:[{rounded:[l]}],"rounded-s":[{"rounded-s":[l]}],"rounded-e":[{"rounded-e":[l]}],"rounded-t":[{"rounded-t":[l]}],"rounded-r":[{"rounded-r":[l]}],"rounded-b":[{"rounded-b":[l]}],"rounded-l":[{"rounded-l":[l]}],"rounded-ss":[{"rounded-ss":[l]}],"rounded-se":[{"rounded-se":[l]}],"rounded-ee":[{"rounded-ee":[l]}],"rounded-es":[{"rounded-es":[l]}],"rounded-tl":[{"rounded-tl":[l]}],"rounded-tr":[{"rounded-tr":[l]}],"rounded-br":[{"rounded-br":[l]}],"rounded-bl":[{"rounded-bl":[l]}],"border-w":[{border:[d]}],"border-w-x":[{"border-x":[d]}],"border-w-y":[{"border-y":[d]}],"border-w-s":[{"border-s":[d]}],"border-w-e":[{"border-e":[d]}],"border-w-t":[{"border-t":[d]}],"border-w-r":[{"border-r":[d]}],"border-w-b":[{"border-b":[d]}],"border-w-l":[{"border-l":[d]}],"border-opacity":[{"border-opacity":[S]}],"border-style":[{border:[...F(),"hidden"]}],"divide-x":[{"divide-x":[d]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[d]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[S]}],"divide-style":[{divide:F()}],"border-color":[{border:[a]}],"border-color-x":[{"border-x":[a]}],"border-color-y":[{"border-y":[a]}],"border-color-s":[{"border-s":[a]}],"border-color-e":[{"border-e":[a]}],"border-color-t":[{"border-t":[a]}],"border-color-r":[{"border-r":[a]}],"border-color-b":[{"border-b":[a]}],"border-color-l":[{"border-l":[a]}],"divide-color":[{divide:[a]}],"outline-style":[{outline:["",...F()]}],"outline-offset":[{"outline-offset":[Vr,He]}],"outline-w":[{outline:[Vr,yo]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:q()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[S]}],"ring-offset-w":[{"ring-offset":[Vr,yo]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",vo,dE]}],"shadow-color":[{shadow:[Vi]}],opacity:[{opacity:[S]}],"mix-blend":[{"mix-blend":[...B(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":B()}],filter:[{filter:["","none"]}],blur:[{blur:[n]}],brightness:[{brightness:[o]}],contrast:[{contrast:[p]}],"drop-shadow":[{"drop-shadow":["","none",vo,He]}],grayscale:[{grayscale:[m]}],"hue-rotate":[{"hue-rotate":[h]}],invert:[{invert:[x]}],saturate:[{saturate:[N]}],sepia:[{sepia:[O]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[n]}],"backdrop-brightness":[{"backdrop-brightness":[o]}],"backdrop-contrast":[{"backdrop-contrast":[p]}],"backdrop-grayscale":[{"backdrop-grayscale":[m]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[h]}],"backdrop-invert":[{"backdrop-invert":[x]}],"backdrop-opacity":[{"backdrop-opacity":[S]}],"backdrop-saturate":[{"backdrop-saturate":[N]}],"backdrop-sepia":[{"backdrop-sepia":[O]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[c]}],"border-spacing-x":[{"border-spacing-x":[c]}],"border-spacing-y":[{"border-spacing-y":[c]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",He]}],duration:[{duration:M()}],ease:[{ease:["linear","in","out","in-out",He]}],delay:[{delay:M()}],animate:[{animate:["none","spin","ping","pulse","bounce",He]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[A]}],"scale-x":[{"scale-x":[A]}],"scale-y":[{"scale-y":[A]}],rotate:[{rotate:[Wi,He]}],"translate-x":[{"translate-x":[L]}],"translate-y":[{"translate-y":[L]}],"skew-x":[{"skew-x":[T]}],"skew-y":[{"skew-y":[T]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",He]}],accent:[{accent:["auto",e]}],appearance:[{appearance:["none","auto"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",He]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":K()}],"scroll-mx":[{"scroll-mx":K()}],"scroll-my":[{"scroll-my":K()}],"scroll-ms":[{"scroll-ms":K()}],"scroll-me":[{"scroll-me":K()}],"scroll-mt":[{"scroll-mt":K()}],"scroll-mr":[{"scroll-mr":K()}],"scroll-mb":[{"scroll-mb":K()}],"scroll-ml":[{"scroll-ml":K()}],"scroll-p":[{"scroll-p":K()}],"scroll-px":[{"scroll-px":K()}],"scroll-py":[{"scroll-py":K()}],"scroll-ps":[{"scroll-ps":K()}],"scroll-pe":[{"scroll-pe":K()}],"scroll-pt":[{"scroll-pt":K()}],"scroll-pr":[{"scroll-pr":K()}],"scroll-pb":[{"scroll-pb":K()}],"scroll-pl":[{"scroll-pl":K()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",He]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[Vr,yo,tf]}],stroke:[{stroke:[e,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}},gE=QC(mE);function Ue(...e){return gE($C(e))}function No(e){if(!e)return"—";const t=new Date(e);return Number.isNaN(t.getTime())?e:t.toLocaleDateString(void 0,{month:"short",day:"numeric",year:"numeric"})}function Er(e){if(!e)return"—";const t=new Date(e);return Number.isNaN(t.getTime())?e:t.toLocaleString(void 0,{month:"short",day:"numeric",year:"numeric",hour:"numeric",minute:"2-digit"})}function xE(e){if(!e)return"—";const t=new Date(e);return Number.isNaN(t.getTime())?e:t.toLocaleDateString(void 0,{month:"short",day:"numeric"})}function yE(e){if(!e)return"—";const t=new Date(e);return Number.isNaN(t.getTime())?e:t.toLocaleString(void 0,{month:"short",day:"numeric",hour:"numeric",minute:"2-digit"})}function vE(e){if(!e)return"—";const t=new Date(e);if(Number.isNaN(t.getTime()))return e;const n=Math.floor((Date.now()-t.getTime())/1e3);if(n<60)return"just now";const o=Math.floor(n/60);if(o<60)return`${o}m ago`;const a=Math.floor(o/60);return a<24?`${a}h ago`:`${Math.floor(a/24)}d ago`}function fn(e){return e.split(/[_\s-]+/).filter(Boolean).map(t=>t.charAt(0).toUpperCase()+t.slice(1)).join(" ")}function Cb(e){return!e||e==="/"?"/":e.endsWith("/")?e.slice(0,-1):e}function bE(e){let t=Cb(e);const n=t.match(/^\/w\/[^/]+(\/.*)?$/);return n&&(t=n[1]||"/"),t==="/"?"/":t.startsWith("/projects")?/^\/projects\/[^/]+\/assignments\//.test(t)?"/assignments":"/projects":t.startsWith("/assignments")?"/assignments":t.startsWith("/servers")?"/servers":t.startsWith("/agent-sessions")?"/agent-sessions":t.startsWith("/playbooks")?"/playbooks":t.startsWith("/todos")?"/todos":t.startsWith("/attention")?"/attention":t.startsWith("/help")?"/help":t.startsWith("/settings")?"/settings":null}function Eb(e,t){return bE(e)===t}function Pb(e){let n=Cb(e).split("/").filter(Boolean);const o=[];let a="Overview",l=null,c="";return n[0]==="w"&&n[1]&&(c=`/w/${n[1]}`,o.push({label:fn(n[1]),path:`${c}/projects`}),n=n.slice(2)),n.length===0?{title:a,breadcrumbs:o,projectSlug:l}:(n[0]==="projects"?(o.push({label:"Projects",path:`${c}/projects`}),a="Projects",n[1]&&(l=n[1],o.push({label:fn(n[1]),path:`${c}/projects/${n[1]}`}),a=fn(n[1])),n[2]==="edit"?a="Edit Project":n[2]==="create"&&n[3]==="assignment"?a="Create Assignment":n[2]==="assignments"&&n[3]&&(o.push({label:fn(n[3]),path:`${c}/projects/${n[1]}/assignments/${n[3]}`}),a=fn(n[3]),n[4]==="edit"?a="Edit Assignment":n[4]==="plan"&&n[5]==="edit"?a="Edit Plan":n[4]==="scratchpad"&&n[5]==="edit"?a="Edit Scratchpad":n[4]==="handoff"&&n[5]==="edit"?a="Append Handoff":n[4]==="decision-record"&&n[5]==="edit"&&(a="Append Decision"))):n[0]==="servers"?(a="Servers",o.push({label:"Servers",path:`${c}/servers`})):n[0]==="agent-sessions"?(a="Agent Sessions",o.push({label:"Agent Sessions",path:`${c}/agent-sessions`})):n[0]==="attention"?(a="Attention",o.push({label:"Attention",path:"/attention"})):n[0]==="assignments"?(a="Assignments",o.push({label:"Assignments",path:`${c}/assignments`})):n[0]==="playbooks"?(o.push({label:"Playbooks",path:"/playbooks"}),a="Playbooks",n[1]==="create"?a="Create Playbook":n[1]&&n[2]==="edit"?(o.push({label:fn(n[1]),path:`/playbooks/${n[1]}`}),a="Edit Playbook"):n[1]&&(o.push({label:fn(n[1]),path:`/playbooks/${n[1]}`}),a=fn(n[1]))):n[0]==="todos"?(a="Todos",o.push({label:"Todos",path:`${c}/todos`})):n[0]==="help"?(a="Help",o.push({label:"Help",path:"/help"})):n[0]==="settings"?(a="Settings",o.push({label:"Settings",path:"/settings"})):n[0]==="create"&&n[1]==="project"&&(a="Create Project",o.push({label:"Create Project",path:`${c}/create/project`})),{title:a,breadcrumbs:o,projectSlug:l})}function zx({items:e,onNavigate:t}){const n=xn();return i.jsx("nav",{className:"space-y-1",children:e.map(o=>{const a=o.icon,l=Eb(n.pathname,o.to)&&!n.pathname.startsWith("/w/");return i.jsxs(De,{to:o.to,onClick:t,className:Ue("flex items-center gap-3 rounded-md px-3 py-2 text-sm font-medium transition",l?"bg-foreground text-background shadow-sm":"text-muted-foreground hover:bg-background/80 hover:text-foreground"),children:[i.jsx(a,{className:"h-4 w-4"}),i.jsx("span",{children:o.label})]},o.to)})})}const Tb=[{slug:"default",label:"Syntaur",description:"Brand purple, warm yellow, coral & teal accents.",swatches:{primary:"oklch(70% 0.18 290)",secondary:"oklch(80% 0.14 75)",coral:"oklch(72% 0.17 15)",teal:"oklch(72% 0.14 185)",amber:"oklch(82% 0.16 75)"}},{slug:"ocean",label:"Midnight",description:"Deep indigo-blue with cyan accents. Inspired by One Dark Pro.",swatches:{primary:"oklch(70% 0.16 240)",secondary:"oklch(78% 0.13 200)",coral:"oklch(72% 0.18 350)",teal:"oklch(78% 0.14 195)",amber:"oklch(84% 0.15 90)"}},{slug:"forest",label:"Verdant",description:"Saturated emerald and pine on a dark olive base.",swatches:{primary:"oklch(72% 0.17 145)",secondary:"oklch(80% 0.13 110)",coral:"oklch(72% 0.17 25)",teal:"oklch(75% 0.13 175)",amber:"oklch(82% 0.16 95)"}},{slug:"sunset",label:"Ember",description:"Warm sepia surfaces with copper and amber accents.",swatches:{primary:"oklch(72% 0.18 35)",secondary:"oklch(80% 0.16 60)",coral:"oklch(72% 0.19 15)",teal:"oklch(72% 0.12 180)",amber:"oklch(86% 0.17 70)"}}],wE=Tb.map(e=>e.slug),mc="default";function Rb(e){return typeof e=="string"&&wE.includes(e)}const Ab={preset:mc,custom:!1};let Zi=null,Es=null;function zp(e){if(!e||typeof e!="object")return Ab;const t=e;return{preset:Rb(t.preset)?t.preset:mc,custom:t.custom===!0}}function kE(){return Zi?Promise.resolve(Zi):Es||(Es=fetch("/api/config/theme").then(e=>{if(!e.ok)throw new Error(`HTTP ${e.status}`);return e.json()}).then(e=>{const t=zp(e);return Zi=t,Es=null,t}).catch(()=>(Es=null,Ab)),Es)}async function jE(e){const t=await fetch("/api/config/theme",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({preset:e})});if(!t.ok){const o=await t.json().catch(()=>({error:`HTTP ${t.status}`}));throw new Error(o.error??"Failed to save theme")}const n=zp(await t.json());return Zi=n,n}async function SE(){const e=await fetch("/api/config/theme",{method:"DELETE"});if(!e.ok)throw new Error(`HTTP ${e.status}`);const t=zp(await e.json());return Zi=t,t}const Xf="syntaur-theme",oc="syntaur-preset",Db=g.createContext(null);function Qf(){try{const e=window.localStorage.getItem(Xf);return e==="light"||e==="dark"?e:null}catch{return null}}function Ib(){try{const e=window.localStorage.getItem(oc);return Rb(e)?e:mc}catch{return mc}}function Ob(){return typeof window>"u"||!window.matchMedia?"light":window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}function Lb(e){document.documentElement.classList.toggle("dark",e==="dark")}function Mb(e){document.documentElement.dataset.theme=e}function NE(){typeof document>"u"||(Lb(Qf()??Ob()),Mb(Ib()))}function CE({children:e}){const[t,n]=g.useState(()=>Qf()),[o,a]=g.useState(()=>Qf()??Ob()),[l,c]=g.useState(()=>Ib());g.useEffect(()=>{Lb(o)},[o]),g.useEffect(()=>{Mb(l)},[l]),g.useEffect(()=>{let h=!1;return kE().then(x=>{if(!h&&x.preset!==l){c(x.preset);try{window.localStorage.setItem(oc,x.preset)}catch{}}}),()=>{h=!0}},[]),g.useEffect(()=>{if(!window.matchMedia)return;const h=window.matchMedia("(prefers-color-scheme: dark)"),x=()=>{t||a(h.matches?"dark":"light")};return x(),h.addEventListener("change",x),()=>{h.removeEventListener("change",x)}},[t]);async function d(h){c(h);try{window.localStorage.setItem(oc,h)}catch{}await jE(h)}async function p(){const h=await SE();c(h.preset);try{window.localStorage.setItem(oc,h.preset)}catch{}}const m={resolvedTheme:o,explicitTheme:t,setTheme:h=>{window.localStorage.setItem(Xf,h),n(h),a(h)},toggleTheme:()=>{const h=o==="dark"?"light":"dark";window.localStorage.setItem(Xf,h),n(h),a(h)},preset:l,setPreset:d,resetPreset:p};return i.jsx(Db.Provider,{value:m,children:e})}function Bp(){const e=g.useContext(Db);if(!e)throw new Error("useTheme must be used within ThemeProvider");return e}const sc=new Set;let En=null,Ms=null;function EE(){return`${window.location.protocol==="https:"?"wss:":"ws:"}//${window.location.host}/ws`}function _b(){En&&(En.readyState===WebSocket.OPEN||En.readyState===WebSocket.CONNECTING)||(En=new WebSocket(EE()),En.onmessage=e=>{try{const t=JSON.parse(e.data);for(const n of sc)n(t)}catch{}},En.onclose=()=>{En=null,Ms&&clearTimeout(Ms),Ms=setTimeout(_b,2e3)},En.onerror=()=>{En==null||En.close()})}function Lc(e){const t=g.useRef(e);t.current=e,g.useEffect(()=>{const n=o=>t.current(o);return sc.add(n),_b(),()=>{sc.delete(n),sc.size===0&&En&&(Ms&&clearTimeout(Ms),Ms=null,En.close(),En=null)}},[])}function yn(e,t){const[n,o]=g.useState(null),[a,l]=g.useState(!0),[c,d]=g.useState(null),[p,m]=g.useState(0),h=g.useCallback(()=>{m(x=>x+1)},[]);return g.useEffect(()=>{if(!e){l(!1),o(null);return}let x=!1;return l(!0),d(null),fetch(e).then(async v=>{if(!v.ok){const b=await v.json().catch(()=>null);throw new Error((b==null?void 0:b.error)||`HTTP ${v.status}`)}return v.json()}).then(v=>{x||(o(v),l(!1))}).catch(v=>{x||(d(v.message),l(!1))}),()=>{x=!0}},[e,p]),Lc(x=>{t&&((x.type==="project-updated"||x.type==="assignment-updated")&&h(),x.type==="servers-updated"&&t==="servers"&&h(),x.type==="agent-sessions-updated"&&t==="agent-sessions"&&h(),x.type==="playbooks-updated"&&t==="playbooks"&&h())}),{data:n,loading:a,error:c,refetch:h}}function Mc(){return yn("/api/projects","projects")}function Up(){return yn("/api/workspaces","projects")}function Lt(){const{workspace:e}=At();return e?`/w/${e}`:""}function PE(){return yn("/api/overview","overview")}function $b(){return yn("/api/assignments","assignments")}function TE(){return yn("/api/attention","attention")}function Fb(){return yn("/api/help")}function zb(e){const t=e?`/api/projects/${e}`:null;return yn(t,"project")}function RE(e,t){const n=e&&t?`/api/projects/${e}/assignments/${t}`:null;return yn(n,"assignment")}function AE(e){const t=e?`/api/assignments/${e}`:null;return yn(t,"assignment")}function Bb(e){return yn(e)}function Hp(){return yn("/api/servers","servers")}function DE(){return yn("/api/agent-sessions","agent-sessions")}function IE(e,t){const n=e&&t?`/api/agent-sessions/${e}?assignment=${t}`:null;return yn(n,"agent-sessions")}function Ub(){return yn("/api/playbooks","playbooks")}function OE(e){const t=e?`/api/playbooks/${e}`:null;return yn(t,"playbooks")}const _c=["new-workspace","new-project","new-todo","new-assignment"];function LE(e){return typeof e=="string"&&_c.includes(e)}const ME=["mod+k","mod+shift+k","?","escape","enter","shift+t","g","g o","g m","g a","g t","g s","g !","g ,","j","k","o","a","e","/","r","p","h","d","s","[","]"],_E=["mod","ctrl","alt","shift"];function Pn(e){if(typeof e!="string")return"";const t=e.trim();if(!t)return"";if(/\s/.test(t)&&!t.includes("+"))return t.split(/\s+/).map(Pn).filter(d=>d.length>0).join(" ");const n=t.split("+").map(d=>d.trim()).filter(d=>d.length>0);if(n.length===0)return"";if(n.length===1)return n[0].toLowerCase();const o=n[n.length-1].toLowerCase(),a=n.slice(0,-1).map(d=>d.toLowerCase()),l=new Set,c=[];for(const d of _E)a.includes(d)&&!l.has(d)&&(c.push(d),l.add(d));for(const d of a)l.has(d)||(c.push(d),l.add(d));return[...c,o].join("+")}function $E(e){const t=Pn(e);return t?ME.includes(t):!1}const FE={"new-workspace":Pn("Mod+Shift+Alt+w"),"new-project":Pn("Mod+Shift+Alt+p"),"new-todo":Pn("Mod+Shift+Alt+t"),"new-assignment":Pn("Mod+Shift+Alt+a")};function zE(e){const t={...FE};for(const n of _c){const o=e[n];typeof o=="string"&&o.length>0&&(t[n]=o)}return t}function Yo(){if(typeof navigator>"u")return!1;const e=navigator.platform||"",t=navigator.userAgent||"";return/Mac|iPhone|iPad|iPod/.test(e)||/Mac OS X/.test(t)}function BE(e){const t=e.split("+").map(a=>a.trim()),n=t[t.length-1]??"",o=new Set(t.slice(0,-1).map(a=>a.toLowerCase()));return{key:n.toLowerCase(),mod:o.has("mod"),shift:o.has("shift"),alt:o.has("alt"),ctrl:o.has("ctrl")}}function Hl(e,t){const n=BE(t);if(e.key.toLowerCase()!==n.key)return!1;const a=Yo()?e.metaKey:e.ctrlKey;return!(n.mod&&!a||!n.mod&&!n.ctrl&&a||n.ctrl&&!e.ctrlKey||n.shift&&!e.shiftKey||!n.shift&&!(n.key.length===1&&!/^[a-z0-9]$/.test(n.key))&&e.shiftKey||n.alt&&!e.altKey||!n.alt&&e.altKey)}function Hb(e){const t=[],n=Yo()?e.metaKey:e.ctrlKey;n&&t.push("mod"),e.ctrlKey&&!n&&t.push("ctrl"),e.altKey&&t.push("alt");const o=e.key;let a;o===" "||o==="Spacebar"?a="space":(o.length,a=o.toLowerCase());const l=a.length===1&&/^[a-z0-9]$/.test(a);e.shiftKey&&l&&t.push("shift");const c=[...t,a].join("+");return Pn(c)}function Pr(e){return e.split("+").map(n=>{const o=n.toLowerCase();return o==="mod"?Yo()?"⌘":"Ctrl":o==="shift"?Yo()?"⇧":"Shift":o==="alt"?Yo()?"⌥":"Alt":o==="ctrl"?Yo()?"⌃":"Ctrl":o==="enter"?"↵":o==="escape"?"Esc":o==="arrowup"?"↑":o==="arrowdown"?"↓":n.length===1?n.toUpperCase():n}).join(Yo()?"":"+")}function UE(e){const[t,n]=g.useState(null),[o,a]=g.useState(!0),[l,c]=g.useState(null),d=g.useCallback(async()=>{try{const p=await fetch(`/api/todos/${encodeURIComponent(e)}`);if(!p.ok)throw new Error(`HTTP ${p.status}`);n(await p.json()),c(null)}catch(p){c(p instanceof Error?p.message:"Failed to fetch todos")}finally{a(!1)}},[e]);return g.useEffect(()=>{d()},[d]),Lc(p=>{p.type==="todos-updated"&&!p.projectSlug&&d()}),{data:t,loading:o,error:l,refetch:d}}function Wp(){const[e,t]=g.useState(null),[n,o]=g.useState(!0),[a,l]=g.useState(null),c=g.useCallback(async()=>{try{const d=await fetch("/api/todos");if(!d.ok)throw new Error(`HTTP ${d.status}`);t(await d.json()),l(null)}catch(d){l(d instanceof Error?d.message:"Failed to fetch todos")}finally{o(!1)}},[]);return g.useEffect(()=>{c()},[c]),Lc(d=>{d.type==="todos-updated"&&!d.projectSlug&&c()}),{data:e,loading:n,error:a,refetch:c}}async function Vp(e,t,n){await fetch(`/api/todos/${encodeURIComponent(e)}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({description:t,tags:n})})}async function Wb(e,t,n){await fetch(`/api/todos/${encodeURIComponent(e)}/${t}/complete`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({summary:"Completed."})})}async function Vb(e,t,n){await fetch(`/api/todos/${encodeURIComponent(e)}/${t}/block`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({reason:n})})}async function qb(e,t,n){await fetch(`/api/todos/${encodeURIComponent(e)}/${t}/start`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({session:n})})}async function Kb(e,t){await fetch(`/api/todos/${encodeURIComponent(e)}/${t}/reopen`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({})})}async function HE(e,t){await fetch(`/api/todos/${encodeURIComponent(e)}/reorder`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({ids:t})})}async function Gb(e,t){await fetch(`/api/todos/${encodeURIComponent(e)}/${t}`,{method:"DELETE"})}async function Yb(e,t){const n=await fetch(e,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)});if(!n.ok){const o=await n.text().catch(()=>"");let a=null;try{a=o?JSON.parse(o):null}catch{}const l=(a==null?void 0:a.error)||o||`HTTP ${n.status}`,c=new Error(l);throw c.status=n.status,c}return n.json().catch(()=>({}))}async function WE(e,t){await Yb(`/api/todos/${encodeURIComponent(e)}/promote`,t)}async function VE(e,t,n){await Yb(`/api/todos/${encodeURIComponent(e)}/${t}/move`,{to:n})}const qE=new Set(["/projects","/assignments","/servers","/todos"]);function ic(e,t){return qE.has(e)?`${t}${e}`:e}const KE=[{id:"page-overview",title:"Overview",basePath:"/",keywords:["home","dashboard"]},{id:"page-projects",title:"Projects",basePath:"/projects",keywords:[]},{id:"page-assignments",title:"Assignments",basePath:"/assignments",keywords:[]},{id:"page-todos",title:"Todos",basePath:"/todos",keywords:["tasks"]},{id:"page-servers",title:"Servers",basePath:"/servers",keywords:["sessions"]},{id:"page-attention",title:"Attention",basePath:"/attention",keywords:["alerts"]},{id:"page-playbooks",title:"Playbooks",basePath:"/playbooks",keywords:[]},{id:"page-settings",title:"Settings",basePath:"/settings",keywords:[]},{id:"page-help",title:"Help",basePath:"/help",keywords:["shortcuts"]}];function GE(e){const t=[];for(const n of KE)t.push({type:"page",id:n.id,title:n.title,keywords:[...n.keywords],route:ic(n.basePath,e.wsPrefix)});for(const n of e.projects??[]){const o=n.workspace?`/w/${n.workspace}`:"";t.push({type:"project",id:`project-${n.slug}`,title:n.title,subtitle:n.slug,keywords:n.tags,route:`${o}/projects/${n.slug}`}),t.push({type:"todo",id:`project-todos-${n.slug}`,title:`${n.title} todos`,subtitle:`${n.slug} · project`,keywords:[...n.tags??[],"project","todos"],route:`${o}/projects/${n.slug}?tab=todos`})}for(const n of e.assignments??[]){const o=n.projectWorkspace?`/w/${n.projectWorkspace}`:"";t.push({type:"assignment",id:n.projectSlug===null?`assignment-standalone-${n.id}`:`assignment-${n.projectSlug}-${n.slug}`,title:n.title,subtitle:`${n.projectTitle} · ${n.status}`,keywords:[n.projectSlug??"standalone",n.assignee??""].filter(a=>!!a),route:n.projectSlug===null?`/assignments/${n.id}`:`${o}/projects/${n.projectSlug}/assignments/${n.slug}`})}for(const n of e.playbooks??[])t.push({type:"playbook",id:`playbook-${n.slug}`,title:n.name,subtitle:n.description,keywords:n.tags,route:`/playbooks/${n.slug}`});for(const n of e.servers??[])t.push({type:"server",id:`server-${n.name}`,title:n.name,subtitle:n.alive?"alive":"dead",route:`${ic("/servers",e.wsPrefix)}#server-${encodeURIComponent(n.name)}`});for(const n of e.todos??[]){const o=n.workspace&&n.workspace!=="_ungrouped"?`/w/${n.workspace}`:e.wsPrefix,a=ic("/todos",o);t.push({type:"todo",id:`todo-${n.id}`,title:n.description,subtitle:n.status,keywords:n.tags,route:`${a}?focus=${encodeURIComponent(n.id)}`})}return t}function cr(e){return e.toLowerCase().trim().replace(/[^a-z0-9\s-]/g,"").replace(/\s+/g,"-").replace(/-+/g,"-").replace(/^-|-$/g,"")}function nf(e){return/^[a-z0-9]+(-[a-z0-9]+)*$/.test(e)}async function YE(e,t,n){const o=t?"disable":"enable",a=await fetch(`/api/playbooks/${encodeURIComponent(e)}/${o}`,{method:"POST"});if(!a.ok){const l=await a.json().catch(()=>({}));throw new Error(l.error||`Failed to ${o} playbook`)}n()}async function rf(e,t){const n=await fetch(`/api/todos/${encodeURIComponent(e)}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({description:t})});if(!n.ok){const o=await n.json().catch(()=>({}));throw new Error(o.error||`Failed to create todo (HTTP ${n.status})`)}}async function Bx(){const e=await fetch("/api/workspaces");if(!e.ok)throw new Error(`Failed to load workspaces (HTTP ${e.status})`);const t=await e.json();return{workspaces:Array.isArray(t.workspaces)?t.workspaces:[],hasUngrouped:t.hasUngrouped===!0}}async function Ux(){const e=await fetch("/api/projects");if(!e.ok)throw new Error(`Failed to load projects (HTTP ${e.status})`);const t=await e.json();return Array.isArray(t)?t:[]}async function of(e){const t=await fetch(e);if(!t.ok)throw new Error(`Failed to load template (HTTP ${t.status})`);const n=await t.json();if(!n.content)throw new Error("Template returned no content");return n.content}function qo(e,t,n){const o=e.match(/^(---\n)([\s\S]*?)(\n---)/);if(!o)return`---
412
+ ${t}: ${JSON.stringify(n)}
413
+ ---
414
+ ${e}`;const a=o[1],l=o[2],c=o[3],d=e.slice(o[0].length),p=JSON.stringify(n),m=new RegExp(`^${t}:\\s*.*$`,"m");let h;return m.test(l)?h=l.replace(m,`${t}: ${p}`):h=`${l}
415
+ ${t}: ${p}`,`${a}${h}${c}${d}`}const XE=/^[a-z0-9][a-z0-9-]*$/;function QE(e){const{playbooks:t,projectSlug:n,currentProjectTitle:o,currentProjectWorkspace:a,wsPrefix:l,refetchPlaybooks:c,navigate:d,toggleTheme:p}=e,m=[];if(m.push({id:"new-workspace",title:"New Workspace",subtitle:"Create a Syntaur workspace",group:"Create",keywords:["new","create","workspace"],bindableKind:"new-workspace",flow:{steps:[{kind:"text",id:"name",label:"Workspace name",placeholder:"lowercase, hyphenated (e.g. acme-app)",required:!0,pattern:{regex:XE,message:"Use lowercase letters, digits, and hyphens (e.g. acme-app). Must start with a letter or digit."}}],submit:async(h,x)=>{const v=(h.name??"").trim();if(!v)throw new Error("Name is required");const b=await fetch("/api/workspaces",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:v})});if(!b.ok){const C=await b.json().catch(()=>({}));throw new Error(C.error||`Failed to create workspace (HTTP ${b.status})`)}x.navigate(`/w/${v}/projects`)}}}),m.push({id:"new-project",title:"New Project",subtitle:"Create a project (pick workspace)",group:"Create",keywords:["new","create","project"],bindableKind:"new-project",flow:{steps:[{kind:"picker",id:"workspace",label:"Workspace",emptyMessage:'No workspaces yet — create one with "New Workspace"',loadOptions:async()=>{const{workspaces:h,hasUngrouped:x}=await Bx(),v=[{value:"_ungrouped",label:"Ungrouped",hint:"no workspace"}];for(const b of h)v.push({value:b,label:b,hint:"workspace"});return v}},{kind:"text",id:"title",label:"Project title",placeholder:"e.g. Marketing site rebuild",required:!0}],submit:async(h,x)=>{const v=(h.workspace??"").trim(),b=(h.title??"").trim();if(!b)throw new Error("Title is required");const C=cr(b);if(!C)throw new Error("Title must contain at least one alphanumeric character");let k=await of("/api/templates/project");k=qo(k,"slug",C),k=qo(k,"title",b),v&&v!=="_ungrouped"&&(k=qo(k,"workspace",v));const j=await fetch("/api/projects",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({content:k})}),S=await j.json().catch(()=>({}));if(!j.ok)throw new Error(S.error||`Failed to create project (HTTP ${j.status})`);const R=v&&v!=="_ungrouped"?`/w/${v}/projects/${S.slug??C}`:`/projects/${S.slug??C}`;x.navigate(R)}}}),m.push({id:"new-todo",title:"New Todo",subtitle:"Pick scope (global / workspace / project)",group:"Create",keywords:["new","create","todo","task"],bindableKind:"new-todo",flow:{steps:[{kind:"picker",id:"scope",label:"Scope",loadOptions:async()=>{const[{workspaces:h},x]=await Promise.all([Bx(),Ux()]),v=[{value:"_ungrouped",label:"Global",hint:"no workspace"}];for(const b of h)v.push({value:b,label:b,hint:"workspace"});for(const b of x){const C=b.workspace??"_ungrouped";v.push({value:C,label:`${b.title}`,hint:`project · ${b.workspace??"ungrouped"}`})}return v}},{kind:"text",id:"description",label:"Description",placeholder:"Describe the todo…",required:!0}],submit:async h=>{const x=(h.scope??"_ungrouped").trim()||"_ungrouped",v=(h.description??"").trim();if(!v)throw new Error("Description is required");await Vp(x,v)}}}),m.push({id:"new-assignment",title:"New Assignment",subtitle:"Pick standalone or a project",group:"Create",keywords:["new","create","assignment"],bindableKind:"new-assignment",flow:{steps:[{kind:"picker",id:"project",label:"Project",loadOptions:async()=>{const h=await Ux(),x=[{value:"_standalone",label:"Standalone",hint:"one-off / not in a project"}];for(const v of h)x.push({value:v.slug,label:v.title,hint:v.workspace?`workspace · ${v.workspace}`:"ungrouped"});return x}},{kind:"text",id:"title",label:"Assignment title",placeholder:"What needs to get done?",required:!0}],submit:async(h,x)=>{var N;const v=(h.project??"_standalone").trim()||"_standalone",b=(h.title??"").trim();if(!b)throw new Error("Title is required");const C=cr(b);if(!C)throw new Error("Title must contain at least one alphanumeric character");if(v==="_standalone"){let A=await of("/api/templates/assignment?standalone=1");A=qo(A,"slug",C),A=qo(A,"title",b);const O=await fetch("/api/assignments",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({content:A})}),T=await O.json().catch(()=>({}));if(!O.ok)throw new Error(T.error||`Failed to create assignment (HTTP ${O.status})`);const D=((N=T==null?void 0:T.assignment)==null?void 0:N.id)??(T==null?void 0:T.id);D?x.navigate(`/assignments/${D}`):x.navigate("/assignments");return}let k=await of("/api/templates/assignment");k=qo(k,"slug",C),k=qo(k,"title",b);const j=await fetch(`/api/projects/${encodeURIComponent(v)}/assignments`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({content:k})}),S=await j.json().catch(()=>({}));if(!j.ok)throw new Error(S.error||`Failed to create assignment (HTTP ${j.status})`);const R=S.slug??C;x.navigate(`/projects/${v}/assignments/${R}`)}}}),m.push({id:"create-project-route",title:"New Project (advanced editor)",subtitle:"Open the markdown editor",group:"Create",keywords:["new","create","project","advanced","editor"],run:()=>d(`${l}/create/project`)}),m.push({id:"create-standalone-assignment",title:"New Standalone Assignment (editor)",subtitle:"Open the markdown editor",group:"Create",keywords:["new","create","assignment","standalone","one-off","editor"],run:()=>d(`${l}/assignments/new`)}),n&&m.push({id:`create-assignment-in-${n}`,title:`New Assignment in ${o??n}`,subtitle:n,group:"Create",keywords:["new","create","assignment",n],run:()=>d(`${l}/projects/${n}/create/assignment`)}),m.push({id:"create-playbook",title:"New Playbook",group:"Create",keywords:["new","create","playbook"],run:()=>d("/playbooks/create")}),m.push({id:"create-todo-global",title:"New Todo (global, quick)",subtitle:"Ungrouped, single-step",group:"Create",keywords:["new","create","todo","global","ungrouped","quick"],requiresInput:{placeholder:"Describe the todo…",runWithInput:async h=>{const x=h.trim();x&&await rf("_ungrouped",x)}}}),l){const h=l.replace(/^\/w\//,"");m.push({id:`create-todo-workspace-${h}`,title:`New Todo in workspace ${h}`,subtitle:h,group:"Create",keywords:["new","create","todo","workspace",h],requiresInput:{placeholder:`Describe the todo for workspace ${h}…`,runWithInput:async x=>{const v=x.trim();v&&await rf(h,v)}}})}n&&a&&m.push({id:`create-todo-project-${n}`,title:`New Todo in project ${o??n}`,subtitle:`${n} · workspace ${a}`,group:"Create",keywords:["new","create","todo","project",n,a],requiresInput:{placeholder:`Describe the todo for project ${o??n}…`,runWithInput:async h=>{const x=h.trim();x&&await rf(a,x)}}});for(const h of t)m.push({id:`toggle-playbook-${h.slug}`,title:`Toggle Playbook: ${h.name}`,subtitle:h.enabled?"enabled":"disabled",group:"Toggle",keywords:["toggle","playbook",h.slug,...h.tags??[]],run:()=>YE(h.slug,h.enabled,c)});return m.push({id:"toggle-theme",title:"Toggle theme",subtitle:"Light / dark",group:"Theme",keywords:["theme","toggle","light","dark","appearance"],run:()=>p()}),m}function mt(e,t,{checkForDefaultPrevented:n=!0}={}){return function(a){if(e==null||e(a),n===!1||!a.defaultPrevented)return t==null?void 0:t(a)}}function Hx(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function $c(...e){return t=>{let n=!1;const o=e.map(a=>{const l=Hx(a,t);return!n&&typeof l=="function"&&(n=!0),l});if(n)return()=>{for(let a=0;a<o.length;a++){const l=o[a];typeof l=="function"?l():Hx(e[a],null)}}}}function pn(...e){return g.useCallback($c(...e),e)}function JE(e,t){const n=g.createContext(t),o=l=>{const{children:c,...d}=l,p=g.useMemo(()=>d,Object.values(d));return i.jsx(n.Provider,{value:p,children:c})};o.displayName=e+"Provider";function a(l){const c=g.useContext(n);if(c)return c;if(t!==void 0)return t;throw new Error(`\`${l}\` must be used within \`${e}\``)}return[o,a]}function Zo(e,t=[]){let n=[];function o(l,c){const d=g.createContext(c),p=n.length;n=[...n,c];const m=x=>{var S;const{scope:v,children:b,...C}=x,k=((S=v==null?void 0:v[e])==null?void 0:S[p])||d,j=g.useMemo(()=>C,Object.values(C));return i.jsx(k.Provider,{value:j,children:b})};m.displayName=l+"Provider";function h(x,v){var k;const b=((k=v==null?void 0:v[e])==null?void 0:k[p])||d,C=g.useContext(b);if(C)return C;if(c!==void 0)return c;throw new Error(`\`${x}\` must be used within \`${l}\``)}return[m,h]}const a=()=>{const l=n.map(c=>g.createContext(c));return function(d){const p=(d==null?void 0:d[e])||l;return g.useMemo(()=>({[`__scope${e}`]:{...d,[e]:p}}),[d,p])}};return a.scopeName=e,[o,ZE(a,...t)]}function ZE(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const o=e.map(a=>({useScope:a(),scopeName:a.scopeName}));return function(l){const c=o.reduce((d,{useScope:p,scopeName:m})=>{const x=p(l)[`__scope${m}`];return{...d,...x}},{});return g.useMemo(()=>({[`__scope${t.scopeName}`]:c}),[c])}};return n.scopeName=t.scopeName,n}var Co=globalThis!=null&&globalThis.document?g.useLayoutEffect:()=>{},e2=Bv[" useId ".trim().toString()]||(()=>{}),t2=0;function _s(e){const[t,n]=g.useState(e2());return Co(()=>{n(o=>o??String(t2++))},[e]),t?`radix-${t}`:""}var n2=Bv[" useInsertionEffect ".trim().toString()]||Co;function Fc({prop:e,defaultProp:t,onChange:n=()=>{},caller:o}){const[a,l,c]=r2({defaultProp:t,onChange:n}),d=e!==void 0,p=d?e:a;{const h=g.useRef(e!==void 0);g.useEffect(()=>{const x=h.current;x!==d&&console.warn(`${o} is changing from ${x?"controlled":"uncontrolled"} to ${d?"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.`),h.current=d},[d,o])}const m=g.useCallback(h=>{var x;if(d){const v=o2(h)?h(e):h;v!==e&&((x=c.current)==null||x.call(c,v))}else l(h)},[d,e,l,c]);return[p,m]}function r2({defaultProp:e,onChange:t}){const[n,o]=g.useState(e),a=g.useRef(n),l=g.useRef(t);return n2(()=>{l.current=t},[t]),g.useEffect(()=>{var c;a.current!==n&&((c=l.current)==null||c.call(l,n),a.current=n)},[n,a]),[n,o,l]}function o2(e){return typeof e=="function"}function s2(e){const t=i2(e),n=g.forwardRef((o,a)=>{const{children:l,...c}=o,d=g.Children.toArray(l),p=d.find(l2);if(p){const m=p.props.children,h=d.map(x=>x===p?g.Children.count(m)>1?g.Children.only(null):g.isValidElement(m)?m.props.children:null:x);return i.jsx(t,{...c,ref:a,children:g.isValidElement(m)?g.cloneElement(m,void 0,h):null})}return i.jsx(t,{...c,ref:a,children:l})});return n.displayName=`${e}.Slot`,n}function i2(e){const t=g.forwardRef((n,o)=>{const{children:a,...l}=n;if(g.isValidElement(a)){const c=u2(a),d=c2(l,a.props);return a.type!==g.Fragment&&(d.ref=o?$c(o,c):c),g.cloneElement(a,d)}return g.Children.count(a)>1?g.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var a2=Symbol("radix.slottable");function l2(e){return g.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===a2}function c2(e,t){const n={...t};for(const o in t){const a=e[o],l=t[o];/^on[A-Z]/.test(o)?a&&l?n[o]=(...d)=>{const p=l(...d);return a(...d),p}:a&&(n[o]=a):o==="style"?n[o]={...a,...l}:o==="className"&&(n[o]=[a,l].filter(Boolean).join(" "))}return{...e,...n}}function u2(e){var o,a;let t=(o=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(a=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:a.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var d2=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Mt=d2.reduce((e,t)=>{const n=s2(`Primitive.${t}`),o=g.forwardRef((a,l)=>{const{asChild:c,...d}=a,p=c?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),i.jsx(p,{...d,ref:l})});return o.displayName=`Primitive.${t}`,{...e,[t]:o}},{});function f2(e,t){e&&So.flushSync(()=>e.dispatchEvent(t))}function Xo(e){const t=g.useRef(e);return g.useEffect(()=>{t.current=e}),g.useMemo(()=>(...n)=>{var o;return(o=t.current)==null?void 0:o.call(t,...n)},[])}function p2(e,t=globalThis==null?void 0:globalThis.document){const n=Xo(e);g.useEffect(()=>{const o=a=>{a.key==="Escape"&&n(a)};return t.addEventListener("keydown",o,{capture:!0}),()=>t.removeEventListener("keydown",o,{capture:!0})},[n,t])}var h2="DismissableLayer",Jf="dismissableLayer.update",m2="dismissableLayer.pointerDownOutside",g2="dismissableLayer.focusOutside",Wx,Xb=g.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),qp=g.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:o,onPointerDownOutside:a,onFocusOutside:l,onInteractOutside:c,onDismiss:d,...p}=e,m=g.useContext(Xb),[h,x]=g.useState(null),v=(h==null?void 0:h.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,b]=g.useState({}),C=pn(t,D=>x(D)),k=Array.from(m.layers),[j]=[...m.layersWithOutsidePointerEventsDisabled].slice(-1),S=k.indexOf(j),R=h?k.indexOf(h):-1,N=m.layersWithOutsidePointerEventsDisabled.size>0,A=R>=S,O=v2(D=>{const L=D.target,G=[...m.branches].some(re=>re.contains(L));!A||G||(a==null||a(D),c==null||c(D),D.defaultPrevented||d==null||d())},v),T=b2(D=>{const L=D.target;[...m.branches].some(re=>re.contains(L))||(l==null||l(D),c==null||c(D),D.defaultPrevented||d==null||d())},v);return p2(D=>{R===m.layers.size-1&&(o==null||o(D),!D.defaultPrevented&&d&&(D.preventDefault(),d()))},v),g.useEffect(()=>{if(h)return n&&(m.layersWithOutsidePointerEventsDisabled.size===0&&(Wx=v.body.style.pointerEvents,v.body.style.pointerEvents="none"),m.layersWithOutsidePointerEventsDisabled.add(h)),m.layers.add(h),Vx(),()=>{n&&m.layersWithOutsidePointerEventsDisabled.size===1&&(v.body.style.pointerEvents=Wx)}},[h,v,n,m]),g.useEffect(()=>()=>{h&&(m.layers.delete(h),m.layersWithOutsidePointerEventsDisabled.delete(h),Vx())},[h,m]),g.useEffect(()=>{const D=()=>b({});return document.addEventListener(Jf,D),()=>document.removeEventListener(Jf,D)},[]),i.jsx(Mt.div,{...p,ref:C,style:{pointerEvents:N?A?"auto":"none":void 0,...e.style},onFocusCapture:mt(e.onFocusCapture,T.onFocusCapture),onBlurCapture:mt(e.onBlurCapture,T.onBlurCapture),onPointerDownCapture:mt(e.onPointerDownCapture,O.onPointerDownCapture)})});qp.displayName=h2;var x2="DismissableLayerBranch",y2=g.forwardRef((e,t)=>{const n=g.useContext(Xb),o=g.useRef(null),a=pn(t,o);return g.useEffect(()=>{const l=o.current;if(l)return n.branches.add(l),()=>{n.branches.delete(l)}},[n.branches]),i.jsx(Mt.div,{...e,ref:a})});y2.displayName=x2;function v2(e,t=globalThis==null?void 0:globalThis.document){const n=Xo(e),o=g.useRef(!1),a=g.useRef(()=>{});return g.useEffect(()=>{const l=d=>{if(d.target&&!o.current){let p=function(){Qb(m2,n,m,{discrete:!0})};const m={originalEvent:d};d.pointerType==="touch"?(t.removeEventListener("click",a.current),a.current=p,t.addEventListener("click",a.current,{once:!0})):p()}else t.removeEventListener("click",a.current);o.current=!1},c=window.setTimeout(()=>{t.addEventListener("pointerdown",l)},0);return()=>{window.clearTimeout(c),t.removeEventListener("pointerdown",l),t.removeEventListener("click",a.current)}},[t,n]),{onPointerDownCapture:()=>o.current=!0}}function b2(e,t=globalThis==null?void 0:globalThis.document){const n=Xo(e),o=g.useRef(!1);return g.useEffect(()=>{const a=l=>{l.target&&!o.current&&Qb(g2,n,{originalEvent:l},{discrete:!1})};return t.addEventListener("focusin",a),()=>t.removeEventListener("focusin",a)},[t,n]),{onFocusCapture:()=>o.current=!0,onBlurCapture:()=>o.current=!1}}function Vx(){const e=new CustomEvent(Jf);document.dispatchEvent(e)}function Qb(e,t,n,{discrete:o}){const a=n.originalEvent.target,l=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&a.addEventListener(e,t,{once:!0}),o?f2(a,l):a.dispatchEvent(l)}var sf="focusScope.autoFocusOnMount",af="focusScope.autoFocusOnUnmount",qx={bubbles:!1,cancelable:!0},w2="FocusScope",Jb=g.forwardRef((e,t)=>{const{loop:n=!1,trapped:o=!1,onMountAutoFocus:a,onUnmountAutoFocus:l,...c}=e,[d,p]=g.useState(null),m=Xo(a),h=Xo(l),x=g.useRef(null),v=pn(t,k=>p(k)),b=g.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;g.useEffect(()=>{if(o){let k=function(N){if(b.paused||!d)return;const A=N.target;d.contains(A)?x.current=A:ko(x.current,{select:!0})},j=function(N){if(b.paused||!d)return;const A=N.relatedTarget;A!==null&&(d.contains(A)||ko(x.current,{select:!0}))},S=function(N){if(document.activeElement===document.body)for(const O of N)O.removedNodes.length>0&&ko(d)};document.addEventListener("focusin",k),document.addEventListener("focusout",j);const R=new MutationObserver(S);return d&&R.observe(d,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",k),document.removeEventListener("focusout",j),R.disconnect()}}},[o,d,b.paused]),g.useEffect(()=>{if(d){Gx.add(b);const k=document.activeElement;if(!d.contains(k)){const S=new CustomEvent(sf,qx);d.addEventListener(sf,m),d.dispatchEvent(S),S.defaultPrevented||(k2(E2(Zb(d)),{select:!0}),document.activeElement===k&&ko(d))}return()=>{d.removeEventListener(sf,m),setTimeout(()=>{const S=new CustomEvent(af,qx);d.addEventListener(af,h),d.dispatchEvent(S),S.defaultPrevented||ko(k??document.body,{select:!0}),d.removeEventListener(af,h),Gx.remove(b)},0)}}},[d,m,h,b]);const C=g.useCallback(k=>{if(!n&&!o||b.paused)return;const j=k.key==="Tab"&&!k.altKey&&!k.ctrlKey&&!k.metaKey,S=document.activeElement;if(j&&S){const R=k.currentTarget,[N,A]=j2(R);N&&A?!k.shiftKey&&S===A?(k.preventDefault(),n&&ko(N,{select:!0})):k.shiftKey&&S===N&&(k.preventDefault(),n&&ko(A,{select:!0})):S===R&&k.preventDefault()}},[n,o,b.paused]);return i.jsx(Mt.div,{tabIndex:-1,...c,ref:v,onKeyDown:C})});Jb.displayName=w2;function k2(e,{select:t=!1}={}){const n=document.activeElement;for(const o of e)if(ko(o,{select:t}),document.activeElement!==n)return}function j2(e){const t=Zb(e),n=Kx(t,e),o=Kx(t.reverse(),e);return[n,o]}function Zb(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:o=>{const a=o.tagName==="INPUT"&&o.type==="hidden";return o.disabled||o.hidden||a?NodeFilter.FILTER_SKIP:o.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function Kx(e,t){for(const n of e)if(!S2(n,{upTo:t}))return n}function S2(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function N2(e){return e instanceof HTMLInputElement&&"select"in e}function ko(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&N2(e)&&t&&e.select()}}var Gx=C2();function C2(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=Yx(e,t),e.unshift(t)},remove(t){var n;e=Yx(e,t),(n=e[0])==null||n.resume()}}}function Yx(e,t){const n=[...e],o=n.indexOf(t);return o!==-1&&n.splice(o,1),n}function E2(e){return e.filter(t=>t.tagName!=="A")}var P2="Portal",Kp=g.forwardRef((e,t)=>{var d;const{container:n,...o}=e,[a,l]=g.useState(!1);Co(()=>l(!0),[]);const c=n||a&&((d=globalThis==null?void 0:globalThis.document)==null?void 0:d.body);return c?tC.createPortal(i.jsx(Mt.div,{...o,ref:t}),c):null});Kp.displayName=P2;function T2(e,t){return g.useReducer((n,o)=>t[n][o]??n,e)}var es=e=>{const{present:t,children:n}=e,o=R2(t),a=typeof n=="function"?n({present:o.isPresent}):g.Children.only(n),l=pn(o.ref,A2(a));return typeof n=="function"||o.isPresent?g.cloneElement(a,{ref:l}):null};es.displayName="Presence";function R2(e){const[t,n]=g.useState(),o=g.useRef(null),a=g.useRef(e),l=g.useRef("none"),c=e?"mounted":"unmounted",[d,p]=T2(c,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return g.useEffect(()=>{const m=Wl(o.current);l.current=d==="mounted"?m:"none"},[d]),Co(()=>{const m=o.current,h=a.current;if(h!==e){const v=l.current,b=Wl(m);e?p("MOUNT"):b==="none"||(m==null?void 0:m.display)==="none"?p("UNMOUNT"):p(h&&v!==b?"ANIMATION_OUT":"UNMOUNT"),a.current=e}},[e,p]),Co(()=>{if(t){let m;const h=t.ownerDocument.defaultView??window,x=b=>{const k=Wl(o.current).includes(CSS.escape(b.animationName));if(b.target===t&&k&&(p("ANIMATION_END"),!a.current)){const j=t.style.animationFillMode;t.style.animationFillMode="forwards",m=h.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=j)})}},v=b=>{b.target===t&&(l.current=Wl(o.current))};return t.addEventListener("animationstart",v),t.addEventListener("animationcancel",x),t.addEventListener("animationend",x),()=>{h.clearTimeout(m),t.removeEventListener("animationstart",v),t.removeEventListener("animationcancel",x),t.removeEventListener("animationend",x)}}else p("ANIMATION_END")},[t,p]),{isPresent:["mounted","unmountSuspended"].includes(d),ref:g.useCallback(m=>{o.current=m?getComputedStyle(m):null,n(m)},[])}}function Wl(e){return(e==null?void 0:e.animationName)||"none"}function A2(e){var o,a;let t=(o=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(a=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:a.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var lf=0;function D2(){g.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??Xx()),document.body.insertAdjacentElement("beforeend",e[1]??Xx()),lf++,()=>{lf===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),lf--}},[])}function Xx(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var jr=function(){return jr=Object.assign||function(t){for(var n,o=1,a=arguments.length;o<a;o++){n=arguments[o];for(var l in n)Object.prototype.hasOwnProperty.call(n,l)&&(t[l]=n[l])}return t},jr.apply(this,arguments)};function ew(e,t){var n={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(n[o]=e[o]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var a=0,o=Object.getOwnPropertySymbols(e);a<o.length;a++)t.indexOf(o[a])<0&&Object.prototype.propertyIsEnumerable.call(e,o[a])&&(n[o[a]]=e[o[a]]);return n}function I2(e,t,n){if(n||arguments.length===2)for(var o=0,a=t.length,l;o<a;o++)(l||!(o in t))&&(l||(l=Array.prototype.slice.call(t,0,o)),l[o]=t[o]);return e.concat(l||Array.prototype.slice.call(t))}var ac="right-scroll-bar-position",lc="width-before-scroll-bar",O2="with-scroll-bars-hidden",L2="--removed-body-scroll-bar-size";function cf(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function M2(e,t){var n=g.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(o){var a=n.value;a!==o&&(n.value=o,n.callback(o,a))}}}})[0];return n.callback=t,n.facade}var _2=typeof window<"u"?g.useLayoutEffect:g.useEffect,Qx=new WeakMap;function $2(e,t){var n=M2(null,function(o){return e.forEach(function(a){return cf(a,o)})});return _2(function(){var o=Qx.get(n);if(o){var a=new Set(o),l=new Set(e),c=n.current;a.forEach(function(d){l.has(d)||cf(d,null)}),l.forEach(function(d){a.has(d)||cf(d,c)})}Qx.set(n,e)},[e]),n}function F2(e){return e}function z2(e,t){t===void 0&&(t=F2);var n=[],o=!1,a={read:function(){if(o)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(l){var c=t(l,o);return n.push(c),function(){n=n.filter(function(d){return d!==c})}},assignSyncMedium:function(l){for(o=!0;n.length;){var c=n;n=[],c.forEach(l)}n={push:function(d){return l(d)},filter:function(){return n}}},assignMedium:function(l){o=!0;var c=[];if(n.length){var d=n;n=[],d.forEach(l),c=n}var p=function(){var h=c;c=[],h.forEach(l)},m=function(){return Promise.resolve().then(p)};m(),n={push:function(h){c.push(h),m()},filter:function(h){return c=c.filter(h),n}}}};return a}function B2(e){e===void 0&&(e={});var t=z2(null);return t.options=jr({async:!0,ssr:!1},e),t}var tw=function(e){var t=e.sideCar,n=ew(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var o=t.read();if(!o)throw new Error("Sidecar medium not found");return g.createElement(o,jr({},n))};tw.isSideCarExport=!0;function U2(e,t){return e.useMedium(t),tw}var nw=B2(),uf=function(){},zc=g.forwardRef(function(e,t){var n=g.useRef(null),o=g.useState({onScrollCapture:uf,onWheelCapture:uf,onTouchMoveCapture:uf}),a=o[0],l=o[1],c=e.forwardProps,d=e.children,p=e.className,m=e.removeScrollBar,h=e.enabled,x=e.shards,v=e.sideCar,b=e.noRelative,C=e.noIsolation,k=e.inert,j=e.allowPinchZoom,S=e.as,R=S===void 0?"div":S,N=e.gapMode,A=ew(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),O=v,T=$2([n,t]),D=jr(jr({},A),a);return g.createElement(g.Fragment,null,h&&g.createElement(O,{sideCar:nw,removeScrollBar:m,shards:x,noRelative:b,noIsolation:C,inert:k,setCallbacks:l,allowPinchZoom:!!j,lockRef:n,gapMode:N}),c?g.cloneElement(g.Children.only(d),jr(jr({},D),{ref:T})):g.createElement(R,jr({},D,{className:p,ref:T}),d))});zc.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};zc.classNames={fullWidth:lc,zeroRight:ac};var H2=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function W2(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=H2();return t&&e.setAttribute("nonce",t),e}function V2(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function q2(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var K2=function(){var e=0,t=null;return{add:function(n){e==0&&(t=W2())&&(V2(t,n),q2(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},G2=function(){var e=K2();return function(t,n){g.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},rw=function(){var e=G2(),t=function(n){var o=n.styles,a=n.dynamic;return e(o,a),null};return t},Y2={left:0,top:0,right:0,gap:0},df=function(e){return parseInt(e||"",10)||0},X2=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],o=t[e==="padding"?"paddingTop":"marginTop"],a=t[e==="padding"?"paddingRight":"marginRight"];return[df(n),df(o),df(a)]},Q2=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return Y2;var t=X2(e),n=document.documentElement.clientWidth,o=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,o-n+t[2]-t[0])}},J2=rw(),$s="data-scroll-locked",Z2=function(e,t,n,o){var a=e.left,l=e.top,c=e.right,d=e.gap;return n===void 0&&(n="margin"),`
416
+ .`.concat(O2,` {
417
+ overflow: hidden `).concat(o,`;
418
+ padding-right: `).concat(d,"px ").concat(o,`;
419
+ }
420
+ body[`).concat($s,`] {
421
+ overflow: hidden `).concat(o,`;
422
+ overscroll-behavior: contain;
423
+ `).concat([t&&"position: relative ".concat(o,";"),n==="margin"&&`
424
+ padding-left: `.concat(a,`px;
425
+ padding-top: `).concat(l,`px;
426
+ padding-right: `).concat(c,`px;
427
+ margin-left:0;
428
+ margin-top:0;
429
+ margin-right: `).concat(d,"px ").concat(o,`;
430
+ `),n==="padding"&&"padding-right: ".concat(d,"px ").concat(o,";")].filter(Boolean).join(""),`
431
+ }
432
+
433
+ .`).concat(ac,` {
434
+ right: `).concat(d,"px ").concat(o,`;
435
+ }
436
+
437
+ .`).concat(lc,` {
438
+ margin-right: `).concat(d,"px ").concat(o,`;
439
+ }
440
+
441
+ .`).concat(ac," .").concat(ac,` {
442
+ right: 0 `).concat(o,`;
443
+ }
444
+
445
+ .`).concat(lc," .").concat(lc,` {
446
+ margin-right: 0 `).concat(o,`;
447
+ }
448
+
449
+ body[`).concat($s,`] {
450
+ `).concat(L2,": ").concat(d,`px;
451
+ }
452
+ `)},Jx=function(){var e=parseInt(document.body.getAttribute($s)||"0",10);return isFinite(e)?e:0},eP=function(){g.useEffect(function(){return document.body.setAttribute($s,(Jx()+1).toString()),function(){var e=Jx()-1;e<=0?document.body.removeAttribute($s):document.body.setAttribute($s,e.toString())}},[])},tP=function(e){var t=e.noRelative,n=e.noImportant,o=e.gapMode,a=o===void 0?"margin":o;eP();var l=g.useMemo(function(){return Q2(a)},[a]);return g.createElement(J2,{styles:Z2(l,!t,a,n?"":"!important")})},Zf=!1;if(typeof window<"u")try{var Vl=Object.defineProperty({},"passive",{get:function(){return Zf=!0,!0}});window.addEventListener("test",Vl,Vl),window.removeEventListener("test",Vl,Vl)}catch{Zf=!1}var Ps=Zf?{passive:!1}:!1,nP=function(e){return e.tagName==="TEXTAREA"},ow=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!nP(e)&&n[t]==="visible")},rP=function(e){return ow(e,"overflowY")},oP=function(e){return ow(e,"overflowX")},Zx=function(e,t){var n=t.ownerDocument,o=t;do{typeof ShadowRoot<"u"&&o instanceof ShadowRoot&&(o=o.host);var a=sw(e,o);if(a){var l=iw(e,o),c=l[1],d=l[2];if(c>d)return!0}o=o.parentNode}while(o&&o!==n.body);return!1},sP=function(e){var t=e.scrollTop,n=e.scrollHeight,o=e.clientHeight;return[t,n,o]},iP=function(e){var t=e.scrollLeft,n=e.scrollWidth,o=e.clientWidth;return[t,n,o]},sw=function(e,t){return e==="v"?rP(t):oP(t)},iw=function(e,t){return e==="v"?sP(t):iP(t)},aP=function(e,t){return e==="h"&&t==="rtl"?-1:1},lP=function(e,t,n,o,a){var l=aP(e,window.getComputedStyle(t).direction),c=l*o,d=n.target,p=t.contains(d),m=!1,h=c>0,x=0,v=0;do{if(!d)break;var b=iw(e,d),C=b[0],k=b[1],j=b[2],S=k-j-l*C;(C||S)&&sw(e,d)&&(x+=S,v+=C);var R=d.parentNode;d=R&&R.nodeType===Node.DOCUMENT_FRAGMENT_NODE?R.host:R}while(!p&&d!==document.body||p&&(t.contains(d)||t===d));return(h&&Math.abs(x)<1||!h&&Math.abs(v)<1)&&(m=!0),m},ql=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},ey=function(e){return[e.deltaX,e.deltaY]},ty=function(e){return e&&"current"in e?e.current:e},cP=function(e,t){return e[0]===t[0]&&e[1]===t[1]},uP=function(e){return`
453
+ .block-interactivity-`.concat(e,` {pointer-events: none;}
454
+ .allow-interactivity-`).concat(e,` {pointer-events: all;}
455
+ `)},dP=0,Ts=[];function fP(e){var t=g.useRef([]),n=g.useRef([0,0]),o=g.useRef(),a=g.useState(dP++)[0],l=g.useState(rw)[0],c=g.useRef(e);g.useEffect(function(){c.current=e},[e]),g.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(a));var k=I2([e.lockRef.current],(e.shards||[]).map(ty),!0).filter(Boolean);return k.forEach(function(j){return j.classList.add("allow-interactivity-".concat(a))}),function(){document.body.classList.remove("block-interactivity-".concat(a)),k.forEach(function(j){return j.classList.remove("allow-interactivity-".concat(a))})}}},[e.inert,e.lockRef.current,e.shards]);var d=g.useCallback(function(k,j){if("touches"in k&&k.touches.length===2||k.type==="wheel"&&k.ctrlKey)return!c.current.allowPinchZoom;var S=ql(k),R=n.current,N="deltaX"in k?k.deltaX:R[0]-S[0],A="deltaY"in k?k.deltaY:R[1]-S[1],O,T=k.target,D=Math.abs(N)>Math.abs(A)?"h":"v";if("touches"in k&&D==="h"&&T.type==="range")return!1;var L=window.getSelection(),G=L&&L.anchorNode,re=G?G===T||G.contains(T):!1;if(re)return!1;var z=Zx(D,T);if(!z)return!0;if(z?O=D:(O=D==="v"?"h":"v",z=Zx(D,T)),!z)return!1;if(!o.current&&"changedTouches"in k&&(N||A)&&(o.current=O),!O)return!0;var K=o.current||O;return lP(K,j,k,K==="h"?N:A)},[]),p=g.useCallback(function(k){var j=k;if(!(!Ts.length||Ts[Ts.length-1]!==l)){var S="deltaY"in j?ey(j):ql(j),R=t.current.filter(function(O){return O.name===j.type&&(O.target===j.target||j.target===O.shadowParent)&&cP(O.delta,S)})[0];if(R&&R.should){j.cancelable&&j.preventDefault();return}if(!R){var N=(c.current.shards||[]).map(ty).filter(Boolean).filter(function(O){return O.contains(j.target)}),A=N.length>0?d(j,N[0]):!c.current.noIsolation;A&&j.cancelable&&j.preventDefault()}}},[]),m=g.useCallback(function(k,j,S,R){var N={name:k,delta:j,target:S,should:R,shadowParent:pP(S)};t.current.push(N),setTimeout(function(){t.current=t.current.filter(function(A){return A!==N})},1)},[]),h=g.useCallback(function(k){n.current=ql(k),o.current=void 0},[]),x=g.useCallback(function(k){m(k.type,ey(k),k.target,d(k,e.lockRef.current))},[]),v=g.useCallback(function(k){m(k.type,ql(k),k.target,d(k,e.lockRef.current))},[]);g.useEffect(function(){return Ts.push(l),e.setCallbacks({onScrollCapture:x,onWheelCapture:x,onTouchMoveCapture:v}),document.addEventListener("wheel",p,Ps),document.addEventListener("touchmove",p,Ps),document.addEventListener("touchstart",h,Ps),function(){Ts=Ts.filter(function(k){return k!==l}),document.removeEventListener("wheel",p,Ps),document.removeEventListener("touchmove",p,Ps),document.removeEventListener("touchstart",h,Ps)}},[]);var b=e.removeScrollBar,C=e.inert;return g.createElement(g.Fragment,null,C?g.createElement(l,{styles:uP(a)}):null,b?g.createElement(tP,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function pP(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const hP=U2(nw,fP);var aw=g.forwardRef(function(e,t){return g.createElement(zc,jr({},e,{ref:t,sideCar:hP}))});aw.classNames=zc.classNames;var mP=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},Rs=new WeakMap,Kl=new WeakMap,Gl={},ff=0,lw=function(e){return e&&(e.host||lw(e.parentNode))},gP=function(e,t){return t.map(function(n){if(e.contains(n))return n;var o=lw(n);return o&&e.contains(o)?o:(console.error("aria-hidden",n,"in not contained inside",e,". Doing nothing"),null)}).filter(function(n){return!!n})},xP=function(e,t,n,o){var a=gP(t,Array.isArray(e)?e:[e]);Gl[n]||(Gl[n]=new WeakMap);var l=Gl[n],c=[],d=new Set,p=new Set(a),m=function(x){!x||d.has(x)||(d.add(x),m(x.parentNode))};a.forEach(m);var h=function(x){!x||p.has(x)||Array.prototype.forEach.call(x.children,function(v){if(d.has(v))h(v);else try{var b=v.getAttribute(o),C=b!==null&&b!=="false",k=(Rs.get(v)||0)+1,j=(l.get(v)||0)+1;Rs.set(v,k),l.set(v,j),c.push(v),k===1&&C&&Kl.set(v,!0),j===1&&v.setAttribute(n,"true"),C||v.setAttribute(o,"true")}catch(S){console.error("aria-hidden: cannot operate on ",v,S)}})};return h(t),d.clear(),ff++,function(){c.forEach(function(x){var v=Rs.get(x)-1,b=l.get(x)-1;Rs.set(x,v),l.set(x,b),v||(Kl.has(x)||x.removeAttribute(o),Kl.delete(x)),b||x.removeAttribute(n)}),ff--,ff||(Rs=new WeakMap,Rs=new WeakMap,Kl=new WeakMap,Gl={})}},yP=function(e,t,n){n===void 0&&(n="data-aria-hidden");var o=Array.from(Array.isArray(e)?e:[e]),a=mP(e);return a?(o.push.apply(o,Array.from(a.querySelectorAll("[aria-live], script"))),xP(o,a,n,"aria-hidden")):function(){return null}};function vP(e){const t=bP(e),n=g.forwardRef((o,a)=>{const{children:l,...c}=o,d=g.Children.toArray(l),p=d.find(kP);if(p){const m=p.props.children,h=d.map(x=>x===p?g.Children.count(m)>1?g.Children.only(null):g.isValidElement(m)?m.props.children:null:x);return i.jsx(t,{...c,ref:a,children:g.isValidElement(m)?g.cloneElement(m,void 0,h):null})}return i.jsx(t,{...c,ref:a,children:l})});return n.displayName=`${e}.Slot`,n}function bP(e){const t=g.forwardRef((n,o)=>{const{children:a,...l}=n;if(g.isValidElement(a)){const c=SP(a),d=jP(l,a.props);return a.type!==g.Fragment&&(d.ref=o?$c(o,c):c),g.cloneElement(a,d)}return g.Children.count(a)>1?g.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var wP=Symbol("radix.slottable");function kP(e){return g.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===wP}function jP(e,t){const n={...t};for(const o in t){const a=e[o],l=t[o];/^on[A-Z]/.test(o)?a&&l?n[o]=(...d)=>{const p=l(...d);return a(...d),p}:a&&(n[o]=a):o==="style"?n[o]={...a,...l}:o==="className"&&(n[o]=[a,l].filter(Boolean).join(" "))}return{...e,...n}}function SP(e){var o,a;let t=(o=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(a=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:a.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var Bc="Dialog",[cw,uw]=Zo(Bc),[NP,mr]=cw(Bc),dw=e=>{const{__scopeDialog:t,children:n,open:o,defaultOpen:a,onOpenChange:l,modal:c=!0}=e,d=g.useRef(null),p=g.useRef(null),[m,h]=Fc({prop:o,defaultProp:a??!1,onChange:l,caller:Bc});return i.jsx(NP,{scope:t,triggerRef:d,contentRef:p,contentId:_s(),titleId:_s(),descriptionId:_s(),open:m,onOpenChange:h,onOpenToggle:g.useCallback(()=>h(x=>!x),[h]),modal:c,children:n})};dw.displayName=Bc;var fw="DialogTrigger",pw=g.forwardRef((e,t)=>{const{__scopeDialog:n,...o}=e,a=mr(fw,n),l=pn(t,a.triggerRef);return i.jsx(Mt.button,{type:"button","aria-haspopup":"dialog","aria-expanded":a.open,"aria-controls":a.contentId,"data-state":Xp(a.open),...o,ref:l,onClick:mt(e.onClick,a.onOpenToggle)})});pw.displayName=fw;var Gp="DialogPortal",[CP,hw]=cw(Gp,{forceMount:void 0}),mw=e=>{const{__scopeDialog:t,forceMount:n,children:o,container:a}=e,l=mr(Gp,t);return i.jsx(CP,{scope:t,forceMount:n,children:g.Children.map(o,c=>i.jsx(es,{present:n||l.open,children:i.jsx(Kp,{asChild:!0,container:a,children:c})}))})};mw.displayName=Gp;var gc="DialogOverlay",gw=g.forwardRef((e,t)=>{const n=hw(gc,e.__scopeDialog),{forceMount:o=n.forceMount,...a}=e,l=mr(gc,e.__scopeDialog);return l.modal?i.jsx(es,{present:o||l.open,children:i.jsx(PP,{...a,ref:t})}):null});gw.displayName=gc;var EP=vP("DialogOverlay.RemoveScroll"),PP=g.forwardRef((e,t)=>{const{__scopeDialog:n,...o}=e,a=mr(gc,n);return i.jsx(aw,{as:EP,allowPinchZoom:!0,shards:[a.contentRef],children:i.jsx(Mt.div,{"data-state":Xp(a.open),...o,ref:t,style:{pointerEvents:"auto",...o.style}})})}),Qo="DialogContent",xw=g.forwardRef((e,t)=>{const n=hw(Qo,e.__scopeDialog),{forceMount:o=n.forceMount,...a}=e,l=mr(Qo,e.__scopeDialog);return i.jsx(es,{present:o||l.open,children:l.modal?i.jsx(TP,{...a,ref:t}):i.jsx(RP,{...a,ref:t})})});xw.displayName=Qo;var TP=g.forwardRef((e,t)=>{const n=mr(Qo,e.__scopeDialog),o=g.useRef(null),a=pn(t,n.contentRef,o);return g.useEffect(()=>{const l=o.current;if(l)return yP(l)},[]),i.jsx(yw,{...e,ref:a,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:mt(e.onCloseAutoFocus,l=>{var c;l.preventDefault(),(c=n.triggerRef.current)==null||c.focus()}),onPointerDownOutside:mt(e.onPointerDownOutside,l=>{const c=l.detail.originalEvent,d=c.button===0&&c.ctrlKey===!0;(c.button===2||d)&&l.preventDefault()}),onFocusOutside:mt(e.onFocusOutside,l=>l.preventDefault())})}),RP=g.forwardRef((e,t)=>{const n=mr(Qo,e.__scopeDialog),o=g.useRef(!1),a=g.useRef(!1);return i.jsx(yw,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:l=>{var c,d;(c=e.onCloseAutoFocus)==null||c.call(e,l),l.defaultPrevented||(o.current||(d=n.triggerRef.current)==null||d.focus(),l.preventDefault()),o.current=!1,a.current=!1},onInteractOutside:l=>{var p,m;(p=e.onInteractOutside)==null||p.call(e,l),l.defaultPrevented||(o.current=!0,l.detail.originalEvent.type==="pointerdown"&&(a.current=!0));const c=l.target;((m=n.triggerRef.current)==null?void 0:m.contains(c))&&l.preventDefault(),l.detail.originalEvent.type==="focusin"&&a.current&&l.preventDefault()}})}),yw=g.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:o,onOpenAutoFocus:a,onCloseAutoFocus:l,...c}=e,d=mr(Qo,n),p=g.useRef(null),m=pn(t,p);return D2(),i.jsxs(i.Fragment,{children:[i.jsx(Jb,{asChild:!0,loop:!0,trapped:o,onMountAutoFocus:a,onUnmountAutoFocus:l,children:i.jsx(qp,{role:"dialog",id:d.contentId,"aria-describedby":d.descriptionId,"aria-labelledby":d.titleId,"data-state":Xp(d.open),...c,ref:m,onDismiss:()=>d.onOpenChange(!1)})}),i.jsxs(i.Fragment,{children:[i.jsx(DP,{titleId:d.titleId}),i.jsx(OP,{contentRef:p,descriptionId:d.descriptionId})]})]})}),Yp="DialogTitle",vw=g.forwardRef((e,t)=>{const{__scopeDialog:n,...o}=e,a=mr(Yp,n);return i.jsx(Mt.h2,{id:a.titleId,...o,ref:t})});vw.displayName=Yp;var bw="DialogDescription",ww=g.forwardRef((e,t)=>{const{__scopeDialog:n,...o}=e,a=mr(bw,n);return i.jsx(Mt.p,{id:a.descriptionId,...o,ref:t})});ww.displayName=bw;var kw="DialogClose",jw=g.forwardRef((e,t)=>{const{__scopeDialog:n,...o}=e,a=mr(kw,n);return i.jsx(Mt.button,{type:"button",...o,ref:t,onClick:mt(e.onClick,()=>a.onOpenChange(!1))})});jw.displayName=kw;function Xp(e){return e?"open":"closed"}var Sw="DialogTitleWarning",[AP,Nw]=JE(Sw,{contentName:Qo,titleName:Yp,docsSlug:"dialog"}),DP=({titleId:e})=>{const t=Nw(Sw),n=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
456
+
457
+ If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.
458
+
459
+ For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return g.useEffect(()=>{e&&(document.getElementById(e)||console.error(n))},[n,e]),null},IP="DialogDescriptionWarning",OP=({contentRef:e,descriptionId:t})=>{const o=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${Nw(IP).contentName}}.`;return g.useEffect(()=>{var l;const a=(l=e.current)==null?void 0:l.getAttribute("aria-describedby");t&&a&&(document.getElementById(t)||console.warn(o))},[o,e,t]),null},Cw=dw,LP=pw,Ew=mw,Qp=gw,Jp=xw,Zp=vw,eh=ww,Pw=jw;const Zs=Cw,MP=Ew,Tw=g.forwardRef(({className:e,...t},n)=>i.jsx(Qp,{ref:n,className:Ue("fixed inset-0 z-50 bg-background/80 backdrop-blur-sm",e),...t}));Tw.displayName=Qp.displayName;const ts=g.forwardRef(({className:e,children:t,...n},o)=>i.jsxs(MP,{children:[i.jsx(Tw,{}),i.jsx(Jp,{ref:o,className:Ue("fixed left-1/2 top-1/2 z-50 grid w-[calc(100%-2rem)] max-w-lg -translate-x-1/2 -translate-y-1/2 gap-4 rounded-xl border border-border/70 bg-card p-6 shadow-2xl outline-none",e),...n,children:t})]}));ts.displayName=Jp.displayName;function th({className:e,...t}){return i.jsx("div",{className:Ue("flex flex-col space-y-2 text-left",e),...t})}function nh({className:e,...t}){return i.jsx("div",{className:Ue("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",e),...t})}const ns=g.forwardRef(({className:e,...t},n)=>i.jsx(Zp,{ref:n,className:Ue("text-lg font-semibold tracking-tight text-foreground",e),...t}));ns.displayName=Zp.displayName;const Na=g.forwardRef(({className:e,...t},n)=>i.jsx(eh,{ref:n,className:Ue("text-sm leading-6 text-muted-foreground",e),...t}));Na.displayName=eh.displayName;const _P=-1,$P=-40;function pf(e,t){if(e.length===0)return 0;if(t.length===0)return-1/0;let n=0,o=0,a=-2,l=0;for(let c=0;c<e.length;c++){const d=e[c];let p=!1;for(;o<t.length;)if(t[o]===d){if(n+=100,o===a+1&&(n+=20),o===0)n+=30;else{const m=t[o-1];(m===" "||m==="-"||m==="_"||m==="/")&&(n+=15)}l>0&&(n+=Math.max($P,l*_P)),a=o,l=0,o++,p=!0;break}else l++,o++;if(!p)return-1/0}return n}const ny={page:0,project:1,assignment:2,playbook:3,server:4,todo:5};function rh(e,t,n=50){const o=e.toLowerCase();if(!o)return t.slice(0,n).map(c=>({...c,score:0}));const l=t.map(c=>{var x;const d=pf(o,c.title.toLowerCase())*1,p=c.subtitle?pf(o,c.subtitle.toLowerCase())*.5:-1/0,m=(x=c.keywords)!=null&&x.length?pf(o,c.keywords.join(" ").toLowerCase())*.3:-1/0,h=Math.max(d,p,m);return{...c,score:h}}).filter(c=>c.score>-1/0);return l.sort((c,d)=>d.score!==c.score?d.score-c.score:c.title.length!==d.title.length?c.title.length-d.title.length:c.title!==d.title?c.title<d.title?-1:1:(ny[c.type]??99)-(ny[d.type]??99)),l.slice(0,n)}const FP={page:"Page",project:"Project",assignment:"Assignment",playbook:"Playbook",server:"Server",todo:"Todo"};function zP({entries:e}){const{paletteOpen:t,closePalette:n}=Ao(),o=Ut(),[a,l]=g.useState(""),[c,d]=g.useState(0),p=g.useRef(null),m=g.useMemo(()=>rh(a,e,50),[a,e]);g.useEffect(()=>{d(0)},[a,t]),g.useEffect(()=>{t||l("")},[t]),g.useEffect(()=>{var b;const v=(b=p.current)==null?void 0:b.querySelector(`[data-palette-idx="${c}"]`);v==null||v.scrollIntoView({block:"nearest"})},[c]);function h(v){o(v.route),n()}function x(v){if(v.key==="ArrowDown")v.preventDefault(),d(b=>Math.min(m.length-1,b+1));else if(v.key==="ArrowUp")v.preventDefault(),d(b=>Math.max(0,b-1));else if(v.key==="Enter"){v.preventDefault();const b=m[c];b&&h(b)}}return i.jsx(Zs,{open:t,onOpenChange:v=>v?null:n(),children:i.jsxs(ts,{className:"max-w-xl p-0 gap-0",children:[i.jsx(ns,{className:"sr-only",children:"Command palette"}),i.jsx("input",{autoFocus:!0,type:"text",value:a,onChange:v=>l(v.target.value),onKeyDown:x,placeholder:"Search projects, assignments, playbooks, servers, todos…",className:"w-full rounded-t-xl border-0 border-b border-border/70 bg-transparent px-4 py-3 text-sm text-foreground outline-none focus:ring-0"}),i.jsx("div",{ref:p,className:"max-h-[60vh] overflow-y-auto p-1",children:m.length===0?i.jsx("div",{className:"px-4 py-6 text-center text-sm text-muted-foreground",children:a?"No matches":"Start typing to search"}):m.map((v,b)=>{const C=b===c;return i.jsxs("button",{type:"button","data-palette-idx":b,onClick:()=>h(v),onMouseEnter:()=>d(b),className:`flex w-full items-center gap-3 rounded-md px-3 py-2 text-left text-sm transition-colors ${C?"bg-accent text-accent-foreground":"hover:bg-accent/50 text-foreground"}`,children:[i.jsx("span",{className:"shrink-0 rounded border border-border/70 bg-background/60 px-1.5 py-0.5 text-[10px] font-medium uppercase tracking-wide text-muted-foreground",children:FP[v.type]??v.type}),i.jsx("span",{className:"min-w-0 flex-1 truncate",children:v.title}),v.subtitle?i.jsx("span",{className:"shrink-0 truncate text-xs text-muted-foreground",children:v.subtitle}):null]},v.id)})}),i.jsxs("div",{className:"flex items-center justify-between border-t border-border/70 px-3 py-2 text-[11px] text-muted-foreground",children:[i.jsxs("span",{children:["↑↓"," navigate ","·"," ","↵"," open ","·"," Esc close"]}),i.jsxs("span",{children:[m.length," result",m.length===1?"":"s"]})]})]})})}function BP({label:e,onBack:t,disabled:n,stepCounter:o}){return i.jsxs("div",{className:"flex items-center gap-2 border-b border-border/70 px-3 py-2",children:[i.jsxs("button",{type:"button",onClick:t,disabled:n,className:"inline-flex h-7 items-center gap-1 rounded border border-border/70 bg-background/60 px-2 text-[11px] text-muted-foreground transition-colors hover:bg-accent/40 hover:text-foreground disabled:opacity-50","aria-label":"Back",children:[i.jsx(aC,{className:"h-3.5 w-3.5","aria-hidden":"true"}),i.jsx("span",{children:"Back"})]}),i.jsx("span",{className:"text-[11px] font-medium uppercase tracking-wide text-muted-foreground",children:e}),o?i.jsxs("span",{className:"ml-auto text-[10px] text-muted-foreground/80",children:["step ",o.current," of ",o.total]}):null]})}function UP({step:e,initialValue:t,disabled:n,onSubmit:o}){const[a,l]=g.useState(t??""),[c,d]=g.useState(!1),p=g.useRef(null);g.useEffect(()=>{var C;(C=p.current)==null||C.focus()},[]);const m=a.trim(),h=e.required!==!1,x=e.pattern&&m.length>0&&!e.pattern.regex.test(m),v=!n&&(!h||m.length>0)&&!x;function b(C){if(C.key==="Enter"){if(C.preventDefault(),!v){d(!0);return}o(m)}}return i.jsxs(i.Fragment,{children:[i.jsx("input",{ref:p,type:"text",value:a,onChange:C=>{l(C.target.value),d(!1)},onKeyDown:b,placeholder:e.placeholder,disabled:n,className:"w-full border-0 border-b border-border/70 bg-transparent px-4 py-3 text-sm text-foreground outline-none focus:ring-0 disabled:opacity-60"}),c&&e.pattern&&x?i.jsx("div",{className:"border-b border-border/70 bg-destructive/10 px-4 py-2 text-xs text-destructive",children:e.pattern.message}):null]})}function HP({step:e,disabled:t,onSubmit:n}){const[o,a]=g.useState({phase:"loading"}),[l,c]=g.useState(""),[d,p]=g.useState(0),[m,h]=g.useState(0),x=g.useRef(null),v=g.useRef(null);g.useEffect(()=>{var k;(k=x.current)==null||k.focus()},[]),g.useEffect(()=>{let k=!1;return a({phase:"loading"}),Promise.resolve().then(()=>e.loadOptions()).then(j=>{k||a({phase:"loaded",options:j})}).catch(j=>{if(k)return;const S=j instanceof Error?j.message:"Failed to load options";a({phase:"error",message:S})}),()=>{k=!0}},[e,m]);const b=g.useMemo(()=>{if(o.phase!=="loaded")return[];const k=o.options.map(j=>({type:"option",title:j.label,subtitle:j.hint,keywords:[j.value],option:j}));return rh(l,k,100)},[o,l]);g.useEffect(()=>{p(0)},[b.length]),g.useEffect(()=>{var j;const k=(j=v.current)==null?void 0:j.querySelector(`[data-picker-idx="${d}"]`);k==null||k.scrollIntoView({block:"nearest"})},[d]);function C(k){if(o.phase==="loaded"){if(k.key==="ArrowDown")k.preventDefault(),p(j=>Math.min(b.length-1,j+1));else if(k.key==="ArrowUp")k.preventDefault(),p(j=>Math.max(0,j-1));else if(k.key==="Enter"){k.preventDefault();const j=b[d];j&&n(j.option.value)}}}return i.jsxs(i.Fragment,{children:[i.jsx("input",{ref:x,type:"text",value:l,onChange:k=>c(k.target.value),onKeyDown:C,placeholder:`Filter ${e.label.toLowerCase()}…`,disabled:t||o.phase==="loading",className:"w-full border-0 border-b border-border/70 bg-transparent px-4 py-3 text-sm text-foreground outline-none focus:ring-0 disabled:opacity-60"}),i.jsx("div",{ref:v,className:"max-h-[60vh] min-h-[120px] overflow-y-auto p-1",children:o.phase==="loading"?i.jsx("div",{className:"px-4 py-6 text-center text-sm text-muted-foreground",children:"Loading…"}):o.phase==="error"?i.jsxs("div",{className:"px-4 py-4 text-sm",children:[i.jsxs("div",{className:"mb-2 text-destructive",children:["Failed to load: ",o.message]}),i.jsx("button",{type:"button",onClick:()=>h(k=>k+1),className:"rounded border border-border/70 bg-background/60 px-2 py-1 text-xs text-foreground hover:bg-accent/40",children:"Retry"})]}):b.length===0?i.jsx("div",{className:"px-4 py-6 text-center text-sm text-muted-foreground",children:o.options.length===0?e.emptyMessage??"No options available":"No matches"}):b.map((k,j)=>{const S=j===d;return i.jsxs("button",{type:"button","data-picker-idx":j,onClick:()=>n(k.option.value),onMouseEnter:()=>p(j),disabled:t,className:`flex w-full items-center gap-3 rounded-md px-3 py-2 text-left text-sm transition-colors disabled:opacity-60 ${S?"bg-accent text-accent-foreground":"hover:bg-accent/50 text-foreground"}`,children:[i.jsx("span",{className:"min-w-0 flex-1 truncate",children:k.option.label}),k.option.hint?i.jsx("span",{className:"shrink-0 truncate text-xs text-muted-foreground",children:k.option.hint}):null]},k.option.value)})})]})}function WP({entries:e}){var ge,Se;const t=Ut(),{actionsPaletteOpen:n,closeActionsPalette:o,customBindings:a,bindAction:l,findConflict:c,pendingActionKind:d,consumePendingActionKind:p}=Ao(),[m,h]=g.useState(""),[x,v]=g.useState(0),[b,C]=g.useState(null),[k,j]=g.useState(""),[S,R]=g.useState(null),[N,A]=g.useState(null),[O,T]=g.useState(!1),[D,L]=g.useState(null),G=g.useRef(null),re=g.useMemo(()=>e.map(te=>({type:te.group.toLowerCase(),title:te.title,subtitle:te.subtitle,keywords:te.keywords,action:te})),[e]),z=g.useMemo(()=>rh(m,re,50),[m,re]);g.useEffect(()=>{v(0)},[m,n]),g.useEffect(()=>{n||(h(""),C(null),j(""),R(null),A(null),T(!1),L(null))},[n]),g.useEffect(()=>{if(!n||!d)return;const te=p();if(!te)return;const fe=e.find(ve=>ve.bindableKind===te);fe&&K(fe)},[n,d]),g.useEffect(()=>{var fe;const te=(fe=G.current)==null?void 0:fe.querySelector(`[data-palette-idx="${x}"]`);te==null||te.scrollIntoView({block:"nearest"})},[x]);async function K(te){if(!O){if(te.flow&&te.flow.steps.length>0){R({action:te,stepIndex:0,values:{}}),L(null);return}if(te.requiresInput){C(te),j(""),L(null);return}if(te.run){T(!0),L(null);try{await te.run(),o()}catch(fe){L(fe instanceof Error?fe.message:"Action failed")}finally{T(!1)}}}}async function q(te){if(!S)return;const fe=S.action.flow.steps[S.stepIndex],ve={...S.values,[fe.id]:te};if(S.stepIndex+1<S.action.flow.steps.length){R({action:S.action,stepIndex:S.stepIndex+1,values:ve});return}T(!0),L(null);try{await S.action.flow.submit(ve,{navigate:t}),o()}catch(we){L(we instanceof Error?we.message:"Action failed")}finally{T(!1)}}function J(){if(S&&!O){if(S.stepIndex===0){R(null),L(null);return}R({action:S.action,stepIndex:S.stepIndex-1,values:S.values}),L(null)}}async function _(){if(O||!(b!=null&&b.requiresInput))return;const te=k.trim();if(te){T(!0),L(null);try{await b.requiresInput.runWithInput(te),o()}catch(fe){L(fe instanceof Error?fe.message:"Action failed")}finally{T(!1)}}}function F(te){if(te.key==="ArrowDown")te.preventDefault(),v(fe=>Math.min(z.length-1,fe+1));else if(te.key==="ArrowUp")te.preventDefault(),v(fe=>Math.max(0,fe-1));else if(te.key==="Enter"&&(te.metaKey||te.ctrlKey)){te.preventDefault();const fe=z[x];fe!=null&&fe.action.bindableKind&&A({action:fe.action,combo:null,conflict:null,saving:!1,error:null})}else if(te.key==="Enter"){te.preventDefault();const fe=z[x];fe&&K(fe.action)}}function B(te){te.key==="Enter"?(te.preventDefault(),_()):te.key==="Escape"&&(te.preventDefault(),C(null),j(""))}function U(te){if(!N||te.key==="Escape"||te.key==="Enter"&&!N.combo)return;te.preventDefault(),te.stopPropagation();const fe=Hb(te.nativeEvent);if(!fe)return;const ve=c(fe,N.action.bindableKind);A({...N,combo:fe,conflict:ve,error:null})}async function Z(){var te;if(!(!N||!N.combo||!N.action.bindableKind)){if((te=N.conflict)!=null&&te.description){A({...N,error:`Reserved: ${N.conflict.description}`});return}A({...N,saving:!0,error:null});try{await l(N.action.bindableKind,N.combo),A(null)}catch(fe){A({...N,saving:!1,error:fe instanceof Error?fe.message:"Failed to save binding"})}}}const P=b!==null,M=S!==null,Q=N!==null,I=S?S.action.flow.steps[S.stepIndex]:null;return i.jsx(Zs,{open:n,onOpenChange:te=>te?null:o(),children:i.jsxs(ts,{className:"max-w-xl p-0 gap-0",onEscapeKeyDown:te=>{if(!O){if(Q){te.preventDefault(),A(null);return}if(M){te.preventDefault(),J();return}P&&(te.preventDefault(),C(null),j(""),L(null))}},children:[i.jsx(ns,{className:"sr-only",children:"Actions palette"}),Q&&N?i.jsxs("div",{onKeyDown:U,tabIndex:-1,autoFocus:!0,children:[i.jsxs("div",{className:"flex items-center gap-2 border-b border-border/70 px-4 py-3",children:[i.jsx(Kf,{className:"h-4 w-4 text-muted-foreground","aria-hidden":"true"}),i.jsxs("span",{className:"text-sm text-foreground",children:["Bind hotkey for ",N.action.title]})]}),i.jsx("div",{className:"px-4 py-6 text-center",children:N.combo?i.jsxs("div",{className:"space-y-3",children:[i.jsx("div",{className:"text-2xl font-semibold tracking-wide text-foreground",children:Pr(N.combo)}),(ge=N.conflict)!=null&&ge.description?i.jsxs("div",{className:"text-sm text-destructive",children:["Reserved: ",N.conflict.description," (cannot bind)"]}):(Se=N.conflict)!=null&&Se.kind?i.jsxs("div",{className:"text-sm text-amber-500 dark:text-amber-400",children:['Already bound to "',N.conflict.kind,'". Press Enter to overwrite.']}):i.jsx("div",{className:"text-sm text-muted-foreground",children:"Press Enter to save, or another key to retry."}),N.error?i.jsx("div",{className:"text-sm text-destructive",children:N.error}):null]}):i.jsx("div",{className:"text-sm text-muted-foreground",children:"Press the key combination you want to bind…"})}),i.jsxs("div",{className:"flex items-center justify-between border-t border-border/70 px-3 py-2 text-[11px] text-muted-foreground",children:[i.jsx("span",{children:"any key records · Enter saves · Esc cancels"}),i.jsx("span",{children:N.saving?"Saving…":""})]}),i.jsx("button",{type:"button",className:"sr-only",onClick:()=>void Z(),"data-bind-confirm":!0}),i.jsx("input",{type:"hidden",onKeyDown:te=>{te.key==="Enter"&&Z()}})]}):M&&I&&S?i.jsxs(i.Fragment,{children:[i.jsx(BP,{label:`${S.action.title} · ${I.label}`,onBack:J,disabled:O,stepCounter:{current:S.stepIndex+1,total:S.action.flow.steps.length}}),I.kind==="text"?i.jsx(UP,{step:I,initialValue:S.values[I.id],disabled:O,onSubmit:q}):i.jsx(HP,{step:I,disabled:O,onSubmit:q}),D?i.jsx("div",{className:"border-t border-border/70 bg-destructive/10 px-4 py-2 text-xs text-destructive",children:D}):null,i.jsxs("div",{className:"flex items-center justify-between border-t border-border/70 px-3 py-2 text-[11px] text-muted-foreground",children:[i.jsx("span",{children:"↵ next · ← back · Esc back"}),i.jsx("span",{children:O?"Running…":""})]})]}):P?i.jsxs(i.Fragment,{children:[i.jsxs("div",{className:"flex items-center gap-2 border-b border-border/70 px-4 py-3",children:[i.jsx("span",{className:"shrink-0 rounded border border-border/70 bg-background/60 px-1.5 py-0.5 text-[10px] font-medium uppercase tracking-wide text-muted-foreground",children:b.group}),i.jsx("span",{className:"min-w-0 flex-1 truncate text-sm text-foreground",children:b.title})]}),i.jsx("input",{autoFocus:!0,type:"text",value:k,onChange:te=>j(te.target.value),onKeyDown:B,placeholder:b.requiresInput.placeholder,disabled:O,className:"w-full border-0 border-b border-border/70 bg-transparent px-4 py-3 text-sm text-foreground outline-none focus:ring-0 disabled:opacity-60"}),D?i.jsx("div",{className:"border-b border-border/70 bg-destructive/10 px-4 py-2 text-xs text-destructive",children:D}):null,i.jsxs("div",{className:"flex items-center justify-between border-t border-border/70 px-3 py-2 text-[11px] text-muted-foreground",children:[i.jsxs("span",{children:["↵"," submit ","·"," Esc back"]}),i.jsx("span",{children:O?"Running…":""})]})]}):i.jsxs(i.Fragment,{children:[i.jsx("input",{autoFocus:!0,type:"text",value:m,onChange:te=>h(te.target.value),onKeyDown:F,placeholder:"Run an action: new project, new todo, toggle…",disabled:O,className:"w-full rounded-t-xl border-0 border-b border-border/70 bg-transparent px-4 py-3 text-sm text-foreground outline-none focus:ring-0 disabled:opacity-60"}),D?i.jsx("div",{className:"border-b border-border/70 bg-destructive/10 px-4 py-2 text-xs text-destructive",children:D}):null,i.jsx("div",{ref:G,className:"max-h-[60vh] overflow-y-auto p-1",children:z.length===0?i.jsx("div",{className:"px-4 py-6 text-center text-sm text-muted-foreground",children:m?"No matches":"Start typing to search actions"}):z.map((te,fe)=>{const ve=fe===x,we=te.action.bindableKind,be=we?a[we]:void 0;return i.jsxs("button",{type:"button","data-palette-idx":fe,onClick:()=>K(te.action),onMouseEnter:()=>v(fe),disabled:O,className:`group flex w-full items-center gap-3 rounded-md px-3 py-2 text-left text-sm transition-colors disabled:opacity-60 ${ve?"bg-accent text-accent-foreground":"hover:bg-accent/50 text-foreground"}`,children:[i.jsx("span",{className:"shrink-0 rounded border border-border/70 bg-background/60 px-1.5 py-0.5 text-[10px] font-medium uppercase tracking-wide text-muted-foreground",children:te.action.group}),i.jsx("span",{className:"min-w-0 flex-1 truncate",children:te.action.title}),te.action.subtitle?i.jsx("span",{className:"shrink-0 truncate text-xs text-muted-foreground",children:te.action.subtitle}):null,be?i.jsx("span",{className:"shrink-0 rounded border border-border/70 bg-background/60 px-1.5 py-0.5 text-[10px] font-medium tracking-wide text-foreground",children:Pr(be)}):null,we?i.jsx("span",{role:"button",tabIndex:-1,"aria-label":"Bind hotkey",onClick:Ye=>{Ye.preventDefault(),Ye.stopPropagation(),A({action:te.action,combo:null,conflict:null,saving:!1,error:null})},className:`shrink-0 inline-flex h-6 w-6 items-center justify-center rounded border border-border/70 bg-background/60 text-muted-foreground transition-opacity hover:text-foreground ${ve?"opacity-100":"opacity-0 group-hover:opacity-100"}`,children:i.jsx(Kf,{className:"h-3.5 w-3.5","aria-hidden":"true"})}):null]},te.action.id)})}),i.jsxs("div",{className:"flex items-center justify-between border-t border-border/70 px-3 py-2 text-[11px] text-muted-foreground",children:[i.jsxs("span",{children:["↑↓"," navigate ","·"," ","↵"," run ","·"," ⌘↵ bind ","·"," Esc close"]}),i.jsx("span",{children:O?"Running…":`${z.length} action${z.length===1?"":"s"}`})]})]})]})})}const VP=[{combo:"mod+k",description:"Open command palette",scope:"global"},{combo:"mod+shift+k",description:"Open actions palette",scope:"global"},{combo:"?",description:"Show keyboard shortcuts",scope:"global"},{combo:"escape",description:"Close dialog or cancel",scope:"global"},{combo:"enter",description:"Activate selected item",scope:"global"},{combo:"shift+t",description:"Toggle light/dark theme",scope:"global"},{combo:"g",description:"Start navigation chord",scope:"global"},{combo:"g o",description:"Go to Overview",scope:"global"},{combo:"g m",description:"Go to Projects",scope:"global"},{combo:"g a",description:"Go to Assignments",scope:"global"},{combo:"g t",description:"Go to Todos",scope:"global"},{combo:"g s",description:"Go to Servers",scope:"global"},{combo:"g !",description:"Go to Attention",scope:"global"},{combo:"g ,",description:"Go to Settings",scope:"global"},{combo:"j",description:"Move selection down",scope:"list"},{combo:"k",description:"Move selection up",scope:"list"},{combo:"o",description:"Open selected item",scope:"list"},{combo:"a",description:"New assignment in project",scope:"project"},{combo:"e",description:"Edit project / assignment",scope:"project|assignment"},{combo:"/",description:"Focus search",scope:"assignments-board"},{combo:"r",description:"Refresh board",scope:"assignments-board"},{combo:"p",description:"Edit plan",scope:"assignment"},{combo:"h",description:"Append handoff",scope:"assignment"},{combo:"d",description:"Append decision record",scope:"assignment"},{combo:"s",description:"Edit scratchpad",scope:"assignment"},{combo:"[",description:"Previous assignment",scope:"assignment"},{combo:"]",description:"Next assignment",scope:"assignment"}];function qP(e){const t=Pn(e);return t?VP.find(n=>n.combo===t)??null:null}const qi={"new-workspace":"New Workspace","new-project":"New Project","new-todo":"New Todo","new-assignment":"New Assignment"},KP={global:"Global","list:projects":"Projects list","list:assignments":"Assignments list","list:todos":"Todos list",assignment:"Assignment detail",project:"Project detail"},GP=["global","list:projects","list:assignments","list:todos","project","assignment"];function ry(e){if(e.includes(" ")){const[t,n]=e.split(" ");return`${Pr(t)} then ${Pr(n)}`}return Pr(e)}function YP(){const{cheatsheetOpen:e,closeCheatsheet:t,listBindings:n,customBindings:o,actionEntries:a}=Ao(),l=g.useMemo(()=>{const p=new Set;for(const m of Object.values(o))typeof m=="string"&&m&&p.add(Pn(m));return p},[o]),c=g.useMemo(()=>{if(!e)return new Map;const p=n(),m=new Map;for(const h of p){if(l.has(Pn(h.keys)))continue;const x=m.get(h.scope)??[];x.push({keys:h.keys,description:h.description}),m.set(h.scope,x)}return m},[e,n,l]),d=g.useMemo(()=>{const p=[];for(const[m,h]of Object.entries(o)){if(!h)continue;const x=a.find(v=>v.bindableKind===m);p.push({kind:m,combo:h,title:x?x.title:m})}return p},[o,a]);return i.jsx(Zs,{open:e,onOpenChange:p=>p?null:t(),children:i.jsxs(ts,{className:"max-w-2xl",children:[i.jsx(ns,{children:"Keyboard shortcuts"}),i.jsxs(Na,{children:["Press Esc to close. ",Pr("Mod+k")," opens the command palette. Press g twice to restart the chord timer."]}),i.jsxs("div",{className:"mt-2 max-h-[60vh] space-y-4 overflow-y-auto pr-1",children:[GP.map(p=>{const m=c.get(p);return!m||m.length===0?null:i.jsxs("section",{children:[i.jsx("h3",{className:"mb-2 text-xs font-semibold uppercase tracking-wide text-muted-foreground",children:KP[p]}),i.jsx("ul",{className:"space-y-1",children:m.map((h,x)=>i.jsxs("li",{className:"flex items-center justify-between gap-3 rounded-md border border-border/40 bg-background/60 px-3 py-1.5 text-sm",children:[i.jsx("span",{className:"text-foreground",children:h.description}),i.jsx("kbd",{className:"shrink-0 rounded border border-border/70 bg-muted px-2 py-0.5 font-mono text-xs text-muted-foreground",children:ry(h.keys)})]},`${p}-${h.keys}-${x}`))})]},p)}),d.length>0?i.jsxs("section",{children:[i.jsx("h3",{className:"mb-2 text-xs font-semibold uppercase tracking-wide text-muted-foreground",children:"Custom bindings"}),i.jsx("ul",{className:"space-y-1",children:d.map(p=>i.jsxs("li",{className:"flex items-center justify-between gap-3 rounded-md border border-border/40 bg-background/60 px-3 py-1.5 text-sm",children:[i.jsx("span",{className:"text-foreground",children:p.title}),i.jsx("kbd",{className:"shrink-0 rounded border border-border/70 bg-muted px-2 py-0.5 font-mono text-xs text-muted-foreground",children:ry(p.combo)})]},`custom-${p.kind}`))})]}):null]})]})})}const oh={bindings:{},custom:!1};let ea=null,As=null;const ep=new Set;function Rw(e){ea=e;for(const t of ep)t(e)}function sh(e){if(!e||typeof e!="object")return oh;const t=e,n={};if(t.bindings&&typeof t.bindings=="object"&&!Array.isArray(t.bindings))for(const[o,a]of Object.entries(t.bindings)){if(!LE(o)||typeof a!="string"||a.trim()==="")continue;const l=Pn(a);l&&(n[o]=l)}return{bindings:n,custom:t.custom===!0}}function XP(){return ea?Promise.resolve(ea):As||(As=fetch("/api/config/hotkeys").then(e=>{if(!e.ok)throw new Error(`HTTP ${e.status}`);return e.json()}).then(e=>{const t=sh(e);return ea=t,As=null,t}).catch(()=>(As=null,oh)),As)}function QP(){const[e,t]=g.useState(()=>ea??oh);return g.useEffect(()=>{let n=!1;return XP().then(o=>{n||t(o)}),ep.add(t),()=>{n=!0,ep.delete(t)}},[]),e}async function oy(e){const t={};for(const a of _c){const l=e[a];if(typeof l!="string")continue;const c=Pn(l);c&&(t[a]=c)}const n=await fetch("/api/config/hotkeys",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({bindings:t})});if(!n.ok){const a=await n.json().catch(()=>({error:`HTTP ${n.status}`}));throw new Error(a.error??"Failed to save hotkey bindings")}const o=sh(await n.json());return Rw(o),o}async function JP(){const e=await fetch("/api/config/hotkeys",{method:"DELETE"});if(!e.ok)throw new Error(`HTTP ${e.status}`);const t=sh(await e.json());return Rw(t),t}const sy=1500;function ZP(e){const t=e.match(/^\/w\/([^/]+)(?:\/|$)/);return t?`/w/${t[1]}`:""}const Aw=g.createContext(null);function eT({children:e}){const{toggleTheme:t}=Bp(),n=xn(),o=Ut(),a=ZP(n.pathname),l=Mc(),c=$b(),d=Ub(),p=Hp(),m=Wp(),h=g.useMemo(()=>{var Be,Ge,jt,St;const ne=l.data??[],Y=((Be=c.data)==null?void 0:Be.assignments)??[],ae=((Ge=d.data)==null?void 0:Ge.playbooks)??[],xe=((jt=p.data)==null?void 0:jt.sessions)??[],Oe=(((St=m.data)==null?void 0:St.workspaces)??[]).flatMap(Dt=>Dt.items.map(Qt=>({...Qt,workspace:Dt.workspace})));return GE({projects:ne,assignments:Y,playbooks:ae,servers:xe,todos:Oe,wsPrefix:a})},[l.data,c.data,d.data,p.data,m.data,a]),v=g.useMemo(()=>Pb(n.pathname),[n.pathname]).projectSlug,b=g.useMemo(()=>{var ne;return v?((ne=l.data)==null?void 0:ne.find(Y=>Y.slug===v))??null:null},[l.data,v]),C=(b==null?void 0:b.title)??null,k=(b==null?void 0:b.workspace)??null,j=g.useMemo(()=>{var ne;return QE({playbooks:((ne=d.data)==null?void 0:ne.playbooks)??[],projectSlug:v,currentProjectTitle:C,currentProjectWorkspace:k,wsPrefix:a,refetchPlaybooks:d.refetch,navigate:o,toggleTheme:t})},[d.data,d.refetch,v,C,k,a,o,t]),S=g.useRef(new Map),R=g.useRef(["global"]),N=g.useRef({phase:"idle"}),A=g.useRef(null),O=g.useRef(1),[T,D]=g.useState(!1),[L,G]=g.useState(!1),[re,z]=g.useState(!1),[K,q]=g.useState(null),{bindings:J}=QP(),_=g.useMemo(()=>zE(J),[J]),F=g.useCallback(ne=>{const Y=O.current++;return S.current.set(Y,{...ne,id:Y}),Y},[]),B=g.useCallback(ne=>{S.current.delete(ne)},[]),U=g.useCallback(ne=>{R.current.push(ne)},[]),Z=g.useCallback(ne=>{const Y=R.current;for(let ae=Y.length-1;ae>=0;ae--)if(Y[ae]===ne){Y.splice(ae,1);return}},[]),P=g.useCallback(()=>D(!0),[]),M=g.useCallback(()=>D(!1),[]),Q=g.useCallback(()=>G(!0),[]),I=g.useCallback(()=>G(!1),[]),ge=g.useCallback(()=>z(!0),[]),Se=g.useCallback(()=>{z(!1),q(null)},[]),te=g.useCallback(()=>Array.from(S.current.values()),[]),fe=g.useCallback(()=>{let ne=null;return q(Y=>(ne=Y,null)),ne},[]),ve=g.useCallback(ne=>{q(ne),z(!0)},[]),we=g.useCallback((ne,Y)=>{const ae=Pn(ne);if(!ae)return null;if($E(ae)){const xe=qP(ae);return{description:(xe==null?void 0:xe.description)??"Reserved built-in shortcut"}}for(const[xe,qe]of Object.entries(_))if(!(Y&&xe===Y)&&qe===ae)return{kind:xe};return null},[_]),be=g.useCallback(async(ne,Y)=>{const ae=Pn(Y);if(!ae)throw new Error("Empty combo");const xe=we(ae,ne);if(xe){const Oe=xe.description?`Reserved: ${xe.description}`:`Already bound to "${xe.kind}"`;throw new Error(Oe)}const qe={...J,[ne]:ae};return await oy(qe),ae},[J,we]),Ye=g.useCallback(async ne=>{if(!J[ne])return;const Y={...J};delete Y[ne],await oy(Y)},[J]);g.useEffect(()=>{N.current={phase:"idle"},A.current!==null&&(window.clearTimeout(A.current),A.current=null)},[n.pathname]),g.useEffect(()=>{function ne(Oe){if(!(Oe instanceof HTMLElement))return!1;const Be=Oe.tagName;return!!(Be==="INPUT"||Be==="TEXTAREA"||Be==="SELECT"||Oe.isContentEditable||Oe.closest('[role="combobox"], [role="textbox"]'))}function Y(){return!!(document.querySelector('[role="dialog"][data-state="open"]')||document.querySelector('[role="alertdialog"][data-state="open"]'))}function ae(){const Oe=R.current;return Oe[Oe.length-1]??"global"}function xe(Oe){return Oe.scope==="global"?!0:Oe.scope===ae()}function qe(Oe){const Be=Hl(Oe,"Mod+k"),Ge=Hl(Oe,"Mod+Shift+k"),jt=Oe.key==="Escape",St=Be||Ge||jt;if(Y()&&!St||ne(Oe.target)&&!St)return;const Dt=N.current;if(Dt.phase==="awaiting-second")if(Date.now()-Dt.startedAt>sy)N.current={phase:"idle"},A.current!==null&&(window.clearTimeout(A.current),A.current=null);else{const ie=Array.from(S.current.values());for(const ce of ie){if(!xe(ce))continue;const ye=ce.keys.split(" ");if(!(ye.length!==2||ye[0]!=="g")&&Hl(Oe,ye[1])&&!(ce.when&&!ce.when())){Oe.preventDefault(),N.current={phase:"idle"},A.current!==null&&(window.clearTimeout(A.current),A.current=null),ce.handler(Oe);return}}N.current={phase:"idle"},A.current!==null&&(window.clearTimeout(A.current),A.current=null)}const Qt=Array.from(S.current.values());for(const Et of Qt){if(!xe(Et))continue;const ie=Et.keys.split(" ");if(ie.length===1&&Hl(Oe,ie[0])&&!(Et.when&&!Et.when())){Oe.preventDefault(),Et.handler(Oe);return}}Oe.key==="g"&&!Oe.metaKey&&!Oe.ctrlKey&&!Oe.altKey&&!Oe.shiftKey&&Array.from(S.current.values()).some(ie=>xe(ie)&&ie.keys.startsWith("g "))&&(Oe.preventDefault(),N.current={phase:"awaiting-second",startedAt:Date.now()},A.current!==null&&window.clearTimeout(A.current),A.current=window.setTimeout(()=>{N.current={phase:"idle"},A.current=null},sy))}return window.addEventListener("keydown",qe),()=>{window.removeEventListener("keydown",qe),A.current!==null&&(window.clearTimeout(A.current),A.current=null)}},[]),g.useEffect(()=>{const ne=F({keys:"Shift+t",handler:()=>t(),scope:"global",description:"Toggle light/dark theme"});return()=>B(ne)},[F,B,t]),g.useEffect(()=>{const ne=F({keys:"?",scope:"global",description:"Show keyboard shortcuts",handler:()=>Q()});return()=>B(ne)},[F,B,Q]),g.useEffect(()=>{const ne=F({keys:"Mod+k",scope:"global",description:"Open command palette",handler:()=>{if(T){M();return}document.querySelector('[role="dialog"][data-state="open"], [role="alertdialog"][data-state="open"]')||P()}});return()=>B(ne)},[F,B,P,M,T]),g.useEffect(()=>{const ne=F({keys:"Mod+Shift+k",scope:"global",description:"Open actions palette",handler:()=>{if(re){Se();return}document.querySelector('[role="dialog"][data-state="open"], [role="alertdialog"][data-state="open"]')||ge()}});return()=>B(ne)},[F,B,ge,Se,re]),g.useEffect(()=>{const Y=[{suffix:"o",basePath:"/",desc:"Go to Overview"},{suffix:"m",basePath:"/projects",desc:"Go to Projects"},{suffix:"a",basePath:"/assignments",desc:"Go to Assignments"},{suffix:"t",basePath:"/todos",desc:"Go to Todos"},{suffix:"s",basePath:"/servers",desc:"Go to Servers"},{suffix:"!",basePath:"/attention",desc:"Go to Attention"},{suffix:",",basePath:"/settings",desc:"Go to Settings"}].map(ae=>F({keys:`g ${ae.suffix}`,scope:"global",description:ae.desc,handler:()=>o(ic(ae.basePath,a))}));return()=>Y.forEach(B)},[F,B,o,a]),g.useEffect(()=>{const ne=[];for(const[Y,ae]of Object.entries(_)){if(!ae)continue;const xe=j.find(Oe=>Oe.bindableKind===Y),qe=xe?`Custom: ${xe.title}`:`Custom: ${Y}`;ne.push(F({keys:ae,scope:"global",description:qe,handler:()=>{q(Y),z(!0)}}))}return()=>ne.forEach(B)},[F,B,_,j]);const Xe=g.useMemo(()=>({register:F,unregister:B,pushScope:U,popScope:Z,openPalette:P,closePalette:M,paletteOpen:T,openCheatsheet:Q,closeCheatsheet:I,cheatsheetOpen:L,openActionsPalette:ge,closeActionsPalette:Se,actionsPaletteOpen:re,listBindings:te,wsPrefix:a,paletteEntries:h,actionEntries:j,userBindings:J,customBindings:_,bindAction:be,unbindAction:Ye,findConflict:we,openActionsPaletteWithAction:ve,pendingActionKind:K,consumePendingActionKind:fe}),[F,B,U,Z,P,M,T,Q,I,L,ge,Se,re,te,a,h,j,J,_,be,Ye,we,ve,K,fe]);return i.jsxs(Aw.Provider,{value:Xe,children:[e,i.jsx(zP,{entries:h}),i.jsx(WP,{entries:j}),i.jsx(YP,{})]})}function Ao(){const e=g.useContext(Aw);if(!e)throw new Error("useHotkeyContext must be used within HotkeyProvider");return e}function ht({keys:e,handler:t,scope:n="global",description:o,when:a,enabled:l=!0}){const{register:c,unregister:d}=Ao(),p=g.useRef(t),m=g.useRef(a);g.useEffect(()=>{p.current=t,m.current=a},[t,a]),g.useEffect(()=>{if(!l)return;const h=c({keys:e,handler:x=>p.current(x),scope:n,description:o,when:m.current?()=>m.current():void 0});return()=>d(h)},[c,d,e,n,o,l])}function rs(e){const{pushScope:t,popScope:n}=Ao();g.useEffect(()=>(t(e),()=>n(e)),[t,n,e])}function Ca(e,t){const[n,o]=g.useState(e.length===0?-1:0),a=xn();g.useEffect(()=>{o(e.length===0?-1:0)},[a.pathname]),g.useEffect(()=>{o(c=>e.length===0?-1:Math.min(Math.max(0,c),e.length-1))},[e.length]),g.useEffect(()=>{if(document.querySelectorAll("[data-hotkey-row-index]").forEach(d=>{const p=Number(d.getAttribute("data-hotkey-row-index"));d.setAttribute("data-hotkey-selected",p===n?"true":"false")}),n>=0){const d=document.querySelector(`[data-hotkey-row-index="${n}"]`);d==null||d.scrollIntoView({block:"nearest"})}},[n,e.length]),ht({keys:"j",scope:t.scope,description:"Select next row",handler:()=>o(c=>e.length===0?-1:Math.min(e.length-1,c<0?0:c+1))}),ht({keys:"k",scope:t.scope,description:"Select previous row",handler:()=>o(c=>e.length===0?-1:Math.max(0,c<0?0:c-1))}),ht({keys:"Enter",scope:t.scope,description:"Open selected row",handler:()=>{n>=0&&n<e.length&&t.onOpen(e[n],n)}}),ht({keys:"o",scope:t.scope,description:"Open selected row",enabled:t.bindO??!0,handler:()=>{n>=0&&n<e.length&&t.onOpen(e[n],n)}});const l=g.useCallback(c=>({"data-hotkey-row-index":c,"data-hotkey-selected":c===n?"true":"false"}),[n]);return{selectedIndex:n,hotkeyRowProps:l}}function tT({title:e,breadcrumbs:t,projectSlug:n,onOpenMobileNav:o}){const a=Lt(),{resolvedTheme:l,toggleTheme:c}=Bp(),{openPalette:d}=Ao();return i.jsx("header",{className:"sticky top-0 z-30 border-b border-border/70 bg-background/85 backdrop-blur",children:i.jsxs("div",{className:"flex flex-wrap items-center gap-2 px-4 py-2.5 lg:px-6",children:[i.jsx("button",{type:"button",onClick:o,className:"inline-flex h-8 w-8 items-center justify-center rounded-md border border-border/70 bg-card/80 text-foreground lg:hidden","aria-label":"Open navigation",children:i.jsx(NC,{className:"h-4 w-4"})}),i.jsx("div",{className:"min-w-0 flex-1",children:i.jsxs("div",{className:"flex items-center gap-2",children:[t.length>1?i.jsxs("nav",{className:"flex items-center gap-1.5 text-xs font-medium uppercase tracking-[0.1em] text-muted-foreground",children:[t.slice(0,-1).map((p,m)=>i.jsxs("span",{className:"flex items-center gap-1.5",children:[m>0?i.jsx("span",{children:"/"}):null,i.jsx(De,{to:p.path,className:"hover:text-foreground",children:p.label})]},p.path)),i.jsx("span",{children:"/"})]}):null,i.jsx("h1",{className:"truncate text-base font-semibold text-foreground",children:e})]})}),i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsxs("button",{type:"button",onClick:d,className:"shell-action","aria-label":"Open command palette",children:[i.jsx(Xs,{className:"h-4 w-4"}),i.jsx("span",{className:"hidden sm:inline font-mono text-xs",children:Pr("Mod+k")})]}),i.jsx(De,{className:"shell-action",to:"/help",children:"Help"}),i.jsxs(De,{className:"shell-action",to:`${a}/create/project`,children:[i.jsx(Un,{className:"h-4 w-4"}),i.jsx("span",{children:"New Project"})]}),n?i.jsxs(De,{className:"shell-action",to:`${a}/projects/${n}/create/assignment`,children:[i.jsx(Un,{className:"h-4 w-4"}),i.jsx("span",{children:"New Assignment"})]}):null,i.jsxs("button",{type:"button",onClick:c,className:"shell-action","aria-label":"Toggle theme",children:[l==="dark"?i.jsx(LC,{className:"h-4 w-4"}):i.jsx(CC,{className:"h-4 w-4"}),i.jsx("span",{children:l==="dark"?"Light":"Dark"})]})]})]})})}const nT=[{to:"/",label:"Overview",icon:pC},{to:"/attention",label:"Attention",icon:Qs},{to:"/playbooks",label:"Playbooks",icon:ub},{to:"/todos",label:"Todos",icon:zn}],rT=[{suffix:"/projects",label:"Projects",icon:Op},{suffix:"/assignments",label:"Assignments",icon:SC},{suffix:"/servers",label:"Servers",icon:Mp},{suffix:"/agent-sessions",label:"Agent Sessions",icon:Ic},{suffix:"/todos",label:"Todos",icon:zn}],oT=[{to:"/help",label:"Help",icon:kC},{to:"/settings",label:"Settings",icon:IC}],iy="syntaur.dashboard.sourceFirstNoticeDismissed";function sT({title:e,breadcrumbs:t,projectSlug:n,workspace:o,children:a}){const[l,c]=g.useState(!1);ht({keys:"Escape",scope:"global",description:"Close mobile navigation",enabled:l,handler:()=>c(!1)});const[d,p]=g.useState(()=>{if(typeof window>"u")return!1;try{return window.localStorage.getItem(iy)==="1"}catch{return!1}});function m(){if(p(!0),!(typeof window>"u"))try{window.localStorage.setItem(iy,"1")}catch{}}return i.jsx("div",{className:"min-h-screen bg-background",children:i.jsxs("div",{className:"relative grid min-h-screen lg:grid-cols-[240px_minmax(0,1fr)]",children:[i.jsx("aside",{className:"hidden max-h-screen sticky top-0 overflow-y-auto border-r border-border/70 bg-sidebar/90 px-4 py-4 backdrop-blur lg:flex lg:flex-col",children:i.jsx(ay,{sourceNoticeDismissed:d,onDismissSourceNotice:m,activeWorkspace:o})}),l?i.jsx("div",{className:"fixed inset-0 z-40 bg-overlay/40 lg:hidden",children:i.jsxs("div",{className:"h-full max-w-xs border-r border-border/70 bg-sidebar p-4 shadow-2xl",children:[i.jsxs("div",{className:"mb-4 flex items-center justify-between",children:[i.jsx(De,{to:"/",className:"text-lg font-semibold text-foreground",onClick:()=>c(!1),children:"Syntaur"}),i.jsx("button",{type:"button",onClick:()=>c(!1),className:"inline-flex h-9 w-9 items-center justify-center rounded-md border border-border/70 bg-background/80",children:i.jsx($p,{className:"h-4 w-4"})})]}),i.jsx(ay,{sourceNoticeDismissed:d,onDismissSourceNotice:m,activeWorkspace:o,onNavigate:()=>c(!1)})]})}):null,i.jsxs("div",{className:"min-w-0",children:[i.jsx(tT,{title:e,breadcrumbs:t,projectSlug:n,onOpenMobileNav:()=>c(!0)}),i.jsx("main",{className:"mx-auto w-full max-w-[1480px] px-4 py-4 lg:px-6 lg:py-5",children:a})]})]})})}function ay({sourceNoticeDismissed:e,onDismissSourceNotice:t,activeWorkspace:n,onNavigate:o}){const{data:a}=Up(),l=(a==null?void 0:a.workspaces)??[],c=(a==null?void 0:a.hasUngrouped)??!1,d=xn(),[p,m]=g.useState(new Set),[h,x]=g.useState(!1),[v,b]=g.useState(""),C=Ut();function k(S){m(R=>{const N=new Set(R);return N.has(S)?N.delete(S):N.add(S),N})}const j=[...l,...c?["_ungrouped"]:[]];return i.jsxs("div",{className:"flex h-full flex-col gap-3",children:[i.jsx("div",{className:"space-y-3",children:i.jsxs(De,{to:"/",className:"inline-flex items-center gap-3",onClick:o,children:[i.jsx("span",{className:"inline-flex h-8 w-8 items-center justify-center rounded-lg bg-card text-background shadow-sm ring-1 ring-border/60",children:i.jsx("img",{src:"/syntaur-logo.svg",alt:"Syntaur",width:20,height:20,className:"h-5 w-5"})}),i.jsxs("div",{children:[i.jsx("p",{className:"text-sm font-semibold text-foreground",children:"Syntaur"}),i.jsx("p",{className:"text-xs text-muted-foreground/60",children:"Local-first project control"})]})]})}),i.jsx(zx,{items:nT,onNavigate:o}),i.jsx("div",{className:"border-t border-border/40"}),i.jsxs("div",{className:"flex-1 space-y-1 overflow-y-auto",children:[j.length===0&&!h&&i.jsx("p",{className:"px-3 py-2 text-xs text-muted-foreground/60",children:"No workspaces yet"}),j.map(S=>{const R=S==="_ungrouped",N=R?"Ungrouped":fn(S),A=R?"/w/_ungrouped":`/w/${S}`,O=p.has(S),T=n===S||n===null&&R&&d.pathname.startsWith("/w/_ungrouped");return i.jsxs("div",{children:[i.jsxs("button",{type:"button",onClick:()=>k(S),className:`flex w-full items-center gap-2 rounded-md px-3 py-1.5 text-xs font-semibold uppercase tracking-wider transition ${T?"text-foreground":"text-muted-foreground/70 hover:text-muted-foreground"}`,children:[i.jsx(ma,{className:`h-3 w-3 transition-transform ${O?"-rotate-90":""}`}),N]}),!O&&i.jsx("nav",{className:"ml-2 space-y-0.5",children:rT.map(D=>{const L=`${A}${D.suffix}`,G=Eb(d.pathname,D.suffix)&&d.pathname.startsWith(A),re=D.icon;return i.jsxs(De,{to:L,onClick:o,className:`flex items-center gap-3 rounded-md px-3 py-1.5 text-sm font-medium transition ${G?"bg-foreground text-background shadow-sm":"text-muted-foreground hover:bg-background/80 hover:text-foreground"}`,children:[i.jsx(re,{className:"h-4 w-4"}),i.jsx("span",{children:D.label})]},L)})})]},S)}),h?i.jsx("form",{className:"px-3 py-1.5",onSubmit:S=>{S.preventDefault();const R=v.trim().toLowerCase().replace(/[^a-z0-9-]/g,"-").replace(/-+/g,"-").replace(/^-|-$/g,"");R&&(x(!1),b(""),fetch("/api/workspaces",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:R})}).then(()=>{o==null||o(),C(`/w/${R}/projects`)}))},children:i.jsx("input",{autoFocus:!0,type:"text",value:v,onChange:S=>b(S.target.value),onKeyDown:S=>{S.key==="Escape"&&(x(!1),b(""))},onBlur:()=>{v.trim()||(x(!1),b(""))},placeholder:"workspace-name",className:"w-full rounded-md border border-border/60 bg-background/80 px-2 py-1 text-xs text-foreground placeholder:text-muted-foreground/50 focus:border-foreground/40 focus:outline-none"})}):i.jsxs("button",{type:"button",onClick:()=>x(!0),className:"flex w-full items-center gap-2 rounded-md px-3 py-1.5 text-xs font-medium text-muted-foreground/60 transition hover:text-muted-foreground",children:[i.jsx(Un,{className:"h-3 w-3"}),"New Workspace"]})]}),i.jsx("div",{className:"border-t border-border/40"}),i.jsx(zx,{items:oT,onNavigate:o}),e?null:i.jsx("div",{className:"rounded-lg border border-border/60 bg-background/80 p-3",children:i.jsxs("div",{className:"flex items-start justify-between gap-3",children:[i.jsxs("div",{children:[i.jsx("p",{className:"text-sm font-semibold text-foreground",children:"Source-first dashboard"}),i.jsx("p",{className:"mt-2 text-sm leading-6 text-muted-foreground",children:"Project and assignment markdown files stay authoritative. Derived files are read-only projections."})]}),i.jsx("button",{type:"button",onClick:t,className:"inline-flex h-7 w-7 items-center justify-center rounded-md border border-border/70 bg-background/80 text-muted-foreground transition hover:text-foreground","aria-label":"Dismiss source-first dashboard notice",children:i.jsx($p,{className:"h-4 w-4"})})]})})]})}function iT(){const e=xn(),{workspace:t}=At(),{title:n,breadcrumbs:o,projectSlug:a}=Pb(e.pathname);return i.jsx(sT,{title:n,breadcrumbs:o,projectSlug:a,workspace:t??null,children:i.jsx(yN,{})})}const tp="border-status-pending-foreground/30 bg-status-pending text-status-pending-foreground",ly="border-status-in-progress-foreground/30 bg-status-in-progress text-status-in-progress-foreground",aT="border-status-blocked-foreground/30 bg-status-blocked text-status-blocked-foreground",lT="border-status-review-foreground/30 bg-status-review text-status-review-foreground",cT="border-status-completed-foreground/30 bg-status-completed text-status-completed-foreground",uT="border-status-failed-foreground/30 bg-status-failed text-status-failed-foreground",dT="border-status-archived-foreground/30 bg-status-archived text-status-archived-foreground",xc={pending:{label:"Pending",description:"Waiting to start or waiting on dependencies.",className:tp,icon:dC},in_progress:{label:"In Progress",description:"Actively being worked on.",className:ly,icon:gb},blocked:{label:"Blocked",description:"Blocked by an explicit obstacle that needs intervention.",className:aT,icon:Vf},review:{label:"Review",description:"Ready for inspection or approval.",className:lT,icon:RC},completed:{label:"Completed",description:"Finished successfully.",className:cT,icon:Ip},failed:{label:"Failed",description:"Could not be completed as planned.",className:uT,icon:Vf},active:{label:"Active",description:"The project has active or review work in flight.",className:ly,icon:qf},stopped:{label:"Stopped",description:"Session ended without completing.",className:tp,icon:lC},archived:{label:"Archived",description:"Archived by a human override.",className:dT,icon:qf}};function Xt({status:e,className:t,showIcon:n=!0,progress:o}){const a=xc[e]??{label:e.replace(/_/g," ").replace(/\b\w/g,h=>h.toUpperCase()),description:`Status: ${e}`,className:tp,icon:qf},l=a.icon,c=o&&o.total>0,d=c?Math.min(1,Math.max(0,o.checked/o.total)):0,p=c?`${a.description} (${o.checked}/${o.total} criteria)`:a.description,m=n?c?i.jsxs("span",{className:"relative inline-flex h-3.5 w-3.5 items-center justify-center",children:[i.jsxs("svg",{"aria-hidden":"true",viewBox:"0 0 16 16",className:"absolute inset-0 h-full w-full -rotate-90",children:[i.jsx("circle",{cx:"8",cy:"8",r:"7",fill:"none",stroke:"currentColor",strokeOpacity:"0.25",strokeWidth:"1.5"}),i.jsx("circle",{cx:"8",cy:"8",r:"7",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeDasharray:2*Math.PI*7,strokeDashoffset:2*Math.PI*7*(1-d)})]}),i.jsx(l,{className:"h-2.5 w-2.5"})]}):i.jsx(l,{className:"h-3.5 w-3.5"}):null;return i.jsxs("span",{title:p,className:Ue("inline-flex items-center gap-1.5 whitespace-nowrap rounded-full border px-2 py-0.5 text-xs font-semibold tracking-wide",a.className,t),children:[m,i.jsx("span",{children:a.label})]})}function Dw(e){var t;return((t=xc[e])==null?void 0:t.description)??`Status: ${e}`}const fT={default:"border-border/70 bg-card/90",info:"border-primary/30 bg-primary/5 dark:border-primary/40 dark:bg-primary/10",warn:"border-warning-foreground/30 bg-warning",danger:"border-error-foreground/30 bg-error",success:"border-success-foreground/30 bg-success"};function nt({label:e,value:t,description:n,icon:o,tone:a="default",to:l}){const c=i.jsxs(i.Fragment,{children:[i.jsxs("div",{className:"flex items-start justify-between gap-4",children:[i.jsxs("div",{className:"space-y-1",children:[i.jsx("p",{className:"text-xs font-semibold uppercase tracking-[0.1em] text-muted-foreground",children:e}),i.jsx("p",{className:"text-2xl font-semibold text-foreground",children:t})]}),o?i.jsx("span",{className:"rounded-md border border-border/60 bg-background/80 p-1.5 text-muted-foreground",children:i.jsx(o,{className:"h-5 w-5"})}):null]}),n?i.jsx("p",{className:"mt-2 text-sm leading-5 text-muted-foreground",children:n}):null]}),d=Ue("rounded-lg border p-3 shadow-sm",fT[a],l?"block transition hover:-translate-y-0.5 hover:shadow-md focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/40":"");return l?i.jsx(De,{to:l,className:d,children:c}):i.jsx("article",{className:d,children:c})}function Ie({title:e,description:t,children:n,className:o,actions:a}){return i.jsxs("section",{className:Ue("surface-panel space-y-3",o),children:[e||a?i.jsxs("div",{className:"flex flex-wrap items-start justify-between gap-3",children:[i.jsxs("div",{className:"space-y-1",children:[e?i.jsx("h2",{className:"text-lg font-semibold text-foreground",children:e}):null,t?i.jsx("p",{className:"text-sm text-muted-foreground",children:t}):null]}),a]}):null,n]})}function kt({label:e="Loading dashboard data…"}){return i.jsx("div",{className:"flex min-h-[240px] items-center justify-center",children:i.jsx("div",{className:"rounded-lg border border-border/70 bg-card/90 px-4 py-3 shadow-sm",children:i.jsx("p",{className:"text-sm text-muted-foreground",children:e})})})}function gt({title:e="Something went wrong",error:t,action:n}){return i.jsx("div",{className:"rounded-lg border border-error-foreground/30 bg-error px-4 py-5",children:i.jsxs("div",{className:"space-y-2",children:[i.jsx("h3",{className:"text-lg font-semibold text-error-foreground",children:e}),i.jsx("p",{className:"text-sm leading-6 text-error-foreground/90",children:t}),n?i.jsx("div",{className:"pt-2",children:n}):null]})})}function rt({title:e,description:t,actions:n}){return i.jsx("div",{className:"rounded-lg border border-dashed border-border/80 bg-muted/30 px-4 py-6 text-center",children:i.jsxs("div",{className:"mx-auto max-w-xl space-y-2",children:[i.jsx("h3",{className:"text-base font-semibold text-foreground",children:e}),i.jsx("p",{className:"text-sm leading-6 text-muted-foreground",children:t}),n?i.jsx("div",{className:"flex flex-wrap justify-center gap-3 pt-2",children:n}):null]})})}function cc({command:e,description:t,example:n}){return i.jsxs("div",{className:"rounded-lg border border-border/70 bg-code px-3 py-3 text-code-foreground shadow-sm",children:[i.jsx("code",{className:"block overflow-x-auto font-mono text-sm",children:e}),t?i.jsx("p",{className:"mt-2 text-sm text-code-foreground/80",children:t}):null,n?i.jsx("p",{className:"mt-2 font-mono text-xs text-code-foreground/60",children:n}):null]})}function pT({help:e,compact:t=!1}){const n=t?(e==null?void 0:e.firstProjectChecklist.slice(0,3))??[]:(e==null?void 0:e.firstProjectChecklist)??[];return i.jsx(Ie,{title:t?"Getting Started Refresher":"Getting Started",description:t?"A fast reminder of the real flow for creating and running work in Syntaur.":"A first-run checklist that maps to the current CLI and dashboard flow.",actions:i.jsx(De,{className:"text-sm font-semibold text-primary hover:underline",to:"/help",children:"Open full help"}),children:i.jsx("div",{className:"space-y-3",children:n.map((o,a)=>i.jsx("div",{className:"rounded-md border border-border/60 bg-background/80 p-3",children:i.jsxs("div",{className:"flex items-start gap-3",children:[i.jsx("span",{className:"inline-flex h-5 w-5 items-center justify-center rounded-full bg-foreground text-xs font-semibold text-background",children:a+1}),i.jsxs("div",{className:"space-y-1.5",children:[i.jsx("h3",{className:"font-semibold text-foreground",children:o.title}),i.jsx("p",{className:"text-sm leading-6 text-muted-foreground",children:o.detail}),o.command?i.jsx(cc,{command:o.command.command,example:o.command.example}):null]})]})},o.title))})})}function hT(){var c;const{data:e,loading:t,error:n}=PE(),{data:o}=Fb(),{data:a}=Wp(),l=a!=null&&a.workspaces?a.workspaces.reduce((d,p)=>d+p.counts.open+p.counts.in_progress,0):0;return t?i.jsx(kt,{label:"Loading overview…"}):n||!e?i.jsx(gt,{error:n||"Overview data is unavailable."}):i.jsxs("div",{className:"space-y-5",children:[i.jsxs("div",{className:"grid gap-3 grid-cols-[repeat(auto-fill,minmax(160px,1fr))]",children:[i.jsx(nt,{label:"Active Projects",value:e.stats.activeProjects,icon:Op,to:"/projects"}),i.jsx(nt,{label:"In Progress",value:e.stats.inProgressAssignments,icon:vC,tone:"info",to:"/assignments?status=in_progress"}),i.jsx(nt,{label:"Blocked",value:e.stats.blockedAssignments,icon:Qs,tone:"warn",to:"/assignments?status=blocked"}),i.jsx(nt,{label:"Review",value:e.stats.reviewAssignments,icon:uC,tone:"info",to:"/assignments?status=review"}),i.jsx(nt,{label:"Failed",value:e.stats.failedAssignments,icon:EC,tone:"danger",to:"/assignments?status=failed"}),i.jsx(nt,{label:"Stale",value:e.stats.staleAssignments,icon:Ic,to:"/assignments?stale=1"}),i.jsx(nt,{label:"Open Todos",value:l,icon:zn,to:"/todos"}),i.jsx(nt,{label:"Active Servers",value:e.serverStats?e.serverStats.aliveSessions:"…",description:e.serverStats?`${e.serverStats.totalPorts} ports · ${e.serverStats.deadSessions>0?`${e.serverStats.deadSessions} dead`:"all healthy"}`:"connecting",icon:Mp,tone:(c=e.serverStats)!=null&&c.deadSessions?"warn":"default",to:"/servers"})]}),i.jsxs("div",{className:"grid gap-4 xl:grid-cols-[minmax(0,1.1fr)_minmax(360px,0.9fr)]",children:[i.jsxs("div",{className:"space-y-4",children:[i.jsx(Ie,{title:"Needs Attention Now",description:"Blocked, failed, review, and stale work from the source files.",children:e.attention.length===0?i.jsx(rt,{title:"Nothing urgent right now",description:"The attention queue is empty. Overview will surface blocked, failed, review, and stale assignments here."}):i.jsx("div",{className:"space-y-3",children:e.attention.map(d=>i.jsxs(De,{to:d.href,className:"block rounded-md border border-border/60 bg-background/80 p-3 transition hover:border-primary/40 hover:bg-background",children:[i.jsxs("div",{className:"flex flex-wrap items-start justify-between gap-3",children:[i.jsxs("div",{className:"space-y-1",children:[i.jsx("p",{className:"text-sm font-semibold text-foreground",children:d.assignmentTitle}),i.jsx("p",{className:"text-sm text-muted-foreground",children:d.projectTitle})]}),i.jsx(Xt,{status:d.status})]}),i.jsx("p",{className:"mt-3 text-sm leading-6 text-muted-foreground",children:d.reason}),i.jsxs("p",{className:"mt-2 text-xs font-medium uppercase tracking-[0.1em] text-muted-foreground",children:["Updated ",Er(d.updated)]})]},d.id))})}),i.jsxs("div",{className:"grid gap-4 lg:grid-cols-2",children:[i.jsx(Ie,{title:"Recently Updated Projects",children:e.recentProjects.length===0?i.jsx(rt,{title:"No projects yet",description:"Create your first project to populate the project directory, recent activity, and attention queue.",actions:i.jsx(De,{className:"shell-action bg-foreground text-background hover:opacity-90",to:"/create/project",children:"Create Project"})}):i.jsx("div",{className:"space-y-3",children:e.recentProjects.map(d=>i.jsx(De,{to:`/projects/${d.slug}`,className:"block rounded-md border border-border/60 bg-background/80 p-3 transition hover:border-primary/40",children:i.jsxs("div",{className:"flex items-start justify-between gap-3",children:[i.jsxs("div",{children:[i.jsx("h3",{className:"font-semibold text-foreground",children:d.title}),i.jsx("p",{className:"mt-1 text-sm text-muted-foreground",children:Er(d.updated)})]}),i.jsx(Xt,{status:d.status})]})},d.slug))})}),i.jsx(Ie,{title:"Recent Activity",children:e.recentActivity.length===0?i.jsx(rt,{title:"No activity yet",description:"Once projects and assignments exist, Overview will show activity based on parsed source timestamps instead of file mtimes."}):i.jsx("div",{className:"space-y-3",children:e.recentActivity.map(d=>i.jsxs(De,{to:d.href,className:"block rounded-md border border-border/60 bg-background/80 p-3 transition hover:border-primary/40",children:[i.jsxs("div",{className:"flex items-start justify-between gap-3",children:[i.jsxs("div",{className:"space-y-1",children:[i.jsx("p",{className:"font-semibold text-foreground",children:d.title}),i.jsx("p",{className:"text-sm text-muted-foreground",children:d.summary})]}),i.jsx("span",{className:"text-xs font-medium uppercase tracking-[0.1em] text-muted-foreground",children:fn(d.type)})]}),i.jsx("p",{className:"mt-3 text-xs text-muted-foreground",children:Er(d.updated)})]},d.id))})})]})]}),e.firstRun&&i.jsx(pT,{help:o})]})]})}function mT(){const{data:e,loading:t,error:n}=TE();return t?i.jsx(kt,{label:"Loading attention queue…"}):n||!e?i.jsx(gt,{error:n||"Attention queue is unavailable."}):i.jsxs("div",{className:"space-y-5",children:[i.jsxs("div",{className:"grid gap-3 md:grid-cols-2 xl:grid-cols-4",children:[i.jsx(nt,{label:"Critical",value:e.summary.critical,icon:yC,tone:"danger"}),i.jsx(nt,{label:"High",value:e.summary.high,icon:Qs,tone:"warn"}),i.jsx(nt,{label:"Medium",value:e.summary.medium,icon:OC,tone:"info"}),i.jsx(nt,{label:"Low",value:e.summary.low,icon:wC})]}),i.jsx(Ie,{title:"Attention Queue",description:"Ordered by severity, then by the latest parsed source update.",children:e.items.length===0?i.jsx(rt,{title:"Attention queue is clear",description:"No blocked, failed, review, or stale assignments are currently surfacing from the source files."}):i.jsx("div",{className:"space-y-3",children:e.items.map(o=>i.jsxs(De,{to:o.href,className:"block rounded-md border border-border/60 bg-background/80 p-3 transition hover:border-primary/40",children:[i.jsxs("div",{className:"flex flex-wrap items-start justify-between gap-3",children:[i.jsxs("div",{className:"space-y-1",children:[i.jsx("h3",{className:"font-semibold text-foreground",children:o.assignmentTitle}),i.jsx("p",{className:"text-sm text-muted-foreground",children:o.projectTitle})]}),i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx("span",{className:"rounded-full border border-border/60 bg-card/90 px-2.5 py-1 text-xs font-semibold uppercase tracking-[0.1em] text-muted-foreground",children:o.severity}),i.jsx(Xt,{status:o.status})]})]}),i.jsx("p",{className:"mt-3 text-sm leading-6 text-muted-foreground",children:o.reason}),i.jsxs("p",{className:"mt-2 text-xs text-muted-foreground",children:["Updated ",Er(o.updated)]})]},o.id))})})]})}function gT({term:e,description:t}){return i.jsx("span",{title:t,className:"cursor-help rounded-full border border-border/70 bg-background/80 px-2.5 py-1 text-xs font-medium text-foreground underline decoration-dotted underline-offset-4",children:e})}function xT(){const{data:e,loading:t,error:n}=Fb(),{openCheatsheet:o}=Ao();return t?i.jsx(kt,{label:"Loading help…"}):n||!e?i.jsx(gt,{error:n||"Help content is unavailable."}):i.jsxs("div",{className:"space-y-5",children:[i.jsx(Ie,{title:"Keyboard Shortcuts",description:"Navigate the dashboard without reaching for the mouse.",children:i.jsxs("div",{className:"flex flex-wrap items-center gap-3",children:[i.jsx("button",{type:"button",onClick:o,className:"inline-flex items-center gap-2 rounded-md border border-border/70 bg-background/80 px-3 py-1.5 text-sm font-medium text-foreground hover:bg-accent",children:"Open shortcuts cheatsheet"}),i.jsxs("span",{className:"text-xs text-muted-foreground",children:["or press ",i.jsx("kbd",{className:"rounded border border-border/70 bg-muted px-1.5 py-0.5 font-mono text-[11px]",children:"?"})," ","anywhere. ",Pr("Mod+k")," opens the command palette."]})]})}),i.jsx(Ie,{title:"What Syntaur Is",description:e.whatIsSyntaur.summary,children:i.jsx("div",{className:"grid gap-3 md:grid-cols-3",children:e.whatIsSyntaur.bullets.map(a=>i.jsx("div",{className:"rounded-md border border-border/60 bg-background/80 p-3 text-sm leading-6 text-muted-foreground",children:a},a))})}),i.jsx(Ie,{title:"Getting Started",children:i.jsx("div",{className:"space-y-3",children:e.workflow.map((a,l)=>i.jsx("div",{className:"rounded-md border border-border/60 bg-background/80 p-3",children:i.jsxs("div",{className:"flex items-start gap-3",children:[i.jsx("span",{className:"inline-flex h-5 w-5 items-center justify-center rounded-full bg-foreground text-xs font-semibold text-background",children:l+1}),i.jsxs("div",{className:"space-y-2",children:[i.jsx("h3",{className:"font-semibold text-foreground",children:a.title}),i.jsx("p",{className:"text-sm leading-6 text-muted-foreground",children:a.detail}),a.command?i.jsx(cc,{command:a.command.command,description:a.command.description,example:a.command.example}):null,a.href?i.jsx(De,{className:"inline-flex text-sm font-semibold text-primary hover:underline",to:a.href,children:"Open the related surface"}):null]})]})},a.title))})}),i.jsxs("div",{className:"grid gap-3 xl:grid-cols-2",children:[i.jsxs(Ie,{title:"Core Concepts",children:[i.jsx("div",{className:"flex flex-wrap gap-2",children:e.coreConcepts.map(a=>i.jsx(gT,{term:a.term,description:a.description},a.term))}),i.jsx("div",{className:"grid gap-3 pt-2",children:e.coreConcepts.map(a=>i.jsxs("div",{className:"rounded-md border border-border/60 bg-background/80 p-3",children:[i.jsx("h3",{className:"font-semibold text-foreground",children:a.term}),i.jsx("p",{className:"mt-2 text-sm leading-6 text-muted-foreground",children:a.description})]},a.term))})]}),i.jsx(Ie,{title:"Status Guide",children:i.jsx("div",{className:"space-y-3",children:e.statusGuide.map(a=>i.jsxs("div",{className:"rounded-md border border-border/60 bg-background/80 p-3",children:[i.jsxs("div",{className:"flex flex-wrap items-center gap-3",children:[i.jsx(Xt,{status:a.status}),i.jsx("p",{className:"font-semibold text-foreground",children:a.meaning})]}),i.jsx("p",{className:"mt-3 text-sm leading-6 text-muted-foreground",children:a.useWhen})]},a.status))})})]}),i.jsxs("div",{className:"grid gap-3 xl:grid-cols-2",children:[i.jsx(Ie,{title:"Ownership And File Rules",children:i.jsx("div",{className:"space-y-3",children:e.ownershipRules.map(a=>i.jsxs("div",{className:"rounded-md border border-border/60 bg-background/80 p-3",children:[i.jsx("h3",{className:"font-semibold text-foreground",children:a.label}),i.jsx("p",{className:"mt-2 text-sm leading-6 text-muted-foreground",children:a.description}),i.jsx("div",{className:"mt-3 flex flex-wrap gap-2",children:a.files.map(l=>i.jsx("span",{className:"rounded-full border border-border/60 bg-card/90 px-2.5 py-1 font-mono text-xs text-foreground",children:l},l))})]},a.label))})}),i.jsx(Ie,{title:"How To Navigate The Dashboard",children:i.jsx("div",{className:"space-y-3",children:e.navigation.map(a=>i.jsxs("div",{className:"rounded-md border border-border/60 bg-background/80 p-3",children:[i.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[i.jsx("h3",{className:"font-semibold text-foreground",children:a.label}),i.jsx(De,{className:"text-sm font-semibold text-primary hover:underline",to:a.href,children:"Open"})]}),i.jsx("p",{className:"mt-2 text-sm leading-6 text-muted-foreground",children:a.description})]},a.label))})})]}),i.jsx(Ie,{title:"CLI Quick Reference",children:i.jsx("div",{className:"grid gap-3 xl:grid-cols-2",children:e.commands.map(a=>i.jsx(cc,{command:a.command,description:a.description,example:a.example},a.command))})}),i.jsxs("div",{className:"grid gap-3 xl:grid-cols-2",children:[i.jsx(Ie,{title:"FAQ",children:i.jsx("div",{className:"space-y-3",children:e.faq.map(a=>i.jsxs("div",{className:"rounded-md border border-border/60 bg-background/80 p-3",children:[i.jsx("h3",{className:"font-semibold text-foreground",children:a.question}),i.jsx("p",{className:"mt-2 text-sm leading-6 text-muted-foreground",children:a.answer})]},a.question))})}),i.jsx(Ie,{title:"First Project Checklist",children:i.jsx("div",{className:"space-y-3",children:e.firstProjectChecklist.map((a,l)=>i.jsx("div",{className:"rounded-md border border-border/60 bg-background/80 p-3",children:i.jsxs("div",{className:"flex items-start gap-3",children:[i.jsx("span",{className:"inline-flex h-5 w-5 items-center justify-center rounded-full bg-foreground text-xs font-semibold text-background",children:l+1}),i.jsxs("div",{className:"space-y-2",children:[i.jsx("h3",{className:"font-semibold text-foreground",children:a.title}),i.jsx("p",{className:"text-sm leading-6 text-muted-foreground",children:a.detail}),a.command?i.jsx(cc,{command:a.command.command,example:a.command.example}):null,a.href?i.jsx(De,{className:"inline-flex text-sm font-semibold text-primary hover:underline",to:a.href,children:"Open the related surface"}):null]})]})},a.title))})})]})]})}function ih({children:e}){return i.jsx("div",{className:"flex flex-col gap-2 rounded-lg border border-border/60 bg-card/80 p-2.5 shadow-sm md:flex-row md:flex-wrap md:items-center",children:e})}const Uc=g.forwardRef(({value:e,onChange:t,placeholder:n="Search"},o)=>i.jsxs("label",{className:"relative flex min-w-[220px] flex-1 items-center",children:[i.jsx(Xs,{className:"pointer-events-none absolute left-3 h-4 w-4 text-muted-foreground"}),i.jsx("input",{ref:o,value:e,onChange:a=>t(a.target.value),placeholder:n,className:"h-9 w-full rounded-md border border-border/60 bg-background/90 pl-9 pr-3 text-sm text-foreground outline-none transition focus:border-primary focus:ring-2 focus:ring-ring/30"})]}));Uc.displayName="SearchInput";function ah({value:e,options:t,onChange:n}){return i.jsx("div",{className:"inline-flex rounded-md border border-border/60 bg-background/80 p-1",children:t.map(o=>i.jsx("button",{type:"button",onClick:()=>n(o.value),className:Ue("rounded-sm px-2.5 py-1.5 text-sm font-medium transition",e===o.value?"bg-foreground text-background":"text-muted-foreground hover:text-foreground"),children:o.label},o.value))})}function Iw({columns:e,items:t,getItemId:n,getColumnId:o,renderCard:a,canDrop:l,onMove:c,emptyMessage:d="No cards in this column."}){const[p,m]=g.useState(null),[h,x]=g.useState(null),v=g.useRef(null),b=g.useMemo(()=>new Map(t.map(O=>[n(O),O])),[n,t]),C=g.useMemo(()=>e.map(O=>({column:O,items:t.filter(T=>o(T)===O.id)})),[e,o,t]),k=p?b.get(p)??null:null;function j(O){if(!k)return{allowed:!1};const T=o(k);return(l==null?void 0:l({item:k,fromColumnId:T,toColumnId:O}))??{allowed:!0}}function S(){m(null),x(null)}function R(O,T){c&&(O.dataTransfer.effectAllowed="move",O.dataTransfer.setData("text/plain",T),m(T))}function N(O,T,D){!c||!k||!j(T).allowed||(O.preventDefault(),O.dataTransfer.dropEffect="move",x(G=>(G==null?void 0:G.columnId)===T&&G.index===D?G:{columnId:T,index:D}))}async function A(O,T,D){var K;if(O.preventDefault(),!c||!k){S();return}const L=o(k),re=(((K=C.find(q=>q.column.id===L))==null?void 0:K.items)??[]).findIndex(q=>n(q)===n(k));if(!j(T).allowed||re<0){S();return}if(L===T&&(D===re||D===re+1)){S();return}try{await c({item:k,fromColumnId:L,toColumnId:T,fromIndex:re,toIndex:D})}finally{S()}}return i.jsx("div",{className:"relative overflow-x-auto pb-2",style:{scrollbarColor:"oklch(var(--border)) transparent",scrollbarWidth:"thin"},children:i.jsx("div",{className:"grid min-w-max auto-cols-[minmax(260px,320px)] grid-flow-col gap-4",children:C.map(({column:O,items:T})=>{const D=j(O.id),L=(h==null?void 0:h.columnId)===O.id;return i.jsxs("section",{className:Ue("flex min-h-[320px] flex-col rounded-lg border border-border/60 bg-card/85 p-3 shadow-sm",k&&!D.allowed?"border-dashed opacity-65":"",k&&D.allowed?"border-primary/30 bg-accent/30":"",L?"ring-2 ring-ring/30":""),title:k&&!D.allowed?D.reason:void 0,children:[i.jsxs("div",{className:"mb-3 flex items-start justify-between gap-3",children:[i.jsxs("div",{className:"space-y-1",children:[i.jsx("h2",{className:"text-sm font-semibold uppercase tracking-[0.16em] text-muted-foreground",children:O.title}),O.description?i.jsx("p",{className:"text-sm leading-6 text-muted-foreground",children:O.description}):null]}),i.jsx("span",{className:"rounded-full border border-border/60 bg-background/80 px-2.5 py-1 text-xs font-semibold text-foreground",children:T.length})]}),i.jsxs("div",{className:"flex flex-1 flex-col gap-3",onDragOver:G=>N(G,O.id,T.length),onDrop:G=>A(G,O.id,T.length),children:[T.length===0?i.jsx(yT,{active:(h==null?void 0:h.columnId)===O.id&&h.index===0,disabled:!!k&&!D.allowed,children:typeof d=="function"?d(O):d}):null,T.map((G,re)=>{const z=n(G),K=p===z;return i.jsxs(g.Fragment,{children:[i.jsx("div",{className:Ue("h-2 rounded-full transition",(h==null?void 0:h.columnId)===O.id&&h.index===re?"bg-primary/70":"bg-transparent"),onDragOver:q=>N(q,O.id,re),onDrop:q=>A(q,O.id,re)}),i.jsx("div",{draggable:!!c,onMouseDown:q=>{v.current=q.target},onDragStart:q=>{const J=v.current;if(J!=null&&J.closest("a, button")){q.preventDefault();return}R(q,z)},onDragEnd:S,className:Ue("transition",c?"cursor-grab active:cursor-grabbing":"",K?"scale-[0.98] opacity-50":""),children:a(G,{dragging:K})})]},z)}),T.length>0?i.jsx("div",{className:Ue("mt-1 rounded-md border border-dashed px-3 py-2 text-center text-xs text-muted-foreground transition",(h==null?void 0:h.columnId)===O.id&&h.index===T.length?"border-primary/50 bg-primary/10 text-foreground":"border-border/60",k&&!D.allowed?"opacity-40":""),children:"Drop here to place at the end"}):null]})]},O.id)})})})}function yT({active:e,disabled:t,children:n}){return i.jsx("div",{className:Ue("flex min-h-[128px] items-center justify-center rounded-lg border border-dashed px-4 text-center text-sm text-muted-foreground transition",e?"border-primary/60 bg-primary/10 text-foreground":"border-border/60 bg-background/50",t?"opacity-45":""),children:n})}const Ow={statuses:[{id:"pending",label:"Pending"},{id:"in_progress",label:"In Progress"},{id:"blocked",label:"Blocked"},{id:"review",label:"Review"},{id:"completed",label:"Completed"},{id:"failed",label:"Failed"}],order:["pending","in_progress","blocked","review","completed","failed"],transitions:[],custom:!1};let ta=null,Go=null;function vT(){return ta?Promise.resolve(ta):Go||(Go=fetch("/api/config/statuses").then(e=>{if(!e.ok)throw new Error(`HTTP ${e.status}`);return e.json()}).then(e=>(ta=e,Go=null,e)).catch(()=>(Go=null,Ow)),Go)}function Hc(){const[e,t]=g.useState(()=>ta??Ow);return g.useEffect(()=>{vT().then(t)},[]),e}function cy(){ta=null,Go=null}function bT(e,t){const n=e.statuses.find(o=>o.id===t);return(n==null?void 0:n.label)??t.replace(/_/g," ").replace(/\b\w/g,o=>o.toUpperCase())}const wT={completed:"bg-status-completed-foreground",in_progress:"bg-status-in-progress-foreground",review:"bg-status-review-foreground",blocked:"bg-status-blocked-foreground",failed:"bg-status-failed-foreground",pending:"bg-status-pending-foreground"},uy=["bg-primary","bg-secondary","bg-accent-coral","bg-accent-teal","bg-accent-amber"];function yc({progress:e,className:t,showLegend:n=!1}){const o=Hc(),a=g.useMemo(()=>{let c=0;return(o.order.length>0?o.order:Object.keys(e).filter(p=>p!=="total")).map(p=>({key:p,className:wT[p]??uy[c++%uy.length]}))},[o.order,e]),l=a.filter(c=>(e[c.key]??0)>0);return i.jsxs("div",{className:Ue("space-y-2",t),children:[i.jsx("div",{className:"flex h-1.5 w-full overflow-hidden rounded-lg border border-border/70 bg-muted/60",children:e.total===0?i.jsx("div",{className:"h-full w-full bg-muted"}):l.map(c=>i.jsx("div",{className:c.className,style:{width:`${(e[c.key]??0)/e.total*100}%`},title:`${fn(c.key)}: ${e[c.key]??0}`},c.key))}),n?i.jsx("div",{className:"flex flex-wrap gap-2 text-xs text-muted-foreground",children:a.map(c=>i.jsxs("span",{className:"inline-flex items-center gap-2 rounded-full border border-border/60 bg-background/80 px-2 py-1",children:[i.jsx("span",{className:Ue("h-2 w-2 rounded-full",c.className)}),i.jsx("span",{children:fn(c.key)}),i.jsx("span",{className:"font-medium text-foreground",children:e[c.key]??0})]},c.key))}):null]})}const kT=["pending","active","blocked","failed","completed","archived"],lh=kT,jT=["pending","in_progress","blocked","review","completed","failed"];function ST(e){return e&&e.length>0?e:[...jT]}function NT(e,t,n){if(t<0||t>=e.length)return e;const o=[...e],[a]=o.splice(t,1),l=t<n?n-1:n;return o.splice(Math.max(0,Math.min(l,o.length)),0,a),o}function dy(){const{workspace:e}=At(),t=Lt(),n=Ut(),{data:o,loading:a,error:l,refetch:c}=Mc(),d=g.useRef(null);rs("list:projects");const[p,m]=g.useState(""),[h,x]=g.useState("all"),[v,b]=g.useState("active"),[C,k]=g.useState("all"),[j,S]=g.useState("updated"),[R,N]=To(),A=R.get("view"),O=A==="table"||A==="kanban"?A:"cards",T=F=>{N(B=>{const U=new URLSearchParams(B);return F==="cards"?U.delete("view"):U.set("view",F),U})},[D,L]=g.useState({}),G=g.useMemo(()=>o?o.filter(F=>{if(e){if(e==="_ungrouped"){if(F.workspace!==null)return!1}else if(F.workspace!==e)return!1}return v==="active"&&F.archived||v==="archived"&&!F.archived||h!=="all"&&F.status!==h||C!=="all"&&!F.tags.includes(C)?!1:p.trim()?`${F.title} ${F.tags.join(" ")} ${F.slug}`.toLowerCase().includes(p.toLowerCase()):!0}).sort((F,B)=>PT(F,B,j)):[],[o,p,h,v,C,j,e]),re=G.map(F=>`${F.slug}:${F.status}`).join("|");g.useEffect(()=>{L(TT(G))},[re,j]);const z=g.useMemo(()=>{const F=new Map(G.map(B=>[B.slug,B]));return lh.flatMap(B=>(D[B]??G.filter(Z=>Z.status===B).map(Z=>Z.slug)).map(Z=>F.get(Z)).filter(Z=>!!Z))},[G,D]),{visibleItems:K,visibleIndexByKey:q}=g.useMemo(()=>{const F=O==="kanban"?z:G,B=new Map;return F.forEach((U,Z)=>B.set(U.slug,Z)),{visibleItems:F,visibleIndexByKey:B}},[O,G,z]),{hotkeyRowProps:J}=Ca(K,{scope:"list:projects",onOpen:F=>n(`${t}/projects/${F.slug}`)});if(ht({keys:"/",scope:"list:projects",description:"Focus filter",handler:()=>{var F;return(F=d.current)==null?void 0:F.focus()}}),ht({keys:"r",scope:"list:projects",description:"Refresh",handler:()=>c()}),a)return i.jsx(kt,{label:"Loading projects…"});if(l||!o)return i.jsx(gt,{error:l||"Project list is unavailable."});const _=Array.from(new Set(o.flatMap(F=>F.tags))).sort();return i.jsxs("div",{className:"space-y-5",children:[i.jsxs(ih,{children:[i.jsx(Uc,{ref:d,value:p,onChange:m,placeholder:"Search by project title or tag"}),i.jsxs("select",{value:h,onChange:F=>x(F.target.value),className:"editor-input max-w-[180px]",children:[i.jsx("option",{value:"all",children:"All statuses"}),i.jsx("option",{value:"pending",children:"Pending"}),i.jsx("option",{value:"active",children:"Active"}),i.jsx("option",{value:"blocked",children:"Blocked"}),i.jsx("option",{value:"failed",children:"Failed"}),i.jsx("option",{value:"completed",children:"Completed"}),i.jsx("option",{value:"archived",children:"Archived"})]}),i.jsxs("select",{value:v,onChange:F=>b(F.target.value),className:"editor-input max-w-[180px]",children:[i.jsx("option",{value:"active",children:"Hide archived"}),i.jsx("option",{value:"all",children:"All projects"}),i.jsx("option",{value:"archived",children:"Archived only"})]}),i.jsxs("select",{value:C,onChange:F=>k(F.target.value),className:"editor-input max-w-[180px]",children:[i.jsx("option",{value:"all",children:"All tags"}),_.map(F=>i.jsx("option",{value:F,children:F},F))]}),i.jsxs("select",{value:j,onChange:F=>S(F.target.value),className:"editor-input max-w-[180px]",children:[i.jsx("option",{value:"updated",children:"Sort: Updated"}),i.jsx("option",{value:"created",children:"Sort: Created"}),i.jsx("option",{value:"title",children:"Sort: Title"}),i.jsx("option",{value:"attention",children:"Sort: Attention"})]}),i.jsx(ah,{value:O,onChange:F=>T(F),options:[{value:"cards",label:"Cards"},{value:"table",label:"Table"},{value:"kanban",label:"Kanban"}]})]}),G.length===0?i.jsx(rt,{title:o.length===0?"No projects yet":"No projects match these filters",description:o.length===0?"A project is the high-level objective that groups assignments, resources, and memories. Create one to start the dashboard flow.":"Adjust the current search and filters or create a new project.",actions:i.jsx(De,{className:"shell-action bg-foreground text-background hover:opacity-90",to:`${t}/create/project`,children:"Create Project"})}):O==="cards"?i.jsx("div",{className:"grid gap-3 lg:grid-cols-2 2xl:grid-cols-3",children:G.map((F,B)=>i.jsxs(De,{to:`${t}/projects/${F.slug}`,className:"block rounded-lg border border-border/60 bg-card/90 p-3 shadow-sm transition hover:border-primary/40 hover:shadow-md",...J(B),children:[i.jsxs("div",{className:"flex items-start justify-between gap-3",children:[i.jsxs("div",{className:"space-y-1",children:[i.jsx("h2",{className:"text-lg font-semibold text-foreground",children:F.title}),i.jsxs("p",{className:"text-sm text-muted-foreground",children:["Updated ",No(F.updated)]})]}),i.jsx(Xt,{status:F.status})]}),i.jsxs("div",{className:"mt-4 space-y-3",children:[i.jsx(yc,{progress:F.progress,showLegend:!0}),i.jsx("div",{className:"flex flex-wrap gap-2",children:F.tags.map(U=>i.jsx("span",{className:"rounded-full border border-border/60 bg-background/80 px-2.5 py-1 text-xs text-foreground",children:U},U))}),i.jsxs("div",{className:"grid grid-cols-2 gap-3 text-sm",children:[i.jsxs("div",{className:"rounded-md border border-border/60 bg-background/80 p-3",children:[i.jsx("p",{className:"text-muted-foreground",children:"Needs attention"}),i.jsx("p",{className:"mt-1 font-semibold text-foreground",children:F.needsAttention.blockedCount+F.needsAttention.failedCount})]}),i.jsxs("div",{className:"rounded-md border border-border/60 bg-background/80 p-3",children:[i.jsx("p",{className:"text-muted-foreground",children:"Assignments"}),i.jsx("p",{className:"mt-1 font-semibold text-foreground",children:F.progress.total})]})]})]})]},F.slug))}):O==="table"?i.jsx(Ie,{title:`${G.length} project${G.length===1?"":"s"}`,children:i.jsx("div",{className:"overflow-x-auto",children:i.jsxs("table",{className:"w-full min-w-[760px] text-left text-sm",children:[i.jsx("thead",{children:i.jsxs("tr",{className:"border-b border-border/60 text-muted-foreground",children:[i.jsx("th",{className:"pb-3 font-medium",children:"Project"}),i.jsx("th",{className:"pb-3 font-medium",children:"Status"}),i.jsx("th",{className:"pb-3 font-medium",children:"Progress"}),i.jsx("th",{className:"pb-3 font-medium",children:"Attention"}),i.jsx("th",{className:"pb-3 font-medium",children:"Updated"})]})}),i.jsx("tbody",{children:G.map((F,B)=>i.jsxs("tr",{className:"border-b border-border/50 last:border-0",...J(B),children:[i.jsxs("td",{className:"py-4 pr-4",children:[i.jsx(De,{to:`${t}/projects/${F.slug}`,className:"font-semibold text-foreground hover:text-primary",children:F.title}),i.jsx("div",{className:"mt-1 flex flex-wrap gap-2",children:F.tags.map(U=>i.jsx("span",{className:"rounded-full border border-border/60 px-2 py-0.5 text-xs text-muted-foreground",children:U},U))})]}),i.jsx("td",{className:"py-4 pr-4",children:i.jsx(Xt,{status:F.status})}),i.jsx("td",{className:"py-4 pr-4",children:i.jsx("div",{className:"min-w-[220px]",children:i.jsx(yc,{progress:F.progress})})}),i.jsx("td",{className:"py-4 pr-4 text-muted-foreground",children:F.needsAttention.blockedCount+F.needsAttention.failedCount}),i.jsx("td",{className:"py-4 text-muted-foreground",children:No(F.updated)})]},F.slug))})]})})}):i.jsx(Iw,{columns:ET,items:z,getItemId:F=>F.slug,getColumnId:F=>F.status,canDrop:({fromColumnId:F,toColumnId:B})=>({allowed:!0,reason:F===B?void 0:"This will set a manual status override on the project."}),onMove:({item:F,fromColumnId:B,toColumnId:U,fromIndex:Z,toIndex:P})=>{if(B===U){const M=D[B]??G.filter(Q=>Q.status===B).map(Q=>Q.slug);L(Q=>({...Q,[B]:NT(M,Z,P)}));return}fetch(`/api/projects/${F.slug}/status-override`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({status:U})}).then(()=>{window.location.reload()})},emptyMessage:F=>`No ${F.title.toLowerCase()} projects.`,renderCard:(F,{dragging:B})=>{const U=q.get(F.slug)??-1;return i.jsx("div",{...U>=0?J(U):{},children:i.jsx(RT,{project:F,dragging:B})})}}),i.jsx("div",{className:"rounded-lg border border-border/60 bg-card/80 p-3 text-sm text-muted-foreground",children:i.jsxs("div",{className:"flex items-start gap-3",children:[i.jsx(mb,{className:"mt-0.5 h-4 w-4"}),i.jsxs("p",{children:["Project status is derived from assignment state by default.",O==="kanban"?" Drag projects between columns or use":" Use"," the status override on the project detail page to set a manual status."]})]})})]})}const CT={pending:"Pending",active:"Active",blocked:"Blocked",failed:"Failed",completed:"Completed",archived:"Archived"},ET=lh.map(e=>({id:e,title:CT[e],description:Dw(e)}));function PT(e,t,n){switch(n){case"created":return t.created.localeCompare(e.created);case"title":return e.title.localeCompare(t.title);case"attention":return fy(t)-fy(e);case"updated":default:return t.updated.localeCompare(e.updated)}}function fy(e){return e.needsAttention.failedCount*10+e.needsAttention.blockedCount*5+e.needsAttention.openQuestions}function TT(e){return Object.fromEntries(lh.map(t=>[t,e.filter(n=>n.status===t).map(n=>n.slug)]))}function RT({project:e,dragging:t}){const n=Lt();return i.jsxs("div",{className:"rounded-lg border border-border/60 bg-background/85 p-3 shadow-sm",children:[i.jsxs("div",{className:"flex items-start justify-between gap-3",children:[i.jsxs("div",{className:"space-y-1",children:[i.jsx(De,{to:`${n}/projects/${e.slug}`,className:"text-base font-semibold text-foreground hover:text-primary",children:e.title}),i.jsxs("p",{className:"text-sm text-muted-foreground",children:["Updated ",No(e.updated)]})]}),i.jsx(Xt,{status:e.status})]}),i.jsx("div",{className:"mt-4",children:i.jsx(yc,{progress:e.progress})}),i.jsxs("div",{className:"mt-4 flex flex-wrap gap-2",children:[e.tags.map(o=>i.jsx("span",{className:"rounded-full border border-border/60 bg-background/80 px-2.5 py-1 text-xs text-foreground",children:o},o)),i.jsxs("span",{className:"rounded-full border border-border/60 px-2.5 py-1 text-xs text-muted-foreground",children:[e.progress.total," assignments"]}),i.jsxs("span",{className:"rounded-full border border-border/60 px-2.5 py-1 text-xs text-muted-foreground",children:[e.needsAttention.blockedCount+e.needsAttention.failedCount," needs attention"]})]}),i.jsx("div",{className:"mt-4 text-xs uppercase tracking-[0.08em] text-muted-foreground",children:t?"Reordering within status":"Derived project lane"})]})}function qr({value:e}){const[t,n]=g.useState(!1);function o(){navigator.clipboard.writeText(e),n(!0),setTimeout(()=>n(!1),1500)}return i.jsx("button",{onClick:o,className:"text-muted-foreground hover:text-foreground",title:t?"Copied!":`Copy: ${e}`,children:t?i.jsx(Sa,{className:"h-3 w-3 text-status-completed-foreground"}):i.jsx(Oc,{className:"h-3 w-3"})})}function py(e){const t=AT(e),n=g.forwardRef((o,a)=>{const{children:l,...c}=o,d=g.Children.toArray(l),p=d.find(IT);if(p){const m=p.props.children,h=d.map(x=>x===p?g.Children.count(m)>1?g.Children.only(null):g.isValidElement(m)?m.props.children:null:x);return i.jsx(t,{...c,ref:a,children:g.isValidElement(m)?g.cloneElement(m,void 0,h):null})}return i.jsx(t,{...c,ref:a,children:l})});return n.displayName=`${e}.Slot`,n}function AT(e){const t=g.forwardRef((n,o)=>{const{children:a,...l}=n;if(g.isValidElement(a)){const c=LT(a),d=OT(l,a.props);return a.type!==g.Fragment&&(d.ref=o?$c(o,c):c),g.cloneElement(a,d)}return g.Children.count(a)>1?g.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var DT=Symbol("radix.slottable");function IT(e){return g.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===DT}function OT(e,t){const n={...t};for(const o in t){const a=e[o],l=t[o];/^on[A-Z]/.test(o)?a&&l?n[o]=(...d)=>{const p=l(...d);return a(...d),p}:a&&(n[o]=a):o==="style"?n[o]={...a,...l}:o==="className"&&(n[o]=[a,l].filter(Boolean).join(" "))}return{...e,...n}}function LT(e){var o,a;let t=(o=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(a=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:a.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function MT(e){const t=e+"CollectionProvider",[n,o]=Zo(t),[a,l]=n(t,{collectionRef:{current:null},itemMap:new Map}),c=k=>{const{scope:j,children:S}=k,R=Ct.useRef(null),N=Ct.useRef(new Map).current;return i.jsx(a,{scope:j,itemMap:N,collectionRef:R,children:S})};c.displayName=t;const d=e+"CollectionSlot",p=py(d),m=Ct.forwardRef((k,j)=>{const{scope:S,children:R}=k,N=l(d,S),A=pn(j,N.collectionRef);return i.jsx(p,{ref:A,children:R})});m.displayName=d;const h=e+"CollectionItemSlot",x="data-radix-collection-item",v=py(h),b=Ct.forwardRef((k,j)=>{const{scope:S,children:R,...N}=k,A=Ct.useRef(null),O=pn(j,A),T=l(h,S);return Ct.useEffect(()=>(T.itemMap.set(A,{ref:A,...N}),()=>void T.itemMap.delete(A))),i.jsx(v,{[x]:"",ref:O,children:R})});b.displayName=h;function C(k){const j=l(e+"CollectionConsumer",k);return Ct.useCallback(()=>{const R=j.collectionRef.current;if(!R)return[];const N=Array.from(R.querySelectorAll(`[${x}]`));return Array.from(j.itemMap.values()).sort((T,D)=>N.indexOf(T.ref.current)-N.indexOf(D.ref.current))},[j.collectionRef,j.itemMap])}return[{Provider:c,Slot:m,ItemSlot:b},C,o]}var _T=g.createContext(void 0);function Lw(e){const t=g.useContext(_T);return e||t||"ltr"}var hf="rovingFocusGroup.onEntryFocus",$T={bubbles:!1,cancelable:!0},Ea="RovingFocusGroup",[np,Mw,FT]=MT(Ea),[zT,_w]=Zo(Ea,[FT]),[BT,UT]=zT(Ea),$w=g.forwardRef((e,t)=>i.jsx(np.Provider,{scope:e.__scopeRovingFocusGroup,children:i.jsx(np.Slot,{scope:e.__scopeRovingFocusGroup,children:i.jsx(HT,{...e,ref:t})})}));$w.displayName=Ea;var HT=g.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:o,loop:a=!1,dir:l,currentTabStopId:c,defaultCurrentTabStopId:d,onCurrentTabStopIdChange:p,onEntryFocus:m,preventScrollOnEntryFocus:h=!1,...x}=e,v=g.useRef(null),b=pn(t,v),C=Lw(l),[k,j]=Fc({prop:c,defaultProp:d??null,onChange:p,caller:Ea}),[S,R]=g.useState(!1),N=Xo(m),A=Mw(n),O=g.useRef(!1),[T,D]=g.useState(0);return g.useEffect(()=>{const L=v.current;if(L)return L.addEventListener(hf,N),()=>L.removeEventListener(hf,N)},[N]),i.jsx(BT,{scope:n,orientation:o,dir:C,loop:a,currentTabStopId:k,onItemFocus:g.useCallback(L=>j(L),[j]),onItemShiftTab:g.useCallback(()=>R(!0),[]),onFocusableItemAdd:g.useCallback(()=>D(L=>L+1),[]),onFocusableItemRemove:g.useCallback(()=>D(L=>L-1),[]),children:i.jsx(Mt.div,{tabIndex:S||T===0?-1:0,"data-orientation":o,...x,ref:b,style:{outline:"none",...e.style},onMouseDown:mt(e.onMouseDown,()=>{O.current=!0}),onFocus:mt(e.onFocus,L=>{const G=!O.current;if(L.target===L.currentTarget&&G&&!S){const re=new CustomEvent(hf,$T);if(L.currentTarget.dispatchEvent(re),!re.defaultPrevented){const z=A().filter(F=>F.focusable),K=z.find(F=>F.active),q=z.find(F=>F.id===k),_=[K,q,...z].filter(Boolean).map(F=>F.ref.current);Bw(_,h)}}O.current=!1}),onBlur:mt(e.onBlur,()=>R(!1))})})}),Fw="RovingFocusGroupItem",zw=g.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:o=!0,active:a=!1,tabStopId:l,children:c,...d}=e,p=_s(),m=l||p,h=UT(Fw,n),x=h.currentTabStopId===m,v=Mw(n),{onFocusableItemAdd:b,onFocusableItemRemove:C,currentTabStopId:k}=h;return g.useEffect(()=>{if(o)return b(),()=>C()},[o,b,C]),i.jsx(np.ItemSlot,{scope:n,id:m,focusable:o,active:a,children:i.jsx(Mt.span,{tabIndex:x?0:-1,"data-orientation":h.orientation,...d,ref:t,onMouseDown:mt(e.onMouseDown,j=>{o?h.onItemFocus(m):j.preventDefault()}),onFocus:mt(e.onFocus,()=>h.onItemFocus(m)),onKeyDown:mt(e.onKeyDown,j=>{if(j.key==="Tab"&&j.shiftKey){h.onItemShiftTab();return}if(j.target!==j.currentTarget)return;const S=qT(j,h.orientation,h.dir);if(S!==void 0){if(j.metaKey||j.ctrlKey||j.altKey||j.shiftKey)return;j.preventDefault();let N=v().filter(A=>A.focusable).map(A=>A.ref.current);if(S==="last")N.reverse();else if(S==="prev"||S==="next"){S==="prev"&&N.reverse();const A=N.indexOf(j.currentTarget);N=h.loop?KT(N,A+1):N.slice(A+1)}setTimeout(()=>Bw(N))}}),children:typeof c=="function"?c({isCurrentTabStop:x,hasTabStop:k!=null}):c})})});zw.displayName=Fw;var WT={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function VT(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function qT(e,t,n){const o=VT(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(o))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(o)))return WT[o]}function Bw(e,t=!1){const n=document.activeElement;for(const o of e)if(o===n||(o.focus({preventScroll:t}),document.activeElement!==n))return}function KT(e,t){return e.map((n,o)=>e[(t+o)%e.length])}var GT=$w,YT=zw,Wc="Tabs",[XT]=Zo(Wc,[_w]),Uw=_w(),[QT,ch]=XT(Wc),Hw=g.forwardRef((e,t)=>{const{__scopeTabs:n,value:o,onValueChange:a,defaultValue:l,orientation:c="horizontal",dir:d,activationMode:p="automatic",...m}=e,h=Lw(d),[x,v]=Fc({prop:o,onChange:a,defaultProp:l??"",caller:Wc});return i.jsx(QT,{scope:n,baseId:_s(),value:x,onValueChange:v,orientation:c,dir:h,activationMode:p,children:i.jsx(Mt.div,{dir:h,"data-orientation":c,...m,ref:t})})});Hw.displayName=Wc;var Ww="TabsList",Vw=g.forwardRef((e,t)=>{const{__scopeTabs:n,loop:o=!0,...a}=e,l=ch(Ww,n),c=Uw(n);return i.jsx(GT,{asChild:!0,...c,orientation:l.orientation,dir:l.dir,loop:o,children:i.jsx(Mt.div,{role:"tablist","aria-orientation":l.orientation,...a,ref:t})})});Vw.displayName=Ww;var qw="TabsTrigger",Kw=g.forwardRef((e,t)=>{const{__scopeTabs:n,value:o,disabled:a=!1,...l}=e,c=ch(qw,n),d=Uw(n),p=Xw(c.baseId,o),m=Qw(c.baseId,o),h=o===c.value;return i.jsx(YT,{asChild:!0,...d,focusable:!a,active:h,children:i.jsx(Mt.button,{type:"button",role:"tab","aria-selected":h,"aria-controls":m,"data-state":h?"active":"inactive","data-disabled":a?"":void 0,disabled:a,id:p,...l,ref:t,onMouseDown:mt(e.onMouseDown,x=>{!a&&x.button===0&&x.ctrlKey===!1?c.onValueChange(o):x.preventDefault()}),onKeyDown:mt(e.onKeyDown,x=>{[" ","Enter"].includes(x.key)&&c.onValueChange(o)}),onFocus:mt(e.onFocus,()=>{const x=c.activationMode!=="manual";!h&&!a&&x&&c.onValueChange(o)})})})});Kw.displayName=qw;var Gw="TabsContent",Yw=g.forwardRef((e,t)=>{const{__scopeTabs:n,value:o,forceMount:a,children:l,...c}=e,d=ch(Gw,n),p=Xw(d.baseId,o),m=Qw(d.baseId,o),h=o===d.value,x=g.useRef(h);return g.useEffect(()=>{const v=requestAnimationFrame(()=>x.current=!1);return()=>cancelAnimationFrame(v)},[]),i.jsx(es,{present:a||h,children:({present:v})=>i.jsx(Mt.div,{"data-state":h?"active":"inactive","data-orientation":d.orientation,role:"tabpanel","aria-labelledby":p,hidden:!v,id:m,tabIndex:0,...c,ref:t,style:{...e.style,animationDuration:x.current?"0s":void 0},children:v&&l})})});Yw.displayName=Gw;function Xw(e,t){return`${e}-trigger-${t}`}function Qw(e,t){return`${e}-content-${t}`}var Jw=Hw,Zw=Vw,rp=Kw,op=Yw;function uh({value:e,onValueChange:t,items:n,className:o}){return i.jsxs(Jw,{value:e,onValueChange:t,className:o,children:[i.jsx(Zw,{className:"scrollbar-none flex gap-2 overflow-x-auto rounded-md border border-border/70 bg-card/80 p-1",children:n.map(a=>i.jsxs(rp,{value:a.value,className:Ue("inline-flex items-center gap-2 rounded-sm px-3 py-1.5 text-sm font-medium text-muted-foreground transition","data-[state=active]:bg-foreground data-[state=active]:text-background"),children:[i.jsx("span",{children:a.label}),typeof a.count=="number"?i.jsx("span",{className:"rounded-full bg-background/20 px-2 py-0.5 text-xs data-[state=active]:bg-background/20",children:a.count}):null]},a.value))}),n.map(a=>i.jsx(op,{value:a.value,className:"pt-3",children:a.content},a.value))]})}const JT="modulepreload",ZT=function(e){return"/"+e},hy={},eR=function(t,n,o){let a=Promise.resolve();if(n&&n.length>0){let c=function(m){return Promise.all(m.map(h=>Promise.resolve(h).then(x=>({status:"fulfilled",value:x}),x=>({status:"rejected",reason:x}))))};document.getElementsByTagName("link");const d=document.querySelector("meta[property=csp-nonce]"),p=(d==null?void 0:d.nonce)||(d==null?void 0:d.getAttribute("nonce"));a=c(n.map(m=>{if(m=ZT(m),m in hy)return;hy[m]=!0;const h=m.endsWith(".css"),x=h?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${m}"]${x}`))return;const v=document.createElement("link");if(v.rel=h?"stylesheet":JT,h||(v.as="script"),v.crossOrigin="",v.href=m,p&&v.setAttribute("nonce",p),document.head.appendChild(v),h)return new Promise((b,C)=>{v.addEventListener("load",b),v.addEventListener("error",()=>C(new Error(`Unable to preload CSS for ${m}`)))})}))}function l(c){const d=new Event("vite:preloadError",{cancelable:!0});if(d.payload=c,window.dispatchEvent(d),!d.defaultPrevented)throw c}return a.then(c=>{for(const d of c||[])d.status==="rejected"&&l(d.reason);return t().catch(l)})};function tR({definition:e,className:t,nodeRoutes:n={}}){const o=g.useRef(null),[a,l]=g.useState(null),[c,d]=g.useState(!0),p=Ut(),m=document.documentElement.classList.contains("dark")?"dark":"default";return g.useEffect(()=>{let h=!1;async function x(){if(o.current)try{const v=(await eR(async()=>{const{default:k}=await import("./mermaid.core-D558akcW.js").then(j=>j.bF);return{default:k}},[])).default;if(v.initialize({startOnLoad:!1,theme:m}),h)return;const b=`mermaid-${Date.now()}`,{svg:C}=await v.render(b,e);if(h||!o.current)return;o.current.innerHTML=C,nR(o.current,n,p),d(!1)}catch(v){h||(l(v instanceof Error?v.message:"Failed to render graph"),d(!1))}}return d(!0),l(null),x(),()=>{h=!0}},[e,p,n,m]),a?i.jsxs("div",{className:Ue("rounded-lg border border-border bg-card p-4",t),children:[i.jsxs("p",{className:"text-sm text-error-foreground",children:["Failed to render dependency graph: ",a]}),i.jsx("pre",{className:"mt-2 text-xs text-muted-foreground overflow-auto",children:e})]}):i.jsxs("div",{className:Ue("rounded-lg border border-border bg-card p-4",t),children:[c&&i.jsx("p",{className:"text-sm text-muted-foreground",children:"Loading graph..."}),i.jsx("div",{ref:o,className:"overflow-auto"})]})}function nR(e,t,n){var o;for(const a of e.querySelectorAll(".node")){const l=((o=a.textContent)==null?void 0:o.replace(/\s+/g," ").trim())??"",c=t[l];if(!c)continue;a.style.cursor="pointer",a.setAttribute("role","link"),a.setAttribute("tabindex","0"),a.setAttribute("aria-label",`Open ${l}`);const d=()=>n(c);a.addEventListener("click",d),a.addEventListener("keydown",p=>{(p.key==="Enter"||p.key===" ")&&(p.preventDefault(),d())})}}function rR(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const oR=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,sR=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,iR={};function my(e,t){return(iR.jsx?sR:oR).test(e)}const aR=/[ \t\n\f\r]/g;function lR(e){return typeof e=="object"?e.type==="text"?gy(e.value):!1:gy(e)}function gy(e){return e.replace(aR,"")===""}class Pa{constructor(t,n,o){this.normal=n,this.property=t,o&&(this.space=o)}}Pa.prototype.normal={};Pa.prototype.property={};Pa.prototype.space=void 0;function e0(e,t){const n={},o={};for(const a of e)Object.assign(n,a.property),Object.assign(o,a.normal);return new Pa(n,o,t)}function sp(e){return e.toLowerCase()}class Rn{constructor(t,n){this.attribute=n,this.property=t}}Rn.prototype.attribute="";Rn.prototype.booleanish=!1;Rn.prototype.boolean=!1;Rn.prototype.commaOrSpaceSeparated=!1;Rn.prototype.commaSeparated=!1;Rn.prototype.defined=!1;Rn.prototype.mustUseProperty=!1;Rn.prototype.number=!1;Rn.prototype.overloadedBoolean=!1;Rn.prototype.property="";Rn.prototype.spaceSeparated=!1;Rn.prototype.space=void 0;let cR=0;const We=os(),Ot=os(),ip=os(),he=os(),at=os(),Fs=os(),_n=os();function os(){return 2**++cR}const ap=Object.freeze(Object.defineProperty({__proto__:null,boolean:We,booleanish:Ot,commaOrSpaceSeparated:_n,commaSeparated:Fs,number:he,overloadedBoolean:ip,spaceSeparated:at},Symbol.toStringTag,{value:"Module"})),mf=Object.keys(ap);class dh extends Rn{constructor(t,n,o,a){let l=-1;if(super(t,n),xy(this,"space",a),typeof o=="number")for(;++l<mf.length;){const c=mf[l];xy(this,mf[l],(o&ap[c])===ap[c])}}}dh.prototype.defined=!0;function xy(e,t,n){n&&(e[t]=n)}function ei(e){const t={},n={};for(const[o,a]of Object.entries(e.properties)){const l=new dh(o,e.transform(e.attributes||{},o),a,e.space);e.mustUseProperty&&e.mustUseProperty.includes(o)&&(l.mustUseProperty=!0),t[o]=l,n[sp(o)]=o,n[sp(l.attribute)]=o}return new Pa(t,n,e.space)}const t0=ei({properties:{ariaActiveDescendant:null,ariaAtomic:Ot,ariaAutoComplete:null,ariaBusy:Ot,ariaChecked:Ot,ariaColCount:he,ariaColIndex:he,ariaColSpan:he,ariaControls:at,ariaCurrent:null,ariaDescribedBy:at,ariaDetails:null,ariaDisabled:Ot,ariaDropEffect:at,ariaErrorMessage:null,ariaExpanded:Ot,ariaFlowTo:at,ariaGrabbed:Ot,ariaHasPopup:null,ariaHidden:Ot,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:at,ariaLevel:he,ariaLive:null,ariaModal:Ot,ariaMultiLine:Ot,ariaMultiSelectable:Ot,ariaOrientation:null,ariaOwns:at,ariaPlaceholder:null,ariaPosInSet:he,ariaPressed:Ot,ariaReadOnly:Ot,ariaRelevant:null,ariaRequired:Ot,ariaRoleDescription:at,ariaRowCount:he,ariaRowIndex:he,ariaRowSpan:he,ariaSelected:Ot,ariaSetSize:he,ariaSort:null,ariaValueMax:he,ariaValueMin:he,ariaValueNow:he,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function n0(e,t){return t in e?e[t]:t}function r0(e,t){return n0(e,t.toLowerCase())}const uR=ei({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:Fs,acceptCharset:at,accessKey:at,action:null,allow:null,allowFullScreen:We,allowPaymentRequest:We,allowUserMedia:We,alt:null,as:null,async:We,autoCapitalize:null,autoComplete:at,autoFocus:We,autoPlay:We,blocking:at,capture:null,charSet:null,checked:We,cite:null,className:at,cols:he,colSpan:null,content:null,contentEditable:Ot,controls:We,controlsList:at,coords:he|Fs,crossOrigin:null,data:null,dateTime:null,decoding:null,default:We,defer:We,dir:null,dirName:null,disabled:We,download:ip,draggable:Ot,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:We,formTarget:null,headers:at,height:he,hidden:ip,high:he,href:null,hrefLang:null,htmlFor:at,httpEquiv:at,id:null,imageSizes:null,imageSrcSet:null,inert:We,inputMode:null,integrity:null,is:null,isMap:We,itemId:null,itemProp:at,itemRef:at,itemScope:We,itemType:at,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:We,low:he,manifest:null,max:null,maxLength:he,media:null,method:null,min:null,minLength:he,multiple:We,muted:We,name:null,nonce:null,noModule:We,noValidate:We,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:We,optimum:he,pattern:null,ping:at,placeholder:null,playsInline:We,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:We,referrerPolicy:null,rel:at,required:We,reversed:We,rows:he,rowSpan:he,sandbox:at,scope:null,scoped:We,seamless:We,selected:We,shadowRootClonable:We,shadowRootDelegatesFocus:We,shadowRootMode:null,shape:null,size:he,sizes:null,slot:null,span:he,spellCheck:Ot,src:null,srcDoc:null,srcLang:null,srcSet:null,start:he,step:null,style:null,tabIndex:he,target:null,title:null,translate:null,type:null,typeMustMatch:We,useMap:null,value:Ot,width:he,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:at,axis:null,background:null,bgColor:null,border:he,borderColor:null,bottomMargin:he,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:We,declare:We,event:null,face:null,frame:null,frameBorder:null,hSpace:he,leftMargin:he,link:null,longDesc:null,lowSrc:null,marginHeight:he,marginWidth:he,noResize:We,noHref:We,noShade:We,noWrap:We,object:null,profile:null,prompt:null,rev:null,rightMargin:he,rules:null,scheme:null,scrolling:Ot,standby:null,summary:null,text:null,topMargin:he,valueType:null,version:null,vAlign:null,vLink:null,vSpace:he,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:We,disableRemotePlayback:We,prefix:null,property:null,results:he,security:null,unselectable:null},space:"html",transform:r0}),dR=ei({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",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",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",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",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",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",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:_n,accentHeight:he,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:he,amplitude:he,arabicForm:null,ascent:he,attributeName:null,attributeType:null,azimuth:he,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:he,by:null,calcMode:null,capHeight:he,className:at,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:he,diffuseConstant:he,direction:null,display:null,dur:null,divisor:he,dominantBaseline:null,download:We,dx:null,dy:null,edgeMode:null,editable:null,elevation:he,enableBackground:null,end:null,event:null,exponent:he,externalResourcesRequired:null,fill:null,fillOpacity:he,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:Fs,g2:Fs,glyphName:Fs,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:he,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:he,horizOriginX:he,horizOriginY:he,id:null,ideographic:he,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:he,k:he,k1:he,k2:he,k3:he,k4:he,kernelMatrix:_n,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:he,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:he,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:he,overlineThickness:he,paintOrder:null,panose1:null,path:null,pathLength:he,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:at,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:he,pointsAtY:he,pointsAtZ:he,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:_n,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:_n,rev:_n,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:_n,requiredFeatures:_n,requiredFonts:_n,requiredFormats:_n,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:he,specularExponent:he,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:he,strikethroughThickness:he,string:null,stroke:null,strokeDashArray:_n,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:he,strokeOpacity:he,strokeWidth:null,style:null,surfaceScale:he,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:_n,tabIndex:he,tableValues:null,target:null,targetX:he,targetY:he,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:_n,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:he,underlineThickness:he,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:he,values:null,vAlphabetic:he,vMathematical:he,vectorEffect:null,vHanging:he,vIdeographic:he,version:null,vertAdvY:he,vertOriginX:he,vertOriginY:he,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:he,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:n0}),o0=ei({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(e,t){return"xlink:"+t.slice(5).toLowerCase()}}),s0=ei({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:r0}),i0=ei({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),fR={classId:"classID",dataType:"datatype",itemId:"itemID",strokeDashArray:"strokeDasharray",strokeDashOffset:"strokeDashoffset",strokeLineCap:"strokeLinecap",strokeLineJoin:"strokeLinejoin",strokeMiterLimit:"strokeMiterlimit",typeOf:"typeof",xLinkActuate:"xlinkActuate",xLinkArcRole:"xlinkArcrole",xLinkHref:"xlinkHref",xLinkRole:"xlinkRole",xLinkShow:"xlinkShow",xLinkTitle:"xlinkTitle",xLinkType:"xlinkType",xmlnsXLink:"xmlnsXlink"},pR=/[A-Z]/g,yy=/-[a-z]/g,hR=/^data[-\w.:]+$/i;function mR(e,t){const n=sp(t);let o=t,a=Rn;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&hR.test(t)){if(t.charAt(4)==="-"){const l=t.slice(5).replace(yy,xR);o="data"+l.charAt(0).toUpperCase()+l.slice(1)}else{const l=t.slice(4);if(!yy.test(l)){let c=l.replace(pR,gR);c.charAt(0)!=="-"&&(c="-"+c),t="data"+c}}a=dh}return new a(o,t)}function gR(e){return"-"+e.toLowerCase()}function xR(e){return e.charAt(1).toUpperCase()}const yR=e0([t0,uR,o0,s0,i0],"html"),fh=e0([t0,dR,o0,s0,i0],"svg");function vR(e){return e.join(" ").trim()}var Ds={},gf,vy;function bR(){if(vy)return gf;vy=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,t=/\n/g,n=/^\s*/,o=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,a=/^:\s*/,l=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,c=/^[;\s]*/,d=/^\s+|\s+$/g,p=`
460
+ `,m="/",h="*",x="",v="comment",b="declaration";function C(j,S){if(typeof j!="string")throw new TypeError("First argument must be a string");if(!j)return[];S=S||{};var R=1,N=1;function A(J){var _=J.match(t);_&&(R+=_.length);var F=J.lastIndexOf(p);N=~F?J.length-F:N+J.length}function O(){var J={line:R,column:N};return function(_){return _.position=new T(J),G(),_}}function T(J){this.start=J,this.end={line:R,column:N},this.source=S.source}T.prototype.content=j;function D(J){var _=new Error(S.source+":"+R+":"+N+": "+J);if(_.reason=J,_.filename=S.source,_.line=R,_.column=N,_.source=j,!S.silent)throw _}function L(J){var _=J.exec(j);if(_){var F=_[0];return A(F),j=j.slice(F.length),_}}function G(){L(n)}function re(J){var _;for(J=J||[];_=z();)_!==!1&&J.push(_);return J}function z(){var J=O();if(!(m!=j.charAt(0)||h!=j.charAt(1))){for(var _=2;x!=j.charAt(_)&&(h!=j.charAt(_)||m!=j.charAt(_+1));)++_;if(_+=2,x===j.charAt(_-1))return D("End of comment missing");var F=j.slice(2,_-2);return N+=2,A(F),j=j.slice(_),N+=2,J({type:v,comment:F})}}function K(){var J=O(),_=L(o);if(_){if(z(),!L(a))return D("property missing ':'");var F=L(l),B=J({type:b,property:k(_[0].replace(e,x)),value:F?k(F[0].replace(e,x)):x});return L(c),B}}function q(){var J=[];re(J);for(var _;_=K();)_!==!1&&(J.push(_),re(J));return J}return G(),q()}function k(j){return j?j.replace(d,x):x}return gf=C,gf}var by;function wR(){if(by)return Ds;by=1;var e=Ds&&Ds.__importDefault||function(o){return o&&o.__esModule?o:{default:o}};Object.defineProperty(Ds,"__esModule",{value:!0}),Ds.default=n;const t=e(bR());function n(o,a){let l=null;if(!o||typeof o!="string")return l;const c=(0,t.default)(o),d=typeof a=="function";return c.forEach(p=>{if(p.type!=="declaration")return;const{property:m,value:h}=p;d?a(m,h,p):h&&(l=l||{},l[m]=h)}),l}return Ds}var Ki={},wy;function kR(){if(wy)return Ki;wy=1,Object.defineProperty(Ki,"__esModule",{value:!0}),Ki.camelCase=void 0;var e=/^--[a-zA-Z0-9_-]+$/,t=/-([a-z])/g,n=/^[^-]+$/,o=/^-(webkit|moz|ms|o|khtml)-/,a=/^-(ms)-/,l=function(m){return!m||n.test(m)||e.test(m)},c=function(m,h){return h.toUpperCase()},d=function(m,h){return"".concat(h,"-")},p=function(m,h){return h===void 0&&(h={}),l(m)?m:(m=m.toLowerCase(),h.reactCompat?m=m.replace(a,d):m=m.replace(o,d),m.replace(t,c))};return Ki.camelCase=p,Ki}var Gi,ky;function jR(){if(ky)return Gi;ky=1;var e=Gi&&Gi.__importDefault||function(a){return a&&a.__esModule?a:{default:a}},t=e(wR()),n=kR();function o(a,l){var c={};return!a||typeof a!="string"||(0,t.default)(a,function(d,p){d&&p&&(c[(0,n.camelCase)(d,l)]=p)}),c}return o.default=o,Gi=o,Gi}var SR=jR();const NR=Rc(SR),a0=l0("end"),ph=l0("start");function l0(e){return t;function t(n){const o=n&&n.position&&n.position[e]||{};if(typeof o.line=="number"&&o.line>0&&typeof o.column=="number"&&o.column>0)return{line:o.line,column:o.column,offset:typeof o.offset=="number"&&o.offset>-1?o.offset:void 0}}}function CR(e){const t=ph(e),n=a0(e);if(t&&n)return{start:t,end:n}}function na(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?jy(e.position):"start"in e||"end"in e?jy(e):"line"in e||"column"in e?lp(e):""}function lp(e){return Sy(e&&e.line)+":"+Sy(e&&e.column)}function jy(e){return lp(e&&e.start)+"-"+lp(e&&e.end)}function Sy(e){return e&&typeof e=="number"?e:1}class hn extends Error{constructor(t,n,o){super(),typeof n=="string"&&(o=n,n=void 0);let a="",l={},c=!1;if(n&&("line"in n&&"column"in n?l={place:n}:"start"in n&&"end"in n?l={place:n}:"type"in n?l={ancestors:[n],place:n.position}:l={...n}),typeof t=="string"?a=t:!l.cause&&t&&(c=!0,a=t.message,l.cause=t),!l.ruleId&&!l.source&&typeof o=="string"){const p=o.indexOf(":");p===-1?l.ruleId=o:(l.source=o.slice(0,p),l.ruleId=o.slice(p+1))}if(!l.place&&l.ancestors&&l.ancestors){const p=l.ancestors[l.ancestors.length-1];p&&(l.place=p.position)}const d=l.place&&"start"in l.place?l.place.start:l.place;this.ancestors=l.ancestors||void 0,this.cause=l.cause||void 0,this.column=d?d.column:void 0,this.fatal=void 0,this.file="",this.message=a,this.line=d?d.line:void 0,this.name=na(l.place)||"1:1",this.place=l.place||void 0,this.reason=this.message,this.ruleId=l.ruleId||void 0,this.source=l.source||void 0,this.stack=c&&l.cause&&typeof l.cause.stack=="string"?l.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}hn.prototype.file="";hn.prototype.name="";hn.prototype.reason="";hn.prototype.message="";hn.prototype.stack="";hn.prototype.column=void 0;hn.prototype.line=void 0;hn.prototype.ancestors=void 0;hn.prototype.cause=void 0;hn.prototype.fatal=void 0;hn.prototype.place=void 0;hn.prototype.ruleId=void 0;hn.prototype.source=void 0;const hh={}.hasOwnProperty,ER=new Map,PR=/[A-Z]/g,TR=new Set(["table","tbody","thead","tfoot","tr"]),RR=new Set(["td","th"]),c0="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function AR(e,t){if(!t||t.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const n=t.filePath||void 0;let o;if(t.development){if(typeof t.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");o=FR(n,t.jsxDEV)}else{if(typeof t.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof t.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");o=$R(n,t.jsx,t.jsxs)}const a={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:o,elementAttributeNameCase:t.elementAttributeNameCase||"react",evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space==="svg"?fh:yR,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},l=u0(a,e,void 0);return l&&typeof l!="string"?l:a.create(e,a.Fragment,{children:l||void 0},void 0)}function u0(e,t,n){if(t.type==="element")return DR(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return IR(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return LR(e,t,n);if(t.type==="mdxjsEsm")return OR(e,t);if(t.type==="root")return MR(e,t,n);if(t.type==="text")return _R(e,t)}function DR(e,t,n){const o=e.schema;let a=o;t.tagName.toLowerCase()==="svg"&&o.space==="html"&&(a=fh,e.schema=a),e.ancestors.push(t);const l=f0(e,t.tagName,!1),c=zR(e,t);let d=gh(e,t);return TR.has(t.tagName)&&(d=d.filter(function(p){return typeof p=="string"?!lR(p):!0})),d0(e,c,l,t),mh(c,d),e.ancestors.pop(),e.schema=o,e.create(t,l,c,n)}function IR(e,t){if(t.data&&t.data.estree&&e.evaluater){const o=t.data.estree.body[0];return o.type,e.evaluater.evaluateExpression(o.expression)}ga(e,t.position)}function OR(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);ga(e,t.position)}function LR(e,t,n){const o=e.schema;let a=o;t.name==="svg"&&o.space==="html"&&(a=fh,e.schema=a),e.ancestors.push(t);const l=t.name===null?e.Fragment:f0(e,t.name,!0),c=BR(e,t),d=gh(e,t);return d0(e,c,l,t),mh(c,d),e.ancestors.pop(),e.schema=o,e.create(t,l,c,n)}function MR(e,t,n){const o={};return mh(o,gh(e,t)),e.create(t,e.Fragment,o,n)}function _R(e,t){return t.value}function d0(e,t,n,o){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=o)}function mh(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function $R(e,t,n){return o;function o(a,l,c,d){const m=Array.isArray(c.children)?n:t;return d?m(l,c,d):m(l,c)}}function FR(e,t){return n;function n(o,a,l,c){const d=Array.isArray(l.children),p=ph(o);return t(a,l,c,d,{columnNumber:p?p.column-1:void 0,fileName:e,lineNumber:p?p.line:void 0},void 0)}}function zR(e,t){const n={};let o,a;for(a in t.properties)if(a!=="children"&&hh.call(t.properties,a)){const l=UR(e,a,t.properties[a]);if(l){const[c,d]=l;e.tableCellAlignToStyle&&c==="align"&&typeof d=="string"&&RR.has(t.tagName)?o=d:n[c]=d}}if(o){const l=n.style||(n.style={});l[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=o}return n}function BR(e,t){const n={};for(const o of t.attributes)if(o.type==="mdxJsxExpressionAttribute")if(o.data&&o.data.estree&&e.evaluater){const l=o.data.estree.body[0];l.type;const c=l.expression;c.type;const d=c.properties[0];d.type,Object.assign(n,e.evaluater.evaluateExpression(d.argument))}else ga(e,t.position);else{const a=o.name;let l;if(o.value&&typeof o.value=="object")if(o.value.data&&o.value.data.estree&&e.evaluater){const d=o.value.data.estree.body[0];d.type,l=e.evaluater.evaluateExpression(d.expression)}else ga(e,t.position);else l=o.value===null?!0:o.value;n[a]=l}return n}function gh(e,t){const n=[];let o=-1;const a=e.passKeys?new Map:ER;for(;++o<t.children.length;){const l=t.children[o];let c;if(e.passKeys){const p=l.type==="element"?l.tagName:l.type==="mdxJsxFlowElement"||l.type==="mdxJsxTextElement"?l.name:void 0;if(p){const m=a.get(p)||0;c=p+"-"+m,a.set(p,m+1)}}const d=u0(e,l,c);d!==void 0&&n.push(d)}return n}function UR(e,t,n){const o=mR(e.schema,t);if(!(n==null||typeof n=="number"&&Number.isNaN(n))){if(Array.isArray(n)&&(n=o.commaSeparated?rR(n):vR(n)),o.property==="style"){let a=typeof n=="object"?n:HR(e,String(n));return e.stylePropertyNameCase==="css"&&(a=WR(a)),["style",a]}return[e.elementAttributeNameCase==="react"&&o.space?fR[o.property]||o.property:o.attribute,n]}}function HR(e,t){try{return NR(t,{reactCompat:!0})}catch(n){if(e.ignoreInvalidStyle)return{};const o=n,a=new hn("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:o,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw a.file=e.filePath||void 0,a.url=c0+"#cannot-parse-style-attribute",a}}function f0(e,t,n){let o;if(!n)o={type:"Literal",value:t};else if(t.includes(".")){const a=t.split(".");let l=-1,c;for(;++l<a.length;){const d=my(a[l])?{type:"Identifier",name:a[l]}:{type:"Literal",value:a[l]};c=c?{type:"MemberExpression",object:c,property:d,computed:!!(l&&d.type==="Literal"),optional:!1}:d}o=c}else o=my(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(o.type==="Literal"){const a=o.value;return hh.call(e.components,a)?e.components[a]:a}if(e.evaluater)return e.evaluater.evaluateExpression(o);ga(e)}function ga(e,t){const n=new hn("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:t,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw n.file=e.filePath||void 0,n.url=c0+"#cannot-handle-mdx-estrees-without-createevaluater",n}function WR(e){const t={};let n;for(n in e)hh.call(e,n)&&(t[VR(n)]=e[n]);return t}function VR(e){let t=e.replace(PR,qR);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function qR(e){return"-"+e.toLowerCase()}const xf={action:["form"],cite:["blockquote","del","ins","q"],data:["object"],formAction:["button","input"],href:["a","area","base","link"],icon:["menuitem"],itemId:null,manifest:["html"],ping:["a","area"],poster:["video"],src:["audio","embed","iframe","img","input","script","source","track","video"]},KR={};function GR(e,t){const n=KR,o=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,a=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return p0(e,o,a)}function p0(e,t,n){if(YR(e)){if("value"in e)return e.type==="html"&&!n?"":e.value;if(t&&"alt"in e&&e.alt)return e.alt;if("children"in e)return Ny(e.children,t,n)}return Array.isArray(e)?Ny(e,t,n):""}function Ny(e,t,n){const o=[];let a=-1;for(;++a<e.length;)o[a]=p0(e[a],t,n);return o.join("")}function YR(e){return!!(e&&typeof e=="object")}const Cy=document.createElement("i");function xh(e){const t="&"+e+";";Cy.innerHTML=t;const n=Cy.textContent;return n.charCodeAt(n.length-1)===59&&e!=="semi"||n===t?!1:n}function Rr(e,t,n,o){const a=e.length;let l=0,c;if(t<0?t=-t>a?0:a+t:t=t>a?a:t,n=n>0?n:0,o.length<1e4)c=Array.from(o),c.unshift(t,n),e.splice(...c);else for(n&&e.splice(t,n);l<o.length;)c=o.slice(l,l+1e4),c.unshift(t,0),e.splice(...c),l+=1e4,t+=1e4}function Jn(e,t){return e.length>0?(Rr(e,e.length,0,t),e):t}const Ey={}.hasOwnProperty;function XR(e){const t={};let n=-1;for(;++n<e.length;)QR(t,e[n]);return t}function QR(e,t){let n;for(n in t){const a=(Ey.call(e,n)?e[n]:void 0)||(e[n]={}),l=t[n];let c;if(l)for(c in l){Ey.call(a,c)||(a[c]=[]);const d=l[c];JR(a[c],Array.isArray(d)?d:d?[d]:[])}}}function JR(e,t){let n=-1;const o=[];for(;++n<t.length;)(t[n].add==="after"?e:o).push(t[n]);Rr(e,0,0,o)}function h0(e,t){const n=Number.parseInt(e,t);return n<9||n===11||n>13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)===65535||(n&65535)===65534||n>1114111?"�":String.fromCodePoint(n)}function zs(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const Sr=Do(/[A-Za-z]/),Fn=Do(/[\dA-Za-z]/),ZR=Do(/[#-'*+\--9=?A-Z^-~]/);function cp(e){return e!==null&&(e<32||e===127)}const up=Do(/\d/),eA=Do(/[\dA-Fa-f]/),tA=Do(/[!-/:-@[-`{-~]/);function Fe(e){return e!==null&&e<-2}function Tn(e){return e!==null&&(e<0||e===32)}function et(e){return e===-2||e===-1||e===32}const nA=Do(new RegExp("\\p{P}|\\p{S}","u")),rA=Do(/\s/);function Do(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function ti(e){const t=[];let n=-1,o=0,a=0;for(;++n<e.length;){const l=e.charCodeAt(n);let c="";if(l===37&&Fn(e.charCodeAt(n+1))&&Fn(e.charCodeAt(n+2)))a=2;else if(l<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(l))||(c=String.fromCharCode(l));else if(l>55295&&l<57344){const d=e.charCodeAt(n+1);l<56320&&d>56319&&d<57344?(c=String.fromCharCode(l,d),a=1):c="�"}else c=String.fromCharCode(l);c&&(t.push(e.slice(o,n),encodeURIComponent(c)),o=n+a+1,c=""),a&&(n+=a,a=0)}return t.join("")+e.slice(o)}function lt(e,t,n,o){const a=o?o-1:Number.POSITIVE_INFINITY;let l=0;return c;function c(p){return et(p)?(e.enter(n),d(p)):t(p)}function d(p){return et(p)&&l++<a?(e.consume(p),d):(e.exit(n),t(p))}}const oA={tokenize:sA};function sA(e){const t=e.attempt(this.parser.constructs.contentInitial,o,a);let n;return t;function o(d){if(d===null){e.consume(d);return}return e.enter("lineEnding"),e.consume(d),e.exit("lineEnding"),lt(e,t,"linePrefix")}function a(d){return e.enter("paragraph"),l(d)}function l(d){const p=e.enter("chunkText",{contentType:"text",previous:n});return n&&(n.next=p),n=p,c(d)}function c(d){if(d===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(d);return}return Fe(d)?(e.consume(d),e.exit("chunkText"),l):(e.consume(d),c)}}const iA={tokenize:aA},Py={tokenize:lA};function aA(e){const t=this,n=[];let o=0,a,l,c;return d;function d(N){if(o<n.length){const A=n[o];return t.containerState=A[1],e.attempt(A[0].continuation,p,m)(N)}return m(N)}function p(N){if(o++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,a&&R();const A=t.events.length;let O=A,T;for(;O--;)if(t.events[O][0]==="exit"&&t.events[O][1].type==="chunkFlow"){T=t.events[O][1].end;break}S(o);let D=A;for(;D<t.events.length;)t.events[D][1].end={...T},D++;return Rr(t.events,O+1,0,t.events.slice(A)),t.events.length=D,m(N)}return d(N)}function m(N){if(o===n.length){if(!a)return v(N);if(a.currentConstruct&&a.currentConstruct.concrete)return C(N);t.interrupt=!!(a.currentConstruct&&!a._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(Py,h,x)(N)}function h(N){return a&&R(),S(o),v(N)}function x(N){return t.parser.lazy[t.now().line]=o!==n.length,c=t.now().offset,C(N)}function v(N){return t.containerState={},e.attempt(Py,b,C)(N)}function b(N){return o++,n.push([t.currentConstruct,t.containerState]),v(N)}function C(N){if(N===null){a&&R(),S(0),e.consume(N);return}return a=a||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:a,contentType:"flow",previous:l}),k(N)}function k(N){if(N===null){j(e.exit("chunkFlow"),!0),S(0),e.consume(N);return}return Fe(N)?(e.consume(N),j(e.exit("chunkFlow")),o=0,t.interrupt=void 0,d):(e.consume(N),k)}function j(N,A){const O=t.sliceStream(N);if(A&&O.push(null),N.previous=l,l&&(l.next=N),l=N,a.defineSkip(N.start),a.write(O),t.parser.lazy[N.start.line]){let T=a.events.length;for(;T--;)if(a.events[T][1].start.offset<c&&(!a.events[T][1].end||a.events[T][1].end.offset>c))return;const D=t.events.length;let L=D,G,re;for(;L--;)if(t.events[L][0]==="exit"&&t.events[L][1].type==="chunkFlow"){if(G){re=t.events[L][1].end;break}G=!0}for(S(o),T=D;T<t.events.length;)t.events[T][1].end={...re},T++;Rr(t.events,L+1,0,t.events.slice(D)),t.events.length=T}}function S(N){let A=n.length;for(;A-- >N;){const O=n[A];t.containerState=O[1],O[0].exit.call(t,e)}n.length=N}function R(){a.write([null]),l=void 0,a=void 0,t.containerState._closeFlow=void 0}}function lA(e,t,n){return lt(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function Ty(e){if(e===null||Tn(e)||rA(e))return 1;if(nA(e))return 2}function yh(e,t,n){const o=[];let a=-1;for(;++a<e.length;){const l=e[a].resolveAll;l&&!o.includes(l)&&(t=l(t,n),o.push(l))}return t}const dp={name:"attention",resolveAll:cA,tokenize:uA};function cA(e,t){let n=-1,o,a,l,c,d,p,m,h;for(;++n<e.length;)if(e[n][0]==="enter"&&e[n][1].type==="attentionSequence"&&e[n][1]._close){for(o=n;o--;)if(e[o][0]==="exit"&&e[o][1].type==="attentionSequence"&&e[o][1]._open&&t.sliceSerialize(e[o][1]).charCodeAt(0)===t.sliceSerialize(e[n][1]).charCodeAt(0)){if((e[o][1]._close||e[n][1]._open)&&(e[n][1].end.offset-e[n][1].start.offset)%3&&!((e[o][1].end.offset-e[o][1].start.offset+e[n][1].end.offset-e[n][1].start.offset)%3))continue;p=e[o][1].end.offset-e[o][1].start.offset>1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;const x={...e[o][1].end},v={...e[n][1].start};Ry(x,-p),Ry(v,p),c={type:p>1?"strongSequence":"emphasisSequence",start:x,end:{...e[o][1].end}},d={type:p>1?"strongSequence":"emphasisSequence",start:{...e[n][1].start},end:v},l={type:p>1?"strongText":"emphasisText",start:{...e[o][1].end},end:{...e[n][1].start}},a={type:p>1?"strong":"emphasis",start:{...c.start},end:{...d.end}},e[o][1].end={...c.start},e[n][1].start={...d.end},m=[],e[o][1].end.offset-e[o][1].start.offset&&(m=Jn(m,[["enter",e[o][1],t],["exit",e[o][1],t]])),m=Jn(m,[["enter",a,t],["enter",c,t],["exit",c,t],["enter",l,t]]),m=Jn(m,yh(t.parser.constructs.insideSpan.null,e.slice(o+1,n),t)),m=Jn(m,[["exit",l,t],["enter",d,t],["exit",d,t],["exit",a,t]]),e[n][1].end.offset-e[n][1].start.offset?(h=2,m=Jn(m,[["enter",e[n][1],t],["exit",e[n][1],t]])):h=0,Rr(e,o-1,n-o+3,m),n=o+m.length-h-2;break}}for(n=-1;++n<e.length;)e[n][1].type==="attentionSequence"&&(e[n][1].type="data");return e}function uA(e,t){const n=this.parser.constructs.attentionMarkers.null,o=this.previous,a=Ty(o);let l;return c;function c(p){return l=p,e.enter("attentionSequence"),d(p)}function d(p){if(p===l)return e.consume(p),d;const m=e.exit("attentionSequence"),h=Ty(p),x=!h||h===2&&a||n.includes(p),v=!a||a===2&&h||n.includes(o);return m._open=!!(l===42?x:x&&(a||!v)),m._close=!!(l===42?v:v&&(h||!x)),t(p)}}function Ry(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const dA={name:"autolink",tokenize:fA};function fA(e,t,n){let o=0;return a;function a(b){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(b),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),l}function l(b){return Sr(b)?(e.consume(b),c):b===64?n(b):m(b)}function c(b){return b===43||b===45||b===46||Fn(b)?(o=1,d(b)):m(b)}function d(b){return b===58?(e.consume(b),o=0,p):(b===43||b===45||b===46||Fn(b))&&o++<32?(e.consume(b),d):(o=0,m(b))}function p(b){return b===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(b),e.exit("autolinkMarker"),e.exit("autolink"),t):b===null||b===32||b===60||cp(b)?n(b):(e.consume(b),p)}function m(b){return b===64?(e.consume(b),h):ZR(b)?(e.consume(b),m):n(b)}function h(b){return Fn(b)?x(b):n(b)}function x(b){return b===46?(e.consume(b),o=0,h):b===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(b),e.exit("autolinkMarker"),e.exit("autolink"),t):v(b)}function v(b){if((b===45||Fn(b))&&o++<63){const C=b===45?v:x;return e.consume(b),C}return n(b)}}const Vc={partial:!0,tokenize:pA};function pA(e,t,n){return o;function o(l){return et(l)?lt(e,a,"linePrefix")(l):a(l)}function a(l){return l===null||Fe(l)?t(l):n(l)}}const m0={continuation:{tokenize:mA},exit:gA,name:"blockQuote",tokenize:hA};function hA(e,t,n){const o=this;return a;function a(c){if(c===62){const d=o.containerState;return d.open||(e.enter("blockQuote",{_container:!0}),d.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(c),e.exit("blockQuoteMarker"),l}return n(c)}function l(c){return et(c)?(e.enter("blockQuotePrefixWhitespace"),e.consume(c),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(c))}}function mA(e,t,n){const o=this;return a;function a(c){return et(c)?lt(e,l,"linePrefix",o.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(c):l(c)}function l(c){return e.attempt(m0,t,n)(c)}}function gA(e){e.exit("blockQuote")}const g0={name:"characterEscape",tokenize:xA};function xA(e,t,n){return o;function o(l){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(l),e.exit("escapeMarker"),a}function a(l){return tA(l)?(e.enter("characterEscapeValue"),e.consume(l),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(l)}}const x0={name:"characterReference",tokenize:yA};function yA(e,t,n){const o=this;let a=0,l,c;return d;function d(x){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(x),e.exit("characterReferenceMarker"),p}function p(x){return x===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(x),e.exit("characterReferenceMarkerNumeric"),m):(e.enter("characterReferenceValue"),l=31,c=Fn,h(x))}function m(x){return x===88||x===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(x),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),l=6,c=eA,h):(e.enter("characterReferenceValue"),l=7,c=up,h(x))}function h(x){if(x===59&&a){const v=e.exit("characterReferenceValue");return c===Fn&&!xh(o.sliceSerialize(v))?n(x):(e.enter("characterReferenceMarker"),e.consume(x),e.exit("characterReferenceMarker"),e.exit("characterReference"),t)}return c(x)&&a++<l?(e.consume(x),h):n(x)}}const Ay={partial:!0,tokenize:bA},Dy={concrete:!0,name:"codeFenced",tokenize:vA};function vA(e,t,n){const o=this,a={partial:!0,tokenize:O};let l=0,c=0,d;return p;function p(T){return m(T)}function m(T){const D=o.events[o.events.length-1];return l=D&&D[1].type==="linePrefix"?D[2].sliceSerialize(D[1],!0).length:0,d=T,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),h(T)}function h(T){return T===d?(c++,e.consume(T),h):c<3?n(T):(e.exit("codeFencedFenceSequence"),et(T)?lt(e,x,"whitespace")(T):x(T))}function x(T){return T===null||Fe(T)?(e.exit("codeFencedFence"),o.interrupt?t(T):e.check(Ay,k,A)(T)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),v(T))}function v(T){return T===null||Fe(T)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),x(T)):et(T)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),lt(e,b,"whitespace")(T)):T===96&&T===d?n(T):(e.consume(T),v)}function b(T){return T===null||Fe(T)?x(T):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),C(T))}function C(T){return T===null||Fe(T)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),x(T)):T===96&&T===d?n(T):(e.consume(T),C)}function k(T){return e.attempt(a,A,j)(T)}function j(T){return e.enter("lineEnding"),e.consume(T),e.exit("lineEnding"),S}function S(T){return l>0&&et(T)?lt(e,R,"linePrefix",l+1)(T):R(T)}function R(T){return T===null||Fe(T)?e.check(Ay,k,A)(T):(e.enter("codeFlowValue"),N(T))}function N(T){return T===null||Fe(T)?(e.exit("codeFlowValue"),R(T)):(e.consume(T),N)}function A(T){return e.exit("codeFenced"),t(T)}function O(T,D,L){let G=0;return re;function re(_){return T.enter("lineEnding"),T.consume(_),T.exit("lineEnding"),z}function z(_){return T.enter("codeFencedFence"),et(_)?lt(T,K,"linePrefix",o.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(_):K(_)}function K(_){return _===d?(T.enter("codeFencedFenceSequence"),q(_)):L(_)}function q(_){return _===d?(G++,T.consume(_),q):G>=c?(T.exit("codeFencedFenceSequence"),et(_)?lt(T,J,"whitespace")(_):J(_)):L(_)}function J(_){return _===null||Fe(_)?(T.exit("codeFencedFence"),D(_)):L(_)}}}function bA(e,t,n){const o=this;return a;function a(c){return c===null?n(c):(e.enter("lineEnding"),e.consume(c),e.exit("lineEnding"),l)}function l(c){return o.parser.lazy[o.now().line]?n(c):t(c)}}const yf={name:"codeIndented",tokenize:kA},wA={partial:!0,tokenize:jA};function kA(e,t,n){const o=this;return a;function a(m){return e.enter("codeIndented"),lt(e,l,"linePrefix",5)(m)}function l(m){const h=o.events[o.events.length-1];return h&&h[1].type==="linePrefix"&&h[2].sliceSerialize(h[1],!0).length>=4?c(m):n(m)}function c(m){return m===null?p(m):Fe(m)?e.attempt(wA,c,p)(m):(e.enter("codeFlowValue"),d(m))}function d(m){return m===null||Fe(m)?(e.exit("codeFlowValue"),c(m)):(e.consume(m),d)}function p(m){return e.exit("codeIndented"),t(m)}}function jA(e,t,n){const o=this;return a;function a(c){return o.parser.lazy[o.now().line]?n(c):Fe(c)?(e.enter("lineEnding"),e.consume(c),e.exit("lineEnding"),a):lt(e,l,"linePrefix",5)(c)}function l(c){const d=o.events[o.events.length-1];return d&&d[1].type==="linePrefix"&&d[2].sliceSerialize(d[1],!0).length>=4?t(c):Fe(c)?a(c):n(c)}}const SA={name:"codeText",previous:CA,resolve:NA,tokenize:EA};function NA(e){let t=e.length-4,n=3,o,a;if((e[n][1].type==="lineEnding"||e[n][1].type==="space")&&(e[t][1].type==="lineEnding"||e[t][1].type==="space")){for(o=n;++o<t;)if(e[o][1].type==="codeTextData"){e[n][1].type="codeTextPadding",e[t][1].type="codeTextPadding",n+=2,t-=2;break}}for(o=n-1,t++;++o<=t;)a===void 0?o!==t&&e[o][1].type!=="lineEnding"&&(a=o):(o===t||e[o][1].type==="lineEnding")&&(e[a][1].type="codeTextData",o!==a+2&&(e[a][1].end=e[o-1][1].end,e.splice(a+2,o-a-2),t-=o-a-2,o=a+2),a=void 0);return e}function CA(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function EA(e,t,n){let o=0,a,l;return c;function c(x){return e.enter("codeText"),e.enter("codeTextSequence"),d(x)}function d(x){return x===96?(e.consume(x),o++,d):(e.exit("codeTextSequence"),p(x))}function p(x){return x===null?n(x):x===32?(e.enter("space"),e.consume(x),e.exit("space"),p):x===96?(l=e.enter("codeTextSequence"),a=0,h(x)):Fe(x)?(e.enter("lineEnding"),e.consume(x),e.exit("lineEnding"),p):(e.enter("codeTextData"),m(x))}function m(x){return x===null||x===32||x===96||Fe(x)?(e.exit("codeTextData"),p(x)):(e.consume(x),m)}function h(x){return x===96?(e.consume(x),a++,h):a===o?(e.exit("codeTextSequence"),e.exit("codeText"),t(x)):(l.type="codeTextData",m(x))}}class PA{constructor(t){this.left=t?[...t]:[],this.right=[]}get(t){if(t<0||t>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+t+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return t<this.left.length?this.left[t]:this.right[this.right.length-t+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(t,n){const o=n??Number.POSITIVE_INFINITY;return o<this.left.length?this.left.slice(t,o):t>this.left.length?this.right.slice(this.right.length-o+this.left.length,this.right.length-t+this.left.length).reverse():this.left.slice(t).concat(this.right.slice(this.right.length-o+this.left.length).reverse())}splice(t,n,o){const a=n||0;this.setCursor(Math.trunc(t));const l=this.right.splice(this.right.length-a,Number.POSITIVE_INFINITY);return o&&Yi(this.left,o),l.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(t){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(t)}pushMany(t){this.setCursor(Number.POSITIVE_INFINITY),Yi(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),Yi(this.right,t.reverse())}setCursor(t){if(!(t===this.left.length||t>this.left.length&&this.right.length===0||t<0&&this.left.length===0))if(t<this.left.length){const n=this.left.splice(t,Number.POSITIVE_INFINITY);Yi(this.right,n.reverse())}else{const n=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);Yi(this.left,n.reverse())}}}function Yi(e,t){let n=0;if(t.length<1e4)e.push(...t);else for(;n<t.length;)e.push(...t.slice(n,n+1e4)),n+=1e4}function y0(e){const t={};let n=-1,o,a,l,c,d,p,m;const h=new PA(e);for(;++n<h.length;){for(;n in t;)n=t[n];if(o=h.get(n),n&&o[1].type==="chunkFlow"&&h.get(n-1)[1].type==="listItemPrefix"&&(p=o[1]._tokenizer.events,l=0,l<p.length&&p[l][1].type==="lineEndingBlank"&&(l+=2),l<p.length&&p[l][1].type==="content"))for(;++l<p.length&&p[l][1].type!=="content";)p[l][1].type==="chunkText"&&(p[l][1]._isInFirstContentOfListItem=!0,l++);if(o[0]==="enter")o[1].contentType&&(Object.assign(t,TA(h,n)),n=t[n],m=!0);else if(o[1]._container){for(l=n,a=void 0;l--;)if(c=h.get(l),c[1].type==="lineEnding"||c[1].type==="lineEndingBlank")c[0]==="enter"&&(a&&(h.get(a)[1].type="lineEndingBlank"),c[1].type="lineEnding",a=l);else if(!(c[1].type==="linePrefix"||c[1].type==="listItemIndent"))break;a&&(o[1].end={...h.get(a)[1].start},d=h.slice(a,n),d.unshift(o),h.splice(a,n-a+1,d))}}return Rr(e,0,Number.POSITIVE_INFINITY,h.slice(0)),!m}function TA(e,t){const n=e.get(t)[1],o=e.get(t)[2];let a=t-1;const l=[];let c=n._tokenizer;c||(c=o.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(c._contentTypeTextTrailing=!0));const d=c.events,p=[],m={};let h,x,v=-1,b=n,C=0,k=0;const j=[k];for(;b;){for(;e.get(++a)[1]!==b;);l.push(a),b._tokenizer||(h=o.sliceStream(b),b.next||h.push(null),x&&c.defineSkip(b.start),b._isInFirstContentOfListItem&&(c._gfmTasklistFirstContentOfListItem=!0),c.write(h),b._isInFirstContentOfListItem&&(c._gfmTasklistFirstContentOfListItem=void 0)),x=b,b=b.next}for(b=n;++v<d.length;)d[v][0]==="exit"&&d[v-1][0]==="enter"&&d[v][1].type===d[v-1][1].type&&d[v][1].start.line!==d[v][1].end.line&&(k=v+1,j.push(k),b._tokenizer=void 0,b.previous=void 0,b=b.next);for(c.events=[],b?(b._tokenizer=void 0,b.previous=void 0):j.pop(),v=j.length;v--;){const S=d.slice(j[v],j[v+1]),R=l.pop();p.push([R,R+S.length-1]),e.splice(R,2,S)}for(p.reverse(),v=-1;++v<p.length;)m[C+p[v][0]]=C+p[v][1],C+=p[v][1]-p[v][0]-1;return m}const RA={resolve:DA,tokenize:IA},AA={partial:!0,tokenize:OA};function DA(e){return y0(e),e}function IA(e,t){let n;return o;function o(d){return e.enter("content"),n=e.enter("chunkContent",{contentType:"content"}),a(d)}function a(d){return d===null?l(d):Fe(d)?e.check(AA,c,l)(d):(e.consume(d),a)}function l(d){return e.exit("chunkContent"),e.exit("content"),t(d)}function c(d){return e.consume(d),e.exit("chunkContent"),n.next=e.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,a}}function OA(e,t,n){const o=this;return a;function a(c){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(c),e.exit("lineEnding"),lt(e,l,"linePrefix")}function l(c){if(c===null||Fe(c))return n(c);const d=o.events[o.events.length-1];return!o.parser.constructs.disable.null.includes("codeIndented")&&d&&d[1].type==="linePrefix"&&d[2].sliceSerialize(d[1],!0).length>=4?t(c):e.interrupt(o.parser.constructs.flow,n,t)(c)}}function v0(e,t,n,o,a,l,c,d,p){const m=p||Number.POSITIVE_INFINITY;let h=0;return x;function x(S){return S===60?(e.enter(o),e.enter(a),e.enter(l),e.consume(S),e.exit(l),v):S===null||S===32||S===41||cp(S)?n(S):(e.enter(o),e.enter(c),e.enter(d),e.enter("chunkString",{contentType:"string"}),k(S))}function v(S){return S===62?(e.enter(l),e.consume(S),e.exit(l),e.exit(a),e.exit(o),t):(e.enter(d),e.enter("chunkString",{contentType:"string"}),b(S))}function b(S){return S===62?(e.exit("chunkString"),e.exit(d),v(S)):S===null||S===60||Fe(S)?n(S):(e.consume(S),S===92?C:b)}function C(S){return S===60||S===62||S===92?(e.consume(S),b):b(S)}function k(S){return!h&&(S===null||S===41||Tn(S))?(e.exit("chunkString"),e.exit(d),e.exit(c),e.exit(o),t(S)):h<m&&S===40?(e.consume(S),h++,k):S===41?(e.consume(S),h--,k):S===null||S===32||S===40||cp(S)?n(S):(e.consume(S),S===92?j:k)}function j(S){return S===40||S===41||S===92?(e.consume(S),k):k(S)}}function b0(e,t,n,o,a,l){const c=this;let d=0,p;return m;function m(b){return e.enter(o),e.enter(a),e.consume(b),e.exit(a),e.enter(l),h}function h(b){return d>999||b===null||b===91||b===93&&!p||b===94&&!d&&"_hiddenFootnoteSupport"in c.parser.constructs?n(b):b===93?(e.exit(l),e.enter(a),e.consume(b),e.exit(a),e.exit(o),t):Fe(b)?(e.enter("lineEnding"),e.consume(b),e.exit("lineEnding"),h):(e.enter("chunkString",{contentType:"string"}),x(b))}function x(b){return b===null||b===91||b===93||Fe(b)||d++>999?(e.exit("chunkString"),h(b)):(e.consume(b),p||(p=!et(b)),b===92?v:x)}function v(b){return b===91||b===92||b===93?(e.consume(b),d++,x):x(b)}}function w0(e,t,n,o,a,l){let c;return d;function d(v){return v===34||v===39||v===40?(e.enter(o),e.enter(a),e.consume(v),e.exit(a),c=v===40?41:v,p):n(v)}function p(v){return v===c?(e.enter(a),e.consume(v),e.exit(a),e.exit(o),t):(e.enter(l),m(v))}function m(v){return v===c?(e.exit(l),p(c)):v===null?n(v):Fe(v)?(e.enter("lineEnding"),e.consume(v),e.exit("lineEnding"),lt(e,m,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),h(v))}function h(v){return v===c||v===null||Fe(v)?(e.exit("chunkString"),m(v)):(e.consume(v),v===92?x:h)}function x(v){return v===c||v===92?(e.consume(v),h):h(v)}}function ra(e,t){let n;return o;function o(a){return Fe(a)?(e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),n=!0,o):et(a)?lt(e,o,n?"linePrefix":"lineSuffix")(a):t(a)}}const LA={name:"definition",tokenize:_A},MA={partial:!0,tokenize:$A};function _A(e,t,n){const o=this;let a;return l;function l(b){return e.enter("definition"),c(b)}function c(b){return b0.call(o,e,d,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(b)}function d(b){return a=zs(o.sliceSerialize(o.events[o.events.length-1][1]).slice(1,-1)),b===58?(e.enter("definitionMarker"),e.consume(b),e.exit("definitionMarker"),p):n(b)}function p(b){return Tn(b)?ra(e,m)(b):m(b)}function m(b){return v0(e,h,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(b)}function h(b){return e.attempt(MA,x,x)(b)}function x(b){return et(b)?lt(e,v,"whitespace")(b):v(b)}function v(b){return b===null||Fe(b)?(e.exit("definition"),o.parser.defined.push(a),t(b)):n(b)}}function $A(e,t,n){return o;function o(d){return Tn(d)?ra(e,a)(d):n(d)}function a(d){return w0(e,l,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(d)}function l(d){return et(d)?lt(e,c,"whitespace")(d):c(d)}function c(d){return d===null||Fe(d)?t(d):n(d)}}const FA={name:"hardBreakEscape",tokenize:zA};function zA(e,t,n){return o;function o(l){return e.enter("hardBreakEscape"),e.consume(l),a}function a(l){return Fe(l)?(e.exit("hardBreakEscape"),t(l)):n(l)}}const BA={name:"headingAtx",resolve:UA,tokenize:HA};function UA(e,t){let n=e.length-2,o=3,a,l;return e[o][1].type==="whitespace"&&(o+=2),n-2>o&&e[n][1].type==="whitespace"&&(n-=2),e[n][1].type==="atxHeadingSequence"&&(o===n-1||n-4>o&&e[n-2][1].type==="whitespace")&&(n-=o+1===n?2:4),n>o&&(a={type:"atxHeadingText",start:e[o][1].start,end:e[n][1].end},l={type:"chunkText",start:e[o][1].start,end:e[n][1].end,contentType:"text"},Rr(e,o,n-o+1,[["enter",a,t],["enter",l,t],["exit",l,t],["exit",a,t]])),e}function HA(e,t,n){let o=0;return a;function a(h){return e.enter("atxHeading"),l(h)}function l(h){return e.enter("atxHeadingSequence"),c(h)}function c(h){return h===35&&o++<6?(e.consume(h),c):h===null||Tn(h)?(e.exit("atxHeadingSequence"),d(h)):n(h)}function d(h){return h===35?(e.enter("atxHeadingSequence"),p(h)):h===null||Fe(h)?(e.exit("atxHeading"),t(h)):et(h)?lt(e,d,"whitespace")(h):(e.enter("atxHeadingText"),m(h))}function p(h){return h===35?(e.consume(h),p):(e.exit("atxHeadingSequence"),d(h))}function m(h){return h===null||h===35||Tn(h)?(e.exit("atxHeadingText"),d(h)):(e.consume(h),m)}}const WA=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],Iy=["pre","script","style","textarea"],VA={concrete:!0,name:"htmlFlow",resolveTo:GA,tokenize:YA},qA={partial:!0,tokenize:QA},KA={partial:!0,tokenize:XA};function GA(e){let t=e.length;for(;t--&&!(e[t][0]==="enter"&&e[t][1].type==="htmlFlow"););return t>1&&e[t-2][1].type==="linePrefix"&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e}function YA(e,t,n){const o=this;let a,l,c,d,p;return m;function m(I){return h(I)}function h(I){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(I),x}function x(I){return I===33?(e.consume(I),v):I===47?(e.consume(I),l=!0,k):I===63?(e.consume(I),a=3,o.interrupt?t:P):Sr(I)?(e.consume(I),c=String.fromCharCode(I),j):n(I)}function v(I){return I===45?(e.consume(I),a=2,b):I===91?(e.consume(I),a=5,d=0,C):Sr(I)?(e.consume(I),a=4,o.interrupt?t:P):n(I)}function b(I){return I===45?(e.consume(I),o.interrupt?t:P):n(I)}function C(I){const ge="CDATA[";return I===ge.charCodeAt(d++)?(e.consume(I),d===ge.length?o.interrupt?t:K:C):n(I)}function k(I){return Sr(I)?(e.consume(I),c=String.fromCharCode(I),j):n(I)}function j(I){if(I===null||I===47||I===62||Tn(I)){const ge=I===47,Se=c.toLowerCase();return!ge&&!l&&Iy.includes(Se)?(a=1,o.interrupt?t(I):K(I)):WA.includes(c.toLowerCase())?(a=6,ge?(e.consume(I),S):o.interrupt?t(I):K(I)):(a=7,o.interrupt&&!o.parser.lazy[o.now().line]?n(I):l?R(I):N(I))}return I===45||Fn(I)?(e.consume(I),c+=String.fromCharCode(I),j):n(I)}function S(I){return I===62?(e.consume(I),o.interrupt?t:K):n(I)}function R(I){return et(I)?(e.consume(I),R):re(I)}function N(I){return I===47?(e.consume(I),re):I===58||I===95||Sr(I)?(e.consume(I),A):et(I)?(e.consume(I),N):re(I)}function A(I){return I===45||I===46||I===58||I===95||Fn(I)?(e.consume(I),A):O(I)}function O(I){return I===61?(e.consume(I),T):et(I)?(e.consume(I),O):N(I)}function T(I){return I===null||I===60||I===61||I===62||I===96?n(I):I===34||I===39?(e.consume(I),p=I,D):et(I)?(e.consume(I),T):L(I)}function D(I){return I===p?(e.consume(I),p=null,G):I===null||Fe(I)?n(I):(e.consume(I),D)}function L(I){return I===null||I===34||I===39||I===47||I===60||I===61||I===62||I===96||Tn(I)?O(I):(e.consume(I),L)}function G(I){return I===47||I===62||et(I)?N(I):n(I)}function re(I){return I===62?(e.consume(I),z):n(I)}function z(I){return I===null||Fe(I)?K(I):et(I)?(e.consume(I),z):n(I)}function K(I){return I===45&&a===2?(e.consume(I),F):I===60&&a===1?(e.consume(I),B):I===62&&a===4?(e.consume(I),M):I===63&&a===3?(e.consume(I),P):I===93&&a===5?(e.consume(I),Z):Fe(I)&&(a===6||a===7)?(e.exit("htmlFlowData"),e.check(qA,Q,q)(I)):I===null||Fe(I)?(e.exit("htmlFlowData"),q(I)):(e.consume(I),K)}function q(I){return e.check(KA,J,Q)(I)}function J(I){return e.enter("lineEnding"),e.consume(I),e.exit("lineEnding"),_}function _(I){return I===null||Fe(I)?q(I):(e.enter("htmlFlowData"),K(I))}function F(I){return I===45?(e.consume(I),P):K(I)}function B(I){return I===47?(e.consume(I),c="",U):K(I)}function U(I){if(I===62){const ge=c.toLowerCase();return Iy.includes(ge)?(e.consume(I),M):K(I)}return Sr(I)&&c.length<8?(e.consume(I),c+=String.fromCharCode(I),U):K(I)}function Z(I){return I===93?(e.consume(I),P):K(I)}function P(I){return I===62?(e.consume(I),M):I===45&&a===2?(e.consume(I),P):K(I)}function M(I){return I===null||Fe(I)?(e.exit("htmlFlowData"),Q(I)):(e.consume(I),M)}function Q(I){return e.exit("htmlFlow"),t(I)}}function XA(e,t,n){const o=this;return a;function a(c){return Fe(c)?(e.enter("lineEnding"),e.consume(c),e.exit("lineEnding"),l):n(c)}function l(c){return o.parser.lazy[o.now().line]?n(c):t(c)}}function QA(e,t,n){return o;function o(a){return e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),e.attempt(Vc,t,n)}}const JA={name:"htmlText",tokenize:ZA};function ZA(e,t,n){const o=this;let a,l,c;return d;function d(P){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(P),p}function p(P){return P===33?(e.consume(P),m):P===47?(e.consume(P),O):P===63?(e.consume(P),N):Sr(P)?(e.consume(P),L):n(P)}function m(P){return P===45?(e.consume(P),h):P===91?(e.consume(P),l=0,C):Sr(P)?(e.consume(P),R):n(P)}function h(P){return P===45?(e.consume(P),b):n(P)}function x(P){return P===null?n(P):P===45?(e.consume(P),v):Fe(P)?(c=x,B(P)):(e.consume(P),x)}function v(P){return P===45?(e.consume(P),b):x(P)}function b(P){return P===62?F(P):P===45?v(P):x(P)}function C(P){const M="CDATA[";return P===M.charCodeAt(l++)?(e.consume(P),l===M.length?k:C):n(P)}function k(P){return P===null?n(P):P===93?(e.consume(P),j):Fe(P)?(c=k,B(P)):(e.consume(P),k)}function j(P){return P===93?(e.consume(P),S):k(P)}function S(P){return P===62?F(P):P===93?(e.consume(P),S):k(P)}function R(P){return P===null||P===62?F(P):Fe(P)?(c=R,B(P)):(e.consume(P),R)}function N(P){return P===null?n(P):P===63?(e.consume(P),A):Fe(P)?(c=N,B(P)):(e.consume(P),N)}function A(P){return P===62?F(P):N(P)}function O(P){return Sr(P)?(e.consume(P),T):n(P)}function T(P){return P===45||Fn(P)?(e.consume(P),T):D(P)}function D(P){return Fe(P)?(c=D,B(P)):et(P)?(e.consume(P),D):F(P)}function L(P){return P===45||Fn(P)?(e.consume(P),L):P===47||P===62||Tn(P)?G(P):n(P)}function G(P){return P===47?(e.consume(P),F):P===58||P===95||Sr(P)?(e.consume(P),re):Fe(P)?(c=G,B(P)):et(P)?(e.consume(P),G):F(P)}function re(P){return P===45||P===46||P===58||P===95||Fn(P)?(e.consume(P),re):z(P)}function z(P){return P===61?(e.consume(P),K):Fe(P)?(c=z,B(P)):et(P)?(e.consume(P),z):G(P)}function K(P){return P===null||P===60||P===61||P===62||P===96?n(P):P===34||P===39?(e.consume(P),a=P,q):Fe(P)?(c=K,B(P)):et(P)?(e.consume(P),K):(e.consume(P),J)}function q(P){return P===a?(e.consume(P),a=void 0,_):P===null?n(P):Fe(P)?(c=q,B(P)):(e.consume(P),q)}function J(P){return P===null||P===34||P===39||P===60||P===61||P===96?n(P):P===47||P===62||Tn(P)?G(P):(e.consume(P),J)}function _(P){return P===47||P===62||Tn(P)?G(P):n(P)}function F(P){return P===62?(e.consume(P),e.exit("htmlTextData"),e.exit("htmlText"),t):n(P)}function B(P){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(P),e.exit("lineEnding"),U}function U(P){return et(P)?lt(e,Z,"linePrefix",o.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(P):Z(P)}function Z(P){return e.enter("htmlTextData"),c(P)}}const vh={name:"labelEnd",resolveAll:r3,resolveTo:o3,tokenize:s3},e3={tokenize:i3},t3={tokenize:a3},n3={tokenize:l3};function r3(e){let t=-1;const n=[];for(;++t<e.length;){const o=e[t][1];if(n.push(e[t]),o.type==="labelImage"||o.type==="labelLink"||o.type==="labelEnd"){const a=o.type==="labelImage"?4:2;o.type="data",t+=a}}return e.length!==n.length&&Rr(e,0,e.length,n),e}function o3(e,t){let n=e.length,o=0,a,l,c,d;for(;n--;)if(a=e[n][1],l){if(a.type==="link"||a.type==="labelLink"&&a._inactive)break;e[n][0]==="enter"&&a.type==="labelLink"&&(a._inactive=!0)}else if(c){if(e[n][0]==="enter"&&(a.type==="labelImage"||a.type==="labelLink")&&!a._balanced&&(l=n,a.type!=="labelLink")){o=2;break}}else a.type==="labelEnd"&&(c=n);const p={type:e[l][1].type==="labelLink"?"link":"image",start:{...e[l][1].start},end:{...e[e.length-1][1].end}},m={type:"label",start:{...e[l][1].start},end:{...e[c][1].end}},h={type:"labelText",start:{...e[l+o+2][1].end},end:{...e[c-2][1].start}};return d=[["enter",p,t],["enter",m,t]],d=Jn(d,e.slice(l+1,l+o+3)),d=Jn(d,[["enter",h,t]]),d=Jn(d,yh(t.parser.constructs.insideSpan.null,e.slice(l+o+4,c-3),t)),d=Jn(d,[["exit",h,t],e[c-2],e[c-1],["exit",m,t]]),d=Jn(d,e.slice(c+1)),d=Jn(d,[["exit",p,t]]),Rr(e,l,e.length,d),e}function s3(e,t,n){const o=this;let a=o.events.length,l,c;for(;a--;)if((o.events[a][1].type==="labelImage"||o.events[a][1].type==="labelLink")&&!o.events[a][1]._balanced){l=o.events[a][1];break}return d;function d(v){return l?l._inactive?x(v):(c=o.parser.defined.includes(zs(o.sliceSerialize({start:l.end,end:o.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(v),e.exit("labelMarker"),e.exit("labelEnd"),p):n(v)}function p(v){return v===40?e.attempt(e3,h,c?h:x)(v):v===91?e.attempt(t3,h,c?m:x)(v):c?h(v):x(v)}function m(v){return e.attempt(n3,h,x)(v)}function h(v){return t(v)}function x(v){return l._balanced=!0,n(v)}}function i3(e,t,n){return o;function o(x){return e.enter("resource"),e.enter("resourceMarker"),e.consume(x),e.exit("resourceMarker"),a}function a(x){return Tn(x)?ra(e,l)(x):l(x)}function l(x){return x===41?h(x):v0(e,c,d,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(x)}function c(x){return Tn(x)?ra(e,p)(x):h(x)}function d(x){return n(x)}function p(x){return x===34||x===39||x===40?w0(e,m,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(x):h(x)}function m(x){return Tn(x)?ra(e,h)(x):h(x)}function h(x){return x===41?(e.enter("resourceMarker"),e.consume(x),e.exit("resourceMarker"),e.exit("resource"),t):n(x)}}function a3(e,t,n){const o=this;return a;function a(d){return b0.call(o,e,l,c,"reference","referenceMarker","referenceString")(d)}function l(d){return o.parser.defined.includes(zs(o.sliceSerialize(o.events[o.events.length-1][1]).slice(1,-1)))?t(d):n(d)}function c(d){return n(d)}}function l3(e,t,n){return o;function o(l){return e.enter("reference"),e.enter("referenceMarker"),e.consume(l),e.exit("referenceMarker"),a}function a(l){return l===93?(e.enter("referenceMarker"),e.consume(l),e.exit("referenceMarker"),e.exit("reference"),t):n(l)}}const c3={name:"labelStartImage",resolveAll:vh.resolveAll,tokenize:u3};function u3(e,t,n){const o=this;return a;function a(d){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(d),e.exit("labelImageMarker"),l}function l(d){return d===91?(e.enter("labelMarker"),e.consume(d),e.exit("labelMarker"),e.exit("labelImage"),c):n(d)}function c(d){return d===94&&"_hiddenFootnoteSupport"in o.parser.constructs?n(d):t(d)}}const d3={name:"labelStartLink",resolveAll:vh.resolveAll,tokenize:f3};function f3(e,t,n){const o=this;return a;function a(c){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(c),e.exit("labelMarker"),e.exit("labelLink"),l}function l(c){return c===94&&"_hiddenFootnoteSupport"in o.parser.constructs?n(c):t(c)}}const vf={name:"lineEnding",tokenize:p3};function p3(e,t){return n;function n(o){return e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),lt(e,t,"linePrefix")}}const uc={name:"thematicBreak",tokenize:h3};function h3(e,t,n){let o=0,a;return l;function l(m){return e.enter("thematicBreak"),c(m)}function c(m){return a=m,d(m)}function d(m){return m===a?(e.enter("thematicBreakSequence"),p(m)):o>=3&&(m===null||Fe(m))?(e.exit("thematicBreak"),t(m)):n(m)}function p(m){return m===a?(e.consume(m),o++,p):(e.exit("thematicBreakSequence"),et(m)?lt(e,d,"whitespace")(m):d(m))}}const Cn={continuation:{tokenize:y3},exit:b3,name:"list",tokenize:x3},m3={partial:!0,tokenize:w3},g3={partial:!0,tokenize:v3};function x3(e,t,n){const o=this,a=o.events[o.events.length-1];let l=a&&a[1].type==="linePrefix"?a[2].sliceSerialize(a[1],!0).length:0,c=0;return d;function d(b){const C=o.containerState.type||(b===42||b===43||b===45?"listUnordered":"listOrdered");if(C==="listUnordered"?!o.containerState.marker||b===o.containerState.marker:up(b)){if(o.containerState.type||(o.containerState.type=C,e.enter(C,{_container:!0})),C==="listUnordered")return e.enter("listItemPrefix"),b===42||b===45?e.check(uc,n,m)(b):m(b);if(!o.interrupt||b===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),p(b)}return n(b)}function p(b){return up(b)&&++c<10?(e.consume(b),p):(!o.interrupt||c<2)&&(o.containerState.marker?b===o.containerState.marker:b===41||b===46)?(e.exit("listItemValue"),m(b)):n(b)}function m(b){return e.enter("listItemMarker"),e.consume(b),e.exit("listItemMarker"),o.containerState.marker=o.containerState.marker||b,e.check(Vc,o.interrupt?n:h,e.attempt(m3,v,x))}function h(b){return o.containerState.initialBlankLine=!0,l++,v(b)}function x(b){return et(b)?(e.enter("listItemPrefixWhitespace"),e.consume(b),e.exit("listItemPrefixWhitespace"),v):n(b)}function v(b){return o.containerState.size=l+o.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(b)}}function y3(e,t,n){const o=this;return o.containerState._closeFlow=void 0,e.check(Vc,a,l);function a(d){return o.containerState.furtherBlankLines=o.containerState.furtherBlankLines||o.containerState.initialBlankLine,lt(e,t,"listItemIndent",o.containerState.size+1)(d)}function l(d){return o.containerState.furtherBlankLines||!et(d)?(o.containerState.furtherBlankLines=void 0,o.containerState.initialBlankLine=void 0,c(d)):(o.containerState.furtherBlankLines=void 0,o.containerState.initialBlankLine=void 0,e.attempt(g3,t,c)(d))}function c(d){return o.containerState._closeFlow=!0,o.interrupt=void 0,lt(e,e.attempt(Cn,t,n),"linePrefix",o.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(d)}}function v3(e,t,n){const o=this;return lt(e,a,"listItemIndent",o.containerState.size+1);function a(l){const c=o.events[o.events.length-1];return c&&c[1].type==="listItemIndent"&&c[2].sliceSerialize(c[1],!0).length===o.containerState.size?t(l):n(l)}}function b3(e){e.exit(this.containerState.type)}function w3(e,t,n){const o=this;return lt(e,a,"listItemPrefixWhitespace",o.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function a(l){const c=o.events[o.events.length-1];return!et(l)&&c&&c[1].type==="listItemPrefixWhitespace"?t(l):n(l)}}const Oy={name:"setextUnderline",resolveTo:k3,tokenize:j3};function k3(e,t){let n=e.length,o,a,l;for(;n--;)if(e[n][0]==="enter"){if(e[n][1].type==="content"){o=n;break}e[n][1].type==="paragraph"&&(a=n)}else e[n][1].type==="content"&&e.splice(n,1),!l&&e[n][1].type==="definition"&&(l=n);const c={type:"setextHeading",start:{...e[o][1].start},end:{...e[e.length-1][1].end}};return e[a][1].type="setextHeadingText",l?(e.splice(a,0,["enter",c,t]),e.splice(l+1,0,["exit",e[o][1],t]),e[o][1].end={...e[l][1].end}):e[o][1]=c,e.push(["exit",c,t]),e}function j3(e,t,n){const o=this;let a;return l;function l(m){let h=o.events.length,x;for(;h--;)if(o.events[h][1].type!=="lineEnding"&&o.events[h][1].type!=="linePrefix"&&o.events[h][1].type!=="content"){x=o.events[h][1].type==="paragraph";break}return!o.parser.lazy[o.now().line]&&(o.interrupt||x)?(e.enter("setextHeadingLine"),a=m,c(m)):n(m)}function c(m){return e.enter("setextHeadingLineSequence"),d(m)}function d(m){return m===a?(e.consume(m),d):(e.exit("setextHeadingLineSequence"),et(m)?lt(e,p,"lineSuffix")(m):p(m))}function p(m){return m===null||Fe(m)?(e.exit("setextHeadingLine"),t(m)):n(m)}}const S3={tokenize:N3};function N3(e){const t=this,n=e.attempt(Vc,o,e.attempt(this.parser.constructs.flowInitial,a,lt(e,e.attempt(this.parser.constructs.flow,a,e.attempt(RA,a)),"linePrefix")));return n;function o(l){if(l===null){e.consume(l);return}return e.enter("lineEndingBlank"),e.consume(l),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n}function a(l){if(l===null){e.consume(l);return}return e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),t.currentConstruct=void 0,n}}const C3={resolveAll:j0()},E3=k0("string"),P3=k0("text");function k0(e){return{resolveAll:j0(e==="text"?T3:void 0),tokenize:t};function t(n){const o=this,a=this.parser.constructs[e],l=n.attempt(a,c,d);return c;function c(h){return m(h)?l(h):d(h)}function d(h){if(h===null){n.consume(h);return}return n.enter("data"),n.consume(h),p}function p(h){return m(h)?(n.exit("data"),l(h)):(n.consume(h),p)}function m(h){if(h===null)return!0;const x=a[h];let v=-1;if(x)for(;++v<x.length;){const b=x[v];if(!b.previous||b.previous.call(o,o.previous))return!0}return!1}}}function j0(e){return t;function t(n,o){let a=-1,l;for(;++a<=n.length;)l===void 0?n[a]&&n[a][1].type==="data"&&(l=a,a++):(!n[a]||n[a][1].type!=="data")&&(a!==l+2&&(n[l][1].end=n[a-1][1].end,n.splice(l+2,a-l-2),a=l+2),l=void 0);return e?e(n,o):n}}function T3(e,t){let n=0;for(;++n<=e.length;)if((n===e.length||e[n][1].type==="lineEnding")&&e[n-1][1].type==="data"){const o=e[n-1][1],a=t.sliceStream(o);let l=a.length,c=-1,d=0,p;for(;l--;){const m=a[l];if(typeof m=="string"){for(c=m.length;m.charCodeAt(c-1)===32;)d++,c--;if(c)break;c=-1}else if(m===-2)p=!0,d++;else if(m!==-1){l++;break}}if(t._contentTypeTextTrailing&&n===e.length&&(d=0),d){const m={type:n===e.length||p||d<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:l?c:o.start._bufferIndex+c,_index:o.start._index+l,line:o.end.line,column:o.end.column-d,offset:o.end.offset-d},end:{...o.end}};o.end={...m.start},o.start.offset===o.end.offset?Object.assign(o,m):(e.splice(n,0,["enter",m,t],["exit",m,t]),n+=2)}n++}return e}const R3={42:Cn,43:Cn,45:Cn,48:Cn,49:Cn,50:Cn,51:Cn,52:Cn,53:Cn,54:Cn,55:Cn,56:Cn,57:Cn,62:m0},A3={91:LA},D3={[-2]:yf,[-1]:yf,32:yf},I3={35:BA,42:uc,45:[Oy,uc],60:VA,61:Oy,95:uc,96:Dy,126:Dy},O3={38:x0,92:g0},L3={[-5]:vf,[-4]:vf,[-3]:vf,33:c3,38:x0,42:dp,60:[dA,JA],91:d3,92:[FA,g0],93:vh,95:dp,96:SA},M3={null:[dp,C3]},_3={null:[42,95]},$3={null:[]},F3=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:_3,contentInitial:A3,disable:$3,document:R3,flow:I3,flowInitial:D3,insideSpan:M3,string:O3,text:L3},Symbol.toStringTag,{value:"Module"}));function z3(e,t,n){let o={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0};const a={},l=[];let c=[],d=[];const p={attempt:D(O),check:D(T),consume:R,enter:N,exit:A,interrupt:D(T,{interrupt:!0})},m={code:null,containerState:{},defineSkip:k,events:[],now:C,parser:e,previous:null,sliceSerialize:v,sliceStream:b,write:x};let h=t.tokenize.call(m,p);return t.resolveAll&&l.push(t),m;function x(z){return c=Jn(c,z),j(),c[c.length-1]!==null?[]:(L(t,0),m.events=yh(l,m.events,m),m.events)}function v(z,K){return U3(b(z),K)}function b(z){return B3(c,z)}function C(){const{_bufferIndex:z,_index:K,line:q,column:J,offset:_}=o;return{_bufferIndex:z,_index:K,line:q,column:J,offset:_}}function k(z){a[z.line]=z.column,re()}function j(){let z;for(;o._index<c.length;){const K=c[o._index];if(typeof K=="string")for(z=o._index,o._bufferIndex<0&&(o._bufferIndex=0);o._index===z&&o._bufferIndex<K.length;)S(K.charCodeAt(o._bufferIndex));else S(K)}}function S(z){h=h(z)}function R(z){Fe(z)?(o.line++,o.column=1,o.offset+=z===-3?2:1,re()):z!==-1&&(o.column++,o.offset++),o._bufferIndex<0?o._index++:(o._bufferIndex++,o._bufferIndex===c[o._index].length&&(o._bufferIndex=-1,o._index++)),m.previous=z}function N(z,K){const q=K||{};return q.type=z,q.start=C(),m.events.push(["enter",q,m]),d.push(q),q}function A(z){const K=d.pop();return K.end=C(),m.events.push(["exit",K,m]),K}function O(z,K){L(z,K.from)}function T(z,K){K.restore()}function D(z,K){return q;function q(J,_,F){let B,U,Z,P;return Array.isArray(J)?Q(J):"tokenize"in J?Q([J]):M(J);function M(te){return fe;function fe(ve){const we=ve!==null&&te[ve],be=ve!==null&&te.null,Ye=[...Array.isArray(we)?we:we?[we]:[],...Array.isArray(be)?be:be?[be]:[]];return Q(Ye)(ve)}}function Q(te){return B=te,U=0,te.length===0?F:I(te[U])}function I(te){return fe;function fe(ve){return P=G(),Z=te,te.partial||(m.currentConstruct=te),te.name&&m.parser.constructs.disable.null.includes(te.name)?Se():te.tokenize.call(K?Object.assign(Object.create(m),K):m,p,ge,Se)(ve)}}function ge(te){return z(Z,P),_}function Se(te){return P.restore(),++U<B.length?I(B[U]):F}}}function L(z,K){z.resolveAll&&!l.includes(z)&&l.push(z),z.resolve&&Rr(m.events,K,m.events.length-K,z.resolve(m.events.slice(K),m)),z.resolveTo&&(m.events=z.resolveTo(m.events,m))}function G(){const z=C(),K=m.previous,q=m.currentConstruct,J=m.events.length,_=Array.from(d);return{from:J,restore:F};function F(){o=z,m.previous=K,m.currentConstruct=q,m.events.length=J,d=_,re()}}function re(){o.line in a&&o.column<2&&(o.column=a[o.line],o.offset+=a[o.line]-1)}}function B3(e,t){const n=t.start._index,o=t.start._bufferIndex,a=t.end._index,l=t.end._bufferIndex;let c;if(n===a)c=[e[n].slice(o,l)];else{if(c=e.slice(n,a),o>-1){const d=c[0];typeof d=="string"?c[0]=d.slice(o):c.shift()}l>0&&c.push(e[a].slice(0,l))}return c}function U3(e,t){let n=-1;const o=[];let a;for(;++n<e.length;){const l=e[n];let c;if(typeof l=="string")c=l;else switch(l){case-5:{c="\r";break}case-4:{c=`
461
+ `;break}case-3:{c=`\r
462
+ `;break}case-2:{c=t?" ":" ";break}case-1:{if(!t&&a)continue;c=" ";break}default:c=String.fromCharCode(l)}a=l===-2,o.push(c)}return o.join("")}function H3(e){const o={constructs:XR([F3,...(e||{}).extensions||[]]),content:a(oA),defined:[],document:a(iA),flow:a(S3),lazy:{},string:a(E3),text:a(P3)};return o;function a(l){return c;function c(d){return z3(o,l,d)}}}function W3(e){for(;!y0(e););return e}const Ly=/[\0\t\n\r]/g;function V3(){let e=1,t="",n=!0,o;return a;function a(l,c,d){const p=[];let m,h,x,v,b;for(l=t+(typeof l=="string"?l.toString():new TextDecoder(c||void 0).decode(l)),x=0,t="",n&&(l.charCodeAt(0)===65279&&x++,n=void 0);x<l.length;){if(Ly.lastIndex=x,m=Ly.exec(l),v=m&&m.index!==void 0?m.index:l.length,b=l.charCodeAt(v),!m){t=l.slice(x);break}if(b===10&&x===v&&o)p.push(-3),o=void 0;else switch(o&&(p.push(-5),o=void 0),x<v&&(p.push(l.slice(x,v)),e+=v-x),b){case 0:{p.push(65533),e++;break}case 9:{for(h=Math.ceil(e/4)*4,p.push(-2);e++<h;)p.push(-1);break}case 10:{p.push(-4),e=1;break}default:o=!0,e=1}x=v+1}return d&&(o&&p.push(-5),t&&p.push(t),p.push(null)),p}}const q3=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function K3(e){return e.replace(q3,G3)}function G3(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){const a=n.charCodeAt(1),l=a===120||a===88;return h0(n.slice(l?2:1),l?16:10)}return xh(n)||e}const S0={}.hasOwnProperty;function Y3(e,t,n){return t&&typeof t=="object"&&(n=t,t=void 0),X3(n)(W3(H3(n).document().write(V3()(e,t,!0))))}function X3(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:l(Be),autolinkProtocol:G,autolinkEmail:G,atxHeading:l(ae),blockQuote:l(be),characterEscape:G,characterReference:G,codeFenced:l(Ye),codeFencedFenceInfo:c,codeFencedFenceMeta:c,codeIndented:l(Ye,c),codeText:l(Xe,c),codeTextData:G,data:G,codeFlowValue:G,definition:l(ne),definitionDestinationString:c,definitionLabelString:c,definitionTitleString:c,emphasis:l(Y),hardBreakEscape:l(xe),hardBreakTrailing:l(xe),htmlFlow:l(qe,c),htmlFlowData:G,htmlText:l(qe,c),htmlTextData:G,image:l(Oe),label:c,link:l(Be),listItem:l(jt),listItemValue:v,listOrdered:l(Ge,x),listUnordered:l(Ge),paragraph:l(St),reference:I,referenceString:c,resourceDestinationString:c,resourceTitleString:c,setextHeading:l(ae),strong:l(Dt),thematicBreak:l(Et)},exit:{atxHeading:p(),atxHeadingSequence:O,autolink:p(),autolinkEmail:we,autolinkProtocol:ve,blockQuote:p(),characterEscapeValue:re,characterReferenceMarkerHexadecimal:Se,characterReferenceMarkerNumeric:Se,characterReferenceValue:te,characterReference:fe,codeFenced:p(j),codeFencedFence:k,codeFencedFenceInfo:b,codeFencedFenceMeta:C,codeFlowValue:re,codeIndented:p(S),codeText:p(_),codeTextData:re,data:re,definition:p(),definitionDestinationString:A,definitionLabelString:R,definitionTitleString:N,emphasis:p(),hardBreakEscape:p(K),hardBreakTrailing:p(K),htmlFlow:p(q),htmlFlowData:re,htmlText:p(J),htmlTextData:re,image:p(B),label:Z,labelText:U,lineEnding:z,link:p(F),listItem:p(),listOrdered:p(),listUnordered:p(),paragraph:p(),referenceString:ge,resourceDestinationString:P,resourceTitleString:M,resource:Q,setextHeading:p(L),setextHeadingLineSequence:D,setextHeadingText:T,strong:p(),thematicBreak:p()}};N0(t,(e||{}).mdastExtensions||[]);const n={};return o;function o(ie){let ce={type:"root",children:[]};const ye={stack:[ce],tokenStack:[],config:t,enter:d,exit:m,buffer:c,resume:h,data:n},se=[];let Ne=-1;for(;++Ne<ie.length;)if(ie[Ne][1].type==="listOrdered"||ie[Ne][1].type==="listUnordered")if(ie[Ne][0]==="enter")se.push(Ne);else{const Re=se.pop();Ne=a(ie,Re,Ne)}for(Ne=-1;++Ne<ie.length;){const Re=t[ie[Ne][0]];S0.call(Re,ie[Ne][1].type)&&Re[ie[Ne][1].type].call(Object.assign({sliceSerialize:ie[Ne][2].sliceSerialize},ye),ie[Ne][1])}if(ye.tokenStack.length>0){const Re=ye.tokenStack[ye.tokenStack.length-1];(Re[1]||My).call(ye,void 0,Re[0])}for(ce.position={start:bo(ie.length>0?ie[0][1].start:{line:1,column:1,offset:0}),end:bo(ie.length>0?ie[ie.length-2][1].end:{line:1,column:1,offset:0})},Ne=-1;++Ne<t.transforms.length;)ce=t.transforms[Ne](ce)||ce;return ce}function a(ie,ce,ye){let se=ce-1,Ne=-1,Re=!1,Ht,rn,Jt,V;for(;++se<=ye;){const pe=ie[se];switch(pe[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{pe[0]==="enter"?Ne++:Ne--,V=void 0;break}case"lineEndingBlank":{pe[0]==="enter"&&(Ht&&!V&&!Ne&&!Jt&&(Jt=se),V=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:V=void 0}if(!Ne&&pe[0]==="enter"&&pe[1].type==="listItemPrefix"||Ne===-1&&pe[0]==="exit"&&(pe[1].type==="listUnordered"||pe[1].type==="listOrdered")){if(Ht){let Ce=se;for(rn=void 0;Ce--;){const ze=ie[Ce];if(ze[1].type==="lineEnding"||ze[1].type==="lineEndingBlank"){if(ze[0]==="exit")continue;rn&&(ie[rn][1].type="lineEndingBlank",Re=!0),ze[1].type="lineEnding",rn=Ce}else if(!(ze[1].type==="linePrefix"||ze[1].type==="blockQuotePrefix"||ze[1].type==="blockQuotePrefixWhitespace"||ze[1].type==="blockQuoteMarker"||ze[1].type==="listItemIndent"))break}Jt&&(!rn||Jt<rn)&&(Ht._spread=!0),Ht.end=Object.assign({},rn?ie[rn][1].start:pe[1].end),ie.splice(rn||se,0,["exit",Ht,pe[2]]),se++,ye++}if(pe[1].type==="listItemPrefix"){const Ce={type:"listItem",_spread:!1,start:Object.assign({},pe[1].start),end:void 0};Ht=Ce,ie.splice(se,0,["enter",Ce,pe[2]]),se++,ye++,Jt=void 0,V=!0}}}return ie[ce][1]._spread=Re,ye}function l(ie,ce){return ye;function ye(se){d.call(this,ie(se),se),ce&&ce.call(this,se)}}function c(){this.stack.push({type:"fragment",children:[]})}function d(ie,ce,ye){this.stack[this.stack.length-1].children.push(ie),this.stack.push(ie),this.tokenStack.push([ce,ye||void 0]),ie.position={start:bo(ce.start),end:void 0}}function p(ie){return ce;function ce(ye){ie&&ie.call(this,ye),m.call(this,ye)}}function m(ie,ce){const ye=this.stack.pop(),se=this.tokenStack.pop();if(se)se[0].type!==ie.type&&(ce?ce.call(this,ie,se[0]):(se[1]||My).call(this,ie,se[0]));else throw new Error("Cannot close `"+ie.type+"` ("+na({start:ie.start,end:ie.end})+"): it’s not open");ye.position.end=bo(ie.end)}function h(){return GR(this.stack.pop())}function x(){this.data.expectingFirstListItemValue=!0}function v(ie){if(this.data.expectingFirstListItemValue){const ce=this.stack[this.stack.length-2];ce.start=Number.parseInt(this.sliceSerialize(ie),10),this.data.expectingFirstListItemValue=void 0}}function b(){const ie=this.resume(),ce=this.stack[this.stack.length-1];ce.lang=ie}function C(){const ie=this.resume(),ce=this.stack[this.stack.length-1];ce.meta=ie}function k(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function j(){const ie=this.resume(),ce=this.stack[this.stack.length-1];ce.value=ie.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function S(){const ie=this.resume(),ce=this.stack[this.stack.length-1];ce.value=ie.replace(/(\r?\n|\r)$/g,"")}function R(ie){const ce=this.resume(),ye=this.stack[this.stack.length-1];ye.label=ce,ye.identifier=zs(this.sliceSerialize(ie)).toLowerCase()}function N(){const ie=this.resume(),ce=this.stack[this.stack.length-1];ce.title=ie}function A(){const ie=this.resume(),ce=this.stack[this.stack.length-1];ce.url=ie}function O(ie){const ce=this.stack[this.stack.length-1];if(!ce.depth){const ye=this.sliceSerialize(ie).length;ce.depth=ye}}function T(){this.data.setextHeadingSlurpLineEnding=!0}function D(ie){const ce=this.stack[this.stack.length-1];ce.depth=this.sliceSerialize(ie).codePointAt(0)===61?1:2}function L(){this.data.setextHeadingSlurpLineEnding=void 0}function G(ie){const ye=this.stack[this.stack.length-1].children;let se=ye[ye.length-1];(!se||se.type!=="text")&&(se=Qt(),se.position={start:bo(ie.start),end:void 0},ye.push(se)),this.stack.push(se)}function re(ie){const ce=this.stack.pop();ce.value+=this.sliceSerialize(ie),ce.position.end=bo(ie.end)}function z(ie){const ce=this.stack[this.stack.length-1];if(this.data.atHardBreak){const ye=ce.children[ce.children.length-1];ye.position.end=bo(ie.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(ce.type)&&(G.call(this,ie),re.call(this,ie))}function K(){this.data.atHardBreak=!0}function q(){const ie=this.resume(),ce=this.stack[this.stack.length-1];ce.value=ie}function J(){const ie=this.resume(),ce=this.stack[this.stack.length-1];ce.value=ie}function _(){const ie=this.resume(),ce=this.stack[this.stack.length-1];ce.value=ie}function F(){const ie=this.stack[this.stack.length-1];if(this.data.inReference){const ce=this.data.referenceType||"shortcut";ie.type+="Reference",ie.referenceType=ce,delete ie.url,delete ie.title}else delete ie.identifier,delete ie.label;this.data.referenceType=void 0}function B(){const ie=this.stack[this.stack.length-1];if(this.data.inReference){const ce=this.data.referenceType||"shortcut";ie.type+="Reference",ie.referenceType=ce,delete ie.url,delete ie.title}else delete ie.identifier,delete ie.label;this.data.referenceType=void 0}function U(ie){const ce=this.sliceSerialize(ie),ye=this.stack[this.stack.length-2];ye.label=K3(ce),ye.identifier=zs(ce).toLowerCase()}function Z(){const ie=this.stack[this.stack.length-1],ce=this.resume(),ye=this.stack[this.stack.length-1];if(this.data.inReference=!0,ye.type==="link"){const se=ie.children;ye.children=se}else ye.alt=ce}function P(){const ie=this.resume(),ce=this.stack[this.stack.length-1];ce.url=ie}function M(){const ie=this.resume(),ce=this.stack[this.stack.length-1];ce.title=ie}function Q(){this.data.inReference=void 0}function I(){this.data.referenceType="collapsed"}function ge(ie){const ce=this.resume(),ye=this.stack[this.stack.length-1];ye.label=ce,ye.identifier=zs(this.sliceSerialize(ie)).toLowerCase(),this.data.referenceType="full"}function Se(ie){this.data.characterReferenceType=ie.type}function te(ie){const ce=this.sliceSerialize(ie),ye=this.data.characterReferenceType;let se;ye?(se=h0(ce,ye==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):se=xh(ce);const Ne=this.stack[this.stack.length-1];Ne.value+=se}function fe(ie){const ce=this.stack.pop();ce.position.end=bo(ie.end)}function ve(ie){re.call(this,ie);const ce=this.stack[this.stack.length-1];ce.url=this.sliceSerialize(ie)}function we(ie){re.call(this,ie);const ce=this.stack[this.stack.length-1];ce.url="mailto:"+this.sliceSerialize(ie)}function be(){return{type:"blockquote",children:[]}}function Ye(){return{type:"code",lang:null,meta:null,value:""}}function Xe(){return{type:"inlineCode",value:""}}function ne(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function Y(){return{type:"emphasis",children:[]}}function ae(){return{type:"heading",depth:0,children:[]}}function xe(){return{type:"break"}}function qe(){return{type:"html",value:""}}function Oe(){return{type:"image",title:null,url:"",alt:null}}function Be(){return{type:"link",title:null,url:"",children:[]}}function Ge(ie){return{type:"list",ordered:ie.type==="listOrdered",start:null,spread:ie._spread,children:[]}}function jt(ie){return{type:"listItem",spread:ie._spread,checked:null,children:[]}}function St(){return{type:"paragraph",children:[]}}function Dt(){return{type:"strong",children:[]}}function Qt(){return{type:"text",value:""}}function Et(){return{type:"thematicBreak"}}}function bo(e){return{line:e.line,column:e.column,offset:e.offset}}function N0(e,t){let n=-1;for(;++n<t.length;){const o=t[n];Array.isArray(o)?N0(e,o):Q3(e,o)}}function Q3(e,t){let n;for(n in t)if(S0.call(t,n))switch(n){case"canContainEols":{const o=t[n];o&&e[n].push(...o);break}case"transforms":{const o=t[n];o&&e[n].push(...o);break}case"enter":case"exit":{const o=t[n];o&&Object.assign(e[n],o);break}}}function My(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+na({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+na({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+na({start:t.start,end:t.end})+") is still open")}function J3(e){const t=this;t.parser=n;function n(o){return Y3(o,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function Z3(e,t){const n={type:"element",tagName:"blockquote",properties:{},children:e.wrap(e.all(t),!0)};return e.patch(t,n),e.applyData(t,n)}function eD(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:`
463
+ `}]}function tD(e,t){const n=t.value?t.value+`
464
+ `:"",o={},a=t.lang?t.lang.split(/\s+/):[];a.length>0&&(o.className=["language-"+a[0]]);let l={type:"element",tagName:"code",properties:o,children:[{type:"text",value:n}]};return t.meta&&(l.data={meta:t.meta}),e.patch(t,l),l=e.applyData(t,l),l={type:"element",tagName:"pre",properties:{},children:[l]},e.patch(t,l),l}function nD(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function rD(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function oD(e,t){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",o=String(t.identifier).toUpperCase(),a=ti(o.toLowerCase()),l=e.footnoteOrder.indexOf(o);let c,d=e.footnoteCounts.get(o);d===void 0?(d=0,e.footnoteOrder.push(o),c=e.footnoteOrder.length):c=l+1,d+=1,e.footnoteCounts.set(o,d);const p={type:"element",tagName:"a",properties:{href:"#"+n+"fn-"+a,id:n+"fnref-"+a+(d>1?"-"+d:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(c)}]};e.patch(t,p);const m={type:"element",tagName:"sup",properties:{},children:[p]};return e.patch(t,m),e.applyData(t,m)}function sD(e,t){const n={type:"element",tagName:"h"+t.depth,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function iD(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}}function C0(e,t){const n=t.referenceType;let o="]";if(n==="collapsed"?o+="[]":n==="full"&&(o+="["+(t.label||t.identifier)+"]"),t.type==="imageReference")return[{type:"text",value:"!["+t.alt+o}];const a=e.all(t),l=a[0];l&&l.type==="text"?l.value="["+l.value:a.unshift({type:"text",value:"["});const c=a[a.length-1];return c&&c.type==="text"?c.value+=o:a.push({type:"text",value:o}),a}function aD(e,t){const n=String(t.identifier).toUpperCase(),o=e.definitionById.get(n);if(!o)return C0(e,t);const a={src:ti(o.url||""),alt:t.alt};o.title!==null&&o.title!==void 0&&(a.title=o.title);const l={type:"element",tagName:"img",properties:a,children:[]};return e.patch(t,l),e.applyData(t,l)}function lD(e,t){const n={src:ti(t.url)};t.alt!==null&&t.alt!==void 0&&(n.alt=t.alt),t.title!==null&&t.title!==void 0&&(n.title=t.title);const o={type:"element",tagName:"img",properties:n,children:[]};return e.patch(t,o),e.applyData(t,o)}function cD(e,t){const n={type:"text",value:t.value.replace(/\r?\n|\r/g," ")};e.patch(t,n);const o={type:"element",tagName:"code",properties:{},children:[n]};return e.patch(t,o),e.applyData(t,o)}function uD(e,t){const n=String(t.identifier).toUpperCase(),o=e.definitionById.get(n);if(!o)return C0(e,t);const a={href:ti(o.url||"")};o.title!==null&&o.title!==void 0&&(a.title=o.title);const l={type:"element",tagName:"a",properties:a,children:e.all(t)};return e.patch(t,l),e.applyData(t,l)}function dD(e,t){const n={href:ti(t.url)};t.title!==null&&t.title!==void 0&&(n.title=t.title);const o={type:"element",tagName:"a",properties:n,children:e.all(t)};return e.patch(t,o),e.applyData(t,o)}function fD(e,t,n){const o=e.all(t),a=n?pD(n):E0(t),l={},c=[];if(typeof t.checked=="boolean"){const h=o[0];let x;h&&h.type==="element"&&h.tagName==="p"?x=h:(x={type:"element",tagName:"p",properties:{},children:[]},o.unshift(x)),x.children.length>0&&x.children.unshift({type:"text",value:" "}),x.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:t.checked,disabled:!0},children:[]}),l.className=["task-list-item"]}let d=-1;for(;++d<o.length;){const h=o[d];(a||d!==0||h.type!=="element"||h.tagName!=="p")&&c.push({type:"text",value:`
465
+ `}),h.type==="element"&&h.tagName==="p"&&!a?c.push(...h.children):c.push(h)}const p=o[o.length-1];p&&(a||p.type!=="element"||p.tagName!=="p")&&c.push({type:"text",value:`
466
+ `});const m={type:"element",tagName:"li",properties:l,children:c};return e.patch(t,m),e.applyData(t,m)}function pD(e){let t=!1;if(e.type==="list"){t=e.spread||!1;const n=e.children;let o=-1;for(;!t&&++o<n.length;)t=E0(n[o])}return t}function E0(e){const t=e.spread;return t??e.children.length>1}function hD(e,t){const n={},o=e.all(t);let a=-1;for(typeof t.start=="number"&&t.start!==1&&(n.start=t.start);++a<o.length;){const c=o[a];if(c.type==="element"&&c.tagName==="li"&&c.properties&&Array.isArray(c.properties.className)&&c.properties.className.includes("task-list-item")){n.className=["contains-task-list"];break}}const l={type:"element",tagName:t.ordered?"ol":"ul",properties:n,children:e.wrap(o,!0)};return e.patch(t,l),e.applyData(t,l)}function mD(e,t){const n={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function gD(e,t){const n={type:"root",children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function xD(e,t){const n={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function yD(e,t){const n=e.all(t),o=n.shift(),a=[];if(o){const c={type:"element",tagName:"thead",properties:{},children:e.wrap([o],!0)};e.patch(t.children[0],c),a.push(c)}if(n.length>0){const c={type:"element",tagName:"tbody",properties:{},children:e.wrap(n,!0)},d=ph(t.children[1]),p=a0(t.children[t.children.length-1]);d&&p&&(c.position={start:d,end:p}),a.push(c)}const l={type:"element",tagName:"table",properties:{},children:e.wrap(a,!0)};return e.patch(t,l),e.applyData(t,l)}function vD(e,t,n){const o=n?n.children:void 0,l=(o?o.indexOf(t):1)===0?"th":"td",c=n&&n.type==="table"?n.align:void 0,d=c?c.length:t.children.length;let p=-1;const m=[];for(;++p<d;){const x=t.children[p],v={},b=c?c[p]:void 0;b&&(v.align=b);let C={type:"element",tagName:l,properties:v,children:[]};x&&(C.children=e.all(x),e.patch(x,C),C=e.applyData(x,C)),m.push(C)}const h={type:"element",tagName:"tr",properties:{},children:e.wrap(m,!0)};return e.patch(t,h),e.applyData(t,h)}function bD(e,t){const n={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}const _y=9,$y=32;function wD(e){const t=String(e),n=/\r?\n|\r/g;let o=n.exec(t),a=0;const l=[];for(;o;)l.push(Fy(t.slice(a,o.index),a>0,!0),o[0]),a=o.index+o[0].length,o=n.exec(t);return l.push(Fy(t.slice(a),a>0,!1)),l.join("")}function Fy(e,t,n){let o=0,a=e.length;if(t){let l=e.codePointAt(o);for(;l===_y||l===$y;)o++,l=e.codePointAt(o)}if(n){let l=e.codePointAt(a-1);for(;l===_y||l===$y;)a--,l=e.codePointAt(a-1)}return a>o?e.slice(o,a):""}function kD(e,t){const n={type:"text",value:wD(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function jD(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const SD={blockquote:Z3,break:eD,code:tD,delete:nD,emphasis:rD,footnoteReference:oD,heading:sD,html:iD,imageReference:aD,image:lD,inlineCode:cD,linkReference:uD,link:dD,listItem:fD,list:hD,paragraph:mD,root:gD,strong:xD,table:yD,tableCell:bD,tableRow:vD,text:kD,thematicBreak:jD,toml:Yl,yaml:Yl,definition:Yl,footnoteDefinition:Yl};function Yl(){}const P0=-1,qc=0,oa=1,vc=2,bh=3,wh=4,kh=5,jh=6,T0=7,R0=8,zy=typeof self=="object"?self:globalThis,ND=(e,t)=>{const n=(a,l)=>(e.set(l,a),a),o=a=>{if(e.has(a))return e.get(a);const[l,c]=t[a];switch(l){case qc:case P0:return n(c,a);case oa:{const d=n([],a);for(const p of c)d.push(o(p));return d}case vc:{const d=n({},a);for(const[p,m]of c)d[o(p)]=o(m);return d}case bh:return n(new Date(c),a);case wh:{const{source:d,flags:p}=c;return n(new RegExp(d,p),a)}case kh:{const d=n(new Map,a);for(const[p,m]of c)d.set(o(p),o(m));return d}case jh:{const d=n(new Set,a);for(const p of c)d.add(o(p));return d}case T0:{const{name:d,message:p}=c;return n(new zy[d](p),a)}case R0:return n(BigInt(c),a);case"BigInt":return n(Object(BigInt(c)),a);case"ArrayBuffer":return n(new Uint8Array(c).buffer,c);case"DataView":{const{buffer:d}=new Uint8Array(c);return n(new DataView(d),c)}}return n(new zy[l](c),a)};return o},By=e=>ND(new Map,e)(0),Is="",{toString:CD}={},{keys:ED}=Object,Xi=e=>{const t=typeof e;if(t!=="object"||!e)return[qc,t];const n=CD.call(e).slice(8,-1);switch(n){case"Array":return[oa,Is];case"Object":return[vc,Is];case"Date":return[bh,Is];case"RegExp":return[wh,Is];case"Map":return[kh,Is];case"Set":return[jh,Is];case"DataView":return[oa,n]}return n.includes("Array")?[oa,n]:n.includes("Error")?[T0,n]:[vc,n]},Xl=([e,t])=>e===qc&&(t==="function"||t==="symbol"),PD=(e,t,n,o)=>{const a=(c,d)=>{const p=o.push(c)-1;return n.set(d,p),p},l=c=>{if(n.has(c))return n.get(c);let[d,p]=Xi(c);switch(d){case qc:{let h=c;switch(p){case"bigint":d=R0,h=c.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+p);h=null;break;case"undefined":return a([P0],c)}return a([d,h],c)}case oa:{if(p){let v=c;return p==="DataView"?v=new Uint8Array(c.buffer):p==="ArrayBuffer"&&(v=new Uint8Array(c)),a([p,[...v]],c)}const h=[],x=a([d,h],c);for(const v of c)h.push(l(v));return x}case vc:{if(p)switch(p){case"BigInt":return a([p,c.toString()],c);case"Boolean":case"Number":case"String":return a([p,c.valueOf()],c)}if(t&&"toJSON"in c)return l(c.toJSON());const h=[],x=a([d,h],c);for(const v of ED(c))(e||!Xl(Xi(c[v])))&&h.push([l(v),l(c[v])]);return x}case bh:return a([d,c.toISOString()],c);case wh:{const{source:h,flags:x}=c;return a([d,{source:h,flags:x}],c)}case kh:{const h=[],x=a([d,h],c);for(const[v,b]of c)(e||!(Xl(Xi(v))||Xl(Xi(b))))&&h.push([l(v),l(b)]);return x}case jh:{const h=[],x=a([d,h],c);for(const v of c)(e||!Xl(Xi(v)))&&h.push(l(v));return x}}const{message:m}=c;return a([d,{name:p,message:m}],c)};return l},Uy=(e,{json:t,lossy:n}={})=>{const o=[];return PD(!(t||n),!!t,new Map,o)(e),o},bc=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?By(Uy(e,t)):structuredClone(e):(e,t)=>By(Uy(e,t));function TD(e,t){const n=[{type:"text",value:"↩"}];return t>1&&n.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(t)}]}),n}function RD(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function AD(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||TD,o=e.options.footnoteBackLabel||RD,a=e.options.footnoteLabel||"Footnotes",l=e.options.footnoteLabelTagName||"h2",c=e.options.footnoteLabelProperties||{className:["sr-only"]},d=[];let p=-1;for(;++p<e.footnoteOrder.length;){const m=e.footnoteById.get(e.footnoteOrder[p]);if(!m)continue;const h=e.all(m),x=String(m.identifier).toUpperCase(),v=ti(x.toLowerCase());let b=0;const C=[],k=e.footnoteCounts.get(x);for(;k!==void 0&&++b<=k;){C.length>0&&C.push({type:"text",value:" "});let R=typeof n=="string"?n:n(p,b);typeof R=="string"&&(R={type:"text",value:R}),C.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+v+(b>1?"-"+b:""),dataFootnoteBackref:"",ariaLabel:typeof o=="string"?o:o(p,b),className:["data-footnote-backref"]},children:Array.isArray(R)?R:[R]})}const j=h[h.length-1];if(j&&j.type==="element"&&j.tagName==="p"){const R=j.children[j.children.length-1];R&&R.type==="text"?R.value+=" ":j.children.push({type:"text",value:" "}),j.children.push(...C)}else h.push(...C);const S={type:"element",tagName:"li",properties:{id:t+"fn-"+v},children:e.wrap(h,!0)};e.patch(m,S),d.push(S)}if(d.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:l,properties:{...bc(c),id:"footnote-label"},children:[{type:"text",value:a}]},{type:"text",value:`
467
+ `},{type:"element",tagName:"ol",properties:{},children:e.wrap(d,!0)},{type:"text",value:`
468
+ `}]}}const A0=(function(e){if(e==null)return LD;if(typeof e=="function")return Kc(e);if(typeof e=="object")return Array.isArray(e)?DD(e):ID(e);if(typeof e=="string")return OD(e);throw new Error("Expected function, string, or object as test")});function DD(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=A0(e[n]);return Kc(o);function o(...a){let l=-1;for(;++l<t.length;)if(t[l].apply(this,a))return!0;return!1}}function ID(e){const t=e;return Kc(n);function n(o){const a=o;let l;for(l in e)if(a[l]!==t[l])return!1;return!0}}function OD(e){return Kc(t);function t(n){return n&&n.type===e}}function Kc(e){return t;function t(n,o,a){return!!(MD(n)&&e.call(this,n,typeof o=="number"?o:void 0,a||void 0))}}function LD(){return!0}function MD(e){return e!==null&&typeof e=="object"&&"type"in e}const D0=[],_D=!0,Hy=!1,$D="skip";function FD(e,t,n,o){let a;typeof t=="function"&&typeof n!="function"?(o=n,n=t):a=t;const l=A0(a),c=o?-1:1;d(e,void 0,[])();function d(p,m,h){const x=p&&typeof p=="object"?p:{};if(typeof x.type=="string"){const b=typeof x.tagName=="string"?x.tagName:typeof x.name=="string"?x.name:void 0;Object.defineProperty(v,"name",{value:"node ("+(p.type+(b?"<"+b+">":""))+")"})}return v;function v(){let b=D0,C,k,j;if((!t||l(p,m,h[h.length-1]||void 0))&&(b=zD(n(p,h)),b[0]===Hy))return b;if("children"in p&&p.children){const S=p;if(S.children&&b[0]!==$D)for(k=(o?S.children.length:-1)+c,j=h.concat(S);k>-1&&k<S.children.length;){const R=S.children[k];if(C=d(R,k,j)(),C[0]===Hy)return C;k=typeof C[1]=="number"?C[1]:k+c}}return b}}}function zD(e){return Array.isArray(e)?e:typeof e=="number"?[_D,e]:e==null?D0:[e]}function I0(e,t,n,o){let a,l,c;typeof t=="function"&&typeof n!="function"?(l=void 0,c=t,a=n):(l=t,c=n,a=o),FD(e,l,d,a);function d(p,m){const h=m[m.length-1],x=h?h.children.indexOf(p):void 0;return c(p,x,h)}}const fp={}.hasOwnProperty,BD={};function UD(e,t){const n=t||BD,o=new Map,a=new Map,l=new Map,c={...SD,...n.handlers},d={all:m,applyData:WD,definitionById:o,footnoteById:a,footnoteCounts:l,footnoteOrder:[],handlers:c,one:p,options:n,patch:HD,wrap:qD};return I0(e,function(h){if(h.type==="definition"||h.type==="footnoteDefinition"){const x=h.type==="definition"?o:a,v=String(h.identifier).toUpperCase();x.has(v)||x.set(v,h)}}),d;function p(h,x){const v=h.type,b=d.handlers[v];if(fp.call(d.handlers,v)&&b)return b(d,h,x);if(d.options.passThrough&&d.options.passThrough.includes(v)){if("children"in h){const{children:k,...j}=h,S=bc(j);return S.children=d.all(h),S}return bc(h)}return(d.options.unknownHandler||VD)(d,h,x)}function m(h){const x=[];if("children"in h){const v=h.children;let b=-1;for(;++b<v.length;){const C=d.one(v[b],h);if(C){if(b&&v[b-1].type==="break"&&(!Array.isArray(C)&&C.type==="text"&&(C.value=Wy(C.value)),!Array.isArray(C)&&C.type==="element")){const k=C.children[0];k&&k.type==="text"&&(k.value=Wy(k.value))}Array.isArray(C)?x.push(...C):x.push(C)}}}return x}}function HD(e,t){e.position&&(t.position=CR(e))}function WD(e,t){let n=t;if(e&&e.data){const o=e.data.hName,a=e.data.hChildren,l=e.data.hProperties;if(typeof o=="string")if(n.type==="element")n.tagName=o;else{const c="children"in n?n.children:[n];n={type:"element",tagName:o,properties:{},children:c}}n.type==="element"&&l&&Object.assign(n.properties,bc(l)),"children"in n&&n.children&&a!==null&&a!==void 0&&(n.children=a)}return n}function VD(e,t){const n=t.data||{},o="value"in t&&!(fp.call(n,"hProperties")||fp.call(n,"hChildren"))?{type:"text",value:t.value}:{type:"element",tagName:"div",properties:{},children:e.all(t)};return e.patch(t,o),e.applyData(t,o)}function qD(e,t){const n=[];let o=-1;for(t&&n.push({type:"text",value:`
469
+ `});++o<e.length;)o&&n.push({type:"text",value:`
470
+ `}),n.push(e[o]);return t&&e.length>0&&n.push({type:"text",value:`
471
+ `}),n}function Wy(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function Vy(e,t){const n=UD(e,t),o=n.one(e,void 0),a=AD(n),l=Array.isArray(o)?{type:"root",children:o}:o||{type:"root",children:[]};return a&&l.children.push({type:"text",value:`
472
+ `},a),l}function KD(e,t){return e&&"run"in e?async function(n,o){const a=Vy(n,{file:o,...t});await e.run(a,o)}:function(n,o){return Vy(n,{file:o,...e||t})}}function qy(e){if(e)throw e}var bf,Ky;function GD(){if(Ky)return bf;Ky=1;var e=Object.prototype.hasOwnProperty,t=Object.prototype.toString,n=Object.defineProperty,o=Object.getOwnPropertyDescriptor,a=function(m){return typeof Array.isArray=="function"?Array.isArray(m):t.call(m)==="[object Array]"},l=function(m){if(!m||t.call(m)!=="[object Object]")return!1;var h=e.call(m,"constructor"),x=m.constructor&&m.constructor.prototype&&e.call(m.constructor.prototype,"isPrototypeOf");if(m.constructor&&!h&&!x)return!1;var v;for(v in m);return typeof v>"u"||e.call(m,v)},c=function(m,h){n&&h.name==="__proto__"?n(m,h.name,{enumerable:!0,configurable:!0,value:h.newValue,writable:!0}):m[h.name]=h.newValue},d=function(m,h){if(h==="__proto__")if(e.call(m,h)){if(o)return o(m,h).value}else return;return m[h]};return bf=function p(){var m,h,x,v,b,C,k=arguments[0],j=1,S=arguments.length,R=!1;for(typeof k=="boolean"&&(R=k,k=arguments[1]||{},j=2),(k==null||typeof k!="object"&&typeof k!="function")&&(k={});j<S;++j)if(m=arguments[j],m!=null)for(h in m)x=d(k,h),v=d(m,h),k!==v&&(R&&v&&(l(v)||(b=a(v)))?(b?(b=!1,C=x&&a(x)?x:[]):C=x&&l(x)?x:{},c(k,{name:h,newValue:p(R,C,v)})):typeof v<"u"&&c(k,{name:h,newValue:v}));return k},bf}var YD=GD();const wf=Rc(YD);function pp(e){if(typeof e!="object"||e===null)return!1;const t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function XD(){const e=[],t={run:n,use:o};return t;function n(...a){let l=-1;const c=a.pop();if(typeof c!="function")throw new TypeError("Expected function as last argument, not "+c);d(null,...a);function d(p,...m){const h=e[++l];let x=-1;if(p){c(p);return}for(;++x<a.length;)(m[x]===null||m[x]===void 0)&&(m[x]=a[x]);a=m,h?QD(h,d)(...m):c(null,...m)}}function o(a){if(typeof a!="function")throw new TypeError("Expected `middelware` to be a function, not "+a);return e.push(a),t}}function QD(e,t){let n;return o;function o(...c){const d=e.length>c.length;let p;d&&c.push(a);try{p=e.apply(this,c)}catch(m){const h=m;if(d&&n)throw h;return a(h)}d||(p&&p.then&&typeof p.then=="function"?p.then(l,a):p instanceof Error?a(p):l(p))}function a(c,...d){n||(n=!0,t(c,...d))}function l(c){a(null,c)}}const kr={basename:JD,dirname:ZD,extname:e4,join:t4,sep:"/"};function JD(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');Ta(e);let n=0,o=-1,a=e.length,l;if(t===void 0||t.length===0||t.length>e.length){for(;a--;)if(e.codePointAt(a)===47){if(l){n=a+1;break}}else o<0&&(l=!0,o=a+1);return o<0?"":e.slice(n,o)}if(t===e)return"";let c=-1,d=t.length-1;for(;a--;)if(e.codePointAt(a)===47){if(l){n=a+1;break}}else c<0&&(l=!0,c=a+1),d>-1&&(e.codePointAt(a)===t.codePointAt(d--)?d<0&&(o=a):(d=-1,o=c));return n===o?o=c:o<0&&(o=e.length),e.slice(n,o)}function ZD(e){if(Ta(e),e.length===0)return".";let t=-1,n=e.length,o;for(;--n;)if(e.codePointAt(n)===47){if(o){t=n;break}}else o||(o=!0);return t<0?e.codePointAt(0)===47?"/":".":t===1&&e.codePointAt(0)===47?"//":e.slice(0,t)}function e4(e){Ta(e);let t=e.length,n=-1,o=0,a=-1,l=0,c;for(;t--;){const d=e.codePointAt(t);if(d===47){if(c){o=t+1;break}continue}n<0&&(c=!0,n=t+1),d===46?a<0?a=t:l!==1&&(l=1):a>-1&&(l=-1)}return a<0||n<0||l===0||l===1&&a===n-1&&a===o+1?"":e.slice(a,n)}function t4(...e){let t=-1,n;for(;++t<e.length;)Ta(e[t]),e[t]&&(n=n===void 0?e[t]:n+"/"+e[t]);return n===void 0?".":n4(n)}function n4(e){Ta(e);const t=e.codePointAt(0)===47;let n=r4(e,!t);return n.length===0&&!t&&(n="."),n.length>0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function r4(e,t){let n="",o=0,a=-1,l=0,c=-1,d,p;for(;++c<=e.length;){if(c<e.length)d=e.codePointAt(c);else{if(d===47)break;d=47}if(d===47){if(!(a===c-1||l===1))if(a!==c-1&&l===2){if(n.length<2||o!==2||n.codePointAt(n.length-1)!==46||n.codePointAt(n.length-2)!==46){if(n.length>2){if(p=n.lastIndexOf("/"),p!==n.length-1){p<0?(n="",o=0):(n=n.slice(0,p),o=n.length-1-n.lastIndexOf("/")),a=c,l=0;continue}}else if(n.length>0){n="",o=0,a=c,l=0;continue}}t&&(n=n.length>0?n+"/..":"..",o=2)}else n.length>0?n+="/"+e.slice(a+1,c):n=e.slice(a+1,c),o=c-a-1;a=c,l=0}else d===46&&l>-1?l++:l=-1}return n}function Ta(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const o4={cwd:s4};function s4(){return"/"}function hp(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function i4(e){if(typeof e=="string")e=new URL(e);else if(!hp(e)){const t=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code="ERR_INVALID_ARG_TYPE",t}if(e.protocol!=="file:"){const t=new TypeError("The URL must be of scheme file");throw t.code="ERR_INVALID_URL_SCHEME",t}return a4(e)}function a4(e){if(e.hostname!==""){const o=new TypeError('File URL host must be "localhost" or empty on darwin');throw o.code="ERR_INVALID_FILE_URL_HOST",o}const t=e.pathname;let n=-1;for(;++n<t.length;)if(t.codePointAt(n)===37&&t.codePointAt(n+1)===50){const o=t.codePointAt(n+2);if(o===70||o===102){const a=new TypeError("File URL path must not include encoded / characters");throw a.code="ERR_INVALID_FILE_URL_PATH",a}}return decodeURIComponent(t)}const kf=["history","path","basename","stem","extname","dirname"];class O0{constructor(t){let n;t?hp(t)?n={path:t}:typeof t=="string"||l4(t)?n={value:t}:n=t:n={},this.cwd="cwd"in n?"":o4.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let o=-1;for(;++o<kf.length;){const l=kf[o];l in n&&n[l]!==void 0&&n[l]!==null&&(this[l]=l==="history"?[...n[l]]:n[l])}let a;for(a in n)kf.includes(a)||(this[a]=n[a])}get basename(){return typeof this.path=="string"?kr.basename(this.path):void 0}set basename(t){Sf(t,"basename"),jf(t,"basename"),this.path=kr.join(this.dirname||"",t)}get dirname(){return typeof this.path=="string"?kr.dirname(this.path):void 0}set dirname(t){Gy(this.basename,"dirname"),this.path=kr.join(t||"",this.basename)}get extname(){return typeof this.path=="string"?kr.extname(this.path):void 0}set extname(t){if(jf(t,"extname"),Gy(this.dirname,"extname"),t){if(t.codePointAt(0)!==46)throw new Error("`extname` must start with `.`");if(t.includes(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=kr.join(this.dirname,this.stem+(t||""))}get path(){return this.history[this.history.length-1]}set path(t){hp(t)&&(t=i4(t)),Sf(t,"path"),this.path!==t&&this.history.push(t)}get stem(){return typeof this.path=="string"?kr.basename(this.path,this.extname):void 0}set stem(t){Sf(t,"stem"),jf(t,"stem"),this.path=kr.join(this.dirname||"",t+(this.extname||""))}fail(t,n,o){const a=this.message(t,n,o);throw a.fatal=!0,a}info(t,n,o){const a=this.message(t,n,o);return a.fatal=void 0,a}message(t,n,o){const a=new hn(t,n,o);return this.path&&(a.name=this.path+":"+a.name,a.file=this.path),a.fatal=!1,this.messages.push(a),a}toString(t){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(t||void 0).decode(this.value)}}function jf(e,t){if(e&&e.includes(kr.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+kr.sep+"`")}function Sf(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function Gy(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function l4(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const c4=(function(e){const o=this.constructor.prototype,a=o[e],l=function(){return a.apply(l,arguments)};return Object.setPrototypeOf(l,o),l}),u4={}.hasOwnProperty;class Sh extends c4{constructor(){super("copy"),this.Compiler=void 0,this.Parser=void 0,this.attachers=[],this.compiler=void 0,this.freezeIndex=-1,this.frozen=void 0,this.namespace={},this.parser=void 0,this.transformers=XD()}copy(){const t=new Sh;let n=-1;for(;++n<this.attachers.length;){const o=this.attachers[n];t.use(...o)}return t.data(wf(!0,{},this.namespace)),t}data(t,n){return typeof t=="string"?arguments.length===2?(Ef("data",this.frozen),this.namespace[t]=n,this):u4.call(this.namespace,t)&&this.namespace[t]||void 0:t?(Ef("data",this.frozen),this.namespace=t,this):this.namespace}freeze(){if(this.frozen)return this;const t=this;for(;++this.freezeIndex<this.attachers.length;){const[n,...o]=this.attachers[this.freezeIndex];if(o[0]===!1)continue;o[0]===!0&&(o[0]=void 0);const a=n.call(t,...o);typeof a=="function"&&this.transformers.use(a)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(t){this.freeze();const n=Ql(t),o=this.parser||this.Parser;return Nf("parse",o),o(String(n),n)}process(t,n){const o=this;return this.freeze(),Nf("process",this.parser||this.Parser),Cf("process",this.compiler||this.Compiler),n?a(void 0,n):new Promise(a);function a(l,c){const d=Ql(t),p=o.parse(d);o.run(p,d,function(h,x,v){if(h||!x||!v)return m(h);const b=x,C=o.stringify(b,v);p4(C)?v.value=C:v.result=C,m(h,v)});function m(h,x){h||!x?c(h):l?l(x):n(void 0,x)}}}processSync(t){let n=!1,o;return this.freeze(),Nf("processSync",this.parser||this.Parser),Cf("processSync",this.compiler||this.Compiler),this.process(t,a),Xy("processSync","process",n),o;function a(l,c){n=!0,qy(l),o=c}}run(t,n,o){Yy(t),this.freeze();const a=this.transformers;return!o&&typeof n=="function"&&(o=n,n=void 0),o?l(void 0,o):new Promise(l);function l(c,d){const p=Ql(n);a.run(t,p,m);function m(h,x,v){const b=x||t;h?d(h):c?c(b):o(void 0,b,v)}}}runSync(t,n){let o=!1,a;return this.run(t,n,l),Xy("runSync","run",o),a;function l(c,d){qy(c),a=d,o=!0}}stringify(t,n){this.freeze();const o=Ql(n),a=this.compiler||this.Compiler;return Cf("stringify",a),Yy(t),a(t,o)}use(t,...n){const o=this.attachers,a=this.namespace;if(Ef("use",this.frozen),t!=null)if(typeof t=="function")p(t,n);else if(typeof t=="object")Array.isArray(t)?d(t):c(t);else throw new TypeError("Expected usable value, not `"+t+"`");return this;function l(m){if(typeof m=="function")p(m,[]);else if(typeof m=="object")if(Array.isArray(m)){const[h,...x]=m;p(h,x)}else c(m);else throw new TypeError("Expected usable value, not `"+m+"`")}function c(m){if(!("plugins"in m)&&!("settings"in m))throw new Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");d(m.plugins),m.settings&&(a.settings=wf(!0,a.settings,m.settings))}function d(m){let h=-1;if(m!=null)if(Array.isArray(m))for(;++h<m.length;){const x=m[h];l(x)}else throw new TypeError("Expected a list of plugins, not `"+m+"`")}function p(m,h){let x=-1,v=-1;for(;++x<o.length;)if(o[x][0]===m){v=x;break}if(v===-1)o.push([m,...h]);else if(h.length>0){let[b,...C]=h;const k=o[v][1];pp(k)&&pp(b)&&(b=wf(!0,k,b)),o[v]=[m,b,...C]}}}}const d4=new Sh().freeze();function Nf(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function Cf(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function Ef(e,t){if(t)throw new Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function Yy(e){if(!pp(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function Xy(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function Ql(e){return f4(e)?e:new O0(e)}function f4(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function p4(e){return typeof e=="string"||h4(e)}function h4(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const m4="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",Qy=[],Jy={allowDangerousHtml:!0},g4=/^(https?|ircs?|mailto|xmpp)$/i,x4=[{from:"astPlugins",id:"remove-buggy-html-in-markdown-parser"},{from:"allowDangerousHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"allowNode",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowElement"},{from:"allowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowedElements"},{from:"disallowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"disallowedElements"},{from:"escapeHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"includeElementIndex",id:"#remove-includeelementindex"},{from:"includeNodeIndex",id:"change-includenodeindex-to-includeelementindex"},{from:"linkTarget",id:"remove-linktarget"},{from:"plugins",id:"change-plugins-to-remarkplugins",to:"remarkPlugins"},{from:"rawSourcePos",id:"#remove-rawsourcepos"},{from:"renderers",id:"change-renderers-to-components",to:"components"},{from:"source",id:"change-source-to-children",to:"children"},{from:"sourcePos",id:"#remove-sourcepos"},{from:"transformImageUri",id:"#add-urltransform",to:"urlTransform"},{from:"transformLinkUri",id:"#add-urltransform",to:"urlTransform"}];function y4(e){const t=v4(e),n=b4(e);return w4(t.runSync(t.parse(n),n),e)}function v4(e){const t=e.rehypePlugins||Qy,n=e.remarkPlugins||Qy,o=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...Jy}:Jy;return d4().use(J3).use(n).use(KD,o).use(t)}function b4(e){const t=e.children||"",n=new O0;return typeof t=="string"&&(n.value=t),n}function w4(e,t){const n=t.allowedElements,o=t.allowElement,a=t.components,l=t.disallowedElements,c=t.skipHtml,d=t.unwrapDisallowed,p=t.urlTransform||k4;for(const h of x4)Object.hasOwn(t,h.from)&&(""+h.from+(h.to?"use `"+h.to+"` instead":"remove it")+m4+h.id,void 0);return t.className&&(e={type:"element",tagName:"div",properties:{className:t.className},children:e.type==="root"?e.children:[e]}),I0(e,m),AR(e,{Fragment:i.Fragment,components:a,ignoreInvalidStyle:!0,jsx:i.jsx,jsxs:i.jsxs,passKeys:!0,passNode:!0});function m(h,x,v){if(h.type==="raw"&&v&&typeof x=="number")return c?v.children.splice(x,1):v.children[x]={type:"text",value:h.value},x;if(h.type==="element"){let b;for(b in xf)if(Object.hasOwn(xf,b)&&Object.hasOwn(h.properties,b)){const C=h.properties[b],k=xf[b];(k===null||k.includes(h.tagName))&&(h.properties[b]=p(String(C||""),b,h))}}if(h.type==="element"){let b=n?!n.includes(h.tagName):l?l.includes(h.tagName):!1;if(!b&&o&&typeof x=="number"&&(b=!o(h,x,v)),b&&v&&typeof x=="number")return d&&h.children?v.children.splice(x,1,...h.children):v.children.splice(x,1),x}}}function k4(e){const t=e.indexOf(":"),n=e.indexOf("?"),o=e.indexOf("#"),a=e.indexOf("/");return t===-1||a!==-1&&t>a||n!==-1&&t>n||o!==-1&&t>o||g4.test(e.slice(0,t))?e:""}function Yt({content:e,className:t,emptyState:n="No markdown content yet."}){const o=e.replace(/<!--[\s\S]*?-->/g,"");return o.trim()?i.jsx("div",{className:Ue("prose-syntaur max-w-none",t),children:i.jsx(y4,{children:o})}):i.jsx("div",{className:"rounded-md border border-dashed border-border/80 bg-muted/30 px-3 py-4 text-sm text-muted-foreground",children:n})}function j4(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return g.useMemo(()=>o=>{t.forEach(a=>a(o))},t)}const Gc=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function ni(e){const t=Object.prototype.toString.call(e);return t==="[object Window]"||t==="[object global]"}function Nh(e){return"nodeType"in e}function An(e){var t,n;return e?ni(e)?e:Nh(e)&&(t=(n=e.ownerDocument)==null?void 0:n.defaultView)!=null?t:window:window}function Ch(e){const{Document:t}=An(e);return e instanceof t}function Ra(e){return ni(e)?!1:e instanceof An(e).HTMLElement}function L0(e){return e instanceof An(e).SVGElement}function ri(e){return e?ni(e)?e.document:Nh(e)?Ch(e)?e:Ra(e)||L0(e)?e.ownerDocument:document:document:document}const Ar=Gc?g.useLayoutEffect:g.useEffect;function Eh(e){const t=g.useRef(e);return Ar(()=>{t.current=e}),g.useCallback(function(){for(var n=arguments.length,o=new Array(n),a=0;a<n;a++)o[a]=arguments[a];return t.current==null?void 0:t.current(...o)},[])}function S4(){const e=g.useRef(null),t=g.useCallback((o,a)=>{e.current=setInterval(o,a)},[]),n=g.useCallback(()=>{e.current!==null&&(clearInterval(e.current),e.current=null)},[]);return[t,n]}function xa(e,t){t===void 0&&(t=[e]);const n=g.useRef(e);return Ar(()=>{n.current!==e&&(n.current=e)},t),n}function Aa(e,t){const n=g.useRef();return g.useMemo(()=>{const o=e(n.current);return n.current=o,o},[...t])}function wc(e){const t=Eh(e),n=g.useRef(null),o=g.useCallback(a=>{a!==n.current&&(t==null||t(a,n.current)),n.current=a},[]);return[n,o]}function mp(e){const t=g.useRef();return g.useEffect(()=>{t.current=e},[e]),t.current}let Pf={};function Da(e,t){return g.useMemo(()=>{if(t)return t;const n=Pf[e]==null?0:Pf[e]+1;return Pf[e]=n,e+"-"+n},[e,t])}function M0(e){return function(t){for(var n=arguments.length,o=new Array(n>1?n-1:0),a=1;a<n;a++)o[a-1]=arguments[a];return o.reduce((l,c)=>{const d=Object.entries(c);for(const[p,m]of d){const h=l[p];h!=null&&(l[p]=h+e*m)}return l},{...t})}}const Bs=M0(1),kc=M0(-1);function N4(e){return"clientX"in e&&"clientY"in e}function Ph(e){if(!e)return!1;const{KeyboardEvent:t}=An(e.target);return t&&e instanceof t}function C4(e){if(!e)return!1;const{TouchEvent:t}=An(e.target);return t&&e instanceof t}function gp(e){if(C4(e)){if(e.touches&&e.touches.length){const{clientX:t,clientY:n}=e.touches[0];return{x:t,y:n}}else if(e.changedTouches&&e.changedTouches.length){const{clientX:t,clientY:n}=e.changedTouches[0];return{x:t,y:n}}}return N4(e)?{x:e.clientX,y:e.clientY}:null}const Vs=Object.freeze({Translate:{toString(e){if(!e)return;const{x:t,y:n}=e;return"translate3d("+(t?Math.round(t):0)+"px, "+(n?Math.round(n):0)+"px, 0)"}},Scale:{toString(e){if(!e)return;const{scaleX:t,scaleY:n}=e;return"scaleX("+t+") scaleY("+n+")"}},Transform:{toString(e){if(e)return[Vs.Translate.toString(e),Vs.Scale.toString(e)].join(" ")}},Transition:{toString(e){let{property:t,duration:n,easing:o}=e;return t+" "+n+"ms "+o}}}),Zy="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function E4(e){return e.matches(Zy)?e:e.querySelector(Zy)}const P4={display:"none"};function T4(e){let{id:t,value:n}=e;return Ct.createElement("div",{id:t,style:P4},n)}function R4(e){let{id:t,announcement:n,ariaLiveType:o="assertive"}=e;const a={position:"fixed",top:0,left:0,width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0 0 0 0)",clipPath:"inset(100%)",whiteSpace:"nowrap"};return Ct.createElement("div",{id:t,style:a,role:"status","aria-live":o,"aria-atomic":!0},n)}function A4(){const[e,t]=g.useState("");return{announce:g.useCallback(o=>{o!=null&&t(o)},[]),announcement:e}}const _0=g.createContext(null);function D4(e){const t=g.useContext(_0);g.useEffect(()=>{if(!t)throw new Error("useDndMonitor must be used within a children of <DndContext>");return t(e)},[e,t])}function I4(){const[e]=g.useState(()=>new Set),t=g.useCallback(o=>(e.add(o),()=>e.delete(o)),[e]);return[g.useCallback(o=>{let{type:a,event:l}=o;e.forEach(c=>{var d;return(d=c[a])==null?void 0:d.call(c,l)})},[e]),t]}const O4={draggable:`
473
+ To pick up a draggable item, press the space bar.
474
+ While dragging, use the arrow keys to move the item.
475
+ Press space again to drop the item in its new position, or press escape to cancel.
476
+ `},L4={onDragStart(e){let{active:t}=e;return"Picked up draggable item "+t.id+"."},onDragOver(e){let{active:t,over:n}=e;return n?"Draggable item "+t.id+" was moved over droppable area "+n.id+".":"Draggable item "+t.id+" is no longer over a droppable area."},onDragEnd(e){let{active:t,over:n}=e;return n?"Draggable item "+t.id+" was dropped over droppable area "+n.id:"Draggable item "+t.id+" was dropped."},onDragCancel(e){let{active:t}=e;return"Dragging was cancelled. Draggable item "+t.id+" was dropped."}};function M4(e){let{announcements:t=L4,container:n,hiddenTextDescribedById:o,screenReaderInstructions:a=O4}=e;const{announce:l,announcement:c}=A4(),d=Da("DndLiveRegion"),[p,m]=g.useState(!1);if(g.useEffect(()=>{m(!0)},[]),D4(g.useMemo(()=>({onDragStart(x){let{active:v}=x;l(t.onDragStart({active:v}))},onDragMove(x){let{active:v,over:b}=x;t.onDragMove&&l(t.onDragMove({active:v,over:b}))},onDragOver(x){let{active:v,over:b}=x;l(t.onDragOver({active:v,over:b}))},onDragEnd(x){let{active:v,over:b}=x;l(t.onDragEnd({active:v,over:b}))},onDragCancel(x){let{active:v,over:b}=x;l(t.onDragCancel({active:v,over:b}))}}),[l,t])),!p)return null;const h=Ct.createElement(Ct.Fragment,null,Ct.createElement(T4,{id:o,value:a.draggable}),Ct.createElement(R4,{id:d,announcement:c}));return n?So.createPortal(h,n):h}var Ft;(function(e){e.DragStart="dragStart",e.DragMove="dragMove",e.DragEnd="dragEnd",e.DragCancel="dragCancel",e.DragOver="dragOver",e.RegisterDroppable="registerDroppable",e.SetDroppableDisabled="setDroppableDisabled",e.UnregisterDroppable="unregisterDroppable"})(Ft||(Ft={}));function jc(){}function Sc(e,t){return g.useMemo(()=>({sensor:e,options:t??{}}),[e,t])}function $0(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return g.useMemo(()=>[...t].filter(o=>o!=null),[...t])}const dr=Object.freeze({x:0,y:0});function _4(e,t){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function $4(e,t){let{data:{value:n}}=e,{data:{value:o}}=t;return n-o}function F4(e,t){let{data:{value:n}}=e,{data:{value:o}}=t;return o-n}function z4(e,t){if(!e||e.length===0)return null;const[n]=e;return n[t]}function ev(e,t,n){return t===void 0&&(t=e.left),n===void 0&&(n=e.top),{x:t+e.width*.5,y:n+e.height*.5}}const F0=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:o}=e;const a=ev(t,t.left,t.top),l=[];for(const c of o){const{id:d}=c,p=n.get(d);if(p){const m=_4(ev(p),a);l.push({id:d,data:{droppableContainer:c,value:m}})}}return l.sort($4)};function B4(e,t){const n=Math.max(t.top,e.top),o=Math.max(t.left,e.left),a=Math.min(t.left+t.width,e.left+e.width),l=Math.min(t.top+t.height,e.top+e.height),c=a-o,d=l-n;if(o<a&&n<l){const p=t.width*t.height,m=e.width*e.height,h=c*d,x=h/(p+m-h);return Number(x.toFixed(4))}return 0}const U4=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:o}=e;const a=[];for(const l of o){const{id:c}=l,d=n.get(c);if(d){const p=B4(d,t);p>0&&a.push({id:c,data:{droppableContainer:l,value:p}})}}return a.sort(F4)};function H4(e,t,n){return{...e,scaleX:t&&n?t.width/n.width:1,scaleY:t&&n?t.height/n.height:1}}function z0(e,t){return e&&t?{x:e.left-t.left,y:e.top-t.top}:dr}function W4(e){return function(n){for(var o=arguments.length,a=new Array(o>1?o-1:0),l=1;l<o;l++)a[l-1]=arguments[l];return a.reduce((c,d)=>({...c,top:c.top+e*d.y,bottom:c.bottom+e*d.y,left:c.left+e*d.x,right:c.right+e*d.x}),{...n})}}const V4=W4(1);function q4(e){if(e.startsWith("matrix3d(")){const t=e.slice(9,-1).split(/, /);return{x:+t[12],y:+t[13],scaleX:+t[0],scaleY:+t[5]}}else if(e.startsWith("matrix(")){const t=e.slice(7,-1).split(/, /);return{x:+t[4],y:+t[5],scaleX:+t[0],scaleY:+t[3]}}return null}function K4(e,t,n){const o=q4(t);if(!o)return e;const{scaleX:a,scaleY:l,x:c,y:d}=o,p=e.left-c-(1-a)*parseFloat(n),m=e.top-d-(1-l)*parseFloat(n.slice(n.indexOf(" ")+1)),h=a?e.width/a:e.width,x=l?e.height/l:e.height;return{width:h,height:x,top:m,right:p+h,bottom:m+x,left:p}}const G4={ignoreTransform:!1};function oi(e,t){t===void 0&&(t=G4);let n=e.getBoundingClientRect();if(t.ignoreTransform){const{transform:m,transformOrigin:h}=An(e).getComputedStyle(e);m&&(n=K4(n,m,h))}const{top:o,left:a,width:l,height:c,bottom:d,right:p}=n;return{top:o,left:a,width:l,height:c,bottom:d,right:p}}function tv(e){return oi(e,{ignoreTransform:!0})}function Y4(e){const t=e.innerWidth,n=e.innerHeight;return{top:0,left:0,right:t,bottom:n,width:t,height:n}}function X4(e,t){return t===void 0&&(t=An(e).getComputedStyle(e)),t.position==="fixed"}function Q4(e,t){t===void 0&&(t=An(e).getComputedStyle(e));const n=/(auto|scroll|overlay)/;return["overflow","overflowX","overflowY"].some(a=>{const l=t[a];return typeof l=="string"?n.test(l):!1})}function Th(e,t){const n=[];function o(a){if(t!=null&&n.length>=t||!a)return n;if(Ch(a)&&a.scrollingElement!=null&&!n.includes(a.scrollingElement))return n.push(a.scrollingElement),n;if(!Ra(a)||L0(a)||n.includes(a))return n;const l=An(e).getComputedStyle(a);return a!==e&&Q4(a,l)&&n.push(a),X4(a,l)?n:o(a.parentNode)}return e?o(e):n}function B0(e){const[t]=Th(e,1);return t??null}function Tf(e){return!Gc||!e?null:ni(e)?e:Nh(e)?Ch(e)||e===ri(e).scrollingElement?window:Ra(e)?e:null:null}function U0(e){return ni(e)?e.scrollX:e.scrollLeft}function H0(e){return ni(e)?e.scrollY:e.scrollTop}function xp(e){return{x:U0(e),y:H0(e)}}var Gt;(function(e){e[e.Forward=1]="Forward",e[e.Backward=-1]="Backward"})(Gt||(Gt={}));function W0(e){return!Gc||!e?!1:e===document.scrollingElement}function V0(e){const t={x:0,y:0},n=W0(e)?{height:window.innerHeight,width:window.innerWidth}:{height:e.clientHeight,width:e.clientWidth},o={x:e.scrollWidth-n.width,y:e.scrollHeight-n.height},a=e.scrollTop<=t.y,l=e.scrollLeft<=t.x,c=e.scrollTop>=o.y,d=e.scrollLeft>=o.x;return{isTop:a,isLeft:l,isBottom:c,isRight:d,maxScroll:o,minScroll:t}}const J4={x:.2,y:.2};function Z4(e,t,n,o,a){let{top:l,left:c,right:d,bottom:p}=n;o===void 0&&(o=10),a===void 0&&(a=J4);const{isTop:m,isBottom:h,isLeft:x,isRight:v}=V0(e),b={x:0,y:0},C={x:0,y:0},k={height:t.height*a.y,width:t.width*a.x};return!m&&l<=t.top+k.height?(b.y=Gt.Backward,C.y=o*Math.abs((t.top+k.height-l)/k.height)):!h&&p>=t.bottom-k.height&&(b.y=Gt.Forward,C.y=o*Math.abs((t.bottom-k.height-p)/k.height)),!v&&d>=t.right-k.width?(b.x=Gt.Forward,C.x=o*Math.abs((t.right-k.width-d)/k.width)):!x&&c<=t.left+k.width&&(b.x=Gt.Backward,C.x=o*Math.abs((t.left+k.width-c)/k.width)),{direction:b,speed:C}}function eI(e){if(e===document.scrollingElement){const{innerWidth:l,innerHeight:c}=window;return{top:0,left:0,right:l,bottom:c,width:l,height:c}}const{top:t,left:n,right:o,bottom:a}=e.getBoundingClientRect();return{top:t,left:n,right:o,bottom:a,width:e.clientWidth,height:e.clientHeight}}function q0(e){return e.reduce((t,n)=>Bs(t,xp(n)),dr)}function tI(e){return e.reduce((t,n)=>t+U0(n),0)}function nI(e){return e.reduce((t,n)=>t+H0(n),0)}function rI(e,t){if(t===void 0&&(t=oi),!e)return;const{top:n,left:o,bottom:a,right:l}=t(e);B0(e)&&(a<=0||l<=0||n>=window.innerHeight||o>=window.innerWidth)&&e.scrollIntoView({block:"center",inline:"center"})}const oI=[["x",["left","right"],tI],["y",["top","bottom"],nI]];class Rh{constructor(t,n){this.rect=void 0,this.width=void 0,this.height=void 0,this.top=void 0,this.bottom=void 0,this.right=void 0,this.left=void 0;const o=Th(n),a=q0(o);this.rect={...t},this.width=t.width,this.height=t.height;for(const[l,c,d]of oI)for(const p of c)Object.defineProperty(this,p,{get:()=>{const m=d(o),h=a[l]-m;return this.rect[p]+h},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}}class sa{constructor(t){this.target=void 0,this.listeners=[],this.removeAll=()=>{this.listeners.forEach(n=>{var o;return(o=this.target)==null?void 0:o.removeEventListener(...n)})},this.target=t}add(t,n,o){var a;(a=this.target)==null||a.addEventListener(t,n,o),this.listeners.push([t,n,o])}}function sI(e){const{EventTarget:t}=An(e);return e instanceof t?e:ri(e)}function Rf(e,t){const n=Math.abs(e.x),o=Math.abs(e.y);return typeof t=="number"?Math.sqrt(n**2+o**2)>t:"x"in t&&"y"in t?n>t.x&&o>t.y:"x"in t?n>t.x:"y"in t?o>t.y:!1}var Qn;(function(e){e.Click="click",e.DragStart="dragstart",e.Keydown="keydown",e.ContextMenu="contextmenu",e.Resize="resize",e.SelectionChange="selectionchange",e.VisibilityChange="visibilitychange"})(Qn||(Qn={}));function nv(e){e.preventDefault()}function iI(e){e.stopPropagation()}var Ze;(function(e){e.Space="Space",e.Down="ArrowDown",e.Right="ArrowRight",e.Left="ArrowLeft",e.Up="ArrowUp",e.Esc="Escape",e.Enter="Enter",e.Tab="Tab"})(Ze||(Ze={}));const K0={start:[Ze.Space,Ze.Enter],cancel:[Ze.Esc],end:[Ze.Space,Ze.Enter,Ze.Tab]},aI=(e,t)=>{let{currentCoordinates:n}=t;switch(e.code){case Ze.Right:return{...n,x:n.x+25};case Ze.Left:return{...n,x:n.x-25};case Ze.Down:return{...n,y:n.y+25};case Ze.Up:return{...n,y:n.y-25}}};class Yc{constructor(t){this.props=void 0,this.autoScrollEnabled=!1,this.referenceCoordinates=void 0,this.listeners=void 0,this.windowListeners=void 0,this.props=t;const{event:{target:n}}=t;this.props=t,this.listeners=new sa(ri(n)),this.windowListeners=new sa(An(n)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(Qn.Resize,this.handleCancel),this.windowListeners.add(Qn.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(Qn.Keydown,this.handleKeyDown))}handleStart(){const{activeNode:t,onStart:n}=this.props,o=t.node.current;o&&rI(o),n(dr)}handleKeyDown(t){if(Ph(t)){const{active:n,context:o,options:a}=this.props,{keyboardCodes:l=K0,coordinateGetter:c=aI,scrollBehavior:d="smooth"}=a,{code:p}=t;if(l.end.includes(p)){this.handleEnd(t);return}if(l.cancel.includes(p)){this.handleCancel(t);return}const{collisionRect:m}=o.current,h=m?{x:m.left,y:m.top}:dr;this.referenceCoordinates||(this.referenceCoordinates=h);const x=c(t,{active:n,context:o.current,currentCoordinates:h});if(x){const v=kc(x,h),b={x:0,y:0},{scrollableAncestors:C}=o.current;for(const k of C){const j=t.code,{isTop:S,isRight:R,isLeft:N,isBottom:A,maxScroll:O,minScroll:T}=V0(k),D=eI(k),L={x:Math.min(j===Ze.Right?D.right-D.width/2:D.right,Math.max(j===Ze.Right?D.left:D.left+D.width/2,x.x)),y:Math.min(j===Ze.Down?D.bottom-D.height/2:D.bottom,Math.max(j===Ze.Down?D.top:D.top+D.height/2,x.y))},G=j===Ze.Right&&!R||j===Ze.Left&&!N,re=j===Ze.Down&&!A||j===Ze.Up&&!S;if(G&&L.x!==x.x){const z=k.scrollLeft+v.x,K=j===Ze.Right&&z<=O.x||j===Ze.Left&&z>=T.x;if(K&&!v.y){k.scrollTo({left:z,behavior:d});return}K?b.x=k.scrollLeft-z:b.x=j===Ze.Right?k.scrollLeft-O.x:k.scrollLeft-T.x,b.x&&k.scrollBy({left:-b.x,behavior:d});break}else if(re&&L.y!==x.y){const z=k.scrollTop+v.y,K=j===Ze.Down&&z<=O.y||j===Ze.Up&&z>=T.y;if(K&&!v.x){k.scrollTo({top:z,behavior:d});return}K?b.y=k.scrollTop-z:b.y=j===Ze.Down?k.scrollTop-O.y:k.scrollTop-T.y,b.y&&k.scrollBy({top:-b.y,behavior:d});break}}this.handleMove(t,Bs(kc(x,this.referenceCoordinates),b))}}}handleMove(t,n){const{onMove:o}=this.props;t.preventDefault(),o(n)}handleEnd(t){const{onEnd:n}=this.props;t.preventDefault(),this.detach(),n()}handleCancel(t){const{onCancel:n}=this.props;t.preventDefault(),this.detach(),n()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll()}}Yc.activators=[{eventName:"onKeyDown",handler:(e,t,n)=>{let{keyboardCodes:o=K0,onActivation:a}=t,{active:l}=n;const{code:c}=e.nativeEvent;if(o.start.includes(c)){const d=l.activatorNode.current;return d&&e.target!==d?!1:(e.preventDefault(),a==null||a({event:e.nativeEvent}),!0)}return!1}}];function rv(e){return!!(e&&"distance"in e)}function ov(e){return!!(e&&"delay"in e)}class Ah{constructor(t,n,o){var a;o===void 0&&(o=sI(t.event.target)),this.props=void 0,this.events=void 0,this.autoScrollEnabled=!0,this.document=void 0,this.activated=!1,this.initialCoordinates=void 0,this.timeoutId=null,this.listeners=void 0,this.documentListeners=void 0,this.windowListeners=void 0,this.props=t,this.events=n;const{event:l}=t,{target:c}=l;this.props=t,this.events=n,this.document=ri(c),this.documentListeners=new sa(this.document),this.listeners=new sa(o),this.windowListeners=new sa(An(c)),this.initialCoordinates=(a=gp(l))!=null?a:dr,this.handleStart=this.handleStart.bind(this),this.handleMove=this.handleMove.bind(this),this.handleEnd=this.handleEnd.bind(this),this.handleCancel=this.handleCancel.bind(this),this.handleKeydown=this.handleKeydown.bind(this),this.removeTextSelection=this.removeTextSelection.bind(this),this.attach()}attach(){const{events:t,props:{options:{activationConstraint:n,bypassActivationConstraint:o}}}=this;if(this.listeners.add(t.move.name,this.handleMove,{passive:!1}),this.listeners.add(t.end.name,this.handleEnd),t.cancel&&this.listeners.add(t.cancel.name,this.handleCancel),this.windowListeners.add(Qn.Resize,this.handleCancel),this.windowListeners.add(Qn.DragStart,nv),this.windowListeners.add(Qn.VisibilityChange,this.handleCancel),this.windowListeners.add(Qn.ContextMenu,nv),this.documentListeners.add(Qn.Keydown,this.handleKeydown),n){if(o!=null&&o({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(ov(n)){this.timeoutId=setTimeout(this.handleStart,n.delay),this.handlePending(n);return}if(rv(n)){this.handlePending(n);return}}this.handleStart()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll(),setTimeout(this.documentListeners.removeAll,50),this.timeoutId!==null&&(clearTimeout(this.timeoutId),this.timeoutId=null)}handlePending(t,n){const{active:o,onPending:a}=this.props;a(o,t,this.initialCoordinates,n)}handleStart(){const{initialCoordinates:t}=this,{onStart:n}=this.props;t&&(this.activated=!0,this.documentListeners.add(Qn.Click,iI,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(Qn.SelectionChange,this.removeTextSelection),n(t))}handleMove(t){var n;const{activated:o,initialCoordinates:a,props:l}=this,{onMove:c,options:{activationConstraint:d}}=l;if(!a)return;const p=(n=gp(t))!=null?n:dr,m=kc(a,p);if(!o&&d){if(rv(d)){if(d.tolerance!=null&&Rf(m,d.tolerance))return this.handleCancel();if(Rf(m,d.distance))return this.handleStart()}if(ov(d)&&Rf(m,d.tolerance))return this.handleCancel();this.handlePending(d,m);return}t.cancelable&&t.preventDefault(),c(p)}handleEnd(){const{onAbort:t,onEnd:n}=this.props;this.detach(),this.activated||t(this.props.active),n()}handleCancel(){const{onAbort:t,onCancel:n}=this.props;this.detach(),this.activated||t(this.props.active),n()}handleKeydown(t){t.code===Ze.Esc&&this.handleCancel()}removeTextSelection(){var t;(t=this.document.getSelection())==null||t.removeAllRanges()}}const lI={cancel:{name:"pointercancel"},move:{name:"pointermove"},end:{name:"pointerup"}};class Xc extends Ah{constructor(t){const{event:n}=t,o=ri(n.target);super(t,lI,o)}}Xc.activators=[{eventName:"onPointerDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:o}=t;return!n.isPrimary||n.button!==0?!1:(o==null||o({event:n}),!0)}}];const cI={move:{name:"mousemove"},end:{name:"mouseup"}};var yp;(function(e){e[e.RightClick=2]="RightClick"})(yp||(yp={}));class uI extends Ah{constructor(t){super(t,cI,ri(t.event.target))}}uI.activators=[{eventName:"onMouseDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:o}=t;return n.button===yp.RightClick?!1:(o==null||o({event:n}),!0)}}];const Af={cancel:{name:"touchcancel"},move:{name:"touchmove"},end:{name:"touchend"}};class dI extends Ah{constructor(t){super(t,Af)}static setup(){return window.addEventListener(Af.move.name,t,{capture:!1,passive:!1}),function(){window.removeEventListener(Af.move.name,t)};function t(){}}}dI.activators=[{eventName:"onTouchStart",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:o}=t;const{touches:a}=n;return a.length>1?!1:(o==null||o({event:n}),!0)}}];var ia;(function(e){e[e.Pointer=0]="Pointer",e[e.DraggableRect=1]="DraggableRect"})(ia||(ia={}));var Nc;(function(e){e[e.TreeOrder=0]="TreeOrder",e[e.ReversedTreeOrder=1]="ReversedTreeOrder"})(Nc||(Nc={}));function fI(e){let{acceleration:t,activator:n=ia.Pointer,canScroll:o,draggingRect:a,enabled:l,interval:c=5,order:d=Nc.TreeOrder,pointerCoordinates:p,scrollableAncestors:m,scrollableAncestorRects:h,delta:x,threshold:v}=e;const b=hI({delta:x,disabled:!l}),[C,k]=S4(),j=g.useRef({x:0,y:0}),S=g.useRef({x:0,y:0}),R=g.useMemo(()=>{switch(n){case ia.Pointer:return p?{top:p.y,bottom:p.y,left:p.x,right:p.x}:null;case ia.DraggableRect:return a}},[n,a,p]),N=g.useRef(null),A=g.useCallback(()=>{const T=N.current;if(!T)return;const D=j.current.x*S.current.x,L=j.current.y*S.current.y;T.scrollBy(D,L)},[]),O=g.useMemo(()=>d===Nc.TreeOrder?[...m].reverse():m,[d,m]);g.useEffect(()=>{if(!l||!m.length||!R){k();return}for(const T of O){if((o==null?void 0:o(T))===!1)continue;const D=m.indexOf(T),L=h[D];if(!L)continue;const{direction:G,speed:re}=Z4(T,L,R,t,v);for(const z of["x","y"])b[z][G[z]]||(re[z]=0,G[z]=0);if(re.x>0||re.y>0){k(),N.current=T,C(A,c),j.current=re,S.current=G;return}}j.current={x:0,y:0},S.current={x:0,y:0},k()},[t,A,o,k,l,c,JSON.stringify(R),JSON.stringify(b),C,m,O,h,JSON.stringify(v)])}const pI={x:{[Gt.Backward]:!1,[Gt.Forward]:!1},y:{[Gt.Backward]:!1,[Gt.Forward]:!1}};function hI(e){let{delta:t,disabled:n}=e;const o=mp(t);return Aa(a=>{if(n||!o||!a)return pI;const l={x:Math.sign(t.x-o.x),y:Math.sign(t.y-o.y)};return{x:{[Gt.Backward]:a.x[Gt.Backward]||l.x===-1,[Gt.Forward]:a.x[Gt.Forward]||l.x===1},y:{[Gt.Backward]:a.y[Gt.Backward]||l.y===-1,[Gt.Forward]:a.y[Gt.Forward]||l.y===1}}},[n,t,o])}function mI(e,t){const n=t!=null?e.get(t):void 0,o=n?n.node.current:null;return Aa(a=>{var l;return t==null?null:(l=o??a)!=null?l:null},[o,t])}function gI(e,t){return g.useMemo(()=>e.reduce((n,o)=>{const{sensor:a}=o,l=a.activators.map(c=>({eventName:c.eventName,handler:t(c.handler,o)}));return[...n,...l]},[]),[e,t])}var ya;(function(e){e[e.Always=0]="Always",e[e.BeforeDragging=1]="BeforeDragging",e[e.WhileDragging=2]="WhileDragging"})(ya||(ya={}));var vp;(function(e){e.Optimized="optimized"})(vp||(vp={}));const sv=new Map;function xI(e,t){let{dragging:n,dependencies:o,config:a}=t;const[l,c]=g.useState(null),{frequency:d,measure:p,strategy:m}=a,h=g.useRef(e),x=j(),v=xa(x),b=g.useCallback(function(S){S===void 0&&(S=[]),!v.current&&c(R=>R===null?S:R.concat(S.filter(N=>!R.includes(N))))},[v]),C=g.useRef(null),k=Aa(S=>{if(x&&!n)return sv;if(!S||S===sv||h.current!==e||l!=null){const R=new Map;for(let N of e){if(!N)continue;if(l&&l.length>0&&!l.includes(N.id)&&N.rect.current){R.set(N.id,N.rect.current);continue}const A=N.node.current,O=A?new Rh(p(A),A):null;N.rect.current=O,O&&R.set(N.id,O)}return R}return S},[e,l,n,x,p]);return g.useEffect(()=>{h.current=e},[e]),g.useEffect(()=>{x||b()},[n,x]),g.useEffect(()=>{l&&l.length>0&&c(null)},[JSON.stringify(l)]),g.useEffect(()=>{x||typeof d!="number"||C.current!==null||(C.current=setTimeout(()=>{b(),C.current=null},d))},[d,x,b,...o]),{droppableRects:k,measureDroppableContainers:b,measuringScheduled:l!=null};function j(){switch(m){case ya.Always:return!1;case ya.BeforeDragging:return n;default:return!n}}}function G0(e,t){return Aa(n=>e?n||(typeof t=="function"?t(e):e):null,[t,e])}function yI(e,t){return G0(e,t)}function vI(e){let{callback:t,disabled:n}=e;const o=Eh(t),a=g.useMemo(()=>{if(n||typeof window>"u"||typeof window.MutationObserver>"u")return;const{MutationObserver:l}=window;return new l(o)},[o,n]);return g.useEffect(()=>()=>a==null?void 0:a.disconnect(),[a]),a}function Qc(e){let{callback:t,disabled:n}=e;const o=Eh(t),a=g.useMemo(()=>{if(n||typeof window>"u"||typeof window.ResizeObserver>"u")return;const{ResizeObserver:l}=window;return new l(o)},[n]);return g.useEffect(()=>()=>a==null?void 0:a.disconnect(),[a]),a}function bI(e){return new Rh(oi(e),e)}function iv(e,t,n){t===void 0&&(t=bI);const[o,a]=g.useState(null);function l(){a(p=>{if(!e)return null;if(e.isConnected===!1){var m;return(m=p??n)!=null?m:null}const h=t(e);return JSON.stringify(p)===JSON.stringify(h)?p:h})}const c=vI({callback(p){if(e)for(const m of p){const{type:h,target:x}=m;if(h==="childList"&&x instanceof HTMLElement&&x.contains(e)){l();break}}}}),d=Qc({callback:l});return Ar(()=>{l(),e?(d==null||d.observe(e),c==null||c.observe(document.body,{childList:!0,subtree:!0})):(d==null||d.disconnect(),c==null||c.disconnect())},[e]),o}function wI(e){const t=G0(e);return z0(e,t)}const av=[];function kI(e){const t=g.useRef(e),n=Aa(o=>e?o&&o!==av&&e&&t.current&&e.parentNode===t.current.parentNode?o:Th(e):av,[e]);return g.useEffect(()=>{t.current=e},[e]),n}function jI(e){const[t,n]=g.useState(null),o=g.useRef(e),a=g.useCallback(l=>{const c=Tf(l.target);c&&n(d=>d?(d.set(c,xp(c)),new Map(d)):null)},[]);return g.useEffect(()=>{const l=o.current;if(e!==l){c(l);const d=e.map(p=>{const m=Tf(p);return m?(m.addEventListener("scroll",a,{passive:!0}),[m,xp(m)]):null}).filter(p=>p!=null);n(d.length?new Map(d):null),o.current=e}return()=>{c(e),c(l)};function c(d){d.forEach(p=>{const m=Tf(p);m==null||m.removeEventListener("scroll",a)})}},[a,e]),g.useMemo(()=>e.length?t?Array.from(t.values()).reduce((l,c)=>Bs(l,c),dr):q0(e):dr,[e,t])}function lv(e,t){t===void 0&&(t=[]);const n=g.useRef(null);return g.useEffect(()=>{n.current=null},t),g.useEffect(()=>{const o=e!==dr;o&&!n.current&&(n.current=e),!o&&n.current&&(n.current=null)},[e]),n.current?kc(e,n.current):dr}function SI(e){g.useEffect(()=>{if(!Gc)return;const t=e.map(n=>{let{sensor:o}=n;return o.setup==null?void 0:o.setup()});return()=>{for(const n of t)n==null||n()}},e.map(t=>{let{sensor:n}=t;return n}))}function NI(e,t){return g.useMemo(()=>e.reduce((n,o)=>{let{eventName:a,handler:l}=o;return n[a]=c=>{l(c,t)},n},{}),[e,t])}function Y0(e){return g.useMemo(()=>e?Y4(e):null,[e])}const cv=[];function CI(e,t){t===void 0&&(t=oi);const[n]=e,o=Y0(n?An(n):null),[a,l]=g.useState(cv);function c(){l(()=>e.length?e.map(p=>W0(p)?o:new Rh(t(p),p)):cv)}const d=Qc({callback:c});return Ar(()=>{d==null||d.disconnect(),c(),e.forEach(p=>d==null?void 0:d.observe(p))},[e]),a}function EI(e){if(!e)return null;if(e.children.length>1)return e;const t=e.children[0];return Ra(t)?t:e}function PI(e){let{measure:t}=e;const[n,o]=g.useState(null),a=g.useCallback(m=>{for(const{target:h}of m)if(Ra(h)){o(x=>{const v=t(h);return x?{...x,width:v.width,height:v.height}:v});break}},[t]),l=Qc({callback:a}),c=g.useCallback(m=>{const h=EI(m);l==null||l.disconnect(),h&&(l==null||l.observe(h)),o(h?t(h):null)},[t,l]),[d,p]=wc(c);return g.useMemo(()=>({nodeRef:d,rect:n,setRef:p}),[n,d,p])}const TI=[{sensor:Xc,options:{}},{sensor:Yc,options:{}}],RI={current:{}},dc={draggable:{measure:tv},droppable:{measure:tv,strategy:ya.WhileDragging,frequency:vp.Optimized},dragOverlay:{measure:oi}};class aa extends Map{get(t){var n;return t!=null&&(n=super.get(t))!=null?n:void 0}toArray(){return Array.from(this.values())}getEnabled(){return this.toArray().filter(t=>{let{disabled:n}=t;return!n})}getNodeFor(t){var n,o;return(n=(o=this.get(t))==null?void 0:o.node.current)!=null?n:void 0}}const AI={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new aa,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:jc},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:dc,measureDroppableContainers:jc,windowRect:null,measuringScheduled:!1},DI={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:jc,draggableNodes:new Map,over:null,measureDroppableContainers:jc},Jc=g.createContext(DI),X0=g.createContext(AI);function II(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new aa}}}function OI(e,t){switch(t.type){case Ft.DragStart:return{...e,draggable:{...e.draggable,initialCoordinates:t.initialCoordinates,active:t.active}};case Ft.DragMove:return e.draggable.active==null?e:{...e,draggable:{...e.draggable,translate:{x:t.coordinates.x-e.draggable.initialCoordinates.x,y:t.coordinates.y-e.draggable.initialCoordinates.y}}};case Ft.DragEnd:case Ft.DragCancel:return{...e,draggable:{...e.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case Ft.RegisterDroppable:{const{element:n}=t,{id:o}=n,a=new aa(e.droppable.containers);return a.set(o,n),{...e,droppable:{...e.droppable,containers:a}}}case Ft.SetDroppableDisabled:{const{id:n,key:o,disabled:a}=t,l=e.droppable.containers.get(n);if(!l||o!==l.key)return e;const c=new aa(e.droppable.containers);return c.set(n,{...l,disabled:a}),{...e,droppable:{...e.droppable,containers:c}}}case Ft.UnregisterDroppable:{const{id:n,key:o}=t,a=e.droppable.containers.get(n);if(!a||o!==a.key)return e;const l=new aa(e.droppable.containers);return l.delete(n),{...e,droppable:{...e.droppable,containers:l}}}default:return e}}function LI(e){let{disabled:t}=e;const{active:n,activatorEvent:o,draggableNodes:a}=g.useContext(Jc),l=mp(o),c=mp(n==null?void 0:n.id);return g.useEffect(()=>{if(!t&&!o&&l&&c!=null){if(!Ph(l)||document.activeElement===l.target)return;const d=a.get(c);if(!d)return;const{activatorNode:p,node:m}=d;if(!p.current&&!m.current)return;requestAnimationFrame(()=>{for(const h of[p.current,m.current]){if(!h)continue;const x=E4(h);if(x){x.focus();break}}})}},[o,t,a,c,l]),null}function MI(e,t){let{transform:n,...o}=t;return e!=null&&e.length?e.reduce((a,l)=>l({transform:a,...o}),n):n}function _I(e){return g.useMemo(()=>({draggable:{...dc.draggable,...e==null?void 0:e.draggable},droppable:{...dc.droppable,...e==null?void 0:e.droppable},dragOverlay:{...dc.dragOverlay,...e==null?void 0:e.dragOverlay}}),[e==null?void 0:e.draggable,e==null?void 0:e.droppable,e==null?void 0:e.dragOverlay])}function $I(e){let{activeNode:t,measure:n,initialRect:o,config:a=!0}=e;const l=g.useRef(!1),{x:c,y:d}=typeof a=="boolean"?{x:a,y:a}:a;Ar(()=>{if(!c&&!d||!t){l.current=!1;return}if(l.current||!o)return;const m=t==null?void 0:t.node.current;if(!m||m.isConnected===!1)return;const h=n(m),x=z0(h,o);if(c||(x.x=0),d||(x.y=0),l.current=!0,Math.abs(x.x)>0||Math.abs(x.y)>0){const v=B0(m);v&&v.scrollBy({top:x.y,left:x.x})}},[t,c,d,o,n])}const Q0=g.createContext({...dr,scaleX:1,scaleY:1});var jo;(function(e){e[e.Uninitialized=0]="Uninitialized",e[e.Initializing=1]="Initializing",e[e.Initialized=2]="Initialized"})(jo||(jo={}));const J0=g.memo(function(t){var n,o,a,l;let{id:c,accessibility:d,autoScroll:p=!0,children:m,sensors:h=TI,collisionDetection:x=U4,measuring:v,modifiers:b,...C}=t;const k=g.useReducer(OI,void 0,II),[j,S]=k,[R,N]=I4(),[A,O]=g.useState(jo.Uninitialized),T=A===jo.Initialized,{draggable:{active:D,nodes:L,translate:G},droppable:{containers:re}}=j,z=D!=null?L.get(D):null,K=g.useRef({initial:null,translated:null}),q=g.useMemo(()=>{var Ve;return D!=null?{id:D,data:(Ve=z==null?void 0:z.data)!=null?Ve:RI,rect:K}:null},[D,z]),J=g.useRef(null),[_,F]=g.useState(null),[B,U]=g.useState(null),Z=xa(C,Object.values(C)),P=Da("DndDescribedBy",c),M=g.useMemo(()=>re.getEnabled(),[re]),Q=_I(v),{droppableRects:I,measureDroppableContainers:ge,measuringScheduled:Se}=xI(M,{dragging:T,dependencies:[G.x,G.y],config:Q.droppable}),te=mI(L,D),fe=g.useMemo(()=>B?gp(B):null,[B]),ve=xt(),we=yI(te,Q.draggable.measure);$I({activeNode:D!=null?L.get(D):null,config:ve.layoutShiftCompensation,initialRect:we,measure:Q.draggable.measure});const be=iv(te,Q.draggable.measure,we),Ye=iv(te?te.parentElement:null),Xe=g.useRef({activatorEvent:null,active:null,activeNode:te,collisionRect:null,collisions:null,droppableRects:I,draggableNodes:L,draggingNode:null,draggingNodeRect:null,droppableContainers:re,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),ne=re.getNodeFor((n=Xe.current.over)==null?void 0:n.id),Y=PI({measure:Q.dragOverlay.measure}),ae=(o=Y.nodeRef.current)!=null?o:te,xe=T?(a=Y.rect)!=null?a:be:null,qe=!!(Y.nodeRef.current&&Y.rect),Oe=wI(qe?null:be),Be=Y0(ae?An(ae):null),Ge=kI(T?ne??te:null),jt=CI(Ge),St=MI(b,{transform:{x:G.x-Oe.x,y:G.y-Oe.y,scaleX:1,scaleY:1},activatorEvent:B,active:q,activeNodeRect:be,containerNodeRect:Ye,draggingNodeRect:xe,over:Xe.current.over,overlayNodeRect:Y.rect,scrollableAncestors:Ge,scrollableAncestorRects:jt,windowRect:Be}),Dt=fe?Bs(fe,G):null,Qt=jI(Ge),Et=lv(Qt),ie=lv(Qt,[be]),ce=Bs(St,Et),ye=xe?V4(xe,St):null,se=q&&ye?x({active:q,collisionRect:ye,droppableRects:I,droppableContainers:M,pointerCoordinates:Dt}):null,Ne=z4(se,"id"),[Re,Ht]=g.useState(null),rn=qe?St:Bs(St,ie),Jt=H4(rn,(l=Re==null?void 0:Re.rect)!=null?l:null,be),V=g.useRef(null),pe=g.useCallback((Ve,ot)=>{let{sensor:Pt,options:Wt}=ot;if(J.current==null)return;const Zt=L.get(J.current);if(!Zt)return;const sn=Ve.nativeEvent,vn=new Pt({active:J.current,activeNode:Zt,event:sn,options:Wt,context:Xe,onAbort(yt){if(!L.get(yt))return;const{onDragAbort:an}=Z.current,er={id:yt};an==null||an(er),R({type:"onDragAbort",event:er})},onPending(yt,Wn,an,er){if(!L.get(yt))return;const{onDragPending:gr}=Z.current,Dn={id:yt,constraint:Wn,initialCoordinates:an,offset:er};gr==null||gr(Dn),R({type:"onDragPending",event:Dn})},onStart(yt){const Wn=J.current;if(Wn==null)return;const an=L.get(Wn);if(!an)return;const{onDragStart:er}=Z.current,tr={activatorEvent:sn,active:{id:Wn,data:an.data,rect:K}};So.unstable_batchedUpdates(()=>{er==null||er(tr),O(jo.Initializing),S({type:Ft.DragStart,initialCoordinates:yt,active:Wn}),R({type:"onDragStart",event:tr}),F(V.current),U(sn)})},onMove(yt){S({type:Ft.DragMove,coordinates:yt})},onEnd:Lr(Ft.DragEnd),onCancel:Lr(Ft.DragCancel)});V.current=vn;function Lr(yt){return async function(){const{active:an,collisions:er,over:tr,scrollAdjustedTranslate:gr}=Xe.current;let Dn=null;if(an&&gr){const{cancelDrop:Mr}=Z.current;Dn={activatorEvent:sn,active:an,collisions:er,delta:gr,over:tr},yt===Ft.DragEnd&&typeof Mr=="function"&&await Promise.resolve(Mr(Dn))&&(yt=Ft.DragCancel)}J.current=null,So.unstable_batchedUpdates(()=>{S({type:yt}),O(jo.Uninitialized),Ht(null),F(null),U(null),V.current=null;const Mr=yt===Ft.DragEnd?"onDragEnd":"onDragCancel";if(Dn){const li=Z.current[Mr];li==null||li(Dn),R({type:Mr,event:Dn})}})}}},[L]),Ce=g.useCallback((Ve,ot)=>(Pt,Wt)=>{const Zt=Pt.nativeEvent,sn=L.get(Wt);if(J.current!==null||!sn||Zt.dndKit||Zt.defaultPrevented)return;const vn={active:sn};Ve(Pt,ot.options,vn)===!0&&(Zt.dndKit={capturedBy:ot.sensor},J.current=Wt,pe(Pt,ot))},[L,pe]),ze=gI(h,Ce);SI(h),Ar(()=>{be&&A===jo.Initializing&&O(jo.Initialized)},[be,A]),g.useEffect(()=>{const{onDragMove:Ve}=Z.current,{active:ot,activatorEvent:Pt,collisions:Wt,over:Zt}=Xe.current;if(!ot||!Pt)return;const sn={active:ot,activatorEvent:Pt,collisions:Wt,delta:{x:ce.x,y:ce.y},over:Zt};So.unstable_batchedUpdates(()=>{Ve==null||Ve(sn),R({type:"onDragMove",event:sn})})},[ce.x,ce.y]),g.useEffect(()=>{const{active:Ve,activatorEvent:ot,collisions:Pt,droppableContainers:Wt,scrollAdjustedTranslate:Zt}=Xe.current;if(!Ve||J.current==null||!ot||!Zt)return;const{onDragOver:sn}=Z.current,vn=Wt.get(Ne),Lr=vn&&vn.rect.current?{id:vn.id,rect:vn.rect.current,data:vn.data,disabled:vn.disabled}:null,yt={active:Ve,activatorEvent:ot,collisions:Pt,delta:{x:Zt.x,y:Zt.y},over:Lr};So.unstable_batchedUpdates(()=>{Ht(Lr),sn==null||sn(yt),R({type:"onDragOver",event:yt})})},[Ne]),Ar(()=>{Xe.current={activatorEvent:B,active:q,activeNode:te,collisionRect:ye,collisions:se,droppableRects:I,draggableNodes:L,draggingNode:ae,draggingNodeRect:xe,droppableContainers:re,over:Re,scrollableAncestors:Ge,scrollAdjustedTranslate:ce},K.current={initial:xe,translated:ye}},[q,te,se,ye,L,ae,xe,I,re,Re,Ge,ce]),fI({...ve,delta:G,draggingRect:ye,pointerCoordinates:Dt,scrollableAncestors:Ge,scrollableAncestorRects:jt});const Hn=g.useMemo(()=>({active:q,activeNode:te,activeNodeRect:be,activatorEvent:B,collisions:se,containerNodeRect:Ye,dragOverlay:Y,draggableNodes:L,droppableContainers:re,droppableRects:I,over:Re,measureDroppableContainers:ge,scrollableAncestors:Ge,scrollableAncestorRects:jt,measuringConfiguration:Q,measuringScheduled:Se,windowRect:Be}),[q,te,be,B,se,Ye,Y,L,re,I,Re,ge,Ge,jt,Q,Se,Be]),on=g.useMemo(()=>({activatorEvent:B,activators:ze,active:q,activeNodeRect:be,ariaDescribedById:{draggable:P},dispatch:S,draggableNodes:L,over:Re,measureDroppableContainers:ge}),[B,ze,q,be,S,P,L,Re,ge]);return Ct.createElement(_0.Provider,{value:N},Ct.createElement(Jc.Provider,{value:on},Ct.createElement(X0.Provider,{value:Hn},Ct.createElement(Q0.Provider,{value:Jt},m)),Ct.createElement(LI,{disabled:(d==null?void 0:d.restoreFocus)===!1})),Ct.createElement(M4,{...d,hiddenTextDescribedById:P}));function xt(){const Ve=(_==null?void 0:_.autoScrollEnabled)===!1,ot=typeof p=="object"?p.enabled===!1:p===!1,Pt=T&&!Ve&&!ot;return typeof p=="object"?{...p,enabled:Pt}:{enabled:Pt}}}),FI=g.createContext(null),uv="button",zI="Draggable";function BI(e){let{id:t,data:n,disabled:o=!1,attributes:a}=e;const l=Da(zI),{activators:c,activatorEvent:d,active:p,activeNodeRect:m,ariaDescribedById:h,draggableNodes:x,over:v}=g.useContext(Jc),{role:b=uv,roleDescription:C="draggable",tabIndex:k=0}=a??{},j=(p==null?void 0:p.id)===t,S=g.useContext(j?Q0:FI),[R,N]=wc(),[A,O]=wc(),T=NI(c,t),D=xa(n);Ar(()=>(x.set(t,{id:t,key:l,node:R,activatorNode:A,data:D}),()=>{const G=x.get(t);G&&G.key===l&&x.delete(t)}),[x,t]);const L=g.useMemo(()=>({role:b,tabIndex:k,"aria-disabled":o,"aria-pressed":j&&b===uv?!0:void 0,"aria-roledescription":C,"aria-describedby":h.draggable}),[o,b,k,j,C,h.draggable]);return{active:p,activatorEvent:d,activeNodeRect:m,attributes:L,isDragging:j,listeners:o?void 0:T,node:R,over:v,setNodeRef:N,setActivatorNodeRef:O,transform:S}}function UI(){return g.useContext(X0)}const HI="Droppable",WI={timeout:25};function VI(e){let{data:t,disabled:n=!1,id:o,resizeObserverConfig:a}=e;const l=Da(HI),{active:c,dispatch:d,over:p,measureDroppableContainers:m}=g.useContext(Jc),h=g.useRef({disabled:n}),x=g.useRef(!1),v=g.useRef(null),b=g.useRef(null),{disabled:C,updateMeasurementsFor:k,timeout:j}={...WI,...a},S=xa(k??o),R=g.useCallback(()=>{if(!x.current){x.current=!0;return}b.current!=null&&clearTimeout(b.current),b.current=setTimeout(()=>{m(Array.isArray(S.current)?S.current:[S.current]),b.current=null},j)},[j]),N=Qc({callback:R,disabled:C||!c}),A=g.useCallback((L,G)=>{N&&(G&&(N.unobserve(G),x.current=!1),L&&N.observe(L))},[N]),[O,T]=wc(A),D=xa(t);return g.useEffect(()=>{!N||!O.current||(N.disconnect(),x.current=!1,N.observe(O.current))},[O,N]),g.useEffect(()=>(d({type:Ft.RegisterDroppable,element:{id:o,key:l,disabled:n,node:O,rect:v,data:D}}),()=>d({type:Ft.UnregisterDroppable,key:l,id:o})),[o]),g.useEffect(()=>{n!==h.current.disabled&&(d({type:Ft.SetDroppableDisabled,id:o,key:l,disabled:n}),h.current.disabled=n)},[o,l,n,d]),{active:c,rect:v,isOver:(p==null?void 0:p.id)===o,node:O,over:p,setNodeRef:T}}function Zc(e,t,n){const o=e.slice();return o.splice(n<0?o.length+n:n,0,o.splice(t,1)[0]),o}function qI(e,t){return e.reduce((n,o,a)=>{const l=t.get(o);return l&&(n[a]=l),n},Array(e.length))}function Jl(e){return e!==null&&e>=0}function KI(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}function GI(e){return typeof e=="boolean"?{draggable:e,droppable:e}:e}const Z0=e=>{let{rects:t,activeIndex:n,overIndex:o,index:a}=e;const l=Zc(t,o,n),c=t[a],d=l[a];return!d||!c?null:{x:d.left-c.left,y:d.top-c.top,scaleX:d.width/c.width,scaleY:d.height/c.height}},Zl={scaleX:1,scaleY:1},ek=e=>{var t;let{activeIndex:n,activeNodeRect:o,index:a,rects:l,overIndex:c}=e;const d=(t=l[n])!=null?t:o;if(!d)return null;if(a===n){const m=l[c];return m?{x:0,y:n<c?m.top+m.height-(d.top+d.height):m.top-d.top,...Zl}:null}const p=YI(l,a,n);return a>n&&a<=c?{x:0,y:-d.height-p,...Zl}:a<n&&a>=c?{x:0,y:d.height+p,...Zl}:{x:0,y:0,...Zl}};function YI(e,t,n){const o=e[t],a=e[t-1],l=e[t+1];return o?n<t?a?o.top-(a.top+a.height):l?l.top-(o.top+o.height):0:l?l.top-(o.top+o.height):a?o.top-(a.top+a.height):0:0}const tk="Sortable",nk=Ct.createContext({activeIndex:-1,containerId:tk,disableTransforms:!1,items:[],overIndex:-1,useDragOverlay:!1,sortedRects:[],strategy:Z0,disabled:{draggable:!1,droppable:!1}});function rk(e){let{children:t,id:n,items:o,strategy:a=Z0,disabled:l=!1}=e;const{active:c,dragOverlay:d,droppableRects:p,over:m,measureDroppableContainers:h}=UI(),x=Da(tk,n),v=d.rect!==null,b=g.useMemo(()=>o.map(T=>typeof T=="object"&&"id"in T?T.id:T),[o]),C=c!=null,k=c?b.indexOf(c.id):-1,j=m?b.indexOf(m.id):-1,S=g.useRef(b),R=!KI(b,S.current),N=j!==-1&&k===-1||R,A=GI(l);Ar(()=>{R&&C&&h(b)},[R,b,C,h]),g.useEffect(()=>{S.current=b},[b]);const O=g.useMemo(()=>({activeIndex:k,containerId:x,disabled:A,disableTransforms:N,items:b,overIndex:j,useDragOverlay:v,sortedRects:qI(b,p),strategy:a}),[k,x,A.draggable,A.droppable,N,b,j,p,v,a]);return Ct.createElement(nk.Provider,{value:O},t)}const XI=e=>{let{id:t,items:n,activeIndex:o,overIndex:a}=e;return Zc(n,o,a).indexOf(t)},QI=e=>{let{containerId:t,isSorting:n,wasDragging:o,index:a,items:l,newIndex:c,previousItems:d,previousContainerId:p,transition:m}=e;return!m||!o||d!==l&&a===c?!1:n?!0:c!==a&&t===p},JI={duration:200,easing:"ease"},ok="transform",ZI=Vs.Transition.toString({property:ok,duration:0,easing:"linear"}),eO={roleDescription:"sortable"};function tO(e){let{disabled:t,index:n,node:o,rect:a}=e;const[l,c]=g.useState(null),d=g.useRef(n);return Ar(()=>{if(!t&&n!==d.current&&o.current){const p=a.current;if(p){const m=oi(o.current,{ignoreTransform:!0}),h={x:p.left-m.left,y:p.top-m.top,scaleX:p.width/m.width,scaleY:p.height/m.height};(h.x||h.y)&&c(h)}}n!==d.current&&(d.current=n)},[t,n,o,a]),g.useEffect(()=>{l&&c(null)},[l]),l}function sk(e){let{animateLayoutChanges:t=QI,attributes:n,disabled:o,data:a,getNewIndex:l=XI,id:c,strategy:d,resizeObserverConfig:p,transition:m=JI}=e;const{items:h,containerId:x,activeIndex:v,disabled:b,disableTransforms:C,sortedRects:k,overIndex:j,useDragOverlay:S,strategy:R}=g.useContext(nk),N=nO(o,b),A=h.indexOf(c),O=g.useMemo(()=>({sortable:{containerId:x,index:A,items:h},...a}),[x,a,A,h]),T=g.useMemo(()=>h.slice(h.indexOf(c)),[h,c]),{rect:D,node:L,isOver:G,setNodeRef:re}=VI({id:c,data:O,disabled:N.droppable,resizeObserverConfig:{updateMeasurementsFor:T,...p}}),{active:z,activatorEvent:K,activeNodeRect:q,attributes:J,setNodeRef:_,listeners:F,isDragging:B,over:U,setActivatorNodeRef:Z,transform:P}=BI({id:c,data:O,attributes:{...eO,...n},disabled:N.draggable}),M=j4(re,_),Q=!!z,I=Q&&!C&&Jl(v)&&Jl(j),ge=!S&&B,Se=ge&&I?P:null,fe=I?Se??(d??R)({rects:k,activeNodeRect:q,activeIndex:v,overIndex:j,index:A}):null,ve=Jl(v)&&Jl(j)?l({id:c,items:h,activeIndex:v,overIndex:j}):A,we=z==null?void 0:z.id,be=g.useRef({activeId:we,items:h,newIndex:ve,containerId:x}),Ye=h!==be.current.items,Xe=t({active:z,containerId:x,isDragging:B,isSorting:Q,id:c,index:A,items:h,newIndex:be.current.newIndex,previousItems:be.current.items,previousContainerId:be.current.containerId,transition:m,wasDragging:be.current.activeId!=null}),ne=tO({disabled:!Xe,index:A,node:L,rect:D});return g.useEffect(()=>{Q&&be.current.newIndex!==ve&&(be.current.newIndex=ve),x!==be.current.containerId&&(be.current.containerId=x),h!==be.current.items&&(be.current.items=h)},[Q,ve,x,h]),g.useEffect(()=>{if(we===be.current.activeId)return;if(we!=null&&be.current.activeId==null){be.current.activeId=we;return}const ae=setTimeout(()=>{be.current.activeId=we},50);return()=>clearTimeout(ae)},[we]),{active:z,activeIndex:v,attributes:J,data:O,rect:D,index:A,newIndex:ve,items:h,isOver:G,isSorting:Q,isDragging:B,listeners:F,node:L,overIndex:j,over:U,setNodeRef:M,setActivatorNodeRef:Z,setDroppableNodeRef:re,setDraggableNodeRef:_,transform:ne??fe,transition:Y()};function Y(){if(ne||Ye&&be.current.newIndex===A)return ZI;if(!(ge&&!Ph(K)||!m)&&(Q||Xe))return Vs.Transition.toString({...m,property:ok})}}function nO(e,t){var n,o;return typeof e=="boolean"?{draggable:e,droppable:!1}:{draggable:(n=e==null?void 0:e.draggable)!=null?n:t.draggable,droppable:(o=e==null?void 0:e.droppable)!=null?o:t.droppable}}Ze.Down,Ze.Right,Ze.Up,Ze.Left;function Dr(e){return`/api/projects/${encodeURIComponent(e)}/todos`}function rO(e){const[t,n]=g.useState(null),[o,a]=g.useState(!0),[l,c]=g.useState(null),d=g.useCallback(async()=>{if(e)try{const p=await fetch(Dr(e));if(!p.ok)throw new Error(`HTTP ${p.status}`);n(await p.json()),c(null)}catch(p){c(p instanceof Error?p.message:"Failed to fetch todos")}finally{a(!1)}},[e]);return g.useEffect(()=>{d()},[d]),Lc(p=>{p.type==="todos-updated"&&p.projectSlug===e&&d()}),{data:t,loading:o,error:l,refetch:d}}async function oO(e,t,n){await fetch(Dr(e),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({description:t,tags:n})})}async function sO(e,t,n){await fetch(`${Dr(e)}/${t}/complete`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({summary:"Completed."})})}async function iO(e,t,n){await fetch(`${Dr(e)}/${t}/block`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({reason:n})})}async function aO(e,t,n){await fetch(`${Dr(e)}/${t}/start`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({session:n})})}async function lO(e,t){await fetch(`${Dr(e)}/${t}/reopen`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({})})}async function cO(e,t){await fetch(`${Dr(e)}/reorder`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({ids:t})})}async function uO(e,t){await fetch(`${Dr(e)}/${t}`,{method:"DELETE"})}async function ik(e,t){const n=await fetch(e,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)});if(!n.ok){const o=await n.text().catch(()=>"");let a=null;try{a=o?JSON.parse(o):null}catch{}const l=(a==null?void 0:a.error)||o||`HTTP ${n.status}`,c=new Error(l);throw c.status=n.status,c}return n.json().catch(()=>({}))}async function dO(e,t){await ik(`${Dr(e)}/promote`,t)}async function fO(e,t,n){await ik(`${Dr(e)}/${t}/move`,{to:n})}const dv=[{value:"open",icon:"○",label:"Open",color:"text-muted-foreground"},{value:"in_progress",icon:"◉",label:"In Progress",color:"text-status-in-progress-foreground"},{value:"completed",icon:"✓",label:"Completed",color:"text-status-completed-foreground"},{value:"blocked",icon:"✕",label:"Blocked",color:"text-status-blocked-foreground"}];function Dh({status:e,onChange:t}){const[n,o]=g.useState(!1),a=g.useRef(null);g.useEffect(()=>{if(!n)return;function c(d){a.current&&!a.current.contains(d.target)&&o(!1)}return document.addEventListener("mousedown",c),()=>document.removeEventListener("mousedown",c)},[n]);const l=dv.find(c=>c.value===e);return i.jsxs("div",{className:"relative",ref:a,onClick:c=>c.stopPropagation(),children:[i.jsx("button",{onClick:()=>o(!n),className:`text-lg leading-none ${l.color} hover:opacity-70 transition`,title:l.label,children:l.icon}),n&&i.jsx("div",{className:"absolute left-0 top-full mt-1 z-20 min-w-[140px] rounded-md border border-border/70 bg-background shadow-lg py-1",children:dv.filter(c=>c.value!==e).map(c=>i.jsxs("button",{onClick:()=>{t(c.value),o(!1)},className:`flex w-full items-center gap-2 px-3 py-1.5 text-sm hover:bg-foreground/5 transition ${c.color}`,children:[i.jsx("span",{className:"text-base leading-none",children:c.icon}),i.jsx("span",{children:c.label})]},c.value))})]})}function ak({open:e,selectedIds:t,scope:n,onOpenChange:o,onDone:a}){const[l,c]=g.useState("new"),[d,p]=g.useState(!1),[m,h]=g.useState(null),[x,v]=g.useState(null),[b,C]=g.useState(null),[k,j]=g.useState(""),[S,R]=g.useState(""),[N,A]=g.useState(""),[O,T]=g.useState(""),[D,L]=g.useState(""),[G,re]=g.useState(""),[z,K]=g.useState(null),[q,J]=g.useState(!1),_=t.length>1;g.useEffect(()=>{if(!e){c("new"),h(null),j(""),R(""),A(""),T(""),L(""),re(""),K(null);return}let P=!1;return(async()=>{try{const M=await fetch("/api/projects");if(!M.ok)throw new Error(`HTTP ${M.status}`);const Q=await M.json();P||v(Q.filter(I=>!I.archived))}catch(M){P||C(M instanceof Error?M.message:String(M))}})(),()=>{P=!0}},[e]),g.useEffect(()=>{if(!D){K(null);return}let P=!1;return J(!0),(async()=>{try{const M=await fetch(`/api/projects/${encodeURIComponent(D)}/assignments`);if(!M.ok)throw new Error(`HTTP ${M.status}`);const Q=await M.json();P||K(Q)}catch{P||K([])}finally{P||J(!1)}})(),()=>{P=!0}},[D]);const F=g.useMemo(()=>x??[],[x]);async function B(P){if(P.preventDefault(),!k){h("Pick a target project.");return}if(_&&!S.trim()){h("Title is required when promoting multiple todos.");return}const M={todoIds:t,mode:"new-assignment",target:{project:k},title:S.trim()||void 0,type:N.trim()||void 0,priority:O||void 0};await Z(M)}async function U(P){if(P.preventDefault(),!D||!G){h("Pick both project and assignment.");return}const M={todoIds:t,mode:"to-assignment",target:{assignment:`${D}/${G}`}};await Z(M)}async function Z(P){p(!0),h(null);try{n.kind==="workspace"?await WE(n.workspace,P):await dO(n.projectId,P),a(),o(!1)}catch(M){h(M instanceof Error?M.message:String(M))}finally{p(!1)}}return i.jsx(Zs,{open:e,onOpenChange:P=>d?void 0:o(P),children:i.jsxs(ts,{className:"max-w-xl",children:[i.jsxs(th,{children:[i.jsxs(ns,{children:["Promote ",t.length," todo",t.length===1?"":"s"]}),i.jsxs(Na,{children:["Convert the selected todo",t.length===1?"":"s"," to an assignment. The source todo",t.length===1?"":"s"," will be marked completed."]})]}),i.jsxs(Jw,{value:l,onValueChange:P=>c(P),children:[i.jsxs(Zw,{className:"flex gap-2 rounded-md border border-border/70 bg-card/80 p-1 mb-4",children:[i.jsx(rp,{value:"new",className:Ue("inline-flex items-center gap-2 rounded-sm px-3 py-1.5 text-sm font-medium text-muted-foreground transition","data-[state=active]:bg-foreground data-[state=active]:text-background"),children:"New assignment"}),i.jsx(rp,{value:"existing",className:Ue("inline-flex items-center gap-2 rounded-sm px-3 py-1.5 text-sm font-medium text-muted-foreground transition","data-[state=active]:bg-foreground data-[state=active]:text-background"),children:"Existing assignment"})]}),i.jsx(op,{value:"new",children:i.jsxs("form",{onSubmit:B,className:"space-y-4",children:[i.jsx(Os,{label:"Target project",children:i.jsx(fv,{value:k,onChange:j,projects:F,error:b,disabled:d})}),i.jsx(Os,{label:_?"Title (required)":"Title (defaults to first todo)",children:i.jsx("input",{type:"text",value:S,onChange:P=>R(P.target.value),disabled:d,className:"editor-textarea w-full bg-background/95 font-sans"})}),i.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[i.jsx(Os,{label:"Type",children:i.jsx("input",{type:"text",value:N,onChange:P=>A(P.target.value),placeholder:"feature",disabled:d,className:"editor-textarea w-full bg-background/95 font-sans"})}),i.jsx(Os,{label:"Priority",children:i.jsxs("select",{value:O,onChange:P=>T(P.target.value),disabled:d,className:"editor-textarea w-full bg-background/95 font-sans",children:[i.jsx("option",{value:"",children:"—"}),i.jsx("option",{value:"low",children:"low"}),i.jsx("option",{value:"medium",children:"medium"}),i.jsx("option",{value:"high",children:"high"}),i.jsx("option",{value:"critical",children:"critical"})]})})]}),m?i.jsx(pv,{message:m}):null,i.jsx(hv,{onCancel:()=>o(!1),submitting:d,submitLabel:"Promote"})]})}),i.jsx(op,{value:"existing",children:i.jsxs("form",{onSubmit:U,className:"space-y-4",children:[i.jsx(Os,{label:"Project",children:i.jsx(fv,{value:D,onChange:P=>{L(P),re("")},projects:F,error:b,disabled:d})}),i.jsx(Os,{label:q?"Assignment (loading...)":"Assignment",children:i.jsxs("select",{value:G,onChange:P=>re(P.target.value),disabled:d||!D||q,className:"editor-textarea w-full bg-background/95 font-sans",children:[i.jsx("option",{value:"",children:D?"Select assignment...":"Pick a project first"}),(z??[]).map(P=>i.jsxs("option",{value:P.slug,children:[P.title," (",P.status,")"]},P.slug))]})}),m?i.jsx(pv,{message:m}):null,i.jsx(hv,{onCancel:()=>o(!1),submitting:d,submitLabel:"Promote"})]})})]})]})})}function Os({label:e,children:t}){return i.jsxs("label",{className:"block space-y-1.5",children:[i.jsx("span",{className:"block text-xs font-medium uppercase tracking-[0.08em] text-muted-foreground",children:e}),t]})}function fv({value:e,onChange:t,projects:n,error:o,disabled:a}){return o?i.jsxs("div",{className:"text-sm text-destructive",children:["Failed to load projects: ",o]}):i.jsxs("select",{value:e,onChange:l=>t(l.target.value),disabled:a,className:"editor-textarea w-full bg-background/95 font-sans",children:[i.jsx("option",{value:"",children:"Select project..."}),n.map(l=>i.jsxs("option",{value:l.slug,children:[l.title," (",l.slug,")"]},l.slug))]})}function pv({message:e}){return i.jsx("div",{className:"rounded-md border border-destructive/50 bg-destructive/10 px-3 py-2 text-sm text-destructive",children:e})}function hv({onCancel:e,submitting:t,submitLabel:n}){return i.jsxs(nh,{children:[i.jsx("button",{type:"button",onClick:e,disabled:t,className:"shell-action disabled:cursor-not-allowed disabled:opacity-50",children:"Cancel"}),i.jsx("button",{type:"submit",disabled:t,className:"shell-action bg-foreground text-background hover:opacity-90 disabled:cursor-not-allowed disabled:opacity-50",children:t?"Submitting...":n})]})}function lk({open:e,selectedIds:t,scope:n,onOpenChange:o,onDone:a}){const[l,c]=g.useState("project"),[d,p]=g.useState(""),[m,h]=g.useState(""),[x,v]=g.useState(!1),[b,C]=g.useState(null),[k,j]=g.useState(null),[S,R]=g.useState(null);g.useEffect(()=>{if(!e){c("project"),p(""),h(""),C(null),j(null);return}let D=!1;return(async()=>{try{const L=await fetch("/api/projects");if(!L.ok)throw new Error(`HTTP ${L.status}`);const G=await L.json();D||R(G.filter(re=>!re.archived))}catch(L){D||j(L instanceof Error?L.message:String(L))}})(),()=>{D=!0}},[e]);const N=g.useMemo(()=>S?n.kind==="project"?S.filter(D=>D.slug!==n.projectId):S:[],[S,n]);function A(){if(l==="global")return{global:!0};if(l==="workspace"){const D=d.trim();return D?{workspace:D}:"Workspace name is required."}return m?{project:m}:"Pick a target project."}async function O(D,L){try{return n.kind==="workspace"?await VE(n.workspace,D,L):await fO(n.projectId,D,L),{ok:!0}}catch(G){return{ok:!1,error:G instanceof Error?G.message:String(G)}}}async function T(D){D.preventDefault(),j(null);const L=A();if(typeof L=="string"){j(L);return}v(!0),C(null);const G=[],re=[];for(const z of t){const K=await O(z,L);K.ok?G.push(z):re.push({id:z,error:K.error})}v(!1),a(),re.length===0?o(!1):C({succeeded:G,failed:re})}return i.jsx(Zs,{open:e,onOpenChange:D=>x?void 0:o(D),children:i.jsx(ts,{className:"max-w-xl",children:i.jsxs("form",{onSubmit:T,className:"space-y-4",children:[i.jsxs(th,{children:[i.jsxs(ns,{children:["Move ",t.length," todo",t.length===1?"":"s"]}),i.jsxs(Na,{children:["Move the selected todo",t.length===1?"":"s"," to a different scope. id, tags, branch, timestamps, and plan dir are preserved."]})]}),i.jsxs("fieldset",{className:"space-y-2",disabled:x,children:[i.jsx("legend",{className:"block text-xs font-medium uppercase tracking-[0.08em] text-muted-foreground mb-1",children:"Target scope"}),i.jsx(Df,{kind:"project",checked:l==="project",onChange:()=>c("project"),label:"Project"}),i.jsx(Df,{kind:"workspace",checked:l==="workspace",onChange:()=>c("workspace"),label:"Workspace"}),i.jsx(Df,{kind:"global",checked:l==="global",onChange:()=>c("global"),label:"Global"})]}),l==="project"?i.jsx(mv,{label:"Target project",children:i.jsxs("select",{value:m,onChange:D=>h(D.target.value),disabled:x,className:"editor-textarea w-full bg-background/95 font-sans",children:[i.jsx("option",{value:"",children:"Select project..."}),N.map(D=>i.jsxs("option",{value:D.slug,children:[D.title," (",D.slug,")"]},D.slug))]})}):null,l==="workspace"?i.jsx(mv,{label:"Target workspace name",children:i.jsx("input",{type:"text",value:d,onChange:D=>p(D.target.value),disabled:x,placeholder:"e.g. syntaur",className:"editor-textarea w-full bg-background/95 font-sans"})}):null,k?i.jsx(pO,{message:k}):null,b?i.jsxs("div",{className:"rounded-md border border-warning-foreground/30 bg-warning px-3 py-2 text-sm text-warning-foreground space-y-1",children:[i.jsxs("div",{className:"font-medium",children:["Moved ",b.succeeded.length," of ",t.length,"; ",b.failed.length," failed."]}),i.jsx("ul",{className:"text-xs space-y-0.5",children:b.failed.map(D=>i.jsxs("li",{children:["[t:",D.id,"] ",D.error]},D.id))})]}):null,i.jsxs(nh,{children:[i.jsx("button",{type:"button",onClick:()=>o(!1),disabled:x,className:"shell-action disabled:cursor-not-allowed disabled:opacity-50",children:b?"Close":"Cancel"}),b===null?i.jsx("button",{type:"submit",disabled:x,className:"shell-action bg-foreground text-background hover:opacity-90 disabled:cursor-not-allowed disabled:opacity-50",children:x?"Moving...":"Move"}):null]})]})})})}function mv({label:e,children:t}){return i.jsxs("label",{className:"block space-y-1.5",children:[i.jsx("span",{className:"block text-xs font-medium uppercase tracking-[0.08em] text-muted-foreground",children:e}),t]})}function Df({kind:e,checked:t,onChange:n,label:o}){return i.jsxs("label",{className:"flex items-center gap-2 text-sm cursor-pointer",children:[i.jsx("input",{type:"radio",name:"move-target-kind",value:e,checked:t,onChange:n}),i.jsx("span",{children:o})]})}function pO({message:e}){return i.jsx("div",{className:"rounded-md border border-destructive/50 bg-destructive/10 px-3 py-2 text-sm text-destructive",children:e})}const hO=["top","right","bottom","left"],Eo=Math.min,$n=Math.max,Cc=Math.round,ec=Math.floor,Tr=e=>({x:e,y:e}),mO={left:"right",right:"left",bottom:"top",top:"bottom"};function bp(e,t,n){return $n(e,Eo(t,n))}function Gr(e,t){return typeof e=="function"?e(t):e}function Yr(e){return e.split("-")[0]}function si(e){return e.split("-")[1]}function Ih(e){return e==="x"?"y":"x"}function Oh(e){return e==="y"?"height":"width"}function Nr(e){const t=e[0];return t==="t"||t==="b"?"y":"x"}function Lh(e){return Ih(Nr(e))}function gO(e,t,n){n===void 0&&(n=!1);const o=si(e),a=Lh(e),l=Oh(a);let c=a==="x"?o===(n?"end":"start")?"right":"left":o==="start"?"bottom":"top";return t.reference[l]>t.floating[l]&&(c=Ec(c)),[c,Ec(c)]}function xO(e){const t=Ec(e);return[wp(e),t,wp(t)]}function wp(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}const gv=["left","right"],xv=["right","left"],yO=["top","bottom"],vO=["bottom","top"];function bO(e,t,n){switch(e){case"top":case"bottom":return n?t?xv:gv:t?gv:xv;case"left":case"right":return t?yO:vO;default:return[]}}function wO(e,t,n,o){const a=si(e);let l=bO(Yr(e),n==="start",o);return a&&(l=l.map(c=>c+"-"+a),t&&(l=l.concat(l.map(wp)))),l}function Ec(e){const t=Yr(e);return mO[t]+e.slice(t.length)}function kO(e){return{top:0,right:0,bottom:0,left:0,...e}}function ck(e){return typeof e!="number"?kO(e):{top:e,right:e,bottom:e,left:e}}function Pc(e){const{x:t,y:n,width:o,height:a}=e;return{width:o,height:a,top:n,left:t,right:t+o,bottom:n+a,x:t,y:n}}function yv(e,t,n){let{reference:o,floating:a}=e;const l=Nr(t),c=Lh(t),d=Oh(c),p=Yr(t),m=l==="y",h=o.x+o.width/2-a.width/2,x=o.y+o.height/2-a.height/2,v=o[d]/2-a[d]/2;let b;switch(p){case"top":b={x:h,y:o.y-a.height};break;case"bottom":b={x:h,y:o.y+o.height};break;case"right":b={x:o.x+o.width,y:x};break;case"left":b={x:o.x-a.width,y:x};break;default:b={x:o.x,y:o.y}}switch(si(t)){case"start":b[c]-=v*(n&&m?-1:1);break;case"end":b[c]+=v*(n&&m?-1:1);break}return b}async function jO(e,t){var n;t===void 0&&(t={});const{x:o,y:a,platform:l,rects:c,elements:d,strategy:p}=e,{boundary:m="clippingAncestors",rootBoundary:h="viewport",elementContext:x="floating",altBoundary:v=!1,padding:b=0}=Gr(t,e),C=ck(b),j=d[v?x==="floating"?"reference":"floating":x],S=Pc(await l.getClippingRect({element:(n=await(l.isElement==null?void 0:l.isElement(j)))==null||n?j:j.contextElement||await(l.getDocumentElement==null?void 0:l.getDocumentElement(d.floating)),boundary:m,rootBoundary:h,strategy:p})),R=x==="floating"?{x:o,y:a,width:c.floating.width,height:c.floating.height}:c.reference,N=await(l.getOffsetParent==null?void 0:l.getOffsetParent(d.floating)),A=await(l.isElement==null?void 0:l.isElement(N))?await(l.getScale==null?void 0:l.getScale(N))||{x:1,y:1}:{x:1,y:1},O=Pc(l.convertOffsetParentRelativeRectToViewportRelativeRect?await l.convertOffsetParentRelativeRectToViewportRelativeRect({elements:d,rect:R,offsetParent:N,strategy:p}):R);return{top:(S.top-O.top+C.top)/A.y,bottom:(O.bottom-S.bottom+C.bottom)/A.y,left:(S.left-O.left+C.left)/A.x,right:(O.right-S.right+C.right)/A.x}}const SO=50,NO=async(e,t,n)=>{const{placement:o="bottom",strategy:a="absolute",middleware:l=[],platform:c}=n,d=c.detectOverflow?c:{...c,detectOverflow:jO},p=await(c.isRTL==null?void 0:c.isRTL(t));let m=await c.getElementRects({reference:e,floating:t,strategy:a}),{x:h,y:x}=yv(m,o,p),v=o,b=0;const C={};for(let k=0;k<l.length;k++){const j=l[k];if(!j)continue;const{name:S,fn:R}=j,{x:N,y:A,data:O,reset:T}=await R({x:h,y:x,initialPlacement:o,placement:v,strategy:a,middlewareData:C,rects:m,platform:d,elements:{reference:e,floating:t}});h=N??h,x=A??x,C[S]={...C[S],...O},T&&b<SO&&(b++,typeof T=="object"&&(T.placement&&(v=T.placement),T.rects&&(m=T.rects===!0?await c.getElementRects({reference:e,floating:t,strategy:a}):T.rects),{x:h,y:x}=yv(m,v,p)),k=-1)}return{x:h,y:x,placement:v,strategy:a,middlewareData:C}},CO=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:o,placement:a,rects:l,platform:c,elements:d,middlewareData:p}=t,{element:m,padding:h=0}=Gr(e,t)||{};if(m==null)return{};const x=ck(h),v={x:n,y:o},b=Lh(a),C=Oh(b),k=await c.getDimensions(m),j=b==="y",S=j?"top":"left",R=j?"bottom":"right",N=j?"clientHeight":"clientWidth",A=l.reference[C]+l.reference[b]-v[b]-l.floating[C],O=v[b]-l.reference[b],T=await(c.getOffsetParent==null?void 0:c.getOffsetParent(m));let D=T?T[N]:0;(!D||!await(c.isElement==null?void 0:c.isElement(T)))&&(D=d.floating[N]||l.floating[C]);const L=A/2-O/2,G=D/2-k[C]/2-1,re=Eo(x[S],G),z=Eo(x[R],G),K=re,q=D-k[C]-z,J=D/2-k[C]/2+L,_=bp(K,J,q),F=!p.arrow&&si(a)!=null&&J!==_&&l.reference[C]/2-(J<K?re:z)-k[C]/2<0,B=F?J<K?J-K:J-q:0;return{[b]:v[b]+B,data:{[b]:_,centerOffset:J-_-B,...F&&{alignmentOffset:B}},reset:F}}}),EO=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,o;const{placement:a,middlewareData:l,rects:c,initialPlacement:d,platform:p,elements:m}=t,{mainAxis:h=!0,crossAxis:x=!0,fallbackPlacements:v,fallbackStrategy:b="bestFit",fallbackAxisSideDirection:C="none",flipAlignment:k=!0,...j}=Gr(e,t);if((n=l.arrow)!=null&&n.alignmentOffset)return{};const S=Yr(a),R=Nr(d),N=Yr(d)===d,A=await(p.isRTL==null?void 0:p.isRTL(m.floating)),O=v||(N||!k?[Ec(d)]:xO(d)),T=C!=="none";!v&&T&&O.push(...wO(d,k,C,A));const D=[d,...O],L=await p.detectOverflow(t,j),G=[];let re=((o=l.flip)==null?void 0:o.overflows)||[];if(h&&G.push(L[S]),x){const J=gO(a,c,A);G.push(L[J[0]],L[J[1]])}if(re=[...re,{placement:a,overflows:G}],!G.every(J=>J<=0)){var z,K;const J=(((z=l.flip)==null?void 0:z.index)||0)+1,_=D[J];if(_&&(!(x==="alignment"?R!==Nr(_):!1)||re.every(U=>Nr(U.placement)===R?U.overflows[0]>0:!0)))return{data:{index:J,overflows:re},reset:{placement:_}};let F=(K=re.filter(B=>B.overflows[0]<=0).sort((B,U)=>B.overflows[1]-U.overflows[1])[0])==null?void 0:K.placement;if(!F)switch(b){case"bestFit":{var q;const B=(q=re.filter(U=>{if(T){const Z=Nr(U.placement);return Z===R||Z==="y"}return!0}).map(U=>[U.placement,U.overflows.filter(Z=>Z>0).reduce((Z,P)=>Z+P,0)]).sort((U,Z)=>U[1]-Z[1])[0])==null?void 0:q[0];B&&(F=B);break}case"initialPlacement":F=d;break}if(a!==F)return{reset:{placement:F}}}return{}}}};function vv(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function bv(e){return hO.some(t=>e[t]>=0)}const PO=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n,platform:o}=t,{strategy:a="referenceHidden",...l}=Gr(e,t);switch(a){case"referenceHidden":{const c=await o.detectOverflow(t,{...l,elementContext:"reference"}),d=vv(c,n.reference);return{data:{referenceHiddenOffsets:d,referenceHidden:bv(d)}}}case"escaped":{const c=await o.detectOverflow(t,{...l,altBoundary:!0}),d=vv(c,n.floating);return{data:{escapedOffsets:d,escaped:bv(d)}}}default:return{}}}}},uk=new Set(["left","top"]);async function TO(e,t){const{placement:n,platform:o,elements:a}=e,l=await(o.isRTL==null?void 0:o.isRTL(a.floating)),c=Yr(n),d=si(n),p=Nr(n)==="y",m=uk.has(c)?-1:1,h=l&&p?-1:1,x=Gr(t,e);let{mainAxis:v,crossAxis:b,alignmentAxis:C}=typeof x=="number"?{mainAxis:x,crossAxis:0,alignmentAxis:null}:{mainAxis:x.mainAxis||0,crossAxis:x.crossAxis||0,alignmentAxis:x.alignmentAxis};return d&&typeof C=="number"&&(b=d==="end"?C*-1:C),p?{x:b*h,y:v*m}:{x:v*m,y:b*h}}const RO=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,o;const{x:a,y:l,placement:c,middlewareData:d}=t,p=await TO(t,e);return c===((n=d.offset)==null?void 0:n.placement)&&(o=d.arrow)!=null&&o.alignmentOffset?{}:{x:a+p.x,y:l+p.y,data:{...p,placement:c}}}}},AO=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:o,placement:a,platform:l}=t,{mainAxis:c=!0,crossAxis:d=!1,limiter:p={fn:S=>{let{x:R,y:N}=S;return{x:R,y:N}}},...m}=Gr(e,t),h={x:n,y:o},x=await l.detectOverflow(t,m),v=Nr(Yr(a)),b=Ih(v);let C=h[b],k=h[v];if(c){const S=b==="y"?"top":"left",R=b==="y"?"bottom":"right",N=C+x[S],A=C-x[R];C=bp(N,C,A)}if(d){const S=v==="y"?"top":"left",R=v==="y"?"bottom":"right",N=k+x[S],A=k-x[R];k=bp(N,k,A)}const j=p.fn({...t,[b]:C,[v]:k});return{...j,data:{x:j.x-n,y:j.y-o,enabled:{[b]:c,[v]:d}}}}}},DO=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:o,placement:a,rects:l,middlewareData:c}=t,{offset:d=0,mainAxis:p=!0,crossAxis:m=!0}=Gr(e,t),h={x:n,y:o},x=Nr(a),v=Ih(x);let b=h[v],C=h[x];const k=Gr(d,t),j=typeof k=="number"?{mainAxis:k,crossAxis:0}:{mainAxis:0,crossAxis:0,...k};if(p){const N=v==="y"?"height":"width",A=l.reference[v]-l.floating[N]+j.mainAxis,O=l.reference[v]+l.reference[N]-j.mainAxis;b<A?b=A:b>O&&(b=O)}if(m){var S,R;const N=v==="y"?"width":"height",A=uk.has(Yr(a)),O=l.reference[x]-l.floating[N]+(A&&((S=c.offset)==null?void 0:S[x])||0)+(A?0:j.crossAxis),T=l.reference[x]+l.reference[N]+(A?0:((R=c.offset)==null?void 0:R[x])||0)-(A?j.crossAxis:0);C<O?C=O:C>T&&(C=T)}return{[v]:b,[x]:C}}}},IO=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,o;const{placement:a,rects:l,platform:c,elements:d}=t,{apply:p=()=>{},...m}=Gr(e,t),h=await c.detectOverflow(t,m),x=Yr(a),v=si(a),b=Nr(a)==="y",{width:C,height:k}=l.floating;let j,S;x==="top"||x==="bottom"?(j=x,S=v===(await(c.isRTL==null?void 0:c.isRTL(d.floating))?"start":"end")?"left":"right"):(S=x,j=v==="end"?"top":"bottom");const R=k-h.top-h.bottom,N=C-h.left-h.right,A=Eo(k-h[j],R),O=Eo(C-h[S],N),T=!t.middlewareData.shift;let D=A,L=O;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(L=N),(o=t.middlewareData.shift)!=null&&o.enabled.y&&(D=R),T&&!v){const re=$n(h.left,0),z=$n(h.right,0),K=$n(h.top,0),q=$n(h.bottom,0);b?L=C-2*(re!==0||z!==0?re+z:$n(h.left,h.right)):D=k-2*(K!==0||q!==0?K+q:$n(h.top,h.bottom))}await p({...t,availableWidth:L,availableHeight:D});const G=await c.getDimensions(d.floating);return C!==G.width||k!==G.height?{reset:{rects:!0}}:{}}}};function eu(){return typeof window<"u"}function ii(e){return dk(e)?(e.nodeName||"").toLowerCase():"#document"}function Bn(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Ir(e){var t;return(t=(dk(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function dk(e){return eu()?e instanceof Node||e instanceof Bn(e).Node:!1}function fr(e){return eu()?e instanceof Element||e instanceof Bn(e).Element:!1}function Xr(e){return eu()?e instanceof HTMLElement||e instanceof Bn(e).HTMLElement:!1}function wv(e){return!eu()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Bn(e).ShadowRoot}function Ia(e){const{overflow:t,overflowX:n,overflowY:o,display:a}=pr(e);return/auto|scroll|overlay|hidden|clip/.test(t+o+n)&&a!=="inline"&&a!=="contents"}function OO(e){return/^(table|td|th)$/.test(ii(e))}function tu(e){try{if(e.matches(":popover-open"))return!0}catch{}try{return e.matches(":modal")}catch{return!1}}const LO=/transform|translate|scale|rotate|perspective|filter/,MO=/paint|layout|strict|content/,Ko=e=>!!e&&e!=="none";let If;function Mh(e){const t=fr(e)?pr(e):e;return Ko(t.transform)||Ko(t.translate)||Ko(t.scale)||Ko(t.rotate)||Ko(t.perspective)||!_h()&&(Ko(t.backdropFilter)||Ko(t.filter))||LO.test(t.willChange||"")||MO.test(t.contain||"")}function _O(e){let t=Po(e);for(;Xr(t)&&!qs(t);){if(Mh(t))return t;if(tu(t))return null;t=Po(t)}return null}function _h(){return If==null&&(If=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),If}function qs(e){return/^(html|body|#document)$/.test(ii(e))}function pr(e){return Bn(e).getComputedStyle(e)}function nu(e){return fr(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Po(e){if(ii(e)==="html")return e;const t=e.assignedSlot||e.parentNode||wv(e)&&e.host||Ir(e);return wv(t)?t.host:t}function fk(e){const t=Po(e);return qs(t)?e.ownerDocument?e.ownerDocument.body:e.body:Xr(t)&&Ia(t)?t:fk(t)}function va(e,t,n){var o;t===void 0&&(t=[]),n===void 0&&(n=!0);const a=fk(e),l=a===((o=e.ownerDocument)==null?void 0:o.body),c=Bn(a);if(l){const d=kp(c);return t.concat(c,c.visualViewport||[],Ia(a)?a:[],d&&n?va(d):[])}else return t.concat(a,va(a,[],n))}function kp(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function pk(e){const t=pr(e);let n=parseFloat(t.width)||0,o=parseFloat(t.height)||0;const a=Xr(e),l=a?e.offsetWidth:n,c=a?e.offsetHeight:o,d=Cc(n)!==l||Cc(o)!==c;return d&&(n=l,o=c),{width:n,height:o,$:d}}function $h(e){return fr(e)?e:e.contextElement}function Us(e){const t=$h(e);if(!Xr(t))return Tr(1);const n=t.getBoundingClientRect(),{width:o,height:a,$:l}=pk(t);let c=(l?Cc(n.width):n.width)/o,d=(l?Cc(n.height):n.height)/a;return(!c||!Number.isFinite(c))&&(c=1),(!d||!Number.isFinite(d))&&(d=1),{x:c,y:d}}const $O=Tr(0);function hk(e){const t=Bn(e);return!_h()||!t.visualViewport?$O:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function FO(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==Bn(e)?!1:t}function Jo(e,t,n,o){t===void 0&&(t=!1),n===void 0&&(n=!1);const a=e.getBoundingClientRect(),l=$h(e);let c=Tr(1);t&&(o?fr(o)&&(c=Us(o)):c=Us(e));const d=FO(l,n,o)?hk(l):Tr(0);let p=(a.left+d.x)/c.x,m=(a.top+d.y)/c.y,h=a.width/c.x,x=a.height/c.y;if(l){const v=Bn(l),b=o&&fr(o)?Bn(o):o;let C=v,k=kp(C);for(;k&&o&&b!==C;){const j=Us(k),S=k.getBoundingClientRect(),R=pr(k),N=S.left+(k.clientLeft+parseFloat(R.paddingLeft))*j.x,A=S.top+(k.clientTop+parseFloat(R.paddingTop))*j.y;p*=j.x,m*=j.y,h*=j.x,x*=j.y,p+=N,m+=A,C=Bn(k),k=kp(C)}}return Pc({width:h,height:x,x:p,y:m})}function ru(e,t){const n=nu(e).scrollLeft;return t?t.left+n:Jo(Ir(e)).left+n}function mk(e,t){const n=e.getBoundingClientRect(),o=n.left+t.scrollLeft-ru(e,n),a=n.top+t.scrollTop;return{x:o,y:a}}function zO(e){let{elements:t,rect:n,offsetParent:o,strategy:a}=e;const l=a==="fixed",c=Ir(o),d=t?tu(t.floating):!1;if(o===c||d&&l)return n;let p={scrollLeft:0,scrollTop:0},m=Tr(1);const h=Tr(0),x=Xr(o);if((x||!x&&!l)&&((ii(o)!=="body"||Ia(c))&&(p=nu(o)),x)){const b=Jo(o);m=Us(o),h.x=b.x+o.clientLeft,h.y=b.y+o.clientTop}const v=c&&!x&&!l?mk(c,p):Tr(0);return{width:n.width*m.x,height:n.height*m.y,x:n.x*m.x-p.scrollLeft*m.x+h.x+v.x,y:n.y*m.y-p.scrollTop*m.y+h.y+v.y}}function BO(e){return Array.from(e.getClientRects())}function UO(e){const t=Ir(e),n=nu(e),o=e.ownerDocument.body,a=$n(t.scrollWidth,t.clientWidth,o.scrollWidth,o.clientWidth),l=$n(t.scrollHeight,t.clientHeight,o.scrollHeight,o.clientHeight);let c=-n.scrollLeft+ru(e);const d=-n.scrollTop;return pr(o).direction==="rtl"&&(c+=$n(t.clientWidth,o.clientWidth)-a),{width:a,height:l,x:c,y:d}}const kv=25;function HO(e,t){const n=Bn(e),o=Ir(e),a=n.visualViewport;let l=o.clientWidth,c=o.clientHeight,d=0,p=0;if(a){l=a.width,c=a.height;const h=_h();(!h||h&&t==="fixed")&&(d=a.offsetLeft,p=a.offsetTop)}const m=ru(o);if(m<=0){const h=o.ownerDocument,x=h.body,v=getComputedStyle(x),b=h.compatMode==="CSS1Compat"&&parseFloat(v.marginLeft)+parseFloat(v.marginRight)||0,C=Math.abs(o.clientWidth-x.clientWidth-b);C<=kv&&(l-=C)}else m<=kv&&(l+=m);return{width:l,height:c,x:d,y:p}}function WO(e,t){const n=Jo(e,!0,t==="fixed"),o=n.top+e.clientTop,a=n.left+e.clientLeft,l=Xr(e)?Us(e):Tr(1),c=e.clientWidth*l.x,d=e.clientHeight*l.y,p=a*l.x,m=o*l.y;return{width:c,height:d,x:p,y:m}}function jv(e,t,n){let o;if(t==="viewport")o=HO(e,n);else if(t==="document")o=UO(Ir(e));else if(fr(t))o=WO(t,n);else{const a=hk(e);o={x:t.x-a.x,y:t.y-a.y,width:t.width,height:t.height}}return Pc(o)}function gk(e,t){const n=Po(e);return n===t||!fr(n)||qs(n)?!1:pr(n).position==="fixed"||gk(n,t)}function VO(e,t){const n=t.get(e);if(n)return n;let o=va(e,[],!1).filter(d=>fr(d)&&ii(d)!=="body"),a=null;const l=pr(e).position==="fixed";let c=l?Po(e):e;for(;fr(c)&&!qs(c);){const d=pr(c),p=Mh(c);!p&&d.position==="fixed"&&(a=null),(l?!p&&!a:!p&&d.position==="static"&&!!a&&(a.position==="absolute"||a.position==="fixed")||Ia(c)&&!p&&gk(e,c))?o=o.filter(h=>h!==c):a=d,c=Po(c)}return t.set(e,o),o}function qO(e){let{element:t,boundary:n,rootBoundary:o,strategy:a}=e;const c=[...n==="clippingAncestors"?tu(t)?[]:VO(t,this._c):[].concat(n),o],d=jv(t,c[0],a);let p=d.top,m=d.right,h=d.bottom,x=d.left;for(let v=1;v<c.length;v++){const b=jv(t,c[v],a);p=$n(b.top,p),m=Eo(b.right,m),h=Eo(b.bottom,h),x=$n(b.left,x)}return{width:m-x,height:h-p,x,y:p}}function KO(e){const{width:t,height:n}=pk(e);return{width:t,height:n}}function GO(e,t,n){const o=Xr(t),a=Ir(t),l=n==="fixed",c=Jo(e,!0,l,t);let d={scrollLeft:0,scrollTop:0};const p=Tr(0);function m(){p.x=ru(a)}if(o||!o&&!l)if((ii(t)!=="body"||Ia(a))&&(d=nu(t)),o){const b=Jo(t,!0,l,t);p.x=b.x+t.clientLeft,p.y=b.y+t.clientTop}else a&&m();l&&!o&&a&&m();const h=a&&!o&&!l?mk(a,d):Tr(0),x=c.left+d.scrollLeft-p.x-h.x,v=c.top+d.scrollTop-p.y-h.y;return{x,y:v,width:c.width,height:c.height}}function Of(e){return pr(e).position==="static"}function Sv(e,t){if(!Xr(e)||pr(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return Ir(e)===n&&(n=n.ownerDocument.body),n}function xk(e,t){const n=Bn(e);if(tu(e))return n;if(!Xr(e)){let a=Po(e);for(;a&&!qs(a);){if(fr(a)&&!Of(a))return a;a=Po(a)}return n}let o=Sv(e,t);for(;o&&OO(o)&&Of(o);)o=Sv(o,t);return o&&qs(o)&&Of(o)&&!Mh(o)?n:o||_O(e)||n}const YO=async function(e){const t=this.getOffsetParent||xk,n=this.getDimensions,o=await n(e.floating);return{reference:GO(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:o.width,height:o.height}}};function XO(e){return pr(e).direction==="rtl"}const QO={convertOffsetParentRelativeRectToViewportRelativeRect:zO,getDocumentElement:Ir,getClippingRect:qO,getOffsetParent:xk,getElementRects:YO,getClientRects:BO,getDimensions:KO,getScale:Us,isElement:fr,isRTL:XO};function yk(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function JO(e,t){let n=null,o;const a=Ir(e);function l(){var d;clearTimeout(o),(d=n)==null||d.disconnect(),n=null}function c(d,p){d===void 0&&(d=!1),p===void 0&&(p=1),l();const m=e.getBoundingClientRect(),{left:h,top:x,width:v,height:b}=m;if(d||t(),!v||!b)return;const C=ec(x),k=ec(a.clientWidth-(h+v)),j=ec(a.clientHeight-(x+b)),S=ec(h),N={rootMargin:-C+"px "+-k+"px "+-j+"px "+-S+"px",threshold:$n(0,Eo(1,p))||1};let A=!0;function O(T){const D=T[0].intersectionRatio;if(D!==p){if(!A)return c();D?c(!1,D):o=setTimeout(()=>{c(!1,1e-7)},1e3)}D===1&&!yk(m,e.getBoundingClientRect())&&c(),A=!1}try{n=new IntersectionObserver(O,{...N,root:a.ownerDocument})}catch{n=new IntersectionObserver(O,N)}n.observe(e)}return c(!0),l}function ZO(e,t,n,o){o===void 0&&(o={});const{ancestorScroll:a=!0,ancestorResize:l=!0,elementResize:c=typeof ResizeObserver=="function",layoutShift:d=typeof IntersectionObserver=="function",animationFrame:p=!1}=o,m=$h(e),h=a||l?[...m?va(m):[],...t?va(t):[]]:[];h.forEach(S=>{a&&S.addEventListener("scroll",n,{passive:!0}),l&&S.addEventListener("resize",n)});const x=m&&d?JO(m,n):null;let v=-1,b=null;c&&(b=new ResizeObserver(S=>{let[R]=S;R&&R.target===m&&b&&t&&(b.unobserve(t),cancelAnimationFrame(v),v=requestAnimationFrame(()=>{var N;(N=b)==null||N.observe(t)})),n()}),m&&!p&&b.observe(m),t&&b.observe(t));let C,k=p?Jo(e):null;p&&j();function j(){const S=Jo(e);k&&!yk(k,S)&&n(),k=S,C=requestAnimationFrame(j)}return n(),()=>{var S;h.forEach(R=>{a&&R.removeEventListener("scroll",n),l&&R.removeEventListener("resize",n)}),x==null||x(),(S=b)==null||S.disconnect(),b=null,p&&cancelAnimationFrame(C)}}const eL=RO,tL=AO,nL=EO,rL=IO,oL=PO,Nv=CO,sL=DO,iL=(e,t,n)=>{const o=new Map,a={platform:QO,...n},l={...a.platform,_c:o};return NO(e,t,{...a,platform:l})};var aL=typeof document<"u",lL=function(){},fc=aL?g.useLayoutEffect:lL;function Tc(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,o,a;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(o=n;o--!==0;)if(!Tc(e[o],t[o]))return!1;return!0}if(a=Object.keys(e),n=a.length,n!==Object.keys(t).length)return!1;for(o=n;o--!==0;)if(!{}.hasOwnProperty.call(t,a[o]))return!1;for(o=n;o--!==0;){const l=a[o];if(!(l==="_owner"&&e.$$typeof)&&!Tc(e[l],t[l]))return!1}return!0}return e!==e&&t!==t}function vk(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Cv(e,t){const n=vk(e);return Math.round(t*n)/n}function Lf(e){const t=g.useRef(e);return fc(()=>{t.current=e}),t}function cL(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:o=[],platform:a,elements:{reference:l,floating:c}={},transform:d=!0,whileElementsMounted:p,open:m}=e,[h,x]=g.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[v,b]=g.useState(o);Tc(v,o)||b(o);const[C,k]=g.useState(null),[j,S]=g.useState(null),R=g.useCallback(U=>{U!==T.current&&(T.current=U,k(U))},[]),N=g.useCallback(U=>{U!==D.current&&(D.current=U,S(U))},[]),A=l||C,O=c||j,T=g.useRef(null),D=g.useRef(null),L=g.useRef(h),G=p!=null,re=Lf(p),z=Lf(a),K=Lf(m),q=g.useCallback(()=>{if(!T.current||!D.current)return;const U={placement:t,strategy:n,middleware:v};z.current&&(U.platform=z.current),iL(T.current,D.current,U).then(Z=>{const P={...Z,isPositioned:K.current!==!1};J.current&&!Tc(L.current,P)&&(L.current=P,So.flushSync(()=>{x(P)}))})},[v,t,n,z,K]);fc(()=>{m===!1&&L.current.isPositioned&&(L.current.isPositioned=!1,x(U=>({...U,isPositioned:!1})))},[m]);const J=g.useRef(!1);fc(()=>(J.current=!0,()=>{J.current=!1}),[]),fc(()=>{if(A&&(T.current=A),O&&(D.current=O),A&&O){if(re.current)return re.current(A,O,q);q()}},[A,O,q,re,G]);const _=g.useMemo(()=>({reference:T,floating:D,setReference:R,setFloating:N}),[R,N]),F=g.useMemo(()=>({reference:A,floating:O}),[A,O]),B=g.useMemo(()=>{const U={position:n,left:0,top:0};if(!F.floating)return U;const Z=Cv(F.floating,h.x),P=Cv(F.floating,h.y);return d?{...U,transform:"translate("+Z+"px, "+P+"px)",...vk(F.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:Z,top:P}},[n,d,F.floating,h.x,h.y]);return g.useMemo(()=>({...h,update:q,refs:_,elements:F,floatingStyles:B}),[h,q,_,F,B])}const uL=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:o,padding:a}=typeof e=="function"?e(n):e;return o&&t(o)?o.current!=null?Nv({element:o.current,padding:a}).fn(n):{}:o?Nv({element:o,padding:a}).fn(n):{}}}},dL=(e,t)=>{const n=eL(e);return{name:n.name,fn:n.fn,options:[e,t]}},fL=(e,t)=>{const n=tL(e);return{name:n.name,fn:n.fn,options:[e,t]}},pL=(e,t)=>({fn:sL(e).fn,options:[e,t]}),hL=(e,t)=>{const n=nL(e);return{name:n.name,fn:n.fn,options:[e,t]}},mL=(e,t)=>{const n=rL(e);return{name:n.name,fn:n.fn,options:[e,t]}},gL=(e,t)=>{const n=oL(e);return{name:n.name,fn:n.fn,options:[e,t]}},xL=(e,t)=>{const n=uL(e);return{name:n.name,fn:n.fn,options:[e,t]}};var yL="Arrow",bk=g.forwardRef((e,t)=>{const{children:n,width:o=10,height:a=5,...l}=e;return i.jsx(Mt.svg,{...l,ref:t,width:o,height:a,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:i.jsx("polygon",{points:"0,0 30,0 15,10"})})});bk.displayName=yL;var vL=bk;function bL(e){const[t,n]=g.useState(void 0);return Co(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const o=new ResizeObserver(a=>{if(!Array.isArray(a)||!a.length)return;const l=a[0];let c,d;if("borderBoxSize"in l){const p=l.borderBoxSize,m=Array.isArray(p)?p[0]:p;c=m.inlineSize,d=m.blockSize}else c=e.offsetWidth,d=e.offsetHeight;n({width:c,height:d})});return o.observe(e,{box:"border-box"}),()=>o.unobserve(e)}else n(void 0)},[e]),t}var Fh="Popper",[wk,kk]=Zo(Fh),[wL,jk]=wk(Fh),Sk=e=>{const{__scopePopper:t,children:n}=e,[o,a]=g.useState(null);return i.jsx(wL,{scope:t,anchor:o,onAnchorChange:a,children:n})};Sk.displayName=Fh;var Nk="PopperAnchor",Ck=g.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:o,...a}=e,l=jk(Nk,n),c=g.useRef(null),d=pn(t,c),p=g.useRef(null);return g.useEffect(()=>{const m=p.current;p.current=(o==null?void 0:o.current)||c.current,m!==p.current&&l.onAnchorChange(p.current)}),o?null:i.jsx(Mt.div,{...a,ref:d})});Ck.displayName=Nk;var zh="PopperContent",[kL,jL]=wk(zh),Ek=g.forwardRef((e,t)=>{var fe,ve,we,be,Ye,Xe;const{__scopePopper:n,side:o="bottom",sideOffset:a=0,align:l="center",alignOffset:c=0,arrowPadding:d=0,avoidCollisions:p=!0,collisionBoundary:m=[],collisionPadding:h=0,sticky:x="partial",hideWhenDetached:v=!1,updatePositionStrategy:b="optimized",onPlaced:C,...k}=e,j=jk(zh,n),[S,R]=g.useState(null),N=pn(t,ne=>R(ne)),[A,O]=g.useState(null),T=bL(A),D=(T==null?void 0:T.width)??0,L=(T==null?void 0:T.height)??0,G=o+(l!=="center"?"-"+l:""),re=typeof h=="number"?h:{top:0,right:0,bottom:0,left:0,...h},z=Array.isArray(m)?m:[m],K=z.length>0,q={padding:re,boundary:z.filter(NL),altBoundary:K},{refs:J,floatingStyles:_,placement:F,isPositioned:B,middlewareData:U}=cL({strategy:"fixed",placement:G,whileElementsMounted:(...ne)=>ZO(...ne,{animationFrame:b==="always"}),elements:{reference:j.anchor},middleware:[dL({mainAxis:a+L,alignmentAxis:c}),p&&fL({mainAxis:!0,crossAxis:!1,limiter:x==="partial"?pL():void 0,...q}),p&&hL({...q}),mL({...q,apply:({elements:ne,rects:Y,availableWidth:ae,availableHeight:xe})=>{const{width:qe,height:Oe}=Y.reference,Be=ne.floating.style;Be.setProperty("--radix-popper-available-width",`${ae}px`),Be.setProperty("--radix-popper-available-height",`${xe}px`),Be.setProperty("--radix-popper-anchor-width",`${qe}px`),Be.setProperty("--radix-popper-anchor-height",`${Oe}px`)}}),A&&xL({element:A,padding:d}),CL({arrowWidth:D,arrowHeight:L}),v&&gL({strategy:"referenceHidden",...q})]}),[Z,P]=Rk(F),M=Xo(C);Co(()=>{B&&(M==null||M())},[B,M]);const Q=(fe=U.arrow)==null?void 0:fe.x,I=(ve=U.arrow)==null?void 0:ve.y,ge=((we=U.arrow)==null?void 0:we.centerOffset)!==0,[Se,te]=g.useState();return Co(()=>{S&&te(window.getComputedStyle(S).zIndex)},[S]),i.jsx("div",{ref:J.setFloating,"data-radix-popper-content-wrapper":"",style:{..._,transform:B?_.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:Se,"--radix-popper-transform-origin":[(be=U.transformOrigin)==null?void 0:be.x,(Ye=U.transformOrigin)==null?void 0:Ye.y].join(" "),...((Xe=U.hide)==null?void 0:Xe.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:i.jsx(kL,{scope:n,placedSide:Z,onArrowChange:O,arrowX:Q,arrowY:I,shouldHideArrow:ge,children:i.jsx(Mt.div,{"data-side":Z,"data-align":P,...k,ref:N,style:{...k.style,animation:B?void 0:"none"}})})})});Ek.displayName=zh;var Pk="PopperArrow",SL={top:"bottom",right:"left",bottom:"top",left:"right"},Tk=g.forwardRef(function(t,n){const{__scopePopper:o,...a}=t,l=jL(Pk,o),c=SL[l.placedSide];return i.jsx("span",{ref:l.onArrowChange,style:{position:"absolute",left:l.arrowX,top:l.arrowY,[c]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[l.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[l.placedSide],visibility:l.shouldHideArrow?"hidden":void 0},children:i.jsx(vL,{...a,ref:n,style:{...a.style,display:"block"}})})});Tk.displayName=Pk;function NL(e){return e!==null}var CL=e=>({name:"transformOrigin",options:e,fn(t){var j,S,R;const{placement:n,rects:o,middlewareData:a}=t,c=((j=a.arrow)==null?void 0:j.centerOffset)!==0,d=c?0:e.arrowWidth,p=c?0:e.arrowHeight,[m,h]=Rk(n),x={start:"0%",center:"50%",end:"100%"}[h],v=(((S=a.arrow)==null?void 0:S.x)??0)+d/2,b=(((R=a.arrow)==null?void 0:R.y)??0)+p/2;let C="",k="";return m==="bottom"?(C=c?x:`${v}px`,k=`${-p}px`):m==="top"?(C=c?x:`${v}px`,k=`${o.floating.height+p}px`):m==="right"?(C=`${-p}px`,k=c?x:`${b}px`):m==="left"&&(C=`${o.floating.width+p}px`,k=c?x:`${b}px`),{data:{x:C,y:k}}}});function Rk(e){const[t,n="center"]=e.split("-");return[t,n]}var EL=Sk,PL=Ck,TL=Ek,RL=Tk,AL=Symbol("radix.slottable");function DL(e){const t=({children:n})=>i.jsx(i.Fragment,{children:n});return t.displayName=`${e}.Slottable`,t.__radixId=AL,t}var IL=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"}),OL="VisuallyHidden",Ak=g.forwardRef((e,t)=>i.jsx(Mt.span,{...e,ref:t,style:{...IL,...e.style}}));Ak.displayName=OL;var LL=Ak,[ou]=Zo("Tooltip",[kk]),su=kk(),Dk="TooltipProvider",ML=700,jp="tooltip.open",[_L,Bh]=ou(Dk),Ik=e=>{const{__scopeTooltip:t,delayDuration:n=ML,skipDelayDuration:o=300,disableHoverableContent:a=!1,children:l}=e,c=g.useRef(!0),d=g.useRef(!1),p=g.useRef(0);return g.useEffect(()=>{const m=p.current;return()=>window.clearTimeout(m)},[]),i.jsx(_L,{scope:t,isOpenDelayedRef:c,delayDuration:n,onOpen:g.useCallback(()=>{window.clearTimeout(p.current),c.current=!1},[]),onClose:g.useCallback(()=>{window.clearTimeout(p.current),p.current=window.setTimeout(()=>c.current=!0,o)},[o]),isPointerInTransitRef:d,onPointerInTransitChange:g.useCallback(m=>{d.current=m},[]),disableHoverableContent:a,children:l})};Ik.displayName=Dk;var ba="Tooltip",[$L,Oa]=ou(ba),Ok=e=>{const{__scopeTooltip:t,children:n,open:o,defaultOpen:a,onOpenChange:l,disableHoverableContent:c,delayDuration:d}=e,p=Bh(ba,e.__scopeTooltip),m=su(t),[h,x]=g.useState(null),v=_s(),b=g.useRef(0),C=c??p.disableHoverableContent,k=d??p.delayDuration,j=g.useRef(!1),[S,R]=Fc({prop:o,defaultProp:a??!1,onChange:D=>{D?(p.onOpen(),document.dispatchEvent(new CustomEvent(jp))):p.onClose(),l==null||l(D)},caller:ba}),N=g.useMemo(()=>S?j.current?"delayed-open":"instant-open":"closed",[S]),A=g.useCallback(()=>{window.clearTimeout(b.current),b.current=0,j.current=!1,R(!0)},[R]),O=g.useCallback(()=>{window.clearTimeout(b.current),b.current=0,R(!1)},[R]),T=g.useCallback(()=>{window.clearTimeout(b.current),b.current=window.setTimeout(()=>{j.current=!0,R(!0),b.current=0},k)},[k,R]);return g.useEffect(()=>()=>{b.current&&(window.clearTimeout(b.current),b.current=0)},[]),i.jsx(EL,{...m,children:i.jsx($L,{scope:t,contentId:v,open:S,stateAttribute:N,trigger:h,onTriggerChange:x,onTriggerEnter:g.useCallback(()=>{p.isOpenDelayedRef.current?T():A()},[p.isOpenDelayedRef,T,A]),onTriggerLeave:g.useCallback(()=>{C?O():(window.clearTimeout(b.current),b.current=0)},[O,C]),onOpen:A,onClose:O,disableHoverableContent:C,children:n})})};Ok.displayName=ba;var Sp="TooltipTrigger",Lk=g.forwardRef((e,t)=>{const{__scopeTooltip:n,...o}=e,a=Oa(Sp,n),l=Bh(Sp,n),c=su(n),d=g.useRef(null),p=pn(t,d,a.onTriggerChange),m=g.useRef(!1),h=g.useRef(!1),x=g.useCallback(()=>m.current=!1,[]);return g.useEffect(()=>()=>document.removeEventListener("pointerup",x),[x]),i.jsx(PL,{asChild:!0,...c,children:i.jsx(Mt.button,{"aria-describedby":a.open?a.contentId:void 0,"data-state":a.stateAttribute,...o,ref:p,onPointerMove:mt(e.onPointerMove,v=>{v.pointerType!=="touch"&&!h.current&&!l.isPointerInTransitRef.current&&(a.onTriggerEnter(),h.current=!0)}),onPointerLeave:mt(e.onPointerLeave,()=>{a.onTriggerLeave(),h.current=!1}),onPointerDown:mt(e.onPointerDown,()=>{a.open&&a.onClose(),m.current=!0,document.addEventListener("pointerup",x,{once:!0})}),onFocus:mt(e.onFocus,()=>{m.current||a.onOpen()}),onBlur:mt(e.onBlur,a.onClose),onClick:mt(e.onClick,a.onClose)})})});Lk.displayName=Sp;var Uh="TooltipPortal",[FL,zL]=ou(Uh,{forceMount:void 0}),Mk=e=>{const{__scopeTooltip:t,forceMount:n,children:o,container:a}=e,l=Oa(Uh,t);return i.jsx(FL,{scope:t,forceMount:n,children:i.jsx(es,{present:n||l.open,children:i.jsx(Kp,{asChild:!0,container:a,children:o})})})};Mk.displayName=Uh;var Ks="TooltipContent",_k=g.forwardRef((e,t)=>{const n=zL(Ks,e.__scopeTooltip),{forceMount:o=n.forceMount,side:a="top",...l}=e,c=Oa(Ks,e.__scopeTooltip);return i.jsx(es,{present:o||c.open,children:c.disableHoverableContent?i.jsx($k,{side:a,...l,ref:t}):i.jsx(BL,{side:a,...l,ref:t})})}),BL=g.forwardRef((e,t)=>{const n=Oa(Ks,e.__scopeTooltip),o=Bh(Ks,e.__scopeTooltip),a=g.useRef(null),l=pn(t,a),[c,d]=g.useState(null),{trigger:p,onClose:m}=n,h=a.current,{onPointerInTransitChange:x}=o,v=g.useCallback(()=>{d(null),x(!1)},[x]),b=g.useCallback((C,k)=>{const j=C.currentTarget,S={x:C.clientX,y:C.clientY},R=qL(S,j.getBoundingClientRect()),N=KL(S,R),A=GL(k.getBoundingClientRect()),O=XL([...N,...A]);d(O),x(!0)},[x]);return g.useEffect(()=>()=>v(),[v]),g.useEffect(()=>{if(p&&h){const C=j=>b(j,h),k=j=>b(j,p);return p.addEventListener("pointerleave",C),h.addEventListener("pointerleave",k),()=>{p.removeEventListener("pointerleave",C),h.removeEventListener("pointerleave",k)}}},[p,h,b,v]),g.useEffect(()=>{if(c){const C=k=>{const j=k.target,S={x:k.clientX,y:k.clientY},R=(p==null?void 0:p.contains(j))||(h==null?void 0:h.contains(j)),N=!YL(S,c);R?v():N&&(v(),m())};return document.addEventListener("pointermove",C),()=>document.removeEventListener("pointermove",C)}},[p,h,c,m,v]),i.jsx($k,{...e,ref:l})}),[UL,HL]=ou(ba,{isInside:!1}),WL=DL("TooltipContent"),$k=g.forwardRef((e,t)=>{const{__scopeTooltip:n,children:o,"aria-label":a,onEscapeKeyDown:l,onPointerDownOutside:c,...d}=e,p=Oa(Ks,n),m=su(n),{onClose:h}=p;return g.useEffect(()=>(document.addEventListener(jp,h),()=>document.removeEventListener(jp,h)),[h]),g.useEffect(()=>{if(p.trigger){const x=v=>{const b=v.target;b!=null&&b.contains(p.trigger)&&h()};return window.addEventListener("scroll",x,{capture:!0}),()=>window.removeEventListener("scroll",x,{capture:!0})}},[p.trigger,h]),i.jsx(qp,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:l,onPointerDownOutside:c,onFocusOutside:x=>x.preventDefault(),onDismiss:h,children:i.jsxs(TL,{"data-state":p.stateAttribute,...m,...d,ref:t,style:{...d.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:[i.jsx(WL,{children:o}),i.jsx(UL,{scope:n,isInside:!0,children:i.jsx(LL,{id:p.contentId,role:"tooltip",children:a||o})})]})})});_k.displayName=Ks;var Fk="TooltipArrow",VL=g.forwardRef((e,t)=>{const{__scopeTooltip:n,...o}=e,a=su(n);return HL(Fk,n).isInside?null:i.jsx(RL,{...a,...o,ref:t})});VL.displayName=Fk;function qL(e,t){const n=Math.abs(t.top-e.y),o=Math.abs(t.bottom-e.y),a=Math.abs(t.right-e.x),l=Math.abs(t.left-e.x);switch(Math.min(n,o,a,l)){case l:return"left";case a:return"right";case n:return"top";case o:return"bottom";default:throw new Error("unreachable")}}function KL(e,t,n=5){const o=[];switch(t){case"top":o.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case"bottom":o.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case"left":o.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case"right":o.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n});break}return o}function GL(e){const{top:t,right:n,bottom:o,left:a}=e;return[{x:a,y:t},{x:n,y:t},{x:n,y:o},{x:a,y:o}]}function YL(e,t){const{x:n,y:o}=e;let a=!1;for(let l=0,c=t.length-1;l<t.length;c=l++){const d=t[l],p=t[c],m=d.x,h=d.y,x=p.x,v=p.y;h>o!=v>o&&n<(x-m)*(o-h)/(v-h)+m&&(a=!a)}return a}function XL(e){const t=e.slice();return t.sort((n,o)=>n.x<o.x?-1:n.x>o.x?1:n.y<o.y?-1:n.y>o.y?1:0),QL(t)}function QL(e){if(e.length<=1)return e.slice();const t=[];for(let o=0;o<e.length;o++){const a=e[o];for(;t.length>=2;){const l=t[t.length-1],c=t[t.length-2];if((l.x-c.x)*(a.y-c.y)>=(l.y-c.y)*(a.x-c.x))t.pop();else break}t.push(a)}t.pop();const n=[];for(let o=e.length-1;o>=0;o--){const a=e[o];for(;n.length>=2;){const l=n[n.length-1],c=n[n.length-2];if((l.x-c.x)*(a.y-c.y)>=(l.y-c.y)*(a.x-c.x))n.pop();else break}n.push(a)}return n.pop(),t.length===1&&n.length===1&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}var JL=Ik,ZL=Ok,eM=Lk,tM=Mk,zk=_k;const la=JL,ca=ZL,ua=eM,Hs=g.forwardRef(({className:e,sideOffset:t=4,...n},o)=>i.jsx(tM,{children:i.jsx(zk,{ref:o,sideOffset:t,className:Ue("z-50 overflow-hidden rounded-md border border-border bg-popover px-3 py-1.5 text-sm text-popover-foreground shadow-md animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...n})}));Hs.displayName=zk.displayName;function nM({item:e,copiedId:t,selected:n,onToggleSelected:o,onMoveOne:a,onCycleStatus:l,onStatusChange:c,onCopyId:d,onDelete:p,disabled:m,hotkeyRowProps:h}){const{attributes:x,listeners:v,setNodeRef:b,setActivatorNodeRef:C,transform:k,transition:j,isDragging:S}=sk({id:e.id,disabled:m}),R={transform:Vs.Transform.toString(k),transition:j,zIndex:S?50:void 0,position:S?"relative":void 0};return i.jsxs("div",{ref:b,style:R,"data-todo-id":e.id,...h??{},className:`surface-panel flex items-center gap-3 px-3 py-2 cursor-pointer hover:bg-foreground/[0.03] transition ${S?"opacity-50 shadow-lg":""}`,onClick:()=>l(e.id,e.status),children:[i.jsx("input",{type:"checkbox","aria-label":`Select todo ${e.id}`,checked:n,onChange:N=>o(e.id,N),onClick:N=>N.stopPropagation(),className:"h-4 w-4 cursor-pointer accent-foreground"}),!m&&i.jsx("button",{ref:C,...x,...v,className:"cursor-grab active:cursor-grabbing text-muted-foreground/40 hover:text-muted-foreground transition touch-none",onClick:N=>N.stopPropagation(),children:i.jsx(hb,{className:"h-4 w-4"})}),i.jsx(Dh,{status:e.status,onChange:N=>c(e.id,N)}),i.jsxs("div",{className:"flex-1 min-w-0",children:[i.jsx("span",{className:`text-sm ${e.status==="completed"?"line-through text-muted-foreground":"text-foreground"}`,children:e.description}),e.tags.length>0&&i.jsx("span",{className:"ml-2 text-xs text-muted-foreground",children:e.tags.map(N=>`#${N}`).join(" ")}),e.session&&i.jsxs("span",{className:"ml-2 text-xs text-info-foreground/70 font-mono",children:["session:",e.session.slice(0,8)]}),i.jsx(Bk,{item:e})]}),t===e.id?i.jsxs("span",{className:"text-xs text-status-completed-foreground flex items-center gap-1",children:[i.jsx(Sa,{className:"h-3 w-3"})," Copied to clipboard"]}):i.jsxs(i.Fragment,{children:[i.jsxs("button",{className:"text-xs text-muted-foreground/60 font-mono hover:text-foreground transition",onClick:N=>d(N,e.id),children:["t:",e.id]}),i.jsx("button",{className:"text-muted-foreground/40 hover:text-foreground transition",title:"Copy ID",onClick:N=>d(N,e.id),children:i.jsx(Oc,{className:"h-3 w-3"})}),i.jsx("button",{className:"text-muted-foreground/40 hover:text-foreground transition",title:"Move to...",onClick:N=>a(e.id,N),children:i.jsx(cb,{className:"h-3 w-3"})}),i.jsx("button",{className:"text-muted-foreground/40 hover:text-destructive transition",title:"Delete todo",onClick:N=>p(N,e.id,e.description),children:i.jsx(Ro,{className:"h-3 w-3"})})]})]})}function Bk({item:e}){return!(e.branch||e.planDir||e.worktreePath||e.createdAt||e.updatedAt)?null:i.jsxs("span",{className:"inline-flex items-center gap-1 ml-2 align-middle",children:[e.branch?i.jsx(la,{delayDuration:120,children:i.jsxs(ca,{children:[i.jsx(ua,{asChild:!0,children:i.jsxs("span",{className:"inline-flex items-center gap-1 rounded-full border border-info-foreground/30 bg-info/30 px-1.5 py-0.5 text-[10px] font-mono text-info-foreground",children:[i.jsx(Lp,{className:"h-2.5 w-2.5"}),i.jsx("span",{className:"max-w-[120px] truncate",children:e.branch})]})}),i.jsx(Hs,{children:e.branch})]})}):null,e.planDir?i.jsx(la,{delayDuration:120,children:i.jsxs(ca,{children:[i.jsx(ua,{asChild:!0,children:i.jsx("button",{type:"button",onClick:n=>{n.stopPropagation(),navigator.clipboard.writeText(e.planDir)},className:"inline-flex items-center rounded-full border border-status-completed-foreground/40 bg-status-completed/30 p-1 text-status-completed-foreground hover:bg-status-completed/50","aria-label":"Copy plan directory path",children:i.jsx(pb,{className:"h-2.5 w-2.5"})})}),i.jsxs(Hs,{children:["Plan: ",e.planDir]})]})}):null,e.worktreePath||e.createdAt||e.updatedAt?i.jsx(la,{delayDuration:120,children:i.jsxs(ca,{children:[i.jsx(ua,{asChild:!0,children:i.jsx("span",{className:"text-[10px] text-muted-foreground/60 cursor-default",children:"·"})}),i.jsx(Hs,{children:i.jsxs("div",{className:"space-y-0.5 text-xs font-mono",children:[e.worktreePath?i.jsxs("div",{children:["worktree: ",e.worktreePath]}):null,e.createdAt?i.jsxs("div",{children:["created: ",e.createdAt]}):null,e.updatedAt?i.jsxs("div",{children:["updated: ",e.updatedAt]}):null]})})]})}):null]})}function rM(){const{workspace:e}=At(),t=e||"_global",{data:n,loading:o,error:a,refetch:l}=UE(t),[c,d]=g.useState(""),[p,m]=g.useState(""),[h,x]=g.useState(""),[v,b]=g.useState(""),[C,k]=g.useState(null),[j,S]=g.useState(new Set),[R,N]=g.useState(!1),[A,O]=g.useState(!1),[T,D]=g.useState(null),L=g.useRef(null);rs("list:todos");const G=!!(c.trim()||p||h),re=$0(Sc(Xc,{activationConstraint:{distance:8}}),Sc(Yc));function z(Y,ae){Y.stopPropagation(),navigator.clipboard.writeText(ae),k(ae),setTimeout(()=>k(xe=>xe===ae?null:xe),1500)}const K=g.useMemo(()=>{if(!(n!=null&&n.items))return[];const Y=new Set;for(const ae of n.items)for(const xe of ae.tags)Y.add(xe);return Array.from(Y).sort()},[n]),q=g.useMemo(()=>{if(!(n!=null&&n.items))return[];let Y=n.items;if(c.trim()){const ae=c.toLowerCase();Y=Y.filter(xe=>xe.description.toLowerCase().includes(ae)||xe.tags.some(qe=>qe.toLowerCase().includes(ae))||xe.id.includes(ae))}return p&&(Y=Y.filter(ae=>ae.status===p)),h&&(Y=Y.filter(ae=>ae.tags.includes(h))),Y},[n,c,p,h]);g.useEffect(()=>{S(new Set)},[c,p,h,t]);const J=g.useMemo(()=>q.filter(Y=>j.has(Y.id)).length,[q,j]),_=q.length>0&&J===q.length,F=J>0&&!_;function B(Y){S(ae=>{const xe=new Set(ae);return xe.has(Y)?xe.delete(Y):xe.add(Y),xe})}function U(){S(Y=>{const ae=new Set(Y);if(_)for(const xe of q)ae.delete(xe.id);else for(const xe of q)ae.add(xe.id);return ae})}function Z(){S(new Set)}const P=T?[T]:Array.from(j);function M(){S(new Set),D(null),l()}function Q(){S(new Set),l()}async function I(){v.trim()&&(await Vp(t,v.trim()),b(""),l())}const ge={open:"in_progress",in_progress:"completed",completed:"open",blocked:"open"};function Se(Y,ae){fe(Y,ge[ae]||"open")}async function te(Y,ae,xe){Y.stopPropagation(),window.confirm(`Delete "${xe}"? This can't be undone.`)&&(await Gb(t,ae),l())}async function fe(Y,ae){switch(ae){case"open":await Kb(t,Y);break;case"in_progress":await qb(t,Y);break;case"completed":await Wb(t,Y);break;case"blocked":await Vb(t,Y);break}l()}const{hotkeyRowProps:ve}=Ca(q,{scope:"list:todos",bindO:!1,onOpen:Y=>Se(Y.id,Y.status)});ht({keys:"/",scope:"list:todos",description:"Focus filter",handler:()=>{var Y;return(Y=L.current)==null?void 0:Y.focus()}}),ht({keys:"r",scope:"list:todos",description:"Refresh",handler:()=>l()});const[we,be]=To(),Ye=we.get("focus");g.useEffect(()=>{if(!Ye)return;const Y=document.querySelector(`[data-todo-id="${window.CSS.escape(Ye)}"]`);if(!Y)return;Y.scrollIntoView({block:"nearest"}),Y.classList.add("ring-2","ring-primary/60");const ae=window.setTimeout(()=>{Y.classList.remove("ring-2","ring-primary/60"),be(xe=>{const qe=new URLSearchParams(xe);return qe.delete("focus"),qe})},1500);return()=>window.clearTimeout(ae)},[Ye,q.length,be]);async function Xe(Y){const{active:ae,over:xe}=Y;if(!xe||ae.id===xe.id||!(n!=null&&n.items))return;const qe=n.items.findIndex(Ge=>Ge.id===ae.id),Oe=n.items.findIndex(Ge=>Ge.id===xe.id);if(qe===-1||Oe===-1)return;const Be=Zc(n.items,qe,Oe);await HE(t,Be.map(Ge=>Ge.id)),l()}if(o)return i.jsx(kt,{label:"Loading todos..."});if(a)return i.jsx(gt,{error:a});const ne=(n==null?void 0:n.counts)||{open:0,in_progress:0,blocked:0,total:0};return i.jsxs("div",{className:"space-y-4",children:[i.jsxs("div",{className:"grid gap-3 grid-cols-[repeat(auto-fill,minmax(140px,1fr))]",children:[i.jsx(nt,{label:"Open",value:ne.open,icon:zn}),i.jsx(nt,{label:"In Progress",value:ne.in_progress,icon:zn,tone:"info"}),i.jsx(nt,{label:"Blocked",value:ne.blocked,icon:Qs,tone:"warn"}),i.jsx(nt,{label:"Total",value:ne.total,icon:zn})]}),i.jsx("div",{className:"surface-panel p-3",children:i.jsxs("div",{className:"flex gap-2",children:[i.jsx("input",{type:"text",placeholder:"Add a todo...",value:v,onChange:Y=>b(Y.target.value),onKeyDown:Y=>Y.key==="Enter"&&I(),className:"h-9 flex-1 rounded-md border border-border/70 bg-background px-3 text-sm text-foreground placeholder:text-muted-foreground/60 focus:border-foreground/30 focus:outline-none"}),i.jsxs("button",{onClick:I,disabled:!v.trim(),className:"inline-flex h-9 items-center gap-1.5 rounded-md bg-foreground px-3 text-sm font-medium text-background transition hover:bg-foreground/90 disabled:opacity-40",children:[i.jsx(Un,{className:"h-4 w-4"}),"Add"]})]})}),i.jsxs("div",{className:"flex items-center gap-3",children:[i.jsxs("div",{className:"relative flex-1 max-w-sm",children:[i.jsx(Xs,{className:"absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground"}),i.jsx("input",{ref:L,type:"text",placeholder:"Search...",value:c,onChange:Y=>d(Y.target.value),className:"h-9 w-full rounded-md border border-border/70 bg-background pl-9 pr-3 text-sm text-foreground placeholder:text-muted-foreground/60 focus:border-foreground/30 focus:outline-none"})]}),i.jsxs("select",{value:p,onChange:Y=>m(Y.target.value),className:"h-9 rounded-md border border-border/70 bg-background px-2 text-sm text-foreground focus:border-foreground/30 focus:outline-none",children:[i.jsx("option",{value:"",children:"All statuses"}),i.jsx("option",{value:"open",children:"Open"}),i.jsx("option",{value:"in_progress",children:"In Progress"}),i.jsx("option",{value:"completed",children:"Completed"}),i.jsx("option",{value:"blocked",children:"Blocked"})]}),K.length>0&&i.jsxs("select",{value:h,onChange:Y=>x(Y.target.value),className:"h-9 rounded-md border border-border/70 bg-background px-2 text-sm text-foreground focus:border-foreground/30 focus:outline-none",children:[i.jsx("option",{value:"",children:"All tags"}),K.map(Y=>i.jsxs("option",{value:Y,children:["#",Y]},Y))]})]}),j.size>0?i.jsxs("div",{className:"surface-panel flex items-center justify-between gap-3 px-3 py-2",children:[i.jsxs("span",{className:"text-sm font-medium",children:[j.size," selected"]}),i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx("button",{type:"button",onClick:()=>N(!0),className:"shell-action bg-foreground text-background hover:opacity-90",children:"Promote selected"}),i.jsx("button",{type:"button",onClick:()=>{D(null),O(!0)},className:"shell-action",children:"Move to…"}),i.jsx("button",{type:"button",onClick:Z,className:"text-xs text-muted-foreground hover:text-foreground",children:"Clear"})]})]}):null,q.length===0?i.jsx(rt,{title:"No todos",description:"Add your first todo above."}):i.jsxs(i.Fragment,{children:[i.jsxs("div",{className:"flex items-center gap-3 px-3 py-1 text-xs text-muted-foreground",children:[i.jsx("input",{type:"checkbox","aria-label":"Select all visible todos",checked:_,ref:Y=>{Y&&(Y.indeterminate=F)},onChange:U,className:"h-4 w-4 cursor-pointer accent-foreground"}),i.jsxs("span",{children:["Select all in current filter (",q.length,")"]})]}),i.jsx(J0,{sensors:re,collisionDetection:F0,onDragEnd:Xe,children:i.jsx(rk,{items:q.map(Y=>Y.id),strategy:ek,children:i.jsx("div",{className:"space-y-1",children:q.map((Y,ae)=>i.jsx(nM,{item:Y,copiedId:C,selected:j.has(Y.id),onToggleSelected:xe=>B(xe),onMoveOne:(xe,qe)=>{qe.stopPropagation(),D(xe),O(!0)},onCycleStatus:Se,onStatusChange:fe,onCopyId:z,onDelete:te,disabled:G,hotkeyRowProps:ve(ae)},Y.id))})})})]}),i.jsx(ak,{open:R,selectedIds:Array.from(j),scope:{kind:"workspace",workspace:t},onOpenChange:N,onDone:Q}),i.jsx(lk,{open:A,selectedIds:P,scope:{kind:"workspace",workspace:t},onOpenChange:Y=>{O(Y),Y||D(null)},onDone:M})]})}function oM({item:e,copiedId:t,selected:n,onToggleSelected:o,onMoveOne:a,onCycleStatus:l,onStatusChange:c,onCopyId:d,onDelete:p,disabled:m,hotkeyRowProps:h}){const{attributes:x,listeners:v,setNodeRef:b,setActivatorNodeRef:C,transform:k,transition:j,isDragging:S}=sk({id:e.id,disabled:m}),R={transform:Vs.Transform.toString(k),transition:j,zIndex:S?50:void 0,position:S?"relative":void 0};return i.jsxs("div",{ref:b,style:R,"data-todo-id":e.id,...h??{},className:`surface-panel flex items-center gap-3 px-3 py-2 cursor-pointer hover:bg-foreground/[0.03] transition ${S?"opacity-50 shadow-lg":""}`,onClick:()=>l(e.id,e.status),children:[i.jsx("input",{type:"checkbox","aria-label":`Select todo ${e.id}`,checked:n,onChange:N=>o(e.id,N),onClick:N=>N.stopPropagation(),className:"h-4 w-4 cursor-pointer accent-foreground"}),!m&&i.jsx("button",{ref:C,...x,...v,className:"cursor-grab active:cursor-grabbing text-muted-foreground/40 hover:text-muted-foreground transition touch-none",onClick:N=>N.stopPropagation(),children:i.jsx(hb,{className:"h-4 w-4"})}),i.jsx(Dh,{status:e.status,onChange:N=>c(e.id,N)}),i.jsxs("div",{className:"flex-1 min-w-0",children:[i.jsx("span",{className:`text-sm ${e.status==="completed"?"line-through text-muted-foreground":"text-foreground"}`,children:e.description}),e.tags.length>0&&i.jsx("span",{className:"ml-2 text-xs text-muted-foreground",children:e.tags.map(N=>`#${N}`).join(" ")}),e.session&&i.jsxs("span",{className:"ml-2 text-xs text-info-foreground/70 font-mono",children:["session:",e.session.slice(0,8)]}),i.jsx(Bk,{item:e})]}),t===e.id?i.jsxs("span",{className:"text-xs text-status-completed-foreground flex items-center gap-1",children:[i.jsx(Sa,{className:"h-3 w-3"})," Copied to clipboard"]}):i.jsxs(i.Fragment,{children:[i.jsxs("button",{className:"text-xs text-muted-foreground/60 font-mono hover:text-foreground transition",onClick:N=>d(N,e.id),children:["t:",e.id]}),i.jsx("button",{className:"text-muted-foreground/40 hover:text-foreground transition",title:"Copy ID",onClick:N=>d(N,e.id),children:i.jsx(Oc,{className:"h-3 w-3"})}),i.jsx("button",{className:"text-muted-foreground/40 hover:text-foreground transition",title:"Move to...",onClick:N=>a(e.id,N),children:i.jsx(cb,{className:"h-3 w-3"})}),i.jsx("button",{className:"text-muted-foreground/40 hover:text-destructive transition",title:"Delete todo",onClick:N=>p(N,e.id,e.description),children:i.jsx(Ro,{className:"h-3 w-3"})})]})]})}function sM({projectId:e}){const{data:t,loading:n,error:o,refetch:a}=rO(e),[l,c]=g.useState(""),[d,p]=g.useState(""),[m,h]=g.useState(""),[x,v]=g.useState(""),[b,C]=g.useState(null),[k,j]=g.useState(new Set),[S,R]=g.useState(!1),[N,A]=g.useState(!1),[O,T]=g.useState(null),D=g.useRef(null);rs("list:todos");const L=!!(l.trim()||d||m),G=$0(Sc(Xc,{activationConstraint:{distance:8}}),Sc(Yc));function re(ne,Y){ne.stopPropagation(),navigator.clipboard.writeText(Y),C(Y),setTimeout(()=>C(ae=>ae===Y?null:ae),1500)}const z=g.useMemo(()=>{if(!(t!=null&&t.items))return[];const ne=new Set;for(const Y of t.items)for(const ae of Y.tags)ne.add(ae);return Array.from(ne).sort()},[t]),K=g.useMemo(()=>{if(!(t!=null&&t.items))return[];let ne=t.items;if(l.trim()){const Y=l.toLowerCase();ne=ne.filter(ae=>ae.description.toLowerCase().includes(Y)||ae.tags.some(xe=>xe.toLowerCase().includes(Y))||ae.id.includes(Y))}return d&&(ne=ne.filter(Y=>Y.status===d)),m&&(ne=ne.filter(Y=>Y.tags.includes(m))),ne},[t,l,d,m]);g.useEffect(()=>{j(new Set)},[l,d,m,e]);const q=g.useMemo(()=>K.filter(ne=>k.has(ne.id)).length,[K,k]),J=K.length>0&&q===K.length,_=q>0&&!J;function F(ne){j(Y=>{const ae=new Set(Y);return ae.has(ne)?ae.delete(ne):ae.add(ne),ae})}function B(){j(ne=>{const Y=new Set(ne);if(J)for(const ae of K)Y.delete(ae.id);else for(const ae of K)Y.add(ae.id);return Y})}function U(){j(new Set)}const Z=O?[O]:Array.from(k);function P(){j(new Set),T(null),a()}function M(){j(new Set),a()}async function Q(){x.trim()&&(await oO(e,x.trim()),v(""),a())}const I={open:"in_progress",in_progress:"completed",completed:"open",blocked:"open"};function ge(ne,Y){te(ne,I[Y]||"open")}async function Se(ne,Y,ae){ne.stopPropagation(),window.confirm(`Delete "${ae}"? This can't be undone.`)&&(await uO(e,Y),a())}async function te(ne,Y){switch(Y){case"open":await lO(e,ne);break;case"in_progress":await aO(e,ne);break;case"completed":await sO(e,ne);break;case"blocked":await iO(e,ne);break}a()}const{hotkeyRowProps:fe}=Ca(K,{scope:"list:todos",bindO:!1,onOpen:ne=>ge(ne.id,ne.status)});ht({keys:"/",scope:"list:todos",description:"Focus filter",handler:()=>{var ne;return(ne=D.current)==null?void 0:ne.focus()}}),ht({keys:"r",scope:"list:todos",description:"Refresh",handler:()=>a()});const[ve,we]=To(),be=ve.get("focus");g.useEffect(()=>{if(!be)return;const ne=document.querySelector(`[data-todo-id="${window.CSS.escape(be)}"]`);if(!ne)return;ne.scrollIntoView({block:"nearest"}),ne.classList.add("ring-2","ring-primary/60");const Y=window.setTimeout(()=>{ne.classList.remove("ring-2","ring-primary/60"),we(ae=>{const xe=new URLSearchParams(ae);return xe.delete("focus"),xe},{replace:!0})},1500);return()=>window.clearTimeout(Y)},[be,K.length,we]);async function Ye(ne){const{active:Y,over:ae}=ne;if(!ae||Y.id===ae.id||!(t!=null&&t.items))return;const xe=t.items.findIndex(Be=>Be.id===Y.id),qe=t.items.findIndex(Be=>Be.id===ae.id);if(xe===-1||qe===-1)return;const Oe=Zc(t.items,xe,qe);await cO(e,Oe.map(Be=>Be.id)),a()}if(n)return i.jsx(kt,{label:"Loading todos..."});if(o)return i.jsx(gt,{error:o});const Xe=(t==null?void 0:t.counts)||{open:0,in_progress:0,blocked:0,total:0};return i.jsxs("div",{className:"space-y-4",children:[i.jsxs("div",{className:"grid gap-3 grid-cols-[repeat(auto-fill,minmax(140px,1fr))]",children:[i.jsx(nt,{label:"Open",value:Xe.open,icon:zn}),i.jsx(nt,{label:"In Progress",value:Xe.in_progress,icon:zn,tone:"info"}),i.jsx(nt,{label:"Blocked",value:Xe.blocked,icon:Qs,tone:"warn"}),i.jsx(nt,{label:"Total",value:Xe.total,icon:zn})]}),i.jsx("div",{className:"surface-panel p-3",children:i.jsxs("div",{className:"flex gap-2",children:[i.jsx("input",{type:"text",placeholder:"Add a todo...",value:x,onChange:ne=>v(ne.target.value),onKeyDown:ne=>ne.key==="Enter"&&Q(),className:"h-9 flex-1 rounded-md border border-border/70 bg-background px-3 text-sm text-foreground placeholder:text-muted-foreground/60 focus:border-foreground/30 focus:outline-none"}),i.jsxs("button",{onClick:Q,disabled:!x.trim(),className:"inline-flex h-9 items-center gap-1.5 rounded-md bg-foreground px-3 text-sm font-medium text-background transition hover:bg-foreground/90 disabled:opacity-40",children:[i.jsx(Un,{className:"h-4 w-4"}),"Add"]})]})}),i.jsxs("div",{className:"flex items-center gap-3",children:[i.jsxs("div",{className:"relative flex-1 max-w-sm",children:[i.jsx(Xs,{className:"absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground"}),i.jsx("input",{ref:D,type:"text",placeholder:"Search...",value:l,onChange:ne=>c(ne.target.value),className:"h-9 w-full rounded-md border border-border/70 bg-background pl-9 pr-3 text-sm text-foreground placeholder:text-muted-foreground/60 focus:border-foreground/30 focus:outline-none"})]}),i.jsxs("select",{value:d,onChange:ne=>p(ne.target.value),className:"h-9 rounded-md border border-border/70 bg-background px-2 text-sm text-foreground focus:border-foreground/30 focus:outline-none",children:[i.jsx("option",{value:"",children:"All statuses"}),i.jsx("option",{value:"open",children:"Open"}),i.jsx("option",{value:"in_progress",children:"In Progress"}),i.jsx("option",{value:"completed",children:"Completed"}),i.jsx("option",{value:"blocked",children:"Blocked"})]}),z.length>0&&i.jsxs("select",{value:m,onChange:ne=>h(ne.target.value),className:"h-9 rounded-md border border-border/70 bg-background px-2 text-sm text-foreground focus:border-foreground/30 focus:outline-none",children:[i.jsx("option",{value:"",children:"All tags"}),z.map(ne=>i.jsxs("option",{value:ne,children:["#",ne]},ne))]})]}),k.size>0?i.jsxs("div",{className:"surface-panel flex items-center justify-between gap-3 px-3 py-2",children:[i.jsxs("span",{className:"text-sm font-medium",children:[k.size," selected"]}),i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx("button",{type:"button",onClick:()=>R(!0),className:"shell-action bg-foreground text-background hover:opacity-90",children:"Promote selected"}),i.jsx("button",{type:"button",onClick:()=>{T(null),A(!0)},className:"shell-action",children:"Move to…"}),i.jsx("button",{type:"button",onClick:U,className:"text-xs text-muted-foreground hover:text-foreground",children:"Clear"})]})]}):null,K.length===0?i.jsx(rt,{title:"No todos",description:"Add your first todo above."}):i.jsxs(i.Fragment,{children:[i.jsxs("div",{className:"flex items-center gap-3 px-3 py-1 text-xs text-muted-foreground",children:[i.jsx("input",{type:"checkbox","aria-label":"Select all visible todos",checked:J,ref:ne=>{ne&&(ne.indeterminate=_)},onChange:B,className:"h-4 w-4 cursor-pointer accent-foreground"}),i.jsxs("span",{children:["Select all in current filter (",K.length,")"]})]}),i.jsx(J0,{sensors:G,collisionDetection:F0,onDragEnd:Ye,children:i.jsx(rk,{items:K.map(ne=>ne.id),strategy:ek,children:i.jsx("div",{className:"space-y-1",children:K.map((ne,Y)=>i.jsx(oM,{item:ne,copiedId:b,selected:k.has(ne.id),onToggleSelected:ae=>F(ae),onMoveOne:(ae,xe)=>{xe.stopPropagation(),T(ae),A(!0)},onCycleStatus:ge,onStatusChange:te,onCopyId:re,onDelete:Se,disabled:L,hotkeyRowProps:fe(Y)},ne.id))})})})]}),i.jsx(ak,{open:S,selectedIds:Array.from(k),scope:{kind:"project",projectId:e},onOpenChange:R,onDone:M}),i.jsx(lk,{open:N,selectedIds:Z,scope:{kind:"project",projectId:e},onOpenChange:ne=>{A(ne),ne||T(null)},onDone:P})]})}const iM=new Set(["overview","assignments","todos","dependencies","knowledge"]);function Ev(){const{slug:e}=At(),t=Lt(),n=Ut();rs("project"),ht({keys:"a",scope:"project",description:"Create assignment",handler:()=>n(`${t}/projects/${e}/create/assignment`)}),ht({keys:"e",scope:"project",description:"Edit project",handler:()=>n(`${t}/projects/${e}/edit`)});const{data:o,loading:a,error:l,refetch:c}=zb(e),d=Hc(),{data:p}=Up(),[m,h]=To(),x=m.get("tab"),v=x&&iM.has(x)?x:"overview";function b(z){h(K=>{const q=new URLSearchParams(K);return z==="overview"?q.delete("tab"):q.set("tab",z),q},{replace:!0})}const[C,k]=g.useState("board"),[j,S]=g.useState("all"),[R,N]=g.useState("all"),[A,O]=g.useState("all"),T=g.useMemo(()=>o?Object.fromEntries(o.assignments.flatMap(z=>{const K=`${t}/projects/${o.slug}/assignments/${z.slug}`;return[[z.slug,K],[z.title,K]]})):{},[o]);async function D(z){await fetch(`/api/projects/${e}/status-override`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({status:z})}),c()}async function L(z){await fetch(`/api/projects/${e}/move-workspace`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({workspace:z})}),c()}if(a)return i.jsx(kt,{label:"Loading project workspace…"});if(l||!o)return i.jsx(gt,{error:l||"Project not found."});const G=Array.from(new Set(o.assignments.map(z=>z.assignee).filter(Boolean))).sort(),re=o.assignments.filter(z=>!(j!=="all"&&z.status!==j||R!=="all"&&z.assignee!==R||A!=="all"&&z.priority!==A));return i.jsxs("div",{className:"space-y-5",children:[i.jsxs("div",{className:"flex flex-wrap items-center gap-3",children:[i.jsx(Xt,{status:o.status}),o.statusOverride&&i.jsx("button",{type:"button",className:"shell-action border-warning-foreground/40 text-warning-foreground",onClick:()=>D(null),title:"Clear manual status override and return to derived status",children:"Clear Override"}),i.jsxs("select",{className:"shell-action appearance-none bg-transparent text-sm",value:"",onChange:z=>{z.target.value&&D(z.target.value)},title:"Override project status",children:[i.jsx("option",{value:"",children:"Set Status…"}),d.statuses.map(z=>i.jsx("option",{value:z.id,children:z.label},z.id)),i.jsx("option",{value:"active",children:"Active"})]}),p&&p.workspaces.length>0&&i.jsxs("select",{className:"shell-action appearance-none bg-transparent text-sm",value:"",onChange:z=>{z.target.value==="_ungrouped"?L(null):z.target.value&&L(z.target.value)},title:"Move project to a different workspace",children:[i.jsx("option",{value:"",children:"Move to Workspace…"}),p.workspaces.filter(z=>z!==o.workspace).map(z=>i.jsx("option",{value:z,children:z},z)),o.workspace&&i.jsx("option",{value:"_ungrouped",children:"Ungrouped"})]}),i.jsxs(De,{className:"shell-action",to:`${t}/projects/${o.slug}/edit`,children:[i.jsx(_x,{className:"h-4 w-4"}),i.jsx("span",{children:"Edit Project"})]}),i.jsxs(De,{className:"shell-action bg-foreground text-background hover:opacity-90",to:`${t}/projects/${o.slug}/create/assignment`,children:[i.jsx(Un,{className:"h-4 w-4"}),i.jsx("span",{children:"New Assignment"})]}),i.jsxs("span",{className:"text-xs text-muted-foreground",children:["Created ",No(o.created),". Last source update ",Er(o.updated),"."]})]}),i.jsxs("div",{className:"grid gap-3 md:grid-cols-2 xl:grid-cols-5",children:[i.jsx(nt,{label:"Assignments",value:o.progress.total}),i.jsx(nt,{label:"In Progress",value:o.progress.in_progress??0,tone:"info"}),i.jsx(nt,{label:"Review",value:o.progress.review??0,tone:"info"}),i.jsx(nt,{label:"Blocked",value:o.progress.blocked??0,tone:"warn"}),i.jsx(nt,{label:"Completed",value:o.progress.completed??0,tone:"success"})]}),i.jsxs("div",{className:"grid gap-4 xl:grid-cols-[minmax(0,1fr)_280px]",children:[i.jsx("div",{className:"space-y-4",children:i.jsx(uh,{value:v,onValueChange:b,items:[{value:"overview",label:"Overview",content:i.jsx("div",{className:"space-y-5",children:i.jsx(Ie,{title:"Project Overview",children:i.jsx(Yt,{content:o.body,emptyState:"This project does not have overview content yet."})})})},{value:"assignments",label:"Assignments",count:o.assignments.length,content:i.jsx("div",{className:"space-y-5",children:i.jsx(Ie,{title:"Assignment Queue",description:"Board and table views over the source assignment files.",actions:i.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[i.jsxs("select",{value:j,onChange:z=>S(z.target.value),className:"editor-input max-w-[170px]",children:[i.jsx("option",{value:"all",children:"All statuses"}),d.statuses.map(z=>i.jsx("option",{value:z.id,children:z.label},z.id))]}),i.jsxs("select",{value:R,onChange:z=>N(z.target.value),className:"editor-input max-w-[170px]",children:[i.jsx("option",{value:"all",children:"All assignees"}),G.map(z=>i.jsx("option",{value:z??"",children:z},z))]}),i.jsxs("select",{value:A,onChange:z=>O(z.target.value),className:"editor-input max-w-[170px]",children:[i.jsx("option",{value:"all",children:"All priorities"}),i.jsx("option",{value:"low",children:"Low"}),i.jsx("option",{value:"medium",children:"Medium"}),i.jsx("option",{value:"high",children:"High"}),i.jsx("option",{value:"critical",children:"Critical"})]}),i.jsx(ah,{value:C,onChange:z=>k(z),options:[{value:"board",label:"Board"},{value:"table",label:"Table"}]})]}),children:re.length===0?i.jsx(rt,{title:"No assignments match these filters",description:"Clear the current filters or create a new assignment for this project.",actions:i.jsx(De,{className:"shell-action bg-foreground text-background hover:opacity-90",to:`${t}/projects/${o.slug}/create/assignment`,children:"Create Assignment"})}):C==="board"?i.jsx("div",{className:"grid gap-3 lg:grid-cols-2",children:re.map(z=>i.jsx(aM,{projectSlug:o.slug,assignment:z},z.slug))}):i.jsx("div",{className:"overflow-x-auto",children:i.jsxs("table",{className:"w-full min-w-[720px] text-left text-sm",children:[i.jsx("thead",{children:i.jsxs("tr",{className:"border-b border-border/60 text-muted-foreground",children:[i.jsx("th",{className:"pb-3 font-medium",children:"Assignment"}),i.jsx("th",{className:"pb-3 font-medium",children:"Status"}),i.jsx("th",{className:"pb-3 font-medium",children:"Priority"}),i.jsx("th",{className:"pb-3 font-medium",children:"Assignee"}),i.jsx("th",{className:"pb-3 font-medium",children:"Updated"})]})}),i.jsx("tbody",{children:re.map(z=>i.jsxs("tr",{className:"border-b border-border/50 last:border-0",children:[i.jsx("td",{className:"py-4",children:i.jsx(De,{to:`${t}/projects/${o.slug}/assignments/${z.slug}`,className:"font-semibold text-foreground hover:text-primary",children:z.title})}),i.jsx("td",{className:"py-4",children:i.jsx(Xt,{status:z.status})}),i.jsx("td",{className:"py-4 capitalize text-muted-foreground",children:z.priority}),i.jsx("td",{className:"py-4 text-muted-foreground",children:z.assignee??"—"}),i.jsx("td",{className:"py-4 text-muted-foreground",children:No(z.updated)})]},z.slug))})]})})})})},{value:"todos",label:"Todos",content:i.jsx(sM,{projectId:o.slug})},{value:"dependencies",label:"Dependencies",content:o.dependencyGraph?i.jsx(Ie,{title:"Dependency Graph",description:"Rendered from the derived graph when available, with a source-based fallback.",children:i.jsx(tR,{definition:o.dependencyGraph,nodeRoutes:T})}):i.jsx(rt,{title:"No dependency graph yet",description:"Dependencies appear here once assignments declare dependsOn relationships."})},{value:"knowledge",label:"Knowledge",content:i.jsxs("div",{className:"grid gap-3 lg:grid-cols-2",children:[i.jsx(Ie,{title:"Resources",description:"Shared project references.",children:o.resources.length===0?i.jsx(rt,{title:"No resources yet",description:"Resources live at the project level and stay available to every assignment."}):i.jsx("div",{className:"space-y-3",children:o.resources.map(z=>i.jsxs("div",{className:"rounded-md border border-border/60 bg-background/80 p-3",children:[i.jsx("h3",{className:"font-semibold text-foreground",children:z.name}),i.jsxs("p",{className:"mt-2 text-sm text-muted-foreground",children:[z.category," · ",z.source]})]},z.slug))})}),i.jsx(Ie,{title:"Memories",description:"Learnings and patterns captured during the project.",children:o.memories.length===0?i.jsx(rt,{title:"No memories yet",description:"Memories capture patterns discovered during execution so later assignments can reuse them."}):i.jsx("div",{className:"space-y-3",children:o.memories.map(z=>i.jsxs("div",{className:"rounded-md border border-border/60 bg-background/80 p-3",children:[i.jsx("h3",{className:"font-semibold text-foreground",children:z.name}),i.jsxs("p",{className:"mt-2 text-sm text-muted-foreground",children:[z.scope," · ",z.source]})]},z.slug))})})]})}]})}),i.jsxs("div",{className:"space-y-5",children:[i.jsx(Ie,{title:"Progress Summary",children:i.jsx(yc,{progress:o.progress,showLegend:!0})}),i.jsx(Ie,{title:"Attention",children:i.jsxs("dl",{className:"space-y-3 text-sm",children:[i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsx("dt",{className:"text-muted-foreground",children:"Blocked"}),i.jsx("dd",{className:"font-semibold text-foreground",children:o.needsAttention.blockedCount})]}),i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsx("dt",{className:"text-muted-foreground",children:"Failed"}),i.jsx("dd",{className:"font-semibold text-foreground",children:o.needsAttention.failedCount})]}),i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsx("dt",{className:"text-muted-foreground",children:"Unanswered questions"}),i.jsx("dd",{className:"font-semibold text-foreground",children:o.needsAttention.openQuestions})]})]})}),i.jsx(Ie,{title:"Quick Links",children:i.jsxs("div",{className:"space-y-2 text-sm",children:[i.jsxs(De,{className:"flex items-center gap-2 text-primary hover:underline",to:`${t}/projects/${o.slug}/edit`,children:[i.jsx(_x,{className:"h-4 w-4"}),"Edit project source"]}),i.jsxs(De,{className:"flex items-center gap-2 text-primary hover:underline",to:`${t}/projects/${o.slug}/create/assignment`,children:[i.jsx(Un,{className:"h-4 w-4"}),"Create assignment"]}),i.jsxs(De,{className:"flex items-center gap-2 text-primary hover:underline",to:"/help",children:[i.jsx(iC,{className:"h-4 w-4"}),"Review project rules"]}),i.jsxs("button",{type:"button",onClick:()=>b("dependencies"),className:"flex items-center gap-2 text-primary hover:underline",children:[i.jsx(Lp,{className:"h-4 w-4"}),"Jump to dependencies"]})]})}),o.archived?i.jsxs(Ie,{title:"Archive Metadata",children:[i.jsxs("p",{className:"text-sm leading-6 text-muted-foreground",children:["Archived ",o.archivedAt?Er(o.archivedAt):"with no timestamp recorded","."]}),o.archivedReason?i.jsx("p",{className:"mt-2 text-sm leading-6 text-muted-foreground",children:o.archivedReason}):null]}):null]})]})]})}function aM({projectSlug:e,assignment:t}){const n=Lt();return i.jsxs(De,{to:`${n}/projects/${e}/assignments/${t.slug}`,className:"block rounded-lg border border-border/60 bg-background/80 p-3 transition hover:border-primary/40",children:[i.jsxs("div",{className:"flex items-start justify-between gap-3",children:[i.jsxs("div",{className:"space-y-1",children:[i.jsx("h3",{className:"font-semibold text-foreground",children:t.title}),i.jsxs("p",{className:"inline-flex items-center gap-1.5 font-mono text-xs text-muted-foreground/70",title:t.id,children:[t.id.slice(0,8),i.jsx("span",{onClick:o=>{o.preventDefault(),o.stopPropagation()},children:i.jsx(qr,{value:t.id})})]}),i.jsxs("p",{className:"text-sm text-muted-foreground",children:["Updated ",No(t.updated)]})]}),i.jsx(Xt,{status:t.status})]}),i.jsxs("div",{className:"mt-4 flex flex-wrap gap-2",children:[i.jsx("span",{className:"rounded-full border border-border/60 px-2.5 py-1 text-xs capitalize text-muted-foreground",children:t.priority}),i.jsx("span",{className:"rounded-full border border-border/60 px-2.5 py-1 text-xs text-muted-foreground",children:t.assignee??"Unassigned"}),i.jsxs("span",{className:"rounded-full border border-border/60 px-2.5 py-1 text-xs text-muted-foreground",children:[t.dependsOn.length," dependencies"]})]})]})}function Uk({open:e,action:t,assignmentTitle:n,loading:o=!1,onConfirm:a,onOpenChange:l}){const[c,d]=g.useState("");g.useEffect(()=>{e||d("")},[e,t==null?void 0:t.command]);const p=g.useMemo(()=>t&&t.command==="block"?"Blocked Reason":"Reason",[t]);if(!t)return null;const m=`${t.label} "${n}"`,h=o?"Applying...":t.label,x=c.trim()||void 0;return i.jsx(Zs,{open:e,onOpenChange:v=>o?void 0:l(v),children:i.jsx(ts,{className:"max-w-xl",children:i.jsxs("form",{className:"space-y-5",onSubmit:v=>{v.preventDefault(),a(x)},children:[i.jsxs(th,{children:[i.jsx(ns,{children:m}),i.jsx(Na,{children:t.description})]}),t.warning?i.jsx("div",{className:"rounded-lg border border-warning-foreground/30 bg-warning px-4 py-3 text-sm text-warning-foreground",children:t.warning}):null,i.jsxs("div",{className:"space-y-2",children:[i.jsx("label",{className:"block text-xs font-medium uppercase tracking-[0.08em] text-muted-foreground",children:p}),i.jsx("textarea",{value:c,onChange:v=>d(v.target.value),autoFocus:!0,rows:4,disabled:o,placeholder:"Optional context for why this assignment is blocked.",className:"editor-textarea min-h-[120px] bg-background/95 font-sans"}),i.jsx("p",{className:"text-xs text-muted-foreground",children:"Leave this blank to continue without a written reason."})]}),i.jsxs(nh,{children:[i.jsx("button",{type:"button",onClick:()=>l(!1),disabled:o,className:"shell-action disabled:cursor-not-allowed disabled:opacity-50",children:"Cancel"}),i.jsx("button",{type:"submit",disabled:o,className:"shell-action bg-foreground text-background hover:opacity-90 disabled:cursor-not-allowed disabled:opacity-50",children:h})]})]})})})}var lM=Symbol("radix.slottable");function cM(e){const t=({children:n})=>i.jsx(i.Fragment,{children:n});return t.displayName=`${e}.Slottable`,t.__radixId=lM,t}var Hk="AlertDialog",[uM]=Zo(Hk,[uw]),Qr=uw(),Wk=e=>{const{__scopeAlertDialog:t,...n}=e,o=Qr(t);return i.jsx(Cw,{...o,...n,modal:!0})};Wk.displayName=Hk;var dM="AlertDialogTrigger",fM=g.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...o}=e,a=Qr(n);return i.jsx(LP,{...a,...o,ref:t})});fM.displayName=dM;var pM="AlertDialogPortal",Vk=e=>{const{__scopeAlertDialog:t,...n}=e,o=Qr(t);return i.jsx(Ew,{...o,...n})};Vk.displayName=pM;var hM="AlertDialogOverlay",qk=g.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...o}=e,a=Qr(n);return i.jsx(Qp,{...a,...o,ref:t})});qk.displayName=hM;var Ws="AlertDialogContent",[mM,gM]=uM(Ws),xM=cM("AlertDialogContent"),Kk=g.forwardRef((e,t)=>{const{__scopeAlertDialog:n,children:o,...a}=e,l=Qr(n),c=g.useRef(null),d=pn(t,c),p=g.useRef(null);return i.jsx(AP,{contentName:Ws,titleName:Gk,docsSlug:"alert-dialog",children:i.jsx(mM,{scope:n,cancelRef:p,children:i.jsxs(Jp,{role:"alertdialog",...l,...a,ref:d,onOpenAutoFocus:mt(a.onOpenAutoFocus,m=>{var h;m.preventDefault(),(h=p.current)==null||h.focus({preventScroll:!0})}),onPointerDownOutside:m=>m.preventDefault(),onInteractOutside:m=>m.preventDefault(),children:[i.jsx(xM,{children:o}),i.jsx(vM,{contentRef:c})]})})})});Kk.displayName=Ws;var Gk="AlertDialogTitle",Yk=g.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...o}=e,a=Qr(n);return i.jsx(Zp,{...a,...o,ref:t})});Yk.displayName=Gk;var Xk="AlertDialogDescription",Qk=g.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...o}=e,a=Qr(n);return i.jsx(eh,{...a,...o,ref:t})});Qk.displayName=Xk;var yM="AlertDialogAction",Jk=g.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...o}=e,a=Qr(n);return i.jsx(Pw,{...a,...o,ref:t})});Jk.displayName=yM;var Zk="AlertDialogCancel",e1=g.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...o}=e,{cancelRef:a}=gM(Zk,n),l=Qr(n),c=pn(t,a);return i.jsx(Pw,{...l,...o,ref:c})});e1.displayName=Zk;var vM=({contentRef:e})=>{const t=`\`${Ws}\` requires a description for the component to be accessible for screen reader users.
477
+
478
+ You can add a description to the \`${Ws}\` by passing a \`${Xk}\` component as a child, which also benefits sighted users by adding visible context to the dialog.
479
+
480
+ Alternatively, you can use your own component as a description by assigning it an \`id\` and passing the same value to the \`aria-describedby\` prop in \`${Ws}\`. If the description is confusing or duplicative for sighted users, you can use the \`@radix-ui/react-visually-hidden\` primitive as a wrapper around your description component.
481
+
482
+ For more information, see https://radix-ui.com/primitives/docs/components/alert-dialog`;return g.useEffect(()=>{var o;document.getElementById((o=e.current)==null?void 0:o.getAttribute("aria-describedby"))||console.warn(t)},[t,e]),null},bM=Wk,wM=Vk,t1=qk,n1=Kk,r1=Jk,o1=e1,s1=Yk,i1=Qk;const kM=bM,jM=wM,a1=g.forwardRef(({className:e,...t},n)=>i.jsx(t1,{ref:n,className:Ue("fixed inset-0 z-50 bg-background/80 backdrop-blur-sm",e),...t}));a1.displayName=t1.displayName;const l1=g.forwardRef(({className:e,...t},n)=>i.jsxs(jM,{children:[i.jsx(a1,{}),i.jsx(n1,{ref:n,className:Ue("fixed left-1/2 top-1/2 z-50 grid w-[calc(100%-2rem)] max-w-lg -translate-x-1/2 -translate-y-1/2 gap-4 rounded-xl border border-border/70 bg-card p-6 shadow-2xl outline-none",e),...t})]}));l1.displayName=n1.displayName;function SM({className:e,...t}){return i.jsx("div",{className:Ue("flex flex-col space-y-2 text-left",e),...t})}function NM({className:e,...t}){return i.jsx("div",{className:Ue("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",e),...t})}const c1=g.forwardRef(({className:e,...t},n)=>i.jsx(s1,{ref:n,className:Ue("text-lg font-semibold tracking-tight text-foreground",e),...t}));c1.displayName=s1.displayName;const u1=g.forwardRef(({className:e,...t},n)=>i.jsx(i1,{ref:n,className:Ue("text-sm leading-6 text-muted-foreground",e),...t}));u1.displayName=i1.displayName;const d1=g.forwardRef(({className:e,...t},n)=>i.jsx(r1,{ref:n,className:Ue(e),...t}));d1.displayName=r1.displayName;const f1=g.forwardRef(({className:e,...t},n)=>i.jsx(o1,{ref:n,className:Ue(e),...t}));f1.displayName=o1.displayName;function p1({open:e,title:t,description:n,confirmLabel:o,cancelLabel:a="Cancel",loading:l=!1,destructive:c=!1,onConfirm:d,onOpenChange:p}){return i.jsx(kM,{open:e,onOpenChange:m=>l?void 0:p(m),children:i.jsxs(l1,{children:[i.jsxs(SM,{children:[i.jsx(c1,{children:t}),i.jsx(u1,{children:n})]}),i.jsxs(NM,{children:[i.jsx(f1,{disabled:l,className:"shell-action mt-0 disabled:cursor-not-allowed disabled:opacity-50",children:a}),i.jsx(d1,{disabled:l,className:`shell-action mt-0 disabled:cursor-not-allowed disabled:opacity-50 ${c?"border-destructive/80 bg-destructive text-destructive-foreground hover:bg-destructive/90":"bg-foreground text-background hover:opacity-90"}`,onClick:m=>{m.preventDefault(),d()},children:l?"Working...":o})]})]})})}function CM({items:e,align:t="end"}){const[n,o]=g.useState(!1),a=g.useRef(null);return g.useEffect(()=>{if(!n)return;function l(d){a.current&&!a.current.contains(d.target)&&o(!1)}function c(d){d.key==="Escape"&&o(!1)}return document.addEventListener("mousedown",l),document.addEventListener("keydown",c),()=>{document.removeEventListener("mousedown",l),document.removeEventListener("keydown",c)}},[n]),e.length===0?null:i.jsxs("div",{className:"relative",ref:a,children:[i.jsx("button",{type:"button",onClick:()=>o(l=>!l),className:"shell-action",title:"More actions","aria-haspopup":"true","aria-expanded":n,children:i.jsx(mC,{className:"h-4 w-4"})}),n&&i.jsx("div",{className:Ue("absolute top-full mt-1 z-30 min-w-[220px] rounded-md border border-border/70 bg-background shadow-lg py-1",t==="end"?"right-0":"left-0"),children:i.jsx(la,{delayDuration:200,children:e.map(l=>{const c=l.icon,d=Ue("flex w-full items-center gap-2 px-3 py-1.5 text-sm text-left transition",l.disabled?"opacity-50 cursor-not-allowed":l.destructive?"text-destructive hover:bg-destructive/10":"hover:bg-foreground/5"),p=i.jsxs(i.Fragment,{children:[c?i.jsx(c,{className:"h-4 w-4 shrink-0"}):null,i.jsx("span",{className:"truncate",children:l.label})]});if(l.disabled){const m=i.jsx("span",{tabIndex:0,className:"inline-block w-full outline-none focus-visible:ring-1 focus-visible:ring-ring",children:i.jsx("button",{type:"button",disabled:!0,className:d,children:p})});return l.disabledReason?i.jsxs(ca,{children:[i.jsx(ua,{asChild:!0,children:m}),i.jsx(Hs,{side:"left",children:l.disabledReason})]},l.key):i.jsx("div",{children:m},l.key)}return l.href?i.jsx(De,{to:l.href,className:d,onClick:()=>o(!1),children:p},l.key):i.jsx("button",{type:"button",className:d,onClick:()=>{var m;(m=l.onSelect)==null||m.call(l),o(!1)},children:p},l.key)})})})]})}async function h1(e,t,n,o){const a=await fetch(`/api/projects/${e}/assignments/${t}/transitions/${n.command}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(o?{reason:o}:{})}),l=await a.json().catch(()=>null);if(!a.ok)throw new Error((l==null?void 0:l.error)||`HTTP ${a.status}`);return l.assignment}async function m1(e,t,n){const o=await fetch(`/api/projects/${e}/assignments/${t}/status-override`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({status:n})}),a=await o.json().catch(()=>null);if(!o.ok)throw new Error((a==null?void 0:a.error)||`HTTP ${o.status}`);return a.assignment}async function EM(e,t){const n=await fetch(`/api/projects/${e}/assignments/${t}`,{method:"DELETE"}),o=await n.json().catch(()=>null);if(!n.ok)throw new Error((o==null?void 0:o.error)||`HTTP ${n.status}`)}function g1(e){return e.requiresReason||e.command==="block"}function PM(e){const t=e.split(`
483
+ `),n=t.findIndex(c=>/^##\s+Acceptance Criteria\s*$/i.test(c.trim()));if(n===-1)return{acceptanceCriteria:[],summaryBody:e};let o=t.length;for(let c=n+1;c<t.length;c+=1)if(/^#{1,2}\s+\S/.test(t[c].trim())){o=c;break}const a=t.slice(n+1,o).map(c=>c.match(/^\s*[-*]\s+\[( |x|X)\]\s+(.*)$/)).filter(c=>!!c).map(c=>({checked:c[1].toLowerCase()==="x",text:c[2].trim()})),l=[...t.slice(0,n),...t.slice(o)].join(`
484
+ `).replace(/\n{3,}/g,`
485
+
486
+ `).trim();return{acceptanceCriteria:a,summaryBody:l}}function TM(e){const t=e.split(`
487
+ `),n=t.findIndex(c=>/^##\s+Todos\s*$/i.test(c.trim()));if(n===-1)return{hasSection:!1,todosMarkdown:"",remaining:e};let o=t.length;for(let c=n+1;c<t.length;c+=1)if(/^#{1,2}\s+\S/.test(t[c].trim())){o=c;break}const a=t.slice(n+1,o).join(`
488
+ `).replace(/<!--[\s\S]*?-->/g,"").replace(/\n{3,}/g,`
489
+
490
+ `).trim(),l=[...t.slice(0,n),...t.slice(o)].join(`
491
+ `).replace(/\n{3,}/g,`
492
+
493
+ `).trim();return{hasSection:!0,todosMarkdown:a,remaining:l}}function RM({projectSlug:e,dependencies:t,blockedReason:n}){const[o,a]=g.useState(!1);if(t.length===0)return null;const l=t.filter(d=>d.status!=="completed"&&d.status!=="review"),c=l.length===0;return c&&!o?i.jsxs("button",{type:"button",onClick:()=>a(!0),className:"flex w-full items-center gap-2 rounded-lg border border-success-foreground/30 bg-success/70 px-4 py-2.5 text-left transition hover:bg-success",children:[i.jsx(Ip,{className:"h-4 w-4 shrink-0 text-success-foreground"}),i.jsxs("span",{className:"text-sm font-medium text-success-foreground",children:["All ",t.length," ",t.length===1?"dependency":"dependencies"," resolved"]}),i.jsx(ma,{className:"ml-auto h-4 w-4 text-success-foreground"})]}):i.jsxs("div",{className:"space-y-3",children:[l.length>0&&i.jsxs("div",{className:"flex items-start gap-3 rounded-lg border border-warning-foreground/30 bg-warning px-4 py-3",children:[i.jsx(Vf,{className:"mt-0.5 h-4 w-4 shrink-0 text-warning-foreground"}),i.jsxs("div",{className:"text-sm text-warning-foreground",children:[i.jsxs("strong",{children:[l.length," ",l.length===1?"dependency is":"dependencies are"," not yet completed."]}),n&&i.jsxs("p",{className:"mt-1 text-warning-foreground/80",children:["Blocked reason: ",n]})]})]}),i.jsx(Ie,{title:"Dependencies",description:`${t.length-l.length} of ${t.length} resolved`,actions:c?i.jsx("button",{type:"button",onClick:()=>a(!1),className:"text-xs text-muted-foreground hover:text-foreground",children:"Collapse"}):void 0,children:i.jsx("div",{className:"divide-y divide-border/40",children:t.map(d=>i.jsxs(De,{to:`/projects/${e}/assignments/${d.slug}`,className:"flex items-center gap-3 px-1 py-2.5 transition hover:bg-muted/40 first:pt-0 last:pb-0",children:[i.jsx(Xt,{status:d.status}),i.jsxs("div",{className:"min-w-0 flex-1",children:[i.jsx("p",{className:"truncate text-sm font-medium text-foreground",children:d.title}),i.jsx("p",{className:"truncate text-xs text-muted-foreground",children:d.slug})]}),d.assignee&&i.jsx("span",{className:"hidden text-xs text-muted-foreground sm:inline",children:d.assignee}),i.jsx(hc,{className:"h-4 w-4 shrink-0 text-muted-foreground"})]},d.slug))})})]})}function AM({links:e}){const t=Lt();if(e.length===0)return null;const n=e.filter(a=>!a.isReverse),o=e.filter(a=>a.isReverse);return i.jsx(Ie,{title:"Linked Assignments",description:`${e.length} ${e.length===1?"link":"links"}`,children:i.jsxs("div",{className:"divide-y divide-border/40",children:[n.map(a=>i.jsxs(De,{to:`${t}/projects/${a.projectSlug}/assignments/${a.assignmentSlug}`,className:"flex items-center gap-3 px-1 py-2.5 transition hover:bg-muted/40 first:pt-0 last:pb-0",children:[i.jsx(sC,{className:"h-3.5 w-3.5 shrink-0 text-muted-foreground"}),i.jsx(Xt,{status:a.status}),i.jsxs("div",{className:"min-w-0 flex-1",children:[i.jsx("p",{className:"truncate text-sm font-medium text-foreground",children:a.title}),i.jsx("p",{className:"truncate text-xs text-muted-foreground",children:a.slug})]}),i.jsx(hc,{className:"h-4 w-4 shrink-0 text-muted-foreground"})]},`fwd-${a.slug}`)),o.map(a=>i.jsxs(De,{to:`${t}/projects/${a.projectSlug}/assignments/${a.assignmentSlug}`,className:"flex items-center gap-3 px-1 py-2.5 transition hover:bg-muted/40 first:pt-0 last:pb-0",children:[i.jsx(lb,{className:"h-3.5 w-3.5 shrink-0 text-muted-foreground"}),i.jsx(Xt,{status:a.status}),i.jsxs("div",{className:"min-w-0 flex-1",children:[i.jsx("p",{className:"truncate text-sm font-medium text-foreground",children:a.title}),i.jsx("p",{className:"truncate text-xs text-muted-foreground",children:a.slug})]}),i.jsx(hc,{className:"h-4 w-4 shrink-0 text-muted-foreground"})]},`rev-${a.slug}`))]})})}function DM(e){const t=new Map;for(const o of e)t.set(o.id,{entry:o,replies:[]});const n=[];for(const o of e){const a=t.get(o.id);o.replyTo&&t.has(o.replyTo)?t.get(o.replyTo).replies.push(a):n.push(a)}return n}function IM(e,t){return e===null?`/api/assignments/${encodeURIComponent(t)}/comments`:`/api/projects/${encodeURIComponent(e)}/assignments/${encodeURIComponent(t)}/comments`}function x1({projectSlug:e,assignmentSlug:t,entries:n}){const[o,a]=g.useState(n);g.useEffect(()=>{a(n)},[n]);const l=g.useMemo(()=>DM(o),[o]),[c,d]=g.useState(""),[p,m]=g.useState("note"),[h,x]=g.useState(!1),[v,b]=g.useState(null);async function C(j){var N;if(j.preventDefault(),!c.trim())return;x(!0),b(null);const S=`tmp-${Date.now()}`,R={id:S,timestamp:new Date().toISOString(),author:"human",type:p,body:c,resolved:p==="question"?!1:void 0};a(A=>[...A,R]);try{const A=await fetch(IM(e,t),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({body:c,type:p})});if(!A.ok){const D=await A.text();throw new Error(D||`HTTP ${A.status}`)}const O=await A.json().catch(()=>null),T=(N=O==null?void 0:O.comment)==null?void 0:N.id;a(D=>D.map(L=>L.id===S?{...L,id:T??L.id}:L)),d(""),window.dispatchEvent(new CustomEvent("syntaur-refresh"))}catch(A){b(A instanceof Error?A.message:String(A)),a(O=>O.filter(T=>T.id!==S))}finally{x(!1)}}async function k(j,S){a(R=>R.map(N=>N.id===j?{...N,resolved:S}:N));try{const R=e===null?`/api/assignments/${encodeURIComponent(t)}/comments/${encodeURIComponent(j)}/resolved`:`/api/projects/${encodeURIComponent(e)}/assignments/${encodeURIComponent(t)}/comments/${encodeURIComponent(j)}/resolved`,N=await fetch(R,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({resolved:S})});if(!N.ok)throw new Error(`HTTP ${N.status}`);window.dispatchEvent(new CustomEvent("syntaur-refresh"))}catch(R){b(R instanceof Error?R.message:String(R)),a(N=>N.map(A=>A.id===j?{...A,resolved:!S}:A))}}return i.jsx(Ie,{title:"Comments",description:"Threaded questions, notes, and feedback. Questions can be resolved once answered.",children:i.jsxs("div",{className:"space-y-4",children:[l.map(j=>i.jsx(y1,{node:j,onToggleResolved:k,depth:0},j.entry.id)),i.jsxs("form",{onSubmit:C,className:"mt-6 space-y-2 border-t border-border pt-4",children:[i.jsx("label",{className:"block text-xs font-medium uppercase tracking-wide text-muted-foreground",children:"Add comment"}),i.jsx("textarea",{value:c,onChange:j=>d(j.target.value),className:"w-full rounded border border-border bg-background p-2 text-sm",rows:3,placeholder:"Ask a question, leave a note, or give feedback…"}),i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsxs("select",{value:p,onChange:j=>m(j.target.value),className:"rounded border border-border bg-background px-2 py-1 text-xs",children:[i.jsx("option",{value:"note",children:"note"}),i.jsx("option",{value:"question",children:"question"}),i.jsx("option",{value:"feedback",children:"feedback"})]}),i.jsx("button",{type:"submit",disabled:h||!c.trim(),className:"shell-action",children:h?"Posting…":"Post comment"}),v?i.jsx("span",{className:"text-xs text-error-foreground",children:v}):null]})]})]})})}function y1({node:e,depth:t,onToggleResolved:n}){const{entry:o,replies:a}=e,l=o.type==="question";return i.jsxs("div",{className:Ue("space-y-2",t>0&&"ml-4 border-l border-border pl-4"),children:[i.jsxs("div",{className:"flex flex-wrap items-center gap-2 text-xs text-muted-foreground",children:[i.jsx("span",{className:"font-mono",children:o.id}),i.jsx("span",{children:"·"}),i.jsx("span",{children:o.timestamp}),i.jsx("span",{children:"·"}),i.jsx("span",{className:"font-medium text-foreground",children:o.author}),i.jsx("span",{children:"·"}),i.jsx("span",{className:Ue("rounded px-1.5 py-0.5 font-mono text-[10px] uppercase",l&&"bg-warning text-warning-foreground",o.type==="feedback"&&"bg-info text-info-foreground",o.type==="note"&&"bg-muted text-muted-foreground"),children:o.type}),l?i.jsxs("button",{type:"button",onClick:()=>n(o.id,!o.resolved),className:Ue("inline-flex items-center gap-1 rounded px-1.5 py-0.5 text-[10px] font-medium",o.resolved?"bg-success text-success-foreground hover:bg-success/80":"bg-muted text-muted-foreground hover:bg-muted/80"),title:o.resolved?"Mark unresolved":"Mark resolved",children:[o.resolved?i.jsx(Ip,{className:"h-3 w-3"}):i.jsx(cC,{className:"h-3 w-3"}),o.resolved?"resolved":"open"]}):null,o.replyTo?i.jsxs("span",{className:"inline-flex items-center gap-1 text-muted-foreground",children:[i.jsx(TC,{className:"h-3 w-3"}),o.replyTo]}):null]}),i.jsx(Yt,{content:o.body}),a.length>0?i.jsx("div",{className:"space-y-2",children:a.map(c=>i.jsx(y1,{node:c,depth:t+1,onToggleResolved:n},c.entry.id))}):null]})}const OM=["review","complete","unblock","start","block","fail","reopen"];function Pv(){var Dt,Qt,Et,ie,ce,ye;const{slug:e,aslug:t}=At(),n=Ut(),o=Lt(),[a,l]=To(),[c,d]=g.useState(null),[p,m]=g.useState(null),[h,x]=g.useState(null),[v,b]=g.useState(null),[C,k]=g.useState(null),[j,S]=g.useState(!1),[R,N]=g.useState(!1),[A,O]=g.useState(0),T=a.get("tab")??"summary",D=Hc(),{data:L,loading:G,error:re,refetch:z}=RE(e,t),{data:K}=zb(e),{data:q}=Hp(),{data:J}=IE(e,t),_=g.useMemo(()=>{if(!L||!K)return[];const se=new Map(K.assignments.map(Ne=>[Ne.slug,Ne]));return L.dependsOn.map(Ne=>{const Re=se.get(Ne);return{slug:Ne,title:(Re==null?void 0:Re.title)??Ne,status:(Re==null?void 0:Re.status)??"pending",priority:(Re==null?void 0:Re.priority)??"medium",assignee:(Re==null?void 0:Re.assignee)??null}})},[L,K]),F=_.filter(se=>se.status!=="completed"&&se.status!=="review");rs("assignment");const B=g.useMemo(()=>((K==null?void 0:K.assignments)??[]).map(se=>se.slug),[K]),U=t?B.indexOf(t):-1,Z=U>0?B[U-1]:null,P=U>=0&&U<B.length-1?B[U+1]:null,M=`${o}/projects/${e}/assignments/${t}`;ht({keys:"e",scope:"assignment",description:"Edit assignment",handler:()=>n(`${M}/edit`)}),ht({keys:"p",scope:"assignment",description:"Edit plan",handler:()=>n(`${M}/plan/edit`)}),ht({keys:"h",scope:"assignment",description:"Append handoff",handler:()=>n(`${M}/handoff/edit`)}),ht({keys:"d",scope:"assignment",description:"Append decision record",handler:()=>n(`${M}/decision-record/edit`)}),ht({keys:"s",scope:"assignment",description:"Edit scratchpad",handler:()=>n(`${M}/scratchpad/edit`)}),ht({keys:"[",scope:"assignment",description:"Previous assignment in project",enabled:!!Z,handler:()=>Z&&n(`${o}/projects/${e}/assignments/${Z}`)}),ht({keys:"]",scope:"assignment",description:"Next assignment in project",enabled:!!P,handler:()=>P&&n(`${o}/projects/${e}/assignments/${P}`)});const Q=g.useMemo(()=>L?PM(L.body):{acceptanceCriteria:[],summaryBody:""},[L]),I=g.useMemo(()=>TM(Q.summaryBody),[Q.summaryBody]),ge=Q.acceptanceCriteria,Se=ge.filter(se=>se.checked).length,te=ge.length>0&&Se===ge.length,fe=g.useRef(te),ve=g.useRef(!1);if(g.useEffect(()=>{if(L){if(!ve.current){fe.current=te,ve.current=!0;return}te&&!fe.current&&O(se=>se+1),fe.current=te}},[te,L]),G)return i.jsx(kt,{label:"Loading assignment workspace…"});if(re||!L||!e||!t)return i.jsx(gt,{error:re||"Assignment not found."});const we=e,be=t,Ye=ge.length>0?{checked:Se,total:ge.length}:void 0,Xe=L.availableTransitions??[],ne=Xe.filter(se=>!se.disabled&&se.targetStatus!==L.status),Y=OM.map(se=>ne.find(Ne=>Ne.command===se)).find(Boolean)??ne[0]??null,ae=[];if(q!=null&&q.sessions)for(const se of q.sessions)for(const Ne of se.windows)for(const Re of Ne.panes)((Dt=Re.assignment)==null?void 0:Dt.project)===e&&((Qt=Re.assignment)==null?void 0:Qt.slug)===t&&ae.push({sessionName:se.name,command:Re.command,urls:Re.urls});async function xe(se){d(null);try{await m1(we,be,se),z()}catch(Ne){d(Ne.message)}}async function qe(){N(!0);try{await EM(we,be),n(`${o}/projects/${we}`)}catch(se){d(se.message),N(!1),S(!1)}}async function Oe(se,Ne){d(null),m(se.command);try{return await h1(we,be,se,Ne),z(),!0}catch(Re){return d(Re.message),!1}finally{m(null)}}function Be(se){if(g1(se)){x(se);return}Oe(se)}async function Ge(se,Ne){b(null),k(se);try{const Re=await fetch(`/api/projects/${we}/assignments/${be}/acceptance-criteria/${se}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({checked:Ne})}),Ht=await Re.json();if(!Re.ok)throw new Error(Ht.error||`HTTP ${Re.status}`);z()}catch(Re){b(Re.message)}finally{k(null)}}const jt=[...ne.filter(se=>se!==Y).map(se=>({key:`transition-${se.command}`,label:se.label,onSelect:()=>Be(se),disabled:p===se.command})),...Xe.filter(se=>se.disabled||se.targetStatus===L.status).map(se=>({key:`transition-${se.command}`,label:se.label,disabled:!0,disabledReason:se.targetStatus===L.status?`Already ${L.status.replace(/_/g," ")}`:se.disabledReason??se.warning??se.description})),...D.statuses.map(se=>({key:`override-${se.id}`,label:`Override → ${se.label}`,onSelect:()=>xe(se.id),disabled:se.id===L.status,disabledReason:se.id===L.status?"Already in this status":void 0})),{key:"edit-assignment",label:"Edit assignment source",icon:xC,href:`${o}/projects/${e}/assignments/${t}/edit`},{key:"edit-plan",label:"Edit plan",icon:AC,href:`${o}/projects/${e}/assignments/${t}/plan/edit`},{key:"edit-scratchpad",label:"Edit scratchpad",icon:ef,href:`${o}/projects/${e}/assignments/${t}/scratchpad/edit`},{key:"append-handoff",label:"Append handoff",icon:hc,href:`${o}/projects/${e}/assignments/${t}/handoff/edit`},{key:"append-decision",label:"Append decision",icon:bC,href:`${o}/projects/${e}/assignments/${t}/decision-record/edit`},{key:"delete",label:"Delete assignment",icon:Ro,destructive:!0,onSelect:()=>S(!0)}],St=(Y==null?void 0:Y.command)==="review";return i.jsxs("div",{className:"space-y-5",children:[i.jsxs("div",{className:"sticky top-12 z-20 rounded-lg border border-border/60 bg-card/90 p-3 shadow-sm backdrop-blur",children:[i.jsxs("div",{className:"flex flex-wrap items-center gap-3",children:[i.jsx(Xt,{status:L.status,progress:Ye}),i.jsx("h1",{className:"text-lg font-semibold text-foreground",children:L.title}),i.jsxs("span",{className:"text-xs text-muted-foreground",children:["Updated ",vE(L.updated)]}),F.length>0&&i.jsxs("span",{className:"text-xs text-warning-foreground",children:["⚠ ",F.length," unmet dep",F.length===1?"":"s"]}),i.jsxs("span",{className:"ml-auto flex items-center gap-2",children:[Y&&i.jsx("button",{type:"button",title:Y.warning||Y.description,disabled:p===Y.command,onClick:()=>Be(Y),className:Ue("shell-action disabled:cursor-not-allowed disabled:opacity-50",Y.warning&&"border-warning-foreground/40",St&&A>0&&"send-to-review-glow"),children:i.jsx("span",{children:p===Y.command?"Working…":Y.label})},St?`review-${A}`:Y.command),i.jsx(CM,{items:jt,align:"end"})]})]}),c?i.jsx("p",{className:"mt-4 rounded-md border border-error-foreground/30 bg-error px-4 py-3 text-sm text-error-foreground",children:c}):null,L.blockedReason?i.jsxs("div",{className:"mt-4 rounded-md border border-warning-foreground/30 bg-warning px-4 py-3 text-sm text-warning-foreground",children:[i.jsx("strong",{children:"Blocked reason:"})," ",L.blockedReason]}):null]}),_.length>0&&i.jsx(RM,{projectSlug:e,dependencies:_,blockedReason:L.blockedReason}),L.enrichedLinks&&L.enrichedLinks.length>0&&i.jsx(AM,{links:L.enrichedLinks}),L.referencedBy&&L.referencedBy.length>0&&i.jsx(Ie,{title:"Referenced by",description:"Other assignments whose Todos, progress, comments, or handoffs link to this one.",children:i.jsx("ul",{className:"space-y-2",children:L.referencedBy.map(se=>{const Ne=se.sourceProjectSlug===null?`/assignments/${se.sourceId}`:`${o}/projects/${se.sourceProjectSlug}/assignments/${se.sourceSlug}`;return i.jsxs("li",{className:"flex items-center gap-2 text-sm",children:[i.jsx(De,{to:Ne,className:"text-foreground hover:text-primary",children:se.sourceTitle}),i.jsxs("span",{className:"text-xs text-muted-foreground",children:["(",se.mentions," mention",se.mentions===1?"":"s",")"]}),se.sourceProjectSlug===null?i.jsx("span",{className:"rounded bg-muted px-1.5 py-0.5 font-mono text-[10px] uppercase text-muted-foreground",children:"Standalone"}):null]},se.sourceId)})})}),i.jsxs("div",{className:"grid gap-4 xl:grid-cols-[minmax(0,1fr)_280px]",children:[i.jsx("div",{className:"space-y-4",children:i.jsx(uh,{value:T,onValueChange:se=>l({tab:se}),items:[{value:"summary",label:"Summary",content:i.jsxs("div",{className:"space-y-5",children:[Q.acceptanceCriteria.length>0?i.jsx(Ie,{title:"Acceptance Criteria",description:"These checkboxes update the source assignment markdown.",children:i.jsxs("div",{className:"space-y-3",children:[v?i.jsx("p",{className:"rounded-md border border-error-foreground/30 bg-error px-4 py-3 text-sm text-error-foreground",children:v}):null,Q.acceptanceCriteria.map((se,Ne)=>{const Re=C!==null;return i.jsxs("label",{className:"flex items-start gap-3 rounded-md border border-border/60 bg-background/80 px-3 py-3",children:[i.jsx("input",{type:"checkbox",checked:se.checked,disabled:Re,onChange:Ht=>Ge(Ne,Ht.target.checked),className:"mt-1 h-4 w-4 rounded border-border text-primary"}),i.jsx("span",{className:"criterion-label text-sm leading-6","data-checked":se.checked,children:se.text})]},`${Ne}-${se.text}`)})]})}):null,I.hasSection?i.jsx(Ie,{title:"Todos",description:"Checklist of work items from assignment.md. Links point to plan files.",children:i.jsx(Yt,{content:I.todosMarkdown,emptyState:"No todos yet."})}):null,i.jsx(Ie,{title:"Assignment Summary",children:i.jsx(Yt,{content:I.remaining,emptyState:Q.acceptanceCriteria.length>0||I.hasSection?"No additional summary markdown beyond the acceptance criteria and todos.":"This assignment does not have summary markdown yet."})})]})},{value:"plan",label:"Plan",count:L.plan?1:0,content:L.plan?i.jsx("div",{className:"space-y-5",children:i.jsxs(Ie,{title:"Plan",description:"Shows plan.md only. Versioned plans (plan-v2.md, ...) linked from the Todos section are not yet rendered here — open them from the filesystem.",actions:i.jsxs(De,{className:"shell-action",to:`${o}/projects/${e}/assignments/${t}/plan/edit`,children:[i.jsx(ef,{className:"h-4 w-4"}),i.jsx("span",{children:"Edit Plan"})]}),children:[i.jsx("div",{className:"mb-4",children:i.jsx(Xt,{status:L.plan.status})}),i.jsx(Yt,{content:L.plan.body,emptyState:"No plan content yet."})]})}):i.jsx(rt,{title:"No plan yet",description:"Plan files are optional and versioned. Run /plan-assignment to create plan.md (or plan-v2.md, ...) and link it from the Todos section."})},{value:"scratchpad",label:"Scratchpad",count:L.scratchpad?1:0,content:L.scratchpad?i.jsx(Ie,{title:"Scratchpad",actions:i.jsxs(De,{className:"shell-action",to:`${o}/projects/${e}/assignments/${t}/scratchpad/edit`,children:[i.jsx(ef,{className:"h-4 w-4"}),i.jsx("span",{children:"Edit Scratchpad"})]}),children:i.jsx(Yt,{content:L.scratchpad.body,emptyState:"Scratchpad is empty."})}):i.jsx(rt,{title:"No scratchpad yet",description:"Scratchpad notes appear here when you use the Edit Scratchpad action."})},{value:"handoff",label:"Handoff",count:((Et=L.handoff)==null?void 0:Et.handoffCount)??0,content:i.jsx("div",{className:"space-y-5",children:L.handoff?i.jsx(Ie,{children:i.jsx(Yt,{content:L.handoff.body,emptyState:"No handoff history yet."})}):i.jsx(rt,{title:"No handoff log yet",description:"Handoffs appear here when an agent runs /complete-assignment or you append one manually."})})},{value:"progress",label:"Progress",count:((ie=L.progress)==null?void 0:ie.entryCount)??0,content:i.jsx("div",{className:"space-y-5",children:L.progress&&L.progress.entries.length>0?i.jsx(Ie,{title:"Progress",description:"Reverse-chronological log of work done on this assignment. Agents append entries via progress.md.",children:i.jsx("ol",{className:"space-y-4",children:L.progress.entries.map((se,Ne)=>i.jsxs("li",{className:"border-l-2 border-border pl-3",children:[i.jsx("div",{className:"text-xs font-mono text-muted-foreground",children:se.timestamp}),i.jsx(Yt,{content:se.body})]},`${se.timestamp}-${Ne}`))})}):i.jsx(rt,{title:"No progress entries yet",description:"Progress entries appear here as the agent appends them to progress.md."})})},{value:"comments",label:"Comments",count:((ce=L.comments)==null?void 0:ce.entryCount)??0,content:i.jsx("div",{className:"space-y-5",children:L.comments&&L.comments.entries.length>0?i.jsx(x1,{projectSlug:e,assignmentSlug:t,entries:L.comments.entries}):i.jsx(rt,{title:"No comments yet",description:"Comments appear here when agents or humans post via `syntaur comment` or the dashboard."})})},{value:"decisions",label:"Decisions",count:((ye=L.decisionRecord)==null?void 0:ye.decisionCount)??0,content:i.jsx("div",{className:"space-y-5",children:L.decisionRecord?i.jsx(Ie,{children:i.jsx(Yt,{content:L.decisionRecord.body,emptyState:"No decision history yet."})}):i.jsx(rt,{title:"No decision record yet",description:"Decision records appear here when you append one via the Append Decision action."})})}]})}),i.jsxs("div",{className:"space-y-5",children:[i.jsx(Ie,{title:"Details",children:i.jsxs("dl",{className:"space-y-3 text-sm",children:[i.jsx(wo,{label:"ID",value:L.id,copyable:!0}),i.jsx(wo,{label:"Priority",value:L.priority}),L.assignee&&i.jsx(wo,{label:"Assignee",value:L.assignee}),i.jsx(wo,{label:"Updated",value:`${yE(L.updated)} · Created ${xE(L.created)}`}),L.workspace.repository&&i.jsx(wo,{label:"Repository",value:L.workspace.repository,copyable:!0}),L.workspace.worktreePath&&i.jsx(wo,{label:"Worktree",value:L.workspace.worktreePath,copyable:!0}),L.workspace.branch&&i.jsx(wo,{label:"Branch",value:L.workspace.branch,copyable:!0}),L.workspace.parentBranch&&i.jsx(wo,{label:"Parent branch",value:L.workspace.parentBranch,copyable:!0})]})}),ae.length>0&&i.jsx(Ie,{title:"Servers",children:i.jsx("div",{className:"space-y-2",children:ae.map((se,Ne)=>i.jsxs("div",{className:"flex items-center gap-2 text-sm",children:[i.jsx("span",{className:"rounded bg-muted/60 px-1.5 py-0.5 font-mono text-xs",children:se.command}),i.jsx("span",{className:"text-xs text-muted-foreground",children:se.sessionName}),se.urls.map(Re=>i.jsxs("a",{href:Re,target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-1 text-xs text-primary hover:underline",children:[Re.replace("http://localhost:",":"),i.jsx(fb,{className:"h-2.5 w-2.5"})]},Re))]},Ne))})}),J&&J.sessions.length>0&&i.jsx(Ie,{title:"Agent Sessions",children:i.jsx("div",{className:"space-y-2",children:J.sessions.map(se=>i.jsxs("div",{className:"flex flex-wrap items-center gap-x-2 gap-y-1 text-sm",children:[i.jsxs("span",{className:"flex items-center gap-1.5",children:[i.jsx(Ic,{className:"h-3 w-3 shrink-0 text-muted-foreground"}),i.jsx("span",{className:"font-medium text-foreground",children:se.agent}),i.jsxs("span",{className:"inline-flex items-center gap-1.5 font-mono text-xs text-muted-foreground",title:se.sessionId,children:[se.sessionId.slice(0,8),i.jsx(qr,{value:se.sessionId})]})]}),i.jsxs("span",{className:"flex items-center gap-2",children:[i.jsx(Xt,{status:se.status}),i.jsx("span",{className:"text-xs text-muted-foreground",children:Er(se.started)})]})]},se.sessionId))})})]})]}),i.jsx(Uk,{open:h!==null,action:h,assignmentTitle:L.title,loading:p===(h==null?void 0:h.command),onOpenChange:se=>{se||x(null)},onConfirm:async se=>{if(!h)return;await Oe(h,se)&&x(null)}}),i.jsx(p1,{open:j,title:"Delete assignment?",description:`This will permanently delete "${L.title}" and all its files (plan, scratchpad, handoff, decision record). This cannot be undone.`,confirmLabel:"Delete Assignment",destructive:!0,loading:R,onOpenChange:se=>{se||S(!1)},onConfirm:qe})]})}function wo({label:e,value:t,copyable:n}){return i.jsxs("div",{className:"flex items-start justify-between gap-3",children:[i.jsx("dt",{className:"text-muted-foreground",children:e}),i.jsxs("dd",{className:"flex items-center gap-1.5 max-w-[60%] text-right text-foreground break-all",children:[i.jsx("span",{className:"truncate",title:t,children:t}),n&&t!=="—"&&i.jsx(qr,{value:t})]})]})}function LM(){var d,p,m,h,x;const{id:e}=At(),[t,n]=To(),o=t.get("tab")??"summary",{data:a,loading:l,error:c}=AE(e);return l?i.jsx(kt,{}):c?i.jsx(gt,{error:c}):a?i.jsxs("div",{className:"space-y-6",children:[i.jsxs("header",{className:"space-y-2",children:[i.jsxs("div",{className:"flex flex-wrap items-center gap-3",children:[i.jsx(Xt,{status:a.status}),i.jsx("span",{className:"text-xs font-mono text-muted-foreground",children:a.id}),i.jsx(De,{to:`/assignments/${a.id}/edit`,className:"ml-auto rounded border border-border px-2 py-1 text-xs text-muted-foreground hover:border-foreground/40 hover:text-foreground",children:"Edit"})]}),i.jsx("h1",{className:"text-2xl font-semibold text-foreground",children:a.title}),a.blockedReason?i.jsxs("p",{className:"text-sm text-warning-foreground",children:["Blocked: ",a.blockedReason]}):null]}),a.referencedBy&&a.referencedBy.length>0?i.jsx(Ie,{title:"Referenced by",description:"Other assignments whose bodies link to this one.",children:i.jsx("ul",{className:"space-y-2",children:a.referencedBy.map(v=>i.jsxs("li",{className:"flex items-center gap-2 text-sm",children:[i.jsx(De,{to:v.sourceProjectSlug===null?`/assignments/${v.sourceId}`:`/projects/${v.sourceProjectSlug}/assignments/${v.sourceSlug}`,className:"text-foreground hover:text-primary",children:v.sourceTitle}),i.jsxs("span",{className:"text-xs text-muted-foreground",children:["(",v.mentions," mention",v.mentions===1?"":"s",")"]})]},v.sourceId))})}):null,i.jsx(uh,{value:o,onValueChange:v=>n({tab:v}),items:[{value:"summary",label:"Summary",content:i.jsx("div",{className:"space-y-5",children:i.jsx(Ie,{title:"Assignment",children:i.jsx(Yt,{content:a.body,emptyState:"This assignment does not have summary markdown yet."})})})},{value:"progress",label:"Progress",count:((d=a.progress)==null?void 0:d.entryCount)??0,content:i.jsx("div",{className:"space-y-5",children:a.progress&&a.progress.entries.length>0?i.jsx(Ie,{title:"Progress",description:"Reverse-chronological log of work done on this assignment.",children:i.jsx("ol",{className:"space-y-4",children:a.progress.entries.map((v,b)=>i.jsxs("li",{className:"border-l-2 border-border pl-3",children:[i.jsx("div",{className:"text-xs font-mono text-muted-foreground",children:v.timestamp}),i.jsx(Yt,{content:v.body})]},`${v.timestamp}-${b}`))})}):i.jsx(rt,{title:"No progress entries yet",description:"Progress entries appear here as the agent appends them to progress.md."})})},{value:"comments",label:"Comments",count:((p=a.comments)==null?void 0:p.entryCount)??0,content:i.jsx("div",{className:"space-y-5",children:i.jsx(x1,{projectSlug:null,assignmentSlug:a.id,entries:((m=a.comments)==null?void 0:m.entries)??[]})})},{value:"plan",label:"Plan",content:i.jsx("div",{className:"space-y-5",children:a.plan?i.jsxs(Ie,{children:[i.jsx(Yt,{content:a.plan.body,emptyState:"Plan file exists but is empty."}),i.jsx("div",{className:"mt-3 flex justify-end",children:i.jsx(De,{to:`/assignments/${a.id}/plan/edit`,className:"rounded border border-border px-2 py-1 text-xs text-muted-foreground hover:border-foreground/40 hover:text-foreground",children:"Edit plan"})})]}):i.jsx(rt,{title:"No plan file yet",description:"Create one via the CLI or `/plan-assignment`."})})},{value:"scratchpad",label:"Scratchpad",content:i.jsx("div",{className:"space-y-5",children:a.scratchpad?i.jsxs(Ie,{children:[i.jsx(Yt,{content:a.scratchpad.body,emptyState:"Scratchpad is empty."}),i.jsx("div",{className:"mt-3 flex justify-end",children:i.jsx(De,{to:`/assignments/${a.id}/scratchpad/edit`,className:"rounded border border-border px-2 py-1 text-xs text-muted-foreground hover:border-foreground/40 hover:text-foreground",children:"Edit scratchpad"})})]}):i.jsx(rt,{title:"No scratchpad yet",description:"Scratchpad is scaffolded at assignment creation time."})})},{value:"handoff",label:"Handoff",count:((h=a.handoff)==null?void 0:h.handoffCount)??0,content:i.jsx("div",{className:"space-y-5",children:a.handoff?i.jsxs(Ie,{children:[i.jsx(Yt,{content:a.handoff.body,emptyState:"No handoff history yet."}),i.jsx("div",{className:"mt-3 flex justify-end",children:i.jsx(De,{to:`/assignments/${a.id}/handoff/edit`,className:"rounded border border-border px-2 py-1 text-xs text-muted-foreground hover:border-foreground/40 hover:text-foreground",children:"Append handoff"})})]}):i.jsx(rt,{title:"No handoff log yet",description:"Handoffs appear here when an agent appends one."})})},{value:"decisions",label:"Decisions",count:((x=a.decisionRecord)==null?void 0:x.decisionCount)??0,content:i.jsx("div",{className:"space-y-5",children:a.decisionRecord?i.jsxs(Ie,{children:[i.jsx(Yt,{content:a.decisionRecord.body,emptyState:"No decision history yet."}),i.jsx("div",{className:"mt-3 flex justify-end",children:i.jsx(De,{to:`/assignments/${a.id}/decision-record/edit`,className:"rounded border border-border px-2 py-1 text-xs text-muted-foreground hover:border-foreground/40 hover:text-foreground",children:"Append decision"})})]}):i.jsx(rt,{title:"No decision record yet",description:"Decision records appear here once appended."})})}]})]}):i.jsx(gt,{error:"Assignment not found"})}const MM=["table","list","kanban"],Tv={critical:0,high:1,medium:2,low:3};function Rv(e){return e==="1"?"stale":e==="0"?"fresh":"all"}function _M(e,t){return e.toString()===t.toString()}function Av(e){const t=Date.parse(e);return Number.isNaN(t)?!1:Date.now()-t>10080*60*1e3}function $M(e,t,n){return[...e].sort((a,l)=>{let c=0;switch(t){case"title":c=a.title.localeCompare(l.title);break;case"status":c=a.status.localeCompare(l.status);break;case"priority":c=(Tv[a.priority]??99)-(Tv[l.priority]??99);break;case"assignee":c=(a.assignee??"").localeCompare(l.assignee??"");break;case"dependencies":c=a.dependsOn.length-l.dependsOn.length;break;case"updated":c=a.updated.localeCompare(l.updated);break}return n==="asc"?c:-c})}function Dv(){const{workspace:e}=At(),t=Lt(),n=Ut(),o=g.useRef(null);rs("list:assignments");const{data:a,loading:l,error:c,refetch:d}=$b(),p=Hc(),[m,h]=To(),x=g.useMemo(()=>ST(p.order),[p]),v=g.useMemo(()=>{const V={};for(const pe of x)V[pe]=bT(p,pe);return V},[x,p]),b=g.useMemo(()=>x.map(V=>({id:V,title:v[V]??V,description:Dw(V)})),[x,v]),C=g.useMemo(()=>new Set(["all",...x]),[x]),k=m.get("view"),j=m.get("status"),S=m.get("stale"),R=k&&MM.includes(k)?k:"kanban";function N(V){return!V||!C.has(V)?"all":V}const A=g.useCallback(V=>{h(pe=>{const Ce=new URLSearchParams(pe);return V==="kanban"?Ce.delete("view"):Ce.set("view",V),Ce})},[h]),[O,T]=g.useState(""),[D,L]=g.useState(()=>N(j)),[G,re]=g.useState("all"),[z,K]=g.useState("all"),[q,J]=g.useState("all"),[_,F]=g.useState(()=>Rv(S)),[B,U]=g.useState("updated"),[Z,P]=g.useState("desc"),[M,Q]=g.useState(()=>new Set(x)),[I,ge]=g.useState([]),[Se,te]=g.useState(null),[fe,ve]=g.useState(null),[we,be]=g.useState(null),[Ye,Xe]=g.useState(null),[ne,Y]=g.useState(null);g.useEffect(()=>{ge((a==null?void 0:a.assignments)??[])},[a]),g.useEffect(()=>{const V=N(j);V!==D&&L(V);const pe=Rv(S);pe!==_&&F(pe)},[_,S,D,j]),g.useEffect(()=>{h(V=>{const pe=new URLSearchParams(V);return D==="all"?pe.delete("status"):pe.set("status",D),_==="all"?pe.delete("stale"):_==="stale"?pe.set("stale","1"):pe.set("stale","0"),_M(V,pe)?V:pe})},[_,h,D]);const ae=g.useMemo(()=>Array.from(new Set(I.map(V=>V.status))).sort(),[I]),xe=g.useMemo(()=>Array.from(new Set(I.map(V=>V.priority))).sort(),[I]),qe=g.useMemo(()=>Array.from(new Set(I.map(V=>V.assignee??"__unassigned__"))).sort(),[I]),Oe=g.useMemo(()=>Array.from(new Map(I.filter(V=>V.projectSlug!==null).map(V=>[V.projectSlug,V.projectTitle]))).sort(([,V],[,pe])=>V.localeCompare(pe)),[I]),Be=g.useMemo(()=>I.filter(V=>{if(e){if(e==="_ungrouped"){if(V.projectWorkspace!==null)return!1}else if(V.projectWorkspace!==e)return!1}if(D!=="all"&&V.status!==D||G!=="all"&&V.priority!==G||_==="stale"&&!Av(V.updated)||_==="fresh"&&Av(V.updated)||z!=="all"&&(V.assignee??"__unassigned__")!==z)return!1;if(q!=="all"){if(q==="__standalone__"){if(V.projectSlug!==null)return!1}else if(V.projectSlug!==q)return!1}const pe=O.trim().toLowerCase();return!(pe&&!`${V.title} ${V.slug} ${V.projectTitle??"standalone"} ${V.projectSlug??""}`.toLowerCase().includes(pe))}),[_,I,O,D,G,z,q,e]),Ge=g.useMemo(()=>$M(Be,B,Z),[Be,B,Z]),{visibleItems:jt,visibleIndexByKey:St}=g.useMemo(()=>{const V=R==="table"?Ge:x.flatMap(Ce=>Be.filter(ze=>ze.status===Ce)),pe=new Map;return V.forEach((Ce,ze)=>pe.set(nn(Ce),ze)),{visibleItems:V,visibleIndexByKey:pe}},[R,Ge,Be,x]),{hotkeyRowProps:Dt}=Ca(jt,{scope:"list:assignments",onOpen:V=>{if(V.projectSlug===null){n(`/assignments/${V.id}`);return}const pe=V.projectWorkspace?`/w/${V.projectWorkspace}`:t;n(`${pe}/projects/${V.projectSlug}/assignments/${V.slug}`)}});if(ht({keys:"/",scope:"list:assignments",description:"Focus filter",handler:()=>{var V;return(V=o.current)==null?void 0:V.focus()}}),ht({keys:"r",scope:"list:assignments",description:"Refresh",handler:()=>d()}),l)return i.jsx(kt,{label:"Loading assignments board…"});if(c||!a)return i.jsx(gt,{error:c||"Assignments board is unavailable."});async function Qt({item:V,toColumnId:pe,action:Ce,reason:ze}){te(null),ve(nn(V));const Hn=I;ge(on=>on.map(xt=>nn(xt)===nn(V)?{...xt,status:pe,blockedReason:pe==="blocked"?ze??xt.blockedReason:null}:xt));try{if(V.projectSlug===null){if(!Ce)throw new Error("Standalone assignments require a transition action, not status override.");const xt=await fetch(`/api/assignments/${encodeURIComponent(V.id)}/transitions/${encodeURIComponent(Ce.command)}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(ze?{reason:ze}:{})});if(!xt.ok)throw new Error((await xt.json()).error??`HTTP ${xt.status}`);const ot=(await xt.json()).assignment;ge(Pt=>Pt.map(Wt=>nn(Wt)===nn(V)?{...Wt,status:ot.status,blockedReason:ot.blockedReason,availableTransitions:ot.availableTransitions,updated:ot.updated}:Wt));return}const on=Ce?await h1(V.projectSlug,V.slug,Ce,ze):await m1(V.projectSlug,V.slug,pe);return ge(xt=>xt.map(Ve=>nn(Ve)===nn(V)?{...Ve,status:on.status,blockedReason:on.blockedReason,availableTransitions:on.availableTransitions,updated:on.updated}:Ve)),d(),!0}catch(on){return ge(Hn),te(on.message),!1}finally{ve(null)}}async function Et({item:V,toColumnId:pe}){if(V.status===pe)return;const Ce=Qi(V,pe);if(Ce!=null&&Ce.disabled){te(Ce.disabledReason||`Cannot move this assignment to ${pe}.`);return}if(Ce&&g1(Ce)){Y({item:V,toColumnId:pe,action:Ce});return}await Qt({item:V,toColumnId:pe,action:Ce})}function ie(V){Q(pe=>{const Ce=new Set(pe);return Ce.has(V)?Ce.delete(V):Ce.add(V),Ce})}function ce(V){B===V?P(pe=>pe==="asc"?"desc":"asc"):(U(V),P("asc"))}const ye=we?I.find(V=>nn(V)===we)??null:null;function se(V,pe){V.dataTransfer.effectAllowed="move",V.dataTransfer.setData("text/plain",pe),be(pe)}function Ne(){be(null),Xe(null)}function Re(V,pe){if(!ye)return;const Ce=Qi(ye,pe);ye.status===pe||Ce!=null&&Ce.disabled||(V.preventDefault(),V.dataTransfer.dropEffect="move",Xe(pe))}function Ht(V,pe){Ye===pe&&!V.currentTarget.contains(V.relatedTarget)&&Xe(null)}function rn(V,pe){if(V.preventDefault(),!ye||ye.status===pe){Ne();return}Ne(),Et({item:ye,toColumnId:pe})}function Jt({field:V,children:pe}){const Ce=B===V;return i.jsx("th",{className:"pb-3 font-medium",children:i.jsxs("button",{type:"button",onClick:()=>ce(V),className:"inline-flex items-center gap-1 hover:text-foreground",children:[pe,Ce?Z==="asc"?i.jsx(db,{className:"h-3 w-3"}):i.jsx(ma,{className:"h-3 w-3"}):null]})})}return i.jsxs("div",{className:"space-y-5",children:[i.jsx("div",{className:"flex items-center justify-end",children:i.jsxs(De,{to:`${t}/assignments/new`,className:"inline-flex h-9 items-center gap-2 rounded-md bg-foreground px-3 text-sm font-medium text-background transition hover:bg-foreground/90",children:[i.jsx(Un,{className:"h-4 w-4"}),"New Assignment"]})}),i.jsxs(ih,{children:[i.jsx(Uc,{ref:o,value:O,onChange:T,placeholder:"Search assignments or projects"}),i.jsxs("select",{value:D,onChange:V=>L(N(V.target.value)),className:"editor-input max-w-[180px]",children:[i.jsx("option",{value:"all",children:"All statuses"}),ae.map(V=>i.jsx("option",{value:V,children:v[V]??V},V))]}),i.jsxs("select",{value:G,onChange:V=>re(V.target.value),className:"editor-input max-w-[180px]",children:[i.jsx("option",{value:"all",children:"All priorities"}),xe.map(V=>i.jsx("option",{value:V,className:"capitalize",children:V},V))]}),i.jsxs("select",{value:z,onChange:V=>K(V.target.value),className:"editor-input max-w-[180px]",children:[i.jsx("option",{value:"all",children:"All assignees"}),qe.map(V=>i.jsx("option",{value:V,children:V==="__unassigned__"?"Unassigned":V},V))]}),i.jsxs("select",{value:q,onChange:V=>J(V.target.value),className:"editor-input max-w-[180px]",children:[i.jsx("option",{value:"all",children:"All projects"}),i.jsx("option",{value:"__standalone__",children:"Standalone"}),Oe.map(([V,pe])=>i.jsx("option",{value:V,children:pe},V))]}),i.jsxs("select",{value:_,onChange:V=>F(V.target.value),className:"editor-input max-w-[180px]",children:[i.jsx("option",{value:"all",children:"All activity"}),i.jsx("option",{value:"stale",children:"Stale only"}),i.jsx("option",{value:"fresh",children:"Fresh only"})]}),i.jsx(ah,{value:R,onChange:V=>A(V),options:[{value:"table",label:"Table"},{value:"list",label:"List"},{value:"kanban",label:"Kanban"}]})]}),Se?i.jsx("div",{className:"rounded-md border border-error-foreground/30 bg-error px-4 py-3 text-sm text-error-foreground",children:Se}):null,a.assignments.length===0?i.jsx(rt,{title:"No assignments yet",description:"Assignments appear here once projects contain concrete work items.",actions:i.jsxs(De,{className:"shell-action bg-foreground text-background hover:opacity-90",to:`${t}/projects`,children:[i.jsx(Op,{className:"h-4 w-4"}),i.jsx("span",{children:"Browse Projects"})]})}):Be.length===0?i.jsx(rt,{title:"No assignments match these filters",description:"Adjust the search term or filters to show assignments across all projects again."}):R==="table"?i.jsx(Ie,{title:`${Ge.length} assignment${Ge.length===1?"":"s"}`,children:i.jsx("div",{className:"overflow-x-auto",children:i.jsxs("table",{className:"w-full min-w-[760px] text-left text-sm",children:[i.jsx("thead",{children:i.jsxs("tr",{className:"border-b border-border/60 text-muted-foreground",children:[i.jsx(Jt,{field:"title",children:"Assignment"}),i.jsx(Jt,{field:"status",children:"Status"}),i.jsx(Jt,{field:"priority",children:"Priority"}),i.jsx(Jt,{field:"assignee",children:"Assignee"}),i.jsx(Jt,{field:"dependencies",children:"Dependencies"}),i.jsx(Jt,{field:"updated",children:"Updated"})]})}),i.jsx("tbody",{children:Ge.map((V,pe)=>i.jsxs("tr",{className:"border-b border-border/50 last:border-0",...Dt(pe),children:[i.jsxs("td",{className:"py-4 pr-4",children:[i.jsx(De,{to:V.projectSlug===null?`/assignments/${V.id}`:`${t}/projects/${V.projectSlug}/assignments/${V.slug}`,className:"font-semibold text-foreground hover:text-primary",children:V.title}),i.jsx("p",{className:"mt-1 text-xs text-muted-foreground",children:V.projectTitle??i.jsx("span",{className:"rounded bg-muted px-1.5 py-0.5 font-mono text-[10px] uppercase text-muted-foreground",children:"Standalone"})}),i.jsxs("p",{className:"mt-0.5 inline-flex items-center gap-1.5 font-mono text-xs text-muted-foreground/70",title:V.id,children:[V.id.slice(0,8),i.jsx(qr,{value:V.id})]})]}),i.jsx("td",{className:"py-4 pr-4",children:i.jsx("select",{value:V.status,disabled:fe===nn(V),onChange:Ce=>Et({item:V,toColumnId:Ce.target.value}),className:Ue("appearance-none rounded-full border px-2.5 py-0.5 text-xs font-semibold tracking-wide outline-none","cursor-pointer bg-[length:12px] bg-[right_6px_center] bg-no-repeat pr-6",`bg-[url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='currentColor'%3E%3Cpath fill-rule='evenodd' d='M5.23 7.21a.75.75 0 011.06.02L10 11.168l3.71-3.938a.75.75 0 111.08 1.04l-4.25 4.5a.75.75 0 01-1.08 0l-4.25-4.5a.75.75 0 01.02-1.06z'/%3E%3C/svg%3E")]`,(xc[V.status]??xc.pending).className,fe===nn(V)&&"animate-pulse opacity-60"),children:x.map(Ce=>{const ze=V.status===Ce?void 0:Qi(V,Ce),Hn=(ze==null?void 0:ze.disabled)??!1;return i.jsx("option",{value:Ce,disabled:Hn,title:Hn?(ze==null?void 0:ze.disabledReason)??void 0:void 0,children:v[Ce]},Ce)})})}),i.jsx("td",{className:"py-4 pr-4 capitalize text-muted-foreground",children:V.priority}),i.jsx("td",{className:"py-4 pr-4 text-muted-foreground",children:V.assignee??"Unassigned"}),i.jsx("td",{className:"py-4 pr-4 text-muted-foreground",children:V.dependsOn.length}),i.jsx("td",{className:"py-4 text-muted-foreground",children:No(V.updated)})]},nn(V)))})]})})}):R==="list"?i.jsx("div",{className:"space-y-3",children:x.map(V=>{var xt;const pe=Be.filter(Ve=>Ve.status===V);if(pe.length===0&&!ye)return null;const Ce=M.has(V),ze=ye?ye.status!==V&&!((xt=Qi(ye,V))!=null&&xt.disabled):!1,Hn=ye?ye.status!==V&&!ze:!1,on=Ye===V;return i.jsxs("div",{className:Ue("rounded-lg border border-border/60 bg-card/90 transition",on&&ze&&"ring-2 ring-ring/30",Hn&&"border-dashed opacity-65"),onDragOver:Ve=>Re(Ve,V),onDragLeave:Ve=>Ht(Ve,V),onDrop:Ve=>rn(Ve,V),children:[i.jsxs("button",{type:"button",onClick:()=>ie(V),className:"flex w-full items-center gap-2 px-4 py-3 text-left",children:[i.jsx(ma,{className:`h-4 w-4 text-muted-foreground transition-transform ${Ce?"":"-rotate-90"}`}),i.jsx("span",{className:"font-semibold text-foreground",children:v[V]}),i.jsx("span",{className:"rounded-full border border-border/60 px-2 py-0.5 text-xs text-muted-foreground",children:pe.length})]}),Ce&&pe.length>0&&i.jsx("div",{className:"space-y-3 px-4 pb-4",children:pe.map(Ve=>{const ot=nn(Ve),Pt=we===ot,Wt=St.get(ot)??-1;return i.jsx("div",{draggable:!0,onDragStart:Zt=>se(Zt,ot),onDragEnd:Ne,...Wt>=0?Dt(Wt):{},className:Ue("cursor-grab transition active:cursor-grabbing",Pt&&"scale-[0.98] opacity-50"),children:i.jsx(Iv,{assignment:Ve,dragging:Pt,transitioning:fe===ot})},ot)})})]},V)})}):i.jsx(Iw,{columns:b,items:Be,getItemId:nn,getColumnId:V=>V.status,canDrop:({item:V,fromColumnId:pe,toColumnId:Ce})=>{if(pe===Ce)return{allowed:!0};const ze=Qi(V,Ce);return ze!=null&&ze.disabled?{allowed:!1,reason:ze.disabledReason||ze.description}:{allowed:!0,reason:ze?ze.warning||ze.description:`Move to ${Ce} (direct status change).`}},onMove:({item:V,toColumnId:pe})=>Et({item:V,toColumnId:pe}),emptyMessage:V=>`No ${V.title.toLowerCase()} assignments.`,renderCard:(V,{dragging:pe})=>{const Ce=St.get(nn(V))??-1;return i.jsx("div",{...Ce>=0?Dt(Ce):{},children:i.jsx(Iv,{assignment:V,dragging:pe,transitioning:fe===nn(V)})})}}),i.jsx(Uk,{open:ne!==null,action:(ne==null?void 0:ne.action)??null,assignmentTitle:(ne==null?void 0:ne.item.title)??"Assignment",loading:fe===(ne?nn(ne.item):null),onOpenChange:V=>{V||Y(null)},onConfirm:async V=>{if(!ne)return;const pe=ne;await Qt({item:pe.item,toColumnId:pe.toColumnId,action:pe.action,reason:V})&&Y(null)}})]})}function Iv({assignment:e,dragging:t,transitioning:n}){var a;const o=Lt();return i.jsxs("div",{className:"rounded-lg border border-border/60 bg-background/85 p-3 shadow-sm",children:[i.jsxs("div",{className:"flex items-start justify-between gap-3",children:[i.jsxs("div",{className:"space-y-1",children:[i.jsx(De,{to:e.projectSlug===null?`/assignments/${e.id}`:`${o}/projects/${e.projectSlug}/assignments/${e.slug}`,className:"text-base font-semibold text-foreground hover:text-primary",children:e.title}),i.jsx("p",{className:"text-sm text-muted-foreground",children:e.projectTitle??i.jsx("span",{className:"rounded bg-muted px-1.5 py-0.5 font-mono text-[10px] uppercase text-muted-foreground",children:"Standalone"})}),i.jsxs("p",{className:"inline-flex items-center gap-1.5 font-mono text-xs text-muted-foreground/70",title:e.id??"",children:[(a=e.id)==null?void 0:a.slice(0,8),e.id&&i.jsx(qr,{value:e.id})]})]}),i.jsx(Xt,{status:e.status})]}),e.blockedReason?i.jsx("p",{className:"mt-3 rounded-md border border-warning-foreground/30 bg-warning px-3 py-2 text-sm text-warning-foreground",children:e.blockedReason}):null,i.jsxs("div",{className:"mt-4 flex flex-wrap gap-2",children:[i.jsx("span",{className:"rounded-full border border-border/60 px-2.5 py-1 text-xs capitalize text-muted-foreground",children:e.priority}),i.jsx("span",{className:"rounded-full border border-border/60 px-2.5 py-1 text-xs text-muted-foreground",children:e.assignee??"Unassigned"}),i.jsxs("span",{className:"rounded-full border border-border/60 px-2.5 py-1 text-xs text-muted-foreground",children:[e.dependsOn.length," dependencies"]})]}),i.jsxs("div",{className:"mt-4 flex items-center justify-between gap-3 text-xs uppercase tracking-[0.08em] text-muted-foreground",children:[i.jsx("span",{children:n?"Updating":t?"Dragging":"Source-first"}),i.jsx("span",{children:No(e.updated)})]})]})}function Qi(e,t){return e.availableTransitions.find(n=>n.targetStatus===t)}function nn(e){return e.id||e.slug||"unknown"}function Or(e){const t=e.match(/^---\n([\s\S]*?)\n---\n?/);if(!t)return{order:[],blocks:new Map,body:e};const n=t[1],o=e.slice(t[0].length),a=n.split(`
494
+ `),l=[],c=new Map;let d=null,p=[];const m=()=>{d&&(l.push(d),c.set(d,p))};for(const h of a){const x=h.match(/^([A-Za-z_][A-Za-z0-9_-]*):/);if(x&&!h.startsWith(" ")){m(),d=x[1],p=[h];continue}d&&p.push(h)}return m(),{order:l,blocks:c,body:o}}function La(e){return`---
495
+ ${e.order.map(n=>e.blocks.get(n)).filter(n=>!!n).flat().join(`
496
+ `)}
497
+ ---
498
+
499
+ ${e.body.replace(/^\n+/,"")}`}function zt(e,t){const n=e.blocks.get(t);if(!(n!=null&&n[0]))return"";const o=n[0].match(/^[^:]+:\s*(.*)$/);if(!o)return"";const a=o[1].trim();return a==="null"?"":a.startsWith('"')&&a.endsWith('"')||a.startsWith("'")&&a.endsWith("'")?a.slice(1,-1):a}function FM(e,t){return zt(e,t)==="true"}function da(e,t){const n=e.blocks.get(t);return n!=null&&n.length?n[0].trim().endsWith("[]")?[]:n.slice(1).map(o=>o.trim()).filter(o=>o.startsWith("- ")).map(o=>o.slice(2).trim()):[]}function zM(e){return typeof e=="boolean"?e?"true":"false":e===null||e===""?"null":/^\d{4}-\d{2}-\d{2}T/.test(e)?`"${e}"`:/[:#{}[\],&*?|>!%@`]/.test(e)||/^\s|\s$/.test(e)?`"${e.replace(/\\/g,"\\\\").replace(/"/g,'\\"')}"`:e}function Bt(e,t,n){e.blocks.has(t)||e.order.push(t),e.blocks.set(t,[`${t}: ${zM(n)}`])}function fa(e,t,n){if(e.blocks.has(t)||e.order.push(t),n.length===0){e.blocks.set(t,[`${t}: []`]);return}e.blocks.set(t,[`${t}:`,...n.map(o=>` - ${o}`)])}function pa(e){return e.split(",").map(t=>t.trim()).filter(Boolean)}function iu(e){const t=Or(e);return{title:zt(t,"title"),slug:zt(t,"slug"),workspace:zt(t,"workspace"),archived:FM(t,"archived"),archivedAt:zt(t,"archivedAt"),archivedReason:zt(t,"archivedReason"),tags:da(t,"tags").join(", "),body:t.body}}function BM(e,t){const n=Or(e),o={...iu(e),...t};return Bt(n,"title",o.title),Bt(n,"slug",o.slug),Bt(n,"workspace",o.workspace||null),Bt(n,"archived",o.archived),Bt(n,"archivedAt",o.archivedAt||null),Bt(n,"archivedReason",o.archivedReason||null),fa(n,"tags",pa(o.tags)),n.body=o.body,La(n)}function au(e){const t=Or(e);return{title:zt(t,"title"),slug:zt(t,"slug"),status:zt(t,"status"),priority:zt(t,"priority")||"medium",assignee:zt(t,"assignee"),dependsOn:da(t,"dependsOn").join(", "),links:da(t,"links").join(", "),blockedReason:zt(t,"blockedReason"),tags:da(t,"tags").join(", "),body:t.body}}function UM(e,t){const n=Or(e),o={...au(e),...t};return Bt(n,"title",o.title),Bt(n,"slug",o.slug),Bt(n,"status",o.status),Bt(n,"priority",o.priority),Bt(n,"assignee",o.assignee||null),fa(n,"dependsOn",pa(o.dependsOn)),fa(n,"links",pa(o.links)),Bt(n,"blockedReason",o.blockedReason||null),fa(n,"tags",pa(o.tags)),n.body=o.body,La(n)}function lu(e){const t=Or(e);return{assignment:zt(t,"assignment"),status:zt(t,"status"),body:t.body}}function HM(e,t){const n=Or(e),o={...lu(e),...t};return Bt(n,"assignment",o.assignment),Bt(n,"status",o.status),n.body=o.body,La(n)}function cu(e){const t=Or(e);return{assignment:zt(t,"assignment"),body:t.body}}function WM(e,t){const n=Or(e),o={...cu(e),...t};return Bt(n,"assignment",o.assignment),n.body=o.body,La(n)}function uu(e){const t=Or(e);return{name:zt(t,"name"),slug:zt(t,"slug"),description:zt(t,"description"),whenToUse:zt(t,"when_to_use"),tags:da(t,"tags").join(", "),body:t.body}}function VM(e,t){const n=Or(e),o={...uu(e),...t};return Bt(n,"name",o.name),Bt(n,"slug",o.slug),Bt(n,"description",o.description||null),Bt(n,"when_to_use",o.whenToUse||null),fa(n,"tags",pa(o.tags)),n.body=o.body,La(n)}function pt(e,t,n){switch(e){case"project":return BM(t,n);case"assignment":return UM(t,n);case"plan":return HM(t,n);case"scratchpad":return WM(t,n);case"playbook":return VM(t,n);default:return t}}function ai({initialContent:e,documentType:t,mode:n="edit",onSave:o,saving:a,error:l,title:c,description:d,onCancel:p,helpTitle:m,helpBody:h,allowSlugEdit:x=!1}){const[v,b]=g.useState(e),[C,k]=g.useState(!1),[j,S]=g.useState("edit");g.useEffect(()=>{b(e)},[e]);const R=YM(t,v),N=v!==e,A=GM(t,v),O=N?"Unsaved changes":n==="create"?"Draft":"Saved";return i.jsxs("div",{className:"space-y-3",children:[i.jsxs("div",{className:"rounded-lg border border-border/70 bg-card/90 p-3 shadow-sm",children:[i.jsxs("div",{className:"flex flex-col gap-4 lg:flex-row lg:items-start lg:justify-between",children:[i.jsxs("div",{className:"space-y-2",children:[i.jsxs("div",{className:"flex items-center gap-3",children:[i.jsx("h1",{className:"text-lg font-semibold text-foreground",children:c}),i.jsx("span",{className:"rounded-full border border-border/70 bg-background/80 px-2.5 py-1 text-xs font-medium text-muted-foreground",children:O})]}),d?i.jsx("p",{className:"max-w-3xl text-sm leading-6 text-muted-foreground",children:d}):null]}),i.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[i.jsxs("button",{type:"button",onClick:p,className:"shell-action",children:[i.jsx(lb,{className:"h-4 w-4"}),i.jsx("span",{children:"Back"})]}),i.jsxs("button",{type:"button",onClick:()=>k(T=>!T),className:"shell-action",children:[i.jsx(gC,{className:"h-4 w-4"}),i.jsx("span",{children:C?"Structured":"Raw Markdown"})]}),i.jsxs("button",{type:"button",onClick:()=>o(v),disabled:a||R.length>0,className:"inline-flex items-center gap-2 rounded-md bg-foreground px-4 py-2 text-sm font-semibold text-background transition hover:opacity-90 disabled:cursor-not-allowed disabled:opacity-50",children:[i.jsx(_p,{className:"h-4 w-4"}),i.jsx("span",{children:a?"Saving…":"Save"})]})]})]}),l?i.jsx("p",{className:"mt-4 rounded-md border border-error-foreground/30 bg-error px-4 py-3 text-sm text-error-foreground",children:l}):null,R.length>0?i.jsx("div",{className:"mt-4 rounded-md border border-warning-foreground/30 bg-warning px-4 py-3 text-sm text-warning-foreground",children:i.jsx("ul",{className:"space-y-1",children:R.map(T=>i.jsx("li",{children:T},T))})}):null]}),i.jsxs("div",{className:"flex items-center gap-2 md:hidden",children:[i.jsx("button",{type:"button",onClick:()=>S("edit"),className:`shell-action ${j==="edit"?"bg-foreground text-background":""}`,children:"Edit"}),i.jsxs("button",{type:"button",onClick:()=>S("preview"),className:`shell-action ${j==="preview"?"bg-foreground text-background":""}`,children:[i.jsx(Mx,{className:"h-4 w-4"}),"Preview"]})]}),i.jsxs("div",{className:"grid gap-3 xl:grid-cols-[minmax(0,1.2fr)_minmax(320px,0.8fr)]",children:[i.jsx("div",{className:j==="preview"?"hidden md:block":"",children:i.jsx("div",{className:"surface-panel space-y-3",children:C?i.jsx("textarea",{value:v,onChange:T=>b(T.target.value),className:"min-h-[720px] w-full rounded-md border border-border/70 bg-background/90 p-4 font-mono text-sm text-foreground outline-none transition focus:border-primary focus:ring-2 focus:ring-ring/30",spellCheck:!1}):i.jsx(qM,{documentType:t,content:v,onChange:b,allowSlugEdit:x})})}),i.jsx("div",{className:j==="edit"?"hidden md:block":"",children:i.jsxs("div",{className:"surface-panel sticky top-16 space-y-4",children:[i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx(Mx,{className:"h-4 w-4 text-muted-foreground"}),i.jsx("h2",{className:"text-lg font-semibold text-foreground",children:"Preview"})]}),i.jsx(Yt,{content:A,emptyState:"Write markdown body content to preview it here."})]})})]})]})}function qM({documentType:e,content:t,onChange:n,allowSlugEdit:o}){if(e==="project"){const l=iu(t);return i.jsxs("div",{className:"space-y-3",children:[i.jsxs(Ji,{children:[i.jsx(it,{label:"Project title",children:i.jsx("input",{value:l.title,onChange:c=>{const d=c.target.value,p={title:d};o&&(l.slug===cr(l.title)||!l.slug.trim())&&(p.slug=cr(d)),n(pt(e,t,p))},className:"editor-input"})}),i.jsx(it,{label:"Slug",children:i.jsxs("div",{className:"space-y-2",children:[i.jsx("input",{value:l.slug,disabled:!o,onChange:c=>n(pt(e,t,{slug:cr(c.target.value)})),className:`editor-input ${o?"":"editor-input-disabled"}`}),i.jsx("p",{className:"text-xs leading-5 text-muted-foreground",children:o?"The slug becomes the folder name and URL. It is auto-generated from the title until you change it, and it cannot be renamed after creation.":"The slug is the folder name and URL-safe identifier. It is locked after creation so links and file paths stay stable."})]})}),i.jsx(it,{label:"Tags",children:i.jsx("input",{value:l.tags,onChange:c=>n(pt(e,t,{tags:c.target.value})),placeholder:"Comma-separated tags",className:"editor-input"})}),i.jsx(KM,{value:l.workspace,onChange:c=>n(pt(e,t,{workspace:c}))})]}),i.jsx(it,{label:"Project body",children:i.jsx("textarea",{value:l.body,onChange:c=>n(pt(e,t,{body:c.target.value})),className:"editor-textarea",spellCheck:!1})})]})}if(e==="assignment"){const l=au(t);return i.jsxs("div",{className:"space-y-3",children:[i.jsxs(Ji,{children:[i.jsx(it,{label:"Assignment title",children:i.jsx("input",{value:l.title,onChange:c=>{const d=c.target.value,p={title:d};o&&(l.slug===cr(l.title)||!l.slug.trim())&&(p.slug=cr(d)),n(pt(e,t,p))},className:"editor-input"})}),i.jsx(it,{label:"Slug",children:i.jsxs("div",{className:"space-y-2",children:[i.jsx("input",{value:l.slug,disabled:!o,onChange:c=>n(pt(e,t,{slug:cr(c.target.value)})),className:`editor-input ${o?"":"editor-input-disabled"}`}),i.jsx("p",{className:"text-xs leading-5 text-muted-foreground",children:o?"The slug becomes the assignment folder name and URL. It is auto-generated from the title until you change it, and it cannot be renamed after creation.":"The slug is locked after creation because assignment paths and dependency references use it as a stable identifier."})]})}),i.jsx(it,{label:"Status",children:i.jsxs("select",{value:l.status,onChange:c=>n(pt(e,t,{status:c.target.value})),className:"editor-input",children:[i.jsx("option",{value:"pending",children:"Pending"}),i.jsx("option",{value:"in_progress",children:"In Progress"}),i.jsx("option",{value:"blocked",children:"Blocked"}),i.jsx("option",{value:"review",children:"Review"}),i.jsx("option",{value:"completed",children:"Completed"}),i.jsx("option",{value:"failed",children:"Failed"})]})}),i.jsx(it,{label:"Priority",children:i.jsxs("select",{value:l.priority,onChange:c=>n(pt(e,t,{priority:c.target.value})),className:"editor-input",children:[i.jsx("option",{value:"low",children:"Low"}),i.jsx("option",{value:"medium",children:"Medium"}),i.jsx("option",{value:"high",children:"High"}),i.jsx("option",{value:"critical",children:"Critical"})]})}),i.jsx(it,{label:"Assignee",children:i.jsx("input",{value:l.assignee,onChange:c=>n(pt(e,t,{assignee:c.target.value})),placeholder:"Agent name",className:"editor-input"})}),i.jsx(it,{label:"Depends on",className:"md:col-span-2",children:i.jsx("input",{value:l.dependsOn,onChange:c=>n(pt(e,t,{dependsOn:c.target.value})),placeholder:"Comma-separated assignment slugs",className:"editor-input"})}),i.jsx(it,{label:"Links",className:"md:col-span-2",children:i.jsx("input",{value:l.links,onChange:c=>n(pt(e,t,{links:c.target.value})),placeholder:"Comma-separated: projectSlug/assignmentSlug",className:"editor-input"})}),i.jsx(it,{label:"Blocked reason",className:"md:col-span-2",children:i.jsx("input",{value:l.blockedReason,onChange:c=>n(pt(e,t,{blockedReason:c.target.value})),placeholder:"Read-only unless the assignment is actually blocked",className:"editor-input"})}),i.jsx(it,{label:"Tags",className:"md:col-span-2",children:i.jsx("input",{value:l.tags,onChange:c=>n(pt(e,t,{tags:c.target.value})),placeholder:"Comma-separated tags",className:"editor-input"})})]}),i.jsx(it,{label:"Assignment body",children:i.jsx("textarea",{value:l.body,onChange:c=>n(pt(e,t,{body:c.target.value})),className:"editor-textarea",spellCheck:!1})})]})}if(e==="plan"){const l=lu(t);return i.jsxs("div",{className:"space-y-3",children:[i.jsxs(Ji,{children:[i.jsx(it,{label:"Assignment",children:i.jsx("input",{value:l.assignment,disabled:!0,className:"editor-input editor-input-disabled"})}),i.jsx(it,{label:"Plan status",children:i.jsxs("select",{value:l.status,onChange:c=>n(pt(e,t,{status:c.target.value})),className:"editor-input",children:[i.jsx("option",{value:"draft",children:"Draft"}),i.jsx("option",{value:"approved",children:"Approved"}),i.jsx("option",{value:"in_progress",children:"In Progress"}),i.jsx("option",{value:"completed",children:"Completed"})]})})]}),i.jsx(it,{label:"Plan body",children:i.jsx("textarea",{value:l.body,onChange:c=>n(pt(e,t,{body:c.target.value})),className:"editor-textarea",spellCheck:!1})})]})}if(e==="scratchpad"){const l=cu(t);return i.jsxs("div",{className:"space-y-3",children:[i.jsx(Ji,{children:i.jsx(it,{label:"Assignment",children:i.jsx("input",{value:l.assignment,disabled:!0,className:"editor-input editor-input-disabled"})})}),i.jsx(it,{label:"Scratchpad body",children:i.jsx("textarea",{value:l.body,onChange:c=>n(pt(e,t,{body:c.target.value})),className:"editor-textarea",spellCheck:!1})})]})}const a=uu(t);return i.jsxs("div",{className:"space-y-3",children:[i.jsxs(Ji,{children:[i.jsx(it,{label:"Playbook name",children:i.jsx("input",{value:a.name,onChange:l=>{const c=l.target.value,d={name:c};o&&(a.slug===cr(a.name)||!a.slug.trim())&&(d.slug=cr(c)),n(pt(e,t,d))},className:"editor-input"})}),i.jsx(it,{label:"Slug",children:i.jsxs("div",{className:"space-y-2",children:[i.jsx("input",{value:a.slug,disabled:!o,onChange:l=>n(pt(e,t,{slug:cr(l.target.value)})),className:`editor-input ${o?"":"editor-input-disabled"}`}),i.jsx("p",{className:"text-xs leading-5 text-muted-foreground",children:o?"The slug becomes the filename. It is auto-generated from the name until you change it.":"The slug is locked after creation because it is the filename."})]})}),i.jsx(it,{label:"Description",className:"md:col-span-2",children:i.jsx("input",{value:a.description,onChange:l=>n(pt(e,t,{description:l.target.value})),placeholder:"One-line description of what this playbook does",className:"editor-input"})}),i.jsx(it,{label:"Tags",className:"md:col-span-2",children:i.jsx("input",{value:a.tags,onChange:l=>n(pt(e,t,{tags:l.target.value})),placeholder:"Comma-separated tags",className:"editor-input"})}),i.jsx(it,{label:"When to use",className:"md:col-span-2",children:i.jsx("input",{value:a.whenToUse,onChange:l=>n(pt(e,t,{whenToUse:l.target.value})),placeholder:"Describe when agents should apply this playbook",className:"editor-input"})})]}),i.jsx(it,{label:"Playbook rules",children:i.jsx("textarea",{value:a.body,onChange:l=>n(pt(e,t,{body:l.target.value})),className:"editor-textarea",spellCheck:!1})})]})}function Ji({children:e}){return i.jsx("div",{className:"grid gap-4 md:grid-cols-2",children:e})}function it({label:e,children:t,className:n}){return i.jsxs("label",{className:`block space-y-2 ${n??""}`,children:[i.jsx("span",{className:"text-sm font-medium text-foreground",children:e}),t]})}function KM({value:e,onChange:t}){const{data:n}=Up(),o=(n==null?void 0:n.workspaces)??[];return i.jsx(it,{label:"Workspace",children:i.jsxs("select",{value:e,onChange:a=>t(a.target.value),className:"editor-input",children:[i.jsx("option",{value:"",children:"Ungrouped"}),o.map(a=>i.jsx("option",{value:a,children:a},a))]})})}function GM(e,t){switch(e){case"project":return iu(t).body;case"assignment":return au(t).body;case"plan":return lu(t).body;case"scratchpad":return cu(t).body;case"playbook":return uu(t).body}}function YM(e,t){switch(e){case"project":{const n=iu(t);return[n.title.trim()?null:"Project title is required.",n.slug.trim()?null:"Project slug is required.",n.slug.trim()&&!nf(n.slug)?"Project slug must be lowercase letters, numbers, and hyphens only.":null].filter(o=>!!o)}case"assignment":{const n=au(t);return[n.title.trim()?null:"Assignment title is required.",n.slug.trim()?null:"Assignment slug is required.",n.slug.trim()&&!nf(n.slug)?"Assignment slug must be lowercase letters, numbers, and hyphens only.":null].filter(o=>!!o)}case"plan":return lu(t).assignment.trim()?[]:["Plan assignment is required."];case"scratchpad":return cu(t).assignment.trim()?[]:["Scratchpad assignment is required."];case"playbook":{const n=uu(t);return[n.name.trim()?null:"Playbook name is required.",n.slug.trim()?null:"Playbook slug is required.",n.slug.trim()&&!nf(n.slug)?"Playbook slug must be lowercase letters, numbers, and hyphens only.":null].filter(o=>!!o)}}}function Ov(){const e=Ut(),{workspace:t}=At(),n=Lt(),[o,a]=g.useState(null),[l,c]=g.useState(!0),[d,p]=g.useState(!1),[m,h]=g.useState(null);g.useEffect(()=>{fetch("/api/templates/project").then(v=>v.json()).then(v=>{let b=v.content;t&&t!=="_ungrouped"&&(b=b.replace(/^(tags: \[\])$/m,`$1
500
+ workspace: ${t}`)),a(b),c(!1)}).catch(v=>{h(v.message),c(!1)})},[t]);async function x(v){p(!0),h(null);try{const b=await fetch("/api/projects",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({content:v})}),C=await b.json();if(!b.ok){h(C.error||`HTTP ${b.status}`),p(!1);return}e(`${n}/projects/${C.slug}`)}catch(b){h(b.message),p(!1);return}p(!1)}return l?i.jsx(kt,{label:"Loading project template…"}):m&&!o?i.jsx(gt,{error:m}):i.jsx(ai,{initialContent:o||"",documentType:"project",mode:"create",onSave:x,saving:d,error:m,title:"Create Project",description:"Projects hold the high-level objective, shared context, and human-authored overview. Put execution details in assignments instead of overloading project.md.",onCancel:()=>e(`${n}/projects`),helpTitle:"Project editing rules",helpBody:"Use this form for project intent, slug, tags, and overview content. If you ever need less common metadata, raw markdown mode still exposes the full file.",allowSlugEdit:!0})}function Lv(){const{slug:e}=At(),t=Lt(),n=Ut(),[o,a]=g.useState(null),[l,c]=g.useState(!0),[d,p]=g.useState(!1),[m,h]=g.useState(null);g.useEffect(()=>{fetch("/api/templates/assignment").then(v=>v.json()).then(v=>{a(v.content),c(!1)}).catch(v=>{h(v.message),c(!1)})},[]);async function x(v){if(!e){h("Project slug is required.");return}p(!0),h(null);try{const b=await fetch(`/api/projects/${e}/assignments`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({content:v})}),C=await b.json();if(!b.ok){h(C.error||`HTTP ${b.status}`),p(!1);return}n(`${t}/projects/${e}/assignments/${C.slug}`)}catch(b){h(b.message),p(!1);return}p(!1)}return l?i.jsx(kt,{label:"Loading assignment template…"}):m&&!o?i.jsx(gt,{error:m}):i.jsx(ai,{initialContent:o||"",documentType:"assignment",mode:"create",onSave:x,saving:d,error:m,title:"Create Assignment",description:"Assignments are the execution unit. Declare dependencies here, keep status pending until work starts, and use blocked later only for runtime obstacles.",onCancel:()=>n(e?`${t}/projects/${e}`:`${t}/projects`),helpTitle:"Assignment editing rules",helpBody:"Use structured fields for priority, assignee, dependencies, and tags. Status can be changed through lifecycle actions, kanban drag, or the status override.",allowSlugEdit:!0})}function Mv(){const{workspace:e}=At(),t=Lt(),n=Ut(),[o,a]=g.useState(null),[l,c]=g.useState(!0),[d,p]=g.useState(!1),[m,h]=g.useState(null);g.useEffect(()=>{const v=new URLSearchParams({standalone:"1"});e&&v.set("workspace",e),fetch(`/api/templates/assignment?${v.toString()}`).then(b=>b.json()).then(b=>{a(b.content),c(!1)}).catch(b=>{h(b.message),c(!1)})},[e]);async function x(v){var b;p(!0),h(null);try{const C=await fetch("/api/assignments",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({content:v})}),k=await C.json();if(!C.ok){h(k.error||`HTTP ${C.status}`),p(!1);return}const j=(b=k==null?void 0:k.assignment)==null?void 0:b.id;if(!j){h("Server did not return the new assignment id."),p(!1);return}n(`/assignments/${j}`)}catch(C){h(C.message),p(!1);return}p(!1)}return l?i.jsx(kt,{label:"Loading assignment template…"}):m&&!o?i.jsx(gt,{error:m}):i.jsx(ai,{initialContent:o||"",documentType:"assignment",mode:"create",onSave:x,saving:d,error:m,title:"Create Standalone Assignment",description:e?`Standalone assignments live outside any project. This one will be tagged with workspaceGroup: ${e} so it appears in this workspace's views.`:"Standalone assignments live outside any project. Add a workspaceGroup to make them appear in workspace-filtered views.",onCancel:()=>n(`${t}/assignments`),helpTitle:"Standalone assignment editing rules",helpBody:"No project field is needed (it must remain null). Use workspaceGroup to group with other workspace work. Status, priority, and tags work the same as project-nested assignments.",allowSlugEdit:!0})}function du({loadUrl:e,saveUrl:t,redirectTo:n,title:o,description:a,documentType:l,helpTitle:c,helpBody:d}){const p=Ut(),{data:m,loading:h,error:x}=Bb(e),[v,b]=g.useState(!1),[C,k]=g.useState(null);async function j(S){b(!0),k(null);try{const R=await fetch(t,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({content:S})}),N=await R.json();if(!R.ok){k(N.error||`HTTP ${R.status}`),b(!1);return}p(n)}catch(R){k(R.message),b(!1);return}b(!1)}return h?i.jsx(kt,{label:`Loading ${o.toLowerCase()}…`}):x||!m?i.jsx(gt,{error:x||`${o} is unavailable.`}):i.jsx(ai,{initialContent:m.content,documentType:l,onSave:j,saving:v,error:C,title:o,description:a,onCancel:()=>p(n),helpTitle:c,helpBody:d})}function _v(){const{slug:e}=At(),t=Lt(),n=e??"";return i.jsx(du,{loadUrl:`/api/projects/${n}/edit`,saveUrl:`/api/projects/${n}`,redirectTo:`${t}/projects/${n}`,title:"Edit Project",description:"Project edits change the human-authored source document. The structured form stays focused on title, slug, tags, and overview content.",documentType:"project",helpTitle:"Editable vs derived project fields",helpBody:"Project status remains derived from assignment state. If you need less common frontmatter fields, switch to raw markdown mode instead of expanding the structured form."})}function Mf(){const{slug:e,aslug:t,id:n}=At(),o=Lt(),a=!!n,l=a?`/api/assignments/${n}/edit`:`/api/projects/${e}/assignments/${t}/edit`,c=a?`/api/assignments/${n}`:`/api/projects/${e}/assignments/${t}`,d=a?`/assignments/${n}`:`${o}/projects/${e}/assignments/${t}`;return i.jsx(du,{loadUrl:l,saveUrl:c,redirectTo:d,title:"Edit Assignment",description:"Edit assignment fields including status, priority, assignee, dependencies, and body.",documentType:"assignment",helpTitle:"Assignment editing",helpBody:"All fields are editable. Status can also be changed through lifecycle actions or kanban drag."})}function _f(){const{slug:e,aslug:t,id:n}=At(),o=Lt(),a=!!n,l=a?`/api/assignments/${n}/plan/edit`:`/api/projects/${e}/assignments/${t}/plan/edit`,c=a?`/api/assignments/${n}/plan`:`/api/projects/${e}/assignments/${t}/plan`,d=a?`/assignments/${n}?tab=plan`:`${o}/projects/${e}/assignments/${t}?tab=plan`;return i.jsx(du,{loadUrl:l,saveUrl:c,redirectTo:d,title:"Edit Plan",description:"Plans are separate from assignment status, so keep implementation steps here instead of overloading the assignment body.",documentType:"plan",helpTitle:"Plan status is separate",helpBody:"Plan status tracks the plan document itself. It does not replace the assignment lifecycle state."})}function $f(){const{slug:e,aslug:t,id:n}=At(),o=Lt(),a=!!n,l=a?`/api/assignments/${n}/scratchpad/edit`:`/api/projects/${e}/assignments/${t}/scratchpad/edit`,c=a?`/api/assignments/${n}/scratchpad`:`/api/projects/${e}/assignments/${t}/scratchpad`,d=a?`/assignments/${n}?tab=scratchpad`:`${o}/projects/${e}/assignments/${t}?tab=scratchpad`;return i.jsx(du,{loadUrl:l,saveUrl:c,redirectTo:d,title:"Edit Scratchpad",description:"Scratchpad is the assignment’s working memory surface for notes, experiments, and temporary context.",documentType:"scratchpad",helpTitle:"Scratchpad usage",helpBody:"Scratchpad is for transient notes. Keep canonical objective and lifecycle data in assignment.md and any active plan files (plan.md, plan-v2.md, ...)."})}function v1({loadUrl:e,saveUrl:t,redirectTo:n,title:o,description:a,helpTitle:l,helpBody:c}){const d=Ut(),{data:p,loading:m,error:h}=Bb(e),[x,v]=g.useState(""),[b,C]=g.useState(""),[k,j]=g.useState(!1),[S,R]=g.useState(null);async function N(){j(!0),R(null);try{const A=await fetch(t,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({title:x,body:b})}),O=await A.json();if(!A.ok){R(O.error||`HTTP ${A.status}`),j(!1);return}d(n)}catch(A){R(A.message),j(!1);return}j(!1)}return m?i.jsx(kt,{label:`Loading ${o.toLowerCase()}…`}):h||!p?i.jsx(gt,{error:h||`${o} is unavailable.`}):i.jsxs("div",{className:"space-y-4",children:[i.jsx(Ie,{title:o,description:a,children:i.jsxs("div",{className:"space-y-4",children:[i.jsxs("label",{className:"block space-y-2",children:[i.jsx("span",{className:"text-sm font-medium text-foreground",children:"Entry title"}),i.jsx("input",{value:x,onChange:A=>v(A.target.value),placeholder:"Optional title",className:"editor-input"})]}),i.jsxs("label",{className:"block space-y-2",children:[i.jsx("span",{className:"text-sm font-medium text-foreground",children:"Entry body"}),i.jsx("textarea",{value:b,onChange:A=>C(A.target.value),className:"editor-textarea",spellCheck:!1})]}),S?i.jsx("p",{className:"rounded-md border border-error-foreground/30 bg-error px-4 py-3 text-sm text-error-foreground",children:S}):null,i.jsxs("div",{className:"flex flex-wrap gap-2",children:[i.jsx("button",{type:"button",onClick:()=>d(n),className:"shell-action",children:"Cancel"}),i.jsx("button",{type:"button",onClick:N,disabled:k||!b.trim(),className:"shell-action bg-foreground text-background hover:opacity-90 disabled:cursor-not-allowed disabled:opacity-50",children:k?"Appending…":"Append Entry"})]})]})}),i.jsx(Ie,{title:"Current Document",children:i.jsx(Yt,{content:p.content.replace(/^---[\s\S]*?---\n?/,""),emptyState:"No existing content."})})]})}function Ff(){const{slug:e,aslug:t,id:n}=At(),o=Lt(),a=!!n,l=a?`/api/assignments/${n}/handoff/edit`:`/api/projects/${e}/assignments/${t}/handoff/edit`,c=a?`/api/assignments/${n}/handoff/entries`:`/api/projects/${e}/assignments/${t}/handoff/entries`,d=a?`/assignments/${n}?tab=handoff`:`${o}/projects/${e}/assignments/${t}?tab=handoff`;return i.jsx(v1,{loadUrl:l,saveUrl:c,redirectTo:d,title:"Append Handoff Entry",description:"Add a new handoff without rewriting previous history.",helpTitle:"Append-only handoff history",helpBody:"Handoff log entries preserve the baton-passing trail between sessions and agents. Add a new entry instead of editing older ones."})}function zf(){const{slug:e,aslug:t,id:n}=At(),o=Lt(),a=!!n,l=a?`/api/assignments/${n}/decision-record/edit`:`/api/projects/${e}/assignments/${t}/decision-record/edit`,c=a?`/api/assignments/${n}/decision-record/entries`:`/api/projects/${e}/assignments/${t}/decision-record/entries`,d=a?`/assignments/${n}?tab=decisions`:`${o}/projects/${e}/assignments/${t}?tab=decisions`;return i.jsx(v1,{loadUrl:l,saveUrl:c,redirectTo:d,title:"Append Decision Entry",description:"Record a new decision and rationale without editing prior entries.",helpTitle:"Append-only decision history",helpBody:"Decision records should accumulate over time so the implementation rationale remains auditable and reviewable."})}function $v(){const{workspace:e}=At(),{data:t}=Mc(),{data:n,loading:o,error:a,refetch:l}=Hp(),[c,d]=g.useState(!1),[p,m]=g.useState(""),[h,x]=g.useState(!1),v=xn();g.useEffect(()=>{const R=v.hash.match(/^#server-(.+)/);if(!R)return;const N=decodeURIComponent(R[1]),A=document.querySelector(`[data-server-name="${window.CSS.escape(N)}"]`);if(!A)return;A.scrollIntoView({block:"nearest"}),A.classList.add("ring-2","ring-primary/60");const O=window.setTimeout(()=>A.classList.remove("ring-2","ring-primary/60"),1500);return()=>window.clearTimeout(O)},[v.hash,n]);const b=(()=>{if(!e||!n)return(n==null?void 0:n.sessions)??[];if(!t)return[];const R=new Set(t.filter(N=>e==="_ungrouped"?N.workspace===null:N.workspace===e).map(N=>N.slug));return n.sessions.filter(N=>N.windows.some(A=>A.panes.some(O=>O.assignment&&O.assignment.project!==null&&R.has(O.assignment.project))))})();async function C(R){if(R.preventDefault(),!!p.trim())try{await fetch("/api/servers",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:p.trim()})}),m(""),d(!1),l()}catch{}}async function k(){x(!0);try{await fetch("/api/servers/refresh",{method:"POST"}),l()}finally{x(!1)}}async function j(R){await fetch(`/api/servers/${encodeURIComponent(R)}`,{method:"DELETE"}),l()}async function S(R){await fetch(`/api/servers/${encodeURIComponent(R)}/refresh`,{method:"POST"}),l()}return o?i.jsx(kt,{label:"Loading servers…"}):a?i.jsx(gt,{error:a}):n?n.tmuxAvailable?i.jsxs(i.Fragment,{children:[i.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[c?i.jsxs("form",{onSubmit:C,className:"flex items-center gap-2",children:[i.jsx("input",{type:"text",value:p,onChange:R=>m(R.target.value),placeholder:"tmux session name",className:"editor-input text-sm",autoFocus:!0}),i.jsx("button",{type:"submit",className:"shell-action",children:"Add"}),i.jsx("button",{type:"button",className:"shell-action",onClick:()=>d(!1),children:"Cancel"})]}):i.jsxs("button",{className:"shell-action",onClick:()=>d(!0),children:[i.jsx(Un,{className:"h-3.5 w-3.5"}),"Track Session"]}),i.jsxs("button",{className:"shell-action",onClick:k,disabled:h,children:[i.jsx(xb,{className:`h-3.5 w-3.5 ${h?"animate-spin":""}`}),"Refresh All"]})]}),b.length===0?i.jsx(rt,{title:"No sessions tracked",description:"Register a tmux session to start tracking your dev servers."}):i.jsx("div",{className:"mt-4 space-y-4",children:b.map(R=>i.jsx(XM,{session:R,onRefresh:()=>S(R.name),onRemove:()=>j(R.name),onRefetch:l},R.name))})]}):i.jsx(i.Fragment,{children:i.jsxs("div",{className:"surface-panel mt-4 flex flex-col items-center gap-3 py-12 text-center",children:[i.jsx(MC,{className:"h-10 w-10 text-muted-foreground/40"}),i.jsx("p",{className:"text-sm font-medium text-foreground",children:"tmux is not installed"}),i.jsxs("p",{className:"max-w-md text-sm text-muted-foreground",children:["Server tracking requires tmux. Install it with ",i.jsx("code",{className:"rounded bg-muted px-1.5 py-0.5 text-xs",children:"brew install tmux"})," to get started."]})]})}):null}function XM({session:e,onRefresh:t,onRemove:n,onRefetch:o}){return i.jsxs("div",{className:"surface-panel","data-server-name":e.name,children:[i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsxs("div",{className:"flex items-center gap-3",children:[i.jsx(Mp,{className:"h-4 w-4 text-muted-foreground"}),i.jsx("span",{className:"text-sm font-semibold text-foreground",children:e.name}),i.jsx("span",{className:`inline-flex items-center rounded-full px-2 py-0.5 text-xs font-medium ${e.alive?"border border-success-foreground/30 bg-success text-success-foreground":"border border-error-foreground/30 bg-error text-error-foreground"}`,children:e.alive?"alive":"dead"}),i.jsxs("span",{className:"text-xs text-muted-foreground",children:["Last refreshed: ",new Date(e.lastRefreshed).toLocaleString()]})]}),i.jsxs("div",{className:"flex items-center gap-1",children:[i.jsx("button",{className:"shell-action",onClick:t,title:"Refresh",children:i.jsx(xb,{className:"h-3.5 w-3.5"})}),i.jsx("button",{className:"shell-action",onClick:n,title:"Remove",children:i.jsx(Ro,{className:"h-3.5 w-3.5"})})]})]}),e.alive&&e.windows.length>0&&i.jsx("div",{className:"mt-3 space-y-3",children:e.windows.map(a=>i.jsxs("div",{children:[i.jsxs("p",{className:"mb-1.5 text-xs font-medium uppercase tracking-wider text-muted-foreground",children:["Window ",a.index,": ",a.name]}),i.jsx("div",{className:"space-y-1.5",children:a.panes.map(l=>i.jsx(QM,{pane:l,sessionName:e.name,windowIndex:a.index,onRefetch:o},`${a.index}:${l.index}`))})]},a.index))}),!e.alive&&i.jsxs("div",{className:"mt-3 flex items-center gap-2 text-sm text-muted-foreground",children:[i.jsx(DC,{className:"h-4 w-4"}),i.jsx("span",{children:e.kind==="process"?"Process no longer running":"Session no longer exists"})]})]})}function QM({pane:e,sessionName:t,windowIndex:n,onRefetch:o}){const a=Lt(),l=e.cwd.replace(/^\/Users\/[^/]+/,"~");return i.jsxs("div",{className:"flex items-center gap-3 rounded-md border border-border/40 bg-background/60 px-3 py-2 text-sm",children:[i.jsxs("span",{className:"shrink-0 font-mono text-xs text-muted-foreground/60",children:[":",e.index]}),i.jsx("span",{className:"shrink-0 rounded bg-muted/60 px-1.5 py-0.5 font-mono text-xs",children:e.command}),i.jsxs("span",{className:"inline-flex min-w-0 items-center gap-1.5 text-xs text-muted-foreground",children:[i.jsx("span",{className:"truncate",title:e.cwd,children:l}),i.jsx(qr,{value:e.cwd})]}),e.branch&&i.jsxs("span",{className:"flex shrink-0 items-center gap-1 text-xs text-muted-foreground",children:[i.jsx(Lp,{className:"h-3 w-3"}),e.branch,e.worktree&&i.jsx("span",{className:"rounded bg-status-in-progress px-1 py-0.5 text-[10px] font-medium text-status-in-progress-foreground",children:"worktree"})]}),e.ports.length>0&&i.jsx("div",{className:"flex shrink-0 items-center gap-1.5",children:e.urls.map(c=>i.jsxs("a",{href:c,target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-1 rounded border border-primary/30 bg-primary/5 px-1.5 py-0.5 text-xs font-medium text-primary hover:bg-primary/10 dark:border-primary/40 dark:bg-primary/10 dark:hover:bg-primary/20",children:[c.replace("http://localhost:",":"),i.jsx(fb,{className:"h-2.5 w-2.5"})]},c))}),i.jsx("div",{className:"ml-auto shrink-0",children:e.assignment?i.jsxs(De,{to:e.assignment.project===null?`/assignments/${e.assignment.slug}`:`${a}/projects/${e.assignment.project}/assignments/${e.assignment.slug}`,className:"inline-flex items-center gap-1 rounded border border-primary/30 bg-primary/10 px-1.5 py-0.5 text-xs font-medium text-primary hover:bg-primary/20",children:[i.jsx(jC,{className:"h-2.5 w-2.5"}),e.assignment.title,e.assignment.project===null?i.jsx("span",{className:"ml-1 rounded bg-muted px-1 py-0.5 text-[9px] uppercase tracking-wide text-muted-foreground",children:"Standalone"}):null]}):i.jsx("span",{className:"text-xs text-muted-foreground/40",children:"unlinked"})})]})}function Fv(){const{workspace:e}=At(),{data:t}=Mc(),{data:n,loading:o,error:a}=DE(),[l,c]=g.useState(""),[d,p]=g.useState(""),[m,h]=g.useState(""),[x,v]=g.useState("started_desc"),[b,C]=g.useState(0),[k,j]=g.useState(new Set),[S,R]=g.useState(!1),[N,A]=g.useState(null),[O,T]=g.useState(null),D=(n==null?void 0:n.sessions.some(q=>q.status==="active"))??!1;g.useEffect(()=>{if(!D)return;const q=window.setInterval(()=>C(J=>J+1),3e4);return()=>window.clearInterval(q)},[D]),g.useEffect(()=>{j(q=>{if(q.size===0)return q;const J=new Set((n==null?void 0:n.sessions.map(F=>F.sessionId))??[]),_=new Set([...q].filter(F=>J.has(F)));return _.size===q.size?q:_})},[n]);const L=g.useMemo(()=>{if(!n)return[];if(e&&!t)return[];const q=l.trim().toLowerCase();return[...n.sessions.filter(_=>{var U;if(e&&t){const Z=((U=t.find(P=>P.slug===_.projectSlug))==null?void 0:U.workspace)??null;if(e==="_ungrouped"){if(Z!==null)return!1}else if(Z!==e)return!1}const F=ZM(_.started);return d&&(!F||F<d)||m&&(!F||F>m)?!1:q?[_.projectSlug??"",_.assignmentSlug??"",_.agent,_.sessionId,_.path,_.description??"",_.transcriptPath??""].join(" ").toLowerCase().includes(q):!0})].sort((_,F)=>e_(_,F,x))},[n,l,x,d,m,b,e,t]);function G(q){j(J=>{const _=new Set(J);return _.has(q)?_.delete(q):_.add(q),_})}function re(){k.size===L.length&&L.length>0?j(new Set):j(new Set(L.map(q=>q.sessionId)))}async function z(q){A(null),R(!0);try{const J=await fetch("/api/agent-sessions",{method:"DELETE",headers:{"Content-Type":"application/json"},body:JSON.stringify({sessionIds:q})}),_=await J.json().catch(()=>null);if(!J.ok)throw new Error((_==null?void 0:_.error)||`HTTP ${J.status}`);j(F=>new Set([...F].filter(B=>!q.includes(B)))),T(null)}catch(J){A(J.message)}finally{R(!1)}}if(o)return i.jsx(kt,{label:"Loading agent sessions..."});if(a)return i.jsx(gt,{error:a});if(!n)return null;const K=n.sessions.length>0;return i.jsxs(i.Fragment,{children:[i.jsxs(ih,{children:[i.jsx(Uc,{value:l,onChange:c,placeholder:"Search project, assignment, agent, session ID, path, or description"}),i.jsxs("label",{className:"flex min-w-[150px] flex-col gap-1 text-xs font-medium uppercase tracking-[0.08em] text-muted-foreground",children:["Started From",i.jsx("input",{type:"date",value:d,onChange:q=>p(q.target.value),className:"editor-input min-w-[150px]"})]}),i.jsxs("label",{className:"flex min-w-[150px] flex-col gap-1 text-xs font-medium uppercase tracking-[0.08em] text-muted-foreground",children:["Started To",i.jsx("input",{type:"date",value:m,onChange:q=>h(q.target.value),className:"editor-input min-w-[150px]"})]}),i.jsxs("select",{value:x,onChange:q=>v(q.target.value),className:"editor-input max-w-[200px]",children:[i.jsx("option",{value:"started_desc",children:"Newest first"}),i.jsx("option",{value:"started_asc",children:"Oldest first"}),i.jsx("option",{value:"assignment_asc",children:"Assignment A-Z"}),i.jsx("option",{value:"agent_asc",children:"Agent A-Z"})]})]}),N?i.jsx("div",{className:"mt-4 rounded-md border border-error-foreground/30 bg-error px-4 py-3 text-sm text-error-foreground",children:N}):null,k.size>0&&i.jsxs("div",{className:"mt-4 flex items-center gap-3 rounded border border-border/40 bg-muted/30 px-4 py-2 text-sm",children:[i.jsxs("span",{className:"text-muted-foreground",children:[k.size," session",k.size!==1?"s":""," selected"]}),i.jsxs("button",{className:"shell-action text-destructive",onClick:()=>T({sessionIds:[...k],title:`Delete ${k.size} selected session${k.size===1?"":"s"}?`,description:"This removes the selected agent session records from the dashboard. This cannot be undone.",confirmLabel:k.size===1?"Delete Session":"Delete Sessions"}),disabled:S,children:[i.jsx(Ro,{className:"mr-1 inline h-3.5 w-3.5"}),"Delete Selected"]}),i.jsx("button",{className:"shell-action",onClick:()=>j(new Set),children:"Clear Selection"})]}),K?L.length===0?i.jsx(rt,{title:"No agent sessions match these filters",description:"Adjust the status, search term, date range, or sorting controls to show sessions again."}):i.jsx("div",{className:"surface-panel mt-4 overflow-x-auto",children:i.jsxs("table",{className:"w-full min-w-[1280px] table-fixed text-sm",children:[i.jsxs("colgroup",{children:[i.jsx("col",{style:{width:"32px"}}),i.jsx("col",{style:{width:"140px"}}),i.jsx("col",{style:{width:"160px"}}),i.jsx("col",{style:{width:"200px"}}),i.jsx("col",{style:{width:"110px"}}),i.jsx("col",{style:{width:"130px"}}),i.jsx("col",{style:{width:"140px"}}),i.jsx("col",{style:{width:"200px"}}),i.jsx("col",{style:{width:"200px"}}),i.jsx("col",{style:{width:"40px"}})]}),i.jsx("thead",{children:i.jsxs("tr",{className:"border-b border-border/40 text-left text-xs uppercase tracking-wider text-muted-foreground",children:[i.jsx("th",{className:"pb-2 pr-3",children:i.jsx("button",{onClick:re,className:"text-muted-foreground hover:text-foreground",children:k.size===L.length&&L.length>0?i.jsx(zn,{className:"h-4 w-4"}):i.jsx(yb,{className:"h-4 w-4"})})}),i.jsx("th",{className:"pb-2 pr-3",children:"Project"}),i.jsx("th",{className:"pb-2 pr-3",children:"Assignment"}),i.jsx("th",{className:"pb-2 pr-3",children:"Description"}),i.jsx("th",{className:"pb-2 pr-3",children:"Agent"}),i.jsx("th",{className:"pb-2 pr-3",children:"Session ID"}),i.jsx("th",{className:"pb-2 pr-3",children:"Started"}),i.jsx("th",{className:"pb-2 pr-3",children:"Path"}),i.jsx("th",{className:"pb-2 pr-3",children:"Transcript"}),i.jsx("th",{className:"pb-2"})]})}),i.jsx("tbody",{children:L.map(q=>i.jsx(JM,{session:q,selected:k.has(q.sessionId),onToggle:()=>G(q.sessionId),onDelete:()=>T({sessionIds:[q.sessionId],title:`Delete session ${q.sessionId.slice(0,8)}...?`,description:`Remove this ${q.agent} session record${q.assignmentSlug?` for ${q.assignmentSlug}`:""}. This cannot be undone.`,confirmLabel:"Delete Session"})},q.sessionId))})]})}):i.jsx(rt,{title:"No agent sessions",description:"No agent sessions have been registered yet. Use /grab-assignment or syntaur track-session to register one."}),i.jsx(p1,{open:O!==null,title:(O==null?void 0:O.title)??"Delete session?",description:(O==null?void 0:O.description)??"",confirmLabel:(O==null?void 0:O.confirmLabel)??"Delete",destructive:!0,loading:S,onOpenChange:q=>{q||T(null)},onConfirm:async()=>{O&&await z(O.sessionIds)}})]})}function JM({session:e,selected:t,onToggle:n,onDelete:o}){const a=Lt(),l=e.sessionId.length>12?e.sessionId.slice(0,8)+"...":e.sessionId,c=e.path?e.path.replace(/^\/Users\/[^/]+/,"~"):"—",d=e.transcriptPath?e.transcriptPath.replace(/^\/Users\/[^/]+/,"~"):"—";return i.jsxs("tr",{className:"border-b border-border/20 last:border-0",children:[i.jsx("td",{className:"py-2 pr-3",children:i.jsx("button",{onClick:n,className:"text-muted-foreground hover:text-foreground",children:t?i.jsx(zn,{className:"h-4 w-4"}):i.jsx(yb,{className:"h-4 w-4"})})}),i.jsx("td",{className:"py-2 pr-3",children:e.projectSlug?i.jsx(De,{to:`${a}/projects/${e.projectSlug}`,className:"block truncate text-primary hover:underline",title:fn(e.projectSlug),children:fn(e.projectSlug)}):e.assignmentSlug?i.jsx("span",{className:"rounded bg-muted px-1.5 py-0.5 text-[10px] font-mono uppercase tracking-wide text-muted-foreground",children:"Standalone"}):i.jsx("span",{className:"text-muted-foreground",children:"—"})}),i.jsx("td",{className:"py-2 pr-3",children:e.projectSlug&&e.assignmentSlug?i.jsx(De,{to:`${a}/projects/${e.projectSlug}/assignments/${e.assignmentSlug}`,className:"block truncate text-primary hover:underline",title:fn(e.assignmentSlug),children:fn(e.assignmentSlug)}):e.assignmentSlug?i.jsx(De,{to:`/assignments/${e.assignmentSlug}`,className:"block truncate font-mono text-primary hover:underline",title:e.assignmentSlug,children:e.assignmentSlug}):i.jsx("span",{className:"text-muted-foreground",children:"—"})}),i.jsx("td",{className:"py-2 pr-3",children:e.description?i.jsx("div",{className:"truncate text-xs text-muted-foreground",title:e.description,children:e.description}):i.jsx("span",{className:"text-muted-foreground",children:"—"})}),i.jsx("td",{className:"py-2 pr-3",children:i.jsxs("span",{className:"flex min-w-0 items-center gap-1.5",children:[i.jsx(Ic,{className:"h-3 w-3 shrink-0 text-muted-foreground"}),i.jsx("span",{className:"truncate",children:e.agent})]})}),i.jsx("td",{className:"py-2 pr-3",children:i.jsxs("span",{className:"flex min-w-0 items-center gap-1.5",children:[i.jsx("span",{className:"truncate font-mono text-xs text-muted-foreground",title:e.sessionId,children:l}),i.jsx(qr,{value:e.sessionId})]})}),i.jsx("td",{className:"py-2 pr-3 text-xs text-muted-foreground",children:i.jsx("span",{className:"truncate block",children:Er(e.started)})}),i.jsx("td",{className:"py-2 pr-3",children:i.jsxs("span",{className:"flex min-w-0 items-center gap-1.5",children:[i.jsx("span",{className:"truncate text-xs text-muted-foreground",title:e.path,children:c}),e.path&&i.jsx(qr,{value:e.path})]})}),i.jsx("td",{className:"py-2 pr-3",children:e.transcriptPath?i.jsxs("span",{className:"flex min-w-0 items-center gap-1.5",children:[i.jsx("span",{className:"truncate font-mono text-xs text-muted-foreground",title:e.transcriptPath,children:d}),i.jsx(qr,{value:e.transcriptPath})]}):i.jsx("span",{className:"text-muted-foreground",children:"—"})}),i.jsx("td",{className:"py-2",children:i.jsx("button",{onClick:o,className:"text-muted-foreground hover:text-destructive",title:"Delete session",children:i.jsx(Ro,{className:"h-3.5 w-3.5"})})})]})}function ZM(e){const t=new Date(e);if(Number.isNaN(t.getTime()))return null;const n=t.getFullYear(),o=String(t.getMonth()+1).padStart(2,"0"),a=String(t.getDate()).padStart(2,"0");return`${n}-${o}-${a}`}function tc(e){const t=Date.parse(e.started),n=e.ended?Date.parse(e.ended):Date.now();return Number.isNaN(t)||Number.isNaN(n)?0:Math.max(0,Math.floor((n-t)/6e4))}function e_(e,t,n){switch(n){case"started_asc":return e.started.localeCompare(t.started);case"started_desc":return t.started.localeCompare(e.started);case"duration_asc":return tc(e)-tc(t);case"duration_desc":return tc(t)-tc(e);case"assignment_asc":return(e.assignmentSlug??"").localeCompare(t.assignmentSlug??"")||(e.projectSlug??"").localeCompare(t.projectSlug??"");case"agent_asc":return e.agent.localeCompare(t.agent)||(e.assignmentSlug??"").localeCompare(t.assignmentSlug??"");default:return 0}}function t_(){const{data:e,loading:t,error:n,refetch:o}=Ub(),[a,l]=g.useState(""),[c,d]=g.useState(null),p=g.useMemo(()=>{if(!(e!=null&&e.playbooks))return[];if(!a.trim())return e.playbooks;const h=a.toLowerCase();return e.playbooks.filter(x=>x.name.toLowerCase().includes(h)||x.description.toLowerCase().includes(h)||x.slug.toLowerCase().includes(h)||x.tags.some(v=>v.toLowerCase().includes(h)))},[e,a]);async function m(h,x,v){if(h.preventDefault(),h.stopPropagation(),!c){d(x);try{const b=v?"disable":"enable",C=await fetch(`/api/playbooks/${encodeURIComponent(x)}/${b}`,{method:"POST"});if(!C.ok){const k=await C.json().catch(()=>({}));throw new Error(k.error||`Failed to ${b} playbook`)}o()}catch(b){console.error(b),alert(b instanceof Error?b.message:"Failed to update playbook")}finally{d(null)}}}return t?i.jsx(kt,{label:"Loading playbooks..."}):n?i.jsx(gt,{error:n}):i.jsxs("div",{className:"space-y-4",children:[i.jsxs("div",{className:"flex items-center justify-between gap-4",children:[i.jsxs("div",{className:"relative flex-1 max-w-sm",children:[i.jsx(Xs,{className:"absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground"}),i.jsx("input",{type:"text",placeholder:"Search playbooks...",value:a,onChange:h=>l(h.target.value),className:"h-9 w-full rounded-md border border-border/70 bg-background pl-9 pr-3 text-sm text-foreground placeholder:text-muted-foreground/60 focus:border-foreground/30 focus:outline-none"})]}),i.jsxs(De,{to:"/playbooks/create",className:"inline-flex h-9 items-center gap-2 rounded-md bg-foreground px-3 text-sm font-medium text-background transition hover:bg-foreground/90",children:[i.jsx(Un,{className:"h-4 w-4"}),"Create Playbook"]})]}),i.jsxs(De,{to:"/playbooks/manifest",className:"surface-panel group flex items-center gap-3 p-3 transition hover:border-foreground/20",children:[i.jsx(pb,{className:"h-5 w-5 shrink-0 text-muted-foreground"}),i.jsxs("div",{className:"min-w-0 flex-1",children:[i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx("h3",{className:"text-sm font-semibold text-foreground group-hover:underline",children:"Playbook Manifest"}),i.jsx("span",{className:"rounded-full border border-border/60 bg-muted/50 px-2 py-0.5 text-[10px] text-muted-foreground",children:"auto-generated"})]}),i.jsxs("p",{className:"mt-0.5 text-xs text-muted-foreground",children:["Index of all playbooks with descriptions. Include ",i.jsx("code",{className:"rounded bg-muted px-1 py-0.5 text-[11px]",children:"~/.syntaur/playbooks/manifest.md"})," in your CLAUDE.md for agent context."]})]})]}),p.length===0?i.jsx(rt,{title:"No playbooks found",description:(e==null?void 0:e.playbooks.length)===0?"Playbooks define rules and workflows for how agents should operate. Create your first one to get started.":"No playbooks match your search.",actions:(e==null?void 0:e.playbooks.length)===0?i.jsxs(De,{to:"/playbooks/create",className:"inline-flex items-center gap-2 rounded-md bg-foreground px-3 py-2 text-sm font-medium text-background transition hover:bg-foreground/90",children:[i.jsx(Un,{className:"h-4 w-4"}),"Create Playbook"]}):void 0}):i.jsx("div",{className:"grid gap-3 sm:grid-cols-2 lg:grid-cols-3",children:p.map(h=>{const x=c===h.slug;return i.jsxs("div",{className:`surface-panel relative flex flex-col gap-2 p-4 transition hover:border-foreground/20 ${h.enabled?"":"opacity-75"}`,children:[i.jsxs(De,{to:`/playbooks/${h.slug}`,className:"group flex flex-col gap-2",children:[i.jsxs("div",{className:"flex items-start gap-2",children:[i.jsx(ub,{className:"mt-0.5 h-4 w-4 shrink-0 text-muted-foreground"}),i.jsxs("div",{className:"min-w-0 flex-1",children:[i.jsx("h3",{className:"text-sm font-semibold text-foreground group-hover:underline",children:h.name}),h.description?i.jsx("p",{className:"mt-1 text-xs leading-5 text-muted-foreground line-clamp-2",children:h.description}):null]})]}),i.jsx("div",{className:"flex items-center gap-2 pt-1 pr-20",children:i.jsxs("div",{className:"flex flex-wrap gap-1",children:[h.tags.slice(0,3).map(v=>i.jsxs("span",{className:"inline-flex items-center gap-1 rounded-full border border-border/60 bg-muted/50 px-2 py-0.5 text-[10px] text-muted-foreground",children:[i.jsx(vb,{className:"h-2.5 w-2.5"}),v]},v)),h.tags.length>3?i.jsxs("span",{className:"text-[10px] text-muted-foreground/60",children:["+",h.tags.length-3]}):null]})})]}),i.jsx("button",{type:"button",role:"switch","aria-checked":h.enabled,"aria-label":h.enabled?"Disable playbook":"Enable playbook",onClick:v=>m(v,h.slug,h.enabled),disabled:x,className:`absolute bottom-3 right-3 z-10 inline-flex h-5 w-9 items-center rounded-full border opacity-100 transition disabled:opacity-50 ${h.enabled?"border-status-completed-foreground/60 bg-status-completed-foreground/80":"border-foreground/40 bg-foreground/15"}`,children:i.jsx("span",{className:`block h-4 w-4 rounded-full shadow-sm transition-transform ${h.enabled?"translate-x-[18px] bg-background":"translate-x-[2px] bg-foreground/70"}`})})]},h.slug)})})]})}function n_(){const{slug:e}=At(),t=Ut(),{data:n,loading:o,error:a,refetch:l}=OE(e),[c,d]=g.useState(!1),[p,m]=g.useState(!1),[h,x]=g.useState(!1),v=e==="manifest";async function b(){if(e){m(!0);try{(await fetch(`/api/playbooks/${e}`,{method:"DELETE"})).ok&&t("/playbooks")}finally{m(!1)}}}async function C(){if(!(!e||!n)){x(!0);try{const k=n.enabled?"disable":"enable",j=await fetch(`/api/playbooks/${encodeURIComponent(e)}/${k}`,{method:"POST"});if(!j.ok){const S=await j.json().catch(()=>({}));throw new Error(S.error||`Failed to ${k} playbook`)}l()}catch(k){console.error(k),alert(k instanceof Error?k.message:"Failed to update playbook")}finally{x(!1)}}}return o?i.jsx(kt,{label:"Loading playbook..."}):a?i.jsx(gt,{error:a}):n?i.jsxs("div",{className:"space-y-6",children:[i.jsxs("div",{className:"flex items-start justify-between gap-4",children:[i.jsxs("div",{className:"min-w-0",children:[i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx("h2",{className:"text-lg font-semibold text-foreground",children:v?"Playbook Manifest":n.name}),v?i.jsx("span",{className:"rounded-full border border-border/60 bg-muted/50 px-2 py-0.5 text-xs text-muted-foreground",children:"auto-generated"}):null]}),!v&&n.description?i.jsx("p",{className:"mt-1 text-sm text-muted-foreground",children:n.description}):null,v?i.jsxs("p",{className:"mt-1 text-sm text-muted-foreground",children:["This file is rebuilt automatically when playbooks are added or removed. Include"," ",i.jsx("code",{className:"rounded bg-muted px-1 py-0.5 text-xs",children:"~/.syntaur/playbooks/manifest.md"})," ","in your CLAUDE.md for agent context."]}):null,!v&&n.whenToUse?i.jsxs("p",{className:"mt-2 text-sm text-muted-foreground italic",children:["When to use: ",n.whenToUse]}):null,i.jsxs("div",{className:"mt-3 flex flex-wrap items-center gap-3 text-xs text-muted-foreground",children:[i.jsxs("span",{children:["Created ",Er(n.created)]}),i.jsxs("span",{children:["Updated ",Er(n.updated)]})]}),n.tags.length>0?i.jsx("div",{className:"mt-2 flex flex-wrap gap-1.5",children:n.tags.map(k=>i.jsxs("span",{className:"inline-flex items-center gap-1 rounded-full border border-border/60 bg-muted/50 px-2 py-0.5 text-xs text-muted-foreground",children:[i.jsx(vb,{className:"h-3 w-3"}),k]},k))}):null]}),v?null:i.jsxs("div",{className:"flex shrink-0 items-center gap-3",children:[i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:n.enabled?"Enabled":"Disabled"}),i.jsx("button",{type:"button",role:"switch","aria-checked":n.enabled,"aria-label":n.enabled?"Disable playbook":"Enable playbook",onClick:C,disabled:h,className:`inline-flex h-5 w-9 items-center rounded-full border transition disabled:opacity-50 ${n.enabled?"border-status-completed-foreground/60 bg-status-completed-foreground/80":"border-foreground/40 bg-foreground/15"}`,children:i.jsx("span",{className:`block h-4 w-4 rounded-full shadow-sm transition-transform ${n.enabled?"translate-x-[18px] bg-background":"translate-x-[2px] bg-foreground/70"}`})})]}),i.jsxs(De,{to:`/playbooks/${e}/edit`,className:"inline-flex h-8 items-center gap-1.5 rounded-md border border-border/70 bg-background px-3 text-xs font-medium text-foreground transition hover:bg-muted",children:[i.jsx(PC,{className:"h-3 w-3"}),"Edit"]}),c?i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx("button",{type:"button",onClick:b,disabled:p,className:"inline-flex h-8 items-center gap-1.5 rounded-md bg-destructive px-3 text-xs font-medium text-destructive-foreground transition hover:bg-destructive/90 disabled:opacity-50",children:p?"Deleting...":"Confirm"}),i.jsx("button",{type:"button",onClick:()=>d(!1),className:"inline-flex h-8 items-center rounded-md border border-border/70 bg-background px-3 text-xs font-medium text-foreground transition hover:bg-muted",children:"Cancel"})]}):i.jsxs("button",{type:"button",onClick:()=>d(!0),className:"inline-flex h-8 items-center gap-1.5 rounded-md border border-border/70 bg-background px-3 text-xs font-medium text-destructive transition hover:bg-destructive/10",children:[i.jsx(Ro,{className:"h-3 w-3"}),"Delete"]})]})]}),i.jsx("div",{className:"surface-panel p-4",children:i.jsx(Yt,{content:n.body})})]}):null}function r_(){const e=Ut(),[t,n]=g.useState(null),[o,a]=g.useState(!0),[l,c]=g.useState(!1),[d,p]=g.useState(null);g.useEffect(()=>{fetch("/api/playbooks/template/new").then(h=>h.json()).then(h=>{n(h.content),a(!1)}).catch(h=>{p(h.message),a(!1)})},[]);async function m(h){c(!0),p(null);try{const x=await fetch("/api/playbooks",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({content:h})}),v=await x.json();if(!x.ok){p(v.error||`HTTP ${x.status}`),c(!1);return}e(`/playbooks/${v.slug}`)}catch(x){p(x.message),c(!1);return}c(!1)}return o?i.jsx(kt,{label:"Loading playbook template..."}):d&&!t?i.jsx(gt,{error:d}):i.jsx(ai,{initialContent:t||"",documentType:"playbook",mode:"create",onSave:m,saving:l,error:d,title:"Create Playbook",description:"Playbooks define rules and workflows for how agents should operate. Keep them short, imperative, and focused on a single concern.",onCancel:()=>e("/playbooks"),allowSlugEdit:!0})}function o_(){const{slug:e}=At(),t=Ut(),[n,o]=g.useState(null),[a,l]=g.useState(!0),[c,d]=g.useState(!1),[p,m]=g.useState(null);g.useEffect(()=>{e&&fetch(`/api/playbooks/${e}/edit`).then(x=>x.json()).then(x=>{o(x.content),l(!1)}).catch(x=>{m(x.message),l(!1)})},[e]);async function h(x){if(e){d(!0),m(null);try{const v=await fetch(`/api/playbooks/${e}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({content:x})}),b=await v.json();if(!v.ok){m(b.error||`HTTP ${v.status}`),d(!1);return}t(`/playbooks/${e}`)}catch(v){m(v.message),d(!1);return}d(!1)}}return a?i.jsx(kt,{label:"Loading playbook..."}):p&&!n?i.jsx(gt,{error:p}):i.jsx(ai,{initialContent:n||"",documentType:"playbook",mode:"edit",onSave:h,saving:c,error:p,title:"Edit Playbook",onCancel:()=>t(`/playbooks/${e}`)})}function s_({value:e,onChange:t}){return i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx("input",{type:"color",value:e||"#64748b",onChange:n=>t(n.target.value),className:"h-7 w-7 shrink-0 cursor-pointer rounded-md border border-border/60 bg-transparent p-0.5",title:"Pick a color"}),i.jsx("input",{type:"text",value:e,onChange:n=>t(n.target.value),placeholder:"#64748b",className:"editor-input w-[5.5rem] font-mono text-xs"})]})}const Np=["projects","playbooks","todos","servers","config"];function i_(e){const t=new Set;for(const n of e.split(",").map(o=>o.trim()))Np.includes(n)&&t.add(n);return t}function zv(e){if(!e)return"never";try{return new Date(e).toLocaleString()}catch{return e}}function a_(){const[e,t]=g.useState(!0),[n,o]=g.useState(null),[a,l]=g.useState(""),[c,d]=g.useState(new Set(Np)),[p,m]=g.useState(!1),[h,x]=g.useState(!1),[v,b]=g.useState(null),[C,k]=g.useState(null),j=g.useCallback(async()=>{try{const T=await fetch("/api/backup");if(!T.ok)throw new Error(`HTTP ${T.status}`);const D=await T.json();o(D),l(D.repo??""),d(i_(D.categories)),m(!1)}catch(T){k({type:"error",message:`Failed to load backup config: ${T instanceof Error?T.message:String(T)}`})}finally{t(!1)}},[]);g.useEffect(()=>{j()},[j]);function S(T){d(D=>{const L=new Set(D);return L.has(T)?L.delete(T):L.add(T),L}),m(!0)}async function R(){x(!0),k(null);try{const T=Array.from(c),D=await fetch("/api/backup/config",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({repo:a.trim()||null,categories:T})}),L=await D.json();if(!D.ok)throw new Error(L.error||`HTTP ${D.status}`);o(L),m(!1),k({type:"success",message:"Backup configuration saved."})}catch(T){k({type:"error",message:`Save failed: ${T instanceof Error?T.message:String(T)}`})}finally{x(!1)}}async function N(){b("push"),k(null);try{const T=await fetch("/api/backup/push",{method:"POST"}),D=await T.json();if(!T.ok||D.success===!1)throw new Error(D.error||D.message||`HTTP ${T.status}`);k({type:"success",message:D.message||"Backup complete."}),await j()}catch(T){k({type:"error",message:`Backup failed: ${T instanceof Error?T.message:String(T)}`})}finally{b(null)}}async function A(){if(window.confirm("Restore will overwrite local files for the selected categories with the contents of the GitHub repo. This cannot be undone. Continue?")){b("pull"),k(null);try{const D=await fetch("/api/backup/pull",{method:"POST"}),L=await D.json();if(!D.ok||L.success===!1)throw new Error(L.error||L.message||`HTTP ${D.status}`);k({type:"success",message:L.message||"Restore complete."}),await j()}catch(D){k({type:"error",message:`Restore failed: ${D instanceof Error?D.message:String(D)}`})}finally{b(null)}}}if(e)return i.jsx(Ie,{title:"GitHub Backup",description:"Back up Syntaur files to a GitHub repository",children:i.jsx("p",{className:"text-sm text-muted-foreground",children:"Loading..."})});const O=!!a.trim()&&c.size>0&&!v&&!p;return i.jsx(Ie,{title:"GitHub Backup",description:"Back up Syntaur files to a GitHub repository and restore from it",children:i.jsxs("div",{className:"space-y-4",children:[C&&i.jsx("div",{className:`rounded-lg border px-4 py-2 text-sm ${C.type==="success"?"border-success-foreground/30 bg-success text-success-foreground":"border-error-foreground/30 bg-error text-error-foreground"}`,children:C.message}),i.jsxs("div",{className:"space-y-2",children:[i.jsx("label",{className:"text-xs font-medium uppercase tracking-wider text-muted-foreground",children:"Repository URL"}),i.jsx("input",{type:"text",value:a,onChange:T=>{l(T.target.value),m(!0)},placeholder:"git@github.com:you/syntaur-backup.git",className:"editor-input w-full text-sm"}),i.jsxs("p",{className:"text-xs text-muted-foreground",children:["SSH or HTTPS URL. Requires ",i.jsx("code",{className:"rounded bg-muted px-1",children:"git"})," installed and credentials configured locally."]})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx("label",{className:"text-xs font-medium uppercase tracking-wider text-muted-foreground",children:"Categories to back up"}),i.jsx("div",{className:"flex flex-wrap gap-2",children:Np.map(T=>{const D=c.has(T);return i.jsxs("button",{type:"button",onClick:()=>S(T),className:`shell-action text-xs ${D?"bg-primary/10 text-primary hover:bg-primary/20":"bg-muted/30 text-muted-foreground hover:bg-muted/60"}`,children:[i.jsx("span",{className:`mr-1 inline-block h-2 w-2 rounded-full ${D?"bg-primary":"bg-muted-foreground/40"}`}),T]},T)})})]}),i.jsxs("div",{className:"grid grid-cols-1 gap-2 text-xs text-muted-foreground sm:grid-cols-2",children:[i.jsxs("div",{children:[i.jsx("span",{className:"font-medium text-foreground",children:"Last backup: "}),zv((n==null?void 0:n.lastBackup)??null)]}),i.jsxs("div",{children:[i.jsx("span",{className:"font-medium text-foreground",children:"Last restore: "}),zv((n==null?void 0:n.lastRestore)??null)]}),(n==null?void 0:n.locked)&&i.jsx("div",{className:"sm:col-span-2 text-warning-foreground",children:"⚠ A backup operation is in progress or the lock file is stale."})]}),i.jsxs("div",{className:"flex flex-wrap items-center gap-3 pt-2",children:[i.jsxs("button",{className:"shell-action bg-primary/10 text-primary hover:bg-primary/20",onClick:R,disabled:h||!p,children:[i.jsx(_p,{className:"h-3.5 w-3.5"}),h?"Saving...":"Save Config"]}),i.jsxs("button",{className:"shell-action",onClick:N,disabled:!O,title:O?"Back up now":p?"Save config first":"Set repo and pick categories",children:[i.jsx(_C,{className:"h-3.5 w-3.5"}),v==="push"?"Backing up...":"Back Up Now"]}),i.jsxs("button",{className:"shell-action",onClick:A,disabled:!O,title:O?"Restore from backup":p?"Save config first":"Set repo and pick categories",children:[i.jsx(hC,{className:"h-3.5 w-3.5"}),v==="pull"?"Restoring...":"Restore"]}),p&&i.jsx("span",{className:"text-xs text-muted-foreground",children:"Unsaved changes"})]}),i.jsxs("p",{className:"flex items-start gap-2 rounded-md border border-border/40 bg-muted/20 p-3 text-xs text-muted-foreground",children:[i.jsx(fC,{className:"mt-0.5 h-3.5 w-3.5 shrink-0"}),i.jsxs("span",{children:["Restore never overwrites ",i.jsx("code",{className:"rounded bg-muted px-1",children:"config.md"})," (would clobber backup settings). The agent sessions database is not backed up — only markdown files."]})]})]})})}function l_(){const{customBindings:e,userBindings:t,actionEntries:n,findConflict:o,bindAction:a,unbindAction:l}=Ao(),[c,d]=g.useState(null),[p,m]=g.useState(null),[h,x]=g.useState(!1),v=Object.values(t).some(N=>typeof N=="string"&&N.length>0);function b(N,A){m({type:N,message:A}),setTimeout(()=>m(null),2500)}function C(N){d({kind:N,combo:null,conflict:null,saving:!1,error:null})}function k(N){if(!c||N.key==="Escape")return;if(N.key==="Enter"&&c.combo){N.preventDefault(),j();return}if(N.key==="Enter")return;N.preventDefault(),N.stopPropagation();const A=Hb(N.nativeEvent);if(!A)return;const O=o(A,c.kind);d({...c,combo:A,conflict:O,error:null})}async function j(){var N;if(c!=null&&c.combo){if((N=c.conflict)!=null&&N.description){d({...c,error:`Reserved: ${c.conflict.description}`});return}d({...c,saving:!0,error:null});try{await a(c.kind,c.combo),d(null),b("success",`Bound ${qi[c.kind]}`)}catch(A){d({...c,saving:!1,error:A instanceof Error?A.message:"Failed to save"})}}}async function S(N){try{await l(N),b("success",`Cleared ${qi[N]} binding`)}catch(A){b("error",A instanceof Error?A.message:"Failed to clear binding")}}async function R(){if(!h){x(!0);try{await JP(),b("success","All hotkey bindings cleared")}catch(N){b("error",N instanceof Error?N.message:"Failed to reset bindings")}finally{x(!1)}}}return i.jsxs(Ie,{title:"Hotkey Bindings",description:"Each canonical create action ships with a default hotkey that fires the action without opening the palette. Override any of them below — Clear restores the default.",actions:v?i.jsxs("button",{className:"shell-action text-xs",onClick:()=>void R(),disabled:h,children:[i.jsx(Gf,{className:"h-3 w-3"}),"Restore defaults"]}):void 0,children:[p?i.jsx("div",{className:`mb-3 rounded-md border px-3 py-1.5 text-xs ${p.type==="success"?"border-success-foreground/30 bg-success text-success-foreground":"border-error-foreground/30 bg-error text-error-foreground"}`,children:p.message}):null,i.jsx("ul",{className:"space-y-2",children:_c.map(N=>{var L,G;const A=n.find(re=>re.bindableKind===N),O=e[N],T=typeof t[N]=="string"&&!!t[N],D=(c==null?void 0:c.kind)===N;return i.jsxs("li",{className:"flex flex-wrap items-center gap-3 rounded-md border border-border/40 bg-background/60 px-3 py-2",children:[i.jsx(Kf,{className:"h-4 w-4 text-muted-foreground","aria-hidden":"true"}),i.jsxs("div",{className:"min-w-0 flex-1",children:[i.jsx("div",{className:"text-sm text-foreground",children:(A==null?void 0:A.title)??qi[N]}),A!=null&&A.subtitle?i.jsx("div",{className:"text-xs text-muted-foreground",children:A.subtitle}):null]}),O?i.jsxs("div",{className:"flex shrink-0 items-center gap-1.5",children:[i.jsx("kbd",{className:"rounded border border-border/70 bg-muted px-2 py-0.5 font-mono text-xs text-foreground",children:Pr(O)}),i.jsx("span",{className:`text-[10px] uppercase tracking-wide ${T?"text-primary":"text-muted-foreground"}`,children:T?"custom":"default"})]}):i.jsx("span",{className:"shrink-0 text-xs text-muted-foreground",children:"unbound"}),i.jsxs("div",{className:"flex items-center gap-1.5",children:[i.jsx("button",{type:"button",className:"shell-action text-xs",onClick:()=>C(N),children:O?"Rebind":"Bind"}),T?i.jsxs("button",{type:"button",className:"shell-action text-xs",onClick:()=>void S(N),"aria-label":`Restore default ${qi[N]} binding`,children:[i.jsx($p,{className:"h-3 w-3"}),"Restore default"]}):null]}),D?i.jsx("div",{className:"mt-2 w-full rounded-md border border-primary/40 bg-primary/5 px-3 py-3 text-center outline-none",tabIndex:0,autoFocus:!0,onKeyDown:k,onBlur:()=>{(c==null?void 0:c.kind)===N&&!c.saving&&d(null)},children:c!=null&&c.combo?i.jsxs("div",{className:"space-y-2",children:[i.jsx("div",{className:"text-base font-semibold tracking-wide text-foreground",children:Pr(c.combo)}),(L=c.conflict)!=null&&L.description?i.jsxs("div",{className:"text-xs text-destructive",children:["Reserved: ",c.conflict.description]}):(G=c.conflict)!=null&&G.kind?i.jsxs("div",{className:"text-xs text-amber-500 dark:text-amber-400",children:['Already bound to "',qi[c.conflict.kind],'". Press Enter to overwrite.']}):i.jsx("div",{className:"text-xs text-muted-foreground",children:"Press Enter to save, Esc to cancel, any other key to retry."}),c.error?i.jsx("div",{className:"text-xs text-destructive",children:c.error}):null]}):i.jsx("div",{className:"text-xs text-muted-foreground",children:"Press the key combination you want to bind…"})}):null]},N)})})]})}function Bf(e){return{statuses:e.statuses.map(t=>({id:t.id,label:t.label,description:t.description??"",color:t.color??"",terminal:t.terminal??!1})),order:[...e.order]}}function c_(){const[e,t]=g.useState(!0),[n,o]=g.useState(null),[a,l]=g.useState(!1),[c,d]=g.useState([]),[p,m]=g.useState([]),[h,x]=g.useState(!1),[v,b]=g.useState(null),[C,k]=g.useState(!1),{preset:j,setPreset:S,resetPreset:R}=Bp(),[N,A]=g.useState(!1),[O,T]=g.useState(null);async function D(B){if(!(B===j||N)){A(!0),T(null);try{await S(B),T({type:"success",message:"Theme updated"}),setTimeout(()=>T(null),2e3)}catch(U){T({type:"error",message:U instanceof Error?U.message:"Failed to save theme"})}finally{A(!1)}}}async function L(){A(!0),T(null);try{await R(),T({type:"success",message:"Theme reset to default"}),setTimeout(()=>T(null),2e3)}catch(B){T({type:"error",message:B instanceof Error?B.message:"Failed to reset theme"})}finally{A(!1)}}const G=g.useCallback(async()=>{try{const B=await fetch("/api/config/statuses");if(!B.ok)throw new Error(`HTTP ${B.status}`);const U=await B.json(),Z=Bf(U);d(Z.statuses),m(Z.order),l(U.custom),k(!1),o(null)}catch(B){o(B instanceof Error?B.message:"Failed to load config")}finally{t(!1)}},[]);g.useEffect(()=>{G()},[G]);function re(){setTimeout(()=>b(null),3e3)}async function z(){x(!0),b(null);try{const B={statuses:c.map(M=>({id:M.id,label:M.label,...M.description?{description:M.description}:{},...M.color?{color:M.color}:{},...M.terminal?{terminal:!0}:{}})),order:p,transitions:[]},U=await fetch("/api/config/statuses",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(B)});if(!U.ok){const M=await U.json().catch(()=>({error:"Unknown error"}));throw new Error(M.error??"Save failed")}const Z=await U.json(),P=Bf(Z);d(P.statuses),m(P.order),l(Z.custom),k(!1),cy(),b({type:"success",message:"Status config saved"}),re()}catch(B){b({type:"error",message:B instanceof Error?B.message:"Save failed"})}finally{x(!1)}}async function K(){x(!0),b(null);try{const B=await fetch("/api/config/statuses",{method:"DELETE"});if(!B.ok)throw new Error("Reset failed");const U=await B.json(),Z=Bf(U);d(Z.statuses),m(Z.order),l(U.custom),k(!1),cy(),b({type:"success",message:"Reset to defaults"}),re()}catch(B){b({type:"error",message:B instanceof Error?B.message:"Reset failed"})}finally{x(!1)}}function q(B,U,Z){d(P=>{const M=[...P];if(M[B]={...M[B],[U]:Z},U==="id"&&typeof Z=="string"){const Q=P[B].id;m(I=>I.map(ge=>ge===Q?Z:ge))}return M}),k(!0)}function J(){const B=`status_${c.length+1}`;d(U=>[...U,{id:B,label:"New Status",description:"",color:"",terminal:!1}]),m(U=>[...U,B]),k(!0)}function _(B){const U=c[B].id;d(Z=>Z.filter((P,M)=>M!==B)),m(Z=>Z.filter(P=>P!==U)),k(!0)}function F(B,U){const Z=B+U;Z<0||Z>=p.length||(m(P=>{const M=[...P];return[M[B],M[Z]]=[M[Z],M[B]],M}),k(!0))}return e?i.jsx(kt,{label:"Loading settings..."}):n?i.jsx(gt,{error:n}):i.jsx(la,{children:i.jsxs("div",{className:"space-y-6",children:[i.jsxs(Ie,{title:"Theme",description:"Pick a color theme for the dashboard. The default is the Syntaur brand.",actions:j!=="default"?i.jsxs("button",{className:"shell-action text-xs",onClick:L,disabled:N,children:[i.jsx(Gf,{className:"h-3 w-3"}),"Reset"]}):void 0,children:[O&&i.jsx("div",{className:`mb-3 rounded-md border px-3 py-1.5 text-xs ${O.type==="success"?"border-success-foreground/30 bg-success text-success-foreground":"border-error-foreground/30 bg-error text-error-foreground"}`,children:O.message}),i.jsx("div",{className:"grid grid-cols-1 gap-3 sm:grid-cols-2 lg:grid-cols-4",children:Tb.map(B=>{const U=B.slug===j;return i.jsxs("button",{type:"button",onClick:()=>D(B.slug),disabled:N,"aria-pressed":U,className:`group relative flex flex-col gap-2 rounded-lg border bg-card/95 p-3 text-left transition disabled:opacity-60 ${U?"border-primary ring-2 ring-primary/40":"border-border/60 hover:border-primary/40"}`,children:[i.jsxs("div",{className:"flex items-center gap-1.5",children:[i.jsx("span",{className:"h-5 w-5 rounded-full ring-1 ring-border/60",style:{background:B.swatches.primary}}),i.jsx("span",{className:"h-5 w-5 rounded-full ring-1 ring-border/60",style:{background:B.swatches.secondary}}),i.jsx("span",{className:"h-5 w-5 rounded-full ring-1 ring-border/60",style:{background:B.swatches.coral}}),i.jsx("span",{className:"h-5 w-5 rounded-full ring-1 ring-border/60",style:{background:B.swatches.teal}}),i.jsx("span",{className:"h-5 w-5 rounded-full ring-1 ring-border/60",style:{background:B.swatches.amber}}),U&&i.jsx("span",{className:"ml-auto inline-flex h-5 w-5 items-center justify-center rounded-full bg-primary text-primary-foreground",children:i.jsx(Sa,{className:"h-3 w-3"})})]}),i.jsxs("div",{children:[i.jsx("div",{className:"text-sm font-medium text-foreground",children:B.label}),i.jsx("div",{className:"text-xs text-muted-foreground",children:B.description})]})]},B.slug)})})]}),i.jsx(l_,{}),i.jsxs("div",{className:`flex items-center justify-between rounded-lg border px-4 py-3 text-sm ${a?"border-primary/30 bg-primary/5 text-primary":"border-border/60 bg-muted/30 text-muted-foreground"}`,children:[i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx(mb,{className:"h-4 w-4"}),a?"Using custom status configuration from ~/.syntaur/config.md":"Using default status configuration"]}),i.jsxs("button",{className:"shell-action text-xs",onClick:K,disabled:h||!a&&!C,children:[i.jsx(Gf,{className:"h-3 w-3"}),"Reset to Defaults"]})]}),v&&i.jsx("div",{className:`rounded-lg border px-4 py-2 text-sm ${v.type==="success"?"border-success-foreground/30 bg-success text-success-foreground":"border-error-foreground/30 bg-error text-error-foreground"}`,children:v.message}),i.jsx(Ie,{title:"Status Definitions",description:"Define the statuses assignments can have",actions:i.jsxs("button",{className:"shell-action text-xs",onClick:J,children:[i.jsx(Un,{className:"h-3 w-3"}),"Add Status"]}),children:i.jsx("div",{className:"overflow-x-auto",children:i.jsxs("table",{className:"w-full text-sm",children:[i.jsx("thead",{children:i.jsxs("tr",{className:"border-b border-border/50 text-left text-xs font-medium uppercase tracking-wider text-muted-foreground",children:[i.jsx("th",{className:"pb-2 pr-3",children:"ID"}),i.jsx("th",{className:"pb-2 pr-3",children:"Label"}),i.jsx("th",{className:"pb-2 pr-3",children:"Color"}),i.jsx("th",{className:"pb-2 pr-3",children:i.jsxs(ca,{children:[i.jsx(ua,{asChild:!0,children:i.jsx("span",{className:"cursor-help underline decoration-dotted underline-offset-4",children:"Done State"})}),i.jsx(Hs,{className:"max-w-xs text-xs font-normal normal-case tracking-normal",children:'When enabled, assignments in this status count as finished — they fill the "done" portion of progress bars and satisfy dependency requirements.'})]})}),i.jsx("th",{className:"pb-2 w-10"})]})}),i.jsx("tbody",{className:"divide-y divide-border/30",children:c.map((B,U)=>i.jsxs("tr",{children:[i.jsx("td",{className:"py-2 pr-3",children:i.jsx("input",{type:"text",value:B.id,onChange:Z=>q(U,"id",Z.target.value),className:"editor-input w-full text-sm"})}),i.jsx("td",{className:"py-2 pr-3",children:i.jsx("input",{type:"text",value:B.label,onChange:Z=>q(U,"label",Z.target.value),className:"editor-input w-full text-sm"})}),i.jsx("td",{className:"py-2 pr-3",children:i.jsx(s_,{value:B.color,onChange:Z=>q(U,"color",Z)})}),i.jsx("td",{className:"py-2 pr-3",children:i.jsx("button",{type:"button",role:"switch","aria-checked":B.terminal,onClick:()=>q(U,"terminal",!B.terminal),className:`relative inline-flex h-5 w-9 shrink-0 cursor-pointer rounded-full border-2 border-transparent transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary focus-visible:ring-offset-2 focus-visible:ring-offset-background ${B.terminal?"bg-primary":"bg-muted"}`,children:i.jsx("span",{className:`pointer-events-none inline-block h-4 w-4 rounded-full bg-background shadow-sm ring-0 transition-transform ${B.terminal?"translate-x-4":"translate-x-0"}`})})}),i.jsx("td",{className:"py-2",children:i.jsx("button",{className:"inline-flex h-7 w-7 items-center justify-center rounded-md text-muted-foreground hover:bg-muted hover:text-foreground",onClick:()=>_(U),title:"Remove status",children:i.jsx(Ro,{className:"h-3.5 w-3.5"})})})]},U))})]})})}),i.jsx(Ie,{title:"Status Order",description:"Controls display order in the dashboard (Kanban columns, progress bars, dropdowns)",children:i.jsx("div",{className:"space-y-1",children:p.map((B,U)=>{var P;const Z=((P=c.find(M=>M.id===B))==null?void 0:P.label)??B;return i.jsxs("div",{className:"flex items-center gap-2 rounded-md border border-border/40 bg-background/60 px-3 py-2 text-sm",children:[i.jsx("span",{className:"mr-1 font-mono text-xs text-muted-foreground/60",children:U+1}),i.jsx("span",{className:"flex-1 font-medium",children:Z}),i.jsx("span",{className:"text-xs text-muted-foreground",children:B}),i.jsx("button",{className:"inline-flex h-6 w-6 items-center justify-center rounded text-muted-foreground hover:bg-muted hover:text-foreground disabled:opacity-30",onClick:()=>F(U,-1),disabled:U===0,title:"Move up",children:i.jsx(db,{className:"h-3.5 w-3.5"})}),i.jsx("button",{className:"inline-flex h-6 w-6 items-center justify-center rounded text-muted-foreground hover:bg-muted hover:text-foreground disabled:opacity-30",onClick:()=>F(U,1),disabled:U===p.length-1,title:"Move down",children:i.jsx(ma,{className:"h-3.5 w-3.5"})})]},U)})})}),i.jsxs("div",{className:"flex items-center gap-3",children:[i.jsxs("button",{className:"shell-action bg-primary/10 text-primary hover:bg-primary/20",onClick:z,disabled:h||!C,children:[i.jsx(_p,{className:"h-3.5 w-3.5"}),h?"Saving...":"Save Configuration"]}),C&&i.jsxs(i.Fragment,{children:[i.jsx("button",{className:"shell-action text-xs",onClick:()=>{t(!0),G()},disabled:h,children:"Discard Changes"}),i.jsx("span",{className:"text-xs text-muted-foreground",children:"Unsaved changes"})]})]}),i.jsx(a_,{})]})})}function u_(){const{data:e,loading:t,error:n,refetch:o}=Wp(),[a,l]=g.useState(""),c=g.useRef(null);rs("list:todos");const[d,p]=g.useState(""),[m,h]=g.useState(""),[x,v]=g.useState(""),[b,C]=g.useState("_global"),[k,j]=g.useState(null);function S(_,F){_.stopPropagation(),navigator.clipboard.writeText(F),j(F),setTimeout(()=>j(B=>B===F?null:B),1500)}const R=g.useMemo(()=>{if(!(e!=null&&e.workspaces))return[];const _=[];for(const F of e.workspaces)for(const B of F.items)_.push({...B,workspace:F.workspace});return _},[e]),N=g.useMemo(()=>{const _=new Set;for(const F of R)for(const B of F.tags)_.add(B);return Array.from(_).sort()},[R]),A=g.useMemo(()=>{let _=R;if(a.trim()){const F=a.toLowerCase();_=_.filter(B=>B.description.toLowerCase().includes(F)||B.tags.some(U=>U.toLowerCase().includes(F))||B.id.includes(F))}return d&&(_=_.filter(F=>F.status===d)),m&&(_=_.filter(F=>F.tags.includes(m))),_},[R,a,d,m]),O=g.useMemo(()=>{if(!(e!=null&&e.workspaces))return{open:0,in_progress:0,completed:0,blocked:0,total:0};const _={open:0,in_progress:0,completed:0,blocked:0,total:0};for(const F of e.workspaces)_.open+=F.counts.open,_.in_progress+=F.counts.in_progress,_.completed+=F.counts.completed,_.blocked+=F.counts.blocked,_.total+=F.counts.total;return _},[e]);async function T(){x.trim()&&(await Vp(b,x.trim()),v(""),o())}const D={open:"in_progress",in_progress:"completed",completed:"open",blocked:"open"};function L(_,F,B){G(_,F,D[B]||"open")}async function G(_,F,B){switch(B){case"open":await Kb(_,F);break;case"in_progress":await qb(_,F);break;case"completed":await Wb(_,F);break;case"blocked":await Vb(_,F);break}o()}async function re(_,F){await Gb(_,F),o()}const{hotkeyRowProps:z}=Ca(A,{scope:"list:todos",bindO:!1,onOpen:_=>L(_.workspace,_.id,_.status)});ht({keys:"/",scope:"list:todos",description:"Focus filter",handler:()=>{var _;return(_=c.current)==null?void 0:_.focus()}}),ht({keys:"r",scope:"list:todos",description:"Refresh",handler:()=>o()});const[K,q]=To(),J=K.get("focus");return g.useEffect(()=>{if(!J)return;const _=document.querySelector(`[data-todo-id="${CSS.escape(J)}"]`);if(!_)return;_.scrollIntoView({block:"nearest"}),_.classList.add("ring-2","ring-primary/60");const F=window.setTimeout(()=>{_.classList.remove("ring-2","ring-primary/60"),q(B=>{const U=new URLSearchParams(B);return U.delete("focus"),U})},1500);return()=>window.clearTimeout(F)},[J,A.length,q]),t?i.jsx(kt,{label:"Loading todos..."}):n?i.jsx(gt,{error:n}):i.jsxs("div",{className:"space-y-4",children:[i.jsxs("div",{className:"grid gap-3 grid-cols-[repeat(auto-fill,minmax(140px,1fr))]",children:[i.jsx(nt,{label:"Open",value:O.open,icon:zn}),i.jsx(nt,{label:"In Progress",value:O.in_progress,icon:gb,tone:"info"}),i.jsx(nt,{label:"Blocked",value:O.blocked,icon:Qs,tone:"warn"}),i.jsx(nt,{label:"Completed",value:O.completed,icon:zn,tone:"default"})]}),i.jsx("div",{className:"surface-panel p-3",children:i.jsxs("div",{className:"flex gap-2",children:[i.jsxs("select",{value:b,onChange:_=>C(_.target.value),className:"h-9 rounded-md border border-border/70 bg-background px-2 text-sm text-foreground focus:border-foreground/30 focus:outline-none",children:[i.jsx("option",{value:"_global",children:"Global"}),e==null?void 0:e.workspaces.filter(_=>_.workspace!=="_global").map(_=>i.jsx("option",{value:_.workspace,children:_.workspace},_.workspace))]}),i.jsx("input",{type:"text",placeholder:"Add a todo...",value:x,onChange:_=>v(_.target.value),onKeyDown:_=>_.key==="Enter"&&T(),className:"h-9 flex-1 rounded-md border border-border/70 bg-background px-3 text-sm text-foreground placeholder:text-muted-foreground/60 focus:border-foreground/30 focus:outline-none"}),i.jsxs("button",{onClick:T,disabled:!x.trim(),className:"inline-flex h-9 items-center gap-1.5 rounded-md bg-foreground px-3 text-sm font-medium text-background transition hover:bg-foreground/90 disabled:opacity-40",children:[i.jsx(Un,{className:"h-4 w-4"}),"Add"]})]})}),i.jsxs("div",{className:"flex items-center gap-3",children:[i.jsxs("div",{className:"relative flex-1 max-w-sm",children:[i.jsx(Xs,{className:"absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground"}),i.jsx("input",{ref:c,type:"text",placeholder:"Search todos...",value:a,onChange:_=>l(_.target.value),className:"h-9 w-full rounded-md border border-border/70 bg-background pl-9 pr-3 text-sm text-foreground placeholder:text-muted-foreground/60 focus:border-foreground/30 focus:outline-none"})]}),i.jsxs("select",{value:d,onChange:_=>p(_.target.value),className:"h-9 rounded-md border border-border/70 bg-background px-2 text-sm text-foreground focus:border-foreground/30 focus:outline-none",children:[i.jsx("option",{value:"",children:"All statuses"}),i.jsx("option",{value:"open",children:"Open"}),i.jsx("option",{value:"in_progress",children:"In Progress"}),i.jsx("option",{value:"completed",children:"Completed"}),i.jsx("option",{value:"blocked",children:"Blocked"})]}),N.length>0&&i.jsxs("select",{value:m,onChange:_=>h(_.target.value),className:"h-9 rounded-md border border-border/70 bg-background px-2 text-sm text-foreground focus:border-foreground/30 focus:outline-none",children:[i.jsx("option",{value:"",children:"All tags"}),N.map(_=>i.jsxs("option",{value:_,children:["#",_]},_))]})]}),A.length===0?i.jsx(rt,{title:"No todos",description:"Add your first todo above or use the CLI: syntaur todo add"}):i.jsx("div",{className:"space-y-1",children:A.map((_,F)=>i.jsxs("div",{"data-todo-id":_.id,...z(F),className:"surface-panel flex items-center gap-3 px-3 py-2 group cursor-pointer hover:bg-foreground/[0.03] transition",onClick:()=>L(_.workspace,_.id,_.status),children:[i.jsx(Dh,{status:_.status,onChange:B=>G(_.workspace,_.id,B)}),i.jsxs("div",{className:"flex-1 min-w-0",children:[i.jsx("span",{className:`text-sm ${_.status==="completed"?"line-through text-muted-foreground":"text-foreground"}`,children:_.description}),_.tags.length>0&&i.jsx("span",{className:"ml-2 text-xs text-muted-foreground",children:_.tags.map(B=>`#${B}`).join(" ")})]}),i.jsx("span",{className:"text-xs text-muted-foreground/60 font-mono",children:_.workspace!=="_global"&&i.jsx(De,{to:`/w/${_.workspace}/todos`,className:"hover:text-foreground transition mr-2",onClick:B=>B.stopPropagation(),children:_.workspace})}),k===_.id?i.jsxs("span",{className:"text-xs text-status-completed-foreground flex items-center gap-1",children:[i.jsx(Sa,{className:"h-3 w-3"})," Copied to clipboard"]}):i.jsxs(i.Fragment,{children:[i.jsxs("button",{className:"text-xs text-muted-foreground/60 font-mono hover:text-foreground transition",onClick:B=>S(B,_.id),children:["t:",_.id]}),i.jsx("button",{className:"text-muted-foreground/40 hover:text-foreground transition",title:"Copy ID",onClick:B=>S(B,_.id),children:i.jsx(Oc,{className:"h-3 w-3"})})]}),i.jsx("button",{onClick:()=>re(_.workspace,_.id),className:"text-xs text-muted-foreground/40 hover:text-destructive transition opacity-0 group-hover:opacity-100",children:"delete"})]},`${_.workspace}-${_.id}`))})]})}function d_(){return i.jsx(VN,{children:i.jsx(eT,{children:i.jsx(bN,{children:i.jsxs(_e,{element:i.jsx(iT,{}),children:[i.jsx(_e,{path:"/",element:i.jsx(hT,{})}),i.jsx(_e,{path:"/projects",element:i.jsx(dy,{})}),i.jsx(_e,{path:"/assignments",element:i.jsx(Dv,{})}),i.jsx(_e,{path:"/assignments/new",element:i.jsx(Mv,{})}),i.jsx(_e,{path:"/assignments/:id",element:i.jsx(LM,{})}),i.jsx(_e,{path:"/assignments/:id/edit",element:i.jsx(Mf,{})}),i.jsx(_e,{path:"/assignments/:id/plan/edit",element:i.jsx(_f,{})}),i.jsx(_e,{path:"/assignments/:id/scratchpad/edit",element:i.jsx($f,{})}),i.jsx(_e,{path:"/assignments/:id/handoff/edit",element:i.jsx(Ff,{})}),i.jsx(_e,{path:"/assignments/:id/decision-record/edit",element:i.jsx(zf,{})}),i.jsx(_e,{path:"/attention",element:i.jsx(mT,{})}),i.jsx(_e,{path:"/servers",element:i.jsx($v,{})}),i.jsx(_e,{path:"/agent-sessions",element:i.jsx(Fv,{})}),i.jsx(_e,{path:"/playbooks",element:i.jsx(t_,{})}),i.jsx(_e,{path:"/playbooks/create",element:i.jsx(r_,{})}),i.jsx(_e,{path:"/playbooks/:slug",element:i.jsx(n_,{})}),i.jsx(_e,{path:"/playbooks/:slug/edit",element:i.jsx(o_,{})}),i.jsx(_e,{path:"/todos",element:i.jsx(u_,{})}),i.jsx(_e,{path:"/help",element:i.jsx(xT,{})}),i.jsx(_e,{path:"/settings",element:i.jsx(c_,{})}),i.jsx(_e,{path:"/create/project",element:i.jsx(Ov,{})}),i.jsx(_e,{path:"/projects/:slug",element:i.jsx(Ev,{})}),i.jsx(_e,{path:"/projects/:slug/edit",element:i.jsx(_v,{})}),i.jsx(_e,{path:"/projects/:slug/create/assignment",element:i.jsx(Lv,{})}),i.jsx(_e,{path:"/projects/:slug/assignments/:aslug",element:i.jsx(Pv,{})}),i.jsx(_e,{path:"/projects/:slug/assignments/:aslug/edit",element:i.jsx(Mf,{})}),i.jsx(_e,{path:"/projects/:slug/assignments/:aslug/plan/edit",element:i.jsx(_f,{})}),i.jsx(_e,{path:"/projects/:slug/assignments/:aslug/scratchpad/edit",element:i.jsx($f,{})}),i.jsx(_e,{path:"/projects/:slug/assignments/:aslug/handoff/edit",element:i.jsx(Ff,{})}),i.jsx(_e,{path:"/projects/:slug/assignments/:aslug/decision-record/edit",element:i.jsx(zf,{})}),i.jsx(_e,{path:"/w/:workspace/projects",element:i.jsx(dy,{})}),i.jsx(_e,{path:"/w/:workspace/assignments",element:i.jsx(Dv,{})}),i.jsx(_e,{path:"/w/:workspace/assignments/new",element:i.jsx(Mv,{})}),i.jsx(_e,{path:"/w/:workspace/servers",element:i.jsx($v,{})}),i.jsx(_e,{path:"/w/:workspace/agent-sessions",element:i.jsx(Fv,{})}),i.jsx(_e,{path:"/w/:workspace/todos",element:i.jsx(rM,{})}),i.jsx(_e,{path:"/w/:workspace/create/project",element:i.jsx(Ov,{})}),i.jsx(_e,{path:"/w/:workspace/projects/:slug",element:i.jsx(Ev,{})}),i.jsx(_e,{path:"/w/:workspace/projects/:slug/edit",element:i.jsx(_v,{})}),i.jsx(_e,{path:"/w/:workspace/projects/:slug/create/assignment",element:i.jsx(Lv,{})}),i.jsx(_e,{path:"/w/:workspace/projects/:slug/assignments/:aslug",element:i.jsx(Pv,{})}),i.jsx(_e,{path:"/w/:workspace/projects/:slug/assignments/:aslug/edit",element:i.jsx(Mf,{})}),i.jsx(_e,{path:"/w/:workspace/projects/:slug/assignments/:aslug/plan/edit",element:i.jsx(_f,{})}),i.jsx(_e,{path:"/w/:workspace/projects/:slug/assignments/:aslug/scratchpad/edit",element:i.jsx($f,{})}),i.jsx(_e,{path:"/w/:workspace/projects/:slug/assignments/:aslug/handoff/edit",element:i.jsx(Ff,{})}),i.jsx(_e,{path:"/w/:workspace/projects/:slug/assignments/:aslug/decision-record/edit",element:i.jsx(zf,{})})]})})})})}NE();bS.createRoot(document.getElementById("root")).render(i.jsx(g.StrictMode,{children:i.jsx(CE,{children:i.jsx(d_,{})})}));export{eR as _,f_ as a,Rc as g};