syntaur 0.16.2 → 0.17.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.
- package/dashboard/dist/assets/{_basePickBy-DTuHiZCP.js → _basePickBy-Dek5-ACb.js} +1 -1
- package/dashboard/dist/assets/{_baseUniq-BjbISCNN.js → _baseUniq-BeLddDKU.js} +1 -1
- package/dashboard/dist/assets/{arc-D9mCa8If.js → arc-kotdj4Uh.js} +1 -1
- package/dashboard/dist/assets/{architectureDiagram-2XIMDMQ5-CLWheiZu.js → architectureDiagram-2XIMDMQ5-BaqFXQ-q.js} +1 -1
- package/dashboard/dist/assets/{blockDiagram-WCTKOSBZ-BBxrVTWB.js → blockDiagram-WCTKOSBZ-BSyGne6h.js} +1 -1
- package/dashboard/dist/assets/{c4Diagram-IC4MRINW-DnhDZ2W3.js → c4Diagram-IC4MRINW-iYjZFKOW.js} +1 -1
- package/dashboard/dist/assets/channel-eXdj7ayV.js +1 -0
- package/dashboard/dist/assets/{chunk-4BX2VUAB-DeAfVeDa.js → chunk-4BX2VUAB-DvY9Y7jB.js} +1 -1
- package/dashboard/dist/assets/{chunk-55IACEB6-cKEeGDNI.js → chunk-55IACEB6-2vCDm2cJ.js} +1 -1
- package/dashboard/dist/assets/{chunk-FMBD7UC4-7RuZ6HEq.js → chunk-FMBD7UC4-BVPaoRtV.js} +1 -1
- package/dashboard/dist/assets/{chunk-JSJVCQXG-B5dwG0bv.js → chunk-JSJVCQXG-B9uJpMzd.js} +1 -1
- package/dashboard/dist/assets/{chunk-KX2RTZJC-DeyQYDVj.js → chunk-KX2RTZJC-CHcjjGaq.js} +1 -1
- package/dashboard/dist/assets/{chunk-NQ4KR5QH-NYo4hSqA.js → chunk-NQ4KR5QH-B8n19pSs.js} +1 -1
- package/dashboard/dist/assets/{chunk-QZHKN3VN-CtJFICF8.js → chunk-QZHKN3VN-CF9ZYFGK.js} +1 -1
- package/dashboard/dist/assets/{chunk-WL4C6EOR-DZ3WYdab.js → chunk-WL4C6EOR-mY_1Vmdf.js} +1 -1
- package/dashboard/dist/assets/classDiagram-VBA2DB6C-B-bBQACr.js +1 -0
- package/dashboard/dist/assets/classDiagram-v2-RAHNMMFH-B-bBQACr.js +1 -0
- package/dashboard/dist/assets/clone-CL04pv9J.js +1 -0
- package/dashboard/dist/assets/{cose-bilkent-S5V4N54A-DaYOsf-M.js → cose-bilkent-S5V4N54A-DOYoG3gB.js} +1 -1
- package/dashboard/dist/assets/{dagre-KLK3FWXG-DzLc7ykF.js → dagre-KLK3FWXG-CZFrp-Yq.js} +1 -1
- package/dashboard/dist/assets/{diagram-E7M64L7V-kpjEdOqb.js → diagram-E7M64L7V-F3rF5YwM.js} +1 -1
- package/dashboard/dist/assets/{diagram-IFDJBPK2-D3EHoh6j.js → diagram-IFDJBPK2-BynWv-Vo.js} +1 -1
- package/dashboard/dist/assets/{diagram-P4PSJMXO-Cp6Un2ys.js → diagram-P4PSJMXO-NIyzhm_M.js} +1 -1
- package/dashboard/dist/assets/{erDiagram-INFDFZHY-DDjOUPWk.js → erDiagram-INFDFZHY-Ca9NbihE.js} +1 -1
- package/dashboard/dist/assets/{flowDiagram-PKNHOUZH-CfO51xge.js → flowDiagram-PKNHOUZH-YhS0MOu4.js} +1 -1
- package/dashboard/dist/assets/{ganttDiagram-A5KZAMGK-BDzAtkcp.js → ganttDiagram-A5KZAMGK-G7P3qq_2.js} +1 -1
- package/dashboard/dist/assets/{gitGraphDiagram-K3NZZRJ6-JPMFN2zF.js → gitGraphDiagram-K3NZZRJ6-BJAK7M7E.js} +1 -1
- package/dashboard/dist/assets/{graph-DXDryilu.js → graph-11geMy3f.js} +1 -1
- package/dashboard/dist/assets/index--qwybK3W.js +535 -0
- package/dashboard/dist/assets/index-DwrhlK8r.css +1 -0
- package/dashboard/dist/assets/{infoDiagram-LFFYTUFH-CYi5kkvz.js → infoDiagram-LFFYTUFH-COcQYcLf.js} +1 -1
- package/dashboard/dist/assets/{ishikawaDiagram-PHBUUO56-DQl_IUe8.js → ishikawaDiagram-PHBUUO56-B7Jjyw8J.js} +1 -1
- package/dashboard/dist/assets/{journeyDiagram-4ABVD52K-BXXGPcrS.js → journeyDiagram-4ABVD52K--snU-QAX.js} +1 -1
- package/dashboard/dist/assets/{kanban-definition-K7BYSVSG-BqJestUY.js → kanban-definition-K7BYSVSG-BucLoc89.js} +1 -1
- package/dashboard/dist/assets/{layout-D5VdYmWn.js → layout-Bcgxdz8A.js} +1 -1
- package/dashboard/dist/assets/{linear-dZA_O_GN.js → linear-CRF8xwvk.js} +1 -1
- package/dashboard/dist/assets/{mermaid.core-B0Ixd1yP.js → mermaid.core-D5JD5uYg.js} +4 -4
- package/dashboard/dist/assets/{mindmap-definition-YRQLILUH-CSJYdSMG.js → mindmap-definition-YRQLILUH-BqGcTcbk.js} +1 -1
- package/dashboard/dist/assets/{pieDiagram-SKSYHLDU-DmYrRZHN.js → pieDiagram-SKSYHLDU-CnQ2EkyX.js} +1 -1
- package/dashboard/dist/assets/{quadrantDiagram-337W2JSQ-La3ce5kE.js → quadrantDiagram-337W2JSQ-CKCfmTRc.js} +1 -1
- package/dashboard/dist/assets/{requirementDiagram-Z7DCOOCP-DPitIZQl.js → requirementDiagram-Z7DCOOCP-B9J4bvUK.js} +1 -1
- package/dashboard/dist/assets/{sankeyDiagram-WA2Y5GQK-CAmCqGkr.js → sankeyDiagram-WA2Y5GQK-CMSzI5rg.js} +1 -1
- package/dashboard/dist/assets/{sequenceDiagram-2WXFIKYE-6lEzNTWG.js → sequenceDiagram-2WXFIKYE-BFQDtxd0.js} +1 -1
- package/dashboard/dist/assets/{stateDiagram-RAJIS63D-DyGKCS2C.js → stateDiagram-RAJIS63D-DgWYKT02.js} +1 -1
- package/dashboard/dist/assets/stateDiagram-v2-FVOUBMTO-Nmwft4cR.js +1 -0
- package/dashboard/dist/assets/{timeline-definition-YZTLITO2-D9RxQE3j.js → timeline-definition-YZTLITO2-jANu0e7M.js} +1 -1
- package/dashboard/dist/assets/{treemap-KZPCXAKY-TuXbGNN4.js → treemap-KZPCXAKY-BFjWMkyM.js} +1 -1
- package/dashboard/dist/assets/{vennDiagram-LZ73GAT5-Bly5knr-.js → vennDiagram-LZ73GAT5-DGwrAJYj.js} +1 -1
- package/dashboard/dist/assets/{xychartDiagram-JWTSCODW-CA-5z7-4.js → xychartDiagram-JWTSCODW-BLCPfoFM.js} +1 -1
- package/dashboard/dist/index.html +2 -2
- package/dist/dashboard/server.js +2220 -479
- package/dist/dashboard/server.js.map +1 -1
- package/dist/db/leases-db.js.map +1 -1
- package/dist/index.js +4499 -1127
- package/dist/index.js.map +1 -1
- package/dist/launch/index.js +127 -63
- package/dist/launch/index.js.map +1 -1
- package/package.json +1 -1
- package/platforms/claude-code/skills/bundle-worktree/SKILL.md +107 -0
- package/platforms/claude-code/skills/complete-bundle/SKILL.md +113 -0
- package/platforms/claude-code/skills/grab-bundle/SKILL.md +111 -0
- package/platforms/claude-code/skills/plan-bundle/SKILL.md +88 -0
- package/platforms/codex/skills/bundle-worktree/SKILL.md +107 -0
- package/platforms/codex/skills/complete-bundle/SKILL.md +113 -0
- package/platforms/codex/skills/grab-bundle/SKILL.md +111 -0
- package/platforms/codex/skills/plan-bundle/SKILL.md +88 -0
- package/skills/bundle-worktree/SKILL.md +107 -0
- package/skills/complete-bundle/SKILL.md +113 -0
- package/skills/grab-bundle/SKILL.md +111 -0
- package/skills/plan-bundle/SKILL.md +88 -0
- package/dashboard/dist/assets/channel-CN5VmjNa.js +0 -1
- package/dashboard/dist/assets/classDiagram-VBA2DB6C-CqLb9GuU.js +0 -1
- package/dashboard/dist/assets/classDiagram-v2-RAHNMMFH-CqLb9GuU.js +0 -1
- package/dashboard/dist/assets/clone-DwvrjCQs.js +0 -1
- package/dashboard/dist/assets/index-D7UtkCYM.js +0 -515
- package/dashboard/dist/assets/index-DTXSWSzH.css +0 -1
- package/dashboard/dist/assets/stateDiagram-v2-FVOUBMTO-BOmRICoY.js +0 -1
|
@@ -0,0 +1,535 @@
|
|
|
1
|
+
var YC=Object.defineProperty;var JC=(e,t,n)=>t in e?YC(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var vv=(e,t,n)=>JC(e,typeof t!="symbol"?t+"":t,n);function XC(e,t){for(var n=0;n<t.length;n++){const s=t[n];if(typeof s!="string"&&!Array.isArray(s)){for(const i in s)if(i!=="default"&&!(i in e)){const l=Object.getOwnPropertyDescriptor(s,i);l&&Object.defineProperty(e,i,l.get?l:{enumerable:!0,get:()=>s[i]})}}}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 i of document.querySelectorAll('link[rel="modulepreload"]'))s(i);new MutationObserver(i=>{for(const l of i)if(l.type==="childList")for(const c of l.addedNodes)c.tagName==="LINK"&&c.rel==="modulepreload"&&s(c)}).observe(document,{childList:!0,subtree:!0});function n(i){const l={};return i.integrity&&(l.integrity=i.integrity),i.referrerPolicy&&(l.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?l.credentials="include":i.crossOrigin==="anonymous"?l.credentials="omit":l.credentials="same-origin",l}function s(i){if(i.ep)return;i.ep=!0;const l=n(i);fetch(i.href,l)}})();function Zu(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function rz(e){if(Object.prototype.hasOwnProperty.call(e,"__esModule"))return e;var t=e.default;if(typeof t=="function"){var n=function s(){return this instanceof s?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(s){var i=Object.getOwnPropertyDescriptor(e,s);Object.defineProperty(n,s,i.get?i:{enumerable:!0,get:function(){return e[s]}})}),n}var Pp={exports:{}},Za={},Rp={exports:{}},ot={};/**
|
|
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 bv;function QC(){if(bv)return ot;bv=1;var e=Symbol.for("react.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),s=Symbol.for("react.strict_mode"),i=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 y(M){return M===null||typeof M!="object"?null:(M=x&&M[x]||M["@@iterator"],typeof M=="function"?M:null)}var v={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},C=Object.assign,j={};function w(M,q,L){this.props=M,this.context=q,this.refs=j,this.updater=L||v}w.prototype.isReactComponent={},w.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")},w.prototype.forceUpdate=function(M){this.updater.enqueueForceUpdate(this,M,"forceUpdate")};function S(){}S.prototype=w.prototype;function E(M,q,L){this.props=M,this.context=q,this.refs=j,this.updater=L||v}var N=E.prototype=new S;N.constructor=E,C(N,w.prototype),N.isPureReactComponent=!0;var P=Array.isArray,I=Object.prototype.hasOwnProperty,R={current:null},$={key:!0,ref:!0,__self:!0,__source:!0};function D(M,q,L){var ue,fe={},B=null,oe=null;if(q!=null)for(ue in q.ref!==void 0&&(oe=q.ref),q.key!==void 0&&(B=""+q.key),q)I.call(q,ue)&&!$.hasOwnProperty(ue)&&(fe[ue]=q[ue]);var he=arguments.length-2;if(he===1)fe.children=L;else if(1<he){for(var we=Array(he),Se=0;Se<he;Se++)we[Se]=arguments[Se+2];fe.children=we}if(M&&M.defaultProps)for(ue in he=M.defaultProps,he)fe[ue]===void 0&&(fe[ue]=he[ue]);return{$$typeof:e,type:M,key:B,ref:oe,props:fe,_owner:R.current}}function X(M,q){return{$$typeof:e,type:M.type,key:q,ref:M.ref,props:M.props,_owner:M._owner}}function Z(M){return typeof M=="object"&&M!==null&&M.$$typeof===e}function F(M){var q={"=":"=0",":":"=2"};return"$"+M.replace(/[=:]/g,function(L){return q[L]})}var H=/\/+/g;function J(M,q){return typeof M=="object"&&M!==null&&M.key!=null?F(""+M.key):q.toString(36)}function _(M,q,L,ue,fe){var B=typeof M;(B==="undefined"||B==="boolean")&&(M=null);var oe=!1;if(M===null)oe=!0;else switch(B){case"string":case"number":oe=!0;break;case"object":switch(M.$$typeof){case e:case t:oe=!0}}if(oe)return oe=M,fe=fe(oe),M=ue===""?"."+J(oe,0):ue,P(fe)?(L="",M!=null&&(L=M.replace(H,"$&/")+"/"),_(fe,q,L,"",function(Se){return Se})):fe!=null&&(Z(fe)&&(fe=X(fe,L+(!fe.key||oe&&oe.key===fe.key?"":(""+fe.key).replace(H,"$&/")+"/")+M)),q.push(fe)),1;if(oe=0,ue=ue===""?".":ue+":",P(M))for(var he=0;he<M.length;he++){B=M[he];var we=ue+J(B,he);oe+=_(B,q,L,we,fe)}else if(we=y(M),typeof we=="function")for(M=we.call(M),he=0;!(B=M.next()).done;)B=B.value,we=ue+J(B,he++),oe+=_(B,q,L,we,fe);else if(B==="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 oe}function W(M,q,L){if(M==null)return M;var ue=[],fe=0;return _(M,ue,"","",function(B){return q.call(L,B,fe++)}),ue}function Y(M){if(M._status===-1){var q=M._result;q=q(),q.then(function(L){(M._status===0||M._status===-1)&&(M._status=1,M._result=L)},function(L){(M._status===0||M._status===-1)&&(M._status=2,M._result=L)}),M._status===-1&&(M._status=0,M._result=q)}if(M._status===1)return M._result.default;throw M._result}var ie={current:null},K={transition:null},ae={ReactCurrentDispatcher:ie,ReactCurrentBatchConfig:K,ReactCurrentOwner:R};function T(){throw Error("act(...) is not supported in production builds of React.")}return ot.Children={map:W,forEach:function(M,q,L){W(M,function(){q.apply(this,arguments)},L)},count:function(M){var q=0;return W(M,function(){q++}),q},toArray:function(M){return W(M,function(q){return q})||[]},only:function(M){if(!Z(M))throw Error("React.Children.only expected to receive a single React element child.");return M}},ot.Component=w,ot.Fragment=n,ot.Profiler=i,ot.PureComponent=E,ot.StrictMode=s,ot.Suspense=p,ot.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=ae,ot.act=T,ot.cloneElement=function(M,q,L){if(M==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+M+".");var ue=C({},M.props),fe=M.key,B=M.ref,oe=M._owner;if(q!=null){if(q.ref!==void 0&&(B=q.ref,oe=R.current),q.key!==void 0&&(fe=""+q.key),M.type&&M.type.defaultProps)var he=M.type.defaultProps;for(we in q)I.call(q,we)&&!$.hasOwnProperty(we)&&(ue[we]=q[we]===void 0&&he!==void 0?he[we]:q[we])}var we=arguments.length-2;if(we===1)ue.children=L;else if(1<we){he=Array(we);for(var Se=0;Se<we;Se++)he[Se]=arguments[Se+2];ue.children=he}return{$$typeof:e,type:M.type,key:fe,ref:B,props:ue,_owner:oe}},ot.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},ot.createElement=D,ot.createFactory=function(M){var q=D.bind(null,M);return q.type=M,q},ot.createRef=function(){return{current:null}},ot.forwardRef=function(M){return{$$typeof:d,render:M}},ot.isValidElement=Z,ot.lazy=function(M){return{$$typeof:h,_payload:{_status:-1,_result:M},_init:Y}},ot.memo=function(M,q){return{$$typeof:m,type:M,compare:q===void 0?null:q}},ot.startTransition=function(M){var q=K.transition;K.transition={};try{M()}finally{K.transition=q}},ot.unstable_act=T,ot.useCallback=function(M,q){return ie.current.useCallback(M,q)},ot.useContext=function(M){return ie.current.useContext(M)},ot.useDebugValue=function(){},ot.useDeferredValue=function(M){return ie.current.useDeferredValue(M)},ot.useEffect=function(M,q){return ie.current.useEffect(M,q)},ot.useId=function(){return ie.current.useId()},ot.useImperativeHandle=function(M,q,L){return ie.current.useImperativeHandle(M,q,L)},ot.useInsertionEffect=function(M,q){return ie.current.useInsertionEffect(M,q)},ot.useLayoutEffect=function(M,q){return ie.current.useLayoutEffect(M,q)},ot.useMemo=function(M,q){return ie.current.useMemo(M,q)},ot.useReducer=function(M,q,L){return ie.current.useReducer(M,q,L)},ot.useRef=function(M){return ie.current.useRef(M)},ot.useState=function(M){return ie.current.useState(M)},ot.useSyncExternalStore=function(M,q,L){return ie.current.useSyncExternalStore(M,q,L)},ot.useTransition=function(){return ie.current.useTransition()},ot.version="18.3.1",ot}var wv;function mh(){return wv||(wv=1,Rp.exports=QC()),Rp.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 jv;function ZC(){if(jv)return Za;jv=1;var e=mh(),t=Symbol.for("react.element"),n=Symbol.for("react.fragment"),s=Object.prototype.hasOwnProperty,i=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={},y=null,v=null;m!==void 0&&(y=""+m),p.key!==void 0&&(y=""+p.key),p.ref!==void 0&&(v=p.ref);for(h in p)s.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:y,ref:v,props:x,_owner:i.current}}return Za.Fragment=n,Za.jsx=c,Za.jsxs=c,Za}var kv;function eE(){return kv||(kv=1,Pp.exports=ZC()),Pp.exports}var r=eE(),f=mh();const Vt=Zu(f),i0=XC({__proto__:null,default:Vt},[f]);var eu={},Ap={exports:{}},Hn={},Dp={exports:{}},$p={};/**
|
|
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 Sv;function tE(){return Sv||(Sv=1,(function(e){function t(K,ae){var T=K.length;K.push(ae);e:for(;0<T;){var M=T-1>>>1,q=K[M];if(0<i(q,ae))K[M]=ae,K[T]=q,T=M;else break e}}function n(K){return K.length===0?null:K[0]}function s(K){if(K.length===0)return null;var ae=K[0],T=K.pop();if(T!==ae){K[0]=T;e:for(var M=0,q=K.length,L=q>>>1;M<L;){var ue=2*(M+1)-1,fe=K[ue],B=ue+1,oe=K[B];if(0>i(fe,T))B<q&&0>i(oe,fe)?(K[M]=oe,K[B]=T,M=B):(K[M]=fe,K[ue]=T,M=ue);else if(B<q&&0>i(oe,T))K[M]=oe,K[B]=T,M=B;else break e}}return ae}function i(K,ae){var T=K.sortIndex-ae.sortIndex;return T!==0?T:K.id-ae.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,y=3,v=!1,C=!1,j=!1,w=typeof setTimeout=="function"?setTimeout:null,S=typeof clearTimeout=="function"?clearTimeout:null,E=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(K){for(var ae=n(m);ae!==null;){if(ae.callback===null)s(m);else if(ae.startTime<=K)s(m),ae.sortIndex=ae.expirationTime,t(p,ae);else break;ae=n(m)}}function P(K){if(j=!1,N(K),!C)if(n(p)!==null)C=!0,Y(I);else{var ae=n(m);ae!==null&&ie(P,ae.startTime-K)}}function I(K,ae){C=!1,j&&(j=!1,S(D),D=-1),v=!0;var T=y;try{for(N(ae),x=n(p);x!==null&&(!(x.expirationTime>ae)||K&&!F());){var M=x.callback;if(typeof M=="function"){x.callback=null,y=x.priorityLevel;var q=M(x.expirationTime<=ae);ae=e.unstable_now(),typeof q=="function"?x.callback=q:x===n(p)&&s(p),N(ae)}else s(p);x=n(p)}if(x!==null)var L=!0;else{var ue=n(m);ue!==null&&ie(P,ue.startTime-ae),L=!1}return L}finally{x=null,y=T,v=!1}}var R=!1,$=null,D=-1,X=5,Z=-1;function F(){return!(e.unstable_now()-Z<X)}function H(){if($!==null){var K=e.unstable_now();Z=K;var ae=!0;try{ae=$(!0,K)}finally{ae?J():(R=!1,$=null)}}else R=!1}var J;if(typeof E=="function")J=function(){E(H)};else if(typeof MessageChannel<"u"){var _=new MessageChannel,W=_.port2;_.port1.onmessage=H,J=function(){W.postMessage(null)}}else J=function(){w(H,0)};function Y(K){$=K,R||(R=!0,J())}function ie(K,ae){D=w(function(){K(e.unstable_now())},ae)}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(K){K.callback=null},e.unstable_continueExecution=function(){C||v||(C=!0,Y(I))},e.unstable_forceFrameRate=function(K){0>K||125<K?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):X=0<K?Math.floor(1e3/K):5},e.unstable_getCurrentPriorityLevel=function(){return y},e.unstable_getFirstCallbackNode=function(){return n(p)},e.unstable_next=function(K){switch(y){case 1:case 2:case 3:var ae=3;break;default:ae=y}var T=y;y=ae;try{return K()}finally{y=T}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(K,ae){switch(K){case 1:case 2:case 3:case 4:case 5:break;default:K=3}var T=y;y=K;try{return ae()}finally{y=T}},e.unstable_scheduleCallback=function(K,ae,T){var M=e.unstable_now();switch(typeof T=="object"&&T!==null?(T=T.delay,T=typeof T=="number"&&0<T?M+T:M):T=M,K){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=T+q,K={id:h++,callback:ae,priorityLevel:K,startTime:T,expirationTime:q,sortIndex:-1},T>M?(K.sortIndex=T,t(m,K),n(p)===null&&K===n(m)&&(j?(S(D),D=-1):j=!0,ie(P,T-M))):(K.sortIndex=q,t(p,K),C||v||(C=!0,Y(I))),K},e.unstable_shouldYield=F,e.unstable_wrapCallback=function(K){var ae=y;return function(){var T=y;y=ae;try{return K.apply(this,arguments)}finally{y=T}}}})($p)),$p}var Nv;function nE(){return Nv||(Nv=1,Dp.exports=tE()),Dp.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 Cv;function rE(){if(Cv)return Hn;Cv=1;var e=mh(),t=nE();function n(o){for(var a="https://reactjs.org/docs/error-decoder.html?invariant="+o,u=1;u<arguments.length;u++)a+="&args[]="+encodeURIComponent(arguments[u]);return"Minified React error #"+o+"; visit "+a+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var s=new Set,i={};function l(o,a){c(o,a),c(o+"Capture",a)}function c(o,a){for(i[o]=a,o=0;o<a.length;o++)s.add(a[o])}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 y(o){return p.call(x,o)?!0:p.call(h,o)?!1:m.test(o)?x[o]=!0:(h[o]=!0,!1)}function v(o,a,u,g){if(u!==null&&u.type===0)return!1;switch(typeof a){case"function":case"symbol":return!0;case"boolean":return g?!1:u!==null?!u.acceptsBooleans:(o=o.toLowerCase().slice(0,5),o!=="data-"&&o!=="aria-");default:return!1}}function C(o,a,u,g){if(a===null||typeof a>"u"||v(o,a,u,g))return!0;if(g)return!1;if(u!==null)switch(u.type){case 3:return!a;case 4:return a===!1;case 5:return isNaN(a);case 6:return isNaN(a)||1>a}return!1}function j(o,a,u,g,b,k,A){this.acceptsBooleans=a===2||a===3||a===4,this.attributeName=g,this.attributeNamespace=b,this.mustUseProperty=u,this.propertyName=o,this.type=a,this.sanitizeURL=k,this.removeEmptyString=A}var w={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(o){w[o]=new j(o,0,!1,o,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(o){var a=o[0];w[a]=new j(a,1,!1,o[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(o){w[o]=new j(o,2,!1,o.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(o){w[o]=new j(o,2,!1,o,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(o){w[o]=new j(o,3,!1,o.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(o){w[o]=new j(o,3,!0,o,null,!1,!1)}),["capture","download"].forEach(function(o){w[o]=new j(o,4,!1,o,null,!1,!1)}),["cols","rows","size","span"].forEach(function(o){w[o]=new j(o,6,!1,o,null,!1,!1)}),["rowSpan","start"].forEach(function(o){w[o]=new j(o,5,!1,o.toLowerCase(),null,!1,!1)});var S=/[\-:]([a-z])/g;function E(o){return o[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(o){var a=o.replace(S,E);w[a]=new j(a,1,!1,o,null,!1,!1)}),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(o){var a=o.replace(S,E);w[a]=new j(a,1,!1,o,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(function(o){var a=o.replace(S,E);w[a]=new j(a,1,!1,o,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(o){w[o]=new j(o,1,!1,o.toLowerCase(),null,!1,!1)}),w.xlinkHref=new j("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(o){w[o]=new j(o,1,!1,o.toLowerCase(),null,!0,!0)});function N(o,a,u,g){var b=w.hasOwnProperty(a)?w[a]:null;(b!==null?b.type!==0:g||!(2<a.length)||a[0]!=="o"&&a[0]!=="O"||a[1]!=="n"&&a[1]!=="N")&&(C(a,u,b,g)&&(u=null),g||b===null?y(a)&&(u===null?o.removeAttribute(a):o.setAttribute(a,""+u)):b.mustUseProperty?o[b.propertyName]=u===null?b.type===3?!1:"":u:(a=b.attributeName,g=b.attributeNamespace,u===null?o.removeAttribute(a):(b=b.type,u=b===3||b===4&&u===!0?"":""+u,g?o.setAttributeNS(g,a,u):o.setAttribute(a,u))))}var P=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,I=Symbol.for("react.element"),R=Symbol.for("react.portal"),$=Symbol.for("react.fragment"),D=Symbol.for("react.strict_mode"),X=Symbol.for("react.profiler"),Z=Symbol.for("react.provider"),F=Symbol.for("react.context"),H=Symbol.for("react.forward_ref"),J=Symbol.for("react.suspense"),_=Symbol.for("react.suspense_list"),W=Symbol.for("react.memo"),Y=Symbol.for("react.lazy"),ie=Symbol.for("react.offscreen"),K=Symbol.iterator;function ae(o){return o===null||typeof o!="object"?null:(o=K&&o[K]||o["@@iterator"],typeof o=="function"?o:null)}var T=Object.assign,M;function q(o){if(M===void 0)try{throw Error()}catch(u){var a=u.stack.trim().match(/\n( *(at )?)/);M=a&&a[1]||""}return`
|
|
34
|
+
`+M+o}var L=!1;function ue(o,a){if(!o||L)return"";L=!0;var u=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(a)if(a=function(){throw Error()},Object.defineProperty(a.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(a,[])}catch(le){var g=le}Reflect.construct(o,[],a)}else{try{a.call()}catch(le){g=le}o.call(a.prototype)}else{try{throw Error()}catch(le){g=le}o()}}catch(le){if(le&&g&&typeof le.stack=="string"){for(var b=le.stack.split(`
|
|
35
|
+
`),k=g.stack.split(`
|
|
36
|
+
`),A=b.length-1,z=k.length-1;1<=A&&0<=z&&b[A]!==k[z];)z--;for(;1<=A&&0<=z;A--,z--)if(b[A]!==k[z]){if(A!==1||z!==1)do if(A--,z--,0>z||b[A]!==k[z]){var V=`
|
|
37
|
+
`+b[A].replace(" at new "," at ");return o.displayName&&V.includes("<anonymous>")&&(V=V.replace("<anonymous>",o.displayName)),V}while(1<=A&&0<=z);break}}}finally{L=!1,Error.prepareStackTrace=u}return(o=o?o.displayName||o.name:"")?q(o):""}function fe(o){switch(o.tag){case 5:return q(o.type);case 16:return q("Lazy");case 13:return q("Suspense");case 19:return q("SuspenseList");case 0:case 2:case 15:return o=ue(o.type,!1),o;case 11:return o=ue(o.type.render,!1),o;case 1:return o=ue(o.type,!0),o;default:return""}}function B(o){if(o==null)return null;if(typeof o=="function")return o.displayName||o.name||null;if(typeof o=="string")return o;switch(o){case $:return"Fragment";case R:return"Portal";case X:return"Profiler";case D:return"StrictMode";case J:return"Suspense";case _:return"SuspenseList"}if(typeof o=="object")switch(o.$$typeof){case F:return(o.displayName||"Context")+".Consumer";case Z:return(o._context.displayName||"Context")+".Provider";case H:var a=o.render;return o=o.displayName,o||(o=a.displayName||a.name||"",o=o!==""?"ForwardRef("+o+")":"ForwardRef"),o;case W:return a=o.displayName||null,a!==null?a:B(o.type)||"Memo";case Y:a=o._payload,o=o._init;try{return B(o(a))}catch{}}return null}function oe(o){var a=o.type;switch(o.tag){case 24:return"Cache";case 9:return(a.displayName||"Context")+".Consumer";case 10:return(a._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return o=a.render,o=o.displayName||o.name||"",a.displayName||(o!==""?"ForwardRef("+o+")":"ForwardRef");case 7:return"Fragment";case 5:return a;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return B(a);case 8:return a===D?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof a=="function")return a.displayName||a.name||null;if(typeof a=="string")return a}return null}function he(o){switch(typeof o){case"boolean":case"number":case"string":case"undefined":return o;case"object":return o;default:return""}}function we(o){var a=o.type;return(o=o.nodeName)&&o.toLowerCase()==="input"&&(a==="checkbox"||a==="radio")}function Se(o){var a=we(o)?"checked":"value",u=Object.getOwnPropertyDescriptor(o.constructor.prototype,a),g=""+o[a];if(!o.hasOwnProperty(a)&&typeof u<"u"&&typeof u.get=="function"&&typeof u.set=="function"){var b=u.get,k=u.set;return Object.defineProperty(o,a,{configurable:!0,get:function(){return b.call(this)},set:function(A){g=""+A,k.call(this,A)}}),Object.defineProperty(o,a,{enumerable:u.enumerable}),{getValue:function(){return g},setValue:function(A){g=""+A},stopTracking:function(){o._valueTracker=null,delete o[a]}}}}function pe(o){o._valueTracker||(o._valueTracker=Se(o))}function He(o){if(!o)return!1;var a=o._valueTracker;if(!a)return!0;var u=a.getValue(),g="";return o&&(g=we(o)?o.checked?"true":"false":o.value),o=g,o!==u?(a.setValue(o),!0):!1}function te(o){if(o=o||(typeof document<"u"?document:void 0),typeof o>"u")return null;try{return o.activeElement||o.body}catch{return o.body}}function ye(o,a){var u=a.checked;return T({},a,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:u??o._wrapperState.initialChecked})}function ne(o,a){var u=a.defaultValue==null?"":a.defaultValue,g=a.checked!=null?a.checked:a.defaultChecked;u=he(a.value!=null?a.value:u),o._wrapperState={initialChecked:g,initialValue:u,controlled:a.type==="checkbox"||a.type==="radio"?a.checked!=null:a.value!=null}}function U(o,a){a=a.checked,a!=null&&N(o,"checked",a,!1)}function de(o,a){U(o,a);var u=he(a.value),g=a.type;if(u!=null)g==="number"?(u===0&&o.value===""||o.value!=u)&&(o.value=""+u):o.value!==""+u&&(o.value=""+u);else if(g==="submit"||g==="reset"){o.removeAttribute("value");return}a.hasOwnProperty("value")?Fe(o,a.type,u):a.hasOwnProperty("defaultValue")&&Fe(o,a.type,he(a.defaultValue)),a.checked==null&&a.defaultChecked!=null&&(o.defaultChecked=!!a.defaultChecked)}function me(o,a,u){if(a.hasOwnProperty("value")||a.hasOwnProperty("defaultValue")){var g=a.type;if(!(g!=="submit"&&g!=="reset"||a.value!==void 0&&a.value!==null))return;a=""+o._wrapperState.initialValue,u||a===o.value||(o.value=a),o.defaultValue=a}u=o.name,u!==""&&(o.name=""),o.defaultChecked=!!o._wrapperState.initialChecked,u!==""&&(o.name=u)}function Fe(o,a,u){(a!=="number"||te(o.ownerDocument)!==o)&&(u==null?o.defaultValue=""+o._wrapperState.initialValue:o.defaultValue!==""+u&&(o.defaultValue=""+u))}var qe=Array.isArray;function Ve(o,a,u,g){if(o=o.options,a){a={};for(var b=0;b<u.length;b++)a["$"+u[b]]=!0;for(u=0;u<o.length;u++)b=a.hasOwnProperty("$"+o[u].value),o[u].selected!==b&&(o[u].selected=b),b&&g&&(o[u].defaultSelected=!0)}else{for(u=""+he(u),a=null,b=0;b<o.length;b++){if(o[b].value===u){o[b].selected=!0,g&&(o[b].defaultSelected=!0);return}a!==null||o[b].disabled||(a=o[b])}a!==null&&(a.selected=!0)}}function Ze(o,a){if(a.dangerouslySetInnerHTML!=null)throw Error(n(91));return T({},a,{value:void 0,defaultValue:void 0,children:""+o._wrapperState.initialValue})}function St(o,a){var u=a.value;if(u==null){if(u=a.children,a=a.defaultValue,u!=null){if(a!=null)throw Error(n(92));if(qe(u)){if(1<u.length)throw Error(n(93));u=u[0]}a=u}a==null&&(a=""),u=a}o._wrapperState={initialValue:he(u)}}function bt(o,a){var u=he(a.value),g=he(a.defaultValue);u!=null&&(u=""+u,u!==o.value&&(o.value=u),a.defaultValue==null&&o.defaultValue!==u&&(o.defaultValue=u)),g!=null&&(o.defaultValue=""+g)}function gt(o){var a=o.textContent;a===o._wrapperState.initialValue&&a!==""&&a!==null&&(o.value=a)}function ce(o){switch(o){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 ve(o,a){return o==null||o==="http://www.w3.org/1999/xhtml"?ce(a):o==="http://www.w3.org/2000/svg"&&a==="foreignObject"?"http://www.w3.org/1999/xhtml":o}var De,Oe=(function(o){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(a,u,g,b){MSApp.execUnsafeLocalFunction(function(){return o(a,u,g,b)})}:o})(function(o,a){if(o.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in o)o.innerHTML=a;else{for(De=De||document.createElement("div"),De.innerHTML="<svg>"+a.valueOf().toString()+"</svg>",a=De.firstChild;o.firstChild;)o.removeChild(o.firstChild);for(;a.firstChild;)o.appendChild(a.firstChild)}});function Ye(o,a){if(a){var u=o.firstChild;if(u&&u===o.lastChild&&u.nodeType===3){u.nodeValue=a;return}}o.textContent=a}var et={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},It=["Webkit","ms","Moz","O"];Object.keys(et).forEach(function(o){It.forEach(function(a){a=a+o.charAt(0).toUpperCase()+o.substring(1),et[a]=et[o]})});function ge(o,a,u){return a==null||typeof a=="boolean"||a===""?"":u||typeof a!="number"||a===0||et.hasOwnProperty(o)&&et[o]?(""+a).trim():a+"px"}function Qe(o,a){o=o.style;for(var u in a)if(a.hasOwnProperty(u)){var g=u.indexOf("--")===0,b=ge(u,a[u],g);u==="float"&&(u="cssFloat"),g?o.setProperty(u,b):o[u]=b}}var Ge=T({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 xt(o,a){if(a){if(Ge[o]&&(a.children!=null||a.dangerouslySetInnerHTML!=null))throw Error(n(137,o));if(a.dangerouslySetInnerHTML!=null){if(a.children!=null)throw Error(n(60));if(typeof a.dangerouslySetInnerHTML!="object"||!("__html"in a.dangerouslySetInnerHTML))throw Error(n(61))}if(a.style!=null&&typeof a.style!="object")throw Error(n(62))}}function Kt(o,a){if(o.indexOf("-")===-1)return typeof a.is=="string";switch(o){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 Bt=null;function rn(o){return o=o.target||o.srcElement||window,o.correspondingUseElement&&(o=o.correspondingUseElement),o.nodeType===3?o.parentNode:o}var Qn=null,On=null,ut=null;function Ut(o){if(o=Ma(o)){if(typeof Qn!="function")throw Error(n(280));var a=o.stateNode;a&&(a=hc(a),Qn(o.stateNode,o.type,a))}}function Dt(o){On?ut?ut.push(o):ut=[o]:On=o}function Xt(){if(On){var o=On,a=ut;if(ut=On=null,Ut(o),a)for(o=0;o<a.length;o++)Ut(a[o])}}function Q(o,a){return o(a)}function _e(){}var tt=!1;function qt(o,a,u){if(tt)return o(a,u);tt=!0;try{return Q(o,a,u)}finally{tt=!1,(On!==null||ut!==null)&&(_e(),Xt())}}function nt(o,a){var u=o.stateNode;if(u===null)return null;var g=hc(u);if(g===null)return null;u=g[a];e:switch(a){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(g=!g.disabled)||(o=o.type,g=!(o==="button"||o==="input"||o==="select"||o==="textarea")),o=!g;break e;default:o=!1}if(o)return null;if(u&&typeof u!="function")throw Error(n(231,a,typeof u));return u}var fn=!1;if(d)try{var sn={};Object.defineProperty(sn,"passive",{get:function(){fn=!0}}),window.addEventListener("test",sn,sn),window.removeEventListener("test",sn,sn)}catch{fn=!1}function on(o,a,u,g,b,k,A,z,V){var le=Array.prototype.slice.call(arguments,3);try{a.apply(u,le)}catch(je){this.onError(je)}}var dt=!1,hr=null,yn=!1,Zn=null,co={onError:function(o){dt=!0,hr=o}};function ga(o,a,u,g,b,k,A,z,V){dt=!1,hr=null,on.apply(co,arguments)}function xa(o,a,u,g,b,k,A,z,V){if(ga.apply(this,arguments),dt){if(dt){var le=hr;dt=!1,hr=null}else throw Error(n(198));yn||(yn=!0,Zn=le)}}function Ar(o){var a=o,u=o;if(o.alternate)for(;a.return;)a=a.return;else{o=a;do a=o,(a.flags&4098)!==0&&(u=a.return),o=a.return;while(o)}return a.tag===3?u:null}function Vo(o){if(o.tag===13){var a=o.memoizedState;if(a===null&&(o=o.alternate,o!==null&&(a=o.memoizedState)),a!==null)return a.dehydrated}return null}function uo(o){if(Ar(o)!==o)throw Error(n(188))}function Kd(o){var a=o.alternate;if(!a){if(a=Ar(o),a===null)throw Error(n(188));return a!==o?null:o}for(var u=o,g=a;;){var b=u.return;if(b===null)break;var k=b.alternate;if(k===null){if(g=b.return,g!==null){u=g;continue}break}if(b.child===k.child){for(k=b.child;k;){if(k===u)return uo(b),o;if(k===g)return uo(b),a;k=k.sibling}throw Error(n(188))}if(u.return!==g.return)u=b,g=k;else{for(var A=!1,z=b.child;z;){if(z===u){A=!0,u=b,g=k;break}if(z===g){A=!0,g=b,u=k;break}z=z.sibling}if(!A){for(z=k.child;z;){if(z===u){A=!0,u=k,g=b;break}if(z===g){A=!0,g=k,u=b;break}z=z.sibling}if(!A)throw Error(n(189))}}if(u.alternate!==g)throw Error(n(190))}if(u.tag!==3)throw Error(n(188));return u.stateNode.current===u?o:a}function fo(o){return o=Kd(o),o!==null?po(o):null}function po(o){if(o.tag===5||o.tag===6)return o;for(o=o.child;o!==null;){var a=po(o);if(a!==null)return a;o=o.sibling}return null}var Ql=t.unstable_scheduleCallback,Zl=t.unstable_cancelCallback,qd=t.unstable_shouldYield,Gd=t.unstable_requestPaint,Ot=t.unstable_now,Yd=t.unstable_getCurrentPriorityLevel,ya=t.unstable_ImmediatePriority,_t=t.unstable_UserBlockingPriority,Vr=t.unstable_NormalPriority,va=t.unstable_LowPriority,ec=t.unstable_IdlePriority,Wo=null,er=null;function ba(o){if(er&&typeof er.onCommitFiberRoot=="function")try{er.onCommitFiberRoot(Wo,o,void 0,(o.current.flags&128)===128)}catch{}}var _n=Math.clz32?Math.clz32:Xd,Ko=Math.log,Jd=Math.LN2;function Xd(o){return o>>>=0,o===0?32:31-(Ko(o)/Jd|0)|0}var qo=64,vn=4194304;function mo(o){switch(o&-o){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 o&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return o&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return o}}function Es(o,a){var u=o.pendingLanes;if(u===0)return 0;var g=0,b=o.suspendedLanes,k=o.pingedLanes,A=u&268435455;if(A!==0){var z=A&~b;z!==0?g=mo(z):(k&=A,k!==0&&(g=mo(k)))}else A=u&~b,A!==0?g=mo(A):k!==0&&(g=mo(k));if(g===0)return 0;if(a!==0&&a!==g&&(a&b)===0&&(b=g&-g,k=a&-a,b>=k||b===16&&(k&4194240)!==0))return a;if((g&4)!==0&&(g|=u&16),a=o.entangledLanes,a!==0)for(o=o.entanglements,a&=g;0<a;)u=31-_n(a),b=1<<u,g|=o[u],a&=~b;return g}function Qd(o,a){switch(o){case 1:case 2:case 4:return a+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 a+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 Zd(o,a){for(var u=o.suspendedLanes,g=o.pingedLanes,b=o.expirationTimes,k=o.pendingLanes;0<k;){var A=31-_n(k),z=1<<A,V=b[A];V===-1?((z&u)===0||(z&g)!==0)&&(b[A]=Qd(z,a)):V<=a&&(o.expiredLanes|=z),k&=~z}}function wa(o){return o=o.pendingLanes&-1073741825,o!==0?o:o&1073741824?1073741824:0}function ds(){var o=qo;return qo<<=1,(qo&4194240)===0&&(qo=64),o}function O(o){for(var a=[],u=0;31>u;u++)a.push(o);return a}function re(o,a,u){o.pendingLanes|=a,a!==536870912&&(o.suspendedLanes=0,o.pingedLanes=0),o=o.eventTimes,a=31-_n(a),o[a]=u}function xe(o,a){var u=o.pendingLanes&~a;o.pendingLanes=a,o.suspendedLanes=0,o.pingedLanes=0,o.expiredLanes&=a,o.mutableReadLanes&=a,o.entangledLanes&=a,a=o.entanglements;var g=o.eventTimes;for(o=o.expirationTimes;0<u;){var b=31-_n(u),k=1<<b;a[b]=0,g[b]=-1,o[b]=-1,u&=~k}}function Pe(o,a){var u=o.entangledLanes|=a;for(o=o.entanglements;u;){var g=31-_n(u),b=1<<g;b&a|o[g]&a&&(o[g]|=a),u&=~b}}var $e=0;function at(o){return o&=-o,1<o?4<o?(o&268435455)!==0?16:536870912:4:1}var yt,Rn,An,tr,gr,Go=!1,ho=[],nr=null,Wr=null,Ts=null,ja=new Map,ka=new Map,Ps=[],xN="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 nx(o,a){switch(o){case"focusin":case"focusout":nr=null;break;case"dragenter":case"dragleave":Wr=null;break;case"mouseover":case"mouseout":Ts=null;break;case"pointerover":case"pointerout":ja.delete(a.pointerId);break;case"gotpointercapture":case"lostpointercapture":ka.delete(a.pointerId)}}function Sa(o,a,u,g,b,k){return o===null||o.nativeEvent!==k?(o={blockedOn:a,domEventName:u,eventSystemFlags:g,nativeEvent:k,targetContainers:[b]},a!==null&&(a=Ma(a),a!==null&&Rn(a)),o):(o.eventSystemFlags|=g,a=o.targetContainers,b!==null&&a.indexOf(b)===-1&&a.push(b),o)}function yN(o,a,u,g,b){switch(a){case"focusin":return nr=Sa(nr,o,a,u,g,b),!0;case"dragenter":return Wr=Sa(Wr,o,a,u,g,b),!0;case"mouseover":return Ts=Sa(Ts,o,a,u,g,b),!0;case"pointerover":var k=b.pointerId;return ja.set(k,Sa(ja.get(k)||null,o,a,u,g,b)),!0;case"gotpointercapture":return k=b.pointerId,ka.set(k,Sa(ka.get(k)||null,o,a,u,g,b)),!0}return!1}function rx(o){var a=go(o.target);if(a!==null){var u=Ar(a);if(u!==null){if(a=u.tag,a===13){if(a=Vo(u),a!==null){o.blockedOn=a,gr(o.priority,function(){An(u)});return}}else if(a===3&&u.stateNode.current.memoizedState.isDehydrated){o.blockedOn=u.tag===3?u.stateNode.containerInfo:null;return}}}o.blockedOn=null}function tc(o){if(o.blockedOn!==null)return!1;for(var a=o.targetContainers;0<a.length;){var u=tf(o.domEventName,o.eventSystemFlags,a[0],o.nativeEvent);if(u===null){u=o.nativeEvent;var g=new u.constructor(u.type,u);Bt=g,u.target.dispatchEvent(g),Bt=null}else return a=Ma(u),a!==null&&Rn(a),o.blockedOn=u,!1;a.shift()}return!0}function sx(o,a,u){tc(o)&&u.delete(a)}function vN(){Go=!1,nr!==null&&tc(nr)&&(nr=null),Wr!==null&&tc(Wr)&&(Wr=null),Ts!==null&&tc(Ts)&&(Ts=null),ja.forEach(sx),ka.forEach(sx)}function Na(o,a){o.blockedOn===a&&(o.blockedOn=null,Go||(Go=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,vN)))}function Ca(o){function a(b){return Na(b,o)}if(0<ho.length){Na(ho[0],o);for(var u=1;u<ho.length;u++){var g=ho[u];g.blockedOn===o&&(g.blockedOn=null)}}for(nr!==null&&Na(nr,o),Wr!==null&&Na(Wr,o),Ts!==null&&Na(Ts,o),ja.forEach(a),ka.forEach(a),u=0;u<Ps.length;u++)g=Ps[u],g.blockedOn===o&&(g.blockedOn=null);for(;0<Ps.length&&(u=Ps[0],u.blockedOn===null);)rx(u),u.blockedOn===null&&Ps.shift()}var Yo=P.ReactCurrentBatchConfig,nc=!0;function bN(o,a,u,g){var b=$e,k=Yo.transition;Yo.transition=null;try{$e=1,ef(o,a,u,g)}finally{$e=b,Yo.transition=k}}function wN(o,a,u,g){var b=$e,k=Yo.transition;Yo.transition=null;try{$e=4,ef(o,a,u,g)}finally{$e=b,Yo.transition=k}}function ef(o,a,u,g){if(nc){var b=tf(o,a,u,g);if(b===null)vf(o,a,g,rc,u),nx(o,g);else if(yN(b,o,a,u,g))g.stopPropagation();else if(nx(o,g),a&4&&-1<xN.indexOf(o)){for(;b!==null;){var k=Ma(b);if(k!==null&&yt(k),k=tf(o,a,u,g),k===null&&vf(o,a,g,rc,u),k===b)break;b=k}b!==null&&g.stopPropagation()}else vf(o,a,g,null,u)}}var rc=null;function tf(o,a,u,g){if(rc=null,o=rn(g),o=go(o),o!==null)if(a=Ar(o),a===null)o=null;else if(u=a.tag,u===13){if(o=Vo(a),o!==null)return o;o=null}else if(u===3){if(a.stateNode.current.memoizedState.isDehydrated)return a.tag===3?a.stateNode.containerInfo:null;o=null}else a!==o&&(o=null);return rc=o,null}function ox(o){switch(o){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(Yd()){case ya:return 1;case _t:return 4;case Vr:case va:return 16;case ec:return 536870912;default:return 16}default:return 16}}var Rs=null,nf=null,sc=null;function ix(){if(sc)return sc;var o,a=nf,u=a.length,g,b="value"in Rs?Rs.value:Rs.textContent,k=b.length;for(o=0;o<u&&a[o]===b[o];o++);var A=u-o;for(g=1;g<=A&&a[u-g]===b[k-g];g++);return sc=b.slice(o,1<g?1-g:void 0)}function oc(o){var a=o.keyCode;return"charCode"in o?(o=o.charCode,o===0&&a===13&&(o=13)):o=a,o===10&&(o=13),32<=o||o===13?o:0}function ic(){return!0}function ax(){return!1}function rr(o){function a(u,g,b,k,A){this._reactName=u,this._targetInst=b,this.type=g,this.nativeEvent=k,this.target=A,this.currentTarget=null;for(var z in o)o.hasOwnProperty(z)&&(u=o[z],this[z]=u?u(k):k[z]);return this.isDefaultPrevented=(k.defaultPrevented!=null?k.defaultPrevented:k.returnValue===!1)?ic:ax,this.isPropagationStopped=ax,this}return T(a.prototype,{preventDefault:function(){this.defaultPrevented=!0;var u=this.nativeEvent;u&&(u.preventDefault?u.preventDefault():typeof u.returnValue!="unknown"&&(u.returnValue=!1),this.isDefaultPrevented=ic)},stopPropagation:function(){var u=this.nativeEvent;u&&(u.stopPropagation?u.stopPropagation():typeof u.cancelBubble!="unknown"&&(u.cancelBubble=!0),this.isPropagationStopped=ic)},persist:function(){},isPersistent:ic}),a}var Jo={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(o){return o.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},rf=rr(Jo),Ea=T({},Jo,{view:0,detail:0}),jN=rr(Ea),sf,of,Ta,ac=T({},Ea,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:lf,button:0,buttons:0,relatedTarget:function(o){return o.relatedTarget===void 0?o.fromElement===o.srcElement?o.toElement:o.fromElement:o.relatedTarget},movementX:function(o){return"movementX"in o?o.movementX:(o!==Ta&&(Ta&&o.type==="mousemove"?(sf=o.screenX-Ta.screenX,of=o.screenY-Ta.screenY):of=sf=0,Ta=o),sf)},movementY:function(o){return"movementY"in o?o.movementY:of}}),lx=rr(ac),kN=T({},ac,{dataTransfer:0}),SN=rr(kN),NN=T({},Ea,{relatedTarget:0}),af=rr(NN),CN=T({},Jo,{animationName:0,elapsedTime:0,pseudoElement:0}),EN=rr(CN),TN=T({},Jo,{clipboardData:function(o){return"clipboardData"in o?o.clipboardData:window.clipboardData}}),PN=rr(TN),RN=T({},Jo,{data:0}),cx=rr(RN),AN={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},DN={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"},$N={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function LN(o){var a=this.nativeEvent;return a.getModifierState?a.getModifierState(o):(o=$N[o])?!!a[o]:!1}function lf(){return LN}var IN=T({},Ea,{key:function(o){if(o.key){var a=AN[o.key]||o.key;if(a!=="Unidentified")return a}return o.type==="keypress"?(o=oc(o),o===13?"Enter":String.fromCharCode(o)):o.type==="keydown"||o.type==="keyup"?DN[o.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:lf,charCode:function(o){return o.type==="keypress"?oc(o):0},keyCode:function(o){return o.type==="keydown"||o.type==="keyup"?o.keyCode:0},which:function(o){return o.type==="keypress"?oc(o):o.type==="keydown"||o.type==="keyup"?o.keyCode:0}}),ON=rr(IN),_N=T({},ac,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),ux=rr(_N),MN=T({},Ea,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:lf}),FN=rr(MN),zN=T({},Jo,{propertyName:0,elapsedTime:0,pseudoElement:0}),BN=rr(zN),UN=T({},ac,{deltaX:function(o){return"deltaX"in o?o.deltaX:"wheelDeltaX"in o?-o.wheelDeltaX:0},deltaY:function(o){return"deltaY"in o?o.deltaY:"wheelDeltaY"in o?-o.wheelDeltaY:"wheelDelta"in o?-o.wheelDelta:0},deltaZ:0,deltaMode:0}),HN=rr(UN),VN=[9,13,27,32],cf=d&&"CompositionEvent"in window,Pa=null;d&&"documentMode"in document&&(Pa=document.documentMode);var WN=d&&"TextEvent"in window&&!Pa,dx=d&&(!cf||Pa&&8<Pa&&11>=Pa),fx=" ",px=!1;function mx(o,a){switch(o){case"keyup":return VN.indexOf(a.keyCode)!==-1;case"keydown":return a.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function hx(o){return o=o.detail,typeof o=="object"&&"data"in o?o.data:null}var Xo=!1;function KN(o,a){switch(o){case"compositionend":return hx(a);case"keypress":return a.which!==32?null:(px=!0,fx);case"textInput":return o=a.data,o===fx&&px?null:o;default:return null}}function qN(o,a){if(Xo)return o==="compositionend"||!cf&&mx(o,a)?(o=ix(),sc=nf=Rs=null,Xo=!1,o):null;switch(o){case"paste":return null;case"keypress":if(!(a.ctrlKey||a.altKey||a.metaKey)||a.ctrlKey&&a.altKey){if(a.char&&1<a.char.length)return a.char;if(a.which)return String.fromCharCode(a.which)}return null;case"compositionend":return dx&&a.locale!=="ko"?null:a.data;default:return null}}var GN={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 gx(o){var a=o&&o.nodeName&&o.nodeName.toLowerCase();return a==="input"?!!GN[o.type]:a==="textarea"}function xx(o,a,u,g){Dt(g),a=fc(a,"onChange"),0<a.length&&(u=new rf("onChange","change",null,u,g),o.push({event:u,listeners:a}))}var Ra=null,Aa=null;function YN(o){Ix(o,0)}function lc(o){var a=ni(o);if(He(a))return o}function JN(o,a){if(o==="change")return a}var yx=!1;if(d){var uf;if(d){var df="oninput"in document;if(!df){var vx=document.createElement("div");vx.setAttribute("oninput","return;"),df=typeof vx.oninput=="function"}uf=df}else uf=!1;yx=uf&&(!document.documentMode||9<document.documentMode)}function bx(){Ra&&(Ra.detachEvent("onpropertychange",wx),Aa=Ra=null)}function wx(o){if(o.propertyName==="value"&&lc(Aa)){var a=[];xx(a,Aa,o,rn(o)),qt(YN,a)}}function XN(o,a,u){o==="focusin"?(bx(),Ra=a,Aa=u,Ra.attachEvent("onpropertychange",wx)):o==="focusout"&&bx()}function QN(o){if(o==="selectionchange"||o==="keyup"||o==="keydown")return lc(Aa)}function ZN(o,a){if(o==="click")return lc(a)}function eC(o,a){if(o==="input"||o==="change")return lc(a)}function tC(o,a){return o===a&&(o!==0||1/o===1/a)||o!==o&&a!==a}var Dr=typeof Object.is=="function"?Object.is:tC;function Da(o,a){if(Dr(o,a))return!0;if(typeof o!="object"||o===null||typeof a!="object"||a===null)return!1;var u=Object.keys(o),g=Object.keys(a);if(u.length!==g.length)return!1;for(g=0;g<u.length;g++){var b=u[g];if(!p.call(a,b)||!Dr(o[b],a[b]))return!1}return!0}function jx(o){for(;o&&o.firstChild;)o=o.firstChild;return o}function kx(o,a){var u=jx(o);o=0;for(var g;u;){if(u.nodeType===3){if(g=o+u.textContent.length,o<=a&&g>=a)return{node:u,offset:a-o};o=g}e:{for(;u;){if(u.nextSibling){u=u.nextSibling;break e}u=u.parentNode}u=void 0}u=jx(u)}}function Sx(o,a){return o&&a?o===a?!0:o&&o.nodeType===3?!1:a&&a.nodeType===3?Sx(o,a.parentNode):"contains"in o?o.contains(a):o.compareDocumentPosition?!!(o.compareDocumentPosition(a)&16):!1:!1}function Nx(){for(var o=window,a=te();a instanceof o.HTMLIFrameElement;){try{var u=typeof a.contentWindow.location.href=="string"}catch{u=!1}if(u)o=a.contentWindow;else break;a=te(o.document)}return a}function ff(o){var a=o&&o.nodeName&&o.nodeName.toLowerCase();return a&&(a==="input"&&(o.type==="text"||o.type==="search"||o.type==="tel"||o.type==="url"||o.type==="password")||a==="textarea"||o.contentEditable==="true")}function nC(o){var a=Nx(),u=o.focusedElem,g=o.selectionRange;if(a!==u&&u&&u.ownerDocument&&Sx(u.ownerDocument.documentElement,u)){if(g!==null&&ff(u)){if(a=g.start,o=g.end,o===void 0&&(o=a),"selectionStart"in u)u.selectionStart=a,u.selectionEnd=Math.min(o,u.value.length);else if(o=(a=u.ownerDocument||document)&&a.defaultView||window,o.getSelection){o=o.getSelection();var b=u.textContent.length,k=Math.min(g.start,b);g=g.end===void 0?k:Math.min(g.end,b),!o.extend&&k>g&&(b=g,g=k,k=b),b=kx(u,k);var A=kx(u,g);b&&A&&(o.rangeCount!==1||o.anchorNode!==b.node||o.anchorOffset!==b.offset||o.focusNode!==A.node||o.focusOffset!==A.offset)&&(a=a.createRange(),a.setStart(b.node,b.offset),o.removeAllRanges(),k>g?(o.addRange(a),o.extend(A.node,A.offset)):(a.setEnd(A.node,A.offset),o.addRange(a)))}}for(a=[],o=u;o=o.parentNode;)o.nodeType===1&&a.push({element:o,left:o.scrollLeft,top:o.scrollTop});for(typeof u.focus=="function"&&u.focus(),u=0;u<a.length;u++)o=a[u],o.element.scrollLeft=o.left,o.element.scrollTop=o.top}}var rC=d&&"documentMode"in document&&11>=document.documentMode,Qo=null,pf=null,$a=null,mf=!1;function Cx(o,a,u){var g=u.window===u?u.document:u.nodeType===9?u:u.ownerDocument;mf||Qo==null||Qo!==te(g)||(g=Qo,"selectionStart"in g&&ff(g)?g={start:g.selectionStart,end:g.selectionEnd}:(g=(g.ownerDocument&&g.ownerDocument.defaultView||window).getSelection(),g={anchorNode:g.anchorNode,anchorOffset:g.anchorOffset,focusNode:g.focusNode,focusOffset:g.focusOffset}),$a&&Da($a,g)||($a=g,g=fc(pf,"onSelect"),0<g.length&&(a=new rf("onSelect","select",null,a,u),o.push({event:a,listeners:g}),a.target=Qo)))}function cc(o,a){var u={};return u[o.toLowerCase()]=a.toLowerCase(),u["Webkit"+o]="webkit"+a,u["Moz"+o]="moz"+a,u}var Zo={animationend:cc("Animation","AnimationEnd"),animationiteration:cc("Animation","AnimationIteration"),animationstart:cc("Animation","AnimationStart"),transitionend:cc("Transition","TransitionEnd")},hf={},Ex={};d&&(Ex=document.createElement("div").style,"AnimationEvent"in window||(delete Zo.animationend.animation,delete Zo.animationiteration.animation,delete Zo.animationstart.animation),"TransitionEvent"in window||delete Zo.transitionend.transition);function uc(o){if(hf[o])return hf[o];if(!Zo[o])return o;var a=Zo[o],u;for(u in a)if(a.hasOwnProperty(u)&&u in Ex)return hf[o]=a[u];return o}var Tx=uc("animationend"),Px=uc("animationiteration"),Rx=uc("animationstart"),Ax=uc("transitionend"),Dx=new Map,$x="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 As(o,a){Dx.set(o,a),l(a,[o])}for(var gf=0;gf<$x.length;gf++){var xf=$x[gf],sC=xf.toLowerCase(),oC=xf[0].toUpperCase()+xf.slice(1);As(sC,"on"+oC)}As(Tx,"onAnimationEnd"),As(Px,"onAnimationIteration"),As(Rx,"onAnimationStart"),As("dblclick","onDoubleClick"),As("focusin","onFocus"),As("focusout","onBlur"),As(Ax,"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 La="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(" "),iC=new Set("cancel close invalid load scroll toggle".split(" ").concat(La));function Lx(o,a,u){var g=o.type||"unknown-event";o.currentTarget=u,xa(g,a,void 0,o),o.currentTarget=null}function Ix(o,a){a=(a&4)!==0;for(var u=0;u<o.length;u++){var g=o[u],b=g.event;g=g.listeners;e:{var k=void 0;if(a)for(var A=g.length-1;0<=A;A--){var z=g[A],V=z.instance,le=z.currentTarget;if(z=z.listener,V!==k&&b.isPropagationStopped())break e;Lx(b,z,le),k=V}else for(A=0;A<g.length;A++){if(z=g[A],V=z.instance,le=z.currentTarget,z=z.listener,V!==k&&b.isPropagationStopped())break e;Lx(b,z,le),k=V}}}if(yn)throw o=Zn,yn=!1,Zn=null,o}function Nt(o,a){var u=a[Nf];u===void 0&&(u=a[Nf]=new Set);var g=o+"__bubble";u.has(g)||(Ox(a,o,2,!1),u.add(g))}function yf(o,a,u){var g=0;a&&(g|=4),Ox(u,o,g,a)}var dc="_reactListening"+Math.random().toString(36).slice(2);function Ia(o){if(!o[dc]){o[dc]=!0,s.forEach(function(u){u!=="selectionchange"&&(iC.has(u)||yf(u,!1,o),yf(u,!0,o))});var a=o.nodeType===9?o:o.ownerDocument;a===null||a[dc]||(a[dc]=!0,yf("selectionchange",!1,a))}}function Ox(o,a,u,g){switch(ox(a)){case 1:var b=bN;break;case 4:b=wN;break;default:b=ef}u=b.bind(null,a,u,o),b=void 0,!fn||a!=="touchstart"&&a!=="touchmove"&&a!=="wheel"||(b=!0),g?b!==void 0?o.addEventListener(a,u,{capture:!0,passive:b}):o.addEventListener(a,u,!0):b!==void 0?o.addEventListener(a,u,{passive:b}):o.addEventListener(a,u,!1)}function vf(o,a,u,g,b){var k=g;if((a&1)===0&&(a&2)===0&&g!==null)e:for(;;){if(g===null)return;var A=g.tag;if(A===3||A===4){var z=g.stateNode.containerInfo;if(z===b||z.nodeType===8&&z.parentNode===b)break;if(A===4)for(A=g.return;A!==null;){var V=A.tag;if((V===3||V===4)&&(V=A.stateNode.containerInfo,V===b||V.nodeType===8&&V.parentNode===b))return;A=A.return}for(;z!==null;){if(A=go(z),A===null)return;if(V=A.tag,V===5||V===6){g=k=A;continue e}z=z.parentNode}}g=g.return}qt(function(){var le=k,je=rn(u),ke=[];e:{var be=Dx.get(o);if(be!==void 0){var Ae=rf,Ie=o;switch(o){case"keypress":if(oc(u)===0)break e;case"keydown":case"keyup":Ae=ON;break;case"focusin":Ie="focus",Ae=af;break;case"focusout":Ie="blur",Ae=af;break;case"beforeblur":case"afterblur":Ae=af;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":Ae=lx;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":Ae=SN;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":Ae=FN;break;case Tx:case Px:case Rx:Ae=EN;break;case Ax:Ae=BN;break;case"scroll":Ae=jN;break;case"wheel":Ae=HN;break;case"copy":case"cut":case"paste":Ae=PN;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":Ae=ux}var Me=(a&4)!==0,Gt=!Me&&o==="scroll",ee=Me?be!==null?be+"Capture":null:be;Me=[];for(var G=le,se;G!==null;){se=G;var Ce=se.stateNode;if(se.tag===5&&Ce!==null&&(se=Ce,ee!==null&&(Ce=nt(G,ee),Ce!=null&&Me.push(Oa(G,Ce,se)))),Gt)break;G=G.return}0<Me.length&&(be=new Ae(be,Ie,null,u,je),ke.push({event:be,listeners:Me}))}}if((a&7)===0){e:{if(be=o==="mouseover"||o==="pointerover",Ae=o==="mouseout"||o==="pointerout",be&&u!==Bt&&(Ie=u.relatedTarget||u.fromElement)&&(go(Ie)||Ie[fs]))break e;if((Ae||be)&&(be=je.window===je?je:(be=je.ownerDocument)?be.defaultView||be.parentWindow:window,Ae?(Ie=u.relatedTarget||u.toElement,Ae=le,Ie=Ie?go(Ie):null,Ie!==null&&(Gt=Ar(Ie),Ie!==Gt||Ie.tag!==5&&Ie.tag!==6)&&(Ie=null)):(Ae=null,Ie=le),Ae!==Ie)){if(Me=lx,Ce="onMouseLeave",ee="onMouseEnter",G="mouse",(o==="pointerout"||o==="pointerover")&&(Me=ux,Ce="onPointerLeave",ee="onPointerEnter",G="pointer"),Gt=Ae==null?be:ni(Ae),se=Ie==null?be:ni(Ie),be=new Me(Ce,G+"leave",Ae,u,je),be.target=Gt,be.relatedTarget=se,Ce=null,go(je)===le&&(Me=new Me(ee,G+"enter",Ie,u,je),Me.target=se,Me.relatedTarget=Gt,Ce=Me),Gt=Ce,Ae&&Ie)t:{for(Me=Ae,ee=Ie,G=0,se=Me;se;se=ei(se))G++;for(se=0,Ce=ee;Ce;Ce=ei(Ce))se++;for(;0<G-se;)Me=ei(Me),G--;for(;0<se-G;)ee=ei(ee),se--;for(;G--;){if(Me===ee||ee!==null&&Me===ee.alternate)break t;Me=ei(Me),ee=ei(ee)}Me=null}else Me=null;Ae!==null&&_x(ke,be,Ae,Me,!1),Ie!==null&&Gt!==null&&_x(ke,Gt,Ie,Me,!0)}}e:{if(be=le?ni(le):window,Ae=be.nodeName&&be.nodeName.toLowerCase(),Ae==="select"||Ae==="input"&&be.type==="file")var Be=JN;else if(gx(be))if(yx)Be=eC;else{Be=QN;var We=XN}else(Ae=be.nodeName)&&Ae.toLowerCase()==="input"&&(be.type==="checkbox"||be.type==="radio")&&(Be=ZN);if(Be&&(Be=Be(o,le))){xx(ke,Be,u,je);break e}We&&We(o,be,le),o==="focusout"&&(We=be._wrapperState)&&We.controlled&&be.type==="number"&&Fe(be,"number",be.value)}switch(We=le?ni(le):window,o){case"focusin":(gx(We)||We.contentEditable==="true")&&(Qo=We,pf=le,$a=null);break;case"focusout":$a=pf=Qo=null;break;case"mousedown":mf=!0;break;case"contextmenu":case"mouseup":case"dragend":mf=!1,Cx(ke,u,je);break;case"selectionchange":if(rC)break;case"keydown":case"keyup":Cx(ke,u,je)}var Ke;if(cf)e:{switch(o){case"compositionstart":var Je="onCompositionStart";break e;case"compositionend":Je="onCompositionEnd";break e;case"compositionupdate":Je="onCompositionUpdate";break e}Je=void 0}else Xo?mx(o,u)&&(Je="onCompositionEnd"):o==="keydown"&&u.keyCode===229&&(Je="onCompositionStart");Je&&(dx&&u.locale!=="ko"&&(Xo||Je!=="onCompositionStart"?Je==="onCompositionEnd"&&Xo&&(Ke=ix()):(Rs=je,nf="value"in Rs?Rs.value:Rs.textContent,Xo=!0)),We=fc(le,Je),0<We.length&&(Je=new cx(Je,o,null,u,je),ke.push({event:Je,listeners:We}),Ke?Je.data=Ke:(Ke=hx(u),Ke!==null&&(Je.data=Ke)))),(Ke=WN?KN(o,u):qN(o,u))&&(le=fc(le,"onBeforeInput"),0<le.length&&(je=new cx("onBeforeInput","beforeinput",null,u,je),ke.push({event:je,listeners:le}),je.data=Ke))}Ix(ke,a)})}function Oa(o,a,u){return{instance:o,listener:a,currentTarget:u}}function fc(o,a){for(var u=a+"Capture",g=[];o!==null;){var b=o,k=b.stateNode;b.tag===5&&k!==null&&(b=k,k=nt(o,u),k!=null&&g.unshift(Oa(o,k,b)),k=nt(o,a),k!=null&&g.push(Oa(o,k,b))),o=o.return}return g}function ei(o){if(o===null)return null;do o=o.return;while(o&&o.tag!==5);return o||null}function _x(o,a,u,g,b){for(var k=a._reactName,A=[];u!==null&&u!==g;){var z=u,V=z.alternate,le=z.stateNode;if(V!==null&&V===g)break;z.tag===5&&le!==null&&(z=le,b?(V=nt(u,k),V!=null&&A.unshift(Oa(u,V,z))):b||(V=nt(u,k),V!=null&&A.push(Oa(u,V,z)))),u=u.return}A.length!==0&&o.push({event:a,listeners:A})}var aC=/\r\n?/g,lC=/\u0000|\uFFFD/g;function Mx(o){return(typeof o=="string"?o:""+o).replace(aC,`
|
|
38
|
+
`).replace(lC,"")}function pc(o,a,u){if(a=Mx(a),Mx(o)!==a&&u)throw Error(n(425))}function mc(){}var bf=null,wf=null;function jf(o,a){return o==="textarea"||o==="noscript"||typeof a.children=="string"||typeof a.children=="number"||typeof a.dangerouslySetInnerHTML=="object"&&a.dangerouslySetInnerHTML!==null&&a.dangerouslySetInnerHTML.__html!=null}var kf=typeof setTimeout=="function"?setTimeout:void 0,cC=typeof clearTimeout=="function"?clearTimeout:void 0,Fx=typeof Promise=="function"?Promise:void 0,uC=typeof queueMicrotask=="function"?queueMicrotask:typeof Fx<"u"?function(o){return Fx.resolve(null).then(o).catch(dC)}:kf;function dC(o){setTimeout(function(){throw o})}function Sf(o,a){var u=a,g=0;do{var b=u.nextSibling;if(o.removeChild(u),b&&b.nodeType===8)if(u=b.data,u==="/$"){if(g===0){o.removeChild(b),Ca(a);return}g--}else u!=="$"&&u!=="$?"&&u!=="$!"||g++;u=b}while(u);Ca(a)}function Ds(o){for(;o!=null;o=o.nextSibling){var a=o.nodeType;if(a===1||a===3)break;if(a===8){if(a=o.data,a==="$"||a==="$!"||a==="$?")break;if(a==="/$")return null}}return o}function zx(o){o=o.previousSibling;for(var a=0;o;){if(o.nodeType===8){var u=o.data;if(u==="$"||u==="$!"||u==="$?"){if(a===0)return o;a--}else u==="/$"&&a++}o=o.previousSibling}return null}var ti=Math.random().toString(36).slice(2),Kr="__reactFiber$"+ti,_a="__reactProps$"+ti,fs="__reactContainer$"+ti,Nf="__reactEvents$"+ti,fC="__reactListeners$"+ti,pC="__reactHandles$"+ti;function go(o){var a=o[Kr];if(a)return a;for(var u=o.parentNode;u;){if(a=u[fs]||u[Kr]){if(u=a.alternate,a.child!==null||u!==null&&u.child!==null)for(o=zx(o);o!==null;){if(u=o[Kr])return u;o=zx(o)}return a}o=u,u=o.parentNode}return null}function Ma(o){return o=o[Kr]||o[fs],!o||o.tag!==5&&o.tag!==6&&o.tag!==13&&o.tag!==3?null:o}function ni(o){if(o.tag===5||o.tag===6)return o.stateNode;throw Error(n(33))}function hc(o){return o[_a]||null}var Cf=[],ri=-1;function $s(o){return{current:o}}function Ct(o){0>ri||(o.current=Cf[ri],Cf[ri]=null,ri--)}function wt(o,a){ri++,Cf[ri]=o.current,o.current=a}var Ls={},Sn=$s(Ls),Mn=$s(!1),xo=Ls;function si(o,a){var u=o.type.contextTypes;if(!u)return Ls;var g=o.stateNode;if(g&&g.__reactInternalMemoizedUnmaskedChildContext===a)return g.__reactInternalMemoizedMaskedChildContext;var b={},k;for(k in u)b[k]=a[k];return g&&(o=o.stateNode,o.__reactInternalMemoizedUnmaskedChildContext=a,o.__reactInternalMemoizedMaskedChildContext=b),b}function Fn(o){return o=o.childContextTypes,o!=null}function gc(){Ct(Mn),Ct(Sn)}function Bx(o,a,u){if(Sn.current!==Ls)throw Error(n(168));wt(Sn,a),wt(Mn,u)}function Ux(o,a,u){var g=o.stateNode;if(a=a.childContextTypes,typeof g.getChildContext!="function")return u;g=g.getChildContext();for(var b in g)if(!(b in a))throw Error(n(108,oe(o)||"Unknown",b));return T({},u,g)}function xc(o){return o=(o=o.stateNode)&&o.__reactInternalMemoizedMergedChildContext||Ls,xo=Sn.current,wt(Sn,o),wt(Mn,Mn.current),!0}function Hx(o,a,u){var g=o.stateNode;if(!g)throw Error(n(169));u?(o=Ux(o,a,xo),g.__reactInternalMemoizedMergedChildContext=o,Ct(Mn),Ct(Sn),wt(Sn,o)):Ct(Mn),wt(Mn,u)}var ps=null,yc=!1,Ef=!1;function Vx(o){ps===null?ps=[o]:ps.push(o)}function mC(o){yc=!0,Vx(o)}function Is(){if(!Ef&&ps!==null){Ef=!0;var o=0,a=$e;try{var u=ps;for($e=1;o<u.length;o++){var g=u[o];do g=g(!0);while(g!==null)}ps=null,yc=!1}catch(b){throw ps!==null&&(ps=ps.slice(o+1)),Ql(ya,Is),b}finally{$e=a,Ef=!1}}return null}var oi=[],ii=0,vc=null,bc=0,xr=[],yr=0,yo=null,ms=1,hs="";function vo(o,a){oi[ii++]=bc,oi[ii++]=vc,vc=o,bc=a}function Wx(o,a,u){xr[yr++]=ms,xr[yr++]=hs,xr[yr++]=yo,yo=o;var g=ms;o=hs;var b=32-_n(g)-1;g&=~(1<<b),u+=1;var k=32-_n(a)+b;if(30<k){var A=b-b%5;k=(g&(1<<A)-1).toString(32),g>>=A,b-=A,ms=1<<32-_n(a)+b|u<<b|g,hs=k+o}else ms=1<<k|u<<b|g,hs=o}function Tf(o){o.return!==null&&(vo(o,1),Wx(o,1,0))}function Pf(o){for(;o===vc;)vc=oi[--ii],oi[ii]=null,bc=oi[--ii],oi[ii]=null;for(;o===yo;)yo=xr[--yr],xr[yr]=null,hs=xr[--yr],xr[yr]=null,ms=xr[--yr],xr[yr]=null}var sr=null,or=null,$t=!1,$r=null;function Kx(o,a){var u=jr(5,null,null,0);u.elementType="DELETED",u.stateNode=a,u.return=o,a=o.deletions,a===null?(o.deletions=[u],o.flags|=16):a.push(u)}function qx(o,a){switch(o.tag){case 5:var u=o.type;return a=a.nodeType!==1||u.toLowerCase()!==a.nodeName.toLowerCase()?null:a,a!==null?(o.stateNode=a,sr=o,or=Ds(a.firstChild),!0):!1;case 6:return a=o.pendingProps===""||a.nodeType!==3?null:a,a!==null?(o.stateNode=a,sr=o,or=null,!0):!1;case 13:return a=a.nodeType!==8?null:a,a!==null?(u=yo!==null?{id:ms,overflow:hs}:null,o.memoizedState={dehydrated:a,treeContext:u,retryLane:1073741824},u=jr(18,null,null,0),u.stateNode=a,u.return=o,o.child=u,sr=o,or=null,!0):!1;default:return!1}}function Rf(o){return(o.mode&1)!==0&&(o.flags&128)===0}function Af(o){if($t){var a=or;if(a){var u=a;if(!qx(o,a)){if(Rf(o))throw Error(n(418));a=Ds(u.nextSibling);var g=sr;a&&qx(o,a)?Kx(g,u):(o.flags=o.flags&-4097|2,$t=!1,sr=o)}}else{if(Rf(o))throw Error(n(418));o.flags=o.flags&-4097|2,$t=!1,sr=o}}}function Gx(o){for(o=o.return;o!==null&&o.tag!==5&&o.tag!==3&&o.tag!==13;)o=o.return;sr=o}function wc(o){if(o!==sr)return!1;if(!$t)return Gx(o),$t=!0,!1;var a;if((a=o.tag!==3)&&!(a=o.tag!==5)&&(a=o.type,a=a!=="head"&&a!=="body"&&!jf(o.type,o.memoizedProps)),a&&(a=or)){if(Rf(o))throw Yx(),Error(n(418));for(;a;)Kx(o,a),a=Ds(a.nextSibling)}if(Gx(o),o.tag===13){if(o=o.memoizedState,o=o!==null?o.dehydrated:null,!o)throw Error(n(317));e:{for(o=o.nextSibling,a=0;o;){if(o.nodeType===8){var u=o.data;if(u==="/$"){if(a===0){or=Ds(o.nextSibling);break e}a--}else u!=="$"&&u!=="$!"&&u!=="$?"||a++}o=o.nextSibling}or=null}}else or=sr?Ds(o.stateNode.nextSibling):null;return!0}function Yx(){for(var o=or;o;)o=Ds(o.nextSibling)}function ai(){or=sr=null,$t=!1}function Df(o){$r===null?$r=[o]:$r.push(o)}var hC=P.ReactCurrentBatchConfig;function Fa(o,a,u){if(o=u.ref,o!==null&&typeof o!="function"&&typeof o!="object"){if(u._owner){if(u=u._owner,u){if(u.tag!==1)throw Error(n(309));var g=u.stateNode}if(!g)throw Error(n(147,o));var b=g,k=""+o;return a!==null&&a.ref!==null&&typeof a.ref=="function"&&a.ref._stringRef===k?a.ref:(a=function(A){var z=b.refs;A===null?delete z[k]:z[k]=A},a._stringRef=k,a)}if(typeof o!="string")throw Error(n(284));if(!u._owner)throw Error(n(290,o))}return o}function jc(o,a){throw o=Object.prototype.toString.call(a),Error(n(31,o==="[object Object]"?"object with keys {"+Object.keys(a).join(", ")+"}":o))}function Jx(o){var a=o._init;return a(o._payload)}function Xx(o){function a(ee,G){if(o){var se=ee.deletions;se===null?(ee.deletions=[G],ee.flags|=16):se.push(G)}}function u(ee,G){if(!o)return null;for(;G!==null;)a(ee,G),G=G.sibling;return null}function g(ee,G){for(ee=new Map;G!==null;)G.key!==null?ee.set(G.key,G):ee.set(G.index,G),G=G.sibling;return ee}function b(ee,G){return ee=Hs(ee,G),ee.index=0,ee.sibling=null,ee}function k(ee,G,se){return ee.index=se,o?(se=ee.alternate,se!==null?(se=se.index,se<G?(ee.flags|=2,G):se):(ee.flags|=2,G)):(ee.flags|=1048576,G)}function A(ee){return o&&ee.alternate===null&&(ee.flags|=2),ee}function z(ee,G,se,Ce){return G===null||G.tag!==6?(G=kp(se,ee.mode,Ce),G.return=ee,G):(G=b(G,se),G.return=ee,G)}function V(ee,G,se,Ce){var Be=se.type;return Be===$?je(ee,G,se.props.children,Ce,se.key):G!==null&&(G.elementType===Be||typeof Be=="object"&&Be!==null&&Be.$$typeof===Y&&Jx(Be)===G.type)?(Ce=b(G,se.props),Ce.ref=Fa(ee,G,se),Ce.return=ee,Ce):(Ce=Kc(se.type,se.key,se.props,null,ee.mode,Ce),Ce.ref=Fa(ee,G,se),Ce.return=ee,Ce)}function le(ee,G,se,Ce){return G===null||G.tag!==4||G.stateNode.containerInfo!==se.containerInfo||G.stateNode.implementation!==se.implementation?(G=Sp(se,ee.mode,Ce),G.return=ee,G):(G=b(G,se.children||[]),G.return=ee,G)}function je(ee,G,se,Ce,Be){return G===null||G.tag!==7?(G=Eo(se,ee.mode,Ce,Be),G.return=ee,G):(G=b(G,se),G.return=ee,G)}function ke(ee,G,se){if(typeof G=="string"&&G!==""||typeof G=="number")return G=kp(""+G,ee.mode,se),G.return=ee,G;if(typeof G=="object"&&G!==null){switch(G.$$typeof){case I:return se=Kc(G.type,G.key,G.props,null,ee.mode,se),se.ref=Fa(ee,null,G),se.return=ee,se;case R:return G=Sp(G,ee.mode,se),G.return=ee,G;case Y:var Ce=G._init;return ke(ee,Ce(G._payload),se)}if(qe(G)||ae(G))return G=Eo(G,ee.mode,se,null),G.return=ee,G;jc(ee,G)}return null}function be(ee,G,se,Ce){var Be=G!==null?G.key:null;if(typeof se=="string"&&se!==""||typeof se=="number")return Be!==null?null:z(ee,G,""+se,Ce);if(typeof se=="object"&&se!==null){switch(se.$$typeof){case I:return se.key===Be?V(ee,G,se,Ce):null;case R:return se.key===Be?le(ee,G,se,Ce):null;case Y:return Be=se._init,be(ee,G,Be(se._payload),Ce)}if(qe(se)||ae(se))return Be!==null?null:je(ee,G,se,Ce,null);jc(ee,se)}return null}function Ae(ee,G,se,Ce,Be){if(typeof Ce=="string"&&Ce!==""||typeof Ce=="number")return ee=ee.get(se)||null,z(G,ee,""+Ce,Be);if(typeof Ce=="object"&&Ce!==null){switch(Ce.$$typeof){case I:return ee=ee.get(Ce.key===null?se:Ce.key)||null,V(G,ee,Ce,Be);case R:return ee=ee.get(Ce.key===null?se:Ce.key)||null,le(G,ee,Ce,Be);case Y:var We=Ce._init;return Ae(ee,G,se,We(Ce._payload),Be)}if(qe(Ce)||ae(Ce))return ee=ee.get(se)||null,je(G,ee,Ce,Be,null);jc(G,Ce)}return null}function Ie(ee,G,se,Ce){for(var Be=null,We=null,Ke=G,Je=G=0,hn=null;Ke!==null&&Je<se.length;Je++){Ke.index>Je?(hn=Ke,Ke=null):hn=Ke.sibling;var ft=be(ee,Ke,se[Je],Ce);if(ft===null){Ke===null&&(Ke=hn);break}o&&Ke&&ft.alternate===null&&a(ee,Ke),G=k(ft,G,Je),We===null?Be=ft:We.sibling=ft,We=ft,Ke=hn}if(Je===se.length)return u(ee,Ke),$t&&vo(ee,Je),Be;if(Ke===null){for(;Je<se.length;Je++)Ke=ke(ee,se[Je],Ce),Ke!==null&&(G=k(Ke,G,Je),We===null?Be=Ke:We.sibling=Ke,We=Ke);return $t&&vo(ee,Je),Be}for(Ke=g(ee,Ke);Je<se.length;Je++)hn=Ae(Ke,ee,Je,se[Je],Ce),hn!==null&&(o&&hn.alternate!==null&&Ke.delete(hn.key===null?Je:hn.key),G=k(hn,G,Je),We===null?Be=hn:We.sibling=hn,We=hn);return o&&Ke.forEach(function(Vs){return a(ee,Vs)}),$t&&vo(ee,Je),Be}function Me(ee,G,se,Ce){var Be=ae(se);if(typeof Be!="function")throw Error(n(150));if(se=Be.call(se),se==null)throw Error(n(151));for(var We=Be=null,Ke=G,Je=G=0,hn=null,ft=se.next();Ke!==null&&!ft.done;Je++,ft=se.next()){Ke.index>Je?(hn=Ke,Ke=null):hn=Ke.sibling;var Vs=be(ee,Ke,ft.value,Ce);if(Vs===null){Ke===null&&(Ke=hn);break}o&&Ke&&Vs.alternate===null&&a(ee,Ke),G=k(Vs,G,Je),We===null?Be=Vs:We.sibling=Vs,We=Vs,Ke=hn}if(ft.done)return u(ee,Ke),$t&&vo(ee,Je),Be;if(Ke===null){for(;!ft.done;Je++,ft=se.next())ft=ke(ee,ft.value,Ce),ft!==null&&(G=k(ft,G,Je),We===null?Be=ft:We.sibling=ft,We=ft);return $t&&vo(ee,Je),Be}for(Ke=g(ee,Ke);!ft.done;Je++,ft=se.next())ft=Ae(Ke,ee,Je,ft.value,Ce),ft!==null&&(o&&ft.alternate!==null&&Ke.delete(ft.key===null?Je:ft.key),G=k(ft,G,Je),We===null?Be=ft:We.sibling=ft,We=ft);return o&&Ke.forEach(function(GC){return a(ee,GC)}),$t&&vo(ee,Je),Be}function Gt(ee,G,se,Ce){if(typeof se=="object"&&se!==null&&se.type===$&&se.key===null&&(se=se.props.children),typeof se=="object"&&se!==null){switch(se.$$typeof){case I:e:{for(var Be=se.key,We=G;We!==null;){if(We.key===Be){if(Be=se.type,Be===$){if(We.tag===7){u(ee,We.sibling),G=b(We,se.props.children),G.return=ee,ee=G;break e}}else if(We.elementType===Be||typeof Be=="object"&&Be!==null&&Be.$$typeof===Y&&Jx(Be)===We.type){u(ee,We.sibling),G=b(We,se.props),G.ref=Fa(ee,We,se),G.return=ee,ee=G;break e}u(ee,We);break}else a(ee,We);We=We.sibling}se.type===$?(G=Eo(se.props.children,ee.mode,Ce,se.key),G.return=ee,ee=G):(Ce=Kc(se.type,se.key,se.props,null,ee.mode,Ce),Ce.ref=Fa(ee,G,se),Ce.return=ee,ee=Ce)}return A(ee);case R:e:{for(We=se.key;G!==null;){if(G.key===We)if(G.tag===4&&G.stateNode.containerInfo===se.containerInfo&&G.stateNode.implementation===se.implementation){u(ee,G.sibling),G=b(G,se.children||[]),G.return=ee,ee=G;break e}else{u(ee,G);break}else a(ee,G);G=G.sibling}G=Sp(se,ee.mode,Ce),G.return=ee,ee=G}return A(ee);case Y:return We=se._init,Gt(ee,G,We(se._payload),Ce)}if(qe(se))return Ie(ee,G,se,Ce);if(ae(se))return Me(ee,G,se,Ce);jc(ee,se)}return typeof se=="string"&&se!==""||typeof se=="number"?(se=""+se,G!==null&&G.tag===6?(u(ee,G.sibling),G=b(G,se),G.return=ee,ee=G):(u(ee,G),G=kp(se,ee.mode,Ce),G.return=ee,ee=G),A(ee)):u(ee,G)}return Gt}var li=Xx(!0),Qx=Xx(!1),kc=$s(null),Sc=null,ci=null,$f=null;function Lf(){$f=ci=Sc=null}function If(o){var a=kc.current;Ct(kc),o._currentValue=a}function Of(o,a,u){for(;o!==null;){var g=o.alternate;if((o.childLanes&a)!==a?(o.childLanes|=a,g!==null&&(g.childLanes|=a)):g!==null&&(g.childLanes&a)!==a&&(g.childLanes|=a),o===u)break;o=o.return}}function ui(o,a){Sc=o,$f=ci=null,o=o.dependencies,o!==null&&o.firstContext!==null&&((o.lanes&a)!==0&&(zn=!0),o.firstContext=null)}function vr(o){var a=o._currentValue;if($f!==o)if(o={context:o,memoizedValue:a,next:null},ci===null){if(Sc===null)throw Error(n(308));ci=o,Sc.dependencies={lanes:0,firstContext:o}}else ci=ci.next=o;return a}var bo=null;function _f(o){bo===null?bo=[o]:bo.push(o)}function Zx(o,a,u,g){var b=a.interleaved;return b===null?(u.next=u,_f(a)):(u.next=b.next,b.next=u),a.interleaved=u,gs(o,g)}function gs(o,a){o.lanes|=a;var u=o.alternate;for(u!==null&&(u.lanes|=a),u=o,o=o.return;o!==null;)o.childLanes|=a,u=o.alternate,u!==null&&(u.childLanes|=a),u=o,o=o.return;return u.tag===3?u.stateNode:null}var Os=!1;function Mf(o){o.updateQueue={baseState:o.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function ey(o,a){o=o.updateQueue,a.updateQueue===o&&(a.updateQueue={baseState:o.baseState,firstBaseUpdate:o.firstBaseUpdate,lastBaseUpdate:o.lastBaseUpdate,shared:o.shared,effects:o.effects})}function xs(o,a){return{eventTime:o,lane:a,tag:0,payload:null,callback:null,next:null}}function _s(o,a,u){var g=o.updateQueue;if(g===null)return null;if(g=g.shared,(lt&2)!==0){var b=g.pending;return b===null?a.next=a:(a.next=b.next,b.next=a),g.pending=a,gs(o,u)}return b=g.interleaved,b===null?(a.next=a,_f(g)):(a.next=b.next,b.next=a),g.interleaved=a,gs(o,u)}function Nc(o,a,u){if(a=a.updateQueue,a!==null&&(a=a.shared,(u&4194240)!==0)){var g=a.lanes;g&=o.pendingLanes,u|=g,a.lanes=u,Pe(o,u)}}function ty(o,a){var u=o.updateQueue,g=o.alternate;if(g!==null&&(g=g.updateQueue,u===g)){var b=null,k=null;if(u=u.firstBaseUpdate,u!==null){do{var A={eventTime:u.eventTime,lane:u.lane,tag:u.tag,payload:u.payload,callback:u.callback,next:null};k===null?b=k=A:k=k.next=A,u=u.next}while(u!==null);k===null?b=k=a:k=k.next=a}else b=k=a;u={baseState:g.baseState,firstBaseUpdate:b,lastBaseUpdate:k,shared:g.shared,effects:g.effects},o.updateQueue=u;return}o=u.lastBaseUpdate,o===null?u.firstBaseUpdate=a:o.next=a,u.lastBaseUpdate=a}function Cc(o,a,u,g){var b=o.updateQueue;Os=!1;var k=b.firstBaseUpdate,A=b.lastBaseUpdate,z=b.shared.pending;if(z!==null){b.shared.pending=null;var V=z,le=V.next;V.next=null,A===null?k=le:A.next=le,A=V;var je=o.alternate;je!==null&&(je=je.updateQueue,z=je.lastBaseUpdate,z!==A&&(z===null?je.firstBaseUpdate=le:z.next=le,je.lastBaseUpdate=V))}if(k!==null){var ke=b.baseState;A=0,je=le=V=null,z=k;do{var be=z.lane,Ae=z.eventTime;if((g&be)===be){je!==null&&(je=je.next={eventTime:Ae,lane:0,tag:z.tag,payload:z.payload,callback:z.callback,next:null});e:{var Ie=o,Me=z;switch(be=a,Ae=u,Me.tag){case 1:if(Ie=Me.payload,typeof Ie=="function"){ke=Ie.call(Ae,ke,be);break e}ke=Ie;break e;case 3:Ie.flags=Ie.flags&-65537|128;case 0:if(Ie=Me.payload,be=typeof Ie=="function"?Ie.call(Ae,ke,be):Ie,be==null)break e;ke=T({},ke,be);break e;case 2:Os=!0}}z.callback!==null&&z.lane!==0&&(o.flags|=64,be=b.effects,be===null?b.effects=[z]:be.push(z))}else Ae={eventTime:Ae,lane:be,tag:z.tag,payload:z.payload,callback:z.callback,next:null},je===null?(le=je=Ae,V=ke):je=je.next=Ae,A|=be;if(z=z.next,z===null){if(z=b.shared.pending,z===null)break;be=z,z=be.next,be.next=null,b.lastBaseUpdate=be,b.shared.pending=null}}while(!0);if(je===null&&(V=ke),b.baseState=V,b.firstBaseUpdate=le,b.lastBaseUpdate=je,a=b.shared.interleaved,a!==null){b=a;do A|=b.lane,b=b.next;while(b!==a)}else k===null&&(b.shared.lanes=0);ko|=A,o.lanes=A,o.memoizedState=ke}}function ny(o,a,u){if(o=a.effects,a.effects=null,o!==null)for(a=0;a<o.length;a++){var g=o[a],b=g.callback;if(b!==null){if(g.callback=null,g=u,typeof b!="function")throw Error(n(191,b));b.call(g)}}}var za={},qr=$s(za),Ba=$s(za),Ua=$s(za);function wo(o){if(o===za)throw Error(n(174));return o}function Ff(o,a){switch(wt(Ua,a),wt(Ba,o),wt(qr,za),o=a.nodeType,o){case 9:case 11:a=(a=a.documentElement)?a.namespaceURI:ve(null,"");break;default:o=o===8?a.parentNode:a,a=o.namespaceURI||null,o=o.tagName,a=ve(a,o)}Ct(qr),wt(qr,a)}function di(){Ct(qr),Ct(Ba),Ct(Ua)}function ry(o){wo(Ua.current);var a=wo(qr.current),u=ve(a,o.type);a!==u&&(wt(Ba,o),wt(qr,u))}function zf(o){Ba.current===o&&(Ct(qr),Ct(Ba))}var Mt=$s(0);function Ec(o){for(var a=o;a!==null;){if(a.tag===13){var u=a.memoizedState;if(u!==null&&(u=u.dehydrated,u===null||u.data==="$?"||u.data==="$!"))return a}else if(a.tag===19&&a.memoizedProps.revealOrder!==void 0){if((a.flags&128)!==0)return a}else if(a.child!==null){a.child.return=a,a=a.child;continue}if(a===o)break;for(;a.sibling===null;){if(a.return===null||a.return===o)return null;a=a.return}a.sibling.return=a.return,a=a.sibling}return null}var Bf=[];function Uf(){for(var o=0;o<Bf.length;o++)Bf[o]._workInProgressVersionPrimary=null;Bf.length=0}var Tc=P.ReactCurrentDispatcher,Hf=P.ReactCurrentBatchConfig,jo=0,Ft=null,an=null,pn=null,Pc=!1,Ha=!1,Va=0,gC=0;function Nn(){throw Error(n(321))}function Vf(o,a){if(a===null)return!1;for(var u=0;u<a.length&&u<o.length;u++)if(!Dr(o[u],a[u]))return!1;return!0}function Wf(o,a,u,g,b,k){if(jo=k,Ft=a,a.memoizedState=null,a.updateQueue=null,a.lanes=0,Tc.current=o===null||o.memoizedState===null?bC:wC,o=u(g,b),Ha){k=0;do{if(Ha=!1,Va=0,25<=k)throw Error(n(301));k+=1,pn=an=null,a.updateQueue=null,Tc.current=jC,o=u(g,b)}while(Ha)}if(Tc.current=Dc,a=an!==null&&an.next!==null,jo=0,pn=an=Ft=null,Pc=!1,a)throw Error(n(300));return o}function Kf(){var o=Va!==0;return Va=0,o}function Gr(){var o={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return pn===null?Ft.memoizedState=pn=o:pn=pn.next=o,pn}function br(){if(an===null){var o=Ft.alternate;o=o!==null?o.memoizedState:null}else o=an.next;var a=pn===null?Ft.memoizedState:pn.next;if(a!==null)pn=a,an=o;else{if(o===null)throw Error(n(310));an=o,o={memoizedState:an.memoizedState,baseState:an.baseState,baseQueue:an.baseQueue,queue:an.queue,next:null},pn===null?Ft.memoizedState=pn=o:pn=pn.next=o}return pn}function Wa(o,a){return typeof a=="function"?a(o):a}function qf(o){var a=br(),u=a.queue;if(u===null)throw Error(n(311));u.lastRenderedReducer=o;var g=an,b=g.baseQueue,k=u.pending;if(k!==null){if(b!==null){var A=b.next;b.next=k.next,k.next=A}g.baseQueue=b=k,u.pending=null}if(b!==null){k=b.next,g=g.baseState;var z=A=null,V=null,le=k;do{var je=le.lane;if((jo&je)===je)V!==null&&(V=V.next={lane:0,action:le.action,hasEagerState:le.hasEagerState,eagerState:le.eagerState,next:null}),g=le.hasEagerState?le.eagerState:o(g,le.action);else{var ke={lane:je,action:le.action,hasEagerState:le.hasEagerState,eagerState:le.eagerState,next:null};V===null?(z=V=ke,A=g):V=V.next=ke,Ft.lanes|=je,ko|=je}le=le.next}while(le!==null&&le!==k);V===null?A=g:V.next=z,Dr(g,a.memoizedState)||(zn=!0),a.memoizedState=g,a.baseState=A,a.baseQueue=V,u.lastRenderedState=g}if(o=u.interleaved,o!==null){b=o;do k=b.lane,Ft.lanes|=k,ko|=k,b=b.next;while(b!==o)}else b===null&&(u.lanes=0);return[a.memoizedState,u.dispatch]}function Gf(o){var a=br(),u=a.queue;if(u===null)throw Error(n(311));u.lastRenderedReducer=o;var g=u.dispatch,b=u.pending,k=a.memoizedState;if(b!==null){u.pending=null;var A=b=b.next;do k=o(k,A.action),A=A.next;while(A!==b);Dr(k,a.memoizedState)||(zn=!0),a.memoizedState=k,a.baseQueue===null&&(a.baseState=k),u.lastRenderedState=k}return[k,g]}function sy(){}function oy(o,a){var u=Ft,g=br(),b=a(),k=!Dr(g.memoizedState,b);if(k&&(g.memoizedState=b,zn=!0),g=g.queue,Yf(ly.bind(null,u,g,o),[o]),g.getSnapshot!==a||k||pn!==null&&pn.memoizedState.tag&1){if(u.flags|=2048,Ka(9,ay.bind(null,u,g,b,a),void 0,null),mn===null)throw Error(n(349));(jo&30)!==0||iy(u,a,b)}return b}function iy(o,a,u){o.flags|=16384,o={getSnapshot:a,value:u},a=Ft.updateQueue,a===null?(a={lastEffect:null,stores:null},Ft.updateQueue=a,a.stores=[o]):(u=a.stores,u===null?a.stores=[o]:u.push(o))}function ay(o,a,u,g){a.value=u,a.getSnapshot=g,cy(a)&&uy(o)}function ly(o,a,u){return u(function(){cy(a)&&uy(o)})}function cy(o){var a=o.getSnapshot;o=o.value;try{var u=a();return!Dr(o,u)}catch{return!0}}function uy(o){var a=gs(o,1);a!==null&&_r(a,o,1,-1)}function dy(o){var a=Gr();return typeof o=="function"&&(o=o()),a.memoizedState=a.baseState=o,o={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:Wa,lastRenderedState:o},a.queue=o,o=o.dispatch=vC.bind(null,Ft,o),[a.memoizedState,o]}function Ka(o,a,u,g){return o={tag:o,create:a,destroy:u,deps:g,next:null},a=Ft.updateQueue,a===null?(a={lastEffect:null,stores:null},Ft.updateQueue=a,a.lastEffect=o.next=o):(u=a.lastEffect,u===null?a.lastEffect=o.next=o:(g=u.next,u.next=o,o.next=g,a.lastEffect=o)),o}function fy(){return br().memoizedState}function Rc(o,a,u,g){var b=Gr();Ft.flags|=o,b.memoizedState=Ka(1|a,u,void 0,g===void 0?null:g)}function Ac(o,a,u,g){var b=br();g=g===void 0?null:g;var k=void 0;if(an!==null){var A=an.memoizedState;if(k=A.destroy,g!==null&&Vf(g,A.deps)){b.memoizedState=Ka(a,u,k,g);return}}Ft.flags|=o,b.memoizedState=Ka(1|a,u,k,g)}function py(o,a){return Rc(8390656,8,o,a)}function Yf(o,a){return Ac(2048,8,o,a)}function my(o,a){return Ac(4,2,o,a)}function hy(o,a){return Ac(4,4,o,a)}function gy(o,a){if(typeof a=="function")return o=o(),a(o),function(){a(null)};if(a!=null)return o=o(),a.current=o,function(){a.current=null}}function xy(o,a,u){return u=u!=null?u.concat([o]):null,Ac(4,4,gy.bind(null,a,o),u)}function Jf(){}function yy(o,a){var u=br();a=a===void 0?null:a;var g=u.memoizedState;return g!==null&&a!==null&&Vf(a,g[1])?g[0]:(u.memoizedState=[o,a],o)}function vy(o,a){var u=br();a=a===void 0?null:a;var g=u.memoizedState;return g!==null&&a!==null&&Vf(a,g[1])?g[0]:(o=o(),u.memoizedState=[o,a],o)}function by(o,a,u){return(jo&21)===0?(o.baseState&&(o.baseState=!1,zn=!0),o.memoizedState=u):(Dr(u,a)||(u=ds(),Ft.lanes|=u,ko|=u,o.baseState=!0),a)}function xC(o,a){var u=$e;$e=u!==0&&4>u?u:4,o(!0);var g=Hf.transition;Hf.transition={};try{o(!1),a()}finally{$e=u,Hf.transition=g}}function wy(){return br().memoizedState}function yC(o,a,u){var g=Bs(o);if(u={lane:g,action:u,hasEagerState:!1,eagerState:null,next:null},jy(o))ky(a,u);else if(u=Zx(o,a,u,g),u!==null){var b=$n();_r(u,o,g,b),Sy(u,a,g)}}function vC(o,a,u){var g=Bs(o),b={lane:g,action:u,hasEagerState:!1,eagerState:null,next:null};if(jy(o))ky(a,b);else{var k=o.alternate;if(o.lanes===0&&(k===null||k.lanes===0)&&(k=a.lastRenderedReducer,k!==null))try{var A=a.lastRenderedState,z=k(A,u);if(b.hasEagerState=!0,b.eagerState=z,Dr(z,A)){var V=a.interleaved;V===null?(b.next=b,_f(a)):(b.next=V.next,V.next=b),a.interleaved=b;return}}catch{}finally{}u=Zx(o,a,b,g),u!==null&&(b=$n(),_r(u,o,g,b),Sy(u,a,g))}}function jy(o){var a=o.alternate;return o===Ft||a!==null&&a===Ft}function ky(o,a){Ha=Pc=!0;var u=o.pending;u===null?a.next=a:(a.next=u.next,u.next=a),o.pending=a}function Sy(o,a,u){if((u&4194240)!==0){var g=a.lanes;g&=o.pendingLanes,u|=g,a.lanes=u,Pe(o,u)}}var Dc={readContext:vr,useCallback:Nn,useContext:Nn,useEffect:Nn,useImperativeHandle:Nn,useInsertionEffect:Nn,useLayoutEffect:Nn,useMemo:Nn,useReducer:Nn,useRef:Nn,useState:Nn,useDebugValue:Nn,useDeferredValue:Nn,useTransition:Nn,useMutableSource:Nn,useSyncExternalStore:Nn,useId:Nn,unstable_isNewReconciler:!1},bC={readContext:vr,useCallback:function(o,a){return Gr().memoizedState=[o,a===void 0?null:a],o},useContext:vr,useEffect:py,useImperativeHandle:function(o,a,u){return u=u!=null?u.concat([o]):null,Rc(4194308,4,gy.bind(null,a,o),u)},useLayoutEffect:function(o,a){return Rc(4194308,4,o,a)},useInsertionEffect:function(o,a){return Rc(4,2,o,a)},useMemo:function(o,a){var u=Gr();return a=a===void 0?null:a,o=o(),u.memoizedState=[o,a],o},useReducer:function(o,a,u){var g=Gr();return a=u!==void 0?u(a):a,g.memoizedState=g.baseState=a,o={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:o,lastRenderedState:a},g.queue=o,o=o.dispatch=yC.bind(null,Ft,o),[g.memoizedState,o]},useRef:function(o){var a=Gr();return o={current:o},a.memoizedState=o},useState:dy,useDebugValue:Jf,useDeferredValue:function(o){return Gr().memoizedState=o},useTransition:function(){var o=dy(!1),a=o[0];return o=xC.bind(null,o[1]),Gr().memoizedState=o,[a,o]},useMutableSource:function(){},useSyncExternalStore:function(o,a,u){var g=Ft,b=Gr();if($t){if(u===void 0)throw Error(n(407));u=u()}else{if(u=a(),mn===null)throw Error(n(349));(jo&30)!==0||iy(g,a,u)}b.memoizedState=u;var k={value:u,getSnapshot:a};return b.queue=k,py(ly.bind(null,g,k,o),[o]),g.flags|=2048,Ka(9,ay.bind(null,g,k,u,a),void 0,null),u},useId:function(){var o=Gr(),a=mn.identifierPrefix;if($t){var u=hs,g=ms;u=(g&~(1<<32-_n(g)-1)).toString(32)+u,a=":"+a+"R"+u,u=Va++,0<u&&(a+="H"+u.toString(32)),a+=":"}else u=gC++,a=":"+a+"r"+u.toString(32)+":";return o.memoizedState=a},unstable_isNewReconciler:!1},wC={readContext:vr,useCallback:yy,useContext:vr,useEffect:Yf,useImperativeHandle:xy,useInsertionEffect:my,useLayoutEffect:hy,useMemo:vy,useReducer:qf,useRef:fy,useState:function(){return qf(Wa)},useDebugValue:Jf,useDeferredValue:function(o){var a=br();return by(a,an.memoizedState,o)},useTransition:function(){var o=qf(Wa)[0],a=br().memoizedState;return[o,a]},useMutableSource:sy,useSyncExternalStore:oy,useId:wy,unstable_isNewReconciler:!1},jC={readContext:vr,useCallback:yy,useContext:vr,useEffect:Yf,useImperativeHandle:xy,useInsertionEffect:my,useLayoutEffect:hy,useMemo:vy,useReducer:Gf,useRef:fy,useState:function(){return Gf(Wa)},useDebugValue:Jf,useDeferredValue:function(o){var a=br();return an===null?a.memoizedState=o:by(a,an.memoizedState,o)},useTransition:function(){var o=Gf(Wa)[0],a=br().memoizedState;return[o,a]},useMutableSource:sy,useSyncExternalStore:oy,useId:wy,unstable_isNewReconciler:!1};function Lr(o,a){if(o&&o.defaultProps){a=T({},a),o=o.defaultProps;for(var u in o)a[u]===void 0&&(a[u]=o[u]);return a}return a}function Xf(o,a,u,g){a=o.memoizedState,u=u(g,a),u=u==null?a:T({},a,u),o.memoizedState=u,o.lanes===0&&(o.updateQueue.baseState=u)}var $c={isMounted:function(o){return(o=o._reactInternals)?Ar(o)===o:!1},enqueueSetState:function(o,a,u){o=o._reactInternals;var g=$n(),b=Bs(o),k=xs(g,b);k.payload=a,u!=null&&(k.callback=u),a=_s(o,k,b),a!==null&&(_r(a,o,b,g),Nc(a,o,b))},enqueueReplaceState:function(o,a,u){o=o._reactInternals;var g=$n(),b=Bs(o),k=xs(g,b);k.tag=1,k.payload=a,u!=null&&(k.callback=u),a=_s(o,k,b),a!==null&&(_r(a,o,b,g),Nc(a,o,b))},enqueueForceUpdate:function(o,a){o=o._reactInternals;var u=$n(),g=Bs(o),b=xs(u,g);b.tag=2,a!=null&&(b.callback=a),a=_s(o,b,g),a!==null&&(_r(a,o,g,u),Nc(a,o,g))}};function Ny(o,a,u,g,b,k,A){return o=o.stateNode,typeof o.shouldComponentUpdate=="function"?o.shouldComponentUpdate(g,k,A):a.prototype&&a.prototype.isPureReactComponent?!Da(u,g)||!Da(b,k):!0}function Cy(o,a,u){var g=!1,b=Ls,k=a.contextType;return typeof k=="object"&&k!==null?k=vr(k):(b=Fn(a)?xo:Sn.current,g=a.contextTypes,k=(g=g!=null)?si(o,b):Ls),a=new a(u,k),o.memoizedState=a.state!==null&&a.state!==void 0?a.state:null,a.updater=$c,o.stateNode=a,a._reactInternals=o,g&&(o=o.stateNode,o.__reactInternalMemoizedUnmaskedChildContext=b,o.__reactInternalMemoizedMaskedChildContext=k),a}function Ey(o,a,u,g){o=a.state,typeof a.componentWillReceiveProps=="function"&&a.componentWillReceiveProps(u,g),typeof a.UNSAFE_componentWillReceiveProps=="function"&&a.UNSAFE_componentWillReceiveProps(u,g),a.state!==o&&$c.enqueueReplaceState(a,a.state,null)}function Qf(o,a,u,g){var b=o.stateNode;b.props=u,b.state=o.memoizedState,b.refs={},Mf(o);var k=a.contextType;typeof k=="object"&&k!==null?b.context=vr(k):(k=Fn(a)?xo:Sn.current,b.context=si(o,k)),b.state=o.memoizedState,k=a.getDerivedStateFromProps,typeof k=="function"&&(Xf(o,a,k,u),b.state=o.memoizedState),typeof a.getDerivedStateFromProps=="function"||typeof b.getSnapshotBeforeUpdate=="function"||typeof b.UNSAFE_componentWillMount!="function"&&typeof b.componentWillMount!="function"||(a=b.state,typeof b.componentWillMount=="function"&&b.componentWillMount(),typeof b.UNSAFE_componentWillMount=="function"&&b.UNSAFE_componentWillMount(),a!==b.state&&$c.enqueueReplaceState(b,b.state,null),Cc(o,u,b,g),b.state=o.memoizedState),typeof b.componentDidMount=="function"&&(o.flags|=4194308)}function fi(o,a){try{var u="",g=a;do u+=fe(g),g=g.return;while(g);var b=u}catch(k){b=`
|
|
39
|
+
Error generating stack: `+k.message+`
|
|
40
|
+
`+k.stack}return{value:o,source:a,stack:b,digest:null}}function Zf(o,a,u){return{value:o,source:null,stack:u??null,digest:a??null}}function ep(o,a){try{console.error(a.value)}catch(u){setTimeout(function(){throw u})}}var kC=typeof WeakMap=="function"?WeakMap:Map;function Ty(o,a,u){u=xs(-1,u),u.tag=3,u.payload={element:null};var g=a.value;return u.callback=function(){zc||(zc=!0,hp=g),ep(o,a)},u}function Py(o,a,u){u=xs(-1,u),u.tag=3;var g=o.type.getDerivedStateFromError;if(typeof g=="function"){var b=a.value;u.payload=function(){return g(b)},u.callback=function(){ep(o,a)}}var k=o.stateNode;return k!==null&&typeof k.componentDidCatch=="function"&&(u.callback=function(){ep(o,a),typeof g!="function"&&(Fs===null?Fs=new Set([this]):Fs.add(this));var A=a.stack;this.componentDidCatch(a.value,{componentStack:A!==null?A:""})}),u}function Ry(o,a,u){var g=o.pingCache;if(g===null){g=o.pingCache=new kC;var b=new Set;g.set(a,b)}else b=g.get(a),b===void 0&&(b=new Set,g.set(a,b));b.has(u)||(b.add(u),o=_C.bind(null,o,a,u),a.then(o,o))}function Ay(o){do{var a;if((a=o.tag===13)&&(a=o.memoizedState,a=a!==null?a.dehydrated!==null:!0),a)return o;o=o.return}while(o!==null);return null}function Dy(o,a,u,g,b){return(o.mode&1)===0?(o===a?o.flags|=65536:(o.flags|=128,u.flags|=131072,u.flags&=-52805,u.tag===1&&(u.alternate===null?u.tag=17:(a=xs(-1,1),a.tag=2,_s(u,a,1))),u.lanes|=1),o):(o.flags|=65536,o.lanes=b,o)}var SC=P.ReactCurrentOwner,zn=!1;function Dn(o,a,u,g){a.child=o===null?Qx(a,null,u,g):li(a,o.child,u,g)}function $y(o,a,u,g,b){u=u.render;var k=a.ref;return ui(a,b),g=Wf(o,a,u,g,k,b),u=Kf(),o!==null&&!zn?(a.updateQueue=o.updateQueue,a.flags&=-2053,o.lanes&=~b,ys(o,a,b)):($t&&u&&Tf(a),a.flags|=1,Dn(o,a,g,b),a.child)}function Ly(o,a,u,g,b){if(o===null){var k=u.type;return typeof k=="function"&&!jp(k)&&k.defaultProps===void 0&&u.compare===null&&u.defaultProps===void 0?(a.tag=15,a.type=k,Iy(o,a,k,g,b)):(o=Kc(u.type,null,g,a,a.mode,b),o.ref=a.ref,o.return=a,a.child=o)}if(k=o.child,(o.lanes&b)===0){var A=k.memoizedProps;if(u=u.compare,u=u!==null?u:Da,u(A,g)&&o.ref===a.ref)return ys(o,a,b)}return a.flags|=1,o=Hs(k,g),o.ref=a.ref,o.return=a,a.child=o}function Iy(o,a,u,g,b){if(o!==null){var k=o.memoizedProps;if(Da(k,g)&&o.ref===a.ref)if(zn=!1,a.pendingProps=g=k,(o.lanes&b)!==0)(o.flags&131072)!==0&&(zn=!0);else return a.lanes=o.lanes,ys(o,a,b)}return tp(o,a,u,g,b)}function Oy(o,a,u){var g=a.pendingProps,b=g.children,k=o!==null?o.memoizedState:null;if(g.mode==="hidden")if((a.mode&1)===0)a.memoizedState={baseLanes:0,cachePool:null,transitions:null},wt(mi,ir),ir|=u;else{if((u&1073741824)===0)return o=k!==null?k.baseLanes|u:u,a.lanes=a.childLanes=1073741824,a.memoizedState={baseLanes:o,cachePool:null,transitions:null},a.updateQueue=null,wt(mi,ir),ir|=o,null;a.memoizedState={baseLanes:0,cachePool:null,transitions:null},g=k!==null?k.baseLanes:u,wt(mi,ir),ir|=g}else k!==null?(g=k.baseLanes|u,a.memoizedState=null):g=u,wt(mi,ir),ir|=g;return Dn(o,a,b,u),a.child}function _y(o,a){var u=a.ref;(o===null&&u!==null||o!==null&&o.ref!==u)&&(a.flags|=512,a.flags|=2097152)}function tp(o,a,u,g,b){var k=Fn(u)?xo:Sn.current;return k=si(a,k),ui(a,b),u=Wf(o,a,u,g,k,b),g=Kf(),o!==null&&!zn?(a.updateQueue=o.updateQueue,a.flags&=-2053,o.lanes&=~b,ys(o,a,b)):($t&&g&&Tf(a),a.flags|=1,Dn(o,a,u,b),a.child)}function My(o,a,u,g,b){if(Fn(u)){var k=!0;xc(a)}else k=!1;if(ui(a,b),a.stateNode===null)Ic(o,a),Cy(a,u,g),Qf(a,u,g,b),g=!0;else if(o===null){var A=a.stateNode,z=a.memoizedProps;A.props=z;var V=A.context,le=u.contextType;typeof le=="object"&&le!==null?le=vr(le):(le=Fn(u)?xo:Sn.current,le=si(a,le));var je=u.getDerivedStateFromProps,ke=typeof je=="function"||typeof A.getSnapshotBeforeUpdate=="function";ke||typeof A.UNSAFE_componentWillReceiveProps!="function"&&typeof A.componentWillReceiveProps!="function"||(z!==g||V!==le)&&Ey(a,A,g,le),Os=!1;var be=a.memoizedState;A.state=be,Cc(a,g,A,b),V=a.memoizedState,z!==g||be!==V||Mn.current||Os?(typeof je=="function"&&(Xf(a,u,je,g),V=a.memoizedState),(z=Os||Ny(a,u,z,g,be,V,le))?(ke||typeof A.UNSAFE_componentWillMount!="function"&&typeof A.componentWillMount!="function"||(typeof A.componentWillMount=="function"&&A.componentWillMount(),typeof A.UNSAFE_componentWillMount=="function"&&A.UNSAFE_componentWillMount()),typeof A.componentDidMount=="function"&&(a.flags|=4194308)):(typeof A.componentDidMount=="function"&&(a.flags|=4194308),a.memoizedProps=g,a.memoizedState=V),A.props=g,A.state=V,A.context=le,g=z):(typeof A.componentDidMount=="function"&&(a.flags|=4194308),g=!1)}else{A=a.stateNode,ey(o,a),z=a.memoizedProps,le=a.type===a.elementType?z:Lr(a.type,z),A.props=le,ke=a.pendingProps,be=A.context,V=u.contextType,typeof V=="object"&&V!==null?V=vr(V):(V=Fn(u)?xo:Sn.current,V=si(a,V));var Ae=u.getDerivedStateFromProps;(je=typeof Ae=="function"||typeof A.getSnapshotBeforeUpdate=="function")||typeof A.UNSAFE_componentWillReceiveProps!="function"&&typeof A.componentWillReceiveProps!="function"||(z!==ke||be!==V)&&Ey(a,A,g,V),Os=!1,be=a.memoizedState,A.state=be,Cc(a,g,A,b);var Ie=a.memoizedState;z!==ke||be!==Ie||Mn.current||Os?(typeof Ae=="function"&&(Xf(a,u,Ae,g),Ie=a.memoizedState),(le=Os||Ny(a,u,le,g,be,Ie,V)||!1)?(je||typeof A.UNSAFE_componentWillUpdate!="function"&&typeof A.componentWillUpdate!="function"||(typeof A.componentWillUpdate=="function"&&A.componentWillUpdate(g,Ie,V),typeof A.UNSAFE_componentWillUpdate=="function"&&A.UNSAFE_componentWillUpdate(g,Ie,V)),typeof A.componentDidUpdate=="function"&&(a.flags|=4),typeof A.getSnapshotBeforeUpdate=="function"&&(a.flags|=1024)):(typeof A.componentDidUpdate!="function"||z===o.memoizedProps&&be===o.memoizedState||(a.flags|=4),typeof A.getSnapshotBeforeUpdate!="function"||z===o.memoizedProps&&be===o.memoizedState||(a.flags|=1024),a.memoizedProps=g,a.memoizedState=Ie),A.props=g,A.state=Ie,A.context=V,g=le):(typeof A.componentDidUpdate!="function"||z===o.memoizedProps&&be===o.memoizedState||(a.flags|=4),typeof A.getSnapshotBeforeUpdate!="function"||z===o.memoizedProps&&be===o.memoizedState||(a.flags|=1024),g=!1)}return np(o,a,u,g,k,b)}function np(o,a,u,g,b,k){_y(o,a);var A=(a.flags&128)!==0;if(!g&&!A)return b&&Hx(a,u,!1),ys(o,a,k);g=a.stateNode,SC.current=a;var z=A&&typeof u.getDerivedStateFromError!="function"?null:g.render();return a.flags|=1,o!==null&&A?(a.child=li(a,o.child,null,k),a.child=li(a,null,z,k)):Dn(o,a,z,k),a.memoizedState=g.state,b&&Hx(a,u,!0),a.child}function Fy(o){var a=o.stateNode;a.pendingContext?Bx(o,a.pendingContext,a.pendingContext!==a.context):a.context&&Bx(o,a.context,!1),Ff(o,a.containerInfo)}function zy(o,a,u,g,b){return ai(),Df(b),a.flags|=256,Dn(o,a,u,g),a.child}var rp={dehydrated:null,treeContext:null,retryLane:0};function sp(o){return{baseLanes:o,cachePool:null,transitions:null}}function By(o,a,u){var g=a.pendingProps,b=Mt.current,k=!1,A=(a.flags&128)!==0,z;if((z=A)||(z=o!==null&&o.memoizedState===null?!1:(b&2)!==0),z?(k=!0,a.flags&=-129):(o===null||o.memoizedState!==null)&&(b|=1),wt(Mt,b&1),o===null)return Af(a),o=a.memoizedState,o!==null&&(o=o.dehydrated,o!==null)?((a.mode&1)===0?a.lanes=1:o.data==="$!"?a.lanes=8:a.lanes=1073741824,null):(A=g.children,o=g.fallback,k?(g=a.mode,k=a.child,A={mode:"hidden",children:A},(g&1)===0&&k!==null?(k.childLanes=0,k.pendingProps=A):k=qc(A,g,0,null),o=Eo(o,g,u,null),k.return=a,o.return=a,k.sibling=o,a.child=k,a.child.memoizedState=sp(u),a.memoizedState=rp,o):op(a,A));if(b=o.memoizedState,b!==null&&(z=b.dehydrated,z!==null))return NC(o,a,A,g,z,b,u);if(k){k=g.fallback,A=a.mode,b=o.child,z=b.sibling;var V={mode:"hidden",children:g.children};return(A&1)===0&&a.child!==b?(g=a.child,g.childLanes=0,g.pendingProps=V,a.deletions=null):(g=Hs(b,V),g.subtreeFlags=b.subtreeFlags&14680064),z!==null?k=Hs(z,k):(k=Eo(k,A,u,null),k.flags|=2),k.return=a,g.return=a,g.sibling=k,a.child=g,g=k,k=a.child,A=o.child.memoizedState,A=A===null?sp(u):{baseLanes:A.baseLanes|u,cachePool:null,transitions:A.transitions},k.memoizedState=A,k.childLanes=o.childLanes&~u,a.memoizedState=rp,g}return k=o.child,o=k.sibling,g=Hs(k,{mode:"visible",children:g.children}),(a.mode&1)===0&&(g.lanes=u),g.return=a,g.sibling=null,o!==null&&(u=a.deletions,u===null?(a.deletions=[o],a.flags|=16):u.push(o)),a.child=g,a.memoizedState=null,g}function op(o,a){return a=qc({mode:"visible",children:a},o.mode,0,null),a.return=o,o.child=a}function Lc(o,a,u,g){return g!==null&&Df(g),li(a,o.child,null,u),o=op(a,a.pendingProps.children),o.flags|=2,a.memoizedState=null,o}function NC(o,a,u,g,b,k,A){if(u)return a.flags&256?(a.flags&=-257,g=Zf(Error(n(422))),Lc(o,a,A,g)):a.memoizedState!==null?(a.child=o.child,a.flags|=128,null):(k=g.fallback,b=a.mode,g=qc({mode:"visible",children:g.children},b,0,null),k=Eo(k,b,A,null),k.flags|=2,g.return=a,k.return=a,g.sibling=k,a.child=g,(a.mode&1)!==0&&li(a,o.child,null,A),a.child.memoizedState=sp(A),a.memoizedState=rp,k);if((a.mode&1)===0)return Lc(o,a,A,null);if(b.data==="$!"){if(g=b.nextSibling&&b.nextSibling.dataset,g)var z=g.dgst;return g=z,k=Error(n(419)),g=Zf(k,g,void 0),Lc(o,a,A,g)}if(z=(A&o.childLanes)!==0,zn||z){if(g=mn,g!==null){switch(A&-A){case 4:b=2;break;case 16:b=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:b=32;break;case 536870912:b=268435456;break;default:b=0}b=(b&(g.suspendedLanes|A))!==0?0:b,b!==0&&b!==k.retryLane&&(k.retryLane=b,gs(o,b),_r(g,o,b,-1))}return wp(),g=Zf(Error(n(421))),Lc(o,a,A,g)}return b.data==="$?"?(a.flags|=128,a.child=o.child,a=MC.bind(null,o),b._reactRetry=a,null):(o=k.treeContext,or=Ds(b.nextSibling),sr=a,$t=!0,$r=null,o!==null&&(xr[yr++]=ms,xr[yr++]=hs,xr[yr++]=yo,ms=o.id,hs=o.overflow,yo=a),a=op(a,g.children),a.flags|=4096,a)}function Uy(o,a,u){o.lanes|=a;var g=o.alternate;g!==null&&(g.lanes|=a),Of(o.return,a,u)}function ip(o,a,u,g,b){var k=o.memoizedState;k===null?o.memoizedState={isBackwards:a,rendering:null,renderingStartTime:0,last:g,tail:u,tailMode:b}:(k.isBackwards=a,k.rendering=null,k.renderingStartTime=0,k.last=g,k.tail=u,k.tailMode=b)}function Hy(o,a,u){var g=a.pendingProps,b=g.revealOrder,k=g.tail;if(Dn(o,a,g.children,u),g=Mt.current,(g&2)!==0)g=g&1|2,a.flags|=128;else{if(o!==null&&(o.flags&128)!==0)e:for(o=a.child;o!==null;){if(o.tag===13)o.memoizedState!==null&&Uy(o,u,a);else if(o.tag===19)Uy(o,u,a);else if(o.child!==null){o.child.return=o,o=o.child;continue}if(o===a)break e;for(;o.sibling===null;){if(o.return===null||o.return===a)break e;o=o.return}o.sibling.return=o.return,o=o.sibling}g&=1}if(wt(Mt,g),(a.mode&1)===0)a.memoizedState=null;else switch(b){case"forwards":for(u=a.child,b=null;u!==null;)o=u.alternate,o!==null&&Ec(o)===null&&(b=u),u=u.sibling;u=b,u===null?(b=a.child,a.child=null):(b=u.sibling,u.sibling=null),ip(a,!1,b,u,k);break;case"backwards":for(u=null,b=a.child,a.child=null;b!==null;){if(o=b.alternate,o!==null&&Ec(o)===null){a.child=b;break}o=b.sibling,b.sibling=u,u=b,b=o}ip(a,!0,u,null,k);break;case"together":ip(a,!1,null,null,void 0);break;default:a.memoizedState=null}return a.child}function Ic(o,a){(a.mode&1)===0&&o!==null&&(o.alternate=null,a.alternate=null,a.flags|=2)}function ys(o,a,u){if(o!==null&&(a.dependencies=o.dependencies),ko|=a.lanes,(u&a.childLanes)===0)return null;if(o!==null&&a.child!==o.child)throw Error(n(153));if(a.child!==null){for(o=a.child,u=Hs(o,o.pendingProps),a.child=u,u.return=a;o.sibling!==null;)o=o.sibling,u=u.sibling=Hs(o,o.pendingProps),u.return=a;u.sibling=null}return a.child}function CC(o,a,u){switch(a.tag){case 3:Fy(a),ai();break;case 5:ry(a);break;case 1:Fn(a.type)&&xc(a);break;case 4:Ff(a,a.stateNode.containerInfo);break;case 10:var g=a.type._context,b=a.memoizedProps.value;wt(kc,g._currentValue),g._currentValue=b;break;case 13:if(g=a.memoizedState,g!==null)return g.dehydrated!==null?(wt(Mt,Mt.current&1),a.flags|=128,null):(u&a.child.childLanes)!==0?By(o,a,u):(wt(Mt,Mt.current&1),o=ys(o,a,u),o!==null?o.sibling:null);wt(Mt,Mt.current&1);break;case 19:if(g=(u&a.childLanes)!==0,(o.flags&128)!==0){if(g)return Hy(o,a,u);a.flags|=128}if(b=a.memoizedState,b!==null&&(b.rendering=null,b.tail=null,b.lastEffect=null),wt(Mt,Mt.current),g)break;return null;case 22:case 23:return a.lanes=0,Oy(o,a,u)}return ys(o,a,u)}var Vy,ap,Wy,Ky;Vy=function(o,a){for(var u=a.child;u!==null;){if(u.tag===5||u.tag===6)o.appendChild(u.stateNode);else if(u.tag!==4&&u.child!==null){u.child.return=u,u=u.child;continue}if(u===a)break;for(;u.sibling===null;){if(u.return===null||u.return===a)return;u=u.return}u.sibling.return=u.return,u=u.sibling}},ap=function(){},Wy=function(o,a,u,g){var b=o.memoizedProps;if(b!==g){o=a.stateNode,wo(qr.current);var k=null;switch(u){case"input":b=ye(o,b),g=ye(o,g),k=[];break;case"select":b=T({},b,{value:void 0}),g=T({},g,{value:void 0}),k=[];break;case"textarea":b=Ze(o,b),g=Ze(o,g),k=[];break;default:typeof b.onClick!="function"&&typeof g.onClick=="function"&&(o.onclick=mc)}xt(u,g);var A;u=null;for(le in b)if(!g.hasOwnProperty(le)&&b.hasOwnProperty(le)&&b[le]!=null)if(le==="style"){var z=b[le];for(A in z)z.hasOwnProperty(A)&&(u||(u={}),u[A]="")}else le!=="dangerouslySetInnerHTML"&&le!=="children"&&le!=="suppressContentEditableWarning"&&le!=="suppressHydrationWarning"&&le!=="autoFocus"&&(i.hasOwnProperty(le)?k||(k=[]):(k=k||[]).push(le,null));for(le in g){var V=g[le];if(z=b!=null?b[le]:void 0,g.hasOwnProperty(le)&&V!==z&&(V!=null||z!=null))if(le==="style")if(z){for(A in z)!z.hasOwnProperty(A)||V&&V.hasOwnProperty(A)||(u||(u={}),u[A]="");for(A in V)V.hasOwnProperty(A)&&z[A]!==V[A]&&(u||(u={}),u[A]=V[A])}else u||(k||(k=[]),k.push(le,u)),u=V;else le==="dangerouslySetInnerHTML"?(V=V?V.__html:void 0,z=z?z.__html:void 0,V!=null&&z!==V&&(k=k||[]).push(le,V)):le==="children"?typeof V!="string"&&typeof V!="number"||(k=k||[]).push(le,""+V):le!=="suppressContentEditableWarning"&&le!=="suppressHydrationWarning"&&(i.hasOwnProperty(le)?(V!=null&&le==="onScroll"&&Nt("scroll",o),k||z===V||(k=[])):(k=k||[]).push(le,V))}u&&(k=k||[]).push("style",u);var le=k;(a.updateQueue=le)&&(a.flags|=4)}},Ky=function(o,a,u,g){u!==g&&(a.flags|=4)};function qa(o,a){if(!$t)switch(o.tailMode){case"hidden":a=o.tail;for(var u=null;a!==null;)a.alternate!==null&&(u=a),a=a.sibling;u===null?o.tail=null:u.sibling=null;break;case"collapsed":u=o.tail;for(var g=null;u!==null;)u.alternate!==null&&(g=u),u=u.sibling;g===null?a||o.tail===null?o.tail=null:o.tail.sibling=null:g.sibling=null}}function Cn(o){var a=o.alternate!==null&&o.alternate.child===o.child,u=0,g=0;if(a)for(var b=o.child;b!==null;)u|=b.lanes|b.childLanes,g|=b.subtreeFlags&14680064,g|=b.flags&14680064,b.return=o,b=b.sibling;else for(b=o.child;b!==null;)u|=b.lanes|b.childLanes,g|=b.subtreeFlags,g|=b.flags,b.return=o,b=b.sibling;return o.subtreeFlags|=g,o.childLanes=u,a}function EC(o,a,u){var g=a.pendingProps;switch(Pf(a),a.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Cn(a),null;case 1:return Fn(a.type)&&gc(),Cn(a),null;case 3:return g=a.stateNode,di(),Ct(Mn),Ct(Sn),Uf(),g.pendingContext&&(g.context=g.pendingContext,g.pendingContext=null),(o===null||o.child===null)&&(wc(a)?a.flags|=4:o===null||o.memoizedState.isDehydrated&&(a.flags&256)===0||(a.flags|=1024,$r!==null&&(yp($r),$r=null))),ap(o,a),Cn(a),null;case 5:zf(a);var b=wo(Ua.current);if(u=a.type,o!==null&&a.stateNode!=null)Wy(o,a,u,g,b),o.ref!==a.ref&&(a.flags|=512,a.flags|=2097152);else{if(!g){if(a.stateNode===null)throw Error(n(166));return Cn(a),null}if(o=wo(qr.current),wc(a)){g=a.stateNode,u=a.type;var k=a.memoizedProps;switch(g[Kr]=a,g[_a]=k,o=(a.mode&1)!==0,u){case"dialog":Nt("cancel",g),Nt("close",g);break;case"iframe":case"object":case"embed":Nt("load",g);break;case"video":case"audio":for(b=0;b<La.length;b++)Nt(La[b],g);break;case"source":Nt("error",g);break;case"img":case"image":case"link":Nt("error",g),Nt("load",g);break;case"details":Nt("toggle",g);break;case"input":ne(g,k),Nt("invalid",g);break;case"select":g._wrapperState={wasMultiple:!!k.multiple},Nt("invalid",g);break;case"textarea":St(g,k),Nt("invalid",g)}xt(u,k),b=null;for(var A in k)if(k.hasOwnProperty(A)){var z=k[A];A==="children"?typeof z=="string"?g.textContent!==z&&(k.suppressHydrationWarning!==!0&&pc(g.textContent,z,o),b=["children",z]):typeof z=="number"&&g.textContent!==""+z&&(k.suppressHydrationWarning!==!0&&pc(g.textContent,z,o),b=["children",""+z]):i.hasOwnProperty(A)&&z!=null&&A==="onScroll"&&Nt("scroll",g)}switch(u){case"input":pe(g),me(g,k,!0);break;case"textarea":pe(g),gt(g);break;case"select":case"option":break;default:typeof k.onClick=="function"&&(g.onclick=mc)}g=b,a.updateQueue=g,g!==null&&(a.flags|=4)}else{A=b.nodeType===9?b:b.ownerDocument,o==="http://www.w3.org/1999/xhtml"&&(o=ce(u)),o==="http://www.w3.org/1999/xhtml"?u==="script"?(o=A.createElement("div"),o.innerHTML="<script><\/script>",o=o.removeChild(o.firstChild)):typeof g.is=="string"?o=A.createElement(u,{is:g.is}):(o=A.createElement(u),u==="select"&&(A=o,g.multiple?A.multiple=!0:g.size&&(A.size=g.size))):o=A.createElementNS(o,u),o[Kr]=a,o[_a]=g,Vy(o,a,!1,!1),a.stateNode=o;e:{switch(A=Kt(u,g),u){case"dialog":Nt("cancel",o),Nt("close",o),b=g;break;case"iframe":case"object":case"embed":Nt("load",o),b=g;break;case"video":case"audio":for(b=0;b<La.length;b++)Nt(La[b],o);b=g;break;case"source":Nt("error",o),b=g;break;case"img":case"image":case"link":Nt("error",o),Nt("load",o),b=g;break;case"details":Nt("toggle",o),b=g;break;case"input":ne(o,g),b=ye(o,g),Nt("invalid",o);break;case"option":b=g;break;case"select":o._wrapperState={wasMultiple:!!g.multiple},b=T({},g,{value:void 0}),Nt("invalid",o);break;case"textarea":St(o,g),b=Ze(o,g),Nt("invalid",o);break;default:b=g}xt(u,b),z=b;for(k in z)if(z.hasOwnProperty(k)){var V=z[k];k==="style"?Qe(o,V):k==="dangerouslySetInnerHTML"?(V=V?V.__html:void 0,V!=null&&Oe(o,V)):k==="children"?typeof V=="string"?(u!=="textarea"||V!=="")&&Ye(o,V):typeof V=="number"&&Ye(o,""+V):k!=="suppressContentEditableWarning"&&k!=="suppressHydrationWarning"&&k!=="autoFocus"&&(i.hasOwnProperty(k)?V!=null&&k==="onScroll"&&Nt("scroll",o):V!=null&&N(o,k,V,A))}switch(u){case"input":pe(o),me(o,g,!1);break;case"textarea":pe(o),gt(o);break;case"option":g.value!=null&&o.setAttribute("value",""+he(g.value));break;case"select":o.multiple=!!g.multiple,k=g.value,k!=null?Ve(o,!!g.multiple,k,!1):g.defaultValue!=null&&Ve(o,!!g.multiple,g.defaultValue,!0);break;default:typeof b.onClick=="function"&&(o.onclick=mc)}switch(u){case"button":case"input":case"select":case"textarea":g=!!g.autoFocus;break e;case"img":g=!0;break e;default:g=!1}}g&&(a.flags|=4)}a.ref!==null&&(a.flags|=512,a.flags|=2097152)}return Cn(a),null;case 6:if(o&&a.stateNode!=null)Ky(o,a,o.memoizedProps,g);else{if(typeof g!="string"&&a.stateNode===null)throw Error(n(166));if(u=wo(Ua.current),wo(qr.current),wc(a)){if(g=a.stateNode,u=a.memoizedProps,g[Kr]=a,(k=g.nodeValue!==u)&&(o=sr,o!==null))switch(o.tag){case 3:pc(g.nodeValue,u,(o.mode&1)!==0);break;case 5:o.memoizedProps.suppressHydrationWarning!==!0&&pc(g.nodeValue,u,(o.mode&1)!==0)}k&&(a.flags|=4)}else g=(u.nodeType===9?u:u.ownerDocument).createTextNode(g),g[Kr]=a,a.stateNode=g}return Cn(a),null;case 13:if(Ct(Mt),g=a.memoizedState,o===null||o.memoizedState!==null&&o.memoizedState.dehydrated!==null){if($t&&or!==null&&(a.mode&1)!==0&&(a.flags&128)===0)Yx(),ai(),a.flags|=98560,k=!1;else if(k=wc(a),g!==null&&g.dehydrated!==null){if(o===null){if(!k)throw Error(n(318));if(k=a.memoizedState,k=k!==null?k.dehydrated:null,!k)throw Error(n(317));k[Kr]=a}else ai(),(a.flags&128)===0&&(a.memoizedState=null),a.flags|=4;Cn(a),k=!1}else $r!==null&&(yp($r),$r=null),k=!0;if(!k)return a.flags&65536?a:null}return(a.flags&128)!==0?(a.lanes=u,a):(g=g!==null,g!==(o!==null&&o.memoizedState!==null)&&g&&(a.child.flags|=8192,(a.mode&1)!==0&&(o===null||(Mt.current&1)!==0?ln===0&&(ln=3):wp())),a.updateQueue!==null&&(a.flags|=4),Cn(a),null);case 4:return di(),ap(o,a),o===null&&Ia(a.stateNode.containerInfo),Cn(a),null;case 10:return If(a.type._context),Cn(a),null;case 17:return Fn(a.type)&&gc(),Cn(a),null;case 19:if(Ct(Mt),k=a.memoizedState,k===null)return Cn(a),null;if(g=(a.flags&128)!==0,A=k.rendering,A===null)if(g)qa(k,!1);else{if(ln!==0||o!==null&&(o.flags&128)!==0)for(o=a.child;o!==null;){if(A=Ec(o),A!==null){for(a.flags|=128,qa(k,!1),g=A.updateQueue,g!==null&&(a.updateQueue=g,a.flags|=4),a.subtreeFlags=0,g=u,u=a.child;u!==null;)k=u,o=g,k.flags&=14680066,A=k.alternate,A===null?(k.childLanes=0,k.lanes=o,k.child=null,k.subtreeFlags=0,k.memoizedProps=null,k.memoizedState=null,k.updateQueue=null,k.dependencies=null,k.stateNode=null):(k.childLanes=A.childLanes,k.lanes=A.lanes,k.child=A.child,k.subtreeFlags=0,k.deletions=null,k.memoizedProps=A.memoizedProps,k.memoizedState=A.memoizedState,k.updateQueue=A.updateQueue,k.type=A.type,o=A.dependencies,k.dependencies=o===null?null:{lanes:o.lanes,firstContext:o.firstContext}),u=u.sibling;return wt(Mt,Mt.current&1|2),a.child}o=o.sibling}k.tail!==null&&Ot()>hi&&(a.flags|=128,g=!0,qa(k,!1),a.lanes=4194304)}else{if(!g)if(o=Ec(A),o!==null){if(a.flags|=128,g=!0,u=o.updateQueue,u!==null&&(a.updateQueue=u,a.flags|=4),qa(k,!0),k.tail===null&&k.tailMode==="hidden"&&!A.alternate&&!$t)return Cn(a),null}else 2*Ot()-k.renderingStartTime>hi&&u!==1073741824&&(a.flags|=128,g=!0,qa(k,!1),a.lanes=4194304);k.isBackwards?(A.sibling=a.child,a.child=A):(u=k.last,u!==null?u.sibling=A:a.child=A,k.last=A)}return k.tail!==null?(a=k.tail,k.rendering=a,k.tail=a.sibling,k.renderingStartTime=Ot(),a.sibling=null,u=Mt.current,wt(Mt,g?u&1|2:u&1),a):(Cn(a),null);case 22:case 23:return bp(),g=a.memoizedState!==null,o!==null&&o.memoizedState!==null!==g&&(a.flags|=8192),g&&(a.mode&1)!==0?(ir&1073741824)!==0&&(Cn(a),a.subtreeFlags&6&&(a.flags|=8192)):Cn(a),null;case 24:return null;case 25:return null}throw Error(n(156,a.tag))}function TC(o,a){switch(Pf(a),a.tag){case 1:return Fn(a.type)&&gc(),o=a.flags,o&65536?(a.flags=o&-65537|128,a):null;case 3:return di(),Ct(Mn),Ct(Sn),Uf(),o=a.flags,(o&65536)!==0&&(o&128)===0?(a.flags=o&-65537|128,a):null;case 5:return zf(a),null;case 13:if(Ct(Mt),o=a.memoizedState,o!==null&&o.dehydrated!==null){if(a.alternate===null)throw Error(n(340));ai()}return o=a.flags,o&65536?(a.flags=o&-65537|128,a):null;case 19:return Ct(Mt),null;case 4:return di(),null;case 10:return If(a.type._context),null;case 22:case 23:return bp(),null;case 24:return null;default:return null}}var Oc=!1,En=!1,PC=typeof WeakSet=="function"?WeakSet:Set,Le=null;function pi(o,a){var u=o.ref;if(u!==null)if(typeof u=="function")try{u(null)}catch(g){Ht(o,a,g)}else u.current=null}function lp(o,a,u){try{u()}catch(g){Ht(o,a,g)}}var qy=!1;function RC(o,a){if(bf=nc,o=Nx(),ff(o)){if("selectionStart"in o)var u={start:o.selectionStart,end:o.selectionEnd};else e:{u=(u=o.ownerDocument)&&u.defaultView||window;var g=u.getSelection&&u.getSelection();if(g&&g.rangeCount!==0){u=g.anchorNode;var b=g.anchorOffset,k=g.focusNode;g=g.focusOffset;try{u.nodeType,k.nodeType}catch{u=null;break e}var A=0,z=-1,V=-1,le=0,je=0,ke=o,be=null;t:for(;;){for(var Ae;ke!==u||b!==0&&ke.nodeType!==3||(z=A+b),ke!==k||g!==0&&ke.nodeType!==3||(V=A+g),ke.nodeType===3&&(A+=ke.nodeValue.length),(Ae=ke.firstChild)!==null;)be=ke,ke=Ae;for(;;){if(ke===o)break t;if(be===u&&++le===b&&(z=A),be===k&&++je===g&&(V=A),(Ae=ke.nextSibling)!==null)break;ke=be,be=ke.parentNode}ke=Ae}u=z===-1||V===-1?null:{start:z,end:V}}else u=null}u=u||{start:0,end:0}}else u=null;for(wf={focusedElem:o,selectionRange:u},nc=!1,Le=a;Le!==null;)if(a=Le,o=a.child,(a.subtreeFlags&1028)!==0&&o!==null)o.return=a,Le=o;else for(;Le!==null;){a=Le;try{var Ie=a.alternate;if((a.flags&1024)!==0)switch(a.tag){case 0:case 11:case 15:break;case 1:if(Ie!==null){var Me=Ie.memoizedProps,Gt=Ie.memoizedState,ee=a.stateNode,G=ee.getSnapshotBeforeUpdate(a.elementType===a.type?Me:Lr(a.type,Me),Gt);ee.__reactInternalSnapshotBeforeUpdate=G}break;case 3:var se=a.stateNode.containerInfo;se.nodeType===1?se.textContent="":se.nodeType===9&&se.documentElement&&se.removeChild(se.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(n(163))}}catch(Ce){Ht(a,a.return,Ce)}if(o=a.sibling,o!==null){o.return=a.return,Le=o;break}Le=a.return}return Ie=qy,qy=!1,Ie}function Ga(o,a,u){var g=a.updateQueue;if(g=g!==null?g.lastEffect:null,g!==null){var b=g=g.next;do{if((b.tag&o)===o){var k=b.destroy;b.destroy=void 0,k!==void 0&&lp(a,u,k)}b=b.next}while(b!==g)}}function _c(o,a){if(a=a.updateQueue,a=a!==null?a.lastEffect:null,a!==null){var u=a=a.next;do{if((u.tag&o)===o){var g=u.create;u.destroy=g()}u=u.next}while(u!==a)}}function cp(o){var a=o.ref;if(a!==null){var u=o.stateNode;switch(o.tag){case 5:o=u;break;default:o=u}typeof a=="function"?a(o):a.current=o}}function Gy(o){var a=o.alternate;a!==null&&(o.alternate=null,Gy(a)),o.child=null,o.deletions=null,o.sibling=null,o.tag===5&&(a=o.stateNode,a!==null&&(delete a[Kr],delete a[_a],delete a[Nf],delete a[fC],delete a[pC])),o.stateNode=null,o.return=null,o.dependencies=null,o.memoizedProps=null,o.memoizedState=null,o.pendingProps=null,o.stateNode=null,o.updateQueue=null}function Yy(o){return o.tag===5||o.tag===3||o.tag===4}function Jy(o){e:for(;;){for(;o.sibling===null;){if(o.return===null||Yy(o.return))return null;o=o.return}for(o.sibling.return=o.return,o=o.sibling;o.tag!==5&&o.tag!==6&&o.tag!==18;){if(o.flags&2||o.child===null||o.tag===4)continue e;o.child.return=o,o=o.child}if(!(o.flags&2))return o.stateNode}}function up(o,a,u){var g=o.tag;if(g===5||g===6)o=o.stateNode,a?u.nodeType===8?u.parentNode.insertBefore(o,a):u.insertBefore(o,a):(u.nodeType===8?(a=u.parentNode,a.insertBefore(o,u)):(a=u,a.appendChild(o)),u=u._reactRootContainer,u!=null||a.onclick!==null||(a.onclick=mc));else if(g!==4&&(o=o.child,o!==null))for(up(o,a,u),o=o.sibling;o!==null;)up(o,a,u),o=o.sibling}function dp(o,a,u){var g=o.tag;if(g===5||g===6)o=o.stateNode,a?u.insertBefore(o,a):u.appendChild(o);else if(g!==4&&(o=o.child,o!==null))for(dp(o,a,u),o=o.sibling;o!==null;)dp(o,a,u),o=o.sibling}var bn=null,Ir=!1;function Ms(o,a,u){for(u=u.child;u!==null;)Xy(o,a,u),u=u.sibling}function Xy(o,a,u){if(er&&typeof er.onCommitFiberUnmount=="function")try{er.onCommitFiberUnmount(Wo,u)}catch{}switch(u.tag){case 5:En||pi(u,a);case 6:var g=bn,b=Ir;bn=null,Ms(o,a,u),bn=g,Ir=b,bn!==null&&(Ir?(o=bn,u=u.stateNode,o.nodeType===8?o.parentNode.removeChild(u):o.removeChild(u)):bn.removeChild(u.stateNode));break;case 18:bn!==null&&(Ir?(o=bn,u=u.stateNode,o.nodeType===8?Sf(o.parentNode,u):o.nodeType===1&&Sf(o,u),Ca(o)):Sf(bn,u.stateNode));break;case 4:g=bn,b=Ir,bn=u.stateNode.containerInfo,Ir=!0,Ms(o,a,u),bn=g,Ir=b;break;case 0:case 11:case 14:case 15:if(!En&&(g=u.updateQueue,g!==null&&(g=g.lastEffect,g!==null))){b=g=g.next;do{var k=b,A=k.destroy;k=k.tag,A!==void 0&&((k&2)!==0||(k&4)!==0)&&lp(u,a,A),b=b.next}while(b!==g)}Ms(o,a,u);break;case 1:if(!En&&(pi(u,a),g=u.stateNode,typeof g.componentWillUnmount=="function"))try{g.props=u.memoizedProps,g.state=u.memoizedState,g.componentWillUnmount()}catch(z){Ht(u,a,z)}Ms(o,a,u);break;case 21:Ms(o,a,u);break;case 22:u.mode&1?(En=(g=En)||u.memoizedState!==null,Ms(o,a,u),En=g):Ms(o,a,u);break;default:Ms(o,a,u)}}function Qy(o){var a=o.updateQueue;if(a!==null){o.updateQueue=null;var u=o.stateNode;u===null&&(u=o.stateNode=new PC),a.forEach(function(g){var b=FC.bind(null,o,g);u.has(g)||(u.add(g),g.then(b,b))})}}function Or(o,a){var u=a.deletions;if(u!==null)for(var g=0;g<u.length;g++){var b=u[g];try{var k=o,A=a,z=A;e:for(;z!==null;){switch(z.tag){case 5:bn=z.stateNode,Ir=!1;break e;case 3:bn=z.stateNode.containerInfo,Ir=!0;break e;case 4:bn=z.stateNode.containerInfo,Ir=!0;break e}z=z.return}if(bn===null)throw Error(n(160));Xy(k,A,b),bn=null,Ir=!1;var V=b.alternate;V!==null&&(V.return=null),b.return=null}catch(le){Ht(b,a,le)}}if(a.subtreeFlags&12854)for(a=a.child;a!==null;)Zy(a,o),a=a.sibling}function Zy(o,a){var u=o.alternate,g=o.flags;switch(o.tag){case 0:case 11:case 14:case 15:if(Or(a,o),Yr(o),g&4){try{Ga(3,o,o.return),_c(3,o)}catch(Me){Ht(o,o.return,Me)}try{Ga(5,o,o.return)}catch(Me){Ht(o,o.return,Me)}}break;case 1:Or(a,o),Yr(o),g&512&&u!==null&&pi(u,u.return);break;case 5:if(Or(a,o),Yr(o),g&512&&u!==null&&pi(u,u.return),o.flags&32){var b=o.stateNode;try{Ye(b,"")}catch(Me){Ht(o,o.return,Me)}}if(g&4&&(b=o.stateNode,b!=null)){var k=o.memoizedProps,A=u!==null?u.memoizedProps:k,z=o.type,V=o.updateQueue;if(o.updateQueue=null,V!==null)try{z==="input"&&k.type==="radio"&&k.name!=null&&U(b,k),Kt(z,A);var le=Kt(z,k);for(A=0;A<V.length;A+=2){var je=V[A],ke=V[A+1];je==="style"?Qe(b,ke):je==="dangerouslySetInnerHTML"?Oe(b,ke):je==="children"?Ye(b,ke):N(b,je,ke,le)}switch(z){case"input":de(b,k);break;case"textarea":bt(b,k);break;case"select":var be=b._wrapperState.wasMultiple;b._wrapperState.wasMultiple=!!k.multiple;var Ae=k.value;Ae!=null?Ve(b,!!k.multiple,Ae,!1):be!==!!k.multiple&&(k.defaultValue!=null?Ve(b,!!k.multiple,k.defaultValue,!0):Ve(b,!!k.multiple,k.multiple?[]:"",!1))}b[_a]=k}catch(Me){Ht(o,o.return,Me)}}break;case 6:if(Or(a,o),Yr(o),g&4){if(o.stateNode===null)throw Error(n(162));b=o.stateNode,k=o.memoizedProps;try{b.nodeValue=k}catch(Me){Ht(o,o.return,Me)}}break;case 3:if(Or(a,o),Yr(o),g&4&&u!==null&&u.memoizedState.isDehydrated)try{Ca(a.containerInfo)}catch(Me){Ht(o,o.return,Me)}break;case 4:Or(a,o),Yr(o);break;case 13:Or(a,o),Yr(o),b=o.child,b.flags&8192&&(k=b.memoizedState!==null,b.stateNode.isHidden=k,!k||b.alternate!==null&&b.alternate.memoizedState!==null||(mp=Ot())),g&4&&Qy(o);break;case 22:if(je=u!==null&&u.memoizedState!==null,o.mode&1?(En=(le=En)||je,Or(a,o),En=le):Or(a,o),Yr(o),g&8192){if(le=o.memoizedState!==null,(o.stateNode.isHidden=le)&&!je&&(o.mode&1)!==0)for(Le=o,je=o.child;je!==null;){for(ke=Le=je;Le!==null;){switch(be=Le,Ae=be.child,be.tag){case 0:case 11:case 14:case 15:Ga(4,be,be.return);break;case 1:pi(be,be.return);var Ie=be.stateNode;if(typeof Ie.componentWillUnmount=="function"){g=be,u=be.return;try{a=g,Ie.props=a.memoizedProps,Ie.state=a.memoizedState,Ie.componentWillUnmount()}catch(Me){Ht(g,u,Me)}}break;case 5:pi(be,be.return);break;case 22:if(be.memoizedState!==null){nv(ke);continue}}Ae!==null?(Ae.return=be,Le=Ae):nv(ke)}je=je.sibling}e:for(je=null,ke=o;;){if(ke.tag===5){if(je===null){je=ke;try{b=ke.stateNode,le?(k=b.style,typeof k.setProperty=="function"?k.setProperty("display","none","important"):k.display="none"):(z=ke.stateNode,V=ke.memoizedProps.style,A=V!=null&&V.hasOwnProperty("display")?V.display:null,z.style.display=ge("display",A))}catch(Me){Ht(o,o.return,Me)}}}else if(ke.tag===6){if(je===null)try{ke.stateNode.nodeValue=le?"":ke.memoizedProps}catch(Me){Ht(o,o.return,Me)}}else if((ke.tag!==22&&ke.tag!==23||ke.memoizedState===null||ke===o)&&ke.child!==null){ke.child.return=ke,ke=ke.child;continue}if(ke===o)break e;for(;ke.sibling===null;){if(ke.return===null||ke.return===o)break e;je===ke&&(je=null),ke=ke.return}je===ke&&(je=null),ke.sibling.return=ke.return,ke=ke.sibling}}break;case 19:Or(a,o),Yr(o),g&4&&Qy(o);break;case 21:break;default:Or(a,o),Yr(o)}}function Yr(o){var a=o.flags;if(a&2){try{e:{for(var u=o.return;u!==null;){if(Yy(u)){var g=u;break e}u=u.return}throw Error(n(160))}switch(g.tag){case 5:var b=g.stateNode;g.flags&32&&(Ye(b,""),g.flags&=-33);var k=Jy(o);dp(o,k,b);break;case 3:case 4:var A=g.stateNode.containerInfo,z=Jy(o);up(o,z,A);break;default:throw Error(n(161))}}catch(V){Ht(o,o.return,V)}o.flags&=-3}a&4096&&(o.flags&=-4097)}function AC(o,a,u){Le=o,ev(o)}function ev(o,a,u){for(var g=(o.mode&1)!==0;Le!==null;){var b=Le,k=b.child;if(b.tag===22&&g){var A=b.memoizedState!==null||Oc;if(!A){var z=b.alternate,V=z!==null&&z.memoizedState!==null||En;z=Oc;var le=En;if(Oc=A,(En=V)&&!le)for(Le=b;Le!==null;)A=Le,V=A.child,A.tag===22&&A.memoizedState!==null?rv(b):V!==null?(V.return=A,Le=V):rv(b);for(;k!==null;)Le=k,ev(k),k=k.sibling;Le=b,Oc=z,En=le}tv(o)}else(b.subtreeFlags&8772)!==0&&k!==null?(k.return=b,Le=k):tv(o)}}function tv(o){for(;Le!==null;){var a=Le;if((a.flags&8772)!==0){var u=a.alternate;try{if((a.flags&8772)!==0)switch(a.tag){case 0:case 11:case 15:En||_c(5,a);break;case 1:var g=a.stateNode;if(a.flags&4&&!En)if(u===null)g.componentDidMount();else{var b=a.elementType===a.type?u.memoizedProps:Lr(a.type,u.memoizedProps);g.componentDidUpdate(b,u.memoizedState,g.__reactInternalSnapshotBeforeUpdate)}var k=a.updateQueue;k!==null&&ny(a,k,g);break;case 3:var A=a.updateQueue;if(A!==null){if(u=null,a.child!==null)switch(a.child.tag){case 5:u=a.child.stateNode;break;case 1:u=a.child.stateNode}ny(a,A,u)}break;case 5:var z=a.stateNode;if(u===null&&a.flags&4){u=z;var V=a.memoizedProps;switch(a.type){case"button":case"input":case"select":case"textarea":V.autoFocus&&u.focus();break;case"img":V.src&&(u.src=V.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(a.memoizedState===null){var le=a.alternate;if(le!==null){var je=le.memoizedState;if(je!==null){var ke=je.dehydrated;ke!==null&&Ca(ke)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(n(163))}En||a.flags&512&&cp(a)}catch(be){Ht(a,a.return,be)}}if(a===o){Le=null;break}if(u=a.sibling,u!==null){u.return=a.return,Le=u;break}Le=a.return}}function nv(o){for(;Le!==null;){var a=Le;if(a===o){Le=null;break}var u=a.sibling;if(u!==null){u.return=a.return,Le=u;break}Le=a.return}}function rv(o){for(;Le!==null;){var a=Le;try{switch(a.tag){case 0:case 11:case 15:var u=a.return;try{_c(4,a)}catch(V){Ht(a,u,V)}break;case 1:var g=a.stateNode;if(typeof g.componentDidMount=="function"){var b=a.return;try{g.componentDidMount()}catch(V){Ht(a,b,V)}}var k=a.return;try{cp(a)}catch(V){Ht(a,k,V)}break;case 5:var A=a.return;try{cp(a)}catch(V){Ht(a,A,V)}}}catch(V){Ht(a,a.return,V)}if(a===o){Le=null;break}var z=a.sibling;if(z!==null){z.return=a.return,Le=z;break}Le=a.return}}var DC=Math.ceil,Mc=P.ReactCurrentDispatcher,fp=P.ReactCurrentOwner,wr=P.ReactCurrentBatchConfig,lt=0,mn=null,Qt=null,wn=0,ir=0,mi=$s(0),ln=0,Ya=null,ko=0,Fc=0,pp=0,Ja=null,Bn=null,mp=0,hi=1/0,vs=null,zc=!1,hp=null,Fs=null,Bc=!1,zs=null,Uc=0,Xa=0,gp=null,Hc=-1,Vc=0;function $n(){return(lt&6)!==0?Ot():Hc!==-1?Hc:Hc=Ot()}function Bs(o){return(o.mode&1)===0?1:(lt&2)!==0&&wn!==0?wn&-wn:hC.transition!==null?(Vc===0&&(Vc=ds()),Vc):(o=$e,o!==0||(o=window.event,o=o===void 0?16:ox(o.type)),o)}function _r(o,a,u,g){if(50<Xa)throw Xa=0,gp=null,Error(n(185));re(o,u,g),((lt&2)===0||o!==mn)&&(o===mn&&((lt&2)===0&&(Fc|=u),ln===4&&Us(o,wn)),Un(o,g),u===1&<===0&&(a.mode&1)===0&&(hi=Ot()+500,yc&&Is()))}function Un(o,a){var u=o.callbackNode;Zd(o,a);var g=Es(o,o===mn?wn:0);if(g===0)u!==null&&Zl(u),o.callbackNode=null,o.callbackPriority=0;else if(a=g&-g,o.callbackPriority!==a){if(u!=null&&Zl(u),a===1)o.tag===0?mC(ov.bind(null,o)):Vx(ov.bind(null,o)),uC(function(){(lt&6)===0&&Is()}),u=null;else{switch(at(g)){case 1:u=ya;break;case 4:u=_t;break;case 16:u=Vr;break;case 536870912:u=ec;break;default:u=Vr}u=pv(u,sv.bind(null,o))}o.callbackPriority=a,o.callbackNode=u}}function sv(o,a){if(Hc=-1,Vc=0,(lt&6)!==0)throw Error(n(327));var u=o.callbackNode;if(gi()&&o.callbackNode!==u)return null;var g=Es(o,o===mn?wn:0);if(g===0)return null;if((g&30)!==0||(g&o.expiredLanes)!==0||a)a=Wc(o,g);else{a=g;var b=lt;lt|=2;var k=av();(mn!==o||wn!==a)&&(vs=null,hi=Ot()+500,No(o,a));do try{IC();break}catch(z){iv(o,z)}while(!0);Lf(),Mc.current=k,lt=b,Qt!==null?a=0:(mn=null,wn=0,a=ln)}if(a!==0){if(a===2&&(b=wa(o),b!==0&&(g=b,a=xp(o,b))),a===1)throw u=Ya,No(o,0),Us(o,g),Un(o,Ot()),u;if(a===6)Us(o,g);else{if(b=o.current.alternate,(g&30)===0&&!$C(b)&&(a=Wc(o,g),a===2&&(k=wa(o),k!==0&&(g=k,a=xp(o,k))),a===1))throw u=Ya,No(o,0),Us(o,g),Un(o,Ot()),u;switch(o.finishedWork=b,o.finishedLanes=g,a){case 0:case 1:throw Error(n(345));case 2:Co(o,Bn,vs);break;case 3:if(Us(o,g),(g&130023424)===g&&(a=mp+500-Ot(),10<a)){if(Es(o,0)!==0)break;if(b=o.suspendedLanes,(b&g)!==g){$n(),o.pingedLanes|=o.suspendedLanes&b;break}o.timeoutHandle=kf(Co.bind(null,o,Bn,vs),a);break}Co(o,Bn,vs);break;case 4:if(Us(o,g),(g&4194240)===g)break;for(a=o.eventTimes,b=-1;0<g;){var A=31-_n(g);k=1<<A,A=a[A],A>b&&(b=A),g&=~k}if(g=b,g=Ot()-g,g=(120>g?120:480>g?480:1080>g?1080:1920>g?1920:3e3>g?3e3:4320>g?4320:1960*DC(g/1960))-g,10<g){o.timeoutHandle=kf(Co.bind(null,o,Bn,vs),g);break}Co(o,Bn,vs);break;case 5:Co(o,Bn,vs);break;default:throw Error(n(329))}}}return Un(o,Ot()),o.callbackNode===u?sv.bind(null,o):null}function xp(o,a){var u=Ja;return o.current.memoizedState.isDehydrated&&(No(o,a).flags|=256),o=Wc(o,a),o!==2&&(a=Bn,Bn=u,a!==null&&yp(a)),o}function yp(o){Bn===null?Bn=o:Bn.push.apply(Bn,o)}function $C(o){for(var a=o;;){if(a.flags&16384){var u=a.updateQueue;if(u!==null&&(u=u.stores,u!==null))for(var g=0;g<u.length;g++){var b=u[g],k=b.getSnapshot;b=b.value;try{if(!Dr(k(),b))return!1}catch{return!1}}}if(u=a.child,a.subtreeFlags&16384&&u!==null)u.return=a,a=u;else{if(a===o)break;for(;a.sibling===null;){if(a.return===null||a.return===o)return!0;a=a.return}a.sibling.return=a.return,a=a.sibling}}return!0}function Us(o,a){for(a&=~pp,a&=~Fc,o.suspendedLanes|=a,o.pingedLanes&=~a,o=o.expirationTimes;0<a;){var u=31-_n(a),g=1<<u;o[u]=-1,a&=~g}}function ov(o){if((lt&6)!==0)throw Error(n(327));gi();var a=Es(o,0);if((a&1)===0)return Un(o,Ot()),null;var u=Wc(o,a);if(o.tag!==0&&u===2){var g=wa(o);g!==0&&(a=g,u=xp(o,g))}if(u===1)throw u=Ya,No(o,0),Us(o,a),Un(o,Ot()),u;if(u===6)throw Error(n(345));return o.finishedWork=o.current.alternate,o.finishedLanes=a,Co(o,Bn,vs),Un(o,Ot()),null}function vp(o,a){var u=lt;lt|=1;try{return o(a)}finally{lt=u,lt===0&&(hi=Ot()+500,yc&&Is())}}function So(o){zs!==null&&zs.tag===0&&(lt&6)===0&&gi();var a=lt;lt|=1;var u=wr.transition,g=$e;try{if(wr.transition=null,$e=1,o)return o()}finally{$e=g,wr.transition=u,lt=a,(lt&6)===0&&Is()}}function bp(){ir=mi.current,Ct(mi)}function No(o,a){o.finishedWork=null,o.finishedLanes=0;var u=o.timeoutHandle;if(u!==-1&&(o.timeoutHandle=-1,cC(u)),Qt!==null)for(u=Qt.return;u!==null;){var g=u;switch(Pf(g),g.tag){case 1:g=g.type.childContextTypes,g!=null&&gc();break;case 3:di(),Ct(Mn),Ct(Sn),Uf();break;case 5:zf(g);break;case 4:di();break;case 13:Ct(Mt);break;case 19:Ct(Mt);break;case 10:If(g.type._context);break;case 22:case 23:bp()}u=u.return}if(mn=o,Qt=o=Hs(o.current,null),wn=ir=a,ln=0,Ya=null,pp=Fc=ko=0,Bn=Ja=null,bo!==null){for(a=0;a<bo.length;a++)if(u=bo[a],g=u.interleaved,g!==null){u.interleaved=null;var b=g.next,k=u.pending;if(k!==null){var A=k.next;k.next=b,g.next=A}u.pending=g}bo=null}return o}function iv(o,a){do{var u=Qt;try{if(Lf(),Tc.current=Dc,Pc){for(var g=Ft.memoizedState;g!==null;){var b=g.queue;b!==null&&(b.pending=null),g=g.next}Pc=!1}if(jo=0,pn=an=Ft=null,Ha=!1,Va=0,fp.current=null,u===null||u.return===null){ln=1,Ya=a,Qt=null;break}e:{var k=o,A=u.return,z=u,V=a;if(a=wn,z.flags|=32768,V!==null&&typeof V=="object"&&typeof V.then=="function"){var le=V,je=z,ke=je.tag;if((je.mode&1)===0&&(ke===0||ke===11||ke===15)){var be=je.alternate;be?(je.updateQueue=be.updateQueue,je.memoizedState=be.memoizedState,je.lanes=be.lanes):(je.updateQueue=null,je.memoizedState=null)}var Ae=Ay(A);if(Ae!==null){Ae.flags&=-257,Dy(Ae,A,z,k,a),Ae.mode&1&&Ry(k,le,a),a=Ae,V=le;var Ie=a.updateQueue;if(Ie===null){var Me=new Set;Me.add(V),a.updateQueue=Me}else Ie.add(V);break e}else{if((a&1)===0){Ry(k,le,a),wp();break e}V=Error(n(426))}}else if($t&&z.mode&1){var Gt=Ay(A);if(Gt!==null){(Gt.flags&65536)===0&&(Gt.flags|=256),Dy(Gt,A,z,k,a),Df(fi(V,z));break e}}k=V=fi(V,z),ln!==4&&(ln=2),Ja===null?Ja=[k]:Ja.push(k),k=A;do{switch(k.tag){case 3:k.flags|=65536,a&=-a,k.lanes|=a;var ee=Ty(k,V,a);ty(k,ee);break e;case 1:z=V;var G=k.type,se=k.stateNode;if((k.flags&128)===0&&(typeof G.getDerivedStateFromError=="function"||se!==null&&typeof se.componentDidCatch=="function"&&(Fs===null||!Fs.has(se)))){k.flags|=65536,a&=-a,k.lanes|=a;var Ce=Py(k,z,a);ty(k,Ce);break e}}k=k.return}while(k!==null)}cv(u)}catch(Be){a=Be,Qt===u&&u!==null&&(Qt=u=u.return);continue}break}while(!0)}function av(){var o=Mc.current;return Mc.current=Dc,o===null?Dc:o}function wp(){(ln===0||ln===3||ln===2)&&(ln=4),mn===null||(ko&268435455)===0&&(Fc&268435455)===0||Us(mn,wn)}function Wc(o,a){var u=lt;lt|=2;var g=av();(mn!==o||wn!==a)&&(vs=null,No(o,a));do try{LC();break}catch(b){iv(o,b)}while(!0);if(Lf(),lt=u,Mc.current=g,Qt!==null)throw Error(n(261));return mn=null,wn=0,ln}function LC(){for(;Qt!==null;)lv(Qt)}function IC(){for(;Qt!==null&&!qd();)lv(Qt)}function lv(o){var a=fv(o.alternate,o,ir);o.memoizedProps=o.pendingProps,a===null?cv(o):Qt=a,fp.current=null}function cv(o){var a=o;do{var u=a.alternate;if(o=a.return,(a.flags&32768)===0){if(u=EC(u,a,ir),u!==null){Qt=u;return}}else{if(u=TC(u,a),u!==null){u.flags&=32767,Qt=u;return}if(o!==null)o.flags|=32768,o.subtreeFlags=0,o.deletions=null;else{ln=6,Qt=null;return}}if(a=a.sibling,a!==null){Qt=a;return}Qt=a=o}while(a!==null);ln===0&&(ln=5)}function Co(o,a,u){var g=$e,b=wr.transition;try{wr.transition=null,$e=1,OC(o,a,u,g)}finally{wr.transition=b,$e=g}return null}function OC(o,a,u,g){do gi();while(zs!==null);if((lt&6)!==0)throw Error(n(327));u=o.finishedWork;var b=o.finishedLanes;if(u===null)return null;if(o.finishedWork=null,o.finishedLanes=0,u===o.current)throw Error(n(177));o.callbackNode=null,o.callbackPriority=0;var k=u.lanes|u.childLanes;if(xe(o,k),o===mn&&(Qt=mn=null,wn=0),(u.subtreeFlags&2064)===0&&(u.flags&2064)===0||Bc||(Bc=!0,pv(Vr,function(){return gi(),null})),k=(u.flags&15990)!==0,(u.subtreeFlags&15990)!==0||k){k=wr.transition,wr.transition=null;var A=$e;$e=1;var z=lt;lt|=4,fp.current=null,RC(o,u),Zy(u,o),nC(wf),nc=!!bf,wf=bf=null,o.current=u,AC(u),Gd(),lt=z,$e=A,wr.transition=k}else o.current=u;if(Bc&&(Bc=!1,zs=o,Uc=b),k=o.pendingLanes,k===0&&(Fs=null),ba(u.stateNode),Un(o,Ot()),a!==null)for(g=o.onRecoverableError,u=0;u<a.length;u++)b=a[u],g(b.value,{componentStack:b.stack,digest:b.digest});if(zc)throw zc=!1,o=hp,hp=null,o;return(Uc&1)!==0&&o.tag!==0&&gi(),k=o.pendingLanes,(k&1)!==0?o===gp?Xa++:(Xa=0,gp=o):Xa=0,Is(),null}function gi(){if(zs!==null){var o=at(Uc),a=wr.transition,u=$e;try{if(wr.transition=null,$e=16>o?16:o,zs===null)var g=!1;else{if(o=zs,zs=null,Uc=0,(lt&6)!==0)throw Error(n(331));var b=lt;for(lt|=4,Le=o.current;Le!==null;){var k=Le,A=k.child;if((Le.flags&16)!==0){var z=k.deletions;if(z!==null){for(var V=0;V<z.length;V++){var le=z[V];for(Le=le;Le!==null;){var je=Le;switch(je.tag){case 0:case 11:case 15:Ga(8,je,k)}var ke=je.child;if(ke!==null)ke.return=je,Le=ke;else for(;Le!==null;){je=Le;var be=je.sibling,Ae=je.return;if(Gy(je),je===le){Le=null;break}if(be!==null){be.return=Ae,Le=be;break}Le=Ae}}}var Ie=k.alternate;if(Ie!==null){var Me=Ie.child;if(Me!==null){Ie.child=null;do{var Gt=Me.sibling;Me.sibling=null,Me=Gt}while(Me!==null)}}Le=k}}if((k.subtreeFlags&2064)!==0&&A!==null)A.return=k,Le=A;else e:for(;Le!==null;){if(k=Le,(k.flags&2048)!==0)switch(k.tag){case 0:case 11:case 15:Ga(9,k,k.return)}var ee=k.sibling;if(ee!==null){ee.return=k.return,Le=ee;break e}Le=k.return}}var G=o.current;for(Le=G;Le!==null;){A=Le;var se=A.child;if((A.subtreeFlags&2064)!==0&&se!==null)se.return=A,Le=se;else e:for(A=G;Le!==null;){if(z=Le,(z.flags&2048)!==0)try{switch(z.tag){case 0:case 11:case 15:_c(9,z)}}catch(Be){Ht(z,z.return,Be)}if(z===A){Le=null;break e}var Ce=z.sibling;if(Ce!==null){Ce.return=z.return,Le=Ce;break e}Le=z.return}}if(lt=b,Is(),er&&typeof er.onPostCommitFiberRoot=="function")try{er.onPostCommitFiberRoot(Wo,o)}catch{}g=!0}return g}finally{$e=u,wr.transition=a}}return!1}function uv(o,a,u){a=fi(u,a),a=Ty(o,a,1),o=_s(o,a,1),a=$n(),o!==null&&(re(o,1,a),Un(o,a))}function Ht(o,a,u){if(o.tag===3)uv(o,o,u);else for(;a!==null;){if(a.tag===3){uv(a,o,u);break}else if(a.tag===1){var g=a.stateNode;if(typeof a.type.getDerivedStateFromError=="function"||typeof g.componentDidCatch=="function"&&(Fs===null||!Fs.has(g))){o=fi(u,o),o=Py(a,o,1),a=_s(a,o,1),o=$n(),a!==null&&(re(a,1,o),Un(a,o));break}}a=a.return}}function _C(o,a,u){var g=o.pingCache;g!==null&&g.delete(a),a=$n(),o.pingedLanes|=o.suspendedLanes&u,mn===o&&(wn&u)===u&&(ln===4||ln===3&&(wn&130023424)===wn&&500>Ot()-mp?No(o,0):pp|=u),Un(o,a)}function dv(o,a){a===0&&((o.mode&1)===0?a=1:(a=vn,vn<<=1,(vn&130023424)===0&&(vn=4194304)));var u=$n();o=gs(o,a),o!==null&&(re(o,a,u),Un(o,u))}function MC(o){var a=o.memoizedState,u=0;a!==null&&(u=a.retryLane),dv(o,u)}function FC(o,a){var u=0;switch(o.tag){case 13:var g=o.stateNode,b=o.memoizedState;b!==null&&(u=b.retryLane);break;case 19:g=o.stateNode;break;default:throw Error(n(314))}g!==null&&g.delete(a),dv(o,u)}var fv;fv=function(o,a,u){if(o!==null)if(o.memoizedProps!==a.pendingProps||Mn.current)zn=!0;else{if((o.lanes&u)===0&&(a.flags&128)===0)return zn=!1,CC(o,a,u);zn=(o.flags&131072)!==0}else zn=!1,$t&&(a.flags&1048576)!==0&&Wx(a,bc,a.index);switch(a.lanes=0,a.tag){case 2:var g=a.type;Ic(o,a),o=a.pendingProps;var b=si(a,Sn.current);ui(a,u),b=Wf(null,a,g,o,b,u);var k=Kf();return a.flags|=1,typeof b=="object"&&b!==null&&typeof b.render=="function"&&b.$$typeof===void 0?(a.tag=1,a.memoizedState=null,a.updateQueue=null,Fn(g)?(k=!0,xc(a)):k=!1,a.memoizedState=b.state!==null&&b.state!==void 0?b.state:null,Mf(a),b.updater=$c,a.stateNode=b,b._reactInternals=a,Qf(a,g,o,u),a=np(null,a,g,!0,k,u)):(a.tag=0,$t&&k&&Tf(a),Dn(null,a,b,u),a=a.child),a;case 16:g=a.elementType;e:{switch(Ic(o,a),o=a.pendingProps,b=g._init,g=b(g._payload),a.type=g,b=a.tag=BC(g),o=Lr(g,o),b){case 0:a=tp(null,a,g,o,u);break e;case 1:a=My(null,a,g,o,u);break e;case 11:a=$y(null,a,g,o,u);break e;case 14:a=Ly(null,a,g,Lr(g.type,o),u);break e}throw Error(n(306,g,""))}return a;case 0:return g=a.type,b=a.pendingProps,b=a.elementType===g?b:Lr(g,b),tp(o,a,g,b,u);case 1:return g=a.type,b=a.pendingProps,b=a.elementType===g?b:Lr(g,b),My(o,a,g,b,u);case 3:e:{if(Fy(a),o===null)throw Error(n(387));g=a.pendingProps,k=a.memoizedState,b=k.element,ey(o,a),Cc(a,g,null,u);var A=a.memoizedState;if(g=A.element,k.isDehydrated)if(k={element:g,isDehydrated:!1,cache:A.cache,pendingSuspenseBoundaries:A.pendingSuspenseBoundaries,transitions:A.transitions},a.updateQueue.baseState=k,a.memoizedState=k,a.flags&256){b=fi(Error(n(423)),a),a=zy(o,a,g,u,b);break e}else if(g!==b){b=fi(Error(n(424)),a),a=zy(o,a,g,u,b);break e}else for(or=Ds(a.stateNode.containerInfo.firstChild),sr=a,$t=!0,$r=null,u=Qx(a,null,g,u),a.child=u;u;)u.flags=u.flags&-3|4096,u=u.sibling;else{if(ai(),g===b){a=ys(o,a,u);break e}Dn(o,a,g,u)}a=a.child}return a;case 5:return ry(a),o===null&&Af(a),g=a.type,b=a.pendingProps,k=o!==null?o.memoizedProps:null,A=b.children,jf(g,b)?A=null:k!==null&&jf(g,k)&&(a.flags|=32),_y(o,a),Dn(o,a,A,u),a.child;case 6:return o===null&&Af(a),null;case 13:return By(o,a,u);case 4:return Ff(a,a.stateNode.containerInfo),g=a.pendingProps,o===null?a.child=li(a,null,g,u):Dn(o,a,g,u),a.child;case 11:return g=a.type,b=a.pendingProps,b=a.elementType===g?b:Lr(g,b),$y(o,a,g,b,u);case 7:return Dn(o,a,a.pendingProps,u),a.child;case 8:return Dn(o,a,a.pendingProps.children,u),a.child;case 12:return Dn(o,a,a.pendingProps.children,u),a.child;case 10:e:{if(g=a.type._context,b=a.pendingProps,k=a.memoizedProps,A=b.value,wt(kc,g._currentValue),g._currentValue=A,k!==null)if(Dr(k.value,A)){if(k.children===b.children&&!Mn.current){a=ys(o,a,u);break e}}else for(k=a.child,k!==null&&(k.return=a);k!==null;){var z=k.dependencies;if(z!==null){A=k.child;for(var V=z.firstContext;V!==null;){if(V.context===g){if(k.tag===1){V=xs(-1,u&-u),V.tag=2;var le=k.updateQueue;if(le!==null){le=le.shared;var je=le.pending;je===null?V.next=V:(V.next=je.next,je.next=V),le.pending=V}}k.lanes|=u,V=k.alternate,V!==null&&(V.lanes|=u),Of(k.return,u,a),z.lanes|=u;break}V=V.next}}else if(k.tag===10)A=k.type===a.type?null:k.child;else if(k.tag===18){if(A=k.return,A===null)throw Error(n(341));A.lanes|=u,z=A.alternate,z!==null&&(z.lanes|=u),Of(A,u,a),A=k.sibling}else A=k.child;if(A!==null)A.return=k;else for(A=k;A!==null;){if(A===a){A=null;break}if(k=A.sibling,k!==null){k.return=A.return,A=k;break}A=A.return}k=A}Dn(o,a,b.children,u),a=a.child}return a;case 9:return b=a.type,g=a.pendingProps.children,ui(a,u),b=vr(b),g=g(b),a.flags|=1,Dn(o,a,g,u),a.child;case 14:return g=a.type,b=Lr(g,a.pendingProps),b=Lr(g.type,b),Ly(o,a,g,b,u);case 15:return Iy(o,a,a.type,a.pendingProps,u);case 17:return g=a.type,b=a.pendingProps,b=a.elementType===g?b:Lr(g,b),Ic(o,a),a.tag=1,Fn(g)?(o=!0,xc(a)):o=!1,ui(a,u),Cy(a,g,b),Qf(a,g,b,u),np(null,a,g,!0,o,u);case 19:return Hy(o,a,u);case 22:return Oy(o,a,u)}throw Error(n(156,a.tag))};function pv(o,a){return Ql(o,a)}function zC(o,a,u,g){this.tag=o,this.key=u,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=a,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=g,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function jr(o,a,u,g){return new zC(o,a,u,g)}function jp(o){return o=o.prototype,!(!o||!o.isReactComponent)}function BC(o){if(typeof o=="function")return jp(o)?1:0;if(o!=null){if(o=o.$$typeof,o===H)return 11;if(o===W)return 14}return 2}function Hs(o,a){var u=o.alternate;return u===null?(u=jr(o.tag,a,o.key,o.mode),u.elementType=o.elementType,u.type=o.type,u.stateNode=o.stateNode,u.alternate=o,o.alternate=u):(u.pendingProps=a,u.type=o.type,u.flags=0,u.subtreeFlags=0,u.deletions=null),u.flags=o.flags&14680064,u.childLanes=o.childLanes,u.lanes=o.lanes,u.child=o.child,u.memoizedProps=o.memoizedProps,u.memoizedState=o.memoizedState,u.updateQueue=o.updateQueue,a=o.dependencies,u.dependencies=a===null?null:{lanes:a.lanes,firstContext:a.firstContext},u.sibling=o.sibling,u.index=o.index,u.ref=o.ref,u}function Kc(o,a,u,g,b,k){var A=2;if(g=o,typeof o=="function")jp(o)&&(A=1);else if(typeof o=="string")A=5;else e:switch(o){case $:return Eo(u.children,b,k,a);case D:A=8,b|=8;break;case X:return o=jr(12,u,a,b|2),o.elementType=X,o.lanes=k,o;case J:return o=jr(13,u,a,b),o.elementType=J,o.lanes=k,o;case _:return o=jr(19,u,a,b),o.elementType=_,o.lanes=k,o;case ie:return qc(u,b,k,a);default:if(typeof o=="object"&&o!==null)switch(o.$$typeof){case Z:A=10;break e;case F:A=9;break e;case H:A=11;break e;case W:A=14;break e;case Y:A=16,g=null;break e}throw Error(n(130,o==null?o:typeof o,""))}return a=jr(A,u,a,b),a.elementType=o,a.type=g,a.lanes=k,a}function Eo(o,a,u,g){return o=jr(7,o,g,a),o.lanes=u,o}function qc(o,a,u,g){return o=jr(22,o,g,a),o.elementType=ie,o.lanes=u,o.stateNode={isHidden:!1},o}function kp(o,a,u){return o=jr(6,o,null,a),o.lanes=u,o}function Sp(o,a,u){return a=jr(4,o.children!==null?o.children:[],o.key,a),a.lanes=u,a.stateNode={containerInfo:o.containerInfo,pendingChildren:null,implementation:o.implementation},a}function UC(o,a,u,g,b){this.tag=a,this.containerInfo=o,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=O(0),this.expirationTimes=O(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=O(0),this.identifierPrefix=g,this.onRecoverableError=b,this.mutableSourceEagerHydrationData=null}function Np(o,a,u,g,b,k,A,z,V){return o=new UC(o,a,u,z,V),a===1?(a=1,k===!0&&(a|=8)):a=0,k=jr(3,null,null,a),o.current=k,k.stateNode=o,k.memoizedState={element:g,isDehydrated:u,cache:null,transitions:null,pendingSuspenseBoundaries:null},Mf(k),o}function HC(o,a,u){var g=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:R,key:g==null?null:""+g,children:o,containerInfo:a,implementation:u}}function mv(o){if(!o)return Ls;o=o._reactInternals;e:{if(Ar(o)!==o||o.tag!==1)throw Error(n(170));var a=o;do{switch(a.tag){case 3:a=a.stateNode.context;break e;case 1:if(Fn(a.type)){a=a.stateNode.__reactInternalMemoizedMergedChildContext;break e}}a=a.return}while(a!==null);throw Error(n(171))}if(o.tag===1){var u=o.type;if(Fn(u))return Ux(o,u,a)}return a}function hv(o,a,u,g,b,k,A,z,V){return o=Np(u,g,!0,o,b,k,A,z,V),o.context=mv(null),u=o.current,g=$n(),b=Bs(u),k=xs(g,b),k.callback=a??null,_s(u,k,b),o.current.lanes=b,re(o,b,g),Un(o,g),o}function Gc(o,a,u,g){var b=a.current,k=$n(),A=Bs(b);return u=mv(u),a.context===null?a.context=u:a.pendingContext=u,a=xs(k,A),a.payload={element:o},g=g===void 0?null:g,g!==null&&(a.callback=g),o=_s(b,a,A),o!==null&&(_r(o,b,A,k),Nc(o,b,A)),A}function Yc(o){if(o=o.current,!o.child)return null;switch(o.child.tag){case 5:return o.child.stateNode;default:return o.child.stateNode}}function gv(o,a){if(o=o.memoizedState,o!==null&&o.dehydrated!==null){var u=o.retryLane;o.retryLane=u!==0&&u<a?u:a}}function Cp(o,a){gv(o,a),(o=o.alternate)&&gv(o,a)}function VC(){return null}var xv=typeof reportError=="function"?reportError:function(o){console.error(o)};function Ep(o){this._internalRoot=o}Jc.prototype.render=Ep.prototype.render=function(o){var a=this._internalRoot;if(a===null)throw Error(n(409));Gc(o,a,null,null)},Jc.prototype.unmount=Ep.prototype.unmount=function(){var o=this._internalRoot;if(o!==null){this._internalRoot=null;var a=o.containerInfo;So(function(){Gc(null,o,null,null)}),a[fs]=null}};function Jc(o){this._internalRoot=o}Jc.prototype.unstable_scheduleHydration=function(o){if(o){var a=tr();o={blockedOn:null,target:o,priority:a};for(var u=0;u<Ps.length&&a!==0&&a<Ps[u].priority;u++);Ps.splice(u,0,o),u===0&&rx(o)}};function Tp(o){return!(!o||o.nodeType!==1&&o.nodeType!==9&&o.nodeType!==11)}function Xc(o){return!(!o||o.nodeType!==1&&o.nodeType!==9&&o.nodeType!==11&&(o.nodeType!==8||o.nodeValue!==" react-mount-point-unstable "))}function yv(){}function WC(o,a,u,g,b){if(b){if(typeof g=="function"){var k=g;g=function(){var le=Yc(A);k.call(le)}}var A=hv(a,g,o,0,null,!1,!1,"",yv);return o._reactRootContainer=A,o[fs]=A.current,Ia(o.nodeType===8?o.parentNode:o),So(),A}for(;b=o.lastChild;)o.removeChild(b);if(typeof g=="function"){var z=g;g=function(){var le=Yc(V);z.call(le)}}var V=Np(o,0,!1,null,null,!1,!1,"",yv);return o._reactRootContainer=V,o[fs]=V.current,Ia(o.nodeType===8?o.parentNode:o),So(function(){Gc(a,V,u,g)}),V}function Qc(o,a,u,g,b){var k=u._reactRootContainer;if(k){var A=k;if(typeof b=="function"){var z=b;b=function(){var V=Yc(A);z.call(V)}}Gc(a,A,o,b)}else A=WC(u,a,o,b,g);return Yc(A)}yt=function(o){switch(o.tag){case 3:var a=o.stateNode;if(a.current.memoizedState.isDehydrated){var u=mo(a.pendingLanes);u!==0&&(Pe(a,u|1),Un(a,Ot()),(lt&6)===0&&(hi=Ot()+500,Is()))}break;case 13:So(function(){var g=gs(o,1);if(g!==null){var b=$n();_r(g,o,1,b)}}),Cp(o,1)}},Rn=function(o){if(o.tag===13){var a=gs(o,134217728);if(a!==null){var u=$n();_r(a,o,134217728,u)}Cp(o,134217728)}},An=function(o){if(o.tag===13){var a=Bs(o),u=gs(o,a);if(u!==null){var g=$n();_r(u,o,a,g)}Cp(o,a)}},tr=function(){return $e},gr=function(o,a){var u=$e;try{return $e=o,a()}finally{$e=u}},Qn=function(o,a,u){switch(a){case"input":if(de(o,u),a=u.name,u.type==="radio"&&a!=null){for(u=o;u.parentNode;)u=u.parentNode;for(u=u.querySelectorAll("input[name="+JSON.stringify(""+a)+'][type="radio"]'),a=0;a<u.length;a++){var g=u[a];if(g!==o&&g.form===o.form){var b=hc(g);if(!b)throw Error(n(90));He(g),de(g,b)}}}break;case"textarea":bt(o,u);break;case"select":a=u.value,a!=null&&Ve(o,!!u.multiple,a,!1)}},Q=vp,_e=So;var KC={usingClientEntryPoint:!1,Events:[Ma,ni,hc,Dt,Xt,vp]},Qa={findFiberByHostInstance:go,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},qC={bundleType:Qa.bundleType,version:Qa.version,rendererPackageName:Qa.rendererPackageName,rendererConfig:Qa.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:P.ReactCurrentDispatcher,findHostInstanceByFiber:function(o){return o=fo(o),o===null?null:o.stateNode},findFiberByHostInstance:Qa.findFiberByHostInstance||VC,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 Zc=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Zc.isDisabled&&Zc.supportsFiber)try{Wo=Zc.inject(qC),er=Zc}catch{}}return Hn.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=KC,Hn.createPortal=function(o,a){var u=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!Tp(a))throw Error(n(200));return HC(o,a,null,u)},Hn.createRoot=function(o,a){if(!Tp(o))throw Error(n(299));var u=!1,g="",b=xv;return a!=null&&(a.unstable_strictMode===!0&&(u=!0),a.identifierPrefix!==void 0&&(g=a.identifierPrefix),a.onRecoverableError!==void 0&&(b=a.onRecoverableError)),a=Np(o,1,!1,null,null,u,!1,g,b),o[fs]=a.current,Ia(o.nodeType===8?o.parentNode:o),new Ep(a)},Hn.findDOMNode=function(o){if(o==null)return null;if(o.nodeType===1)return o;var a=o._reactInternals;if(a===void 0)throw typeof o.render=="function"?Error(n(188)):(o=Object.keys(o).join(","),Error(n(268,o)));return o=fo(a),o=o===null?null:o.stateNode,o},Hn.flushSync=function(o){return So(o)},Hn.hydrate=function(o,a,u){if(!Xc(a))throw Error(n(200));return Qc(null,o,a,!0,u)},Hn.hydrateRoot=function(o,a,u){if(!Tp(o))throw Error(n(405));var g=u!=null&&u.hydratedSources||null,b=!1,k="",A=xv;if(u!=null&&(u.unstable_strictMode===!0&&(b=!0),u.identifierPrefix!==void 0&&(k=u.identifierPrefix),u.onRecoverableError!==void 0&&(A=u.onRecoverableError)),a=hv(a,null,o,1,u??null,b,!1,k,A),o[fs]=a.current,Ia(o),g)for(o=0;o<g.length;o++)u=g[o],b=u._getVersion,b=b(u._source),a.mutableSourceEagerHydrationData==null?a.mutableSourceEagerHydrationData=[u,b]:a.mutableSourceEagerHydrationData.push(u,b);return new Jc(a)},Hn.render=function(o,a,u){if(!Xc(a))throw Error(n(200));return Qc(null,o,a,!1,u)},Hn.unmountComponentAtNode=function(o){if(!Xc(o))throw Error(n(40));return o._reactRootContainer?(So(function(){Qc(null,null,o,!1,function(){o._reactRootContainer=null,o[fs]=null})}),!0):!1},Hn.unstable_batchedUpdates=vp,Hn.unstable_renderSubtreeIntoContainer=function(o,a,u,g){if(!Xc(u))throw Error(n(200));if(o==null||o._reactInternals===void 0)throw Error(n(38));return Qc(o,a,u,!1,g)},Hn.version="18.3.1-next-f1338f8080-20240426",Hn}var Ev;function a0(){if(Ev)return Ap.exports;Ev=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(),Ap.exports=rE(),Ap.exports}var Tv;function sE(){if(Tv)return eu;Tv=1;var e=a0();return eu.createRoot=e.createRoot,eu.hydrateRoot=e.hydrateRoot,eu}var oE=sE();/**
|
|
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 Pv="popstate";function Rv(e){return typeof e=="object"&&e!=null&&"pathname"in e&&"search"in e&&"hash"in e&&"state"in e&&"key"in e}function iE(e={}){function t(s,i){var m;let l=(m=i.state)==null?void 0:m.masked,{pathname:c,search:d,hash:p}=l||s.location;return Tm("",{pathname:c,search:d,hash:p},i.state&&i.state.usr||null,i.state&&i.state.key||"default",l?{pathname:s.location.pathname,search:s.location.search,hash:s.location.hash}:void 0)}function n(s,i){return typeof i=="string"?i:Cl(i)}return lE(t,n,null,e)}function zt(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function Mr(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function aE(){return Math.random().toString(36).substring(2,10)}function Av(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 Tm(e,t,n=null,s,i){return{pathname:typeof e=="string"?e:e.pathname,search:"",hash:"",...typeof t=="string"?Yi(t):t,state:n,key:t&&t.key||s||aE(),unstable_mask:i}}function Cl({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 Yi(e){let t={};if(e){let n=e.indexOf("#");n>=0&&(t.hash=e.substring(n),e=e.substring(0,n));let s=e.indexOf("?");s>=0&&(t.search=e.substring(s),e=e.substring(0,s)),e&&(t.pathname=e)}return t}function lE(e,t,n,s={}){let{window:i=document.defaultView,v5Compat:l=!1}=s,c=i.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 w=h(),S=w==null?null:w-m;m=w,p&&p({action:d,location:j.location,delta:S})}function y(w,S){d="PUSH";let E=Rv(w)?w:Tm(j.location,w,S);m=h()+1;let N=Av(E,m),P=j.createHref(E.unstable_mask||E);try{c.pushState(N,"",P)}catch(I){if(I instanceof DOMException&&I.name==="DataCloneError")throw I;i.location.assign(P)}l&&p&&p({action:d,location:j.location,delta:1})}function v(w,S){d="REPLACE";let E=Rv(w)?w:Tm(j.location,w,S);m=h();let N=Av(E,m),P=j.createHref(E.unstable_mask||E);c.replaceState(N,"",P),l&&p&&p({action:d,location:j.location,delta:0})}function C(w){return cE(w)}let j={get action(){return d},get location(){return e(i,c)},listen(w){if(p)throw new Error("A history only accepts one active listener");return i.addEventListener(Pv,x),p=w,()=>{i.removeEventListener(Pv,x),p=null}},createHref(w){return t(i,w)},createURL:C,encodeLocation(w){let S=C(w);return{pathname:S.pathname,search:S.search,hash:S.hash}},push:y,replace:v,go(w){return c.go(w)}};return j}function cE(e,t=!1){let n="http://localhost";typeof window<"u"&&(n=window.location.origin!=="null"?window.location.origin:window.location.href),zt(n,"No window.location.(origin|href) available to create URL");let s=typeof e=="string"?e:Cl(e);return s=s.replace(/ $/,"%20"),!t&&s.startsWith("//")&&(s=n+s),new URL(s,n)}function l0(e,t,n="/"){return uE(e,t,n,!1)}function uE(e,t,n,s){let i=typeof t=="string"?Yi(t):t,l=js(i.pathname||"/",n);if(l==null)return null;let c=c0(e);dE(c);let d=null;for(let p=0;d==null&&p<c.length;++p){let m=jE(l);d=bE(c[p],m,s)}return d}function c0(e,t=[],n=[],s="",i=!1){let l=(c,d,p=i,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(s)&&p)return;zt(h.relativePath.startsWith(s),`Absolute route path "${h.relativePath}" nested under path "${s}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),h.relativePath=h.relativePath.slice(s.length)}let x=es([s,h.relativePath]),y=n.concat(h);c.children&&c.children.length>0&&(zt(c.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${x}".`),c0(c.children,t,y,x,p)),!(c.path==null&&!c.index)&&t.push({path:x,score:yE(x,c.index),routesMeta:y})};return e.forEach((c,d)=>{var p;if(c.path===""||!((p=c.path)!=null&&p.includes("?")))l(c,d);else for(let m of u0(c.path))l(c,d,!0,m)}),t}function u0(e){let t=e.split("/");if(t.length===0)return[];let[n,...s]=t,i=n.endsWith("?"),l=n.replace(/\?$/,"");if(s.length===0)return i?[l,""]:[l];let c=u0(s.join("/")),d=[];return d.push(...c.map(p=>p===""?l:[l,p].join("/"))),i&&d.push(...c),d.map(p=>e.startsWith("/")&&p===""?"/":p)}function dE(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:vE(t.routesMeta.map(s=>s.childrenIndex),n.routesMeta.map(s=>s.childrenIndex)))}var fE=/^:[\w-]+$/,pE=3,mE=2,hE=1,gE=10,xE=-2,Dv=e=>e==="*";function yE(e,t){let n=e.split("/"),s=n.length;return n.some(Dv)&&(s+=xE),t&&(s+=mE),n.filter(i=>!Dv(i)).reduce((i,l)=>i+(fE.test(l)?pE:l===""?hE:gE),s)}function vE(e,t){return e.length===t.length&&e.slice(0,-1).every((s,i)=>s===t[i])?e[e.length-1]-t[t.length-1]:0}function bE(e,t,n=!1){let{routesMeta:s}=e,i={},l="/",c=[];for(let d=0;d<s.length;++d){let p=s[d],m=d===s.length-1,h=l==="/"?t:t.slice(l.length)||"/",x=Au({path:p.relativePath,caseSensitive:p.caseSensitive,end:m},h),y=p.route;if(!x&&m&&n&&!s[s.length-1].route.index&&(x=Au({path:p.relativePath,caseSensitive:p.caseSensitive,end:!1},h)),!x)return null;Object.assign(i,x.params),c.push({params:i,pathname:es([l,x.pathname]),pathnameBase:CE(es([l,x.pathnameBase])),route:y}),x.pathnameBase!=="/"&&(l=es([l,x.pathnameBase]))}return c}function Au(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[n,s]=wE(e.path,e.caseSensitive,e.end),i=t.match(n);if(!i)return null;let l=i[0],c=l.replace(/(.)\/+$/,"$1"),d=i.slice(1);return{params:s.reduce((m,{paramName:h,isOptional:x},y)=>{if(h==="*"){let C=d[y]||"";c=l.slice(0,l.length-C.length).replace(/(.)\/+$/,"$1")}const v=d[y];return x&&!v?m[h]=void 0:m[h]=(v||"").replace(/%2F/g,"/"),m},{}),pathname:l,pathnameBase:c,pattern:e}}function wE(e,t=!1,n=!0){Mr(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 s=[],i="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(c,d,p,m,h)=>{if(s.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("*")?(s.push({paramName:"*"}),i+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?i+="\\/*$":e!==""&&e!=="/"&&(i+="(?:(?=\\/|$))"),[new RegExp(i,t?void 0:"i"),s]}function jE(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return Mr(!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 js(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith("/")?t.length-1:t.length,s=e.charAt(n);return s&&s!=="/"?null:e.slice(n)||"/"}var kE=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i;function SE(e,t="/"){let{pathname:n,search:s="",hash:i=""}=typeof e=="string"?Yi(e):e,l;return n?(n=n.replace(/\/\/+/g,"/"),n.startsWith("/")?l=$v(n.substring(1),"/"):l=$v(n,t)):l=t,{pathname:l,search:EE(s),hash:TE(i)}}function $v(e,t){let n=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(i=>{i===".."?n.length>1&&n.pop():i!=="."&&n.push(i)}),n.length>1?n.join("/"):"/"}function Lp(e,t,n,s){return`Cannot include a '${e}' character in a manually specified \`to.${t}\` field [${JSON.stringify(s)}]. 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 NE(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function d0(e){let t=NE(e);return t.map((n,s)=>s===t.length-1?n.pathname:n.pathnameBase)}function hh(e,t,n,s=!1){let i;typeof e=="string"?i=Yi(e):(i={...e},zt(!i.pathname||!i.pathname.includes("?"),Lp("?","pathname","search",i)),zt(!i.pathname||!i.pathname.includes("#"),Lp("#","pathname","hash",i)),zt(!i.search||!i.search.includes("#"),Lp("#","search","hash",i)));let l=e===""||i.pathname==="",c=l?"/":i.pathname,d;if(c==null)d=n;else{let x=t.length-1;if(!s&&c.startsWith("..")){let y=c.split("/");for(;y[0]==="..";)y.shift(),x-=1;i.pathname=y.join("/")}d=x>=0?t[x]:"/"}let p=SE(i,d),m=c&&c!=="/"&&c.endsWith("/"),h=(l||c===".")&&n.endsWith("/");return!p.pathname.endsWith("/")&&(m||h)&&(p.pathname+="/"),p}var es=e=>e.join("/").replace(/\/\/+/g,"/"),CE=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),EE=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,TE=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e,PE=class{constructor(e,t,n,s=!1){this.status=e,this.statusText=t||"",this.internal=s,n instanceof Error?(this.data=n.toString(),this.error=n):this.data=n}};function RE(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}function AE(e){return e.map(t=>t.route.path).filter(Boolean).join("/").replace(/\/\/*/g,"/")||"/"}var f0=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function p0(e,t){let n=e;if(typeof n!="string"||!kE.test(n))return{absoluteURL:void 0,isExternal:!1,to:n};let s=n,i=!1;if(f0)try{let l=new URL(window.location.href),c=n.startsWith("//")?new URL(l.protocol+n):new URL(n),d=js(c.pathname,t);c.origin===l.origin&&d!=null?n=d+c.search+c.hash:i=!0}catch{Mr(!1,`<Link to="${n}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:s,isExternal:i,to:n}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");var m0=["POST","PUT","PATCH","DELETE"];new Set(m0);var DE=["GET",...m0];new Set(DE);var Ji=f.createContext(null);Ji.displayName="DataRouter";var ed=f.createContext(null);ed.displayName="DataRouterState";var $E=f.createContext(!1),h0=f.createContext({isTransitioning:!1});h0.displayName="ViewTransition";var LE=f.createContext(new Map);LE.displayName="Fetchers";var IE=f.createContext(null);IE.displayName="Await";var Pr=f.createContext(null);Pr.displayName="Navigation";var Ml=f.createContext(null);Ml.displayName="Location";var Ur=f.createContext({outlet:null,matches:[],isDataRoute:!1});Ur.displayName="Route";var gh=f.createContext(null);gh.displayName="RouteError";var g0="REACT_ROUTER_ERROR",OE="REDIRECT",_E="ROUTE_ERROR_RESPONSE";function ME(e){if(e.startsWith(`${g0}:${OE}:{`))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 FE(e){if(e.startsWith(`${g0}:${_E}:{`))try{let t=JSON.parse(e.slice(40));if(typeof t=="object"&&t&&typeof t.status=="number"&&typeof t.statusText=="string")return new PE(t.status,t.statusText,t.data)}catch{}}function zE(e,{relative:t}={}){zt(Fl(),"useHref() may be used only in the context of a <Router> component.");let{basename:n,navigator:s}=f.useContext(Pr),{hash:i,pathname:l,search:c}=zl(e,{relative:t}),d=l;return n!=="/"&&(d=l==="/"?n:es([n,l])),s.createHref({pathname:d,search:c,hash:i})}function Fl(){return f.useContext(Ml)!=null}function Ln(){return zt(Fl(),"useLocation() may be used only in the context of a <Router> component."),f.useContext(Ml).location}var x0="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function y0(e){f.useContext(Pr).static||f.useLayoutEffect(e)}function Rt(){let{isDataRoute:e}=f.useContext(Ur);return e?t2():BE()}function BE(){zt(Fl(),"useNavigate() may be used only in the context of a <Router> component.");let e=f.useContext(Ji),{basename:t,navigator:n}=f.useContext(Pr),{matches:s}=f.useContext(Ur),{pathname:i}=Ln(),l=JSON.stringify(d0(s)),c=f.useRef(!1);return y0(()=>{c.current=!0}),f.useCallback((p,m={})=>{if(Mr(c.current,x0),!c.current)return;if(typeof p=="number"){n.go(p);return}let h=hh(p,JSON.parse(l),i,m.relative==="path");e==null&&t!=="/"&&(h.pathname=h.pathname==="/"?t:es([t,h.pathname])),(m.replace?n.replace:n.push)(h,m.state,m)},[t,n,l,i,e])}var UE=f.createContext(null);function HE(e){let t=f.useContext(Ur).outlet;return f.useMemo(()=>t&&f.createElement(UE.Provider,{value:e},t),[t,e])}function At(){let{matches:e}=f.useContext(Ur),t=e[e.length-1];return t?t.params:{}}function zl(e,{relative:t}={}){let{matches:n}=f.useContext(Ur),{pathname:s}=Ln(),i=JSON.stringify(d0(n));return f.useMemo(()=>hh(e,JSON.parse(i),s,t==="path"),[e,i,s,t])}function VE(e,t){return v0(e,t)}function v0(e,t,n){var w;zt(Fl(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:s}=f.useContext(Pr),{matches:i}=f.useContext(Ur),l=i[i.length-1],c=l?l.params:{},d=l?l.pathname:"/",p=l?l.pathnameBase:"/",m=l&&l.route;{let S=m&&m.path||"";w0(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=Ln(),x;if(t){let S=typeof t=="string"?Yi(t):t;zt(p==="/"||((w=S.pathname)==null?void 0:w.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 y=x.pathname||"/",v=y;if(p!=="/"){let S=p.replace(/^\//,"").split("/");v="/"+y.replace(/^\//,"").split("/").slice(S.length).join("/")}let C=l0(e,{pathname:v});Mr(m||C!=null,`No routes matched location "${x.pathname}${x.search}${x.hash}" `),Mr(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 j=YE(C&&C.map(S=>Object.assign({},S,{params:Object.assign({},c,S.params),pathname:es([p,s.encodeLocation?s.encodeLocation(S.pathname.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:S.pathname]),pathnameBase:S.pathnameBase==="/"?p:es([p,s.encodeLocation?s.encodeLocation(S.pathnameBase.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:S.pathnameBase])})),i,n);return t&&j?f.createElement(Ml.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",unstable_mask:void 0,...x},navigationType:"POP"}},j):j}function WE(){let e=e2(),t=RE(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,s="rgba(200,200,200, 0.5)",i={padding:"0.5rem",backgroundColor:s},l={padding:"2px 4px",backgroundColor:s},c=null;return console.error("Error handled by React Router default ErrorBoundary:",e),c=f.createElement(f.Fragment,null,f.createElement("p",null,"💿 Hey developer 👋"),f.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",f.createElement("code",{style:l},"ErrorBoundary")," or"," ",f.createElement("code",{style:l},"errorElement")," prop on your route.")),f.createElement(f.Fragment,null,f.createElement("h2",null,"Unexpected Application Error!"),f.createElement("h3",{style:{fontStyle:"italic"}},t),n?f.createElement("pre",{style:i},n):null,c)}var KE=f.createElement(WE,null),b0=class extends f.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=FE(e.digest);n&&(e=n)}let t=e!==void 0?f.createElement(Ur.Provider,{value:this.props.routeContext},f.createElement(gh.Provider,{value:e,children:this.props.component})):this.props.children;return this.context?f.createElement(qE,{error:e},t):t}};b0.contextType=$E;var Ip=new WeakMap;function qE({children:e,error:t}){let{basename:n}=f.useContext(Pr);if(typeof t=="object"&&t&&"digest"in t&&typeof t.digest=="string"){let s=ME(t.digest);if(s){let i=Ip.get(t);if(i)throw i;let l=p0(s.location,n);if(f0&&!Ip.get(t))if(l.isExternal||s.reloadDocument)window.location.href=l.absoluteURL||l.to;else{const c=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(l.to,{replace:s.replace}));throw Ip.set(t,c),c}return f.createElement("meta",{httpEquiv:"refresh",content:`0;url=${l.absoluteURL||l.to}`})}}return e}function GE({routeContext:e,match:t,children:n}){let s=f.useContext(Ji);return s&&s.static&&s.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(s.staticContext._deepestRenderedBoundaryId=t.route.id),f.createElement(Ur.Provider,{value:e},n)}function YE(e,t=[],n){let s=n==null?void 0:n.state;if(e==null){if(!s)return null;if(s.errors)e=s.matches;else if(t.length===0&&!s.initialized&&s.matches.length>0)e=s.matches;else return null}let i=e,l=s==null?void 0:s.errors;if(l!=null){let h=i.findIndex(x=>x.route.id&&(l==null?void 0:l[x.route.id])!==void 0);zt(h>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(l).join(",")}`),i=i.slice(0,Math.min(i.length,h+1))}let c=!1,d=-1;if(n&&s){c=s.renderFallback;for(let h=0;h<i.length;h++){let x=i[h];if((x.route.HydrateFallback||x.route.hydrateFallbackElement)&&(d=h),x.route.id){let{loaderData:y,errors:v}=s,C=x.route.loader&&!y.hasOwnProperty(x.route.id)&&(!v||v[x.route.id]===void 0);if(x.route.lazy||C){n.isStatic&&(c=!0),d>=0?i=i.slice(0,d+1):i=[i[0]];break}}}}let p=n==null?void 0:n.onError,m=s&&p?(h,x)=>{var y,v;p(h,{location:s.location,params:((v=(y=s.matches)==null?void 0:y[0])==null?void 0:v.params)??{},unstable_pattern:AE(s.matches),errorInfo:x})}:void 0;return i.reduceRight((h,x,y)=>{let v,C=!1,j=null,w=null;s&&(v=l&&x.route.id?l[x.route.id]:void 0,j=x.route.errorElement||KE,c&&(d<0&&y===0?(w0("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),C=!0,w=null):d===y&&(C=!0,w=x.route.hydrateFallbackElement||null)));let S=t.concat(i.slice(0,y+1)),E=()=>{let N;return v?N=j:C?N=w:x.route.Component?N=f.createElement(x.route.Component,null):x.route.element?N=x.route.element:N=h,f.createElement(GE,{match:x,routeContext:{outlet:h,matches:S,isDataRoute:s!=null},children:N})};return s&&(x.route.ErrorBoundary||x.route.errorElement||y===0)?f.createElement(b0,{location:s.location,revalidation:s.revalidation,component:j,error:v,children:E(),routeContext:{outlet:null,matches:S,isDataRoute:!0},onError:m}):E()},null)}function xh(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function JE(e){let t=f.useContext(Ji);return zt(t,xh(e)),t}function XE(e){let t=f.useContext(ed);return zt(t,xh(e)),t}function QE(e){let t=f.useContext(Ur);return zt(t,xh(e)),t}function yh(e){let t=QE(e),n=t.matches[t.matches.length-1];return zt(n.route.id,`${e} can only be used on routes that contain a unique "id"`),n.route.id}function ZE(){return yh("useRouteId")}function e2(){var s;let e=f.useContext(gh),t=XE("useRouteError"),n=yh("useRouteError");return e!==void 0?e:(s=t.errors)==null?void 0:s[n]}function t2(){let{router:e}=JE("useNavigate"),t=yh("useNavigate"),n=f.useRef(!1);return y0(()=>{n.current=!0}),f.useCallback(async(i,l={})=>{Mr(n.current,x0),n.current&&(typeof i=="number"?await e.navigate(i):await e.navigate(i,{fromRouteId:t,...l}))},[e,t])}var Lv={};function w0(e,t,n){!t&&!Lv[e]&&(Lv[e]=!0,Mr(!1,n))}f.memo(n2);function n2({routes:e,future:t,state:n,isStatic:s,onError:i}){return v0(e,void 0,{state:n,isStatic:s,onError:i})}function r2(e){return HE(e.context)}function ze(e){zt(!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 s2({basename:e="/",children:t=null,location:n,navigationType:s="POP",navigator:i,static:l=!1,unstable_useTransitions:c}){zt(!Fl(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let d=e.replace(/^\/*/,"/"),p=f.useMemo(()=>({basename:d,navigator:i,static:l,unstable_useTransitions:c,future:{}}),[d,i,l,c]);typeof n=="string"&&(n=Yi(n));let{pathname:m="/",search:h="",hash:x="",state:y=null,key:v="default",unstable_mask:C}=n,j=f.useMemo(()=>{let w=js(m,d);return w==null?null:{location:{pathname:w,search:h,hash:x,state:y,key:v,unstable_mask:C},navigationType:s}},[d,m,h,x,y,v,s,C]);return Mr(j!=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.`),j==null?null:f.createElement(Pr.Provider,{value:p},f.createElement(Ml.Provider,{children:t,value:j}))}function o2({children:e,location:t}){return VE(Pm(e),t)}function Pm(e,t=[]){let n=[];return f.Children.forEach(e,(s,i)=>{if(!f.isValidElement(s))return;let l=[...t,i];if(s.type===f.Fragment){n.push.apply(n,Pm(s.props.children,l));return}zt(s.type===ze,`[${typeof s.type=="string"?s.type:s.type.name}] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>`),zt(!s.props.index||!s.props.children,"An index route cannot have child routes.");let c={id:s.props.id||l.join("-"),caseSensitive:s.props.caseSensitive,element:s.props.element,Component:s.props.Component,index:s.props.index,path:s.props.path,middleware:s.props.middleware,loader:s.props.loader,action:s.props.action,hydrateFallbackElement:s.props.hydrateFallbackElement,HydrateFallback:s.props.HydrateFallback,errorElement:s.props.errorElement,ErrorBoundary:s.props.ErrorBoundary,hasErrorBoundary:s.props.hasErrorBoundary===!0||s.props.ErrorBoundary!=null||s.props.errorElement!=null,shouldRevalidate:s.props.shouldRevalidate,handle:s.props.handle,lazy:s.props.lazy};s.props.children&&(c.children=Pm(s.props.children,l)),n.push(c)}),n}var yu="get",vu="application/x-www-form-urlencoded";function td(e){return typeof HTMLElement<"u"&&e instanceof HTMLElement}function i2(e){return td(e)&&e.tagName.toLowerCase()==="button"}function a2(e){return td(e)&&e.tagName.toLowerCase()==="form"}function l2(e){return td(e)&&e.tagName.toLowerCase()==="input"}function c2(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function u2(e,t){return e.button===0&&(!t||t==="_self")&&!c2(e)}function Rm(e=""){return new URLSearchParams(typeof e=="string"||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((t,n)=>{let s=e[n];return t.concat(Array.isArray(s)?s.map(i=>[n,i]):[[n,s]])},[]))}function d2(e,t){let n=Rm(e);return t&&t.forEach((s,i)=>{n.has(i)||t.getAll(i).forEach(l=>{n.append(i,l)})}),n}var tu=null;function f2(){if(tu===null)try{new FormData(document.createElement("form"),0),tu=!1}catch{tu=!0}return tu}var p2=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function Op(e){return e!=null&&!p2.has(e)?(Mr(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${vu}"`),null):e}function m2(e,t){let n,s,i,l,c;if(a2(e)){let d=e.getAttribute("action");s=d?js(d,t):null,n=e.getAttribute("method")||yu,i=Op(e.getAttribute("enctype"))||vu,l=new FormData(e)}else if(i2(e)||l2(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(s=p?js(p,t):null,n=e.getAttribute("formmethod")||d.getAttribute("method")||yu,i=Op(e.getAttribute("formenctype"))||Op(d.getAttribute("enctype"))||vu,l=new FormData(d,e),!f2()){let{name:m,type:h,value:x}=e;if(h==="image"){let y=m?`${m}.`:"";l.append(`${y}x`,"0"),l.append(`${y}y`,"0")}else m&&l.append(m,x)}}else{if(td(e))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');n=yu,s=null,i=vu,c=e}return l&&i==="text/plain"&&(c=l,l=void 0),{action:s,method:n.toLowerCase(),encType:i,formData:l,body:c}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function vh(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function h2(e,t,n,s){let i=typeof e=="string"?new URL(e,typeof window>"u"?"server://singlefetch/":window.location.origin):e;return n?i.pathname.endsWith("/")?i.pathname=`${i.pathname}_.${s}`:i.pathname=`${i.pathname}.${s}`:i.pathname==="/"?i.pathname=`_root.${s}`:t&&js(i.pathname,t)==="/"?i.pathname=`${t.replace(/\/$/,"")}/_root.${s}`:i.pathname=`${i.pathname.replace(/\/$/,"")}.${s}`,i}async function g2(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 x2(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 y2(e,t,n){let s=await Promise.all(e.map(async i=>{let l=t.routes[i.route.id];if(l){let c=await g2(l,n);return c.links?c.links():[]}return[]}));return j2(s.flat(1).filter(x2).filter(i=>i.rel==="stylesheet"||i.rel==="preload").map(i=>i.rel==="stylesheet"?{...i,rel:"prefetch",as:"style"}:{...i,rel:"prefetch"}))}function Iv(e,t,n,s,i,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=s.routes[p.route.id];if(!h||!h.hasLoader)return!1;if(c(p,m)||d(p,m))return!0;if(p.route.shouldRevalidate){let y=p.route.shouldRevalidate({currentUrl:new URL(i.pathname+i.search+i.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 y=="boolean")return y}return!0}):[]}function v2(e,t,{includeHydrateFallback:n}={}){return b2(e.map(s=>{let i=t.routes[s.route.id];if(!i)return[];let l=[i.module];return i.clientActionModule&&(l=l.concat(i.clientActionModule)),i.clientLoaderModule&&(l=l.concat(i.clientLoaderModule)),n&&i.hydrateFallbackModule&&(l=l.concat(i.hydrateFallbackModule)),i.imports&&(l=l.concat(i.imports)),l}).flat(1))}function b2(e){return[...new Set(e)]}function w2(e){let t={},n=Object.keys(e).sort();for(let s of n)t[s]=e[s];return t}function j2(e,t){let n=new Set;return new Set(t),e.reduce((s,i)=>{let l=JSON.stringify(w2(i));return n.has(l)||(n.add(l),s.push({key:l,link:i})),s},[])}function j0(){let e=f.useContext(Ji);return vh(e,"You must render this element inside a <DataRouterContext.Provider> element"),e}function k2(){let e=f.useContext(ed);return vh(e,"You must render this element inside a <DataRouterStateContext.Provider> element"),e}var bh=f.createContext(void 0);bh.displayName="FrameworkContext";function k0(){let e=f.useContext(bh);return vh(e,"You must render this element inside a <HydratedRouter> element"),e}function S2(e,t){let n=f.useContext(bh),[s,i]=f.useState(!1),[l,c]=f.useState(!1),{onFocus:d,onBlur:p,onMouseEnter:m,onMouseLeave:h,onTouchStart:x}=t,y=f.useRef(null);f.useEffect(()=>{if(e==="render"&&c(!0),e==="viewport"){let j=S=>{S.forEach(E=>{c(E.isIntersecting)})},w=new IntersectionObserver(j,{threshold:.5});return y.current&&w.observe(y.current),()=>{w.disconnect()}}},[e]),f.useEffect(()=>{if(s){let j=setTimeout(()=>{c(!0)},100);return()=>{clearTimeout(j)}}},[s]);let v=()=>{i(!0)},C=()=>{i(!1),c(!1)};return n?e!=="intent"?[l,y,{}]:[l,y,{onFocus:el(d,v),onBlur:el(p,C),onMouseEnter:el(m,v),onMouseLeave:el(h,C),onTouchStart:el(x,v)}]:[!1,y,{}]}function el(e,t){return n=>{e&&e(n),n.defaultPrevented||t(n)}}function N2({page:e,...t}){let{router:n}=j0(),s=f.useMemo(()=>l0(n.routes,e,n.basename),[n.routes,e,n.basename]);return s?f.createElement(E2,{page:e,matches:s,...t}):null}function C2(e){let{manifest:t,routeModules:n}=k0(),[s,i]=f.useState([]);return f.useEffect(()=>{let l=!1;return y2(e,t,n).then(c=>{l||i(c)}),()=>{l=!0}},[e,t,n]),s}function E2({page:e,matches:t,...n}){let s=Ln(),{future:i,manifest:l,routeModules:c}=k0(),{basename:d}=j0(),{loaderData:p,matches:m}=k2(),h=f.useMemo(()=>Iv(e,t,m,l,s,"data"),[e,t,m,l,s]),x=f.useMemo(()=>Iv(e,t,m,l,s,"assets"),[e,t,m,l,s]),y=f.useMemo(()=>{if(e===s.pathname+s.search+s.hash)return[];let j=new Set,w=!1;if(t.forEach(E=>{var P;let N=l.routes[E.route.id];!N||!N.hasLoader||(!h.some(I=>I.route.id===E.route.id)&&E.route.id in p&&((P=c[E.route.id])!=null&&P.shouldRevalidate)||N.hasClientLoader?w=!0:j.add(E.route.id))}),j.size===0)return[];let S=h2(e,d,i.unstable_trailingSlashAwareDataRequests,"data");return w&&j.size>0&&S.searchParams.set("_routes",t.filter(E=>j.has(E.route.id)).map(E=>E.route.id).join(",")),[S.pathname+S.search]},[d,i.unstable_trailingSlashAwareDataRequests,p,s,l,h,t,e,c]),v=f.useMemo(()=>v2(x,l),[x,l]),C=C2(x);return f.createElement(f.Fragment,null,y.map(j=>f.createElement("link",{key:j,rel:"prefetch",as:"fetch",href:j,...n})),v.map(j=>f.createElement("link",{key:j,rel:"modulepreload",href:j,...n})),C.map(({key:j,link:w})=>f.createElement("link",{key:j,nonce:n.nonce,...w,crossOrigin:w.crossOrigin??n.crossOrigin})))}function T2(...e){return t=>{e.forEach(n=>{typeof n=="function"?n(t):n!=null&&(n.current=t)})}}var P2=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{P2&&(window.__reactRouterVersion="7.13.1")}catch{}function R2({basename:e,children:t,unstable_useTransitions:n,window:s}){let i=f.useRef();i.current==null&&(i.current=iE({window:s,v5Compat:!0}));let l=i.current,[c,d]=f.useState({action:l.action,location:l.location}),p=f.useCallback(m=>{n===!1?d(m):f.startTransition(()=>d(m))},[n]);return f.useLayoutEffect(()=>l.listen(p),[l,p]),f.createElement(s2,{basename:e,children:t,location:c.location,navigationType:c.action,navigator:l,unstable_useTransitions:n})}var S0=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Ee=f.forwardRef(function({onClick:t,discover:n="render",prefetch:s="none",relative:i,reloadDocument:l,replace:c,unstable_mask:d,state:p,target:m,to:h,preventScrollReset:x,viewTransition:y,unstable_defaultShouldRevalidate:v,...C},j){let{basename:w,navigator:S,unstable_useTransitions:E}=f.useContext(Pr),N=typeof h=="string"&&S0.test(h),P=p0(h,w);h=P.to;let I=zE(h,{relative:i}),R=Ln(),$=null;if(d){let W=hh(d,[],R.unstable_mask?R.unstable_mask.pathname:"/",!0);w!=="/"&&(W.pathname=W.pathname==="/"?w:es([w,W.pathname])),$=S.createHref(W)}let[D,X,Z]=S2(s,C),F=L2(h,{replace:c,unstable_mask:d,state:p,target:m,preventScrollReset:x,relative:i,viewTransition:y,unstable_defaultShouldRevalidate:v,unstable_useTransitions:E});function H(W){t&&t(W),W.defaultPrevented||F(W)}let J=!(P.isExternal||l),_=f.createElement("a",{...C,...Z,href:(J?$:void 0)||P.absoluteURL||I,onClick:J?H:t,ref:T2(j,X),target:m,"data-discover":!N&&n==="render"?"true":void 0});return D&&!N?f.createElement(f.Fragment,null,_,f.createElement(N2,{page:I})):_});Ee.displayName="Link";var A2=f.forwardRef(function({"aria-current":t="page",caseSensitive:n=!1,className:s="",end:i=!1,style:l,to:c,viewTransition:d,children:p,...m},h){let x=zl(c,{relative:m.relative}),y=Ln(),v=f.useContext(ed),{navigator:C,basename:j}=f.useContext(Pr),w=v!=null&&F2(x)&&d===!0,S=C.encodeLocation?C.encodeLocation(x).pathname:x.pathname,E=y.pathname,N=v&&v.navigation&&v.navigation.location?v.navigation.location.pathname:null;n||(E=E.toLowerCase(),N=N?N.toLowerCase():null,S=S.toLowerCase()),N&&j&&(N=js(N,j)||N);const P=S!=="/"&&S.endsWith("/")?S.length-1:S.length;let I=E===S||!i&&E.startsWith(S)&&E.charAt(P)==="/",R=N!=null&&(N===S||!i&&N.startsWith(S)&&N.charAt(S.length)==="/"),$={isActive:I,isPending:R,isTransitioning:w},D=I?t:void 0,X;typeof s=="function"?X=s($):X=[s,I?"active":null,R?"pending":null,w?"transitioning":null].filter(Boolean).join(" ");let Z=typeof l=="function"?l($):l;return f.createElement(Ee,{...m,"aria-current":D,className:X,ref:h,style:Z,to:c,viewTransition:d},typeof p=="function"?p($):p)});A2.displayName="NavLink";var D2=f.forwardRef(({discover:e="render",fetcherKey:t,navigate:n,reloadDocument:s,replace:i,state:l,method:c=yu,action:d,onSubmit:p,relative:m,preventScrollReset:h,viewTransition:x,unstable_defaultShouldRevalidate:y,...v},C)=>{let{unstable_useTransitions:j}=f.useContext(Pr),w=_2(),S=M2(d,{relative:m}),E=c.toLowerCase()==="get"?"get":"post",N=typeof d=="string"&&S0.test(d),P=I=>{if(p&&p(I),I.defaultPrevented)return;I.preventDefault();let R=I.nativeEvent.submitter,$=(R==null?void 0:R.getAttribute("formmethod"))||c,D=()=>w(R||I.currentTarget,{fetcherKey:t,method:$,navigate:n,replace:i,state:l,relative:m,preventScrollReset:h,viewTransition:x,unstable_defaultShouldRevalidate:y});j&&n!==!1?f.startTransition(()=>D()):D()};return f.createElement("form",{ref:C,method:E,action:S,onSubmit:s?p:P,...v,"data-discover":!N&&e==="render"?"true":void 0})});D2.displayName="Form";function $2(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function N0(e){let t=f.useContext(Ji);return zt(t,$2(e)),t}function L2(e,{target:t,replace:n,unstable_mask:s,state:i,preventScrollReset:l,relative:c,viewTransition:d,unstable_defaultShouldRevalidate:p,unstable_useTransitions:m}={}){let h=Rt(),x=Ln(),y=zl(e,{relative:c});return f.useCallback(v=>{if(u2(v,t)){v.preventDefault();let C=n!==void 0?n:Cl(x)===Cl(y),j=()=>h(e,{replace:C,unstable_mask:s,state:i,preventScrollReset:l,relative:c,viewTransition:d,unstable_defaultShouldRevalidate:p});m?f.startTransition(()=>j()):j()}},[x,h,y,n,s,i,t,e,l,c,d,p,m])}function is(e){Mr(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=f.useRef(Rm(e)),n=f.useRef(!1),s=Ln(),i=f.useMemo(()=>d2(s.search,n.current?null:t.current),[s.search]),l=Rt(),c=f.useCallback((d,p)=>{const m=Rm(typeof d=="function"?d(new URLSearchParams(i)):d);n.current=!0,l("?"+m,p)},[l,i]);return[i,c]}var I2=0,O2=()=>`__${String(++I2)}__`;function _2(){let{router:e}=N0("useSubmit"),{basename:t}=f.useContext(Pr),n=ZE(),s=e.fetch,i=e.navigate;return f.useCallback(async(l,c={})=>{let{action:d,method:p,encType:m,formData:h,body:x}=m2(l,t);if(c.navigate===!1){let y=c.fetcherKey||O2();await s(y,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 i(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})},[s,i,t,n])}function M2(e,{relative:t}={}){let{basename:n}=f.useContext(Pr),s=f.useContext(Ur);zt(s,"useFormAction must be used inside a RouteContext");let[i]=s.matches.slice(-1),l={...zl(e||".",{relative:t})},c=Ln();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===".")&&i.route.index&&(l.search=l.search?l.search.replace(/^\?/,"?index&"):"?index"),n!=="/"&&(l.pathname=l.pathname==="/"?n:es([n,l.pathname])),Cl(l)}function F2(e,{relative:t}={}){let n=f.useContext(h0);zt(n!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:s}=N0("useViewTransitionState"),i=zl(e,{relative:t});if(!n.isTransitioning)return!1;let l=js(n.currentLocation.pathname,s)||n.currentLocation.pathname,c=js(n.nextLocation.pathname,s)||n.nextLocation.pathname;return Au(i.pathname,c)!=null||Au(i.pathname,l)!=null}var ws=a0();const z2=Zu(ws);/**
|
|
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 B2=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),C0=(...e)=>e.filter((t,n,s)=>!!t&&t.trim()!==""&&s.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 U2={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 H2=f.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:s,className:i="",children:l,iconNode:c,...d},p)=>f.createElement("svg",{ref:p,...U2,width:t,height:t,stroke:e,strokeWidth:s?Number(n)*24/Number(t):n,className:C0("lucide",i),...d},[...c.map(([m,h])=>f.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 Re=(e,t)=>{const n=f.forwardRef(({className:s,...i},l)=>f.createElement(H2,{ref:l,iconNode:t,className:C0(`lucide-${B2(e)}`,s),...i}));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 nd=Re("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 E0=Re("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 Bl=Re("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 T0=Re("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 Du=Re("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 V2=Re("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 P0=Re("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 rd=Re("Boxes",[["path",{d:"M2.97 12.92A2 2 0 0 0 2 14.63v3.24a2 2 0 0 0 .97 1.71l3 1.8a2 2 0 0 0 2.06 0L12 19v-5.5l-5-3-4.03 2.42Z",key:"lc1i9w"}],["path",{d:"m7 16.5-4.74-2.85",key:"1o9zyk"}],["path",{d:"m7 16.5 5-3",key:"va8pkn"}],["path",{d:"M7 16.5v5.17",key:"jnp8gn"}],["path",{d:"M12 13.5V19l3.97 2.38a2 2 0 0 0 2.06 0l3-1.8a2 2 0 0 0 .97-1.71v-3.24a2 2 0 0 0-.97-1.71L17 10.5l-5 3Z",key:"8zsnat"}],["path",{d:"m17 16.5-5-3",key:"8arw3v"}],["path",{d:"m17 16.5 4.74-2.85",key:"8rfmw"}],["path",{d:"M17 16.5v5.17",key:"k6z78m"}],["path",{d:"M7.97 4.42A2 2 0 0 0 7 6.13v4.37l5 3 5-3V6.13a2 2 0 0 0-.97-1.71l-3-1.8a2 2 0 0 0-2.06 0l-3 1.8Z",key:"1xygjf"}],["path",{d:"M12 8 7.26 5.15",key:"1vbdud"}],["path",{d:"m12 8 4.74-2.85",key:"3rx089"}],["path",{d:"M12 13.5V8",key:"1io7kd"}]]);/**
|
|
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 W2=Re("Brain",[["path",{d:"M12 5a3 3 0 1 0-5.997.125 4 4 0 0 0-2.526 5.77 4 4 0 0 0 .556 6.588A4 4 0 1 0 12 18Z",key:"l5xja"}],["path",{d:"M12 5a3 3 0 1 1 5.997.125 4 4 0 0 1 2.526 5.77 4 4 0 0 1-.556 6.588A4 4 0 1 1 12 18Z",key:"ep3f8r"}],["path",{d:"M15 13a4.5 4.5 0 0 1-3-4 4.5 4.5 0 0 1-3 4",key:"1p4c4q"}],["path",{d:"M17.599 6.5a3 3 0 0 0 .399-1.375",key:"tmeiqw"}],["path",{d:"M6.003 5.125A3 3 0 0 0 6.401 6.5",key:"105sqy"}],["path",{d:"M3.477 10.896a4 4 0 0 1 .585-.396",key:"ql3yin"}],["path",{d:"M19.938 10.5a4 4 0 0 1 .585.396",key:"1qfode"}],["path",{d:"M6 18a4 4 0 0 1-1.967-.516",key:"2e4loj"}],["path",{d:"M19.967 17.484A4 4 0 0 1 18 18",key:"159ez6"}]]);/**
|
|
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 Fo=Re("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/**
|
|
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 Io=Re("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/**
|
|
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 K2=Re("ChevronLeft",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]);/**
|
|
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 R0=Re("ChevronUp",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);/**
|
|
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 Am=Re("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"}]]);/**
|
|
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 wh=Re("CircleCheck",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);/**
|
|
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 Dm=Re("CircleDot",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}]]);/**
|
|
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 q2=Re("CircleStop",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["rect",{x:"9",y:"9",width:"6",height:"6",rx:"1",key:"1ssd4o"}]]);/**
|
|
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 G2=Re("Circle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);/**
|
|
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 Y2=Re("Clock3",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16.5 12",key:"1aq6pp"}]]);/**
|
|
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 J2=Re("Clock",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16 14",key:"68esgv"}]]);/**
|
|
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 X2=Re("Cloud",[["path",{d:"M17.5 19H9a7 7 0 1 1 6.71-9h1.79a4.5 4.5 0 1 1 0 9Z",key:"p7xjir"}]]);/**
|
|
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 jh=Re("Coins",[["circle",{cx:"8",cy:"8",r:"6",key:"3yglwk"}],["path",{d:"M18.09 10.37A6 6 0 1 1 10.34 18",key:"t5s6rm"}],["path",{d:"M7 6h1v4",key:"1obek4"}],["path",{d:"m16.71 13.88.7.71-2.82 2.82",key:"1rbuyh"}]]);/**
|
|
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 Q2=Re("Columns3",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}],["path",{d:"M15 3v18",key:"14nvp0"}]]);/**
|
|
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 A0=Re("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"}]]);/**
|
|
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 El=Re("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"}]]);/**
|
|
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 Z2=Re("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"}]]);/**
|
|
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 eT=Re("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"}]]);/**
|
|
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 Xi=Re("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"}]]);/**
|
|
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 Ov=Re("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"}]]);/**
|
|
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 tT=Re("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"}]]);/**
|
|
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 nT=Re("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"}]]);/**
|
|
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 D0=Re("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"}]]);/**
|
|
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 $0=Re("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"}]]);/**
|
|
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 rT=Re("GitBranchPlus",[["path",{d:"M6 3v12",key:"qpgusn"}],["path",{d:"M18 9a3 3 0 1 0 0-6 3 3 0 0 0 0 6z",key:"1d02ji"}],["path",{d:"M6 21a3 3 0 1 0 0-6 3 3 0 0 0 0 6z",key:"chk6ph"}],["path",{d:"M15 6a9 9 0 0 0-9 9",key:"or332x"}],["path",{d:"M18 15v6",key:"9wciyi"}],["path",{d:"M21 18h-6",key:"139f0c"}]]);/**
|
|
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 kh=Re("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"}]]);/**
|
|
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 sT=Re("GitFork",[["circle",{cx:"12",cy:"18",r:"3",key:"1mpf1b"}],["circle",{cx:"6",cy:"6",r:"3",key:"1lh9wr"}],["circle",{cx:"18",cy:"6",r:"3",key:"1h7g24"}],["path",{d:"M18 9v2c0 .6-.4 1-1 1H7c-.6 0-1-.4-1-1V9",key:"1uq4wg"}],["path",{d:"M12 12v3",key:"158kv8"}]]);/**
|
|
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 sd=Re("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"}]]);/**
|
|
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 oT=Re("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"}]]);/**
|
|
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 Sh=Re("Info",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]]);/**
|
|
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 $m=Re("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"}]]);/**
|
|
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 L0=Re("LayoutTemplate",[["rect",{width:"18",height:"7",x:"3",y:"3",rx:"1",key:"f1a2em"}],["rect",{width:"9",height:"7",x:"3",y:"14",rx:"1",key:"jqznyg"}],["rect",{width:"5",height:"7",x:"16",y:"14",rx:"1",key:"q5h2i8"}]]);/**
|
|
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 iT=Re("Library",[["path",{d:"m16 6 4 14",key:"ji33uf"}],["path",{d:"M12 6v14",key:"1n7gus"}],["path",{d:"M8 8v12",key:"1gg7y9"}],["path",{d:"M4 4v16",key:"6qkkli"}]]);/**
|
|
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 aT=Re("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"}]]);/**
|
|
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 lT=Re("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"}]]);/**
|
|
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 cT=Re("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"}]]);/**
|
|
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 Nh=Re("LoaderCircle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);/**
|
|
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 uT=Re("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"}]]);/**
|
|
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 Ch=Re("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"}]]);/**
|
|
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 dT=Re("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"}]]);/**
|
|
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 _p=Re("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"}]]);/**
|
|
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 zo=Re("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"}]]);/**
|
|
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 fT=Re("Play",[["polygon",{points:"6 3 20 12 6 21 6 3",key:"1oa8hb"}]]);/**
|
|
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 Jt=Re("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);/**
|
|
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 I0=Re("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"}]]);/**
|
|
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 pT=Re("Replace",[["path",{d:"M14 4a2 2 0 0 1 2-2",key:"1w2hp7"}],["path",{d:"M16 10a2 2 0 0 1-2-2",key:"shjach"}],["path",{d:"M20 2a2 2 0 0 1 2 2",key:"188mtx"}],["path",{d:"M22 8a2 2 0 0 1-2 2",key:"ddf4tu"}],["path",{d:"m3 7 3 3 3-3",key:"x25e72"}],["path",{d:"M6 10V5a3 3 0 0 1 3-3h1",key:"3y3t5z"}],["rect",{x:"2",y:"14",width:"8",height:"8",rx:"2",key:"4rksxw"}]]);/**
|
|
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 mT=Re("Reply",[["polyline",{points:"9 17 4 12 9 7",key:"hvgpf2"}],["path",{d:"M20 18v-2a4 4 0 0 0-4-4H4",key:"5vmcpk"}]]);/**
|
|
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 Wi=Re("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"}]]);/**
|
|
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 od=Re("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"}]]);/**
|
|
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 hT=Re("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"}]]);/**
|
|
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 so=Re("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);/**
|
|
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 gT=Re("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"}]]);/**
|
|
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 xT=Re("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"}]]);/**
|
|
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 yT=Re("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"}]]);/**
|
|
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 vT=Re("ShieldAlert",[["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:"M12 8v4",key:"1got3b"}],["path",{d:"M12 16h.01",key:"1drbdi"}]]);/**
|
|
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 Er=Re("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"}]]);/**
|
|
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 _v=Re("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"}]]);/**
|
|
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 Eh=Re("Square",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]]);/**
|
|
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 bT=Re("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"}]]);/**
|
|
412
|
+
* @license lucide-react v0.460.0 - ISC
|
|
413
|
+
*
|
|
414
|
+
* This source code is licensed under the ISC license.
|
|
415
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
416
|
+
*/const O0=Re("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"}]]);/**
|
|
417
|
+
* @license lucide-react v0.460.0 - ISC
|
|
418
|
+
*
|
|
419
|
+
* This source code is licensed under the ISC license.
|
|
420
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
421
|
+
*/const $i=Re("Terminal",[["polyline",{points:"4 17 10 11 4 5",key:"akl6gq"}],["line",{x1:"12",x2:"20",y1:"19",y2:"19",key:"q2wloq"}]]);/**
|
|
422
|
+
* @license lucide-react v0.460.0 - ISC
|
|
423
|
+
*
|
|
424
|
+
* This source code is licensed under the ISC license.
|
|
425
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
426
|
+
*/const In=Re("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"}]]);/**
|
|
427
|
+
* @license lucide-react v0.460.0 - ISC
|
|
428
|
+
*
|
|
429
|
+
* This source code is licensed under the ISC license.
|
|
430
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
431
|
+
*/const Th=Re("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"}]]);/**
|
|
432
|
+
* @license lucide-react v0.460.0 - ISC
|
|
433
|
+
*
|
|
434
|
+
* This source code is licensed under the ISC license.
|
|
435
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
436
|
+
*/const wT=Re("Type",[["polyline",{points:"4 7 4 4 20 4 20 7",key:"1nosan"}],["line",{x1:"9",x2:"15",y1:"20",y2:"20",key:"swin9y"}],["line",{x1:"12",x2:"12",y1:"4",y2:"20",key:"1tx1rr"}]]);/**
|
|
437
|
+
* @license lucide-react v0.460.0 - ISC
|
|
438
|
+
*
|
|
439
|
+
* This source code is licensed under the ISC license.
|
|
440
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
441
|
+
*/const jT=Re("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"}]]);/**
|
|
442
|
+
* @license lucide-react v0.460.0 - ISC
|
|
443
|
+
*
|
|
444
|
+
* This source code is licensed under the ISC license.
|
|
445
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
446
|
+
*/const Ph=Re("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);function _0(e){var t,n,s="";if(typeof e=="string"||typeof e=="number")s+=e;else if(typeof e=="object")if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(n=_0(e[t]))&&(s&&(s+=" "),s+=n)}else for(n in e)e[n]&&(s&&(s+=" "),s+=n);return s}function kT(){for(var e,t,n=0,s="",i=arguments.length;n<i;n++)(e=arguments[n])&&(t=_0(e))&&(s&&(s+=" "),s+=t);return s}const Rh="-",ST=e=>{const t=CT(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:s}=e;return{getClassGroupId:c=>{const d=c.split(Rh);return d[0]===""&&d.length!==1&&d.shift(),M0(d,t)||NT(c)},getConflictingClassGroupIds:(c,d)=>{const p=n[c]||[];return d&&s[c]?[...p,...s[c]]:p}}},M0=(e,t)=>{var c;if(e.length===0)return t.classGroupId;const n=e[0],s=t.nextPart.get(n),i=s?M0(e.slice(1),s):void 0;if(i)return i;if(t.validators.length===0)return;const l=e.join(Rh);return(c=t.validators.find(({validator:d})=>d(l)))==null?void 0:c.classGroupId},Mv=/^\[(.+)\]$/,NT=e=>{if(Mv.test(e)){const t=Mv.exec(e)[1],n=t==null?void 0:t.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}},CT=e=>{const{theme:t,prefix:n}=e,s={nextPart:new Map,validators:[]};return TT(Object.entries(e.classGroups),n).forEach(([l,c])=>{Lm(c,s,l,t)}),s},Lm=(e,t,n,s)=>{e.forEach(i=>{if(typeof i=="string"){const l=i===""?t:Fv(t,i);l.classGroupId=n;return}if(typeof i=="function"){if(ET(i)){Lm(i(s),t,n,s);return}t.validators.push({validator:i,classGroupId:n});return}Object.entries(i).forEach(([l,c])=>{Lm(c,Fv(t,l),n,s)})})},Fv=(e,t)=>{let n=e;return t.split(Rh).forEach(s=>{n.nextPart.has(s)||n.nextPart.set(s,{nextPart:new Map,validators:[]}),n=n.nextPart.get(s)}),n},ET=e=>e.isThemeGetter,TT=(e,t)=>t?e.map(([n,s])=>{const i=s.map(l=>typeof l=="string"?t+l:typeof l=="object"?Object.fromEntries(Object.entries(l).map(([c,d])=>[t+c,d])):l);return[n,i]}):e,PT=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=new Map,s=new Map;const i=(l,c)=>{n.set(l,c),t++,t>e&&(t=0,s=n,n=new Map)};return{get(l){let c=n.get(l);if(c!==void 0)return c;if((c=s.get(l))!==void 0)return i(l,c),c},set(l,c){n.has(l)?n.set(l,c):i(l,c)}}},F0="!",RT=e=>{const{separator:t,experimentalParseClassName:n}=e,s=t.length===1,i=t[0],l=t.length,c=d=>{const p=[];let m=0,h=0,x;for(let w=0;w<d.length;w++){let S=d[w];if(m===0){if(S===i&&(s||d.slice(w,w+l)===t)){p.push(d.slice(h,w)),h=w+l;continue}if(S==="/"){x=w;continue}}S==="["?m++:S==="]"&&m--}const y=p.length===0?d:d.substring(h),v=y.startsWith(F0),C=v?y.substring(1):y,j=x&&x>h?x-h:void 0;return{modifiers:p,hasImportantModifier:v,baseClassName:C,maybePostfixModifierPosition:j}};return n?d=>n({className:d,parseClassName:c}):c},AT=e=>{if(e.length<=1)return e;const t=[];let n=[];return e.forEach(s=>{s[0]==="["?(t.push(...n.sort(),s),n=[]):n.push(s)}),t.push(...n.sort()),t},DT=e=>({cache:PT(e.cacheSize),parseClassName:RT(e),...ST(e)}),$T=/\s+/,LT=(e,t)=>{const{parseClassName:n,getClassGroupId:s,getConflictingClassGroupIds:i}=t,l=[],c=e.trim().split($T);let d="";for(let p=c.length-1;p>=0;p-=1){const m=c[p],{modifiers:h,hasImportantModifier:x,baseClassName:y,maybePostfixModifierPosition:v}=n(m);let C=!!v,j=s(C?y.substring(0,v):y);if(!j){if(!C){d=m+(d.length>0?" "+d:d);continue}if(j=s(y),!j){d=m+(d.length>0?" "+d:d);continue}C=!1}const w=AT(h).join(":"),S=x?w+F0:w,E=S+j;if(l.includes(E))continue;l.push(E);const N=i(j,C);for(let P=0;P<N.length;++P){const I=N[P];l.push(S+I)}d=m+(d.length>0?" "+d:d)}return d};function IT(){let e=0,t,n,s="";for(;e<arguments.length;)(t=arguments[e++])&&(n=z0(t))&&(s&&(s+=" "),s+=n);return s}const z0=e=>{if(typeof e=="string")return e;let t,n="";for(let s=0;s<e.length;s++)e[s]&&(t=z0(e[s]))&&(n&&(n+=" "),n+=t);return n};function OT(e,...t){let n,s,i,l=c;function c(p){const m=t.reduce((h,x)=>x(h),e());return n=DT(m),s=n.cache.get,i=n.cache.set,l=d,d(p)}function d(p){const m=s(p);if(m)return m;const h=LT(p,n);return i(p,h),h}return function(){return l(IT.apply(null,arguments))}}const Et=e=>{const t=n=>n[e]||[];return t.isThemeGetter=!0,t},B0=/^\[(?:([a-z-]+):)?(.+)\]$/i,_T=/^\d+\/\d+$/,MT=new Set(["px","full","screen"]),FT=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,zT=/\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$/,BT=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,UT=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,HT=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,bs=e=>Li(e)||MT.has(e)||_T.test(e),Ws=e=>Qi(e,"length",XT),Li=e=>!!e&&!Number.isNaN(Number(e)),Mp=e=>Qi(e,"number",Li),tl=e=>!!e&&Number.isInteger(Number(e)),VT=e=>e.endsWith("%")&&Li(e.slice(0,-1)),rt=e=>B0.test(e),Ks=e=>FT.test(e),WT=new Set(["length","size","percentage"]),KT=e=>Qi(e,WT,U0),qT=e=>Qi(e,"position",U0),GT=new Set(["image","url"]),YT=e=>Qi(e,GT,ZT),JT=e=>Qi(e,"",QT),nl=()=>!0,Qi=(e,t,n)=>{const s=B0.exec(e);return s?s[1]?typeof t=="string"?s[1]===t:t.has(s[1]):n(s[2]):!1},XT=e=>zT.test(e)&&!BT.test(e),U0=()=>!1,QT=e=>UT.test(e),ZT=e=>HT.test(e),eP=()=>{const e=Et("colors"),t=Et("spacing"),n=Et("blur"),s=Et("brightness"),i=Et("borderColor"),l=Et("borderRadius"),c=Et("borderSpacing"),d=Et("borderWidth"),p=Et("contrast"),m=Et("grayscale"),h=Et("hueRotate"),x=Et("invert"),y=Et("gap"),v=Et("gradientColorStops"),C=Et("gradientColorStopPositions"),j=Et("inset"),w=Et("margin"),S=Et("opacity"),E=Et("padding"),N=Et("saturate"),P=Et("scale"),I=Et("sepia"),R=Et("skew"),$=Et("space"),D=Et("translate"),X=()=>["auto","contain","none"],Z=()=>["auto","hidden","clip","visible","scroll"],F=()=>["auto",rt,t],H=()=>[rt,t],J=()=>["",bs,Ws],_=()=>["auto",Li,rt],W=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],Y=()=>["solid","dashed","dotted","double","none"],ie=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],K=()=>["start","end","center","between","around","evenly","stretch"],ae=()=>["","0",rt],T=()=>["auto","avoid","all","avoid-page","page","left","right","column"],M=()=>[Li,rt];return{cacheSize:500,separator:":",theme:{colors:[nl],spacing:[bs,Ws],blur:["none","",Ks,rt],brightness:M(),borderColor:[e],borderRadius:["none","","full",Ks,rt],borderSpacing:H(),borderWidth:J(),contrast:M(),grayscale:ae(),hueRotate:M(),invert:ae(),gap:H(),gradientColorStops:[e],gradientColorStopPositions:[VT,Ws],inset:F(),margin:F(),opacity:M(),padding:H(),saturate:M(),scale:M(),sepia:ae(),skew:M(),space:H(),translate:H()},classGroups:{aspect:[{aspect:["auto","square","video",rt]}],container:["container"],columns:[{columns:[Ks]}],"break-after":[{"break-after":T()}],"break-before":[{"break-before":T()}],"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:[...W(),rt]}],overflow:[{overflow:Z()}],"overflow-x":[{"overflow-x":Z()}],"overflow-y":[{"overflow-y":Z()}],overscroll:[{overscroll:X()}],"overscroll-x":[{"overscroll-x":X()}],"overscroll-y":[{"overscroll-y":X()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[j]}],"inset-x":[{"inset-x":[j]}],"inset-y":[{"inset-y":[j]}],start:[{start:[j]}],end:[{end:[j]}],top:[{top:[j]}],right:[{right:[j]}],bottom:[{bottom:[j]}],left:[{left:[j]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",tl,rt]}],basis:[{basis:F()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",rt]}],grow:[{grow:ae()}],shrink:[{shrink:ae()}],order:[{order:["first","last","none",tl,rt]}],"grid-cols":[{"grid-cols":[nl]}],"col-start-end":[{col:["auto",{span:["full",tl,rt]},rt]}],"col-start":[{"col-start":_()}],"col-end":[{"col-end":_()}],"grid-rows":[{"grid-rows":[nl]}],"row-start-end":[{row:["auto",{span:[tl,rt]},rt]}],"row-start":[{"row-start":_()}],"row-end":[{"row-end":_()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",rt]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",rt]}],gap:[{gap:[y]}],"gap-x":[{"gap-x":[y]}],"gap-y":[{"gap-y":[y]}],"justify-content":[{justify:["normal",...K()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...K(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...K(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[E]}],px:[{px:[E]}],py:[{py:[E]}],ps:[{ps:[E]}],pe:[{pe:[E]}],pt:[{pt:[E]}],pr:[{pr:[E]}],pb:[{pb:[E]}],pl:[{pl:[E]}],m:[{m:[w]}],mx:[{mx:[w]}],my:[{my:[w]}],ms:[{ms:[w]}],me:[{me:[w]}],mt:[{mt:[w]}],mr:[{mr:[w]}],mb:[{mb:[w]}],ml:[{ml:[w]}],"space-x":[{"space-x":[$]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[$]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",rt,t]}],"min-w":[{"min-w":[rt,t,"min","max","fit"]}],"max-w":[{"max-w":[rt,t,"none","full","min","max","fit","prose",{screen:[Ks]},Ks]}],h:[{h:[rt,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[rt,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[rt,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[rt,t,"auto","min","max","fit"]}],"font-size":[{text:["base",Ks,Ws]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",Mp]}],"font-family":[{font:[nl]}],"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",rt]}],"line-clamp":[{"line-clamp":["none",Li,Mp]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",bs,rt]}],"list-image":[{"list-image":["none",rt]}],"list-style-type":[{list:["none","disc","decimal",rt]}],"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:[...Y(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",bs,Ws]}],"underline-offset":[{"underline-offset":["auto",bs,rt]}],"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:H()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",rt]}],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",rt]}],"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:[...W(),qT]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",KT]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},YT]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[C]}],"gradient-via-pos":[{via:[C]}],"gradient-to-pos":[{to:[C]}],"gradient-from":[{from:[v]}],"gradient-via":[{via:[v]}],"gradient-to":[{to:[v]}],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:[...Y(),"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:Y()}],"border-color":[{border:[i]}],"border-color-x":[{"border-x":[i]}],"border-color-y":[{"border-y":[i]}],"border-color-s":[{"border-s":[i]}],"border-color-e":[{"border-e":[i]}],"border-color-t":[{"border-t":[i]}],"border-color-r":[{"border-r":[i]}],"border-color-b":[{"border-b":[i]}],"border-color-l":[{"border-l":[i]}],"divide-color":[{divide:[i]}],"outline-style":[{outline:["",...Y()]}],"outline-offset":[{"outline-offset":[bs,rt]}],"outline-w":[{outline:[bs,Ws]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:J()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[S]}],"ring-offset-w":[{"ring-offset":[bs,Ws]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",Ks,JT]}],"shadow-color":[{shadow:[nl]}],opacity:[{opacity:[S]}],"mix-blend":[{"mix-blend":[...ie(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":ie()}],filter:[{filter:["","none"]}],blur:[{blur:[n]}],brightness:[{brightness:[s]}],contrast:[{contrast:[p]}],"drop-shadow":[{"drop-shadow":["","none",Ks,rt]}],grayscale:[{grayscale:[m]}],"hue-rotate":[{"hue-rotate":[h]}],invert:[{invert:[x]}],saturate:[{saturate:[N]}],sepia:[{sepia:[I]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[n]}],"backdrop-brightness":[{"backdrop-brightness":[s]}],"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":[I]}],"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",rt]}],duration:[{duration:M()}],ease:[{ease:["linear","in","out","in-out",rt]}],delay:[{delay:M()}],animate:[{animate:["none","spin","ping","pulse","bounce",rt]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[P]}],"scale-x":[{"scale-x":[P]}],"scale-y":[{"scale-y":[P]}],rotate:[{rotate:[tl,rt]}],"translate-x":[{"translate-x":[D]}],"translate-y":[{"translate-y":[D]}],"skew-x":[{"skew-x":[R]}],"skew-y":[{"skew-y":[R]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",rt]}],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",rt]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":H()}],"scroll-mx":[{"scroll-mx":H()}],"scroll-my":[{"scroll-my":H()}],"scroll-ms":[{"scroll-ms":H()}],"scroll-me":[{"scroll-me":H()}],"scroll-mt":[{"scroll-mt":H()}],"scroll-mr":[{"scroll-mr":H()}],"scroll-mb":[{"scroll-mb":H()}],"scroll-ml":[{"scroll-ml":H()}],"scroll-p":[{"scroll-p":H()}],"scroll-px":[{"scroll-px":H()}],"scroll-py":[{"scroll-py":H()}],"scroll-ps":[{"scroll-ps":H()}],"scroll-pe":[{"scroll-pe":H()}],"scroll-pt":[{"scroll-pt":H()}],"scroll-pr":[{"scroll-pr":H()}],"scroll-pb":[{"scroll-pb":H()}],"scroll-pl":[{"scroll-pl":H()}],"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",rt]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[bs,Ws,Mp]}],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"]}}},tP=OT(eP);function Te(...e){return tP(kT(e))}function pr(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 rs(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 H0(e){if(!e)return"—";const t=new Date(e);return Number.isNaN(t.getTime())?e:t.toLocaleDateString(void 0,{month:"short",day:"numeric"})}function V0(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 W0(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 s=Math.floor(n/60);if(s<60)return`${s}m ago`;const i=Math.floor(s/60);return i<24?`${i}h ago`:`${Math.floor(i/24)}d ago`}function gn(e){return e.split(/[_\s-]+/).filter(Boolean).map(t=>t.charAt(0).toUpperCase()+t.slice(1)).join(" ")}function K0(e){return!e||e==="/"?"/":e.endsWith("/")?e.slice(0,-1):e}function nP(e){let t=K0(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("/inventories")?"/inventories":t.startsWith("/usage")?"/usage":t.startsWith("/agent-sessions")?"/agent-sessions":t.startsWith("/playbooks")?"/playbooks":t.startsWith("/memories")?"/memories":t.startsWith("/resources")?"/resources":t.startsWith("/todos")?"/todos":t.startsWith("/views")?"/views":t.startsWith("/help")?"/help":t.startsWith("/settings")?"/settings":null}function q0(e,t){return nP(e)===t}function G0(e){let n=K0(e).split("/").filter(Boolean);const s=[];let i="Overview",l=null,c="";if(n[0]==="w"&&n[1]&&(c=`/w/${n[1]}`,s.push({label:gn(n[1]),path:`${c}/projects`}),n=n.slice(2)),n.length===0)return{title:i,breadcrumbs:s,projectSlug:l};if(n[0]==="projects"){if(s.push({label:"Projects",path:`${c}/projects`}),i="Projects",n[1]&&(l=n[1],s.push({label:gn(n[1]),path:`${c}/projects/${n[1]}`}),i=gn(n[1])),n[2]==="edit")i="Edit Project";else if(n[2]==="create"&&n[3]==="assignment")i="Create Assignment";else if(n[2]==="assignments"&&n[3])s.push({label:gn(n[3]),path:`${c}/projects/${n[1]}/assignments/${n[3]}`}),i=gn(n[3]),n[4]==="edit"?i="Edit Assignment":n[4]==="plan"&&n[5]==="edit"?i="Edit Plan":n[4]==="scratchpad"&&n[5]==="edit"?i="Edit Scratchpad":n[4]==="handoff"&&n[5]==="edit"?i="Append Handoff":n[4]==="decision-record"&&n[5]==="edit"&&(i="Append Decision");else if((n[2]==="memories"||n[2]==="resources")&&n[3]){const d=n[2]==="memories"?"Memories":"Resources",p=n[2]==="memories"?"/memories":"/resources";s.push({label:d,path:p}),s.push({label:gn(n[3]),path:`${c}/projects/${n[1]}/${n[2]}/${n[3]}`}),i=gn(n[3]),n[4]==="edit"&&(i=n[2]==="memories"?"Edit Memory":"Edit Resource")}}else n[0]==="servers"?(i="Servers",s.push({label:"Servers",path:`${c}/servers`})):n[0]==="inventories"?(i="Inventories",s.push({label:"Inventories",path:`${c}/inventories`})):n[0]==="usage"?(i="Usage",s.push({label:"Usage",path:`${c}/usage`})):n[0]==="agent-sessions"?(i="Agent Sessions",s.push({label:"Agent Sessions",path:`${c}/agent-sessions`})):n[0]==="assignments"?(i="Assignments",s.push({label:"Assignments",path:`${c}/assignments`})):n[0]==="playbooks"?(s.push({label:"Playbooks",path:"/playbooks"}),i="Playbooks",n[1]==="create"?i="Create Playbook":n[1]&&n[2]==="edit"?(s.push({label:gn(n[1]),path:`/playbooks/${n[1]}`}),i="Edit Playbook"):n[1]&&(s.push({label:gn(n[1]),path:`/playbooks/${n[1]}`}),i=gn(n[1]))):n[0]==="memories"?(s.push({label:"Memories",path:"/memories"}),i="Memories",n[1]==="new"&&(i="New Memory")):n[0]==="resources"?(s.push({label:"Resources",path:"/resources"}),i="Resources",n[1]==="new"&&(i="New Resource")):n[0]==="todos"?(i="Todos",s.push({label:"Todos",path:`${c}/todos`})):n[0]==="views"?(i="Saved Views",s.push({label:"Saved Views",path:`${c}/views`})):n[0]==="help"?(i="Help",s.push({label:"Help",path:"/help"})):n[0]==="settings"?(i="Settings",s.push({label:"Settings",path:"/settings"})):n[0]==="create"&&n[1]==="project"&&(i="Create Project",s.push({label:"Create Project",path:`${c}/create/project`}));return{title:i,breadcrumbs:s,projectSlug:l}}function zv({items:e,onNavigate:t}){const n=Ln();return r.jsx("nav",{className:"space-y-1",children:e.map(s=>{const i=s.icon,l=q0(n.pathname,s.to)&&!n.pathname.startsWith("/w/");return r.jsxs(Ee,{to:s.to,onClick:t,className:Te("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:[r.jsx(i,{className:"h-4 w-4"}),r.jsx("span",{children:s.label})]},s.to)})})}const Y0=[{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)"}}],rP=Y0.map(e=>e.slug),$u="default";function J0(e){return typeof e=="string"&&rP.includes(e)}const X0={preset:$u,custom:!1};let pl=null,xi=null;function Ah(e){if(!e||typeof e!="object")return X0;const t=e;return{preset:J0(t.preset)?t.preset:$u,custom:t.custom===!0}}function sP(){return pl?Promise.resolve(pl):xi||(xi=fetch("/api/config/theme").then(e=>{if(!e.ok)throw new Error(`HTTP ${e.status}`);return e.json()}).then(e=>{const t=Ah(e);return pl=t,xi=null,t}).catch(()=>(xi=null,X0)),xi)}async function oP(e){const t=await fetch("/api/config/theme",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({preset:e})});if(!t.ok){const s=await t.json().catch(()=>({error:`HTTP ${t.status}`}));throw new Error(s.error??"Failed to save theme")}const n=Ah(await t.json());return pl=n,n}async function iP(){const e=await fetch("/api/config/theme",{method:"DELETE"});if(!e.ok)throw new Error(`HTTP ${e.status}`);const t=Ah(await e.json());return pl=t,t}const Im="syntaur-theme",bu="syntaur-preset",Q0=f.createContext(null);function Om(){try{const e=window.localStorage.getItem(Im);return e==="light"||e==="dark"?e:null}catch{return null}}function Z0(){try{const e=window.localStorage.getItem(bu);return J0(e)?e:$u}catch{return $u}}function ej(){return typeof window>"u"||!window.matchMedia?"light":window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}function tj(e){document.documentElement.classList.toggle("dark",e==="dark")}function nj(e){document.documentElement.dataset.theme=e}function aP(){typeof document>"u"||(tj(Om()??ej()),nj(Z0()))}function lP({children:e}){const[t,n]=f.useState(()=>Om()),[s,i]=f.useState(()=>Om()??ej()),[l,c]=f.useState(()=>Z0());f.useEffect(()=>{tj(s)},[s]),f.useEffect(()=>{nj(l)},[l]),f.useEffect(()=>{let h=!1;return sP().then(x=>{if(!h&&x.preset!==l){c(x.preset);try{window.localStorage.setItem(bu,x.preset)}catch{}}}),()=>{h=!0}},[]),f.useEffect(()=>{if(!window.matchMedia)return;const h=window.matchMedia("(prefers-color-scheme: dark)"),x=()=>{t||i(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(bu,h)}catch{}await oP(h)}async function p(){const h=await iP();c(h.preset);try{window.localStorage.setItem(bu,h.preset)}catch{}}const m={resolvedTheme:s,explicitTheme:t,setTheme:h=>{window.localStorage.setItem(Im,h),n(h),i(h)},toggleTheme:()=>{const h=s==="dark"?"light":"dark";window.localStorage.setItem(Im,h),n(h),i(h)},preset:l,setPreset:d,resetPreset:p};return r.jsx(Q0.Provider,{value:m,children:e})}function Dh(){const e=f.useContext(Q0);if(!e)throw new Error("useTheme must be used within ThemeProvider");return e}const wu=new Set;let Wn=null,Ii=null;function cP(){return`${window.location.protocol==="https:"?"wss:":"ws:"}//${window.location.host}/ws`}function rj(){Wn&&(Wn.readyState===WebSocket.OPEN||Wn.readyState===WebSocket.CONNECTING)||(Wn=new WebSocket(cP()),Wn.onmessage=e=>{try{const t=JSON.parse(e.data);for(const n of wu)n(t)}catch{}},Wn.onclose=()=>{Wn=null,Ii&&clearTimeout(Ii),Ii=setTimeout(rj,2e3)},Wn.onerror=()=>{Wn==null||Wn.close()})}function Ul(e){const t=f.useRef(e);t.current=e,f.useEffect(()=>{const n=s=>t.current(s);return wu.add(n),rj(),()=>{wu.delete(n),wu.size===0&&Wn&&(Ii&&clearTimeout(Ii),Ii=null,Wn.close(),Wn=null)}},[])}function tn(e,t){const[n,s]=f.useState(null),[i,l]=f.useState(!0),[c,d]=f.useState(null),[p,m]=f.useState(0),h=f.useCallback(()=>{m(x=>x+1)},[]);return f.useEffect(()=>{if(!e){l(!1),s(null);return}let x=!1;return l(!0),d(null),fetch(e).then(async y=>{if(!y.ok){const v=await y.json().catch(()=>null);throw new Error((v==null?void 0:v.error)||`HTTP ${y.status}`)}return y.json()}).then(y=>{x||(s(y),l(!1))}).catch(y=>{x||(d(y.message),l(!1))}),()=>{x=!0}},[e,p]),Ul(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"||t==="overview")&&h(),x.type==="playbooks-updated"&&t==="playbooks"&&h(),x.type==="leases-updated"&&t==="inventories"&&h())}),{data:n,loading:i,error:c,refetch:h}}function Zi(){return tn("/api/projects","projects")}function id(){return tn("/api/workspaces","projects")}function Wt(){const{workspace:e}=At();return e?`/w/${e}`:""}function uP(e={}){const t=new URLSearchParams;typeof e.staleLimit=="number"&&Number.isFinite(e.staleLimit)&&t.set("staleLimit",String(e.staleLimit)),typeof e.staleOffset=="number"&&Number.isFinite(e.staleOffset)&&t.set("staleOffset",String(e.staleOffset));const n=t.toString(),s=n?`/api/overview?${n}`:"/api/overview";return tn(s,"overview")}function $h(){return tn("/api/assignments","assignments")}function sj(){return tn("/api/help")}function oj(e){const t=e?`/api/projects/${e}`:null;return tn(t,"project")}function dP(e,t){const n=e&&t?`/api/projects/${e}/assignments/${t}`:null;return tn(n,"assignment")}function fP(e){const t=e?`/api/assignments/${e}`:null;return tn(t,"assignment")}function ij(e){return tn(e)}function Lh(){return tn("/api/servers","servers")}function aj(){return tn("/api/leases","inventories")}function lj(){return tn("/api/agent-sessions","agent-sessions")}function pP(e,t){const n=e&&t?`/api/agent-sessions/${e}?assignment=${t}`:null;return tn(n,"agent-sessions")}function mP(e){const t=e?`/api/assignments/${e}/sessions`:null;return tn(t,"agent-sessions")}function cj(){return tn("/api/playbooks","playbooks")}function hP(e){const t=e?`/api/playbooks/${e}`:null;return tn(t,"playbooks")}function gP(){return tn("/api/memories","project")}function xP(e,t){const n=e&&t?`/api/projects/${e}/memories/${t}`:null;return tn(n,"project")}function yP(){return tn("/api/resources","project")}function vP(e,t){const n=e&&t?`/api/projects/${e}/resources/${t}`:null;return tn(n,"project")}const ad=["new-workspace","new-project","new-todo","new-assignment"];function bP(e){return typeof e=="string"&&ad.includes(e)}const wP=["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","[","]"],jP=["mod","ctrl","alt","shift"];function Kn(e){if(typeof e!="string")return"";const t=e.trim();if(!t)return"";if(/\s/.test(t)&&!t.includes("+"))return t.split(/\s+/).map(Kn).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 s=n[n.length-1].toLowerCase(),i=n.slice(0,-1).map(d=>d.toLowerCase()),l=new Set,c=[];for(const d of jP)i.includes(d)&&!l.has(d)&&(c.push(d),l.add(d));for(const d of i)l.has(d)||(c.push(d),l.add(d));return[...c,s].join("+")}function kP(e){const t=Kn(e);return t?wP.includes(t):!1}const SP={"new-workspace":Kn("Mod+Shift+Alt+w"),"new-project":Kn("Mod+Shift+Alt+p"),"new-todo":Kn("Mod+Shift+Alt+t"),"new-assignment":Kn("Mod+Shift+Alt+a")};function NP(e){const t={...SP};for(const n of ad){const s=e[n];typeof s=="string"&&s.length>0&&(t[n]=s)}return t}function Do(){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 CP(e){const t=e.split("+").map(i=>i.trim()),n=t[t.length-1]??"",s=new Set(t.slice(0,-1).map(i=>i.toLowerCase()));return{key:n.toLowerCase(),mod:s.has("mod"),shift:s.has("shift"),alt:s.has("alt"),ctrl:s.has("ctrl")}}function nu(e,t){const n=CP(t);if(e.key.toLowerCase()!==n.key)return!1;const i=Do()?e.metaKey:e.ctrlKey;return!(n.mod&&!i||!n.mod&&!n.ctrl&&i||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 uj(e){const t=[],n=Do()?e.metaKey:e.ctrlKey;n&&t.push("mod"),e.ctrlKey&&!n&&t.push("ctrl"),e.altKey&&t.push("alt");const s=e.key;let i;s===" "||s==="Spacebar"?i="space":(s.length,i=s.toLowerCase());const l=i.length===1&&/^[a-z0-9]$/.test(i);e.shiftKey&&l&&t.push("shift");const c=[...t,i].join("+");return Kn(c)}function ts(e){return e.split("+").map(n=>{const s=n.toLowerCase();return s==="mod"?Do()?"⌘":"Ctrl":s==="shift"?Do()?"⇧":"Shift":s==="alt"?Do()?"⌥":"Alt":s==="ctrl"?Do()?"⌃":"Ctrl":s==="enter"?"↵":s==="escape"?"Esc":s==="arrowup"?"↑":s==="arrowdown"?"↓":n.length===1?n.toUpperCase():n}).join(Do()?"":"+")}function EP(e){const[t,n]=f.useState(null),[s,i]=f.useState(!0),[l,c]=f.useState(null),d=f.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{i(!1)}},[e]);return f.useEffect(()=>{d()},[d]),Ul(p=>{p.type==="todos-updated"&&!p.projectSlug&&d()}),{data:t,loading:s,error:l,refetch:d}}function dj(){const[e,t]=f.useState(null),[n,s]=f.useState(!0),[i,l]=f.useState(null),c=f.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{s(!1)}},[]);return f.useEffect(()=>{c()},[c]),Ul(d=>{d.type==="todos-updated"&&!d.projectSlug&&c()}),{data:e,loading:n,error:i,refetch:c}}async function Ih(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 fj(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 pj(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 mj(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 hj(e,t){await fetch(`/api/todos/${encodeURIComponent(e)}/${t}/reopen`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({})})}async function TP(e,t){await fetch(`/api/todos/${encodeURIComponent(e)}/reorder`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({ids:t})})}async function gj(e,t){await fetch(`/api/todos/${encodeURIComponent(e)}/${t}`,{method:"DELETE"})}async function Oh(e,t){const n=await fetch(e,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)});if(!n.ok){const s=await n.text().catch(()=>"");let i=null;try{i=s?JSON.parse(s):null}catch{}const l=(i==null?void 0:i.error)||s||`HTTP ${n.status}`,c=new Error(l);throw c.status=n.status,c}return n.json().catch(()=>({}))}async function PP(e,t){return await Oh(`/api/todos/${encodeURIComponent(e)}/promote`,t)}async function RP(e){return await Oh("/api/todos/promote-bulk",e)}async function AP(e,t,n){await Oh(`/api/todos/${encodeURIComponent(e)}/${t}/move`,{to:n})}const DP=new Set(["/projects","/assignments","/servers","/todos"]);function ju(e,t){return DP.has(e)?`${t}${e}`:e}const $P=[{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-playbooks",title:"Playbooks",basePath:"/playbooks",keywords:[]},{id:"page-memories",title:"Memories",basePath:"/memories",keywords:["knowledge","learnings"]},{id:"page-resources",title:"Resources",basePath:"/resources",keywords:["knowledge","reference"]},{id:"page-settings",title:"Settings",basePath:"/settings",keywords:[]},{id:"page-help",title:"Help",basePath:"/help",keywords:["shortcuts"]}];function LP(e){const t=[];for(const n of $P)t.push({type:"page",id:n.id,title:n.title,keywords:[...n.keywords],route:ju(n.basePath,e.wsPrefix)});for(const n of e.projects??[]){const s=n.workspace?`/w/${n.workspace}`:"";t.push({type:"project",id:`project-${n.slug}`,title:n.title,subtitle:n.slug,keywords:n.tags,route:`${s}/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:`${s}/projects/${n.slug}?tab=todos`})}for(const n of e.assignments??[]){const s=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(i=>!!i),route:n.projectSlug===null?`/assignments/${n.id}`:`${s}/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:`${ju("/servers",e.wsPrefix)}#server-${encodeURIComponent(n.name)}`});for(const n of e.todos??[]){const s=n.workspace&&n.workspace!=="_ungrouped"?`/w/${n.workspace}`:e.wsPrefix,i=ju("/todos",s);t.push({type:"todo",id:`todo-${n.id}`,title:n.description,subtitle:n.status,keywords:n.tags,route:`${i}?focus=${encodeURIComponent(n.id)}`})}return t}function lr(e){return e.toLowerCase().trim().replace(/[^a-z0-9\s-]/g,"").replace(/\s+/g,"-").replace(/-+/g,"-").replace(/^-|-$/g,"")}function ku(e){return/^[a-z0-9]+(-[a-z0-9]+)*$/.test(e)}async function IP(e,t,n){const s=t?"disable":"enable",i=await fetch(`/api/playbooks/${encodeURIComponent(e)}/${s}`,{method:"POST"});if(!i.ok){const l=await i.json().catch(()=>({}));throw new Error(l.error||`Failed to ${s} playbook`)}n()}async function Fp(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 s=await n.json().catch(()=>({}));throw new Error(s.error||`Failed to create todo (HTTP ${n.status})`)}}async function Bv(){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 Uv(){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 zp(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 To(e,t,n){const s=e.match(/^(---\n)([\s\S]*?)(\n---)/);if(!s)return`---
|
|
447
|
+
${t}: ${JSON.stringify(n)}
|
|
448
|
+
---
|
|
449
|
+
${e}`;const i=s[1],l=s[2],c=s[3],d=e.slice(s[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}
|
|
450
|
+
${t}: ${p}`,`${i}${h}${c}${d}`}const OP=/^[a-z0-9][a-z0-9-]*$/;function _P(e){const{playbooks:t,projectSlug:n,currentProjectTitle:s,currentProjectWorkspace:i,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:OP,message:"Use lowercase letters, digits, and hyphens (e.g. acme-app). Must start with a letter or digit."}}],submit:async(h,x)=>{const y=(h.name??"").trim();if(!y)throw new Error("Name is required");const v=await fetch("/api/workspaces",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:y})});if(!v.ok){const C=await v.json().catch(()=>({}));throw new Error(C.error||`Failed to create workspace (HTTP ${v.status})`)}x.navigate(`/w/${y}/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 Bv(),y=[{value:"_ungrouped",label:"Ungrouped",hint:"no workspace"}];for(const v of h)y.push({value:v,label:v,hint:"workspace"});return y}},{kind:"text",id:"title",label:"Project title",placeholder:"e.g. Marketing site rebuild",required:!0}],submit:async(h,x)=>{const y=(h.workspace??"").trim(),v=(h.title??"").trim();if(!v)throw new Error("Title is required");const C=lr(v);if(!C)throw new Error("Title must contain at least one alphanumeric character");let j=await zp("/api/templates/project");j=To(j,"slug",C),j=To(j,"title",v),y&&y!=="_ungrouped"&&(j=To(j,"workspace",y));const w=await fetch("/api/projects",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({content:j})}),S=await w.json().catch(()=>({}));if(!w.ok)throw new Error(S.error||`Failed to create project (HTTP ${w.status})`);const E=y&&y!=="_ungrouped"?`/w/${y}/projects/${S.slug??C}`:`/projects/${S.slug??C}`;x.navigate(E)}}}),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([Bv(),Uv()]),y=[{value:"_ungrouped",label:"Global",hint:"no workspace"}];for(const v of h)y.push({value:v,label:v,hint:"workspace"});for(const v of x){const C=v.workspace??"_ungrouped";y.push({value:C,label:`${v.title}`,hint:`project · ${v.workspace??"ungrouped"}`})}return y}},{kind:"text",id:"description",label:"Description",placeholder:"Describe the todo…",required:!0}],submit:async h=>{const x=(h.scope??"_ungrouped").trim()||"_ungrouped",y=(h.description??"").trim();if(!y)throw new Error("Description is required");await Ih(x,y)}}}),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 Uv(),x=[{value:"_standalone",label:"Standalone",hint:"one-off / not in a project"}];for(const y of h)x.push({value:y.slug,label:y.title,hint:y.workspace?`workspace · ${y.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 y=(h.project??"_standalone").trim()||"_standalone",v=(h.title??"").trim();if(!v)throw new Error("Title is required");const C=lr(v);if(!C)throw new Error("Title must contain at least one alphanumeric character");if(y==="_standalone"){let P=await zp("/api/templates/assignment?standalone=1");P=To(P,"slug",C),P=To(P,"title",v);const I=await fetch("/api/assignments",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({content:P})}),R=await I.json().catch(()=>({}));if(!I.ok)throw new Error(R.error||`Failed to create assignment (HTTP ${I.status})`);const $=((N=R==null?void 0:R.assignment)==null?void 0:N.id)??(R==null?void 0:R.id);$?x.navigate(`/assignments/${$}`):x.navigate("/assignments");return}let j=await zp("/api/templates/assignment");j=To(j,"slug",C),j=To(j,"title",v);const w=await fetch(`/api/projects/${encodeURIComponent(y)}/assignments`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({content:j})}),S=await w.json().catch(()=>({}));if(!w.ok)throw new Error(S.error||`Failed to create assignment (HTTP ${w.status})`);const E=S.slug??C;x.navigate(`/projects/${y}/assignments/${E}`)}}}),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 ${s??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 Fp("_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 y=x.trim();y&&await Fp(h,y)}}})}n&&i&&m.push({id:`create-todo-project-${n}`,title:`New Todo in project ${s??n}`,subtitle:`${n} · workspace ${i}`,group:"Create",keywords:["new","create","todo","project",n,i],requiresInput:{placeholder:`Describe the todo for project ${s??n}…`,runWithInput:async h=>{const x=h.trim();x&&await Fp(i,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:()=>IP(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 Lt(e,t,{checkForDefaultPrevented:n=!0}={}){return function(i){if(e==null||e(i),n===!1||!i.defaultPrevented)return t==null?void 0:t(i)}}function Hv(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function ld(...e){return t=>{let n=!1;const s=e.map(i=>{const l=Hv(i,t);return!n&&typeof l=="function"&&(n=!0),l});if(n)return()=>{for(let i=0;i<s.length;i++){const l=s[i];typeof l=="function"?l():Hv(e[i],null)}}}}function Tn(...e){return f.useCallback(ld(...e),e)}function MP(e,t){const n=f.createContext(t),s=l=>{const{children:c,...d}=l,p=f.useMemo(()=>d,Object.values(d));return r.jsx(n.Provider,{value:p,children:c})};s.displayName=e+"Provider";function i(l){const c=f.useContext(n);if(c)return c;if(t!==void 0)return t;throw new Error(`\`${l}\` must be used within \`${e}\``)}return[s,i]}function Bo(e,t=[]){let n=[];function s(l,c){const d=f.createContext(c),p=n.length;n=[...n,c];const m=x=>{var S;const{scope:y,children:v,...C}=x,j=((S=y==null?void 0:y[e])==null?void 0:S[p])||d,w=f.useMemo(()=>C,Object.values(C));return r.jsx(j.Provider,{value:w,children:v})};m.displayName=l+"Provider";function h(x,y){var j;const v=((j=y==null?void 0:y[e])==null?void 0:j[p])||d,C=f.useContext(v);if(C)return C;if(c!==void 0)return c;throw new Error(`\`${x}\` must be used within \`${l}\``)}return[m,h]}const i=()=>{const l=n.map(c=>f.createContext(c));return function(d){const p=(d==null?void 0:d[e])||l;return f.useMemo(()=>({[`__scope${e}`]:{...d,[e]:p}}),[d,p])}};return i.scopeName=e,[s,FP(i,...t)]}function FP(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const s=e.map(i=>({useScope:i(),scopeName:i.scopeName}));return function(l){const c=s.reduce((d,{useScope:p,scopeName:m})=>{const x=p(l)[`__scope${m}`];return{...d,...x}},{});return f.useMemo(()=>({[`__scope${t.scopeName}`]:c}),[c])}};return n.scopeName=t.scopeName,n}var Zs=globalThis!=null&&globalThis.document?f.useLayoutEffect:()=>{},zP=i0[" useId ".trim().toString()]||(()=>{}),BP=0;function Oi(e){const[t,n]=f.useState(zP());return Zs(()=>{n(s=>s??String(BP++))},[e]),e||(t?`radix-${t}`:"")}var UP=i0[" useInsertionEffect ".trim().toString()]||Zs;function cd({prop:e,defaultProp:t,onChange:n=()=>{},caller:s}){const[i,l,c]=HP({defaultProp:t,onChange:n}),d=e!==void 0,p=d?e:i;{const h=f.useRef(e!==void 0);f.useEffect(()=>{const x=h.current;x!==d&&console.warn(`${s} 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,s])}const m=f.useCallback(h=>{var x;if(d){const y=VP(h)?h(e):h;y!==e&&((x=c.current)==null||x.call(c,y))}else l(h)},[d,e,l,c]);return[p,m]}function HP({defaultProp:e,onChange:t}){const[n,s]=f.useState(e),i=f.useRef(n),l=f.useRef(t);return UP(()=>{l.current=t},[t]),f.useEffect(()=>{var c;i.current!==n&&((c=l.current)==null||c.call(l,n),i.current=n)},[n,i]),[n,s,l]}function VP(e){return typeof e=="function"}function WP(e){const t=KP(e),n=f.forwardRef((s,i)=>{const{children:l,...c}=s,d=f.Children.toArray(l),p=d.find(GP);if(p){const m=p.props.children,h=d.map(x=>x===p?f.Children.count(m)>1?f.Children.only(null):f.isValidElement(m)?m.props.children:null:x);return r.jsx(t,{...c,ref:i,children:f.isValidElement(m)?f.cloneElement(m,void 0,h):null})}return r.jsx(t,{...c,ref:i,children:l})});return n.displayName=`${e}.Slot`,n}function KP(e){const t=f.forwardRef((n,s)=>{const{children:i,...l}=n;if(f.isValidElement(i)){const c=JP(i),d=YP(l,i.props);return i.type!==f.Fragment&&(d.ref=s?ld(s,c):c),f.cloneElement(i,d)}return f.Children.count(i)>1?f.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var qP=Symbol("radix.slottable");function GP(e){return f.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===qP}function YP(e,t){const n={...t};for(const s in t){const i=e[s],l=t[s];/^on[A-Z]/.test(s)?i&&l?n[s]=(...d)=>{const p=l(...d);return i(...d),p}:i&&(n[s]=i):s==="style"?n[s]={...i,...l}:s==="className"&&(n[s]=[i,l].filter(Boolean).join(" "))}return{...e,...n}}function JP(e){var s,i;let t=(s=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:s.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(i=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:i.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var XP=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],nn=XP.reduce((e,t)=>{const n=WP(`Primitive.${t}`),s=f.forwardRef((i,l)=>{const{asChild:c,...d}=i,p=c?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),r.jsx(p,{...d,ref:l})});return s.displayName=`Primitive.${t}`,{...e,[t]:s}},{});function QP(e,t){e&&ws.flushSync(()=>e.dispatchEvent(t))}function Oo(e){const t=f.useRef(e);return f.useEffect(()=>{t.current=e}),f.useMemo(()=>(...n)=>{var s;return(s=t.current)==null?void 0:s.call(t,...n)},[])}function ZP(e,t=globalThis==null?void 0:globalThis.document){const n=Oo(e);f.useEffect(()=>{const s=i=>{i.key==="Escape"&&n(i)};return t.addEventListener("keydown",s,{capture:!0}),()=>t.removeEventListener("keydown",s,{capture:!0})},[n,t])}var eR="DismissableLayer",_m="dismissableLayer.update",tR="dismissableLayer.pointerDownOutside",nR="dismissableLayer.focusOutside",Vv,xj=f.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),_h=f.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:s,onPointerDownOutside:i,onFocusOutside:l,onInteractOutside:c,onDismiss:d,...p}=e,m=f.useContext(xj),[h,x]=f.useState(null),y=(h==null?void 0:h.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,v]=f.useState({}),C=Tn(t,$=>x($)),j=Array.from(m.layers),[w]=[...m.layersWithOutsidePointerEventsDisabled].slice(-1),S=j.indexOf(w),E=h?j.indexOf(h):-1,N=m.layersWithOutsidePointerEventsDisabled.size>0,P=E>=S,I=oR($=>{const D=$.target,X=[...m.branches].some(Z=>Z.contains(D));!P||X||(i==null||i($),c==null||c($),$.defaultPrevented||d==null||d())},y),R=iR($=>{const D=$.target;[...m.branches].some(Z=>Z.contains(D))||(l==null||l($),c==null||c($),$.defaultPrevented||d==null||d())},y);return ZP($=>{E===m.layers.size-1&&(s==null||s($),!$.defaultPrevented&&d&&($.preventDefault(),d()))},y),f.useEffect(()=>{if(h)return n&&(m.layersWithOutsidePointerEventsDisabled.size===0&&(Vv=y.body.style.pointerEvents,y.body.style.pointerEvents="none"),m.layersWithOutsidePointerEventsDisabled.add(h)),m.layers.add(h),Wv(),()=>{n&&m.layersWithOutsidePointerEventsDisabled.size===1&&(y.body.style.pointerEvents=Vv)}},[h,y,n,m]),f.useEffect(()=>()=>{h&&(m.layers.delete(h),m.layersWithOutsidePointerEventsDisabled.delete(h),Wv())},[h,m]),f.useEffect(()=>{const $=()=>v({});return document.addEventListener(_m,$),()=>document.removeEventListener(_m,$)},[]),r.jsx(nn.div,{...p,ref:C,style:{pointerEvents:N?P?"auto":"none":void 0,...e.style},onFocusCapture:Lt(e.onFocusCapture,R.onFocusCapture),onBlurCapture:Lt(e.onBlurCapture,R.onBlurCapture),onPointerDownCapture:Lt(e.onPointerDownCapture,I.onPointerDownCapture)})});_h.displayName=eR;var rR="DismissableLayerBranch",sR=f.forwardRef((e,t)=>{const n=f.useContext(xj),s=f.useRef(null),i=Tn(t,s);return f.useEffect(()=>{const l=s.current;if(l)return n.branches.add(l),()=>{n.branches.delete(l)}},[n.branches]),r.jsx(nn.div,{...e,ref:i})});sR.displayName=rR;function oR(e,t=globalThis==null?void 0:globalThis.document){const n=Oo(e),s=f.useRef(!1),i=f.useRef(()=>{});return f.useEffect(()=>{const l=d=>{if(d.target&&!s.current){let p=function(){yj(tR,n,m,{discrete:!0})};const m={originalEvent:d};d.pointerType==="touch"?(t.removeEventListener("click",i.current),i.current=p,t.addEventListener("click",i.current,{once:!0})):p()}else t.removeEventListener("click",i.current);s.current=!1},c=window.setTimeout(()=>{t.addEventListener("pointerdown",l)},0);return()=>{window.clearTimeout(c),t.removeEventListener("pointerdown",l),t.removeEventListener("click",i.current)}},[t,n]),{onPointerDownCapture:()=>s.current=!0}}function iR(e,t=globalThis==null?void 0:globalThis.document){const n=Oo(e),s=f.useRef(!1);return f.useEffect(()=>{const i=l=>{l.target&&!s.current&&yj(nR,n,{originalEvent:l},{discrete:!1})};return t.addEventListener("focusin",i),()=>t.removeEventListener("focusin",i)},[t,n]),{onFocusCapture:()=>s.current=!0,onBlurCapture:()=>s.current=!1}}function Wv(){const e=new CustomEvent(_m);document.dispatchEvent(e)}function yj(e,t,n,{discrete:s}){const i=n.originalEvent.target,l=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&i.addEventListener(e,t,{once:!0}),s?QP(i,l):i.dispatchEvent(l)}var Bp="focusScope.autoFocusOnMount",Up="focusScope.autoFocusOnUnmount",Kv={bubbles:!1,cancelable:!0},aR="FocusScope",vj=f.forwardRef((e,t)=>{const{loop:n=!1,trapped:s=!1,onMountAutoFocus:i,onUnmountAutoFocus:l,...c}=e,[d,p]=f.useState(null),m=Oo(i),h=Oo(l),x=f.useRef(null),y=Tn(t,j=>p(j)),v=f.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;f.useEffect(()=>{if(s){let j=function(N){if(v.paused||!d)return;const P=N.target;d.contains(P)?x.current=P:Js(x.current,{select:!0})},w=function(N){if(v.paused||!d)return;const P=N.relatedTarget;P!==null&&(d.contains(P)||Js(x.current,{select:!0}))},S=function(N){if(document.activeElement===document.body)for(const I of N)I.removedNodes.length>0&&Js(d)};document.addEventListener("focusin",j),document.addEventListener("focusout",w);const E=new MutationObserver(S);return d&&E.observe(d,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",j),document.removeEventListener("focusout",w),E.disconnect()}}},[s,d,v.paused]),f.useEffect(()=>{if(d){Gv.add(v);const j=document.activeElement;if(!d.contains(j)){const S=new CustomEvent(Bp,Kv);d.addEventListener(Bp,m),d.dispatchEvent(S),S.defaultPrevented||(lR(pR(bj(d)),{select:!0}),document.activeElement===j&&Js(d))}return()=>{d.removeEventListener(Bp,m),setTimeout(()=>{const S=new CustomEvent(Up,Kv);d.addEventListener(Up,h),d.dispatchEvent(S),S.defaultPrevented||Js(j??document.body,{select:!0}),d.removeEventListener(Up,h),Gv.remove(v)},0)}}},[d,m,h,v]);const C=f.useCallback(j=>{if(!n&&!s||v.paused)return;const w=j.key==="Tab"&&!j.altKey&&!j.ctrlKey&&!j.metaKey,S=document.activeElement;if(w&&S){const E=j.currentTarget,[N,P]=cR(E);N&&P?!j.shiftKey&&S===P?(j.preventDefault(),n&&Js(N,{select:!0})):j.shiftKey&&S===N&&(j.preventDefault(),n&&Js(P,{select:!0})):S===E&&j.preventDefault()}},[n,s,v.paused]);return r.jsx(nn.div,{tabIndex:-1,...c,ref:y,onKeyDown:C})});vj.displayName=aR;function lR(e,{select:t=!1}={}){const n=document.activeElement;for(const s of e)if(Js(s,{select:t}),document.activeElement!==n)return}function cR(e){const t=bj(e),n=qv(t,e),s=qv(t.reverse(),e);return[n,s]}function bj(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:s=>{const i=s.tagName==="INPUT"&&s.type==="hidden";return s.disabled||s.hidden||i?NodeFilter.FILTER_SKIP:s.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function qv(e,t){for(const n of e)if(!uR(n,{upTo:t}))return n}function uR(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 dR(e){return e instanceof HTMLInputElement&&"select"in e}function Js(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&dR(e)&&t&&e.select()}}var Gv=fR();function fR(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=Yv(e,t),e.unshift(t)},remove(t){var n;e=Yv(e,t),(n=e[0])==null||n.resume()}}}function Yv(e,t){const n=[...e],s=n.indexOf(t);return s!==-1&&n.splice(s,1),n}function pR(e){return e.filter(t=>t.tagName!=="A")}var mR="Portal",Mh=f.forwardRef((e,t)=>{var d;const{container:n,...s}=e,[i,l]=f.useState(!1);Zs(()=>l(!0),[]);const c=n||i&&((d=globalThis==null?void 0:globalThis.document)==null?void 0:d.body);return c?z2.createPortal(r.jsx(nn.div,{...s,ref:t}),c):null});Mh.displayName=mR;function hR(e,t){return f.useReducer((n,s)=>t[n][s]??n,e)}var Uo=e=>{const{present:t,children:n}=e,s=gR(t),i=typeof n=="function"?n({present:s.isPresent}):f.Children.only(n),l=Tn(s.ref,xR(i));return typeof n=="function"||s.isPresent?f.cloneElement(i,{ref:l}):null};Uo.displayName="Presence";function gR(e){const[t,n]=f.useState(),s=f.useRef(null),i=f.useRef(e),l=f.useRef("none"),c=e?"mounted":"unmounted",[d,p]=hR(c,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return f.useEffect(()=>{const m=ru(s.current);l.current=d==="mounted"?m:"none"},[d]),Zs(()=>{const m=s.current,h=i.current;if(h!==e){const y=l.current,v=ru(m);e?p("MOUNT"):v==="none"||(m==null?void 0:m.display)==="none"?p("UNMOUNT"):p(h&&y!==v?"ANIMATION_OUT":"UNMOUNT"),i.current=e}},[e,p]),Zs(()=>{if(t){let m;const h=t.ownerDocument.defaultView??window,x=v=>{const j=ru(s.current).includes(CSS.escape(v.animationName));if(v.target===t&&j&&(p("ANIMATION_END"),!i.current)){const w=t.style.animationFillMode;t.style.animationFillMode="forwards",m=h.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=w)})}},y=v=>{v.target===t&&(l.current=ru(s.current))};return t.addEventListener("animationstart",y),t.addEventListener("animationcancel",x),t.addEventListener("animationend",x),()=>{h.clearTimeout(m),t.removeEventListener("animationstart",y),t.removeEventListener("animationcancel",x),t.removeEventListener("animationend",x)}}else p("ANIMATION_END")},[t,p]),{isPresent:["mounted","unmountSuspended"].includes(d),ref:f.useCallback(m=>{s.current=m?getComputedStyle(m):null,n(m)},[])}}function ru(e){return(e==null?void 0:e.animationName)||"none"}function xR(e){var s,i;let t=(s=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:s.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(i=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:i.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var Hp=0;function yR(){f.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??Jv()),document.body.insertAdjacentElement("beforeend",e[1]??Jv()),Hp++,()=>{Hp===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),Hp--}},[])}function Jv(){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 Xr=function(){return Xr=Object.assign||function(t){for(var n,s=1,i=arguments.length;s<i;s++){n=arguments[s];for(var l in n)Object.prototype.hasOwnProperty.call(n,l)&&(t[l]=n[l])}return t},Xr.apply(this,arguments)};function wj(e,t){var n={};for(var s in e)Object.prototype.hasOwnProperty.call(e,s)&&t.indexOf(s)<0&&(n[s]=e[s]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,s=Object.getOwnPropertySymbols(e);i<s.length;i++)t.indexOf(s[i])<0&&Object.prototype.propertyIsEnumerable.call(e,s[i])&&(n[s[i]]=e[s[i]]);return n}function vR(e,t,n){if(n||arguments.length===2)for(var s=0,i=t.length,l;s<i;s++)(l||!(s in t))&&(l||(l=Array.prototype.slice.call(t,0,s)),l[s]=t[s]);return e.concat(l||Array.prototype.slice.call(t))}var Su="right-scroll-bar-position",Nu="width-before-scroll-bar",bR="with-scroll-bars-hidden",wR="--removed-body-scroll-bar-size";function Vp(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function jR(e,t){var n=f.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(s){var i=n.value;i!==s&&(n.value=s,n.callback(s,i))}}}})[0];return n.callback=t,n.facade}var kR=typeof window<"u"?f.useLayoutEffect:f.useEffect,Xv=new WeakMap;function SR(e,t){var n=jR(null,function(s){return e.forEach(function(i){return Vp(i,s)})});return kR(function(){var s=Xv.get(n);if(s){var i=new Set(s),l=new Set(e),c=n.current;i.forEach(function(d){l.has(d)||Vp(d,null)}),l.forEach(function(d){i.has(d)||Vp(d,c)})}Xv.set(n,e)},[e]),n}function NR(e){return e}function CR(e,t){t===void 0&&(t=NR);var n=[],s=!1,i={read:function(){if(s)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,s);return n.push(c),function(){n=n.filter(function(d){return d!==c})}},assignSyncMedium:function(l){for(s=!0;n.length;){var c=n;n=[],c.forEach(l)}n={push:function(d){return l(d)},filter:function(){return n}}},assignMedium:function(l){s=!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 i}function ER(e){e===void 0&&(e={});var t=CR(null);return t.options=Xr({async:!0,ssr:!1},e),t}var jj=function(e){var t=e.sideCar,n=wj(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var s=t.read();if(!s)throw new Error("Sidecar medium not found");return f.createElement(s,Xr({},n))};jj.isSideCarExport=!0;function TR(e,t){return e.useMedium(t),jj}var kj=ER(),Wp=function(){},ud=f.forwardRef(function(e,t){var n=f.useRef(null),s=f.useState({onScrollCapture:Wp,onWheelCapture:Wp,onTouchMoveCapture:Wp}),i=s[0],l=s[1],c=e.forwardProps,d=e.children,p=e.className,m=e.removeScrollBar,h=e.enabled,x=e.shards,y=e.sideCar,v=e.noRelative,C=e.noIsolation,j=e.inert,w=e.allowPinchZoom,S=e.as,E=S===void 0?"div":S,N=e.gapMode,P=wj(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),I=y,R=SR([n,t]),$=Xr(Xr({},P),i);return f.createElement(f.Fragment,null,h&&f.createElement(I,{sideCar:kj,removeScrollBar:m,shards:x,noRelative:v,noIsolation:C,inert:j,setCallbacks:l,allowPinchZoom:!!w,lockRef:n,gapMode:N}),c?f.cloneElement(f.Children.only(d),Xr(Xr({},$),{ref:R})):f.createElement(E,Xr({},$,{className:p,ref:R}),d))});ud.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};ud.classNames={fullWidth:Nu,zeroRight:Su};var PR=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function RR(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=PR();return t&&e.setAttribute("nonce",t),e}function AR(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function DR(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var $R=function(){var e=0,t=null;return{add:function(n){e==0&&(t=RR())&&(AR(t,n),DR(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},LR=function(){var e=$R();return function(t,n){f.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},Sj=function(){var e=LR(),t=function(n){var s=n.styles,i=n.dynamic;return e(s,i),null};return t},IR={left:0,top:0,right:0,gap:0},Kp=function(e){return parseInt(e||"",10)||0},OR=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],s=t[e==="padding"?"paddingTop":"marginTop"],i=t[e==="padding"?"paddingRight":"marginRight"];return[Kp(n),Kp(s),Kp(i)]},_R=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return IR;var t=OR(e),n=document.documentElement.clientWidth,s=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,s-n+t[2]-t[0])}},MR=Sj(),_i="data-scroll-locked",FR=function(e,t,n,s){var i=e.left,l=e.top,c=e.right,d=e.gap;return n===void 0&&(n="margin"),`
|
|
451
|
+
.`.concat(bR,` {
|
|
452
|
+
overflow: hidden `).concat(s,`;
|
|
453
|
+
padding-right: `).concat(d,"px ").concat(s,`;
|
|
454
|
+
}
|
|
455
|
+
body[`).concat(_i,`] {
|
|
456
|
+
overflow: hidden `).concat(s,`;
|
|
457
|
+
overscroll-behavior: contain;
|
|
458
|
+
`).concat([t&&"position: relative ".concat(s,";"),n==="margin"&&`
|
|
459
|
+
padding-left: `.concat(i,`px;
|
|
460
|
+
padding-top: `).concat(l,`px;
|
|
461
|
+
padding-right: `).concat(c,`px;
|
|
462
|
+
margin-left:0;
|
|
463
|
+
margin-top:0;
|
|
464
|
+
margin-right: `).concat(d,"px ").concat(s,`;
|
|
465
|
+
`),n==="padding"&&"padding-right: ".concat(d,"px ").concat(s,";")].filter(Boolean).join(""),`
|
|
466
|
+
}
|
|
467
|
+
|
|
468
|
+
.`).concat(Su,` {
|
|
469
|
+
right: `).concat(d,"px ").concat(s,`;
|
|
470
|
+
}
|
|
471
|
+
|
|
472
|
+
.`).concat(Nu,` {
|
|
473
|
+
margin-right: `).concat(d,"px ").concat(s,`;
|
|
474
|
+
}
|
|
475
|
+
|
|
476
|
+
.`).concat(Su," .").concat(Su,` {
|
|
477
|
+
right: 0 `).concat(s,`;
|
|
478
|
+
}
|
|
479
|
+
|
|
480
|
+
.`).concat(Nu," .").concat(Nu,` {
|
|
481
|
+
margin-right: 0 `).concat(s,`;
|
|
482
|
+
}
|
|
483
|
+
|
|
484
|
+
body[`).concat(_i,`] {
|
|
485
|
+
`).concat(wR,": ").concat(d,`px;
|
|
486
|
+
}
|
|
487
|
+
`)},Qv=function(){var e=parseInt(document.body.getAttribute(_i)||"0",10);return isFinite(e)?e:0},zR=function(){f.useEffect(function(){return document.body.setAttribute(_i,(Qv()+1).toString()),function(){var e=Qv()-1;e<=0?document.body.removeAttribute(_i):document.body.setAttribute(_i,e.toString())}},[])},BR=function(e){var t=e.noRelative,n=e.noImportant,s=e.gapMode,i=s===void 0?"margin":s;zR();var l=f.useMemo(function(){return _R(i)},[i]);return f.createElement(MR,{styles:FR(l,!t,i,n?"":"!important")})},Mm=!1;if(typeof window<"u")try{var su=Object.defineProperty({},"passive",{get:function(){return Mm=!0,!0}});window.addEventListener("test",su,su),window.removeEventListener("test",su,su)}catch{Mm=!1}var yi=Mm?{passive:!1}:!1,UR=function(e){return e.tagName==="TEXTAREA"},Nj=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!UR(e)&&n[t]==="visible")},HR=function(e){return Nj(e,"overflowY")},VR=function(e){return Nj(e,"overflowX")},Zv=function(e,t){var n=t.ownerDocument,s=t;do{typeof ShadowRoot<"u"&&s instanceof ShadowRoot&&(s=s.host);var i=Cj(e,s);if(i){var l=Ej(e,s),c=l[1],d=l[2];if(c>d)return!0}s=s.parentNode}while(s&&s!==n.body);return!1},WR=function(e){var t=e.scrollTop,n=e.scrollHeight,s=e.clientHeight;return[t,n,s]},KR=function(e){var t=e.scrollLeft,n=e.scrollWidth,s=e.clientWidth;return[t,n,s]},Cj=function(e,t){return e==="v"?HR(t):VR(t)},Ej=function(e,t){return e==="v"?WR(t):KR(t)},qR=function(e,t){return e==="h"&&t==="rtl"?-1:1},GR=function(e,t,n,s,i){var l=qR(e,window.getComputedStyle(t).direction),c=l*s,d=n.target,p=t.contains(d),m=!1,h=c>0,x=0,y=0;do{if(!d)break;var v=Ej(e,d),C=v[0],j=v[1],w=v[2],S=j-w-l*C;(C||S)&&Cj(e,d)&&(x+=S,y+=C);var E=d.parentNode;d=E&&E.nodeType===Node.DOCUMENT_FRAGMENT_NODE?E.host:E}while(!p&&d!==document.body||p&&(t.contains(d)||t===d));return(h&&Math.abs(x)<1||!h&&Math.abs(y)<1)&&(m=!0),m},ou=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},eb=function(e){return[e.deltaX,e.deltaY]},tb=function(e){return e&&"current"in e?e.current:e},YR=function(e,t){return e[0]===t[0]&&e[1]===t[1]},JR=function(e){return`
|
|
488
|
+
.block-interactivity-`.concat(e,` {pointer-events: none;}
|
|
489
|
+
.allow-interactivity-`).concat(e,` {pointer-events: all;}
|
|
490
|
+
`)},XR=0,vi=[];function QR(e){var t=f.useRef([]),n=f.useRef([0,0]),s=f.useRef(),i=f.useState(XR++)[0],l=f.useState(Sj)[0],c=f.useRef(e);f.useEffect(function(){c.current=e},[e]),f.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(i));var j=vR([e.lockRef.current],(e.shards||[]).map(tb),!0).filter(Boolean);return j.forEach(function(w){return w.classList.add("allow-interactivity-".concat(i))}),function(){document.body.classList.remove("block-interactivity-".concat(i)),j.forEach(function(w){return w.classList.remove("allow-interactivity-".concat(i))})}}},[e.inert,e.lockRef.current,e.shards]);var d=f.useCallback(function(j,w){if("touches"in j&&j.touches.length===2||j.type==="wheel"&&j.ctrlKey)return!c.current.allowPinchZoom;var S=ou(j),E=n.current,N="deltaX"in j?j.deltaX:E[0]-S[0],P="deltaY"in j?j.deltaY:E[1]-S[1],I,R=j.target,$=Math.abs(N)>Math.abs(P)?"h":"v";if("touches"in j&&$==="h"&&R.type==="range")return!1;var D=window.getSelection(),X=D&&D.anchorNode,Z=X?X===R||X.contains(R):!1;if(Z)return!1;var F=Zv($,R);if(!F)return!0;if(F?I=$:(I=$==="v"?"h":"v",F=Zv($,R)),!F)return!1;if(!s.current&&"changedTouches"in j&&(N||P)&&(s.current=I),!I)return!0;var H=s.current||I;return GR(H,w,j,H==="h"?N:P)},[]),p=f.useCallback(function(j){var w=j;if(!(!vi.length||vi[vi.length-1]!==l)){var S="deltaY"in w?eb(w):ou(w),E=t.current.filter(function(I){return I.name===w.type&&(I.target===w.target||w.target===I.shadowParent)&&YR(I.delta,S)})[0];if(E&&E.should){w.cancelable&&w.preventDefault();return}if(!E){var N=(c.current.shards||[]).map(tb).filter(Boolean).filter(function(I){return I.contains(w.target)}),P=N.length>0?d(w,N[0]):!c.current.noIsolation;P&&w.cancelable&&w.preventDefault()}}},[]),m=f.useCallback(function(j,w,S,E){var N={name:j,delta:w,target:S,should:E,shadowParent:ZR(S)};t.current.push(N),setTimeout(function(){t.current=t.current.filter(function(P){return P!==N})},1)},[]),h=f.useCallback(function(j){n.current=ou(j),s.current=void 0},[]),x=f.useCallback(function(j){m(j.type,eb(j),j.target,d(j,e.lockRef.current))},[]),y=f.useCallback(function(j){m(j.type,ou(j),j.target,d(j,e.lockRef.current))},[]);f.useEffect(function(){return vi.push(l),e.setCallbacks({onScrollCapture:x,onWheelCapture:x,onTouchMoveCapture:y}),document.addEventListener("wheel",p,yi),document.addEventListener("touchmove",p,yi),document.addEventListener("touchstart",h,yi),function(){vi=vi.filter(function(j){return j!==l}),document.removeEventListener("wheel",p,yi),document.removeEventListener("touchmove",p,yi),document.removeEventListener("touchstart",h,yi)}},[]);var v=e.removeScrollBar,C=e.inert;return f.createElement(f.Fragment,null,C?f.createElement(l,{styles:JR(i)}):null,v?f.createElement(BR,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function ZR(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const e3=TR(kj,QR);var Tj=f.forwardRef(function(e,t){return f.createElement(ud,Xr({},e,{ref:t,sideCar:e3}))});Tj.classNames=ud.classNames;var t3=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},bi=new WeakMap,iu=new WeakMap,au={},qp=0,Pj=function(e){return e&&(e.host||Pj(e.parentNode))},n3=function(e,t){return t.map(function(n){if(e.contains(n))return n;var s=Pj(n);return s&&e.contains(s)?s:(console.error("aria-hidden",n,"in not contained inside",e,". Doing nothing"),null)}).filter(function(n){return!!n})},r3=function(e,t,n,s){var i=n3(t,Array.isArray(e)?e:[e]);au[n]||(au[n]=new WeakMap);var l=au[n],c=[],d=new Set,p=new Set(i),m=function(x){!x||d.has(x)||(d.add(x),m(x.parentNode))};i.forEach(m);var h=function(x){!x||p.has(x)||Array.prototype.forEach.call(x.children,function(y){if(d.has(y))h(y);else try{var v=y.getAttribute(s),C=v!==null&&v!=="false",j=(bi.get(y)||0)+1,w=(l.get(y)||0)+1;bi.set(y,j),l.set(y,w),c.push(y),j===1&&C&&iu.set(y,!0),w===1&&y.setAttribute(n,"true"),C||y.setAttribute(s,"true")}catch(S){console.error("aria-hidden: cannot operate on ",y,S)}})};return h(t),d.clear(),qp++,function(){c.forEach(function(x){var y=bi.get(x)-1,v=l.get(x)-1;bi.set(x,y),l.set(x,v),y||(iu.has(x)||x.removeAttribute(s),iu.delete(x)),v||x.removeAttribute(n)}),qp--,qp||(bi=new WeakMap,bi=new WeakMap,iu=new WeakMap,au={})}},s3=function(e,t,n){n===void 0&&(n="data-aria-hidden");var s=Array.from(Array.isArray(e)?e:[e]),i=t3(e);return i?(s.push.apply(s,Array.from(i.querySelectorAll("[aria-live], script"))),r3(s,i,n,"aria-hidden")):function(){return null}};function o3(e){const t=i3(e),n=f.forwardRef((s,i)=>{const{children:l,...c}=s,d=f.Children.toArray(l),p=d.find(l3);if(p){const m=p.props.children,h=d.map(x=>x===p?f.Children.count(m)>1?f.Children.only(null):f.isValidElement(m)?m.props.children:null:x);return r.jsx(t,{...c,ref:i,children:f.isValidElement(m)?f.cloneElement(m,void 0,h):null})}return r.jsx(t,{...c,ref:i,children:l})});return n.displayName=`${e}.Slot`,n}function i3(e){const t=f.forwardRef((n,s)=>{const{children:i,...l}=n;if(f.isValidElement(i)){const c=u3(i),d=c3(l,i.props);return i.type!==f.Fragment&&(d.ref=s?ld(s,c):c),f.cloneElement(i,d)}return f.Children.count(i)>1?f.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var a3=Symbol("radix.slottable");function l3(e){return f.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===a3}function c3(e,t){const n={...t};for(const s in t){const i=e[s],l=t[s];/^on[A-Z]/.test(s)?i&&l?n[s]=(...d)=>{const p=l(...d);return i(...d),p}:i&&(n[s]=i):s==="style"?n[s]={...i,...l}:s==="className"&&(n[s]=[i,l].filter(Boolean).join(" "))}return{...e,...n}}function u3(e){var s,i;let t=(s=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:s.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(i=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:i.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var dd="Dialog",[Rj,Aj]=Bo(dd),[d3,Hr]=Rj(dd),Dj=e=>{const{__scopeDialog:t,children:n,open:s,defaultOpen:i,onOpenChange:l,modal:c=!0}=e,d=f.useRef(null),p=f.useRef(null),[m,h]=cd({prop:s,defaultProp:i??!1,onChange:l,caller:dd});return r.jsx(d3,{scope:t,triggerRef:d,contentRef:p,contentId:Oi(),titleId:Oi(),descriptionId:Oi(),open:m,onOpenChange:h,onOpenToggle:f.useCallback(()=>h(x=>!x),[h]),modal:c,children:n})};Dj.displayName=dd;var $j="DialogTrigger",Lj=f.forwardRef((e,t)=>{const{__scopeDialog:n,...s}=e,i=Hr($j,n),l=Tn(t,i.triggerRef);return r.jsx(nn.button,{type:"button","aria-haspopup":"dialog","aria-expanded":i.open,"aria-controls":i.contentId,"data-state":Bh(i.open),...s,ref:l,onClick:Lt(e.onClick,i.onOpenToggle)})});Lj.displayName=$j;var Fh="DialogPortal",[f3,Ij]=Rj(Fh,{forceMount:void 0}),Oj=e=>{const{__scopeDialog:t,forceMount:n,children:s,container:i}=e,l=Hr(Fh,t);return r.jsx(f3,{scope:t,forceMount:n,children:f.Children.map(s,c=>r.jsx(Uo,{present:n||l.open,children:r.jsx(Mh,{asChild:!0,container:i,children:c})}))})};Oj.displayName=Fh;var Lu="DialogOverlay",_j=f.forwardRef((e,t)=>{const n=Ij(Lu,e.__scopeDialog),{forceMount:s=n.forceMount,...i}=e,l=Hr(Lu,e.__scopeDialog);return l.modal?r.jsx(Uo,{present:s||l.open,children:r.jsx(m3,{...i,ref:t})}):null});_j.displayName=Lu;var p3=o3("DialogOverlay.RemoveScroll"),m3=f.forwardRef((e,t)=>{const{__scopeDialog:n,...s}=e,i=Hr(Lu,n);return r.jsx(Tj,{as:p3,allowPinchZoom:!0,shards:[i.contentRef],children:r.jsx(nn.div,{"data-state":Bh(i.open),...s,ref:t,style:{pointerEvents:"auto",...s.style}})})}),_o="DialogContent",Mj=f.forwardRef((e,t)=>{const n=Ij(_o,e.__scopeDialog),{forceMount:s=n.forceMount,...i}=e,l=Hr(_o,e.__scopeDialog);return r.jsx(Uo,{present:s||l.open,children:l.modal?r.jsx(h3,{...i,ref:t}):r.jsx(g3,{...i,ref:t})})});Mj.displayName=_o;var h3=f.forwardRef((e,t)=>{const n=Hr(_o,e.__scopeDialog),s=f.useRef(null),i=Tn(t,n.contentRef,s);return f.useEffect(()=>{const l=s.current;if(l)return s3(l)},[]),r.jsx(Fj,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Lt(e.onCloseAutoFocus,l=>{var c;l.preventDefault(),(c=n.triggerRef.current)==null||c.focus()}),onPointerDownOutside:Lt(e.onPointerDownOutside,l=>{const c=l.detail.originalEvent,d=c.button===0&&c.ctrlKey===!0;(c.button===2||d)&&l.preventDefault()}),onFocusOutside:Lt(e.onFocusOutside,l=>l.preventDefault())})}),g3=f.forwardRef((e,t)=>{const n=Hr(_o,e.__scopeDialog),s=f.useRef(!1),i=f.useRef(!1);return r.jsx(Fj,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:l=>{var c,d;(c=e.onCloseAutoFocus)==null||c.call(e,l),l.defaultPrevented||(s.current||(d=n.triggerRef.current)==null||d.focus(),l.preventDefault()),s.current=!1,i.current=!1},onInteractOutside:l=>{var p,m;(p=e.onInteractOutside)==null||p.call(e,l),l.defaultPrevented||(s.current=!0,l.detail.originalEvent.type==="pointerdown"&&(i.current=!0));const c=l.target;((m=n.triggerRef.current)==null?void 0:m.contains(c))&&l.preventDefault(),l.detail.originalEvent.type==="focusin"&&i.current&&l.preventDefault()}})}),Fj=f.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:s,onOpenAutoFocus:i,onCloseAutoFocus:l,...c}=e,d=Hr(_o,n),p=f.useRef(null),m=Tn(t,p);return yR(),r.jsxs(r.Fragment,{children:[r.jsx(vj,{asChild:!0,loop:!0,trapped:s,onMountAutoFocus:i,onUnmountAutoFocus:l,children:r.jsx(_h,{role:"dialog",id:d.contentId,"aria-describedby":d.descriptionId,"aria-labelledby":d.titleId,"data-state":Bh(d.open),...c,ref:m,onDismiss:()=>d.onOpenChange(!1)})}),r.jsxs(r.Fragment,{children:[r.jsx(y3,{titleId:d.titleId}),r.jsx(b3,{contentRef:p,descriptionId:d.descriptionId})]})]})}),zh="DialogTitle",zj=f.forwardRef((e,t)=>{const{__scopeDialog:n,...s}=e,i=Hr(zh,n);return r.jsx(nn.h2,{id:i.titleId,...s,ref:t})});zj.displayName=zh;var Bj="DialogDescription",Uj=f.forwardRef((e,t)=>{const{__scopeDialog:n,...s}=e,i=Hr(Bj,n);return r.jsx(nn.p,{id:i.descriptionId,...s,ref:t})});Uj.displayName=Bj;var Hj="DialogClose",Vj=f.forwardRef((e,t)=>{const{__scopeDialog:n,...s}=e,i=Hr(Hj,n);return r.jsx(nn.button,{type:"button",...s,ref:t,onClick:Lt(e.onClick,()=>i.onOpenChange(!1))})});Vj.displayName=Hj;function Bh(e){return e?"open":"closed"}var Wj="DialogTitleWarning",[x3,Kj]=MP(Wj,{contentName:_o,titleName:zh,docsSlug:"dialog"}),y3=({titleId:e})=>{const t=Kj(Wj),n=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
|
|
491
|
+
|
|
492
|
+
If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.
|
|
493
|
+
|
|
494
|
+
For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return f.useEffect(()=>{e&&(document.getElementById(e)||console.error(n))},[n,e]),null},v3="DialogDescriptionWarning",b3=({contentRef:e,descriptionId:t})=>{const s=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${Kj(v3).contentName}}.`;return f.useEffect(()=>{var l;const i=(l=e.current)==null?void 0:l.getAttribute("aria-describedby");t&&i&&(document.getElementById(t)||console.warn(s))},[s,e,t]),null},qj=Dj,Gj=Lj,Yj=Oj,Uh=_j,Hh=Mj,Vh=zj,Wh=Uj,Kh=Vj;const mr=qj,w3=Gj,j3=Yj,k3=Kh,Jj=f.forwardRef(({className:e,...t},n)=>r.jsx(Uh,{ref:n,className:Te("fixed inset-0 z-50 bg-background/80 backdrop-blur-sm",e),...t}));Jj.displayName=Uh.displayName;const Gn=f.forwardRef(({className:e,children:t,...n},s)=>r.jsxs(j3,{children:[r.jsx(Jj,{}),r.jsx(Hh,{ref:s,className:Te("chrome-card 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 !p-6 outline-none",e),...n,children:t})]}));Gn.displayName=Hh.displayName;function as({className:e,...t}){return r.jsx("div",{className:Te("flex flex-col space-y-2 text-left",e),...t})}function oo({className:e,...t}){return r.jsx("div",{className:Te("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",e),...t})}const Yn=f.forwardRef(({className:e,...t},n)=>r.jsx(Vh,{ref:n,className:Te("text-lg font-semibold tracking-tight text-foreground",e),...t}));Yn.displayName=Vh.displayName;const ls=f.forwardRef(({className:e,...t},n)=>r.jsx(Wh,{ref:n,className:Te("text-sm leading-6 text-muted-foreground",e),...t}));ls.displayName=Wh.displayName;const S3=-1,N3=-40;function Gp(e,t){if(e.length===0)return 0;if(t.length===0)return-1/0;let n=0,s=0,i=-2,l=0;for(let c=0;c<e.length;c++){const d=e[c];let p=!1;for(;s<t.length;)if(t[s]===d){if(n+=100,s===i+1&&(n+=20),s===0)n+=30;else{const m=t[s-1];(m===" "||m==="-"||m==="_"||m==="/")&&(n+=15)}l>0&&(n+=Math.max(N3,l*S3)),i=s,l=0,s++,p=!0;break}else l++,s++;if(!p)return-1/0}return n}const nb={page:0,project:1,assignment:2,playbook:3,server:4,todo:5};function qh(e,t,n=50){const s=e.toLowerCase();if(!s)return t.slice(0,n).map(c=>({...c,score:0}));const l=t.map(c=>{var x;const d=Gp(s,c.title.toLowerCase())*1,p=c.subtitle?Gp(s,c.subtitle.toLowerCase())*.5:-1/0,m=(x=c.keywords)!=null&&x.length?Gp(s,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:(nb[c.type]??99)-(nb[d.type]??99)),l.slice(0,n)}const C3={page:"Page",project:"Project",assignment:"Assignment",playbook:"Playbook",server:"Server",todo:"Todo"};function E3({entries:e}){const{paletteOpen:t,closePalette:n}=io(),s=Rt(),[i,l]=f.useState(""),[c,d]=f.useState(0),p=f.useRef(null),m=f.useMemo(()=>qh(i,e,50),[i,e]);f.useEffect(()=>{d(0)},[i,t]),f.useEffect(()=>{t||l("")},[t]),f.useEffect(()=>{var v;const y=(v=p.current)==null?void 0:v.querySelector(`[data-palette-idx="${c}"]`);y==null||y.scrollIntoView({block:"nearest"})},[c]);function h(y){s(y.route),n()}function x(y){if(y.key==="ArrowDown")y.preventDefault(),d(v=>Math.min(m.length-1,v+1));else if(y.key==="ArrowUp")y.preventDefault(),d(v=>Math.max(0,v-1));else if(y.key==="Enter"){y.preventDefault();const v=m[c];v&&h(v)}}return r.jsx(mr,{open:t,onOpenChange:y=>y?null:n(),children:r.jsxs(Gn,{className:"max-w-xl p-0 gap-0",children:[r.jsx(Yn,{className:"sr-only",children:"Command palette"}),r.jsx("input",{autoFocus:!0,type:"text",value:i,onChange:y=>l(y.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"}),r.jsx("div",{ref:p,className:"max-h-[60vh] overflow-y-auto p-1",children:m.length===0?r.jsx("div",{className:"px-4 py-6 text-center text-sm text-muted-foreground",children:i?"No matches":"Start typing to search"}):m.map((y,v)=>{const C=v===c;return r.jsxs("button",{type:"button","data-palette-idx":v,onClick:()=>h(y),onMouseEnter:()=>d(v),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:[r.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:C3[y.type]??y.type}),r.jsx("span",{className:"min-w-0 flex-1 truncate",children:y.title}),y.subtitle?r.jsx("span",{className:"shrink-0 truncate text-xs text-muted-foreground",children:y.subtitle}):null]},y.id)})}),r.jsxs("div",{className:"flex items-center justify-between border-t border-border/70 px-3 py-2 text-[11px] text-muted-foreground",children:[r.jsxs("span",{children:["↑↓"," navigate ","·"," ","↵"," open ","·"," Esc close"]}),r.jsxs("span",{children:[m.length," result",m.length===1?"":"s"]})]})]})})}function T3({label:e,onBack:t,disabled:n,stepCounter:s}){return r.jsxs("div",{className:"flex items-center gap-2 border-b border-border/70 px-3 py-2",children:[r.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:[r.jsx(K2,{className:"h-3.5 w-3.5","aria-hidden":"true"}),r.jsx("span",{children:"Back"})]}),r.jsx("span",{className:"text-[11px] font-medium uppercase tracking-wide text-muted-foreground",children:e}),s?r.jsxs("span",{className:"ml-auto text-[10px] text-muted-foreground/80",children:["step ",s.current," of ",s.total]}):null]})}function P3({step:e,initialValue:t,disabled:n,onSubmit:s}){const[i,l]=f.useState(t??""),[c,d]=f.useState(!1),p=f.useRef(null);f.useEffect(()=>{var C;(C=p.current)==null||C.focus()},[]);const m=i.trim(),h=e.required!==!1,x=e.pattern&&m.length>0&&!e.pattern.regex.test(m),y=!n&&(!h||m.length>0)&&!x;function v(C){if(C.key==="Enter"){if(C.preventDefault(),!y){d(!0);return}s(m)}}return r.jsxs(r.Fragment,{children:[r.jsx("input",{ref:p,type:"text",value:i,onChange:C=>{l(C.target.value),d(!1)},onKeyDown:v,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?r.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 R3({step:e,disabled:t,onSubmit:n}){const[s,i]=f.useState({phase:"loading"}),[l,c]=f.useState(""),[d,p]=f.useState(0),[m,h]=f.useState(0),x=f.useRef(null),y=f.useRef(null);f.useEffect(()=>{var j;(j=x.current)==null||j.focus()},[]),f.useEffect(()=>{let j=!1;return i({phase:"loading"}),Promise.resolve().then(()=>e.loadOptions()).then(w=>{j||i({phase:"loaded",options:w})}).catch(w=>{if(j)return;const S=w instanceof Error?w.message:"Failed to load options";i({phase:"error",message:S})}),()=>{j=!0}},[e,m]);const v=f.useMemo(()=>{if(s.phase!=="loaded")return[];const j=s.options.map(w=>({type:"option",title:w.label,subtitle:w.hint,keywords:[w.value],option:w}));return qh(l,j,100)},[s,l]);f.useEffect(()=>{p(0)},[v.length]),f.useEffect(()=>{var w;const j=(w=y.current)==null?void 0:w.querySelector(`[data-picker-idx="${d}"]`);j==null||j.scrollIntoView({block:"nearest"})},[d]);function C(j){if(s.phase==="loaded"){if(j.key==="ArrowDown")j.preventDefault(),p(w=>Math.min(v.length-1,w+1));else if(j.key==="ArrowUp")j.preventDefault(),p(w=>Math.max(0,w-1));else if(j.key==="Enter"){j.preventDefault();const w=v[d];w&&n(w.option.value)}}}return r.jsxs(r.Fragment,{children:[r.jsx("input",{ref:x,type:"text",value:l,onChange:j=>c(j.target.value),onKeyDown:C,placeholder:`Filter ${e.label.toLowerCase()}…`,disabled:t||s.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"}),r.jsx("div",{ref:y,className:"max-h-[60vh] min-h-[120px] overflow-y-auto p-1",children:s.phase==="loading"?r.jsx("div",{className:"px-4 py-6 text-center text-sm text-muted-foreground",children:"Loading…"}):s.phase==="error"?r.jsxs("div",{className:"px-4 py-4 text-sm",children:[r.jsxs("div",{className:"mb-2 text-destructive",children:["Failed to load: ",s.message]}),r.jsx("button",{type:"button",onClick:()=>h(j=>j+1),className:"rounded border border-border/70 bg-background/60 px-2 py-1 text-xs text-foreground hover:bg-accent/40",children:"Retry"})]}):v.length===0?r.jsx("div",{className:"px-4 py-6 text-center text-sm text-muted-foreground",children:s.options.length===0?e.emptyMessage??"No options available":"No matches"}):v.map((j,w)=>{const S=w===d;return r.jsxs("button",{type:"button","data-picker-idx":w,onClick:()=>n(j.option.value),onMouseEnter:()=>p(w),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:[r.jsx("span",{className:"min-w-0 flex-1 truncate",children:j.option.label}),j.option.hint?r.jsx("span",{className:"shrink-0 truncate text-xs text-muted-foreground",children:j.option.hint}):null]},j.option.value)})})]})}function A3({entries:e}){var ue,fe;const t=Rt(),{actionsPaletteOpen:n,closeActionsPalette:s,customBindings:i,bindAction:l,findConflict:c,pendingActionKind:d,consumePendingActionKind:p}=io(),[m,h]=f.useState(""),[x,y]=f.useState(0),[v,C]=f.useState(null),[j,w]=f.useState(""),[S,E]=f.useState(null),[N,P]=f.useState(null),[I,R]=f.useState(!1),[$,D]=f.useState(null),X=f.useRef(null),Z=f.useMemo(()=>e.map(B=>({type:B.group.toLowerCase(),title:B.title,subtitle:B.subtitle,keywords:B.keywords,action:B})),[e]),F=f.useMemo(()=>qh(m,Z,50),[m,Z]);f.useEffect(()=>{y(0)},[m,n]),f.useEffect(()=>{n||(h(""),C(null),w(""),E(null),P(null),R(!1),D(null))},[n]),f.useEffect(()=>{if(!n||!d)return;const B=p();if(!B)return;const oe=e.find(he=>he.bindableKind===B);oe&&H(oe)},[n,d]),f.useEffect(()=>{var oe;const B=(oe=X.current)==null?void 0:oe.querySelector(`[data-palette-idx="${x}"]`);B==null||B.scrollIntoView({block:"nearest"})},[x]);async function H(B){if(!I){if(B.flow&&B.flow.steps.length>0){E({action:B,stepIndex:0,values:{}}),D(null);return}if(B.requiresInput){C(B),w(""),D(null);return}if(B.run){R(!0),D(null);try{await B.run(),s()}catch(oe){D(oe instanceof Error?oe.message:"Action failed")}finally{R(!1)}}}}async function J(B){if(!S)return;const oe=S.action.flow.steps[S.stepIndex],he={...S.values,[oe.id]:B};if(S.stepIndex+1<S.action.flow.steps.length){E({action:S.action,stepIndex:S.stepIndex+1,values:he});return}R(!0),D(null);try{await S.action.flow.submit(he,{navigate:t}),s()}catch(we){D(we instanceof Error?we.message:"Action failed")}finally{R(!1)}}function _(){if(S&&!I){if(S.stepIndex===0){E(null),D(null);return}E({action:S.action,stepIndex:S.stepIndex-1,values:S.values}),D(null)}}async function W(){if(I||!(v!=null&&v.requiresInput))return;const B=j.trim();if(B){R(!0),D(null);try{await v.requiresInput.runWithInput(B),s()}catch(oe){D(oe instanceof Error?oe.message:"Action failed")}finally{R(!1)}}}function Y(B){if(B.key==="ArrowDown")B.preventDefault(),y(oe=>Math.min(F.length-1,oe+1));else if(B.key==="ArrowUp")B.preventDefault(),y(oe=>Math.max(0,oe-1));else if(B.key==="Enter"&&(B.metaKey||B.ctrlKey)){B.preventDefault();const oe=F[x];oe!=null&&oe.action.bindableKind&&P({action:oe.action,combo:null,conflict:null,saving:!1,error:null})}else if(B.key==="Enter"){B.preventDefault();const oe=F[x];oe&&H(oe.action)}}function ie(B){B.key==="Enter"?(B.preventDefault(),W()):B.key==="Escape"&&(B.preventDefault(),C(null),w(""))}function K(B){if(!N||B.key==="Escape"||B.key==="Enter"&&!N.combo)return;B.preventDefault(),B.stopPropagation();const oe=uj(B.nativeEvent);if(!oe)return;const he=c(oe,N.action.bindableKind);P({...N,combo:oe,conflict:he,error:null})}async function ae(){var B;if(!(!N||!N.combo||!N.action.bindableKind)){if((B=N.conflict)!=null&&B.description){P({...N,error:`Reserved: ${N.conflict.description}`});return}P({...N,saving:!0,error:null});try{await l(N.action.bindableKind,N.combo),P(null)}catch(oe){P({...N,saving:!1,error:oe instanceof Error?oe.message:"Failed to save binding"})}}}const T=v!==null,M=S!==null,q=N!==null,L=S?S.action.flow.steps[S.stepIndex]:null;return r.jsx(mr,{open:n,onOpenChange:B=>B?null:s(),children:r.jsxs(Gn,{className:"max-w-xl p-0 gap-0",onEscapeKeyDown:B=>{if(!I){if(q){B.preventDefault(),P(null);return}if(M){B.preventDefault(),_();return}T&&(B.preventDefault(),C(null),w(""),D(null))}},children:[r.jsx(Yn,{className:"sr-only",children:"Actions palette"}),q&&N?r.jsxs("div",{onKeyDown:K,tabIndex:-1,autoFocus:!0,children:[r.jsxs("div",{className:"flex items-center gap-2 border-b border-border/70 px-4 py-3",children:[r.jsx($m,{className:"h-4 w-4 text-muted-foreground","aria-hidden":"true"}),r.jsxs("span",{className:"text-sm text-foreground",children:["Bind hotkey for ",N.action.title]})]}),r.jsx("div",{className:"px-4 py-6 text-center",children:N.combo?r.jsxs("div",{className:"space-y-3",children:[r.jsx("div",{className:"text-2xl font-semibold tracking-wide text-foreground",children:ts(N.combo)}),(ue=N.conflict)!=null&&ue.description?r.jsxs("div",{className:"text-sm text-destructive",children:["Reserved: ",N.conflict.description," (cannot bind)"]}):(fe=N.conflict)!=null&&fe.kind?r.jsxs("div",{className:"text-sm text-amber-500 dark:text-amber-400",children:['Already bound to "',N.conflict.kind,'". Press Enter to overwrite.']}):r.jsx("div",{className:"text-sm text-muted-foreground",children:"Press Enter to save, or another key to retry."}),N.error?r.jsx("div",{className:"text-sm text-destructive",children:N.error}):null]}):r.jsx("div",{className:"text-sm text-muted-foreground",children:"Press the key combination you want to bind…"})}),r.jsxs("div",{className:"flex items-center justify-between border-t border-border/70 px-3 py-2 text-[11px] text-muted-foreground",children:[r.jsx("span",{children:"any key records · Enter saves · Esc cancels"}),r.jsx("span",{children:N.saving?"Saving…":""})]}),r.jsx("button",{type:"button",className:"sr-only",onClick:()=>void ae(),"data-bind-confirm":!0}),r.jsx("input",{type:"hidden",onKeyDown:B=>{B.key==="Enter"&&ae()}})]}):M&&L&&S?r.jsxs(r.Fragment,{children:[r.jsx(T3,{label:`${S.action.title} · ${L.label}`,onBack:_,disabled:I,stepCounter:{current:S.stepIndex+1,total:S.action.flow.steps.length}}),L.kind==="text"?r.jsx(P3,{step:L,initialValue:S.values[L.id],disabled:I,onSubmit:J}):r.jsx(R3,{step:L,disabled:I,onSubmit:J}),$?r.jsx("div",{className:"border-t border-border/70 bg-destructive/10 px-4 py-2 text-xs text-destructive",children:$}):null,r.jsxs("div",{className:"flex items-center justify-between border-t border-border/70 px-3 py-2 text-[11px] text-muted-foreground",children:[r.jsx("span",{children:"↵ next · ← back · Esc back"}),r.jsx("span",{children:I?"Running…":""})]})]}):T?r.jsxs(r.Fragment,{children:[r.jsxs("div",{className:"flex items-center gap-2 border-b border-border/70 px-4 py-3",children:[r.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:v.group}),r.jsx("span",{className:"min-w-0 flex-1 truncate text-sm text-foreground",children:v.title})]}),r.jsx("input",{autoFocus:!0,type:"text",value:j,onChange:B=>w(B.target.value),onKeyDown:ie,placeholder:v.requiresInput.placeholder,disabled:I,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"}),$?r.jsx("div",{className:"border-b border-border/70 bg-destructive/10 px-4 py-2 text-xs text-destructive",children:$}):null,r.jsxs("div",{className:"flex items-center justify-between border-t border-border/70 px-3 py-2 text-[11px] text-muted-foreground",children:[r.jsxs("span",{children:["↵"," submit ","·"," Esc back"]}),r.jsx("span",{children:I?"Running…":""})]})]}):r.jsxs(r.Fragment,{children:[r.jsx("input",{autoFocus:!0,type:"text",value:m,onChange:B=>h(B.target.value),onKeyDown:Y,placeholder:"Run an action: new project, new todo, toggle…",disabled:I,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"}),$?r.jsx("div",{className:"border-b border-border/70 bg-destructive/10 px-4 py-2 text-xs text-destructive",children:$}):null,r.jsx("div",{ref:X,className:"max-h-[60vh] overflow-y-auto p-1",children:F.length===0?r.jsx("div",{className:"px-4 py-6 text-center text-sm text-muted-foreground",children:m?"No matches":"Start typing to search actions"}):F.map((B,oe)=>{const he=oe===x,we=B.action.bindableKind,Se=we?i[we]:void 0;return r.jsxs("button",{type:"button","data-palette-idx":oe,onClick:()=>H(B.action),onMouseEnter:()=>y(oe),disabled:I,className:`group flex w-full items-center gap-3 rounded-md px-3 py-2 text-left text-sm transition-colors disabled:opacity-60 ${he?"bg-accent text-accent-foreground":"hover:bg-accent/50 text-foreground"}`,children:[r.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.action.group}),r.jsx("span",{className:"min-w-0 flex-1 truncate",children:B.action.title}),B.action.subtitle?r.jsx("span",{className:"shrink-0 truncate text-xs text-muted-foreground",children:B.action.subtitle}):null,Se?r.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:ts(Se)}):null,we?r.jsx("span",{role:"button",tabIndex:-1,"aria-label":"Bind hotkey",onClick:pe=>{pe.preventDefault(),pe.stopPropagation(),P({action:B.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 ${he?"opacity-100":"opacity-0 group-hover:opacity-100"}`,children:r.jsx($m,{className:"h-3.5 w-3.5","aria-hidden":"true"})}):null]},B.action.id)})}),r.jsxs("div",{className:"flex items-center justify-between border-t border-border/70 px-3 py-2 text-[11px] text-muted-foreground",children:[r.jsxs("span",{children:["↑↓"," navigate ","·"," ","↵"," run ","·"," ⌘↵ bind ","·"," Esc close"]}),r.jsx("span",{children:I?"Running…":`${F.length} action${F.length===1?"":"s"}`})]})]})]})})}const D3=[{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 $3(e){const t=Kn(e);return t?D3.find(n=>n.combo===t)??null:null}const rl={"new-workspace":"New Workspace","new-project":"New Project","new-todo":"New Todo","new-assignment":"New Assignment"},L3={global:"Global","list:overview":"Overview","list:projects":"Projects list","list:assignments":"Assignments list","list:todos":"Todos list",assignment:"Assignment detail",project:"Project detail"},I3=["global","list:overview","list:projects","list:assignments","list:todos","project","assignment"];function rb(e){if(e.includes(" ")){const[t,n]=e.split(" ");return`${ts(t)} then ${ts(n)}`}return ts(e)}function O3(){const{cheatsheetOpen:e,closeCheatsheet:t,listBindings:n,customBindings:s,actionEntries:i}=io(),l=f.useMemo(()=>{const p=new Set;for(const m of Object.values(s))typeof m=="string"&&m&&p.add(Kn(m));return p},[s]),c=f.useMemo(()=>{if(!e)return new Map;const p=n(),m=new Map;for(const h of p){if(l.has(Kn(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=f.useMemo(()=>{const p=[];for(const[m,h]of Object.entries(s)){if(!h)continue;const x=i.find(y=>y.bindableKind===m);p.push({kind:m,combo:h,title:x?x.title:m})}return p},[s,i]);return r.jsx(mr,{open:e,onOpenChange:p=>p?null:t(),children:r.jsxs(Gn,{className:"max-w-2xl",children:[r.jsx(Yn,{children:"Keyboard shortcuts"}),r.jsxs(ls,{children:["Press Esc to close. ",ts("Mod+k")," opens the command palette. Press g twice to restart the chord timer."]}),r.jsxs("div",{className:"mt-2 max-h-[60vh] space-y-4 overflow-y-auto pr-1",children:[I3.map(p=>{const m=c.get(p);return!m||m.length===0?null:r.jsxs("section",{children:[r.jsx("h3",{className:"mb-2 text-xs font-semibold uppercase tracking-wide text-muted-foreground",children:L3[p]}),r.jsx("ul",{className:"space-y-1",children:m.map((h,x)=>r.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:[r.jsx("span",{className:"text-foreground",children:h.description}),r.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:rb(h.keys)})]},`${p}-${h.keys}-${x}`))})]},p)}),d.length>0?r.jsxs("section",{children:[r.jsx("h3",{className:"mb-2 text-xs font-semibold uppercase tracking-wide text-muted-foreground",children:"Custom bindings"}),r.jsx("ul",{className:"space-y-1",children:d.map(p=>r.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:[r.jsx("span",{className:"text-foreground",children:p.title}),r.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:rb(p.combo)})]},`custom-${p.kind}`))})]}):null]})]})})}const Gh={bindings:{},custom:!1};let ml=null,wi=null;const Fm=new Set;function Xj(e){ml=e;for(const t of Fm)t(e)}function Yh(e){if(!e||typeof e!="object")return Gh;const t=e,n={};if(t.bindings&&typeof t.bindings=="object"&&!Array.isArray(t.bindings))for(const[s,i]of Object.entries(t.bindings)){if(!bP(s)||typeof i!="string"||i.trim()==="")continue;const l=Kn(i);l&&(n[s]=l)}return{bindings:n,custom:t.custom===!0}}function _3(){return ml?Promise.resolve(ml):wi||(wi=fetch("/api/config/hotkeys").then(e=>{if(!e.ok)throw new Error(`HTTP ${e.status}`);return e.json()}).then(e=>{const t=Yh(e);return ml=t,wi=null,t}).catch(()=>(wi=null,Gh)),wi)}function M3(){const[e,t]=f.useState(()=>ml??Gh);return f.useEffect(()=>{let n=!1;return _3().then(s=>{n||t(s)}),Fm.add(t),()=>{n=!0,Fm.delete(t)}},[]),e}async function sb(e){const t={};for(const i of ad){const l=e[i];if(typeof l!="string")continue;const c=Kn(l);c&&(t[i]=c)}const n=await fetch("/api/config/hotkeys",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({bindings:t})});if(!n.ok){const i=await n.json().catch(()=>({error:`HTTP ${n.status}`}));throw new Error(i.error??"Failed to save hotkey bindings")}const s=Yh(await n.json());return Xj(s),s}async function F3(){const e=await fetch("/api/config/hotkeys",{method:"DELETE"});if(!e.ok)throw new Error(`HTTP ${e.status}`);const t=Yh(await e.json());return Xj(t),t}const ob=1500;function z3(e){const t=e.match(/^\/w\/([^/]+)(?:\/|$)/);return t?`/w/${t[1]}`:""}const Qj=f.createContext(null);function B3({children:e}){const{toggleTheme:t}=Dh(),n=Ln(),s=Rt(),i=z3(n.pathname),l=Zi(),c=$h(),d=cj(),p=Lh(),m=dj(),h=f.useMemo(()=>{var Fe,qe,Ve,Ze;const te=l.data??[],ye=((Fe=c.data)==null?void 0:Fe.assignments)??[],ne=((qe=d.data)==null?void 0:qe.playbooks)??[],U=((Ve=p.data)==null?void 0:Ve.sessions)??[],me=(((Ze=m.data)==null?void 0:Ze.workspaces)??[]).flatMap(St=>St.items.map(bt=>({...bt,workspace:St.workspace})));return LP({projects:te,assignments:ye,playbooks:ne,servers:U,todos:me,wsPrefix:i})},[l.data,c.data,d.data,p.data,m.data,i]),y=f.useMemo(()=>G0(n.pathname),[n.pathname]).projectSlug,v=f.useMemo(()=>{var te;return y?((te=l.data)==null?void 0:te.find(ye=>ye.slug===y))??null:null},[l.data,y]),C=(v==null?void 0:v.title)??null,j=(v==null?void 0:v.workspace)??null,w=f.useMemo(()=>{var te;return _P({playbooks:((te=d.data)==null?void 0:te.playbooks)??[],projectSlug:y,currentProjectTitle:C,currentProjectWorkspace:j,wsPrefix:i,refetchPlaybooks:d.refetch,navigate:s,toggleTheme:t})},[d.data,d.refetch,y,C,j,i,s,t]),S=f.useRef(new Map),E=f.useRef(["global"]),N=f.useRef({phase:"idle"}),P=f.useRef(null),I=f.useRef(1),[R,$]=f.useState(!1),[D,X]=f.useState(!1),[Z,F]=f.useState(!1),[H,J]=f.useState(null),{bindings:_}=M3(),W=f.useMemo(()=>NP(_),[_]),Y=f.useCallback(te=>{const ye=I.current++;return S.current.set(ye,{...te,id:ye}),ye},[]),ie=f.useCallback(te=>{S.current.delete(te)},[]),K=f.useCallback(te=>{E.current.push(te)},[]),ae=f.useCallback(te=>{const ye=E.current;for(let ne=ye.length-1;ne>=0;ne--)if(ye[ne]===te){ye.splice(ne,1);return}},[]),T=f.useCallback(()=>$(!0),[]),M=f.useCallback(()=>$(!1),[]),q=f.useCallback(()=>X(!0),[]),L=f.useCallback(()=>X(!1),[]),ue=f.useCallback(()=>F(!0),[]),fe=f.useCallback(()=>{F(!1),J(null)},[]),B=f.useCallback(()=>Array.from(S.current.values()),[]),oe=f.useCallback(()=>{let te=null;return J(ye=>(te=ye,null)),te},[]),he=f.useCallback(te=>{J(te),F(!0)},[]),we=f.useCallback((te,ye)=>{const ne=Kn(te);if(!ne)return null;if(kP(ne)){const U=$3(ne);return{description:(U==null?void 0:U.description)??"Reserved built-in shortcut"}}for(const[U,de]of Object.entries(W))if(!(ye&&U===ye)&&de===ne)return{kind:U};return null},[W]),Se=f.useCallback(async(te,ye)=>{const ne=Kn(ye);if(!ne)throw new Error("Empty combo");const U=we(ne,te);if(U){const me=U.description?`Reserved: ${U.description}`:`Already bound to "${U.kind}"`;throw new Error(me)}const de={..._,[te]:ne};return await sb(de),ne},[_,we]),pe=f.useCallback(async te=>{if(!_[te])return;const ye={..._};delete ye[te],await sb(ye)},[_]);f.useEffect(()=>{N.current={phase:"idle"},P.current!==null&&(window.clearTimeout(P.current),P.current=null)},[n.pathname]),f.useEffect(()=>{function te(me){if(!(me instanceof HTMLElement))return!1;const Fe=me.tagName;return!!(Fe==="INPUT"||Fe==="TEXTAREA"||Fe==="SELECT"||me.isContentEditable||me.closest('[role="combobox"], [role="textbox"]'))}function ye(){return!!(document.querySelector('[role="dialog"][data-state="open"]')||document.querySelector('[role="alertdialog"][data-state="open"]'))}function ne(){const me=E.current;return me[me.length-1]??"global"}function U(me){return me.scope==="global"?!0:me.scope===ne()}function de(me){const Fe=nu(me,"Mod+k"),qe=nu(me,"Mod+Shift+k"),Ve=me.key==="Escape",Ze=Fe||qe||Ve;if(ye()&&!Ze||te(me.target)&&!Ze)return;const St=N.current;if(St.phase==="awaiting-second")if(Date.now()-St.startedAt>ob)N.current={phase:"idle"},P.current!==null&&(window.clearTimeout(P.current),P.current=null);else{const ce=Array.from(S.current.values());for(const ve of ce){if(!U(ve))continue;const De=ve.keys.split(" ");if(!(De.length!==2||De[0]!=="g")&&nu(me,De[1])&&!(ve.when&&!ve.when())){me.preventDefault(),N.current={phase:"idle"},P.current!==null&&(window.clearTimeout(P.current),P.current=null),ve.handler(me);return}}N.current={phase:"idle"},P.current!==null&&(window.clearTimeout(P.current),P.current=null)}const bt=Array.from(S.current.values());for(const gt of bt){if(!U(gt))continue;const ce=gt.keys.split(" ");if(ce.length===1&&nu(me,ce[0])&&!(gt.when&&!gt.when())){me.preventDefault(),gt.handler(me);return}}me.key==="g"&&!me.metaKey&&!me.ctrlKey&&!me.altKey&&!me.shiftKey&&Array.from(S.current.values()).some(ce=>U(ce)&&ce.keys.startsWith("g "))&&(me.preventDefault(),N.current={phase:"awaiting-second",startedAt:Date.now()},P.current!==null&&window.clearTimeout(P.current),P.current=window.setTimeout(()=>{N.current={phase:"idle"},P.current=null},ob))}return window.addEventListener("keydown",de),()=>{window.removeEventListener("keydown",de),P.current!==null&&(window.clearTimeout(P.current),P.current=null)}},[]),f.useEffect(()=>{const te=Y({keys:"Shift+t",handler:()=>t(),scope:"global",description:"Toggle light/dark theme"});return()=>ie(te)},[Y,ie,t]),f.useEffect(()=>{const te=Y({keys:"?",scope:"global",description:"Show keyboard shortcuts",handler:()=>q()});return()=>ie(te)},[Y,ie,q]),f.useEffect(()=>{const te=Y({keys:"Mod+k",scope:"global",description:"Open command palette",handler:()=>{if(R){M();return}document.querySelector('[role="dialog"][data-state="open"], [role="alertdialog"][data-state="open"]')||T()}});return()=>ie(te)},[Y,ie,T,M,R]),f.useEffect(()=>{const te=Y({keys:"Mod+Shift+k",scope:"global",description:"Open actions palette",handler:()=>{if(Z){fe();return}document.querySelector('[role="dialog"][data-state="open"], [role="alertdialog"][data-state="open"]')||ue()}});return()=>ie(te)},[Y,ie,ue,fe,Z]),f.useEffect(()=>{const ye=[{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:"/settings",desc:"Go to Settings"}].map(ne=>Y({keys:`g ${ne.suffix}`,scope:"global",description:ne.desc,handler:()=>s(ju(ne.basePath,i))}));return()=>ye.forEach(ie)},[Y,ie,s,i]),f.useEffect(()=>{const te=[];for(const[ye,ne]of Object.entries(W)){if(!ne)continue;const U=w.find(me=>me.bindableKind===ye),de=U?`Custom: ${U.title}`:`Custom: ${ye}`;te.push(Y({keys:ne,scope:"global",description:de,handler:()=>{J(ye),F(!0)}}))}return()=>te.forEach(ie)},[Y,ie,W,w]);const He=f.useMemo(()=>({register:Y,unregister:ie,pushScope:K,popScope:ae,openPalette:T,closePalette:M,paletteOpen:R,openCheatsheet:q,closeCheatsheet:L,cheatsheetOpen:D,openActionsPalette:ue,closeActionsPalette:fe,actionsPaletteOpen:Z,listBindings:B,wsPrefix:i,paletteEntries:h,actionEntries:w,userBindings:_,customBindings:W,bindAction:Se,unbindAction:pe,findConflict:we,openActionsPaletteWithAction:he,pendingActionKind:H,consumePendingActionKind:oe}),[Y,ie,K,ae,T,M,R,q,L,D,ue,fe,Z,B,i,h,w,_,W,Se,pe,we,he,H,oe]);return r.jsxs(Qj.Provider,{value:He,children:[e,r.jsx(E3,{entries:h}),r.jsx(A3,{entries:w}),r.jsx(O3,{})]})}function io(){const e=f.useContext(Qj);if(!e)throw new Error("useHotkeyContext must be used within HotkeyProvider");return e}function Pt({keys:e,handler:t,scope:n="global",description:s,when:i,enabled:l=!0}){const{register:c,unregister:d}=io(),p=f.useRef(t),m=f.useRef(i);f.useEffect(()=>{p.current=t,m.current=i},[t,i]),f.useEffect(()=>{if(!l)return;const h=c({keys:e,handler:x=>p.current(x),scope:n,description:s,when:m.current?()=>m.current():void 0});return()=>d(h)},[c,d,e,n,s,l])}function ao(e){const{pushScope:t,popScope:n}=io();f.useEffect(()=>(t(e),()=>n(e)),[t,n,e])}function Hl(e,t){const[n,s]=f.useState(e.length===0?-1:0),i=Ln();f.useEffect(()=>{s(e.length===0?-1:0)},[i.pathname]),f.useEffect(()=>{s(c=>e.length===0?-1:Math.min(Math.max(0,c),e.length-1))},[e.length]),f.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]),Pt({keys:"j",scope:t.scope,description:"Select next row",handler:()=>s(c=>e.length===0?-1:Math.min(e.length-1,c<0?0:c+1))}),Pt({keys:"k",scope:t.scope,description:"Select previous row",handler:()=>s(c=>e.length===0?-1:Math.max(0,c<0?0:c-1))}),Pt({keys:"Enter",scope:t.scope,description:"Open selected row",handler:()=>{n>=0&&n<e.length&&t.onOpen(e[n],n)}}),Pt({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=f.useCallback(c=>({"data-hotkey-row-index":c,"data-hotkey-selected":c===n?"true":"false"}),[n]);return{selectedIndex:n,hotkeyRowProps:l}}function U3({title:e,breadcrumbs:t,projectSlug:n,onOpenMobileNav:s}){const i=Wt(),{resolvedTheme:l,toggleTheme:c}=Dh(),{openPalette:d}=io();return r.jsx("header",{className:"sticky top-0 z-30 border-b border-border/70 bg-background/70 backdrop-blur",children:r.jsxs("div",{className:"flex flex-wrap items-center gap-2 px-4 py-2.5 lg:px-6",children:[r.jsx("button",{type:"button",onClick:s,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:r.jsx(uT,{className:"h-4 w-4"})}),r.jsx("div",{className:"min-w-0 flex-1",children:r.jsxs("div",{className:"flex items-center gap-2",children:[t.length>1?r.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)=>r.jsxs("span",{className:"flex items-center gap-1.5",children:[m>0?r.jsx("span",{children:"/"}):null,r.jsx(Ee,{to:p.path,className:"hover:text-foreground",children:p.label})]},p.path)),r.jsx("span",{children:"/"})]}):null,r.jsx("h1",{className:"min-w-0 truncate text-base font-semibold text-foreground",children:e})]})}),r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsxs("button",{type:"button",onClick:d,className:"shell-action","aria-label":"Open command palette",children:[r.jsx(so,{className:"h-4 w-4"}),r.jsx("span",{className:"hidden sm:inline font-mono text-xs",children:ts("Mod+k")})]}),r.jsx(Ee,{className:"shell-action",to:"/help",children:"Help"}),r.jsxs(Ee,{className:"shell-action",to:`${i}/create/project`,children:[r.jsx(Jt,{className:"h-4 w-4"}),r.jsx("span",{children:"New Project"})]}),n?r.jsxs(Ee,{className:"shell-action",to:`${i}/projects/${n}/create/assignment`,children:[r.jsx(Jt,{className:"h-4 w-4"}),r.jsx("span",{children:"New Assignment"})]}):null,r.jsxs("button",{type:"button",onClick:c,className:"shell-action","aria-label":"Toggle theme",children:[l==="dark"?r.jsx(bT,{className:"h-4 w-4"}):r.jsx(dT,{className:"h-4 w-4"}),r.jsx("span",{children:l==="dark"?"Light":"Dark"})]})]})]})})}var H3=Symbol("radix.slottable");function V3(e){const t=({children:n})=>r.jsx(r.Fragment,{children:n});return t.displayName=`${e}.Slottable`,t.__radixId=H3,t}var Zj="AlertDialog",[W3]=Bo(Zj,[Aj]),Ns=Aj(),ek=e=>{const{__scopeAlertDialog:t,...n}=e,s=Ns(t);return r.jsx(qj,{...s,...n,modal:!0})};ek.displayName=Zj;var K3="AlertDialogTrigger",q3=f.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...s}=e,i=Ns(n);return r.jsx(Gj,{...i,...s,ref:t})});q3.displayName=K3;var G3="AlertDialogPortal",tk=e=>{const{__scopeAlertDialog:t,...n}=e,s=Ns(t);return r.jsx(Yj,{...s,...n})};tk.displayName=G3;var Y3="AlertDialogOverlay",nk=f.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...s}=e,i=Ns(n);return r.jsx(Uh,{...i,...s,ref:t})});nk.displayName=Y3;var Mi="AlertDialogContent",[J3,X3]=W3(Mi),Q3=V3("AlertDialogContent"),rk=f.forwardRef((e,t)=>{const{__scopeAlertDialog:n,children:s,...i}=e,l=Ns(n),c=f.useRef(null),d=Tn(t,c),p=f.useRef(null);return r.jsx(x3,{contentName:Mi,titleName:sk,docsSlug:"alert-dialog",children:r.jsx(J3,{scope:n,cancelRef:p,children:r.jsxs(Hh,{role:"alertdialog",...l,...i,ref:d,onOpenAutoFocus:Lt(i.onOpenAutoFocus,m=>{var h;m.preventDefault(),(h=p.current)==null||h.focus({preventScroll:!0})}),onPointerDownOutside:m=>m.preventDefault(),onInteractOutside:m=>m.preventDefault(),children:[r.jsx(Q3,{children:s}),r.jsx(eA,{contentRef:c})]})})})});rk.displayName=Mi;var sk="AlertDialogTitle",ok=f.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...s}=e,i=Ns(n);return r.jsx(Vh,{...i,...s,ref:t})});ok.displayName=sk;var ik="AlertDialogDescription",ak=f.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...s}=e,i=Ns(n);return r.jsx(Wh,{...i,...s,ref:t})});ak.displayName=ik;var Z3="AlertDialogAction",lk=f.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...s}=e,i=Ns(n);return r.jsx(Kh,{...i,...s,ref:t})});lk.displayName=Z3;var ck="AlertDialogCancel",uk=f.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...s}=e,{cancelRef:i}=X3(ck,n),l=Ns(n),c=Tn(t,i);return r.jsx(Kh,{...l,...s,ref:c})});uk.displayName=ck;var eA=({contentRef:e})=>{const t=`\`${Mi}\` requires a description for the component to be accessible for screen reader users.
|
|
495
|
+
|
|
496
|
+
You can add a description to the \`${Mi}\` by passing a \`${ik}\` component as a child, which also benefits sighted users by adding visible context to the dialog.
|
|
497
|
+
|
|
498
|
+
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 \`${Mi}\`. 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.
|
|
499
|
+
|
|
500
|
+
For more information, see https://radix-ui.com/primitives/docs/components/alert-dialog`;return f.useEffect(()=>{var s;document.getElementById((s=e.current)==null?void 0:s.getAttribute("aria-describedby"))||console.warn(t)},[t,e]),null},tA=ek,nA=tk,dk=nk,fk=rk,pk=lk,mk=uk,hk=ok,gk=ak;const Jh=tA,rA=nA,xk=f.forwardRef(({className:e,...t},n)=>r.jsx(dk,{ref:n,className:Te("fixed inset-0 z-50 bg-background/80 backdrop-blur-sm",e),...t}));xk.displayName=dk.displayName;const fd=f.forwardRef(({className:e,...t},n)=>r.jsxs(rA,{children:[r.jsx(xk,{}),r.jsx(fk,{ref:n,className:Te("chrome-card 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 !p-6 outline-none",e),...t})]}));fd.displayName=fk.displayName;function Xh({className:e,...t}){return r.jsx("div",{className:Te("flex flex-col space-y-2 text-left",e),...t})}function Qh({className:e,...t}){return r.jsx("div",{className:Te("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",e),...t})}const pd=f.forwardRef(({className:e,...t},n)=>r.jsx(hk,{ref:n,className:Te("text-lg font-semibold tracking-tight text-foreground",e),...t}));pd.displayName=hk.displayName;const md=f.forwardRef(({className:e,...t},n)=>r.jsx(gk,{ref:n,className:Te("text-sm leading-6 text-muted-foreground",e),...t}));md.displayName=gk.displayName;const Tl=f.forwardRef(({className:e,...t},n)=>r.jsx(pk,{ref:n,className:Te(e),...t}));Tl.displayName=pk.displayName;const hd=f.forwardRef(({className:e,...t},n)=>r.jsx(mk,{ref:n,className:Te(e),...t}));hd.displayName=mk.displayName;const sA=[{to:"/",label:"Overview",icon:A0},{to:"/playbooks",label:"Playbooks",icon:P0},{to:"/memories",label:"Memories",icon:W2},{to:"/resources",label:"Resources",icon:iT},{to:"/inventories",label:"Inventories",icon:rd},{to:"/usage",label:"Usage",icon:jh},{to:"/todos",label:"Todos",icon:Er},{to:"/views",label:"Saved Views",icon:L0}],oA=[{suffix:"/projects",label:"Projects",icon:$0},{suffix:"/assignments",label:"Assignments",icon:cT},{suffix:"/servers",label:"Servers",icon:Ch},{suffix:"/inventories",label:"Inventories",icon:rd},{suffix:"/usage",label:"Usage",icon:jh},{suffix:"/agent-sessions",label:"Agent Sessions",icon:nd},{suffix:"/todos",label:"Todos",icon:Er}],iA=[{to:"/help",label:"Help",icon:aT},{to:"/settings",label:"Settings",icon:yT}],ib="syntaur.dashboard.sourceFirstNoticeDismissed";function aA({title:e,breadcrumbs:t,projectSlug:n,workspace:s,children:i}){const[l,c]=f.useState(!1);Pt({keys:"Escape",scope:"global",description:"Close mobile navigation",enabled:l,handler:()=>c(!1)});const[d,p]=f.useState(()=>{if(typeof window>"u")return!1;try{return window.localStorage.getItem(ib)==="1"}catch{return!1}});function m(){if(p(!0),!(typeof window>"u"))try{window.localStorage.setItem(ib,"1")}catch{}}return r.jsx("div",{className:"min-h-screen bg-background",children:r.jsxs("div",{className:"relative grid min-h-screen lg:grid-cols-[240px_minmax(0,1fr)]",children:[r.jsx("aside",{className:"hidden max-h-screen sticky top-0 overflow-y-auto border-r border-border/70 bg-sidebar px-4 py-4 lg:flex lg:flex-col",children:r.jsx(ab,{sourceNoticeDismissed:d,onDismissSourceNotice:m,activeWorkspace:s})}),l?r.jsx("div",{className:"fixed inset-0 z-40 bg-overlay/40 lg:hidden",children:r.jsxs("div",{className:"h-full max-w-xs border-r border-border/70 bg-sidebar p-4 shadow-2xl",children:[r.jsxs("div",{className:"mb-4 flex items-center justify-between",children:[r.jsx(Ee,{to:"/",className:"text-lg font-semibold text-foreground",onClick:()=>c(!1),children:"Syntaur"}),r.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:r.jsx(Ph,{className:"h-4 w-4"})})]}),r.jsx(ab,{sourceNoticeDismissed:d,onDismissSourceNotice:m,activeWorkspace:s,onNavigate:()=>c(!1)})]})}):null,r.jsxs("div",{className:"min-w-0",children:[r.jsx(U3,{title:e,breadcrumbs:t,projectSlug:n,onOpenMobileNav:()=>c(!0)}),r.jsx("main",{className:"mx-auto w-full max-w-[1480px] px-4 py-4 lg:px-6 lg:py-5",children:i})]})]})})}function ab({sourceNoticeDismissed:e,onDismissSourceNotice:t,activeWorkspace:n,onNavigate:s}){const{data:i}=id(),l=(i==null?void 0:i.workspaces)??[],c=(i==null?void 0:i.hasUngrouped)??!1,d=Ln(),[p,m]=f.useState(new Set),[h,x]=f.useState(!1),[y,v]=f.useState(""),[C,j]=f.useState(null),[w,S]=f.useState(null),[E,N]=f.useState(null),[P,I]=f.useState(!1),R=Rt();function $(F){m(H=>{const J=new Set(H);return J.has(F)?J.delete(F):J.add(F),J})}const D=[...l,...c?["_ungrouped"]:[]];async function X(F){if(w){I(!0);try{const H=`/api/workspaces/${encodeURIComponent(w)}${F?"?cascade=true":""}`,J=await fetch(H,{method:"DELETE"});if(J.status===409){const _=await J.json().catch(()=>({}));N((_==null?void 0:_.blockedBy)??{projects:[],standalones:[]});return}if(!J.ok){const _=await J.json().catch(()=>({}));throw new Error(_.error||"Failed to delete workspace")}S(null),N(null)}catch(H){console.error(H),alert(H instanceof Error?H.message:"Failed to delete workspace")}finally{I(!1)}}}async function Z(F,H){try{if(F.type==="project"){const J=await fetch(`/api/projects/${encodeURIComponent(F.id)}/move-workspace`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({workspace:H})});if(!J.ok){const _=await J.json().catch(()=>({}));throw new Error(_.error||"Failed to move project")}return}if(F.type==="standalone-assignment"){const J=await fetch(`/api/assignments/${encodeURIComponent(F.id)}/move-workspace`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({workspaceGroup:H})});if(!J.ok){const _=await J.json().catch(()=>({}));throw new Error(_.error||"Failed to move assignment")}return}if(F.type==="project-assignment"){alert("Assignments inherit workspace from their project — drag the project (or move it) to change workspaces.");return}}catch(J){console.error(J),alert(J instanceof Error?J.message:"Failed to move item")}}return r.jsxs("div",{className:"flex h-full flex-col gap-3",children:[r.jsx("div",{className:"space-y-3",children:r.jsxs(Ee,{to:"/",className:"inline-flex items-center gap-3",onClick:s,children:[r.jsx("span",{className:"inline-flex h-8 w-8 items-center justify-center rounded-lg bg-card text-foreground shadow-sm ring-1 ring-border/60",children:r.jsxs("svg",{viewBox:"0 0 43 51","aria-label":"Syntaur",role:"img",className:"h-4 w-auto",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",children:[r.jsx("path",{d:"M13 2C13 0.89543 13.8954 0 15 0H41C42.1046 0 43 0.895431 43 2V12C43 13.1046 42.1046 14 41 14H13V2Z"}),r.jsx("path",{d:"M0 15C0 13.8954 0.895431 13 2 13H14V25C14 26.1046 13.1046 27 12 27H2C0.89543 27 0 26.1046 0 25V15Z"}),r.jsx("path",{d:"M30 49C30 50.1046 29.1046 51 28 51L2 51C0.89543 51 0 50.1046 0 49L0 39C0 37.8954 0.895431 37 2 37L30 37L30 49Z"}),r.jsx("path",{d:"M42.9646 36C42.9646 37.1046 42.0692 38 40.9646 38H28.9646V26C28.9646 24.8954 29.86 24 30.9646 24H40.9646C42.0692 24 42.9646 24.8954 42.9646 26V36Z"})]})}),r.jsxs("div",{children:[r.jsx("p",{className:"text-sm font-semibold text-foreground",children:"Syntaur"}),r.jsx("p",{className:"text-xs text-muted-foreground/60",children:"Local-first project control"})]})]})}),r.jsx(zv,{items:sA,onNavigate:s}),r.jsx("div",{className:"border-t border-border/40"}),r.jsxs("div",{className:"flex-1 space-y-1 overflow-y-auto",children:[D.length===0&&!h&&r.jsx("p",{className:"px-3 py-2 text-xs text-muted-foreground/60",children:"No workspaces yet"}),D.map(F=>{const H=F==="_ungrouped",J=H?"Ungrouped":gn(F),_=H?"/w/_ungrouped":`/w/${F}`,W=p.has(F),Y=n===F||n===null&&H&&d.pathname.startsWith("/w/_ungrouped"),ie=C===F;return r.jsxs("div",{className:`rounded-md transition ${ie?"bg-accent/40 ring-1 ring-ring/40":""}`,onDragOver:K=>{K.dataTransfer.types.includes("application/json")&&(K.preventDefault(),K.dataTransfer.dropEffect="move",j(F))},onDragLeave:K=>{K.currentTarget.contains(K.relatedTarget)||j(ae=>ae===F?null:ae)},onDrop:async K=>{try{const ae=K.dataTransfer.getData("application/json");if(!ae)return;K.preventDefault();let T;try{T=JSON.parse(ae)}catch{return}if(!(T!=null&&T.type)||!(T!=null&&T.id))return;await Z(T,H?null:F)}finally{j(null)}},children:[r.jsxs("div",{className:"group flex items-center",children:[r.jsxs("button",{type:"button",onClick:()=>$(F),className:`flex flex-1 items-center gap-2 rounded-md px-3 py-1.5 text-xs font-semibold uppercase tracking-wider transition ${Y?"text-foreground":"text-muted-foreground/70 hover:text-muted-foreground"}`,children:[r.jsx(Io,{className:`h-3 w-3 transition-transform ${W?"-rotate-90":""}`}),J]}),H?null:r.jsx("button",{type:"button",onClick:K=>{K.stopPropagation(),S(F),N(null)},title:`Delete workspace "${F}"`,"aria-label":`Delete workspace "${F}"`,className:"mr-1 flex h-6 w-6 items-center justify-center rounded text-muted-foreground/60 opacity-0 transition hover:bg-destructive/10 hover:text-destructive focus-visible:opacity-100 group-hover:opacity-100",children:r.jsx(In,{className:"h-3 w-3"})})]}),!W&&r.jsx("nav",{className:"ml-2 space-y-0.5",children:oA.map(K=>{const ae=`${_}${K.suffix}`,T=q0(d.pathname,K.suffix)&&d.pathname.startsWith(_),M=K.icon;return r.jsxs(Ee,{to:ae,onClick:s,className:`flex items-center gap-3 rounded-md px-3 py-1.5 text-sm font-medium transition ${T?"bg-foreground text-background shadow-sm":"text-muted-foreground hover:bg-background/80 hover:text-foreground"}`,children:[r.jsx(M,{className:"h-4 w-4"}),r.jsx("span",{children:K.label})]},ae)})})]},F)}),h?r.jsx("form",{className:"px-3 py-1.5",onSubmit:F=>{F.preventDefault();const H=y.trim().toLowerCase().replace(/[^a-z0-9-]/g,"-").replace(/-+/g,"-").replace(/^-|-$/g,"");H&&(x(!1),v(""),fetch("/api/workspaces",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:H})}).then(()=>{s==null||s(),R(`/w/${H}/projects`)}))},children:r.jsx("input",{autoFocus:!0,type:"text",value:y,onChange:F=>v(F.target.value),onKeyDown:F=>{F.key==="Escape"&&(x(!1),v(""))},onBlur:()=>{y.trim()||(x(!1),v(""))},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"})}):r.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:[r.jsx(Jt,{className:"h-3 w-3"}),"New Workspace"]})]}),r.jsx("div",{className:"border-t border-border/40"}),r.jsx(zv,{items:iA,onNavigate:s}),e?null:r.jsx("div",{className:"chrome-card",children:r.jsxs("div",{className:"flex items-start justify-between gap-3",children:[r.jsxs("div",{children:[r.jsx("p",{className:"text-sm font-semibold text-foreground",children:"Source-first dashboard"}),r.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."})]}),r.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:r.jsx(Ph,{className:"h-4 w-4"})})]})}),r.jsx(Jh,{open:w!==null,onOpenChange:F=>{P||F||(S(null),N(null))},children:r.jsxs(fd,{children:[r.jsxs(Xh,{children:[r.jsx(pd,{children:E?"Workspace has references":"Delete workspace?"}),r.jsx(md,{children:E?r.jsxs(r.Fragment,{children:["The workspace ",r.jsx("code",{className:"rounded bg-muted px-1 py-0.5",children:w})," is still referenced by:"]}):r.jsxs(r.Fragment,{children:["Remove the workspace ",r.jsx("code",{className:"rounded bg-muted px-1 py-0.5",children:w})," from the registry. This does not affect projects or standalones unless you choose to cascade."]})})]}),E?r.jsxs("div",{className:"space-y-2 text-sm",children:[E.projects.length>0?r.jsxs("div",{children:[r.jsxs("p",{className:"font-medium text-foreground",children:["Projects (",E.projects.length,")"]}),r.jsx("ul",{className:"mt-1 list-disc pl-5 text-muted-foreground",children:E.projects.map(F=>r.jsx("li",{children:r.jsx(Ee,{to:`/projects/${F}`,className:"hover:underline",children:F})},F))})]}):null,E.standalones.length>0?r.jsxs("div",{children:[r.jsxs("p",{className:"font-medium text-foreground",children:["Standalones (",E.standalones.length,")"]}),r.jsx("ul",{className:"mt-1 list-disc pl-5 text-muted-foreground",children:E.standalones.map(F=>r.jsx("li",{children:r.jsx(Ee,{to:`/assignments/${F}`,className:"hover:underline",children:F})},F))})]}):null,r.jsxs("p",{className:"text-xs text-muted-foreground",children:['Choose "Clear references and delete" to set ',r.jsx("code",{children:"workspace:"})," / ",r.jsx("code",{children:"workspaceGroup:"})," to ",r.jsx("code",{children:"null"})," on each, then remove the workspace."]})]}):null,r.jsxs(Qh,{children:[r.jsx(hd,{disabled:P,className:"shell-action mt-0 disabled:cursor-not-allowed disabled:opacity-50",children:"Cancel"}),E?r.jsx(Tl,{disabled:P,onClick:F=>{F.preventDefault(),X(!0)},className:"shell-action mt-0 border-destructive/80 bg-destructive text-destructive-foreground hover:bg-destructive/90 disabled:cursor-not-allowed disabled:opacity-50",children:P?"Working…":"Clear references and delete"}):r.jsx(Tl,{disabled:P,onClick:F=>{F.preventDefault(),X(!1)},className:"shell-action mt-0 border-destructive/80 bg-destructive text-destructive-foreground hover:bg-destructive/90 disabled:cursor-not-allowed disabled:opacity-50",children:P?"Working…":"Delete"})]})]})})]})}function lA(){const e=Ln(),{workspace:t}=At(),{title:n,breadcrumbs:s,projectSlug:i}=G0(e.pathname);return r.jsx(aA,{title:n,breadcrumbs:s,projectSlug:i,workspace:t??null,children:r.jsx(r2,{})})}function ct({label:e="Loading dashboard data…"}){return r.jsx("div",{className:"flex min-h-[240px] items-center justify-center",children:r.jsx("div",{className:"chrome-card !px-4 !py-3",children:r.jsx("p",{className:"text-sm text-muted-foreground",children:e})})})}function mt({title:e="Something went wrong",error:t,action:n}){return r.jsx("div",{className:"rounded-lg border border-error-foreground/30 bg-error px-4 py-5",children:r.jsxs("div",{className:"space-y-2",children:[r.jsx("h3",{className:"text-lg font-semibold text-error-foreground",children:e}),r.jsx("p",{className:"text-sm leading-6 text-error-foreground/90",children:t}),n?r.jsx("div",{className:"pt-2",children:n}):null]})})}function Cu({command:e,description:t,example:n}){return r.jsxs("div",{className:"rounded-lg border border-border/70 bg-code px-3 py-3 text-code-foreground shadow-sm",children:[r.jsx("code",{className:"block overflow-x-auto font-mono text-sm",children:e}),t?r.jsx("p",{className:"mt-2 text-sm text-code-foreground/80",children:t}):null,n?r.jsx("p",{className:"mt-2 font-mono text-xs text-code-foreground/60",children:n}):null]})}function Ue({title:e,description:t,children:n,className:s,actions:i}){return r.jsxs("section",{className:Te("surface-panel space-y-3",s),children:[e||i?r.jsxs("div",{className:"flex flex-wrap items-start justify-between gap-3",children:[r.jsxs("div",{className:"space-y-1",children:[e?r.jsx("h2",{className:"text-lg font-semibold text-foreground",children:e}):null,t?r.jsx("p",{className:"text-sm text-muted-foreground",children:t}):null]}),i]}):null,n]})}function cA({help:e,compact:t=!1}){const n=t?(e==null?void 0:e.firstProjectChecklist.slice(0,3))??[]:(e==null?void 0:e.firstProjectChecklist)??[];return r.jsx(Ue,{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:r.jsx(Ee,{className:"text-sm font-semibold text-primary hover:underline",to:"/help",children:"Open full help"}),children:r.jsx("div",{className:"space-y-3",children:n.map((s,i)=>r.jsx("div",{className:"rounded-md border border-border/60 bg-background/80 p-3",children:r.jsxs("div",{className:"flex items-start gap-3",children:[r.jsx("span",{className:"inline-flex h-5 w-5 items-center justify-center rounded-full bg-foreground text-xs font-semibold text-background",children:i+1}),r.jsxs("div",{className:"space-y-1.5",children:[r.jsx("h3",{className:"font-semibold text-foreground",children:s.title}),r.jsx("p",{className:"text-sm leading-6 text-muted-foreground",children:s.detail}),s.command?r.jsx(Cu,{command:s.command.command,example:s.command.example}):null]})]})},s.title))})})}const Yp={review:"{total} items ready for your review","review.singular":"Review {title}",ready_to_implement:"{total} plans ready to implement — start with {title}","ready_to_implement.singular":"Start implementing {title}",ready_for_planning:"{total} assignments ready to plan — start with {title}","ready_for_planning.singular":"Plan {title}",in_progress:"Resume {title} ({total} in progress)","in_progress.singular":"Resume {title}",draft:"Shape your {total} drafts — start with {title}","draft.singular":"Shape {title}",blocked:"Unblock {title} ({total} blocked)","blocked.singular":"Unblock {title}",stale:"Triage {total} stale items","stale.singular":"Triage {title} — sitting stale",clean:"You’re all clear. Nothing needs you right now."},$o={emptyStateCleanTitle:"You’re all clear",emptyStateCleanCTA:"Browse projects",recentSessionsEmptyTitle:"No recent sessions",recentSessionsEmptyHint:"Use /grab-assignment or `syntaur track-session` to register one.",recentSessionsCopyPathLabel:"Copy path",recentSessionsCopyPathDisabled:"Session has no path",recentSessionsCopyFallbackHint:"Press ⌘C to copy"};function uA(e,t){return e.replace(/\{(\w+)\}/g,(n,s)=>String(t[s]??`{${s}}`))}function dA({hero:e,itemsById:t}){const n=Wt();if(e.kind==="clean")return r.jsxs("section",{"aria-labelledby":"overview-hero-title",className:"rounded-xl border border-border/60 bg-background/60 p-6 shadow-sm",children:[r.jsx("p",{className:"eyebrow",children:$o.emptyStateCleanTitle}),r.jsx("h2",{id:"overview-hero-title",className:"mt-2 text-2xl font-semibold tracking-tight text-foreground",children:Yp.clean}),r.jsx("p",{className:"mt-3 text-sm text-muted-foreground",children:"When work shows up — a draft, a review, a stale row — it’ll surface here."}),r.jsx("div",{className:"mt-4",children:r.jsx(Ee,{to:`${n}/projects`,className:"shell-action bg-foreground text-background hover:opacity-90",children:$o.emptyStateCleanCTA})})]});const s=e.itemId?t[e.itemId]:void 0,i=(s==null?void 0:s.assignmentTitle)??"",l=Yp[e.copyKey]??Yp[e.kind],c=uA(l,{total:e.total,title:i}),d=s?fA(s,n):`${n}/assignments`;return r.jsxs("section",{"aria-labelledby":"overview-hero-title",className:"rounded-xl border border-primary/20 bg-primary/5 p-6 shadow-sm",children:[r.jsx("p",{className:"eyebrow",children:"What needs you today"}),r.jsx("h2",{id:"overview-hero-title",className:"mt-2 text-2xl font-semibold tracking-tight text-foreground",children:c}),s?r.jsxs("p",{className:"mt-2 text-sm text-muted-foreground",children:["In ",r.jsx("span",{className:"font-medium text-foreground",children:s.projectTitle??"Standalone"})," ","· status ",r.jsx("span",{className:"font-medium text-foreground",children:s.status})]}):null,r.jsx("div",{className:"mt-4",children:r.jsxs(Ee,{to:d,className:"shell-action bg-foreground text-background hover:opacity-90",children:["Open ",i||"assignment"]})})]})}function fA(e,t){return e.projectSlug?`${t}${e.href}`:e.href}const yk=["kanban","list","table"],pA=["title","status","priority","assignee","dependencies","updated"],mA=["asc","desc"],hA=["comfortable","compact"],gA=["none","status","type","priority","assignee","project"],xA={defaultView:"kanban",sortField:"updated",sortDirection:"desc",density:"comfortable",grouping:"none",filters:{status:"all",type:"all",priority:"all",assignee:"all",project:"all",activity:"all"}},Pl={version:1,global:xA,projects:{}};function Jp(e){return e==="table"?"table":"kanban"}function yA(e,t){return t?{...e,...t}:{...e}}function vk(e,t){const n=e.global;if(t===null)return n;const s=e.projects[t];return s?{defaultView:s.defaultView??n.defaultView,sortField:s.sortField??n.sortField,sortDirection:s.sortDirection??n.sortDirection,density:n.density,grouping:s.grouping??n.grouping,filters:yA(n.filters,s.filters)}:n}const Xp=["title","status","priority","assignee","dependencies","updated"],vA={status:"all",priority:"all",assignee:"all",project:"all",activity:"all"},lb="2026-05-21T00:00:00Z";function Qp(e,t,n){return{id:e,name:t,workspace:null,config:{viewMode:"list",filters:{...vA,...n},sortField:"updated",sortDirection:"desc",listSectionVisibility:{collapsed:[]},kanbanColumnVisibility:{hidden:[]},tableColumnVisibility:{hidden:[]}},createdAt:lb,updatedAt:lb}}const Qs={version:1,views:[Qp("default-recently-updated","Recently updated",{}),Qp("default-high-priority","High priority",{priority:"high"}),Qp("default-stale","Stale",{activity:"stale"})],dashboard:{version:1,slots:[{id:"slot-0",widget:{kind:"agent-sessions"}},{id:"slot-1",widget:{kind:"saved-view",viewId:"default-recently-updated"}},{id:"slot-2",widget:{kind:"saved-view",viewId:"default-high-priority"}},{id:"slot-3",widget:{kind:"saved-view",viewId:"default-stale"}},{id:"slot-4",widget:{kind:"inventories"}}]}};function bA(e,t){switch(t.kind){case"global":return e.workspace===null;case"workspace":return e.workspace===t.workspace||e.workspace===null;case"project":{if(!(e.workspace===t.workspace||e.workspace===null))return!1;const s=e.config.filters.project;return s===void 0||s==="all"||s===t.slug}}}const bk=`syntaur.savedViews.cache.v${Qs.version}`;let Fi=wA(),Ro=null,Zh=null;const zm=new Set,Iu=new Set;let wk=0;function jk(){return++wk}function Bm(e){return e===wk}function wA(){if(typeof window>"u"||!window.localStorage)return null;try{const e=window.localStorage.getItem(bk);if(!e)return null;const t=JSON.parse(e);return t.version!==Qs.version?null:t}catch{return null}}function jA(e){if(!(typeof window>"u"||!window.localStorage))try{window.localStorage.setItem(bk,JSON.stringify(e))}catch{}}function kk(e){Fi=e,Zh=null,jA(e);for(const t of zm)t(e);for(const t of Iu)t(null)}function kA(e){Zh=e;for(const t of Iu)t(e)}function Sk(e){if(!e||typeof e!="object")return Qs;const t=e;return t.version!==Qs.version||!Array.isArray(t.views)||!t.dashboard?Qs:t}function cb(){if(Ro)return Ro;const e=jk();return Ro=fetch("/api/saved-views").then(t=>{if(!t.ok)throw new Error(`HTTP ${t.status}`);return t.json()}).then(t=>{const n=Sk(t);return Bm(e)&&kk(n),Ro=null,Fi??n}).catch(t=>{const n=t instanceof Error?t:new Error(String(t));return Bm(e)&&kA(n),Ro=null,Fi??Qs}),Ro}function eg(){const[e,t]=f.useState(()=>Fi??Qs),[n,s]=f.useState(()=>Fi===null),[i,l]=f.useState(()=>Zh);return f.useEffect(()=>{let d=!1;Fi===null&&s(!0),cb().then(h=>{d||(t(h),s(!1))});const p=h=>{d||(t(h),s(!1),l(null))},m=h=>{d||(l(h),s(!1))};return zm.add(p),Iu.add(m),()=>{d=!0,zm.delete(p),Iu.delete(m)}},[]),{file:e,loading:n,error:i,refetch:()=>{Ro=null,s(!0),l(null),cb()}}}function tg(){const{file:e,loading:t}=eg();return{views:e.views,loading:t}}function SA(){const{file:e,loading:t}=eg();return{layout:e.dashboard,loading:t}}function Ki(e){const{file:t,loading:n,error:s,refetch:i}=eg();return e?{view:t.views.find(c=>c.id===e)??null,loading:n,error:s,refetch:i}:{view:null,loading:!1,error:null,refetch:i}}async function gd(e,t,n){const s=jk(),i=await fetch(t,{method:e,headers:n!==void 0?{"Content-Type":"application/json"}:void 0,body:n!==void 0?JSON.stringify(n):void 0});if(!i.ok){const c=await i.json().catch(()=>({error:`HTTP ${i.status}`}));throw new Error(c.error??`HTTP ${i.status}`)}const l=Sk(await i.json());return Bm(s)&&kk(l),l}function Nk(e){return gd("POST","/api/saved-views",e)}function ng(e,t){return gd("PATCH",`/api/saved-views/${encodeURIComponent(e)}`,t)}function NA(e){return gd("DELETE",`/api/saved-views/${encodeURIComponent(e)}`)}function CA(e){return gd("PUT","/api/dashboard",{slots:e})}const EA=["top","right","bottom","left"],eo=Math.min,cr=Math.max,Ou=Math.round,lu=Math.floor,ns=e=>({x:e,y:e}),TA={left:"right",right:"left",bottom:"top",top:"bottom"};function Um(e,t,n){return cr(e,eo(t,n))}function ks(e,t){return typeof e=="function"?e(t):e}function Ss(e){return e.split("-")[0]}function ea(e){return e.split("-")[1]}function rg(e){return e==="x"?"y":"x"}function sg(e){return e==="y"?"height":"width"}function Zr(e){const t=e[0];return t==="t"||t==="b"?"y":"x"}function og(e){return rg(Zr(e))}function PA(e,t,n){n===void 0&&(n=!1);const s=ea(e),i=og(e),l=sg(i);let c=i==="x"?s===(n?"end":"start")?"right":"left":s==="start"?"bottom":"top";return t.reference[l]>t.floating[l]&&(c=_u(c)),[c,_u(c)]}function RA(e){const t=_u(e);return[Hm(e),t,Hm(t)]}function Hm(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}const ub=["left","right"],db=["right","left"],AA=["top","bottom"],DA=["bottom","top"];function $A(e,t,n){switch(e){case"top":case"bottom":return n?t?db:ub:t?ub:db;case"left":case"right":return t?AA:DA;default:return[]}}function LA(e,t,n,s){const i=ea(e);let l=$A(Ss(e),n==="start",s);return i&&(l=l.map(c=>c+"-"+i),t&&(l=l.concat(l.map(Hm)))),l}function _u(e){const t=Ss(e);return TA[t]+e.slice(t.length)}function IA(e){return{top:0,right:0,bottom:0,left:0,...e}}function Ck(e){return typeof e!="number"?IA(e):{top:e,right:e,bottom:e,left:e}}function Mu(e){const{x:t,y:n,width:s,height:i}=e;return{width:s,height:i,top:n,left:t,right:t+s,bottom:n+i,x:t,y:n}}function fb(e,t,n){let{reference:s,floating:i}=e;const l=Zr(t),c=og(t),d=sg(c),p=Ss(t),m=l==="y",h=s.x+s.width/2-i.width/2,x=s.y+s.height/2-i.height/2,y=s[d]/2-i[d]/2;let v;switch(p){case"top":v={x:h,y:s.y-i.height};break;case"bottom":v={x:h,y:s.y+s.height};break;case"right":v={x:s.x+s.width,y:x};break;case"left":v={x:s.x-i.width,y:x};break;default:v={x:s.x,y:s.y}}switch(ea(t)){case"start":v[c]-=y*(n&&m?-1:1);break;case"end":v[c]+=y*(n&&m?-1:1);break}return v}async function OA(e,t){var n;t===void 0&&(t={});const{x:s,y:i,platform:l,rects:c,elements:d,strategy:p}=e,{boundary:m="clippingAncestors",rootBoundary:h="viewport",elementContext:x="floating",altBoundary:y=!1,padding:v=0}=ks(t,e),C=Ck(v),w=d[y?x==="floating"?"reference":"floating":x],S=Mu(await l.getClippingRect({element:(n=await(l.isElement==null?void 0:l.isElement(w)))==null||n?w:w.contextElement||await(l.getDocumentElement==null?void 0:l.getDocumentElement(d.floating)),boundary:m,rootBoundary:h,strategy:p})),E=x==="floating"?{x:s,y:i,width:c.floating.width,height:c.floating.height}:c.reference,N=await(l.getOffsetParent==null?void 0:l.getOffsetParent(d.floating)),P=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},I=Mu(l.convertOffsetParentRelativeRectToViewportRelativeRect?await l.convertOffsetParentRelativeRectToViewportRelativeRect({elements:d,rect:E,offsetParent:N,strategy:p}):E);return{top:(S.top-I.top+C.top)/P.y,bottom:(I.bottom-S.bottom+C.bottom)/P.y,left:(S.left-I.left+C.left)/P.x,right:(I.right-S.right+C.right)/P.x}}const _A=50,MA=async(e,t,n)=>{const{placement:s="bottom",strategy:i="absolute",middleware:l=[],platform:c}=n,d=c.detectOverflow?c:{...c,detectOverflow:OA},p=await(c.isRTL==null?void 0:c.isRTL(t));let m=await c.getElementRects({reference:e,floating:t,strategy:i}),{x:h,y:x}=fb(m,s,p),y=s,v=0;const C={};for(let j=0;j<l.length;j++){const w=l[j];if(!w)continue;const{name:S,fn:E}=w,{x:N,y:P,data:I,reset:R}=await E({x:h,y:x,initialPlacement:s,placement:y,strategy:i,middlewareData:C,rects:m,platform:d,elements:{reference:e,floating:t}});h=N??h,x=P??x,C[S]={...C[S],...I},R&&v<_A&&(v++,typeof R=="object"&&(R.placement&&(y=R.placement),R.rects&&(m=R.rects===!0?await c.getElementRects({reference:e,floating:t,strategy:i}):R.rects),{x:h,y:x}=fb(m,y,p)),j=-1)}return{x:h,y:x,placement:y,strategy:i,middlewareData:C}},FA=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:s,placement:i,rects:l,platform:c,elements:d,middlewareData:p}=t,{element:m,padding:h=0}=ks(e,t)||{};if(m==null)return{};const x=Ck(h),y={x:n,y:s},v=og(i),C=sg(v),j=await c.getDimensions(m),w=v==="y",S=w?"top":"left",E=w?"bottom":"right",N=w?"clientHeight":"clientWidth",P=l.reference[C]+l.reference[v]-y[v]-l.floating[C],I=y[v]-l.reference[v],R=await(c.getOffsetParent==null?void 0:c.getOffsetParent(m));let $=R?R[N]:0;(!$||!await(c.isElement==null?void 0:c.isElement(R)))&&($=d.floating[N]||l.floating[C]);const D=P/2-I/2,X=$/2-j[C]/2-1,Z=eo(x[S],X),F=eo(x[E],X),H=Z,J=$-j[C]-F,_=$/2-j[C]/2+D,W=Um(H,_,J),Y=!p.arrow&&ea(i)!=null&&_!==W&&l.reference[C]/2-(_<H?Z:F)-j[C]/2<0,ie=Y?_<H?_-H:_-J:0;return{[v]:y[v]+ie,data:{[v]:W,centerOffset:_-W-ie,...Y&&{alignmentOffset:ie}},reset:Y}}}),zA=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,s;const{placement:i,middlewareData:l,rects:c,initialPlacement:d,platform:p,elements:m}=t,{mainAxis:h=!0,crossAxis:x=!0,fallbackPlacements:y,fallbackStrategy:v="bestFit",fallbackAxisSideDirection:C="none",flipAlignment:j=!0,...w}=ks(e,t);if((n=l.arrow)!=null&&n.alignmentOffset)return{};const S=Ss(i),E=Zr(d),N=Ss(d)===d,P=await(p.isRTL==null?void 0:p.isRTL(m.floating)),I=y||(N||!j?[_u(d)]:RA(d)),R=C!=="none";!y&&R&&I.push(...LA(d,j,C,P));const $=[d,...I],D=await p.detectOverflow(t,w),X=[];let Z=((s=l.flip)==null?void 0:s.overflows)||[];if(h&&X.push(D[S]),x){const _=PA(i,c,P);X.push(D[_[0]],D[_[1]])}if(Z=[...Z,{placement:i,overflows:X}],!X.every(_=>_<=0)){var F,H;const _=(((F=l.flip)==null?void 0:F.index)||0)+1,W=$[_];if(W&&(!(x==="alignment"?E!==Zr(W):!1)||Z.every(K=>Zr(K.placement)===E?K.overflows[0]>0:!0)))return{data:{index:_,overflows:Z},reset:{placement:W}};let Y=(H=Z.filter(ie=>ie.overflows[0]<=0).sort((ie,K)=>ie.overflows[1]-K.overflows[1])[0])==null?void 0:H.placement;if(!Y)switch(v){case"bestFit":{var J;const ie=(J=Z.filter(K=>{if(R){const ae=Zr(K.placement);return ae===E||ae==="y"}return!0}).map(K=>[K.placement,K.overflows.filter(ae=>ae>0).reduce((ae,T)=>ae+T,0)]).sort((K,ae)=>K[1]-ae[1])[0])==null?void 0:J[0];ie&&(Y=ie);break}case"initialPlacement":Y=d;break}if(i!==Y)return{reset:{placement:Y}}}return{}}}};function pb(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function mb(e){return EA.some(t=>e[t]>=0)}const BA=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n,platform:s}=t,{strategy:i="referenceHidden",...l}=ks(e,t);switch(i){case"referenceHidden":{const c=await s.detectOverflow(t,{...l,elementContext:"reference"}),d=pb(c,n.reference);return{data:{referenceHiddenOffsets:d,referenceHidden:mb(d)}}}case"escaped":{const c=await s.detectOverflow(t,{...l,altBoundary:!0}),d=pb(c,n.floating);return{data:{escapedOffsets:d,escaped:mb(d)}}}default:return{}}}}},Ek=new Set(["left","top"]);async function UA(e,t){const{placement:n,platform:s,elements:i}=e,l=await(s.isRTL==null?void 0:s.isRTL(i.floating)),c=Ss(n),d=ea(n),p=Zr(n)==="y",m=Ek.has(c)?-1:1,h=l&&p?-1:1,x=ks(t,e);let{mainAxis:y,crossAxis:v,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"&&(v=d==="end"?C*-1:C),p?{x:v*h,y:y*m}:{x:y*m,y:v*h}}const HA=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,s;const{x:i,y:l,placement:c,middlewareData:d}=t,p=await UA(t,e);return c===((n=d.offset)==null?void 0:n.placement)&&(s=d.arrow)!=null&&s.alignmentOffset?{}:{x:i+p.x,y:l+p.y,data:{...p,placement:c}}}}},VA=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:s,placement:i,platform:l}=t,{mainAxis:c=!0,crossAxis:d=!1,limiter:p={fn:S=>{let{x:E,y:N}=S;return{x:E,y:N}}},...m}=ks(e,t),h={x:n,y:s},x=await l.detectOverflow(t,m),y=Zr(Ss(i)),v=rg(y);let C=h[v],j=h[y];if(c){const S=v==="y"?"top":"left",E=v==="y"?"bottom":"right",N=C+x[S],P=C-x[E];C=Um(N,C,P)}if(d){const S=y==="y"?"top":"left",E=y==="y"?"bottom":"right",N=j+x[S],P=j-x[E];j=Um(N,j,P)}const w=p.fn({...t,[v]:C,[y]:j});return{...w,data:{x:w.x-n,y:w.y-s,enabled:{[v]:c,[y]:d}}}}}},WA=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:s,placement:i,rects:l,middlewareData:c}=t,{offset:d=0,mainAxis:p=!0,crossAxis:m=!0}=ks(e,t),h={x:n,y:s},x=Zr(i),y=rg(x);let v=h[y],C=h[x];const j=ks(d,t),w=typeof j=="number"?{mainAxis:j,crossAxis:0}:{mainAxis:0,crossAxis:0,...j};if(p){const N=y==="y"?"height":"width",P=l.reference[y]-l.floating[N]+w.mainAxis,I=l.reference[y]+l.reference[N]-w.mainAxis;v<P?v=P:v>I&&(v=I)}if(m){var S,E;const N=y==="y"?"width":"height",P=Ek.has(Ss(i)),I=l.reference[x]-l.floating[N]+(P&&((S=c.offset)==null?void 0:S[x])||0)+(P?0:w.crossAxis),R=l.reference[x]+l.reference[N]+(P?0:((E=c.offset)==null?void 0:E[x])||0)-(P?w.crossAxis:0);C<I?C=I:C>R&&(C=R)}return{[y]:v,[x]:C}}}},KA=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,s;const{placement:i,rects:l,platform:c,elements:d}=t,{apply:p=()=>{},...m}=ks(e,t),h=await c.detectOverflow(t,m),x=Ss(i),y=ea(i),v=Zr(i)==="y",{width:C,height:j}=l.floating;let w,S;x==="top"||x==="bottom"?(w=x,S=y===(await(c.isRTL==null?void 0:c.isRTL(d.floating))?"start":"end")?"left":"right"):(S=x,w=y==="end"?"top":"bottom");const E=j-h.top-h.bottom,N=C-h.left-h.right,P=eo(j-h[w],E),I=eo(C-h[S],N),R=!t.middlewareData.shift;let $=P,D=I;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(D=N),(s=t.middlewareData.shift)!=null&&s.enabled.y&&($=E),R&&!y){const Z=cr(h.left,0),F=cr(h.right,0),H=cr(h.top,0),J=cr(h.bottom,0);v?D=C-2*(Z!==0||F!==0?Z+F:cr(h.left,h.right)):$=j-2*(H!==0||J!==0?H+J:cr(h.top,h.bottom))}await p({...t,availableWidth:D,availableHeight:$});const X=await c.getDimensions(d.floating);return C!==X.width||j!==X.height?{reset:{rects:!0}}:{}}}};function xd(){return typeof window<"u"}function ta(e){return Tk(e)?(e.nodeName||"").toLowerCase():"#document"}function fr(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function cs(e){var t;return(t=(Tk(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function Tk(e){return xd()?e instanceof Node||e instanceof fr(e).Node:!1}function Fr(e){return xd()?e instanceof Element||e instanceof fr(e).Element:!1}function Cs(e){return xd()?e instanceof HTMLElement||e instanceof fr(e).HTMLElement:!1}function hb(e){return!xd()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof fr(e).ShadowRoot}function Vl(e){const{overflow:t,overflowX:n,overflowY:s,display:i}=zr(e);return/auto|scroll|overlay|hidden|clip/.test(t+s+n)&&i!=="inline"&&i!=="contents"}function qA(e){return/^(table|td|th)$/.test(ta(e))}function yd(e){try{if(e.matches(":popover-open"))return!0}catch{}try{return e.matches(":modal")}catch{return!1}}const GA=/transform|translate|scale|rotate|perspective|filter/,YA=/paint|layout|strict|content/,Po=e=>!!e&&e!=="none";let Zp;function ig(e){const t=Fr(e)?zr(e):e;return Po(t.transform)||Po(t.translate)||Po(t.scale)||Po(t.rotate)||Po(t.perspective)||!ag()&&(Po(t.backdropFilter)||Po(t.filter))||GA.test(t.willChange||"")||YA.test(t.contain||"")}function JA(e){let t=to(e);for(;Cs(t)&&!qi(t);){if(ig(t))return t;if(yd(t))return null;t=to(t)}return null}function ag(){return Zp==null&&(Zp=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),Zp}function qi(e){return/^(html|body|#document)$/.test(ta(e))}function zr(e){return fr(e).getComputedStyle(e)}function vd(e){return Fr(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function to(e){if(ta(e)==="html")return e;const t=e.assignedSlot||e.parentNode||hb(e)&&e.host||cs(e);return hb(t)?t.host:t}function Pk(e){const t=to(e);return qi(t)?e.ownerDocument?e.ownerDocument.body:e.body:Cs(t)&&Vl(t)?t:Pk(t)}function Rl(e,t,n){var s;t===void 0&&(t=[]),n===void 0&&(n=!0);const i=Pk(e),l=i===((s=e.ownerDocument)==null?void 0:s.body),c=fr(i);if(l){const d=Vm(c);return t.concat(c,c.visualViewport||[],Vl(i)?i:[],d&&n?Rl(d):[])}else return t.concat(i,Rl(i,[],n))}function Vm(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Rk(e){const t=zr(e);let n=parseFloat(t.width)||0,s=parseFloat(t.height)||0;const i=Cs(e),l=i?e.offsetWidth:n,c=i?e.offsetHeight:s,d=Ou(n)!==l||Ou(s)!==c;return d&&(n=l,s=c),{width:n,height:s,$:d}}function lg(e){return Fr(e)?e:e.contextElement}function zi(e){const t=lg(e);if(!Cs(t))return ns(1);const n=t.getBoundingClientRect(),{width:s,height:i,$:l}=Rk(t);let c=(l?Ou(n.width):n.width)/s,d=(l?Ou(n.height):n.height)/i;return(!c||!Number.isFinite(c))&&(c=1),(!d||!Number.isFinite(d))&&(d=1),{x:c,y:d}}const XA=ns(0);function Ak(e){const t=fr(e);return!ag()||!t.visualViewport?XA:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function QA(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==fr(e)?!1:t}function Mo(e,t,n,s){t===void 0&&(t=!1),n===void 0&&(n=!1);const i=e.getBoundingClientRect(),l=lg(e);let c=ns(1);t&&(s?Fr(s)&&(c=zi(s)):c=zi(e));const d=QA(l,n,s)?Ak(l):ns(0);let p=(i.left+d.x)/c.x,m=(i.top+d.y)/c.y,h=i.width/c.x,x=i.height/c.y;if(l){const y=fr(l),v=s&&Fr(s)?fr(s):s;let C=y,j=Vm(C);for(;j&&s&&v!==C;){const w=zi(j),S=j.getBoundingClientRect(),E=zr(j),N=S.left+(j.clientLeft+parseFloat(E.paddingLeft))*w.x,P=S.top+(j.clientTop+parseFloat(E.paddingTop))*w.y;p*=w.x,m*=w.y,h*=w.x,x*=w.y,p+=N,m+=P,C=fr(j),j=Vm(C)}}return Mu({width:h,height:x,x:p,y:m})}function bd(e,t){const n=vd(e).scrollLeft;return t?t.left+n:Mo(cs(e)).left+n}function Dk(e,t){const n=e.getBoundingClientRect(),s=n.left+t.scrollLeft-bd(e,n),i=n.top+t.scrollTop;return{x:s,y:i}}function ZA(e){let{elements:t,rect:n,offsetParent:s,strategy:i}=e;const l=i==="fixed",c=cs(s),d=t?yd(t.floating):!1;if(s===c||d&&l)return n;let p={scrollLeft:0,scrollTop:0},m=ns(1);const h=ns(0),x=Cs(s);if((x||!x&&!l)&&((ta(s)!=="body"||Vl(c))&&(p=vd(s)),x)){const v=Mo(s);m=zi(s),h.x=v.x+s.clientLeft,h.y=v.y+s.clientTop}const y=c&&!x&&!l?Dk(c,p):ns(0);return{width:n.width*m.x,height:n.height*m.y,x:n.x*m.x-p.scrollLeft*m.x+h.x+y.x,y:n.y*m.y-p.scrollTop*m.y+h.y+y.y}}function eD(e){return Array.from(e.getClientRects())}function tD(e){const t=cs(e),n=vd(e),s=e.ownerDocument.body,i=cr(t.scrollWidth,t.clientWidth,s.scrollWidth,s.clientWidth),l=cr(t.scrollHeight,t.clientHeight,s.scrollHeight,s.clientHeight);let c=-n.scrollLeft+bd(e);const d=-n.scrollTop;return zr(s).direction==="rtl"&&(c+=cr(t.clientWidth,s.clientWidth)-i),{width:i,height:l,x:c,y:d}}const gb=25;function nD(e,t){const n=fr(e),s=cs(e),i=n.visualViewport;let l=s.clientWidth,c=s.clientHeight,d=0,p=0;if(i){l=i.width,c=i.height;const h=ag();(!h||h&&t==="fixed")&&(d=i.offsetLeft,p=i.offsetTop)}const m=bd(s);if(m<=0){const h=s.ownerDocument,x=h.body,y=getComputedStyle(x),v=h.compatMode==="CSS1Compat"&&parseFloat(y.marginLeft)+parseFloat(y.marginRight)||0,C=Math.abs(s.clientWidth-x.clientWidth-v);C<=gb&&(l-=C)}else m<=gb&&(l+=m);return{width:l,height:c,x:d,y:p}}function rD(e,t){const n=Mo(e,!0,t==="fixed"),s=n.top+e.clientTop,i=n.left+e.clientLeft,l=Cs(e)?zi(e):ns(1),c=e.clientWidth*l.x,d=e.clientHeight*l.y,p=i*l.x,m=s*l.y;return{width:c,height:d,x:p,y:m}}function xb(e,t,n){let s;if(t==="viewport")s=nD(e,n);else if(t==="document")s=tD(cs(e));else if(Fr(t))s=rD(t,n);else{const i=Ak(e);s={x:t.x-i.x,y:t.y-i.y,width:t.width,height:t.height}}return Mu(s)}function $k(e,t){const n=to(e);return n===t||!Fr(n)||qi(n)?!1:zr(n).position==="fixed"||$k(n,t)}function sD(e,t){const n=t.get(e);if(n)return n;let s=Rl(e,[],!1).filter(d=>Fr(d)&&ta(d)!=="body"),i=null;const l=zr(e).position==="fixed";let c=l?to(e):e;for(;Fr(c)&&!qi(c);){const d=zr(c),p=ig(c);!p&&d.position==="fixed"&&(i=null),(l?!p&&!i:!p&&d.position==="static"&&!!i&&(i.position==="absolute"||i.position==="fixed")||Vl(c)&&!p&&$k(e,c))?s=s.filter(h=>h!==c):i=d,c=to(c)}return t.set(e,s),s}function oD(e){let{element:t,boundary:n,rootBoundary:s,strategy:i}=e;const c=[...n==="clippingAncestors"?yd(t)?[]:sD(t,this._c):[].concat(n),s],d=xb(t,c[0],i);let p=d.top,m=d.right,h=d.bottom,x=d.left;for(let y=1;y<c.length;y++){const v=xb(t,c[y],i);p=cr(v.top,p),m=eo(v.right,m),h=eo(v.bottom,h),x=cr(v.left,x)}return{width:m-x,height:h-p,x,y:p}}function iD(e){const{width:t,height:n}=Rk(e);return{width:t,height:n}}function aD(e,t,n){const s=Cs(t),i=cs(t),l=n==="fixed",c=Mo(e,!0,l,t);let d={scrollLeft:0,scrollTop:0};const p=ns(0);function m(){p.x=bd(i)}if(s||!s&&!l)if((ta(t)!=="body"||Vl(i))&&(d=vd(t)),s){const v=Mo(t,!0,l,t);p.x=v.x+t.clientLeft,p.y=v.y+t.clientTop}else i&&m();l&&!s&&i&&m();const h=i&&!s&&!l?Dk(i,d):ns(0),x=c.left+d.scrollLeft-p.x-h.x,y=c.top+d.scrollTop-p.y-h.y;return{x,y,width:c.width,height:c.height}}function em(e){return zr(e).position==="static"}function yb(e,t){if(!Cs(e)||zr(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return cs(e)===n&&(n=n.ownerDocument.body),n}function Lk(e,t){const n=fr(e);if(yd(e))return n;if(!Cs(e)){let i=to(e);for(;i&&!qi(i);){if(Fr(i)&&!em(i))return i;i=to(i)}return n}let s=yb(e,t);for(;s&&qA(s)&&em(s);)s=yb(s,t);return s&&qi(s)&&em(s)&&!ig(s)?n:s||JA(e)||n}const lD=async function(e){const t=this.getOffsetParent||Lk,n=this.getDimensions,s=await n(e.floating);return{reference:aD(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:s.width,height:s.height}}};function cD(e){return zr(e).direction==="rtl"}const uD={convertOffsetParentRelativeRectToViewportRelativeRect:ZA,getDocumentElement:cs,getClippingRect:oD,getOffsetParent:Lk,getElementRects:lD,getClientRects:eD,getDimensions:iD,getScale:zi,isElement:Fr,isRTL:cD};function Ik(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function dD(e,t){let n=null,s;const i=cs(e);function l(){var d;clearTimeout(s),(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:y,height:v}=m;if(d||t(),!y||!v)return;const C=lu(x),j=lu(i.clientWidth-(h+y)),w=lu(i.clientHeight-(x+v)),S=lu(h),N={rootMargin:-C+"px "+-j+"px "+-w+"px "+-S+"px",threshold:cr(0,eo(1,p))||1};let P=!0;function I(R){const $=R[0].intersectionRatio;if($!==p){if(!P)return c();$?c(!1,$):s=setTimeout(()=>{c(!1,1e-7)},1e3)}$===1&&!Ik(m,e.getBoundingClientRect())&&c(),P=!1}try{n=new IntersectionObserver(I,{...N,root:i.ownerDocument})}catch{n=new IntersectionObserver(I,N)}n.observe(e)}return c(!0),l}function fD(e,t,n,s){s===void 0&&(s={});const{ancestorScroll:i=!0,ancestorResize:l=!0,elementResize:c=typeof ResizeObserver=="function",layoutShift:d=typeof IntersectionObserver=="function",animationFrame:p=!1}=s,m=lg(e),h=i||l?[...m?Rl(m):[],...t?Rl(t):[]]:[];h.forEach(S=>{i&&S.addEventListener("scroll",n,{passive:!0}),l&&S.addEventListener("resize",n)});const x=m&&d?dD(m,n):null;let y=-1,v=null;c&&(v=new ResizeObserver(S=>{let[E]=S;E&&E.target===m&&v&&t&&(v.unobserve(t),cancelAnimationFrame(y),y=requestAnimationFrame(()=>{var N;(N=v)==null||N.observe(t)})),n()}),m&&!p&&v.observe(m),t&&v.observe(t));let C,j=p?Mo(e):null;p&&w();function w(){const S=Mo(e);j&&!Ik(j,S)&&n(),j=S,C=requestAnimationFrame(w)}return n(),()=>{var S;h.forEach(E=>{i&&E.removeEventListener("scroll",n),l&&E.removeEventListener("resize",n)}),x==null||x(),(S=v)==null||S.disconnect(),v=null,p&&cancelAnimationFrame(C)}}const pD=HA,mD=VA,hD=zA,gD=KA,xD=BA,vb=FA,yD=WA,vD=(e,t,n)=>{const s=new Map,i={platform:uD,...n},l={...i.platform,_c:s};return MA(e,t,{...i,platform:l})};var bD=typeof document<"u",wD=function(){},Eu=bD?f.useLayoutEffect:wD;function Fu(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,s,i;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(s=n;s--!==0;)if(!Fu(e[s],t[s]))return!1;return!0}if(i=Object.keys(e),n=i.length,n!==Object.keys(t).length)return!1;for(s=n;s--!==0;)if(!{}.hasOwnProperty.call(t,i[s]))return!1;for(s=n;s--!==0;){const l=i[s];if(!(l==="_owner"&&e.$$typeof)&&!Fu(e[l],t[l]))return!1}return!0}return e!==e&&t!==t}function Ok(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function bb(e,t){const n=Ok(e);return Math.round(t*n)/n}function tm(e){const t=f.useRef(e);return Eu(()=>{t.current=e}),t}function jD(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:s=[],platform:i,elements:{reference:l,floating:c}={},transform:d=!0,whileElementsMounted:p,open:m}=e,[h,x]=f.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[y,v]=f.useState(s);Fu(y,s)||v(s);const[C,j]=f.useState(null),[w,S]=f.useState(null),E=f.useCallback(K=>{K!==R.current&&(R.current=K,j(K))},[]),N=f.useCallback(K=>{K!==$.current&&($.current=K,S(K))},[]),P=l||C,I=c||w,R=f.useRef(null),$=f.useRef(null),D=f.useRef(h),X=p!=null,Z=tm(p),F=tm(i),H=tm(m),J=f.useCallback(()=>{if(!R.current||!$.current)return;const K={placement:t,strategy:n,middleware:y};F.current&&(K.platform=F.current),vD(R.current,$.current,K).then(ae=>{const T={...ae,isPositioned:H.current!==!1};_.current&&!Fu(D.current,T)&&(D.current=T,ws.flushSync(()=>{x(T)}))})},[y,t,n,F,H]);Eu(()=>{m===!1&&D.current.isPositioned&&(D.current.isPositioned=!1,x(K=>({...K,isPositioned:!1})))},[m]);const _=f.useRef(!1);Eu(()=>(_.current=!0,()=>{_.current=!1}),[]),Eu(()=>{if(P&&(R.current=P),I&&($.current=I),P&&I){if(Z.current)return Z.current(P,I,J);J()}},[P,I,J,Z,X]);const W=f.useMemo(()=>({reference:R,floating:$,setReference:E,setFloating:N}),[E,N]),Y=f.useMemo(()=>({reference:P,floating:I}),[P,I]),ie=f.useMemo(()=>{const K={position:n,left:0,top:0};if(!Y.floating)return K;const ae=bb(Y.floating,h.x),T=bb(Y.floating,h.y);return d?{...K,transform:"translate("+ae+"px, "+T+"px)",...Ok(Y.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:ae,top:T}},[n,d,Y.floating,h.x,h.y]);return f.useMemo(()=>({...h,update:J,refs:W,elements:Y,floatingStyles:ie}),[h,J,W,Y,ie])}const kD=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:s,padding:i}=typeof e=="function"?e(n):e;return s&&t(s)?s.current!=null?vb({element:s.current,padding:i}).fn(n):{}:s?vb({element:s,padding:i}).fn(n):{}}}},SD=(e,t)=>{const n=pD(e);return{name:n.name,fn:n.fn,options:[e,t]}},ND=(e,t)=>{const n=mD(e);return{name:n.name,fn:n.fn,options:[e,t]}},CD=(e,t)=>({fn:yD(e).fn,options:[e,t]}),ED=(e,t)=>{const n=hD(e);return{name:n.name,fn:n.fn,options:[e,t]}},TD=(e,t)=>{const n=gD(e);return{name:n.name,fn:n.fn,options:[e,t]}},PD=(e,t)=>{const n=xD(e);return{name:n.name,fn:n.fn,options:[e,t]}},RD=(e,t)=>{const n=kD(e);return{name:n.name,fn:n.fn,options:[e,t]}};var AD="Arrow",_k=f.forwardRef((e,t)=>{const{children:n,width:s=10,height:i=5,...l}=e;return r.jsx(nn.svg,{...l,ref:t,width:s,height:i,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:r.jsx("polygon",{points:"0,0 30,0 15,10"})})});_k.displayName=AD;var DD=_k;function $D(e){const[t,n]=f.useState(void 0);return Zs(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const s=new ResizeObserver(i=>{if(!Array.isArray(i)||!i.length)return;const l=i[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 s.observe(e,{box:"border-box"}),()=>s.unobserve(e)}else n(void 0)},[e]),t}var cg="Popper",[Mk,Fk]=Bo(cg),[LD,zk]=Mk(cg),Bk=e=>{const{__scopePopper:t,children:n}=e,[s,i]=f.useState(null);return r.jsx(LD,{scope:t,anchor:s,onAnchorChange:i,children:n})};Bk.displayName=cg;var Uk="PopperAnchor",Hk=f.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:s,...i}=e,l=zk(Uk,n),c=f.useRef(null),d=Tn(t,c),p=f.useRef(null);return f.useEffect(()=>{const m=p.current;p.current=(s==null?void 0:s.current)||c.current,m!==p.current&&l.onAnchorChange(p.current)}),s?null:r.jsx(nn.div,{...i,ref:d})});Hk.displayName=Uk;var ug="PopperContent",[ID,OD]=Mk(ug),Vk=f.forwardRef((e,t)=>{var oe,he,we,Se,pe,He;const{__scopePopper:n,side:s="bottom",sideOffset:i=0,align:l="center",alignOffset:c=0,arrowPadding:d=0,avoidCollisions:p=!0,collisionBoundary:m=[],collisionPadding:h=0,sticky:x="partial",hideWhenDetached:y=!1,updatePositionStrategy:v="optimized",onPlaced:C,...j}=e,w=zk(ug,n),[S,E]=f.useState(null),N=Tn(t,te=>E(te)),[P,I]=f.useState(null),R=$D(P),$=(R==null?void 0:R.width)??0,D=(R==null?void 0:R.height)??0,X=s+(l!=="center"?"-"+l:""),Z=typeof h=="number"?h:{top:0,right:0,bottom:0,left:0,...h},F=Array.isArray(m)?m:[m],H=F.length>0,J={padding:Z,boundary:F.filter(MD),altBoundary:H},{refs:_,floatingStyles:W,placement:Y,isPositioned:ie,middlewareData:K}=jD({strategy:"fixed",placement:X,whileElementsMounted:(...te)=>fD(...te,{animationFrame:v==="always"}),elements:{reference:w.anchor},middleware:[SD({mainAxis:i+D,alignmentAxis:c}),p&&ND({mainAxis:!0,crossAxis:!1,limiter:x==="partial"?CD():void 0,...J}),p&&ED({...J}),TD({...J,apply:({elements:te,rects:ye,availableWidth:ne,availableHeight:U})=>{const{width:de,height:me}=ye.reference,Fe=te.floating.style;Fe.setProperty("--radix-popper-available-width",`${ne}px`),Fe.setProperty("--radix-popper-available-height",`${U}px`),Fe.setProperty("--radix-popper-anchor-width",`${de}px`),Fe.setProperty("--radix-popper-anchor-height",`${me}px`)}}),P&&RD({element:P,padding:d}),FD({arrowWidth:$,arrowHeight:D}),y&&PD({strategy:"referenceHidden",...J})]}),[ae,T]=qk(Y),M=Oo(C);Zs(()=>{ie&&(M==null||M())},[ie,M]);const q=(oe=K.arrow)==null?void 0:oe.x,L=(he=K.arrow)==null?void 0:he.y,ue=((we=K.arrow)==null?void 0:we.centerOffset)!==0,[fe,B]=f.useState();return Zs(()=>{S&&B(window.getComputedStyle(S).zIndex)},[S]),r.jsx("div",{ref:_.setFloating,"data-radix-popper-content-wrapper":"",style:{...W,transform:ie?W.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:fe,"--radix-popper-transform-origin":[(Se=K.transformOrigin)==null?void 0:Se.x,(pe=K.transformOrigin)==null?void 0:pe.y].join(" "),...((He=K.hide)==null?void 0:He.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:r.jsx(ID,{scope:n,placedSide:ae,onArrowChange:I,arrowX:q,arrowY:L,shouldHideArrow:ue,children:r.jsx(nn.div,{"data-side":ae,"data-align":T,...j,ref:N,style:{...j.style,animation:ie?void 0:"none"}})})})});Vk.displayName=ug;var Wk="PopperArrow",_D={top:"bottom",right:"left",bottom:"top",left:"right"},Kk=f.forwardRef(function(t,n){const{__scopePopper:s,...i}=t,l=OD(Wk,s),c=_D[l.placedSide];return r.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:r.jsx(DD,{...i,ref:n,style:{...i.style,display:"block"}})})});Kk.displayName=Wk;function MD(e){return e!==null}var FD=e=>({name:"transformOrigin",options:e,fn(t){var w,S,E;const{placement:n,rects:s,middlewareData:i}=t,c=((w=i.arrow)==null?void 0:w.centerOffset)!==0,d=c?0:e.arrowWidth,p=c?0:e.arrowHeight,[m,h]=qk(n),x={start:"0%",center:"50%",end:"100%"}[h],y=(((S=i.arrow)==null?void 0:S.x)??0)+d/2,v=(((E=i.arrow)==null?void 0:E.y)??0)+p/2;let C="",j="";return m==="bottom"?(C=c?x:`${y}px`,j=`${-p}px`):m==="top"?(C=c?x:`${y}px`,j=`${s.floating.height+p}px`):m==="right"?(C=`${-p}px`,j=c?x:`${v}px`):m==="left"&&(C=`${s.floating.width+p}px`,j=c?x:`${v}px`),{data:{x:C,y:j}}}});function qk(e){const[t,n="center"]=e.split("-");return[t,n]}var zD=Bk,BD=Hk,UD=Vk,HD=Kk,VD=Symbol("radix.slottable");function WD(e){const t=({children:n})=>r.jsx(r.Fragment,{children:n});return t.displayName=`${e}.Slottable`,t.__radixId=VD,t}var KD=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"}),qD="VisuallyHidden",Gk=f.forwardRef((e,t)=>r.jsx(nn.span,{...e,ref:t,style:{...KD,...e.style}}));Gk.displayName=qD;var GD=Gk,[wd]=Bo("Tooltip",[Fk]),jd=Fk(),Yk="TooltipProvider",YD=700,Wm="tooltip.open",[JD,dg]=wd(Yk),Jk=e=>{const{__scopeTooltip:t,delayDuration:n=YD,skipDelayDuration:s=300,disableHoverableContent:i=!1,children:l}=e,c=f.useRef(!0),d=f.useRef(!1),p=f.useRef(0);return f.useEffect(()=>{const m=p.current;return()=>window.clearTimeout(m)},[]),r.jsx(JD,{scope:t,isOpenDelayedRef:c,delayDuration:n,onOpen:f.useCallback(()=>{window.clearTimeout(p.current),c.current=!1},[]),onClose:f.useCallback(()=>{window.clearTimeout(p.current),p.current=window.setTimeout(()=>c.current=!0,s)},[s]),isPointerInTransitRef:d,onPointerInTransitChange:f.useCallback(m=>{d.current=m},[]),disableHoverableContent:i,children:l})};Jk.displayName=Yk;var Al="Tooltip",[XD,Wl]=wd(Al),Xk=e=>{const{__scopeTooltip:t,children:n,open:s,defaultOpen:i,onOpenChange:l,disableHoverableContent:c,delayDuration:d}=e,p=dg(Al,e.__scopeTooltip),m=jd(t),[h,x]=f.useState(null),y=Oi(),v=f.useRef(0),C=c??p.disableHoverableContent,j=d??p.delayDuration,w=f.useRef(!1),[S,E]=cd({prop:s,defaultProp:i??!1,onChange:$=>{$?(p.onOpen(),document.dispatchEvent(new CustomEvent(Wm))):p.onClose(),l==null||l($)},caller:Al}),N=f.useMemo(()=>S?w.current?"delayed-open":"instant-open":"closed",[S]),P=f.useCallback(()=>{window.clearTimeout(v.current),v.current=0,w.current=!1,E(!0)},[E]),I=f.useCallback(()=>{window.clearTimeout(v.current),v.current=0,E(!1)},[E]),R=f.useCallback(()=>{window.clearTimeout(v.current),v.current=window.setTimeout(()=>{w.current=!0,E(!0),v.current=0},j)},[j,E]);return f.useEffect(()=>()=>{v.current&&(window.clearTimeout(v.current),v.current=0)},[]),r.jsx(zD,{...m,children:r.jsx(XD,{scope:t,contentId:y,open:S,stateAttribute:N,trigger:h,onTriggerChange:x,onTriggerEnter:f.useCallback(()=>{p.isOpenDelayedRef.current?R():P()},[p.isOpenDelayedRef,R,P]),onTriggerLeave:f.useCallback(()=>{C?I():(window.clearTimeout(v.current),v.current=0)},[I,C]),onOpen:P,onClose:I,disableHoverableContent:C,children:n})})};Xk.displayName=Al;var Km="TooltipTrigger",Qk=f.forwardRef((e,t)=>{const{__scopeTooltip:n,...s}=e,i=Wl(Km,n),l=dg(Km,n),c=jd(n),d=f.useRef(null),p=Tn(t,d,i.onTriggerChange),m=f.useRef(!1),h=f.useRef(!1),x=f.useCallback(()=>m.current=!1,[]);return f.useEffect(()=>()=>document.removeEventListener("pointerup",x),[x]),r.jsx(BD,{asChild:!0,...c,children:r.jsx(nn.button,{"aria-describedby":i.open?i.contentId:void 0,"data-state":i.stateAttribute,...s,ref:p,onPointerMove:Lt(e.onPointerMove,y=>{y.pointerType!=="touch"&&!h.current&&!l.isPointerInTransitRef.current&&(i.onTriggerEnter(),h.current=!0)}),onPointerLeave:Lt(e.onPointerLeave,()=>{i.onTriggerLeave(),h.current=!1}),onPointerDown:Lt(e.onPointerDown,()=>{i.open&&i.onClose(),m.current=!0,document.addEventListener("pointerup",x,{once:!0})}),onFocus:Lt(e.onFocus,()=>{m.current||i.onOpen()}),onBlur:Lt(e.onBlur,i.onClose),onClick:Lt(e.onClick,i.onClose)})})});Qk.displayName=Km;var fg="TooltipPortal",[QD,ZD]=wd(fg,{forceMount:void 0}),Zk=e=>{const{__scopeTooltip:t,forceMount:n,children:s,container:i}=e,l=Wl(fg,t);return r.jsx(QD,{scope:t,forceMount:n,children:r.jsx(Uo,{present:n||l.open,children:r.jsx(Mh,{asChild:!0,container:i,children:s})})})};Zk.displayName=fg;var Gi="TooltipContent",e1=f.forwardRef((e,t)=>{const n=ZD(Gi,e.__scopeTooltip),{forceMount:s=n.forceMount,side:i="top",...l}=e,c=Wl(Gi,e.__scopeTooltip);return r.jsx(Uo,{present:s||c.open,children:c.disableHoverableContent?r.jsx(t1,{side:i,...l,ref:t}):r.jsx(e4,{side:i,...l,ref:t})})}),e4=f.forwardRef((e,t)=>{const n=Wl(Gi,e.__scopeTooltip),s=dg(Gi,e.__scopeTooltip),i=f.useRef(null),l=Tn(t,i),[c,d]=f.useState(null),{trigger:p,onClose:m}=n,h=i.current,{onPointerInTransitChange:x}=s,y=f.useCallback(()=>{d(null),x(!1)},[x]),v=f.useCallback((C,j)=>{const w=C.currentTarget,S={x:C.clientX,y:C.clientY},E=o4(S,w.getBoundingClientRect()),N=i4(S,E),P=a4(j.getBoundingClientRect()),I=c4([...N,...P]);d(I),x(!0)},[x]);return f.useEffect(()=>()=>y(),[y]),f.useEffect(()=>{if(p&&h){const C=w=>v(w,h),j=w=>v(w,p);return p.addEventListener("pointerleave",C),h.addEventListener("pointerleave",j),()=>{p.removeEventListener("pointerleave",C),h.removeEventListener("pointerleave",j)}}},[p,h,v,y]),f.useEffect(()=>{if(c){const C=j=>{const w=j.target,S={x:j.clientX,y:j.clientY},E=(p==null?void 0:p.contains(w))||(h==null?void 0:h.contains(w)),N=!l4(S,c);E?y():N&&(y(),m())};return document.addEventListener("pointermove",C),()=>document.removeEventListener("pointermove",C)}},[p,h,c,m,y]),r.jsx(t1,{...e,ref:l})}),[t4,n4]=wd(Al,{isInside:!1}),r4=WD("TooltipContent"),t1=f.forwardRef((e,t)=>{const{__scopeTooltip:n,children:s,"aria-label":i,onEscapeKeyDown:l,onPointerDownOutside:c,...d}=e,p=Wl(Gi,n),m=jd(n),{onClose:h}=p;return f.useEffect(()=>(document.addEventListener(Wm,h),()=>document.removeEventListener(Wm,h)),[h]),f.useEffect(()=>{if(p.trigger){const x=y=>{const v=y.target;v!=null&&v.contains(p.trigger)&&h()};return window.addEventListener("scroll",x,{capture:!0}),()=>window.removeEventListener("scroll",x,{capture:!0})}},[p.trigger,h]),r.jsx(_h,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:l,onPointerDownOutside:c,onFocusOutside:x=>x.preventDefault(),onDismiss:h,children:r.jsxs(UD,{"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:[r.jsx(r4,{children:s}),r.jsx(t4,{scope:n,isInside:!0,children:r.jsx(GD,{id:p.contentId,role:"tooltip",children:i||s})})]})})});e1.displayName=Gi;var n1="TooltipArrow",s4=f.forwardRef((e,t)=>{const{__scopeTooltip:n,...s}=e,i=jd(n);return n4(n1,n).isInside?null:r.jsx(HD,{...i,...s,ref:t})});s4.displayName=n1;function o4(e,t){const n=Math.abs(t.top-e.y),s=Math.abs(t.bottom-e.y),i=Math.abs(t.right-e.x),l=Math.abs(t.left-e.x);switch(Math.min(n,s,i,l)){case l:return"left";case i:return"right";case n:return"top";case s:return"bottom";default:throw new Error("unreachable")}}function i4(e,t,n=5){const s=[];switch(t){case"top":s.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case"bottom":s.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case"left":s.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case"right":s.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n});break}return s}function a4(e){const{top:t,right:n,bottom:s,left:i}=e;return[{x:i,y:t},{x:n,y:t},{x:n,y:s},{x:i,y:s}]}function l4(e,t){const{x:n,y:s}=e;let i=!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,y=p.y;h>s!=y>s&&n<(x-m)*(s-h)/(y-h)+m&&(i=!i)}return i}function c4(e){const t=e.slice();return t.sort((n,s)=>n.x<s.x?-1:n.x>s.x?1:n.y<s.y?-1:n.y>s.y?1:0),u4(t)}function u4(e){if(e.length<=1)return e.slice();const t=[];for(let s=0;s<e.length;s++){const i=e[s];for(;t.length>=2;){const l=t[t.length-1],c=t[t.length-2];if((l.x-c.x)*(i.y-c.y)>=(l.y-c.y)*(i.x-c.x))t.pop();else break}t.push(i)}t.pop();const n=[];for(let s=e.length-1;s>=0;s--){const i=e[s];for(;n.length>=2;){const l=n[n.length-1],c=n[n.length-2];if((l.x-c.x)*(i.y-c.y)>=(l.y-c.y)*(i.x-c.x))n.pop();else break}n.push(i)}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 d4=Jk,f4=Xk,p4=Qk,m4=Zk,r1=e1;const Lo=d4,Nr=f4,Cr=p4,ur=f.forwardRef(({className:e,sideOffset:t=4,...n},s)=>r.jsx(m4,{children:r.jsx(r1,{ref:s,sideOffset:t,className:Te("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})}));ur.displayName=r1.displayName;function pg({items:e,align:t="end"}){const[n,s]=f.useState(!1),i=f.useRef(null);return f.useEffect(()=>{if(!n)return;function l(d){i.current&&!i.current.contains(d.target)&&s(!1)}function c(d){d.key==="Escape"&&s(!1)}return document.addEventListener("mousedown",l),document.addEventListener("keydown",c),()=>{document.removeEventListener("mousedown",l),document.removeEventListener("keydown",c)}},[n]),e.length===0?null:r.jsxs("div",{className:"relative",ref:i,children:[r.jsx("button",{type:"button",onClick:()=>s(l=>!l),className:"shell-action",title:"More actions","aria-haspopup":"true","aria-expanded":n,children:r.jsx(eT,{className:"h-4 w-4"})}),n&&r.jsx("div",{className:Te("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:r.jsx(Lo,{delayDuration:200,children:e.map(l=>{const c=l.icon,d=Te("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=r.jsxs(r.Fragment,{children:[c?r.jsx(c,{className:"h-4 w-4 shrink-0"}):null,r.jsx("span",{className:"block min-w-0 truncate",children:l.label})]});if(l.disabled){const m=r.jsx("span",{tabIndex:0,className:"inline-block w-full outline-none focus-visible:ring-1 focus-visible:ring-ring",children:r.jsx("button",{type:"button",disabled:!0,className:d,children:p})});return l.disabledReason?r.jsxs(Nr,{children:[r.jsx(Cr,{asChild:!0,children:m}),r.jsx(ur,{side:"left",children:l.disabledReason})]},l.key):r.jsx("div",{children:m},l.key)}return l.href?r.jsx(Ee,{to:l.href,className:d,onClick:()=>s(!1),children:p},l.key):r.jsx("button",{type:"button",className:d,onClick:()=>{var m;(m=l.onSelect)==null||m.call(l),s(!1)},children:p},l.key)})})})]})}function wb(e){const t=Date.parse(e);return Number.isNaN(t)?!1:Date.now()-t>10080*60*1e3}function h4(e,t,n={}){const{workspace:s,search:i}=n,{status:l,priority:c,assignee:d,project:p,activity:m}=t;if(s){if(s==="_ungrouped"){if(e.projectWorkspace!==null)return!1}else if(e.projectWorkspace!==s)return!1}if(l&&l!=="all"&&e.status!==l||c&&c!=="all"&&e.priority!==c||m==="stale"&&!wb(e.updated)||m==="fresh"&&wb(e.updated)||d&&d!=="all"&&(e.assignee??"__unassigned__")!==d)return!1;if(p&&p!=="all"){if(p==="__standalone__"){if(e.projectSlug!==null)return!1}else if(e.projectSlug!==p)return!1}if(i){const h=i.trim().toLowerCase();if(h&&!`${e.title} ${e.slug} ${e.projectTitle??"standalone"} ${e.projectSlug??""}`.toLowerCase().includes(h))return!1}return!0}function g4(e){return e.projectSlug===null?`/assignments/${e.id}`:`${e.projectWorkspace?`/w/${e.projectWorkspace}`:""}/projects/${e.projectSlug}/assignments/${e.slug}`}const s1={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 hl=null,Ao=null;function x4(){return hl?Promise.resolve(hl):Ao||(Ao=fetch("/api/config/statuses").then(e=>{if(!e.ok)throw new Error(`HTTP ${e.status}`);return e.json()}).then(e=>(hl=e,Ao=null,e)).catch(()=>(Ao=null,s1)),Ao)}function na(){const[e,t]=f.useState(()=>hl??s1);return f.useEffect(()=>{x4().then(t)},[]),e}function jb(){hl=null,Ao=null}function kd(e,t){const n=e.statuses.find(s=>s.id===t);return(n==null?void 0:n.label)??t.replace(/_/g," ").replace(/\b\w/g,s=>s.toUpperCase())}const kb={critical:0,high:1,medium:2,low:3};function mg(e,t,n){return[...e].sort((i,l)=>{let c=0;switch(t){case"title":c=i.title.localeCompare(l.title);break;case"status":c=i.status.localeCompare(l.status);break;case"priority":c=(kb[i.priority]??99)-(kb[l.priority]??99);break;case"assignee":c=(i.assignee??"").localeCompare(l.assignee??"");break;case"dependencies":c=i.dependsOn.length-l.dependsOn.length;break;case"updated":c=i.updated.localeCompare(l.updated);break}return n==="asc"?c:-c})}function pt({title:e,description:t,actions:n}){return r.jsx("div",{className:"rounded-lg border border-dashed border-border bg-muted/40 px-4 py-6 text-center",children:r.jsxs("div",{className:"mx-auto max-w-xl space-y-2",children:[r.jsx("h3",{className:"text-base font-semibold text-foreground",children:e}),r.jsx("p",{className:"text-sm leading-6 text-muted-foreground",children:t}),n?r.jsx("div",{className:"flex flex-wrap justify-center gap-3 pt-2",children:n}):null]})})}const Sb='a, button, input, select, textarea, [contenteditable="true"], [role="button"], [data-no-drag]';function Sd({columns:e,items:t,getItemId:n,getColumnId:s,renderCard:i,canDrop:l,onMove:c,getExternalDragData:d,onCardContextMenu:p,emptyMessage:m="No cards in this column.",hiddenColumnIds:h,onHideColumn:x,compact:y=!1,dragDisabled:v=!1}){const C=f.useMemo(()=>new Set(h??[]),[h]),j=f.useMemo(()=>e.filter(_=>!C.has(_.id)),[e,C]),w=f.useMemo(()=>e.filter(_=>C.has(_.id)),[e,C]),[S,E]=f.useState(null),[N,P]=f.useState(null),I=f.useRef(null),R=f.useMemo(()=>new Map(t.map(_=>[n(_),_])),[n,t]),$=f.useMemo(()=>j.map(_=>({column:_,items:t.filter(W=>s(W)===_.id)})),[j,s,t]),D=S?R.get(S)??null:null;function X(_){if(!D)return{allowed:!1};const W=s(D);return(l==null?void 0:l({item:D,fromColumnId:W,toColumnId:_}))??{allowed:!0}}function Z(){E(null),P(null)}function F(_,W,Y){if(v)return;const ie=(d==null?void 0:d(W))??null;!c&&!ie||(_.dataTransfer.effectAllowed="move",_.dataTransfer.setData("text/plain",Y),ie&&_.dataTransfer.setData("application/json",JSON.stringify(ie)),c&&E(Y))}function H(_,W,Y){v||!c||!D||!X(W).allowed||(_.preventDefault(),_.dataTransfer.dropEffect="move",P(K=>(K==null?void 0:K.columnId)===W&&K.index===Y?K:{columnId:W,index:Y}))}async function J(_,W,Y){var M;if(_.preventDefault(),v||!c||!D){Z();return}const ie=s(D),ae=(((M=$.find(q=>q.column.id===ie))==null?void 0:M.items)??[]).findIndex(q=>n(q)===n(D));if(!X(W).allowed||ae<0){Z();return}if(ie===W&&(Y===ae||Y===ae+1)){Z();return}try{await c({item:D,fromColumnId:ie,toColumnId:W,fromIndex:ae,toIndex:Y})}finally{Z()}}return r.jsxs("div",{className:"relative overflow-x-auto pb-2",style:{scrollbarColor:"oklch(var(--border)) transparent",scrollbarWidth:"thin"},children:[w.length>0&&x?r.jsxs("div",{className:"mb-2 flex flex-wrap items-center gap-2 text-xs text-muted-foreground",children:[r.jsx("span",{children:"Hidden:"}),w.map(_=>r.jsxs("button",{type:"button",onClick:()=>x(_.id),className:"rounded-full border border-dashed border-border/60 px-2 py-0.5 hover:border-border hover:text-foreground",title:`Restore "${_.title}" column`,children:[_.title," ×"]},_.id))]}):null,r.jsx("div",{className:Te("grid min-w-max grid-flow-col gap-4",y?"auto-cols-[minmax(200px,240px)]":"auto-cols-[minmax(260px,320px)]"),children:$.map(({column:_,items:W})=>{const Y=X(_.id),ie=(N==null?void 0:N.columnId)===_.id;return r.jsxs("section",{className:Te("flex flex-col rounded-lg border border-border/60 bg-card/85 shadow-sm",y?"min-h-[200px] p-2":"min-h-[320px] p-3",D&&!Y.allowed?"border-dashed opacity-65":"",D&&Y.allowed?"border-primary/30 bg-accent/30":"",ie?"ring-2 ring-ring/30":""),title:D&&!Y.allowed?Y.reason:void 0,children:[r.jsxs("div",{className:"mb-3 flex items-start justify-between gap-3",children:[r.jsxs("div",{className:"space-y-1",children:[r.jsx("h2",{className:Te("font-semibold uppercase tracking-[0.16em] text-muted-foreground",y?"text-xs":"text-sm"),children:_.title}),_.description&&!y?r.jsx("p",{className:"text-sm leading-6 text-muted-foreground",children:_.description}):null]}),r.jsxs("div",{className:"flex items-center gap-1",children:[r.jsx("span",{className:"rounded-full border border-border/60 bg-background/80 px-2.5 py-1 text-xs font-semibold text-foreground",children:W.length}),x?r.jsx("button",{type:"button",onClick:()=>x(_.id),className:"rounded-full border border-transparent px-1.5 py-0.5 text-xs text-muted-foreground hover:border-border hover:text-foreground",title:`Hide "${_.title}" column`,"aria-label":`Hide column ${_.title}`,children:"×"}):null]})]}),r.jsxs("div",{className:"flex flex-1 flex-col gap-3",onDragOver:K=>H(K,_.id,W.length),onDrop:K=>J(K,_.id,W.length),children:[W.length===0?v?r.jsx("div",{className:"flex min-h-[128px] items-center justify-center rounded-lg border border-border/60 bg-background/50 px-4 text-center text-sm text-muted-foreground",children:typeof m=="function"?m(_):m}):r.jsx(y4,{active:(N==null?void 0:N.columnId)===_.id&&N.index===0,disabled:!!D&&!Y.allowed,children:typeof m=="function"?m(_):m}):null,W.map((K,ae)=>{const T=n(K),M=S===T;return r.jsxs(f.Fragment,{children:[r.jsx("div",{className:Te("h-2 rounded-full transition",(N==null?void 0:N.columnId)===_.id&&N.index===ae?"bg-primary/70":"bg-transparent"),onDragOver:q=>H(q,_.id,ae),onDrop:q=>J(q,_.id,ae)}),r.jsx("div",{draggable:!v&&!!(c||d),onMouseDown:q=>{I.current=q.target},onDragStart:q=>{const L=I.current;if(L!=null&&L.closest(Sb)){q.preventDefault();return}F(q,K,T)},onDragEnd:Z,onContextMenu:q=>{if(!p)return;const L=q.target;L!=null&&L.closest(Sb)||p(K,q)},className:Te("transition",!v&&(c||d)?"cursor-grab active:cursor-grabbing":"",M?"scale-[0.98] opacity-50":""),children:i(K,{dragging:M})})]},T)}),W.length>0&&!v?r.jsx("div",{className:Te("mt-1 rounded-md border border-dashed px-3 py-2 text-center text-xs text-muted-foreground transition",(N==null?void 0:N.columnId)===_.id&&N.index===W.length?"border-primary/50 bg-primary/10 text-foreground":"border-border/60",D&&!Y.allowed?"opacity-40":""),children:"Drop here to place at the end"}):null]})]},_.id)})})]})}function y4({active:e,disabled:t,children:n}){return r.jsx("div",{className:Te("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 fl="border-status-pending-foreground/30 bg-status-pending text-status-pending-foreground",nm="border-status-in-progress-foreground/30 bg-status-in-progress text-status-in-progress-foreground",v4="border-status-blocked-foreground/30 bg-status-blocked text-status-blocked-foreground",b4="border-status-review-foreground/30 bg-status-review text-status-review-foreground",w4="border-status-completed-foreground/30 bg-status-completed text-status-completed-foreground",j4="border-status-failed-foreground/30 bg-status-failed text-status-failed-foreground",k4="border-status-archived-foreground/30 bg-status-archived text-status-archived-foreground",zu={draft:{label:"Draft",description:"Just-created stub; not yet shaped.",className:fl,icon:zo},pending:{label:"Pending",description:"Waiting to start or waiting on dependencies.",className:fl,icon:Y2},ready_for_planning:{label:"Ready for Planning",description:"Objective and acceptance criteria written; awaiting a plan.",className:fl,icon:A0},ready_to_implement:{label:"Ready to Implement",description:"Plan written and approved; ready to start coding.",className:nm,icon:fT},in_progress:{label:"In Progress",description:"Actively being worked on.",className:nm,icon:Nh},blocked:{label:"Blocked",description:"Blocked by an explicit obstacle that needs intervention.",className:v4,icon:Am},review:{label:"Review",description:"Ready for inspection or approval.",className:b4,icon:hT},completed:{label:"Completed",description:"Finished successfully.",className:w4,icon:wh},failed:{label:"Failed",description:"Could not be completed as planned.",className:j4,icon:Am},active:{label:"Active",description:"The project has active or review work in flight.",className:nm,icon:Dm},stopped:{label:"Stopped",description:"Session ended without completing.",className:fl,icon:q2},archived:{label:"Archived",description:"Archived by a human override.",className:k4,icon:Dm}};function Bu(e){const t=zu[e];return t||{className:fl,icon:Dm,label:e.replace(/_/g," ").replace(/\b\w/g,n=>n.toUpperCase()),description:`Status: ${e}`}}function o1(e,t){return Te("inline-flex items-center gap-1.5 whitespace-nowrap rounded-full border px-2.5 py-0.5 text-xs font-medium tracking-normal","shadow-[inset_0_0_0_1px_oklch(100%_0_0_/_0)] dark:shadow-[inset_0_0_0_1px_oklch(100%_0_0_/_0.04)]",Bu(e).className,t)}function kn({status:e,className:t,showIcon:n=!0,progress:s}){const i=Bu(e),l=i.icon,c=s&&s.total>0,d=c?Math.min(1,Math.max(0,s.checked/s.total)):0,p=c?`${i.description} (${s.checked}/${s.total} criteria)`:i.description,m=n?c?r.jsxs("span",{className:"relative inline-flex h-3.5 w-3.5 items-center justify-center",children:[r.jsxs("svg",{"aria-hidden":"true",viewBox:"0 0 16 16",className:"absolute inset-0 h-full w-full -rotate-90",children:[r.jsx("circle",{cx:"8",cy:"8",r:"7",fill:"none",stroke:"currentColor",strokeOpacity:"0.25",strokeWidth:"1.5"}),r.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)})]}),r.jsx(l,{className:"h-2.5 w-2.5"})]}):r.jsx(l,{className:"h-3.5 w-3.5"}):null;return r.jsxs("span",{title:p,className:o1(e,t),children:[m,r.jsx("span",{children:i.label})]})}function Nd(e){var t;return((t=zu[e])==null?void 0:t.description)??`Status: ${e}`}function Tr({value:e,label:t,disabled:n=!1,disabledReason:s,onError:i}){const[l,c]=f.useState(!1);async function d(){if(!n)try{if(!navigator.clipboard||typeof navigator.clipboard.writeText!="function")throw new Error("Clipboard API is unavailable in this context.");await navigator.clipboard.writeText(e),c(!0),setTimeout(()=>c(!1),1500)}catch(p){i==null||i(p instanceof Error?p:new Error(String(p)))}}return n?r.jsx("button",{type:"button",disabled:!0,"aria-disabled":"true",className:"cursor-not-allowed text-muted-foreground/50",title:s??"Copy unavailable","aria-label":t??"Copy",children:r.jsx(El,{className:"h-3 w-3","aria-hidden":"true"})}):r.jsx("button",{type:"button",onClick:d,className:"text-muted-foreground hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-1 rounded",title:l?"Copied!":t??`Copy: ${e}`,"aria-label":t??"Copy",children:l?r.jsx(Fo,{className:"h-3 w-3 text-status-completed-foreground","aria-hidden":"true"}):r.jsx(El,{className:"h-3 w-3","aria-hidden":"true"})})}const Nb={critical:0,high:1,medium:2,low:3};function S4(e,t,n){return[...e].sort((i,l)=>{let c=0;switch(t){case"title":c=i.title.localeCompare(l.title);break;case"status":c=i.status.localeCompare(l.status);break;case"priority":c=(Nb[i.priority]??99)-(Nb[l.priority]??99);break;case"assignee":c=(i.assignee??"").localeCompare(l.assignee??"");break;case"dependencies":c=i.dependsOn.length-l.dependsOn.length;break;case"updated":c=i.updated.localeCompare(l.updated);break}return n==="asc"?c:-c})}function N4(e){return e.projectSlug===null?`/assignments/${e.id}`:`${e.projectWorkspace?`/w/${e.projectWorkspace}`:""}/projects/${e.projectSlug}/assignments/${e.slug}`}function C4({items:e,statusOrder:t,sortField:n,sortDirection:s,listSectionVisibility:i,compact:l=!1}){const c=na(),[d,p]=f.useState(()=>new Set(i.collapsed));f.useEffect(()=>{p(new Set(i.collapsed))},[i]);const m=h=>{p(x=>{const y=new Set(x);return y.has(h)?y.delete(h):y.add(h),y})};return r.jsx("div",{className:Te("space-y-2",l?"space-y-1.5":"space-y-3"),children:t.map(h=>{const x=S4(e.filter(C=>C.status===h),n,s);if(x.length===0)return null;const y=!d.has(h),v=kd(c,h);return r.jsxs("div",{className:"rounded-lg border border-border/60 bg-card/90",children:[r.jsxs("button",{type:"button",onClick:()=>m(h),className:Te("flex w-full items-center gap-2 text-left",l?"px-3 py-2 text-xs":"px-4 py-3 text-sm"),children:[r.jsx(Io,{className:Te("text-muted-foreground transition-transform",l?"h-3.5 w-3.5":"h-4 w-4",y?"":"-rotate-90")}),r.jsx("span",{className:"font-semibold text-foreground",children:v}),r.jsx("span",{className:Te("rounded-full border border-border/60 text-muted-foreground",l?"px-1.5 py-0 text-[10px]":"px-2 py-0.5 text-xs"),children:x.length})]}),y&&r.jsx("ul",{className:Te("divide-y divide-border/40 border-t border-border/40",l?"text-xs":"text-sm"),children:x.map(C=>{const j=N4(C);return r.jsx("li",{children:r.jsxs(Ee,{to:j,className:Te("flex items-center gap-3 hover:bg-muted/40",l?"px-3 py-1.5":"px-4 py-2.5"),children:[r.jsx("span",{className:"min-w-0 flex-1 truncate font-medium text-foreground",children:C.title}),C.projectTitle?r.jsx("span",{className:"hidden truncate text-muted-foreground sm:inline",children:C.projectTitle}):null,r.jsx("span",{className:"shrink-0 text-muted-foreground",children:pr(C.updated)})]})},`${C.projectSlug??"standalone"}:${C.id}`)})})]},h)})})}const Cb={critical:0,high:1,medium:2,low:3};function E4(e,t,n){return[...e].sort((i,l)=>{let c=0;switch(t){case"title":c=i.title.localeCompare(l.title);break;case"status":c=i.status.localeCompare(l.status);break;case"priority":c=(Cb[i.priority]??99)-(Cb[l.priority]??99);break;case"assignee":c=(i.assignee??"").localeCompare(l.assignee??"");break;case"dependencies":c=i.dependsOn.length-l.dependsOn.length;break;case"updated":c=i.updated.localeCompare(l.updated);break}return n==="asc"?c:-c})}function T4(e){return e.projectSlug===null?`/assignments/${e.id}`:`${e.projectWorkspace?`/w/${e.projectWorkspace}`:""}/projects/${e.projectSlug}/assignments/${e.slug}`}function P4({items:e,sortField:t,sortDirection:n,tableColumnVisibility:s,compact:i=!1}){const l=new Set(s.hidden);l.delete("title");const c=h=>!l.has(h),d=E4(e,t,n),p=i?"py-2 pr-3":"py-3 pr-4",m=i?"text-xs":"text-sm";return r.jsx("div",{className:"overflow-x-auto",children:r.jsxs("table",{className:Te("w-full text-left",m),children:[r.jsx("thead",{children:r.jsxs("tr",{className:"border-b border-border/60 text-muted-foreground",children:[c("title")?r.jsx("th",{className:Te("font-medium",p),children:"Assignment"}):null,c("status")?r.jsx("th",{className:Te("font-medium",p),children:"Status"}):null,c("priority")?r.jsx("th",{className:Te("font-medium",p),children:"Priority"}):null,c("assignee")?r.jsx("th",{className:Te("font-medium",p),children:"Assignee"}):null,c("dependencies")?r.jsx("th",{className:Te("font-medium",p),children:"Dependencies"}):null,c("updated")?r.jsx("th",{className:Te("font-medium",p),children:"Updated"}):null]})}),r.jsx("tbody",{children:d.map(h=>{const x=T4(h),y=`${h.projectSlug??"standalone"}:${h.id}`;return r.jsxs("tr",{className:"border-b border-border/50 last:border-0",children:[c("title")?r.jsxs("td",{className:p,children:[r.jsx(Ee,{to:x,className:"font-semibold text-foreground hover:text-primary",children:h.title}),h.projectTitle?r.jsx("p",{className:"mt-0.5 text-xs text-muted-foreground",children:h.projectTitle}):null]}):null,c("status")?r.jsx("td",{className:p,children:r.jsx(kn,{status:h.status})}):null,c("priority")?r.jsx("td",{className:Te("capitalize text-muted-foreground",p),children:h.priority}):null,c("assignee")?r.jsx("td",{className:Te("text-muted-foreground",p),children:h.assignee??"Unassigned"}):null,c("dependencies")?r.jsx("td",{className:Te("text-muted-foreground",p),children:h.dependsOn.length}):null,c("updated")?r.jsx("td",{className:Te("text-muted-foreground",p),children:pr(h.updated)}):null]},y)})})]})})}function R4(e,t,n){return e.filter(s=>h4(s,t,{workspace:n}))}function A4({viewId:e,onPickAnother:t}){const{view:n,loading:s,error:i,refetch:l}=Ki(e),{data:c,loading:d,error:p}=$h(),m=na(),h=f.useMemo(()=>m.order.map(y=>({id:y,title:kd(m,y),description:Nd(y)})),[m]),x=f.useMemo(()=>{if(!n||!c)return[];const y=R4(c.assignments,n.config.filters,n.workspace);return mg(y,n.config.sortField,n.config.sortDirection)},[c,n]);if(s||d&&!c)return r.jsx(ct,{label:"Loading view…"});if(i)return r.jsxs("div",{className:"rounded-lg border border-border/60 bg-card/85 px-4 py-3 text-sm",children:[r.jsx("p",{className:"font-medium text-foreground",children:"Couldn't load view"}),r.jsx("p",{className:"mt-1 text-xs text-muted-foreground",children:i.message}),r.jsx("button",{type:"button",onClick:()=>l(),className:"shell-action mt-3",children:"Retry"})]});if(!n)return r.jsxs("div",{className:"rounded-lg border border-border/60 bg-card/85 px-4 py-3 text-sm",children:[r.jsx("p",{className:"font-medium text-foreground",children:"View no longer exists"}),r.jsx("p",{className:"mt-1 text-xs text-muted-foreground",children:"The saved view this slot was bound to has been deleted."}),r.jsx("button",{type:"button",onClick:t,className:"shell-action mt-3",children:"Pick another widget"})]});if(p)return r.jsxs("div",{className:"rounded-lg border border-border/60 bg-card/85 px-4 py-3 text-sm",children:[r.jsx("p",{className:"font-medium text-foreground",children:"Couldn't load assignments"}),r.jsx("p",{className:"mt-1 text-xs text-muted-foreground",children:p})]});if(x.length===0)return r.jsx(pt,{title:"No assignments match this view.",description:"Adjust the view's filters to surface different work, or pick another widget for this slot."});switch(n.config.viewMode){case"kanban":return r.jsx(Sd,{compact:!0,columns:h,items:x,getItemId:y=>y.slug||y.id,getColumnId:y=>y.status,hiddenColumnIds:n.config.kanbanColumnVisibility.hidden,renderCard:y=>r.jsx(D4,{item:y})});case"list":return r.jsx(C4,{items:x,statusOrder:m.order,sortField:n.config.sortField,sortDirection:n.config.sortDirection,listSectionVisibility:n.config.listSectionVisibility,compact:!0});case"table":return r.jsx(P4,{items:x,sortField:n.config.sortField,sortDirection:n.config.sortDirection,tableColumnVisibility:n.config.tableColumnVisibility,compact:!0})}}function D4({item:e}){const t=g4(e);return r.jsxs("div",{className:Te("rounded-md border border-border/60 bg-background/85 p-2 shadow-sm"),children:[r.jsxs("div",{className:"flex items-start justify-between gap-2",children:[r.jsxs("div",{className:"min-w-0 flex-1",children:[r.jsx(Ee,{to:t,className:"block truncate text-sm font-semibold text-foreground hover:text-primary",children:e.title}),r.jsx("p",{className:"truncate text-xs text-muted-foreground",children:e.projectTitle??"Standalone"})]}),r.jsx(kn,{status:e.status})]}),r.jsxs("div",{className:"mt-2 flex items-center justify-between gap-2 text-[10px] uppercase tracking-[0.08em] text-muted-foreground",children:[r.jsx("span",{className:"truncate",children:e.assignee??"Unassigned"}),r.jsx("span",{className:"shrink-0",children:pr(e.updated)})]}),e.id?r.jsxs("p",{className:"mt-1 inline-flex items-center gap-1 font-mono text-[10px] text-muted-foreground/70",children:[e.id.slice(0,8),r.jsx(Tr,{value:e.id})]}):null]})}function $4({sessions:e}){return r.jsxs("aside",{"aria-labelledby":"overview-sessions-title",className:"rounded-xl border border-border/60 bg-background/60 shadow-sm",children:[r.jsx("header",{className:"border-b border-border/40 px-4 py-3",children:r.jsx("h3",{id:"overview-sessions-title",className:"text-sm font-semibold text-foreground",children:"Recent Sessions"})}),e.length===0?r.jsxs("div",{className:"px-4 py-6 text-sm",children:[r.jsx("p",{className:"font-medium text-foreground",children:$o.recentSessionsEmptyTitle}),r.jsx("p",{className:"mt-1 text-muted-foreground",children:$o.recentSessionsEmptyHint})]}):r.jsx("ul",{className:"divide-y divide-border/40",children:e.map(t=>r.jsx("li",{children:r.jsx(L4,{session:t})},t.sessionId))})]})}function L4({session:e}){const t=Wt(),[n,s]=f.useState(!1),i=I4(e,t),l=O4(e),c=!e.path;return r.jsxs("div",{className:"flex items-start gap-3 px-4 py-3",children:[r.jsxs("div",{className:"min-w-0 flex-1",children:[r.jsx(Ee,{to:i,className:"block text-sm font-medium text-foreground hover:text-primary focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring rounded-sm",children:e.agent}),r.jsxs("p",{className:"text-xs text-muted-foreground",children:[l," · ",W0(e.started)]}),n&&e.path?r.jsxs("div",{className:"mt-1 space-y-0.5",children:[r.jsx("code",{className:"block w-full select-all rounded bg-muted/40 px-1.5 py-0.5 text-xs text-foreground",children:e.path}),r.jsx("p",{className:"text-[10px] text-muted-foreground",children:$o.recentSessionsCopyFallbackHint})]}):null]}),r.jsx(Tr,{value:e.path,label:$o.recentSessionsCopyPathLabel,disabled:c,disabledReason:$o.recentSessionsCopyPathDisabled,onError:()=>s(!0)})]})}function I4(e,t){return e.projectSlug&&e.assignmentSlug?`${t}/projects/${e.projectSlug}/assignments/${e.assignmentSlug}`:(!e.projectSlug&&e.assignmentSlug,"/agent-sessions")}function O4(e){return e.assignmentSlug&&e.projectSlug?`${e.projectSlug}/${e.assignmentSlug}`:e.assignmentSlug?`standalone/${e.assignmentSlug}`:"standalone"}function _4(){const{data:e,loading:t,error:n}=lj();return t&&!e?r.jsx(ct,{label:"Loading sessions…"}):n?r.jsxs("div",{className:"rounded-lg border border-border/60 bg-card/85 px-4 py-3 text-sm text-muted-foreground",children:[r.jsx("p",{className:"font-medium text-foreground",children:"Couldn't load sessions"}),r.jsx("p",{className:"mt-1 text-xs",children:n})]}):r.jsx($4,{sessions:(e==null?void 0:e.sessions)??[]})}const M4=5;function F4(){const{data:e,loading:t,error:n}=aj();if(t&&!e)return r.jsx(ct,{label:"Loading inventories…"});if(n)return r.jsxs("div",{className:"rounded-lg border border-border/60 bg-card/85 px-4 py-3 text-sm text-muted-foreground",children:[r.jsx("p",{className:"font-medium text-foreground",children:"Couldn't load inventories"}),r.jsx("p",{className:"mt-1 text-xs",children:n})]});const i=((e==null?void 0:e.inventories)??[]).slice(0,M4);return r.jsxs("aside",{"aria-labelledby":"overview-inventories-title",className:"rounded-xl border border-border/60 bg-background/60 shadow-sm",children:[r.jsxs("header",{className:"flex items-center justify-between border-b border-border/40 px-4 py-3",children:[r.jsx("h3",{id:"overview-inventories-title",className:"text-sm font-semibold text-foreground",children:"Inventories"}),r.jsx(Ee,{to:"/inventories",className:"text-xs text-muted-foreground hover:text-foreground",children:"View all →"})]}),i.length===0?r.jsxs("div",{className:"px-4 py-6 text-sm",children:[r.jsx("p",{className:"font-medium text-foreground",children:"No inventories yet."}),r.jsx("p",{className:"mt-1 text-muted-foreground",children:"Create one to track leased resources across agents."})]}):r.jsx("ul",{className:"divide-y divide-border/40",children:i.map(l=>{const c=l.inventory,d=l.active_leases.length,p=l.members.length,m=c.display_name??c.slug;return r.jsx("li",{children:r.jsxs(Ee,{to:`/inventories/${encodeURIComponent(c.slug)}`,className:"flex items-center gap-3 px-4 py-2.5 text-sm hover:bg-muted/40",children:[r.jsx("span",{className:"min-w-0 flex-1 truncate font-medium text-foreground",children:m}),r.jsxs("span",{className:"shrink-0 text-xs text-muted-foreground",children:[d,"/",p," leased"]})]})},c.slug)})})]})}const i1={"saved-view":{title:"Saved view",icon:L0,render:(e,t)=>e.kind!=="saved-view"?null:f.createElement(A4,{viewId:e.viewId,onPickAnother:t.onPickAnother})},"agent-sessions":{title:"Agent sessions",icon:nd,render:()=>f.createElement(_4)},inventories:{title:"Inventories",icon:rd,render:()=>f.createElement(F4)}};function z4({slot:e,onReplace:t,onRemove:n}){if(e.widget===null)return r.jsx("div",{className:"flex min-h-[320px] items-center justify-center rounded-lg border border-dashed border-border/60 bg-card/40 p-3 shadow-sm",children:r.jsxs("button",{type:"button",onClick:t,className:"shell-action inline-flex items-center gap-2",children:[r.jsx(Jt,{className:"h-4 w-4"}),"Add widget"]})});const s=i1[e.widget.kind];if(!s)return r.jsx("div",{className:"min-h-[320px] overflow-auto rounded-lg border border-border/60 bg-card/85 p-3 shadow-sm",children:r.jsxs("div",{className:"rounded-md border border-border/60 bg-background/60 px-3 py-2 text-sm text-muted-foreground",children:["Unknown widget kind: ",e.widget.kind]})});const i=s.icon;return r.jsxs("div",{className:"min-h-[320px] overflow-auto rounded-lg border border-border/60 bg-card/85 p-3 shadow-sm",children:[r.jsxs("header",{className:"mb-2 flex items-center justify-between gap-2",children:[r.jsxs("div",{className:"flex min-w-0 items-center gap-2 text-xs uppercase tracking-[0.12em] text-muted-foreground",children:[r.jsx(i,{className:"h-3.5 w-3.5","aria-hidden":"true"}),r.jsx("span",{className:"truncate",children:r.jsx(B4,{slot:e,fallback:s.title})})]}),r.jsx(pg,{items:[{key:"replace",label:"Replace…",icon:pT,onSelect:t},{key:"remove",label:"Remove",icon:In,destructive:!0,onSelect:n}]})]}),r.jsx("div",{children:s.render(e.widget,{slotId:e.id,onPickAnother:t})})]})}function B4({slot:e,fallback:t}){var i,l;const n=((i=e.widget)==null?void 0:i.kind)==="saved-view"?e.widget.viewId:null,{view:s}=Ki(n);return((l=e.widget)==null?void 0:l.kind)==="saved-view"&&s?r.jsx(r.Fragment,{children:s.name}):r.jsx(r.Fragment,{children:t})}const U4=["agent-sessions","inventories"];function H4({open:e,onOpenChange:t,onSelect:n}){const{views:s,loading:i}=tg();function l(c){n(c),t(!1)}return r.jsx(mr,{open:e,onOpenChange:t,children:r.jsxs(Gn,{className:"max-w-xl",children:[r.jsxs(as,{children:[r.jsx(Yn,{children:"Add a widget"}),r.jsx(ls,{children:"Choose a built-in widget or one of your saved views."})]}),r.jsxs("section",{className:"space-y-2",children:[r.jsx("h3",{className:"text-xs font-semibold uppercase tracking-[0.12em] text-muted-foreground",children:"Built-in widgets"}),r.jsx("ul",{className:"divide-y divide-border/40 rounded-md border border-border/60",children:U4.map(c=>{const d=i1[c],p=d.icon;return r.jsx("li",{children:r.jsxs("button",{type:"button",onClick:()=>l({kind:c}),className:"flex w-full items-center gap-3 px-3 py-2.5 text-left text-sm hover:bg-muted/40",children:[r.jsx(p,{className:"h-4 w-4 text-muted-foreground","aria-hidden":"true"}),r.jsx("span",{className:"font-medium text-foreground",children:d.title})]})},c)})})]}),r.jsxs("section",{className:"space-y-2",children:[r.jsx("h3",{className:"text-xs font-semibold uppercase tracking-[0.12em] text-muted-foreground",children:"Saved views"}),i?r.jsx("div",{className:"rounded-md border border-border/60 px-3 py-4 text-sm text-muted-foreground",children:"Loading saved views…"}):s.length===0?r.jsxs("div",{className:"rounded-md border border-border/60 px-3 py-4 text-sm",children:[r.jsx("p",{className:"font-medium text-foreground",children:"No saved views yet"}),r.jsxs("p",{className:"mt-1 text-xs text-muted-foreground",children:["Save a view from the assignments page first."," ",r.jsx(Ee,{to:"/views",className:"text-foreground underline hover:opacity-80",children:"Manage views →"})]})]}):r.jsx("ul",{className:"max-h-72 divide-y divide-border/40 overflow-auto rounded-md border border-border/60",children:s.map(c=>r.jsx("li",{children:r.jsxs("button",{type:"button",onClick:()=>l({kind:"saved-view",viewId:c.id}),className:"flex w-full items-center gap-3 px-3 py-2.5 text-left text-sm hover:bg-muted/40",children:[r.jsx("span",{className:"min-w-0 flex-1 truncate font-medium text-foreground",children:c.name}),c.workspace!==null?r.jsx("span",{className:"shrink-0 rounded-full border border-border/60 px-2 py-0.5 text-[10px] text-muted-foreground",title:`Scoped to workspace: ${c.workspace}`,children:c.workspace}):null,r.jsx("span",{className:"shrink-0 rounded-full border border-border/60 px-2 py-0.5 text-[10px] capitalize text-muted-foreground",children:c.config.viewMode})]})},c.id))}),!i&&s.some(c=>c.workspace!==null)?r.jsx("p",{className:"text-[11px] text-muted-foreground",children:"Workspace-scoped views on the global Overview will only show items from that workspace."}):null]})]})})}function V4(){const{data:e,loading:t,error:n,refetch:s}=uP(),{data:i}=sj(),{layout:l}=SA(),[c,d]=f.useState(!1),[p,m]=f.useState(null),[h,x]=f.useState(null);ao("list:overview"),Pt({keys:"r",description:"Refresh",scope:"list:overview",handler:()=>{s()}});const y=f.useCallback(S=>{m(S),d(!0)},[]),v=f.useCallback(async S=>{x(null);try{await CA(S)}catch(E){x(E instanceof Error?E.message:String(E))}},[]),C=f.useCallback(S=>{if(p===null)return;const E=l.slots.map((N,P)=>P===p?{...N,widget:S}:N);m(null),v(E)},[l.slots,p,v]),j=f.useCallback(S=>{const E=l.slots.map((N,P)=>P===S?{...N,widget:null}:N);v(E)},[l.slots,v]);if(t&&!e)return r.jsx(ct,{label:"Loading overview…"});if(n||!e)return r.jsx(mt,{error:n||"Overview data is unavailable."});const w={};for(const S of Object.keys(e.segments))for(const E of e.segments[S].items)w[E.id]=E;return r.jsxs("div",{className:"space-y-6",children:[r.jsxs("header",{className:"space-y-2",children:[r.jsx("p",{className:"eyebrow",children:"Workspace Overview"}),r.jsx("h1",{className:"text-4xl font-semibold tracking-display text-foreground md:text-5xl",children:"What needs you today"})]}),r.jsx(dA,{hero:e.hero,itemsById:w}),e.firstRun?r.jsx(cA,{help:i}):null,h?r.jsxs("div",{className:"rounded-md border border-destructive/30 bg-destructive/5 px-3 py-2 text-sm text-destructive",children:["Couldn't save dashboard layout: ",h]}):null,r.jsx("div",{className:"grid grid-cols-1 gap-4 xl:grid-cols-2",children:l.slots.map((S,E)=>r.jsx(z4,{slot:S,index:E,onReplace:()=>y(E),onRemove:()=>j(E)},S.id))}),e.serverStats?r.jsxs("p",{className:"flex items-center gap-2 text-xs text-muted-foreground",children:[r.jsx(Ch,{className:"h-3 w-3","aria-hidden":"true"}),r.jsxs("span",{children:["● ",e.serverStats.totalPorts," ports ·"," ",e.serverStats.deadSessions>0?`${e.serverStats.deadSessions} dead`:"all healthy"]})]}):null,r.jsx(H4,{open:c,onOpenChange:S=>{d(S),S||m(null)},onSelect:C})]})}function W4({term:e,description:t}){return r.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 K4(){const{data:e,loading:t,error:n}=sj(),{openCheatsheet:s}=io();return t?r.jsx(ct,{label:"Loading help…"}):n||!e?r.jsx(mt,{error:n||"Help content is unavailable."}):r.jsxs("div",{className:"space-y-5",children:[r.jsx(Ue,{title:"Keyboard Shortcuts",description:"Navigate the dashboard without reaching for the mouse.",children:r.jsxs("div",{className:"flex flex-wrap items-center gap-3",children:[r.jsx("button",{type:"button",onClick:s,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"}),r.jsxs("span",{className:"text-xs text-muted-foreground",children:["or press ",r.jsx("kbd",{className:"rounded border border-border/70 bg-muted px-1.5 py-0.5 font-mono text-[11px]",children:"?"})," ","anywhere. ",ts("Mod+k")," opens the command palette."]})]})}),r.jsx(Ue,{title:"What Syntaur Is",description:e.whatIsSyntaur.summary,children:r.jsx("div",{className:"grid gap-3 md:grid-cols-3",children:e.whatIsSyntaur.bullets.map(i=>r.jsx("div",{className:"rounded-md border border-border/60 bg-background/80 p-3 text-sm leading-6 text-muted-foreground",children:i},i))})}),r.jsx(Ue,{title:"Getting Started",children:r.jsx("div",{className:"space-y-3",children:e.workflow.map((i,l)=>r.jsx("div",{className:"rounded-md border border-border/60 bg-background/80 p-3",children:r.jsxs("div",{className:"flex items-start gap-3",children:[r.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}),r.jsxs("div",{className:"space-y-2",children:[r.jsx("h3",{className:"font-semibold text-foreground",children:i.title}),r.jsx("p",{className:"text-sm leading-6 text-muted-foreground",children:i.detail}),i.command?r.jsx(Cu,{command:i.command.command,description:i.command.description,example:i.command.example}):null,i.href?r.jsx(Ee,{className:"inline-flex text-sm font-semibold text-primary hover:underline",to:i.href,children:"Open the related surface"}):null]})]})},i.title))})}),r.jsxs("div",{className:"grid gap-3 xl:grid-cols-2",children:[r.jsxs(Ue,{title:"Core Concepts",children:[r.jsx("div",{className:"flex flex-wrap gap-2",children:e.coreConcepts.map(i=>r.jsx(W4,{term:i.term,description:i.description},i.term))}),r.jsx("div",{className:"grid gap-3 pt-2",children:e.coreConcepts.map(i=>r.jsxs("div",{className:"rounded-md border border-border/60 bg-background/80 p-3",children:[r.jsx("h3",{className:"font-semibold text-foreground",children:i.term}),r.jsx("p",{className:"mt-2 text-sm leading-6 text-muted-foreground",children:i.description})]},i.term))})]}),r.jsx(Ue,{title:"Status Guide",children:r.jsx("div",{className:"space-y-3",children:e.statusGuide.map(i=>r.jsxs("div",{className:"rounded-md border border-border/60 bg-background/80 p-3",children:[r.jsxs("div",{className:"flex flex-wrap items-center gap-3",children:[r.jsx(kn,{status:i.status}),r.jsx("p",{className:"font-semibold text-foreground",children:i.meaning})]}),r.jsx("p",{className:"mt-3 text-sm leading-6 text-muted-foreground",children:i.useWhen})]},i.status))})})]}),r.jsxs("div",{className:"grid gap-3 xl:grid-cols-2",children:[r.jsx(Ue,{title:"Ownership And File Rules",children:r.jsx("div",{className:"space-y-3",children:e.ownershipRules.map(i=>r.jsxs("div",{className:"rounded-md border border-border/60 bg-background/80 p-3",children:[r.jsx("h3",{className:"font-semibold text-foreground",children:i.label}),r.jsx("p",{className:"mt-2 text-sm leading-6 text-muted-foreground",children:i.description}),r.jsx("div",{className:"mt-3 flex flex-wrap gap-2",children:i.files.map(l=>r.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))})]},i.label))})}),r.jsx(Ue,{title:"How To Navigate The Dashboard",children:r.jsx("div",{className:"space-y-3",children:e.navigation.map(i=>r.jsxs("div",{className:"rounded-md border border-border/60 bg-background/80 p-3",children:[r.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[r.jsx("h3",{className:"font-semibold text-foreground",children:i.label}),r.jsx(Ee,{className:"text-sm font-semibold text-primary hover:underline",to:i.href,children:"Open"})]}),r.jsx("p",{className:"mt-2 text-sm leading-6 text-muted-foreground",children:i.description})]},i.label))})})]}),r.jsx(Ue,{title:"CLI Quick Reference",children:r.jsx("div",{className:"grid gap-3 xl:grid-cols-2",children:e.commands.map(i=>r.jsx(Cu,{command:i.command,description:i.description,example:i.example},i.command))})}),r.jsxs("div",{className:"grid gap-3 xl:grid-cols-2",children:[r.jsx(Ue,{title:"FAQ",children:r.jsx("div",{className:"space-y-3",children:e.faq.map(i=>r.jsxs("div",{className:"rounded-md border border-border/60 bg-background/80 p-3",children:[r.jsx("h3",{className:"font-semibold text-foreground",children:i.question}),r.jsx("p",{className:"mt-2 text-sm leading-6 text-muted-foreground",children:i.answer})]},i.question))})}),r.jsx(Ue,{title:"First Project Checklist",children:r.jsx("div",{className:"space-y-3",children:e.firstProjectChecklist.map((i,l)=>r.jsx("div",{className:"rounded-md border border-border/60 bg-background/80 p-3",children:r.jsxs("div",{className:"flex items-start gap-3",children:[r.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}),r.jsxs("div",{className:"space-y-2",children:[r.jsx("h3",{className:"font-semibold text-foreground",children:i.title}),r.jsx("p",{className:"text-sm leading-6 text-muted-foreground",children:i.detail}),i.command?r.jsx(Cu,{command:i.command.command,example:i.command.example}):null,i.href?r.jsx(Ee,{className:"inline-flex text-sm font-semibold text-primary hover:underline",to:i.href,children:"Open the related surface"}):null]})]})},i.title))})})]})]})}function hg({children:e}){return r.jsx("div",{className:"chrome-card flex flex-col gap-2 !p-2.5 md:flex-row md:flex-wrap md:items-center",children:e})}const Cd=f.forwardRef(({value:e,onChange:t,placeholder:n="Search"},s)=>r.jsxs("label",{className:"relative flex min-w-[220px] flex-1 items-center",children:[r.jsx(so,{className:"pointer-events-none absolute left-3 h-4 w-4 text-muted-foreground"}),r.jsx("input",{ref:s,value:e,onChange:i=>t(i.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"})]}));Cd.displayName="SearchInput";function gg({value:e,options:t,onChange:n}){return r.jsx("div",{className:"inline-flex rounded-md border border-border/60 bg-background/80 p-1",children:t.map(s=>r.jsx("button",{type:"button",onClick:()=>n(s.value),className:Te("rounded-sm px-2.5 py-1.5 text-sm font-medium transition",e===s.value?"bg-foreground text-background":"text-muted-foreground hover:text-foreground"),children:s.label},s.value))})}const q4={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"},Eb=["bg-primary","bg-secondary","bg-accent-coral","bg-accent-teal","bg-accent-amber"];function Uu({progress:e,className:t,showLegend:n=!1}){const s=na(),i=f.useMemo(()=>{let c=0;return(s.order.length>0?s.order:Object.keys(e).filter(p=>p!=="total")).map(p=>({key:p,className:q4[p]??Eb[c++%Eb.length]}))},[s.order,e]),l=i.filter(c=>(e[c.key]??0)>0);return r.jsxs("div",{className:Te("space-y-2",t),children:[r.jsx("div",{className:"flex h-1.5 w-full overflow-hidden rounded-lg border border-border/70 bg-muted/60",children:e.total===0?r.jsx("div",{className:"h-full w-full bg-muted"}):l.map(c=>r.jsx("div",{className:c.className,style:{width:`${(e[c.key]??0)/e.total*100}%`},title:`${gn(c.key)}: ${e[c.key]??0}`},c.key))}),n?r.jsx("div",{className:"flex flex-wrap gap-2 text-xs text-muted-foreground",children:i.map(c=>r.jsxs("span",{className:"inline-flex items-center gap-2 rounded-full border border-border/60 bg-background/80 px-2 py-1",children:[r.jsx("span",{className:Te("h-2 w-2 rounded-full",c.className)}),r.jsx("span",{children:gn(c.key)}),r.jsx("span",{className:"font-medium text-foreground",children:e[c.key]??0})]},c.key))}):null]})}const G4=["pending","active","blocked","failed","completed","archived"],xg=G4,Y4=["draft","pending","ready_for_planning","ready_to_implement","in_progress","blocked","review","completed","failed"];function a1(e){return e&&e.length>0?e:[...Y4]}function J4(e,t,n){if(t<0||t>=e.length)return e;const s=[...e],[i]=s.splice(t,1),l=t<n?n-1:n;return s.splice(Math.max(0,Math.min(l,s.length)),0,i),s}const X4=220,cu=8;function l1({anchor:e,items:t,onClose:n}){const s=f.useRef(null),[i,l]=f.useState(null);return f.useLayoutEffect(()=>{if(!e){l(null);return}const c=s.current,d=(c==null?void 0:c.offsetWidth)??X4,p=(c==null?void 0:c.offsetHeight)??0,m=Math.max(cu,window.innerWidth-d-cu),h=Math.max(cu,window.innerHeight-p-cu);l({left:Math.min(e.x,m),top:Math.min(e.y,h)})},[e]),f.useEffect(()=>{if(!e)return;function c(m){s.current&&!s.current.contains(m.target)&&n()}function d(m){m.key==="Escape"&&n()}function p(){n()}return document.addEventListener("mousedown",c),document.addEventListener("keydown",d),document.addEventListener("contextmenu",c),window.addEventListener("scroll",p,!0),()=>{document.removeEventListener("mousedown",c),document.removeEventListener("keydown",d),document.removeEventListener("contextmenu",c),window.removeEventListener("scroll",p,!0)}},[e,n]),!e||t.length===0?null:r.jsx("div",{ref:s,role:"menu",className:"fixed z-50 min-w-[220px] rounded-md border border-border/70 bg-background py-1 shadow-lg",style:{left:(i==null?void 0:i.left)??e.x,top:(i==null?void 0:i.top)??e.y,visibility:i?"visible":"hidden"},children:r.jsx(Lo,{delayDuration:200,children:t.map(c=>{const d=c.icon,p=Te("flex w-full items-center gap-2 px-3 py-1.5 text-left text-sm transition",c.disabled?"cursor-not-allowed opacity-50":c.destructive?"text-destructive hover:bg-destructive/10":"hover:bg-foreground/5"),m=r.jsxs(r.Fragment,{children:[d?r.jsx(d,{className:"h-4 w-4 shrink-0"}):null,r.jsx("span",{className:"block min-w-0 truncate",children:c.label})]});if(c.disabled){const h=r.jsx("span",{tabIndex:0,className:"inline-block w-full outline-none focus-visible:ring-1 focus-visible:ring-ring",children:r.jsx("button",{type:"button",disabled:!0,className:p,children:m})});return c.disabledReason?r.jsxs(Nr,{children:[r.jsx(Cr,{asChild:!0,children:h}),r.jsx(ur,{side:"left",children:c.disabledReason})]},c.key):r.jsx("div",{children:h},c.key)}return c.href?r.jsx(Ee,{to:c.href,className:p,onClick:()=>n(),children:m},c.key):r.jsx("button",{type:"button",className:p,onClick:()=>{var h;(h=c.onSelect)==null||h.call(c),n()},children:m},c.key)})})})}const Q4="__ungrouped__";function yg({open:e,onOpenChange:t,currentWorkspace:n,onSubmit:s,title:i="Move to workspace",description:l="Pick the workspace this item should belong to."}){const{data:c,loading:d}=id(),[p,m]=f.useState(n),[h,x]=f.useState(!1),[y,v]=f.useState(null);f.useEffect(()=>{e&&(m(n),v(null))},[e,n]);const C=f.useMemo(()=>[...((c==null?void 0:c.workspaces)??[]).map(E=>({key:E,label:E,value:E})),{key:Q4,label:"Ungrouped",value:null}],[c]),j=!h&&p!==n;async function w(){if(j){x(!0),v(null);try{await s(p),t(!1)}catch(S){v(S instanceof Error?S.message:"Failed to move item")}finally{x(!1)}}}return r.jsx(mr,{open:e,onOpenChange:S=>h?void 0:t(S),children:r.jsxs(Gn,{children:[r.jsxs(as,{children:[r.jsx(Yn,{children:i}),r.jsx(ls,{children:l})]}),r.jsx("div",{className:"my-2 max-h-[320px] overflow-y-auto rounded-md border border-border/60",children:d&&C.length===0?r.jsxs("div",{className:"flex items-center gap-2 px-3 py-3 text-sm text-muted-foreground",children:[r.jsx(Nh,{className:"h-4 w-4 animate-spin"})," Loading workspaces…"]}):C.map(S=>{const E=S.value===n,N=S.value===p;return r.jsxs("button",{type:"button",disabled:E||h,onClick:()=>m(S.value),className:Te("flex w-full items-center justify-between px-3 py-2 text-left text-sm transition",E?"cursor-not-allowed bg-foreground/5 text-muted-foreground":N?"bg-accent/40 text-foreground":"hover:bg-foreground/5"),children:[r.jsxs("span",{className:Te("block min-w-0 truncate",S.value===null?"italic text-muted-foreground":""),children:[S.label,E?r.jsx("span",{className:"ml-2 text-xs",children:"(current)"}):null]}),N?r.jsx(Fo,{className:"h-4 w-4 text-foreground"}):null]},S.key)})}),y?r.jsx("p",{className:"text-sm text-destructive",role:"alert",children:y}):null,r.jsxs(oo,{children:[r.jsx("button",{type:"button",onClick:()=>t(!1),disabled:h,className:"shell-action mt-0 disabled:cursor-not-allowed disabled:opacity-50",children:"Cancel"}),r.jsx("button",{type:"button",onClick:w,disabled:!j,className:"shell-action mt-0 bg-foreground text-background hover:opacity-90 disabled:cursor-not-allowed disabled:opacity-50",children:h?"Moving…":"Move"})]})]})})}function Tb(){const{workspace:e}=At(),t=Wt(),n=Rt(),{data:s,loading:i,error:l,refetch:c}=Zi(),d=f.useRef(null);ao("list:projects");const[p,m]=f.useState(""),[h,x]=f.useState("all"),[y,v]=f.useState("active"),[C,j]=f.useState("all"),[w,S]=f.useState("updated"),[E,N]=is(),P=E.get("view"),I=P==="table"||P==="kanban"?P:"cards",R=T=>{N(M=>{const q=new URLSearchParams(M);return T==="cards"?q.delete("view"):q.set("view",T),q})},[$,D]=f.useState({}),[X,Z]=f.useState(null),[F,H]=f.useState(null),J=f.useMemo(()=>s?s.filter(T=>{if(e){if(e==="_ungrouped"){if(T.workspace!==null)return!1}else if(T.workspace!==e)return!1}return y==="active"&&T.archived||y==="archived"&&!T.archived||h!=="all"&&T.status!==h||C!=="all"&&!T.tags.includes(C)?!1:p.trim()?`${T.title} ${T.tags.join(" ")} ${T.slug}`.toLowerCase().includes(p.toLowerCase()):!0}).sort((T,M)=>t$(T,M,w)):[],[s,p,h,y,C,w,e]),_=J.map(T=>`${T.slug}:${T.status}`).join("|");f.useEffect(()=>{D(n$(J))},[_,w]);const W=f.useMemo(()=>{const T=new Map(J.map(M=>[M.slug,M]));return xg.flatMap(M=>($[M]??J.filter(L=>L.status===M).map(L=>L.slug)).map(L=>T.get(L)).filter(L=>!!L))},[J,$]),{visibleItems:Y,visibleIndexByKey:ie}=f.useMemo(()=>{const T=I==="kanban"?W:J,M=new Map;return T.forEach((q,L)=>M.set(q.slug,L)),{visibleItems:T,visibleIndexByKey:M}},[I,J,W]),{hotkeyRowProps:K}=Hl(Y,{scope:"list:projects",onOpen:T=>n(`${t}/projects/${T.slug}`)});if(Pt({keys:"/",scope:"list:projects",description:"Focus filter",handler:()=>{var T;return(T=d.current)==null?void 0:T.focus()}}),Pt({keys:"r",scope:"list:projects",description:"Refresh",handler:()=>c()}),i)return r.jsx(ct,{label:"Loading projects…"});if(l||!s)return r.jsx(mt,{error:l||"Project list is unavailable."});const ae=Array.from(new Set(s.flatMap(T=>T.tags))).sort();return r.jsxs("div",{className:"space-y-5",children:[r.jsxs(hg,{children:[r.jsx(Cd,{ref:d,value:p,onChange:m,placeholder:"Search by project title or tag"}),r.jsxs("select",{value:h,onChange:T=>x(T.target.value),className:"editor-input max-w-[180px]",children:[r.jsx("option",{value:"all",children:"All statuses"}),r.jsx("option",{value:"pending",children:"Pending"}),r.jsx("option",{value:"active",children:"Active"}),r.jsx("option",{value:"blocked",children:"Blocked"}),r.jsx("option",{value:"failed",children:"Failed"}),r.jsx("option",{value:"completed",children:"Completed"}),r.jsx("option",{value:"archived",children:"Archived"})]}),r.jsxs("select",{value:y,onChange:T=>v(T.target.value),className:"editor-input max-w-[180px]",children:[r.jsx("option",{value:"active",children:"Hide archived"}),r.jsx("option",{value:"all",children:"All projects"}),r.jsx("option",{value:"archived",children:"Archived only"})]}),r.jsxs("select",{value:C,onChange:T=>j(T.target.value),className:"editor-input max-w-[180px]",children:[r.jsx("option",{value:"all",children:"All tags"}),ae.map(T=>r.jsx("option",{value:T,children:T},T))]}),r.jsxs("select",{value:w,onChange:T=>S(T.target.value),className:"editor-input max-w-[180px]",children:[r.jsx("option",{value:"updated",children:"Sort: Updated"}),r.jsx("option",{value:"created",children:"Sort: Created"}),r.jsx("option",{value:"title",children:"Sort: Title"}),r.jsx("option",{value:"attention",children:"Sort: Attention"})]}),r.jsx(gg,{value:I,onChange:T=>R(T),options:[{value:"cards",label:"Cards"},{value:"table",label:"Table"},{value:"kanban",label:"Kanban"}]})]}),J.length===0?s.length===0?r.jsxs("div",{className:"rounded-frame border border-border/60 bg-card px-6 py-16 text-center",children:[r.jsx("p",{className:"eyebrow mx-auto justify-center",children:"Start here"}),r.jsx("h2",{className:"mx-auto mt-4 max-w-2xl text-3xl font-semibold tracking-display text-foreground md:text-4xl",children:"The task manager built for agents, by agents"}),r.jsx("p",{className:"mx-auto mt-3 max-w-xl text-sm leading-6 text-muted-foreground",children:"A project groups assignments, resources, and memories under one objective. Markdown stays authoritative — the dashboard is just a view."}),r.jsxs("div",{className:"mt-6 flex flex-wrap justify-center gap-3",children:[r.jsx(Ee,{className:"shell-action shell-action--solid",to:`${t}/create/project`,children:"Create your first project"}),r.jsx(Ee,{className:"shell-action",to:"/help",children:"Read the spec"})]})]}):r.jsx(pt,{title:"No projects match these filters",description:"Adjust the current search and filters or create a new project.",actions:r.jsx(Ee,{className:"shell-action shell-action--solid",to:`${t}/create/project`,children:"Create Project"})}):I==="cards"?r.jsx("div",{className:"grid gap-3 lg:grid-cols-2 2xl:grid-cols-3",children:J.map((T,M)=>r.jsxs(Ee,{to:`${t}/projects/${T.slug}`,className:"block rounded-lg border border-border/60 bg-card/90 p-3 shadow-sm transition hover:border-primary/40 hover:shadow-md",...K(M),children:[r.jsxs("div",{className:"flex items-start justify-between gap-3",children:[r.jsxs("div",{className:"space-y-1",children:[r.jsx("h2",{className:"text-lg font-semibold text-foreground",children:T.title}),r.jsxs("p",{className:"text-sm text-muted-foreground",children:["Updated ",pr(T.updated)]})]}),r.jsx(kn,{status:T.status})]}),r.jsxs("div",{className:"mt-4 space-y-3",children:[r.jsx(Uu,{progress:T.progress,showLegend:!0}),r.jsx("div",{className:"flex flex-wrap gap-2",children:T.tags.map(q=>r.jsx("span",{className:"rounded-full border border-border/60 bg-background/80 px-2.5 py-1 text-xs text-foreground",children:q},q))}),r.jsxs("div",{className:"grid grid-cols-2 gap-3 text-sm",children:[r.jsxs("div",{className:"rounded-md border border-border/60 bg-background/80 p-3",children:[r.jsx("p",{className:"text-muted-foreground",children:"Needs attention"}),r.jsx("p",{className:"mt-1 font-semibold text-foreground",children:T.needsAttention.blockedCount+T.needsAttention.failedCount})]}),r.jsxs("div",{className:"rounded-md border border-border/60 bg-background/80 p-3",children:[r.jsx("p",{className:"text-muted-foreground",children:"Assignments"}),r.jsx("p",{className:"mt-1 font-semibold text-foreground",children:T.progress.total})]})]})]})]},T.slug))}):I==="table"?r.jsx(Ue,{title:`${J.length} project${J.length===1?"":"s"}`,children:r.jsx("div",{className:"overflow-x-auto",children:r.jsxs("table",{className:"w-full min-w-[760px] text-left text-sm",children:[r.jsx("thead",{children:r.jsxs("tr",{className:"border-b border-border/60 text-muted-foreground",children:[r.jsx("th",{className:"pb-3 font-medium",children:"Project"}),r.jsx("th",{className:"pb-3 font-medium",children:"Status"}),r.jsx("th",{className:"pb-3 font-medium",children:"Progress"}),r.jsx("th",{className:"pb-3 font-medium",children:"Attention"}),r.jsx("th",{className:"pb-3 font-medium",children:"Updated"})]})}),r.jsx("tbody",{children:J.map((T,M)=>r.jsxs("tr",{className:"border-b border-border/50 last:border-0",...K(M),children:[r.jsxs("td",{className:"py-4 pr-4",children:[r.jsx(Ee,{to:`${t}/projects/${T.slug}`,className:"font-semibold text-foreground hover:text-primary",children:T.title}),r.jsx("div",{className:"mt-1 flex flex-wrap gap-2",children:T.tags.map(q=>r.jsx("span",{className:"rounded-full border border-border/60 px-2 py-0.5 text-xs text-muted-foreground",children:q},q))})]}),r.jsx("td",{className:"py-4 pr-4",children:r.jsx(kn,{status:T.status})}),r.jsx("td",{className:"py-4 pr-4",children:r.jsx("div",{className:"min-w-[220px]",children:r.jsx(Uu,{progress:T.progress})})}),r.jsx("td",{className:"py-4 pr-4 text-muted-foreground",children:T.needsAttention.blockedCount+T.needsAttention.failedCount}),r.jsx("td",{className:"py-4 text-muted-foreground",children:pr(T.updated)})]},T.slug))})]})})}):r.jsx(Sd,{columns:e$,items:W,getItemId:T=>T.slug,getColumnId:T=>T.status,canDrop:({fromColumnId:T,toColumnId:M})=>({allowed:!0,reason:T===M?void 0:"This will set a manual status override on the project."}),onMove:({item:T,fromColumnId:M,toColumnId:q,fromIndex:L,toIndex:ue})=>{if(M===q){const fe=$[M]??J.filter(B=>B.status===M).map(B=>B.slug);D(B=>({...B,[M]:J4(fe,L,ue)}));return}fetch(`/api/projects/${T.slug}/status-override`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({status:q})}).then(()=>{window.location.reload()})},getExternalDragData:T=>({type:"project",id:T.slug}),onCardContextMenu:(T,M)=>{M.preventDefault(),Z({project:T,anchor:{x:M.clientX,y:M.clientY}})},emptyMessage:T=>`No ${T.title.toLowerCase()} projects.`,renderCard:(T,{dragging:M})=>{const q=ie.get(T.slug)??-1;return r.jsx("div",{...q>=0?K(q):{},children:r.jsx(r$,{project:T,dragging:M})})}}),r.jsx(l1,{anchor:(X==null?void 0:X.anchor)??null,items:X?[{key:"edit",label:"Edit",icon:zo,onSelect:()=>n(`${t}/projects/${X.project.slug}`)},{key:"move",label:"Move to workspace…",icon:Bl,onSelect:()=>H(X.project)}]:[],onClose:()=>Z(null)}),r.jsx(yg,{open:F!==null,onOpenChange:T=>{T||H(null)},currentWorkspace:(F==null?void 0:F.workspace)??null,title:"Move project to workspace",onSubmit:async T=>{if(!F)return;const M=await fetch(`/api/projects/${encodeURIComponent(F.slug)}/move-workspace`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({workspace:T})});if(!M.ok){const q=await M.json().catch(()=>({}));throw new Error(q.error||"Failed to move project")}c()}}),r.jsx("div",{className:"rounded-lg border border-border/60 bg-card/80 p-3 text-sm text-muted-foreground",children:r.jsxs("div",{className:"flex items-start gap-3",children:[r.jsx(Sh,{className:"mt-0.5 h-4 w-4"}),r.jsxs("p",{children:["Project status is derived from assignment state by default.",I==="kanban"?" Drag projects between columns or use":" Use"," the status override on the project detail page to set a manual status."]})]})})]})}const Z4={pending:"Pending",active:"Active",blocked:"Blocked",failed:"Failed",completed:"Completed",archived:"Archived"},e$=xg.map(e=>({id:e,title:Z4[e],description:Nd(e)}));function t$(e,t,n){switch(n){case"created":return t.created.localeCompare(e.created);case"title":return e.title.localeCompare(t.title);case"attention":return Pb(t)-Pb(e);case"updated":default:return t.updated.localeCompare(e.updated)}}function Pb(e){return e.needsAttention.failedCount*10+e.needsAttention.blockedCount*5+e.needsAttention.openQuestions}function n$(e){return Object.fromEntries(xg.map(t=>[t,e.filter(n=>n.status===t).map(n=>n.slug)]))}function r$({project:e,dragging:t}){const n=Wt();return r.jsxs("div",{className:"rounded-lg border border-border/60 bg-background/85 p-3 shadow-sm",children:[r.jsxs("div",{className:"flex items-start justify-between gap-3",children:[r.jsxs("div",{className:"space-y-1",children:[r.jsx(Ee,{to:`${n}/projects/${e.slug}`,className:"text-base font-semibold text-foreground hover:text-primary",children:e.title}),r.jsxs("p",{className:"text-sm text-muted-foreground",children:["Updated ",pr(e.updated)]})]}),r.jsx(kn,{status:e.status})]}),r.jsx("div",{className:"mt-4",children:r.jsx(Uu,{progress:e.progress})}),r.jsxs("div",{className:"mt-4 flex flex-wrap gap-2",children:[e.tags.map(s=>r.jsx("span",{className:"rounded-full border border-border/60 bg-background/80 px-2.5 py-1 text-xs text-foreground",children:s},s)),r.jsxs("span",{className:"rounded-full border border-border/60 px-2.5 py-1 text-xs text-muted-foreground",children:[e.progress.total," assignments"]}),r.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"]})]}),r.jsx("div",{className:"mt-4 text-xs uppercase tracking-[0.08em] text-muted-foreground",children:t?"Reordering within status":"Derived project lane"})]})}const c1={definitions:[{id:"feature",label:"Feature"},{id:"bug",label:"Bug"},{id:"refactor",label:"Refactor"},{id:"research",label:"Research"},{id:"chore",label:"Chore"}],default:"feature",custom:!1};let Tu=null,ji=null;function s$(){return Tu?Promise.resolve(Tu):ji||(ji=fetch("/api/config/types").then(e=>{if(!e.ok)throw new Error(`HTTP ${e.status}`);return e.json()}).then(e=>(Tu=e,ji=null,e)).catch(()=>(ji=null,c1)),ji)}function vg(){const[e,t]=f.useState(()=>Tu??c1);return f.useEffect(()=>{s$().then(t)},[]),e}function gl(e,t){if(!t)return"—";const n=e.definitions.find(s=>s.id===t);return(n==null?void 0:n.label)??t.replace(/_/g," ").replace(/\b\w/g,s=>s.toUpperCase())}function o$(e,t){return t?e.definitions.find(n=>n.id===t)??null:null}function ra({type:e,className:t,compact:n=!1}){const s=vg();if(!e)return null;const i=o$(s,e),l=(i==null?void 0:i.label)??e.replace(/_/g," ").replace(/\b\w/g,d=>d.toUpperCase()),c=i!=null&&i.color?{backgroundColor:`color-mix(in oklch, ${i.color} 18%, transparent)`,borderColor:`color-mix(in oklch, ${i.color} 50%, transparent)`,color:i.color}:void 0;return r.jsx("span",{title:(i==null?void 0:i.description)??`Type: ${l}`,style:c,className:Te("inline-flex items-center whitespace-nowrap rounded-full border text-xs capitalize",n?"px-2 py-0.5":"px-2.5 py-1",!c&&"border-border/60 text-muted-foreground",t),children:l})}const Rb="inline-flex max-w-[14rem] items-center gap-1 whitespace-nowrap rounded-full border px-2 py-0.5 text-[11px] font-semibold tracking-wide border-border/60 text-muted-foreground",Ab="block min-w-0 truncate";function bg({externalIds:e,className:t}){return e.length===0?null:r.jsx("span",{className:Te("flex flex-wrap items-center gap-1.5",t),children:e.map((n,s)=>{const i=`${n.system}:${n.id}`,l=`${n.system}:${n.id}:${s}`;return n.url!=null&&n.url.length>0?r.jsxs("a",{href:n.url??void 0,target:"_blank",rel:"noopener noreferrer",className:Te(Rb,"transition-colors hover:text-foreground hover:border-foreground/40"),title:`Open ${i} in ${n.system}`,children:[r.jsx("span",{className:Ab,children:i}),r.jsx(Xi,{className:"h-2.5 w-2.5 shrink-0"})]},l):r.jsx("span",{className:Rb,title:i,children:r.jsx("span",{className:Ab,children:i})},l)})})}const i$={default:"chrome-card",info:"rounded-lg border border-primary/30 bg-primary/5 p-3 dark:border-primary/40 dark:bg-primary/10",warn:"rounded-lg border border-warning-foreground/30 bg-warning p-3",danger:"rounded-lg border border-error-foreground/30 bg-error p-3",success:"rounded-lg border border-success-foreground/30 bg-success p-3"};function jn({label:e,value:t,description:n,icon:s,tone:i="default",to:l}){const c=r.jsxs(r.Fragment,{children:[r.jsxs("div",{className:"flex items-start justify-between gap-4",children:[r.jsxs("div",{className:"space-y-1",children:[r.jsx("p",{className:"text-xs font-semibold uppercase tracking-[0.1em] text-muted-foreground",children:e}),r.jsx("p",{className:"text-2xl font-semibold text-foreground",children:t})]}),s?r.jsx("span",{className:"rounded-md border border-border/60 bg-background/80 p-1.5 text-muted-foreground",children:r.jsx(s,{className:"h-5 w-5"})}):null]}),n?r.jsx("p",{className:"mt-2 text-sm leading-5 text-muted-foreground",children:n}):null]}),d=Te(i$[i],l?"block transition hover:-translate-y-0.5 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/40":"");return l?r.jsx(Ee,{to:l,className:d,children:c}):r.jsx("article",{className:d,children:c})}function Db(e){const t=a$(e),n=f.forwardRef((s,i)=>{const{children:l,...c}=s,d=f.Children.toArray(l),p=d.find(c$);if(p){const m=p.props.children,h=d.map(x=>x===p?f.Children.count(m)>1?f.Children.only(null):f.isValidElement(m)?m.props.children:null:x);return r.jsx(t,{...c,ref:i,children:f.isValidElement(m)?f.cloneElement(m,void 0,h):null})}return r.jsx(t,{...c,ref:i,children:l})});return n.displayName=`${e}.Slot`,n}function a$(e){const t=f.forwardRef((n,s)=>{const{children:i,...l}=n;if(f.isValidElement(i)){const c=d$(i),d=u$(l,i.props);return i.type!==f.Fragment&&(d.ref=s?ld(s,c):c),f.cloneElement(i,d)}return f.Children.count(i)>1?f.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var l$=Symbol("radix.slottable");function c$(e){return f.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===l$}function u$(e,t){const n={...t};for(const s in t){const i=e[s],l=t[s];/^on[A-Z]/.test(s)?i&&l?n[s]=(...d)=>{const p=l(...d);return i(...d),p}:i&&(n[s]=i):s==="style"?n[s]={...i,...l}:s==="className"&&(n[s]=[i,l].filter(Boolean).join(" "))}return{...e,...n}}function d$(e){var s,i;let t=(s=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:s.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(i=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:i.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function f$(e){const t=e+"CollectionProvider",[n,s]=Bo(t),[i,l]=n(t,{collectionRef:{current:null},itemMap:new Map}),c=j=>{const{scope:w,children:S}=j,E=Vt.useRef(null),N=Vt.useRef(new Map).current;return r.jsx(i,{scope:w,itemMap:N,collectionRef:E,children:S})};c.displayName=t;const d=e+"CollectionSlot",p=Db(d),m=Vt.forwardRef((j,w)=>{const{scope:S,children:E}=j,N=l(d,S),P=Tn(w,N.collectionRef);return r.jsx(p,{ref:P,children:E})});m.displayName=d;const h=e+"CollectionItemSlot",x="data-radix-collection-item",y=Db(h),v=Vt.forwardRef((j,w)=>{const{scope:S,children:E,...N}=j,P=Vt.useRef(null),I=Tn(w,P),R=l(h,S);return Vt.useEffect(()=>(R.itemMap.set(P,{ref:P,...N}),()=>void R.itemMap.delete(P))),r.jsx(y,{[x]:"",ref:I,children:E})});v.displayName=h;function C(j){const w=l(e+"CollectionConsumer",j);return Vt.useCallback(()=>{const E=w.collectionRef.current;if(!E)return[];const N=Array.from(E.querySelectorAll(`[${x}]`));return Array.from(w.itemMap.values()).sort((R,$)=>N.indexOf(R.ref.current)-N.indexOf($.ref.current))},[w.collectionRef,w.itemMap])}return[{Provider:c,Slot:m,ItemSlot:v},C,s]}var p$=f.createContext(void 0);function u1(e){const t=f.useContext(p$);return e||t||"ltr"}var rm="rovingFocusGroup.onEntryFocus",m$={bubbles:!1,cancelable:!0},Kl="RovingFocusGroup",[qm,d1,h$]=f$(Kl),[g$,f1]=Bo(Kl,[h$]),[x$,y$]=g$(Kl),p1=f.forwardRef((e,t)=>r.jsx(qm.Provider,{scope:e.__scopeRovingFocusGroup,children:r.jsx(qm.Slot,{scope:e.__scopeRovingFocusGroup,children:r.jsx(v$,{...e,ref:t})})}));p1.displayName=Kl;var v$=f.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:s,loop:i=!1,dir:l,currentTabStopId:c,defaultCurrentTabStopId:d,onCurrentTabStopIdChange:p,onEntryFocus:m,preventScrollOnEntryFocus:h=!1,...x}=e,y=f.useRef(null),v=Tn(t,y),C=u1(l),[j,w]=cd({prop:c,defaultProp:d??null,onChange:p,caller:Kl}),[S,E]=f.useState(!1),N=Oo(m),P=d1(n),I=f.useRef(!1),[R,$]=f.useState(0);return f.useEffect(()=>{const D=y.current;if(D)return D.addEventListener(rm,N),()=>D.removeEventListener(rm,N)},[N]),r.jsx(x$,{scope:n,orientation:s,dir:C,loop:i,currentTabStopId:j,onItemFocus:f.useCallback(D=>w(D),[w]),onItemShiftTab:f.useCallback(()=>E(!0),[]),onFocusableItemAdd:f.useCallback(()=>$(D=>D+1),[]),onFocusableItemRemove:f.useCallback(()=>$(D=>D-1),[]),children:r.jsx(nn.div,{tabIndex:S||R===0?-1:0,"data-orientation":s,...x,ref:v,style:{outline:"none",...e.style},onMouseDown:Lt(e.onMouseDown,()=>{I.current=!0}),onFocus:Lt(e.onFocus,D=>{const X=!I.current;if(D.target===D.currentTarget&&X&&!S){const Z=new CustomEvent(rm,m$);if(D.currentTarget.dispatchEvent(Z),!Z.defaultPrevented){const F=P().filter(Y=>Y.focusable),H=F.find(Y=>Y.active),J=F.find(Y=>Y.id===j),W=[H,J,...F].filter(Boolean).map(Y=>Y.ref.current);g1(W,h)}}I.current=!1}),onBlur:Lt(e.onBlur,()=>E(!1))})})}),m1="RovingFocusGroupItem",h1=f.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:s=!0,active:i=!1,tabStopId:l,children:c,...d}=e,p=Oi(),m=l||p,h=y$(m1,n),x=h.currentTabStopId===m,y=d1(n),{onFocusableItemAdd:v,onFocusableItemRemove:C,currentTabStopId:j}=h;return f.useEffect(()=>{if(s)return v(),()=>C()},[s,v,C]),r.jsx(qm.ItemSlot,{scope:n,id:m,focusable:s,active:i,children:r.jsx(nn.span,{tabIndex:x?0:-1,"data-orientation":h.orientation,...d,ref:t,onMouseDown:Lt(e.onMouseDown,w=>{s?h.onItemFocus(m):w.preventDefault()}),onFocus:Lt(e.onFocus,()=>h.onItemFocus(m)),onKeyDown:Lt(e.onKeyDown,w=>{if(w.key==="Tab"&&w.shiftKey){h.onItemShiftTab();return}if(w.target!==w.currentTarget)return;const S=j$(w,h.orientation,h.dir);if(S!==void 0){if(w.metaKey||w.ctrlKey||w.altKey||w.shiftKey)return;w.preventDefault();let N=y().filter(P=>P.focusable).map(P=>P.ref.current);if(S==="last")N.reverse();else if(S==="prev"||S==="next"){S==="prev"&&N.reverse();const P=N.indexOf(w.currentTarget);N=h.loop?k$(N,P+1):N.slice(P+1)}setTimeout(()=>g1(N))}}),children:typeof c=="function"?c({isCurrentTabStop:x,hasTabStop:j!=null}):c})})});h1.displayName=m1;var b$={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function w$(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function j$(e,t,n){const s=w$(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(s))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(s)))return b$[s]}function g1(e,t=!1){const n=document.activeElement;for(const s of e)if(s===n||(s.focus({preventScroll:t}),document.activeElement!==n))return}function k$(e,t){return e.map((n,s)=>e[(t+s)%e.length])}var S$=p1,N$=h1,Ed="Tabs",[C$]=Bo(Ed,[f1]),x1=f1(),[E$,wg]=C$(Ed),y1=f.forwardRef((e,t)=>{const{__scopeTabs:n,value:s,onValueChange:i,defaultValue:l,orientation:c="horizontal",dir:d,activationMode:p="automatic",...m}=e,h=u1(d),[x,y]=cd({prop:s,onChange:i,defaultProp:l??"",caller:Ed});return r.jsx(E$,{scope:n,baseId:Oi(),value:x,onValueChange:y,orientation:c,dir:h,activationMode:p,children:r.jsx(nn.div,{dir:h,"data-orientation":c,...m,ref:t})})});y1.displayName=Ed;var v1="TabsList",b1=f.forwardRef((e,t)=>{const{__scopeTabs:n,loop:s=!0,...i}=e,l=wg(v1,n),c=x1(n);return r.jsx(S$,{asChild:!0,...c,orientation:l.orientation,dir:l.dir,loop:s,children:r.jsx(nn.div,{role:"tablist","aria-orientation":l.orientation,...i,ref:t})})});b1.displayName=v1;var w1="TabsTrigger",j1=f.forwardRef((e,t)=>{const{__scopeTabs:n,value:s,disabled:i=!1,...l}=e,c=wg(w1,n),d=x1(n),p=N1(c.baseId,s),m=C1(c.baseId,s),h=s===c.value;return r.jsx(N$,{asChild:!0,...d,focusable:!i,active:h,children:r.jsx(nn.button,{type:"button",role:"tab","aria-selected":h,"aria-controls":m,"data-state":h?"active":"inactive","data-disabled":i?"":void 0,disabled:i,id:p,...l,ref:t,onMouseDown:Lt(e.onMouseDown,x=>{!i&&x.button===0&&x.ctrlKey===!1?c.onValueChange(s):x.preventDefault()}),onKeyDown:Lt(e.onKeyDown,x=>{[" ","Enter"].includes(x.key)&&c.onValueChange(s)}),onFocus:Lt(e.onFocus,()=>{const x=c.activationMode!=="manual";!h&&!i&&x&&c.onValueChange(s)})})})});j1.displayName=w1;var k1="TabsContent",S1=f.forwardRef((e,t)=>{const{__scopeTabs:n,value:s,forceMount:i,children:l,...c}=e,d=wg(k1,n),p=N1(d.baseId,s),m=C1(d.baseId,s),h=s===d.value,x=f.useRef(h);return f.useEffect(()=>{const y=requestAnimationFrame(()=>x.current=!1);return()=>cancelAnimationFrame(y)},[]),r.jsx(Uo,{present:i||h,children:({present:y})=>r.jsx(nn.div,{"data-state":h?"active":"inactive","data-orientation":d.orientation,role:"tabpanel","aria-labelledby":p,hidden:!y,id:m,tabIndex:0,...c,ref:t,style:{...e.style,animationDuration:x.current?"0s":void 0},children:y&&l})})});S1.displayName=k1;function N1(e,t){return`${e}-trigger-${t}`}function C1(e,t){return`${e}-content-${t}`}var E1=y1,T1=b1,Gm=j1,Ym=S1;function jg({value:e,onValueChange:t,items:n,className:s}){return r.jsxs(E1,{value:e,onValueChange:t,className:s,children:[r.jsx(T1,{className:"scrollbar-none flex gap-2 overflow-x-auto rounded-md border border-border/70 bg-card/80 p-1",children:n.map(i=>r.jsxs(Gm,{value:i.value,className:Te("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:[r.jsx("span",{children:i.label}),typeof i.count=="number"?r.jsx("span",{className:"rounded-full bg-background/20 px-2 py-0.5 text-xs data-[state=active]:bg-background/20",children:i.count}):null]},i.value))}),n.map(i=>r.jsx(Ym,{value:i.value,className:"pt-3",children:i.content},i.value))]})}const T$="modulepreload",P$=function(e){return"/"+e},$b={},R$=function(t,n,s){let i=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"));i=c(n.map(m=>{if(m=P$(m),m in $b)return;$b[m]=!0;const h=m.endsWith(".css"),x=h?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${m}"]${x}`))return;const y=document.createElement("link");if(y.rel=h?"stylesheet":T$,h||(y.as="script"),y.crossOrigin="",y.href=m,p&&y.setAttribute("nonce",p),document.head.appendChild(y),h)return new Promise((v,C)=>{y.addEventListener("load",v),y.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 i.then(c=>{for(const d of c||[])d.status==="rejected"&&l(d.reason);return t().catch(l)})};function A$({definition:e,className:t,nodeRoutes:n={}}){const s=f.useRef(null),[i,l]=f.useState(null),[c,d]=f.useState(!0),p=Rt(),m=document.documentElement.classList.contains("dark")?"dark":"default";return f.useEffect(()=>{let h=!1;async function x(){if(s.current)try{const y=(await R$(async()=>{const{default:j}=await import("./mermaid.core-D5JD5uYg.js").then(w=>w.bF);return{default:j}},[])).default;if(y.initialize({startOnLoad:!1,theme:"base",themeVariables:D$(m==="dark")}),h)return;const v=`mermaid-${Date.now()}`,{svg:C}=await y.render(v,e);if(h||!s.current)return;s.current.innerHTML=C,$$(s.current,n,p),d(!1)}catch(y){h||(l(y instanceof Error?y.message:"Failed to render graph"),d(!1))}}return d(!0),l(null),x(),()=>{h=!0}},[e,p,n,m]),i?r.jsxs("div",{className:Te("rounded-lg border border-border bg-card p-4",t),children:[r.jsxs("p",{className:"text-sm text-error-foreground",children:["Failed to render dependency graph: ",i]}),r.jsx("pre",{className:"mt-2 text-xs text-muted-foreground overflow-auto",children:e})]}):r.jsxs("div",{className:Te("rounded-lg border border-border bg-card p-4",t),children:[c&&r.jsx("p",{className:"text-sm text-muted-foreground",children:"Loading graph..."}),r.jsx("div",{ref:s,className:"overflow-auto"})]})}function D$(e){const t=document.documentElement,n=x=>{const y=getComputedStyle(t).getPropertyValue(x).trim();return y?`oklch(${y})`:""},s=n("--card"),i=n("--card-foreground"),l=n("--border"),c=n("--primary"),d=n("--primary-foreground"),p=n("--muted"),m=n("--muted-foreground"),h=n("--secondary");return{background:s,primaryColor:s,primaryTextColor:i,primaryBorderColor:l,secondaryColor:p,secondaryTextColor:i,secondaryBorderColor:l,tertiaryColor:p,tertiaryTextColor:m,tertiaryBorderColor:l,lineColor:e?m:l,textColor:i,mainBkg:s,nodeBkg:s,nodeTextColor:i,nodeBorder:l,clusterBkg:p,clusterBorder:l,edgeLabelBackground:s,titleColor:i,activeTaskBkgColor:c,activeTaskBorderColor:c,altBackground:p,labelColor:i,errorBkgColor:h,errorTextColor:d}}function $$(e,t,n){var s;for(const i of e.querySelectorAll(".node")){const l=((s=i.textContent)==null?void 0:s.replace(/\s+/g," ").trim())??"",c=t[l];if(!c)continue;i.style.cursor="pointer",i.setAttribute("role","link"),i.setAttribute("tabindex","0"),i.setAttribute("aria-label",`Open ${l}`);const d=()=>n(c);i.addEventListener("click",d),i.addEventListener("keydown",p=>{(p.key==="Enter"||p.key===" ")&&(p.preventDefault(),d())})}}function L$(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const I$=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,O$=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,_$={};function Lb(e,t){return(_$.jsx?O$:I$).test(e)}const M$=/[ \t\n\f\r]/g;function F$(e){return typeof e=="object"?e.type==="text"?Ib(e.value):!1:Ib(e)}function Ib(e){return e.replace(M$,"")===""}class ql{constructor(t,n,s){this.normal=n,this.property=t,s&&(this.space=s)}}ql.prototype.normal={};ql.prototype.property={};ql.prototype.space=void 0;function P1(e,t){const n={},s={};for(const i of e)Object.assign(n,i.property),Object.assign(s,i.normal);return new ql(n,s,t)}function Jm(e){return e.toLowerCase()}class Jn{constructor(t,n){this.attribute=n,this.property=t}}Jn.prototype.attribute="";Jn.prototype.booleanish=!1;Jn.prototype.boolean=!1;Jn.prototype.commaOrSpaceSeparated=!1;Jn.prototype.commaSeparated=!1;Jn.prototype.defined=!1;Jn.prototype.mustUseProperty=!1;Jn.prototype.number=!1;Jn.prototype.overloadedBoolean=!1;Jn.prototype.property="";Jn.prototype.spaceSeparated=!1;Jn.prototype.space=void 0;let z$=0;const st=Ho(),Zt=Ho(),Xm=Ho(),Ne=Ho(),jt=Ho(),Bi=Ho(),ar=Ho();function Ho(){return 2**++z$}const Qm=Object.freeze(Object.defineProperty({__proto__:null,boolean:st,booleanish:Zt,commaOrSpaceSeparated:ar,commaSeparated:Bi,number:Ne,overloadedBoolean:Xm,spaceSeparated:jt},Symbol.toStringTag,{value:"Module"})),sm=Object.keys(Qm);class kg extends Jn{constructor(t,n,s,i){let l=-1;if(super(t,n),Ob(this,"space",i),typeof s=="number")for(;++l<sm.length;){const c=sm[l];Ob(this,sm[l],(s&Qm[c])===Qm[c])}}}kg.prototype.defined=!0;function Ob(e,t,n){n&&(e[t]=n)}function sa(e){const t={},n={};for(const[s,i]of Object.entries(e.properties)){const l=new kg(s,e.transform(e.attributes||{},s),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(s)&&(l.mustUseProperty=!0),t[s]=l,n[Jm(s)]=s,n[Jm(l.attribute)]=s}return new ql(t,n,e.space)}const R1=sa({properties:{ariaActiveDescendant:null,ariaAtomic:Zt,ariaAutoComplete:null,ariaBusy:Zt,ariaChecked:Zt,ariaColCount:Ne,ariaColIndex:Ne,ariaColSpan:Ne,ariaControls:jt,ariaCurrent:null,ariaDescribedBy:jt,ariaDetails:null,ariaDisabled:Zt,ariaDropEffect:jt,ariaErrorMessage:null,ariaExpanded:Zt,ariaFlowTo:jt,ariaGrabbed:Zt,ariaHasPopup:null,ariaHidden:Zt,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:jt,ariaLevel:Ne,ariaLive:null,ariaModal:Zt,ariaMultiLine:Zt,ariaMultiSelectable:Zt,ariaOrientation:null,ariaOwns:jt,ariaPlaceholder:null,ariaPosInSet:Ne,ariaPressed:Zt,ariaReadOnly:Zt,ariaRelevant:null,ariaRequired:Zt,ariaRoleDescription:jt,ariaRowCount:Ne,ariaRowIndex:Ne,ariaRowSpan:Ne,ariaSelected:Zt,ariaSetSize:Ne,ariaSort:null,ariaValueMax:Ne,ariaValueMin:Ne,ariaValueNow:Ne,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function A1(e,t){return t in e?e[t]:t}function D1(e,t){return A1(e,t.toLowerCase())}const B$=sa({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:Bi,acceptCharset:jt,accessKey:jt,action:null,allow:null,allowFullScreen:st,allowPaymentRequest:st,allowUserMedia:st,alt:null,as:null,async:st,autoCapitalize:null,autoComplete:jt,autoFocus:st,autoPlay:st,blocking:jt,capture:null,charSet:null,checked:st,cite:null,className:jt,cols:Ne,colSpan:null,content:null,contentEditable:Zt,controls:st,controlsList:jt,coords:Ne|Bi,crossOrigin:null,data:null,dateTime:null,decoding:null,default:st,defer:st,dir:null,dirName:null,disabled:st,download:Xm,draggable:Zt,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:st,formTarget:null,headers:jt,height:Ne,hidden:Xm,high:Ne,href:null,hrefLang:null,htmlFor:jt,httpEquiv:jt,id:null,imageSizes:null,imageSrcSet:null,inert:st,inputMode:null,integrity:null,is:null,isMap:st,itemId:null,itemProp:jt,itemRef:jt,itemScope:st,itemType:jt,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:st,low:Ne,manifest:null,max:null,maxLength:Ne,media:null,method:null,min:null,minLength:Ne,multiple:st,muted:st,name:null,nonce:null,noModule:st,noValidate:st,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:st,optimum:Ne,pattern:null,ping:jt,placeholder:null,playsInline:st,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:st,referrerPolicy:null,rel:jt,required:st,reversed:st,rows:Ne,rowSpan:Ne,sandbox:jt,scope:null,scoped:st,seamless:st,selected:st,shadowRootClonable:st,shadowRootDelegatesFocus:st,shadowRootMode:null,shape:null,size:Ne,sizes:null,slot:null,span:Ne,spellCheck:Zt,src:null,srcDoc:null,srcLang:null,srcSet:null,start:Ne,step:null,style:null,tabIndex:Ne,target:null,title:null,translate:null,type:null,typeMustMatch:st,useMap:null,value:Zt,width:Ne,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:jt,axis:null,background:null,bgColor:null,border:Ne,borderColor:null,bottomMargin:Ne,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:st,declare:st,event:null,face:null,frame:null,frameBorder:null,hSpace:Ne,leftMargin:Ne,link:null,longDesc:null,lowSrc:null,marginHeight:Ne,marginWidth:Ne,noResize:st,noHref:st,noShade:st,noWrap:st,object:null,profile:null,prompt:null,rev:null,rightMargin:Ne,rules:null,scheme:null,scrolling:Zt,standby:null,summary:null,text:null,topMargin:Ne,valueType:null,version:null,vAlign:null,vLink:null,vSpace:Ne,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:st,disableRemotePlayback:st,prefix:null,property:null,results:Ne,security:null,unselectable:null},space:"html",transform:D1}),U$=sa({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:ar,accentHeight:Ne,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:Ne,amplitude:Ne,arabicForm:null,ascent:Ne,attributeName:null,attributeType:null,azimuth:Ne,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:Ne,by:null,calcMode:null,capHeight:Ne,className:jt,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:Ne,diffuseConstant:Ne,direction:null,display:null,dur:null,divisor:Ne,dominantBaseline:null,download:st,dx:null,dy:null,edgeMode:null,editable:null,elevation:Ne,enableBackground:null,end:null,event:null,exponent:Ne,externalResourcesRequired:null,fill:null,fillOpacity:Ne,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:Bi,g2:Bi,glyphName:Bi,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:Ne,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:Ne,horizOriginX:Ne,horizOriginY:Ne,id:null,ideographic:Ne,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:Ne,k:Ne,k1:Ne,k2:Ne,k3:Ne,k4:Ne,kernelMatrix:ar,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:Ne,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:Ne,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:Ne,overlineThickness:Ne,paintOrder:null,panose1:null,path:null,pathLength:Ne,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:jt,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:Ne,pointsAtY:Ne,pointsAtZ:Ne,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:ar,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:ar,rev:ar,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:ar,requiredFeatures:ar,requiredFonts:ar,requiredFormats:ar,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:Ne,specularExponent:Ne,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:Ne,strikethroughThickness:Ne,string:null,stroke:null,strokeDashArray:ar,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:Ne,strokeOpacity:Ne,strokeWidth:null,style:null,surfaceScale:Ne,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:ar,tabIndex:Ne,tableValues:null,target:null,targetX:Ne,targetY:Ne,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:ar,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:Ne,underlineThickness:Ne,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:Ne,values:null,vAlphabetic:Ne,vMathematical:Ne,vectorEffect:null,vHanging:Ne,vIdeographic:Ne,version:null,vertAdvY:Ne,vertOriginX:Ne,vertOriginY:Ne,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:Ne,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:A1}),$1=sa({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()}}),L1=sa({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:D1}),I1=sa({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),H$={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"},V$=/[A-Z]/g,_b=/-[a-z]/g,W$=/^data[-\w.:]+$/i;function K$(e,t){const n=Jm(t);let s=t,i=Jn;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&W$.test(t)){if(t.charAt(4)==="-"){const l=t.slice(5).replace(_b,G$);s="data"+l.charAt(0).toUpperCase()+l.slice(1)}else{const l=t.slice(4);if(!_b.test(l)){let c=l.replace(V$,q$);c.charAt(0)!=="-"&&(c="-"+c),t="data"+c}}i=kg}return new i(s,t)}function q$(e){return"-"+e.toLowerCase()}function G$(e){return e.charAt(1).toUpperCase()}const Y$=P1([R1,B$,$1,L1,I1],"html"),Sg=P1([R1,U$,$1,L1,I1],"svg");function J$(e){return e.join(" ").trim()}var ki={},om,Mb;function X$(){if(Mb)return om;Mb=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,t=/\n/g,n=/^\s*/,s=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,i=/^:\s*/,l=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,c=/^[;\s]*/,d=/^\s+|\s+$/g,p=`
|
|
501
|
+
`,m="/",h="*",x="",y="comment",v="declaration";function C(w,S){if(typeof w!="string")throw new TypeError("First argument must be a string");if(!w)return[];S=S||{};var E=1,N=1;function P(_){var W=_.match(t);W&&(E+=W.length);var Y=_.lastIndexOf(p);N=~Y?_.length-Y:N+_.length}function I(){var _={line:E,column:N};return function(W){return W.position=new R(_),X(),W}}function R(_){this.start=_,this.end={line:E,column:N},this.source=S.source}R.prototype.content=w;function $(_){var W=new Error(S.source+":"+E+":"+N+": "+_);if(W.reason=_,W.filename=S.source,W.line=E,W.column=N,W.source=w,!S.silent)throw W}function D(_){var W=_.exec(w);if(W){var Y=W[0];return P(Y),w=w.slice(Y.length),W}}function X(){D(n)}function Z(_){var W;for(_=_||[];W=F();)W!==!1&&_.push(W);return _}function F(){var _=I();if(!(m!=w.charAt(0)||h!=w.charAt(1))){for(var W=2;x!=w.charAt(W)&&(h!=w.charAt(W)||m!=w.charAt(W+1));)++W;if(W+=2,x===w.charAt(W-1))return $("End of comment missing");var Y=w.slice(2,W-2);return N+=2,P(Y),w=w.slice(W),N+=2,_({type:y,comment:Y})}}function H(){var _=I(),W=D(s);if(W){if(F(),!D(i))return $("property missing ':'");var Y=D(l),ie=_({type:v,property:j(W[0].replace(e,x)),value:Y?j(Y[0].replace(e,x)):x});return D(c),ie}}function J(){var _=[];Z(_);for(var W;W=H();)W!==!1&&(_.push(W),Z(_));return _}return X(),J()}function j(w){return w?w.replace(d,x):x}return om=C,om}var Fb;function Q$(){if(Fb)return ki;Fb=1;var e=ki&&ki.__importDefault||function(s){return s&&s.__esModule?s:{default:s}};Object.defineProperty(ki,"__esModule",{value:!0}),ki.default=n;const t=e(X$());function n(s,i){let l=null;if(!s||typeof s!="string")return l;const c=(0,t.default)(s),d=typeof i=="function";return c.forEach(p=>{if(p.type!=="declaration")return;const{property:m,value:h}=p;d?i(m,h,p):h&&(l=l||{},l[m]=h)}),l}return ki}var sl={},zb;function Z$(){if(zb)return sl;zb=1,Object.defineProperty(sl,"__esModule",{value:!0}),sl.camelCase=void 0;var e=/^--[a-zA-Z0-9_-]+$/,t=/-([a-z])/g,n=/^[^-]+$/,s=/^-(webkit|moz|ms|o|khtml)-/,i=/^-(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(i,d):m=m.replace(s,d),m.replace(t,c))};return sl.camelCase=p,sl}var ol,Bb;function eL(){if(Bb)return ol;Bb=1;var e=ol&&ol.__importDefault||function(i){return i&&i.__esModule?i:{default:i}},t=e(Q$()),n=Z$();function s(i,l){var c={};return!i||typeof i!="string"||(0,t.default)(i,function(d,p){d&&p&&(c[(0,n.camelCase)(d,l)]=p)}),c}return s.default=s,ol=s,ol}var tL=eL();const nL=Zu(tL),O1=_1("end"),Ng=_1("start");function _1(e){return t;function t(n){const s=n&&n.position&&n.position[e]||{};if(typeof s.line=="number"&&s.line>0&&typeof s.column=="number"&&s.column>0)return{line:s.line,column:s.column,offset:typeof s.offset=="number"&&s.offset>-1?s.offset:void 0}}}function rL(e){const t=Ng(e),n=O1(e);if(t&&n)return{start:t,end:n}}function xl(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?Ub(e.position):"start"in e||"end"in e?Ub(e):"line"in e||"column"in e?Zm(e):""}function Zm(e){return Hb(e&&e.line)+":"+Hb(e&&e.column)}function Ub(e){return Zm(e&&e.start)+"-"+Zm(e&&e.end)}function Hb(e){return e&&typeof e=="number"?e:1}class Pn extends Error{constructor(t,n,s){super(),typeof n=="string"&&(s=n,n=void 0);let i="",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"?i=t:!l.cause&&t&&(c=!0,i=t.message,l.cause=t),!l.ruleId&&!l.source&&typeof s=="string"){const p=s.indexOf(":");p===-1?l.ruleId=s:(l.source=s.slice(0,p),l.ruleId=s.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=i,this.line=d?d.line:void 0,this.name=xl(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}}Pn.prototype.file="";Pn.prototype.name="";Pn.prototype.reason="";Pn.prototype.message="";Pn.prototype.stack="";Pn.prototype.column=void 0;Pn.prototype.line=void 0;Pn.prototype.ancestors=void 0;Pn.prototype.cause=void 0;Pn.prototype.fatal=void 0;Pn.prototype.place=void 0;Pn.prototype.ruleId=void 0;Pn.prototype.source=void 0;const Cg={}.hasOwnProperty,sL=new Map,oL=/[A-Z]/g,iL=new Set(["table","tbody","thead","tfoot","tr"]),aL=new Set(["td","th"]),M1="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function lL(e,t){if(!t||t.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const n=t.filePath||void 0;let s;if(t.development){if(typeof t.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");s=gL(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");s=hL(n,t.jsx,t.jsxs)}const i={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:s,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"?Sg:Y$,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},l=F1(i,e,void 0);return l&&typeof l!="string"?l:i.create(e,i.Fragment,{children:l||void 0},void 0)}function F1(e,t,n){if(t.type==="element")return cL(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return uL(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return fL(e,t,n);if(t.type==="mdxjsEsm")return dL(e,t);if(t.type==="root")return pL(e,t,n);if(t.type==="text")return mL(e,t)}function cL(e,t,n){const s=e.schema;let i=s;t.tagName.toLowerCase()==="svg"&&s.space==="html"&&(i=Sg,e.schema=i),e.ancestors.push(t);const l=B1(e,t.tagName,!1),c=xL(e,t);let d=Tg(e,t);return iL.has(t.tagName)&&(d=d.filter(function(p){return typeof p=="string"?!F$(p):!0})),z1(e,c,l,t),Eg(c,d),e.ancestors.pop(),e.schema=s,e.create(t,l,c,n)}function uL(e,t){if(t.data&&t.data.estree&&e.evaluater){const s=t.data.estree.body[0];return s.type,e.evaluater.evaluateExpression(s.expression)}Dl(e,t.position)}function dL(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);Dl(e,t.position)}function fL(e,t,n){const s=e.schema;let i=s;t.name==="svg"&&s.space==="html"&&(i=Sg,e.schema=i),e.ancestors.push(t);const l=t.name===null?e.Fragment:B1(e,t.name,!0),c=yL(e,t),d=Tg(e,t);return z1(e,c,l,t),Eg(c,d),e.ancestors.pop(),e.schema=s,e.create(t,l,c,n)}function pL(e,t,n){const s={};return Eg(s,Tg(e,t)),e.create(t,e.Fragment,s,n)}function mL(e,t){return t.value}function z1(e,t,n,s){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=s)}function Eg(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function hL(e,t,n){return s;function s(i,l,c,d){const m=Array.isArray(c.children)?n:t;return d?m(l,c,d):m(l,c)}}function gL(e,t){return n;function n(s,i,l,c){const d=Array.isArray(l.children),p=Ng(s);return t(i,l,c,d,{columnNumber:p?p.column-1:void 0,fileName:e,lineNumber:p?p.line:void 0},void 0)}}function xL(e,t){const n={};let s,i;for(i in t.properties)if(i!=="children"&&Cg.call(t.properties,i)){const l=vL(e,i,t.properties[i]);if(l){const[c,d]=l;e.tableCellAlignToStyle&&c==="align"&&typeof d=="string"&&aL.has(t.tagName)?s=d:n[c]=d}}if(s){const l=n.style||(n.style={});l[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=s}return n}function yL(e,t){const n={};for(const s of t.attributes)if(s.type==="mdxJsxExpressionAttribute")if(s.data&&s.data.estree&&e.evaluater){const l=s.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 Dl(e,t.position);else{const i=s.name;let l;if(s.value&&typeof s.value=="object")if(s.value.data&&s.value.data.estree&&e.evaluater){const d=s.value.data.estree.body[0];d.type,l=e.evaluater.evaluateExpression(d.expression)}else Dl(e,t.position);else l=s.value===null?!0:s.value;n[i]=l}return n}function Tg(e,t){const n=[];let s=-1;const i=e.passKeys?new Map:sL;for(;++s<t.children.length;){const l=t.children[s];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=i.get(p)||0;c=p+"-"+m,i.set(p,m+1)}}const d=F1(e,l,c);d!==void 0&&n.push(d)}return n}function vL(e,t,n){const s=K$(e.schema,t);if(!(n==null||typeof n=="number"&&Number.isNaN(n))){if(Array.isArray(n)&&(n=s.commaSeparated?L$(n):J$(n)),s.property==="style"){let i=typeof n=="object"?n:bL(e,String(n));return e.stylePropertyNameCase==="css"&&(i=wL(i)),["style",i]}return[e.elementAttributeNameCase==="react"&&s.space?H$[s.property]||s.property:s.attribute,n]}}function bL(e,t){try{return nL(t,{reactCompat:!0})}catch(n){if(e.ignoreInvalidStyle)return{};const s=n,i=new Pn("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:s,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw i.file=e.filePath||void 0,i.url=M1+"#cannot-parse-style-attribute",i}}function B1(e,t,n){let s;if(!n)s={type:"Literal",value:t};else if(t.includes(".")){const i=t.split(".");let l=-1,c;for(;++l<i.length;){const d=Lb(i[l])?{type:"Identifier",name:i[l]}:{type:"Literal",value:i[l]};c=c?{type:"MemberExpression",object:c,property:d,computed:!!(l&&d.type==="Literal"),optional:!1}:d}s=c}else s=Lb(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(s.type==="Literal"){const i=s.value;return Cg.call(e.components,i)?e.components[i]:i}if(e.evaluater)return e.evaluater.evaluateExpression(s);Dl(e)}function Dl(e,t){const n=new Pn("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=M1+"#cannot-handle-mdx-estrees-without-createevaluater",n}function wL(e){const t={};let n;for(n in e)Cg.call(e,n)&&(t[jL(n)]=e[n]);return t}function jL(e){let t=e.replace(oL,kL);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function kL(e){return"-"+e.toLowerCase()}const im={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"]},SL={};function NL(e,t){const n=SL,s=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,i=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return U1(e,s,i)}function U1(e,t,n){if(CL(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 Vb(e.children,t,n)}return Array.isArray(e)?Vb(e,t,n):""}function Vb(e,t,n){const s=[];let i=-1;for(;++i<e.length;)s[i]=U1(e[i],t,n);return s.join("")}function CL(e){return!!(e&&typeof e=="object")}const Wb=document.createElement("i");function Pg(e){const t="&"+e+";";Wb.innerHTML=t;const n=Wb.textContent;return n.charCodeAt(n.length-1)===59&&e!=="semi"||n===t?!1:n}function ss(e,t,n,s){const i=e.length;let l=0,c;if(t<0?t=-t>i?0:i+t:t=t>i?i:t,n=n>0?n:0,s.length<1e4)c=Array.from(s),c.unshift(t,n),e.splice(...c);else for(n&&e.splice(t,n);l<s.length;)c=s.slice(l,l+1e4),c.unshift(t,0),e.splice(...c),l+=1e4,t+=1e4}function Sr(e,t){return e.length>0?(ss(e,e.length,0,t),e):t}const Kb={}.hasOwnProperty;function EL(e){const t={};let n=-1;for(;++n<e.length;)TL(t,e[n]);return t}function TL(e,t){let n;for(n in t){const i=(Kb.call(e,n)?e[n]:void 0)||(e[n]={}),l=t[n];let c;if(l)for(c in l){Kb.call(i,c)||(i[c]=[]);const d=l[c];PL(i[c],Array.isArray(d)?d:d?[d]:[])}}}function PL(e,t){let n=-1;const s=[];for(;++n<t.length;)(t[n].add==="after"?e:s).push(t[n]);ss(e,0,0,s)}function H1(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 Ui(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const Qr=lo(/[A-Za-z]/),dr=lo(/[\dA-Za-z]/),RL=lo(/[#-'*+\--9=?A-Z^-~]/);function eh(e){return e!==null&&(e<32||e===127)}const th=lo(/\d/),AL=lo(/[\dA-Fa-f]/),DL=lo(/[!-/:-@[-`{-~]/);function Xe(e){return e!==null&&e<-2}function qn(e){return e!==null&&(e<0||e===32)}function ht(e){return e===-2||e===-1||e===32}const $L=lo(new RegExp("\\p{P}|\\p{S}","u")),LL=lo(/\s/);function lo(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function oa(e){const t=[];let n=-1,s=0,i=0;for(;++n<e.length;){const l=e.charCodeAt(n);let c="";if(l===37&&dr(e.charCodeAt(n+1))&&dr(e.charCodeAt(n+2)))i=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),i=1):c="�"}else c=String.fromCharCode(l);c&&(t.push(e.slice(s,n),encodeURIComponent(c)),s=n+i+1,c=""),i&&(n+=i,i=0)}return t.join("")+e.slice(s)}function kt(e,t,n,s){const i=s?s-1:Number.POSITIVE_INFINITY;let l=0;return c;function c(p){return ht(p)?(e.enter(n),d(p)):t(p)}function d(p){return ht(p)&&l++<i?(e.consume(p),d):(e.exit(n),t(p))}}const IL={tokenize:OL};function OL(e){const t=e.attempt(this.parser.constructs.contentInitial,s,i);let n;return t;function s(d){if(d===null){e.consume(d);return}return e.enter("lineEnding"),e.consume(d),e.exit("lineEnding"),kt(e,t,"linePrefix")}function i(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 Xe(d)?(e.consume(d),e.exit("chunkText"),l):(e.consume(d),c)}}const _L={tokenize:ML},qb={tokenize:FL};function ML(e){const t=this,n=[];let s=0,i,l,c;return d;function d(N){if(s<n.length){const P=n[s];return t.containerState=P[1],e.attempt(P[0].continuation,p,m)(N)}return m(N)}function p(N){if(s++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,i&&E();const P=t.events.length;let I=P,R;for(;I--;)if(t.events[I][0]==="exit"&&t.events[I][1].type==="chunkFlow"){R=t.events[I][1].end;break}S(s);let $=P;for(;$<t.events.length;)t.events[$][1].end={...R},$++;return ss(t.events,I+1,0,t.events.slice(P)),t.events.length=$,m(N)}return d(N)}function m(N){if(s===n.length){if(!i)return y(N);if(i.currentConstruct&&i.currentConstruct.concrete)return C(N);t.interrupt=!!(i.currentConstruct&&!i._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(qb,h,x)(N)}function h(N){return i&&E(),S(s),y(N)}function x(N){return t.parser.lazy[t.now().line]=s!==n.length,c=t.now().offset,C(N)}function y(N){return t.containerState={},e.attempt(qb,v,C)(N)}function v(N){return s++,n.push([t.currentConstruct,t.containerState]),y(N)}function C(N){if(N===null){i&&E(),S(0),e.consume(N);return}return i=i||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:i,contentType:"flow",previous:l}),j(N)}function j(N){if(N===null){w(e.exit("chunkFlow"),!0),S(0),e.consume(N);return}return Xe(N)?(e.consume(N),w(e.exit("chunkFlow")),s=0,t.interrupt=void 0,d):(e.consume(N),j)}function w(N,P){const I=t.sliceStream(N);if(P&&I.push(null),N.previous=l,l&&(l.next=N),l=N,i.defineSkip(N.start),i.write(I),t.parser.lazy[N.start.line]){let R=i.events.length;for(;R--;)if(i.events[R][1].start.offset<c&&(!i.events[R][1].end||i.events[R][1].end.offset>c))return;const $=t.events.length;let D=$,X,Z;for(;D--;)if(t.events[D][0]==="exit"&&t.events[D][1].type==="chunkFlow"){if(X){Z=t.events[D][1].end;break}X=!0}for(S(s),R=$;R<t.events.length;)t.events[R][1].end={...Z},R++;ss(t.events,D+1,0,t.events.slice($)),t.events.length=R}}function S(N){let P=n.length;for(;P-- >N;){const I=n[P];t.containerState=I[1],I[0].exit.call(t,e)}n.length=N}function E(){i.write([null]),l=void 0,i=void 0,t.containerState._closeFlow=void 0}}function FL(e,t,n){return kt(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function Gb(e){if(e===null||qn(e)||LL(e))return 1;if($L(e))return 2}function Rg(e,t,n){const s=[];let i=-1;for(;++i<e.length;){const l=e[i].resolveAll;l&&!s.includes(l)&&(t=l(t,n),s.push(l))}return t}const nh={name:"attention",resolveAll:zL,tokenize:BL};function zL(e,t){let n=-1,s,i,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(s=n;s--;)if(e[s][0]==="exit"&&e[s][1].type==="attentionSequence"&&e[s][1]._open&&t.sliceSerialize(e[s][1]).charCodeAt(0)===t.sliceSerialize(e[n][1]).charCodeAt(0)){if((e[s][1]._close||e[n][1]._open)&&(e[n][1].end.offset-e[n][1].start.offset)%3&&!((e[s][1].end.offset-e[s][1].start.offset+e[n][1].end.offset-e[n][1].start.offset)%3))continue;p=e[s][1].end.offset-e[s][1].start.offset>1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;const x={...e[s][1].end},y={...e[n][1].start};Yb(x,-p),Yb(y,p),c={type:p>1?"strongSequence":"emphasisSequence",start:x,end:{...e[s][1].end}},d={type:p>1?"strongSequence":"emphasisSequence",start:{...e[n][1].start},end:y},l={type:p>1?"strongText":"emphasisText",start:{...e[s][1].end},end:{...e[n][1].start}},i={type:p>1?"strong":"emphasis",start:{...c.start},end:{...d.end}},e[s][1].end={...c.start},e[n][1].start={...d.end},m=[],e[s][1].end.offset-e[s][1].start.offset&&(m=Sr(m,[["enter",e[s][1],t],["exit",e[s][1],t]])),m=Sr(m,[["enter",i,t],["enter",c,t],["exit",c,t],["enter",l,t]]),m=Sr(m,Rg(t.parser.constructs.insideSpan.null,e.slice(s+1,n),t)),m=Sr(m,[["exit",l,t],["enter",d,t],["exit",d,t],["exit",i,t]]),e[n][1].end.offset-e[n][1].start.offset?(h=2,m=Sr(m,[["enter",e[n][1],t],["exit",e[n][1],t]])):h=0,ss(e,s-1,n-s+3,m),n=s+m.length-h-2;break}}for(n=-1;++n<e.length;)e[n][1].type==="attentionSequence"&&(e[n][1].type="data");return e}function BL(e,t){const n=this.parser.constructs.attentionMarkers.null,s=this.previous,i=Gb(s);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=Gb(p),x=!h||h===2&&i||n.includes(p),y=!i||i===2&&h||n.includes(s);return m._open=!!(l===42?x:x&&(i||!y)),m._close=!!(l===42?y:y&&(h||!x)),t(p)}}function Yb(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const UL={name:"autolink",tokenize:HL};function HL(e,t,n){let s=0;return i;function i(v){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(v),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),l}function l(v){return Qr(v)?(e.consume(v),c):v===64?n(v):m(v)}function c(v){return v===43||v===45||v===46||dr(v)?(s=1,d(v)):m(v)}function d(v){return v===58?(e.consume(v),s=0,p):(v===43||v===45||v===46||dr(v))&&s++<32?(e.consume(v),d):(s=0,m(v))}function p(v){return v===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(v),e.exit("autolinkMarker"),e.exit("autolink"),t):v===null||v===32||v===60||eh(v)?n(v):(e.consume(v),p)}function m(v){return v===64?(e.consume(v),h):RL(v)?(e.consume(v),m):n(v)}function h(v){return dr(v)?x(v):n(v)}function x(v){return v===46?(e.consume(v),s=0,h):v===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(v),e.exit("autolinkMarker"),e.exit("autolink"),t):y(v)}function y(v){if((v===45||dr(v))&&s++<63){const C=v===45?y:x;return e.consume(v),C}return n(v)}}const Td={partial:!0,tokenize:VL};function VL(e,t,n){return s;function s(l){return ht(l)?kt(e,i,"linePrefix")(l):i(l)}function i(l){return l===null||Xe(l)?t(l):n(l)}}const V1={continuation:{tokenize:KL},exit:qL,name:"blockQuote",tokenize:WL};function WL(e,t,n){const s=this;return i;function i(c){if(c===62){const d=s.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 ht(c)?(e.enter("blockQuotePrefixWhitespace"),e.consume(c),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(c))}}function KL(e,t,n){const s=this;return i;function i(c){return ht(c)?kt(e,l,"linePrefix",s.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(c):l(c)}function l(c){return e.attempt(V1,t,n)(c)}}function qL(e){e.exit("blockQuote")}const W1={name:"characterEscape",tokenize:GL};function GL(e,t,n){return s;function s(l){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(l),e.exit("escapeMarker"),i}function i(l){return DL(l)?(e.enter("characterEscapeValue"),e.consume(l),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(l)}}const K1={name:"characterReference",tokenize:YL};function YL(e,t,n){const s=this;let i=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=dr,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=AL,h):(e.enter("characterReferenceValue"),l=7,c=th,h(x))}function h(x){if(x===59&&i){const y=e.exit("characterReferenceValue");return c===dr&&!Pg(s.sliceSerialize(y))?n(x):(e.enter("characterReferenceMarker"),e.consume(x),e.exit("characterReferenceMarker"),e.exit("characterReference"),t)}return c(x)&&i++<l?(e.consume(x),h):n(x)}}const Jb={partial:!0,tokenize:XL},Xb={concrete:!0,name:"codeFenced",tokenize:JL};function JL(e,t,n){const s=this,i={partial:!0,tokenize:I};let l=0,c=0,d;return p;function p(R){return m(R)}function m(R){const $=s.events[s.events.length-1];return l=$&&$[1].type==="linePrefix"?$[2].sliceSerialize($[1],!0).length:0,d=R,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),h(R)}function h(R){return R===d?(c++,e.consume(R),h):c<3?n(R):(e.exit("codeFencedFenceSequence"),ht(R)?kt(e,x,"whitespace")(R):x(R))}function x(R){return R===null||Xe(R)?(e.exit("codeFencedFence"),s.interrupt?t(R):e.check(Jb,j,P)(R)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),y(R))}function y(R){return R===null||Xe(R)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),x(R)):ht(R)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),kt(e,v,"whitespace")(R)):R===96&&R===d?n(R):(e.consume(R),y)}function v(R){return R===null||Xe(R)?x(R):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),C(R))}function C(R){return R===null||Xe(R)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),x(R)):R===96&&R===d?n(R):(e.consume(R),C)}function j(R){return e.attempt(i,P,w)(R)}function w(R){return e.enter("lineEnding"),e.consume(R),e.exit("lineEnding"),S}function S(R){return l>0&&ht(R)?kt(e,E,"linePrefix",l+1)(R):E(R)}function E(R){return R===null||Xe(R)?e.check(Jb,j,P)(R):(e.enter("codeFlowValue"),N(R))}function N(R){return R===null||Xe(R)?(e.exit("codeFlowValue"),E(R)):(e.consume(R),N)}function P(R){return e.exit("codeFenced"),t(R)}function I(R,$,D){let X=0;return Z;function Z(W){return R.enter("lineEnding"),R.consume(W),R.exit("lineEnding"),F}function F(W){return R.enter("codeFencedFence"),ht(W)?kt(R,H,"linePrefix",s.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(W):H(W)}function H(W){return W===d?(R.enter("codeFencedFenceSequence"),J(W)):D(W)}function J(W){return W===d?(X++,R.consume(W),J):X>=c?(R.exit("codeFencedFenceSequence"),ht(W)?kt(R,_,"whitespace")(W):_(W)):D(W)}function _(W){return W===null||Xe(W)?(R.exit("codeFencedFence"),$(W)):D(W)}}}function XL(e,t,n){const s=this;return i;function i(c){return c===null?n(c):(e.enter("lineEnding"),e.consume(c),e.exit("lineEnding"),l)}function l(c){return s.parser.lazy[s.now().line]?n(c):t(c)}}const am={name:"codeIndented",tokenize:ZL},QL={partial:!0,tokenize:eI};function ZL(e,t,n){const s=this;return i;function i(m){return e.enter("codeIndented"),kt(e,l,"linePrefix",5)(m)}function l(m){const h=s.events[s.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):Xe(m)?e.attempt(QL,c,p)(m):(e.enter("codeFlowValue"),d(m))}function d(m){return m===null||Xe(m)?(e.exit("codeFlowValue"),c(m)):(e.consume(m),d)}function p(m){return e.exit("codeIndented"),t(m)}}function eI(e,t,n){const s=this;return i;function i(c){return s.parser.lazy[s.now().line]?n(c):Xe(c)?(e.enter("lineEnding"),e.consume(c),e.exit("lineEnding"),i):kt(e,l,"linePrefix",5)(c)}function l(c){const d=s.events[s.events.length-1];return d&&d[1].type==="linePrefix"&&d[2].sliceSerialize(d[1],!0).length>=4?t(c):Xe(c)?i(c):n(c)}}const tI={name:"codeText",previous:rI,resolve:nI,tokenize:sI};function nI(e){let t=e.length-4,n=3,s,i;if((e[n][1].type==="lineEnding"||e[n][1].type==="space")&&(e[t][1].type==="lineEnding"||e[t][1].type==="space")){for(s=n;++s<t;)if(e[s][1].type==="codeTextData"){e[n][1].type="codeTextPadding",e[t][1].type="codeTextPadding",n+=2,t-=2;break}}for(s=n-1,t++;++s<=t;)i===void 0?s!==t&&e[s][1].type!=="lineEnding"&&(i=s):(s===t||e[s][1].type==="lineEnding")&&(e[i][1].type="codeTextData",s!==i+2&&(e[i][1].end=e[s-1][1].end,e.splice(i+2,s-i-2),t-=s-i-2,s=i+2),i=void 0);return e}function rI(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function sI(e,t,n){let s=0,i,l;return c;function c(x){return e.enter("codeText"),e.enter("codeTextSequence"),d(x)}function d(x){return x===96?(e.consume(x),s++,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"),i=0,h(x)):Xe(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||Xe(x)?(e.exit("codeTextData"),p(x)):(e.consume(x),m)}function h(x){return x===96?(e.consume(x),i++,h):i===s?(e.exit("codeTextSequence"),e.exit("codeText"),t(x)):(l.type="codeTextData",m(x))}}class oI{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 s=n??Number.POSITIVE_INFINITY;return s<this.left.length?this.left.slice(t,s):t>this.left.length?this.right.slice(this.right.length-s+this.left.length,this.right.length-t+this.left.length).reverse():this.left.slice(t).concat(this.right.slice(this.right.length-s+this.left.length).reverse())}splice(t,n,s){const i=n||0;this.setCursor(Math.trunc(t));const l=this.right.splice(this.right.length-i,Number.POSITIVE_INFINITY);return s&&il(this.left,s),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),il(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),il(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);il(this.right,n.reverse())}else{const n=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);il(this.left,n.reverse())}}}function il(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 q1(e){const t={};let n=-1,s,i,l,c,d,p,m;const h=new oI(e);for(;++n<h.length;){for(;n in t;)n=t[n];if(s=h.get(n),n&&s[1].type==="chunkFlow"&&h.get(n-1)[1].type==="listItemPrefix"&&(p=s[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(s[0]==="enter")s[1].contentType&&(Object.assign(t,iI(h,n)),n=t[n],m=!0);else if(s[1]._container){for(l=n,i=void 0;l--;)if(c=h.get(l),c[1].type==="lineEnding"||c[1].type==="lineEndingBlank")c[0]==="enter"&&(i&&(h.get(i)[1].type="lineEndingBlank"),c[1].type="lineEnding",i=l);else if(!(c[1].type==="linePrefix"||c[1].type==="listItemIndent"))break;i&&(s[1].end={...h.get(i)[1].start},d=h.slice(i,n),d.unshift(s),h.splice(i,n-i+1,d))}}return ss(e,0,Number.POSITIVE_INFINITY,h.slice(0)),!m}function iI(e,t){const n=e.get(t)[1],s=e.get(t)[2];let i=t-1;const l=[];let c=n._tokenizer;c||(c=s.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(c._contentTypeTextTrailing=!0));const d=c.events,p=[],m={};let h,x,y=-1,v=n,C=0,j=0;const w=[j];for(;v;){for(;e.get(++i)[1]!==v;);l.push(i),v._tokenizer||(h=s.sliceStream(v),v.next||h.push(null),x&&c.defineSkip(v.start),v._isInFirstContentOfListItem&&(c._gfmTasklistFirstContentOfListItem=!0),c.write(h),v._isInFirstContentOfListItem&&(c._gfmTasklistFirstContentOfListItem=void 0)),x=v,v=v.next}for(v=n;++y<d.length;)d[y][0]==="exit"&&d[y-1][0]==="enter"&&d[y][1].type===d[y-1][1].type&&d[y][1].start.line!==d[y][1].end.line&&(j=y+1,w.push(j),v._tokenizer=void 0,v.previous=void 0,v=v.next);for(c.events=[],v?(v._tokenizer=void 0,v.previous=void 0):w.pop(),y=w.length;y--;){const S=d.slice(w[y],w[y+1]),E=l.pop();p.push([E,E+S.length-1]),e.splice(E,2,S)}for(p.reverse(),y=-1;++y<p.length;)m[C+p[y][0]]=C+p[y][1],C+=p[y][1]-p[y][0]-1;return m}const aI={resolve:cI,tokenize:uI},lI={partial:!0,tokenize:dI};function cI(e){return q1(e),e}function uI(e,t){let n;return s;function s(d){return e.enter("content"),n=e.enter("chunkContent",{contentType:"content"}),i(d)}function i(d){return d===null?l(d):Xe(d)?e.check(lI,c,l)(d):(e.consume(d),i)}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,i}}function dI(e,t,n){const s=this;return i;function i(c){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(c),e.exit("lineEnding"),kt(e,l,"linePrefix")}function l(c){if(c===null||Xe(c))return n(c);const d=s.events[s.events.length-1];return!s.parser.constructs.disable.null.includes("codeIndented")&&d&&d[1].type==="linePrefix"&&d[2].sliceSerialize(d[1],!0).length>=4?t(c):e.interrupt(s.parser.constructs.flow,n,t)(c)}}function G1(e,t,n,s,i,l,c,d,p){const m=p||Number.POSITIVE_INFINITY;let h=0;return x;function x(S){return S===60?(e.enter(s),e.enter(i),e.enter(l),e.consume(S),e.exit(l),y):S===null||S===32||S===41||eh(S)?n(S):(e.enter(s),e.enter(c),e.enter(d),e.enter("chunkString",{contentType:"string"}),j(S))}function y(S){return S===62?(e.enter(l),e.consume(S),e.exit(l),e.exit(i),e.exit(s),t):(e.enter(d),e.enter("chunkString",{contentType:"string"}),v(S))}function v(S){return S===62?(e.exit("chunkString"),e.exit(d),y(S)):S===null||S===60||Xe(S)?n(S):(e.consume(S),S===92?C:v)}function C(S){return S===60||S===62||S===92?(e.consume(S),v):v(S)}function j(S){return!h&&(S===null||S===41||qn(S))?(e.exit("chunkString"),e.exit(d),e.exit(c),e.exit(s),t(S)):h<m&&S===40?(e.consume(S),h++,j):S===41?(e.consume(S),h--,j):S===null||S===32||S===40||eh(S)?n(S):(e.consume(S),S===92?w:j)}function w(S){return S===40||S===41||S===92?(e.consume(S),j):j(S)}}function Y1(e,t,n,s,i,l){const c=this;let d=0,p;return m;function m(v){return e.enter(s),e.enter(i),e.consume(v),e.exit(i),e.enter(l),h}function h(v){return d>999||v===null||v===91||v===93&&!p||v===94&&!d&&"_hiddenFootnoteSupport"in c.parser.constructs?n(v):v===93?(e.exit(l),e.enter(i),e.consume(v),e.exit(i),e.exit(s),t):Xe(v)?(e.enter("lineEnding"),e.consume(v),e.exit("lineEnding"),h):(e.enter("chunkString",{contentType:"string"}),x(v))}function x(v){return v===null||v===91||v===93||Xe(v)||d++>999?(e.exit("chunkString"),h(v)):(e.consume(v),p||(p=!ht(v)),v===92?y:x)}function y(v){return v===91||v===92||v===93?(e.consume(v),d++,x):x(v)}}function J1(e,t,n,s,i,l){let c;return d;function d(y){return y===34||y===39||y===40?(e.enter(s),e.enter(i),e.consume(y),e.exit(i),c=y===40?41:y,p):n(y)}function p(y){return y===c?(e.enter(i),e.consume(y),e.exit(i),e.exit(s),t):(e.enter(l),m(y))}function m(y){return y===c?(e.exit(l),p(c)):y===null?n(y):Xe(y)?(e.enter("lineEnding"),e.consume(y),e.exit("lineEnding"),kt(e,m,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),h(y))}function h(y){return y===c||y===null||Xe(y)?(e.exit("chunkString"),m(y)):(e.consume(y),y===92?x:h)}function x(y){return y===c||y===92?(e.consume(y),h):h(y)}}function yl(e,t){let n;return s;function s(i){return Xe(i)?(e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),n=!0,s):ht(i)?kt(e,s,n?"linePrefix":"lineSuffix")(i):t(i)}}const fI={name:"definition",tokenize:mI},pI={partial:!0,tokenize:hI};function mI(e,t,n){const s=this;let i;return l;function l(v){return e.enter("definition"),c(v)}function c(v){return Y1.call(s,e,d,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(v)}function d(v){return i=Ui(s.sliceSerialize(s.events[s.events.length-1][1]).slice(1,-1)),v===58?(e.enter("definitionMarker"),e.consume(v),e.exit("definitionMarker"),p):n(v)}function p(v){return qn(v)?yl(e,m)(v):m(v)}function m(v){return G1(e,h,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(v)}function h(v){return e.attempt(pI,x,x)(v)}function x(v){return ht(v)?kt(e,y,"whitespace")(v):y(v)}function y(v){return v===null||Xe(v)?(e.exit("definition"),s.parser.defined.push(i),t(v)):n(v)}}function hI(e,t,n){return s;function s(d){return qn(d)?yl(e,i)(d):n(d)}function i(d){return J1(e,l,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(d)}function l(d){return ht(d)?kt(e,c,"whitespace")(d):c(d)}function c(d){return d===null||Xe(d)?t(d):n(d)}}const gI={name:"hardBreakEscape",tokenize:xI};function xI(e,t,n){return s;function s(l){return e.enter("hardBreakEscape"),e.consume(l),i}function i(l){return Xe(l)?(e.exit("hardBreakEscape"),t(l)):n(l)}}const yI={name:"headingAtx",resolve:vI,tokenize:bI};function vI(e,t){let n=e.length-2,s=3,i,l;return e[s][1].type==="whitespace"&&(s+=2),n-2>s&&e[n][1].type==="whitespace"&&(n-=2),e[n][1].type==="atxHeadingSequence"&&(s===n-1||n-4>s&&e[n-2][1].type==="whitespace")&&(n-=s+1===n?2:4),n>s&&(i={type:"atxHeadingText",start:e[s][1].start,end:e[n][1].end},l={type:"chunkText",start:e[s][1].start,end:e[n][1].end,contentType:"text"},ss(e,s,n-s+1,[["enter",i,t],["enter",l,t],["exit",l,t],["exit",i,t]])),e}function bI(e,t,n){let s=0;return i;function i(h){return e.enter("atxHeading"),l(h)}function l(h){return e.enter("atxHeadingSequence"),c(h)}function c(h){return h===35&&s++<6?(e.consume(h),c):h===null||qn(h)?(e.exit("atxHeadingSequence"),d(h)):n(h)}function d(h){return h===35?(e.enter("atxHeadingSequence"),p(h)):h===null||Xe(h)?(e.exit("atxHeading"),t(h)):ht(h)?kt(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||qn(h)?(e.exit("atxHeadingText"),d(h)):(e.consume(h),m)}}const wI=["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"],Qb=["pre","script","style","textarea"],jI={concrete:!0,name:"htmlFlow",resolveTo:NI,tokenize:CI},kI={partial:!0,tokenize:TI},SI={partial:!0,tokenize:EI};function NI(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 CI(e,t,n){const s=this;let i,l,c,d,p;return m;function m(L){return h(L)}function h(L){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(L),x}function x(L){return L===33?(e.consume(L),y):L===47?(e.consume(L),l=!0,j):L===63?(e.consume(L),i=3,s.interrupt?t:T):Qr(L)?(e.consume(L),c=String.fromCharCode(L),w):n(L)}function y(L){return L===45?(e.consume(L),i=2,v):L===91?(e.consume(L),i=5,d=0,C):Qr(L)?(e.consume(L),i=4,s.interrupt?t:T):n(L)}function v(L){return L===45?(e.consume(L),s.interrupt?t:T):n(L)}function C(L){const ue="CDATA[";return L===ue.charCodeAt(d++)?(e.consume(L),d===ue.length?s.interrupt?t:H:C):n(L)}function j(L){return Qr(L)?(e.consume(L),c=String.fromCharCode(L),w):n(L)}function w(L){if(L===null||L===47||L===62||qn(L)){const ue=L===47,fe=c.toLowerCase();return!ue&&!l&&Qb.includes(fe)?(i=1,s.interrupt?t(L):H(L)):wI.includes(c.toLowerCase())?(i=6,ue?(e.consume(L),S):s.interrupt?t(L):H(L)):(i=7,s.interrupt&&!s.parser.lazy[s.now().line]?n(L):l?E(L):N(L))}return L===45||dr(L)?(e.consume(L),c+=String.fromCharCode(L),w):n(L)}function S(L){return L===62?(e.consume(L),s.interrupt?t:H):n(L)}function E(L){return ht(L)?(e.consume(L),E):Z(L)}function N(L){return L===47?(e.consume(L),Z):L===58||L===95||Qr(L)?(e.consume(L),P):ht(L)?(e.consume(L),N):Z(L)}function P(L){return L===45||L===46||L===58||L===95||dr(L)?(e.consume(L),P):I(L)}function I(L){return L===61?(e.consume(L),R):ht(L)?(e.consume(L),I):N(L)}function R(L){return L===null||L===60||L===61||L===62||L===96?n(L):L===34||L===39?(e.consume(L),p=L,$):ht(L)?(e.consume(L),R):D(L)}function $(L){return L===p?(e.consume(L),p=null,X):L===null||Xe(L)?n(L):(e.consume(L),$)}function D(L){return L===null||L===34||L===39||L===47||L===60||L===61||L===62||L===96||qn(L)?I(L):(e.consume(L),D)}function X(L){return L===47||L===62||ht(L)?N(L):n(L)}function Z(L){return L===62?(e.consume(L),F):n(L)}function F(L){return L===null||Xe(L)?H(L):ht(L)?(e.consume(L),F):n(L)}function H(L){return L===45&&i===2?(e.consume(L),Y):L===60&&i===1?(e.consume(L),ie):L===62&&i===4?(e.consume(L),M):L===63&&i===3?(e.consume(L),T):L===93&&i===5?(e.consume(L),ae):Xe(L)&&(i===6||i===7)?(e.exit("htmlFlowData"),e.check(kI,q,J)(L)):L===null||Xe(L)?(e.exit("htmlFlowData"),J(L)):(e.consume(L),H)}function J(L){return e.check(SI,_,q)(L)}function _(L){return e.enter("lineEnding"),e.consume(L),e.exit("lineEnding"),W}function W(L){return L===null||Xe(L)?J(L):(e.enter("htmlFlowData"),H(L))}function Y(L){return L===45?(e.consume(L),T):H(L)}function ie(L){return L===47?(e.consume(L),c="",K):H(L)}function K(L){if(L===62){const ue=c.toLowerCase();return Qb.includes(ue)?(e.consume(L),M):H(L)}return Qr(L)&&c.length<8?(e.consume(L),c+=String.fromCharCode(L),K):H(L)}function ae(L){return L===93?(e.consume(L),T):H(L)}function T(L){return L===62?(e.consume(L),M):L===45&&i===2?(e.consume(L),T):H(L)}function M(L){return L===null||Xe(L)?(e.exit("htmlFlowData"),q(L)):(e.consume(L),M)}function q(L){return e.exit("htmlFlow"),t(L)}}function EI(e,t,n){const s=this;return i;function i(c){return Xe(c)?(e.enter("lineEnding"),e.consume(c),e.exit("lineEnding"),l):n(c)}function l(c){return s.parser.lazy[s.now().line]?n(c):t(c)}}function TI(e,t,n){return s;function s(i){return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),e.attempt(Td,t,n)}}const PI={name:"htmlText",tokenize:RI};function RI(e,t,n){const s=this;let i,l,c;return d;function d(T){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(T),p}function p(T){return T===33?(e.consume(T),m):T===47?(e.consume(T),I):T===63?(e.consume(T),N):Qr(T)?(e.consume(T),D):n(T)}function m(T){return T===45?(e.consume(T),h):T===91?(e.consume(T),l=0,C):Qr(T)?(e.consume(T),E):n(T)}function h(T){return T===45?(e.consume(T),v):n(T)}function x(T){return T===null?n(T):T===45?(e.consume(T),y):Xe(T)?(c=x,ie(T)):(e.consume(T),x)}function y(T){return T===45?(e.consume(T),v):x(T)}function v(T){return T===62?Y(T):T===45?y(T):x(T)}function C(T){const M="CDATA[";return T===M.charCodeAt(l++)?(e.consume(T),l===M.length?j:C):n(T)}function j(T){return T===null?n(T):T===93?(e.consume(T),w):Xe(T)?(c=j,ie(T)):(e.consume(T),j)}function w(T){return T===93?(e.consume(T),S):j(T)}function S(T){return T===62?Y(T):T===93?(e.consume(T),S):j(T)}function E(T){return T===null||T===62?Y(T):Xe(T)?(c=E,ie(T)):(e.consume(T),E)}function N(T){return T===null?n(T):T===63?(e.consume(T),P):Xe(T)?(c=N,ie(T)):(e.consume(T),N)}function P(T){return T===62?Y(T):N(T)}function I(T){return Qr(T)?(e.consume(T),R):n(T)}function R(T){return T===45||dr(T)?(e.consume(T),R):$(T)}function $(T){return Xe(T)?(c=$,ie(T)):ht(T)?(e.consume(T),$):Y(T)}function D(T){return T===45||dr(T)?(e.consume(T),D):T===47||T===62||qn(T)?X(T):n(T)}function X(T){return T===47?(e.consume(T),Y):T===58||T===95||Qr(T)?(e.consume(T),Z):Xe(T)?(c=X,ie(T)):ht(T)?(e.consume(T),X):Y(T)}function Z(T){return T===45||T===46||T===58||T===95||dr(T)?(e.consume(T),Z):F(T)}function F(T){return T===61?(e.consume(T),H):Xe(T)?(c=F,ie(T)):ht(T)?(e.consume(T),F):X(T)}function H(T){return T===null||T===60||T===61||T===62||T===96?n(T):T===34||T===39?(e.consume(T),i=T,J):Xe(T)?(c=H,ie(T)):ht(T)?(e.consume(T),H):(e.consume(T),_)}function J(T){return T===i?(e.consume(T),i=void 0,W):T===null?n(T):Xe(T)?(c=J,ie(T)):(e.consume(T),J)}function _(T){return T===null||T===34||T===39||T===60||T===61||T===96?n(T):T===47||T===62||qn(T)?X(T):(e.consume(T),_)}function W(T){return T===47||T===62||qn(T)?X(T):n(T)}function Y(T){return T===62?(e.consume(T),e.exit("htmlTextData"),e.exit("htmlText"),t):n(T)}function ie(T){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(T),e.exit("lineEnding"),K}function K(T){return ht(T)?kt(e,ae,"linePrefix",s.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(T):ae(T)}function ae(T){return e.enter("htmlTextData"),c(T)}}const Ag={name:"labelEnd",resolveAll:LI,resolveTo:II,tokenize:OI},AI={tokenize:_I},DI={tokenize:MI},$I={tokenize:FI};function LI(e){let t=-1;const n=[];for(;++t<e.length;){const s=e[t][1];if(n.push(e[t]),s.type==="labelImage"||s.type==="labelLink"||s.type==="labelEnd"){const i=s.type==="labelImage"?4:2;s.type="data",t+=i}}return e.length!==n.length&&ss(e,0,e.length,n),e}function II(e,t){let n=e.length,s=0,i,l,c,d;for(;n--;)if(i=e[n][1],l){if(i.type==="link"||i.type==="labelLink"&&i._inactive)break;e[n][0]==="enter"&&i.type==="labelLink"&&(i._inactive=!0)}else if(c){if(e[n][0]==="enter"&&(i.type==="labelImage"||i.type==="labelLink")&&!i._balanced&&(l=n,i.type!=="labelLink")){s=2;break}}else i.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+s+2][1].end},end:{...e[c-2][1].start}};return d=[["enter",p,t],["enter",m,t]],d=Sr(d,e.slice(l+1,l+s+3)),d=Sr(d,[["enter",h,t]]),d=Sr(d,Rg(t.parser.constructs.insideSpan.null,e.slice(l+s+4,c-3),t)),d=Sr(d,[["exit",h,t],e[c-2],e[c-1],["exit",m,t]]),d=Sr(d,e.slice(c+1)),d=Sr(d,[["exit",p,t]]),ss(e,l,e.length,d),e}function OI(e,t,n){const s=this;let i=s.events.length,l,c;for(;i--;)if((s.events[i][1].type==="labelImage"||s.events[i][1].type==="labelLink")&&!s.events[i][1]._balanced){l=s.events[i][1];break}return d;function d(y){return l?l._inactive?x(y):(c=s.parser.defined.includes(Ui(s.sliceSerialize({start:l.end,end:s.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(y),e.exit("labelMarker"),e.exit("labelEnd"),p):n(y)}function p(y){return y===40?e.attempt(AI,h,c?h:x)(y):y===91?e.attempt(DI,h,c?m:x)(y):c?h(y):x(y)}function m(y){return e.attempt($I,h,x)(y)}function h(y){return t(y)}function x(y){return l._balanced=!0,n(y)}}function _I(e,t,n){return s;function s(x){return e.enter("resource"),e.enter("resourceMarker"),e.consume(x),e.exit("resourceMarker"),i}function i(x){return qn(x)?yl(e,l)(x):l(x)}function l(x){return x===41?h(x):G1(e,c,d,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(x)}function c(x){return qn(x)?yl(e,p)(x):h(x)}function d(x){return n(x)}function p(x){return x===34||x===39||x===40?J1(e,m,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(x):h(x)}function m(x){return qn(x)?yl(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 MI(e,t,n){const s=this;return i;function i(d){return Y1.call(s,e,l,c,"reference","referenceMarker","referenceString")(d)}function l(d){return s.parser.defined.includes(Ui(s.sliceSerialize(s.events[s.events.length-1][1]).slice(1,-1)))?t(d):n(d)}function c(d){return n(d)}}function FI(e,t,n){return s;function s(l){return e.enter("reference"),e.enter("referenceMarker"),e.consume(l),e.exit("referenceMarker"),i}function i(l){return l===93?(e.enter("referenceMarker"),e.consume(l),e.exit("referenceMarker"),e.exit("reference"),t):n(l)}}const zI={name:"labelStartImage",resolveAll:Ag.resolveAll,tokenize:BI};function BI(e,t,n){const s=this;return i;function i(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 s.parser.constructs?n(d):t(d)}}const UI={name:"labelStartLink",resolveAll:Ag.resolveAll,tokenize:HI};function HI(e,t,n){const s=this;return i;function i(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 s.parser.constructs?n(c):t(c)}}const lm={name:"lineEnding",tokenize:VI};function VI(e,t){return n;function n(s){return e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),kt(e,t,"linePrefix")}}const Pu={name:"thematicBreak",tokenize:WI};function WI(e,t,n){let s=0,i;return l;function l(m){return e.enter("thematicBreak"),c(m)}function c(m){return i=m,d(m)}function d(m){return m===i?(e.enter("thematicBreakSequence"),p(m)):s>=3&&(m===null||Xe(m))?(e.exit("thematicBreak"),t(m)):n(m)}function p(m){return m===i?(e.consume(m),s++,p):(e.exit("thematicBreakSequence"),ht(m)?kt(e,d,"whitespace")(m):d(m))}}const Vn={continuation:{tokenize:YI},exit:XI,name:"list",tokenize:GI},KI={partial:!0,tokenize:QI},qI={partial:!0,tokenize:JI};function GI(e,t,n){const s=this,i=s.events[s.events.length-1];let l=i&&i[1].type==="linePrefix"?i[2].sliceSerialize(i[1],!0).length:0,c=0;return d;function d(v){const C=s.containerState.type||(v===42||v===43||v===45?"listUnordered":"listOrdered");if(C==="listUnordered"?!s.containerState.marker||v===s.containerState.marker:th(v)){if(s.containerState.type||(s.containerState.type=C,e.enter(C,{_container:!0})),C==="listUnordered")return e.enter("listItemPrefix"),v===42||v===45?e.check(Pu,n,m)(v):m(v);if(!s.interrupt||v===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),p(v)}return n(v)}function p(v){return th(v)&&++c<10?(e.consume(v),p):(!s.interrupt||c<2)&&(s.containerState.marker?v===s.containerState.marker:v===41||v===46)?(e.exit("listItemValue"),m(v)):n(v)}function m(v){return e.enter("listItemMarker"),e.consume(v),e.exit("listItemMarker"),s.containerState.marker=s.containerState.marker||v,e.check(Td,s.interrupt?n:h,e.attempt(KI,y,x))}function h(v){return s.containerState.initialBlankLine=!0,l++,y(v)}function x(v){return ht(v)?(e.enter("listItemPrefixWhitespace"),e.consume(v),e.exit("listItemPrefixWhitespace"),y):n(v)}function y(v){return s.containerState.size=l+s.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(v)}}function YI(e,t,n){const s=this;return s.containerState._closeFlow=void 0,e.check(Td,i,l);function i(d){return s.containerState.furtherBlankLines=s.containerState.furtherBlankLines||s.containerState.initialBlankLine,kt(e,t,"listItemIndent",s.containerState.size+1)(d)}function l(d){return s.containerState.furtherBlankLines||!ht(d)?(s.containerState.furtherBlankLines=void 0,s.containerState.initialBlankLine=void 0,c(d)):(s.containerState.furtherBlankLines=void 0,s.containerState.initialBlankLine=void 0,e.attempt(qI,t,c)(d))}function c(d){return s.containerState._closeFlow=!0,s.interrupt=void 0,kt(e,e.attempt(Vn,t,n),"linePrefix",s.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(d)}}function JI(e,t,n){const s=this;return kt(e,i,"listItemIndent",s.containerState.size+1);function i(l){const c=s.events[s.events.length-1];return c&&c[1].type==="listItemIndent"&&c[2].sliceSerialize(c[1],!0).length===s.containerState.size?t(l):n(l)}}function XI(e){e.exit(this.containerState.type)}function QI(e,t,n){const s=this;return kt(e,i,"listItemPrefixWhitespace",s.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function i(l){const c=s.events[s.events.length-1];return!ht(l)&&c&&c[1].type==="listItemPrefixWhitespace"?t(l):n(l)}}const Zb={name:"setextUnderline",resolveTo:ZI,tokenize:eO};function ZI(e,t){let n=e.length,s,i,l;for(;n--;)if(e[n][0]==="enter"){if(e[n][1].type==="content"){s=n;break}e[n][1].type==="paragraph"&&(i=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[s][1].start},end:{...e[e.length-1][1].end}};return e[i][1].type="setextHeadingText",l?(e.splice(i,0,["enter",c,t]),e.splice(l+1,0,["exit",e[s][1],t]),e[s][1].end={...e[l][1].end}):e[s][1]=c,e.push(["exit",c,t]),e}function eO(e,t,n){const s=this;let i;return l;function l(m){let h=s.events.length,x;for(;h--;)if(s.events[h][1].type!=="lineEnding"&&s.events[h][1].type!=="linePrefix"&&s.events[h][1].type!=="content"){x=s.events[h][1].type==="paragraph";break}return!s.parser.lazy[s.now().line]&&(s.interrupt||x)?(e.enter("setextHeadingLine"),i=m,c(m)):n(m)}function c(m){return e.enter("setextHeadingLineSequence"),d(m)}function d(m){return m===i?(e.consume(m),d):(e.exit("setextHeadingLineSequence"),ht(m)?kt(e,p,"lineSuffix")(m):p(m))}function p(m){return m===null||Xe(m)?(e.exit("setextHeadingLine"),t(m)):n(m)}}const tO={tokenize:nO};function nO(e){const t=this,n=e.attempt(Td,s,e.attempt(this.parser.constructs.flowInitial,i,kt(e,e.attempt(this.parser.constructs.flow,i,e.attempt(aI,i)),"linePrefix")));return n;function s(l){if(l===null){e.consume(l);return}return e.enter("lineEndingBlank"),e.consume(l),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n}function i(l){if(l===null){e.consume(l);return}return e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),t.currentConstruct=void 0,n}}const rO={resolveAll:Q1()},sO=X1("string"),oO=X1("text");function X1(e){return{resolveAll:Q1(e==="text"?iO:void 0),tokenize:t};function t(n){const s=this,i=this.parser.constructs[e],l=n.attempt(i,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=i[h];let y=-1;if(x)for(;++y<x.length;){const v=x[y];if(!v.previous||v.previous.call(s,s.previous))return!0}return!1}}}function Q1(e){return t;function t(n,s){let i=-1,l;for(;++i<=n.length;)l===void 0?n[i]&&n[i][1].type==="data"&&(l=i,i++):(!n[i]||n[i][1].type!=="data")&&(i!==l+2&&(n[l][1].end=n[i-1][1].end,n.splice(l+2,i-l-2),i=l+2),l=void 0);return e?e(n,s):n}}function iO(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 s=e[n-1][1],i=t.sliceStream(s);let l=i.length,c=-1,d=0,p;for(;l--;){const m=i[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:s.start._bufferIndex+c,_index:s.start._index+l,line:s.end.line,column:s.end.column-d,offset:s.end.offset-d},end:{...s.end}};s.end={...m.start},s.start.offset===s.end.offset?Object.assign(s,m):(e.splice(n,0,["enter",m,t],["exit",m,t]),n+=2)}n++}return e}const aO={42:Vn,43:Vn,45:Vn,48:Vn,49:Vn,50:Vn,51:Vn,52:Vn,53:Vn,54:Vn,55:Vn,56:Vn,57:Vn,62:V1},lO={91:fI},cO={[-2]:am,[-1]:am,32:am},uO={35:yI,42:Pu,45:[Zb,Pu],60:jI,61:Zb,95:Pu,96:Xb,126:Xb},dO={38:K1,92:W1},fO={[-5]:lm,[-4]:lm,[-3]:lm,33:zI,38:K1,42:nh,60:[UL,PI],91:UI,92:[gI,W1],93:Ag,95:nh,96:tI},pO={null:[nh,rO]},mO={null:[42,95]},hO={null:[]},gO=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:mO,contentInitial:lO,disable:hO,document:aO,flow:uO,flowInitial:cO,insideSpan:pO,string:dO,text:fO},Symbol.toStringTag,{value:"Module"}));function xO(e,t,n){let s={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0};const i={},l=[];let c=[],d=[];const p={attempt:$(I),check:$(R),consume:E,enter:N,exit:P,interrupt:$(R,{interrupt:!0})},m={code:null,containerState:{},defineSkip:j,events:[],now:C,parser:e,previous:null,sliceSerialize:y,sliceStream:v,write:x};let h=t.tokenize.call(m,p);return t.resolveAll&&l.push(t),m;function x(F){return c=Sr(c,F),w(),c[c.length-1]!==null?[]:(D(t,0),m.events=Rg(l,m.events,m),m.events)}function y(F,H){return vO(v(F),H)}function v(F){return yO(c,F)}function C(){const{_bufferIndex:F,_index:H,line:J,column:_,offset:W}=s;return{_bufferIndex:F,_index:H,line:J,column:_,offset:W}}function j(F){i[F.line]=F.column,Z()}function w(){let F;for(;s._index<c.length;){const H=c[s._index];if(typeof H=="string")for(F=s._index,s._bufferIndex<0&&(s._bufferIndex=0);s._index===F&&s._bufferIndex<H.length;)S(H.charCodeAt(s._bufferIndex));else S(H)}}function S(F){h=h(F)}function E(F){Xe(F)?(s.line++,s.column=1,s.offset+=F===-3?2:1,Z()):F!==-1&&(s.column++,s.offset++),s._bufferIndex<0?s._index++:(s._bufferIndex++,s._bufferIndex===c[s._index].length&&(s._bufferIndex=-1,s._index++)),m.previous=F}function N(F,H){const J=H||{};return J.type=F,J.start=C(),m.events.push(["enter",J,m]),d.push(J),J}function P(F){const H=d.pop();return H.end=C(),m.events.push(["exit",H,m]),H}function I(F,H){D(F,H.from)}function R(F,H){H.restore()}function $(F,H){return J;function J(_,W,Y){let ie,K,ae,T;return Array.isArray(_)?q(_):"tokenize"in _?q([_]):M(_);function M(B){return oe;function oe(he){const we=he!==null&&B[he],Se=he!==null&&B.null,pe=[...Array.isArray(we)?we:we?[we]:[],...Array.isArray(Se)?Se:Se?[Se]:[]];return q(pe)(he)}}function q(B){return ie=B,K=0,B.length===0?Y:L(B[K])}function L(B){return oe;function oe(he){return T=X(),ae=B,B.partial||(m.currentConstruct=B),B.name&&m.parser.constructs.disable.null.includes(B.name)?fe():B.tokenize.call(H?Object.assign(Object.create(m),H):m,p,ue,fe)(he)}}function ue(B){return F(ae,T),W}function fe(B){return T.restore(),++K<ie.length?L(ie[K]):Y}}}function D(F,H){F.resolveAll&&!l.includes(F)&&l.push(F),F.resolve&&ss(m.events,H,m.events.length-H,F.resolve(m.events.slice(H),m)),F.resolveTo&&(m.events=F.resolveTo(m.events,m))}function X(){const F=C(),H=m.previous,J=m.currentConstruct,_=m.events.length,W=Array.from(d);return{from:_,restore:Y};function Y(){s=F,m.previous=H,m.currentConstruct=J,m.events.length=_,d=W,Z()}}function Z(){s.line in i&&s.column<2&&(s.column=i[s.line],s.offset+=i[s.line]-1)}}function yO(e,t){const n=t.start._index,s=t.start._bufferIndex,i=t.end._index,l=t.end._bufferIndex;let c;if(n===i)c=[e[n].slice(s,l)];else{if(c=e.slice(n,i),s>-1){const d=c[0];typeof d=="string"?c[0]=d.slice(s):c.shift()}l>0&&c.push(e[i].slice(0,l))}return c}function vO(e,t){let n=-1;const s=[];let i;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=`
|
|
502
|
+
`;break}case-3:{c=`\r
|
|
503
|
+
`;break}case-2:{c=t?" ":" ";break}case-1:{if(!t&&i)continue;c=" ";break}default:c=String.fromCharCode(l)}i=l===-2,s.push(c)}return s.join("")}function bO(e){const s={constructs:EL([gO,...(e||{}).extensions||[]]),content:i(IL),defined:[],document:i(_L),flow:i(tO),lazy:{},string:i(sO),text:i(oO)};return s;function i(l){return c;function c(d){return xO(s,l,d)}}}function wO(e){for(;!q1(e););return e}const ew=/[\0\t\n\r]/g;function jO(){let e=1,t="",n=!0,s;return i;function i(l,c,d){const p=[];let m,h,x,y,v;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(ew.lastIndex=x,m=ew.exec(l),y=m&&m.index!==void 0?m.index:l.length,v=l.charCodeAt(y),!m){t=l.slice(x);break}if(v===10&&x===y&&s)p.push(-3),s=void 0;else switch(s&&(p.push(-5),s=void 0),x<y&&(p.push(l.slice(x,y)),e+=y-x),v){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:s=!0,e=1}x=y+1}return d&&(s&&p.push(-5),t&&p.push(t),p.push(null)),p}}const kO=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function SO(e){return e.replace(kO,NO)}function NO(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){const i=n.charCodeAt(1),l=i===120||i===88;return H1(n.slice(l?2:1),l?16:10)}return Pg(n)||e}const Z1={}.hasOwnProperty;function CO(e,t,n){return t&&typeof t=="object"&&(n=t,t=void 0),EO(n)(wO(bO(n).document().write(jO()(e,t,!0))))}function EO(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:l(Fe),autolinkProtocol:X,autolinkEmail:X,atxHeading:l(ne),blockQuote:l(Se),characterEscape:X,characterReference:X,codeFenced:l(pe),codeFencedFenceInfo:c,codeFencedFenceMeta:c,codeIndented:l(pe,c),codeText:l(He,c),codeTextData:X,data:X,codeFlowValue:X,definition:l(te),definitionDestinationString:c,definitionLabelString:c,definitionTitleString:c,emphasis:l(ye),hardBreakEscape:l(U),hardBreakTrailing:l(U),htmlFlow:l(de,c),htmlFlowData:X,htmlText:l(de,c),htmlTextData:X,image:l(me),label:c,link:l(Fe),listItem:l(Ve),listItemValue:y,listOrdered:l(qe,x),listUnordered:l(qe),paragraph:l(Ze),reference:L,referenceString:c,resourceDestinationString:c,resourceTitleString:c,setextHeading:l(ne),strong:l(St),thematicBreak:l(gt)},exit:{atxHeading:p(),atxHeadingSequence:I,autolink:p(),autolinkEmail:we,autolinkProtocol:he,blockQuote:p(),characterEscapeValue:Z,characterReferenceMarkerHexadecimal:fe,characterReferenceMarkerNumeric:fe,characterReferenceValue:B,characterReference:oe,codeFenced:p(w),codeFencedFence:j,codeFencedFenceInfo:v,codeFencedFenceMeta:C,codeFlowValue:Z,codeIndented:p(S),codeText:p(W),codeTextData:Z,data:Z,definition:p(),definitionDestinationString:P,definitionLabelString:E,definitionTitleString:N,emphasis:p(),hardBreakEscape:p(H),hardBreakTrailing:p(H),htmlFlow:p(J),htmlFlowData:Z,htmlText:p(_),htmlTextData:Z,image:p(ie),label:ae,labelText:K,lineEnding:F,link:p(Y),listItem:p(),listOrdered:p(),listUnordered:p(),paragraph:p(),referenceString:ue,resourceDestinationString:T,resourceTitleString:M,resource:q,setextHeading:p(D),setextHeadingLineSequence:$,setextHeadingText:R,strong:p(),thematicBreak:p()}};eS(t,(e||{}).mdastExtensions||[]);const n={};return s;function s(ce){let ve={type:"root",children:[]};const De={stack:[ve],tokenStack:[],config:t,enter:d,exit:m,buffer:c,resume:h,data:n},Oe=[];let Ye=-1;for(;++Ye<ce.length;)if(ce[Ye][1].type==="listOrdered"||ce[Ye][1].type==="listUnordered")if(ce[Ye][0]==="enter")Oe.push(Ye);else{const et=Oe.pop();Ye=i(ce,et,Ye)}for(Ye=-1;++Ye<ce.length;){const et=t[ce[Ye][0]];Z1.call(et,ce[Ye][1].type)&&et[ce[Ye][1].type].call(Object.assign({sliceSerialize:ce[Ye][2].sliceSerialize},De),ce[Ye][1])}if(De.tokenStack.length>0){const et=De.tokenStack[De.tokenStack.length-1];(et[1]||tw).call(De,void 0,et[0])}for(ve.position={start:qs(ce.length>0?ce[0][1].start:{line:1,column:1,offset:0}),end:qs(ce.length>0?ce[ce.length-2][1].end:{line:1,column:1,offset:0})},Ye=-1;++Ye<t.transforms.length;)ve=t.transforms[Ye](ve)||ve;return ve}function i(ce,ve,De){let Oe=ve-1,Ye=-1,et=!1,It,ge,Qe,Ge;for(;++Oe<=De;){const xt=ce[Oe];switch(xt[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{xt[0]==="enter"?Ye++:Ye--,Ge=void 0;break}case"lineEndingBlank":{xt[0]==="enter"&&(It&&!Ge&&!Ye&&!Qe&&(Qe=Oe),Ge=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:Ge=void 0}if(!Ye&&xt[0]==="enter"&&xt[1].type==="listItemPrefix"||Ye===-1&&xt[0]==="exit"&&(xt[1].type==="listUnordered"||xt[1].type==="listOrdered")){if(It){let Kt=Oe;for(ge=void 0;Kt--;){const Bt=ce[Kt];if(Bt[1].type==="lineEnding"||Bt[1].type==="lineEndingBlank"){if(Bt[0]==="exit")continue;ge&&(ce[ge][1].type="lineEndingBlank",et=!0),Bt[1].type="lineEnding",ge=Kt}else if(!(Bt[1].type==="linePrefix"||Bt[1].type==="blockQuotePrefix"||Bt[1].type==="blockQuotePrefixWhitespace"||Bt[1].type==="blockQuoteMarker"||Bt[1].type==="listItemIndent"))break}Qe&&(!ge||Qe<ge)&&(It._spread=!0),It.end=Object.assign({},ge?ce[ge][1].start:xt[1].end),ce.splice(ge||Oe,0,["exit",It,xt[2]]),Oe++,De++}if(xt[1].type==="listItemPrefix"){const Kt={type:"listItem",_spread:!1,start:Object.assign({},xt[1].start),end:void 0};It=Kt,ce.splice(Oe,0,["enter",Kt,xt[2]]),Oe++,De++,Qe=void 0,Ge=!0}}}return ce[ve][1]._spread=et,De}function l(ce,ve){return De;function De(Oe){d.call(this,ce(Oe),Oe),ve&&ve.call(this,Oe)}}function c(){this.stack.push({type:"fragment",children:[]})}function d(ce,ve,De){this.stack[this.stack.length-1].children.push(ce),this.stack.push(ce),this.tokenStack.push([ve,De||void 0]),ce.position={start:qs(ve.start),end:void 0}}function p(ce){return ve;function ve(De){ce&&ce.call(this,De),m.call(this,De)}}function m(ce,ve){const De=this.stack.pop(),Oe=this.tokenStack.pop();if(Oe)Oe[0].type!==ce.type&&(ve?ve.call(this,ce,Oe[0]):(Oe[1]||tw).call(this,ce,Oe[0]));else throw new Error("Cannot close `"+ce.type+"` ("+xl({start:ce.start,end:ce.end})+"): it’s not open");De.position.end=qs(ce.end)}function h(){return NL(this.stack.pop())}function x(){this.data.expectingFirstListItemValue=!0}function y(ce){if(this.data.expectingFirstListItemValue){const ve=this.stack[this.stack.length-2];ve.start=Number.parseInt(this.sliceSerialize(ce),10),this.data.expectingFirstListItemValue=void 0}}function v(){const ce=this.resume(),ve=this.stack[this.stack.length-1];ve.lang=ce}function C(){const ce=this.resume(),ve=this.stack[this.stack.length-1];ve.meta=ce}function j(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function w(){const ce=this.resume(),ve=this.stack[this.stack.length-1];ve.value=ce.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function S(){const ce=this.resume(),ve=this.stack[this.stack.length-1];ve.value=ce.replace(/(\r?\n|\r)$/g,"")}function E(ce){const ve=this.resume(),De=this.stack[this.stack.length-1];De.label=ve,De.identifier=Ui(this.sliceSerialize(ce)).toLowerCase()}function N(){const ce=this.resume(),ve=this.stack[this.stack.length-1];ve.title=ce}function P(){const ce=this.resume(),ve=this.stack[this.stack.length-1];ve.url=ce}function I(ce){const ve=this.stack[this.stack.length-1];if(!ve.depth){const De=this.sliceSerialize(ce).length;ve.depth=De}}function R(){this.data.setextHeadingSlurpLineEnding=!0}function $(ce){const ve=this.stack[this.stack.length-1];ve.depth=this.sliceSerialize(ce).codePointAt(0)===61?1:2}function D(){this.data.setextHeadingSlurpLineEnding=void 0}function X(ce){const De=this.stack[this.stack.length-1].children;let Oe=De[De.length-1];(!Oe||Oe.type!=="text")&&(Oe=bt(),Oe.position={start:qs(ce.start),end:void 0},De.push(Oe)),this.stack.push(Oe)}function Z(ce){const ve=this.stack.pop();ve.value+=this.sliceSerialize(ce),ve.position.end=qs(ce.end)}function F(ce){const ve=this.stack[this.stack.length-1];if(this.data.atHardBreak){const De=ve.children[ve.children.length-1];De.position.end=qs(ce.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(ve.type)&&(X.call(this,ce),Z.call(this,ce))}function H(){this.data.atHardBreak=!0}function J(){const ce=this.resume(),ve=this.stack[this.stack.length-1];ve.value=ce}function _(){const ce=this.resume(),ve=this.stack[this.stack.length-1];ve.value=ce}function W(){const ce=this.resume(),ve=this.stack[this.stack.length-1];ve.value=ce}function Y(){const ce=this.stack[this.stack.length-1];if(this.data.inReference){const ve=this.data.referenceType||"shortcut";ce.type+="Reference",ce.referenceType=ve,delete ce.url,delete ce.title}else delete ce.identifier,delete ce.label;this.data.referenceType=void 0}function ie(){const ce=this.stack[this.stack.length-1];if(this.data.inReference){const ve=this.data.referenceType||"shortcut";ce.type+="Reference",ce.referenceType=ve,delete ce.url,delete ce.title}else delete ce.identifier,delete ce.label;this.data.referenceType=void 0}function K(ce){const ve=this.sliceSerialize(ce),De=this.stack[this.stack.length-2];De.label=SO(ve),De.identifier=Ui(ve).toLowerCase()}function ae(){const ce=this.stack[this.stack.length-1],ve=this.resume(),De=this.stack[this.stack.length-1];if(this.data.inReference=!0,De.type==="link"){const Oe=ce.children;De.children=Oe}else De.alt=ve}function T(){const ce=this.resume(),ve=this.stack[this.stack.length-1];ve.url=ce}function M(){const ce=this.resume(),ve=this.stack[this.stack.length-1];ve.title=ce}function q(){this.data.inReference=void 0}function L(){this.data.referenceType="collapsed"}function ue(ce){const ve=this.resume(),De=this.stack[this.stack.length-1];De.label=ve,De.identifier=Ui(this.sliceSerialize(ce)).toLowerCase(),this.data.referenceType="full"}function fe(ce){this.data.characterReferenceType=ce.type}function B(ce){const ve=this.sliceSerialize(ce),De=this.data.characterReferenceType;let Oe;De?(Oe=H1(ve,De==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):Oe=Pg(ve);const Ye=this.stack[this.stack.length-1];Ye.value+=Oe}function oe(ce){const ve=this.stack.pop();ve.position.end=qs(ce.end)}function he(ce){Z.call(this,ce);const ve=this.stack[this.stack.length-1];ve.url=this.sliceSerialize(ce)}function we(ce){Z.call(this,ce);const ve=this.stack[this.stack.length-1];ve.url="mailto:"+this.sliceSerialize(ce)}function Se(){return{type:"blockquote",children:[]}}function pe(){return{type:"code",lang:null,meta:null,value:""}}function He(){return{type:"inlineCode",value:""}}function te(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function ye(){return{type:"emphasis",children:[]}}function ne(){return{type:"heading",depth:0,children:[]}}function U(){return{type:"break"}}function de(){return{type:"html",value:""}}function me(){return{type:"image",title:null,url:"",alt:null}}function Fe(){return{type:"link",title:null,url:"",children:[]}}function qe(ce){return{type:"list",ordered:ce.type==="listOrdered",start:null,spread:ce._spread,children:[]}}function Ve(ce){return{type:"listItem",spread:ce._spread,checked:null,children:[]}}function Ze(){return{type:"paragraph",children:[]}}function St(){return{type:"strong",children:[]}}function bt(){return{type:"text",value:""}}function gt(){return{type:"thematicBreak"}}}function qs(e){return{line:e.line,column:e.column,offset:e.offset}}function eS(e,t){let n=-1;for(;++n<t.length;){const s=t[n];Array.isArray(s)?eS(e,s):TO(e,s)}}function TO(e,t){let n;for(n in t)if(Z1.call(t,n))switch(n){case"canContainEols":{const s=t[n];s&&e[n].push(...s);break}case"transforms":{const s=t[n];s&&e[n].push(...s);break}case"enter":case"exit":{const s=t[n];s&&Object.assign(e[n],s);break}}}function tw(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+xl({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+xl({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+xl({start:t.start,end:t.end})+") is still open")}function PO(e){const t=this;t.parser=n;function n(s){return CO(s,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function RO(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 AO(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:`
|
|
504
|
+
`}]}function DO(e,t){const n=t.value?t.value+`
|
|
505
|
+
`:"",s={},i=t.lang?t.lang.split(/\s+/):[];i.length>0&&(s.className=["language-"+i[0]]);let l={type:"element",tagName:"code",properties:s,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 $O(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function LO(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function IO(e,t){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",s=String(t.identifier).toUpperCase(),i=oa(s.toLowerCase()),l=e.footnoteOrder.indexOf(s);let c,d=e.footnoteCounts.get(s);d===void 0?(d=0,e.footnoteOrder.push(s),c=e.footnoteOrder.length):c=l+1,d+=1,e.footnoteCounts.set(s,d);const p={type:"element",tagName:"a",properties:{href:"#"+n+"fn-"+i,id:n+"fnref-"+i+(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 OO(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 _O(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}}function tS(e,t){const n=t.referenceType;let s="]";if(n==="collapsed"?s+="[]":n==="full"&&(s+="["+(t.label||t.identifier)+"]"),t.type==="imageReference")return[{type:"text",value:"!["+t.alt+s}];const i=e.all(t),l=i[0];l&&l.type==="text"?l.value="["+l.value:i.unshift({type:"text",value:"["});const c=i[i.length-1];return c&&c.type==="text"?c.value+=s:i.push({type:"text",value:s}),i}function MO(e,t){const n=String(t.identifier).toUpperCase(),s=e.definitionById.get(n);if(!s)return tS(e,t);const i={src:oa(s.url||""),alt:t.alt};s.title!==null&&s.title!==void 0&&(i.title=s.title);const l={type:"element",tagName:"img",properties:i,children:[]};return e.patch(t,l),e.applyData(t,l)}function FO(e,t){const n={src:oa(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 s={type:"element",tagName:"img",properties:n,children:[]};return e.patch(t,s),e.applyData(t,s)}function zO(e,t){const n={type:"text",value:t.value.replace(/\r?\n|\r/g," ")};e.patch(t,n);const s={type:"element",tagName:"code",properties:{},children:[n]};return e.patch(t,s),e.applyData(t,s)}function BO(e,t){const n=String(t.identifier).toUpperCase(),s=e.definitionById.get(n);if(!s)return tS(e,t);const i={href:oa(s.url||"")};s.title!==null&&s.title!==void 0&&(i.title=s.title);const l={type:"element",tagName:"a",properties:i,children:e.all(t)};return e.patch(t,l),e.applyData(t,l)}function UO(e,t){const n={href:oa(t.url)};t.title!==null&&t.title!==void 0&&(n.title=t.title);const s={type:"element",tagName:"a",properties:n,children:e.all(t)};return e.patch(t,s),e.applyData(t,s)}function HO(e,t,n){const s=e.all(t),i=n?VO(n):nS(t),l={},c=[];if(typeof t.checked=="boolean"){const h=s[0];let x;h&&h.type==="element"&&h.tagName==="p"?x=h:(x={type:"element",tagName:"p",properties:{},children:[]},s.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<s.length;){const h=s[d];(i||d!==0||h.type!=="element"||h.tagName!=="p")&&c.push({type:"text",value:`
|
|
506
|
+
`}),h.type==="element"&&h.tagName==="p"&&!i?c.push(...h.children):c.push(h)}const p=s[s.length-1];p&&(i||p.type!=="element"||p.tagName!=="p")&&c.push({type:"text",value:`
|
|
507
|
+
`});const m={type:"element",tagName:"li",properties:l,children:c};return e.patch(t,m),e.applyData(t,m)}function VO(e){let t=!1;if(e.type==="list"){t=e.spread||!1;const n=e.children;let s=-1;for(;!t&&++s<n.length;)t=nS(n[s])}return t}function nS(e){const t=e.spread;return t??e.children.length>1}function WO(e,t){const n={},s=e.all(t);let i=-1;for(typeof t.start=="number"&&t.start!==1&&(n.start=t.start);++i<s.length;){const c=s[i];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(s,!0)};return e.patch(t,l),e.applyData(t,l)}function KO(e,t){const n={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function qO(e,t){const n={type:"root",children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function GO(e,t){const n={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function YO(e,t){const n=e.all(t),s=n.shift(),i=[];if(s){const c={type:"element",tagName:"thead",properties:{},children:e.wrap([s],!0)};e.patch(t.children[0],c),i.push(c)}if(n.length>0){const c={type:"element",tagName:"tbody",properties:{},children:e.wrap(n,!0)},d=Ng(t.children[1]),p=O1(t.children[t.children.length-1]);d&&p&&(c.position={start:d,end:p}),i.push(c)}const l={type:"element",tagName:"table",properties:{},children:e.wrap(i,!0)};return e.patch(t,l),e.applyData(t,l)}function JO(e,t,n){const s=n?n.children:void 0,l=(s?s.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],y={},v=c?c[p]:void 0;v&&(y.align=v);let C={type:"element",tagName:l,properties:y,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 XO(e,t){const n={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}const nw=9,rw=32;function QO(e){const t=String(e),n=/\r?\n|\r/g;let s=n.exec(t),i=0;const l=[];for(;s;)l.push(sw(t.slice(i,s.index),i>0,!0),s[0]),i=s.index+s[0].length,s=n.exec(t);return l.push(sw(t.slice(i),i>0,!1)),l.join("")}function sw(e,t,n){let s=0,i=e.length;if(t){let l=e.codePointAt(s);for(;l===nw||l===rw;)s++,l=e.codePointAt(s)}if(n){let l=e.codePointAt(i-1);for(;l===nw||l===rw;)i--,l=e.codePointAt(i-1)}return i>s?e.slice(s,i):""}function ZO(e,t){const n={type:"text",value:QO(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function e_(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const t_={blockquote:RO,break:AO,code:DO,delete:$O,emphasis:LO,footnoteReference:IO,heading:OO,html:_O,imageReference:MO,image:FO,inlineCode:zO,linkReference:BO,link:UO,listItem:HO,list:WO,paragraph:KO,root:qO,strong:GO,table:YO,tableCell:XO,tableRow:JO,text:ZO,thematicBreak:e_,toml:uu,yaml:uu,definition:uu,footnoteDefinition:uu};function uu(){}const rS=-1,Pd=0,vl=1,Hu=2,Dg=3,$g=4,Lg=5,Ig=6,sS=7,oS=8,ow=typeof self=="object"?self:globalThis,n_=(e,t)=>{const n=(i,l)=>(e.set(l,i),i),s=i=>{if(e.has(i))return e.get(i);const[l,c]=t[i];switch(l){case Pd:case rS:return n(c,i);case vl:{const d=n([],i);for(const p of c)d.push(s(p));return d}case Hu:{const d=n({},i);for(const[p,m]of c)d[s(p)]=s(m);return d}case Dg:return n(new Date(c),i);case $g:{const{source:d,flags:p}=c;return n(new RegExp(d,p),i)}case Lg:{const d=n(new Map,i);for(const[p,m]of c)d.set(s(p),s(m));return d}case Ig:{const d=n(new Set,i);for(const p of c)d.add(s(p));return d}case sS:{const{name:d,message:p}=c;return n(new ow[d](p),i)}case oS:return n(BigInt(c),i);case"BigInt":return n(Object(BigInt(c)),i);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 ow[l](c),i)};return s},iw=e=>n_(new Map,e)(0),Si="",{toString:r_}={},{keys:s_}=Object,al=e=>{const t=typeof e;if(t!=="object"||!e)return[Pd,t];const n=r_.call(e).slice(8,-1);switch(n){case"Array":return[vl,Si];case"Object":return[Hu,Si];case"Date":return[Dg,Si];case"RegExp":return[$g,Si];case"Map":return[Lg,Si];case"Set":return[Ig,Si];case"DataView":return[vl,n]}return n.includes("Array")?[vl,n]:n.includes("Error")?[sS,n]:[Hu,n]},du=([e,t])=>e===Pd&&(t==="function"||t==="symbol"),o_=(e,t,n,s)=>{const i=(c,d)=>{const p=s.push(c)-1;return n.set(d,p),p},l=c=>{if(n.has(c))return n.get(c);let[d,p]=al(c);switch(d){case Pd:{let h=c;switch(p){case"bigint":d=oS,h=c.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+p);h=null;break;case"undefined":return i([rS],c)}return i([d,h],c)}case vl:{if(p){let y=c;return p==="DataView"?y=new Uint8Array(c.buffer):p==="ArrayBuffer"&&(y=new Uint8Array(c)),i([p,[...y]],c)}const h=[],x=i([d,h],c);for(const y of c)h.push(l(y));return x}case Hu:{if(p)switch(p){case"BigInt":return i([p,c.toString()],c);case"Boolean":case"Number":case"String":return i([p,c.valueOf()],c)}if(t&&"toJSON"in c)return l(c.toJSON());const h=[],x=i([d,h],c);for(const y of s_(c))(e||!du(al(c[y])))&&h.push([l(y),l(c[y])]);return x}case Dg:return i([d,c.toISOString()],c);case $g:{const{source:h,flags:x}=c;return i([d,{source:h,flags:x}],c)}case Lg:{const h=[],x=i([d,h],c);for(const[y,v]of c)(e||!(du(al(y))||du(al(v))))&&h.push([l(y),l(v)]);return x}case Ig:{const h=[],x=i([d,h],c);for(const y of c)(e||!du(al(y)))&&h.push(l(y));return x}}const{message:m}=c;return i([d,{name:p,message:m}],c)};return l},aw=(e,{json:t,lossy:n}={})=>{const s=[];return o_(!(t||n),!!t,new Map,s)(e),s},Vu=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?iw(aw(e,t)):structuredClone(e):(e,t)=>iw(aw(e,t));function i_(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 a_(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function l_(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||i_,s=e.options.footnoteBackLabel||a_,i=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(),y=oa(x.toLowerCase());let v=0;const C=[],j=e.footnoteCounts.get(x);for(;j!==void 0&&++v<=j;){C.length>0&&C.push({type:"text",value:" "});let E=typeof n=="string"?n:n(p,v);typeof E=="string"&&(E={type:"text",value:E}),C.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+y+(v>1?"-"+v:""),dataFootnoteBackref:"",ariaLabel:typeof s=="string"?s:s(p,v),className:["data-footnote-backref"]},children:Array.isArray(E)?E:[E]})}const w=h[h.length-1];if(w&&w.type==="element"&&w.tagName==="p"){const E=w.children[w.children.length-1];E&&E.type==="text"?E.value+=" ":w.children.push({type:"text",value:" "}),w.children.push(...C)}else h.push(...C);const S={type:"element",tagName:"li",properties:{id:t+"fn-"+y},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:{...Vu(c),id:"footnote-label"},children:[{type:"text",value:i}]},{type:"text",value:`
|
|
508
|
+
`},{type:"element",tagName:"ol",properties:{},children:e.wrap(d,!0)},{type:"text",value:`
|
|
509
|
+
`}]}}const iS=(function(e){if(e==null)return f_;if(typeof e=="function")return Rd(e);if(typeof e=="object")return Array.isArray(e)?c_(e):u_(e);if(typeof e=="string")return d_(e);throw new Error("Expected function, string, or object as test")});function c_(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=iS(e[n]);return Rd(s);function s(...i){let l=-1;for(;++l<t.length;)if(t[l].apply(this,i))return!0;return!1}}function u_(e){const t=e;return Rd(n);function n(s){const i=s;let l;for(l in e)if(i[l]!==t[l])return!1;return!0}}function d_(e){return Rd(t);function t(n){return n&&n.type===e}}function Rd(e){return t;function t(n,s,i){return!!(p_(n)&&e.call(this,n,typeof s=="number"?s:void 0,i||void 0))}}function f_(){return!0}function p_(e){return e!==null&&typeof e=="object"&&"type"in e}const aS=[],m_=!0,lw=!1,h_="skip";function g_(e,t,n,s){let i;typeof t=="function"&&typeof n!="function"?(s=n,n=t):i=t;const l=iS(i),c=s?-1:1;d(e,void 0,[])();function d(p,m,h){const x=p&&typeof p=="object"?p:{};if(typeof x.type=="string"){const v=typeof x.tagName=="string"?x.tagName:typeof x.name=="string"?x.name:void 0;Object.defineProperty(y,"name",{value:"node ("+(p.type+(v?"<"+v+">":""))+")"})}return y;function y(){let v=aS,C,j,w;if((!t||l(p,m,h[h.length-1]||void 0))&&(v=x_(n(p,h)),v[0]===lw))return v;if("children"in p&&p.children){const S=p;if(S.children&&v[0]!==h_)for(j=(s?S.children.length:-1)+c,w=h.concat(S);j>-1&&j<S.children.length;){const E=S.children[j];if(C=d(E,j,w)(),C[0]===lw)return C;j=typeof C[1]=="number"?C[1]:j+c}}return v}}}function x_(e){return Array.isArray(e)?e:typeof e=="number"?[m_,e]:e==null?aS:[e]}function lS(e,t,n,s){let i,l,c;typeof t=="function"&&typeof n!="function"?(l=void 0,c=t,i=n):(l=t,c=n,i=s),g_(e,l,d,i);function d(p,m){const h=m[m.length-1],x=h?h.children.indexOf(p):void 0;return c(p,x,h)}}const rh={}.hasOwnProperty,y_={};function v_(e,t){const n=t||y_,s=new Map,i=new Map,l=new Map,c={...t_,...n.handlers},d={all:m,applyData:w_,definitionById:s,footnoteById:i,footnoteCounts:l,footnoteOrder:[],handlers:c,one:p,options:n,patch:b_,wrap:k_};return lS(e,function(h){if(h.type==="definition"||h.type==="footnoteDefinition"){const x=h.type==="definition"?s:i,y=String(h.identifier).toUpperCase();x.has(y)||x.set(y,h)}}),d;function p(h,x){const y=h.type,v=d.handlers[y];if(rh.call(d.handlers,y)&&v)return v(d,h,x);if(d.options.passThrough&&d.options.passThrough.includes(y)){if("children"in h){const{children:j,...w}=h,S=Vu(w);return S.children=d.all(h),S}return Vu(h)}return(d.options.unknownHandler||j_)(d,h,x)}function m(h){const x=[];if("children"in h){const y=h.children;let v=-1;for(;++v<y.length;){const C=d.one(y[v],h);if(C){if(v&&y[v-1].type==="break"&&(!Array.isArray(C)&&C.type==="text"&&(C.value=cw(C.value)),!Array.isArray(C)&&C.type==="element")){const j=C.children[0];j&&j.type==="text"&&(j.value=cw(j.value))}Array.isArray(C)?x.push(...C):x.push(C)}}}return x}}function b_(e,t){e.position&&(t.position=rL(e))}function w_(e,t){let n=t;if(e&&e.data){const s=e.data.hName,i=e.data.hChildren,l=e.data.hProperties;if(typeof s=="string")if(n.type==="element")n.tagName=s;else{const c="children"in n?n.children:[n];n={type:"element",tagName:s,properties:{},children:c}}n.type==="element"&&l&&Object.assign(n.properties,Vu(l)),"children"in n&&n.children&&i!==null&&i!==void 0&&(n.children=i)}return n}function j_(e,t){const n=t.data||{},s="value"in t&&!(rh.call(n,"hProperties")||rh.call(n,"hChildren"))?{type:"text",value:t.value}:{type:"element",tagName:"div",properties:{},children:e.all(t)};return e.patch(t,s),e.applyData(t,s)}function k_(e,t){const n=[];let s=-1;for(t&&n.push({type:"text",value:`
|
|
510
|
+
`});++s<e.length;)s&&n.push({type:"text",value:`
|
|
511
|
+
`}),n.push(e[s]);return t&&e.length>0&&n.push({type:"text",value:`
|
|
512
|
+
`}),n}function cw(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function uw(e,t){const n=v_(e,t),s=n.one(e,void 0),i=l_(n),l=Array.isArray(s)?{type:"root",children:s}:s||{type:"root",children:[]};return i&&l.children.push({type:"text",value:`
|
|
513
|
+
`},i),l}function S_(e,t){return e&&"run"in e?async function(n,s){const i=uw(n,{file:s,...t});await e.run(i,s)}:function(n,s){return uw(n,{file:s,...e||t})}}function dw(e){if(e)throw e}var cm,fw;function N_(){if(fw)return cm;fw=1;var e=Object.prototype.hasOwnProperty,t=Object.prototype.toString,n=Object.defineProperty,s=Object.getOwnPropertyDescriptor,i=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 y;for(y in m);return typeof y>"u"||e.call(m,y)},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(s)return s(m,h).value}else return;return m[h]};return cm=function p(){var m,h,x,y,v,C,j=arguments[0],w=1,S=arguments.length,E=!1;for(typeof j=="boolean"&&(E=j,j=arguments[1]||{},w=2),(j==null||typeof j!="object"&&typeof j!="function")&&(j={});w<S;++w)if(m=arguments[w],m!=null)for(h in m)x=d(j,h),y=d(m,h),j!==y&&(E&&y&&(l(y)||(v=i(y)))?(v?(v=!1,C=x&&i(x)?x:[]):C=x&&l(x)?x:{},c(j,{name:h,newValue:p(E,C,y)})):typeof y<"u"&&c(j,{name:h,newValue:y}));return j},cm}var C_=N_();const um=Zu(C_);function sh(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 E_(){const e=[],t={run:n,use:s};return t;function n(...i){let l=-1;const c=i.pop();if(typeof c!="function")throw new TypeError("Expected function as last argument, not "+c);d(null,...i);function d(p,...m){const h=e[++l];let x=-1;if(p){c(p);return}for(;++x<i.length;)(m[x]===null||m[x]===void 0)&&(m[x]=i[x]);i=m,h?T_(h,d)(...m):c(null,...m)}}function s(i){if(typeof i!="function")throw new TypeError("Expected `middelware` to be a function, not "+i);return e.push(i),t}}function T_(e,t){let n;return s;function s(...c){const d=e.length>c.length;let p;d&&c.push(i);try{p=e.apply(this,c)}catch(m){const h=m;if(d&&n)throw h;return i(h)}d||(p&&p.then&&typeof p.then=="function"?p.then(l,i):p instanceof Error?i(p):l(p))}function i(c,...d){n||(n=!0,t(c,...d))}function l(c){i(null,c)}}const Jr={basename:P_,dirname:R_,extname:A_,join:D_,sep:"/"};function P_(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');Gl(e);let n=0,s=-1,i=e.length,l;if(t===void 0||t.length===0||t.length>e.length){for(;i--;)if(e.codePointAt(i)===47){if(l){n=i+1;break}}else s<0&&(l=!0,s=i+1);return s<0?"":e.slice(n,s)}if(t===e)return"";let c=-1,d=t.length-1;for(;i--;)if(e.codePointAt(i)===47){if(l){n=i+1;break}}else c<0&&(l=!0,c=i+1),d>-1&&(e.codePointAt(i)===t.codePointAt(d--)?d<0&&(s=i):(d=-1,s=c));return n===s?s=c:s<0&&(s=e.length),e.slice(n,s)}function R_(e){if(Gl(e),e.length===0)return".";let t=-1,n=e.length,s;for(;--n;)if(e.codePointAt(n)===47){if(s){t=n;break}}else s||(s=!0);return t<0?e.codePointAt(0)===47?"/":".":t===1&&e.codePointAt(0)===47?"//":e.slice(0,t)}function A_(e){Gl(e);let t=e.length,n=-1,s=0,i=-1,l=0,c;for(;t--;){const d=e.codePointAt(t);if(d===47){if(c){s=t+1;break}continue}n<0&&(c=!0,n=t+1),d===46?i<0?i=t:l!==1&&(l=1):i>-1&&(l=-1)}return i<0||n<0||l===0||l===1&&i===n-1&&i===s+1?"":e.slice(i,n)}function D_(...e){let t=-1,n;for(;++t<e.length;)Gl(e[t]),e[t]&&(n=n===void 0?e[t]:n+"/"+e[t]);return n===void 0?".":$_(n)}function $_(e){Gl(e);const t=e.codePointAt(0)===47;let n=L_(e,!t);return n.length===0&&!t&&(n="."),n.length>0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function L_(e,t){let n="",s=0,i=-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(!(i===c-1||l===1))if(i!==c-1&&l===2){if(n.length<2||s!==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="",s=0):(n=n.slice(0,p),s=n.length-1-n.lastIndexOf("/")),i=c,l=0;continue}}else if(n.length>0){n="",s=0,i=c,l=0;continue}}t&&(n=n.length>0?n+"/..":"..",s=2)}else n.length>0?n+="/"+e.slice(i+1,c):n=e.slice(i+1,c),s=c-i-1;i=c,l=0}else d===46&&l>-1?l++:l=-1}return n}function Gl(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const I_={cwd:O_};function O_(){return"/"}function oh(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function __(e){if(typeof e=="string")e=new URL(e);else if(!oh(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 M_(e)}function M_(e){if(e.hostname!==""){const s=new TypeError('File URL host must be "localhost" or empty on darwin');throw s.code="ERR_INVALID_FILE_URL_HOST",s}const t=e.pathname;let n=-1;for(;++n<t.length;)if(t.codePointAt(n)===37&&t.codePointAt(n+1)===50){const s=t.codePointAt(n+2);if(s===70||s===102){const i=new TypeError("File URL path must not include encoded / characters");throw i.code="ERR_INVALID_FILE_URL_PATH",i}}return decodeURIComponent(t)}const dm=["history","path","basename","stem","extname","dirname"];class cS{constructor(t){let n;t?oh(t)?n={path:t}:typeof t=="string"||F_(t)?n={value:t}:n=t:n={},this.cwd="cwd"in n?"":I_.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let s=-1;for(;++s<dm.length;){const l=dm[s];l in n&&n[l]!==void 0&&n[l]!==null&&(this[l]=l==="history"?[...n[l]]:n[l])}let i;for(i in n)dm.includes(i)||(this[i]=n[i])}get basename(){return typeof this.path=="string"?Jr.basename(this.path):void 0}set basename(t){pm(t,"basename"),fm(t,"basename"),this.path=Jr.join(this.dirname||"",t)}get dirname(){return typeof this.path=="string"?Jr.dirname(this.path):void 0}set dirname(t){pw(this.basename,"dirname"),this.path=Jr.join(t||"",this.basename)}get extname(){return typeof this.path=="string"?Jr.extname(this.path):void 0}set extname(t){if(fm(t,"extname"),pw(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=Jr.join(this.dirname,this.stem+(t||""))}get path(){return this.history[this.history.length-1]}set path(t){oh(t)&&(t=__(t)),pm(t,"path"),this.path!==t&&this.history.push(t)}get stem(){return typeof this.path=="string"?Jr.basename(this.path,this.extname):void 0}set stem(t){pm(t,"stem"),fm(t,"stem"),this.path=Jr.join(this.dirname||"",t+(this.extname||""))}fail(t,n,s){const i=this.message(t,n,s);throw i.fatal=!0,i}info(t,n,s){const i=this.message(t,n,s);return i.fatal=void 0,i}message(t,n,s){const i=new Pn(t,n,s);return this.path&&(i.name=this.path+":"+i.name,i.file=this.path),i.fatal=!1,this.messages.push(i),i}toString(t){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(t||void 0).decode(this.value)}}function fm(e,t){if(e&&e.includes(Jr.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+Jr.sep+"`")}function pm(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function pw(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function F_(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const z_=(function(e){const s=this.constructor.prototype,i=s[e],l=function(){return i.apply(l,arguments)};return Object.setPrototypeOf(l,s),l}),B_={}.hasOwnProperty;class Og extends z_{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=E_()}copy(){const t=new Og;let n=-1;for(;++n<this.attachers.length;){const s=this.attachers[n];t.use(...s)}return t.data(um(!0,{},this.namespace)),t}data(t,n){return typeof t=="string"?arguments.length===2?(gm("data",this.frozen),this.namespace[t]=n,this):B_.call(this.namespace,t)&&this.namespace[t]||void 0:t?(gm("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,...s]=this.attachers[this.freezeIndex];if(s[0]===!1)continue;s[0]===!0&&(s[0]=void 0);const i=n.call(t,...s);typeof i=="function"&&this.transformers.use(i)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(t){this.freeze();const n=fu(t),s=this.parser||this.Parser;return mm("parse",s),s(String(n),n)}process(t,n){const s=this;return this.freeze(),mm("process",this.parser||this.Parser),hm("process",this.compiler||this.Compiler),n?i(void 0,n):new Promise(i);function i(l,c){const d=fu(t),p=s.parse(d);s.run(p,d,function(h,x,y){if(h||!x||!y)return m(h);const v=x,C=s.stringify(v,y);V_(C)?y.value=C:y.result=C,m(h,y)});function m(h,x){h||!x?c(h):l?l(x):n(void 0,x)}}}processSync(t){let n=!1,s;return this.freeze(),mm("processSync",this.parser||this.Parser),hm("processSync",this.compiler||this.Compiler),this.process(t,i),hw("processSync","process",n),s;function i(l,c){n=!0,dw(l),s=c}}run(t,n,s){mw(t),this.freeze();const i=this.transformers;return!s&&typeof n=="function"&&(s=n,n=void 0),s?l(void 0,s):new Promise(l);function l(c,d){const p=fu(n);i.run(t,p,m);function m(h,x,y){const v=x||t;h?d(h):c?c(v):s(void 0,v,y)}}}runSync(t,n){let s=!1,i;return this.run(t,n,l),hw("runSync","run",s),i;function l(c,d){dw(c),i=d,s=!0}}stringify(t,n){this.freeze();const s=fu(n),i=this.compiler||this.Compiler;return hm("stringify",i),mw(t),i(t,s)}use(t,...n){const s=this.attachers,i=this.namespace;if(gm("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&&(i.settings=um(!0,i.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,y=-1;for(;++x<s.length;)if(s[x][0]===m){y=x;break}if(y===-1)s.push([m,...h]);else if(h.length>0){let[v,...C]=h;const j=s[y][1];sh(j)&&sh(v)&&(v=um(!0,j,v)),s[y]=[m,v,...C]}}}}const U_=new Og().freeze();function mm(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function hm(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function gm(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 mw(e){if(!sh(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function hw(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function fu(e){return H_(e)?e:new cS(e)}function H_(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function V_(e){return typeof e=="string"||W_(e)}function W_(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const K_="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",gw=[],xw={allowDangerousHtml:!0},q_=/^(https?|ircs?|mailto|xmpp)$/i,G_=[{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 Y_(e){const t=J_(e),n=X_(e);return Q_(t.runSync(t.parse(n),n),e)}function J_(e){const t=e.rehypePlugins||gw,n=e.remarkPlugins||gw,s=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...xw}:xw;return U_().use(PO).use(n).use(S_,s).use(t)}function X_(e){const t=e.children||"",n=new cS;return typeof t=="string"&&(n.value=t),n}function Q_(e,t){const n=t.allowedElements,s=t.allowElement,i=t.components,l=t.disallowedElements,c=t.skipHtml,d=t.unwrapDisallowed,p=t.urlTransform||Z_;for(const h of G_)Object.hasOwn(t,h.from)&&(""+h.from+(h.to?"use `"+h.to+"` instead":"remove it")+K_+h.id,void 0);return t.className&&(e={type:"element",tagName:"div",properties:{className:t.className},children:e.type==="root"?e.children:[e]}),lS(e,m),lL(e,{Fragment:r.Fragment,components:i,ignoreInvalidStyle:!0,jsx:r.jsx,jsxs:r.jsxs,passKeys:!0,passNode:!0});function m(h,x,y){if(h.type==="raw"&&y&&typeof x=="number")return c?y.children.splice(x,1):y.children[x]={type:"text",value:h.value},x;if(h.type==="element"){let v;for(v in im)if(Object.hasOwn(im,v)&&Object.hasOwn(h.properties,v)){const C=h.properties[v],j=im[v];(j===null||j.includes(h.tagName))&&(h.properties[v]=p(String(C||""),v,h))}}if(h.type==="element"){let v=n?!n.includes(h.tagName):l?l.includes(h.tagName):!1;if(!v&&s&&typeof x=="number"&&(v=!s(h,x,y)),v&&y&&typeof x=="number")return d&&h.children?y.children.splice(x,1,...h.children):y.children.splice(x,1),x}}}function Z_(e){const t=e.indexOf(":"),n=e.indexOf("?"),s=e.indexOf("#"),i=e.indexOf("/");return t===-1||i!==-1&&t>i||n!==-1&&t>n||s!==-1&&t>s||q_.test(e.slice(0,t))?e:""}function en({content:e,className:t,emptyState:n="No markdown content yet."}){const s=e.replace(/<!--[\s\S]*?-->/g,"");return s.trim()?r.jsx("div",{className:Te("prose-syntaur max-w-none",t),children:r.jsx(Y_,{children:s})}):r.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 eM(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return f.useMemo(()=>s=>{t.forEach(i=>i(s))},t)}const Ad=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function ia(e){const t=Object.prototype.toString.call(e);return t==="[object Window]"||t==="[object global]"}function _g(e){return"nodeType"in e}function Xn(e){var t,n;return e?ia(e)?e:_g(e)&&(t=(n=e.ownerDocument)==null?void 0:n.defaultView)!=null?t:window:window}function Mg(e){const{Document:t}=Xn(e);return e instanceof t}function Yl(e){return ia(e)?!1:e instanceof Xn(e).HTMLElement}function uS(e){return e instanceof Xn(e).SVGElement}function aa(e){return e?ia(e)?e.document:_g(e)?Mg(e)?e:Yl(e)||uS(e)?e.ownerDocument:document:document:document}const os=Ad?f.useLayoutEffect:f.useEffect;function Fg(e){const t=f.useRef(e);return os(()=>{t.current=e}),f.useCallback(function(){for(var n=arguments.length,s=new Array(n),i=0;i<n;i++)s[i]=arguments[i];return t.current==null?void 0:t.current(...s)},[])}function tM(){const e=f.useRef(null),t=f.useCallback((s,i)=>{e.current=setInterval(s,i)},[]),n=f.useCallback(()=>{e.current!==null&&(clearInterval(e.current),e.current=null)},[]);return[t,n]}function $l(e,t){t===void 0&&(t=[e]);const n=f.useRef(e);return os(()=>{n.current!==e&&(n.current=e)},t),n}function Jl(e,t){const n=f.useRef();return f.useMemo(()=>{const s=e(n.current);return n.current=s,s},[...t])}function Wu(e){const t=Fg(e),n=f.useRef(null),s=f.useCallback(i=>{i!==n.current&&(t==null||t(i,n.current)),n.current=i},[]);return[n,s]}function ih(e){const t=f.useRef();return f.useEffect(()=>{t.current=e},[e]),t.current}let xm={};function Xl(e,t){return f.useMemo(()=>{if(t)return t;const n=xm[e]==null?0:xm[e]+1;return xm[e]=n,e+"-"+n},[e,t])}function dS(e){return function(t){for(var n=arguments.length,s=new Array(n>1?n-1:0),i=1;i<n;i++)s[i-1]=arguments[i];return s.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 Hi=dS(1),Ll=dS(-1);function nM(e){return"clientX"in e&&"clientY"in e}function zg(e){if(!e)return!1;const{KeyboardEvent:t}=Xn(e.target);return t&&e instanceof t}function rM(e){if(!e)return!1;const{TouchEvent:t}=Xn(e.target);return t&&e instanceof t}function ah(e){if(rM(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 nM(e)?{x:e.clientX,y:e.clientY}:null}const no=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[no.Translate.toString(e),no.Scale.toString(e)].join(" ")}},Transition:{toString(e){let{property:t,duration:n,easing:s}=e;return t+" "+n+"ms "+s}}}),yw="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function sM(e){return e.matches(yw)?e:e.querySelector(yw)}const oM={display:"none"};function iM(e){let{id:t,value:n}=e;return Vt.createElement("div",{id:t,style:oM},n)}function aM(e){let{id:t,announcement:n,ariaLiveType:s="assertive"}=e;const i={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 Vt.createElement("div",{id:t,style:i,role:"status","aria-live":s,"aria-atomic":!0},n)}function lM(){const[e,t]=f.useState("");return{announce:f.useCallback(s=>{s!=null&&t(s)},[]),announcement:e}}const fS=f.createContext(null);function cM(e){const t=f.useContext(fS);f.useEffect(()=>{if(!t)throw new Error("useDndMonitor must be used within a children of <DndContext>");return t(e)},[e,t])}function uM(){const[e]=f.useState(()=>new Set),t=f.useCallback(s=>(e.add(s),()=>e.delete(s)),[e]);return[f.useCallback(s=>{let{type:i,event:l}=s;e.forEach(c=>{var d;return(d=c[i])==null?void 0:d.call(c,l)})},[e]),t]}const dM={draggable:`
|
|
514
|
+
To pick up a draggable item, press the space bar.
|
|
515
|
+
While dragging, use the arrow keys to move the item.
|
|
516
|
+
Press space again to drop the item in its new position, or press escape to cancel.
|
|
517
|
+
`},fM={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 pM(e){let{announcements:t=fM,container:n,hiddenTextDescribedById:s,screenReaderInstructions:i=dM}=e;const{announce:l,announcement:c}=lM(),d=Xl("DndLiveRegion"),[p,m]=f.useState(!1);if(f.useEffect(()=>{m(!0)},[]),cM(f.useMemo(()=>({onDragStart(x){let{active:y}=x;l(t.onDragStart({active:y}))},onDragMove(x){let{active:y,over:v}=x;t.onDragMove&&l(t.onDragMove({active:y,over:v}))},onDragOver(x){let{active:y,over:v}=x;l(t.onDragOver({active:y,over:v}))},onDragEnd(x){let{active:y,over:v}=x;l(t.onDragEnd({active:y,over:v}))},onDragCancel(x){let{active:y,over:v}=x;l(t.onDragCancel({active:y,over:v}))}}),[l,t])),!p)return null;const h=Vt.createElement(Vt.Fragment,null,Vt.createElement(iM,{id:s,value:i.draggable}),Vt.createElement(aM,{id:d,announcement:c}));return n?ws.createPortal(h,n):h}var cn;(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"})(cn||(cn={}));function Ku(){}function ro(e,t){return f.useMemo(()=>({sensor:e,options:t??{}}),[e,t])}function Dd(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return f.useMemo(()=>[...t].filter(s=>s!=null),[...t])}const Br=Object.freeze({x:0,y:0});function pS(e,t){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function mS(e,t){let{data:{value:n}}=e,{data:{value:s}}=t;return n-s}function mM(e,t){let{data:{value:n}}=e,{data:{value:s}}=t;return s-n}function vw(e){let{left:t,top:n,height:s,width:i}=e;return[{x:t,y:n},{x:t+i,y:n},{x:t,y:n+s},{x:t+i,y:n+s}]}function hS(e,t){if(!e||e.length===0)return null;const[n]=e;return n[t]}function bw(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 $d=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:s}=e;const i=bw(t,t.left,t.top),l=[];for(const c of s){const{id:d}=c,p=n.get(d);if(p){const m=pS(bw(p),i);l.push({id:d,data:{droppableContainer:c,value:m}})}}return l.sort(mS)},hM=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:s}=e;const i=vw(t),l=[];for(const c of s){const{id:d}=c,p=n.get(d);if(p){const m=vw(p),h=i.reduce((y,v,C)=>y+pS(m[C],v),0),x=Number((h/4).toFixed(4));l.push({id:d,data:{droppableContainer:c,value:x}})}}return l.sort(mS)};function gM(e,t){const n=Math.max(t.top,e.top),s=Math.max(t.left,e.left),i=Math.min(t.left+t.width,e.left+e.width),l=Math.min(t.top+t.height,e.top+e.height),c=i-s,d=l-n;if(s<i&&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 xM=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:s}=e;const i=[];for(const l of s){const{id:c}=l,d=n.get(c);if(d){const p=gM(d,t);p>0&&i.push({id:c,data:{droppableContainer:l,value:p}})}}return i.sort(mM)};function yM(e,t,n){return{...e,scaleX:t&&n?t.width/n.width:1,scaleY:t&&n?t.height/n.height:1}}function gS(e,t){return e&&t?{x:e.left-t.left,y:e.top-t.top}:Br}function vM(e){return function(n){for(var s=arguments.length,i=new Array(s>1?s-1:0),l=1;l<s;l++)i[l-1]=arguments[l];return i.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 bM=vM(1);function wM(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 jM(e,t,n){const s=wM(t);if(!s)return e;const{scaleX:i,scaleY:l,x:c,y:d}=s,p=e.left-c-(1-i)*parseFloat(n),m=e.top-d-(1-l)*parseFloat(n.slice(n.indexOf(" ")+1)),h=i?e.width/i: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 kM={ignoreTransform:!1};function la(e,t){t===void 0&&(t=kM);let n=e.getBoundingClientRect();if(t.ignoreTransform){const{transform:m,transformOrigin:h}=Xn(e).getComputedStyle(e);m&&(n=jM(n,m,h))}const{top:s,left:i,width:l,height:c,bottom:d,right:p}=n;return{top:s,left:i,width:l,height:c,bottom:d,right:p}}function ww(e){return la(e,{ignoreTransform:!0})}function SM(e){const t=e.innerWidth,n=e.innerHeight;return{top:0,left:0,right:t,bottom:n,width:t,height:n}}function NM(e,t){return t===void 0&&(t=Xn(e).getComputedStyle(e)),t.position==="fixed"}function CM(e,t){t===void 0&&(t=Xn(e).getComputedStyle(e));const n=/(auto|scroll|overlay)/;return["overflow","overflowX","overflowY"].some(i=>{const l=t[i];return typeof l=="string"?n.test(l):!1})}function Ld(e,t){const n=[];function s(i){if(t!=null&&n.length>=t||!i)return n;if(Mg(i)&&i.scrollingElement!=null&&!n.includes(i.scrollingElement))return n.push(i.scrollingElement),n;if(!Yl(i)||uS(i)||n.includes(i))return n;const l=Xn(e).getComputedStyle(i);return i!==e&&CM(i,l)&&n.push(i),NM(i,l)?n:s(i.parentNode)}return e?s(e):n}function xS(e){const[t]=Ld(e,1);return t??null}function ym(e){return!Ad||!e?null:ia(e)?e:_g(e)?Mg(e)||e===aa(e).scrollingElement?window:Yl(e)?e:null:null}function yS(e){return ia(e)?e.scrollX:e.scrollLeft}function vS(e){return ia(e)?e.scrollY:e.scrollTop}function lh(e){return{x:yS(e),y:vS(e)}}var xn;(function(e){e[e.Forward=1]="Forward",e[e.Backward=-1]="Backward"})(xn||(xn={}));function bS(e){return!Ad||!e?!1:e===document.scrollingElement}function wS(e){const t={x:0,y:0},n=bS(e)?{height:window.innerHeight,width:window.innerWidth}:{height:e.clientHeight,width:e.clientWidth},s={x:e.scrollWidth-n.width,y:e.scrollHeight-n.height},i=e.scrollTop<=t.y,l=e.scrollLeft<=t.x,c=e.scrollTop>=s.y,d=e.scrollLeft>=s.x;return{isTop:i,isLeft:l,isBottom:c,isRight:d,maxScroll:s,minScroll:t}}const EM={x:.2,y:.2};function TM(e,t,n,s,i){let{top:l,left:c,right:d,bottom:p}=n;s===void 0&&(s=10),i===void 0&&(i=EM);const{isTop:m,isBottom:h,isLeft:x,isRight:y}=wS(e),v={x:0,y:0},C={x:0,y:0},j={height:t.height*i.y,width:t.width*i.x};return!m&&l<=t.top+j.height?(v.y=xn.Backward,C.y=s*Math.abs((t.top+j.height-l)/j.height)):!h&&p>=t.bottom-j.height&&(v.y=xn.Forward,C.y=s*Math.abs((t.bottom-j.height-p)/j.height)),!y&&d>=t.right-j.width?(v.x=xn.Forward,C.x=s*Math.abs((t.right-j.width-d)/j.width)):!x&&c<=t.left+j.width&&(v.x=xn.Backward,C.x=s*Math.abs((t.left+j.width-c)/j.width)),{direction:v,speed:C}}function PM(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:s,bottom:i}=e.getBoundingClientRect();return{top:t,left:n,right:s,bottom:i,width:e.clientWidth,height:e.clientHeight}}function jS(e){return e.reduce((t,n)=>Hi(t,lh(n)),Br)}function RM(e){return e.reduce((t,n)=>t+yS(n),0)}function AM(e){return e.reduce((t,n)=>t+vS(n),0)}function DM(e,t){if(t===void 0&&(t=la),!e)return;const{top:n,left:s,bottom:i,right:l}=t(e);xS(e)&&(i<=0||l<=0||n>=window.innerHeight||s>=window.innerWidth)&&e.scrollIntoView({block:"center",inline:"center"})}const $M=[["x",["left","right"],RM],["y",["top","bottom"],AM]];class Bg{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 s=Ld(n),i=jS(s);this.rect={...t},this.width=t.width,this.height=t.height;for(const[l,c,d]of $M)for(const p of c)Object.defineProperty(this,p,{get:()=>{const m=d(s),h=i[l]-m;return this.rect[p]+h},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}}class bl{constructor(t){this.target=void 0,this.listeners=[],this.removeAll=()=>{this.listeners.forEach(n=>{var s;return(s=this.target)==null?void 0:s.removeEventListener(...n)})},this.target=t}add(t,n,s){var i;(i=this.target)==null||i.addEventListener(t,n,s),this.listeners.push([t,n,s])}}function LM(e){const{EventTarget:t}=Xn(e);return e instanceof t?e:aa(e)}function vm(e,t){const n=Math.abs(e.x),s=Math.abs(e.y);return typeof t=="number"?Math.sqrt(n**2+s**2)>t:"x"in t&&"y"in t?n>t.x&&s>t.y:"x"in t?n>t.x:"y"in t?s>t.y:!1}var kr;(function(e){e.Click="click",e.DragStart="dragstart",e.Keydown="keydown",e.ContextMenu="contextmenu",e.Resize="resize",e.SelectionChange="selectionchange",e.VisibilityChange="visibilitychange"})(kr||(kr={}));function jw(e){e.preventDefault()}function IM(e){e.stopPropagation()}var it;(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"})(it||(it={}));const kS={start:[it.Space,it.Enter],cancel:[it.Esc],end:[it.Space,it.Enter,it.Tab]},OM=(e,t)=>{let{currentCoordinates:n}=t;switch(e.code){case it.Right:return{...n,x:n.x+25};case it.Left:return{...n,x:n.x-25};case it.Down:return{...n,y:n.y+25};case it.Up:return{...n,y:n.y-25}}};class ca{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 bl(aa(n)),this.windowListeners=new bl(Xn(n)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(kr.Resize,this.handleCancel),this.windowListeners.add(kr.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(kr.Keydown,this.handleKeyDown))}handleStart(){const{activeNode:t,onStart:n}=this.props,s=t.node.current;s&&DM(s),n(Br)}handleKeyDown(t){if(zg(t)){const{active:n,context:s,options:i}=this.props,{keyboardCodes:l=kS,coordinateGetter:c=OM,scrollBehavior:d="smooth"}=i,{code:p}=t;if(l.end.includes(p)){this.handleEnd(t);return}if(l.cancel.includes(p)){this.handleCancel(t);return}const{collisionRect:m}=s.current,h=m?{x:m.left,y:m.top}:Br;this.referenceCoordinates||(this.referenceCoordinates=h);const x=c(t,{active:n,context:s.current,currentCoordinates:h});if(x){const y=Ll(x,h),v={x:0,y:0},{scrollableAncestors:C}=s.current;for(const j of C){const w=t.code,{isTop:S,isRight:E,isLeft:N,isBottom:P,maxScroll:I,minScroll:R}=wS(j),$=PM(j),D={x:Math.min(w===it.Right?$.right-$.width/2:$.right,Math.max(w===it.Right?$.left:$.left+$.width/2,x.x)),y:Math.min(w===it.Down?$.bottom-$.height/2:$.bottom,Math.max(w===it.Down?$.top:$.top+$.height/2,x.y))},X=w===it.Right&&!E||w===it.Left&&!N,Z=w===it.Down&&!P||w===it.Up&&!S;if(X&&D.x!==x.x){const F=j.scrollLeft+y.x,H=w===it.Right&&F<=I.x||w===it.Left&&F>=R.x;if(H&&!y.y){j.scrollTo({left:F,behavior:d});return}H?v.x=j.scrollLeft-F:v.x=w===it.Right?j.scrollLeft-I.x:j.scrollLeft-R.x,v.x&&j.scrollBy({left:-v.x,behavior:d});break}else if(Z&&D.y!==x.y){const F=j.scrollTop+y.y,H=w===it.Down&&F<=I.y||w===it.Up&&F>=R.y;if(H&&!y.x){j.scrollTo({top:F,behavior:d});return}H?v.y=j.scrollTop-F:v.y=w===it.Down?j.scrollTop-I.y:j.scrollTop-R.y,v.y&&j.scrollBy({top:-v.y,behavior:d});break}}this.handleMove(t,Hi(Ll(x,this.referenceCoordinates),v))}}}handleMove(t,n){const{onMove:s}=this.props;t.preventDefault(),s(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()}}ca.activators=[{eventName:"onKeyDown",handler:(e,t,n)=>{let{keyboardCodes:s=kS,onActivation:i}=t,{active:l}=n;const{code:c}=e.nativeEvent;if(s.start.includes(c)){const d=l.activatorNode.current;return d&&e.target!==d?!1:(e.preventDefault(),i==null||i({event:e.nativeEvent}),!0)}return!1}}];function kw(e){return!!(e&&"distance"in e)}function Sw(e){return!!(e&&"delay"in e)}class Ug{constructor(t,n,s){var i;s===void 0&&(s=LM(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=aa(c),this.documentListeners=new bl(this.document),this.listeners=new bl(s),this.windowListeners=new bl(Xn(c)),this.initialCoordinates=(i=ah(l))!=null?i:Br,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:s}}}=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(kr.Resize,this.handleCancel),this.windowListeners.add(kr.DragStart,jw),this.windowListeners.add(kr.VisibilityChange,this.handleCancel),this.windowListeners.add(kr.ContextMenu,jw),this.documentListeners.add(kr.Keydown,this.handleKeydown),n){if(s!=null&&s({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(Sw(n)){this.timeoutId=setTimeout(this.handleStart,n.delay),this.handlePending(n);return}if(kw(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:s,onPending:i}=this.props;i(s,t,this.initialCoordinates,n)}handleStart(){const{initialCoordinates:t}=this,{onStart:n}=this.props;t&&(this.activated=!0,this.documentListeners.add(kr.Click,IM,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(kr.SelectionChange,this.removeTextSelection),n(t))}handleMove(t){var n;const{activated:s,initialCoordinates:i,props:l}=this,{onMove:c,options:{activationConstraint:d}}=l;if(!i)return;const p=(n=ah(t))!=null?n:Br,m=Ll(i,p);if(!s&&d){if(kw(d)){if(d.tolerance!=null&&vm(m,d.tolerance))return this.handleCancel();if(vm(m,d.distance))return this.handleStart()}if(Sw(d)&&vm(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===it.Esc&&this.handleCancel()}removeTextSelection(){var t;(t=this.document.getSelection())==null||t.removeAllRanges()}}const _M={cancel:{name:"pointercancel"},move:{name:"pointermove"},end:{name:"pointerup"}};class ua extends Ug{constructor(t){const{event:n}=t,s=aa(n.target);super(t,_M,s)}}ua.activators=[{eventName:"onPointerDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:s}=t;return!n.isPrimary||n.button!==0?!1:(s==null||s({event:n}),!0)}}];const MM={move:{name:"mousemove"},end:{name:"mouseup"}};var ch;(function(e){e[e.RightClick=2]="RightClick"})(ch||(ch={}));class FM extends Ug{constructor(t){super(t,MM,aa(t.event.target))}}FM.activators=[{eventName:"onMouseDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:s}=t;return n.button===ch.RightClick?!1:(s==null||s({event:n}),!0)}}];const bm={cancel:{name:"touchcancel"},move:{name:"touchmove"},end:{name:"touchend"}};class zM extends Ug{constructor(t){super(t,bm)}static setup(){return window.addEventListener(bm.move.name,t,{capture:!1,passive:!1}),function(){window.removeEventListener(bm.move.name,t)};function t(){}}}zM.activators=[{eventName:"onTouchStart",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:s}=t;const{touches:i}=n;return i.length>1?!1:(s==null||s({event:n}),!0)}}];var wl;(function(e){e[e.Pointer=0]="Pointer",e[e.DraggableRect=1]="DraggableRect"})(wl||(wl={}));var qu;(function(e){e[e.TreeOrder=0]="TreeOrder",e[e.ReversedTreeOrder=1]="ReversedTreeOrder"})(qu||(qu={}));function BM(e){let{acceleration:t,activator:n=wl.Pointer,canScroll:s,draggingRect:i,enabled:l,interval:c=5,order:d=qu.TreeOrder,pointerCoordinates:p,scrollableAncestors:m,scrollableAncestorRects:h,delta:x,threshold:y}=e;const v=HM({delta:x,disabled:!l}),[C,j]=tM(),w=f.useRef({x:0,y:0}),S=f.useRef({x:0,y:0}),E=f.useMemo(()=>{switch(n){case wl.Pointer:return p?{top:p.y,bottom:p.y,left:p.x,right:p.x}:null;case wl.DraggableRect:return i}},[n,i,p]),N=f.useRef(null),P=f.useCallback(()=>{const R=N.current;if(!R)return;const $=w.current.x*S.current.x,D=w.current.y*S.current.y;R.scrollBy($,D)},[]),I=f.useMemo(()=>d===qu.TreeOrder?[...m].reverse():m,[d,m]);f.useEffect(()=>{if(!l||!m.length||!E){j();return}for(const R of I){if((s==null?void 0:s(R))===!1)continue;const $=m.indexOf(R),D=h[$];if(!D)continue;const{direction:X,speed:Z}=TM(R,D,E,t,y);for(const F of["x","y"])v[F][X[F]]||(Z[F]=0,X[F]=0);if(Z.x>0||Z.y>0){j(),N.current=R,C(P,c),w.current=Z,S.current=X;return}}w.current={x:0,y:0},S.current={x:0,y:0},j()},[t,P,s,j,l,c,JSON.stringify(E),JSON.stringify(v),C,m,I,h,JSON.stringify(y)])}const UM={x:{[xn.Backward]:!1,[xn.Forward]:!1},y:{[xn.Backward]:!1,[xn.Forward]:!1}};function HM(e){let{delta:t,disabled:n}=e;const s=ih(t);return Jl(i=>{if(n||!s||!i)return UM;const l={x:Math.sign(t.x-s.x),y:Math.sign(t.y-s.y)};return{x:{[xn.Backward]:i.x[xn.Backward]||l.x===-1,[xn.Forward]:i.x[xn.Forward]||l.x===1},y:{[xn.Backward]:i.y[xn.Backward]||l.y===-1,[xn.Forward]:i.y[xn.Forward]||l.y===1}}},[n,t,s])}function VM(e,t){const n=t!=null?e.get(t):void 0,s=n?n.node.current:null;return Jl(i=>{var l;return t==null?null:(l=s??i)!=null?l:null},[s,t])}function WM(e,t){return f.useMemo(()=>e.reduce((n,s)=>{const{sensor:i}=s,l=i.activators.map(c=>({eventName:c.eventName,handler:t(c.handler,s)}));return[...n,...l]},[]),[e,t])}var Il;(function(e){e[e.Always=0]="Always",e[e.BeforeDragging=1]="BeforeDragging",e[e.WhileDragging=2]="WhileDragging"})(Il||(Il={}));var uh;(function(e){e.Optimized="optimized"})(uh||(uh={}));const Nw=new Map;function KM(e,t){let{dragging:n,dependencies:s,config:i}=t;const[l,c]=f.useState(null),{frequency:d,measure:p,strategy:m}=i,h=f.useRef(e),x=w(),y=$l(x),v=f.useCallback(function(S){S===void 0&&(S=[]),!y.current&&c(E=>E===null?S:E.concat(S.filter(N=>!E.includes(N))))},[y]),C=f.useRef(null),j=Jl(S=>{if(x&&!n)return Nw;if(!S||S===Nw||h.current!==e||l!=null){const E=new Map;for(let N of e){if(!N)continue;if(l&&l.length>0&&!l.includes(N.id)&&N.rect.current){E.set(N.id,N.rect.current);continue}const P=N.node.current,I=P?new Bg(p(P),P):null;N.rect.current=I,I&&E.set(N.id,I)}return E}return S},[e,l,n,x,p]);return f.useEffect(()=>{h.current=e},[e]),f.useEffect(()=>{x||v()},[n,x]),f.useEffect(()=>{l&&l.length>0&&c(null)},[JSON.stringify(l)]),f.useEffect(()=>{x||typeof d!="number"||C.current!==null||(C.current=setTimeout(()=>{v(),C.current=null},d))},[d,x,v,...s]),{droppableRects:j,measureDroppableContainers:v,measuringScheduled:l!=null};function w(){switch(m){case Il.Always:return!1;case Il.BeforeDragging:return n;default:return!n}}}function SS(e,t){return Jl(n=>e?n||(typeof t=="function"?t(e):e):null,[t,e])}function qM(e,t){return SS(e,t)}function GM(e){let{callback:t,disabled:n}=e;const s=Fg(t),i=f.useMemo(()=>{if(n||typeof window>"u"||typeof window.MutationObserver>"u")return;const{MutationObserver:l}=window;return new l(s)},[s,n]);return f.useEffect(()=>()=>i==null?void 0:i.disconnect(),[i]),i}function Id(e){let{callback:t,disabled:n}=e;const s=Fg(t),i=f.useMemo(()=>{if(n||typeof window>"u"||typeof window.ResizeObserver>"u")return;const{ResizeObserver:l}=window;return new l(s)},[n]);return f.useEffect(()=>()=>i==null?void 0:i.disconnect(),[i]),i}function YM(e){return new Bg(la(e),e)}function Cw(e,t,n){t===void 0&&(t=YM);const[s,i]=f.useState(null);function l(){i(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=GM({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=Id({callback:l});return os(()=>{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]),s}function JM(e){const t=SS(e);return gS(e,t)}const Ew=[];function XM(e){const t=f.useRef(e),n=Jl(s=>e?s&&s!==Ew&&e&&t.current&&e.parentNode===t.current.parentNode?s:Ld(e):Ew,[e]);return f.useEffect(()=>{t.current=e},[e]),n}function QM(e){const[t,n]=f.useState(null),s=f.useRef(e),i=f.useCallback(l=>{const c=ym(l.target);c&&n(d=>d?(d.set(c,lh(c)),new Map(d)):null)},[]);return f.useEffect(()=>{const l=s.current;if(e!==l){c(l);const d=e.map(p=>{const m=ym(p);return m?(m.addEventListener("scroll",i,{passive:!0}),[m,lh(m)]):null}).filter(p=>p!=null);n(d.length?new Map(d):null),s.current=e}return()=>{c(e),c(l)};function c(d){d.forEach(p=>{const m=ym(p);m==null||m.removeEventListener("scroll",i)})}},[i,e]),f.useMemo(()=>e.length?t?Array.from(t.values()).reduce((l,c)=>Hi(l,c),Br):jS(e):Br,[e,t])}function Tw(e,t){t===void 0&&(t=[]);const n=f.useRef(null);return f.useEffect(()=>{n.current=null},t),f.useEffect(()=>{const s=e!==Br;s&&!n.current&&(n.current=e),!s&&n.current&&(n.current=null)},[e]),n.current?Ll(e,n.current):Br}function ZM(e){f.useEffect(()=>{if(!Ad)return;const t=e.map(n=>{let{sensor:s}=n;return s.setup==null?void 0:s.setup()});return()=>{for(const n of t)n==null||n()}},e.map(t=>{let{sensor:n}=t;return n}))}function e5(e,t){return f.useMemo(()=>e.reduce((n,s)=>{let{eventName:i,handler:l}=s;return n[i]=c=>{l(c,t)},n},{}),[e,t])}function NS(e){return f.useMemo(()=>e?SM(e):null,[e])}const Pw=[];function t5(e,t){t===void 0&&(t=la);const[n]=e,s=NS(n?Xn(n):null),[i,l]=f.useState(Pw);function c(){l(()=>e.length?e.map(p=>bS(p)?s:new Bg(t(p),p)):Pw)}const d=Id({callback:c});return os(()=>{d==null||d.disconnect(),c(),e.forEach(p=>d==null?void 0:d.observe(p))},[e]),i}function n5(e){if(!e)return null;if(e.children.length>1)return e;const t=e.children[0];return Yl(t)?t:e}function r5(e){let{measure:t}=e;const[n,s]=f.useState(null),i=f.useCallback(m=>{for(const{target:h}of m)if(Yl(h)){s(x=>{const y=t(h);return x?{...x,width:y.width,height:y.height}:y});break}},[t]),l=Id({callback:i}),c=f.useCallback(m=>{const h=n5(m);l==null||l.disconnect(),h&&(l==null||l.observe(h)),s(h?t(h):null)},[t,l]),[d,p]=Wu(c);return f.useMemo(()=>({nodeRef:d,rect:n,setRef:p}),[n,d,p])}const s5=[{sensor:ua,options:{}},{sensor:ca,options:{}}],o5={current:{}},Ru={draggable:{measure:ww},droppable:{measure:ww,strategy:Il.WhileDragging,frequency:uh.Optimized},dragOverlay:{measure:la}};class jl 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,s;return(n=(s=this.get(t))==null?void 0:s.node.current)!=null?n:void 0}}const i5={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new jl,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:Ku},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:Ru,measureDroppableContainers:Ku,windowRect:null,measuringScheduled:!1},a5={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:Ku,draggableNodes:new Map,over:null,measureDroppableContainers:Ku},Od=f.createContext(a5),CS=f.createContext(i5);function l5(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new jl}}}function c5(e,t){switch(t.type){case cn.DragStart:return{...e,draggable:{...e.draggable,initialCoordinates:t.initialCoordinates,active:t.active}};case cn.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 cn.DragEnd:case cn.DragCancel:return{...e,draggable:{...e.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case cn.RegisterDroppable:{const{element:n}=t,{id:s}=n,i=new jl(e.droppable.containers);return i.set(s,n),{...e,droppable:{...e.droppable,containers:i}}}case cn.SetDroppableDisabled:{const{id:n,key:s,disabled:i}=t,l=e.droppable.containers.get(n);if(!l||s!==l.key)return e;const c=new jl(e.droppable.containers);return c.set(n,{...l,disabled:i}),{...e,droppable:{...e.droppable,containers:c}}}case cn.UnregisterDroppable:{const{id:n,key:s}=t,i=e.droppable.containers.get(n);if(!i||s!==i.key)return e;const l=new jl(e.droppable.containers);return l.delete(n),{...e,droppable:{...e.droppable,containers:l}}}default:return e}}function u5(e){let{disabled:t}=e;const{active:n,activatorEvent:s,draggableNodes:i}=f.useContext(Od),l=ih(s),c=ih(n==null?void 0:n.id);return f.useEffect(()=>{if(!t&&!s&&l&&c!=null){if(!zg(l)||document.activeElement===l.target)return;const d=i.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=sM(h);if(x){x.focus();break}}})}},[s,t,i,c,l]),null}function d5(e,t){let{transform:n,...s}=t;return e!=null&&e.length?e.reduce((i,l)=>l({transform:i,...s}),n):n}function f5(e){return f.useMemo(()=>({draggable:{...Ru.draggable,...e==null?void 0:e.draggable},droppable:{...Ru.droppable,...e==null?void 0:e.droppable},dragOverlay:{...Ru.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 p5(e){let{activeNode:t,measure:n,initialRect:s,config:i=!0}=e;const l=f.useRef(!1),{x:c,y:d}=typeof i=="boolean"?{x:i,y:i}:i;os(()=>{if(!c&&!d||!t){l.current=!1;return}if(l.current||!s)return;const m=t==null?void 0:t.node.current;if(!m||m.isConnected===!1)return;const h=n(m),x=gS(h,s);if(c||(x.x=0),d||(x.y=0),l.current=!0,Math.abs(x.x)>0||Math.abs(x.y)>0){const y=xS(m);y&&y.scrollBy({top:x.y,left:x.x})}},[t,c,d,s,n])}const ES=f.createContext({...Br,scaleX:1,scaleY:1});var Xs;(function(e){e[e.Uninitialized=0]="Uninitialized",e[e.Initializing=1]="Initializing",e[e.Initialized=2]="Initialized"})(Xs||(Xs={}));const _d=f.memo(function(t){var n,s,i,l;let{id:c,accessibility:d,autoScroll:p=!0,children:m,sensors:h=s5,collisionDetection:x=xM,measuring:y,modifiers:v,...C}=t;const j=f.useReducer(c5,void 0,l5),[w,S]=j,[E,N]=uM(),[P,I]=f.useState(Xs.Uninitialized),R=P===Xs.Initialized,{draggable:{active:$,nodes:D,translate:X},droppable:{containers:Z}}=w,F=$!=null?D.get($):null,H=f.useRef({initial:null,translated:null}),J=f.useMemo(()=>{var ut;return $!=null?{id:$,data:(ut=F==null?void 0:F.data)!=null?ut:o5,rect:H}:null},[$,F]),_=f.useRef(null),[W,Y]=f.useState(null),[ie,K]=f.useState(null),ae=$l(C,Object.values(C)),T=Xl("DndDescribedBy",c),M=f.useMemo(()=>Z.getEnabled(),[Z]),q=f5(y),{droppableRects:L,measureDroppableContainers:ue,measuringScheduled:fe}=KM(M,{dragging:R,dependencies:[X.x,X.y],config:q.droppable}),B=VM(D,$),oe=f.useMemo(()=>ie?ah(ie):null,[ie]),he=On(),we=qM(B,q.draggable.measure);p5({activeNode:$!=null?D.get($):null,config:he.layoutShiftCompensation,initialRect:we,measure:q.draggable.measure});const Se=Cw(B,q.draggable.measure,we),pe=Cw(B?B.parentElement:null),He=f.useRef({activatorEvent:null,active:null,activeNode:B,collisionRect:null,collisions:null,droppableRects:L,draggableNodes:D,draggingNode:null,draggingNodeRect:null,droppableContainers:Z,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),te=Z.getNodeFor((n=He.current.over)==null?void 0:n.id),ye=r5({measure:q.dragOverlay.measure}),ne=(s=ye.nodeRef.current)!=null?s:B,U=R?(i=ye.rect)!=null?i:Se:null,de=!!(ye.nodeRef.current&&ye.rect),me=JM(de?null:Se),Fe=NS(ne?Xn(ne):null),qe=XM(R?te??B:null),Ve=t5(qe),Ze=d5(v,{transform:{x:X.x-me.x,y:X.y-me.y,scaleX:1,scaleY:1},activatorEvent:ie,active:J,activeNodeRect:Se,containerNodeRect:pe,draggingNodeRect:U,over:He.current.over,overlayNodeRect:ye.rect,scrollableAncestors:qe,scrollableAncestorRects:Ve,windowRect:Fe}),St=oe?Hi(oe,X):null,bt=QM(qe),gt=Tw(bt),ce=Tw(bt,[Se]),ve=Hi(Ze,gt),De=U?bM(U,Ze):null,Oe=J&&De?x({active:J,collisionRect:De,droppableRects:L,droppableContainers:M,pointerCoordinates:St}):null,Ye=hS(Oe,"id"),[et,It]=f.useState(null),ge=de?Ze:Hi(Ze,ce),Qe=yM(ge,(l=et==null?void 0:et.rect)!=null?l:null,Se),Ge=f.useRef(null),xt=f.useCallback((ut,Ut)=>{let{sensor:Dt,options:Xt}=Ut;if(_.current==null)return;const Q=D.get(_.current);if(!Q)return;const _e=ut.nativeEvent,tt=new Dt({active:_.current,activeNode:Q,event:_e,options:Xt,context:He,onAbort(nt){if(!D.get(nt))return;const{onDragAbort:sn}=ae.current,on={id:nt};sn==null||sn(on),E({type:"onDragAbort",event:on})},onPending(nt,fn,sn,on){if(!D.get(nt))return;const{onDragPending:hr}=ae.current,yn={id:nt,constraint:fn,initialCoordinates:sn,offset:on};hr==null||hr(yn),E({type:"onDragPending",event:yn})},onStart(nt){const fn=_.current;if(fn==null)return;const sn=D.get(fn);if(!sn)return;const{onDragStart:on}=ae.current,dt={activatorEvent:_e,active:{id:fn,data:sn.data,rect:H}};ws.unstable_batchedUpdates(()=>{on==null||on(dt),I(Xs.Initializing),S({type:cn.DragStart,initialCoordinates:nt,active:fn}),E({type:"onDragStart",event:dt}),Y(Ge.current),K(_e)})},onMove(nt){S({type:cn.DragMove,coordinates:nt})},onEnd:qt(cn.DragEnd),onCancel:qt(cn.DragCancel)});Ge.current=tt;function qt(nt){return async function(){const{active:sn,collisions:on,over:dt,scrollAdjustedTranslate:hr}=He.current;let yn=null;if(sn&&hr){const{cancelDrop:Zn}=ae.current;yn={activatorEvent:_e,active:sn,collisions:on,delta:hr,over:dt},nt===cn.DragEnd&&typeof Zn=="function"&&await Promise.resolve(Zn(yn))&&(nt=cn.DragCancel)}_.current=null,ws.unstable_batchedUpdates(()=>{S({type:nt}),I(Xs.Uninitialized),It(null),Y(null),K(null),Ge.current=null;const Zn=nt===cn.DragEnd?"onDragEnd":"onDragCancel";if(yn){const co=ae.current[Zn];co==null||co(yn),E({type:Zn,event:yn})}})}}},[D]),Kt=f.useCallback((ut,Ut)=>(Dt,Xt)=>{const Q=Dt.nativeEvent,_e=D.get(Xt);if(_.current!==null||!_e||Q.dndKit||Q.defaultPrevented)return;const tt={active:_e};ut(Dt,Ut.options,tt)===!0&&(Q.dndKit={capturedBy:Ut.sensor},_.current=Xt,xt(Dt,Ut))},[D,xt]),Bt=WM(h,Kt);ZM(h),os(()=>{Se&&P===Xs.Initializing&&I(Xs.Initialized)},[Se,P]),f.useEffect(()=>{const{onDragMove:ut}=ae.current,{active:Ut,activatorEvent:Dt,collisions:Xt,over:Q}=He.current;if(!Ut||!Dt)return;const _e={active:Ut,activatorEvent:Dt,collisions:Xt,delta:{x:ve.x,y:ve.y},over:Q};ws.unstable_batchedUpdates(()=>{ut==null||ut(_e),E({type:"onDragMove",event:_e})})},[ve.x,ve.y]),f.useEffect(()=>{const{active:ut,activatorEvent:Ut,collisions:Dt,droppableContainers:Xt,scrollAdjustedTranslate:Q}=He.current;if(!ut||_.current==null||!Ut||!Q)return;const{onDragOver:_e}=ae.current,tt=Xt.get(Ye),qt=tt&&tt.rect.current?{id:tt.id,rect:tt.rect.current,data:tt.data,disabled:tt.disabled}:null,nt={active:ut,activatorEvent:Ut,collisions:Dt,delta:{x:Q.x,y:Q.y},over:qt};ws.unstable_batchedUpdates(()=>{It(qt),_e==null||_e(nt),E({type:"onDragOver",event:nt})})},[Ye]),os(()=>{He.current={activatorEvent:ie,active:J,activeNode:B,collisionRect:De,collisions:Oe,droppableRects:L,draggableNodes:D,draggingNode:ne,draggingNodeRect:U,droppableContainers:Z,over:et,scrollableAncestors:qe,scrollAdjustedTranslate:ve},H.current={initial:U,translated:De}},[J,B,Oe,De,D,ne,U,L,Z,et,qe,ve]),BM({...he,delta:X,draggingRect:De,pointerCoordinates:St,scrollableAncestors:qe,scrollableAncestorRects:Ve});const rn=f.useMemo(()=>({active:J,activeNode:B,activeNodeRect:Se,activatorEvent:ie,collisions:Oe,containerNodeRect:pe,dragOverlay:ye,draggableNodes:D,droppableContainers:Z,droppableRects:L,over:et,measureDroppableContainers:ue,scrollableAncestors:qe,scrollableAncestorRects:Ve,measuringConfiguration:q,measuringScheduled:fe,windowRect:Fe}),[J,B,Se,ie,Oe,pe,ye,D,Z,L,et,ue,qe,Ve,q,fe,Fe]),Qn=f.useMemo(()=>({activatorEvent:ie,activators:Bt,active:J,activeNodeRect:Se,ariaDescribedById:{draggable:T},dispatch:S,draggableNodes:D,over:et,measureDroppableContainers:ue}),[ie,Bt,J,Se,S,T,D,et,ue]);return Vt.createElement(fS.Provider,{value:N},Vt.createElement(Od.Provider,{value:Qn},Vt.createElement(CS.Provider,{value:rn},Vt.createElement(ES.Provider,{value:Qe},m)),Vt.createElement(u5,{disabled:(d==null?void 0:d.restoreFocus)===!1})),Vt.createElement(pM,{...d,hiddenTextDescribedById:T}));function On(){const ut=(W==null?void 0:W.autoScrollEnabled)===!1,Ut=typeof p=="object"?p.enabled===!1:p===!1,Dt=R&&!ut&&!Ut;return typeof p=="object"?{...p,enabled:Dt}:{enabled:Dt}}}),m5=f.createContext(null),Rw="button",h5="Draggable";function g5(e){let{id:t,data:n,disabled:s=!1,attributes:i}=e;const l=Xl(h5),{activators:c,activatorEvent:d,active:p,activeNodeRect:m,ariaDescribedById:h,draggableNodes:x,over:y}=f.useContext(Od),{role:v=Rw,roleDescription:C="draggable",tabIndex:j=0}=i??{},w=(p==null?void 0:p.id)===t,S=f.useContext(w?ES:m5),[E,N]=Wu(),[P,I]=Wu(),R=e5(c,t),$=$l(n);os(()=>(x.set(t,{id:t,key:l,node:E,activatorNode:P,data:$}),()=>{const X=x.get(t);X&&X.key===l&&x.delete(t)}),[x,t]);const D=f.useMemo(()=>({role:v,tabIndex:j,"aria-disabled":s,"aria-pressed":w&&v===Rw?!0:void 0,"aria-roledescription":C,"aria-describedby":h.draggable}),[s,v,j,w,C,h.draggable]);return{active:p,activatorEvent:d,activeNodeRect:m,attributes:D,isDragging:w,listeners:s?void 0:R,node:E,over:y,setNodeRef:N,setActivatorNodeRef:I,transform:S}}function x5(){return f.useContext(CS)}const y5="Droppable",v5={timeout:25};function b5(e){let{data:t,disabled:n=!1,id:s,resizeObserverConfig:i}=e;const l=Xl(y5),{active:c,dispatch:d,over:p,measureDroppableContainers:m}=f.useContext(Od),h=f.useRef({disabled:n}),x=f.useRef(!1),y=f.useRef(null),v=f.useRef(null),{disabled:C,updateMeasurementsFor:j,timeout:w}={...v5,...i},S=$l(j??s),E=f.useCallback(()=>{if(!x.current){x.current=!0;return}v.current!=null&&clearTimeout(v.current),v.current=setTimeout(()=>{m(Array.isArray(S.current)?S.current:[S.current]),v.current=null},w)},[w]),N=Id({callback:E,disabled:C||!c}),P=f.useCallback((D,X)=>{N&&(X&&(N.unobserve(X),x.current=!1),D&&N.observe(D))},[N]),[I,R]=Wu(P),$=$l(t);return f.useEffect(()=>{!N||!I.current||(N.disconnect(),x.current=!1,N.observe(I.current))},[I,N]),f.useEffect(()=>(d({type:cn.RegisterDroppable,element:{id:s,key:l,disabled:n,node:I,rect:y,data:$}}),()=>d({type:cn.UnregisterDroppable,key:l,id:s})),[s]),f.useEffect(()=>{n!==h.current.disabled&&(d({type:cn.SetDroppableDisabled,id:s,key:l,disabled:n}),h.current.disabled=n)},[s,l,n,d]),{active:c,rect:y,isOver:(p==null?void 0:p.id)===s,node:I,over:p,setNodeRef:R}}function da(e,t,n){const s=e.slice();return s.splice(n<0?s.length+n:n,0,s.splice(t,1)[0]),s}function w5(e,t){return e.reduce((n,s,i)=>{const l=t.get(s);return l&&(n[i]=l),n},Array(e.length))}function pu(e){return e!==null&&e>=0}function j5(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 k5(e){return typeof e=="boolean"?{draggable:e,droppable:e}:e}const TS=e=>{let{rects:t,activeIndex:n,overIndex:s,index:i}=e;const l=da(t,s,n),c=t[i],d=l[i];return!d||!c?null:{x:d.left-c.left,y:d.top-c.top,scaleX:d.width/c.width,scaleY:d.height/c.height}},mu={scaleX:1,scaleY:1},Md=e=>{var t;let{activeIndex:n,activeNodeRect:s,index:i,rects:l,overIndex:c}=e;const d=(t=l[n])!=null?t:s;if(!d)return null;if(i===n){const m=l[c];return m?{x:0,y:n<c?m.top+m.height-(d.top+d.height):m.top-d.top,...mu}:null}const p=S5(l,i,n);return i>n&&i<=c?{x:0,y:-d.height-p,...mu}:i<n&&i>=c?{x:0,y:d.height+p,...mu}:{x:0,y:0,...mu}};function S5(e,t,n){const s=e[t],i=e[t-1],l=e[t+1];return s?n<t?i?s.top-(i.top+i.height):l?l.top-(s.top+s.height):0:l?l.top-(s.top+s.height):i?s.top-(i.top+i.height):0:0}const PS="Sortable",RS=Vt.createContext({activeIndex:-1,containerId:PS,disableTransforms:!1,items:[],overIndex:-1,useDragOverlay:!1,sortedRects:[],strategy:TS,disabled:{draggable:!1,droppable:!1}});function Fd(e){let{children:t,id:n,items:s,strategy:i=TS,disabled:l=!1}=e;const{active:c,dragOverlay:d,droppableRects:p,over:m,measureDroppableContainers:h}=x5(),x=Xl(PS,n),y=d.rect!==null,v=f.useMemo(()=>s.map(R=>typeof R=="object"&&"id"in R?R.id:R),[s]),C=c!=null,j=c?v.indexOf(c.id):-1,w=m?v.indexOf(m.id):-1,S=f.useRef(v),E=!j5(v,S.current),N=w!==-1&&j===-1||E,P=k5(l);os(()=>{E&&C&&h(v)},[E,v,C,h]),f.useEffect(()=>{S.current=v},[v]);const I=f.useMemo(()=>({activeIndex:j,containerId:x,disabled:P,disableTransforms:N,items:v,overIndex:w,useDragOverlay:y,sortedRects:w5(v,p),strategy:i}),[j,x,P.draggable,P.droppable,N,v,w,p,y,i]);return Vt.createElement(RS.Provider,{value:I},t)}const N5=e=>{let{id:t,items:n,activeIndex:s,overIndex:i}=e;return da(n,s,i).indexOf(t)},C5=e=>{let{containerId:t,isSorting:n,wasDragging:s,index:i,items:l,newIndex:c,previousItems:d,previousContainerId:p,transition:m}=e;return!m||!s||d!==l&&i===c?!1:n?!0:c!==i&&t===p},E5={duration:200,easing:"ease"},AS="transform",T5=no.Transition.toString({property:AS,duration:0,easing:"linear"}),P5={roleDescription:"sortable"};function R5(e){let{disabled:t,index:n,node:s,rect:i}=e;const[l,c]=f.useState(null),d=f.useRef(n);return os(()=>{if(!t&&n!==d.current&&s.current){const p=i.current;if(p){const m=la(s.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,s,i]),f.useEffect(()=>{l&&c(null)},[l]),l}function zd(e){let{animateLayoutChanges:t=C5,attributes:n,disabled:s,data:i,getNewIndex:l=N5,id:c,strategy:d,resizeObserverConfig:p,transition:m=E5}=e;const{items:h,containerId:x,activeIndex:y,disabled:v,disableTransforms:C,sortedRects:j,overIndex:w,useDragOverlay:S,strategy:E}=f.useContext(RS),N=A5(s,v),P=h.indexOf(c),I=f.useMemo(()=>({sortable:{containerId:x,index:P,items:h},...i}),[x,i,P,h]),R=f.useMemo(()=>h.slice(h.indexOf(c)),[h,c]),{rect:$,node:D,isOver:X,setNodeRef:Z}=b5({id:c,data:I,disabled:N.droppable,resizeObserverConfig:{updateMeasurementsFor:R,...p}}),{active:F,activatorEvent:H,activeNodeRect:J,attributes:_,setNodeRef:W,listeners:Y,isDragging:ie,over:K,setActivatorNodeRef:ae,transform:T}=g5({id:c,data:I,attributes:{...P5,...n},disabled:N.draggable}),M=eM(Z,W),q=!!F,L=q&&!C&&pu(y)&&pu(w),ue=!S&&ie,fe=ue&&L?T:null,oe=L?fe??(d??E)({rects:j,activeNodeRect:J,activeIndex:y,overIndex:w,index:P}):null,he=pu(y)&&pu(w)?l({id:c,items:h,activeIndex:y,overIndex:w}):P,we=F==null?void 0:F.id,Se=f.useRef({activeId:we,items:h,newIndex:he,containerId:x}),pe=h!==Se.current.items,He=t({active:F,containerId:x,isDragging:ie,isSorting:q,id:c,index:P,items:h,newIndex:Se.current.newIndex,previousItems:Se.current.items,previousContainerId:Se.current.containerId,transition:m,wasDragging:Se.current.activeId!=null}),te=R5({disabled:!He,index:P,node:D,rect:$});return f.useEffect(()=>{q&&Se.current.newIndex!==he&&(Se.current.newIndex=he),x!==Se.current.containerId&&(Se.current.containerId=x),h!==Se.current.items&&(Se.current.items=h)},[q,he,x,h]),f.useEffect(()=>{if(we===Se.current.activeId)return;if(we!=null&&Se.current.activeId==null){Se.current.activeId=we;return}const ne=setTimeout(()=>{Se.current.activeId=we},50);return()=>clearTimeout(ne)},[we]),{active:F,activeIndex:y,attributes:_,data:I,rect:$,index:P,newIndex:he,items:h,isOver:X,isSorting:q,isDragging:ie,listeners:Y,node:D,overIndex:w,over:K,setNodeRef:M,setActivatorNodeRef:ae,setDroppableNodeRef:Z,setDraggableNodeRef:W,transform:te??oe,transition:ye()};function ye(){if(te||pe&&Se.current.newIndex===P)return T5;if(!(ue&&!zg(H)||!m)&&(q||He))return no.Transition.toString({...m,property:AS})}}function A5(e,t){var n,s;return typeof e=="boolean"?{draggable:e,droppable:!1}:{draggable:(n=e==null?void 0:e.draggable)!=null?n:t.draggable,droppable:(s=e==null?void 0:e.droppable)!=null?s:t.droppable}}function Gu(e){if(!e)return!1;const t=e.data.current;return!!(t&&"sortable"in t&&typeof t.sortable=="object"&&"containerId"in t.sortable&&"items"in t.sortable&&"index"in t.sortable)}const D5=[it.Down,it.Right,it.Up,it.Left],$5=(e,t)=>{let{context:{active:n,collisionRect:s,droppableRects:i,droppableContainers:l,over:c,scrollableAncestors:d}}=t;if(D5.includes(e.code)){if(e.preventDefault(),!n||!s)return;const p=[];l.getEnabled().forEach(x=>{if(!x||x!=null&&x.disabled)return;const y=i.get(x.id);if(y)switch(e.code){case it.Down:s.top<y.top&&p.push(x);break;case it.Up:s.top>y.top&&p.push(x);break;case it.Left:s.left>y.left&&p.push(x);break;case it.Right:s.left<y.left&&p.push(x);break}});const m=hM({collisionRect:s,droppableRects:i,droppableContainers:p});let h=hS(m,"id");if(h===(c==null?void 0:c.id)&&m.length>1&&(h=m[1].id),h!=null){const x=l.get(n.id),y=l.get(h),v=y?i.get(y.id):null,C=y==null?void 0:y.node.current;if(C&&v&&x&&y){const w=Ld(C).some((R,$)=>d[$]!==R),S=DS(x,y),E=L5(x,y),N=w||!S?{x:0,y:0}:{x:E?s.width-v.width:0,y:E?s.height-v.height:0},P={x:v.left,y:v.top};return N.x&&N.y?P:Ll(P,N)}}}};function DS(e,t){return!Gu(e)||!Gu(t)?!1:e.data.current.sortable.containerId===t.data.current.sortable.containerId}function L5(e,t){return!Gu(e)||!Gu(t)||!DS(e,t)?!1:e.data.current.sortable.index<t.data.current.sortable.index}function us(e){return`/api/projects/${encodeURIComponent(e)}/todos`}function I5(e){const[t,n]=f.useState(null),[s,i]=f.useState(!0),[l,c]=f.useState(null),d=f.useCallback(async()=>{if(e)try{const p=await fetch(us(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{i(!1)}},[e]);return f.useEffect(()=>{d()},[d]),Ul(p=>{p.type==="todos-updated"&&p.projectSlug===e&&d()}),{data:t,loading:s,error:l,refetch:d}}async function O5(e,t,n){await fetch(us(e),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({description:t,tags:n})})}async function _5(e,t,n){await fetch(`${us(e)}/${t}/complete`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({summary:"Completed."})})}async function M5(e,t,n){await fetch(`${us(e)}/${t}/block`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({reason:n})})}async function F5(e,t,n){await fetch(`${us(e)}/${t}/start`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({session:n})})}async function z5(e,t){await fetch(`${us(e)}/${t}/reopen`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({})})}async function B5(e,t){await fetch(`${us(e)}/reorder`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({ids:t})})}async function U5(e,t){await fetch(`${us(e)}/${t}`,{method:"DELETE"})}async function $S(e,t){const n=await fetch(e,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)});if(!n.ok){const s=await n.text().catch(()=>"");let i=null;try{i=s?JSON.parse(s):null}catch{}const l=(i==null?void 0:i.error)||s||`HTTP ${n.status}`,c=new Error(l);throw c.status=n.status,c}return n.json().catch(()=>({}))}async function H5(e,t){return await $S(`${us(e)}/promote`,t)}async function V5(e,t,n){await $S(`${us(e)}/${t}/move`,{to:n})}const Aw=[{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 Hg({status:e,onChange:t}){const[n,s]=f.useState(!1),i=f.useRef(null);f.useEffect(()=>{if(!n)return;function c(d){i.current&&!i.current.contains(d.target)&&s(!1)}return document.addEventListener("mousedown",c),()=>document.removeEventListener("mousedown",c)},[n]);const l=Aw.find(c=>c.value===e);return r.jsxs("div",{className:"relative",ref:i,onClick:c=>c.stopPropagation(),children:[r.jsx("button",{onClick:()=>s(!n),className:`text-lg leading-none ${l.color} hover:opacity-70 transition`,title:l.label,children:l.icon}),n&&r.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:Aw.filter(c=>c.value!==e).map(c=>r.jsxs("button",{onClick:()=>{t(c.value),s(!1)},className:`flex w-full items-center gap-2 px-3 py-1.5 text-sm hover:bg-foreground/5 transition ${c.color}`,children:[r.jsx("span",{className:"text-base leading-none",children:c.icon}),r.jsx("span",{children:c.label})]},c.value))})]})}const LS="__one_off__";function Vg({open:e,selectedIds:t,scope:n,onOpenChange:s,onDone:i,defaultProject:l,defaultTitle:c,allowOneOff:d=!0}){const[p,m]=f.useState("new"),[h,x]=f.useState(!1),[y,v]=f.useState(null),[C,j]=f.useState(null),[w,S]=f.useState(null),[E,N]=f.useState(""),[P,I]=f.useState(""),[R,$]=f.useState(""),[D,X]=f.useState(""),[Z,F]=f.useState(""),[H,J]=f.useState(""),[_,W]=f.useState(null),[Y,ie]=f.useState(!1),K=t.length>1;f.useEffect(()=>{if(!e){m("new"),v(null),N(""),I(""),$(""),X(""),F(""),J(""),W(null);return}N(l??""),I(c??"");let ue=!1;return(async()=>{try{const fe=await fetch("/api/projects");if(!fe.ok)throw new Error(`HTTP ${fe.status}`);const B=await fe.json();ue||j(B.filter(oe=>!oe.archived))}catch(fe){ue||S(fe instanceof Error?fe.message:String(fe))}})(),()=>{ue=!0}},[e,l,c]),f.useEffect(()=>{if(!Z){W(null);return}let ue=!1;return ie(!0),(async()=>{try{const fe=await fetch(`/api/projects/${encodeURIComponent(Z)}/assignments`);if(!fe.ok)throw new Error(`HTTP ${fe.status}`);const B=await fe.json();ue||W(B)}catch{ue||W([])}finally{ue||ie(!1)}})(),()=>{ue=!0}},[Z]);const ae=f.useMemo(()=>C??[],[C]);async function T(ue){if(ue.preventDefault(),!E){v('Pick a target project (or "One-off").');return}if(K&&!P.trim()){v("Title is required when promoting multiple todos.");return}const fe=E===LS?{oneOff:!0}:{project:E};if(n.kind==="aggregate"){const oe={groups:n.groups,mode:"new-assignment",target:fe,title:P.trim()||void 0,type:R.trim()||void 0,priority:D||void 0};await L(oe);return}const B={todoIds:t,mode:"new-assignment",target:fe,title:P.trim()||void 0,type:R.trim()||void 0,priority:D||void 0};await q(B)}async function M(ue){if(ue.preventDefault(),n.kind==="aggregate"){v("Existing-assignment mode does not support cross-workspace selections yet.");return}if(!Z||!H){v("Pick both project and assignment.");return}const fe={todoIds:t,mode:"to-assignment",target:{assignment:`${Z}/${H}`}};await q(fe)}async function q(ue){x(!0),v(null);try{let fe;if(n.kind==="workspace")fe=await PP(n.workspace,ue);else if(n.kind==="project")fe=await H5(n.projectId,ue);else throw new Error("Aggregate scope requires runBulkMutation.");i(fe),s(!1)}catch(fe){v(fe instanceof Error?fe.message:String(fe))}finally{x(!1)}}async function L(ue){x(!0),v(null);try{const fe=await RP(ue);i(fe),s(!1)}catch(fe){v(fe instanceof Error?fe.message:String(fe))}finally{x(!1)}}return r.jsx(mr,{open:e,onOpenChange:ue=>h?void 0:s(ue),children:r.jsxs(Gn,{className:"max-w-xl",children:[r.jsxs(as,{children:[r.jsxs(Yn,{children:["Promote ",t.length," todo",t.length===1?"":"s"]}),r.jsxs(ls,{children:["Convert the selected todo",t.length===1?"":"s"," to a new or existing assignment. Source todo",t.length===1?"":"s"," will be marked ",r.jsx("strong",{children:"in progress"})," and linked to the new assignment (auto-completed when the assignment closes)."]})]}),r.jsxs(E1,{value:p,onValueChange:ue=>m(ue),children:[r.jsxs(T1,{className:"flex gap-2 rounded-md border border-border/70 bg-card/80 p-1 mb-4",children:[r.jsx(Gm,{value:"new",className:Te("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"}),r.jsx(Gm,{value:"existing",className:Te("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"})]}),r.jsx(Ym,{value:"new",children:r.jsxs("form",{onSubmit:T,className:"space-y-4",children:[r.jsx(Ni,{label:"Target project",children:r.jsx(Dw,{value:E,onChange:N,projects:ae,error:w,disabled:h,allowOneOff:d})}),r.jsx(Ni,{label:K?"Title (required)":"Title (defaults to first todo)",children:r.jsx("input",{type:"text",value:P,onChange:ue=>I(ue.target.value),disabled:h,className:"editor-textarea w-full bg-background/95 font-sans"})}),r.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[r.jsx(Ni,{label:"Type",children:r.jsx("input",{type:"text",value:R,onChange:ue=>$(ue.target.value),placeholder:"feature",disabled:h,className:"editor-textarea w-full bg-background/95 font-sans"})}),r.jsx(Ni,{label:"Priority",children:r.jsxs("select",{value:D,onChange:ue=>X(ue.target.value),disabled:h,className:"editor-textarea w-full bg-background/95 font-sans",children:[r.jsx("option",{value:"",children:"—"}),r.jsx("option",{value:"low",children:"low"}),r.jsx("option",{value:"medium",children:"medium"}),r.jsx("option",{value:"high",children:"high"}),r.jsx("option",{value:"critical",children:"critical"})]})})]}),y?r.jsx($w,{message:y}):null,r.jsx(Lw,{onCancel:()=>s(!1),submitting:h,submitLabel:"Promote"})]})}),r.jsx(Ym,{value:"existing",children:r.jsxs("form",{onSubmit:M,className:"space-y-4",children:[r.jsx(Ni,{label:"Project",children:r.jsx(Dw,{value:Z,onChange:ue=>{F(ue),J("")},projects:ae,error:w,disabled:h})}),r.jsx(Ni,{label:Y?"Assignment (loading...)":"Assignment",children:r.jsxs("select",{value:H,onChange:ue=>J(ue.target.value),disabled:h||!Z||Y,className:"editor-textarea w-full bg-background/95 font-sans",children:[r.jsx("option",{value:"",children:Z?"Select assignment...":"Pick a project first"}),(_??[]).map(ue=>r.jsxs("option",{value:ue.slug,children:[ue.title," (",ue.status,")"]},ue.slug))]})}),y?r.jsx($w,{message:y}):null,r.jsx(Lw,{onCancel:()=>s(!1),submitting:h,submitLabel:"Promote"})]})})]})]})})}function Ni({label:e,children:t}){return r.jsxs("label",{className:"block space-y-1.5",children:[r.jsx("span",{className:"block text-xs font-medium uppercase tracking-[0.08em] text-muted-foreground",children:e}),t]})}function Dw({value:e,onChange:t,projects:n,error:s,disabled:i,allowOneOff:l}){return s?r.jsxs("div",{className:"text-sm text-destructive",children:["Failed to load projects: ",s]}):r.jsxs("select",{value:e,onChange:c=>t(c.target.value),disabled:i,className:"editor-textarea w-full bg-background/95 font-sans",children:[r.jsx("option",{value:"",children:"Select project..."}),l?r.jsx("option",{value:LS,children:"One-off (no project)"}):null,n.map(c=>r.jsxs("option",{value:c.slug,children:[c.title," (",c.slug,")"]},c.slug))]})}function $w({message:e}){return r.jsx("div",{className:"rounded-md border border-destructive/50 bg-destructive/10 px-3 py-2 text-sm text-destructive",children:e})}function Lw({onCancel:e,submitting:t,submitLabel:n}){return r.jsxs(oo,{children:[r.jsx("button",{type:"button",onClick:e,disabled:t,className:"shell-action disabled:cursor-not-allowed disabled:opacity-50",children:"Cancel"}),r.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 IS({open:e,selectedIds:t,scope:n,onOpenChange:s,onDone:i}){const[l,c]=f.useState("project"),[d,p]=f.useState(""),[m,h]=f.useState(""),[x,y]=f.useState(!1),[v,C]=f.useState(null),[j,w]=f.useState(null),[S,E]=f.useState(null);f.useEffect(()=>{if(!e){c("project"),p(""),h(""),C(null),w(null);return}let $=!1;return(async()=>{try{const D=await fetch("/api/projects");if(!D.ok)throw new Error(`HTTP ${D.status}`);const X=await D.json();$||E(X.filter(Z=>!Z.archived))}catch(D){$||w(D instanceof Error?D.message:String(D))}})(),()=>{$=!0}},[e]);const N=f.useMemo(()=>S?n.kind==="project"?S.filter($=>$.slug!==n.projectId):S:[],[S,n]);function P(){if(l==="global")return{global:!0};if(l==="workspace"){const $=d.trim();return $?{workspace:$}:"Workspace name is required."}return m?{project:m}:"Pick a target project."}async function I($,D){try{return n.kind==="workspace"?await AP(n.workspace,$,D):await V5(n.projectId,$,D),{ok:!0}}catch(X){return{ok:!1,error:X instanceof Error?X.message:String(X)}}}async function R($){$.preventDefault(),w(null);const D=P();if(typeof D=="string"){w(D);return}y(!0),C(null);const X=[],Z=[];for(const F of t){const H=await I(F,D);H.ok?X.push(F):Z.push({id:F,error:H.error})}y(!1),i(),Z.length===0?s(!1):C({succeeded:X,failed:Z})}return r.jsx(mr,{open:e,onOpenChange:$=>x?void 0:s($),children:r.jsx(Gn,{className:"max-w-xl",children:r.jsxs("form",{onSubmit:R,className:"space-y-4",children:[r.jsxs(as,{children:[r.jsxs(Yn,{children:["Move ",t.length," todo",t.length===1?"":"s"]}),r.jsxs(ls,{children:["Move the selected todo",t.length===1?"":"s"," to a different scope. id, tags, branch, timestamps, and plan dir are preserved."]})]}),r.jsxs("fieldset",{className:"space-y-2",disabled:x,children:[r.jsx("legend",{className:"block text-xs font-medium uppercase tracking-[0.08em] text-muted-foreground mb-1",children:"Target scope"}),r.jsx(wm,{kind:"project",checked:l==="project",onChange:()=>c("project"),label:"Project"}),r.jsx(wm,{kind:"workspace",checked:l==="workspace",onChange:()=>c("workspace"),label:"Workspace"}),r.jsx(wm,{kind:"global",checked:l==="global",onChange:()=>c("global"),label:"Global"})]}),l==="project"?r.jsx(Iw,{label:"Target project",children:r.jsxs("select",{value:m,onChange:$=>h($.target.value),disabled:x,className:"editor-textarea w-full bg-background/95 font-sans",children:[r.jsx("option",{value:"",children:"Select project..."}),N.map($=>r.jsxs("option",{value:$.slug,children:[$.title," (",$.slug,")"]},$.slug))]})}):null,l==="workspace"?r.jsx(Iw,{label:"Target workspace name",children:r.jsx("input",{type:"text",value:d,onChange:$=>p($.target.value),disabled:x,placeholder:"e.g. syntaur",className:"editor-textarea w-full bg-background/95 font-sans"})}):null,j?r.jsx(W5,{message:j}):null,v?r.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:[r.jsxs("div",{className:"font-medium",children:["Moved ",v.succeeded.length," of ",t.length,"; ",v.failed.length," failed."]}),r.jsx("ul",{className:"text-xs space-y-0.5",children:v.failed.map($=>r.jsxs("li",{children:["[t:",$.id,"] ",$.error]},$.id))})]}):null,r.jsxs(oo,{children:[r.jsx("button",{type:"button",onClick:()=>s(!1),disabled:x,className:"shell-action disabled:cursor-not-allowed disabled:opacity-50",children:v?"Close":"Cancel"}),v===null?r.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 Iw({label:e,children:t}){return r.jsxs("label",{className:"block space-y-1.5",children:[r.jsx("span",{className:"block text-xs font-medium uppercase tracking-[0.08em] text-muted-foreground",children:e}),t]})}function wm({kind:e,checked:t,onChange:n,label:s}){return r.jsxs("label",{className:"flex items-center gap-2 text-sm cursor-pointer",children:[r.jsx("input",{type:"radio",name:"move-target-kind",value:e,checked:t,onChange:n}),r.jsx("span",{children:s})]})}function W5({message:e}){return r.jsx("div",{className:"rounded-md border border-destructive/50 bg-destructive/10 px-3 py-2 text-sm text-destructive",children:e})}const K5={open:{icon:"○",cls:"text-muted-foreground",label:"Open"},in_progress:{icon:"◉",cls:"text-status-in-progress-foreground",label:"In progress"},blocked:{icon:"✕",cls:"text-status-blocked-foreground",label:"Blocked"},completed:{icon:"✓",cls:"text-status-completed-foreground",label:"Completed"},mixed:{icon:"◐",cls:"text-muted-foreground",label:"Mixed"}};function q5({bundle:e}){const t=K5[e.derivedStatus.status],{counts:n}=e.derivedStatus;return r.jsxs("div",{className:"border rounded-md p-3 mb-2 bg-card",children:[r.jsxs("div",{className:"flex items-center gap-3",children:[r.jsx("span",{className:`text-lg leading-none ${t.cls}`,title:t.label,children:t.icon}),r.jsxs("span",{className:"font-mono text-sm text-muted-foreground",children:["b:",e.id]}),e.slug&&r.jsx("span",{className:"font-medium",children:e.slug}),r.jsxs("span",{className:"ml-auto text-sm text-muted-foreground",children:[n.completed,"/",n.total," done"]})]}),r.jsxs("div",{className:"mt-2 grid gap-1 text-sm",children:[e.branch&&r.jsxs("div",{className:"text-muted-foreground",children:[r.jsx("span",{className:"font-medium",children:"Branch:"})," ",r.jsx("code",{className:"font-mono",children:e.branch})]}),e.worktreePath&&r.jsxs("div",{className:"text-muted-foreground truncate",children:[r.jsx("span",{className:"font-medium",children:"Worktree:"})," ",r.jsx("code",{className:"font-mono",children:e.worktreePath})]}),e.planDir&&r.jsxs("div",{className:"text-muted-foreground truncate",children:[r.jsx("span",{className:"font-medium",children:"Plan:"})," ",r.jsx("code",{className:"font-mono",children:e.planDir})]})]}),r.jsx("ul",{className:"mt-2 ml-6 text-sm list-disc",children:e.members.map(s=>r.jsxs("li",{className:s.status==="completed"?"line-through text-muted-foreground":"",children:[r.jsxs("span",{className:"font-mono text-xs text-muted-foreground mr-2",children:["t:",s.id]}),s.description]},s.id))})]})}function G5({bundles:e,title:t="Bundles"}){return e.length===0?null:r.jsxs("section",{className:"mb-6",children:[r.jsxs("h3",{className:"text-sm font-medium text-muted-foreground mb-2",children:[t," (",e.length,")"]}),e.map(n=>r.jsx(q5,{bundle:n},n.id))]})}function Y5(e){const[t,n]=f.useState(null),[s,i]=f.useState(!0),[l,c]=f.useState(null),d=f.useCallback(async()=>{try{const p=await fetch(`/api/bundles/${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 bundles")}finally{i(!1)}},[e]);return f.useEffect(()=>{d()},[d]),Ul(p=>{p.type==="todos-updated"&&!p.projectSlug&&d()}),{data:t,loading:s,error:l,refetch:d}}function J5({item:e,copiedId:t,selected:n,onToggleSelected:s,onMoveOne:i,onCycleStatus:l,onStatusChange:c,onCopyId:d,onDelete:p,disabled:m,hotkeyRowProps:h}){const{attributes:x,listeners:y,setNodeRef:v,setActivatorNodeRef:C,transform:j,transition:w,isDragging:S}=zd({id:e.id,disabled:m}),E={transform:no.Transform.toString(j),transition:w,zIndex:S?50:void 0,position:S?"relative":void 0};return r.jsxs("div",{ref:v,style:E,"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:[r.jsx("input",{type:"checkbox","aria-label":`Select todo ${e.id}`,checked:n,onChange:N=>s(e.id,N),onClick:N=>N.stopPropagation(),className:"h-4 w-4 cursor-pointer accent-foreground"}),!m&&r.jsx("button",{ref:C,...x,...y,className:"cursor-grab active:cursor-grabbing text-muted-foreground/40 hover:text-muted-foreground transition touch-none",onClick:N=>N.stopPropagation(),children:r.jsx(sd,{className:"h-4 w-4"})}),r.jsx(Hg,{status:e.status,onChange:N=>c(e.id,N)}),r.jsxs("div",{className:"flex-1 min-w-0",children:[r.jsx("span",{className:`text-sm ${e.status==="completed"?"line-through text-muted-foreground":"text-foreground"}`,children:e.description}),e.tags.length>0&&r.jsx("span",{className:"ml-2 text-xs text-muted-foreground",children:e.tags.map(N=>`#${N}`).join(" ")}),e.session&&r.jsxs("span",{className:"ml-2 text-xs text-info-foreground/70 font-mono",children:["session:",e.session.slice(0,8)]}),r.jsx(OS,{item:e})]}),t===e.id?r.jsxs("span",{className:"text-xs text-status-completed-foreground flex items-center gap-1",children:[r.jsx(Fo,{className:"h-3 w-3"})," Copied to clipboard"]}):r.jsxs(r.Fragment,{children:[r.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]}),r.jsx("button",{className:"text-muted-foreground/40 hover:text-foreground transition",title:"Copy ID",onClick:N=>d(N,e.id),children:r.jsx(El,{className:"h-3 w-3"})}),r.jsx("button",{className:"text-muted-foreground/40 hover:text-foreground transition",title:"Move to...",onClick:N=>i(e.id,N),children:r.jsx(Bl,{className:"h-3 w-3"})}),r.jsx("button",{className:"text-muted-foreground/40 hover:text-destructive transition",title:"Delete todo",onClick:N=>p(N,e.id,e.description),children:r.jsx(In,{className:"h-3 w-3"})})]})]})}function OS({item:e}){return!(e.branch||e.planDir||e.worktreePath||e.createdAt||e.updatedAt)?null:r.jsxs("span",{className:"inline-flex items-center gap-1 ml-2 align-middle",children:[e.branch?r.jsx(Lo,{delayDuration:120,children:r.jsxs(Nr,{children:[r.jsx(Cr,{asChild:!0,children:r.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:[r.jsx(kh,{className:"h-2.5 w-2.5"}),r.jsx("span",{className:"block min-w-0 max-w-[120px] truncate",children:e.branch})]})}),r.jsx(ur,{children:e.branch})]})}):null,e.planDir?r.jsx(Lo,{delayDuration:120,children:r.jsxs(Nr,{children:[r.jsx(Cr,{asChild:!0,children:r.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:r.jsx(D0,{className:"h-2.5 w-2.5"})})}),r.jsxs(ur,{children:["Plan: ",e.planDir]})]})}):null,e.worktreePath||e.createdAt||e.updatedAt?r.jsx(Lo,{delayDuration:120,children:r.jsxs(Nr,{children:[r.jsx(Cr,{asChild:!0,children:r.jsx("span",{className:"text-[10px] text-muted-foreground/60 cursor-default",children:"·"})}),r.jsx(ur,{children:r.jsxs("div",{className:"space-y-0.5 text-xs font-mono",children:[e.worktreePath?r.jsxs("div",{children:["worktree: ",e.worktreePath]}):null,e.createdAt?r.jsxs("div",{children:["created: ",e.createdAt]}):null,e.updatedAt?r.jsxs("div",{children:["updated: ",e.updatedAt]}):null]})})]})}):null]})}function X5(){const{workspace:e}=At(),t=e||"_global",{data:n,loading:s,error:i,refetch:l}=EP(t),{data:c}=Y5(t),[d,p]=f.useState(""),[m,h]=f.useState(""),[x,y]=f.useState(""),[v,C]=f.useState(""),[j,w]=f.useState(null),[S,E]=f.useState(new Set),[N,P]=f.useState(!1),[I,R]=f.useState(!1),[$,D]=f.useState(null),X=f.useRef(null);ao("list:todos");const Z=!!(d.trim()||m||x),F=Dd(ro(ua,{activationConstraint:{distance:8}}),ro(ca));function H(ne,U){ne.stopPropagation(),navigator.clipboard.writeText(U),w(U),setTimeout(()=>w(de=>de===U?null:de),1500)}const J=f.useMemo(()=>{if(!(n!=null&&n.items))return[];const ne=new Set;for(const U of n.items)for(const de of U.tags)ne.add(de);return Array.from(ne).sort()},[n]),_=f.useMemo(()=>{if(!(n!=null&&n.items))return[];let ne=n.items;if(d.trim()){const U=d.toLowerCase();ne=ne.filter(de=>de.description.toLowerCase().includes(U)||de.tags.some(me=>me.toLowerCase().includes(U))||de.id.includes(U))}return m&&(ne=ne.filter(U=>U.status===m)),x&&(ne=ne.filter(U=>U.tags.includes(x))),ne},[n,d,m,x]);f.useEffect(()=>{E(new Set)},[d,m,x,t]);const W=f.useMemo(()=>_.filter(ne=>S.has(ne.id)).length,[_,S]),Y=_.length>0&&W===_.length,ie=W>0&&!Y;function K(ne){E(U=>{const de=new Set(U);return de.has(ne)?de.delete(ne):de.add(ne),de})}function ae(){E(ne=>{const U=new Set(ne);if(Y)for(const de of _)U.delete(de.id);else for(const de of _)U.add(de.id);return U})}function T(){E(new Set)}const M=$?[$]:Array.from(S);function q(){E(new Set),D(null),l()}function L(){E(new Set),l()}async function ue(){v.trim()&&(await Ih(t,v.trim()),C(""),l())}const fe={open:"in_progress",in_progress:"completed",completed:"open",blocked:"open"};function B(ne,U){he(ne,fe[U]||"open")}async function oe(ne,U,de){ne.stopPropagation(),window.confirm(`Delete "${de}"? This can't be undone.`)&&(await gj(t,U),l())}async function he(ne,U){switch(U){case"open":await hj(t,ne);break;case"in_progress":await mj(t,ne);break;case"completed":await fj(t,ne);break;case"blocked":await pj(t,ne);break}l()}const{hotkeyRowProps:we}=Hl(_,{scope:"list:todos",bindO:!1,onOpen:ne=>B(ne.id,ne.status)});Pt({keys:"/",scope:"list:todos",description:"Focus filter",handler:()=>{var ne;return(ne=X.current)==null?void 0:ne.focus()}}),Pt({keys:"r",scope:"list:todos",description:"Refresh",handler:()=>l()});const[Se,pe]=is(),He=Se.get("focus");f.useEffect(()=>{if(!He)return;const ne=document.querySelector(`[data-todo-id="${window.CSS.escape(He)}"]`);if(!ne)return;ne.scrollIntoView({block:"nearest"}),ne.classList.add("ring-2","ring-primary/60");const U=window.setTimeout(()=>{ne.classList.remove("ring-2","ring-primary/60"),pe(de=>{const me=new URLSearchParams(de);return me.delete("focus"),me})},1500);return()=>window.clearTimeout(U)},[He,_.length,pe]);async function te(ne){const{active:U,over:de}=ne;if(!de||U.id===de.id||!(n!=null&&n.items))return;const me=n.items.findIndex(Ve=>Ve.id===U.id),Fe=n.items.findIndex(Ve=>Ve.id===de.id);if(me===-1||Fe===-1)return;const qe=da(n.items,me,Fe);await TP(t,qe.map(Ve=>Ve.id)),l()}if(s)return r.jsx(ct,{label:"Loading todos..."});if(i)return r.jsx(mt,{error:i});const ye=(n==null?void 0:n.counts)||{open:0,in_progress:0,blocked:0,total:0};return r.jsxs("div",{className:"space-y-4",children:[r.jsxs("div",{className:"grid gap-3 grid-cols-[repeat(auto-fill,minmax(140px,1fr))]",children:[r.jsx(jn,{label:"Open",value:ye.open,icon:Er}),r.jsx(jn,{label:"In Progress",value:ye.in_progress,icon:Er,tone:"info"}),r.jsx(jn,{label:"Blocked",value:ye.blocked,icon:Th,tone:"warn"}),r.jsx(jn,{label:"Total",value:ye.total,icon:Er})]}),c&&r.jsx(G5,{bundles:c.bundles}),r.jsx("div",{className:"surface-panel p-3",children:r.jsxs("div",{className:"flex gap-2",children:[r.jsx("input",{type:"text",placeholder:"Add a todo...",value:v,onChange:ne=>C(ne.target.value),onKeyDown:ne=>ne.key==="Enter"&&ue(),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"}),r.jsxs("button",{onClick:ue,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:[r.jsx(Jt,{className:"h-4 w-4"}),"Add"]})]})}),r.jsxs("div",{className:"flex items-center gap-3",children:[r.jsxs("div",{className:"relative flex-1 max-w-sm",children:[r.jsx(so,{className:"absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground"}),r.jsx("input",{ref:X,type:"text",placeholder:"Search...",value:d,onChange:ne=>p(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"})]}),r.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:[r.jsx("option",{value:"",children:"All statuses"}),r.jsx("option",{value:"open",children:"Open"}),r.jsx("option",{value:"in_progress",children:"In Progress"}),r.jsx("option",{value:"completed",children:"Completed"}),r.jsx("option",{value:"blocked",children:"Blocked"})]}),J.length>0&&r.jsxs("select",{value:x,onChange:ne=>y(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:[r.jsx("option",{value:"",children:"All tags"}),J.map(ne=>r.jsxs("option",{value:ne,children:["#",ne]},ne))]})]}),S.size>0?r.jsxs("div",{className:"surface-panel flex items-center justify-between gap-3 px-3 py-2",children:[r.jsxs("span",{className:"text-sm font-medium",children:[S.size," selected"]}),r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx("button",{type:"button",onClick:()=>P(!0),className:"shell-action bg-foreground text-background hover:opacity-90",children:"Promote selected"}),r.jsx("button",{type:"button",onClick:()=>{D(null),R(!0)},className:"shell-action",children:"Move to…"}),r.jsx("button",{type:"button",onClick:T,className:"text-xs text-muted-foreground hover:text-foreground",children:"Clear"})]})]}):null,_.length===0?r.jsx(pt,{title:"No todos",description:"Add your first todo above."}):r.jsxs(r.Fragment,{children:[r.jsxs("div",{className:"flex items-center gap-3 px-3 py-1 text-xs text-muted-foreground",children:[r.jsx("input",{type:"checkbox","aria-label":"Select all visible todos",checked:Y,ref:ne=>{ne&&(ne.indeterminate=ie)},onChange:ae,className:"h-4 w-4 cursor-pointer accent-foreground"}),r.jsxs("span",{children:["Select all in current filter (",_.length,")"]})]}),r.jsx(_d,{sensors:F,collisionDetection:$d,onDragEnd:te,children:r.jsx(Fd,{items:_.map(ne=>ne.id),strategy:Md,children:r.jsx("div",{className:"space-y-1",children:_.map((ne,U)=>r.jsx(J5,{item:ne,copiedId:j,selected:S.has(ne.id),onToggleSelected:de=>K(de),onMoveOne:(de,me)=>{me.stopPropagation(),D(de),R(!0)},onCycleStatus:B,onStatusChange:he,onCopyId:H,onDelete:oe,disabled:Z,hotkeyRowProps:we(U)},ne.id))})})})]}),r.jsx(Vg,{open:N,selectedIds:Array.from(S),scope:{kind:"workspace",workspace:t},onOpenChange:P,onDone:L}),r.jsx(IS,{open:I,selectedIds:M,scope:{kind:"workspace",workspace:t},onOpenChange:ne=>{R(ne),ne||D(null)},onDone:q})]})}function Q5({item:e,copiedId:t,selected:n,onToggleSelected:s,onMoveOne:i,onCycleStatus:l,onStatusChange:c,onCopyId:d,onDelete:p,disabled:m,hotkeyRowProps:h}){const{attributes:x,listeners:y,setNodeRef:v,setActivatorNodeRef:C,transform:j,transition:w,isDragging:S}=zd({id:e.id,disabled:m}),E={transform:no.Transform.toString(j),transition:w,zIndex:S?50:void 0,position:S?"relative":void 0};return r.jsxs("div",{ref:v,style:E,"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:[r.jsx("input",{type:"checkbox","aria-label":`Select todo ${e.id}`,checked:n,onChange:N=>s(e.id,N),onClick:N=>N.stopPropagation(),className:"h-4 w-4 cursor-pointer accent-foreground"}),!m&&r.jsx("button",{ref:C,...x,...y,className:"cursor-grab active:cursor-grabbing text-muted-foreground/40 hover:text-muted-foreground transition touch-none",onClick:N=>N.stopPropagation(),children:r.jsx(sd,{className:"h-4 w-4"})}),r.jsx(Hg,{status:e.status,onChange:N=>c(e.id,N)}),r.jsxs("div",{className:"flex-1 min-w-0",children:[r.jsx("span",{className:`text-sm ${e.status==="completed"?"line-through text-muted-foreground":"text-foreground"}`,children:e.description}),e.tags.length>0&&r.jsx("span",{className:"ml-2 text-xs text-muted-foreground",children:e.tags.map(N=>`#${N}`).join(" ")}),e.session&&r.jsxs("span",{className:"ml-2 text-xs text-info-foreground/70 font-mono",children:["session:",e.session.slice(0,8)]}),r.jsx(OS,{item:e})]}),t===e.id?r.jsxs("span",{className:"text-xs text-status-completed-foreground flex items-center gap-1",children:[r.jsx(Fo,{className:"h-3 w-3"})," Copied to clipboard"]}):r.jsxs(r.Fragment,{children:[r.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]}),r.jsx("button",{className:"text-muted-foreground/40 hover:text-foreground transition",title:"Copy ID",onClick:N=>d(N,e.id),children:r.jsx(El,{className:"h-3 w-3"})}),r.jsx("button",{className:"text-muted-foreground/40 hover:text-foreground transition",title:"Move to...",onClick:N=>i(e.id,N),children:r.jsx(Bl,{className:"h-3 w-3"})}),r.jsx("button",{className:"text-muted-foreground/40 hover:text-destructive transition",title:"Delete todo",onClick:N=>p(N,e.id,e.description),children:r.jsx(In,{className:"h-3 w-3"})})]})]})}function Z5({projectId:e}){const{data:t,loading:n,error:s,refetch:i}=I5(e),[l,c]=f.useState(""),[d,p]=f.useState(""),[m,h]=f.useState(""),[x,y]=f.useState(""),[v,C]=f.useState(null),[j,w]=f.useState(new Set),[S,E]=f.useState(!1),[N,P]=f.useState(!1),[I,R]=f.useState(null),$=f.useRef(null);ao("list:todos");const D=!!(l.trim()||d||m),X=Dd(ro(ua,{activationConstraint:{distance:8}}),ro(ca));function Z(te,ye){te.stopPropagation(),navigator.clipboard.writeText(ye),C(ye),setTimeout(()=>C(ne=>ne===ye?null:ne),1500)}const F=f.useMemo(()=>{if(!(t!=null&&t.items))return[];const te=new Set;for(const ye of t.items)for(const ne of ye.tags)te.add(ne);return Array.from(te).sort()},[t]),H=f.useMemo(()=>{if(!(t!=null&&t.items))return[];let te=t.items;if(l.trim()){const ye=l.toLowerCase();te=te.filter(ne=>ne.description.toLowerCase().includes(ye)||ne.tags.some(U=>U.toLowerCase().includes(ye))||ne.id.includes(ye))}return d&&(te=te.filter(ye=>ye.status===d)),m&&(te=te.filter(ye=>ye.tags.includes(m))),te},[t,l,d,m]);f.useEffect(()=>{w(new Set)},[l,d,m,e]);const J=f.useMemo(()=>H.filter(te=>j.has(te.id)).length,[H,j]),_=H.length>0&&J===H.length,W=J>0&&!_;function Y(te){w(ye=>{const ne=new Set(ye);return ne.has(te)?ne.delete(te):ne.add(te),ne})}function ie(){w(te=>{const ye=new Set(te);if(_)for(const ne of H)ye.delete(ne.id);else for(const ne of H)ye.add(ne.id);return ye})}function K(){w(new Set)}const ae=I?[I]:Array.from(j);function T(){w(new Set),R(null),i()}function M(){w(new Set),i()}async function q(){x.trim()&&(await O5(e,x.trim()),y(""),i())}const L={open:"in_progress",in_progress:"completed",completed:"open",blocked:"open"};function ue(te,ye){B(te,L[ye]||"open")}async function fe(te,ye,ne){te.stopPropagation(),window.confirm(`Delete "${ne}"? This can't be undone.`)&&(await U5(e,ye),i())}async function B(te,ye){switch(ye){case"open":await z5(e,te);break;case"in_progress":await F5(e,te);break;case"completed":await _5(e,te);break;case"blocked":await M5(e,te);break}i()}const{hotkeyRowProps:oe}=Hl(H,{scope:"list:todos",bindO:!1,onOpen:te=>ue(te.id,te.status)});Pt({keys:"/",scope:"list:todos",description:"Focus filter",handler:()=>{var te;return(te=$.current)==null?void 0:te.focus()}}),Pt({keys:"r",scope:"list:todos",description:"Refresh",handler:()=>i()});const[he,we]=is(),Se=he.get("focus");f.useEffect(()=>{if(!Se)return;const te=document.querySelector(`[data-todo-id="${window.CSS.escape(Se)}"]`);if(!te)return;te.scrollIntoView({block:"nearest"}),te.classList.add("ring-2","ring-primary/60");const ye=window.setTimeout(()=>{te.classList.remove("ring-2","ring-primary/60"),we(ne=>{const U=new URLSearchParams(ne);return U.delete("focus"),U},{replace:!0})},1500);return()=>window.clearTimeout(ye)},[Se,H.length,we]);async function pe(te){const{active:ye,over:ne}=te;if(!ne||ye.id===ne.id||!(t!=null&&t.items))return;const U=t.items.findIndex(Fe=>Fe.id===ye.id),de=t.items.findIndex(Fe=>Fe.id===ne.id);if(U===-1||de===-1)return;const me=da(t.items,U,de);await B5(e,me.map(Fe=>Fe.id)),i()}if(n)return r.jsx(ct,{label:"Loading todos..."});if(s)return r.jsx(mt,{error:s});const He=(t==null?void 0:t.counts)||{open:0,in_progress:0,blocked:0,total:0};return r.jsxs("div",{className:"space-y-4",children:[r.jsxs("div",{className:"grid gap-3 grid-cols-[repeat(auto-fill,minmax(140px,1fr))]",children:[r.jsx(jn,{label:"Open",value:He.open,icon:Er}),r.jsx(jn,{label:"In Progress",value:He.in_progress,icon:Er,tone:"info"}),r.jsx(jn,{label:"Blocked",value:He.blocked,icon:Th,tone:"warn"}),r.jsx(jn,{label:"Total",value:He.total,icon:Er})]}),r.jsx("div",{className:"surface-panel p-3",children:r.jsxs("div",{className:"flex gap-2",children:[r.jsx("input",{type:"text",placeholder:"Add a todo...",value:x,onChange:te=>y(te.target.value),onKeyDown:te=>te.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"}),r.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:[r.jsx(Jt,{className:"h-4 w-4"}),"Add"]})]})}),r.jsxs("div",{className:"flex items-center gap-3",children:[r.jsxs("div",{className:"relative flex-1 max-w-sm",children:[r.jsx(so,{className:"absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground"}),r.jsx("input",{ref:$,type:"text",placeholder:"Search...",value:l,onChange:te=>c(te.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"})]}),r.jsxs("select",{value:d,onChange:te=>p(te.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:[r.jsx("option",{value:"",children:"All statuses"}),r.jsx("option",{value:"open",children:"Open"}),r.jsx("option",{value:"in_progress",children:"In Progress"}),r.jsx("option",{value:"completed",children:"Completed"}),r.jsx("option",{value:"blocked",children:"Blocked"})]}),F.length>0&&r.jsxs("select",{value:m,onChange:te=>h(te.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:[r.jsx("option",{value:"",children:"All tags"}),F.map(te=>r.jsxs("option",{value:te,children:["#",te]},te))]})]}),j.size>0?r.jsxs("div",{className:"surface-panel flex items-center justify-between gap-3 px-3 py-2",children:[r.jsxs("span",{className:"text-sm font-medium",children:[j.size," selected"]}),r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx("button",{type:"button",onClick:()=>E(!0),className:"shell-action bg-foreground text-background hover:opacity-90",children:"Promote selected"}),r.jsx("button",{type:"button",onClick:()=>{R(null),P(!0)},className:"shell-action",children:"Move to…"}),r.jsx("button",{type:"button",onClick:K,className:"text-xs text-muted-foreground hover:text-foreground",children:"Clear"})]})]}):null,H.length===0?r.jsx(pt,{title:"No todos",description:"Add your first todo above."}):r.jsxs(r.Fragment,{children:[r.jsxs("div",{className:"flex items-center gap-3 px-3 py-1 text-xs text-muted-foreground",children:[r.jsx("input",{type:"checkbox","aria-label":"Select all visible todos",checked:_,ref:te=>{te&&(te.indeterminate=W)},onChange:ie,className:"h-4 w-4 cursor-pointer accent-foreground"}),r.jsxs("span",{children:["Select all in current filter (",H.length,")"]})]}),r.jsx(_d,{sensors:X,collisionDetection:$d,onDragEnd:pe,children:r.jsx(Fd,{items:H.map(te=>te.id),strategy:Md,children:r.jsx("div",{className:"space-y-1",children:H.map((te,ye)=>r.jsx(Q5,{item:te,copiedId:v,selected:j.has(te.id),onToggleSelected:ne=>Y(ne),onMoveOne:(ne,U)=>{U.stopPropagation(),R(ne),P(!0)},onCycleStatus:ue,onStatusChange:B,onCopyId:Z,onDelete:fe,disabled:D,hotkeyRowProps:oe(ye)},te.id))})})})]}),r.jsx(Vg,{open:S,selectedIds:Array.from(j),scope:{kind:"project",projectId:e},onOpenChange:E,onDone:M}),r.jsx(IS,{open:N,selectedIds:ae,scope:{kind:"project",projectId:e},onOpenChange:te=>{P(te),te||R(null)},onDone:T})]})}const eF={title:"Assignment",status:"Status",priority:"Priority",assignee:"Assignee",dependencies:"Dependencies",updated:"Updated"},Ow=new Set(["title"]);function _S({visibility:e,onChange:t}){const[n,s]=f.useState(!1);function i(c){if(Ow.has(c))return;const p=e.hidden.includes(c)?e.hidden.filter(m=>m!==c):[...e.hidden,c];t({hidden:p})}const l=e.hidden.length;return r.jsxs(mr,{open:n,onOpenChange:s,children:[r.jsx(w3,{asChild:!0,children:r.jsxs("button",{type:"button",className:"inline-flex items-center gap-1.5 rounded-md border border-border/60 bg-background/60 px-2.5 py-1.5 text-xs font-medium text-foreground hover:bg-background",title:"Show or hide table columns",children:[r.jsx(Q2,{className:"h-3.5 w-3.5","aria-hidden":"true"}),r.jsxs("span",{children:["Columns",l>0?` (${Xp.length-l}/${Xp.length})`:""]})]})}),r.jsxs(Gn,{className:"max-w-sm",children:[r.jsx(as,{children:r.jsx(Yn,{children:"Columns"})}),r.jsx("div",{className:"space-y-2",children:Xp.map(c=>{const d=e.hidden.includes(c),p=Ow.has(c);return r.jsxs("label",{className:`flex items-center gap-2 rounded-md px-2 py-1.5 text-sm ${p?"opacity-60":"cursor-pointer hover:bg-background/80"}`,children:[r.jsx("input",{type:"checkbox",checked:!d,onChange:()=>i(c),disabled:p,className:"h-4 w-4 rounded border-border accent-foreground"}),r.jsx("span",{children:eF[c]}),p?r.jsx("span",{className:"ml-auto text-xs text-muted-foreground",children:"always shown"}):null]},c)})})]})]})}const Vi={...Pl,custom:!1},MS=`view-prefs.cache.v${Pl.version}`;let Ol=tF(),Ci=null;const _l=new Set;let FS=0;function Wg(){return++FS}function Kg(e){return e===FS}function tF(){if(typeof window>"u"||!window.localStorage)return null;try{const e=window.localStorage.getItem(MS);if(!e)return null;const t=JSON.parse(e);return t.version!==Pl.version?null:t}catch{return null}}function nF(e){if(!(typeof window>"u"||!window.localStorage))try{window.localStorage.setItem(MS,JSON.stringify(e))}catch{}}function qg(e){Ol=e,nF(e);for(const t of _l)t(e)}function Gg(e){if(!e||typeof e!="object")return Vi;const t=e;return t.version!==Pl.version||!t.global||!t.projects?Vi:{version:Pl.version,global:t.global,projects:t.projects,custom:t.custom===!0}}function Yg(){if(Ci)return Ci;const e=Wg();return Ci=fetch("/api/view-prefs").then(t=>{if(!t.ok)throw new Error(`HTTP ${t.status}`);return t.json()}).then(t=>{const n=Gg(t);return Kg(e)&&qg(n),Ci=null,Ol??n}).catch(()=>(Ci=null,Ol??Vi)),Ci}function zS(e){const[t,n]=f.useState(()=>Ol??Vi);return f.useEffect(()=>{let s=!1;return Yg().then(i=>{s||n(i)}),_l.add(n),()=>{s=!0,_l.delete(n)}},[]),vk(t,e??null)}function rF(){const[e,t]=f.useState(()=>Ol??Vi);return f.useEffect(()=>{let n=!1;return Yg().then(s=>{n||t(s)}),_l.add(t),()=>{n=!0,_l.delete(t)}},[]),e}async function BS(e){const t=Wg(),n=await fetch("/api/view-prefs",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});if(!n.ok){const i=await n.json().catch(()=>({error:`HTTP ${n.status}`}));throw new Error(i.error??"Failed to save view-prefs")}const s=Gg(await n.json());return Kg(t)&&qg(s),s}function US(e){return BS({global:e})}function HS(e,t){return BS({projects:{[e]:t}})}async function sF(){const e=Wg(),t=await fetch("/api/view-prefs",{method:"DELETE"});if(!t.ok)throw new Error(`HTTP ${t.status}`);const n=Gg(await t.json());return Kg(e)&&qg(n),n}const _w=80;function VS({open:e,onOpenChange:t,initialName:n="",onSubmit:s,title:i="Save view"}){const[l,c]=f.useState(n),[d,p]=f.useState(!1),[m,h]=f.useState(null);f.useEffect(()=>{e&&(c(n),h(null),p(!1))},[e,n]);const x=l.trim(),y=x.length>0&&x.length<=_w;return r.jsx(mr,{open:e,onOpenChange:t,children:r.jsx(Gn,{className:"max-w-md",children:r.jsxs("form",{className:"space-y-4",onSubmit:async v=>{if(v.preventDefault(),!(!y||d)){p(!0),h(null);try{await s(x)}catch(C){h(C instanceof Error?C.message:String(C)),p(!1)}}},children:[r.jsx(as,{children:r.jsx(Yn,{children:i})}),r.jsxs("div",{className:"space-y-2",children:[r.jsx("input",{type:"text",value:l,autoFocus:!0,required:!0,maxLength:_w,onChange:v=>c(v.target.value),placeholder:"View name",className:"w-full rounded-md border border-border/70 bg-background px-3 py-2 text-sm focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring"}),m?r.jsx("p",{className:"text-xs text-error-foreground",role:"alert",children:m}):null]}),r.jsxs(oo,{children:[r.jsx("button",{type:"button",onClick:()=>t(!1),className:"shell-action",disabled:d,children:"Cancel"}),r.jsx("button",{type:"submit",disabled:!y||d,className:"shell-action bg-foreground text-background hover:opacity-90 disabled:opacity-50",children:d?"Saving…":"Save"})]})]})})})}function WS({scope:e,loadedViewId:t,onApply:n,onOpenSaveDialog:s}){const{views:i,loading:l}=tg(),[c,d]=f.useState(!1),p=f.useRef(null);f.useEffect(()=>{if(!c)return;function y(C){p.current&&!p.current.contains(C.target)&&d(!1)}function v(C){C.key==="Escape"&&d(!1)}return document.addEventListener("mousedown",y),document.addEventListener("keydown",v),()=>{document.removeEventListener("mousedown",y),document.removeEventListener("keydown",v)}},[c]);const m=f.useMemo(()=>i.filter(y=>bA(y,e)),[i,e]),h=t?i.find(y=>y.id===t)??null:null,x=l?"Saved views…":h?h.name:"Saved views";return r.jsxs("div",{className:"relative",ref:p,children:[r.jsxs("button",{type:"button",disabled:l,onClick:()=>d(y=>!y),className:"inline-flex items-center gap-1.5 rounded-md border border-border/60 bg-background/60 px-2.5 py-1.5 text-xs font-medium text-foreground hover:bg-background disabled:opacity-50","aria-haspopup":"true","aria-expanded":c,title:"Saved views",children:[r.jsx("span",{className:"max-w-[160px] truncate",children:x}),r.jsx(Io,{className:"h-3.5 w-3.5","aria-hidden":"true"})]}),c&&r.jsx("div",{className:"absolute right-0 top-full z-30 mt-1 min-w-[240px] rounded-md border border-border/70 bg-background shadow-lg py-1",children:m.length===0?r.jsxs("div",{className:"px-3 py-3 text-sm text-muted-foreground",children:[r.jsx("p",{className:"mb-2",children:"No saved views yet — Save the current view to start."}),r.jsx("button",{type:"button",onClick:()=>{d(!1),s()},className:"shell-action w-full justify-center",children:"Save current view"})]}):m.map(y=>{const v=y.id===t;return r.jsxs("button",{type:"button",onClick:()=>{d(!1),n(y)},className:Te("flex w-full items-center gap-2 px-3 py-1.5 text-left text-sm transition hover:bg-foreground/5",v&&"font-semibold text-foreground"),children:[r.jsx("span",{className:"inline-flex h-4 w-4 shrink-0 items-center justify-center",children:v?r.jsx(Fo,{className:"h-3.5 w-3.5","aria-hidden":"true"}):null}),r.jsx("span",{className:"truncate",children:y.name})]},y.id)})})]})}const Ri={status:"all",priority:"all",assignee:"all",project:"all",activity:"all",type:"all"};function oF(e,t){const n={};return e.status!==void 0&&e.status!==Ri.status&&(n.status=e.status),e.priority!==void 0&&e.priority!==Ri.priority&&(n.priority=e.priority),e.assignee!==void 0&&e.assignee!==Ri.assignee&&(n.assignee=e.assignee),e.activity!==void 0&&e.activity!==Ri.activity&&(n.activity=e.activity),t&&t!=="all"?n.project=t:e.project!==void 0&&e.project!==Ri.project&&(n.project=e.project),n}function Yu(e){const t={viewMode:e.state.viewMode,filters:oF(e.state.filters,e.context.projectSlug),sortField:e.state.sortField,sortDirection:e.state.sortDirection,listSectionVisibility:{collapsed:[...e.state.listSectionVisibility.collapsed]},kanbanColumnVisibility:{hidden:[...e.state.kanbanColumnVisibility.hidden]},tableColumnVisibility:{hidden:[...e.state.tableColumnVisibility.hidden]}};return{name:e.name.trim(),workspace:e.context.workspace,config:t}}function KS(e,t){var s,i,l,c,d,p;const{config:n}=e;if((s=t.setViewMode)==null||s.call(t,n.viewMode),t.setStatusFilter&&t.setStatusFilter(n.filters.status??"all"),t.setPriorityFilter&&t.setPriorityFilter(n.filters.priority??"all"),t.setAssigneeFilter&&t.setAssigneeFilter(n.filters.assignee??"all"),t.setProjectFilter&&t.setProjectFilter(n.filters.project??"all"),t.setActivityFilter){const m=n.filters.activity??"all";t.setActivityFilter(m==="fresh"||m==="stale"?m:"all")}(i=t.setSortField)==null||i.call(t,n.sortField),(l=t.setSortDirection)==null||l.call(t,n.sortDirection),(c=t.setListSectionVisibility)==null||c.call(t,{collapsed:[...n.listSectionVisibility.collapsed]}),(d=t.setKanbanColumnVisibility)==null||d.call(t,{hidden:[...n.kanbanColumnVisibility.hidden]}),(p=t.setTableColumnVisibility)==null||p.call(t,{hidden:[...n.tableColumnVisibility.hidden]})}function iF(e){const t=e.workspace?`/w/${e.workspace}`:"",n=e.config.filters.project;return n&&n!=="all"&&n!=="__standalone__"?`${t}/projects/${n}?tab=assignments&loadView=${encodeURIComponent(e.id)}`:`${t}/assignments?loadView=${encodeURIComponent(e.id)}`}function aF(e){const t=[];for(const n of["status","priority","assignee","project","activity"]){const s=e[n];!s||s===Ri[n]||t.push(`${n}=${s}`)}return t.join(" · ")||"no filters"}const lF=4e3;function Jg(){const[e,t]=f.useState(null),n=f.useRef(null),s=f.useCallback(()=>{n.current!==null&&(clearTimeout(n.current),n.current=null),t(null)},[]),i=f.useCallback((l,c="error")=>{n.current!==null&&clearTimeout(n.current),t({id:Date.now()+Math.random(),message:l,kind:c}),n.current=setTimeout(()=>{t(null),n.current=null},lF)},[]);return f.useEffect(()=>()=>{n.current!==null&&clearTimeout(n.current)},[]),{toast:e,showToast:i,dismissToast:s}}function Xg({toast:e,onDismiss:t}){if(!e)return null;const n=e.kind==="error";return r.jsx("div",{className:"pointer-events-none fixed bottom-4 right-4 z-50 flex max-w-sm",role:"status","aria-live":"polite",children:r.jsx("button",{type:"button",onClick:t,className:Te("syntaur-toast pointer-events-auto rounded-md border px-4 py-3 text-sm font-medium shadow-lg transition",n?"border-error-foreground/30 bg-error text-error-foreground hover:opacity-90":"border-success-foreground/30 bg-success text-success-foreground hover:opacity-90"),children:e.message},e.id)})}const cF=new Set(["overview","assignments","todos","dependencies","knowledge"]),Mw="__unknown_type__";function Fw(){const{slug:e,workspace:t}=At(),n=Wt(),s=Rt();ao("project"),Pt({keys:"a",scope:"project",description:"Create assignment",handler:()=>s(`${n}/projects/${e}/create/assignment`)}),Pt({keys:"e",scope:"project",description:"Edit project",handler:()=>s(`${n}/projects/${e}/edit`)});const{data:i,loading:l,error:c,refetch:d}=oj(e),p=na(),m=vg(),{data:h}=id(),[x,y]=is(),v=x.get("tab"),C=v&&cF.has(v)?v:"overview";function j(Q){y(_e=>{const tt=new URLSearchParams(_e);return Q==="overview"?tt.delete("tab"):tt.set("tab",Q),tt},{replace:!0})}const w=e?`p:${e}`:null,S=zS(w),[E,N]=f.useState(()=>Jp(S.defaultView)),[P,I]=f.useState(()=>S.filters.status??"all"),[R,$]=f.useState(()=>S.filters.assignee??"all"),[D,X]=f.useState(()=>S.filters.priority??"all"),[Z,F]=f.useState(()=>S.filters.type??"all"),[H,J]=f.useState(()=>S.grouping),[_,W]=f.useState(()=>S.sortField),[Y,ie]=f.useState(()=>S.sortDirection),[K,ae]=f.useState(()=>({collapsed:[]})),[T,M]=f.useState(()=>({hidden:[]})),[q,L]=f.useState(()=>({hidden:[]})),[ue,fe]=f.useState(null),[B,oe]=f.useState(!1),[he,we]=f.useState(!1),{toast:Se,showToast:pe,dismissToast:He}=Jg(),te={kind:"project",slug:e??"",workspace:t??null},ye=x.get("loadView"),{view:ne,loading:U,error:de}=Ki(ye),{view:me,loading:Fe,error:qe}=Ki(ue),Ve=f.useRef(null);f.useEffect(()=>{ue&&!Fe&&!qe&&!me&&fe(null)},[me,qe,ue,Fe]),f.useEffect(()=>{fe(null),Ve.current=null},[e,t]),f.useEffect(()=>{N(Jp(S.defaultView)),I(S.filters.status??"all"),$(S.filters.assignee??"all"),X(S.filters.priority??"all"),F(S.filters.type??"all"),J(S.grouping),W(S.sortField),ie(S.sortDirection)},[e,S.defaultView,S.filters.status,S.filters.assignee,S.filters.priority,S.filters.type,S.grouping,S.sortField,S.sortDirection]);const Ze=f.useCallback(Q=>{w&&HS(w,Q).catch(_e=>{console.warn("Failed to persist project view prefs:",_e)})},[w]),St=f.useCallback(Q=>{N(Q),Ze({defaultView:Q})},[Ze]),bt=f.useCallback(Q=>{I(Q),Ze({filters:{status:Q}})},[Ze]),gt=f.useCallback(Q=>{$(Q),Ze({filters:{assignee:Q}})},[Ze]),ce=f.useCallback(Q=>{X(Q),Ze({filters:{priority:Q}})},[Ze]),ve=f.useCallback(Q=>{F(Q),Ze({filters:{type:Q}})},[Ze]),De=f.useCallback(Q=>{J(Q),Ze({grouping:Q})},[Ze]),Oe=f.useCallback(Q=>{W(Q),Ze({sortField:Q})},[Ze]),Ye=f.useCallback(Q=>{ie(Q),Ze({sortDirection:Q})},[Ze]),et=f.useCallback(()=>({viewMode:E,filters:{status:P,priority:D,assignee:R,project:"all",activity:"all"},sortField:_,sortDirection:Y,listSectionVisibility:K,kanbanColumnVisibility:T,tableColumnVisibility:q}),[E,P,D,R,_,Y,K,T,q]),It=f.useCallback(Q=>{KS(Q,{setViewMode:_e=>N(Jp(_e)),setStatusFilter:bt,setPriorityFilter:ce,setAssigneeFilter:gt,setSortField:Oe,setSortDirection:Ye,setListSectionVisibility:ae,setKanbanColumnVisibility:M,setTableColumnVisibility:L}),fe(Q.id)},[bt,ce,gt,Oe,Ye]),ge=f.useCallback(Q=>{It(Q),Ve.current=Q.id,y(_e=>{const tt=new URLSearchParams(_e);return tt.set("loadView",Q.id),tt},{replace:!0})},[It,y]),Qe=f.useCallback(async Q=>{try{const _e=Yu({name:Q,context:{workspace:t??null,projectSlug:e??null},state:et()}),tt=await Nk(_e),qt=tt.views[tt.views.length-1];fe((qt==null?void 0:qt.id)??null),qt&&(Ve.current=qt.id,y(nt=>{const fn=new URLSearchParams(nt);return fn.set("loadView",qt.id),fn},{replace:!0})),oe(!1),we(!1),pe(`Saved view "${Q}"`,"success")}catch(_e){throw pe(_e instanceof Error?_e.message:"Failed to save view","error"),_e}},[et,y,pe,e,t]),Ge=f.useCallback(async()=>{if(ue)try{const Q=Yu({name:(me==null?void 0:me.name)??"",context:{workspace:t??null,projectSlug:e??null},state:et()});await ng(ue,{config:Q.config}),pe("View updated","success")}catch(Q){pe(Q instanceof Error?Q.message:"Failed to update view","error")}},[et,me==null?void 0:me.name,ue,pe,e,t]);f.useEffect(()=>{if(!ye){Ve.current=null;return}if(Ve.current!==ye&&(ue&&ue!==ye&&fe(null),!U)){if(de){pe("Couldn't load saved view — try again","error");return}if(ne){Ve.current=ye,It(ne),y(Q=>{const _e=new URLSearchParams(Q);return _e.delete("loadView"),_e},{replace:!0});return}Ve.current=ye,pe("Saved view no longer exists","error"),y(Q=>{const _e=new URLSearchParams(Q);return _e.delete("loadView"),_e},{replace:!0})}},[ye,ne,U,de,ue,It,y,pe]);function xt(Q){_===Q?Ye(Y==="asc"?"desc":"asc"):(Oe(Q),Ye("asc"))}const Kt=f.useMemo(()=>i?Object.fromEntries(i.assignments.flatMap(Q=>{const _e=`${n}/projects/${i.slug}/assignments/${Q.slug}`;return[[Q.slug,_e],[Q.title,_e]]})):{},[i]);async function Bt(Q){await fetch(`/api/projects/${e}/status-override`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({status:Q})}),d()}async function rn(Q){await fetch(`/api/projects/${e}/move-workspace`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({workspace:Q})}),d()}if(l)return r.jsx(ct,{label:"Loading project workspace…"});if(c||!i)return r.jsx(mt,{error:c||"Project not found."});const Qn=Array.from(new Set(i.assignments.map(Q=>Q.assignee).filter(Boolean))).sort(),On=i.assignments.filter(Q=>!(P!=="all"&&Q.status!==P||R!=="all"&&Q.assignee!==R||D!=="all"&&Q.priority!==D||Z!=="all"&&(Q.type??"")!==Z)),ut=mg(On,_,Y),Ut=new Set(m.definitions.map(Q=>Q.id)),Dt=H==="type"?[...m.definitions.map(Q=>({id:Q.id,title:gl(m,Q.id),description:Q.description})),...On.some(Q=>!Q.type||!Ut.has(Q.type))?[{id:Mw,title:"Other",description:"Assignments with no recognized type."}]:[]]:a1(p.order).map(Q=>({id:Q,title:kd(p,Q),description:Nd(Q)}));function Xt({field:Q,children:_e}){const tt=_===Q;return r.jsx("th",{className:"pb-3 font-medium",children:r.jsxs("button",{type:"button",onClick:()=>xt(Q),className:"inline-flex items-center gap-1 hover:text-foreground",children:[_e,tt?Y==="asc"?r.jsx(R0,{className:"h-3 w-3"}):r.jsx(Io,{className:"h-3 w-3"}):null]})})}return r.jsxs("div",{className:"space-y-5","data-density":S.density,children:[r.jsxs("div",{className:"flex flex-wrap items-center gap-3",children:[r.jsx(kn,{status:i.status}),i.statusOverride&&r.jsx("button",{type:"button",className:"shell-action border-warning-foreground/40 text-warning-foreground",onClick:()=>Bt(null),title:"Clear manual status override and return to derived status",children:"Clear Override"}),r.jsxs("select",{className:"shell-action appearance-none bg-transparent text-sm",value:"",onChange:Q=>{Q.target.value&&Bt(Q.target.value)},title:"Override project status",children:[r.jsx("option",{value:"",children:"Set Status…"}),p.statuses.map(Q=>r.jsx("option",{value:Q.id,children:Q.label},Q.id)),r.jsx("option",{value:"active",children:"Active"})]}),h&&h.workspaces.length>0&&r.jsxs("select",{className:"shell-action appearance-none bg-transparent text-sm",value:"",onChange:Q=>{Q.target.value==="_ungrouped"?rn(null):Q.target.value&&rn(Q.target.value)},title:"Move project to a different workspace",children:[r.jsx("option",{value:"",children:"Move to Workspace…"}),h.workspaces.filter(Q=>Q!==i.workspace).map(Q=>r.jsx("option",{value:Q,children:Q},Q)),i.workspace&&r.jsx("option",{value:"_ungrouped",children:"Ungrouped"})]}),r.jsxs(Ee,{className:"shell-action",to:`${n}/projects/${i.slug}/edit`,children:[r.jsx(_v,{className:"h-4 w-4"}),r.jsx("span",{children:"Edit Project"})]}),r.jsxs(Ee,{className:"shell-action bg-foreground text-background hover:opacity-90",to:`${n}/projects/${i.slug}/create/assignment`,children:[r.jsx(Jt,{className:"h-4 w-4"}),r.jsx("span",{children:"New Assignment"})]}),r.jsx(bg,{externalIds:i.externalIds}),r.jsxs("span",{className:"text-xs text-muted-foreground",children:["Created ",pr(i.created),". Last source update ",rs(i.updated),"."]})]}),r.jsxs("div",{className:"grid gap-3 md:grid-cols-2 xl:grid-cols-5",children:[r.jsx(jn,{label:"Assignments",value:i.progress.total}),r.jsx(jn,{label:"In Progress",value:i.progress.in_progress??0,tone:"info"}),r.jsx(jn,{label:"Review",value:i.progress.review??0,tone:"info"}),r.jsx(jn,{label:"Blocked",value:i.progress.blocked??0,tone:"warn"}),r.jsx(jn,{label:"Completed",value:i.progress.completed??0,tone:"success"})]}),r.jsxs("div",{className:"grid gap-4 xl:grid-cols-[minmax(0,1fr)_280px]",children:[r.jsx("div",{className:"space-y-4",children:r.jsx(jg,{value:C,onValueChange:j,items:[{value:"overview",label:"Overview",content:r.jsx("div",{className:"space-y-5",children:r.jsx(Ue,{title:"Project Overview",children:r.jsx(en,{content:i.body,emptyState:"This project does not have overview content yet."})})})},{value:"assignments",label:"Assignments",count:i.assignments.length,content:r.jsx("div",{className:"space-y-5",children:r.jsx(Ue,{title:"Assignment Queue",description:"Board and table views over the source assignment files.",actions:r.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[r.jsxs("select",{value:P,onChange:Q=>bt(Q.target.value),className:"editor-input max-w-[170px]",children:[r.jsx("option",{value:"all",children:"All statuses"}),p.statuses.map(Q=>r.jsx("option",{value:Q.id,children:Q.label},Q.id))]}),r.jsxs("select",{value:R,onChange:Q=>gt(Q.target.value),className:"editor-input max-w-[170px]",children:[r.jsx("option",{value:"all",children:"All assignees"}),Qn.map(Q=>r.jsx("option",{value:Q??"",children:Q},Q))]}),r.jsxs("select",{value:D,onChange:Q=>ce(Q.target.value),className:"editor-input max-w-[170px]",children:[r.jsx("option",{value:"all",children:"All priorities"}),r.jsx("option",{value:"low",children:"Low"}),r.jsx("option",{value:"medium",children:"Medium"}),r.jsx("option",{value:"high",children:"High"}),r.jsx("option",{value:"critical",children:"Critical"})]}),r.jsxs("select",{value:Z,onChange:Q=>ve(Q.target.value),className:"editor-input max-w-[170px]",children:[r.jsx("option",{value:"all",children:"All types"}),m.definitions.map(Q=>r.jsx("option",{value:Q.id,children:gl(m,Q.id)},Q.id))]}),E==="kanban"&&r.jsxs("select",{value:H==="type"?"type":"status",onChange:Q=>De(Q.target.value),className:"editor-input max-w-[170px]",title:"Group kanban by",children:[r.jsx("option",{value:"status",children:"Group: Status"}),r.jsx("option",{value:"type",children:"Group: Type"})]}),r.jsx(gg,{value:E,onChange:Q=>St(Q),options:[{value:"kanban",label:"Kanban"},{value:"table",label:"Table"}]}),r.jsx(WS,{scope:te,loadedViewId:ue,onApply:ge,onOpenSaveDialog:()=>{we(!1),oe(!0)}}),r.jsx("button",{type:"button",onClick:()=>{me?Ge():(we(!1),oe(!0))},className:"inline-flex items-center gap-1.5 rounded-md border border-border/60 bg-background/60 px-2.5 py-1.5 text-xs font-medium text-foreground hover:bg-background",title:me?`Update ${me.name}`:"Save current view",children:me?`Update '${me.name}'`:"Save view"}),me?r.jsx("button",{type:"button",onClick:()=>{we(!0),oe(!0)},className:"inline-flex items-center gap-1.5 rounded-md border border-border/60 bg-background/60 px-2.5 py-1.5 text-xs font-medium text-foreground hover:bg-background",title:"Save as new view",children:"Save as new…"}):null]}),children:On.length===0?r.jsx(pt,{title:"No assignments match these filters",description:"Clear the current filters or create a new assignment for this project.",actions:r.jsx(Ee,{className:"shell-action bg-foreground text-background hover:opacity-90",to:`${n}/projects/${i.slug}/create/assignment`,children:"Create Assignment"})}):E==="kanban"?r.jsx(Sd,{columns:Dt,items:ut,getItemId:Q=>Q.slug,getColumnId:Q=>H==="type"?Q.type&&Ut.has(Q.type)?Q.type:Mw:Q.status,dragDisabled:!0,renderCard:Q=>r.jsx(uF,{projectSlug:i.slug,assignment:Q}),emptyMessage:Q=>`No ${Q.title.toLowerCase()} assignments.`,hiddenColumnIds:T.hidden,onHideColumn:Q=>M(_e=>({hidden:_e.hidden.includes(Q)?_e.hidden.filter(qt=>qt!==Q):[..._e.hidden,Q]}))}):(()=>{const Q=new Set(q.hidden),_e=tt=>tt==="title"||!Q.has(tt);return r.jsxs("div",{className:"overflow-x-auto",children:[r.jsx("div",{className:"mb-3 flex items-center justify-end",children:r.jsx(_S,{visibility:q,onChange:L})}),r.jsxs("table",{className:"w-full min-w-[720px] text-left text-sm",children:[r.jsx("thead",{children:r.jsxs("tr",{className:"border-b border-border/60 text-muted-foreground",children:[_e("title")?r.jsx(Xt,{field:"title",children:"Assignment"}):null,_e("status")?r.jsx(Xt,{field:"status",children:"Status"}):null,r.jsx("th",{className:"pb-3 font-medium",children:"Type"}),_e("priority")?r.jsx(Xt,{field:"priority",children:"Priority"}):null,_e("assignee")?r.jsx(Xt,{field:"assignee",children:"Assignee"}):null,_e("dependencies")?r.jsx(Xt,{field:"dependencies",children:"Dependencies"}):null,_e("updated")?r.jsx(Xt,{field:"updated",children:"Updated"}):null]})}),r.jsx("tbody",{children:ut.map(tt=>r.jsxs("tr",{className:"border-b border-border/50 last:border-0",children:[_e("title")?r.jsx("td",{className:"py-4",children:r.jsx(Ee,{to:`${n}/projects/${i.slug}/assignments/${tt.slug}`,className:"font-semibold text-foreground hover:text-primary",children:tt.title})}):null,_e("status")?r.jsx("td",{className:"py-4",children:r.jsx(kn,{status:tt.status})}):null,r.jsx("td",{className:"py-4",children:r.jsx(ra,{type:tt.type,compact:!0})}),_e("priority")?r.jsx("td",{className:"py-4 capitalize text-muted-foreground",children:tt.priority}):null,_e("assignee")?r.jsx("td",{className:"py-4 text-muted-foreground",children:tt.assignee??"—"}):null,_e("dependencies")?r.jsx("td",{className:"py-4 text-muted-foreground",children:tt.dependsOn.length}):null,_e("updated")?r.jsx("td",{className:"py-4 text-muted-foreground",children:pr(tt.updated)}):null]},tt.slug))})]})]})})()})})},{value:"todos",label:"Todos",content:r.jsx(Z5,{projectId:i.slug})},{value:"dependencies",label:"Dependencies",content:i.dependencyGraph?r.jsx(Ue,{title:"Dependency Graph",description:"Rendered from the derived graph when available, with a source-based fallback.",children:r.jsx(A$,{definition:i.dependencyGraph,nodeRoutes:Kt})}):r.jsx(pt,{title:"No dependency graph yet",description:"Dependencies appear here once assignments declare dependsOn relationships."})},{value:"knowledge",label:"Knowledge",content:r.jsxs("div",{className:"grid gap-3 lg:grid-cols-2",children:[r.jsx(Ue,{title:"Resources",description:"Shared project references.",actions:r.jsxs(Ee,{className:"shell-action",to:`/resources/new?project=${i.slug}`,children:[r.jsx(Jt,{className:"h-4 w-4"}),r.jsx("span",{children:"New Resource"})]}),children:i.resources.length===0?r.jsx(pt,{title:"No resources yet",description:"Resources live at the project level and stay available to every assignment."}):r.jsx("div",{className:"space-y-3",children:i.resources.map(Q=>r.jsxs(Ee,{to:`/projects/${i.slug}/resources/${Q.slug}`,className:"block rounded-md border border-border/60 bg-background/80 p-3 transition hover:border-primary/40",children:[r.jsx("h3",{className:"font-semibold text-foreground",children:Q.name}),r.jsxs("p",{className:"mt-2 text-sm text-muted-foreground",children:[Q.category," · ",Q.source]})]},Q.slug))})}),r.jsx(Ue,{title:"Memories",description:"Learnings and patterns captured during the project.",actions:r.jsxs(Ee,{className:"shell-action",to:`/memories/new?project=${i.slug}`,children:[r.jsx(Jt,{className:"h-4 w-4"}),r.jsx("span",{children:"New Memory"})]}),children:i.memories.length===0?r.jsx(pt,{title:"No memories yet",description:"Memories capture patterns discovered during execution so later assignments can reuse them."}):r.jsx("div",{className:"space-y-3",children:i.memories.map(Q=>r.jsxs(Ee,{to:`/projects/${i.slug}/memories/${Q.slug}`,className:"block rounded-md border border-border/60 bg-background/80 p-3 transition hover:border-primary/40",children:[r.jsx("h3",{className:"font-semibold text-foreground",children:Q.name}),r.jsxs("p",{className:"mt-2 text-sm text-muted-foreground",children:[Q.scope," · ",Q.source]})]},Q.slug))})})]})}]})}),r.jsxs("div",{className:"space-y-5",children:[r.jsx(Ue,{title:"Progress Summary",children:r.jsx(Uu,{progress:i.progress,showLegend:!0})}),r.jsx(Ue,{title:"Attention",children:r.jsxs("dl",{className:"space-y-3 text-sm",children:[r.jsxs("div",{className:"flex items-center justify-between",children:[r.jsx("dt",{className:"text-muted-foreground",children:"Blocked"}),r.jsx("dd",{className:"font-semibold text-foreground",children:i.needsAttention.blockedCount})]}),r.jsxs("div",{className:"flex items-center justify-between",children:[r.jsx("dt",{className:"text-muted-foreground",children:"Failed"}),r.jsx("dd",{className:"font-semibold text-foreground",children:i.needsAttention.failedCount})]}),r.jsxs("div",{className:"flex items-center justify-between",children:[r.jsx("dt",{className:"text-muted-foreground",children:"Unanswered questions"}),r.jsx("dd",{className:"font-semibold text-foreground",children:i.needsAttention.openQuestions})]})]})}),r.jsx(Ue,{title:"Quick Links",children:r.jsxs("div",{className:"space-y-2 text-sm",children:[r.jsxs(Ee,{className:"flex items-center gap-2 text-primary hover:underline",to:`${n}/projects/${i.slug}/edit`,children:[r.jsx(_v,{className:"h-4 w-4"}),"Edit project source"]}),r.jsxs(Ee,{className:"flex items-center gap-2 text-primary hover:underline",to:`${n}/projects/${i.slug}/create/assignment`,children:[r.jsx(Jt,{className:"h-4 w-4"}),"Create assignment"]}),r.jsxs(Ee,{className:"flex items-center gap-2 text-primary hover:underline",to:"/help",children:[r.jsx(V2,{className:"h-4 w-4"}),"Review project rules"]}),r.jsxs("button",{type:"button",onClick:()=>j("dependencies"),className:"flex items-center gap-2 text-primary hover:underline",children:[r.jsx(kh,{className:"h-4 w-4"}),"Jump to dependencies"]})]})}),i.archived?r.jsxs(Ue,{title:"Archive Metadata",children:[r.jsxs("p",{className:"text-sm leading-6 text-muted-foreground",children:["Archived ",i.archivedAt?rs(i.archivedAt):"with no timestamp recorded","."]}),i.archivedReason?r.jsx("p",{className:"mt-2 text-sm leading-6 text-muted-foreground",children:i.archivedReason}):null]}):null]})]}),r.jsx(Xg,{toast:Se,onDismiss:He}),r.jsx(VS,{open:B,onOpenChange:Q=>{oe(Q),Q||we(!1)},initialName:he&&me?`${me.name} (copy)`:"",title:he?"Save as new view":"Save view",onSubmit:Qe})]})}function uF({projectSlug:e,assignment:t}){const n=Wt();return r.jsxs(Ee,{to:`${n}/projects/${e}/assignments/${t.slug}`,className:"vp-card block rounded-lg border border-border/60 bg-background/80 p-3 transition hover:border-primary/40",children:[r.jsxs("div",{className:"flex items-start justify-between gap-3",children:[r.jsxs("div",{className:"space-y-1",children:[r.jsx("h3",{className:"font-semibold text-foreground",children:t.title}),r.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),r.jsx("span",{onClick:s=>{s.preventDefault(),s.stopPropagation()},children:r.jsx(Tr,{value:t.id})})]}),r.jsxs("p",{className:"text-sm text-muted-foreground",children:["Updated ",pr(t.updated)]})]}),r.jsx(kn,{status:t.status})]}),r.jsxs("div",{className:"mt-4 flex flex-wrap gap-2",children:[r.jsx(ra,{type:t.type}),r.jsx("span",{className:"rounded-full border border-border/60 px-2.5 py-1 text-xs capitalize text-muted-foreground",children:t.priority}),r.jsx("span",{className:"rounded-full border border-border/60 px-2.5 py-1 text-xs text-muted-foreground",children:t.assignee??"Unassigned"}),r.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 qS({session:e,onMarkStopped:t}){const n=`syntaur://open?session=${encodeURIComponent(e.sessionId)}&mode=resume`,s=`syntaur://open?session=${encodeURIComponent(e.sessionId)}&mode=fork`,i="size-3.5",l=Te("shell-action","inline-flex items-center justify-center px-2 py-1 text-xs","disabled:cursor-not-allowed disabled:opacity-50"),c="inline-flex outline-none focus-visible:ring-1 focus-visible:ring-ring rounded-sm",d=!e.resumeSupported&&!e.forkSupported;return r.jsx(Lo,{delayDuration:200,children:r.jsxs("div",{className:"inline-flex items-center gap-1",children:[d&&r.jsxs(Nr,{children:[r.jsx(Cr,{asChild:!0,children:r.jsx("span",{tabIndex:0,className:c,children:r.jsxs("button",{type:"button",disabled:!0,"aria-disabled":!0,className:l,children:[r.jsx($i,{className:i}),r.jsx("span",{children:"Reopen"})]})})}),r.jsx(ur,{side:"top",children:"Reopen unavailable — this agent has no resume/fork command configured"})]}),e.resumeSupported&&(e.isLive?r.jsxs(Nr,{children:[r.jsx(Cr,{asChild:!0,children:r.jsx("span",{tabIndex:0,className:c,children:r.jsxs("button",{type:"button",disabled:!0,"aria-disabled":!0,className:l,children:[r.jsx($i,{className:i}),r.jsx("span",{children:"Resume"})]})})}),r.jsx(ur,{side:"top",children:"Session appears active — fork instead to avoid transcript corruption"})]}):r.jsxs(Nr,{children:[r.jsx(Cr,{asChild:!0,children:r.jsxs("a",{href:n,className:l,children:[r.jsx($i,{className:i}),r.jsx("span",{children:"Resume"})]})}),r.jsx(ur,{side:"top",children:"Continue this session in its agent (same session id, same transcript)"})]})),e.forkSupported&&r.jsxs(Nr,{children:[r.jsx(Cr,{asChild:!0,children:r.jsxs("a",{href:s,className:l,children:[r.jsx(sT,{className:i}),r.jsx("span",{children:"Fork"})]})}),r.jsx(ur,{side:"top",children:"Branch a new session from this point — safe even when the original is still running"})]}),e.status==="active"&&r.jsxs(Nr,{children:[r.jsx(Cr,{asChild:!0,children:r.jsxs("button",{type:"button",className:l,onClick:()=>t(e.sessionId),children:[r.jsx(Eh,{className:i}),r.jsx("span",{children:"Mark stopped"})]})}),r.jsx(ur,{side:"top",children:e.resumeSupported?"Tell the dashboard this session has ended so Resume re-enables":"Tell the dashboard this session has ended"})]})]})})}async function dF(e){await fetch(`/api/agent-sessions/${encodeURIComponent(e)}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({status:"stopped"})})}function GS({sessions:e,loading:t,error:n}){return t&&!e?null:n&&!e?r.jsx(Ue,{title:"Agent Sessions",children:r.jsx(pt,{title:"Couldn't load sessions",description:n})}):!e||e.length===0?r.jsx(Ue,{title:"Agent Sessions",children:r.jsx(pt,{title:"No agent sessions yet",description:"Sessions appear here when an agent registers one via /grab-assignment or syntaur track-session."})}):r.jsx(Ue,{title:"Agent Sessions",children:r.jsx("div",{className:"space-y-2",children:e.map(s=>r.jsxs("div",{className:"flex flex-wrap items-center gap-x-2 gap-y-1 text-sm",children:[r.jsxs("span",{className:"flex items-center gap-1.5",children:[r.jsx(nd,{className:"h-3 w-3 shrink-0 text-muted-foreground"}),r.jsx("span",{className:"font-medium text-foreground",children:s.agent}),r.jsxs("span",{className:"inline-flex items-center gap-1.5 font-mono text-xs text-muted-foreground",title:s.sessionId,children:[s.sessionId.slice(0,8),r.jsx(Tr,{value:s.sessionId})]})]}),r.jsxs("span",{className:"flex items-center gap-2",children:[r.jsx(kn,{status:s.status}),r.jsx("span",{className:"text-xs text-muted-foreground",children:rs(s.started)})]}),r.jsx(qS,{session:s,onMarkStopped:dF})]},s.sessionId))})})}function YS({open:e,action:t,assignmentTitle:n,loading:s=!1,onConfirm:i,onOpenChange:l}){const[c,d]=f.useState("");f.useEffect(()=>{e||d("")},[e,t==null?void 0:t.command]);const p=f.useMemo(()=>t&&t.command==="block"?"Blocked Reason":"Reason",[t]);if(!t)return null;const m=`${t.label} "${n}"`,h=s?"Applying...":t.label,x=c.trim()||void 0;return r.jsx(mr,{open:e,onOpenChange:y=>s?void 0:l(y),children:r.jsx(Gn,{className:"max-w-xl",children:r.jsxs("form",{className:"space-y-5",onSubmit:y=>{y.preventDefault(),i(x)},children:[r.jsxs(as,{children:[r.jsx(Yn,{children:m}),r.jsx(ls,{children:t.description})]}),t.warning?r.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,r.jsxs("div",{className:"space-y-2",children:[r.jsx("label",{className:"block text-xs font-medium uppercase tracking-[0.08em] text-muted-foreground",children:p}),r.jsx("textarea",{value:c,onChange:y=>d(y.target.value),autoFocus:!0,rows:4,disabled:s,placeholder:"Optional context for why this assignment is blocked.",className:"editor-textarea min-h-[120px] bg-background/95 font-sans"}),r.jsx("p",{className:"text-xs text-muted-foreground",children:"Leave this blank to continue without a written reason."})]}),r.jsxs(oo,{children:[r.jsx("button",{type:"button",onClick:()=>l(!1),disabled:s,className:"shell-action disabled:cursor-not-allowed disabled:opacity-50",children:"Cancel"}),r.jsx("button",{type:"submit",disabled:s,className:"shell-action bg-foreground text-background hover:opacity-90 disabled:cursor-not-allowed disabled:opacity-50",children:h})]})]})})})}function fa({open:e,title:t,description:n,confirmLabel:s,cancelLabel:i="Cancel",loading:l=!1,destructive:c=!1,onConfirm:d,onOpenChange:p}){return r.jsx(Jh,{open:e,onOpenChange:m=>l?void 0:p(m),children:r.jsxs(fd,{children:[r.jsxs(Xh,{children:[r.jsx(pd,{children:t}),r.jsx(md,{children:n})]}),r.jsxs(Qh,{children:[r.jsx(hd,{disabled:l,className:"shell-action mt-0 disabled:cursor-not-allowed disabled:opacity-50",children:i}),r.jsx(Tl,{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...":s})]})]})})}function hu(e,t){const n=`syntaur://open?${e.kind}=${encodeURIComponent(e.id)}`;return t?`${n}&terminal=${encodeURIComponent(t)}`:n}function JS({target:e,worktreePath:t=null,size:n="default",title:s}){const i=e.kind==="assignment"&&(t==null||t===""),[l,c]=f.useState(null),[d,p]=f.useState(!1),m=e.kind==="assignment"?"Open this assignment in your configured terminal + agent":"Resume this session in its agent",h="Set a worktree first — see the Workspace Before Code playbook",x=Te("shell-action",n==="compact"&&"inline-flex items-center justify-center px-2 py-1 text-xs","disabled:cursor-not-allowed disabled:opacity-50");if(i)return r.jsxs("button",{type:"button",disabled:!0,title:h,className:x,"aria-disabled":!0,children:[r.jsx($i,{className:"size-3.5"}),r.jsx("span",{children:"Open in agent"})]});async function y(){if(!d){p(!0);try{const C=await fetch("/api/launch/preflight",{method:"POST",headers:{"Content-Type":"application/json"},body:"{}"});if(!C.ok){window.location.href=hu(e);return}const j=await C.json();if(j.ok){window.location.href=hu(e);return}c(j)}catch(C){console.warn("preflight failed, firing without override:",C),window.location.href=hu(e)}finally{p(!1)}}}function v(){l&&(window.location.href=hu(e,l.suggestedFallback),c(null))}return r.jsxs(r.Fragment,{children:[r.jsxs("button",{type:"button",onClick:y,disabled:d,title:s??m,className:x,children:[r.jsx($i,{className:"size-3.5"}),r.jsx("span",{children:e.kind==="session"?"Open":"Open in agent"})]}),r.jsx(Jh,{open:l!==null,onOpenChange:C=>!C&&c(null),children:r.jsxs(fd,{children:[r.jsxs(Xh,{children:[r.jsxs(pd,{children:[l==null?void 0:l.terminal," is not installed"]}),r.jsxs(md,{children:["Open in ",r.jsx("strong",{children:l==null?void 0:l.suggestedFallback})," instead? You can change the default in"," ",r.jsx(Ee,{to:"/settings",className:"underline hover:text-foreground",onClick:()=>c(null),children:"Settings"}),"."]})]}),r.jsxs(Qh,{children:[r.jsx(hd,{className:"shell-action mt-0",children:"Cancel"}),r.jsxs(Tl,{className:"shell-action mt-0 bg-foreground text-background hover:opacity-90",onClick:C=>{C.preventDefault(),v()},children:["Open in ",l==null?void 0:l.suggestedFallback]})]})]})})]})}async function XS(e,t,n,s){const i=await fetch(`/api/projects/${e}/assignments/${t}/transitions/${n.command}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(s?{reason:s}:{})}),l=await i.json().catch(()=>null);if(!i.ok)throw new Error((l==null?void 0:l.error)||`HTTP ${i.status}`);return l.assignment}async function QS(e,t,n){const s=await fetch(`/api/projects/${e}/assignments/${t}/status-override`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({status:n})}),i=await s.json().catch(()=>null);if(!s.ok)throw new Error((i==null?void 0:i.error)||`HTTP ${s.status}`);return i.assignment}async function fF(e,t){const n=await fetch(`/api/projects/${e}/assignments/${t}`,{method:"DELETE"}),s=await n.json().catch(()=>null);if(!n.ok)throw new Error((s==null?void 0:s.error)||`HTTP ${n.status}`)}function ZS(e){return e.requiresReason||e.command==="block"}async function pF(e){const t=await fetch(`/api/projects/${e.projectSlug}/assignments/${e.assignmentSlug}/title`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({title:e.title})}),n=await t.json().catch(()=>null);if(!t.ok)throw new Error((n==null?void 0:n.error)||`HTTP ${t.status}`);return n.assignment}async function mF(e){const t=await fetch(`/api/assignments/${e.id}/title`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({title:e.title})}),n=await t.json().catch(()=>null);if(!t.ok)throw new Error((n==null?void 0:n.error)||`HTTP ${t.status}`);return n.assignment}class eN extends Error{constructor(t,n){super(t),this.stderr=n,this.name="CreateWorktreeError"}}async function tN(e){const t=await e.json().catch(()=>null);return new eN((t==null?void 0:t.error)||`HTTP ${e.status}`,t==null?void 0:t.stderr)}async function hF(e){const t=await fetch(`/api/projects/${e}/repository-candidates`),n=await t.json().catch(()=>null);if(!t.ok)throw new Error((n==null?void 0:n.error)||`HTTP ${t.status}`);return n.candidates}async function gF(e){const t=await fetch(`/api/assignments/${e}/repository-candidates`),n=await t.json().catch(()=>null);if(!t.ok)throw new Error((n==null?void 0:n.error)||`HTTP ${t.status}`);return n.candidates}async function xF(e,t,n){const s=await fetch(`/api/projects/${e}/assignments/${t}/worktree`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(n)});if(!s.ok)throw await tN(s);return(await s.json()).assignment}async function yF(e,t){const n=await fetch(`/api/assignments/${e}/worktree`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)});if(!n.ok)throw await tN(n);return(await n.json()).assignment}const ll="__other__";function nN({projectSlug:e,assignmentSlug:t,assignmentId:n,defaultBranch:s,defaultParentBranch:i="main",onCreated:l}){const c=e&&t?{kind:"project-nested",projectSlug:e,assignmentSlug:t}:{kind:"standalone",assignmentId:n},[d,p]=f.useState(!1),[m,h]=f.useState(null),[x,y]=f.useState(null),[v,C]=f.useState(""),[j,w]=f.useState(""),[S,E]=f.useState(s),[N,P]=f.useState(i),[I,R]=f.useState(!1),[$,D]=f.useState(null);f.useEffect(()=>{if(!d)return;let _=!1;return h(null),y(null),D(null),C(""),w(""),E(s),P(i),(c.kind==="project-nested"?hF(c.projectSlug):gF(c.assignmentId)).then(Y=>{if(_)return;h(Y);const ie=Y.find(ae=>ae.source==="project"),K=Y.find(ae=>ae.source==="sibling");C((ie==null?void 0:ie.path)??(K==null?void 0:K.path)??ll)}).catch(Y=>{_||(y(Y.message),h([]),C(ll))}),()=>{_=!0}},[d,s,i,e,t,n]);const X=v===ll?j.trim():v,Z=f.useMemo(()=>!X||!S?"":`${X.replace(/\/+$/,"")}/.worktrees/${S}`,[X,S]),F=m!==null&&m.length===0,H=I||m===null||!X||!S.trim()||!N.trim(),J=async()=>{R(!0),D(null);try{const _={repository:X,branch:S.trim(),parentBranch:N.trim()};c.kind==="project-nested"?await xF(c.projectSlug,c.assignmentSlug,_):await yF(c.assignmentId,_),p(!1),l()}catch(_){_ instanceof eN?D({message:_.message,stderr:_.stderr}):_ instanceof Error?D({message:_.message}):D({message:String(_)})}finally{R(!1)}};return r.jsxs(mr,{open:d,onOpenChange:_=>I?void 0:p(_),children:[r.jsxs("button",{type:"button",className:"shell-action inline-flex items-center gap-1.5",onClick:()=>p(!0),children:[r.jsx(rT,{className:"h-3.5 w-3.5","aria-hidden":"true"}),r.jsx("span",{children:"Create worktree"})]}),r.jsxs(Gn,{children:[r.jsxs(as,{children:[r.jsx(Yn,{children:"Create worktree"}),r.jsxs(ls,{children:["Creates a git worktree at ",r.jsx("code",{children:"<repo>/.worktrees/<branch>"})," and records the workspace fields on this assignment's frontmatter."]})]}),r.jsxs("div",{className:"grid gap-4 text-sm",children:[F?r.jsxs("div",{className:"rounded-md border border-warning-foreground/30 bg-warning px-3 py-2 text-xs text-warning-foreground",children:["No repositories configured for this project. Enter a repo path below, or add a"," ",r.jsx("code",{children:"repositories:"})," list to ",r.jsx("code",{children:"project.md"}),"."]}):null,x?r.jsxs("div",{className:"rounded-md border border-error-foreground/30 bg-error px-3 py-2 text-xs text-error-foreground",children:["Could not load repository candidates: ",x]}):null,r.jsxs("label",{className:"grid gap-1",children:[r.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"Repository"}),r.jsxs("select",{className:"w-full rounded-md border border-border/70 bg-background px-3 py-2 text-sm focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",value:v,onChange:_=>C(_.target.value),disabled:I||m===null,children:[(m??[]).map(_=>r.jsxs("option",{value:_.path,children:[_.path,_.source==="project"?" (project)":_.sourceAssignmentSlug?` (sibling — ${_.sourceAssignmentSlug})`:" (sibling)"]},`${_.source}:${_.path}`)),r.jsx("option",{value:ll,children:"Other…"})]}),v===ll?r.jsx("input",{className:"mt-1 w-full rounded-md border border-border/70 bg-background px-3 py-2 text-sm focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",type:"text",placeholder:"/absolute/path/to/repo",value:j,onChange:_=>w(_.target.value),disabled:I}):null]}),r.jsxs("label",{className:"grid gap-1",children:[r.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"Branch"}),r.jsx("input",{className:"w-full rounded-md border border-border/70 bg-background px-3 py-2 text-sm focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",type:"text",value:S,onChange:_=>E(_.target.value),disabled:I})]}),r.jsxs("label",{className:"grid gap-1",children:[r.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"Parent branch"}),r.jsx("input",{className:"w-full rounded-md border border-border/70 bg-background px-3 py-2 text-sm focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",type:"text",value:N,onChange:_=>P(_.target.value),disabled:I})]}),r.jsxs("div",{className:"grid gap-1",children:[r.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"Worktree path"}),r.jsx("code",{className:"rounded-md border border-border bg-muted px-2 py-1 text-xs",children:Z||r.jsx("span",{className:"opacity-60",children:"— pick a repo & branch —"})})]}),$?r.jsxs("div",{className:"rounded-md border border-error-foreground/30 bg-error px-3 py-2 text-xs text-error-foreground",children:[r.jsx("div",{className:"font-medium",children:$.message}),$.stderr?r.jsx("pre",{className:"mt-2 whitespace-pre-wrap text-[11px] opacity-90",children:$.stderr}):null]}):null]}),r.jsxs(oo,{children:[r.jsx(k3,{disabled:I,className:"shell-action mt-0 disabled:cursor-not-allowed disabled:opacity-50",children:"Cancel"}),r.jsx("button",{type:"button",disabled:H,onClick:()=>void J(),className:"shell-action mt-0 bg-foreground text-background hover:opacity-90 disabled:cursor-not-allowed disabled:opacity-50",children:I?"Working…":"Create worktree"})]})]})]})}function vF(e){const t=e.split(`
|
|
518
|
+
`),n=t.findIndex(c=>/^##\s+Acceptance Criteria\s*$/i.test(c.trim()));if(n===-1)return{acceptanceCriteria:[],summaryBody:e};let s=t.length;for(let c=n+1;c<t.length;c+=1)if(/^#{1,2}\s+\S/.test(t[c].trim())){s=c;break}const i=t.slice(n+1,s).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(s)].join(`
|
|
519
|
+
`).replace(/\n{3,}/g,`
|
|
520
|
+
|
|
521
|
+
`).trim();return{acceptanceCriteria:i,summaryBody:l}}function bF(e){const t=e.split(`
|
|
522
|
+
`),n=t.findIndex(c=>/^##\s+Todos\s*$/i.test(c.trim()));if(n===-1)return{hasSection:!1,todosMarkdown:"",remaining:e};let s=t.length;for(let c=n+1;c<t.length;c+=1)if(/^#{1,2}\s+\S/.test(t[c].trim())){s=c;break}const i=t.slice(n+1,s).join(`
|
|
523
|
+
`).replace(/<!--[\s\S]*?-->/g,"").replace(/\n{3,}/g,`
|
|
524
|
+
|
|
525
|
+
`).trim(),l=[...t.slice(0,n),...t.slice(s)].join(`
|
|
526
|
+
`).replace(/\n{3,}/g,`
|
|
527
|
+
|
|
528
|
+
`).trim();return{hasSection:!0,todosMarkdown:i,remaining:l}}function wF({projectSlug:e,dependencies:t,blockedReason:n}){const[s,i]=f.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&&!s?r.jsxs("button",{type:"button",onClick:()=>i(!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:[r.jsx(wh,{className:"h-4 w-4 shrink-0 text-success-foreground"}),r.jsxs("span",{className:"text-sm font-medium text-success-foreground",children:["All ",t.length," ",t.length===1?"dependency":"dependencies"," resolved"]}),r.jsx(Io,{className:"ml-auto h-4 w-4 text-success-foreground"})]}):r.jsxs("div",{className:"space-y-3",children:[l.length>0&&r.jsxs("div",{className:"flex items-start gap-3 rounded-lg border border-warning-foreground/30 bg-warning px-4 py-3",children:[r.jsx(Am,{className:"mt-0.5 h-4 w-4 shrink-0 text-warning-foreground"}),r.jsxs("div",{className:"text-sm text-warning-foreground",children:[r.jsxs("strong",{children:[l.length," ",l.length===1?"dependency is":"dependencies are"," not yet completed."]}),n&&r.jsxs("p",{className:"mt-1 text-warning-foreground/80",children:["Blocked reason: ",n]})]})]}),r.jsx(Ue,{title:"Dependencies",description:`${t.length-l.length} of ${t.length} resolved`,actions:c?r.jsx("button",{type:"button",onClick:()=>i(!1),className:"text-xs text-muted-foreground hover:text-foreground",children:"Collapse"}):void 0,children:r.jsx("div",{className:"divide-y divide-border/40",children:t.map(d=>r.jsxs(Ee,{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:[r.jsx(kn,{status:d.status}),r.jsxs("div",{className:"min-w-0 flex-1",children:[r.jsx("p",{className:"truncate text-sm font-medium text-foreground",children:d.title}),r.jsx("p",{className:"truncate text-xs text-muted-foreground",children:d.slug})]}),d.assignee&&r.jsx("span",{className:"hidden text-xs text-muted-foreground sm:inline",children:d.assignee}),r.jsx(Du,{className:"h-4 w-4 shrink-0 text-muted-foreground"})]},d.slug))})})]})}function jF({links:e}){const t=Wt();if(e.length===0)return null;const n=e.filter(i=>!i.isReverse),s=e.filter(i=>i.isReverse);return r.jsx(Ue,{title:"Linked Assignments",description:`${e.length} ${e.length===1?"link":"links"}`,children:r.jsxs("div",{className:"divide-y divide-border/40",children:[n.map(i=>r.jsxs(Ee,{to:`${t}/projects/${i.projectSlug}/assignments/${i.assignmentSlug}`,className:"flex items-center gap-3 px-1 py-2.5 transition hover:bg-muted/40 first:pt-0 last:pb-0",children:[r.jsx(T0,{className:"h-3.5 w-3.5 shrink-0 text-muted-foreground"}),r.jsx(kn,{status:i.status}),r.jsxs("div",{className:"min-w-0 flex-1",children:[r.jsx("p",{className:"truncate text-sm font-medium text-foreground",children:i.title}),r.jsx("p",{className:"truncate text-xs text-muted-foreground",children:i.slug})]}),r.jsx(Du,{className:"h-4 w-4 shrink-0 text-muted-foreground"})]},`fwd-${i.slug}`)),s.map(i=>r.jsxs(Ee,{to:`${t}/projects/${i.projectSlug}/assignments/${i.assignmentSlug}`,className:"flex items-center gap-3 px-1 py-2.5 transition hover:bg-muted/40 first:pt-0 last:pb-0",children:[r.jsx(E0,{className:"h-3.5 w-3.5 shrink-0 text-muted-foreground"}),r.jsx(kn,{status:i.status}),r.jsxs("div",{className:"min-w-0 flex-1",children:[r.jsx("p",{className:"truncate text-sm font-medium text-foreground",children:i.title}),r.jsx("p",{className:"truncate text-xs text-muted-foreground",children:i.slug})]}),r.jsx(Du,{className:"h-4 w-4 shrink-0 text-muted-foreground"})]},`rev-${i.slug}`))]})})}function kF(e){const t=new Map;for(const s of e)t.set(s.id,{entry:s,replies:[]});const n=[];for(const s of e){const i=t.get(s.id);s.replyTo&&t.has(s.replyTo)?t.get(s.replyTo).replies.push(i):n.push(i)}return n}function SF(e,t){return e===null?`/api/assignments/${encodeURIComponent(t)}/comments`:`/api/projects/${encodeURIComponent(e)}/assignments/${encodeURIComponent(t)}/comments`}function rN({projectSlug:e,assignmentSlug:t,entries:n}){const[s,i]=f.useState(n);f.useEffect(()=>{i(n)},[n]);const l=f.useMemo(()=>kF(s),[s]),[c,d]=f.useState(""),[p,m]=f.useState("note"),[h,x]=f.useState(!1),[y,v]=f.useState(null);async function C(w){var N;if(w.preventDefault(),!c.trim())return;x(!0),v(null);const S=`tmp-${Date.now()}`,E={id:S,timestamp:new Date().toISOString(),author:"human",type:p,body:c,resolved:p==="question"?!1:void 0};i(P=>[...P,E]);try{const P=await fetch(SF(e,t),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({body:c,type:p})});if(!P.ok){const $=await P.text();throw new Error($||`HTTP ${P.status}`)}const I=await P.json().catch(()=>null),R=(N=I==null?void 0:I.comment)==null?void 0:N.id;i($=>$.map(D=>D.id===S?{...D,id:R??D.id}:D)),d(""),window.dispatchEvent(new CustomEvent("syntaur-refresh"))}catch(P){v(P instanceof Error?P.message:String(P)),i(I=>I.filter(R=>R.id!==S))}finally{x(!1)}}async function j(w,S){i(E=>E.map(N=>N.id===w?{...N,resolved:S}:N));try{const E=e===null?`/api/assignments/${encodeURIComponent(t)}/comments/${encodeURIComponent(w)}/resolved`:`/api/projects/${encodeURIComponent(e)}/assignments/${encodeURIComponent(t)}/comments/${encodeURIComponent(w)}/resolved`,N=await fetch(E,{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(E){v(E instanceof Error?E.message:String(E)),i(N=>N.map(P=>P.id===w?{...P,resolved:!S}:P))}}return r.jsx(Ue,{title:"Comments",description:"Threaded questions, notes, and feedback. Questions can be resolved once answered.",children:r.jsxs("div",{className:"space-y-4",children:[l.map(w=>r.jsx(sN,{node:w,onToggleResolved:j,depth:0},w.entry.id)),r.jsxs("form",{onSubmit:C,className:"mt-6 space-y-2 border-t border-border pt-4",children:[r.jsx("label",{className:"block text-xs font-medium uppercase tracking-wide text-muted-foreground",children:"Add comment"}),r.jsx("textarea",{value:c,onChange:w=>d(w.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…"}),r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsxs("select",{value:p,onChange:w=>m(w.target.value),className:"rounded border border-border bg-background px-2 py-1 text-xs",children:[r.jsx("option",{value:"note",children:"note"}),r.jsx("option",{value:"question",children:"question"}),r.jsx("option",{value:"feedback",children:"feedback"})]}),r.jsx("button",{type:"submit",disabled:h||!c.trim(),className:"shell-action",children:h?"Posting…":"Post comment"}),y?r.jsx("span",{className:"text-xs text-error-foreground",children:y}):null]})]})]})})}function sN({node:e,depth:t,onToggleResolved:n}){const{entry:s,replies:i}=e,l=s.type==="question";return r.jsxs("div",{className:Te("space-y-2",t>0&&"ml-4 border-l border-border pl-4"),children:[r.jsxs("div",{className:"flex flex-wrap items-center gap-2 text-xs text-muted-foreground",children:[r.jsx("span",{className:"font-mono",children:s.id}),r.jsx("span",{children:"·"}),r.jsx("span",{children:s.timestamp}),r.jsx("span",{children:"·"}),r.jsx("span",{className:"font-medium text-foreground",children:s.author}),r.jsx("span",{children:"·"}),r.jsx("span",{className:Te("rounded px-1.5 py-0.5 font-mono text-[10px] uppercase",l&&"bg-warning text-warning-foreground",s.type==="feedback"&&"bg-info text-info-foreground",s.type==="note"&&"bg-muted text-muted-foreground"),children:s.type}),l?r.jsxs("button",{type:"button",onClick:()=>n(s.id,!s.resolved),className:Te("inline-flex items-center gap-1 rounded px-1.5 py-0.5 text-[10px] font-medium",s.resolved?"bg-success text-success-foreground hover:bg-success/80":"bg-muted text-muted-foreground hover:bg-muted/80"),title:s.resolved?"Mark unresolved":"Mark resolved",children:[s.resolved?r.jsx(wh,{className:"h-3 w-3"}):r.jsx(G2,{className:"h-3 w-3"}),s.resolved?"resolved":"open"]}):null,s.replyTo?r.jsxs("span",{className:"inline-flex items-center gap-1 text-muted-foreground",children:[r.jsx(mT,{className:"h-3 w-3"}),s.replyTo]}):null]}),r.jsx(en,{content:s.body}),i.length>0?r.jsx("div",{className:"space-y-2",children:i.map(c=>r.jsx(sN,{node:c,depth:t+1,onToggleResolved:n},c.entry.id))}):null]})}const NF=["review","complete","shape","plan-ready","implement","unblock","start","block","fail","reopen"];function zw(){var gt,ce,ve,De,Oe,Ye,et,It;const{slug:e,aslug:t}=At(),n=Rt(),s=Wt(),[i,l]=is(),[c,d]=f.useState(null),[p,m]=f.useState(null),[h,x]=f.useState(null),[y,v]=f.useState(null),[C,j]=f.useState(null),[w,S]=f.useState(!1),[E,N]=f.useState(!1),[P,I]=f.useState(0),R=i.get("tab")??"summary",$=na(),{data:D,loading:X,error:Z,refetch:F}=dP(e,t),{data:H}=oj(e),{data:J}=Lh(),{data:_,loading:W,error:Y}=pP(e,t),ie=f.useMemo(()=>{if(!D||!H)return[];const ge=new Map(H.assignments.map(Qe=>[Qe.slug,Qe]));return D.dependsOn.map(Qe=>{const Ge=ge.get(Qe);return{slug:Qe,title:(Ge==null?void 0:Ge.title)??Qe,status:(Ge==null?void 0:Ge.status)??"pending",priority:(Ge==null?void 0:Ge.priority)??"medium",assignee:(Ge==null?void 0:Ge.assignee)??null}})},[D,H]),K=ie.filter(ge=>ge.status!=="completed"&&ge.status!=="review");ao("assignment");const ae=f.useMemo(()=>((H==null?void 0:H.assignments)??[]).map(ge=>ge.slug),[H]),T=t?ae.indexOf(t):-1,M=T>0?ae[T-1]:null,q=T>=0&&T<ae.length-1?ae[T+1]:null,L=`${s}/projects/${e}/assignments/${t}`;Pt({keys:"e",scope:"assignment",description:"Edit assignment",handler:()=>n(`${L}/edit`)}),Pt({keys:"p",scope:"assignment",description:"Edit plan",handler:()=>n(`${L}/plan/edit`)}),Pt({keys:"h",scope:"assignment",description:"Append handoff",handler:()=>n(`${L}/handoff/edit`)}),Pt({keys:"d",scope:"assignment",description:"Append decision record",handler:()=>n(`${L}/decision-record/edit`)}),Pt({keys:"s",scope:"assignment",description:"Edit scratchpad",handler:()=>n(`${L}/scratchpad/edit`)}),Pt({keys:"[",scope:"assignment",description:"Previous assignment in project",enabled:!!M,handler:()=>M&&n(`${s}/projects/${e}/assignments/${M}`)}),Pt({keys:"]",scope:"assignment",description:"Next assignment in project",enabled:!!q,handler:()=>q&&n(`${s}/projects/${e}/assignments/${q}`)});const ue=f.useMemo(()=>D?vF(D.body):{acceptanceCriteria:[],summaryBody:""},[D]),fe=f.useMemo(()=>bF(ue.summaryBody),[ue.summaryBody]),B=ue.acceptanceCriteria,oe=B.filter(ge=>ge.checked).length,he=B.length>0&&oe===B.length,we=f.useRef(he),Se=f.useRef(!1);if(f.useEffect(()=>{if(D){if(!Se.current){we.current=he,Se.current=!0;return}he&&!we.current&&I(ge=>ge+1),we.current=he}},[he,D]),X)return r.jsx(ct,{label:"Loading assignment workspace…"});if(Z||!D||!e||!t)return r.jsx(mt,{error:Z||"Assignment not found."});const pe=e,He=t,te=B.length>0?{checked:oe,total:B.length}:void 0,ye=D.availableTransitions??[],ne=ye.filter(ge=>!ge.disabled&&ge.targetStatus!==D.status),U=NF.map(ge=>ne.find(Qe=>Qe.command===ge)).find(Boolean)??ne[0]??null,de=[];if(J!=null&&J.sessions)for(const ge of J.sessions)for(const Qe of ge.windows)for(const Ge of Qe.panes)((gt=Ge.assignment)==null?void 0:gt.project)===e&&((ce=Ge.assignment)==null?void 0:ce.slug)===t&&de.push({sessionName:ge.name,command:Ge.command,urls:Ge.urls});async function me(ge){d(null);try{await QS(pe,He,ge),F()}catch(Qe){d(Qe.message)}}async function Fe(){N(!0);try{await fF(pe,He),n(`${s}/projects/${pe}`)}catch(ge){d(ge.message),N(!1),S(!1)}}async function qe(ge,Qe){d(null),m(ge.command);try{return await XS(pe,He,ge,Qe),F(),!0}catch(Ge){return d(Ge.message),!1}finally{m(null)}}function Ve(ge){if(ZS(ge)){x(ge);return}qe(ge)}async function Ze(ge,Qe){v(null),j(ge);try{const Ge=await fetch(`/api/projects/${pe}/assignments/${He}/acceptance-criteria/${ge}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({checked:Qe})}),xt=await Ge.json();if(!Ge.ok)throw new Error(xt.error||`HTTP ${Ge.status}`);F()}catch(Ge){v(Ge.message)}finally{j(null)}}const St=[...ne.filter(ge=>ge!==U).map(ge=>({key:`transition-${ge.command}`,label:ge.label,onSelect:()=>Ve(ge),disabled:p===ge.command})),...ye.filter(ge=>ge.disabled||ge.targetStatus===D.status).map(ge=>({key:`transition-${ge.command}`,label:ge.label,disabled:!0,disabledReason:ge.targetStatus===D.status?`Already ${D.status.replace(/_/g," ")}`:ge.disabledReason??ge.warning??ge.description})),...$.statuses.map(ge=>({key:`override-${ge.id}`,label:`Override → ${ge.label}`,onSelect:()=>me(ge.id),disabled:ge.id===D.status,disabledReason:ge.id===D.status?"Already in this status":void 0})),{key:"edit-assignment",label:"Edit assignment source",icon:nT,href:`${s}/projects/${e}/assignments/${t}/edit`},{key:"edit-plan",label:"Edit plan",icon:gT,href:`${s}/projects/${e}/assignments/${t}/plan/edit`},{key:"edit-scratchpad",label:"Edit scratchpad",icon:_p,href:`${s}/projects/${e}/assignments/${t}/scratchpad/edit`},{key:"append-handoff",label:"Append handoff",icon:Du,href:`${s}/projects/${e}/assignments/${t}/handoff/edit`},{key:"append-decision",label:"Append decision",icon:oT,href:`${s}/projects/${e}/assignments/${t}/decision-record/edit`},{key:"delete",label:"Delete assignment",icon:In,destructive:!0,onSelect:()=>S(!0)}],bt=(U==null?void 0:U.command)==="review";return r.jsxs("div",{className:"space-y-5",children:[r.jsxs("div",{className:"sticky top-12 z-20 rounded-lg border border-border/60 bg-card/90 p-3 shadow-sm backdrop-blur",children:[r.jsxs("div",{className:"flex flex-wrap items-center gap-3",children:[r.jsx(kn,{status:D.status,progress:te}),r.jsx(ra,{type:D.type}),r.jsx("h1",{className:"text-lg font-semibold text-foreground",children:D.title}),r.jsxs("span",{className:"text-xs text-muted-foreground",children:["Updated ",W0(D.updated)]}),K.length>0&&r.jsxs("span",{className:"text-xs text-warning-foreground",children:["⚠ ",K.length," unmet dep",K.length===1?"":"s"]}),r.jsx(bg,{externalIds:D.externalIds}),r.jsxs("span",{className:"ml-auto flex items-center gap-2",children:[r.jsx(JS,{target:{kind:"assignment",id:D.id},worktreePath:((ve=D.workspace)==null?void 0:ve.worktreePath)??null}),!((De=D.workspace)!=null&&De.worktreePath)&&e&&t&&r.jsx(nN,{projectSlug:e,assignmentSlug:t,defaultBranch:`syntaur/${e}/${t}`,onCreated:()=>F()}),U&&r.jsx("button",{type:"button",title:U.warning||U.description,disabled:p===U.command,onClick:()=>Ve(U),className:Te("shell-action disabled:cursor-not-allowed disabled:opacity-50",U.warning&&"border-warning-foreground/40",bt&&P>0&&"send-to-review-glow"),children:r.jsx("span",{children:p===U.command?"Working…":U.label})},bt?`review-${P}`:U.command),r.jsx(pg,{items:St,align:"end"})]})]}),c?r.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,D.blockedReason?r.jsxs("div",{className:"mt-4 rounded-md border border-warning-foreground/30 bg-warning px-4 py-3 text-sm text-warning-foreground",children:[r.jsx("strong",{children:"Blocked reason:"})," ",D.blockedReason]}):null]}),ie.length>0&&r.jsx(wF,{projectSlug:e,dependencies:ie,blockedReason:D.blockedReason}),D.enrichedLinks&&D.enrichedLinks.length>0&&r.jsx(jF,{links:D.enrichedLinks}),D.referencedBy&&D.referencedBy.length>0&&r.jsx(Ue,{title:"Referenced by",description:"Other assignments whose Todos, progress, comments, or handoffs link to this one.",children:r.jsx("ul",{className:"space-y-2",children:D.referencedBy.map(ge=>{const Qe=ge.sourceProjectSlug===null?`/assignments/${ge.sourceId}`:`${s}/projects/${ge.sourceProjectSlug}/assignments/${ge.sourceSlug}`;return r.jsxs("li",{className:"flex items-center gap-2 text-sm",children:[r.jsx(Ee,{to:Qe,className:"text-foreground hover:text-primary",children:ge.sourceTitle}),r.jsxs("span",{className:"text-xs text-muted-foreground",children:["(",ge.mentions," mention",ge.mentions===1?"":"s",")"]}),ge.sourceProjectSlug===null?r.jsx("span",{className:"rounded bg-muted px-1.5 py-0.5 font-mono text-[10px] uppercase text-muted-foreground",children:"Standalone"}):null]},ge.sourceId)})})}),r.jsxs("div",{className:"grid gap-4 xl:grid-cols-[minmax(0,1fr)_280px]",children:[r.jsx("div",{className:"space-y-4",children:r.jsx(jg,{value:R,onValueChange:ge=>l({tab:ge}),items:[{value:"summary",label:"Summary",content:r.jsxs("div",{className:"space-y-5",children:[ue.acceptanceCriteria.length>0?r.jsx(Ue,{title:"Acceptance Criteria",description:"These checkboxes update the source assignment markdown.",children:r.jsxs("div",{className:"space-y-3",children:[y?r.jsx("p",{className:"rounded-md border border-error-foreground/30 bg-error px-4 py-3 text-sm text-error-foreground",children:y}):null,ue.acceptanceCriteria.map((ge,Qe)=>{const Ge=C!==null;return r.jsxs("label",{className:"flex items-start gap-3 rounded-md border border-border/60 bg-background/80 px-3 py-3",children:[r.jsx("input",{type:"checkbox",checked:ge.checked,disabled:Ge,onChange:xt=>Ze(Qe,xt.target.checked),className:"mt-1 h-4 w-4 rounded border-border text-primary"}),r.jsx("span",{className:"criterion-label text-sm leading-6","data-checked":ge.checked,children:ge.text})]},`${Qe}-${ge.text}`)})]})}):null,fe.hasSection?r.jsx(Ue,{title:"Todos",description:"Checklist of work items from assignment.md. Links point to plan files.",children:r.jsx(en,{content:fe.todosMarkdown,emptyState:"No todos yet."})}):null,r.jsx(Ue,{title:"Assignment Summary",children:r.jsx(en,{content:fe.remaining,emptyState:ue.acceptanceCriteria.length>0||fe.hasSection?"No additional summary markdown beyond the acceptance criteria and todos.":"This assignment does not have summary markdown yet."})})]})},{value:"plan",label:"Plan",count:D.plan?1:0,content:D.plan?r.jsx("div",{className:"space-y-5",children:r.jsxs(Ue,{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:r.jsxs(Ee,{className:"shell-action",to:`${s}/projects/${e}/assignments/${t}/plan/edit`,children:[r.jsx(_p,{className:"h-4 w-4"}),r.jsx("span",{children:"Edit Plan"})]}),children:[r.jsx("div",{className:"mb-4",children:r.jsx(kn,{status:D.plan.status})}),r.jsx(en,{content:D.plan.body,emptyState:"No plan content yet."})]})}):r.jsx(pt,{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:D.scratchpad?1:0,content:D.scratchpad?r.jsx(Ue,{title:"Scratchpad",actions:r.jsxs(Ee,{className:"shell-action",to:`${s}/projects/${e}/assignments/${t}/scratchpad/edit`,children:[r.jsx(_p,{className:"h-4 w-4"}),r.jsx("span",{children:"Edit Scratchpad"})]}),children:r.jsx(en,{content:D.scratchpad.body,emptyState:"Scratchpad is empty."})}):r.jsx(pt,{title:"No scratchpad yet",description:"Scratchpad notes appear here when you use the Edit Scratchpad action."})},{value:"handoff",label:"Handoff",count:((Oe=D.handoff)==null?void 0:Oe.handoffCount)??0,content:r.jsx("div",{className:"space-y-5",children:D.handoff?r.jsx(Ue,{children:r.jsx(en,{content:D.handoff.body,emptyState:"No handoff history yet."})}):r.jsx(pt,{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:((Ye=D.progress)==null?void 0:Ye.entryCount)??0,content:r.jsx("div",{className:"space-y-5",children:D.progress&&D.progress.entries.length>0?r.jsx(Ue,{title:"Progress",description:"Reverse-chronological log of work done on this assignment. Agents append entries via progress.md.",children:r.jsx("ol",{className:"space-y-4",children:D.progress.entries.map((ge,Qe)=>r.jsxs("li",{className:"border-l-2 border-border pl-3",children:[r.jsx("div",{className:"text-xs font-mono text-muted-foreground",children:ge.timestamp}),r.jsx(en,{content:ge.body})]},`${ge.timestamp}-${Qe}`))})}):r.jsx(pt,{title:"No progress entries yet",description:"Progress entries appear here as the agent appends them to progress.md."})})},{value:"comments",label:"Comments",count:((et=D.comments)==null?void 0:et.entryCount)??0,content:r.jsx("div",{className:"space-y-5",children:D.comments&&D.comments.entries.length>0?r.jsx(rN,{projectSlug:e,assignmentSlug:t,entries:D.comments.entries}):r.jsx(pt,{title:"No comments yet",description:"Comments appear here when agents or humans post via `syntaur comment` or the dashboard."})})},{value:"decisions",label:"Decisions",count:((It=D.decisionRecord)==null?void 0:It.decisionCount)??0,content:r.jsx("div",{className:"space-y-5",children:D.decisionRecord?r.jsx(Ue,{children:r.jsx(en,{content:D.decisionRecord.body,emptyState:"No decision history yet."})}):r.jsx(pt,{title:"No decision record yet",description:"Decision records appear here when you append one via the Append Decision action."})})}]})}),r.jsxs("div",{className:"space-y-5",children:[r.jsx(Ue,{title:"Details",children:r.jsxs("dl",{className:"space-y-3 text-sm",children:[r.jsx(Gs,{label:"ID",value:D.id,copyable:!0}),r.jsx(Gs,{label:"Priority",value:D.priority}),D.assignee&&r.jsx(Gs,{label:"Assignee",value:D.assignee}),r.jsx(Gs,{label:"Updated",value:`${V0(D.updated)} · Created ${H0(D.created)}`}),D.workspace.repository&&r.jsx(Gs,{label:"Repository",value:D.workspace.repository,copyable:!0}),D.workspace.worktreePath&&r.jsx(Gs,{label:"Worktree",value:D.workspace.worktreePath,copyable:!0}),D.workspace.branch&&r.jsx(Gs,{label:"Branch",value:D.workspace.branch,copyable:!0}),D.workspace.parentBranch&&r.jsx(Gs,{label:"Parent branch",value:D.workspace.parentBranch,copyable:!0}),D.externalIds.map((ge,Qe)=>r.jsx(CF,{entry:ge},`${ge.system}:${ge.id}:${Qe}`))]})}),de.length>0&&r.jsx(Ue,{title:"Servers",children:r.jsx("div",{className:"space-y-2",children:de.map((ge,Qe)=>r.jsxs("div",{className:"flex items-center gap-2 text-sm",children:[r.jsx("span",{className:"rounded bg-muted/60 px-1.5 py-0.5 font-mono text-xs",children:ge.command}),r.jsx("span",{className:"text-xs text-muted-foreground",children:ge.sessionName}),ge.urls.map(Ge=>r.jsxs("a",{href:Ge,target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-1 text-xs text-primary hover:underline",children:[Ge.replace("http://localhost:",":"),r.jsx(Xi,{className:"h-2.5 w-2.5"})]},Ge))]},Qe))})}),r.jsx(GS,{sessions:_==null?void 0:_.sessions,loading:W,error:Y})]})]}),r.jsx(YS,{open:h!==null,action:h,assignmentTitle:D.title,loading:p===(h==null?void 0:h.command),onOpenChange:ge=>{ge||x(null)},onConfirm:async ge=>{if(!h)return;await qe(h,ge)&&x(null)}}),r.jsx(fa,{open:w,title:"Delete assignment?",description:`This will permanently delete "${D.title}" and all its files (plan, scratchpad, handoff, decision record). This cannot be undone.`,confirmLabel:"Delete Assignment",destructive:!0,loading:E,onOpenChange:ge=>{ge||S(!1)},onConfirm:Fe})]})}function Gs({label:e,value:t,copyable:n}){return r.jsxs("div",{className:"flex items-start justify-between gap-3",children:[r.jsx("dt",{className:"text-muted-foreground",children:e}),r.jsxs("dd",{className:"flex items-center gap-1.5 max-w-[60%] text-right text-foreground break-all",children:[r.jsx("span",{className:"block min-w-0 truncate",title:t,children:t}),n&&t!=="—"&&r.jsx(Tr,{value:t})]})]})}function CF({entry:e}){const t=e.url!=null&&e.url.length>0;return r.jsxs("div",{className:"flex items-start justify-between gap-3",children:[r.jsx("dt",{className:"text-muted-foreground",children:e.system}),r.jsx("dd",{className:"flex items-center gap-1.5 max-w-[60%] text-right text-foreground break-all",children:t?r.jsxs("a",{href:e.url??void 0,target:"_blank",rel:"noopener noreferrer","aria-label":`Open ${e.system}:${e.id} in ${e.system}`,className:"flex items-center gap-1.5 min-w-0 text-primary hover:underline",children:[r.jsx("span",{className:"truncate min-w-0",title:e.id,children:e.id}),r.jsx(Xi,{className:"h-2.5 w-2.5 shrink-0"})]}):r.jsx("span",{className:"truncate min-w-0",title:e.id,children:e.id})})]})}function EF(){var v,C,j,w,S,E,N;const{id:e}=At(),[t,n]=is(),s=t.get("tab")??"summary",{data:i,loading:l,error:c,refetch:d}=fP(e),{data:p,loading:m,error:h}=mP(e),[x,y]=f.useState(!1);return l?r.jsx(ct,{}):c?r.jsx(mt,{error:c}):i?r.jsxs("div",{className:"space-y-6",children:[r.jsxs("header",{className:"space-y-2",children:[r.jsxs("div",{className:"flex flex-wrap items-center gap-3",children:[r.jsx(kn,{status:i.status}),r.jsx(ra,{type:i.type}),r.jsx("span",{className:"text-xs font-mono text-muted-foreground",children:i.id}),r.jsx(bg,{externalIds:i.externalIds}),r.jsxs("div",{className:"ml-auto flex items-center gap-2",children:[r.jsx(JS,{target:{kind:"assignment",id:i.id},worktreePath:((v=i.workspace)==null?void 0:v.worktreePath)??null,size:"compact"}),!((C=i.workspace)!=null&&C.worktreePath)&&r.jsx(nN,{assignmentId:i.id,defaultBranch:`syntaur/${i.slug}`,onCreated:()=>d()}),r.jsxs("button",{type:"button",onClick:()=>y(!0),className:"inline-flex items-center gap-1.5 rounded border border-border px-2 py-1 text-xs text-muted-foreground hover:border-foreground/40 hover:text-foreground",children:[r.jsx(Bl,{className:"h-3 w-3"}),"Move to workspace…"]}),r.jsx(Ee,{to:`/assignments/${i.id}/edit`,className:"rounded border border-border px-2 py-1 text-xs text-muted-foreground hover:border-foreground/40 hover:text-foreground",children:"Edit"})]})]}),r.jsx("h1",{className:"text-2xl font-semibold text-foreground",children:i.title}),i.blockedReason?r.jsxs("p",{className:"text-sm text-warning-foreground",children:["Blocked: ",i.blockedReason]}):null]}),r.jsx(Ue,{title:"Details",children:r.jsxs("dl",{className:"space-y-3 text-sm",children:[r.jsx(Ys,{label:"ID",value:i.id,copyable:!0}),r.jsx(Ys,{label:"Priority",value:i.priority}),i.assignee&&r.jsx(Ys,{label:"Assignee",value:i.assignee}),r.jsx(Ys,{label:"Updated",value:`${V0(i.updated)} · Created ${H0(i.created)}`}),i.workspace.repository&&r.jsx(Ys,{label:"Repository",value:i.workspace.repository,copyable:!0}),i.workspace.worktreePath&&r.jsx(Ys,{label:"Worktree",value:i.workspace.worktreePath,copyable:!0}),i.workspace.branch&&r.jsx(Ys,{label:"Branch",value:i.workspace.branch,copyable:!0}),i.workspace.parentBranch&&r.jsx(Ys,{label:"Parent branch",value:i.workspace.parentBranch,copyable:!0}),i.externalIds.map((P,I)=>r.jsx(TF,{entry:P},`${P.system}:${P.id}:${I}`))]})}),i.referencedBy&&i.referencedBy.length>0?r.jsx(Ue,{title:"Referenced by",description:"Other assignments whose bodies link to this one.",children:r.jsx("ul",{className:"space-y-2",children:i.referencedBy.map(P=>r.jsxs("li",{className:"flex items-center gap-2 text-sm",children:[r.jsx(Ee,{to:P.sourceProjectSlug===null?`/assignments/${P.sourceId}`:`/projects/${P.sourceProjectSlug}/assignments/${P.sourceSlug}`,className:"text-foreground hover:text-primary",children:P.sourceTitle}),r.jsxs("span",{className:"text-xs text-muted-foreground",children:["(",P.mentions," mention",P.mentions===1?"":"s",")"]})]},P.sourceId))})}):null,r.jsx(GS,{sessions:p==null?void 0:p.sessions,loading:m,error:h}),r.jsx(jg,{value:s,onValueChange:P=>n({tab:P}),items:[{value:"summary",label:"Summary",content:r.jsx("div",{className:"space-y-5",children:r.jsx(Ue,{title:"Assignment",children:r.jsx(en,{content:i.body,emptyState:"This assignment does not have summary markdown yet."})})})},{value:"progress",label:"Progress",count:((j=i.progress)==null?void 0:j.entryCount)??0,content:r.jsx("div",{className:"space-y-5",children:i.progress&&i.progress.entries.length>0?r.jsx(Ue,{title:"Progress",description:"Reverse-chronological log of work done on this assignment.",children:r.jsx("ol",{className:"space-y-4",children:i.progress.entries.map((P,I)=>r.jsxs("li",{className:"border-l-2 border-border pl-3",children:[r.jsx("div",{className:"text-xs font-mono text-muted-foreground",children:P.timestamp}),r.jsx(en,{content:P.body})]},`${P.timestamp}-${I}`))})}):r.jsx(pt,{title:"No progress entries yet",description:"Progress entries appear here as the agent appends them to progress.md."})})},{value:"comments",label:"Comments",count:((w=i.comments)==null?void 0:w.entryCount)??0,content:r.jsx("div",{className:"space-y-5",children:r.jsx(rN,{projectSlug:null,assignmentSlug:i.id,entries:((S=i.comments)==null?void 0:S.entries)??[]})})},{value:"plan",label:"Plan",content:r.jsx("div",{className:"space-y-5",children:i.plan?r.jsxs(Ue,{children:[r.jsx(en,{content:i.plan.body,emptyState:"Plan file exists but is empty."}),r.jsx("div",{className:"mt-3 flex justify-end",children:r.jsx(Ee,{to:`/assignments/${i.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"})})]}):r.jsx(pt,{title:"No plan file yet",description:"Create one via the CLI or `/plan-assignment`."})})},{value:"scratchpad",label:"Scratchpad",content:r.jsx("div",{className:"space-y-5",children:i.scratchpad?r.jsxs(Ue,{children:[r.jsx(en,{content:i.scratchpad.body,emptyState:"Scratchpad is empty."}),r.jsx("div",{className:"mt-3 flex justify-end",children:r.jsx(Ee,{to:`/assignments/${i.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"})})]}):r.jsx(pt,{title:"No scratchpad yet",description:"Scratchpad is scaffolded at assignment creation time."})})},{value:"handoff",label:"Handoff",count:((E=i.handoff)==null?void 0:E.handoffCount)??0,content:r.jsx("div",{className:"space-y-5",children:i.handoff?r.jsxs(Ue,{children:[r.jsx(en,{content:i.handoff.body,emptyState:"No handoff history yet."}),r.jsx("div",{className:"mt-3 flex justify-end",children:r.jsx(Ee,{to:`/assignments/${i.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"})})]}):r.jsx(pt,{title:"No handoff log yet",description:"Handoffs appear here when an agent appends one."})})},{value:"decisions",label:"Decisions",count:((N=i.decisionRecord)==null?void 0:N.decisionCount)??0,content:r.jsx("div",{className:"space-y-5",children:i.decisionRecord?r.jsxs(Ue,{children:[r.jsx(en,{content:i.decisionRecord.body,emptyState:"No decision history yet."}),r.jsx("div",{className:"mt-3 flex justify-end",children:r.jsx(Ee,{to:`/assignments/${i.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"})})]}):r.jsx(pt,{title:"No decision record yet",description:"Decision records appear here once appended."})})}]}),r.jsx(yg,{open:x,onOpenChange:y,currentWorkspace:i.projectWorkspace,title:"Move assignment to workspace",description:"Standalone assignments belong to a project-workspace via the workspaceGroup frontmatter field.",onSubmit:async P=>{const I=await fetch(`/api/assignments/${encodeURIComponent(i.id)}/move-workspace`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({workspaceGroup:P})});if(!I.ok){const R=await I.json().catch(()=>({}));throw new Error(R.error||"Failed to move assignment")}d()}})]}):r.jsx(mt,{error:"Assignment not found"})}function Ys({label:e,value:t,copyable:n}){return r.jsxs("div",{className:"flex items-start justify-between gap-3",children:[r.jsx("dt",{className:"text-muted-foreground",children:e}),r.jsxs("dd",{className:"flex items-center gap-1.5 max-w-[60%] text-right text-foreground break-all",children:[r.jsx("span",{className:"truncate",title:t,children:t}),n&&t!=="—"&&r.jsx(Tr,{value:t})]})]})}function TF({entry:e}){const t=e.url!=null&&e.url.length>0;return r.jsxs("div",{className:"flex items-start justify-between gap-3",children:[r.jsx("dt",{className:"text-muted-foreground",children:e.system}),r.jsx("dd",{className:"flex items-center gap-1.5 max-w-[60%] text-right text-foreground break-all",children:t?r.jsxs("a",{href:e.url??void 0,target:"_blank",rel:"noopener noreferrer","aria-label":`Open ${e.system}:${e.id} in ${e.system}`,className:"flex items-center gap-1.5 min-w-0 text-primary hover:underline",children:[r.jsx("span",{className:"truncate min-w-0",title:e.id,children:e.id}),r.jsx(Xi,{className:"h-2.5 w-2.5 shrink-0"})]}):r.jsx("span",{className:"truncate min-w-0",title:e.id,children:e.id})})]})}function PF({currentStatus:e,availableTransitions:t,onSelect:n,disabled:s=!1}){const[i,l]=f.useState(!1),[c,d]=f.useState(null),[p,m]=f.useState(0),h=f.useRef(null),x=f.useRef(null),y=f.useId(),v=Bu(e),C=v.icon,j=f.useCallback(P=>{l(!1),P&&requestAnimationFrame(()=>{var I;(I=h.current)==null||I.focus()})},[]),w=f.useCallback(()=>{var I;const P=(I=h.current)==null?void 0:I.getBoundingClientRect();P&&d({top:P.top,left:P.left,width:P.width,bottom:P.bottom})},[]);f.useLayoutEffect(()=>{i&&w()},[i,w]),f.useEffect(()=>{if(!i)return;const P=()=>w();return window.addEventListener("scroll",P,!0),window.addEventListener("resize",P),()=>{window.removeEventListener("scroll",P,!0),window.removeEventListener("resize",P)}},[i,w]),f.useEffect(()=>{if(!i)return;const P=I=>{var $,D;const R=I.target;R&&(($=x.current)!=null&&$.contains(R)||(D=h.current)!=null&&D.contains(R)||j(!1))};return document.addEventListener("mousedown",P),()=>document.removeEventListener("mousedown",P)},[i,j]),f.useEffect(()=>{i&&m(0)},[i,t.length]);function S(P){(P.key==="Enter"||P.key===" "||P.key==="ArrowDown")&&(P.preventDefault(),l(!0))}function E(P){if(t.length===0){P.key==="Escape"&&(P.preventDefault(),j(!0));return}if(P.key==="ArrowDown")P.preventDefault(),m(I=>(I+1)%t.length);else if(P.key==="ArrowUp")P.preventDefault(),m(I=>(I-1+t.length)%t.length);else if(P.key==="Home")P.preventDefault(),m(0);else if(P.key==="End")P.preventDefault(),m(t.length-1);else if(P.key==="Enter"){P.preventDefault();const I=t[p];I&&(n(I),j(!0))}else P.key==="Escape"&&(P.preventDefault(),j(!0))}function N(P){n(P),j(!1)}return r.jsxs(r.Fragment,{children:[r.jsxs("button",{ref:h,type:"button","data-no-drag":!0,disabled:s,"aria-haspopup":"menu","aria-expanded":i,"aria-controls":i?y:void 0,onClick:()=>{s||l(P=>!P)},onKeyDown:S,title:`Status: ${v.label}. Click to change.`,className:Te(o1(e),"cursor-pointer transition hover:brightness-95 focus:outline-none focus-visible:ring-2 focus-visible:ring-ring/40",s&&"cursor-not-allowed opacity-60"),children:[r.jsx(C,{className:"h-3.5 w-3.5"}),r.jsx("span",{children:v.label})]}),i&&c&&typeof document<"u"?ws.createPortal(r.jsx("div",{ref:x,id:y,role:"menu",tabIndex:-1,autoFocus:!0,onKeyDown:E,style:{position:"fixed",top:c.bottom+6,left:c.left,minWidth:Math.max(c.width,180),zIndex:60},className:"rounded-md border border-border/70 bg-popover py-1 text-sm text-popover-foreground shadow-lg",children:t.length===0?r.jsx("div",{className:"px-3 py-2 text-xs text-muted-foreground",children:"No transitions available from this status."}):t.map((P,I)=>{const R=Bu(P.targetStatus),$=R.icon,D=I===p;return r.jsxs("button",{type:"button",role:"menuitem","data-no-drag":!0,onMouseEnter:()=>m(I),onClick:()=>N(P),title:P.warning||P.description,className:Te("flex w-full flex-col items-stretch gap-0.5 px-3 py-1.5 text-left text-sm transition",D?"bg-foreground/5":"hover:bg-foreground/5"),children:[r.jsxs("span",{className:"flex items-center justify-between gap-2",children:[r.jsxs("span",{className:"flex min-w-0 items-center gap-2",children:[r.jsx($,{className:"h-3.5 w-3.5 flex-shrink-0 text-muted-foreground"}),r.jsx("span",{className:"truncate",children:P.label})]}),r.jsx("span",{className:"text-[10px] uppercase tracking-wide text-muted-foreground",children:R.label})]}),P.warning?r.jsx("span",{className:"text-[11px] leading-snug text-warning-foreground",children:P.warning}):null]},`${P.command}:${P.targetStatus}`)})}),document.body):null]})}function RF({title:e,detailHref:t,onSave:n,disabled:s=!1}){const[i,l]=f.useState(!1);return i?r.jsx(AF,{initialTitle:e,disabled:s,onSave:n,onExit:()=>l(!1)}):r.jsxs("div",{className:"group flex items-baseline gap-1.5",children:[r.jsx("button",{type:"button","data-no-drag":!0,disabled:s,onClick:()=>{s||l(!0)},className:Te("text-left text-base font-semibold text-foreground transition hover:text-primary focus:outline-none focus-visible:ring-2 focus-visible:ring-ring/40 rounded-sm",s&&"cursor-not-allowed opacity-60"),title:"Click to rename",children:e}),r.jsx(Ee,{to:t,"data-no-drag":!0,"aria-label":"Open detail page",title:"Open detail page",onClick:c=>c.stopPropagation(),className:"text-muted-foreground opacity-0 transition group-hover:opacity-100 focus:opacity-100 focus:outline-none focus-visible:ring-2 focus-visible:ring-ring/40 rounded-sm",children:r.jsx(Xi,{className:"h-3.5 w-3.5"})})]})}function AF({initialTitle:e,disabled:t,onSave:n,onExit:s}){const i=f.useRef(e),[l,c]=f.useState(e),[d,p]=f.useState(!1),[m,h]=f.useState(!1),x=f.useRef(null),y=f.useRef(!1);f.useEffect(()=>{const w=x.current;w&&(w.focus(),w.select())},[]);const v=f.useCallback(()=>{var w;h(!0),window.setTimeout(()=>h(!1),260),(w=x.current)==null||w.focus()},[]),C=f.useCallback(async()=>{if(y.current)return;const w=l.trim();if(w.length===0){v();return}if(w===i.current){s();return}y.current=!0,p(!0);try{await n(w)}catch{}finally{p(!1),s()}},[l,s,n,v]);function j(w){w.key==="Enter"?(w.preventDefault(),C()):w.key==="Escape"&&(w.preventDefault(),y.current=!0,s())}return r.jsx("input",{ref:x,type:"text","data-no-drag":!0,disabled:t||d,value:l,onChange:w=>c(w.target.value),onKeyDown:j,onBlur:()=>void C(),className:Te("w-full rounded-sm border border-border bg-background px-1.5 py-0.5 text-base font-semibold text-foreground outline-none transition focus:border-ring focus:ring-1 focus:ring-ring",m&&"syntaur-input-shake",d&&"opacity-70")})}const Bw=yk;function Uw(e){return e==="1"?"stale":e==="0"?"fresh":"all"}function DF(e,t){return e.toString()===t.toString()}function Hw(e){const t=Date.parse(e);return Number.isNaN(t)?!1:Date.now()-t>10080*60*1e3}function Vw(){const{workspace:e}=At(),t=Wt(),n=Rt(),s=f.useRef(null);ao("list:assignments");const{data:i,loading:l,error:c,refetch:d}=$h(),p=na(),m=vg(),[h,x]=is(),y=e?`w:${e}`:null,v=zS(y),C=f.useRef(void 0),j=f.useMemo(()=>a1(p.order),[p]),w=f.useMemo(()=>{const O={};for(const re of j)O[re]=kd(p,re);return O},[j,p]),S=f.useMemo(()=>j.map(O=>({id:O,title:w[O]??O,description:Nd(O)})),[j,w]),E=f.useMemo(()=>m.definitions.map(O=>({id:O.id,title:gl(m,O.id),description:O.description})),[m]),N="__unknown_type__",P=f.useMemo(()=>new Set(["all",...j]),[j]),I=h.get("view"),R=h.get("status"),$=h.get("stale"),D=I&&Bw.includes(I)?I:"kanban";function X(O){return!O||!P.has(O)?"all":O}const Z=f.useCallback(O=>{x(re=>{const xe=new URLSearchParams(re);return O==="kanban"?xe.delete("view"):xe.set("view",O),xe})},[x]),[F,H]=f.useState(""),[J,_]=f.useState(()=>X(R)),[W,Y]=f.useState(()=>v.filters.priority??"all"),[ie,K]=f.useState(()=>v.filters.type??"all"),[ae,T]=f.useState(()=>v.filters.assignee??"all"),[M,q]=f.useState(()=>v.filters.project??"all"),[L,ue]=f.useState(()=>Uw($)),[fe,B]=f.useState(()=>v.sortField),[oe,he]=f.useState(()=>v.sortDirection),[we,Se]=f.useState(()=>({hidden:[]})),[pe,He]=f.useState(()=>({hidden:[]})),[te,ye]=f.useState(()=>v.grouping),ne=te==="type"?"type":"status",[U,de]=f.useState(()=>new Set),[me,Fe]=f.useState([]),{toast:qe,showToast:Ve,dismissToast:Ze}=Jg(),[St,bt]=f.useState(null),[gt,ce]=f.useState(null),[ve,De]=f.useState(null),[Oe,Ye]=f.useState(null),[et,It]=f.useState(null),[ge,Qe]=f.useState(null),[Ge,xt]=f.useState(null),[Kt,Bt]=f.useState(null),[rn,Qn]=f.useState(null),[On,ut]=f.useState(!1),[Ut,Dt]=f.useState(!1),Xt=e?{kind:"workspace",workspace:e}:{kind:"global"},Q=h.get("loadView"),{view:_e,loading:tt,error:qt}=Ki(Q),{view:nt,loading:fn,error:sn}=Ki(rn),on=f.useRef(null);f.useEffect(()=>{Fe((i==null?void 0:i.assignments)??[])},[i]),f.useEffect(()=>{rn&&!fn&&!sn&&!nt&&Qn(null)},[nt,sn,rn,fn]),f.useEffect(()=>{Qn(null),on.current=null},[e]),f.useEffect(()=>{const O=X(R);O!==J&&_(O);const re=Uw($);re!==L&&ue(re)},[L,$,J,R]),f.useEffect(()=>{C.current===y&&x(O=>{const re=new URLSearchParams(O);return J==="all"?re.delete("status"):re.set("status",J),L==="all"?re.delete("stale"):L==="stale"?re.set("stale","1"):re.set("stale","0"),DF(O,re)?O:re})},[L,y,x,J]),f.useEffect(()=>{Y(v.filters.priority??"all"),K(v.filters.type??"all"),T(v.filters.assignee??"all"),q(v.filters.project??"all"),B(v.sortField),he(v.sortDirection),ye(v.grouping)},[v.filters.priority,v.filters.type,v.filters.assignee,v.filters.project,v.sortField,v.sortDirection,v.grouping]),f.useEffect(()=>{if(C.current===y)return;let O=!1;return Yg().then(re=>{if(O||C.current===y)return;const xe=vk(re,y),Pe=xe.defaultView,$e=xe.filters.status??"all",at=xe.filters.activity??"all",yt=new URLSearchParams(window.location.search);let Rn=!1;const An=new URLSearchParams(yt);yt.get("view")===null&&Pe!=="kanban"&&Bw.includes(Pe)&&(An.set("view",Pe),Rn=!0),yt.get("status")===null&&$e!=="all"&&(An.set("status",$e),_($e),Rn=!0),yt.get("stale")===null&&at!=="all"&&(An.set("stale",at==="stale"?"1":"0"),ue(at),Rn=!0),Rn&&x(An,{replace:!0}),queueMicrotask(()=>{C.current=y})}),()=>{O=!0}},[y]);const dt=f.useCallback(O=>{(y===null?US(O):HS(y,O)).catch(xe=>{console.warn("Failed to persist view prefs:",xe)})},[y]),hr=f.useCallback(O=>{Z(O),dt({defaultView:O})},[Z,dt]),yn=f.useCallback(O=>{_(O),dt({filters:{status:O}})},[dt]),Zn=f.useCallback(O=>{Y(O),dt({filters:{priority:O}})},[dt]),co=f.useCallback(O=>{K(O),dt({filters:{type:O}})},[dt]),ga=f.useCallback(O=>{T(O),dt({filters:{assignee:O}})},[dt]),xa=f.useCallback(O=>{q(O),dt({filters:{project:O}})},[dt]),Ar=f.useCallback(O=>{ue(O),dt({filters:{activity:O}})},[dt]),Vo=f.useCallback(O=>{B(O),dt({sortField:O})},[dt]),uo=f.useCallback(O=>{he(O),dt({sortDirection:O})},[dt]),Kd=f.useCallback(O=>{ye(O),dt({grouping:O})},[dt]),fo=f.useCallback(()=>({viewMode:D,filters:{status:J,priority:W,assignee:ae,project:M,activity:L},sortField:fe,sortDirection:oe,listSectionVisibility:{collapsed:[...U]},kanbanColumnVisibility:we,tableColumnVisibility:pe}),[D,J,W,ae,M,L,fe,oe,U,we,pe]),po=f.useCallback(O=>{KS(O,{setViewMode:Z,setStatusFilter:yn,setPriorityFilter:Zn,setAssigneeFilter:ga,setProjectFilter:xa,setActivityFilter:Ar,setSortField:Vo,setSortDirection:uo,setListSectionVisibility:re=>de(new Set(re.collapsed)),setKanbanColumnVisibility:Se,setTableColumnVisibility:He}),Qn(O.id)},[Z,yn,Zn,ga,xa,Ar,Vo,uo]),Ql=f.useCallback(O=>{po(O),on.current=O.id,x(re=>{const xe=new URLSearchParams(re);return xe.set("loadView",O.id),xe},{replace:!0})},[po,x]),Zl=f.useCallback(async O=>{try{const re=Yu({name:O,context:{workspace:e??null,projectSlug:null},state:fo()}),xe=await Nk(re),Pe=xe.views[xe.views.length-1];Qn((Pe==null?void 0:Pe.id)??null),Pe&&(on.current=Pe.id,x($e=>{const at=new URLSearchParams($e);return at.set("loadView",Pe.id),at},{replace:!0})),ut(!1),Dt(!1),Ve(`Saved view "${O}"`,"success")}catch(re){throw Ve(re instanceof Error?re.message:"Failed to save view","error"),re}},[fo,x,Ve,e]),qd=f.useCallback(async()=>{if(rn)try{const O=Yu({name:(nt==null?void 0:nt.name)??"",context:{workspace:e??null,projectSlug:null},state:fo()});await ng(rn,{config:O.config}),Ve("View updated","success")}catch(O){Ve(O instanceof Error?O.message:"Failed to update view","error")}},[fo,nt==null?void 0:nt.name,rn,Ve,e]);f.useEffect(()=>{if(!Q){on.current=null;return}if(on.current!==Q&&(rn&&rn!==Q&&Qn(null),!tt)){if(qt){Ve("Couldn't load saved view — try again","error");return}if(_e){on.current=Q,po(_e),x(O=>{const re=new URLSearchParams(O);return re.delete("loadView"),re},{replace:!0});return}on.current=Q,Ve("Saved view no longer exists","error"),x(O=>{const re=new URLSearchParams(O);return re.delete("loadView"),re},{replace:!0})}},[Q,_e,tt,qt,rn,po,x,Ve]);const Gd=f.useMemo(()=>Array.from(new Set(me.map(O=>O.status))).sort(),[me]),Ot=f.useMemo(()=>Array.from(new Set(me.map(O=>O.priority))).sort(),[me]),Yd=f.useMemo(()=>Array.from(new Set(me.map(O=>O.assignee??"__unassigned__"))).sort(),[me]),ya=f.useMemo(()=>Array.from(new Map(me.filter(O=>O.projectSlug!==null).map(O=>[O.projectSlug,O.projectTitle]))).sort(([,O],[,re])=>O.localeCompare(re)),[me]),_t=f.useMemo(()=>me.filter(O=>{if(e){if(e==="_ungrouped"){if(O.projectWorkspace!==null)return!1}else if(O.projectWorkspace!==e)return!1}if(J!=="all"&&O.status!==J||W!=="all"&&O.priority!==W||ie!=="all"&&(O.type??"")!==ie||L==="stale"&&!Hw(O.updated)||L==="fresh"&&Hw(O.updated)||ae!=="all"&&(O.assignee??"__unassigned__")!==ae)return!1;if(M!=="all"){if(M==="__standalone__"){if(O.projectSlug!==null)return!1}else if(O.projectSlug!==M)return!1}const re=F.trim().toLowerCase();return!(re&&!`${O.title} ${O.slug} ${O.projectTitle??"standalone"} ${O.projectSlug??""}`.toLowerCase().includes(re))}),[L,me,F,J,W,ie,ae,M,e]),Vr=f.useMemo(()=>mg(_t,fe,oe),[_t,fe,oe]),va=f.useMemo(()=>{if(te==="none")return[{id:"__all__",label:"All assignments",items:_t}];if(te==="type"){const O=m.definitions.map(Pe=>({id:Pe.id,label:gl(m,Pe.id),items:_t.filter($e=>$e.type===Pe.id)})),re=new Set(m.definitions.map(Pe=>Pe.id)),xe=_t.filter(Pe=>!Pe.type||!re.has(Pe.type));return xe.length>0&&O.push({id:N,label:"Other",items:xe}),O}if(te==="priority")return["critical","high","medium","low"].map(re=>({id:re,label:re.charAt(0).toUpperCase()+re.slice(1),items:_t.filter(xe=>xe.priority===re)}));if(te==="assignee")return Array.from(new Set(_t.map(re=>re.assignee??"__unassigned__"))).sort().map(re=>({id:re,label:re==="__unassigned__"?"Unassigned":re,items:_t.filter(xe=>(xe.assignee??"__unassigned__")===re)}));if(te==="project"){const O=new Map;for(const re of _t){const xe=re.projectSlug??"__standalone__",Pe=re.projectTitle??"Standalone";O.has(xe)||O.set(xe,Pe)}return Array.from(O.entries()).sort(([,re],[,xe])=>re.localeCompare(xe)).map(([re,xe])=>({id:re,label:xe,items:_t.filter(Pe=>(Pe.projectSlug??"__standalone__")===re)}))}return j.map(O=>({id:O,label:w[O]??O,items:_t.filter(re=>re.status===O)}))},[te,_t,m,j,w]),ec=f.useMemo(()=>{const O=new Set(m.definitions.map(xe=>xe.id));return _t.some(xe=>!xe.type||!O.has(xe.type))?[...E,{id:N,title:"Other",description:"Assignments with no recognized type."}]:E},[E,m,_t]),{visibleItems:Wo,visibleIndexByKey:er}=f.useMemo(()=>{let O;if(D==="table")O=Vr;else if(D==="kanban"){const xe=new Set(m.definitions.map(Pe=>Pe.id));ne==="type"?O=[...m.definitions.flatMap(Pe=>_t.filter($e=>$e.type===Pe.id)),..._t.filter(Pe=>!Pe.type||!xe.has(Pe.type))]:O=j.flatMap(Pe=>_t.filter($e=>$e.status===Pe))}else O=va.flatMap(xe=>xe.items);const re=new Map;return O.forEach((xe,Pe)=>re.set(Yt(xe),Pe)),{visibleItems:O,visibleIndexByKey:re}},[D,Vr,va,ne,m,_t,j]),{hotkeyRowProps:ba}=Hl(Wo,{scope:"list:assignments",onOpen:O=>{if(O.projectSlug===null){n(`/assignments/${O.id}`);return}const re=O.projectWorkspace?`/w/${O.projectWorkspace}`:t;n(`${re}/projects/${O.projectSlug}/assignments/${O.slug}`)}});if(Pt({keys:"/",scope:"list:assignments",description:"Focus filter",handler:()=>{var O;return(O=s.current)==null?void 0:O.focus()}}),Pt({keys:"r",scope:"list:assignments",description:"Refresh",handler:()=>d()}),l)return r.jsx(ct,{label:"Loading assignments board…"});if(c||!i)return r.jsx(mt,{error:c||"Assignments board is unavailable."});async function _n({item:O,toColumnId:re,action:xe,reason:Pe}){bt(Yt(O));const $e=me;Fe(at=>at.map(yt=>Yt(yt)===Yt(O)?{...yt,status:re,blockedReason:re==="blocked"?Pe??yt.blockedReason:null}:yt));try{if(O.projectSlug===null){if(!xe)throw new Error("Standalone assignments require a transition action, not status override.");const yt=await fetch(`/api/assignments/${encodeURIComponent(O.id)}/transitions/${encodeURIComponent(xe.command)}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(Pe?{reason:Pe}:{})});if(!yt.ok)throw new Error((await yt.json()).error??`HTTP ${yt.status}`);const An=(await yt.json()).assignment;Fe(tr=>tr.map(gr=>Yt(gr)===Yt(O)?{...gr,status:An.status,blockedReason:An.blockedReason,availableTransitions:An.availableTransitions,updated:An.updated}:gr));return}const at=xe?await XS(O.projectSlug,O.slug,xe,Pe):await QS(O.projectSlug,O.slug,re);return Fe(yt=>yt.map(Rn=>Yt(Rn)===Yt(O)?{...Rn,status:at.status,blockedReason:at.blockedReason,availableTransitions:at.availableTransitions,updated:at.updated}:Rn)),d(),!0}catch(at){return Fe($e),Ve(at.message,"error"),!1}finally{bt(null)}}async function Ko({item:O,toColumnId:re,action:xe}){if(O.status===re)return;const Pe=xe??cl(O,re);if(Pe!=null&&Pe.disabled){Ve(Pe.disabledReason||`Cannot move this assignment to ${re}.`,"error");return}if(Pe&&ZS(Pe)){Ye({item:O,toColumnId:re,action:Pe});return}await _n({item:O,toColumnId:re,action:Pe})}async function Jd(O,re){if(re===O.title)return;const xe=Yt(O),Pe=me;Fe($e=>$e.map(at=>Yt(at)===xe?{...at,title:re}:at)),bt(xe);try{const $e=O.projectSlug===null?await mF({id:O.id,title:re}):await pF({projectSlug:O.projectSlug,assignmentSlug:O.slug,title:re});Fe(at=>at.map(yt=>Yt(yt)===xe?{...yt,title:$e.title,updated:$e.updated}:yt)),d()}catch($e){throw Fe(Pe),Ve($e.message,"error"),$e}finally{bt(null)}}function Xd(O){de(re=>{const xe=new Set(re);return xe.has(O)?xe.delete(O):xe.add(O),xe})}function qo(O){fe===O?uo(oe==="asc"?"desc":"asc"):(Vo(O),uo("asc"))}const vn=gt?me.find(O=>Yt(O)===gt)??null:null;function mo(O,re){O.dataTransfer.effectAllowed="move",O.dataTransfer.setData("text/plain",re),ce(re)}function Es(){ce(null),De(null)}function Qd(O,re){if(!vn)return;const xe=cl(vn,re);vn.status===re||xe!=null&&xe.disabled||(O.preventDefault(),O.dataTransfer.dropEffect="move",De(re))}function Zd(O,re){ve===re&&!O.currentTarget.contains(O.relatedTarget)&&De(null)}function wa(O,re){if(O.preventDefault(),!vn||vn.status===re){Es();return}Es(),Ko({item:vn,toColumnId:re})}function ds({field:O,children:re}){const xe=fe===O;return r.jsx("th",{className:"pb-3 font-medium",children:r.jsxs("button",{type:"button",onClick:()=>qo(O),className:"inline-flex items-center gap-1 hover:text-foreground",children:[re,xe?oe==="asc"?r.jsx(R0,{className:"h-3 w-3"}):r.jsx(Io,{className:"h-3 w-3"}):null]})})}return r.jsxs("div",{className:"space-y-5","data-density":v.density,children:[r.jsx("div",{className:"flex items-center justify-end",children:r.jsxs(Ee,{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:[r.jsx(Jt,{className:"h-4 w-4"}),"New Assignment"]})}),r.jsxs(hg,{children:[r.jsx(Cd,{ref:s,value:F,onChange:H,placeholder:"Search assignments or projects"}),r.jsxs("select",{value:J,onChange:O=>yn(X(O.target.value)),className:"editor-input max-w-[180px]",children:[r.jsx("option",{value:"all",children:"All statuses"}),Gd.map(O=>r.jsx("option",{value:O,children:w[O]??O},O))]}),r.jsxs("select",{value:W,onChange:O=>Zn(O.target.value),className:"editor-input max-w-[180px]",children:[r.jsx("option",{value:"all",children:"All priorities"}),Ot.map(O=>r.jsx("option",{value:O,className:"capitalize",children:O},O))]}),r.jsxs("select",{value:ie,onChange:O=>co(O.target.value),className:"editor-input max-w-[180px]",children:[r.jsx("option",{value:"all",children:"All types"}),m.definitions.map(O=>r.jsx("option",{value:O.id,children:gl(m,O.id)},O.id))]}),r.jsxs("select",{value:ae,onChange:O=>ga(O.target.value),className:"editor-input max-w-[180px]",children:[r.jsx("option",{value:"all",children:"All assignees"}),Yd.map(O=>r.jsx("option",{value:O,children:O==="__unassigned__"?"Unassigned":O},O))]}),r.jsxs("select",{value:M,onChange:O=>xa(O.target.value),className:"editor-input max-w-[180px]",children:[r.jsx("option",{value:"all",children:"All projects"}),r.jsx("option",{value:"__standalone__",children:"Standalone"}),ya.map(([O,re])=>r.jsx("option",{value:O,children:re},O))]}),r.jsxs("select",{value:L,onChange:O=>Ar(O.target.value),className:"editor-input max-w-[180px]",children:[r.jsx("option",{value:"all",children:"All activity"}),r.jsx("option",{value:"stale",children:"Stale only"}),r.jsx("option",{value:"fresh",children:"Fresh only"})]}),r.jsx("select",{value:D==="kanban"?ne:te,onChange:O=>Kd(O.target.value),className:"editor-input max-w-[180px]",title:"Group by",children:gA.map(O=>{const re=D==="kanban"&&O!=="status"&&O!=="type",xe=O==="none"?"No grouping":`Group: ${O.charAt(0).toUpperCase()+O.slice(1)}`;return r.jsx("option",{value:O,disabled:re,children:re?`${xe} (list only)`:xe},O)})}),r.jsx(gg,{value:D,onChange:O=>hr(O),options:[{value:"table",label:"Table"},{value:"list",label:"List"},{value:"kanban",label:"Kanban"}]}),D==="table"?r.jsx(_S,{visibility:pe,onChange:He}):null,r.jsx(WS,{scope:Xt,loadedViewId:rn,onApply:Ql,onOpenSaveDialog:()=>{Dt(!1),ut(!0)}}),r.jsx("button",{type:"button",onClick:()=>{nt?qd():(Dt(!1),ut(!0))},className:"inline-flex items-center gap-1.5 rounded-md border border-border/60 bg-background/60 px-2.5 py-1.5 text-xs font-medium text-foreground hover:bg-background",title:nt?`Update ${nt.name}`:"Save current view",children:nt?`Update '${nt.name}'`:"Save view"}),nt?r.jsx("button",{type:"button",onClick:()=>{Dt(!0),ut(!0)},className:"inline-flex items-center gap-1.5 rounded-md border border-border/60 bg-background/60 px-2.5 py-1.5 text-xs font-medium text-foreground hover:bg-background",title:"Save as new view",children:"Save as new…"}):null]}),i.assignments.length===0?r.jsx(pt,{title:"No assignments yet",description:"Assignments appear here once projects contain concrete work items.",actions:r.jsxs(Ee,{className:"shell-action bg-foreground text-background hover:opacity-90",to:`${t}/projects`,children:[r.jsx($0,{className:"h-4 w-4"}),r.jsx("span",{children:"Browse Projects"})]})}):_t.length===0?r.jsx(pt,{title:"No assignments match these filters",description:"Adjust the search term or filters to show assignments across all projects again."}):D==="table"?(()=>{const O=new Set(pe.hidden),re=xe=>xe==="title"||!O.has(xe);return r.jsx(Ue,{title:`${Vr.length} assignment${Vr.length===1?"":"s"}`,children:r.jsx("div",{className:"overflow-x-auto",children:r.jsxs("table",{className:"w-full min-w-[760px] text-left text-sm",children:[r.jsx("thead",{children:r.jsxs("tr",{className:"border-b border-border/60 text-muted-foreground",children:[re("title")?r.jsx(ds,{field:"title",children:"Assignment"}):null,re("status")?r.jsx(ds,{field:"status",children:"Status"}):null,r.jsx("th",{className:"py-2 pr-4 text-xs font-medium uppercase tracking-wider",children:"Type"}),re("priority")?r.jsx(ds,{field:"priority",children:"Priority"}):null,re("assignee")?r.jsx(ds,{field:"assignee",children:"Assignee"}):null,re("dependencies")?r.jsx(ds,{field:"dependencies",children:"Dependencies"}):null,re("updated")?r.jsx(ds,{field:"updated",children:"Updated"}):null]})}),r.jsx("tbody",{children:Vr.map((xe,Pe)=>r.jsxs("tr",{className:"border-b border-border/50 last:border-0",...ba(Pe),children:[re("title")?r.jsxs("td",{className:"py-4 pr-4",children:[r.jsx(Ee,{to:xe.projectSlug===null?`/assignments/${xe.id}`:`${t}/projects/${xe.projectSlug}/assignments/${xe.slug}`,className:"font-semibold text-foreground hover:text-primary",children:xe.title}),r.jsx("p",{className:"mt-1 text-xs text-muted-foreground",children:xe.projectTitle??r.jsx("span",{className:"rounded bg-muted px-1.5 py-0.5 font-mono text-[10px] uppercase text-muted-foreground",children:"Standalone"})}),r.jsxs("p",{className:"mt-0.5 inline-flex items-center gap-1.5 font-mono text-xs text-muted-foreground/70",title:xe.id,children:[xe.id.slice(0,8),r.jsx(Tr,{value:xe.id})]})]}):null,re("status")?r.jsx("td",{className:"py-4 pr-4",children:r.jsx("select",{value:xe.status,disabled:St===Yt(xe),onChange:$e=>Ko({item:xe,toColumnId:$e.target.value}),className:Te("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")]`,(zu[xe.status]??zu.pending).className,St===Yt(xe)&&"animate-pulse opacity-60"),children:j.map($e=>{const at=xe.status===$e?void 0:cl(xe,$e),yt=(at==null?void 0:at.disabled)??!1;return r.jsx("option",{value:$e,disabled:yt,title:yt?(at==null?void 0:at.disabledReason)??void 0:void 0,children:w[$e]},$e)})})}):null,r.jsx("td",{className:"py-4 pr-4",children:r.jsx(ra,{type:xe.type,compact:!0})}),re("priority")?r.jsx("td",{className:"py-4 pr-4 capitalize text-muted-foreground",children:xe.priority}):null,re("assignee")?r.jsx("td",{className:"py-4 pr-4 text-muted-foreground",children:xe.assignee??"Unassigned"}):null,re("dependencies")?r.jsx("td",{className:"py-4 pr-4 text-muted-foreground",children:xe.dependsOn.length}):null,re("updated")?r.jsx("td",{className:"py-4 text-muted-foreground",children:pr(xe.updated)}):null]},Yt(xe)))})]})})})})():D==="list"?r.jsx("div",{className:"space-y-3",children:va.map(({id:O,label:re,items:xe})=>{var An;if(xe.length===0&&!(vn&&te==="status"))return null;const Pe=!U.has(O),$e=te==="status",at=$e&&vn?vn.status!==O&&!((An=cl(vn,O))!=null&&An.disabled):!1,yt=$e&&vn?vn.status!==O&&!at:!1,Rn=$e&&ve===O;return r.jsxs("div",{className:Te("rounded-lg border border-border/60 bg-card/90 transition",Rn&&at&&"ring-2 ring-ring/30",yt&&"border-dashed opacity-65"),onDragOver:$e?tr=>Qd(tr,O):void 0,onDragLeave:$e?tr=>Zd(tr,O):void 0,onDrop:$e?tr=>wa(tr,O):void 0,children:[r.jsxs("button",{type:"button",onClick:()=>Xd(O),className:"flex w-full items-center gap-2 px-4 py-3 text-left",children:[r.jsx(Io,{className:`h-4 w-4 text-muted-foreground transition-transform ${Pe?"":"-rotate-90"}`}),r.jsx("span",{className:"font-semibold text-foreground",children:re}),r.jsx("span",{className:"rounded-full border border-border/60 px-2 py-0.5 text-xs text-muted-foreground",children:xe.length})]}),Pe&&xe.length>0&&r.jsx("div",{className:"space-y-3 px-4 pb-4",children:xe.map(tr=>{const gr=Yt(tr),Go=gt===gr,ho=er.get(gr)??-1,nr=$e;return r.jsx("div",{draggable:nr,onDragStart:nr?Wr=>mo(Wr,gr):void 0,onDragEnd:nr?Es:void 0,...ho>=0?ba(ho):{},className:Te("transition",nr&&"cursor-grab active:cursor-grabbing",Go&&"scale-[0.98] opacity-50"),children:r.jsx(Ww,{assignment:tr,dragging:Go,transitioning:St===gr})},gr)})})]},O)})}):r.jsx(Sd,{columns:ne==="type"?ec:S,items:_t,getItemId:Yt,getColumnId:O=>ne==="type"?O.type&&m.definitions.some(re=>re.id===O.type)?O.type:N:O.status,canDrop:({item:O,fromColumnId:re,toColumnId:xe})=>{if(re===xe)return{allowed:!0};const Pe=cl(O,xe);return Pe!=null&&Pe.disabled?{allowed:!1,reason:Pe.disabledReason||Pe.description}:{allowed:!0,reason:Pe?Pe.warning||Pe.description:`Move to ${xe} (direct status change).`}},onMove:ne==="type"?void 0:({item:O,toColumnId:re})=>Ko({item:O,toColumnId:re}),dragDisabled:ne==="type",getExternalDragData:O=>O.projectSlug===null?{type:"standalone-assignment",id:O.id}:{type:"project-assignment",id:O.id},onCardContextMenu:(O,re)=>{re.preventDefault(),It({item:O,anchor:{x:re.clientX,y:re.clientY}})},emptyMessage:O=>`No ${O.title.toLowerCase()} assignments.`,hiddenColumnIds:we.hidden,onHideColumn:O=>Se(re=>({hidden:re.hidden.includes(O)?re.hidden.filter(Pe=>Pe!==O):[...re.hidden,O]})),renderCard:(O,{dragging:re})=>{const xe=er.get(Yt(O))??-1;return r.jsx("div",{...xe>=0?ba(xe):{},children:r.jsx(Ww,{assignment:O,dragging:re,transitioning:St===Yt(O),onPillSelect:Pe=>void Ko({item:O,toColumnId:Pe.targetStatus,action:Pe}),onRenameTitle:Pe=>Jd(O,Pe)})})}}),r.jsx(Xg,{toast:qe,onDismiss:Ze}),r.jsx(VS,{open:On,onOpenChange:O=>{ut(O),O||Dt(!1)},initialName:Ut&&nt?`${nt.name} (copy)`:"",title:Ut?"Save as new view":"Save view",onSubmit:Zl}),r.jsx(YS,{open:Oe!==null,action:(Oe==null?void 0:Oe.action)??null,assignmentTitle:(Oe==null?void 0:Oe.item.title)??"Assignment",loading:St===(Oe?Yt(Oe.item):null),onOpenChange:O=>{O||Ye(null)},onConfirm:async O=>{if(!Oe)return;const re=Oe;await _n({item:re.item,toColumnId:re.toColumnId,action:re.action,reason:O})&&Ye(null)}}),r.jsx(l1,{anchor:(et==null?void 0:et.anchor)??null,items:et?$F(et.item,{onEdit:()=>{const O=et.item,re=O.projectSlug===null?`/assignments/${O.id}`:`${O.projectWorkspace?`/w/${O.projectWorkspace}`:t}/projects/${O.projectSlug}/assignments/${O.slug}`;n(re)},onDelete:()=>Qe(et.item),onMove:()=>Bt(et.item)}):[],onClose:()=>It(null)}),r.jsx(fa,{open:ge!==null,title:"Delete assignment?",description:ge?`"${ge.title}" will be permanently removed. This cannot be undone.`:"",confirmLabel:"Delete",destructive:!0,loading:Ge!==null,onOpenChange:O=>{!O&&Ge===null&&Qe(null)},onConfirm:async()=>{if(!ge||ge.projectSlug===null){Qe(null);return}const O=Yt(ge);xt(O);try{const re=await fetch(`/api/projects/${encodeURIComponent(ge.projectSlug)}/assignments/${encodeURIComponent(ge.slug)}`,{method:"DELETE"});if(!re.ok){const xe=await re.json().catch(()=>({}));throw new Error(xe.error||"Failed to delete assignment")}Qe(null),d()}catch(re){alert(re instanceof Error?re.message:"Failed to delete assignment")}finally{xt(null)}}}),r.jsx(yg,{open:Kt!==null,onOpenChange:O=>{O||Bt(null)},currentWorkspace:(Kt==null?void 0:Kt.projectWorkspace)??null,title:"Move assignment to workspace",description:"Standalone assignments belong to a project-workspace via the workspaceGroup frontmatter field.",onSubmit:async O=>{if(!Kt)return;const re=await fetch(`/api/assignments/${encodeURIComponent(Kt.id)}/move-workspace`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({workspaceGroup:O})});if(!re.ok){const xe=await re.json().catch(()=>({}));throw new Error(xe.error||"Failed to move assignment")}d()}})]})}function $F(e,t){const n=[{key:"edit",label:"Edit",icon:zo,onSelect:t.onEdit}];return e.projectSlug!==null?n.push({key:"delete",label:"Delete",icon:In,destructive:!0,onSelect:t.onDelete}):n.push({key:"move",label:"Move to workspace…",icon:Bl,onSelect:t.onMove}),n}function Ww({assignment:e,dragging:t,transitioning:n,onPillSelect:s,onRenameTitle:i}){var p;const l=Wt(),c=e.projectSlug===null?`/assignments/${e.id}`:`${l}/projects/${e.projectSlug}/assignments/${e.slug}`,d=!!(s&&i);return r.jsxs("div",{className:"vp-card rounded-lg border border-border/60 bg-background/85 p-3 shadow-sm",children:[r.jsxs("div",{className:"flex items-start justify-between gap-3",children:[r.jsxs("div",{className:"min-w-0 flex-1 space-y-1",children:[d?r.jsx(RF,{title:e.title,detailHref:c,onSave:i,disabled:n}):r.jsx(Ee,{to:c,className:"text-base font-semibold text-foreground hover:text-primary",children:e.title}),r.jsx("p",{className:"text-sm text-muted-foreground",children:e.projectTitle??r.jsx("span",{className:"rounded bg-muted px-1.5 py-0.5 font-mono text-[10px] uppercase text-muted-foreground",children:"Standalone"})}),r.jsxs("p",{className:"inline-flex items-center gap-1.5 font-mono text-xs text-muted-foreground/70",title:e.id??"",children:[(p=e.id)==null?void 0:p.slice(0,8),e.id&&r.jsx(Tr,{value:e.id})]})]}),d?r.jsx(PF,{currentStatus:e.status,availableTransitions:e.availableTransitions,onSelect:s,disabled:n}):r.jsx(kn,{status:e.status})]}),e.blockedReason?r.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,r.jsxs("div",{className:"mt-4 flex flex-wrap gap-2",children:[r.jsx(ra,{type:e.type}),r.jsx("span",{className:"rounded-full border border-border/60 px-2.5 py-1 text-xs capitalize text-muted-foreground",children:e.priority}),r.jsx("span",{className:"rounded-full border border-border/60 px-2.5 py-1 text-xs text-muted-foreground",children:e.assignee??"Unassigned"}),r.jsxs("span",{className:"rounded-full border border-border/60 px-2.5 py-1 text-xs text-muted-foreground",children:[e.dependsOn.length," dependencies"]})]}),r.jsxs("div",{className:"mt-4 flex items-center justify-between gap-3 text-xs uppercase tracking-[0.08em] text-muted-foreground",children:[r.jsx("span",{children:n?"Updating":t?"Dragging":"Source-first"}),r.jsx("span",{children:pr(e.updated)})]})]})}function cl(e,t){return e.availableTransitions.find(n=>n.targetStatus===t)}function Yt(e){return e.id||e.slug||"unknown"}function Rr(e){const t=e.match(/^---\n([\s\S]*?)\n---\n?/);if(!t)return{order:[],blocks:new Map,body:e};const n=t[1],s=e.slice(t[0].length),i=n.split(`
|
|
529
|
+
`),l=[],c=new Map;let d=null,p=[];const m=()=>{d&&(l.push(d),c.set(d,p))};for(const h of i){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:s}}function pa(e){return`---
|
|
530
|
+
${e.order.map(n=>e.blocks.get(n)).filter(n=>!!n).flat().join(`
|
|
531
|
+
`)}
|
|
532
|
+
---
|
|
533
|
+
|
|
534
|
+
${e.body.replace(/^\n+/,"")}`}function un(e,t){const n=e.blocks.get(t);if(!(n!=null&&n[0]))return"";const s=n[0].match(/^[^:]+:\s*(.*)$/);if(!s)return"";const i=s[1].trim();return i==="null"?"":i.startsWith('"')&&i.endsWith('"')||i.startsWith("'")&&i.endsWith("'")?i.slice(1,-1):i}function LF(e,t){return un(e,t)==="true"}function kl(e,t){const n=e.blocks.get(t);return n!=null&&n.length?n[0].trim().endsWith("[]")?[]:n.slice(1).map(s=>s.trim()).filter(s=>s.startsWith("- ")).map(s=>s.slice(2).trim()):[]}function IF(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 dn(e,t,n){e.blocks.has(t)||e.order.push(t),e.blocks.set(t,[`${t}: ${IF(n)}`])}function Sl(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(s=>` - ${s}`)])}function Nl(e){return e.split(",").map(t=>t.trim()).filter(Boolean)}function Bd(e){const t=Rr(e);return{title:un(t,"title"),slug:un(t,"slug"),workspace:un(t,"workspace"),archived:LF(t,"archived"),archivedAt:un(t,"archivedAt"),archivedReason:un(t,"archivedReason"),tags:kl(t,"tags").join(", "),body:t.body}}function OF(e,t){const n=Rr(e),s={...Bd(e),...t};return dn(n,"title",s.title),dn(n,"slug",s.slug),dn(n,"workspace",s.workspace||null),dn(n,"archived",s.archived),dn(n,"archivedAt",s.archivedAt||null),dn(n,"archivedReason",s.archivedReason||null),Sl(n,"tags",Nl(s.tags)),n.body=s.body,pa(n)}function Ud(e){const t=Rr(e);return{title:un(t,"title"),slug:un(t,"slug"),status:un(t,"status"),priority:un(t,"priority")||"medium",assignee:un(t,"assignee"),dependsOn:kl(t,"dependsOn").join(", "),links:kl(t,"links").join(", "),blockedReason:un(t,"blockedReason"),tags:kl(t,"tags").join(", "),body:t.body}}function _F(e,t){const n=Rr(e),s={...Ud(e),...t};return dn(n,"title",s.title),dn(n,"slug",s.slug),dn(n,"status",s.status),dn(n,"priority",s.priority),dn(n,"assignee",s.assignee||null),Sl(n,"dependsOn",Nl(s.dependsOn)),Sl(n,"links",Nl(s.links)),dn(n,"blockedReason",s.blockedReason||null),Sl(n,"tags",Nl(s.tags)),n.body=s.body,pa(n)}function Hd(e){const t=Rr(e);return{assignment:un(t,"assignment"),status:un(t,"status"),body:t.body}}function MF(e,t){const n=Rr(e),s={...Hd(e),...t};return dn(n,"assignment",s.assignment),dn(n,"status",s.status),n.body=s.body,pa(n)}function Vd(e){const t=Rr(e);return{assignment:un(t,"assignment"),body:t.body}}function FF(e,t){const n=Rr(e),s={...Vd(e),...t};return dn(n,"assignment",s.assignment),n.body=s.body,pa(n)}function Wd(e){const t=Rr(e);return{name:un(t,"name"),slug:un(t,"slug"),description:un(t,"description"),whenToUse:un(t,"when_to_use"),tags:kl(t,"tags").join(", "),body:t.body}}function zF(e,t){const n=Rr(e),s={...Wd(e),...t};return dn(n,"name",s.name),dn(n,"slug",s.slug),dn(n,"description",s.description||null),dn(n,"when_to_use",s.whenToUse||null),Sl(n,"tags",Nl(s.tags)),n.body=s.body,pa(n)}function Qg(e){return{body:Rr(e).body}}function oN(e){return Qg(e)}function iN(e,t){const n=Rr(e);return t.body!==void 0&&(n.body=t.body),pa(n)}function BF(e,t){return iN(e,t)}function Tt(e,t,n){switch(e){case"project":return OF(t,n);case"assignment":return _F(t,n);case"plan":return MF(t,n);case"scratchpad":return FF(t,n);case"playbook":return zF(t,n);case"memory":return iN(t,n);case"resource":return BF(t,n);default:return t}}function ma({initialContent:e,documentType:t,mode:n="edit",onSave:s,saving:i,error:l,title:c,description:d,onCancel:p,helpTitle:m,helpBody:h,allowSlugEdit:x=!1}){const[y,v]=f.useState(e),[C,j]=f.useState(!1),[w,S]=f.useState("edit");f.useEffect(()=>{v(e)},[e]);const E=WF(t,y),N=y!==e,P=VF(t,y),I=N?"Unsaved changes":n==="create"?"Draft":"Saved",R=t!=="memory"&&t!=="resource";return r.jsxs("div",{className:"space-y-3",children:[r.jsxs("div",{className:"rounded-lg border border-border/70 bg-card/90 p-3 shadow-sm",children:[r.jsxs("div",{className:"flex flex-col gap-4 lg:flex-row lg:items-start lg:justify-between",children:[r.jsxs("div",{className:"space-y-2",children:[r.jsxs("div",{className:"flex items-center gap-3",children:[r.jsx("h1",{className:"text-lg font-semibold text-foreground",children:c}),r.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:I})]}),d?r.jsx("p",{className:"max-w-3xl text-sm leading-6 text-muted-foreground",children:d}):null]}),r.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[r.jsxs("button",{type:"button",onClick:p,className:"shell-action",children:[r.jsx(E0,{className:"h-4 w-4"}),r.jsx("span",{children:"Back"})]}),R?r.jsxs("button",{type:"button",onClick:()=>j($=>!$),className:"shell-action",children:[r.jsx(tT,{className:"h-4 w-4"}),r.jsx("span",{children:C?"Structured":"Raw Markdown"})]}):null,r.jsxs("button",{type:"button",onClick:()=>s(y),disabled:i||E.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:[r.jsx(od,{className:"h-4 w-4"}),r.jsx("span",{children:i?"Saving…":"Save"})]})]})]}),l?r.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,E.length>0?r.jsx("div",{className:"mt-4 rounded-md border border-warning-foreground/30 bg-warning px-4 py-3 text-sm text-warning-foreground",children:r.jsx("ul",{className:"space-y-1",children:E.map($=>r.jsx("li",{children:$},$))})}):null]}),r.jsxs("div",{className:"flex items-center gap-2 md:hidden",children:[r.jsx("button",{type:"button",onClick:()=>S("edit"),className:`shell-action ${w==="edit"?"bg-foreground text-background":""}`,children:"Edit"}),r.jsxs("button",{type:"button",onClick:()=>S("preview"),className:`shell-action ${w==="preview"?"bg-foreground text-background":""}`,children:[r.jsx(Ov,{className:"h-4 w-4"}),"Preview"]})]}),r.jsxs("div",{className:"grid gap-3 xl:grid-cols-[minmax(0,1.2fr)_minmax(320px,0.8fr)]",children:[r.jsx("div",{className:w==="preview"?"hidden md:block":"",children:r.jsx("div",{className:"surface-panel space-y-3",children:C?r.jsx("textarea",{value:y,onChange:$=>v($.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}):r.jsx(UF,{documentType:t,content:y,onChange:v,allowSlugEdit:x})})}),r.jsx("div",{className:w==="edit"?"hidden md:block":"",children:r.jsxs("div",{className:"surface-panel sticky top-16 space-y-4",children:[r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx(Ov,{className:"h-4 w-4 text-muted-foreground"}),r.jsx("h2",{className:"text-lg font-semibold text-foreground",children:"Preview"})]}),r.jsx(en,{content:P,emptyState:"Write markdown body content to preview it here."})]})})]})]})}function UF({documentType:e,content:t,onChange:n,allowSlugEdit:s}){if(e==="project"){const l=Bd(t);return r.jsxs("div",{className:"space-y-3",children:[r.jsxs(ul,{children:[r.jsx(vt,{label:"Project title",children:r.jsx("input",{value:l.title,onChange:c=>{const d=c.target.value,p={title:d};s&&(l.slug===lr(l.title)||!l.slug.trim())&&(p.slug=lr(d)),n(Tt(e,t,p))},className:"editor-input"})}),r.jsx(vt,{label:"Slug",children:r.jsxs("div",{className:"space-y-2",children:[r.jsx("input",{value:l.slug,disabled:!s,onChange:c=>n(Tt(e,t,{slug:lr(c.target.value)})),className:`editor-input ${s?"":"editor-input-disabled"}`}),r.jsx("p",{className:"text-xs leading-5 text-muted-foreground",children:s?"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."})]})}),r.jsx(vt,{label:"Tags",children:r.jsx("input",{value:l.tags,onChange:c=>n(Tt(e,t,{tags:c.target.value})),placeholder:"Comma-separated tags",className:"editor-input"})}),r.jsx(HF,{value:l.workspace,onChange:c=>n(Tt(e,t,{workspace:c}))})]}),r.jsx(vt,{label:"Project body",children:r.jsx("textarea",{value:l.body,onChange:c=>n(Tt(e,t,{body:c.target.value})),className:"editor-textarea",spellCheck:!1})})]})}if(e==="assignment"){const l=Ud(t);return r.jsxs("div",{className:"space-y-3",children:[r.jsxs(ul,{children:[r.jsx(vt,{label:"Assignment title",children:r.jsx("input",{value:l.title,onChange:c=>{const d=c.target.value,p={title:d};s&&(l.slug===lr(l.title)||!l.slug.trim())&&(p.slug=lr(d)),n(Tt(e,t,p))},className:"editor-input"})}),r.jsx(vt,{label:"Slug",children:r.jsxs("div",{className:"space-y-2",children:[r.jsx("input",{value:l.slug,disabled:!s,onChange:c=>n(Tt(e,t,{slug:lr(c.target.value)})),className:`editor-input ${s?"":"editor-input-disabled"}`}),r.jsx("p",{className:"text-xs leading-5 text-muted-foreground",children:s?"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."})]})}),r.jsx(vt,{label:"Status",children:r.jsxs("select",{value:l.status,onChange:c=>n(Tt(e,t,{status:c.target.value})),className:"editor-input",children:[r.jsx("option",{value:"pending",children:"Pending"}),r.jsx("option",{value:"in_progress",children:"In Progress"}),r.jsx("option",{value:"blocked",children:"Blocked"}),r.jsx("option",{value:"review",children:"Review"}),r.jsx("option",{value:"completed",children:"Completed"}),r.jsx("option",{value:"failed",children:"Failed"})]})}),r.jsx(vt,{label:"Priority",children:r.jsxs("select",{value:l.priority,onChange:c=>n(Tt(e,t,{priority:c.target.value})),className:"editor-input",children:[r.jsx("option",{value:"low",children:"Low"}),r.jsx("option",{value:"medium",children:"Medium"}),r.jsx("option",{value:"high",children:"High"}),r.jsx("option",{value:"critical",children:"Critical"})]})}),r.jsx(vt,{label:"Assignee",children:r.jsx("input",{value:l.assignee,onChange:c=>n(Tt(e,t,{assignee:c.target.value})),placeholder:"Agent name",className:"editor-input"})}),r.jsx(vt,{label:"Depends on",className:"md:col-span-2",children:r.jsx("input",{value:l.dependsOn,onChange:c=>n(Tt(e,t,{dependsOn:c.target.value})),placeholder:"Comma-separated assignment slugs",className:"editor-input"})}),r.jsx(vt,{label:"Links",className:"md:col-span-2",children:r.jsx("input",{value:l.links,onChange:c=>n(Tt(e,t,{links:c.target.value})),placeholder:"Comma-separated: projectSlug/assignmentSlug",className:"editor-input"})}),r.jsx(vt,{label:"Blocked reason",className:"md:col-span-2",children:r.jsx("input",{value:l.blockedReason,onChange:c=>n(Tt(e,t,{blockedReason:c.target.value})),placeholder:"Read-only unless the assignment is actually blocked",className:"editor-input"})}),r.jsx(vt,{label:"Tags",className:"md:col-span-2",children:r.jsx("input",{value:l.tags,onChange:c=>n(Tt(e,t,{tags:c.target.value})),placeholder:"Comma-separated tags",className:"editor-input"})})]}),r.jsx(vt,{label:"Assignment body",children:r.jsx("textarea",{value:l.body,onChange:c=>n(Tt(e,t,{body:c.target.value})),className:"editor-textarea",spellCheck:!1})})]})}if(e==="plan"){const l=Hd(t);return r.jsxs("div",{className:"space-y-3",children:[r.jsxs(ul,{children:[r.jsx(vt,{label:"Assignment",children:r.jsx("input",{value:l.assignment,disabled:!0,className:"editor-input editor-input-disabled"})}),r.jsx(vt,{label:"Plan status",children:r.jsxs("select",{value:l.status,onChange:c=>n(Tt(e,t,{status:c.target.value})),className:"editor-input",children:[r.jsx("option",{value:"draft",children:"Draft"}),r.jsx("option",{value:"approved",children:"Approved"}),r.jsx("option",{value:"in_progress",children:"In Progress"}),r.jsx("option",{value:"completed",children:"Completed"})]})})]}),r.jsx(vt,{label:"Plan body",children:r.jsx("textarea",{value:l.body,onChange:c=>n(Tt(e,t,{body:c.target.value})),className:"editor-textarea",spellCheck:!1})})]})}if(e==="scratchpad"){const l=Vd(t);return r.jsxs("div",{className:"space-y-3",children:[r.jsx(ul,{children:r.jsx(vt,{label:"Assignment",children:r.jsx("input",{value:l.assignment,disabled:!0,className:"editor-input editor-input-disabled"})})}),r.jsx(vt,{label:"Scratchpad body",children:r.jsx("textarea",{value:l.body,onChange:c=>n(Tt(e,t,{body:c.target.value})),className:"editor-textarea",spellCheck:!1})})]})}if(e==="memory"||e==="resource"){const l=e==="memory"?Qg(t):oN(t),c=e==="memory"?"Memory body":"Resource body";return r.jsxs("div",{className:"space-y-3",children:[r.jsx(vt,{label:c,children:r.jsx("textarea",{value:l.body,onChange:d=>n(Tt(e,t,{body:d.target.value})),className:"editor-textarea",spellCheck:!1})}),r.jsx("p",{className:"text-xs text-muted-foreground/80",children:"Frontmatter (name, scope/category, source, related assignments, tags) is preserved server-side on save."})]})}const i=Wd(t);return r.jsxs("div",{className:"space-y-3",children:[r.jsxs(ul,{children:[r.jsx(vt,{label:"Playbook name",children:r.jsx("input",{value:i.name,onChange:l=>{const c=l.target.value,d={name:c};s&&(i.slug===lr(i.name)||!i.slug.trim())&&(d.slug=lr(c)),n(Tt(e,t,d))},className:"editor-input"})}),r.jsx(vt,{label:"Slug",children:r.jsxs("div",{className:"space-y-2",children:[r.jsx("input",{value:i.slug,disabled:!s,onChange:l=>n(Tt(e,t,{slug:lr(l.target.value)})),className:`editor-input ${s?"":"editor-input-disabled"}`}),r.jsx("p",{className:"text-xs leading-5 text-muted-foreground",children:s?"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."})]})}),r.jsx(vt,{label:"Description",className:"md:col-span-2",children:r.jsx("input",{value:i.description,onChange:l=>n(Tt(e,t,{description:l.target.value})),placeholder:"One-line description of what this playbook does",className:"editor-input"})}),r.jsx(vt,{label:"Tags",className:"md:col-span-2",children:r.jsx("input",{value:i.tags,onChange:l=>n(Tt(e,t,{tags:l.target.value})),placeholder:"Comma-separated tags",className:"editor-input"})}),r.jsx(vt,{label:"When to use",className:"md:col-span-2",children:r.jsx("input",{value:i.whenToUse,onChange:l=>n(Tt(e,t,{whenToUse:l.target.value})),placeholder:"Describe when agents should apply this playbook",className:"editor-input"})})]}),r.jsx(vt,{label:"Playbook rules",children:r.jsx("textarea",{value:i.body,onChange:l=>n(Tt(e,t,{body:l.target.value})),className:"editor-textarea",spellCheck:!1})})]})}function ul({children:e}){return r.jsx("div",{className:"grid gap-4 md:grid-cols-2",children:e})}function vt({label:e,children:t,className:n}){return r.jsxs("label",{className:`block space-y-2 ${n??""}`,children:[r.jsx("span",{className:"text-sm font-medium text-foreground",children:e}),t]})}function HF({value:e,onChange:t}){const{data:n}=id(),s=(n==null?void 0:n.workspaces)??[];return r.jsx(vt,{label:"Workspace",children:r.jsxs("select",{value:e,onChange:i=>t(i.target.value),className:"editor-input",children:[r.jsx("option",{value:"",children:"Ungrouped"}),s.map(i=>r.jsx("option",{value:i,children:i},i))]})})}function VF(e,t){switch(e){case"project":return Bd(t).body;case"assignment":return Ud(t).body;case"plan":return Hd(t).body;case"scratchpad":return Vd(t).body;case"playbook":return Wd(t).body;case"memory":return Qg(t).body;case"resource":return oN(t).body}}function WF(e,t){switch(e){case"project":{const n=Bd(t);return[n.title.trim()?null:"Project title is required.",n.slug.trim()?null:"Project slug is required.",n.slug.trim()&&!ku(n.slug)?"Project slug must be lowercase letters, numbers, and hyphens only.":null].filter(s=>!!s)}case"assignment":{const n=Ud(t);return[n.title.trim()?null:"Assignment title is required.",n.slug.trim()?null:"Assignment slug is required.",n.slug.trim()&&!ku(n.slug)?"Assignment slug must be lowercase letters, numbers, and hyphens only.":null].filter(s=>!!s)}case"plan":return Hd(t).assignment.trim()?[]:["Plan assignment is required."];case"scratchpad":return Vd(t).assignment.trim()?[]:["Scratchpad assignment is required."];case"playbook":{const n=Wd(t);return[n.name.trim()?null:"Playbook name is required.",n.slug.trim()?null:"Playbook slug is required.",n.slug.trim()&&!ku(n.slug)?"Playbook slug must be lowercase letters, numbers, and hyphens only.":null].filter(s=>!!s)}case"memory":case"resource":return[]}}function Kw(){const e=Rt(),{workspace:t}=At(),n=Wt(),[s,i]=f.useState(null),[l,c]=f.useState(!0),[d,p]=f.useState(!1),[m,h]=f.useState(null);f.useEffect(()=>{fetch("/api/templates/project").then(y=>y.json()).then(y=>{let v=y.content;t&&t!=="_ungrouped"&&(v=v.replace(/^(tags: \[\])$/m,`$1
|
|
535
|
+
workspace: ${t}`)),i(v),c(!1)}).catch(y=>{h(y.message),c(!1)})},[t]);async function x(y){p(!0),h(null);try{const v=await fetch("/api/projects",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({content:y})}),C=await v.json();if(!v.ok){h(C.error||`HTTP ${v.status}`),p(!1);return}e(`${n}/projects/${C.slug}`)}catch(v){h(v.message),p(!1);return}p(!1)}return l?r.jsx(ct,{label:"Loading project template…"}):m&&!s?r.jsx(mt,{error:m}):r.jsx(ma,{initialContent:s||"",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 qw(){const{slug:e}=At(),t=Wt(),n=Rt(),[s,i]=f.useState(null),[l,c]=f.useState(!0),[d,p]=f.useState(!1),[m,h]=f.useState(null);f.useEffect(()=>{fetch("/api/templates/assignment").then(y=>y.json()).then(y=>{i(y.content),c(!1)}).catch(y=>{h(y.message),c(!1)})},[]);async function x(y){if(!e){h("Project slug is required.");return}p(!0),h(null);try{const v=await fetch(`/api/projects/${e}/assignments`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({content:y})}),C=await v.json();if(!v.ok){h(C.error||`HTTP ${v.status}`),p(!1);return}n(`${t}/projects/${e}/assignments/${C.slug}`)}catch(v){h(v.message),p(!1);return}p(!1)}return l?r.jsx(ct,{label:"Loading assignment template…"}):m&&!s?r.jsx(mt,{error:m}):r.jsx(ma,{initialContent:s||"",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 Gw(){const{workspace:e}=At(),t=Wt(),n=Rt(),[s,i]=f.useState(null),[l,c]=f.useState(!0),[d,p]=f.useState(!1),[m,h]=f.useState(null);f.useEffect(()=>{const y=new URLSearchParams({standalone:"1"});e&&y.set("workspace",e),fetch(`/api/templates/assignment?${y.toString()}`).then(v=>v.json()).then(v=>{i(v.content),c(!1)}).catch(v=>{h(v.message),c(!1)})},[e]);async function x(y){var v;p(!0),h(null);try{const C=await fetch("/api/assignments",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({content:y})}),j=await C.json();if(!C.ok){h(j.error||`HTTP ${C.status}`),p(!1);return}const w=(v=j==null?void 0:j.assignment)==null?void 0:v.id;if(!w){h("Server did not return the new assignment id."),p(!1);return}n(`/assignments/${w}`)}catch(C){h(C.message),p(!1);return}p(!1)}return l?r.jsx(ct,{label:"Loading assignment template…"}):m&&!s?r.jsx(mt,{error:m}):r.jsx(ma,{initialContent:s||"",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 ha({loadUrl:e,saveUrl:t,redirectTo:n,title:s,description:i,documentType:l,helpTitle:c,helpBody:d}){const p=Rt(),{data:m,loading:h,error:x}=ij(e),[y,v]=f.useState(!1),[C,j]=f.useState(null);async function w(S){v(!0),j(null);try{const E=await fetch(t,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({content:S})}),N=await E.json();if(!E.ok){j(N.error||`HTTP ${E.status}`),v(!1);return}p(n)}catch(E){j(E.message),v(!1);return}v(!1)}return h?r.jsx(ct,{label:`Loading ${s.toLowerCase()}…`}):x||!m?r.jsx(mt,{error:x||`${s} is unavailable.`}):r.jsx(ma,{initialContent:m.content,documentType:l,onSave:w,saving:y,error:C,title:s,description:i,onCancel:()=>p(n),helpTitle:c,helpBody:d})}function Yw(){const{slug:e}=At(),t=Wt(),n=e??"";return r.jsx(ha,{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 jm(){const{slug:e,aslug:t,id:n}=At(),s=Wt(),i=!!n,l=i?`/api/assignments/${n}/edit`:`/api/projects/${e}/assignments/${t}/edit`,c=i?`/api/assignments/${n}`:`/api/projects/${e}/assignments/${t}`,d=i?`/assignments/${n}`:`${s}/projects/${e}/assignments/${t}`;return r.jsx(ha,{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 km(){const{slug:e,aslug:t,id:n}=At(),s=Wt(),i=!!n,l=i?`/api/assignments/${n}/plan/edit`:`/api/projects/${e}/assignments/${t}/plan/edit`,c=i?`/api/assignments/${n}/plan`:`/api/projects/${e}/assignments/${t}/plan`,d=i?`/assignments/${n}?tab=plan`:`${s}/projects/${e}/assignments/${t}?tab=plan`;return r.jsx(ha,{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 Sm(){const{slug:e,aslug:t,id:n}=At(),s=Wt(),i=!!n,l=i?`/api/assignments/${n}/scratchpad/edit`:`/api/projects/${e}/assignments/${t}/scratchpad/edit`,c=i?`/api/assignments/${n}/scratchpad`:`/api/projects/${e}/assignments/${t}/scratchpad`,d=i?`/assignments/${n}?tab=scratchpad`:`${s}/projects/${e}/assignments/${t}?tab=scratchpad`;return r.jsx(ha,{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 aN({loadUrl:e,saveUrl:t,redirectTo:n,title:s,description:i,helpTitle:l,helpBody:c}){const d=Rt(),{data:p,loading:m,error:h}=ij(e),[x,y]=f.useState(""),[v,C]=f.useState(""),[j,w]=f.useState(!1),[S,E]=f.useState(null);async function N(){w(!0),E(null);try{const P=await fetch(t,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({title:x,body:v})}),I=await P.json();if(!P.ok){E(I.error||`HTTP ${P.status}`),w(!1);return}d(n)}catch(P){E(P.message),w(!1);return}w(!1)}return m?r.jsx(ct,{label:`Loading ${s.toLowerCase()}…`}):h||!p?r.jsx(mt,{error:h||`${s} is unavailable.`}):r.jsxs("div",{className:"space-y-4",children:[r.jsx(Ue,{title:s,description:i,children:r.jsxs("div",{className:"space-y-4",children:[r.jsxs("label",{className:"block space-y-2",children:[r.jsx("span",{className:"text-sm font-medium text-foreground",children:"Entry title"}),r.jsx("input",{value:x,onChange:P=>y(P.target.value),placeholder:"Optional title",className:"editor-input"})]}),r.jsxs("label",{className:"block space-y-2",children:[r.jsx("span",{className:"text-sm font-medium text-foreground",children:"Entry body"}),r.jsx("textarea",{value:v,onChange:P=>C(P.target.value),className:"editor-textarea",spellCheck:!1})]}),S?r.jsx("p",{className:"rounded-md border border-error-foreground/30 bg-error px-4 py-3 text-sm text-error-foreground",children:S}):null,r.jsxs("div",{className:"flex flex-wrap gap-2",children:[r.jsx("button",{type:"button",onClick:()=>d(n),className:"shell-action",children:"Cancel"}),r.jsx("button",{type:"button",onClick:N,disabled:j||!v.trim(),className:"shell-action bg-foreground text-background hover:opacity-90 disabled:cursor-not-allowed disabled:opacity-50",children:j?"Appending…":"Append Entry"})]})]})}),r.jsx(Ue,{title:"Current Document",children:r.jsx(en,{content:p.content.replace(/^---[\s\S]*?---\n?/,""),emptyState:"No existing content."})})]})}function Nm(){const{slug:e,aslug:t,id:n}=At(),s=Wt(),i=!!n,l=i?`/api/assignments/${n}/handoff/edit`:`/api/projects/${e}/assignments/${t}/handoff/edit`,c=i?`/api/assignments/${n}/handoff/entries`:`/api/projects/${e}/assignments/${t}/handoff/entries`,d=i?`/assignments/${n}?tab=handoff`:`${s}/projects/${e}/assignments/${t}?tab=handoff`;return r.jsx(aN,{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 Cm(){const{slug:e,aslug:t,id:n}=At(),s=Wt(),i=!!n,l=i?`/api/assignments/${n}/decision-record/edit`:`/api/projects/${e}/assignments/${t}/decision-record/edit`,c=i?`/api/assignments/${n}/decision-record/entries`:`/api/projects/${e}/assignments/${t}/decision-record/entries`,d=i?`/assignments/${n}?tab=decisions`:`${s}/projects/${e}/assignments/${t}?tab=decisions`;return r.jsx(aN,{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 Jw(){const{workspace:e}=At(),{data:t}=Zi(),{data:n,loading:s,error:i,refetch:l}=Lh(),[c,d]=f.useState(!1),[p,m]=f.useState(""),[h,x]=f.useState(!1),y=Ln();f.useEffect(()=>{const E=y.hash.match(/^#server-(.+)/);if(!E)return;const N=decodeURIComponent(E[1]),P=document.querySelector(`[data-server-name="${window.CSS.escape(N)}"]`);if(!P)return;P.scrollIntoView({block:"nearest"}),P.classList.add("ring-2","ring-primary/60");const I=window.setTimeout(()=>P.classList.remove("ring-2","ring-primary/60"),1500);return()=>window.clearTimeout(I)},[y.hash,n]);const v=(()=>{if(!e||!n)return(n==null?void 0:n.sessions)??[];if(!t)return[];const E=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(P=>P.panes.some(I=>I.assignment&&I.assignment.project!==null&&E.has(I.assignment.project))))})();async function C(E){if(E.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 j(){x(!0);try{await fetch("/api/servers/refresh",{method:"POST"}),l()}finally{x(!1)}}async function w(E){await fetch(`/api/servers/${encodeURIComponent(E)}`,{method:"DELETE"}),l()}async function S(E){await fetch(`/api/servers/${encodeURIComponent(E)}/refresh`,{method:"POST"}),l()}return s?r.jsx(ct,{label:"Loading servers…"}):i?r.jsx(mt,{error:i}):n?n.tmuxAvailable?r.jsxs(r.Fragment,{children:[r.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[c?r.jsxs("form",{onSubmit:C,className:"flex items-center gap-2",children:[r.jsx("input",{type:"text",value:p,onChange:E=>m(E.target.value),placeholder:"tmux session name",className:"editor-input text-sm",autoFocus:!0}),r.jsx("button",{type:"submit",className:"shell-action",children:"Add"}),r.jsx("button",{type:"button",className:"shell-action",onClick:()=>d(!1),children:"Cancel"})]}):r.jsxs("button",{className:"shell-action",onClick:()=>d(!0),children:[r.jsx(Jt,{className:"h-3.5 w-3.5"}),"Track Session"]}),r.jsxs("button",{className:"shell-action",onClick:j,disabled:h,children:[r.jsx(I0,{className:`h-3.5 w-3.5 ${h?"animate-spin":""}`}),"Refresh All"]})]}),v.length===0?r.jsx(pt,{title:"No sessions tracked",description:"Register a tmux session to start tracking your dev servers."}):r.jsx("div",{className:"mt-4 space-y-4",children:v.map(E=>r.jsx(KF,{session:E,onRefresh:()=>S(E.name),onRemove:()=>w(E.name),onRefetch:l},E.name))})]}):r.jsx(r.Fragment,{children:r.jsxs("div",{className:"surface-panel mt-4 flex flex-col items-center gap-3 py-12 text-center",children:[r.jsx($i,{className:"h-10 w-10 text-muted-foreground/40"}),r.jsx("p",{className:"text-sm font-medium text-foreground",children:"tmux is not installed"}),r.jsxs("p",{className:"max-w-md text-sm text-muted-foreground",children:["Server tracking requires tmux. Install it with ",r.jsx("code",{className:"rounded bg-muted px-1.5 py-0.5 text-xs",children:"brew install tmux"})," to get started."]})]})}):null}function KF({session:e,onRefresh:t,onRemove:n,onRefetch:s}){return r.jsxs("div",{className:"surface-panel","data-server-name":e.name,children:[r.jsxs("div",{className:"flex items-center justify-between",children:[r.jsxs("div",{className:"flex items-center gap-3",children:[r.jsx(Ch,{className:"h-4 w-4 text-muted-foreground"}),r.jsx("span",{className:"text-sm font-semibold text-foreground",children:e.name}),r.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"}),r.jsxs("span",{className:"text-xs text-muted-foreground",children:["Last refreshed: ",new Date(e.lastRefreshed).toLocaleString()]})]}),r.jsxs("div",{className:"flex items-center gap-1",children:[r.jsx("button",{className:"shell-action",onClick:t,title:"Refresh",children:r.jsx(I0,{className:"h-3.5 w-3.5"})}),r.jsx("button",{className:"shell-action",onClick:n,title:"Remove",children:r.jsx(In,{className:"h-3.5 w-3.5"})})]})]}),e.alive&&e.windows.length>0&&r.jsx("div",{className:"mt-3 space-y-3",children:e.windows.map(i=>r.jsxs("div",{children:[r.jsxs("p",{className:"mb-1.5 text-xs font-medium uppercase tracking-wider text-muted-foreground",children:["Window ",i.index,": ",i.name]}),r.jsx("div",{className:"space-y-1.5",children:i.panes.map(l=>r.jsx(qF,{pane:l,sessionName:e.name,windowIndex:i.index,onRefetch:s},`${i.index}:${l.index}`))})]},i.index))}),!e.alive&&r.jsxs("div",{className:"mt-3 flex items-center gap-2 text-sm text-muted-foreground",children:[r.jsx(xT,{className:"h-4 w-4"}),r.jsx("span",{children:e.kind==="process"?"Process no longer running":"Session no longer exists"})]})]})}function qF({pane:e,sessionName:t,windowIndex:n,onRefetch:s}){const i=Wt(),l=e.cwd.replace(/^\/Users\/[^/]+/,"~");return r.jsxs("div",{className:"flex items-center gap-3 rounded-md border border-border/40 bg-background/60 px-3 py-2 text-sm",children:[r.jsxs("span",{className:"shrink-0 font-mono text-xs text-muted-foreground/60",children:[":",e.index]}),r.jsx("span",{className:"shrink-0 rounded bg-muted/60 px-1.5 py-0.5 font-mono text-xs",children:e.command}),r.jsxs("span",{className:"inline-flex min-w-0 items-center gap-1.5 text-xs text-muted-foreground",children:[r.jsx("span",{className:"block min-w-0 truncate",title:e.cwd,children:l}),r.jsx(Tr,{value:e.cwd})]}),e.branch&&r.jsxs("span",{className:"flex shrink-0 items-center gap-1 text-xs text-muted-foreground",children:[r.jsx(kh,{className:"h-3 w-3"}),e.branch,e.worktree&&r.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&&r.jsx("div",{className:"flex shrink-0 items-center gap-1.5",children:e.urls.map(c=>r.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:",":"),r.jsx(Xi,{className:"h-2.5 w-2.5"})]},c))}),r.jsx("div",{className:"ml-auto shrink-0",children:e.assignment?r.jsxs(Ee,{to:e.assignment.project===null?`/assignments/${e.assignment.slug}`:`${i}/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:[r.jsx(lT,{className:"h-2.5 w-2.5"}),e.assignment.title,e.assignment.project===null?r.jsx("span",{className:"ml-1 rounded bg-muted px-1 py-0.5 text-[9px] uppercase tracking-wide text-muted-foreground",children:"Standalone"}):null]}):r.jsx("span",{className:"text-xs text-muted-foreground/40",children:"unlinked"})})]})}function lN(e){return e<60?`${e}s`:e<3600?`${Math.round(e/60)}m`:e<86400?`${Math.round(e/3600)}h`:`${Math.round(e/86400)}d`}function GF(e,t){const n=Date.parse(e),s=Math.floor((n-t)/1e3);return Number.isNaN(s)?"–":s<=0?"expired":lN(s)}function YF(e){switch(e){case"idle":return"bg-green-500/15 text-green-400 border-green-500/30";case"leased":return"bg-amber-500/15 text-amber-400 border-amber-500/30";case"retired":return"bg-zinc-500/15 text-zinc-400 border-zinc-500/30"}}function JF(e){if(!e)return null;try{return JSON.parse(e)}catch{return null}}function Xw(){const{data:e,loading:t,error:n,refetch:s}=aj(),[i,l]=f.useState(()=>Date.now()),[c,d]=f.useState(null),[p,m]=f.useState(!1);if(f.useEffect(()=>{const x=window.setInterval(()=>l(Date.now()),1e3);return()=>window.clearInterval(x)},[]),t)return r.jsx(ct,{label:"Loading inventories…"});if(n)return r.jsx(mt,{title:"Could not load inventories",error:n,action:r.jsx("button",{type:"button",onClick:s,className:"rounded border px-3 py-1 text-sm",children:"Retry"})});if(!e||e.inventories.length===0)return r.jsx(pt,{title:"No inventories yet",description:"Create one with `syntaur lease create-inventory <slug> --kind <kind>`, then add members with `syntaur lease member add <slug> <id>`."});async function h(){if(c){m(!0);try{const x=await fetch(`/api/leases/${encodeURIComponent(c.slug)}/force-release/${encodeURIComponent(c.lease.lease_id)}`,{method:"POST"});if(!x.ok){const y=await x.json().catch(()=>null);throw new Error((y==null?void 0:y.error)??`HTTP ${x.status}`)}s(),d(null)}catch(x){window.alert(x instanceof Error?`Force release failed: ${x.message}`:"Force release failed")}finally{m(!1)}}}return r.jsxs("div",{className:"space-y-6",children:[r.jsx("div",{className:"flex items-start justify-between",children:r.jsxs("div",{children:[r.jsx("h1",{className:"text-2xl font-semibold",children:"Inventories"}),r.jsx("p",{className:"mt-1 text-sm text-muted-foreground",children:"Claimable shared resources (dev envs, test DBs, named locks, …). Global in v1 — the same set appears on every workspace."})]})}),r.jsx("div",{className:"grid gap-4",children:e.inventories.map(x=>r.jsx(XF,{detail:x,now:i,onForceRelease:y=>d({slug:x.inventory.slug,lease:y})},x.inventory.slug))}),r.jsx(fa,{open:c!==null,title:"Force release this lease?",description:c?`This will revoke lease ${c.lease.lease_id} and (if it's still the current holder) free member ${c.lease.member_id}. Any agent still using this lease will see a stale-lease error on its next CLI call.`:"",confirmLabel:"Force release",destructive:!0,loading:p,onConfirm:h,onOpenChange:x=>{x||d(null)}})]})}function XF({detail:e,now:t,onForceRelease:n}){const{inventory:s,members:i,active_leases:l}=e,c=i.filter(p=>p.status==="idle").length,d=i.filter(p=>p.status==="leased").length;return r.jsxs("div",{className:"rounded-lg border bg-card p-4",children:[r.jsxs("div",{className:"flex items-start justify-between",children:[r.jsxs("div",{children:[r.jsxs("h2",{className:"text-lg font-semibold",children:[r.jsx(rd,{className:"mr-2 inline h-4 w-4 text-muted-foreground"}),s.display_name??s.slug]}),r.jsxs("p",{className:"mt-0.5 text-xs text-muted-foreground",children:[r.jsx("code",{className:"font-mono",children:s.slug})," · kind=",s.kind," · default TTL=",lN(s.default_ttl_s)]})]}),r.jsx("div",{className:"text-right text-xs text-muted-foreground",children:r.jsxs("div",{children:[c," idle · ",d," leased · ",i.length," total"]})})]}),r.jsx("div",{className:"mt-4 grid gap-2 sm:grid-cols-2 lg:grid-cols-3",children:i.map(p=>r.jsx(QF,{member:p},p.member_id))}),l.length>0&&r.jsxs("div",{className:"mt-4",children:[r.jsx("h3",{className:"text-xs font-semibold uppercase tracking-wide text-muted-foreground",children:"Active leases"}),r.jsx("div",{className:"mt-2 space-y-2",children:l.map(p=>r.jsx(ZF,{lease:p,now:t,onForceRelease:()=>n(p)},p.lease_id))})]})]})}function QF({member:e}){const t=JF(e.metadata_json);return r.jsxs("div",{className:"rounded-md border bg-muted/40 px-3 py-2 text-sm",children:[r.jsxs("div",{className:"flex items-center justify-between",children:[r.jsx("span",{className:"font-mono",children:e.member_id}),r.jsx("span",{className:`rounded border px-1.5 py-0.5 text-xs ${YF(e.status)}`,children:e.status})]}),t&&r.jsx("div",{className:"mt-1 text-xs text-muted-foreground",children:Object.entries(t).map(([n,s])=>r.jsxs("div",{className:"truncate",children:[r.jsx("span",{className:"font-mono",children:n}),"=",r.jsx("span",{className:"font-mono",children:String(s)})]},n))})]})}function ZF({lease:e,now:t,onForceRelease:n}){return r.jsxs("div",{className:"flex items-center justify-between rounded border bg-muted/20 px-3 py-2 text-sm",children:[r.jsx("div",{className:"min-w-0 flex-1",children:r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsxs("span",{className:"font-mono text-xs text-muted-foreground",children:[e.lease_id.slice(0,8),"…"]}),r.jsx("span",{className:"font-mono",children:e.member_id}),e.requested_for&&r.jsxs("span",{className:"text-xs text-muted-foreground",children:["for ",e.requested_for]})]})}),r.jsxs("div",{className:"ml-3 flex items-center gap-3",children:[r.jsxs("span",{className:"flex items-center gap-1 text-xs text-muted-foreground",children:[r.jsx(J2,{className:"h-3 w-3"}),GF(e.expires_at,t)]}),r.jsxs("button",{type:"button",onClick:n,className:"flex items-center gap-1 rounded border border-destructive/40 px-2 py-1 text-xs text-destructive hover:bg-destructive/10",children:[r.jsx(vT,{className:"h-3 w-3"}),"Force release"]})]})]})}function e6(){return new Date(Date.now()-720*60*60*1e3).toISOString().slice(0,10)}function t6(){return new Date().toISOString().slice(0,10)}function Qw(e){return e.toLocaleString("en-US")}function Zw(e){return`$${e.toFixed(4)}`}function e0(){const[e,t]=f.useState(e6()),[n,s]=f.useState(t6()),[i,l]=f.useState(""),[c,d]=f.useState("project"),[p,m]=f.useState(null),[h,x]=f.useState(!0),[y,v]=f.useState(null),[C,j]=f.useState([]);return f.useEffect(()=>{const w=new AbortController;x(!0),v(null);const S=new URLSearchParams({since:e,until:n,groupBy:c});return i&&S.set("project",i),fetch(`/api/usage?${S.toString()}`,{signal:w.signal}).then(E=>{if(!E.ok)throw new Error(`HTTP ${E.status}`);return E.json()}).then(E=>{if(m(E),!i){const N=new Set;for(const P of E.daily)P.project_slug&&N.add(P.project_slug);j([...N].sort())}x(!1)}).catch(E=>{E instanceof Error&&E.name==="AbortError"||(v(E instanceof Error?E.message:String(E)),x(!1))}),()=>{w.abort()}},[e,n,i,c]),r.jsxs("div",{className:"p-6 max-w-7xl mx-auto",children:[r.jsxs("header",{className:"flex items-center gap-3 mb-6",children:[r.jsx(jh,{className:"w-6 h-6 text-amber-400"}),r.jsx("h1",{className:"text-2xl font-semibold",children:"Token usage"})]}),r.jsxs("div",{className:"flex flex-wrap gap-4 items-end mb-6 p-4 rounded-lg bg-zinc-900/50 border border-zinc-800",children:[r.jsxs("label",{className:"flex flex-col gap-1 text-sm",children:[r.jsx("span",{className:"text-zinc-400",children:"Since"}),r.jsx("input",{type:"date",value:e,onChange:w=>t(w.target.value),className:"bg-zinc-950 border border-zinc-700 rounded px-2 py-1 text-sm"})]}),r.jsxs("label",{className:"flex flex-col gap-1 text-sm",children:[r.jsx("span",{className:"text-zinc-400",children:"Until"}),r.jsx("input",{type:"date",value:n,onChange:w=>s(w.target.value),className:"bg-zinc-950 border border-zinc-700 rounded px-2 py-1 text-sm"})]}),r.jsxs("label",{className:"flex flex-col gap-1 text-sm",children:[r.jsx("span",{className:"text-zinc-400",children:"Project"}),r.jsxs("select",{value:i,onChange:w=>l(w.target.value),className:"bg-zinc-950 border border-zinc-700 rounded px-2 py-1 text-sm",children:[r.jsx("option",{value:"",children:"All"}),C.map(w=>r.jsx("option",{value:w,children:w},w))]})]}),r.jsxs("label",{className:"flex flex-col gap-1 text-sm",children:[r.jsx("span",{className:"text-zinc-400",children:"Group by"}),r.jsxs("select",{value:c,onChange:w=>d(w.target.value),className:"bg-zinc-950 border border-zinc-700 rounded px-2 py-1 text-sm",children:[r.jsx("option",{value:"project",children:"Project"}),r.jsx("option",{value:"assignment",children:"Assignment"})]})]})]}),h&&r.jsx("p",{className:"text-zinc-400",children:"Loading…"}),y&&r.jsxs("p",{className:"text-red-400",children:["Error: ",y]}),p&&!h&&!y&&r.jsxs(r.Fragment,{children:[r.jsxs("section",{className:"mb-8",children:[r.jsx("h2",{className:"text-lg font-medium mb-2",children:"Summary"}),p.summary.length===0?r.jsxs("p",{className:"text-zinc-500 text-sm",children:["No usage data in this window. Run"," ",r.jsx("code",{className:"bg-zinc-800 px-1 py-0.5 rounded text-amber-300",children:"syntaur usage"})," ","to ingest the latest ccusage data."]}):r.jsxs("table",{className:"w-full text-sm border border-zinc-800 rounded overflow-hidden",children:[r.jsx("thead",{className:"bg-zinc-900 text-zinc-400",children:r.jsxs("tr",{children:[r.jsx("th",{className:"text-left px-3 py-2",children:"Project"}),c==="assignment"&&r.jsx("th",{className:"text-left px-3 py-2",children:"Assignment"}),r.jsx("th",{className:"text-right px-3 py-2",children:"Tokens"}),r.jsx("th",{className:"text-right px-3 py-2",children:"Cost"}),r.jsx("th",{className:"text-left px-3 py-2",children:"Last event"})]})}),r.jsx("tbody",{children:p.summary.map((w,S)=>r.jsxs("tr",{className:"border-t border-zinc-800",children:[r.jsx("td",{className:"px-3 py-2",children:w.projectSlug||"(unattributed)"}),c==="assignment"&&r.jsx("td",{className:"px-3 py-2",children:w.assignmentSlug||"(unattributed)"}),r.jsx("td",{className:"px-3 py-2 text-right tabular-nums",children:Qw(w.totalTokens)}),r.jsx("td",{className:"px-3 py-2 text-right tabular-nums",children:Zw(w.totalCost)}),r.jsx("td",{className:"px-3 py-2 text-zinc-400",children:w.lastEventDay})]},S))})]})]}),r.jsxs("section",{children:[r.jsx("h2",{className:"text-lg font-medium mb-2",children:"Daily breakdown"}),p.daily.length===0?r.jsx("p",{className:"text-zinc-500 text-sm",children:"No daily rows."}):r.jsxs("table",{className:"w-full text-sm border border-zinc-800 rounded overflow-hidden",children:[r.jsx("thead",{className:"bg-zinc-900 text-zinc-400",children:r.jsxs("tr",{children:[r.jsx("th",{className:"text-left px-3 py-2",children:"Day"}),r.jsx("th",{className:"text-left px-3 py-2",children:"Tool"}),r.jsx("th",{className:"text-left px-3 py-2",children:"Model"}),r.jsx("th",{className:"text-left px-3 py-2",children:"Project"}),r.jsx("th",{className:"text-left px-3 py-2",children:"Assignment"}),r.jsx("th",{className:"text-right px-3 py-2",children:"Tokens"}),r.jsx("th",{className:"text-right px-3 py-2",children:"Cost"})]})}),r.jsx("tbody",{children:p.daily.map((w,S)=>r.jsxs("tr",{className:"border-t border-zinc-800",children:[r.jsx("td",{className:"px-3 py-2 tabular-nums",children:w.day}),r.jsx("td",{className:"px-3 py-2 text-zinc-400",children:w.tool}),r.jsx("td",{className:"px-3 py-2 text-zinc-400",children:w.model}),r.jsx("td",{className:"px-3 py-2",children:w.project_slug||"–"}),r.jsx("td",{className:"px-3 py-2",children:w.assignment_slug||"–"}),r.jsx("td",{className:"px-3 py-2 text-right tabular-nums",children:Qw(w.total_tokens)}),r.jsx("td",{className:"px-3 py-2 text-right tabular-nums",children:Zw(w.total_cost)})]},S))})]})]})]})]})}function t0(){const{workspace:e}=At(),{data:t}=Zi(),{data:n,loading:s,error:i}=lj(),[l,c]=f.useState(""),[d,p]=f.useState(""),[m,h]=f.useState(""),[x,y]=f.useState("started_desc"),[v,C]=f.useState(0),[j,w]=f.useState(new Set),[S,E]=f.useState(!1),[N,P]=f.useState(null),[I,R]=f.useState(null),$=(n==null?void 0:n.sessions.some(_=>_.status==="active"))??!1;f.useEffect(()=>{if(!$)return;const _=window.setInterval(()=>C(W=>W+1),3e4);return()=>window.clearInterval(_)},[$]),f.useEffect(()=>{w(_=>{if(_.size===0)return _;const W=new Set((n==null?void 0:n.sessions.map(ie=>ie.sessionId))??[]),Y=new Set([..._].filter(ie=>W.has(ie)));return Y.size===_.size?_:Y})},[n]);const D=f.useMemo(()=>{if(!n)return[];if(e&&!t)return[];const _=l.trim().toLowerCase();return[...n.sessions.filter(Y=>{var ae;if(e&&t){const T=((ae=t.find(M=>M.slug===Y.projectSlug))==null?void 0:ae.workspace)??null;if(e==="_ungrouped"){if(T!==null)return!1}else if(T!==e)return!1}const ie=r6(Y.started);return d&&(!ie||ie<d)||m&&(!ie||ie>m)?!1:_?[Y.projectSlug??"",Y.assignmentSlug??"",Y.agent,Y.sessionId,Y.path,Y.description??"",Y.transcriptPath??""].join(" ").toLowerCase().includes(_):!0})].sort((Y,ie)=>s6(Y,ie,x))},[n,l,x,d,m,v,e,t]);function X(_){w(W=>{const Y=new Set(W);return Y.has(_)?Y.delete(_):Y.add(_),Y})}function Z(){j.size===D.length&&D.length>0?w(new Set):w(new Set(D.map(_=>_.sessionId)))}async function F(_){P(null),E(!0);try{const W=await fetch("/api/agent-sessions",{method:"DELETE",headers:{"Content-Type":"application/json"},body:JSON.stringify({sessionIds:_})}),Y=await W.json().catch(()=>null);if(!W.ok)throw new Error((Y==null?void 0:Y.error)||`HTTP ${W.status}`);w(ie=>new Set([...ie].filter(K=>!_.includes(K)))),R(null)}catch(W){P(W.message)}finally{E(!1)}}async function H(_){try{const W=await fetch(`/api/agent-sessions/${encodeURIComponent(_)}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({status:"stopped"})});if(!W.ok){const Y=await W.json().catch(()=>null);P((Y==null?void 0:Y.error)||`Failed to mark session stopped: HTTP ${W.status}`)}}catch(W){P(W.message)}}if(s)return r.jsx(ct,{label:"Loading agent sessions..."});if(i)return r.jsx(mt,{error:i});if(!n)return null;const J=n.sessions.length>0;return r.jsxs(r.Fragment,{children:[r.jsxs(hg,{children:[r.jsx(Cd,{value:l,onChange:c,placeholder:"Search project, assignment, agent, session ID, path, or description"}),r.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",r.jsx("input",{type:"date",value:d,onChange:_=>p(_.target.value),className:"editor-input min-w-[150px]"})]}),r.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",r.jsx("input",{type:"date",value:m,onChange:_=>h(_.target.value),className:"editor-input min-w-[150px]"})]}),r.jsxs("select",{value:x,onChange:_=>y(_.target.value),className:"editor-input max-w-[200px]",children:[r.jsx("option",{value:"started_desc",children:"Newest first"}),r.jsx("option",{value:"started_asc",children:"Oldest first"}),r.jsx("option",{value:"assignment_asc",children:"Assignment A-Z"}),r.jsx("option",{value:"agent_asc",children:"Agent A-Z"})]})]}),N?r.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,j.size>0&&r.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:[r.jsxs("span",{className:"text-muted-foreground",children:[j.size," session",j.size!==1?"s":""," selected"]}),r.jsxs("button",{className:"shell-action text-destructive",onClick:()=>R({sessionIds:[...j],title:`Delete ${j.size} selected session${j.size===1?"":"s"}?`,description:"This removes the selected agent session records from the dashboard. This cannot be undone.",confirmLabel:j.size===1?"Delete Session":"Delete Sessions"}),disabled:S,children:[r.jsx(In,{className:"mr-1 inline h-3.5 w-3.5"}),"Delete Selected"]}),r.jsx("button",{className:"shell-action",onClick:()=>w(new Set),children:"Clear Selection"})]}),J?D.length===0?r.jsx(pt,{title:"No agent sessions match these filters",description:"Adjust the status, search term, date range, or sorting controls to show sessions again."}):r.jsx("div",{className:"surface-panel mt-4 overflow-x-auto",children:r.jsxs("table",{className:"w-full min-w-[1280px] table-fixed text-sm",children:[r.jsxs("colgroup",{children:[r.jsx("col",{style:{width:"32px"}}),r.jsx("col",{style:{width:"140px"}}),r.jsx("col",{style:{width:"160px"}}),r.jsx("col",{style:{width:"200px"}}),r.jsx("col",{style:{width:"110px"}}),r.jsx("col",{style:{width:"130px"}}),r.jsx("col",{style:{width:"140px"}}),r.jsx("col",{style:{width:"200px"}}),r.jsx("col",{style:{width:"200px"}}),r.jsx("col",{style:{width:"40px"}})]}),r.jsx("thead",{children:r.jsxs("tr",{className:"border-b border-border/40 text-left text-xs uppercase tracking-wider text-muted-foreground",children:[r.jsx("th",{className:"pb-2 pr-3",children:r.jsx("button",{onClick:Z,className:"text-muted-foreground hover:text-foreground",children:j.size===D.length&&D.length>0?r.jsx(Er,{className:"h-4 w-4"}):r.jsx(Eh,{className:"h-4 w-4"})})}),r.jsx("th",{className:"pb-2 pr-3",children:"Project"}),r.jsx("th",{className:"pb-2 pr-3",children:"Assignment"}),r.jsx("th",{className:"pb-2 pr-3",children:"Description"}),r.jsx("th",{className:"pb-2 pr-3",children:"Agent"}),r.jsx("th",{className:"pb-2 pr-3",children:"Session ID"}),r.jsx("th",{className:"pb-2 pr-3",children:"Started"}),r.jsx("th",{className:"pb-2 pr-3",children:"Path"}),r.jsx("th",{className:"pb-2 pr-3",children:"Transcript"}),r.jsx("th",{className:"pb-2"})]})}),r.jsx("tbody",{children:D.map(_=>r.jsx(n6,{session:_,selected:j.has(_.sessionId),onToggle:()=>X(_.sessionId),onDelete:()=>R({sessionIds:[_.sessionId],title:`Delete session ${_.sessionId.slice(0,8)}...?`,description:`Remove this ${_.agent} session record${_.assignmentSlug?` for ${_.assignmentSlug}`:""}. This cannot be undone.`,confirmLabel:"Delete Session"}),onMarkStopped:H},_.sessionId))})]})}):r.jsx(pt,{title:"No agent sessions",description:"No agent sessions have been registered yet. Use /grab-assignment or syntaur track-session to register one."}),r.jsx(fa,{open:I!==null,title:(I==null?void 0:I.title)??"Delete session?",description:(I==null?void 0:I.description)??"",confirmLabel:(I==null?void 0:I.confirmLabel)??"Delete",destructive:!0,loading:S,onOpenChange:_=>{_||R(null)},onConfirm:async()=>{I&&await F(I.sessionIds)}})]})}function n6({session:e,selected:t,onToggle:n,onDelete:s,onMarkStopped:i}){const l=Wt(),c=e.sessionId.length>12?e.sessionId.slice(0,8)+"...":e.sessionId,d=e.path?e.path.replace(/^\/Users\/[^/]+/,"~"):"—",p=e.transcriptPath?e.transcriptPath.replace(/^\/Users\/[^/]+/,"~"):"—";return r.jsxs("tr",{className:"border-b border-border/20 last:border-0",children:[r.jsx("td",{className:"py-2 pr-3",children:r.jsx("button",{onClick:n,className:"text-muted-foreground hover:text-foreground",children:t?r.jsx(Er,{className:"h-4 w-4"}):r.jsx(Eh,{className:"h-4 w-4"})})}),r.jsx("td",{className:"py-2 pr-3",children:e.projectSlug?r.jsx(Ee,{to:`${l}/projects/${e.projectSlug}`,className:"block truncate text-primary hover:underline",title:gn(e.projectSlug),children:gn(e.projectSlug)}):e.assignmentSlug?r.jsx("span",{className:"rounded bg-muted px-1.5 py-0.5 text-[10px] font-mono uppercase tracking-wide text-muted-foreground",children:"Standalone"}):r.jsx("span",{className:"text-muted-foreground",children:"—"})}),r.jsx("td",{className:"py-2 pr-3",children:e.projectSlug&&e.assignmentSlug?r.jsx(Ee,{to:`${l}/projects/${e.projectSlug}/assignments/${e.assignmentSlug}`,className:"block truncate text-primary hover:underline",title:gn(e.assignmentSlug),children:gn(e.assignmentSlug)}):e.assignmentSlug?r.jsx(Ee,{to:`/assignments/${e.assignmentSlug}`,className:"block truncate font-mono text-primary hover:underline",title:e.assignmentSlug,children:e.assignmentSlug}):r.jsx("span",{className:"text-muted-foreground",children:"—"})}),r.jsx("td",{className:"py-2 pr-3",children:e.description?r.jsx("div",{className:"truncate text-xs text-muted-foreground",title:e.description,children:e.description}):r.jsx("span",{className:"text-muted-foreground",children:"—"})}),r.jsx("td",{className:"py-2 pr-3",children:r.jsxs("span",{className:"flex min-w-0 items-center gap-1.5",children:[r.jsx(nd,{className:"h-3 w-3 shrink-0 text-muted-foreground"}),r.jsx("span",{className:"block min-w-0 truncate",children:e.agent})]})}),r.jsx("td",{className:"py-2 pr-3",children:r.jsxs("span",{className:"flex min-w-0 items-center gap-1.5",children:[r.jsx("span",{className:"block min-w-0 truncate font-mono text-xs text-muted-foreground",title:e.sessionId,children:c}),r.jsx(Tr,{value:e.sessionId})]})}),r.jsx("td",{className:"py-2 pr-3 text-xs text-muted-foreground",children:r.jsx("span",{className:"truncate block",children:rs(e.started)})}),r.jsx("td",{className:"py-2 pr-3",children:r.jsxs("span",{className:"flex min-w-0 items-center gap-1.5",children:[r.jsx("span",{className:"block min-w-0 truncate text-xs text-muted-foreground",title:e.path,children:d}),e.path&&r.jsx(Tr,{value:e.path})]})}),r.jsx("td",{className:"py-2 pr-3",children:e.transcriptPath?r.jsxs("span",{className:"flex min-w-0 items-center gap-1.5",children:[r.jsx("span",{className:"block min-w-0 truncate font-mono text-xs text-muted-foreground",title:e.transcriptPath,children:p}),r.jsx(Tr,{value:e.transcriptPath})]}):r.jsx("span",{className:"text-muted-foreground",children:"—"})}),r.jsx("td",{className:"py-2",children:r.jsxs("div",{className:"flex items-center gap-1.5",children:[r.jsx(qS,{session:e,onMarkStopped:i}),r.jsx("button",{onClick:s,className:"text-muted-foreground hover:text-destructive",title:"Delete session",children:r.jsx(In,{className:"h-3.5 w-3.5"})})]})})]})}function r6(e){const t=new Date(e);if(Number.isNaN(t.getTime()))return null;const n=t.getFullYear(),s=String(t.getMonth()+1).padStart(2,"0"),i=String(t.getDate()).padStart(2,"0");return`${n}-${s}-${i}`}function gu(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 s6(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 gu(e)-gu(t);case"duration_desc":return gu(t)-gu(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 o6(){const{data:e,loading:t,error:n,refetch:s}=cj(),[i,l]=f.useState(""),[c,d]=f.useState(null),[p,m]=f.useState(null),[h,x]=f.useState(null),y=f.useMemo(()=>{if(!(e!=null&&e.playbooks))return[];if(!i.trim())return e.playbooks;const j=i.toLowerCase();return e.playbooks.filter(w=>w.name.toLowerCase().includes(j)||w.description.toLowerCase().includes(j)||w.slug.toLowerCase().includes(j)||w.tags.some(S=>S.toLowerCase().includes(j)))},[e,i]);async function v(j,w,S){if(j.preventDefault(),j.stopPropagation(),!c){d(w);try{const E=S?"disable":"enable",N=await fetch(`/api/playbooks/${encodeURIComponent(w)}/${E}`,{method:"POST"});if(!N.ok){const P=await N.json().catch(()=>({}));throw new Error(P.error||`Failed to ${E} playbook`)}s()}catch(E){console.error(E),alert(E instanceof Error?E.message:"Failed to update playbook")}finally{d(null)}}}async function C(){if(p){x(p.slug);try{const j=await fetch(`/api/playbooks/${encodeURIComponent(p.slug)}`,{method:"DELETE"});if(!j.ok){const w=await j.json().catch(()=>({}));throw new Error(w.error||"Failed to delete playbook")}m(null),s()}catch(j){console.error(j),alert(j instanceof Error?j.message:"Failed to delete playbook")}finally{x(null)}}}return t?r.jsx(ct,{label:"Loading playbooks..."}):n?r.jsx(mt,{error:n}):r.jsxs("div",{className:"space-y-4",children:[r.jsxs("div",{className:"flex items-center justify-between gap-4",children:[r.jsxs("div",{className:"relative flex-1 max-w-sm",children:[r.jsx(so,{className:"absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground"}),r.jsx("input",{type:"text",placeholder:"Search playbooks...",value:i,onChange:j=>l(j.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"})]}),r.jsxs(Ee,{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:[r.jsx(Jt,{className:"h-4 w-4"}),"Create Playbook"]})]}),r.jsxs(Ee,{to:"/playbooks/manifest",className:"surface-panel group flex items-center gap-3 p-3 transition hover:border-foreground/20",children:[r.jsx(D0,{className:"h-5 w-5 shrink-0 text-muted-foreground"}),r.jsxs("div",{className:"min-w-0 flex-1",children:[r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx("h3",{className:"text-sm font-semibold text-foreground group-hover:underline",children:"Playbook Manifest"}),r.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"})]}),r.jsxs("p",{className:"mt-0.5 text-xs text-muted-foreground",children:["Index of all playbooks with descriptions. Include ",r.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."]})]})]}),y.length===0?r.jsx(pt,{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?r.jsxs(Ee,{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:[r.jsx(Jt,{className:"h-4 w-4"}),"Create Playbook"]}):void 0}):r.jsx("div",{className:"grid gap-3 sm:grid-cols-2 lg:grid-cols-3",children:y.map(j=>{const w=c===j.slug,S=[{key:"delete",label:"Delete",icon:In,destructive:!0,onSelect:()=>m({slug:j.slug,name:j.name})}];return r.jsxs("div",{className:`surface-panel relative flex flex-col gap-2 p-4 transition hover:border-foreground/20 ${j.enabled?"":"opacity-75"}`,children:[r.jsx("div",{className:"absolute right-3 top-3 z-10",children:r.jsx(pg,{items:S})}),r.jsxs(Ee,{to:`/playbooks/${j.slug}`,className:"group flex flex-col gap-2",children:[r.jsxs("div",{className:"flex items-start gap-2",children:[r.jsx(P0,{className:"mt-0.5 h-4 w-4 shrink-0 text-muted-foreground"}),r.jsxs("div",{className:"min-w-0 flex-1",children:[r.jsx("h3",{className:"text-sm font-semibold text-foreground group-hover:underline",children:j.name}),j.description?r.jsx("p",{className:"mt-1 text-xs leading-5 text-muted-foreground line-clamp-2",children:j.description}):null]})]}),r.jsx("div",{className:"flex items-center gap-2 pt-1 pr-20",children:r.jsxs("div",{className:"flex flex-wrap gap-1",children:[j.tags.slice(0,3).map(E=>r.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:[r.jsx(O0,{className:"h-2.5 w-2.5"}),E]},E)),j.tags.length>3?r.jsxs("span",{className:"text-[10px] text-muted-foreground/60",children:["+",j.tags.length-3]}):null]})})]}),r.jsx("button",{type:"button",role:"switch","aria-checked":j.enabled,"aria-label":j.enabled?"Disable playbook":"Enable playbook",onClick:E=>v(E,j.slug,j.enabled),disabled:w,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 ${j.enabled?"border-status-completed-foreground/60 bg-status-completed-foreground/80":"border-foreground/40 bg-foreground/15"}`,children:r.jsx("span",{className:`block h-4 w-4 rounded-full shadow-sm transition-transform ${j.enabled?"translate-x-[18px] bg-background":"translate-x-[2px] bg-foreground/70"}`})})]},j.slug)})}),r.jsx(fa,{open:p!==null,title:"Delete playbook?",description:p?`"${p.name}" will be removed from disk and the playbook manifest will be regenerated. This cannot be undone.`:"",confirmLabel:"Delete",destructive:!0,loading:h!==null,onConfirm:C,onOpenChange:j=>{j||m(null)}})]})}function i6(){const{slug:e}=At(),t=Rt(),{data:n,loading:s,error:i,refetch:l}=hP(e),[c,d]=f.useState(!1),[p,m]=f.useState(!1),[h,x]=f.useState(!1),[y,v]=f.useState(!1),[C,j]=f.useState(""),[w,S]=f.useState(!1),[E,N]=f.useState(null),P=e==="manifest";f.useEffect(()=>{y&&(j(e??""),N(null))},[y,e]);const I=lr(C),R=I.length>0&&ku(I)&&I!=="manifest",$=I!==e;async function D(){if(!(!e||!R||!$)){S(!0),N(null);try{const F=await fetch(`/api/playbooks/${encodeURIComponent(e)}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({newSlug:I})});if(!F.ok){const H=await F.json().catch(()=>({}));throw new Error(H.error||"Failed to rename playbook")}v(!1),t(`/playbooks/${I}`)}catch(F){N(F instanceof Error?F.message:"Failed to rename playbook")}finally{S(!1)}}}async function X(){if(e){m(!0);try{(await fetch(`/api/playbooks/${e}`,{method:"DELETE"})).ok&&t("/playbooks")}finally{m(!1)}}}async function Z(){if(!(!e||!n)){x(!0);try{const F=n.enabled?"disable":"enable",H=await fetch(`/api/playbooks/${encodeURIComponent(e)}/${F}`,{method:"POST"});if(!H.ok){const J=await H.json().catch(()=>({}));throw new Error(J.error||`Failed to ${F} playbook`)}l()}catch(F){console.error(F),alert(F instanceof Error?F.message:"Failed to update playbook")}finally{x(!1)}}}return s?r.jsx(ct,{label:"Loading playbook..."}):i?r.jsx(mt,{error:i}):n?r.jsxs("div",{className:"space-y-6",children:[r.jsxs("div",{className:"flex items-start justify-between gap-4",children:[r.jsxs("div",{className:"min-w-0",children:[r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx("h2",{className:"text-lg font-semibold text-foreground",children:P?"Playbook Manifest":n.name}),P?r.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]}),!P&&n.description?r.jsx("p",{className:"mt-1 text-sm text-muted-foreground",children:n.description}):null,P?r.jsxs("p",{className:"mt-1 text-sm text-muted-foreground",children:["This file is rebuilt automatically when playbooks are added or removed. Include"," ",r.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,!P&&n.whenToUse?r.jsxs("p",{className:"mt-2 text-sm text-muted-foreground italic",children:["When to use: ",n.whenToUse]}):null,r.jsxs("div",{className:"mt-3 flex flex-wrap items-center gap-3 text-xs text-muted-foreground",children:[r.jsxs("span",{children:["Created ",rs(n.created)]}),r.jsxs("span",{children:["Updated ",rs(n.updated)]})]}),n.tags.length>0?r.jsx("div",{className:"mt-2 flex flex-wrap gap-1.5",children:n.tags.map(F=>r.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:[r.jsx(O0,{className:"h-3 w-3"}),F]},F))}):null]}),P?null:r.jsxs("div",{className:"flex shrink-0 items-center gap-3",children:[r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:n.enabled?"Enabled":"Disabled"}),r.jsx("button",{type:"button",role:"switch","aria-checked":n.enabled,"aria-label":n.enabled?"Disable playbook":"Enable playbook",onClick:Z,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:r.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"}`})})]}),r.jsxs(Ee,{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:[r.jsx(zo,{className:"h-3 w-3"}),"Edit"]}),r.jsxs("button",{type:"button",onClick:()=>v(!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-foreground transition hover:bg-muted",children:[r.jsx(wT,{className:"h-3 w-3"}),"Rename"]}),c?r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx("button",{type:"button",onClick:X,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"}),r.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"})]}):r.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:[r.jsx(In,{className:"h-3 w-3"}),"Delete"]})]})]}),r.jsx("div",{className:"surface-panel p-4",children:r.jsx(en,{content:n.body})}),r.jsx(mr,{open:y,onOpenChange:F=>w?void 0:v(F),children:r.jsxs(Gn,{children:[r.jsxs(as,{children:[r.jsx(Yn,{children:"Rename playbook"}),r.jsx(ls,{children:"The slug changes both the file name and the canonical slug stored in frontmatter. The URL will update on save."})]}),r.jsxs("div",{className:"space-y-2",children:[r.jsx("label",{htmlFor:"rename-slug-input",className:"block text-xs font-medium text-muted-foreground",children:"New slug"}),r.jsx("input",{id:"rename-slug-input",type:"text",autoFocus:!0,value:C,onChange:F=>j(F.target.value),disabled:w,className:"h-9 w-full rounded-md border border-border/70 bg-background px-3 text-sm text-foreground focus:border-foreground/40 focus:outline-none",placeholder:"my-new-slug"}),C&&I!==C?r.jsxs("p",{className:"text-xs text-muted-foreground",children:["Will be normalized to ",r.jsx("code",{className:"rounded bg-muted px-1 py-0.5",children:I||"—"})]}):null,C&&!R?r.jsx("p",{className:"text-xs text-destructive",children:'Slugs must be lowercase, hyphen-separated, with no special characters, and cannot be "manifest".'}):null]}),E?r.jsx("p",{className:"text-sm text-destructive",role:"alert",children:E}):null,r.jsxs(oo,{children:[r.jsx("button",{type:"button",onClick:()=>v(!1),disabled:w,className:"shell-action mt-0 disabled:cursor-not-allowed disabled:opacity-50",children:"Cancel"}),r.jsx("button",{type:"button",onClick:D,disabled:w||!R||!$,className:"shell-action mt-0 bg-foreground text-background hover:opacity-90 disabled:cursor-not-allowed disabled:opacity-50",children:w?"Renaming…":"Rename"})]})]})})]}):null}function a6(){const e=Rt(),[t,n]=f.useState(null),[s,i]=f.useState(!0),[l,c]=f.useState(!1),[d,p]=f.useState(null);f.useEffect(()=>{fetch("/api/playbooks/template/new").then(h=>h.json()).then(h=>{n(h.content),i(!1)}).catch(h=>{p(h.message),i(!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})}),y=await x.json();if(!x.ok){p(y.error||`HTTP ${x.status}`),c(!1);return}e(`/playbooks/${y.slug}`)}catch(x){p(x.message),c(!1);return}c(!1)}return s?r.jsx(ct,{label:"Loading playbook template..."}):d&&!t?r.jsx(mt,{error:d}):r.jsx(ma,{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 l6(){const{slug:e}=At(),t=Rt(),[n,s]=f.useState(null),[i,l]=f.useState(!0),[c,d]=f.useState(!1),[p,m]=f.useState(null);f.useEffect(()=>{e&&fetch(`/api/playbooks/${e}/edit`).then(x=>x.json()).then(x=>{s(x.content),l(!1)}).catch(x=>{m(x.message),l(!1)})},[e]);async function h(x){if(e){d(!0),m(null);try{const y=await fetch(`/api/playbooks/${e}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({content:x})}),v=await y.json();if(!y.ok){m(v.error||`HTTP ${y.status}`),d(!1);return}t(`/playbooks/${e}`)}catch(y){m(y.message),d(!1);return}d(!1)}}return i?r.jsx(ct,{label:"Loading playbook..."}):p&&!n?r.jsx(mt,{error:p}):r.jsx(ma,{initialContent:n||"",documentType:"playbook",mode:"edit",onSave:h,saving:c,error:p,title:"Edit Playbook",onCancel:()=>t(`/playbooks/${e}`)})}function c6(){const{data:e,loading:t,error:n}=gP(),[s,i]=f.useState(""),[l,c]=f.useState("all"),[d,p]=f.useState("all"),[m,h]=f.useState("all"),x=(e==null?void 0:e.memories)??[],y=f.useMemo(()=>Array.from(new Set(x.map(w=>w.projectSlug))).sort(),[x]),v=f.useMemo(()=>Array.from(new Set(x.map(w=>w.scope).filter(Boolean))).sort(),[x]),C=f.useMemo(()=>Array.from(new Set(x.map(w=>w.source).filter(Boolean))).sort(),[x]),j=f.useMemo(()=>x.filter(w=>{if(l!=="all"&&w.projectSlug!==l||d!=="all"&&w.scope!==d||m!=="all"&&w.source!==m)return!1;if(s.trim()){const S=s.toLowerCase();if(!w.name.toLowerCase().includes(S)&&!w.slug.toLowerCase().includes(S)&&!w.projectTitle.toLowerCase().includes(S))return!1}return!0}),[x,s,l,d,m]);return t?r.jsx(ct,{label:"Loading memories…"}):n?r.jsx(mt,{error:n}):r.jsxs("div",{className:"space-y-4",children:[r.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[r.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[r.jsxs("div",{className:"relative",children:[r.jsx(so,{className:"absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground"}),r.jsx("input",{type:"text",placeholder:"Search memories…",value:s,onChange:w=>i(w.target.value),className:"h-9 w-64 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"})]}),r.jsxs("select",{value:l,onChange:w=>c(w.target.value),className:"editor-input max-w-[170px]",children:[r.jsx("option",{value:"all",children:"All projects"}),y.map(w=>r.jsx("option",{value:w,children:w},w))]}),r.jsxs("select",{value:d,onChange:w=>p(w.target.value),className:"editor-input max-w-[140px]",children:[r.jsx("option",{value:"all",children:"All scopes"}),v.map(w=>r.jsx("option",{value:w,children:w},w))]}),r.jsxs("select",{value:m,onChange:w=>h(w.target.value),className:"editor-input max-w-[140px]",children:[r.jsx("option",{value:"all",children:"All sources"}),C.map(w=>r.jsx("option",{value:w,children:w},w))]})]}),r.jsxs(Ee,{to:"/memories/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:[r.jsx(Jt,{className:"h-4 w-4"}),"New Memory"]})]}),j.length===0?r.jsx(pt,{title:x.length===0?"No memories yet":"No memories match these filters",description:x.length===0?"Memories capture patterns and learnings discovered while working in a project. Agents create them via /create-memory or you can add one manually.":"Clear the current filters or create a new memory.",actions:x.length===0?r.jsxs(Ee,{to:"/memories/new",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:[r.jsx(Jt,{className:"h-4 w-4"}),"New Memory"]}):void 0}):r.jsx("div",{className:"surface-panel overflow-x-auto",children:r.jsxs("table",{className:"w-full min-w-[820px] text-left text-sm",children:[r.jsx("thead",{children:r.jsxs("tr",{className:"border-b border-border/60 text-muted-foreground",children:[r.jsx("th",{className:"px-3 pb-3 pt-3 font-medium",children:"Name"}),r.jsx("th",{className:"px-3 pb-3 pt-3 font-medium",children:"Project"}),r.jsx("th",{className:"px-3 pb-3 pt-3 font-medium",children:"Scope"}),r.jsx("th",{className:"px-3 pb-3 pt-3 font-medium",children:"Source"}),r.jsx("th",{className:"px-3 pb-3 pt-3 font-medium",children:"# Related"}),r.jsx("th",{className:"px-3 pb-3 pt-3 font-medium",children:"Updated"})]})}),r.jsx("tbody",{children:j.map(w=>r.jsxs("tr",{className:"border-b border-border/50 last:border-0",children:[r.jsx("td",{className:"px-3 py-3",children:r.jsx(Ee,{to:`/projects/${w.projectSlug}/memories/${w.slug}`,className:"font-semibold text-foreground hover:text-primary",children:w.name||w.slug})}),r.jsx("td",{className:"px-3 py-3 text-muted-foreground",children:r.jsx(Ee,{to:`/projects/${w.projectSlug}`,className:"hover:text-foreground hover:underline",children:w.projectTitle})}),r.jsx("td",{className:"px-3 py-3 text-muted-foreground",children:w.scope||"—"}),r.jsx("td",{className:"px-3 py-3 text-muted-foreground",children:w.source||"—"}),r.jsx("td",{className:"px-3 py-3 text-muted-foreground",children:w.relatedAssignments.length}),r.jsx("td",{className:"px-3 py-3 text-muted-foreground",children:pr(w.updated)})]},`${w.projectSlug}/${w.slug}`))})]})})]})}function u6(){const{slug:e,itemSlug:t}=At(),n=Rt(),{data:s,loading:i,error:l}=xP(e,t),[c,d]=f.useState(!1),[p,m]=f.useState(!1);async function h(){if(!(!e||!t)){m(!0);try{(await fetch(`/api/projects/${e}/memories/${t}`,{method:"DELETE"})).ok&&n("/memories")}finally{m(!1)}}}return i?r.jsx(ct,{label:"Loading memory…"}):l?r.jsx(mt,{error:l}):s?r.jsxs("div",{className:"space-y-6",children:[r.jsxs("div",{className:"flex items-start justify-between gap-4",children:[r.jsxs("div",{className:"min-w-0",children:[r.jsx("h2",{className:"text-lg font-semibold text-foreground",children:s.name||s.slug}),r.jsxs("div",{className:"mt-2 flex flex-wrap items-center gap-2 text-xs text-muted-foreground",children:[r.jsx(Ee,{to:`/projects/${s.projectSlug}`,className:"rounded-full border border-border/60 bg-muted/50 px-2 py-0.5 hover:text-foreground",children:s.projectTitle}),s.scope?r.jsxs("span",{className:"rounded-full border border-border/60 bg-muted/50 px-2 py-0.5",children:["Scope: ",s.scope]}):null,s.source?r.jsxs("span",{className:"rounded-full border border-border/60 bg-muted/50 px-2 py-0.5",children:["Source: ",s.source]}):null,s.sourceAssignment?r.jsxs("span",{className:"rounded-full border border-border/60 bg-muted/50 px-2 py-0.5",children:["From: ",s.sourceAssignment]}):null,r.jsxs("span",{className:"rounded-full border border-border/60 bg-muted/50 px-2 py-0.5",children:[s.relatedAssignments.length," related"]})]}),r.jsxs("div",{className:"mt-3 flex flex-wrap items-center gap-3 text-xs text-muted-foreground",children:[r.jsxs("span",{children:["Created ",rs(s.created)]}),r.jsxs("span",{children:["Updated ",rs(s.updated)]})]}),s.tags&&s.tags.length>0?r.jsx("div",{className:"mt-2 flex flex-wrap gap-1.5",children:s.tags.map(x=>r.jsx("span",{className:"inline-flex items-center rounded-full border border-border/60 bg-muted/50 px-2 py-0.5 text-xs text-muted-foreground",children:x},x))}):null]}),r.jsxs("div",{className:"flex shrink-0 items-center gap-2",children:[r.jsxs(Ee,{to:`/projects/${e}/memories/${t}/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:[r.jsx(zo,{className:"h-3 w-3"}),"Edit"]}),c?r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx("button",{type:"button",onClick:h,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"}),r.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"})]}):r.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:[r.jsx(In,{className:"h-3 w-3"}),"Delete"]})]})]}),r.jsx("div",{className:"surface-panel p-4",children:r.jsx(en,{content:s.body})})]}):null}function d6(){const e=Rt(),[t]=is(),n=t.get("project"),{data:s,loading:i,error:l}=Zi(),[c,d]=f.useState(n??""),[p,m]=f.useState(""),[h,x]=f.useState(""),[y,v]=f.useState(!1),[C,j]=f.useState(null);f.useEffect(()=>{!c&&s&&s.length>0&&d(n??s[0].slug)},[s,n,c]);async function w(S){if(S.preventDefault(),!(!c||!p.trim())){v(!0),j(null);try{const E=await fetch(`/api/projects/${c}/memories`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:p.trim(),body:h||void 0})}),N=await E.json();if(!E.ok){j(N.error||`HTTP ${E.status}`),v(!1);return}e(`/projects/${N.projectSlug}/memories/${N.slug}`)}catch(E){j(E.message),v(!1)}}}return i?r.jsx(ct,{label:"Loading projects…"}):l?r.jsx(mt,{error:l}):!s||s.length===0?r.jsx(mt,{error:"You need at least one project before you can create a memory. Create a project from the sidebar."}):r.jsxs("form",{onSubmit:w,className:"space-y-5",children:[r.jsxs("div",{children:[r.jsx("h2",{className:"text-lg font-semibold text-foreground",children:"New Memory"}),r.jsx("p",{className:"mt-1 text-sm text-muted-foreground",children:"Memories capture patterns and learnings discovered during work in a project. They are available to every assignment in that project."})]}),r.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[r.jsxs("div",{className:"space-y-1.5",children:[r.jsx("label",{htmlFor:"project",className:"block text-sm font-medium text-foreground",children:"Project"}),r.jsx("select",{id:"project",value:c,onChange:S=>d(S.target.value),className:"editor-input",required:!0,children:s.map(S=>r.jsx("option",{value:S.slug,children:S.title},S.slug))})]}),r.jsxs("div",{className:"space-y-1.5",children:[r.jsx("label",{htmlFor:"name",className:"block text-sm font-medium text-foreground",children:"Name"}),r.jsx("input",{id:"name",type:"text",value:p,onChange:S=>m(S.target.value),placeholder:"e.g. PostgreSQL connection pooling",className:"editor-input",required:!0,autoFocus:!0}),r.jsx("p",{className:"text-xs text-muted-foreground/80",children:"The slug is auto-derived from the name. Letters, digits, and hyphens."})]})]}),r.jsxs("div",{className:"space-y-1.5",children:[r.jsx("label",{htmlFor:"body",className:"block text-sm font-medium text-foreground",children:"Body"}),r.jsx("textarea",{id:"body",value:h,onChange:S=>x(S.target.value),rows:14,placeholder:"Write the memory body in markdown. Leave blank to start from a template.",className:"editor-input font-mono text-sm"})]}),C?r.jsx("div",{className:"rounded-md border border-destructive/30 bg-destructive/10 px-3 py-2 text-sm text-destructive",children:C}):null,r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx("button",{type:"submit",disabled:y||!p.trim()||!c,className:"inline-flex h-9 items-center rounded-md bg-foreground px-3 text-sm font-medium text-background transition hover:bg-foreground/90 disabled:opacity-50",children:y?"Creating…":"Create Memory"}),r.jsx("button",{type:"button",onClick:()=>e("/memories"),className:"inline-flex h-9 items-center rounded-md border border-border/70 bg-background px-3 text-sm font-medium text-foreground transition hover:bg-muted",children:"Cancel"})]})]})}function f6(){const{slug:e,itemSlug:t}=At();return r.jsx(ha,{loadUrl:`/api/projects/${e}/memories/${t}/edit`,saveUrl:`/api/projects/${e}/memories/${t}`,redirectTo:`/projects/${e}/memories/${t}`,title:"Edit Memory",description:"Edit the body. The frontmatter (name, scope, source, related assignments) is preserved unchanged on save.",documentType:"memory",helpTitle:"Memory editing",helpBody:"Memory edits are body-only. Frontmatter changes from the editor are ignored server-side; the file's existing frontmatter is preserved and `updated` is bumped automatically."})}function p6(){const{data:e,loading:t,error:n}=yP(),[s,i]=f.useState(""),[l,c]=f.useState("all"),[d,p]=f.useState("all"),[m,h]=f.useState("all"),x=(e==null?void 0:e.resources)??[],y=f.useMemo(()=>Array.from(new Set(x.map(w=>w.projectSlug))).sort(),[x]),v=f.useMemo(()=>Array.from(new Set(x.map(w=>w.category).filter(Boolean))).sort(),[x]),C=f.useMemo(()=>Array.from(new Set(x.map(w=>w.source).filter(Boolean))).sort(),[x]),j=f.useMemo(()=>x.filter(w=>{if(l!=="all"&&w.projectSlug!==l||d!=="all"&&w.category!==d||m!=="all"&&w.source!==m)return!1;if(s.trim()){const S=s.toLowerCase();if(!w.name.toLowerCase().includes(S)&&!w.slug.toLowerCase().includes(S)&&!w.projectTitle.toLowerCase().includes(S))return!1}return!0}),[x,s,l,d,m]);return t?r.jsx(ct,{label:"Loading resources…"}):n?r.jsx(mt,{error:n}):r.jsxs("div",{className:"space-y-4",children:[r.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[r.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[r.jsxs("div",{className:"relative",children:[r.jsx(so,{className:"absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground"}),r.jsx("input",{type:"text",placeholder:"Search resources…",value:s,onChange:w=>i(w.target.value),className:"h-9 w-64 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"})]}),r.jsxs("select",{value:l,onChange:w=>c(w.target.value),className:"editor-input max-w-[170px]",children:[r.jsx("option",{value:"all",children:"All projects"}),y.map(w=>r.jsx("option",{value:w,children:w},w))]}),r.jsxs("select",{value:d,onChange:w=>p(w.target.value),className:"editor-input max-w-[160px]",children:[r.jsx("option",{value:"all",children:"All categories"}),v.map(w=>r.jsx("option",{value:w,children:w},w))]}),r.jsxs("select",{value:m,onChange:w=>h(w.target.value),className:"editor-input max-w-[140px]",children:[r.jsx("option",{value:"all",children:"All sources"}),C.map(w=>r.jsx("option",{value:w,children:w},w))]})]}),r.jsxs(Ee,{to:"/resources/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:[r.jsx(Jt,{className:"h-4 w-4"}),"New Resource"]})]}),j.length===0?r.jsx(pt,{title:x.length===0?"No resources yet":"No resources match these filters",description:x.length===0?"Resources are reference materials shared across a project — specs, requirements, links, or any reference content.":"Clear the current filters or create a new resource.",actions:x.length===0?r.jsxs(Ee,{to:"/resources/new",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:[r.jsx(Jt,{className:"h-4 w-4"}),"New Resource"]}):void 0}):r.jsx("div",{className:"surface-panel overflow-x-auto",children:r.jsxs("table",{className:"w-full min-w-[820px] text-left text-sm",children:[r.jsx("thead",{children:r.jsxs("tr",{className:"border-b border-border/60 text-muted-foreground",children:[r.jsx("th",{className:"px-3 pb-3 pt-3 font-medium",children:"Name"}),r.jsx("th",{className:"px-3 pb-3 pt-3 font-medium",children:"Project"}),r.jsx("th",{className:"px-3 pb-3 pt-3 font-medium",children:"Category"}),r.jsx("th",{className:"px-3 pb-3 pt-3 font-medium",children:"Source"}),r.jsx("th",{className:"px-3 pb-3 pt-3 font-medium",children:"# Related"}),r.jsx("th",{className:"px-3 pb-3 pt-3 font-medium",children:"Updated"})]})}),r.jsx("tbody",{children:j.map(w=>r.jsxs("tr",{className:"border-b border-border/50 last:border-0",children:[r.jsx("td",{className:"px-3 py-3",children:r.jsx(Ee,{to:`/projects/${w.projectSlug}/resources/${w.slug}`,className:"font-semibold text-foreground hover:text-primary",children:w.name||w.slug})}),r.jsx("td",{className:"px-3 py-3 text-muted-foreground",children:r.jsx(Ee,{to:`/projects/${w.projectSlug}`,className:"hover:text-foreground hover:underline",children:w.projectTitle})}),r.jsx("td",{className:"px-3 py-3 text-muted-foreground",children:w.category||"—"}),r.jsx("td",{className:"px-3 py-3 text-muted-foreground",children:w.source||"—"}),r.jsx("td",{className:"px-3 py-3 text-muted-foreground",children:w.relatedAssignments.length}),r.jsx("td",{className:"px-3 py-3 text-muted-foreground",children:pr(w.updated)})]},`${w.projectSlug}/${w.slug}`))})]})})]})}function m6(){const{slug:e,itemSlug:t}=At(),n=Rt(),{data:s,loading:i,error:l}=vP(e,t),[c,d]=f.useState(!1),[p,m]=f.useState(!1);async function h(){if(!(!e||!t)){m(!0);try{(await fetch(`/api/projects/${e}/resources/${t}`,{method:"DELETE"})).ok&&n("/resources")}finally{m(!1)}}}return i?r.jsx(ct,{label:"Loading resource…"}):l?r.jsx(mt,{error:l}):s?r.jsxs("div",{className:"space-y-6",children:[r.jsxs("div",{className:"flex items-start justify-between gap-4",children:[r.jsxs("div",{className:"min-w-0",children:[r.jsx("h2",{className:"text-lg font-semibold text-foreground",children:s.name||s.slug}),r.jsxs("div",{className:"mt-2 flex flex-wrap items-center gap-2 text-xs text-muted-foreground",children:[r.jsx(Ee,{to:`/projects/${s.projectSlug}`,className:"rounded-full border border-border/60 bg-muted/50 px-2 py-0.5 hover:text-foreground",children:s.projectTitle}),s.category?r.jsxs("span",{className:"rounded-full border border-border/60 bg-muted/50 px-2 py-0.5",children:["Category: ",s.category]}):null,s.source?r.jsxs("span",{className:"rounded-full border border-border/60 bg-muted/50 px-2 py-0.5",children:["Source: ",s.source]}):null,r.jsxs("span",{className:"rounded-full border border-border/60 bg-muted/50 px-2 py-0.5",children:[s.relatedAssignments.length," related"]})]}),r.jsxs("div",{className:"mt-3 flex flex-wrap items-center gap-3 text-xs text-muted-foreground",children:[r.jsxs("span",{children:["Created ",rs(s.created)]}),r.jsxs("span",{children:["Updated ",rs(s.updated)]})]})]}),r.jsxs("div",{className:"flex shrink-0 items-center gap-2",children:[r.jsxs(Ee,{to:`/projects/${e}/resources/${t}/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:[r.jsx(zo,{className:"h-3 w-3"}),"Edit"]}),c?r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx("button",{type:"button",onClick:h,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"}),r.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"})]}):r.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:[r.jsx(In,{className:"h-3 w-3"}),"Delete"]})]})]}),r.jsx("div",{className:"surface-panel p-4",children:r.jsx(en,{content:s.body})})]}):null}function h6(){const e=Rt(),[t]=is(),n=t.get("project"),{data:s,loading:i,error:l}=Zi(),[c,d]=f.useState(n??""),[p,m]=f.useState(""),[h,x]=f.useState(""),[y,v]=f.useState(!1),[C,j]=f.useState(null);f.useEffect(()=>{!c&&s&&s.length>0&&d(n??s[0].slug)},[s,n,c]);async function w(S){if(S.preventDefault(),!(!c||!p.trim())){v(!0),j(null);try{const E=await fetch(`/api/projects/${c}/resources`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:p.trim(),body:h||void 0})}),N=await E.json();if(!E.ok){j(N.error||`HTTP ${E.status}`),v(!1);return}e(`/projects/${N.projectSlug}/resources/${N.slug}`)}catch(E){j(E.message),v(!1)}}}return i?r.jsx(ct,{label:"Loading projects…"}):l?r.jsx(mt,{error:l}):!s||s.length===0?r.jsx(mt,{error:"You need at least one project before you can create a resource. Create a project from the sidebar."}):r.jsxs("form",{onSubmit:w,className:"space-y-5",children:[r.jsxs("div",{children:[r.jsx("h2",{className:"text-lg font-semibold text-foreground",children:"New Resource"}),r.jsx("p",{className:"mt-1 text-sm text-muted-foreground",children:"Resources are reference material — specs, requirements, links — shared across every assignment in a project."})]}),r.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[r.jsxs("div",{className:"space-y-1.5",children:[r.jsx("label",{htmlFor:"project",className:"block text-sm font-medium text-foreground",children:"Project"}),r.jsx("select",{id:"project",value:c,onChange:S=>d(S.target.value),className:"editor-input",required:!0,children:s.map(S=>r.jsx("option",{value:S.slug,children:S.title},S.slug))})]}),r.jsxs("div",{className:"space-y-1.5",children:[r.jsx("label",{htmlFor:"name",className:"block text-sm font-medium text-foreground",children:"Name"}),r.jsx("input",{id:"name",type:"text",value:p,onChange:S=>m(S.target.value),placeholder:"e.g. Auth Requirements",className:"editor-input",required:!0,autoFocus:!0}),r.jsx("p",{className:"text-xs text-muted-foreground/80",children:"The slug is auto-derived from the name. Letters, digits, and hyphens."})]})]}),r.jsxs("div",{className:"space-y-1.5",children:[r.jsx("label",{htmlFor:"body",className:"block text-sm font-medium text-foreground",children:"Body"}),r.jsx("textarea",{id:"body",value:h,onChange:S=>x(S.target.value),rows:14,placeholder:"Write the resource body in markdown. Leave blank to start from a template.",className:"editor-input font-mono text-sm"})]}),C?r.jsx("div",{className:"rounded-md border border-destructive/30 bg-destructive/10 px-3 py-2 text-sm text-destructive",children:C}):null,r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx("button",{type:"submit",disabled:y||!p.trim()||!c,className:"inline-flex h-9 items-center rounded-md bg-foreground px-3 text-sm font-medium text-background transition hover:bg-foreground/90 disabled:opacity-50",children:y?"Creating…":"Create Resource"}),r.jsx("button",{type:"button",onClick:()=>e("/resources"),className:"inline-flex h-9 items-center rounded-md border border-border/70 bg-background px-3 text-sm font-medium text-foreground transition hover:bg-muted",children:"Cancel"})]})]})}function g6(){const{slug:e,itemSlug:t}=At();return r.jsx(ha,{loadUrl:`/api/projects/${e}/resources/${t}/edit`,saveUrl:`/api/projects/${e}/resources/${t}`,redirectTo:`/projects/${e}/resources/${t}`,title:"Edit Resource",description:"Edit the body. The frontmatter (name, category, source, related assignments) is preserved unchanged on save.",documentType:"resource",helpTitle:"Resource editing",helpBody:"Resource edits are body-only. Frontmatter changes from the editor are ignored server-side; the file's existing frontmatter is preserved and `updated` is bumped automatically."})}function x6({value:e,onChange:t,ariaLabel:n}){const s=n??"Pick a color",i=n?`${n} (hex)`:"Color hex value";return r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx("input",{type:"color",value:e||"#64748b",onChange:l=>t(l.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","aria-label":s}),r.jsx("input",{type:"text",value:e,onChange:l=>t(l.target.value),placeholder:"#64748b",className:"editor-input w-[5.5rem] font-mono text-xs","aria-label":i})]})}const dh=["projects","playbooks","todos","servers","config"];function y6(e){const t=new Set;for(const n of e.split(",").map(s=>s.trim()))dh.includes(n)&&t.add(n);return t}function n0(e){if(!e)return"never";try{return new Date(e).toLocaleString()}catch{return e}}function v6(){const[e,t]=f.useState(!0),[n,s]=f.useState(null),[i,l]=f.useState(""),[c,d]=f.useState(new Set(dh)),[p,m]=f.useState(!1),[h,x]=f.useState(!1),[y,v]=f.useState(null),[C,j]=f.useState(null),w=f.useCallback(async()=>{try{const R=await fetch("/api/backup");if(!R.ok)throw new Error(`HTTP ${R.status}`);const $=await R.json();s($),l($.repo??""),d(y6($.categories)),m(!1)}catch(R){j({type:"error",message:`Failed to load backup config: ${R instanceof Error?R.message:String(R)}`})}finally{t(!1)}},[]);f.useEffect(()=>{w()},[w]);function S(R){d($=>{const D=new Set($);return D.has(R)?D.delete(R):D.add(R),D}),m(!0)}async function E(){x(!0),j(null);try{const R=Array.from(c),$=await fetch("/api/backup/config",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({repo:i.trim()||null,categories:R})}),D=await $.json();if(!$.ok)throw new Error(D.error||`HTTP ${$.status}`);s(D),m(!1),j({type:"success",message:"Backup configuration saved."})}catch(R){j({type:"error",message:`Save failed: ${R instanceof Error?R.message:String(R)}`})}finally{x(!1)}}async function N(){v("push"),j(null);try{const R=await fetch("/api/backup/push",{method:"POST"}),$=await R.json();if(!R.ok||$.success===!1)throw new Error($.error||$.message||`HTTP ${R.status}`);j({type:"success",message:$.message||"Backup complete."}),await w()}catch(R){j({type:"error",message:`Backup failed: ${R instanceof Error?R.message:String(R)}`})}finally{v(null)}}async function P(){if(window.confirm("Restore will overwrite local files for the selected categories with the contents of the GitHub repo. This cannot be undone. Continue?")){v("pull"),j(null);try{const $=await fetch("/api/backup/pull",{method:"POST"}),D=await $.json();if(!$.ok||D.success===!1)throw new Error(D.error||D.message||`HTTP ${$.status}`);j({type:"success",message:D.message||"Restore complete."}),await w()}catch($){j({type:"error",message:`Restore failed: ${$ instanceof Error?$.message:String($)}`})}finally{v(null)}}}if(e)return r.jsx(Ue,{title:"GitHub Backup",description:"Back up Syntaur files to a GitHub repository",children:r.jsx("p",{className:"text-sm text-muted-foreground",children:"Loading..."})});const I=!!i.trim()&&c.size>0&&!y&&!p;return r.jsx(Ue,{title:"GitHub Backup",description:"Back up Syntaur files to a GitHub repository and restore from it",children:r.jsxs("div",{className:"space-y-4",children:[C&&r.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}),r.jsxs("div",{className:"space-y-2",children:[r.jsx("label",{className:"text-xs font-medium uppercase tracking-wider text-muted-foreground",children:"Repository URL"}),r.jsx("input",{type:"text",value:i,onChange:R=>{l(R.target.value),m(!0)},placeholder:"git@github.com:you/syntaur-backup.git",className:"editor-input w-full text-sm"}),r.jsxs("p",{className:"text-xs text-muted-foreground",children:["SSH or HTTPS URL. Requires ",r.jsx("code",{className:"rounded bg-muted px-1",children:"git"})," installed and credentials configured locally."]})]}),r.jsxs("div",{className:"space-y-2",children:[r.jsx("label",{className:"text-xs font-medium uppercase tracking-wider text-muted-foreground",children:"Categories to back up"}),r.jsx("div",{className:"flex flex-wrap gap-2",children:dh.map(R=>{const $=c.has(R);return r.jsxs("button",{type:"button",onClick:()=>S(R),className:`shell-action text-xs ${$?"bg-primary/10 text-primary hover:bg-primary/20":"bg-muted/30 text-muted-foreground hover:bg-muted/60"}`,children:[r.jsx("span",{className:`mr-1 inline-block h-2 w-2 rounded-full ${$?"bg-primary":"bg-muted-foreground/40"}`}),R]},R)})})]}),r.jsxs("div",{className:"grid grid-cols-1 gap-2 text-xs text-muted-foreground sm:grid-cols-2",children:[r.jsxs("div",{children:[r.jsx("span",{className:"font-medium text-foreground",children:"Last backup: "}),n0((n==null?void 0:n.lastBackup)??null)]}),r.jsxs("div",{children:[r.jsx("span",{className:"font-medium text-foreground",children:"Last restore: "}),n0((n==null?void 0:n.lastRestore)??null)]}),(n==null?void 0:n.locked)&&r.jsx("div",{className:"sm:col-span-2 text-warning-foreground",children:"⚠ A backup operation is in progress or the lock file is stale."})]}),r.jsxs("div",{className:"flex flex-wrap items-center gap-3 pt-2",children:[r.jsxs("button",{className:"shell-action bg-primary/10 text-primary hover:bg-primary/20",onClick:E,disabled:h||!p,children:[r.jsx(od,{className:"h-3.5 w-3.5"}),h?"Saving...":"Save Config"]}),r.jsxs("button",{className:"shell-action",onClick:N,disabled:!I,title:I?"Back up now":p?"Save config first":"Set repo and pick categories",children:[r.jsx(jT,{className:"h-3.5 w-3.5"}),y==="push"?"Backing up...":"Back Up Now"]}),r.jsxs("button",{className:"shell-action",onClick:P,disabled:!I,title:I?"Restore from backup":p?"Save config first":"Set repo and pick categories",children:[r.jsx(Z2,{className:"h-3.5 w-3.5"}),y==="pull"?"Restoring...":"Restore"]}),p&&r.jsx("span",{className:"text-xs text-muted-foreground",children:"Unsaved changes"})]}),r.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:[r.jsx(X2,{className:"mt-0.5 h-3.5 w-3.5 shrink-0"}),r.jsxs("span",{children:["Restore never overwrites ",r.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 b6({open:e,affected:t,remaining:n,onResolve:s,onCancel:i}){var j;const[l,c]=f.useState(n.length>0?"remap":"delete"),[d,p]=f.useState(((j=n[0])==null?void 0:j.id)??""),[m,h]=f.useState(!1);f.useEffect(()=>{var w;e&&(c(n.length>0?"remap":"delete"),p(((w=n[0])==null?void 0:w.id)??""),h(!1))},[e,n]);const x=l==="remap"&&n.length>0&&d!==""&&d!==t.id||l==="delete"&&m;function y(){x&&s(l==="remap"?{id:t.id,mode:"remap",target:d}:{id:t.id,mode:"delete"})}const v=t.assignments.slice(0,10),C=t.count-v.length;return r.jsx(mr,{open:e,onOpenChange:w=>w?void 0:i(),children:r.jsxs(Gn,{className:"max-w-xl",children:[r.jsxs(as,{children:[r.jsxs(Yn,{children:['Delete status "',t.label,'" — ',t.count," assignment",t.count===1?"":"s"," reference it"]}),r.jsx(ls,{children:"Choose how to resolve the affected assignments before this status is removed from the workflow."})]}),r.jsx("div",{className:"rounded-md border border-border/60 bg-background/80 p-3",children:r.jsxs("ul",{className:"space-y-1 text-sm",children:[v.map(w=>r.jsx("li",{children:r.jsx("span",{className:"font-mono text-xs text-muted-foreground",children:w.display})},`${w.projectSlug??"standalone"}/${w.assignmentSlug}`)),C>0&&r.jsxs("li",{className:"text-xs italic text-muted-foreground",children:["+",C," more not shown"]})]})}),r.jsxs("div",{className:"space-y-3",children:[r.jsxs("label",{className:"flex items-start gap-2 cursor-pointer",children:[r.jsx("input",{type:"radio",name:"status-delete-mode",checked:l==="remap",onChange:()=>c("remap"),disabled:n.length===0,className:"mt-1"}),r.jsxs("span",{className:"flex-1",children:[r.jsx("span",{className:"block text-sm font-medium",children:"Remap to another status"}),r.jsxs("select",{value:d,onChange:w=>p(w.target.value),onClick:()=>c("remap"),disabled:l!=="remap"||n.length===0,className:"mt-2 block w-full rounded-md border border-border/60 bg-background px-2 py-1 text-sm",children:[n.length===0&&r.jsx("option",{value:"",children:"(no other statuses)"}),n.map(w=>r.jsxs("option",{value:w.id,children:[w.label," (",w.id,")"]},w.id))]}),n.length===0&&r.jsx("span",{className:"block text-xs text-muted-foreground mt-1",children:"No other saved statuses to remap to. Add another status first, or use Delete."})]})]}),r.jsxs("label",{className:"flex items-start gap-2 cursor-pointer",children:[r.jsx("input",{type:"radio",name:"status-delete-mode",checked:l==="delete",onChange:()=>c("delete"),className:"mt-1"}),r.jsxs("span",{className:"flex-1",children:[r.jsx("span",{className:"block text-sm font-medium text-error-foreground",children:"Delete these assignments"}),r.jsxs("span",{className:"block text-xs text-muted-foreground mt-1",children:["Permanently removes ",t.count," assignment",t.count===1?"":"s"," from disk. This cannot be undone."]}),l==="delete"&&r.jsxs("label",{className:"mt-2 flex items-center gap-2 cursor-pointer",children:[r.jsx("input",{type:"checkbox",checked:m,onChange:w=>h(w.target.checked)}),r.jsxs("span",{className:"text-xs",children:["I understand this will permanently delete ",t.count," assignment",t.count===1?"":"s","."]})]})]})]})]}),r.jsxs(oo,{children:[r.jsx("button",{type:"button",onClick:i,className:"shell-action",children:"Cancel"}),r.jsx("button",{type:"button",onClick:y,disabled:!x,className:`shell-action ${l==="delete"?"bg-error text-error-foreground hover:opacity-90":"bg-foreground text-background hover:opacity-90"} disabled:cursor-not-allowed disabled:opacity-50`,children:l==="remap"?`Remap ${t.count} → ${d||"..."}`:`Delete ${t.count}`})]})]})})}function w6(e){const t=Array.from(e.pendingResolutions.values());return{body:{statuses:e.statuses.map(s=>({id:s.id,label:s.label,...s.description?{description:s.description}:{},...s.color?{color:s.color}:{},...s.terminal?{terminal:!0}:{}})),order:e.order,transitions:[],resolutions:t},resolutions:t}}function j6(e,t){const n=new Map;t.forEach((i,l)=>{n.has(i)||n.set(i,l)});const s=t.length;return e.map((i,l)=>({s:i,originalIndex:l,r:n.get(i.id)??s})).sort((i,l)=>i.r-l.r||i.originalIndex-l.originalIndex).map(i=>i.s)}function r0(e,t){const n=new Map;for(const[s,i]of e.entries())t.has(i.id)||i.mode==="remap"&&!t.has(i.target)||n.set(s,i);return n}function k6(){const{customBindings:e,userBindings:t,actionEntries:n,findConflict:s,bindAction:i,unbindAction:l}=io(),[c,d]=f.useState(null),[p,m]=f.useState(null),[h,x]=f.useState(!1),y=Object.values(t).some(N=>typeof N=="string"&&N.length>0);function v(N,P){m({type:N,message:P}),setTimeout(()=>m(null),2500)}function C(N){d({kind:N,combo:null,conflict:null,saving:!1,error:null})}function j(N){if(!c||N.key==="Escape")return;if(N.key==="Enter"&&c.combo){N.preventDefault(),w();return}if(N.key==="Enter")return;N.preventDefault(),N.stopPropagation();const P=uj(N.nativeEvent);if(!P)return;const I=s(P,c.kind);d({...c,combo:P,conflict:I,error:null})}async function w(){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 i(c.kind,c.combo),d(null),v("success",`Bound ${rl[c.kind]}`)}catch(P){d({...c,saving:!1,error:P instanceof Error?P.message:"Failed to save"})}}}async function S(N){try{await l(N),v("success",`Cleared ${rl[N]} binding`)}catch(P){v("error",P instanceof Error?P.message:"Failed to clear binding")}}async function E(){if(!h){x(!0);try{await F3(),v("success","All hotkey bindings cleared")}catch(N){v("error",N instanceof Error?N.message:"Failed to reset bindings")}finally{x(!1)}}}return r.jsxs(Ue,{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:y?r.jsxs("button",{className:"shell-action text-xs",onClick:()=>void E(),disabled:h,children:[r.jsx(Wi,{className:"h-3 w-3"}),"Restore defaults"]}):void 0,children:[p?r.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,r.jsx("ul",{className:"space-y-2",children:ad.map(N=>{var D,X;const P=n.find(Z=>Z.bindableKind===N),I=e[N],R=typeof t[N]=="string"&&!!t[N],$=(c==null?void 0:c.kind)===N;return r.jsxs("li",{className:"flex flex-wrap items-center gap-3 rounded-md border border-border/40 bg-background/60 px-3 py-2",children:[r.jsx($m,{className:"h-4 w-4 text-muted-foreground","aria-hidden":"true"}),r.jsxs("div",{className:"min-w-0 flex-1",children:[r.jsx("div",{className:"text-sm text-foreground",children:(P==null?void 0:P.title)??rl[N]}),P!=null&&P.subtitle?r.jsx("div",{className:"text-xs text-muted-foreground",children:P.subtitle}):null]}),I?r.jsxs("div",{className:"flex shrink-0 items-center gap-1.5",children:[r.jsx("kbd",{className:"rounded border border-border/70 bg-muted px-2 py-0.5 font-mono text-xs text-foreground",children:ts(I)}),r.jsx("span",{className:`text-[10px] uppercase tracking-wide ${R?"text-primary":"text-muted-foreground"}`,children:R?"custom":"default"})]}):r.jsx("span",{className:"shrink-0 text-xs text-muted-foreground",children:"unbound"}),r.jsxs("div",{className:"flex items-center gap-1.5",children:[r.jsx("button",{type:"button",className:"shell-action text-xs",onClick:()=>C(N),children:I?"Rebind":"Bind"}),R?r.jsxs("button",{type:"button",className:"shell-action text-xs",onClick:()=>void S(N),"aria-label":`Restore default ${rl[N]} binding`,children:[r.jsx(Ph,{className:"h-3 w-3"}),"Restore default"]}):null]}),$?r.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:j,onBlur:()=>{(c==null?void 0:c.kind)===N&&!c.saving&&d(null)},children:c!=null&&c.combo?r.jsxs("div",{className:"space-y-2",children:[r.jsx("div",{className:"text-base font-semibold tracking-wide text-foreground",children:ts(c.combo)}),(D=c.conflict)!=null&&D.description?r.jsxs("div",{className:"text-xs text-destructive",children:["Reserved: ",c.conflict.description]}):(X=c.conflict)!=null&&X.kind?r.jsxs("div",{className:"text-xs text-amber-500 dark:text-amber-400",children:['Already bound to "',rl[c.conflict.kind],'". Press Enter to overwrite.']}):r.jsx("div",{className:"text-xs text-muted-foreground",children:"Press Enter to save, Esc to cancel, any other key to retry."}),c.error?r.jsx("div",{className:"text-xs text-destructive",children:c.error}):null]}):r.jsx("div",{className:"text-xs text-muted-foreground",children:"Press the key combination you want to bind…"})}):null]},N)})})]})}const S6={kanban:"Kanban",list:"List",table:"Table"},N6={comfortable:"Comfortable",compact:"Compact"},C6={title:"Title",status:"Status",priority:"Priority",assignee:"Assignee",dependencies:"Dependencies",updated:"Updated"},E6={asc:"Ascending",desc:"Descending"};function T6(){const e=rF(),t=e.global,[n,s]=f.useState(!1),[i,l]=f.useState(null);function c(m,h){l({type:m,message:h}),setTimeout(()=>l(null),2e3)}async function d(m,h){if(t[m]!==h){s(!0);try{await US({[m]:h}),c("success","Saved")}catch(x){c("error",x instanceof Error?x.message:"Failed to save")}finally{s(!1)}}}async function p(){if(e.custom){s(!0);try{await sF(),c("success","Reset to defaults")}catch(m){c("error",m instanceof Error?m.message:"Failed to reset")}finally{s(!1)}}}return r.jsxs(Ue,{title:"View defaults",description:"Defaults for the assignments board, list, and table views. Per-project overrides are saved automatically as you use them.",actions:e.custom?r.jsxs("button",{type:"button",className:"shell-action text-xs",onClick:p,disabled:n,children:[r.jsx(Wi,{className:"h-3 w-3"}),"Reset"]}):void 0,children:[i&&r.jsx("div",{className:`mb-3 rounded-md border px-3 py-1.5 text-xs ${i.type==="success"?"border-success-foreground/30 bg-success text-success-foreground":"border-error-foreground/30 bg-error text-error-foreground"}`,children:i.message}),r.jsxs("dl",{className:"grid grid-cols-1 gap-4 sm:grid-cols-2",children:[r.jsxs("div",{children:[r.jsx("dt",{className:"text-xs font-medium uppercase tracking-wide text-muted-foreground",children:"Default view"}),r.jsx("dd",{className:"mt-1.5 inline-flex rounded-md border border-border/60 p-0.5",children:yk.map(m=>r.jsx("button",{type:"button",onClick:()=>d("defaultView",m),disabled:n,"aria-pressed":t.defaultView===m,className:`px-3 py-1 text-xs ${t.defaultView===m?"rounded bg-foreground text-background":"text-muted-foreground hover:text-foreground"}`,children:S6[m]},m))})]}),r.jsxs("div",{children:[r.jsx("dt",{className:"text-xs font-medium uppercase tracking-wide text-muted-foreground",children:"Density"}),r.jsx("dd",{className:"mt-1.5 inline-flex rounded-md border border-border/60 p-0.5",children:hA.map(m=>r.jsx("button",{type:"button",onClick:()=>d("density",m),disabled:n,"aria-pressed":t.density===m,className:`px-3 py-1 text-xs ${t.density===m?"rounded bg-foreground text-background":"text-muted-foreground hover:text-foreground"}`,children:N6[m]},m))})]}),r.jsxs("div",{children:[r.jsx("dt",{className:"text-xs font-medium uppercase tracking-wide text-muted-foreground",children:"Sort by"}),r.jsx("dd",{className:"mt-1.5",children:r.jsx("select",{value:t.sortField,onChange:m=>d("sortField",m.target.value),disabled:n,className:"editor-input max-w-[220px]",children:pA.map(m=>r.jsx("option",{value:m,children:C6[m]},m))})})]}),r.jsxs("div",{children:[r.jsx("dt",{className:"text-xs font-medium uppercase tracking-wide text-muted-foreground",children:"Direction"}),r.jsx("dd",{className:"mt-1.5 inline-flex rounded-md border border-border/60 p-0.5",children:mA.map(m=>r.jsx("button",{type:"button",onClick:()=>d("sortDirection",m),disabled:n,"aria-pressed":t.sortDirection===m,className:`px-3 py-1 text-xs ${t.sortDirection===m?"rounded bg-foreground text-background":"text-muted-foreground hover:text-foreground"}`,children:E6[m]},m))})]})]})]})}const P6=/^[a-z0-9][a-z0-9_-]*$/,cN=["first","last","none"];class uN extends Error{constructor(n,s){super(n);vv(this,"fieldErrors");this.name="AgentsConfigError",this.fieldErrors=s}}const Zg={agents:[],custom:!1};let Ai=null,Ei=null,Ju=0;const fh=new Set;function dN(e){Ai=e;for(const t of fh)t(e)}function R6(e){if(!e||typeof e!="object"||Array.isArray(e))return null;const t=e;if(typeof t.id!="string"||t.id.length===0||typeof t.label!="string"||typeof t.command!="string")return null;const n={id:t.id,label:t.label,command:t.command};return Array.isArray(t.args)&&t.args.every(s=>typeof s=="string")&&(n.args=t.args),typeof t.promptArgPosition=="string"&&cN.includes(t.promptArgPosition)&&(n.promptArgPosition=t.promptArgPosition),typeof t.resolveFromShellAliases=="boolean"&&(n.resolveFromShellAliases=t.resolveFromShellAliases),typeof t.default=="boolean"&&(n.default=t.default),n}function ex(e){if(!e||typeof e!="object")return Zg;const t=e,n=Array.isArray(t.agents)?t.agents:[],s=[];for(const i of n){const l=R6(i);l&&s.push(l)}return{agents:s,custom:t.custom===!0}}function A6(){if(Ai)return Promise.resolve(Ai);if(Ei)return Ei;const e=++Ju;return Ei=fetch("/api/config/agents").then(t=>{if(!t.ok)throw new Error(`HTTP ${t.status}`);return t.json()}).then(t=>{Ei=null;const n=ex(t);return e!==Ju?Ai??n:(Ai=n,n)}).catch(()=>(Ei=null,Zg)),Ei}function D6(){const[e,t]=f.useState(()=>Ai??Zg);return f.useEffect(()=>{let n=!1;return A6().then(s=>{n||t(s)}),fh.add(t),()=>{n=!0,fh.delete(t)}},[]),e}async function fN(e){const t=await e.json().catch(()=>null),n=(t==null?void 0:t.error)??`HTTP ${e.status}`;return new uN(n,t==null?void 0:t.fieldErrors)}async function $6(e){++Ju;const t=await fetch("/api/config/agents",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({agents:e})});if(!t.ok)throw await fN(t);const n=ex(await t.json());return dN(n),n}async function L6(){++Ju;const e=await fetch("/api/config/agents",{method:"DELETE"});if(!e.ok)throw await fN(e);const t=ex(await e.json());return dN(t),t}const I6={first:"first",last:"last",none:"none"};function pN(){return`row_${Math.random().toString(36).slice(2,10)}_${Date.now().toString(36)}`}function dl(e){return e.map(t=>({rowKey:pN(),id:t.id,originalId:t.id,isNew:!1,idEditable:!1,autoSlugFromLabel:!1,label:t.label,command:t.command,argsText:t.args?t.args.join(" "):"",promptArgPosition:t.promptArgPosition??"first",resolveFromShellAliases:t.resolveFromShellAliases??!1,default:t.default??!1,fieldErrors:{}}))}function O6(e){return e.map(t=>{const n={id:t.id,label:t.label,command:t.command},s=t.argsText.split(/[,\s]+/).filter(Boolean);return s.length>0&&(n.args=s),t.promptArgPosition!=="first"&&(n.promptArgPosition=t.promptArgPosition),t.resolveFromShellAliases&&(n.resolveFromShellAliases=!0),t.default&&(n.default=!0),n})}function _6(e){if(e.length===0)return e;let t=-1;for(let n=0;n<e.length;n++)if(e[n].default){t=n;break}return e.map((n,s)=>({...n,default:t===-1?s===0:s===t}))}function M6(e,t){return!t||t.length===0?e:e.map((n,s)=>{const i={};for(const l of t){if(l.index!==void 0){l.index===s&&(i[l.field]=l.message);continue}if(l.id!==void 0){l.id===n.id&&(i[l.field]=l.message);continue}i[l.field]=l.message}return{...n,fieldErrors:i}})}function F6(e){return e.map(t=>Object.keys(t.fieldErrors).length===0?t:{...t,fieldErrors:{}})}function z6(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++){const s=e[n],i=t[n];if(s.id!==i.id||s.label!==i.label||s.command!==i.command||s.argsText!==i.argsText||s.promptArgPosition!==i.promptArgPosition||s.resolveFromShellAliases!==i.resolveFromShellAliases||s.default!==i.default)return!1}return!0}function B6({row:e,index:t,canRemove:n,onPatch:s,onSetDefault:i,onRemove:l}){const{attributes:c,listeners:d,setNodeRef:p,setActivatorNodeRef:m,transform:h,transition:x,isDragging:y}=zd({id:e.rowKey}),v={transform:no.Transform.toString(h),transition:x,zIndex:y?50:void 0,position:y?"relative":void 0};function C(S){const E={label:S};if(e.autoSlugFromLabel){const N=lr(S);N&&P6.test(N)?E.id=N:E.id=`agent-${t+1}`}s(E)}function j(S){s({id:S,autoSlugFromLabel:!1})}const w=S=>e.fieldErrors[S]?"border-error-foreground/60":"";return r.jsxs("div",{ref:p,style:v,className:`surface-panel space-y-2 px-3 py-2 ${y?"opacity-60 shadow-lg":""}`,children:[r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx("button",{ref:m,...c,...d,type:"button","aria-label":"Drag to reorder",className:"cursor-grab active:cursor-grabbing text-muted-foreground/40 hover:text-muted-foreground transition touch-none",children:r.jsx(sd,{className:"h-4 w-4"})}),r.jsxs("label",{className:"inline-flex items-center gap-1.5 text-xs text-muted-foreground",children:[r.jsx("input",{type:"radio",name:"agents-default",checked:e.default,onChange:i,className:"h-3 w-3 cursor-pointer accent-foreground"}),"Default"]}),r.jsxs("div",{className:"ml-auto flex items-center gap-2",children:[r.jsx("span",{className:"text-[10px] font-mono uppercase tracking-wide text-muted-foreground/70",children:"id"}),e.idEditable?r.jsx("input",{type:"text",value:e.id,onChange:S=>j(S.target.value),className:`editor-input w-32 font-mono text-xs ${w("id")}`,"aria-label":"Agent id"}):r.jsx("span",{className:"font-mono text-xs text-muted-foreground",children:e.id}),r.jsx("button",{type:"button",onClick:l,disabled:!n,"aria-label":"Remove agent",className:"rounded p-1 text-muted-foreground/60 transition hover:bg-foreground/[0.04] hover:text-foreground disabled:cursor-not-allowed disabled:opacity-30",children:r.jsx(In,{className:"h-3.5 w-3.5"})})]})]}),e.fieldErrors.id&&r.jsx("p",{className:"ml-7 text-[11px] text-error-foreground",children:e.fieldErrors.id}),r.jsxs("div",{className:"ml-7 grid grid-cols-1 gap-2 sm:grid-cols-2",children:[r.jsxs("div",{children:[r.jsx("label",{className:"text-[11px] uppercase tracking-wide text-muted-foreground/80",children:"Label"}),r.jsx("input",{type:"text",value:e.label,onChange:S=>C(S.target.value),className:`editor-input mt-0.5 w-full ${w("label")}`}),e.fieldErrors.label&&r.jsx("p",{className:"mt-0.5 text-[11px] text-error-foreground",children:e.fieldErrors.label})]}),r.jsxs("div",{children:[r.jsx("label",{className:"text-[11px] uppercase tracking-wide text-muted-foreground/80",children:"Command"}),r.jsx("input",{type:"text",value:e.command,placeholder:"claude or /usr/local/bin/claude",onChange:S=>s({command:S.target.value}),className:`editor-input mt-0.5 w-full font-mono ${w("command")}`}),e.fieldErrors.command&&r.jsx("p",{className:"mt-0.5 text-[11px] text-error-foreground",children:e.fieldErrors.command})]}),r.jsxs("div",{children:[r.jsx("label",{className:"text-[11px] uppercase tracking-wide text-muted-foreground/80",children:"Args (comma- or space-separated)"}),r.jsx("input",{type:"text",value:e.argsText,placeholder:"--dangerously-skip-permissions",onChange:S=>s({argsText:S.target.value}),className:`editor-input mt-0.5 w-full font-mono ${w("args")}`}),e.fieldErrors.args&&r.jsx("p",{className:"mt-0.5 text-[11px] text-error-foreground",children:e.fieldErrors.args})]}),r.jsxs("div",{children:[r.jsx("label",{className:"text-[11px] uppercase tracking-wide text-muted-foreground/80",children:"Prompt arg position"}),r.jsx("select",{value:e.promptArgPosition,onChange:S=>s({promptArgPosition:S.target.value}),className:`editor-input mt-0.5 w-full ${w("promptArgPosition")}`,children:cN.map(S=>r.jsx("option",{value:S,children:I6[S]},S))}),e.fieldErrors.promptArgPosition&&r.jsx("p",{className:"mt-0.5 text-[11px] text-error-foreground",children:e.fieldErrors.promptArgPosition})]}),r.jsxs("label",{className:"col-span-full inline-flex items-center gap-1.5 text-xs text-muted-foreground",children:[r.jsx("input",{type:"checkbox",checked:e.resolveFromShellAliases,onChange:S=>s({resolveFromShellAliases:S.target.checked}),className:"h-3.5 w-3.5 cursor-pointer accent-foreground"}),"Resolve from shell aliases (look up ",r.jsx("code",{className:"font-mono",children:"command"})," in your interactive shell before launching)"]})]})]})}function U6(){const e=D6(),[t,n]=f.useState(()=>dl(e.agents)),[s,i]=f.useState(()=>dl(e.agents)),[l,c]=f.useState(!1),[d,p]=f.useState(null),[m,h]=f.useState(null);f.useEffect(()=>{const R=dl(e.agents);n(R),i(R),p(null)},[e.agents]);const x=f.useMemo(()=>!z6(t,s),[t,s]),y=Dd(ro(ua,{activationConstraint:{distance:8}}),ro(ca));function v(R,$){h({type:R,message:$}),setTimeout(()=>h(null),2500)}function C(R,$){n(D=>D.map(X=>X.rowKey===R?{...X,...$,fieldErrors:H6(X.fieldErrors,$)}:X))}function j(R){n($=>$.map(D=>({...D,default:D.rowKey===R})))}function w(){n(R=>{const $=new Set(R.map(J=>J.id)),D="new-agent";let X=D,Z=1;for(;$.has(X);)Z+=1,X=`${D}-${Z}`;const F=Z===1?"New Agent":`New Agent ${Z}`,H={rowKey:pN(),id:X,originalId:null,isNew:!0,idEditable:!0,autoSlugFromLabel:!0,label:F,command:"",argsText:"",promptArgPosition:"first",resolveFromShellAliases:!0,default:!1,fieldErrors:{}};return[...R,H]})}function S(R){n($=>$.filter(D=>D.rowKey!==R))}async function E(){c(!0),p(null);try{const R=_6(t),$=O6(R),D=await $6($),X=dl(D.agents);n(X),i(X),v("success","Agents saved")}catch(R){if(R instanceof uN)p(R.message),n($=>M6(F6($),R.fieldErrors)),v("error",R.message);else{const $=R instanceof Error?R.message:"Failed to save";p($),v("error",$)}}finally{c(!1)}}function N(){n(s),p(null)}async function P(){if(e.custom&&window.confirm("Reset agents to built-in defaults? Any custom agents will be deleted from your config.")){c(!0),p(null);try{const R=await L6(),$=dl(R.agents);n($),i($),v("success","Reset to defaults")}catch(R){const $=R instanceof Error?R.message:"Failed to reset";p($),v("error",$)}finally{c(!1)}}}function I(R){const{active:$,over:D}=R;!D||$.id===D.id||n(X=>{const Z=X.findIndex(H=>H.rowKey===$.id),F=X.findIndex(H=>H.rowKey===D.id);return Z===-1||F===-1?X:da(X,Z,F)})}return r.jsxs(Ue,{title:"Agents",description:"Configure which agents the dashboard and 'Open in agent' actions can launch. The default agent is used when no other one is specified.",actions:e.custom?r.jsxs("button",{type:"button",className:"shell-action text-xs",onClick:P,disabled:l,children:[r.jsx(Wi,{className:"h-3 w-3"}),"Reset"]}):void 0,children:[!e.custom&&r.jsxs("div",{className:"flex items-start gap-2 rounded-md border border-border/60 bg-foreground/[0.02] px-3 py-2 text-xs text-muted-foreground",children:[r.jsx(Sh,{className:"mt-0.5 h-3.5 w-3.5 shrink-0"}),r.jsxs("span",{children:["Using built-in defaults — first save will write your own list to"," ",r.jsx("code",{className:"font-mono",children:"~/.syntaur/config.md"}),"."]})]}),m&&r.jsx("div",{className:`rounded-md border px-3 py-1.5 text-xs ${m.type==="success"?"border-success-foreground/30 bg-success text-success-foreground":"border-error-foreground/30 bg-error text-error-foreground"}`,children:m.message}),d&&(!m||m.type!=="error")&&r.jsx("div",{className:"rounded-md border border-error-foreground/30 bg-error px-3 py-1.5 text-xs text-error-foreground",children:d}),r.jsx(_d,{sensors:y,collisionDetection:$d,onDragEnd:I,children:r.jsx(Fd,{items:t.map(R=>R.rowKey),strategy:Md,children:r.jsx("div",{className:"space-y-2",children:t.map((R,$)=>r.jsx(B6,{row:R,index:$,canRemove:t.length>1,onPatch:D=>C(R.rowKey,D),onSetDefault:()=>j(R.rowKey),onRemove:()=>S(R.rowKey)},R.rowKey))})})}),r.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[r.jsxs("button",{type:"button",onClick:w,disabled:l,className:"shell-action text-xs",children:[r.jsx(Jt,{className:"h-3 w-3"}),"Add agent"]}),r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx("button",{type:"button",onClick:N,disabled:!x||l,className:"shell-action text-xs",children:"Discard"}),r.jsxs("button",{type:"button",onClick:E,disabled:!x||l,className:"shell-action text-xs",children:[r.jsx(od,{className:"h-3 w-3"}),"Save"]})]})]})]})}function H6(e,t){if(Object.keys(e).length===0)return e;const n={...e};return"id"in t&&delete n.id,"label"in t&&delete n.label,"command"in t&&delete n.command,"argsText"in t&&delete n.args,"promptArgPosition"in t&&delete n.promptArgPosition,"resolveFromShellAliases"in t&&delete n.resolveFromShellAliases,"default"in t&&delete n.default,n}const mN=["terminal-app","iterm","ghostty","alacritty","warp","kitty"],Xu={terminal:"terminal-app",custom:!1};let Di=null,Ti=null,Qu=0;const ph=new Set;function hN(e){Di=e;for(const t of ph)t(e)}function tx(e){if(!e||typeof e!="object")return Xu;const t=e;return{terminal:typeof t.terminal=="string"&&mN.includes(t.terminal)?t.terminal:Xu.terminal,custom:t.custom===!0}}function V6(){if(Di)return Promise.resolve(Di);if(Ti)return Ti;const e=++Qu;return Ti=fetch("/api/config/terminal").then(t=>{if(!t.ok)throw new Error(`HTTP ${t.status}`);return t.json()}).then(t=>{Ti=null;const n=tx(t);return e!==Qu?Di??n:(Di=n,n)}).catch(()=>(Ti=null,Xu)),Ti}function W6(){const[e,t]=f.useState(()=>Di??Xu);return f.useEffect(()=>{let n=!1;return V6().then(s=>{n||t(s)}),ph.add(t),()=>{n=!0,ph.delete(t)}},[]),e}async function K6(e){++Qu;const t=await fetch("/api/config/terminal",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({terminal:e})});if(!t.ok){const s=await t.json().catch(()=>null);throw new Error((s==null?void 0:s.error)??`HTTP ${t.status}`)}const n=tx(await t.json());return hN(n),n}async function q6(){++Qu;const e=await fetch("/api/config/terminal",{method:"DELETE"});if(!e.ok){const n=await e.json().catch(()=>null);throw new Error((n==null?void 0:n.error)??`HTTP ${e.status}`)}const t=tx(await e.json());return hN(t),t}const xu={"terminal-app":"Terminal (macOS built-in)",iterm:"iTerm2",ghostty:"Ghostty",alacritty:"Alacritty",warp:"Warp",kitty:"kitty"};function G6(){const{terminal:e,custom:t}=W6(),[n,s]=f.useState(!1),[i,l]=f.useState(null);function c(m){l(m),setTimeout(()=>l(null),2500)}async function d(m){if(!(m===e&&t)){s(!0);try{await K6(m),c({type:"success",message:`Terminal set to ${xu[m]}.`})}catch(h){c({type:"error",message:h instanceof Error?h.message:"Save failed."})}finally{s(!1)}}}async function p(){s(!0);try{const m=await q6();c({type:"success",message:`Reset to OS default (${xu[m.terminal]}).`})}catch(m){c({type:"error",message:m instanceof Error?m.message:"Reset failed."})}finally{s(!1)}}return r.jsxs(Ue,{title:"Terminal",description:`Which terminal "Open in agent" launches. Defaults to the OS choice (currently ${xu[e]}) when unset.`,actions:t?r.jsxs("button",{className:"shell-action text-xs",onClick:p,disabled:n,type:"button",children:[r.jsx(Wi,{className:"h-3 w-3"}),"Reset to OS default"]}):void 0,children:[i&&r.jsx("div",{className:`mb-3 rounded-md border px-3 py-1.5 text-xs ${i.type==="success"?"border-success-foreground/30 bg-success text-success-foreground":"border-error-foreground/30 bg-error text-error-foreground"}`,children:i.message}),r.jsxs("label",{className:"block text-sm",children:[r.jsx("span",{className:"mb-1.5 block text-xs font-medium text-muted-foreground",children:"Launch in"}),r.jsx("select",{value:e,onChange:m=>d(m.target.value),disabled:n,className:"w-full max-w-sm rounded-md border border-border/60 bg-background px-3 py-1.5 text-sm focus:border-primary focus:outline-none focus:ring-2 focus:ring-primary/30 disabled:opacity-60",children:mN.map(m=>r.jsx("option",{value:m,children:xu[m]},m))})]})]})}function gN(){return`row_${Math.random().toString(36).slice(2,10)}_${Date.now().toString(36)}`}function Em(e){const t=e.statuses.map(n=>({rowKey:gN(),id:n.id,label:n.label,description:n.description??"",color:n.color??"",terminal:n.terminal??!1}));return j6(t,e.order)}function Y6({row:e,isSaved:t,onUpdate:n,onRemove:s}){const{attributes:i,listeners:l,setNodeRef:c,setActivatorNodeRef:d,transform:p,transition:m,isDragging:h}=zd({id:e.rowKey}),x={transform:no.Transform.toString(p),transition:m,zIndex:h?50:void 0,position:h?"relative":void 0};return r.jsxs("div",{ref:c,style:x,className:`surface-panel flex flex-wrap items-center gap-3 px-3 py-2 ${h?"opacity-60 shadow-lg":""}`,children:[r.jsx("button",{ref:d,...i,...l,type:"button","aria-label":"Drag to reorder",className:"cursor-grab active:cursor-grabbing text-muted-foreground/40 hover:text-muted-foreground transition touch-none",children:r.jsx(sd,{className:"h-4 w-4"})}),r.jsx("div",{className:"min-w-[8rem] flex-1",children:t?r.jsxs(Nr,{children:[r.jsx(Cr,{asChild:!0,children:r.jsx("input",{type:"text",value:e.id,readOnly:!0,"aria-label":"Status ID",className:"editor-input w-full text-sm cursor-not-allowed opacity-60"})}),r.jsx(ur,{className:"max-w-xs text-xs font-normal normal-case tracking-normal",children:"To rename a saved status, delete the row and create a new one (this triggers the orphan-resolution flow if assignments still reference it)."})]}):r.jsx("input",{type:"text",value:e.id,onChange:y=>n("id",y.target.value),"aria-label":"Status ID",className:"editor-input w-full text-sm"})}),r.jsx("div",{className:"min-w-[8rem] flex-1",children:r.jsx("input",{type:"text",value:e.label,onChange:y=>n("label",y.target.value),"aria-label":"Status label",className:"editor-input w-full text-sm"})}),r.jsx(x6,{value:e.color,onChange:y=>n("color",y),ariaLabel:`Color for ${e.label||e.id}`}),r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsxs(Nr,{children:[r.jsx(Cr,{asChild:!0,children:r.jsx("span",{className:"cursor-help text-xs text-muted-foreground underline decoration-dotted underline-offset-4",children:"Done"})}),r.jsx(ur,{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.'})]}),r.jsx("button",{type:"button",role:"switch","aria-checked":e.terminal,"aria-label":`Done state for ${e.label||e.id}`,onClick:()=>n("terminal",!e.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 ${e.terminal?"bg-primary":"bg-muted"}`,children:r.jsx("span",{className:`pointer-events-none inline-block h-4 w-4 rounded-full bg-background shadow-sm ring-0 transition-transform ${e.terminal?"translate-x-4":"translate-x-0"}`})})]}),r.jsx("button",{type:"button",className:"inline-flex h-7 w-7 items-center justify-center rounded-md text-muted-foreground hover:bg-muted hover:text-foreground",onClick:s,title:"Remove status","aria-label":`Remove status ${e.id}`,children:r.jsx(In,{className:"h-3.5 w-3.5"})})]})}function J6(){var fe;const[e,t]=f.useState(!0),[n,s]=f.useState(null),[i,l]=f.useState(!1),[c,d]=f.useState([]),[p,m]=f.useState(!1),[h,x]=f.useState(null),[y,v]=f.useState(!1),[C,j]=f.useState(new Set),[w,S]=f.useState(new Map),[E,N]=f.useState({open:!1}),P=Dd(ro(ua,{activationConstraint:{distance:8}}),ro(ca,{coordinateGetter:$5})),{preset:I,setPreset:R,resetPreset:$}=Dh(),[D,X]=f.useState(!1),[Z,F]=f.useState(null);async function H(B){if(!(B===I||D)){X(!0),F(null);try{await R(B),F({type:"success",message:"Theme updated"}),setTimeout(()=>F(null),2e3)}catch(oe){F({type:"error",message:oe instanceof Error?oe.message:"Failed to save theme"})}finally{X(!1)}}}async function J(){X(!0),F(null);try{await $(),F({type:"success",message:"Theme reset to default"}),setTimeout(()=>F(null),2e3)}catch(B){F({type:"error",message:B instanceof Error?B.message:"Failed to reset theme"})}finally{X(!1)}}const _=f.useCallback(async()=>{try{const B=await fetch("/api/config/statuses");if(!B.ok)throw new Error(`HTTP ${B.status}`);const oe=await B.json(),he=Em(oe);d(he),l(oe.custom),j(new Set(he.map(we=>we.id))),S(new Map),v(!1),s(null)}catch(B){s(B instanceof Error?B.message:"Failed to load config")}finally{t(!1)}},[]);f.useEffect(()=>{_()},[_]);function W(){setTimeout(()=>x(null),3e3)}async function Y(){m(!0),x(null);try{const{body:B}=w6({statuses:c,order:c.map(pe=>pe.id),pendingResolutions:w}),oe=await fetch("/api/config/statuses",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(B)});if(!oe.ok){const pe=await oe.json().catch(()=>null);if(oe.status===409&&(pe==null?void 0:pe.error)==="unresolved-orphans"){const He=Array.isArray(pe.unresolved)?pe.unresolved.map(te=>te.id).join(", "):"";throw new Error(`Cannot save — these statuses have assignments that need a resolution: ${He}. Click the trash icon on each row to choose remap or delete.`)}if(oe.status===409&&(pe==null?void 0:pe.error)==="concurrent-edit"){const He=pe.applied?` (${pe.applied.remapped} remapped, ${pe.applied.deleted} deleted before the conflict)`:"";x({type:"error",message:`Concurrent edit detected${He}: ${pe.cause??"an assignment moved to a still-dropped status during save"}. Refreshing — please re-resolve.`}),await _();return}if(oe.status===500&&(pe==null?void 0:pe.error)==="config-write-failed"&&(pe!=null&&pe.applied)){const{remapped:He,deleted:te}=pe.applied,ye=pe.message?`: ${pe.message}`:"";x({type:"error",message:`Resolutions applied (${He} remapped, ${te} deleted) but the status config write failed${ye}. Click Save again to retry.`}),await _();return}throw(pe==null?void 0:pe.error)==="invalid-remap-target"?new Error(`Invalid remap target (${pe.reason}): ${pe.id} → ${pe.target}.`):(pe==null?void 0:pe.error)==="duplicate-resolution-ids"?new Error(`Duplicate resolution ids: ${(pe.ids??[]).join(", ")}`):(pe==null?void 0:pe.error)==="stale-resolution"?new Error(`Stale resolution for id "${pe.id??"?"}".`):(pe==null?void 0:pe.error)==="malformed-resolutions"?new Error(`Malformed resolutions: ${pe.message??"unknown"}`):(pe==null?void 0:pe.error)==="remap-write-failed"||(pe==null?void 0:pe.error)==="delete-failed"||(pe==null?void 0:pe.error)==="scan-failed"?new Error(`${pe.error}: ${pe.cause??"unknown"}`):new Error((pe==null?void 0:pe.error)??`Save failed (HTTP ${oe.status})`)}const he=await oe.json(),we=Em(he);d(we),l(he.custom),j(new Set(we.map(pe=>pe.id))),S(new Map),v(!1),jb();const Se=he.applied?` (${he.applied.remapped} remapped, ${he.applied.deleted} deleted)`:"";x({type:"success",message:`Status config saved${Se}`}),W()}catch(B){x({type:"error",message:B instanceof Error?B.message:"Save failed"})}finally{m(!1)}}async function ie(){m(!0),x(null);try{const B=await fetch("/api/config/statuses",{method:"DELETE"});if(!B.ok)throw new Error("Reset failed");const oe=await B.json(),he=Em(oe);d(he),l(oe.custom),j(new Set(he.map(we=>we.id))),S(new Map),v(!1),jb(),x({type:"success",message:"Reset to defaults"}),W()}catch(B){x({type:"error",message:B instanceof Error?B.message:"Reset failed"})}finally{m(!1)}}function K(B,oe,he){d(we=>{const Se=[...we];return Se[B]={...Se[B],[oe]:he},Se}),v(!0)}function ae(){const B=`status_${c.length+1}`;d(oe=>[...oe,{rowKey:gN(),id:B,label:"New Status",description:"",color:"",terminal:!1}]),v(!0)}function T(B){d(oe=>{const he=oe.filter(Se=>Se.id!==B),we=new Set(he.map(Se=>Se.id));return S(Se=>r0(Se,we)),he}),v(!0)}async function M(B){const oe=c[B].id;if(!C.has(oe)){T(oe);return}try{const he=await fetch(`/api/config/statuses/affected/${encodeURIComponent(oe)}`);if(!he.ok)throw new Error(`HTTP ${he.status}`);const we=await he.json();if(we.count===0){T(oe);return}N({open:!0,affected:we,pendingId:oe})}catch(he){x({type:"error",message:`Could not check affected assignments for "${oe}": ${he instanceof Error?he.message:String(he)}`})}}function q(B){if(!E.open)return;const{pendingId:oe}=E;if(oe!==B.id){N({open:!1});return}if(!c.some(he=>he.id===oe)){x({type:"error",message:`Row for "${oe}" was already removed — modal action ignored.`}),N({open:!1});return}d(he=>{const we=he.filter(pe=>pe.id!==oe),Se=new Set(we.map(pe=>pe.id));return S(pe=>{const He=r0(pe,Se),te=new Map(He);return te.set(oe,B),te}),we}),v(!0),N({open:!1})}function L(){N({open:!1})}function ue(B){const{active:oe,over:he}=B;!he||oe.id===he.id||(d(we=>{const Se=we.findIndex(He=>He.rowKey===oe.id),pe=we.findIndex(He=>He.rowKey===he.id);return Se===-1||pe===-1?we:da(we,Se,pe)}),v(!0))}return e?r.jsx(ct,{label:"Loading settings..."}):n?r.jsx(mt,{error:n}):r.jsx(Lo,{children:r.jsxs("div",{className:"space-y-6",children:[r.jsxs(Ue,{title:"Theme",description:"Pick a color theme for the dashboard. The default is the Syntaur brand.",actions:I!=="default"?r.jsxs("button",{className:"shell-action text-xs",onClick:J,disabled:D,children:[r.jsx(Wi,{className:"h-3 w-3"}),"Reset"]}):void 0,children:[Z&&r.jsx("div",{className:`mb-3 rounded-md border px-3 py-1.5 text-xs ${Z.type==="success"?"border-success-foreground/30 bg-success text-success-foreground":"border-error-foreground/30 bg-error text-error-foreground"}`,children:Z.message}),r.jsx("div",{className:"grid grid-cols-1 gap-3 sm:grid-cols-2 lg:grid-cols-4",children:Y0.map(B=>{const oe=B.slug===I;return r.jsxs("button",{type:"button",onClick:()=>H(B.slug),disabled:D,"aria-pressed":oe,className:`group relative flex flex-col gap-2 rounded-lg border bg-card/95 p-3 text-left transition disabled:opacity-60 ${oe?"border-primary ring-2 ring-primary/40":"border-border/60 hover:border-primary/40"}`,children:[r.jsxs("div",{className:"flex items-center gap-1.5",children:[r.jsx("span",{className:"h-5 w-5 rounded-full ring-1 ring-border/60",style:{background:B.swatches.primary}}),r.jsx("span",{className:"h-5 w-5 rounded-full ring-1 ring-border/60",style:{background:B.swatches.secondary}}),r.jsx("span",{className:"h-5 w-5 rounded-full ring-1 ring-border/60",style:{background:B.swatches.coral}}),r.jsx("span",{className:"h-5 w-5 rounded-full ring-1 ring-border/60",style:{background:B.swatches.teal}}),r.jsx("span",{className:"h-5 w-5 rounded-full ring-1 ring-border/60",style:{background:B.swatches.amber}}),oe&&r.jsx("span",{className:"ml-auto inline-flex h-5 w-5 items-center justify-center rounded-full bg-primary text-primary-foreground",children:r.jsx(Fo,{className:"h-3 w-3"})})]}),r.jsxs("div",{children:[r.jsx("div",{className:"text-sm font-medium text-foreground",children:B.label}),r.jsx("div",{className:"text-xs text-muted-foreground",children:B.description})]})]},B.slug)})})]}),r.jsx(k6,{}),r.jsx(G6,{}),r.jsx(U6,{}),r.jsx(T6,{}),r.jsxs("div",{className:`flex items-center justify-between rounded-lg border px-4 py-3 text-sm ${i?"border-primary/30 bg-primary/5 text-primary":"border-border/60 bg-muted/30 text-muted-foreground"}`,children:[r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx(Sh,{className:"h-4 w-4"}),i?"Using custom status configuration from ~/.syntaur/config.md":"Using default status configuration"]}),r.jsxs("button",{className:"shell-action text-xs",onClick:ie,disabled:p||!i&&!y,children:[r.jsx(Wi,{className:"h-3 w-3"}),"Reset to Defaults"]})]}),h&&r.jsx("div",{className:`rounded-lg border px-4 py-2 text-sm ${h.type==="success"?"border-success-foreground/30 bg-success text-success-foreground":"border-error-foreground/30 bg-error text-error-foreground"}`,children:h.message}),r.jsx(Ue,{title:"Status Definitions",description:"Define the statuses assignments can have. Drag rows to set the display order used by Kanban columns, progress bars, and dropdowns.",actions:r.jsxs("button",{className:"shell-action text-xs",onClick:ae,children:[r.jsx(Jt,{className:"h-3 w-3"}),"Add Status"]}),children:r.jsx(_d,{sensors:P,collisionDetection:$d,onDragEnd:ue,children:r.jsx(Fd,{items:c.map(B=>B.rowKey),strategy:Md,children:r.jsx("div",{className:"space-y-2",children:c.map((B,oe)=>r.jsx(Y6,{row:B,isSaved:C.has(B.id),onUpdate:(he,we)=>K(oe,he,we),onRemove:()=>M(oe)},B.rowKey))})})})}),r.jsxs("div",{className:"flex items-center gap-3",children:[r.jsxs("button",{className:"shell-action bg-primary/10 text-primary hover:bg-primary/20",onClick:Y,disabled:p||!y,children:[r.jsx(od,{className:"h-3.5 w-3.5"}),p?"Saving...":"Save Configuration"]}),y&&r.jsxs(r.Fragment,{children:[r.jsx("button",{className:"shell-action text-xs",onClick:()=>{t(!0),_()},disabled:p,children:"Discard Changes"}),r.jsx("span",{className:"text-xs text-muted-foreground",children:"Unsaved changes"})]})]}),r.jsx(v6,{}),E.open&&r.jsx(b6,{open:E.open,affected:{...E.affected,label:((fe=c.find(B=>B.id===E.affected.id))==null?void 0:fe.label)??E.affected.id},remaining:c.filter(B=>B.id!==E.affected.id&&C.has(B.id)).map(B=>({id:B.id,label:B.label})),onResolve:q,onCancel:L})]})})}const Pi=e=>`${e.workspace}::${e.id}`;function s0(e){if(e.includes("/")){const[t,n]=e.split("/");return`/projects/${t}/assignments/${n}`}return`/assignments/${e}`}function X6(){var ne;const{data:e,loading:t,error:n,refetch:s}=dj(),i=Rt(),[l,c]=f.useState(""),d=f.useRef(null);ao("list:todos");const[p,m]=f.useState(""),[h,x]=f.useState(""),[y,v]=f.useState(""),[C,j]=f.useState("_global"),[w,S]=f.useState(null),[E,N]=f.useState(new Set),[P,I]=f.useState(!1),R=f.useRef(null),[$,D]=f.useState(null);f.useEffect(()=>{let U=!1;return(async()=>{try{const de=await fetch("/api/projects");if(!de.ok)return;const me=await de.json();U||D(me.filter(Fe=>!Fe.archived))}catch{}})(),()=>{U=!0}},[]);function X(U,de){U.stopPropagation(),navigator.clipboard.writeText(de),S(de),setTimeout(()=>S(me=>me===de?null:me),1500)}const Z=f.useMemo(()=>{if(!(e!=null&&e.workspaces))return[];const U=[];for(const de of e.workspaces)for(const me of de.items)U.push({...me,workspace:de.workspace});return U},[e]),F=f.useMemo(()=>{const U=new Set;for(const de of Z)for(const me of de.tags)U.add(me);return Array.from(U).sort()},[Z]),H=f.useMemo(()=>{let U=Z;if(l.trim()){const de=l.toLowerCase();U=U.filter(me=>me.description.toLowerCase().includes(de)||me.tags.some(Fe=>Fe.toLowerCase().includes(de))||me.id.includes(de))}return p&&(U=U.filter(de=>de.status===p)),h&&(U=U.filter(de=>de.tags.includes(h))),U},[Z,l,p,h]);f.useEffect(()=>{N(new Set),R.current=null},[l,p,h]);const J=f.useMemo(()=>H.filter(U=>E.has(Pi(U))),[H,E]),_=H.length>0&&J.length===H.length,W=J.length>0&&!_,Y=f.useMemo(()=>{if(J.length===0)return null;const U=new Set(J.map(de=>de.workspace));return U.size===1?[...U][0]:null},[J]),ie=f.useMemo(()=>{if(!Y||!$)return;const U=$.filter(de=>de.workspace===Y);return U.length===1?U[0].slug:void 0},[Y,$]),K=((ne=J[0])==null?void 0:ne.description)??"",ae=f.useMemo(()=>{if(Y)return null;const U=new Map;for(const de of J)U.has(de.workspace)||U.set(de.workspace,[]),U.get(de.workspace).push(de.id);return Array.from(U,([de,me])=>({workspace:de,todoIds:me}))},[J,Y]),T=Y?{kind:"workspace",workspace:Y}:{kind:"aggregate",groups:ae??[]};function M(U,de,me){const Fe=Pi(U);if(!!(me&&"shiftKey"in me&&me.shiftKey)&&R.current!=null){const Ve=Math.min(R.current,de),Ze=Math.max(R.current,de);N(St=>{const bt=new Set(St);for(let gt=Ve;gt<=Ze;gt++){const ce=H[gt];ce&&bt.add(Pi(ce))}return bt})}else N(Ve=>{const Ze=new Set(Ve);return Ze.has(Fe)?Ze.delete(Fe):Ze.add(Fe),Ze});R.current=de}function q(){N(U=>{const de=new Set(U);if(_)for(const me of H)de.delete(Pi(me));else for(const me of H)de.add(Pi(me));return de})}function L(){N(new Set),R.current=null}function ue(U){L(),s(),U!=null&&U.assignmentRef&&i(s0(U.assignmentRef))}const fe=f.useMemo(()=>{if(!(e!=null&&e.workspaces))return{open:0,in_progress:0,completed:0,blocked:0,total:0};const U={open:0,in_progress:0,completed:0,blocked:0,total:0};for(const de of e.workspaces)U.open+=de.counts.open,U.in_progress+=de.counts.in_progress,U.completed+=de.counts.completed,U.blocked+=de.counts.blocked,U.total+=de.counts.total;return U},[e]);async function B(){y.trim()&&(await Ih(C,y.trim()),v(""),s())}const oe={open:"in_progress",in_progress:"completed",completed:"open",blocked:"open"};function he(U,de,me){we(U,de,oe[me]||"open")}async function we(U,de,me){switch(me){case"open":await hj(U,de);break;case"in_progress":await mj(U,de);break;case"completed":await fj(U,de);break;case"blocked":await pj(U,de);break}s()}async function Se(U,de){await gj(U,de),s()}const{hotkeyRowProps:pe}=Hl(H,{scope:"list:todos",bindO:!1,onOpen:U=>he(U.workspace,U.id,U.status)});Pt({keys:"/",scope:"list:todos",description:"Focus filter",handler:()=>{var U;return(U=d.current)==null?void 0:U.focus()}}),Pt({keys:"r",scope:"list:todos",description:"Refresh",handler:()=>s()});const[He,te]=is(),ye=He.get("focus");return f.useEffect(()=>{if(!ye)return;const U=document.querySelector(`[data-todo-id="${CSS.escape(ye)}"]`);if(!U)return;U.scrollIntoView({block:"nearest"}),U.classList.add("ring-2","ring-primary/60");const de=window.setTimeout(()=>{U.classList.remove("ring-2","ring-primary/60"),te(me=>{const Fe=new URLSearchParams(me);return Fe.delete("focus"),Fe})},1500);return()=>window.clearTimeout(de)},[ye,H.length,te]),t?r.jsx(ct,{label:"Loading todos..."}):n?r.jsx(mt,{error:n}):r.jsxs("div",{className:"space-y-4",children:[r.jsxs("div",{className:"grid gap-3 grid-cols-[repeat(auto-fill,minmax(140px,1fr))]",children:[r.jsx(jn,{label:"Open",value:fe.open,icon:Er}),r.jsx(jn,{label:"In Progress",value:fe.in_progress,icon:Nh,tone:"info"}),r.jsx(jn,{label:"Blocked",value:fe.blocked,icon:Th,tone:"warn"}),r.jsx(jn,{label:"Completed",value:fe.completed,icon:Er,tone:"default"})]}),r.jsx("div",{className:"surface-panel p-3",children:r.jsxs("div",{className:"flex gap-2",children:[r.jsxs("select",{value:C,onChange:U=>j(U.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:[r.jsx("option",{value:"_global",children:"Global"}),e==null?void 0:e.workspaces.filter(U=>U.workspace!=="_global").map(U=>r.jsx("option",{value:U.workspace,children:U.workspace},U.workspace))]}),r.jsx("input",{type:"text",placeholder:"Add a todo...",value:y,onChange:U=>v(U.target.value),onKeyDown:U=>U.key==="Enter"&&B(),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"}),r.jsxs("button",{onClick:B,disabled:!y.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:[r.jsx(Jt,{className:"h-4 w-4"}),"Add"]})]})}),r.jsxs("div",{className:"flex items-center gap-3",children:[r.jsxs("div",{className:"relative flex-1 max-w-sm",children:[r.jsx(so,{className:"absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground"}),r.jsx("input",{ref:d,type:"text",placeholder:"Search todos...",value:l,onChange:U=>c(U.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"})]}),r.jsxs("select",{value:p,onChange:U=>m(U.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:[r.jsx("option",{value:"",children:"All statuses"}),r.jsx("option",{value:"open",children:"Open"}),r.jsx("option",{value:"in_progress",children:"In Progress"}),r.jsx("option",{value:"completed",children:"Completed"}),r.jsx("option",{value:"blocked",children:"Blocked"})]}),F.length>0&&r.jsxs("select",{value:h,onChange:U=>x(U.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:[r.jsx("option",{value:"",children:"All tags"}),F.map(U=>r.jsxs("option",{value:U,children:["#",U]},U))]})]}),J.length>0?r.jsxs("div",{className:"surface-panel flex items-center justify-between gap-3 px-3 py-2",children:[r.jsxs("span",{className:"text-sm font-medium",children:[J.length," selected",Y?r.jsxs("span",{className:"ml-2 text-xs text-muted-foreground",children:["(from ",r.jsx("strong",{children:Y}),")"]}):r.jsxs("span",{className:"ml-2 text-xs text-muted-foreground",children:["across ",new Set(J.map(U=>U.workspace)).size," workspaces"]})]}),r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx("button",{type:"button",onClick:()=>I(!0),className:"shell-action bg-foreground text-background hover:opacity-90",children:"Promote to assignment"}),r.jsx("button",{type:"button",onClick:L,className:"text-xs text-muted-foreground hover:text-foreground",children:"Clear"})]})]}):null,H.length===0?r.jsx(pt,{title:"No todos",description:"Add your first todo above or use the CLI: syntaur todo add"}):r.jsxs(r.Fragment,{children:[r.jsxs("div",{className:"flex items-center gap-3 px-3 py-1 text-xs text-muted-foreground",children:[r.jsx("input",{type:"checkbox","aria-label":"Select all visible todos",checked:_,ref:U=>{U&&(U.indeterminate=W)},onChange:q,className:"h-4 w-4 cursor-pointer accent-foreground"}),r.jsxs("span",{children:["Select all in current filter (",H.length,")"]}),r.jsx("span",{className:"text-muted-foreground/60",children:"— shift-click for range select"})]}),r.jsx("div",{className:"space-y-1",children:H.map((U,de)=>{const me=Pi(U),Fe=E.has(me);return r.jsxs("div",{"data-todo-id":U.id,...pe(de),className:`surface-panel flex items-center gap-3 px-3 py-2 group cursor-pointer hover:bg-foreground/[0.03] transition ${Fe?"ring-1 ring-foreground/20":""}`,onClick:()=>he(U.workspace,U.id,U.status),children:[r.jsx("input",{type:"checkbox","aria-label":`Select todo ${U.id}`,checked:Fe,onChange:()=>{},onClick:qe=>{qe.stopPropagation(),M(U,de,qe)},className:"h-4 w-4 cursor-pointer accent-foreground"}),r.jsx(Hg,{status:U.status,onChange:qe=>we(U.workspace,U.id,qe)}),r.jsxs("div",{className:"flex-1 min-w-0",children:[r.jsx("span",{className:`text-sm ${U.status==="completed"?"line-through text-muted-foreground":"text-foreground"}`,children:U.description}),U.tags.length>0&&r.jsx("span",{className:"ml-2 text-xs text-muted-foreground",children:U.tags.map(qe=>`#${qe}`).join(" ")}),U.linkedAssignmentRef?r.jsxs(Ee,{to:s0(U.linkedAssignmentRef),className:"ml-2 inline-flex items-center gap-0.5 rounded-full border border-status-completed-foreground/40 bg-status-completed/30 px-1.5 py-0.5 text-[10px] font-mono text-status-completed-foreground hover:bg-status-completed/50",onClick:qe=>qe.stopPropagation(),children:[r.jsx(T0,{className:"h-2.5 w-2.5"}),U.linkedAssignmentRef.includes("/")?U.linkedAssignmentRef:`oneoff:${U.linkedAssignmentRef.slice(0,8)}`]}):null]}),r.jsx("span",{className:"text-xs text-muted-foreground/60 font-mono",children:U.workspace!=="_global"&&r.jsx(Ee,{to:`/w/${U.workspace}/todos`,className:"hover:text-foreground transition mr-2",onClick:qe=>qe.stopPropagation(),children:U.workspace})}),w===U.id?r.jsxs("span",{className:"text-xs text-status-completed-foreground flex items-center gap-1",children:[r.jsx(Fo,{className:"h-3 w-3"})," Copied to clipboard"]}):r.jsxs(r.Fragment,{children:[r.jsxs("button",{className:"text-xs text-muted-foreground/60 font-mono hover:text-foreground transition",onClick:qe=>X(qe,U.id),children:["t:",U.id]}),r.jsx("button",{className:"text-muted-foreground/40 hover:text-foreground transition",title:"Copy ID",onClick:qe=>X(qe,U.id),children:r.jsx(El,{className:"h-3 w-3"})})]}),r.jsx("button",{onClick:qe=>{qe.stopPropagation(),Se(U.workspace,U.id)},className:"text-xs text-muted-foreground/40 hover:text-destructive transition opacity-0 group-hover:opacity-100",children:"delete"})]},`${U.workspace}-${U.id}`)})})]}),r.jsx(Vg,{open:P,selectedIds:J.map(U=>U.id),scope:T,onOpenChange:I,onDone:ue,defaultProject:ie,defaultTitle:K,allowOneOff:!0})]})}function Q6({title:e,description:t,actions:n,className:s}){return r.jsxs("div",{className:Te("flex flex-col gap-3 lg:flex-row lg:items-end lg:justify-between",s),children:[r.jsxs("div",{className:"space-y-1",children:[e?r.jsx("h1",{className:"text-xl font-semibold tracking-tight text-foreground sm:text-2xl",children:e}):null,t?r.jsx("p",{className:"max-w-3xl text-sm leading-5 text-muted-foreground",children:t}):null]}),n?r.jsx("div",{className:"flex flex-wrap items-center gap-3",children:n}):null]})}const Z6={kanban:"Kanban",list:"List",table:"Table"};function o0(){const{views:e,loading:t}=tg(),{toast:n,showToast:s,dismissToast:i}=Jg(),[l,c]=f.useState(null),[d,p]=f.useState(!1);async function m(){if(l){p(!0);try{await NA(l.id),c(null)}catch(h){s(h instanceof Error?h.message:"Failed to delete saved view")}finally{p(!1)}}}return r.jsxs("div",{className:"space-y-4",children:[r.jsx(Q6,{title:"Saved Views",description:"Browse, rename, and apply saved views captured from any assignments board."}),t?r.jsx(ct,{label:"Loading saved views…"}):e.length===0?r.jsx(pt,{title:"No saved views yet",description:"Visit any assignments board, set filters/sort/column visibility, and click 'Save view' to start."}):r.jsx(Ue,{children:r.jsx("ul",{className:"divide-y divide-border/60",children:e.map(h=>r.jsx(ez,{view:h,onRenameError:x=>s(x),onRequestDelete:()=>c(h)},h.id))})}),r.jsx(fa,{open:l!==null,title:"Delete saved view?",description:l?`Delete '${l.name}'? Any Overview widgets referencing this view will become empty.`:"",confirmLabel:"Delete",loading:d,destructive:!0,onConfirm:m,onOpenChange:h=>{!h&&!d&&c(null)}}),r.jsx(Xg,{toast:n,onDismiss:i})]})}function ez({view:e,onRenameError:t,onRequestDelete:n}){const s=Rt(),[i,l]=f.useState(!1),[c,d]=f.useState(e.name),[p,m]=f.useState(!1),h=f.useRef(null);f.useEffect(()=>{var j,w;i&&((j=h.current)==null||j.focus(),(w=h.current)==null||w.select())},[i]),f.useEffect(()=>{i||d(e.name)},[e.name,i]);async function x(){const j=c.trim();if(!j||j===e.name){d(e.name),l(!1);return}m(!0);try{await ng(e.id,{name:j}),l(!1)}catch(w){t(w instanceof Error?w.message:"Failed to rename saved view")}finally{m(!1)}}function y(){d(e.name),l(!1)}const v=aF(e.config.filters),C=e.workspace?gn(e.workspace):null;return r.jsxs("li",{className:"flex flex-wrap items-center gap-3 py-3",children:[r.jsxs("div",{className:"min-w-0 flex-1 space-y-1",children:[r.jsxs("div",{className:"flex items-center gap-2",children:[i?r.jsx("input",{ref:h,type:"text",value:c,onChange:j=>d(j.target.value),onBlur:()=>{p||x()},onKeyDown:j=>{j.key==="Enter"?(j.preventDefault(),x()):j.key==="Escape"&&(j.preventDefault(),y())},disabled:p,className:"editor-input max-w-xs text-sm font-semibold","aria-label":"Rename saved view"}):r.jsxs("button",{type:"button",onClick:()=>l(!0),className:"group inline-flex items-center gap-1.5 rounded-md text-left text-sm font-semibold text-foreground hover:text-foreground/80",title:"Click to rename",children:[r.jsx("span",{className:"truncate",children:e.name}),r.jsx(zo,{className:"h-3 w-3 text-muted-foreground/50 opacity-0 transition group-hover:opacity-100"})]}),r.jsx("span",{className:"inline-flex shrink-0 items-center rounded-full border border-border/70 bg-muted px-2 py-0.5 text-xs font-medium text-muted-foreground",children:Z6[e.config.viewMode]}),C?r.jsx("span",{className:"inline-flex shrink-0 items-center rounded-full border border-border/70 bg-muted/60 px-2 py-0.5 text-xs text-muted-foreground",children:C}):null]}),r.jsx("p",{className:"truncate text-xs text-muted-foreground",children:v})]}),r.jsxs("div",{className:"flex shrink-0 items-center gap-2",children:[r.jsx("button",{type:"button",onClick:()=>s(iF(e)),className:"shell-action",children:"Apply"}),r.jsx("button",{type:"button",onClick:n,className:"shell-action border-destructive/40 text-destructive hover:bg-destructive/10",children:"Delete"})]})]})}function tz(){return r.jsx(R2,{children:r.jsx(B3,{children:r.jsx(o2,{children:r.jsxs(ze,{element:r.jsx(lA,{}),children:[r.jsx(ze,{path:"/",element:r.jsx(V4,{})}),r.jsx(ze,{path:"/projects",element:r.jsx(Tb,{})}),r.jsx(ze,{path:"/assignments",element:r.jsx(Vw,{})}),r.jsx(ze,{path:"/assignments/new",element:r.jsx(Gw,{})}),r.jsx(ze,{path:"/assignments/:id",element:r.jsx(EF,{})}),r.jsx(ze,{path:"/assignments/:id/edit",element:r.jsx(jm,{})}),r.jsx(ze,{path:"/assignments/:id/plan/edit",element:r.jsx(km,{})}),r.jsx(ze,{path:"/assignments/:id/scratchpad/edit",element:r.jsx(Sm,{})}),r.jsx(ze,{path:"/assignments/:id/handoff/edit",element:r.jsx(Nm,{})}),r.jsx(ze,{path:"/assignments/:id/decision-record/edit",element:r.jsx(Cm,{})}),r.jsx(ze,{path:"/servers",element:r.jsx(Jw,{})}),r.jsx(ze,{path:"/inventories",element:r.jsx(Xw,{})}),r.jsx(ze,{path:"/usage",element:r.jsx(e0,{})}),r.jsx(ze,{path:"/agent-sessions",element:r.jsx(t0,{})}),r.jsx(ze,{path:"/playbooks",element:r.jsx(o6,{})}),r.jsx(ze,{path:"/playbooks/create",element:r.jsx(a6,{})}),r.jsx(ze,{path:"/playbooks/:slug",element:r.jsx(i6,{})}),r.jsx(ze,{path:"/playbooks/:slug/edit",element:r.jsx(l6,{})}),r.jsx(ze,{path:"/memories",element:r.jsx(c6,{})}),r.jsx(ze,{path:"/memories/new",element:r.jsx(d6,{})}),r.jsx(ze,{path:"/projects/:slug/memories/:itemSlug",element:r.jsx(u6,{})}),r.jsx(ze,{path:"/projects/:slug/memories/:itemSlug/edit",element:r.jsx(f6,{})}),r.jsx(ze,{path:"/resources",element:r.jsx(p6,{})}),r.jsx(ze,{path:"/resources/new",element:r.jsx(h6,{})}),r.jsx(ze,{path:"/projects/:slug/resources/:itemSlug",element:r.jsx(m6,{})}),r.jsx(ze,{path:"/projects/:slug/resources/:itemSlug/edit",element:r.jsx(g6,{})}),r.jsx(ze,{path:"/todos",element:r.jsx(X6,{})}),r.jsx(ze,{path:"/views",element:r.jsx(o0,{})}),r.jsx(ze,{path:"/help",element:r.jsx(K4,{})}),r.jsx(ze,{path:"/settings",element:r.jsx(J6,{})}),r.jsx(ze,{path:"/create/project",element:r.jsx(Kw,{})}),r.jsx(ze,{path:"/projects/:slug",element:r.jsx(Fw,{})}),r.jsx(ze,{path:"/projects/:slug/edit",element:r.jsx(Yw,{})}),r.jsx(ze,{path:"/projects/:slug/create/assignment",element:r.jsx(qw,{})}),r.jsx(ze,{path:"/projects/:slug/assignments/:aslug",element:r.jsx(zw,{})}),r.jsx(ze,{path:"/projects/:slug/assignments/:aslug/edit",element:r.jsx(jm,{})}),r.jsx(ze,{path:"/projects/:slug/assignments/:aslug/plan/edit",element:r.jsx(km,{})}),r.jsx(ze,{path:"/projects/:slug/assignments/:aslug/scratchpad/edit",element:r.jsx(Sm,{})}),r.jsx(ze,{path:"/projects/:slug/assignments/:aslug/handoff/edit",element:r.jsx(Nm,{})}),r.jsx(ze,{path:"/projects/:slug/assignments/:aslug/decision-record/edit",element:r.jsx(Cm,{})}),r.jsx(ze,{path:"/w/:workspace/projects",element:r.jsx(Tb,{})}),r.jsx(ze,{path:"/w/:workspace/assignments",element:r.jsx(Vw,{})}),r.jsx(ze,{path:"/w/:workspace/assignments/new",element:r.jsx(Gw,{})}),r.jsx(ze,{path:"/w/:workspace/servers",element:r.jsx(Jw,{})}),r.jsx(ze,{path:"/w/:workspace/inventories",element:r.jsx(Xw,{})}),r.jsx(ze,{path:"/w/:workspace/usage",element:r.jsx(e0,{})}),r.jsx(ze,{path:"/w/:workspace/agent-sessions",element:r.jsx(t0,{})}),r.jsx(ze,{path:"/w/:workspace/todos",element:r.jsx(X5,{})}),r.jsx(ze,{path:"/w/:workspace/views",element:r.jsx(o0,{})}),r.jsx(ze,{path:"/w/:workspace/create/project",element:r.jsx(Kw,{})}),r.jsx(ze,{path:"/w/:workspace/projects/:slug",element:r.jsx(Fw,{})}),r.jsx(ze,{path:"/w/:workspace/projects/:slug/edit",element:r.jsx(Yw,{})}),r.jsx(ze,{path:"/w/:workspace/projects/:slug/create/assignment",element:r.jsx(qw,{})}),r.jsx(ze,{path:"/w/:workspace/projects/:slug/assignments/:aslug",element:r.jsx(zw,{})}),r.jsx(ze,{path:"/w/:workspace/projects/:slug/assignments/:aslug/edit",element:r.jsx(jm,{})}),r.jsx(ze,{path:"/w/:workspace/projects/:slug/assignments/:aslug/plan/edit",element:r.jsx(km,{})}),r.jsx(ze,{path:"/w/:workspace/projects/:slug/assignments/:aslug/scratchpad/edit",element:r.jsx(Sm,{})}),r.jsx(ze,{path:"/w/:workspace/projects/:slug/assignments/:aslug/handoff/edit",element:r.jsx(Nm,{})}),r.jsx(ze,{path:"/w/:workspace/projects/:slug/assignments/:aslug/decision-record/edit",element:r.jsx(Cm,{})})]})})})})}aP();oE.createRoot(document.getElementById("root")).render(r.jsx(f.StrictMode,{children:r.jsx(lP,{children:r.jsx(tz,{})})}));export{R$ as _,rz as a,Zu as g};
|