syntaur 0.17.7 → 0.18.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-D2BEDWwi.js → _basePickBy-Cx0q44iE.js} +1 -1
- package/dashboard/dist/assets/{_baseUniq-BeSpY7QD.js → _baseUniq-CfFbkKif.js} +1 -1
- package/dashboard/dist/assets/{arc-B91qXWF0.js → arc-XluBomWz.js} +1 -1
- package/dashboard/dist/assets/{architectureDiagram-2XIMDMQ5-DL72avGf.js → architectureDiagram-2XIMDMQ5-CihGybG6.js} +1 -1
- package/dashboard/dist/assets/{blockDiagram-WCTKOSBZ-C5XvhKB2.js → blockDiagram-WCTKOSBZ-BPUKO5fj.js} +1 -1
- package/dashboard/dist/assets/{c4Diagram-IC4MRINW-DdYphXt_.js → c4Diagram-IC4MRINW-DKVq_j1f.js} +1 -1
- package/dashboard/dist/assets/channel-mNClnLVi.js +1 -0
- package/dashboard/dist/assets/{chunk-4BX2VUAB-CAkBm9mu.js → chunk-4BX2VUAB-DAaE8oN2.js} +1 -1
- package/dashboard/dist/assets/{chunk-55IACEB6-BnDFEPyz.js → chunk-55IACEB6-BZoVpy5G.js} +1 -1
- package/dashboard/dist/assets/{chunk-FMBD7UC4-DzMBU-Fd.js → chunk-FMBD7UC4-Cuo9M0jI.js} +1 -1
- package/dashboard/dist/assets/{chunk-JSJVCQXG-wMzEo8HB.js → chunk-JSJVCQXG-DGzypY5S.js} +1 -1
- package/dashboard/dist/assets/{chunk-KX2RTZJC-CRmBqsRx.js → chunk-KX2RTZJC-DfxYbrKI.js} +1 -1
- package/dashboard/dist/assets/{chunk-NQ4KR5QH-tqIZ9310.js → chunk-NQ4KR5QH-BEbwpe5N.js} +1 -1
- package/dashboard/dist/assets/{chunk-QZHKN3VN-D-ewc-ee.js → chunk-QZHKN3VN-DDjrkJqg.js} +1 -1
- package/dashboard/dist/assets/{chunk-WL4C6EOR-HkvRMQku.js → chunk-WL4C6EOR-BSMHQ3p4.js} +1 -1
- package/dashboard/dist/assets/classDiagram-VBA2DB6C-Dv6vdcHm.js +1 -0
- package/dashboard/dist/assets/classDiagram-v2-RAHNMMFH-Dv6vdcHm.js +1 -0
- package/dashboard/dist/assets/clone-CRLXHkrd.js +1 -0
- package/dashboard/dist/assets/{cose-bilkent-S5V4N54A-BMyTKVPh.js → cose-bilkent-S5V4N54A-BgUyyImN.js} +1 -1
- package/dashboard/dist/assets/{dagre-KLK3FWXG-DMVGeUDc.js → dagre-KLK3FWXG-zAe7pq6F.js} +1 -1
- package/dashboard/dist/assets/{diagram-E7M64L7V-toMQqEvO.js → diagram-E7M64L7V-B1bVb4ll.js} +1 -1
- package/dashboard/dist/assets/{diagram-IFDJBPK2-BsLs1a6k.js → diagram-IFDJBPK2-DZCxJIkJ.js} +1 -1
- package/dashboard/dist/assets/{diagram-P4PSJMXO-DJsb6s3U.js → diagram-P4PSJMXO-BuPgL5q1.js} +1 -1
- package/dashboard/dist/assets/{erDiagram-INFDFZHY-CpqdOFWz.js → erDiagram-INFDFZHY-l3YvnHT9.js} +1 -1
- package/dashboard/dist/assets/{flowDiagram-PKNHOUZH-Bz6X36zg.js → flowDiagram-PKNHOUZH-CLOLQLdW.js} +1 -1
- package/dashboard/dist/assets/{ganttDiagram-A5KZAMGK-BmJ12rGZ.js → ganttDiagram-A5KZAMGK-D1yLx2Ap.js} +1 -1
- package/dashboard/dist/assets/{gitGraphDiagram-K3NZZRJ6-ChzWbz51.js → gitGraphDiagram-K3NZZRJ6-uC4rY3UQ.js} +1 -1
- package/dashboard/dist/assets/{graph-C8VrN9Qh.js → graph-DvUnLFOz.js} +1 -1
- package/dashboard/dist/assets/index-BoVXMp5e.js +535 -0
- package/dashboard/dist/assets/index-XappA8I7.css +1 -0
- package/dashboard/dist/assets/{infoDiagram-LFFYTUFH-bnQ_IsSg.js → infoDiagram-LFFYTUFH-B6jLLOUk.js} +1 -1
- package/dashboard/dist/assets/{ishikawaDiagram-PHBUUO56-C60EOLe-.js → ishikawaDiagram-PHBUUO56-CDvhubqL.js} +1 -1
- package/dashboard/dist/assets/{journeyDiagram-4ABVD52K-DQUMUGEh.js → journeyDiagram-4ABVD52K-BOtMcoBj.js} +1 -1
- package/dashboard/dist/assets/{kanban-definition-K7BYSVSG-BMBPqPyS.js → kanban-definition-K7BYSVSG-DC05q9p4.js} +1 -1
- package/dashboard/dist/assets/{layout-C5occCbB.js → layout-B4jiZlj6.js} +1 -1
- package/dashboard/dist/assets/{linear-Dfg42G4d.js → linear-DpQXVSyZ.js} +1 -1
- package/dashboard/dist/assets/{mermaid.core-DGOfMuvU.js → mermaid.core-aNcWKq-4.js} +4 -4
- package/dashboard/dist/assets/{mindmap-definition-YRQLILUH-Cxpbaz8-.js → mindmap-definition-YRQLILUH-Dv4qo7wQ.js} +1 -1
- package/dashboard/dist/assets/{pieDiagram-SKSYHLDU-Cx2koqvn.js → pieDiagram-SKSYHLDU-ByRY4ahm.js} +1 -1
- package/dashboard/dist/assets/{quadrantDiagram-337W2JSQ-1Zj8gcll.js → quadrantDiagram-337W2JSQ-Dt5_Xjwp.js} +1 -1
- package/dashboard/dist/assets/{requirementDiagram-Z7DCOOCP-BcLlByAA.js → requirementDiagram-Z7DCOOCP-CSRV6VcE.js} +1 -1
- package/dashboard/dist/assets/{sankeyDiagram-WA2Y5GQK-DRL0SmhI.js → sankeyDiagram-WA2Y5GQK-DA8gxGEq.js} +1 -1
- package/dashboard/dist/assets/{sequenceDiagram-2WXFIKYE-gWjoJwYy.js → sequenceDiagram-2WXFIKYE-CVZr9aKv.js} +1 -1
- package/dashboard/dist/assets/{stateDiagram-RAJIS63D-BcSyrW2F.js → stateDiagram-RAJIS63D-yIU4X0e8.js} +1 -1
- package/dashboard/dist/assets/stateDiagram-v2-FVOUBMTO-DMBx3hAg.js +1 -0
- package/dashboard/dist/assets/{timeline-definition-YZTLITO2-06bIf-77.js → timeline-definition-YZTLITO2-DnfvRVEJ.js} +1 -1
- package/dashboard/dist/assets/{treemap-KZPCXAKY-BbrvjZJT.js → treemap-KZPCXAKY-p5sbmBwK.js} +1 -1
- package/dashboard/dist/assets/{vennDiagram-LZ73GAT5-Brs30qbF.js → vennDiagram-LZ73GAT5-Do2Vp3nv.js} +1 -1
- package/dashboard/dist/assets/{xychartDiagram-JWTSCODW-DvJSOm0Q.js → xychartDiagram-JWTSCODW-BrfAGQWt.js} +1 -1
- package/dashboard/dist/index.html +2 -2
- package/dist/dashboard/server.js +26 -15
- package/dist/dashboard/server.js.map +1 -1
- package/dist/index.js +26 -15
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/dashboard/dist/assets/channel-B_KiPZsR.js +0 -1
- package/dashboard/dist/assets/classDiagram-VBA2DB6C-BpldwYUh.js +0 -1
- package/dashboard/dist/assets/classDiagram-v2-RAHNMMFH-BpldwYUh.js +0 -1
- package/dashboard/dist/assets/clone-CiuyjD6N.js +0 -1
- package/dashboard/dist/assets/index-Bmb8M9LK.js +0 -535
- package/dashboard/dist/assets/index-DF4_iU_C.css +0 -1
- package/dashboard/dist/assets/stateDiagram-v2-FVOUBMTO-kBe6P9_O.js +0 -1
|
@@ -0,0 +1,535 @@
|
|
|
1
|
+
var aE=Object.defineProperty;var lE=(e,t,n)=>t in e?aE(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var Pb=(e,t,n)=>lE(e,typeof t!="symbol"?t+"":t,n);function cE(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 fd(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function Nz(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 zp={exports:{}},rl={},Bp={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 Rb;function uE(){if(Rb)return ot;Rb=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"),u=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(O){return O===null||typeof O!="object"?null:(O=x&&O[x]||O["@@iterator"],typeof O=="function"?O:null)}var b={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},C=Object.assign,j={};function w(O,q,L){this.props=O,this.context=q,this.refs=j,this.updater=L||b}w.prototype.isReactComponent={},w.prototype.setState=function(O,q){if(typeof O!="object"&&typeof O!="function"&&O!=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,O,q,"setState")},w.prototype.forceUpdate=function(O){this.updater.enqueueForceUpdate(this,O,"forceUpdate")};function S(){}S.prototype=w.prototype;function E(O,q,L){this.props=O,this.context=q,this.refs=j,this.updater=L||b}var N=E.prototype=new S;N.constructor=E,C(N,w.prototype),N.isPureReactComponent=!0;var R=Array.isArray,I=Object.prototype.hasOwnProperty,P={current:null},$={key:!0,ref:!0,__self:!0,__source:!0};function D(O,q,L){var ee,de={},F=null,re=null;if(q!=null)for(ee in q.ref!==void 0&&(re=q.ref),q.key!==void 0&&(F=""+q.key),q)I.call(q,ee)&&!$.hasOwnProperty(ee)&&(de[ee]=q[ee]);var me=arguments.length-2;if(me===1)de.children=L;else if(1<me){for(var ve=Array(me),Se=0;Se<me;Se++)ve[Se]=arguments[Se+2];de.children=ve}if(O&&O.defaultProps)for(ee in me=O.defaultProps,me)de[ee]===void 0&&(de[ee]=me[ee]);return{$$typeof:e,type:O,key:F,ref:re,props:de,_owner:P.current}}function X(O,q){return{$$typeof:e,type:O.type,key:q,ref:O.ref,props:O.props,_owner:O._owner}}function Z(O){return typeof O=="object"&&O!==null&&O.$$typeof===e}function z(O){var q={"=":"=0",":":"=2"};return"$"+O.replace(/[=:]/g,function(L){return q[L]})}var U=/\/+/g;function J(O,q){return typeof O=="object"&&O!==null&&O.key!=null?z(""+O.key):q.toString(36)}function _(O,q,L,ee,de){var F=typeof O;(F==="undefined"||F==="boolean")&&(O=null);var re=!1;if(O===null)re=!0;else switch(F){case"string":case"number":re=!0;break;case"object":switch(O.$$typeof){case e:case t:re=!0}}if(re)return re=O,de=de(re),O=ee===""?"."+J(re,0):ee,R(de)?(L="",O!=null&&(L=O.replace(U,"$&/")+"/"),_(de,q,L,"",function(Se){return Se})):de!=null&&(Z(de)&&(de=X(de,L+(!de.key||re&&re.key===de.key?"":(""+de.key).replace(U,"$&/")+"/")+O)),q.push(de)),1;if(re=0,ee=ee===""?".":ee+":",R(O))for(var me=0;me<O.length;me++){F=O[me];var ve=ee+J(F,me);re+=_(F,q,L,ve,de)}else if(ve=y(O),typeof ve=="function")for(O=ve.call(O),me=0;!(F=O.next()).done;)F=F.value,ve=ee+J(F,me++),re+=_(F,q,L,ve,de);else if(F==="object")throw q=String(O),Error("Objects are not valid as a React child (found: "+(q==="[object Object]"?"object with keys {"+Object.keys(O).join(", ")+"}":q)+"). If you meant to render a collection of children, use an array instead.");return re}function G(O,q,L){if(O==null)return O;var ee=[],de=0;return _(O,ee,"","",function(F){return q.call(L,F,de++)}),ee}function Q(O){if(O._status===-1){var q=O._result;q=q(),q.then(function(L){(O._status===0||O._status===-1)&&(O._status=1,O._result=L)},function(L){(O._status===0||O._status===-1)&&(O._status=2,O._result=L)}),O._status===-1&&(O._status=0,O._result=q)}if(O._status===1)return O._result.default;throw O._result}var le={current:null},W={transition:null},ne={ReactCurrentDispatcher:le,ReactCurrentBatchConfig:W,ReactCurrentOwner:P};function T(){throw Error("act(...) is not supported in production builds of React.")}return ot.Children={map:G,forEach:function(O,q,L){G(O,function(){q.apply(this,arguments)},L)},count:function(O){var q=0;return G(O,function(){q++}),q},toArray:function(O){return G(O,function(q){return q})||[]},only:function(O){if(!Z(O))throw Error("React.Children.only expected to receive a single React element child.");return O}},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=ne,ot.act=T,ot.cloneElement=function(O,q,L){if(O==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+O+".");var ee=C({},O.props),de=O.key,F=O.ref,re=O._owner;if(q!=null){if(q.ref!==void 0&&(F=q.ref,re=P.current),q.key!==void 0&&(de=""+q.key),O.type&&O.type.defaultProps)var me=O.type.defaultProps;for(ve in q)I.call(q,ve)&&!$.hasOwnProperty(ve)&&(ee[ve]=q[ve]===void 0&&me!==void 0?me[ve]:q[ve])}var ve=arguments.length-2;if(ve===1)ee.children=L;else if(1<ve){me=Array(ve);for(var Se=0;Se<ve;Se++)me[Se]=arguments[Se+2];ee.children=me}return{$$typeof:e,type:O.type,key:de,ref:F,props:ee,_owner:re}},ot.createContext=function(O){return O={$$typeof:c,_currentValue:O,_currentValue2:O,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},O.Provider={$$typeof:l,_context:O},O.Consumer=O},ot.createElement=D,ot.createFactory=function(O){var q=D.bind(null,O);return q.type=O,q},ot.createRef=function(){return{current:null}},ot.forwardRef=function(O){return{$$typeof:u,render:O}},ot.isValidElement=Z,ot.lazy=function(O){return{$$typeof:h,_payload:{_status:-1,_result:O},_init:Q}},ot.memo=function(O,q){return{$$typeof:m,type:O,compare:q===void 0?null:q}},ot.startTransition=function(O){var q=W.transition;W.transition={};try{O()}finally{W.transition=q}},ot.unstable_act=T,ot.useCallback=function(O,q){return le.current.useCallback(O,q)},ot.useContext=function(O){return le.current.useContext(O)},ot.useDebugValue=function(){},ot.useDeferredValue=function(O){return le.current.useDeferredValue(O)},ot.useEffect=function(O,q){return le.current.useEffect(O,q)},ot.useId=function(){return le.current.useId()},ot.useImperativeHandle=function(O,q,L){return le.current.useImperativeHandle(O,q,L)},ot.useInsertionEffect=function(O,q){return le.current.useInsertionEffect(O,q)},ot.useLayoutEffect=function(O,q){return le.current.useLayoutEffect(O,q)},ot.useMemo=function(O,q){return le.current.useMemo(O,q)},ot.useReducer=function(O,q,L){return le.current.useReducer(O,q,L)},ot.useRef=function(O){return le.current.useRef(O)},ot.useState=function(O){return le.current.useState(O)},ot.useSyncExternalStore=function(O,q,L){return le.current.useSyncExternalStore(O,q,L)},ot.useTransition=function(){return le.current.useTransition()},ot.version="18.3.1",ot}var Ab;function Th(){return Ab||(Ab=1,Bp.exports=uE()),Bp.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 Db;function dE(){if(Db)return rl;Db=1;var e=Th(),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(u,p,m){var h,x={},y=null,b=null;m!==void 0&&(y=""+m),p.key!==void 0&&(y=""+p.key),p.ref!==void 0&&(b=p.ref);for(h in p)s.call(p,h)&&!l.hasOwnProperty(h)&&(x[h]=p[h]);if(u&&u.defaultProps)for(h in p=u.defaultProps,p)x[h]===void 0&&(x[h]=p[h]);return{$$typeof:t,type:u,key:y,ref:b,props:x,_owner:i.current}}return rl.Fragment=n,rl.jsx=c,rl.jsxs=c,rl}var Lb;function fE(){return Lb||(Lb=1,zp.exports=dE()),zp.exports}var r=fE(),f=Th();const Wt=fd(f),mj=cE({__proto__:null,default:Wt},[f]);var cu={},Up={exports:{}},qn={},Vp={exports:{}},Hp={};/**
|
|
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 $b;function pE(){return $b||($b=1,(function(e){function t(W,ne){var T=W.length;W.push(ne);e:for(;0<T;){var O=T-1>>>1,q=W[O];if(0<i(q,ne))W[O]=ne,W[T]=q,T=O;else break e}}function n(W){return W.length===0?null:W[0]}function s(W){if(W.length===0)return null;var ne=W[0],T=W.pop();if(T!==ne){W[0]=T;e:for(var O=0,q=W.length,L=q>>>1;O<L;){var ee=2*(O+1)-1,de=W[ee],F=ee+1,re=W[F];if(0>i(de,T))F<q&&0>i(re,de)?(W[O]=re,W[F]=T,O=F):(W[O]=de,W[ee]=T,O=ee);else if(F<q&&0>i(re,T))W[O]=re,W[F]=T,O=F;else break e}}return ne}function i(W,ne){var T=W.sortIndex-ne.sortIndex;return T!==0?T:W.id-ne.id}if(typeof performance=="object"&&typeof performance.now=="function"){var l=performance;e.unstable_now=function(){return l.now()}}else{var c=Date,u=c.now();e.unstable_now=function(){return c.now()-u}}var p=[],m=[],h=1,x=null,y=3,b=!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(W){for(var ne=n(m);ne!==null;){if(ne.callback===null)s(m);else if(ne.startTime<=W)s(m),ne.sortIndex=ne.expirationTime,t(p,ne);else break;ne=n(m)}}function R(W){if(j=!1,N(W),!C)if(n(p)!==null)C=!0,Q(I);else{var ne=n(m);ne!==null&&le(R,ne.startTime-W)}}function I(W,ne){C=!1,j&&(j=!1,S(D),D=-1),b=!0;var T=y;try{for(N(ne),x=n(p);x!==null&&(!(x.expirationTime>ne)||W&&!z());){var O=x.callback;if(typeof O=="function"){x.callback=null,y=x.priorityLevel;var q=O(x.expirationTime<=ne);ne=e.unstable_now(),typeof q=="function"?x.callback=q:x===n(p)&&s(p),N(ne)}else s(p);x=n(p)}if(x!==null)var L=!0;else{var ee=n(m);ee!==null&&le(R,ee.startTime-ne),L=!1}return L}finally{x=null,y=T,b=!1}}var P=!1,$=null,D=-1,X=5,Z=-1;function z(){return!(e.unstable_now()-Z<X)}function U(){if($!==null){var W=e.unstable_now();Z=W;var ne=!0;try{ne=$(!0,W)}finally{ne?J():(P=!1,$=null)}}else P=!1}var J;if(typeof E=="function")J=function(){E(U)};else if(typeof MessageChannel<"u"){var _=new MessageChannel,G=_.port2;_.port1.onmessage=U,J=function(){G.postMessage(null)}}else J=function(){w(U,0)};function Q(W){$=W,P||(P=!0,J())}function le(W,ne){D=w(function(){W(e.unstable_now())},ne)}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(W){W.callback=null},e.unstable_continueExecution=function(){C||b||(C=!0,Q(I))},e.unstable_forceFrameRate=function(W){0>W||125<W?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):X=0<W?Math.floor(1e3/W):5},e.unstable_getCurrentPriorityLevel=function(){return y},e.unstable_getFirstCallbackNode=function(){return n(p)},e.unstable_next=function(W){switch(y){case 1:case 2:case 3:var ne=3;break;default:ne=y}var T=y;y=ne;try{return W()}finally{y=T}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(W,ne){switch(W){case 1:case 2:case 3:case 4:case 5:break;default:W=3}var T=y;y=W;try{return ne()}finally{y=T}},e.unstable_scheduleCallback=function(W,ne,T){var O=e.unstable_now();switch(typeof T=="object"&&T!==null?(T=T.delay,T=typeof T=="number"&&0<T?O+T:O):T=O,W){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,W={id:h++,callback:ne,priorityLevel:W,startTime:T,expirationTime:q,sortIndex:-1},T>O?(W.sortIndex=T,t(m,W),n(p)===null&&W===n(m)&&(j?(S(D),D=-1):j=!0,le(R,T-O))):(W.sortIndex=q,t(p,W),C||b||(C=!0,Q(I))),W},e.unstable_shouldYield=z,e.unstable_wrapCallback=function(W){var ne=y;return function(){var T=y;y=ne;try{return W.apply(this,arguments)}finally{y=T}}}})(Hp)),Hp}var Ib;function mE(){return Ib||(Ib=1,Vp.exports=pE()),Vp.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 Ob;function hE(){if(Ob)return qn;Ob=1;var e=Th(),t=mE();function n(o){for(var a="https://reactjs.org/docs/error-decoder.html?invariant="+o,d=1;d<arguments.length;d++)a+="&args[]="+encodeURIComponent(arguments[d]);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 u=!(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 b(o,a,d,g){if(d!==null&&d.type===0)return!1;switch(typeof a){case"function":case"symbol":return!0;case"boolean":return g?!1:d!==null?!d.acceptsBooleans:(o=o.toLowerCase().slice(0,5),o!=="data-"&&o!=="aria-");default:return!1}}function C(o,a,d,g){if(a===null||typeof a>"u"||b(o,a,d,g))return!0;if(g)return!1;if(d!==null)switch(d.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,d,g,v,k,A){this.acceptsBooleans=a===2||a===3||a===4,this.attributeName=g,this.attributeNamespace=v,this.mustUseProperty=d,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,d,g){var v=w.hasOwnProperty(a)?w[a]:null;(v!==null?v.type!==0:g||!(2<a.length)||a[0]!=="o"&&a[0]!=="O"||a[1]!=="n"&&a[1]!=="N")&&(C(a,d,v,g)&&(d=null),g||v===null?y(a)&&(d===null?o.removeAttribute(a):o.setAttribute(a,""+d)):v.mustUseProperty?o[v.propertyName]=d===null?v.type===3?!1:"":d:(a=v.attributeName,g=v.attributeNamespace,d===null?o.removeAttribute(a):(v=v.type,d=v===3||v===4&&d===!0?"":""+d,g?o.setAttributeNS(g,a,d):o.setAttribute(a,d))))}var R=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,I=Symbol.for("react.element"),P=Symbol.for("react.portal"),$=Symbol.for("react.fragment"),D=Symbol.for("react.strict_mode"),X=Symbol.for("react.profiler"),Z=Symbol.for("react.provider"),z=Symbol.for("react.context"),U=Symbol.for("react.forward_ref"),J=Symbol.for("react.suspense"),_=Symbol.for("react.suspense_list"),G=Symbol.for("react.memo"),Q=Symbol.for("react.lazy"),le=Symbol.for("react.offscreen"),W=Symbol.iterator;function ne(o){return o===null||typeof o!="object"?null:(o=W&&o[W]||o["@@iterator"],typeof o=="function"?o:null)}var T=Object.assign,O;function q(o){if(O===void 0)try{throw Error()}catch(d){var a=d.stack.trim().match(/\n( *(at )?)/);O=a&&a[1]||""}return`
|
|
34
|
+
`+O+o}var L=!1;function ee(o,a){if(!o||L)return"";L=!0;var d=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(ce){var g=ce}Reflect.construct(o,[],a)}else{try{a.call()}catch(ce){g=ce}o.call(a.prototype)}else{try{throw Error()}catch(ce){g=ce}o()}}catch(ce){if(ce&&g&&typeof ce.stack=="string"){for(var v=ce.stack.split(`
|
|
35
|
+
`),k=g.stack.split(`
|
|
36
|
+
`),A=v.length-1,B=k.length-1;1<=A&&0<=B&&v[A]!==k[B];)B--;for(;1<=A&&0<=B;A--,B--)if(v[A]!==k[B]){if(A!==1||B!==1)do if(A--,B--,0>B||v[A]!==k[B]){var K=`
|
|
37
|
+
`+v[A].replace(" at new "," at ");return o.displayName&&K.includes("<anonymous>")&&(K=K.replace("<anonymous>",o.displayName)),K}while(1<=A&&0<=B);break}}}finally{L=!1,Error.prepareStackTrace=d}return(o=o?o.displayName||o.name:"")?q(o):""}function de(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=ee(o.type,!1),o;case 11:return o=ee(o.type.render,!1),o;case 1:return o=ee(o.type,!0),o;default:return""}}function F(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 P: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 z:return(o.displayName||"Context")+".Consumer";case Z:return(o._context.displayName||"Context")+".Provider";case U:var a=o.render;return o=o.displayName,o||(o=a.displayName||a.name||"",o=o!==""?"ForwardRef("+o+")":"ForwardRef"),o;case G:return a=o.displayName||null,a!==null?a:F(o.type)||"Memo";case Q:a=o._payload,o=o._init;try{return F(o(a))}catch{}}return null}function re(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 F(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 me(o){switch(typeof o){case"boolean":case"number":case"string":case"undefined":return o;case"object":return o;default:return""}}function ve(o){var a=o.type;return(o=o.nodeName)&&o.toLowerCase()==="input"&&(a==="checkbox"||a==="radio")}function Se(o){var a=ve(o)?"checked":"value",d=Object.getOwnPropertyDescriptor(o.constructor.prototype,a),g=""+o[a];if(!o.hasOwnProperty(a)&&typeof d<"u"&&typeof d.get=="function"&&typeof d.set=="function"){var v=d.get,k=d.set;return Object.defineProperty(o,a,{configurable:!0,get:function(){return v.call(this)},set:function(A){g=""+A,k.call(this,A)}}),Object.defineProperty(o,a,{enumerable:d.enumerable}),{getValue:function(){return g},setValue:function(A){g=""+A},stopTracking:function(){o._valueTracker=null,delete o[a]}}}}function fe(o){o._valueTracker||(o._valueTracker=Se(o))}function He(o){if(!o)return!1;var a=o._valueTracker;if(!a)return!0;var d=a.getValue(),g="";return o&&(g=ve(o)?o.checked?"true":"false":o.value),o=g,o!==d?(a.setValue(o),!0):!1}function pe(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 Pe(o,a){var d=a.checked;return T({},a,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:d??o._wrapperState.initialChecked})}function V(o,a){var d=a.defaultValue==null?"":a.defaultValue,g=a.checked!=null?a.checked:a.defaultChecked;d=me(a.value!=null?a.value:d),o._wrapperState={initialChecked:g,initialValue:d,controlled:a.type==="checkbox"||a.type==="radio"?a.checked!=null:a.value!=null}}function H(o,a){a=a.checked,a!=null&&N(o,"checked",a,!1)}function ae(o,a){H(o,a);var d=me(a.value),g=a.type;if(d!=null)g==="number"?(d===0&&o.value===""||o.value!=d)&&(o.value=""+d):o.value!==""+d&&(o.value=""+d);else if(g==="submit"||g==="reset"){o.removeAttribute("value");return}a.hasOwnProperty("value")?Ae(o,a.type,d):a.hasOwnProperty("defaultValue")&&Ae(o,a.type,me(a.defaultValue)),a.checked==null&&a.defaultChecked!=null&&(o.defaultChecked=!!a.defaultChecked)}function he(o,a,d){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,d||a===o.value||(o.value=a),o.defaultValue=a}d=o.name,d!==""&&(o.name=""),o.defaultChecked=!!o._wrapperState.initialChecked,d!==""&&(o.name=d)}function Ae(o,a,d){(a!=="number"||pe(o.ownerDocument)!==o)&&(d==null?o.defaultValue=""+o._wrapperState.initialValue:o.defaultValue!==""+d&&(o.defaultValue=""+d))}var Te=Array.isArray;function Ve(o,a,d,g){if(o=o.options,a){a={};for(var v=0;v<d.length;v++)a["$"+d[v]]=!0;for(d=0;d<o.length;d++)v=a.hasOwnProperty("$"+o[d].value),o[d].selected!==v&&(o[d].selected=v),v&&g&&(o[d].defaultSelected=!0)}else{for(d=""+me(d),a=null,v=0;v<o.length;v++){if(o[v].value===d){o[v].selected=!0,g&&(o[v].defaultSelected=!0);return}a!==null||o[v].disabled||(a=o[v])}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 Tt(o,a){var d=a.value;if(d==null){if(d=a.children,a=a.defaultValue,d!=null){if(a!=null)throw Error(n(92));if(Te(d)){if(1<d.length)throw Error(n(93));d=d[0]}a=d}a==null&&(a=""),d=a}o._wrapperState={initialValue:me(d)}}function yt(o,a){var d=me(a.value),g=me(a.defaultValue);d!=null&&(d=""+d,d!==o.value&&(o.value=d),a.defaultValue==null&&o.defaultValue!==d&&(o.defaultValue=d)),g!=null&&(o.defaultValue=""+g)}function jt(o){var a=o.textContent;a===o._wrapperState.initialValue&&a!==""&&a!==null&&(o.value=a)}function ue(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 ye(o,a){return o==null||o==="http://www.w3.org/1999/xhtml"?ue(a):o==="http://www.w3.org/2000/svg"&&a==="foreignObject"?"http://www.w3.org/1999/xhtml":o}var Le,Ie=(function(o){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(a,d,g,v){MSApp.execUnsafeLocalFunction(function(){return o(a,d,g,v)})}:o})(function(o,a){if(o.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in o)o.innerHTML=a;else{for(Le=Le||document.createElement("div"),Le.innerHTML="<svg>"+a.valueOf().toString()+"</svg>",a=Le.firstChild;o.firstChild;)o.removeChild(o.firstChild);for(;a.firstChild;)o.appendChild(a.firstChild)}});function We(o,a){if(a){var d=o.firstChild;if(d&&d===o.lastChild&&d.nodeType===3){d.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},_t=["Webkit","ms","Moz","O"];Object.keys(et).forEach(function(o){_t.forEach(function(a){a=a+o.charAt(0).toUpperCase()+o.substring(1),et[a]=et[o]})});function bt(o,a,d){return a==null||typeof a=="boolean"||a===""?"":d||typeof a!="number"||a===0||et.hasOwnProperty(o)&&et[o]?(""+a).trim():a+"px"}function Qt(o,a){o=o.style;for(var d in a)if(a.hasOwnProperty(d)){var g=d.indexOf("--")===0,v=bt(d,a[d],g);d==="float"&&(d="cssFloat"),g?o.setProperty(d,v):o[d]=v}}var sn=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 vt(o,a){if(a){if(sn[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 xe(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 Ye=null;function Ke(o){return o=o.target||o.srcElement||window,o.correspondingUseElement&&(o=o.correspondingUseElement),o.nodeType===3?o.parentNode:o}var vn=null,zn=null,ft=null;function Vt(o){if(o=Ua(o)){if(typeof vn!="function")throw Error(n(280));var a=o.stateNode;a&&(a=Sc(a),vn(o.stateNode,o.type,a))}}function It(o){zn?ft?ft.push(o):ft=[o]:zn=o}function Zt(){if(zn){var o=zn,a=ft;if(ft=zn=null,Vt(o),a)for(o=0;o<a.length;o++)Vt(a[o])}}function se(o,a){return o(a)}function Oe(){}var Je=!1;function Gt(o,a,d){if(Je)return o(a,d);Je=!0;try{return se(o,a,d)}finally{Je=!1,(zn!==null||ft!==null)&&(Oe(),Zt())}}function tt(o,a){var d=o.stateNode;if(d===null)return null;var g=Sc(d);if(g===null)return null;d=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(d&&typeof d!="function")throw Error(n(231,a,typeof d));return d}var pn=!1;if(u)try{var on={};Object.defineProperty(on,"passive",{get:function(){pn=!0}}),window.addEventListener("test",on,on),window.removeEventListener("test",on,on)}catch{pn=!1}function an(o,a,d,g,v,k,A,B,K){var ce=Array.prototype.slice.call(arguments,3);try{a.apply(d,ce)}catch(je){this.onError(je)}}var pt=!1,xr=null,wn=!1,nr=null,hs={onError:function(o){pt=!0,xr=o}};function wa(o,a,d,g,v,k,A,B,K){pt=!1,xr=null,an.apply(hs,arguments)}function ja(o,a,d,g,v,k,A,B,K){if(wa.apply(this,arguments),pt){if(pt){var ce=xr;pt=!1,xr=null}else throw Error(n(198));wn||(wn=!0,nr=ce)}}function Lr(o){var a=o,d=o;if(o.alternate)for(;a.return;)a=a.return;else{o=a;do a=o,(a.flags&4098)!==0&&(d=a.return),o=a.return;while(o)}return a.tag===3?d:null}function qo(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 mo(o){if(Lr(o)!==o)throw Error(n(188))}function af(o){var a=o.alternate;if(!a){if(a=Lr(o),a===null)throw Error(n(188));return a!==o?null:o}for(var d=o,g=a;;){var v=d.return;if(v===null)break;var k=v.alternate;if(k===null){if(g=v.return,g!==null){d=g;continue}break}if(v.child===k.child){for(k=v.child;k;){if(k===d)return mo(v),o;if(k===g)return mo(v),a;k=k.sibling}throw Error(n(188))}if(d.return!==g.return)d=v,g=k;else{for(var A=!1,B=v.child;B;){if(B===d){A=!0,d=v,g=k;break}if(B===g){A=!0,g=v,d=k;break}B=B.sibling}if(!A){for(B=k.child;B;){if(B===d){A=!0,d=k,g=v;break}if(B===g){A=!0,g=k,d=v;break}B=B.sibling}if(!A)throw Error(n(189))}}if(d.alternate!==g)throw Error(n(190))}if(d.tag!==3)throw Error(n(188));return d.stateNode.current===d?o:a}function ho(o){return o=af(o),o!==null?go(o):null}function go(o){if(o.tag===5||o.tag===6)return o;for(o=o.child;o!==null;){var a=go(o);if(a!==null)return a;o=o.sibling}return null}var sc=t.unstable_scheduleCallback,oc=t.unstable_cancelCallback,lf=t.unstable_shouldYield,Gr=t.unstable_requestPaint,Ft=t.unstable_now,cf=t.unstable_getCurrentPriorityLevel,ka=t.unstable_ImmediatePriority,ic=t.unstable_UserBlockingPriority,Pt=t.unstable_NormalPriority,xo=t.unstable_LowPriority,Go=t.unstable_IdlePriority,Yo=null,yr=null;function ac(o){if(yr&&typeof yr.onCommitFiberRoot=="function")try{yr.onCommitFiberRoot(Yo,o,void 0,(o.current.flags&128)===128)}catch{}}var Dn=Math.clz32?Math.clz32:uf,lc=Math.log,Jo=Math.LN2;function uf(o){return o>>>=0,o===0?32:31-(lc(o)/Jo|0)|0}var Xo=64,Qo=4194304;function mn(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 Zo(o,a){var d=o.pendingLanes;if(d===0)return 0;var g=0,v=o.suspendedLanes,k=o.pingedLanes,A=d&268435455;if(A!==0){var B=A&~v;B!==0?g=mn(B):(k&=A,k!==0&&(g=mn(k)))}else A=d&~v,A!==0?g=mn(A):k!==0&&(g=mn(k));if(g===0)return 0;if(a!==0&&a!==g&&(a&v)===0&&(v=g&-g,k=a&-a,v>=k||v===16&&(k&4194240)!==0))return a;if((g&4)!==0&&(g|=d&16),a=o.entangledLanes,a!==0)for(o=o.entanglements,a&=g;0<a;)d=31-Dn(a),v=1<<d,g|=o[d],a&=~v;return g}function Sa(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 df(o,a){for(var d=o.suspendedLanes,g=o.pingedLanes,v=o.expirationTimes,k=o.pendingLanes;0<k;){var A=31-Dn(k),B=1<<A,K=v[A];K===-1?((B&d)===0||(B&g)!==0)&&(v[A]=Sa(B,a)):K<=a&&(o.expiredLanes|=B),k&=~B}}function Na(o){return o=o.pendingLanes&-1073741825,o!==0?o:o&1073741824?1073741824:0}function cc(){var o=Xo;return Xo<<=1,(Xo&4194240)===0&&(Xo=64),o}function Yr(o){for(var a=[],d=0;31>d;d++)a.push(o);return a}function M(o,a,d){o.pendingLanes|=a,a!==536870912&&(o.suspendedLanes=0,o.pingedLanes=0),o=o.eventTimes,a=31-Dn(a),o[a]=d}function ie(o,a){var d=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<d;){var v=31-Dn(d),k=1<<v;a[v]=0,g[v]=-1,o[v]=-1,d&=~k}}function ge(o,a){var d=o.entangledLanes|=a;for(o=o.entanglements;d;){var g=31-Dn(d),v=1<<g;v&a|o[g]&a&&(o[g]|=a),d&=~v}}var be=0;function st(o){return o&=-o,1<o?4<o?(o&268435455)!==0?16:536870912:4:1}var lt,xt,Bn,Ln,rr,sr=!1,yo=[],$r=null,or=null,Jr=null,Ca=new Map,Ea=new Map,Ds=[],PN="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 fx(o,a){switch(o){case"focusin":case"focusout":$r=null;break;case"dragenter":case"dragleave":or=null;break;case"mouseover":case"mouseout":Jr=null;break;case"pointerover":case"pointerout":Ca.delete(a.pointerId);break;case"gotpointercapture":case"lostpointercapture":Ea.delete(a.pointerId)}}function Ta(o,a,d,g,v,k){return o===null||o.nativeEvent!==k?(o={blockedOn:a,domEventName:d,eventSystemFlags:g,nativeEvent:k,targetContainers:[v]},a!==null&&(a=Ua(a),a!==null&&xt(a)),o):(o.eventSystemFlags|=g,a=o.targetContainers,v!==null&&a.indexOf(v)===-1&&a.push(v),o)}function RN(o,a,d,g,v){switch(a){case"focusin":return $r=Ta($r,o,a,d,g,v),!0;case"dragenter":return or=Ta(or,o,a,d,g,v),!0;case"mouseover":return Jr=Ta(Jr,o,a,d,g,v),!0;case"pointerover":var k=v.pointerId;return Ca.set(k,Ta(Ca.get(k)||null,o,a,d,g,v)),!0;case"gotpointercapture":return k=v.pointerId,Ea.set(k,Ta(Ea.get(k)||null,o,a,d,g,v)),!0}return!1}function px(o){var a=bo(o.target);if(a!==null){var d=Lr(a);if(d!==null){if(a=d.tag,a===13){if(a=qo(d),a!==null){o.blockedOn=a,rr(o.priority,function(){Bn(d)});return}}else if(a===3&&d.stateNode.current.memoizedState.isDehydrated){o.blockedOn=d.tag===3?d.stateNode.containerInfo:null;return}}}o.blockedOn=null}function uc(o){if(o.blockedOn!==null)return!1;for(var a=o.targetContainers;0<a.length;){var d=pf(o.domEventName,o.eventSystemFlags,a[0],o.nativeEvent);if(d===null){d=o.nativeEvent;var g=new d.constructor(d.type,d);Ye=g,d.target.dispatchEvent(g),Ye=null}else return a=Ua(d),a!==null&&xt(a),o.blockedOn=d,!1;a.shift()}return!0}function mx(o,a,d){uc(o)&&d.delete(a)}function AN(){sr=!1,$r!==null&&uc($r)&&($r=null),or!==null&&uc(or)&&(or=null),Jr!==null&&uc(Jr)&&(Jr=null),Ca.forEach(mx),Ea.forEach(mx)}function Pa(o,a){o.blockedOn===a&&(o.blockedOn=null,sr||(sr=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,AN)))}function Ra(o){function a(v){return Pa(v,o)}if(0<yo.length){Pa(yo[0],o);for(var d=1;d<yo.length;d++){var g=yo[d];g.blockedOn===o&&(g.blockedOn=null)}}for($r!==null&&Pa($r,o),or!==null&&Pa(or,o),Jr!==null&&Pa(Jr,o),Ca.forEach(a),Ea.forEach(a),d=0;d<Ds.length;d++)g=Ds[d],g.blockedOn===o&&(g.blockedOn=null);for(;0<Ds.length&&(d=Ds[0],d.blockedOn===null);)px(d),d.blockedOn===null&&Ds.shift()}var ei=R.ReactCurrentBatchConfig,dc=!0;function DN(o,a,d,g){var v=be,k=ei.transition;ei.transition=null;try{be=1,ff(o,a,d,g)}finally{be=v,ei.transition=k}}function LN(o,a,d,g){var v=be,k=ei.transition;ei.transition=null;try{be=4,ff(o,a,d,g)}finally{be=v,ei.transition=k}}function ff(o,a,d,g){if(dc){var v=pf(o,a,d,g);if(v===null)Rf(o,a,g,fc,d),fx(o,g);else if(RN(v,o,a,d,g))g.stopPropagation();else if(fx(o,g),a&4&&-1<PN.indexOf(o)){for(;v!==null;){var k=Ua(v);if(k!==null&<(k),k=pf(o,a,d,g),k===null&&Rf(o,a,g,fc,d),k===v)break;v=k}v!==null&&g.stopPropagation()}else Rf(o,a,g,null,d)}}var fc=null;function pf(o,a,d,g){if(fc=null,o=Ke(g),o=bo(o),o!==null)if(a=Lr(o),a===null)o=null;else if(d=a.tag,d===13){if(o=qo(a),o!==null)return o;o=null}else if(d===3){if(a.stateNode.current.memoizedState.isDehydrated)return a.tag===3?a.stateNode.containerInfo:null;o=null}else a!==o&&(o=null);return fc=o,null}function hx(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(cf()){case ka:return 1;case ic:return 4;case Pt:case xo:return 16;case Go:return 536870912;default:return 16}default:return 16}}var Ls=null,mf=null,pc=null;function gx(){if(pc)return pc;var o,a=mf,d=a.length,g,v="value"in Ls?Ls.value:Ls.textContent,k=v.length;for(o=0;o<d&&a[o]===v[o];o++);var A=d-o;for(g=1;g<=A&&a[d-g]===v[k-g];g++);return pc=v.slice(o,1<g?1-g:void 0)}function mc(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 hc(){return!0}function xx(){return!1}function ir(o){function a(d,g,v,k,A){this._reactName=d,this._targetInst=v,this.type=g,this.nativeEvent=k,this.target=A,this.currentTarget=null;for(var B in o)o.hasOwnProperty(B)&&(d=o[B],this[B]=d?d(k):k[B]);return this.isDefaultPrevented=(k.defaultPrevented!=null?k.defaultPrevented:k.returnValue===!1)?hc:xx,this.isPropagationStopped=xx,this}return T(a.prototype,{preventDefault:function(){this.defaultPrevented=!0;var d=this.nativeEvent;d&&(d.preventDefault?d.preventDefault():typeof d.returnValue!="unknown"&&(d.returnValue=!1),this.isDefaultPrevented=hc)},stopPropagation:function(){var d=this.nativeEvent;d&&(d.stopPropagation?d.stopPropagation():typeof d.cancelBubble!="unknown"&&(d.cancelBubble=!0),this.isPropagationStopped=hc)},persist:function(){},isPersistent:hc}),a}var ti={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(o){return o.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},hf=ir(ti),Aa=T({},ti,{view:0,detail:0}),$N=ir(Aa),gf,xf,Da,gc=T({},Aa,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:bf,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!==Da&&(Da&&o.type==="mousemove"?(gf=o.screenX-Da.screenX,xf=o.screenY-Da.screenY):xf=gf=0,Da=o),gf)},movementY:function(o){return"movementY"in o?o.movementY:xf}}),yx=ir(gc),IN=T({},gc,{dataTransfer:0}),ON=ir(IN),MN=T({},Aa,{relatedTarget:0}),yf=ir(MN),_N=T({},ti,{animationName:0,elapsedTime:0,pseudoElement:0}),FN=ir(_N),zN=T({},ti,{clipboardData:function(o){return"clipboardData"in o?o.clipboardData:window.clipboardData}}),BN=ir(zN),UN=T({},ti,{data:0}),bx=ir(UN),VN={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},HN={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"},WN={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function KN(o){var a=this.nativeEvent;return a.getModifierState?a.getModifierState(o):(o=WN[o])?!!a[o]:!1}function bf(){return KN}var qN=T({},Aa,{key:function(o){if(o.key){var a=VN[o.key]||o.key;if(a!=="Unidentified")return a}return o.type==="keypress"?(o=mc(o),o===13?"Enter":String.fromCharCode(o)):o.type==="keydown"||o.type==="keyup"?HN[o.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:bf,charCode:function(o){return o.type==="keypress"?mc(o):0},keyCode:function(o){return o.type==="keydown"||o.type==="keyup"?o.keyCode:0},which:function(o){return o.type==="keypress"?mc(o):o.type==="keydown"||o.type==="keyup"?o.keyCode:0}}),GN=ir(qN),YN=T({},gc,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),vx=ir(YN),JN=T({},Aa,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:bf}),XN=ir(JN),QN=T({},ti,{propertyName:0,elapsedTime:0,pseudoElement:0}),ZN=ir(QN),eC=T({},gc,{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}),tC=ir(eC),nC=[9,13,27,32],vf=u&&"CompositionEvent"in window,La=null;u&&"documentMode"in document&&(La=document.documentMode);var rC=u&&"TextEvent"in window&&!La,wx=u&&(!vf||La&&8<La&&11>=La),jx=" ",kx=!1;function Sx(o,a){switch(o){case"keyup":return nC.indexOf(a.keyCode)!==-1;case"keydown":return a.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Nx(o){return o=o.detail,typeof o=="object"&&"data"in o?o.data:null}var ni=!1;function sC(o,a){switch(o){case"compositionend":return Nx(a);case"keypress":return a.which!==32?null:(kx=!0,jx);case"textInput":return o=a.data,o===jx&&kx?null:o;default:return null}}function oC(o,a){if(ni)return o==="compositionend"||!vf&&Sx(o,a)?(o=gx(),pc=mf=Ls=null,ni=!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 wx&&a.locale!=="ko"?null:a.data;default:return null}}var iC={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 Cx(o){var a=o&&o.nodeName&&o.nodeName.toLowerCase();return a==="input"?!!iC[o.type]:a==="textarea"}function Ex(o,a,d,g){It(g),a=wc(a,"onChange"),0<a.length&&(d=new hf("onChange","change",null,d,g),o.push({event:d,listeners:a}))}var $a=null,Ia=null;function aC(o){Wx(o,0)}function xc(o){var a=ai(o);if(He(a))return o}function lC(o,a){if(o==="change")return a}var Tx=!1;if(u){var wf;if(u){var jf="oninput"in document;if(!jf){var Px=document.createElement("div");Px.setAttribute("oninput","return;"),jf=typeof Px.oninput=="function"}wf=jf}else wf=!1;Tx=wf&&(!document.documentMode||9<document.documentMode)}function Rx(){$a&&($a.detachEvent("onpropertychange",Ax),Ia=$a=null)}function Ax(o){if(o.propertyName==="value"&&xc(Ia)){var a=[];Ex(a,Ia,o,Ke(o)),Gt(aC,a)}}function cC(o,a,d){o==="focusin"?(Rx(),$a=a,Ia=d,$a.attachEvent("onpropertychange",Ax)):o==="focusout"&&Rx()}function uC(o){if(o==="selectionchange"||o==="keyup"||o==="keydown")return xc(Ia)}function dC(o,a){if(o==="click")return xc(a)}function fC(o,a){if(o==="input"||o==="change")return xc(a)}function pC(o,a){return o===a&&(o!==0||1/o===1/a)||o!==o&&a!==a}var Ir=typeof Object.is=="function"?Object.is:pC;function Oa(o,a){if(Ir(o,a))return!0;if(typeof o!="object"||o===null||typeof a!="object"||a===null)return!1;var d=Object.keys(o),g=Object.keys(a);if(d.length!==g.length)return!1;for(g=0;g<d.length;g++){var v=d[g];if(!p.call(a,v)||!Ir(o[v],a[v]))return!1}return!0}function Dx(o){for(;o&&o.firstChild;)o=o.firstChild;return o}function Lx(o,a){var d=Dx(o);o=0;for(var g;d;){if(d.nodeType===3){if(g=o+d.textContent.length,o<=a&&g>=a)return{node:d,offset:a-o};o=g}e:{for(;d;){if(d.nextSibling){d=d.nextSibling;break e}d=d.parentNode}d=void 0}d=Dx(d)}}function $x(o,a){return o&&a?o===a?!0:o&&o.nodeType===3?!1:a&&a.nodeType===3?$x(o,a.parentNode):"contains"in o?o.contains(a):o.compareDocumentPosition?!!(o.compareDocumentPosition(a)&16):!1:!1}function Ix(){for(var o=window,a=pe();a instanceof o.HTMLIFrameElement;){try{var d=typeof a.contentWindow.location.href=="string"}catch{d=!1}if(d)o=a.contentWindow;else break;a=pe(o.document)}return a}function kf(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 mC(o){var a=Ix(),d=o.focusedElem,g=o.selectionRange;if(a!==d&&d&&d.ownerDocument&&$x(d.ownerDocument.documentElement,d)){if(g!==null&&kf(d)){if(a=g.start,o=g.end,o===void 0&&(o=a),"selectionStart"in d)d.selectionStart=a,d.selectionEnd=Math.min(o,d.value.length);else if(o=(a=d.ownerDocument||document)&&a.defaultView||window,o.getSelection){o=o.getSelection();var v=d.textContent.length,k=Math.min(g.start,v);g=g.end===void 0?k:Math.min(g.end,v),!o.extend&&k>g&&(v=g,g=k,k=v),v=Lx(d,k);var A=Lx(d,g);v&&A&&(o.rangeCount!==1||o.anchorNode!==v.node||o.anchorOffset!==v.offset||o.focusNode!==A.node||o.focusOffset!==A.offset)&&(a=a.createRange(),a.setStart(v.node,v.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=d;o=o.parentNode;)o.nodeType===1&&a.push({element:o,left:o.scrollLeft,top:o.scrollTop});for(typeof d.focus=="function"&&d.focus(),d=0;d<a.length;d++)o=a[d],o.element.scrollLeft=o.left,o.element.scrollTop=o.top}}var hC=u&&"documentMode"in document&&11>=document.documentMode,ri=null,Sf=null,Ma=null,Nf=!1;function Ox(o,a,d){var g=d.window===d?d.document:d.nodeType===9?d:d.ownerDocument;Nf||ri==null||ri!==pe(g)||(g=ri,"selectionStart"in g&&kf(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}),Ma&&Oa(Ma,g)||(Ma=g,g=wc(Sf,"onSelect"),0<g.length&&(a=new hf("onSelect","select",null,a,d),o.push({event:a,listeners:g}),a.target=ri)))}function yc(o,a){var d={};return d[o.toLowerCase()]=a.toLowerCase(),d["Webkit"+o]="webkit"+a,d["Moz"+o]="moz"+a,d}var si={animationend:yc("Animation","AnimationEnd"),animationiteration:yc("Animation","AnimationIteration"),animationstart:yc("Animation","AnimationStart"),transitionend:yc("Transition","TransitionEnd")},Cf={},Mx={};u&&(Mx=document.createElement("div").style,"AnimationEvent"in window||(delete si.animationend.animation,delete si.animationiteration.animation,delete si.animationstart.animation),"TransitionEvent"in window||delete si.transitionend.transition);function bc(o){if(Cf[o])return Cf[o];if(!si[o])return o;var a=si[o],d;for(d in a)if(a.hasOwnProperty(d)&&d in Mx)return Cf[o]=a[d];return o}var _x=bc("animationend"),Fx=bc("animationiteration"),zx=bc("animationstart"),Bx=bc("transitionend"),Ux=new Map,Vx="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 $s(o,a){Ux.set(o,a),l(a,[o])}for(var Ef=0;Ef<Vx.length;Ef++){var Tf=Vx[Ef],gC=Tf.toLowerCase(),xC=Tf[0].toUpperCase()+Tf.slice(1);$s(gC,"on"+xC)}$s(_x,"onAnimationEnd"),$s(Fx,"onAnimationIteration"),$s(zx,"onAnimationStart"),$s("dblclick","onDoubleClick"),$s("focusin","onFocus"),$s("focusout","onBlur"),$s(Bx,"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 _a="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(" "),yC=new Set("cancel close invalid load scroll toggle".split(" ").concat(_a));function Hx(o,a,d){var g=o.type||"unknown-event";o.currentTarget=d,ja(g,a,void 0,o),o.currentTarget=null}function Wx(o,a){a=(a&4)!==0;for(var d=0;d<o.length;d++){var g=o[d],v=g.event;g=g.listeners;e:{var k=void 0;if(a)for(var A=g.length-1;0<=A;A--){var B=g[A],K=B.instance,ce=B.currentTarget;if(B=B.listener,K!==k&&v.isPropagationStopped())break e;Hx(v,B,ce),k=K}else for(A=0;A<g.length;A++){if(B=g[A],K=B.instance,ce=B.currentTarget,B=B.listener,K!==k&&v.isPropagationStopped())break e;Hx(v,B,ce),k=K}}}if(wn)throw o=nr,wn=!1,nr=null,o}function Rt(o,a){var d=a[Of];d===void 0&&(d=a[Of]=new Set);var g=o+"__bubble";d.has(g)||(Kx(a,o,2,!1),d.add(g))}function Pf(o,a,d){var g=0;a&&(g|=4),Kx(d,o,g,a)}var vc="_reactListening"+Math.random().toString(36).slice(2);function Fa(o){if(!o[vc]){o[vc]=!0,s.forEach(function(d){d!=="selectionchange"&&(yC.has(d)||Pf(d,!1,o),Pf(d,!0,o))});var a=o.nodeType===9?o:o.ownerDocument;a===null||a[vc]||(a[vc]=!0,Pf("selectionchange",!1,a))}}function Kx(o,a,d,g){switch(hx(a)){case 1:var v=DN;break;case 4:v=LN;break;default:v=ff}d=v.bind(null,a,d,o),v=void 0,!pn||a!=="touchstart"&&a!=="touchmove"&&a!=="wheel"||(v=!0),g?v!==void 0?o.addEventListener(a,d,{capture:!0,passive:v}):o.addEventListener(a,d,!0):v!==void 0?o.addEventListener(a,d,{passive:v}):o.addEventListener(a,d,!1)}function Rf(o,a,d,g,v){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 B=g.stateNode.containerInfo;if(B===v||B.nodeType===8&&B.parentNode===v)break;if(A===4)for(A=g.return;A!==null;){var K=A.tag;if((K===3||K===4)&&(K=A.stateNode.containerInfo,K===v||K.nodeType===8&&K.parentNode===v))return;A=A.return}for(;B!==null;){if(A=bo(B),A===null)return;if(K=A.tag,K===5||K===6){g=k=A;continue e}B=B.parentNode}}g=g.return}Gt(function(){var ce=k,je=Ke(d),ke=[];e:{var we=Ux.get(o);if(we!==void 0){var $e=hf,_e=o;switch(o){case"keypress":if(mc(d)===0)break e;case"keydown":case"keyup":$e=GN;break;case"focusin":_e="focus",$e=yf;break;case"focusout":_e="blur",$e=yf;break;case"beforeblur":case"afterblur":$e=yf;break;case"click":if(d.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":$e=yx;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":$e=ON;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":$e=XN;break;case _x:case Fx:case zx:$e=FN;break;case Bx:$e=ZN;break;case"scroll":$e=$N;break;case"wheel":$e=tC;break;case"copy":case"cut":case"paste":$e=BN;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":$e=vx}var Fe=(a&4)!==0,Yt=!Fe&&o==="scroll",te=Fe?we!==null?we+"Capture":null:we;Fe=[];for(var Y=ce,oe;Y!==null;){oe=Y;var Ce=oe.stateNode;if(oe.tag===5&&Ce!==null&&(oe=Ce,te!==null&&(Ce=tt(Y,te),Ce!=null&&Fe.push(za(Y,Ce,oe)))),Yt)break;Y=Y.return}0<Fe.length&&(we=new $e(we,_e,null,d,je),ke.push({event:we,listeners:Fe}))}}if((a&7)===0){e:{if(we=o==="mouseover"||o==="pointerover",$e=o==="mouseout"||o==="pointerout",we&&d!==Ye&&(_e=d.relatedTarget||d.fromElement)&&(bo(_e)||_e[gs]))break e;if(($e||we)&&(we=je.window===je?je:(we=je.ownerDocument)?we.defaultView||we.parentWindow:window,$e?(_e=d.relatedTarget||d.toElement,$e=ce,_e=_e?bo(_e):null,_e!==null&&(Yt=Lr(_e),_e!==Yt||_e.tag!==5&&_e.tag!==6)&&(_e=null)):($e=null,_e=ce),$e!==_e)){if(Fe=yx,Ce="onMouseLeave",te="onMouseEnter",Y="mouse",(o==="pointerout"||o==="pointerover")&&(Fe=vx,Ce="onPointerLeave",te="onPointerEnter",Y="pointer"),Yt=$e==null?we:ai($e),oe=_e==null?we:ai(_e),we=new Fe(Ce,Y+"leave",$e,d,je),we.target=Yt,we.relatedTarget=oe,Ce=null,bo(je)===ce&&(Fe=new Fe(te,Y+"enter",_e,d,je),Fe.target=oe,Fe.relatedTarget=Yt,Ce=Fe),Yt=Ce,$e&&_e)t:{for(Fe=$e,te=_e,Y=0,oe=Fe;oe;oe=oi(oe))Y++;for(oe=0,Ce=te;Ce;Ce=oi(Ce))oe++;for(;0<Y-oe;)Fe=oi(Fe),Y--;for(;0<oe-Y;)te=oi(te),oe--;for(;Y--;){if(Fe===te||te!==null&&Fe===te.alternate)break t;Fe=oi(Fe),te=oi(te)}Fe=null}else Fe=null;$e!==null&&qx(ke,we,$e,Fe,!1),_e!==null&&Yt!==null&&qx(ke,Yt,_e,Fe,!0)}}e:{if(we=ce?ai(ce):window,$e=we.nodeName&&we.nodeName.toLowerCase(),$e==="select"||$e==="input"&&we.type==="file")var Ue=lC;else if(Cx(we))if(Tx)Ue=fC;else{Ue=uC;var qe=cC}else($e=we.nodeName)&&$e.toLowerCase()==="input"&&(we.type==="checkbox"||we.type==="radio")&&(Ue=dC);if(Ue&&(Ue=Ue(o,ce))){Ex(ke,Ue,d,je);break e}qe&&qe(o,we,ce),o==="focusout"&&(qe=we._wrapperState)&&qe.controlled&&we.type==="number"&&Ae(we,"number",we.value)}switch(qe=ce?ai(ce):window,o){case"focusin":(Cx(qe)||qe.contentEditable==="true")&&(ri=qe,Sf=ce,Ma=null);break;case"focusout":Ma=Sf=ri=null;break;case"mousedown":Nf=!0;break;case"contextmenu":case"mouseup":case"dragend":Nf=!1,Ox(ke,d,je);break;case"selectionchange":if(hC)break;case"keydown":case"keyup":Ox(ke,d,je)}var Ge;if(vf)e:{switch(o){case"compositionstart":var Xe="onCompositionStart";break e;case"compositionend":Xe="onCompositionEnd";break e;case"compositionupdate":Xe="onCompositionUpdate";break e}Xe=void 0}else ni?Sx(o,d)&&(Xe="onCompositionEnd"):o==="keydown"&&d.keyCode===229&&(Xe="onCompositionStart");Xe&&(wx&&d.locale!=="ko"&&(ni||Xe!=="onCompositionStart"?Xe==="onCompositionEnd"&&ni&&(Ge=gx()):(Ls=je,mf="value"in Ls?Ls.value:Ls.textContent,ni=!0)),qe=wc(ce,Xe),0<qe.length&&(Xe=new bx(Xe,o,null,d,je),ke.push({event:Xe,listeners:qe}),Ge?Xe.data=Ge:(Ge=Nx(d),Ge!==null&&(Xe.data=Ge)))),(Ge=rC?sC(o,d):oC(o,d))&&(ce=wc(ce,"onBeforeInput"),0<ce.length&&(je=new bx("onBeforeInput","beforeinput",null,d,je),ke.push({event:je,listeners:ce}),je.data=Ge))}Wx(ke,a)})}function za(o,a,d){return{instance:o,listener:a,currentTarget:d}}function wc(o,a){for(var d=a+"Capture",g=[];o!==null;){var v=o,k=v.stateNode;v.tag===5&&k!==null&&(v=k,k=tt(o,d),k!=null&&g.unshift(za(o,k,v)),k=tt(o,a),k!=null&&g.push(za(o,k,v))),o=o.return}return g}function oi(o){if(o===null)return null;do o=o.return;while(o&&o.tag!==5);return o||null}function qx(o,a,d,g,v){for(var k=a._reactName,A=[];d!==null&&d!==g;){var B=d,K=B.alternate,ce=B.stateNode;if(K!==null&&K===g)break;B.tag===5&&ce!==null&&(B=ce,v?(K=tt(d,k),K!=null&&A.unshift(za(d,K,B))):v||(K=tt(d,k),K!=null&&A.push(za(d,K,B)))),d=d.return}A.length!==0&&o.push({event:a,listeners:A})}var bC=/\r\n?/g,vC=/\u0000|\uFFFD/g;function Gx(o){return(typeof o=="string"?o:""+o).replace(bC,`
|
|
38
|
+
`).replace(vC,"")}function jc(o,a,d){if(a=Gx(a),Gx(o)!==a&&d)throw Error(n(425))}function kc(){}var Af=null,Df=null;function Lf(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 $f=typeof setTimeout=="function"?setTimeout:void 0,wC=typeof clearTimeout=="function"?clearTimeout:void 0,Yx=typeof Promise=="function"?Promise:void 0,jC=typeof queueMicrotask=="function"?queueMicrotask:typeof Yx<"u"?function(o){return Yx.resolve(null).then(o).catch(kC)}:$f;function kC(o){setTimeout(function(){throw o})}function If(o,a){var d=a,g=0;do{var v=d.nextSibling;if(o.removeChild(d),v&&v.nodeType===8)if(d=v.data,d==="/$"){if(g===0){o.removeChild(v),Ra(a);return}g--}else d!=="$"&&d!=="$?"&&d!=="$!"||g++;d=v}while(d);Ra(a)}function Is(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 Jx(o){o=o.previousSibling;for(var a=0;o;){if(o.nodeType===8){var d=o.data;if(d==="$"||d==="$!"||d==="$?"){if(a===0)return o;a--}else d==="/$"&&a++}o=o.previousSibling}return null}var ii=Math.random().toString(36).slice(2),Xr="__reactFiber$"+ii,Ba="__reactProps$"+ii,gs="__reactContainer$"+ii,Of="__reactEvents$"+ii,SC="__reactListeners$"+ii,NC="__reactHandles$"+ii;function bo(o){var a=o[Xr];if(a)return a;for(var d=o.parentNode;d;){if(a=d[gs]||d[Xr]){if(d=a.alternate,a.child!==null||d!==null&&d.child!==null)for(o=Jx(o);o!==null;){if(d=o[Xr])return d;o=Jx(o)}return a}o=d,d=o.parentNode}return null}function Ua(o){return o=o[Xr]||o[gs],!o||o.tag!==5&&o.tag!==6&&o.tag!==13&&o.tag!==3?null:o}function ai(o){if(o.tag===5||o.tag===6)return o.stateNode;throw Error(n(33))}function Sc(o){return o[Ba]||null}var Mf=[],li=-1;function Os(o){return{current:o}}function At(o){0>li||(o.current=Mf[li],Mf[li]=null,li--)}function kt(o,a){li++,Mf[li]=o.current,o.current=a}var Ms={},Cn=Os(Ms),Un=Os(!1),vo=Ms;function ci(o,a){var d=o.type.contextTypes;if(!d)return Ms;var g=o.stateNode;if(g&&g.__reactInternalMemoizedUnmaskedChildContext===a)return g.__reactInternalMemoizedMaskedChildContext;var v={},k;for(k in d)v[k]=a[k];return g&&(o=o.stateNode,o.__reactInternalMemoizedUnmaskedChildContext=a,o.__reactInternalMemoizedMaskedChildContext=v),v}function Vn(o){return o=o.childContextTypes,o!=null}function Nc(){At(Un),At(Cn)}function Xx(o,a,d){if(Cn.current!==Ms)throw Error(n(168));kt(Cn,a),kt(Un,d)}function Qx(o,a,d){var g=o.stateNode;if(a=a.childContextTypes,typeof g.getChildContext!="function")return d;g=g.getChildContext();for(var v in g)if(!(v in a))throw Error(n(108,re(o)||"Unknown",v));return T({},d,g)}function Cc(o){return o=(o=o.stateNode)&&o.__reactInternalMemoizedMergedChildContext||Ms,vo=Cn.current,kt(Cn,o),kt(Un,Un.current),!0}function Zx(o,a,d){var g=o.stateNode;if(!g)throw Error(n(169));d?(o=Qx(o,a,vo),g.__reactInternalMemoizedMergedChildContext=o,At(Un),At(Cn),kt(Cn,o)):At(Un),kt(Un,d)}var xs=null,Ec=!1,_f=!1;function ey(o){xs===null?xs=[o]:xs.push(o)}function CC(o){Ec=!0,ey(o)}function _s(){if(!_f&&xs!==null){_f=!0;var o=0,a=be;try{var d=xs;for(be=1;o<d.length;o++){var g=d[o];do g=g(!0);while(g!==null)}xs=null,Ec=!1}catch(v){throw xs!==null&&(xs=xs.slice(o+1)),sc(ka,_s),v}finally{be=a,_f=!1}}return null}var ui=[],di=0,Tc=null,Pc=0,br=[],vr=0,wo=null,ys=1,bs="";function jo(o,a){ui[di++]=Pc,ui[di++]=Tc,Tc=o,Pc=a}function ty(o,a,d){br[vr++]=ys,br[vr++]=bs,br[vr++]=wo,wo=o;var g=ys;o=bs;var v=32-Dn(g)-1;g&=~(1<<v),d+=1;var k=32-Dn(a)+v;if(30<k){var A=v-v%5;k=(g&(1<<A)-1).toString(32),g>>=A,v-=A,ys=1<<32-Dn(a)+v|d<<v|g,bs=k+o}else ys=1<<k|d<<v|g,bs=o}function Ff(o){o.return!==null&&(jo(o,1),ty(o,1,0))}function zf(o){for(;o===Tc;)Tc=ui[--di],ui[di]=null,Pc=ui[--di],ui[di]=null;for(;o===wo;)wo=br[--vr],br[vr]=null,bs=br[--vr],br[vr]=null,ys=br[--vr],br[vr]=null}var ar=null,lr=null,Ot=!1,Or=null;function ny(o,a){var d=Sr(5,null,null,0);d.elementType="DELETED",d.stateNode=a,d.return=o,a=o.deletions,a===null?(o.deletions=[d],o.flags|=16):a.push(d)}function ry(o,a){switch(o.tag){case 5:var d=o.type;return a=a.nodeType!==1||d.toLowerCase()!==a.nodeName.toLowerCase()?null:a,a!==null?(o.stateNode=a,ar=o,lr=Is(a.firstChild),!0):!1;case 6:return a=o.pendingProps===""||a.nodeType!==3?null:a,a!==null?(o.stateNode=a,ar=o,lr=null,!0):!1;case 13:return a=a.nodeType!==8?null:a,a!==null?(d=wo!==null?{id:ys,overflow:bs}:null,o.memoizedState={dehydrated:a,treeContext:d,retryLane:1073741824},d=Sr(18,null,null,0),d.stateNode=a,d.return=o,o.child=d,ar=o,lr=null,!0):!1;default:return!1}}function Bf(o){return(o.mode&1)!==0&&(o.flags&128)===0}function Uf(o){if(Ot){var a=lr;if(a){var d=a;if(!ry(o,a)){if(Bf(o))throw Error(n(418));a=Is(d.nextSibling);var g=ar;a&&ry(o,a)?ny(g,d):(o.flags=o.flags&-4097|2,Ot=!1,ar=o)}}else{if(Bf(o))throw Error(n(418));o.flags=o.flags&-4097|2,Ot=!1,ar=o}}}function sy(o){for(o=o.return;o!==null&&o.tag!==5&&o.tag!==3&&o.tag!==13;)o=o.return;ar=o}function Rc(o){if(o!==ar)return!1;if(!Ot)return sy(o),Ot=!0,!1;var a;if((a=o.tag!==3)&&!(a=o.tag!==5)&&(a=o.type,a=a!=="head"&&a!=="body"&&!Lf(o.type,o.memoizedProps)),a&&(a=lr)){if(Bf(o))throw oy(),Error(n(418));for(;a;)ny(o,a),a=Is(a.nextSibling)}if(sy(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 d=o.data;if(d==="/$"){if(a===0){lr=Is(o.nextSibling);break e}a--}else d!=="$"&&d!=="$!"&&d!=="$?"||a++}o=o.nextSibling}lr=null}}else lr=ar?Is(o.stateNode.nextSibling):null;return!0}function oy(){for(var o=lr;o;)o=Is(o.nextSibling)}function fi(){lr=ar=null,Ot=!1}function Vf(o){Or===null?Or=[o]:Or.push(o)}var EC=R.ReactCurrentBatchConfig;function Va(o,a,d){if(o=d.ref,o!==null&&typeof o!="function"&&typeof o!="object"){if(d._owner){if(d=d._owner,d){if(d.tag!==1)throw Error(n(309));var g=d.stateNode}if(!g)throw Error(n(147,o));var v=g,k=""+o;return a!==null&&a.ref!==null&&typeof a.ref=="function"&&a.ref._stringRef===k?a.ref:(a=function(A){var B=v.refs;A===null?delete B[k]:B[k]=A},a._stringRef=k,a)}if(typeof o!="string")throw Error(n(284));if(!d._owner)throw Error(n(290,o))}return o}function Ac(o,a){throw o=Object.prototype.toString.call(a),Error(n(31,o==="[object Object]"?"object with keys {"+Object.keys(a).join(", ")+"}":o))}function iy(o){var a=o._init;return a(o._payload)}function ay(o){function a(te,Y){if(o){var oe=te.deletions;oe===null?(te.deletions=[Y],te.flags|=16):oe.push(Y)}}function d(te,Y){if(!o)return null;for(;Y!==null;)a(te,Y),Y=Y.sibling;return null}function g(te,Y){for(te=new Map;Y!==null;)Y.key!==null?te.set(Y.key,Y):te.set(Y.index,Y),Y=Y.sibling;return te}function v(te,Y){return te=Ks(te,Y),te.index=0,te.sibling=null,te}function k(te,Y,oe){return te.index=oe,o?(oe=te.alternate,oe!==null?(oe=oe.index,oe<Y?(te.flags|=2,Y):oe):(te.flags|=2,Y)):(te.flags|=1048576,Y)}function A(te){return o&&te.alternate===null&&(te.flags|=2),te}function B(te,Y,oe,Ce){return Y===null||Y.tag!==6?(Y=$p(oe,te.mode,Ce),Y.return=te,Y):(Y=v(Y,oe),Y.return=te,Y)}function K(te,Y,oe,Ce){var Ue=oe.type;return Ue===$?je(te,Y,oe.props.children,Ce,oe.key):Y!==null&&(Y.elementType===Ue||typeof Ue=="object"&&Ue!==null&&Ue.$$typeof===Q&&iy(Ue)===Y.type)?(Ce=v(Y,oe.props),Ce.ref=Va(te,Y,oe),Ce.return=te,Ce):(Ce=tu(oe.type,oe.key,oe.props,null,te.mode,Ce),Ce.ref=Va(te,Y,oe),Ce.return=te,Ce)}function ce(te,Y,oe,Ce){return Y===null||Y.tag!==4||Y.stateNode.containerInfo!==oe.containerInfo||Y.stateNode.implementation!==oe.implementation?(Y=Ip(oe,te.mode,Ce),Y.return=te,Y):(Y=v(Y,oe.children||[]),Y.return=te,Y)}function je(te,Y,oe,Ce,Ue){return Y===null||Y.tag!==7?(Y=Ro(oe,te.mode,Ce,Ue),Y.return=te,Y):(Y=v(Y,oe),Y.return=te,Y)}function ke(te,Y,oe){if(typeof Y=="string"&&Y!==""||typeof Y=="number")return Y=$p(""+Y,te.mode,oe),Y.return=te,Y;if(typeof Y=="object"&&Y!==null){switch(Y.$$typeof){case I:return oe=tu(Y.type,Y.key,Y.props,null,te.mode,oe),oe.ref=Va(te,null,Y),oe.return=te,oe;case P:return Y=Ip(Y,te.mode,oe),Y.return=te,Y;case Q:var Ce=Y._init;return ke(te,Ce(Y._payload),oe)}if(Te(Y)||ne(Y))return Y=Ro(Y,te.mode,oe,null),Y.return=te,Y;Ac(te,Y)}return null}function we(te,Y,oe,Ce){var Ue=Y!==null?Y.key:null;if(typeof oe=="string"&&oe!==""||typeof oe=="number")return Ue!==null?null:B(te,Y,""+oe,Ce);if(typeof oe=="object"&&oe!==null){switch(oe.$$typeof){case I:return oe.key===Ue?K(te,Y,oe,Ce):null;case P:return oe.key===Ue?ce(te,Y,oe,Ce):null;case Q:return Ue=oe._init,we(te,Y,Ue(oe._payload),Ce)}if(Te(oe)||ne(oe))return Ue!==null?null:je(te,Y,oe,Ce,null);Ac(te,oe)}return null}function $e(te,Y,oe,Ce,Ue){if(typeof Ce=="string"&&Ce!==""||typeof Ce=="number")return te=te.get(oe)||null,B(Y,te,""+Ce,Ue);if(typeof Ce=="object"&&Ce!==null){switch(Ce.$$typeof){case I:return te=te.get(Ce.key===null?oe:Ce.key)||null,K(Y,te,Ce,Ue);case P:return te=te.get(Ce.key===null?oe:Ce.key)||null,ce(Y,te,Ce,Ue);case Q:var qe=Ce._init;return $e(te,Y,oe,qe(Ce._payload),Ue)}if(Te(Ce)||ne(Ce))return te=te.get(oe)||null,je(Y,te,Ce,Ue,null);Ac(Y,Ce)}return null}function _e(te,Y,oe,Ce){for(var Ue=null,qe=null,Ge=Y,Xe=Y=0,xn=null;Ge!==null&&Xe<oe.length;Xe++){Ge.index>Xe?(xn=Ge,Ge=null):xn=Ge.sibling;var mt=we(te,Ge,oe[Xe],Ce);if(mt===null){Ge===null&&(Ge=xn);break}o&&Ge&&mt.alternate===null&&a(te,Ge),Y=k(mt,Y,Xe),qe===null?Ue=mt:qe.sibling=mt,qe=mt,Ge=xn}if(Xe===oe.length)return d(te,Ge),Ot&&jo(te,Xe),Ue;if(Ge===null){for(;Xe<oe.length;Xe++)Ge=ke(te,oe[Xe],Ce),Ge!==null&&(Y=k(Ge,Y,Xe),qe===null?Ue=Ge:qe.sibling=Ge,qe=Ge);return Ot&&jo(te,Xe),Ue}for(Ge=g(te,Ge);Xe<oe.length;Xe++)xn=$e(Ge,te,Xe,oe[Xe],Ce),xn!==null&&(o&&xn.alternate!==null&&Ge.delete(xn.key===null?Xe:xn.key),Y=k(xn,Y,Xe),qe===null?Ue=xn:qe.sibling=xn,qe=xn);return o&&Ge.forEach(function(qs){return a(te,qs)}),Ot&&jo(te,Xe),Ue}function Fe(te,Y,oe,Ce){var Ue=ne(oe);if(typeof Ue!="function")throw Error(n(150));if(oe=Ue.call(oe),oe==null)throw Error(n(151));for(var qe=Ue=null,Ge=Y,Xe=Y=0,xn=null,mt=oe.next();Ge!==null&&!mt.done;Xe++,mt=oe.next()){Ge.index>Xe?(xn=Ge,Ge=null):xn=Ge.sibling;var qs=we(te,Ge,mt.value,Ce);if(qs===null){Ge===null&&(Ge=xn);break}o&&Ge&&qs.alternate===null&&a(te,Ge),Y=k(qs,Y,Xe),qe===null?Ue=qs:qe.sibling=qs,qe=qs,Ge=xn}if(mt.done)return d(te,Ge),Ot&&jo(te,Xe),Ue;if(Ge===null){for(;!mt.done;Xe++,mt=oe.next())mt=ke(te,mt.value,Ce),mt!==null&&(Y=k(mt,Y,Xe),qe===null?Ue=mt:qe.sibling=mt,qe=mt);return Ot&&jo(te,Xe),Ue}for(Ge=g(te,Ge);!mt.done;Xe++,mt=oe.next())mt=$e(Ge,te,Xe,mt.value,Ce),mt!==null&&(o&&mt.alternate!==null&&Ge.delete(mt.key===null?Xe:mt.key),Y=k(mt,Y,Xe),qe===null?Ue=mt:qe.sibling=mt,qe=mt);return o&&Ge.forEach(function(iE){return a(te,iE)}),Ot&&jo(te,Xe),Ue}function Yt(te,Y,oe,Ce){if(typeof oe=="object"&&oe!==null&&oe.type===$&&oe.key===null&&(oe=oe.props.children),typeof oe=="object"&&oe!==null){switch(oe.$$typeof){case I:e:{for(var Ue=oe.key,qe=Y;qe!==null;){if(qe.key===Ue){if(Ue=oe.type,Ue===$){if(qe.tag===7){d(te,qe.sibling),Y=v(qe,oe.props.children),Y.return=te,te=Y;break e}}else if(qe.elementType===Ue||typeof Ue=="object"&&Ue!==null&&Ue.$$typeof===Q&&iy(Ue)===qe.type){d(te,qe.sibling),Y=v(qe,oe.props),Y.ref=Va(te,qe,oe),Y.return=te,te=Y;break e}d(te,qe);break}else a(te,qe);qe=qe.sibling}oe.type===$?(Y=Ro(oe.props.children,te.mode,Ce,oe.key),Y.return=te,te=Y):(Ce=tu(oe.type,oe.key,oe.props,null,te.mode,Ce),Ce.ref=Va(te,Y,oe),Ce.return=te,te=Ce)}return A(te);case P:e:{for(qe=oe.key;Y!==null;){if(Y.key===qe)if(Y.tag===4&&Y.stateNode.containerInfo===oe.containerInfo&&Y.stateNode.implementation===oe.implementation){d(te,Y.sibling),Y=v(Y,oe.children||[]),Y.return=te,te=Y;break e}else{d(te,Y);break}else a(te,Y);Y=Y.sibling}Y=Ip(oe,te.mode,Ce),Y.return=te,te=Y}return A(te);case Q:return qe=oe._init,Yt(te,Y,qe(oe._payload),Ce)}if(Te(oe))return _e(te,Y,oe,Ce);if(ne(oe))return Fe(te,Y,oe,Ce);Ac(te,oe)}return typeof oe=="string"&&oe!==""||typeof oe=="number"?(oe=""+oe,Y!==null&&Y.tag===6?(d(te,Y.sibling),Y=v(Y,oe),Y.return=te,te=Y):(d(te,Y),Y=$p(oe,te.mode,Ce),Y.return=te,te=Y),A(te)):d(te,Y)}return Yt}var pi=ay(!0),ly=ay(!1),Dc=Os(null),Lc=null,mi=null,Hf=null;function Wf(){Hf=mi=Lc=null}function Kf(o){var a=Dc.current;At(Dc),o._currentValue=a}function qf(o,a,d){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===d)break;o=o.return}}function hi(o,a){Lc=o,Hf=mi=null,o=o.dependencies,o!==null&&o.firstContext!==null&&((o.lanes&a)!==0&&(Hn=!0),o.firstContext=null)}function wr(o){var a=o._currentValue;if(Hf!==o)if(o={context:o,memoizedValue:a,next:null},mi===null){if(Lc===null)throw Error(n(308));mi=o,Lc.dependencies={lanes:0,firstContext:o}}else mi=mi.next=o;return a}var ko=null;function Gf(o){ko===null?ko=[o]:ko.push(o)}function cy(o,a,d,g){var v=a.interleaved;return v===null?(d.next=d,Gf(a)):(d.next=v.next,v.next=d),a.interleaved=d,vs(o,g)}function vs(o,a){o.lanes|=a;var d=o.alternate;for(d!==null&&(d.lanes|=a),d=o,o=o.return;o!==null;)o.childLanes|=a,d=o.alternate,d!==null&&(d.childLanes|=a),d=o,o=o.return;return d.tag===3?d.stateNode:null}var Fs=!1;function Yf(o){o.updateQueue={baseState:o.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function uy(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 ws(o,a){return{eventTime:o,lane:a,tag:0,payload:null,callback:null,next:null}}function zs(o,a,d){var g=o.updateQueue;if(g===null)return null;if(g=g.shared,(ut&2)!==0){var v=g.pending;return v===null?a.next=a:(a.next=v.next,v.next=a),g.pending=a,vs(o,d)}return v=g.interleaved,v===null?(a.next=a,Gf(g)):(a.next=v.next,v.next=a),g.interleaved=a,vs(o,d)}function $c(o,a,d){if(a=a.updateQueue,a!==null&&(a=a.shared,(d&4194240)!==0)){var g=a.lanes;g&=o.pendingLanes,d|=g,a.lanes=d,ge(o,d)}}function dy(o,a){var d=o.updateQueue,g=o.alternate;if(g!==null&&(g=g.updateQueue,d===g)){var v=null,k=null;if(d=d.firstBaseUpdate,d!==null){do{var A={eventTime:d.eventTime,lane:d.lane,tag:d.tag,payload:d.payload,callback:d.callback,next:null};k===null?v=k=A:k=k.next=A,d=d.next}while(d!==null);k===null?v=k=a:k=k.next=a}else v=k=a;d={baseState:g.baseState,firstBaseUpdate:v,lastBaseUpdate:k,shared:g.shared,effects:g.effects},o.updateQueue=d;return}o=d.lastBaseUpdate,o===null?d.firstBaseUpdate=a:o.next=a,d.lastBaseUpdate=a}function Ic(o,a,d,g){var v=o.updateQueue;Fs=!1;var k=v.firstBaseUpdate,A=v.lastBaseUpdate,B=v.shared.pending;if(B!==null){v.shared.pending=null;var K=B,ce=K.next;K.next=null,A===null?k=ce:A.next=ce,A=K;var je=o.alternate;je!==null&&(je=je.updateQueue,B=je.lastBaseUpdate,B!==A&&(B===null?je.firstBaseUpdate=ce:B.next=ce,je.lastBaseUpdate=K))}if(k!==null){var ke=v.baseState;A=0,je=ce=K=null,B=k;do{var we=B.lane,$e=B.eventTime;if((g&we)===we){je!==null&&(je=je.next={eventTime:$e,lane:0,tag:B.tag,payload:B.payload,callback:B.callback,next:null});e:{var _e=o,Fe=B;switch(we=a,$e=d,Fe.tag){case 1:if(_e=Fe.payload,typeof _e=="function"){ke=_e.call($e,ke,we);break e}ke=_e;break e;case 3:_e.flags=_e.flags&-65537|128;case 0:if(_e=Fe.payload,we=typeof _e=="function"?_e.call($e,ke,we):_e,we==null)break e;ke=T({},ke,we);break e;case 2:Fs=!0}}B.callback!==null&&B.lane!==0&&(o.flags|=64,we=v.effects,we===null?v.effects=[B]:we.push(B))}else $e={eventTime:$e,lane:we,tag:B.tag,payload:B.payload,callback:B.callback,next:null},je===null?(ce=je=$e,K=ke):je=je.next=$e,A|=we;if(B=B.next,B===null){if(B=v.shared.pending,B===null)break;we=B,B=we.next,we.next=null,v.lastBaseUpdate=we,v.shared.pending=null}}while(!0);if(je===null&&(K=ke),v.baseState=K,v.firstBaseUpdate=ce,v.lastBaseUpdate=je,a=v.shared.interleaved,a!==null){v=a;do A|=v.lane,v=v.next;while(v!==a)}else k===null&&(v.shared.lanes=0);Co|=A,o.lanes=A,o.memoizedState=ke}}function fy(o,a,d){if(o=a.effects,a.effects=null,o!==null)for(a=0;a<o.length;a++){var g=o[a],v=g.callback;if(v!==null){if(g.callback=null,g=d,typeof v!="function")throw Error(n(191,v));v.call(g)}}}var Ha={},Qr=Os(Ha),Wa=Os(Ha),Ka=Os(Ha);function So(o){if(o===Ha)throw Error(n(174));return o}function Jf(o,a){switch(kt(Ka,a),kt(Wa,o),kt(Qr,Ha),o=a.nodeType,o){case 9:case 11:a=(a=a.documentElement)?a.namespaceURI:ye(null,"");break;default:o=o===8?a.parentNode:a,a=o.namespaceURI||null,o=o.tagName,a=ye(a,o)}At(Qr),kt(Qr,a)}function gi(){At(Qr),At(Wa),At(Ka)}function py(o){So(Ka.current);var a=So(Qr.current),d=ye(a,o.type);a!==d&&(kt(Wa,o),kt(Qr,d))}function Xf(o){Wa.current===o&&(At(Qr),At(Wa))}var zt=Os(0);function Oc(o){for(var a=o;a!==null;){if(a.tag===13){var d=a.memoizedState;if(d!==null&&(d=d.dehydrated,d===null||d.data==="$?"||d.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 Qf=[];function Zf(){for(var o=0;o<Qf.length;o++)Qf[o]._workInProgressVersionPrimary=null;Qf.length=0}var Mc=R.ReactCurrentDispatcher,ep=R.ReactCurrentBatchConfig,No=0,Bt=null,ln=null,hn=null,_c=!1,qa=!1,Ga=0,TC=0;function En(){throw Error(n(321))}function tp(o,a){if(a===null)return!1;for(var d=0;d<a.length&&d<o.length;d++)if(!Ir(o[d],a[d]))return!1;return!0}function np(o,a,d,g,v,k){if(No=k,Bt=a,a.memoizedState=null,a.updateQueue=null,a.lanes=0,Mc.current=o===null||o.memoizedState===null?DC:LC,o=d(g,v),qa){k=0;do{if(qa=!1,Ga=0,25<=k)throw Error(n(301));k+=1,hn=ln=null,a.updateQueue=null,Mc.current=$C,o=d(g,v)}while(qa)}if(Mc.current=Bc,a=ln!==null&&ln.next!==null,No=0,hn=ln=Bt=null,_c=!1,a)throw Error(n(300));return o}function rp(){var o=Ga!==0;return Ga=0,o}function Zr(){var o={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return hn===null?Bt.memoizedState=hn=o:hn=hn.next=o,hn}function jr(){if(ln===null){var o=Bt.alternate;o=o!==null?o.memoizedState:null}else o=ln.next;var a=hn===null?Bt.memoizedState:hn.next;if(a!==null)hn=a,ln=o;else{if(o===null)throw Error(n(310));ln=o,o={memoizedState:ln.memoizedState,baseState:ln.baseState,baseQueue:ln.baseQueue,queue:ln.queue,next:null},hn===null?Bt.memoizedState=hn=o:hn=hn.next=o}return hn}function Ya(o,a){return typeof a=="function"?a(o):a}function sp(o){var a=jr(),d=a.queue;if(d===null)throw Error(n(311));d.lastRenderedReducer=o;var g=ln,v=g.baseQueue,k=d.pending;if(k!==null){if(v!==null){var A=v.next;v.next=k.next,k.next=A}g.baseQueue=v=k,d.pending=null}if(v!==null){k=v.next,g=g.baseState;var B=A=null,K=null,ce=k;do{var je=ce.lane;if((No&je)===je)K!==null&&(K=K.next={lane:0,action:ce.action,hasEagerState:ce.hasEagerState,eagerState:ce.eagerState,next:null}),g=ce.hasEagerState?ce.eagerState:o(g,ce.action);else{var ke={lane:je,action:ce.action,hasEagerState:ce.hasEagerState,eagerState:ce.eagerState,next:null};K===null?(B=K=ke,A=g):K=K.next=ke,Bt.lanes|=je,Co|=je}ce=ce.next}while(ce!==null&&ce!==k);K===null?A=g:K.next=B,Ir(g,a.memoizedState)||(Hn=!0),a.memoizedState=g,a.baseState=A,a.baseQueue=K,d.lastRenderedState=g}if(o=d.interleaved,o!==null){v=o;do k=v.lane,Bt.lanes|=k,Co|=k,v=v.next;while(v!==o)}else v===null&&(d.lanes=0);return[a.memoizedState,d.dispatch]}function op(o){var a=jr(),d=a.queue;if(d===null)throw Error(n(311));d.lastRenderedReducer=o;var g=d.dispatch,v=d.pending,k=a.memoizedState;if(v!==null){d.pending=null;var A=v=v.next;do k=o(k,A.action),A=A.next;while(A!==v);Ir(k,a.memoizedState)||(Hn=!0),a.memoizedState=k,a.baseQueue===null&&(a.baseState=k),d.lastRenderedState=k}return[k,g]}function my(){}function hy(o,a){var d=Bt,g=jr(),v=a(),k=!Ir(g.memoizedState,v);if(k&&(g.memoizedState=v,Hn=!0),g=g.queue,ip(yy.bind(null,d,g,o),[o]),g.getSnapshot!==a||k||hn!==null&&hn.memoizedState.tag&1){if(d.flags|=2048,Ja(9,xy.bind(null,d,g,v,a),void 0,null),gn===null)throw Error(n(349));(No&30)!==0||gy(d,a,v)}return v}function gy(o,a,d){o.flags|=16384,o={getSnapshot:a,value:d},a=Bt.updateQueue,a===null?(a={lastEffect:null,stores:null},Bt.updateQueue=a,a.stores=[o]):(d=a.stores,d===null?a.stores=[o]:d.push(o))}function xy(o,a,d,g){a.value=d,a.getSnapshot=g,by(a)&&vy(o)}function yy(o,a,d){return d(function(){by(a)&&vy(o)})}function by(o){var a=o.getSnapshot;o=o.value;try{var d=a();return!Ir(o,d)}catch{return!0}}function vy(o){var a=vs(o,1);a!==null&&zr(a,o,1,-1)}function wy(o){var a=Zr();return typeof o=="function"&&(o=o()),a.memoizedState=a.baseState=o,o={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:Ya,lastRenderedState:o},a.queue=o,o=o.dispatch=AC.bind(null,Bt,o),[a.memoizedState,o]}function Ja(o,a,d,g){return o={tag:o,create:a,destroy:d,deps:g,next:null},a=Bt.updateQueue,a===null?(a={lastEffect:null,stores:null},Bt.updateQueue=a,a.lastEffect=o.next=o):(d=a.lastEffect,d===null?a.lastEffect=o.next=o:(g=d.next,d.next=o,o.next=g,a.lastEffect=o)),o}function jy(){return jr().memoizedState}function Fc(o,a,d,g){var v=Zr();Bt.flags|=o,v.memoizedState=Ja(1|a,d,void 0,g===void 0?null:g)}function zc(o,a,d,g){var v=jr();g=g===void 0?null:g;var k=void 0;if(ln!==null){var A=ln.memoizedState;if(k=A.destroy,g!==null&&tp(g,A.deps)){v.memoizedState=Ja(a,d,k,g);return}}Bt.flags|=o,v.memoizedState=Ja(1|a,d,k,g)}function ky(o,a){return Fc(8390656,8,o,a)}function ip(o,a){return zc(2048,8,o,a)}function Sy(o,a){return zc(4,2,o,a)}function Ny(o,a){return zc(4,4,o,a)}function Cy(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 Ey(o,a,d){return d=d!=null?d.concat([o]):null,zc(4,4,Cy.bind(null,a,o),d)}function ap(){}function Ty(o,a){var d=jr();a=a===void 0?null:a;var g=d.memoizedState;return g!==null&&a!==null&&tp(a,g[1])?g[0]:(d.memoizedState=[o,a],o)}function Py(o,a){var d=jr();a=a===void 0?null:a;var g=d.memoizedState;return g!==null&&a!==null&&tp(a,g[1])?g[0]:(o=o(),d.memoizedState=[o,a],o)}function Ry(o,a,d){return(No&21)===0?(o.baseState&&(o.baseState=!1,Hn=!0),o.memoizedState=d):(Ir(d,a)||(d=cc(),Bt.lanes|=d,Co|=d,o.baseState=!0),a)}function PC(o,a){var d=be;be=d!==0&&4>d?d:4,o(!0);var g=ep.transition;ep.transition={};try{o(!1),a()}finally{be=d,ep.transition=g}}function Ay(){return jr().memoizedState}function RC(o,a,d){var g=Hs(o);if(d={lane:g,action:d,hasEagerState:!1,eagerState:null,next:null},Dy(o))Ly(a,d);else if(d=cy(o,a,d,g),d!==null){var v=In();zr(d,o,g,v),$y(d,a,g)}}function AC(o,a,d){var g=Hs(o),v={lane:g,action:d,hasEagerState:!1,eagerState:null,next:null};if(Dy(o))Ly(a,v);else{var k=o.alternate;if(o.lanes===0&&(k===null||k.lanes===0)&&(k=a.lastRenderedReducer,k!==null))try{var A=a.lastRenderedState,B=k(A,d);if(v.hasEagerState=!0,v.eagerState=B,Ir(B,A)){var K=a.interleaved;K===null?(v.next=v,Gf(a)):(v.next=K.next,K.next=v),a.interleaved=v;return}}catch{}finally{}d=cy(o,a,v,g),d!==null&&(v=In(),zr(d,o,g,v),$y(d,a,g))}}function Dy(o){var a=o.alternate;return o===Bt||a!==null&&a===Bt}function Ly(o,a){qa=_c=!0;var d=o.pending;d===null?a.next=a:(a.next=d.next,d.next=a),o.pending=a}function $y(o,a,d){if((d&4194240)!==0){var g=a.lanes;g&=o.pendingLanes,d|=g,a.lanes=d,ge(o,d)}}var Bc={readContext:wr,useCallback:En,useContext:En,useEffect:En,useImperativeHandle:En,useInsertionEffect:En,useLayoutEffect:En,useMemo:En,useReducer:En,useRef:En,useState:En,useDebugValue:En,useDeferredValue:En,useTransition:En,useMutableSource:En,useSyncExternalStore:En,useId:En,unstable_isNewReconciler:!1},DC={readContext:wr,useCallback:function(o,a){return Zr().memoizedState=[o,a===void 0?null:a],o},useContext:wr,useEffect:ky,useImperativeHandle:function(o,a,d){return d=d!=null?d.concat([o]):null,Fc(4194308,4,Cy.bind(null,a,o),d)},useLayoutEffect:function(o,a){return Fc(4194308,4,o,a)},useInsertionEffect:function(o,a){return Fc(4,2,o,a)},useMemo:function(o,a){var d=Zr();return a=a===void 0?null:a,o=o(),d.memoizedState=[o,a],o},useReducer:function(o,a,d){var g=Zr();return a=d!==void 0?d(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=RC.bind(null,Bt,o),[g.memoizedState,o]},useRef:function(o){var a=Zr();return o={current:o},a.memoizedState=o},useState:wy,useDebugValue:ap,useDeferredValue:function(o){return Zr().memoizedState=o},useTransition:function(){var o=wy(!1),a=o[0];return o=PC.bind(null,o[1]),Zr().memoizedState=o,[a,o]},useMutableSource:function(){},useSyncExternalStore:function(o,a,d){var g=Bt,v=Zr();if(Ot){if(d===void 0)throw Error(n(407));d=d()}else{if(d=a(),gn===null)throw Error(n(349));(No&30)!==0||gy(g,a,d)}v.memoizedState=d;var k={value:d,getSnapshot:a};return v.queue=k,ky(yy.bind(null,g,k,o),[o]),g.flags|=2048,Ja(9,xy.bind(null,g,k,d,a),void 0,null),d},useId:function(){var o=Zr(),a=gn.identifierPrefix;if(Ot){var d=bs,g=ys;d=(g&~(1<<32-Dn(g)-1)).toString(32)+d,a=":"+a+"R"+d,d=Ga++,0<d&&(a+="H"+d.toString(32)),a+=":"}else d=TC++,a=":"+a+"r"+d.toString(32)+":";return o.memoizedState=a},unstable_isNewReconciler:!1},LC={readContext:wr,useCallback:Ty,useContext:wr,useEffect:ip,useImperativeHandle:Ey,useInsertionEffect:Sy,useLayoutEffect:Ny,useMemo:Py,useReducer:sp,useRef:jy,useState:function(){return sp(Ya)},useDebugValue:ap,useDeferredValue:function(o){var a=jr();return Ry(a,ln.memoizedState,o)},useTransition:function(){var o=sp(Ya)[0],a=jr().memoizedState;return[o,a]},useMutableSource:my,useSyncExternalStore:hy,useId:Ay,unstable_isNewReconciler:!1},$C={readContext:wr,useCallback:Ty,useContext:wr,useEffect:ip,useImperativeHandle:Ey,useInsertionEffect:Sy,useLayoutEffect:Ny,useMemo:Py,useReducer:op,useRef:jy,useState:function(){return op(Ya)},useDebugValue:ap,useDeferredValue:function(o){var a=jr();return ln===null?a.memoizedState=o:Ry(a,ln.memoizedState,o)},useTransition:function(){var o=op(Ya)[0],a=jr().memoizedState;return[o,a]},useMutableSource:my,useSyncExternalStore:hy,useId:Ay,unstable_isNewReconciler:!1};function Mr(o,a){if(o&&o.defaultProps){a=T({},a),o=o.defaultProps;for(var d in o)a[d]===void 0&&(a[d]=o[d]);return a}return a}function lp(o,a,d,g){a=o.memoizedState,d=d(g,a),d=d==null?a:T({},a,d),o.memoizedState=d,o.lanes===0&&(o.updateQueue.baseState=d)}var Uc={isMounted:function(o){return(o=o._reactInternals)?Lr(o)===o:!1},enqueueSetState:function(o,a,d){o=o._reactInternals;var g=In(),v=Hs(o),k=ws(g,v);k.payload=a,d!=null&&(k.callback=d),a=zs(o,k,v),a!==null&&(zr(a,o,v,g),$c(a,o,v))},enqueueReplaceState:function(o,a,d){o=o._reactInternals;var g=In(),v=Hs(o),k=ws(g,v);k.tag=1,k.payload=a,d!=null&&(k.callback=d),a=zs(o,k,v),a!==null&&(zr(a,o,v,g),$c(a,o,v))},enqueueForceUpdate:function(o,a){o=o._reactInternals;var d=In(),g=Hs(o),v=ws(d,g);v.tag=2,a!=null&&(v.callback=a),a=zs(o,v,g),a!==null&&(zr(a,o,g,d),$c(a,o,g))}};function Iy(o,a,d,g,v,k,A){return o=o.stateNode,typeof o.shouldComponentUpdate=="function"?o.shouldComponentUpdate(g,k,A):a.prototype&&a.prototype.isPureReactComponent?!Oa(d,g)||!Oa(v,k):!0}function Oy(o,a,d){var g=!1,v=Ms,k=a.contextType;return typeof k=="object"&&k!==null?k=wr(k):(v=Vn(a)?vo:Cn.current,g=a.contextTypes,k=(g=g!=null)?ci(o,v):Ms),a=new a(d,k),o.memoizedState=a.state!==null&&a.state!==void 0?a.state:null,a.updater=Uc,o.stateNode=a,a._reactInternals=o,g&&(o=o.stateNode,o.__reactInternalMemoizedUnmaskedChildContext=v,o.__reactInternalMemoizedMaskedChildContext=k),a}function My(o,a,d,g){o=a.state,typeof a.componentWillReceiveProps=="function"&&a.componentWillReceiveProps(d,g),typeof a.UNSAFE_componentWillReceiveProps=="function"&&a.UNSAFE_componentWillReceiveProps(d,g),a.state!==o&&Uc.enqueueReplaceState(a,a.state,null)}function cp(o,a,d,g){var v=o.stateNode;v.props=d,v.state=o.memoizedState,v.refs={},Yf(o);var k=a.contextType;typeof k=="object"&&k!==null?v.context=wr(k):(k=Vn(a)?vo:Cn.current,v.context=ci(o,k)),v.state=o.memoizedState,k=a.getDerivedStateFromProps,typeof k=="function"&&(lp(o,a,k,d),v.state=o.memoizedState),typeof a.getDerivedStateFromProps=="function"||typeof v.getSnapshotBeforeUpdate=="function"||typeof v.UNSAFE_componentWillMount!="function"&&typeof v.componentWillMount!="function"||(a=v.state,typeof v.componentWillMount=="function"&&v.componentWillMount(),typeof v.UNSAFE_componentWillMount=="function"&&v.UNSAFE_componentWillMount(),a!==v.state&&Uc.enqueueReplaceState(v,v.state,null),Ic(o,d,v,g),v.state=o.memoizedState),typeof v.componentDidMount=="function"&&(o.flags|=4194308)}function xi(o,a){try{var d="",g=a;do d+=de(g),g=g.return;while(g);var v=d}catch(k){v=`
|
|
39
|
+
Error generating stack: `+k.message+`
|
|
40
|
+
`+k.stack}return{value:o,source:a,stack:v,digest:null}}function up(o,a,d){return{value:o,source:null,stack:d??null,digest:a??null}}function dp(o,a){try{console.error(a.value)}catch(d){setTimeout(function(){throw d})}}var IC=typeof WeakMap=="function"?WeakMap:Map;function _y(o,a,d){d=ws(-1,d),d.tag=3,d.payload={element:null};var g=a.value;return d.callback=function(){Yc||(Yc=!0,Cp=g),dp(o,a)},d}function Fy(o,a,d){d=ws(-1,d),d.tag=3;var g=o.type.getDerivedStateFromError;if(typeof g=="function"){var v=a.value;d.payload=function(){return g(v)},d.callback=function(){dp(o,a)}}var k=o.stateNode;return k!==null&&typeof k.componentDidCatch=="function"&&(d.callback=function(){dp(o,a),typeof g!="function"&&(Us===null?Us=new Set([this]):Us.add(this));var A=a.stack;this.componentDidCatch(a.value,{componentStack:A!==null?A:""})}),d}function zy(o,a,d){var g=o.pingCache;if(g===null){g=o.pingCache=new IC;var v=new Set;g.set(a,v)}else v=g.get(a),v===void 0&&(v=new Set,g.set(a,v));v.has(d)||(v.add(d),o=YC.bind(null,o,a,d),a.then(o,o))}function By(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 Uy(o,a,d,g,v){return(o.mode&1)===0?(o===a?o.flags|=65536:(o.flags|=128,d.flags|=131072,d.flags&=-52805,d.tag===1&&(d.alternate===null?d.tag=17:(a=ws(-1,1),a.tag=2,zs(d,a,1))),d.lanes|=1),o):(o.flags|=65536,o.lanes=v,o)}var OC=R.ReactCurrentOwner,Hn=!1;function $n(o,a,d,g){a.child=o===null?ly(a,null,d,g):pi(a,o.child,d,g)}function Vy(o,a,d,g,v){d=d.render;var k=a.ref;return hi(a,v),g=np(o,a,d,g,k,v),d=rp(),o!==null&&!Hn?(a.updateQueue=o.updateQueue,a.flags&=-2053,o.lanes&=~v,js(o,a,v)):(Ot&&d&&Ff(a),a.flags|=1,$n(o,a,g,v),a.child)}function Hy(o,a,d,g,v){if(o===null){var k=d.type;return typeof k=="function"&&!Lp(k)&&k.defaultProps===void 0&&d.compare===null&&d.defaultProps===void 0?(a.tag=15,a.type=k,Wy(o,a,k,g,v)):(o=tu(d.type,null,g,a,a.mode,v),o.ref=a.ref,o.return=a,a.child=o)}if(k=o.child,(o.lanes&v)===0){var A=k.memoizedProps;if(d=d.compare,d=d!==null?d:Oa,d(A,g)&&o.ref===a.ref)return js(o,a,v)}return a.flags|=1,o=Ks(k,g),o.ref=a.ref,o.return=a,a.child=o}function Wy(o,a,d,g,v){if(o!==null){var k=o.memoizedProps;if(Oa(k,g)&&o.ref===a.ref)if(Hn=!1,a.pendingProps=g=k,(o.lanes&v)!==0)(o.flags&131072)!==0&&(Hn=!0);else return a.lanes=o.lanes,js(o,a,v)}return fp(o,a,d,g,v)}function Ky(o,a,d){var g=a.pendingProps,v=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},kt(bi,cr),cr|=d;else{if((d&1073741824)===0)return o=k!==null?k.baseLanes|d:d,a.lanes=a.childLanes=1073741824,a.memoizedState={baseLanes:o,cachePool:null,transitions:null},a.updateQueue=null,kt(bi,cr),cr|=o,null;a.memoizedState={baseLanes:0,cachePool:null,transitions:null},g=k!==null?k.baseLanes:d,kt(bi,cr),cr|=g}else k!==null?(g=k.baseLanes|d,a.memoizedState=null):g=d,kt(bi,cr),cr|=g;return $n(o,a,v,d),a.child}function qy(o,a){var d=a.ref;(o===null&&d!==null||o!==null&&o.ref!==d)&&(a.flags|=512,a.flags|=2097152)}function fp(o,a,d,g,v){var k=Vn(d)?vo:Cn.current;return k=ci(a,k),hi(a,v),d=np(o,a,d,g,k,v),g=rp(),o!==null&&!Hn?(a.updateQueue=o.updateQueue,a.flags&=-2053,o.lanes&=~v,js(o,a,v)):(Ot&&g&&Ff(a),a.flags|=1,$n(o,a,d,v),a.child)}function Gy(o,a,d,g,v){if(Vn(d)){var k=!0;Cc(a)}else k=!1;if(hi(a,v),a.stateNode===null)Hc(o,a),Oy(a,d,g),cp(a,d,g,v),g=!0;else if(o===null){var A=a.stateNode,B=a.memoizedProps;A.props=B;var K=A.context,ce=d.contextType;typeof ce=="object"&&ce!==null?ce=wr(ce):(ce=Vn(d)?vo:Cn.current,ce=ci(a,ce));var je=d.getDerivedStateFromProps,ke=typeof je=="function"||typeof A.getSnapshotBeforeUpdate=="function";ke||typeof A.UNSAFE_componentWillReceiveProps!="function"&&typeof A.componentWillReceiveProps!="function"||(B!==g||K!==ce)&&My(a,A,g,ce),Fs=!1;var we=a.memoizedState;A.state=we,Ic(a,g,A,v),K=a.memoizedState,B!==g||we!==K||Un.current||Fs?(typeof je=="function"&&(lp(a,d,je,g),K=a.memoizedState),(B=Fs||Iy(a,d,B,g,we,K,ce))?(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=K),A.props=g,A.state=K,A.context=ce,g=B):(typeof A.componentDidMount=="function"&&(a.flags|=4194308),g=!1)}else{A=a.stateNode,uy(o,a),B=a.memoizedProps,ce=a.type===a.elementType?B:Mr(a.type,B),A.props=ce,ke=a.pendingProps,we=A.context,K=d.contextType,typeof K=="object"&&K!==null?K=wr(K):(K=Vn(d)?vo:Cn.current,K=ci(a,K));var $e=d.getDerivedStateFromProps;(je=typeof $e=="function"||typeof A.getSnapshotBeforeUpdate=="function")||typeof A.UNSAFE_componentWillReceiveProps!="function"&&typeof A.componentWillReceiveProps!="function"||(B!==ke||we!==K)&&My(a,A,g,K),Fs=!1,we=a.memoizedState,A.state=we,Ic(a,g,A,v);var _e=a.memoizedState;B!==ke||we!==_e||Un.current||Fs?(typeof $e=="function"&&(lp(a,d,$e,g),_e=a.memoizedState),(ce=Fs||Iy(a,d,ce,g,we,_e,K)||!1)?(je||typeof A.UNSAFE_componentWillUpdate!="function"&&typeof A.componentWillUpdate!="function"||(typeof A.componentWillUpdate=="function"&&A.componentWillUpdate(g,_e,K),typeof A.UNSAFE_componentWillUpdate=="function"&&A.UNSAFE_componentWillUpdate(g,_e,K)),typeof A.componentDidUpdate=="function"&&(a.flags|=4),typeof A.getSnapshotBeforeUpdate=="function"&&(a.flags|=1024)):(typeof A.componentDidUpdate!="function"||B===o.memoizedProps&&we===o.memoizedState||(a.flags|=4),typeof A.getSnapshotBeforeUpdate!="function"||B===o.memoizedProps&&we===o.memoizedState||(a.flags|=1024),a.memoizedProps=g,a.memoizedState=_e),A.props=g,A.state=_e,A.context=K,g=ce):(typeof A.componentDidUpdate!="function"||B===o.memoizedProps&&we===o.memoizedState||(a.flags|=4),typeof A.getSnapshotBeforeUpdate!="function"||B===o.memoizedProps&&we===o.memoizedState||(a.flags|=1024),g=!1)}return pp(o,a,d,g,k,v)}function pp(o,a,d,g,v,k){qy(o,a);var A=(a.flags&128)!==0;if(!g&&!A)return v&&Zx(a,d,!1),js(o,a,k);g=a.stateNode,OC.current=a;var B=A&&typeof d.getDerivedStateFromError!="function"?null:g.render();return a.flags|=1,o!==null&&A?(a.child=pi(a,o.child,null,k),a.child=pi(a,null,B,k)):$n(o,a,B,k),a.memoizedState=g.state,v&&Zx(a,d,!0),a.child}function Yy(o){var a=o.stateNode;a.pendingContext?Xx(o,a.pendingContext,a.pendingContext!==a.context):a.context&&Xx(o,a.context,!1),Jf(o,a.containerInfo)}function Jy(o,a,d,g,v){return fi(),Vf(v),a.flags|=256,$n(o,a,d,g),a.child}var mp={dehydrated:null,treeContext:null,retryLane:0};function hp(o){return{baseLanes:o,cachePool:null,transitions:null}}function Xy(o,a,d){var g=a.pendingProps,v=zt.current,k=!1,A=(a.flags&128)!==0,B;if((B=A)||(B=o!==null&&o.memoizedState===null?!1:(v&2)!==0),B?(k=!0,a.flags&=-129):(o===null||o.memoizedState!==null)&&(v|=1),kt(zt,v&1),o===null)return Uf(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=nu(A,g,0,null),o=Ro(o,g,d,null),k.return=a,o.return=a,k.sibling=o,a.child=k,a.child.memoizedState=hp(d),a.memoizedState=mp,o):gp(a,A));if(v=o.memoizedState,v!==null&&(B=v.dehydrated,B!==null))return MC(o,a,A,g,B,v,d);if(k){k=g.fallback,A=a.mode,v=o.child,B=v.sibling;var K={mode:"hidden",children:g.children};return(A&1)===0&&a.child!==v?(g=a.child,g.childLanes=0,g.pendingProps=K,a.deletions=null):(g=Ks(v,K),g.subtreeFlags=v.subtreeFlags&14680064),B!==null?k=Ks(B,k):(k=Ro(k,A,d,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?hp(d):{baseLanes:A.baseLanes|d,cachePool:null,transitions:A.transitions},k.memoizedState=A,k.childLanes=o.childLanes&~d,a.memoizedState=mp,g}return k=o.child,o=k.sibling,g=Ks(k,{mode:"visible",children:g.children}),(a.mode&1)===0&&(g.lanes=d),g.return=a,g.sibling=null,o!==null&&(d=a.deletions,d===null?(a.deletions=[o],a.flags|=16):d.push(o)),a.child=g,a.memoizedState=null,g}function gp(o,a){return a=nu({mode:"visible",children:a},o.mode,0,null),a.return=o,o.child=a}function Vc(o,a,d,g){return g!==null&&Vf(g),pi(a,o.child,null,d),o=gp(a,a.pendingProps.children),o.flags|=2,a.memoizedState=null,o}function MC(o,a,d,g,v,k,A){if(d)return a.flags&256?(a.flags&=-257,g=up(Error(n(422))),Vc(o,a,A,g)):a.memoizedState!==null?(a.child=o.child,a.flags|=128,null):(k=g.fallback,v=a.mode,g=nu({mode:"visible",children:g.children},v,0,null),k=Ro(k,v,A,null),k.flags|=2,g.return=a,k.return=a,g.sibling=k,a.child=g,(a.mode&1)!==0&&pi(a,o.child,null,A),a.child.memoizedState=hp(A),a.memoizedState=mp,k);if((a.mode&1)===0)return Vc(o,a,A,null);if(v.data==="$!"){if(g=v.nextSibling&&v.nextSibling.dataset,g)var B=g.dgst;return g=B,k=Error(n(419)),g=up(k,g,void 0),Vc(o,a,A,g)}if(B=(A&o.childLanes)!==0,Hn||B){if(g=gn,g!==null){switch(A&-A){case 4:v=2;break;case 16:v=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:v=32;break;case 536870912:v=268435456;break;default:v=0}v=(v&(g.suspendedLanes|A))!==0?0:v,v!==0&&v!==k.retryLane&&(k.retryLane=v,vs(o,v),zr(g,o,v,-1))}return Dp(),g=up(Error(n(421))),Vc(o,a,A,g)}return v.data==="$?"?(a.flags|=128,a.child=o.child,a=JC.bind(null,o),v._reactRetry=a,null):(o=k.treeContext,lr=Is(v.nextSibling),ar=a,Ot=!0,Or=null,o!==null&&(br[vr++]=ys,br[vr++]=bs,br[vr++]=wo,ys=o.id,bs=o.overflow,wo=a),a=gp(a,g.children),a.flags|=4096,a)}function Qy(o,a,d){o.lanes|=a;var g=o.alternate;g!==null&&(g.lanes|=a),qf(o.return,a,d)}function xp(o,a,d,g,v){var k=o.memoizedState;k===null?o.memoizedState={isBackwards:a,rendering:null,renderingStartTime:0,last:g,tail:d,tailMode:v}:(k.isBackwards=a,k.rendering=null,k.renderingStartTime=0,k.last=g,k.tail=d,k.tailMode=v)}function Zy(o,a,d){var g=a.pendingProps,v=g.revealOrder,k=g.tail;if($n(o,a,g.children,d),g=zt.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&&Qy(o,d,a);else if(o.tag===19)Qy(o,d,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(kt(zt,g),(a.mode&1)===0)a.memoizedState=null;else switch(v){case"forwards":for(d=a.child,v=null;d!==null;)o=d.alternate,o!==null&&Oc(o)===null&&(v=d),d=d.sibling;d=v,d===null?(v=a.child,a.child=null):(v=d.sibling,d.sibling=null),xp(a,!1,v,d,k);break;case"backwards":for(d=null,v=a.child,a.child=null;v!==null;){if(o=v.alternate,o!==null&&Oc(o)===null){a.child=v;break}o=v.sibling,v.sibling=d,d=v,v=o}xp(a,!0,d,null,k);break;case"together":xp(a,!1,null,null,void 0);break;default:a.memoizedState=null}return a.child}function Hc(o,a){(a.mode&1)===0&&o!==null&&(o.alternate=null,a.alternate=null,a.flags|=2)}function js(o,a,d){if(o!==null&&(a.dependencies=o.dependencies),Co|=a.lanes,(d&a.childLanes)===0)return null;if(o!==null&&a.child!==o.child)throw Error(n(153));if(a.child!==null){for(o=a.child,d=Ks(o,o.pendingProps),a.child=d,d.return=a;o.sibling!==null;)o=o.sibling,d=d.sibling=Ks(o,o.pendingProps),d.return=a;d.sibling=null}return a.child}function _C(o,a,d){switch(a.tag){case 3:Yy(a),fi();break;case 5:py(a);break;case 1:Vn(a.type)&&Cc(a);break;case 4:Jf(a,a.stateNode.containerInfo);break;case 10:var g=a.type._context,v=a.memoizedProps.value;kt(Dc,g._currentValue),g._currentValue=v;break;case 13:if(g=a.memoizedState,g!==null)return g.dehydrated!==null?(kt(zt,zt.current&1),a.flags|=128,null):(d&a.child.childLanes)!==0?Xy(o,a,d):(kt(zt,zt.current&1),o=js(o,a,d),o!==null?o.sibling:null);kt(zt,zt.current&1);break;case 19:if(g=(d&a.childLanes)!==0,(o.flags&128)!==0){if(g)return Zy(o,a,d);a.flags|=128}if(v=a.memoizedState,v!==null&&(v.rendering=null,v.tail=null,v.lastEffect=null),kt(zt,zt.current),g)break;return null;case 22:case 23:return a.lanes=0,Ky(o,a,d)}return js(o,a,d)}var eb,yp,tb,nb;eb=function(o,a){for(var d=a.child;d!==null;){if(d.tag===5||d.tag===6)o.appendChild(d.stateNode);else if(d.tag!==4&&d.child!==null){d.child.return=d,d=d.child;continue}if(d===a)break;for(;d.sibling===null;){if(d.return===null||d.return===a)return;d=d.return}d.sibling.return=d.return,d=d.sibling}},yp=function(){},tb=function(o,a,d,g){var v=o.memoizedProps;if(v!==g){o=a.stateNode,So(Qr.current);var k=null;switch(d){case"input":v=Pe(o,v),g=Pe(o,g),k=[];break;case"select":v=T({},v,{value:void 0}),g=T({},g,{value:void 0}),k=[];break;case"textarea":v=Ze(o,v),g=Ze(o,g),k=[];break;default:typeof v.onClick!="function"&&typeof g.onClick=="function"&&(o.onclick=kc)}vt(d,g);var A;d=null;for(ce in v)if(!g.hasOwnProperty(ce)&&v.hasOwnProperty(ce)&&v[ce]!=null)if(ce==="style"){var B=v[ce];for(A in B)B.hasOwnProperty(A)&&(d||(d={}),d[A]="")}else ce!=="dangerouslySetInnerHTML"&&ce!=="children"&&ce!=="suppressContentEditableWarning"&&ce!=="suppressHydrationWarning"&&ce!=="autoFocus"&&(i.hasOwnProperty(ce)?k||(k=[]):(k=k||[]).push(ce,null));for(ce in g){var K=g[ce];if(B=v!=null?v[ce]:void 0,g.hasOwnProperty(ce)&&K!==B&&(K!=null||B!=null))if(ce==="style")if(B){for(A in B)!B.hasOwnProperty(A)||K&&K.hasOwnProperty(A)||(d||(d={}),d[A]="");for(A in K)K.hasOwnProperty(A)&&B[A]!==K[A]&&(d||(d={}),d[A]=K[A])}else d||(k||(k=[]),k.push(ce,d)),d=K;else ce==="dangerouslySetInnerHTML"?(K=K?K.__html:void 0,B=B?B.__html:void 0,K!=null&&B!==K&&(k=k||[]).push(ce,K)):ce==="children"?typeof K!="string"&&typeof K!="number"||(k=k||[]).push(ce,""+K):ce!=="suppressContentEditableWarning"&&ce!=="suppressHydrationWarning"&&(i.hasOwnProperty(ce)?(K!=null&&ce==="onScroll"&&Rt("scroll",o),k||B===K||(k=[])):(k=k||[]).push(ce,K))}d&&(k=k||[]).push("style",d);var ce=k;(a.updateQueue=ce)&&(a.flags|=4)}},nb=function(o,a,d,g){d!==g&&(a.flags|=4)};function Xa(o,a){if(!Ot)switch(o.tailMode){case"hidden":a=o.tail;for(var d=null;a!==null;)a.alternate!==null&&(d=a),a=a.sibling;d===null?o.tail=null:d.sibling=null;break;case"collapsed":d=o.tail;for(var g=null;d!==null;)d.alternate!==null&&(g=d),d=d.sibling;g===null?a||o.tail===null?o.tail=null:o.tail.sibling=null:g.sibling=null}}function Tn(o){var a=o.alternate!==null&&o.alternate.child===o.child,d=0,g=0;if(a)for(var v=o.child;v!==null;)d|=v.lanes|v.childLanes,g|=v.subtreeFlags&14680064,g|=v.flags&14680064,v.return=o,v=v.sibling;else for(v=o.child;v!==null;)d|=v.lanes|v.childLanes,g|=v.subtreeFlags,g|=v.flags,v.return=o,v=v.sibling;return o.subtreeFlags|=g,o.childLanes=d,a}function FC(o,a,d){var g=a.pendingProps;switch(zf(a),a.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Tn(a),null;case 1:return Vn(a.type)&&Nc(),Tn(a),null;case 3:return g=a.stateNode,gi(),At(Un),At(Cn),Zf(),g.pendingContext&&(g.context=g.pendingContext,g.pendingContext=null),(o===null||o.child===null)&&(Rc(a)?a.flags|=4:o===null||o.memoizedState.isDehydrated&&(a.flags&256)===0||(a.flags|=1024,Or!==null&&(Pp(Or),Or=null))),yp(o,a),Tn(a),null;case 5:Xf(a);var v=So(Ka.current);if(d=a.type,o!==null&&a.stateNode!=null)tb(o,a,d,g,v),o.ref!==a.ref&&(a.flags|=512,a.flags|=2097152);else{if(!g){if(a.stateNode===null)throw Error(n(166));return Tn(a),null}if(o=So(Qr.current),Rc(a)){g=a.stateNode,d=a.type;var k=a.memoizedProps;switch(g[Xr]=a,g[Ba]=k,o=(a.mode&1)!==0,d){case"dialog":Rt("cancel",g),Rt("close",g);break;case"iframe":case"object":case"embed":Rt("load",g);break;case"video":case"audio":for(v=0;v<_a.length;v++)Rt(_a[v],g);break;case"source":Rt("error",g);break;case"img":case"image":case"link":Rt("error",g),Rt("load",g);break;case"details":Rt("toggle",g);break;case"input":V(g,k),Rt("invalid",g);break;case"select":g._wrapperState={wasMultiple:!!k.multiple},Rt("invalid",g);break;case"textarea":Tt(g,k),Rt("invalid",g)}vt(d,k),v=null;for(var A in k)if(k.hasOwnProperty(A)){var B=k[A];A==="children"?typeof B=="string"?g.textContent!==B&&(k.suppressHydrationWarning!==!0&&jc(g.textContent,B,o),v=["children",B]):typeof B=="number"&&g.textContent!==""+B&&(k.suppressHydrationWarning!==!0&&jc(g.textContent,B,o),v=["children",""+B]):i.hasOwnProperty(A)&&B!=null&&A==="onScroll"&&Rt("scroll",g)}switch(d){case"input":fe(g),he(g,k,!0);break;case"textarea":fe(g),jt(g);break;case"select":case"option":break;default:typeof k.onClick=="function"&&(g.onclick=kc)}g=v,a.updateQueue=g,g!==null&&(a.flags|=4)}else{A=v.nodeType===9?v:v.ownerDocument,o==="http://www.w3.org/1999/xhtml"&&(o=ue(d)),o==="http://www.w3.org/1999/xhtml"?d==="script"?(o=A.createElement("div"),o.innerHTML="<script><\/script>",o=o.removeChild(o.firstChild)):typeof g.is=="string"?o=A.createElement(d,{is:g.is}):(o=A.createElement(d),d==="select"&&(A=o,g.multiple?A.multiple=!0:g.size&&(A.size=g.size))):o=A.createElementNS(o,d),o[Xr]=a,o[Ba]=g,eb(o,a,!1,!1),a.stateNode=o;e:{switch(A=xe(d,g),d){case"dialog":Rt("cancel",o),Rt("close",o),v=g;break;case"iframe":case"object":case"embed":Rt("load",o),v=g;break;case"video":case"audio":for(v=0;v<_a.length;v++)Rt(_a[v],o);v=g;break;case"source":Rt("error",o),v=g;break;case"img":case"image":case"link":Rt("error",o),Rt("load",o),v=g;break;case"details":Rt("toggle",o),v=g;break;case"input":V(o,g),v=Pe(o,g),Rt("invalid",o);break;case"option":v=g;break;case"select":o._wrapperState={wasMultiple:!!g.multiple},v=T({},g,{value:void 0}),Rt("invalid",o);break;case"textarea":Tt(o,g),v=Ze(o,g),Rt("invalid",o);break;default:v=g}vt(d,v),B=v;for(k in B)if(B.hasOwnProperty(k)){var K=B[k];k==="style"?Qt(o,K):k==="dangerouslySetInnerHTML"?(K=K?K.__html:void 0,K!=null&&Ie(o,K)):k==="children"?typeof K=="string"?(d!=="textarea"||K!=="")&&We(o,K):typeof K=="number"&&We(o,""+K):k!=="suppressContentEditableWarning"&&k!=="suppressHydrationWarning"&&k!=="autoFocus"&&(i.hasOwnProperty(k)?K!=null&&k==="onScroll"&&Rt("scroll",o):K!=null&&N(o,k,K,A))}switch(d){case"input":fe(o),he(o,g,!1);break;case"textarea":fe(o),jt(o);break;case"option":g.value!=null&&o.setAttribute("value",""+me(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 v.onClick=="function"&&(o.onclick=kc)}switch(d){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 Tn(a),null;case 6:if(o&&a.stateNode!=null)nb(o,a,o.memoizedProps,g);else{if(typeof g!="string"&&a.stateNode===null)throw Error(n(166));if(d=So(Ka.current),So(Qr.current),Rc(a)){if(g=a.stateNode,d=a.memoizedProps,g[Xr]=a,(k=g.nodeValue!==d)&&(o=ar,o!==null))switch(o.tag){case 3:jc(g.nodeValue,d,(o.mode&1)!==0);break;case 5:o.memoizedProps.suppressHydrationWarning!==!0&&jc(g.nodeValue,d,(o.mode&1)!==0)}k&&(a.flags|=4)}else g=(d.nodeType===9?d:d.ownerDocument).createTextNode(g),g[Xr]=a,a.stateNode=g}return Tn(a),null;case 13:if(At(zt),g=a.memoizedState,o===null||o.memoizedState!==null&&o.memoizedState.dehydrated!==null){if(Ot&&lr!==null&&(a.mode&1)!==0&&(a.flags&128)===0)oy(),fi(),a.flags|=98560,k=!1;else if(k=Rc(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[Xr]=a}else fi(),(a.flags&128)===0&&(a.memoizedState=null),a.flags|=4;Tn(a),k=!1}else Or!==null&&(Pp(Or),Or=null),k=!0;if(!k)return a.flags&65536?a:null}return(a.flags&128)!==0?(a.lanes=d,a):(g=g!==null,g!==(o!==null&&o.memoizedState!==null)&&g&&(a.child.flags|=8192,(a.mode&1)!==0&&(o===null||(zt.current&1)!==0?cn===0&&(cn=3):Dp())),a.updateQueue!==null&&(a.flags|=4),Tn(a),null);case 4:return gi(),yp(o,a),o===null&&Fa(a.stateNode.containerInfo),Tn(a),null;case 10:return Kf(a.type._context),Tn(a),null;case 17:return Vn(a.type)&&Nc(),Tn(a),null;case 19:if(At(zt),k=a.memoizedState,k===null)return Tn(a),null;if(g=(a.flags&128)!==0,A=k.rendering,A===null)if(g)Xa(k,!1);else{if(cn!==0||o!==null&&(o.flags&128)!==0)for(o=a.child;o!==null;){if(A=Oc(o),A!==null){for(a.flags|=128,Xa(k,!1),g=A.updateQueue,g!==null&&(a.updateQueue=g,a.flags|=4),a.subtreeFlags=0,g=d,d=a.child;d!==null;)k=d,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}),d=d.sibling;return kt(zt,zt.current&1|2),a.child}o=o.sibling}k.tail!==null&&Ft()>vi&&(a.flags|=128,g=!0,Xa(k,!1),a.lanes=4194304)}else{if(!g)if(o=Oc(A),o!==null){if(a.flags|=128,g=!0,d=o.updateQueue,d!==null&&(a.updateQueue=d,a.flags|=4),Xa(k,!0),k.tail===null&&k.tailMode==="hidden"&&!A.alternate&&!Ot)return Tn(a),null}else 2*Ft()-k.renderingStartTime>vi&&d!==1073741824&&(a.flags|=128,g=!0,Xa(k,!1),a.lanes=4194304);k.isBackwards?(A.sibling=a.child,a.child=A):(d=k.last,d!==null?d.sibling=A:a.child=A,k.last=A)}return k.tail!==null?(a=k.tail,k.rendering=a,k.tail=a.sibling,k.renderingStartTime=Ft(),a.sibling=null,d=zt.current,kt(zt,g?d&1|2:d&1),a):(Tn(a),null);case 22:case 23:return Ap(),g=a.memoizedState!==null,o!==null&&o.memoizedState!==null!==g&&(a.flags|=8192),g&&(a.mode&1)!==0?(cr&1073741824)!==0&&(Tn(a),a.subtreeFlags&6&&(a.flags|=8192)):Tn(a),null;case 24:return null;case 25:return null}throw Error(n(156,a.tag))}function zC(o,a){switch(zf(a),a.tag){case 1:return Vn(a.type)&&Nc(),o=a.flags,o&65536?(a.flags=o&-65537|128,a):null;case 3:return gi(),At(Un),At(Cn),Zf(),o=a.flags,(o&65536)!==0&&(o&128)===0?(a.flags=o&-65537|128,a):null;case 5:return Xf(a),null;case 13:if(At(zt),o=a.memoizedState,o!==null&&o.dehydrated!==null){if(a.alternate===null)throw Error(n(340));fi()}return o=a.flags,o&65536?(a.flags=o&-65537|128,a):null;case 19:return At(zt),null;case 4:return gi(),null;case 10:return Kf(a.type._context),null;case 22:case 23:return Ap(),null;case 24:return null;default:return null}}var Wc=!1,Pn=!1,BC=typeof WeakSet=="function"?WeakSet:Set,Me=null;function yi(o,a){var d=o.ref;if(d!==null)if(typeof d=="function")try{d(null)}catch(g){Ht(o,a,g)}else d.current=null}function bp(o,a,d){try{d()}catch(g){Ht(o,a,g)}}var rb=!1;function UC(o,a){if(Af=dc,o=Ix(),kf(o)){if("selectionStart"in o)var d={start:o.selectionStart,end:o.selectionEnd};else e:{d=(d=o.ownerDocument)&&d.defaultView||window;var g=d.getSelection&&d.getSelection();if(g&&g.rangeCount!==0){d=g.anchorNode;var v=g.anchorOffset,k=g.focusNode;g=g.focusOffset;try{d.nodeType,k.nodeType}catch{d=null;break e}var A=0,B=-1,K=-1,ce=0,je=0,ke=o,we=null;t:for(;;){for(var $e;ke!==d||v!==0&&ke.nodeType!==3||(B=A+v),ke!==k||g!==0&&ke.nodeType!==3||(K=A+g),ke.nodeType===3&&(A+=ke.nodeValue.length),($e=ke.firstChild)!==null;)we=ke,ke=$e;for(;;){if(ke===o)break t;if(we===d&&++ce===v&&(B=A),we===k&&++je===g&&(K=A),($e=ke.nextSibling)!==null)break;ke=we,we=ke.parentNode}ke=$e}d=B===-1||K===-1?null:{start:B,end:K}}else d=null}d=d||{start:0,end:0}}else d=null;for(Df={focusedElem:o,selectionRange:d},dc=!1,Me=a;Me!==null;)if(a=Me,o=a.child,(a.subtreeFlags&1028)!==0&&o!==null)o.return=a,Me=o;else for(;Me!==null;){a=Me;try{var _e=a.alternate;if((a.flags&1024)!==0)switch(a.tag){case 0:case 11:case 15:break;case 1:if(_e!==null){var Fe=_e.memoizedProps,Yt=_e.memoizedState,te=a.stateNode,Y=te.getSnapshotBeforeUpdate(a.elementType===a.type?Fe:Mr(a.type,Fe),Yt);te.__reactInternalSnapshotBeforeUpdate=Y}break;case 3:var oe=a.stateNode.containerInfo;oe.nodeType===1?oe.textContent="":oe.nodeType===9&&oe.documentElement&&oe.removeChild(oe.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,Me=o;break}Me=a.return}return _e=rb,rb=!1,_e}function Qa(o,a,d){var g=a.updateQueue;if(g=g!==null?g.lastEffect:null,g!==null){var v=g=g.next;do{if((v.tag&o)===o){var k=v.destroy;v.destroy=void 0,k!==void 0&&bp(a,d,k)}v=v.next}while(v!==g)}}function Kc(o,a){if(a=a.updateQueue,a=a!==null?a.lastEffect:null,a!==null){var d=a=a.next;do{if((d.tag&o)===o){var g=d.create;d.destroy=g()}d=d.next}while(d!==a)}}function vp(o){var a=o.ref;if(a!==null){var d=o.stateNode;switch(o.tag){case 5:o=d;break;default:o=d}typeof a=="function"?a(o):a.current=o}}function sb(o){var a=o.alternate;a!==null&&(o.alternate=null,sb(a)),o.child=null,o.deletions=null,o.sibling=null,o.tag===5&&(a=o.stateNode,a!==null&&(delete a[Xr],delete a[Ba],delete a[Of],delete a[SC],delete a[NC])),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 ob(o){return o.tag===5||o.tag===3||o.tag===4}function ib(o){e:for(;;){for(;o.sibling===null;){if(o.return===null||ob(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 wp(o,a,d){var g=o.tag;if(g===5||g===6)o=o.stateNode,a?d.nodeType===8?d.parentNode.insertBefore(o,a):d.insertBefore(o,a):(d.nodeType===8?(a=d.parentNode,a.insertBefore(o,d)):(a=d,a.appendChild(o)),d=d._reactRootContainer,d!=null||a.onclick!==null||(a.onclick=kc));else if(g!==4&&(o=o.child,o!==null))for(wp(o,a,d),o=o.sibling;o!==null;)wp(o,a,d),o=o.sibling}function jp(o,a,d){var g=o.tag;if(g===5||g===6)o=o.stateNode,a?d.insertBefore(o,a):d.appendChild(o);else if(g!==4&&(o=o.child,o!==null))for(jp(o,a,d),o=o.sibling;o!==null;)jp(o,a,d),o=o.sibling}var jn=null,_r=!1;function Bs(o,a,d){for(d=d.child;d!==null;)ab(o,a,d),d=d.sibling}function ab(o,a,d){if(yr&&typeof yr.onCommitFiberUnmount=="function")try{yr.onCommitFiberUnmount(Yo,d)}catch{}switch(d.tag){case 5:Pn||yi(d,a);case 6:var g=jn,v=_r;jn=null,Bs(o,a,d),jn=g,_r=v,jn!==null&&(_r?(o=jn,d=d.stateNode,o.nodeType===8?o.parentNode.removeChild(d):o.removeChild(d)):jn.removeChild(d.stateNode));break;case 18:jn!==null&&(_r?(o=jn,d=d.stateNode,o.nodeType===8?If(o.parentNode,d):o.nodeType===1&&If(o,d),Ra(o)):If(jn,d.stateNode));break;case 4:g=jn,v=_r,jn=d.stateNode.containerInfo,_r=!0,Bs(o,a,d),jn=g,_r=v;break;case 0:case 11:case 14:case 15:if(!Pn&&(g=d.updateQueue,g!==null&&(g=g.lastEffect,g!==null))){v=g=g.next;do{var k=v,A=k.destroy;k=k.tag,A!==void 0&&((k&2)!==0||(k&4)!==0)&&bp(d,a,A),v=v.next}while(v!==g)}Bs(o,a,d);break;case 1:if(!Pn&&(yi(d,a),g=d.stateNode,typeof g.componentWillUnmount=="function"))try{g.props=d.memoizedProps,g.state=d.memoizedState,g.componentWillUnmount()}catch(B){Ht(d,a,B)}Bs(o,a,d);break;case 21:Bs(o,a,d);break;case 22:d.mode&1?(Pn=(g=Pn)||d.memoizedState!==null,Bs(o,a,d),Pn=g):Bs(o,a,d);break;default:Bs(o,a,d)}}function lb(o){var a=o.updateQueue;if(a!==null){o.updateQueue=null;var d=o.stateNode;d===null&&(d=o.stateNode=new BC),a.forEach(function(g){var v=XC.bind(null,o,g);d.has(g)||(d.add(g),g.then(v,v))})}}function Fr(o,a){var d=a.deletions;if(d!==null)for(var g=0;g<d.length;g++){var v=d[g];try{var k=o,A=a,B=A;e:for(;B!==null;){switch(B.tag){case 5:jn=B.stateNode,_r=!1;break e;case 3:jn=B.stateNode.containerInfo,_r=!0;break e;case 4:jn=B.stateNode.containerInfo,_r=!0;break e}B=B.return}if(jn===null)throw Error(n(160));ab(k,A,v),jn=null,_r=!1;var K=v.alternate;K!==null&&(K.return=null),v.return=null}catch(ce){Ht(v,a,ce)}}if(a.subtreeFlags&12854)for(a=a.child;a!==null;)cb(a,o),a=a.sibling}function cb(o,a){var d=o.alternate,g=o.flags;switch(o.tag){case 0:case 11:case 14:case 15:if(Fr(a,o),es(o),g&4){try{Qa(3,o,o.return),Kc(3,o)}catch(Fe){Ht(o,o.return,Fe)}try{Qa(5,o,o.return)}catch(Fe){Ht(o,o.return,Fe)}}break;case 1:Fr(a,o),es(o),g&512&&d!==null&&yi(d,d.return);break;case 5:if(Fr(a,o),es(o),g&512&&d!==null&&yi(d,d.return),o.flags&32){var v=o.stateNode;try{We(v,"")}catch(Fe){Ht(o,o.return,Fe)}}if(g&4&&(v=o.stateNode,v!=null)){var k=o.memoizedProps,A=d!==null?d.memoizedProps:k,B=o.type,K=o.updateQueue;if(o.updateQueue=null,K!==null)try{B==="input"&&k.type==="radio"&&k.name!=null&&H(v,k),xe(B,A);var ce=xe(B,k);for(A=0;A<K.length;A+=2){var je=K[A],ke=K[A+1];je==="style"?Qt(v,ke):je==="dangerouslySetInnerHTML"?Ie(v,ke):je==="children"?We(v,ke):N(v,je,ke,ce)}switch(B){case"input":ae(v,k);break;case"textarea":yt(v,k);break;case"select":var we=v._wrapperState.wasMultiple;v._wrapperState.wasMultiple=!!k.multiple;var $e=k.value;$e!=null?Ve(v,!!k.multiple,$e,!1):we!==!!k.multiple&&(k.defaultValue!=null?Ve(v,!!k.multiple,k.defaultValue,!0):Ve(v,!!k.multiple,k.multiple?[]:"",!1))}v[Ba]=k}catch(Fe){Ht(o,o.return,Fe)}}break;case 6:if(Fr(a,o),es(o),g&4){if(o.stateNode===null)throw Error(n(162));v=o.stateNode,k=o.memoizedProps;try{v.nodeValue=k}catch(Fe){Ht(o,o.return,Fe)}}break;case 3:if(Fr(a,o),es(o),g&4&&d!==null&&d.memoizedState.isDehydrated)try{Ra(a.containerInfo)}catch(Fe){Ht(o,o.return,Fe)}break;case 4:Fr(a,o),es(o);break;case 13:Fr(a,o),es(o),v=o.child,v.flags&8192&&(k=v.memoizedState!==null,v.stateNode.isHidden=k,!k||v.alternate!==null&&v.alternate.memoizedState!==null||(Np=Ft())),g&4&&lb(o);break;case 22:if(je=d!==null&&d.memoizedState!==null,o.mode&1?(Pn=(ce=Pn)||je,Fr(a,o),Pn=ce):Fr(a,o),es(o),g&8192){if(ce=o.memoizedState!==null,(o.stateNode.isHidden=ce)&&!je&&(o.mode&1)!==0)for(Me=o,je=o.child;je!==null;){for(ke=Me=je;Me!==null;){switch(we=Me,$e=we.child,we.tag){case 0:case 11:case 14:case 15:Qa(4,we,we.return);break;case 1:yi(we,we.return);var _e=we.stateNode;if(typeof _e.componentWillUnmount=="function"){g=we,d=we.return;try{a=g,_e.props=a.memoizedProps,_e.state=a.memoizedState,_e.componentWillUnmount()}catch(Fe){Ht(g,d,Fe)}}break;case 5:yi(we,we.return);break;case 22:if(we.memoizedState!==null){fb(ke);continue}}$e!==null?($e.return=we,Me=$e):fb(ke)}je=je.sibling}e:for(je=null,ke=o;;){if(ke.tag===5){if(je===null){je=ke;try{v=ke.stateNode,ce?(k=v.style,typeof k.setProperty=="function"?k.setProperty("display","none","important"):k.display="none"):(B=ke.stateNode,K=ke.memoizedProps.style,A=K!=null&&K.hasOwnProperty("display")?K.display:null,B.style.display=bt("display",A))}catch(Fe){Ht(o,o.return,Fe)}}}else if(ke.tag===6){if(je===null)try{ke.stateNode.nodeValue=ce?"":ke.memoizedProps}catch(Fe){Ht(o,o.return,Fe)}}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:Fr(a,o),es(o),g&4&&lb(o);break;case 21:break;default:Fr(a,o),es(o)}}function es(o){var a=o.flags;if(a&2){try{e:{for(var d=o.return;d!==null;){if(ob(d)){var g=d;break e}d=d.return}throw Error(n(160))}switch(g.tag){case 5:var v=g.stateNode;g.flags&32&&(We(v,""),g.flags&=-33);var k=ib(o);jp(o,k,v);break;case 3:case 4:var A=g.stateNode.containerInfo,B=ib(o);wp(o,B,A);break;default:throw Error(n(161))}}catch(K){Ht(o,o.return,K)}o.flags&=-3}a&4096&&(o.flags&=-4097)}function VC(o,a,d){Me=o,ub(o)}function ub(o,a,d){for(var g=(o.mode&1)!==0;Me!==null;){var v=Me,k=v.child;if(v.tag===22&&g){var A=v.memoizedState!==null||Wc;if(!A){var B=v.alternate,K=B!==null&&B.memoizedState!==null||Pn;B=Wc;var ce=Pn;if(Wc=A,(Pn=K)&&!ce)for(Me=v;Me!==null;)A=Me,K=A.child,A.tag===22&&A.memoizedState!==null?pb(v):K!==null?(K.return=A,Me=K):pb(v);for(;k!==null;)Me=k,ub(k),k=k.sibling;Me=v,Wc=B,Pn=ce}db(o)}else(v.subtreeFlags&8772)!==0&&k!==null?(k.return=v,Me=k):db(o)}}function db(o){for(;Me!==null;){var a=Me;if((a.flags&8772)!==0){var d=a.alternate;try{if((a.flags&8772)!==0)switch(a.tag){case 0:case 11:case 15:Pn||Kc(5,a);break;case 1:var g=a.stateNode;if(a.flags&4&&!Pn)if(d===null)g.componentDidMount();else{var v=a.elementType===a.type?d.memoizedProps:Mr(a.type,d.memoizedProps);g.componentDidUpdate(v,d.memoizedState,g.__reactInternalSnapshotBeforeUpdate)}var k=a.updateQueue;k!==null&&fy(a,k,g);break;case 3:var A=a.updateQueue;if(A!==null){if(d=null,a.child!==null)switch(a.child.tag){case 5:d=a.child.stateNode;break;case 1:d=a.child.stateNode}fy(a,A,d)}break;case 5:var B=a.stateNode;if(d===null&&a.flags&4){d=B;var K=a.memoizedProps;switch(a.type){case"button":case"input":case"select":case"textarea":K.autoFocus&&d.focus();break;case"img":K.src&&(d.src=K.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(a.memoizedState===null){var ce=a.alternate;if(ce!==null){var je=ce.memoizedState;if(je!==null){var ke=je.dehydrated;ke!==null&&Ra(ke)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(n(163))}Pn||a.flags&512&&vp(a)}catch(we){Ht(a,a.return,we)}}if(a===o){Me=null;break}if(d=a.sibling,d!==null){d.return=a.return,Me=d;break}Me=a.return}}function fb(o){for(;Me!==null;){var a=Me;if(a===o){Me=null;break}var d=a.sibling;if(d!==null){d.return=a.return,Me=d;break}Me=a.return}}function pb(o){for(;Me!==null;){var a=Me;try{switch(a.tag){case 0:case 11:case 15:var d=a.return;try{Kc(4,a)}catch(K){Ht(a,d,K)}break;case 1:var g=a.stateNode;if(typeof g.componentDidMount=="function"){var v=a.return;try{g.componentDidMount()}catch(K){Ht(a,v,K)}}var k=a.return;try{vp(a)}catch(K){Ht(a,k,K)}break;case 5:var A=a.return;try{vp(a)}catch(K){Ht(a,A,K)}}}catch(K){Ht(a,a.return,K)}if(a===o){Me=null;break}var B=a.sibling;if(B!==null){B.return=a.return,Me=B;break}Me=a.return}}var HC=Math.ceil,qc=R.ReactCurrentDispatcher,kp=R.ReactCurrentOwner,kr=R.ReactCurrentBatchConfig,ut=0,gn=null,en=null,kn=0,cr=0,bi=Os(0),cn=0,Za=null,Co=0,Gc=0,Sp=0,el=null,Wn=null,Np=0,vi=1/0,ks=null,Yc=!1,Cp=null,Us=null,Jc=!1,Vs=null,Xc=0,tl=0,Ep=null,Qc=-1,Zc=0;function In(){return(ut&6)!==0?Ft():Qc!==-1?Qc:Qc=Ft()}function Hs(o){return(o.mode&1)===0?1:(ut&2)!==0&&kn!==0?kn&-kn:EC.transition!==null?(Zc===0&&(Zc=cc()),Zc):(o=be,o!==0||(o=window.event,o=o===void 0?16:hx(o.type)),o)}function zr(o,a,d,g){if(50<tl)throw tl=0,Ep=null,Error(n(185));M(o,d,g),((ut&2)===0||o!==gn)&&(o===gn&&((ut&2)===0&&(Gc|=d),cn===4&&Ws(o,kn)),Kn(o,g),d===1&&ut===0&&(a.mode&1)===0&&(vi=Ft()+500,Ec&&_s()))}function Kn(o,a){var d=o.callbackNode;df(o,a);var g=Zo(o,o===gn?kn:0);if(g===0)d!==null&&oc(d),o.callbackNode=null,o.callbackPriority=0;else if(a=g&-g,o.callbackPriority!==a){if(d!=null&&oc(d),a===1)o.tag===0?CC(hb.bind(null,o)):ey(hb.bind(null,o)),jC(function(){(ut&6)===0&&_s()}),d=null;else{switch(st(g)){case 1:d=ka;break;case 4:d=ic;break;case 16:d=Pt;break;case 536870912:d=Go;break;default:d=Pt}d=kb(d,mb.bind(null,o))}o.callbackPriority=a,o.callbackNode=d}}function mb(o,a){if(Qc=-1,Zc=0,(ut&6)!==0)throw Error(n(327));var d=o.callbackNode;if(wi()&&o.callbackNode!==d)return null;var g=Zo(o,o===gn?kn:0);if(g===0)return null;if((g&30)!==0||(g&o.expiredLanes)!==0||a)a=eu(o,g);else{a=g;var v=ut;ut|=2;var k=xb();(gn!==o||kn!==a)&&(ks=null,vi=Ft()+500,To(o,a));do try{qC();break}catch(B){gb(o,B)}while(!0);Wf(),qc.current=k,ut=v,en!==null?a=0:(gn=null,kn=0,a=cn)}if(a!==0){if(a===2&&(v=Na(o),v!==0&&(g=v,a=Tp(o,v))),a===1)throw d=Za,To(o,0),Ws(o,g),Kn(o,Ft()),d;if(a===6)Ws(o,g);else{if(v=o.current.alternate,(g&30)===0&&!WC(v)&&(a=eu(o,g),a===2&&(k=Na(o),k!==0&&(g=k,a=Tp(o,k))),a===1))throw d=Za,To(o,0),Ws(o,g),Kn(o,Ft()),d;switch(o.finishedWork=v,o.finishedLanes=g,a){case 0:case 1:throw Error(n(345));case 2:Po(o,Wn,ks);break;case 3:if(Ws(o,g),(g&130023424)===g&&(a=Np+500-Ft(),10<a)){if(Zo(o,0)!==0)break;if(v=o.suspendedLanes,(v&g)!==g){In(),o.pingedLanes|=o.suspendedLanes&v;break}o.timeoutHandle=$f(Po.bind(null,o,Wn,ks),a);break}Po(o,Wn,ks);break;case 4:if(Ws(o,g),(g&4194240)===g)break;for(a=o.eventTimes,v=-1;0<g;){var A=31-Dn(g);k=1<<A,A=a[A],A>v&&(v=A),g&=~k}if(g=v,g=Ft()-g,g=(120>g?120:480>g?480:1080>g?1080:1920>g?1920:3e3>g?3e3:4320>g?4320:1960*HC(g/1960))-g,10<g){o.timeoutHandle=$f(Po.bind(null,o,Wn,ks),g);break}Po(o,Wn,ks);break;case 5:Po(o,Wn,ks);break;default:throw Error(n(329))}}}return Kn(o,Ft()),o.callbackNode===d?mb.bind(null,o):null}function Tp(o,a){var d=el;return o.current.memoizedState.isDehydrated&&(To(o,a).flags|=256),o=eu(o,a),o!==2&&(a=Wn,Wn=d,a!==null&&Pp(a)),o}function Pp(o){Wn===null?Wn=o:Wn.push.apply(Wn,o)}function WC(o){for(var a=o;;){if(a.flags&16384){var d=a.updateQueue;if(d!==null&&(d=d.stores,d!==null))for(var g=0;g<d.length;g++){var v=d[g],k=v.getSnapshot;v=v.value;try{if(!Ir(k(),v))return!1}catch{return!1}}}if(d=a.child,a.subtreeFlags&16384&&d!==null)d.return=a,a=d;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 Ws(o,a){for(a&=~Sp,a&=~Gc,o.suspendedLanes|=a,o.pingedLanes&=~a,o=o.expirationTimes;0<a;){var d=31-Dn(a),g=1<<d;o[d]=-1,a&=~g}}function hb(o){if((ut&6)!==0)throw Error(n(327));wi();var a=Zo(o,0);if((a&1)===0)return Kn(o,Ft()),null;var d=eu(o,a);if(o.tag!==0&&d===2){var g=Na(o);g!==0&&(a=g,d=Tp(o,g))}if(d===1)throw d=Za,To(o,0),Ws(o,a),Kn(o,Ft()),d;if(d===6)throw Error(n(345));return o.finishedWork=o.current.alternate,o.finishedLanes=a,Po(o,Wn,ks),Kn(o,Ft()),null}function Rp(o,a){var d=ut;ut|=1;try{return o(a)}finally{ut=d,ut===0&&(vi=Ft()+500,Ec&&_s())}}function Eo(o){Vs!==null&&Vs.tag===0&&(ut&6)===0&&wi();var a=ut;ut|=1;var d=kr.transition,g=be;try{if(kr.transition=null,be=1,o)return o()}finally{be=g,kr.transition=d,ut=a,(ut&6)===0&&_s()}}function Ap(){cr=bi.current,At(bi)}function To(o,a){o.finishedWork=null,o.finishedLanes=0;var d=o.timeoutHandle;if(d!==-1&&(o.timeoutHandle=-1,wC(d)),en!==null)for(d=en.return;d!==null;){var g=d;switch(zf(g),g.tag){case 1:g=g.type.childContextTypes,g!=null&&Nc();break;case 3:gi(),At(Un),At(Cn),Zf();break;case 5:Xf(g);break;case 4:gi();break;case 13:At(zt);break;case 19:At(zt);break;case 10:Kf(g.type._context);break;case 22:case 23:Ap()}d=d.return}if(gn=o,en=o=Ks(o.current,null),kn=cr=a,cn=0,Za=null,Sp=Gc=Co=0,Wn=el=null,ko!==null){for(a=0;a<ko.length;a++)if(d=ko[a],g=d.interleaved,g!==null){d.interleaved=null;var v=g.next,k=d.pending;if(k!==null){var A=k.next;k.next=v,g.next=A}d.pending=g}ko=null}return o}function gb(o,a){do{var d=en;try{if(Wf(),Mc.current=Bc,_c){for(var g=Bt.memoizedState;g!==null;){var v=g.queue;v!==null&&(v.pending=null),g=g.next}_c=!1}if(No=0,hn=ln=Bt=null,qa=!1,Ga=0,kp.current=null,d===null||d.return===null){cn=1,Za=a,en=null;break}e:{var k=o,A=d.return,B=d,K=a;if(a=kn,B.flags|=32768,K!==null&&typeof K=="object"&&typeof K.then=="function"){var ce=K,je=B,ke=je.tag;if((je.mode&1)===0&&(ke===0||ke===11||ke===15)){var we=je.alternate;we?(je.updateQueue=we.updateQueue,je.memoizedState=we.memoizedState,je.lanes=we.lanes):(je.updateQueue=null,je.memoizedState=null)}var $e=By(A);if($e!==null){$e.flags&=-257,Uy($e,A,B,k,a),$e.mode&1&&zy(k,ce,a),a=$e,K=ce;var _e=a.updateQueue;if(_e===null){var Fe=new Set;Fe.add(K),a.updateQueue=Fe}else _e.add(K);break e}else{if((a&1)===0){zy(k,ce,a),Dp();break e}K=Error(n(426))}}else if(Ot&&B.mode&1){var Yt=By(A);if(Yt!==null){(Yt.flags&65536)===0&&(Yt.flags|=256),Uy(Yt,A,B,k,a),Vf(xi(K,B));break e}}k=K=xi(K,B),cn!==4&&(cn=2),el===null?el=[k]:el.push(k),k=A;do{switch(k.tag){case 3:k.flags|=65536,a&=-a,k.lanes|=a;var te=_y(k,K,a);dy(k,te);break e;case 1:B=K;var Y=k.type,oe=k.stateNode;if((k.flags&128)===0&&(typeof Y.getDerivedStateFromError=="function"||oe!==null&&typeof oe.componentDidCatch=="function"&&(Us===null||!Us.has(oe)))){k.flags|=65536,a&=-a,k.lanes|=a;var Ce=Fy(k,B,a);dy(k,Ce);break e}}k=k.return}while(k!==null)}bb(d)}catch(Ue){a=Ue,en===d&&d!==null&&(en=d=d.return);continue}break}while(!0)}function xb(){var o=qc.current;return qc.current=Bc,o===null?Bc:o}function Dp(){(cn===0||cn===3||cn===2)&&(cn=4),gn===null||(Co&268435455)===0&&(Gc&268435455)===0||Ws(gn,kn)}function eu(o,a){var d=ut;ut|=2;var g=xb();(gn!==o||kn!==a)&&(ks=null,To(o,a));do try{KC();break}catch(v){gb(o,v)}while(!0);if(Wf(),ut=d,qc.current=g,en!==null)throw Error(n(261));return gn=null,kn=0,cn}function KC(){for(;en!==null;)yb(en)}function qC(){for(;en!==null&&!lf();)yb(en)}function yb(o){var a=jb(o.alternate,o,cr);o.memoizedProps=o.pendingProps,a===null?bb(o):en=a,kp.current=null}function bb(o){var a=o;do{var d=a.alternate;if(o=a.return,(a.flags&32768)===0){if(d=FC(d,a,cr),d!==null){en=d;return}}else{if(d=zC(d,a),d!==null){d.flags&=32767,en=d;return}if(o!==null)o.flags|=32768,o.subtreeFlags=0,o.deletions=null;else{cn=6,en=null;return}}if(a=a.sibling,a!==null){en=a;return}en=a=o}while(a!==null);cn===0&&(cn=5)}function Po(o,a,d){var g=be,v=kr.transition;try{kr.transition=null,be=1,GC(o,a,d,g)}finally{kr.transition=v,be=g}return null}function GC(o,a,d,g){do wi();while(Vs!==null);if((ut&6)!==0)throw Error(n(327));d=o.finishedWork;var v=o.finishedLanes;if(d===null)return null;if(o.finishedWork=null,o.finishedLanes=0,d===o.current)throw Error(n(177));o.callbackNode=null,o.callbackPriority=0;var k=d.lanes|d.childLanes;if(ie(o,k),o===gn&&(en=gn=null,kn=0),(d.subtreeFlags&2064)===0&&(d.flags&2064)===0||Jc||(Jc=!0,kb(Pt,function(){return wi(),null})),k=(d.flags&15990)!==0,(d.subtreeFlags&15990)!==0||k){k=kr.transition,kr.transition=null;var A=be;be=1;var B=ut;ut|=4,kp.current=null,UC(o,d),cb(d,o),mC(Df),dc=!!Af,Df=Af=null,o.current=d,VC(d),Gr(),ut=B,be=A,kr.transition=k}else o.current=d;if(Jc&&(Jc=!1,Vs=o,Xc=v),k=o.pendingLanes,k===0&&(Us=null),ac(d.stateNode),Kn(o,Ft()),a!==null)for(g=o.onRecoverableError,d=0;d<a.length;d++)v=a[d],g(v.value,{componentStack:v.stack,digest:v.digest});if(Yc)throw Yc=!1,o=Cp,Cp=null,o;return(Xc&1)!==0&&o.tag!==0&&wi(),k=o.pendingLanes,(k&1)!==0?o===Ep?tl++:(tl=0,Ep=o):tl=0,_s(),null}function wi(){if(Vs!==null){var o=st(Xc),a=kr.transition,d=be;try{if(kr.transition=null,be=16>o?16:o,Vs===null)var g=!1;else{if(o=Vs,Vs=null,Xc=0,(ut&6)!==0)throw Error(n(331));var v=ut;for(ut|=4,Me=o.current;Me!==null;){var k=Me,A=k.child;if((Me.flags&16)!==0){var B=k.deletions;if(B!==null){for(var K=0;K<B.length;K++){var ce=B[K];for(Me=ce;Me!==null;){var je=Me;switch(je.tag){case 0:case 11:case 15:Qa(8,je,k)}var ke=je.child;if(ke!==null)ke.return=je,Me=ke;else for(;Me!==null;){je=Me;var we=je.sibling,$e=je.return;if(sb(je),je===ce){Me=null;break}if(we!==null){we.return=$e,Me=we;break}Me=$e}}}var _e=k.alternate;if(_e!==null){var Fe=_e.child;if(Fe!==null){_e.child=null;do{var Yt=Fe.sibling;Fe.sibling=null,Fe=Yt}while(Fe!==null)}}Me=k}}if((k.subtreeFlags&2064)!==0&&A!==null)A.return=k,Me=A;else e:for(;Me!==null;){if(k=Me,(k.flags&2048)!==0)switch(k.tag){case 0:case 11:case 15:Qa(9,k,k.return)}var te=k.sibling;if(te!==null){te.return=k.return,Me=te;break e}Me=k.return}}var Y=o.current;for(Me=Y;Me!==null;){A=Me;var oe=A.child;if((A.subtreeFlags&2064)!==0&&oe!==null)oe.return=A,Me=oe;else e:for(A=Y;Me!==null;){if(B=Me,(B.flags&2048)!==0)try{switch(B.tag){case 0:case 11:case 15:Kc(9,B)}}catch(Ue){Ht(B,B.return,Ue)}if(B===A){Me=null;break e}var Ce=B.sibling;if(Ce!==null){Ce.return=B.return,Me=Ce;break e}Me=B.return}}if(ut=v,_s(),yr&&typeof yr.onPostCommitFiberRoot=="function")try{yr.onPostCommitFiberRoot(Yo,o)}catch{}g=!0}return g}finally{be=d,kr.transition=a}}return!1}function vb(o,a,d){a=xi(d,a),a=_y(o,a,1),o=zs(o,a,1),a=In(),o!==null&&(M(o,1,a),Kn(o,a))}function Ht(o,a,d){if(o.tag===3)vb(o,o,d);else for(;a!==null;){if(a.tag===3){vb(a,o,d);break}else if(a.tag===1){var g=a.stateNode;if(typeof a.type.getDerivedStateFromError=="function"||typeof g.componentDidCatch=="function"&&(Us===null||!Us.has(g))){o=xi(d,o),o=Fy(a,o,1),a=zs(a,o,1),o=In(),a!==null&&(M(a,1,o),Kn(a,o));break}}a=a.return}}function YC(o,a,d){var g=o.pingCache;g!==null&&g.delete(a),a=In(),o.pingedLanes|=o.suspendedLanes&d,gn===o&&(kn&d)===d&&(cn===4||cn===3&&(kn&130023424)===kn&&500>Ft()-Np?To(o,0):Sp|=d),Kn(o,a)}function wb(o,a){a===0&&((o.mode&1)===0?a=1:(a=Qo,Qo<<=1,(Qo&130023424)===0&&(Qo=4194304)));var d=In();o=vs(o,a),o!==null&&(M(o,a,d),Kn(o,d))}function JC(o){var a=o.memoizedState,d=0;a!==null&&(d=a.retryLane),wb(o,d)}function XC(o,a){var d=0;switch(o.tag){case 13:var g=o.stateNode,v=o.memoizedState;v!==null&&(d=v.retryLane);break;case 19:g=o.stateNode;break;default:throw Error(n(314))}g!==null&&g.delete(a),wb(o,d)}var jb;jb=function(o,a,d){if(o!==null)if(o.memoizedProps!==a.pendingProps||Un.current)Hn=!0;else{if((o.lanes&d)===0&&(a.flags&128)===0)return Hn=!1,_C(o,a,d);Hn=(o.flags&131072)!==0}else Hn=!1,Ot&&(a.flags&1048576)!==0&&ty(a,Pc,a.index);switch(a.lanes=0,a.tag){case 2:var g=a.type;Hc(o,a),o=a.pendingProps;var v=ci(a,Cn.current);hi(a,d),v=np(null,a,g,o,v,d);var k=rp();return a.flags|=1,typeof v=="object"&&v!==null&&typeof v.render=="function"&&v.$$typeof===void 0?(a.tag=1,a.memoizedState=null,a.updateQueue=null,Vn(g)?(k=!0,Cc(a)):k=!1,a.memoizedState=v.state!==null&&v.state!==void 0?v.state:null,Yf(a),v.updater=Uc,a.stateNode=v,v._reactInternals=a,cp(a,g,o,d),a=pp(null,a,g,!0,k,d)):(a.tag=0,Ot&&k&&Ff(a),$n(null,a,v,d),a=a.child),a;case 16:g=a.elementType;e:{switch(Hc(o,a),o=a.pendingProps,v=g._init,g=v(g._payload),a.type=g,v=a.tag=ZC(g),o=Mr(g,o),v){case 0:a=fp(null,a,g,o,d);break e;case 1:a=Gy(null,a,g,o,d);break e;case 11:a=Vy(null,a,g,o,d);break e;case 14:a=Hy(null,a,g,Mr(g.type,o),d);break e}throw Error(n(306,g,""))}return a;case 0:return g=a.type,v=a.pendingProps,v=a.elementType===g?v:Mr(g,v),fp(o,a,g,v,d);case 1:return g=a.type,v=a.pendingProps,v=a.elementType===g?v:Mr(g,v),Gy(o,a,g,v,d);case 3:e:{if(Yy(a),o===null)throw Error(n(387));g=a.pendingProps,k=a.memoizedState,v=k.element,uy(o,a),Ic(a,g,null,d);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){v=xi(Error(n(423)),a),a=Jy(o,a,g,d,v);break e}else if(g!==v){v=xi(Error(n(424)),a),a=Jy(o,a,g,d,v);break e}else for(lr=Is(a.stateNode.containerInfo.firstChild),ar=a,Ot=!0,Or=null,d=ly(a,null,g,d),a.child=d;d;)d.flags=d.flags&-3|4096,d=d.sibling;else{if(fi(),g===v){a=js(o,a,d);break e}$n(o,a,g,d)}a=a.child}return a;case 5:return py(a),o===null&&Uf(a),g=a.type,v=a.pendingProps,k=o!==null?o.memoizedProps:null,A=v.children,Lf(g,v)?A=null:k!==null&&Lf(g,k)&&(a.flags|=32),qy(o,a),$n(o,a,A,d),a.child;case 6:return o===null&&Uf(a),null;case 13:return Xy(o,a,d);case 4:return Jf(a,a.stateNode.containerInfo),g=a.pendingProps,o===null?a.child=pi(a,null,g,d):$n(o,a,g,d),a.child;case 11:return g=a.type,v=a.pendingProps,v=a.elementType===g?v:Mr(g,v),Vy(o,a,g,v,d);case 7:return $n(o,a,a.pendingProps,d),a.child;case 8:return $n(o,a,a.pendingProps.children,d),a.child;case 12:return $n(o,a,a.pendingProps.children,d),a.child;case 10:e:{if(g=a.type._context,v=a.pendingProps,k=a.memoizedProps,A=v.value,kt(Dc,g._currentValue),g._currentValue=A,k!==null)if(Ir(k.value,A)){if(k.children===v.children&&!Un.current){a=js(o,a,d);break e}}else for(k=a.child,k!==null&&(k.return=a);k!==null;){var B=k.dependencies;if(B!==null){A=k.child;for(var K=B.firstContext;K!==null;){if(K.context===g){if(k.tag===1){K=ws(-1,d&-d),K.tag=2;var ce=k.updateQueue;if(ce!==null){ce=ce.shared;var je=ce.pending;je===null?K.next=K:(K.next=je.next,je.next=K),ce.pending=K}}k.lanes|=d,K=k.alternate,K!==null&&(K.lanes|=d),qf(k.return,d,a),B.lanes|=d;break}K=K.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|=d,B=A.alternate,B!==null&&(B.lanes|=d),qf(A,d,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}$n(o,a,v.children,d),a=a.child}return a;case 9:return v=a.type,g=a.pendingProps.children,hi(a,d),v=wr(v),g=g(v),a.flags|=1,$n(o,a,g,d),a.child;case 14:return g=a.type,v=Mr(g,a.pendingProps),v=Mr(g.type,v),Hy(o,a,g,v,d);case 15:return Wy(o,a,a.type,a.pendingProps,d);case 17:return g=a.type,v=a.pendingProps,v=a.elementType===g?v:Mr(g,v),Hc(o,a),a.tag=1,Vn(g)?(o=!0,Cc(a)):o=!1,hi(a,d),Oy(a,g,v),cp(a,g,v,d),pp(null,a,g,!0,o,d);case 19:return Zy(o,a,d);case 22:return Ky(o,a,d)}throw Error(n(156,a.tag))};function kb(o,a){return sc(o,a)}function QC(o,a,d,g){this.tag=o,this.key=d,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 Sr(o,a,d,g){return new QC(o,a,d,g)}function Lp(o){return o=o.prototype,!(!o||!o.isReactComponent)}function ZC(o){if(typeof o=="function")return Lp(o)?1:0;if(o!=null){if(o=o.$$typeof,o===U)return 11;if(o===G)return 14}return 2}function Ks(o,a){var d=o.alternate;return d===null?(d=Sr(o.tag,a,o.key,o.mode),d.elementType=o.elementType,d.type=o.type,d.stateNode=o.stateNode,d.alternate=o,o.alternate=d):(d.pendingProps=a,d.type=o.type,d.flags=0,d.subtreeFlags=0,d.deletions=null),d.flags=o.flags&14680064,d.childLanes=o.childLanes,d.lanes=o.lanes,d.child=o.child,d.memoizedProps=o.memoizedProps,d.memoizedState=o.memoizedState,d.updateQueue=o.updateQueue,a=o.dependencies,d.dependencies=a===null?null:{lanes:a.lanes,firstContext:a.firstContext},d.sibling=o.sibling,d.index=o.index,d.ref=o.ref,d}function tu(o,a,d,g,v,k){var A=2;if(g=o,typeof o=="function")Lp(o)&&(A=1);else if(typeof o=="string")A=5;else e:switch(o){case $:return Ro(d.children,v,k,a);case D:A=8,v|=8;break;case X:return o=Sr(12,d,a,v|2),o.elementType=X,o.lanes=k,o;case J:return o=Sr(13,d,a,v),o.elementType=J,o.lanes=k,o;case _:return o=Sr(19,d,a,v),o.elementType=_,o.lanes=k,o;case le:return nu(d,v,k,a);default:if(typeof o=="object"&&o!==null)switch(o.$$typeof){case Z:A=10;break e;case z:A=9;break e;case U:A=11;break e;case G:A=14;break e;case Q:A=16,g=null;break e}throw Error(n(130,o==null?o:typeof o,""))}return a=Sr(A,d,a,v),a.elementType=o,a.type=g,a.lanes=k,a}function Ro(o,a,d,g){return o=Sr(7,o,g,a),o.lanes=d,o}function nu(o,a,d,g){return o=Sr(22,o,g,a),o.elementType=le,o.lanes=d,o.stateNode={isHidden:!1},o}function $p(o,a,d){return o=Sr(6,o,null,a),o.lanes=d,o}function Ip(o,a,d){return a=Sr(4,o.children!==null?o.children:[],o.key,a),a.lanes=d,a.stateNode={containerInfo:o.containerInfo,pendingChildren:null,implementation:o.implementation},a}function eE(o,a,d,g,v){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=Yr(0),this.expirationTimes=Yr(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Yr(0),this.identifierPrefix=g,this.onRecoverableError=v,this.mutableSourceEagerHydrationData=null}function Op(o,a,d,g,v,k,A,B,K){return o=new eE(o,a,d,B,K),a===1?(a=1,k===!0&&(a|=8)):a=0,k=Sr(3,null,null,a),o.current=k,k.stateNode=o,k.memoizedState={element:g,isDehydrated:d,cache:null,transitions:null,pendingSuspenseBoundaries:null},Yf(k),o}function tE(o,a,d){var g=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:P,key:g==null?null:""+g,children:o,containerInfo:a,implementation:d}}function Sb(o){if(!o)return Ms;o=o._reactInternals;e:{if(Lr(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(Vn(a.type)){a=a.stateNode.__reactInternalMemoizedMergedChildContext;break e}}a=a.return}while(a!==null);throw Error(n(171))}if(o.tag===1){var d=o.type;if(Vn(d))return Qx(o,d,a)}return a}function Nb(o,a,d,g,v,k,A,B,K){return o=Op(d,g,!0,o,v,k,A,B,K),o.context=Sb(null),d=o.current,g=In(),v=Hs(d),k=ws(g,v),k.callback=a??null,zs(d,k,v),o.current.lanes=v,M(o,v,g),Kn(o,g),o}function ru(o,a,d,g){var v=a.current,k=In(),A=Hs(v);return d=Sb(d),a.context===null?a.context=d:a.pendingContext=d,a=ws(k,A),a.payload={element:o},g=g===void 0?null:g,g!==null&&(a.callback=g),o=zs(v,a,A),o!==null&&(zr(o,v,A,k),$c(o,v,A)),A}function su(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 Cb(o,a){if(o=o.memoizedState,o!==null&&o.dehydrated!==null){var d=o.retryLane;o.retryLane=d!==0&&d<a?d:a}}function Mp(o,a){Cb(o,a),(o=o.alternate)&&Cb(o,a)}function nE(){return null}var Eb=typeof reportError=="function"?reportError:function(o){console.error(o)};function _p(o){this._internalRoot=o}ou.prototype.render=_p.prototype.render=function(o){var a=this._internalRoot;if(a===null)throw Error(n(409));ru(o,a,null,null)},ou.prototype.unmount=_p.prototype.unmount=function(){var o=this._internalRoot;if(o!==null){this._internalRoot=null;var a=o.containerInfo;Eo(function(){ru(null,o,null,null)}),a[gs]=null}};function ou(o){this._internalRoot=o}ou.prototype.unstable_scheduleHydration=function(o){if(o){var a=Ln();o={blockedOn:null,target:o,priority:a};for(var d=0;d<Ds.length&&a!==0&&a<Ds[d].priority;d++);Ds.splice(d,0,o),d===0&&px(o)}};function Fp(o){return!(!o||o.nodeType!==1&&o.nodeType!==9&&o.nodeType!==11)}function iu(o){return!(!o||o.nodeType!==1&&o.nodeType!==9&&o.nodeType!==11&&(o.nodeType!==8||o.nodeValue!==" react-mount-point-unstable "))}function Tb(){}function rE(o,a,d,g,v){if(v){if(typeof g=="function"){var k=g;g=function(){var ce=su(A);k.call(ce)}}var A=Nb(a,g,o,0,null,!1,!1,"",Tb);return o._reactRootContainer=A,o[gs]=A.current,Fa(o.nodeType===8?o.parentNode:o),Eo(),A}for(;v=o.lastChild;)o.removeChild(v);if(typeof g=="function"){var B=g;g=function(){var ce=su(K);B.call(ce)}}var K=Op(o,0,!1,null,null,!1,!1,"",Tb);return o._reactRootContainer=K,o[gs]=K.current,Fa(o.nodeType===8?o.parentNode:o),Eo(function(){ru(a,K,d,g)}),K}function au(o,a,d,g,v){var k=d._reactRootContainer;if(k){var A=k;if(typeof v=="function"){var B=v;v=function(){var K=su(A);B.call(K)}}ru(a,A,o,v)}else A=rE(d,a,o,v,g);return su(A)}lt=function(o){switch(o.tag){case 3:var a=o.stateNode;if(a.current.memoizedState.isDehydrated){var d=mn(a.pendingLanes);d!==0&&(ge(a,d|1),Kn(a,Ft()),(ut&6)===0&&(vi=Ft()+500,_s()))}break;case 13:Eo(function(){var g=vs(o,1);if(g!==null){var v=In();zr(g,o,1,v)}}),Mp(o,1)}},xt=function(o){if(o.tag===13){var a=vs(o,134217728);if(a!==null){var d=In();zr(a,o,134217728,d)}Mp(o,134217728)}},Bn=function(o){if(o.tag===13){var a=Hs(o),d=vs(o,a);if(d!==null){var g=In();zr(d,o,a,g)}Mp(o,a)}},Ln=function(){return be},rr=function(o,a){var d=be;try{return be=o,a()}finally{be=d}},vn=function(o,a,d){switch(a){case"input":if(ae(o,d),a=d.name,d.type==="radio"&&a!=null){for(d=o;d.parentNode;)d=d.parentNode;for(d=d.querySelectorAll("input[name="+JSON.stringify(""+a)+'][type="radio"]'),a=0;a<d.length;a++){var g=d[a];if(g!==o&&g.form===o.form){var v=Sc(g);if(!v)throw Error(n(90));He(g),ae(g,v)}}}break;case"textarea":yt(o,d);break;case"select":a=d.value,a!=null&&Ve(o,!!d.multiple,a,!1)}},se=Rp,Oe=Eo;var sE={usingClientEntryPoint:!1,Events:[Ua,ai,Sc,It,Zt,Rp]},nl={findFiberByHostInstance:bo,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},oE={bundleType:nl.bundleType,version:nl.version,rendererPackageName:nl.rendererPackageName,rendererConfig:nl.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:R.ReactCurrentDispatcher,findHostInstanceByFiber:function(o){return o=ho(o),o===null?null:o.stateNode},findFiberByHostInstance:nl.findFiberByHostInstance||nE,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 lu=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!lu.isDisabled&&lu.supportsFiber)try{Yo=lu.inject(oE),yr=lu}catch{}}return qn.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=sE,qn.createPortal=function(o,a){var d=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!Fp(a))throw Error(n(200));return tE(o,a,null,d)},qn.createRoot=function(o,a){if(!Fp(o))throw Error(n(299));var d=!1,g="",v=Eb;return a!=null&&(a.unstable_strictMode===!0&&(d=!0),a.identifierPrefix!==void 0&&(g=a.identifierPrefix),a.onRecoverableError!==void 0&&(v=a.onRecoverableError)),a=Op(o,1,!1,null,null,d,!1,g,v),o[gs]=a.current,Fa(o.nodeType===8?o.parentNode:o),new _p(a)},qn.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=ho(a),o=o===null?null:o.stateNode,o},qn.flushSync=function(o){return Eo(o)},qn.hydrate=function(o,a,d){if(!iu(a))throw Error(n(200));return au(null,o,a,!0,d)},qn.hydrateRoot=function(o,a,d){if(!Fp(o))throw Error(n(405));var g=d!=null&&d.hydratedSources||null,v=!1,k="",A=Eb;if(d!=null&&(d.unstable_strictMode===!0&&(v=!0),d.identifierPrefix!==void 0&&(k=d.identifierPrefix),d.onRecoverableError!==void 0&&(A=d.onRecoverableError)),a=Nb(a,null,o,1,d??null,v,!1,k,A),o[gs]=a.current,Fa(o),g)for(o=0;o<g.length;o++)d=g[o],v=d._getVersion,v=v(d._source),a.mutableSourceEagerHydrationData==null?a.mutableSourceEagerHydrationData=[d,v]:a.mutableSourceEagerHydrationData.push(d,v);return new ou(a)},qn.render=function(o,a,d){if(!iu(a))throw Error(n(200));return au(null,o,a,!1,d)},qn.unmountComponentAtNode=function(o){if(!iu(o))throw Error(n(40));return o._reactRootContainer?(Eo(function(){au(null,null,o,!1,function(){o._reactRootContainer=null,o[gs]=null})}),!0):!1},qn.unstable_batchedUpdates=Rp,qn.unstable_renderSubtreeIntoContainer=function(o,a,d,g){if(!iu(d))throw Error(n(200));if(o==null||o._reactInternals===void 0)throw Error(n(38));return au(o,a,d,!1,g)},qn.version="18.3.1-next-f1338f8080-20240426",qn}var Mb;function hj(){if(Mb)return Up.exports;Mb=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(),Up.exports=hE(),Up.exports}var _b;function gE(){if(_b)return cu;_b=1;var e=hj();return cu.createRoot=e.createRoot,cu.hydrateRoot=e.hydrateRoot,cu}var xE=gE();/**
|
|
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 Fb="popstate";function zb(e){return typeof e=="object"&&e!=null&&"pathname"in e&&"search"in e&&"hash"in e&&"state"in e&&"key"in e}function yE(e={}){function t(s,i){var m;let l=(m=i.state)==null?void 0:m.masked,{pathname:c,search:u,hash:p}=l||s.location;return Bm("",{pathname:c,search:u,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:Tl(i)}return vE(t,n,null,e)}function Ut(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function Br(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function bE(){return Math.random().toString(36).substring(2,10)}function Bb(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 Bm(e,t,n=null,s,i){return{pathname:typeof e=="string"?e:e.pathname,search:"",hash:"",...typeof t=="string"?na(t):t,state:n,key:t&&t.key||s||bE(),unstable_mask:i}}function Tl({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 na(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 vE(e,t,n,s={}){let{window:i=document.defaultView,v5Compat:l=!1}=s,c=i.history,u="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(){u="POP";let w=h(),S=w==null?null:w-m;m=w,p&&p({action:u,location:j.location,delta:S})}function y(w,S){u="PUSH";let E=zb(w)?w:Bm(j.location,w,S);m=h()+1;let N=Bb(E,m),R=j.createHref(E.unstable_mask||E);try{c.pushState(N,"",R)}catch(I){if(I instanceof DOMException&&I.name==="DataCloneError")throw I;i.location.assign(R)}l&&p&&p({action:u,location:j.location,delta:1})}function b(w,S){u="REPLACE";let E=zb(w)?w:Bm(j.location,w,S);m=h();let N=Bb(E,m),R=j.createHref(E.unstable_mask||E);c.replaceState(N,"",R),l&&p&&p({action:u,location:j.location,delta:0})}function C(w){return wE(w)}let j={get action(){return u},get location(){return e(i,c)},listen(w){if(p)throw new Error("A history only accepts one active listener");return i.addEventListener(Fb,x),p=w,()=>{i.removeEventListener(Fb,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:b,go(w){return c.go(w)}};return j}function wE(e,t=!1){let n="http://localhost";typeof window<"u"&&(n=window.location.origin!=="null"?window.location.origin:window.location.href),Ut(n,"No window.location.(origin|href) available to create URL");let s=typeof e=="string"?e:Tl(e);return s=s.replace(/ $/,"%20"),!t&&s.startsWith("//")&&(s=n+s),new URL(s,n)}function gj(e,t,n="/"){return jE(e,t,n,!1)}function jE(e,t,n,s){let i=typeof t=="string"?na(t):t,l=Cs(i.pathname||"/",n);if(l==null)return null;let c=xj(e);kE(c);let u=null;for(let p=0;u==null&&p<c.length;++p){let m=$E(l);u=DE(c[p],m,s)}return u}function xj(e,t=[],n=[],s="",i=!1){let l=(c,u,p=i,m)=>{let h={relativePath:m===void 0?c.path||"":m,caseSensitive:c.caseSensitive===!0,childrenIndex:u,route:c};if(h.relativePath.startsWith("/")){if(!h.relativePath.startsWith(s)&&p)return;Ut(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=os([s,h.relativePath]),y=n.concat(h);c.children&&c.children.length>0&&(Ut(c.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${x}".`),xj(c.children,t,y,x,p)),!(c.path==null&&!c.index)&&t.push({path:x,score:RE(x,c.index),routesMeta:y})};return e.forEach((c,u)=>{var p;if(c.path===""||!((p=c.path)!=null&&p.includes("?")))l(c,u);else for(let m of yj(c.path))l(c,u,!0,m)}),t}function yj(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=yj(s.join("/")),u=[];return u.push(...c.map(p=>p===""?l:[l,p].join("/"))),i&&u.push(...c),u.map(p=>e.startsWith("/")&&p===""?"/":p)}function kE(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:AE(t.routesMeta.map(s=>s.childrenIndex),n.routesMeta.map(s=>s.childrenIndex)))}var SE=/^:[\w-]+$/,NE=3,CE=2,EE=1,TE=10,PE=-2,Ub=e=>e==="*";function RE(e,t){let n=e.split("/"),s=n.length;return n.some(Ub)&&(s+=PE),t&&(s+=CE),n.filter(i=>!Ub(i)).reduce((i,l)=>i+(SE.test(l)?NE:l===""?EE:TE),s)}function AE(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 DE(e,t,n=!1){let{routesMeta:s}=e,i={},l="/",c=[];for(let u=0;u<s.length;++u){let p=s[u],m=u===s.length-1,h=l==="/"?t:t.slice(l.length)||"/",x=zu({path:p.relativePath,caseSensitive:p.caseSensitive,end:m},h),y=p.route;if(!x&&m&&n&&!s[s.length-1].route.index&&(x=zu({path:p.relativePath,caseSensitive:p.caseSensitive,end:!1},h)),!x)return null;Object.assign(i,x.params),c.push({params:i,pathname:os([l,x.pathname]),pathnameBase:_E(os([l,x.pathnameBase])),route:y}),x.pathnameBase!=="/"&&(l=os([l,x.pathnameBase]))}return c}function zu(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[n,s]=LE(e.path,e.caseSensitive,e.end),i=t.match(n);if(!i)return null;let l=i[0],c=l.replace(/(.)\/+$/,"$1"),u=i.slice(1);return{params:s.reduce((m,{paramName:h,isOptional:x},y)=>{if(h==="*"){let C=u[y]||"";c=l.slice(0,l.length-C.length).replace(/(.)\/+$/,"$1")}const b=u[y];return x&&!b?m[h]=void 0:m[h]=(b||"").replace(/%2F/g,"/"),m},{}),pathname:l,pathnameBase:c,pattern:e}}function LE(e,t=!1,n=!0){Br(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,u,p,m,h)=>{if(s.push({paramName:u,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 $E(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return Br(!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 Cs(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 IE=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i;function OE(e,t="/"){let{pathname:n,search:s="",hash:i=""}=typeof e=="string"?na(e):e,l;return n?(n=n.replace(/\/\/+/g,"/"),n.startsWith("/")?l=Vb(n.substring(1),"/"):l=Vb(n,t)):l=t,{pathname:l,search:FE(s),hash:zE(i)}}function Vb(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 Wp(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 ME(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function bj(e){let t=ME(e);return t.map((n,s)=>s===t.length-1?n.pathname:n.pathnameBase)}function Ph(e,t,n,s=!1){let i;typeof e=="string"?i=na(e):(i={...e},Ut(!i.pathname||!i.pathname.includes("?"),Wp("?","pathname","search",i)),Ut(!i.pathname||!i.pathname.includes("#"),Wp("#","pathname","hash",i)),Ut(!i.search||!i.search.includes("#"),Wp("#","search","hash",i)));let l=e===""||i.pathname==="",c=l?"/":i.pathname,u;if(c==null)u=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("/")}u=x>=0?t[x]:"/"}let p=OE(i,u),m=c&&c!=="/"&&c.endsWith("/"),h=(l||c===".")&&n.endsWith("/");return!p.pathname.endsWith("/")&&(m||h)&&(p.pathname+="/"),p}var os=e=>e.join("/").replace(/\/\/+/g,"/"),_E=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),FE=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,zE=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e,BE=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 UE(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}function VE(e){return e.map(t=>t.route.path).filter(Boolean).join("/").replace(/\/\/*/g,"/")||"/"}var vj=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function wj(e,t){let n=e;if(typeof n!="string"||!IE.test(n))return{absoluteURL:void 0,isExternal:!1,to:n};let s=n,i=!1;if(vj)try{let l=new URL(window.location.href),c=n.startsWith("//")?new URL(l.protocol+n):new URL(n),u=Cs(c.pathname,t);c.origin===l.origin&&u!=null?n=u+c.search+c.hash:i=!0}catch{Br(!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 jj=["POST","PUT","PATCH","DELETE"];new Set(jj);var HE=["GET",...jj];new Set(HE);var ra=f.createContext(null);ra.displayName="DataRouter";var pd=f.createContext(null);pd.displayName="DataRouterState";var WE=f.createContext(!1),kj=f.createContext({isTransitioning:!1});kj.displayName="ViewTransition";var KE=f.createContext(new Map);KE.displayName="Fetchers";var qE=f.createContext(null);qE.displayName="Await";var Ar=f.createContext(null);Ar.displayName="Navigation";var Vl=f.createContext(null);Vl.displayName="Location";var Wr=f.createContext({outlet:null,matches:[],isDataRoute:!1});Wr.displayName="Route";var Rh=f.createContext(null);Rh.displayName="RouteError";var Sj="REACT_ROUTER_ERROR",GE="REDIRECT",YE="ROUTE_ERROR_RESPONSE";function JE(e){if(e.startsWith(`${Sj}:${GE}:{`))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 XE(e){if(e.startsWith(`${Sj}:${YE}:{`))try{let t=JSON.parse(e.slice(40));if(typeof t=="object"&&t&&typeof t.status=="number"&&typeof t.statusText=="string")return new BE(t.status,t.statusText,t.data)}catch{}}function QE(e,{relative:t}={}){Ut(Hl(),"useHref() may be used only in the context of a <Router> component.");let{basename:n,navigator:s}=f.useContext(Ar),{hash:i,pathname:l,search:c}=Wl(e,{relative:t}),u=l;return n!=="/"&&(u=l==="/"?n:os([n,l])),s.createHref({pathname:u,search:c,hash:i})}function Hl(){return f.useContext(Vl)!=null}function On(){return Ut(Hl(),"useLocation() may be used only in the context of a <Router> component."),f.useContext(Vl).location}var Nj="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function Cj(e){f.useContext(Ar).static||f.useLayoutEffect(e)}function Ct(){let{isDataRoute:e}=f.useContext(Wr);return e?p2():ZE()}function ZE(){Ut(Hl(),"useNavigate() may be used only in the context of a <Router> component.");let e=f.useContext(ra),{basename:t,navigator:n}=f.useContext(Ar),{matches:s}=f.useContext(Wr),{pathname:i}=On(),l=JSON.stringify(bj(s)),c=f.useRef(!1);return Cj(()=>{c.current=!0}),f.useCallback((p,m={})=>{if(Br(c.current,Nj),!c.current)return;if(typeof p=="number"){n.go(p);return}let h=Ph(p,JSON.parse(l),i,m.relative==="path");e==null&&t!=="/"&&(h.pathname=h.pathname==="/"?t:os([t,h.pathname])),(m.replace?n.replace:n.push)(h,m.state,m)},[t,n,l,i,e])}var e2=f.createContext(null);function t2(e){let t=f.useContext(Wr).outlet;return f.useMemo(()=>t&&f.createElement(e2.Provider,{value:e},t),[t,e])}function Et(){let{matches:e}=f.useContext(Wr),t=e[e.length-1];return t?t.params:{}}function Wl(e,{relative:t}={}){let{matches:n}=f.useContext(Wr),{pathname:s}=On(),i=JSON.stringify(bj(n));return f.useMemo(()=>Ph(e,JSON.parse(i),s,t==="path"),[e,i,s,t])}function n2(e,t){return Ej(e,t)}function Ej(e,t,n){var w;Ut(Hl(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:s}=f.useContext(Ar),{matches:i}=f.useContext(Wr),l=i[i.length-1],c=l?l.params:{},u=l?l.pathname:"/",p=l?l.pathnameBase:"/",m=l&&l.route;{let S=m&&m.path||"";Pj(u,!m||S.endsWith("*")||S.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${u}" (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=On(),x;if(t){let S=typeof t=="string"?na(t):t;Ut(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||"/",b=y;if(p!=="/"){let S=p.replace(/^\//,"").split("/");b="/"+y.replace(/^\//,"").split("/").slice(S.length).join("/")}let C=gj(e,{pathname:b});Br(m||C!=null,`No routes matched location "${x.pathname}${x.search}${x.hash}" `),Br(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=a2(C&&C.map(S=>Object.assign({},S,{params:Object.assign({},c,S.params),pathname:os([p,s.encodeLocation?s.encodeLocation(S.pathname.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:S.pathname]),pathnameBase:S.pathnameBase==="/"?p:os([p,s.encodeLocation?s.encodeLocation(S.pathnameBase.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:S.pathnameBase])})),i,n);return t&&j?f.createElement(Vl.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",unstable_mask:void 0,...x},navigationType:"POP"}},j):j}function r2(){let e=f2(),t=UE(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 s2=f.createElement(r2,null),Tj=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=XE(e.digest);n&&(e=n)}let t=e!==void 0?f.createElement(Wr.Provider,{value:this.props.routeContext},f.createElement(Rh.Provider,{value:e,children:this.props.component})):this.props.children;return this.context?f.createElement(o2,{error:e},t):t}};Tj.contextType=WE;var Kp=new WeakMap;function o2({children:e,error:t}){let{basename:n}=f.useContext(Ar);if(typeof t=="object"&&t&&"digest"in t&&typeof t.digest=="string"){let s=JE(t.digest);if(s){let i=Kp.get(t);if(i)throw i;let l=wj(s.location,n);if(vj&&!Kp.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 Kp.set(t,c),c}return f.createElement("meta",{httpEquiv:"refresh",content:`0;url=${l.absoluteURL||l.to}`})}}return e}function i2({routeContext:e,match:t,children:n}){let s=f.useContext(ra);return s&&s.static&&s.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(s.staticContext._deepestRenderedBoundaryId=t.route.id),f.createElement(Wr.Provider,{value:e},n)}function a2(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);Ut(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,u=-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)&&(u=h),x.route.id){let{loaderData:y,errors:b}=s,C=x.route.loader&&!y.hasOwnProperty(x.route.id)&&(!b||b[x.route.id]===void 0);if(x.route.lazy||C){n.isStatic&&(c=!0),u>=0?i=i.slice(0,u+1):i=[i[0]];break}}}}let p=n==null?void 0:n.onError,m=s&&p?(h,x)=>{var y,b;p(h,{location:s.location,params:((b=(y=s.matches)==null?void 0:y[0])==null?void 0:b.params)??{},unstable_pattern:VE(s.matches),errorInfo:x})}:void 0;return i.reduceRight((h,x,y)=>{let b,C=!1,j=null,w=null;s&&(b=l&&x.route.id?l[x.route.id]:void 0,j=x.route.errorElement||s2,c&&(u<0&&y===0?(Pj("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),C=!0,w=null):u===y&&(C=!0,w=x.route.hydrateFallbackElement||null)));let S=t.concat(i.slice(0,y+1)),E=()=>{let N;return b?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(i2,{match:x,routeContext:{outlet:h,matches:S,isDataRoute:s!=null},children:N})};return s&&(x.route.ErrorBoundary||x.route.errorElement||y===0)?f.createElement(Tj,{location:s.location,revalidation:s.revalidation,component:j,error:b,children:E(),routeContext:{outlet:null,matches:S,isDataRoute:!0},onError:m}):E()},null)}function Ah(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function l2(e){let t=f.useContext(ra);return Ut(t,Ah(e)),t}function c2(e){let t=f.useContext(pd);return Ut(t,Ah(e)),t}function u2(e){let t=f.useContext(Wr);return Ut(t,Ah(e)),t}function Dh(e){let t=u2(e),n=t.matches[t.matches.length-1];return Ut(n.route.id,`${e} can only be used on routes that contain a unique "id"`),n.route.id}function d2(){return Dh("useRouteId")}function f2(){var s;let e=f.useContext(Rh),t=c2("useRouteError"),n=Dh("useRouteError");return e!==void 0?e:(s=t.errors)==null?void 0:s[n]}function p2(){let{router:e}=l2("useNavigate"),t=Dh("useNavigate"),n=f.useRef(!1);return Cj(()=>{n.current=!0}),f.useCallback(async(i,l={})=>{Br(n.current,Nj),n.current&&(typeof i=="number"?await e.navigate(i):await e.navigate(i,{fromRouteId:t,...l}))},[e,t])}var Hb={};function Pj(e,t,n){!t&&!Hb[e]&&(Hb[e]=!0,Br(!1,n))}f.memo(m2);function m2({routes:e,future:t,state:n,isStatic:s,onError:i}){return Ej(e,void 0,{state:n,isStatic:s,onError:i})}function h2(e){return t2(e.context)}function ze(e){Ut(!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 g2({basename:e="/",children:t=null,location:n,navigationType:s="POP",navigator:i,static:l=!1,unstable_useTransitions:c}){Ut(!Hl(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let u=e.replace(/^\/*/,"/"),p=f.useMemo(()=>({basename:u,navigator:i,static:l,unstable_useTransitions:c,future:{}}),[u,i,l,c]);typeof n=="string"&&(n=na(n));let{pathname:m="/",search:h="",hash:x="",state:y=null,key:b="default",unstable_mask:C}=n,j=f.useMemo(()=>{let w=Cs(m,u);return w==null?null:{location:{pathname:w,search:h,hash:x,state:y,key:b,unstable_mask:C},navigationType:s}},[u,m,h,x,y,b,s,C]);return Br(j!=null,`<Router basename="${u}"> 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(Ar.Provider,{value:p},f.createElement(Vl.Provider,{children:t,value:j}))}function x2({children:e,location:t}){return n2(Um(e),t)}function Um(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,Um(s.props.children,l));return}Ut(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>`),Ut(!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=Um(s.props.children,l)),n.push(c)}),n}var Eu="get",Tu="application/x-www-form-urlencoded";function md(e){return typeof HTMLElement<"u"&&e instanceof HTMLElement}function y2(e){return md(e)&&e.tagName.toLowerCase()==="button"}function b2(e){return md(e)&&e.tagName.toLowerCase()==="form"}function v2(e){return md(e)&&e.tagName.toLowerCase()==="input"}function w2(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function j2(e,t){return e.button===0&&(!t||t==="_self")&&!w2(e)}function Vm(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 k2(e,t){let n=Vm(e);return t&&t.forEach((s,i)=>{n.has(i)||t.getAll(i).forEach(l=>{n.append(i,l)})}),n}var uu=null;function S2(){if(uu===null)try{new FormData(document.createElement("form"),0),uu=!1}catch{uu=!0}return uu}var N2=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function qp(e){return e!=null&&!N2.has(e)?(Br(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${Tu}"`),null):e}function C2(e,t){let n,s,i,l,c;if(b2(e)){let u=e.getAttribute("action");s=u?Cs(u,t):null,n=e.getAttribute("method")||Eu,i=qp(e.getAttribute("enctype"))||Tu,l=new FormData(e)}else if(y2(e)||v2(e)&&(e.type==="submit"||e.type==="image")){let u=e.form;if(u==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let p=e.getAttribute("formaction")||u.getAttribute("action");if(s=p?Cs(p,t):null,n=e.getAttribute("formmethod")||u.getAttribute("method")||Eu,i=qp(e.getAttribute("formenctype"))||qp(u.getAttribute("enctype"))||Tu,l=new FormData(u,e),!S2()){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(md(e))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');n=Eu,s=null,i=Tu,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 Lh(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function E2(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&&Cs(i.pathname,t)==="/"?i.pathname=`${t.replace(/\/$/,"")}/_root.${s}`:i.pathname=`${i.pathname.replace(/\/$/,"")}.${s}`,i}async function T2(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 P2(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 R2(e,t,n){let s=await Promise.all(e.map(async i=>{let l=t.routes[i.route.id];if(l){let c=await T2(l,n);return c.links?c.links():[]}return[]}));return $2(s.flat(1).filter(P2).filter(i=>i.rel==="stylesheet"||i.rel==="preload").map(i=>i.rel==="stylesheet"?{...i,rel:"prefetch",as:"style"}:{...i,rel:"prefetch"}))}function Wb(e,t,n,s,i,l){let c=(p,m)=>n[m]?p.route.id!==n[m].route.id:!0,u=(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)||u(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)||u(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 A2(e,t,{includeHydrateFallback:n}={}){return D2(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 D2(e){return[...new Set(e)]}function L2(e){let t={},n=Object.keys(e).sort();for(let s of n)t[s]=e[s];return t}function $2(e,t){let n=new Set;return new Set(t),e.reduce((s,i)=>{let l=JSON.stringify(L2(i));return n.has(l)||(n.add(l),s.push({key:l,link:i})),s},[])}function Rj(){let e=f.useContext(ra);return Lh(e,"You must render this element inside a <DataRouterContext.Provider> element"),e}function I2(){let e=f.useContext(pd);return Lh(e,"You must render this element inside a <DataRouterStateContext.Provider> element"),e}var $h=f.createContext(void 0);$h.displayName="FrameworkContext";function Aj(){let e=f.useContext($h);return Lh(e,"You must render this element inside a <HydratedRouter> element"),e}function O2(e,t){let n=f.useContext($h),[s,i]=f.useState(!1),[l,c]=f.useState(!1),{onFocus:u,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 b=()=>{i(!0)},C=()=>{i(!1),c(!1)};return n?e!=="intent"?[l,y,{}]:[l,y,{onFocus:sl(u,b),onBlur:sl(p,C),onMouseEnter:sl(m,b),onMouseLeave:sl(h,C),onTouchStart:sl(x,b)}]:[!1,y,{}]}function sl(e,t){return n=>{e&&e(n),n.defaultPrevented||t(n)}}function M2({page:e,...t}){let{router:n}=Rj(),s=f.useMemo(()=>gj(n.routes,e,n.basename),[n.routes,e,n.basename]);return s?f.createElement(F2,{page:e,matches:s,...t}):null}function _2(e){let{manifest:t,routeModules:n}=Aj(),[s,i]=f.useState([]);return f.useEffect(()=>{let l=!1;return R2(e,t,n).then(c=>{l||i(c)}),()=>{l=!0}},[e,t,n]),s}function F2({page:e,matches:t,...n}){let s=On(),{future:i,manifest:l,routeModules:c}=Aj(),{basename:u}=Rj(),{loaderData:p,matches:m}=I2(),h=f.useMemo(()=>Wb(e,t,m,l,s,"data"),[e,t,m,l,s]),x=f.useMemo(()=>Wb(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 R;let N=l.routes[E.route.id];!N||!N.hasLoader||(!h.some(I=>I.route.id===E.route.id)&&E.route.id in p&&((R=c[E.route.id])!=null&&R.shouldRevalidate)||N.hasClientLoader?w=!0:j.add(E.route.id))}),j.size===0)return[];let S=E2(e,u,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]},[u,i.unstable_trailingSlashAwareDataRequests,p,s,l,h,t,e,c]),b=f.useMemo(()=>A2(x,l),[x,l]),C=_2(x);return f.createElement(f.Fragment,null,y.map(j=>f.createElement("link",{key:j,rel:"prefetch",as:"fetch",href:j,...n})),b.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 z2(...e){return t=>{e.forEach(n=>{typeof n=="function"?n(t):n!=null&&(n.current=t)})}}var B2=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{B2&&(window.__reactRouterVersion="7.13.1")}catch{}function U2({basename:e,children:t,unstable_useTransitions:n,window:s}){let i=f.useRef();i.current==null&&(i.current=yE({window:s,v5Compat:!0}));let l=i.current,[c,u]=f.useState({action:l.action,location:l.location}),p=f.useCallback(m=>{n===!1?u(m):f.startTransition(()=>u(m))},[n]);return f.useLayoutEffect(()=>l.listen(p),[l,p]),f.createElement(g2,{basename:e,children:t,location:c.location,navigationType:c.action,navigator:l,unstable_useTransitions:n})}var Dj=/^(?:[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:u,state:p,target:m,to:h,preventScrollReset:x,viewTransition:y,unstable_defaultShouldRevalidate:b,...C},j){let{basename:w,navigator:S,unstable_useTransitions:E}=f.useContext(Ar),N=typeof h=="string"&&Dj.test(h),R=wj(h,w);h=R.to;let I=QE(h,{relative:i}),P=On(),$=null;if(u){let G=Ph(u,[],P.unstable_mask?P.unstable_mask.pathname:"/",!0);w!=="/"&&(G.pathname=G.pathname==="/"?w:os([w,G.pathname])),$=S.createHref(G)}let[D,X,Z]=O2(s,C),z=K2(h,{replace:c,unstable_mask:u,state:p,target:m,preventScrollReset:x,relative:i,viewTransition:y,unstable_defaultShouldRevalidate:b,unstable_useTransitions:E});function U(G){t&&t(G),G.defaultPrevented||z(G)}let J=!(R.isExternal||l),_=f.createElement("a",{...C,...Z,href:(J?$:void 0)||R.absoluteURL||I,onClick:J?U:t,ref:z2(j,X),target:m,"data-discover":!N&&n==="render"?"true":void 0});return D&&!N?f.createElement(f.Fragment,null,_,f.createElement(M2,{page:I})):_});Ee.displayName="Link";var V2=f.forwardRef(function({"aria-current":t="page",caseSensitive:n=!1,className:s="",end:i=!1,style:l,to:c,viewTransition:u,children:p,...m},h){let x=Wl(c,{relative:m.relative}),y=On(),b=f.useContext(pd),{navigator:C,basename:j}=f.useContext(Ar),w=b!=null&&X2(x)&&u===!0,S=C.encodeLocation?C.encodeLocation(x).pathname:x.pathname,E=y.pathname,N=b&&b.navigation&&b.navigation.location?b.navigation.location.pathname:null;n||(E=E.toLowerCase(),N=N?N.toLowerCase():null,S=S.toLowerCase()),N&&j&&(N=Cs(N,j)||N);const R=S!=="/"&&S.endsWith("/")?S.length-1:S.length;let I=E===S||!i&&E.startsWith(S)&&E.charAt(R)==="/",P=N!=null&&(N===S||!i&&N.startsWith(S)&&N.charAt(S.length)==="/"),$={isActive:I,isPending:P,isTransitioning:w},D=I?t:void 0,X;typeof s=="function"?X=s($):X=[s,I?"active":null,P?"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:u},typeof p=="function"?p($):p)});V2.displayName="NavLink";var H2=f.forwardRef(({discover:e="render",fetcherKey:t,navigate:n,reloadDocument:s,replace:i,state:l,method:c=Eu,action:u,onSubmit:p,relative:m,preventScrollReset:h,viewTransition:x,unstable_defaultShouldRevalidate:y,...b},C)=>{let{unstable_useTransitions:j}=f.useContext(Ar),w=Y2(),S=J2(u,{relative:m}),E=c.toLowerCase()==="get"?"get":"post",N=typeof u=="string"&&Dj.test(u),R=I=>{if(p&&p(I),I.defaultPrevented)return;I.preventDefault();let P=I.nativeEvent.submitter,$=(P==null?void 0:P.getAttribute("formmethod"))||c,D=()=>w(P||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:R,...b,"data-discover":!N&&e==="render"?"true":void 0})});H2.displayName="Form";function W2(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function Lj(e){let t=f.useContext(ra);return Ut(t,W2(e)),t}function K2(e,{target:t,replace:n,unstable_mask:s,state:i,preventScrollReset:l,relative:c,viewTransition:u,unstable_defaultShouldRevalidate:p,unstable_useTransitions:m}={}){let h=Ct(),x=On(),y=Wl(e,{relative:c});return f.useCallback(b=>{if(j2(b,t)){b.preventDefault();let C=n!==void 0?n:Tl(x)===Tl(y),j=()=>h(e,{replace:C,unstable_mask:s,state:i,preventScrollReset:l,relative:c,viewTransition:u,unstable_defaultShouldRevalidate:p});m?f.startTransition(()=>j()):j()}},[x,h,y,n,s,i,t,e,l,c,u,p,m])}function ds(e){Br(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(Vm(e)),n=f.useRef(!1),s=On(),i=f.useMemo(()=>k2(s.search,n.current?null:t.current),[s.search]),l=Ct(),c=f.useCallback((u,p)=>{const m=Vm(typeof u=="function"?u(new URLSearchParams(i)):u);n.current=!0,l("?"+m,p)},[l,i]);return[i,c]}var q2=0,G2=()=>`__${String(++q2)}__`;function Y2(){let{router:e}=Lj("useSubmit"),{basename:t}=f.useContext(Ar),n=d2(),s=e.fetch,i=e.navigate;return f.useCallback(async(l,c={})=>{let{action:u,method:p,encType:m,formData:h,body:x}=C2(l,t);if(c.navigate===!1){let y=c.fetcherKey||G2();await s(y,n,c.action||u,{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||u,{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 J2(e,{relative:t}={}){let{basename:n}=f.useContext(Ar),s=f.useContext(Wr);Ut(s,"useFormAction must be used inside a RouteContext");let[i]=s.matches.slice(-1),l={...Wl(e||".",{relative:t})},c=On();if(e==null){l.search=c.search;let u=new URLSearchParams(l.search),p=u.getAll("index");if(p.some(h=>h==="")){u.delete("index"),p.filter(x=>x).forEach(x=>u.append("index",x));let h=u.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:os([n,l.pathname])),Tl(l)}function X2(e,{relative:t}={}){let n=f.useContext(kj);Ut(n!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:s}=Lj("useViewTransitionState"),i=Wl(e,{relative:t});if(!n.isTransitioning)return!1;let l=Cs(n.currentLocation.pathname,s)||n.currentLocation.pathname,c=Cs(n.nextLocation.pathname,s)||n.nextLocation.pathname;return zu(i.pathname,c)!=null||zu(i.pathname,l)!=null}var Ns=hj();const Q2=fd(Ns);/**
|
|
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 Z2=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),$j=(...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 eT={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 tT=f.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:s,className:i="",children:l,iconNode:c,...u},p)=>f.createElement("svg",{ref:p,...eT,width:t,height:t,stroke:e,strokeWidth:s?Number(n)*24/Number(t):n,className:$j("lucide",i),...u},[...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 De=(e,t)=>{const n=f.forwardRef(({className:s,...i},l)=>f.createElement(tT,{ref:l,iconNode:t,className:$j(`lucide-${Z2(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 hd=De("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 Ij=De("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 Kl=De("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 Oj=De("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 Bu=De("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 nT=De("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 Mj=De("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 gd=De("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 rT=De("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 lo=De("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 no=De("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 sT=De("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 _j=De("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 Hm=De("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 Ih=De("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 Wm=De("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 oT=De("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 iT=De("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 aT=De("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 lT=De("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 cT=De("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 xd=De("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 uT=De("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 Fj=De("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 Pl=De("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 dT=De("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 fT=De("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 sa=De("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 Kb=De("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 pT=De("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 mT=De("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 zj=De("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 Bj=De("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 hT=De("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 Oh=De("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 gT=De("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 yd=De("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 xT=De("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 Mh=De("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 Km=De("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 Uj=De("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 yT=De("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 bT=De("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 vT=De("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 wT=De("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 _h=De("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 jT=De("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 Fh=De("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 kT=De("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 Gp=De("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 Bo=De("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 ST=De("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 Kt=De("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 Vj=De("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 NT=De("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 CT=De("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 Xi=De("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 bd=De("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 ET=De("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 co=De("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 TT=De("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 PT=De("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 RT=De("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 AT=De("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 Pr=De("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 qb=De("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 zh=De("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 DT=De("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 Hj=De("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=De("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 Mn=De("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 Bh=De("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 LT=De("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 $T=De("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 Uh=De("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);function Wj(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=Wj(e[t]))&&(s&&(s+=" "),s+=n)}else for(n in e)e[n]&&(s&&(s+=" "),s+=n);return s}function IT(){for(var e,t,n=0,s="",i=arguments.length;n<i;n++)(e=arguments[n])&&(t=Wj(e))&&(s&&(s+=" "),s+=t);return s}const Vh="-",OT=e=>{const t=_T(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:s}=e;return{getClassGroupId:c=>{const u=c.split(Vh);return u[0]===""&&u.length!==1&&u.shift(),Kj(u,t)||MT(c)},getConflictingClassGroupIds:(c,u)=>{const p=n[c]||[];return u&&s[c]?[...p,...s[c]]:p}}},Kj=(e,t)=>{var c;if(e.length===0)return t.classGroupId;const n=e[0],s=t.nextPart.get(n),i=s?Kj(e.slice(1),s):void 0;if(i)return i;if(t.validators.length===0)return;const l=e.join(Vh);return(c=t.validators.find(({validator:u})=>u(l)))==null?void 0:c.classGroupId},Gb=/^\[(.+)\]$/,MT=e=>{if(Gb.test(e)){const t=Gb.exec(e)[1],n=t==null?void 0:t.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}},_T=e=>{const{theme:t,prefix:n}=e,s={nextPart:new Map,validators:[]};return zT(Object.entries(e.classGroups),n).forEach(([l,c])=>{qm(c,s,l,t)}),s},qm=(e,t,n,s)=>{e.forEach(i=>{if(typeof i=="string"){const l=i===""?t:Yb(t,i);l.classGroupId=n;return}if(typeof i=="function"){if(FT(i)){qm(i(s),t,n,s);return}t.validators.push({validator:i,classGroupId:n});return}Object.entries(i).forEach(([l,c])=>{qm(c,Yb(t,l),n,s)})})},Yb=(e,t)=>{let n=e;return t.split(Vh).forEach(s=>{n.nextPart.has(s)||n.nextPart.set(s,{nextPart:new Map,validators:[]}),n=n.nextPart.get(s)}),n},FT=e=>e.isThemeGetter,zT=(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,u])=>[t+c,u])):l);return[n,i]}):e,BT=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)}}},qj="!",UT=e=>{const{separator:t,experimentalParseClassName:n}=e,s=t.length===1,i=t[0],l=t.length,c=u=>{const p=[];let m=0,h=0,x;for(let w=0;w<u.length;w++){let S=u[w];if(m===0){if(S===i&&(s||u.slice(w,w+l)===t)){p.push(u.slice(h,w)),h=w+l;continue}if(S==="/"){x=w;continue}}S==="["?m++:S==="]"&&m--}const y=p.length===0?u:u.substring(h),b=y.startsWith(qj),C=b?y.substring(1):y,j=x&&x>h?x-h:void 0;return{modifiers:p,hasImportantModifier:b,baseClassName:C,maybePostfixModifierPosition:j}};return n?u=>n({className:u,parseClassName:c}):c},VT=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},HT=e=>({cache:BT(e.cacheSize),parseClassName:UT(e),...OT(e)}),WT=/\s+/,KT=(e,t)=>{const{parseClassName:n,getClassGroupId:s,getConflictingClassGroupIds:i}=t,l=[],c=e.trim().split(WT);let u="";for(let p=c.length-1;p>=0;p-=1){const m=c[p],{modifiers:h,hasImportantModifier:x,baseClassName:y,maybePostfixModifierPosition:b}=n(m);let C=!!b,j=s(C?y.substring(0,b):y);if(!j){if(!C){u=m+(u.length>0?" "+u:u);continue}if(j=s(y),!j){u=m+(u.length>0?" "+u:u);continue}C=!1}const w=VT(h).join(":"),S=x?w+qj:w,E=S+j;if(l.includes(E))continue;l.push(E);const N=i(j,C);for(let R=0;R<N.length;++R){const I=N[R];l.push(S+I)}u=m+(u.length>0?" "+u:u)}return u};function qT(){let e=0,t,n,s="";for(;e<arguments.length;)(t=arguments[e++])&&(n=Gj(t))&&(s&&(s+=" "),s+=n);return s}const Gj=e=>{if(typeof e=="string")return e;let t,n="";for(let s=0;s<e.length;s++)e[s]&&(t=Gj(e[s]))&&(n&&(n+=" "),n+=t);return n};function GT(e,...t){let n,s,i,l=c;function c(p){const m=t.reduce((h,x)=>x(h),e());return n=HT(m),s=n.cache.get,i=n.cache.set,l=u,u(p)}function u(p){const m=s(p);if(m)return m;const h=KT(p,n);return i(p,h),h}return function(){return l(qT.apply(null,arguments))}}const Dt=e=>{const t=n=>n[e]||[];return t.isThemeGetter=!0,t},Yj=/^\[(?:([a-z-]+):)?(.+)\]$/i,YT=/^\d+\/\d+$/,JT=new Set(["px","full","screen"]),XT=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,QT=/\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$/,ZT=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,eP=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,tP=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Ss=e=>Fi(e)||JT.has(e)||YT.test(e),Gs=e=>oa(e,"length",cP),Fi=e=>!!e&&!Number.isNaN(Number(e)),Yp=e=>oa(e,"number",Fi),ol=e=>!!e&&Number.isInteger(Number(e)),nP=e=>e.endsWith("%")&&Fi(e.slice(0,-1)),nt=e=>Yj.test(e),Ys=e=>XT.test(e),rP=new Set(["length","size","percentage"]),sP=e=>oa(e,rP,Jj),oP=e=>oa(e,"position",Jj),iP=new Set(["image","url"]),aP=e=>oa(e,iP,dP),lP=e=>oa(e,"",uP),il=()=>!0,oa=(e,t,n)=>{const s=Yj.exec(e);return s?s[1]?typeof t=="string"?s[1]===t:t.has(s[1]):n(s[2]):!1},cP=e=>QT.test(e)&&!ZT.test(e),Jj=()=>!1,uP=e=>eP.test(e),dP=e=>tP.test(e),fP=()=>{const e=Dt("colors"),t=Dt("spacing"),n=Dt("blur"),s=Dt("brightness"),i=Dt("borderColor"),l=Dt("borderRadius"),c=Dt("borderSpacing"),u=Dt("borderWidth"),p=Dt("contrast"),m=Dt("grayscale"),h=Dt("hueRotate"),x=Dt("invert"),y=Dt("gap"),b=Dt("gradientColorStops"),C=Dt("gradientColorStopPositions"),j=Dt("inset"),w=Dt("margin"),S=Dt("opacity"),E=Dt("padding"),N=Dt("saturate"),R=Dt("scale"),I=Dt("sepia"),P=Dt("skew"),$=Dt("space"),D=Dt("translate"),X=()=>["auto","contain","none"],Z=()=>["auto","hidden","clip","visible","scroll"],z=()=>["auto",nt,t],U=()=>[nt,t],J=()=>["",Ss,Gs],_=()=>["auto",Fi,nt],G=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],Q=()=>["solid","dashed","dotted","double","none"],le=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],W=()=>["start","end","center","between","around","evenly","stretch"],ne=()=>["","0",nt],T=()=>["auto","avoid","all","avoid-page","page","left","right","column"],O=()=>[Fi,nt];return{cacheSize:500,separator:":",theme:{colors:[il],spacing:[Ss,Gs],blur:["none","",Ys,nt],brightness:O(),borderColor:[e],borderRadius:["none","","full",Ys,nt],borderSpacing:U(),borderWidth:J(),contrast:O(),grayscale:ne(),hueRotate:O(),invert:ne(),gap:U(),gradientColorStops:[e],gradientColorStopPositions:[nP,Gs],inset:z(),margin:z(),opacity:O(),padding:U(),saturate:O(),scale:O(),sepia:ne(),skew:O(),space:U(),translate:U()},classGroups:{aspect:[{aspect:["auto","square","video",nt]}],container:["container"],columns:[{columns:[Ys]}],"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:[...G(),nt]}],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",ol,nt]}],basis:[{basis:z()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",nt]}],grow:[{grow:ne()}],shrink:[{shrink:ne()}],order:[{order:["first","last","none",ol,nt]}],"grid-cols":[{"grid-cols":[il]}],"col-start-end":[{col:["auto",{span:["full",ol,nt]},nt]}],"col-start":[{"col-start":_()}],"col-end":[{"col-end":_()}],"grid-rows":[{"grid-rows":[il]}],"row-start-end":[{row:["auto",{span:[ol,nt]},nt]}],"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",nt]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",nt]}],gap:[{gap:[y]}],"gap-x":[{"gap-x":[y]}],"gap-y":[{"gap-y":[y]}],"justify-content":[{justify:["normal",...W()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...W(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...W(),"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",nt,t]}],"min-w":[{"min-w":[nt,t,"min","max","fit"]}],"max-w":[{"max-w":[nt,t,"none","full","min","max","fit","prose",{screen:[Ys]},Ys]}],h:[{h:[nt,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[nt,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[nt,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[nt,t,"auto","min","max","fit"]}],"font-size":[{text:["base",Ys,Gs]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",Yp]}],"font-family":[{font:[il]}],"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",nt]}],"line-clamp":[{"line-clamp":["none",Fi,Yp]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",Ss,nt]}],"list-image":[{"list-image":["none",nt]}],"list-style-type":[{list:["none","disc","decimal",nt]}],"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:[...Q(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",Ss,Gs]}],"underline-offset":[{"underline-offset":["auto",Ss,nt]}],"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:U()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",nt]}],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",nt]}],"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:[...G(),oP]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",sP]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},aP]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[C]}],"gradient-via-pos":[{via:[C]}],"gradient-to-pos":[{to:[C]}],"gradient-from":[{from:[b]}],"gradient-via":[{via:[b]}],"gradient-to":[{to:[b]}],rounded:[{rounded:[l]}],"rounded-s":[{"rounded-s":[l]}],"rounded-e":[{"rounded-e":[l]}],"rounded-t":[{"rounded-t":[l]}],"rounded-r":[{"rounded-r":[l]}],"rounded-b":[{"rounded-b":[l]}],"rounded-l":[{"rounded-l":[l]}],"rounded-ss":[{"rounded-ss":[l]}],"rounded-se":[{"rounded-se":[l]}],"rounded-ee":[{"rounded-ee":[l]}],"rounded-es":[{"rounded-es":[l]}],"rounded-tl":[{"rounded-tl":[l]}],"rounded-tr":[{"rounded-tr":[l]}],"rounded-br":[{"rounded-br":[l]}],"rounded-bl":[{"rounded-bl":[l]}],"border-w":[{border:[u]}],"border-w-x":[{"border-x":[u]}],"border-w-y":[{"border-y":[u]}],"border-w-s":[{"border-s":[u]}],"border-w-e":[{"border-e":[u]}],"border-w-t":[{"border-t":[u]}],"border-w-r":[{"border-r":[u]}],"border-w-b":[{"border-b":[u]}],"border-w-l":[{"border-l":[u]}],"border-opacity":[{"border-opacity":[S]}],"border-style":[{border:[...Q(),"hidden"]}],"divide-x":[{"divide-x":[u]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[u]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[S]}],"divide-style":[{divide:Q()}],"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:["",...Q()]}],"outline-offset":[{"outline-offset":[Ss,nt]}],"outline-w":[{outline:[Ss,Gs]}],"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":[Ss,Gs]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",Ys,lP]}],"shadow-color":[{shadow:[il]}],opacity:[{opacity:[S]}],"mix-blend":[{"mix-blend":[...le(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":le()}],filter:[{filter:["","none"]}],blur:[{blur:[n]}],brightness:[{brightness:[s]}],contrast:[{contrast:[p]}],"drop-shadow":[{"drop-shadow":["","none",Ys,nt]}],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",nt]}],duration:[{duration:O()}],ease:[{ease:["linear","in","out","in-out",nt]}],delay:[{delay:O()}],animate:[{animate:["none","spin","ping","pulse","bounce",nt]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[R]}],"scale-x":[{"scale-x":[R]}],"scale-y":[{"scale-y":[R]}],rotate:[{rotate:[ol,nt]}],"translate-x":[{"translate-x":[D]}],"translate-y":[{"translate-y":[D]}],"skew-x":[{"skew-x":[P]}],"skew-y":[{"skew-y":[P]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",nt]}],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",nt]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":U()}],"scroll-mx":[{"scroll-mx":U()}],"scroll-my":[{"scroll-my":U()}],"scroll-ms":[{"scroll-ms":U()}],"scroll-me":[{"scroll-me":U()}],"scroll-mt":[{"scroll-mt":U()}],"scroll-mr":[{"scroll-mr":U()}],"scroll-mb":[{"scroll-mb":U()}],"scroll-ml":[{"scroll-ml":U()}],"scroll-p":[{"scroll-p":U()}],"scroll-px":[{"scroll-px":U()}],"scroll-py":[{"scroll-py":U()}],"scroll-ps":[{"scroll-ps":U()}],"scroll-pe":[{"scroll-pe":U()}],"scroll-pt":[{"scroll-pt":U()}],"scroll-pr":[{"scroll-pr":U()}],"scroll-pb":[{"scroll-pb":U()}],"scroll-pl":[{"scroll-pl":U()}],"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",nt]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[Ss,Gs,Yp]}],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"]}}},pP=GT(fP);function Re(...e){return pP(IT(e))}function gr(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 ls(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 Xj(e){if(!e)return"—";const t=new Date(e);return Number.isNaN(t.getTime())?e:t.toLocaleDateString(void 0,{month:"short",day:"numeric"})}function Qj(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 Zj(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 Uu(e){return e.toLocaleString("en-US")}function Vu(e){return`$${e.toFixed(4)}`}function mP(e){if(!e)return"—";const t=/^(\d{4})-(\d{2})-(\d{2})$/.exec(e);if(!t)return e;const[,n,s,i]=t,l=new Date(Number(n),Number(s)-1,Number(i));return Number.isNaN(l.getTime())?e:l.toLocaleDateString(void 0,{month:"short",day:"numeric",year:"numeric"})}function yn(e){return e.split(/[_\s-]+/).filter(Boolean).map(t=>t.charAt(0).toUpperCase()+t.slice(1)).join(" ")}function e0(e){return!e||e==="/"?"/":e.endsWith("/")?e.slice(0,-1):e}function hP(e){let t=e0(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 t0(e,t){return hP(e)===t}function n0(e){let n=e0(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:yn(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:yn(n[1]),path:`${c}/projects/${n[1]}`}),i=yn(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:yn(n[3]),path:`${c}/projects/${n[1]}/assignments/${n[3]}`}),i=yn(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 u=n[2]==="memories"?"Memories":"Resources",p=n[2]==="memories"?"/memories":"/resources";s.push({label:u,path:p}),s.push({label:yn(n[3]),path:`${c}/projects/${n[1]}/${n[2]}/${n[3]}`}),i=yn(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:yn(n[1]),path:`/playbooks/${n[1]}`}),i="Edit Playbook"):n[1]&&(s.push({label:yn(n[1]),path:`/playbooks/${n[1]}`}),i=yn(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 Jb({items:e,onNavigate:t}){const n=On();return r.jsx("nav",{className:"space-y-1",children:e.map(s=>{const i=s.icon,l=t0(n.pathname,s.to)&&!n.pathname.startsWith("/w/");return r.jsxs(Ee,{to:s.to,onClick:t,className:Re("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 r0=[{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)"}}],gP=r0.map(e=>e.slug),Hu="default";function s0(e){return typeof e=="string"&&gP.includes(e)}const o0={preset:Hu,custom:!1};let gl=null,ji=null;function Hh(e){if(!e||typeof e!="object")return o0;const t=e;return{preset:s0(t.preset)?t.preset:Hu,custom:t.custom===!0}}function xP(){return gl?Promise.resolve(gl):ji||(ji=fetch("/api/config/theme").then(e=>{if(!e.ok)throw new Error(`HTTP ${e.status}`);return e.json()}).then(e=>{const t=Hh(e);return gl=t,ji=null,t}).catch(()=>(ji=null,o0)),ji)}async function yP(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=Hh(await t.json());return gl=n,n}async function bP(){const e=await fetch("/api/config/theme",{method:"DELETE"});if(!e.ok)throw new Error(`HTTP ${e.status}`);const t=Hh(await e.json());return gl=t,t}const Gm="syntaur-theme",Pu="syntaur-preset",i0=f.createContext(null);function Ym(){try{const e=window.localStorage.getItem(Gm);return e==="light"||e==="dark"?e:null}catch{return null}}function a0(){try{const e=window.localStorage.getItem(Pu);return s0(e)?e:Hu}catch{return Hu}}function l0(){return typeof window>"u"||!window.matchMedia?"light":window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}function c0(e){document.documentElement.classList.toggle("dark",e==="dark")}function u0(e){document.documentElement.dataset.theme=e}function vP(){typeof document>"u"||(c0(Ym()??l0()),u0(a0()))}function wP({children:e}){const[t,n]=f.useState(()=>Ym()),[s,i]=f.useState(()=>Ym()??l0()),[l,c]=f.useState(()=>a0());f.useEffect(()=>{c0(s)},[s]),f.useEffect(()=>{u0(l)},[l]),f.useEffect(()=>{let h=!1;return xP().then(x=>{if(!h&&x.preset!==l){c(x.preset);try{window.localStorage.setItem(Pu,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 u(h){c(h);try{window.localStorage.setItem(Pu,h)}catch{}await yP(h)}async function p(){const h=await bP();c(h.preset);try{window.localStorage.setItem(Pu,h.preset)}catch{}}const m={resolvedTheme:s,explicitTheme:t,setTheme:h=>{window.localStorage.setItem(Gm,h),n(h),i(h)},toggleTheme:()=>{const h=s==="dark"?"light":"dark";window.localStorage.setItem(Gm,h),n(h),i(h)},preset:l,setPreset:u,resetPreset:p};return r.jsx(i0.Provider,{value:m,children:e})}function Wh(){const e=f.useContext(i0);if(!e)throw new Error("useTheme must be used within ThemeProvider");return e}const Ru=new Set;let Yn=null,zi=null;function jP(){return`${window.location.protocol==="https:"?"wss:":"ws:"}//${window.location.host}/ws`}function d0(){Yn&&(Yn.readyState===WebSocket.OPEN||Yn.readyState===WebSocket.CONNECTING)||(Yn=new WebSocket(jP()),Yn.onmessage=e=>{try{const t=JSON.parse(e.data);for(const n of Ru)n(t)}catch{}},Yn.onclose=()=>{Yn=null,zi&&clearTimeout(zi),zi=setTimeout(d0,2e3)},Yn.onerror=()=>{Yn==null||Yn.close()})}function ql(e){const t=f.useRef(e);t.current=e,f.useEffect(()=>{const n=s=>t.current(s);return Ru.add(n),d0(),()=>{Ru.delete(n),Ru.size===0&&Yn&&(zi&&clearTimeout(zi),zi=null,Yn.close(),Yn=null)}},[])}function qt(e,t,n=!0,s=!1){const[i,l]=f.useState(null),[c,u]=f.useState(!0),[p,m]=f.useState(null),[h,x]=f.useState(0),y=n?e:null,b=f.useCallback(()=>{x(j=>j+1)},[]),C=f.useRef(y);return s&&C.current!==y&&(C.current=y,l(null),m(null)),f.useEffect(()=>{if(!y){u(!1),l(null);return}let j=!1;return u(!0),m(null),fetch(y).then(async w=>{if(!w.ok){const S=await w.json().catch(()=>null);throw new Error((S==null?void 0:S.error)||`HTTP ${w.status}`)}return w.json()}).then(w=>{j||(l(w),u(!1))}).catch(w=>{j||(m(w.message),u(!1))}),()=>{j=!0}},[y,h]),ql(j=>{!t||!y||((j.type==="project-updated"||j.type==="assignment-updated")&&b(),j.type==="servers-updated"&&t==="servers"&&b(),j.type==="agent-sessions-updated"&&(t==="agent-sessions"||t==="overview")&&b(),j.type==="playbooks-updated"&&t==="playbooks"&&b(),j.type==="leases-updated"&&t==="inventories"&&b())}),{data:i,loading:c,error:p,refetch:b}}function Uo(e=!0){return qt("/api/projects","projects",e)}function vd(){return qt("/api/workspaces","projects")}function Xt(){const{workspace:e}=Et();return e?`/w/${e}`:""}function kP(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 qt(s,"overview")}function wd(e=!0){return qt("/api/assignments","assignments",e)}function f0(){return qt("/api/help")}function p0(e){const t=e?`/api/projects/${e}`:null;return qt(t,"project")}function SP(e,t){const n=e&&t?`/api/projects/${e}/assignments/${t}`:null;return qt(n,"assignment")}function NP(e){const t=e?`/api/assignments/${e}`:null;return qt(t,"assignment")}function m0(e){return qt(e)}function Kh(e=!0){return qt("/api/servers","servers",e)}function h0(){return qt("/api/leases","inventories")}function g0(){return qt("/api/agent-sessions","agent-sessions")}function CP(e,t){const n=e&&t?`/api/agent-sessions/${e}?assignment=${t}`:null;return qt(n,"agent-sessions")}function EP(e){const t=e?`/api/assignments/${e}/sessions`:null;return qt(t,"agent-sessions")}function TP(e,t){const n=e&&t?`/api/usage/projects/${encodeURIComponent(e)}/assignments/${encodeURIComponent(t)}`:null;return qt(n,void 0,!0,!0)}function PP(e){const t=e?`/api/usage/standalone/${encodeURIComponent(e)}`:null;return qt(t,void 0,!0,!0)}function x0(e=!0){return qt("/api/playbooks","playbooks",e)}function RP(e){const t=e?`/api/playbooks/${e}`:null;return qt(t,"playbooks")}function AP(){return qt("/api/memories","project")}function DP(e,t){const n=e&&t?`/api/projects/${e}/memories/${t}`:null;return qt(n,"project")}function LP(){return qt("/api/resources","project")}function $P(e,t){const n=e&&t?`/api/projects/${e}/resources/${t}`:null;return qt(n,"project")}const jd=["new-workspace","new-project","new-todo","new-assignment"];function IP(e){return typeof e=="string"&&jd.includes(e)}const OP=["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","[","]"],MP=["mod","ctrl","alt","shift"];function Xn(e){if(typeof e!="string")return"";const t=e.trim();if(!t)return"";if(/\s/.test(t)&&!t.includes("+"))return t.split(/\s+/).map(Xn).filter(u=>u.length>0).join(" ");const n=t.split("+").map(u=>u.trim()).filter(u=>u.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(u=>u.toLowerCase()),l=new Set,c=[];for(const u of MP)i.includes(u)&&!l.has(u)&&(c.push(u),l.add(u));for(const u of i)l.has(u)||(c.push(u),l.add(u));return[...c,s].join("+")}function _P(e){const t=Xn(e);return t?OP.includes(t):!1}const FP={"new-workspace":Xn("Mod+Shift+Alt+w"),"new-project":Xn("Mod+Shift+Alt+p"),"new-todo":Xn("Mod+Shift+Alt+t"),"new-assignment":Xn("Mod+Shift+Alt+a")};function zP(e){const t={...FP};for(const n of jd){const s=e[n];typeof s=="string"&&s.length>0&&(t[n]=s)}return t}function Io(){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 BP(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 du(e,t){const n=BP(t);if(e.key.toLowerCase()!==n.key)return!1;const i=Io()?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 y0(e){const t=[],n=Io()?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 Xn(c)}function is(e){return e.split("+").map(n=>{const s=n.toLowerCase();return s==="mod"?Io()?"⌘":"Ctrl":s==="shift"?Io()?"⇧":"Shift":s==="alt"?Io()?"⌥":"Alt":s==="ctrl"?Io()?"⌃":"Ctrl":s==="enter"?"↵":s==="escape"?"Esc":s==="arrowup"?"↑":s==="arrowdown"?"↓":n.length===1?n.toUpperCase():n}).join(Io()?"":"+")}function UP(e){const[t,n]=f.useState(null),[s,i]=f.useState(!0),[l,c]=f.useState(null),u=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(()=>{u()},[u]),ql(p=>{p.type==="todos-updated"&&!p.projectSlug&&u()}),{data:t,loading:s,error:l,refetch:u}}function b0(e=!0){const[t,n]=f.useState(null),[s,i]=f.useState(!0),[l,c]=f.useState(null),u=f.useCallback(async()=>{try{const p=await fetch("/api/todos");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)}},[]);return f.useEffect(()=>{if(!e){i(!1);return}u()},[u,e]),ql(p=>{e&&p.type==="todos-updated"&&!p.projectSlug&&u()}),{data:t,loading:s,error:l,refetch:u}}async function qh(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 v0(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 w0(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 j0(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 k0(e,t){await fetch(`/api/todos/${encodeURIComponent(e)}/${t}/reopen`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({})})}async function VP(e,t){await fetch(`/api/todos/${encodeURIComponent(e)}/reorder`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({ids:t})})}async function S0(e,t){await fetch(`/api/todos/${encodeURIComponent(e)}/${t}`,{method:"DELETE"})}async function Gh(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 HP(e,t){return await Gh(`/api/todos/${encodeURIComponent(e)}/promote`,t)}async function WP(e){return await Gh("/api/todos/promote-bulk",e)}async function KP(e,t,n){await Gh(`/api/todos/${encodeURIComponent(e)}/${t}/move`,{to:n})}const qP=new Set(["/projects","/assignments","/servers","/todos"]);function Au(e,t){return qP.has(e)?`${t}${e}`:e}const GP=[{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 YP(e){const t=[];for(const n of GP)t.push({type:"page",id:n.id,title:n.title,keywords:[...n.keywords],route:Au(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:`${Au("/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=Au("/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 dr(e){return e.toLowerCase().trim().replace(/[^a-z0-9\s-]/g,"").replace(/\s+/g,"-").replace(/-+/g,"-").replace(/^-|-$/g,"")}function Du(e){return/^[a-z0-9]+(-[a-z0-9]+)*$/.test(e)}async function JP(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 Jp(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 Xb(){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 Qb(){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 Xp(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 Ao(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],u=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}${u}`}const XP=/^[a-z0-9][a-z0-9-]*$/;function QP(e){const{playbooks:t,projectSlug:n,currentProjectTitle:s,currentProjectWorkspace:i,wsPrefix:l,refetchPlaybooks:c,navigate:u,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:XP,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 b=await fetch("/api/workspaces",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:y})});if(!b.ok){const C=await b.json().catch(()=>({}));throw new Error(C.error||`Failed to create workspace (HTTP ${b.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 Xb(),y=[{value:"_ungrouped",label:"Ungrouped",hint:"no workspace"}];for(const b of h)y.push({value:b,label:b,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(),b=(h.title??"").trim();if(!b)throw new Error("Title is required");const C=dr(b);if(!C)throw new Error("Title must contain at least one alphanumeric character");let j=await Xp("/api/templates/project");j=Ao(j,"slug",C),j=Ao(j,"title",b),y&&y!=="_ungrouped"&&(j=Ao(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([Xb(),Qb()]),y=[{value:"_ungrouped",label:"Global",hint:"no workspace"}];for(const b of h)y.push({value:b,label:b,hint:"workspace"});for(const b of x){const C=b.workspace??"_ungrouped";y.push({value:C,label:`${b.title}`,hint:`project · ${b.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 qh(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 Qb(),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",b=(h.title??"").trim();if(!b)throw new Error("Title is required");const C=dr(b);if(!C)throw new Error("Title must contain at least one alphanumeric character");if(y==="_standalone"){let R=await Xp("/api/templates/assignment?standalone=1");R=Ao(R,"slug",C),R=Ao(R,"title",b);const I=await fetch("/api/assignments",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({content:R})}),P=await I.json().catch(()=>({}));if(!I.ok)throw new Error(P.error||`Failed to create assignment (HTTP ${I.status})`);const $=((N=P==null?void 0:P.assignment)==null?void 0:N.id)??(P==null?void 0:P.id);$?x.navigate(`/assignments/${$}`):x.navigate("/assignments");return}let j=await Xp("/api/templates/assignment");j=Ao(j,"slug",C),j=Ao(j,"title",b);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:()=>u(`${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:()=>u(`${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:()=>u(`${l}/projects/${n}/create/assignment`)}),m.push({id:"create-playbook",title:"New Playbook",group:"Create",keywords:["new","create","playbook"],run:()=>u("/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 Jp("_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 Jp(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 Jp(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:()=>JP(h.slug,h.enabled,c)});return m.push({id:"toggle-theme",title:"Toggle theme",subtitle:"Light / dark",group:"Theme",keywords:["theme","toggle","light","dark","appearance"],run:()=>p()}),m}function Mt(e,t,{checkForDefaultPrevented:n=!0}={}){return function(i){if(e==null||e(i),n===!1||!i.defaultPrevented)return t==null?void 0:t(i)}}function Zb(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function kd(...e){return t=>{let n=!1;const s=e.map(i=>{const l=Zb(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():Zb(e[i],null)}}}}function Rn(...e){return f.useCallback(kd(...e),e)}function ZP(e,t){const n=f.createContext(t),s=l=>{const{children:c,...u}=l,p=f.useMemo(()=>u,Object.values(u));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 Vo(e,t=[]){let n=[];function s(l,c){const u=f.createContext(c),p=n.length;n=[...n,c];const m=x=>{var S;const{scope:y,children:b,...C}=x,j=((S=y==null?void 0:y[e])==null?void 0:S[p])||u,w=f.useMemo(()=>C,Object.values(C));return r.jsx(j.Provider,{value:w,children:b})};m.displayName=l+"Provider";function h(x,y){var j;const b=((j=y==null?void 0:y[e])==null?void 0:j[p])||u,C=f.useContext(b);if(C)return C;if(c!==void 0)return c;throw new Error(`\`${x}\` must be used within \`${l}\``)}return[m,h]}const i=()=>{const l=n.map(c=>f.createContext(c));return function(u){const p=(u==null?void 0:u[e])||l;return f.useMemo(()=>({[`__scope${e}`]:{...u,[e]:p}}),[u,p])}};return i.scopeName=e,[s,eR(i,...t)]}function eR(...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((u,{useScope:p,scopeName:m})=>{const x=p(l)[`__scope${m}`];return{...u,...x}},{});return f.useMemo(()=>({[`__scope${t.scopeName}`]:c}),[c])}};return n.scopeName=t.scopeName,n}var ro=globalThis!=null&&globalThis.document?f.useLayoutEffect:()=>{},tR=mj[" useId ".trim().toString()]||(()=>{}),nR=0;function Bi(e){const[t,n]=f.useState(tR());return ro(()=>{n(s=>s??String(nR++))},[e]),e||(t?`radix-${t}`:"")}var rR=mj[" useInsertionEffect ".trim().toString()]||ro;function Sd({prop:e,defaultProp:t,onChange:n=()=>{},caller:s}){const[i,l,c]=sR({defaultProp:t,onChange:n}),u=e!==void 0,p=u?e:i;{const h=f.useRef(e!==void 0);f.useEffect(()=>{const x=h.current;x!==u&&console.warn(`${s} is changing from ${x?"controlled":"uncontrolled"} to ${u?"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=u},[u,s])}const m=f.useCallback(h=>{var x;if(u){const y=oR(h)?h(e):h;y!==e&&((x=c.current)==null||x.call(c,y))}else l(h)},[u,e,l,c]);return[p,m]}function sR({defaultProp:e,onChange:t}){const[n,s]=f.useState(e),i=f.useRef(n),l=f.useRef(t);return rR(()=>{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 oR(e){return typeof e=="function"}function iR(e){const t=aR(e),n=f.forwardRef((s,i)=>{const{children:l,...c}=s,u=f.Children.toArray(l),p=u.find(cR);if(p){const m=p.props.children,h=u.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 aR(e){const t=f.forwardRef((n,s)=>{const{children:i,...l}=n;if(f.isValidElement(i)){const c=dR(i),u=uR(l,i.props);return i.type!==f.Fragment&&(u.ref=s?kd(s,c):c),f.cloneElement(i,u)}return f.Children.count(i)>1?f.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var lR=Symbol("radix.slottable");function cR(e){return f.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===lR}function uR(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]=(...u)=>{const p=l(...u);return i(...u),p}:i&&(n[s]=i):s==="style"?n[s]={...i,...l}:s==="className"&&(n[s]=[i,l].filter(Boolean).join(" "))}return{...e,...n}}function dR(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 fR=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],rn=fR.reduce((e,t)=>{const n=iR(`Primitive.${t}`),s=f.forwardRef((i,l)=>{const{asChild:c,...u}=i,p=c?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),r.jsx(p,{...u,ref:l})});return s.displayName=`Primitive.${t}`,{...e,[t]:s}},{});function pR(e,t){e&&Ns.flushSync(()=>e.dispatchEvent(t))}function _o(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 mR(e,t=globalThis==null?void 0:globalThis.document){const n=_o(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 hR="DismissableLayer",Jm="dismissableLayer.update",gR="dismissableLayer.pointerDownOutside",xR="dismissableLayer.focusOutside",ev,N0=f.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Yh=f.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:s,onPointerDownOutside:i,onFocusOutside:l,onInteractOutside:c,onDismiss:u,...p}=e,m=f.useContext(N0),[h,x]=f.useState(null),y=(h==null?void 0:h.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,b]=f.useState({}),C=Rn(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,R=E>=S,I=vR($=>{const D=$.target,X=[...m.branches].some(Z=>Z.contains(D));!R||X||(i==null||i($),c==null||c($),$.defaultPrevented||u==null||u())},y),P=wR($=>{const D=$.target;[...m.branches].some(Z=>Z.contains(D))||(l==null||l($),c==null||c($),$.defaultPrevented||u==null||u())},y);return mR($=>{E===m.layers.size-1&&(s==null||s($),!$.defaultPrevented&&u&&($.preventDefault(),u()))},y),f.useEffect(()=>{if(h)return n&&(m.layersWithOutsidePointerEventsDisabled.size===0&&(ev=y.body.style.pointerEvents,y.body.style.pointerEvents="none"),m.layersWithOutsidePointerEventsDisabled.add(h)),m.layers.add(h),tv(),()=>{n&&m.layersWithOutsidePointerEventsDisabled.size===1&&(y.body.style.pointerEvents=ev)}},[h,y,n,m]),f.useEffect(()=>()=>{h&&(m.layers.delete(h),m.layersWithOutsidePointerEventsDisabled.delete(h),tv())},[h,m]),f.useEffect(()=>{const $=()=>b({});return document.addEventListener(Jm,$),()=>document.removeEventListener(Jm,$)},[]),r.jsx(rn.div,{...p,ref:C,style:{pointerEvents:N?R?"auto":"none":void 0,...e.style},onFocusCapture:Mt(e.onFocusCapture,P.onFocusCapture),onBlurCapture:Mt(e.onBlurCapture,P.onBlurCapture),onPointerDownCapture:Mt(e.onPointerDownCapture,I.onPointerDownCapture)})});Yh.displayName=hR;var yR="DismissableLayerBranch",bR=f.forwardRef((e,t)=>{const n=f.useContext(N0),s=f.useRef(null),i=Rn(t,s);return f.useEffect(()=>{const l=s.current;if(l)return n.branches.add(l),()=>{n.branches.delete(l)}},[n.branches]),r.jsx(rn.div,{...e,ref:i})});bR.displayName=yR;function vR(e,t=globalThis==null?void 0:globalThis.document){const n=_o(e),s=f.useRef(!1),i=f.useRef(()=>{});return f.useEffect(()=>{const l=u=>{if(u.target&&!s.current){let p=function(){C0(gR,n,m,{discrete:!0})};const m={originalEvent:u};u.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 wR(e,t=globalThis==null?void 0:globalThis.document){const n=_o(e),s=f.useRef(!1);return f.useEffect(()=>{const i=l=>{l.target&&!s.current&&C0(xR,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 tv(){const e=new CustomEvent(Jm);document.dispatchEvent(e)}function C0(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?pR(i,l):i.dispatchEvent(l)}var Qp="focusScope.autoFocusOnMount",Zp="focusScope.autoFocusOnUnmount",nv={bubbles:!1,cancelable:!0},jR="FocusScope",E0=f.forwardRef((e,t)=>{const{loop:n=!1,trapped:s=!1,onMountAutoFocus:i,onUnmountAutoFocus:l,...c}=e,[u,p]=f.useState(null),m=_o(i),h=_o(l),x=f.useRef(null),y=Rn(t,j=>p(j)),b=f.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;f.useEffect(()=>{if(s){let j=function(N){if(b.paused||!u)return;const R=N.target;u.contains(R)?x.current=R:Zs(x.current,{select:!0})},w=function(N){if(b.paused||!u)return;const R=N.relatedTarget;R!==null&&(u.contains(R)||Zs(x.current,{select:!0}))},S=function(N){if(document.activeElement===document.body)for(const I of N)I.removedNodes.length>0&&Zs(u)};document.addEventListener("focusin",j),document.addEventListener("focusout",w);const E=new MutationObserver(S);return u&&E.observe(u,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",j),document.removeEventListener("focusout",w),E.disconnect()}}},[s,u,b.paused]),f.useEffect(()=>{if(u){sv.add(b);const j=document.activeElement;if(!u.contains(j)){const S=new CustomEvent(Qp,nv);u.addEventListener(Qp,m),u.dispatchEvent(S),S.defaultPrevented||(kR(TR(T0(u)),{select:!0}),document.activeElement===j&&Zs(u))}return()=>{u.removeEventListener(Qp,m),setTimeout(()=>{const S=new CustomEvent(Zp,nv);u.addEventListener(Zp,h),u.dispatchEvent(S),S.defaultPrevented||Zs(j??document.body,{select:!0}),u.removeEventListener(Zp,h),sv.remove(b)},0)}}},[u,m,h,b]);const C=f.useCallback(j=>{if(!n&&!s||b.paused)return;const w=j.key==="Tab"&&!j.altKey&&!j.ctrlKey&&!j.metaKey,S=document.activeElement;if(w&&S){const E=j.currentTarget,[N,R]=SR(E);N&&R?!j.shiftKey&&S===R?(j.preventDefault(),n&&Zs(N,{select:!0})):j.shiftKey&&S===N&&(j.preventDefault(),n&&Zs(R,{select:!0})):S===E&&j.preventDefault()}},[n,s,b.paused]);return r.jsx(rn.div,{tabIndex:-1,...c,ref:y,onKeyDown:C})});E0.displayName=jR;function kR(e,{select:t=!1}={}){const n=document.activeElement;for(const s of e)if(Zs(s,{select:t}),document.activeElement!==n)return}function SR(e){const t=T0(e),n=rv(t,e),s=rv(t.reverse(),e);return[n,s]}function T0(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 rv(e,t){for(const n of e)if(!NR(n,{upTo:t}))return n}function NR(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 CR(e){return e instanceof HTMLInputElement&&"select"in e}function Zs(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&CR(e)&&t&&e.select()}}var sv=ER();function ER(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=ov(e,t),e.unshift(t)},remove(t){var n;e=ov(e,t),(n=e[0])==null||n.resume()}}}function ov(e,t){const n=[...e],s=n.indexOf(t);return s!==-1&&n.splice(s,1),n}function TR(e){return e.filter(t=>t.tagName!=="A")}var PR="Portal",Jh=f.forwardRef((e,t)=>{var u;const{container:n,...s}=e,[i,l]=f.useState(!1);ro(()=>l(!0),[]);const c=n||i&&((u=globalThis==null?void 0:globalThis.document)==null?void 0:u.body);return c?Q2.createPortal(r.jsx(rn.div,{...s,ref:t}),c):null});Jh.displayName=PR;function RR(e,t){return f.useReducer((n,s)=>t[n][s]??n,e)}var Ho=e=>{const{present:t,children:n}=e,s=AR(t),i=typeof n=="function"?n({present:s.isPresent}):f.Children.only(n),l=Rn(s.ref,DR(i));return typeof n=="function"||s.isPresent?f.cloneElement(i,{ref:l}):null};Ho.displayName="Presence";function AR(e){const[t,n]=f.useState(),s=f.useRef(null),i=f.useRef(e),l=f.useRef("none"),c=e?"mounted":"unmounted",[u,p]=RR(c,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return f.useEffect(()=>{const m=fu(s.current);l.current=u==="mounted"?m:"none"},[u]),ro(()=>{const m=s.current,h=i.current;if(h!==e){const y=l.current,b=fu(m);e?p("MOUNT"):b==="none"||(m==null?void 0:m.display)==="none"?p("UNMOUNT"):p(h&&y!==b?"ANIMATION_OUT":"UNMOUNT"),i.current=e}},[e,p]),ro(()=>{if(t){let m;const h=t.ownerDocument.defaultView??window,x=b=>{const j=fu(s.current).includes(CSS.escape(b.animationName));if(b.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=b=>{b.target===t&&(l.current=fu(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(u),ref:f.useCallback(m=>{s.current=m?getComputedStyle(m):null,n(m)},[])}}function fu(e){return(e==null?void 0:e.animationName)||"none"}function DR(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 em=0;function LR(){f.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??iv()),document.body.insertAdjacentElement("beforeend",e[1]??iv()),em++,()=>{em===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),em--}},[])}function iv(){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 ns=function(){return ns=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},ns.apply(this,arguments)};function P0(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 $R(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 Lu="right-scroll-bar-position",$u="width-before-scroll-bar",IR="with-scroll-bars-hidden",OR="--removed-body-scroll-bar-size";function tm(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function MR(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 _R=typeof window<"u"?f.useLayoutEffect:f.useEffect,av=new WeakMap;function FR(e,t){var n=MR(null,function(s){return e.forEach(function(i){return tm(i,s)})});return _R(function(){var s=av.get(n);if(s){var i=new Set(s),l=new Set(e),c=n.current;i.forEach(function(u){l.has(u)||tm(u,null)}),l.forEach(function(u){i.has(u)||tm(u,c)})}av.set(n,e)},[e]),n}function zR(e){return e}function BR(e,t){t===void 0&&(t=zR);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(u){return u!==c})}},assignSyncMedium:function(l){for(s=!0;n.length;){var c=n;n=[],c.forEach(l)}n={push:function(u){return l(u)},filter:function(){return n}}},assignMedium:function(l){s=!0;var c=[];if(n.length){var u=n;n=[],u.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 UR(e){e===void 0&&(e={});var t=BR(null);return t.options=ns({async:!0,ssr:!1},e),t}var R0=function(e){var t=e.sideCar,n=P0(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,ns({},n))};R0.isSideCarExport=!0;function VR(e,t){return e.useMedium(t),R0}var A0=UR(),nm=function(){},Nd=f.forwardRef(function(e,t){var n=f.useRef(null),s=f.useState({onScrollCapture:nm,onWheelCapture:nm,onTouchMoveCapture:nm}),i=s[0],l=s[1],c=e.forwardProps,u=e.children,p=e.className,m=e.removeScrollBar,h=e.enabled,x=e.shards,y=e.sideCar,b=e.noRelative,C=e.noIsolation,j=e.inert,w=e.allowPinchZoom,S=e.as,E=S===void 0?"div":S,N=e.gapMode,R=P0(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),I=y,P=FR([n,t]),$=ns(ns({},R),i);return f.createElement(f.Fragment,null,h&&f.createElement(I,{sideCar:A0,removeScrollBar:m,shards:x,noRelative:b,noIsolation:C,inert:j,setCallbacks:l,allowPinchZoom:!!w,lockRef:n,gapMode:N}),c?f.cloneElement(f.Children.only(u),ns(ns({},$),{ref:P})):f.createElement(E,ns({},$,{className:p,ref:P}),u))});Nd.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};Nd.classNames={fullWidth:$u,zeroRight:Lu};var HR=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function WR(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=HR();return t&&e.setAttribute("nonce",t),e}function KR(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function qR(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var GR=function(){var e=0,t=null;return{add:function(n){e==0&&(t=WR())&&(KR(t,n),qR(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},YR=function(){var e=GR();return function(t,n){f.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},D0=function(){var e=YR(),t=function(n){var s=n.styles,i=n.dynamic;return e(s,i),null};return t},JR={left:0,top:0,right:0,gap:0},rm=function(e){return parseInt(e||"",10)||0},XR=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[rm(n),rm(s),rm(i)]},QR=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return JR;var t=XR(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])}},ZR=D0(),Ui="data-scroll-locked",e3=function(e,t,n,s){var i=e.left,l=e.top,c=e.right,u=e.gap;return n===void 0&&(n="margin"),`
|
|
451
|
+
.`.concat(IR,` {
|
|
452
|
+
overflow: hidden `).concat(s,`;
|
|
453
|
+
padding-right: `).concat(u,"px ").concat(s,`;
|
|
454
|
+
}
|
|
455
|
+
body[`).concat(Ui,`] {
|
|
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(u,"px ").concat(s,`;
|
|
465
|
+
`),n==="padding"&&"padding-right: ".concat(u,"px ").concat(s,";")].filter(Boolean).join(""),`
|
|
466
|
+
}
|
|
467
|
+
|
|
468
|
+
.`).concat(Lu,` {
|
|
469
|
+
right: `).concat(u,"px ").concat(s,`;
|
|
470
|
+
}
|
|
471
|
+
|
|
472
|
+
.`).concat($u,` {
|
|
473
|
+
margin-right: `).concat(u,"px ").concat(s,`;
|
|
474
|
+
}
|
|
475
|
+
|
|
476
|
+
.`).concat(Lu," .").concat(Lu,` {
|
|
477
|
+
right: 0 `).concat(s,`;
|
|
478
|
+
}
|
|
479
|
+
|
|
480
|
+
.`).concat($u," .").concat($u,` {
|
|
481
|
+
margin-right: 0 `).concat(s,`;
|
|
482
|
+
}
|
|
483
|
+
|
|
484
|
+
body[`).concat(Ui,`] {
|
|
485
|
+
`).concat(OR,": ").concat(u,`px;
|
|
486
|
+
}
|
|
487
|
+
`)},lv=function(){var e=parseInt(document.body.getAttribute(Ui)||"0",10);return isFinite(e)?e:0},t3=function(){f.useEffect(function(){return document.body.setAttribute(Ui,(lv()+1).toString()),function(){var e=lv()-1;e<=0?document.body.removeAttribute(Ui):document.body.setAttribute(Ui,e.toString())}},[])},n3=function(e){var t=e.noRelative,n=e.noImportant,s=e.gapMode,i=s===void 0?"margin":s;t3();var l=f.useMemo(function(){return QR(i)},[i]);return f.createElement(ZR,{styles:e3(l,!t,i,n?"":"!important")})},Xm=!1;if(typeof window<"u")try{var pu=Object.defineProperty({},"passive",{get:function(){return Xm=!0,!0}});window.addEventListener("test",pu,pu),window.removeEventListener("test",pu,pu)}catch{Xm=!1}var ki=Xm?{passive:!1}:!1,r3=function(e){return e.tagName==="TEXTAREA"},L0=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!r3(e)&&n[t]==="visible")},s3=function(e){return L0(e,"overflowY")},o3=function(e){return L0(e,"overflowX")},cv=function(e,t){var n=t.ownerDocument,s=t;do{typeof ShadowRoot<"u"&&s instanceof ShadowRoot&&(s=s.host);var i=$0(e,s);if(i){var l=I0(e,s),c=l[1],u=l[2];if(c>u)return!0}s=s.parentNode}while(s&&s!==n.body);return!1},i3=function(e){var t=e.scrollTop,n=e.scrollHeight,s=e.clientHeight;return[t,n,s]},a3=function(e){var t=e.scrollLeft,n=e.scrollWidth,s=e.clientWidth;return[t,n,s]},$0=function(e,t){return e==="v"?s3(t):o3(t)},I0=function(e,t){return e==="v"?i3(t):a3(t)},l3=function(e,t){return e==="h"&&t==="rtl"?-1:1},c3=function(e,t,n,s,i){var l=l3(e,window.getComputedStyle(t).direction),c=l*s,u=n.target,p=t.contains(u),m=!1,h=c>0,x=0,y=0;do{if(!u)break;var b=I0(e,u),C=b[0],j=b[1],w=b[2],S=j-w-l*C;(C||S)&&$0(e,u)&&(x+=S,y+=C);var E=u.parentNode;u=E&&E.nodeType===Node.DOCUMENT_FRAGMENT_NODE?E.host:E}while(!p&&u!==document.body||p&&(t.contains(u)||t===u));return(h&&Math.abs(x)<1||!h&&Math.abs(y)<1)&&(m=!0),m},mu=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},uv=function(e){return[e.deltaX,e.deltaY]},dv=function(e){return e&&"current"in e?e.current:e},u3=function(e,t){return e[0]===t[0]&&e[1]===t[1]},d3=function(e){return`
|
|
488
|
+
.block-interactivity-`.concat(e,` {pointer-events: none;}
|
|
489
|
+
.allow-interactivity-`).concat(e,` {pointer-events: all;}
|
|
490
|
+
`)},f3=0,Si=[];function p3(e){var t=f.useRef([]),n=f.useRef([0,0]),s=f.useRef(),i=f.useState(f3++)[0],l=f.useState(D0)[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=$R([e.lockRef.current],(e.shards||[]).map(dv),!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 u=f.useCallback(function(j,w){if("touches"in j&&j.touches.length===2||j.type==="wheel"&&j.ctrlKey)return!c.current.allowPinchZoom;var S=mu(j),E=n.current,N="deltaX"in j?j.deltaX:E[0]-S[0],R="deltaY"in j?j.deltaY:E[1]-S[1],I,P=j.target,$=Math.abs(N)>Math.abs(R)?"h":"v";if("touches"in j&&$==="h"&&P.type==="range")return!1;var D=window.getSelection(),X=D&&D.anchorNode,Z=X?X===P||X.contains(P):!1;if(Z)return!1;var z=cv($,P);if(!z)return!0;if(z?I=$:(I=$==="v"?"h":"v",z=cv($,P)),!z)return!1;if(!s.current&&"changedTouches"in j&&(N||R)&&(s.current=I),!I)return!0;var U=s.current||I;return c3(U,w,j,U==="h"?N:R)},[]),p=f.useCallback(function(j){var w=j;if(!(!Si.length||Si[Si.length-1]!==l)){var S="deltaY"in w?uv(w):mu(w),E=t.current.filter(function(I){return I.name===w.type&&(I.target===w.target||w.target===I.shadowParent)&&u3(I.delta,S)})[0];if(E&&E.should){w.cancelable&&w.preventDefault();return}if(!E){var N=(c.current.shards||[]).map(dv).filter(Boolean).filter(function(I){return I.contains(w.target)}),R=N.length>0?u(w,N[0]):!c.current.noIsolation;R&&w.cancelable&&w.preventDefault()}}},[]),m=f.useCallback(function(j,w,S,E){var N={name:j,delta:w,target:S,should:E,shadowParent:m3(S)};t.current.push(N),setTimeout(function(){t.current=t.current.filter(function(R){return R!==N})},1)},[]),h=f.useCallback(function(j){n.current=mu(j),s.current=void 0},[]),x=f.useCallback(function(j){m(j.type,uv(j),j.target,u(j,e.lockRef.current))},[]),y=f.useCallback(function(j){m(j.type,mu(j),j.target,u(j,e.lockRef.current))},[]);f.useEffect(function(){return Si.push(l),e.setCallbacks({onScrollCapture:x,onWheelCapture:x,onTouchMoveCapture:y}),document.addEventListener("wheel",p,ki),document.addEventListener("touchmove",p,ki),document.addEventListener("touchstart",h,ki),function(){Si=Si.filter(function(j){return j!==l}),document.removeEventListener("wheel",p,ki),document.removeEventListener("touchmove",p,ki),document.removeEventListener("touchstart",h,ki)}},[]);var b=e.removeScrollBar,C=e.inert;return f.createElement(f.Fragment,null,C?f.createElement(l,{styles:d3(i)}):null,b?f.createElement(n3,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function m3(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const h3=VR(A0,p3);var O0=f.forwardRef(function(e,t){return f.createElement(Nd,ns({},e,{ref:t,sideCar:h3}))});O0.classNames=Nd.classNames;var g3=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},Ni=new WeakMap,hu=new WeakMap,gu={},sm=0,M0=function(e){return e&&(e.host||M0(e.parentNode))},x3=function(e,t){return t.map(function(n){if(e.contains(n))return n;var s=M0(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})},y3=function(e,t,n,s){var i=x3(t,Array.isArray(e)?e:[e]);gu[n]||(gu[n]=new WeakMap);var l=gu[n],c=[],u=new Set,p=new Set(i),m=function(x){!x||u.has(x)||(u.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(u.has(y))h(y);else try{var b=y.getAttribute(s),C=b!==null&&b!=="false",j=(Ni.get(y)||0)+1,w=(l.get(y)||0)+1;Ni.set(y,j),l.set(y,w),c.push(y),j===1&&C&&hu.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),u.clear(),sm++,function(){c.forEach(function(x){var y=Ni.get(x)-1,b=l.get(x)-1;Ni.set(x,y),l.set(x,b),y||(hu.has(x)||x.removeAttribute(s),hu.delete(x)),b||x.removeAttribute(n)}),sm--,sm||(Ni=new WeakMap,Ni=new WeakMap,hu=new WeakMap,gu={})}},b3=function(e,t,n){n===void 0&&(n="data-aria-hidden");var s=Array.from(Array.isArray(e)?e:[e]),i=g3(e);return i?(s.push.apply(s,Array.from(i.querySelectorAll("[aria-live], script"))),y3(s,i,n,"aria-hidden")):function(){return null}};function v3(e){const t=w3(e),n=f.forwardRef((s,i)=>{const{children:l,...c}=s,u=f.Children.toArray(l),p=u.find(k3);if(p){const m=p.props.children,h=u.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 w3(e){const t=f.forwardRef((n,s)=>{const{children:i,...l}=n;if(f.isValidElement(i)){const c=N3(i),u=S3(l,i.props);return i.type!==f.Fragment&&(u.ref=s?kd(s,c):c),f.cloneElement(i,u)}return f.Children.count(i)>1?f.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var j3=Symbol("radix.slottable");function k3(e){return f.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===j3}function S3(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]=(...u)=>{const p=l(...u);return i(...u),p}:i&&(n[s]=i):s==="style"?n[s]={...i,...l}:s==="className"&&(n[s]=[i,l].filter(Boolean).join(" "))}return{...e,...n}}function N3(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 Cd="Dialog",[_0,F0]=Vo(Cd),[C3,Kr]=_0(Cd),z0=e=>{const{__scopeDialog:t,children:n,open:s,defaultOpen:i,onOpenChange:l,modal:c=!0}=e,u=f.useRef(null),p=f.useRef(null),[m,h]=Sd({prop:s,defaultProp:i??!1,onChange:l,caller:Cd});return r.jsx(C3,{scope:t,triggerRef:u,contentRef:p,contentId:Bi(),titleId:Bi(),descriptionId:Bi(),open:m,onOpenChange:h,onOpenToggle:f.useCallback(()=>h(x=>!x),[h]),modal:c,children:n})};z0.displayName=Cd;var B0="DialogTrigger",U0=f.forwardRef((e,t)=>{const{__scopeDialog:n,...s}=e,i=Kr(B0,n),l=Rn(t,i.triggerRef);return r.jsx(rn.button,{type:"button","aria-haspopup":"dialog","aria-expanded":i.open,"aria-controls":i.contentId,"data-state":Zh(i.open),...s,ref:l,onClick:Mt(e.onClick,i.onOpenToggle)})});U0.displayName=B0;var Xh="DialogPortal",[E3,V0]=_0(Xh,{forceMount:void 0}),H0=e=>{const{__scopeDialog:t,forceMount:n,children:s,container:i}=e,l=Kr(Xh,t);return r.jsx(E3,{scope:t,forceMount:n,children:f.Children.map(s,c=>r.jsx(Ho,{present:n||l.open,children:r.jsx(Jh,{asChild:!0,container:i,children:c})}))})};H0.displayName=Xh;var Wu="DialogOverlay",W0=f.forwardRef((e,t)=>{const n=V0(Wu,e.__scopeDialog),{forceMount:s=n.forceMount,...i}=e,l=Kr(Wu,e.__scopeDialog);return l.modal?r.jsx(Ho,{present:s||l.open,children:r.jsx(P3,{...i,ref:t})}):null});W0.displayName=Wu;var T3=v3("DialogOverlay.RemoveScroll"),P3=f.forwardRef((e,t)=>{const{__scopeDialog:n,...s}=e,i=Kr(Wu,n);return r.jsx(O0,{as:T3,allowPinchZoom:!0,shards:[i.contentRef],children:r.jsx(rn.div,{"data-state":Zh(i.open),...s,ref:t,style:{pointerEvents:"auto",...s.style}})})}),Fo="DialogContent",K0=f.forwardRef((e,t)=>{const n=V0(Fo,e.__scopeDialog),{forceMount:s=n.forceMount,...i}=e,l=Kr(Fo,e.__scopeDialog);return r.jsx(Ho,{present:s||l.open,children:l.modal?r.jsx(R3,{...i,ref:t}):r.jsx(A3,{...i,ref:t})})});K0.displayName=Fo;var R3=f.forwardRef((e,t)=>{const n=Kr(Fo,e.__scopeDialog),s=f.useRef(null),i=Rn(t,n.contentRef,s);return f.useEffect(()=>{const l=s.current;if(l)return b3(l)},[]),r.jsx(q0,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Mt(e.onCloseAutoFocus,l=>{var c;l.preventDefault(),(c=n.triggerRef.current)==null||c.focus()}),onPointerDownOutside:Mt(e.onPointerDownOutside,l=>{const c=l.detail.originalEvent,u=c.button===0&&c.ctrlKey===!0;(c.button===2||u)&&l.preventDefault()}),onFocusOutside:Mt(e.onFocusOutside,l=>l.preventDefault())})}),A3=f.forwardRef((e,t)=>{const n=Kr(Fo,e.__scopeDialog),s=f.useRef(!1),i=f.useRef(!1);return r.jsx(q0,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:l=>{var c,u;(c=e.onCloseAutoFocus)==null||c.call(e,l),l.defaultPrevented||(s.current||(u=n.triggerRef.current)==null||u.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()}})}),q0=f.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:s,onOpenAutoFocus:i,onCloseAutoFocus:l,...c}=e,u=Kr(Fo,n),p=f.useRef(null),m=Rn(t,p);return LR(),r.jsxs(r.Fragment,{children:[r.jsx(E0,{asChild:!0,loop:!0,trapped:s,onMountAutoFocus:i,onUnmountAutoFocus:l,children:r.jsx(Yh,{role:"dialog",id:u.contentId,"aria-describedby":u.descriptionId,"aria-labelledby":u.titleId,"data-state":Zh(u.open),...c,ref:m,onDismiss:()=>u.onOpenChange(!1)})}),r.jsxs(r.Fragment,{children:[r.jsx(L3,{titleId:u.titleId}),r.jsx(I3,{contentRef:p,descriptionId:u.descriptionId})]})]})}),Qh="DialogTitle",G0=f.forwardRef((e,t)=>{const{__scopeDialog:n,...s}=e,i=Kr(Qh,n);return r.jsx(rn.h2,{id:i.titleId,...s,ref:t})});G0.displayName=Qh;var Y0="DialogDescription",J0=f.forwardRef((e,t)=>{const{__scopeDialog:n,...s}=e,i=Kr(Y0,n);return r.jsx(rn.p,{id:i.descriptionId,...s,ref:t})});J0.displayName=Y0;var X0="DialogClose",Q0=f.forwardRef((e,t)=>{const{__scopeDialog:n,...s}=e,i=Kr(X0,n);return r.jsx(rn.button,{type:"button",...s,ref:t,onClick:Mt(e.onClick,()=>i.onOpenChange(!1))})});Q0.displayName=X0;function Zh(e){return e?"open":"closed"}var Z0="DialogTitleWarning",[D3,ek]=ZP(Z0,{contentName:Fo,titleName:Qh,docsSlug:"dialog"}),L3=({titleId:e})=>{const t=ek(Z0),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},$3="DialogDescriptionWarning",I3=({contentRef:e,descriptionId:t})=>{const s=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${ek($3).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},tk=z0,nk=U0,rk=H0,eg=W0,tg=K0,ng=G0,rg=J0,sg=Q0;const Zn=tk,O3=nk,M3=rk,_3=sg,sk=f.forwardRef(({className:e,...t},n)=>r.jsx(eg,{ref:n,className:Re("fixed inset-0 z-50 bg-background/80 backdrop-blur-sm",e),...t}));sk.displayName=eg.displayName;const _n=f.forwardRef(({className:e,children:t,...n},s)=>r.jsxs(M3,{children:[r.jsx(sk,{}),r.jsx(tg,{ref:s,className:Re("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})]}));_n.displayName=tg.displayName;function qr({className:e,...t}){return r.jsx("div",{className:Re("flex flex-col space-y-2 text-left",e),...t})}function Ps({className:e,...t}){return r.jsx("div",{className:Re("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",e),...t})}const Fn=f.forwardRef(({className:e,...t},n)=>r.jsx(ng,{ref:n,className:Re("text-lg font-semibold tracking-tight text-foreground",e),...t}));Fn.displayName=ng.displayName;const fs=f.forwardRef(({className:e,...t},n)=>r.jsx(rg,{ref:n,className:Re("text-sm leading-6 text-muted-foreground",e),...t}));fs.displayName=rg.displayName;const F3=-1,z3=-40;function om(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 u=e[c];let p=!1;for(;s<t.length;)if(t[s]===u){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(z3,l*F3)),i=s,l=0,s++,p=!0;break}else l++,s++;if(!p)return-1/0}return n}const fv={page:0,project:1,assignment:2,playbook:3,server:4,todo:5};function og(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 u=om(s,c.title.toLowerCase())*1,p=c.subtitle?om(s,c.subtitle.toLowerCase())*.5:-1/0,m=(x=c.keywords)!=null&&x.length?om(s,c.keywords.join(" ").toLowerCase())*.3:-1/0,h=Math.max(u,p,m);return{...c,score:h}}).filter(c=>c.score>-1/0);return l.sort((c,u)=>u.score!==c.score?u.score-c.score:c.title.length!==u.title.length?c.title.length-u.title.length:c.title!==u.title?c.title<u.title?-1:1:(fv[c.type]??99)-(fv[u.type]??99)),l.slice(0,n)}const B3={page:"Page",project:"Project",assignment:"Assignment",playbook:"Playbook",server:"Server",todo:"Todo"};function U3({entries:e}){const{paletteOpen:t,closePalette:n}=uo(),s=Ct(),[i,l]=f.useState(""),[c,u]=f.useState(0),p=f.useRef(null),m=f.useMemo(()=>og(i,e,50),[i,e]);f.useEffect(()=>{u(0)},[i,t]),f.useEffect(()=>{t||l("")},[t]),f.useEffect(()=>{var b;const y=(b=p.current)==null?void 0:b.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(),u(b=>Math.min(m.length-1,b+1));else if(y.key==="ArrowUp")y.preventDefault(),u(b=>Math.max(0,b-1));else if(y.key==="Enter"){y.preventDefault();const b=m[c];b&&h(b)}}return r.jsx(Zn,{open:t,onOpenChange:y=>y?null:n(),children:r.jsxs(_n,{className:"max-w-xl p-0 gap-0",children:[r.jsx(Fn,{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,b)=>{const C=b===c;return r.jsxs("button",{type:"button","data-palette-idx":b,onClick:()=>h(y),onMouseEnter:()=>u(b),className:`flex w-full items-center gap-3 rounded-md px-3 py-2 text-left text-sm transition-colors ${C?"bg-accent text-accent-foreground":"hover:bg-accent/50 text-foreground"}`,children:[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:B3[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 V3({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(sT,{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 H3({step:e,initialValue:t,disabled:n,onSubmit:s}){const[i,l]=f.useState(t??""),[c,u]=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 b(C){if(C.key==="Enter"){if(C.preventDefault(),!y){u(!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),u(!1)},onKeyDown:b,placeholder:e.placeholder,disabled:n,className:"w-full border-0 border-b border-border/70 bg-transparent px-4 py-3 text-sm text-foreground outline-none focus:ring-0 disabled:opacity-60"}),c&&e.pattern&&x?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 W3({step:e,disabled:t,onSubmit:n}){const[s,i]=f.useState({phase:"loading"}),[l,c]=f.useState(""),[u,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 b=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 og(l,j,100)},[s,l]);f.useEffect(()=>{p(0)},[b.length]),f.useEffect(()=>{var w;const j=(w=y.current)==null?void 0:w.querySelector(`[data-picker-idx="${u}"]`);j==null||j.scrollIntoView({block:"nearest"})},[u]);function C(j){if(s.phase==="loaded"){if(j.key==="ArrowDown")j.preventDefault(),p(w=>Math.min(b.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=b[u];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"})]}):b.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"}):b.map((j,w)=>{const S=w===u;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 K3({entries:e}){var ee,de;const t=Ct(),{actionsPaletteOpen:n,closeActionsPalette:s,customBindings:i,bindAction:l,findConflict:c,pendingActionKind:u,consumePendingActionKind:p}=uo(),[m,h]=f.useState(""),[x,y]=f.useState(0),[b,C]=f.useState(null),[j,w]=f.useState(""),[S,E]=f.useState(null),[N,R]=f.useState(null),[I,P]=f.useState(!1),[$,D]=f.useState(null),X=f.useRef(null),Z=f.useMemo(()=>e.map(F=>({type:F.group.toLowerCase(),title:F.title,subtitle:F.subtitle,keywords:F.keywords,action:F})),[e]),z=f.useMemo(()=>og(m,Z,50),[m,Z]);f.useEffect(()=>{y(0)},[m,n]),f.useEffect(()=>{n||(h(""),C(null),w(""),E(null),R(null),P(!1),D(null))},[n]),f.useEffect(()=>{if(!n||!u)return;const F=p();if(!F)return;const re=e.find(me=>me.bindableKind===F);re&&U(re)},[n,u]),f.useEffect(()=>{var re;const F=(re=X.current)==null?void 0:re.querySelector(`[data-palette-idx="${x}"]`);F==null||F.scrollIntoView({block:"nearest"})},[x]);async function U(F){if(!I){if(F.flow&&F.flow.steps.length>0){E({action:F,stepIndex:0,values:{}}),D(null);return}if(F.requiresInput){C(F),w(""),D(null);return}if(F.run){P(!0),D(null);try{await F.run(),s()}catch(re){D(re instanceof Error?re.message:"Action failed")}finally{P(!1)}}}}async function J(F){if(!S)return;const re=S.action.flow.steps[S.stepIndex],me={...S.values,[re.id]:F};if(S.stepIndex+1<S.action.flow.steps.length){E({action:S.action,stepIndex:S.stepIndex+1,values:me});return}P(!0),D(null);try{await S.action.flow.submit(me,{navigate:t}),s()}catch(ve){D(ve instanceof Error?ve.message:"Action failed")}finally{P(!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 G(){if(I||!(b!=null&&b.requiresInput))return;const F=j.trim();if(F){P(!0),D(null);try{await b.requiresInput.runWithInput(F),s()}catch(re){D(re instanceof Error?re.message:"Action failed")}finally{P(!1)}}}function Q(F){if(F.key==="ArrowDown")F.preventDefault(),y(re=>Math.min(z.length-1,re+1));else if(F.key==="ArrowUp")F.preventDefault(),y(re=>Math.max(0,re-1));else if(F.key==="Enter"&&(F.metaKey||F.ctrlKey)){F.preventDefault();const re=z[x];re!=null&&re.action.bindableKind&&R({action:re.action,combo:null,conflict:null,saving:!1,error:null})}else if(F.key==="Enter"){F.preventDefault();const re=z[x];re&&U(re.action)}}function le(F){F.key==="Enter"?(F.preventDefault(),G()):F.key==="Escape"&&(F.preventDefault(),C(null),w(""))}function W(F){if(!N||F.key==="Escape"||F.key==="Enter"&&!N.combo)return;F.preventDefault(),F.stopPropagation();const re=y0(F.nativeEvent);if(!re)return;const me=c(re,N.action.bindableKind);R({...N,combo:re,conflict:me,error:null})}async function ne(){var F;if(!(!N||!N.combo||!N.action.bindableKind)){if((F=N.conflict)!=null&&F.description){R({...N,error:`Reserved: ${N.conflict.description}`});return}R({...N,saving:!0,error:null});try{await l(N.action.bindableKind,N.combo),R(null)}catch(re){R({...N,saving:!1,error:re instanceof Error?re.message:"Failed to save binding"})}}}const T=b!==null,O=S!==null,q=N!==null,L=S?S.action.flow.steps[S.stepIndex]:null;return r.jsx(Zn,{open:n,onOpenChange:F=>F?null:s(),children:r.jsxs(_n,{className:"max-w-xl p-0 gap-0",onEscapeKeyDown:F=>{if(!I){if(q){F.preventDefault(),R(null);return}if(O){F.preventDefault(),_();return}T&&(F.preventDefault(),C(null),w(""),D(null))}},children:[r.jsx(Fn,{className:"sr-only",children:"Actions palette"}),q&&N?r.jsxs("div",{onKeyDown:W,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(Km,{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:is(N.combo)}),(ee=N.conflict)!=null&&ee.description?r.jsxs("div",{className:"text-sm text-destructive",children:["Reserved: ",N.conflict.description," (cannot bind)"]}):(de=N.conflict)!=null&&de.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 ne(),"data-bind-confirm":!0}),r.jsx("input",{type:"hidden",onKeyDown:F=>{F.key==="Enter"&&ne()}})]}):O&&L&&S?r.jsxs(r.Fragment,{children:[r.jsx(V3,{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(H3,{step:L,initialValue:S.values[L.id],disabled:I,onSubmit:J}):r.jsx(W3,{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:b.group}),r.jsx("span",{className:"min-w-0 flex-1 truncate text-sm text-foreground",children:b.title})]}),r.jsx("input",{autoFocus:!0,type:"text",value:j,onChange:F=>w(F.target.value),onKeyDown:le,placeholder:b.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:F=>h(F.target.value),onKeyDown:Q,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:z.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"}):z.map((F,re)=>{const me=re===x,ve=F.action.bindableKind,Se=ve?i[ve]:void 0;return r.jsxs("button",{type:"button","data-palette-idx":re,onClick:()=>U(F.action),onMouseEnter:()=>y(re),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 ${me?"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:F.action.group}),r.jsx("span",{className:"min-w-0 flex-1 truncate",children:F.action.title}),F.action.subtitle?r.jsx("span",{className:"shrink-0 truncate text-xs text-muted-foreground",children:F.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:is(Se)}):null,ve?r.jsx("span",{role:"button",tabIndex:-1,"aria-label":"Bind hotkey",onClick:fe=>{fe.preventDefault(),fe.stopPropagation(),R({action:F.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 ${me?"opacity-100":"opacity-0 group-hover:opacity-100"}`,children:r.jsx(Km,{className:"h-3.5 w-3.5","aria-hidden":"true"})}):null]},F.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…":`${z.length} action${z.length===1?"":"s"}`})]})]})]})})}const q3=[{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 G3(e){const t=Xn(e);return t?q3.find(n=>n.combo===t)??null:null}const al={"new-workspace":"New Workspace","new-project":"New Project","new-todo":"New Todo","new-assignment":"New Assignment"},Y3={global:"Global","list:overview":"Overview","list:projects":"Projects list","list:assignments":"Assignments list","list:todos":"Todos list",assignment:"Assignment detail",project:"Project detail"},J3=["global","list:overview","list:projects","list:assignments","list:todos","project","assignment"];function pv(e){if(e.includes(" ")){const[t,n]=e.split(" ");return`${is(t)} then ${is(n)}`}return is(e)}function X3(){const{cheatsheetOpen:e,closeCheatsheet:t,listBindings:n,customBindings:s,actionEntries:i}=uo(),l=f.useMemo(()=>{const p=new Set;for(const m of Object.values(s))typeof m=="string"&&m&&p.add(Xn(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(Xn(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]),u=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(Zn,{open:e,onOpenChange:p=>p?null:t(),children:r.jsxs(_n,{className:"max-w-2xl",children:[r.jsx(Fn,{children:"Keyboard shortcuts"}),r.jsxs(fs,{children:["Press Esc to close. ",is("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:[J3.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:Y3[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:pv(h.keys)})]},`${p}-${h.keys}-${x}`))})]},p)}),u.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:u.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:pv(p.combo)})]},`custom-${p.kind}`))})]}):null]})]})})}const ig={bindings:{},custom:!1};let xl=null,Ci=null;const Qm=new Set;function ok(e){xl=e;for(const t of Qm)t(e)}function ag(e){if(!e||typeof e!="object")return ig;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(!IP(s)||typeof i!="string"||i.trim()==="")continue;const l=Xn(i);l&&(n[s]=l)}return{bindings:n,custom:t.custom===!0}}function Q3(){return xl?Promise.resolve(xl):Ci||(Ci=fetch("/api/config/hotkeys").then(e=>{if(!e.ok)throw new Error(`HTTP ${e.status}`);return e.json()}).then(e=>{const t=ag(e);return xl=t,Ci=null,t}).catch(()=>(Ci=null,ig)),Ci)}function Z3(){const[e,t]=f.useState(()=>xl??ig);return f.useEffect(()=>{let n=!1;return Q3().then(s=>{n||t(s)}),Qm.add(t),()=>{n=!0,Qm.delete(t)}},[]),e}async function mv(e){const t={};for(const i of jd){const l=e[i];if(typeof l!="string")continue;const c=Xn(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=ag(await n.json());return ok(s),s}async function eA(){const e=await fetch("/api/config/hotkeys",{method:"DELETE"});if(!e.ok)throw new Error(`HTTP ${e.status}`);const t=ag(await e.json());return ok(t),t}const hv=1500;function tA(e){const t=e.match(/^\/w\/([^/]+)(?:\/|$)/);return t?`/w/${t[1]}`:""}const ik=f.createContext(null);function nA({children:e}){const{toggleTheme:t}=Wh(),n=On(),s=Ct(),i=tA(n.pathname),[l,c]=f.useState(!1),u=Uo(l),p=wd(l),m=x0(l),h=Kh(l),x=b0(l),y=f.useMemo(()=>{var Ve,Ze,Tt,yt;const V=u.data??[],H=((Ve=p.data)==null?void 0:Ve.assignments)??[],ae=((Ze=m.data)==null?void 0:Ze.playbooks)??[],he=((Tt=h.data)==null?void 0:Tt.sessions)??[],Te=(((yt=x.data)==null?void 0:yt.workspaces)??[]).flatMap(jt=>jt.items.map(ue=>({...ue,workspace:jt.workspace})));return YP({projects:V,assignments:H,playbooks:ae,servers:he,todos:Te,wsPrefix:i})},[u.data,p.data,m.data,h.data,x.data,i]),C=f.useMemo(()=>n0(n.pathname),[n.pathname]).projectSlug,j=f.useMemo(()=>{var V;return C?((V=u.data)==null?void 0:V.find(H=>H.slug===C))??null:null},[u.data,C]),w=(j==null?void 0:j.title)??null,S=(j==null?void 0:j.workspace)??null,E=f.useMemo(()=>{var V;return QP({playbooks:((V=m.data)==null?void 0:V.playbooks)??[],projectSlug:C,currentProjectTitle:w,currentProjectWorkspace:S,wsPrefix:i,refetchPlaybooks:m.refetch,navigate:s,toggleTheme:t})},[m.data,m.refetch,C,w,S,i,s,t]),N=f.useRef(new Map),R=f.useRef(["global"]),I=f.useRef({phase:"idle"}),P=f.useRef(null),$=f.useRef(1),[D,X]=f.useState(!1),[Z,z]=f.useState(!1),[U,J]=f.useState(!1),[_,G]=f.useState(null);f.useEffect(()=>{(D||U)&&c(!0)},[D,U]);const{bindings:Q}=Z3(),le=f.useMemo(()=>zP(Q),[Q]),W=f.useCallback(V=>{const H=$.current++;return N.current.set(H,{...V,id:H}),H},[]),ne=f.useCallback(V=>{N.current.delete(V)},[]),T=f.useCallback(V=>{R.current.push(V)},[]),O=f.useCallback(V=>{const H=R.current;for(let ae=H.length-1;ae>=0;ae--)if(H[ae]===V){H.splice(ae,1);return}},[]),q=f.useCallback(()=>X(!0),[]),L=f.useCallback(()=>X(!1),[]),ee=f.useCallback(()=>z(!0),[]),de=f.useCallback(()=>z(!1),[]),F=f.useCallback(()=>J(!0),[]),re=f.useCallback(()=>{J(!1),G(null)},[]),me=f.useCallback(()=>Array.from(N.current.values()),[]),ve=f.useCallback(()=>{let V=null;return G(H=>(V=H,null)),V},[]),Se=f.useCallback(V=>{G(V),J(!0)},[]),fe=f.useCallback((V,H)=>{const ae=Xn(V);if(!ae)return null;if(_P(ae)){const he=G3(ae);return{description:(he==null?void 0:he.description)??"Reserved built-in shortcut"}}for(const[he,Ae]of Object.entries(le))if(!(H&&he===H)&&Ae===ae)return{kind:he};return null},[le]),He=f.useCallback(async(V,H)=>{const ae=Xn(H);if(!ae)throw new Error("Empty combo");const he=fe(ae,V);if(he){const Te=he.description?`Reserved: ${he.description}`:`Already bound to "${he.kind}"`;throw new Error(Te)}const Ae={...Q,[V]:ae};return await mv(Ae),ae},[Q,fe]),pe=f.useCallback(async V=>{if(!Q[V])return;const H={...Q};delete H[V],await mv(H)},[Q]);f.useEffect(()=>{I.current={phase:"idle"},P.current!==null&&(window.clearTimeout(P.current),P.current=null)},[n.pathname]),f.useEffect(()=>{function V(Te){if(!(Te instanceof HTMLElement))return!1;const Ve=Te.tagName;return!!(Ve==="INPUT"||Ve==="TEXTAREA"||Ve==="SELECT"||Te.isContentEditable||Te.closest('[role="combobox"], [role="textbox"]'))}function H(){return!!(document.querySelector('[role="dialog"][data-state="open"]')||document.querySelector('[role="alertdialog"][data-state="open"]'))}function ae(){const Te=R.current;return Te[Te.length-1]??"global"}function he(Te){return Te.scope==="global"?!0:Te.scope===ae()}function Ae(Te){const Ve=du(Te,"Mod+k"),Ze=du(Te,"Mod+Shift+k"),Tt=Te.key==="Escape",yt=Ve||Ze||Tt;if(H()&&!yt||V(Te.target)&&!yt)return;const jt=I.current;if(jt.phase==="awaiting-second")if(Date.now()-jt.startedAt>hv)I.current={phase:"idle"},P.current!==null&&(window.clearTimeout(P.current),P.current=null);else{const Le=Array.from(N.current.values());for(const Ie of Le){if(!he(Ie))continue;const We=Ie.keys.split(" ");if(!(We.length!==2||We[0]!=="g")&&du(Te,We[1])&&!(Ie.when&&!Ie.when())){Te.preventDefault(),I.current={phase:"idle"},P.current!==null&&(window.clearTimeout(P.current),P.current=null),Ie.handler(Te);return}}I.current={phase:"idle"},P.current!==null&&(window.clearTimeout(P.current),P.current=null)}const ue=Array.from(N.current.values());for(const ye of ue){if(!he(ye))continue;const Le=ye.keys.split(" ");if(Le.length===1&&du(Te,Le[0])&&!(ye.when&&!ye.when())){Te.preventDefault(),ye.handler(Te);return}}Te.key==="g"&&!Te.metaKey&&!Te.ctrlKey&&!Te.altKey&&!Te.shiftKey&&Array.from(N.current.values()).some(Le=>he(Le)&&Le.keys.startsWith("g "))&&(Te.preventDefault(),I.current={phase:"awaiting-second",startedAt:Date.now()},P.current!==null&&window.clearTimeout(P.current),P.current=window.setTimeout(()=>{I.current={phase:"idle"},P.current=null},hv))}return window.addEventListener("keydown",Ae),()=>{window.removeEventListener("keydown",Ae),P.current!==null&&(window.clearTimeout(P.current),P.current=null)}},[]),f.useEffect(()=>{const V=W({keys:"Shift+t",handler:()=>t(),scope:"global",description:"Toggle light/dark theme"});return()=>ne(V)},[W,ne,t]),f.useEffect(()=>{const V=W({keys:"?",scope:"global",description:"Show keyboard shortcuts",handler:()=>ee()});return()=>ne(V)},[W,ne,ee]),f.useEffect(()=>{const V=W({keys:"Mod+k",scope:"global",description:"Open command palette",handler:()=>{if(D){L();return}document.querySelector('[role="dialog"][data-state="open"], [role="alertdialog"][data-state="open"]')||q()}});return()=>ne(V)},[W,ne,q,L,D]),f.useEffect(()=>{const V=W({keys:"Mod+Shift+k",scope:"global",description:"Open actions palette",handler:()=>{if(U){re();return}document.querySelector('[role="dialog"][data-state="open"], [role="alertdialog"][data-state="open"]')||F()}});return()=>ne(V)},[W,ne,F,re,U]),f.useEffect(()=>{const H=[{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(ae=>W({keys:`g ${ae.suffix}`,scope:"global",description:ae.desc,handler:()=>s(Au(ae.basePath,i))}));return()=>H.forEach(ne)},[W,ne,s,i]),f.useEffect(()=>{const V=[];for(const[H,ae]of Object.entries(le)){if(!ae)continue;const he=E.find(Te=>Te.bindableKind===H),Ae=he?`Custom: ${he.title}`:`Custom: ${H}`;V.push(W({keys:ae,scope:"global",description:Ae,handler:()=>{G(H),J(!0)}}))}return()=>V.forEach(ne)},[W,ne,le,E]);const Pe=f.useMemo(()=>({register:W,unregister:ne,pushScope:T,popScope:O,openPalette:q,closePalette:L,paletteOpen:D,openCheatsheet:ee,closeCheatsheet:de,cheatsheetOpen:Z,openActionsPalette:F,closeActionsPalette:re,actionsPaletteOpen:U,listBindings:me,wsPrefix:i,paletteEntries:y,actionEntries:E,userBindings:Q,customBindings:le,bindAction:He,unbindAction:pe,findConflict:fe,openActionsPaletteWithAction:Se,pendingActionKind:_,consumePendingActionKind:ve}),[W,ne,T,O,q,L,D,ee,de,Z,F,re,U,me,i,y,E,Q,le,He,pe,fe,Se,_,ve]);return r.jsxs(ik.Provider,{value:Pe,children:[e,r.jsx(U3,{entries:y}),r.jsx(K3,{entries:E}),r.jsx(X3,{})]})}function uo(){const e=f.useContext(ik);if(!e)throw new Error("useHotkeyContext must be used within HotkeyProvider");return e}function $t({keys:e,handler:t,scope:n="global",description:s,when:i,enabled:l=!0}){const{register:c,unregister:u}=uo(),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()=>u(h)},[c,u,e,n,s,l])}function fo(e){const{pushScope:t,popScope:n}=uo();f.useEffect(()=>(t(e),()=>n(e)),[t,n,e])}function Gl(e,t){const[n,s]=f.useState(e.length===0?-1:0),i=On();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(u=>{const p=Number(u.getAttribute("data-hotkey-row-index"));u.setAttribute("data-hotkey-selected",p===n?"true":"false")}),n>=0){const u=document.querySelector(`[data-hotkey-row-index="${n}"]`);u==null||u.scrollIntoView({block:"nearest"})}},[n,e.length]),$t({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))}),$t({keys:"k",scope:t.scope,description:"Select previous row",handler:()=>s(c=>e.length===0?-1:Math.max(0,c<0?0:c-1))}),$t({keys:"Enter",scope:t.scope,description:"Open selected row",handler:()=>{n>=0&&n<e.length&&t.onOpen(e[n],n)}}),$t({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 rA({title:e,breadcrumbs:t,projectSlug:n,onOpenMobileNav:s}){const i=Xt(),{resolvedTheme:l,toggleTheme:c}=Wh(),{openPalette:u}=uo();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(jT,{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:u,className:"shell-action","aria-label":"Open command palette",children:[r.jsx(co,{className:"h-4 w-4"}),r.jsx("span",{className:"hidden sm:inline font-mono text-xs",children:is("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(Kt,{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(Kt,{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(DT,{className:"h-4 w-4"}):r.jsx(kT,{className:"h-4 w-4"}),r.jsx("span",{children:l==="dark"?"Light":"Dark"})]})]})]})})}var sA=Symbol("radix.slottable");function oA(e){const t=({children:n})=>r.jsx(r.Fragment,{children:n});return t.displayName=`${e}.Slottable`,t.__radixId=sA,t}var ak="AlertDialog",[iA]=Vo(ak,[F0]),Rs=F0(),lk=e=>{const{__scopeAlertDialog:t,...n}=e,s=Rs(t);return r.jsx(tk,{...s,...n,modal:!0})};lk.displayName=ak;var aA="AlertDialogTrigger",lA=f.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...s}=e,i=Rs(n);return r.jsx(nk,{...i,...s,ref:t})});lA.displayName=aA;var cA="AlertDialogPortal",ck=e=>{const{__scopeAlertDialog:t,...n}=e,s=Rs(t);return r.jsx(rk,{...s,...n})};ck.displayName=cA;var uA="AlertDialogOverlay",uk=f.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...s}=e,i=Rs(n);return r.jsx(eg,{...i,...s,ref:t})});uk.displayName=uA;var Vi="AlertDialogContent",[dA,fA]=iA(Vi),pA=oA("AlertDialogContent"),dk=f.forwardRef((e,t)=>{const{__scopeAlertDialog:n,children:s,...i}=e,l=Rs(n),c=f.useRef(null),u=Rn(t,c),p=f.useRef(null);return r.jsx(D3,{contentName:Vi,titleName:fk,docsSlug:"alert-dialog",children:r.jsx(dA,{scope:n,cancelRef:p,children:r.jsxs(tg,{role:"alertdialog",...l,...i,ref:u,onOpenAutoFocus:Mt(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(pA,{children:s}),r.jsx(hA,{contentRef:c})]})})})});dk.displayName=Vi;var fk="AlertDialogTitle",pk=f.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...s}=e,i=Rs(n);return r.jsx(ng,{...i,...s,ref:t})});pk.displayName=fk;var mk="AlertDialogDescription",hk=f.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...s}=e,i=Rs(n);return r.jsx(rg,{...i,...s,ref:t})});hk.displayName=mk;var mA="AlertDialogAction",gk=f.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...s}=e,i=Rs(n);return r.jsx(sg,{...i,...s,ref:t})});gk.displayName=mA;var xk="AlertDialogCancel",yk=f.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...s}=e,{cancelRef:i}=fA(xk,n),l=Rs(n),c=Rn(t,i);return r.jsx(sg,{...l,...s,ref:c})});yk.displayName=xk;var hA=({contentRef:e})=>{const t=`\`${Vi}\` requires a description for the component to be accessible for screen reader users.
|
|
495
|
+
|
|
496
|
+
You can add a description to the \`${Vi}\` by passing a \`${mk}\` 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 \`${Vi}\`. 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},gA=lk,xA=ck,bk=uk,vk=dk,wk=gk,jk=yk,kk=pk,Sk=hk;const Ku=gA,yA=xA,Nk=f.forwardRef(({className:e,...t},n)=>r.jsx(bk,{ref:n,className:Re("fixed inset-0 z-50 bg-background/80 backdrop-blur-sm",e),...t}));Nk.displayName=bk.displayName;const Rl=f.forwardRef(({className:e,...t},n)=>r.jsxs(yA,{children:[r.jsx(Nk,{}),r.jsx(vk,{ref:n,className:Re("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})]}));Rl.displayName=vk.displayName;function qu({className:e,...t}){return r.jsx("div",{className:Re("flex flex-col space-y-2 text-left",e),...t})}function Gu({className:e,...t}){return r.jsx("div",{className:Re("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",e),...t})}const Al=f.forwardRef(({className:e,...t},n)=>r.jsx(kk,{ref:n,className:Re("text-lg font-semibold tracking-tight text-foreground",e),...t}));Al.displayName=kk.displayName;const Dl=f.forwardRef(({className:e,...t},n)=>r.jsx(Sk,{ref:n,className:Re("text-sm leading-6 text-muted-foreground",e),...t}));Dl.displayName=Sk.displayName;const Qi=f.forwardRef(({className:e,...t},n)=>r.jsx(wk,{ref:n,className:Re(e),...t}));Qi.displayName=wk.displayName;const Ed=f.forwardRef(({className:e,...t},n)=>r.jsx(jk,{ref:n,className:Re(e),...t}));Ed.displayName=jk.displayName;const bA=[{to:"/",label:"Overview",icon:Fj},{to:"/playbooks",label:"Playbooks",icon:Mj},{to:"/memories",label:"Memories",icon:rT},{to:"/resources",label:"Resources",icon:yT},{to:"/inventories",label:"Inventories",icon:gd},{to:"/usage",label:"Usage",icon:xd},{to:"/todos",label:"Todos",icon:Pr},{to:"/views",label:"Saved Views",icon:Uj}],vA=[{suffix:"/projects",label:"Projects",icon:Bj},{suffix:"/assignments",label:"Assignments",icon:wT},{suffix:"/servers",label:"Servers",icon:Fh},{suffix:"/inventories",label:"Inventories",icon:gd},{suffix:"/usage",label:"Usage",icon:xd},{suffix:"/agent-sessions",label:"Agent Sessions",icon:hd},{suffix:"/todos",label:"Todos",icon:Pr}],wA=[{to:"/help",label:"Help",icon:bT},{to:"/settings",label:"Settings",icon:RT}],gv="syntaur.dashboard.sourceFirstNoticeDismissed";function jA({title:e,breadcrumbs:t,projectSlug:n,workspace:s,children:i}){const[l,c]=f.useState(!1);$t({keys:"Escape",scope:"global",description:"Close mobile navigation",enabled:l,handler:()=>c(!1)});const[u,p]=f.useState(()=>{if(typeof window>"u")return!1;try{return window.localStorage.getItem(gv)==="1"}catch{return!1}});function m(){if(p(!0),!(typeof window>"u"))try{window.localStorage.setItem(gv,"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(xv,{sourceNoticeDismissed:u,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(Uh,{className:"h-4 w-4"})})]}),r.jsx(xv,{sourceNoticeDismissed:u,onDismissSourceNotice:m,activeWorkspace:s,onNavigate:()=>c(!1)})]})}):null,r.jsxs("div",{className:"min-w-0",children:[r.jsx(rA,{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 xv({sourceNoticeDismissed:e,onDismissSourceNotice:t,activeWorkspace:n,onNavigate:s}){const{data:i}=vd(),l=(i==null?void 0:i.workspaces)??[],c=(i==null?void 0:i.hasUngrouped)??!1,u=On(),[p,m]=f.useState(new Set),[h,x]=f.useState(!1),[y,b]=f.useState(""),[C,j]=f.useState(null),[w,S]=f.useState(null),[E,N]=f.useState(null),[R,I]=f.useState(!1),P=Ct();function $(z){m(U=>{const J=new Set(U);return J.has(z)?J.delete(z):J.add(z),J})}const D=[...l,...c?["_ungrouped"]:[]];async function X(z){if(w){I(!0);try{const U=`/api/workspaces/${encodeURIComponent(w)}${z?"?cascade=true":""}`,J=await fetch(U,{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(U){console.error(U),alert(U instanceof Error?U.message:"Failed to delete workspace")}finally{I(!1)}}}async function Z(z,U){try{if(z.type==="project"){const J=await fetch(`/api/projects/${encodeURIComponent(z.id)}/move-workspace`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({workspace:U})});if(!J.ok){const _=await J.json().catch(()=>({}));throw new Error(_.error||"Failed to move project")}return}if(z.type==="standalone-assignment"){const J=await fetch(`/api/assignments/${encodeURIComponent(z.id)}/move-workspace`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({workspaceGroup:U})});if(!J.ok){const _=await J.json().catch(()=>({}));throw new Error(_.error||"Failed to move assignment")}return}if(z.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(Jb,{items:bA,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(z=>{const U=z==="_ungrouped",J=U?"Ungrouped":yn(z),_=U?"/w/_ungrouped":`/w/${z}`,G=p.has(z),Q=n===z||n===null&&U&&u.pathname.startsWith("/w/_ungrouped"),le=C===z;return r.jsxs("div",{className:`rounded-md transition ${le?"bg-accent/40 ring-1 ring-ring/40":""}`,onDragOver:W=>{W.dataTransfer.types.includes("application/json")&&(W.preventDefault(),W.dataTransfer.dropEffect="move",j(z))},onDragLeave:W=>{W.currentTarget.contains(W.relatedTarget)||j(ne=>ne===z?null:ne)},onDrop:async W=>{try{const ne=W.dataTransfer.getData("application/json");if(!ne)return;W.preventDefault();let T;try{T=JSON.parse(ne)}catch{return}if(!(T!=null&&T.type)||!(T!=null&&T.id))return;await Z(T,U?null:z)}finally{j(null)}},children:[r.jsxs("div",{className:"group flex items-center",children:[r.jsxs("button",{type:"button",onClick:()=>$(z),className:`flex flex-1 items-center gap-2 rounded-md px-3 py-1.5 text-xs font-semibold uppercase tracking-wider transition ${Q?"text-foreground":"text-muted-foreground/70 hover:text-muted-foreground"}`,children:[r.jsx(no,{className:`h-3 w-3 transition-transform ${G?"-rotate-90":""}`}),J]}),U?null:r.jsx("button",{type:"button",onClick:W=>{W.stopPropagation(),S(z),N(null)},title:`Delete workspace "${z}"`,"aria-label":`Delete workspace "${z}"`,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(Mn,{className:"h-3 w-3"})})]}),!G&&r.jsx("nav",{className:"ml-2 space-y-0.5",children:vA.map(W=>{const ne=`${_}${W.suffix}`,T=t0(u.pathname,W.suffix)&&u.pathname.startsWith(_),O=W.icon;return r.jsxs(Ee,{to:ne,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(O,{className:"h-4 w-4"}),r.jsx("span",{children:W.label})]},ne)})})]},z)}),h?r.jsx("form",{className:"px-3 py-1.5",onSubmit:z=>{z.preventDefault();const U=y.trim().toLowerCase().replace(/[^a-z0-9-]/g,"-").replace(/-+/g,"-").replace(/^-|-$/g,"");U&&(x(!1),b(""),fetch("/api/workspaces",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:U})}).then(()=>{s==null||s(),P(`/w/${U}/projects`)}))},children:r.jsx("input",{autoFocus:!0,type:"text",value:y,onChange:z=>b(z.target.value),onKeyDown:z=>{z.key==="Escape"&&(x(!1),b(""))},onBlur:()=>{y.trim()||(x(!1),b(""))},placeholder:"workspace-name",className:"w-full rounded-md border border-border/60 bg-background/80 px-2 py-1 text-xs text-foreground placeholder:text-muted-foreground/50 focus:border-foreground/40 focus:outline-none"})}):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(Kt,{className:"h-3 w-3"}),"New Workspace"]})]}),r.jsx("div",{className:"border-t border-border/40"}),r.jsx(Jb,{items:wA,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(Uh,{className:"h-4 w-4"})})]})}),r.jsx(Ku,{open:w!==null,onOpenChange:z=>{R||z||(S(null),N(null))},children:r.jsxs(Rl,{children:[r.jsxs(qu,{children:[r.jsx(Al,{children:E?"Workspace has references":"Delete workspace?"}),r.jsx(Dl,{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(z=>r.jsx("li",{children:r.jsx(Ee,{to:`/projects/${z}`,className:"hover:underline",children:z})},z))})]}):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(z=>r.jsx("li",{children:r.jsx(Ee,{to:`/assignments/${z}`,className:"hover:underline",children:z})},z))})]}):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(Gu,{children:[r.jsx(Ed,{disabled:R,className:"shell-action mt-0 disabled:cursor-not-allowed disabled:opacity-50",children:"Cancel"}),E?r.jsx(Qi,{disabled:R,onClick:z=>{z.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:R?"Working…":"Clear references and delete"}):r.jsx(Qi,{disabled:R,onClick:z=>{z.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:R?"Working…":"Delete"})]})]})})]})}function kA(){const e=On(),{workspace:t}=Et(),{title:n,breadcrumbs:s,projectSlug:i}=n0(e.pathname);return r.jsx(jA,{title:n,breadcrumbs:s,projectSlug:i,workspace:t??null,children:r.jsx(h2,{})})}function dt({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 ht({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 Iu({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 Be({title:e,description:t,children:n,className:s,actions:i}){return r.jsxs("section",{className:Re("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 SA({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(Be,{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(Iu,{command:s.command.command,example:s.command.example}):null]})]})},s.title))})})}const im={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."},Oo={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 NA(e,t){return e.replace(/\{(\w+)\}/g,(n,s)=>String(t[s]??`{${s}}`))}function CA({hero:e,itemsById:t}){const n=Xt();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:Oo.emptyStateCleanTitle}),r.jsx("h2",{id:"overview-hero-title",className:"mt-2 text-2xl font-semibold tracking-tight text-foreground",children:im.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:Oo.emptyStateCleanCTA})})]});const s=e.itemId?t[e.itemId]:void 0,i=(s==null?void 0:s.assignmentTitle)??"",l=im[e.copyKey]??im[e.kind],c=NA(l,{total:e.total,title:i}),u=s?EA(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:u,className:"shell-action bg-foreground text-background hover:opacity-90",children:["Open ",i||"assignment"]})})]})}function EA(e,t){return e.projectSlug?`${t}${e.href}`:e.href}const lg=["kanban","list","table"],Ck=["title","status","priority","assignee","dependencies","updated"],TA=["asc","desc"],PA=["comfortable","compact"],RA=["none","status","type","priority","assignee","project"];function it(e){const t=e===void 0?[]:Array.isArray(e)?e:[e],n=[];for(const s of t){if(typeof s!="string")continue;const i=s.trim();!i||i==="all"||n.includes(i)||n.push(i)}return n}function AA(e,t){const n=it(e),s=it(t);return n.length===s.length&&n.every(i=>s.includes(i))}const DA={defaultView:"kanban",sortField:"updated",sortDirection:"desc",density:"comfortable",grouping:"none",filters:{status:"all",type:"all",priority:"all",assignee:"all",project:"all",activity:"all"}},Ll={version:1,global:DA,projects:{}};function am(e){return e==="table"?"table":"kanban"}function LA(e,t){return t?{...e,...t}:{...e}}function Ek(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:LA(n.filters,s.filters)}:n}const lm=["title","status","priority","assignee","dependencies","updated"],$A={status:"all",priority:"all",assignee:"all",project:"all",activity:"all"},yv="2026-05-21T00:00:00Z";function cm(e,t,n){return{id:e,name:t,workspace:null,config:{viewMode:"list",filters:{...$A,...n},sortField:"updated",sortDirection:"desc",listSectionVisibility:{collapsed:[]},kanbanColumnVisibility:{hidden:[]},tableColumnVisibility:{hidden:[]}},createdAt:yv,updatedAt:yv}}const to={version:1,views:[cm("default-recently-updated","Recently updated",{}),cm("default-high-priority","High priority",{priority:"high"}),cm("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 Tk(e,t){const n=it(e.filters.project),s=n.length===0||n.length===1&&n[0]===t,i=e.filters.activity;return s&&(!i||i==="all")}function Pk(e,t){switch(t.kind){case"global":return e.workspace===null;case"workspace":return e.workspace===t.workspace||e.workspace===null;case"project":return e.workspace===t.workspace||e.workspace===null?Tk(e.config,t.slug):!1}}const Rk=`syntaur.savedViews.cache.v${to.version}`;let Hi=IA(),Lo=null,cg=null;const Zm=new Set,Yu=new Set;let Ak=0;function Dk(){return++Ak}function eh(e){return e===Ak}function IA(){if(typeof window>"u"||!window.localStorage)return null;try{const e=window.localStorage.getItem(Rk);if(!e)return null;const t=JSON.parse(e);return t.version!==to.version?null:t}catch{return null}}function OA(e){if(!(typeof window>"u"||!window.localStorage))try{window.localStorage.setItem(Rk,JSON.stringify(e))}catch{}}function Lk(e){Hi=e,cg=null,OA(e);for(const t of Zm)t(e);for(const t of Yu)t(null)}function MA(e){cg=e;for(const t of Yu)t(e)}function $k(e){if(!e||typeof e!="object")return to;const t=e;return t.version!==to.version||!Array.isArray(t.views)||!t.dashboard?to:t}function bv(){if(Lo)return Lo;const e=Dk();return Lo=fetch("/api/saved-views").then(t=>{if(!t.ok)throw new Error(`HTTP ${t.status}`);return t.json()}).then(t=>{const n=$k(t);return eh(e)&&Lk(n),Lo=null,Hi??n}).catch(t=>{const n=t instanceof Error?t:new Error(String(t));return eh(e)&&MA(n),Lo=null,Hi??to}),Lo}function ug(){const[e,t]=f.useState(()=>Hi??to),[n,s]=f.useState(()=>Hi===null),[i,l]=f.useState(()=>cg);return f.useEffect(()=>{let u=!1;Hi===null&&s(!0),bv().then(h=>{u||(t(h),s(!1))});const p=h=>{u||(t(h),s(!1),l(null))},m=h=>{u||(l(h),s(!1))};return Zm.add(p),Yu.add(m),()=>{u=!0,Zm.delete(p),Yu.delete(m)}},[]),{file:e,loading:n,error:i,refetch:()=>{Lo=null,s(!0),l(null),bv()}}}function dg(){const{file:e,loading:t}=ug();return{views:e.views,loading:t}}function _A(){const{file:e,loading:t}=ug();return{layout:e.dashboard,loading:t}}function Zi(e){const{file:t,loading:n,error:s,refetch:i}=ug();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 Td(e,t,n){const s=Dk(),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=$k(await i.json());return eh(s)&&Lk(l),l}function fg(e){return Td("POST","/api/saved-views",e)}function pg(e,t){return Td("PATCH",`/api/saved-views/${encodeURIComponent(e)}`,t)}function FA(e){return Td("DELETE",`/api/saved-views/${encodeURIComponent(e)}`)}function zA(e){return Td("PUT","/api/dashboard",{slots:e})}const BA=["top","right","bottom","left"],so=Math.min,fr=Math.max,Ju=Math.round,xu=Math.floor,as=e=>({x:e,y:e}),UA={left:"right",right:"left",bottom:"top",top:"bottom"};function th(e,t,n){return fr(e,so(t,n))}function Es(e,t){return typeof e=="function"?e(t):e}function Ts(e){return e.split("-")[0]}function ia(e){return e.split("-")[1]}function mg(e){return e==="x"?"y":"x"}function hg(e){return e==="y"?"height":"width"}function ss(e){const t=e[0];return t==="t"||t==="b"?"y":"x"}function gg(e){return mg(ss(e))}function VA(e,t,n){n===void 0&&(n=!1);const s=ia(e),i=gg(e),l=hg(i);let c=i==="x"?s===(n?"end":"start")?"right":"left":s==="start"?"bottom":"top";return t.reference[l]>t.floating[l]&&(c=Xu(c)),[c,Xu(c)]}function HA(e){const t=Xu(e);return[nh(e),t,nh(t)]}function nh(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}const vv=["left","right"],wv=["right","left"],WA=["top","bottom"],KA=["bottom","top"];function qA(e,t,n){switch(e){case"top":case"bottom":return n?t?wv:vv:t?vv:wv;case"left":case"right":return t?WA:KA;default:return[]}}function GA(e,t,n,s){const i=ia(e);let l=qA(Ts(e),n==="start",s);return i&&(l=l.map(c=>c+"-"+i),t&&(l=l.concat(l.map(nh)))),l}function Xu(e){const t=Ts(e);return UA[t]+e.slice(t.length)}function YA(e){return{top:0,right:0,bottom:0,left:0,...e}}function Ik(e){return typeof e!="number"?YA(e):{top:e,right:e,bottom:e,left:e}}function Qu(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 jv(e,t,n){let{reference:s,floating:i}=e;const l=ss(t),c=gg(t),u=hg(c),p=Ts(t),m=l==="y",h=s.x+s.width/2-i.width/2,x=s.y+s.height/2-i.height/2,y=s[u]/2-i[u]/2;let b;switch(p){case"top":b={x:h,y:s.y-i.height};break;case"bottom":b={x:h,y:s.y+s.height};break;case"right":b={x:s.x+s.width,y:x};break;case"left":b={x:s.x-i.width,y:x};break;default:b={x:s.x,y:s.y}}switch(ia(t)){case"start":b[c]-=y*(n&&m?-1:1);break;case"end":b[c]+=y*(n&&m?-1:1);break}return b}async function JA(e,t){var n;t===void 0&&(t={});const{x:s,y:i,platform:l,rects:c,elements:u,strategy:p}=e,{boundary:m="clippingAncestors",rootBoundary:h="viewport",elementContext:x="floating",altBoundary:y=!1,padding:b=0}=Es(t,e),C=Ik(b),w=u[y?x==="floating"?"reference":"floating":x],S=Qu(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(u.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(u.floating)),R=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=Qu(l.convertOffsetParentRelativeRectToViewportRelativeRect?await l.convertOffsetParentRelativeRectToViewportRelativeRect({elements:u,rect:E,offsetParent:N,strategy:p}):E);return{top:(S.top-I.top+C.top)/R.y,bottom:(I.bottom-S.bottom+C.bottom)/R.y,left:(S.left-I.left+C.left)/R.x,right:(I.right-S.right+C.right)/R.x}}const XA=50,QA=async(e,t,n)=>{const{placement:s="bottom",strategy:i="absolute",middleware:l=[],platform:c}=n,u=c.detectOverflow?c:{...c,detectOverflow:JA},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}=jv(m,s,p),y=s,b=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:R,data:I,reset:P}=await E({x:h,y:x,initialPlacement:s,placement:y,strategy:i,middlewareData:C,rects:m,platform:u,elements:{reference:e,floating:t}});h=N??h,x=R??x,C[S]={...C[S],...I},P&&b<XA&&(b++,typeof P=="object"&&(P.placement&&(y=P.placement),P.rects&&(m=P.rects===!0?await c.getElementRects({reference:e,floating:t,strategy:i}):P.rects),{x:h,y:x}=jv(m,y,p)),j=-1)}return{x:h,y:x,placement:y,strategy:i,middlewareData:C}},ZA=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:s,placement:i,rects:l,platform:c,elements:u,middlewareData:p}=t,{element:m,padding:h=0}=Es(e,t)||{};if(m==null)return{};const x=Ik(h),y={x:n,y:s},b=gg(i),C=hg(b),j=await c.getDimensions(m),w=b==="y",S=w?"top":"left",E=w?"bottom":"right",N=w?"clientHeight":"clientWidth",R=l.reference[C]+l.reference[b]-y[b]-l.floating[C],I=y[b]-l.reference[b],P=await(c.getOffsetParent==null?void 0:c.getOffsetParent(m));let $=P?P[N]:0;(!$||!await(c.isElement==null?void 0:c.isElement(P)))&&($=u.floating[N]||l.floating[C]);const D=R/2-I/2,X=$/2-j[C]/2-1,Z=so(x[S],X),z=so(x[E],X),U=Z,J=$-j[C]-z,_=$/2-j[C]/2+D,G=th(U,_,J),Q=!p.arrow&&ia(i)!=null&&_!==G&&l.reference[C]/2-(_<U?Z:z)-j[C]/2<0,le=Q?_<U?_-U:_-J:0;return{[b]:y[b]+le,data:{[b]:G,centerOffset:_-G-le,...Q&&{alignmentOffset:le}},reset:Q}}}),eD=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:u,platform:p,elements:m}=t,{mainAxis:h=!0,crossAxis:x=!0,fallbackPlacements:y,fallbackStrategy:b="bestFit",fallbackAxisSideDirection:C="none",flipAlignment:j=!0,...w}=Es(e,t);if((n=l.arrow)!=null&&n.alignmentOffset)return{};const S=Ts(i),E=ss(u),N=Ts(u)===u,R=await(p.isRTL==null?void 0:p.isRTL(m.floating)),I=y||(N||!j?[Xu(u)]:HA(u)),P=C!=="none";!y&&P&&I.push(...GA(u,j,C,R));const $=[u,...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 _=VA(i,c,R);X.push(D[_[0]],D[_[1]])}if(Z=[...Z,{placement:i,overflows:X}],!X.every(_=>_<=0)){var z,U;const _=(((z=l.flip)==null?void 0:z.index)||0)+1,G=$[_];if(G&&(!(x==="alignment"?E!==ss(G):!1)||Z.every(W=>ss(W.placement)===E?W.overflows[0]>0:!0)))return{data:{index:_,overflows:Z},reset:{placement:G}};let Q=(U=Z.filter(le=>le.overflows[0]<=0).sort((le,W)=>le.overflows[1]-W.overflows[1])[0])==null?void 0:U.placement;if(!Q)switch(b){case"bestFit":{var J;const le=(J=Z.filter(W=>{if(P){const ne=ss(W.placement);return ne===E||ne==="y"}return!0}).map(W=>[W.placement,W.overflows.filter(ne=>ne>0).reduce((ne,T)=>ne+T,0)]).sort((W,ne)=>W[1]-ne[1])[0])==null?void 0:J[0];le&&(Q=le);break}case"initialPlacement":Q=u;break}if(i!==Q)return{reset:{placement:Q}}}return{}}}};function kv(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function Sv(e){return BA.some(t=>e[t]>=0)}const tD=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n,platform:s}=t,{strategy:i="referenceHidden",...l}=Es(e,t);switch(i){case"referenceHidden":{const c=await s.detectOverflow(t,{...l,elementContext:"reference"}),u=kv(c,n.reference);return{data:{referenceHiddenOffsets:u,referenceHidden:Sv(u)}}}case"escaped":{const c=await s.detectOverflow(t,{...l,altBoundary:!0}),u=kv(c,n.floating);return{data:{escapedOffsets:u,escaped:Sv(u)}}}default:return{}}}}},Ok=new Set(["left","top"]);async function nD(e,t){const{placement:n,platform:s,elements:i}=e,l=await(s.isRTL==null?void 0:s.isRTL(i.floating)),c=Ts(n),u=ia(n),p=ss(n)==="y",m=Ok.has(c)?-1:1,h=l&&p?-1:1,x=Es(t,e);let{mainAxis:y,crossAxis:b,alignmentAxis:C}=typeof x=="number"?{mainAxis:x,crossAxis:0,alignmentAxis:null}:{mainAxis:x.mainAxis||0,crossAxis:x.crossAxis||0,alignmentAxis:x.alignmentAxis};return u&&typeof C=="number"&&(b=u==="end"?C*-1:C),p?{x:b*h,y:y*m}:{x:y*m,y:b*h}}const rD=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:u}=t,p=await nD(t,e);return c===((n=u.offset)==null?void 0:n.placement)&&(s=u.arrow)!=null&&s.alignmentOffset?{}:{x:i+p.x,y:l+p.y,data:{...p,placement:c}}}}},sD=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:u=!1,limiter:p={fn:S=>{let{x:E,y:N}=S;return{x:E,y:N}}},...m}=Es(e,t),h={x:n,y:s},x=await l.detectOverflow(t,m),y=ss(Ts(i)),b=mg(y);let C=h[b],j=h[y];if(c){const S=b==="y"?"top":"left",E=b==="y"?"bottom":"right",N=C+x[S],R=C-x[E];C=th(N,C,R)}if(u){const S=y==="y"?"top":"left",E=y==="y"?"bottom":"right",N=j+x[S],R=j-x[E];j=th(N,j,R)}const w=p.fn({...t,[b]:C,[y]:j});return{...w,data:{x:w.x-n,y:w.y-s,enabled:{[b]:c,[y]:u}}}}}},oD=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:s,placement:i,rects:l,middlewareData:c}=t,{offset:u=0,mainAxis:p=!0,crossAxis:m=!0}=Es(e,t),h={x:n,y:s},x=ss(i),y=mg(x);let b=h[y],C=h[x];const j=Es(u,t),w=typeof j=="number"?{mainAxis:j,crossAxis:0}:{mainAxis:0,crossAxis:0,...j};if(p){const N=y==="y"?"height":"width",R=l.reference[y]-l.floating[N]+w.mainAxis,I=l.reference[y]+l.reference[N]-w.mainAxis;b<R?b=R:b>I&&(b=I)}if(m){var S,E;const N=y==="y"?"width":"height",R=Ok.has(Ts(i)),I=l.reference[x]-l.floating[N]+(R&&((S=c.offset)==null?void 0:S[x])||0)+(R?0:w.crossAxis),P=l.reference[x]+l.reference[N]+(R?0:((E=c.offset)==null?void 0:E[x])||0)-(R?w.crossAxis:0);C<I?C=I:C>P&&(C=P)}return{[y]:b,[x]:C}}}},iD=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:u}=t,{apply:p=()=>{},...m}=Es(e,t),h=await c.detectOverflow(t,m),x=Ts(i),y=ia(i),b=ss(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(u.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,R=so(j-h[w],E),I=so(C-h[S],N),P=!t.middlewareData.shift;let $=R,D=I;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(D=N),(s=t.middlewareData.shift)!=null&&s.enabled.y&&($=E),P&&!y){const Z=fr(h.left,0),z=fr(h.right,0),U=fr(h.top,0),J=fr(h.bottom,0);b?D=C-2*(Z!==0||z!==0?Z+z:fr(h.left,h.right)):$=j-2*(U!==0||J!==0?U+J:fr(h.top,h.bottom))}await p({...t,availableWidth:D,availableHeight:$});const X=await c.getDimensions(u.floating);return C!==X.width||j!==X.height?{reset:{rects:!0}}:{}}}};function Pd(){return typeof window<"u"}function aa(e){return Mk(e)?(e.nodeName||"").toLowerCase():"#document"}function hr(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function ps(e){var t;return(t=(Mk(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function Mk(e){return Pd()?e instanceof Node||e instanceof hr(e).Node:!1}function Ur(e){return Pd()?e instanceof Element||e instanceof hr(e).Element:!1}function As(e){return Pd()?e instanceof HTMLElement||e instanceof hr(e).HTMLElement:!1}function Nv(e){return!Pd()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof hr(e).ShadowRoot}function Yl(e){const{overflow:t,overflowX:n,overflowY:s,display:i}=Vr(e);return/auto|scroll|overlay|hidden|clip/.test(t+s+n)&&i!=="inline"&&i!=="contents"}function aD(e){return/^(table|td|th)$/.test(aa(e))}function Rd(e){try{if(e.matches(":popover-open"))return!0}catch{}try{return e.matches(":modal")}catch{return!1}}const lD=/transform|translate|scale|rotate|perspective|filter/,cD=/paint|layout|strict|content/,Do=e=>!!e&&e!=="none";let um;function xg(e){const t=Ur(e)?Vr(e):e;return Do(t.transform)||Do(t.translate)||Do(t.scale)||Do(t.rotate)||Do(t.perspective)||!yg()&&(Do(t.backdropFilter)||Do(t.filter))||lD.test(t.willChange||"")||cD.test(t.contain||"")}function uD(e){let t=oo(e);for(;As(t)&&!ea(t);){if(xg(t))return t;if(Rd(t))return null;t=oo(t)}return null}function yg(){return um==null&&(um=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),um}function ea(e){return/^(html|body|#document)$/.test(aa(e))}function Vr(e){return hr(e).getComputedStyle(e)}function Ad(e){return Ur(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function oo(e){if(aa(e)==="html")return e;const t=e.assignedSlot||e.parentNode||Nv(e)&&e.host||ps(e);return Nv(t)?t.host:t}function _k(e){const t=oo(e);return ea(t)?e.ownerDocument?e.ownerDocument.body:e.body:As(t)&&Yl(t)?t:_k(t)}function $l(e,t,n){var s;t===void 0&&(t=[]),n===void 0&&(n=!0);const i=_k(e),l=i===((s=e.ownerDocument)==null?void 0:s.body),c=hr(i);if(l){const u=rh(c);return t.concat(c,c.visualViewport||[],Yl(i)?i:[],u&&n?$l(u):[])}else return t.concat(i,$l(i,[],n))}function rh(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Fk(e){const t=Vr(e);let n=parseFloat(t.width)||0,s=parseFloat(t.height)||0;const i=As(e),l=i?e.offsetWidth:n,c=i?e.offsetHeight:s,u=Ju(n)!==l||Ju(s)!==c;return u&&(n=l,s=c),{width:n,height:s,$:u}}function bg(e){return Ur(e)?e:e.contextElement}function Wi(e){const t=bg(e);if(!As(t))return as(1);const n=t.getBoundingClientRect(),{width:s,height:i,$:l}=Fk(t);let c=(l?Ju(n.width):n.width)/s,u=(l?Ju(n.height):n.height)/i;return(!c||!Number.isFinite(c))&&(c=1),(!u||!Number.isFinite(u))&&(u=1),{x:c,y:u}}const dD=as(0);function zk(e){const t=hr(e);return!yg()||!t.visualViewport?dD:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function fD(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==hr(e)?!1:t}function zo(e,t,n,s){t===void 0&&(t=!1),n===void 0&&(n=!1);const i=e.getBoundingClientRect(),l=bg(e);let c=as(1);t&&(s?Ur(s)&&(c=Wi(s)):c=Wi(e));const u=fD(l,n,s)?zk(l):as(0);let p=(i.left+u.x)/c.x,m=(i.top+u.y)/c.y,h=i.width/c.x,x=i.height/c.y;if(l){const y=hr(l),b=s&&Ur(s)?hr(s):s;let C=y,j=rh(C);for(;j&&s&&b!==C;){const w=Wi(j),S=j.getBoundingClientRect(),E=Vr(j),N=S.left+(j.clientLeft+parseFloat(E.paddingLeft))*w.x,R=S.top+(j.clientTop+parseFloat(E.paddingTop))*w.y;p*=w.x,m*=w.y,h*=w.x,x*=w.y,p+=N,m+=R,C=hr(j),j=rh(C)}}return Qu({width:h,height:x,x:p,y:m})}function Dd(e,t){const n=Ad(e).scrollLeft;return t?t.left+n:zo(ps(e)).left+n}function Bk(e,t){const n=e.getBoundingClientRect(),s=n.left+t.scrollLeft-Dd(e,n),i=n.top+t.scrollTop;return{x:s,y:i}}function pD(e){let{elements:t,rect:n,offsetParent:s,strategy:i}=e;const l=i==="fixed",c=ps(s),u=t?Rd(t.floating):!1;if(s===c||u&&l)return n;let p={scrollLeft:0,scrollTop:0},m=as(1);const h=as(0),x=As(s);if((x||!x&&!l)&&((aa(s)!=="body"||Yl(c))&&(p=Ad(s)),x)){const b=zo(s);m=Wi(s),h.x=b.x+s.clientLeft,h.y=b.y+s.clientTop}const y=c&&!x&&!l?Bk(c,p):as(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 mD(e){return Array.from(e.getClientRects())}function hD(e){const t=ps(e),n=Ad(e),s=e.ownerDocument.body,i=fr(t.scrollWidth,t.clientWidth,s.scrollWidth,s.clientWidth),l=fr(t.scrollHeight,t.clientHeight,s.scrollHeight,s.clientHeight);let c=-n.scrollLeft+Dd(e);const u=-n.scrollTop;return Vr(s).direction==="rtl"&&(c+=fr(t.clientWidth,s.clientWidth)-i),{width:i,height:l,x:c,y:u}}const Cv=25;function gD(e,t){const n=hr(e),s=ps(e),i=n.visualViewport;let l=s.clientWidth,c=s.clientHeight,u=0,p=0;if(i){l=i.width,c=i.height;const h=yg();(!h||h&&t==="fixed")&&(u=i.offsetLeft,p=i.offsetTop)}const m=Dd(s);if(m<=0){const h=s.ownerDocument,x=h.body,y=getComputedStyle(x),b=h.compatMode==="CSS1Compat"&&parseFloat(y.marginLeft)+parseFloat(y.marginRight)||0,C=Math.abs(s.clientWidth-x.clientWidth-b);C<=Cv&&(l-=C)}else m<=Cv&&(l+=m);return{width:l,height:c,x:u,y:p}}function xD(e,t){const n=zo(e,!0,t==="fixed"),s=n.top+e.clientTop,i=n.left+e.clientLeft,l=As(e)?Wi(e):as(1),c=e.clientWidth*l.x,u=e.clientHeight*l.y,p=i*l.x,m=s*l.y;return{width:c,height:u,x:p,y:m}}function Ev(e,t,n){let s;if(t==="viewport")s=gD(e,n);else if(t==="document")s=hD(ps(e));else if(Ur(t))s=xD(t,n);else{const i=zk(e);s={x:t.x-i.x,y:t.y-i.y,width:t.width,height:t.height}}return Qu(s)}function Uk(e,t){const n=oo(e);return n===t||!Ur(n)||ea(n)?!1:Vr(n).position==="fixed"||Uk(n,t)}function yD(e,t){const n=t.get(e);if(n)return n;let s=$l(e,[],!1).filter(u=>Ur(u)&&aa(u)!=="body"),i=null;const l=Vr(e).position==="fixed";let c=l?oo(e):e;for(;Ur(c)&&!ea(c);){const u=Vr(c),p=xg(c);!p&&u.position==="fixed"&&(i=null),(l?!p&&!i:!p&&u.position==="static"&&!!i&&(i.position==="absolute"||i.position==="fixed")||Yl(c)&&!p&&Uk(e,c))?s=s.filter(h=>h!==c):i=u,c=oo(c)}return t.set(e,s),s}function bD(e){let{element:t,boundary:n,rootBoundary:s,strategy:i}=e;const c=[...n==="clippingAncestors"?Rd(t)?[]:yD(t,this._c):[].concat(n),s],u=Ev(t,c[0],i);let p=u.top,m=u.right,h=u.bottom,x=u.left;for(let y=1;y<c.length;y++){const b=Ev(t,c[y],i);p=fr(b.top,p),m=so(b.right,m),h=so(b.bottom,h),x=fr(b.left,x)}return{width:m-x,height:h-p,x,y:p}}function vD(e){const{width:t,height:n}=Fk(e);return{width:t,height:n}}function wD(e,t,n){const s=As(t),i=ps(t),l=n==="fixed",c=zo(e,!0,l,t);let u={scrollLeft:0,scrollTop:0};const p=as(0);function m(){p.x=Dd(i)}if(s||!s&&!l)if((aa(t)!=="body"||Yl(i))&&(u=Ad(t)),s){const b=zo(t,!0,l,t);p.x=b.x+t.clientLeft,p.y=b.y+t.clientTop}else i&&m();l&&!s&&i&&m();const h=i&&!s&&!l?Bk(i,u):as(0),x=c.left+u.scrollLeft-p.x-h.x,y=c.top+u.scrollTop-p.y-h.y;return{x,y,width:c.width,height:c.height}}function dm(e){return Vr(e).position==="static"}function Tv(e,t){if(!As(e)||Vr(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return ps(e)===n&&(n=n.ownerDocument.body),n}function Vk(e,t){const n=hr(e);if(Rd(e))return n;if(!As(e)){let i=oo(e);for(;i&&!ea(i);){if(Ur(i)&&!dm(i))return i;i=oo(i)}return n}let s=Tv(e,t);for(;s&&aD(s)&&dm(s);)s=Tv(s,t);return s&&ea(s)&&dm(s)&&!xg(s)?n:s||uD(e)||n}const jD=async function(e){const t=this.getOffsetParent||Vk,n=this.getDimensions,s=await n(e.floating);return{reference:wD(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:s.width,height:s.height}}};function kD(e){return Vr(e).direction==="rtl"}const SD={convertOffsetParentRelativeRectToViewportRelativeRect:pD,getDocumentElement:ps,getClippingRect:bD,getOffsetParent:Vk,getElementRects:jD,getClientRects:mD,getDimensions:vD,getScale:Wi,isElement:Ur,isRTL:kD};function Hk(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function ND(e,t){let n=null,s;const i=ps(e);function l(){var u;clearTimeout(s),(u=n)==null||u.disconnect(),n=null}function c(u,p){u===void 0&&(u=!1),p===void 0&&(p=1),l();const m=e.getBoundingClientRect(),{left:h,top:x,width:y,height:b}=m;if(u||t(),!y||!b)return;const C=xu(x),j=xu(i.clientWidth-(h+y)),w=xu(i.clientHeight-(x+b)),S=xu(h),N={rootMargin:-C+"px "+-j+"px "+-w+"px "+-S+"px",threshold:fr(0,so(1,p))||1};let R=!0;function I(P){const $=P[0].intersectionRatio;if($!==p){if(!R)return c();$?c(!1,$):s=setTimeout(()=>{c(!1,1e-7)},1e3)}$===1&&!Hk(m,e.getBoundingClientRect())&&c(),R=!1}try{n=new IntersectionObserver(I,{...N,root:i.ownerDocument})}catch{n=new IntersectionObserver(I,N)}n.observe(e)}return c(!0),l}function CD(e,t,n,s){s===void 0&&(s={});const{ancestorScroll:i=!0,ancestorResize:l=!0,elementResize:c=typeof ResizeObserver=="function",layoutShift:u=typeof IntersectionObserver=="function",animationFrame:p=!1}=s,m=bg(e),h=i||l?[...m?$l(m):[],...t?$l(t):[]]:[];h.forEach(S=>{i&&S.addEventListener("scroll",n,{passive:!0}),l&&S.addEventListener("resize",n)});const x=m&&u?ND(m,n):null;let y=-1,b=null;c&&(b=new ResizeObserver(S=>{let[E]=S;E&&E.target===m&&b&&t&&(b.unobserve(t),cancelAnimationFrame(y),y=requestAnimationFrame(()=>{var N;(N=b)==null||N.observe(t)})),n()}),m&&!p&&b.observe(m),t&&b.observe(t));let C,j=p?zo(e):null;p&&w();function w(){const S=zo(e);j&&!Hk(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=b)==null||S.disconnect(),b=null,p&&cancelAnimationFrame(C)}}const ED=rD,TD=sD,PD=eD,RD=iD,AD=tD,Pv=ZA,DD=oD,LD=(e,t,n)=>{const s=new Map,i={platform:SD,...n},l={...i.platform,_c:s};return QA(e,t,{...i,platform:l})};var $D=typeof document<"u",ID=function(){},Ou=$D?f.useLayoutEffect:ID;function Zu(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(!Zu(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)&&!Zu(e[l],t[l]))return!1}return!0}return e!==e&&t!==t}function Wk(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Rv(e,t){const n=Wk(e);return Math.round(t*n)/n}function fm(e){const t=f.useRef(e);return Ou(()=>{t.current=e}),t}function OD(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:s=[],platform:i,elements:{reference:l,floating:c}={},transform:u=!0,whileElementsMounted:p,open:m}=e,[h,x]=f.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[y,b]=f.useState(s);Zu(y,s)||b(s);const[C,j]=f.useState(null),[w,S]=f.useState(null),E=f.useCallback(W=>{W!==P.current&&(P.current=W,j(W))},[]),N=f.useCallback(W=>{W!==$.current&&($.current=W,S(W))},[]),R=l||C,I=c||w,P=f.useRef(null),$=f.useRef(null),D=f.useRef(h),X=p!=null,Z=fm(p),z=fm(i),U=fm(m),J=f.useCallback(()=>{if(!P.current||!$.current)return;const W={placement:t,strategy:n,middleware:y};z.current&&(W.platform=z.current),LD(P.current,$.current,W).then(ne=>{const T={...ne,isPositioned:U.current!==!1};_.current&&!Zu(D.current,T)&&(D.current=T,Ns.flushSync(()=>{x(T)}))})},[y,t,n,z,U]);Ou(()=>{m===!1&&D.current.isPositioned&&(D.current.isPositioned=!1,x(W=>({...W,isPositioned:!1})))},[m]);const _=f.useRef(!1);Ou(()=>(_.current=!0,()=>{_.current=!1}),[]),Ou(()=>{if(R&&(P.current=R),I&&($.current=I),R&&I){if(Z.current)return Z.current(R,I,J);J()}},[R,I,J,Z,X]);const G=f.useMemo(()=>({reference:P,floating:$,setReference:E,setFloating:N}),[E,N]),Q=f.useMemo(()=>({reference:R,floating:I}),[R,I]),le=f.useMemo(()=>{const W={position:n,left:0,top:0};if(!Q.floating)return W;const ne=Rv(Q.floating,h.x),T=Rv(Q.floating,h.y);return u?{...W,transform:"translate("+ne+"px, "+T+"px)",...Wk(Q.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:ne,top:T}},[n,u,Q.floating,h.x,h.y]);return f.useMemo(()=>({...h,update:J,refs:G,elements:Q,floatingStyles:le}),[h,J,G,Q,le])}const MD=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?Pv({element:s.current,padding:i}).fn(n):{}:s?Pv({element:s,padding:i}).fn(n):{}}}},_D=(e,t)=>{const n=ED(e);return{name:n.name,fn:n.fn,options:[e,t]}},FD=(e,t)=>{const n=TD(e);return{name:n.name,fn:n.fn,options:[e,t]}},zD=(e,t)=>({fn:DD(e).fn,options:[e,t]}),BD=(e,t)=>{const n=PD(e);return{name:n.name,fn:n.fn,options:[e,t]}},UD=(e,t)=>{const n=RD(e);return{name:n.name,fn:n.fn,options:[e,t]}},VD=(e,t)=>{const n=AD(e);return{name:n.name,fn:n.fn,options:[e,t]}},HD=(e,t)=>{const n=MD(e);return{name:n.name,fn:n.fn,options:[e,t]}};var WD="Arrow",Kk=f.forwardRef((e,t)=>{const{children:n,width:s=10,height:i=5,...l}=e;return r.jsx(rn.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"})})});Kk.displayName=WD;var KD=Kk;function qD(e){const[t,n]=f.useState(void 0);return ro(()=>{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,u;if("borderBoxSize"in l){const p=l.borderBoxSize,m=Array.isArray(p)?p[0]:p;c=m.inlineSize,u=m.blockSize}else c=e.offsetWidth,u=e.offsetHeight;n({width:c,height:u})});return s.observe(e,{box:"border-box"}),()=>s.unobserve(e)}else n(void 0)},[e]),t}var vg="Popper",[qk,Gk]=Vo(vg),[GD,Yk]=qk(vg),Jk=e=>{const{__scopePopper:t,children:n}=e,[s,i]=f.useState(null);return r.jsx(GD,{scope:t,anchor:s,onAnchorChange:i,children:n})};Jk.displayName=vg;var Xk="PopperAnchor",Qk=f.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:s,...i}=e,l=Yk(Xk,n),c=f.useRef(null),u=Rn(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(rn.div,{...i,ref:u})});Qk.displayName=Xk;var wg="PopperContent",[YD,JD]=qk(wg),Zk=f.forwardRef((e,t)=>{var re,me,ve,Se,fe,He;const{__scopePopper:n,side:s="bottom",sideOffset:i=0,align:l="center",alignOffset:c=0,arrowPadding:u=0,avoidCollisions:p=!0,collisionBoundary:m=[],collisionPadding:h=0,sticky:x="partial",hideWhenDetached:y=!1,updatePositionStrategy:b="optimized",onPlaced:C,...j}=e,w=Yk(wg,n),[S,E]=f.useState(null),N=Rn(t,pe=>E(pe)),[R,I]=f.useState(null),P=qD(R),$=(P==null?void 0:P.width)??0,D=(P==null?void 0:P.height)??0,X=s+(l!=="center"?"-"+l:""),Z=typeof h=="number"?h:{top:0,right:0,bottom:0,left:0,...h},z=Array.isArray(m)?m:[m],U=z.length>0,J={padding:Z,boundary:z.filter(QD),altBoundary:U},{refs:_,floatingStyles:G,placement:Q,isPositioned:le,middlewareData:W}=OD({strategy:"fixed",placement:X,whileElementsMounted:(...pe)=>CD(...pe,{animationFrame:b==="always"}),elements:{reference:w.anchor},middleware:[_D({mainAxis:i+D,alignmentAxis:c}),p&&FD({mainAxis:!0,crossAxis:!1,limiter:x==="partial"?zD():void 0,...J}),p&&BD({...J}),UD({...J,apply:({elements:pe,rects:Pe,availableWidth:V,availableHeight:H})=>{const{width:ae,height:he}=Pe.reference,Ae=pe.floating.style;Ae.setProperty("--radix-popper-available-width",`${V}px`),Ae.setProperty("--radix-popper-available-height",`${H}px`),Ae.setProperty("--radix-popper-anchor-width",`${ae}px`),Ae.setProperty("--radix-popper-anchor-height",`${he}px`)}}),R&&HD({element:R,padding:u}),ZD({arrowWidth:$,arrowHeight:D}),y&&VD({strategy:"referenceHidden",...J})]}),[ne,T]=n1(Q),O=_o(C);ro(()=>{le&&(O==null||O())},[le,O]);const q=(re=W.arrow)==null?void 0:re.x,L=(me=W.arrow)==null?void 0:me.y,ee=((ve=W.arrow)==null?void 0:ve.centerOffset)!==0,[de,F]=f.useState();return ro(()=>{S&&F(window.getComputedStyle(S).zIndex)},[S]),r.jsx("div",{ref:_.setFloating,"data-radix-popper-content-wrapper":"",style:{...G,transform:le?G.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:de,"--radix-popper-transform-origin":[(Se=W.transformOrigin)==null?void 0:Se.x,(fe=W.transformOrigin)==null?void 0:fe.y].join(" "),...((He=W.hide)==null?void 0:He.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:r.jsx(YD,{scope:n,placedSide:ne,onArrowChange:I,arrowX:q,arrowY:L,shouldHideArrow:ee,children:r.jsx(rn.div,{"data-side":ne,"data-align":T,...j,ref:N,style:{...j.style,animation:le?void 0:"none"}})})})});Zk.displayName=wg;var e1="PopperArrow",XD={top:"bottom",right:"left",bottom:"top",left:"right"},t1=f.forwardRef(function(t,n){const{__scopePopper:s,...i}=t,l=JD(e1,s),c=XD[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(KD,{...i,ref:n,style:{...i.style,display:"block"}})})});t1.displayName=e1;function QD(e){return e!==null}var ZD=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,u=c?0:e.arrowWidth,p=c?0:e.arrowHeight,[m,h]=n1(n),x={start:"0%",center:"50%",end:"100%"}[h],y=(((S=i.arrow)==null?void 0:S.x)??0)+u/2,b=(((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:`${b}px`):m==="left"&&(C=`${s.floating.width+p}px`,j=c?x:`${b}px`),{data:{x:C,y:j}}}});function n1(e){const[t,n="center"]=e.split("-");return[t,n]}var e4=Jk,t4=Qk,n4=Zk,r4=t1,s4=Symbol("radix.slottable");function o4(e){const t=({children:n})=>r.jsx(r.Fragment,{children:n});return t.displayName=`${e}.Slottable`,t.__radixId=s4,t}var i4=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"}),a4="VisuallyHidden",r1=f.forwardRef((e,t)=>r.jsx(rn.span,{...e,ref:t,style:{...i4,...e.style}}));r1.displayName=a4;var l4=r1,[Ld]=Vo("Tooltip",[Gk]),$d=Gk(),s1="TooltipProvider",c4=700,sh="tooltip.open",[u4,jg]=Ld(s1),o1=e=>{const{__scopeTooltip:t,delayDuration:n=c4,skipDelayDuration:s=300,disableHoverableContent:i=!1,children:l}=e,c=f.useRef(!0),u=f.useRef(!1),p=f.useRef(0);return f.useEffect(()=>{const m=p.current;return()=>window.clearTimeout(m)},[]),r.jsx(u4,{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:u,onPointerInTransitChange:f.useCallback(m=>{u.current=m},[]),disableHoverableContent:i,children:l})};o1.displayName=s1;var Il="Tooltip",[d4,Jl]=Ld(Il),i1=e=>{const{__scopeTooltip:t,children:n,open:s,defaultOpen:i,onOpenChange:l,disableHoverableContent:c,delayDuration:u}=e,p=jg(Il,e.__scopeTooltip),m=$d(t),[h,x]=f.useState(null),y=Bi(),b=f.useRef(0),C=c??p.disableHoverableContent,j=u??p.delayDuration,w=f.useRef(!1),[S,E]=Sd({prop:s,defaultProp:i??!1,onChange:$=>{$?(p.onOpen(),document.dispatchEvent(new CustomEvent(sh))):p.onClose(),l==null||l($)},caller:Il}),N=f.useMemo(()=>S?w.current?"delayed-open":"instant-open":"closed",[S]),R=f.useCallback(()=>{window.clearTimeout(b.current),b.current=0,w.current=!1,E(!0)},[E]),I=f.useCallback(()=>{window.clearTimeout(b.current),b.current=0,E(!1)},[E]),P=f.useCallback(()=>{window.clearTimeout(b.current),b.current=window.setTimeout(()=>{w.current=!0,E(!0),b.current=0},j)},[j,E]);return f.useEffect(()=>()=>{b.current&&(window.clearTimeout(b.current),b.current=0)},[]),r.jsx(e4,{...m,children:r.jsx(d4,{scope:t,contentId:y,open:S,stateAttribute:N,trigger:h,onTriggerChange:x,onTriggerEnter:f.useCallback(()=>{p.isOpenDelayedRef.current?P():R()},[p.isOpenDelayedRef,P,R]),onTriggerLeave:f.useCallback(()=>{C?I():(window.clearTimeout(b.current),b.current=0)},[I,C]),onOpen:R,onClose:I,disableHoverableContent:C,children:n})})};i1.displayName=Il;var oh="TooltipTrigger",a1=f.forwardRef((e,t)=>{const{__scopeTooltip:n,...s}=e,i=Jl(oh,n),l=jg(oh,n),c=$d(n),u=f.useRef(null),p=Rn(t,u,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(t4,{asChild:!0,...c,children:r.jsx(rn.button,{"aria-describedby":i.open?i.contentId:void 0,"data-state":i.stateAttribute,...s,ref:p,onPointerMove:Mt(e.onPointerMove,y=>{y.pointerType!=="touch"&&!h.current&&!l.isPointerInTransitRef.current&&(i.onTriggerEnter(),h.current=!0)}),onPointerLeave:Mt(e.onPointerLeave,()=>{i.onTriggerLeave(),h.current=!1}),onPointerDown:Mt(e.onPointerDown,()=>{i.open&&i.onClose(),m.current=!0,document.addEventListener("pointerup",x,{once:!0})}),onFocus:Mt(e.onFocus,()=>{m.current||i.onOpen()}),onBlur:Mt(e.onBlur,i.onClose),onClick:Mt(e.onClick,i.onClose)})})});a1.displayName=oh;var kg="TooltipPortal",[f4,p4]=Ld(kg,{forceMount:void 0}),l1=e=>{const{__scopeTooltip:t,forceMount:n,children:s,container:i}=e,l=Jl(kg,t);return r.jsx(f4,{scope:t,forceMount:n,children:r.jsx(Ho,{present:n||l.open,children:r.jsx(Jh,{asChild:!0,container:i,children:s})})})};l1.displayName=kg;var ta="TooltipContent",c1=f.forwardRef((e,t)=>{const n=p4(ta,e.__scopeTooltip),{forceMount:s=n.forceMount,side:i="top",...l}=e,c=Jl(ta,e.__scopeTooltip);return r.jsx(Ho,{present:s||c.open,children:c.disableHoverableContent?r.jsx(u1,{side:i,...l,ref:t}):r.jsx(m4,{side:i,...l,ref:t})})}),m4=f.forwardRef((e,t)=>{const n=Jl(ta,e.__scopeTooltip),s=jg(ta,e.__scopeTooltip),i=f.useRef(null),l=Rn(t,i),[c,u]=f.useState(null),{trigger:p,onClose:m}=n,h=i.current,{onPointerInTransitChange:x}=s,y=f.useCallback(()=>{u(null),x(!1)},[x]),b=f.useCallback((C,j)=>{const w=C.currentTarget,S={x:C.clientX,y:C.clientY},E=b4(S,w.getBoundingClientRect()),N=v4(S,E),R=w4(j.getBoundingClientRect()),I=k4([...N,...R]);u(I),x(!0)},[x]);return f.useEffect(()=>()=>y(),[y]),f.useEffect(()=>{if(p&&h){const C=w=>b(w,h),j=w=>b(w,p);return p.addEventListener("pointerleave",C),h.addEventListener("pointerleave",j),()=>{p.removeEventListener("pointerleave",C),h.removeEventListener("pointerleave",j)}}},[p,h,b,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=!j4(S,c);E?y():N&&(y(),m())};return document.addEventListener("pointermove",C),()=>document.removeEventListener("pointermove",C)}},[p,h,c,m,y]),r.jsx(u1,{...e,ref:l})}),[h4,g4]=Ld(Il,{isInside:!1}),x4=o4("TooltipContent"),u1=f.forwardRef((e,t)=>{const{__scopeTooltip:n,children:s,"aria-label":i,onEscapeKeyDown:l,onPointerDownOutside:c,...u}=e,p=Jl(ta,n),m=$d(n),{onClose:h}=p;return f.useEffect(()=>(document.addEventListener(sh,h),()=>document.removeEventListener(sh,h)),[h]),f.useEffect(()=>{if(p.trigger){const x=y=>{const b=y.target;b!=null&&b.contains(p.trigger)&&h()};return window.addEventListener("scroll",x,{capture:!0}),()=>window.removeEventListener("scroll",x,{capture:!0})}},[p.trigger,h]),r.jsx(Yh,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:l,onPointerDownOutside:c,onFocusOutside:x=>x.preventDefault(),onDismiss:h,children:r.jsxs(n4,{"data-state":p.stateAttribute,...m,...u,ref:t,style:{...u.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(x4,{children:s}),r.jsx(h4,{scope:n,isInside:!0,children:r.jsx(l4,{id:p.contentId,role:"tooltip",children:i||s})})]})})});c1.displayName=ta;var d1="TooltipArrow",y4=f.forwardRef((e,t)=>{const{__scopeTooltip:n,...s}=e,i=$d(n);return g4(d1,n).isInside?null:r.jsx(r4,{...i,...s,ref:t})});y4.displayName=d1;function b4(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 v4(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 w4(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 j4(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 u=t[l],p=t[c],m=u.x,h=u.y,x=p.x,y=p.y;h>s!=y>s&&n<(x-m)*(s-h)/(y-h)+m&&(i=!i)}return i}function k4(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),S4(t)}function S4(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 N4=o1,C4=i1,E4=a1,T4=l1,f1=c1;const Mo=N4,Er=C4,Tr=E4,pr=f.forwardRef(({className:e,sideOffset:t=4,...n},s)=>r.jsx(T4,{children:r.jsx(f1,{ref:s,sideOffset:t,className:Re("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})}));pr.displayName=f1.displayName;function Sg({items:e,align:t="end"}){const[n,s]=f.useState(!1),i=f.useRef(null);return f.useEffect(()=>{if(!n)return;function l(u){i.current&&!i.current.contains(u.target)&&s(!1)}function c(u){u.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(fT,{className:"h-4 w-4"})}),n&&r.jsx("div",{className:Re("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(Mo,{delayDuration:200,children:e.map(l=>{const c=l.icon,u=Re("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:u,children:p})});return l.disabledReason?r.jsxs(Er,{children:[r.jsx(Tr,{asChild:!0,children:m}),r.jsx(pr,{side:"left",children:l.disabledReason})]},l.key):r.jsx("div",{children:m},l.key)}return l.href?r.jsx(Ee,{to:l.href,className:u,onClick:()=>s(!1),children:p},l.key):r.jsx("button",{type:"button",className:u,onClick:()=>{var m;(m=l.onSelect)==null||m.call(l),s(!1)},children:p},l.key)})})})]})}function Av(e){const t=Date.parse(e);return Number.isNaN(t)?!1:Date.now()-t>10080*60*1e3}function Ng(e,t,n={}){const{workspace:s,search:i}=n,l=it(t.status),c=it(t.priority),u=it(t.type),p=it(t.assignee),m=it(t.project),{activity:h}=t;if(s){if(s==="_ungrouped"){if(e.projectWorkspace!=null)return!1}else if(e.projectWorkspace!==s)return!1}if(l.length&&!l.includes(e.status)||c.length&&!c.includes(e.priority)||u.length&&!u.includes(e.type??"")||h==="stale"&&!Av(e.updated)||h==="fresh"&&Av(e.updated))return!1;if(p.length){const x=e.assignee??"__unassigned__";if(!p.includes(x))return!1}if(m.length&&!m.some(y=>y==="__standalone__"?e.projectSlug==null:e.projectSlug===y))return!1;if(i){const x=i.trim().toLowerCase();if(x&&!`${e.title??""} ${e.slug??""} ${e.projectTitle??"standalone"} ${e.projectSlug??""}`.toLowerCase().includes(x))return!1}return!0}function p1(e){return e.projectSlug===null?`/assignments/${e.id}`:`${e.projectWorkspace?`/w/${e.projectWorkspace}`:""}/projects/${e.projectSlug}/assignments/${e.slug}`}const m1={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 yl=null,$o=null;function P4(){return yl?Promise.resolve(yl):$o||($o=fetch("/api/config/statuses").then(e=>{if(!e.ok)throw new Error(`HTTP ${e.status}`);return e.json()}).then(e=>(yl=e,$o=null,e)).catch(()=>($o=null,m1)),$o)}function Wo(){const[e,t]=f.useState(()=>yl??m1);return f.useEffect(()=>{P4().then(t)},[]),e}function Dv(){yl=null,$o=null}function Xl(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 Lv={critical:0,high:1,medium:2,low:3};function Cg(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=(Lv[i.priority]??99)-(Lv[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 ct({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 ih='a, button, input, select, textarea, [contenteditable="true"], [role="button"], [data-no-drag]';function Id({columns:e,items:t,getItemId:n,getColumnId:s,renderCard:i,canDrop:l,onMove:c,getExternalDragData:u,onCardContextMenu:p,emptyMessage:m="No cards in this column.",hiddenColumnIds:h,onHideColumn:x,compact:y=!1,dragDisabled:b=!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,R]=f.useState(null),I=f.useRef(null),P=f.useMemo(()=>new Map(t.map(_=>[n(_),_])),[n,t]),$=f.useMemo(()=>j.map(_=>({column:_,items:t.filter(G=>s(G)===_.id)})),[j,s,t]),D=S?P.get(S)??null:null;function X(_){if(!D)return{allowed:!1};const G=s(D);return(l==null?void 0:l({item:D,fromColumnId:G,toColumnId:_}))??{allowed:!0}}function Z(){E(null),R(null)}function z(_,G,Q){if(b)return;const le=(u==null?void 0:u(G))??null;!c&&!le||(_.dataTransfer.effectAllowed="move",_.dataTransfer.setData("text/plain",Q),le&&_.dataTransfer.setData("application/json",JSON.stringify(le)),c&&E(Q))}function U(_,G,Q){b||!c||!D||!X(G).allowed||(_.preventDefault(),_.dataTransfer.dropEffect="move",R(W=>(W==null?void 0:W.columnId)===G&&W.index===Q?W:{columnId:G,index:Q}))}async function J(_,G,Q){var O;if(_.preventDefault(),b||!c||!D){Z();return}const le=s(D),ne=(((O=$.find(q=>q.column.id===le))==null?void 0:O.items)??[]).findIndex(q=>n(q)===n(D));if(!X(G).allowed||ne<0){Z();return}if(le===G&&(Q===ne||Q===ne+1)){Z();return}try{await c({item:D,fromColumnId:le,toColumnId:G,fromIndex:ne,toIndex:Q})}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:Re("grid min-w-max grid-flow-col gap-4",y?"auto-cols-[minmax(200px,240px)]":"auto-cols-[minmax(260px,320px)]"),children:$.map(({column:_,items:G})=>{const Q=X(_.id),le=(N==null?void 0:N.columnId)===_.id;return r.jsxs("section",{className:Re("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&&!Q.allowed?"border-dashed opacity-65":"",D&&Q.allowed?"border-primary/30 bg-accent/30":"",le?"ring-2 ring-ring/30":""),title:D&&!Q.allowed?Q.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:Re("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:G.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:W=>U(W,_.id,G.length),onDrop:W=>J(W,_.id,G.length),children:[G.length===0?b?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(R4,{active:(N==null?void 0:N.columnId)===_.id&&N.index===0,disabled:!!D&&!Q.allowed,children:typeof m=="function"?m(_):m}):null,G.map((W,ne)=>{const T=n(W),O=S===T;return r.jsxs(f.Fragment,{children:[r.jsx("div",{className:Re("h-2 rounded-full transition",(N==null?void 0:N.columnId)===_.id&&N.index===ne?"bg-primary/70":"bg-transparent"),onDragOver:q=>U(q,_.id,ne),onDrop:q=>J(q,_.id,ne)}),r.jsx("div",{draggable:!b&&!!(c||u),onMouseDown:q=>{I.current=q.target},onDragStart:q=>{const L=I.current;if(L!=null&&L.closest(ih)){q.preventDefault();return}z(q,W,T)},onDragEnd:Z,onContextMenu:q=>{if(!p)return;const L=q.target;L!=null&&L.closest(ih)||p(W,q)},className:Re("transition",!b&&(c||u)?"cursor-grab active:cursor-grabbing":"",O?"scale-[0.98] opacity-50":""),children:i(W,{dragging:O})})]},T)}),G.length>0&&!b?r.jsx("div",{className:Re("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===G.length?"border-primary/50 bg-primary/10 text-foreground":"border-border/60",D&&!Q.allowed?"opacity-40":""),children:"Drop here to place at the end"}):null]})]},_.id)})})]})}function R4({active:e,disabled:t,children:n}){return r.jsx("div",{className:Re("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 hl="border-status-pending-foreground/30 bg-status-pending text-status-pending-foreground",pm="border-status-in-progress-foreground/30 bg-status-in-progress text-status-in-progress-foreground",A4="border-status-blocked-foreground/30 bg-status-blocked text-status-blocked-foreground",D4="border-status-review-foreground/30 bg-status-review text-status-review-foreground",L4="border-status-completed-foreground/30 bg-status-completed text-status-completed-foreground",$4="border-status-failed-foreground/30 bg-status-failed text-status-failed-foreground",I4="border-status-archived-foreground/30 bg-status-archived text-status-archived-foreground",ed={draft:{label:"Draft",description:"Just-created stub; not yet shaped.",className:hl,icon:Bo},pending:{label:"Pending",description:"Waiting to start or waiting on dependencies.",className:hl,icon:aT},ready_for_planning:{label:"Ready for Planning",description:"Objective and acceptance criteria written; awaiting a plan.",className:hl,icon:Fj},ready_to_implement:{label:"Ready to Implement",description:"Plan written and approved; ready to start coding.",className:pm,icon:ST},in_progress:{label:"In Progress",description:"Actively being worked on.",className:pm,icon:_h},blocked:{label:"Blocked",description:"Blocked by an explicit obstacle that needs intervention.",className:A4,icon:Hm},review:{label:"Review",description:"Ready for inspection or approval.",className:D4,icon:ET},completed:{label:"Completed",description:"Finished successfully.",className:L4,icon:Ih},failed:{label:"Failed",description:"Could not be completed as planned.",className:$4,icon:Hm},active:{label:"Active",description:"The project has active or review work in flight.",className:pm,icon:Wm},stopped:{label:"Stopped",description:"Session ended without completing.",className:hl,icon:oT},archived:{label:"Archived",description:"Archived by a human override.",className:I4,icon:Wm}};function td(e){const t=ed[e];return t||{className:hl,icon:Wm,label:e.replace(/_/g," ").replace(/\b\w/g,n=>n.toUpperCase()),description:`Status: ${e}`}}function h1(e,t){return Re("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)]",td(e).className,t)}function Nn({status:e,className:t,showIcon:n=!0,progress:s}){const i=td(e),l=i.icon,c=s&&s.total>0,u=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-u)})]}),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:h1(e,t),children:[m,r.jsx("span",{children:i.label})]})}function Od(e){var t;return((t=ed[e])==null?void 0:t.description)??`Status: ${e}`}function Rr({value:e,label:t,disabled:n=!1,disabledReason:s,onError:i}){const[l,c]=f.useState(!1);async function u(){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(Pl,{className:"h-3 w-3","aria-hidden":"true"})}):r.jsx("button",{type:"button",onClick:u,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(lo,{className:"h-3 w-3 text-status-completed-foreground","aria-hidden":"true"}):r.jsx(Pl,{className:"h-3 w-3","aria-hidden":"true"})})}const $v={critical:0,high:1,medium:2,low:3};function O4(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=($v[i.priority]??99)-($v[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 M4(e){return e.projectSlug===null?`/assignments/${e.id}`:`${e.projectWorkspace?`/w/${e.projectWorkspace}`:""}/projects/${e.projectSlug}/assignments/${e.slug}`}function _4({items:e,statusOrder:t,sortField:n,sortDirection:s,listSectionVisibility:i,compact:l=!1}){const c=Wo(),[u,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:Re("space-y-2",l?"space-y-1.5":"space-y-3"),children:t.map(h=>{const x=O4(e.filter(C=>C.status===h),n,s);if(x.length===0)return null;const y=!u.has(h),b=Xl(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:Re("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(no,{className:Re("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:b}),r.jsx("span",{className:Re("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:Re("divide-y divide-border/40 border-t border-border/40",l?"text-xs":"text-sm"),children:x.map(C=>{const j=M4(C);return r.jsx("li",{children:r.jsxs(Ee,{to:j,className:Re("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:gr(C.updated)})]})},`${C.projectSlug??"standalone"}:${C.id}`)})})]},h)})})}const Iv={critical:0,high:1,medium:2,low:3};function F4(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=(Iv[i.priority]??99)-(Iv[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 z4(e){return e.projectSlug===null?`/assignments/${e.id}`:`${e.projectWorkspace?`/w/${e.projectWorkspace}`:""}/projects/${e.projectSlug}/assignments/${e.slug}`}function B4({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),u=F4(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:Re("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:Re("font-medium",p),children:"Assignment"}):null,c("status")?r.jsx("th",{className:Re("font-medium",p),children:"Status"}):null,c("priority")?r.jsx("th",{className:Re("font-medium",p),children:"Priority"}):null,c("assignee")?r.jsx("th",{className:Re("font-medium",p),children:"Assignee"}):null,c("dependencies")?r.jsx("th",{className:Re("font-medium",p),children:"Dependencies"}):null,c("updated")?r.jsx("th",{className:Re("font-medium",p),children:"Updated"}):null]})}),r.jsx("tbody",{children:u.map(h=>{const x=z4(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(Nn,{status:h.status})}):null,c("priority")?r.jsx("td",{className:Re("capitalize text-muted-foreground",p),children:h.priority}):null,c("assignee")?r.jsx("td",{className:Re("text-muted-foreground",p),children:h.assignee??"Unassigned"}):null,c("dependencies")?r.jsx("td",{className:Re("text-muted-foreground",p),children:h.dependsOn.length}):null,c("updated")?r.jsx("td",{className:Re("text-muted-foreground",p),children:gr(h.updated)}):null]},y)})})]})})}function U4(e,t,n){return e.filter(s=>Ng(s,t,{workspace:n}))}function V4({viewId:e,onPickAnother:t}){const{view:n,loading:s,error:i,refetch:l}=Zi(e),{data:c,loading:u,error:p}=wd(),m=Wo(),h=f.useMemo(()=>m.order.map(y=>({id:y,title:Xl(m,y),description:Od(y)})),[m]),x=f.useMemo(()=>{if(!n||!c)return[];const y=U4(c.assignments,n.config.filters,n.workspace);return Cg(y,n.config.sortField,n.config.sortDirection)},[c,n]);if(s||u&&!c)return r.jsx(dt,{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(ct,{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(Id,{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(H4,{item:y})});case"list":return r.jsx(_4,{items:x,statusOrder:m.order,sortField:n.config.sortField,sortDirection:n.config.sortDirection,listSectionVisibility:n.config.listSectionVisibility,compact:!0});case"table":return r.jsx(B4,{items:x,sortField:n.config.sortField,sortDirection:n.config.sortDirection,tableColumnVisibility:n.config.tableColumnVisibility,compact:!0})}}function H4({item:e}){const t=p1(e);return r.jsxs("div",{className:Re("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(Nn,{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:gr(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(Rr,{value:e.id})]}):null]})}function W4({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:Oo.recentSessionsEmptyTitle}),r.jsx("p",{className:"mt-1 text-muted-foreground",children:Oo.recentSessionsEmptyHint})]}):r.jsx("ul",{className:"divide-y divide-border/40",children:e.map(t=>r.jsx("li",{children:r.jsx(K4,{session:t})},t.sessionId))})]})}function K4({session:e}){const t=Xt(),[n,s]=f.useState(!1),i=q4(e,t),l=G4(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," · ",Zj(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:Oo.recentSessionsCopyFallbackHint})]}):null]}),r.jsx(Rr,{value:e.path,label:Oo.recentSessionsCopyPathLabel,disabled:c,disabledReason:Oo.recentSessionsCopyPathDisabled,onError:()=>s(!0)})]})}function q4(e,t){return e.projectSlug&&e.assignmentSlug?`${t}/projects/${e.projectSlug}/assignments/${e.assignmentSlug}`:(!e.projectSlug&&e.assignmentSlug,"/agent-sessions")}function G4(e){return e.assignmentSlug&&e.projectSlug?`${e.projectSlug}/${e.assignmentSlug}`:e.assignmentSlug?`standalone/${e.assignmentSlug}`:"standalone"}function Y4(){const{data:e,loading:t,error:n}=g0();return t&&!e?r.jsx(dt,{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(W4,{sessions:(e==null?void 0:e.sessions)??[]})}const J4=5;function X4(){const{data:e,loading:t,error:n}=h0();if(t&&!e)return r.jsx(dt,{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,J4);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,u=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:[u,"/",p," leased"]})]})},c.slug)})})]})}const g1={"saved-view":{title:"Saved view",icon:Uj,render:(e,t)=>e.kind!=="saved-view"?null:f.createElement(V4,{viewId:e.viewId,onPickAnother:t.onPickAnother})},"agent-sessions":{title:"Agent sessions",icon:hd,render:()=>f.createElement(Y4)},inventories:{title:"Inventories",icon:gd,render:()=>f.createElement(X4)}};function Q4({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(Kt,{className:"h-4 w-4"}),"Add widget"]})});const s=g1[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(Z4,{slot:e,fallback:s.title})})]}),r.jsx(Sg,{items:[{key:"replace",label:"Replace…",icon:NT,onSelect:t},{key:"remove",label:"Remove",icon:Mn,destructive:!0,onSelect:n}]})]}),r.jsx("div",{children:s.render(e.widget,{slotId:e.id,onPickAnother:t})})]})}function Z4({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}=Zi(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 eL=["agent-sessions","inventories"];function tL({open:e,onOpenChange:t,onSelect:n}){const{views:s,loading:i}=dg();function l(c){n(c),t(!1)}return r.jsx(Zn,{open:e,onOpenChange:t,children:r.jsxs(_n,{className:"max-w-xl",children:[r.jsxs(qr,{children:[r.jsx(Fn,{children:"Add a widget"}),r.jsx(fs,{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:eL.map(c=>{const u=g1[c],p=u.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:u.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 nL(){const{data:e,error:t,refetch:n}=kP(),{data:s}=f0(),{layout:i}=_A(),[l,c]=f.useState(!1),[u,p]=f.useState(null),[m,h]=f.useState(null);fo("list:overview"),$t({keys:"r",description:"Refresh",scope:"list:overview",handler:()=>{n()}});const x=f.useCallback(w=>{p(w),c(!0)},[]),y=f.useCallback(async w=>{h(null);try{await zA(w)}catch(S){h(S instanceof Error?S.message:String(S))}},[]),b=f.useCallback(w=>{if(u===null)return;const S=i.slots.map((E,N)=>N===u?{...E,widget:w}:E);p(null),y(S)},[i.slots,u,y]),C=f.useCallback(w=>{const S=i.slots.map((E,N)=>N===w?{...E,widget:null}:E);y(S)},[i.slots,y]),j={};if(e)for(const w of Object.keys(e.segments))for(const S of e.segments[w].items)j[S.id]=S;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"})]}),e?r.jsx(CA,{hero:e.hero,itemsById:j}):t?r.jsx(ht,{error:t}):r.jsx(dt,{label:"Loading overview…"}),e!=null&&e.firstRun?r.jsx(SA,{help:s}):null,m?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: ",m]}):null,r.jsx("div",{className:"grid grid-cols-1 gap-4 xl:grid-cols-2",children:i.slots.map((w,S)=>r.jsx(Q4,{slot:w,index:S,onReplace:()=>x(S),onRemove:()=>C(S)},w.id))}),e!=null&&e.serverStats?r.jsxs("p",{className:"flex items-center gap-2 text-xs text-muted-foreground",children:[r.jsx(Fh,{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(tL,{open:l,onOpenChange:w=>{c(w),w||p(null)},onSelect:b})]})}function rL({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 sL(){const{data:e,loading:t,error:n}=f0(),{openCheatsheet:s}=uo();return t?r.jsx(dt,{label:"Loading help…"}):n||!e?r.jsx(ht,{error:n||"Help content is unavailable."}):r.jsxs("div",{className:"space-y-5",children:[r.jsx(Be,{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. ",is("Mod+k")," opens the command palette."]})]})}),r.jsx(Be,{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(Be,{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(Iu,{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(Be,{title:"Core Concepts",children:[r.jsx("div",{className:"flex flex-wrap gap-2",children:e.coreConcepts.map(i=>r.jsx(rL,{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(Be,{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(Nn,{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(Be,{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(Be,{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(Be,{title:"CLI Quick Reference",children:r.jsx("div",{className:"grid gap-3 xl:grid-cols-2",children:e.commands.map(i=>r.jsx(Iu,{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(Be,{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(Be,{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(Iu,{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 Eg({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 Md=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(co,{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"})]}));Md.displayName="SearchInput";function _d({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","aria-pressed":e===s.value,onClick:()=>n(s.value),className:Re("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 oL={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"},Ov=["bg-primary","bg-secondary","bg-accent-coral","bg-accent-teal","bg-accent-amber"];function nd({progress:e,className:t,showLegend:n=!1}){const s=Wo(),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:oL[p]??Ov[c++%Ov.length]}))},[s.order,e]),l=i.filter(c=>(e[c.key]??0)>0);return r.jsxs("div",{className:Re("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:`${yn(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:Re("h-2 w-2 rounded-full",c.className)}),r.jsx("span",{children:yn(c.key)}),r.jsx("span",{className:"font-medium text-foreground",children:e[c.key]??0})]},c.key))}):null]})}const iL=["pending","active","blocked","failed","completed","archived"],Tg=iL,aL=["draft","pending","ready_for_planning","ready_to_implement","in_progress","blocked","review","completed","failed"];function x1(e){return e&&e.length>0?e:[...aL]}function lL(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 cL=220,yu=8;function y1({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,u=(c==null?void 0:c.offsetWidth)??cL,p=(c==null?void 0:c.offsetHeight)??0,m=Math.max(yu,window.innerWidth-u-yu),h=Math.max(yu,window.innerHeight-p-yu);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 u(m){m.key==="Escape"&&n()}function p(){n()}return document.addEventListener("mousedown",c),document.addEventListener("keydown",u),document.addEventListener("contextmenu",c),window.addEventListener("scroll",p,!0),()=>{document.removeEventListener("mousedown",c),document.removeEventListener("keydown",u),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(Mo,{delayDuration:200,children:t.map(c=>{const u=c.icon,p=Re("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:[u?r.jsx(u,{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(Er,{children:[r.jsx(Tr,{asChild:!0,children:h}),r.jsx(pr,{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 uL="__ungrouped__";function Pg({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:u}=vd(),[p,m]=f.useState(n),[h,x]=f.useState(!1),[y,b]=f.useState(null);f.useEffect(()=>{e&&(m(n),b(null))},[e,n]);const C=f.useMemo(()=>[...((c==null?void 0:c.workspaces)??[]).map(E=>({key:E,label:E,value:E})),{key:uL,label:"Ungrouped",value:null}],[c]),j=!h&&p!==n;async function w(){if(j){x(!0),b(null);try{await s(p),t(!1)}catch(S){b(S instanceof Error?S.message:"Failed to move item")}finally{x(!1)}}}return r.jsx(Zn,{open:e,onOpenChange:S=>h?void 0:t(S),children:r.jsxs(_n,{children:[r.jsxs(qr,{children:[r.jsx(Fn,{children:i}),r.jsx(fs,{children:l})]}),r.jsx("div",{className:"my-2 max-h-[320px] overflow-y-auto rounded-md border border-border/60",children:u&&C.length===0?r.jsxs("div",{className:"flex items-center gap-2 px-3 py-3 text-sm text-muted-foreground",children:[r.jsx(_h,{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:Re("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:Re("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(lo,{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(Ps,{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 Mv(){const{workspace:e}=Et(),t=Xt(),n=Ct(),{data:s,loading:i,error:l,refetch:c}=Uo(),u=f.useRef(null);fo("list:projects");const[p,m]=f.useState(""),[h,x]=f.useState("all"),[y,b]=f.useState("active"),[C,j]=f.useState("all"),[w,S]=f.useState("updated"),[E,N]=ds(),R=E.get("view"),I=R==="table"||R==="kanban"?R:"cards",P=T=>{N(O=>{const q=new URLSearchParams(O);return T==="cards"?q.delete("view"):q.set("view",T),q})},[$,D]=f.useState({}),[X,Z]=f.useState(null),[z,U]=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,O)=>pL(T,O,w)):[],[s,p,h,y,C,w,e]),_=J.map(T=>`${T.slug}:${T.status}`).join("|");f.useEffect(()=>{D(mL(J))},[_,w]);const G=f.useMemo(()=>{const T=new Map(J.map(O=>[O.slug,O]));return Tg.flatMap(O=>($[O]??J.filter(L=>L.status===O).map(L=>L.slug)).map(L=>T.get(L)).filter(L=>!!L))},[J,$]),{visibleItems:Q,visibleIndexByKey:le}=f.useMemo(()=>{const T=I==="kanban"?G:J,O=new Map;return T.forEach((q,L)=>O.set(q.slug,L)),{visibleItems:T,visibleIndexByKey:O}},[I,J,G]),{hotkeyRowProps:W}=Gl(Q,{scope:"list:projects",onOpen:T=>n(`${t}/projects/${T.slug}`)});if($t({keys:"/",scope:"list:projects",description:"Focus filter",handler:()=>{var T;return(T=u.current)==null?void 0:T.focus()}}),$t({keys:"r",scope:"list:projects",description:"Refresh",handler:()=>c()}),i)return r.jsx(dt,{label:"Loading projects…"});if(l||!s)return r.jsx(ht,{error:l||"Project list is unavailable."});const ne=Array.from(new Set(s.flatMap(T=>T.tags))).sort();return r.jsxs("div",{className:"space-y-5",children:[r.jsxs(Eg,{children:[r.jsx(Md,{ref:u,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=>b(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"}),ne.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(_d,{value:I,onChange:T=>P(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(ct,{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,O)=>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",...W(O),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 ",gr(T.updated)]})]}),r.jsx(Nn,{status:T.status})]}),r.jsxs("div",{className:"mt-4 space-y-3",children:[r.jsx(nd,{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(Be,{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,O)=>r.jsxs("tr",{className:"border-b border-border/50 last:border-0",...W(O),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(Nn,{status:T.status})}),r.jsx("td",{className:"py-4 pr-4",children:r.jsx("div",{className:"min-w-[220px]",children:r.jsx(nd,{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:gr(T.updated)})]},T.slug))})]})})}):r.jsx(Id,{columns:fL,items:G,getItemId:T=>T.slug,getColumnId:T=>T.status,canDrop:({fromColumnId:T,toColumnId:O})=>({allowed:!0,reason:T===O?void 0:"This will set a manual status override on the project."}),onMove:({item:T,fromColumnId:O,toColumnId:q,fromIndex:L,toIndex:ee})=>{if(O===q){const de=$[O]??J.filter(F=>F.status===O).map(F=>F.slug);D(F=>({...F,[O]:lL(de,L,ee)}));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,O)=>{O.preventDefault(),Z({project:T,anchor:{x:O.clientX,y:O.clientY}})},emptyMessage:T=>`No ${T.title.toLowerCase()} projects.`,renderCard:(T,{dragging:O})=>{const q=le.get(T.slug)??-1;return r.jsx("div",{...q>=0?W(q):{},children:r.jsx(hL,{project:T,dragging:O})})}}),r.jsx(y1,{anchor:(X==null?void 0:X.anchor)??null,items:X?[{key:"edit",label:"Edit",icon:Bo,onSelect:()=>n(`${t}/projects/${X.project.slug}`)},{key:"move",label:"Move to workspace…",icon:Kl,onSelect:()=>U(X.project)}]:[],onClose:()=>Z(null)}),r.jsx(Pg,{open:z!==null,onOpenChange:T=>{T||U(null)},currentWorkspace:(z==null?void 0:z.workspace)??null,title:"Move project to workspace",onSubmit:async T=>{if(!z)return;const O=await fetch(`/api/projects/${encodeURIComponent(z.slug)}/move-workspace`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({workspace:T})});if(!O.ok){const q=await O.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(Mh,{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 dL={pending:"Pending",active:"Active",blocked:"Blocked",failed:"Failed",completed:"Completed",archived:"Archived"},fL=Tg.map(e=>({id:e,title:dL[e],description:Od(e)}));function pL(e,t,n){switch(n){case"created":return t.created.localeCompare(e.created);case"title":return e.title.localeCompare(t.title);case"attention":return _v(t)-_v(e);case"updated":default:return t.updated.localeCompare(e.updated)}}function _v(e){return e.needsAttention.failedCount*10+e.needsAttention.blockedCount*5+e.needsAttention.openQuestions}function mL(e){return Object.fromEntries(Tg.map(t=>[t,e.filter(n=>n.status===t).map(n=>n.slug)]))}function hL({project:e,dragging:t}){const n=Xt();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 ",gr(e.updated)]})]}),r.jsx(Nn,{status:e.status})]}),r.jsx("div",{className:"mt-4",children:r.jsx(nd,{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 b1={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 Mu=null,Ei=null;function gL(){return Mu?Promise.resolve(Mu):Ei||(Ei=fetch("/api/config/types").then(e=>{if(!e.ok)throw new Error(`HTTP ${e.status}`);return e.json()}).then(e=>(Mu=e,Ei=null,e)).catch(()=>(Ei=null,b1)),Ei)}function Fd(){const[e,t]=f.useState(()=>Mu??b1);return f.useEffect(()=>{gL().then(t)},[]),e}function Ki(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 xL(e,t){return t?e.definitions.find(n=>n.id===t)??null:null}function la({type:e,className:t,compact:n=!1}){const s=Fd();if(!e)return null;const i=xL(s,e),l=(i==null?void 0:i.label)??e.replace(/_/g," ").replace(/\b\w/g,u=>u.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:Re("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 Fv="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",zv="block min-w-0 truncate";function Rg({externalIds:e,className:t}){return e.length===0?null:r.jsx("span",{className:Re("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:Re(Fv,"transition-colors hover:text-foreground hover:border-foreground/40"),title:`Open ${i} in ${n.system}`,children:[r.jsx("span",{className:zv,children:i}),r.jsx(sa,{className:"h-2.5 w-2.5 shrink-0"})]},l):r.jsx("span",{className:Fv,title:i,children:r.jsx("span",{className:zv,children:i})},l)})})}const yL={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 Sn({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]}),u=Re(yL[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:u,children:c}):r.jsx("article",{className:u,children:c})}function Bv(e){const t=bL(e),n=f.forwardRef((s,i)=>{const{children:l,...c}=s,u=f.Children.toArray(l),p=u.find(wL);if(p){const m=p.props.children,h=u.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 bL(e){const t=f.forwardRef((n,s)=>{const{children:i,...l}=n;if(f.isValidElement(i)){const c=kL(i),u=jL(l,i.props);return i.type!==f.Fragment&&(u.ref=s?kd(s,c):c),f.cloneElement(i,u)}return f.Children.count(i)>1?f.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var vL=Symbol("radix.slottable");function wL(e){return f.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===vL}function jL(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]=(...u)=>{const p=l(...u);return i(...u),p}:i&&(n[s]=i):s==="style"?n[s]={...i,...l}:s==="className"&&(n[s]=[i,l].filter(Boolean).join(" "))}return{...e,...n}}function kL(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 SL(e){const t=e+"CollectionProvider",[n,s]=Vo(t),[i,l]=n(t,{collectionRef:{current:null},itemMap:new Map}),c=j=>{const{scope:w,children:S}=j,E=Wt.useRef(null),N=Wt.useRef(new Map).current;return r.jsx(i,{scope:w,itemMap:N,collectionRef:E,children:S})};c.displayName=t;const u=e+"CollectionSlot",p=Bv(u),m=Wt.forwardRef((j,w)=>{const{scope:S,children:E}=j,N=l(u,S),R=Rn(w,N.collectionRef);return r.jsx(p,{ref:R,children:E})});m.displayName=u;const h=e+"CollectionItemSlot",x="data-radix-collection-item",y=Bv(h),b=Wt.forwardRef((j,w)=>{const{scope:S,children:E,...N}=j,R=Wt.useRef(null),I=Rn(w,R),P=l(h,S);return Wt.useEffect(()=>(P.itemMap.set(R,{ref:R,...N}),()=>void P.itemMap.delete(R))),r.jsx(y,{[x]:"",ref:I,children:E})});b.displayName=h;function C(j){const w=l(e+"CollectionConsumer",j);return Wt.useCallback(()=>{const E=w.collectionRef.current;if(!E)return[];const N=Array.from(E.querySelectorAll(`[${x}]`));return Array.from(w.itemMap.values()).sort((P,$)=>N.indexOf(P.ref.current)-N.indexOf($.ref.current))},[w.collectionRef,w.itemMap])}return[{Provider:c,Slot:m,ItemSlot:b},C,s]}var NL=f.createContext(void 0);function v1(e){const t=f.useContext(NL);return e||t||"ltr"}var mm="rovingFocusGroup.onEntryFocus",CL={bubbles:!1,cancelable:!0},Ql="RovingFocusGroup",[ah,w1,EL]=SL(Ql),[TL,j1]=Vo(Ql,[EL]),[PL,RL]=TL(Ql),k1=f.forwardRef((e,t)=>r.jsx(ah.Provider,{scope:e.__scopeRovingFocusGroup,children:r.jsx(ah.Slot,{scope:e.__scopeRovingFocusGroup,children:r.jsx(AL,{...e,ref:t})})}));k1.displayName=Ql;var AL=f.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:s,loop:i=!1,dir:l,currentTabStopId:c,defaultCurrentTabStopId:u,onCurrentTabStopIdChange:p,onEntryFocus:m,preventScrollOnEntryFocus:h=!1,...x}=e,y=f.useRef(null),b=Rn(t,y),C=v1(l),[j,w]=Sd({prop:c,defaultProp:u??null,onChange:p,caller:Ql}),[S,E]=f.useState(!1),N=_o(m),R=w1(n),I=f.useRef(!1),[P,$]=f.useState(0);return f.useEffect(()=>{const D=y.current;if(D)return D.addEventListener(mm,N),()=>D.removeEventListener(mm,N)},[N]),r.jsx(PL,{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(rn.div,{tabIndex:S||P===0?-1:0,"data-orientation":s,...x,ref:b,style:{outline:"none",...e.style},onMouseDown:Mt(e.onMouseDown,()=>{I.current=!0}),onFocus:Mt(e.onFocus,D=>{const X=!I.current;if(D.target===D.currentTarget&&X&&!S){const Z=new CustomEvent(mm,CL);if(D.currentTarget.dispatchEvent(Z),!Z.defaultPrevented){const z=R().filter(Q=>Q.focusable),U=z.find(Q=>Q.active),J=z.find(Q=>Q.id===j),G=[U,J,...z].filter(Boolean).map(Q=>Q.ref.current);C1(G,h)}}I.current=!1}),onBlur:Mt(e.onBlur,()=>E(!1))})})}),S1="RovingFocusGroupItem",N1=f.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:s=!0,active:i=!1,tabStopId:l,children:c,...u}=e,p=Bi(),m=l||p,h=RL(S1,n),x=h.currentTabStopId===m,y=w1(n),{onFocusableItemAdd:b,onFocusableItemRemove:C,currentTabStopId:j}=h;return f.useEffect(()=>{if(s)return b(),()=>C()},[s,b,C]),r.jsx(ah.ItemSlot,{scope:n,id:m,focusable:s,active:i,children:r.jsx(rn.span,{tabIndex:x?0:-1,"data-orientation":h.orientation,...u,ref:t,onMouseDown:Mt(e.onMouseDown,w=>{s?h.onItemFocus(m):w.preventDefault()}),onFocus:Mt(e.onFocus,()=>h.onItemFocus(m)),onKeyDown:Mt(e.onKeyDown,w=>{if(w.key==="Tab"&&w.shiftKey){h.onItemShiftTab();return}if(w.target!==w.currentTarget)return;const S=$L(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(R=>R.focusable).map(R=>R.ref.current);if(S==="last")N.reverse();else if(S==="prev"||S==="next"){S==="prev"&&N.reverse();const R=N.indexOf(w.currentTarget);N=h.loop?IL(N,R+1):N.slice(R+1)}setTimeout(()=>C1(N))}}),children:typeof c=="function"?c({isCurrentTabStop:x,hasTabStop:j!=null}):c})})});N1.displayName=S1;var DL={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function LL(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function $L(e,t,n){const s=LL(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(s))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(s)))return DL[s]}function C1(e,t=!1){const n=document.activeElement;for(const s of e)if(s===n||(s.focus({preventScroll:t}),document.activeElement!==n))return}function IL(e,t){return e.map((n,s)=>e[(t+s)%e.length])}var OL=k1,ML=N1,zd="Tabs",[_L]=Vo(zd,[j1]),E1=j1(),[FL,Ag]=_L(zd),T1=f.forwardRef((e,t)=>{const{__scopeTabs:n,value:s,onValueChange:i,defaultValue:l,orientation:c="horizontal",dir:u,activationMode:p="automatic",...m}=e,h=v1(u),[x,y]=Sd({prop:s,onChange:i,defaultProp:l??"",caller:zd});return r.jsx(FL,{scope:n,baseId:Bi(),value:x,onValueChange:y,orientation:c,dir:h,activationMode:p,children:r.jsx(rn.div,{dir:h,"data-orientation":c,...m,ref:t})})});T1.displayName=zd;var P1="TabsList",R1=f.forwardRef((e,t)=>{const{__scopeTabs:n,loop:s=!0,...i}=e,l=Ag(P1,n),c=E1(n);return r.jsx(OL,{asChild:!0,...c,orientation:l.orientation,dir:l.dir,loop:s,children:r.jsx(rn.div,{role:"tablist","aria-orientation":l.orientation,...i,ref:t})})});R1.displayName=P1;var A1="TabsTrigger",D1=f.forwardRef((e,t)=>{const{__scopeTabs:n,value:s,disabled:i=!1,...l}=e,c=Ag(A1,n),u=E1(n),p=I1(c.baseId,s),m=O1(c.baseId,s),h=s===c.value;return r.jsx(ML,{asChild:!0,...u,focusable:!i,active:h,children:r.jsx(rn.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:Mt(e.onMouseDown,x=>{!i&&x.button===0&&x.ctrlKey===!1?c.onValueChange(s):x.preventDefault()}),onKeyDown:Mt(e.onKeyDown,x=>{[" ","Enter"].includes(x.key)&&c.onValueChange(s)}),onFocus:Mt(e.onFocus,()=>{const x=c.activationMode!=="manual";!h&&!i&&x&&c.onValueChange(s)})})})});D1.displayName=A1;var L1="TabsContent",$1=f.forwardRef((e,t)=>{const{__scopeTabs:n,value:s,forceMount:i,children:l,...c}=e,u=Ag(L1,n),p=I1(u.baseId,s),m=O1(u.baseId,s),h=s===u.value,x=f.useRef(h);return f.useEffect(()=>{const y=requestAnimationFrame(()=>x.current=!1);return()=>cancelAnimationFrame(y)},[]),r.jsx(Ho,{present:i||h,children:({present:y})=>r.jsx(rn.div,{"data-state":h?"active":"inactive","data-orientation":u.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})})});$1.displayName=L1;function I1(e,t){return`${e}-trigger-${t}`}function O1(e,t){return`${e}-content-${t}`}var M1=T1,_1=R1,lh=D1,ch=$1;function Dg({value:e,onValueChange:t,items:n,className:s}){return r.jsxs(M1,{value:e,onValueChange:t,className:s,children:[r.jsx(_1,{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(lh,{value:i.value,className:Re("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(ch,{value:i.value,className:"pt-3",children:i.content},i.value))]})}const zL="modulepreload",BL=function(e){return"/"+e},Uv={},UL=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 u=document.querySelector("meta[property=csp-nonce]"),p=(u==null?void 0:u.nonce)||(u==null?void 0:u.getAttribute("nonce"));i=c(n.map(m=>{if(m=BL(m),m in Uv)return;Uv[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":zL,h||(y.as="script"),y.crossOrigin="",y.href=m,p&&y.setAttribute("nonce",p),document.head.appendChild(y),h)return new Promise((b,C)=>{y.addEventListener("load",b),y.addEventListener("error",()=>C(new Error(`Unable to preload CSS for ${m}`)))})}))}function l(c){const u=new Event("vite:preloadError",{cancelable:!0});if(u.payload=c,window.dispatchEvent(u),!u.defaultPrevented)throw c}return i.then(c=>{for(const u of c||[])u.status==="rejected"&&l(u.reason);return t().catch(l)})};function VL({definition:e,className:t,nodeRoutes:n={}}){const s=f.useRef(null),[i,l]=f.useState(null),[c,u]=f.useState(!0),p=Ct(),m=document.documentElement.classList.contains("dark")?"dark":"default";return f.useEffect(()=>{let h=!1;async function x(){if(s.current)try{const y=(await UL(async()=>{const{default:j}=await import("./mermaid.core-aNcWKq-4.js").then(w=>w.bF);return{default:j}},[])).default;if(y.initialize({startOnLoad:!1,theme:"base",themeVariables:HL(m==="dark")}),h)return;const b=`mermaid-${Date.now()}`,{svg:C}=await y.render(b,e);if(h||!s.current)return;s.current.innerHTML=C,WL(s.current,n,p),u(!1)}catch(y){h||(l(y instanceof Error?y.message:"Failed to render graph"),u(!1))}}return u(!0),l(null),x(),()=>{h=!0}},[e,p,n,m]),i?r.jsxs("div",{className:Re("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:Re("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 HL(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"),u=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:u}}function WL(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 u=()=>n(c);i.addEventListener("click",u),i.addEventListener("keydown",p=>{(p.key==="Enter"||p.key===" ")&&(p.preventDefault(),u())})}}function KL(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const qL=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,GL=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,YL={};function Vv(e,t){return(YL.jsx?GL:qL).test(e)}const JL=/[ \t\n\f\r]/g;function XL(e){return typeof e=="object"?e.type==="text"?Hv(e.value):!1:Hv(e)}function Hv(e){return e.replace(JL,"")===""}class Zl{constructor(t,n,s){this.normal=n,this.property=t,s&&(this.space=s)}}Zl.prototype.normal={};Zl.prototype.property={};Zl.prototype.space=void 0;function F1(e,t){const n={},s={};for(const i of e)Object.assign(n,i.property),Object.assign(s,i.normal);return new Zl(n,s,t)}function uh(e){return e.toLowerCase()}class er{constructor(t,n){this.attribute=n,this.property=t}}er.prototype.attribute="";er.prototype.booleanish=!1;er.prototype.boolean=!1;er.prototype.commaOrSpaceSeparated=!1;er.prototype.commaSeparated=!1;er.prototype.defined=!1;er.prototype.mustUseProperty=!1;er.prototype.number=!1;er.prototype.overloadedBoolean=!1;er.prototype.property="";er.prototype.spaceSeparated=!1;er.prototype.space=void 0;let QL=0;const rt=Ko(),tn=Ko(),dh=Ko(),Ne=Ko(),St=Ko(),qi=Ko(),ur=Ko();function Ko(){return 2**++QL}const fh=Object.freeze(Object.defineProperty({__proto__:null,boolean:rt,booleanish:tn,commaOrSpaceSeparated:ur,commaSeparated:qi,number:Ne,overloadedBoolean:dh,spaceSeparated:St},Symbol.toStringTag,{value:"Module"})),hm=Object.keys(fh);class Lg extends er{constructor(t,n,s,i){let l=-1;if(super(t,n),Wv(this,"space",i),typeof s=="number")for(;++l<hm.length;){const c=hm[l];Wv(this,hm[l],(s&fh[c])===fh[c])}}}Lg.prototype.defined=!0;function Wv(e,t,n){n&&(e[t]=n)}function ca(e){const t={},n={};for(const[s,i]of Object.entries(e.properties)){const l=new Lg(s,e.transform(e.attributes||{},s),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(s)&&(l.mustUseProperty=!0),t[s]=l,n[uh(s)]=s,n[uh(l.attribute)]=s}return new Zl(t,n,e.space)}const z1=ca({properties:{ariaActiveDescendant:null,ariaAtomic:tn,ariaAutoComplete:null,ariaBusy:tn,ariaChecked:tn,ariaColCount:Ne,ariaColIndex:Ne,ariaColSpan:Ne,ariaControls:St,ariaCurrent:null,ariaDescribedBy:St,ariaDetails:null,ariaDisabled:tn,ariaDropEffect:St,ariaErrorMessage:null,ariaExpanded:tn,ariaFlowTo:St,ariaGrabbed:tn,ariaHasPopup:null,ariaHidden:tn,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:St,ariaLevel:Ne,ariaLive:null,ariaModal:tn,ariaMultiLine:tn,ariaMultiSelectable:tn,ariaOrientation:null,ariaOwns:St,ariaPlaceholder:null,ariaPosInSet:Ne,ariaPressed:tn,ariaReadOnly:tn,ariaRelevant:null,ariaRequired:tn,ariaRoleDescription:St,ariaRowCount:Ne,ariaRowIndex:Ne,ariaRowSpan:Ne,ariaSelected:tn,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 B1(e,t){return t in e?e[t]:t}function U1(e,t){return B1(e,t.toLowerCase())}const ZL=ca({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:qi,acceptCharset:St,accessKey:St,action:null,allow:null,allowFullScreen:rt,allowPaymentRequest:rt,allowUserMedia:rt,alt:null,as:null,async:rt,autoCapitalize:null,autoComplete:St,autoFocus:rt,autoPlay:rt,blocking:St,capture:null,charSet:null,checked:rt,cite:null,className:St,cols:Ne,colSpan:null,content:null,contentEditable:tn,controls:rt,controlsList:St,coords:Ne|qi,crossOrigin:null,data:null,dateTime:null,decoding:null,default:rt,defer:rt,dir:null,dirName:null,disabled:rt,download:dh,draggable:tn,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:rt,formTarget:null,headers:St,height:Ne,hidden:dh,high:Ne,href:null,hrefLang:null,htmlFor:St,httpEquiv:St,id:null,imageSizes:null,imageSrcSet:null,inert:rt,inputMode:null,integrity:null,is:null,isMap:rt,itemId:null,itemProp:St,itemRef:St,itemScope:rt,itemType:St,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:rt,low:Ne,manifest:null,max:null,maxLength:Ne,media:null,method:null,min:null,minLength:Ne,multiple:rt,muted:rt,name:null,nonce:null,noModule:rt,noValidate:rt,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:rt,optimum:Ne,pattern:null,ping:St,placeholder:null,playsInline:rt,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:rt,referrerPolicy:null,rel:St,required:rt,reversed:rt,rows:Ne,rowSpan:Ne,sandbox:St,scope:null,scoped:rt,seamless:rt,selected:rt,shadowRootClonable:rt,shadowRootDelegatesFocus:rt,shadowRootMode:null,shape:null,size:Ne,sizes:null,slot:null,span:Ne,spellCheck:tn,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:rt,useMap:null,value:tn,width:Ne,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:St,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:rt,declare:rt,event:null,face:null,frame:null,frameBorder:null,hSpace:Ne,leftMargin:Ne,link:null,longDesc:null,lowSrc:null,marginHeight:Ne,marginWidth:Ne,noResize:rt,noHref:rt,noShade:rt,noWrap:rt,object:null,profile:null,prompt:null,rev:null,rightMargin:Ne,rules:null,scheme:null,scrolling:tn,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:rt,disableRemotePlayback:rt,prefix:null,property:null,results:Ne,security:null,unselectable:null},space:"html",transform:U1}),e$=ca({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:ur,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:St,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:rt,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:qi,g2:qi,glyphName:qi,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:ur,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:St,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:Ne,pointsAtY:Ne,pointsAtZ:Ne,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:ur,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:ur,rev:ur,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:ur,requiredFeatures:ur,requiredFonts:ur,requiredFormats:ur,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:ur,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:ur,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:ur,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:B1}),V1=ca({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()}}),H1=ca({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:U1}),W1=ca({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),t$={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"},n$=/[A-Z]/g,Kv=/-[a-z]/g,r$=/^data[-\w.:]+$/i;function s$(e,t){const n=uh(t);let s=t,i=er;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&r$.test(t)){if(t.charAt(4)==="-"){const l=t.slice(5).replace(Kv,i$);s="data"+l.charAt(0).toUpperCase()+l.slice(1)}else{const l=t.slice(4);if(!Kv.test(l)){let c=l.replace(n$,o$);c.charAt(0)!=="-"&&(c="-"+c),t="data"+c}}i=Lg}return new i(s,t)}function o$(e){return"-"+e.toLowerCase()}function i$(e){return e.charAt(1).toUpperCase()}const a$=F1([z1,ZL,V1,H1,W1],"html"),$g=F1([z1,e$,V1,H1,W1],"svg");function l$(e){return e.join(" ").trim()}var Ti={},gm,qv;function c$(){if(qv)return gm;qv=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,t=/\n/g,n=/^\s*/,s=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,i=/^:\s*/,l=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,c=/^[;\s]*/,u=/^\s+|\s+$/g,p=`
|
|
501
|
+
`,m="/",h="*",x="",y="comment",b="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 R(_){var G=_.match(t);G&&(E+=G.length);var Q=_.lastIndexOf(p);N=~Q?_.length-Q:N+_.length}function I(){var _={line:E,column:N};return function(G){return G.position=new P(_),X(),G}}function P(_){this.start=_,this.end={line:E,column:N},this.source=S.source}P.prototype.content=w;function $(_){var G=new Error(S.source+":"+E+":"+N+": "+_);if(G.reason=_,G.filename=S.source,G.line=E,G.column=N,G.source=w,!S.silent)throw G}function D(_){var G=_.exec(w);if(G){var Q=G[0];return R(Q),w=w.slice(Q.length),G}}function X(){D(n)}function Z(_){var G;for(_=_||[];G=z();)G!==!1&&_.push(G);return _}function z(){var _=I();if(!(m!=w.charAt(0)||h!=w.charAt(1))){for(var G=2;x!=w.charAt(G)&&(h!=w.charAt(G)||m!=w.charAt(G+1));)++G;if(G+=2,x===w.charAt(G-1))return $("End of comment missing");var Q=w.slice(2,G-2);return N+=2,R(Q),w=w.slice(G),N+=2,_({type:y,comment:Q})}}function U(){var _=I(),G=D(s);if(G){if(z(),!D(i))return $("property missing ':'");var Q=D(l),le=_({type:b,property:j(G[0].replace(e,x)),value:Q?j(Q[0].replace(e,x)):x});return D(c),le}}function J(){var _=[];Z(_);for(var G;G=U();)G!==!1&&(_.push(G),Z(_));return _}return X(),J()}function j(w){return w?w.replace(u,x):x}return gm=C,gm}var Gv;function u$(){if(Gv)return Ti;Gv=1;var e=Ti&&Ti.__importDefault||function(s){return s&&s.__esModule?s:{default:s}};Object.defineProperty(Ti,"__esModule",{value:!0}),Ti.default=n;const t=e(c$());function n(s,i){let l=null;if(!s||typeof s!="string")return l;const c=(0,t.default)(s),u=typeof i=="function";return c.forEach(p=>{if(p.type!=="declaration")return;const{property:m,value:h}=p;u?i(m,h,p):h&&(l=l||{},l[m]=h)}),l}return Ti}var ll={},Yv;function d$(){if(Yv)return ll;Yv=1,Object.defineProperty(ll,"__esModule",{value:!0}),ll.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()},u=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,u):m=m.replace(s,u),m.replace(t,c))};return ll.camelCase=p,ll}var cl,Jv;function f$(){if(Jv)return cl;Jv=1;var e=cl&&cl.__importDefault||function(i){return i&&i.__esModule?i:{default:i}},t=e(u$()),n=d$();function s(i,l){var c={};return!i||typeof i!="string"||(0,t.default)(i,function(u,p){u&&p&&(c[(0,n.camelCase)(u,l)]=p)}),c}return s.default=s,cl=s,cl}var p$=f$();const m$=fd(p$),K1=q1("end"),Ig=q1("start");function q1(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 h$(e){const t=Ig(e),n=K1(e);if(t&&n)return{start:t,end:n}}function bl(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?Xv(e.position):"start"in e||"end"in e?Xv(e):"line"in e||"column"in e?ph(e):""}function ph(e){return Qv(e&&e.line)+":"+Qv(e&&e.column)}function Xv(e){return ph(e&&e.start)+"-"+ph(e&&e.end)}function Qv(e){return e&&typeof e=="number"?e:1}class An 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 u=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=u?u.column:void 0,this.fatal=void 0,this.file="",this.message=i,this.line=u?u.line:void 0,this.name=bl(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}}An.prototype.file="";An.prototype.name="";An.prototype.reason="";An.prototype.message="";An.prototype.stack="";An.prototype.column=void 0;An.prototype.line=void 0;An.prototype.ancestors=void 0;An.prototype.cause=void 0;An.prototype.fatal=void 0;An.prototype.place=void 0;An.prototype.ruleId=void 0;An.prototype.source=void 0;const Og={}.hasOwnProperty,g$=new Map,x$=/[A-Z]/g,y$=new Set(["table","tbody","thead","tfoot","tr"]),b$=new Set(["td","th"]),G1="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function v$(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=T$(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=E$(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"?$g:a$,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},l=Y1(i,e,void 0);return l&&typeof l!="string"?l:i.create(e,i.Fragment,{children:l||void 0},void 0)}function Y1(e,t,n){if(t.type==="element")return w$(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return j$(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return S$(e,t,n);if(t.type==="mdxjsEsm")return k$(e,t);if(t.type==="root")return N$(e,t,n);if(t.type==="text")return C$(e,t)}function w$(e,t,n){const s=e.schema;let i=s;t.tagName.toLowerCase()==="svg"&&s.space==="html"&&(i=$g,e.schema=i),e.ancestors.push(t);const l=X1(e,t.tagName,!1),c=P$(e,t);let u=_g(e,t);return y$.has(t.tagName)&&(u=u.filter(function(p){return typeof p=="string"?!XL(p):!0})),J1(e,c,l,t),Mg(c,u),e.ancestors.pop(),e.schema=s,e.create(t,l,c,n)}function j$(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)}Ol(e,t.position)}function k$(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);Ol(e,t.position)}function S$(e,t,n){const s=e.schema;let i=s;t.name==="svg"&&s.space==="html"&&(i=$g,e.schema=i),e.ancestors.push(t);const l=t.name===null?e.Fragment:X1(e,t.name,!0),c=R$(e,t),u=_g(e,t);return J1(e,c,l,t),Mg(c,u),e.ancestors.pop(),e.schema=s,e.create(t,l,c,n)}function N$(e,t,n){const s={};return Mg(s,_g(e,t)),e.create(t,e.Fragment,s,n)}function C$(e,t){return t.value}function J1(e,t,n,s){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=s)}function Mg(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function E$(e,t,n){return s;function s(i,l,c,u){const m=Array.isArray(c.children)?n:t;return u?m(l,c,u):m(l,c)}}function T$(e,t){return n;function n(s,i,l,c){const u=Array.isArray(l.children),p=Ig(s);return t(i,l,c,u,{columnNumber:p?p.column-1:void 0,fileName:e,lineNumber:p?p.line:void 0},void 0)}}function P$(e,t){const n={};let s,i;for(i in t.properties)if(i!=="children"&&Og.call(t.properties,i)){const l=A$(e,i,t.properties[i]);if(l){const[c,u]=l;e.tableCellAlignToStyle&&c==="align"&&typeof u=="string"&&b$.has(t.tagName)?s=u:n[c]=u}}if(s){const l=n.style||(n.style={});l[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=s}return n}function R$(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 u=c.properties[0];u.type,Object.assign(n,e.evaluater.evaluateExpression(u.argument))}else Ol(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 u=s.value.data.estree.body[0];u.type,l=e.evaluater.evaluateExpression(u.expression)}else Ol(e,t.position);else l=s.value===null?!0:s.value;n[i]=l}return n}function _g(e,t){const n=[];let s=-1;const i=e.passKeys?new Map:g$;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 u=Y1(e,l,c);u!==void 0&&n.push(u)}return n}function A$(e,t,n){const s=s$(e.schema,t);if(!(n==null||typeof n=="number"&&Number.isNaN(n))){if(Array.isArray(n)&&(n=s.commaSeparated?KL(n):l$(n)),s.property==="style"){let i=typeof n=="object"?n:D$(e,String(n));return e.stylePropertyNameCase==="css"&&(i=L$(i)),["style",i]}return[e.elementAttributeNameCase==="react"&&s.space?t$[s.property]||s.property:s.attribute,n]}}function D$(e,t){try{return m$(t,{reactCompat:!0})}catch(n){if(e.ignoreInvalidStyle)return{};const s=n,i=new An("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=G1+"#cannot-parse-style-attribute",i}}function X1(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 u=Vv(i[l])?{type:"Identifier",name:i[l]}:{type:"Literal",value:i[l]};c=c?{type:"MemberExpression",object:c,property:u,computed:!!(l&&u.type==="Literal"),optional:!1}:u}s=c}else s=Vv(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(s.type==="Literal"){const i=s.value;return Og.call(e.components,i)?e.components[i]:i}if(e.evaluater)return e.evaluater.evaluateExpression(s);Ol(e)}function Ol(e,t){const n=new An("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=G1+"#cannot-handle-mdx-estrees-without-createevaluater",n}function L$(e){const t={};let n;for(n in e)Og.call(e,n)&&(t[$$(n)]=e[n]);return t}function $$(e){let t=e.replace(x$,I$);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function I$(e){return"-"+e.toLowerCase()}const xm={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"]},O$={};function M$(e,t){const n=O$,s=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,i=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return Q1(e,s,i)}function Q1(e,t,n){if(_$(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 Zv(e.children,t,n)}return Array.isArray(e)?Zv(e,t,n):""}function Zv(e,t,n){const s=[];let i=-1;for(;++i<e.length;)s[i]=Q1(e[i],t,n);return s.join("")}function _$(e){return!!(e&&typeof e=="object")}const ew=document.createElement("i");function Fg(e){const t="&"+e+";";ew.innerHTML=t;const n=ew.textContent;return n.charCodeAt(n.length-1)===59&&e!=="semi"||n===t?!1:n}function cs(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 Cr(e,t){return e.length>0?(cs(e,e.length,0,t),e):t}const tw={}.hasOwnProperty;function F$(e){const t={};let n=-1;for(;++n<e.length;)z$(t,e[n]);return t}function z$(e,t){let n;for(n in t){const i=(tw.call(e,n)?e[n]:void 0)||(e[n]={}),l=t[n];let c;if(l)for(c in l){tw.call(i,c)||(i[c]=[]);const u=l[c];B$(i[c],Array.isArray(u)?u:u?[u]:[])}}}function B$(e,t){let n=-1;const s=[];for(;++n<t.length;)(t[n].add==="after"?e:s).push(t[n]);cs(e,0,0,s)}function Z1(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 Gi(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const rs=po(/[A-Za-z]/),mr=po(/[\dA-Za-z]/),U$=po(/[#-'*+\--9=?A-Z^-~]/);function mh(e){return e!==null&&(e<32||e===127)}const hh=po(/\d/),V$=po(/[\dA-Fa-f]/),H$=po(/[!-/:-@[-`{-~]/);function Qe(e){return e!==null&&e<-2}function Qn(e){return e!==null&&(e<0||e===32)}function gt(e){return e===-2||e===-1||e===32}const W$=po(new RegExp("\\p{P}|\\p{S}","u")),K$=po(/\s/);function po(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function ua(e){const t=[];let n=-1,s=0,i=0;for(;++n<e.length;){const l=e.charCodeAt(n);let c="";if(l===37&&mr(e.charCodeAt(n+1))&&mr(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 u=e.charCodeAt(n+1);l<56320&&u>56319&&u<57344?(c=String.fromCharCode(l,u),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 Nt(e,t,n,s){const i=s?s-1:Number.POSITIVE_INFINITY;let l=0;return c;function c(p){return gt(p)?(e.enter(n),u(p)):t(p)}function u(p){return gt(p)&&l++<i?(e.consume(p),u):(e.exit(n),t(p))}}const q$={tokenize:G$};function G$(e){const t=e.attempt(this.parser.constructs.contentInitial,s,i);let n;return t;function s(u){if(u===null){e.consume(u);return}return e.enter("lineEnding"),e.consume(u),e.exit("lineEnding"),Nt(e,t,"linePrefix")}function i(u){return e.enter("paragraph"),l(u)}function l(u){const p=e.enter("chunkText",{contentType:"text",previous:n});return n&&(n.next=p),n=p,c(u)}function c(u){if(u===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(u);return}return Qe(u)?(e.consume(u),e.exit("chunkText"),l):(e.consume(u),c)}}const Y$={tokenize:J$},nw={tokenize:X$};function J$(e){const t=this,n=[];let s=0,i,l,c;return u;function u(N){if(s<n.length){const R=n[s];return t.containerState=R[1],e.attempt(R[0].continuation,p,m)(N)}return m(N)}function p(N){if(s++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,i&&E();const R=t.events.length;let I=R,P;for(;I--;)if(t.events[I][0]==="exit"&&t.events[I][1].type==="chunkFlow"){P=t.events[I][1].end;break}S(s);let $=R;for(;$<t.events.length;)t.events[$][1].end={...P},$++;return cs(t.events,I+1,0,t.events.slice(R)),t.events.length=$,m(N)}return u(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(nw,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(nw,b,C)(N)}function b(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 Qe(N)?(e.consume(N),w(e.exit("chunkFlow")),s=0,t.interrupt=void 0,u):(e.consume(N),j)}function w(N,R){const I=t.sliceStream(N);if(R&&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 P=i.events.length;for(;P--;)if(i.events[P][1].start.offset<c&&(!i.events[P][1].end||i.events[P][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),P=$;P<t.events.length;)t.events[P][1].end={...Z},P++;cs(t.events,D+1,0,t.events.slice($)),t.events.length=P}}function S(N){let R=n.length;for(;R-- >N;){const I=n[R];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 X$(e,t,n){return Nt(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function rw(e){if(e===null||Qn(e)||K$(e))return 1;if(W$(e))return 2}function zg(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 gh={name:"attention",resolveAll:Q$,tokenize:Z$};function Q$(e,t){let n=-1,s,i,l,c,u,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};sw(x,-p),sw(y,p),c={type:p>1?"strongSequence":"emphasisSequence",start:x,end:{...e[s][1].end}},u={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:{...u.end}},e[s][1].end={...c.start},e[n][1].start={...u.end},m=[],e[s][1].end.offset-e[s][1].start.offset&&(m=Cr(m,[["enter",e[s][1],t],["exit",e[s][1],t]])),m=Cr(m,[["enter",i,t],["enter",c,t],["exit",c,t],["enter",l,t]]),m=Cr(m,zg(t.parser.constructs.insideSpan.null,e.slice(s+1,n),t)),m=Cr(m,[["exit",l,t],["enter",u,t],["exit",u,t],["exit",i,t]]),e[n][1].end.offset-e[n][1].start.offset?(h=2,m=Cr(m,[["enter",e[n][1],t],["exit",e[n][1],t]])):h=0,cs(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 Z$(e,t){const n=this.parser.constructs.attentionMarkers.null,s=this.previous,i=rw(s);let l;return c;function c(p){return l=p,e.enter("attentionSequence"),u(p)}function u(p){if(p===l)return e.consume(p),u;const m=e.exit("attentionSequence"),h=rw(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 sw(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const eI={name:"autolink",tokenize:tI};function tI(e,t,n){let s=0;return i;function i(b){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(b),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),l}function l(b){return rs(b)?(e.consume(b),c):b===64?n(b):m(b)}function c(b){return b===43||b===45||b===46||mr(b)?(s=1,u(b)):m(b)}function u(b){return b===58?(e.consume(b),s=0,p):(b===43||b===45||b===46||mr(b))&&s++<32?(e.consume(b),u):(s=0,m(b))}function p(b){return b===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(b),e.exit("autolinkMarker"),e.exit("autolink"),t):b===null||b===32||b===60||mh(b)?n(b):(e.consume(b),p)}function m(b){return b===64?(e.consume(b),h):U$(b)?(e.consume(b),m):n(b)}function h(b){return mr(b)?x(b):n(b)}function x(b){return b===46?(e.consume(b),s=0,h):b===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(b),e.exit("autolinkMarker"),e.exit("autolink"),t):y(b)}function y(b){if((b===45||mr(b))&&s++<63){const C=b===45?y:x;return e.consume(b),C}return n(b)}}const Bd={partial:!0,tokenize:nI};function nI(e,t,n){return s;function s(l){return gt(l)?Nt(e,i,"linePrefix")(l):i(l)}function i(l){return l===null||Qe(l)?t(l):n(l)}}const eS={continuation:{tokenize:sI},exit:oI,name:"blockQuote",tokenize:rI};function rI(e,t,n){const s=this;return i;function i(c){if(c===62){const u=s.containerState;return u.open||(e.enter("blockQuote",{_container:!0}),u.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(c),e.exit("blockQuoteMarker"),l}return n(c)}function l(c){return gt(c)?(e.enter("blockQuotePrefixWhitespace"),e.consume(c),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(c))}}function sI(e,t,n){const s=this;return i;function i(c){return gt(c)?Nt(e,l,"linePrefix",s.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(c):l(c)}function l(c){return e.attempt(eS,t,n)(c)}}function oI(e){e.exit("blockQuote")}const tS={name:"characterEscape",tokenize:iI};function iI(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 H$(l)?(e.enter("characterEscapeValue"),e.consume(l),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(l)}}const nS={name:"characterReference",tokenize:aI};function aI(e,t,n){const s=this;let i=0,l,c;return u;function u(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=mr,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=V$,h):(e.enter("characterReferenceValue"),l=7,c=hh,h(x))}function h(x){if(x===59&&i){const y=e.exit("characterReferenceValue");return c===mr&&!Fg(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 ow={partial:!0,tokenize:cI},iw={concrete:!0,name:"codeFenced",tokenize:lI};function lI(e,t,n){const s=this,i={partial:!0,tokenize:I};let l=0,c=0,u;return p;function p(P){return m(P)}function m(P){const $=s.events[s.events.length-1];return l=$&&$[1].type==="linePrefix"?$[2].sliceSerialize($[1],!0).length:0,u=P,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),h(P)}function h(P){return P===u?(c++,e.consume(P),h):c<3?n(P):(e.exit("codeFencedFenceSequence"),gt(P)?Nt(e,x,"whitespace")(P):x(P))}function x(P){return P===null||Qe(P)?(e.exit("codeFencedFence"),s.interrupt?t(P):e.check(ow,j,R)(P)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),y(P))}function y(P){return P===null||Qe(P)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),x(P)):gt(P)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),Nt(e,b,"whitespace")(P)):P===96&&P===u?n(P):(e.consume(P),y)}function b(P){return P===null||Qe(P)?x(P):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),C(P))}function C(P){return P===null||Qe(P)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),x(P)):P===96&&P===u?n(P):(e.consume(P),C)}function j(P){return e.attempt(i,R,w)(P)}function w(P){return e.enter("lineEnding"),e.consume(P),e.exit("lineEnding"),S}function S(P){return l>0&>(P)?Nt(e,E,"linePrefix",l+1)(P):E(P)}function E(P){return P===null||Qe(P)?e.check(ow,j,R)(P):(e.enter("codeFlowValue"),N(P))}function N(P){return P===null||Qe(P)?(e.exit("codeFlowValue"),E(P)):(e.consume(P),N)}function R(P){return e.exit("codeFenced"),t(P)}function I(P,$,D){let X=0;return Z;function Z(G){return P.enter("lineEnding"),P.consume(G),P.exit("lineEnding"),z}function z(G){return P.enter("codeFencedFence"),gt(G)?Nt(P,U,"linePrefix",s.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(G):U(G)}function U(G){return G===u?(P.enter("codeFencedFenceSequence"),J(G)):D(G)}function J(G){return G===u?(X++,P.consume(G),J):X>=c?(P.exit("codeFencedFenceSequence"),gt(G)?Nt(P,_,"whitespace")(G):_(G)):D(G)}function _(G){return G===null||Qe(G)?(P.exit("codeFencedFence"),$(G)):D(G)}}}function cI(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 ym={name:"codeIndented",tokenize:dI},uI={partial:!0,tokenize:fI};function dI(e,t,n){const s=this;return i;function i(m){return e.enter("codeIndented"),Nt(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):Qe(m)?e.attempt(uI,c,p)(m):(e.enter("codeFlowValue"),u(m))}function u(m){return m===null||Qe(m)?(e.exit("codeFlowValue"),c(m)):(e.consume(m),u)}function p(m){return e.exit("codeIndented"),t(m)}}function fI(e,t,n){const s=this;return i;function i(c){return s.parser.lazy[s.now().line]?n(c):Qe(c)?(e.enter("lineEnding"),e.consume(c),e.exit("lineEnding"),i):Nt(e,l,"linePrefix",5)(c)}function l(c){const u=s.events[s.events.length-1];return u&&u[1].type==="linePrefix"&&u[2].sliceSerialize(u[1],!0).length>=4?t(c):Qe(c)?i(c):n(c)}}const pI={name:"codeText",previous:hI,resolve:mI,tokenize:gI};function mI(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 hI(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function gI(e,t,n){let s=0,i,l;return c;function c(x){return e.enter("codeText"),e.enter("codeTextSequence"),u(x)}function u(x){return x===96?(e.consume(x),s++,u):(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)):Qe(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||Qe(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 xI{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&&ul(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),ul(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),ul(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);ul(this.right,n.reverse())}else{const n=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);ul(this.left,n.reverse())}}}function ul(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 rS(e){const t={};let n=-1,s,i,l,c,u,p,m;const h=new xI(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,yI(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},u=h.slice(i,n),u.unshift(s),h.splice(i,n-i+1,u))}}return cs(e,0,Number.POSITIVE_INFINITY,h.slice(0)),!m}function yI(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 u=c.events,p=[],m={};let h,x,y=-1,b=n,C=0,j=0;const w=[j];for(;b;){for(;e.get(++i)[1]!==b;);l.push(i),b._tokenizer||(h=s.sliceStream(b),b.next||h.push(null),x&&c.defineSkip(b.start),b._isInFirstContentOfListItem&&(c._gfmTasklistFirstContentOfListItem=!0),c.write(h),b._isInFirstContentOfListItem&&(c._gfmTasklistFirstContentOfListItem=void 0)),x=b,b=b.next}for(b=n;++y<u.length;)u[y][0]==="exit"&&u[y-1][0]==="enter"&&u[y][1].type===u[y-1][1].type&&u[y][1].start.line!==u[y][1].end.line&&(j=y+1,w.push(j),b._tokenizer=void 0,b.previous=void 0,b=b.next);for(c.events=[],b?(b._tokenizer=void 0,b.previous=void 0):w.pop(),y=w.length;y--;){const S=u.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 bI={resolve:wI,tokenize:jI},vI={partial:!0,tokenize:kI};function wI(e){return rS(e),e}function jI(e,t){let n;return s;function s(u){return e.enter("content"),n=e.enter("chunkContent",{contentType:"content"}),i(u)}function i(u){return u===null?l(u):Qe(u)?e.check(vI,c,l)(u):(e.consume(u),i)}function l(u){return e.exit("chunkContent"),e.exit("content"),t(u)}function c(u){return e.consume(u),e.exit("chunkContent"),n.next=e.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,i}}function kI(e,t,n){const s=this;return i;function i(c){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(c),e.exit("lineEnding"),Nt(e,l,"linePrefix")}function l(c){if(c===null||Qe(c))return n(c);const u=s.events[s.events.length-1];return!s.parser.constructs.disable.null.includes("codeIndented")&&u&&u[1].type==="linePrefix"&&u[2].sliceSerialize(u[1],!0).length>=4?t(c):e.interrupt(s.parser.constructs.flow,n,t)(c)}}function sS(e,t,n,s,i,l,c,u,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||mh(S)?n(S):(e.enter(s),e.enter(c),e.enter(u),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(u),e.enter("chunkString",{contentType:"string"}),b(S))}function b(S){return S===62?(e.exit("chunkString"),e.exit(u),y(S)):S===null||S===60||Qe(S)?n(S):(e.consume(S),S===92?C:b)}function C(S){return S===60||S===62||S===92?(e.consume(S),b):b(S)}function j(S){return!h&&(S===null||S===41||Qn(S))?(e.exit("chunkString"),e.exit(u),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||mh(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 oS(e,t,n,s,i,l){const c=this;let u=0,p;return m;function m(b){return e.enter(s),e.enter(i),e.consume(b),e.exit(i),e.enter(l),h}function h(b){return u>999||b===null||b===91||b===93&&!p||b===94&&!u&&"_hiddenFootnoteSupport"in c.parser.constructs?n(b):b===93?(e.exit(l),e.enter(i),e.consume(b),e.exit(i),e.exit(s),t):Qe(b)?(e.enter("lineEnding"),e.consume(b),e.exit("lineEnding"),h):(e.enter("chunkString",{contentType:"string"}),x(b))}function x(b){return b===null||b===91||b===93||Qe(b)||u++>999?(e.exit("chunkString"),h(b)):(e.consume(b),p||(p=!gt(b)),b===92?y:x)}function y(b){return b===91||b===92||b===93?(e.consume(b),u++,x):x(b)}}function iS(e,t,n,s,i,l){let c;return u;function u(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):Qe(y)?(e.enter("lineEnding"),e.consume(y),e.exit("lineEnding"),Nt(e,m,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),h(y))}function h(y){return y===c||y===null||Qe(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 vl(e,t){let n;return s;function s(i){return Qe(i)?(e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),n=!0,s):gt(i)?Nt(e,s,n?"linePrefix":"lineSuffix")(i):t(i)}}const SI={name:"definition",tokenize:CI},NI={partial:!0,tokenize:EI};function CI(e,t,n){const s=this;let i;return l;function l(b){return e.enter("definition"),c(b)}function c(b){return oS.call(s,e,u,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(b)}function u(b){return i=Gi(s.sliceSerialize(s.events[s.events.length-1][1]).slice(1,-1)),b===58?(e.enter("definitionMarker"),e.consume(b),e.exit("definitionMarker"),p):n(b)}function p(b){return Qn(b)?vl(e,m)(b):m(b)}function m(b){return sS(e,h,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(b)}function h(b){return e.attempt(NI,x,x)(b)}function x(b){return gt(b)?Nt(e,y,"whitespace")(b):y(b)}function y(b){return b===null||Qe(b)?(e.exit("definition"),s.parser.defined.push(i),t(b)):n(b)}}function EI(e,t,n){return s;function s(u){return Qn(u)?vl(e,i)(u):n(u)}function i(u){return iS(e,l,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(u)}function l(u){return gt(u)?Nt(e,c,"whitespace")(u):c(u)}function c(u){return u===null||Qe(u)?t(u):n(u)}}const TI={name:"hardBreakEscape",tokenize:PI};function PI(e,t,n){return s;function s(l){return e.enter("hardBreakEscape"),e.consume(l),i}function i(l){return Qe(l)?(e.exit("hardBreakEscape"),t(l)):n(l)}}const RI={name:"headingAtx",resolve:AI,tokenize:DI};function AI(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"},cs(e,s,n-s+1,[["enter",i,t],["enter",l,t],["exit",l,t],["exit",i,t]])),e}function DI(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"),u(h)):n(h)}function u(h){return h===35?(e.enter("atxHeadingSequence"),p(h)):h===null||Qe(h)?(e.exit("atxHeading"),t(h)):gt(h)?Nt(e,u,"whitespace")(h):(e.enter("atxHeadingText"),m(h))}function p(h){return h===35?(e.consume(h),p):(e.exit("atxHeadingSequence"),u(h))}function m(h){return h===null||h===35||Qn(h)?(e.exit("atxHeadingText"),u(h)):(e.consume(h),m)}}const LI=["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"],aw=["pre","script","style","textarea"],$I={concrete:!0,name:"htmlFlow",resolveTo:MI,tokenize:_I},II={partial:!0,tokenize:zI},OI={partial:!0,tokenize:FI};function MI(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 _I(e,t,n){const s=this;let i,l,c,u,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):rs(L)?(e.consume(L),c=String.fromCharCode(L),w):n(L)}function y(L){return L===45?(e.consume(L),i=2,b):L===91?(e.consume(L),i=5,u=0,C):rs(L)?(e.consume(L),i=4,s.interrupt?t:T):n(L)}function b(L){return L===45?(e.consume(L),s.interrupt?t:T):n(L)}function C(L){const ee="CDATA[";return L===ee.charCodeAt(u++)?(e.consume(L),u===ee.length?s.interrupt?t:U:C):n(L)}function j(L){return rs(L)?(e.consume(L),c=String.fromCharCode(L),w):n(L)}function w(L){if(L===null||L===47||L===62||Qn(L)){const ee=L===47,de=c.toLowerCase();return!ee&&!l&&aw.includes(de)?(i=1,s.interrupt?t(L):U(L)):LI.includes(c.toLowerCase())?(i=6,ee?(e.consume(L),S):s.interrupt?t(L):U(L)):(i=7,s.interrupt&&!s.parser.lazy[s.now().line]?n(L):l?E(L):N(L))}return L===45||mr(L)?(e.consume(L),c+=String.fromCharCode(L),w):n(L)}function S(L){return L===62?(e.consume(L),s.interrupt?t:U):n(L)}function E(L){return gt(L)?(e.consume(L),E):Z(L)}function N(L){return L===47?(e.consume(L),Z):L===58||L===95||rs(L)?(e.consume(L),R):gt(L)?(e.consume(L),N):Z(L)}function R(L){return L===45||L===46||L===58||L===95||mr(L)?(e.consume(L),R):I(L)}function I(L){return L===61?(e.consume(L),P):gt(L)?(e.consume(L),I):N(L)}function P(L){return L===null||L===60||L===61||L===62||L===96?n(L):L===34||L===39?(e.consume(L),p=L,$):gt(L)?(e.consume(L),P):D(L)}function $(L){return L===p?(e.consume(L),p=null,X):L===null||Qe(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||gt(L)?N(L):n(L)}function Z(L){return L===62?(e.consume(L),z):n(L)}function z(L){return L===null||Qe(L)?U(L):gt(L)?(e.consume(L),z):n(L)}function U(L){return L===45&&i===2?(e.consume(L),Q):L===60&&i===1?(e.consume(L),le):L===62&&i===4?(e.consume(L),O):L===63&&i===3?(e.consume(L),T):L===93&&i===5?(e.consume(L),ne):Qe(L)&&(i===6||i===7)?(e.exit("htmlFlowData"),e.check(II,q,J)(L)):L===null||Qe(L)?(e.exit("htmlFlowData"),J(L)):(e.consume(L),U)}function J(L){return e.check(OI,_,q)(L)}function _(L){return e.enter("lineEnding"),e.consume(L),e.exit("lineEnding"),G}function G(L){return L===null||Qe(L)?J(L):(e.enter("htmlFlowData"),U(L))}function Q(L){return L===45?(e.consume(L),T):U(L)}function le(L){return L===47?(e.consume(L),c="",W):U(L)}function W(L){if(L===62){const ee=c.toLowerCase();return aw.includes(ee)?(e.consume(L),O):U(L)}return rs(L)&&c.length<8?(e.consume(L),c+=String.fromCharCode(L),W):U(L)}function ne(L){return L===93?(e.consume(L),T):U(L)}function T(L){return L===62?(e.consume(L),O):L===45&&i===2?(e.consume(L),T):U(L)}function O(L){return L===null||Qe(L)?(e.exit("htmlFlowData"),q(L)):(e.consume(L),O)}function q(L){return e.exit("htmlFlow"),t(L)}}function FI(e,t,n){const s=this;return i;function i(c){return Qe(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 zI(e,t,n){return s;function s(i){return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),e.attempt(Bd,t,n)}}const BI={name:"htmlText",tokenize:UI};function UI(e,t,n){const s=this;let i,l,c;return u;function u(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):rs(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):rs(T)?(e.consume(T),E):n(T)}function h(T){return T===45?(e.consume(T),b):n(T)}function x(T){return T===null?n(T):T===45?(e.consume(T),y):Qe(T)?(c=x,le(T)):(e.consume(T),x)}function y(T){return T===45?(e.consume(T),b):x(T)}function b(T){return T===62?Q(T):T===45?y(T):x(T)}function C(T){const O="CDATA[";return T===O.charCodeAt(l++)?(e.consume(T),l===O.length?j:C):n(T)}function j(T){return T===null?n(T):T===93?(e.consume(T),w):Qe(T)?(c=j,le(T)):(e.consume(T),j)}function w(T){return T===93?(e.consume(T),S):j(T)}function S(T){return T===62?Q(T):T===93?(e.consume(T),S):j(T)}function E(T){return T===null||T===62?Q(T):Qe(T)?(c=E,le(T)):(e.consume(T),E)}function N(T){return T===null?n(T):T===63?(e.consume(T),R):Qe(T)?(c=N,le(T)):(e.consume(T),N)}function R(T){return T===62?Q(T):N(T)}function I(T){return rs(T)?(e.consume(T),P):n(T)}function P(T){return T===45||mr(T)?(e.consume(T),P):$(T)}function $(T){return Qe(T)?(c=$,le(T)):gt(T)?(e.consume(T),$):Q(T)}function D(T){return T===45||mr(T)?(e.consume(T),D):T===47||T===62||Qn(T)?X(T):n(T)}function X(T){return T===47?(e.consume(T),Q):T===58||T===95||rs(T)?(e.consume(T),Z):Qe(T)?(c=X,le(T)):gt(T)?(e.consume(T),X):Q(T)}function Z(T){return T===45||T===46||T===58||T===95||mr(T)?(e.consume(T),Z):z(T)}function z(T){return T===61?(e.consume(T),U):Qe(T)?(c=z,le(T)):gt(T)?(e.consume(T),z):X(T)}function U(T){return T===null||T===60||T===61||T===62||T===96?n(T):T===34||T===39?(e.consume(T),i=T,J):Qe(T)?(c=U,le(T)):gt(T)?(e.consume(T),U):(e.consume(T),_)}function J(T){return T===i?(e.consume(T),i=void 0,G):T===null?n(T):Qe(T)?(c=J,le(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 G(T){return T===47||T===62||Qn(T)?X(T):n(T)}function Q(T){return T===62?(e.consume(T),e.exit("htmlTextData"),e.exit("htmlText"),t):n(T)}function le(T){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(T),e.exit("lineEnding"),W}function W(T){return gt(T)?Nt(e,ne,"linePrefix",s.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(T):ne(T)}function ne(T){return e.enter("htmlTextData"),c(T)}}const Bg={name:"labelEnd",resolveAll:KI,resolveTo:qI,tokenize:GI},VI={tokenize:YI},HI={tokenize:JI},WI={tokenize:XI};function KI(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&&cs(e,0,e.length,n),e}function qI(e,t){let n=e.length,s=0,i,l,c,u;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 u=[["enter",p,t],["enter",m,t]],u=Cr(u,e.slice(l+1,l+s+3)),u=Cr(u,[["enter",h,t]]),u=Cr(u,zg(t.parser.constructs.insideSpan.null,e.slice(l+s+4,c-3),t)),u=Cr(u,[["exit",h,t],e[c-2],e[c-1],["exit",m,t]]),u=Cr(u,e.slice(c+1)),u=Cr(u,[["exit",p,t]]),cs(e,l,e.length,u),e}function GI(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 u;function u(y){return l?l._inactive?x(y):(c=s.parser.defined.includes(Gi(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(VI,h,c?h:x)(y):y===91?e.attempt(HI,h,c?m:x)(y):c?h(y):x(y)}function m(y){return e.attempt(WI,h,x)(y)}function h(y){return t(y)}function x(y){return l._balanced=!0,n(y)}}function YI(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)?vl(e,l)(x):l(x)}function l(x){return x===41?h(x):sS(e,c,u,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(x)}function c(x){return Qn(x)?vl(e,p)(x):h(x)}function u(x){return n(x)}function p(x){return x===34||x===39||x===40?iS(e,m,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(x):h(x)}function m(x){return Qn(x)?vl(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 JI(e,t,n){const s=this;return i;function i(u){return oS.call(s,e,l,c,"reference","referenceMarker","referenceString")(u)}function l(u){return s.parser.defined.includes(Gi(s.sliceSerialize(s.events[s.events.length-1][1]).slice(1,-1)))?t(u):n(u)}function c(u){return n(u)}}function XI(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 QI={name:"labelStartImage",resolveAll:Bg.resolveAll,tokenize:ZI};function ZI(e,t,n){const s=this;return i;function i(u){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(u),e.exit("labelImageMarker"),l}function l(u){return u===91?(e.enter("labelMarker"),e.consume(u),e.exit("labelMarker"),e.exit("labelImage"),c):n(u)}function c(u){return u===94&&"_hiddenFootnoteSupport"in s.parser.constructs?n(u):t(u)}}const eO={name:"labelStartLink",resolveAll:Bg.resolveAll,tokenize:tO};function tO(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 bm={name:"lineEnding",tokenize:nO};function nO(e,t){return n;function n(s){return e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),Nt(e,t,"linePrefix")}}const _u={name:"thematicBreak",tokenize:rO};function rO(e,t,n){let s=0,i;return l;function l(m){return e.enter("thematicBreak"),c(m)}function c(m){return i=m,u(m)}function u(m){return m===i?(e.enter("thematicBreakSequence"),p(m)):s>=3&&(m===null||Qe(m))?(e.exit("thematicBreak"),t(m)):n(m)}function p(m){return m===i?(e.consume(m),s++,p):(e.exit("thematicBreakSequence"),gt(m)?Nt(e,u,"whitespace")(m):u(m))}}const Gn={continuation:{tokenize:aO},exit:cO,name:"list",tokenize:iO},sO={partial:!0,tokenize:uO},oO={partial:!0,tokenize:lO};function iO(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 u;function u(b){const C=s.containerState.type||(b===42||b===43||b===45?"listUnordered":"listOrdered");if(C==="listUnordered"?!s.containerState.marker||b===s.containerState.marker:hh(b)){if(s.containerState.type||(s.containerState.type=C,e.enter(C,{_container:!0})),C==="listUnordered")return e.enter("listItemPrefix"),b===42||b===45?e.check(_u,n,m)(b):m(b);if(!s.interrupt||b===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),p(b)}return n(b)}function p(b){return hh(b)&&++c<10?(e.consume(b),p):(!s.interrupt||c<2)&&(s.containerState.marker?b===s.containerState.marker:b===41||b===46)?(e.exit("listItemValue"),m(b)):n(b)}function m(b){return e.enter("listItemMarker"),e.consume(b),e.exit("listItemMarker"),s.containerState.marker=s.containerState.marker||b,e.check(Bd,s.interrupt?n:h,e.attempt(sO,y,x))}function h(b){return s.containerState.initialBlankLine=!0,l++,y(b)}function x(b){return gt(b)?(e.enter("listItemPrefixWhitespace"),e.consume(b),e.exit("listItemPrefixWhitespace"),y):n(b)}function y(b){return s.containerState.size=l+s.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(b)}}function aO(e,t,n){const s=this;return s.containerState._closeFlow=void 0,e.check(Bd,i,l);function i(u){return s.containerState.furtherBlankLines=s.containerState.furtherBlankLines||s.containerState.initialBlankLine,Nt(e,t,"listItemIndent",s.containerState.size+1)(u)}function l(u){return s.containerState.furtherBlankLines||!gt(u)?(s.containerState.furtherBlankLines=void 0,s.containerState.initialBlankLine=void 0,c(u)):(s.containerState.furtherBlankLines=void 0,s.containerState.initialBlankLine=void 0,e.attempt(oO,t,c)(u))}function c(u){return s.containerState._closeFlow=!0,s.interrupt=void 0,Nt(e,e.attempt(Gn,t,n),"linePrefix",s.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(u)}}function lO(e,t,n){const s=this;return Nt(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 cO(e){e.exit(this.containerState.type)}function uO(e,t,n){const s=this;return Nt(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!gt(l)&&c&&c[1].type==="listItemPrefixWhitespace"?t(l):n(l)}}const lw={name:"setextUnderline",resolveTo:dO,tokenize:fO};function dO(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 fO(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"),u(m)}function u(m){return m===i?(e.consume(m),u):(e.exit("setextHeadingLineSequence"),gt(m)?Nt(e,p,"lineSuffix")(m):p(m))}function p(m){return m===null||Qe(m)?(e.exit("setextHeadingLine"),t(m)):n(m)}}const pO={tokenize:mO};function mO(e){const t=this,n=e.attempt(Bd,s,e.attempt(this.parser.constructs.flowInitial,i,Nt(e,e.attempt(this.parser.constructs.flow,i,e.attempt(bI,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 hO={resolveAll:lS()},gO=aS("string"),xO=aS("text");function aS(e){return{resolveAll:lS(e==="text"?yO:void 0),tokenize:t};function t(n){const s=this,i=this.parser.constructs[e],l=n.attempt(i,c,u);return c;function c(h){return m(h)?l(h):u(h)}function u(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 b=x[y];if(!b.previous||b.previous.call(s,s.previous))return!0}return!1}}}function lS(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 yO(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,u=0,p;for(;l--;){const m=i[l];if(typeof m=="string"){for(c=m.length;m.charCodeAt(c-1)===32;)u++,c--;if(c)break;c=-1}else if(m===-2)p=!0,u++;else if(m!==-1){l++;break}}if(t._contentTypeTextTrailing&&n===e.length&&(u=0),u){const m={type:n===e.length||p||u<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:l?c:s.start._bufferIndex+c,_index:s.start._index+l,line:s.end.line,column:s.end.column-u,offset:s.end.offset-u},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 bO={42:Gn,43:Gn,45:Gn,48:Gn,49:Gn,50:Gn,51:Gn,52:Gn,53:Gn,54:Gn,55:Gn,56:Gn,57:Gn,62:eS},vO={91:SI},wO={[-2]:ym,[-1]:ym,32:ym},jO={35:RI,42:_u,45:[lw,_u],60:$I,61:lw,95:_u,96:iw,126:iw},kO={38:nS,92:tS},SO={[-5]:bm,[-4]:bm,[-3]:bm,33:QI,38:nS,42:gh,60:[eI,BI],91:eO,92:[TI,tS],93:Bg,95:gh,96:pI},NO={null:[gh,hO]},CO={null:[42,95]},EO={null:[]},TO=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:CO,contentInitial:vO,disable:EO,document:bO,flow:jO,flowInitial:wO,insideSpan:NO,string:kO,text:SO},Symbol.toStringTag,{value:"Module"}));function PO(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=[],u=[];const p={attempt:$(I),check:$(P),consume:E,enter:N,exit:R,interrupt:$(P,{interrupt:!0})},m={code:null,containerState:{},defineSkip:j,events:[],now:C,parser:e,previous:null,sliceSerialize:y,sliceStream:b,write:x};let h=t.tokenize.call(m,p);return t.resolveAll&&l.push(t),m;function x(z){return c=Cr(c,z),w(),c[c.length-1]!==null?[]:(D(t,0),m.events=zg(l,m.events,m),m.events)}function y(z,U){return AO(b(z),U)}function b(z){return RO(c,z)}function C(){const{_bufferIndex:z,_index:U,line:J,column:_,offset:G}=s;return{_bufferIndex:z,_index:U,line:J,column:_,offset:G}}function j(z){i[z.line]=z.column,Z()}function w(){let z;for(;s._index<c.length;){const U=c[s._index];if(typeof U=="string")for(z=s._index,s._bufferIndex<0&&(s._bufferIndex=0);s._index===z&&s._bufferIndex<U.length;)S(U.charCodeAt(s._bufferIndex));else S(U)}}function S(z){h=h(z)}function E(z){Qe(z)?(s.line++,s.column=1,s.offset+=z===-3?2:1,Z()):z!==-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=z}function N(z,U){const J=U||{};return J.type=z,J.start=C(),m.events.push(["enter",J,m]),u.push(J),J}function R(z){const U=u.pop();return U.end=C(),m.events.push(["exit",U,m]),U}function I(z,U){D(z,U.from)}function P(z,U){U.restore()}function $(z,U){return J;function J(_,G,Q){let le,W,ne,T;return Array.isArray(_)?q(_):"tokenize"in _?q([_]):O(_);function O(F){return re;function re(me){const ve=me!==null&&F[me],Se=me!==null&&F.null,fe=[...Array.isArray(ve)?ve:ve?[ve]:[],...Array.isArray(Se)?Se:Se?[Se]:[]];return q(fe)(me)}}function q(F){return le=F,W=0,F.length===0?Q:L(F[W])}function L(F){return re;function re(me){return T=X(),ne=F,F.partial||(m.currentConstruct=F),F.name&&m.parser.constructs.disable.null.includes(F.name)?de():F.tokenize.call(U?Object.assign(Object.create(m),U):m,p,ee,de)(me)}}function ee(F){return z(ne,T),G}function de(F){return T.restore(),++W<le.length?L(le[W]):Q}}}function D(z,U){z.resolveAll&&!l.includes(z)&&l.push(z),z.resolve&&cs(m.events,U,m.events.length-U,z.resolve(m.events.slice(U),m)),z.resolveTo&&(m.events=z.resolveTo(m.events,m))}function X(){const z=C(),U=m.previous,J=m.currentConstruct,_=m.events.length,G=Array.from(u);return{from:_,restore:Q};function Q(){s=z,m.previous=U,m.currentConstruct=J,m.events.length=_,u=G,Z()}}function Z(){s.line in i&&s.column<2&&(s.column=i[s.line],s.offset+=i[s.line]-1)}}function RO(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 u=c[0];typeof u=="string"?c[0]=u.slice(s):c.shift()}l>0&&c.push(e[i].slice(0,l))}return c}function AO(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 DO(e){const s={constructs:F$([TO,...(e||{}).extensions||[]]),content:i(q$),defined:[],document:i(Y$),flow:i(pO),lazy:{},string:i(gO),text:i(xO)};return s;function i(l){return c;function c(u){return PO(s,l,u)}}}function LO(e){for(;!rS(e););return e}const cw=/[\0\t\n\r]/g;function $O(){let e=1,t="",n=!0,s;return i;function i(l,c,u){const p=[];let m,h,x,y,b;for(l=t+(typeof l=="string"?l.toString():new TextDecoder(c||void 0).decode(l)),x=0,t="",n&&(l.charCodeAt(0)===65279&&x++,n=void 0);x<l.length;){if(cw.lastIndex=x,m=cw.exec(l),y=m&&m.index!==void 0?m.index:l.length,b=l.charCodeAt(y),!m){t=l.slice(x);break}if(b===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),b){case 0:{p.push(65533),e++;break}case 9:{for(h=Math.ceil(e/4)*4,p.push(-2);e++<h;)p.push(-1);break}case 10:{p.push(-4),e=1;break}default:s=!0,e=1}x=y+1}return u&&(s&&p.push(-5),t&&p.push(t),p.push(null)),p}}const IO=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function OO(e){return e.replace(IO,MO)}function MO(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){const i=n.charCodeAt(1),l=i===120||i===88;return Z1(n.slice(l?2:1),l?16:10)}return Fg(n)||e}const cS={}.hasOwnProperty;function _O(e,t,n){return t&&typeof t=="object"&&(n=t,t=void 0),FO(n)(LO(DO(n).document().write($O()(e,t,!0))))}function FO(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:l(Ae),autolinkProtocol:X,autolinkEmail:X,atxHeading:l(V),blockQuote:l(Se),characterEscape:X,characterReference:X,codeFenced:l(fe),codeFencedFenceInfo:c,codeFencedFenceMeta:c,codeIndented:l(fe,c),codeText:l(He,c),codeTextData:X,data:X,codeFlowValue:X,definition:l(pe),definitionDestinationString:c,definitionLabelString:c,definitionTitleString:c,emphasis:l(Pe),hardBreakEscape:l(H),hardBreakTrailing:l(H),htmlFlow:l(ae,c),htmlFlowData:X,htmlText:l(ae,c),htmlTextData:X,image:l(he),label:c,link:l(Ae),listItem:l(Ve),listItemValue:y,listOrdered:l(Te,x),listUnordered:l(Te),paragraph:l(Ze),reference:L,referenceString:c,resourceDestinationString:c,resourceTitleString:c,setextHeading:l(V),strong:l(Tt),thematicBreak:l(jt)},exit:{atxHeading:p(),atxHeadingSequence:I,autolink:p(),autolinkEmail:ve,autolinkProtocol:me,blockQuote:p(),characterEscapeValue:Z,characterReferenceMarkerHexadecimal:de,characterReferenceMarkerNumeric:de,characterReferenceValue:F,characterReference:re,codeFenced:p(w),codeFencedFence:j,codeFencedFenceInfo:b,codeFencedFenceMeta:C,codeFlowValue:Z,codeIndented:p(S),codeText:p(G),codeTextData:Z,data:Z,definition:p(),definitionDestinationString:R,definitionLabelString:E,definitionTitleString:N,emphasis:p(),hardBreakEscape:p(U),hardBreakTrailing:p(U),htmlFlow:p(J),htmlFlowData:Z,htmlText:p(_),htmlTextData:Z,image:p(le),label:ne,labelText:W,lineEnding:z,link:p(Q),listItem:p(),listOrdered:p(),listUnordered:p(),paragraph:p(),referenceString:ee,resourceDestinationString:T,resourceTitleString:O,resource:q,setextHeading:p(D),setextHeadingLineSequence:$,setextHeadingText:P,strong:p(),thematicBreak:p()}};uS(t,(e||{}).mdastExtensions||[]);const n={};return s;function s(ue){let ye={type:"root",children:[]};const Le={stack:[ye],tokenStack:[],config:t,enter:u,exit:m,buffer:c,resume:h,data:n},Ie=[];let We=-1;for(;++We<ue.length;)if(ue[We][1].type==="listOrdered"||ue[We][1].type==="listUnordered")if(ue[We][0]==="enter")Ie.push(We);else{const et=Ie.pop();We=i(ue,et,We)}for(We=-1;++We<ue.length;){const et=t[ue[We][0]];cS.call(et,ue[We][1].type)&&et[ue[We][1].type].call(Object.assign({sliceSerialize:ue[We][2].sliceSerialize},Le),ue[We][1])}if(Le.tokenStack.length>0){const et=Le.tokenStack[Le.tokenStack.length-1];(et[1]||uw).call(Le,void 0,et[0])}for(ye.position={start:Js(ue.length>0?ue[0][1].start:{line:1,column:1,offset:0}),end:Js(ue.length>0?ue[ue.length-2][1].end:{line:1,column:1,offset:0})},We=-1;++We<t.transforms.length;)ye=t.transforms[We](ye)||ye;return ye}function i(ue,ye,Le){let Ie=ye-1,We=-1,et=!1,_t,bt,Qt,sn;for(;++Ie<=Le;){const vt=ue[Ie];switch(vt[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{vt[0]==="enter"?We++:We--,sn=void 0;break}case"lineEndingBlank":{vt[0]==="enter"&&(_t&&!sn&&!We&&!Qt&&(Qt=Ie),sn=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:sn=void 0}if(!We&&vt[0]==="enter"&&vt[1].type==="listItemPrefix"||We===-1&&vt[0]==="exit"&&(vt[1].type==="listUnordered"||vt[1].type==="listOrdered")){if(_t){let xe=Ie;for(bt=void 0;xe--;){const Ye=ue[xe];if(Ye[1].type==="lineEnding"||Ye[1].type==="lineEndingBlank"){if(Ye[0]==="exit")continue;bt&&(ue[bt][1].type="lineEndingBlank",et=!0),Ye[1].type="lineEnding",bt=xe}else if(!(Ye[1].type==="linePrefix"||Ye[1].type==="blockQuotePrefix"||Ye[1].type==="blockQuotePrefixWhitespace"||Ye[1].type==="blockQuoteMarker"||Ye[1].type==="listItemIndent"))break}Qt&&(!bt||Qt<bt)&&(_t._spread=!0),_t.end=Object.assign({},bt?ue[bt][1].start:vt[1].end),ue.splice(bt||Ie,0,["exit",_t,vt[2]]),Ie++,Le++}if(vt[1].type==="listItemPrefix"){const xe={type:"listItem",_spread:!1,start:Object.assign({},vt[1].start),end:void 0};_t=xe,ue.splice(Ie,0,["enter",xe,vt[2]]),Ie++,Le++,Qt=void 0,sn=!0}}}return ue[ye][1]._spread=et,Le}function l(ue,ye){return Le;function Le(Ie){u.call(this,ue(Ie),Ie),ye&&ye.call(this,Ie)}}function c(){this.stack.push({type:"fragment",children:[]})}function u(ue,ye,Le){this.stack[this.stack.length-1].children.push(ue),this.stack.push(ue),this.tokenStack.push([ye,Le||void 0]),ue.position={start:Js(ye.start),end:void 0}}function p(ue){return ye;function ye(Le){ue&&ue.call(this,Le),m.call(this,Le)}}function m(ue,ye){const Le=this.stack.pop(),Ie=this.tokenStack.pop();if(Ie)Ie[0].type!==ue.type&&(ye?ye.call(this,ue,Ie[0]):(Ie[1]||uw).call(this,ue,Ie[0]));else throw new Error("Cannot close `"+ue.type+"` ("+bl({start:ue.start,end:ue.end})+"): it’s not open");Le.position.end=Js(ue.end)}function h(){return M$(this.stack.pop())}function x(){this.data.expectingFirstListItemValue=!0}function y(ue){if(this.data.expectingFirstListItemValue){const ye=this.stack[this.stack.length-2];ye.start=Number.parseInt(this.sliceSerialize(ue),10),this.data.expectingFirstListItemValue=void 0}}function b(){const ue=this.resume(),ye=this.stack[this.stack.length-1];ye.lang=ue}function C(){const ue=this.resume(),ye=this.stack[this.stack.length-1];ye.meta=ue}function j(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function w(){const ue=this.resume(),ye=this.stack[this.stack.length-1];ye.value=ue.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function S(){const ue=this.resume(),ye=this.stack[this.stack.length-1];ye.value=ue.replace(/(\r?\n|\r)$/g,"")}function E(ue){const ye=this.resume(),Le=this.stack[this.stack.length-1];Le.label=ye,Le.identifier=Gi(this.sliceSerialize(ue)).toLowerCase()}function N(){const ue=this.resume(),ye=this.stack[this.stack.length-1];ye.title=ue}function R(){const ue=this.resume(),ye=this.stack[this.stack.length-1];ye.url=ue}function I(ue){const ye=this.stack[this.stack.length-1];if(!ye.depth){const Le=this.sliceSerialize(ue).length;ye.depth=Le}}function P(){this.data.setextHeadingSlurpLineEnding=!0}function $(ue){const ye=this.stack[this.stack.length-1];ye.depth=this.sliceSerialize(ue).codePointAt(0)===61?1:2}function D(){this.data.setextHeadingSlurpLineEnding=void 0}function X(ue){const Le=this.stack[this.stack.length-1].children;let Ie=Le[Le.length-1];(!Ie||Ie.type!=="text")&&(Ie=yt(),Ie.position={start:Js(ue.start),end:void 0},Le.push(Ie)),this.stack.push(Ie)}function Z(ue){const ye=this.stack.pop();ye.value+=this.sliceSerialize(ue),ye.position.end=Js(ue.end)}function z(ue){const ye=this.stack[this.stack.length-1];if(this.data.atHardBreak){const Le=ye.children[ye.children.length-1];Le.position.end=Js(ue.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(ye.type)&&(X.call(this,ue),Z.call(this,ue))}function U(){this.data.atHardBreak=!0}function J(){const ue=this.resume(),ye=this.stack[this.stack.length-1];ye.value=ue}function _(){const ue=this.resume(),ye=this.stack[this.stack.length-1];ye.value=ue}function G(){const ue=this.resume(),ye=this.stack[this.stack.length-1];ye.value=ue}function Q(){const ue=this.stack[this.stack.length-1];if(this.data.inReference){const ye=this.data.referenceType||"shortcut";ue.type+="Reference",ue.referenceType=ye,delete ue.url,delete ue.title}else delete ue.identifier,delete ue.label;this.data.referenceType=void 0}function le(){const ue=this.stack[this.stack.length-1];if(this.data.inReference){const ye=this.data.referenceType||"shortcut";ue.type+="Reference",ue.referenceType=ye,delete ue.url,delete ue.title}else delete ue.identifier,delete ue.label;this.data.referenceType=void 0}function W(ue){const ye=this.sliceSerialize(ue),Le=this.stack[this.stack.length-2];Le.label=OO(ye),Le.identifier=Gi(ye).toLowerCase()}function ne(){const ue=this.stack[this.stack.length-1],ye=this.resume(),Le=this.stack[this.stack.length-1];if(this.data.inReference=!0,Le.type==="link"){const Ie=ue.children;Le.children=Ie}else Le.alt=ye}function T(){const ue=this.resume(),ye=this.stack[this.stack.length-1];ye.url=ue}function O(){const ue=this.resume(),ye=this.stack[this.stack.length-1];ye.title=ue}function q(){this.data.inReference=void 0}function L(){this.data.referenceType="collapsed"}function ee(ue){const ye=this.resume(),Le=this.stack[this.stack.length-1];Le.label=ye,Le.identifier=Gi(this.sliceSerialize(ue)).toLowerCase(),this.data.referenceType="full"}function de(ue){this.data.characterReferenceType=ue.type}function F(ue){const ye=this.sliceSerialize(ue),Le=this.data.characterReferenceType;let Ie;Le?(Ie=Z1(ye,Le==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):Ie=Fg(ye);const We=this.stack[this.stack.length-1];We.value+=Ie}function re(ue){const ye=this.stack.pop();ye.position.end=Js(ue.end)}function me(ue){Z.call(this,ue);const ye=this.stack[this.stack.length-1];ye.url=this.sliceSerialize(ue)}function ve(ue){Z.call(this,ue);const ye=this.stack[this.stack.length-1];ye.url="mailto:"+this.sliceSerialize(ue)}function Se(){return{type:"blockquote",children:[]}}function fe(){return{type:"code",lang:null,meta:null,value:""}}function He(){return{type:"inlineCode",value:""}}function pe(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function Pe(){return{type:"emphasis",children:[]}}function V(){return{type:"heading",depth:0,children:[]}}function H(){return{type:"break"}}function ae(){return{type:"html",value:""}}function he(){return{type:"image",title:null,url:"",alt:null}}function Ae(){return{type:"link",title:null,url:"",children:[]}}function Te(ue){return{type:"list",ordered:ue.type==="listOrdered",start:null,spread:ue._spread,children:[]}}function Ve(ue){return{type:"listItem",spread:ue._spread,checked:null,children:[]}}function Ze(){return{type:"paragraph",children:[]}}function Tt(){return{type:"strong",children:[]}}function yt(){return{type:"text",value:""}}function jt(){return{type:"thematicBreak"}}}function Js(e){return{line:e.line,column:e.column,offset:e.offset}}function uS(e,t){let n=-1;for(;++n<t.length;){const s=t[n];Array.isArray(s)?uS(e,s):zO(e,s)}}function zO(e,t){let n;for(n in t)if(cS.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 uw(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+bl({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+bl({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+bl({start:t.start,end:t.end})+") is still open")}function BO(e){const t=this;t.parser=n;function n(s){return _O(s,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function UO(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 VO(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:`
|
|
504
|
+
`}]}function HO(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 WO(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function KO(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function qO(e,t){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",s=String(t.identifier).toUpperCase(),i=ua(s.toLowerCase()),l=e.footnoteOrder.indexOf(s);let c,u=e.footnoteCounts.get(s);u===void 0?(u=0,e.footnoteOrder.push(s),c=e.footnoteOrder.length):c=l+1,u+=1,e.footnoteCounts.set(s,u);const p={type:"element",tagName:"a",properties:{href:"#"+n+"fn-"+i,id:n+"fnref-"+i+(u>1?"-"+u:""),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 GO(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 YO(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}}function dS(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 JO(e,t){const n=String(t.identifier).toUpperCase(),s=e.definitionById.get(n);if(!s)return dS(e,t);const i={src:ua(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 XO(e,t){const n={src:ua(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 QO(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 ZO(e,t){const n=String(t.identifier).toUpperCase(),s=e.definitionById.get(n);if(!s)return dS(e,t);const i={href:ua(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 eM(e,t){const n={href:ua(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 tM(e,t,n){const s=e.all(t),i=n?nM(n):fS(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 u=-1;for(;++u<s.length;){const h=s[u];(i||u!==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 nM(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=fS(n[s])}return t}function fS(e){const t=e.spread;return t??e.children.length>1}function rM(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 sM(e,t){const n={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function oM(e,t){const n={type:"root",children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function iM(e,t){const n={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function aM(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)},u=Ig(t.children[1]),p=K1(t.children[t.children.length-1]);u&&p&&(c.position={start:u,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 lM(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,u=c?c.length:t.children.length;let p=-1;const m=[];for(;++p<u;){const x=t.children[p],y={},b=c?c[p]:void 0;b&&(y.align=b);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 cM(e,t){const n={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}const dw=9,fw=32;function uM(e){const t=String(e),n=/\r?\n|\r/g;let s=n.exec(t),i=0;const l=[];for(;s;)l.push(pw(t.slice(i,s.index),i>0,!0),s[0]),i=s.index+s[0].length,s=n.exec(t);return l.push(pw(t.slice(i),i>0,!1)),l.join("")}function pw(e,t,n){let s=0,i=e.length;if(t){let l=e.codePointAt(s);for(;l===dw||l===fw;)s++,l=e.codePointAt(s)}if(n){let l=e.codePointAt(i-1);for(;l===dw||l===fw;)i--,l=e.codePointAt(i-1)}return i>s?e.slice(s,i):""}function dM(e,t){const n={type:"text",value:uM(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function fM(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const pM={blockquote:UO,break:VO,code:HO,delete:WO,emphasis:KO,footnoteReference:qO,heading:GO,html:YO,imageReference:JO,image:XO,inlineCode:QO,linkReference:ZO,link:eM,listItem:tM,list:rM,paragraph:sM,root:oM,strong:iM,table:aM,tableCell:cM,tableRow:lM,text:dM,thematicBreak:fM,toml:bu,yaml:bu,definition:bu,footnoteDefinition:bu};function bu(){}const pS=-1,Ud=0,wl=1,rd=2,Ug=3,Vg=4,Hg=5,Wg=6,mS=7,hS=8,mw=typeof self=="object"?self:globalThis,mM=(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 Ud:case pS:return n(c,i);case wl:{const u=n([],i);for(const p of c)u.push(s(p));return u}case rd:{const u=n({},i);for(const[p,m]of c)u[s(p)]=s(m);return u}case Ug:return n(new Date(c),i);case Vg:{const{source:u,flags:p}=c;return n(new RegExp(u,p),i)}case Hg:{const u=n(new Map,i);for(const[p,m]of c)u.set(s(p),s(m));return u}case Wg:{const u=n(new Set,i);for(const p of c)u.add(s(p));return u}case mS:{const{name:u,message:p}=c;return n(new mw[u](p),i)}case hS: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:u}=new Uint8Array(c);return n(new DataView(u),c)}}return n(new mw[l](c),i)};return s},hw=e=>mM(new Map,e)(0),Pi="",{toString:hM}={},{keys:gM}=Object,dl=e=>{const t=typeof e;if(t!=="object"||!e)return[Ud,t];const n=hM.call(e).slice(8,-1);switch(n){case"Array":return[wl,Pi];case"Object":return[rd,Pi];case"Date":return[Ug,Pi];case"RegExp":return[Vg,Pi];case"Map":return[Hg,Pi];case"Set":return[Wg,Pi];case"DataView":return[wl,n]}return n.includes("Array")?[wl,n]:n.includes("Error")?[mS,n]:[rd,n]},vu=([e,t])=>e===Ud&&(t==="function"||t==="symbol"),xM=(e,t,n,s)=>{const i=(c,u)=>{const p=s.push(c)-1;return n.set(u,p),p},l=c=>{if(n.has(c))return n.get(c);let[u,p]=dl(c);switch(u){case Ud:{let h=c;switch(p){case"bigint":u=hS,h=c.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+p);h=null;break;case"undefined":return i([pS],c)}return i([u,h],c)}case wl:{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([u,h],c);for(const y of c)h.push(l(y));return x}case rd:{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([u,h],c);for(const y of gM(c))(e||!vu(dl(c[y])))&&h.push([l(y),l(c[y])]);return x}case Ug:return i([u,c.toISOString()],c);case Vg:{const{source:h,flags:x}=c;return i([u,{source:h,flags:x}],c)}case Hg:{const h=[],x=i([u,h],c);for(const[y,b]of c)(e||!(vu(dl(y))||vu(dl(b))))&&h.push([l(y),l(b)]);return x}case Wg:{const h=[],x=i([u,h],c);for(const y of c)(e||!vu(dl(y)))&&h.push(l(y));return x}}const{message:m}=c;return i([u,{name:p,message:m}],c)};return l},gw=(e,{json:t,lossy:n}={})=>{const s=[];return xM(!(t||n),!!t,new Map,s)(e),s},sd=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?hw(gw(e,t)):structuredClone(e):(e,t)=>hw(gw(e,t));function yM(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 bM(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function vM(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||yM,s=e.options.footnoteBackLabel||bM,i=e.options.footnoteLabel||"Footnotes",l=e.options.footnoteLabelTagName||"h2",c=e.options.footnoteLabelProperties||{className:["sr-only"]},u=[];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=ua(x.toLowerCase());let b=0;const C=[],j=e.footnoteCounts.get(x);for(;j!==void 0&&++b<=j;){C.length>0&&C.push({type:"text",value:" "});let E=typeof n=="string"?n:n(p,b);typeof E=="string"&&(E={type:"text",value:E}),C.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+y+(b>1?"-"+b:""),dataFootnoteBackref:"",ariaLabel:typeof s=="string"?s:s(p,b),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),u.push(S)}if(u.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:l,properties:{...sd(c),id:"footnote-label"},children:[{type:"text",value:i}]},{type:"text",value:`
|
|
508
|
+
`},{type:"element",tagName:"ol",properties:{},children:e.wrap(u,!0)},{type:"text",value:`
|
|
509
|
+
`}]}}const gS=(function(e){if(e==null)return SM;if(typeof e=="function")return Vd(e);if(typeof e=="object")return Array.isArray(e)?wM(e):jM(e);if(typeof e=="string")return kM(e);throw new Error("Expected function, string, or object as test")});function wM(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=gS(e[n]);return Vd(s);function s(...i){let l=-1;for(;++l<t.length;)if(t[l].apply(this,i))return!0;return!1}}function jM(e){const t=e;return Vd(n);function n(s){const i=s;let l;for(l in e)if(i[l]!==t[l])return!1;return!0}}function kM(e){return Vd(t);function t(n){return n&&n.type===e}}function Vd(e){return t;function t(n,s,i){return!!(NM(n)&&e.call(this,n,typeof s=="number"?s:void 0,i||void 0))}}function SM(){return!0}function NM(e){return e!==null&&typeof e=="object"&&"type"in e}const xS=[],CM=!0,xw=!1,EM="skip";function TM(e,t,n,s){let i;typeof t=="function"&&typeof n!="function"?(s=n,n=t):i=t;const l=gS(i),c=s?-1:1;u(e,void 0,[])();function u(p,m,h){const x=p&&typeof p=="object"?p:{};if(typeof x.type=="string"){const b=typeof x.tagName=="string"?x.tagName:typeof x.name=="string"?x.name:void 0;Object.defineProperty(y,"name",{value:"node ("+(p.type+(b?"<"+b+">":""))+")"})}return y;function y(){let b=xS,C,j,w;if((!t||l(p,m,h[h.length-1]||void 0))&&(b=PM(n(p,h)),b[0]===xw))return b;if("children"in p&&p.children){const S=p;if(S.children&&b[0]!==EM)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=u(E,j,w)(),C[0]===xw)return C;j=typeof C[1]=="number"?C[1]:j+c}}return b}}}function PM(e){return Array.isArray(e)?e:typeof e=="number"?[CM,e]:e==null?xS:[e]}function yS(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),TM(e,l,u,i);function u(p,m){const h=m[m.length-1],x=h?h.children.indexOf(p):void 0;return c(p,x,h)}}const xh={}.hasOwnProperty,RM={};function AM(e,t){const n=t||RM,s=new Map,i=new Map,l=new Map,c={...pM,...n.handlers},u={all:m,applyData:LM,definitionById:s,footnoteById:i,footnoteCounts:l,footnoteOrder:[],handlers:c,one:p,options:n,patch:DM,wrap:IM};return yS(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)}}),u;function p(h,x){const y=h.type,b=u.handlers[y];if(xh.call(u.handlers,y)&&b)return b(u,h,x);if(u.options.passThrough&&u.options.passThrough.includes(y)){if("children"in h){const{children:j,...w}=h,S=sd(w);return S.children=u.all(h),S}return sd(h)}return(u.options.unknownHandler||$M)(u,h,x)}function m(h){const x=[];if("children"in h){const y=h.children;let b=-1;for(;++b<y.length;){const C=u.one(y[b],h);if(C){if(b&&y[b-1].type==="break"&&(!Array.isArray(C)&&C.type==="text"&&(C.value=yw(C.value)),!Array.isArray(C)&&C.type==="element")){const j=C.children[0];j&&j.type==="text"&&(j.value=yw(j.value))}Array.isArray(C)?x.push(...C):x.push(C)}}}return x}}function DM(e,t){e.position&&(t.position=h$(e))}function LM(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,sd(l)),"children"in n&&n.children&&i!==null&&i!==void 0&&(n.children=i)}return n}function $M(e,t){const n=t.data||{},s="value"in t&&!(xh.call(n,"hProperties")||xh.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 IM(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 yw(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function bw(e,t){const n=AM(e,t),s=n.one(e,void 0),i=vM(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 OM(e,t){return e&&"run"in e?async function(n,s){const i=bw(n,{file:s,...t});await e.run(i,s)}:function(n,s){return bw(n,{file:s,...e||t})}}function vw(e){if(e)throw e}var vm,ww;function MM(){if(ww)return vm;ww=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},u=function(m,h){if(h==="__proto__")if(e.call(m,h)){if(s)return s(m,h).value}else return;return m[h]};return vm=function p(){var m,h,x,y,b,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=u(j,h),y=u(m,h),j!==y&&(E&&y&&(l(y)||(b=i(y)))?(b?(b=!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},vm}var _M=MM();const wm=fd(_M);function yh(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 FM(){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);u(null,...i);function u(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?zM(h,u)(...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 zM(e,t){let n;return s;function s(...c){const u=e.length>c.length;let p;u&&c.push(i);try{p=e.apply(this,c)}catch(m){const h=m;if(u&&n)throw h;return i(h)}u||(p&&p.then&&typeof p.then=="function"?p.then(l,i):p instanceof Error?i(p):l(p))}function i(c,...u){n||(n=!0,t(c,...u))}function l(c){i(null,c)}}const ts={basename:BM,dirname:UM,extname:VM,join:HM,sep:"/"};function BM(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');ec(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,u=t.length-1;for(;i--;)if(e.codePointAt(i)===47){if(l){n=i+1;break}}else c<0&&(l=!0,c=i+1),u>-1&&(e.codePointAt(i)===t.codePointAt(u--)?u<0&&(s=i):(u=-1,s=c));return n===s?s=c:s<0&&(s=e.length),e.slice(n,s)}function UM(e){if(ec(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 VM(e){ec(e);let t=e.length,n=-1,s=0,i=-1,l=0,c;for(;t--;){const u=e.codePointAt(t);if(u===47){if(c){s=t+1;break}continue}n<0&&(c=!0,n=t+1),u===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 HM(...e){let t=-1,n;for(;++t<e.length;)ec(e[t]),e[t]&&(n=n===void 0?e[t]:n+"/"+e[t]);return n===void 0?".":WM(n)}function WM(e){ec(e);const t=e.codePointAt(0)===47;let n=KM(e,!t);return n.length===0&&!t&&(n="."),n.length>0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function KM(e,t){let n="",s=0,i=-1,l=0,c=-1,u,p;for(;++c<=e.length;){if(c<e.length)u=e.codePointAt(c);else{if(u===47)break;u=47}if(u===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 u===46&&l>-1?l++:l=-1}return n}function ec(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const qM={cwd:GM};function GM(){return"/"}function bh(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function YM(e){if(typeof e=="string")e=new URL(e);else if(!bh(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 JM(e)}function JM(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 jm=["history","path","basename","stem","extname","dirname"];class bS{constructor(t){let n;t?bh(t)?n={path:t}:typeof t=="string"||XM(t)?n={value:t}:n=t:n={},this.cwd="cwd"in n?"":qM.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let s=-1;for(;++s<jm.length;){const l=jm[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)jm.includes(i)||(this[i]=n[i])}get basename(){return typeof this.path=="string"?ts.basename(this.path):void 0}set basename(t){Sm(t,"basename"),km(t,"basename"),this.path=ts.join(this.dirname||"",t)}get dirname(){return typeof this.path=="string"?ts.dirname(this.path):void 0}set dirname(t){jw(this.basename,"dirname"),this.path=ts.join(t||"",this.basename)}get extname(){return typeof this.path=="string"?ts.extname(this.path):void 0}set extname(t){if(km(t,"extname"),jw(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=ts.join(this.dirname,this.stem+(t||""))}get path(){return this.history[this.history.length-1]}set path(t){bh(t)&&(t=YM(t)),Sm(t,"path"),this.path!==t&&this.history.push(t)}get stem(){return typeof this.path=="string"?ts.basename(this.path,this.extname):void 0}set stem(t){Sm(t,"stem"),km(t,"stem"),this.path=ts.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 An(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 km(e,t){if(e&&e.includes(ts.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+ts.sep+"`")}function Sm(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function jw(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function XM(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const QM=(function(e){const s=this.constructor.prototype,i=s[e],l=function(){return i.apply(l,arguments)};return Object.setPrototypeOf(l,s),l}),ZM={}.hasOwnProperty;class Kg extends QM{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=FM()}copy(){const t=new Kg;let n=-1;for(;++n<this.attachers.length;){const s=this.attachers[n];t.use(...s)}return t.data(wm(!0,{},this.namespace)),t}data(t,n){return typeof t=="string"?arguments.length===2?(Em("data",this.frozen),this.namespace[t]=n,this):ZM.call(this.namespace,t)&&this.namespace[t]||void 0:t?(Em("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=wu(t),s=this.parser||this.Parser;return Nm("parse",s),s(String(n),n)}process(t,n){const s=this;return this.freeze(),Nm("process",this.parser||this.Parser),Cm("process",this.compiler||this.Compiler),n?i(void 0,n):new Promise(i);function i(l,c){const u=wu(t),p=s.parse(u);s.run(p,u,function(h,x,y){if(h||!x||!y)return m(h);const b=x,C=s.stringify(b,y);n_(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(),Nm("processSync",this.parser||this.Parser),Cm("processSync",this.compiler||this.Compiler),this.process(t,i),Sw("processSync","process",n),s;function i(l,c){n=!0,vw(l),s=c}}run(t,n,s){kw(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,u){const p=wu(n);i.run(t,p,m);function m(h,x,y){const b=x||t;h?u(h):c?c(b):s(void 0,b,y)}}}runSync(t,n){let s=!1,i;return this.run(t,n,l),Sw("runSync","run",s),i;function l(c,u){vw(c),i=u,s=!0}}stringify(t,n){this.freeze();const s=wu(n),i=this.compiler||this.Compiler;return Cm("stringify",i),kw(t),i(t,s)}use(t,...n){const s=this.attachers,i=this.namespace;if(Em("use",this.frozen),t!=null)if(typeof t=="function")p(t,n);else if(typeof t=="object")Array.isArray(t)?u(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");u(m.plugins),m.settings&&(i.settings=wm(!0,i.settings,m.settings))}function u(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[b,...C]=h;const j=s[y][1];yh(j)&&yh(b)&&(b=wm(!0,j,b)),s[y]=[m,b,...C]}}}}const e_=new Kg().freeze();function Nm(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function Cm(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function Em(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 kw(e){if(!yh(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function Sw(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function wu(e){return t_(e)?e:new bS(e)}function t_(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function n_(e){return typeof e=="string"||r_(e)}function r_(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const s_="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",Nw=[],Cw={allowDangerousHtml:!0},o_=/^(https?|ircs?|mailto|xmpp)$/i,i_=[{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 a_(e){const t=l_(e),n=c_(e);return u_(t.runSync(t.parse(n),n),e)}function l_(e){const t=e.rehypePlugins||Nw,n=e.remarkPlugins||Nw,s=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...Cw}:Cw;return e_().use(BO).use(n).use(OM,s).use(t)}function c_(e){const t=e.children||"",n=new bS;return typeof t=="string"&&(n.value=t),n}function u_(e,t){const n=t.allowedElements,s=t.allowElement,i=t.components,l=t.disallowedElements,c=t.skipHtml,u=t.unwrapDisallowed,p=t.urlTransform||d_;for(const h of i_)Object.hasOwn(t,h.from)&&(""+h.from+(h.to?"use `"+h.to+"` instead":"remove it")+s_+h.id,void 0);return t.className&&(e={type:"element",tagName:"div",properties:{className:t.className},children:e.type==="root"?e.children:[e]}),yS(e,m),v$(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 b;for(b in xm)if(Object.hasOwn(xm,b)&&Object.hasOwn(h.properties,b)){const C=h.properties[b],j=xm[b];(j===null||j.includes(h.tagName))&&(h.properties[b]=p(String(C||""),b,h))}}if(h.type==="element"){let b=n?!n.includes(h.tagName):l?l.includes(h.tagName):!1;if(!b&&s&&typeof x=="number"&&(b=!s(h,x,y)),b&&y&&typeof x=="number")return u&&h.children?y.children.splice(x,1,...h.children):y.children.splice(x,1),x}}}function d_(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||o_.test(e.slice(0,t))?e:""}function nn({content:e,className:t,emptyState:n="No markdown content yet."}){const s=e.replace(/<!--[\s\S]*?-->/g,"");return s.trim()?r.jsx("div",{className:Re("prose-syntaur max-w-none",t),children:r.jsx(a_,{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 f_(){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 Hd=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function da(e){const t=Object.prototype.toString.call(e);return t==="[object Window]"||t==="[object global]"}function qg(e){return"nodeType"in e}function tr(e){var t,n;return e?da(e)?e:qg(e)&&(t=(n=e.ownerDocument)==null?void 0:n.defaultView)!=null?t:window:window}function Gg(e){const{Document:t}=tr(e);return e instanceof t}function tc(e){return da(e)?!1:e instanceof tr(e).HTMLElement}function vS(e){return e instanceof tr(e).SVGElement}function fa(e){return e?da(e)?e.document:qg(e)?Gg(e)?e:tc(e)||vS(e)?e.ownerDocument:document:document:document}const us=Hd?f.useLayoutEffect:f.useEffect;function Yg(e){const t=f.useRef(e);return us(()=>{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 p_(){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 Ml(e,t){t===void 0&&(t=[e]);const n=f.useRef(e);return us(()=>{n.current!==e&&(n.current=e)},t),n}function nc(e,t){const n=f.useRef();return f.useMemo(()=>{const s=e(n.current);return n.current=s,s},[...t])}function od(e){const t=Yg(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 vh(e){const t=f.useRef();return f.useEffect(()=>{t.current=e},[e]),t.current}let Tm={};function rc(e,t){return f.useMemo(()=>{if(t)return t;const n=Tm[e]==null?0:Tm[e]+1;return Tm[e]=n,e+"-"+n},[e,t])}function wS(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 u=Object.entries(c);for(const[p,m]of u){const h=l[p];h!=null&&(l[p]=h+e*m)}return l},{...t})}}const Yi=wS(1),_l=wS(-1);function m_(e){return"clientX"in e&&"clientY"in e}function Jg(e){if(!e)return!1;const{KeyboardEvent:t}=tr(e.target);return t&&e instanceof t}function h_(e){if(!e)return!1;const{TouchEvent:t}=tr(e.target);return t&&e instanceof t}function wh(e){if(h_(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 m_(e)?{x:e.clientX,y:e.clientY}:null}const io=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[io.Translate.toString(e),io.Scale.toString(e)].join(" ")}},Transition:{toString(e){let{property:t,duration:n,easing:s}=e;return t+" "+n+"ms "+s}}}),Ew="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function g_(e){return e.matches(Ew)?e:e.querySelector(Ew)}const x_={display:"none"};function y_(e){let{id:t,value:n}=e;return Wt.createElement("div",{id:t,style:x_},n)}function b_(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 Wt.createElement("div",{id:t,style:i,role:"status","aria-live":s,"aria-atomic":!0},n)}function v_(){const[e,t]=f.useState("");return{announce:f.useCallback(s=>{s!=null&&t(s)},[]),announcement:e}}const jS=f.createContext(null);function w_(e){const t=f.useContext(jS);f.useEffect(()=>{if(!t)throw new Error("useDndMonitor must be used within a children of <DndContext>");return t(e)},[e,t])}function j_(){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 u;return(u=c[i])==null?void 0:u.call(c,l)})},[e]),t]}const k_={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
|
+
`},S_={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 N_(e){let{announcements:t=S_,container:n,hiddenTextDescribedById:s,screenReaderInstructions:i=k_}=e;const{announce:l,announcement:c}=v_(),u=rc("DndLiveRegion"),[p,m]=f.useState(!1);if(f.useEffect(()=>{m(!0)},[]),w_(f.useMemo(()=>({onDragStart(x){let{active:y}=x;l(t.onDragStart({active:y}))},onDragMove(x){let{active:y,over:b}=x;t.onDragMove&&l(t.onDragMove({active:y,over:b}))},onDragOver(x){let{active:y,over:b}=x;l(t.onDragOver({active:y,over:b}))},onDragEnd(x){let{active:y,over:b}=x;l(t.onDragEnd({active:y,over:b}))},onDragCancel(x){let{active:y,over:b}=x;l(t.onDragCancel({active:y,over:b}))}}),[l,t])),!p)return null;const h=Wt.createElement(Wt.Fragment,null,Wt.createElement(y_,{id:s,value:i.draggable}),Wt.createElement(b_,{id:u,announcement:c}));return n?Ns.createPortal(h,n):h}var un;(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"})(un||(un={}));function id(){}function ao(e,t){return f.useMemo(()=>({sensor:e,options:t??{}}),[e,t])}function Wd(){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 Hr=Object.freeze({x:0,y:0});function kS(e,t){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function SS(e,t){let{data:{value:n}}=e,{data:{value:s}}=t;return n-s}function C_(e,t){let{data:{value:n}}=e,{data:{value:s}}=t;return s-n}function Tw(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 NS(e,t){if(!e||e.length===0)return null;const[n]=e;return n[t]}function Pw(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 Kd=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:s}=e;const i=Pw(t,t.left,t.top),l=[];for(const c of s){const{id:u}=c,p=n.get(u);if(p){const m=kS(Pw(p),i);l.push({id:u,data:{droppableContainer:c,value:m}})}}return l.sort(SS)},E_=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:s}=e;const i=Tw(t),l=[];for(const c of s){const{id:u}=c,p=n.get(u);if(p){const m=Tw(p),h=i.reduce((y,b,C)=>y+kS(m[C],b),0),x=Number((h/4).toFixed(4));l.push({id:u,data:{droppableContainer:c,value:x}})}}return l.sort(SS)};function T_(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,u=l-n;if(s<i&&n<l){const p=t.width*t.height,m=e.width*e.height,h=c*u,x=h/(p+m-h);return Number(x.toFixed(4))}return 0}const P_=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:s}=e;const i=[];for(const l of s){const{id:c}=l,u=n.get(c);if(u){const p=T_(u,t);p>0&&i.push({id:c,data:{droppableContainer:l,value:p}})}}return i.sort(C_)};function R_(e,t,n){return{...e,scaleX:t&&n?t.width/n.width:1,scaleY:t&&n?t.height/n.height:1}}function CS(e,t){return e&&t?{x:e.left-t.left,y:e.top-t.top}:Hr}function A_(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,u)=>({...c,top:c.top+e*u.y,bottom:c.bottom+e*u.y,left:c.left+e*u.x,right:c.right+e*u.x}),{...n})}}const D_=A_(1);function L_(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 $_(e,t,n){const s=L_(t);if(!s)return e;const{scaleX:i,scaleY:l,x:c,y:u}=s,p=e.left-c-(1-i)*parseFloat(n),m=e.top-u-(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 I_={ignoreTransform:!1};function pa(e,t){t===void 0&&(t=I_);let n=e.getBoundingClientRect();if(t.ignoreTransform){const{transform:m,transformOrigin:h}=tr(e).getComputedStyle(e);m&&(n=$_(n,m,h))}const{top:s,left:i,width:l,height:c,bottom:u,right:p}=n;return{top:s,left:i,width:l,height:c,bottom:u,right:p}}function Rw(e){return pa(e,{ignoreTransform:!0})}function O_(e){const t=e.innerWidth,n=e.innerHeight;return{top:0,left:0,right:t,bottom:n,width:t,height:n}}function M_(e,t){return t===void 0&&(t=tr(e).getComputedStyle(e)),t.position==="fixed"}function __(e,t){t===void 0&&(t=tr(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 qd(e,t){const n=[];function s(i){if(t!=null&&n.length>=t||!i)return n;if(Gg(i)&&i.scrollingElement!=null&&!n.includes(i.scrollingElement))return n.push(i.scrollingElement),n;if(!tc(i)||vS(i)||n.includes(i))return n;const l=tr(e).getComputedStyle(i);return i!==e&&__(i,l)&&n.push(i),M_(i,l)?n:s(i.parentNode)}return e?s(e):n}function ES(e){const[t]=qd(e,1);return t??null}function Pm(e){return!Hd||!e?null:da(e)?e:qg(e)?Gg(e)||e===fa(e).scrollingElement?window:tc(e)?e:null:null}function TS(e){return da(e)?e.scrollX:e.scrollLeft}function PS(e){return da(e)?e.scrollY:e.scrollTop}function jh(e){return{x:TS(e),y:PS(e)}}var bn;(function(e){e[e.Forward=1]="Forward",e[e.Backward=-1]="Backward"})(bn||(bn={}));function RS(e){return!Hd||!e?!1:e===document.scrollingElement}function AS(e){const t={x:0,y:0},n=RS(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,u=e.scrollLeft>=s.x;return{isTop:i,isLeft:l,isBottom:c,isRight:u,maxScroll:s,minScroll:t}}const F_={x:.2,y:.2};function z_(e,t,n,s,i){let{top:l,left:c,right:u,bottom:p}=n;s===void 0&&(s=10),i===void 0&&(i=F_);const{isTop:m,isBottom:h,isLeft:x,isRight:y}=AS(e),b={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?(b.y=bn.Backward,C.y=s*Math.abs((t.top+j.height-l)/j.height)):!h&&p>=t.bottom-j.height&&(b.y=bn.Forward,C.y=s*Math.abs((t.bottom-j.height-p)/j.height)),!y&&u>=t.right-j.width?(b.x=bn.Forward,C.x=s*Math.abs((t.right-j.width-u)/j.width)):!x&&c<=t.left+j.width&&(b.x=bn.Backward,C.x=s*Math.abs((t.left+j.width-c)/j.width)),{direction:b,speed:C}}function B_(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 DS(e){return e.reduce((t,n)=>Yi(t,jh(n)),Hr)}function U_(e){return e.reduce((t,n)=>t+TS(n),0)}function V_(e){return e.reduce((t,n)=>t+PS(n),0)}function H_(e,t){if(t===void 0&&(t=pa),!e)return;const{top:n,left:s,bottom:i,right:l}=t(e);ES(e)&&(i<=0||l<=0||n>=window.innerHeight||s>=window.innerWidth)&&e.scrollIntoView({block:"center",inline:"center"})}const W_=[["x",["left","right"],U_],["y",["top","bottom"],V_]];class Xg{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=qd(n),i=DS(s);this.rect={...t},this.width=t.width,this.height=t.height;for(const[l,c,u]of W_)for(const p of c)Object.defineProperty(this,p,{get:()=>{const m=u(s),h=i[l]-m;return this.rect[p]+h},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}}class jl{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 K_(e){const{EventTarget:t}=tr(e);return e instanceof t?e:fa(e)}function Rm(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 Nr;(function(e){e.Click="click",e.DragStart="dragstart",e.Keydown="keydown",e.ContextMenu="contextmenu",e.Resize="resize",e.SelectionChange="selectionchange",e.VisibilityChange="visibilitychange"})(Nr||(Nr={}));function Aw(e){e.preventDefault()}function q_(e){e.stopPropagation()}var at;(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"})(at||(at={}));const LS={start:[at.Space,at.Enter],cancel:[at.Esc],end:[at.Space,at.Enter,at.Tab]},G_=(e,t)=>{let{currentCoordinates:n}=t;switch(e.code){case at.Right:return{...n,x:n.x+25};case at.Left:return{...n,x:n.x-25};case at.Down:return{...n,y:n.y+25};case at.Up:return{...n,y:n.y-25}}};class ma{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 jl(fa(n)),this.windowListeners=new jl(tr(n)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(Nr.Resize,this.handleCancel),this.windowListeners.add(Nr.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(Nr.Keydown,this.handleKeyDown))}handleStart(){const{activeNode:t,onStart:n}=this.props,s=t.node.current;s&&H_(s),n(Hr)}handleKeyDown(t){if(Jg(t)){const{active:n,context:s,options:i}=this.props,{keyboardCodes:l=LS,coordinateGetter:c=G_,scrollBehavior:u="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}:Hr;this.referenceCoordinates||(this.referenceCoordinates=h);const x=c(t,{active:n,context:s.current,currentCoordinates:h});if(x){const y=_l(x,h),b={x:0,y:0},{scrollableAncestors:C}=s.current;for(const j of C){const w=t.code,{isTop:S,isRight:E,isLeft:N,isBottom:R,maxScroll:I,minScroll:P}=AS(j),$=B_(j),D={x:Math.min(w===at.Right?$.right-$.width/2:$.right,Math.max(w===at.Right?$.left:$.left+$.width/2,x.x)),y:Math.min(w===at.Down?$.bottom-$.height/2:$.bottom,Math.max(w===at.Down?$.top:$.top+$.height/2,x.y))},X=w===at.Right&&!E||w===at.Left&&!N,Z=w===at.Down&&!R||w===at.Up&&!S;if(X&&D.x!==x.x){const z=j.scrollLeft+y.x,U=w===at.Right&&z<=I.x||w===at.Left&&z>=P.x;if(U&&!y.y){j.scrollTo({left:z,behavior:u});return}U?b.x=j.scrollLeft-z:b.x=w===at.Right?j.scrollLeft-I.x:j.scrollLeft-P.x,b.x&&j.scrollBy({left:-b.x,behavior:u});break}else if(Z&&D.y!==x.y){const z=j.scrollTop+y.y,U=w===at.Down&&z<=I.y||w===at.Up&&z>=P.y;if(U&&!y.x){j.scrollTo({top:z,behavior:u});return}U?b.y=j.scrollTop-z:b.y=w===at.Down?j.scrollTop-I.y:j.scrollTop-P.y,b.y&&j.scrollBy({top:-b.y,behavior:u});break}}this.handleMove(t,Yi(_l(x,this.referenceCoordinates),b))}}}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()}}ma.activators=[{eventName:"onKeyDown",handler:(e,t,n)=>{let{keyboardCodes:s=LS,onActivation:i}=t,{active:l}=n;const{code:c}=e.nativeEvent;if(s.start.includes(c)){const u=l.activatorNode.current;return u&&e.target!==u?!1:(e.preventDefault(),i==null||i({event:e.nativeEvent}),!0)}return!1}}];function Dw(e){return!!(e&&"distance"in e)}function Lw(e){return!!(e&&"delay"in e)}class Qg{constructor(t,n,s){var i;s===void 0&&(s=K_(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=fa(c),this.documentListeners=new jl(this.document),this.listeners=new jl(s),this.windowListeners=new jl(tr(c)),this.initialCoordinates=(i=wh(l))!=null?i:Hr,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(Nr.Resize,this.handleCancel),this.windowListeners.add(Nr.DragStart,Aw),this.windowListeners.add(Nr.VisibilityChange,this.handleCancel),this.windowListeners.add(Nr.ContextMenu,Aw),this.documentListeners.add(Nr.Keydown,this.handleKeydown),n){if(s!=null&&s({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(Lw(n)){this.timeoutId=setTimeout(this.handleStart,n.delay),this.handlePending(n);return}if(Dw(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(Nr.Click,q_,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(Nr.SelectionChange,this.removeTextSelection),n(t))}handleMove(t){var n;const{activated:s,initialCoordinates:i,props:l}=this,{onMove:c,options:{activationConstraint:u}}=l;if(!i)return;const p=(n=wh(t))!=null?n:Hr,m=_l(i,p);if(!s&&u){if(Dw(u)){if(u.tolerance!=null&&Rm(m,u.tolerance))return this.handleCancel();if(Rm(m,u.distance))return this.handleStart()}if(Lw(u)&&Rm(m,u.tolerance))return this.handleCancel();this.handlePending(u,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===at.Esc&&this.handleCancel()}removeTextSelection(){var t;(t=this.document.getSelection())==null||t.removeAllRanges()}}const Y_={cancel:{name:"pointercancel"},move:{name:"pointermove"},end:{name:"pointerup"}};class ha extends Qg{constructor(t){const{event:n}=t,s=fa(n.target);super(t,Y_,s)}}ha.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 J_={move:{name:"mousemove"},end:{name:"mouseup"}};var kh;(function(e){e[e.RightClick=2]="RightClick"})(kh||(kh={}));class X_ extends Qg{constructor(t){super(t,J_,fa(t.event.target))}}X_.activators=[{eventName:"onMouseDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:s}=t;return n.button===kh.RightClick?!1:(s==null||s({event:n}),!0)}}];const Am={cancel:{name:"touchcancel"},move:{name:"touchmove"},end:{name:"touchend"}};class Q_ extends Qg{constructor(t){super(t,Am)}static setup(){return window.addEventListener(Am.move.name,t,{capture:!1,passive:!1}),function(){window.removeEventListener(Am.move.name,t)};function t(){}}}Q_.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 kl;(function(e){e[e.Pointer=0]="Pointer",e[e.DraggableRect=1]="DraggableRect"})(kl||(kl={}));var ad;(function(e){e[e.TreeOrder=0]="TreeOrder",e[e.ReversedTreeOrder=1]="ReversedTreeOrder"})(ad||(ad={}));function Z_(e){let{acceleration:t,activator:n=kl.Pointer,canScroll:s,draggingRect:i,enabled:l,interval:c=5,order:u=ad.TreeOrder,pointerCoordinates:p,scrollableAncestors:m,scrollableAncestorRects:h,delta:x,threshold:y}=e;const b=t5({delta:x,disabled:!l}),[C,j]=p_(),w=f.useRef({x:0,y:0}),S=f.useRef({x:0,y:0}),E=f.useMemo(()=>{switch(n){case kl.Pointer:return p?{top:p.y,bottom:p.y,left:p.x,right:p.x}:null;case kl.DraggableRect:return i}},[n,i,p]),N=f.useRef(null),R=f.useCallback(()=>{const P=N.current;if(!P)return;const $=w.current.x*S.current.x,D=w.current.y*S.current.y;P.scrollBy($,D)},[]),I=f.useMemo(()=>u===ad.TreeOrder?[...m].reverse():m,[u,m]);f.useEffect(()=>{if(!l||!m.length||!E){j();return}for(const P of I){if((s==null?void 0:s(P))===!1)continue;const $=m.indexOf(P),D=h[$];if(!D)continue;const{direction:X,speed:Z}=z_(P,D,E,t,y);for(const z of["x","y"])b[z][X[z]]||(Z[z]=0,X[z]=0);if(Z.x>0||Z.y>0){j(),N.current=P,C(R,c),w.current=Z,S.current=X;return}}w.current={x:0,y:0},S.current={x:0,y:0},j()},[t,R,s,j,l,c,JSON.stringify(E),JSON.stringify(b),C,m,I,h,JSON.stringify(y)])}const e5={x:{[bn.Backward]:!1,[bn.Forward]:!1},y:{[bn.Backward]:!1,[bn.Forward]:!1}};function t5(e){let{delta:t,disabled:n}=e;const s=vh(t);return nc(i=>{if(n||!s||!i)return e5;const l={x:Math.sign(t.x-s.x),y:Math.sign(t.y-s.y)};return{x:{[bn.Backward]:i.x[bn.Backward]||l.x===-1,[bn.Forward]:i.x[bn.Forward]||l.x===1},y:{[bn.Backward]:i.y[bn.Backward]||l.y===-1,[bn.Forward]:i.y[bn.Forward]||l.y===1}}},[n,t,s])}function n5(e,t){const n=t!=null?e.get(t):void 0,s=n?n.node.current:null;return nc(i=>{var l;return t==null?null:(l=s??i)!=null?l:null},[s,t])}function r5(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 Fl;(function(e){e[e.Always=0]="Always",e[e.BeforeDragging=1]="BeforeDragging",e[e.WhileDragging=2]="WhileDragging"})(Fl||(Fl={}));var Sh;(function(e){e.Optimized="optimized"})(Sh||(Sh={}));const $w=new Map;function s5(e,t){let{dragging:n,dependencies:s,config:i}=t;const[l,c]=f.useState(null),{frequency:u,measure:p,strategy:m}=i,h=f.useRef(e),x=w(),y=Ml(x),b=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=nc(S=>{if(x&&!n)return $w;if(!S||S===$w||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 R=N.node.current,I=R?new Xg(p(R),R):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||b()},[n,x]),f.useEffect(()=>{l&&l.length>0&&c(null)},[JSON.stringify(l)]),f.useEffect(()=>{x||typeof u!="number"||C.current!==null||(C.current=setTimeout(()=>{b(),C.current=null},u))},[u,x,b,...s]),{droppableRects:j,measureDroppableContainers:b,measuringScheduled:l!=null};function w(){switch(m){case Fl.Always:return!1;case Fl.BeforeDragging:return n;default:return!n}}}function $S(e,t){return nc(n=>e?n||(typeof t=="function"?t(e):e):null,[t,e])}function o5(e,t){return $S(e,t)}function i5(e){let{callback:t,disabled:n}=e;const s=Yg(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 Gd(e){let{callback:t,disabled:n}=e;const s=Yg(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 a5(e){return new Xg(pa(e),e)}function Iw(e,t,n){t===void 0&&(t=a5);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=i5({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}}}}),u=Gd({callback:l});return us(()=>{l(),e?(u==null||u.observe(e),c==null||c.observe(document.body,{childList:!0,subtree:!0})):(u==null||u.disconnect(),c==null||c.disconnect())},[e]),s}function l5(e){const t=$S(e);return CS(e,t)}const Ow=[];function c5(e){const t=f.useRef(e),n=nc(s=>e?s&&s!==Ow&&e&&t.current&&e.parentNode===t.current.parentNode?s:qd(e):Ow,[e]);return f.useEffect(()=>{t.current=e},[e]),n}function u5(e){const[t,n]=f.useState(null),s=f.useRef(e),i=f.useCallback(l=>{const c=Pm(l.target);c&&n(u=>u?(u.set(c,jh(c)),new Map(u)):null)},[]);return f.useEffect(()=>{const l=s.current;if(e!==l){c(l);const u=e.map(p=>{const m=Pm(p);return m?(m.addEventListener("scroll",i,{passive:!0}),[m,jh(m)]):null}).filter(p=>p!=null);n(u.length?new Map(u):null),s.current=e}return()=>{c(e),c(l)};function c(u){u.forEach(p=>{const m=Pm(p);m==null||m.removeEventListener("scroll",i)})}},[i,e]),f.useMemo(()=>e.length?t?Array.from(t.values()).reduce((l,c)=>Yi(l,c),Hr):DS(e):Hr,[e,t])}function Mw(e,t){t===void 0&&(t=[]);const n=f.useRef(null);return f.useEffect(()=>{n.current=null},t),f.useEffect(()=>{const s=e!==Hr;s&&!n.current&&(n.current=e),!s&&n.current&&(n.current=null)},[e]),n.current?_l(e,n.current):Hr}function d5(e){f.useEffect(()=>{if(!Hd)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 f5(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 IS(e){return f.useMemo(()=>e?O_(e):null,[e])}const _w=[];function p5(e,t){t===void 0&&(t=pa);const[n]=e,s=IS(n?tr(n):null),[i,l]=f.useState(_w);function c(){l(()=>e.length?e.map(p=>RS(p)?s:new Xg(t(p),p)):_w)}const u=Gd({callback:c});return us(()=>{u==null||u.disconnect(),c(),e.forEach(p=>u==null?void 0:u.observe(p))},[e]),i}function m5(e){if(!e)return null;if(e.children.length>1)return e;const t=e.children[0];return tc(t)?t:e}function h5(e){let{measure:t}=e;const[n,s]=f.useState(null),i=f.useCallback(m=>{for(const{target:h}of m)if(tc(h)){s(x=>{const y=t(h);return x?{...x,width:y.width,height:y.height}:y});break}},[t]),l=Gd({callback:i}),c=f.useCallback(m=>{const h=m5(m);l==null||l.disconnect(),h&&(l==null||l.observe(h)),s(h?t(h):null)},[t,l]),[u,p]=od(c);return f.useMemo(()=>({nodeRef:u,rect:n,setRef:p}),[n,u,p])}const g5=[{sensor:ha,options:{}},{sensor:ma,options:{}}],x5={current:{}},Fu={draggable:{measure:Rw},droppable:{measure:Rw,strategy:Fl.WhileDragging,frequency:Sh.Optimized},dragOverlay:{measure:pa}};class Sl 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 y5={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new Sl,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:id},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:Fu,measureDroppableContainers:id,windowRect:null,measuringScheduled:!1},b5={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:id,draggableNodes:new Map,over:null,measureDroppableContainers:id},Yd=f.createContext(b5),OS=f.createContext(y5);function v5(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new Sl}}}function w5(e,t){switch(t.type){case un.DragStart:return{...e,draggable:{...e.draggable,initialCoordinates:t.initialCoordinates,active:t.active}};case un.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 un.DragEnd:case un.DragCancel:return{...e,draggable:{...e.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case un.RegisterDroppable:{const{element:n}=t,{id:s}=n,i=new Sl(e.droppable.containers);return i.set(s,n),{...e,droppable:{...e.droppable,containers:i}}}case un.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 Sl(e.droppable.containers);return c.set(n,{...l,disabled:i}),{...e,droppable:{...e.droppable,containers:c}}}case un.UnregisterDroppable:{const{id:n,key:s}=t,i=e.droppable.containers.get(n);if(!i||s!==i.key)return e;const l=new Sl(e.droppable.containers);return l.delete(n),{...e,droppable:{...e.droppable,containers:l}}}default:return e}}function j5(e){let{disabled:t}=e;const{active:n,activatorEvent:s,draggableNodes:i}=f.useContext(Yd),l=vh(s),c=vh(n==null?void 0:n.id);return f.useEffect(()=>{if(!t&&!s&&l&&c!=null){if(!Jg(l)||document.activeElement===l.target)return;const u=i.get(c);if(!u)return;const{activatorNode:p,node:m}=u;if(!p.current&&!m.current)return;requestAnimationFrame(()=>{for(const h of[p.current,m.current]){if(!h)continue;const x=g_(h);if(x){x.focus();break}}})}},[s,t,i,c,l]),null}function k5(e,t){let{transform:n,...s}=t;return e!=null&&e.length?e.reduce((i,l)=>l({transform:i,...s}),n):n}function S5(e){return f.useMemo(()=>({draggable:{...Fu.draggable,...e==null?void 0:e.draggable},droppable:{...Fu.droppable,...e==null?void 0:e.droppable},dragOverlay:{...Fu.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 N5(e){let{activeNode:t,measure:n,initialRect:s,config:i=!0}=e;const l=f.useRef(!1),{x:c,y:u}=typeof i=="boolean"?{x:i,y:i}:i;us(()=>{if(!c&&!u||!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=CS(h,s);if(c||(x.x=0),u||(x.y=0),l.current=!0,Math.abs(x.x)>0||Math.abs(x.y)>0){const y=ES(m);y&&y.scrollBy({top:x.y,left:x.x})}},[t,c,u,s,n])}const MS=f.createContext({...Hr,scaleX:1,scaleY:1});var eo;(function(e){e[e.Uninitialized=0]="Uninitialized",e[e.Initializing=1]="Initializing",e[e.Initialized=2]="Initialized"})(eo||(eo={}));const Jd=f.memo(function(t){var n,s,i,l;let{id:c,accessibility:u,autoScroll:p=!0,children:m,sensors:h=g5,collisionDetection:x=P_,measuring:y,modifiers:b,...C}=t;const j=f.useReducer(w5,void 0,v5),[w,S]=j,[E,N]=j_(),[R,I]=f.useState(eo.Uninitialized),P=R===eo.Initialized,{draggable:{active:$,nodes:D,translate:X},droppable:{containers:Z}}=w,z=$!=null?D.get($):null,U=f.useRef({initial:null,translated:null}),J=f.useMemo(()=>{var ft;return $!=null?{id:$,data:(ft=z==null?void 0:z.data)!=null?ft:x5,rect:U}:null},[$,z]),_=f.useRef(null),[G,Q]=f.useState(null),[le,W]=f.useState(null),ne=Ml(C,Object.values(C)),T=rc("DndDescribedBy",c),O=f.useMemo(()=>Z.getEnabled(),[Z]),q=S5(y),{droppableRects:L,measureDroppableContainers:ee,measuringScheduled:de}=s5(O,{dragging:P,dependencies:[X.x,X.y],config:q.droppable}),F=n5(D,$),re=f.useMemo(()=>le?wh(le):null,[le]),me=zn(),ve=o5(F,q.draggable.measure);N5({activeNode:$!=null?D.get($):null,config:me.layoutShiftCompensation,initialRect:ve,measure:q.draggable.measure});const Se=Iw(F,q.draggable.measure,ve),fe=Iw(F?F.parentElement:null),He=f.useRef({activatorEvent:null,active:null,activeNode:F,collisionRect:null,collisions:null,droppableRects:L,draggableNodes:D,draggingNode:null,draggingNodeRect:null,droppableContainers:Z,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),pe=Z.getNodeFor((n=He.current.over)==null?void 0:n.id),Pe=h5({measure:q.dragOverlay.measure}),V=(s=Pe.nodeRef.current)!=null?s:F,H=P?(i=Pe.rect)!=null?i:Se:null,ae=!!(Pe.nodeRef.current&&Pe.rect),he=l5(ae?null:Se),Ae=IS(V?tr(V):null),Te=c5(P?pe??F:null),Ve=p5(Te),Ze=k5(b,{transform:{x:X.x-he.x,y:X.y-he.y,scaleX:1,scaleY:1},activatorEvent:le,active:J,activeNodeRect:Se,containerNodeRect:fe,draggingNodeRect:H,over:He.current.over,overlayNodeRect:Pe.rect,scrollableAncestors:Te,scrollableAncestorRects:Ve,windowRect:Ae}),Tt=re?Yi(re,X):null,yt=u5(Te),jt=Mw(yt),ue=Mw(yt,[Se]),ye=Yi(Ze,jt),Le=H?D_(H,Ze):null,Ie=J&&Le?x({active:J,collisionRect:Le,droppableRects:L,droppableContainers:O,pointerCoordinates:Tt}):null,We=NS(Ie,"id"),[et,_t]=f.useState(null),bt=ae?Ze:Yi(Ze,ue),Qt=R_(bt,(l=et==null?void 0:et.rect)!=null?l:null,Se),sn=f.useRef(null),vt=f.useCallback((ft,Vt)=>{let{sensor:It,options:Zt}=Vt;if(_.current==null)return;const se=D.get(_.current);if(!se)return;const Oe=ft.nativeEvent,Je=new It({active:_.current,activeNode:se,event:Oe,options:Zt,context:He,onAbort(tt){if(!D.get(tt))return;const{onDragAbort:on}=ne.current,an={id:tt};on==null||on(an),E({type:"onDragAbort",event:an})},onPending(tt,pn,on,an){if(!D.get(tt))return;const{onDragPending:xr}=ne.current,wn={id:tt,constraint:pn,initialCoordinates:on,offset:an};xr==null||xr(wn),E({type:"onDragPending",event:wn})},onStart(tt){const pn=_.current;if(pn==null)return;const on=D.get(pn);if(!on)return;const{onDragStart:an}=ne.current,pt={activatorEvent:Oe,active:{id:pn,data:on.data,rect:U}};Ns.unstable_batchedUpdates(()=>{an==null||an(pt),I(eo.Initializing),S({type:un.DragStart,initialCoordinates:tt,active:pn}),E({type:"onDragStart",event:pt}),Q(sn.current),W(Oe)})},onMove(tt){S({type:un.DragMove,coordinates:tt})},onEnd:Gt(un.DragEnd),onCancel:Gt(un.DragCancel)});sn.current=Je;function Gt(tt){return async function(){const{active:on,collisions:an,over:pt,scrollAdjustedTranslate:xr}=He.current;let wn=null;if(on&&xr){const{cancelDrop:nr}=ne.current;wn={activatorEvent:Oe,active:on,collisions:an,delta:xr,over:pt},tt===un.DragEnd&&typeof nr=="function"&&await Promise.resolve(nr(wn))&&(tt=un.DragCancel)}_.current=null,Ns.unstable_batchedUpdates(()=>{S({type:tt}),I(eo.Uninitialized),_t(null),Q(null),W(null),sn.current=null;const nr=tt===un.DragEnd?"onDragEnd":"onDragCancel";if(wn){const hs=ne.current[nr];hs==null||hs(wn),E({type:nr,event:wn})}})}}},[D]),xe=f.useCallback((ft,Vt)=>(It,Zt)=>{const se=It.nativeEvent,Oe=D.get(Zt);if(_.current!==null||!Oe||se.dndKit||se.defaultPrevented)return;const Je={active:Oe};ft(It,Vt.options,Je)===!0&&(se.dndKit={capturedBy:Vt.sensor},_.current=Zt,vt(It,Vt))},[D,vt]),Ye=r5(h,xe);d5(h),us(()=>{Se&&R===eo.Initializing&&I(eo.Initialized)},[Se,R]),f.useEffect(()=>{const{onDragMove:ft}=ne.current,{active:Vt,activatorEvent:It,collisions:Zt,over:se}=He.current;if(!Vt||!It)return;const Oe={active:Vt,activatorEvent:It,collisions:Zt,delta:{x:ye.x,y:ye.y},over:se};Ns.unstable_batchedUpdates(()=>{ft==null||ft(Oe),E({type:"onDragMove",event:Oe})})},[ye.x,ye.y]),f.useEffect(()=>{const{active:ft,activatorEvent:Vt,collisions:It,droppableContainers:Zt,scrollAdjustedTranslate:se}=He.current;if(!ft||_.current==null||!Vt||!se)return;const{onDragOver:Oe}=ne.current,Je=Zt.get(We),Gt=Je&&Je.rect.current?{id:Je.id,rect:Je.rect.current,data:Je.data,disabled:Je.disabled}:null,tt={active:ft,activatorEvent:Vt,collisions:It,delta:{x:se.x,y:se.y},over:Gt};Ns.unstable_batchedUpdates(()=>{_t(Gt),Oe==null||Oe(tt),E({type:"onDragOver",event:tt})})},[We]),us(()=>{He.current={activatorEvent:le,active:J,activeNode:F,collisionRect:Le,collisions:Ie,droppableRects:L,draggableNodes:D,draggingNode:V,draggingNodeRect:H,droppableContainers:Z,over:et,scrollableAncestors:Te,scrollAdjustedTranslate:ye},U.current={initial:H,translated:Le}},[J,F,Ie,Le,D,V,H,L,Z,et,Te,ye]),Z_({...me,delta:X,draggingRect:Le,pointerCoordinates:Tt,scrollableAncestors:Te,scrollableAncestorRects:Ve});const Ke=f.useMemo(()=>({active:J,activeNode:F,activeNodeRect:Se,activatorEvent:le,collisions:Ie,containerNodeRect:fe,dragOverlay:Pe,draggableNodes:D,droppableContainers:Z,droppableRects:L,over:et,measureDroppableContainers:ee,scrollableAncestors:Te,scrollableAncestorRects:Ve,measuringConfiguration:q,measuringScheduled:de,windowRect:Ae}),[J,F,Se,le,Ie,fe,Pe,D,Z,L,et,ee,Te,Ve,q,de,Ae]),vn=f.useMemo(()=>({activatorEvent:le,activators:Ye,active:J,activeNodeRect:Se,ariaDescribedById:{draggable:T},dispatch:S,draggableNodes:D,over:et,measureDroppableContainers:ee}),[le,Ye,J,Se,S,T,D,et,ee]);return Wt.createElement(jS.Provider,{value:N},Wt.createElement(Yd.Provider,{value:vn},Wt.createElement(OS.Provider,{value:Ke},Wt.createElement(MS.Provider,{value:Qt},m)),Wt.createElement(j5,{disabled:(u==null?void 0:u.restoreFocus)===!1})),Wt.createElement(N_,{...u,hiddenTextDescribedById:T}));function zn(){const ft=(G==null?void 0:G.autoScrollEnabled)===!1,Vt=typeof p=="object"?p.enabled===!1:p===!1,It=P&&!ft&&!Vt;return typeof p=="object"?{...p,enabled:It}:{enabled:It}}}),C5=f.createContext(null),Fw="button",E5="Draggable";function T5(e){let{id:t,data:n,disabled:s=!1,attributes:i}=e;const l=rc(E5),{activators:c,activatorEvent:u,active:p,activeNodeRect:m,ariaDescribedById:h,draggableNodes:x,over:y}=f.useContext(Yd),{role:b=Fw,roleDescription:C="draggable",tabIndex:j=0}=i??{},w=(p==null?void 0:p.id)===t,S=f.useContext(w?MS:C5),[E,N]=od(),[R,I]=od(),P=f5(c,t),$=Ml(n);us(()=>(x.set(t,{id:t,key:l,node:E,activatorNode:R,data:$}),()=>{const X=x.get(t);X&&X.key===l&&x.delete(t)}),[x,t]);const D=f.useMemo(()=>({role:b,tabIndex:j,"aria-disabled":s,"aria-pressed":w&&b===Fw?!0:void 0,"aria-roledescription":C,"aria-describedby":h.draggable}),[s,b,j,w,C,h.draggable]);return{active:p,activatorEvent:u,activeNodeRect:m,attributes:D,isDragging:w,listeners:s?void 0:P,node:E,over:y,setNodeRef:N,setActivatorNodeRef:I,transform:S}}function P5(){return f.useContext(OS)}const R5="Droppable",A5={timeout:25};function D5(e){let{data:t,disabled:n=!1,id:s,resizeObserverConfig:i}=e;const l=rc(R5),{active:c,dispatch:u,over:p,measureDroppableContainers:m}=f.useContext(Yd),h=f.useRef({disabled:n}),x=f.useRef(!1),y=f.useRef(null),b=f.useRef(null),{disabled:C,updateMeasurementsFor:j,timeout:w}={...A5,...i},S=Ml(j??s),E=f.useCallback(()=>{if(!x.current){x.current=!0;return}b.current!=null&&clearTimeout(b.current),b.current=setTimeout(()=>{m(Array.isArray(S.current)?S.current:[S.current]),b.current=null},w)},[w]),N=Gd({callback:E,disabled:C||!c}),R=f.useCallback((D,X)=>{N&&(X&&(N.unobserve(X),x.current=!1),D&&N.observe(D))},[N]),[I,P]=od(R),$=Ml(t);return f.useEffect(()=>{!N||!I.current||(N.disconnect(),x.current=!1,N.observe(I.current))},[I,N]),f.useEffect(()=>(u({type:un.RegisterDroppable,element:{id:s,key:l,disabled:n,node:I,rect:y,data:$}}),()=>u({type:un.UnregisterDroppable,key:l,id:s})),[s]),f.useEffect(()=>{n!==h.current.disabled&&(u({type:un.SetDroppableDisabled,id:s,key:l,disabled:n}),h.current.disabled=n)},[s,l,n,u]),{active:c,rect:y,isOver:(p==null?void 0:p.id)===s,node:I,over:p,setNodeRef:P}}function ga(e,t,n){const s=e.slice();return s.splice(n<0?s.length+n:n,0,s.splice(t,1)[0]),s}function L5(e,t){return e.reduce((n,s,i)=>{const l=t.get(s);return l&&(n[i]=l),n},Array(e.length))}function ju(e){return e!==null&&e>=0}function $5(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 I5(e){return typeof e=="boolean"?{draggable:e,droppable:e}:e}const _S=e=>{let{rects:t,activeIndex:n,overIndex:s,index:i}=e;const l=ga(t,s,n),c=t[i],u=l[i];return!u||!c?null:{x:u.left-c.left,y:u.top-c.top,scaleX:u.width/c.width,scaleY:u.height/c.height}},ku={scaleX:1,scaleY:1},Xd=e=>{var t;let{activeIndex:n,activeNodeRect:s,index:i,rects:l,overIndex:c}=e;const u=(t=l[n])!=null?t:s;if(!u)return null;if(i===n){const m=l[c];return m?{x:0,y:n<c?m.top+m.height-(u.top+u.height):m.top-u.top,...ku}:null}const p=O5(l,i,n);return i>n&&i<=c?{x:0,y:-u.height-p,...ku}:i<n&&i>=c?{x:0,y:u.height+p,...ku}:{x:0,y:0,...ku}};function O5(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 FS="Sortable",zS=Wt.createContext({activeIndex:-1,containerId:FS,disableTransforms:!1,items:[],overIndex:-1,useDragOverlay:!1,sortedRects:[],strategy:_S,disabled:{draggable:!1,droppable:!1}});function Qd(e){let{children:t,id:n,items:s,strategy:i=_S,disabled:l=!1}=e;const{active:c,dragOverlay:u,droppableRects:p,over:m,measureDroppableContainers:h}=P5(),x=rc(FS,n),y=u.rect!==null,b=f.useMemo(()=>s.map(P=>typeof P=="object"&&"id"in P?P.id:P),[s]),C=c!=null,j=c?b.indexOf(c.id):-1,w=m?b.indexOf(m.id):-1,S=f.useRef(b),E=!$5(b,S.current),N=w!==-1&&j===-1||E,R=I5(l);us(()=>{E&&C&&h(b)},[E,b,C,h]),f.useEffect(()=>{S.current=b},[b]);const I=f.useMemo(()=>({activeIndex:j,containerId:x,disabled:R,disableTransforms:N,items:b,overIndex:w,useDragOverlay:y,sortedRects:L5(b,p),strategy:i}),[j,x,R.draggable,R.droppable,N,b,w,p,y,i]);return Wt.createElement(zS.Provider,{value:I},t)}const M5=e=>{let{id:t,items:n,activeIndex:s,overIndex:i}=e;return ga(n,s,i).indexOf(t)},_5=e=>{let{containerId:t,isSorting:n,wasDragging:s,index:i,items:l,newIndex:c,previousItems:u,previousContainerId:p,transition:m}=e;return!m||!s||u!==l&&i===c?!1:n?!0:c!==i&&t===p},F5={duration:200,easing:"ease"},BS="transform",z5=io.Transition.toString({property:BS,duration:0,easing:"linear"}),B5={roleDescription:"sortable"};function U5(e){let{disabled:t,index:n,node:s,rect:i}=e;const[l,c]=f.useState(null),u=f.useRef(n);return us(()=>{if(!t&&n!==u.current&&s.current){const p=i.current;if(p){const m=pa(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!==u.current&&(u.current=n)},[t,n,s,i]),f.useEffect(()=>{l&&c(null)},[l]),l}function Zd(e){let{animateLayoutChanges:t=_5,attributes:n,disabled:s,data:i,getNewIndex:l=M5,id:c,strategy:u,resizeObserverConfig:p,transition:m=F5}=e;const{items:h,containerId:x,activeIndex:y,disabled:b,disableTransforms:C,sortedRects:j,overIndex:w,useDragOverlay:S,strategy:E}=f.useContext(zS),N=V5(s,b),R=h.indexOf(c),I=f.useMemo(()=>({sortable:{containerId:x,index:R,items:h},...i}),[x,i,R,h]),P=f.useMemo(()=>h.slice(h.indexOf(c)),[h,c]),{rect:$,node:D,isOver:X,setNodeRef:Z}=D5({id:c,data:I,disabled:N.droppable,resizeObserverConfig:{updateMeasurementsFor:P,...p}}),{active:z,activatorEvent:U,activeNodeRect:J,attributes:_,setNodeRef:G,listeners:Q,isDragging:le,over:W,setActivatorNodeRef:ne,transform:T}=T5({id:c,data:I,attributes:{...B5,...n},disabled:N.draggable}),O=f_(Z,G),q=!!z,L=q&&!C&&ju(y)&&ju(w),ee=!S&&le,de=ee&&L?T:null,re=L?de??(u??E)({rects:j,activeNodeRect:J,activeIndex:y,overIndex:w,index:R}):null,me=ju(y)&&ju(w)?l({id:c,items:h,activeIndex:y,overIndex:w}):R,ve=z==null?void 0:z.id,Se=f.useRef({activeId:ve,items:h,newIndex:me,containerId:x}),fe=h!==Se.current.items,He=t({active:z,containerId:x,isDragging:le,isSorting:q,id:c,index:R,items:h,newIndex:Se.current.newIndex,previousItems:Se.current.items,previousContainerId:Se.current.containerId,transition:m,wasDragging:Se.current.activeId!=null}),pe=U5({disabled:!He,index:R,node:D,rect:$});return f.useEffect(()=>{q&&Se.current.newIndex!==me&&(Se.current.newIndex=me),x!==Se.current.containerId&&(Se.current.containerId=x),h!==Se.current.items&&(Se.current.items=h)},[q,me,x,h]),f.useEffect(()=>{if(ve===Se.current.activeId)return;if(ve!=null&&Se.current.activeId==null){Se.current.activeId=ve;return}const V=setTimeout(()=>{Se.current.activeId=ve},50);return()=>clearTimeout(V)},[ve]),{active:z,activeIndex:y,attributes:_,data:I,rect:$,index:R,newIndex:me,items:h,isOver:X,isSorting:q,isDragging:le,listeners:Q,node:D,overIndex:w,over:W,setNodeRef:O,setActivatorNodeRef:ne,setDroppableNodeRef:Z,setDraggableNodeRef:G,transform:pe??re,transition:Pe()};function Pe(){if(pe||fe&&Se.current.newIndex===R)return z5;if(!(ee&&!Jg(U)||!m)&&(q||He))return io.Transition.toString({...m,property:BS})}}function V5(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 ld(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 H5=[at.Down,at.Right,at.Up,at.Left],W5=(e,t)=>{let{context:{active:n,collisionRect:s,droppableRects:i,droppableContainers:l,over:c,scrollableAncestors:u}}=t;if(H5.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 at.Down:s.top<y.top&&p.push(x);break;case at.Up:s.top>y.top&&p.push(x);break;case at.Left:s.left>y.left&&p.push(x);break;case at.Right:s.left<y.left&&p.push(x);break}});const m=E_({collisionRect:s,droppableRects:i,droppableContainers:p});let h=NS(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),b=y?i.get(y.id):null,C=y==null?void 0:y.node.current;if(C&&b&&x&&y){const w=qd(C).some((P,$)=>u[$]!==P),S=US(x,y),E=K5(x,y),N=w||!S?{x:0,y:0}:{x:E?s.width-b.width:0,y:E?s.height-b.height:0},R={x:b.left,y:b.top};return N.x&&N.y?R:_l(R,N)}}}};function US(e,t){return!ld(e)||!ld(t)?!1:e.data.current.sortable.containerId===t.data.current.sortable.containerId}function K5(e,t){return!ld(e)||!ld(t)||!US(e,t)?!1:e.data.current.sortable.index<t.data.current.sortable.index}function ms(e){return`/api/projects/${encodeURIComponent(e)}/todos`}function q5(e){const[t,n]=f.useState(null),[s,i]=f.useState(!0),[l,c]=f.useState(null),u=f.useCallback(async()=>{if(e)try{const p=await fetch(ms(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(()=>{u()},[u]),ql(p=>{p.type==="todos-updated"&&p.projectSlug===e&&u()}),{data:t,loading:s,error:l,refetch:u}}async function G5(e,t,n){await fetch(ms(e),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({description:t,tags:n})})}async function Y5(e,t,n){await fetch(`${ms(e)}/${t}/complete`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({summary:"Completed."})})}async function J5(e,t,n){await fetch(`${ms(e)}/${t}/block`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({reason:n})})}async function X5(e,t,n){await fetch(`${ms(e)}/${t}/start`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({session:n})})}async function Q5(e,t){await fetch(`${ms(e)}/${t}/reopen`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({})})}async function Z5(e,t){await fetch(`${ms(e)}/reorder`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({ids:t})})}async function eF(e,t){await fetch(`${ms(e)}/${t}`,{method:"DELETE"})}async function VS(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 tF(e,t){return await VS(`${ms(e)}/promote`,t)}async function nF(e,t,n){await VS(`${ms(e)}/${t}/move`,{to:n})}const zw=[{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 Zg({status:e,onChange:t}){const[n,s]=f.useState(!1),i=f.useRef(null);f.useEffect(()=>{if(!n)return;function c(u){i.current&&!i.current.contains(u.target)&&s(!1)}return document.addEventListener("mousedown",c),()=>document.removeEventListener("mousedown",c)},[n]);const l=zw.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:zw.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 HS="__one_off__";function ex({open:e,selectedIds:t,scope:n,onOpenChange:s,onDone:i,defaultProject:l,defaultTitle:c,allowOneOff:u=!0}){const[p,m]=f.useState("new"),[h,x]=f.useState(!1),[y,b]=f.useState(null),[C,j]=f.useState(null),[w,S]=f.useState(null),[E,N]=f.useState(""),[R,I]=f.useState(""),[P,$]=f.useState(""),[D,X]=f.useState(""),[Z,z]=f.useState(""),[U,J]=f.useState(""),[_,G]=f.useState(null),[Q,le]=f.useState(!1),W=t.length>1;f.useEffect(()=>{if(!e){m("new"),b(null),N(""),I(""),$(""),X(""),z(""),J(""),G(null);return}N(l??""),I(c??"");let ee=!1;return(async()=>{try{const de=await fetch("/api/projects");if(!de.ok)throw new Error(`HTTP ${de.status}`);const F=await de.json();ee||j(F.filter(re=>!re.archived))}catch(de){ee||S(de instanceof Error?de.message:String(de))}})(),()=>{ee=!0}},[e,l,c]),f.useEffect(()=>{if(!Z){G(null);return}let ee=!1;return le(!0),(async()=>{try{const de=await fetch(`/api/projects/${encodeURIComponent(Z)}/assignments`);if(!de.ok)throw new Error(`HTTP ${de.status}`);const F=await de.json();ee||G(F)}catch{ee||G([])}finally{ee||le(!1)}})(),()=>{ee=!0}},[Z]);const ne=f.useMemo(()=>C??[],[C]);async function T(ee){if(ee.preventDefault(),!E){b('Pick a target project (or "One-off").');return}if(W&&!R.trim()){b("Title is required when promoting multiple todos.");return}const de=E===HS?{oneOff:!0}:{project:E};if(n.kind==="aggregate"){const re={groups:n.groups,mode:"new-assignment",target:de,title:R.trim()||void 0,type:P.trim()||void 0,priority:D||void 0};await L(re);return}const F={todoIds:t,mode:"new-assignment",target:de,title:R.trim()||void 0,type:P.trim()||void 0,priority:D||void 0};await q(F)}async function O(ee){if(ee.preventDefault(),n.kind==="aggregate"){b("Existing-assignment mode does not support cross-workspace selections yet.");return}if(!Z||!U){b("Pick both project and assignment.");return}const de={todoIds:t,mode:"to-assignment",target:{assignment:`${Z}/${U}`}};await q(de)}async function q(ee){x(!0),b(null);try{let de;if(n.kind==="workspace")de=await HP(n.workspace,ee);else if(n.kind==="project")de=await tF(n.projectId,ee);else throw new Error("Aggregate scope requires runBulkMutation.");i(de),s(!1)}catch(de){b(de instanceof Error?de.message:String(de))}finally{x(!1)}}async function L(ee){x(!0),b(null);try{const de=await WP(ee);i(de),s(!1)}catch(de){b(de instanceof Error?de.message:String(de))}finally{x(!1)}}return r.jsx(Zn,{open:e,onOpenChange:ee=>h?void 0:s(ee),children:r.jsxs(_n,{className:"max-w-xl",children:[r.jsxs(qr,{children:[r.jsxs(Fn,{children:["Promote ",t.length," todo",t.length===1?"":"s"]}),r.jsxs(fs,{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(M1,{value:p,onValueChange:ee=>m(ee),children:[r.jsxs(_1,{className:"flex gap-2 rounded-md border border-border/70 bg-card/80 p-1 mb-4",children:[r.jsx(lh,{value:"new",className:Re("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(lh,{value:"existing",className:Re("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(ch,{value:"new",children:r.jsxs("form",{onSubmit:T,className:"space-y-4",children:[r.jsx(Ri,{label:"Target project",children:r.jsx(Bw,{value:E,onChange:N,projects:ne,error:w,disabled:h,allowOneOff:u})}),r.jsx(Ri,{label:W?"Title (required)":"Title (defaults to first todo)",children:r.jsx("input",{type:"text",value:R,onChange:ee=>I(ee.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(Ri,{label:"Type",children:r.jsx("input",{type:"text",value:P,onChange:ee=>$(ee.target.value),placeholder:"feature",disabled:h,className:"editor-textarea w-full bg-background/95 font-sans"})}),r.jsx(Ri,{label:"Priority",children:r.jsxs("select",{value:D,onChange:ee=>X(ee.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(Uw,{message:y}):null,r.jsx(Vw,{onCancel:()=>s(!1),submitting:h,submitLabel:"Promote"})]})}),r.jsx(ch,{value:"existing",children:r.jsxs("form",{onSubmit:O,className:"space-y-4",children:[r.jsx(Ri,{label:"Project",children:r.jsx(Bw,{value:Z,onChange:ee=>{z(ee),J("")},projects:ne,error:w,disabled:h})}),r.jsx(Ri,{label:Q?"Assignment (loading...)":"Assignment",children:r.jsxs("select",{value:U,onChange:ee=>J(ee.target.value),disabled:h||!Z||Q,className:"editor-textarea w-full bg-background/95 font-sans",children:[r.jsx("option",{value:"",children:Z?"Select assignment...":"Pick a project first"}),(_??[]).map(ee=>r.jsxs("option",{value:ee.slug,children:[ee.title," (",ee.status,")"]},ee.slug))]})}),y?r.jsx(Uw,{message:y}):null,r.jsx(Vw,{onCancel:()=>s(!1),submitting:h,submitLabel:"Promote"})]})})]})]})})}function Ri({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 Bw({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:HS,children:"One-off (no project)"}):null,n.map(c=>r.jsxs("option",{value:c.slug,children:[c.title," (",c.slug,")"]},c.slug))]})}function Uw({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 Vw({onCancel:e,submitting:t,submitLabel:n}){return r.jsxs(Ps,{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 WS({open:e,selectedIds:t,scope:n,onOpenChange:s,onDone:i}){const[l,c]=f.useState("project"),[u,p]=f.useState(""),[m,h]=f.useState(""),[x,y]=f.useState(!1),[b,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 R(){if(l==="global")return{global:!0};if(l==="workspace"){const $=u.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 KP(n.workspace,$,D):await nF(n.projectId,$,D),{ok:!0}}catch(X){return{ok:!1,error:X instanceof Error?X.message:String(X)}}}async function P($){$.preventDefault(),w(null);const D=R();if(typeof D=="string"){w(D);return}y(!0),C(null);const X=[],Z=[];for(const z of t){const U=await I(z,D);U.ok?X.push(z):Z.push({id:z,error:U.error})}y(!1),i(),Z.length===0?s(!1):C({succeeded:X,failed:Z})}return r.jsx(Zn,{open:e,onOpenChange:$=>x?void 0:s($),children:r.jsx(_n,{className:"max-w-xl",children:r.jsxs("form",{onSubmit:P,className:"space-y-4",children:[r.jsxs(qr,{children:[r.jsxs(Fn,{children:["Move ",t.length," todo",t.length===1?"":"s"]}),r.jsxs(fs,{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(Dm,{kind:"project",checked:l==="project",onChange:()=>c("project"),label:"Project"}),r.jsx(Dm,{kind:"workspace",checked:l==="workspace",onChange:()=>c("workspace"),label:"Workspace"}),r.jsx(Dm,{kind:"global",checked:l==="global",onChange:()=>c("global"),label:"Global"})]}),l==="project"?r.jsx(Hw,{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(Hw,{label:"Target workspace name",children:r.jsx("input",{type:"text",value:u,onChange:$=>p($.target.value),disabled:x,placeholder:"e.g. syntaur",className:"editor-textarea w-full bg-background/95 font-sans"})}):null,j?r.jsx(rF,{message:j}):null,b?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 ",b.succeeded.length," of ",t.length,"; ",b.failed.length," failed."]}),r.jsx("ul",{className:"text-xs space-y-0.5",children:b.failed.map($=>r.jsxs("li",{children:["[t:",$.id,"] ",$.error]},$.id))})]}):null,r.jsxs(Ps,{children:[r.jsx("button",{type:"button",onClick:()=>s(!1),disabled:x,className:"shell-action disabled:cursor-not-allowed disabled:opacity-50",children:b?"Close":"Cancel"}),b===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 Hw({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 Dm({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 rF({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 sF={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 oF({bundle:e}){const t=sF[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 iF({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(oF,{bundle:n},n.id))]})}function aF(e){const[t,n]=f.useState(null),[s,i]=f.useState(!0),[l,c]=f.useState(null),u=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(()=>{u()},[u]),ql(p=>{p.type==="todos-updated"&&!p.projectSlug&&u()}),{data:t,loading:s,error:l,refetch:u}}function lF({item:e,copiedId:t,selected:n,onToggleSelected:s,onMoveOne:i,onCycleStatus:l,onStatusChange:c,onCopyId:u,onDelete:p,disabled:m,hotkeyRowProps:h}){const{attributes:x,listeners:y,setNodeRef:b,setActivatorNodeRef:C,transform:j,transition:w,isDragging:S}=Zd({id:e.id,disabled:m}),E={transform:io.Transform.toString(j),transition:w,zIndex:S?50:void 0,position:S?"relative":void 0};return r.jsxs("div",{ref:b,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(yd,{className:"h-4 w-4"})}),r.jsx(Zg,{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(KS,{item:e})]}),t===e.id?r.jsxs("span",{className:"text-xs text-status-completed-foreground flex items-center gap-1",children:[r.jsx(lo,{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=>u(N,e.id),children:["t:",e.id]}),r.jsx("button",{className:"text-muted-foreground/40 hover:text-foreground transition",title:"Copy ID",onClick:N=>u(N,e.id),children:r.jsx(Pl,{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(Kl,{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(Mn,{className:"h-3 w-3"})})]})]})}function KS({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(Mo,{delayDuration:120,children:r.jsxs(Er,{children:[r.jsx(Tr,{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(Oh,{className:"h-2.5 w-2.5"}),r.jsx("span",{className:"block min-w-0 max-w-[120px] truncate",children:e.branch})]})}),r.jsx(pr,{children:e.branch})]})}):null,e.planDir?r.jsx(Mo,{delayDuration:120,children:r.jsxs(Er,{children:[r.jsx(Tr,{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(zj,{className:"h-2.5 w-2.5"})})}),r.jsxs(pr,{children:["Plan: ",e.planDir]})]})}):null,e.worktreePath||e.createdAt||e.updatedAt?r.jsx(Mo,{delayDuration:120,children:r.jsxs(Er,{children:[r.jsx(Tr,{asChild:!0,children:r.jsx("span",{className:"text-[10px] text-muted-foreground/60 cursor-default",children:"·"})}),r.jsx(pr,{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 cF(){const{workspace:e}=Et(),t=e||"_global",{data:n,loading:s,error:i,refetch:l}=UP(t),{data:c}=aF(t),[u,p]=f.useState(""),[m,h]=f.useState(""),[x,y]=f.useState(""),[b,C]=f.useState(""),[j,w]=f.useState(null),[S,E]=f.useState(new Set),[N,R]=f.useState(!1),[I,P]=f.useState(!1),[$,D]=f.useState(null),X=f.useRef(null);fo("list:todos");const Z=!!(u.trim()||m||x),z=Wd(ao(ha,{activationConstraint:{distance:8}}),ao(ma));function U(V,H){V.stopPropagation(),navigator.clipboard.writeText(H),w(H),setTimeout(()=>w(ae=>ae===H?null:ae),1500)}const J=f.useMemo(()=>{if(!(n!=null&&n.items))return[];const V=new Set;for(const H of n.items)for(const ae of H.tags)V.add(ae);return Array.from(V).sort()},[n]),_=f.useMemo(()=>{if(!(n!=null&&n.items))return[];let V=n.items;if(u.trim()){const H=u.toLowerCase();V=V.filter(ae=>ae.description.toLowerCase().includes(H)||ae.tags.some(he=>he.toLowerCase().includes(H))||ae.id.includes(H))}return m&&(V=V.filter(H=>H.status===m)),x&&(V=V.filter(H=>H.tags.includes(x))),V},[n,u,m,x]);f.useEffect(()=>{E(new Set)},[u,m,x,t]);const G=f.useMemo(()=>_.filter(V=>S.has(V.id)).length,[_,S]),Q=_.length>0&&G===_.length,le=G>0&&!Q;function W(V){E(H=>{const ae=new Set(H);return ae.has(V)?ae.delete(V):ae.add(V),ae})}function ne(){E(V=>{const H=new Set(V);if(Q)for(const ae of _)H.delete(ae.id);else for(const ae of _)H.add(ae.id);return H})}function T(){E(new Set)}const O=$?[$]:Array.from(S);function q(){E(new Set),D(null),l()}function L(){E(new Set),l()}async function ee(){b.trim()&&(await qh(t,b.trim()),C(""),l())}const de={open:"in_progress",in_progress:"completed",completed:"open",blocked:"open"};function F(V,H){me(V,de[H]||"open")}async function re(V,H,ae){V.stopPropagation(),window.confirm(`Delete "${ae}"? This can't be undone.`)&&(await S0(t,H),l())}async function me(V,H){switch(H){case"open":await k0(t,V);break;case"in_progress":await j0(t,V);break;case"completed":await v0(t,V);break;case"blocked":await w0(t,V);break}l()}const{hotkeyRowProps:ve}=Gl(_,{scope:"list:todos",bindO:!1,onOpen:V=>F(V.id,V.status)});$t({keys:"/",scope:"list:todos",description:"Focus filter",handler:()=>{var V;return(V=X.current)==null?void 0:V.focus()}}),$t({keys:"r",scope:"list:todos",description:"Refresh",handler:()=>l()});const[Se,fe]=ds(),He=Se.get("focus");f.useEffect(()=>{if(!He)return;const V=document.querySelector(`[data-todo-id="${window.CSS.escape(He)}"]`);if(!V)return;V.scrollIntoView({block:"nearest"}),V.classList.add("ring-2","ring-primary/60");const H=window.setTimeout(()=>{V.classList.remove("ring-2","ring-primary/60"),fe(ae=>{const he=new URLSearchParams(ae);return he.delete("focus"),he})},1500);return()=>window.clearTimeout(H)},[He,_.length,fe]);async function pe(V){const{active:H,over:ae}=V;if(!ae||H.id===ae.id||!(n!=null&&n.items))return;const he=n.items.findIndex(Ve=>Ve.id===H.id),Ae=n.items.findIndex(Ve=>Ve.id===ae.id);if(he===-1||Ae===-1)return;const Te=ga(n.items,he,Ae);await VP(t,Te.map(Ve=>Ve.id)),l()}if(s)return r.jsx(dt,{label:"Loading todos..."});if(i)return r.jsx(ht,{error:i});const Pe=(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(Sn,{label:"Open",value:Pe.open,icon:Pr}),r.jsx(Sn,{label:"In Progress",value:Pe.in_progress,icon:Pr,tone:"info"}),r.jsx(Sn,{label:"Blocked",value:Pe.blocked,icon:Bh,tone:"warn"}),r.jsx(Sn,{label:"Total",value:Pe.total,icon:Pr})]}),c&&r.jsx(iF,{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:b,onChange:V=>C(V.target.value),onKeyDown:V=>V.key==="Enter"&&ee(),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:ee,disabled:!b.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(Kt,{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(co,{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:u,onChange:V=>p(V.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:V=>h(V.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:V=>y(V.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(V=>r.jsxs("option",{value:V,children:["#",V]},V))]})]}),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:()=>R(!0),className:"shell-action bg-foreground text-background hover:opacity-90",children:"Promote selected"}),r.jsx("button",{type:"button",onClick:()=>{D(null),P(!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(ct,{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:Q,ref:V=>{V&&(V.indeterminate=le)},onChange:ne,className:"h-4 w-4 cursor-pointer accent-foreground"}),r.jsxs("span",{children:["Select all in current filter (",_.length,")"]})]}),r.jsx(Jd,{sensors:z,collisionDetection:Kd,onDragEnd:pe,children:r.jsx(Qd,{items:_.map(V=>V.id),strategy:Xd,children:r.jsx("div",{className:"space-y-1",children:_.map((V,H)=>r.jsx(lF,{item:V,copiedId:j,selected:S.has(V.id),onToggleSelected:ae=>W(ae),onMoveOne:(ae,he)=>{he.stopPropagation(),D(ae),P(!0)},onCycleStatus:F,onStatusChange:me,onCopyId:U,onDelete:re,disabled:Z,hotkeyRowProps:ve(H)},V.id))})})})]}),r.jsx(ex,{open:N,selectedIds:Array.from(S),scope:{kind:"workspace",workspace:t},onOpenChange:R,onDone:L}),r.jsx(WS,{open:I,selectedIds:O,scope:{kind:"workspace",workspace:t},onOpenChange:V=>{P(V),V||D(null)},onDone:q})]})}function uF({item:e,copiedId:t,selected:n,onToggleSelected:s,onMoveOne:i,onCycleStatus:l,onStatusChange:c,onCopyId:u,onDelete:p,disabled:m,hotkeyRowProps:h}){const{attributes:x,listeners:y,setNodeRef:b,setActivatorNodeRef:C,transform:j,transition:w,isDragging:S}=Zd({id:e.id,disabled:m}),E={transform:io.Transform.toString(j),transition:w,zIndex:S?50:void 0,position:S?"relative":void 0};return r.jsxs("div",{ref:b,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(yd,{className:"h-4 w-4"})}),r.jsx(Zg,{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(KS,{item:e})]}),t===e.id?r.jsxs("span",{className:"text-xs text-status-completed-foreground flex items-center gap-1",children:[r.jsx(lo,{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=>u(N,e.id),children:["t:",e.id]}),r.jsx("button",{className:"text-muted-foreground/40 hover:text-foreground transition",title:"Copy ID",onClick:N=>u(N,e.id),children:r.jsx(Pl,{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(Kl,{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(Mn,{className:"h-3 w-3"})})]})]})}function dF({projectId:e}){const{data:t,loading:n,error:s,refetch:i}=q5(e),[l,c]=f.useState(""),[u,p]=f.useState(""),[m,h]=f.useState(""),[x,y]=f.useState(""),[b,C]=f.useState(null),[j,w]=f.useState(new Set),[S,E]=f.useState(!1),[N,R]=f.useState(!1),[I,P]=f.useState(null),$=f.useRef(null);fo("list:todos");const D=!!(l.trim()||u||m),X=Wd(ao(ha,{activationConstraint:{distance:8}}),ao(ma));function Z(pe,Pe){pe.stopPropagation(),navigator.clipboard.writeText(Pe),C(Pe),setTimeout(()=>C(V=>V===Pe?null:V),1500)}const z=f.useMemo(()=>{if(!(t!=null&&t.items))return[];const pe=new Set;for(const Pe of t.items)for(const V of Pe.tags)pe.add(V);return Array.from(pe).sort()},[t]),U=f.useMemo(()=>{if(!(t!=null&&t.items))return[];let pe=t.items;if(l.trim()){const Pe=l.toLowerCase();pe=pe.filter(V=>V.description.toLowerCase().includes(Pe)||V.tags.some(H=>H.toLowerCase().includes(Pe))||V.id.includes(Pe))}return u&&(pe=pe.filter(Pe=>Pe.status===u)),m&&(pe=pe.filter(Pe=>Pe.tags.includes(m))),pe},[t,l,u,m]);f.useEffect(()=>{w(new Set)},[l,u,m,e]);const J=f.useMemo(()=>U.filter(pe=>j.has(pe.id)).length,[U,j]),_=U.length>0&&J===U.length,G=J>0&&!_;function Q(pe){w(Pe=>{const V=new Set(Pe);return V.has(pe)?V.delete(pe):V.add(pe),V})}function le(){w(pe=>{const Pe=new Set(pe);if(_)for(const V of U)Pe.delete(V.id);else for(const V of U)Pe.add(V.id);return Pe})}function W(){w(new Set)}const ne=I?[I]:Array.from(j);function T(){w(new Set),P(null),i()}function O(){w(new Set),i()}async function q(){x.trim()&&(await G5(e,x.trim()),y(""),i())}const L={open:"in_progress",in_progress:"completed",completed:"open",blocked:"open"};function ee(pe,Pe){F(pe,L[Pe]||"open")}async function de(pe,Pe,V){pe.stopPropagation(),window.confirm(`Delete "${V}"? This can't be undone.`)&&(await eF(e,Pe),i())}async function F(pe,Pe){switch(Pe){case"open":await Q5(e,pe);break;case"in_progress":await X5(e,pe);break;case"completed":await Y5(e,pe);break;case"blocked":await J5(e,pe);break}i()}const{hotkeyRowProps:re}=Gl(U,{scope:"list:todos",bindO:!1,onOpen:pe=>ee(pe.id,pe.status)});$t({keys:"/",scope:"list:todos",description:"Focus filter",handler:()=>{var pe;return(pe=$.current)==null?void 0:pe.focus()}}),$t({keys:"r",scope:"list:todos",description:"Refresh",handler:()=>i()});const[me,ve]=ds(),Se=me.get("focus");f.useEffect(()=>{if(!Se)return;const pe=document.querySelector(`[data-todo-id="${window.CSS.escape(Se)}"]`);if(!pe)return;pe.scrollIntoView({block:"nearest"}),pe.classList.add("ring-2","ring-primary/60");const Pe=window.setTimeout(()=>{pe.classList.remove("ring-2","ring-primary/60"),ve(V=>{const H=new URLSearchParams(V);return H.delete("focus"),H},{replace:!0})},1500);return()=>window.clearTimeout(Pe)},[Se,U.length,ve]);async function fe(pe){const{active:Pe,over:V}=pe;if(!V||Pe.id===V.id||!(t!=null&&t.items))return;const H=t.items.findIndex(Ae=>Ae.id===Pe.id),ae=t.items.findIndex(Ae=>Ae.id===V.id);if(H===-1||ae===-1)return;const he=ga(t.items,H,ae);await Z5(e,he.map(Ae=>Ae.id)),i()}if(n)return r.jsx(dt,{label:"Loading todos..."});if(s)return r.jsx(ht,{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(Sn,{label:"Open",value:He.open,icon:Pr}),r.jsx(Sn,{label:"In Progress",value:He.in_progress,icon:Pr,tone:"info"}),r.jsx(Sn,{label:"Blocked",value:He.blocked,icon:Bh,tone:"warn"}),r.jsx(Sn,{label:"Total",value:He.total,icon:Pr})]}),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:pe=>y(pe.target.value),onKeyDown:pe=>pe.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(Kt,{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(co,{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:pe=>c(pe.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:u,onChange:pe=>p(pe.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"})]}),z.length>0&&r.jsxs("select",{value:m,onChange:pe=>h(pe.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"}),z.map(pe=>r.jsxs("option",{value:pe,children:["#",pe]},pe))]})]}),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:()=>{P(null),R(!0)},className:"shell-action",children:"Move to…"}),r.jsx("button",{type:"button",onClick:W,className:"text-xs text-muted-foreground hover:text-foreground",children:"Clear"})]})]}):null,U.length===0?r.jsx(ct,{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:pe=>{pe&&(pe.indeterminate=G)},onChange:le,className:"h-4 w-4 cursor-pointer accent-foreground"}),r.jsxs("span",{children:["Select all in current filter (",U.length,")"]})]}),r.jsx(Jd,{sensors:X,collisionDetection:Kd,onDragEnd:fe,children:r.jsx(Qd,{items:U.map(pe=>pe.id),strategy:Xd,children:r.jsx("div",{className:"space-y-1",children:U.map((pe,Pe)=>r.jsx(uF,{item:pe,copiedId:b,selected:j.has(pe.id),onToggleSelected:V=>Q(V),onMoveOne:(V,H)=>{H.stopPropagation(),P(V),R(!0)},onCycleStatus:ee,onStatusChange:F,onCopyId:Z,onDelete:de,disabled:D,hotkeyRowProps:re(Pe)},pe.id))})})})]}),r.jsx(ex,{open:S,selectedIds:Array.from(j),scope:{kind:"project",projectId:e},onOpenChange:E,onDone:O}),r.jsx(WS,{open:N,selectedIds:ne,scope:{kind:"project",projectId:e},onOpenChange:pe=>{R(pe),pe||P(null)},onDone:T})]})}const fF={title:"Assignment",status:"Status",priority:"Priority",assignee:"Assignee",dependencies:"Dependencies",updated:"Updated"},Ww=new Set(["title"]);function qS({visibility:e,onChange:t}){const[n,s]=f.useState(!1);function i(c){if(Ww.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(Zn,{open:n,onOpenChange:s,children:[r.jsx(O3,{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(uT,{className:"h-3.5 w-3.5","aria-hidden":"true"}),r.jsxs("span",{children:["Columns",l>0?` (${lm.length-l}/${lm.length})`:""]})]})}),r.jsxs(_n,{className:"max-w-sm",children:[r.jsx(qr,{children:r.jsx(Fn,{children:"Columns"})}),r.jsx("div",{className:"space-y-2",children:lm.map(c=>{const u=e.hidden.includes(c),p=Ww.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:!u,onChange:()=>i(c),disabled:p,className:"h-4 w-4 rounded border-border accent-foreground"}),r.jsx("span",{children:fF[c]}),p?r.jsx("span",{className:"ml-auto text-xs text-muted-foreground",children:"always shown"}):null]},c)})})]})]})}const Ji={...Ll,custom:!1},GS=`view-prefs.cache.v${Ll.version}`;let zl=pF(),Ai=null;const Bl=new Set;let YS=0;function tx(){return++YS}function nx(e){return e===YS}function pF(){if(typeof window>"u"||!window.localStorage)return null;try{const e=window.localStorage.getItem(GS);if(!e)return null;const t=JSON.parse(e);return t.version!==Ll.version?null:t}catch{return null}}function mF(e){if(!(typeof window>"u"||!window.localStorage))try{window.localStorage.setItem(GS,JSON.stringify(e))}catch{}}function rx(e){zl=e,mF(e);for(const t of Bl)t(e)}function sx(e){if(!e||typeof e!="object")return Ji;const t=e;return t.version!==Ll.version||!t.global||!t.projects?Ji:{version:Ll.version,global:t.global,projects:t.projects,custom:t.custom===!0}}function ox(){if(Ai)return Ai;const e=tx();return Ai=fetch("/api/view-prefs").then(t=>{if(!t.ok)throw new Error(`HTTP ${t.status}`);return t.json()}).then(t=>{const n=sx(t);return nx(e)&&rx(n),Ai=null,zl??n}).catch(()=>(Ai=null,zl??Ji)),Ai}function JS(e){const[t,n]=f.useState(()=>zl??Ji);return f.useEffect(()=>{let s=!1;return ox().then(i=>{s||n(i)}),Bl.add(n),()=>{s=!0,Bl.delete(n)}},[]),Ek(t,e??null)}function hF(){const[e,t]=f.useState(()=>zl??Ji);return f.useEffect(()=>{let n=!1;return ox().then(s=>{n||t(s)}),Bl.add(t),()=>{n=!0,Bl.delete(t)}},[]),e}async function XS(e){const t=tx(),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=sx(await n.json());return nx(t)&&rx(s),s}function QS(e){return XS({global:e})}function ZS(e,t){return XS({projects:{[e]:t}})}async function gF(){const e=tx(),t=await fetch("/api/view-prefs",{method:"DELETE"});if(!t.ok)throw new Error(`HTTP ${t.status}`);const n=sx(await t.json());return nx(e)&&rx(n),n}const Kw=80;function eN({open:e,onOpenChange:t,initialName:n="",onSubmit:s,title:i="Save view"}){const[l,c]=f.useState(n),[u,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<=Kw;return r.jsx(Zn,{open:e,onOpenChange:t,children:r.jsx(_n,{className:"max-w-md",children:r.jsxs("form",{className:"space-y-4",onSubmit:async b=>{if(b.preventDefault(),!(!y||u)){p(!0),h(null);try{await s(x)}catch(C){h(C instanceof Error?C.message:String(C)),p(!1)}}},children:[r.jsx(qr,{children:r.jsx(Fn,{children:i})}),r.jsxs("div",{className:"space-y-2",children:[r.jsx("input",{type:"text",value:l,autoFocus:!0,required:!0,maxLength:Kw,onChange:b=>c(b.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(Ps,{children:[r.jsx("button",{type:"button",onClick:()=>t(!1),className:"shell-action",disabled:u,children:"Cancel"}),r.jsx("button",{type:"submit",disabled:!y||u,className:"shell-action bg-foreground text-background hover:opacity-90 disabled:opacity-50",children:u?"Saving…":"Save"})]})]})})})}function tN({scope:e,loadedViewId:t,onApply:n,onOpenSaveDialog:s}){const{views:i,loading:l}=dg(),[c,u]=f.useState(!1),p=f.useRef(null);f.useEffect(()=>{if(!c)return;function y(C){p.current&&!p.current.contains(C.target)&&u(!1)}function b(C){C.key==="Escape"&&u(!1)}return document.addEventListener("mousedown",y),document.addEventListener("keydown",b),()=>{document.removeEventListener("mousedown",y),document.removeEventListener("keydown",b)}},[c]);const m=f.useMemo(()=>i.filter(y=>Pk(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:()=>u(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(no,{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:()=>{u(!1),s()},className:"shell-action w-full justify-center",children:"Save current view"})]}):m.map(y=>{const b=y.id===t;return r.jsxs("button",{type:"button",onClick:()=>{u(!1),n(y)},className:Re("flex w-full items-center gap-2 px-3 py-1.5 text-left text-sm transition hover:bg-foreground/5",b&&"font-semibold text-foreground"),children:[r.jsx("span",{className:"inline-flex h-4 w-4 shrink-0 items-center justify-center",children:b?r.jsx(lo,{className:"h-3.5 w-3.5","aria-hidden":"true"}):null}),r.jsx("span",{className:"truncate",children:y.name})]},y.id)})})]})}const xF={__unassigned__:"Unassigned",__standalone__:"No project"};function Jn({options:e,value:t,onChange:n,allLabel:s="Any",className:i,disabled:l,ariaLabel:c}){const[u,p]=f.useState(!1),m=f.useRef(null),h=f.useRef(null),x=f.useRef([]),y=f.useMemo(()=>{const E=new Set(e.map(R=>R.value)),N=t.filter(R=>!E.has(R)).map(R=>({value:R,label:xF[R]??R}));return[...e,...N]},[e,t]),b=f.useMemo(()=>new Set(t),[t]);f.useEffect(()=>{if(!u)return;function E(N){m.current&&!m.current.contains(N.target)&&p(!1)}return document.addEventListener("mousedown",E),()=>document.removeEventListener("mousedown",E)},[u]),f.useEffect(()=>{var E;u&&((E=x.current[0])==null||E.focus())},[u]);const C=f.useMemo(()=>{if(t.length===0)return s;if(t.length===1){const E=y.find(N=>N.value===t[0]);return E?E.label:t[0]}return`${t.length} selected`},[t,y,s]);function j(E){n(b.has(E)?t.filter(N=>N!==E):[...t,E])}function w(E){var R;const N=Math.max(0,Math.min(E,y.length-1));(R=x.current[N])==null||R.focus()}function S(E){var P;const N=x.current,R=document.activeElement,I=N.findIndex($=>$===R);E.key==="ArrowDown"?(E.preventDefault(),w(I<0?0:I+1)):E.key==="ArrowUp"?(E.preventDefault(),w(I<0?y.length-1:I-1)):E.key==="Home"?(E.preventDefault(),w(0)):E.key==="End"?(E.preventDefault(),w(y.length-1)):E.key==="Escape"&&(E.preventDefault(),p(!1),(P=h.current)==null||P.focus())}return r.jsxs("div",{className:"relative",ref:m,children:[r.jsxs("button",{type:"button",ref:h,disabled:l,"aria-haspopup":"menu","aria-expanded":u,"aria-label":c,onClick:()=>p(E=>!E),onKeyDown:E=>{!u&&(E.key==="ArrowDown"||E.key==="ArrowUp")&&(E.preventDefault(),p(!0))},className:Re("editor-input inline-flex items-center justify-between gap-1.5 text-left",t.length>0&&"border-foreground/40 text-foreground",i),children:[r.jsx("span",{className:"truncate",children:C}),r.jsx(no,{className:"h-3.5 w-3.5 shrink-0 opacity-60","aria-hidden":"true"})]}),u?r.jsxs("div",{role:"menu","aria-label":c,onKeyDown:S,className:"absolute left-0 top-full z-30 mt-1 max-h-72 min-w-[200px] overflow-auto rounded-md border border-border/70 bg-background py-1 shadow-lg",children:[r.jsxs("div",{className:"flex items-center justify-between gap-2 px-2 pb-1",children:[r.jsx("button",{type:"button",role:"menuitem",className:"text-xs text-muted-foreground hover:text-foreground disabled:opacity-40",disabled:t.length===y.length,onClick:()=>n(y.map(E=>E.value)),children:"Select all"}),r.jsx("button",{type:"button",role:"menuitem",className:"text-xs text-muted-foreground hover:text-foreground disabled:opacity-40",disabled:t.length===0,onClick:()=>n([]),children:"Clear"})]}),y.length===0?r.jsx("p",{className:"px-3 py-1.5 text-xs text-muted-foreground",children:"No options"}):y.map((E,N)=>{const R=b.has(E.value);return r.jsxs("button",{ref:I=>{x.current[N]=I},type:"button",role:"menuitemcheckbox","aria-checked":R,tabIndex:-1,onClick:()=>j(E.value),className:Re("flex w-full items-center gap-2 px-3 py-1.5 text-left text-sm transition hover:bg-foreground/5",R?"text-foreground":"text-muted-foreground"),children:[r.jsx("span",{className:Re("flex h-4 w-4 shrink-0 items-center justify-center rounded border",R?"border-foreground bg-foreground text-background":"border-border/70"),"aria-hidden":"true",children:R?r.jsx(lo,{className:"h-3 w-3"}):null}),r.jsx("span",{className:"truncate",children:E.label})]},E.value)})]}):null]})}function yF(e,t){const n={},s=it(e.status);s.length&&(n.status=s);const i=it(e.type);i.length&&(n.type=i);const l=it(e.priority);l.length&&(n.priority=l);const c=it(e.assignee);if(c.length&&(n.assignee=c),t&&t!=="all")n.project=[t];else{const u=it(e.project);u.length&&(n.project=u)}return e.activity&&e.activity!=="all"&&(n.activity=e.activity),n}function Ul(e){const t={viewMode:e.state.viewMode,filters:yF(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 nN(e,t){var s,i,l,c,u,p,m,h,x,y,b;const{config:n}=e;if((s=t.setViewMode)==null||s.call(t,n.viewMode),(i=t.setStatusFilter)==null||i.call(t,it(n.filters.status)),(l=t.setTypeFilter)==null||l.call(t,it(n.filters.type)),(c=t.setPriorityFilter)==null||c.call(t,it(n.filters.priority)),(u=t.setAssigneeFilter)==null||u.call(t,it(n.filters.assignee)),(p=t.setProjectFilter)==null||p.call(t,it(n.filters.project)),t.setActivityFilter){const C=n.filters.activity??"all";t.setActivityFilter(C==="fresh"||C==="stale"?C:"all")}(m=t.setSortField)==null||m.call(t,n.sortField),(h=t.setSortDirection)==null||h.call(t,n.sortDirection),(x=t.setListSectionVisibility)==null||x.call(t,{collapsed:[...n.listSectionVisibility.collapsed]}),(y=t.setKanbanColumnVisibility)==null||y.call(t,{hidden:[...n.kanbanColumnVisibility.hidden]}),(b=t.setTableColumnVisibility)==null||b.call(t,{hidden:[...n.tableColumnVisibility.hidden]})}function rN(e){const t=e.workspace?`/w/${e.workspace}`:"",n=it(e.config.filters.project);return n.length===1&&n[0]!=="__standalone__"&&Tk(e.config,n[0])?`${t}/projects/${n[0]}?tab=assignments&loadView=${encodeURIComponent(e.id)}`:`${t}/assignments?loadView=${encodeURIComponent(e.id)}`}const bF=["critical","high","medium","low"],Di={viewMode:"kanban",sortField:"updated",sortDirection:"desc"};function vF(e,t){const{config:n}=Ul({name:"",context:{workspace:t,projectSlug:null},state:{viewMode:e.viewMode,filters:e.filters,sortField:e.sortField,sortDirection:e.sortDirection,listSectionVisibility:{collapsed:[]},kanbanColumnVisibility:{hidden:[]},tableColumnVisibility:{hidden:[]}}});return{workspace:t,config:n}}function wF(e){const t=[];for(const n of["status","priority","type","assignee","project"]){const s=it(e[n]);s.length&&t.push(`${n}=${s.join(", ")}`)}return e.activity&&e.activity!=="all"&&t.push(`activity=${e.activity}`),t.join(" · ")||"no filters"}const jF=4e3;function ix(){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},jF)},[]);return f.useEffect(()=>()=>{n.current!==null&&clearTimeout(n.current)},[]),{toast:e,showToast:i,dismissToast:s}}function ax({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:Re("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 kF=new Set(["overview","assignments","todos","dependencies","knowledge"]),qw="__unknown_type__";function Gw(){const{slug:e,workspace:t}=Et(),n=Xt(),s=Ct();fo("project"),$t({keys:"a",scope:"project",description:"Create assignment",handler:()=>s(`${n}/projects/${e}/create/assignment`)}),$t({keys:"e",scope:"project",description:"Edit project",handler:()=>s(`${n}/projects/${e}/edit`)});const{data:i,loading:l,error:c,refetch:u}=p0(e),p=Wo(),m=Fd(),{data:h}=vd(),[x,y]=ds(),b=x.get("tab"),C=b&&kF.has(b)?b:"overview";function j(se){y(Oe=>{const Je=new URLSearchParams(Oe);return se==="overview"?Je.delete("tab"):Je.set("tab",se),Je},{replace:!0})}const w=e?`p:${e}`:null,S=JS(w),[E,N]=f.useState(()=>am(S.defaultView)),[R,I]=f.useState(()=>it(S.filters.status)),[P,$]=f.useState(()=>it(S.filters.assignee)),[D,X]=f.useState(()=>it(S.filters.priority)),[Z,z]=f.useState(()=>it(S.filters.type)),[U,J]=f.useState(()=>S.grouping),[_,G]=f.useState(()=>S.sortField),[Q,le]=f.useState(()=>S.sortDirection),[W,ne]=f.useState(()=>({collapsed:[]})),[T,O]=f.useState(()=>({hidden:[]})),[q,L]=f.useState(()=>({hidden:[]})),[ee,de]=f.useState(null),[F,re]=f.useState(!1),[me,ve]=f.useState(!1),{toast:Se,showToast:fe,dismissToast:He}=ix(),pe={kind:"project",slug:e??"",workspace:t??null},Pe=x.get("loadView"),{view:V,loading:H,error:ae}=Zi(Pe),{view:he,loading:Ae,error:Te}=Zi(ee),Ve=f.useRef(null);f.useEffect(()=>{ee&&!Ae&&!Te&&!he&&de(null)},[he,Te,ee,Ae]),f.useEffect(()=>{de(null),Ve.current=null},[e,t]),f.useEffect(()=>{N(am(S.defaultView)),I(it(S.filters.status)),$(it(S.filters.assignee)),X(it(S.filters.priority)),z(it(S.filters.type)),J(S.grouping),G(S.sortField),le(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(se=>{w&&ZS(w,se).catch(Oe=>{console.warn("Failed to persist project view prefs:",Oe)})},[w]),Tt=f.useCallback(se=>{N(se),Ze({defaultView:se})},[Ze]),yt=f.useCallback(se=>{I(se),Ze({filters:{status:se}})},[Ze]),jt=f.useCallback(se=>{$(se),Ze({filters:{assignee:se}})},[Ze]),ue=f.useCallback(se=>{X(se),Ze({filters:{priority:se}})},[Ze]),ye=f.useCallback(se=>{z(se),Ze({filters:{type:se}})},[Ze]),Le=f.useCallback(se=>{J(se),Ze({grouping:se})},[Ze]),Ie=f.useCallback(se=>{G(se),Ze({sortField:se})},[Ze]),We=f.useCallback(se=>{le(se),Ze({sortDirection:se})},[Ze]),et=f.useCallback(()=>({viewMode:E,filters:{status:R,priority:D,type:Z,assignee:P,project:"all",activity:"all"},sortField:_,sortDirection:Q,listSectionVisibility:W,kanbanColumnVisibility:T,tableColumnVisibility:q}),[E,R,D,Z,P,_,Q,W,T,q]),_t=f.useCallback(se=>{nN(se,{setViewMode:Oe=>N(am(Oe)),setStatusFilter:yt,setPriorityFilter:ue,setTypeFilter:ye,setAssigneeFilter:jt,setSortField:Ie,setSortDirection:We,setListSectionVisibility:ne,setKanbanColumnVisibility:O,setTableColumnVisibility:L}),de(se.id)},[yt,ue,ye,jt,Ie,We]),bt=f.useCallback(se=>{_t(se),Ve.current=se.id,y(Oe=>{const Je=new URLSearchParams(Oe);return Je.set("loadView",se.id),Je},{replace:!0})},[_t,y]),Qt=f.useCallback(async se=>{try{const Oe=Ul({name:se,context:{workspace:t??null,projectSlug:e??null},state:et()}),Je=await fg(Oe),Gt=Je.views[Je.views.length-1];de((Gt==null?void 0:Gt.id)??null),Gt&&(Ve.current=Gt.id,y(tt=>{const pn=new URLSearchParams(tt);return pn.set("loadView",Gt.id),pn},{replace:!0})),re(!1),ve(!1),fe(`Saved view "${se}"`,"success")}catch(Oe){throw fe(Oe instanceof Error?Oe.message:"Failed to save view","error"),Oe}},[et,y,fe,e,t]),sn=f.useCallback(async()=>{if(ee)try{const se=it(he==null?void 0:he.config.filters.project)[0]??null,Oe=Ul({name:(he==null?void 0:he.name)??"",context:{workspace:t??null,projectSlug:se},state:et()});await pg(ee,{config:Oe.config}),fe("View updated","success")}catch(se){fe(se instanceof Error?se.message:"Failed to update view","error")}},[et,he,ee,fe,t]);f.useEffect(()=>{if(!Pe){Ve.current=null;return}if(Ve.current!==Pe&&(ee&&ee!==Pe&&de(null),!H)){if(ae){fe("Couldn't load saved view — try again","error");return}if(V){if(Ve.current=Pe,!Pk(V,{kind:"project",slug:e??"",workspace:t??null})){s(rN(V),{replace:!0});return}_t(V),y(se=>{const Oe=new URLSearchParams(se);return Oe.delete("loadView"),Oe},{replace:!0});return}Ve.current=Pe,fe("Saved view no longer exists","error"),y(se=>{const Oe=new URLSearchParams(se);return Oe.delete("loadView"),Oe},{replace:!0})}},[Pe,V,H,ae,ee,_t,y,fe,s,e,t]);function vt(se){_===se?We(Q==="asc"?"desc":"asc"):(Ie(se),We("asc"))}const xe=f.useMemo(()=>i?Object.fromEntries(i.assignments.flatMap(se=>{const Oe=`${n}/projects/${i.slug}/assignments/${se.slug}`;return[[se.slug,Oe],[se.title,Oe]]})):{},[i]);async function Ye(se){await fetch(`/api/projects/${e}/status-override`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({status:se})}),u()}async function Ke(se){await fetch(`/api/projects/${e}/move-workspace`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({workspace:se})}),u()}if(l)return r.jsx(dt,{label:"Loading project workspace…"});if(c||!i)return r.jsx(ht,{error:c||"Project not found."});const vn=(()=>{const se=new Set;for(const Je of i.assignments)Je.assignee&&se.add(Je.assignee);const Oe=[{value:"__unassigned__",label:"Unassigned"}];for(const Je of Array.from(se).sort())Oe.push({value:Je,label:Je});return Oe})(),zn=i.assignments.filter(se=>Ng(se,{status:R,priority:D,type:Z,assignee:P})),ft=Cg(zn,_,Q),Vt=new Set(m.definitions.map(se=>se.id)),It=U==="type"?[...m.definitions.map(se=>({id:se.id,title:Ki(m,se.id),description:se.description})),...zn.some(se=>!se.type||!Vt.has(se.type))?[{id:qw,title:"Other",description:"Assignments with no recognized type."}]:[]]:x1(p.order).map(se=>({id:se,title:Xl(p,se),description:Od(se)}));function Zt({field:se,children:Oe}){const Je=_===se;return r.jsx("th",{className:"pb-3 font-medium",children:r.jsxs("button",{type:"button",onClick:()=>vt(se),className:"inline-flex items-center gap-1 hover:text-foreground",children:[Oe,Je?Q==="asc"?r.jsx(_j,{className:"h-3 w-3"}):r.jsx(no,{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(Nn,{status:i.status}),i.statusOverride&&r.jsx("button",{type:"button",className:"shell-action border-warning-foreground/40 text-warning-foreground",onClick:()=>Ye(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:se=>{se.target.value&&Ye(se.target.value)},title:"Override project status",children:[r.jsx("option",{value:"",children:"Set Status…"}),p.statuses.map(se=>r.jsx("option",{value:se.id,children:se.label},se.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:se=>{se.target.value==="_ungrouped"?Ke(null):se.target.value&&Ke(se.target.value)},title:"Move project to a different workspace",children:[r.jsx("option",{value:"",children:"Move to Workspace…"}),h.workspaces.filter(se=>se!==i.workspace).map(se=>r.jsx("option",{value:se,children:se},se)),i.workspace&&r.jsx("option",{value:"_ungrouped",children:"Ungrouped"})]}),r.jsxs(Ee,{className:"shell-action",to:`${n}/projects/${i.slug}/edit`,children:[r.jsx(qb,{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(Kt,{className:"h-4 w-4"}),r.jsx("span",{children:"New Assignment"})]}),r.jsx(Rg,{externalIds:i.externalIds}),r.jsxs("span",{className:"text-xs text-muted-foreground",children:["Created ",gr(i.created),". Last source update ",ls(i.updated),"."]})]}),r.jsxs("div",{className:"grid gap-3 md:grid-cols-2 xl:grid-cols-5",children:[r.jsx(Sn,{label:"Assignments",value:i.progress.total}),r.jsx(Sn,{label:"In Progress",value:i.progress.in_progress??0,tone:"info"}),r.jsx(Sn,{label:"Review",value:i.progress.review??0,tone:"info"}),r.jsx(Sn,{label:"Blocked",value:i.progress.blocked??0,tone:"warn"}),r.jsx(Sn,{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(Dg,{value:C,onValueChange:j,items:[{value:"overview",label:"Overview",content:r.jsx("div",{className:"space-y-5",children:r.jsx(Be,{title:"Project Overview",children:r.jsx(nn,{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(Be,{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.jsx(Jn,{ariaLabel:"Status filter",className:"max-w-[170px]",allLabel:"All statuses",options:p.statuses.map(se=>({value:se.id,label:se.label})),value:R,onChange:yt}),r.jsx(Jn,{ariaLabel:"Assignee filter",className:"max-w-[170px]",allLabel:"All assignees",options:vn,value:P,onChange:jt}),r.jsx(Jn,{ariaLabel:"Priority filter",className:"max-w-[170px]",allLabel:"All priorities",options:[{value:"critical",label:"Critical"},{value:"high",label:"High"},{value:"medium",label:"Medium"},{value:"low",label:"Low"}],value:D,onChange:ue}),r.jsx(Jn,{ariaLabel:"Type filter",className:"max-w-[170px]",allLabel:"All types",options:m.definitions.map(se=>({value:se.id,label:Ki(m,se.id)})),value:Z,onChange:ye}),E==="kanban"&&r.jsxs("select",{value:U==="type"?"type":"status",onChange:se=>Le(se.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(_d,{value:E,onChange:se=>Tt(se),options:[{value:"kanban",label:"Kanban"},{value:"table",label:"Table"}]}),r.jsx(tN,{scope:pe,loadedViewId:ee,onApply:bt,onOpenSaveDialog:()=>{ve(!1),re(!0)}}),r.jsx("button",{type:"button",onClick:()=>{he?sn():(ve(!1),re(!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:he?`Update ${he.name}`:"Save current view",children:he?`Update '${he.name}'`:"Save view"}),he?r.jsx("button",{type:"button",onClick:()=>{ve(!0),re(!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:zn.length===0?r.jsx(ct,{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(Id,{columns:It,items:ft,getItemId:se=>se.slug,getColumnId:se=>U==="type"?se.type&&Vt.has(se.type)?se.type:qw:se.status,dragDisabled:!0,renderCard:se=>r.jsx(SF,{projectSlug:i.slug,assignment:se}),emptyMessage:se=>`No ${se.title.toLowerCase()} assignments.`,hiddenColumnIds:T.hidden,onHideColumn:se=>O(Oe=>({hidden:Oe.hidden.includes(se)?Oe.hidden.filter(Gt=>Gt!==se):[...Oe.hidden,se]}))}):(()=>{const se=new Set(q.hidden),Oe=Je=>Je==="title"||!se.has(Je);return r.jsxs("div",{className:"overflow-x-auto",children:[r.jsx("div",{className:"mb-3 flex items-center justify-end",children:r.jsx(qS,{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:[Oe("title")?r.jsx(Zt,{field:"title",children:"Assignment"}):null,Oe("status")?r.jsx(Zt,{field:"status",children:"Status"}):null,r.jsx("th",{className:"pb-3 font-medium",children:"Type"}),Oe("priority")?r.jsx(Zt,{field:"priority",children:"Priority"}):null,Oe("assignee")?r.jsx(Zt,{field:"assignee",children:"Assignee"}):null,Oe("dependencies")?r.jsx(Zt,{field:"dependencies",children:"Dependencies"}):null,Oe("updated")?r.jsx(Zt,{field:"updated",children:"Updated"}):null]})}),r.jsx("tbody",{children:ft.map(Je=>r.jsxs("tr",{className:"border-b border-border/50 last:border-0",children:[Oe("title")?r.jsx("td",{className:"py-4",children:r.jsx(Ee,{to:`${n}/projects/${i.slug}/assignments/${Je.slug}`,className:"font-semibold text-foreground hover:text-primary",children:Je.title})}):null,Oe("status")?r.jsx("td",{className:"py-4",children:r.jsx(Nn,{status:Je.status})}):null,r.jsx("td",{className:"py-4",children:r.jsx(la,{type:Je.type,compact:!0})}),Oe("priority")?r.jsx("td",{className:"py-4 capitalize text-muted-foreground",children:Je.priority}):null,Oe("assignee")?r.jsx("td",{className:"py-4 text-muted-foreground",children:Je.assignee??"—"}):null,Oe("dependencies")?r.jsx("td",{className:"py-4 text-muted-foreground",children:Je.dependsOn.length}):null,Oe("updated")?r.jsx("td",{className:"py-4 text-muted-foreground",children:gr(Je.updated)}):null]},Je.slug))})]})]})})()})})},{value:"todos",label:"Todos",content:r.jsx(dF,{projectId:i.slug})},{value:"dependencies",label:"Dependencies",content:i.dependencyGraph?r.jsx(Be,{title:"Dependency Graph",description:"Rendered from the derived graph when available, with a source-based fallback.",children:r.jsx(VL,{definition:i.dependencyGraph,nodeRoutes:xe})}):r.jsx(ct,{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(Be,{title:"Resources",description:"Shared project references.",actions:r.jsxs(Ee,{className:"shell-action",to:`/resources/new?project=${i.slug}`,children:[r.jsx(Kt,{className:"h-4 w-4"}),r.jsx("span",{children:"New Resource"})]}),children:i.resources.length===0?r.jsx(ct,{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(se=>r.jsxs(Ee,{to:`/projects/${i.slug}/resources/${se.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:se.name}),r.jsxs("p",{className:"mt-2 text-sm text-muted-foreground",children:[se.category," · ",se.source]})]},se.slug))})}),r.jsx(Be,{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(Kt,{className:"h-4 w-4"}),r.jsx("span",{children:"New Memory"})]}),children:i.memories.length===0?r.jsx(ct,{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(se=>r.jsxs(Ee,{to:`/projects/${i.slug}/memories/${se.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:se.name}),r.jsxs("p",{className:"mt-2 text-sm text-muted-foreground",children:[se.scope," · ",se.source]})]},se.slug))})})]})}]})}),r.jsxs("div",{className:"space-y-5",children:[r.jsx(Be,{title:"Progress Summary",children:r.jsx(nd,{progress:i.progress,showLegend:!0})}),r.jsx(Be,{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(Be,{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(qb,{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(Kt,{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(nT,{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(Oh,{className:"h-4 w-4"}),"Jump to dependencies"]})]})}),i.archived?r.jsxs(Be,{title:"Archive Metadata",children:[r.jsxs("p",{className:"text-sm leading-6 text-muted-foreground",children:["Archived ",i.archivedAt?ls(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(ax,{toast:Se,onDismiss:He}),r.jsx(eN,{open:F,onOpenChange:se=>{re(se),se||ve(!1)},initialName:me&&he?`${he.name} (copy)`:"",title:me?"Save as new view":"Save view",onSubmit:Qt})]})}function SF({projectSlug:e,assignment:t}){const n=Xt();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(Rr,{value:t.id})})]}),r.jsxs("p",{className:"text-sm text-muted-foreground",children:["Updated ",gr(t.updated)]})]}),r.jsx(Nn,{status:t.status})]}),r.jsxs("div",{className:"mt-4 flex flex-wrap gap-2",children:[r.jsx(la,{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 sN({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=Re("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",u=!e.resumeSupported&&!e.forkSupported;return r.jsx(Mo,{delayDuration:200,children:r.jsxs("div",{className:"inline-flex items-center gap-1",children:[u&&r.jsxs(Er,{children:[r.jsx(Tr,{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(pr,{side:"top",children:"Reopen unavailable — this agent has no resume/fork command configured"})]}),e.resumeSupported&&(e.isLive?r.jsxs(Er,{children:[r.jsx(Tr,{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(pr,{side:"top",children:"Session appears active — fork instead to avoid transcript corruption"})]}):r.jsxs(Er,{children:[r.jsx(Tr,{asChild:!0,children:r.jsxs("a",{href:n,className:l,children:[r.jsx(_i,{className:i}),r.jsx("span",{children:"Resume"})]})}),r.jsx(pr,{side:"top",children:"Continue this session in its agent (same session id, same transcript)"})]})),e.forkSupported&&r.jsxs(Er,{children:[r.jsx(Tr,{asChild:!0,children:r.jsxs("a",{href:s,className:l,children:[r.jsx(gT,{className:i}),r.jsx("span",{children:"Fork"})]})}),r.jsx(pr,{side:"top",children:"Branch a new session from this point — safe even when the original is still running"})]}),e.status==="active"&&r.jsxs(Er,{children:[r.jsx(Tr,{asChild:!0,children:r.jsxs("button",{type:"button",className:l,onClick:()=>t(e.sessionId),children:[r.jsx(zh,{className:i}),r.jsx("span",{children:"Mark stopped"})]})}),r.jsx(pr,{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 NF(e){await fetch(`/api/agent-sessions/${encodeURIComponent(e)}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({status:"stopped"})})}function oN({sessions:e,loading:t,error:n}){return t&&!e?null:n&&!e?r.jsx(Be,{title:"Agent Sessions",children:r.jsx(ct,{title:"Couldn't load sessions",description:n})}):!e||e.length===0?r.jsx(Be,{title:"Agent Sessions",children:r.jsx(ct,{title:"No agent sessions yet",description:"Sessions appear here when an agent registers one via /grab-assignment or syntaur track-session."})}):r.jsx(Be,{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(hd,{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(Rr,{value:s.sessionId})]})]}),r.jsxs("span",{className:"flex items-center gap-2",children:[r.jsx(Nn,{status:s.status}),r.jsx("span",{className:"text-xs text-muted-foreground",children:ls(s.started)})]}),r.jsx(sN,{session:s,onMarkStopped:NF})]},s.sessionId))})})}const Lm="Cost / Usage";function iN({summary:e,error:t}){return t&&!e?r.jsx(Be,{title:Lm,children:r.jsx(ct,{title:"Couldn't load usage",description:t})}):e?e.lastEventDay===null?r.jsx(Be,{title:Lm,children:r.jsx(ct,{title:"No usage recorded yet",description:"Cost and token totals appear here once the usage collector records activity for this assignment."})}):r.jsx(Be,{title:Lm,children:r.jsxs("div",{className:"space-y-3",children:[r.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[r.jsx(Yw,{label:"Total cost",value:Vu(e.totalCost)}),r.jsx(Yw,{label:"Total tokens",value:Uu(e.totalTokens)})]}),e.byModel.length>1?r.jsxs("div",{className:"space-y-1.5 border-t border-border pt-3",children:[r.jsx("p",{className:"text-xs font-medium uppercase tracking-wide text-muted-foreground",children:"By model"}),r.jsx("div",{className:"space-y-1",children:e.byModel.map(n=>r.jsxs("div",{className:"flex items-center justify-between gap-2 text-sm",children:[r.jsxs("span",{className:"flex min-w-0 items-center gap-1.5",children:[r.jsx(xd,{className:"h-3 w-3 shrink-0 text-muted-foreground"}),r.jsx("span",{className:"truncate font-mono text-xs text-foreground",title:n.model,children:n.model})]}),r.jsxs("span",{className:"shrink-0 text-xs text-muted-foreground",children:[Uu(n.totalTokens)," · ",Vu(n.totalCost)]})]},n.model))})]}):null,r.jsxs("p",{className:"text-xs text-muted-foreground",children:["Last usage recorded ",mP(e.lastEventDay)]})]})}):null}function Yw({label:e,value:t}){return r.jsxs("div",{className:"space-y-0.5",children:[r.jsx("p",{className:"text-xs font-medium uppercase tracking-wide text-muted-foreground",children:e}),r.jsx("p",{className:"text-lg font-semibold tabular-nums text-foreground",children:t})]})}function aN({open:e,action:t,assignmentTitle:n,loading:s=!1,onConfirm:i,onOpenChange:l}){const[c,u]=f.useState("");f.useEffect(()=>{e||u("")},[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(Zn,{open:e,onOpenChange:y=>s?void 0:l(y),children:r.jsx(_n,{className:"max-w-xl",children:r.jsxs("form",{className:"space-y-5",onSubmit:y=>{y.preventDefault(),i(x)},children:[r.jsxs(qr,{children:[r.jsx(Fn,{children:m}),r.jsx(fs,{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=>u(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(Ps,{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 xa({open:e,title:t,description:n,confirmLabel:s,cancelLabel:i="Cancel",loading:l=!1,destructive:c=!1,onConfirm:u,onOpenChange:p}){return r.jsx(Ku,{open:e,onOpenChange:m=>l?void 0:p(m),children:r.jsxs(Rl,{children:[r.jsxs(qu,{children:[r.jsx(Al,{children:t}),r.jsx(Dl,{children:n})]}),r.jsxs(Gu,{children:[r.jsx(Ed,{disabled:l,className:"shell-action mt-0 disabled:cursor-not-allowed disabled:opacity-50",children:i}),r.jsx(Qi,{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(),u()},children:l?"Working...":s})]})]})})}function Su(e,t){const n=`syntaur://open?${e.kind}=${encodeURIComponent(e.id)}`;return t?`${n}&terminal=${encodeURIComponent(t)}`:n}function lN({target:e,worktreePath:t=null,repository:n=null,size:s="default",title:i}){const l=e.kind==="assignment"&&!t&&!n,[c,u]=f.useState(null),[p,m]=f.useState(null),[h,x]=f.useState(!1),y=e.kind==="assignment"?"Open this assignment in your configured terminal + agent":"Resume this session in its agent",b="Set a workspace path first — see the Workspace Before Code playbook",C=Re("shell-action",s==="compact"&&"inline-flex items-center justify-center px-2 py-1 text-xs","disabled:cursor-not-allowed disabled:opacity-50");if(l)return r.jsxs("button",{type:"button",disabled:!0,title:b,className:C,"aria-disabled":!0,children:[r.jsx(_i,{className:"size-3.5"}),r.jsx("span",{children:"Open in agent"})]});async function j(){if(!h){x(!0);try{const S=await fetch("/api/launch/preflight",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({target:e})});if(!S.ok){window.location.href=Su(e);return}const E=await S.json();if(E.ok){window.location.href=Su(e);return}if(E.reason==="workspace-path-invalid"){m(E.message);return}u(E)}catch(S){console.warn("preflight failed, firing without override:",S),window.location.href=Su(e)}finally{x(!1)}}}function w(){c&&(window.location.href=Su(e,c.suggestedFallback),u(null))}return r.jsxs(r.Fragment,{children:[r.jsxs("button",{type:"button",onClick:j,disabled:h,title:i??y,className:C,children:[r.jsx(_i,{className:"size-3.5"}),r.jsx("span",{children:e.kind==="session"?"Open":"Open in agent"})]}),r.jsx(Ku,{open:c!==null,onOpenChange:S=>!S&&u(null),children:r.jsxs(Rl,{children:[r.jsxs(qu,{children:[r.jsxs(Al,{children:[c==null?void 0:c.terminal," is not installed"]}),r.jsxs(Dl,{children:["Open in ",r.jsx("strong",{children:c==null?void 0:c.suggestedFallback})," instead? You can change the default in"," ",r.jsx(Ee,{to:"/settings",className:"underline hover:text-foreground",onClick:()=>u(null),children:"Settings"}),"."]})]}),r.jsxs(Gu,{children:[r.jsx(Ed,{className:"shell-action mt-0",children:"Cancel"}),r.jsxs(Qi,{className:"shell-action mt-0 bg-foreground text-background hover:opacity-90",onClick:S=>{S.preventDefault(),w()},children:["Open in ",c==null?void 0:c.suggestedFallback]})]})]})}),r.jsx(Ku,{open:p!==null,onOpenChange:S=>!S&&m(null),children:r.jsxs(Rl,{children:[r.jsxs(qu,{children:[r.jsx(Al,{children:"Can't open in agent"}),r.jsxs(Dl,{children:[p," Set a valid worktree or repository for this assignment, then try again."]})]}),r.jsx(Gu,{children:r.jsx(Qi,{className:"shell-action mt-0 bg-foreground text-background hover:opacity-90",onClick:()=>m(null),children:"OK"})})]})})]})}function CF(e){if(!e.trim())return"Branch name is required.";if(/\s/.test(e))return"Branch name cannot contain whitespace.";if(/[\x00-\x1F\x7F~^:?*[\\]/.test(e))return"Branch name cannot contain any of: ~ ^ : ? * [ \\ or control characters.";if(e.startsWith("-"))return'Branch name cannot start with "-".';if(e.startsWith("/")||e.endsWith("/"))return'Branch name cannot start or end with "/".';if(e.endsWith("."))return'Branch name cannot end with ".".';if(e.includes(".."))return'Branch name cannot contain "..".';if(e.includes("@{"))return'Branch name cannot contain "@{".';if(e==="@")return'Branch name cannot be "@".';for(const t of e.split("/")){if(!t)return'Branch name cannot contain empty path segments (e.g. "a//b").';if(t.startsWith("."))return'Branch name segments cannot start with ".".';if(t.endsWith(".lock"))return'Branch name segments cannot end with ".lock".'}return null}async function cN(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 uN(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 EF(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 dN(e){return e.requiresReason||e.command==="block"}async function TF(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 PF(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 fN extends Error{constructor(t,n){super(t),this.stderr=n,this.name="CreateWorktreeError"}}async function pN(e){const t=await e.json().catch(()=>null);return new fN((t==null?void 0:t.error)||`HTTP ${e.status}`,t==null?void 0:t.stderr)}async function RF(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 AF(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 DF(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 pN(s);return(await s.json()).assignment}async function LF(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 pN(n);return(await n.json()).assignment}async function ef(e){const t=await e.json().catch(()=>null);if(!e.ok)throw new Error((t==null?void 0:t.error)||`HTTP ${e.status}`);return t}async function $F(e,t,n){const s=await fetch(`/api/projects/${e}/assignments/${t}/repository-branches?repo=${encodeURIComponent(n)}`);return ef(s)}async function IF(e,t){const n=await fetch(`/api/assignments/${e}/repository-branches?repo=${encodeURIComponent(t)}`);return ef(n)}async function OF(e,t){const n=await fetch(`/api/projects/${e}/assignments/${t}/source-assignments`);return(await ef(n)).sourceAssignments}async function MF(e){const t=await fetch(`/api/assignments/${e}/source-assignments`);return(await ef(t)).sourceAssignments}const $m="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 disabled:cursor-not-allowed disabled:opacity-50";function mN({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},[u,p]=f.useState(!1),[m,h]=f.useState("new-branch"),[x,y]=f.useState(null),[b,C]=f.useState(null),[j,w]=f.useState(""),[S,E]=f.useState(!1),[N,R]=f.useState(""),[I,P]=f.useState([]),[$,D]=f.useState(!1),[X,Z]=f.useState(null),[z,U]=f.useState(""),[J,_]=f.useState(null),[G,Q]=f.useState(null),[le,W]=f.useState(""),[ne,T]=f.useState(s),[O,q]=f.useState(!1),[L,ee]=f.useState(null);f.useEffect(()=>{if(!u)return;let V=!1;return h("new-branch"),y(null),C(null),w(""),E(!1),R(""),P([]),D(!1),Z(null),U(""),_(null),Q(null),W(""),T(s),ee(null),(c.kind==="project-nested"?RF(c.projectSlug):AF(c.assignmentId)).then(he=>{if(!V)if(y(he),he.length===0)E(!0);else{const Ae=he.find(Ve=>Ve.source==="project"),Te=he.find(Ve=>Ve.source==="sibling");w((Ae==null?void 0:Ae.path)??(Te==null?void 0:Te.path)??he[0].path)}}).catch(he=>{V||(C(he.message),y([]),E(!0))}),(c.kind==="project-nested"?OF(c.projectSlug,c.assignmentSlug):MF(c.assignmentId)).then(he=>{V||_(he)}).catch(he=>{V||(Q(he.message),_([]))}),()=>{V=!0}},[u,s,i,e,t,n]);const de=m==="branch-off"?(J??[]).find(V=>V.id===le)??null:null,F=m==="branch-off"?(de==null?void 0:de.repository)??"":S?N.trim():j;f.useEffect(()=>{if(!u||m!=="new-branch")return;if(!F){P([]),Z(null),D(!1),U("");return}let V=!1;return D(!0),Z(null),U(""),(c.kind==="project-nested"?$F(c.projectSlug,c.assignmentSlug,F):IF(c.assignmentId,F)).then(ae=>{if(V)return;P(ae.branches);const he=(ae.defaultBranch&&ae.branches.includes(ae.defaultBranch)?ae.defaultBranch:ae.branches.includes(i)?i:ae.branches[0])??"";U(he),D(!1)}).catch(ae=>{V||(P([]),Z(ae.message),D(!1))}),()=>{V=!0}},[u,m,F,i,e,t,n]);const re=CF(ne.trim()),me=f.useMemo(()=>!F||!ne.trim()?"":`${F.replace(/\/+$/,"")}/.worktrees/${ne.trim()}`,[F,ne]),ve=x!==null&&x.length===0,Se=J!==null&&J.length===0,fe=V=>{V!==m&&(h(V),W(""),ee(null),V==="branch-off"&&(U(""),P([]),Z(null),D(!1)))},He=V=>{W(V);const H=(J??[]).find(ae=>ae.id===V);U((H==null?void 0:H.branch)??"")},pe=O||re!==null||!F||!z.trim()||(m==="new-branch"?x===null||$:J===null||!le),Pe=async()=>{q(!0),ee(null);try{const V={repository:F,branch:ne.trim(),parentBranch:z.trim()};c.kind==="project-nested"?await DF(c.projectSlug,c.assignmentSlug,V):await LF(c.assignmentId,V),p(!1),l()}catch(V){V instanceof fN?ee({message:V.message,stderr:V.stderr}):V instanceof Error?ee({message:V.message}):ee({message:String(V)})}finally{q(!1)}};return r.jsxs(Zn,{open:u,onOpenChange:V=>O?void 0:p(V),children:[r.jsxs("button",{type:"button",className:"shell-action inline-flex items-center gap-1.5",onClick:()=>p(!0),children:[r.jsx(hT,{className:"h-3.5 w-3.5","aria-hidden":"true"}),r.jsx("span",{children:"Create worktree"})]}),r.jsxs(_n,{children:[r.jsxs(qr,{children:[r.jsx(Fn,{children:"Create worktree"}),r.jsxs(fs,{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:[r.jsxs("div",{className:"grid grid-cols-2 gap-1 rounded-md border border-border/70 p-1",children:[r.jsx("button",{type:"button",disabled:O,onClick:()=>fe("new-branch"),className:`rounded px-2 py-1.5 text-xs font-medium transition-colors disabled:cursor-not-allowed ${m==="new-branch"?"bg-foreground text-background":"text-muted-foreground hover:bg-muted"}`,children:"New branch from repo"}),r.jsx("button",{type:"button",disabled:O,onClick:()=>fe("branch-off"),className:`rounded px-2 py-1.5 text-xs font-medium transition-colors disabled:cursor-not-allowed ${m==="branch-off"?"bg-foreground text-background":"text-muted-foreground hover:bg-muted"}`,children:"Branch off another assignment"})]}),m==="new-branch"?r.jsxs(r.Fragment,{children:[ve?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,b?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: ",b]}):null,r.jsxs("label",{className:"grid gap-1",children:[r.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"Repository"}),r.jsx("select",{className:$m,value:j,onChange:V=>w(V.target.value),disabled:O||x===null||S,children:(x??[]).map(V=>r.jsxs("option",{value:V.path,children:[V.path,V.source==="project"?" (project)":V.sourceAssignmentSlug?` (sibling — ${V.sourceAssignmentSlug})`:" (sibling)"]},`${V.source}:${V.path}`))}),ve?null:r.jsx("button",{type:"button",className:"justify-self-start text-[11px] text-muted-foreground underline underline-offset-2 hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50",disabled:O,onClick:()=>E(V=>!V),children:S?"Use a listed repository":"Enter a custom repository path (advanced)"}),S?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:N,onChange:V=>R(V.target.value),disabled:O}):null]}),r.jsxs("label",{className:"grid gap-1",children:[r.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"Parent branch"}),r.jsx("select",{className:$m,value:z,onChange:V=>U(V.target.value),disabled:O||$||I.length===0,children:$?r.jsx("option",{value:"",children:"Loading branches…"}):I.length===0?r.jsx("option",{value:"",children:X?"Could not load branches":F?"No branches found":"— pick a repository —"}):I.map(V=>r.jsx("option",{value:V,children:V},V))}),X?r.jsxs("span",{className:"text-[11px] text-error-foreground",children:["Could not load branches: ",X]}):null]})]}):r.jsxs(r.Fragment,{children:[G?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 assignments: ",G]}):null,Se?r.jsx("div",{className:"rounded-md border border-warning-foreground/30 bg-warning px-3 py-2 text-xs text-warning-foreground",children:"No other assignments with a configured workspace to branch off. Create a worktree for one first, or use “New branch from repo”."}):r.jsxs("label",{className:"grid gap-1",children:[r.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"Source assignment"}),r.jsxs("select",{className:$m,value:le,onChange:V=>He(V.target.value),disabled:O||J===null,children:[r.jsx("option",{value:"",children:"— select an assignment —"}),(J??[]).map(V=>r.jsxs("option",{value:V.id,children:[V.title," (",V.branch,")"]},V.id))]})]}),de?r.jsxs("div",{className:"grid gap-2 rounded-md border border-border/70 bg-muted/40 px-3 py-2 text-xs",children:[r.jsxs("div",{className:"grid gap-0.5",children:[r.jsx("span",{className:"font-medium text-muted-foreground",children:"Repository (from source)"}),r.jsx("code",{className:"break-all",children:de.repository})]}),r.jsxs("div",{className:"grid gap-0.5",children:[r.jsx("span",{className:"font-medium text-muted-foreground",children:"Parent branch (from source)"}),r.jsx("code",{children:de.branch})]})]}):null]}),r.jsxs("label",{className:"grid gap-1",children:[r.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"New branch name"}),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:ne,onChange:V=>T(V.target.value),disabled:O}),re?r.jsx("span",{className:"text-[11px] text-error-foreground",children:re}):null]}),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 break-all",children:me||r.jsx("span",{className:"opacity-60",children:"— pick a repo & branch —"})})]}),L?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:L.message}),L.stderr?r.jsx("pre",{className:"mt-2 whitespace-pre-wrap text-[11px] opacity-90",children:L.stderr}):null]}):null]}),r.jsxs(Ps,{children:[r.jsx(_3,{disabled:O,className:"shell-action mt-0 disabled:cursor-not-allowed disabled:opacity-50",children:"Cancel"}),r.jsx("button",{type:"button",disabled:pe,onClick:()=>void Pe(),className:"shell-action mt-0 bg-foreground text-background hover:opacity-90 disabled:cursor-not-allowed disabled:opacity-50",children:O?"Working…":"Create worktree"})]})]})]})}function _F(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 FF(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 zF({projectSlug:e,dependencies:t,blockedReason:n}){const[s,i]=f.useState(!1);if(t.length===0)return null;const l=t.filter(u=>u.status!=="completed"&&u.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(Ih,{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(no,{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(Hm,{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(Be,{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(u=>r.jsxs(Ee,{to:`/projects/${e}/assignments/${u.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(Nn,{status:u.status}),r.jsxs("div",{className:"min-w-0 flex-1",children:[r.jsx("p",{className:"truncate text-sm font-medium text-foreground",children:u.title}),r.jsx("p",{className:"truncate text-xs text-muted-foreground",children:u.slug})]}),u.assignee&&r.jsx("span",{className:"hidden text-xs text-muted-foreground sm:inline",children:u.assignee}),r.jsx(Bu,{className:"h-4 w-4 shrink-0 text-muted-foreground"})]},u.slug))})})]})}function BF({links:e}){const t=Xt();if(e.length===0)return null;const n=e.filter(i=>!i.isReverse),s=e.filter(i=>i.isReverse);return r.jsx(Be,{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(Oj,{className:"h-3.5 w-3.5 shrink-0 text-muted-foreground"}),r.jsx(Nn,{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(Bu,{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(Ij,{className:"h-3.5 w-3.5 shrink-0 text-muted-foreground"}),r.jsx(Nn,{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(Bu,{className:"h-4 w-4 shrink-0 text-muted-foreground"})]},`rev-${i.slug}`))]})})}function UF(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 VF(e,t){return e===null?`/api/assignments/${encodeURIComponent(t)}/comments`:`/api/projects/${encodeURIComponent(e)}/assignments/${encodeURIComponent(t)}/comments`}function hN({projectSlug:e,assignmentSlug:t,entries:n}){const[s,i]=f.useState(n);f.useEffect(()=>{i(n)},[n]);const l=f.useMemo(()=>UF(s),[s]),[c,u]=f.useState(""),[p,m]=f.useState("note"),[h,x]=f.useState(!1),[y,b]=f.useState(null);async function C(w){var N;if(w.preventDefault(),!c.trim())return;x(!0),b(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(R=>[...R,E]);try{const R=await fetch(VF(e,t),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({body:c,type:p})});if(!R.ok){const $=await R.text();throw new Error($||`HTTP ${R.status}`)}const I=await R.json().catch(()=>null),P=(N=I==null?void 0:I.comment)==null?void 0:N.id;i($=>$.map(D=>D.id===S?{...D,id:P??D.id}:D)),u(""),window.dispatchEvent(new CustomEvent("syntaur-refresh"))}catch(R){b(R instanceof Error?R.message:String(R)),i(I=>I.filter(P=>P.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){b(E instanceof Error?E.message:String(E)),i(N=>N.map(R=>R.id===w?{...R,resolved:!S}:R))}}return r.jsx(Be,{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(gN,{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=>u(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 gN({node:e,depth:t,onToggleResolved:n}){const{entry:s,replies:i}=e,l=s.type==="question";return r.jsxs("div",{className:Re("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:Re("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:Re("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(Ih,{className:"h-3 w-3"}):r.jsx(iT,{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(CT,{className:"h-3 w-3"}),s.replyTo]}):null]}),r.jsx(nn,{content:s.body}),i.length>0?r.jsx("div",{className:"space-y-2",children:i.map(c=>r.jsx(gN,{node:c,depth:t+1,onToggleResolved:n},c.entry.id))}):null]})}const HF=["review","complete","shape","plan-ready","implement","unblock","start","block","fail","reopen"];function Jw(){var Le,Ie,We,et,_t,bt,Qt,sn,vt;const{slug:e,aslug:t}=Et(),n=Ct(),s=Xt(),[i,l]=ds(),[c,u]=f.useState(null),[p,m]=f.useState(null),[h,x]=f.useState(null),[y,b]=f.useState(null),[C,j]=f.useState(null),[w,S]=f.useState(!1),[E,N]=f.useState(!1),[R,I]=f.useState(0),P=i.get("tab")??"summary",$=Wo(),{data:D,loading:X,error:Z,refetch:z}=SP(e,t),{data:U}=p0(e),{data:J}=Kh(),{data:_,loading:G,error:Q}=CP(e,t),{data:le,loading:W,error:ne}=TP(e,t),T=f.useMemo(()=>{if(!D||!U)return[];const xe=new Map(U.assignments.map(Ye=>[Ye.slug,Ye]));return D.dependsOn.map(Ye=>{const Ke=xe.get(Ye);return{slug:Ye,title:(Ke==null?void 0:Ke.title)??Ye,status:(Ke==null?void 0:Ke.status)??"pending",priority:(Ke==null?void 0:Ke.priority)??"medium",assignee:(Ke==null?void 0:Ke.assignee)??null}})},[D,U]),O=T.filter(xe=>xe.status!=="completed"&&xe.status!=="review");fo("assignment");const q=f.useMemo(()=>((U==null?void 0:U.assignments)??[]).map(xe=>xe.slug),[U]),L=t?q.indexOf(t):-1,ee=L>0?q[L-1]:null,de=L>=0&&L<q.length-1?q[L+1]:null,F=`${s}/projects/${e}/assignments/${t}`;$t({keys:"e",scope:"assignment",description:"Edit assignment",handler:()=>n(`${F}/edit`)}),$t({keys:"p",scope:"assignment",description:"Edit plan",handler:()=>n(`${F}/plan/edit`)}),$t({keys:"h",scope:"assignment",description:"Append handoff",handler:()=>n(`${F}/handoff/edit`)}),$t({keys:"d",scope:"assignment",description:"Append decision record",handler:()=>n(`${F}/decision-record/edit`)}),$t({keys:"s",scope:"assignment",description:"Edit scratchpad",handler:()=>n(`${F}/scratchpad/edit`)}),$t({keys:"[",scope:"assignment",description:"Previous assignment in project",enabled:!!ee,handler:()=>ee&&n(`${s}/projects/${e}/assignments/${ee}`)}),$t({keys:"]",scope:"assignment",description:"Next assignment in project",enabled:!!de,handler:()=>de&&n(`${s}/projects/${e}/assignments/${de}`)});const re=f.useMemo(()=>D?_F(D.body):{acceptanceCriteria:[],summaryBody:""},[D]),me=f.useMemo(()=>FF(re.summaryBody),[re.summaryBody]),ve=re.acceptanceCriteria,Se=ve.filter(xe=>xe.checked).length,fe=ve.length>0&&Se===ve.length,He=f.useRef(fe),pe=f.useRef(!1);if(f.useEffect(()=>{if(D){if(!pe.current){He.current=fe,pe.current=!0;return}fe&&!He.current&&I(xe=>xe+1),He.current=fe}},[fe,D]),X)return r.jsx(dt,{label:"Loading assignment workspace…"});if(Z||!D||!e||!t)return r.jsx(ht,{error:Z||"Assignment not found."});const Pe=e,V=t,H=ve.length>0?{checked:Se,total:ve.length}:void 0,ae=D.availableTransitions??[],he=ae.filter(xe=>!xe.disabled&&xe.targetStatus!==D.status),Ae=HF.map(xe=>he.find(Ye=>Ye.command===xe)).find(Boolean)??he[0]??null,Te=[];if(J!=null&&J.sessions)for(const xe of J.sessions)for(const Ye of xe.windows)for(const Ke of Ye.panes)((Le=Ke.assignment)==null?void 0:Le.project)===e&&((Ie=Ke.assignment)==null?void 0:Ie.slug)===t&&Te.push({sessionName:xe.name,command:Ke.command,urls:Ke.urls});async function Ve(xe){u(null);try{await uN(Pe,V,xe),z()}catch(Ye){u(Ye.message)}}async function Ze(){N(!0);try{await EF(Pe,V),n(`${s}/projects/${Pe}`)}catch(xe){u(xe.message),N(!1),S(!1)}}async function Tt(xe,Ye){u(null),m(xe.command);try{return await cN(Pe,V,xe,Ye),z(),!0}catch(Ke){return u(Ke.message),!1}finally{m(null)}}function yt(xe){if(dN(xe)){x(xe);return}Tt(xe)}async function jt(xe,Ye){b(null),j(xe);try{const Ke=await fetch(`/api/projects/${Pe}/assignments/${V}/acceptance-criteria/${xe}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({checked:Ye})}),vn=await Ke.json();if(!Ke.ok)throw new Error(vn.error||`HTTP ${Ke.status}`);z()}catch(Ke){b(Ke.message)}finally{j(null)}}const ue=[...he.filter(xe=>xe!==Ae).map(xe=>({key:`transition-${xe.command}`,label:xe.label,onSelect:()=>yt(xe),disabled:p===xe.command})),...ae.filter(xe=>xe.disabled||xe.targetStatus===D.status).map(xe=>({key:`transition-${xe.command}`,label:xe.label,disabled:!0,disabledReason:xe.targetStatus===D.status?`Already ${D.status.replace(/_/g," ")}`:xe.disabledReason??xe.warning??xe.description})),...$.statuses.map(xe=>({key:`override-${xe.id}`,label:`Override → ${xe.label}`,onSelect:()=>Ve(xe.id),disabled:xe.id===D.status,disabledReason:xe.id===D.status?"Already in this status":void 0})),{key:"edit-assignment",label:"Edit assignment source",icon:mT,href:`${s}/projects/${e}/assignments/${t}/edit`},{key:"edit-plan",label:"Edit plan",icon:TT,href:`${s}/projects/${e}/assignments/${t}/plan/edit`},{key:"edit-scratchpad",label:"Edit scratchpad",icon:Gp,href:`${s}/projects/${e}/assignments/${t}/scratchpad/edit`},{key:"append-handoff",label:"Append handoff",icon:Bu,href:`${s}/projects/${e}/assignments/${t}/handoff/edit`},{key:"append-decision",label:"Append decision",icon:xT,href:`${s}/projects/${e}/assignments/${t}/decision-record/edit`},{key:"delete",label:"Delete assignment",icon:Mn,destructive:!0,onSelect:()=>S(!0)}],ye=(Ae==null?void 0:Ae.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(Nn,{status:D.status,progress:H}),r.jsx(la,{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 ",Zj(D.updated)]}),O.length>0&&r.jsxs("span",{className:"text-xs text-warning-foreground",children:["⚠ ",O.length," unmet dep",O.length===1?"":"s"]}),r.jsx(Rg,{externalIds:D.externalIds}),r.jsxs("span",{className:"ml-auto flex items-center gap-2",children:[r.jsx(lN,{target:{kind:"assignment",id:D.id},worktreePath:((We=D.workspace)==null?void 0:We.worktreePath)??null,repository:((et=D.workspace)==null?void 0:et.repository)??null}),!((_t=D.workspace)!=null&&_t.worktreePath)&&e&&t&&r.jsx(mN,{projectSlug:e,assignmentSlug:t,defaultBranch:`syntaur/${e}/${t}`,onCreated:()=>z()}),Ae&&r.jsx("button",{type:"button",title:Ae.warning||Ae.description,disabled:p===Ae.command,onClick:()=>yt(Ae),className:Re("shell-action disabled:cursor-not-allowed disabled:opacity-50",Ae.warning&&"border-warning-foreground/40",ye&&R>0&&"send-to-review-glow"),children:r.jsx("span",{children:p===Ae.command?"Working…":Ae.label})},ye?`review-${R}`:Ae.command),r.jsx(Sg,{items:ue,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]}),T.length>0&&r.jsx(zF,{projectSlug:e,dependencies:T,blockedReason:D.blockedReason}),D.enrichedLinks&&D.enrichedLinks.length>0&&r.jsx(BF,{links:D.enrichedLinks}),D.referencedBy&&D.referencedBy.length>0&&r.jsx(Be,{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(xe=>{const Ye=xe.sourceProjectSlug===null?`/assignments/${xe.sourceId}`:`${s}/projects/${xe.sourceProjectSlug}/assignments/${xe.sourceSlug}`;return r.jsxs("li",{className:"flex items-center gap-2 text-sm",children:[r.jsx(Ee,{to:Ye,className:"text-foreground hover:text-primary",children:xe.sourceTitle}),r.jsxs("span",{className:"text-xs text-muted-foreground",children:["(",xe.mentions," mention",xe.mentions===1?"":"s",")"]}),xe.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]},xe.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(Dg,{value:P,onValueChange:xe=>l({tab:xe}),items:[{value:"summary",label:"Summary",content:r.jsxs("div",{className:"space-y-5",children:[re.acceptanceCriteria.length>0?r.jsx(Be,{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,re.acceptanceCriteria.map((xe,Ye)=>{const Ke=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:xe.checked,disabled:Ke,onChange:vn=>jt(Ye,vn.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":xe.checked,children:xe.text})]},`${Ye}-${xe.text}`)})]})}):null,me.hasSection?r.jsx(Be,{title:"Todos",description:"Checklist of work items from assignment.md. Links point to plan files.",children:r.jsx(nn,{content:me.todosMarkdown,emptyState:"No todos yet."})}):null,r.jsx(Be,{title:"Assignment Summary",children:r.jsx(nn,{content:me.remaining,emptyState:re.acceptanceCriteria.length>0||me.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(Be,{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(Gp,{className:"h-4 w-4"}),r.jsx("span",{children:"Edit Plan"})]}),children:[r.jsx("div",{className:"mb-4",children:r.jsx(Nn,{status:D.plan.status})}),r.jsx(nn,{content:D.plan.body,emptyState:"No plan content yet."})]})}):r.jsx(ct,{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(Be,{title:"Scratchpad",actions:r.jsxs(Ee,{className:"shell-action",to:`${s}/projects/${e}/assignments/${t}/scratchpad/edit`,children:[r.jsx(Gp,{className:"h-4 w-4"}),r.jsx("span",{children:"Edit Scratchpad"})]}),children:r.jsx(nn,{content:D.scratchpad.body,emptyState:"Scratchpad is empty."})}):r.jsx(ct,{title:"No scratchpad yet",description:"Scratchpad notes appear here when you use the Edit Scratchpad action."})},{value:"handoff",label:"Handoff",count:((bt=D.handoff)==null?void 0:bt.handoffCount)??0,content:r.jsx("div",{className:"space-y-5",children:D.handoff?r.jsx(Be,{children:r.jsx(nn,{content:D.handoff.body,emptyState:"No handoff history yet."})}):r.jsx(ct,{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:((Qt=D.progress)==null?void 0:Qt.entryCount)??0,content:r.jsx("div",{className:"space-y-5",children:D.progress&&D.progress.entries.length>0?r.jsx(Be,{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((xe,Ye)=>r.jsxs("li",{className:"border-l-2 border-border pl-3",children:[r.jsx("div",{className:"text-xs font-mono text-muted-foreground",children:xe.timestamp}),r.jsx(nn,{content:xe.body})]},`${xe.timestamp}-${Ye}`))})}):r.jsx(ct,{title:"No progress entries yet",description:"Progress entries appear here as the agent appends them to progress.md."})})},{value:"comments",label:"Comments",count:((sn=D.comments)==null?void 0:sn.entryCount)??0,content:r.jsx("div",{className:"space-y-5",children:D.comments&&D.comments.entries.length>0?r.jsx(hN,{projectSlug:e,assignmentSlug:t,entries:D.comments.entries}):r.jsx(ct,{title:"No comments yet",description:"Comments appear here when agents or humans post via `syntaur comment` or the dashboard."})})},{value:"decisions",label:"Decisions",count:((vt=D.decisionRecord)==null?void 0:vt.decisionCount)??0,content:r.jsx("div",{className:"space-y-5",children:D.decisionRecord?r.jsx(Be,{children:r.jsx(nn,{content:D.decisionRecord.body,emptyState:"No decision history yet."})}):r.jsx(ct,{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(Be,{title:"Details",children:r.jsxs("dl",{className:"space-y-3 text-sm",children:[r.jsx(Xs,{label:"ID",value:D.id,copyable:!0}),r.jsx(Xs,{label:"Priority",value:D.priority}),D.assignee&&r.jsx(Xs,{label:"Assignee",value:D.assignee}),r.jsx(Xs,{label:"Updated",value:`${Qj(D.updated)} · Created ${Xj(D.created)}`}),D.workspace.repository&&r.jsx(Xs,{label:"Repository",value:D.workspace.repository,copyable:!0}),D.workspace.worktreePath&&r.jsx(Xs,{label:"Worktree",value:D.workspace.worktreePath,copyable:!0}),D.workspace.branch&&r.jsx(Xs,{label:"Branch",value:D.workspace.branch,copyable:!0}),D.workspace.parentBranch&&r.jsx(Xs,{label:"Parent branch",value:D.workspace.parentBranch,copyable:!0}),D.externalIds.map((xe,Ye)=>r.jsx(WF,{entry:xe},`${xe.system}:${xe.id}:${Ye}`))]})}),Te.length>0&&r.jsx(Be,{title:"Servers",children:r.jsx("div",{className:"space-y-2",children:Te.map((xe,Ye)=>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:xe.command}),r.jsx("span",{className:"text-xs text-muted-foreground",children:xe.sessionName}),xe.urls.map(Ke=>r.jsxs("a",{href:Ke,target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-1 text-xs text-primary hover:underline",children:[Ke.replace("http://localhost:",":"),r.jsx(sa,{className:"h-2.5 w-2.5"})]},Ke))]},Ye))})}),r.jsx(oN,{sessions:_==null?void 0:_.sessions,loading:G,error:Q}),r.jsx(iN,{summary:le==null?void 0:le.summary,loading:W,error:ne})]})]}),r.jsx(aN,{open:h!==null,action:h,assignmentTitle:D.title,loading:p===(h==null?void 0:h.command),onOpenChange:xe=>{xe||x(null)},onConfirm:async xe=>{if(!h)return;await Tt(h,xe)&&x(null)}}),r.jsx(xa,{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:xe=>{xe||S(!1)},onConfirm:Ze})]})}function Xs({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(Rr,{value:t})]})]})}function WF({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(sa,{className:"h-2.5 w-2.5 shrink-0"})]}):r.jsx("span",{className:"truncate min-w-0",title:e.id,children:e.id})})]})}function KF(){var w,S,E,N,R,I,P,$;const{id:e}=Et(),[t,n]=ds(),s=t.get("tab")??"summary",{data:i,loading:l,error:c,refetch:u}=NP(e),{data:p,loading:m,error:h}=EP(e),{data:x,loading:y,error:b}=PP(i==null?void 0:i.slug),[C,j]=f.useState(!1);return l?r.jsx(dt,{}):c?r.jsx(ht,{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(Nn,{status:i.status}),r.jsx(la,{type:i.type}),r.jsx("span",{className:"text-xs font-mono text-muted-foreground",children:i.id}),r.jsx(Rg,{externalIds:i.externalIds}),r.jsxs("div",{className:"ml-auto flex items-center gap-2",children:[r.jsx(lN,{target:{kind:"assignment",id:i.id},worktreePath:((w=i.workspace)==null?void 0:w.worktreePath)??null,repository:((S=i.workspace)==null?void 0:S.repository)??null,size:"compact"}),!((E=i.workspace)!=null&&E.worktreePath)&&r.jsx(mN,{assignmentId:i.id,defaultBranch:`syntaur/${i.slug}`,onCreated:()=>u()}),r.jsxs("button",{type:"button",onClick:()=>j(!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(Kl,{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(Be,{title:"Details",children:r.jsxs("dl",{className:"space-y-3 text-sm",children:[r.jsx(Qs,{label:"ID",value:i.id,copyable:!0}),r.jsx(Qs,{label:"Priority",value:i.priority}),i.assignee&&r.jsx(Qs,{label:"Assignee",value:i.assignee}),r.jsx(Qs,{label:"Updated",value:`${Qj(i.updated)} · Created ${Xj(i.created)}`}),i.workspace.repository&&r.jsx(Qs,{label:"Repository",value:i.workspace.repository,copyable:!0}),i.workspace.worktreePath&&r.jsx(Qs,{label:"Worktree",value:i.workspace.worktreePath,copyable:!0}),i.workspace.branch&&r.jsx(Qs,{label:"Branch",value:i.workspace.branch,copyable:!0}),i.workspace.parentBranch&&r.jsx(Qs,{label:"Parent branch",value:i.workspace.parentBranch,copyable:!0}),i.externalIds.map((D,X)=>r.jsx(qF,{entry:D},`${D.system}:${D.id}:${X}`))]})}),i.referencedBy&&i.referencedBy.length>0?r.jsx(Be,{title:"Referenced by",description:"Other assignments whose bodies link to this one.",children:r.jsx("ul",{className:"space-y-2",children:i.referencedBy.map(D=>r.jsxs("li",{className:"flex items-center gap-2 text-sm",children:[r.jsx(Ee,{to:D.sourceProjectSlug===null?`/assignments/${D.sourceId}`:`/projects/${D.sourceProjectSlug}/assignments/${D.sourceSlug}`,className:"text-foreground hover:text-primary",children:D.sourceTitle}),r.jsxs("span",{className:"text-xs text-muted-foreground",children:["(",D.mentions," mention",D.mentions===1?"":"s",")"]})]},D.sourceId))})}):null,r.jsx(oN,{sessions:p==null?void 0:p.sessions,loading:m,error:h}),r.jsx(iN,{summary:x==null?void 0:x.summary,loading:y,error:b}),r.jsx(Dg,{value:s,onValueChange:D=>n({tab:D}),items:[{value:"summary",label:"Summary",content:r.jsx("div",{className:"space-y-5",children:r.jsx(Be,{title:"Assignment",children:r.jsx(nn,{content:i.body,emptyState:"This assignment does not have summary markdown yet."})})})},{value:"progress",label:"Progress",count:((N=i.progress)==null?void 0:N.entryCount)??0,content:r.jsx("div",{className:"space-y-5",children:i.progress&&i.progress.entries.length>0?r.jsx(Be,{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((D,X)=>r.jsxs("li",{className:"border-l-2 border-border pl-3",children:[r.jsx("div",{className:"text-xs font-mono text-muted-foreground",children:D.timestamp}),r.jsx(nn,{content:D.body})]},`${D.timestamp}-${X}`))})}):r.jsx(ct,{title:"No progress entries yet",description:"Progress entries appear here as the agent appends them to progress.md."})})},{value:"comments",label:"Comments",count:((R=i.comments)==null?void 0:R.entryCount)??0,content:r.jsx("div",{className:"space-y-5",children:r.jsx(hN,{projectSlug:null,assignmentSlug:i.id,entries:((I=i.comments)==null?void 0:I.entries)??[]})})},{value:"plan",label:"Plan",content:r.jsx("div",{className:"space-y-5",children:i.plan?r.jsxs(Be,{children:[r.jsx(nn,{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(ct,{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(Be,{children:[r.jsx(nn,{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(ct,{title:"No scratchpad yet",description:"Scratchpad is scaffolded at assignment creation time."})})},{value:"handoff",label:"Handoff",count:((P=i.handoff)==null?void 0:P.handoffCount)??0,content:r.jsx("div",{className:"space-y-5",children:i.handoff?r.jsxs(Be,{children:[r.jsx(nn,{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(ct,{title:"No handoff log yet",description:"Handoffs appear here when an agent appends one."})})},{value:"decisions",label:"Decisions",count:(($=i.decisionRecord)==null?void 0:$.decisionCount)??0,content:r.jsx("div",{className:"space-y-5",children:i.decisionRecord?r.jsxs(Be,{children:[r.jsx(nn,{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(ct,{title:"No decision record yet",description:"Decision records appear here once appended."})})}]}),r.jsx(Pg,{open:C,onOpenChange:j,currentWorkspace:i.projectWorkspace,title:"Move assignment to workspace",description:"Standalone assignments belong to a project-workspace via the workspaceGroup frontmatter field.",onSubmit:async D=>{const X=await fetch(`/api/assignments/${encodeURIComponent(i.id)}/move-workspace`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({workspaceGroup:D})});if(!X.ok){const Z=await X.json().catch(()=>({}));throw new Error(Z.error||"Failed to move assignment")}u()}})]}):r.jsx(ht,{error:"Assignment not found"})}function Qs({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(Rr,{value:t})]})]})}function qF({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(sa,{className:"h-2.5 w-2.5 shrink-0"})]}):r.jsx("span",{className:"truncate min-w-0",title:e.id,children:e.id})})]})}function GF({currentStatus:e,availableTransitions:t,onSelect:n,disabled:s=!1}){const[i,l]=f.useState(!1),[c,u]=f.useState(null),[p,m]=f.useState(0),h=f.useRef(null),x=f.useRef(null),y=f.useId(),b=td(e),C=b.icon,j=f.useCallback(R=>{l(!1),R&&requestAnimationFrame(()=>{var I;(I=h.current)==null||I.focus()})},[]),w=f.useCallback(()=>{var I;const R=(I=h.current)==null?void 0:I.getBoundingClientRect();R&&u({top:R.top,left:R.left,width:R.width,bottom:R.bottom})},[]);f.useLayoutEffect(()=>{i&&w()},[i,w]),f.useEffect(()=>{if(!i)return;const R=()=>w();return window.addEventListener("scroll",R,!0),window.addEventListener("resize",R),()=>{window.removeEventListener("scroll",R,!0),window.removeEventListener("resize",R)}},[i,w]),f.useEffect(()=>{if(!i)return;const R=I=>{var $,D;const P=I.target;P&&(($=x.current)!=null&&$.contains(P)||(D=h.current)!=null&&D.contains(P)||j(!1))};return document.addEventListener("mousedown",R),()=>document.removeEventListener("mousedown",R)},[i,j]),f.useEffect(()=>{i&&m(0)},[i,t.length]);function S(R){(R.key==="Enter"||R.key===" "||R.key==="ArrowDown")&&(R.preventDefault(),l(!0))}function E(R){if(t.length===0){R.key==="Escape"&&(R.preventDefault(),j(!0));return}if(R.key==="ArrowDown")R.preventDefault(),m(I=>(I+1)%t.length);else if(R.key==="ArrowUp")R.preventDefault(),m(I=>(I-1+t.length)%t.length);else if(R.key==="Home")R.preventDefault(),m(0);else if(R.key==="End")R.preventDefault(),m(t.length-1);else if(R.key==="Enter"){R.preventDefault();const I=t[p];I&&(n(I),j(!0))}else R.key==="Escape"&&(R.preventDefault(),j(!0))}function N(R){n(R),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(R=>!R)},onKeyDown:S,title:`Status: ${b.label}. Click to change.`,className:Re(h1(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:b.label})]}),i&&c&&typeof document<"u"?Ns.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((R,I)=>{const P=td(R.targetStatus),$=P.icon,D=I===p;return r.jsxs("button",{type:"button",role:"menuitem","data-no-drag":!0,onMouseEnter:()=>m(I),onClick:()=>N(R),title:R.warning||R.description,className:Re("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:R.label})]}),r.jsx("span",{className:"text-[10px] uppercase tracking-wide text-muted-foreground",children:P.label})]}),R.warning?r.jsx("span",{className:"text-[11px] leading-snug text-warning-foreground",children:R.warning}):null]},`${R.command}:${R.targetStatus}`)})}),document.body):null]})}function YF({title:e,detailHref:t,onSave:n,disabled:s=!1}){const[i,l]=f.useState(!1);return i?r.jsx(JF,{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:Re("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(sa,{className:"h-3.5 w-3.5"})})]})}function JF({initialTitle:e,disabled:t,onSave:n,onExit:s}){const i=f.useRef(e),[l,c]=f.useState(e),[u,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 b=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){b();return}if(w===i.current){s();return}y.current=!0,p(!0);try{await n(w)}catch{}finally{p(!1),s()}},[l,s,n,b]);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||u,value:l,onChange:w=>c(w.target.value),onKeyDown:j,onBlur:()=>void C(),className:Re("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",u&&"opacity-70")})}const Xw=lg;function Qw(e){return e==="1"?"stale":e==="0"?"fresh":"all"}function XF(e,t){return e.toString()===t.toString()}function Zw(){const{workspace:e}=Et(),t=Xt(),n=Ct(),s=f.useRef(null);fo("list:assignments");const{data:i,loading:l,error:c,refetch:u}=wd(),p=Wo(),m=Fd(),[h,x]=ds(),y=e?`w:${e}`:null,b=JS(y),C=f.useRef(void 0),j=f.useMemo(()=>x1(p.order),[p]),w=f.useMemo(()=>{const M={};for(const ie of j)M[ie]=Xl(p,ie);return M},[j,p]),S=f.useMemo(()=>j.map(M=>({id:M,title:w[M]??M,description:Od(M)})),[j,w]),E=f.useMemo(()=>m.definitions.map(M=>({id:M.id,title:Ki(m,M.id),description:M.description})),[m]),N="__unknown_type__",R=f.useMemo(()=>new Set(["all",...j]),[j]),I=h.get("view"),P=h.get("status"),$=h.get("stale"),D=I&&Xw.includes(I)?I:"kanban";function X(M){if(!M)return[];const ie=[];for(const ge of M.split(",")){const be=ge.trim();!be||be==="all"||!R.has(be)||ie.includes(be)||ie.push(be)}return ie}const Z=f.useCallback(M=>{x(ie=>{const ge=new URLSearchParams(ie);return M==="kanban"?ge.delete("view"):ge.set("view",M),ge})},[x]),[z,U]=f.useState(""),[J,_]=f.useState(()=>X(P)),[G,Q]=f.useState(()=>it(b.filters.priority)),[le,W]=f.useState(()=>it(b.filters.type)),[ne,T]=f.useState(()=>it(b.filters.assignee)),[O,q]=f.useState(()=>it(b.filters.project)),[L,ee]=f.useState(()=>Qw($)),[de,F]=f.useState(()=>b.sortField),[re,me]=f.useState(()=>b.sortDirection),[ve,Se]=f.useState(()=>({hidden:[]})),[fe,He]=f.useState(()=>({hidden:[]})),[pe,Pe]=f.useState(()=>b.grouping),V=pe==="type"?"type":"status",[H,ae]=f.useState(()=>new Set),[he,Ae]=f.useState([]),{toast:Te,showToast:Ve,dismissToast:Ze}=ix(),[Tt,yt]=f.useState(null),[jt,ue]=f.useState(null),[ye,Le]=f.useState(null),[Ie,We]=f.useState(null),[et,_t]=f.useState(null),[bt,Qt]=f.useState(null),[sn,vt]=f.useState(null),[xe,Ye]=f.useState(null),[Ke,vn]=f.useState(null),[zn,ft]=f.useState(!1),[Vt,It]=f.useState(!1),Zt=e?{kind:"workspace",workspace:e}:{kind:"global"},se=h.get("loadView"),{view:Oe,loading:Je,error:Gt}=Zi(se),{view:tt,loading:pn,error:on}=Zi(Ke),an=f.useRef(null);f.useEffect(()=>{Ae((i==null?void 0:i.assignments)??[])},[i]),f.useEffect(()=>{Ke&&!pn&&!on&&!tt&&vn(null)},[tt,on,Ke,pn]),f.useEffect(()=>{vn(null),an.current=null},[e]),f.useEffect(()=>{const M=X(P);AA(M,J)||_(M);const ie=Qw($);ie!==L&&ee(ie)},[L,$,J,P]),f.useEffect(()=>{C.current===y&&x(M=>{const ie=new URLSearchParams(M);return J.length===0?ie.delete("status"):ie.set("status",J.join(",")),L==="all"?ie.delete("stale"):L==="stale"?ie.set("stale","1"):ie.set("stale","0"),XF(M,ie)?M:ie})},[L,y,x,J]),f.useEffect(()=>{Q(it(b.filters.priority)),W(it(b.filters.type)),T(it(b.filters.assignee)),q(it(b.filters.project)),F(b.sortField),me(b.sortDirection),Pe(b.grouping)},[b.filters.priority,b.filters.type,b.filters.assignee,b.filters.project,b.sortField,b.sortDirection,b.grouping]),f.useEffect(()=>{if(C.current===y)return;let M=!1;return ox().then(ie=>{if(M||C.current===y)return;const ge=Ek(ie,y),be=ge.defaultView,st=it(ge.filters.status),lt=ge.filters.activity??"all",xt=new URLSearchParams(window.location.search);let Bn=!1;const Ln=new URLSearchParams(xt);xt.get("view")===null&&be!=="kanban"&&Xw.includes(be)&&(Ln.set("view",be),Bn=!0),xt.get("status")===null&&st.length>0&&(Ln.set("status",st.join(",")),_(st),Bn=!0),xt.get("stale")===null&<!=="all"&&(Ln.set("stale",lt==="stale"?"1":"0"),ee(lt),Bn=!0),Bn&&x(Ln,{replace:!0}),queueMicrotask(()=>{C.current=y})}),()=>{M=!0}},[y]);const pt=f.useCallback(M=>{(y===null?QS(M):ZS(y,M)).catch(ge=>{console.warn("Failed to persist view prefs:",ge)})},[y]),xr=f.useCallback(M=>{Z(M),pt({defaultView:M})},[Z,pt]),wn=f.useCallback(M=>{_(M),pt({filters:{status:M}})},[pt]),nr=f.useCallback(M=>{Q(M),pt({filters:{priority:M}})},[pt]),hs=f.useCallback(M=>{W(M),pt({filters:{type:M}})},[pt]),wa=f.useCallback(M=>{T(M),pt({filters:{assignee:M}})},[pt]),ja=f.useCallback(M=>{q(M),pt({filters:{project:M}})},[pt]),Lr=f.useCallback(M=>{ee(M),pt({filters:{activity:M}})},[pt]),qo=f.useCallback(M=>{F(M),pt({sortField:M})},[pt]),mo=f.useCallback(M=>{me(M),pt({sortDirection:M})},[pt]),af=f.useCallback(M=>{Pe(M),pt({grouping:M})},[pt]),ho=f.useCallback(()=>({viewMode:D,filters:{status:J,priority:G,type:le,assignee:ne,project:O,activity:L},sortField:de,sortDirection:re,listSectionVisibility:{collapsed:[...H]},kanbanColumnVisibility:ve,tableColumnVisibility:fe}),[D,J,G,le,ne,O,L,de,re,H,ve,fe]),go=f.useCallback(M=>{nN(M,{setViewMode:Z,setStatusFilter:wn,setPriorityFilter:nr,setTypeFilter:hs,setAssigneeFilter:wa,setProjectFilter:ja,setActivityFilter:Lr,setSortField:qo,setSortDirection:mo,setListSectionVisibility:ie=>ae(new Set(ie.collapsed)),setKanbanColumnVisibility:Se,setTableColumnVisibility:He}),vn(M.id)},[Z,wn,nr,hs,wa,ja,Lr,qo,mo]),sc=f.useCallback(M=>{go(M),an.current=M.id,x(ie=>{const ge=new URLSearchParams(ie);return ge.set("loadView",M.id),ge},{replace:!0})},[go,x]),oc=f.useCallback(async M=>{try{const ie=Ul({name:M,context:{workspace:e??null,projectSlug:null},state:ho()}),ge=await fg(ie),be=ge.views[ge.views.length-1];vn((be==null?void 0:be.id)??null),be&&(an.current=be.id,x(st=>{const lt=new URLSearchParams(st);return lt.set("loadView",be.id),lt},{replace:!0})),ft(!1),It(!1),Ve(`Saved view "${M}"`,"success")}catch(ie){throw Ve(ie instanceof Error?ie.message:"Failed to save view","error"),ie}},[ho,x,Ve,e]),lf=f.useCallback(async()=>{if(Ke)try{const M=Ul({name:(tt==null?void 0:tt.name)??"",context:{workspace:e??null,projectSlug:null},state:ho()});await pg(Ke,{config:M.config}),Ve("View updated","success")}catch(M){Ve(M instanceof Error?M.message:"Failed to update view","error")}},[ho,tt==null?void 0:tt.name,Ke,Ve,e]);f.useEffect(()=>{if(!se){an.current=null;return}if(an.current!==se&&(Ke&&Ke!==se&&vn(null),!Je)){if(Gt){Ve("Couldn't load saved view — try again","error");return}if(Oe){an.current=se,go(Oe),x(M=>{const ie=new URLSearchParams(M);return ie.delete("loadView"),ie},{replace:!0});return}an.current=se,Ve("Saved view no longer exists","error"),x(M=>{const ie=new URLSearchParams(M);return ie.delete("loadView"),ie},{replace:!0})}},[se,Oe,Je,Gt,Ke,go,x,Ve]);const Gr=f.useMemo(()=>he.filter(M=>e?e==="_ungrouped"?M.projectWorkspace===null:M.projectWorkspace===e:!0),[he,e]),Ft=f.useMemo(()=>Array.from(new Set(Gr.map(M=>M.status))).sort(),[Gr]),cf=f.useMemo(()=>Array.from(new Set(Gr.map(M=>M.priority))).sort(),[Gr]),ka=f.useMemo(()=>Array.from(new Set(Gr.map(M=>M.assignee??"__unassigned__"))).sort(),[Gr]),ic=f.useMemo(()=>Array.from(new Map(Gr.filter(M=>M.projectSlug!==null).map(M=>[M.projectSlug,M.projectTitle]))).sort(([,M],[,ie])=>M.localeCompare(ie)),[Gr]),Pt=f.useMemo(()=>he.filter(M=>Ng(M,{status:J,priority:G,type:le,assignee:ne,project:O,activity:L},{workspace:e,search:z})),[L,he,z,J,G,le,ne,O,e]),xo=f.useMemo(()=>Cg(Pt,de,re),[Pt,de,re]),Go=f.useMemo(()=>{if(pe==="none")return[{id:"__all__",label:"All assignments",items:Pt}];if(pe==="type"){const M=m.definitions.map(be=>({id:be.id,label:Ki(m,be.id),items:Pt.filter(st=>st.type===be.id)})),ie=new Set(m.definitions.map(be=>be.id)),ge=Pt.filter(be=>!be.type||!ie.has(be.type));return ge.length>0&&M.push({id:N,label:"Other",items:ge}),M}if(pe==="priority")return["critical","high","medium","low"].map(ie=>({id:ie,label:ie.charAt(0).toUpperCase()+ie.slice(1),items:Pt.filter(ge=>ge.priority===ie)}));if(pe==="assignee")return Array.from(new Set(Pt.map(ie=>ie.assignee??"__unassigned__"))).sort().map(ie=>({id:ie,label:ie==="__unassigned__"?"Unassigned":ie,items:Pt.filter(ge=>(ge.assignee??"__unassigned__")===ie)}));if(pe==="project"){const M=new Map;for(const ie of Pt){const ge=ie.projectSlug??"__standalone__",be=ie.projectTitle??"Standalone";M.has(ge)||M.set(ge,be)}return Array.from(M.entries()).sort(([,ie],[,ge])=>ie.localeCompare(ge)).map(([ie,ge])=>({id:ie,label:ge,items:Pt.filter(be=>(be.projectSlug??"__standalone__")===ie)}))}return j.map(M=>({id:M,label:w[M]??M,items:Pt.filter(ie=>ie.status===M)}))},[pe,Pt,m,j,w]),Yo=f.useMemo(()=>{const M=new Set(m.definitions.map(ge=>ge.id));return Pt.some(ge=>!ge.type||!M.has(ge.type))?[...E,{id:N,title:"Other",description:"Assignments with no recognized type."}]:E},[E,m,Pt]),{visibleItems:yr,visibleIndexByKey:ac}=f.useMemo(()=>{let M;if(D==="table")M=xo;else if(D==="kanban"){const ge=new Set(m.definitions.map(be=>be.id));V==="type"?M=[...m.definitions.flatMap(be=>Pt.filter(st=>st.type===be.id)),...Pt.filter(be=>!be.type||!ge.has(be.type))]:M=j.flatMap(be=>Pt.filter(st=>st.status===be))}else M=Go.flatMap(ge=>ge.items);const ie=new Map;return M.forEach((ge,be)=>ie.set(Jt(ge),be)),{visibleItems:M,visibleIndexByKey:ie}},[D,xo,Go,V,m,Pt,j]),{hotkeyRowProps:Dn}=Gl(yr,{scope:"list:assignments",onOpen:M=>{if(M.projectSlug===null){n(`/assignments/${M.id}`);return}const ie=M.projectWorkspace?`/w/${M.projectWorkspace}`:t;n(`${ie}/projects/${M.projectSlug}/assignments/${M.slug}`)}});if($t({keys:"/",scope:"list:assignments",description:"Focus filter",handler:()=>{var M;return(M=s.current)==null?void 0:M.focus()}}),$t({keys:"r",scope:"list:assignments",description:"Refresh",handler:()=>u()}),l)return r.jsx(dt,{label:"Loading assignments board…"});if(c||!i)return r.jsx(ht,{error:c||"Assignments board is unavailable."});async function lc({item:M,toColumnId:ie,action:ge,reason:be}){yt(Jt(M));const st=he;Ae(lt=>lt.map(xt=>Jt(xt)===Jt(M)?{...xt,status:ie,blockedReason:ie==="blocked"?be??xt.blockedReason:null}:xt));try{if(M.projectSlug===null){if(!ge)throw new Error("Standalone assignments require a transition action, not status override.");const xt=await fetch(`/api/assignments/${encodeURIComponent(M.id)}/transitions/${encodeURIComponent(ge.command)}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(be?{reason:be}:{})});if(!xt.ok)throw new Error((await xt.json()).error??`HTTP ${xt.status}`);const Ln=(await xt.json()).assignment;Ae(rr=>rr.map(sr=>Jt(sr)===Jt(M)?{...sr,status:Ln.status,blockedReason:Ln.blockedReason,availableTransitions:Ln.availableTransitions,updated:Ln.updated}:sr));return}const lt=ge?await cN(M.projectSlug,M.slug,ge,be):await uN(M.projectSlug,M.slug,ie);return Ae(xt=>xt.map(Bn=>Jt(Bn)===Jt(M)?{...Bn,status:lt.status,blockedReason:lt.blockedReason,availableTransitions:lt.availableTransitions,updated:lt.updated}:Bn)),u(),!0}catch(lt){return Ae(st),Ve(lt.message,"error"),!1}finally{yt(null)}}async function Jo({item:M,toColumnId:ie,action:ge}){if(M.status===ie)return;const be=ge??fl(M,ie);if(be!=null&&be.disabled){Ve(be.disabledReason||`Cannot move this assignment to ${ie}.`,"error");return}if(be&&dN(be)){We({item:M,toColumnId:ie,action:be});return}await lc({item:M,toColumnId:ie,action:be})}async function uf(M,ie){if(ie===M.title)return;const ge=Jt(M),be=he;Ae(st=>st.map(lt=>Jt(lt)===ge?{...lt,title:ie}:lt)),yt(ge);try{const st=M.projectSlug===null?await PF({id:M.id,title:ie}):await TF({projectSlug:M.projectSlug,assignmentSlug:M.slug,title:ie});Ae(lt=>lt.map(xt=>Jt(xt)===ge?{...xt,title:st.title,updated:st.updated}:xt)),u()}catch(st){throw Ae(be),Ve(st.message,"error"),st}finally{yt(null)}}function Xo(M){ae(ie=>{const ge=new Set(ie);return ge.has(M)?ge.delete(M):ge.add(M),ge})}function Qo(M){de===M?mo(re==="asc"?"desc":"asc"):(qo(M),mo("asc"))}const mn=jt?he.find(M=>Jt(M)===jt)??null:null;function Zo(M,ie){M.dataTransfer.effectAllowed="move",M.dataTransfer.setData("text/plain",ie),ue(ie)}function Sa(){ue(null),Le(null)}function df(M,ie){if(!mn)return;const ge=fl(mn,ie);mn.status===ie||ge!=null&&ge.disabled||(M.preventDefault(),M.dataTransfer.dropEffect="move",Le(ie))}function Na(M,ie){ye===ie&&!M.currentTarget.contains(M.relatedTarget)&&Le(null)}function cc(M,ie){if(M.preventDefault(),!mn||mn.status===ie){Sa();return}Sa(),Jo({item:mn,toColumnId:ie})}function Yr({field:M,children:ie}){const ge=de===M;return r.jsx("th",{className:"pb-3 font-medium",children:r.jsxs("button",{type:"button",onClick:()=>Qo(M),className:"inline-flex items-center gap-1 hover:text-foreground",children:[ie,ge?re==="asc"?r.jsx(_j,{className:"h-3 w-3"}):r.jsx(no,{className:"h-3 w-3"}):null]})})}return r.jsxs("div",{className:"space-y-5","data-density":b.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(Kt,{className:"h-4 w-4"}),"New Assignment"]})}),r.jsxs(Eg,{children:[r.jsx(Md,{ref:s,value:z,onChange:U,placeholder:"Search assignments or projects"}),r.jsx(Jn,{ariaLabel:"Status filter",className:"max-w-[180px]",allLabel:"All statuses",options:Ft.map(M=>({value:M,label:w[M]??M})),value:J,onChange:wn}),r.jsx(Jn,{ariaLabel:"Priority filter",className:"max-w-[180px]",allLabel:"All priorities",options:cf.map(M=>({value:M,label:M[0].toUpperCase()+M.slice(1)})),value:G,onChange:nr}),r.jsx(Jn,{ariaLabel:"Type filter",className:"max-w-[180px]",allLabel:"All types",options:m.definitions.map(M=>({value:M.id,label:Ki(m,M.id)})),value:le,onChange:hs}),r.jsx(Jn,{ariaLabel:"Assignee filter",className:"max-w-[180px]",allLabel:"All assignees",options:[{value:"__unassigned__",label:"Unassigned"},...ka.filter(M=>M!=="__unassigned__").map(M=>({value:M,label:M}))],value:ne,onChange:wa}),r.jsx(Jn,{ariaLabel:"Project filter",className:"max-w-[180px]",allLabel:"All projects",options:[{value:"__standalone__",label:"Standalone"},...ic.map(([M,ie])=>({value:M,label:ie}))],value:O,onChange:ja}),r.jsxs("select",{value:L,onChange:M=>Lr(M.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"?V:pe,onChange:M=>af(M.target.value),className:"editor-input max-w-[180px]",title:"Group by",children:RA.map(M=>{const ie=D==="kanban"&&M!=="status"&&M!=="type",ge=M==="none"?"No grouping":`Group: ${M.charAt(0).toUpperCase()+M.slice(1)}`;return r.jsx("option",{value:M,disabled:ie,children:ie?`${ge} (list only)`:ge},M)})}),r.jsx(_d,{value:D,onChange:M=>xr(M),options:[{value:"table",label:"Table"},{value:"list",label:"List"},{value:"kanban",label:"Kanban"}]}),D==="table"?r.jsx(qS,{visibility:fe,onChange:He}):null,r.jsx(tN,{scope:Zt,loadedViewId:Ke,onApply:sc,onOpenSaveDialog:()=>{It(!1),ft(!0)}}),r.jsx("button",{type:"button",onClick:()=>{tt?lf():(It(!1),ft(!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:tt?`Update ${tt.name}`:"Save current view",children:tt?`Update '${tt.name}'`:"Save view"}),tt?r.jsx("button",{type:"button",onClick:()=>{It(!0),ft(!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(ct,{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(Bj,{className:"h-4 w-4"}),r.jsx("span",{children:"Browse Projects"})]})}):Pt.length===0?r.jsx(ct,{title:"No assignments match these filters",description:"Adjust the search term or filters to show assignments across all projects again."}):D==="table"?(()=>{const M=new Set(fe.hidden),ie=ge=>ge==="title"||!M.has(ge);return r.jsx(Be,{title:`${xo.length} assignment${xo.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:[ie("title")?r.jsx(Yr,{field:"title",children:"Assignment"}):null,ie("status")?r.jsx(Yr,{field:"status",children:"Status"}):null,r.jsx("th",{className:"py-2 pr-4 text-xs font-medium uppercase tracking-wider",children:"Type"}),ie("priority")?r.jsx(Yr,{field:"priority",children:"Priority"}):null,ie("assignee")?r.jsx(Yr,{field:"assignee",children:"Assignee"}):null,ie("dependencies")?r.jsx(Yr,{field:"dependencies",children:"Dependencies"}):null,ie("updated")?r.jsx(Yr,{field:"updated",children:"Updated"}):null]})}),r.jsx("tbody",{children:xo.map((ge,be)=>r.jsxs("tr",{className:"border-b border-border/50 last:border-0",...Dn(be),children:[ie("title")?r.jsxs("td",{className:"py-4 pr-4",children:[r.jsx(Ee,{to:ge.projectSlug===null?`/assignments/${ge.id}`:`${t}/projects/${ge.projectSlug}/assignments/${ge.slug}`,className:"font-semibold text-foreground hover:text-primary",children:ge.title}),r.jsx("p",{className:"mt-1 text-xs text-muted-foreground",children:ge.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:ge.id,children:[ge.id.slice(0,8),r.jsx(Rr,{value:ge.id})]})]}):null,ie("status")?r.jsx("td",{className:"py-4 pr-4",children:r.jsx("select",{value:ge.status,disabled:Tt===Jt(ge),onChange:st=>Jo({item:ge,toColumnId:st.target.value}),className:Re("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")]`,(ed[ge.status]??ed.pending).className,Tt===Jt(ge)&&"animate-pulse opacity-60"),children:j.map(st=>{const lt=ge.status===st?void 0:fl(ge,st),xt=(lt==null?void 0:lt.disabled)??!1;return r.jsx("option",{value:st,disabled:xt,title:xt?(lt==null?void 0:lt.disabledReason)??void 0:void 0,children:w[st]},st)})})}):null,r.jsx("td",{className:"py-4 pr-4",children:r.jsx(la,{type:ge.type,compact:!0})}),ie("priority")?r.jsx("td",{className:"py-4 pr-4 capitalize text-muted-foreground",children:ge.priority}):null,ie("assignee")?r.jsx("td",{className:"py-4 pr-4 text-muted-foreground",children:ge.assignee??"Unassigned"}):null,ie("dependencies")?r.jsx("td",{className:"py-4 pr-4 text-muted-foreground",children:ge.dependsOn.length}):null,ie("updated")?r.jsx("td",{className:"py-4 text-muted-foreground",children:gr(ge.updated)}):null]},Jt(ge)))})]})})})})():D==="list"?r.jsx("div",{className:"space-y-3",children:Go.map(({id:M,label:ie,items:ge})=>{var Ln;if(ge.length===0&&!(mn&&pe==="status"))return null;const be=!H.has(M),st=pe==="status",lt=st&&mn?mn.status!==M&&!((Ln=fl(mn,M))!=null&&Ln.disabled):!1,xt=st&&mn?mn.status!==M&&!lt:!1,Bn=st&&ye===M;return r.jsxs("div",{className:Re("rounded-lg border border-border/60 bg-card/90 transition",Bn&<&&"ring-2 ring-ring/30",xt&&"border-dashed opacity-65"),onDragOver:st?rr=>df(rr,M):void 0,onDragLeave:st?rr=>Na(rr,M):void 0,onDrop:st?rr=>cc(rr,M):void 0,children:[r.jsxs("button",{type:"button",onClick:()=>Xo(M),className:"flex w-full items-center gap-2 px-4 py-3 text-left",children:[r.jsx(no,{className:`h-4 w-4 text-muted-foreground transition-transform ${be?"":"-rotate-90"}`}),r.jsx("span",{className:"font-semibold text-foreground",children:ie}),r.jsx("span",{className:"rounded-full border border-border/60 px-2 py-0.5 text-xs text-muted-foreground",children:ge.length})]}),be&&ge.length>0&&r.jsx("div",{className:"space-y-3 px-4 pb-4",children:ge.map(rr=>{const sr=Jt(rr),yo=jt===sr,$r=ac.get(sr)??-1,or=st;return r.jsx("div",{draggable:or,onDragStart:or?Jr=>Zo(Jr,sr):void 0,onDragEnd:or?Sa:void 0,...$r>=0?Dn($r):{},className:Re("transition",or&&"cursor-grab active:cursor-grabbing",yo&&"scale-[0.98] opacity-50"),children:r.jsx(ej,{assignment:rr,dragging:yo,transitioning:Tt===sr})},sr)})})]},M)})}):r.jsx(Id,{columns:V==="type"?Yo:S,items:Pt,getItemId:Jt,getColumnId:M=>V==="type"?M.type&&m.definitions.some(ie=>ie.id===M.type)?M.type:N:M.status,canDrop:({item:M,fromColumnId:ie,toColumnId:ge})=>{if(ie===ge)return{allowed:!0};const be=fl(M,ge);return be!=null&&be.disabled?{allowed:!1,reason:be.disabledReason||be.description}:{allowed:!0,reason:be?be.warning||be.description:`Move to ${ge} (direct status change).`}},onMove:V==="type"?void 0:({item:M,toColumnId:ie})=>Jo({item:M,toColumnId:ie}),dragDisabled:V==="type",getExternalDragData:M=>M.projectSlug===null?{type:"standalone-assignment",id:M.id}:{type:"project-assignment",id:M.id},onCardContextMenu:(M,ie)=>{ie.preventDefault(),_t({item:M,anchor:{x:ie.clientX,y:ie.clientY}})},emptyMessage:M=>`No ${M.title.toLowerCase()} assignments.`,hiddenColumnIds:ve.hidden,onHideColumn:M=>Se(ie=>({hidden:ie.hidden.includes(M)?ie.hidden.filter(be=>be!==M):[...ie.hidden,M]})),renderCard:(M,{dragging:ie})=>{const ge=ac.get(Jt(M))??-1;return r.jsx("div",{...ge>=0?Dn(ge):{},children:r.jsx(ej,{assignment:M,dragging:ie,transitioning:Tt===Jt(M),onPillSelect:be=>void Jo({item:M,toColumnId:be.targetStatus,action:be}),onRenameTitle:be=>uf(M,be)})})}}),r.jsx(ax,{toast:Te,onDismiss:Ze}),r.jsx(eN,{open:zn,onOpenChange:M=>{ft(M),M||It(!1)},initialName:Vt&&tt?`${tt.name} (copy)`:"",title:Vt?"Save as new view":"Save view",onSubmit:oc}),r.jsx(aN,{open:Ie!==null,action:(Ie==null?void 0:Ie.action)??null,assignmentTitle:(Ie==null?void 0:Ie.item.title)??"Assignment",loading:Tt===(Ie?Jt(Ie.item):null),onOpenChange:M=>{M||We(null)},onConfirm:async M=>{if(!Ie)return;const ie=Ie;await lc({item:ie.item,toColumnId:ie.toColumnId,action:ie.action,reason:M})&&We(null)}}),r.jsx(y1,{anchor:(et==null?void 0:et.anchor)??null,items:et?QF(et.item,{onEdit:()=>{const M=et.item,ie=M.projectSlug===null?`/assignments/${M.id}`:`${M.projectWorkspace?`/w/${M.projectWorkspace}`:t}/projects/${M.projectSlug}/assignments/${M.slug}`;n(ie)},onDelete:()=>Qt(et.item),onMove:()=>Ye(et.item)}):[],onClose:()=>_t(null)}),r.jsx(xa,{open:bt!==null,title:"Delete assignment?",description:bt?`"${bt.title}" will be permanently removed. This cannot be undone.`:"",confirmLabel:"Delete",destructive:!0,loading:sn!==null,onOpenChange:M=>{!M&&sn===null&&Qt(null)},onConfirm:async()=>{if(!bt||bt.projectSlug===null){Qt(null);return}const M=Jt(bt);vt(M);try{const ie=await fetch(`/api/projects/${encodeURIComponent(bt.projectSlug)}/assignments/${encodeURIComponent(bt.slug)}`,{method:"DELETE"});if(!ie.ok){const ge=await ie.json().catch(()=>({}));throw new Error(ge.error||"Failed to delete assignment")}Qt(null),u()}catch(ie){alert(ie instanceof Error?ie.message:"Failed to delete assignment")}finally{vt(null)}}}),r.jsx(Pg,{open:xe!==null,onOpenChange:M=>{M||Ye(null)},currentWorkspace:(xe==null?void 0:xe.projectWorkspace)??null,title:"Move assignment to workspace",description:"Standalone assignments belong to a project-workspace via the workspaceGroup frontmatter field.",onSubmit:async M=>{if(!xe)return;const ie=await fetch(`/api/assignments/${encodeURIComponent(xe.id)}/move-workspace`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({workspaceGroup:M})});if(!ie.ok){const ge=await ie.json().catch(()=>({}));throw new Error(ge.error||"Failed to move assignment")}u()}})]})}function QF(e,t){const n=[{key:"edit",label:"Edit",icon:Bo,onSelect:t.onEdit}];return e.projectSlug!==null?n.push({key:"delete",label:"Delete",icon:Mn,destructive:!0,onSelect:t.onDelete}):n.push({key:"move",label:"Move to workspace…",icon:Kl,onSelect:t.onMove}),n}function ej({assignment:e,dragging:t,transitioning:n,onPillSelect:s,onRenameTitle:i}){var y;const l=Ct(),c=f.useRef(null),u=f.useRef(!1),p=p1(e),m=!!(s&&i),h=()=>{const b=c.current,C=!!(b!=null&&b.querySelector('[aria-expanded="true"]')),j=!!document.querySelector('[role="menu"]'),w=document.activeElement,S=!!(w&&(b!=null&&b.contains(w))&&(w.tagName==="INPUT"||w.tagName==="TEXTAREA"));u.current=C||j||S},x=b=>{if(u.current)return;const C=b.target;!C||C.closest(ih)||l(p)};return r.jsxs("div",{ref:c,className:Re("vp-card rounded-lg border border-border/60 bg-background/85 p-3 shadow-sm",m&&"cursor-pointer"),onMouseDown:m?h:void 0,onClick:m?x:void 0,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:[m?r.jsx(YF,{title:e.title,detailHref:p,onSave:i,disabled:n}):r.jsx(Ee,{to:p,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:[(y=e.id)==null?void 0:y.slice(0,8),e.id&&r.jsx(Rr,{value:e.id})]})]}),m?r.jsx(GF,{currentStatus:e.status,availableTransitions:e.availableTransitions,onSelect:s,disabled:n}):r.jsx(Nn,{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(la,{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:gr(e.updated)})]})]})}function fl(e,t){return e.availableTransitions.find(n=>n.targetStatus===t)}function Jt(e){return e.id||e.slug||"unknown"}function Dr(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 u=null,p=[];const m=()=>{u&&(l.push(u),c.set(u,p))};for(const h of i){const x=h.match(/^([A-Za-z_][A-Za-z0-9_-]*):/);if(x&&!h.startsWith(" ")){m(),u=x[1],p=[h];continue}u&&p.push(h)}return m(),{order:l,blocks:c,body:s}}function ya(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 dn(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 ZF(e,t){return dn(e,t)==="true"}function Nl(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 e6(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 fn(e,t,n){e.blocks.has(t)||e.order.push(t),e.blocks.set(t,[`${t}: ${e6(n)}`])}function Cl(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 El(e){return e.split(",").map(t=>t.trim()).filter(Boolean)}function tf(e){const t=Dr(e);return{title:dn(t,"title"),slug:dn(t,"slug"),workspace:dn(t,"workspace"),archived:ZF(t,"archived"),archivedAt:dn(t,"archivedAt"),archivedReason:dn(t,"archivedReason"),tags:Nl(t,"tags").join(", "),body:t.body}}function t6(e,t){const n=Dr(e),s={...tf(e),...t};return fn(n,"title",s.title),fn(n,"slug",s.slug),fn(n,"workspace",s.workspace||null),fn(n,"archived",s.archived),fn(n,"archivedAt",s.archivedAt||null),fn(n,"archivedReason",s.archivedReason||null),Cl(n,"tags",El(s.tags)),n.body=s.body,ya(n)}function nf(e){const t=Dr(e);return{title:dn(t,"title"),slug:dn(t,"slug"),status:dn(t,"status"),priority:dn(t,"priority")||"medium",assignee:dn(t,"assignee"),dependsOn:Nl(t,"dependsOn").join(", "),links:Nl(t,"links").join(", "),blockedReason:dn(t,"blockedReason"),tags:Nl(t,"tags").join(", "),body:t.body}}function n6(e,t){const n=Dr(e),s={...nf(e),...t};return fn(n,"title",s.title),fn(n,"slug",s.slug),fn(n,"status",s.status),fn(n,"priority",s.priority),fn(n,"assignee",s.assignee||null),Cl(n,"dependsOn",El(s.dependsOn)),Cl(n,"links",El(s.links)),fn(n,"blockedReason",s.blockedReason||null),Cl(n,"tags",El(s.tags)),n.body=s.body,ya(n)}function rf(e){const t=Dr(e);return{assignment:dn(t,"assignment"),status:dn(t,"status"),body:t.body}}function r6(e,t){const n=Dr(e),s={...rf(e),...t};return fn(n,"assignment",s.assignment),fn(n,"status",s.status),n.body=s.body,ya(n)}function sf(e){const t=Dr(e);return{assignment:dn(t,"assignment"),body:t.body}}function s6(e,t){const n=Dr(e),s={...sf(e),...t};return fn(n,"assignment",s.assignment),n.body=s.body,ya(n)}function of(e){const t=Dr(e);return{name:dn(t,"name"),slug:dn(t,"slug"),description:dn(t,"description"),whenToUse:dn(t,"when_to_use"),tags:Nl(t,"tags").join(", "),body:t.body}}function o6(e,t){const n=Dr(e),s={...of(e),...t};return fn(n,"name",s.name),fn(n,"slug",s.slug),fn(n,"description",s.description||null),fn(n,"when_to_use",s.whenToUse||null),Cl(n,"tags",El(s.tags)),n.body=s.body,ya(n)}function lx(e){return{body:Dr(e).body}}function xN(e){return lx(e)}function yN(e,t){const n=Dr(e);return t.body!==void 0&&(n.body=t.body),ya(n)}function i6(e,t){return yN(e,t)}function Lt(e,t,n){switch(e){case"project":return t6(t,n);case"assignment":return n6(t,n);case"plan":return r6(t,n);case"scratchpad":return s6(t,n);case"playbook":return o6(t,n);case"memory":return yN(t,n);case"resource":return i6(t,n);default:return t}}function ba({initialContent:e,documentType:t,mode:n="edit",onSave:s,saving:i,error:l,title:c,description:u,onCancel:p,helpTitle:m,helpBody:h,allowSlugEdit:x=!1}){const[y,b]=f.useState(e),[C,j]=f.useState(!1),[w,S]=f.useState("edit");f.useEffect(()=>{b(e)},[e]);const E=u6(t,y),N=y!==e,R=c6(t,y),I=N?"Unsaved changes":n==="create"?"Draft":"Saved",P=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})]}),u?r.jsx("p",{className:"max-w-3xl text-sm leading-6 text-muted-foreground",children:u}):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(Ij,{className:"h-4 w-4"}),r.jsx("span",{children:"Back"})]}),P?r.jsxs("button",{type:"button",onClick:()=>j($=>!$),className:"shell-action",children:[r.jsx(pT,{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(bd,{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(Kb,{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:$=>b($.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(a6,{documentType:t,content:y,onChange:b,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(Kb,{className:"h-4 w-4 text-muted-foreground"}),r.jsx("h2",{className:"text-lg font-semibold text-foreground",children:"Preview"})]}),r.jsx(nn,{content:R,emptyState:"Write markdown body content to preview it here."})]})})]})]})}function a6({documentType:e,content:t,onChange:n,allowSlugEdit:s}){if(e==="project"){const l=tf(t);return r.jsxs("div",{className:"space-y-3",children:[r.jsxs(pl,{children:[r.jsx(wt,{label:"Project title",children:r.jsx("input",{value:l.title,onChange:c=>{const u=c.target.value,p={title:u};s&&(l.slug===dr(l.title)||!l.slug.trim())&&(p.slug=dr(u)),n(Lt(e,t,p))},className:"editor-input"})}),r.jsx(wt,{label:"Slug",children:r.jsxs("div",{className:"space-y-2",children:[r.jsx("input",{value:l.slug,disabled:!s,onChange:c=>n(Lt(e,t,{slug:dr(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(wt,{label:"Tags",children:r.jsx("input",{value:l.tags,onChange:c=>n(Lt(e,t,{tags:c.target.value})),placeholder:"Comma-separated tags",className:"editor-input"})}),r.jsx(l6,{value:l.workspace,onChange:c=>n(Lt(e,t,{workspace:c}))})]}),r.jsx(wt,{label:"Project body",children:r.jsx("textarea",{value:l.body,onChange:c=>n(Lt(e,t,{body:c.target.value})),className:"editor-textarea",spellCheck:!1})})]})}if(e==="assignment"){const l=nf(t);return r.jsxs("div",{className:"space-y-3",children:[r.jsxs(pl,{children:[r.jsx(wt,{label:"Assignment title",children:r.jsx("input",{value:l.title,onChange:c=>{const u=c.target.value,p={title:u};s&&(l.slug===dr(l.title)||!l.slug.trim())&&(p.slug=dr(u)),n(Lt(e,t,p))},className:"editor-input"})}),r.jsx(wt,{label:"Slug",children:r.jsxs("div",{className:"space-y-2",children:[r.jsx("input",{value:l.slug,disabled:!s,onChange:c=>n(Lt(e,t,{slug:dr(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(wt,{label:"Status",children:r.jsxs("select",{value:l.status,onChange:c=>n(Lt(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(wt,{label:"Priority",children:r.jsxs("select",{value:l.priority,onChange:c=>n(Lt(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(wt,{label:"Assignee",children:r.jsx("input",{value:l.assignee,onChange:c=>n(Lt(e,t,{assignee:c.target.value})),placeholder:"Agent name",className:"editor-input"})}),r.jsx(wt,{label:"Depends on",className:"md:col-span-2",children:r.jsx("input",{value:l.dependsOn,onChange:c=>n(Lt(e,t,{dependsOn:c.target.value})),placeholder:"Comma-separated assignment slugs",className:"editor-input"})}),r.jsx(wt,{label:"Links",className:"md:col-span-2",children:r.jsx("input",{value:l.links,onChange:c=>n(Lt(e,t,{links:c.target.value})),placeholder:"Comma-separated: projectSlug/assignmentSlug",className:"editor-input"})}),r.jsx(wt,{label:"Blocked reason",className:"md:col-span-2",children:r.jsx("input",{value:l.blockedReason,onChange:c=>n(Lt(e,t,{blockedReason:c.target.value})),placeholder:"Read-only unless the assignment is actually blocked",className:"editor-input"})}),r.jsx(wt,{label:"Tags",className:"md:col-span-2",children:r.jsx("input",{value:l.tags,onChange:c=>n(Lt(e,t,{tags:c.target.value})),placeholder:"Comma-separated tags",className:"editor-input"})})]}),r.jsx(wt,{label:"Assignment body",children:r.jsx("textarea",{value:l.body,onChange:c=>n(Lt(e,t,{body:c.target.value})),className:"editor-textarea",spellCheck:!1})})]})}if(e==="plan"){const l=rf(t);return r.jsxs("div",{className:"space-y-3",children:[r.jsxs(pl,{children:[r.jsx(wt,{label:"Assignment",children:r.jsx("input",{value:l.assignment,disabled:!0,className:"editor-input editor-input-disabled"})}),r.jsx(wt,{label:"Plan status",children:r.jsxs("select",{value:l.status,onChange:c=>n(Lt(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(wt,{label:"Plan body",children:r.jsx("textarea",{value:l.body,onChange:c=>n(Lt(e,t,{body:c.target.value})),className:"editor-textarea",spellCheck:!1})})]})}if(e==="scratchpad"){const l=sf(t);return r.jsxs("div",{className:"space-y-3",children:[r.jsx(pl,{children:r.jsx(wt,{label:"Assignment",children:r.jsx("input",{value:l.assignment,disabled:!0,className:"editor-input editor-input-disabled"})})}),r.jsx(wt,{label:"Scratchpad body",children:r.jsx("textarea",{value:l.body,onChange:c=>n(Lt(e,t,{body:c.target.value})),className:"editor-textarea",spellCheck:!1})})]})}if(e==="memory"||e==="resource"){const l=e==="memory"?lx(t):xN(t),c=e==="memory"?"Memory body":"Resource body";return r.jsxs("div",{className:"space-y-3",children:[r.jsx(wt,{label:c,children:r.jsx("textarea",{value:l.body,onChange:u=>n(Lt(e,t,{body:u.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=of(t);return r.jsxs("div",{className:"space-y-3",children:[r.jsxs(pl,{children:[r.jsx(wt,{label:"Playbook name",children:r.jsx("input",{value:i.name,onChange:l=>{const c=l.target.value,u={name:c};s&&(i.slug===dr(i.name)||!i.slug.trim())&&(u.slug=dr(c)),n(Lt(e,t,u))},className:"editor-input"})}),r.jsx(wt,{label:"Slug",children:r.jsxs("div",{className:"space-y-2",children:[r.jsx("input",{value:i.slug,disabled:!s,onChange:l=>n(Lt(e,t,{slug:dr(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(wt,{label:"Description",className:"md:col-span-2",children:r.jsx("input",{value:i.description,onChange:l=>n(Lt(e,t,{description:l.target.value})),placeholder:"One-line description of what this playbook does",className:"editor-input"})}),r.jsx(wt,{label:"Tags",className:"md:col-span-2",children:r.jsx("input",{value:i.tags,onChange:l=>n(Lt(e,t,{tags:l.target.value})),placeholder:"Comma-separated tags",className:"editor-input"})}),r.jsx(wt,{label:"When to use",className:"md:col-span-2",children:r.jsx("input",{value:i.whenToUse,onChange:l=>n(Lt(e,t,{whenToUse:l.target.value})),placeholder:"Describe when agents should apply this playbook",className:"editor-input"})})]}),r.jsx(wt,{label:"Playbook rules",children:r.jsx("textarea",{value:i.body,onChange:l=>n(Lt(e,t,{body:l.target.value})),className:"editor-textarea",spellCheck:!1})})]})}function pl({children:e}){return r.jsx("div",{className:"grid gap-4 md:grid-cols-2",children:e})}function wt({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 l6({value:e,onChange:t}){const{data:n}=vd(),s=(n==null?void 0:n.workspaces)??[];return r.jsx(wt,{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 c6(e,t){switch(e){case"project":return tf(t).body;case"assignment":return nf(t).body;case"plan":return rf(t).body;case"scratchpad":return sf(t).body;case"playbook":return of(t).body;case"memory":return lx(t).body;case"resource":return xN(t).body}}function u6(e,t){switch(e){case"project":{const n=tf(t);return[n.title.trim()?null:"Project title is required.",n.slug.trim()?null:"Project slug is required.",n.slug.trim()&&!Du(n.slug)?"Project slug must be lowercase letters, numbers, and hyphens only.":null].filter(s=>!!s)}case"assignment":{const n=nf(t);return[n.title.trim()?null:"Assignment title is required.",n.slug.trim()?null:"Assignment slug is required.",n.slug.trim()&&!Du(n.slug)?"Assignment slug must be lowercase letters, numbers, and hyphens only.":null].filter(s=>!!s)}case"plan":return rf(t).assignment.trim()?[]:["Plan assignment is required."];case"scratchpad":return sf(t).assignment.trim()?[]:["Scratchpad assignment is required."];case"playbook":{const n=of(t);return[n.name.trim()?null:"Playbook name is required.",n.slug.trim()?null:"Playbook slug is required.",n.slug.trim()&&!Du(n.slug)?"Playbook slug must be lowercase letters, numbers, and hyphens only.":null].filter(s=>!!s)}case"memory":case"resource":return[]}}function tj(){const e=Ct(),{workspace:t}=Et(),n=Xt(),[s,i]=f.useState(null),[l,c]=f.useState(!0),[u,p]=f.useState(!1),[m,h]=f.useState(null);f.useEffect(()=>{fetch("/api/templates/project").then(y=>y.json()).then(y=>{let b=y.content;t&&t!=="_ungrouped"&&(b=b.replace(/^(tags: \[\])$/m,`$1
|
|
535
|
+
workspace: ${t}`)),i(b),c(!1)}).catch(y=>{h(y.message),c(!1)})},[t]);async function x(y){p(!0),h(null);try{const b=await fetch("/api/projects",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({content:y})}),C=await b.json();if(!b.ok){h(C.error||`HTTP ${b.status}`),p(!1);return}e(`${n}/projects/${C.slug}`)}catch(b){h(b.message),p(!1);return}p(!1)}return l?r.jsx(dt,{label:"Loading project template…"}):m&&!s?r.jsx(ht,{error:m}):r.jsx(ba,{initialContent:s||"",documentType:"project",mode:"create",onSave:x,saving:u,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 nj(){const{slug:e}=Et(),t=Xt(),n=Ct(),[s,i]=f.useState(null),[l,c]=f.useState(!0),[u,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 b=await fetch(`/api/projects/${e}/assignments`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({content:y})}),C=await b.json();if(!b.ok){h(C.error||`HTTP ${b.status}`),p(!1);return}n(`${t}/projects/${e}/assignments/${C.slug}`)}catch(b){h(b.message),p(!1);return}p(!1)}return l?r.jsx(dt,{label:"Loading assignment template…"}):m&&!s?r.jsx(ht,{error:m}):r.jsx(ba,{initialContent:s||"",documentType:"assignment",mode:"create",onSave:x,saving:u,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 rj(){const{workspace:e}=Et(),t=Xt(),n=Ct(),[s,i]=f.useState(null),[l,c]=f.useState(!0),[u,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(b=>b.json()).then(b=>{i(b.content),c(!1)}).catch(b=>{h(b.message),c(!1)})},[e]);async function x(y){var b;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=(b=j==null?void 0:j.assignment)==null?void 0:b.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(dt,{label:"Loading assignment template…"}):m&&!s?r.jsx(ht,{error:m}):r.jsx(ba,{initialContent:s||"",documentType:"assignment",mode:"create",onSave:x,saving:u,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 va({loadUrl:e,saveUrl:t,redirectTo:n,title:s,description:i,documentType:l,helpTitle:c,helpBody:u}){const p=Ct(),{data:m,loading:h,error:x}=m0(e),[y,b]=f.useState(!1),[C,j]=f.useState(null);async function w(S){b(!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}`),b(!1);return}p(n)}catch(E){j(E.message),b(!1);return}b(!1)}return h?r.jsx(dt,{label:`Loading ${s.toLowerCase()}…`}):x||!m?r.jsx(ht,{error:x||`${s} is unavailable.`}):r.jsx(ba,{initialContent:m.content,documentType:l,onSave:w,saving:y,error:C,title:s,description:i,onCancel:()=>p(n),helpTitle:c,helpBody:u})}function sj(){const{slug:e}=Et(),t=Xt(),n=e??"";return r.jsx(va,{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 Im(){const{slug:e,aslug:t,id:n}=Et(),s=Xt(),i=!!n,l=i?`/api/assignments/${n}/edit`:`/api/projects/${e}/assignments/${t}/edit`,c=i?`/api/assignments/${n}`:`/api/projects/${e}/assignments/${t}`,u=i?`/assignments/${n}`:`${s}/projects/${e}/assignments/${t}`;return r.jsx(va,{loadUrl:l,saveUrl:c,redirectTo:u,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 Om(){const{slug:e,aslug:t,id:n}=Et(),s=Xt(),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`,u=i?`/assignments/${n}?tab=plan`:`${s}/projects/${e}/assignments/${t}?tab=plan`;return r.jsx(va,{loadUrl:l,saveUrl:c,redirectTo:u,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 Mm(){const{slug:e,aslug:t,id:n}=Et(),s=Xt(),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`,u=i?`/assignments/${n}?tab=scratchpad`:`${s}/projects/${e}/assignments/${t}?tab=scratchpad`;return r.jsx(va,{loadUrl:l,saveUrl:c,redirectTo:u,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 bN({loadUrl:e,saveUrl:t,redirectTo:n,title:s,description:i,helpTitle:l,helpBody:c}){const u=Ct(),{data:p,loading:m,error:h}=m0(e),[x,y]=f.useState(""),[b,C]=f.useState(""),[j,w]=f.useState(!1),[S,E]=f.useState(null);async function N(){w(!0),E(null);try{const R=await fetch(t,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({title:x,body:b})}),I=await R.json();if(!R.ok){E(I.error||`HTTP ${R.status}`),w(!1);return}u(n)}catch(R){E(R.message),w(!1);return}w(!1)}return m?r.jsx(dt,{label:`Loading ${s.toLowerCase()}…`}):h||!p?r.jsx(ht,{error:h||`${s} is unavailable.`}):r.jsxs("div",{className:"space-y-4",children:[r.jsx(Be,{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:R=>y(R.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:b,onChange:R=>C(R.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:()=>u(n),className:"shell-action",children:"Cancel"}),r.jsx("button",{type:"button",onClick:N,disabled:j||!b.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(Be,{title:"Current Document",children:r.jsx(nn,{content:p.content.replace(/^---[\s\S]*?---\n?/,""),emptyState:"No existing content."})})]})}function _m(){const{slug:e,aslug:t,id:n}=Et(),s=Xt(),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`,u=i?`/assignments/${n}?tab=handoff`:`${s}/projects/${e}/assignments/${t}?tab=handoff`;return r.jsx(bN,{loadUrl:l,saveUrl:c,redirectTo:u,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 Fm(){const{slug:e,aslug:t,id:n}=Et(),s=Xt(),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`,u=i?`/assignments/${n}?tab=decisions`:`${s}/projects/${e}/assignments/${t}?tab=decisions`;return r.jsx(bN,{loadUrl:l,saveUrl:c,redirectTo:u,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 oj(){const{workspace:e}=Et(),{data:t}=Uo(),{data:n,loading:s,error:i,refetch:l}=Kh(),[c,u]=f.useState(!1),[p,m]=f.useState(""),[h,x]=f.useState(!1),y=On();f.useEffect(()=>{const E=y.hash.match(/^#server-(.+)/);if(!E)return;const N=decodeURIComponent(E[1]),R=document.querySelector(`[data-server-name="${window.CSS.escape(N)}"]`);if(!R)return;R.scrollIntoView({block:"nearest"}),R.classList.add("ring-2","ring-primary/60");const I=window.setTimeout(()=>R.classList.remove("ring-2","ring-primary/60"),1500);return()=>window.clearTimeout(I)},[y.hash,n]);const b=(()=>{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(R=>R.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(""),u(!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(dt,{label:"Loading servers…"}):i?r.jsx(ht,{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:()=>u(!1),children:"Cancel"})]}):r.jsxs("button",{className:"shell-action",onClick:()=>u(!0),children:[r.jsx(Kt,{className:"h-3.5 w-3.5"}),"Track Session"]}),r.jsxs("button",{className:"shell-action",onClick:j,disabled:h,children:[r.jsx(Vj,{className:`h-3.5 w-3.5 ${h?"animate-spin":""}`}),"Refresh All"]})]}),b.length===0?r.jsx(ct,{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:b.map(E=>r.jsx(d6,{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 d6({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(Fh,{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(Vj,{className:"h-3.5 w-3.5"})}),r.jsx("button",{className:"shell-action",onClick:n,title:"Remove",children:r.jsx(Mn,{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(f6,{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(PT,{className:"h-4 w-4"}),r.jsx("span",{children:e.kind==="process"?"Process no longer running":"Session no longer exists"})]})]})}function f6({pane:e,sessionName:t,windowIndex:n,onRefetch:s}){const i=Xt(),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(Rr,{value:e.cwd})]}),e.branch&&r.jsxs("span",{className:"flex shrink-0 items-center gap-1 text-xs text-muted-foreground",children:[r.jsx(Oh,{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(sa,{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(vT,{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 vN(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 p6(e,t){const n=Date.parse(e),s=Math.floor((n-t)/1e3);return Number.isNaN(s)?"–":s<=0?"expired":vN(s)}function m6(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 h6(e){if(!e)return null;try{return JSON.parse(e)}catch{return null}}function ij(){const{data:e,loading:t,error:n,refetch:s}=h0(),[i,l]=f.useState(()=>Date.now()),[c,u]=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(dt,{label:"Loading inventories…"});if(n)return r.jsx(ht,{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(ct,{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(),u(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(g6,{detail:x,now:i,onForceRelease:y=>u({slug:x.inventory.slug,lease:y})},x.inventory.slug))}),r.jsx(xa,{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||u(null)}})]})}function g6({detail:e,now:t,onForceRelease:n}){const{inventory:s,members:i,active_leases:l}=e,c=i.filter(p=>p.status==="idle").length,u=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(gd,{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=",vN(s.default_ttl_s)]})]}),r.jsx("div",{className:"text-right text-xs text-muted-foreground",children:r.jsxs("div",{children:[c," idle · ",u," 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(x6,{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(y6,{lease:p,now:t,onForceRelease:()=>n(p)},p.lease_id))})]})]})}function x6({member:e}){const t=h6(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 ${m6(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 y6({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(lT,{className:"h-3 w-3"}),p6(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(AT,{className:"h-3 w-3"}),"Force release"]})]})]})}function b6(){return new Date(Date.now()-720*60*60*1e3).toISOString().slice(0,10)}function v6(){return new Date().toISOString().slice(0,10)}function aj(){const[e,t]=f.useState(b6()),[n,s]=f.useState(v6()),[i,l]=f.useState(""),[c,u]=f.useState("project"),[p,m]=f.useState(null),[h,x]=f.useState(!0),[y,b]=f.useState(null),[C,j]=f.useState([]);return f.useEffect(()=>{const w=new AbortController;x(!0),b(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 R of E.daily)R.project_slug&&N.add(R.project_slug);j([...N].sort())}x(!1)}).catch(E=>{E instanceof Error&&E.name==="AbortError"||(b(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(xd,{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=>u(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:Uu(w.totalTokens)}),r.jsx("td",{className:"px-3 py-2 text-right tabular-nums",children:Vu(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:Uu(w.total_tokens)}),r.jsx("td",{className:"px-3 py-2 text-right tabular-nums",children:Vu(w.total_cost)})]},S))})]})]})]})]})}function lj(){const{workspace:e}=Et(),{data:t}=Uo(),{data:n,loading:s,error:i}=g0(),[l,c]=f.useState(""),[u,p]=f.useState(""),[m,h]=f.useState(""),[x,y]=f.useState("started_desc"),[b,C]=f.useState(0),[j,w]=f.useState(new Set),[S,E]=f.useState(!1),[N,R]=f.useState(null),[I,P]=f.useState(null),$=(n==null?void 0:n.sessions.some(_=>_.status==="active"))??!1;f.useEffect(()=>{if(!$)return;const _=window.setInterval(()=>C(G=>G+1),3e4);return()=>window.clearInterval(_)},[$]),f.useEffect(()=>{w(_=>{if(_.size===0)return _;const G=new Set((n==null?void 0:n.sessions.map(le=>le.sessionId))??[]),Q=new Set([..._].filter(le=>G.has(le)));return Q.size===_.size?_:Q})},[n]);const D=f.useMemo(()=>{if(!n)return[];if(e&&!t)return[];const _=l.trim().toLowerCase();return[...n.sessions.filter(Q=>{var ne;if(e&&t){const T=((ne=t.find(O=>O.slug===Q.projectSlug))==null?void 0:ne.workspace)??null;if(e==="_ungrouped"){if(T!==null)return!1}else if(T!==e)return!1}const le=j6(Q.started);return u&&(!le||le<u)||m&&(!le||le>m)?!1:_?[Q.projectSlug??"",Q.assignmentSlug??"",Q.agent,Q.sessionId,Q.path,Q.description??"",Q.transcriptPath??""].join(" ").toLowerCase().includes(_):!0})].sort((Q,le)=>k6(Q,le,x))},[n,l,x,u,m,b,e,t]);function X(_){w(G=>{const Q=new Set(G);return Q.has(_)?Q.delete(_):Q.add(_),Q})}function Z(){j.size===D.length&&D.length>0?w(new Set):w(new Set(D.map(_=>_.sessionId)))}async function z(_){R(null),E(!0);try{const G=await fetch("/api/agent-sessions",{method:"DELETE",headers:{"Content-Type":"application/json"},body:JSON.stringify({sessionIds:_})}),Q=await G.json().catch(()=>null);if(!G.ok)throw new Error((Q==null?void 0:Q.error)||`HTTP ${G.status}`);w(le=>new Set([...le].filter(W=>!_.includes(W)))),P(null)}catch(G){R(G.message)}finally{E(!1)}}async function U(_){try{const G=await fetch(`/api/agent-sessions/${encodeURIComponent(_)}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({status:"stopped"})});if(!G.ok){const Q=await G.json().catch(()=>null);R((Q==null?void 0:Q.error)||`Failed to mark session stopped: HTTP ${G.status}`)}}catch(G){R(G.message)}}if(s)return r.jsx(dt,{label:"Loading agent sessions..."});if(i)return r.jsx(ht,{error:i});if(!n)return null;const J=n.sessions.length>0;return r.jsxs(r.Fragment,{children:[r.jsxs(Eg,{children:[r.jsx(Md,{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:u,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:()=>P({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(Mn,{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(ct,{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(Pr,{className:"h-4 w-4"}):r.jsx(zh,{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(w6,{session:_,selected:j.has(_.sessionId),onToggle:()=>X(_.sessionId),onDelete:()=>P({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:U},_.sessionId))})]})}):r.jsx(ct,{title:"No agent sessions",description:"No agent sessions have been registered yet. Use /grab-assignment or syntaur track-session to register one."}),r.jsx(xa,{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:_=>{_||P(null)},onConfirm:async()=>{I&&await z(I.sessionIds)}})]})}function w6({session:e,selected:t,onToggle:n,onDelete:s,onMarkStopped:i}){const l=Xt(),c=e.sessionId.length>12?e.sessionId.slice(0,8)+"...":e.sessionId,u=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(Pr,{className:"h-4 w-4"}):r.jsx(zh,{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:yn(e.projectSlug),children:yn(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:yn(e.assignmentSlug),children:yn(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(hd,{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(Rr,{value:e.sessionId})]})}),r.jsx("td",{className:"py-2 pr-3 text-xs text-muted-foreground",children:r.jsx("span",{className:"truncate block",children:ls(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:u}),e.path&&r.jsx(Rr,{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(Rr,{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(sN,{session:e,onMarkStopped:i}),r.jsx("button",{onClick:s,className:"text-muted-foreground hover:text-destructive",title:"Delete session",children:r.jsx(Mn,{className:"h-3.5 w-3.5"})})]})})]})}function j6(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 Nu(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 k6(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 Nu(e)-Nu(t);case"duration_desc":return Nu(t)-Nu(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 S6(){const{data:e,loading:t,error:n,refetch:s}=x0(),[i,l]=f.useState(""),[c,u]=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 b(j,w,S){if(j.preventDefault(),j.stopPropagation(),!c){u(w);try{const E=S?"disable":"enable",N=await fetch(`/api/playbooks/${encodeURIComponent(w)}/${E}`,{method:"POST"});if(!N.ok){const R=await N.json().catch(()=>({}));throw new Error(R.error||`Failed to ${E} playbook`)}s()}catch(E){console.error(E),alert(E instanceof Error?E.message:"Failed to update playbook")}finally{u(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(dt,{label:"Loading playbooks..."}):n?r.jsx(ht,{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(co,{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(Kt,{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(zj,{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(ct,{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(Kt,{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:Mn,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(Sg,{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(Mj,{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(Hj,{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=>b(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(xa,{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 N6(){const{slug:e}=Et(),t=Ct(),{data:n,loading:s,error:i,refetch:l}=RP(e),[c,u]=f.useState(!1),[p,m]=f.useState(!1),[h,x]=f.useState(!1),[y,b]=f.useState(!1),[C,j]=f.useState(""),[w,S]=f.useState(!1),[E,N]=f.useState(null),R=e==="manifest";f.useEffect(()=>{y&&(j(e??""),N(null))},[y,e]);const I=dr(C),P=I.length>0&&Du(I)&&I!=="manifest",$=I!==e;async function D(){if(!(!e||!P||!$)){S(!0),N(null);try{const z=await fetch(`/api/playbooks/${encodeURIComponent(e)}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({newSlug:I})});if(!z.ok){const U=await z.json().catch(()=>({}));throw new Error(U.error||"Failed to rename playbook")}b(!1),t(`/playbooks/${I}`)}catch(z){N(z instanceof Error?z.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 z=n.enabled?"disable":"enable",U=await fetch(`/api/playbooks/${encodeURIComponent(e)}/${z}`,{method:"POST"});if(!U.ok){const J=await U.json().catch(()=>({}));throw new Error(J.error||`Failed to ${z} playbook`)}l()}catch(z){console.error(z),alert(z instanceof Error?z.message:"Failed to update playbook")}finally{x(!1)}}}return s?r.jsx(dt,{label:"Loading playbook..."}):i?r.jsx(ht,{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:R?"Playbook Manifest":n.name}),R?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]}),!R&&n.description?r.jsx("p",{className:"mt-1 text-sm text-muted-foreground",children:n.description}):null,R?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,!R&&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 ",ls(n.created)]}),r.jsxs("span",{children:["Updated ",ls(n.updated)]})]}),n.tags.length>0?r.jsx("div",{className:"mt-2 flex flex-wrap gap-1.5",children:n.tags.map(z=>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(Hj,{className:"h-3 w-3"}),z]},z))}):null]}),R?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(Bo,{className:"h-3 w-3"}),"Edit"]}),r.jsxs("button",{type:"button",onClick:()=>b(!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(LT,{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:()=>u(!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:()=>u(!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(Mn,{className:"h-3 w-3"}),"Delete"]})]})]}),r.jsx("div",{className:"surface-panel p-4",children:r.jsx(nn,{content:n.body})}),r.jsx(Zn,{open:y,onOpenChange:z=>w?void 0:b(z),children:r.jsxs(_n,{children:[r.jsxs(qr,{children:[r.jsx(Fn,{children:"Rename playbook"}),r.jsx(fs,{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:z=>j(z.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&&!P?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(Ps,{children:[r.jsx("button",{type:"button",onClick:()=>b(!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||!P||!$,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 C6(){const e=Ct(),[t,n]=f.useState(null),[s,i]=f.useState(!0),[l,c]=f.useState(!1),[u,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(dt,{label:"Loading playbook template..."}):u&&!t?r.jsx(ht,{error:u}):r.jsx(ba,{initialContent:t||"",documentType:"playbook",mode:"create",onSave:m,saving:l,error:u,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 E6(){const{slug:e}=Et(),t=Ct(),[n,s]=f.useState(null),[i,l]=f.useState(!0),[c,u]=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){u(!0),m(null);try{const y=await fetch(`/api/playbooks/${e}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({content:x})}),b=await y.json();if(!y.ok){m(b.error||`HTTP ${y.status}`),u(!1);return}t(`/playbooks/${e}`)}catch(y){m(y.message),u(!1);return}u(!1)}}return i?r.jsx(dt,{label:"Loading playbook..."}):p&&!n?r.jsx(ht,{error:p}):r.jsx(ba,{initialContent:n||"",documentType:"playbook",mode:"edit",onSave:h,saving:c,error:p,title:"Edit Playbook",onCancel:()=>t(`/playbooks/${e}`)})}function T6(){const{data:e,loading:t,error:n}=AP(),[s,i]=f.useState(""),[l,c]=f.useState("all"),[u,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]),b=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||u!=="all"&&w.scope!==u||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,u,m]);return t?r.jsx(dt,{label:"Loading memories…"}):n?r.jsx(ht,{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(co,{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:u,onChange:w=>p(w.target.value),className:"editor-input max-w-[140px]",children:[r.jsx("option",{value:"all",children:"All scopes"}),b.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(Kt,{className:"h-4 w-4"}),"New Memory"]})]}),j.length===0?r.jsx(ct,{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(Kt,{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:gr(w.updated)})]},`${w.projectSlug}/${w.slug}`))})]})})]})}function P6(){const{slug:e,itemSlug:t}=Et(),n=Ct(),{data:s,loading:i,error:l}=DP(e,t),[c,u]=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(dt,{label:"Loading memory…"}):l?r.jsx(ht,{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 ",ls(s.created)]}),r.jsxs("span",{children:["Updated ",ls(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(Bo,{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:()=>u(!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:()=>u(!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(Mn,{className:"h-3 w-3"}),"Delete"]})]})]}),r.jsx("div",{className:"surface-panel p-4",children:r.jsx(nn,{content:s.body})})]}):null}function R6(){const e=Ct(),[t]=ds(),n=t.get("project"),{data:s,loading:i,error:l}=Uo(),[c,u]=f.useState(n??""),[p,m]=f.useState(""),[h,x]=f.useState(""),[y,b]=f.useState(!1),[C,j]=f.useState(null);f.useEffect(()=>{!c&&s&&s.length>0&&u(n??s[0].slug)},[s,n,c]);async function w(S){if(S.preventDefault(),!(!c||!p.trim())){b(!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}`),b(!1);return}e(`/projects/${N.projectSlug}/memories/${N.slug}`)}catch(E){j(E.message),b(!1)}}}return i?r.jsx(dt,{label:"Loading projects…"}):l?r.jsx(ht,{error:l}):!s||s.length===0?r.jsx(ht,{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=>u(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 A6(){const{slug:e,itemSlug:t}=Et();return r.jsx(va,{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 D6(){const{data:e,loading:t,error:n}=LP(),[s,i]=f.useState(""),[l,c]=f.useState("all"),[u,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]),b=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||u!=="all"&&w.category!==u||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,u,m]);return t?r.jsx(dt,{label:"Loading resources…"}):n?r.jsx(ht,{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(co,{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:u,onChange:w=>p(w.target.value),className:"editor-input max-w-[160px]",children:[r.jsx("option",{value:"all",children:"All categories"}),b.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(Kt,{className:"h-4 w-4"}),"New Resource"]})]}),j.length===0?r.jsx(ct,{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(Kt,{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:gr(w.updated)})]},`${w.projectSlug}/${w.slug}`))})]})})]})}function L6(){const{slug:e,itemSlug:t}=Et(),n=Ct(),{data:s,loading:i,error:l}=$P(e,t),[c,u]=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(dt,{label:"Loading resource…"}):l?r.jsx(ht,{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 ",ls(s.created)]}),r.jsxs("span",{children:["Updated ",ls(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(Bo,{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:()=>u(!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:()=>u(!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(Mn,{className:"h-3 w-3"}),"Delete"]})]})]}),r.jsx("div",{className:"surface-panel p-4",children:r.jsx(nn,{content:s.body})})]}):null}function $6(){const e=Ct(),[t]=ds(),n=t.get("project"),{data:s,loading:i,error:l}=Uo(),[c,u]=f.useState(n??""),[p,m]=f.useState(""),[h,x]=f.useState(""),[y,b]=f.useState(!1),[C,j]=f.useState(null);f.useEffect(()=>{!c&&s&&s.length>0&&u(n??s[0].slug)},[s,n,c]);async function w(S){if(S.preventDefault(),!(!c||!p.trim())){b(!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}`),b(!1);return}e(`/projects/${N.projectSlug}/resources/${N.slug}`)}catch(E){j(E.message),b(!1)}}}return i?r.jsx(dt,{label:"Loading projects…"}):l?r.jsx(ht,{error:l}):!s||s.length===0?r.jsx(ht,{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=>u(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 I6(){const{slug:e,itemSlug:t}=Et();return r.jsx(va,{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 O6({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 Nh=["projects","playbooks","todos","servers","config"];function M6(e){const t=new Set;for(const n of e.split(",").map(s=>s.trim()))Nh.includes(n)&&t.add(n);return t}function cj(e){if(!e)return"never";try{return new Date(e).toLocaleString()}catch{return e}}function _6(){const[e,t]=f.useState(!0),[n,s]=f.useState(null),[i,l]=f.useState(""),[c,u]=f.useState(new Set(Nh)),[p,m]=f.useState(!1),[h,x]=f.useState(!1),[y,b]=f.useState(null),[C,j]=f.useState(null),w=f.useCallback(async()=>{try{const P=await fetch("/api/backup");if(!P.ok)throw new Error(`HTTP ${P.status}`);const $=await P.json();s($),l($.repo??""),u(M6($.categories)),m(!1)}catch(P){j({type:"error",message:`Failed to load backup config: ${P instanceof Error?P.message:String(P)}`})}finally{t(!1)}},[]);f.useEffect(()=>{w()},[w]);function S(P){u($=>{const D=new Set($);return D.has(P)?D.delete(P):D.add(P),D}),m(!0)}async function E(){x(!0),j(null);try{const P=Array.from(c),$=await fetch("/api/backup/config",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({repo:i.trim()||null,categories:P})}),D=await $.json();if(!$.ok)throw new Error(D.error||`HTTP ${$.status}`);s(D),m(!1),j({type:"success",message:"Backup configuration saved."})}catch(P){j({type:"error",message:`Save failed: ${P instanceof Error?P.message:String(P)}`})}finally{x(!1)}}async function N(){b("push"),j(null);try{const P=await fetch("/api/backup/push",{method:"POST"}),$=await P.json();if(!P.ok||$.success===!1)throw new Error($.error||$.message||`HTTP ${P.status}`);j({type:"success",message:$.message||"Backup complete."}),await w()}catch(P){j({type:"error",message:`Backup failed: ${P instanceof Error?P.message:String(P)}`})}finally{b(null)}}async function R(){if(window.confirm("Restore will overwrite local files for the selected categories with the contents of the GitHub repo. This cannot be undone. Continue?")){b("pull"),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{b(null)}}}if(e)return r.jsx(Be,{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(Be,{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:P=>{l(P.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:Nh.map(P=>{const $=c.has(P);return r.jsxs("button",{type:"button",onClick:()=>S(P),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"}`}),P]},P)})})]}),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: "}),cj((n==null?void 0:n.lastBackup)??null)]}),r.jsxs("div",{children:[r.jsx("span",{className:"font-medium text-foreground",children:"Last restore: "}),cj((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(bd,{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($T,{className:"h-3.5 w-3.5"}),y==="push"?"Backing up...":"Back Up Now"]}),r.jsxs("button",{className:"shell-action",onClick:R,disabled:!I,title:I?"Restore from backup":p?"Save config first":"Set repo and pick categories",children:[r.jsx(dT,{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(cT,{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 F6({open:e,affected:t,remaining:n,onResolve:s,onCancel:i}){var j;const[l,c]=f.useState(n.length>0?"remap":"delete"),[u,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&&u!==""&&u!==t.id||l==="delete"&&m;function y(){x&&s(l==="remap"?{id:t.id,mode:"remap",target:u}:{id:t.id,mode:"delete"})}const b=t.assignments.slice(0,10),C=t.count-b.length;return r.jsx(Zn,{open:e,onOpenChange:w=>w?void 0:i(),children:r.jsxs(_n,{className:"max-w-xl",children:[r.jsxs(qr,{children:[r.jsxs(Fn,{children:['Delete status "',t.label,'" — ',t.count," assignment",t.count===1?"":"s"," reference it"]}),r.jsx(fs,{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:[b.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:u,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(Ps,{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} → ${u||"..."}`:`Delete ${t.count}`})]})]})})}function z6(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 B6(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 uj(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 U6(){const{customBindings:e,userBindings:t,actionEntries:n,findConflict:s,bindAction:i,unbindAction:l}=uo(),[c,u]=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 b(N,R){m({type:N,message:R}),setTimeout(()=>m(null),2500)}function C(N){u({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 R=y0(N.nativeEvent);if(!R)return;const I=s(R,c.kind);u({...c,combo:R,conflict:I,error:null})}async function w(){var N;if(c!=null&&c.combo){if((N=c.conflict)!=null&&N.description){u({...c,error:`Reserved: ${c.conflict.description}`});return}u({...c,saving:!0,error:null});try{await i(c.kind,c.combo),u(null),b("success",`Bound ${al[c.kind]}`)}catch(R){u({...c,saving:!1,error:R instanceof Error?R.message:"Failed to save"})}}}async function S(N){try{await l(N),b("success",`Cleared ${al[N]} binding`)}catch(R){b("error",R instanceof Error?R.message:"Failed to clear binding")}}async function E(){if(!h){x(!0);try{await eA(),b("success","All hotkey bindings cleared")}catch(N){b("error",N instanceof Error?N.message:"Failed to reset bindings")}finally{x(!1)}}}return r.jsxs(Be,{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(Xi,{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:jd.map(N=>{var D,X;const R=n.find(Z=>Z.bindableKind===N),I=e[N],P=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(Km,{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:(R==null?void 0:R.title)??al[N]}),R!=null&&R.subtitle?r.jsx("div",{className:"text-xs text-muted-foreground",children:R.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:is(I)}),r.jsx("span",{className:`text-[10px] uppercase tracking-wide ${P?"text-primary":"text-muted-foreground"}`,children:P?"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"}),P?r.jsxs("button",{type:"button",className:"shell-action text-xs",onClick:()=>void S(N),"aria-label":`Restore default ${al[N]} binding`,children:[r.jsx(Uh,{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&&u(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:is(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 "',al[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 V6={kanban:"Kanban",list:"List",table:"Table"},H6={comfortable:"Comfortable",compact:"Compact"},W6={title:"Title",status:"Status",priority:"Priority",assignee:"Assignee",dependencies:"Dependencies",updated:"Updated"},K6={asc:"Ascending",desc:"Descending"};function q6(){const e=hF(),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 u(m,h){if(t[m]!==h){s(!0);try{await QS({[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 gF(),c("success","Reset to defaults")}catch(m){c("error",m instanceof Error?m.message:"Failed to reset")}finally{s(!1)}}}return r.jsxs(Be,{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(Xi,{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:lg.map(m=>r.jsx("button",{type:"button",onClick:()=>u("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:V6[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:PA.map(m=>r.jsx("button",{type:"button",onClick:()=>u("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:H6[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=>u("sortField",m.target.value),disabled:n,className:"editor-input max-w-[220px]",children:Ck.map(m=>r.jsx("option",{value:m,children:W6[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:TA.map(m=>r.jsx("button",{type:"button",onClick:()=>u("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:K6[m]},m))})]})]})]})}const G6=/^[a-z0-9][a-z0-9_-]*$/,wN=["first","last","none"];class jN extends Error{constructor(n,s){super(n);Pb(this,"fieldErrors");this.name="AgentsConfigError",this.fieldErrors=s}}const cx={agents:[],custom:!1};let Oi=null,Li=null,cd=0;const Ch=new Set;function kN(e){Oi=e;for(const t of Ch)t(e)}function Y6(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"&&wN.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 ux(e){if(!e||typeof e!="object")return cx;const t=e,n=Array.isArray(t.agents)?t.agents:[],s=[];for(const i of n){const l=Y6(i);l&&s.push(l)}return{agents:s,custom:t.custom===!0}}function J6(){if(Oi)return Promise.resolve(Oi);if(Li)return Li;const e=++cd;return Li=fetch("/api/config/agents").then(t=>{if(!t.ok)throw new Error(`HTTP ${t.status}`);return t.json()}).then(t=>{Li=null;const n=ux(t);return e!==cd?Oi??n:(Oi=n,n)}).catch(()=>(Li=null,cx)),Li}function X6(){const[e,t]=f.useState(()=>Oi??cx);return f.useEffect(()=>{let n=!1;return J6().then(s=>{n||t(s)}),Ch.add(t),()=>{n=!0,Ch.delete(t)}},[]),e}async function SN(e){const t=await e.json().catch(()=>null),n=(t==null?void 0:t.error)??`HTTP ${e.status}`;return new jN(n,t==null?void 0:t.fieldErrors)}async function Q6(e){++cd;const t=await fetch("/api/config/agents",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({agents:e})});if(!t.ok)throw await SN(t);const n=ux(await t.json());return kN(n),n}async function Z6(){++cd;const e=await fetch("/api/config/agents",{method:"DELETE"});if(!e.ok)throw await SN(e);const t=ux(await e.json());return kN(t),t}const ez={first:"first",last:"last",none:"none"};function NN(){return`row_${Math.random().toString(36).slice(2,10)}_${Date.now().toString(36)}`}function ml(e){return e.map(t=>({rowKey:NN(),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 tz(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 nz(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 rz(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 sz(e){return e.map(t=>Object.keys(t.fieldErrors).length===0?t:{...t,fieldErrors:{}})}function oz(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 iz({row:e,index:t,canRemove:n,onPatch:s,onSetDefault:i,onRemove:l}){const{attributes:c,listeners:u,setNodeRef:p,setActivatorNodeRef:m,transform:h,transition:x,isDragging:y}=Zd({id:e.rowKey}),b={transform:io.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=dr(S);N&&G6.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:b,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,...u,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(yd,{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(Mn,{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:wN.map(S=>r.jsx("option",{value:S,children:ez[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 az(){const e=X6(),[t,n]=f.useState(()=>ml(e.agents)),[s,i]=f.useState(()=>ml(e.agents)),[l,c]=f.useState(!1),[u,p]=f.useState(null),[m,h]=f.useState(null);f.useEffect(()=>{const P=ml(e.agents);n(P),i(P),p(null)},[e.agents]);const x=f.useMemo(()=>!oz(t,s),[t,s]),y=Wd(ao(ha,{activationConstraint:{distance:8}}),ao(ma));function b(P,$){h({type:P,message:$}),setTimeout(()=>h(null),2500)}function C(P,$){n(D=>D.map(X=>X.rowKey===P?{...X,...$,fieldErrors:lz(X.fieldErrors,$)}:X))}function j(P){n($=>$.map(D=>({...D,default:D.rowKey===P})))}function w(){n(P=>{const $=new Set(P.map(J=>J.id)),D="new-agent";let X=D,Z=1;for(;$.has(X);)Z+=1,X=`${D}-${Z}`;const z=Z===1?"New Agent":`New Agent ${Z}`,U={rowKey:NN(),id:X,originalId:null,isNew:!0,idEditable:!0,autoSlugFromLabel:!0,label:z,command:"",argsText:"",promptArgPosition:"first",resolveFromShellAliases:!0,default:!1,fieldErrors:{}};return[...P,U]})}function S(P){n($=>$.filter(D=>D.rowKey!==P))}async function E(){c(!0),p(null);try{const P=nz(t),$=tz(P),D=await Q6($),X=ml(D.agents);n(X),i(X),b("success","Agents saved")}catch(P){if(P instanceof jN)p(P.message),n($=>rz(sz($),P.fieldErrors)),b("error",P.message);else{const $=P instanceof Error?P.message:"Failed to save";p($),b("error",$)}}finally{c(!1)}}function N(){n(s),p(null)}async function R(){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 P=await Z6(),$=ml(P.agents);n($),i($),b("success","Reset to defaults")}catch(P){const $=P instanceof Error?P.message:"Failed to reset";p($),b("error",$)}finally{c(!1)}}}function I(P){const{active:$,over:D}=P;!D||$.id===D.id||n(X=>{const Z=X.findIndex(U=>U.rowKey===$.id),z=X.findIndex(U=>U.rowKey===D.id);return Z===-1||z===-1?X:ga(X,Z,z)})}return r.jsxs(Be,{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:R,disabled:l,children:[r.jsx(Xi,{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(Mh,{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}),u&&(!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:u}),r.jsx(Jd,{sensors:y,collisionDetection:Kd,onDragEnd:I,children:r.jsx(Qd,{items:t.map(P=>P.rowKey),strategy:Xd,children:r.jsx("div",{className:"space-y-2",children:t.map((P,$)=>r.jsx(iz,{row:P,index:$,canRemove:t.length>1,onPatch:D=>C(P.rowKey,D),onSetDefault:()=>j(P.rowKey),onRemove:()=>S(P.rowKey)},P.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(Kt,{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(bd,{className:"h-3 w-3"}),"Save"]})]})]})]})}function lz(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 CN=["terminal-app","iterm","ghostty","alacritty","warp","kitty"],ud={terminal:"terminal-app",custom:!1};let Mi=null,$i=null,dd=0;const Eh=new Set;function EN(e){Mi=e;for(const t of Eh)t(e)}function dx(e){if(!e||typeof e!="object")return ud;const t=e;return{terminal:typeof t.terminal=="string"&&CN.includes(t.terminal)?t.terminal:ud.terminal,custom:t.custom===!0}}function cz(){if(Mi)return Promise.resolve(Mi);if($i)return $i;const e=++dd;return $i=fetch("/api/config/terminal").then(t=>{if(!t.ok)throw new Error(`HTTP ${t.status}`);return t.json()}).then(t=>{$i=null;const n=dx(t);return e!==dd?Mi??n:(Mi=n,n)}).catch(()=>($i=null,ud)),$i}function uz(){const[e,t]=f.useState(()=>Mi??ud);return f.useEffect(()=>{let n=!1;return cz().then(s=>{n||t(s)}),Eh.add(t),()=>{n=!0,Eh.delete(t)}},[]),e}async function dz(e){++dd;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=dx(await t.json());return EN(n),n}async function fz(){++dd;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=dx(await e.json());return EN(t),t}const Cu={"terminal-app":"Terminal (macOS built-in)",iterm:"iTerm2",ghostty:"Ghostty",alacritty:"Alacritty",warp:"Warp",kitty:"kitty"};function pz(){const{terminal:e,custom:t}=uz(),[n,s]=f.useState(!1),[i,l]=f.useState(null);function c(m){l(m),setTimeout(()=>l(null),2500)}async function u(m){if(!(m===e&&t)){s(!0);try{await dz(m),c({type:"success",message:`Terminal set to ${Cu[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 fz();c({type:"success",message:`Reset to OS default (${Cu[m.terminal]}).`})}catch(m){c({type:"error",message:m instanceof Error?m.message:"Reset failed."})}finally{s(!1)}}return r.jsxs(Be,{title:"Terminal",description:`Which terminal "Open in agent" launches. Defaults to the OS choice (currently ${Cu[e]}) when unset.`,actions:t?r.jsxs("button",{className:"shell-action text-xs",onClick:p,disabled:n,type:"button",children:[r.jsx(Xi,{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=>u(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:CN.map(m=>r.jsx("option",{value:m,children:Cu[m]},m))})]})]})}function TN(){return`row_${Math.random().toString(36).slice(2,10)}_${Date.now().toString(36)}`}function zm(e){const t=e.statuses.map(n=>({rowKey:TN(),id:n.id,label:n.label,description:n.description??"",color:n.color??"",terminal:n.terminal??!1}));return B6(t,e.order)}function mz({row:e,isSaved:t,onUpdate:n,onRemove:s}){const{attributes:i,listeners:l,setNodeRef:c,setActivatorNodeRef:u,transform:p,transition:m,isDragging:h}=Zd({id:e.rowKey}),x={transform:io.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:u,...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(yd,{className:"h-4 w-4"})}),r.jsx("div",{className:"min-w-[8rem] flex-1",children:t?r.jsxs(Er,{children:[r.jsx(Tr,{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(pr,{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(O6,{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(Er,{children:[r.jsx(Tr,{asChild:!0,children:r.jsx("span",{className:"cursor-help text-xs text-muted-foreground underline decoration-dotted underline-offset-4",children:"Done"})}),r.jsx(pr,{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(Mn,{className:"h-3.5 w-3.5"})})]})}function hz(){var de;const[e,t]=f.useState(!0),[n,s]=f.useState(null),[i,l]=f.useState(!1),[c,u]=f.useState([]),[p,m]=f.useState(!1),[h,x]=f.useState(null),[y,b]=f.useState(!1),[C,j]=f.useState(new Set),[w,S]=f.useState(new Map),[E,N]=f.useState({open:!1}),R=Wd(ao(ha,{activationConstraint:{distance:8}}),ao(ma,{coordinateGetter:W5})),{preset:I,setPreset:P,resetPreset:$}=Wh(),[D,X]=f.useState(!1),[Z,z]=f.useState(null);async function U(F){if(!(F===I||D)){X(!0),z(null);try{await P(F),z({type:"success",message:"Theme updated"}),setTimeout(()=>z(null),2e3)}catch(re){z({type:"error",message:re instanceof Error?re.message:"Failed to save theme"})}finally{X(!1)}}}async function J(){X(!0),z(null);try{await $(),z({type:"success",message:"Theme reset to default"}),setTimeout(()=>z(null),2e3)}catch(F){z({type:"error",message:F instanceof Error?F.message:"Failed to reset theme"})}finally{X(!1)}}const _=f.useCallback(async()=>{try{const F=await fetch("/api/config/statuses");if(!F.ok)throw new Error(`HTTP ${F.status}`);const re=await F.json(),me=zm(re);u(me),l(re.custom),j(new Set(me.map(ve=>ve.id))),S(new Map),b(!1),s(null)}catch(F){s(F instanceof Error?F.message:"Failed to load config")}finally{t(!1)}},[]);f.useEffect(()=>{_()},[_]);function G(){setTimeout(()=>x(null),3e3)}async function Q(){m(!0),x(null);try{const{body:F}=z6({statuses:c,order:c.map(fe=>fe.id),pendingResolutions:w}),re=await fetch("/api/config/statuses",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(F)});if(!re.ok){const fe=await re.json().catch(()=>null);if(re.status===409&&(fe==null?void 0:fe.error)==="unresolved-orphans"){const He=Array.isArray(fe.unresolved)?fe.unresolved.map(pe=>pe.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(re.status===409&&(fe==null?void 0:fe.error)==="concurrent-edit"){const He=fe.applied?` (${fe.applied.remapped} remapped, ${fe.applied.deleted} deleted before the conflict)`:"";x({type:"error",message:`Concurrent edit detected${He}: ${fe.cause??"an assignment moved to a still-dropped status during save"}. Refreshing — please re-resolve.`}),await _();return}if(re.status===500&&(fe==null?void 0:fe.error)==="config-write-failed"&&(fe!=null&&fe.applied)){const{remapped:He,deleted:pe}=fe.applied,Pe=fe.message?`: ${fe.message}`:"";x({type:"error",message:`Resolutions applied (${He} remapped, ${pe} deleted) but the status config write failed${Pe}. Click Save again to retry.`}),await _();return}throw(fe==null?void 0:fe.error)==="invalid-remap-target"?new Error(`Invalid remap target (${fe.reason}): ${fe.id} → ${fe.target}.`):(fe==null?void 0:fe.error)==="duplicate-resolution-ids"?new Error(`Duplicate resolution ids: ${(fe.ids??[]).join(", ")}`):(fe==null?void 0:fe.error)==="stale-resolution"?new Error(`Stale resolution for id "${fe.id??"?"}".`):(fe==null?void 0:fe.error)==="malformed-resolutions"?new Error(`Malformed resolutions: ${fe.message??"unknown"}`):(fe==null?void 0:fe.error)==="remap-write-failed"||(fe==null?void 0:fe.error)==="delete-failed"||(fe==null?void 0:fe.error)==="scan-failed"?new Error(`${fe.error}: ${fe.cause??"unknown"}`):new Error((fe==null?void 0:fe.error)??`Save failed (HTTP ${re.status})`)}const me=await re.json(),ve=zm(me);u(ve),l(me.custom),j(new Set(ve.map(fe=>fe.id))),S(new Map),b(!1),Dv();const Se=me.applied?` (${me.applied.remapped} remapped, ${me.applied.deleted} deleted)`:"";x({type:"success",message:`Status config saved${Se}`}),G()}catch(F){x({type:"error",message:F instanceof Error?F.message:"Save failed"})}finally{m(!1)}}async function le(){m(!0),x(null);try{const F=await fetch("/api/config/statuses",{method:"DELETE"});if(!F.ok)throw new Error("Reset failed");const re=await F.json(),me=zm(re);u(me),l(re.custom),j(new Set(me.map(ve=>ve.id))),S(new Map),b(!1),Dv(),x({type:"success",message:"Reset to defaults"}),G()}catch(F){x({type:"error",message:F instanceof Error?F.message:"Reset failed"})}finally{m(!1)}}function W(F,re,me){u(ve=>{const Se=[...ve];return Se[F]={...Se[F],[re]:me},Se}),b(!0)}function ne(){const F=`status_${c.length+1}`;u(re=>[...re,{rowKey:TN(),id:F,label:"New Status",description:"",color:"",terminal:!1}]),b(!0)}function T(F){u(re=>{const me=re.filter(Se=>Se.id!==F),ve=new Set(me.map(Se=>Se.id));return S(Se=>uj(Se,ve)),me}),b(!0)}async function O(F){const re=c[F].id;if(!C.has(re)){T(re);return}try{const me=await fetch(`/api/config/statuses/affected/${encodeURIComponent(re)}`);if(!me.ok)throw new Error(`HTTP ${me.status}`);const ve=await me.json();if(ve.count===0){T(re);return}N({open:!0,affected:ve,pendingId:re})}catch(me){x({type:"error",message:`Could not check affected assignments for "${re}": ${me instanceof Error?me.message:String(me)}`})}}function q(F){if(!E.open)return;const{pendingId:re}=E;if(re!==F.id){N({open:!1});return}if(!c.some(me=>me.id===re)){x({type:"error",message:`Row for "${re}" was already removed — modal action ignored.`}),N({open:!1});return}u(me=>{const ve=me.filter(fe=>fe.id!==re),Se=new Set(ve.map(fe=>fe.id));return S(fe=>{const He=uj(fe,Se),pe=new Map(He);return pe.set(re,F),pe}),ve}),b(!0),N({open:!1})}function L(){N({open:!1})}function ee(F){const{active:re,over:me}=F;!me||re.id===me.id||(u(ve=>{const Se=ve.findIndex(He=>He.rowKey===re.id),fe=ve.findIndex(He=>He.rowKey===me.id);return Se===-1||fe===-1?ve:ga(ve,Se,fe)}),b(!0))}return e?r.jsx(dt,{label:"Loading settings..."}):n?r.jsx(ht,{error:n}):r.jsx(Mo,{children:r.jsxs("div",{className:"space-y-6",children:[r.jsxs(Be,{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(Xi,{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:r0.map(F=>{const re=F.slug===I;return r.jsxs("button",{type:"button",onClick:()=>U(F.slug),disabled:D,"aria-pressed":re,className:`group relative flex flex-col gap-2 rounded-lg border bg-card/95 p-3 text-left transition disabled:opacity-60 ${re?"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:F.swatches.primary}}),r.jsx("span",{className:"h-5 w-5 rounded-full ring-1 ring-border/60",style:{background:F.swatches.secondary}}),r.jsx("span",{className:"h-5 w-5 rounded-full ring-1 ring-border/60",style:{background:F.swatches.coral}}),r.jsx("span",{className:"h-5 w-5 rounded-full ring-1 ring-border/60",style:{background:F.swatches.teal}}),r.jsx("span",{className:"h-5 w-5 rounded-full ring-1 ring-border/60",style:{background:F.swatches.amber}}),re&&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(lo,{className:"h-3 w-3"})})]}),r.jsxs("div",{children:[r.jsx("div",{className:"text-sm font-medium text-foreground",children:F.label}),r.jsx("div",{className:"text-xs text-muted-foreground",children:F.description})]})]},F.slug)})})]}),r.jsx(U6,{}),r.jsx(pz,{}),r.jsx(az,{}),r.jsx(q6,{}),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(Mh,{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:le,disabled:p||!i&&!y,children:[r.jsx(Xi,{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(Be,{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:ne,children:[r.jsx(Kt,{className:"h-3 w-3"}),"Add Status"]}),children:r.jsx(Jd,{sensors:R,collisionDetection:Kd,onDragEnd:ee,children:r.jsx(Qd,{items:c.map(F=>F.rowKey),strategy:Xd,children:r.jsx("div",{className:"space-y-2",children:c.map((F,re)=>r.jsx(mz,{row:F,isSaved:C.has(F.id),onUpdate:(me,ve)=>W(re,me,ve),onRemove:()=>O(re)},F.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:Q,disabled:p||!y,children:[r.jsx(bd,{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(_6,{}),E.open&&r.jsx(F6,{open:E.open,affected:{...E.affected,label:((de=c.find(F=>F.id===E.affected.id))==null?void 0:de.label)??E.affected.id},remaining:c.filter(F=>F.id!==E.affected.id&&C.has(F.id)).map(F=>({id:F.id,label:F.label})),onResolve:q,onCancel:L})]})})}const Ii=e=>`${e.workspace}::${e.id}`;function dj(e){if(e.includes("/")){const[t,n]=e.split("/");return`/projects/${t}/assignments/${n}`}return`/assignments/${e}`}function gz(){var V;const{data:e,loading:t,error:n,refetch:s}=b0(),i=Ct(),[l,c]=f.useState(""),u=f.useRef(null);fo("list:todos");const[p,m]=f.useState(""),[h,x]=f.useState(""),[y,b]=f.useState(""),[C,j]=f.useState("_global"),[w,S]=f.useState(null),[E,N]=f.useState(new Set),[R,I]=f.useState(!1),P=f.useRef(null),[$,D]=f.useState(null);f.useEffect(()=>{let H=!1;return(async()=>{try{const ae=await fetch("/api/projects");if(!ae.ok)return;const he=await ae.json();H||D(he.filter(Ae=>!Ae.archived))}catch{}})(),()=>{H=!0}},[]);function X(H,ae){H.stopPropagation(),navigator.clipboard.writeText(ae),S(ae),setTimeout(()=>S(he=>he===ae?null:he),1500)}const Z=f.useMemo(()=>{if(!(e!=null&&e.workspaces))return[];const H=[];for(const ae of e.workspaces)for(const he of ae.items)H.push({...he,workspace:ae.workspace});return H},[e]),z=f.useMemo(()=>{const H=new Set;for(const ae of Z)for(const he of ae.tags)H.add(he);return Array.from(H).sort()},[Z]),U=f.useMemo(()=>{let H=Z;if(l.trim()){const ae=l.toLowerCase();H=H.filter(he=>he.description.toLowerCase().includes(ae)||he.tags.some(Ae=>Ae.toLowerCase().includes(ae))||he.id.includes(ae))}return p&&(H=H.filter(ae=>ae.status===p)),h&&(H=H.filter(ae=>ae.tags.includes(h))),H},[Z,l,p,h]);f.useEffect(()=>{N(new Set),P.current=null},[l,p,h]);const J=f.useMemo(()=>U.filter(H=>E.has(Ii(H))),[U,E]),_=U.length>0&&J.length===U.length,G=J.length>0&&!_,Q=f.useMemo(()=>{if(J.length===0)return null;const H=new Set(J.map(ae=>ae.workspace));return H.size===1?[...H][0]:null},[J]),le=f.useMemo(()=>{if(!Q||!$)return;const H=$.filter(ae=>ae.workspace===Q);return H.length===1?H[0].slug:void 0},[Q,$]),W=((V=J[0])==null?void 0:V.description)??"",ne=f.useMemo(()=>{if(Q)return null;const H=new Map;for(const ae of J)H.has(ae.workspace)||H.set(ae.workspace,[]),H.get(ae.workspace).push(ae.id);return Array.from(H,([ae,he])=>({workspace:ae,todoIds:he}))},[J,Q]),T=Q?{kind:"workspace",workspace:Q}:{kind:"aggregate",groups:ne??[]};function O(H,ae,he){const Ae=Ii(H);if(!!(he&&"shiftKey"in he&&he.shiftKey)&&P.current!=null){const Ve=Math.min(P.current,ae),Ze=Math.max(P.current,ae);N(Tt=>{const yt=new Set(Tt);for(let jt=Ve;jt<=Ze;jt++){const ue=U[jt];ue&&yt.add(Ii(ue))}return yt})}else N(Ve=>{const Ze=new Set(Ve);return Ze.has(Ae)?Ze.delete(Ae):Ze.add(Ae),Ze});P.current=ae}function q(){N(H=>{const ae=new Set(H);if(_)for(const he of U)ae.delete(Ii(he));else for(const he of U)ae.add(Ii(he));return ae})}function L(){N(new Set),P.current=null}function ee(H){L(),s(),H!=null&&H.assignmentRef&&i(dj(H.assignmentRef))}const de=f.useMemo(()=>{if(!(e!=null&&e.workspaces))return{open:0,in_progress:0,completed:0,blocked:0,total:0};const H={open:0,in_progress:0,completed:0,blocked:0,total:0};for(const ae of e.workspaces)H.open+=ae.counts.open,H.in_progress+=ae.counts.in_progress,H.completed+=ae.counts.completed,H.blocked+=ae.counts.blocked,H.total+=ae.counts.total;return H},[e]);async function F(){y.trim()&&(await qh(C,y.trim()),b(""),s())}const re={open:"in_progress",in_progress:"completed",completed:"open",blocked:"open"};function me(H,ae,he){ve(H,ae,re[he]||"open")}async function ve(H,ae,he){switch(he){case"open":await k0(H,ae);break;case"in_progress":await j0(H,ae);break;case"completed":await v0(H,ae);break;case"blocked":await w0(H,ae);break}s()}async function Se(H,ae){await S0(H,ae),s()}const{hotkeyRowProps:fe}=Gl(U,{scope:"list:todos",bindO:!1,onOpen:H=>me(H.workspace,H.id,H.status)});$t({keys:"/",scope:"list:todos",description:"Focus filter",handler:()=>{var H;return(H=u.current)==null?void 0:H.focus()}}),$t({keys:"r",scope:"list:todos",description:"Refresh",handler:()=>s()});const[He,pe]=ds(),Pe=He.get("focus");return f.useEffect(()=>{if(!Pe)return;const H=document.querySelector(`[data-todo-id="${CSS.escape(Pe)}"]`);if(!H)return;H.scrollIntoView({block:"nearest"}),H.classList.add("ring-2","ring-primary/60");const ae=window.setTimeout(()=>{H.classList.remove("ring-2","ring-primary/60"),pe(he=>{const Ae=new URLSearchParams(he);return Ae.delete("focus"),Ae})},1500);return()=>window.clearTimeout(ae)},[Pe,U.length,pe]),t?r.jsx(dt,{label:"Loading todos..."}):n?r.jsx(ht,{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(Sn,{label:"Open",value:de.open,icon:Pr}),r.jsx(Sn,{label:"In Progress",value:de.in_progress,icon:_h,tone:"info"}),r.jsx(Sn,{label:"Blocked",value:de.blocked,icon:Bh,tone:"warn"}),r.jsx(Sn,{label:"Completed",value:de.completed,icon:Pr,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:H=>j(H.target.value),className:"h-9 rounded-md border border-border/70 bg-background px-2 text-sm text-foreground focus:border-foreground/30 focus:outline-none",children:[r.jsx("option",{value:"_global",children:"Global"}),e==null?void 0:e.workspaces.filter(H=>H.workspace!=="_global").map(H=>r.jsx("option",{value:H.workspace,children:H.workspace},H.workspace))]}),r.jsx("input",{type:"text",placeholder:"Add a todo...",value:y,onChange:H=>b(H.target.value),onKeyDown:H=>H.key==="Enter"&&F(),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:F,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(Kt,{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(co,{className:"absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground"}),r.jsx("input",{ref:u,type:"text",placeholder:"Search todos...",value:l,onChange:H=>c(H.target.value),className:"h-9 w-full rounded-md border border-border/70 bg-background pl-9 pr-3 text-sm text-foreground placeholder:text-muted-foreground/60 focus:border-foreground/30 focus:outline-none"})]}),r.jsxs("select",{value:p,onChange:H=>m(H.target.value),className:"h-9 rounded-md border border-border/70 bg-background px-2 text-sm text-foreground focus:border-foreground/30 focus:outline-none",children:[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"})]}),z.length>0&&r.jsxs("select",{value:h,onChange:H=>x(H.target.value),className:"h-9 rounded-md border border-border/70 bg-background px-2 text-sm text-foreground focus:border-foreground/30 focus:outline-none",children:[r.jsx("option",{value:"",children:"All tags"}),z.map(H=>r.jsxs("option",{value:H,children:["#",H]},H))]})]}),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",Q?r.jsxs("span",{className:"ml-2 text-xs text-muted-foreground",children:["(from ",r.jsx("strong",{children:Q}),")"]}):r.jsxs("span",{className:"ml-2 text-xs text-muted-foreground",children:["across ",new Set(J.map(H=>H.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,U.length===0?r.jsx(ct,{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:H=>{H&&(H.indeterminate=G)},onChange:q,className:"h-4 w-4 cursor-pointer accent-foreground"}),r.jsxs("span",{children:["Select all in current filter (",U.length,")"]}),r.jsx("span",{className:"text-muted-foreground/60",children:"— shift-click for range select"})]}),r.jsx("div",{className:"space-y-1",children:U.map((H,ae)=>{const he=Ii(H),Ae=E.has(he);return r.jsxs("div",{"data-todo-id":H.id,...fe(ae),className:`surface-panel flex items-center gap-3 px-3 py-2 group cursor-pointer hover:bg-foreground/[0.03] transition ${Ae?"ring-1 ring-foreground/20":""}`,onClick:()=>me(H.workspace,H.id,H.status),children:[r.jsx("input",{type:"checkbox","aria-label":`Select todo ${H.id}`,checked:Ae,onChange:()=>{},onClick:Te=>{Te.stopPropagation(),O(H,ae,Te)},className:"h-4 w-4 cursor-pointer accent-foreground"}),r.jsx(Zg,{status:H.status,onChange:Te=>ve(H.workspace,H.id,Te)}),r.jsxs("div",{className:"flex-1 min-w-0",children:[r.jsx("span",{className:`text-sm ${H.status==="completed"?"line-through text-muted-foreground":"text-foreground"}`,children:H.description}),H.tags.length>0&&r.jsx("span",{className:"ml-2 text-xs text-muted-foreground",children:H.tags.map(Te=>`#${Te}`).join(" ")}),H.linkedAssignmentRef?r.jsxs(Ee,{to:dj(H.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:Te=>Te.stopPropagation(),children:[r.jsx(Oj,{className:"h-2.5 w-2.5"}),H.linkedAssignmentRef.includes("/")?H.linkedAssignmentRef:`oneoff:${H.linkedAssignmentRef.slice(0,8)}`]}):null]}),r.jsx("span",{className:"text-xs text-muted-foreground/60 font-mono",children:H.workspace!=="_global"&&r.jsx(Ee,{to:`/w/${H.workspace}/todos`,className:"hover:text-foreground transition mr-2",onClick:Te=>Te.stopPropagation(),children:H.workspace})}),w===H.id?r.jsxs("span",{className:"text-xs text-status-completed-foreground flex items-center gap-1",children:[r.jsx(lo,{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:Te=>X(Te,H.id),children:["t:",H.id]}),r.jsx("button",{className:"text-muted-foreground/40 hover:text-foreground transition",title:"Copy ID",onClick:Te=>X(Te,H.id),children:r.jsx(Pl,{className:"h-3 w-3"})})]}),r.jsx("button",{onClick:Te=>{Te.stopPropagation(),Se(H.workspace,H.id)},className:"text-xs text-muted-foreground/40 hover:text-destructive transition opacity-0 group-hover:opacity-100",children:"delete"})]},`${H.workspace}-${H.id}`)})})]}),r.jsx(ex,{open:R,selectedIds:J.map(H=>H.id),scope:T,onOpenChange:I,onDone:ee,defaultProject:le,defaultTitle:W,allowOneOff:!0})]})}const fj=80,xz={kanban:"Kanban",list:"List",table:"Table"},yz={title:"Title",status:"Status",priority:"Priority",assignee:"Assignee",dependencies:"Dependencies",updated:"Updated"};function bz({open:e,onOpenChange:t,workspace:n,onSubmit:s}){const i=Wo(),l=Fd(),{data:c}=Uo(),{data:u}=wd(),[p,m]=f.useState(""),[h,x]=f.useState(Di.viewMode),[y,b]=f.useState([]),[C,j]=f.useState([]),[w,S]=f.useState([]),[E,N]=f.useState([]),[R,I]=f.useState([]),[P,$]=f.useState("all"),[D,X]=f.useState(Di.sortField),[Z,z]=f.useState(Di.sortDirection),[U,J]=f.useState(!1),[_,G]=f.useState(null);f.useEffect(()=>{e&&(m(""),x(Di.viewMode),b([]),j([]),S([]),N([]),I([]),$("all"),X(Di.sortField),z(Di.sortDirection),G(null),J(!1))},[e]);const Q=f.useMemo(()=>{const ee=(c??[]).filter(de=>n?n==="_ungrouped"?de.workspace===null:de.workspace===n:!0);return[{value:"__standalone__",label:"No project"},...ee.map(de=>({value:de.slug,label:de.title}))]},[c,n]),le=f.useMemo(()=>{const ee=new Set;for(const F of(u==null?void 0:u.assignments)??[])(n?n==="_ungrouped"?F.projectWorkspace===null:F.projectWorkspace===n:!0)&&F.assignee&&ee.add(F.assignee);const de=[{value:"__unassigned__",label:"Unassigned"}];for(const F of Array.from(ee).sort())de.push({value:F,label:F});return de},[u,n]),W=f.useMemo(()=>i.order.map(ee=>({value:ee,label:Xl(i,ee)})),[i]),ne=f.useMemo(()=>bF.map(ee=>({value:ee,label:ee[0].toUpperCase()+ee.slice(1)})),[]),T=f.useMemo(()=>l.definitions.map(ee=>({value:ee.id,label:Ki(l,ee.id)})),[l]),O=lg.map(ee=>({value:ee,label:xz[ee]})),q=p.trim(),L=q.length>0&&q.length<=fj;return r.jsx(Zn,{open:e,onOpenChange:t,children:r.jsx(_n,{className:"max-w-lg",children:r.jsxs("form",{className:"space-y-4",onSubmit:async ee=>{if(ee.preventDefault(),!L||U)return;J(!0),G(null);const de={viewMode:h,filters:{status:y,priority:C,type:w,project:E,assignee:R,activity:P},sortField:D,sortDirection:Z};try{await s(q,de)}catch(F){G(F instanceof Error?F.message:String(F)),J(!1)}},children:[r.jsx(qr,{children:r.jsx(Fn,{children:"Create view"})}),r.jsxs("div",{className:"space-y-2",children:[r.jsx("label",{className:"block text-xs font-medium text-muted-foreground",htmlFor:"create-view-name",children:"Name"}),r.jsx("input",{id:"create-view-name",type:"text",value:p,autoFocus:!0,required:!0,maxLength:fj,onChange:ee=>m(ee.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"})]}),r.jsxs("div",{className:"space-y-2",children:[r.jsx("span",{className:"block text-xs font-medium text-muted-foreground",children:"View mode"}),r.jsx(_d,{value:h,onChange:ee=>x(ee),options:O})]}),r.jsxs("div",{className:"grid grid-cols-1 gap-3 sm:grid-cols-2",children:[r.jsxs("label",{className:"space-y-1",children:[r.jsx("span",{className:"block text-xs font-medium text-muted-foreground",children:"Status"}),r.jsx(Jn,{ariaLabel:"Status filter",className:"w-full",allLabel:"All statuses",options:W,value:y,onChange:b})]}),r.jsxs("label",{className:"space-y-1",children:[r.jsx("span",{className:"block text-xs font-medium text-muted-foreground",children:"Priority"}),r.jsx(Jn,{ariaLabel:"Priority filter",className:"w-full",allLabel:"All priorities",options:ne,value:C,onChange:j})]}),r.jsxs("label",{className:"space-y-1",children:[r.jsx("span",{className:"block text-xs font-medium text-muted-foreground",children:"Type"}),r.jsx(Jn,{ariaLabel:"Type filter",className:"w-full",allLabel:"All types",options:T,value:w,onChange:S})]}),r.jsxs("label",{className:"space-y-1",children:[r.jsx("span",{className:"block text-xs font-medium text-muted-foreground",children:"Project"}),r.jsx(Jn,{ariaLabel:"Project filter",className:"w-full",allLabel:"All projects",options:Q,value:E,onChange:N})]}),r.jsxs("label",{className:"space-y-1",children:[r.jsx("span",{className:"block text-xs font-medium text-muted-foreground",children:"Assignee"}),r.jsx(Jn,{ariaLabel:"Assignee filter",className:"w-full",allLabel:"All assignees",options:le,value:R,onChange:I})]}),r.jsxs("label",{className:"space-y-1",children:[r.jsx("span",{className:"block text-xs font-medium text-muted-foreground",children:"Activity"}),r.jsxs("select",{value:P,onChange:ee=>$(ee.target.value),className:"editor-input w-full",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.jsxs("label",{className:"space-y-1 sm:col-span-2",children:[r.jsx("span",{className:"block text-xs font-medium text-muted-foreground",children:"Sort by"}),r.jsxs("div",{className:"flex gap-2",children:[r.jsx("select",{value:D,onChange:ee=>X(ee.target.value),className:"editor-input w-full",children:Ck.map(ee=>r.jsx("option",{value:ee,children:yz[ee]},ee))}),r.jsx("button",{type:"button",onClick:()=>z(ee=>ee==="asc"?"desc":"asc"),className:"shell-action shrink-0",title:Z==="asc"?"Ascending":"Descending",children:Z==="asc"?"Asc":"Desc"})]})]})]}),_?r.jsx("p",{className:"text-xs text-error-foreground",role:"alert",children:_}):null,r.jsxs(Ps,{children:[r.jsx("button",{type:"button",onClick:()=>t(!1),className:"shell-action",disabled:U,children:"Cancel"}),r.jsx("button",{type:"submit",disabled:!L||U,className:"shell-action bg-foreground text-background hover:opacity-90 disabled:opacity-50",children:U?"Creating…":"Create view"})]})]})})})}function vz({title:e,description:t,actions:n,className:s}){return r.jsxs("div",{className:Re("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 wz={kanban:"Kanban",list:"List",table:"Table"};function pj(){const{workspace:e}=Et(),{views:t,loading:n}=dg(),{toast:s,showToast:i,dismissToast:l}=ix(),[c,u]=f.useState(null),[p,m]=f.useState(!1),[h,x]=f.useState(!1);async function y(){if(c){m(!0);try{await FA(c.id),u(null)}catch(j){i(j instanceof Error?j.message:"Failed to delete saved view")}finally{m(!1)}}}async function b(j,w){const{workspace:S,config:E}=vF(w,e??null);try{await fg({name:j,workspace:S,config:E}),x(!1),i(`Created view "${j}"`)}catch(N){throw i(N instanceof Error?N.message:"Failed to create saved view"),N}}const C=r.jsxs("button",{type:"button",onClick:()=>x(!0),className:"shell-action inline-flex items-center gap-1.5 bg-foreground text-background hover:opacity-90",children:[r.jsx(Kt,{className:"h-4 w-4"}),"Create view"]});return r.jsxs("div",{className:"space-y-4",children:[r.jsx(vz,{title:"Saved Views",description:"Create a view here, or browse, rename, and apply views captured from any board.",actions:C}),n?r.jsx(dt,{label:"Loading saved views…"}):t.length===0?r.jsx(ct,{title:"No saved views yet",description:"Create your first view here, or capture one from any assignments board.",actions:C}):r.jsx(Be,{children:r.jsx("ul",{className:"divide-y divide-border/60",children:t.map(j=>r.jsx(jz,{view:j,onRenameError:w=>i(w),onRequestDelete:()=>u(j)},j.id))})}),r.jsx(bz,{open:h,onOpenChange:x,workspace:e??null,onSubmit:b}),r.jsx(xa,{open:c!==null,title:"Delete saved view?",description:c?`Delete '${c.name}'? Any Overview widgets referencing this view will become empty.`:"",confirmLabel:"Delete",loading:p,destructive:!0,onConfirm:y,onOpenChange:j=>{!j&&!p&&u(null)}}),r.jsx(ax,{toast:s,onDismiss:l})]})}function jz({view:e,onRenameError:t,onRequestDelete:n}){const s=Ct(),[i,l]=f.useState(!1),[c,u]=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||u(e.name)},[e.name,i]);async function x(){const j=c.trim();if(!j||j===e.name){u(e.name),l(!1);return}m(!0);try{await pg(e.id,{name:j}),l(!1)}catch(w){t(w instanceof Error?w.message:"Failed to rename saved view")}finally{m(!1)}}function y(){u(e.name),l(!1)}const b=wF(e.config.filters),C=e.workspace?yn(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=>u(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(Bo,{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:wz[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:b})]}),r.jsxs("div",{className:"flex shrink-0 items-center gap-2",children:[r.jsx("button",{type:"button",onClick:()=>s(rN(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 kz(){return r.jsx(U2,{children:r.jsx(nA,{children:r.jsx(x2,{children:r.jsxs(ze,{element:r.jsx(kA,{}),children:[r.jsx(ze,{path:"/",element:r.jsx(nL,{})}),r.jsx(ze,{path:"/projects",element:r.jsx(Mv,{})}),r.jsx(ze,{path:"/assignments",element:r.jsx(Zw,{})}),r.jsx(ze,{path:"/assignments/new",element:r.jsx(rj,{})}),r.jsx(ze,{path:"/assignments/:id",element:r.jsx(KF,{})}),r.jsx(ze,{path:"/assignments/:id/edit",element:r.jsx(Im,{})}),r.jsx(ze,{path:"/assignments/:id/plan/edit",element:r.jsx(Om,{})}),r.jsx(ze,{path:"/assignments/:id/scratchpad/edit",element:r.jsx(Mm,{})}),r.jsx(ze,{path:"/assignments/:id/handoff/edit",element:r.jsx(_m,{})}),r.jsx(ze,{path:"/assignments/:id/decision-record/edit",element:r.jsx(Fm,{})}),r.jsx(ze,{path:"/servers",element:r.jsx(oj,{})}),r.jsx(ze,{path:"/inventories",element:r.jsx(ij,{})}),r.jsx(ze,{path:"/usage",element:r.jsx(aj,{})}),r.jsx(ze,{path:"/agent-sessions",element:r.jsx(lj,{})}),r.jsx(ze,{path:"/playbooks",element:r.jsx(S6,{})}),r.jsx(ze,{path:"/playbooks/create",element:r.jsx(C6,{})}),r.jsx(ze,{path:"/playbooks/:slug",element:r.jsx(N6,{})}),r.jsx(ze,{path:"/playbooks/:slug/edit",element:r.jsx(E6,{})}),r.jsx(ze,{path:"/memories",element:r.jsx(T6,{})}),r.jsx(ze,{path:"/memories/new",element:r.jsx(R6,{})}),r.jsx(ze,{path:"/projects/:slug/memories/:itemSlug",element:r.jsx(P6,{})}),r.jsx(ze,{path:"/projects/:slug/memories/:itemSlug/edit",element:r.jsx(A6,{})}),r.jsx(ze,{path:"/resources",element:r.jsx(D6,{})}),r.jsx(ze,{path:"/resources/new",element:r.jsx($6,{})}),r.jsx(ze,{path:"/projects/:slug/resources/:itemSlug",element:r.jsx(L6,{})}),r.jsx(ze,{path:"/projects/:slug/resources/:itemSlug/edit",element:r.jsx(I6,{})}),r.jsx(ze,{path:"/todos",element:r.jsx(gz,{})}),r.jsx(ze,{path:"/views",element:r.jsx(pj,{})}),r.jsx(ze,{path:"/help",element:r.jsx(sL,{})}),r.jsx(ze,{path:"/settings",element:r.jsx(hz,{})}),r.jsx(ze,{path:"/create/project",element:r.jsx(tj,{})}),r.jsx(ze,{path:"/projects/:slug",element:r.jsx(Gw,{})}),r.jsx(ze,{path:"/projects/:slug/edit",element:r.jsx(sj,{})}),r.jsx(ze,{path:"/projects/:slug/create/assignment",element:r.jsx(nj,{})}),r.jsx(ze,{path:"/projects/:slug/assignments/:aslug",element:r.jsx(Jw,{})}),r.jsx(ze,{path:"/projects/:slug/assignments/:aslug/edit",element:r.jsx(Im,{})}),r.jsx(ze,{path:"/projects/:slug/assignments/:aslug/plan/edit",element:r.jsx(Om,{})}),r.jsx(ze,{path:"/projects/:slug/assignments/:aslug/scratchpad/edit",element:r.jsx(Mm,{})}),r.jsx(ze,{path:"/projects/:slug/assignments/:aslug/handoff/edit",element:r.jsx(_m,{})}),r.jsx(ze,{path:"/projects/:slug/assignments/:aslug/decision-record/edit",element:r.jsx(Fm,{})}),r.jsx(ze,{path:"/w/:workspace/projects",element:r.jsx(Mv,{})}),r.jsx(ze,{path:"/w/:workspace/assignments",element:r.jsx(Zw,{})}),r.jsx(ze,{path:"/w/:workspace/assignments/new",element:r.jsx(rj,{})}),r.jsx(ze,{path:"/w/:workspace/servers",element:r.jsx(oj,{})}),r.jsx(ze,{path:"/w/:workspace/inventories",element:r.jsx(ij,{})}),r.jsx(ze,{path:"/w/:workspace/usage",element:r.jsx(aj,{})}),r.jsx(ze,{path:"/w/:workspace/agent-sessions",element:r.jsx(lj,{})}),r.jsx(ze,{path:"/w/:workspace/todos",element:r.jsx(cF,{})}),r.jsx(ze,{path:"/w/:workspace/views",element:r.jsx(pj,{})}),r.jsx(ze,{path:"/w/:workspace/create/project",element:r.jsx(tj,{})}),r.jsx(ze,{path:"/w/:workspace/projects/:slug",element:r.jsx(Gw,{})}),r.jsx(ze,{path:"/w/:workspace/projects/:slug/edit",element:r.jsx(sj,{})}),r.jsx(ze,{path:"/w/:workspace/projects/:slug/create/assignment",element:r.jsx(nj,{})}),r.jsx(ze,{path:"/w/:workspace/projects/:slug/assignments/:aslug",element:r.jsx(Jw,{})}),r.jsx(ze,{path:"/w/:workspace/projects/:slug/assignments/:aslug/edit",element:r.jsx(Im,{})}),r.jsx(ze,{path:"/w/:workspace/projects/:slug/assignments/:aslug/plan/edit",element:r.jsx(Om,{})}),r.jsx(ze,{path:"/w/:workspace/projects/:slug/assignments/:aslug/scratchpad/edit",element:r.jsx(Mm,{})}),r.jsx(ze,{path:"/w/:workspace/projects/:slug/assignments/:aslug/handoff/edit",element:r.jsx(_m,{})}),r.jsx(ze,{path:"/w/:workspace/projects/:slug/assignments/:aslug/decision-record/edit",element:r.jsx(Fm,{})})]})})})})}vP();xE.createRoot(document.getElementById("root")).render(r.jsx(f.StrictMode,{children:r.jsx(wP,{children:r.jsx(kz,{})})}));export{UL as _,Nz as a,fd as g};
|