@vibeflow-tools/cli 0.5.0 → 0.5.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +7 -0
- package/dist/chunk-IZB3AHO6.js +6 -0
- package/dist/chunk-QULSJOW5.js +7 -0
- package/dist/chunk-TPDIOJDI.js +7 -0
- package/dist/cli/chunk-IZB3AHO6.js +6 -0
- package/dist/cli/chunk-QULSJOW5.js +7 -0
- package/dist/cli/chunk-TPDIOJDI.js +7 -0
- package/dist/cli/files-H2UIFEPJ.js +2 -0
- package/dist/cli/files-JPVPKRMX.js +2 -0
- package/dist/cli/files-MIDXKOAF.js +2 -0
- package/dist/cli/index.js +337 -150
- package/dist/client/kanban-browser.js +23 -12
- package/dist/client/kanban.css +1 -1
- package/dist/client/overlay-browser.js +5 -4
- package/dist/files-H2UIFEPJ.js +2 -0
- package/dist/files-JPVPKRMX.js +2 -0
- package/dist/files-MIDXKOAF.js +2 -0
- package/dist/index.js +337 -150
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import{a as B,b as
|
|
3
|
-
`+
|
|
4
|
-
`+r}import{watch as
|
|
2
|
+
import{a as B,b as Ne,c as Le,d as Sn,e as En,f as Fe,g as Pn,h as le,i as Ee,j as ue,k as ie,l as de,m as V,n as je,o as nn,p as De,q as He,r as In,t as te,u as Tn,v as _n,w as Rn,x as tn}from"./chunk-TPDIOJDI.js";import{a as re,b as Nn,c as Ln}from"./chunk-KJ5LYG6A.js";import{Command as Eo}from"commander";import{execSync as Cn,execFileSync as Ze}from"child_process";import{readFileSync as Tr,readdirSync as _r,statSync as Rr,existsSync as yn,writeFileSync as rt,mkdirSync as ot,unlinkSync as ct}from"fs";import{createRequire as Nr}from"module";import{join as oe,resolve as Lr,basename as ce,extname as dt,dirname as Fr}from"path";import{createServer as pt}from"http";import{spawn as at,execSync as Oe}from"child_process";import{networkInterfaces as Dr}from"os";import fe from"express";import{WebSocketServer as ft,WebSocket as mt}from"ws";import y from"chalk";import{createExpressMiddleware as Ar}from"@trpc/server/adapters/express";import*as Kt from"cheerio";import{readdirSync as Fo,statSync as Do}from"fs";import{join as Oo,extname as Mo}from"path";function Fn(n,e){let r=`<script data-vibeflow-overlay>${e}</script>`,u=n.lastIndexOf("</body>");return u!==-1?n.slice(0,u)+r+`
|
|
3
|
+
`+n.slice(u):n+`
|
|
4
|
+
`+r}import{watch as Qt}from"chokidar";function rn(n,e){let r=Qt(n,{persistent:!0,ignoreInitial:!0,awaitWriteFinish:{stabilityThreshold:200,pollInterval:50}});return r.on("change",u=>{e.onChange(u)}),e.onAdd&&r.on("add",e.onAdd),e.onUnlink&&r.on("unlink",e.onUnlink),r}function on(n,e){return rn(n,{onChange:e.onChanged,onAdd:e.onChanged,onUnlink:e.onDeleted})}var an=`"use strict";
|
|
5
5
|
(() => {
|
|
6
6
|
var __create = Object.create;
|
|
7
7
|
var __defProp = Object.defineProperty;
|
|
@@ -1922,7 +1922,7 @@ import{a as B,b as Ie,c as Te,d as xn,e as Cn,f as _e,g as Sn,h as ue,i as Ce,j
|
|
|
1922
1922
|
if (true) {
|
|
1923
1923
|
(function() {
|
|
1924
1924
|
"use strict";
|
|
1925
|
-
var
|
|
1925
|
+
var React25 = require_react();
|
|
1926
1926
|
var REACT_ELEMENT_TYPE = /* @__PURE__ */ Symbol.for("react.element");
|
|
1927
1927
|
var REACT_PORTAL_TYPE = /* @__PURE__ */ Symbol.for("react.portal");
|
|
1928
1928
|
var REACT_FRAGMENT_TYPE = /* @__PURE__ */ Symbol.for("react.fragment");
|
|
@@ -1948,7 +1948,7 @@ import{a as B,b as Ie,c as Te,d as xn,e as Cn,f as _e,g as Sn,h as ue,i as Ce,j
|
|
|
1948
1948
|
}
|
|
1949
1949
|
return null;
|
|
1950
1950
|
}
|
|
1951
|
-
var ReactSharedInternals =
|
|
1951
|
+
var ReactSharedInternals = React25.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
|
|
1952
1952
|
function error(format) {
|
|
1953
1953
|
{
|
|
1954
1954
|
{
|
|
@@ -2798,11 +2798,11 @@ import{a as B,b as Ie,c as Te,d as xn,e as Cn,f as _e,g as Sn,h as ue,i as Ce,j
|
|
|
2798
2798
|
return jsxWithValidation(type, props, key, false);
|
|
2799
2799
|
}
|
|
2800
2800
|
}
|
|
2801
|
-
var
|
|
2802
|
-
var
|
|
2801
|
+
var jsx33 = jsxWithValidationDynamic;
|
|
2802
|
+
var jsxs28 = jsxWithValidationStatic;
|
|
2803
2803
|
exports.Fragment = REACT_FRAGMENT_TYPE;
|
|
2804
|
-
exports.jsx =
|
|
2805
|
-
exports.jsxs =
|
|
2804
|
+
exports.jsx = jsx33;
|
|
2805
|
+
exports.jsxs = jsxs28;
|
|
2806
2806
|
})();
|
|
2807
2807
|
}
|
|
2808
2808
|
}
|
|
@@ -3292,9 +3292,9 @@ import{a as B,b as Ie,c as Te,d as xn,e as Cn,f as _e,g as Sn,h as ue,i as Ce,j
|
|
|
3292
3292
|
if (typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ !== "undefined" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart === "function") {
|
|
3293
3293
|
__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error());
|
|
3294
3294
|
}
|
|
3295
|
-
var
|
|
3295
|
+
var React25 = require_react();
|
|
3296
3296
|
var Scheduler = require_scheduler();
|
|
3297
|
-
var ReactSharedInternals =
|
|
3297
|
+
var ReactSharedInternals = React25.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
|
|
3298
3298
|
var suppressWarning = false;
|
|
3299
3299
|
function setSuppressWarning(newSuppressWarning) {
|
|
3300
3300
|
{
|
|
@@ -3343,7 +3343,7 @@ import{a as B,b as Ie,c as Te,d as xn,e as Cn,f as _e,g as Sn,h as ue,i as Ce,j
|
|
|
3343
3343
|
var HostPortal = 4;
|
|
3344
3344
|
var HostComponent = 5;
|
|
3345
3345
|
var HostText = 6;
|
|
3346
|
-
var
|
|
3346
|
+
var Fragment10 = 7;
|
|
3347
3347
|
var Mode = 8;
|
|
3348
3348
|
var ContextConsumer = 9;
|
|
3349
3349
|
var ContextProvider = 10;
|
|
@@ -4500,7 +4500,7 @@ import{a as B,b as Ie,c as Te,d as xn,e as Cn,f as _e,g as Sn,h as ue,i as Ce,j
|
|
|
4500
4500
|
return "DehydratedFragment";
|
|
4501
4501
|
case ForwardRef:
|
|
4502
4502
|
return getWrappedName$1(type, type.render, "ForwardRef");
|
|
4503
|
-
case
|
|
4503
|
+
case Fragment10:
|
|
4504
4504
|
return "Fragment";
|
|
4505
4505
|
case HostComponent:
|
|
4506
4506
|
return type;
|
|
@@ -4901,7 +4901,7 @@ import{a as B,b as Ie,c as Te,d as xn,e as Cn,f as _e,g as Sn,h as ue,i as Ce,j
|
|
|
4901
4901
|
{
|
|
4902
4902
|
if (props.value == null) {
|
|
4903
4903
|
if (typeof props.children === "object" && props.children !== null) {
|
|
4904
|
-
|
|
4904
|
+
React25.Children.forEach(props.children, function(child) {
|
|
4905
4905
|
if (child == null) {
|
|
4906
4906
|
return;
|
|
4907
4907
|
}
|
|
@@ -12929,7 +12929,7 @@ import{a as B,b as Ie,c as Te,d as xn,e as Cn,f as _e,g as Sn,h as ue,i as Ce,j
|
|
|
12929
12929
|
}
|
|
12930
12930
|
}
|
|
12931
12931
|
function updateFragment2(returnFiber, current2, fragment, lanes, key) {
|
|
12932
|
-
if (current2 === null || current2.tag !==
|
|
12932
|
+
if (current2 === null || current2.tag !== Fragment10) {
|
|
12933
12933
|
var created = createFiberFromFragment(fragment, returnFiber.mode, lanes, key);
|
|
12934
12934
|
created.return = returnFiber;
|
|
12935
12935
|
return created;
|
|
@@ -13332,7 +13332,7 @@ import{a as B,b as Ie,c as Te,d as xn,e as Cn,f as _e,g as Sn,h as ue,i as Ce,j
|
|
|
13332
13332
|
if (child.key === key) {
|
|
13333
13333
|
var elementType = element.type;
|
|
13334
13334
|
if (elementType === REACT_FRAGMENT_TYPE) {
|
|
13335
|
-
if (child.tag ===
|
|
13335
|
+
if (child.tag === Fragment10) {
|
|
13336
13336
|
deleteRemainingChildren(returnFiber, child.sibling);
|
|
13337
13337
|
var existing = useFiber(child, element.props.children);
|
|
13338
13338
|
existing.return = returnFiber;
|
|
@@ -18808,7 +18808,7 @@ import{a as B,b as Ie,c as Te,d as xn,e as Cn,f as _e,g as Sn,h as ue,i as Ce,j
|
|
|
18808
18808
|
var _resolvedProps2 = workInProgress2.elementType === type ? _unresolvedProps2 : resolveDefaultProps(type, _unresolvedProps2);
|
|
18809
18809
|
return updateForwardRef(current2, workInProgress2, type, _resolvedProps2, renderLanes2);
|
|
18810
18810
|
}
|
|
18811
|
-
case
|
|
18811
|
+
case Fragment10:
|
|
18812
18812
|
return updateFragment(current2, workInProgress2, renderLanes2);
|
|
18813
18813
|
case Mode:
|
|
18814
18814
|
return updateMode(current2, workInProgress2, renderLanes2);
|
|
@@ -19080,7 +19080,7 @@ import{a as B,b as Ie,c as Te,d as xn,e as Cn,f as _e,g as Sn,h as ue,i as Ce,j
|
|
|
19080
19080
|
case SimpleMemoComponent:
|
|
19081
19081
|
case FunctionComponent:
|
|
19082
19082
|
case ForwardRef:
|
|
19083
|
-
case
|
|
19083
|
+
case Fragment10:
|
|
19084
19084
|
case Mode:
|
|
19085
19085
|
case Profiler:
|
|
19086
19086
|
case ContextConsumer:
|
|
@@ -23341,7 +23341,7 @@ import{a as B,b as Ie,c as Te,d as xn,e as Cn,f as _e,g as Sn,h as ue,i as Ce,j
|
|
|
23341
23341
|
return fiber;
|
|
23342
23342
|
}
|
|
23343
23343
|
function createFiberFromFragment(elements, mode, lanes, key) {
|
|
23344
|
-
var fiber = createFiber(
|
|
23344
|
+
var fiber = createFiber(Fragment10, elements, key, mode);
|
|
23345
23345
|
fiber.lanes = lanes;
|
|
23346
23346
|
return fiber;
|
|
23347
23347
|
}
|
|
@@ -23518,7 +23518,7 @@ import{a as B,b as Ie,c as Te,d as xn,e as Cn,f as _e,g as Sn,h as ue,i as Ce,j
|
|
|
23518
23518
|
return root2;
|
|
23519
23519
|
}
|
|
23520
23520
|
var ReactVersion = "18.3.1";
|
|
23521
|
-
function
|
|
23521
|
+
function createPortal4(children, containerInfo, implementation) {
|
|
23522
23522
|
var key = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : null;
|
|
23523
23523
|
{
|
|
23524
23524
|
checkKeyStringCoercion(key);
|
|
@@ -24375,7 +24375,7 @@ import{a as B,b as Ie,c as Te,d as xn,e as Cn,f as _e,g as Sn,h as ue,i as Ce,j
|
|
|
24375
24375
|
if (!isValidContainer(container)) {
|
|
24376
24376
|
throw new Error("Target container is not a DOM element.");
|
|
24377
24377
|
}
|
|
24378
|
-
return
|
|
24378
|
+
return createPortal4(children, container, null, key);
|
|
24379
24379
|
}
|
|
24380
24380
|
function renderSubtreeIntoContainer(parentComponent, element, containerNode, callback) {
|
|
24381
24381
|
return unstable_renderSubtreeIntoContainer(parentComponent, element, containerNode, callback);
|
|
@@ -26772,7 +26772,7 @@ import{a as B,b as Ie,c as Te,d as xn,e as Cn,f as _e,g as Sn,h as ue,i as Ce,j
|
|
|
26772
26772
|
}
|
|
26773
26773
|
|
|
26774
26774
|
// src/client/overlay-react/OverlayApp.tsx
|
|
26775
|
-
var
|
|
26775
|
+
var import_react25 = __toESM(require_react(), 1);
|
|
26776
26776
|
|
|
26777
26777
|
// ../ui/src/VibeflowIcon.tsx
|
|
26778
26778
|
var import_jsx_runtime = __toESM(require_jsx_runtime(), 1);
|
|
@@ -26851,6 +26851,16 @@ import{a as B,b as Ie,c as Te,d as xn,e as Cn,f as _e,g as Sn,h as ue,i as Ce,j
|
|
|
26851
26851
|
return Component;
|
|
26852
26852
|
};
|
|
26853
26853
|
|
|
26854
|
+
// ../../node_modules/.pnpm/lucide-react@0.468.0_react@18.3.1/node_modules/lucide-react/dist/esm/icons/bot.js
|
|
26855
|
+
var Bot = createLucideIcon("Bot", [
|
|
26856
|
+
["path", { d: "M12 8V4H8", key: "hb8ula" }],
|
|
26857
|
+
["rect", { width: "16", height: "12", x: "4", y: "8", rx: "2", key: "enze0r" }],
|
|
26858
|
+
["path", { d: "M2 14h2", key: "vft8re" }],
|
|
26859
|
+
["path", { d: "M20 14h2", key: "4cs60a" }],
|
|
26860
|
+
["path", { d: "M15 13v2", key: "1xurst" }],
|
|
26861
|
+
["path", { d: "M9 13v2", key: "rq6x2g" }]
|
|
26862
|
+
]);
|
|
26863
|
+
|
|
26854
26864
|
// ../../node_modules/.pnpm/lucide-react@0.468.0_react@18.3.1/node_modules/lucide-react/dist/esm/icons/circle-check-big.js
|
|
26855
26865
|
var CircleCheckBig = createLucideIcon("CircleCheckBig", [
|
|
26856
26866
|
["path", { d: "M21.801 10A10 10 0 1 1 17 3.335", key: "yps3ct" }],
|
|
@@ -27363,7 +27373,19 @@ import{a as B,b as Ie,c as Te,d as xn,e as Cn,f as _e,g as Sn,h as ue,i as Ce,j
|
|
|
27363
27373
|
var THUMB_IMG_STYLE = { width: 52, height: 34, borderRadius: 6, objectFit: "cover", border: "1px solid color-mix(in srgb, var(--p-border) 90%, transparent)", display: "block", cursor: "pointer" };
|
|
27364
27374
|
var CARD_FOOTER_STYLE = { display: "flex", alignItems: "center", gap: 2, marginTop: 1 };
|
|
27365
27375
|
var SPACER_STYLE = { flex: 1 };
|
|
27366
|
-
var TaskCard = import_react7.default.memo(function TaskCard2({
|
|
27376
|
+
var TaskCard = import_react7.default.memo(function TaskCard2({
|
|
27377
|
+
task,
|
|
27378
|
+
col,
|
|
27379
|
+
liveActivity,
|
|
27380
|
+
onOpen,
|
|
27381
|
+
onDragStart,
|
|
27382
|
+
selectMode,
|
|
27383
|
+
selected,
|
|
27384
|
+
onToggleSelect,
|
|
27385
|
+
agentStatus,
|
|
27386
|
+
experimentalAgents,
|
|
27387
|
+
multiDragCount
|
|
27388
|
+
}) {
|
|
27367
27389
|
var _a;
|
|
27368
27390
|
const isInProgress = col.id === "in-progress";
|
|
27369
27391
|
const isDone = col.id === "done";
|
|
@@ -27385,6 +27407,20 @@ import{a as B,b as Ie,c as Te,d as xn,e as Cn,f as _e,g as Sn,h as ue,i as Ce,j
|
|
|
27385
27407
|
function handleDragEnd(e) {
|
|
27386
27408
|
e.currentTarget.classList.remove("dragging");
|
|
27387
27409
|
}
|
|
27410
|
+
function handleClick(e) {
|
|
27411
|
+
if (selectMode) {
|
|
27412
|
+
e.stopPropagation();
|
|
27413
|
+
onToggleSelect == null ? void 0 : onToggleSelect(task.id);
|
|
27414
|
+
return;
|
|
27415
|
+
}
|
|
27416
|
+
onOpen(task);
|
|
27417
|
+
}
|
|
27418
|
+
function handleCheckboxClick(e) {
|
|
27419
|
+
e.stopPropagation();
|
|
27420
|
+
onToggleSelect == null ? void 0 : onToggleSelect(task.id);
|
|
27421
|
+
}
|
|
27422
|
+
const agentBorder = experimentalAgents === true && agentStatus === "running" ? "1px solid rgba(59,130,246,0.5)" : experimentalAgents === true && agentStatus === "queued" ? "1px solid color-mix(in srgb, var(--p-amber) 45%, transparent)" : experimentalAgents === true && agentStatus === "done" ? "1px solid color-mix(in srgb, var(--p-green) 40%, transparent)" : void 0;
|
|
27423
|
+
const agentBg = experimentalAgents === true && agentStatus === "running" ? "color-mix(in srgb, var(--p-blue) 6%, var(--p-card))" : experimentalAgents === true && agentStatus === "queued" ? "color-mix(in srgb, var(--p-amber) 5%, var(--p-card))" : experimentalAgents === true && agentStatus === "done" ? "color-mix(in srgb, var(--p-green) 5%, var(--p-card))" : void 0;
|
|
27388
27424
|
if (isDone) {
|
|
27389
27425
|
return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
27390
27426
|
"article",
|
|
@@ -27392,13 +27428,48 @@ import{a as B,b as Ie,c as Te,d as xn,e as Cn,f as _e,g as Sn,h as ue,i as Ce,j
|
|
|
27392
27428
|
className: "task-card",
|
|
27393
27429
|
draggable: true,
|
|
27394
27430
|
"data-task-id": task.id,
|
|
27395
|
-
style:
|
|
27431
|
+
style: {
|
|
27432
|
+
...DONE_ARTICLE_STYLE,
|
|
27433
|
+
...selectMode && selected ? { borderColor: "var(--p-blue)", background: "color-mix(in srgb, var(--p-blue) 10%, var(--p-card))" } : {}
|
|
27434
|
+
},
|
|
27396
27435
|
onDragStart: handleDragStart,
|
|
27397
27436
|
onDragEnd: handleDragEnd,
|
|
27398
|
-
onClick:
|
|
27437
|
+
onClick: handleClick,
|
|
27399
27438
|
children: /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { style: DONE_INNER_ROW_STYLE, children: [
|
|
27439
|
+
selectMode && /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
27440
|
+
"span",
|
|
27441
|
+
{
|
|
27442
|
+
onClick: handleCheckboxClick,
|
|
27443
|
+
style: {
|
|
27444
|
+
width: 12,
|
|
27445
|
+
height: 12,
|
|
27446
|
+
borderRadius: 3,
|
|
27447
|
+
border: selected ? "1px solid var(--p-blue)" : "1px solid var(--p-border-s)",
|
|
27448
|
+
background: selected ? "var(--p-blue)" : "var(--p-input)",
|
|
27449
|
+
flexShrink: 0,
|
|
27450
|
+
cursor: "pointer",
|
|
27451
|
+
display: "inline-flex",
|
|
27452
|
+
alignItems: "center",
|
|
27453
|
+
justifyContent: "center"
|
|
27454
|
+
},
|
|
27455
|
+
children: selected && /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("span", { style: { color: "#fff", fontSize: 9, fontWeight: 700 }, children: "\\u2713" })
|
|
27456
|
+
}
|
|
27457
|
+
),
|
|
27400
27458
|
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(CircleCheckBig, { style: DONE_CHECK_ICON_STYLE }),
|
|
27401
|
-
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("span", { style: DONE_TITLE_STYLE, children: task.title })
|
|
27459
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("span", { style: DONE_TITLE_STYLE, children: task.title }),
|
|
27460
|
+
multiDragCount != null && /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("span", { style: {
|
|
27461
|
+
fontSize: 9,
|
|
27462
|
+
fontWeight: 700,
|
|
27463
|
+
padding: "1px 5px",
|
|
27464
|
+
borderRadius: 4,
|
|
27465
|
+
background: "var(--p-blue)",
|
|
27466
|
+
color: "#fff",
|
|
27467
|
+
flexShrink: 0,
|
|
27468
|
+
marginLeft: 4
|
|
27469
|
+
}, children: [
|
|
27470
|
+
"+",
|
|
27471
|
+
multiDragCount - 1
|
|
27472
|
+
] })
|
|
27402
27473
|
] })
|
|
27403
27474
|
}
|
|
27404
27475
|
);
|
|
@@ -27413,16 +27484,52 @@ import{a as B,b as Ie,c as Te,d as xn,e as Cn,f as _e,g as Sn,h as ue,i as Ce,j
|
|
|
27413
27484
|
padding: "7px 8px",
|
|
27414
27485
|
gap: 4,
|
|
27415
27486
|
userSelect: "none",
|
|
27416
|
-
background: liveActivity ? "rgba(59,130,246,0.08)" : cardBgColor,
|
|
27417
|
-
|
|
27487
|
+
background: liveActivity ? "rgba(59,130,246,0.08)" : agentBg ?? cardBgColor,
|
|
27488
|
+
border: agentBorder ?? (liveActivity ? "1px solid rgba(59,130,246,0.5)" : cardBorderColor ? \`1px solid \${cardBorderColor}\` : void 0),
|
|
27489
|
+
...liveActivity ? { boxShadow: "0 0 0 2px rgba(59,130,246,0.14)" } : {},
|
|
27490
|
+
...selectMode && selected ? { borderColor: "var(--p-blue)", background: "color-mix(in srgb, var(--p-blue) 10%, var(--p-card))" } : {}
|
|
27418
27491
|
},
|
|
27419
27492
|
onDragStart: handleDragStart,
|
|
27420
27493
|
onDragEnd: handleDragEnd,
|
|
27421
|
-
onClick:
|
|
27494
|
+
onClick: handleClick,
|
|
27422
27495
|
children: [
|
|
27423
27496
|
/* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { style: CARD_TITLE_ROW_STYLE, children: [
|
|
27497
|
+
selectMode && /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
27498
|
+
"span",
|
|
27499
|
+
{
|
|
27500
|
+
onClick: handleCheckboxClick,
|
|
27501
|
+
style: {
|
|
27502
|
+
width: 14,
|
|
27503
|
+
height: 14,
|
|
27504
|
+
borderRadius: 3,
|
|
27505
|
+
border: selected ? "1px solid var(--p-blue)" : "1px solid var(--p-border-s)",
|
|
27506
|
+
background: selected ? "var(--p-blue)" : "var(--p-input)",
|
|
27507
|
+
flexShrink: 0,
|
|
27508
|
+
cursor: "pointer",
|
|
27509
|
+
display: "inline-flex",
|
|
27510
|
+
alignItems: "center",
|
|
27511
|
+
justifyContent: "center",
|
|
27512
|
+
marginRight: 2
|
|
27513
|
+
},
|
|
27514
|
+
children: selected && /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("span", { style: { color: "#fff", fontSize: 9, fontWeight: 700 }, children: "\\u2713" })
|
|
27515
|
+
}
|
|
27516
|
+
),
|
|
27424
27517
|
isInProgress && /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("span", { className: "spinner", style: SPINNER_SHRINK_STYLE }),
|
|
27425
|
-
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("span", {
|
|
27518
|
+
experimentalAgents === true && agentStatus === "running" && !isInProgress && /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("span", { className: "spinner", style: SPINNER_SHRINK_STYLE }),
|
|
27519
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("span", { style: CARD_TITLE_TEXT_STYLE, children: task.title }),
|
|
27520
|
+
multiDragCount != null && /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("span", { style: {
|
|
27521
|
+
fontSize: 9,
|
|
27522
|
+
fontWeight: 700,
|
|
27523
|
+
padding: "1px 5px",
|
|
27524
|
+
borderRadius: 4,
|
|
27525
|
+
background: "var(--p-blue)",
|
|
27526
|
+
color: "#fff",
|
|
27527
|
+
flexShrink: 0,
|
|
27528
|
+
marginLeft: 4
|
|
27529
|
+
}, children: [
|
|
27530
|
+
"+",
|
|
27531
|
+
multiDragCount - 1
|
|
27532
|
+
] })
|
|
27426
27533
|
] }),
|
|
27427
27534
|
(task.description || thumbnailUrl) && /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { style: DESC_THUMB_ROW_STYLE, children: [
|
|
27428
27535
|
task.description && /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("div", { style: DESC_TEXT_STYLE, children: task.description }),
|
|
@@ -27484,6 +27591,72 @@ import{a as B,b as Ie,c as Te,d as xn,e as Cn,f as _e,g as Sn,h as ue,i as Ce,j
|
|
|
27484
27591
|
/* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { className: "flex items-center", style: CARD_FOOTER_STYLE, children: [
|
|
27485
27592
|
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(TypeBadge, { type: task.type }),
|
|
27486
27593
|
task.priority && /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(PriorityBadge, { priority: task.priority }),
|
|
27594
|
+
experimentalAgents === true && agentStatus === "running" && /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("span", { style: {
|
|
27595
|
+
display: "inline-flex",
|
|
27596
|
+
alignItems: "center",
|
|
27597
|
+
gap: 3,
|
|
27598
|
+
fontSize: 10,
|
|
27599
|
+
fontWeight: 600,
|
|
27600
|
+
padding: "1px 6px",
|
|
27601
|
+
borderRadius: 6,
|
|
27602
|
+
background: "rgba(59,130,246,0.12)",
|
|
27603
|
+
color: "#60a5fa",
|
|
27604
|
+
whiteSpace: "nowrap",
|
|
27605
|
+
overflow: "hidden",
|
|
27606
|
+
textOverflow: "ellipsis",
|
|
27607
|
+
maxWidth: 90
|
|
27608
|
+
}, children: [
|
|
27609
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("span", { className: "spinner", style: { width: 8, height: 8, borderWidth: 1.5 } }),
|
|
27610
|
+
"Agent"
|
|
27611
|
+
] }),
|
|
27612
|
+
experimentalAgents === true && agentStatus === "queued" && /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("span", { style: {
|
|
27613
|
+
display: "inline-flex",
|
|
27614
|
+
alignItems: "center",
|
|
27615
|
+
gap: 3,
|
|
27616
|
+
fontSize: 10,
|
|
27617
|
+
fontWeight: 600,
|
|
27618
|
+
padding: "1px 6px",
|
|
27619
|
+
borderRadius: 6,
|
|
27620
|
+
background: "rgba(245,158,11,0.12)",
|
|
27621
|
+
color: "var(--p-amber)",
|
|
27622
|
+
whiteSpace: "nowrap",
|
|
27623
|
+
overflow: "hidden",
|
|
27624
|
+
textOverflow: "ellipsis",
|
|
27625
|
+
maxWidth: 90
|
|
27626
|
+
}, children: "\\u23F3 Queued" }),
|
|
27627
|
+
experimentalAgents === true && agentStatus === "done" && /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("span", { style: {
|
|
27628
|
+
display: "inline-flex",
|
|
27629
|
+
alignItems: "center",
|
|
27630
|
+
gap: 3,
|
|
27631
|
+
fontSize: 10,
|
|
27632
|
+
fontWeight: 600,
|
|
27633
|
+
padding: "1px 6px",
|
|
27634
|
+
borderRadius: 6,
|
|
27635
|
+
background: "rgba(34,197,94,0.12)",
|
|
27636
|
+
color: "var(--p-green)",
|
|
27637
|
+
whiteSpace: "nowrap",
|
|
27638
|
+
overflow: "hidden",
|
|
27639
|
+
textOverflow: "ellipsis",
|
|
27640
|
+
maxWidth: 90
|
|
27641
|
+
}, children: "\\u2713 Done" }),
|
|
27642
|
+
experimentalAgents === true && !agentStatus && task.agent && /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("span", { style: {
|
|
27643
|
+
display: "inline-flex",
|
|
27644
|
+
alignItems: "center",
|
|
27645
|
+
gap: 3,
|
|
27646
|
+
fontSize: 10,
|
|
27647
|
+
fontWeight: 600,
|
|
27648
|
+
padding: "1px 6px",
|
|
27649
|
+
borderRadius: 6,
|
|
27650
|
+
background: "rgba(139,92,246,0.12)",
|
|
27651
|
+
color: "#a78bfa",
|
|
27652
|
+
whiteSpace: "nowrap",
|
|
27653
|
+
overflow: "hidden",
|
|
27654
|
+
textOverflow: "ellipsis",
|
|
27655
|
+
maxWidth: 90
|
|
27656
|
+
}, title: \`Agent: \${task.agent}\`, children: [
|
|
27657
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(Bot, { style: { width: 8, height: 8, flexShrink: 0 } }),
|
|
27658
|
+
"Agent"
|
|
27659
|
+
] }),
|
|
27487
27660
|
isInProgress && task.assigneeName && /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("span", { style: {
|
|
27488
27661
|
fontSize: 10,
|
|
27489
27662
|
fontWeight: 600,
|
|
@@ -27624,7 +27797,7 @@ import{a as B,b as Ie,c as Te,d as xn,e as Cn,f as _e,g as Sn,h as ue,i as Ce,j
|
|
|
27624
27797
|
var import_jsx_runtime15 = __toESM(require_jsx_runtime(), 1);
|
|
27625
27798
|
|
|
27626
27799
|
// ../ui/src/kanban/components/DetailPanel.tsx
|
|
27627
|
-
var
|
|
27800
|
+
var import_react20 = __toESM(require_react(), 1);
|
|
27628
27801
|
|
|
27629
27802
|
// ../ui/src/kanban/components/shared/CommentsList.tsx
|
|
27630
27803
|
var import_react14 = __toESM(require_react(), 1);
|
|
@@ -27718,22 +27891,31 @@ import{a as B,b as Ie,c as Te,d as xn,e as Cn,f as _e,g as Sn,h as ue,i as Ce,j
|
|
|
27718
27891
|
// ../ui/src/kanban/components/shared/CommentsInputArea.tsx
|
|
27719
27892
|
var import_jsx_runtime25 = __toESM(require_jsx_runtime(), 1);
|
|
27720
27893
|
|
|
27721
|
-
// ../ui/src/kanban/components/
|
|
27894
|
+
// ../ui/src/kanban/components/AgentTab.tsx
|
|
27895
|
+
var import_react19 = __toESM(require_react(), 1);
|
|
27896
|
+
var import_react_dom4 = __toESM(require_react_dom(), 1);
|
|
27722
27897
|
var import_jsx_runtime26 = __toESM(require_jsx_runtime(), 1);
|
|
27723
|
-
var MAX_UPLOAD_BYTES = 5 * 1024 * 1024;
|
|
27724
27898
|
|
|
27725
|
-
// ../ui/src/kanban/components/
|
|
27726
|
-
var import_react20 = __toESM(require_react(), 1);
|
|
27899
|
+
// ../ui/src/kanban/components/DetailPanel.tsx
|
|
27727
27900
|
var import_jsx_runtime27 = __toESM(require_jsx_runtime(), 1);
|
|
27901
|
+
var MAX_UPLOAD_BYTES = 5 * 1024 * 1024;
|
|
27728
27902
|
|
|
27729
|
-
// ../ui/src/kanban/components/
|
|
27903
|
+
// ../ui/src/kanban/components/FilterBar.tsx
|
|
27730
27904
|
var import_react21 = __toESM(require_react(), 1);
|
|
27731
27905
|
var import_jsx_runtime28 = __toESM(require_jsx_runtime(), 1);
|
|
27732
27906
|
|
|
27733
|
-
// ../ui/src/kanban/components/
|
|
27907
|
+
// ../ui/src/kanban/components/SettingsModal.tsx
|
|
27734
27908
|
var import_react22 = __toESM(require_react(), 1);
|
|
27735
27909
|
var import_jsx_runtime29 = __toESM(require_jsx_runtime(), 1);
|
|
27736
27910
|
|
|
27911
|
+
// ../ui/src/kanban/components/FilePreviewModal.tsx
|
|
27912
|
+
var import_react23 = __toESM(require_react(), 1);
|
|
27913
|
+
var import_jsx_runtime30 = __toESM(require_jsx_runtime(), 1);
|
|
27914
|
+
|
|
27915
|
+
// ../ui/src/kanban/components/AgentQueuePanel.tsx
|
|
27916
|
+
var import_react24 = __toESM(require_react(), 1);
|
|
27917
|
+
var import_jsx_runtime31 = __toESM(require_jsx_runtime(), 1);
|
|
27918
|
+
|
|
27737
27919
|
// src/client/overlay-browser/error-recorder.ts
|
|
27738
27920
|
var MAX_ENTRIES = 50;
|
|
27739
27921
|
var IGNORED_PATTERNS = [
|
|
@@ -27793,7 +27975,7 @@ import{a as B,b as Ie,c as Te,d as xn,e as Cn,f as _e,g as Sn,h as ue,i as Ce,j
|
|
|
27793
27975
|
}
|
|
27794
27976
|
|
|
27795
27977
|
// src/client/overlay-react/OverlayApp.tsx
|
|
27796
|
-
var
|
|
27978
|
+
var import_jsx_runtime32 = __toESM(require_jsx_runtime(), 1);
|
|
27797
27979
|
var _externalShowAddModal = null;
|
|
27798
27980
|
var _externalFlashTrigger = null;
|
|
27799
27981
|
function flashFavicon(durationMs = 2200) {
|
|
@@ -27831,20 +28013,20 @@ import{a as B,b as Ie,c as Te,d as xn,e as Cn,f as _e,g as Sn,h as ue,i as Ce,j
|
|
|
27831
28013
|
onClick,
|
|
27832
28014
|
flashing
|
|
27833
28015
|
}) {
|
|
27834
|
-
const svgIcon = /* @__PURE__ */ (0,
|
|
27835
|
-
/* @__PURE__ */ (0,
|
|
27836
|
-
/* @__PURE__ */ (0,
|
|
27837
|
-
/* @__PURE__ */ (0,
|
|
27838
|
-
/* @__PURE__ */ (0,
|
|
28016
|
+
const svgIcon = /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("svg", { width: "20", height: "20", viewBox: "0 0 18 18", fill: "none", "aria-hidden": "true", children: [
|
|
28017
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)("rect", { x: "2.5", y: "5", width: "2", height: "8", rx: "1", fill: "currentColor", opacity: "0.7" }),
|
|
28018
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)("rect", { x: "6.5", y: "2", width: "2", height: "14", rx: "1", fill: "currentColor" }),
|
|
28019
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)("rect", { x: "10.5", y: "6", width: "2", height: "6", rx: "1", fill: "currentColor", opacity: "0.7" }),
|
|
28020
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)("rect", { x: "14.5", y: "4", width: "2", height: "10", rx: "1", fill: "currentColor", opacity: "0.85" })
|
|
27839
28021
|
] });
|
|
27840
|
-
const [pos, setPos] =
|
|
27841
|
-
const [isDragging, setIsDragging] =
|
|
27842
|
-
const [isHolding, setIsHolding] =
|
|
27843
|
-
const dragOrigin =
|
|
27844
|
-
const holdTimer =
|
|
27845
|
-
const didDrag =
|
|
27846
|
-
const buttonRef =
|
|
27847
|
-
const posRef =
|
|
28022
|
+
const [pos, setPos] = import_react25.default.useState(null);
|
|
28023
|
+
const [isDragging, setIsDragging] = import_react25.default.useState(false);
|
|
28024
|
+
const [isHolding, setIsHolding] = import_react25.default.useState(false);
|
|
28025
|
+
const dragOrigin = import_react25.default.useRef(null);
|
|
28026
|
+
const holdTimer = import_react25.default.useRef(null);
|
|
28027
|
+
const didDrag = import_react25.default.useRef(false);
|
|
28028
|
+
const buttonRef = import_react25.default.useRef(null);
|
|
28029
|
+
const posRef = import_react25.default.useRef(null);
|
|
27848
28030
|
posRef.current = pos;
|
|
27849
28031
|
function getInitialPos(el2) {
|
|
27850
28032
|
const rect = el2.getBoundingClientRect();
|
|
@@ -27910,7 +28092,7 @@ import{a as B,b as Ie,c as Te,d as xn,e as Cn,f as _e,g as Sn,h as ue,i as Ce,j
|
|
|
27910
28092
|
isDragging ? "trigger-dragging" : ""
|
|
27911
28093
|
].filter(Boolean).join(" ");
|
|
27912
28094
|
const title = isDragging ? "Drag to reposition" : isHolding ? "Drag to reposition \\xB7 Release to open" : "Open Kanban board \\xB7 Hold to drag";
|
|
27913
|
-
return /* @__PURE__ */ (0,
|
|
28095
|
+
return /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
|
27914
28096
|
"button",
|
|
27915
28097
|
{
|
|
27916
28098
|
ref: buttonRef,
|
|
@@ -27935,16 +28117,16 @@ import{a as B,b as Ie,c as Te,d as xn,e as Cn,f as _e,g as Sn,h as ue,i as Ce,j
|
|
|
27935
28117
|
done: { background: "rgba(52,211,153,0.12)", borderColor: "rgba(52,211,153,0.4)", color: "#6ee7b7" }
|
|
27936
28118
|
};
|
|
27937
28119
|
function OverlayAddModal({ opts, onClose, onSubmit }) {
|
|
27938
|
-
const [title, setTitle] =
|
|
27939
|
-
const [description, setDescription] =
|
|
27940
|
-
const [status, setStatus] =
|
|
27941
|
-
const [type, setType] =
|
|
27942
|
-
const [showPreview, setShowPreview] =
|
|
27943
|
-
const [titleError, setTitleError] =
|
|
27944
|
-
const titleRef =
|
|
27945
|
-
const [dragPos, setDragPos] =
|
|
27946
|
-
const [isDragging, setIsDragging] =
|
|
27947
|
-
const dragOrigin =
|
|
28120
|
+
const [title, setTitle] = import_react25.default.useState(opts.initialTitle ?? "");
|
|
28121
|
+
const [description, setDescription] = import_react25.default.useState(opts.initialDescription ?? "");
|
|
28122
|
+
const [status, setStatus] = import_react25.default.useState("todo");
|
|
28123
|
+
const [type, setType] = import_react25.default.useState("Task");
|
|
28124
|
+
const [showPreview, setShowPreview] = import_react25.default.useState(false);
|
|
28125
|
+
const [titleError, setTitleError] = import_react25.default.useState(false);
|
|
28126
|
+
const titleRef = import_react25.default.useRef(null);
|
|
28127
|
+
const [dragPos, setDragPos] = import_react25.default.useState(null);
|
|
28128
|
+
const [isDragging, setIsDragging] = import_react25.default.useState(false);
|
|
28129
|
+
const dragOrigin = import_react25.default.useRef(null);
|
|
27948
28130
|
function onHeaderPointerDown(e) {
|
|
27949
28131
|
if (e.target.closest("button, input, select, textarea, a")) return;
|
|
27950
28132
|
e.currentTarget.setPointerCapture(e.pointerId);
|
|
@@ -27963,7 +28145,7 @@ import{a as B,b as Ie,c as Te,d as xn,e as Cn,f as _e,g as Sn,h as ue,i as Ce,j
|
|
|
27963
28145
|
dragOrigin.current = null;
|
|
27964
28146
|
setIsDragging(false);
|
|
27965
28147
|
}
|
|
27966
|
-
|
|
28148
|
+
import_react25.default.useEffect(() => {
|
|
27967
28149
|
setTimeout(() => {
|
|
27968
28150
|
var _a;
|
|
27969
28151
|
return (_a = titleRef.current) == null ? void 0 : _a.focus();
|
|
@@ -28023,23 +28205,23 @@ import{a as B,b as Ie,c as Te,d as xn,e as Cn,f as _e,g as Sn,h as ue,i as Ce,j
|
|
|
28023
28205
|
cursor: isDragging ? "grabbing" : "grab",
|
|
28024
28206
|
userSelect: "none"
|
|
28025
28207
|
};
|
|
28026
|
-
const DragHandle = /* @__PURE__ */ (0,
|
|
28208
|
+
const DragHandle = /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
|
28027
28209
|
"span",
|
|
28028
28210
|
{
|
|
28029
28211
|
title: "Drag to move",
|
|
28030
28212
|
style: { display: "flex", alignItems: "center", color: "var(--vibeflow-text-muted)", opacity: 0.5, flexShrink: 0, pointerEvents: "none" },
|
|
28031
|
-
children: /* @__PURE__ */ (0,
|
|
28032
|
-
/* @__PURE__ */ (0,
|
|
28033
|
-
/* @__PURE__ */ (0,
|
|
28034
|
-
/* @__PURE__ */ (0,
|
|
28035
|
-
/* @__PURE__ */ (0,
|
|
28036
|
-
/* @__PURE__ */ (0,
|
|
28037
|
-
/* @__PURE__ */ (0,
|
|
28213
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("svg", { width: "12", height: "16", viewBox: "0 0 12 16", fill: "currentColor", "aria-hidden": "true", children: [
|
|
28214
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)("circle", { cx: "3", cy: "3", r: "1.5" }),
|
|
28215
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)("circle", { cx: "9", cy: "3", r: "1.5" }),
|
|
28216
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)("circle", { cx: "3", cy: "8", r: "1.5" }),
|
|
28217
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)("circle", { cx: "9", cy: "8", r: "1.5" }),
|
|
28218
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)("circle", { cx: "3", cy: "13", r: "1.5" }),
|
|
28219
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)("circle", { cx: "9", cy: "13", r: "1.5" })
|
|
28038
28220
|
] })
|
|
28039
28221
|
}
|
|
28040
28222
|
);
|
|
28041
|
-
return /* @__PURE__ */ (0,
|
|
28042
|
-
/* @__PURE__ */ (0,
|
|
28223
|
+
return /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("div", { className: "vibeflow-modal-backdrop", onClick: handleBackdropClick, onKeyDown: handleKeyDown, children: /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("div", { className: "vibeflow-modal overlay-add-modal", role: "dialog", "aria-modal": "true", style: modalStyle, children: [
|
|
28224
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsxs)(
|
|
28043
28225
|
"div",
|
|
28044
28226
|
{
|
|
28045
28227
|
className: "modal-header overlay-modal-header",
|
|
@@ -28049,8 +28231,8 @@ import{a as B,b as Ie,c as Te,d as xn,e as Cn,f as _e,g as Sn,h as ue,i as Ce,j
|
|
|
28049
28231
|
onPointerUp: onHeaderPointerUp,
|
|
28050
28232
|
children: [
|
|
28051
28233
|
DragHandle,
|
|
28052
|
-
/* @__PURE__ */ (0,
|
|
28053
|
-
/* @__PURE__ */ (0,
|
|
28234
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)(TypePicker, { value: type, onChange: setType }),
|
|
28235
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
|
28054
28236
|
"input",
|
|
28055
28237
|
{
|
|
28056
28238
|
ref: titleRef,
|
|
@@ -28080,8 +28262,8 @@ import{a as B,b as Ie,c as Te,d as xn,e as Cn,f as _e,g as Sn,h as ue,i as Ce,j
|
|
|
28080
28262
|
}
|
|
28081
28263
|
}
|
|
28082
28264
|
),
|
|
28083
|
-
titleError && /* @__PURE__ */ (0,
|
|
28084
|
-
/* @__PURE__ */ (0,
|
|
28265
|
+
titleError && /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("span", { style: { fontSize: 11, color: "rgba(239,68,68,0.9)", flexShrink: 0, whiteSpace: "nowrap" }, children: "Title is required" }),
|
|
28266
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
|
28085
28267
|
"button",
|
|
28086
28268
|
{
|
|
28087
28269
|
type: "button",
|
|
@@ -28102,9 +28284,9 @@ import{a as B,b as Ie,c as Te,d as xn,e as Cn,f as _e,g as Sn,h as ue,i as Ce,j
|
|
|
28102
28284
|
]
|
|
28103
28285
|
}
|
|
28104
28286
|
),
|
|
28105
|
-
/* @__PURE__ */ (0,
|
|
28106
|
-
/* @__PURE__ */ (0,
|
|
28107
|
-
STATUS_OPTIONS.map((s) => /* @__PURE__ */ (0,
|
|
28287
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("div", { style: { display: "flex", alignItems: "center", gap: 6, padding: "8px 16px", borderBottom: "1px solid var(--vibeflow-border-strong)" }, children: [
|
|
28288
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)("span", { style: { fontSize: 10, color: "var(--vibeflow-text-muted)", fontWeight: 500, textTransform: "uppercase", letterSpacing: "0.04em", flexShrink: 0 }, children: "Status" }),
|
|
28289
|
+
STATUS_OPTIONS.map((s) => /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
|
28108
28290
|
"button",
|
|
28109
28291
|
{
|
|
28110
28292
|
type: "button",
|
|
@@ -28127,8 +28309,8 @@ import{a as B,b as Ie,c as Te,d as xn,e as Cn,f as _e,g as Sn,h as ue,i as Ce,j
|
|
|
28127
28309
|
s
|
|
28128
28310
|
))
|
|
28129
28311
|
] }),
|
|
28130
|
-
(opts.file || opts.component) && /* @__PURE__ */ (0,
|
|
28131
|
-
opts.file && /* @__PURE__ */ (0,
|
|
28312
|
+
(opts.file || opts.component) && /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("div", { style: { display: "flex", alignItems: "center", gap: 8, padding: "6px 16px", background: "var(--vibeflow-surface-elevated)", borderBottom: "1px solid var(--vibeflow-border-subtle)", fontSize: 11, color: "var(--vibeflow-text-muted)" }, children: [
|
|
28313
|
+
opts.file && /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)(
|
|
28132
28314
|
"a",
|
|
28133
28315
|
{
|
|
28134
28316
|
href: \`vscode://file\${opts.file}\${opts.line != null ? \`:\${opts.line}\` : ""}\`,
|
|
@@ -28142,16 +28324,16 @@ import{a as B,b as Ie,c as Te,d as xn,e as Cn,f as _e,g as Sn,h as ue,i as Ce,j
|
|
|
28142
28324
|
]
|
|
28143
28325
|
}
|
|
28144
28326
|
),
|
|
28145
|
-
opts.component && /* @__PURE__ */ (0,
|
|
28327
|
+
opts.component && /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("span", { style: { display: "inline-flex", alignItems: "center", gap: 4, padding: "2px 6px", borderRadius: 4, background: "rgba(139,92,246,0.08)", border: "1px solid rgba(139,92,246,0.25)", color: "#8b5cf6", fontSize: 11 }, children: [
|
|
28146
28328
|
"\\u2B21 ",
|
|
28147
28329
|
opts.component
|
|
28148
28330
|
] })
|
|
28149
28331
|
] }),
|
|
28150
|
-
/* @__PURE__ */ (0,
|
|
28151
|
-
/* @__PURE__ */ (0,
|
|
28152
|
-
/* @__PURE__ */ (0,
|
|
28332
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("div", { className: "modal-tabs", children: [
|
|
28333
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)("div", { className: \`modal-tab\${!showPreview ? " active" : ""}\`, onClick: () => setShowPreview(false), children: "Edit" }),
|
|
28334
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)("div", { className: \`modal-tab\${showPreview ? " active" : ""}\`, onClick: () => setShowPreview(true), children: "Preview" })
|
|
28153
28335
|
] }),
|
|
28154
|
-
/* @__PURE__ */ (0,
|
|
28336
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)("div", { className: "modal-body", children: !showPreview ? /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("div", { className: "modal-editor-pane", children: /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
|
28155
28337
|
AutoExpandTextarea,
|
|
28156
28338
|
{
|
|
28157
28339
|
className: "dp-textarea",
|
|
@@ -28161,30 +28343,30 @@ import{a as B,b as Ie,c as Te,d as xn,e as Cn,f as _e,g as Sn,h as ue,i as Ce,j
|
|
|
28161
28343
|
baseRows: 5,
|
|
28162
28344
|
maxRows: 14
|
|
28163
28345
|
}
|
|
28164
|
-
) }) : /* @__PURE__ */ (0,
|
|
28346
|
+
) }) : /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
|
28165
28347
|
MarkdownPreview,
|
|
28166
28348
|
{
|
|
28167
28349
|
markdown: description,
|
|
28168
28350
|
className: "modal-preview-pane"
|
|
28169
28351
|
}
|
|
28170
28352
|
) }),
|
|
28171
|
-
type === "Bug" && /* @__PURE__ */ (0,
|
|
28172
|
-
/* @__PURE__ */ (0,
|
|
28173
|
-
/* @__PURE__ */ (0,
|
|
28353
|
+
type === "Bug" && /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("div", { style: { display: "flex", alignItems: "center", gap: 6, padding: "6px 16px", background: "rgba(239,68,68,0.06)", borderTop: "1px solid rgba(239,68,68,0.18)", fontSize: 11, color: "rgba(239,68,68,0.75)" }, children: [
|
|
28354
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)("span", { children: "\\u{1F534}" }),
|
|
28355
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)("span", { children: "Console errors & warnings will be attached to this report" })
|
|
28174
28356
|
] }),
|
|
28175
|
-
/* @__PURE__ */ (0,
|
|
28176
|
-
/* @__PURE__ */ (0,
|
|
28177
|
-
/* @__PURE__ */ (0,
|
|
28178
|
-
/* @__PURE__ */ (0,
|
|
28357
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("div", { className: "modal-footer", children: [
|
|
28358
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("div", { className: "modal-footer-left", children: [
|
|
28359
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)("button", { type: "button", className: "btn-primary", onClick: handleSave, disabled: !title.trim(), style: { opacity: title.trim() ? 1 : 0.45, cursor: title.trim() ? "pointer" : "not-allowed" }, children: "Add Task" }),
|
|
28360
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)("button", { type: "button", className: "btn-ghost", onClick: onClose, children: "Cancel" })
|
|
28179
28361
|
] }),
|
|
28180
|
-
/* @__PURE__ */ (0,
|
|
28362
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)("div", { className: "modal-footer-center" })
|
|
28181
28363
|
] })
|
|
28182
28364
|
] }) });
|
|
28183
28365
|
}
|
|
28184
28366
|
function OverlayApp({ onOpenKanban, onSubmitTask }) {
|
|
28185
|
-
const [addModalOpts, setAddModalOpts] =
|
|
28186
|
-
const [triggerFlashing, setTriggerFlashing] =
|
|
28187
|
-
|
|
28367
|
+
const [addModalOpts, setAddModalOpts] = import_react25.default.useState(null);
|
|
28368
|
+
const [triggerFlashing, setTriggerFlashing] = import_react25.default.useState(false);
|
|
28369
|
+
import_react25.default.useEffect(() => {
|
|
28188
28370
|
_externalShowAddModal = (opts) => setAddModalOpts(opts);
|
|
28189
28371
|
_externalFlashTrigger = () => {
|
|
28190
28372
|
setTriggerFlashing(true);
|
|
@@ -28197,15 +28379,15 @@ import{a as B,b as Ie,c as Te,d as xn,e as Cn,f as _e,g as Sn,h as ue,i as Ce,j
|
|
|
28197
28379
|
};
|
|
28198
28380
|
}, []);
|
|
28199
28381
|
const isKanbanPage = typeof document !== "undefined" && document.body.hasAttribute("data-vibeflow-cli-kanban");
|
|
28200
|
-
return /* @__PURE__ */ (0,
|
|
28201
|
-
!isKanbanPage && /* @__PURE__ */ (0,
|
|
28382
|
+
return /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)(import_jsx_runtime32.Fragment, { children: [
|
|
28383
|
+
!isKanbanPage && /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
|
28202
28384
|
CornerTrigger,
|
|
28203
28385
|
{
|
|
28204
28386
|
onClick: onOpenKanban,
|
|
28205
28387
|
flashing: triggerFlashing
|
|
28206
28388
|
}
|
|
28207
28389
|
),
|
|
28208
|
-
addModalOpts !== null && /* @__PURE__ */ (0,
|
|
28390
|
+
addModalOpts !== null && /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
|
28209
28391
|
OverlayAddModal,
|
|
28210
28392
|
{
|
|
28211
28393
|
opts: addModalOpts,
|
|
@@ -29189,7 +29371,7 @@ import{a as B,b as Ie,c as Te,d as xn,e as Cn,f as _e,g as Sn,h as ue,i as Ce,j
|
|
|
29189
29371
|
}
|
|
29190
29372
|
|
|
29191
29373
|
// src/client/overlay-browser/index.ts
|
|
29192
|
-
var
|
|
29374
|
+
var import_react26 = __toESM(require_react(), 1);
|
|
29193
29375
|
var import_client = __toESM(require_client(), 1);
|
|
29194
29376
|
function main() {
|
|
29195
29377
|
startRecording();
|
|
@@ -29220,7 +29402,7 @@ import{a as B,b as Ie,c as Te,d as xn,e as Cn,f as _e,g as Sn,h as ue,i as Ce,j
|
|
|
29220
29402
|
root.appendChild(reactContainer);
|
|
29221
29403
|
const reactRoot = (0, import_client.createRoot)(reactContainer);
|
|
29222
29404
|
reactRoot.render(
|
|
29223
|
-
|
|
29405
|
+
import_react26.default.createElement(OverlayApp, {
|
|
29224
29406
|
onOpenKanban: () => {
|
|
29225
29407
|
if (PROTO_CONFIG.boardId) {
|
|
29226
29408
|
const origin = new URL(PROTO_CONFIG.apiUrl).origin;
|
|
@@ -29320,6 +29502,7 @@ lucide-react/dist/esm/shared/src/utils.js:
|
|
|
29320
29502
|
lucide-react/dist/esm/defaultAttributes.js:
|
|
29321
29503
|
lucide-react/dist/esm/Icon.js:
|
|
29322
29504
|
lucide-react/dist/esm/createLucideIcon.js:
|
|
29505
|
+
lucide-react/dist/esm/icons/bot.js:
|
|
29323
29506
|
lucide-react/dist/esm/icons/circle-check-big.js:
|
|
29324
29507
|
lucide-react/dist/esm/icons/eye.js:
|
|
29325
29508
|
lucide-react/dist/esm/icons/lock.js:
|
|
@@ -29333,36 +29516,42 @@ lucide-react/dist/esm/lucide-react.js:
|
|
|
29333
29516
|
* See the LICENSE file in the root directory of this source tree.
|
|
29334
29517
|
*)
|
|
29335
29518
|
*/
|
|
29336
|
-
`;function
|
|
29519
|
+
`;function sn(n){return`
|
|
29337
29520
|
var _vfScriptSrc = document.currentScript && document.currentScript.src;
|
|
29338
29521
|
var _vfOrigin = _vfScriptSrc ? new URL(_vfScriptSrc).origin : ('http://' + window.location.host);
|
|
29339
29522
|
var PROTO_CONFIG = {
|
|
29340
|
-
port: ${
|
|
29523
|
+
port: ${n},
|
|
29341
29524
|
wsUrl: _vfOrigin.replace(/^http/, 'ws'),
|
|
29342
29525
|
apiUrl: _vfOrigin + '/api/tasks',
|
|
29343
29526
|
pagesUrl: _vfOrigin + '/api/pages',
|
|
29344
29527
|
screenshotsUrl: _vfOrigin + '/screenshots/'
|
|
29345
29528
|
};
|
|
29346
|
-
`+
|
|
29347
|
-
`+
|
|
29348
|
-
/*! tailwindcss v3.4.19 | MIT License | https://tailwindcss.com*/*,:after,:before{box-sizing:border-box;border:0 solid #e5e7eb}:after,:before{--tw-content:""}:host,html{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;-o-tab-size:4;tab-size:4;font-family:Inter,system-ui,sans-serif;font-feature-settings:normal;font-variation-settings:normal;-webkit-tap-highlight-color:transparent}body{margin:0;line-height:inherit}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,pre,samp{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-feature-settings:normal;font-variation-settings:normal;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}button,input,optgroup,select,textarea{font-family:inherit;font-feature-settings:inherit;font-variation-settings:inherit;font-size:100%;font-weight:inherit;line-height:inherit;letter-spacing:inherit;color:inherit;margin:0;padding:0}button,select{text-transform:none}button,input:where([type=button]),input:where([type=reset]),input:where([type=submit]){-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dd,dl,figure,h1,h2,h3,h4,h5,h6,hr,p,pre{margin:0}fieldset{margin:0}fieldset,legend{padding:0}menu,ol,ul{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{opacity:1;color:#9ca3af}input::placeholder,textarea::placeholder{opacity:1;color:#9ca3af}[role=button],button{cursor:pointer}:disabled{cursor:default}audio,canvas,embed,iframe,img,object,svg,video{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}[hidden]:where(:not([hidden=until-found])){display:none}.container{width:100%}@media (min-width:640px){.container{max-width:640px}}@media (min-width:768px){.container{max-width:768px}}@media (min-width:1024px){.container{max-width:1024px}}@media (min-width:1280px){.container{max-width:1280px}}@media (min-width:1536px){.container{max-width:1536px}}.\\!visible{visibility:visible!important}.visible{visibility:visible}.fixed{position:fixed}.absolute{position:absolute}.relative{position:relative}.mb-0\\.5{margin-bottom:.125rem}.ml-1\\.5{margin-left:.375rem}.mr-0\\.5{margin-right:.125rem}.mt-0\\.5{margin-top:.125rem}.block{display:block}.inline-block{display:inline-block}.inline{display:inline}.flex{display:flex}.inline-flex{display:inline-flex}.grid{display:grid}.hidden{display:none}.h-1{height:.25rem}.h-1\\.5{height:.375rem}.h-10{height:2.5rem}.h-2\\.5{height:.625rem}.h-3{height:.75rem}.h-3\\.5{height:.875rem}.h-4{height:1rem}.h-7{height:1.75rem}.min-h-\\[30px\\]{min-height:30px}.w-1{width:.25rem}.w-1\\.5{width:.375rem}.w-10{width:2.5rem}.w-2\\.5{width:.625rem}.w-3{width:.75rem}.w-3\\.5{width:.875rem}.w-4{width:1rem}.w-7{width:1.75rem}.w-full{width:100%}.min-w-\\[100px\\]{min-width:100px}.max-w-sm{max-width:24rem}.flex-1{flex:1 1 0%}.flex-shrink-0{flex-shrink:0}.transform{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.cursor-text{cursor:text}.resize{resize:both}.flex-col{flex-direction:column}.flex-wrap{flex-wrap:wrap}.items-center{align-items:center}.justify-center{justify-content:center}.justify-between{justify-content:space-between}.gap-1{gap:.25rem}.gap-1\\.5{gap:.375rem}.gap-2{gap:.5rem}.gap-3{gap:.75rem}.overflow-auto{overflow:auto}.overflow-hidden{overflow:hidden}.overflow-x-auto{overflow-x:auto}.overflow-y-hidden{overflow-y:hidden}.break-all{word-break:break-all}.rounded{border-radius:.25rem}.rounded-full{border-radius:9999px}.rounded-lg{border-radius:.5rem}.rounded-md{border-radius:.375rem}.border{border-width:1px}.border-b{border-bottom-width:1px}.border-none{border-style:none}.border-slate-700{--tw-border-opacity:1;border-color:rgb(51 65 85/var(--tw-border-opacity,1))}.border-slate-700\\/60{border-color:rgba(51,65,85,.6)}.border-slate-800\\/60{border-color:rgba(30,41,59,.6)}.border-violet-700\\/50{border-color:rgba(109,40,217,.5)}.bg-blue-400{--tw-bg-opacity:1;background-color:rgb(96 165 250/var(--tw-bg-opacity,1))}.bg-green-400{--tw-bg-opacity:1;background-color:rgb(74 222 128/var(--tw-bg-opacity,1))}.bg-slate-800{--tw-bg-opacity:1;background-color:rgb(30 41 59/var(--tw-bg-opacity,1))}.bg-transparent{background-color:transparent}.bg-violet-900\\/30{background-color:rgba(76,29,149,.3)}.p-1{padding:.25rem}.p-1\\.5{padding:.375rem}.px-2{padding-left:.5rem;padding-right:.5rem}.px-3{padding-left:.75rem;padding-right:.75rem}.px-4{padding-left:1rem;padding-right:1rem}.px-5{padding-left:1.25rem;padding-right:1.25rem}.py-0\\.5{padding-top:.125rem;padding-bottom:.125rem}.py-1{padding-top:.25rem;padding-bottom:.25rem}.py-1\\.5{padding-top:.375rem;padding-bottom:.375rem}.py-12{padding-top:3rem;padding-bottom:3rem}.py-3{padding-top:.75rem;padding-bottom:.75rem}.py-4{padding-top:1rem;padding-bottom:1rem}.font-mono{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace}.text-\\[10px\\]{font-size:10px}.text-sm{font-size:.875rem;line-height:1.25rem}.text-xs{font-size:.75rem;line-height:1rem}.font-medium{font-weight:500}.font-semibold{font-weight:600}.uppercase{text-transform:uppercase}.lowercase{text-transform:lowercase}.italic{font-style:italic}.leading-tight{line-height:1.25}.text-green-400{--tw-text-opacity:1;color:rgb(74 222 128/var(--tw-text-opacity,1))}.text-slate-200{--tw-text-opacity:1;color:rgb(226 232 240/var(--tw-text-opacity,1))}.text-slate-300{--tw-text-opacity:1;color:rgb(203 213 225/var(--tw-text-opacity,1))}.text-slate-400{--tw-text-opacity:1;color:rgb(148 163 184/var(--tw-text-opacity,1))}.text-slate-500{--tw-text-opacity:1;color:rgb(100 116 139/var(--tw-text-opacity,1))}.text-slate-600{--tw-text-opacity:1;color:rgb(71 85 105/var(--tw-text-opacity,1))}.text-violet-300{--tw-text-opacity:1;color:rgb(196 181 253/var(--tw-text-opacity,1))}.text-violet-400{--tw-text-opacity:1;color:rgb(167 139 250/var(--tw-text-opacity,1))}.text-white{--tw-text-opacity:1;color:rgb(255 255 255/var(--tw-text-opacity,1))}.underline{text-decoration-line:underline}.line-through{text-decoration-line:line-through}.no-underline{text-decoration-line:none}.placeholder-slate-500::-moz-placeholder{--tw-placeholder-opacity:1;color:rgb(100 116 139/var(--tw-placeholder-opacity,1))}.placeholder-slate-500::placeholder{--tw-placeholder-opacity:1;color:rgb(100 116 139/var(--tw-placeholder-opacity,1))}.opacity-0{opacity:0}.opacity-40{opacity:.4}.outline-none{outline:2px solid transparent;outline-offset:2px}.outline{outline-style:solid}.blur{--tw-blur:blur(8px)}.blur,.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.transition{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-colors{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-opacity{transition-property:opacity;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.ease-in-out{transition-timing-function:cubic-bezier(.4,0,.2,1)}:root{--p-bg:#020c1b;--p-surface:#080f1e;--p-card:#0a0f1e;--p-input:#050d1a;--p-hover:#0d1f38;--p-border:#1e293b;--p-border-s:#1e3a5f;--p-border-t:#334155;--p-text:#e2e8f0;--p-text-sub:#cbd5e1;--p-text-m:#94a3b8;--p-text-f:#64748b;--p-text-g:#475569;--p-white:#fff;--p-blue:#2563eb;--p-blue-700:#1d4ed8;--p-blue-300:#60a5fa;--p-blue-200:#93c5fd;--p-purple:#a78bfa;--p-purple-300:#c4b5fd;--p-cyan-300:#7dd3fc;--p-amber:#f59e0b;--p-amber-300:#fcd34d;--p-green:#22c55e;--p-green-300:#6ee7b7;--p-red:#f87171;--p-red-500:#ef4444;--p-shadow-lg:0 8px 24px rgba(2,6,23,.28);--p-overlay:rgba(15,23,42,.2)}body,html{height:100%;margin:0;padding:0}body{font-family:Inter,sans-serif;background:var(--p-bg);color:var(--p-text)}#root{height:100%;display:flex;flex-direction:column;overflow:hidden}*{scrollbar-width:thin;scrollbar-color:var(--p-border-t) transparent}::-webkit-scrollbar{width:4px;height:4px}::-webkit-scrollbar-track{background:transparent}::-webkit-scrollbar-thumb{background:var(--p-border-t);border-radius:4px}::-webkit-scrollbar-thumb:hover{background:var(--p-text-g)}#kanban-board{scrollbar-width:none;-ms-overflow-style:none;overflow-x:auto;overflow-y:hidden}#kanban-board::-webkit-scrollbar{display:none}#kanban-scroll-track{position:fixed;bottom:0;left:0;right:0;height:6px;background:transparent;z-index:40;pointer-events:none}#kanban-scroll-thumb{position:absolute;top:1px;height:4px;border-radius:2px;background:var(--p-border-t);cursor:pointer;pointer-events:auto;transition:background .15s}#kanban-scroll-thumb.dragging,#kanban-scroll-thumb:hover{background:var(--p-text-g)}.board-column{flex:0 0 280px;width:280px;display:flex;flex-direction:column;gap:6px;min-height:0}.column-header{display:flex;align-items:center;gap:8px;padding:8px 10px;border-radius:8px;background:var(--p-surface);border:1px solid var(--p-border)}.column-scroll{flex:1;overflow-y:auto;min-height:0;gap:5px;padding-bottom:8px}.column-scroll,.task-card{display:flex;flex-direction:column}.task-card{background:var(--p-card);border:1px solid var(--p-border);border-radius:10px;padding:11px 13px;cursor:grab;transition:border-color .12s,background .12s,box-shadow .12s,transform .12s;gap:7px}.task-card:hover{border-color:var(--p-border-s);background:var(--p-hover);box-shadow:0 4px 16px rgba(0,0,0,.3);transform:translateY(-1px)}.task-card:active{cursor:grabbing;transform:scale(.98)}.task-card.dragging{opacity:.4}.drag-over{outline:2px dashed rgba(59,130,246,.5);outline-offset:-3px;border-radius:10px;background:rgba(59,130,246,.04)}.file-compact-actions{opacity:0}.group\\/file-compact:hover .file-compact-actions{opacity:1}.file-normal-actions,.group\\/file-compact:hover .file-compact-ts{opacity:0}.group\\/file:hover .file-normal-actions{opacity:1}.group\\/file:hover{background:rgba(30,41,59,.6)}.status-dot{width:7px;height:7px;border-radius:50%;flex-shrink:0}.sd-backlog{background:#475569}.sd-todo{background:#f59e0b}.sd-inprogress{background:#3b82f6;animation:pulse-prog 2s ease-in-out infinite}.sd-review{background:#a855f7}.sd-done{background:#22c55e}@keyframes pulse-prog{0%,to{box-shadow:0 0 0 0 rgba(59,130,246,.5)}50%{box-shadow:0 0 0 4px rgba(59,130,246,0)}}.type-badge{display:inline-flex;align-items:center;gap:3px;padding:2px 7px;border-radius:20px;font-size:10px;font-weight:500;border:1px solid}.type-bug{color:#fca5a5;background:rgba(239,68,68,.1);border-color:rgba(239,68,68,.25)}.type-feature{color:#86efac;background:rgba(34,197,94,.08);border-color:rgba(34,197,94,.2)}.type-enhancement{color:#93c5fd;background:rgba(59,130,246,.08);border-color:rgba(59,130,246,.2)}.type-task{color:#cbd5e1;background:rgba(148,163,184,.08);border-color:rgba(148,163,184,.2)}.type-research{color:#c4b5fd;background:rgba(139,92,246,.08);border-color:rgba(139,92,246,.2)}.source-pill{display:inline-flex;align-items:center;gap:4px;padding:2px 7px;border-radius:6px;font-size:10px;font-family:JetBrains Mono,monospace;background:rgba(59,130,246,.06);border:1px solid rgba(59,130,246,.15);color:#60a5fa;cursor:pointer;text-decoration:none;transition:background .1s,border-color .1s;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:100%}.source-pill:hover{background:rgba(59,130,246,.12);border-color:rgba(59,130,246,.3)}@keyframes spin{to{transform:rotate(1turn)}}.spinner{display:inline-block;width:11px;height:11px;border:2px solid rgba(96,165,250,.3);border-top-color:#60a5fa;border-radius:50%;animation:spin .7s linear infinite}.modal-backdrop{position:fixed;inset:0;background:rgba(0,0,0,.6);z-index:50;display:flex;align-items:center;justify-content:center}.modal-box{background:var(--p-card);border:1px solid var(--p-border);border-radius:14px;width:520px;max-width:95vw;overflow:hidden}.type-picker{display:flex;align-items:center;gap:6px}.type-picker-trigger{display:flex;align-items:center;gap:4px;width:auto;height:30px;padding:0 8px;border-radius:8px;border:1px solid var(--p-border-t);background:var(--p-card);color:var(--p-text-sub);font-size:13px;cursor:pointer;white-space:nowrap}.type-picker-label{font-size:11px;font-weight:500;color:var(--p-text-m);letter-spacing:.02em}.type-picker-trigger:hover{border-color:var(--p-text-g);color:var(--p-text)}.type-picker-options{display:none;align-items:center;gap:4px}.type-picker-options.open{display:flex}.type-picker-option{width:28px;height:28px;border-radius:7px;border:1px solid var(--p-border-t);background:var(--p-card);color:var(--p-text-sub);display:flex;align-items:center;justify-content:center;cursor:pointer;font-size:13px}.type-picker-option:hover{border-color:#60a5fa;color:#bfdbfe}#detail-panel-container{min-width:360px;max-width:min(860px,100%);position:absolute;right:0;top:0;bottom:0;display:flex;flex-direction:column;overflow:hidden;border-left:1px solid #1e293b;animation:panel-slide-in .18s ease-out}#detail-panel-container.resizing{box-shadow:-12px 0 32px rgba(2,8,23,.6)}#detail-panel-resize-handle{position:absolute;left:0;top:0;width:12px;height:100%;cursor:ew-resize;z-index:5}#detail-panel-resize-handle:hover{background:linear-gradient(90deg,rgba(59,130,246,.22),rgba(59,130,246,0))}body.proto-resizing-panel{cursor:ew-resize;-webkit-user-select:none;-moz-user-select:none;user-select:none}#detail-panel{flex:1;background:var(--p-card);display:flex;flex-direction:column;overflow:hidden}@keyframes panel-slide-in{0%{width:0;opacity:0}to{width:420px;opacity:1}}.dp-header{padding:14px 16px 10px}.dp-header,.dp-tabs{border-bottom:1px solid var(--p-border);background:var(--p-surface);flex-shrink:0}.dp-tabs{display:flex;gap:0}.dp-tab{padding:8px 14px;font-size:12px;font-weight:500;color:var(--p-text-g);cursor:pointer;transition:color .12s,border-color .12s;background:none;border:none;border-bottom:2px solid transparent}.dp-tab:hover{color:var(--p-text-m)}.dp-tab.active{color:#93c5fd;border-bottom-color:#3b82f6}.dp-body{overflow:hidden}.dp-body,.dp-body>.dp-pane{flex:1;display:flex;flex-direction:column;gap:12px;min-height:0}.dp-body>.dp-pane{padding:14px 16px}#dp-details-pane,.dp-body>.dp-pane{overflow-y:auto;background:var(--p-card)}.dp-footer{padding:10px 16px 12px;border-top:1px solid var(--p-border);flex-shrink:0;display:flex;align-items:center;justify-content:space-between;gap:8px;background:var(--p-card)}.dp-source-pill{display:inline-flex;align-items:center;gap:3px;padding:2px 7px;border-radius:6px;font-size:10px;font-family:monospace;background:rgba(59,130,246,.06);border:1px solid rgba(59,130,246,.15);color:#60a5fa;white-space:nowrap}.dp-source-pill:hover{background:rgba(59,130,246,.12);border-color:rgba(59,130,246,.3)}.dp-status-btn{padding:3px 10px;border-radius:6px;font-size:10px;font-weight:500;border:1px solid var(--p-border-t);color:var(--p-text-f);background:transparent;cursor:pointer;transition:background .12s,border-color .12s,color .12s}.dp-status-btn:hover{border-color:var(--p-text-g);color:var(--p-text-m)}.dp-status-btn.active-backlog{border-color:#475569;background:rgba(100,116,139,.1);color:#94a3b8}.dp-status-btn.active-todo{border-color:rgba(245,158,11,.5);background:rgba(245,158,11,.1);color:#f59e0b}.dp-status-btn.active-in-progress{border-color:rgba(59,130,246,.5);background:rgba(59,130,246,.1);color:#60a5fa}.dp-status-btn.active-review{border-color:rgba(168,85,247,.5);background:rgba(168,85,247,.1);color:#a855f7}.dp-status-btn.active-done{border-color:rgba(34,197,94,.4);background:rgba(34,197,94,.08);color:#22c55e}.dp-input{width:100%;padding:7px 10px;border:1px solid var(--p-border-s);border-radius:8px;background:var(--p-input);color:var(--p-text);font-size:13px;font-family:inherit;outline:none;transition:border-color .12s,box-shadow .12s;box-sizing:border-box}.dp-input:focus{border-color:#3b82f6;box-shadow:0 0 0 3px rgba(59,130,246,.1)}.dp-input::-moz-placeholder{color:var(--p-border-t)}.dp-input::placeholder{color:var(--p-border-t)}.dp-textarea{width:100%;padding:8px 10px;border:1px solid var(--p-border-s);border-radius:8px;background:var(--p-input);color:var(--p-text);font-size:12px;font-family:monospace;line-height:1.6;resize:vertical;outline:none;box-sizing:border-box;transition:border-color .12s,box-shadow .12s}.dp-textarea:focus{border-color:#3b82f6;box-shadow:0 0 0 3px rgba(59,130,246,.1)}.dp-textarea::-moz-placeholder{color:var(--p-border-t)}.dp-textarea::placeholder{color:var(--p-border-t)}.dp-meta-label{font-size:10px;font-weight:600;color:var(--p-text-g);text-transform:uppercase;letter-spacing:.04em;margin-bottom:6px}@keyframes pulse-live{0%,to{box-shadow:0 0 0 0 rgba(74,222,128,.4)}50%{box-shadow:0 0 0 4px rgba(74,222,128,0)}}@keyframes agent-pulse{0%,to{opacity:.5}50%{opacity:1}}@keyframes skeleton-pulse{0%,to{opacity:1}50%{opacity:.4}}@keyframes away-glow{0%,to{box-shadow:0 0 0 0 rgba(37,99,235,.45),0 0 24px rgba(37,99,235,.1);border-color:rgba(37,99,235,.35)}50%{box-shadow:0 0 0 14px rgba(37,99,235,0),0 0 48px rgba(37,99,235,.2);border-color:rgba(96,165,250,.6)}}@keyframes away-fade-in{0%{opacity:0;transform:scale(.9)}to{opacity:1;transform:scale(1)}}.focus-within\\:border-blue-500:focus-within{--tw-border-opacity:1;border-color:rgb(59 130 246/var(--tw-border-opacity,1))}.hover\\:bg-red-900\\/40:hover{background-color:rgba(127,29,29,.4)}.hover\\:bg-slate-700:hover{--tw-bg-opacity:1;background-color:rgb(51 65 85/var(--tw-bg-opacity,1))}.hover\\:bg-slate-700\\/50:hover{background-color:rgba(51,65,85,.5)}.hover\\:bg-slate-700\\/60:hover{background-color:rgba(51,65,85,.6)}.hover\\:bg-slate-800:hover{--tw-bg-opacity:1;background-color:rgb(30 41 59/var(--tw-bg-opacity,1))}.hover\\:bg-violet-800\\/30:hover{background-color:rgba(91,33,182,.3)}.hover\\:text-slate-200:hover{--tw-text-opacity:1;color:rgb(226 232 240/var(--tw-text-opacity,1))}.hover\\:text-slate-300:hover{--tw-text-opacity:1;color:rgb(203 213 225/var(--tw-text-opacity,1))}.hover\\:text-violet-300:hover{--tw-text-opacity:1;color:rgb(196 181 253/var(--tw-text-opacity,1))}.hover\\:underline:hover{text-decoration-line:underline}.group\\/comment:hover .group-hover\\/comment\\:opacity-100{opacity:1}`;var tn='"use strict";(()=>{var Xm=Object.create;var md=Object.defineProperty;var Qm=Object.getOwnPropertyDescriptor;var Ym=Object.getOwnPropertyNames;var Zm=Object.getPrototypeOf,Jm=Object.prototype.hasOwnProperty;var Jt=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var eg=(e,t,a,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of Ym(t))!Jm.call(e,o)&&o!==a&&md(e,o,{get:()=>t[o],enumerable:!(r=Qm(t,o))||r.enumerable});return e};var A=(e,t,a)=>(a=e!=null?Xm(Zm(e)):{},eg(t||!e||!e.__esModule?md(a,"default",{value:e,enumerable:!0}):a,e));var bd=Jt(le=>{"use strict";var yo=Symbol.for("react.element"),tg=Symbol.for("react.portal"),ag=Symbol.for("react.fragment"),rg=Symbol.for("react.strict_mode"),og=Symbol.for("react.profiler"),ng=Symbol.for("react.provider"),lg=Symbol.for("react.context"),sg=Symbol.for("react.forward_ref"),ug=Symbol.for("react.suspense"),ig=Symbol.for("react.memo"),dg=Symbol.for("react.lazy"),gd=Symbol.iterator;function fg(e){return e===null||typeof e!="object"?null:(e=gd&&e[gd]||e["@@iterator"],typeof e=="function"?e:null)}var vd={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},yd=Object.assign,Ld={};function Tr(e,t,a){this.props=e,this.context=t,this.refs=Ld,this.updater=a||vd}Tr.prototype.isReactComponent={};Tr.prototype.setState=function(e,t){if(typeof e!="object"&&typeof e!="function"&&e!=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,e,t,"setState")};Tr.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function Sd(){}Sd.prototype=Tr.prototype;function bs(e,t,a){this.props=e,this.context=t,this.refs=Ld,this.updater=a||vd}var Ps=bs.prototype=new Sd;Ps.constructor=bs;yd(Ps,Tr.prototype);Ps.isPureReactComponent=!0;var hd=Array.isArray,Id=Object.prototype.hasOwnProperty,Ts={current:null},Cd={key:!0,ref:!0,__self:!0,__source:!0};function wd(e,t,a){var r,o={},n=null,l=null;if(t!=null)for(r in t.ref!==void 0&&(l=t.ref),t.key!==void 0&&(n=""+t.key),t)Id.call(t,r)&&!Cd.hasOwnProperty(r)&&(o[r]=t[r]);var s=arguments.length-2;if(s===1)o.children=a;else if(1<s){for(var u=Array(s),d=0;d<s;d++)u[d]=arguments[d+2];o.children=u}if(e&&e.defaultProps)for(r in s=e.defaultProps,s)o[r]===void 0&&(o[r]=s[r]);return{$$typeof:yo,type:e,key:n,ref:l,props:o,_owner:Ts.current}}function cg(e,t){return{$$typeof:yo,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}function Rs(e){return typeof e=="object"&&e!==null&&e.$$typeof===yo}function pg(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(a){return t[a]})}var xd=/\\/+/g;function ks(e,t){return typeof e=="object"&&e!==null&&e.key!=null?pg(""+e.key):t.toString(36)}function Un(e,t,a,r,o){var n=typeof e;(n==="undefined"||n==="boolean")&&(e=null);var l=!1;if(e===null)l=!0;else switch(n){case"string":case"number":l=!0;break;case"object":switch(e.$$typeof){case yo:case tg:l=!0}}if(l)return l=e,o=o(l),e=r===""?"."+ks(l,0):r,hd(o)?(a="",e!=null&&(a=e.replace(xd,"$&/")+"/"),Un(o,t,a,"",function(d){return d})):o!=null&&(Rs(o)&&(o=cg(o,a+(!o.key||l&&l.key===o.key?"":(""+o.key).replace(xd,"$&/")+"/")+e)),t.push(o)),1;if(l=0,r=r===""?".":r+":",hd(e))for(var s=0;s<e.length;s++){n=e[s];var u=r+ks(n,s);l+=Un(n,t,a,u,o)}else if(u=fg(e),typeof u=="function")for(e=u.call(e),s=0;!(n=e.next()).done;)n=n.value,u=r+ks(n,s++),l+=Un(n,t,a,u,o);else if(n==="object")throw t=String(e),Error("Objects are not valid as a React child (found: "+(t==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":t)+"). If you meant to render a collection of children, use an array instead.");return l}function zn(e,t,a){if(e==null)return e;var r=[],o=0;return Un(e,r,"","",function(n){return t.call(a,n,o++)}),r}function mg(e){if(e._status===-1){var t=e._result;t=t(),t.then(function(a){(e._status===0||e._status===-1)&&(e._status=1,e._result=a)},function(a){(e._status===0||e._status===-1)&&(e._status=2,e._result=a)}),e._status===-1&&(e._status=0,e._result=t)}if(e._status===1)return e._result.default;throw e._result}var Qe={current:null},Nn={transition:null},gg={ReactCurrentDispatcher:Qe,ReactCurrentBatchConfig:Nn,ReactCurrentOwner:Ts};function kd(){throw Error("act(...) is not supported in production builds of React.")}le.Children={map:zn,forEach:function(e,t,a){zn(e,function(){t.apply(this,arguments)},a)},count:function(e){var t=0;return zn(e,function(){t++}),t},toArray:function(e){return zn(e,function(t){return t})||[]},only:function(e){if(!Rs(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};le.Component=Tr;le.Fragment=ag;le.Profiler=og;le.PureComponent=bs;le.StrictMode=rg;le.Suspense=ug;le.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=gg;le.act=kd;le.cloneElement=function(e,t,a){if(e==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+e+".");var r=yd({},e.props),o=e.key,n=e.ref,l=e._owner;if(t!=null){if(t.ref!==void 0&&(n=t.ref,l=Ts.current),t.key!==void 0&&(o=""+t.key),e.type&&e.type.defaultProps)var s=e.type.defaultProps;for(u in t)Id.call(t,u)&&!Cd.hasOwnProperty(u)&&(r[u]=t[u]===void 0&&s!==void 0?s[u]:t[u])}var u=arguments.length-2;if(u===1)r.children=a;else if(1<u){s=Array(u);for(var d=0;d<u;d++)s[d]=arguments[d+2];r.children=s}return{$$typeof:yo,type:e.type,key:o,ref:n,props:r,_owner:l}};le.createContext=function(e){return e={$$typeof:lg,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},e.Provider={$$typeof:ng,_context:e},e.Consumer=e};le.createElement=wd;le.createFactory=function(e){var t=wd.bind(null,e);return t.type=e,t};le.createRef=function(){return{current:null}};le.forwardRef=function(e){return{$$typeof:sg,render:e}};le.isValidElement=Rs;le.lazy=function(e){return{$$typeof:dg,_payload:{_status:-1,_result:e},_init:mg}};le.memo=function(e,t){return{$$typeof:ig,type:e,compare:t===void 0?null:t}};le.startTransition=function(e){var t=Nn.transition;Nn.transition={};try{e()}finally{Nn.transition=t}};le.unstable_act=kd;le.useCallback=function(e,t){return Qe.current.useCallback(e,t)};le.useContext=function(e){return Qe.current.useContext(e)};le.useDebugValue=function(){};le.useDeferredValue=function(e){return Qe.current.useDeferredValue(e)};le.useEffect=function(e,t){return Qe.current.useEffect(e,t)};le.useId=function(){return Qe.current.useId()};le.useImperativeHandle=function(e,t,a){return Qe.current.useImperativeHandle(e,t,a)};le.useInsertionEffect=function(e,t){return Qe.current.useInsertionEffect(e,t)};le.useLayoutEffect=function(e,t){return Qe.current.useLayoutEffect(e,t)};le.useMemo=function(e,t){return Qe.current.useMemo(e,t)};le.useReducer=function(e,t,a){return Qe.current.useReducer(e,t,a)};le.useRef=function(e){return Qe.current.useRef(e)};le.useState=function(e){return Qe.current.useState(e)};le.useSyncExternalStore=function(e,t,a){return Qe.current.useSyncExternalStore(e,t,a)};le.useTransition=function(){return Qe.current.useTransition()};le.version="18.3.1"});var Ce=Jt((vv,Pd)=>{"use strict";Pd.exports=bd()});var zd=Jt(xe=>{"use strict";function Es(e,t){var a=e.length;e.push(t);e:for(;0<a;){var r=a-1>>>1,o=e[r];if(0<Hn(o,t))e[r]=t,e[a]=o,a=r;else break e}}function Dt(e){return e.length===0?null:e[0]}function qn(e){if(e.length===0)return null;var t=e[0],a=e.pop();if(a!==t){e[0]=a;e:for(var r=0,o=e.length,n=o>>>1;r<n;){var l=2*(r+1)-1,s=e[l],u=l+1,d=e[u];if(0>Hn(s,a))u<o&&0>Hn(d,s)?(e[r]=d,e[u]=a,r=u):(e[r]=s,e[l]=a,r=l);else if(u<o&&0>Hn(d,a))e[r]=d,e[u]=a,r=u;else break e}}return t}function Hn(e,t){var a=e.sortIndex-t.sortIndex;return a!==0?a:e.id-t.id}typeof performance=="object"&&typeof performance.now=="function"?(Td=performance,xe.unstable_now=function(){return Td.now()}):(Ds=Date,Rd=Ds.now(),xe.unstable_now=function(){return Ds.now()-Rd});var Td,Ds,Rd,qt=[],ma=[],hg=1,ht=null,We=3,Wn=!1,Qa=!1,So=!1,Ad=typeof setTimeout=="function"?setTimeout:null,Ed=typeof clearTimeout=="function"?clearTimeout:null,Dd=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function Fs(e){for(var t=Dt(ma);t!==null;){if(t.callback===null)qn(ma);else if(t.startTime<=e)qn(ma),t.sortIndex=t.expirationTime,Es(qt,t);else break;t=Dt(ma)}}function Bs(e){if(So=!1,Fs(e),!Qa)if(Dt(qt)!==null)Qa=!0,zs(Os);else{var t=Dt(ma);t!==null&&Us(Bs,t.startTime-e)}}function Os(e,t){Qa=!1,So&&(So=!1,Ed(Io),Io=-1),Wn=!0;var a=We;try{for(Fs(t),ht=Dt(qt);ht!==null&&(!(ht.expirationTime>t)||e&&!Od());){var r=ht.callback;if(typeof r=="function"){ht.callback=null,We=ht.priorityLevel;var o=r(ht.expirationTime<=t);t=xe.unstable_now(),typeof o=="function"?ht.callback=o:ht===Dt(qt)&&qn(qt),Fs(t)}else qn(qt);ht=Dt(qt)}if(ht!==null)var n=!0;else{var l=Dt(ma);l!==null&&Us(Bs,l.startTime-t),n=!1}return n}finally{ht=null,We=a,Wn=!1}}var Vn=!1,_n=null,Io=-1,Fd=5,Bd=-1;function Od(){return!(xe.unstable_now()-Bd<Fd)}function Ms(){if(_n!==null){var e=xe.unstable_now();Bd=e;var t=!0;try{t=_n(!0,e)}finally{t?Lo():(Vn=!1,_n=null)}}else Vn=!1}var Lo;typeof Dd=="function"?Lo=function(){Dd(Ms)}:typeof MessageChannel<"u"?(As=new MessageChannel,Md=As.port2,As.port1.onmessage=Ms,Lo=function(){Md.postMessage(null)}):Lo=function(){Ad(Ms,0)};var As,Md;function zs(e){_n=e,Vn||(Vn=!0,Lo())}function Us(e,t){Io=Ad(function(){e(xe.unstable_now())},t)}xe.unstable_IdlePriority=5;xe.unstable_ImmediatePriority=1;xe.unstable_LowPriority=4;xe.unstable_NormalPriority=3;xe.unstable_Profiling=null;xe.unstable_UserBlockingPriority=2;xe.unstable_cancelCallback=function(e){e.callback=null};xe.unstable_continueExecution=function(){Qa||Wn||(Qa=!0,zs(Os))};xe.unstable_forceFrameRate=function(e){0>e||125<e?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):Fd=0<e?Math.floor(1e3/e):5};xe.unstable_getCurrentPriorityLevel=function(){return We};xe.unstable_getFirstCallbackNode=function(){return Dt(qt)};xe.unstable_next=function(e){switch(We){case 1:case 2:case 3:var t=3;break;default:t=We}var a=We;We=t;try{return e()}finally{We=a}};xe.unstable_pauseExecution=function(){};xe.unstable_requestPaint=function(){};xe.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var a=We;We=e;try{return t()}finally{We=a}};xe.unstable_scheduleCallback=function(e,t,a){var r=xe.unstable_now();switch(typeof a=="object"&&a!==null?(a=a.delay,a=typeof a=="number"&&0<a?r+a:r):a=r,e){case 1:var o=-1;break;case 2:o=250;break;case 5:o=1073741823;break;case 4:o=1e4;break;default:o=5e3}return o=a+o,e={id:hg++,callback:t,priorityLevel:e,startTime:a,expirationTime:o,sortIndex:-1},a>r?(e.sortIndex=a,Es(ma,e),Dt(qt)===null&&e===Dt(ma)&&(So?(Ed(Io),Io=-1):So=!0,Us(Bs,a-r))):(e.sortIndex=o,Es(qt,e),Qa||Wn||(Qa=!0,zs(Os))),e};xe.unstable_shouldYield=Od;xe.unstable_wrapCallback=function(e){var t=We;return function(){var a=We;We=t;try{return e.apply(this,arguments)}finally{We=a}}}});var Nd=Jt((Lv,Ud)=>{"use strict";Ud.exports=zd()});var Vp=Jt(pt=>{"use strict";var xg=Ce(),ft=Nd();function T(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,a=1;a<arguments.length;a++)t+="&args[]="+encodeURIComponent(arguments[a]);return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var Gf=new Set,Vo={};function ir(e,t){Xr(e,t),Xr(e+"Capture",t)}function Xr(e,t){for(Vo[e]=t,e=0;e<t.length;e++)Gf.add(t[e])}var na=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),su=Object.prototype.hasOwnProperty,vg=/^[: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]*$/,Hd={},_d={};function yg(e){return su.call(_d,e)?!0:su.call(Hd,e)?!1:vg.test(e)?_d[e]=!0:(Hd[e]=!0,!1)}function Lg(e,t,a,r){if(a!==null&&a.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return r?!1:a!==null?!a.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function Sg(e,t,a,r){if(t===null||typeof t>"u"||Lg(e,t,a,r))return!0;if(r)return!1;if(a!==null)switch(a.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function Je(e,t,a,r,o,n,l){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=r,this.attributeNamespace=o,this.mustUseProperty=a,this.propertyName=e,this.type=t,this.sanitizeURL=n,this.removeEmptyString=l}var qe={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){qe[e]=new Je(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];qe[t]=new Je(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){qe[e]=new Je(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){qe[e]=new Je(e,2,!1,e,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(e){qe[e]=new Je(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){qe[e]=new Je(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){qe[e]=new Je(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){qe[e]=new Je(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){qe[e]=new Je(e,5,!1,e.toLowerCase(),null,!1,!1)});var Ju=/[\\-:]([a-z])/g;function ei(e){return e[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(e){var t=e.replace(Ju,ei);qe[t]=new Je(t,1,!1,e,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(Ju,ei);qe[t]=new Je(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(Ju,ei);qe[t]=new Je(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){qe[e]=new Je(e,1,!1,e.toLowerCase(),null,!1,!1)});qe.xlinkHref=new Je("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){qe[e]=new Je(e,1,!1,e.toLowerCase(),null,!0,!0)});function ti(e,t,a,r){var o=qe.hasOwnProperty(t)?qe[t]:null;(o!==null?o.type!==0:r||!(2<t.length)||t[0]!=="o"&&t[0]!=="O"||t[1]!=="n"&&t[1]!=="N")&&(Sg(t,a,o,r)&&(a=null),r||o===null?yg(t)&&(a===null?e.removeAttribute(t):e.setAttribute(t,""+a)):o.mustUseProperty?e[o.propertyName]=a===null?o.type===3?!1:"":a:(t=o.attributeName,r=o.attributeNamespace,a===null?e.removeAttribute(t):(o=o.type,a=o===3||o===4&&a===!0?"":""+a,r?e.setAttributeNS(r,t,a):e.setAttribute(t,a))))}var ia=xg.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,$n=Symbol.for("react.element"),Mr=Symbol.for("react.portal"),Ar=Symbol.for("react.fragment"),ai=Symbol.for("react.strict_mode"),uu=Symbol.for("react.profiler"),jf=Symbol.for("react.provider"),Xf=Symbol.for("react.context"),ri=Symbol.for("react.forward_ref"),iu=Symbol.for("react.suspense"),du=Symbol.for("react.suspense_list"),oi=Symbol.for("react.memo"),ha=Symbol.for("react.lazy");Symbol.for("react.scope");Symbol.for("react.debug_trace_mode");var Qf=Symbol.for("react.offscreen");Symbol.for("react.legacy_hidden");Symbol.for("react.cache");Symbol.for("react.tracing_marker");var qd=Symbol.iterator;function Co(e){return e===null||typeof e!="object"?null:(e=qd&&e[qd]||e["@@iterator"],typeof e=="function"?e:null)}var Pe=Object.assign,Ns;function Mo(e){if(Ns===void 0)try{throw Error()}catch(a){var t=a.stack.trim().match(/\\n( *(at )?)/);Ns=t&&t[1]||""}return`\n`+Ns+e}var Hs=!1;function _s(e,t){if(!e||Hs)return"";Hs=!0;var a=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(t)if(t=function(){throw Error()},Object.defineProperty(t.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(t,[])}catch(d){var r=d}Reflect.construct(e,[],t)}else{try{t.call()}catch(d){r=d}e.call(t.prototype)}else{try{throw Error()}catch(d){r=d}e()}}catch(d){if(d&&r&&typeof d.stack=="string"){for(var o=d.stack.split(`\n`),n=r.stack.split(`\n`),l=o.length-1,s=n.length-1;1<=l&&0<=s&&o[l]!==n[s];)s--;for(;1<=l&&0<=s;l--,s--)if(o[l]!==n[s]){if(l!==1||s!==1)do if(l--,s--,0>s||o[l]!==n[s]){var u=`\n`+o[l].replace(" at new "," at ");return e.displayName&&u.includes("<anonymous>")&&(u=u.replace("<anonymous>",e.displayName)),u}while(1<=l&&0<=s);break}}}finally{Hs=!1,Error.prepareStackTrace=a}return(e=e?e.displayName||e.name:"")?Mo(e):""}function Ig(e){switch(e.tag){case 5:return Mo(e.type);case 16:return Mo("Lazy");case 13:return Mo("Suspense");case 19:return Mo("SuspenseList");case 0:case 2:case 15:return e=_s(e.type,!1),e;case 11:return e=_s(e.type.render,!1),e;case 1:return e=_s(e.type,!0),e;default:return""}}function fu(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case Ar:return"Fragment";case Mr:return"Portal";case uu:return"Profiler";case ai:return"StrictMode";case iu:return"Suspense";case du:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case Xf:return(e.displayName||"Context")+".Consumer";case jf:return(e._context.displayName||"Context")+".Provider";case ri:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case oi:return t=e.displayName||null,t!==null?t:fu(e.type)||"Memo";case ha:t=e._payload,e=e._init;try{return fu(e(t))}catch{}}return null}function Cg(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return fu(t);case 8:return t===ai?"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 t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function Da(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Yf(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function wg(e){var t=Yf(e)?"checked":"value",a=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=""+e[t];if(!e.hasOwnProperty(t)&&typeof a<"u"&&typeof a.get=="function"&&typeof a.set=="function"){var o=a.get,n=a.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return o.call(this)},set:function(l){r=""+l,n.call(this,l)}}),Object.defineProperty(e,t,{enumerable:a.enumerable}),{getValue:function(){return r},setValue:function(l){r=""+l},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Kn(e){e._valueTracker||(e._valueTracker=wg(e))}function Zf(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var a=t.getValue(),r="";return e&&(r=Yf(e)?e.checked?"true":"false":e.value),e=r,e!==a?(t.setValue(e),!0):!1}function Ll(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function cu(e,t){var a=t.checked;return Pe({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:a??e._wrapperState.initialChecked})}function Wd(e,t){var a=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;a=Da(t.value!=null?t.value:a),e._wrapperState={initialChecked:r,initialValue:a,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function Jf(e,t){t=t.checked,t!=null&&ti(e,"checked",t,!1)}function pu(e,t){Jf(e,t);var a=Da(t.value),r=t.type;if(a!=null)r==="number"?(a===0&&e.value===""||e.value!=a)&&(e.value=""+a):e.value!==""+a&&(e.value=""+a);else if(r==="submit"||r==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?mu(e,t.type,a):t.hasOwnProperty("defaultValue")&&mu(e,t.type,Da(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function Vd(e,t,a){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var r=t.type;if(!(r!=="submit"&&r!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,a||t===e.value||(e.value=t),e.defaultValue=t}a=e.name,a!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,a!==""&&(e.name=a)}function mu(e,t,a){(t!=="number"||Ll(e.ownerDocument)!==e)&&(a==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+a&&(e.defaultValue=""+a))}var Ao=Array.isArray;function Wr(e,t,a,r){if(e=e.options,t){t={};for(var o=0;o<a.length;o++)t["$"+a[o]]=!0;for(a=0;a<e.length;a++)o=t.hasOwnProperty("$"+e[a].value),e[a].selected!==o&&(e[a].selected=o),o&&r&&(e[a].defaultSelected=!0)}else{for(a=""+Da(a),t=null,o=0;o<e.length;o++){if(e[o].value===a){e[o].selected=!0,r&&(e[o].defaultSelected=!0);return}t!==null||e[o].disabled||(t=e[o])}t!==null&&(t.selected=!0)}}function gu(e,t){if(t.dangerouslySetInnerHTML!=null)throw Error(T(91));return Pe({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function $d(e,t){var a=t.value;if(a==null){if(a=t.children,t=t.defaultValue,a!=null){if(t!=null)throw Error(T(92));if(Ao(a)){if(1<a.length)throw Error(T(93));a=a[0]}t=a}t==null&&(t=""),a=t}e._wrapperState={initialValue:Da(a)}}function ec(e,t){var a=Da(t.value),r=Da(t.defaultValue);a!=null&&(a=""+a,a!==e.value&&(e.value=a),t.defaultValue==null&&e.defaultValue!==a&&(e.defaultValue=a)),r!=null&&(e.defaultValue=""+r)}function Kd(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==""&&t!==null&&(e.value=t)}function tc(e){switch(e){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 hu(e,t){return e==null||e==="http://www.w3.org/1999/xhtml"?tc(t):e==="http://www.w3.org/2000/svg"&&t==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var Gn,ac=(function(e){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(t,a,r,o){MSApp.execUnsafeLocalFunction(function(){return e(t,a,r,o)})}:e})(function(e,t){if(e.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in e)e.innerHTML=t;else{for(Gn=Gn||document.createElement("div"),Gn.innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=Gn.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function $o(e,t){if(t){var a=e.firstChild;if(a&&a===e.lastChild&&a.nodeType===3){a.nodeValue=t;return}}e.textContent=t}var Bo={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},kg=["Webkit","ms","Moz","O"];Object.keys(Bo).forEach(function(e){kg.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),Bo[t]=Bo[e]})});function rc(e,t,a){return t==null||typeof t=="boolean"||t===""?"":a||typeof t!="number"||t===0||Bo.hasOwnProperty(e)&&Bo[e]?(""+t).trim():t+"px"}function oc(e,t){e=e.style;for(var a in t)if(t.hasOwnProperty(a)){var r=a.indexOf("--")===0,o=rc(a,t[a],r);a==="float"&&(a="cssFloat"),r?e.setProperty(a,o):e[a]=o}}var bg=Pe({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 xu(e,t){if(t){if(bg[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(T(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(T(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(T(61))}if(t.style!=null&&typeof t.style!="object")throw Error(T(62))}}function vu(e,t){if(e.indexOf("-")===-1)return typeof t.is=="string";switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var yu=null;function ni(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Lu=null,Vr=null,$r=null;function Gd(e){if(e=dn(e)){if(typeof Lu!="function")throw Error(T(280));var t=e.stateNode;t&&(t=jl(t),Lu(e.stateNode,e.type,t))}}function nc(e){Vr?$r?$r.push(e):$r=[e]:Vr=e}function lc(){if(Vr){var e=Vr,t=$r;if($r=Vr=null,Gd(e),t)for(e=0;e<t.length;e++)Gd(t[e])}}function sc(e,t){return e(t)}function uc(){}var qs=!1;function ic(e,t,a){if(qs)return e(t,a);qs=!0;try{return sc(e,t,a)}finally{qs=!1,(Vr!==null||$r!==null)&&(uc(),lc())}}function Ko(e,t){var a=e.stateNode;if(a===null)return null;var r=jl(a);if(r===null)return null;a=r[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(r=!r.disabled)||(e=e.type,r=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!r;break e;default:e=!1}if(e)return null;if(a&&typeof a!="function")throw Error(T(231,t,typeof a));return a}var Su=!1;if(na)try{Rr={},Object.defineProperty(Rr,"passive",{get:function(){Su=!0}}),window.addEventListener("test",Rr,Rr),window.removeEventListener("test",Rr,Rr)}catch{Su=!1}var Rr;function Pg(e,t,a,r,o,n,l,s,u){var d=Array.prototype.slice.call(arguments,3);try{t.apply(a,d)}catch(g){this.onError(g)}}var Oo=!1,Sl=null,Il=!1,Iu=null,Tg={onError:function(e){Oo=!0,Sl=e}};function Rg(e,t,a,r,o,n,l,s,u){Oo=!1,Sl=null,Pg.apply(Tg,arguments)}function Dg(e,t,a,r,o,n,l,s,u){if(Rg.apply(this,arguments),Oo){if(Oo){var d=Sl;Oo=!1,Sl=null}else throw Error(T(198));Il||(Il=!0,Iu=d)}}function dr(e){var t=e,a=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,(t.flags&4098)!==0&&(a=t.return),e=t.return;while(e)}return t.tag===3?a:null}function dc(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function jd(e){if(dr(e)!==e)throw Error(T(188))}function Mg(e){var t=e.alternate;if(!t){if(t=dr(e),t===null)throw Error(T(188));return t!==e?null:e}for(var a=e,r=t;;){var o=a.return;if(o===null)break;var n=o.alternate;if(n===null){if(r=o.return,r!==null){a=r;continue}break}if(o.child===n.child){for(n=o.child;n;){if(n===a)return jd(o),e;if(n===r)return jd(o),t;n=n.sibling}throw Error(T(188))}if(a.return!==r.return)a=o,r=n;else{for(var l=!1,s=o.child;s;){if(s===a){l=!0,a=o,r=n;break}if(s===r){l=!0,r=o,a=n;break}s=s.sibling}if(!l){for(s=n.child;s;){if(s===a){l=!0,a=n,r=o;break}if(s===r){l=!0,r=n,a=o;break}s=s.sibling}if(!l)throw Error(T(189))}}if(a.alternate!==r)throw Error(T(190))}if(a.tag!==3)throw Error(T(188));return a.stateNode.current===a?e:t}function fc(e){return e=Mg(e),e!==null?cc(e):null}function cc(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=cc(e);if(t!==null)return t;e=e.sibling}return null}var pc=ft.unstable_scheduleCallback,Xd=ft.unstable_cancelCallback,Ag=ft.unstable_shouldYield,Eg=ft.unstable_requestPaint,De=ft.unstable_now,Fg=ft.unstable_getCurrentPriorityLevel,li=ft.unstable_ImmediatePriority,mc=ft.unstable_UserBlockingPriority,Cl=ft.unstable_NormalPriority,Bg=ft.unstable_LowPriority,gc=ft.unstable_IdlePriority,Vl=null,Kt=null;function Og(e){if(Kt&&typeof Kt.onCommitFiberRoot=="function")try{Kt.onCommitFiberRoot(Vl,e,void 0,(e.current.flags&128)===128)}catch{}}var Bt=Math.clz32?Math.clz32:Ng,zg=Math.log,Ug=Math.LN2;function Ng(e){return e>>>=0,e===0?32:31-(zg(e)/Ug|0)|0}var jn=64,Xn=4194304;function Eo(e){switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64: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 e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function wl(e,t){var a=e.pendingLanes;if(a===0)return 0;var r=0,o=e.suspendedLanes,n=e.pingedLanes,l=a&268435455;if(l!==0){var s=l&~o;s!==0?r=Eo(s):(n&=l,n!==0&&(r=Eo(n)))}else l=a&~o,l!==0?r=Eo(l):n!==0&&(r=Eo(n));if(r===0)return 0;if(t!==0&&t!==r&&(t&o)===0&&(o=r&-r,n=t&-t,o>=n||o===16&&(n&4194240)!==0))return t;if((r&4)!==0&&(r|=a&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=r;0<t;)a=31-Bt(t),o=1<<a,r|=e[a],t&=~o;return r}function Hg(e,t){switch(e){case 1:case 2:case 4:return t+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 t+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 _g(e,t){for(var a=e.suspendedLanes,r=e.pingedLanes,o=e.expirationTimes,n=e.pendingLanes;0<n;){var l=31-Bt(n),s=1<<l,u=o[l];u===-1?((s&a)===0||(s&r)!==0)&&(o[l]=Hg(s,t)):u<=t&&(e.expiredLanes|=s),n&=~s}}function Cu(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function hc(){var e=jn;return jn<<=1,(jn&4194240)===0&&(jn=64),e}function Ws(e){for(var t=[],a=0;31>a;a++)t.push(e);return t}function sn(e,t,a){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-Bt(t),e[t]=a}function qg(e,t){var a=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var r=e.eventTimes;for(e=e.expirationTimes;0<a;){var o=31-Bt(a),n=1<<o;t[o]=0,r[o]=-1,e[o]=-1,a&=~n}}function si(e,t){var a=e.entangledLanes|=t;for(e=e.entanglements;a;){var r=31-Bt(a),o=1<<r;o&t|e[r]&t&&(e[r]|=t),a&=~o}}var me=0;function xc(e){return e&=-e,1<e?4<e?(e&268435455)!==0?16:536870912:4:1}var vc,ui,yc,Lc,Sc,wu=!1,Qn=[],Ia=null,Ca=null,wa=null,Go=new Map,jo=new Map,va=[],Wg="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 Qd(e,t){switch(e){case"focusin":case"focusout":Ia=null;break;case"dragenter":case"dragleave":Ca=null;break;case"mouseover":case"mouseout":wa=null;break;case"pointerover":case"pointerout":Go.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":jo.delete(t.pointerId)}}function wo(e,t,a,r,o,n){return e===null||e.nativeEvent!==n?(e={blockedOn:t,domEventName:a,eventSystemFlags:r,nativeEvent:n,targetContainers:[o]},t!==null&&(t=dn(t),t!==null&&ui(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,o!==null&&t.indexOf(o)===-1&&t.push(o),e)}function Vg(e,t,a,r,o){switch(t){case"focusin":return Ia=wo(Ia,e,t,a,r,o),!0;case"dragenter":return Ca=wo(Ca,e,t,a,r,o),!0;case"mouseover":return wa=wo(wa,e,t,a,r,o),!0;case"pointerover":var n=o.pointerId;return Go.set(n,wo(Go.get(n)||null,e,t,a,r,o)),!0;case"gotpointercapture":return n=o.pointerId,jo.set(n,wo(jo.get(n)||null,e,t,a,r,o)),!0}return!1}function Ic(e){var t=Ja(e.target);if(t!==null){var a=dr(t);if(a!==null){if(t=a.tag,t===13){if(t=dc(a),t!==null){e.blockedOn=t,Sc(e.priority,function(){yc(a)});return}}else if(t===3&&a.stateNode.current.memoizedState.isDehydrated){e.blockedOn=a.tag===3?a.stateNode.containerInfo:null;return}}}e.blockedOn=null}function dl(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var a=ku(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(a===null){a=e.nativeEvent;var r=new a.constructor(a.type,a);yu=r,a.target.dispatchEvent(r),yu=null}else return t=dn(a),t!==null&&ui(t),e.blockedOn=a,!1;t.shift()}return!0}function Yd(e,t,a){dl(e)&&a.delete(t)}function $g(){wu=!1,Ia!==null&&dl(Ia)&&(Ia=null),Ca!==null&&dl(Ca)&&(Ca=null),wa!==null&&dl(wa)&&(wa=null),Go.forEach(Yd),jo.forEach(Yd)}function ko(e,t){e.blockedOn===t&&(e.blockedOn=null,wu||(wu=!0,ft.unstable_scheduleCallback(ft.unstable_NormalPriority,$g)))}function Xo(e){function t(o){return ko(o,e)}if(0<Qn.length){ko(Qn[0],e);for(var a=1;a<Qn.length;a++){var r=Qn[a];r.blockedOn===e&&(r.blockedOn=null)}}for(Ia!==null&&ko(Ia,e),Ca!==null&&ko(Ca,e),wa!==null&&ko(wa,e),Go.forEach(t),jo.forEach(t),a=0;a<va.length;a++)r=va[a],r.blockedOn===e&&(r.blockedOn=null);for(;0<va.length&&(a=va[0],a.blockedOn===null);)Ic(a),a.blockedOn===null&&va.shift()}var Kr=ia.ReactCurrentBatchConfig,kl=!0;function Kg(e,t,a,r){var o=me,n=Kr.transition;Kr.transition=null;try{me=1,ii(e,t,a,r)}finally{me=o,Kr.transition=n}}function Gg(e,t,a,r){var o=me,n=Kr.transition;Kr.transition=null;try{me=4,ii(e,t,a,r)}finally{me=o,Kr.transition=n}}function ii(e,t,a,r){if(kl){var o=ku(e,t,a,r);if(o===null)Qs(e,t,r,bl,a),Qd(e,r);else if(Vg(o,e,t,a,r))r.stopPropagation();else if(Qd(e,r),t&4&&-1<Wg.indexOf(e)){for(;o!==null;){var n=dn(o);if(n!==null&&vc(n),n=ku(e,t,a,r),n===null&&Qs(e,t,r,bl,a),n===o)break;o=n}o!==null&&r.stopPropagation()}else Qs(e,t,r,null,a)}}var bl=null;function ku(e,t,a,r){if(bl=null,e=ni(r),e=Ja(e),e!==null)if(t=dr(e),t===null)e=null;else if(a=t.tag,a===13){if(e=dc(t),e!==null)return e;e=null}else if(a===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null);return bl=e,null}function Cc(e){switch(e){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(Fg()){case li:return 1;case mc:return 4;case Cl:case Bg:return 16;case gc:return 536870912;default:return 16}default:return 16}}var La=null,di=null,fl=null;function wc(){if(fl)return fl;var e,t=di,a=t.length,r,o="value"in La?La.value:La.textContent,n=o.length;for(e=0;e<a&&t[e]===o[e];e++);var l=a-e;for(r=1;r<=l&&t[a-r]===o[n-r];r++);return fl=o.slice(e,1<r?1-r:void 0)}function cl(e){var t=e.keyCode;return"charCode"in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function Yn(){return!0}function Zd(){return!1}function ct(e){function t(a,r,o,n,l){this._reactName=a,this._targetInst=o,this.type=r,this.nativeEvent=n,this.target=l,this.currentTarget=null;for(var s in e)e.hasOwnProperty(s)&&(a=e[s],this[s]=a?a(n):n[s]);return this.isDefaultPrevented=(n.defaultPrevented!=null?n.defaultPrevented:n.returnValue===!1)?Yn:Zd,this.isPropagationStopped=Zd,this}return Pe(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var a=this.nativeEvent;a&&(a.preventDefault?a.preventDefault():typeof a.returnValue!="unknown"&&(a.returnValue=!1),this.isDefaultPrevented=Yn)},stopPropagation:function(){var a=this.nativeEvent;a&&(a.stopPropagation?a.stopPropagation():typeof a.cancelBubble!="unknown"&&(a.cancelBubble=!0),this.isPropagationStopped=Yn)},persist:function(){},isPersistent:Yn}),t}var ao={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},fi=ct(ao),un=Pe({},ao,{view:0,detail:0}),jg=ct(un),Vs,$s,bo,$l=Pe({},un,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:ci,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return"movementX"in e?e.movementX:(e!==bo&&(bo&&e.type==="mousemove"?(Vs=e.screenX-bo.screenX,$s=e.screenY-bo.screenY):$s=Vs=0,bo=e),Vs)},movementY:function(e){return"movementY"in e?e.movementY:$s}}),Jd=ct($l),Xg=Pe({},$l,{dataTransfer:0}),Qg=ct(Xg),Yg=Pe({},un,{relatedTarget:0}),Ks=ct(Yg),Zg=Pe({},ao,{animationName:0,elapsedTime:0,pseudoElement:0}),Jg=ct(Zg),eh=Pe({},ao,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),th=ct(eh),ah=Pe({},ao,{data:0}),ef=ct(ah),rh={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},oh={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"},nh={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function lh(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=nh[e])?!!t[e]:!1}function ci(){return lh}var sh=Pe({},un,{key:function(e){if(e.key){var t=rh[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=cl(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?oh[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:ci,charCode:function(e){return e.type==="keypress"?cl(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?cl(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),uh=ct(sh),ih=Pe({},$l,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),tf=ct(ih),dh=Pe({},un,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:ci}),fh=ct(dh),ch=Pe({},ao,{propertyName:0,elapsedTime:0,pseudoElement:0}),ph=ct(ch),mh=Pe({},$l,{deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0}),gh=ct(mh),hh=[9,13,27,32],pi=na&&"CompositionEvent"in window,zo=null;na&&"documentMode"in document&&(zo=document.documentMode);var xh=na&&"TextEvent"in window&&!zo,kc=na&&(!pi||zo&&8<zo&&11>=zo),af=" ",rf=!1;function bc(e,t){switch(e){case"keyup":return hh.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Pc(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Er=!1;function vh(e,t){switch(e){case"compositionend":return Pc(t);case"keypress":return t.which!==32?null:(rf=!0,af);case"textInput":return e=t.data,e===af&&rf?null:e;default:return null}}function yh(e,t){if(Er)return e==="compositionend"||!pi&&bc(e,t)?(e=wc(),fl=di=La=null,Er=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case"compositionend":return kc&&t.locale!=="ko"?null:t.data;default:return null}}var Lh={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 of(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!Lh[e.type]:t==="textarea"}function Tc(e,t,a,r){nc(r),t=Pl(t,"onChange"),0<t.length&&(a=new fi("onChange","change",null,a,r),e.push({event:a,listeners:t}))}var Uo=null,Qo=null;function Sh(e){Nc(e,0)}function Kl(e){var t=Or(e);if(Zf(t))return e}function Ih(e,t){if(e==="change")return t}var Rc=!1;na&&(na?(Jn="oninput"in document,Jn||(Gs=document.createElement("div"),Gs.setAttribute("oninput","return;"),Jn=typeof Gs.oninput=="function"),Zn=Jn):Zn=!1,Rc=Zn&&(!document.documentMode||9<document.documentMode));var Zn,Jn,Gs;function nf(){Uo&&(Uo.detachEvent("onpropertychange",Dc),Qo=Uo=null)}function Dc(e){if(e.propertyName==="value"&&Kl(Qo)){var t=[];Tc(t,Qo,e,ni(e)),ic(Sh,t)}}function Ch(e,t,a){e==="focusin"?(nf(),Uo=t,Qo=a,Uo.attachEvent("onpropertychange",Dc)):e==="focusout"&&nf()}function wh(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Kl(Qo)}function kh(e,t){if(e==="click")return Kl(t)}function bh(e,t){if(e==="input"||e==="change")return Kl(t)}function Ph(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var zt=typeof Object.is=="function"?Object.is:Ph;function Yo(e,t){if(zt(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var a=Object.keys(e),r=Object.keys(t);if(a.length!==r.length)return!1;for(r=0;r<a.length;r++){var o=a[r];if(!su.call(t,o)||!zt(e[o],t[o]))return!1}return!0}function lf(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function sf(e,t){var a=lf(e);e=0;for(var r;a;){if(a.nodeType===3){if(r=e+a.textContent.length,e<=t&&r>=t)return{node:a,offset:t-e};e=r}e:{for(;a;){if(a.nextSibling){a=a.nextSibling;break e}a=a.parentNode}a=void 0}a=lf(a)}}function Mc(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Mc(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Ac(){for(var e=window,t=Ll();t instanceof e.HTMLIFrameElement;){try{var a=typeof t.contentWindow.location.href=="string"}catch{a=!1}if(a)e=t.contentWindow;else break;t=Ll(e.document)}return t}function mi(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}function Th(e){var t=Ac(),a=e.focusedElem,r=e.selectionRange;if(t!==a&&a&&a.ownerDocument&&Mc(a.ownerDocument.documentElement,a)){if(r!==null&&mi(a)){if(t=r.start,e=r.end,e===void 0&&(e=t),"selectionStart"in a)a.selectionStart=t,a.selectionEnd=Math.min(e,a.value.length);else if(e=(t=a.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var o=a.textContent.length,n=Math.min(r.start,o);r=r.end===void 0?n:Math.min(r.end,o),!e.extend&&n>r&&(o=r,r=n,n=o),o=sf(a,n);var l=sf(a,r);o&&l&&(e.rangeCount!==1||e.anchorNode!==o.node||e.anchorOffset!==o.offset||e.focusNode!==l.node||e.focusOffset!==l.offset)&&(t=t.createRange(),t.setStart(o.node,o.offset),e.removeAllRanges(),n>r?(e.addRange(t),e.extend(l.node,l.offset)):(t.setEnd(l.node,l.offset),e.addRange(t)))}}for(t=[],e=a;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof a.focus=="function"&&a.focus(),a=0;a<t.length;a++)e=t[a],e.element.scrollLeft=e.left,e.element.scrollTop=e.top}}var Rh=na&&"documentMode"in document&&11>=document.documentMode,Fr=null,bu=null,No=null,Pu=!1;function uf(e,t,a){var r=a.window===a?a.document:a.nodeType===9?a:a.ownerDocument;Pu||Fr==null||Fr!==Ll(r)||(r=Fr,"selectionStart"in r&&mi(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),No&&Yo(No,r)||(No=r,r=Pl(bu,"onSelect"),0<r.length&&(t=new fi("onSelect","select",null,t,a),e.push({event:t,listeners:r}),t.target=Fr)))}function el(e,t){var a={};return a[e.toLowerCase()]=t.toLowerCase(),a["Webkit"+e]="webkit"+t,a["Moz"+e]="moz"+t,a}var Br={animationend:el("Animation","AnimationEnd"),animationiteration:el("Animation","AnimationIteration"),animationstart:el("Animation","AnimationStart"),transitionend:el("Transition","TransitionEnd")},js={},Ec={};na&&(Ec=document.createElement("div").style,"AnimationEvent"in window||(delete Br.animationend.animation,delete Br.animationiteration.animation,delete Br.animationstart.animation),"TransitionEvent"in window||delete Br.transitionend.transition);function Gl(e){if(js[e])return js[e];if(!Br[e])return e;var t=Br[e],a;for(a in t)if(t.hasOwnProperty(a)&&a in Ec)return js[e]=t[a];return e}var Fc=Gl("animationend"),Bc=Gl("animationiteration"),Oc=Gl("animationstart"),zc=Gl("transitionend"),Uc=new Map,df="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 Aa(e,t){Uc.set(e,t),ir(t,[e])}for(tl=0;tl<df.length;tl++)al=df[tl],ff=al.toLowerCase(),cf=al[0].toUpperCase()+al.slice(1),Aa(ff,"on"+cf);var al,ff,cf,tl;Aa(Fc,"onAnimationEnd");Aa(Bc,"onAnimationIteration");Aa(Oc,"onAnimationStart");Aa("dblclick","onDoubleClick");Aa("focusin","onFocus");Aa("focusout","onBlur");Aa(zc,"onTransitionEnd");Xr("onMouseEnter",["mouseout","mouseover"]);Xr("onMouseLeave",["mouseout","mouseover"]);Xr("onPointerEnter",["pointerout","pointerover"]);Xr("onPointerLeave",["pointerout","pointerover"]);ir("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));ir("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));ir("onBeforeInput",["compositionend","keypress","textInput","paste"]);ir("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));ir("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));ir("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Fo="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(" "),Dh=new Set("cancel close invalid load scroll toggle".split(" ").concat(Fo));function pf(e,t,a){var r=e.type||"unknown-event";e.currentTarget=a,Dg(r,t,void 0,e),e.currentTarget=null}function Nc(e,t){t=(t&4)!==0;for(var a=0;a<e.length;a++){var r=e[a],o=r.event;r=r.listeners;e:{var n=void 0;if(t)for(var l=r.length-1;0<=l;l--){var s=r[l],u=s.instance,d=s.currentTarget;if(s=s.listener,u!==n&&o.isPropagationStopped())break e;pf(o,s,d),n=u}else for(l=0;l<r.length;l++){if(s=r[l],u=s.instance,d=s.currentTarget,s=s.listener,u!==n&&o.isPropagationStopped())break e;pf(o,s,d),n=u}}}if(Il)throw e=Iu,Il=!1,Iu=null,e}function Le(e,t){var a=t[Au];a===void 0&&(a=t[Au]=new Set);var r=e+"__bubble";a.has(r)||(Hc(t,e,2,!1),a.add(r))}function Xs(e,t,a){var r=0;t&&(r|=4),Hc(a,e,r,t)}var rl="_reactListening"+Math.random().toString(36).slice(2);function Zo(e){if(!e[rl]){e[rl]=!0,Gf.forEach(function(a){a!=="selectionchange"&&(Dh.has(a)||Xs(a,!1,e),Xs(a,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[rl]||(t[rl]=!0,Xs("selectionchange",!1,t))}}function Hc(e,t,a,r){switch(Cc(t)){case 1:var o=Kg;break;case 4:o=Gg;break;default:o=ii}a=o.bind(null,t,a,e),o=void 0,!Su||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(o=!0),r?o!==void 0?e.addEventListener(t,a,{capture:!0,passive:o}):e.addEventListener(t,a,!0):o!==void 0?e.addEventListener(t,a,{passive:o}):e.addEventListener(t,a,!1)}function Qs(e,t,a,r,o){var n=r;if((t&1)===0&&(t&2)===0&&r!==null)e:for(;;){if(r===null)return;var l=r.tag;if(l===3||l===4){var s=r.stateNode.containerInfo;if(s===o||s.nodeType===8&&s.parentNode===o)break;if(l===4)for(l=r.return;l!==null;){var u=l.tag;if((u===3||u===4)&&(u=l.stateNode.containerInfo,u===o||u.nodeType===8&&u.parentNode===o))return;l=l.return}for(;s!==null;){if(l=Ja(s),l===null)return;if(u=l.tag,u===5||u===6){r=n=l;continue e}s=s.parentNode}}r=r.return}ic(function(){var d=n,g=ni(a),m=[];e:{var p=Uc.get(e);if(p!==void 0){var v=fi,L=e;switch(e){case"keypress":if(cl(a)===0)break e;case"keydown":case"keyup":v=uh;break;case"focusin":L="focus",v=Ks;break;case"focusout":L="blur",v=Ks;break;case"beforeblur":case"afterblur":v=Ks;break;case"click":if(a.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":v=Jd;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":v=Qg;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":v=fh;break;case Fc:case Bc:case Oc:v=Jg;break;case zc:v=ph;break;case"scroll":v=jg;break;case"wheel":v=gh;break;case"copy":case"cut":case"paste":v=th;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":v=tf}var S=(t&4)!==0,z=!S&&e==="scroll",c=S?p!==null?p+"Capture":null:p;S=[];for(var i=d,f;i!==null;){f=i;var y=f.stateNode;if(f.tag===5&&y!==null&&(f=y,c!==null&&(y=Ko(i,c),y!=null&&S.push(Jo(i,y,f)))),z)break;i=i.return}0<S.length&&(p=new v(p,L,null,a,g),m.push({event:p,listeners:S}))}}if((t&7)===0){e:{if(p=e==="mouseover"||e==="pointerover",v=e==="mouseout"||e==="pointerout",p&&a!==yu&&(L=a.relatedTarget||a.fromElement)&&(Ja(L)||L[la]))break e;if((v||p)&&(p=g.window===g?g:(p=g.ownerDocument)?p.defaultView||p.parentWindow:window,v?(L=a.relatedTarget||a.toElement,v=d,L=L?Ja(L):null,L!==null&&(z=dr(L),L!==z||L.tag!==5&&L.tag!==6)&&(L=null)):(v=null,L=d),v!==L)){if(S=Jd,y="onMouseLeave",c="onMouseEnter",i="mouse",(e==="pointerout"||e==="pointerover")&&(S=tf,y="onPointerLeave",c="onPointerEnter",i="pointer"),z=v==null?p:Or(v),f=L==null?p:Or(L),p=new S(y,i+"leave",v,a,g),p.target=z,p.relatedTarget=f,y=null,Ja(g)===d&&(S=new S(c,i+"enter",L,a,g),S.target=f,S.relatedTarget=z,y=S),z=y,v&&L)t:{for(S=v,c=L,i=0,f=S;f;f=Dr(f))i++;for(f=0,y=c;y;y=Dr(y))f++;for(;0<i-f;)S=Dr(S),i--;for(;0<f-i;)c=Dr(c),f--;for(;i--;){if(S===c||c!==null&&S===c.alternate)break t;S=Dr(S),c=Dr(c)}S=null}else S=null;v!==null&&mf(m,p,v,S,!1),L!==null&&z!==null&&mf(m,z,L,S,!0)}}e:{if(p=d?Or(d):window,v=p.nodeName&&p.nodeName.toLowerCase(),v==="select"||v==="input"&&p.type==="file")var C=Ih;else if(of(p))if(Rc)C=bh;else{C=wh;var k=Ch}else(v=p.nodeName)&&v.toLowerCase()==="input"&&(p.type==="checkbox"||p.type==="radio")&&(C=kh);if(C&&(C=C(e,d))){Tc(m,C,a,g);break e}k&&k(e,p,d),e==="focusout"&&(k=p._wrapperState)&&k.controlled&&p.type==="number"&&mu(p,"number",p.value)}switch(k=d?Or(d):window,e){case"focusin":(of(k)||k.contentEditable==="true")&&(Fr=k,bu=d,No=null);break;case"focusout":No=bu=Fr=null;break;case"mousedown":Pu=!0;break;case"contextmenu":case"mouseup":case"dragend":Pu=!1,uf(m,a,g);break;case"selectionchange":if(Rh)break;case"keydown":case"keyup":uf(m,a,g)}var h;if(pi)e:{switch(e){case"compositionstart":var w="onCompositionStart";break e;case"compositionend":w="onCompositionEnd";break e;case"compositionupdate":w="onCompositionUpdate";break e}w=void 0}else Er?bc(e,a)&&(w="onCompositionEnd"):e==="keydown"&&a.keyCode===229&&(w="onCompositionStart");w&&(kc&&a.locale!=="ko"&&(Er||w!=="onCompositionStart"?w==="onCompositionEnd"&&Er&&(h=wc()):(La=g,di="value"in La?La.value:La.textContent,Er=!0)),k=Pl(d,w),0<k.length&&(w=new ef(w,e,null,a,g),m.push({event:w,listeners:k}),h?w.data=h:(h=Pc(a),h!==null&&(w.data=h)))),(h=xh?vh(e,a):yh(e,a))&&(d=Pl(d,"onBeforeInput"),0<d.length&&(g=new ef("onBeforeInput","beforeinput",null,a,g),m.push({event:g,listeners:d}),g.data=h))}Nc(m,t)})}function Jo(e,t,a){return{instance:e,listener:t,currentTarget:a}}function Pl(e,t){for(var a=t+"Capture",r=[];e!==null;){var o=e,n=o.stateNode;o.tag===5&&n!==null&&(o=n,n=Ko(e,a),n!=null&&r.unshift(Jo(e,n,o)),n=Ko(e,t),n!=null&&r.push(Jo(e,n,o))),e=e.return}return r}function Dr(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function mf(e,t,a,r,o){for(var n=t._reactName,l=[];a!==null&&a!==r;){var s=a,u=s.alternate,d=s.stateNode;if(u!==null&&u===r)break;s.tag===5&&d!==null&&(s=d,o?(u=Ko(a,n),u!=null&&l.unshift(Jo(a,u,s))):o||(u=Ko(a,n),u!=null&&l.push(Jo(a,u,s)))),a=a.return}l.length!==0&&e.push({event:t,listeners:l})}var Mh=/\\r\\n?/g,Ah=/\\u0000|\\uFFFD/g;function gf(e){return(typeof e=="string"?e:""+e).replace(Mh,`\n`).replace(Ah,"")}function ol(e,t,a){if(t=gf(t),gf(e)!==t&&a)throw Error(T(425))}function Tl(){}var Tu=null,Ru=null;function Du(e,t){return e==="textarea"||e==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var Mu=typeof setTimeout=="function"?setTimeout:void 0,Eh=typeof clearTimeout=="function"?clearTimeout:void 0,hf=typeof Promise=="function"?Promise:void 0,Fh=typeof queueMicrotask=="function"?queueMicrotask:typeof hf<"u"?function(e){return hf.resolve(null).then(e).catch(Bh)}:Mu;function Bh(e){setTimeout(function(){throw e})}function Ys(e,t){var a=t,r=0;do{var o=a.nextSibling;if(e.removeChild(a),o&&o.nodeType===8)if(a=o.data,a==="/$"){if(r===0){e.removeChild(o),Xo(t);return}r--}else a!=="$"&&a!=="$?"&&a!=="$!"||r++;a=o}while(a);Xo(t)}function ka(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t==="$"||t==="$!"||t==="$?")break;if(t==="/$")return null}}return e}function xf(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var a=e.data;if(a==="$"||a==="$!"||a==="$?"){if(t===0)return e;t--}else a==="/$"&&t++}e=e.previousSibling}return null}var ro=Math.random().toString(36).slice(2),$t="__reactFiber$"+ro,en="__reactProps$"+ro,la="__reactContainer$"+ro,Au="__reactEvents$"+ro,Oh="__reactListeners$"+ro,zh="__reactHandles$"+ro;function Ja(e){var t=e[$t];if(t)return t;for(var a=e.parentNode;a;){if(t=a[la]||a[$t]){if(a=t.alternate,t.child!==null||a!==null&&a.child!==null)for(e=xf(e);e!==null;){if(a=e[$t])return a;e=xf(e)}return t}e=a,a=e.parentNode}return null}function dn(e){return e=e[$t]||e[la],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function Or(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(T(33))}function jl(e){return e[en]||null}var Eu=[],zr=-1;function Ea(e){return{current:e}}function Se(e){0>zr||(e.current=Eu[zr],Eu[zr]=null,zr--)}function ve(e,t){zr++,Eu[zr]=e.current,e.current=t}var Ma={},Ge=Ea(Ma),rt=Ea(!1),or=Ma;function Qr(e,t){var a=e.type.contextTypes;if(!a)return Ma;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var o={},n;for(n in a)o[n]=t[n];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=o),o}function ot(e){return e=e.childContextTypes,e!=null}function Rl(){Se(rt),Se(Ge)}function vf(e,t,a){if(Ge.current!==Ma)throw Error(T(168));ve(Ge,t),ve(rt,a)}function _c(e,t,a){var r=e.stateNode;if(t=t.childContextTypes,typeof r.getChildContext!="function")return a;r=r.getChildContext();for(var o in r)if(!(o in t))throw Error(T(108,Cg(e)||"Unknown",o));return Pe({},a,r)}function Dl(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Ma,or=Ge.current,ve(Ge,e),ve(rt,rt.current),!0}function yf(e,t,a){var r=e.stateNode;if(!r)throw Error(T(169));a?(e=_c(e,t,or),r.__reactInternalMemoizedMergedChildContext=e,Se(rt),Se(Ge),ve(Ge,e)):Se(rt),ve(rt,a)}var ta=null,Xl=!1,Zs=!1;function qc(e){ta===null?ta=[e]:ta.push(e)}function Uh(e){Xl=!0,qc(e)}function Fa(){if(!Zs&&ta!==null){Zs=!0;var e=0,t=me;try{var a=ta;for(me=1;e<a.length;e++){var r=a[e];do r=r(!0);while(r!==null)}ta=null,Xl=!1}catch(o){throw ta!==null&&(ta=ta.slice(e+1)),pc(li,Fa),o}finally{me=t,Zs=!1}}return null}var Ur=[],Nr=0,Ml=null,Al=0,xt=[],vt=0,nr=null,aa=1,ra="";function Ya(e,t){Ur[Nr++]=Al,Ur[Nr++]=Ml,Ml=e,Al=t}function Wc(e,t,a){xt[vt++]=aa,xt[vt++]=ra,xt[vt++]=nr,nr=e;var r=aa;e=ra;var o=32-Bt(r)-1;r&=~(1<<o),a+=1;var n=32-Bt(t)+o;if(30<n){var l=o-o%5;n=(r&(1<<l)-1).toString(32),r>>=l,o-=l,aa=1<<32-Bt(t)+o|a<<o|r,ra=n+e}else aa=1<<n|a<<o|r,ra=e}function gi(e){e.return!==null&&(Ya(e,1),Wc(e,1,0))}function hi(e){for(;e===Ml;)Ml=Ur[--Nr],Ur[Nr]=null,Al=Ur[--Nr],Ur[Nr]=null;for(;e===nr;)nr=xt[--vt],xt[vt]=null,ra=xt[--vt],xt[vt]=null,aa=xt[--vt],xt[vt]=null}var dt=null,it=null,we=!1,Ft=null;function Vc(e,t){var a=yt(5,null,null,0);a.elementType="DELETED",a.stateNode=t,a.return=e,t=e.deletions,t===null?(e.deletions=[a],e.flags|=16):t.push(a)}function Lf(e,t){switch(e.tag){case 5:var a=e.type;return t=t.nodeType!==1||a.toLowerCase()!==t.nodeName.toLowerCase()?null:t,t!==null?(e.stateNode=t,dt=e,it=ka(t.firstChild),!0):!1;case 6:return t=e.pendingProps===""||t.nodeType!==3?null:t,t!==null?(e.stateNode=t,dt=e,it=null,!0):!1;case 13:return t=t.nodeType!==8?null:t,t!==null?(a=nr!==null?{id:aa,overflow:ra}:null,e.memoizedState={dehydrated:t,treeContext:a,retryLane:1073741824},a=yt(18,null,null,0),a.stateNode=t,a.return=e,e.child=a,dt=e,it=null,!0):!1;default:return!1}}function Fu(e){return(e.mode&1)!==0&&(e.flags&128)===0}function Bu(e){if(we){var t=it;if(t){var a=t;if(!Lf(e,t)){if(Fu(e))throw Error(T(418));t=ka(a.nextSibling);var r=dt;t&&Lf(e,t)?Vc(r,a):(e.flags=e.flags&-4097|2,we=!1,dt=e)}}else{if(Fu(e))throw Error(T(418));e.flags=e.flags&-4097|2,we=!1,dt=e}}}function Sf(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;dt=e}function nl(e){if(e!==dt)return!1;if(!we)return Sf(e),we=!0,!1;var t;if((t=e.tag!==3)&&!(t=e.tag!==5)&&(t=e.type,t=t!=="head"&&t!=="body"&&!Du(e.type,e.memoizedProps)),t&&(t=it)){if(Fu(e))throw $c(),Error(T(418));for(;t;)Vc(e,t),t=ka(t.nextSibling)}if(Sf(e),e.tag===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(T(317));e:{for(e=e.nextSibling,t=0;e;){if(e.nodeType===8){var a=e.data;if(a==="/$"){if(t===0){it=ka(e.nextSibling);break e}t--}else a!=="$"&&a!=="$!"&&a!=="$?"||t++}e=e.nextSibling}it=null}}else it=dt?ka(e.stateNode.nextSibling):null;return!0}function $c(){for(var e=it;e;)e=ka(e.nextSibling)}function Yr(){it=dt=null,we=!1}function xi(e){Ft===null?Ft=[e]:Ft.push(e)}var Nh=ia.ReactCurrentBatchConfig;function Po(e,t,a){if(e=a.ref,e!==null&&typeof e!="function"&&typeof e!="object"){if(a._owner){if(a=a._owner,a){if(a.tag!==1)throw Error(T(309));var r=a.stateNode}if(!r)throw Error(T(147,e));var o=r,n=""+e;return t!==null&&t.ref!==null&&typeof t.ref=="function"&&t.ref._stringRef===n?t.ref:(t=function(l){var s=o.refs;l===null?delete s[n]:s[n]=l},t._stringRef=n,t)}if(typeof e!="string")throw Error(T(284));if(!a._owner)throw Error(T(290,e))}return e}function ll(e,t){throw e=Object.prototype.toString.call(t),Error(T(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function If(e){var t=e._init;return t(e._payload)}function Kc(e){function t(c,i){if(e){var f=c.deletions;f===null?(c.deletions=[i],c.flags|=16):f.push(i)}}function a(c,i){if(!e)return null;for(;i!==null;)t(c,i),i=i.sibling;return null}function r(c,i){for(c=new Map;i!==null;)i.key!==null?c.set(i.key,i):c.set(i.index,i),i=i.sibling;return c}function o(c,i){return c=Ra(c,i),c.index=0,c.sibling=null,c}function n(c,i,f){return c.index=f,e?(f=c.alternate,f!==null?(f=f.index,f<i?(c.flags|=2,i):f):(c.flags|=2,i)):(c.flags|=1048576,i)}function l(c){return e&&c.alternate===null&&(c.flags|=2),c}function s(c,i,f,y){return i===null||i.tag!==6?(i=nu(f,c.mode,y),i.return=c,i):(i=o(i,f),i.return=c,i)}function u(c,i,f,y){var C=f.type;return C===Ar?g(c,i,f.props.children,y,f.key):i!==null&&(i.elementType===C||typeof C=="object"&&C!==null&&C.$$typeof===ha&&If(C)===i.type)?(y=o(i,f.props),y.ref=Po(c,i,f),y.return=c,y):(y=yl(f.type,f.key,f.props,null,c.mode,y),y.ref=Po(c,i,f),y.return=c,y)}function d(c,i,f,y){return i===null||i.tag!==4||i.stateNode.containerInfo!==f.containerInfo||i.stateNode.implementation!==f.implementation?(i=lu(f,c.mode,y),i.return=c,i):(i=o(i,f.children||[]),i.return=c,i)}function g(c,i,f,y,C){return i===null||i.tag!==7?(i=rr(f,c.mode,y,C),i.return=c,i):(i=o(i,f),i.return=c,i)}function m(c,i,f){if(typeof i=="string"&&i!==""||typeof i=="number")return i=nu(""+i,c.mode,f),i.return=c,i;if(typeof i=="object"&&i!==null){switch(i.$$typeof){case $n:return f=yl(i.type,i.key,i.props,null,c.mode,f),f.ref=Po(c,null,i),f.return=c,f;case Mr:return i=lu(i,c.mode,f),i.return=c,i;case ha:var y=i._init;return m(c,y(i._payload),f)}if(Ao(i)||Co(i))return i=rr(i,c.mode,f,null),i.return=c,i;ll(c,i)}return null}function p(c,i,f,y){var C=i!==null?i.key:null;if(typeof f=="string"&&f!==""||typeof f=="number")return C!==null?null:s(c,i,""+f,y);if(typeof f=="object"&&f!==null){switch(f.$$typeof){case $n:return f.key===C?u(c,i,f,y):null;case Mr:return f.key===C?d(c,i,f,y):null;case ha:return C=f._init,p(c,i,C(f._payload),y)}if(Ao(f)||Co(f))return C!==null?null:g(c,i,f,y,null);ll(c,f)}return null}function v(c,i,f,y,C){if(typeof y=="string"&&y!==""||typeof y=="number")return c=c.get(f)||null,s(i,c,""+y,C);if(typeof y=="object"&&y!==null){switch(y.$$typeof){case $n:return c=c.get(y.key===null?f:y.key)||null,u(i,c,y,C);case Mr:return c=c.get(y.key===null?f:y.key)||null,d(i,c,y,C);case ha:var k=y._init;return v(c,i,f,k(y._payload),C)}if(Ao(y)||Co(y))return c=c.get(f)||null,g(i,c,y,C,null);ll(i,y)}return null}function L(c,i,f,y){for(var C=null,k=null,h=i,w=i=0,b=null;h!==null&&w<f.length;w++){h.index>w?(b=h,h=null):b=h.sibling;var M=p(c,h,f[w],y);if(M===null){h===null&&(h=b);break}e&&h&&M.alternate===null&&t(c,h),i=n(M,i,w),k===null?C=M:k.sibling=M,k=M,h=b}if(w===f.length)return a(c,h),we&&Ya(c,w),C;if(h===null){for(;w<f.length;w++)h=m(c,f[w],y),h!==null&&(i=n(h,i,w),k===null?C=h:k.sibling=h,k=h);return we&&Ya(c,w),C}for(h=r(c,h);w<f.length;w++)b=v(h,c,w,f[w],y),b!==null&&(e&&b.alternate!==null&&h.delete(b.key===null?w:b.key),i=n(b,i,w),k===null?C=b:k.sibling=b,k=b);return e&&h.forEach(function(R){return t(c,R)}),we&&Ya(c,w),C}function S(c,i,f,y){var C=Co(f);if(typeof C!="function")throw Error(T(150));if(f=C.call(f),f==null)throw Error(T(151));for(var k=C=null,h=i,w=i=0,b=null,M=f.next();h!==null&&!M.done;w++,M=f.next()){h.index>w?(b=h,h=null):b=h.sibling;var R=p(c,h,M.value,y);if(R===null){h===null&&(h=b);break}e&&h&&R.alternate===null&&t(c,h),i=n(R,i,w),k===null?C=R:k.sibling=R,k=R,h=b}if(M.done)return a(c,h),we&&Ya(c,w),C;if(h===null){for(;!M.done;w++,M=f.next())M=m(c,M.value,y),M!==null&&(i=n(M,i,w),k===null?C=M:k.sibling=M,k=M);return we&&Ya(c,w),C}for(h=r(c,h);!M.done;w++,M=f.next())M=v(h,c,w,M.value,y),M!==null&&(e&&M.alternate!==null&&h.delete(M.key===null?w:M.key),i=n(M,i,w),k===null?C=M:k.sibling=M,k=M);return e&&h.forEach(function(F){return t(c,F)}),we&&Ya(c,w),C}function z(c,i,f,y){if(typeof f=="object"&&f!==null&&f.type===Ar&&f.key===null&&(f=f.props.children),typeof f=="object"&&f!==null){switch(f.$$typeof){case $n:e:{for(var C=f.key,k=i;k!==null;){if(k.key===C){if(C=f.type,C===Ar){if(k.tag===7){a(c,k.sibling),i=o(k,f.props.children),i.return=c,c=i;break e}}else if(k.elementType===C||typeof C=="object"&&C!==null&&C.$$typeof===ha&&If(C)===k.type){a(c,k.sibling),i=o(k,f.props),i.ref=Po(c,k,f),i.return=c,c=i;break e}a(c,k);break}else t(c,k);k=k.sibling}f.type===Ar?(i=rr(f.props.children,c.mode,y,f.key),i.return=c,c=i):(y=yl(f.type,f.key,f.props,null,c.mode,y),y.ref=Po(c,i,f),y.return=c,c=y)}return l(c);case Mr:e:{for(k=f.key;i!==null;){if(i.key===k)if(i.tag===4&&i.stateNode.containerInfo===f.containerInfo&&i.stateNode.implementation===f.implementation){a(c,i.sibling),i=o(i,f.children||[]),i.return=c,c=i;break e}else{a(c,i);break}else t(c,i);i=i.sibling}i=lu(f,c.mode,y),i.return=c,c=i}return l(c);case ha:return k=f._init,z(c,i,k(f._payload),y)}if(Ao(f))return L(c,i,f,y);if(Co(f))return S(c,i,f,y);ll(c,f)}return typeof f=="string"&&f!==""||typeof f=="number"?(f=""+f,i!==null&&i.tag===6?(a(c,i.sibling),i=o(i,f),i.return=c,c=i):(a(c,i),i=nu(f,c.mode,y),i.return=c,c=i),l(c)):a(c,i)}return z}var Zr=Kc(!0),Gc=Kc(!1),El=Ea(null),Fl=null,Hr=null,vi=null;function yi(){vi=Hr=Fl=null}function Li(e){var t=El.current;Se(El),e._currentValue=t}function Ou(e,t,a){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,r!==null&&(r.childLanes|=t)):r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t),e===a)break;e=e.return}}function Gr(e,t){Fl=e,vi=Hr=null,e=e.dependencies,e!==null&&e.firstContext!==null&&((e.lanes&t)!==0&&(at=!0),e.firstContext=null)}function St(e){var t=e._currentValue;if(vi!==e)if(e={context:e,memoizedValue:t,next:null},Hr===null){if(Fl===null)throw Error(T(308));Hr=e,Fl.dependencies={lanes:0,firstContext:e}}else Hr=Hr.next=e;return t}var er=null;function Si(e){er===null?er=[e]:er.push(e)}function jc(e,t,a,r){var o=t.interleaved;return o===null?(a.next=a,Si(t)):(a.next=o.next,o.next=a),t.interleaved=a,sa(e,r)}function sa(e,t){e.lanes|=t;var a=e.alternate;for(a!==null&&(a.lanes|=t),a=e,e=e.return;e!==null;)e.childLanes|=t,a=e.alternate,a!==null&&(a.childLanes|=t),a=e,e=e.return;return a.tag===3?a.stateNode:null}var xa=!1;function Ii(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function Xc(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function oa(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function ba(e,t,a){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,(ue&2)!==0){var o=r.pending;return o===null?t.next=t:(t.next=o.next,o.next=t),r.pending=t,sa(e,a)}return o=r.interleaved,o===null?(t.next=t,Si(r)):(t.next=o.next,o.next=t),r.interleaved=t,sa(e,a)}function pl(e,t,a){if(t=t.updateQueue,t!==null&&(t=t.shared,(a&4194240)!==0)){var r=t.lanes;r&=e.pendingLanes,a|=r,t.lanes=a,si(e,a)}}function Cf(e,t){var a=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,a===r)){var o=null,n=null;if(a=a.firstBaseUpdate,a!==null){do{var l={eventTime:a.eventTime,lane:a.lane,tag:a.tag,payload:a.payload,callback:a.callback,next:null};n===null?o=n=l:n=n.next=l,a=a.next}while(a!==null);n===null?o=n=t:n=n.next=t}else o=n=t;a={baseState:r.baseState,firstBaseUpdate:o,lastBaseUpdate:n,shared:r.shared,effects:r.effects},e.updateQueue=a;return}e=a.lastBaseUpdate,e===null?a.firstBaseUpdate=t:e.next=t,a.lastBaseUpdate=t}function Bl(e,t,a,r){var o=e.updateQueue;xa=!1;var n=o.firstBaseUpdate,l=o.lastBaseUpdate,s=o.shared.pending;if(s!==null){o.shared.pending=null;var u=s,d=u.next;u.next=null,l===null?n=d:l.next=d,l=u;var g=e.alternate;g!==null&&(g=g.updateQueue,s=g.lastBaseUpdate,s!==l&&(s===null?g.firstBaseUpdate=d:s.next=d,g.lastBaseUpdate=u))}if(n!==null){var m=o.baseState;l=0,g=d=u=null,s=n;do{var p=s.lane,v=s.eventTime;if((r&p)===p){g!==null&&(g=g.next={eventTime:v,lane:0,tag:s.tag,payload:s.payload,callback:s.callback,next:null});e:{var L=e,S=s;switch(p=t,v=a,S.tag){case 1:if(L=S.payload,typeof L=="function"){m=L.call(v,m,p);break e}m=L;break e;case 3:L.flags=L.flags&-65537|128;case 0:if(L=S.payload,p=typeof L=="function"?L.call(v,m,p):L,p==null)break e;m=Pe({},m,p);break e;case 2:xa=!0}}s.callback!==null&&s.lane!==0&&(e.flags|=64,p=o.effects,p===null?o.effects=[s]:p.push(s))}else v={eventTime:v,lane:p,tag:s.tag,payload:s.payload,callback:s.callback,next:null},g===null?(d=g=v,u=m):g=g.next=v,l|=p;if(s=s.next,s===null){if(s=o.shared.pending,s===null)break;p=s,s=p.next,p.next=null,o.lastBaseUpdate=p,o.shared.pending=null}}while(!0);if(g===null&&(u=m),o.baseState=u,o.firstBaseUpdate=d,o.lastBaseUpdate=g,t=o.shared.interleaved,t!==null){o=t;do l|=o.lane,o=o.next;while(o!==t)}else n===null&&(o.shared.lanes=0);sr|=l,e.lanes=l,e.memoizedState=m}}function wf(e,t,a){if(e=t.effects,t.effects=null,e!==null)for(t=0;t<e.length;t++){var r=e[t],o=r.callback;if(o!==null){if(r.callback=null,r=a,typeof o!="function")throw Error(T(191,o));o.call(r)}}}var fn={},Gt=Ea(fn),tn=Ea(fn),an=Ea(fn);function tr(e){if(e===fn)throw Error(T(174));return e}function Ci(e,t){switch(ve(an,t),ve(tn,e),ve(Gt,fn),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:hu(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=hu(t,e)}Se(Gt),ve(Gt,t)}function Jr(){Se(Gt),Se(tn),Se(an)}function Qc(e){tr(an.current);var t=tr(Gt.current),a=hu(t,e.type);t!==a&&(ve(tn,e),ve(Gt,a))}function wi(e){tn.current===e&&(Se(Gt),Se(tn))}var ke=Ea(0);function Ol(e){for(var t=e;t!==null;){if(t.tag===13){var a=t.memoizedState;if(a!==null&&(a=a.dehydrated,a===null||a.data==="$?"||a.data==="$!"))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==void 0){if((t.flags&128)!==0)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var Js=[];function ki(){for(var e=0;e<Js.length;e++)Js[e]._workInProgressVersionPrimary=null;Js.length=0}var ml=ia.ReactCurrentDispatcher,eu=ia.ReactCurrentBatchConfig,lr=0,be=null,Be=null,ze=null,zl=!1,Ho=!1,rn=0,Hh=0;function Ve(){throw Error(T(321))}function bi(e,t){if(t===null)return!1;for(var a=0;a<t.length&&a<e.length;a++)if(!zt(e[a],t[a]))return!1;return!0}function Pi(e,t,a,r,o,n){if(lr=n,be=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,ml.current=e===null||e.memoizedState===null?Vh:$h,e=a(r,o),Ho){n=0;do{if(Ho=!1,rn=0,25<=n)throw Error(T(301));n+=1,ze=Be=null,t.updateQueue=null,ml.current=Kh,e=a(r,o)}while(Ho)}if(ml.current=Ul,t=Be!==null&&Be.next!==null,lr=0,ze=Be=be=null,zl=!1,t)throw Error(T(300));return e}function Ti(){var e=rn!==0;return rn=0,e}function Vt(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return ze===null?be.memoizedState=ze=e:ze=ze.next=e,ze}function It(){if(Be===null){var e=be.alternate;e=e!==null?e.memoizedState:null}else e=Be.next;var t=ze===null?be.memoizedState:ze.next;if(t!==null)ze=t,Be=e;else{if(e===null)throw Error(T(310));Be=e,e={memoizedState:Be.memoizedState,baseState:Be.baseState,baseQueue:Be.baseQueue,queue:Be.queue,next:null},ze===null?be.memoizedState=ze=e:ze=ze.next=e}return ze}function on(e,t){return typeof t=="function"?t(e):t}function tu(e){var t=It(),a=t.queue;if(a===null)throw Error(T(311));a.lastRenderedReducer=e;var r=Be,o=r.baseQueue,n=a.pending;if(n!==null){if(o!==null){var l=o.next;o.next=n.next,n.next=l}r.baseQueue=o=n,a.pending=null}if(o!==null){n=o.next,r=r.baseState;var s=l=null,u=null,d=n;do{var g=d.lane;if((lr&g)===g)u!==null&&(u=u.next={lane:0,action:d.action,hasEagerState:d.hasEagerState,eagerState:d.eagerState,next:null}),r=d.hasEagerState?d.eagerState:e(r,d.action);else{var m={lane:g,action:d.action,hasEagerState:d.hasEagerState,eagerState:d.eagerState,next:null};u===null?(s=u=m,l=r):u=u.next=m,be.lanes|=g,sr|=g}d=d.next}while(d!==null&&d!==n);u===null?l=r:u.next=s,zt(r,t.memoizedState)||(at=!0),t.memoizedState=r,t.baseState=l,t.baseQueue=u,a.lastRenderedState=r}if(e=a.interleaved,e!==null){o=e;do n=o.lane,be.lanes|=n,sr|=n,o=o.next;while(o!==e)}else o===null&&(a.lanes=0);return[t.memoizedState,a.dispatch]}function au(e){var t=It(),a=t.queue;if(a===null)throw Error(T(311));a.lastRenderedReducer=e;var r=a.dispatch,o=a.pending,n=t.memoizedState;if(o!==null){a.pending=null;var l=o=o.next;do n=e(n,l.action),l=l.next;while(l!==o);zt(n,t.memoizedState)||(at=!0),t.memoizedState=n,t.baseQueue===null&&(t.baseState=n),a.lastRenderedState=n}return[n,r]}function Yc(){}function Zc(e,t){var a=be,r=It(),o=t(),n=!zt(r.memoizedState,o);if(n&&(r.memoizedState=o,at=!0),r=r.queue,Ri(tp.bind(null,a,r,e),[e]),r.getSnapshot!==t||n||ze!==null&&ze.memoizedState.tag&1){if(a.flags|=2048,nn(9,ep.bind(null,a,r,o,t),void 0,null),Ue===null)throw Error(T(349));(lr&30)!==0||Jc(a,t,o)}return o}function Jc(e,t,a){e.flags|=16384,e={getSnapshot:t,value:a},t=be.updateQueue,t===null?(t={lastEffect:null,stores:null},be.updateQueue=t,t.stores=[e]):(a=t.stores,a===null?t.stores=[e]:a.push(e))}function ep(e,t,a,r){t.value=a,t.getSnapshot=r,ap(t)&&rp(e)}function tp(e,t,a){return a(function(){ap(t)&&rp(e)})}function ap(e){var t=e.getSnapshot;e=e.value;try{var a=t();return!zt(e,a)}catch{return!0}}function rp(e){var t=sa(e,1);t!==null&&Ot(t,e,1,-1)}function kf(e){var t=Vt();return typeof e=="function"&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:on,lastRenderedState:e},t.queue=e,e=e.dispatch=Wh.bind(null,be,e),[t.memoizedState,e]}function nn(e,t,a,r){return e={tag:e,create:t,destroy:a,deps:r,next:null},t=be.updateQueue,t===null?(t={lastEffect:null,stores:null},be.updateQueue=t,t.lastEffect=e.next=e):(a=t.lastEffect,a===null?t.lastEffect=e.next=e:(r=a.next,a.next=e,e.next=r,t.lastEffect=e)),e}function op(){return It().memoizedState}function gl(e,t,a,r){var o=Vt();be.flags|=e,o.memoizedState=nn(1|t,a,void 0,r===void 0?null:r)}function Ql(e,t,a,r){var o=It();r=r===void 0?null:r;var n=void 0;if(Be!==null){var l=Be.memoizedState;if(n=l.destroy,r!==null&&bi(r,l.deps)){o.memoizedState=nn(t,a,n,r);return}}be.flags|=e,o.memoizedState=nn(1|t,a,n,r)}function bf(e,t){return gl(8390656,8,e,t)}function Ri(e,t){return Ql(2048,8,e,t)}function np(e,t){return Ql(4,2,e,t)}function lp(e,t){return Ql(4,4,e,t)}function sp(e,t){if(typeof t=="function")return e=e(),t(e),function(){t(null)};if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function up(e,t,a){return a=a!=null?a.concat([e]):null,Ql(4,4,sp.bind(null,t,e),a)}function Di(){}function ip(e,t){var a=It();t=t===void 0?null:t;var r=a.memoizedState;return r!==null&&t!==null&&bi(t,r[1])?r[0]:(a.memoizedState=[e,t],e)}function dp(e,t){var a=It();t=t===void 0?null:t;var r=a.memoizedState;return r!==null&&t!==null&&bi(t,r[1])?r[0]:(e=e(),a.memoizedState=[e,t],e)}function fp(e,t,a){return(lr&21)===0?(e.baseState&&(e.baseState=!1,at=!0),e.memoizedState=a):(zt(a,t)||(a=hc(),be.lanes|=a,sr|=a,e.baseState=!0),t)}function _h(e,t){var a=me;me=a!==0&&4>a?a:4,e(!0);var r=eu.transition;eu.transition={};try{e(!1),t()}finally{me=a,eu.transition=r}}function cp(){return It().memoizedState}function qh(e,t,a){var r=Ta(e);if(a={lane:r,action:a,hasEagerState:!1,eagerState:null,next:null},pp(e))mp(t,a);else if(a=jc(e,t,a,r),a!==null){var o=Ze();Ot(a,e,r,o),gp(a,t,r)}}function Wh(e,t,a){var r=Ta(e),o={lane:r,action:a,hasEagerState:!1,eagerState:null,next:null};if(pp(e))mp(t,o);else{var n=e.alternate;if(e.lanes===0&&(n===null||n.lanes===0)&&(n=t.lastRenderedReducer,n!==null))try{var l=t.lastRenderedState,s=n(l,a);if(o.hasEagerState=!0,o.eagerState=s,zt(s,l)){var u=t.interleaved;u===null?(o.next=o,Si(t)):(o.next=u.next,u.next=o),t.interleaved=o;return}}catch{}finally{}a=jc(e,t,o,r),a!==null&&(o=Ze(),Ot(a,e,r,o),gp(a,t,r))}}function pp(e){var t=e.alternate;return e===be||t!==null&&t===be}function mp(e,t){Ho=zl=!0;var a=e.pending;a===null?t.next=t:(t.next=a.next,a.next=t),e.pending=t}function gp(e,t,a){if((a&4194240)!==0){var r=t.lanes;r&=e.pendingLanes,a|=r,t.lanes=a,si(e,a)}}var Ul={readContext:St,useCallback:Ve,useContext:Ve,useEffect:Ve,useImperativeHandle:Ve,useInsertionEffect:Ve,useLayoutEffect:Ve,useMemo:Ve,useReducer:Ve,useRef:Ve,useState:Ve,useDebugValue:Ve,useDeferredValue:Ve,useTransition:Ve,useMutableSource:Ve,useSyncExternalStore:Ve,useId:Ve,unstable_isNewReconciler:!1},Vh={readContext:St,useCallback:function(e,t){return Vt().memoizedState=[e,t===void 0?null:t],e},useContext:St,useEffect:bf,useImperativeHandle:function(e,t,a){return a=a!=null?a.concat([e]):null,gl(4194308,4,sp.bind(null,t,e),a)},useLayoutEffect:function(e,t){return gl(4194308,4,e,t)},useInsertionEffect:function(e,t){return gl(4,2,e,t)},useMemo:function(e,t){var a=Vt();return t=t===void 0?null:t,e=e(),a.memoizedState=[e,t],e},useReducer:function(e,t,a){var r=Vt();return t=a!==void 0?a(t):t,r.memoizedState=r.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},r.queue=e,e=e.dispatch=qh.bind(null,be,e),[r.memoizedState,e]},useRef:function(e){var t=Vt();return e={current:e},t.memoizedState=e},useState:kf,useDebugValue:Di,useDeferredValue:function(e){return Vt().memoizedState=e},useTransition:function(){var e=kf(!1),t=e[0];return e=_h.bind(null,e[1]),Vt().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,a){var r=be,o=Vt();if(we){if(a===void 0)throw Error(T(407));a=a()}else{if(a=t(),Ue===null)throw Error(T(349));(lr&30)!==0||Jc(r,t,a)}o.memoizedState=a;var n={value:a,getSnapshot:t};return o.queue=n,bf(tp.bind(null,r,n,e),[e]),r.flags|=2048,nn(9,ep.bind(null,r,n,a,t),void 0,null),a},useId:function(){var e=Vt(),t=Ue.identifierPrefix;if(we){var a=ra,r=aa;a=(r&~(1<<32-Bt(r)-1)).toString(32)+a,t=":"+t+"R"+a,a=rn++,0<a&&(t+="H"+a.toString(32)),t+=":"}else a=Hh++,t=":"+t+"r"+a.toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},$h={readContext:St,useCallback:ip,useContext:St,useEffect:Ri,useImperativeHandle:up,useInsertionEffect:np,useLayoutEffect:lp,useMemo:dp,useReducer:tu,useRef:op,useState:function(){return tu(on)},useDebugValue:Di,useDeferredValue:function(e){var t=It();return fp(t,Be.memoizedState,e)},useTransition:function(){var e=tu(on)[0],t=It().memoizedState;return[e,t]},useMutableSource:Yc,useSyncExternalStore:Zc,useId:cp,unstable_isNewReconciler:!1},Kh={readContext:St,useCallback:ip,useContext:St,useEffect:Ri,useImperativeHandle:up,useInsertionEffect:np,useLayoutEffect:lp,useMemo:dp,useReducer:au,useRef:op,useState:function(){return au(on)},useDebugValue:Di,useDeferredValue:function(e){var t=It();return Be===null?t.memoizedState=e:fp(t,Be.memoizedState,e)},useTransition:function(){var e=au(on)[0],t=It().memoizedState;return[e,t]},useMutableSource:Yc,useSyncExternalStore:Zc,useId:cp,unstable_isNewReconciler:!1};function At(e,t){if(e&&e.defaultProps){t=Pe({},t),e=e.defaultProps;for(var a in e)t[a]===void 0&&(t[a]=e[a]);return t}return t}function zu(e,t,a,r){t=e.memoizedState,a=a(r,t),a=a==null?t:Pe({},t,a),e.memoizedState=a,e.lanes===0&&(e.updateQueue.baseState=a)}var Yl={isMounted:function(e){return(e=e._reactInternals)?dr(e)===e:!1},enqueueSetState:function(e,t,a){e=e._reactInternals;var r=Ze(),o=Ta(e),n=oa(r,o);n.payload=t,a!=null&&(n.callback=a),t=ba(e,n,o),t!==null&&(Ot(t,e,o,r),pl(t,e,o))},enqueueReplaceState:function(e,t,a){e=e._reactInternals;var r=Ze(),o=Ta(e),n=oa(r,o);n.tag=1,n.payload=t,a!=null&&(n.callback=a),t=ba(e,n,o),t!==null&&(Ot(t,e,o,r),pl(t,e,o))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var a=Ze(),r=Ta(e),o=oa(a,r);o.tag=2,t!=null&&(o.callback=t),t=ba(e,o,r),t!==null&&(Ot(t,e,r,a),pl(t,e,r))}};function Pf(e,t,a,r,o,n,l){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(r,n,l):t.prototype&&t.prototype.isPureReactComponent?!Yo(a,r)||!Yo(o,n):!0}function hp(e,t,a){var r=!1,o=Ma,n=t.contextType;return typeof n=="object"&&n!==null?n=St(n):(o=ot(t)?or:Ge.current,r=t.contextTypes,n=(r=r!=null)?Qr(e,o):Ma),t=new t(a,n),e.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=Yl,e.stateNode=t,t._reactInternals=e,r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=o,e.__reactInternalMemoizedMaskedChildContext=n),t}function Tf(e,t,a,r){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(a,r),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(a,r),t.state!==e&&Yl.enqueueReplaceState(t,t.state,null)}function Uu(e,t,a,r){var o=e.stateNode;o.props=a,o.state=e.memoizedState,o.refs={},Ii(e);var n=t.contextType;typeof n=="object"&&n!==null?o.context=St(n):(n=ot(t)?or:Ge.current,o.context=Qr(e,n)),o.state=e.memoizedState,n=t.getDerivedStateFromProps,typeof n=="function"&&(zu(e,t,n,a),o.state=e.memoizedState),typeof t.getDerivedStateFromProps=="function"||typeof o.getSnapshotBeforeUpdate=="function"||typeof o.UNSAFE_componentWillMount!="function"&&typeof o.componentWillMount!="function"||(t=o.state,typeof o.componentWillMount=="function"&&o.componentWillMount(),typeof o.UNSAFE_componentWillMount=="function"&&o.UNSAFE_componentWillMount(),t!==o.state&&Yl.enqueueReplaceState(o,o.state,null),Bl(e,a,o,r),o.state=e.memoizedState),typeof o.componentDidMount=="function"&&(e.flags|=4194308)}function eo(e,t){try{var a="",r=t;do a+=Ig(r),r=r.return;while(r);var o=a}catch(n){o=`\nError generating stack: `+n.message+`\n`+n.stack}return{value:e,source:t,stack:o,digest:null}}function ru(e,t,a){return{value:e,source:null,stack:a??null,digest:t??null}}function Nu(e,t){try{console.error(t.value)}catch(a){setTimeout(function(){throw a})}}var Gh=typeof WeakMap=="function"?WeakMap:Map;function xp(e,t,a){a=oa(-1,a),a.tag=3,a.payload={element:null};var r=t.value;return a.callback=function(){Hl||(Hl=!0,Xu=r),Nu(e,t)},a}function vp(e,t,a){a=oa(-1,a),a.tag=3;var r=e.type.getDerivedStateFromError;if(typeof r=="function"){var o=t.value;a.payload=function(){return r(o)},a.callback=function(){Nu(e,t)}}var n=e.stateNode;return n!==null&&typeof n.componentDidCatch=="function"&&(a.callback=function(){Nu(e,t),typeof r!="function"&&(Pa===null?Pa=new Set([this]):Pa.add(this));var l=t.stack;this.componentDidCatch(t.value,{componentStack:l!==null?l:""})}),a}function Rf(e,t,a){var r=e.pingCache;if(r===null){r=e.pingCache=new Gh;var o=new Set;r.set(t,o)}else o=r.get(t),o===void 0&&(o=new Set,r.set(t,o));o.has(a)||(o.add(a),e=sx.bind(null,e,t,a),t.then(e,e))}function Df(e){do{var t;if((t=e.tag===13)&&(t=e.memoizedState,t=t!==null?t.dehydrated!==null:!0),t)return e;e=e.return}while(e!==null);return null}function Mf(e,t,a,r,o){return(e.mode&1)===0?(e===t?e.flags|=65536:(e.flags|=128,a.flags|=131072,a.flags&=-52805,a.tag===1&&(a.alternate===null?a.tag=17:(t=oa(-1,1),t.tag=2,ba(a,t,1))),a.lanes|=1),e):(e.flags|=65536,e.lanes=o,e)}var jh=ia.ReactCurrentOwner,at=!1;function Ye(e,t,a,r){t.child=e===null?Gc(t,null,a,r):Zr(t,e.child,a,r)}function Af(e,t,a,r,o){a=a.render;var n=t.ref;return Gr(t,o),r=Pi(e,t,a,r,n,o),a=Ti(),e!==null&&!at?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~o,ua(e,t,o)):(we&&a&&gi(t),t.flags|=1,Ye(e,t,r,o),t.child)}function Ef(e,t,a,r,o){if(e===null){var n=a.type;return typeof n=="function"&&!Ui(n)&&n.defaultProps===void 0&&a.compare===null&&a.defaultProps===void 0?(t.tag=15,t.type=n,yp(e,t,n,r,o)):(e=yl(a.type,null,r,t,t.mode,o),e.ref=t.ref,e.return=t,t.child=e)}if(n=e.child,(e.lanes&o)===0){var l=n.memoizedProps;if(a=a.compare,a=a!==null?a:Yo,a(l,r)&&e.ref===t.ref)return ua(e,t,o)}return t.flags|=1,e=Ra(n,r),e.ref=t.ref,e.return=t,t.child=e}function yp(e,t,a,r,o){if(e!==null){var n=e.memoizedProps;if(Yo(n,r)&&e.ref===t.ref)if(at=!1,t.pendingProps=r=n,(e.lanes&o)!==0)(e.flags&131072)!==0&&(at=!0);else return t.lanes=e.lanes,ua(e,t,o)}return Hu(e,t,a,r,o)}function Lp(e,t,a){var r=t.pendingProps,o=r.children,n=e!==null?e.memoizedState:null;if(r.mode==="hidden")if((t.mode&1)===0)t.memoizedState={baseLanes:0,cachePool:null,transitions:null},ve(qr,ut),ut|=a;else{if((a&1073741824)===0)return e=n!==null?n.baseLanes|a:a,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,ve(qr,ut),ut|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=n!==null?n.baseLanes:a,ve(qr,ut),ut|=r}else n!==null?(r=n.baseLanes|a,t.memoizedState=null):r=a,ve(qr,ut),ut|=r;return Ye(e,t,o,a),t.child}function Sp(e,t){var a=t.ref;(e===null&&a!==null||e!==null&&e.ref!==a)&&(t.flags|=512,t.flags|=2097152)}function Hu(e,t,a,r,o){var n=ot(a)?or:Ge.current;return n=Qr(t,n),Gr(t,o),a=Pi(e,t,a,r,n,o),r=Ti(),e!==null&&!at?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~o,ua(e,t,o)):(we&&r&&gi(t),t.flags|=1,Ye(e,t,a,o),t.child)}function Ff(e,t,a,r,o){if(ot(a)){var n=!0;Dl(t)}else n=!1;if(Gr(t,o),t.stateNode===null)hl(e,t),hp(t,a,r),Uu(t,a,r,o),r=!0;else if(e===null){var l=t.stateNode,s=t.memoizedProps;l.props=s;var u=l.context,d=a.contextType;typeof d=="object"&&d!==null?d=St(d):(d=ot(a)?or:Ge.current,d=Qr(t,d));var g=a.getDerivedStateFromProps,m=typeof g=="function"||typeof l.getSnapshotBeforeUpdate=="function";m||typeof l.UNSAFE_componentWillReceiveProps!="function"&&typeof l.componentWillReceiveProps!="function"||(s!==r||u!==d)&&Tf(t,l,r,d),xa=!1;var p=t.memoizedState;l.state=p,Bl(t,r,l,o),u=t.memoizedState,s!==r||p!==u||rt.current||xa?(typeof g=="function"&&(zu(t,a,g,r),u=t.memoizedState),(s=xa||Pf(t,a,s,r,p,u,d))?(m||typeof l.UNSAFE_componentWillMount!="function"&&typeof l.componentWillMount!="function"||(typeof l.componentWillMount=="function"&&l.componentWillMount(),typeof l.UNSAFE_componentWillMount=="function"&&l.UNSAFE_componentWillMount()),typeof l.componentDidMount=="function"&&(t.flags|=4194308)):(typeof l.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=u),l.props=r,l.state=u,l.context=d,r=s):(typeof l.componentDidMount=="function"&&(t.flags|=4194308),r=!1)}else{l=t.stateNode,Xc(e,t),s=t.memoizedProps,d=t.type===t.elementType?s:At(t.type,s),l.props=d,m=t.pendingProps,p=l.context,u=a.contextType,typeof u=="object"&&u!==null?u=St(u):(u=ot(a)?or:Ge.current,u=Qr(t,u));var v=a.getDerivedStateFromProps;(g=typeof v=="function"||typeof l.getSnapshotBeforeUpdate=="function")||typeof l.UNSAFE_componentWillReceiveProps!="function"&&typeof l.componentWillReceiveProps!="function"||(s!==m||p!==u)&&Tf(t,l,r,u),xa=!1,p=t.memoizedState,l.state=p,Bl(t,r,l,o);var L=t.memoizedState;s!==m||p!==L||rt.current||xa?(typeof v=="function"&&(zu(t,a,v,r),L=t.memoizedState),(d=xa||Pf(t,a,d,r,p,L,u)||!1)?(g||typeof l.UNSAFE_componentWillUpdate!="function"&&typeof l.componentWillUpdate!="function"||(typeof l.componentWillUpdate=="function"&&l.componentWillUpdate(r,L,u),typeof l.UNSAFE_componentWillUpdate=="function"&&l.UNSAFE_componentWillUpdate(r,L,u)),typeof l.componentDidUpdate=="function"&&(t.flags|=4),typeof l.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof l.componentDidUpdate!="function"||s===e.memoizedProps&&p===e.memoizedState||(t.flags|=4),typeof l.getSnapshotBeforeUpdate!="function"||s===e.memoizedProps&&p===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=L),l.props=r,l.state=L,l.context=u,r=d):(typeof l.componentDidUpdate!="function"||s===e.memoizedProps&&p===e.memoizedState||(t.flags|=4),typeof l.getSnapshotBeforeUpdate!="function"||s===e.memoizedProps&&p===e.memoizedState||(t.flags|=1024),r=!1)}return _u(e,t,a,r,n,o)}function _u(e,t,a,r,o,n){Sp(e,t);var l=(t.flags&128)!==0;if(!r&&!l)return o&&yf(t,a,!1),ua(e,t,n);r=t.stateNode,jh.current=t;var s=l&&typeof a.getDerivedStateFromError!="function"?null:r.render();return t.flags|=1,e!==null&&l?(t.child=Zr(t,e.child,null,n),t.child=Zr(t,null,s,n)):Ye(e,t,s,n),t.memoizedState=r.state,o&&yf(t,a,!0),t.child}function Ip(e){var t=e.stateNode;t.pendingContext?vf(e,t.pendingContext,t.pendingContext!==t.context):t.context&&vf(e,t.context,!1),Ci(e,t.containerInfo)}function Bf(e,t,a,r,o){return Yr(),xi(o),t.flags|=256,Ye(e,t,a,r),t.child}var qu={dehydrated:null,treeContext:null,retryLane:0};function Wu(e){return{baseLanes:e,cachePool:null,transitions:null}}function Cp(e,t,a){var r=t.pendingProps,o=ke.current,n=!1,l=(t.flags&128)!==0,s;if((s=l)||(s=e!==null&&e.memoizedState===null?!1:(o&2)!==0),s?(n=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(o|=1),ve(ke,o&1),e===null)return Bu(t),e=t.memoizedState,e!==null&&(e=e.dehydrated,e!==null)?((t.mode&1)===0?t.lanes=1:e.data==="$!"?t.lanes=8:t.lanes=1073741824,null):(l=r.children,e=r.fallback,n?(r=t.mode,n=t.child,l={mode:"hidden",children:l},(r&1)===0&&n!==null?(n.childLanes=0,n.pendingProps=l):n=es(l,r,0,null),e=rr(e,r,a,null),n.return=t,e.return=t,n.sibling=e,t.child=n,t.child.memoizedState=Wu(a),t.memoizedState=qu,e):Mi(t,l));if(o=e.memoizedState,o!==null&&(s=o.dehydrated,s!==null))return Xh(e,t,l,r,s,o,a);if(n){n=r.fallback,l=t.mode,o=e.child,s=o.sibling;var u={mode:"hidden",children:r.children};return(l&1)===0&&t.child!==o?(r=t.child,r.childLanes=0,r.pendingProps=u,t.deletions=null):(r=Ra(o,u),r.subtreeFlags=o.subtreeFlags&14680064),s!==null?n=Ra(s,n):(n=rr(n,l,a,null),n.flags|=2),n.return=t,r.return=t,r.sibling=n,t.child=r,r=n,n=t.child,l=e.child.memoizedState,l=l===null?Wu(a):{baseLanes:l.baseLanes|a,cachePool:null,transitions:l.transitions},n.memoizedState=l,n.childLanes=e.childLanes&~a,t.memoizedState=qu,r}return n=e.child,e=n.sibling,r=Ra(n,{mode:"visible",children:r.children}),(t.mode&1)===0&&(r.lanes=a),r.return=t,r.sibling=null,e!==null&&(a=t.deletions,a===null?(t.deletions=[e],t.flags|=16):a.push(e)),t.child=r,t.memoizedState=null,r}function Mi(e,t){return t=es({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function sl(e,t,a,r){return r!==null&&xi(r),Zr(t,e.child,null,a),e=Mi(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function Xh(e,t,a,r,o,n,l){if(a)return t.flags&256?(t.flags&=-257,r=ru(Error(T(422))),sl(e,t,l,r)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(n=r.fallback,o=t.mode,r=es({mode:"visible",children:r.children},o,0,null),n=rr(n,o,l,null),n.flags|=2,r.return=t,n.return=t,r.sibling=n,t.child=r,(t.mode&1)!==0&&Zr(t,e.child,null,l),t.child.memoizedState=Wu(l),t.memoizedState=qu,n);if((t.mode&1)===0)return sl(e,t,l,null);if(o.data==="$!"){if(r=o.nextSibling&&o.nextSibling.dataset,r)var s=r.dgst;return r=s,n=Error(T(419)),r=ru(n,r,void 0),sl(e,t,l,r)}if(s=(l&e.childLanes)!==0,at||s){if(r=Ue,r!==null){switch(l&-l){case 4:o=2;break;case 16:o=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:o=32;break;case 536870912:o=268435456;break;default:o=0}o=(o&(r.suspendedLanes|l))!==0?0:o,o!==0&&o!==n.retryLane&&(n.retryLane=o,sa(e,o),Ot(r,e,o,-1))}return zi(),r=ru(Error(T(421))),sl(e,t,l,r)}return o.data==="$?"?(t.flags|=128,t.child=e.child,t=ux.bind(null,e),o._reactRetry=t,null):(e=n.treeContext,it=ka(o.nextSibling),dt=t,we=!0,Ft=null,e!==null&&(xt[vt++]=aa,xt[vt++]=ra,xt[vt++]=nr,aa=e.id,ra=e.overflow,nr=t),t=Mi(t,r.children),t.flags|=4096,t)}function Of(e,t,a){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),Ou(e.return,t,a)}function ou(e,t,a,r,o){var n=e.memoizedState;n===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:a,tailMode:o}:(n.isBackwards=t,n.rendering=null,n.renderingStartTime=0,n.last=r,n.tail=a,n.tailMode=o)}function wp(e,t,a){var r=t.pendingProps,o=r.revealOrder,n=r.tail;if(Ye(e,t,r.children,a),r=ke.current,(r&2)!==0)r=r&1|2,t.flags|=128;else{if(e!==null&&(e.flags&128)!==0)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&Of(e,a,t);else if(e.tag===19)Of(e,a,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}r&=1}if(ve(ke,r),(t.mode&1)===0)t.memoizedState=null;else switch(o){case"forwards":for(a=t.child,o=null;a!==null;)e=a.alternate,e!==null&&Ol(e)===null&&(o=a),a=a.sibling;a=o,a===null?(o=t.child,t.child=null):(o=a.sibling,a.sibling=null),ou(t,!1,o,a,n);break;case"backwards":for(a=null,o=t.child,t.child=null;o!==null;){if(e=o.alternate,e!==null&&Ol(e)===null){t.child=o;break}e=o.sibling,o.sibling=a,a=o,o=e}ou(t,!0,a,null,n);break;case"together":ou(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function hl(e,t){(t.mode&1)===0&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function ua(e,t,a){if(e!==null&&(t.dependencies=e.dependencies),sr|=t.lanes,(a&t.childLanes)===0)return null;if(e!==null&&t.child!==e.child)throw Error(T(153));if(t.child!==null){for(e=t.child,a=Ra(e,e.pendingProps),t.child=a,a.return=t;e.sibling!==null;)e=e.sibling,a=a.sibling=Ra(e,e.pendingProps),a.return=t;a.sibling=null}return t.child}function Qh(e,t,a){switch(t.tag){case 3:Ip(t),Yr();break;case 5:Qc(t);break;case 1:ot(t.type)&&Dl(t);break;case 4:Ci(t,t.stateNode.containerInfo);break;case 10:var r=t.type._context,o=t.memoizedProps.value;ve(El,r._currentValue),r._currentValue=o;break;case 13:if(r=t.memoizedState,r!==null)return r.dehydrated!==null?(ve(ke,ke.current&1),t.flags|=128,null):(a&t.child.childLanes)!==0?Cp(e,t,a):(ve(ke,ke.current&1),e=ua(e,t,a),e!==null?e.sibling:null);ve(ke,ke.current&1);break;case 19:if(r=(a&t.childLanes)!==0,(e.flags&128)!==0){if(r)return wp(e,t,a);t.flags|=128}if(o=t.memoizedState,o!==null&&(o.rendering=null,o.tail=null,o.lastEffect=null),ve(ke,ke.current),r)break;return null;case 22:case 23:return t.lanes=0,Lp(e,t,a)}return ua(e,t,a)}var kp,Vu,bp,Pp;kp=function(e,t){for(var a=t.child;a!==null;){if(a.tag===5||a.tag===6)e.appendChild(a.stateNode);else if(a.tag!==4&&a.child!==null){a.child.return=a,a=a.child;continue}if(a===t)break;for(;a.sibling===null;){if(a.return===null||a.return===t)return;a=a.return}a.sibling.return=a.return,a=a.sibling}};Vu=function(){};bp=function(e,t,a,r){var o=e.memoizedProps;if(o!==r){e=t.stateNode,tr(Gt.current);var n=null;switch(a){case"input":o=cu(e,o),r=cu(e,r),n=[];break;case"select":o=Pe({},o,{value:void 0}),r=Pe({},r,{value:void 0}),n=[];break;case"textarea":o=gu(e,o),r=gu(e,r),n=[];break;default:typeof o.onClick!="function"&&typeof r.onClick=="function"&&(e.onclick=Tl)}xu(a,r);var l;a=null;for(d in o)if(!r.hasOwnProperty(d)&&o.hasOwnProperty(d)&&o[d]!=null)if(d==="style"){var s=o[d];for(l in s)s.hasOwnProperty(l)&&(a||(a={}),a[l]="")}else d!=="dangerouslySetInnerHTML"&&d!=="children"&&d!=="suppressContentEditableWarning"&&d!=="suppressHydrationWarning"&&d!=="autoFocus"&&(Vo.hasOwnProperty(d)?n||(n=[]):(n=n||[]).push(d,null));for(d in r){var u=r[d];if(s=o!=null?o[d]:void 0,r.hasOwnProperty(d)&&u!==s&&(u!=null||s!=null))if(d==="style")if(s){for(l in s)!s.hasOwnProperty(l)||u&&u.hasOwnProperty(l)||(a||(a={}),a[l]="");for(l in u)u.hasOwnProperty(l)&&s[l]!==u[l]&&(a||(a={}),a[l]=u[l])}else a||(n||(n=[]),n.push(d,a)),a=u;else d==="dangerouslySetInnerHTML"?(u=u?u.__html:void 0,s=s?s.__html:void 0,u!=null&&s!==u&&(n=n||[]).push(d,u)):d==="children"?typeof u!="string"&&typeof u!="number"||(n=n||[]).push(d,""+u):d!=="suppressContentEditableWarning"&&d!=="suppressHydrationWarning"&&(Vo.hasOwnProperty(d)?(u!=null&&d==="onScroll"&&Le("scroll",e),n||s===u||(n=[])):(n=n||[]).push(d,u))}a&&(n=n||[]).push("style",a);var d=n;(t.updateQueue=d)&&(t.flags|=4)}};Pp=function(e,t,a,r){a!==r&&(t.flags|=4)};function To(e,t){if(!we)switch(e.tailMode){case"hidden":t=e.tail;for(var a=null;t!==null;)t.alternate!==null&&(a=t),t=t.sibling;a===null?e.tail=null:a.sibling=null;break;case"collapsed":a=e.tail;for(var r=null;a!==null;)a.alternate!==null&&(r=a),a=a.sibling;r===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:r.sibling=null}}function $e(e){var t=e.alternate!==null&&e.alternate.child===e.child,a=0,r=0;if(t)for(var o=e.child;o!==null;)a|=o.lanes|o.childLanes,r|=o.subtreeFlags&14680064,r|=o.flags&14680064,o.return=e,o=o.sibling;else for(o=e.child;o!==null;)a|=o.lanes|o.childLanes,r|=o.subtreeFlags,r|=o.flags,o.return=e,o=o.sibling;return e.subtreeFlags|=r,e.childLanes=a,t}function Yh(e,t,a){var r=t.pendingProps;switch(hi(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return $e(t),null;case 1:return ot(t.type)&&Rl(),$e(t),null;case 3:return r=t.stateNode,Jr(),Se(rt),Se(Ge),ki(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),(e===null||e.child===null)&&(nl(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,Ft!==null&&(Zu(Ft),Ft=null))),Vu(e,t),$e(t),null;case 5:wi(t);var o=tr(an.current);if(a=t.type,e!==null&&t.stateNode!=null)bp(e,t,a,r,o),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!r){if(t.stateNode===null)throw Error(T(166));return $e(t),null}if(e=tr(Gt.current),nl(t)){r=t.stateNode,a=t.type;var n=t.memoizedProps;switch(r[$t]=t,r[en]=n,e=(t.mode&1)!==0,a){case"dialog":Le("cancel",r),Le("close",r);break;case"iframe":case"object":case"embed":Le("load",r);break;case"video":case"audio":for(o=0;o<Fo.length;o++)Le(Fo[o],r);break;case"source":Le("error",r);break;case"img":case"image":case"link":Le("error",r),Le("load",r);break;case"details":Le("toggle",r);break;case"input":Wd(r,n),Le("invalid",r);break;case"select":r._wrapperState={wasMultiple:!!n.multiple},Le("invalid",r);break;case"textarea":$d(r,n),Le("invalid",r)}xu(a,n),o=null;for(var l in n)if(n.hasOwnProperty(l)){var s=n[l];l==="children"?typeof s=="string"?r.textContent!==s&&(n.suppressHydrationWarning!==!0&&ol(r.textContent,s,e),o=["children",s]):typeof s=="number"&&r.textContent!==""+s&&(n.suppressHydrationWarning!==!0&&ol(r.textContent,s,e),o=["children",""+s]):Vo.hasOwnProperty(l)&&s!=null&&l==="onScroll"&&Le("scroll",r)}switch(a){case"input":Kn(r),Vd(r,n,!0);break;case"textarea":Kn(r),Kd(r);break;case"select":case"option":break;default:typeof n.onClick=="function"&&(r.onclick=Tl)}r=o,t.updateQueue=r,r!==null&&(t.flags|=4)}else{l=o.nodeType===9?o:o.ownerDocument,e==="http://www.w3.org/1999/xhtml"&&(e=tc(a)),e==="http://www.w3.org/1999/xhtml"?a==="script"?(e=l.createElement("div"),e.innerHTML="<script><\\/script>",e=e.removeChild(e.firstChild)):typeof r.is=="string"?e=l.createElement(a,{is:r.is}):(e=l.createElement(a),a==="select"&&(l=e,r.multiple?l.multiple=!0:r.size&&(l.size=r.size))):e=l.createElementNS(e,a),e[$t]=t,e[en]=r,kp(e,t,!1,!1),t.stateNode=e;e:{switch(l=vu(a,r),a){case"dialog":Le("cancel",e),Le("close",e),o=r;break;case"iframe":case"object":case"embed":Le("load",e),o=r;break;case"video":case"audio":for(o=0;o<Fo.length;o++)Le(Fo[o],e);o=r;break;case"source":Le("error",e),o=r;break;case"img":case"image":case"link":Le("error",e),Le("load",e),o=r;break;case"details":Le("toggle",e),o=r;break;case"input":Wd(e,r),o=cu(e,r),Le("invalid",e);break;case"option":o=r;break;case"select":e._wrapperState={wasMultiple:!!r.multiple},o=Pe({},r,{value:void 0}),Le("invalid",e);break;case"textarea":$d(e,r),o=gu(e,r),Le("invalid",e);break;default:o=r}xu(a,o),s=o;for(n in s)if(s.hasOwnProperty(n)){var u=s[n];n==="style"?oc(e,u):n==="dangerouslySetInnerHTML"?(u=u?u.__html:void 0,u!=null&&ac(e,u)):n==="children"?typeof u=="string"?(a!=="textarea"||u!=="")&&$o(e,u):typeof u=="number"&&$o(e,""+u):n!=="suppressContentEditableWarning"&&n!=="suppressHydrationWarning"&&n!=="autoFocus"&&(Vo.hasOwnProperty(n)?u!=null&&n==="onScroll"&&Le("scroll",e):u!=null&&ti(e,n,u,l))}switch(a){case"input":Kn(e),Vd(e,r,!1);break;case"textarea":Kn(e),Kd(e);break;case"option":r.value!=null&&e.setAttribute("value",""+Da(r.value));break;case"select":e.multiple=!!r.multiple,n=r.value,n!=null?Wr(e,!!r.multiple,n,!1):r.defaultValue!=null&&Wr(e,!!r.multiple,r.defaultValue,!0);break;default:typeof o.onClick=="function"&&(e.onclick=Tl)}switch(a){case"button":case"input":case"select":case"textarea":r=!!r.autoFocus;break e;case"img":r=!0;break e;default:r=!1}}r&&(t.flags|=4)}t.ref!==null&&(t.flags|=512,t.flags|=2097152)}return $e(t),null;case 6:if(e&&t.stateNode!=null)Pp(e,t,e.memoizedProps,r);else{if(typeof r!="string"&&t.stateNode===null)throw Error(T(166));if(a=tr(an.current),tr(Gt.current),nl(t)){if(r=t.stateNode,a=t.memoizedProps,r[$t]=t,(n=r.nodeValue!==a)&&(e=dt,e!==null))switch(e.tag){case 3:ol(r.nodeValue,a,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&ol(r.nodeValue,a,(e.mode&1)!==0)}n&&(t.flags|=4)}else r=(a.nodeType===9?a:a.ownerDocument).createTextNode(r),r[$t]=t,t.stateNode=r}return $e(t),null;case 13:if(Se(ke),r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(we&&it!==null&&(t.mode&1)!==0&&(t.flags&128)===0)$c(),Yr(),t.flags|=98560,n=!1;else if(n=nl(t),r!==null&&r.dehydrated!==null){if(e===null){if(!n)throw Error(T(318));if(n=t.memoizedState,n=n!==null?n.dehydrated:null,!n)throw Error(T(317));n[$t]=t}else Yr(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;$e(t),n=!1}else Ft!==null&&(Zu(Ft),Ft=null),n=!0;if(!n)return t.flags&65536?t:null}return(t.flags&128)!==0?(t.lanes=a,t):(r=r!==null,r!==(e!==null&&e.memoizedState!==null)&&r&&(t.child.flags|=8192,(t.mode&1)!==0&&(e===null||(ke.current&1)!==0?Oe===0&&(Oe=3):zi())),t.updateQueue!==null&&(t.flags|=4),$e(t),null);case 4:return Jr(),Vu(e,t),e===null&&Zo(t.stateNode.containerInfo),$e(t),null;case 10:return Li(t.type._context),$e(t),null;case 17:return ot(t.type)&&Rl(),$e(t),null;case 19:if(Se(ke),n=t.memoizedState,n===null)return $e(t),null;if(r=(t.flags&128)!==0,l=n.rendering,l===null)if(r)To(n,!1);else{if(Oe!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(l=Ol(e),l!==null){for(t.flags|=128,To(n,!1),r=l.updateQueue,r!==null&&(t.updateQueue=r,t.flags|=4),t.subtreeFlags=0,r=a,a=t.child;a!==null;)n=a,e=r,n.flags&=14680066,l=n.alternate,l===null?(n.childLanes=0,n.lanes=e,n.child=null,n.subtreeFlags=0,n.memoizedProps=null,n.memoizedState=null,n.updateQueue=null,n.dependencies=null,n.stateNode=null):(n.childLanes=l.childLanes,n.lanes=l.lanes,n.child=l.child,n.subtreeFlags=0,n.deletions=null,n.memoizedProps=l.memoizedProps,n.memoizedState=l.memoizedState,n.updateQueue=l.updateQueue,n.type=l.type,e=l.dependencies,n.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),a=a.sibling;return ve(ke,ke.current&1|2),t.child}e=e.sibling}n.tail!==null&&De()>to&&(t.flags|=128,r=!0,To(n,!1),t.lanes=4194304)}else{if(!r)if(e=Ol(l),e!==null){if(t.flags|=128,r=!0,a=e.updateQueue,a!==null&&(t.updateQueue=a,t.flags|=4),To(n,!0),n.tail===null&&n.tailMode==="hidden"&&!l.alternate&&!we)return $e(t),null}else 2*De()-n.renderingStartTime>to&&a!==1073741824&&(t.flags|=128,r=!0,To(n,!1),t.lanes=4194304);n.isBackwards?(l.sibling=t.child,t.child=l):(a=n.last,a!==null?a.sibling=l:t.child=l,n.last=l)}return n.tail!==null?(t=n.tail,n.rendering=t,n.tail=t.sibling,n.renderingStartTime=De(),t.sibling=null,a=ke.current,ve(ke,r?a&1|2:a&1),t):($e(t),null);case 22:case 23:return Oi(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&(t.mode&1)!==0?(ut&1073741824)!==0&&($e(t),t.subtreeFlags&6&&(t.flags|=8192)):$e(t),null;case 24:return null;case 25:return null}throw Error(T(156,t.tag))}function Zh(e,t){switch(hi(t),t.tag){case 1:return ot(t.type)&&Rl(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Jr(),Se(rt),Se(Ge),ki(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 5:return wi(t),null;case 13:if(Se(ke),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(T(340));Yr()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Se(ke),null;case 4:return Jr(),null;case 10:return Li(t.type._context),null;case 22:case 23:return Oi(),null;case 24:return null;default:return null}}var ul=!1,Ke=!1,Jh=typeof WeakSet=="function"?WeakSet:Set,U=null;function _r(e,t){var a=e.ref;if(a!==null)if(typeof a=="function")try{a(null)}catch(r){Re(e,t,r)}else a.current=null}function $u(e,t,a){try{a()}catch(r){Re(e,t,r)}}var zf=!1;function ex(e,t){if(Tu=kl,e=Ac(),mi(e)){if("selectionStart"in e)var a={start:e.selectionStart,end:e.selectionEnd};else e:{a=(a=e.ownerDocument)&&a.defaultView||window;var r=a.getSelection&&a.getSelection();if(r&&r.rangeCount!==0){a=r.anchorNode;var o=r.anchorOffset,n=r.focusNode;r=r.focusOffset;try{a.nodeType,n.nodeType}catch{a=null;break e}var l=0,s=-1,u=-1,d=0,g=0,m=e,p=null;t:for(;;){for(var v;m!==a||o!==0&&m.nodeType!==3||(s=l+o),m!==n||r!==0&&m.nodeType!==3||(u=l+r),m.nodeType===3&&(l+=m.nodeValue.length),(v=m.firstChild)!==null;)p=m,m=v;for(;;){if(m===e)break t;if(p===a&&++d===o&&(s=l),p===n&&++g===r&&(u=l),(v=m.nextSibling)!==null)break;m=p,p=m.parentNode}m=v}a=s===-1||u===-1?null:{start:s,end:u}}else a=null}a=a||{start:0,end:0}}else a=null;for(Ru={focusedElem:e,selectionRange:a},kl=!1,U=t;U!==null;)if(t=U,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,U=e;else for(;U!==null;){t=U;try{var L=t.alternate;if((t.flags&1024)!==0)switch(t.tag){case 0:case 11:case 15:break;case 1:if(L!==null){var S=L.memoizedProps,z=L.memoizedState,c=t.stateNode,i=c.getSnapshotBeforeUpdate(t.elementType===t.type?S:At(t.type,S),z);c.__reactInternalSnapshotBeforeUpdate=i}break;case 3:var f=t.stateNode.containerInfo;f.nodeType===1?f.textContent="":f.nodeType===9&&f.documentElement&&f.removeChild(f.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(T(163))}}catch(y){Re(t,t.return,y)}if(e=t.sibling,e!==null){e.return=t.return,U=e;break}U=t.return}return L=zf,zf=!1,L}function _o(e,t,a){var r=t.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var o=r=r.next;do{if((o.tag&e)===e){var n=o.destroy;o.destroy=void 0,n!==void 0&&$u(t,a,n)}o=o.next}while(o!==r)}}function Zl(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var a=t=t.next;do{if((a.tag&e)===e){var r=a.create;a.destroy=r()}a=a.next}while(a!==t)}}function Ku(e){var t=e.ref;if(t!==null){var a=e.stateNode;switch(e.tag){case 5:e=a;break;default:e=a}typeof t=="function"?t(e):t.current=e}}function Tp(e){var t=e.alternate;t!==null&&(e.alternate=null,Tp(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[$t],delete t[en],delete t[Au],delete t[Oh],delete t[zh])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function Rp(e){return e.tag===5||e.tag===3||e.tag===4}function Uf(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Rp(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function Gu(e,t,a){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?a.nodeType===8?a.parentNode.insertBefore(e,t):a.insertBefore(e,t):(a.nodeType===8?(t=a.parentNode,t.insertBefore(e,a)):(t=a,t.appendChild(e)),a=a._reactRootContainer,a!=null||t.onclick!==null||(t.onclick=Tl));else if(r!==4&&(e=e.child,e!==null))for(Gu(e,t,a),e=e.sibling;e!==null;)Gu(e,t,a),e=e.sibling}function ju(e,t,a){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?a.insertBefore(e,t):a.appendChild(e);else if(r!==4&&(e=e.child,e!==null))for(ju(e,t,a),e=e.sibling;e!==null;)ju(e,t,a),e=e.sibling}var He=null,Et=!1;function ga(e,t,a){for(a=a.child;a!==null;)Dp(e,t,a),a=a.sibling}function Dp(e,t,a){if(Kt&&typeof Kt.onCommitFiberUnmount=="function")try{Kt.onCommitFiberUnmount(Vl,a)}catch{}switch(a.tag){case 5:Ke||_r(a,t);case 6:var r=He,o=Et;He=null,ga(e,t,a),He=r,Et=o,He!==null&&(Et?(e=He,a=a.stateNode,e.nodeType===8?e.parentNode.removeChild(a):e.removeChild(a)):He.removeChild(a.stateNode));break;case 18:He!==null&&(Et?(e=He,a=a.stateNode,e.nodeType===8?Ys(e.parentNode,a):e.nodeType===1&&Ys(e,a),Xo(e)):Ys(He,a.stateNode));break;case 4:r=He,o=Et,He=a.stateNode.containerInfo,Et=!0,ga(e,t,a),He=r,Et=o;break;case 0:case 11:case 14:case 15:if(!Ke&&(r=a.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){o=r=r.next;do{var n=o,l=n.destroy;n=n.tag,l!==void 0&&((n&2)!==0||(n&4)!==0)&&$u(a,t,l),o=o.next}while(o!==r)}ga(e,t,a);break;case 1:if(!Ke&&(_r(a,t),r=a.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=a.memoizedProps,r.state=a.memoizedState,r.componentWillUnmount()}catch(s){Re(a,t,s)}ga(e,t,a);break;case 21:ga(e,t,a);break;case 22:a.mode&1?(Ke=(r=Ke)||a.memoizedState!==null,ga(e,t,a),Ke=r):ga(e,t,a);break;default:ga(e,t,a)}}function Nf(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var a=e.stateNode;a===null&&(a=e.stateNode=new Jh),t.forEach(function(r){var o=ix.bind(null,e,r);a.has(r)||(a.add(r),r.then(o,o))})}}function Mt(e,t){var a=t.deletions;if(a!==null)for(var r=0;r<a.length;r++){var o=a[r];try{var n=e,l=t,s=l;e:for(;s!==null;){switch(s.tag){case 5:He=s.stateNode,Et=!1;break e;case 3:He=s.stateNode.containerInfo,Et=!0;break e;case 4:He=s.stateNode.containerInfo,Et=!0;break e}s=s.return}if(He===null)throw Error(T(160));Dp(n,l,o),He=null,Et=!1;var u=o.alternate;u!==null&&(u.return=null),o.return=null}catch(d){Re(o,t,d)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)Mp(t,e),t=t.sibling}function Mp(e,t){var a=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(Mt(t,e),Wt(e),r&4){try{_o(3,e,e.return),Zl(3,e)}catch(S){Re(e,e.return,S)}try{_o(5,e,e.return)}catch(S){Re(e,e.return,S)}}break;case 1:Mt(t,e),Wt(e),r&512&&a!==null&&_r(a,a.return);break;case 5:if(Mt(t,e),Wt(e),r&512&&a!==null&&_r(a,a.return),e.flags&32){var o=e.stateNode;try{$o(o,"")}catch(S){Re(e,e.return,S)}}if(r&4&&(o=e.stateNode,o!=null)){var n=e.memoizedProps,l=a!==null?a.memoizedProps:n,s=e.type,u=e.updateQueue;if(e.updateQueue=null,u!==null)try{s==="input"&&n.type==="radio"&&n.name!=null&&Jf(o,n),vu(s,l);var d=vu(s,n);for(l=0;l<u.length;l+=2){var g=u[l],m=u[l+1];g==="style"?oc(o,m):g==="dangerouslySetInnerHTML"?ac(o,m):g==="children"?$o(o,m):ti(o,g,m,d)}switch(s){case"input":pu(o,n);break;case"textarea":ec(o,n);break;case"select":var p=o._wrapperState.wasMultiple;o._wrapperState.wasMultiple=!!n.multiple;var v=n.value;v!=null?Wr(o,!!n.multiple,v,!1):p!==!!n.multiple&&(n.defaultValue!=null?Wr(o,!!n.multiple,n.defaultValue,!0):Wr(o,!!n.multiple,n.multiple?[]:"",!1))}o[en]=n}catch(S){Re(e,e.return,S)}}break;case 6:if(Mt(t,e),Wt(e),r&4){if(e.stateNode===null)throw Error(T(162));o=e.stateNode,n=e.memoizedProps;try{o.nodeValue=n}catch(S){Re(e,e.return,S)}}break;case 3:if(Mt(t,e),Wt(e),r&4&&a!==null&&a.memoizedState.isDehydrated)try{Xo(t.containerInfo)}catch(S){Re(e,e.return,S)}break;case 4:Mt(t,e),Wt(e);break;case 13:Mt(t,e),Wt(e),o=e.child,o.flags&8192&&(n=o.memoizedState!==null,o.stateNode.isHidden=n,!n||o.alternate!==null&&o.alternate.memoizedState!==null||(Fi=De())),r&4&&Nf(e);break;case 22:if(g=a!==null&&a.memoizedState!==null,e.mode&1?(Ke=(d=Ke)||g,Mt(t,e),Ke=d):Mt(t,e),Wt(e),r&8192){if(d=e.memoizedState!==null,(e.stateNode.isHidden=d)&&!g&&(e.mode&1)!==0)for(U=e,g=e.child;g!==null;){for(m=U=g;U!==null;){switch(p=U,v=p.child,p.tag){case 0:case 11:case 14:case 15:_o(4,p,p.return);break;case 1:_r(p,p.return);var L=p.stateNode;if(typeof L.componentWillUnmount=="function"){r=p,a=p.return;try{t=r,L.props=t.memoizedProps,L.state=t.memoizedState,L.componentWillUnmount()}catch(S){Re(r,a,S)}}break;case 5:_r(p,p.return);break;case 22:if(p.memoizedState!==null){_f(m);continue}}v!==null?(v.return=p,U=v):_f(m)}g=g.sibling}e:for(g=null,m=e;;){if(m.tag===5){if(g===null){g=m;try{o=m.stateNode,d?(n=o.style,typeof n.setProperty=="function"?n.setProperty("display","none","important"):n.display="none"):(s=m.stateNode,u=m.memoizedProps.style,l=u!=null&&u.hasOwnProperty("display")?u.display:null,s.style.display=rc("display",l))}catch(S){Re(e,e.return,S)}}}else if(m.tag===6){if(g===null)try{m.stateNode.nodeValue=d?"":m.memoizedProps}catch(S){Re(e,e.return,S)}}else if((m.tag!==22&&m.tag!==23||m.memoizedState===null||m===e)&&m.child!==null){m.child.return=m,m=m.child;continue}if(m===e)break e;for(;m.sibling===null;){if(m.return===null||m.return===e)break e;g===m&&(g=null),m=m.return}g===m&&(g=null),m.sibling.return=m.return,m=m.sibling}}break;case 19:Mt(t,e),Wt(e),r&4&&Nf(e);break;case 21:break;default:Mt(t,e),Wt(e)}}function Wt(e){var t=e.flags;if(t&2){try{e:{for(var a=e.return;a!==null;){if(Rp(a)){var r=a;break e}a=a.return}throw Error(T(160))}switch(r.tag){case 5:var o=r.stateNode;r.flags&32&&($o(o,""),r.flags&=-33);var n=Uf(e);ju(e,n,o);break;case 3:case 4:var l=r.stateNode.containerInfo,s=Uf(e);Gu(e,s,l);break;default:throw Error(T(161))}}catch(u){Re(e,e.return,u)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function tx(e,t,a){U=e,Ap(e,t,a)}function Ap(e,t,a){for(var r=(e.mode&1)!==0;U!==null;){var o=U,n=o.child;if(o.tag===22&&r){var l=o.memoizedState!==null||ul;if(!l){var s=o.alternate,u=s!==null&&s.memoizedState!==null||Ke;s=ul;var d=Ke;if(ul=l,(Ke=u)&&!d)for(U=o;U!==null;)l=U,u=l.child,l.tag===22&&l.memoizedState!==null?qf(o):u!==null?(u.return=l,U=u):qf(o);for(;n!==null;)U=n,Ap(n,t,a),n=n.sibling;U=o,ul=s,Ke=d}Hf(e,t,a)}else(o.subtreeFlags&8772)!==0&&n!==null?(n.return=o,U=n):Hf(e,t,a)}}function Hf(e){for(;U!==null;){var t=U;if((t.flags&8772)!==0){var a=t.alternate;try{if((t.flags&8772)!==0)switch(t.tag){case 0:case 11:case 15:Ke||Zl(5,t);break;case 1:var r=t.stateNode;if(t.flags&4&&!Ke)if(a===null)r.componentDidMount();else{var o=t.elementType===t.type?a.memoizedProps:At(t.type,a.memoizedProps);r.componentDidUpdate(o,a.memoizedState,r.__reactInternalSnapshotBeforeUpdate)}var n=t.updateQueue;n!==null&&wf(t,n,r);break;case 3:var l=t.updateQueue;if(l!==null){if(a=null,t.child!==null)switch(t.child.tag){case 5:a=t.child.stateNode;break;case 1:a=t.child.stateNode}wf(t,l,a)}break;case 5:var s=t.stateNode;if(a===null&&t.flags&4){a=s;var u=t.memoizedProps;switch(t.type){case"button":case"input":case"select":case"textarea":u.autoFocus&&a.focus();break;case"img":u.src&&(a.src=u.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(t.memoizedState===null){var d=t.alternate;if(d!==null){var g=d.memoizedState;if(g!==null){var m=g.dehydrated;m!==null&&Xo(m)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(T(163))}Ke||t.flags&512&&Ku(t)}catch(p){Re(t,t.return,p)}}if(t===e){U=null;break}if(a=t.sibling,a!==null){a.return=t.return,U=a;break}U=t.return}}function _f(e){for(;U!==null;){var t=U;if(t===e){U=null;break}var a=t.sibling;if(a!==null){a.return=t.return,U=a;break}U=t.return}}function qf(e){for(;U!==null;){var t=U;try{switch(t.tag){case 0:case 11:case 15:var a=t.return;try{Zl(4,t)}catch(u){Re(t,a,u)}break;case 1:var r=t.stateNode;if(typeof r.componentDidMount=="function"){var o=t.return;try{r.componentDidMount()}catch(u){Re(t,o,u)}}var n=t.return;try{Ku(t)}catch(u){Re(t,n,u)}break;case 5:var l=t.return;try{Ku(t)}catch(u){Re(t,l,u)}}}catch(u){Re(t,t.return,u)}if(t===e){U=null;break}var s=t.sibling;if(s!==null){s.return=t.return,U=s;break}U=t.return}}var ax=Math.ceil,Nl=ia.ReactCurrentDispatcher,Ai=ia.ReactCurrentOwner,Lt=ia.ReactCurrentBatchConfig,ue=0,Ue=null,Ae=null,_e=0,ut=0,qr=Ea(0),Oe=0,ln=null,sr=0,Jl=0,Ei=0,qo=null,tt=null,Fi=0,to=1/0,ea=null,Hl=!1,Xu=null,Pa=null,il=!1,Sa=null,_l=0,Wo=0,Qu=null,xl=-1,vl=0;function Ze(){return(ue&6)!==0?De():xl!==-1?xl:xl=De()}function Ta(e){return(e.mode&1)===0?1:(ue&2)!==0&&_e!==0?_e&-_e:Nh.transition!==null?(vl===0&&(vl=hc()),vl):(e=me,e!==0||(e=window.event,e=e===void 0?16:Cc(e.type)),e)}function Ot(e,t,a,r){if(50<Wo)throw Wo=0,Qu=null,Error(T(185));sn(e,a,r),((ue&2)===0||e!==Ue)&&(e===Ue&&((ue&2)===0&&(Jl|=a),Oe===4&&ya(e,_e)),nt(e,r),a===1&&ue===0&&(t.mode&1)===0&&(to=De()+500,Xl&&Fa()))}function nt(e,t){var a=e.callbackNode;_g(e,t);var r=wl(e,e===Ue?_e:0);if(r===0)a!==null&&Xd(a),e.callbackNode=null,e.callbackPriority=0;else if(t=r&-r,e.callbackPriority!==t){if(a!=null&&Xd(a),t===1)e.tag===0?Uh(Wf.bind(null,e)):qc(Wf.bind(null,e)),Fh(function(){(ue&6)===0&&Fa()}),a=null;else{switch(xc(r)){case 1:a=li;break;case 4:a=mc;break;case 16:a=Cl;break;case 536870912:a=gc;break;default:a=Cl}a=Hp(a,Ep.bind(null,e))}e.callbackPriority=t,e.callbackNode=a}}function Ep(e,t){if(xl=-1,vl=0,(ue&6)!==0)throw Error(T(327));var a=e.callbackNode;if(jr()&&e.callbackNode!==a)return null;var r=wl(e,e===Ue?_e:0);if(r===0)return null;if((r&30)!==0||(r&e.expiredLanes)!==0||t)t=ql(e,r);else{t=r;var o=ue;ue|=2;var n=Bp();(Ue!==e||_e!==t)&&(ea=null,to=De()+500,ar(e,t));do try{nx();break}catch(s){Fp(e,s)}while(!0);yi(),Nl.current=n,ue=o,Ae!==null?t=0:(Ue=null,_e=0,t=Oe)}if(t!==0){if(t===2&&(o=Cu(e),o!==0&&(r=o,t=Yu(e,o))),t===1)throw a=ln,ar(e,0),ya(e,r),nt(e,De()),a;if(t===6)ya(e,r);else{if(o=e.current.alternate,(r&30)===0&&!rx(o)&&(t=ql(e,r),t===2&&(n=Cu(e),n!==0&&(r=n,t=Yu(e,n))),t===1))throw a=ln,ar(e,0),ya(e,r),nt(e,De()),a;switch(e.finishedWork=o,e.finishedLanes=r,t){case 0:case 1:throw Error(T(345));case 2:Za(e,tt,ea);break;case 3:if(ya(e,r),(r&130023424)===r&&(t=Fi+500-De(),10<t)){if(wl(e,0)!==0)break;if(o=e.suspendedLanes,(o&r)!==r){Ze(),e.pingedLanes|=e.suspendedLanes&o;break}e.timeoutHandle=Mu(Za.bind(null,e,tt,ea),t);break}Za(e,tt,ea);break;case 4:if(ya(e,r),(r&4194240)===r)break;for(t=e.eventTimes,o=-1;0<r;){var l=31-Bt(r);n=1<<l,l=t[l],l>o&&(o=l),r&=~n}if(r=o,r=De()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*ax(r/1960))-r,10<r){e.timeoutHandle=Mu(Za.bind(null,e,tt,ea),r);break}Za(e,tt,ea);break;case 5:Za(e,tt,ea);break;default:throw Error(T(329))}}}return nt(e,De()),e.callbackNode===a?Ep.bind(null,e):null}function Yu(e,t){var a=qo;return e.current.memoizedState.isDehydrated&&(ar(e,t).flags|=256),e=ql(e,t),e!==2&&(t=tt,tt=a,t!==null&&Zu(t)),e}function Zu(e){tt===null?tt=e:tt.push.apply(tt,e)}function rx(e){for(var t=e;;){if(t.flags&16384){var a=t.updateQueue;if(a!==null&&(a=a.stores,a!==null))for(var r=0;r<a.length;r++){var o=a[r],n=o.getSnapshot;o=o.value;try{if(!zt(n(),o))return!1}catch{return!1}}}if(a=t.child,t.subtreeFlags&16384&&a!==null)a.return=t,t=a;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function ya(e,t){for(t&=~Ei,t&=~Jl,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var a=31-Bt(t),r=1<<a;e[a]=-1,t&=~r}}function Wf(e){if((ue&6)!==0)throw Error(T(327));jr();var t=wl(e,0);if((t&1)===0)return nt(e,De()),null;var a=ql(e,t);if(e.tag!==0&&a===2){var r=Cu(e);r!==0&&(t=r,a=Yu(e,r))}if(a===1)throw a=ln,ar(e,0),ya(e,t),nt(e,De()),a;if(a===6)throw Error(T(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,Za(e,tt,ea),nt(e,De()),null}function Bi(e,t){var a=ue;ue|=1;try{return e(t)}finally{ue=a,ue===0&&(to=De()+500,Xl&&Fa())}}function ur(e){Sa!==null&&Sa.tag===0&&(ue&6)===0&&jr();var t=ue;ue|=1;var a=Lt.transition,r=me;try{if(Lt.transition=null,me=1,e)return e()}finally{me=r,Lt.transition=a,ue=t,(ue&6)===0&&Fa()}}function Oi(){ut=qr.current,Se(qr)}function ar(e,t){e.finishedWork=null,e.finishedLanes=0;var a=e.timeoutHandle;if(a!==-1&&(e.timeoutHandle=-1,Eh(a)),Ae!==null)for(a=Ae.return;a!==null;){var r=a;switch(hi(r),r.tag){case 1:r=r.type.childContextTypes,r!=null&&Rl();break;case 3:Jr(),Se(rt),Se(Ge),ki();break;case 5:wi(r);break;case 4:Jr();break;case 13:Se(ke);break;case 19:Se(ke);break;case 10:Li(r.type._context);break;case 22:case 23:Oi()}a=a.return}if(Ue=e,Ae=e=Ra(e.current,null),_e=ut=t,Oe=0,ln=null,Ei=Jl=sr=0,tt=qo=null,er!==null){for(t=0;t<er.length;t++)if(a=er[t],r=a.interleaved,r!==null){a.interleaved=null;var o=r.next,n=a.pending;if(n!==null){var l=n.next;n.next=o,r.next=l}a.pending=r}er=null}return e}function Fp(e,t){do{var a=Ae;try{if(yi(),ml.current=Ul,zl){for(var r=be.memoizedState;r!==null;){var o=r.queue;o!==null&&(o.pending=null),r=r.next}zl=!1}if(lr=0,ze=Be=be=null,Ho=!1,rn=0,Ai.current=null,a===null||a.return===null){Oe=1,ln=t,Ae=null;break}e:{var n=e,l=a.return,s=a,u=t;if(t=_e,s.flags|=32768,u!==null&&typeof u=="object"&&typeof u.then=="function"){var d=u,g=s,m=g.tag;if((g.mode&1)===0&&(m===0||m===11||m===15)){var p=g.alternate;p?(g.updateQueue=p.updateQueue,g.memoizedState=p.memoizedState,g.lanes=p.lanes):(g.updateQueue=null,g.memoizedState=null)}var v=Df(l);if(v!==null){v.flags&=-257,Mf(v,l,s,n,t),v.mode&1&&Rf(n,d,t),t=v,u=d;var L=t.updateQueue;if(L===null){var S=new Set;S.add(u),t.updateQueue=S}else L.add(u);break e}else{if((t&1)===0){Rf(n,d,t),zi();break e}u=Error(T(426))}}else if(we&&s.mode&1){var z=Df(l);if(z!==null){(z.flags&65536)===0&&(z.flags|=256),Mf(z,l,s,n,t),xi(eo(u,s));break e}}n=u=eo(u,s),Oe!==4&&(Oe=2),qo===null?qo=[n]:qo.push(n),n=l;do{switch(n.tag){case 3:n.flags|=65536,t&=-t,n.lanes|=t;var c=xp(n,u,t);Cf(n,c);break e;case 1:s=u;var i=n.type,f=n.stateNode;if((n.flags&128)===0&&(typeof i.getDerivedStateFromError=="function"||f!==null&&typeof f.componentDidCatch=="function"&&(Pa===null||!Pa.has(f)))){n.flags|=65536,t&=-t,n.lanes|=t;var y=vp(n,s,t);Cf(n,y);break e}}n=n.return}while(n!==null)}zp(a)}catch(C){t=C,Ae===a&&a!==null&&(Ae=a=a.return);continue}break}while(!0)}function Bp(){var e=Nl.current;return Nl.current=Ul,e===null?Ul:e}function zi(){(Oe===0||Oe===3||Oe===2)&&(Oe=4),Ue===null||(sr&268435455)===0&&(Jl&268435455)===0||ya(Ue,_e)}function ql(e,t){var a=ue;ue|=2;var r=Bp();(Ue!==e||_e!==t)&&(ea=null,ar(e,t));do try{ox();break}catch(o){Fp(e,o)}while(!0);if(yi(),ue=a,Nl.current=r,Ae!==null)throw Error(T(261));return Ue=null,_e=0,Oe}function ox(){for(;Ae!==null;)Op(Ae)}function nx(){for(;Ae!==null&&!Ag();)Op(Ae)}function Op(e){var t=Np(e.alternate,e,ut);e.memoizedProps=e.pendingProps,t===null?zp(e):Ae=t,Ai.current=null}function zp(e){var t=e;do{var a=t.alternate;if(e=t.return,(t.flags&32768)===0){if(a=Yh(a,t,ut),a!==null){Ae=a;return}}else{if(a=Zh(a,t),a!==null){a.flags&=32767,Ae=a;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{Oe=6,Ae=null;return}}if(t=t.sibling,t!==null){Ae=t;return}Ae=t=e}while(t!==null);Oe===0&&(Oe=5)}function Za(e,t,a){var r=me,o=Lt.transition;try{Lt.transition=null,me=1,lx(e,t,a,r)}finally{Lt.transition=o,me=r}return null}function lx(e,t,a,r){do jr();while(Sa!==null);if((ue&6)!==0)throw Error(T(327));a=e.finishedWork;var o=e.finishedLanes;if(a===null)return null;if(e.finishedWork=null,e.finishedLanes=0,a===e.current)throw Error(T(177));e.callbackNode=null,e.callbackPriority=0;var n=a.lanes|a.childLanes;if(qg(e,n),e===Ue&&(Ae=Ue=null,_e=0),(a.subtreeFlags&2064)===0&&(a.flags&2064)===0||il||(il=!0,Hp(Cl,function(){return jr(),null})),n=(a.flags&15990)!==0,(a.subtreeFlags&15990)!==0||n){n=Lt.transition,Lt.transition=null;var l=me;me=1;var s=ue;ue|=4,Ai.current=null,ex(e,a),Mp(a,e),Th(Ru),kl=!!Tu,Ru=Tu=null,e.current=a,tx(a,e,o),Eg(),ue=s,me=l,Lt.transition=n}else e.current=a;if(il&&(il=!1,Sa=e,_l=o),n=e.pendingLanes,n===0&&(Pa=null),Og(a.stateNode,r),nt(e,De()),t!==null)for(r=e.onRecoverableError,a=0;a<t.length;a++)o=t[a],r(o.value,{componentStack:o.stack,digest:o.digest});if(Hl)throw Hl=!1,e=Xu,Xu=null,e;return(_l&1)!==0&&e.tag!==0&&jr(),n=e.pendingLanes,(n&1)!==0?e===Qu?Wo++:(Wo=0,Qu=e):Wo=0,Fa(),null}function jr(){if(Sa!==null){var e=xc(_l),t=Lt.transition,a=me;try{if(Lt.transition=null,me=16>e?16:e,Sa===null)var r=!1;else{if(e=Sa,Sa=null,_l=0,(ue&6)!==0)throw Error(T(331));var o=ue;for(ue|=4,U=e.current;U!==null;){var n=U,l=n.child;if((U.flags&16)!==0){var s=n.deletions;if(s!==null){for(var u=0;u<s.length;u++){var d=s[u];for(U=d;U!==null;){var g=U;switch(g.tag){case 0:case 11:case 15:_o(8,g,n)}var m=g.child;if(m!==null)m.return=g,U=m;else for(;U!==null;){g=U;var p=g.sibling,v=g.return;if(Tp(g),g===d){U=null;break}if(p!==null){p.return=v,U=p;break}U=v}}}var L=n.alternate;if(L!==null){var S=L.child;if(S!==null){L.child=null;do{var z=S.sibling;S.sibling=null,S=z}while(S!==null)}}U=n}}if((n.subtreeFlags&2064)!==0&&l!==null)l.return=n,U=l;else e:for(;U!==null;){if(n=U,(n.flags&2048)!==0)switch(n.tag){case 0:case 11:case 15:_o(9,n,n.return)}var c=n.sibling;if(c!==null){c.return=n.return,U=c;break e}U=n.return}}var i=e.current;for(U=i;U!==null;){l=U;var f=l.child;if((l.subtreeFlags&2064)!==0&&f!==null)f.return=l,U=f;else e:for(l=i;U!==null;){if(s=U,(s.flags&2048)!==0)try{switch(s.tag){case 0:case 11:case 15:Zl(9,s)}}catch(C){Re(s,s.return,C)}if(s===l){U=null;break e}var y=s.sibling;if(y!==null){y.return=s.return,U=y;break e}U=s.return}}if(ue=o,Fa(),Kt&&typeof Kt.onPostCommitFiberRoot=="function")try{Kt.onPostCommitFiberRoot(Vl,e)}catch{}r=!0}return r}finally{me=a,Lt.transition=t}}return!1}function Vf(e,t,a){t=eo(a,t),t=xp(e,t,1),e=ba(e,t,1),t=Ze(),e!==null&&(sn(e,1,t),nt(e,t))}function Re(e,t,a){if(e.tag===3)Vf(e,e,a);else for(;t!==null;){if(t.tag===3){Vf(t,e,a);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof r.componentDidCatch=="function"&&(Pa===null||!Pa.has(r))){e=eo(a,e),e=vp(t,e,1),t=ba(t,e,1),e=Ze(),t!==null&&(sn(t,1,e),nt(t,e));break}}t=t.return}}function sx(e,t,a){var r=e.pingCache;r!==null&&r.delete(t),t=Ze(),e.pingedLanes|=e.suspendedLanes&a,Ue===e&&(_e&a)===a&&(Oe===4||Oe===3&&(_e&130023424)===_e&&500>De()-Fi?ar(e,0):Ei|=a),nt(e,t)}function Up(e,t){t===0&&((e.mode&1)===0?t=1:(t=Xn,Xn<<=1,(Xn&130023424)===0&&(Xn=4194304)));var a=Ze();e=sa(e,t),e!==null&&(sn(e,t,a),nt(e,a))}function ux(e){var t=e.memoizedState,a=0;t!==null&&(a=t.retryLane),Up(e,a)}function ix(e,t){var a=0;switch(e.tag){case 13:var r=e.stateNode,o=e.memoizedState;o!==null&&(a=o.retryLane);break;case 19:r=e.stateNode;break;default:throw Error(T(314))}r!==null&&r.delete(t),Up(e,a)}var Np;Np=function(e,t,a){if(e!==null)if(e.memoizedProps!==t.pendingProps||rt.current)at=!0;else{if((e.lanes&a)===0&&(t.flags&128)===0)return at=!1,Qh(e,t,a);at=(e.flags&131072)!==0}else at=!1,we&&(t.flags&1048576)!==0&&Wc(t,Al,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;hl(e,t),e=t.pendingProps;var o=Qr(t,Ge.current);Gr(t,a),o=Pi(null,t,r,e,o,a);var n=Ti();return t.flags|=1,typeof o=="object"&&o!==null&&typeof o.render=="function"&&o.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,ot(r)?(n=!0,Dl(t)):n=!1,t.memoizedState=o.state!==null&&o.state!==void 0?o.state:null,Ii(t),o.updater=Yl,t.stateNode=o,o._reactInternals=t,Uu(t,r,e,a),t=_u(null,t,r,!0,n,a)):(t.tag=0,we&&n&&gi(t),Ye(null,t,o,a),t=t.child),t;case 16:r=t.elementType;e:{switch(hl(e,t),e=t.pendingProps,o=r._init,r=o(r._payload),t.type=r,o=t.tag=fx(r),e=At(r,e),o){case 0:t=Hu(null,t,r,e,a);break e;case 1:t=Ff(null,t,r,e,a);break e;case 11:t=Af(null,t,r,e,a);break e;case 14:t=Ef(null,t,r,At(r.type,e),a);break e}throw Error(T(306,r,""))}return t;case 0:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:At(r,o),Hu(e,t,r,o,a);case 1:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:At(r,o),Ff(e,t,r,o,a);case 3:e:{if(Ip(t),e===null)throw Error(T(387));r=t.pendingProps,n=t.memoizedState,o=n.element,Xc(e,t),Bl(t,r,null,a);var l=t.memoizedState;if(r=l.element,n.isDehydrated)if(n={element:r,isDehydrated:!1,cache:l.cache,pendingSuspenseBoundaries:l.pendingSuspenseBoundaries,transitions:l.transitions},t.updateQueue.baseState=n,t.memoizedState=n,t.flags&256){o=eo(Error(T(423)),t),t=Bf(e,t,r,a,o);break e}else if(r!==o){o=eo(Error(T(424)),t),t=Bf(e,t,r,a,o);break e}else for(it=ka(t.stateNode.containerInfo.firstChild),dt=t,we=!0,Ft=null,a=Gc(t,null,r,a),t.child=a;a;)a.flags=a.flags&-3|4096,a=a.sibling;else{if(Yr(),r===o){t=ua(e,t,a);break e}Ye(e,t,r,a)}t=t.child}return t;case 5:return Qc(t),e===null&&Bu(t),r=t.type,o=t.pendingProps,n=e!==null?e.memoizedProps:null,l=o.children,Du(r,o)?l=null:n!==null&&Du(r,n)&&(t.flags|=32),Sp(e,t),Ye(e,t,l,a),t.child;case 6:return e===null&&Bu(t),null;case 13:return Cp(e,t,a);case 4:return Ci(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=Zr(t,null,r,a):Ye(e,t,r,a),t.child;case 11:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:At(r,o),Af(e,t,r,o,a);case 7:return Ye(e,t,t.pendingProps,a),t.child;case 8:return Ye(e,t,t.pendingProps.children,a),t.child;case 12:return Ye(e,t,t.pendingProps.children,a),t.child;case 10:e:{if(r=t.type._context,o=t.pendingProps,n=t.memoizedProps,l=o.value,ve(El,r._currentValue),r._currentValue=l,n!==null)if(zt(n.value,l)){if(n.children===o.children&&!rt.current){t=ua(e,t,a);break e}}else for(n=t.child,n!==null&&(n.return=t);n!==null;){var s=n.dependencies;if(s!==null){l=n.child;for(var u=s.firstContext;u!==null;){if(u.context===r){if(n.tag===1){u=oa(-1,a&-a),u.tag=2;var d=n.updateQueue;if(d!==null){d=d.shared;var g=d.pending;g===null?u.next=u:(u.next=g.next,g.next=u),d.pending=u}}n.lanes|=a,u=n.alternate,u!==null&&(u.lanes|=a),Ou(n.return,a,t),s.lanes|=a;break}u=u.next}}else if(n.tag===10)l=n.type===t.type?null:n.child;else if(n.tag===18){if(l=n.return,l===null)throw Error(T(341));l.lanes|=a,s=l.alternate,s!==null&&(s.lanes|=a),Ou(l,a,t),l=n.sibling}else l=n.child;if(l!==null)l.return=n;else for(l=n;l!==null;){if(l===t){l=null;break}if(n=l.sibling,n!==null){n.return=l.return,l=n;break}l=l.return}n=l}Ye(e,t,o.children,a),t=t.child}return t;case 9:return o=t.type,r=t.pendingProps.children,Gr(t,a),o=St(o),r=r(o),t.flags|=1,Ye(e,t,r,a),t.child;case 14:return r=t.type,o=At(r,t.pendingProps),o=At(r.type,o),Ef(e,t,r,o,a);case 15:return yp(e,t,t.type,t.pendingProps,a);case 17:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:At(r,o),hl(e,t),t.tag=1,ot(r)?(e=!0,Dl(t)):e=!1,Gr(t,a),hp(t,r,o),Uu(t,r,o,a),_u(null,t,r,!0,e,a);case 19:return wp(e,t,a);case 22:return Lp(e,t,a)}throw Error(T(156,t.tag))};function Hp(e,t){return pc(e,t)}function dx(e,t,a,r){this.tag=e,this.key=a,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function yt(e,t,a,r){return new dx(e,t,a,r)}function Ui(e){return e=e.prototype,!(!e||!e.isReactComponent)}function fx(e){if(typeof e=="function")return Ui(e)?1:0;if(e!=null){if(e=e.$$typeof,e===ri)return 11;if(e===oi)return 14}return 2}function Ra(e,t){var a=e.alternate;return a===null?(a=yt(e.tag,t,e.key,e.mode),a.elementType=e.elementType,a.type=e.type,a.stateNode=e.stateNode,a.alternate=e,e.alternate=a):(a.pendingProps=t,a.type=e.type,a.flags=0,a.subtreeFlags=0,a.deletions=null),a.flags=e.flags&14680064,a.childLanes=e.childLanes,a.lanes=e.lanes,a.child=e.child,a.memoizedProps=e.memoizedProps,a.memoizedState=e.memoizedState,a.updateQueue=e.updateQueue,t=e.dependencies,a.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},a.sibling=e.sibling,a.index=e.index,a.ref=e.ref,a}function yl(e,t,a,r,o,n){var l=2;if(r=e,typeof e=="function")Ui(e)&&(l=1);else if(typeof e=="string")l=5;else e:switch(e){case Ar:return rr(a.children,o,n,t);case ai:l=8,o|=8;break;case uu:return e=yt(12,a,t,o|2),e.elementType=uu,e.lanes=n,e;case iu:return e=yt(13,a,t,o),e.elementType=iu,e.lanes=n,e;case du:return e=yt(19,a,t,o),e.elementType=du,e.lanes=n,e;case Qf:return es(a,o,n,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case jf:l=10;break e;case Xf:l=9;break e;case ri:l=11;break e;case oi:l=14;break e;case ha:l=16,r=null;break e}throw Error(T(130,e==null?e:typeof e,""))}return t=yt(l,a,t,o),t.elementType=e,t.type=r,t.lanes=n,t}function rr(e,t,a,r){return e=yt(7,e,r,t),e.lanes=a,e}function es(e,t,a,r){return e=yt(22,e,r,t),e.elementType=Qf,e.lanes=a,e.stateNode={isHidden:!1},e}function nu(e,t,a){return e=yt(6,e,null,t),e.lanes=a,e}function lu(e,t,a){return t=yt(4,e.children!==null?e.children:[],e.key,t),t.lanes=a,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function cx(e,t,a,r,o){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Ws(0),this.expirationTimes=Ws(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Ws(0),this.identifierPrefix=r,this.onRecoverableError=o,this.mutableSourceEagerHydrationData=null}function Ni(e,t,a,r,o,n,l,s,u){return e=new cx(e,t,a,s,u),t===1?(t=1,n===!0&&(t|=8)):t=0,n=yt(3,null,null,t),e.current=n,n.stateNode=e,n.memoizedState={element:r,isDehydrated:a,cache:null,transitions:null,pendingSuspenseBoundaries:null},Ii(n),e}function px(e,t,a){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:Mr,key:r==null?null:""+r,children:e,containerInfo:t,implementation:a}}function _p(e){if(!e)return Ma;e=e._reactInternals;e:{if(dr(e)!==e||e.tag!==1)throw Error(T(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if(ot(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(t!==null);throw Error(T(171))}if(e.tag===1){var a=e.type;if(ot(a))return _c(e,a,t)}return t}function qp(e,t,a,r,o,n,l,s,u){return e=Ni(a,r,!0,e,o,n,l,s,u),e.context=_p(null),a=e.current,r=Ze(),o=Ta(a),n=oa(r,o),n.callback=t??null,ba(a,n,o),e.current.lanes=o,sn(e,o,r),nt(e,r),e}function ts(e,t,a,r){var o=t.current,n=Ze(),l=Ta(o);return a=_p(a),t.context===null?t.context=a:t.pendingContext=a,t=oa(n,l),t.payload={element:e},r=r===void 0?null:r,r!==null&&(t.callback=r),e=ba(o,t,l),e!==null&&(Ot(e,o,l,n),pl(e,o,l)),l}function Wl(e){if(e=e.current,!e.child)return null;switch(e.child.tag){case 5:return e.child.stateNode;default:return e.child.stateNode}}function $f(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var a=e.retryLane;e.retryLane=a!==0&&a<t?a:t}}function Hi(e,t){$f(e,t),(e=e.alternate)&&$f(e,t)}function mx(){return null}var Wp=typeof reportError=="function"?reportError:function(e){console.error(e)};function _i(e){this._internalRoot=e}as.prototype.render=_i.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(T(409));ts(e,t,null,null)};as.prototype.unmount=_i.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;ur(function(){ts(null,e,null,null)}),t[la]=null}};function as(e){this._internalRoot=e}as.prototype.unstable_scheduleHydration=function(e){if(e){var t=Lc();e={blockedOn:null,target:e,priority:t};for(var a=0;a<va.length&&t!==0&&t<va[a].priority;a++);va.splice(a,0,e),a===0&&Ic(e)}};function qi(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function rs(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function Kf(){}function gx(e,t,a,r,o){if(o){if(typeof r=="function"){var n=r;r=function(){var d=Wl(l);n.call(d)}}var l=qp(t,r,e,0,null,!1,!1,"",Kf);return e._reactRootContainer=l,e[la]=l.current,Zo(e.nodeType===8?e.parentNode:e),ur(),l}for(;o=e.lastChild;)e.removeChild(o);if(typeof r=="function"){var s=r;r=function(){var d=Wl(u);s.call(d)}}var u=Ni(e,0,!1,null,null,!1,!1,"",Kf);return e._reactRootContainer=u,e[la]=u.current,Zo(e.nodeType===8?e.parentNode:e),ur(function(){ts(t,u,a,r)}),u}function os(e,t,a,r,o){var n=a._reactRootContainer;if(n){var l=n;if(typeof o=="function"){var s=o;o=function(){var u=Wl(l);s.call(u)}}ts(t,l,e,o)}else l=gx(a,t,e,o,r);return Wl(l)}vc=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var a=Eo(t.pendingLanes);a!==0&&(si(t,a|1),nt(t,De()),(ue&6)===0&&(to=De()+500,Fa()))}break;case 13:ur(function(){var r=sa(e,1);if(r!==null){var o=Ze();Ot(r,e,1,o)}}),Hi(e,1)}};ui=function(e){if(e.tag===13){var t=sa(e,134217728);if(t!==null){var a=Ze();Ot(t,e,134217728,a)}Hi(e,134217728)}};yc=function(e){if(e.tag===13){var t=Ta(e),a=sa(e,t);if(a!==null){var r=Ze();Ot(a,e,t,r)}Hi(e,t)}};Lc=function(){return me};Sc=function(e,t){var a=me;try{return me=e,t()}finally{me=a}};Lu=function(e,t,a){switch(t){case"input":if(pu(e,a),t=a.name,a.type==="radio"&&t!=null){for(a=e;a.parentNode;)a=a.parentNode;for(a=a.querySelectorAll("input[name="+JSON.stringify(""+t)+\'][type="radio"]\'),t=0;t<a.length;t++){var r=a[t];if(r!==e&&r.form===e.form){var o=jl(r);if(!o)throw Error(T(90));Zf(r),pu(r,o)}}}break;case"textarea":ec(e,a);break;case"select":t=a.value,t!=null&&Wr(e,!!a.multiple,t,!1)}};sc=Bi;uc=ur;var hx={usingClientEntryPoint:!1,Events:[dn,Or,jl,nc,lc,Bi]},Ro={findFiberByHostInstance:Ja,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},xx={bundleType:Ro.bundleType,version:Ro.version,rendererPackageName:Ro.rendererPackageName,rendererConfig:Ro.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:ia.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=fc(e),e===null?null:e.stateNode},findFiberByHostInstance:Ro.findFiberByHostInstance||mx,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1-next-f1338f8080-20240426"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&(Do=__REACT_DEVTOOLS_GLOBAL_HOOK__,!Do.isDisabled&&Do.supportsFiber))try{Vl=Do.inject(xx),Kt=Do}catch{}var Do;pt.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=hx;pt.createPortal=function(e,t){var a=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!qi(t))throw Error(T(200));return px(e,t,null,a)};pt.createRoot=function(e,t){if(!qi(e))throw Error(T(299));var a=!1,r="",o=Wp;return t!=null&&(t.unstable_strictMode===!0&&(a=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onRecoverableError!==void 0&&(o=t.onRecoverableError)),t=Ni(e,1,!1,null,null,a,!1,r,o),e[la]=t.current,Zo(e.nodeType===8?e.parentNode:e),new _i(t)};pt.findDOMNode=function(e){if(e==null)return null;if(e.nodeType===1)return e;var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(T(188)):(e=Object.keys(e).join(","),Error(T(268,e)));return e=fc(t),e=e===null?null:e.stateNode,e};pt.flushSync=function(e){return ur(e)};pt.hydrate=function(e,t,a){if(!rs(t))throw Error(T(200));return os(null,e,t,!0,a)};pt.hydrateRoot=function(e,t,a){if(!qi(e))throw Error(T(405));var r=a!=null&&a.hydratedSources||null,o=!1,n="",l=Wp;if(a!=null&&(a.unstable_strictMode===!0&&(o=!0),a.identifierPrefix!==void 0&&(n=a.identifierPrefix),a.onRecoverableError!==void 0&&(l=a.onRecoverableError)),t=qp(t,null,e,1,a??null,o,!1,n,l),e[la]=t.current,Zo(e),r)for(e=0;e<r.length;e++)a=r[e],o=a._getVersion,o=o(a._source),t.mutableSourceEagerHydrationData==null?t.mutableSourceEagerHydrationData=[a,o]:t.mutableSourceEagerHydrationData.push(a,o);return new as(t)};pt.render=function(e,t,a){if(!rs(t))throw Error(T(200));return os(null,e,t,!1,a)};pt.unmountComponentAtNode=function(e){if(!rs(e))throw Error(T(40));return e._reactRootContainer?(ur(function(){os(null,null,e,!1,function(){e._reactRootContainer=null,e[la]=null})}),!0):!1};pt.unstable_batchedUpdates=Bi;pt.unstable_renderSubtreeIntoContainer=function(e,t,a,r){if(!rs(a))throw Error(T(200));if(e==null||e._reactInternals===void 0)throw Error(T(38));return os(e,t,a,!1,r)};pt.version="18.3.1-next-f1338f8080-20240426"});var oo=Jt((Iv,Kp)=>{"use strict";function $p(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE($p)}catch(e){console.error(e)}}$p(),Kp.exports=Vp()});var jp=Jt(Wi=>{"use strict";var Gp=oo();Wi.createRoot=Gp.createRoot,Wi.hydrateRoot=Gp.hydrateRoot;var Cv});var em=Jt(fs=>{"use strict";var Sx=Ce(),Ix=Symbol.for("react.element"),Cx=Symbol.for("react.fragment"),wx=Object.prototype.hasOwnProperty,kx=Sx.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,bx={key:!0,ref:!0,__self:!0,__source:!0};function Jp(e,t,a){var r,o={},n=null,l=null;a!==void 0&&(n=""+a),t.key!==void 0&&(n=""+t.key),t.ref!==void 0&&(l=t.ref);for(r in t)wx.call(t,r)&&!bx.hasOwnProperty(r)&&(o[r]=t[r]);if(e&&e.defaultProps)for(r in t=e.defaultProps,t)o[r]===void 0&&(o[r]=t[r]);return{$$typeof:Ix,type:e,key:n,ref:l,props:o,_owner:kx.current}}fs.Fragment=Cx;fs.jsx=Jp;fs.jsxs=Jp});var q=Jt((Qy,tm)=>{"use strict";tm.exports=em()});var Em=A(jp(),1);var re=A(Ce(),1),Rm=A(oo(),1);function Xp(e){return e.trim().replace(/^\\|/,"").replace(/\\|$/,"").split("|").map(a=>a.trim())}function vx(e){return/^\\s*\\|?\\s*:?-{3,}:?\\s*(\\|\\s*:?-{3,}:?\\s*)+\\|?\\s*$/.test(e)}function yx(e){let t=e.split(`\n`),a=[],r=0;for(;r<t.length;){let o=t[r]??"",n=t[r+1]??"";if(o.includes("|")&&vx(n)){let l=Xp(o),s=[];for(r+=2;r<t.length&&t[r].includes("|")&&t[r].trim()!=="";)s.push(Xp(t[r])),r+=1;let u=`<tr>${l.map(g=>`<th style="text-align:left;padding:7px 10px;border:1px solid #334155;color:#e2e8f0;background:#0f172a;">${g}</th>`).join("")}</tr>`,d=s.map(g=>`<tr>${g.map(m=>`<td style="padding:7px 10px;border:1px solid #334155;color:#cbd5e1;vertical-align:top;">${m}</td>`).join("")}</tr>`).join("");a.push(`<div style="overflow-x:auto;margin:0.65em 0;"><table style="border-collapse:collapse;min-width:360px;width:100%;font-size:12px;"><thead>${u}</thead><tbody>${d}</tbody></table></div>`);continue}a.push(t[r]),r+=1}return a.join(`\n`)}function ns(e){if(!e)return\'<span style="color:#475569;font-style:italic;">No description yet</span>\';let t=e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""");return yx(t).replace(/^### (.+)$/gm,\'<h3 style="font-weight:700;margin:0.8em 0 0.3em;font-size:1.05em;color:#cbd5e1;">$1</h3>\').replace(/^## (.+)$/gm,\'<h2 style="font-weight:700;margin:0.8em 0 0.3em;font-size:1.2em;color:#f1f5f9;">$1</h2>\').replace(/^# (.+)$/gm,\'<h1 style="font-weight:700;margin:0.8em 0 0.3em;font-size:1.4em;color:#f1f5f9;">$1</h1>\').replace(/[*][*]([^\\n]+?)[*][*]/g,\'<strong style="font-weight:700;color:#f1f5f9;">$1</strong>\').replace(/__([^\\n]+?)__/g,\'<strong style="font-weight:700;color:#f1f5f9;">$1</strong>\').replace(/[*]([^\\n*]+?)[*]/g,\'<em style="font-style:italic;color:#94a3b8;">$1</em>\').replace(/(?<![a-zA-Z0-9])_([^_\\n]+?)_(?![a-zA-Z0-9])/g,\'<em style="font-style:italic;color:#94a3b8;">$1</em>\').replace(/`(.+?)`/g,\'<code style="font-family:Menlo,monospace;font-size:12px;background:#1e293b;padding:1px 5px;border-radius:3px;color:#7dd3fc;">$1</code>\').replace(/\\[([^\\]]+)\\]\\((https?:\\/\\/[^)]+)\\)/g,\'<a href="$2" target="_blank" rel="noopener noreferrer" style="color:#60a5fa;text-decoration:underline;">$1</a>\').replace(/(^|[\\s(>])((https?:\\/\\/)[^\\s<>"\']+)/g,\'$1<a href="$2" target="_blank" rel="noopener noreferrer" style="color:#60a5fa;text-decoration:underline;word-break:break-all;">$2</a>\').replace(/(^|[^\\w])#([a-f0-9]{30})(?![a-f0-9])/gi,\'$1<a href="#task-$2" data-task-ref="$2" style="color:#60a5fa;text-decoration:underline;font-family:Menlo,monospace;">#$2</a>\').replace(/^[-*] (.+)$/gm,\'<li style="margin:0.2em 0;display:list-item;">$1</li>\').replace(/^---$/gm,\'<hr style="border:none;border-top:1px solid #334155;margin:0.8em 0;">\').replace(/(<li[^>]*>[\\s\\S]*?<\\/li>\\n?)+/g,r=>`<ul style="padding-left:1.5em;margin:0.4em 0;list-style-type:disc;">${r}</ul>`).replace(/^(?!<[a-z]|$).+$/gm,r=>`<p style="margin:0.5em 0;">${r}</p>`)}var Lx="proto-comments-seen";function Vi(e,t){try{let a=localStorage.getItem(Lx),r=a?JSON.parse(a):{};return t>(r[e]??0)}catch{return!1}}function $i(e){return e<1024?`${e} B`:e<1048576?`${(e/1024).toFixed(1)} KB`:`${(e/1048576).toFixed(1)} MB`}function lt(e){try{return new Date(e).toLocaleString()}catch{return e}}var Ki=16,no=1000000n,us=BigInt("9".repeat(Ki));function Ct(e){return(e<0n?0n:e>us?us:e).toString().padStart(Ki,"0")}function ls(e){let t=e.split(".")[0];return/^\\d+$/.test(t)?BigInt(t):us}function ss(e){let t=e.indexOf(".");return t>=0?e.slice(t+1):null}function fr(e,t){if(t===null){if(e===null)return Ct(no);let l=ls(e);if(l<us-no)return Ct(l+no);let s=ss(e)??"0".repeat(Ki);return Ct(l)+"."+fr(s,null)}if(e===null){let l=ls(t),s=ss(t);return l>no?Ct(l-no):s!==null?Ct(l)+"."+fr(null,s):l>0n?Ct(l/2n):Ct(0n)+".0"}let a=ls(e),r=ls(t),o=ss(e),n=ss(t);return r>a+1n?Ct((a+r)/2n):r===a+1n?Ct(a)+"."+fr(o,null):o===null&&n===null?Ct(a)+"."+Ct(no):Ct(a)+"."+fr(o,n)}function cn(e,t){return e.sortKey&&t.sortKey?e.sortKey<t.sortKey?-1:e.sortKey>t.sortKey?1:0:e.sortKey?-1:t.sortKey?1:(t.updatedAt??t.createdAt??"").localeCompare(e.updatedAt??e.createdAt??"")}function Gi(e,t,a,r){let o=new Map,n=null;for(let m of e)m.sortKey&&m.sortKey!=="n"&&(o.set(m.id,m.sortKey),n=m.sortKey);let l=[],s=e.filter(m=>!m.sortKey||m.sortKey==="n");if(s.length>0){let m=n;for(let p of s){let v=fr(m,null);o.set(p.id,v),m=v,p.id!==t&&l.push({id:p.id,sortKey:v})}}let u=a?o.get(a)??null:null,d=r?o.get(r)??null:null;return{newSortKey:fr(u,d),normalizationPatches:l}}var jt=A(Ce(),1);var ds=A(Ce());var Qp=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),is=(...e)=>e.filter((t,a,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===a).join(" ").trim();var pn=A(Ce());var Yp={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"};var Zp=(0,pn.forwardRef)(({color:e="currentColor",size:t=24,strokeWidth:a=2,absoluteStrokeWidth:r,className:o="",children:n,iconNode:l,...s},u)=>(0,pn.createElement)("svg",{ref:u,...Yp,width:t,height:t,stroke:e,strokeWidth:r?Number(a)*24/Number(t):a,className:is("lucide",o),...s},[...l.map(([d,g])=>(0,pn.createElement)(d,g)),...Array.isArray(n)?n:[n]]));var J=(e,t)=>{let a=(0,ds.forwardRef)(({className:r,...o},n)=>(0,ds.createElement)(Zp,{ref:n,iconNode:t,className:is(`lucide-${Qp(e)}`,r),...o}));return a.displayName=`${e}`,a};var cr=J("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);var mn=J("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);var Ba=J("CircleCheckBig",[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]]);var pr=J("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"}]]);var gn=J("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"}]]);var lo=J("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"}]]);var hn=J("Flag",[["path",{d:"M4 15s1-1 4-1 5 2 8 2 4-1 4-1V3s-1 1-4 1-5-2-8-2-4 1-4 1z",key:"i9b6wo"}],["line",{x1:"4",x2:"4",y1:"22",y2:"15",key:"1cm3nv"}]]);var xn=J("LayoutDashboard",[["rect",{width:"7",height:"9",x:"3",y:"3",rx:"1",key:"10lvy0"}],["rect",{width:"7",height:"5",x:"14",y:"3",rx:"1",key:"16une8"}],["rect",{width:"7",height:"9",x:"14",y:"12",rx:"1",key:"1hutg5"}],["rect",{width:"7",height:"5",x:"3",y:"16",rx:"1",key:"ldoo1y"}]]);var vn=J("List",[["path",{d:"M3 12h.01",key:"nlz23k"}],["path",{d:"M3 18h.01",key:"1tta3j"}],["path",{d:"M3 6h.01",key:"1rqtza"}],["path",{d:"M8 12h13",key:"1za7za"}],["path",{d:"M8 18h13",key:"1lx6n3"}],["path",{d:"M8 6h13",key:"ik3vkj"}]]);var yn=J("Lock",[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4",key:"fwvmzm"}]]);var mr=J("MessageCircle",[["path",{d:"M7.9 20A9 9 0 1 0 4 16.1L2 22Z",key:"vv11sd"}]]);var Oa=J("PanelsTopLeft",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M3 9h18",key:"1pudct"}],["path",{d:"M9 21V9",key:"1oto5p"}]]);var gr=J("Paperclip",[["path",{d:"M13.234 20.252 21 12.3",key:"1cbrk9"}],["path",{d:"m16 6-8.414 8.586a2 2 0 0 0 0 2.828 2 2 0 0 0 2.828 0l8.414-8.586a4 4 0 0 0 0-5.656 4 4 0 0 0-5.656 0l-8.415 8.585a6 6 0 1 0 8.486 8.486",key:"1pkts6"}]]);var Ln=J("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);var Sn=J("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);var hr=J("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"}]]);var so=J("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"}]]);var za=J("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"}]]);var uo=J("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"}]]);var In=J("User",[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]]);var Cn=J("Workflow",[["rect",{width:"8",height:"8",x:"3",y:"3",rx:"2",key:"by2w9f"}],["path",{d:"M7 11v4a2 2 0 0 0 2 2h4",key:"xkn7yn"}],["rect",{width:"8",height:"8",x:"13",y:"13",rx:"2",key:"1cgmvn"}]]);var Ne=J("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);var io=A(Ce(),1),cm=A(oo(),1);var om=A(q(),1),am={Bug:{background:"rgba(239,68,68,0.12)",color:"#f87171",border:"rgba(239,68,68,0.25)"},Research:{background:"rgba(192,132,252,0.12)",color:"#c084fc",border:"rgba(139,92,246,0.2)"},Task:{background:"rgba(148,163,184,0.1)",color:"#94a3b8",border:"rgba(148,163,184,0.2)"}};function rm({type:e,style:t}){let a=typeof e=="string"&&e.trim()&&e!=="[object Object]"&&am[e]?e:"Task",r=am[a];return(0,om.jsx)("span",{style:{fontSize:9,fontWeight:700,letterSpacing:"0.04em",padding:"1px 5px",borderRadius:3,flexShrink:0,textTransform:"uppercase",background:r.background,color:r.color,border:`1px solid ${r.border}`,lineHeight:"1.5",...t},children:a})}var sm=A(q(),1),nm={Critical:{background:"rgba(239,68,68,0.15)",color:"#f87171",border:"rgba(239,68,68,0.3)"},High:{background:"rgba(249,115,22,0.12)",color:"#fb923c",border:"rgba(249,115,22,0.25)"},Medium:{background:"rgba(234,179,8,0.12)",color:"#facc15",border:"rgba(234,179,8,0.25)"},Low:{background:"rgba(148,163,184,0.1)",color:"#94a3b8",border:"rgba(148,163,184,0.2)"}};function lm({priority:e,style:t}){if(!e||!nm[e])return null;let a=nm[e];return(0,sm.jsx)("span",{style:{fontSize:9,fontWeight:700,letterSpacing:"0.04em",padding:"1px 5px",borderRadius:3,flexShrink:0,textTransform:"uppercase",background:a.background,color:a.color,border:`1px solid ${a.border}`,lineHeight:"1.5",...t},children:e})}var xr=[{value:"Task",icon:"\\u2611",label:"Task",css:"type-task",tooltip:"A general task or feature to implement."},{value:"Bug",icon:"\\u{1F41E}",label:"Bug",css:"type-bug",tooltip:"A defect \\u2014 annotator collects page errors and console logs to help reproduce it."},{value:"Research",icon:"\\u{1F52C}",label:"Research",css:"type-research",tooltip:"A research task \\u2014 agent will NOT write code but must attach a findings report."}],Jy=xr.map(e=>e.value),im=Object.fromEntries(xr.map(e=>[e.value,e.icon])),eL=Object.fromEntries(xr.map(e=>[e.value,e.css])),um={Task:"#94a3b8",Bug:"#ef4444",Research:"#a855f7"};function wn(e){return um[e??"Task"]??um.Task}var dm=[{bg:"color-mix(in srgb, var(--p-blue) 14%, transparent)",text:"var(--p-blue-200)",border:"color-mix(in srgb, var(--p-blue) 30%, transparent)"},{bg:"color-mix(in srgb, var(--p-green) 14%, transparent)",text:"var(--p-green-300)",border:"color-mix(in srgb, var(--p-green) 30%, transparent)"},{bg:"color-mix(in srgb, var(--p-purple) 14%, transparent)",text:"var(--p-purple-300)",border:"color-mix(in srgb, var(--p-purple) 30%, transparent)"},{bg:"color-mix(in srgb, var(--p-amber) 14%, transparent)",text:"var(--p-amber-300)",border:"color-mix(in srgb, var(--p-amber) 30%, transparent)"},{bg:"color-mix(in srgb, #f472b6 14%, transparent)",text:"#f9a8d4",border:"color-mix(in srgb, #f472b6 30%, transparent)"},{bg:"color-mix(in srgb, var(--p-cyan) 14%, transparent)",text:"var(--p-cyan-300)",border:"color-mix(in srgb, var(--p-cyan) 30%, transparent)"},{bg:"color-mix(in srgb, #f87171 14%, transparent)",text:"#fca5a5",border:"color-mix(in srgb, #f87171 30%, transparent)"},{bg:"color-mix(in srgb, var(--p-text-g) 14%, transparent)",text:"var(--p-text-m)",border:"color-mix(in srgb, var(--p-text-g) 30%, transparent)"}];function Px(e){let t=0;for(let a=0;a<e.length;a++)t=t*31+e.charCodeAt(a)>>>0;return t%dm.length}function Ut(e){return dm[Px(e)]}var kn=A(q(),1);function bn({tags:e,onRemove:t,size:a="sm"}){if(!e.length)return null;let r=a==="xs"?"1px 6px":"2px 7px",o=a==="xs"?9:10;return(0,kn.jsx)("div",{style:{display:"flex",flexWrap:"wrap",gap:3,alignItems:"center"},children:e.map(n=>{let{bg:l,text:s,border:u}=Ut(n);return(0,kn.jsxs)("span",{style:{display:"inline-flex",alignItems:"center",gap:3,padding:r,borderRadius:100,background:l,border:`1px solid ${u}`,color:s,fontSize:o,fontWeight:600,whiteSpace:"nowrap"},children:[n,t&&(0,kn.jsx)("button",{type:"button",onClick:d=>{d.stopPropagation(),t(n)},style:{display:"flex",background:"none",border:"none",color:s,cursor:"pointer",padding:0,lineHeight:1,opacity:.7},onMouseEnter:d=>{d.currentTarget.style.opacity="1"},onMouseLeave:d=>{d.currentTarget.style.opacity="0.7"},children:"\\xD7"})]},n)})})}var ie=A(q(),1);function Tx(e){return/\\.(png|jpe?g|gif|webp|svg|avif)$/i.test(e)}function pm(e,t){if(!/^#[0-9a-fA-F]{6}$/.test(e))return;let a=Math.max(0,Math.min(1,t)),r=Math.round(a*255).toString(16).padStart(2,"0");return`${e}${r}`}function mm(e,t){return pm(e,t==="Critical"?.36:t==="High"?.3:.24)??"color-mix(in srgb, var(--p-text-g) 40%, transparent)"}function Rx(e){return pm(e,.05)??"transparent"}var Dx={padding:"7px 8px",gap:4,opacity:.45,userSelect:"none"},Mx={display:"flex",alignItems:"center",gap:5},Ax={width:12,height:12,color:"color-mix(in srgb, var(--p-green) 55%, transparent)",flexShrink:0},Ex={fontSize:11.5,fontWeight:600,color:"var(--p-text-g)",textDecoration:"line-through",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",flex:1},Fx={display:"flex",alignItems:"center",gap:5,minWidth:0},Bx={flexShrink:0},Ox={fontSize:11.5,fontWeight:600,color:"var(--p-text)",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",flex:1},zx={display:"flex",alignItems:"flex-start",gap:8},Ux={fontSize:10,color:"var(--p-text-g)",lineHeight:"1.45",overflow:"hidden",display:"-webkit-box",WebkitBoxOrient:"vertical",WebkitLineClamp:2,flex:1,minWidth:0},Nx={position:"relative",flexShrink:0},Hx={width:52,height:34,borderRadius:6,objectFit:"cover",border:"1px solid color-mix(in srgb, var(--p-border) 90%, transparent)",display:"block",cursor:"pointer"},_x={display:"flex",alignItems:"center",gap:2,marginTop:1},qx={flex:1},ji=io.default.memo(function({task:t,col:a,liveActivity:r,onOpen:o,onDragStart:n}){var h;let l=a.id==="in-progress",s=a.id==="done",[u,d]=io.default.useState(!1),[g,m]=io.default.useState(null),p=io.default.useRef(null),v=t.commentCount??0,L=t.fileCount??0,S=v>0&&Vi(t.id,v),z=mm(a.color,t.priority),c=wn(t.type),i=Rx(c),f=(h=t.files)==null?void 0:h.find(w=>Tx(w.name)),y=f?`/api/tasks/${t.id}/files/${encodeURIComponent(f.name)}`:null;function C(w){n(w,t.id),w.currentTarget.classList.add("dragging")}function k(w){w.currentTarget.classList.remove("dragging")}return s?(0,ie.jsx)("article",{className:"task-card",draggable:!0,"data-task-id":t.id,style:Dx,onDragStart:C,onDragEnd:k,onClick:()=>o(t),children:(0,ie.jsxs)("div",{style:Mx,children:[(0,ie.jsx)(Ba,{style:Ax}),(0,ie.jsx)("span",{style:Ex,children:t.title})]})}):(0,ie.jsxs)("article",{className:`task-card${r?" task-live-edit":""}`,draggable:!0,"data-task-id":t.id,style:{padding:"7px 8px",gap:4,userSelect:"none",background:r?"rgba(59,130,246,0.08)":i,...r?{borderColor:"rgba(59,130,246,0.5)",boxShadow:"0 0 0 2px rgba(59,130,246,0.14)"}:z?{borderColor:z}:{}},onDragStart:C,onDragEnd:k,onClick:()=>o(t),children:[(0,ie.jsxs)("div",{style:Fx,children:[l&&(0,ie.jsx)("span",{className:"spinner",style:Bx}),(0,ie.jsx)("span",{style:Ox,children:t.title})]}),(t.description||y)&&(0,ie.jsxs)("div",{style:zx,children:[t.description&&(0,ie.jsx)("div",{style:Ux,children:t.description}),y&&(0,ie.jsxs)("div",{style:Nx,onMouseEnter:()=>{if(p.current){let w=p.current.getBoundingClientRect();m({top:w.top,right:w.right})}d(!0)},onMouseLeave:()=>{d(!1),m(null)},children:[(0,ie.jsx)("img",{ref:p,src:y,alt:"Task screenshot","data-role":"task-thumb",style:Hx}),u&&g&&cm.default.createPortal((0,ie.jsx)("img",{src:y,alt:"Task screenshot enlarged preview","data-role":"task-thumb-preview",style:{position:"fixed",right:window.innerWidth-g.right,bottom:window.innerHeight-g.top+8,width:220,height:138,borderRadius:8,objectFit:"cover",border:"1px solid color-mix(in srgb, var(--p-border) 96%, transparent)",boxShadow:"0 10px 24px color-mix(in srgb, var(--p-bg) 75%, transparent)",pointerEvents:"none",zIndex:9999,background:"var(--p-bg)"}}),document.body)]})]}),(0,ie.jsxs)("div",{className:"flex items-center",style:_x,children:[(0,ie.jsx)(rm,{type:t.type}),t.priority&&(0,ie.jsx)(lm,{priority:t.priority}),l&&t.assigneeName&&(0,ie.jsx)("span",{style:{fontSize:10,fontWeight:600,padding:"1px 6px",borderRadius:6,background:"rgba(59,130,246,0.12)",color:"#60a5fa",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",maxWidth:80},children:t.assigneeName}),t.tags&&t.tags.length>0&&(0,ie.jsx)(bn,{tags:t.tags,size:"xs"}),(0,ie.jsx)("div",{style:qx}),r&&(0,ie.jsx)(Xi,{activity:r}),(0,ie.jsx)(fm,{icon:(0,ie.jsx)(mr,{style:{width:9,height:9}}),label:v>0?String(v):"",color:S?"var(--p-purple)":v>0?"var(--p-text-m)":"var(--p-border-t)",hoverColor:S?"var(--p-purple-300)":"var(--p-text)",title:v>0?`${v} comment(s)`:"Add comment",badge:S,badgeColor:"var(--p-purple)",onClick:w=>{w.stopPropagation(),o(t,"comments")}}),(0,ie.jsx)(fm,{icon:(0,ie.jsx)(gr,{style:{width:9,height:9}}),label:L>0?String(L):"",color:L>0?"var(--p-blue-300)":"var(--p-border-t)",hoverColor:L>0?"var(--p-cyan-300)":"var(--p-text-sub)",title:L>0?`${L} file(s) attached`:"Files",onClick:w=>{w.stopPropagation(),o(t,"files")}})]})]})});function fm({icon:e,label:t,color:a,hoverColor:r,title:o,badge:n,badgeColor:l,onClick:s}){let[u,d]=io.default.useState(!1);return(0,ie.jsxs)("button",{style:{display:"inline-flex",alignItems:"center",gap:2,padding:"2px 3px",borderRadius:3,border:"none",background:u?"color-mix(in srgb, var(--p-text-m) 10%, transparent)":"transparent",cursor:"pointer",fontSize:9,color:u?r:a,transition:"color .1s, background .1s"},title:o,onMouseEnter:()=>d(!0),onMouseLeave:()=>d(!1),onClick:s,children:[e,t&&(0,ie.jsx)("span",{children:t}),n&&(0,ie.jsx)("span",{style:{width:4,height:4,background:l??a,borderRadius:"50%",flexShrink:0}})]})}function Xi({activity:e}){let t=e.state==="locked"||e.state==="editing",a=t?(0,ie.jsx)(yn,{style:{width:8,height:8}}):(0,ie.jsx)(gn,{style:{width:8,height:8}}),r=t?`Locked by ${e.user}`:`${e.user} viewing`;return(0,ie.jsxs)("span",{style:t?{display:"inline-flex",alignItems:"center",gap:3,borderRadius:999,padding:"1px 5px",fontSize:9,fontWeight:600,border:"1px solid rgba(244,114,182,0.35)",color:"#f9a8d4",background:"rgba(157,23,77,0.28)",flexShrink:0,maxWidth:110,overflow:"hidden",whiteSpace:"nowrap",flexWrap:"nowrap"}:{display:"inline-flex",alignItems:"center",gap:3,borderRadius:999,padding:"1px 5px",fontSize:9,fontWeight:600,border:"1px solid rgba(59,130,246,0.35)",color:"#93c5fd",background:"rgba(30,58,138,0.28)",flexShrink:0,maxWidth:110,overflow:"hidden",whiteSpace:"nowrap",flexWrap:"nowrap"},title:r,"data-testid":"live-activity-badge",children:[a,(0,ie.jsx)("span",{style:{overflow:"hidden",textOverflow:"ellipsis",minWidth:0,flex:"1 1 0"},children:e.user})]})}var de=A(q(),1),Ua=[{id:"backlog",label:"Backlog",color:"var(--p-text-f)",accent:"color-mix(in srgb, var(--p-text-g) 20%, transparent)"},{id:"todo",label:"Todo",color:"var(--p-amber)",accent:"color-mix(in srgb, var(--p-amber) 12%, transparent)"},{id:"in-progress",label:"In Progress",color:"var(--p-blue)",accent:"color-mix(in srgb, var(--p-blue) 12%, transparent)",glow:!0},{id:"review",label:"Review",color:"var(--p-purple)",accent:"color-mix(in srgb, var(--p-purple) 12%, transparent)"},{id:"done",label:"Done",color:"var(--p-green)",accent:"color-mix(in srgb, var(--p-green) 10%, transparent)"}];var Wx=3;function Vx(){return(0,de.jsxs)("div",{style:{borderRadius:8,border:"1px solid var(--p-border-t)",padding:"10px 12px",background:"var(--p-bg-2)",marginBottom:6,animation:"skeleton-pulse 1.5s ease-in-out infinite"},children:[(0,de.jsx)("div",{style:{height:12,borderRadius:4,background:"var(--p-border-s)",width:"75%",marginBottom:8}}),(0,de.jsx)("div",{style:{height:10,borderRadius:4,background:"var(--p-border-s)",width:"50%",marginBottom:8}}),(0,de.jsxs)("div",{style:{display:"flex",gap:6},children:[(0,de.jsx)("div",{style:{height:18,borderRadius:10,background:"var(--p-border-s)",width:48}}),(0,de.jsx)("div",{style:{height:18,borderRadius:10,background:"var(--p-border-s)",width:36}})]})]})}function Qi({tasks:e,visibleCols:t,searchQuery:a,isLoading:r,liveActivities:o,onOpenPanel:n,onDrop:l,onReorder:s}){let u=jt.default.useRef(null),d=jt.default.useRef(null),[g,m]=jt.default.useState(null),[p,v]=jt.default.useState(null),[L,S]=jt.default.useState(null),z=jt.default.useRef(null),c=jt.default.useRef(null),i=a?e.filter(b=>(b.title??"").toLowerCase().includes(a.toLowerCase())||(b.description??"").toLowerCase().includes(a.toLowerCase())):e,f=Ua.filter(b=>t.includes(b.id));jt.default.useEffect(()=>{let b=u.current,M=d.current;if(!b||!M)return;function R(){if(!b||!M)return;let te=b.scrollWidth>b.clientWidth?b.clientWidth/b.scrollWidth:1,W=Math.max(40,b.clientWidth*te);M.style.width=`${W}px`;let ce=b.scrollWidth-b.clientWidth,je=b.clientWidth-W;M.style.left=`${ce>0?b.scrollLeft/ce*je:0}px`,M.style.opacity=te<1?"1":"0"}b.addEventListener("scroll",R);let F=new ResizeObserver(R);F.observe(b),R();let ee=!1,G=0,Ie=0;function _(te){ee=!0,G=te.clientX,Ie=b.scrollLeft,M.classList.add("dragging"),document.addEventListener("mousemove",N),document.addEventListener("mouseup",Z)}function N(te){if(!ee||!b||!M)return;let W=b.scrollWidth>b.clientWidth?b.scrollWidth/b.clientWidth:1;b.scrollLeft=Ie+(te.clientX-G)*W}function Z(){ee=!1,M==null||M.classList.remove("dragging"),document.removeEventListener("mousemove",N),document.removeEventListener("mouseup",Z)}return M.addEventListener("mousedown",_),()=>{b.removeEventListener("scroll",R),F.disconnect(),M.removeEventListener("mousedown",_)}},[f.length]);function y(b,M){z.current=M,m(M),b.dataTransfer.effectAllowed="move"}function C(b,M){b.preventDefault(),v(M)}function k(b,M){b.preventDefault(),b.stopPropagation();let R=b.currentTarget.getBoundingClientRect(),F=b.clientY<R.top+R.height/2?"before":"after",ee={taskId:M,position:F};c.current=ee,S(G=>(G==null?void 0:G.taskId)===M&&G.position===F?G:ee)}function h(b,M,R){b.preventDefault(),v(null);let F=c.current;c.current=null,S(null);let ee=z.current;if(z.current=null,m(null),!!ee)if(s&&F){let G=R.findIndex(N=>N.id===F.taskId),Ie=null,_=null;F.position==="before"?(_=F.taskId,Ie=G>0?R[G-1].id:null):(Ie=F.taskId,_=G<R.length-1?R[G+1].id:null),s(ee,M,Ie,_)}else l(ee,M)}function w(){z.current=null,m(null),v(null),c.current=null,S(null)}return(0,de.jsxs)(de.Fragment,{children:[(0,de.jsx)("main",{id:"kanban-board",ref:u,className:"flex-1 flex overflow-x-auto overflow-y-hidden",style:{padding:"16px 20px",gap:16},onDragEnd:w,children:f.map(b=>{let M=r?[]:i.filter(R=>R.status===b.id).sort(cn);return(0,de.jsx)($x,{col:b,tasks:M,isLoading:r,liveActivities:o,isDragOver:p===b.id&&!L,onDragOver:R=>C(R,b.id),onDrop:R=>h(R,b.id,M),onDragLeave:R=>{let F=R.relatedTarget;F&&R.currentTarget.contains(F)||(v(null),c.current=null,S(null))},onStatusChange:(R,F)=>l(R,F),onAddTask:()=>n(null,"details",b.id),onOpenTask:n,onDragStart:y,onCardDragOver:k,cardDropTarget:L},b.id)})}),(0,de.jsx)("div",{id:"kanban-scroll-track",style:{position:"fixed",bottom:0,left:0,right:0,height:6,background:"transparent",zIndex:40,pointerEvents:"none"},children:(0,de.jsx)("div",{id:"kanban-scroll-thumb",ref:d,style:{position:"absolute",top:1,height:4,borderRadius:2,background:"var(--p-border-t)",cursor:"pointer",pointerEvents:"auto",transition:"background 0.15s",opacity:0},onMouseEnter:b=>{b.currentTarget.style.background="var(--p-text-g)"},onMouseLeave:b=>{b.currentTarget.classList.contains("dragging")||(b.currentTarget.style.background="var(--p-border-t)")}})})]})}function $x({col:e,tasks:t,isLoading:a,liveActivities:r,isDragOver:o,onDragOver:n,onDrop:l,onDragLeave:s,onStatusChange:u,onAddTask:d,onOpenTask:g,onDragStart:m,onCardDragOver:p,cardDropTarget:v}){let[L,S]=jt.default.useState(!1),z=e.id==="in-progress"?"sd-inprogress":`sd-${e.id}`,c=20,i=e.id==="done",f=i&&t.length>c?t.length-c:0,y=i?t.slice(0,c):t;return(0,de.jsxs)("section",{className:"board-column","data-column-id":e.id,style:{outline:o?`2px dashed ${e.color}66`:void 0,outlineOffset:-2,borderRadius:8},onDragOver:n,onDragLeave:s,onDrop:l,children:[(0,de.jsxs)("div",{className:"column-header",style:{background:e.accent,borderColor:`color-mix(in srgb, ${e.color} 30%, transparent)`},children:[(0,de.jsx)("div",{className:`status-dot ${z}`}),(0,de.jsxs)("span",{style:{fontSize:12,fontWeight:600,color:e.id==="done"?`${e.color}b3`:e.color},children:[e.label,a?"":` \\xB7 ${t.length}`]}),(0,de.jsx)("span",{style:{marginLeft:"auto"}}),(0,de.jsx)("button",{type:"button",title:`Add task to ${e.label}`,style:{width:20,height:20,display:"flex",alignItems:"center",justifyContent:"center",borderRadius:4,border:"none",background:"transparent",color:L?e.color:"var(--p-text-g)",cursor:"pointer",transition:"color .15s",padding:0},onMouseEnter:()=>S(!0),onMouseLeave:()=>S(!1),onClick:d,children:(0,de.jsx)(Ln,{style:{width:14,height:14}})})]}),(0,de.jsx)("div",{className:"column-scroll","data-status":e.id,children:a?Array.from({length:Wx}).map((C,k)=>(0,de.jsx)(Vx,{},k)):t.length===0?(0,de.jsxs)("div",{style:{border:"1px dashed var(--p-border-t)",borderRadius:8,padding:"10px 8px",fontSize:11,color:"var(--p-text-f)",textAlign:"center"},children:["No tasks in ",e.label.toLowerCase(),"."]}):(0,de.jsxs)(de.Fragment,{children:[y.map(C=>(0,de.jsxs)("div",{style:{position:"relative"},onDragOver:k=>p(k,C.id),children:[(v==null?void 0:v.taskId)===C.id&&v.position==="before"&&(0,de.jsx)("div",{style:{height:2,borderRadius:1,background:e.color,margin:"2px 0"}}),(0,de.jsx)(ji,{task:C,col:e,liveActivity:r==null?void 0:r.get(C.id),onOpen:g,onDragStart:m}),(v==null?void 0:v.taskId)===C.id&&v.position==="after"&&(0,de.jsx)("div",{style:{height:2,borderRadius:1,background:e.color,margin:"2px 0"}})]},C.id)),f>0&&(0,de.jsxs)("div",{style:{margin:"4px 0 2px",padding:"6px 8px",borderRadius:6,border:"1px dashed var(--p-border-t)",fontSize:11,color:"var(--p-text-g)",textAlign:"center",lineHeight:1.4},children:["+",f," older ",f===1?"task":"tasks"," not shown"]})]})})]})}var vr=A(Ce(),1);var oe=A(q(),1),gm={backlog:{text:"var(--p-text-m)",bg:"color-mix(in srgb, var(--p-text-g) 14%, transparent)",border:"color-mix(in srgb, var(--p-text-g) 30%, transparent)"},todo:{text:"var(--p-amber-300)",bg:"color-mix(in srgb, var(--p-amber) 14%, transparent)",border:"color-mix(in srgb, var(--p-amber) 30%, transparent)"},"in-progress":{text:"var(--p-blue-200)",bg:"color-mix(in srgb, var(--p-blue) 14%, transparent)",border:"color-mix(in srgb, var(--p-blue) 30%, transparent)"},review:{text:"var(--p-purple-300)",bg:"color-mix(in srgb, var(--p-purple) 14%, transparent)",border:"color-mix(in srgb, var(--p-purple) 30%, transparent)"},done:{text:"var(--p-green-300)",bg:"color-mix(in srgb, var(--p-green) 12%, transparent)",border:"color-mix(in srgb, var(--p-green) 30%, transparent)"}},Kx=im,hm={Critical:"var(--p-red)",High:"var(--p-amber-300)",Medium:"var(--p-text-m)",Low:"var(--p-text-f)"},Yi=["in-progress","review","todo","backlog","done"];function Gx(){return(0,oe.jsxs)("div",{style:{display:"grid",gridTemplateColumns:"18px 1fr auto auto",alignItems:"center",gap:10,padding:"6px 10px",borderRadius:8,border:"1px solid var(--p-border-t)",background:"var(--p-bg-2)",animation:"skeleton-pulse 1.5s ease-in-out infinite"},children:[(0,oe.jsx)("div",{style:{width:14,height:14,borderRadius:3,background:"var(--p-border-s)"}}),(0,oe.jsx)("div",{style:{height:12,borderRadius:4,background:"var(--p-border-s)",width:"60%"}}),(0,oe.jsx)("div",{style:{height:18,borderRadius:10,background:"var(--p-border-s)",width:44}}),(0,oe.jsx)("div",{style:{height:18,borderRadius:10,background:"var(--p-border-s)",width:36}})]})}function Zi({tasks:e,searchQuery:t,isLoading:a,liveActivities:r,onOpenPanel:o,onAddTask:n,onDrop:l}){let[s,u]=vr.default.useState(null),[d,g]=vr.default.useState(null),[m,p]=vr.default.useState(null),[v,L]=vr.default.useState({backlog:!1,todo:!1,"in-progress":!1,review:!1,done:!1}),S=t?e.filter(c=>(c.title??"").toLowerCase().includes(t.toLowerCase())||(c.description??"").toLowerCase().includes(t.toLowerCase())):e,z=vr.default.useMemo(()=>{let c=new Map;for(let i of Yi)c.set(i,[]);for(let i of S)(c.get(i.status)??[]).push(i);return c},[S]);return(0,oe.jsxs)("div",{id:"kanban-list-view",style:{flex:1,overflowY:"auto",padding:"16px 24px",minHeight:0},children:[a?Yi.slice(0,3).map(c=>{let i=gm[c];return(0,oe.jsxs)("div",{style:{marginBottom:24},children:[(0,oe.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:8,marginBottom:8},children:[(0,oe.jsx)("div",{style:{width:18,height:18,borderRadius:5,background:"var(--p-border-s)",animation:"skeleton-pulse 1.5s ease-in-out infinite"}}),(0,oe.jsx)("div",{style:{height:18,borderRadius:6,background:i.bg,border:`1px solid ${i.border}`,width:72,animation:"skeleton-pulse 1.5s ease-in-out infinite"}}),(0,oe.jsx)("div",{style:{height:14,borderRadius:4,background:"var(--p-border-s)",width:16,animation:"skeleton-pulse 1.5s ease-in-out infinite"}})]}),(0,oe.jsx)("div",{style:{display:"flex",flexDirection:"column",gap:2},children:Array.from({length:3}).map((f,y)=>(0,oe.jsx)(Gx,{},y))})]},c)}):Yi.map(c=>{let i=z.get(c)??[];if(i.length===0)return null;let f=gm[c];return(0,oe.jsxs)("div",{style:{marginBottom:24},children:[(0,oe.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:8,marginBottom:8,padding:"4px 6px",borderRadius:6,transition:"background .1s",background:d===c?f.bg:"transparent",outline:d===c?`1px dashed ${f.border}`:void 0},onDragOver:y=>{y.preventDefault(),g(c)},onDragLeave:()=>g(null),onDrop:y=>{y.preventDefault(),g(null),p(null),s&&l(s,c),u(null)},children:[(0,oe.jsx)("button",{type:"button",title:v[c]?"Expand":"Collapse",onClick:y=>{y.stopPropagation(),L(C=>({...C,[c]:!C[c]}))},style:{width:18,height:18,borderRadius:5,border:"1px solid var(--p-border-t)",background:"var(--p-surface)",color:"var(--p-text-m)",fontSize:10,cursor:"pointer",display:"inline-flex",alignItems:"center",justifyContent:"center",flexShrink:0},children:v[c]?"+":"\\u2212"}),(0,oe.jsx)("span",{style:{fontSize:11,fontWeight:600,textTransform:"uppercase",letterSpacing:"0.05em",padding:"2px 8px",borderRadius:6,background:f.bg,border:`1px solid ${f.border}`,color:f.text},children:c}),(0,oe.jsx)("span",{style:{fontSize:11,color:"var(--p-text-g)"},children:i.length}),(0,oe.jsx)("button",{type:"button",title:`Add task to ${c}`,onClick:y=>{y.stopPropagation(),n(c)},style:{marginLeft:"auto",width:22,height:22,borderRadius:7,border:`1px solid ${f.border}`,background:f.bg,color:f.text,cursor:"pointer",display:"inline-flex",alignItems:"center",justifyContent:"center",fontSize:14,fontWeight:600},children:"+"})]}),(0,oe.jsx)("div",{style:{display:v[c]?"none":"flex",flexDirection:"column",gap:2},children:i.map(y=>(0,oe.jsx)(jx,{task:y,liveActivity:r==null?void 0:r.get(y.id),onOpen:o,onDragStart:C=>u(C),dragOver:m===y.id,onDragOver:()=>p(y.id),onDragLeave:()=>p(C=>C===y.id?null:C),onDropToStatus:()=>{s&&l(s,y.status),u(null),p(null)}},y.id))})]},c)}),!a&&S.length===0&&(0,oe.jsx)("div",{style:{textAlign:"center",color:"var(--p-text-g)",fontSize:13,marginTop:60},children:"No tasks found"})]})}function jx({task:e,liveActivity:t,onOpen:a,onDragStart:r,dragOver:o,onDragOver:n,onDragLeave:l,onDropToStatus:s}){let[u,d]=vr.default.useState(!1),g=Kx[e.type??"Task"]??"\\u2611",m=e.commentCount??0,p=e.fileCount??0;return(0,oe.jsxs)("div",{"data-task-id":e.id,"data-proto-id":"list-row",draggable:!0,style:{display:"grid",gridTemplateColumns:"18px 1fr auto auto auto",alignItems:"center",gap:10,padding:"6px 10px",borderRadius:8,background:o?"color-mix(in srgb, var(--p-blue) 10%, transparent)":u?"var(--p-hover)":"transparent",border:`1px solid ${o?"color-mix(in srgb, var(--p-blue) 40%, transparent)":u?"var(--p-border)":"transparent"}`,cursor:"grab",transition:"background .1s,border-color .1s",userSelect:"none"},onMouseEnter:()=>d(!0),onMouseLeave:()=>d(!1),onClick:()=>a(e),onDragStart:v=>{v.dataTransfer.effectAllowed="move",r(e.id),v.currentTarget.style.opacity="0.4"},onDragEnd:v=>{v.currentTarget.style.opacity="1"},onDragOver:v=>{v.preventDefault(),n()},onDragLeave:l,onDrop:v=>{v.preventDefault(),s()},children:[(0,oe.jsx)("span",{style:{fontSize:12,textAlign:"center",flexShrink:0},children:g}),(0,oe.jsxs)("div",{style:{minWidth:0},children:[(0,oe.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:6},children:[(0,oe.jsx)("span",{style:{fontSize:13,fontWeight:500,color:"var(--p-text)",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:e.title}),e.priority&&hm[e.priority]&&(0,oe.jsx)(hn,{className:"w-2.5 h-2.5 flex-shrink-0",style:{color:hm[e.priority]}}),e.component&&(0,oe.jsx)("span",{style:{fontSize:10,padding:"1px 6px",borderRadius:10,background:"color-mix(in srgb, var(--p-purple) 14%, transparent)",border:"1px solid color-mix(in srgb, var(--p-purple) 30%, transparent)",color:"var(--p-purple-300)",flexShrink:0,fontFamily:"monospace"},children:e.component})]}),e.description&&(0,oe.jsx)("div",{style:{fontSize:11,color:"var(--p-text-g)",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",marginTop:1,maxWidth:"100%"},children:e.description.replace(/\\s+/g," ").trim()})]}),(0,oe.jsxs)("button",{title:m>0?`${m} comment(s)`:"Add comment",style:{display:"flex",alignItems:"center",gap:3,fontSize:11,color:m>0?"var(--p-text-m)":"var(--p-border-t)",background:"none",border:"none",cursor:"pointer",padding:"0 2px",flexShrink:0},onClick:v=>{v.stopPropagation(),a(e,"comments")},children:[(0,oe.jsx)(mr,{className:"w-3 h-3"}),m>0&&(0,oe.jsx)("span",{children:m})]}),p>0&&(0,oe.jsxs)("button",{title:`${p} file(s)`,style:{display:"flex",alignItems:"center",gap:3,fontSize:11,color:"var(--p-blue-300)",background:"none",border:"none",cursor:"pointer",padding:"0 2px",flexShrink:0},onClick:v=>{v.stopPropagation(),a(e,"files")},children:[(0,oe.jsx)(gr,{className:"w-3 h-3"}),(0,oe.jsx)("span",{children:p})]}),t&&(0,oe.jsx)(Xi,{activity:t})]})}var fo=A(Ce(),1);var Na=A(q(),1);function xm({size:e=32,style:t,className:a}){return(0,Na.jsxs)("svg",{width:e,height:e,viewBox:"0 0 32 32",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:t,className:a,"aria-label":"Vibeflow",children:[(0,Na.jsx)("rect",{width:"32",height:"32",rx:"7",fill:"#2563eb"}),(0,Na.jsx)("rect",{x:"7",y:"13",width:"3.5",height:"10",rx:"1.5",fill:"white",opacity:"0.75"}),(0,Na.jsx)("rect",{x:"12.25",y:"8.5",width:"3.5",height:"15",rx:"1.5",fill:"white"}),(0,Na.jsx)("rect",{x:"17.5",y:"14.5",width:"3.5",height:"8",rx:"1.5",fill:"white",opacity:"0.75"}),(0,Na.jsx)("rect",{x:"22.5",y:"11",width:"2.5",height:"11",rx:"1.25",fill:"white",opacity:"0.85"})]})}var ps=A(q(),1);function cs({id:e,title:t,onClick:a,label:r,icon:o,variant:n="neutral"}){return(0,ps.jsxs)("button",{id:e,onClick:a,title:t,className:`h-7 inline-flex items-center justify-center rounded-lg border transition-colors ${n==="accent"?"border-violet-700/50 bg-violet-900/30 text-violet-300 hover:bg-violet-800/30":"border-slate-700/60 bg-slate-800 text-slate-400 hover:bg-slate-700/50 hover:text-slate-200"} ${r?"gap-1.5 px-3 text-xs font-medium":"w-7"}`,type:"button",children:[o,r&&(0,ps.jsx)("span",{children:r})]})}var K=A(q(),1);function Ji({projectName:e,projectIcon:t,missingProjectIconStyle:a="initial",wsConnected:r,port:o,searchQuery:n,premiumUsage:l,isLoading:s,filterTags:u,allTags:d,onToggleTag:g,backHref:m,backLabel:p,onSearchChange:v,onSettings:L,extraActions:S,taskSummary:z}){let[c,i]=fo.default.useState(!1),[f,y]=fo.default.useState(0),C=fo.default.useRef(null),k=fo.default.useRef(null),h=n.match(/(?:^|\\s)#(\\S*)$/),w=h?h[1]:null,b=u??[],M=(d??[]).filter(N=>!b.includes(N)),R=w!==null?M.filter(N=>N.toLowerCase().includes(w.toLowerCase())):[];fo.default.useEffect(()=>{y(0)},[R.length]);function F(N){var te;let Z=n.replace(/\\s*#\\S*$/,"");v(Z),g==null||g(N),(te=C.current)==null||te.focus()}function ee(N){if(N.key==="Backspace"&&n===""&&b.length>0){N.preventDefault(),g==null||g(b[b.length-1]);return}if(!(w===null||R.length===0)){if(N.key==="ArrowDown")N.preventDefault(),y(Z=>Math.min(Z+1,R.length-1));else if(N.key==="ArrowUp")N.preventDefault(),y(Z=>Math.max(Z-1,0));else if(N.key==="Enter")N.preventDefault(),R[f]&&F(R[f]);else if(N.key==="Escape"){let Z=n.replace(/\\s*#\\S*$/,"");v(Z)}}}let G=(t??"").trim(),Ie=e?e.charAt(0).toUpperCase()+e.slice(1):"Vibeflow Board",_=n||b.length>0;return(0,K.jsxs)("header",{className:"px-5 py-3 flex items-center gap-3 border-b border-slate-800/60 flex-shrink-0",children:[(0,K.jsxs)("div",{className:"flex items-center gap-3 flex-shrink-0",children:[m&&(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)("a",{id:"header-back-link",href:m,className:"text-xs text-slate-400 hover:text-slate-200 transition-colors no-underline",style:{textDecoration:"none",fontWeight:500},children:p??"Back"}),(0,K.jsx)(mn,{className:"w-3 h-3 text-slate-600 flex-shrink-0"})]}),(0,K.jsx)("div",{className:"flex-shrink-0",style:G?{fontSize:20}:void 0,children:G||(a==="vibeflow"?(0,K.jsx)(xm,{size:32}):(0,K.jsx)("div",{style:{width:32,height:32,borderRadius:8,flexShrink:0,background:"linear-gradient(135deg, #1e3a5f 0%, #1e293b 100%)",border:"1px solid rgba(37,99,235,0.3)",display:"flex",alignItems:"center",justifyContent:"center",fontSize:13,fontWeight:700,color:"#93c5fd",letterSpacing:"-0.01em"},title:Ie,children:Ie.charAt(0).toUpperCase()}))}),(0,K.jsxs)("div",{children:[(0,K.jsxs)("div",{className:"flex items-center gap-2",children:[(0,K.jsx)("h1",{id:"header-project-name",className:"text-sm font-semibold text-white leading-tight",children:Ie}),r&&(0,K.jsxs)("div",{id:"header-live-pill",className:"flex items-center gap-1.5 rounded-full px-2 py-0.5",style:{background:"color-mix(in srgb, var(--p-green) 30%, transparent)",border:"1px solid color-mix(in srgb, var(--p-green) 28%, transparent)"},children:[(0,K.jsx)("div",{className:"w-1.5 h-1.5 rounded-full bg-green-400",style:{animation:"pulse-live 2s ease-in-out infinite"}}),(0,K.jsxs)("span",{className:"text-[10px] font-medium text-green-400",children:["live \\xB7 :",o]})]})]}),(0,K.jsxs)("p",{className:"text-[10px] text-slate-500 font-mono mt-0.5",children:[z,s&&(0,K.jsx)("span",{id:"header-loading-indicator",className:"inline-block ml-1.5 w-1 h-1 rounded-full bg-blue-400",style:{animation:"pulse-live 1.4s ease-in-out infinite",verticalAlign:"middle"}})]})]})]}),(0,K.jsx)("div",{className:"flex-1 flex justify-center px-4",children:(0,K.jsxs)("div",{className:"relative w-full max-w-sm",children:[(0,K.jsxs)("div",{className:"flex flex-wrap items-center gap-1 w-full min-h-[30px] rounded-lg bg-slate-800 border border-slate-700/60 px-2 py-1 cursor-text transition-colors focus-within:border-blue-500",onClick:()=>{var N;return(N=C.current)==null?void 0:N.focus()},children:[(0,K.jsx)(Sn,{className:"w-3.5 h-3.5 text-slate-500 flex-shrink-0 mr-0.5"}),b.map(N=>{let{bg:Z,text:te,border:W}=Ut(N);return(0,K.jsxs)("span",{style:{background:Z,color:te,border:`1px solid ${W}`,display:"inline-flex",alignItems:"center",gap:3,padding:"1px 7px",borderRadius:100,fontSize:11,fontWeight:500,whiteSpace:"nowrap"},children:[N,(0,K.jsx)("button",{onClick:ce=>{ce.stopPropagation(),g==null||g(N)},style:{background:"none",border:"none",cursor:"pointer",padding:0,lineHeight:1,color:"inherit",opacity:.7,display:"flex"},children:(0,K.jsx)(Ne,{style:{width:9,height:9}})})]},N)}),(0,K.jsx)("input",{ref:C,id:"global-search",type:"text",placeholder:b.length===0?"Search\\u2026 or type #tag":"#tag or search\\u2026",value:n,onChange:N=>v(N.target.value),onKeyDown:ee,className:"flex-1 min-w-[100px] bg-transparent border-none outline-none text-xs text-slate-200 placeholder-slate-500",autoComplete:"off",spellCheck:!1}),_&&(0,K.jsx)("button",{id:"global-search-clear",onClick:()=>{v(""),b.forEach(N=>g==null?void 0:g(N))},className:"text-slate-500 hover:text-slate-300 transition-colors flex-shrink-0 flex",title:"Clear search and tag filters",children:(0,K.jsx)(Ne,{className:"w-3.5 h-3.5"})})]}),w!==null&&R.length>0&&(0,K.jsxs)("div",{ref:k,style:{position:"absolute",top:"calc(100% + 4px)",left:0,right:0,background:"var(--p-card)",border:"1px solid var(--p-border-s)",borderRadius:8,boxShadow:"0 8px 24px rgba(0,0,0,0.3)",zIndex:50,overflow:"hidden"},children:[(0,K.jsx)("div",{style:{padding:"5px 10px",fontSize:10,textTransform:"uppercase",letterSpacing:"0.06em",color:"var(--p-text-g)",borderBottom:"1px solid var(--p-border)"},children:"Tags"}),R.map((N,Z)=>{let{bg:te,text:W,border:ce}=Ut(N);return(0,K.jsxs)("button",{onMouseDown:je=>{je.preventDefault(),F(N)},onMouseEnter:()=>y(Z),style:{width:"100%",textAlign:"left",display:"flex",alignItems:"center",gap:8,padding:"7px 12px",background:Z===f?"var(--p-hover)":"none",border:"none",cursor:"pointer"},children:[(0,K.jsx)("span",{style:{width:8,height:8,borderRadius:"50%",background:W,flexShrink:0}}),(0,K.jsx)("span",{style:{fontSize:12,color:"var(--p-text-m)"},children:N}),(0,K.jsx)("span",{style:{marginLeft:"auto",display:"inline-flex",alignItems:"center",padding:"1px 7px",borderRadius:100,fontSize:10,background:te,color:W,border:`1px solid ${ce}`},children:"tag"})]},N)}),(0,K.jsx)("div",{style:{padding:"5px 10px",fontSize:10,color:"var(--p-text-g)",borderTop:"1px solid var(--p-border)"},children:"\\u2191\\u2193 navigate \\xB7 Enter select \\xB7 Esc close"})]})]})}),(0,K.jsxs)("div",{className:"flex items-center gap-2 flex-shrink-0",children:[S,(0,K.jsx)(cs,{id:"header-shortcuts-hint",title:"Click to see keyboard shortcuts",onClick:()=>i(!0),label:"? shortcuts"}),(0,K.jsx)(cs,{id:"btn-settings",title:"Settings",onClick:L,icon:(0,K.jsx)(hr,{className:"w-3.5 h-3.5"})})]}),c&&(0,K.jsx)("div",{style:{position:"fixed",inset:0,background:"rgba(2,12,27,0.80)",backdropFilter:"blur(8px)",WebkitBackdropFilter:"blur(8px)",zIndex:200,display:"flex",alignItems:"center",justifyContent:"center"},onClick:()=>i(!1),children:(0,K.jsxs)("div",{id:"shortcuts-modal",style:{background:"var(--p-card)",border:"1px solid var(--p-border-s)",borderRadius:14,padding:"20px 24px",minWidth:320,maxWidth:420,boxShadow:"var(--p-shadow-lg)"},onClick:N=>N.stopPropagation(),children:[(0,K.jsxs)("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",marginBottom:16},children:[(0,K.jsx)("span",{style:{fontSize:13,fontWeight:700,color:"var(--p-text)"},children:"Keyboard Shortcuts"}),(0,K.jsx)("button",{onClick:()=>i(!1),style:{background:"none",border:"none",cursor:"pointer",color:"var(--p-text-f)",padding:2},children:(0,K.jsx)(Ne,{style:{width:14,height:14}})})]}),(0,K.jsx)("div",{style:{display:"flex",flexDirection:"column",gap:8},children:[["Alt+N","Open new task panel"],["Esc","Close panel / modal"],["?","Show this shortcuts overlay"],["Alt+F","Focus task search"]].map(([N,Z])=>(0,K.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:12},children:[(0,K.jsx)("kbd",{style:{fontSize:10,fontFamily:"monospace",background:"var(--p-surface)",border:"1px solid var(--p-border-t)",borderRadius:4,padding:"2px 7px",color:"var(--p-text-sub)",flexShrink:0},children:N}),(0,K.jsx)("span",{style:{fontSize:12,color:"var(--p-text-m)"},children:Z})]},N))})]})})]})}var X=A(Ce(),1);var ms=A(Ce(),1);var Xt=A(q(),1);function gs({id:e,value:t,onChange:a,disabled:r}){let[o,n]=ms.default.useState(!1),l=ms.default.useRef(null),s=xr.find(u=>u.value===t)??xr[0];return ms.default.useEffect(()=>{let u=d=>{var g;(g=l.current)!=null&&g.contains(d.target)||n(!1)};return document.addEventListener("click",u),()=>document.removeEventListener("click",u)},[]),(0,Xt.jsxs)("div",{id:e,ref:l,style:{position:"relative",display:"inline-block"},children:[(0,Xt.jsxs)("button",{type:"button",title:s==null?void 0:s.tooltip,onClick:u=>{u.preventDefault(),r||n(d=>!d)},style:{display:"inline-flex",alignItems:"center",gap:5,padding:"3px 8px",borderRadius:6,border:"1px solid var(--p-border, rgba(255,255,255,0.08))",background:"var(--p-hover, rgba(255,255,255,0.05))",color:"var(--p-text-m, rgba(255,255,255,0.7))",fontSize:12,cursor:"pointer",whiteSpace:"nowrap"},children:[(0,Xt.jsx)("span",{style:{fontSize:13},children:s==null?void 0:s.icon}),(0,Xt.jsx)("span",{children:s==null?void 0:s.label})]}),o&&(0,Xt.jsx)("div",{style:{position:"absolute",top:"100%",left:0,marginTop:4,background:"var(--p-card, #1e293b)",border:"1px solid var(--p-border-s, rgba(255,255,255,0.12))",borderRadius:8,padding:"4px 0",zIndex:200,minWidth:140,boxShadow:"0 8px 24px rgba(0,0,0,0.4)"},children:xr.map(u=>(0,Xt.jsxs)("button",{type:"button",title:u.tooltip,onClick:()=>{a(u.value),n(!1)},style:{display:"flex",alignItems:"center",gap:8,width:"100%",padding:"6px 12px",border:"none",background:u.value===t?"var(--p-hover, rgba(255,255,255,0.06))":"transparent",color:u.value===t?"var(--p-text, #fff)":"var(--p-text-f, rgba(255,255,255,0.55))",fontSize:12,cursor:"pointer",textAlign:"left"},children:[(0,Xt.jsx)("span",{style:{fontSize:14,lineHeight:1},children:u.icon}),(0,Xt.jsx)("span",{children:u.label})]},u.value))})]})}var et=A(Ce(),1);var Pn=A(Ce(),1);var Ha=A(q(),1);function _a({markdown:e,className:t,style:a}){let r=Pn.default.useRef(null),o=Pn.default.useRef({}),[n,l]=Pn.default.useState(null);return Pn.default.useEffect(()=>{let s=r.current;if(!s)return;function u(){l(null)}async function d(m){let p=m.target,v=p==null?void 0:p.closest("a[data-task-ref]");if(!v){u();return}m.preventDefault();let L=v.getAttribute("data-task-ref");if(!L)return;let S=v.getBoundingClientRect(),z=o.current[L];if(z){l({id:L,title:z.title,status:z.status,x:S.left,y:S.bottom+6});return}try{let i=await(await fetch(`/api/tasks/${L}`)).json(),f={title:i.title??`Task ${L}`,status:i.status??"unknown"};o.current[L]=f,l({id:L,title:f.title,status:f.status,x:S.left,y:S.bottom+6})}catch{l({id:L,title:`Task ${L}`,status:"unknown",x:S.left,y:S.bottom+6})}}function g(m){var L,S;let p=(S=(L=m.target)==null?void 0:L.closest)==null?void 0:S.call(L,"a[data-task-ref]");if(!p)return;let v=p.getAttribute("data-task-ref");v&&window.dispatchEvent(new CustomEvent("vibeflow-task-ref-click",{detail:{refId:v}}))}return s.addEventListener("mouseover",d),s.addEventListener("mouseleave",u),s.addEventListener("click",g),()=>{s.removeEventListener("mouseover",d),s.removeEventListener("mouseleave",u),s.removeEventListener("click",g)}},[]),(0,Ha.jsxs)("div",{style:{position:"relative"},children:[(0,Ha.jsx)("div",{ref:r,className:t,style:a,dangerouslySetInnerHTML:{__html:ns(e)}}),n&&(0,Ha.jsxs)("div",{style:{position:"fixed",left:n.x,top:n.y,background:"#0f172a",border:"1px solid rgba(59,130,246,0.4)",color:"#e2e8f0",borderRadius:8,padding:"8px 10px",fontSize:11,boxShadow:"0 10px 24px rgba(2,6,23,0.55)",zIndex:60,pointerEvents:"none",minWidth:180},children:[(0,Ha.jsxs)("div",{style:{color:"#60a5fa",fontFamily:"Menlo,monospace",marginBottom:3},children:["#",n.id]}),(0,Ha.jsx)("div",{style:{fontWeight:600,marginBottom:3},children:n.title}),(0,Ha.jsxs)("div",{style:{color:"#94a3b8"},children:["status: ",n.status]})]})]})}var Tn=A(Ce(),1),vm=A(q(),1),co=Tn.default.forwardRef(function({value:t,onChange:a,baseRows:r=4,maxRows:o,style:n,...l},s){let u=Tn.default.useRef(null),d=o??r*2,g=Tn.default.useCallback(()=>{let m=u.current;if(!m)return;m.style.height="auto";let p=window.getComputedStyle(m),v=Number.parseFloat(p.lineHeight||"0")||18,L=Number.parseFloat(p.paddingTop||"0")+Number.parseFloat(p.paddingBottom||"0"),S=Number.parseFloat(p.borderTopWidth||"0")+Number.parseFloat(p.borderBottomWidth||"0"),z=r*v+L+S,c=d*v+L+S,i=Math.max(z,Math.min(m.scrollHeight,c));m.style.height=`${i}px`,m.style.overflowY=m.scrollHeight>c?"auto":"hidden"},[r,d]);return Tn.default.useLayoutEffect(()=>{g()},[t,g]),(0,vm.jsx)("textarea",{...l,ref:m=>{u.current=m,typeof s=="function"?s(m):s&&(s.current=m)},rows:r,value:t,onChange:m=>a(m.target.value),style:{...n,resize:"none"}})});var Sm=A(Ce(),1);var ym=A(Ce(),1),Lm=A(oo(),1),da=A(q(),1);function yr({open:e,onClose:t,icon:a,title:r,headerActions:o,width:n,maxHeight:l,id:s,children:u,footer:d,boxStyle:g,onKeyDown:m}){if(ym.default.useEffect(()=>{if(!e)return;function L(S){S.key==="Escape"&&t(),m==null||m(S)}return window.addEventListener("keydown",L),()=>window.removeEventListener("keydown",L)},[e,t,m]),!e)return null;let p=!!(a||r||o),v=(0,da.jsx)("div",{id:s,className:"modal-backdrop",onClick:L=>{L.target===L.currentTarget&&t()},onMouseDown:L=>L.stopPropagation(),children:(0,da.jsxs)("div",{className:"modal-box",style:{width:n??"min(420px, 95vw)",maxHeight:l,...g},children:[p&&(0,da.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:10,padding:"14px 18px",borderBottom:"1px solid var(--p-border)",flexShrink:0},children:[a&&(0,da.jsx)("span",{style:{flexShrink:0,display:"flex",alignItems:"center"},children:a}),r&&(0,da.jsx)("span",{style:{fontSize:14,fontWeight:600,color:"var(--p-text)",flex:1,minWidth:0},children:r}),o&&(0,da.jsx)("div",{style:{display:"flex",alignItems:"center",gap:4,flexShrink:0,marginLeft:"auto"},children:o})]}),u,d&&(0,da.jsx)("div",{style:{display:"flex",alignItems:"center",justifyContent:"flex-end",gap:8,padding:"10px 18px",borderTop:"1px solid var(--p-border)",flexShrink:0},children:d})]})});return(0,Lm.createPortal)(v,document.body)}var wt=A(q(),1);function Qt({open:e,message:t,title:a="Confirm",confirmLabel:r="Delete",cancelLabel:o="Cancel",loading:n,error:l,onConfirm:s,onCancel:u}){let d=Sm.default.useCallback(g=>{g.key==="Enter"&&s()},[s]);return(0,wt.jsx)(yr,{open:e,onClose:u,id:"confirm-modal",width:"min(380px, 95vw)",icon:(0,wt.jsx)(za,{style:{width:20,height:20,color:"#f87171"}}),title:a,onKeyDown:d,footer:(0,wt.jsxs)(wt.Fragment,{children:[(0,wt.jsx)("button",{id:"confirm-modal-cancel",onClick:u,disabled:n,style:{padding:"7px 16px",borderRadius:8,background:"var(--p-hover)",border:"1px solid var(--p-border)",color:"var(--p-text-m)",fontSize:13,cursor:"pointer",transition:"background 0.15s"},children:o}),(0,wt.jsx)("button",{id:"confirm-modal-confirm",onClick:s,disabled:n,style:{padding:"7px 16px",borderRadius:8,background:"#dc2626",border:"none",color:"#fff",fontSize:13,fontWeight:600,cursor:n?"wait":"pointer",opacity:n?.6:1,transition:"background 0.15s"},children:n?"Deleting\\u2026":r})]}),children:(0,wt.jsxs)("div",{style:{padding:"16px 18px"},children:[typeof t=="string"?(0,wt.jsx)("p",{style:{margin:0,fontSize:13,color:"var(--p-text-f)",lineHeight:1.6},children:t}):t,l&&(0,wt.jsx)("p",{style:{margin:"8px 0 0",fontSize:12,color:"var(--p-red)"},children:l})]})})}var Ee=A(q(),1);function Im(e){return e.linkedPath?"\\u{1F517}":/\\.(png|jpe?g|gif|webp|svg)$/i.test(e.name)?"\\u{1F5BC}\\uFE0F":/\\.html?$/i.test(e.name)?"\\u{1F310}":/\\.md$/i.test(e.name)||/\\.pdf$/i.test(e.name)?"\\u{1F4C4}":"\\u{1F4CE}"}function Xx(e){return/\\.(png|jpe?g|gif|webp|svg|html?)$/i.test(e.name)}function Qx(e){return/\\.html?$/i.test(e.name)}function hs({file:e,url:t,variant:a,onPreview:r,onDelete:o}){let n=Xx(e),l=Qx(e);function s(){r?r(e,t):window.open(t,"_blank")}return a==="compact"?(0,Ee.jsxs)("div",{className:"group/file-compact",style:{display:"flex",alignItems:"center",gap:8,padding:"4px 8px",borderRadius:8,background:"var(--p-card)",border:"1px solid var(--p-border)",position:"relative"},children:[(0,Ee.jsx)("span",{style:{fontSize:14,flexShrink:0},children:Im(e)}),(0,Ee.jsx)("div",{style:{flex:1,minWidth:0},children:(0,Ee.jsx)("button",{onClick:s,style:{fontSize:12,color:"var(--p-blue-300)",background:"none",border:"none",cursor:"pointer",padding:0,textAlign:"left",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",maxWidth:"100%"},title:e.name,children:e.name})}),(0,Ee.jsx)("span",{className:"file-compact-ts",style:{fontSize:10,color:"var(--p-border-t)",flexShrink:0,marginLeft:2},children:e.createdAt?lt(e.createdAt):"attached"}),(0,Ee.jsxs)("div",{className:"file-compact-actions",style:{position:"absolute",right:6,top:0,bottom:0,display:"flex",alignItems:"center",gap:4,transition:"opacity 0.15s",background:"var(--p-card)",paddingLeft:8},children:[n&&(0,Ee.jsx)("button",{onClick:s,style:{background:"none",border:"none",cursor:"pointer",padding:"2px 4px",borderRadius:4,fontSize:11,color:"var(--p-text-m)"},title:l?"Open in new tab":"Preview",children:l?"\\u2197":"\\u{1F441}"}),(0,Ee.jsx)("a",{href:t,download:e.name,style:{background:"none",border:"none",cursor:"pointer",padding:"2px 4px",borderRadius:4,fontSize:11,color:"var(--p-text-m)",textDecoration:"none"},title:"Download",onClick:u=>u.stopPropagation(),children:"\\u2193"}),o&&(0,Ee.jsx)("button",{onClick:()=>void o(e),style:{background:"none",border:"none",cursor:"pointer",padding:"2px 4px",borderRadius:4,fontSize:11,color:"var(--p-text-m)"},title:"Delete",children:"\\u2715"})]})]}):(0,Ee.jsxs)("div",{className:"group/file",style:{display:"flex",alignItems:"center",gap:10,padding:8,borderRadius:8,border:"1px solid var(--p-border)",transition:"background 0.15s",position:"relative"},children:[(0,Ee.jsx)("span",{style:{fontSize:18,flexShrink:0},children:Im(e)}),(0,Ee.jsxs)("div",{style:{flex:1,minWidth:0},children:[(0,Ee.jsx)("p",{style:{fontSize:12,fontWeight:500,color:"var(--p-text)",margin:0,cursor:"pointer",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},title:e.name,onClick:s,children:e.name}),(0,Ee.jsx)("p",{style:{fontSize:10,color:"var(--p-text-f)",margin:0},children:e.linkedPath?`linked: ${e.linkedPath}`:$i(e.size??0)})]}),(0,Ee.jsxs)("div",{className:"file-normal-actions",style:{display:"flex",alignItems:"center",gap:4,transition:"opacity 0.15s"},children:[n&&(0,Ee.jsx)("button",{onClick:s,style:{background:"none",border:"none",cursor:"pointer",padding:"4px",borderRadius:4,fontSize:11,color:"var(--p-text-m)"},title:l?"Open in new tab":"Preview",children:l?"\\u2197":"\\u{1F441}"}),(0,Ee.jsx)("a",{href:t,download:e.name,style:{background:"none",border:"none",cursor:"pointer",padding:"4px",borderRadius:4,fontSize:11,color:"var(--p-text-m)",textDecoration:"none"},title:"Download",onClick:u=>u.stopPropagation(),children:"\\u2193"}),o&&(0,Ee.jsx)("button",{onClick:()=>void o(e),style:{background:"none",border:"none",cursor:"pointer",padding:"4px",borderRadius:4,fontSize:11,color:"var(--p-text-m)"},title:"Delete",children:"\\u2715"})]})]})}var B=A(q(),1);function Cm({source:e}){return e!=="cli"?null:(0,B.jsx)("span",{title:"Via CLI (agent)",style:{fontSize:9,color:"var(--p-green-300)",background:"rgba(34,197,94,0.1)",border:"1px solid rgba(34,197,94,0.2)",borderRadius:4,padding:"0 4px",fontFamily:"monospace",lineHeight:"16px",flexShrink:0},children:">_"})}function Yx(e,t){if(e.kind==="lifecycle")return e.author??null;if(e.kind==="comment"){let a=e.comment;return a.type==="system"?null:a.author==="agent"?"\\u{1F916} Agent":a.authorName??t}return e.kind==="change"?e.actor:null}function Zx(e,t){let a=[];for(let r of e){let o=Yx(r,t),n=a[a.length-1];o&&n&&n.author===o?(n.items.push(r),r.sortKey>n.newestSortKey&&(n.newestSortKey=r.sortKey),r.sortKey<n.oldestSortKey&&(n.oldestSortKey=r.sortKey)):a.push({author:o,newestSortKey:r.sortKey,oldestSortKey:r.sortKey,items:[r]})}return a}function ed({comments:e,files:t=[],localChanges:a=[],loading:r,error:o,gitUserName:n="You",taskAuthorName:l,baseUrl:s="",taskId:u,taskCreatedAt:d,taskUpdatedAt:g,onEdit:m,onDelete:p,onDeleteFile:v,onFilePreview:L}){let S=et.default.useRef(null),z=et.default.useRef(null),[c,i]=et.default.useState(null),[f,y]=et.default.useState(""),[C,k]=et.default.useState(null),[h,w]=et.default.useState(null),[b,M]=et.default.useState(()=>{try{return localStorage.getItem("vibeflow-show-updates")!=="false"}catch{return!0}}),R=et.default.useRef(r),F=et.default.useMemo(()=>{let _=[];d&&_.push({kind:"lifecycle",sortKey:d,label:"Task created",icon:"\\u2726",author:l??n}),g&&g!==d&&_.push({kind:"lifecycle",sortKey:g,label:"Task edited",icon:"\\u270E"});let N=e.map(W=>({kind:"comment",sortKey:W.createdAt,comment:W})),Z=t.map(W=>{let ce=W.url.startsWith("http")?W.url:`${s}${W.url}`;return{kind:"file",sortKey:W.createdAt??"9999",file:W,url:ce}}),te=a.map(W=>({kind:"change",sortKey:W.timestamp,field:W.field,from:W.from,to:W.to,actor:W.actor,source:W.source}));return[..._,...N,...Z,...te].sort((W,ce)=>ce.sortKey.localeCompare(W.sortKey))},[e,t,a,s,d,g]),ee=et.default.useMemo(()=>F.filter(_=>_.kind==="lifecycle"||_.kind==="change").length,[F]),G=et.default.useMemo(()=>b?F:F.filter(_=>_.kind==="comment"||_.kind==="file"),[F,b]),Ie=et.default.useMemo(()=>Zx(G,n),[G,n]);return et.default.useEffect(()=>{let _=R.current&&!r;R.current=r,S.current&&_&&requestAnimationFrame(()=>{S.current&&(S.current.scrollTop=0)})},[r]),et.default.useEffect(()=>{c&&z.current&&(z.current.focus(),z.current.scrollIntoView({block:"nearest"}))},[c]),r?(0,B.jsx)("p",{style:{color:"var(--p-text-g)",fontSize:12,textAlign:"center",padding:"16px 0"},children:"Loading\\u2026"}):o?(0,B.jsx)("p",{style:{color:"var(--p-red-500)",fontSize:12,textAlign:"center",padding:"8px 0"},children:"Failed to load."}):F.length===0?(0,B.jsx)("p",{style:{color:"var(--p-text-g)",fontSize:12,textAlign:"center",padding:"16px 0"},children:"No activity yet."}):(0,B.jsxs)("div",{style:{flex:1,display:"flex",flexDirection:"column",minHeight:0},children:[ee>0&&(0,B.jsxs)("div",{style:{display:"flex",alignItems:"center",padding:"4px 0 4px",flexShrink:0,borderBottom:"1px solid var(--p-border)",marginBottom:4},children:[(0,B.jsx)("span",{style:{fontSize:9,color:"var(--p-text-g)",flex:1,letterSpacing:"0.04em"},children:b?"":`${ee} system event${ee!==1?"s":""} hidden`}),(0,B.jsx)("button",{id:"dp-toggle-updates",onClick:()=>M(_=>{let N=!_;try{localStorage.setItem("vibeflow-show-updates",String(N))}catch{}return N}),style:{all:"unset",cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center",width:22,height:22,borderRadius:5,color:b?"var(--p-text-m)":"var(--p-text-g)",transition:"color .12s, background .12s"},title:b?"Hide system events":`Show ${ee} system event${ee!==1?"s":""}`,onMouseEnter:_=>{_.currentTarget.style.color="var(--p-text)",_.currentTarget.style.background="var(--p-hover)"},onMouseLeave:_=>{_.currentTarget.style.color=b?"var(--p-text-m)":"var(--p-text-g)",_.currentTarget.style.background="transparent"},children:b?(0,B.jsxs)("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,B.jsx)("path",{d:"M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z"}),(0,B.jsx)("circle",{cx:"12",cy:"12",r:"3"})]}):(0,B.jsxs)("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,B.jsx)("path",{d:"M17.94 17.94A10.07 10.07 0 0 1 12 20c-7 0-11-8-11-8a18.45 18.45 0 0 1 5.06-5.94M9.9 4.24A9.12 9.12 0 0 1 12 4c7 0 11 8 11 8a18.5 18.5 0 0 1-2.16 3.19m-6.72-1.07a3 3 0 1 1-4.24-4.24"}),(0,B.jsx)("line",{x1:"1",y1:"1",x2:"23",y2:"23"})]})})]}),(0,B.jsx)("div",{ref:S,style:{flex:1,overflowY:"auto",display:"flex",flexDirection:"column",gap:2,minHeight:0},children:Ie.map((_,N)=>{let Z=_.author!==null&&_.items.length>1,te=Z,W=_.author==="\\u{1F916} Agent";return(0,B.jsxs)("div",{style:{display:"flex",flexDirection:"column",gap:0},children:[te&&(0,B.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:6,padding:"6px 0 2px",marginTop:4},children:[(0,B.jsx)("span",{style:{fontSize:11,fontWeight:600,color:W?"var(--p-purple)":"var(--p-blue-300)",flexShrink:0},children:_.author}),(0,B.jsx)("span",{style:{fontSize:10,color:"var(--p-text-g)",flexShrink:0},children:`${lt(_.oldestSortKey)} \\u2013 ${lt(_.newestSortKey)}`}),(0,B.jsxs)("span",{style:{fontSize:10,color:"var(--p-border-t)",flexShrink:0,marginLeft:2},children:["(",_.items.length," activities)"]})]}),(0,B.jsx)("div",{style:{display:"flex",flexDirection:"column",gap:Z?4:8,paddingLeft:Z?8:0,borderLeft:Z?"1.5px solid var(--p-border)":"none",marginLeft:Z?4:0},children:_.items.map((ce,je)=>Jx(ce,je,N,Z,n,c,f,z,i,y,m,k,v?w:null,L))})]},`group-${N}`)})}),(0,B.jsx)(Qt,{open:C!==null,message:"Delete this comment? This action cannot be undone.",onConfirm:()=>{C&&p(C),k(null)},onCancel:()=>k(null)}),v&&(0,B.jsx)(Qt,{open:h!==null,message:h?`Delete "${h.name}"? This action cannot be undone.`:"",onConfirm:()=>{h&&v(h),w(null)},onCancel:()=>w(null)})]})}function Jx(e,t,a,r,o,n,l,s,u,d,g,m,p,v){if(e.kind==="lifecycle")return(0,B.jsxs)("div",{style:{display:"flex",alignItems:"flex-start",gap:6,padding:"2px 0"},children:[(0,B.jsx)("span",{style:{fontSize:11,color:"var(--p-purple)",fontWeight:600,flexShrink:0,minWidth:18,paddingTop:1},children:e.icon}),(0,B.jsx)("div",{style:{flex:1,minWidth:0},children:(0,B.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:6,flexWrap:"wrap"},children:[(0,B.jsx)("span",{style:{fontSize:11,color:"var(--p-text-m)",fontStyle:"italic"},children:e.label}),!r&&(0,B.jsx)("span",{style:{fontSize:10,color:"var(--p-text-g)",marginLeft:"auto",flexShrink:0},children:lt(e.sortKey)})]})})]},`lifecycle-${e.sortKey}-${a}-${t}`);if(e.kind==="change"){let C=e.from.length>28?e.from.slice(0,28)+"\\u2026":e.from,k=e.to.length>28?e.to.slice(0,28)+"\\u2026":e.to,h=e.from.length>28||e.to.length>28;return(0,B.jsxs)("div",{style:{display:"flex",alignItems:"flex-start",gap:6,padding:"2px 0"},children:[(0,B.jsx)("span",{style:{fontSize:11,color:"var(--p-blue)",fontWeight:600,flexShrink:0,minWidth:18,paddingTop:1},children:"\\u270E"}),(0,B.jsxs)("div",{style:{flex:1,minWidth:0},children:[(0,B.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:6,flexWrap:"wrap"},children:[!r&&(0,B.jsxs)("span",{style:{fontSize:11,fontWeight:600,color:"var(--p-blue-300)"},children:["\\u{1F464} ",e.actor]}),!r&&(0,B.jsx)(Cm,{source:e.source}),(0,B.jsxs)("span",{style:{fontSize:11,color:"var(--p-text-m)"},children:["changed ",(0,B.jsx)("strong",{style:{color:"var(--p-text)"},children:e.field})]}),!r&&(0,B.jsx)("span",{style:{fontSize:10,color:"var(--p-text-g)",marginLeft:"auto",flexShrink:0},children:lt(e.sortKey)})]}),(0,B.jsxs)("div",{title:h?`${e.from} \\u2192 ${e.to}`:void 0,style:{marginTop:2,fontSize:11,color:"var(--p-text-g)",display:"flex",alignItems:"center",gap:4,cursor:h?"help":"default"},children:[(0,B.jsx)("span",{style:{color:"var(--p-red)",background:"rgba(239,68,68,0.1)",borderRadius:4,padding:"1px 5px",maxWidth:120,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:C}),(0,B.jsx)("span",{style:{color:"var(--p-text-g)"},children:"\\u2192"}),(0,B.jsx)("span",{style:{color:"var(--p-green)",background:"rgba(34,197,94,0.1)",borderRadius:4,padding:"1px 5px",maxWidth:120,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:k})]})]})]},`change-${e.sortKey}-${a}-${t}`)}if(e.kind==="file"){let{file:y,url:C}=e;return(0,B.jsx)(hs,{file:y,url:C,variant:"compact",onPreview:v?(k,h)=>v(k.name,h):void 0,onDelete:p?k=>(p(k),Promise.resolve()):void 0},`file-${y.name}-${a}-${t}`)}let L=e.comment,S=L.author==="agent",z=L.type==="system",c=L.deleted===!0,i=!!L.id&&!S&&!z&&!c&&L.isOwnComment!==!1,f=n===L.id;return z?(0,B.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:6,padding:"2px 0",fontSize:11,color:"var(--p-text-g)",fontStyle:"italic"},children:[(0,B.jsx)("span",{style:{opacity:.6},children:"\\u2B21"}),(0,B.jsx)("span",{children:L.text}),!r&&(0,B.jsx)("span",{style:{marginLeft:"auto",flexShrink:0,opacity:.6},children:lt(L.createdAt)})]},L.id):(0,B.jsxs)("div",{className:"flex flex-col gap-1 group/comment",style:{paddingTop:r?2:4},children:[!r&&(0,B.jsxs)("div",{className:"flex items-center justify-between gap-1.5 text-xs mb-0.5",children:[(0,B.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,B.jsx)("span",{style:{color:c?"var(--p-text-g)":S?"var(--p-purple)":"var(--p-blue-300)"},children:S?"\\u{1F916} Agent":`\\u{1F464} ${L.authorName??o}`}),(0,B.jsx)(Cm,{source:L.source}),(0,B.jsxs)("span",{style:{color:"var(--p-text-g)"},children:[lt(L.createdAt),!c&&L.updatedAt?" \\xB7 edited":"",c?" \\xB7 deleted":""]})]}),i&&(0,B.jsxs)("div",{className:"flex items-center gap-1 opacity-0 group-hover/comment:opacity-100 transition-opacity",children:[(0,B.jsx)("button",{onClick:()=>{u(L.id),d(L.text)},className:"p-1 rounded hover:bg-slate-700 transition-colors",title:"Edit",children:(0,B.jsx)("span",{style:{fontSize:11,color:"var(--p-text-m)"},children:"\\u270E"})}),(0,B.jsx)("button",{onClick:()=>m(L),className:"p-1 rounded hover:bg-red-900/40 transition-colors",title:"Delete",children:(0,B.jsx)("span",{style:{fontSize:11,color:"var(--p-text-m)"},children:"\\u2715"})})]})]}),r&&(0,B.jsxs)("div",{className:"flex items-center justify-between gap-1.5",style:{marginBottom:2},children:[(0,B.jsxs)("span",{style:{fontSize:10,color:"var(--p-text-g)"},children:[lt(L.createdAt),!c&&L.updatedAt?" \\xB7 edited":"",c?" \\xB7 deleted":""]}),i&&(0,B.jsxs)("div",{className:"flex items-center gap-1 opacity-0 group-hover/comment:opacity-100 transition-opacity",children:[(0,B.jsx)("button",{onClick:()=>{u(L.id),d(L.text)},className:"p-1 rounded hover:bg-slate-700 transition-colors",title:"Edit",children:(0,B.jsx)("span",{style:{fontSize:11,color:"var(--p-text-m)"},children:"\\u270E"})}),(0,B.jsx)("button",{onClick:()=>m(L),className:"p-1 rounded hover:bg-red-900/40 transition-colors",title:"Delete",children:(0,B.jsx)("span",{style:{fontSize:11,color:"var(--p-text-m)"},children:"\\u2715"})})]})]}),f?(0,B.jsxs)("div",{style:{display:"flex",flexDirection:"column",gap:6},children:[(0,B.jsx)(co,{ref:s,value:l,onChange:d,baseRows:4,maxRows:12,onKeyDown:y=>{y.key==="Enter"&&(y.ctrlKey||y.metaKey)&&(y.preventDefault(),g(L,l).then(()=>u(null)))},style:{width:"100%",background:"var(--p-input)",border:"1px solid var(--p-border-s)",borderRadius:6,padding:"8px 10px",fontSize:12,color:"var(--p-text)",outline:"none",fontFamily:"inherit",boxSizing:"border-box"}}),(0,B.jsxs)("div",{style:{display:"flex",gap:6,justifyContent:"flex-end"},children:[(0,B.jsx)("button",{onClick:()=>u(null),style:{padding:"4px 10px",background:"var(--p-surface)",border:"none",borderRadius:5,fontSize:11,color:"var(--p-text-sub)",cursor:"pointer"},children:"Cancel"}),(0,B.jsx)("button",{onClick:async()=>{await g(L,l),u(null)},style:{padding:"4px 10px",background:"var(--p-blue)",border:"none",borderRadius:5,fontSize:11,color:"var(--p-white)",cursor:"pointer"},children:"Save"})]})]}):c?(0,B.jsx)("div",{style:{padding:"8px 14px",fontSize:12,color:"var(--p-text-g)",fontStyle:"italic",background:"var(--p-input)",border:"1px dashed var(--p-border)",borderRadius:8},children:"Comment deleted"}):(0,B.jsx)(_a,{markdown:L.text,style:{background:"var(--p-input)",border:"1px solid var(--p-border)",borderRadius:8,padding:"10px 14px",fontSize:12,color:"var(--p-text-sub)",lineHeight:1.6}})]},L.id)}var wm=A(Ce(),1);var qa=A(q(),1);function td({files:e,loading:t,error:a,baseUrl:r,onPreview:o,onDelete:n}){let[l,s]=wm.default.useState(null);return t?(0,qa.jsx)("p",{style:{color:"var(--p-text-g)",fontSize:12,textAlign:"center",padding:"16px 0"},children:"Loading\\u2026"}):a?(0,qa.jsx)("p",{style:{color:"var(--p-red-500)",fontSize:12,textAlign:"center",padding:"8px 0"},children:"Failed to load."}):e.length===0?(0,qa.jsx)("p",{style:{color:"var(--p-text-g)",fontSize:12,textAlign:"center",padding:"16px 0"},children:"No files attached."}):(0,qa.jsxs)("div",{style:{display:"flex",flexDirection:"column",gap:6},children:[e.map(u=>{let d=u.url??`${r}/api/files/${encodeURIComponent(u.name)}`;return(0,qa.jsx)(hs,{file:u,url:d,variant:"normal",onPreview:g=>o(g),onDelete:n?g=>(s(g),Promise.resolve()):void 0},u.name)}),n&&(0,qa.jsx)(Qt,{open:l!==null,message:l?`Delete "${l.name}"? This action cannot be undone.`:"",onConfirm:()=>{l&&n(l),s(null)},onCancel:()=>s(null)})]})}var od=A(Ce(),1);var po=A(Ce(),1),km=A(oo(),1);var Nt=A(q(),1);function Rn({value:e,onChange:t,previewValue:a,showPreview:r,setShowPreview:o,previewId:n,textareaId:l,placeholder:s,previewEmptyText:u,previewMinHeight:d=54,previewMaxHeight:g=220,baseRows:m=5,maxRows:p=12,autoFocus:v=!1,textareaRef:L,onKeyDown:S,afterTextarea:z,onBlur:c}){let i=po.default.useRef(null),[f,y]=po.default.useState([]),[C,k]=po.default.useState(null),[h,w]=po.default.useState(null);po.default.useEffect(()=>{let R=!0;return fetch("/api/tasks").then(F=>F.json()).then(F=>{if(!R)return;let ee=(F.tasks??[]).map(G=>({id:String(G.id??""),title:String(G.title??"")})).filter(G=>G.id.length>0);y(ee)}).catch(()=>{}),()=>{R=!1}},[]);function b(R){let F=i.current;if(!F){k(null);return}let ee=F.selectionStart??R.length,G=R.slice(0,ee),Ie=-1;for(let te=G.length-1;te>=0;te--){if(G[te]!=="#")continue;let W=te>0?G[te-1]:"";if(W&&!/\\s/.test(W))continue;let ce=G.slice(te+1);if(!ce.includes("#")){if(ce.length>80)return;Ie=te;break}}if(Ie===-1){k(null);return}let _=G.slice(Ie+1).trim().toLowerCase(),N=f.filter(te=>{if(!_)return!0;let W=te.id.toLowerCase(),ce=te.title.toLowerCase();return W.includes(_)||ce.includes(_)}).sort((te,W)=>{let ce=te.id.toLowerCase().startsWith(_)?1:0,je=W.id.toLowerCase().startsWith(_)?1:0;if(ce!==je)return je-ce;let bt=te.title.toLowerCase().startsWith(_)?1:0,Xe=W.title.toLowerCase().startsWith(_)?1:0;return bt!==Xe?Xe-bt:te.id.localeCompare(W.id)}).slice(0,6);if(!N.length){k(null),w(null);return}let Z=F.getBoundingClientRect();w({top:Z.top,left:Z.left,width:Z.width}),k({queryStart:Ie,queryEnd:ee,items:N})}function M(R){let F=C;if(!F)return;let ee=`${e.slice(0,F.queryStart)}#${R} ${e.slice(F.queryEnd)}`;t(ee),k(null),w(null),requestAnimationFrame(()=>{let G=i.current;if(!G)return;let Ie=F.queryStart+R.length+2;G.focus(),G.setSelectionRange(Ie,Ie)})}return r?(0,Nt.jsx)("div",{id:n,onClick:R=>{R.target.closest("a")||o(!1)},title:"Click to edit",style:{cursor:"text",minHeight:d,background:"var(--p-input)",border:"1px solid var(--p-border-s)",borderRadius:8,padding:10,fontSize:12,color:"var(--p-text-sub)",lineHeight:1.7,overflow:"auto",maxHeight:g},children:(a??e).trim()?(0,Nt.jsx)(_a,{markdown:a??e}):(0,Nt.jsx)("span",{style:{color:"var(--p-border-t)"},children:u??s})}):(0,Nt.jsxs)("div",{style:{position:"relative"},children:[(0,Nt.jsx)(co,{id:l,ref:R=>{i.current=R,L&&(L.current=R)},className:"dp-textarea",placeholder:s,value:e,onChange:R=>{t(R),b(R)},onFocus:()=>o(!1),onBlur:()=>{k(null),w(null),o(!0),c==null||c()},baseRows:m,maxRows:p,autoFocus:v,onKeyDown:R=>{R.key==="Escape"&&(k(null),w(null)),S==null||S(R)}}),C&&h&&(0,km.createPortal)((0,Nt.jsx)("div",{"data-task-ref-suggest":"true",style:{position:"fixed",left:h.left+8,width:h.width-16,top:h.top,transform:"translateY(-100%)",border:"1px solid var(--p-border-s)",background:"var(--p-card)",borderRadius:8,boxShadow:"var(--p-shadow-lg)",overflow:"hidden",zIndex:9999},children:C.items.map(R=>(0,Nt.jsxs)("button",{type:"button",onMouseDown:F=>{F.preventDefault(),M(R.id)},style:{width:"100%",display:"flex",alignItems:"center",gap:8,textAlign:"left",border:"none",borderBottom:"1px solid var(--p-border)",background:"transparent",color:"var(--p-text-sub)",padding:"7px 10px",fontSize:11,cursor:"pointer"},onMouseEnter:F=>{F.currentTarget.style.background="var(--p-hover)"},onMouseLeave:F=>{F.currentTarget.style.background="transparent"},children:[(0,Nt.jsxs)("span",{style:{fontFamily:"monospace",color:"var(--p-blue-300)"},children:["#",R.id]}),(0,Nt.jsx)("span",{style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:R.title})]},R.id))}),document.body),z]})}var Lr=A(Ce(),1);var kt=A(q(),1);function ad({tags:e,allTags:t,onChange:a,disabled:r}){let[o,n]=Lr.default.useState(""),[l,s]=Lr.default.useState(!1),u=Lr.default.useRef(null),d=Lr.default.useRef(null),g=o.trim().toLowerCase(),m=Lr.default.useMemo(()=>t.filter(f=>!e.includes(f)&&f.toLowerCase().includes(g)).slice(0,8),[t,e,g]),p=g.length>0&&!t.some(i=>i.toLowerCase()===g)&&!e.some(i=>i.toLowerCase()===g),v=g.length>0&&t.some(i=>i.toLowerCase()===g)&&!e.some(i=>i.toLowerCase()===g);function L(i){var y;let f=i.trim();!f||e.includes(f)||(a([...e,f]),n(""),s(!1),(y=u.current)==null||y.focus())}function S(i){a(e.filter(f=>f!==i))}function z(i){if(i.key==="Enter")if(i.preventDefault(),p||v){let f=t.find(y=>y.toLowerCase()===g);L(f??o.trim())}else m.length>0&&L(m[0]);i.key==="Escape"&&(s(!1),n("")),i.key==="Backspace"&&!o&&e.length>0&&S(e[e.length-1])}Lr.default.useEffect(()=>{function i(f){d.current&&!d.current.contains(f.target)&&s(!1)}return document.addEventListener("mousedown",i),()=>document.removeEventListener("mousedown",i)},[]);let c=l&&(m.length>0||p);return(0,kt.jsxs)("div",{ref:d,style:{position:"relative"},children:[(0,kt.jsxs)("div",{style:{display:"flex",flexWrap:"wrap",gap:4,alignItems:"center",padding:"5px 8px",borderRadius:8,border:`1px solid ${l?"var(--p-blue)":"var(--p-border)"}`,background:"var(--p-input)",cursor:r?"not-allowed":"text",opacity:r?.6:1,minHeight:34,transition:"border-color .12s"},onClick:()=>{var i;r||(i=u.current)==null||i.focus()},children:[(0,kt.jsx)(bn,{tags:e,onRemove:r?void 0:S,size:"sm"}),!r&&(0,kt.jsx)("input",{ref:u,type:"text",value:o,placeholder:e.length?"":"Add tags\\u2026",onChange:i=>{n(i.target.value),s(!0)},onFocus:()=>s(!0),onKeyDown:z,style:{background:"none",border:"none",outline:"none",fontSize:12,color:"var(--p-text)",minWidth:80,flex:1,padding:0,lineHeight:"1.4"}})]}),c&&(0,kt.jsxs)("div",{style:{position:"absolute",top:"calc(100% + 4px)",left:0,right:0,background:"var(--p-card)",border:"1px solid var(--p-border-s)",borderRadius:8,boxShadow:"0 8px 24px rgba(0,0,0,0.25)",zIndex:50,overflow:"hidden"},onMouseDown:i=>i.preventDefault(),children:[m.map(i=>{let{bg:f,text:y,border:C}=Ut(i);return(0,kt.jsxs)("button",{type:"button",onClick:()=>L(i),style:{width:"100%",textAlign:"left",padding:"6px 10px",display:"flex",alignItems:"center",gap:6,background:"none",border:"none",cursor:"pointer",fontSize:12,color:"var(--p-text-m)"},onMouseEnter:k=>{k.currentTarget.style.background="var(--p-hover)"},onMouseLeave:k=>{k.currentTarget.style.background="none"},children:[(0,kt.jsx)("span",{style:{width:8,height:8,borderRadius:"50%",background:y,border:`1px solid ${C}`,flexShrink:0}}),i]},i)}),p&&(0,kt.jsxs)("button",{type:"button",onClick:()=>L(o.trim()),style:{width:"100%",textAlign:"left",padding:"6px 10px",display:"flex",alignItems:"center",gap:6,background:"none",border:m.length>0?"1px solid var(--p-border)":"none",borderLeft:"none",borderRight:"none",borderBottom:"none",cursor:"pointer",fontSize:12,color:"var(--p-text-g)"},onMouseEnter:i=>{i.currentTarget.style.background="var(--p-hover)",i.currentTarget.style.color="var(--p-text-m)"},onMouseLeave:i=>{i.currentTarget.style.background="none",i.currentTarget.style.color="var(--p-text-g)"},children:[(0,kt.jsx)("span",{style:{fontSize:14,lineHeight:1},children:"+"}),\'Create "\',(0,kt.jsx)("strong",{style:{color:"var(--p-text)"},children:o.trim()}),\'"\']})]})]})}var $=A(q(),1);function nd({task:e,description:t,setDescription:a,showDescPreview:r,setShowDescPreview:o,priority:n,setPriority:l,onDescriptionBlur:s,onDescriptionDiscard:u,originalDescription:d,onPriorityChange:g,githubUrl:m,onFilePreview:p,onPatch:v,onDeleteScreenshot:L,liveFiles:S,allTags:z=[],overrideTags:c,onTagsChange:i}){let f=(e==null?void 0:e.files)??[],y=S?S.map(F=>({name:F.name,linkedPath:F.linkedPath,addedAt:F.createdAt,url:F.url})):f,C=y==null?void 0:y.find(F=>/\\.(png|jpe?g|gif|webp|svg|avif)$/i.test(F.name)),k=e&&C?C.url||`/api/tasks/${e.id}/files/${encodeURIComponent(C.name)}`:null,h=od.default.useRef(null),[w,b]=od.default.useState(null),{userPart:M,consolePart:R}=tv(t);return(0,$.jsxs)("div",{style:{display:"flex",flexDirection:"column",gap:12},children:[(0,$.jsxs)("div",{children:[(0,$.jsx)("div",{className:"dp-meta-label",style:{marginBottom:4},children:"Description"}),(0,$.jsx)(Rn,{value:t,previewValue:R?M:void 0,onChange:a,onBlur:s,showPreview:r,setShowPreview:o,previewId:"dp-desc-preview",textareaId:"dp-desc",placeholder:"Description (markdown)\\u2026",previewMinHeight:80,previewMaxHeight:220,baseRows:6,maxRows:12,autoFocus:!0,textareaRef:h,afterTextarea:u&&d!==void 0&&t!==d?(0,$.jsx)("button",{type:"button",onMouseDown:F=>{F.preventDefault(),u()},title:"Discard changes and restore saved description",style:{marginTop:4,display:"flex",alignItems:"center",gap:4,fontSize:11,color:"var(--p-text-g)",background:"none",border:"1px solid var(--p-border-t)",borderRadius:6,padding:"3px 8px",cursor:"pointer",transition:"color .12s, border-color .12s"},onMouseEnter:F=>{F.currentTarget.style.color="var(--p-amber-300)",F.currentTarget.style.borderColor="var(--p-amber-300)"},onMouseLeave:F=>{F.currentTarget.style.color="var(--p-text-g)",F.currentTarget.style.borderColor="var(--p-border-t)"},children:"\\u21A9 Discard changes"}):void 0})]}),R&&(0,$.jsx)(av,{logs:R}),e&&C&&k&&(0,$.jsxs)("div",{children:[(0,$.jsx)("div",{className:"dp-meta-label",children:"Screenshot"}),(0,$.jsxs)("div",{id:"dp-screenshot-preview",style:{border:"1px solid color-mix(in srgb, var(--p-border-t) 70%, transparent)",borderRadius:10,overflow:"hidden",background:"var(--p-card)"},children:[(0,$.jsx)("button",{onClick:()=>p(C.name,k),style:{width:"100%",height:112,border:"none",padding:0,background:"linear-gradient(135deg, var(--p-border), var(--p-bg))",cursor:"pointer",display:"block",overflow:"hidden"},title:"Preview screenshot",children:(0,$.jsx)("img",{src:k,alt:"Task screenshot",style:{width:"100%",height:"100%",objectFit:"cover",display:"block"}})}),(0,$.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:8,padding:"8px 10px",borderTop:"1px solid var(--p-border)",background:"var(--p-surface)"},children:[(0,$.jsx)("span",{style:{fontSize:10,color:"var(--p-text-f)",flex:1,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:C.addedAt?`Captured ${lt(C.addedAt)}`:"Screenshot attached"}),(0,$.jsx)("button",{onClick:()=>p(C.name,k),style:{fontSize:10,color:"var(--p-text-m)",background:"transparent",border:"none",cursor:"pointer",padding:0},title:"Preview screenshot",children:"Preview"}),(0,$.jsx)("button",{onClick:()=>b(C.name),style:{fontSize:10,color:"var(--p-red)",background:"transparent",border:"none",cursor:"pointer",padding:0},title:"Remove screenshot",children:"Remove"})]})]})]}),(0,$.jsxs)("div",{children:[(0,$.jsx)("div",{className:"dp-meta-label",children:"Tags"}),(0,$.jsx)(ad,{tags:c??(e==null?void 0:e.tags)??[],allTags:z,disabled:!e&&!i,onChange:F=>{i?i(F):e&&v(e.id,{tags:F})}})]}),(0,$.jsxs)("div",{children:[(0,$.jsx)("div",{className:"dp-meta-label",children:"Priority"}),(0,$.jsxs)("select",{id:"dp-priority",className:"dp-input",value:n,onChange:F=>{let ee=F.target.value;l(ee),g==null||g(ee)},style:{padding:"5px 8px",fontSize:12,cursor:"pointer",width:"auto"},children:[(0,$.jsx)("option",{value:"",children:"\\u2014"}),(0,$.jsx)("option",{value:"Critical",children:"Critical"}),(0,$.jsx)("option",{value:"High",children:"High"}),(0,$.jsx)("option",{value:"Medium",children:"Medium"}),(0,$.jsx)("option",{value:"Low",children:"Low"})]})]}),e&&(0,$.jsxs)("div",{id:"dp-metadata",style:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:6},children:[(0,$.jsx)(rd,{label:"Created",id:"dp-created",children:e.createdAt?lt(e.createdAt):"\\u2014"}),(0,$.jsx)(rd,{label:"ID",id:"dp-id",children:(0,$.jsx)("span",{style:{fontFamily:"monospace"},children:e.id})}),(0,$.jsx)(rd,{label:"Author",id:"dp-author",children:e.authorName??e.author??"\\u2014"}),e.commit&&(0,$.jsx)(ev,{task:e,githubUrl:m}),e.annotatedElementText&&(0,$.jsxs)("div",{id:"dp-annotated-text",style:{gridColumn:"1 / -1",background:"var(--p-card)",borderRadius:8,padding:"8px 10px"},children:[(0,$.jsx)("div",{style:{fontSize:9,color:"var(--p-border-t)",marginBottom:2,textTransform:"uppercase",letterSpacing:"0.04em"},children:"Annotated element text"}),(0,$.jsx)("div",{style:{fontSize:11,color:"var(--p-text-f)",fontStyle:"italic",whiteSpace:"pre-wrap",wordBreak:"break-word"},children:e.annotatedElementText})]})]}),(0,$.jsx)(Qt,{open:w!==null,message:"Remove this screenshot? This action cannot be undone.",confirmLabel:"Remove",onConfirm:()=>{w&&L(w),b(null)},onCancel:()=>b(null)})]})}function rd({label:e,id:t,children:a}){return(0,$.jsxs)("div",{id:t,style:{background:"var(--p-card)",borderRadius:8,padding:"8px 10px"},children:[(0,$.jsx)("div",{style:{fontSize:9,color:"var(--p-border-t)",marginBottom:2,textTransform:"uppercase",letterSpacing:"0.04em"},children:e}),(0,$.jsx)("div",{style:{fontSize:11,color:"var(--p-text-f)",borderBottom:"1px solid var(--p-border)",paddingBottom:4,display:"flex",alignItems:"center",minHeight:16},children:a})]})}function ev({task:e,githubUrl:t}){var n;let a=(n=e.commits)!=null&&n.length?e.commits:[{sha:e.commit,message:e.title??"",timestamp:e.createdAt??""}],r=a[a.length-1],o=a.map(l=>`${l.sha.slice(0,8)} ${l.timestamp?new Date(l.timestamp).toLocaleString():""} ${l.message.slice(0,60)}`).join(`\n`);return(0,$.jsxs)("div",{id:"dp-commit",style:{background:"var(--p-card)",borderRadius:8,padding:"8px 10px",cursor:"default"},title:a.length>1?`All commits:\n${o}`:`${r.sha}\n${r.message}`,children:[(0,$.jsxs)("div",{style:{fontSize:9,color:"var(--p-border-t)",marginBottom:2,textTransform:"uppercase",letterSpacing:"0.04em"},children:["Commit",a.length>1?"s":""]}),(0,$.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:5},children:[t&&e.commitPushed!==!1?(0,$.jsxs)("a",{href:`${t}/commit/${r.sha}`,target:"_blank",rel:"noopener noreferrer",style:{fontSize:10,color:"var(--p-blue-300)",fontFamily:"monospace",textDecoration:"none"},title:"Open diff on GitHub",onClick:l=>l.stopPropagation(),children:[r.sha.slice(0,8)," \\u2197"]}):(0,$.jsxs)("span",{style:{fontSize:10,color:"var(--p-text-f)",fontFamily:"monospace"},title:e.commitPushed===!1?"Commit not pushed to remote yet":void 0,children:[r.sha.slice(0,8),e.commitPushed===!1?" \\u23F3":""]}),a.length>1&&(0,$.jsxs)("span",{style:{fontSize:9,color:"var(--p-blue)",background:"color-mix(in srgb, var(--p-blue) 12%, transparent)",border:"1px solid color-mix(in srgb, var(--p-blue) 25%, transparent)",borderRadius:10,padding:"0 5px",fontWeight:600},children:["+",a.length-1]})]})]})}function tv(e){let a=e.indexOf(`\n---\n**Console logs**`);return a===-1?{userPart:e,consolePart:null}:{userPart:e.slice(0,a).trim(),consolePart:e.slice(a+1).trim()}}function av({logs:e}){let t=e.replace(/^---\\s*\\n/,"").split(`\n`).filter(a=>a.trim());return(0,$.jsxs)("div",{id:"dp-console-logs",style:{borderRadius:8,border:"1px solid color-mix(in srgb, var(--p-red) 30%, var(--p-border))",background:"color-mix(in srgb, var(--p-red) 4%, var(--p-card))",overflow:"hidden"},children:[(0,$.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:6,padding:"6px 10px",borderBottom:"1px solid color-mix(in srgb, var(--p-red) 20%, var(--p-border))",background:"color-mix(in srgb, var(--p-red) 8%, var(--p-card))"},children:[(0,$.jsx)("span",{style:{fontSize:10,fontWeight:700,color:"color-mix(in srgb, var(--p-red) 80%, var(--p-text-sub))",letterSpacing:"0.05em",textTransform:"uppercase"},children:"Console Logs"}),(0,$.jsx)("span",{style:{fontSize:9,color:"var(--p-text-g)",marginLeft:"auto"},children:"captured at submission"})]}),(0,$.jsxs)("div",{style:{padding:"6px 10px",maxHeight:200,overflowY:"auto",display:"flex",flexDirection:"column",gap:3},children:[t.map((a,r)=>{let o=a.includes("\\u{1F534}"),n=a.includes("\\u{1F7E1}"),l=a.replace(/^[-*]\\s*/,"");return(0,$.jsx)("div",{style:{fontFamily:"Menlo, monospace",fontSize:10,lineHeight:1.5,color:o?"var(--p-red)":n?"var(--p-amber-300)":"var(--p-text-f)",wordBreak:"break-all"},children:l},r)}),t.length===0&&(0,$.jsx)("div",{style:{fontSize:10,color:"var(--p-text-g)",fontStyle:"italic"},children:"No log entries captured."})]})]})}var mo=A(q(),1);function ld({commentInput:e,setCommentInput:t,commentSubmitting:a,onSubmit:r,baseRows:o=4}){return(0,mo.jsx)("div",{id:"dp-comment-input-area",children:(0,mo.jsx)(Rn,{value:e,onChange:t,showPreview:!1,setShowPreview:()=>{},previewId:"dp-comment-tab-edit",textareaId:"dp-comment-input",placeholder:"Add a comment\\u2026 (markdown)",previewEmptyText:"Leave a comment (markdown)\\u2026",previewMinHeight:o<=2?36:54,previewMaxHeight:140,baseRows:o,maxRows:10,autoFocus:!0,onKeyDown:n=>{n.key==="Enter"&&(n.ctrlKey||n.metaKey)&&(n.preventDefault(),r())},afterTextarea:(0,mo.jsx)("button",{id:"dp-comment-submit",disabled:a,onMouseDown:n=>{n.preventDefault(),r()},title:"Send (Ctrl+Enter)",style:{position:"absolute",bottom:16,right:8,width:26,height:26,display:"flex",alignItems:"center",justifyContent:"center",background:"var(--p-blue)",border:"none",borderRadius:6,cursor:"pointer",color:"var(--p-white)",transition:"background .15s"},children:(0,mo.jsx)("svg",{width:"13",height:"13",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{display:"block"},children:(0,mo.jsx)("path",{d:"M2 8L14 2L10 8L14 14L2 8Z",fill:"currentColor"})})})})})}var E=A(q(),1),rv="vibeflow-paste-hint-dismissed";function ov({storageKey:e=rv}){let[t,a]=X.default.useState(()=>{try{return!localStorage.getItem(e)}catch{return!0}});if(!t)return null;function r(){try{localStorage.setItem(e,"1")}catch{}a(!1)}return(0,E.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:8,padding:"6px 10px",margin:"0 0 6px",borderRadius:6,background:"rgba(37,99,235,0.08)",border:"1px solid rgba(37,99,235,0.18)",fontSize:11,color:"var(--p-blue-300)",flexShrink:0},children:[(0,E.jsxs)("span",{style:{flex:1,lineHeight:1.4},children:["\\u{1F4A1} ",(0,E.jsx)("strong",{children:"Tip:"})," Paste screenshots or files anywhere in this panel \\u2014 they attach automatically."]}),(0,E.jsx)("button",{onClick:r,title:"Dismiss",style:{flexShrink:0,background:"none",border:"none",cursor:"pointer",padding:2,color:"var(--p-blue-300)",opacity:.7,display:"flex",alignItems:"center"},onMouseEnter:o=>{o.currentTarget.style.opacity="1"},onMouseLeave:o=>{o.currentTarget.style.opacity="0.7"},children:(0,E.jsx)(Ne,{style:{width:12,height:12}})})]})}var nv=[{id:"backlog",label:"backlog"},{id:"todo",label:"todo"},{id:"in-progress",label:"in-progress"},{id:"review",label:"review"},{id:"done",label:"done"}],lv=5*1024*1024;function sd(e,t=.8){return new Promise((a,r)=>{let o=new Image,n=URL.createObjectURL(e);o.onload=()=>{let l=document.createElement("canvas");l.width=o.naturalWidth,l.height=o.naturalHeight;let s=l.getContext("2d");if(!s){URL.revokeObjectURL(n),r(new Error("canvas unavailable"));return}s.drawImage(o,0,0),URL.revokeObjectURL(n),l.toBlob(u=>{u?a(u):r(new Error("canvas.toBlob failed"))},"image/jpeg",t)},o.onerror=()=>{URL.revokeObjectURL(n),r(new Error("image load failed"))},o.src=n})}function ud({open:e,task:t,tab:a,addColumnId:r="todo",gitUserName:o="You",githubUrl:n,baseUrl:l,isResizing:s,api:u,onClose:d,onSave:g,onCreate:m,onDelete:p,onPatch:v,onFilePreview:L,onActivityChange:S,externalLocalChanges:z=[],showLockIndicator:c=!0,lockedByUser:i,onGoBack:f,navBackLabel:y,commentVersion:C,allTasks:k=[]}){let h=!t,w=t?wn(t.type):wn("Task"),b=X.default.useRef(null),[M,R]=X.default.useState([]),F=X.default.useRef(!1),ee=X.default.useRef(""),G=X.default.useRef(""),Ie=X.default.useMemo(()=>{let I=new Set;for(let H of k)for(let V of H.tags??[])I.add(V);return[...I].sort()},[k]),[_,N]=X.default.useState(a),[Z,te]=X.default.useState(""),[W,ce]=X.default.useState(""),[je,bt]=X.default.useState(r),[Xe,Yt]=X.default.useState("Task"),[Pt,fa]=X.default.useState(""),[gt,Ir]=X.default.useState(!1),[Ls,Cr]=X.default.useState(!1),[Tt,Zt]=X.default.useState(!1),[Ss,Dn]=X.default.useState([]),[Is,Mn]=X.default.useState(!1),[An,Va]=X.default.useState(null),[ca,wr]=X.default.useState(""),[Cs,$a]=X.default.useState(!1),[kr,En]=X.default.useState([]),[Fn,Bn]=X.default.useState(!1),[ws,On]=X.default.useState(null),[ho,xo]=X.default.useState(0),Ka=X.default.useRef(0),[vo,x]=X.default.useState(0),[P,O]=X.default.useState(null),[Q,ge]=X.default.useState([]),[se,ae]=X.default.useState([]),ne=X.default.useRef(null),Te=X.default.useRef(()=>{}),Me=X.default.useRef(""),Fe=X.default.useRef(!1);X.default.useEffect(()=>{Me.current=ca},[ca]),X.default.useEffect(()=>{Fe.current=Tt},[Tt]),X.default.useEffect(()=>{F.current=s??!1},[s]),X.default.useEffect(()=>{e||S==null||S(null,"viewing")},[e]),X.default.useEffect(()=>{if(!e||!t)return;Z!==ee.current||W!==G.current?S==null||S(t.id,"locked"):S==null||S(t.id,"viewing")},[Z,W,e,t==null?void 0:t.id]),X.default.useEffect(()=>{if(!e)return;function I(H){var V,ye,pe,Rt;if(!F.current&&!((ye=(V=H.target)==null?void 0:V.closest)!=null&&ye.call(V,"[data-task-ref-suggest]"))&&!((Rt=(pe=H.target)==null?void 0:pe.closest)!=null&&Rt.call(pe,".modal-backdrop"))&&b.current&&!b.current.contains(H.target)){if(Fe.current)return;if(Me.current.trim().length>0){Te.current(),Zt(!0);return}Te.current(),d()}}return document.addEventListener("mousedown",I),()=>document.removeEventListener("mousedown",I)},[e,d]),X.default.useEffect(()=>{if(!e)return;function I(H){if(H.key==="Escape"){if(Fe.current){Zt(!1),H.stopPropagation();return}if(Me.current.trim().length>0){H.stopPropagation(),Te.current(),Zt(!0);return}}}return document.addEventListener("keydown",I,{capture:!0}),()=>document.removeEventListener("keydown",I,{capture:!0})},[e]),X.default.useEffect(()=>{if(e){if(N(a),Ir(!!t),wr(""),Dn([]),En([]),xo(0),x(0),ge([]),ae([]),t){let I=(t.title??"").trim(),H=(t.description??"").trim();te(I),ce(H),bt(t.status),Yt(t.type??"Task"),fa(t.priority??""),ee.current=I,G.current=H,S==null||S(t.id,"viewing")}else te(""),ce(""),bt(r),Yt("Task"),fa("");t&&(D(t.id),st(t.id)),setTimeout(()=>{var I;return(I=ne.current)==null?void 0:I.focus()},50)}},[e,t==null?void 0:t.id,a]),X.default.useEffect(()=>{!e||!t||(_==="comments"?(Ga(t.id),st(t.id)):_==="files"&&st(t.id))},[_,e,t==null?void 0:t.id]),X.default.useEffect(()=>{if(!e||!t||Z!==ee.current||W!==G.current)return;let H=(t.title??"").trim(),V=(t.description??"").trim();(H!==ee.current||V!==G.current)&&(te(H),ce(V),ee.current=H,G.current=V),t.status&&t.status!==je&&bt(t.status),t.type&&t.type!==Xe&&Yt(t.type),t.priority!==void 0&&t.priority!==Pt&&fa(t.priority??"")},[t==null?void 0:t.title,t==null?void 0:t.description,t==null?void 0:t.status,t==null?void 0:t.type,t==null?void 0:t.priority]),X.default.useEffect(()=>{!e||!t||C===void 0||(_==="comments"?Ga(t.id):D(t.id))},[C]);async function D(I){var H,V;try{let[ye,pe]=await Promise.all([u.getComments(I),u.getFiles(I)]);xo(((H=ye.comments)==null?void 0:H.length)??0),x(((V=pe.files)==null?void 0:V.length)??0)}catch{}}async function Ga(I){var V;let H=++Ka.current;Mn(!0),Va(null);try{let ye=await u.getComments(I);if(Ka.current!==H)return;Dn(ye.comments??[]),xo(((V=ye.comments)==null?void 0:V.length)??0)}catch{if(Ka.current!==H)return;Va("failed")}finally{Ka.current===H&&Mn(!1)}}async function st(I){var H;Bn(!0),On(null);try{let V=await u.getFiles(I);En(V.files??[]),x(((H=V.files)==null?void 0:H.length)??0)}catch{On("failed")}finally{Bn(!1)}}async function _t(){var I;if(!Z.trim()){(I=ne.current)==null||I.focus();return}if(!h&&ca.trim()&&await br(),h){let H=await m({title:Z.trim(),description:W.trim()||Z.trim(),status:je,type:Xe,priority:Pt||void 0,selector:"/",tags:se.length>0?se:void 0});if(H&&M.length>0){for(let V of M)await u.uploadFile(H,V).catch(()=>null);R([])}d()}else pa()}function pa(){if(!t||h)return;let I=Z.trim();if(!I)return;let H=ee.current,V=G.current,ye=I!==H,pe=W.trim()!==V;!ye&&!pe||(ye&&ja("title",H,I),pe&&ja("description",V,W.trim()),v(t.id,{title:I,description:W.trim(),type:Xe,priority:Pt||void 0}),ee.current=I,G.current=W.trim())}Te.current=pa;function ja(I,H,V){H!==V&&ge(ye=>[...ye,{field:I,from:H,to:V,actor:o,timestamp:new Date().toISOString()}])}async function br(){if(!(!t||!ca.trim())){$a(!0);try{await u.addComment(t.id,ca.trim()),wr(""),await Ga(t.id)}finally{$a(!1)}}}async function Bm(I,H){t&&(await u.updateComment(t.id,I.id,H),await Ga(t.id))}async function Om(I){t&&(await u.deleteComment(t.id,I.id),await Ga(t.id))}async function zm(I){if(!t)return;let H=t.id;O(null);for(let V of Array.from(I.target.files??[])){if(!V.type.startsWith("image/")&&V.size>lv){O(`"${V.name}" exceeds the 5 MB limit and was skipped.`);continue}let ye;if(V.type.startsWith("image/")){let pe=await sd(V),Rt=V.name.replace(/\\.(png|bmp|gif|webp|tiff?)$/i,".jpg");ye=new File([pe],Rt,{type:"image/jpeg"})}else ye=V;await u.uploadFile(H,ye)}I.target.value="",await st(H),D(H)}async function Um(I){if(!t)return;O(null);let H=await sd(I),ye=`paste-${new Date().toISOString().replace(/[:.]/g,"-").slice(0,19)}.jpg`,pe=new File([H],ye,{type:"image/jpeg"});await u.uploadFile(t.id,pe),await st(t.id),D(t.id)}async function Nm(I){if(!t)return;let H=Array.from(I.items),V=H.find(pe=>pe.type.startsWith("image/"));if(V){let pe=V.getAsFile();pe&&await Um(pe);return}let ye=H.filter(pe=>pe.kind==="file"&&!pe.type.startsWith("image/"));if(ye.length>0){for(let pe of ye){let Rt=pe.getAsFile();Rt&&await u.uploadFile(t.id,Rt)}await st(t.id),D(t.id);return}}X.default.useEffect(()=>{if(!e)return;function I(H){if(!H.clipboardData)return;let V=H.target;if(!((V.tagName==="TEXTAREA"||V.tagName==="INPUT"||V.isContentEditable)&&!Array.from(H.clipboardData.items).some(Pr=>Pr.kind==="file"))){if(H.preventDefault(),!t){let Rt=Array.from(H.clipboardData.items).find(Pr=>Pr.type.startsWith("image/"));if(Rt){let Pr=Rt.getAsFile();Pr&&(async()=>{let $m=await sd(Pr),Km=new Date().toISOString().replace(/[:.]/g,"-").slice(0,19),Gm=new File([$m],`paste-${Km}.jpg`,{type:"image/jpeg"});R(jm=>[...jm,Gm])})()}return}Nm(H.clipboardData)}}return document.addEventListener("paste",I),()=>document.removeEventListener("paste",I)},[e,t==null?void 0:t.id]);async function cd(I){t&&(await u.deleteFile(t.id,I.name),await st(t.id),D(t.id))}async function Hm(I){if(!t)return;await u.deleteFile(t.id,I);let H=(t.files??[]).filter(V=>V.name!==I);v(t.id,{files:H}),await st(t.id),D(t.id)}function _m(I){bt(I),!h&&t&&v(t.id,{status:I})}let qm=I=>I!==je?"dp-status-btn":`dp-status-btn active-${I}`;function pd(){if(!Fe.current){if(Me.current.trim().length>0){Te.current(),Zt(!0);return}Te.current(),d()}}let Wm=e&&t!=null&&(Z!==ee.current||W!==G.current),Vm=X.default.useMemo(()=>{let I=[...z,...Q].sort((V,ye)=>new Date(V.timestamp).getTime()-new Date(ye.timestamp).getTime()),H=[];for(let V of I)H.some(pe=>pe.field===V.field&&pe.from.toLowerCase()===V.from.toLowerCase()&&pe.to.toLowerCase()===V.to.toLowerCase()&&pe.actor===V.actor&&Math.abs(new Date(pe.timestamp).getTime()-new Date(V.timestamp).getTime())<=3e3)||H.push(V);return H},[z,Q]),Xa=!h&&!!i;return(0,E.jsxs)(E.Fragment,{children:[(0,E.jsxs)("aside",{id:"detail-panel",className:"open",ref:b,children:[Xa&&(0,E.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:8,padding:"8px 12px",background:"rgba(234,88,12,0.12)",border:"1px solid rgba(234,88,12,0.25)",borderRadius:6,margin:"8px 12px 0",fontSize:12,color:"#f97316",fontWeight:500},children:["\\u{1F512} Locked by ",(0,E.jsx)("strong",{children:i})," \\u2014 editing disabled until they finish."]}),(0,E.jsxs)("div",{className:"dp-header",children:[(0,E.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:8,marginBottom:10},children:[f&&(0,E.jsx)("button",{id:"dp-back",onClick:f,title:y?`Back to: ${y}`:"Go back",style:{width:26,height:26,flexShrink:0,display:"flex",alignItems:"center",justifyContent:"center",borderRadius:6,border:"1px solid var(--p-border-t)",background:"transparent",color:"var(--p-text-g)",cursor:"pointer",transition:"background .12s,color .12s",fontSize:14,lineHeight:1},onMouseOver:I=>{I.currentTarget.style.background="var(--p-border)",I.currentTarget.style.color="var(--p-blue-300)",I.currentTarget.style.borderColor="var(--p-blue)"},onMouseOut:I=>{I.currentTarget.style.background="transparent",I.currentTarget.style.color="var(--p-text-g)",I.currentTarget.style.borderColor="var(--p-border-t)"},children:"\\u2190"}),(0,E.jsx)(gs,{id:"dp-type-picker",value:Xe,disabled:Xa,onChange:I=>{!h&&t&&I!==Xe&&ja("type",Xe,I),Yt(I),!h&&t&&v(t.id,{type:I})}}),(0,E.jsx)("input",{id:"dp-title",ref:ne,className:"dp-input",type:"text",placeholder:"Task title\\u2026",value:Z,readOnly:Xa,onChange:I=>te(I.target.value),onKeyDown:I=>{I.key==="Escape"&&(I.stopPropagation(),pd()),I.key==="Enter"&&h&&_t()},style:{flex:1,fontSize:14,fontWeight:600,padding:"4px 8px",borderColor:"transparent",background:"transparent"},onFocus:I=>{I.currentTarget.style.borderColor="var(--p-blue)",I.currentTarget.style.background="var(--p-input)"},onBlur:I=>{I.currentTarget.style.borderColor="transparent",I.currentTarget.style.background="transparent",h||pa()}}),!h&&Z!==ee.current&&Z.trim()!==""&&(0,E.jsx)("button",{type:"button",title:"Discard title changes",onMouseDown:I=>{I.preventDefault(),te(ee.current)},style:{width:20,height:20,flexShrink:0,display:"flex",alignItems:"center",justifyContent:"center",borderRadius:4,border:"1px solid var(--p-border-t)",background:"none",color:"var(--p-text-g)",cursor:"pointer",fontSize:13,lineHeight:1},onMouseEnter:I=>{I.currentTarget.style.color="var(--p-amber-300)",I.currentTarget.style.borderColor="var(--p-amber-300)"},onMouseLeave:I=>{I.currentTarget.style.color="var(--p-text-g)",I.currentTarget.style.borderColor="var(--p-border-t)"},children:"\\u21A9"}),(0,E.jsx)("button",{id:"dp-close",onClick:pd,style:{width:26,height:26,flexShrink:0,display:"flex",alignItems:"center",justifyContent:"center",borderRadius:6,border:"none",background:"transparent",color:"var(--p-text-g)",cursor:"pointer",transition:"background .12s,color .12s",pointerEvents:"auto"},onMouseOver:I=>{I.currentTarget.style.background="var(--p-border)",I.currentTarget.style.color="var(--p-text-m)"},onMouseOut:I=>{I.currentTarget.style.background="transparent",I.currentTarget.style.color="var(--p-text-g)"},children:(0,E.jsx)(Ne,{style:{width:14,height:14}})}),c&&Wm&&t&&(0,E.jsx)("span",{id:"dp-lock-indicator",title:`Locked by ${o} \\u2014 unsaved changes`,style:{display:"inline-flex",alignItems:"center",gap:3,flexShrink:0,borderRadius:999,padding:"2px 7px",fontSize:10,fontWeight:600,border:"1px solid rgba(244,114,182,0.35)",color:"#f9a8d4",background:"rgba(157,23,77,0.28)"},children:"\\u{1F512} Locked"})]}),(0,E.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:6,flexWrap:"wrap",...Xa?{pointerEvents:"none",opacity:.6}:{}},children:[(0,E.jsx)("span",{style:{fontSize:10,color:"var(--p-text-g)",fontWeight:500,textTransform:"uppercase",letterSpacing:"0.04em"},children:"Status"}),nv.map(I=>(0,E.jsx)("button",{className:qm(I.id),"data-status":I.id,onClick:()=>_m(I.id),children:I.label},I.id))]})]}),!h&&(0,E.jsxs)("div",{className:"dp-tabs",id:"dp-tabs-row",children:[(0,E.jsx)("button",{className:`dp-tab${_==="details"?" active":""}`,id:"dp-tab-details",onClick:()=>N("details"),children:"Details"}),(0,E.jsxs)("button",{className:`dp-tab${_==="comments"?" active":""}`,id:"dp-tab-activity",onClick:()=>N("comments"),children:["Activity ",ho>0&&(0,E.jsxs)("span",{id:"dp-activity-count",style:{color:"var(--p-text-g)",fontSize:10},children:["(",ho,")"]})]}),(0,E.jsxs)("button",{className:`dp-tab${_==="files"?" active":""}`,id:"dp-tab-files",onClick:()=>N("files"),children:["Files ",vo>0&&(0,E.jsxs)("span",{id:"dp-file-count",style:{color:"var(--p-text-g)",fontSize:10},children:["(",vo,")"]})]})]}),(0,E.jsxs)("div",{className:"dp-body",children:[!h&&(0,E.jsx)(ov,{}),(0,E.jsxs)("div",{className:"dp-pane",id:"dp-details-pane",style:{display:!t||_==="details"?"":"none"},children:[(0,E.jsx)("div",{style:Xa?{pointerEvents:"none",opacity:.6,flexShrink:0}:{flexShrink:0},children:(0,E.jsx)(nd,{task:t,description:W,setDescription:ce,showDescPreview:gt,setShowDescPreview:Ir,priority:Pt,setPriority:fa,onDescriptionBlur:h?void 0:pa,onDescriptionDiscard:h?void 0:()=>{ce(G.current),Ir(!0)},originalDescription:h?void 0:G.current,onPriorityChange:h?void 0:I=>{t&&(I!==Pt&&ja("priority",Pt||"\\u2014",I||"\\u2014"),v(t.id,{priority:I||void 0}))},githubUrl:n,onFilePreview:L,onDeleteScreenshot:Hm,onPatch:v,liveFiles:kr.length>0||Fn?kr:void 0,allTags:Ie,overrideTags:h?se:void 0,onTagsChange:h?ae:void 0})}),!h&&t&&(0,E.jsx)("div",{style:{display:"flex",alignItems:"center",gap:8,flexWrap:"wrap",flexShrink:0,marginTop:12,borderTop:"1px solid var(--p-border)",paddingTop:10},children:(0,E.jsx)(sv,{task:t})})]}),(0,E.jsxs)("div",{className:"dp-pane",id:"dp-activity-pane",style:{display:_==="comments"&&!h?"":"none"},children:[(0,E.jsx)("div",{style:{borderBottom:"1px solid var(--p-border)",paddingBottom:8,flexShrink:0},children:(0,E.jsx)(ld,{commentInput:ca,setCommentInput:wr,commentSubmitting:Cs,onSubmit:()=>void br(),baseRows:2})}),(0,E.jsx)(ed,{comments:Ss,files:kr,localChanges:Vm,loading:Is,error:An,gitUserName:o,taskAuthorName:t==null?void 0:t.authorName,baseUrl:l,taskId:t==null?void 0:t.id,taskCreatedAt:t==null?void 0:t.createdAt,taskUpdatedAt:t==null?void 0:t.updatedAt,onEdit:Bm,onDelete:Om,onDeleteFile:cd,onFilePreview:L})]}),(0,E.jsxs)("div",{className:"dp-pane",id:"dp-files-pane",style:{display:_==="files"&&!h?"":"none"},children:[(0,E.jsx)(td,{files:kr,loading:Fn,error:ws,baseUrl:l,onPreview:I=>L(I.name,I.linkedPath?`${l}/api/tasks/${t==null?void 0:t.id}/files/${encodeURIComponent(I.name)}`:`${l}${I.url}`),onDelete:Xa?void 0:cd}),(0,E.jsxs)("div",{style:{borderTop:"1px solid var(--p-border)",paddingTop:8,flexShrink:0,display:"flex",gap:8,flexWrap:"wrap",alignItems:"center",...Xa?{pointerEvents:"none",opacity:.5}:{}},children:[P&&(0,E.jsx)("div",{style:{width:"100%",fontSize:11,color:"var(--p-red)",background:"rgba(255,80,80,0.08)",border:"1px solid rgba(255,80,80,0.2)",borderRadius:5,padding:"4px 8px"},children:P}),(0,E.jsxs)("label",{style:{display:"flex",alignItems:"center",gap:6,cursor:"pointer",padding:"6px 10px",background:"var(--p-card)",border:"1px solid var(--p-border)",borderRadius:8,color:"var(--p-text-m)",fontSize:12,transition:"all .15s"},onMouseOver:I=>{I.currentTarget.style.borderColor="var(--p-border-t)",I.currentTarget.style.color="var(--p-text)"},onMouseOut:I=>{I.currentTarget.style.borderColor="var(--p-border)",I.currentTarget.style.color="var(--p-text-m)"},children:[(0,E.jsx)(uo,{style:{width:12,height:12}}),"Upload",(0,E.jsx)("input",{id:"dp-file-upload",type:"file",style:{display:"none"},multiple:!0,onChange:zm})]}),(0,E.jsx)("span",{style:{fontSize:11,color:"var(--p-border-t)",marginLeft:"auto"},children:"or paste image"})]})]})]}),(0,E.jsxs)("div",{className:"dp-footer",children:[!h&&(0,E.jsx)("button",{id:"dp-delete",onClick:()=>Cr(!0),style:{color:"var(--p-red)",background:"none",border:"1px solid var(--p-border-t)",borderRadius:7,padding:"5px 12px",fontSize:12,cursor:"pointer",fontFamily:"inherit",transition:"all .15s"},onMouseOver:I=>{I.currentTarget.style.borderColor="var(--p-red)"},onMouseOut:I=>{I.currentTarget.style.borderColor="var(--p-border-t)"},children:"Delete"}),(0,E.jsx)("div",{style:{flex:1}}),h?(0,E.jsxs)(E.Fragment,{children:[M.length>0&&(0,E.jsxs)("span",{style:{fontSize:11,color:"var(--p-blue-300)",marginRight:8,background:"rgba(37,99,235,0.1)",border:"1px solid rgba(37,99,235,0.25)",borderRadius:6,padding:"3px 8px"},children:["\\u{1F4CE} ",M.length," screenshot",M.length!==1?"s":""," will attach on save"]}),(0,E.jsx)("button",{id:"dp-cancel",onClick:d,style:{padding:"5px 14px",borderRadius:7,fontSize:12,fontWeight:500,cursor:"pointer",border:"1px solid var(--p-border-t)",background:"var(--p-border)",color:"var(--p-text-sub)",fontFamily:"inherit",transition:"all .15s"},onMouseOver:I=>{I.currentTarget.style.borderColor="var(--p-text-g)"},onMouseOut:I=>{I.currentTarget.style.borderColor="var(--p-border-t)"},children:"Cancel"}),(0,E.jsx)("button",{id:"dp-save",onClick:()=>void _t(),style:{padding:"5px 18px",borderRadius:7,fontSize:12,fontWeight:500,cursor:"pointer",border:"1px solid var(--p-blue-700)",background:"var(--p-blue)",color:"var(--p-white)",fontFamily:"inherit",transition:"background .15s"},onMouseOver:I=>{I.currentTarget.style.background="var(--p-blue-700)"},onMouseOut:I=>{I.currentTarget.style.background="var(--p-blue)"},children:"Add Task"})]}):(0,E.jsx)("span",{style:{fontSize:11,color:"var(--p-text-g)",padding:"5px 4px"},children:"Changes are saved automatically"})]}),(0,E.jsx)(Qt,{open:Ls,title:"Delete task?",message:`You are about to permanently delete "${(t==null?void 0:t.title)||"this task"}". This action cannot be undone.`,confirmLabel:"Delete task",onConfirm:()=>{Cr(!1),p(t.id),d()},onCancel:()=>Cr(!1)})]}),Tt&&(0,E.jsx)("div",{style:{position:"fixed",inset:0,zIndex:201,display:"flex",alignItems:"center",justifyContent:"center",backdropFilter:"blur(8px)",WebkitBackdropFilter:"blur(8px)",background:"rgba(2,12,27,0.80)"},children:(0,E.jsxs)("div",{style:{background:"var(--p-surface)",border:"1px solid var(--p-border-s)",borderRadius:16,padding:"28px 32px",width:"100%",maxWidth:480,boxShadow:"var(--p-shadow-lg)",position:"relative"},children:[(0,E.jsx)("div",{style:{width:44,height:44,borderRadius:12,background:"rgba(139,92,246,0.12)",border:"1px solid rgba(139,92,246,0.25)",display:"flex",alignItems:"center",justifyContent:"center",marginBottom:16},children:(0,E.jsx)(uo,{style:{width:20,height:20,color:"var(--p-purple)"}})}),(0,E.jsx)("h2",{style:{margin:"0 0 8px",fontSize:17,fontWeight:700,color:"var(--p-text)"},children:"Send comment?"}),(0,E.jsx)("p",{style:{margin:"0 0 22px",fontSize:13,color:"var(--p-text-f)",lineHeight:1.6},children:"You have an unsent comment. Do you want to send it before closing?"}),(0,E.jsxs)("div",{style:{display:"flex",gap:8},children:[(0,E.jsx)("button",{onClick:()=>{Zt(!1),br().then(()=>d())},style:{flex:1,padding:"9px 14px",borderRadius:8,background:"var(--p-purple)",border:"none",color:"#fff",fontSize:13,fontWeight:600,cursor:"pointer",whiteSpace:"nowrap"},children:"Send & Close"}),(0,E.jsx)("button",{type:"button",onClick:()=>{Zt(!1),wr(""),d()},style:{padding:"9px 16px",borderRadius:8,background:"var(--p-hover)",border:"1px solid var(--p-border)",color:"var(--p-text-m)",fontSize:13,cursor:"pointer"},children:"Discard & Close"}),(0,E.jsx)("button",{type:"button",onClick:()=>Zt(!1),style:{padding:"9px 16px",borderRadius:8,background:"var(--p-hover)",border:"1px solid var(--p-border)",color:"var(--p-text-m)",fontSize:13,cursor:"pointer"},children:"Keep editing"})]})]})})]})}function sv({task:e}){let t=[];if(e.component&&t.push((0,E.jsxs)("span",{style:{display:"inline-flex",alignItems:"center",gap:4,padding:"2px 8px",background:"color-mix(in srgb, var(--p-purple) 14%, transparent)",border:"1px solid color-mix(in srgb, var(--p-purple) 36%, transparent)",borderRadius:100,fontSize:10,color:"var(--p-purple-300)",fontFamily:"monospace"},children:["\\u2B21 ",e.component]},"component")),e.file||e.selector&&e.selector!=="/"||e.cssSelector){let r=e.file??"";e.line!=null&&(r+=`:${e.line}`),e.col!=null&&(r+=`:${e.col}`);let o=e.cssSelector??(e.selector&&e.selector!=="/"?e.selector:""),n=r||o;if(n){let l=n.length>40?`\\u2026${n.slice(-40)}`:n,s=e.url?e.url.length>30?`\\u2026${e.url.slice(-30)}`:e.url:"";t.push((0,E.jsxs)("span",{style:{display:"inline-flex",alignItems:"center",gap:0,borderRadius:6,overflow:"hidden",border:"1px solid color-mix(in srgb, var(--p-blue) 15%, transparent)",fontSize:10,fontFamily:"monospace",whiteSpace:"nowrap"},children:[(0,E.jsx)("span",{title:[r,o].filter(Boolean).join(" \\xB7 "),style:{padding:"2px 6px",background:"color-mix(in srgb, var(--p-blue) 10%, transparent)",color:"var(--p-blue-300)"},children:l}),s&&(0,E.jsx)("span",{title:e.url,style:{padding:"2px 6px",background:"color-mix(in srgb, var(--p-border) 72%, transparent)",color:"var(--p-text-g)",borderLeft:"1px solid color-mix(in srgb, var(--p-blue) 18%, transparent)"},children:s})]},"source"))}}else if(e.url){let r=e.url.length>40?`\\u2026${e.url.slice(-40)}`:e.url;t.push((0,E.jsx)("span",{className:"dp-source-pill",title:e.url,children:r},"url"))}return e.reportBack&&t.push((0,E.jsx)("span",{style:{display:"inline-flex",alignItems:"center",gap:4,padding:"2px 8px",background:"color-mix(in srgb, var(--p-purple) 10%, transparent)",border:"1px solid color-mix(in srgb, var(--p-purple) 24%, transparent)",borderRadius:100,fontSize:10,color:"var(--p-purple-300)"},children:"\\u21A9 report back"},"rb")),(0,E.jsx)("div",{id:"dp-meta-row",style:{display:"flex",alignItems:"center",gap:6,flexWrap:"wrap",flex:1},children:t})}var Sr=A(Ce(),1);var Y=A(q(),1),uv=[{id:"all",label:"All",dot:""},{id:"todo",label:"Todo",dot:"var(--p-amber)"},{id:"in-progress",label:"In Progress",dot:"var(--p-blue)"},{id:"review",label:"Review",dot:"var(--p-purple)"}],iv={todo:{background:"color-mix(in srgb, var(--p-amber) 16%, transparent)",border:"1px solid color-mix(in srgb, var(--p-amber) 38%, transparent)",color:"var(--p-amber-300)"},"in-progress":{background:"color-mix(in srgb, var(--p-blue) 16%, transparent)",border:"1px solid color-mix(in srgb, var(--p-blue) 38%, transparent)",color:"var(--p-blue-200)"},review:{background:"color-mix(in srgb, var(--p-purple) 16%, transparent)",border:"1px solid color-mix(in srgb, var(--p-purple) 38%, transparent)",color:"var(--p-purple-300)"},done:{background:"color-mix(in srgb, var(--p-green) 14%, transparent)",border:"1px solid color-mix(in srgb, var(--p-green) 32%, transparent)",color:"var(--p-green-300)"},backlog:{background:"color-mix(in srgb, var(--p-text-g) 16%, transparent)",border:"1px solid color-mix(in srgb, var(--p-text-g) 32%, transparent)",color:"var(--p-text-m)"},all:{background:"color-mix(in srgb, var(--p-blue) 12%, transparent)",border:"1px solid color-mix(in srgb, var(--p-blue) 32%, transparent)",color:"var(--p-blue-200)"}};function id({tasks:e,filter:t,onFilter:a,view:r="board",onViewChange:o,activityCounter:n}){let[l,s]=Sr.default.useState(!1),[u,d]=Sr.default.useState(!1),[g,m]=Sr.default.useState(!1),p=Sr.default.useMemo(()=>[...new Set(e.map(h=>h.type).filter(Boolean))].sort(),[e]),v=Sr.default.useMemo(()=>[...new Set(e.map(h=>h.author).filter(Boolean))].sort(),[e]),L=Sr.default.useMemo(()=>{let h=new Set;for(let w of e)for(let b of w.tags??[])h.add(b);return[...h].sort()},[e]);function S(h){return e.filter(w=>w.status===h).length}function z(h){a({...t,status:h}),s(!1),d(!1),m(!1)}function c(h){a({...t,type:h}),s(!1)}function i(h){a({...t,user:h}),d(!1)}function f(h){let w=t.tags??[],b=w.includes(h)?w.filter(M=>M!==h):[...w,h];a({...t,tags:b})}function y(h){h.stopPropagation();let w=h.currentTarget.dataset.status;w&&z(w)}let C={display:"flex",alignItems:"center",gap:5,padding:"3px 10px",borderRadius:6,fontSize:11,cursor:"pointer",border:"1px solid transparent",background:"transparent",color:"var(--p-text-f)",transition:"all .12s",fontFamily:"inherit",fontWeight:500},k={...C,background:"var(--p-card)",border:"1px solid var(--p-border)",color:"var(--p-text-f)",padding:"3px 10px",position:"relative"};return(0,Y.jsxs)("div",{"data-proto-id":"filter-bar",style:{display:"flex",alignItems:"center",gap:6,padding:"7px 16px",background:"var(--p-surface)",borderBottom:"1px solid var(--p-border)",flexShrink:0},onClick:()=>{s(!1),d(!1),m(!1)},children:[(0,Y.jsx)("div",{style:{display:"flex",alignItems:"center",gap:2},children:uv.map(h=>{let w=t.status===h.id,b=h.id!=="all"?S(h.id):null,M=w?iv[h.id]:{};return(0,Y.jsxs)("button",{"data-status":h.id,style:{...C,...M},onMouseOver:R=>{w||(R.currentTarget.style.background="var(--p-hover)",R.currentTarget.style.color="var(--p-text-m)")},onMouseOut:R=>{w||(R.currentTarget.style.background="transparent",R.currentTarget.style.color="var(--p-text-f)")},onClick:y,children:[h.dot&&(0,Y.jsx)("span",{style:{width:6,height:6,borderRadius:"50%",background:h.dot,flexShrink:0,display:"inline-block"}}),h.label,b!=null&&(0,Y.jsx)("span",{style:{color:w?"inherit":"var(--p-border-t)",fontSize:10,opacity:.8},children:b})]},h.id)})}),(0,Y.jsx)("div",{style:{flex:1}}),n,t.user&&(0,Y.jsxs)("span",{style:{display:"inline-flex",alignItems:"center",gap:4,padding:"2px 8px",borderRadius:100,background:"color-mix(in srgb, var(--p-purple) 10%, transparent)",border:"1px solid color-mix(in srgb, var(--p-purple) 24%, transparent)",fontSize:10,color:"var(--p-purple-300)"},children:[t.user,(0,Y.jsx)("button",{onClick:()=>i(null),style:{display:"flex",background:"none",border:"none",color:"var(--p-purple-300)",cursor:"pointer",padding:0,lineHeight:1},children:(0,Y.jsx)(Ne,{style:{width:10,height:10}})})]}),t.type&&(0,Y.jsxs)("span",{style:{display:"inline-flex",alignItems:"center",gap:4,padding:"2px 8px",borderRadius:100,background:"color-mix(in srgb, var(--p-blue) 10%, transparent)",border:"1px solid color-mix(in srgb, var(--p-blue) 24%, transparent)",fontSize:10,color:"var(--p-cyan-300)"},children:[t.type,(0,Y.jsx)("button",{onClick:()=>c(null),style:{display:"flex",background:"none",border:"none",color:"var(--p-cyan-300)",cursor:"pointer",padding:0,lineHeight:1},children:(0,Y.jsx)(Ne,{style:{width:10,height:10}})})]}),(t.tags??[]).map(h=>{let{bg:w,text:b,border:M}=Ut(h);return(0,Y.jsxs)("span",{style:{display:"inline-flex",alignItems:"center",gap:4,padding:"2px 8px",borderRadius:100,background:w,border:`1px solid ${M}`,fontSize:10,color:b,fontWeight:600},children:[h,(0,Y.jsx)("button",{onClick:()=>f(h),style:{display:"flex",background:"none",border:"none",color:b,cursor:"pointer",padding:0,lineHeight:1},children:(0,Y.jsx)(Ne,{style:{width:10,height:10}})})]},h)}),(0,Y.jsxs)("div",{style:{position:"relative"},children:[(0,Y.jsxs)("button",{style:{...k,color:(t.tags??[]).length?"var(--p-green-300)":"var(--p-text-f)",borderColor:(t.tags??[]).length?"color-mix(in srgb, var(--p-green) 36%, transparent)":"var(--p-border)",opacity:L.length?1:.55},onClick:h=>{h.stopPropagation(),L.length&&(d(!1),s(!1),m(w=>!w))},children:[(0,Y.jsx)(so,{style:{width:12,height:12}}),"Tags",(t.tags??[]).length>0&&(0,Y.jsx)("span",{style:{fontSize:9,background:"color-mix(in srgb, var(--p-green) 20%, transparent)",color:"var(--p-green-300)",borderRadius:100,padding:"0 4px"},children:(t.tags??[]).length}),(0,Y.jsx)(cr,{style:{width:12,height:12}})]}),g&&L.length>0&&(0,Y.jsxs)("div",{style:{position:"absolute",top:"calc(100% + 4px)",right:0,minWidth:160,background:"var(--p-card)",border:"1px solid var(--p-border-s)",borderRadius:8,boxShadow:"0 8px 24px rgba(0,0,0,0.25)",zIndex:50,overflow:"hidden"},onClick:h=>h.stopPropagation(),children:[(t.tags??[]).length>0&&(0,Y.jsx)("button",{style:{width:"100%",textAlign:"left",padding:"7px 12px",fontSize:11,color:"var(--p-text-f)",background:"none",border:"none",cursor:"pointer",borderBottom:"1px solid var(--p-border)"},onClick:()=>a({...t,tags:[]}),children:"Clear tag filters"}),L.map(h=>{let{bg:w,text:b,border:M}=Ut(h),R=(t.tags??[]).includes(h);return(0,Y.jsxs)("button",{style:{width:"100%",textAlign:"left",padding:"6px 12px",fontSize:11,color:"var(--p-text-m)",background:R?"var(--p-hover)":"none",border:"none",cursor:"pointer",display:"flex",alignItems:"center",gap:6},onMouseEnter:F=>{F.currentTarget.style.background="var(--p-hover)"},onMouseLeave:F=>{F.currentTarget.style.background=R?"var(--p-hover)":"none"},onClick:()=>f(h),children:[(0,Y.jsx)("span",{style:{width:8,height:8,borderRadius:"50%",background:b,border:`1px solid ${M}`,flexShrink:0}}),(0,Y.jsx)("span",{style:{flex:1},children:h}),R&&(0,Y.jsx)("span",{style:{color:b,fontSize:12,lineHeight:1},children:"\\u2713"})]},h)})]})]}),(0,Y.jsxs)("div",{style:{position:"relative"},children:[(0,Y.jsxs)("button",{style:{...k,color:t.user?"var(--p-purple-300)":"var(--p-text-f)",borderColor:t.user?"color-mix(in srgb, var(--p-purple) 36%, transparent)":"var(--p-border)",opacity:v.length?1:.55},onClick:h=>{h.stopPropagation(),v.length&&(s(!1),d(w=>!w))},children:[(0,Y.jsx)(In,{style:{width:12,height:12}}),"User",(0,Y.jsx)(cr,{style:{width:12,height:12}})]}),u&&v.length>0&&(0,Y.jsxs)("div",{style:{position:"absolute",top:"calc(100% + 4px)",right:0,minWidth:160,background:"var(--p-card)",border:"1px solid var(--p-border-s)",borderRadius:8,boxShadow:"0 8px 24px rgba(0,0,0,0.25)",zIndex:50,overflow:"hidden"},onClick:h=>h.stopPropagation(),children:[(0,Y.jsx)("button",{style:{width:"100%",textAlign:"left",padding:"7px 12px",fontSize:11,color:"var(--p-text-f)",background:"none",border:"none",cursor:"pointer",borderBottom:"1px solid var(--p-border)"},onClick:()=>i(null),children:"All users"}),v.map(h=>(0,Y.jsx)("button",{style:{width:"100%",textAlign:"left",padding:"7px 12px",fontSize:11,color:t.user===h?"var(--p-purple-300)":"var(--p-text-m)",background:t.user===h?"color-mix(in srgb, var(--p-purple) 12%, transparent)":"none",border:"none",cursor:"pointer"},onMouseOver:w=>{t.user!==h&&(w.currentTarget.style.background="var(--p-hover)")},onMouseOut:w=>{t.user!==h&&(w.currentTarget.style.background="none")},onClick:()=>i(h),children:h},h))]})]}),(0,Y.jsxs)("div",{style:{position:"relative"},children:[(0,Y.jsxs)("button",{style:{...k,color:t.type?"var(--p-cyan-300)":"var(--p-text-f)",borderColor:t.type?"color-mix(in srgb, var(--p-blue) 36%, transparent)":"var(--p-border)",opacity:p.length?1:.55},onClick:h=>{h.stopPropagation(),p.length&&s(w=>!w)},children:[(0,Y.jsx)(so,{style:{width:12,height:12}}),"Type",(0,Y.jsx)(cr,{style:{width:12,height:12}})]}),l&&p.length>0&&(0,Y.jsxs)("div",{style:{position:"absolute",top:"calc(100% + 4px)",right:0,minWidth:140,background:"var(--p-card)",border:"1px solid var(--p-border-s)",borderRadius:8,boxShadow:"0 8px 24px rgba(0,0,0,0.25)",zIndex:50,overflow:"hidden"},onClick:h=>h.stopPropagation(),children:[(0,Y.jsx)("button",{style:{width:"100%",textAlign:"left",padding:"7px 12px",fontSize:11,color:"var(--p-text-f)",background:"none",border:"none",cursor:"pointer",borderBottom:"1px solid var(--p-border)"},onClick:()=>c(null),children:"All types"}),p.map(h=>(0,Y.jsx)("button",{style:{width:"100%",textAlign:"left",padding:"7px 12px",fontSize:11,color:t.type===h?"var(--p-cyan-300)":"var(--p-text-m)",background:t.type===h?"color-mix(in srgb, var(--p-blue) 12%, transparent)":"none",border:"none",cursor:"pointer"},onMouseOver:w=>{t.type!==h&&(w.currentTarget.style.background="var(--p-hover)")},onMouseOut:w=>{t.type!==h&&(w.currentTarget.style.background="none")},onClick:()=>c(h),children:h},h))]})]}),(0,Y.jsxs)("div",{style:{display:"flex",alignItems:"center",background:"var(--p-card)",border:"1px solid var(--p-border)",borderRadius:8,padding:2,gap:0},children:[(0,Y.jsx)("button",{title:"Board view",style:{padding:"4px 7px",borderRadius:5,background:r==="board"?"var(--p-surface)":"none",color:r==="board"?"var(--p-text-sub)":"var(--p-text-g)",border:"none",cursor:"pointer",display:"flex",alignItems:"center",transition:"background .12s,color .12s"},onClick:h=>{h.stopPropagation(),o==null||o("board")},children:(0,Y.jsx)(xn,{style:{width:13,height:13}})}),(0,Y.jsx)("button",{title:"List view",style:{padding:"4px 7px",borderRadius:5,background:r==="list"?"var(--p-surface)":"none",color:r==="list"?"var(--p-text-sub)":"var(--p-text-g)",border:"none",cursor:"pointer",display:"flex",alignItems:"center",transition:"background .12s,color .12s"},onClick:h=>{h.stopPropagation(),o==null||o("list")},children:(0,Y.jsx)(vn,{style:{width:13,height:13}})})]})]})}var Wa=A(Ce(),1);var fe=A(q(),1),dv=[{id:"board",label:"Board",icon:(0,fe.jsx)(Oa,{className:"w-3.5 h-3.5"})},{id:"workflow",label:"Workflow",icon:(0,fe.jsx)(Cn,{className:"w-3.5 h-3.5"})}];function dd({open:e,visibleCols:t,settings:a,onClose:r,onSave:o}){let[n,l]=Wa.default.useState("board"),[s,u]=Wa.default.useState({}),[d,g]=Wa.default.useState(a.autoCommit??!1),[m,p]=Wa.default.useState(a.autoComment??!1),[v,L]=Wa.default.useState(a.autoPush??!1),[S,z]=Wa.default.useState(a.createBranch??!1);Wa.default.useEffect(()=>{if(!e)return;let f={};Ua.forEach(y=>{f[y.id]=t.includes(y.id)}),u(f),g(a.autoCommit??!1),p(a.autoComment??!1),L(a.autoPush??!1),z(a.createBranch??!1),l("board")},[e,t,a]);function c(){let f=Ua.filter(y=>s[y.id]).map(y=>y.id);o(f,{autoCommit:d,autoComment:m,autoPush:v,createBranch:S}),r()}function i(f){u(y=>({...y,[f]:!y[f]}))}return(0,fe.jsxs)(yr,{open:e,onClose:r,id:"settings-modal",width:"min(460px, 95vw)",icon:(0,fe.jsx)(hr,{style:{width:14,height:14,color:"var(--p-text-g)"}}),title:"Settings",headerActions:(0,fe.jsx)("button",{id:"settings-close",onClick:r,style:{width:26,height:26,display:"flex",alignItems:"center",justifyContent:"center",borderRadius:6,border:"none",background:"transparent",color:"var(--p-text-g)",cursor:"pointer",transition:"background .12s,color .12s"},onMouseOver:f=>{f.currentTarget.style.background="var(--p-surface)",f.currentTarget.style.color="var(--p-text-m)"},onMouseOut:f=>{f.currentTarget.style.background="transparent",f.currentTarget.style.color="var(--p-text-g)"},children:(0,fe.jsx)(Ne,{style:{width:14,height:14}})}),footer:(0,fe.jsxs)("div",{style:{display:"flex",gap:8},children:[(0,fe.jsx)("button",{id:"settings-cancel",onClick:r,className:"dp-status-btn",style:{padding:"5px 14px",fontSize:12},children:"Cancel"}),(0,fe.jsx)("button",{id:"settings-apply",onClick:c,style:{padding:"5px 14px",fontSize:12,fontWeight:500,borderRadius:6,border:"1px solid color-mix(in srgb, var(--p-purple) 55%, transparent)",background:"color-mix(in srgb, var(--p-purple) 18%, transparent)",color:"var(--p-purple-300)",cursor:"pointer",transition:"background .12s"},onMouseOver:f=>{f.currentTarget.style.background="color-mix(in srgb, var(--p-purple) 28%, transparent)"},onMouseOut:f=>{f.currentTarget.style.background="color-mix(in srgb, var(--p-purple) 18%, transparent)"},children:"Apply"})]}),children:[(0,fe.jsx)("div",{className:"dp-tabs",children:dv.map(f=>(0,fe.jsxs)("button",{onClick:()=>l(f.id),className:`dp-tab${n===f.id?" active":""}`,style:{display:"flex",alignItems:"center",gap:6},children:[f.icon,f.label]},f.id))}),n==="board"&&(0,fe.jsxs)("div",{style:{padding:"14px 16px",display:"flex",flexDirection:"column",gap:10},children:[(0,fe.jsx)("div",{className:"dp-meta-label",children:"Visible Columns"}),Ua.map(f=>(0,fe.jsxs)("label",{style:{display:"flex",alignItems:"center",gap:10,cursor:"pointer",userSelect:"none"},children:[(0,fe.jsx)("input",{id:`settings-col-${f.id}`,type:"checkbox",checked:s[f.id]??!0,onChange:()=>i(f.id),style:{width:14,height:14,accentColor:f.color,cursor:"pointer"}}),(0,fe.jsx)("span",{style:{width:8,height:8,borderRadius:"50%",background:f.color,flexShrink:0}}),(0,fe.jsx)("span",{style:{fontSize:13,color:"var(--p-text-m)"},children:f.label})]},f.id))]}),n==="workflow"&&(0,fe.jsxs)("div",{style:{padding:"14px 16px",display:"flex",flexDirection:"column",gap:16},children:[(0,fe.jsx)(xs,{id:"settings-auto-commit",label:"Commit after task implementation",description:"Agent is instructed to stage and commit changes after each task.",value:d,onChange:g}),(0,fe.jsx)(xs,{id:"settings-auto-push",label:"Push after task commit",description:`Agent is instructed to push after every commit. Requires \'Commit\' to be ON.${d?"":" (Enable Commit first)"}`,value:v&&d,onChange:f=>L(f&&d)}),(0,fe.jsx)(xs,{id:"settings-auto-comment",label:"Comment after task implementation",description:"Agent is instructed to add a summary comment after completing a task.",value:m,onChange:p}),(0,fe.jsx)(xs,{id:"settings-create-branch",label:"Create branch at end of session",description:"Agent creates a descriptive branch after all session tasks are done (e.g. fix/bug-errors, feat/eye-toggle). Name reflects the work: lowercase, kebab-case, 2\\u20135 words, prefix fix/feat/chore/docs.",value:S,onChange:z})]})]})}function xs({id:e,label:t,description:a,value:r,onChange:o}){return(0,fe.jsxs)("div",{children:[(0,fe.jsx)("div",{className:"dp-meta-label",style:{marginBottom:4},children:t}),(0,fe.jsx)("div",{style:{fontSize:11,color:"var(--p-text-g)",marginBottom:10},children:a}),(0,fe.jsxs)("div",{id:e,style:{display:"flex",alignItems:"center",gap:10,cursor:"pointer"},onClick:()=>o(!r),children:[(0,fe.jsxs)("div",{style:{position:"relative",width:36,height:20,flexShrink:0},children:[(0,fe.jsx)("div",{style:{width:36,height:20,borderRadius:10,background:r?"var(--p-purple)":"var(--p-card)",border:`1px solid ${r?"var(--p-purple-300)":"var(--p-border)"}`,transition:"all .15s"}}),(0,fe.jsx)("div",{style:{position:"absolute",top:3,left:r?18:3,width:14,height:14,borderRadius:"50%",background:r?"var(--p-purple-300)":"var(--p-text-muted)",transition:"all .15s"}})]}),(0,fe.jsx)("span",{style:{fontSize:12,color:"var(--p-text-g)"},children:r?"On":"Off"})]})]})}var ys=A(Ce(),1);var he=A(q(),1);function bm(e){return/\\.(png|jpe?g|gif|webp|svg|avif)$/i.test(e)}function vs(e){return/\\.md$/i.test(e)}function fd({open:e,name:t,url:a,onClose:r}){let[o,n]=ys.default.useState(null),[l,s]=ys.default.useState(!1);return ys.default.useEffect(()=>{!e||!a||(vs(t)?(s(!0),n(null),fetch(a).then(u=>u.text()).then(u=>{n(u),s(!1)}).catch(()=>{n("Error loading file."),s(!1)})):n(null))},[e,t,a]),(0,he.jsx)(yr,{open:e,onClose:r,id:"file-preview-modal",width:"min(700px, 95vw)",maxHeight:"88vh",boxStyle:{display:"flex",flexDirection:"column"},icon:(0,he.jsx)(lo,{className:"w-4 h-4 text-slate-400"}),title:t,headerActions:(0,he.jsxs)(he.Fragment,{children:[(0,he.jsx)("a",{href:a,download:t,className:"text-slate-400 hover:text-slate-200 transition-colors p-1.5 rounded-md hover:bg-slate-700/60",title:"Download",children:(0,he.jsx)(pr,{className:"w-4 h-4"})}),(0,he.jsx)("button",{id:"file-preview-close",onClick:r,className:"text-slate-400 hover:text-slate-200 transition-colors p-1.5 rounded-md hover:bg-slate-700/60",title:"Close",children:(0,he.jsx)(Ne,{className:"w-4 h-4"})})]}),footer:(0,he.jsxs)(he.Fragment,{children:[(0,he.jsxs)("a",{href:a,download:t,className:"flex items-center gap-1.5 border border-slate-700 hover:bg-slate-800 text-slate-300 text-sm px-3 py-1.5 rounded-lg transition-colors",children:[(0,he.jsx)(pr,{className:"w-3.5 h-3.5"}),"Download"]}),(0,he.jsx)("button",{id:"file-preview-close-footer",onClick:r,className:"border border-slate-700 hover:bg-slate-800 text-slate-300 text-sm px-4 py-1.5 rounded-lg transition-colors",children:"Close"})]}),children:(0,he.jsxs)("div",{className:"flex-1 overflow-auto",style:{minHeight:0,padding:"16px 20px"},children:[bm(t)&&(0,he.jsx)("div",{style:{borderRadius:8,overflow:"hidden",border:"1px solid var(--p-border)",background:"var(--p-card)",display:"inline-block",width:"100%"},children:(0,he.jsx)("img",{src:a,alt:t,style:{maxWidth:"100%",display:"block",margin:"0 auto",objectFit:"contain"}})}),vs(t)&&l&&(0,he.jsx)("p",{className:"text-xs text-slate-500 py-4",children:"Loading\\u2026"}),vs(t)&&!l&&o!==null&&(0,he.jsx)("div",{id:"file-preview-md",style:{background:"var(--p-input)",border:"1px solid var(--p-border-s)",borderRadius:8,padding:"10px 14px",fontSize:13,color:"var(--p-text-sub)",lineHeight:1.65},children:(0,he.jsx)(_a,{markdown:o})}),!bm(t)&&!vs(t)&&(0,he.jsxs)("div",{className:"flex flex-col items-center justify-center gap-3 py-12 text-slate-500",children:[(0,he.jsx)(lo,{className:"w-10 h-10 opacity-40"}),(0,he.jsx)("p",{className:"text-sm",children:"Preview not available for this file type."}),(0,he.jsxs)("a",{href:a,download:t,className:"flex items-center gap-1.5 text-violet-400 hover:text-violet-300 hover:underline text-sm transition-colors",children:[(0,he.jsx)(pr,{className:"w-3.5 h-3.5"}),"Download file"]})]})]})})}var go=window.location.origin,Ht=`${go}/api/tasks`,mt={async getTasks(){return(await fetch(`${Ht}?_=${Date.now()}`,{cache:"no-store"})).json()},async createTask(e){return(await fetch(Ht,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)})).json()},async updateTask(e,t){return(await fetch(`${Ht}/${e}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)})).json()},async deleteTask(e){await fetch(`${Ht}/${e}`,{method:"DELETE"})},async getComments(e){return(await fetch(`${Ht}/${e}/comments`)).json()},async addComment(e,t){await fetch(`${Ht}/${e}/comments`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({author:"user",text:t,source:"web"})})},async updateComment(e,t,a){await fetch(`${Ht}/${e}/comments/${t}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({text:a})})},async deleteComment(e,t){await fetch(`${Ht}/${e}/comments/${t}`,{method:"DELETE"})},async getFiles(e){return(await fetch(`${Ht}/${e}/files`)).json()},async uploadFile(e,t){let a=await t.arrayBuffer();await fetch(`${Ht}/${e}/files/${encodeURIComponent(t.name)}`,{method:"POST",headers:{"Content-Type":"application/octet-stream"},body:a})},async deleteFile(e,t){await fetch(`${Ht}/${e}/files/${encodeURIComponent(t)}`,{method:"DELETE"})},async getProject(){return(await fetch(`${go}/api/project`)).json()},async getCopilotStatus(){return(await fetch(`${go}/api/copilot/status`)).json()},async copilotLogin(){return(await fetch(`${go}/api/copilot/login`,{method:"POST"})).json().catch(()=>({}))},async getSettings(){return(await fetch(`${go}/api/settings`,{cache:"no-store"})).json()},async saveSettings(e){await fetch(`${go}/api/settings`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)})},wsUrl(){return`${window.location.protocol==="https:"?"wss:":"ws:"}//${window.location.host}`}};var j=A(q(),1),fv=window.__PORT__??3700,cv=window.__SAAS_MODE__??!1,Pm=window.__BOARD_URL__??"",pv=window.__BOARD_NAME__??"",Dm=window.__IS_ADMIN__??!1;function mv({onClose:e}){let t=window.location.origin,[a,r]=re.default.useState("idle"),[o,n]=re.default.useState(!0),[l,s]=re.default.useState(null),[u,d]=re.default.useState("");async function g(){r("pushing"),d("");try{let p=await fetch(`${t}/api/push`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({keepLocalFiles:o})}),v=await p.json();if(!p.ok){d(v.error??"Push failed"),r("error");return}s({imported:v.imported??0,skipped:v.skipped}),r("done")}catch(p){d(p instanceof Error?p.message:"Network error"),r("error")}}let m=a==="pushing";return(0,j.jsx)("div",{style:{position:"fixed",inset:0,zIndex:9999,background:"rgba(5, 8, 18, 0.72)",backdropFilter:"blur(10px)",display:"flex",alignItems:"center",justifyContent:"center",padding:20,fontFamily:"Inter, system-ui, -apple-system, sans-serif"},children:(0,j.jsxs)("div",{style:{background:"#101827",border:"1px solid rgba(255,255,255,0.07)",borderRadius:24,maxWidth:380,width:"100%",boxShadow:"0 0 0 1px rgba(59,130,246,0.07), 0 40px 80px rgba(0,0,0,0.75)",overflow:"hidden",position:"relative"},children:[(0,j.jsx)("div",{style:{position:"absolute",top:0,left:"20%",right:"20%",height:1,background:"linear-gradient(90deg, transparent, rgba(59,130,246,0.5), transparent)"}}),(0,j.jsxs)("div",{style:{padding:"36px 36px 20px",display:"flex",flexDirection:"column",alignItems:"center",textAlign:"center"},children:[(0,j.jsx)("div",{style:{position:"relative",width:52,height:52,marginBottom:22},children:(0,j.jsxs)("svg",{width:"52",height:"52",viewBox:"0 0 18 18",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,j.jsx)("rect",{width:"18",height:"18",rx:"4",fill:"#2563eb"}),(0,j.jsx)("rect",{x:"2.5",y:"5",width:"2",height:"8",rx:"1",fill:"white",opacity:"0.7"}),(0,j.jsx)("rect",{x:"6.5",y:"2",width:"2",height:"14",rx:"1",fill:"white"}),(0,j.jsx)("rect",{x:"10.5",y:"6",width:"2",height:"6",rx:"1",fill:"white",opacity:"0.7"}),(0,j.jsx)("rect",{x:"14.5",y:"4",width:"2",height:"10",rx:"1",fill:"white",opacity:"0.85"})]})}),(0,j.jsx)("h1",{style:{fontSize:18,fontWeight:700,color:"#f1f5f9",letterSpacing:"-0.3px",margin:"0 0 7px"},children:"Online Mode Active"}),(0,j.jsxs)("p",{style:{fontSize:12,color:"rgba(255,255,255,0.36)",lineHeight:1.5,margin:0},children:["Connected to"," ",(0,j.jsx)("strong",{style:{color:"rgba(255,255,255,0.55)",fontWeight:500},children:pv||"Vibeflow SaaS"})]})]}),a==="done"&&l&&(0,j.jsxs)("div",{style:{margin:"0 28px 0",padding:"10px 14px",borderRadius:9,fontSize:12,display:"flex",alignItems:"center",gap:9,background:"rgba(16,185,129,0.08)",border:"1px solid rgba(16,185,129,0.18)",color:"#34d399"},children:[(0,j.jsx)("svg",{width:"13",height:"13",viewBox:"0 0 16 16",fill:"none",children:(0,j.jsx)("path",{d:"M13 5L6.5 11.5 3 8",stroke:"#34d399",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round"})}),l.imported," task",l.imported!==1?"s":""," pushed to board",l.skipped!=null&&l.skipped>0?` \\xB7 ${l.skipped} already existed`:""]}),a==="error"&&u&&(0,j.jsx)("div",{style:{margin:"0 28px 0",padding:"10px 14px",borderRadius:9,fontSize:12,display:"flex",alignItems:"center",gap:9,background:"rgba(239,68,68,0.08)",border:"1px solid rgba(239,68,68,0.18)",color:"#f87171"},children:u}),(0,j.jsxs)("div",{style:{padding:"20px 24px 28px",display:"flex",flexDirection:"column",gap:8},children:[Pm&&(0,j.jsx)("a",{href:Pm,target:"_blank",rel:"noopener noreferrer",style:{display:"flex",alignItems:"center",justifyContent:"center",gap:9,padding:14,background:"#2563eb",border:"none",borderRadius:12,color:"#fff",fontSize:14,fontWeight:600,cursor:"pointer",textDecoration:"none",letterSpacing:"-0.1px",transition:"background 0.15s, transform 0.1s"},onMouseEnter:p=>{p.currentTarget.style.background="#3b82f6",p.currentTarget.style.transform="translateY(-1px)"},onMouseLeave:p=>{p.currentTarget.style.background="#2563eb",p.currentTarget.style.transform="none"},children:"Open Web App \\u2192"}),a!=="done"&&(0,j.jsx)("button",{onClick:()=>void g(),disabled:m,style:{display:"flex",alignItems:"center",justifyContent:"center",gap:9,padding:12,background:"transparent",border:"1px solid rgba(255,255,255,0.08)",borderRadius:12,color:m?"rgba(255,255,255,0.25)":"rgba(255,255,255,0.4)",fontSize:13,fontWeight:500,cursor:m?"not-allowed":"pointer",transition:"border-color 0.15s, color 0.15s, background 0.15s"},onMouseEnter:p=>{m||(p.currentTarget.style.borderColor="rgba(255,255,255,0.15)",p.currentTarget.style.color="rgba(255,255,255,0.65)",p.currentTarget.style.background="rgba(255,255,255,0.03)")},onMouseLeave:p=>{m||(p.currentTarget.style.borderColor="rgba(255,255,255,0.08)",p.currentTarget.style.color="rgba(255,255,255,0.4)",p.currentTarget.style.background="transparent")},children:m?"\\u23F3 Pushing\\u2026":"\\u2191 Push local tasks"})]}),(0,j.jsxs)("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"0 24px 20px"},children:[(0,j.jsxs)("label",{style:{display:"flex",alignItems:"center",gap:7,cursor:"pointer"},children:[(0,j.jsx)("input",{type:"checkbox",checked:o,onChange:p=>n(p.target.checked),style:{accentColor:"#2563eb",width:13,height:13,cursor:"pointer"}}),(0,j.jsx)("span",{style:{fontSize:11.5,color:"rgba(255,255,255,0.28)"},children:"Keep local files"})]}),Dm&&e&&(0,j.jsx)("button",{onClick:e,style:{fontSize:11,color:"rgba(255,255,255,0.2)",background:"none",border:"none",cursor:"pointer",textDecoration:"underline",textUnderlineOffset:2,transition:"color 0.15s"},onMouseEnter:p=>{p.currentTarget.style.color="rgba(255,255,255,0.45)"},onMouseLeave:p=>{p.currentTarget.style.color="rgba(255,255,255,0.2)"},children:"Dismiss (admin)"})]})]})})}var Tm={backlog:"Backlog",todo:"Todo","in-progress":"In Progress",review:"Review",done:"Done"};function gv(e,t,a){let r=a?e.filter(s=>{var u,d;return((u=s.title)==null?void 0:u.toLowerCase().includes(a))||((d=s.description)==null?void 0:d.toLowerCase().includes(a))}):e;if(a)return`${r.length} of ${e.length} tasks`;let o=r.filter(s=>s.status!=="done").length,n=r.filter(s=>s.status==="in-progress").length,l=r.filter(s=>s.status==="review").length;return`${o} open \\xB7 ${n} in-progress \\xB7 ${l} in review`}function Mm(){var Ka,vo;let[e,t]=re.default.useState([]),[a,r]=re.default.useState(!0),[o,n]=re.default.useState(!1),[l,s]=re.default.useState({open:!1,task:null,tab:"details"}),[u,d]=re.default.useState("board"),[g,m]=re.default.useState(!1),[p,v]=re.default.useState({open:!1,name:"",url:""}),[L,S]=re.default.useState(420),[z,c]=re.default.useState(!1),[i,f]=re.default.useState(""),[y,C]=re.default.useState(Ua.map(x=>x.id)),[k,h]=re.default.useState({status:"all",component:null,type:null,user:null,tags:[]}),[w,b]=re.default.useState("Proto Board"),[M,R]=re.default.useState(!1),[F,ee]=re.default.useState(!1),[G,Ie]=re.default.useState("You"),[_,N]=re.default.useState(null),[Z,te]=re.default.useState(""),[W,ce]=re.default.useState({}),je=re.default.useRef(null),bt=re.default.useRef(null),Xe=re.default.useRef(null),[Yt,Pt]=re.default.useState([]),fa=re.default.useRef(!1),gt=re.default.useRef([]),[Ir,Ls]=re.default.useState([]);re.default.useEffect(()=>(Tt(),Ss(),Is(),Mn(),Dn(),An(),()=>{var x;bt.current&&clearTimeout(bt.current),(x=je.current)==null||x.close()}),[]),re.default.useEffect(()=>{document.body.setAttribute("data-theme","dark")},[]),re.default.useEffect(()=>{function x(){let Q=window.location.hash.match(/^#task-([a-f0-9]{30})$/i);if(!Q){Xe.current=null;return}let ge=Q[1].toLowerCase();if(Xe.current===ge)return;let se=e.find(ae=>ae.id.toLowerCase()===ge);se&&(Xe.current=ge,fa.current?s(ae=>({...ae,open:!0,task:se,tab:"details"})):s(ae=>(ae.task&&ae.task.id!==se.id&&Pt(ne=>[...ne,ae.task]),{...ae,open:!0,task:se,tab:"details"})),fa.current=!1)}function P(){}x();let O=()=>{Xe.current=null,x()};return window.addEventListener("hashchange",O),window.addEventListener("vibeflow-task-ref-click",P),()=>{window.removeEventListener("hashchange",O),window.removeEventListener("vibeflow-task-ref-click",P)}},[e]),re.default.useEffect(()=>{if(!l.open||!l.task)return;let x=e.find(Q=>Q.id===l.task.id);if(!x)return;let P=l.task;Object.keys(x).some(Q=>x[Q]!==P[Q])&&s(Q=>({...Q,task:x}))},[e,l.open,(Ka=l.task)==null?void 0:Ka.id]),re.default.useEffect(()=>{function x(P){var ge,se,ae;let O=(ge=P.target)==null?void 0:ge.tagName,Q=O==="INPUT"||O==="TEXTAREA"||((se=P.target)==null?void 0:se.isContentEditable);if(P.key==="Escape"){if(p.open){v(ne=>({...ne,open:!1}));return}if(l.open){s(ne=>({...ne,open:!1}));return}if(g){m(!1);return}}if(!Q&&((P.key==="?"||P.key==="/"&&P.shiftKey)&&((ae=document.getElementById("header-shortcuts-hint"))==null||ae.click()),P.altKey&&!P.ctrlKey&&!P.metaKey&&(P.key==="n"||P.key==="N")&&(P.preventDefault(),$a(null,"details")),P.altKey&&!P.ctrlKey&&!P.metaKey&&(P.key==="f"||P.key==="F"))){P.preventDefault();let ne=document.getElementById("global-search");ne==null||ne.focus(),ne==null||ne.select()}}return window.addEventListener("keydown",x),()=>window.removeEventListener("keydown",x)},[p.open,l.open,g]);function Cr(x,P,O,Q,ge){let se=new Date().toISOString(),ae=Tm[P]??P,ne=Tm[O]??O,Te=Date.now()-3e3;Ls(Me=>Me.some(D=>D.taskId===x&&D.to===ne&&new Date(D.timestamp).getTime()>Te)?Me:[...Me,{taskId:x,field:"status",from:ae,to:ne,actor:Q,timestamp:se,source:ge}].slice(-500))}async function Tt(){try{let x=await mt.getTasks();gt.current=x.tasks??[],t(x.tasks??[])}catch{}finally{r(!1)}}let Zt=re.default.useCallback((x,P,O)=>{let Q=String(x.id??"");if(!Q)return;let ge=x.created??x.createdAt,se=x.updated?String(x.updated):void 0,ae=Array.isArray(x.comments)?x.comments.length:void 0,ne=Array.isArray(x.files)?x.files.length:void 0,Te=x.status?String(x.status):void 0,Me=gt.current.find(Fe=>Fe.id===Q);Te&&Me&&Me.status!==Te&&Cr(Q,Me.status,Te,P??"Someone",O),t(Fe=>{let D=Fe.find(_t=>_t.id===Q),Ga={id:Q,title:x.title?String(x.title):(D==null?void 0:D.title)??"Untitled",description:x.description!=null?String(x.description):(D==null?void 0:D.description)??"",status:Te??(D==null?void 0:D.status)??"todo",type:x.type?String(x.type):D==null?void 0:D.type,priority:x.priority?String(x.priority):D==null?void 0:D.priority,agent:x.agent?String(x.agent):D==null?void 0:D.agent,model:x.model?String(x.model):D==null?void 0:D.model,selector:x.selector?String(x.selector):D==null?void 0:D.selector,cssSelector:x.cssSelector?String(x.cssSelector):D==null?void 0:D.cssSelector,file:x.file?String(x.file):D==null?void 0:D.file,line:typeof x.line=="number"?x.line:D==null?void 0:D.line,col:typeof x.col=="number"?x.col:D==null?void 0:D.col,component:x.component?String(x.component):D==null?void 0:D.component,url:x.url?String(x.url):D==null?void 0:D.url,reportBack:x.reportBack===!0||(D==null?void 0:D.reportBack)===!0,commit:x.commit?String(x.commit):D==null?void 0:D.commit,commits:Array.isArray(x.commits)?x.commits:D==null?void 0:D.commits,commentCount:ae??(D==null?void 0:D.commentCount),fileCount:ne??(D==null?void 0:D.fileCount),createdAt:ge?String(ge):(D==null?void 0:D.createdAt)??new Date().toISOString(),updatedAt:se??(D==null?void 0:D.updatedAt),author:x.author?String(x.author):D==null?void 0:D.author,tags:Array.isArray(x.tags)?x.tags:D==null?void 0:D.tags,sortKey:x.sortKey?String(x.sortKey):D==null?void 0:D.sortKey},st=Fe.filter(_t=>_t.id!==Q);return st.push(Ga),st.sort((_t,pa)=>{let ja=new Date(_t.updatedAt??_t.createdAt??"").getTime(),br=new Date(pa.updatedAt??pa.createdAt??"").getTime();return ja===br?_t.id.localeCompare(pa.id):br-ja}),gt.current=st,st})},[]);async function Ss(){try{let x=await mt.getProject();x.name&&b(x.name),x.gitUserName&&Ie(x.gitUserName)}catch{}}async function Dn(){try{let x=await fetch("/api/github-url").then(P=>P.json());N(x.githubUrl??null)}catch{}}async function Is(){var x;try{let O=await mt.getSettings();ce(O),(x=O.visibleCols)!=null&&x.length&&C(O.visibleCols),O.viewMode&&d(O.viewMode),O.panelWidth&&O.panelWidth>=280&&O.panelWidth<=900&&S(O.panelWidth)}catch{}}async function Mn(){try{let x=await mt.getCopilotStatus();x!=null&&x.authenticated&&(x!=null&&x.username)?te(`Copilot: ${x.username}`):te("Copilot: not logged in")}catch{}}function An(){let P=`${window.location.protocol==="https:"?"wss:":"ws:"}//${window.location.host}`,O=new WebSocket(P);je.current=O,O.addEventListener("open",()=>{R(!0),ee(!0),Tt()}),O.addEventListener("close",()=>{R(!1),bt.current=setTimeout(An,1500)}),O.addEventListener("message",ge=>{var se;try{let ae=JSON.parse(ge.data);if(ae.type==="tasks-updated"||(se=ae.type)!=null&&se.startsWith("task:")){Tt();return}if(ae.type==="task-changed"&&ae.task){let ne=ae.task,Te=typeof ne.alteredBy=="string"?ne.alteredBy:typeof ne.author=="string"?ne.author:"Someone",Me=ae.source==="cli"?"cli":void 0;Zt(ne,Te,Me);return}if(ae.type==="task-deleted"&&ae.taskId){let ne=String(ae.taskId);t(Te=>{let Me=Te.filter(Fe=>Fe.id!==ne);return gt.current=Me,Me})}}catch{}});let Q=setInterval(()=>{O.readyState===WebSocket.OPEN&&O.send(JSON.stringify({type:"ping"}))},2e4);O.addEventListener("close",()=>clearInterval(Q))}async function Va(x,P){let O=gt.current.find(Q=>Q.id===x);t(Q=>{let ge=Q.map(se=>se.id===x?{...se,...P}:se);return gt.current=ge,ge}),P.status&&(O!=null&&O.status)&&P.status!==O.status&&Cr(x,O.status,P.status,G);try{let Q=await mt.updateTask(x,P);Q.task&&t(ge=>{let se=ge.map(ae=>ae.id===x?Q.task:ae);return gt.current=se,se})}catch{Tt()}}async function ca(x,P,O,Q){let ge=gt.current.filter(ne=>ne.status===P).sort(cn),{newSortKey:se,normalizationPatches:ae}=Gi(ge,x,O,Q);t(ne=>{let Te=new Map;for(let{id:Fe,sortKey:D}of ae)Te.set(Fe,{sortKey:D});Te.set(x,{status:P,sortKey:se});let Me=ne.map(Fe=>Te.has(Fe.id)?{...Fe,...Te.get(Fe.id)}:Fe);return gt.current=Me,Me}),await mt.updateTask(x,{status:P,sortKey:se}).catch(()=>{Tt()})}async function wr(x){t(P=>{let O=P.filter(Q=>Q.id!==x);return gt.current=O,O});try{await mt.deleteTask(x)}catch{Tt()}}async function Cs(x){var P;try{let O=await mt.createTask(x);return await Tt(),(P=O==null?void 0:O.task)==null?void 0:P.id}catch{}}function $a(x,P="details",O){Pt([]),s({open:!0,task:x,tab:P,addColumnId:O})}function kr(){Pt(x=>{if(x.length===0)return x;let P=x[x.length-1],O=x.slice(0,-1);return fa.current=!0,Xe.current=null,window.location.hash=`#task-${P.id}`,s(Q=>({...Q,open:!0,task:P,tab:"details"})),O})}function En(x,P){if(/\\.html?$/i.test(x)){window.open(P,"_blank","noopener,noreferrer");return}v({open:!0,name:x,url:P})}let Fn=gv(e,y,i.toLowerCase()),Bn=window.location.origin,ws=re.default.useMemo(()=>{let x=new Set;return e.forEach(P=>(P.tags??[]).forEach(O=>x.add(O))),Array.from(x).sort()},[e]),On=re.default.useMemo(()=>{var P;let x=(P=l.task)==null?void 0:P.id;return x?Ir.filter(O=>O.taskId===x).map(({field:O,from:Q,to:ge,actor:se,timestamp:ae,source:ne})=>({field:O,from:Q,to:ge,actor:se,timestamp:ae,source:ne})):[]},[(vo=l.task)==null?void 0:vo.id,Ir]),ho=re.default.useMemo(()=>{let x=e;return k.status!=="all"&&(x=x.filter(P=>P.status===k.status)),k.component&&(x=x.filter(P=>P.component===k.component)),k.type&&(x=x.filter(P=>P.type===k.type)),k.user&&(x=x.filter(P=>P.author===k.user)),k.tags&&k.tags.length>0&&(x=x.filter(P=>k.tags.every(O=>(P.tags??[]).includes(O)))),x},[e,k]),xo=F&&!M;return(0,j.jsxs)(j.Fragment,{children:[cv&&!o&&(0,j.jsx)(mv,{onClose:Dm?()=>n(!0):void 0}),(0,j.jsx)(Ji,{projectName:w,missingProjectIconStyle:"vibeflow",wsConnected:M,port:fv,searchQuery:i,filterTags:k.tags,allTags:ws,onToggleTag:x=>{let P=k.tags??[],O=P.includes(x)?P.filter(Q=>Q!==x):[...P,x];h(Q=>({...Q,tags:O}))},premiumUsage:Z,isLoading:a,taskSummary:Fn,onSearchChange:f,onSettings:()=>m(!0)}),(0,j.jsx)(id,{tasks:e,filter:k,view:u,onFilter:h,onViewChange:x=>{d(x),mt.saveSettings({...W,viewMode:x}),ce(P=>({...P,viewMode:x}))}}),(0,j.jsxs)("div",{className:"flex flex-1 overflow-hidden",style:{minHeight:0,position:"relative"},children:[u==="list"?(0,j.jsx)(Zi,{tasks:ho,searchQuery:i,isLoading:a,onOpenPanel:(x,P)=>$a(x,P),onAddTask:x=>$a(null,"details",x),onDrop:(x,P)=>Va(x,{status:P})}):(0,j.jsx)(Qi,{tasks:ho,visibleCols:y,searchQuery:i,isLoading:a,onOpenPanel:(x,P,O)=>$a(x,P,O),onDrop:(x,P)=>Va(x,{status:P}),onReorder:ca}),l.open&&(0,j.jsxs)("div",{id:"detail-panel-container",style:{width:L,zIndex:z?30:10},className:z?"resizing":"",children:[(0,j.jsx)("div",{id:"detail-panel-resize-handle",onMouseDown:x=>{x.preventDefault(),c(!0),document.body.classList.add("vibeflow-resizing-panel");let P=x.clientX,O=L,Q=se=>{let ae=O-(se.clientX-P);S(Math.max(360,Math.min(860,ae)))},ge=se=>{c(!1),document.body.classList.remove("vibeflow-resizing-panel");let ae=Math.max(360,Math.min(860,O-(se.clientX-P)));mt.saveSettings({...W,panelWidth:ae}),ce(ne=>({...ne,panelWidth:ae})),window.removeEventListener("mousemove",Q),window.removeEventListener("mouseup",ge)};window.addEventListener("mousemove",Q),window.addEventListener("mouseup",ge)}}),(0,j.jsx)(ud,{open:l.open,task:l.task,tab:l.tab,showLockIndicator:!1,addColumnId:l.addColumnId,gitUserName:G,githubUrl:_,baseUrl:Bn,isResizing:z,api:mt,onClose:()=>{Pt([]),s(x=>({...x,open:!1}))},onSave:async x=>{l.task&&await Va(l.task.id,x),s(P=>({...P,open:!1}))},onCreate:async x=>{let P=await Cs(x);return s(O=>({...O,open:!1})),P},onDelete:async x=>{await wr(x),s(P=>({...P,open:!1}))},onPatch:Va,onFilePreview:En,onGoBack:Yt.length>0?kr:void 0,navBackLabel:Yt.length>0?Yt[Yt.length-1].title:void 0,externalLocalChanges:On,allTasks:e})]})]}),xo&&(0,Rm.createPortal)((0,j.jsx)("div",{id:"ws-lost-overlay",style:{position:"fixed",top:0,left:0,width:"100vw",height:"100vh",zIndex:99999,background:"rgba(2, 6, 23, 0.88)",backdropFilter:"blur(4px)",WebkitBackdropFilter:"blur(4px)",display:"flex",alignItems:"center",justifyContent:"center",padding:16,pointerEvents:"all",cursor:"not-allowed"},children:(0,j.jsxs)("div",{style:{width:"min(420px, 92vw)",borderRadius:14,border:"1px solid var(--p-border-s)",background:"var(--p-card)",boxShadow:"0 16px 40px rgba(2,6,23,0.7)",padding:"20px 22px",display:"flex",flexDirection:"column",gap:10,cursor:"default",pointerEvents:"auto"},children:[(0,j.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:10},children:[(0,j.jsx)("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"var(--p-text-m)",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",style:{animation:"spin 1.1s linear infinite",flexShrink:0},children:(0,j.jsx)("path",{d:"M21 12a9 9 0 1 1-6.219-8.56"})}),(0,j.jsx)("span",{style:{fontSize:13,fontWeight:600,color:"var(--p-text)"},children:"Connection Lost"})]}),(0,j.jsx)("div",{style:{fontSize:12,color:"var(--p-text-m)",lineHeight:1.6},children:"Real-time connection to the server was interrupted. Reconnecting in the background\\u2026"})]})}),document.body),(0,j.jsx)(dd,{open:g,visibleCols:y,settings:W,onClose:()=>m(!1),onSave:(x,P)=>{C(x);let O={...W,...P,visibleCols:x};ce(O),mt.saveSettings(O)}}),(0,j.jsx)(fd,{open:p.open,name:p.name,url:p.url,onClose:()=>v(x=>({...x,open:!1}))})]})}var Fm=A(q(),1),Am=document.getElementById("root");Am&&(0,Em.createRoot)(Am).render((0,Fm.jsx)(Mm,{}));})();\n/*! Bundled license information:\n\nreact/cjs/react.production.min.js:\n (**\n * @license React\n * react.production.min.js\n *\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *)\n\nscheduler/cjs/scheduler.production.min.js:\n (**\n * @license React\n * scheduler.production.min.js\n *\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *)\n\nreact-dom/cjs/react-dom.production.min.js:\n (**\n * @license React\n * react-dom.production.min.js\n *\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *)\n\nreact/cjs/react-jsx-runtime.production.min.js:\n (**\n * @license React\n * react-jsx-runtime.production.min.js\n *\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *)\n\nlucide-react/dist/esm/shared/src/utils.js:\nlucide-react/dist/esm/defaultAttributes.js:\nlucide-react/dist/esm/Icon.js:\nlucide-react/dist/esm/createLucideIcon.js:\nlucide-react/dist/esm/icons/chevron-down.js:\nlucide-react/dist/esm/icons/chevron-right.js:\nlucide-react/dist/esm/icons/circle-check-big.js:\nlucide-react/dist/esm/icons/download.js:\nlucide-react/dist/esm/icons/eye.js:\nlucide-react/dist/esm/icons/file-text.js:\nlucide-react/dist/esm/icons/flag.js:\nlucide-react/dist/esm/icons/layout-dashboard.js:\nlucide-react/dist/esm/icons/list.js:\nlucide-react/dist/esm/icons/lock.js:\nlucide-react/dist/esm/icons/message-circle.js:\nlucide-react/dist/esm/icons/panels-top-left.js:\nlucide-react/dist/esm/icons/paperclip.js:\nlucide-react/dist/esm/icons/plus.js:\nlucide-react/dist/esm/icons/search.js:\nlucide-react/dist/esm/icons/settings.js:\nlucide-react/dist/esm/icons/tag.js:\nlucide-react/dist/esm/icons/triangle-alert.js:\nlucide-react/dist/esm/icons/upload.js:\nlucide-react/dist/esm/icons/user.js:\nlucide-react/dist/esm/icons/workflow.js:\nlucide-react/dist/esm/icons/x.js:\nlucide-react/dist/esm/lucide-react.js:\n (**\n * @license lucide-react v0.468.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n *)\n*/\n';var Xt=Gt(import.meta.url),Zt=Qt(Xt),Jt=[rn(Zt,"kanban-template.html"),rn(process.cwd(),"src","server","kanban-template.html"),rn(process.cwd(),"dist","server","kanban-template.html")];function er(t){let e=Jt.find(r=>Kt(r));if(!e)throw new Error("kanban-template.html not found in expected locations");return Yt(e,"utf8").replaceAll("__PORT__",String(t))}function nr(t){return t.saasMode?`window.__SAAS_MODE__ = true; window.__BOARD_URL__ = ${JSON.stringify(t.boardUrl??"")}; window.__BOARD_NAME__ = ${JSON.stringify(t.boardName??"")}; window.__IS_ADMIN__ = ${t.isAdmin?"true":"false"};`:""}var tr="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAxOCAxOCIgZmlsbD0ibm9uZSI+PHJlY3Qgd2lkdGg9IjE4IiBoZWlnaHQ9IjE4IiByeD0iNCIgZmlsbD0iIzI1NjNlYiIvPjxyZWN0IHg9IjIuNSIgeT0iNSIgd2lkdGg9IjIiIGhlaWdodD0iOCIgcng9IjEiIGZpbGw9IndoaXRlIiBvcGFjaXR5PSIwLjciLz48cmVjdCB4PSI2LjUiIHk9IjIiIHdpZHRoPSIyIiBoZWlnaHQ9IjE0IiByeD0iMSIgZmlsbD0id2hpdGUiLz48cmVjdCB4PSIxMC41IiB5PSI2IiB3aWR0aD0iMiIgaGVpZ2h0PSI2IiByeD0iMSIgZmlsbD0id2hpdGUiIG9wYWNpdHk9IjAuNyIvPjxyZWN0IHg9IjE0LjUiIHk9IjQiIHdpZHRoPSIyIiBoZWlnaHQ9IjEwIiByeD0iMSIgZmlsbD0id2hpdGUiIG9wYWNpdHk9IjAuODUiLz48L3N2Zz4=";function rr(t){return`<!DOCTYPE html>
|
|
29529
|
+
`+an}function Dn(n){return`var PROTO_CONFIG = ${JSON.stringify({port:0,wsUrl:"",apiUrl:`${n}/api/overlay/tasks`,pagesUrl:"",screenshotsUrl:""})};
|
|
29530
|
+
`+an}import{existsSync as Gt,readFileSync as Xt}from"fs";import{dirname as Jt,join as un}from"path";import{fileURLToPath as Zt}from"url";var An=`*,:after,:before{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness:proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgba(59,130,246,.5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }::backdrop{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness:proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgba(59,130,246,.5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }
|
|
29531
|
+
/*! tailwindcss v3.4.19 | MIT License | https://tailwindcss.com*/*,:after,:before{box-sizing:border-box;border:0 solid #e5e7eb}:after,:before{--tw-content:""}:host,html{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;-o-tab-size:4;tab-size:4;font-family:Inter,system-ui,sans-serif;font-feature-settings:normal;font-variation-settings:normal;-webkit-tap-highlight-color:transparent}body{margin:0;line-height:inherit}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,pre,samp{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-feature-settings:normal;font-variation-settings:normal;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}button,input,optgroup,select,textarea{font-family:inherit;font-feature-settings:inherit;font-variation-settings:inherit;font-size:100%;font-weight:inherit;line-height:inherit;letter-spacing:inherit;color:inherit;margin:0;padding:0}button,select{text-transform:none}button,input:where([type=button]),input:where([type=reset]),input:where([type=submit]){-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dd,dl,figure,h1,h2,h3,h4,h5,h6,hr,p,pre{margin:0}fieldset{margin:0}fieldset,legend{padding:0}menu,ol,ul{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{opacity:1;color:#9ca3af}input::placeholder,textarea::placeholder{opacity:1;color:#9ca3af}[role=button],button{cursor:pointer}:disabled{cursor:default}audio,canvas,embed,iframe,img,object,svg,video{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}[hidden]:where(:not([hidden=until-found])){display:none}.container{width:100%}@media (min-width:640px){.container{max-width:640px}}@media (min-width:768px){.container{max-width:768px}}@media (min-width:1024px){.container{max-width:1024px}}@media (min-width:1280px){.container{max-width:1280px}}@media (min-width:1536px){.container{max-width:1536px}}.\\!visible{visibility:visible!important}.visible{visibility:visible}.static{position:static}.fixed{position:fixed}.absolute{position:absolute}.relative{position:relative}.mb-0\\.5{margin-bottom:.125rem}.ml-1\\.5{margin-left:.375rem}.mr-0\\.5{margin-right:.125rem}.mt-0\\.5{margin-top:.125rem}.block{display:block}.inline-block{display:inline-block}.inline{display:inline}.flex{display:flex}.inline-flex{display:inline-flex}.grid{display:grid}.hidden{display:none}.h-1{height:.25rem}.h-1\\.5{height:.375rem}.h-10{height:2.5rem}.h-2\\.5{height:.625rem}.h-3{height:.75rem}.h-3\\.5{height:.875rem}.h-4{height:1rem}.h-7{height:1.75rem}.min-h-\\[30px\\]{min-height:30px}.w-1{width:.25rem}.w-1\\.5{width:.375rem}.w-10{width:2.5rem}.w-2\\.5{width:.625rem}.w-3{width:.75rem}.w-3\\.5{width:.875rem}.w-4{width:1rem}.w-7{width:1.75rem}.w-full{width:100%}.min-w-\\[100px\\]{min-width:100px}.max-w-sm{max-width:24rem}.flex-1{flex:1 1 0%}.flex-shrink-0{flex-shrink:0}.transform{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.cursor-text{cursor:text}.resize{resize:both}.flex-col{flex-direction:column}.flex-wrap{flex-wrap:wrap}.items-center{align-items:center}.justify-center{justify-content:center}.justify-between{justify-content:space-between}.gap-1{gap:.25rem}.gap-1\\.5{gap:.375rem}.gap-2{gap:.5rem}.gap-3{gap:.75rem}.overflow-auto{overflow:auto}.overflow-hidden{overflow:hidden}.overflow-x-auto{overflow-x:auto}.overflow-y-hidden{overflow-y:hidden}.break-all{word-break:break-all}.rounded{border-radius:.25rem}.rounded-full{border-radius:9999px}.rounded-lg{border-radius:.5rem}.rounded-md{border-radius:.375rem}.border{border-width:1px}.border-b{border-bottom-width:1px}.border-none{border-style:none}.border-slate-700{--tw-border-opacity:1;border-color:rgb(51 65 85/var(--tw-border-opacity,1))}.border-slate-700\\/60{border-color:rgba(51,65,85,.6)}.border-slate-800\\/60{border-color:rgba(30,41,59,.6)}.border-violet-700\\/50{border-color:rgba(109,40,217,.5)}.bg-blue-400{--tw-bg-opacity:1;background-color:rgb(96 165 250/var(--tw-bg-opacity,1))}.bg-green-400{--tw-bg-opacity:1;background-color:rgb(74 222 128/var(--tw-bg-opacity,1))}.bg-slate-800{--tw-bg-opacity:1;background-color:rgb(30 41 59/var(--tw-bg-opacity,1))}.bg-transparent{background-color:transparent}.bg-violet-900\\/30{background-color:rgba(76,29,149,.3)}.p-1{padding:.25rem}.p-1\\.5{padding:.375rem}.px-2{padding-left:.5rem;padding-right:.5rem}.px-3{padding-left:.75rem;padding-right:.75rem}.px-4{padding-left:1rem;padding-right:1rem}.px-5{padding-left:1.25rem;padding-right:1.25rem}.py-0\\.5{padding-top:.125rem;padding-bottom:.125rem}.py-1{padding-top:.25rem;padding-bottom:.25rem}.py-1\\.5{padding-top:.375rem;padding-bottom:.375rem}.py-12{padding-top:3rem;padding-bottom:3rem}.py-3{padding-top:.75rem;padding-bottom:.75rem}.py-4{padding-top:1rem;padding-bottom:1rem}.font-mono{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace}.text-\\[10px\\]{font-size:10px}.text-sm{font-size:.875rem;line-height:1.25rem}.text-xs{font-size:.75rem;line-height:1rem}.font-medium{font-weight:500}.font-semibold{font-weight:600}.uppercase{text-transform:uppercase}.lowercase{text-transform:lowercase}.italic{font-style:italic}.leading-tight{line-height:1.25}.text-green-400{--tw-text-opacity:1;color:rgb(74 222 128/var(--tw-text-opacity,1))}.text-slate-200{--tw-text-opacity:1;color:rgb(226 232 240/var(--tw-text-opacity,1))}.text-slate-300{--tw-text-opacity:1;color:rgb(203 213 225/var(--tw-text-opacity,1))}.text-slate-400{--tw-text-opacity:1;color:rgb(148 163 184/var(--tw-text-opacity,1))}.text-slate-500{--tw-text-opacity:1;color:rgb(100 116 139/var(--tw-text-opacity,1))}.text-slate-600{--tw-text-opacity:1;color:rgb(71 85 105/var(--tw-text-opacity,1))}.text-violet-300{--tw-text-opacity:1;color:rgb(196 181 253/var(--tw-text-opacity,1))}.text-violet-400{--tw-text-opacity:1;color:rgb(167 139 250/var(--tw-text-opacity,1))}.text-white{--tw-text-opacity:1;color:rgb(255 255 255/var(--tw-text-opacity,1))}.underline{text-decoration-line:underline}.line-through{text-decoration-line:line-through}.no-underline{text-decoration-line:none}.placeholder-slate-500::-moz-placeholder{--tw-placeholder-opacity:1;color:rgb(100 116 139/var(--tw-placeholder-opacity,1))}.placeholder-slate-500::placeholder{--tw-placeholder-opacity:1;color:rgb(100 116 139/var(--tw-placeholder-opacity,1))}.opacity-0{opacity:0}.opacity-40{opacity:.4}.outline-none{outline:2px solid transparent;outline-offset:2px}.outline{outline-style:solid}.blur{--tw-blur:blur(8px);filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.\\!filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)!important}.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.transition{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-colors{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-opacity{transition-property:opacity;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.ease-in-out{transition-timing-function:cubic-bezier(.4,0,.2,1)}:root{--p-bg:#020c1b;--p-surface:#080f1e;--p-card:#0a0f1e;--p-input:#050d1a;--p-hover:#0d1f38;--p-border:#1e293b;--p-border-s:#1e3a5f;--p-border-t:#334155;--p-text:#e2e8f0;--p-text-sub:#cbd5e1;--p-text-m:#94a3b8;--p-text-f:#64748b;--p-text-g:#475569;--p-white:#fff;--p-blue:#2563eb;--p-blue-700:#1d4ed8;--p-blue-300:#60a5fa;--p-blue-200:#93c5fd;--p-purple:#a78bfa;--p-purple-300:#c4b5fd;--p-cyan-300:#7dd3fc;--p-amber:#f59e0b;--p-amber-300:#fcd34d;--p-green:#22c55e;--p-green-300:#6ee7b7;--p-red:#f87171;--p-red-500:#ef4444;--p-bg-2:#0f172a;--p-bg-3:#1e293b;--p-shadow-lg:0 8px 24px rgba(2,6,23,.28);--p-overlay:rgba(15,23,42,.2)}body,html{height:100%;margin:0;padding:0}body{font-family:Inter,sans-serif;background:var(--p-bg);color:var(--p-text)}#root{height:100%;display:flex;flex-direction:column;overflow:hidden}*{scrollbar-width:thin;scrollbar-color:var(--p-border-t) transparent}::-webkit-scrollbar{width:4px;height:4px}::-webkit-scrollbar-track{background:transparent}::-webkit-scrollbar-thumb{background:var(--p-border-t);border-radius:4px}::-webkit-scrollbar-thumb:hover{background:var(--p-text-g)}#kanban-board{scrollbar-width:none;-ms-overflow-style:none;overflow-x:auto;overflow-y:hidden}#kanban-board::-webkit-scrollbar{display:none}#kanban-scroll-track{position:fixed;bottom:0;left:0;right:0;height:6px;background:transparent;z-index:40;pointer-events:none}#kanban-scroll-thumb{position:absolute;top:1px;height:4px;border-radius:2px;background:var(--p-border-t);cursor:pointer;pointer-events:auto;transition:background .15s}#kanban-scroll-thumb.dragging,#kanban-scroll-thumb:hover{background:var(--p-text-g)}.board-column{flex:0 0 280px;width:280px;display:flex;flex-direction:column;gap:6px;min-height:0}.column-header{display:flex;align-items:center;gap:8px;padding:8px 10px;border-radius:8px;background:var(--p-surface);border:1px solid var(--p-border)}.column-scroll{flex:1;overflow-y:auto;min-height:0;gap:5px;padding-bottom:8px}.column-scroll,.task-card{display:flex;flex-direction:column}.task-card{background:var(--p-card);border:1px solid var(--p-border);border-radius:10px;padding:11px 13px;cursor:grab;transition:border-color .12s,background .12s,box-shadow .12s,transform .12s;gap:7px}.task-card:hover{border-color:var(--p-border-s);background:var(--p-hover);box-shadow:0 4px 16px rgba(0,0,0,.3);transform:translateY(-1px)}.task-card:active{cursor:grabbing;transform:scale(.98)}.task-card.dragging{opacity:.4}.drag-over{outline:2px dashed rgba(59,130,246,.5);outline-offset:-3px;border-radius:10px;background:rgba(59,130,246,.04)}.file-compact-actions{opacity:0}.group\\/file-compact:hover .file-compact-actions{opacity:1}.file-normal-actions,.group\\/file-compact:hover .file-compact-ts{opacity:0}.group\\/file:hover .file-normal-actions{opacity:1}.group\\/file:hover{background:rgba(30,41,59,.6)}.status-dot{width:7px;height:7px;border-radius:50%;flex-shrink:0}.sd-backlog{background:#475569}.sd-todo{background:#f59e0b}.sd-inprogress{background:#3b82f6;animation:pulse-prog 2s ease-in-out infinite}.sd-review{background:#a855f7}.sd-done{background:#22c55e}@keyframes pulse-prog{0%,to{box-shadow:0 0 0 0 rgba(59,130,246,.5)}50%{box-shadow:0 0 0 4px rgba(59,130,246,0)}}.type-badge{display:inline-flex;align-items:center;gap:3px;padding:2px 7px;border-radius:20px;font-size:10px;font-weight:500;border:1px solid}.type-bug{color:#fca5a5;background:rgba(239,68,68,.1);border-color:rgba(239,68,68,.25)}.type-feature{color:#86efac;background:rgba(34,197,94,.08);border-color:rgba(34,197,94,.2)}.type-enhancement{color:#93c5fd;background:rgba(59,130,246,.08);border-color:rgba(59,130,246,.2)}.type-task{color:#cbd5e1;background:rgba(148,163,184,.08);border-color:rgba(148,163,184,.2)}.type-research{color:#c4b5fd;background:rgba(139,92,246,.08);border-color:rgba(139,92,246,.2)}.source-pill{display:inline-flex;align-items:center;gap:4px;padding:2px 7px;border-radius:6px;font-size:10px;font-family:JetBrains Mono,monospace;background:rgba(59,130,246,.06);border:1px solid rgba(59,130,246,.15);color:#60a5fa;cursor:pointer;text-decoration:none;transition:background .1s,border-color .1s;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:100%}.source-pill:hover{background:rgba(59,130,246,.12);border-color:rgba(59,130,246,.3)}@keyframes spin{to{transform:rotate(1turn)}}.spinner{display:inline-block;width:11px;height:11px;border:2px solid rgba(96,165,250,.3);border-top-color:#60a5fa;border-radius:50%;animation:spin .7s linear infinite}.modal-backdrop{position:fixed;inset:0;background:rgba(0,0,0,.6);z-index:50;display:flex;align-items:center;justify-content:center}.modal-box{background:var(--p-card);border:1px solid var(--p-border);border-radius:14px;width:520px;max-width:95vw;overflow:hidden}.type-picker{display:flex;align-items:center;gap:6px}.type-picker-trigger{display:flex;align-items:center;gap:4px;width:auto;height:30px;padding:0 8px;border-radius:8px;border:1px solid var(--p-border-t);background:var(--p-card);color:var(--p-text-sub);font-size:13px;cursor:pointer;white-space:nowrap}.type-picker-label{font-size:11px;font-weight:500;color:var(--p-text-m);letter-spacing:.02em}.type-picker-trigger:hover{border-color:var(--p-text-g);color:var(--p-text)}.type-picker-options{display:none;align-items:center;gap:4px}.type-picker-options.open{display:flex}.type-picker-option{width:28px;height:28px;border-radius:7px;border:1px solid var(--p-border-t);background:var(--p-card);color:var(--p-text-sub);display:flex;align-items:center;justify-content:center;cursor:pointer;font-size:13px}.type-picker-option:hover{border-color:#60a5fa;color:#bfdbfe}#detail-panel-container{min-width:360px;max-width:min(860px,100%);position:absolute;right:0;top:0;bottom:0;display:flex;flex-direction:column;overflow:hidden;border-left:1px solid #1e293b;animation:panel-slide-in .18s ease-out}#detail-panel-container.resizing{box-shadow:-12px 0 32px rgba(2,8,23,.6)}#detail-panel-resize-handle{position:absolute;left:0;top:0;width:12px;height:100%;cursor:ew-resize;z-index:5}#detail-panel-resize-handle:hover{background:linear-gradient(90deg,rgba(59,130,246,.22),rgba(59,130,246,0))}body.proto-resizing-panel{cursor:ew-resize;-webkit-user-select:none;-moz-user-select:none;user-select:none}#detail-panel{flex:1;background:var(--p-card);display:flex;flex-direction:column;overflow:hidden}@keyframes panel-slide-in{0%{width:0;opacity:0}to{width:420px;opacity:1}}.dp-header{padding:14px 16px 10px}.dp-header,.dp-tabs{border-bottom:1px solid var(--p-border);background:var(--p-surface);flex-shrink:0}.dp-tabs{display:flex;gap:0}.dp-tab{padding:8px 14px;font-size:12px;font-weight:500;color:var(--p-text-g);cursor:pointer;transition:color .12s,border-color .12s;background:none;border:none;border-bottom:2px solid transparent}.dp-tab:hover{color:var(--p-text-m)}.dp-tab.active{color:#93c5fd;border-bottom-color:#3b82f6}.dp-body{overflow:hidden}.dp-body,.dp-body>.dp-pane{flex:1;display:flex;flex-direction:column;gap:12px;min-height:0}.dp-body>.dp-pane{padding:14px 16px}#dp-details-pane,.dp-body>.dp-pane{overflow-y:auto;background:var(--p-card)}.dp-footer{padding:10px 16px 12px;border-top:1px solid var(--p-border);flex-shrink:0;display:flex;align-items:center;justify-content:space-between;gap:8px;background:var(--p-card)}.dp-source-pill{display:inline-flex;align-items:center;gap:3px;padding:2px 7px;border-radius:6px;font-size:10px;font-family:monospace;background:rgba(59,130,246,.06);border:1px solid rgba(59,130,246,.15);color:#60a5fa;white-space:nowrap}.dp-source-pill:hover{background:rgba(59,130,246,.12);border-color:rgba(59,130,246,.3)}.dp-status-btn{padding:3px 10px;border-radius:6px;font-size:10px;font-weight:500;border:1px solid var(--p-border-t);color:var(--p-text-f);background:transparent;cursor:pointer;transition:background .12s,border-color .12s,color .12s}.dp-status-btn:hover{border-color:var(--p-text-g);color:var(--p-text-m)}.dp-status-btn.active-backlog{border-color:#475569;background:rgba(100,116,139,.1);color:#94a3b8}.dp-status-btn.active-todo{border-color:rgba(245,158,11,.5);background:rgba(245,158,11,.1);color:#f59e0b}.dp-status-btn.active-in-progress{border-color:rgba(59,130,246,.5);background:rgba(59,130,246,.1);color:#60a5fa}.dp-status-btn.active-review{border-color:rgba(168,85,247,.5);background:rgba(168,85,247,.1);color:#a855f7}.dp-status-btn.active-done{border-color:rgba(34,197,94,.4);background:rgba(34,197,94,.08);color:#22c55e}.dp-input{width:100%;padding:7px 10px;border:1px solid var(--p-border-s);border-radius:8px;background:var(--p-input);color:var(--p-text);font-size:13px;font-family:inherit;outline:none;transition:border-color .12s,box-shadow .12s;box-sizing:border-box}.dp-input:focus{border-color:#3b82f6;box-shadow:0 0 0 3px rgba(59,130,246,.1)}.dp-input::-moz-placeholder{color:var(--p-border-t)}.dp-input::placeholder{color:var(--p-border-t)}.dp-textarea{width:100%;padding:8px 10px;border:1px solid var(--p-border-s);border-radius:8px;background:var(--p-input);color:var(--p-text);font-size:12px;font-family:monospace;line-height:1.6;resize:vertical;outline:none;box-sizing:border-box;transition:border-color .12s,box-shadow .12s}.dp-textarea:focus{border-color:#3b82f6;box-shadow:0 0 0 3px rgba(59,130,246,.1)}.dp-textarea::-moz-placeholder{color:var(--p-border-t)}.dp-textarea::placeholder{color:var(--p-border-t)}.dp-meta-label{font-size:10px;font-weight:600;color:var(--p-text-g);text-transform:uppercase;letter-spacing:.04em;margin-bottom:6px}@keyframes pulse-live{0%,to{box-shadow:0 0 0 0 rgba(74,222,128,.4)}50%{box-shadow:0 0 0 4px rgba(74,222,128,0)}}@keyframes agent-pulse{0%,to{opacity:.5}50%{opacity:1}}@keyframes skeleton-pulse{0%,to{opacity:1}50%{opacity:.4}}@keyframes away-glow{0%,to{box-shadow:0 0 0 0 rgba(37,99,235,.45),0 0 24px rgba(37,99,235,.1);border-color:rgba(37,99,235,.35)}50%{box-shadow:0 0 0 14px rgba(37,99,235,0),0 0 48px rgba(37,99,235,.2);border-color:rgba(96,165,250,.6)}}@keyframes away-fade-in{0%{opacity:0;transform:scale(.9)}to{opacity:1;transform:scale(1)}}.focus-within\\:border-blue-500:focus-within{--tw-border-opacity:1;border-color:rgb(59 130 246/var(--tw-border-opacity,1))}.hover\\:bg-red-900\\/40:hover{background-color:rgba(127,29,29,.4)}.hover\\:bg-slate-700:hover{--tw-bg-opacity:1;background-color:rgb(51 65 85/var(--tw-bg-opacity,1))}.hover\\:bg-slate-700\\/50:hover{background-color:rgba(51,65,85,.5)}.hover\\:bg-slate-700\\/60:hover{background-color:rgba(51,65,85,.6)}.hover\\:bg-slate-800:hover{--tw-bg-opacity:1;background-color:rgb(30 41 59/var(--tw-bg-opacity,1))}.hover\\:bg-violet-800\\/30:hover{background-color:rgba(91,33,182,.3)}.hover\\:text-slate-200:hover{--tw-text-opacity:1;color:rgb(226 232 240/var(--tw-text-opacity,1))}.hover\\:text-slate-300:hover{--tw-text-opacity:1;color:rgb(203 213 225/var(--tw-text-opacity,1))}.hover\\:text-violet-300:hover{--tw-text-opacity:1;color:rgb(196 181 253/var(--tw-text-opacity,1))}.hover\\:underline:hover{text-decoration-line:underline}.group\\/comment:hover .group-hover\\/comment\\:opacity-100{opacity:1}`;var ln='"use strict";(()=>{var zg=Object.create;var af=Object.defineProperty;var Ng=Object.getOwnPropertyDescriptor;var Ug=Object.getOwnPropertyNames;var Hg=Object.getPrototypeOf,qg=Object.prototype.hasOwnProperty;var ya=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var _g=(e,t,a,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of Ug(t))!qg.call(e,o)&&o!==a&&af(e,o,{get:()=>t[o],enumerable:!(r=Ng(t,o))||r.enumerable});return e};var E=(e,t,a)=>(a=e!=null?zg(Hg(e)):{},_g(t||!e||!e.__esModule?af(a,"default",{value:e,enumerable:!0}):a,e));var gf=ya(xe=>{"use strict";var Xo=Symbol.for("react.element"),Wg=Symbol.for("react.portal"),$g=Symbol.for("react.fragment"),Vg=Symbol.for("react.strict_mode"),Gg=Symbol.for("react.profiler"),Kg=Symbol.for("react.provider"),jg=Symbol.for("react.context"),Xg=Symbol.for("react.forward_ref"),Qg=Symbol.for("react.suspense"),Yg=Symbol.for("react.memo"),Zg=Symbol.for("react.lazy"),rf=Symbol.iterator;function Jg(e){return e===null||typeof e!="object"?null:(e=rf&&e[rf]||e["@@iterator"],typeof e=="function"?e:null)}var lf={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},sf=Object.assign,uf={};function ro(e,t,a){this.props=e,this.context=t,this.refs=uf,this.updater=a||lf}ro.prototype.isReactComponent={};ro.prototype.setState=function(e,t){if(typeof e!="object"&&typeof e!="function"&&e!=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,e,t,"setState")};ro.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function df(){}df.prototype=ro.prototype;function di(e,t,a){this.props=e,this.context=t,this.refs=uf,this.updater=a||lf}var fi=di.prototype=new df;fi.constructor=di;sf(fi,ro.prototype);fi.isPureReactComponent=!0;var of=Array.isArray,ff=Object.prototype.hasOwnProperty,ci={current:null},cf={key:!0,ref:!0,__self:!0,__source:!0};function pf(e,t,a){var r,o={},n=null,l=null;if(t!=null)for(r in t.ref!==void 0&&(l=t.ref),t.key!==void 0&&(n=""+t.key),t)ff.call(t,r)&&!cf.hasOwnProperty(r)&&(o[r]=t[r]);var s=arguments.length-2;if(s===1)o.children=a;else if(1<s){for(var i=Array(s),d=0;d<s;d++)i[d]=arguments[d+2];o.children=i}if(e&&e.defaultProps)for(r in s=e.defaultProps,s)o[r]===void 0&&(o[r]=s[r]);return{$$typeof:Xo,type:e,key:n,ref:l,props:o,_owner:ci.current}}function eh(e,t){return{$$typeof:Xo,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}function pi(e){return typeof e=="object"&&e!==null&&e.$$typeof===Xo}function th(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(a){return t[a]})}var nf=/\\/+/g;function ui(e,t){return typeof e=="object"&&e!==null&&e.key!=null?th(""+e.key):t.toString(36)}function Ll(e,t,a,r,o){var n=typeof e;(n==="undefined"||n==="boolean")&&(e=null);var l=!1;if(e===null)l=!0;else switch(n){case"string":case"number":l=!0;break;case"object":switch(e.$$typeof){case Xo:case Wg:l=!0}}if(l)return l=e,o=o(l),e=r===""?"."+ui(l,0):r,of(o)?(a="",e!=null&&(a=e.replace(nf,"$&/")+"/"),Ll(o,t,a,"",function(d){return d})):o!=null&&(pi(o)&&(o=eh(o,a+(!o.key||l&&l.key===o.key?"":(""+o.key).replace(nf,"$&/")+"/")+e)),t.push(o)),1;if(l=0,r=r===""?".":r+":",of(e))for(var s=0;s<e.length;s++){n=e[s];var i=r+ui(n,s);l+=Ll(n,t,a,i,o)}else if(i=Jg(e),typeof i=="function")for(e=i.call(e),s=0;!(n=e.next()).done;)n=n.value,i=r+ui(n,s++),l+=Ll(n,t,a,i,o);else if(n==="object")throw t=String(e),Error("Objects are not valid as a React child (found: "+(t==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":t)+"). If you meant to render a collection of children, use an array instead.");return l}function yl(e,t,a){if(e==null)return e;var r=[],o=0;return Ll(e,r,"","",function(n){return t.call(a,n,o++)}),r}function ah(e){if(e._status===-1){var t=e._result;t=t(),t.then(function(a){(e._status===0||e._status===-1)&&(e._status=1,e._result=a)},function(a){(e._status===0||e._status===-1)&&(e._status=2,e._result=a)}),e._status===-1&&(e._status=0,e._result=t)}if(e._status===1)return e._result.default;throw e._result}var xt={current:null},Sl={transition:null},rh={ReactCurrentDispatcher:xt,ReactCurrentBatchConfig:Sl,ReactCurrentOwner:ci};function mf(){throw Error("act(...) is not supported in production builds of React.")}xe.Children={map:yl,forEach:function(e,t,a){yl(e,function(){t.apply(this,arguments)},a)},count:function(e){var t=0;return yl(e,function(){t++}),t},toArray:function(e){return yl(e,function(t){return t})||[]},only:function(e){if(!pi(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};xe.Component=ro;xe.Fragment=$g;xe.Profiler=Gg;xe.PureComponent=di;xe.StrictMode=Vg;xe.Suspense=Qg;xe.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=rh;xe.act=mf;xe.cloneElement=function(e,t,a){if(e==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+e+".");var r=sf({},e.props),o=e.key,n=e.ref,l=e._owner;if(t!=null){if(t.ref!==void 0&&(n=t.ref,l=ci.current),t.key!==void 0&&(o=""+t.key),e.type&&e.type.defaultProps)var s=e.type.defaultProps;for(i in t)ff.call(t,i)&&!cf.hasOwnProperty(i)&&(r[i]=t[i]===void 0&&s!==void 0?s[i]:t[i])}var i=arguments.length-2;if(i===1)r.children=a;else if(1<i){s=Array(i);for(var d=0;d<i;d++)s[d]=arguments[d+2];r.children=s}return{$$typeof:Xo,type:e.type,key:o,ref:n,props:r,_owner:l}};xe.createContext=function(e){return e={$$typeof:jg,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},e.Provider={$$typeof:Kg,_context:e},e.Consumer=e};xe.createElement=pf;xe.createFactory=function(e){var t=pf.bind(null,e);return t.type=e,t};xe.createRef=function(){return{current:null}};xe.forwardRef=function(e){return{$$typeof:Xg,render:e}};xe.isValidElement=pi;xe.lazy=function(e){return{$$typeof:Zg,_payload:{_status:-1,_result:e},_init:ah}};xe.memo=function(e,t){return{$$typeof:Yg,type:e,compare:t===void 0?null:t}};xe.startTransition=function(e){var t=Sl.transition;Sl.transition={};try{e()}finally{Sl.transition=t}};xe.unstable_act=mf;xe.useCallback=function(e,t){return xt.current.useCallback(e,t)};xe.useContext=function(e){return xt.current.useContext(e)};xe.useDebugValue=function(){};xe.useDeferredValue=function(e){return xt.current.useDeferredValue(e)};xe.useEffect=function(e,t){return xt.current.useEffect(e,t)};xe.useId=function(){return xt.current.useId()};xe.useImperativeHandle=function(e,t,a){return xt.current.useImperativeHandle(e,t,a)};xe.useInsertionEffect=function(e,t){return xt.current.useInsertionEffect(e,t)};xe.useLayoutEffect=function(e,t){return xt.current.useLayoutEffect(e,t)};xe.useMemo=function(e,t){return xt.current.useMemo(e,t)};xe.useReducer=function(e,t,a){return xt.current.useReducer(e,t,a)};xe.useRef=function(e){return xt.current.useRef(e)};xe.useState=function(e){return xt.current.useState(e)};xe.useSyncExternalStore=function(e,t,a){return xt.current.useSyncExternalStore(e,t,a)};xe.useTransition=function(){return xt.current.useTransition()};xe.version="18.3.1"});var De=ya((cy,hf)=>{"use strict";hf.exports=gf()});var bf=ya(Ee=>{"use strict";function xi(e,t){var a=e.length;e.push(t);e:for(;0<a;){var r=a-1>>>1,o=e[r];if(0<Il(o,t))e[r]=t,e[a]=o,a=r;else break e}}function Qt(e){return e.length===0?null:e[0]}function wl(e){if(e.length===0)return null;var t=e[0],a=e.pop();if(a!==t){e[0]=a;e:for(var r=0,o=e.length,n=o>>>1;r<n;){var l=2*(r+1)-1,s=e[l],i=l+1,d=e[i];if(0>Il(s,a))i<o&&0>Il(d,s)?(e[r]=d,e[i]=a,r=i):(e[r]=s,e[l]=a,r=l);else if(i<o&&0>Il(d,a))e[r]=d,e[i]=a,r=i;else break e}}return t}function Il(e,t){var a=e.sortIndex-t.sortIndex;return a!==0?a:e.id-t.id}typeof performance=="object"&&typeof performance.now=="function"?(xf=performance,Ee.unstable_now=function(){return xf.now()}):(mi=Date,vf=mi.now(),Ee.unstable_now=function(){return mi.now()-vf});var xf,mi,vf,sa=[],Fa=[],oh=1,zt=null,ut=3,kl=!1,Lr=!1,Yo=!1,Sf=typeof setTimeout=="function"?setTimeout:null,If=typeof clearTimeout=="function"?clearTimeout:null,yf=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function vi(e){for(var t=Qt(Fa);t!==null;){if(t.callback===null)wl(Fa);else if(t.startTime<=e)wl(Fa),t.sortIndex=t.expirationTime,xi(sa,t);else break;t=Qt(Fa)}}function yi(e){if(Yo=!1,vi(e),!Lr)if(Qt(sa)!==null)Lr=!0,Si(Li);else{var t=Qt(Fa);t!==null&&Ii(yi,t.startTime-e)}}function Li(e,t){Lr=!1,Yo&&(Yo=!1,If(Zo),Zo=-1),kl=!0;var a=ut;try{for(vi(t),zt=Qt(sa);zt!==null&&(!(zt.expirationTime>t)||e&&!kf());){var r=zt.callback;if(typeof r=="function"){zt.callback=null,ut=zt.priorityLevel;var o=r(zt.expirationTime<=t);t=Ee.unstable_now(),typeof o=="function"?zt.callback=o:zt===Qt(sa)&&wl(sa),vi(t)}else wl(sa);zt=Qt(sa)}if(zt!==null)var n=!0;else{var l=Qt(Fa);l!==null&&Ii(yi,l.startTime-t),n=!1}return n}finally{zt=null,ut=a,kl=!1}}var bl=!1,Cl=null,Zo=-1,Cf=5,wf=-1;function kf(){return!(Ee.unstable_now()-wf<Cf)}function gi(){if(Cl!==null){var e=Ee.unstable_now();wf=e;var t=!0;try{t=Cl(!0,e)}finally{t?Qo():(bl=!1,Cl=null)}}else bl=!1}var Qo;typeof yf=="function"?Qo=function(){yf(gi)}:typeof MessageChannel<"u"?(hi=new MessageChannel,Lf=hi.port2,hi.port1.onmessage=gi,Qo=function(){Lf.postMessage(null)}):Qo=function(){Sf(gi,0)};var hi,Lf;function Si(e){Cl=e,bl||(bl=!0,Qo())}function Ii(e,t){Zo=Sf(function(){e(Ee.unstable_now())},t)}Ee.unstable_IdlePriority=5;Ee.unstable_ImmediatePriority=1;Ee.unstable_LowPriority=4;Ee.unstable_NormalPriority=3;Ee.unstable_Profiling=null;Ee.unstable_UserBlockingPriority=2;Ee.unstable_cancelCallback=function(e){e.callback=null};Ee.unstable_continueExecution=function(){Lr||kl||(Lr=!0,Si(Li))};Ee.unstable_forceFrameRate=function(e){0>e||125<e?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):Cf=0<e?Math.floor(1e3/e):5};Ee.unstable_getCurrentPriorityLevel=function(){return ut};Ee.unstable_getFirstCallbackNode=function(){return Qt(sa)};Ee.unstable_next=function(e){switch(ut){case 1:case 2:case 3:var t=3;break;default:t=ut}var a=ut;ut=t;try{return e()}finally{ut=a}};Ee.unstable_pauseExecution=function(){};Ee.unstable_requestPaint=function(){};Ee.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var a=ut;ut=e;try{return t()}finally{ut=a}};Ee.unstable_scheduleCallback=function(e,t,a){var r=Ee.unstable_now();switch(typeof a=="object"&&a!==null?(a=a.delay,a=typeof a=="number"&&0<a?r+a:r):a=r,e){case 1:var o=-1;break;case 2:o=250;break;case 5:o=1073741823;break;case 4:o=1e4;break;default:o=5e3}return o=a+o,e={id:oh++,callback:t,priorityLevel:e,startTime:a,expirationTime:o,sortIndex:-1},a>r?(e.sortIndex=a,xi(Fa,e),Qt(sa)===null&&e===Qt(Fa)&&(Yo?(If(Zo),Zo=-1):Yo=!0,Ii(yi,a-r))):(e.sortIndex=o,xi(sa,e),Lr||kl||(Lr=!0,Si(Li))),e};Ee.unstable_shouldYield=kf;Ee.unstable_wrapCallback=function(e){var t=ut;return function(){var a=ut;ut=t;try{return e.apply(this,arguments)}finally{ut=a}}}});var Pf=ya((my,Tf)=>{"use strict";Tf.exports=bf()});var Dm=ya(Ft=>{"use strict";var nh=De(),Dt=Pf();function R(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,a=1;a<arguments.length;a++)t+="&args[]="+encodeURIComponent(arguments[a]);return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var Bc=new Set,Sn={};function Er(e,t){ko(e,t),ko(e+"Capture",t)}function ko(e,t){for(Sn[e]=t,e=0;e<t.length;e++)Bc.add(t[e])}var ka=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Vi=Object.prototype.hasOwnProperty,lh=/^[: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]*$/,Rf={},Mf={};function sh(e){return Vi.call(Mf,e)?!0:Vi.call(Rf,e)?!1:lh.test(e)?Mf[e]=!0:(Rf[e]=!0,!1)}function ih(e,t,a,r){if(a!==null&&a.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return r?!1:a!==null?!a.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function uh(e,t,a,r){if(t===null||typeof t>"u"||ih(e,t,a,r))return!0;if(r)return!1;if(a!==null)switch(a.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function Lt(e,t,a,r,o,n,l){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=r,this.attributeNamespace=o,this.mustUseProperty=a,this.propertyName=e,this.type=t,this.sanitizeURL=n,this.removeEmptyString=l}var lt={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){lt[e]=new Lt(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];lt[t]=new Lt(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){lt[e]=new Lt(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){lt[e]=new Lt(e,2,!1,e,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(e){lt[e]=new Lt(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){lt[e]=new Lt(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){lt[e]=new Lt(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){lt[e]=new Lt(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){lt[e]=new Lt(e,5,!1,e.toLowerCase(),null,!1,!1)});var zu=/[\\-:]([a-z])/g;function Nu(e){return e[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(e){var t=e.replace(zu,Nu);lt[t]=new Lt(t,1,!1,e,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(zu,Nu);lt[t]=new Lt(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(zu,Nu);lt[t]=new Lt(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){lt[e]=new Lt(e,1,!1,e.toLowerCase(),null,!1,!1)});lt.xlinkHref=new Lt("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){lt[e]=new Lt(e,1,!1,e.toLowerCase(),null,!0,!0)});function Uu(e,t,a,r){var o=lt.hasOwnProperty(t)?lt[t]:null;(o!==null?o.type!==0:r||!(2<t.length)||t[0]!=="o"&&t[0]!=="O"||t[1]!=="n"&&t[1]!=="N")&&(uh(t,a,o,r)&&(a=null),r||o===null?sh(t)&&(a===null?e.removeAttribute(t):e.setAttribute(t,""+a)):o.mustUseProperty?e[o.propertyName]=a===null?o.type===3?!1:"":a:(t=o.attributeName,r=o.attributeNamespace,a===null?e.removeAttribute(t):(o=o.type,a=o===3||o===4&&a===!0?"":""+a,r?e.setAttributeNS(r,t,a):e.setAttribute(t,a))))}var Ra=nh.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,Tl=Symbol.for("react.element"),lo=Symbol.for("react.portal"),so=Symbol.for("react.fragment"),Hu=Symbol.for("react.strict_mode"),Gi=Symbol.for("react.profiler"),Oc=Symbol.for("react.provider"),zc=Symbol.for("react.context"),qu=Symbol.for("react.forward_ref"),Ki=Symbol.for("react.suspense"),ji=Symbol.for("react.suspense_list"),_u=Symbol.for("react.memo"),Oa=Symbol.for("react.lazy");Symbol.for("react.scope");Symbol.for("react.debug_trace_mode");var Nc=Symbol.for("react.offscreen");Symbol.for("react.legacy_hidden");Symbol.for("react.cache");Symbol.for("react.tracing_marker");var Af=Symbol.iterator;function Jo(e){return e===null||typeof e!="object"?null:(e=Af&&e[Af]||e["@@iterator"],typeof e=="function"?e:null)}var We=Object.assign,Ci;function sn(e){if(Ci===void 0)try{throw Error()}catch(a){var t=a.stack.trim().match(/\\n( *(at )?)/);Ci=t&&t[1]||""}return`\n`+Ci+e}var wi=!1;function ki(e,t){if(!e||wi)return"";wi=!0;var a=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(t)if(t=function(){throw Error()},Object.defineProperty(t.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(t,[])}catch(d){var r=d}Reflect.construct(e,[],t)}else{try{t.call()}catch(d){r=d}e.call(t.prototype)}else{try{throw Error()}catch(d){r=d}e()}}catch(d){if(d&&r&&typeof d.stack=="string"){for(var o=d.stack.split(`\n`),n=r.stack.split(`\n`),l=o.length-1,s=n.length-1;1<=l&&0<=s&&o[l]!==n[s];)s--;for(;1<=l&&0<=s;l--,s--)if(o[l]!==n[s]){if(l!==1||s!==1)do if(l--,s--,0>s||o[l]!==n[s]){var i=`\n`+o[l].replace(" at new "," at ");return e.displayName&&i.includes("<anonymous>")&&(i=i.replace("<anonymous>",e.displayName)),i}while(1<=l&&0<=s);break}}}finally{wi=!1,Error.prepareStackTrace=a}return(e=e?e.displayName||e.name:"")?sn(e):""}function dh(e){switch(e.tag){case 5:return sn(e.type);case 16:return sn("Lazy");case 13:return sn("Suspense");case 19:return sn("SuspenseList");case 0:case 2:case 15:return e=ki(e.type,!1),e;case 11:return e=ki(e.type.render,!1),e;case 1:return e=ki(e.type,!0),e;default:return""}}function Xi(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case so:return"Fragment";case lo:return"Portal";case Gi:return"Profiler";case Hu:return"StrictMode";case Ki:return"Suspense";case ji:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case zc:return(e.displayName||"Context")+".Consumer";case Oc:return(e._context.displayName||"Context")+".Provider";case qu:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case _u:return t=e.displayName||null,t!==null?t:Xi(e.type)||"Memo";case Oa:t=e._payload,e=e._init;try{return Xi(e(t))}catch{}}return null}function fh(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return Xi(t);case 8:return t===Hu?"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 t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function Qa(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Uc(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function ch(e){var t=Uc(e)?"checked":"value",a=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=""+e[t];if(!e.hasOwnProperty(t)&&typeof a<"u"&&typeof a.get=="function"&&typeof a.set=="function"){var o=a.get,n=a.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return o.call(this)},set:function(l){r=""+l,n.call(this,l)}}),Object.defineProperty(e,t,{enumerable:a.enumerable}),{getValue:function(){return r},setValue:function(l){r=""+l},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Pl(e){e._valueTracker||(e._valueTracker=ch(e))}function Hc(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var a=t.getValue(),r="";return e&&(r=Uc(e)?e.checked?"true":"false":e.value),e=r,e!==a?(t.setValue(e),!0):!1}function as(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function Qi(e,t){var a=t.checked;return We({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:a??e._wrapperState.initialChecked})}function Df(e,t){var a=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;a=Qa(t.value!=null?t.value:a),e._wrapperState={initialChecked:r,initialValue:a,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function qc(e,t){t=t.checked,t!=null&&Uu(e,"checked",t,!1)}function Yi(e,t){qc(e,t);var a=Qa(t.value),r=t.type;if(a!=null)r==="number"?(a===0&&e.value===""||e.value!=a)&&(e.value=""+a):e.value!==""+a&&(e.value=""+a);else if(r==="submit"||r==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?Zi(e,t.type,a):t.hasOwnProperty("defaultValue")&&Zi(e,t.type,Qa(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function Ef(e,t,a){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var r=t.type;if(!(r!=="submit"&&r!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,a||t===e.value||(e.value=t),e.defaultValue=t}a=e.name,a!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,a!==""&&(e.name=a)}function Zi(e,t,a){(t!=="number"||as(e.ownerDocument)!==e)&&(a==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+a&&(e.defaultValue=""+a))}var un=Array.isArray;function yo(e,t,a,r){if(e=e.options,t){t={};for(var o=0;o<a.length;o++)t["$"+a[o]]=!0;for(a=0;a<e.length;a++)o=t.hasOwnProperty("$"+e[a].value),e[a].selected!==o&&(e[a].selected=o),o&&r&&(e[a].defaultSelected=!0)}else{for(a=""+Qa(a),t=null,o=0;o<e.length;o++){if(e[o].value===a){e[o].selected=!0,r&&(e[o].defaultSelected=!0);return}t!==null||e[o].disabled||(t=e[o])}t!==null&&(t.selected=!0)}}function Ji(e,t){if(t.dangerouslySetInnerHTML!=null)throw Error(R(91));return We({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function Ff(e,t){var a=t.value;if(a==null){if(a=t.children,t=t.defaultValue,a!=null){if(t!=null)throw Error(R(92));if(un(a)){if(1<a.length)throw Error(R(93));a=a[0]}t=a}t==null&&(t=""),a=t}e._wrapperState={initialValue:Qa(a)}}function _c(e,t){var a=Qa(t.value),r=Qa(t.defaultValue);a!=null&&(a=""+a,a!==e.value&&(e.value=a),t.defaultValue==null&&e.defaultValue!==a&&(e.defaultValue=a)),r!=null&&(e.defaultValue=""+r)}function Bf(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==""&&t!==null&&(e.value=t)}function Wc(e){switch(e){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 eu(e,t){return e==null||e==="http://www.w3.org/1999/xhtml"?Wc(t):e==="http://www.w3.org/2000/svg"&&t==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var Rl,$c=(function(e){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(t,a,r,o){MSApp.execUnsafeLocalFunction(function(){return e(t,a,r,o)})}:e})(function(e,t){if(e.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in e)e.innerHTML=t;else{for(Rl=Rl||document.createElement("div"),Rl.innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=Rl.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function In(e,t){if(t){var a=e.firstChild;if(a&&a===e.lastChild&&a.nodeType===3){a.nodeValue=t;return}}e.textContent=t}var cn={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},ph=["Webkit","ms","Moz","O"];Object.keys(cn).forEach(function(e){ph.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),cn[t]=cn[e]})});function Vc(e,t,a){return t==null||typeof t=="boolean"||t===""?"":a||typeof t!="number"||t===0||cn.hasOwnProperty(e)&&cn[e]?(""+t).trim():t+"px"}function Gc(e,t){e=e.style;for(var a in t)if(t.hasOwnProperty(a)){var r=a.indexOf("--")===0,o=Vc(a,t[a],r);a==="float"&&(a="cssFloat"),r?e.setProperty(a,o):e[a]=o}}var mh=We({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 tu(e,t){if(t){if(mh[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(R(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(R(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(R(61))}if(t.style!=null&&typeof t.style!="object")throw Error(R(62))}}function au(e,t){if(e.indexOf("-")===-1)return typeof t.is=="string";switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var ru=null;function Wu(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var ou=null,Lo=null,So=null;function Of(e){if(e=Hn(e)){if(typeof ou!="function")throw Error(R(280));var t=e.stateNode;t&&(t=Ms(t),ou(e.stateNode,e.type,t))}}function Kc(e){Lo?So?So.push(e):So=[e]:Lo=e}function jc(){if(Lo){var e=Lo,t=So;if(So=Lo=null,Of(e),t)for(e=0;e<t.length;e++)Of(t[e])}}function Xc(e,t){return e(t)}function Qc(){}var bi=!1;function Yc(e,t,a){if(bi)return e(t,a);bi=!0;try{return Xc(e,t,a)}finally{bi=!1,(Lo!==null||So!==null)&&(Qc(),jc())}}function Cn(e,t){var a=e.stateNode;if(a===null)return null;var r=Ms(a);if(r===null)return null;a=r[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(r=!r.disabled)||(e=e.type,r=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!r;break e;default:e=!1}if(e)return null;if(a&&typeof a!="function")throw Error(R(231,t,typeof a));return a}var nu=!1;if(ka)try{oo={},Object.defineProperty(oo,"passive",{get:function(){nu=!0}}),window.addEventListener("test",oo,oo),window.removeEventListener("test",oo,oo)}catch{nu=!1}var oo;function gh(e,t,a,r,o,n,l,s,i){var d=Array.prototype.slice.call(arguments,3);try{t.apply(a,d)}catch(c){this.onError(c)}}var pn=!1,rs=null,os=!1,lu=null,hh={onError:function(e){pn=!0,rs=e}};function xh(e,t,a,r,o,n,l,s,i){pn=!1,rs=null,gh.apply(hh,arguments)}function vh(e,t,a,r,o,n,l,s,i){if(xh.apply(this,arguments),pn){if(pn){var d=rs;pn=!1,rs=null}else throw Error(R(198));os||(os=!0,lu=d)}}function Fr(e){var t=e,a=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,(t.flags&4098)!==0&&(a=t.return),e=t.return;while(e)}return t.tag===3?a:null}function Zc(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function zf(e){if(Fr(e)!==e)throw Error(R(188))}function yh(e){var t=e.alternate;if(!t){if(t=Fr(e),t===null)throw Error(R(188));return t!==e?null:e}for(var a=e,r=t;;){var o=a.return;if(o===null)break;var n=o.alternate;if(n===null){if(r=o.return,r!==null){a=r;continue}break}if(o.child===n.child){for(n=o.child;n;){if(n===a)return zf(o),e;if(n===r)return zf(o),t;n=n.sibling}throw Error(R(188))}if(a.return!==r.return)a=o,r=n;else{for(var l=!1,s=o.child;s;){if(s===a){l=!0,a=o,r=n;break}if(s===r){l=!0,r=o,a=n;break}s=s.sibling}if(!l){for(s=n.child;s;){if(s===a){l=!0,a=n,r=o;break}if(s===r){l=!0,r=n,a=o;break}s=s.sibling}if(!l)throw Error(R(189))}}if(a.alternate!==r)throw Error(R(190))}if(a.tag!==3)throw Error(R(188));return a.stateNode.current===a?e:t}function Jc(e){return e=yh(e),e!==null?ep(e):null}function ep(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=ep(e);if(t!==null)return t;e=e.sibling}return null}var tp=Dt.unstable_scheduleCallback,Nf=Dt.unstable_cancelCallback,Lh=Dt.unstable_shouldYield,Sh=Dt.unstable_requestPaint,je=Dt.unstable_now,Ih=Dt.unstable_getCurrentPriorityLevel,$u=Dt.unstable_ImmediatePriority,ap=Dt.unstable_UserBlockingPriority,ns=Dt.unstable_NormalPriority,Ch=Dt.unstable_LowPriority,rp=Dt.unstable_IdlePriority,bs=null,fa=null;function wh(e){if(fa&&typeof fa.onCommitFiberRoot=="function")try{fa.onCommitFiberRoot(bs,e,void 0,(e.current.flags&128)===128)}catch{}}var ta=Math.clz32?Math.clz32:Th,kh=Math.log,bh=Math.LN2;function Th(e){return e>>>=0,e===0?32:31-(kh(e)/bh|0)|0}var Ml=64,Al=4194304;function dn(e){switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64: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 e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function ls(e,t){var a=e.pendingLanes;if(a===0)return 0;var r=0,o=e.suspendedLanes,n=e.pingedLanes,l=a&268435455;if(l!==0){var s=l&~o;s!==0?r=dn(s):(n&=l,n!==0&&(r=dn(n)))}else l=a&~o,l!==0?r=dn(l):n!==0&&(r=dn(n));if(r===0)return 0;if(t!==0&&t!==r&&(t&o)===0&&(o=r&-r,n=t&-t,o>=n||o===16&&(n&4194240)!==0))return t;if((r&4)!==0&&(r|=a&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=r;0<t;)a=31-ta(t),o=1<<a,r|=e[a],t&=~o;return r}function Ph(e,t){switch(e){case 1:case 2:case 4:return t+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 t+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 Rh(e,t){for(var a=e.suspendedLanes,r=e.pingedLanes,o=e.expirationTimes,n=e.pendingLanes;0<n;){var l=31-ta(n),s=1<<l,i=o[l];i===-1?((s&a)===0||(s&r)!==0)&&(o[l]=Ph(s,t)):i<=t&&(e.expiredLanes|=s),n&=~s}}function su(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function op(){var e=Ml;return Ml<<=1,(Ml&4194240)===0&&(Ml=64),e}function Ti(e){for(var t=[],a=0;31>a;a++)t.push(e);return t}function Nn(e,t,a){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-ta(t),e[t]=a}function Mh(e,t){var a=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var r=e.eventTimes;for(e=e.expirationTimes;0<a;){var o=31-ta(a),n=1<<o;t[o]=0,r[o]=-1,e[o]=-1,a&=~n}}function Vu(e,t){var a=e.entangledLanes|=t;for(e=e.entanglements;a;){var r=31-ta(a),o=1<<r;o&t|e[r]&t&&(e[r]|=t),a&=~o}}var Re=0;function np(e){return e&=-e,1<e?4<e?(e&268435455)!==0?16:536870912:4:1}var lp,Gu,sp,ip,up,iu=!1,Dl=[],_a=null,Wa=null,$a=null,wn=new Map,kn=new Map,Na=[],Ah="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 Uf(e,t){switch(e){case"focusin":case"focusout":_a=null;break;case"dragenter":case"dragleave":Wa=null;break;case"mouseover":case"mouseout":$a=null;break;case"pointerover":case"pointerout":wn.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":kn.delete(t.pointerId)}}function en(e,t,a,r,o,n){return e===null||e.nativeEvent!==n?(e={blockedOn:t,domEventName:a,eventSystemFlags:r,nativeEvent:n,targetContainers:[o]},t!==null&&(t=Hn(t),t!==null&&Gu(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,o!==null&&t.indexOf(o)===-1&&t.push(o),e)}function Dh(e,t,a,r,o){switch(t){case"focusin":return _a=en(_a,e,t,a,r,o),!0;case"dragenter":return Wa=en(Wa,e,t,a,r,o),!0;case"mouseover":return $a=en($a,e,t,a,r,o),!0;case"pointerover":var n=o.pointerId;return wn.set(n,en(wn.get(n)||null,e,t,a,r,o)),!0;case"gotpointercapture":return n=o.pointerId,kn.set(n,en(kn.get(n)||null,e,t,a,r,o)),!0}return!1}function dp(e){var t=Cr(e.target);if(t!==null){var a=Fr(t);if(a!==null){if(t=a.tag,t===13){if(t=Zc(a),t!==null){e.blockedOn=t,up(e.priority,function(){sp(a)});return}}else if(t===3&&a.stateNode.current.memoizedState.isDehydrated){e.blockedOn=a.tag===3?a.stateNode.containerInfo:null;return}}}e.blockedOn=null}function Gl(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var a=uu(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(a===null){a=e.nativeEvent;var r=new a.constructor(a.type,a);ru=r,a.target.dispatchEvent(r),ru=null}else return t=Hn(a),t!==null&&Gu(t),e.blockedOn=a,!1;t.shift()}return!0}function Hf(e,t,a){Gl(e)&&a.delete(t)}function Eh(){iu=!1,_a!==null&&Gl(_a)&&(_a=null),Wa!==null&&Gl(Wa)&&(Wa=null),$a!==null&&Gl($a)&&($a=null),wn.forEach(Hf),kn.forEach(Hf)}function tn(e,t){e.blockedOn===t&&(e.blockedOn=null,iu||(iu=!0,Dt.unstable_scheduleCallback(Dt.unstable_NormalPriority,Eh)))}function bn(e){function t(o){return tn(o,e)}if(0<Dl.length){tn(Dl[0],e);for(var a=1;a<Dl.length;a++){var r=Dl[a];r.blockedOn===e&&(r.blockedOn=null)}}for(_a!==null&&tn(_a,e),Wa!==null&&tn(Wa,e),$a!==null&&tn($a,e),wn.forEach(t),kn.forEach(t),a=0;a<Na.length;a++)r=Na[a],r.blockedOn===e&&(r.blockedOn=null);for(;0<Na.length&&(a=Na[0],a.blockedOn===null);)dp(a),a.blockedOn===null&&Na.shift()}var Io=Ra.ReactCurrentBatchConfig,ss=!0;function Fh(e,t,a,r){var o=Re,n=Io.transition;Io.transition=null;try{Re=1,Ku(e,t,a,r)}finally{Re=o,Io.transition=n}}function Bh(e,t,a,r){var o=Re,n=Io.transition;Io.transition=null;try{Re=4,Ku(e,t,a,r)}finally{Re=o,Io.transition=n}}function Ku(e,t,a,r){if(ss){var o=uu(e,t,a,r);if(o===null)Fi(e,t,r,is,a),Uf(e,r);else if(Dh(o,e,t,a,r))r.stopPropagation();else if(Uf(e,r),t&4&&-1<Ah.indexOf(e)){for(;o!==null;){var n=Hn(o);if(n!==null&&lp(n),n=uu(e,t,a,r),n===null&&Fi(e,t,r,is,a),n===o)break;o=n}o!==null&&r.stopPropagation()}else Fi(e,t,r,null,a)}}var is=null;function uu(e,t,a,r){if(is=null,e=Wu(r),e=Cr(e),e!==null)if(t=Fr(e),t===null)e=null;else if(a=t.tag,a===13){if(e=Zc(t),e!==null)return e;e=null}else if(a===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null);return is=e,null}function fp(e){switch(e){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(Ih()){case $u:return 1;case ap:return 4;case ns:case Ch:return 16;case rp:return 536870912;default:return 16}default:return 16}}var Ha=null,ju=null,Kl=null;function cp(){if(Kl)return Kl;var e,t=ju,a=t.length,r,o="value"in Ha?Ha.value:Ha.textContent,n=o.length;for(e=0;e<a&&t[e]===o[e];e++);var l=a-e;for(r=1;r<=l&&t[a-r]===o[n-r];r++);return Kl=o.slice(e,1<r?1-r:void 0)}function jl(e){var t=e.keyCode;return"charCode"in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function El(){return!0}function qf(){return!1}function Et(e){function t(a,r,o,n,l){this._reactName=a,this._targetInst=o,this.type=r,this.nativeEvent=n,this.target=l,this.currentTarget=null;for(var s in e)e.hasOwnProperty(s)&&(a=e[s],this[s]=a?a(n):n[s]);return this.isDefaultPrevented=(n.defaultPrevented!=null?n.defaultPrevented:n.returnValue===!1)?El:qf,this.isPropagationStopped=qf,this}return We(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var a=this.nativeEvent;a&&(a.preventDefault?a.preventDefault():typeof a.returnValue!="unknown"&&(a.returnValue=!1),this.isDefaultPrevented=El)},stopPropagation:function(){var a=this.nativeEvent;a&&(a.stopPropagation?a.stopPropagation():typeof a.cancelBubble!="unknown"&&(a.cancelBubble=!0),this.isPropagationStopped=El)},persist:function(){},isPersistent:El}),t}var Do={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Xu=Et(Do),Un=We({},Do,{view:0,detail:0}),Oh=Et(Un),Pi,Ri,an,Ts=We({},Un,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Qu,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return"movementX"in e?e.movementX:(e!==an&&(an&&e.type==="mousemove"?(Pi=e.screenX-an.screenX,Ri=e.screenY-an.screenY):Ri=Pi=0,an=e),Pi)},movementY:function(e){return"movementY"in e?e.movementY:Ri}}),_f=Et(Ts),zh=We({},Ts,{dataTransfer:0}),Nh=Et(zh),Uh=We({},Un,{relatedTarget:0}),Mi=Et(Uh),Hh=We({},Do,{animationName:0,elapsedTime:0,pseudoElement:0}),qh=Et(Hh),_h=We({},Do,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),Wh=Et(_h),$h=We({},Do,{data:0}),Wf=Et($h),Vh={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Gh={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"},Kh={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function jh(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=Kh[e])?!!t[e]:!1}function Qu(){return jh}var Xh=We({},Un,{key:function(e){if(e.key){var t=Vh[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=jl(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?Gh[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Qu,charCode:function(e){return e.type==="keypress"?jl(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?jl(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),Qh=Et(Xh),Yh=We({},Ts,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),$f=Et(Yh),Zh=We({},Un,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Qu}),Jh=Et(Zh),ex=We({},Do,{propertyName:0,elapsedTime:0,pseudoElement:0}),tx=Et(ex),ax=We({},Ts,{deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0}),rx=Et(ax),ox=[9,13,27,32],Yu=ka&&"CompositionEvent"in window,mn=null;ka&&"documentMode"in document&&(mn=document.documentMode);var nx=ka&&"TextEvent"in window&&!mn,pp=ka&&(!Yu||mn&&8<mn&&11>=mn),Vf=" ",Gf=!1;function mp(e,t){switch(e){case"keyup":return ox.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function gp(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var io=!1;function lx(e,t){switch(e){case"compositionend":return gp(t);case"keypress":return t.which!==32?null:(Gf=!0,Vf);case"textInput":return e=t.data,e===Vf&&Gf?null:e;default:return null}}function sx(e,t){if(io)return e==="compositionend"||!Yu&&mp(e,t)?(e=cp(),Kl=ju=Ha=null,io=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case"compositionend":return pp&&t.locale!=="ko"?null:t.data;default:return null}}var ix={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 Kf(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!ix[e.type]:t==="textarea"}function hp(e,t,a,r){Kc(r),t=us(t,"onChange"),0<t.length&&(a=new Xu("onChange","change",null,a,r),e.push({event:a,listeners:t}))}var gn=null,Tn=null;function ux(e){Tp(e,0)}function Ps(e){var t=co(e);if(Hc(t))return e}function dx(e,t){if(e==="change")return t}var xp=!1;ka&&(ka?(Bl="oninput"in document,Bl||(Ai=document.createElement("div"),Ai.setAttribute("oninput","return;"),Bl=typeof Ai.oninput=="function"),Fl=Bl):Fl=!1,xp=Fl&&(!document.documentMode||9<document.documentMode));var Fl,Bl,Ai;function jf(){gn&&(gn.detachEvent("onpropertychange",vp),Tn=gn=null)}function vp(e){if(e.propertyName==="value"&&Ps(Tn)){var t=[];hp(t,Tn,e,Wu(e)),Yc(ux,t)}}function fx(e,t,a){e==="focusin"?(jf(),gn=t,Tn=a,gn.attachEvent("onpropertychange",vp)):e==="focusout"&&jf()}function cx(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Ps(Tn)}function px(e,t){if(e==="click")return Ps(t)}function mx(e,t){if(e==="input"||e==="change")return Ps(t)}function gx(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var ra=typeof Object.is=="function"?Object.is:gx;function Pn(e,t){if(ra(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var a=Object.keys(e),r=Object.keys(t);if(a.length!==r.length)return!1;for(r=0;r<a.length;r++){var o=a[r];if(!Vi.call(t,o)||!ra(e[o],t[o]))return!1}return!0}function Xf(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Qf(e,t){var a=Xf(e);e=0;for(var r;a;){if(a.nodeType===3){if(r=e+a.textContent.length,e<=t&&r>=t)return{node:a,offset:t-e};e=r}e:{for(;a;){if(a.nextSibling){a=a.nextSibling;break e}a=a.parentNode}a=void 0}a=Xf(a)}}function yp(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?yp(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Lp(){for(var e=window,t=as();t instanceof e.HTMLIFrameElement;){try{var a=typeof t.contentWindow.location.href=="string"}catch{a=!1}if(a)e=t.contentWindow;else break;t=as(e.document)}return t}function Zu(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}function hx(e){var t=Lp(),a=e.focusedElem,r=e.selectionRange;if(t!==a&&a&&a.ownerDocument&&yp(a.ownerDocument.documentElement,a)){if(r!==null&&Zu(a)){if(t=r.start,e=r.end,e===void 0&&(e=t),"selectionStart"in a)a.selectionStart=t,a.selectionEnd=Math.min(e,a.value.length);else if(e=(t=a.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var o=a.textContent.length,n=Math.min(r.start,o);r=r.end===void 0?n:Math.min(r.end,o),!e.extend&&n>r&&(o=r,r=n,n=o),o=Qf(a,n);var l=Qf(a,r);o&&l&&(e.rangeCount!==1||e.anchorNode!==o.node||e.anchorOffset!==o.offset||e.focusNode!==l.node||e.focusOffset!==l.offset)&&(t=t.createRange(),t.setStart(o.node,o.offset),e.removeAllRanges(),n>r?(e.addRange(t),e.extend(l.node,l.offset)):(t.setEnd(l.node,l.offset),e.addRange(t)))}}for(t=[],e=a;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof a.focus=="function"&&a.focus(),a=0;a<t.length;a++)e=t[a],e.element.scrollLeft=e.left,e.element.scrollTop=e.top}}var xx=ka&&"documentMode"in document&&11>=document.documentMode,uo=null,du=null,hn=null,fu=!1;function Yf(e,t,a){var r=a.window===a?a.document:a.nodeType===9?a:a.ownerDocument;fu||uo==null||uo!==as(r)||(r=uo,"selectionStart"in r&&Zu(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),hn&&Pn(hn,r)||(hn=r,r=us(du,"onSelect"),0<r.length&&(t=new Xu("onSelect","select",null,t,a),e.push({event:t,listeners:r}),t.target=uo)))}function Ol(e,t){var a={};return a[e.toLowerCase()]=t.toLowerCase(),a["Webkit"+e]="webkit"+t,a["Moz"+e]="moz"+t,a}var fo={animationend:Ol("Animation","AnimationEnd"),animationiteration:Ol("Animation","AnimationIteration"),animationstart:Ol("Animation","AnimationStart"),transitionend:Ol("Transition","TransitionEnd")},Di={},Sp={};ka&&(Sp=document.createElement("div").style,"AnimationEvent"in window||(delete fo.animationend.animation,delete fo.animationiteration.animation,delete fo.animationstart.animation),"TransitionEvent"in window||delete fo.transitionend.transition);function Rs(e){if(Di[e])return Di[e];if(!fo[e])return e;var t=fo[e],a;for(a in t)if(t.hasOwnProperty(a)&&a in Sp)return Di[e]=t[a];return e}var Ip=Rs("animationend"),Cp=Rs("animationiteration"),wp=Rs("animationstart"),kp=Rs("transitionend"),bp=new Map,Zf="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 Za(e,t){bp.set(e,t),Er(t,[e])}for(zl=0;zl<Zf.length;zl++)Nl=Zf[zl],Jf=Nl.toLowerCase(),ec=Nl[0].toUpperCase()+Nl.slice(1),Za(Jf,"on"+ec);var Nl,Jf,ec,zl;Za(Ip,"onAnimationEnd");Za(Cp,"onAnimationIteration");Za(wp,"onAnimationStart");Za("dblclick","onDoubleClick");Za("focusin","onFocus");Za("focusout","onBlur");Za(kp,"onTransitionEnd");ko("onMouseEnter",["mouseout","mouseover"]);ko("onMouseLeave",["mouseout","mouseover"]);ko("onPointerEnter",["pointerout","pointerover"]);ko("onPointerLeave",["pointerout","pointerover"]);Er("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));Er("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));Er("onBeforeInput",["compositionend","keypress","textInput","paste"]);Er("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));Er("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));Er("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var fn="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(" "),vx=new Set("cancel close invalid load scroll toggle".split(" ").concat(fn));function tc(e,t,a){var r=e.type||"unknown-event";e.currentTarget=a,vh(r,t,void 0,e),e.currentTarget=null}function Tp(e,t){t=(t&4)!==0;for(var a=0;a<e.length;a++){var r=e[a],o=r.event;r=r.listeners;e:{var n=void 0;if(t)for(var l=r.length-1;0<=l;l--){var s=r[l],i=s.instance,d=s.currentTarget;if(s=s.listener,i!==n&&o.isPropagationStopped())break e;tc(o,s,d),n=i}else for(l=0;l<r.length;l++){if(s=r[l],i=s.instance,d=s.currentTarget,s=s.listener,i!==n&&o.isPropagationStopped())break e;tc(o,s,d),n=i}}}if(os)throw e=lu,os=!1,lu=null,e}function Ne(e,t){var a=t[hu];a===void 0&&(a=t[hu]=new Set);var r=e+"__bubble";a.has(r)||(Pp(t,e,2,!1),a.add(r))}function Ei(e,t,a){var r=0;t&&(r|=4),Pp(a,e,r,t)}var Ul="_reactListening"+Math.random().toString(36).slice(2);function Rn(e){if(!e[Ul]){e[Ul]=!0,Bc.forEach(function(a){a!=="selectionchange"&&(vx.has(a)||Ei(a,!1,e),Ei(a,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Ul]||(t[Ul]=!0,Ei("selectionchange",!1,t))}}function Pp(e,t,a,r){switch(fp(t)){case 1:var o=Fh;break;case 4:o=Bh;break;default:o=Ku}a=o.bind(null,t,a,e),o=void 0,!nu||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(o=!0),r?o!==void 0?e.addEventListener(t,a,{capture:!0,passive:o}):e.addEventListener(t,a,!0):o!==void 0?e.addEventListener(t,a,{passive:o}):e.addEventListener(t,a,!1)}function Fi(e,t,a,r,o){var n=r;if((t&1)===0&&(t&2)===0&&r!==null)e:for(;;){if(r===null)return;var l=r.tag;if(l===3||l===4){var s=r.stateNode.containerInfo;if(s===o||s.nodeType===8&&s.parentNode===o)break;if(l===4)for(l=r.return;l!==null;){var i=l.tag;if((i===3||i===4)&&(i=l.stateNode.containerInfo,i===o||i.nodeType===8&&i.parentNode===o))return;l=l.return}for(;s!==null;){if(l=Cr(s),l===null)return;if(i=l.tag,i===5||i===6){r=n=l;continue e}s=s.parentNode}}r=r.return}Yc(function(){var d=n,c=Wu(a),p=[];e:{var g=bp.get(e);if(g!==void 0){var L=Xu,x=e;switch(e){case"keypress":if(jl(a)===0)break e;case"keydown":case"keyup":L=Qh;break;case"focusin":x="focus",L=Mi;break;case"focusout":x="blur",L=Mi;break;case"beforeblur":case"afterblur":L=Mi;break;case"click":if(a.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":L=_f;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":L=Nh;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":L=Jh;break;case Ip:case Cp:case wp:L=qh;break;case kp:L=tx;break;case"scroll":L=Oh;break;case"wheel":L=rx;break;case"copy":case"cut":case"paste":L=Wh;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":L=$f}var I=(t&4)!==0,N=!I&&e==="scroll",m=I?g!==null?g+"Capture":null:g;I=[];for(var u=d,f;u!==null;){f=u;var v=f.stateNode;if(f.tag===5&&v!==null&&(f=v,m!==null&&(v=Cn(u,m),v!=null&&I.push(Mn(u,v,f)))),N)break;u=u.return}0<I.length&&(g=new L(g,x,null,a,c),p.push({event:g,listeners:I}))}}if((t&7)===0){e:{if(g=e==="mouseover"||e==="pointerover",L=e==="mouseout"||e==="pointerout",g&&a!==ru&&(x=a.relatedTarget||a.fromElement)&&(Cr(x)||x[ba]))break e;if((L||g)&&(g=c.window===c?c:(g=c.ownerDocument)?g.defaultView||g.parentWindow:window,L?(x=a.relatedTarget||a.toElement,L=d,x=x?Cr(x):null,x!==null&&(N=Fr(x),x!==N||x.tag!==5&&x.tag!==6)&&(x=null)):(L=null,x=d),L!==x)){if(I=_f,v="onMouseLeave",m="onMouseEnter",u="mouse",(e==="pointerout"||e==="pointerover")&&(I=$f,v="onPointerLeave",m="onPointerEnter",u="pointer"),N=L==null?g:co(L),f=x==null?g:co(x),g=new I(v,u+"leave",L,a,c),g.target=N,g.relatedTarget=f,v=null,Cr(c)===d&&(I=new I(m,u+"enter",x,a,c),I.target=f,I.relatedTarget=N,v=I),N=v,L&&x)t:{for(I=L,m=x,u=0,f=I;f;f=no(f))u++;for(f=0,v=m;v;v=no(v))f++;for(;0<u-f;)I=no(I),u--;for(;0<f-u;)m=no(m),f--;for(;u--;){if(I===m||m!==null&&I===m.alternate)break t;I=no(I),m=no(m)}I=null}else I=null;L!==null&&ac(p,g,L,I,!1),x!==null&&N!==null&&ac(p,N,x,I,!0)}}e:{if(g=d?co(d):window,L=g.nodeName&&g.nodeName.toLowerCase(),L==="select"||L==="input"&&g.type==="file")var C=dx;else if(Kf(g))if(xp)C=mx;else{C=cx;var w=fx}else(L=g.nodeName)&&L.toLowerCase()==="input"&&(g.type==="checkbox"||g.type==="radio")&&(C=px);if(C&&(C=C(e,d))){hp(p,C,a,c);break e}w&&w(e,g,d),e==="focusout"&&(w=g._wrapperState)&&w.controlled&&g.type==="number"&&Zi(g,"number",g.value)}switch(w=d?co(d):window,e){case"focusin":(Kf(w)||w.contentEditable==="true")&&(uo=w,du=d,hn=null);break;case"focusout":hn=du=uo=null;break;case"mousedown":fu=!0;break;case"contextmenu":case"mouseup":case"dragend":fu=!1,Yf(p,a,c);break;case"selectionchange":if(xx)break;case"keydown":case"keyup":Yf(p,a,c)}var y;if(Yu)e:{switch(e){case"compositionstart":var k="onCompositionStart";break e;case"compositionend":k="onCompositionEnd";break e;case"compositionupdate":k="onCompositionUpdate";break e}k=void 0}else io?mp(e,a)&&(k="onCompositionEnd"):e==="keydown"&&a.keyCode===229&&(k="onCompositionStart");k&&(pp&&a.locale!=="ko"&&(io||k!=="onCompositionStart"?k==="onCompositionEnd"&&io&&(y=cp()):(Ha=c,ju="value"in Ha?Ha.value:Ha.textContent,io=!0)),w=us(d,k),0<w.length&&(k=new Wf(k,e,null,a,c),p.push({event:k,listeners:w}),y?k.data=y:(y=gp(a),y!==null&&(k.data=y)))),(y=nx?lx(e,a):sx(e,a))&&(d=us(d,"onBeforeInput"),0<d.length&&(c=new Wf("onBeforeInput","beforeinput",null,a,c),p.push({event:c,listeners:d}),c.data=y))}Tp(p,t)})}function Mn(e,t,a){return{instance:e,listener:t,currentTarget:a}}function us(e,t){for(var a=t+"Capture",r=[];e!==null;){var o=e,n=o.stateNode;o.tag===5&&n!==null&&(o=n,n=Cn(e,a),n!=null&&r.unshift(Mn(e,n,o)),n=Cn(e,t),n!=null&&r.push(Mn(e,n,o))),e=e.return}return r}function no(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function ac(e,t,a,r,o){for(var n=t._reactName,l=[];a!==null&&a!==r;){var s=a,i=s.alternate,d=s.stateNode;if(i!==null&&i===r)break;s.tag===5&&d!==null&&(s=d,o?(i=Cn(a,n),i!=null&&l.unshift(Mn(a,i,s))):o||(i=Cn(a,n),i!=null&&l.push(Mn(a,i,s)))),a=a.return}l.length!==0&&e.push({event:t,listeners:l})}var yx=/\\r\\n?/g,Lx=/\\u0000|\\uFFFD/g;function rc(e){return(typeof e=="string"?e:""+e).replace(yx,`\n`).replace(Lx,"")}function Hl(e,t,a){if(t=rc(t),rc(e)!==t&&a)throw Error(R(425))}function ds(){}var cu=null,pu=null;function mu(e,t){return e==="textarea"||e==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var gu=typeof setTimeout=="function"?setTimeout:void 0,Sx=typeof clearTimeout=="function"?clearTimeout:void 0,oc=typeof Promise=="function"?Promise:void 0,Ix=typeof queueMicrotask=="function"?queueMicrotask:typeof oc<"u"?function(e){return oc.resolve(null).then(e).catch(Cx)}:gu;function Cx(e){setTimeout(function(){throw e})}function Bi(e,t){var a=t,r=0;do{var o=a.nextSibling;if(e.removeChild(a),o&&o.nodeType===8)if(a=o.data,a==="/$"){if(r===0){e.removeChild(o),bn(t);return}r--}else a!=="$"&&a!=="$?"&&a!=="$!"||r++;a=o}while(a);bn(t)}function Va(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t==="$"||t==="$!"||t==="$?")break;if(t==="/$")return null}}return e}function nc(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var a=e.data;if(a==="$"||a==="$!"||a==="$?"){if(t===0)return e;t--}else a==="/$"&&t++}e=e.previousSibling}return null}var Eo=Math.random().toString(36).slice(2),da="__reactFiber$"+Eo,An="__reactProps$"+Eo,ba="__reactContainer$"+Eo,hu="__reactEvents$"+Eo,wx="__reactListeners$"+Eo,kx="__reactHandles$"+Eo;function Cr(e){var t=e[da];if(t)return t;for(var a=e.parentNode;a;){if(t=a[ba]||a[da]){if(a=t.alternate,t.child!==null||a!==null&&a.child!==null)for(e=nc(e);e!==null;){if(a=e[da])return a;e=nc(e)}return t}e=a,a=e.parentNode}return null}function Hn(e){return e=e[da]||e[ba],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function co(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(R(33))}function Ms(e){return e[An]||null}var xu=[],po=-1;function Ja(e){return{current:e}}function Ue(e){0>po||(e.current=xu[po],xu[po]=null,po--)}function Fe(e,t){po++,xu[po]=e.current,e.current=t}var Ya={},pt=Ja(Ya),kt=Ja(!1),Pr=Ya;function bo(e,t){var a=e.type.contextTypes;if(!a)return Ya;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var o={},n;for(n in a)o[n]=t[n];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=o),o}function bt(e){return e=e.childContextTypes,e!=null}function fs(){Ue(kt),Ue(pt)}function lc(e,t,a){if(pt.current!==Ya)throw Error(R(168));Fe(pt,t),Fe(kt,a)}function Rp(e,t,a){var r=e.stateNode;if(t=t.childContextTypes,typeof r.getChildContext!="function")return a;r=r.getChildContext();for(var o in r)if(!(o in t))throw Error(R(108,fh(e)||"Unknown",o));return We({},a,r)}function cs(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Ya,Pr=pt.current,Fe(pt,e),Fe(kt,kt.current),!0}function sc(e,t,a){var r=e.stateNode;if(!r)throw Error(R(169));a?(e=Rp(e,t,Pr),r.__reactInternalMemoizedMergedChildContext=e,Ue(kt),Ue(pt),Fe(pt,e)):Ue(kt),Fe(kt,a)}var Sa=null,As=!1,Oi=!1;function Mp(e){Sa===null?Sa=[e]:Sa.push(e)}function bx(e){As=!0,Mp(e)}function er(){if(!Oi&&Sa!==null){Oi=!0;var e=0,t=Re;try{var a=Sa;for(Re=1;e<a.length;e++){var r=a[e];do r=r(!0);while(r!==null)}Sa=null,As=!1}catch(o){throw Sa!==null&&(Sa=Sa.slice(e+1)),tp($u,er),o}finally{Re=t,Oi=!1}}return null}var mo=[],go=0,ps=null,ms=0,Nt=[],Ut=0,Rr=null,Ia=1,Ca="";function Sr(e,t){mo[go++]=ms,mo[go++]=ps,ps=e,ms=t}function Ap(e,t,a){Nt[Ut++]=Ia,Nt[Ut++]=Ca,Nt[Ut++]=Rr,Rr=e;var r=Ia;e=Ca;var o=32-ta(r)-1;r&=~(1<<o),a+=1;var n=32-ta(t)+o;if(30<n){var l=o-o%5;n=(r&(1<<l)-1).toString(32),r>>=l,o-=l,Ia=1<<32-ta(t)+o|a<<o|r,Ca=n+e}else Ia=1<<n|a<<o|r,Ca=e}function Ju(e){e.return!==null&&(Sr(e,1),Ap(e,1,0))}function ed(e){for(;e===ps;)ps=mo[--go],mo[go]=null,ms=mo[--go],mo[go]=null;for(;e===Rr;)Rr=Nt[--Ut],Nt[Ut]=null,Ca=Nt[--Ut],Nt[Ut]=null,Ia=Nt[--Ut],Nt[Ut]=null}var At=null,Mt=null,He=!1,ea=null;function Dp(e,t){var a=Ht(5,null,null,0);a.elementType="DELETED",a.stateNode=t,a.return=e,t=e.deletions,t===null?(e.deletions=[a],e.flags|=16):t.push(a)}function ic(e,t){switch(e.tag){case 5:var a=e.type;return t=t.nodeType!==1||a.toLowerCase()!==t.nodeName.toLowerCase()?null:t,t!==null?(e.stateNode=t,At=e,Mt=Va(t.firstChild),!0):!1;case 6:return t=e.pendingProps===""||t.nodeType!==3?null:t,t!==null?(e.stateNode=t,At=e,Mt=null,!0):!1;case 13:return t=t.nodeType!==8?null:t,t!==null?(a=Rr!==null?{id:Ia,overflow:Ca}:null,e.memoizedState={dehydrated:t,treeContext:a,retryLane:1073741824},a=Ht(18,null,null,0),a.stateNode=t,a.return=e,e.child=a,At=e,Mt=null,!0):!1;default:return!1}}function vu(e){return(e.mode&1)!==0&&(e.flags&128)===0}function yu(e){if(He){var t=Mt;if(t){var a=t;if(!ic(e,t)){if(vu(e))throw Error(R(418));t=Va(a.nextSibling);var r=At;t&&ic(e,t)?Dp(r,a):(e.flags=e.flags&-4097|2,He=!1,At=e)}}else{if(vu(e))throw Error(R(418));e.flags=e.flags&-4097|2,He=!1,At=e}}}function uc(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;At=e}function ql(e){if(e!==At)return!1;if(!He)return uc(e),He=!0,!1;var t;if((t=e.tag!==3)&&!(t=e.tag!==5)&&(t=e.type,t=t!=="head"&&t!=="body"&&!mu(e.type,e.memoizedProps)),t&&(t=Mt)){if(vu(e))throw Ep(),Error(R(418));for(;t;)Dp(e,t),t=Va(t.nextSibling)}if(uc(e),e.tag===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(R(317));e:{for(e=e.nextSibling,t=0;e;){if(e.nodeType===8){var a=e.data;if(a==="/$"){if(t===0){Mt=Va(e.nextSibling);break e}t--}else a!=="$"&&a!=="$!"&&a!=="$?"||t++}e=e.nextSibling}Mt=null}}else Mt=At?Va(e.stateNode.nextSibling):null;return!0}function Ep(){for(var e=Mt;e;)e=Va(e.nextSibling)}function To(){Mt=At=null,He=!1}function td(e){ea===null?ea=[e]:ea.push(e)}var Tx=Ra.ReactCurrentBatchConfig;function rn(e,t,a){if(e=a.ref,e!==null&&typeof e!="function"&&typeof e!="object"){if(a._owner){if(a=a._owner,a){if(a.tag!==1)throw Error(R(309));var r=a.stateNode}if(!r)throw Error(R(147,e));var o=r,n=""+e;return t!==null&&t.ref!==null&&typeof t.ref=="function"&&t.ref._stringRef===n?t.ref:(t=function(l){var s=o.refs;l===null?delete s[n]:s[n]=l},t._stringRef=n,t)}if(typeof e!="string")throw Error(R(284));if(!a._owner)throw Error(R(290,e))}return e}function _l(e,t){throw e=Object.prototype.toString.call(t),Error(R(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function dc(e){var t=e._init;return t(e._payload)}function Fp(e){function t(m,u){if(e){var f=m.deletions;f===null?(m.deletions=[u],m.flags|=16):f.push(u)}}function a(m,u){if(!e)return null;for(;u!==null;)t(m,u),u=u.sibling;return null}function r(m,u){for(m=new Map;u!==null;)u.key!==null?m.set(u.key,u):m.set(u.index,u),u=u.sibling;return m}function o(m,u){return m=Xa(m,u),m.index=0,m.sibling=null,m}function n(m,u,f){return m.index=f,e?(f=m.alternate,f!==null?(f=f.index,f<u?(m.flags|=2,u):f):(m.flags|=2,u)):(m.flags|=1048576,u)}function l(m){return e&&m.alternate===null&&(m.flags|=2),m}function s(m,u,f,v){return u===null||u.tag!==6?(u=Wi(f,m.mode,v),u.return=m,u):(u=o(u,f),u.return=m,u)}function i(m,u,f,v){var C=f.type;return C===so?c(m,u,f.props.children,v,f.key):u!==null&&(u.elementType===C||typeof C=="object"&&C!==null&&C.$$typeof===Oa&&dc(C)===u.type)?(v=o(u,f.props),v.ref=rn(m,u,f),v.return=m,v):(v=ts(f.type,f.key,f.props,null,m.mode,v),v.ref=rn(m,u,f),v.return=m,v)}function d(m,u,f,v){return u===null||u.tag!==4||u.stateNode.containerInfo!==f.containerInfo||u.stateNode.implementation!==f.implementation?(u=$i(f,m.mode,v),u.return=m,u):(u=o(u,f.children||[]),u.return=m,u)}function c(m,u,f,v,C){return u===null||u.tag!==7?(u=Tr(f,m.mode,v,C),u.return=m,u):(u=o(u,f),u.return=m,u)}function p(m,u,f){if(typeof u=="string"&&u!==""||typeof u=="number")return u=Wi(""+u,m.mode,f),u.return=m,u;if(typeof u=="object"&&u!==null){switch(u.$$typeof){case Tl:return f=ts(u.type,u.key,u.props,null,m.mode,f),f.ref=rn(m,null,u),f.return=m,f;case lo:return u=$i(u,m.mode,f),u.return=m,u;case Oa:var v=u._init;return p(m,v(u._payload),f)}if(un(u)||Jo(u))return u=Tr(u,m.mode,f,null),u.return=m,u;_l(m,u)}return null}function g(m,u,f,v){var C=u!==null?u.key:null;if(typeof f=="string"&&f!==""||typeof f=="number")return C!==null?null:s(m,u,""+f,v);if(typeof f=="object"&&f!==null){switch(f.$$typeof){case Tl:return f.key===C?i(m,u,f,v):null;case lo:return f.key===C?d(m,u,f,v):null;case Oa:return C=f._init,g(m,u,C(f._payload),v)}if(un(f)||Jo(f))return C!==null?null:c(m,u,f,v,null);_l(m,f)}return null}function L(m,u,f,v,C){if(typeof v=="string"&&v!==""||typeof v=="number")return m=m.get(f)||null,s(u,m,""+v,C);if(typeof v=="object"&&v!==null){switch(v.$$typeof){case Tl:return m=m.get(v.key===null?f:v.key)||null,i(u,m,v,C);case lo:return m=m.get(v.key===null?f:v.key)||null,d(u,m,v,C);case Oa:var w=v._init;return L(m,u,f,w(v._payload),C)}if(un(v)||Jo(v))return m=m.get(f)||null,c(u,m,v,C,null);_l(u,v)}return null}function x(m,u,f,v){for(var C=null,w=null,y=u,k=u=0,z=null;y!==null&&k<f.length;k++){y.index>k?(z=y,y=null):z=y.sibling;var U=g(m,y,f[k],v);if(U===null){y===null&&(y=z);break}e&&y&&U.alternate===null&&t(m,y),u=n(U,u,k),w===null?C=U:w.sibling=U,w=U,y=z}if(k===f.length)return a(m,y),He&&Sr(m,k),C;if(y===null){for(;k<f.length;k++)y=p(m,f[k],v),y!==null&&(u=n(y,u,k),w===null?C=y:w.sibling=y,w=y);return He&&Sr(m,k),C}for(y=r(m,y);k<f.length;k++)z=L(y,m,k,f[k],v),z!==null&&(e&&z.alternate!==null&&y.delete(z.key===null?k:z.key),u=n(z,u,k),w===null?C=z:w.sibling=z,w=z);return e&&y.forEach(function(F){return t(m,F)}),He&&Sr(m,k),C}function I(m,u,f,v){var C=Jo(f);if(typeof C!="function")throw Error(R(150));if(f=C.call(f),f==null)throw Error(R(151));for(var w=C=null,y=u,k=u=0,z=null,U=f.next();y!==null&&!U.done;k++,U=f.next()){y.index>k?(z=y,y=null):z=y.sibling;var F=g(m,y,U.value,v);if(F===null){y===null&&(y=z);break}e&&y&&F.alternate===null&&t(m,y),u=n(F,u,k),w===null?C=F:w.sibling=F,w=F,y=z}if(U.done)return a(m,y),He&&Sr(m,k),C;if(y===null){for(;!U.done;k++,U=f.next())U=p(m,U.value,v),U!==null&&(u=n(U,u,k),w===null?C=U:w.sibling=U,w=U);return He&&Sr(m,k),C}for(y=r(m,y);!U.done;k++,U=f.next())U=L(y,m,k,U.value,v),U!==null&&(e&&U.alternate!==null&&y.delete(U.key===null?k:U.key),u=n(U,u,k),w===null?C=U:w.sibling=U,w=U);return e&&y.forEach(function(Z){return t(m,Z)}),He&&Sr(m,k),C}function N(m,u,f,v){if(typeof f=="object"&&f!==null&&f.type===so&&f.key===null&&(f=f.props.children),typeof f=="object"&&f!==null){switch(f.$$typeof){case Tl:e:{for(var C=f.key,w=u;w!==null;){if(w.key===C){if(C=f.type,C===so){if(w.tag===7){a(m,w.sibling),u=o(w,f.props.children),u.return=m,m=u;break e}}else if(w.elementType===C||typeof C=="object"&&C!==null&&C.$$typeof===Oa&&dc(C)===w.type){a(m,w.sibling),u=o(w,f.props),u.ref=rn(m,w,f),u.return=m,m=u;break e}a(m,w);break}else t(m,w);w=w.sibling}f.type===so?(u=Tr(f.props.children,m.mode,v,f.key),u.return=m,m=u):(v=ts(f.type,f.key,f.props,null,m.mode,v),v.ref=rn(m,u,f),v.return=m,m=v)}return l(m);case lo:e:{for(w=f.key;u!==null;){if(u.key===w)if(u.tag===4&&u.stateNode.containerInfo===f.containerInfo&&u.stateNode.implementation===f.implementation){a(m,u.sibling),u=o(u,f.children||[]),u.return=m,m=u;break e}else{a(m,u);break}else t(m,u);u=u.sibling}u=$i(f,m.mode,v),u.return=m,m=u}return l(m);case Oa:return w=f._init,N(m,u,w(f._payload),v)}if(un(f))return x(m,u,f,v);if(Jo(f))return I(m,u,f,v);_l(m,f)}return typeof f=="string"&&f!==""||typeof f=="number"?(f=""+f,u!==null&&u.tag===6?(a(m,u.sibling),u=o(u,f),u.return=m,m=u):(a(m,u),u=Wi(f,m.mode,v),u.return=m,m=u),l(m)):a(m,u)}return N}var Po=Fp(!0),Bp=Fp(!1),gs=Ja(null),hs=null,ho=null,ad=null;function rd(){ad=ho=hs=null}function od(e){var t=gs.current;Ue(gs),e._currentValue=t}function Lu(e,t,a){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,r!==null&&(r.childLanes|=t)):r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t),e===a)break;e=e.return}}function Co(e,t){hs=e,ad=ho=null,e=e.dependencies,e!==null&&e.firstContext!==null&&((e.lanes&t)!==0&&(wt=!0),e.firstContext=null)}function _t(e){var t=e._currentValue;if(ad!==e)if(e={context:e,memoizedValue:t,next:null},ho===null){if(hs===null)throw Error(R(308));ho=e,hs.dependencies={lanes:0,firstContext:e}}else ho=ho.next=e;return t}var wr=null;function nd(e){wr===null?wr=[e]:wr.push(e)}function Op(e,t,a,r){var o=t.interleaved;return o===null?(a.next=a,nd(t)):(a.next=o.next,o.next=a),t.interleaved=a,Ta(e,r)}function Ta(e,t){e.lanes|=t;var a=e.alternate;for(a!==null&&(a.lanes|=t),a=e,e=e.return;e!==null;)e.childLanes|=t,a=e.alternate,a!==null&&(a.childLanes|=t),a=e,e=e.return;return a.tag===3?a.stateNode:null}var za=!1;function ld(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function zp(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function wa(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function Ga(e,t,a){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,(Se&2)!==0){var o=r.pending;return o===null?t.next=t:(t.next=o.next,o.next=t),r.pending=t,Ta(e,a)}return o=r.interleaved,o===null?(t.next=t,nd(r)):(t.next=o.next,o.next=t),r.interleaved=t,Ta(e,a)}function Xl(e,t,a){if(t=t.updateQueue,t!==null&&(t=t.shared,(a&4194240)!==0)){var r=t.lanes;r&=e.pendingLanes,a|=r,t.lanes=a,Vu(e,a)}}function fc(e,t){var a=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,a===r)){var o=null,n=null;if(a=a.firstBaseUpdate,a!==null){do{var l={eventTime:a.eventTime,lane:a.lane,tag:a.tag,payload:a.payload,callback:a.callback,next:null};n===null?o=n=l:n=n.next=l,a=a.next}while(a!==null);n===null?o=n=t:n=n.next=t}else o=n=t;a={baseState:r.baseState,firstBaseUpdate:o,lastBaseUpdate:n,shared:r.shared,effects:r.effects},e.updateQueue=a;return}e=a.lastBaseUpdate,e===null?a.firstBaseUpdate=t:e.next=t,a.lastBaseUpdate=t}function xs(e,t,a,r){var o=e.updateQueue;za=!1;var n=o.firstBaseUpdate,l=o.lastBaseUpdate,s=o.shared.pending;if(s!==null){o.shared.pending=null;var i=s,d=i.next;i.next=null,l===null?n=d:l.next=d,l=i;var c=e.alternate;c!==null&&(c=c.updateQueue,s=c.lastBaseUpdate,s!==l&&(s===null?c.firstBaseUpdate=d:s.next=d,c.lastBaseUpdate=i))}if(n!==null){var p=o.baseState;l=0,c=d=i=null,s=n;do{var g=s.lane,L=s.eventTime;if((r&g)===g){c!==null&&(c=c.next={eventTime:L,lane:0,tag:s.tag,payload:s.payload,callback:s.callback,next:null});e:{var x=e,I=s;switch(g=t,L=a,I.tag){case 1:if(x=I.payload,typeof x=="function"){p=x.call(L,p,g);break e}p=x;break e;case 3:x.flags=x.flags&-65537|128;case 0:if(x=I.payload,g=typeof x=="function"?x.call(L,p,g):x,g==null)break e;p=We({},p,g);break e;case 2:za=!0}}s.callback!==null&&s.lane!==0&&(e.flags|=64,g=o.effects,g===null?o.effects=[s]:g.push(s))}else L={eventTime:L,lane:g,tag:s.tag,payload:s.payload,callback:s.callback,next:null},c===null?(d=c=L,i=p):c=c.next=L,l|=g;if(s=s.next,s===null){if(s=o.shared.pending,s===null)break;g=s,s=g.next,g.next=null,o.lastBaseUpdate=g,o.shared.pending=null}}while(!0);if(c===null&&(i=p),o.baseState=i,o.firstBaseUpdate=d,o.lastBaseUpdate=c,t=o.shared.interleaved,t!==null){o=t;do l|=o.lane,o=o.next;while(o!==t)}else n===null&&(o.shared.lanes=0);Ar|=l,e.lanes=l,e.memoizedState=p}}function cc(e,t,a){if(e=t.effects,t.effects=null,e!==null)for(t=0;t<e.length;t++){var r=e[t],o=r.callback;if(o!==null){if(r.callback=null,r=a,typeof o!="function")throw Error(R(191,o));o.call(r)}}}var qn={},ca=Ja(qn),Dn=Ja(qn),En=Ja(qn);function kr(e){if(e===qn)throw Error(R(174));return e}function sd(e,t){switch(Fe(En,t),Fe(Dn,e),Fe(ca,qn),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:eu(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=eu(t,e)}Ue(ca),Fe(ca,t)}function Ro(){Ue(ca),Ue(Dn),Ue(En)}function Np(e){kr(En.current);var t=kr(ca.current),a=eu(t,e.type);t!==a&&(Fe(Dn,e),Fe(ca,a))}function id(e){Dn.current===e&&(Ue(ca),Ue(Dn))}var qe=Ja(0);function vs(e){for(var t=e;t!==null;){if(t.tag===13){var a=t.memoizedState;if(a!==null&&(a=a.dehydrated,a===null||a.data==="$?"||a.data==="$!"))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==void 0){if((t.flags&128)!==0)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var zi=[];function ud(){for(var e=0;e<zi.length;e++)zi[e]._workInProgressVersionPrimary=null;zi.length=0}var Ql=Ra.ReactCurrentDispatcher,Ni=Ra.ReactCurrentBatchConfig,Mr=0,_e=null,Ze=null,tt=null,ys=!1,xn=!1,Fn=0,Px=0;function dt(){throw Error(R(321))}function dd(e,t){if(t===null)return!1;for(var a=0;a<t.length&&a<e.length;a++)if(!ra(e[a],t[a]))return!1;return!0}function fd(e,t,a,r,o,n){if(Mr=n,_e=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,Ql.current=e===null||e.memoizedState===null?Dx:Ex,e=a(r,o),xn){n=0;do{if(xn=!1,Fn=0,25<=n)throw Error(R(301));n+=1,tt=Ze=null,t.updateQueue=null,Ql.current=Fx,e=a(r,o)}while(xn)}if(Ql.current=Ls,t=Ze!==null&&Ze.next!==null,Mr=0,tt=Ze=_e=null,ys=!1,t)throw Error(R(300));return e}function cd(){var e=Fn!==0;return Fn=0,e}function ua(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return tt===null?_e.memoizedState=tt=e:tt=tt.next=e,tt}function Wt(){if(Ze===null){var e=_e.alternate;e=e!==null?e.memoizedState:null}else e=Ze.next;var t=tt===null?_e.memoizedState:tt.next;if(t!==null)tt=t,Ze=e;else{if(e===null)throw Error(R(310));Ze=e,e={memoizedState:Ze.memoizedState,baseState:Ze.baseState,baseQueue:Ze.baseQueue,queue:Ze.queue,next:null},tt===null?_e.memoizedState=tt=e:tt=tt.next=e}return tt}function Bn(e,t){return typeof t=="function"?t(e):t}function Ui(e){var t=Wt(),a=t.queue;if(a===null)throw Error(R(311));a.lastRenderedReducer=e;var r=Ze,o=r.baseQueue,n=a.pending;if(n!==null){if(o!==null){var l=o.next;o.next=n.next,n.next=l}r.baseQueue=o=n,a.pending=null}if(o!==null){n=o.next,r=r.baseState;var s=l=null,i=null,d=n;do{var c=d.lane;if((Mr&c)===c)i!==null&&(i=i.next={lane:0,action:d.action,hasEagerState:d.hasEagerState,eagerState:d.eagerState,next:null}),r=d.hasEagerState?d.eagerState:e(r,d.action);else{var p={lane:c,action:d.action,hasEagerState:d.hasEagerState,eagerState:d.eagerState,next:null};i===null?(s=i=p,l=r):i=i.next=p,_e.lanes|=c,Ar|=c}d=d.next}while(d!==null&&d!==n);i===null?l=r:i.next=s,ra(r,t.memoizedState)||(wt=!0),t.memoizedState=r,t.baseState=l,t.baseQueue=i,a.lastRenderedState=r}if(e=a.interleaved,e!==null){o=e;do n=o.lane,_e.lanes|=n,Ar|=n,o=o.next;while(o!==e)}else o===null&&(a.lanes=0);return[t.memoizedState,a.dispatch]}function Hi(e){var t=Wt(),a=t.queue;if(a===null)throw Error(R(311));a.lastRenderedReducer=e;var r=a.dispatch,o=a.pending,n=t.memoizedState;if(o!==null){a.pending=null;var l=o=o.next;do n=e(n,l.action),l=l.next;while(l!==o);ra(n,t.memoizedState)||(wt=!0),t.memoizedState=n,t.baseQueue===null&&(t.baseState=n),a.lastRenderedState=n}return[n,r]}function Up(){}function Hp(e,t){var a=_e,r=Wt(),o=t(),n=!ra(r.memoizedState,o);if(n&&(r.memoizedState=o,wt=!0),r=r.queue,pd(Wp.bind(null,a,r,e),[e]),r.getSnapshot!==t||n||tt!==null&&tt.memoizedState.tag&1){if(a.flags|=2048,On(9,_p.bind(null,a,r,o,t),void 0,null),at===null)throw Error(R(349));(Mr&30)!==0||qp(a,t,o)}return o}function qp(e,t,a){e.flags|=16384,e={getSnapshot:t,value:a},t=_e.updateQueue,t===null?(t={lastEffect:null,stores:null},_e.updateQueue=t,t.stores=[e]):(a=t.stores,a===null?t.stores=[e]:a.push(e))}function _p(e,t,a,r){t.value=a,t.getSnapshot=r,$p(t)&&Vp(e)}function Wp(e,t,a){return a(function(){$p(t)&&Vp(e)})}function $p(e){var t=e.getSnapshot;e=e.value;try{var a=t();return!ra(e,a)}catch{return!0}}function Vp(e){var t=Ta(e,1);t!==null&&aa(t,e,1,-1)}function pc(e){var t=ua();return typeof e=="function"&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:Bn,lastRenderedState:e},t.queue=e,e=e.dispatch=Ax.bind(null,_e,e),[t.memoizedState,e]}function On(e,t,a,r){return e={tag:e,create:t,destroy:a,deps:r,next:null},t=_e.updateQueue,t===null?(t={lastEffect:null,stores:null},_e.updateQueue=t,t.lastEffect=e.next=e):(a=t.lastEffect,a===null?t.lastEffect=e.next=e:(r=a.next,a.next=e,e.next=r,t.lastEffect=e)),e}function Gp(){return Wt().memoizedState}function Yl(e,t,a,r){var o=ua();_e.flags|=e,o.memoizedState=On(1|t,a,void 0,r===void 0?null:r)}function Ds(e,t,a,r){var o=Wt();r=r===void 0?null:r;var n=void 0;if(Ze!==null){var l=Ze.memoizedState;if(n=l.destroy,r!==null&&dd(r,l.deps)){o.memoizedState=On(t,a,n,r);return}}_e.flags|=e,o.memoizedState=On(1|t,a,n,r)}function mc(e,t){return Yl(8390656,8,e,t)}function pd(e,t){return Ds(2048,8,e,t)}function Kp(e,t){return Ds(4,2,e,t)}function jp(e,t){return Ds(4,4,e,t)}function Xp(e,t){if(typeof t=="function")return e=e(),t(e),function(){t(null)};if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function Qp(e,t,a){return a=a!=null?a.concat([e]):null,Ds(4,4,Xp.bind(null,t,e),a)}function md(){}function Yp(e,t){var a=Wt();t=t===void 0?null:t;var r=a.memoizedState;return r!==null&&t!==null&&dd(t,r[1])?r[0]:(a.memoizedState=[e,t],e)}function Zp(e,t){var a=Wt();t=t===void 0?null:t;var r=a.memoizedState;return r!==null&&t!==null&&dd(t,r[1])?r[0]:(e=e(),a.memoizedState=[e,t],e)}function Jp(e,t,a){return(Mr&21)===0?(e.baseState&&(e.baseState=!1,wt=!0),e.memoizedState=a):(ra(a,t)||(a=op(),_e.lanes|=a,Ar|=a,e.baseState=!0),t)}function Rx(e,t){var a=Re;Re=a!==0&&4>a?a:4,e(!0);var r=Ni.transition;Ni.transition={};try{e(!1),t()}finally{Re=a,Ni.transition=r}}function em(){return Wt().memoizedState}function Mx(e,t,a){var r=ja(e);if(a={lane:r,action:a,hasEagerState:!1,eagerState:null,next:null},tm(e))am(t,a);else if(a=Op(e,t,a,r),a!==null){var o=yt();aa(a,e,r,o),rm(a,t,r)}}function Ax(e,t,a){var r=ja(e),o={lane:r,action:a,hasEagerState:!1,eagerState:null,next:null};if(tm(e))am(t,o);else{var n=e.alternate;if(e.lanes===0&&(n===null||n.lanes===0)&&(n=t.lastRenderedReducer,n!==null))try{var l=t.lastRenderedState,s=n(l,a);if(o.hasEagerState=!0,o.eagerState=s,ra(s,l)){var i=t.interleaved;i===null?(o.next=o,nd(t)):(o.next=i.next,i.next=o),t.interleaved=o;return}}catch{}finally{}a=Op(e,t,o,r),a!==null&&(o=yt(),aa(a,e,r,o),rm(a,t,r))}}function tm(e){var t=e.alternate;return e===_e||t!==null&&t===_e}function am(e,t){xn=ys=!0;var a=e.pending;a===null?t.next=t:(t.next=a.next,a.next=t),e.pending=t}function rm(e,t,a){if((a&4194240)!==0){var r=t.lanes;r&=e.pendingLanes,a|=r,t.lanes=a,Vu(e,a)}}var Ls={readContext:_t,useCallback:dt,useContext:dt,useEffect:dt,useImperativeHandle:dt,useInsertionEffect:dt,useLayoutEffect:dt,useMemo:dt,useReducer:dt,useRef:dt,useState:dt,useDebugValue:dt,useDeferredValue:dt,useTransition:dt,useMutableSource:dt,useSyncExternalStore:dt,useId:dt,unstable_isNewReconciler:!1},Dx={readContext:_t,useCallback:function(e,t){return ua().memoizedState=[e,t===void 0?null:t],e},useContext:_t,useEffect:mc,useImperativeHandle:function(e,t,a){return a=a!=null?a.concat([e]):null,Yl(4194308,4,Xp.bind(null,t,e),a)},useLayoutEffect:function(e,t){return Yl(4194308,4,e,t)},useInsertionEffect:function(e,t){return Yl(4,2,e,t)},useMemo:function(e,t){var a=ua();return t=t===void 0?null:t,e=e(),a.memoizedState=[e,t],e},useReducer:function(e,t,a){var r=ua();return t=a!==void 0?a(t):t,r.memoizedState=r.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},r.queue=e,e=e.dispatch=Mx.bind(null,_e,e),[r.memoizedState,e]},useRef:function(e){var t=ua();return e={current:e},t.memoizedState=e},useState:pc,useDebugValue:md,useDeferredValue:function(e){return ua().memoizedState=e},useTransition:function(){var e=pc(!1),t=e[0];return e=Rx.bind(null,e[1]),ua().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,a){var r=_e,o=ua();if(He){if(a===void 0)throw Error(R(407));a=a()}else{if(a=t(),at===null)throw Error(R(349));(Mr&30)!==0||qp(r,t,a)}o.memoizedState=a;var n={value:a,getSnapshot:t};return o.queue=n,mc(Wp.bind(null,r,n,e),[e]),r.flags|=2048,On(9,_p.bind(null,r,n,a,t),void 0,null),a},useId:function(){var e=ua(),t=at.identifierPrefix;if(He){var a=Ca,r=Ia;a=(r&~(1<<32-ta(r)-1)).toString(32)+a,t=":"+t+"R"+a,a=Fn++,0<a&&(t+="H"+a.toString(32)),t+=":"}else a=Px++,t=":"+t+"r"+a.toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},Ex={readContext:_t,useCallback:Yp,useContext:_t,useEffect:pd,useImperativeHandle:Qp,useInsertionEffect:Kp,useLayoutEffect:jp,useMemo:Zp,useReducer:Ui,useRef:Gp,useState:function(){return Ui(Bn)},useDebugValue:md,useDeferredValue:function(e){var t=Wt();return Jp(t,Ze.memoizedState,e)},useTransition:function(){var e=Ui(Bn)[0],t=Wt().memoizedState;return[e,t]},useMutableSource:Up,useSyncExternalStore:Hp,useId:em,unstable_isNewReconciler:!1},Fx={readContext:_t,useCallback:Yp,useContext:_t,useEffect:pd,useImperativeHandle:Qp,useInsertionEffect:Kp,useLayoutEffect:jp,useMemo:Zp,useReducer:Hi,useRef:Gp,useState:function(){return Hi(Bn)},useDebugValue:md,useDeferredValue:function(e){var t=Wt();return Ze===null?t.memoizedState=e:Jp(t,Ze.memoizedState,e)},useTransition:function(){var e=Hi(Bn)[0],t=Wt().memoizedState;return[e,t]},useMutableSource:Up,useSyncExternalStore:Hp,useId:em,unstable_isNewReconciler:!1};function Zt(e,t){if(e&&e.defaultProps){t=We({},t),e=e.defaultProps;for(var a in e)t[a]===void 0&&(t[a]=e[a]);return t}return t}function Su(e,t,a,r){t=e.memoizedState,a=a(r,t),a=a==null?t:We({},t,a),e.memoizedState=a,e.lanes===0&&(e.updateQueue.baseState=a)}var Es={isMounted:function(e){return(e=e._reactInternals)?Fr(e)===e:!1},enqueueSetState:function(e,t,a){e=e._reactInternals;var r=yt(),o=ja(e),n=wa(r,o);n.payload=t,a!=null&&(n.callback=a),t=Ga(e,n,o),t!==null&&(aa(t,e,o,r),Xl(t,e,o))},enqueueReplaceState:function(e,t,a){e=e._reactInternals;var r=yt(),o=ja(e),n=wa(r,o);n.tag=1,n.payload=t,a!=null&&(n.callback=a),t=Ga(e,n,o),t!==null&&(aa(t,e,o,r),Xl(t,e,o))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var a=yt(),r=ja(e),o=wa(a,r);o.tag=2,t!=null&&(o.callback=t),t=Ga(e,o,r),t!==null&&(aa(t,e,r,a),Xl(t,e,r))}};function gc(e,t,a,r,o,n,l){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(r,n,l):t.prototype&&t.prototype.isPureReactComponent?!Pn(a,r)||!Pn(o,n):!0}function om(e,t,a){var r=!1,o=Ya,n=t.contextType;return typeof n=="object"&&n!==null?n=_t(n):(o=bt(t)?Pr:pt.current,r=t.contextTypes,n=(r=r!=null)?bo(e,o):Ya),t=new t(a,n),e.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=Es,e.stateNode=t,t._reactInternals=e,r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=o,e.__reactInternalMemoizedMaskedChildContext=n),t}function hc(e,t,a,r){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(a,r),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(a,r),t.state!==e&&Es.enqueueReplaceState(t,t.state,null)}function Iu(e,t,a,r){var o=e.stateNode;o.props=a,o.state=e.memoizedState,o.refs={},ld(e);var n=t.contextType;typeof n=="object"&&n!==null?o.context=_t(n):(n=bt(t)?Pr:pt.current,o.context=bo(e,n)),o.state=e.memoizedState,n=t.getDerivedStateFromProps,typeof n=="function"&&(Su(e,t,n,a),o.state=e.memoizedState),typeof t.getDerivedStateFromProps=="function"||typeof o.getSnapshotBeforeUpdate=="function"||typeof o.UNSAFE_componentWillMount!="function"&&typeof o.componentWillMount!="function"||(t=o.state,typeof o.componentWillMount=="function"&&o.componentWillMount(),typeof o.UNSAFE_componentWillMount=="function"&&o.UNSAFE_componentWillMount(),t!==o.state&&Es.enqueueReplaceState(o,o.state,null),xs(e,a,o,r),o.state=e.memoizedState),typeof o.componentDidMount=="function"&&(e.flags|=4194308)}function Mo(e,t){try{var a="",r=t;do a+=dh(r),r=r.return;while(r);var o=a}catch(n){o=`\nError generating stack: `+n.message+`\n`+n.stack}return{value:e,source:t,stack:o,digest:null}}function qi(e,t,a){return{value:e,source:null,stack:a??null,digest:t??null}}function Cu(e,t){try{console.error(t.value)}catch(a){setTimeout(function(){throw a})}}var Bx=typeof WeakMap=="function"?WeakMap:Map;function nm(e,t,a){a=wa(-1,a),a.tag=3,a.payload={element:null};var r=t.value;return a.callback=function(){Is||(Is=!0,Eu=r),Cu(e,t)},a}function lm(e,t,a){a=wa(-1,a),a.tag=3;var r=e.type.getDerivedStateFromError;if(typeof r=="function"){var o=t.value;a.payload=function(){return r(o)},a.callback=function(){Cu(e,t)}}var n=e.stateNode;return n!==null&&typeof n.componentDidCatch=="function"&&(a.callback=function(){Cu(e,t),typeof r!="function"&&(Ka===null?Ka=new Set([this]):Ka.add(this));var l=t.stack;this.componentDidCatch(t.value,{componentStack:l!==null?l:""})}),a}function xc(e,t,a){var r=e.pingCache;if(r===null){r=e.pingCache=new Bx;var o=new Set;r.set(t,o)}else o=r.get(t),o===void 0&&(o=new Set,r.set(t,o));o.has(a)||(o.add(a),e=Xx.bind(null,e,t,a),t.then(e,e))}function vc(e){do{var t;if((t=e.tag===13)&&(t=e.memoizedState,t=t!==null?t.dehydrated!==null:!0),t)return e;e=e.return}while(e!==null);return null}function yc(e,t,a,r,o){return(e.mode&1)===0?(e===t?e.flags|=65536:(e.flags|=128,a.flags|=131072,a.flags&=-52805,a.tag===1&&(a.alternate===null?a.tag=17:(t=wa(-1,1),t.tag=2,Ga(a,t,1))),a.lanes|=1),e):(e.flags|=65536,e.lanes=o,e)}var Ox=Ra.ReactCurrentOwner,wt=!1;function vt(e,t,a,r){t.child=e===null?Bp(t,null,a,r):Po(t,e.child,a,r)}function Lc(e,t,a,r,o){a=a.render;var n=t.ref;return Co(t,o),r=fd(e,t,a,r,n,o),a=cd(),e!==null&&!wt?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~o,Pa(e,t,o)):(He&&a&&Ju(t),t.flags|=1,vt(e,t,r,o),t.child)}function Sc(e,t,a,r,o){if(e===null){var n=a.type;return typeof n=="function"&&!Id(n)&&n.defaultProps===void 0&&a.compare===null&&a.defaultProps===void 0?(t.tag=15,t.type=n,sm(e,t,n,r,o)):(e=ts(a.type,null,r,t,t.mode,o),e.ref=t.ref,e.return=t,t.child=e)}if(n=e.child,(e.lanes&o)===0){var l=n.memoizedProps;if(a=a.compare,a=a!==null?a:Pn,a(l,r)&&e.ref===t.ref)return Pa(e,t,o)}return t.flags|=1,e=Xa(n,r),e.ref=t.ref,e.return=t,t.child=e}function sm(e,t,a,r,o){if(e!==null){var n=e.memoizedProps;if(Pn(n,r)&&e.ref===t.ref)if(wt=!1,t.pendingProps=r=n,(e.lanes&o)!==0)(e.flags&131072)!==0&&(wt=!0);else return t.lanes=e.lanes,Pa(e,t,o)}return wu(e,t,a,r,o)}function im(e,t,a){var r=t.pendingProps,o=r.children,n=e!==null?e.memoizedState:null;if(r.mode==="hidden")if((t.mode&1)===0)t.memoizedState={baseLanes:0,cachePool:null,transitions:null},Fe(vo,Rt),Rt|=a;else{if((a&1073741824)===0)return e=n!==null?n.baseLanes|a:a,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,Fe(vo,Rt),Rt|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=n!==null?n.baseLanes:a,Fe(vo,Rt),Rt|=r}else n!==null?(r=n.baseLanes|a,t.memoizedState=null):r=a,Fe(vo,Rt),Rt|=r;return vt(e,t,o,a),t.child}function um(e,t){var a=t.ref;(e===null&&a!==null||e!==null&&e.ref!==a)&&(t.flags|=512,t.flags|=2097152)}function wu(e,t,a,r,o){var n=bt(a)?Pr:pt.current;return n=bo(t,n),Co(t,o),a=fd(e,t,a,r,n,o),r=cd(),e!==null&&!wt?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~o,Pa(e,t,o)):(He&&r&&Ju(t),t.flags|=1,vt(e,t,a,o),t.child)}function Ic(e,t,a,r,o){if(bt(a)){var n=!0;cs(t)}else n=!1;if(Co(t,o),t.stateNode===null)Zl(e,t),om(t,a,r),Iu(t,a,r,o),r=!0;else if(e===null){var l=t.stateNode,s=t.memoizedProps;l.props=s;var i=l.context,d=a.contextType;typeof d=="object"&&d!==null?d=_t(d):(d=bt(a)?Pr:pt.current,d=bo(t,d));var c=a.getDerivedStateFromProps,p=typeof c=="function"||typeof l.getSnapshotBeforeUpdate=="function";p||typeof l.UNSAFE_componentWillReceiveProps!="function"&&typeof l.componentWillReceiveProps!="function"||(s!==r||i!==d)&&hc(t,l,r,d),za=!1;var g=t.memoizedState;l.state=g,xs(t,r,l,o),i=t.memoizedState,s!==r||g!==i||kt.current||za?(typeof c=="function"&&(Su(t,a,c,r),i=t.memoizedState),(s=za||gc(t,a,s,r,g,i,d))?(p||typeof l.UNSAFE_componentWillMount!="function"&&typeof l.componentWillMount!="function"||(typeof l.componentWillMount=="function"&&l.componentWillMount(),typeof l.UNSAFE_componentWillMount=="function"&&l.UNSAFE_componentWillMount()),typeof l.componentDidMount=="function"&&(t.flags|=4194308)):(typeof l.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=i),l.props=r,l.state=i,l.context=d,r=s):(typeof l.componentDidMount=="function"&&(t.flags|=4194308),r=!1)}else{l=t.stateNode,zp(e,t),s=t.memoizedProps,d=t.type===t.elementType?s:Zt(t.type,s),l.props=d,p=t.pendingProps,g=l.context,i=a.contextType,typeof i=="object"&&i!==null?i=_t(i):(i=bt(a)?Pr:pt.current,i=bo(t,i));var L=a.getDerivedStateFromProps;(c=typeof L=="function"||typeof l.getSnapshotBeforeUpdate=="function")||typeof l.UNSAFE_componentWillReceiveProps!="function"&&typeof l.componentWillReceiveProps!="function"||(s!==p||g!==i)&&hc(t,l,r,i),za=!1,g=t.memoizedState,l.state=g,xs(t,r,l,o);var x=t.memoizedState;s!==p||g!==x||kt.current||za?(typeof L=="function"&&(Su(t,a,L,r),x=t.memoizedState),(d=za||gc(t,a,d,r,g,x,i)||!1)?(c||typeof l.UNSAFE_componentWillUpdate!="function"&&typeof l.componentWillUpdate!="function"||(typeof l.componentWillUpdate=="function"&&l.componentWillUpdate(r,x,i),typeof l.UNSAFE_componentWillUpdate=="function"&&l.UNSAFE_componentWillUpdate(r,x,i)),typeof l.componentDidUpdate=="function"&&(t.flags|=4),typeof l.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof l.componentDidUpdate!="function"||s===e.memoizedProps&&g===e.memoizedState||(t.flags|=4),typeof l.getSnapshotBeforeUpdate!="function"||s===e.memoizedProps&&g===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=x),l.props=r,l.state=x,l.context=i,r=d):(typeof l.componentDidUpdate!="function"||s===e.memoizedProps&&g===e.memoizedState||(t.flags|=4),typeof l.getSnapshotBeforeUpdate!="function"||s===e.memoizedProps&&g===e.memoizedState||(t.flags|=1024),r=!1)}return ku(e,t,a,r,n,o)}function ku(e,t,a,r,o,n){um(e,t);var l=(t.flags&128)!==0;if(!r&&!l)return o&&sc(t,a,!1),Pa(e,t,n);r=t.stateNode,Ox.current=t;var s=l&&typeof a.getDerivedStateFromError!="function"?null:r.render();return t.flags|=1,e!==null&&l?(t.child=Po(t,e.child,null,n),t.child=Po(t,null,s,n)):vt(e,t,s,n),t.memoizedState=r.state,o&&sc(t,a,!0),t.child}function dm(e){var t=e.stateNode;t.pendingContext?lc(e,t.pendingContext,t.pendingContext!==t.context):t.context&&lc(e,t.context,!1),sd(e,t.containerInfo)}function Cc(e,t,a,r,o){return To(),td(o),t.flags|=256,vt(e,t,a,r),t.child}var bu={dehydrated:null,treeContext:null,retryLane:0};function Tu(e){return{baseLanes:e,cachePool:null,transitions:null}}function fm(e,t,a){var r=t.pendingProps,o=qe.current,n=!1,l=(t.flags&128)!==0,s;if((s=l)||(s=e!==null&&e.memoizedState===null?!1:(o&2)!==0),s?(n=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(o|=1),Fe(qe,o&1),e===null)return yu(t),e=t.memoizedState,e!==null&&(e=e.dehydrated,e!==null)?((t.mode&1)===0?t.lanes=1:e.data==="$!"?t.lanes=8:t.lanes=1073741824,null):(l=r.children,e=r.fallback,n?(r=t.mode,n=t.child,l={mode:"hidden",children:l},(r&1)===0&&n!==null?(n.childLanes=0,n.pendingProps=l):n=Os(l,r,0,null),e=Tr(e,r,a,null),n.return=t,e.return=t,n.sibling=e,t.child=n,t.child.memoizedState=Tu(a),t.memoizedState=bu,e):gd(t,l));if(o=e.memoizedState,o!==null&&(s=o.dehydrated,s!==null))return zx(e,t,l,r,s,o,a);if(n){n=r.fallback,l=t.mode,o=e.child,s=o.sibling;var i={mode:"hidden",children:r.children};return(l&1)===0&&t.child!==o?(r=t.child,r.childLanes=0,r.pendingProps=i,t.deletions=null):(r=Xa(o,i),r.subtreeFlags=o.subtreeFlags&14680064),s!==null?n=Xa(s,n):(n=Tr(n,l,a,null),n.flags|=2),n.return=t,r.return=t,r.sibling=n,t.child=r,r=n,n=t.child,l=e.child.memoizedState,l=l===null?Tu(a):{baseLanes:l.baseLanes|a,cachePool:null,transitions:l.transitions},n.memoizedState=l,n.childLanes=e.childLanes&~a,t.memoizedState=bu,r}return n=e.child,e=n.sibling,r=Xa(n,{mode:"visible",children:r.children}),(t.mode&1)===0&&(r.lanes=a),r.return=t,r.sibling=null,e!==null&&(a=t.deletions,a===null?(t.deletions=[e],t.flags|=16):a.push(e)),t.child=r,t.memoizedState=null,r}function gd(e,t){return t=Os({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function Wl(e,t,a,r){return r!==null&&td(r),Po(t,e.child,null,a),e=gd(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function zx(e,t,a,r,o,n,l){if(a)return t.flags&256?(t.flags&=-257,r=qi(Error(R(422))),Wl(e,t,l,r)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(n=r.fallback,o=t.mode,r=Os({mode:"visible",children:r.children},o,0,null),n=Tr(n,o,l,null),n.flags|=2,r.return=t,n.return=t,r.sibling=n,t.child=r,(t.mode&1)!==0&&Po(t,e.child,null,l),t.child.memoizedState=Tu(l),t.memoizedState=bu,n);if((t.mode&1)===0)return Wl(e,t,l,null);if(o.data==="$!"){if(r=o.nextSibling&&o.nextSibling.dataset,r)var s=r.dgst;return r=s,n=Error(R(419)),r=qi(n,r,void 0),Wl(e,t,l,r)}if(s=(l&e.childLanes)!==0,wt||s){if(r=at,r!==null){switch(l&-l){case 4:o=2;break;case 16:o=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:o=32;break;case 536870912:o=268435456;break;default:o=0}o=(o&(r.suspendedLanes|l))!==0?0:o,o!==0&&o!==n.retryLane&&(n.retryLane=o,Ta(e,o),aa(r,e,o,-1))}return Sd(),r=qi(Error(R(421))),Wl(e,t,l,r)}return o.data==="$?"?(t.flags|=128,t.child=e.child,t=Qx.bind(null,e),o._reactRetry=t,null):(e=n.treeContext,Mt=Va(o.nextSibling),At=t,He=!0,ea=null,e!==null&&(Nt[Ut++]=Ia,Nt[Ut++]=Ca,Nt[Ut++]=Rr,Ia=e.id,Ca=e.overflow,Rr=t),t=gd(t,r.children),t.flags|=4096,t)}function wc(e,t,a){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),Lu(e.return,t,a)}function _i(e,t,a,r,o){var n=e.memoizedState;n===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:a,tailMode:o}:(n.isBackwards=t,n.rendering=null,n.renderingStartTime=0,n.last=r,n.tail=a,n.tailMode=o)}function cm(e,t,a){var r=t.pendingProps,o=r.revealOrder,n=r.tail;if(vt(e,t,r.children,a),r=qe.current,(r&2)!==0)r=r&1|2,t.flags|=128;else{if(e!==null&&(e.flags&128)!==0)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&wc(e,a,t);else if(e.tag===19)wc(e,a,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}r&=1}if(Fe(qe,r),(t.mode&1)===0)t.memoizedState=null;else switch(o){case"forwards":for(a=t.child,o=null;a!==null;)e=a.alternate,e!==null&&vs(e)===null&&(o=a),a=a.sibling;a=o,a===null?(o=t.child,t.child=null):(o=a.sibling,a.sibling=null),_i(t,!1,o,a,n);break;case"backwards":for(a=null,o=t.child,t.child=null;o!==null;){if(e=o.alternate,e!==null&&vs(e)===null){t.child=o;break}e=o.sibling,o.sibling=a,a=o,o=e}_i(t,!0,a,null,n);break;case"together":_i(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function Zl(e,t){(t.mode&1)===0&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function Pa(e,t,a){if(e!==null&&(t.dependencies=e.dependencies),Ar|=t.lanes,(a&t.childLanes)===0)return null;if(e!==null&&t.child!==e.child)throw Error(R(153));if(t.child!==null){for(e=t.child,a=Xa(e,e.pendingProps),t.child=a,a.return=t;e.sibling!==null;)e=e.sibling,a=a.sibling=Xa(e,e.pendingProps),a.return=t;a.sibling=null}return t.child}function Nx(e,t,a){switch(t.tag){case 3:dm(t),To();break;case 5:Np(t);break;case 1:bt(t.type)&&cs(t);break;case 4:sd(t,t.stateNode.containerInfo);break;case 10:var r=t.type._context,o=t.memoizedProps.value;Fe(gs,r._currentValue),r._currentValue=o;break;case 13:if(r=t.memoizedState,r!==null)return r.dehydrated!==null?(Fe(qe,qe.current&1),t.flags|=128,null):(a&t.child.childLanes)!==0?fm(e,t,a):(Fe(qe,qe.current&1),e=Pa(e,t,a),e!==null?e.sibling:null);Fe(qe,qe.current&1);break;case 19:if(r=(a&t.childLanes)!==0,(e.flags&128)!==0){if(r)return cm(e,t,a);t.flags|=128}if(o=t.memoizedState,o!==null&&(o.rendering=null,o.tail=null,o.lastEffect=null),Fe(qe,qe.current),r)break;return null;case 22:case 23:return t.lanes=0,im(e,t,a)}return Pa(e,t,a)}var pm,Pu,mm,gm;pm=function(e,t){for(var a=t.child;a!==null;){if(a.tag===5||a.tag===6)e.appendChild(a.stateNode);else if(a.tag!==4&&a.child!==null){a.child.return=a,a=a.child;continue}if(a===t)break;for(;a.sibling===null;){if(a.return===null||a.return===t)return;a=a.return}a.sibling.return=a.return,a=a.sibling}};Pu=function(){};mm=function(e,t,a,r){var o=e.memoizedProps;if(o!==r){e=t.stateNode,kr(ca.current);var n=null;switch(a){case"input":o=Qi(e,o),r=Qi(e,r),n=[];break;case"select":o=We({},o,{value:void 0}),r=We({},r,{value:void 0}),n=[];break;case"textarea":o=Ji(e,o),r=Ji(e,r),n=[];break;default:typeof o.onClick!="function"&&typeof r.onClick=="function"&&(e.onclick=ds)}tu(a,r);var l;a=null;for(d in o)if(!r.hasOwnProperty(d)&&o.hasOwnProperty(d)&&o[d]!=null)if(d==="style"){var s=o[d];for(l in s)s.hasOwnProperty(l)&&(a||(a={}),a[l]="")}else d!=="dangerouslySetInnerHTML"&&d!=="children"&&d!=="suppressContentEditableWarning"&&d!=="suppressHydrationWarning"&&d!=="autoFocus"&&(Sn.hasOwnProperty(d)?n||(n=[]):(n=n||[]).push(d,null));for(d in r){var i=r[d];if(s=o!=null?o[d]:void 0,r.hasOwnProperty(d)&&i!==s&&(i!=null||s!=null))if(d==="style")if(s){for(l in s)!s.hasOwnProperty(l)||i&&i.hasOwnProperty(l)||(a||(a={}),a[l]="");for(l in i)i.hasOwnProperty(l)&&s[l]!==i[l]&&(a||(a={}),a[l]=i[l])}else a||(n||(n=[]),n.push(d,a)),a=i;else d==="dangerouslySetInnerHTML"?(i=i?i.__html:void 0,s=s?s.__html:void 0,i!=null&&s!==i&&(n=n||[]).push(d,i)):d==="children"?typeof i!="string"&&typeof i!="number"||(n=n||[]).push(d,""+i):d!=="suppressContentEditableWarning"&&d!=="suppressHydrationWarning"&&(Sn.hasOwnProperty(d)?(i!=null&&d==="onScroll"&&Ne("scroll",e),n||s===i||(n=[])):(n=n||[]).push(d,i))}a&&(n=n||[]).push("style",a);var d=n;(t.updateQueue=d)&&(t.flags|=4)}};gm=function(e,t,a,r){a!==r&&(t.flags|=4)};function on(e,t){if(!He)switch(e.tailMode){case"hidden":t=e.tail;for(var a=null;t!==null;)t.alternate!==null&&(a=t),t=t.sibling;a===null?e.tail=null:a.sibling=null;break;case"collapsed":a=e.tail;for(var r=null;a!==null;)a.alternate!==null&&(r=a),a=a.sibling;r===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:r.sibling=null}}function ft(e){var t=e.alternate!==null&&e.alternate.child===e.child,a=0,r=0;if(t)for(var o=e.child;o!==null;)a|=o.lanes|o.childLanes,r|=o.subtreeFlags&14680064,r|=o.flags&14680064,o.return=e,o=o.sibling;else for(o=e.child;o!==null;)a|=o.lanes|o.childLanes,r|=o.subtreeFlags,r|=o.flags,o.return=e,o=o.sibling;return e.subtreeFlags|=r,e.childLanes=a,t}function Ux(e,t,a){var r=t.pendingProps;switch(ed(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return ft(t),null;case 1:return bt(t.type)&&fs(),ft(t),null;case 3:return r=t.stateNode,Ro(),Ue(kt),Ue(pt),ud(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),(e===null||e.child===null)&&(ql(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,ea!==null&&(Ou(ea),ea=null))),Pu(e,t),ft(t),null;case 5:id(t);var o=kr(En.current);if(a=t.type,e!==null&&t.stateNode!=null)mm(e,t,a,r,o),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!r){if(t.stateNode===null)throw Error(R(166));return ft(t),null}if(e=kr(ca.current),ql(t)){r=t.stateNode,a=t.type;var n=t.memoizedProps;switch(r[da]=t,r[An]=n,e=(t.mode&1)!==0,a){case"dialog":Ne("cancel",r),Ne("close",r);break;case"iframe":case"object":case"embed":Ne("load",r);break;case"video":case"audio":for(o=0;o<fn.length;o++)Ne(fn[o],r);break;case"source":Ne("error",r);break;case"img":case"image":case"link":Ne("error",r),Ne("load",r);break;case"details":Ne("toggle",r);break;case"input":Df(r,n),Ne("invalid",r);break;case"select":r._wrapperState={wasMultiple:!!n.multiple},Ne("invalid",r);break;case"textarea":Ff(r,n),Ne("invalid",r)}tu(a,n),o=null;for(var l in n)if(n.hasOwnProperty(l)){var s=n[l];l==="children"?typeof s=="string"?r.textContent!==s&&(n.suppressHydrationWarning!==!0&&Hl(r.textContent,s,e),o=["children",s]):typeof s=="number"&&r.textContent!==""+s&&(n.suppressHydrationWarning!==!0&&Hl(r.textContent,s,e),o=["children",""+s]):Sn.hasOwnProperty(l)&&s!=null&&l==="onScroll"&&Ne("scroll",r)}switch(a){case"input":Pl(r),Ef(r,n,!0);break;case"textarea":Pl(r),Bf(r);break;case"select":case"option":break;default:typeof n.onClick=="function"&&(r.onclick=ds)}r=o,t.updateQueue=r,r!==null&&(t.flags|=4)}else{l=o.nodeType===9?o:o.ownerDocument,e==="http://www.w3.org/1999/xhtml"&&(e=Wc(a)),e==="http://www.w3.org/1999/xhtml"?a==="script"?(e=l.createElement("div"),e.innerHTML="<script><\\/script>",e=e.removeChild(e.firstChild)):typeof r.is=="string"?e=l.createElement(a,{is:r.is}):(e=l.createElement(a),a==="select"&&(l=e,r.multiple?l.multiple=!0:r.size&&(l.size=r.size))):e=l.createElementNS(e,a),e[da]=t,e[An]=r,pm(e,t,!1,!1),t.stateNode=e;e:{switch(l=au(a,r),a){case"dialog":Ne("cancel",e),Ne("close",e),o=r;break;case"iframe":case"object":case"embed":Ne("load",e),o=r;break;case"video":case"audio":for(o=0;o<fn.length;o++)Ne(fn[o],e);o=r;break;case"source":Ne("error",e),o=r;break;case"img":case"image":case"link":Ne("error",e),Ne("load",e),o=r;break;case"details":Ne("toggle",e),o=r;break;case"input":Df(e,r),o=Qi(e,r),Ne("invalid",e);break;case"option":o=r;break;case"select":e._wrapperState={wasMultiple:!!r.multiple},o=We({},r,{value:void 0}),Ne("invalid",e);break;case"textarea":Ff(e,r),o=Ji(e,r),Ne("invalid",e);break;default:o=r}tu(a,o),s=o;for(n in s)if(s.hasOwnProperty(n)){var i=s[n];n==="style"?Gc(e,i):n==="dangerouslySetInnerHTML"?(i=i?i.__html:void 0,i!=null&&$c(e,i)):n==="children"?typeof i=="string"?(a!=="textarea"||i!=="")&&In(e,i):typeof i=="number"&&In(e,""+i):n!=="suppressContentEditableWarning"&&n!=="suppressHydrationWarning"&&n!=="autoFocus"&&(Sn.hasOwnProperty(n)?i!=null&&n==="onScroll"&&Ne("scroll",e):i!=null&&Uu(e,n,i,l))}switch(a){case"input":Pl(e),Ef(e,r,!1);break;case"textarea":Pl(e),Bf(e);break;case"option":r.value!=null&&e.setAttribute("value",""+Qa(r.value));break;case"select":e.multiple=!!r.multiple,n=r.value,n!=null?yo(e,!!r.multiple,n,!1):r.defaultValue!=null&&yo(e,!!r.multiple,r.defaultValue,!0);break;default:typeof o.onClick=="function"&&(e.onclick=ds)}switch(a){case"button":case"input":case"select":case"textarea":r=!!r.autoFocus;break e;case"img":r=!0;break e;default:r=!1}}r&&(t.flags|=4)}t.ref!==null&&(t.flags|=512,t.flags|=2097152)}return ft(t),null;case 6:if(e&&t.stateNode!=null)gm(e,t,e.memoizedProps,r);else{if(typeof r!="string"&&t.stateNode===null)throw Error(R(166));if(a=kr(En.current),kr(ca.current),ql(t)){if(r=t.stateNode,a=t.memoizedProps,r[da]=t,(n=r.nodeValue!==a)&&(e=At,e!==null))switch(e.tag){case 3:Hl(r.nodeValue,a,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&Hl(r.nodeValue,a,(e.mode&1)!==0)}n&&(t.flags|=4)}else r=(a.nodeType===9?a:a.ownerDocument).createTextNode(r),r[da]=t,t.stateNode=r}return ft(t),null;case 13:if(Ue(qe),r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(He&&Mt!==null&&(t.mode&1)!==0&&(t.flags&128)===0)Ep(),To(),t.flags|=98560,n=!1;else if(n=ql(t),r!==null&&r.dehydrated!==null){if(e===null){if(!n)throw Error(R(318));if(n=t.memoizedState,n=n!==null?n.dehydrated:null,!n)throw Error(R(317));n[da]=t}else To(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;ft(t),n=!1}else ea!==null&&(Ou(ea),ea=null),n=!0;if(!n)return t.flags&65536?t:null}return(t.flags&128)!==0?(t.lanes=a,t):(r=r!==null,r!==(e!==null&&e.memoizedState!==null)&&r&&(t.child.flags|=8192,(t.mode&1)!==0&&(e===null||(qe.current&1)!==0?Je===0&&(Je=3):Sd())),t.updateQueue!==null&&(t.flags|=4),ft(t),null);case 4:return Ro(),Pu(e,t),e===null&&Rn(t.stateNode.containerInfo),ft(t),null;case 10:return od(t.type._context),ft(t),null;case 17:return bt(t.type)&&fs(),ft(t),null;case 19:if(Ue(qe),n=t.memoizedState,n===null)return ft(t),null;if(r=(t.flags&128)!==0,l=n.rendering,l===null)if(r)on(n,!1);else{if(Je!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(l=vs(e),l!==null){for(t.flags|=128,on(n,!1),r=l.updateQueue,r!==null&&(t.updateQueue=r,t.flags|=4),t.subtreeFlags=0,r=a,a=t.child;a!==null;)n=a,e=r,n.flags&=14680066,l=n.alternate,l===null?(n.childLanes=0,n.lanes=e,n.child=null,n.subtreeFlags=0,n.memoizedProps=null,n.memoizedState=null,n.updateQueue=null,n.dependencies=null,n.stateNode=null):(n.childLanes=l.childLanes,n.lanes=l.lanes,n.child=l.child,n.subtreeFlags=0,n.deletions=null,n.memoizedProps=l.memoizedProps,n.memoizedState=l.memoizedState,n.updateQueue=l.updateQueue,n.type=l.type,e=l.dependencies,n.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),a=a.sibling;return Fe(qe,qe.current&1|2),t.child}e=e.sibling}n.tail!==null&&je()>Ao&&(t.flags|=128,r=!0,on(n,!1),t.lanes=4194304)}else{if(!r)if(e=vs(l),e!==null){if(t.flags|=128,r=!0,a=e.updateQueue,a!==null&&(t.updateQueue=a,t.flags|=4),on(n,!0),n.tail===null&&n.tailMode==="hidden"&&!l.alternate&&!He)return ft(t),null}else 2*je()-n.renderingStartTime>Ao&&a!==1073741824&&(t.flags|=128,r=!0,on(n,!1),t.lanes=4194304);n.isBackwards?(l.sibling=t.child,t.child=l):(a=n.last,a!==null?a.sibling=l:t.child=l,n.last=l)}return n.tail!==null?(t=n.tail,n.rendering=t,n.tail=t.sibling,n.renderingStartTime=je(),t.sibling=null,a=qe.current,Fe(qe,r?a&1|2:a&1),t):(ft(t),null);case 22:case 23:return Ld(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&(t.mode&1)!==0?(Rt&1073741824)!==0&&(ft(t),t.subtreeFlags&6&&(t.flags|=8192)):ft(t),null;case 24:return null;case 25:return null}throw Error(R(156,t.tag))}function Hx(e,t){switch(ed(t),t.tag){case 1:return bt(t.type)&&fs(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Ro(),Ue(kt),Ue(pt),ud(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 5:return id(t),null;case 13:if(Ue(qe),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(R(340));To()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Ue(qe),null;case 4:return Ro(),null;case 10:return od(t.type._context),null;case 22:case 23:return Ld(),null;case 24:return null;default:return null}}var $l=!1,ct=!1,qx=typeof WeakSet=="function"?WeakSet:Set,W=null;function xo(e,t){var a=e.ref;if(a!==null)if(typeof a=="function")try{a(null)}catch(r){Ve(e,t,r)}else a.current=null}function Ru(e,t,a){try{a()}catch(r){Ve(e,t,r)}}var kc=!1;function _x(e,t){if(cu=ss,e=Lp(),Zu(e)){if("selectionStart"in e)var a={start:e.selectionStart,end:e.selectionEnd};else e:{a=(a=e.ownerDocument)&&a.defaultView||window;var r=a.getSelection&&a.getSelection();if(r&&r.rangeCount!==0){a=r.anchorNode;var o=r.anchorOffset,n=r.focusNode;r=r.focusOffset;try{a.nodeType,n.nodeType}catch{a=null;break e}var l=0,s=-1,i=-1,d=0,c=0,p=e,g=null;t:for(;;){for(var L;p!==a||o!==0&&p.nodeType!==3||(s=l+o),p!==n||r!==0&&p.nodeType!==3||(i=l+r),p.nodeType===3&&(l+=p.nodeValue.length),(L=p.firstChild)!==null;)g=p,p=L;for(;;){if(p===e)break t;if(g===a&&++d===o&&(s=l),g===n&&++c===r&&(i=l),(L=p.nextSibling)!==null)break;p=g,g=p.parentNode}p=L}a=s===-1||i===-1?null:{start:s,end:i}}else a=null}a=a||{start:0,end:0}}else a=null;for(pu={focusedElem:e,selectionRange:a},ss=!1,W=t;W!==null;)if(t=W,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,W=e;else for(;W!==null;){t=W;try{var x=t.alternate;if((t.flags&1024)!==0)switch(t.tag){case 0:case 11:case 15:break;case 1:if(x!==null){var I=x.memoizedProps,N=x.memoizedState,m=t.stateNode,u=m.getSnapshotBeforeUpdate(t.elementType===t.type?I:Zt(t.type,I),N);m.__reactInternalSnapshotBeforeUpdate=u}break;case 3:var f=t.stateNode.containerInfo;f.nodeType===1?f.textContent="":f.nodeType===9&&f.documentElement&&f.removeChild(f.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(R(163))}}catch(v){Ve(t,t.return,v)}if(e=t.sibling,e!==null){e.return=t.return,W=e;break}W=t.return}return x=kc,kc=!1,x}function vn(e,t,a){var r=t.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var o=r=r.next;do{if((o.tag&e)===e){var n=o.destroy;o.destroy=void 0,n!==void 0&&Ru(t,a,n)}o=o.next}while(o!==r)}}function Fs(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var a=t=t.next;do{if((a.tag&e)===e){var r=a.create;a.destroy=r()}a=a.next}while(a!==t)}}function Mu(e){var t=e.ref;if(t!==null){var a=e.stateNode;switch(e.tag){case 5:e=a;break;default:e=a}typeof t=="function"?t(e):t.current=e}}function hm(e){var t=e.alternate;t!==null&&(e.alternate=null,hm(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[da],delete t[An],delete t[hu],delete t[wx],delete t[kx])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function xm(e){return e.tag===5||e.tag===3||e.tag===4}function bc(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||xm(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function Au(e,t,a){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?a.nodeType===8?a.parentNode.insertBefore(e,t):a.insertBefore(e,t):(a.nodeType===8?(t=a.parentNode,t.insertBefore(e,a)):(t=a,t.appendChild(e)),a=a._reactRootContainer,a!=null||t.onclick!==null||(t.onclick=ds));else if(r!==4&&(e=e.child,e!==null))for(Au(e,t,a),e=e.sibling;e!==null;)Au(e,t,a),e=e.sibling}function Du(e,t,a){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?a.insertBefore(e,t):a.appendChild(e);else if(r!==4&&(e=e.child,e!==null))for(Du(e,t,a),e=e.sibling;e!==null;)Du(e,t,a),e=e.sibling}var ot=null,Jt=!1;function Ba(e,t,a){for(a=a.child;a!==null;)vm(e,t,a),a=a.sibling}function vm(e,t,a){if(fa&&typeof fa.onCommitFiberUnmount=="function")try{fa.onCommitFiberUnmount(bs,a)}catch{}switch(a.tag){case 5:ct||xo(a,t);case 6:var r=ot,o=Jt;ot=null,Ba(e,t,a),ot=r,Jt=o,ot!==null&&(Jt?(e=ot,a=a.stateNode,e.nodeType===8?e.parentNode.removeChild(a):e.removeChild(a)):ot.removeChild(a.stateNode));break;case 18:ot!==null&&(Jt?(e=ot,a=a.stateNode,e.nodeType===8?Bi(e.parentNode,a):e.nodeType===1&&Bi(e,a),bn(e)):Bi(ot,a.stateNode));break;case 4:r=ot,o=Jt,ot=a.stateNode.containerInfo,Jt=!0,Ba(e,t,a),ot=r,Jt=o;break;case 0:case 11:case 14:case 15:if(!ct&&(r=a.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){o=r=r.next;do{var n=o,l=n.destroy;n=n.tag,l!==void 0&&((n&2)!==0||(n&4)!==0)&&Ru(a,t,l),o=o.next}while(o!==r)}Ba(e,t,a);break;case 1:if(!ct&&(xo(a,t),r=a.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=a.memoizedProps,r.state=a.memoizedState,r.componentWillUnmount()}catch(s){Ve(a,t,s)}Ba(e,t,a);break;case 21:Ba(e,t,a);break;case 22:a.mode&1?(ct=(r=ct)||a.memoizedState!==null,Ba(e,t,a),ct=r):Ba(e,t,a);break;default:Ba(e,t,a)}}function Tc(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var a=e.stateNode;a===null&&(a=e.stateNode=new qx),t.forEach(function(r){var o=Yx.bind(null,e,r);a.has(r)||(a.add(r),r.then(o,o))})}}function Yt(e,t){var a=t.deletions;if(a!==null)for(var r=0;r<a.length;r++){var o=a[r];try{var n=e,l=t,s=l;e:for(;s!==null;){switch(s.tag){case 5:ot=s.stateNode,Jt=!1;break e;case 3:ot=s.stateNode.containerInfo,Jt=!0;break e;case 4:ot=s.stateNode.containerInfo,Jt=!0;break e}s=s.return}if(ot===null)throw Error(R(160));vm(n,l,o),ot=null,Jt=!1;var i=o.alternate;i!==null&&(i.return=null),o.return=null}catch(d){Ve(o,t,d)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)ym(t,e),t=t.sibling}function ym(e,t){var a=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(Yt(t,e),ia(e),r&4){try{vn(3,e,e.return),Fs(3,e)}catch(I){Ve(e,e.return,I)}try{vn(5,e,e.return)}catch(I){Ve(e,e.return,I)}}break;case 1:Yt(t,e),ia(e),r&512&&a!==null&&xo(a,a.return);break;case 5:if(Yt(t,e),ia(e),r&512&&a!==null&&xo(a,a.return),e.flags&32){var o=e.stateNode;try{In(o,"")}catch(I){Ve(e,e.return,I)}}if(r&4&&(o=e.stateNode,o!=null)){var n=e.memoizedProps,l=a!==null?a.memoizedProps:n,s=e.type,i=e.updateQueue;if(e.updateQueue=null,i!==null)try{s==="input"&&n.type==="radio"&&n.name!=null&&qc(o,n),au(s,l);var d=au(s,n);for(l=0;l<i.length;l+=2){var c=i[l],p=i[l+1];c==="style"?Gc(o,p):c==="dangerouslySetInnerHTML"?$c(o,p):c==="children"?In(o,p):Uu(o,c,p,d)}switch(s){case"input":Yi(o,n);break;case"textarea":_c(o,n);break;case"select":var g=o._wrapperState.wasMultiple;o._wrapperState.wasMultiple=!!n.multiple;var L=n.value;L!=null?yo(o,!!n.multiple,L,!1):g!==!!n.multiple&&(n.defaultValue!=null?yo(o,!!n.multiple,n.defaultValue,!0):yo(o,!!n.multiple,n.multiple?[]:"",!1))}o[An]=n}catch(I){Ve(e,e.return,I)}}break;case 6:if(Yt(t,e),ia(e),r&4){if(e.stateNode===null)throw Error(R(162));o=e.stateNode,n=e.memoizedProps;try{o.nodeValue=n}catch(I){Ve(e,e.return,I)}}break;case 3:if(Yt(t,e),ia(e),r&4&&a!==null&&a.memoizedState.isDehydrated)try{bn(t.containerInfo)}catch(I){Ve(e,e.return,I)}break;case 4:Yt(t,e),ia(e);break;case 13:Yt(t,e),ia(e),o=e.child,o.flags&8192&&(n=o.memoizedState!==null,o.stateNode.isHidden=n,!n||o.alternate!==null&&o.alternate.memoizedState!==null||(vd=je())),r&4&&Tc(e);break;case 22:if(c=a!==null&&a.memoizedState!==null,e.mode&1?(ct=(d=ct)||c,Yt(t,e),ct=d):Yt(t,e),ia(e),r&8192){if(d=e.memoizedState!==null,(e.stateNode.isHidden=d)&&!c&&(e.mode&1)!==0)for(W=e,c=e.child;c!==null;){for(p=W=c;W!==null;){switch(g=W,L=g.child,g.tag){case 0:case 11:case 14:case 15:vn(4,g,g.return);break;case 1:xo(g,g.return);var x=g.stateNode;if(typeof x.componentWillUnmount=="function"){r=g,a=g.return;try{t=r,x.props=t.memoizedProps,x.state=t.memoizedState,x.componentWillUnmount()}catch(I){Ve(r,a,I)}}break;case 5:xo(g,g.return);break;case 22:if(g.memoizedState!==null){Rc(p);continue}}L!==null?(L.return=g,W=L):Rc(p)}c=c.sibling}e:for(c=null,p=e;;){if(p.tag===5){if(c===null){c=p;try{o=p.stateNode,d?(n=o.style,typeof n.setProperty=="function"?n.setProperty("display","none","important"):n.display="none"):(s=p.stateNode,i=p.memoizedProps.style,l=i!=null&&i.hasOwnProperty("display")?i.display:null,s.style.display=Vc("display",l))}catch(I){Ve(e,e.return,I)}}}else if(p.tag===6){if(c===null)try{p.stateNode.nodeValue=d?"":p.memoizedProps}catch(I){Ve(e,e.return,I)}}else if((p.tag!==22&&p.tag!==23||p.memoizedState===null||p===e)&&p.child!==null){p.child.return=p,p=p.child;continue}if(p===e)break e;for(;p.sibling===null;){if(p.return===null||p.return===e)break e;c===p&&(c=null),p=p.return}c===p&&(c=null),p.sibling.return=p.return,p=p.sibling}}break;case 19:Yt(t,e),ia(e),r&4&&Tc(e);break;case 21:break;default:Yt(t,e),ia(e)}}function ia(e){var t=e.flags;if(t&2){try{e:{for(var a=e.return;a!==null;){if(xm(a)){var r=a;break e}a=a.return}throw Error(R(160))}switch(r.tag){case 5:var o=r.stateNode;r.flags&32&&(In(o,""),r.flags&=-33);var n=bc(e);Du(e,n,o);break;case 3:case 4:var l=r.stateNode.containerInfo,s=bc(e);Au(e,s,l);break;default:throw Error(R(161))}}catch(i){Ve(e,e.return,i)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function Wx(e,t,a){W=e,Lm(e,t,a)}function Lm(e,t,a){for(var r=(e.mode&1)!==0;W!==null;){var o=W,n=o.child;if(o.tag===22&&r){var l=o.memoizedState!==null||$l;if(!l){var s=o.alternate,i=s!==null&&s.memoizedState!==null||ct;s=$l;var d=ct;if($l=l,(ct=i)&&!d)for(W=o;W!==null;)l=W,i=l.child,l.tag===22&&l.memoizedState!==null?Mc(o):i!==null?(i.return=l,W=i):Mc(o);for(;n!==null;)W=n,Lm(n,t,a),n=n.sibling;W=o,$l=s,ct=d}Pc(e,t,a)}else(o.subtreeFlags&8772)!==0&&n!==null?(n.return=o,W=n):Pc(e,t,a)}}function Pc(e){for(;W!==null;){var t=W;if((t.flags&8772)!==0){var a=t.alternate;try{if((t.flags&8772)!==0)switch(t.tag){case 0:case 11:case 15:ct||Fs(5,t);break;case 1:var r=t.stateNode;if(t.flags&4&&!ct)if(a===null)r.componentDidMount();else{var o=t.elementType===t.type?a.memoizedProps:Zt(t.type,a.memoizedProps);r.componentDidUpdate(o,a.memoizedState,r.__reactInternalSnapshotBeforeUpdate)}var n=t.updateQueue;n!==null&&cc(t,n,r);break;case 3:var l=t.updateQueue;if(l!==null){if(a=null,t.child!==null)switch(t.child.tag){case 5:a=t.child.stateNode;break;case 1:a=t.child.stateNode}cc(t,l,a)}break;case 5:var s=t.stateNode;if(a===null&&t.flags&4){a=s;var i=t.memoizedProps;switch(t.type){case"button":case"input":case"select":case"textarea":i.autoFocus&&a.focus();break;case"img":i.src&&(a.src=i.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(t.memoizedState===null){var d=t.alternate;if(d!==null){var c=d.memoizedState;if(c!==null){var p=c.dehydrated;p!==null&&bn(p)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(R(163))}ct||t.flags&512&&Mu(t)}catch(g){Ve(t,t.return,g)}}if(t===e){W=null;break}if(a=t.sibling,a!==null){a.return=t.return,W=a;break}W=t.return}}function Rc(e){for(;W!==null;){var t=W;if(t===e){W=null;break}var a=t.sibling;if(a!==null){a.return=t.return,W=a;break}W=t.return}}function Mc(e){for(;W!==null;){var t=W;try{switch(t.tag){case 0:case 11:case 15:var a=t.return;try{Fs(4,t)}catch(i){Ve(t,a,i)}break;case 1:var r=t.stateNode;if(typeof r.componentDidMount=="function"){var o=t.return;try{r.componentDidMount()}catch(i){Ve(t,o,i)}}var n=t.return;try{Mu(t)}catch(i){Ve(t,n,i)}break;case 5:var l=t.return;try{Mu(t)}catch(i){Ve(t,l,i)}}}catch(i){Ve(t,t.return,i)}if(t===e){W=null;break}var s=t.sibling;if(s!==null){s.return=t.return,W=s;break}W=t.return}}var $x=Math.ceil,Ss=Ra.ReactCurrentDispatcher,hd=Ra.ReactCurrentOwner,qt=Ra.ReactCurrentBatchConfig,Se=0,at=null,Qe=null,nt=0,Rt=0,vo=Ja(0),Je=0,zn=null,Ar=0,Bs=0,xd=0,yn=null,Ct=null,vd=0,Ao=1/0,La=null,Is=!1,Eu=null,Ka=null,Vl=!1,qa=null,Cs=0,Ln=0,Fu=null,Jl=-1,es=0;function yt(){return(Se&6)!==0?je():Jl!==-1?Jl:Jl=je()}function ja(e){return(e.mode&1)===0?1:(Se&2)!==0&&nt!==0?nt&-nt:Tx.transition!==null?(es===0&&(es=op()),es):(e=Re,e!==0||(e=window.event,e=e===void 0?16:fp(e.type)),e)}function aa(e,t,a,r){if(50<Ln)throw Ln=0,Fu=null,Error(R(185));Nn(e,a,r),((Se&2)===0||e!==at)&&(e===at&&((Se&2)===0&&(Bs|=a),Je===4&&Ua(e,nt)),Tt(e,r),a===1&&Se===0&&(t.mode&1)===0&&(Ao=je()+500,As&&er()))}function Tt(e,t){var a=e.callbackNode;Rh(e,t);var r=ls(e,e===at?nt:0);if(r===0)a!==null&&Nf(a),e.callbackNode=null,e.callbackPriority=0;else if(t=r&-r,e.callbackPriority!==t){if(a!=null&&Nf(a),t===1)e.tag===0?bx(Ac.bind(null,e)):Mp(Ac.bind(null,e)),Ix(function(){(Se&6)===0&&er()}),a=null;else{switch(np(r)){case 1:a=$u;break;case 4:a=ap;break;case 16:a=ns;break;case 536870912:a=rp;break;default:a=ns}a=Pm(a,Sm.bind(null,e))}e.callbackPriority=t,e.callbackNode=a}}function Sm(e,t){if(Jl=-1,es=0,(Se&6)!==0)throw Error(R(327));var a=e.callbackNode;if(wo()&&e.callbackNode!==a)return null;var r=ls(e,e===at?nt:0);if(r===0)return null;if((r&30)!==0||(r&e.expiredLanes)!==0||t)t=ws(e,r);else{t=r;var o=Se;Se|=2;var n=Cm();(at!==e||nt!==t)&&(La=null,Ao=je()+500,br(e,t));do try{Kx();break}catch(s){Im(e,s)}while(!0);rd(),Ss.current=n,Se=o,Qe!==null?t=0:(at=null,nt=0,t=Je)}if(t!==0){if(t===2&&(o=su(e),o!==0&&(r=o,t=Bu(e,o))),t===1)throw a=zn,br(e,0),Ua(e,r),Tt(e,je()),a;if(t===6)Ua(e,r);else{if(o=e.current.alternate,(r&30)===0&&!Vx(o)&&(t=ws(e,r),t===2&&(n=su(e),n!==0&&(r=n,t=Bu(e,n))),t===1))throw a=zn,br(e,0),Ua(e,r),Tt(e,je()),a;switch(e.finishedWork=o,e.finishedLanes=r,t){case 0:case 1:throw Error(R(345));case 2:Ir(e,Ct,La);break;case 3:if(Ua(e,r),(r&130023424)===r&&(t=vd+500-je(),10<t)){if(ls(e,0)!==0)break;if(o=e.suspendedLanes,(o&r)!==r){yt(),e.pingedLanes|=e.suspendedLanes&o;break}e.timeoutHandle=gu(Ir.bind(null,e,Ct,La),t);break}Ir(e,Ct,La);break;case 4:if(Ua(e,r),(r&4194240)===r)break;for(t=e.eventTimes,o=-1;0<r;){var l=31-ta(r);n=1<<l,l=t[l],l>o&&(o=l),r&=~n}if(r=o,r=je()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*$x(r/1960))-r,10<r){e.timeoutHandle=gu(Ir.bind(null,e,Ct,La),r);break}Ir(e,Ct,La);break;case 5:Ir(e,Ct,La);break;default:throw Error(R(329))}}}return Tt(e,je()),e.callbackNode===a?Sm.bind(null,e):null}function Bu(e,t){var a=yn;return e.current.memoizedState.isDehydrated&&(br(e,t).flags|=256),e=ws(e,t),e!==2&&(t=Ct,Ct=a,t!==null&&Ou(t)),e}function Ou(e){Ct===null?Ct=e:Ct.push.apply(Ct,e)}function Vx(e){for(var t=e;;){if(t.flags&16384){var a=t.updateQueue;if(a!==null&&(a=a.stores,a!==null))for(var r=0;r<a.length;r++){var o=a[r],n=o.getSnapshot;o=o.value;try{if(!ra(n(),o))return!1}catch{return!1}}}if(a=t.child,t.subtreeFlags&16384&&a!==null)a.return=t,t=a;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function Ua(e,t){for(t&=~xd,t&=~Bs,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var a=31-ta(t),r=1<<a;e[a]=-1,t&=~r}}function Ac(e){if((Se&6)!==0)throw Error(R(327));wo();var t=ls(e,0);if((t&1)===0)return Tt(e,je()),null;var a=ws(e,t);if(e.tag!==0&&a===2){var r=su(e);r!==0&&(t=r,a=Bu(e,r))}if(a===1)throw a=zn,br(e,0),Ua(e,t),Tt(e,je()),a;if(a===6)throw Error(R(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,Ir(e,Ct,La),Tt(e,je()),null}function yd(e,t){var a=Se;Se|=1;try{return e(t)}finally{Se=a,Se===0&&(Ao=je()+500,As&&er())}}function Dr(e){qa!==null&&qa.tag===0&&(Se&6)===0&&wo();var t=Se;Se|=1;var a=qt.transition,r=Re;try{if(qt.transition=null,Re=1,e)return e()}finally{Re=r,qt.transition=a,Se=t,(Se&6)===0&&er()}}function Ld(){Rt=vo.current,Ue(vo)}function br(e,t){e.finishedWork=null,e.finishedLanes=0;var a=e.timeoutHandle;if(a!==-1&&(e.timeoutHandle=-1,Sx(a)),Qe!==null)for(a=Qe.return;a!==null;){var r=a;switch(ed(r),r.tag){case 1:r=r.type.childContextTypes,r!=null&&fs();break;case 3:Ro(),Ue(kt),Ue(pt),ud();break;case 5:id(r);break;case 4:Ro();break;case 13:Ue(qe);break;case 19:Ue(qe);break;case 10:od(r.type._context);break;case 22:case 23:Ld()}a=a.return}if(at=e,Qe=e=Xa(e.current,null),nt=Rt=t,Je=0,zn=null,xd=Bs=Ar=0,Ct=yn=null,wr!==null){for(t=0;t<wr.length;t++)if(a=wr[t],r=a.interleaved,r!==null){a.interleaved=null;var o=r.next,n=a.pending;if(n!==null){var l=n.next;n.next=o,r.next=l}a.pending=r}wr=null}return e}function Im(e,t){do{var a=Qe;try{if(rd(),Ql.current=Ls,ys){for(var r=_e.memoizedState;r!==null;){var o=r.queue;o!==null&&(o.pending=null),r=r.next}ys=!1}if(Mr=0,tt=Ze=_e=null,xn=!1,Fn=0,hd.current=null,a===null||a.return===null){Je=1,zn=t,Qe=null;break}e:{var n=e,l=a.return,s=a,i=t;if(t=nt,s.flags|=32768,i!==null&&typeof i=="object"&&typeof i.then=="function"){var d=i,c=s,p=c.tag;if((c.mode&1)===0&&(p===0||p===11||p===15)){var g=c.alternate;g?(c.updateQueue=g.updateQueue,c.memoizedState=g.memoizedState,c.lanes=g.lanes):(c.updateQueue=null,c.memoizedState=null)}var L=vc(l);if(L!==null){L.flags&=-257,yc(L,l,s,n,t),L.mode&1&&xc(n,d,t),t=L,i=d;var x=t.updateQueue;if(x===null){var I=new Set;I.add(i),t.updateQueue=I}else x.add(i);break e}else{if((t&1)===0){xc(n,d,t),Sd();break e}i=Error(R(426))}}else if(He&&s.mode&1){var N=vc(l);if(N!==null){(N.flags&65536)===0&&(N.flags|=256),yc(N,l,s,n,t),td(Mo(i,s));break e}}n=i=Mo(i,s),Je!==4&&(Je=2),yn===null?yn=[n]:yn.push(n),n=l;do{switch(n.tag){case 3:n.flags|=65536,t&=-t,n.lanes|=t;var m=nm(n,i,t);fc(n,m);break e;case 1:s=i;var u=n.type,f=n.stateNode;if((n.flags&128)===0&&(typeof u.getDerivedStateFromError=="function"||f!==null&&typeof f.componentDidCatch=="function"&&(Ka===null||!Ka.has(f)))){n.flags|=65536,t&=-t,n.lanes|=t;var v=lm(n,s,t);fc(n,v);break e}}n=n.return}while(n!==null)}km(a)}catch(C){t=C,Qe===a&&a!==null&&(Qe=a=a.return);continue}break}while(!0)}function Cm(){var e=Ss.current;return Ss.current=Ls,e===null?Ls:e}function Sd(){(Je===0||Je===3||Je===2)&&(Je=4),at===null||(Ar&268435455)===0&&(Bs&268435455)===0||Ua(at,nt)}function ws(e,t){var a=Se;Se|=2;var r=Cm();(at!==e||nt!==t)&&(La=null,br(e,t));do try{Gx();break}catch(o){Im(e,o)}while(!0);if(rd(),Se=a,Ss.current=r,Qe!==null)throw Error(R(261));return at=null,nt=0,Je}function Gx(){for(;Qe!==null;)wm(Qe)}function Kx(){for(;Qe!==null&&!Lh();)wm(Qe)}function wm(e){var t=Tm(e.alternate,e,Rt);e.memoizedProps=e.pendingProps,t===null?km(e):Qe=t,hd.current=null}function km(e){var t=e;do{var a=t.alternate;if(e=t.return,(t.flags&32768)===0){if(a=Ux(a,t,Rt),a!==null){Qe=a;return}}else{if(a=Hx(a,t),a!==null){a.flags&=32767,Qe=a;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{Je=6,Qe=null;return}}if(t=t.sibling,t!==null){Qe=t;return}Qe=t=e}while(t!==null);Je===0&&(Je=5)}function Ir(e,t,a){var r=Re,o=qt.transition;try{qt.transition=null,Re=1,jx(e,t,a,r)}finally{qt.transition=o,Re=r}return null}function jx(e,t,a,r){do wo();while(qa!==null);if((Se&6)!==0)throw Error(R(327));a=e.finishedWork;var o=e.finishedLanes;if(a===null)return null;if(e.finishedWork=null,e.finishedLanes=0,a===e.current)throw Error(R(177));e.callbackNode=null,e.callbackPriority=0;var n=a.lanes|a.childLanes;if(Mh(e,n),e===at&&(Qe=at=null,nt=0),(a.subtreeFlags&2064)===0&&(a.flags&2064)===0||Vl||(Vl=!0,Pm(ns,function(){return wo(),null})),n=(a.flags&15990)!==0,(a.subtreeFlags&15990)!==0||n){n=qt.transition,qt.transition=null;var l=Re;Re=1;var s=Se;Se|=4,hd.current=null,_x(e,a),ym(a,e),hx(pu),ss=!!cu,pu=cu=null,e.current=a,Wx(a,e,o),Sh(),Se=s,Re=l,qt.transition=n}else e.current=a;if(Vl&&(Vl=!1,qa=e,Cs=o),n=e.pendingLanes,n===0&&(Ka=null),wh(a.stateNode,r),Tt(e,je()),t!==null)for(r=e.onRecoverableError,a=0;a<t.length;a++)o=t[a],r(o.value,{componentStack:o.stack,digest:o.digest});if(Is)throw Is=!1,e=Eu,Eu=null,e;return(Cs&1)!==0&&e.tag!==0&&wo(),n=e.pendingLanes,(n&1)!==0?e===Fu?Ln++:(Ln=0,Fu=e):Ln=0,er(),null}function wo(){if(qa!==null){var e=np(Cs),t=qt.transition,a=Re;try{if(qt.transition=null,Re=16>e?16:e,qa===null)var r=!1;else{if(e=qa,qa=null,Cs=0,(Se&6)!==0)throw Error(R(331));var o=Se;for(Se|=4,W=e.current;W!==null;){var n=W,l=n.child;if((W.flags&16)!==0){var s=n.deletions;if(s!==null){for(var i=0;i<s.length;i++){var d=s[i];for(W=d;W!==null;){var c=W;switch(c.tag){case 0:case 11:case 15:vn(8,c,n)}var p=c.child;if(p!==null)p.return=c,W=p;else for(;W!==null;){c=W;var g=c.sibling,L=c.return;if(hm(c),c===d){W=null;break}if(g!==null){g.return=L,W=g;break}W=L}}}var x=n.alternate;if(x!==null){var I=x.child;if(I!==null){x.child=null;do{var N=I.sibling;I.sibling=null,I=N}while(I!==null)}}W=n}}if((n.subtreeFlags&2064)!==0&&l!==null)l.return=n,W=l;else e:for(;W!==null;){if(n=W,(n.flags&2048)!==0)switch(n.tag){case 0:case 11:case 15:vn(9,n,n.return)}var m=n.sibling;if(m!==null){m.return=n.return,W=m;break e}W=n.return}}var u=e.current;for(W=u;W!==null;){l=W;var f=l.child;if((l.subtreeFlags&2064)!==0&&f!==null)f.return=l,W=f;else e:for(l=u;W!==null;){if(s=W,(s.flags&2048)!==0)try{switch(s.tag){case 0:case 11:case 15:Fs(9,s)}}catch(C){Ve(s,s.return,C)}if(s===l){W=null;break e}var v=s.sibling;if(v!==null){v.return=s.return,W=v;break e}W=s.return}}if(Se=o,er(),fa&&typeof fa.onPostCommitFiberRoot=="function")try{fa.onPostCommitFiberRoot(bs,e)}catch{}r=!0}return r}finally{Re=a,qt.transition=t}}return!1}function Dc(e,t,a){t=Mo(a,t),t=nm(e,t,1),e=Ga(e,t,1),t=yt(),e!==null&&(Nn(e,1,t),Tt(e,t))}function Ve(e,t,a){if(e.tag===3)Dc(e,e,a);else for(;t!==null;){if(t.tag===3){Dc(t,e,a);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof r.componentDidCatch=="function"&&(Ka===null||!Ka.has(r))){e=Mo(a,e),e=lm(t,e,1),t=Ga(t,e,1),e=yt(),t!==null&&(Nn(t,1,e),Tt(t,e));break}}t=t.return}}function Xx(e,t,a){var r=e.pingCache;r!==null&&r.delete(t),t=yt(),e.pingedLanes|=e.suspendedLanes&a,at===e&&(nt&a)===a&&(Je===4||Je===3&&(nt&130023424)===nt&&500>je()-vd?br(e,0):xd|=a),Tt(e,t)}function bm(e,t){t===0&&((e.mode&1)===0?t=1:(t=Al,Al<<=1,(Al&130023424)===0&&(Al=4194304)));var a=yt();e=Ta(e,t),e!==null&&(Nn(e,t,a),Tt(e,a))}function Qx(e){var t=e.memoizedState,a=0;t!==null&&(a=t.retryLane),bm(e,a)}function Yx(e,t){var a=0;switch(e.tag){case 13:var r=e.stateNode,o=e.memoizedState;o!==null&&(a=o.retryLane);break;case 19:r=e.stateNode;break;default:throw Error(R(314))}r!==null&&r.delete(t),bm(e,a)}var Tm;Tm=function(e,t,a){if(e!==null)if(e.memoizedProps!==t.pendingProps||kt.current)wt=!0;else{if((e.lanes&a)===0&&(t.flags&128)===0)return wt=!1,Nx(e,t,a);wt=(e.flags&131072)!==0}else wt=!1,He&&(t.flags&1048576)!==0&&Ap(t,ms,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;Zl(e,t),e=t.pendingProps;var o=bo(t,pt.current);Co(t,a),o=fd(null,t,r,e,o,a);var n=cd();return t.flags|=1,typeof o=="object"&&o!==null&&typeof o.render=="function"&&o.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,bt(r)?(n=!0,cs(t)):n=!1,t.memoizedState=o.state!==null&&o.state!==void 0?o.state:null,ld(t),o.updater=Es,t.stateNode=o,o._reactInternals=t,Iu(t,r,e,a),t=ku(null,t,r,!0,n,a)):(t.tag=0,He&&n&&Ju(t),vt(null,t,o,a),t=t.child),t;case 16:r=t.elementType;e:{switch(Zl(e,t),e=t.pendingProps,o=r._init,r=o(r._payload),t.type=r,o=t.tag=Jx(r),e=Zt(r,e),o){case 0:t=wu(null,t,r,e,a);break e;case 1:t=Ic(null,t,r,e,a);break e;case 11:t=Lc(null,t,r,e,a);break e;case 14:t=Sc(null,t,r,Zt(r.type,e),a);break e}throw Error(R(306,r,""))}return t;case 0:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:Zt(r,o),wu(e,t,r,o,a);case 1:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:Zt(r,o),Ic(e,t,r,o,a);case 3:e:{if(dm(t),e===null)throw Error(R(387));r=t.pendingProps,n=t.memoizedState,o=n.element,zp(e,t),xs(t,r,null,a);var l=t.memoizedState;if(r=l.element,n.isDehydrated)if(n={element:r,isDehydrated:!1,cache:l.cache,pendingSuspenseBoundaries:l.pendingSuspenseBoundaries,transitions:l.transitions},t.updateQueue.baseState=n,t.memoizedState=n,t.flags&256){o=Mo(Error(R(423)),t),t=Cc(e,t,r,a,o);break e}else if(r!==o){o=Mo(Error(R(424)),t),t=Cc(e,t,r,a,o);break e}else for(Mt=Va(t.stateNode.containerInfo.firstChild),At=t,He=!0,ea=null,a=Bp(t,null,r,a),t.child=a;a;)a.flags=a.flags&-3|4096,a=a.sibling;else{if(To(),r===o){t=Pa(e,t,a);break e}vt(e,t,r,a)}t=t.child}return t;case 5:return Np(t),e===null&&yu(t),r=t.type,o=t.pendingProps,n=e!==null?e.memoizedProps:null,l=o.children,mu(r,o)?l=null:n!==null&&mu(r,n)&&(t.flags|=32),um(e,t),vt(e,t,l,a),t.child;case 6:return e===null&&yu(t),null;case 13:return fm(e,t,a);case 4:return sd(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=Po(t,null,r,a):vt(e,t,r,a),t.child;case 11:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:Zt(r,o),Lc(e,t,r,o,a);case 7:return vt(e,t,t.pendingProps,a),t.child;case 8:return vt(e,t,t.pendingProps.children,a),t.child;case 12:return vt(e,t,t.pendingProps.children,a),t.child;case 10:e:{if(r=t.type._context,o=t.pendingProps,n=t.memoizedProps,l=o.value,Fe(gs,r._currentValue),r._currentValue=l,n!==null)if(ra(n.value,l)){if(n.children===o.children&&!kt.current){t=Pa(e,t,a);break e}}else for(n=t.child,n!==null&&(n.return=t);n!==null;){var s=n.dependencies;if(s!==null){l=n.child;for(var i=s.firstContext;i!==null;){if(i.context===r){if(n.tag===1){i=wa(-1,a&-a),i.tag=2;var d=n.updateQueue;if(d!==null){d=d.shared;var c=d.pending;c===null?i.next=i:(i.next=c.next,c.next=i),d.pending=i}}n.lanes|=a,i=n.alternate,i!==null&&(i.lanes|=a),Lu(n.return,a,t),s.lanes|=a;break}i=i.next}}else if(n.tag===10)l=n.type===t.type?null:n.child;else if(n.tag===18){if(l=n.return,l===null)throw Error(R(341));l.lanes|=a,s=l.alternate,s!==null&&(s.lanes|=a),Lu(l,a,t),l=n.sibling}else l=n.child;if(l!==null)l.return=n;else for(l=n;l!==null;){if(l===t){l=null;break}if(n=l.sibling,n!==null){n.return=l.return,l=n;break}l=l.return}n=l}vt(e,t,o.children,a),t=t.child}return t;case 9:return o=t.type,r=t.pendingProps.children,Co(t,a),o=_t(o),r=r(o),t.flags|=1,vt(e,t,r,a),t.child;case 14:return r=t.type,o=Zt(r,t.pendingProps),o=Zt(r.type,o),Sc(e,t,r,o,a);case 15:return sm(e,t,t.type,t.pendingProps,a);case 17:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:Zt(r,o),Zl(e,t),t.tag=1,bt(r)?(e=!0,cs(t)):e=!1,Co(t,a),om(t,r,o),Iu(t,r,o,a),ku(null,t,r,!0,e,a);case 19:return cm(e,t,a);case 22:return im(e,t,a)}throw Error(R(156,t.tag))};function Pm(e,t){return tp(e,t)}function Zx(e,t,a,r){this.tag=e,this.key=a,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Ht(e,t,a,r){return new Zx(e,t,a,r)}function Id(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Jx(e){if(typeof e=="function")return Id(e)?1:0;if(e!=null){if(e=e.$$typeof,e===qu)return 11;if(e===_u)return 14}return 2}function Xa(e,t){var a=e.alternate;return a===null?(a=Ht(e.tag,t,e.key,e.mode),a.elementType=e.elementType,a.type=e.type,a.stateNode=e.stateNode,a.alternate=e,e.alternate=a):(a.pendingProps=t,a.type=e.type,a.flags=0,a.subtreeFlags=0,a.deletions=null),a.flags=e.flags&14680064,a.childLanes=e.childLanes,a.lanes=e.lanes,a.child=e.child,a.memoizedProps=e.memoizedProps,a.memoizedState=e.memoizedState,a.updateQueue=e.updateQueue,t=e.dependencies,a.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},a.sibling=e.sibling,a.index=e.index,a.ref=e.ref,a}function ts(e,t,a,r,o,n){var l=2;if(r=e,typeof e=="function")Id(e)&&(l=1);else if(typeof e=="string")l=5;else e:switch(e){case so:return Tr(a.children,o,n,t);case Hu:l=8,o|=8;break;case Gi:return e=Ht(12,a,t,o|2),e.elementType=Gi,e.lanes=n,e;case Ki:return e=Ht(13,a,t,o),e.elementType=Ki,e.lanes=n,e;case ji:return e=Ht(19,a,t,o),e.elementType=ji,e.lanes=n,e;case Nc:return Os(a,o,n,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case Oc:l=10;break e;case zc:l=9;break e;case qu:l=11;break e;case _u:l=14;break e;case Oa:l=16,r=null;break e}throw Error(R(130,e==null?e:typeof e,""))}return t=Ht(l,a,t,o),t.elementType=e,t.type=r,t.lanes=n,t}function Tr(e,t,a,r){return e=Ht(7,e,r,t),e.lanes=a,e}function Os(e,t,a,r){return e=Ht(22,e,r,t),e.elementType=Nc,e.lanes=a,e.stateNode={isHidden:!1},e}function Wi(e,t,a){return e=Ht(6,e,null,t),e.lanes=a,e}function $i(e,t,a){return t=Ht(4,e.children!==null?e.children:[],e.key,t),t.lanes=a,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function ev(e,t,a,r,o){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Ti(0),this.expirationTimes=Ti(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Ti(0),this.identifierPrefix=r,this.onRecoverableError=o,this.mutableSourceEagerHydrationData=null}function Cd(e,t,a,r,o,n,l,s,i){return e=new ev(e,t,a,s,i),t===1?(t=1,n===!0&&(t|=8)):t=0,n=Ht(3,null,null,t),e.current=n,n.stateNode=e,n.memoizedState={element:r,isDehydrated:a,cache:null,transitions:null,pendingSuspenseBoundaries:null},ld(n),e}function tv(e,t,a){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:lo,key:r==null?null:""+r,children:e,containerInfo:t,implementation:a}}function Rm(e){if(!e)return Ya;e=e._reactInternals;e:{if(Fr(e)!==e||e.tag!==1)throw Error(R(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if(bt(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(t!==null);throw Error(R(171))}if(e.tag===1){var a=e.type;if(bt(a))return Rp(e,a,t)}return t}function Mm(e,t,a,r,o,n,l,s,i){return e=Cd(a,r,!0,e,o,n,l,s,i),e.context=Rm(null),a=e.current,r=yt(),o=ja(a),n=wa(r,o),n.callback=t??null,Ga(a,n,o),e.current.lanes=o,Nn(e,o,r),Tt(e,r),e}function zs(e,t,a,r){var o=t.current,n=yt(),l=ja(o);return a=Rm(a),t.context===null?t.context=a:t.pendingContext=a,t=wa(n,l),t.payload={element:e},r=r===void 0?null:r,r!==null&&(t.callback=r),e=Ga(o,t,l),e!==null&&(aa(e,o,l,n),Xl(e,o,l)),l}function ks(e){if(e=e.current,!e.child)return null;switch(e.child.tag){case 5:return e.child.stateNode;default:return e.child.stateNode}}function Ec(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var a=e.retryLane;e.retryLane=a!==0&&a<t?a:t}}function wd(e,t){Ec(e,t),(e=e.alternate)&&Ec(e,t)}function av(){return null}var Am=typeof reportError=="function"?reportError:function(e){console.error(e)};function kd(e){this._internalRoot=e}Ns.prototype.render=kd.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(R(409));zs(e,t,null,null)};Ns.prototype.unmount=kd.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;Dr(function(){zs(null,e,null,null)}),t[ba]=null}};function Ns(e){this._internalRoot=e}Ns.prototype.unstable_scheduleHydration=function(e){if(e){var t=ip();e={blockedOn:null,target:e,priority:t};for(var a=0;a<Na.length&&t!==0&&t<Na[a].priority;a++);Na.splice(a,0,e),a===0&&dp(e)}};function bd(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function Us(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function Fc(){}function rv(e,t,a,r,o){if(o){if(typeof r=="function"){var n=r;r=function(){var d=ks(l);n.call(d)}}var l=Mm(t,r,e,0,null,!1,!1,"",Fc);return e._reactRootContainer=l,e[ba]=l.current,Rn(e.nodeType===8?e.parentNode:e),Dr(),l}for(;o=e.lastChild;)e.removeChild(o);if(typeof r=="function"){var s=r;r=function(){var d=ks(i);s.call(d)}}var i=Cd(e,0,!1,null,null,!1,!1,"",Fc);return e._reactRootContainer=i,e[ba]=i.current,Rn(e.nodeType===8?e.parentNode:e),Dr(function(){zs(t,i,a,r)}),i}function Hs(e,t,a,r,o){var n=a._reactRootContainer;if(n){var l=n;if(typeof o=="function"){var s=o;o=function(){var i=ks(l);s.call(i)}}zs(t,l,e,o)}else l=rv(a,t,e,o,r);return ks(l)}lp=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var a=dn(t.pendingLanes);a!==0&&(Vu(t,a|1),Tt(t,je()),(Se&6)===0&&(Ao=je()+500,er()))}break;case 13:Dr(function(){var r=Ta(e,1);if(r!==null){var o=yt();aa(r,e,1,o)}}),wd(e,1)}};Gu=function(e){if(e.tag===13){var t=Ta(e,134217728);if(t!==null){var a=yt();aa(t,e,134217728,a)}wd(e,134217728)}};sp=function(e){if(e.tag===13){var t=ja(e),a=Ta(e,t);if(a!==null){var r=yt();aa(a,e,t,r)}wd(e,t)}};ip=function(){return Re};up=function(e,t){var a=Re;try{return Re=e,t()}finally{Re=a}};ou=function(e,t,a){switch(t){case"input":if(Yi(e,a),t=a.name,a.type==="radio"&&t!=null){for(a=e;a.parentNode;)a=a.parentNode;for(a=a.querySelectorAll("input[name="+JSON.stringify(""+t)+\'][type="radio"]\'),t=0;t<a.length;t++){var r=a[t];if(r!==e&&r.form===e.form){var o=Ms(r);if(!o)throw Error(R(90));Hc(r),Yi(r,o)}}}break;case"textarea":_c(e,a);break;case"select":t=a.value,t!=null&&yo(e,!!a.multiple,t,!1)}};Xc=yd;Qc=Dr;var ov={usingClientEntryPoint:!1,Events:[Hn,co,Ms,Kc,jc,yd]},nn={findFiberByHostInstance:Cr,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},nv={bundleType:nn.bundleType,version:nn.version,rendererPackageName:nn.rendererPackageName,rendererConfig:nn.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:Ra.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=Jc(e),e===null?null:e.stateNode},findFiberByHostInstance:nn.findFiberByHostInstance||av,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1-next-f1338f8080-20240426"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&(ln=__REACT_DEVTOOLS_GLOBAL_HOOK__,!ln.isDisabled&&ln.supportsFiber))try{bs=ln.inject(nv),fa=ln}catch{}var ln;Ft.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=ov;Ft.createPortal=function(e,t){var a=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!bd(t))throw Error(R(200));return tv(e,t,null,a)};Ft.createRoot=function(e,t){if(!bd(e))throw Error(R(299));var a=!1,r="",o=Am;return t!=null&&(t.unstable_strictMode===!0&&(a=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onRecoverableError!==void 0&&(o=t.onRecoverableError)),t=Cd(e,1,!1,null,null,a,!1,r,o),e[ba]=t.current,Rn(e.nodeType===8?e.parentNode:e),new kd(t)};Ft.findDOMNode=function(e){if(e==null)return null;if(e.nodeType===1)return e;var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(R(188)):(e=Object.keys(e).join(","),Error(R(268,e)));return e=Jc(t),e=e===null?null:e.stateNode,e};Ft.flushSync=function(e){return Dr(e)};Ft.hydrate=function(e,t,a){if(!Us(t))throw Error(R(200));return Hs(null,e,t,!0,a)};Ft.hydrateRoot=function(e,t,a){if(!bd(e))throw Error(R(405));var r=a!=null&&a.hydratedSources||null,o=!1,n="",l=Am;if(a!=null&&(a.unstable_strictMode===!0&&(o=!0),a.identifierPrefix!==void 0&&(n=a.identifierPrefix),a.onRecoverableError!==void 0&&(l=a.onRecoverableError)),t=Mm(t,null,e,1,a??null,o,!1,n,l),e[ba]=t.current,Rn(e),r)for(e=0;e<r.length;e++)a=r[e],o=a._getVersion,o=o(a._source),t.mutableSourceEagerHydrationData==null?t.mutableSourceEagerHydrationData=[a,o]:t.mutableSourceEagerHydrationData.push(a,o);return new Ns(t)};Ft.render=function(e,t,a){if(!Us(t))throw Error(R(200));return Hs(null,e,t,!1,a)};Ft.unmountComponentAtNode=function(e){if(!Us(e))throw Error(R(40));return e._reactRootContainer?(Dr(function(){Hs(null,null,e,!1,function(){e._reactRootContainer=null,e[ba]=null})}),!0):!1};Ft.unstable_batchedUpdates=yd;Ft.unstable_renderSubtreeIntoContainer=function(e,t,a,r){if(!Us(a))throw Error(R(200));if(e==null||e._reactInternals===void 0)throw Error(R(38));return Hs(e,t,a,!1,r)};Ft.version="18.3.1-next-f1338f8080-20240426"});var Br=ya((hy,Fm)=>{"use strict";function Em(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(Em)}catch(e){console.error(e)}}Em(),Fm.exports=Dm()});var Om=ya(Td=>{"use strict";var Bm=Br();Td.createRoot=Bm.createRoot,Td.hydrateRoot=Bm.hydrateRoot;var xy});var _m=ya(Ks=>{"use strict";var uv=De(),dv=Symbol.for("react.element"),fv=Symbol.for("react.fragment"),cv=Object.prototype.hasOwnProperty,pv=uv.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,mv={key:!0,ref:!0,__self:!0,__source:!0};function qm(e,t,a){var r,o={},n=null,l=null;a!==void 0&&(n=""+a),t.key!==void 0&&(n=""+t.key),t.ref!==void 0&&(l=t.ref);for(r in t)cv.call(t,r)&&!mv.hasOwnProperty(r)&&(o[r]=t[r]);if(e&&e.defaultProps)for(r in t=e.defaultProps,t)o[r]===void 0&&(o[r]=t[r]);return{$$typeof:dv,type:e,key:n,ref:l,props:o,_owner:pv.current}}Ks.Fragment=fv;Ks.jsx=qm;Ks.jsxs=qm});var K=ya((mL,Wm)=>{"use strict";Wm.exports=_m()});var wg=E(Om(),1);var le=E(De(),1),Lg=E(Br(),1);function zm(e){return e.trim().replace(/^\\|/,"").replace(/\\|$/,"").split("|").map(a=>a.trim())}function lv(e){return/^\\s*\\|?\\s*:?-{3,}:?\\s*(\\|\\s*:?-{3,}:?\\s*)+\\|?\\s*$/.test(e)}function sv(e){let t=e.split(`\n`),a=[],r=0;for(;r<t.length;){let o=t[r]??"",n=t[r+1]??"";if(o.includes("|")&&lv(n)){let l=zm(o),s=[];for(r+=2;r<t.length&&t[r].includes("|")&&t[r].trim()!=="";)s.push(zm(t[r])),r+=1;let i=`<tr>${l.map(c=>`<th style="text-align:left;padding:7px 10px;border:1px solid #334155;color:#e2e8f0;background:#0f172a;">${c}</th>`).join("")}</tr>`,d=s.map(c=>`<tr>${c.map(p=>`<td style="padding:7px 10px;border:1px solid #334155;color:#cbd5e1;vertical-align:top;">${p}</td>`).join("")}</tr>`).join("");a.push(`<div style="overflow-x:auto;margin:0.65em 0;"><table style="border-collapse:collapse;min-width:360px;width:100%;font-size:12px;"><thead>${i}</thead><tbody>${d}</tbody></table></div>`);continue}a.push(t[r]),r+=1}return a.join(`\n`)}function qs(e){if(!e)return\'<span style="color:#475569;font-style:italic;">No description yet</span>\';let t=e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""");return sv(t).replace(/^### (.+)$/gm,\'<h3 style="font-weight:700;margin:0.8em 0 0.3em;font-size:1.05em;color:#cbd5e1;">$1</h3>\').replace(/^## (.+)$/gm,\'<h2 style="font-weight:700;margin:0.8em 0 0.3em;font-size:1.2em;color:#f1f5f9;">$1</h2>\').replace(/^# (.+)$/gm,\'<h1 style="font-weight:700;margin:0.8em 0 0.3em;font-size:1.4em;color:#f1f5f9;">$1</h1>\').replace(/[*][*]([^\\n]+?)[*][*]/g,\'<strong style="font-weight:700;color:#f1f5f9;">$1</strong>\').replace(/__([^\\n]+?)__/g,\'<strong style="font-weight:700;color:#f1f5f9;">$1</strong>\').replace(/[*]([^\\n*]+?)[*]/g,\'<em style="font-style:italic;color:#94a3b8;">$1</em>\').replace(/(?<![a-zA-Z0-9])_([^_\\n]+?)_(?![a-zA-Z0-9])/g,\'<em style="font-style:italic;color:#94a3b8;">$1</em>\').replace(/`(.+?)`/g,\'<code style="font-family:Menlo,monospace;font-size:12px;background:#1e293b;padding:1px 5px;border-radius:3px;color:#7dd3fc;">$1</code>\').replace(/\\[([^\\]]+)\\]\\((https?:\\/\\/[^)]+)\\)/g,\'<a href="$2" target="_blank" rel="noopener noreferrer" style="color:#60a5fa;text-decoration:underline;">$1</a>\').replace(/(^|[\\s(>])((https?:\\/\\/)[^\\s<>"\']+)/g,\'$1<a href="$2" target="_blank" rel="noopener noreferrer" style="color:#60a5fa;text-decoration:underline;word-break:break-all;">$2</a>\').replace(/(^|[^\\w])#([a-f0-9]{30})(?![a-f0-9])/gi,\'$1<a href="#task-$2" data-task-ref="$2" style="color:#60a5fa;text-decoration:underline;font-family:Menlo,monospace;">#$2</a>\').replace(/^[-*] (.+)$/gm,\'<li style="margin:0.2em 0;display:list-item;">$1</li>\').replace(/^---$/gm,\'<hr style="border:none;border-top:1px solid #334155;margin:0.8em 0;">\').replace(/(<li[^>]*>[\\s\\S]*?<\\/li>\\n?)+/g,r=>`<ul style="padding-left:1.5em;margin:0.4em 0;list-style-type:disc;">${r}</ul>`).replace(/^(?!<[a-z]|$).+$/gm,r=>`<p style="margin:0.5em 0;">${r}</p>`)}var iv="proto-comments-seen";function Pd(e,t){try{let a=localStorage.getItem(iv),r=a?JSON.parse(a):{};return t>(r[e]??0)}catch{return!1}}function Rd(e){return e<1024?`${e} B`:e<1048576?`${(e/1024).toFixed(1)} KB`:`${(e/1048576).toFixed(1)} MB`}function Pt(e){try{return new Date(e).toLocaleString()}catch{return e}}var Md=16,Fo=1000000n,$s=BigInt("9".repeat(Md));function $t(e){return(e<0n?0n:e>$s?$s:e).toString().padStart(Md,"0")}function _s(e){let t=e.split(".")[0];return/^\\d+$/.test(t)?BigInt(t):$s}function Ws(e){let t=e.indexOf(".");return t>=0?e.slice(t+1):null}function Ma(e,t){if(t===null){if(e===null)return $t(Fo);let l=_s(e);if(l<$s-Fo)return $t(l+Fo);let s=Ws(e)??"0".repeat(Md);return $t(l)+"."+Ma(s,null)}if(e===null){let l=_s(t),s=Ws(t);return l>Fo?$t(l-Fo):s!==null?$t(l)+"."+Ma(null,s):l>0n?$t(l/2n):$t(0n)+".0"}let a=_s(e),r=_s(t),o=Ws(e),n=Ws(t);return r>a+1n?$t((a+r)/2n):r===a+1n?$t(a)+"."+Ma(o,null):o===null&&n===null?$t(a)+"."+$t(Fo):$t(a)+"."+Ma(o,n)}function Or(e,t){return e.sortKey&&t.sortKey?e.sortKey<t.sortKey?-1:e.sortKey>t.sortKey?1:0:e.sortKey?-1:t.sortKey?1:(e.updatedAt??e.createdAt??"").localeCompare(t.updatedAt??t.createdAt??"")}function Ad(e,t,a,r){let o=new Map,n=null;for(let p of e)p.sortKey&&p.sortKey!=="n"&&(o.set(p.id,p.sortKey),n=p.sortKey);let l=[],s=e.filter(p=>!p.sortKey||p.sortKey==="n");if(s.length>0){let p=n;for(let g of s){let L=Ma(p,null);o.set(g.id,L),p=L,g.id!==t&&l.push({id:g.id,sortKey:L})}}let i=a?o.get(a)??null:null,d=r?o.get(r)??null:null;return{newSortKey:Ma(i,d),normalizationPatches:l}}var Vt=E(De(),1);var Gs=E(De());var Nm=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),Vs=(...e)=>e.filter((t,a,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===a).join(" ").trim();var _n=E(De());var Um={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"};var Hm=(0,_n.forwardRef)(({color:e="currentColor",size:t=24,strokeWidth:a=2,absoluteStrokeWidth:r,className:o="",children:n,iconNode:l,...s},i)=>(0,_n.createElement)("svg",{ref:i,...Um,width:t,height:t,stroke:e,strokeWidth:r?Number(a)*24/Number(t):a,className:Vs("lucide",o),...s},[...l.map(([d,c])=>(0,_n.createElement)(d,c)),...Array.isArray(n)?n:[n]]));var G=(e,t)=>{let a=(0,Gs.forwardRef)(({className:r,...o},n)=>(0,Gs.createElement)(Hm,{ref:n,iconNode:t,className:Vs(`lucide-${Nm(e)}`,r),...o}));return a.displayName=`${e}`,a};var mt=G("Bot",[["path",{d:"M12 8V4H8",key:"hb8ula"}],["rect",{width:"16",height:"12",x:"4",y:"8",rx:"2",key:"enze0r"}],["path",{d:"M2 14h2",key:"vft8re"}],["path",{d:"M20 14h2",key:"4cs60a"}],["path",{d:"M15 13v2",key:"1xurst"}],["path",{d:"M9 13v2",key:"rq6x2g"}]]);var pa=G("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);var Wn=G("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);var tr=G("CircleCheckBig",[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]]);var ar=G("Clock",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16 14",key:"68esgv"}]]);var zr=G("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"}]]);var $n=G("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"}]]);var Bo=G("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"}]]);var Vn=G("Flag",[["path",{d:"M4 15s1-1 4-1 5 2 8 2 4-1 4-1V3s-1 1-4 1-5-2-8-2-4 1-4 1z",key:"i9b6wo"}],["line",{x1:"4",x2:"4",y1:"22",y2:"15",key:"1cm3nv"}]]);var Gn=G("FolderTree",[["path",{d:"M20 10a1 1 0 0 0 1-1V6a1 1 0 0 0-1-1h-2.5a1 1 0 0 1-.8-.4l-.9-1.2A1 1 0 0 0 15 3h-2a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1Z",key:"hod4my"}],["path",{d:"M20 21a1 1 0 0 0 1-1v-3a1 1 0 0 0-1-1h-2.9a1 1 0 0 1-.88-.55l-.42-.85a1 1 0 0 0-.92-.6H13a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1Z",key:"w4yl2u"}],["path",{d:"M3 5a2 2 0 0 0 2 2h3",key:"f2jnh7"}],["path",{d:"M3 3v13a2 2 0 0 0 2 2h3",key:"k8epm1"}]]);var Kn=G("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"}]]);var jn=G("LayoutDashboard",[["rect",{width:"7",height:"9",x:"3",y:"3",rx:"1",key:"10lvy0"}],["rect",{width:"7",height:"5",x:"14",y:"3",rx:"1",key:"16une8"}],["rect",{width:"7",height:"9",x:"14",y:"12",rx:"1",key:"1hutg5"}],["rect",{width:"7",height:"5",x:"3",y:"16",rx:"1",key:"ldoo1y"}]]);var Xn=G("List",[["path",{d:"M3 12h.01",key:"nlz23k"}],["path",{d:"M3 18h.01",key:"1tta3j"}],["path",{d:"M3 6h.01",key:"1rqtza"}],["path",{d:"M8 12h13",key:"1za7za"}],["path",{d:"M8 18h13",key:"1lx6n3"}],["path",{d:"M8 6h13",key:"ik3vkj"}]]);var Qn=G("Lock",[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4",key:"fwvmzm"}]]);var Nr=G("MessageCircle",[["path",{d:"M7.9 20A9 9 0 1 0 4 16.1L2 22Z",key:"vv11sd"}]]);var rr=G("PanelsTopLeft",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M3 9h18",key:"1pudct"}],["path",{d:"M9 21V9",key:"1oto5p"}]]);var Ur=G("Paperclip",[["path",{d:"M13.234 20.252 21 12.3",key:"1cbrk9"}],["path",{d:"m16 6-8.414 8.586a2 2 0 0 0 0 2.828 2 2 0 0 0 2.828 0l8.414-8.586a4 4 0 0 0 0-5.656 4 4 0 0 0-5.656 0l-8.415 8.585a6 6 0 1 0 8.486 8.486",key:"1pkts6"}]]);var Hr=G("Play",[["polygon",{points:"6 3 20 12 6 21 6 3",key:"1oa8hb"}]]);var Yn=G("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);var qr=G("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);var _r=G("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"}]]);var or=G("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"}]]);var Wr=G("Square",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]]);var Oo=G("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"}]]);var Zn=G("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"}]]);var nr=G("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"}]]);var zo=G("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"}]]);var Jn=G("User",[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]]);var el=G("Workflow",[["rect",{width:"8",height:"8",x:"3",y:"3",rx:"2",key:"by2w9f"}],["path",{d:"M7 11v4a2 2 0 0 0 2 2h4",key:"xkn7yn"}],["rect",{width:"8",height:"8",x:"13",y:"13",rx:"2",key:"1cgmvn"}]]);var Ge=G("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);var No=E(De(),1),tg=E(Br(),1);var Gm=E(K(),1),$m={Bug:{background:"rgba(239,68,68,0.12)",color:"#f87171",border:"rgba(239,68,68,0.25)"},Research:{background:"rgba(192,132,252,0.12)",color:"#c084fc",border:"rgba(139,92,246,0.2)"},Task:{background:"rgba(148,163,184,0.1)",color:"#94a3b8",border:"rgba(148,163,184,0.2)"}};function Vm({type:e,style:t}){let a=typeof e=="string"&&e.trim()&&e!=="[object Object]"&&$m[e]?e:"Task",r=$m[a];return(0,Gm.jsx)("span",{style:{fontSize:9,fontWeight:700,letterSpacing:"0.04em",padding:"1px 5px",borderRadius:3,flexShrink:0,textTransform:"uppercase",background:r.background,color:r.color,border:`1px solid ${r.border}`,lineHeight:"1.5",...t},children:a})}var Xm=E(K(),1),Km={Critical:{background:"rgba(239,68,68,0.15)",color:"#f87171",border:"rgba(239,68,68,0.3)"},High:{background:"rgba(249,115,22,0.12)",color:"#fb923c",border:"rgba(249,115,22,0.25)"},Medium:{background:"rgba(234,179,8,0.12)",color:"#facc15",border:"rgba(234,179,8,0.25)"},Low:{background:"rgba(148,163,184,0.1)",color:"#94a3b8",border:"rgba(148,163,184,0.2)"}};function jm({priority:e,style:t}){if(!e||!Km[e])return null;let a=Km[e];return(0,Xm.jsx)("span",{style:{fontSize:9,fontWeight:700,letterSpacing:"0.04em",padding:"1px 5px",borderRadius:3,flexShrink:0,textTransform:"uppercase",background:a.background,color:a.color,border:`1px solid ${a.border}`,lineHeight:"1.5",...t},children:e})}var $r=[{value:"Task",icon:"\\u2611",label:"Task",css:"type-task",tooltip:"A general task or feature to implement."},{value:"Bug",icon:"\\u{1F41E}",label:"Bug",css:"type-bug",tooltip:"A defect \\u2014 annotator collects page errors and console logs to help reproduce it."},{value:"Research",icon:"\\u{1F52C}",label:"Research",css:"type-research",tooltip:"A research task \\u2014 agent will NOT write code but must attach a findings report."}],xL=$r.map(e=>e.value),Ym=Object.fromEntries($r.map(e=>[e.value,e.icon])),vL=Object.fromEntries($r.map(e=>[e.value,e.css])),Qm={Task:"#94a3b8",Bug:"#ef4444",Research:"#a855f7"};function tl(e){return Qm[e??"Task"]??Qm.Task}var Zm=[{bg:"color-mix(in srgb, var(--p-blue) 14%, transparent)",text:"var(--p-blue-200)",border:"color-mix(in srgb, var(--p-blue) 30%, transparent)"},{bg:"color-mix(in srgb, var(--p-green) 14%, transparent)",text:"var(--p-green-300)",border:"color-mix(in srgb, var(--p-green) 30%, transparent)"},{bg:"color-mix(in srgb, var(--p-purple) 14%, transparent)",text:"var(--p-purple-300)",border:"color-mix(in srgb, var(--p-purple) 30%, transparent)"},{bg:"color-mix(in srgb, var(--p-amber) 14%, transparent)",text:"var(--p-amber-300)",border:"color-mix(in srgb, var(--p-amber) 30%, transparent)"},{bg:"color-mix(in srgb, #f472b6 14%, transparent)",text:"#f9a8d4",border:"color-mix(in srgb, #f472b6 30%, transparent)"},{bg:"color-mix(in srgb, var(--p-cyan) 14%, transparent)",text:"var(--p-cyan-300)",border:"color-mix(in srgb, var(--p-cyan) 30%, transparent)"},{bg:"color-mix(in srgb, #f87171 14%, transparent)",text:"#fca5a5",border:"color-mix(in srgb, #f87171 30%, transparent)"},{bg:"color-mix(in srgb, var(--p-text-g) 14%, transparent)",text:"var(--p-text-m)",border:"color-mix(in srgb, var(--p-text-g) 30%, transparent)"}];function gv(e){let t=0;for(let a=0;a<e.length;a++)t=t*31+e.charCodeAt(a)>>>0;return t%Zm.length}function oa(e){return Zm[gv(e)]}var al=E(K(),1);function rl({tags:e,onRemove:t,size:a="sm"}){if(!e.length)return null;let r=a==="xs"?"1px 6px":"2px 7px",o=a==="xs"?9:10;return(0,al.jsx)("div",{style:{display:"flex",flexWrap:"wrap",gap:3,alignItems:"center"},children:e.map(n=>{let{bg:l,text:s,border:i}=oa(n);return(0,al.jsxs)("span",{style:{display:"inline-flex",alignItems:"center",gap:3,padding:r,borderRadius:100,background:l,border:`1px solid ${i}`,color:s,fontSize:o,fontWeight:600,whiteSpace:"nowrap"},children:[n,t&&(0,al.jsx)("button",{type:"button",onClick:d=>{d.stopPropagation(),t(n)},style:{display:"flex",background:"none",border:"none",color:s,cursor:"pointer",padding:0,lineHeight:1,opacity:.7},onMouseEnter:d=>{d.currentTarget.style.opacity="1"},onMouseLeave:d=>{d.currentTarget.style.opacity="0.7"},children:"\\xD7"})]},n)})})}var ie=E(K(),1);function hv(e){return/\\.(png|jpe?g|gif|webp|svg|avif)$/i.test(e)}function ag(e,t){if(!/^#[0-9a-fA-F]{6}$/.test(e))return;let a=Math.max(0,Math.min(1,t)),r=Math.round(a*255).toString(16).padStart(2,"0");return`${e}${r}`}function rg(e,t){return ag(e,t==="Critical"?.36:t==="High"?.3:.24)??"color-mix(in srgb, var(--p-text-g) 40%, transparent)"}function xv(e){return ag(e,.05)??"transparent"}var vv={padding:"7px 8px",gap:4,opacity:.45,userSelect:"none"},yv={display:"flex",alignItems:"center",gap:5},Lv={width:12,height:12,color:"color-mix(in srgb, var(--p-green) 55%, transparent)",flexShrink:0},Sv={fontSize:11.5,fontWeight:600,color:"var(--p-text-g)",textDecoration:"line-through",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",flex:1},Iv={display:"flex",alignItems:"center",gap:5,minWidth:0},Jm={flexShrink:0},Cv={fontSize:11.5,fontWeight:600,color:"var(--p-text)",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",flex:1},wv={display:"flex",alignItems:"flex-start",gap:8},kv={fontSize:10,color:"var(--p-text-g)",lineHeight:"1.45",overflow:"hidden",display:"-webkit-box",WebkitBoxOrient:"vertical",WebkitLineClamp:2,flex:1,minWidth:0},bv={position:"relative",flexShrink:0},Tv={width:52,height:34,borderRadius:6,objectFit:"cover",border:"1px solid color-mix(in srgb, var(--p-border) 90%, transparent)",display:"block",cursor:"pointer"},Pv={display:"flex",alignItems:"center",gap:2,marginTop:1},Rv={flex:1},Dd=No.default.memo(function({task:t,col:a,liveActivity:r,onOpen:o,onDragStart:n,selectMode:l,selected:s,onToggleSelect:i,agentStatus:d,experimentalAgents:c,multiDragCount:p}){var Te;let g=a.id==="in-progress",L=a.id==="done",[x,I]=No.default.useState(!1),[N,m]=No.default.useState(null),u=No.default.useRef(null),f=t.commentCount??0,v=t.fileCount??0,C=f>0&&Pd(t.id,f),w=rg(a.color,t.priority),y=tl(t.type),k=xv(y),z=(Te=t.files)==null?void 0:Te.find(ue=>hv(ue.name)),U=z?`/api/tasks/${t.id}/files/${encodeURIComponent(z.name)}`:null;function F(ue){n(ue,t.id),ue.currentTarget.classList.add("dragging")}function Z(ue){ue.currentTarget.classList.remove("dragging")}function oe(ue){if(l){ue.stopPropagation(),i==null||i(t.id);return}o(t)}function fe(ue){ue.stopPropagation(),i==null||i(t.id)}let Ce=c===!0&&d==="running"?"1px solid rgba(59,130,246,0.5)":c===!0&&d==="queued"?"1px solid color-mix(in srgb, var(--p-amber) 45%, transparent)":c===!0&&d==="done"?"1px solid color-mix(in srgb, var(--p-green) 40%, transparent)":void 0,ee=c===!0&&d==="running"?"color-mix(in srgb, var(--p-blue) 6%, var(--p-card))":c===!0&&d==="queued"?"color-mix(in srgb, var(--p-amber) 5%, var(--p-card))":c===!0&&d==="done"?"color-mix(in srgb, var(--p-green) 5%, var(--p-card))":void 0;return L?(0,ie.jsx)("article",{className:"task-card",draggable:!0,"data-task-id":t.id,style:{...vv,...l&&s?{borderColor:"var(--p-blue)",background:"color-mix(in srgb, var(--p-blue) 10%, var(--p-card))"}:{}},onDragStart:F,onDragEnd:Z,onClick:oe,children:(0,ie.jsxs)("div",{style:yv,children:[l&&(0,ie.jsx)("span",{onClick:fe,style:{width:12,height:12,borderRadius:3,border:s?"1px solid var(--p-blue)":"1px solid var(--p-border-s)",background:s?"var(--p-blue)":"var(--p-input)",flexShrink:0,cursor:"pointer",display:"inline-flex",alignItems:"center",justifyContent:"center"},children:s&&(0,ie.jsx)("span",{style:{color:"#fff",fontSize:9,fontWeight:700},children:"\\u2713"})}),(0,ie.jsx)(tr,{style:Lv}),(0,ie.jsx)("span",{style:Sv,children:t.title}),p!=null&&(0,ie.jsxs)("span",{style:{fontSize:9,fontWeight:700,padding:"1px 5px",borderRadius:4,background:"var(--p-blue)",color:"#fff",flexShrink:0,marginLeft:4},children:["+",p-1]})]})}):(0,ie.jsxs)("article",{className:`task-card${r?" task-live-edit":""}`,draggable:!0,"data-task-id":t.id,style:{padding:"7px 8px",gap:4,userSelect:"none",background:r?"rgba(59,130,246,0.08)":ee??k,border:Ce??(r?"1px solid rgba(59,130,246,0.5)":w?`1px solid ${w}`:void 0),...r?{boxShadow:"0 0 0 2px rgba(59,130,246,0.14)"}:{},...l&&s?{borderColor:"var(--p-blue)",background:"color-mix(in srgb, var(--p-blue) 10%, var(--p-card))"}:{}},onDragStart:F,onDragEnd:Z,onClick:oe,children:[(0,ie.jsxs)("div",{style:Iv,children:[l&&(0,ie.jsx)("span",{onClick:fe,style:{width:14,height:14,borderRadius:3,border:s?"1px solid var(--p-blue)":"1px solid var(--p-border-s)",background:s?"var(--p-blue)":"var(--p-input)",flexShrink:0,cursor:"pointer",display:"inline-flex",alignItems:"center",justifyContent:"center",marginRight:2},children:s&&(0,ie.jsx)("span",{style:{color:"#fff",fontSize:9,fontWeight:700},children:"\\u2713"})}),g&&(0,ie.jsx)("span",{className:"spinner",style:Jm}),c===!0&&d==="running"&&!g&&(0,ie.jsx)("span",{className:"spinner",style:Jm}),(0,ie.jsx)("span",{style:Cv,children:t.title}),p!=null&&(0,ie.jsxs)("span",{style:{fontSize:9,fontWeight:700,padding:"1px 5px",borderRadius:4,background:"var(--p-blue)",color:"#fff",flexShrink:0,marginLeft:4},children:["+",p-1]})]}),(t.description||U)&&(0,ie.jsxs)("div",{style:wv,children:[t.description&&(0,ie.jsx)("div",{style:kv,children:t.description}),U&&(0,ie.jsxs)("div",{style:bv,onMouseEnter:()=>{if(u.current){let ue=u.current.getBoundingClientRect();m({top:ue.top,right:ue.right})}I(!0)},onMouseLeave:()=>{I(!1),m(null)},children:[(0,ie.jsx)("img",{ref:u,src:U,alt:"Task screenshot","data-role":"task-thumb",style:Tv}),x&&N&&tg.default.createPortal((0,ie.jsx)("img",{src:U,alt:"Task screenshot enlarged preview","data-role":"task-thumb-preview",style:{position:"fixed",right:window.innerWidth-N.right,bottom:window.innerHeight-N.top+8,width:220,height:138,borderRadius:8,objectFit:"cover",border:"1px solid color-mix(in srgb, var(--p-border) 96%, transparent)",boxShadow:"0 10px 24px color-mix(in srgb, var(--p-bg) 75%, transparent)",pointerEvents:"none",zIndex:9999,background:"var(--p-bg)"}}),document.body)]})]}),(0,ie.jsxs)("div",{className:"flex items-center",style:Pv,children:[(0,ie.jsx)(Vm,{type:t.type}),t.priority&&(0,ie.jsx)(jm,{priority:t.priority}),c===!0&&d==="running"&&(0,ie.jsxs)("span",{style:{display:"inline-flex",alignItems:"center",gap:3,fontSize:10,fontWeight:600,padding:"1px 6px",borderRadius:6,background:"rgba(59,130,246,0.12)",color:"#60a5fa",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",maxWidth:90},children:[(0,ie.jsx)("span",{className:"spinner",style:{width:8,height:8,borderWidth:1.5}}),"Agent"]}),c===!0&&d==="queued"&&(0,ie.jsx)("span",{style:{display:"inline-flex",alignItems:"center",gap:3,fontSize:10,fontWeight:600,padding:"1px 6px",borderRadius:6,background:"rgba(245,158,11,0.12)",color:"var(--p-amber)",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",maxWidth:90},children:"\\u23F3 Queued"}),c===!0&&d==="done"&&(0,ie.jsx)("span",{style:{display:"inline-flex",alignItems:"center",gap:3,fontSize:10,fontWeight:600,padding:"1px 6px",borderRadius:6,background:"rgba(34,197,94,0.12)",color:"var(--p-green)",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",maxWidth:90},children:"\\u2713 Done"}),c===!0&&!d&&t.agent&&(0,ie.jsxs)("span",{style:{display:"inline-flex",alignItems:"center",gap:3,fontSize:10,fontWeight:600,padding:"1px 6px",borderRadius:6,background:"rgba(139,92,246,0.12)",color:"#a78bfa",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",maxWidth:90},title:`Agent: ${t.agent}`,children:[(0,ie.jsx)(mt,{style:{width:8,height:8,flexShrink:0}}),"Agent"]}),g&&t.assigneeName&&(0,ie.jsx)("span",{style:{fontSize:10,fontWeight:600,padding:"1px 6px",borderRadius:6,background:"rgba(59,130,246,0.12)",color:"#60a5fa",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",maxWidth:80},children:t.assigneeName}),t.tags&&t.tags.length>0&&(0,ie.jsx)(rl,{tags:t.tags,size:"xs"}),(0,ie.jsx)("div",{style:Rv}),r&&(0,ie.jsx)(Ed,{activity:r}),(0,ie.jsx)(eg,{icon:(0,ie.jsx)(Nr,{style:{width:9,height:9}}),label:f>0?String(f):"",color:C?"var(--p-purple)":f>0?"var(--p-text-m)":"var(--p-border-t)",hoverColor:C?"var(--p-purple-300)":"var(--p-text)",title:f>0?`${f} comment(s)`:"Add comment",badge:C,badgeColor:"var(--p-purple)",onClick:ue=>{ue.stopPropagation(),o(t,"comments")}}),(0,ie.jsx)(eg,{icon:(0,ie.jsx)(Ur,{style:{width:9,height:9}}),label:v>0?String(v):"",color:v>0?"var(--p-blue-300)":"var(--p-border-t)",hoverColor:v>0?"var(--p-cyan-300)":"var(--p-text-sub)",title:v>0?`${v} file(s) attached`:"Files",onClick:ue=>{ue.stopPropagation(),o(t,"files")}})]})]})});function eg({icon:e,label:t,color:a,hoverColor:r,title:o,badge:n,badgeColor:l,onClick:s}){let[i,d]=No.default.useState(!1);return(0,ie.jsxs)("button",{style:{display:"inline-flex",alignItems:"center",gap:2,padding:"2px 3px",borderRadius:3,border:"none",background:i?"color-mix(in srgb, var(--p-text-m) 10%, transparent)":"transparent",cursor:"pointer",fontSize:9,color:i?r:a,transition:"color .1s, background .1s"},title:o,onMouseEnter:()=>d(!0),onMouseLeave:()=>d(!1),onClick:s,children:[e,t&&(0,ie.jsx)("span",{children:t}),n&&(0,ie.jsx)("span",{style:{width:4,height:4,background:l??a,borderRadius:"50%",flexShrink:0}})]})}function Ed({activity:e}){let t=e.state==="locked"||e.state==="editing",a=t?(0,ie.jsx)(Qn,{style:{width:8,height:8}}):(0,ie.jsx)($n,{style:{width:8,height:8}}),r=t?`Locked by ${e.user}`:`${e.user} viewing`;return(0,ie.jsxs)("span",{style:t?{display:"inline-flex",alignItems:"center",gap:3,borderRadius:999,padding:"1px 5px",fontSize:9,fontWeight:600,border:"1px solid rgba(244,114,182,0.35)",color:"#f9a8d4",background:"rgba(157,23,77,0.28)",flexShrink:0,maxWidth:110,overflow:"hidden",whiteSpace:"nowrap",flexWrap:"nowrap"}:{display:"inline-flex",alignItems:"center",gap:3,borderRadius:999,padding:"1px 5px",fontSize:9,fontWeight:600,border:"1px solid rgba(59,130,246,0.35)",color:"#93c5fd",background:"rgba(30,58,138,0.28)",flexShrink:0,maxWidth:110,overflow:"hidden",whiteSpace:"nowrap",flexWrap:"nowrap"},title:r,"data-testid":"live-activity-badge",children:[a,(0,ie.jsx)("span",{style:{overflow:"hidden",textOverflow:"ellipsis",minWidth:0,flex:"1 1 0"},children:e.user})]})}var me=E(K(),1),lr=[{id:"backlog",label:"Backlog",color:"var(--p-text-f)",accent:"color-mix(in srgb, var(--p-text-g) 20%, transparent)"},{id:"todo",label:"Todo",color:"var(--p-amber)",accent:"color-mix(in srgb, var(--p-amber) 12%, transparent)"},{id:"in-progress",label:"In Progress",color:"var(--p-blue)",accent:"color-mix(in srgb, var(--p-blue) 12%, transparent)",glow:!0},{id:"review",label:"Review",color:"var(--p-purple)",accent:"color-mix(in srgb, var(--p-purple) 12%, transparent)"},{id:"done",label:"Done",color:"var(--p-green)",accent:"color-mix(in srgb, var(--p-green) 10%, transparent)"}];var Mv=3;function Av(){return(0,me.jsxs)("div",{style:{borderRadius:8,border:"1px solid var(--p-border-t)",padding:"10px 12px",background:"var(--p-bg-2)",marginBottom:6,animation:"skeleton-pulse 1.5s ease-in-out infinite"},children:[(0,me.jsx)("div",{style:{height:12,borderRadius:4,background:"var(--p-border-s)",width:"75%",marginBottom:8}}),(0,me.jsx)("div",{style:{height:10,borderRadius:4,background:"var(--p-border-s)",width:"50%",marginBottom:8}}),(0,me.jsxs)("div",{style:{display:"flex",gap:6},children:[(0,me.jsx)("div",{style:{height:18,borderRadius:10,background:"var(--p-border-s)",width:48}}),(0,me.jsx)("div",{style:{height:18,borderRadius:10,background:"var(--p-border-s)",width:36}})]})]})}function Fd({tasks:e,visibleCols:t,searchQuery:a,isLoading:r,liveActivities:o,onOpenPanel:n,onDrop:l,onReorder:s,selectMode:i,selectedTaskIds:d,onToggleSelect:c,agentStatuses:p,onRunSelectedAgents:g,onExitSelectMode:L,experimentalAgents:x}){let I=Vt.default.useRef(null),N=Vt.default.useRef(null),[m,u]=Vt.default.useState(null),[f,v]=Vt.default.useState(null),[C,w]=Vt.default.useState(null),y=Vt.default.useRef(null),k=Vt.default.useRef(null),[z,U]=Vt.default.useState([]),F=Vt.default.useRef([]),Z=a?e.filter(T=>(T.title??"").toLowerCase().includes(a.toLowerCase())||(T.description??"").toLowerCase().includes(a.toLowerCase())):e,oe=lr.filter(T=>t.includes(T.id));Vt.default.useEffect(()=>{let T=I.current,V=N.current;if(!T||!V)return;function B(){if(!T||!V)return;let Oe=T.scrollWidth>T.clientWidth?T.clientWidth/T.scrollWidth:1,Ke=Math.max(40,T.clientWidth*Oe);V.style.width=`${Ke}px`;let we=T.scrollWidth-T.clientWidth,ye=T.clientWidth-Ke;V.style.left=`${we>0?T.scrollLeft/we*ye:0}px`,V.style.opacity=Oe<1?"1":"0"}T.addEventListener("scroll",B);let A=new ResizeObserver(B);A.observe(T),B();let ge=!1,Le=0,Me=0;function rt(Oe){ge=!0,Le=Oe.clientX,Me=T.scrollLeft,V.classList.add("dragging"),document.addEventListener("mousemove",ve),document.addEventListener("mouseup",Xe)}function ve(Oe){if(!ge||!T||!V)return;let Ke=T.scrollWidth>T.clientWidth?T.scrollWidth/T.clientWidth:1;T.scrollLeft=Me+(Oe.clientX-Le)*Ke}function Xe(){ge=!1,V==null||V.classList.remove("dragging"),document.removeEventListener("mousemove",ve),document.removeEventListener("mouseup",Xe)}return V.addEventListener("mousedown",rt),()=>{T.removeEventListener("scroll",B),A.disconnect(),V.removeEventListener("mousedown",rt)}},[oe.length]);function fe(T,V){if(y.current=V,u(V),T.dataTransfer.effectAllowed="move",i&&(d!=null&&d.has(V))&&(d.size??0)>1){let B=Array.from(d);F.current=B,U(B)}else F.current=[],U([])}function Ce(T,V){T.preventDefault(),v(V)}function ee(T,V){T.preventDefault(),T.stopPropagation();let B=T.currentTarget.getBoundingClientRect(),A=T.clientY<B.top+B.height/2?"before":"after",ge={taskId:V,position:A};k.current=ge,w(Le=>(Le==null?void 0:Le.taskId)===V&&Le.position===A?Le:ge)}function Te(T,V,B){T.preventDefault(),v(null);let A=k.current;k.current=null,w(null);let ge=y.current;y.current=null,u(null);let Le=F.current;if(F.current=[],U([]),!!ge){if(Le.length>1&&s){let Me=Le.map(ye=>e.find(gt=>gt.id===ye)).filter(Boolean).sort(Or).map(ye=>ye.id),ve=e.filter(ye=>ye.status===V).sort(Or).filter(ye=>!Le.includes(ye.id)),Xe;if(A){let ye=ve.findIndex(gt=>gt.id===A.taskId);Xe=A.position==="before"?ye:ye+1}else Xe=ve.length;let Oe=Me.map(ye=>e.find(gt=>gt.id===ye)),Ke=[...ve.slice(0,Xe),...Oe,...ve.slice(Xe)],we=new Map;for(let ye of Ke)we.set(ye.id,ye.sortKey??null);for(let ye=0;ye<Ke.length;ye++){let gt=Ke[ye];if(!Le.includes(gt.id))continue;let ht=ye>0?Ke[ye-1].id:null,et=ye<Ke.length-1?Ke[ye+1].id:null,ha=ht?we.get(ht)??null:null,Bt=et?we.get(et)??null:null,xa=Ma(ha,Bt);we.set(gt.id,xa),s(gt.id,V,ht,et,xa)}return}if(s&&A){let Me=B.findIndex(Xe=>Xe.id===A.taskId),rt=null,ve=null;A.position==="before"?(ve=A.taskId,rt=Me>0?B[Me-1].id:null):(rt=A.taskId,ve=Me<B.length-1?B[Me+1].id:null),s(ge,V,rt,ve)}else l(ge,V)}}function ue(){y.current=null,u(null),v(null),k.current=null,w(null),F.current=[],U([])}let J=(d==null?void 0:d.size)??0;return(0,me.jsxs)(me.Fragment,{children:[(0,me.jsx)("main",{id:"kanban-board",ref:I,className:"flex-1 flex overflow-x-auto overflow-y-hidden",style:{padding:"16px 20px",gap:16},onDragEnd:ue,children:oe.map(T=>{let V=r?[]:Z.filter(A=>A.status===T.id).sort(Or),B=T.id==="done"?[...V].reverse():V;return(0,me.jsx)(Dv,{col:T,tasks:B,isLoading:r,liveActivities:o,isDragOver:f===T.id&&!C,onDragOver:A=>Ce(A,T.id),onDrop:A=>Te(A,T.id,V),onDragLeave:A=>{let ge=A.relatedTarget;ge&&A.currentTarget.contains(ge)||(v(null),k.current=null,w(null))},onStatusChange:(A,ge)=>l(A,ge),onAddTask:()=>n(null,"details",T.id),onOpenTask:n,onDragStart:fe,onCardDragOver:ee,cardDropTarget:C,selectMode:i,selectedTaskIds:d,onToggleSelect:c,agentStatuses:x===!0?p:void 0,experimentalAgents:x,multiDragIds:z},T.id)})}),x===!0&&i&&J>0&&(0,me.jsxs)("div",{style:{position:"fixed",bottom:14,left:"50%",transform:"translateX(-50%)",zIndex:45,display:"flex",alignItems:"center",gap:10,background:"var(--p-surface)",border:"1px solid var(--p-border-s)",borderRadius:10,padding:"8px 14px",boxShadow:"0 -4px 24px rgba(0,0,0,0.4)"},children:[(0,me.jsxs)("span",{style:{fontSize:12,color:"var(--p-text-m)",fontWeight:500},children:[(0,me.jsx)("strong",{style:{color:"var(--p-text)"},children:J})," task",J!==1?"s":""," selected"]}),(0,me.jsx)("div",{style:{width:1,height:16,background:"var(--p-border)"}}),(0,me.jsxs)("button",{onClick:()=>g==null?void 0:g(Array.from(d)),style:{display:"inline-flex",alignItems:"center",gap:5,padding:"5px 12px",borderRadius:6,border:"1px solid var(--p-purple)",background:"var(--p-purple)",color:"#fff",fontSize:11,fontWeight:600,cursor:"pointer",transition:"background .12s"},onMouseEnter:T=>{T.currentTarget.style.background="#9333ea"},onMouseLeave:T=>{T.currentTarget.style.background="var(--p-purple)"},children:[(0,me.jsx)(Hr,{style:{width:10,height:10}}),"Run Agents (",J,")"]}),(0,me.jsxs)("button",{onClick:L,style:{display:"inline-flex",alignItems:"center",gap:5,padding:"5px 10px",borderRadius:6,border:"1px solid var(--p-border)",background:"transparent",color:"var(--p-text-m)",fontSize:11,cursor:"pointer",transition:"all .12s"},onMouseEnter:T=>{T.currentTarget.style.borderColor="var(--p-border-s)",T.currentTarget.style.color="var(--p-text)"},onMouseLeave:T=>{T.currentTarget.style.borderColor="var(--p-border)",T.currentTarget.style.color="var(--p-text-m)"},children:[(0,me.jsx)(Ge,{style:{width:10,height:10}}),"Clear"]})]}),(0,me.jsx)("div",{id:"kanban-scroll-track",style:{position:"fixed",bottom:0,left:0,right:0,height:6,background:"transparent",zIndex:40,pointerEvents:"none"},children:(0,me.jsx)("div",{id:"kanban-scroll-thumb",ref:N,style:{position:"absolute",top:1,height:4,borderRadius:2,background:"var(--p-border-t)",cursor:"pointer",pointerEvents:"auto",transition:"background 0.15s",opacity:0},onMouseEnter:T=>{T.currentTarget.style.background="var(--p-text-g)"},onMouseLeave:T=>{T.currentTarget.classList.contains("dragging")||(T.currentTarget.style.background="var(--p-border-t)")}})})]})}function Dv({col:e,tasks:t,isLoading:a,liveActivities:r,isDragOver:o,onDragOver:n,onDrop:l,onDragLeave:s,onStatusChange:i,onAddTask:d,onOpenTask:c,onDragStart:p,onCardDragOver:g,cardDropTarget:L,selectMode:x,selectedTaskIds:I,onToggleSelect:N,agentStatuses:m,experimentalAgents:u,multiDragIds:f}){let[v,C]=Vt.default.useState(!1),w=e.id==="in-progress"?"sd-inprogress":`sd-${e.id}`,y=20,k=e.id==="done",z=k&&t.length>y?t.length-y:0,U=k?t.slice(0,y):t;return(0,me.jsxs)("section",{className:"board-column","data-column-id":e.id,style:{outline:o?`2px dashed ${e.color}66`:void 0,outlineOffset:-2,borderRadius:8},onDragOver:n,onDragLeave:s,onDrop:l,children:[(0,me.jsxs)("div",{className:"column-header",style:{background:e.accent,borderColor:`color-mix(in srgb, ${e.color} 30%, transparent)`},children:[(0,me.jsx)("div",{className:`status-dot ${w}`}),(0,me.jsxs)("span",{style:{fontSize:12,fontWeight:600,color:e.id==="done"?`${e.color}b3`:e.color},children:[e.label,a?"":` \\xB7 ${t.length}`]}),(0,me.jsx)("span",{style:{marginLeft:"auto"}}),(0,me.jsx)("button",{type:"button",title:`Add task to ${e.label}`,style:{width:20,height:20,display:"flex",alignItems:"center",justifyContent:"center",borderRadius:4,border:"none",background:"transparent",color:v?e.color:"var(--p-text-g)",cursor:"pointer",transition:"color .15s",padding:0},onMouseEnter:()=>C(!0),onMouseLeave:()=>C(!1),onClick:d,children:(0,me.jsx)(Yn,{style:{width:14,height:14}})})]}),(0,me.jsx)("div",{className:"column-scroll","data-status":e.id,children:a?Array.from({length:Mv}).map((F,Z)=>(0,me.jsx)(Av,{},Z)):t.length===0?(0,me.jsxs)("div",{style:{border:"1px dashed var(--p-border-t)",borderRadius:8,padding:"10px 8px",fontSize:11,color:"var(--p-text-f)",textAlign:"center"},children:["No tasks in ",e.label.toLowerCase(),"."]}):(0,me.jsxs)(me.Fragment,{children:[U.map(F=>(0,me.jsxs)("div",{style:{position:"relative"},onDragOver:Z=>g(Z,F.id),children:[(L==null?void 0:L.taskId)===F.id&&L.position==="before"&&(0,me.jsx)("div",{style:{height:2,borderRadius:1,background:e.color,margin:"2px 0"}}),(0,me.jsx)(Dd,{task:F,col:e,liveActivity:r==null?void 0:r.get(F.id),onOpen:c,onDragStart:p,selectMode:x,selected:I==null?void 0:I.has(F.id),onToggleSelect:N,agentStatus:m==null?void 0:m.get(F.id),experimentalAgents:u,multiDragCount:f&&f.length>1&&f[0]===F.id?f.length:void 0}),(L==null?void 0:L.taskId)===F.id&&L.position==="after"&&(0,me.jsx)("div",{style:{height:2,borderRadius:1,background:e.color,margin:"2px 0"}})]},F.id)),z>0&&(0,me.jsxs)("div",{style:{margin:"4px 0 2px",padding:"6px 8px",borderRadius:6,border:"1px dashed var(--p-border-t)",fontSize:11,color:"var(--p-text-g)",textAlign:"center",lineHeight:1.4},children:["+",z," older ",z===1?"task":"tasks"," not shown"]})]})})]})}var Vr=E(De(),1);var ce=E(K(),1),og={backlog:{text:"var(--p-text-m)",bg:"color-mix(in srgb, var(--p-text-g) 14%, transparent)",border:"color-mix(in srgb, var(--p-text-g) 30%, transparent)"},todo:{text:"var(--p-amber-300)",bg:"color-mix(in srgb, var(--p-amber) 14%, transparent)",border:"color-mix(in srgb, var(--p-amber) 30%, transparent)"},"in-progress":{text:"var(--p-blue-200)",bg:"color-mix(in srgb, var(--p-blue) 14%, transparent)",border:"color-mix(in srgb, var(--p-blue) 30%, transparent)"},review:{text:"var(--p-purple-300)",bg:"color-mix(in srgb, var(--p-purple) 14%, transparent)",border:"color-mix(in srgb, var(--p-purple) 30%, transparent)"},done:{text:"var(--p-green-300)",bg:"color-mix(in srgb, var(--p-green) 12%, transparent)",border:"color-mix(in srgb, var(--p-green) 30%, transparent)"}},Ev=Ym,ng={Critical:"var(--p-red)",High:"var(--p-amber-300)",Medium:"var(--p-text-m)",Low:"var(--p-text-f)"},Bd=["in-progress","review","todo","backlog","done"];function Fv(){return(0,ce.jsxs)("div",{style:{display:"grid",gridTemplateColumns:"18px 1fr auto auto",alignItems:"center",gap:10,padding:"6px 10px",borderRadius:8,border:"1px solid var(--p-border-t)",background:"var(--p-bg-2)",animation:"skeleton-pulse 1.5s ease-in-out infinite"},children:[(0,ce.jsx)("div",{style:{width:14,height:14,borderRadius:3,background:"var(--p-border-s)"}}),(0,ce.jsx)("div",{style:{height:12,borderRadius:4,background:"var(--p-border-s)",width:"60%"}}),(0,ce.jsx)("div",{style:{height:18,borderRadius:10,background:"var(--p-border-s)",width:44}}),(0,ce.jsx)("div",{style:{height:18,borderRadius:10,background:"var(--p-border-s)",width:36}})]})}function Od({tasks:e,searchQuery:t,isLoading:a,liveActivities:r,onOpenPanel:o,onAddTask:n,onDrop:l,experimentalAgents:s}){let[i,d]=Vr.default.useState(null),[c,p]=Vr.default.useState(null),[g,L]=Vr.default.useState(null),[x,I]=Vr.default.useState({backlog:!1,todo:!1,"in-progress":!1,review:!1,done:!1}),N=t?e.filter(u=>(u.title??"").toLowerCase().includes(t.toLowerCase())||(u.description??"").toLowerCase().includes(t.toLowerCase())):e,m=Vr.default.useMemo(()=>{let u=new Map;for(let f of Bd)u.set(f,[]);for(let f of N)(u.get(f.status)??[]).push(f);return u},[N]);return(0,ce.jsxs)("div",{id:"kanban-list-view",style:{flex:1,overflowY:"auto",padding:"16px 24px",minHeight:0},children:[a?Bd.slice(0,3).map(u=>{let f=og[u];return(0,ce.jsxs)("div",{style:{marginBottom:24},children:[(0,ce.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:8,marginBottom:8},children:[(0,ce.jsx)("div",{style:{width:18,height:18,borderRadius:5,background:"var(--p-border-s)",animation:"skeleton-pulse 1.5s ease-in-out infinite"}}),(0,ce.jsx)("div",{style:{height:18,borderRadius:6,background:f.bg,border:`1px solid ${f.border}`,width:72,animation:"skeleton-pulse 1.5s ease-in-out infinite"}}),(0,ce.jsx)("div",{style:{height:14,borderRadius:4,background:"var(--p-border-s)",width:16,animation:"skeleton-pulse 1.5s ease-in-out infinite"}})]}),(0,ce.jsx)("div",{style:{display:"flex",flexDirection:"column",gap:2},children:Array.from({length:3}).map((v,C)=>(0,ce.jsx)(Fv,{},C))})]},u)}):Bd.map(u=>{let f=m.get(u)??[];if(f.length===0)return null;let v=og[u];return(0,ce.jsxs)("div",{style:{marginBottom:24},children:[(0,ce.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:8,marginBottom:8,padding:"4px 6px",borderRadius:6,transition:"background .1s",background:c===u?v.bg:"transparent",outline:c===u?`1px dashed ${v.border}`:void 0},onDragOver:C=>{C.preventDefault(),p(u)},onDragLeave:()=>p(null),onDrop:C=>{C.preventDefault(),p(null),L(null),i&&l(i,u),d(null)},children:[(0,ce.jsx)("button",{type:"button",title:x[u]?"Expand":"Collapse",onClick:C=>{C.stopPropagation(),I(w=>({...w,[u]:!w[u]}))},style:{width:18,height:18,borderRadius:5,border:"1px solid var(--p-border-t)",background:"var(--p-surface)",color:"var(--p-text-m)",fontSize:10,cursor:"pointer",display:"inline-flex",alignItems:"center",justifyContent:"center",flexShrink:0},children:x[u]?"+":"\\u2212"}),(0,ce.jsx)("span",{style:{fontSize:11,fontWeight:600,textTransform:"uppercase",letterSpacing:"0.05em",padding:"2px 8px",borderRadius:6,background:v.bg,border:`1px solid ${v.border}`,color:v.text},children:u}),(0,ce.jsx)("span",{style:{fontSize:11,color:"var(--p-text-g)"},children:f.length}),(0,ce.jsx)("button",{type:"button",title:`Add task to ${u}`,onClick:C=>{C.stopPropagation(),n(u)},style:{marginLeft:"auto",width:22,height:22,borderRadius:7,border:`1px solid ${v.border}`,background:v.bg,color:v.text,cursor:"pointer",display:"inline-flex",alignItems:"center",justifyContent:"center",fontSize:14,fontWeight:600},children:"+"})]}),(0,ce.jsx)("div",{style:{display:x[u]?"none":"flex",flexDirection:"column",gap:2},children:f.map(C=>(0,ce.jsx)(Bv,{task:C,liveActivity:r==null?void 0:r.get(C.id),onOpen:o,onDragStart:w=>d(w),dragOver:g===C.id,onDragOver:()=>L(C.id),onDragLeave:()=>L(w=>w===C.id?null:w),onDropToStatus:()=>{i&&l(i,C.status),d(null),L(null)},experimentalAgents:s},C.id))})]},u)}),!a&&N.length===0&&(0,ce.jsx)("div",{style:{textAlign:"center",color:"var(--p-text-g)",fontSize:13,marginTop:60},children:"No tasks found"})]})}function Bv({task:e,liveActivity:t,onOpen:a,onDragStart:r,dragOver:o,onDragOver:n,onDragLeave:l,onDropToStatus:s,experimentalAgents:i}){let[d,c]=Vr.default.useState(!1),p=Ev[e.type??"Task"]??"\\u2611",g=e.commentCount??0,L=e.fileCount??0;return(0,ce.jsxs)("div",{"data-task-id":e.id,"data-proto-id":"list-row",draggable:!0,style:{display:"grid",gridTemplateColumns:"18px 1fr auto auto auto",alignItems:"center",gap:10,padding:"6px 10px",borderRadius:8,background:o?"color-mix(in srgb, var(--p-blue) 10%, transparent)":d?"var(--p-hover)":"transparent",border:`1px solid ${o?"color-mix(in srgb, var(--p-blue) 40%, transparent)":d?"var(--p-border)":"transparent"}`,cursor:"grab",transition:"background .1s,border-color .1s",userSelect:"none"},onMouseEnter:()=>c(!0),onMouseLeave:()=>c(!1),onClick:()=>a(e),onDragStart:x=>{x.dataTransfer.effectAllowed="move",r(e.id),x.currentTarget.style.opacity="0.4"},onDragEnd:x=>{x.currentTarget.style.opacity="1"},onDragOver:x=>{x.preventDefault(),n()},onDragLeave:l,onDrop:x=>{x.preventDefault(),s()},children:[(0,ce.jsx)("span",{style:{fontSize:12,textAlign:"center",flexShrink:0},children:p}),(0,ce.jsxs)("div",{style:{minWidth:0},children:[(0,ce.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:6},children:[(0,ce.jsx)("span",{style:{fontSize:13,fontWeight:500,color:"var(--p-text)",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:e.title}),e.priority&&ng[e.priority]&&(0,ce.jsx)(Vn,{className:"w-2.5 h-2.5 flex-shrink-0",style:{color:ng[e.priority]}}),e.component&&(0,ce.jsx)("span",{style:{fontSize:10,padding:"1px 6px",borderRadius:10,background:"color-mix(in srgb, var(--p-purple) 14%, transparent)",border:"1px solid color-mix(in srgb, var(--p-purple) 30%, transparent)",color:"var(--p-purple-300)",flexShrink:0,fontFamily:"monospace"},children:e.component}),i===!0&&e.agent&&(0,ce.jsxs)("span",{style:{display:"inline-flex",alignItems:"center",gap:3,fontSize:10,fontWeight:600,padding:"1px 6px",borderRadius:6,background:"rgba(139,92,246,0.12)",color:"#a78bfa",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",maxWidth:90,flexShrink:0},title:`Agent: ${e.agent}`,children:[(0,ce.jsx)(mt,{style:{width:8,height:8,flexShrink:0}}),"Agent"]})]}),e.description&&(0,ce.jsx)("div",{style:{fontSize:11,color:"var(--p-text-g)",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",marginTop:1,maxWidth:"100%"},children:e.description.replace(/\\s+/g," ").trim()})]}),(0,ce.jsxs)("button",{title:g>0?`${g} comment(s)`:"Add comment",style:{display:"flex",alignItems:"center",gap:3,fontSize:11,color:g>0?"var(--p-text-m)":"var(--p-border-t)",background:"none",border:"none",cursor:"pointer",padding:"0 2px",flexShrink:0},onClick:x=>{x.stopPropagation(),a(e,"comments")},children:[(0,ce.jsx)(Nr,{className:"w-3 h-3"}),g>0&&(0,ce.jsx)("span",{children:g})]}),L>0&&(0,ce.jsxs)("button",{title:`${L} file(s)`,style:{display:"flex",alignItems:"center",gap:3,fontSize:11,color:"var(--p-blue-300)",background:"none",border:"none",cursor:"pointer",padding:"0 2px",flexShrink:0},onClick:x=>{x.stopPropagation(),a(e,"files")},children:[(0,ce.jsx)(Ur,{className:"w-3 h-3"}),(0,ce.jsx)("span",{children:L})]}),t&&(0,ce.jsx)(Ed,{activity:t})]})}var Ho=E(De(),1);var sr=E(K(),1);function lg({size:e=32,style:t,className:a}){return(0,sr.jsxs)("svg",{width:e,height:e,viewBox:"0 0 32 32",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:t,className:a,"aria-label":"Vibeflow",children:[(0,sr.jsx)("rect",{width:"32",height:"32",rx:"7",fill:"#2563eb"}),(0,sr.jsx)("rect",{x:"7",y:"13",width:"3.5",height:"10",rx:"1.5",fill:"white",opacity:"0.75"}),(0,sr.jsx)("rect",{x:"12.25",y:"8.5",width:"3.5",height:"15",rx:"1.5",fill:"white"}),(0,sr.jsx)("rect",{x:"17.5",y:"14.5",width:"3.5",height:"8",rx:"1.5",fill:"white",opacity:"0.75"}),(0,sr.jsx)("rect",{x:"22.5",y:"11",width:"2.5",height:"11",rx:"1.25",fill:"white",opacity:"0.85"})]})}var js=E(K(),1);function Uo({id:e,title:t,onClick:a,label:r,icon:o,variant:n="neutral"}){return(0,js.jsxs)("button",{id:e,onClick:a,title:t,className:`h-7 inline-flex items-center justify-center rounded-lg border transition-colors ${n==="accent"?"border-violet-700/50 bg-violet-900/30 text-violet-300 hover:bg-violet-800/30":"border-slate-700/60 bg-slate-800 text-slate-400 hover:bg-slate-700/50 hover:text-slate-200"} ${r?"gap-1.5 px-3 text-xs font-medium":"w-7"}`,type:"button",children:[o,r&&(0,js.jsx)("span",{children:r})]})}var j=E(K(),1);function zd({projectName:e,projectIcon:t,missingProjectIconStyle:a="initial",wsConnected:r,port:o,searchQuery:n,premiumUsage:l,isLoading:s,filterTags:i,allTags:d,onToggleTag:c,backHref:p,backLabel:g,onSearchChange:L,onSettings:x,extraActions:I,taskSummary:N,agentRuns:m,selectMode:u,onToggleSelectMode:f,agentQueueCount:v,onOpenAgentQueue:C,experimentalAgents:w}){let[y,k]=Ho.default.useState(!1),[z,U]=Ho.default.useState(0),F=Ho.default.useRef(null),Z=Ho.default.useRef(null),oe=n.match(/(?:^|\\s)#(\\S*)$/),fe=oe?oe[1]:null,Ce=i??[],ee=(d??[]).filter(A=>!Ce.includes(A)),Te=fe!==null?ee.filter(A=>A.toLowerCase().includes(fe.toLowerCase())):[];Ho.default.useEffect(()=>{U(0)},[Te.length]);function ue(A){var Le;let ge=n.replace(/\\s*#\\S*$/,"");L(ge),c==null||c(A),(Le=F.current)==null||Le.focus()}function J(A){if(A.key==="Backspace"&&n===""&&Ce.length>0){A.preventDefault(),c==null||c(Ce[Ce.length-1]);return}if(!(fe===null||Te.length===0)){if(A.key==="ArrowDown")A.preventDefault(),U(ge=>Math.min(ge+1,Te.length-1));else if(A.key==="ArrowUp")A.preventDefault(),U(ge=>Math.max(ge-1,0));else if(A.key==="Enter")A.preventDefault(),Te[z]&&ue(Te[z]);else if(A.key==="Escape"){let ge=n.replace(/\\s*#\\S*$/,"");L(ge)}}}let T=(t??"").trim(),V=e?e.charAt(0).toUpperCase()+e.slice(1):"Vibeflow Board",B=n||Ce.length>0;return(0,j.jsxs)("header",{className:"px-5 py-3 flex items-center gap-3 border-b border-slate-800/60 flex-shrink-0",children:[(0,j.jsxs)("div",{className:"flex items-center gap-3 flex-shrink-0",children:[p&&(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)("a",{id:"header-back-link",href:p,className:"text-xs text-slate-400 hover:text-slate-200 transition-colors no-underline",style:{textDecoration:"none",fontWeight:500},children:g??"Back"}),(0,j.jsx)(Wn,{className:"w-3 h-3 text-slate-600 flex-shrink-0"})]}),(0,j.jsx)("div",{className:"flex-shrink-0",style:T?{fontSize:20}:void 0,children:T||(a==="vibeflow"?(0,j.jsx)(lg,{size:32}):(0,j.jsx)("div",{style:{width:32,height:32,borderRadius:8,flexShrink:0,background:"linear-gradient(135deg, #1e3a5f 0%, #1e293b 100%)",border:"1px solid rgba(37,99,235,0.3)",display:"flex",alignItems:"center",justifyContent:"center",fontSize:13,fontWeight:700,color:"#93c5fd",letterSpacing:"-0.01em"},title:V,children:V.charAt(0).toUpperCase()}))}),(0,j.jsxs)("div",{children:[(0,j.jsxs)("div",{className:"flex items-center gap-2",children:[(0,j.jsx)("h1",{id:"header-project-name",className:"text-sm font-semibold text-white leading-tight",children:V}),r&&(0,j.jsxs)("div",{id:"header-live-pill",className:"flex items-center gap-1.5 rounded-full px-2 py-0.5",style:{background:"color-mix(in srgb, var(--p-green) 30%, transparent)",border:"1px solid color-mix(in srgb, var(--p-green) 28%, transparent)"},children:[(0,j.jsx)("div",{className:"w-1.5 h-1.5 rounded-full bg-green-400",style:{animation:"pulse-live 2s ease-in-out infinite"}}),(0,j.jsxs)("span",{className:"text-[10px] font-medium text-green-400",children:["live \\xB7 :",o]})]})]}),(0,j.jsxs)("p",{className:"text-[10px] text-slate-500 font-mono mt-0.5",children:[N,s&&(0,j.jsx)("span",{id:"header-loading-indicator",className:"inline-block ml-1.5 w-1 h-1 rounded-full bg-blue-400",style:{animation:"pulse-live 1.4s ease-in-out infinite",verticalAlign:"middle"}})]})]})]}),(0,j.jsx)("div",{className:"flex-1 flex justify-center px-4",children:(0,j.jsxs)("div",{className:"relative w-full max-w-sm",children:[(0,j.jsxs)("div",{className:"flex flex-wrap items-center gap-1 w-full min-h-[30px] rounded-lg bg-slate-800 border border-slate-700/60 px-2 py-1 cursor-text transition-colors focus-within:border-blue-500",onClick:()=>{var A;return(A=F.current)==null?void 0:A.focus()},children:[(0,j.jsx)(qr,{className:"w-3.5 h-3.5 text-slate-500 flex-shrink-0 mr-0.5"}),Ce.map(A=>{let{bg:ge,text:Le,border:Me}=oa(A);return(0,j.jsxs)("span",{style:{background:ge,color:Le,border:`1px solid ${Me}`,display:"inline-flex",alignItems:"center",gap:3,padding:"1px 7px",borderRadius:100,fontSize:11,fontWeight:500,whiteSpace:"nowrap"},children:[A,(0,j.jsx)("button",{onClick:rt=>{rt.stopPropagation(),c==null||c(A)},style:{background:"none",border:"none",cursor:"pointer",padding:0,lineHeight:1,color:"inherit",opacity:.7,display:"flex"},children:(0,j.jsx)(Ge,{style:{width:9,height:9}})})]},A)}),(0,j.jsx)("input",{ref:F,id:"global-search",type:"text",placeholder:Ce.length===0?"Search\\u2026 or type #tag":"#tag or search\\u2026",value:n,onChange:A=>L(A.target.value),onKeyDown:J,className:"flex-1 min-w-[100px] bg-transparent border-none outline-none text-xs text-slate-200 placeholder-slate-500",autoComplete:"off",spellCheck:!1}),B&&(0,j.jsx)("button",{id:"global-search-clear",onClick:()=>{L(""),Ce.forEach(A=>c==null?void 0:c(A))},className:"text-slate-500 hover:text-slate-300 transition-colors flex-shrink-0 flex",title:"Clear search and tag filters",children:(0,j.jsx)(Ge,{className:"w-3.5 h-3.5"})})]}),fe!==null&&Te.length>0&&(0,j.jsxs)("div",{ref:Z,style:{position:"absolute",top:"calc(100% + 4px)",left:0,right:0,background:"var(--p-card)",border:"1px solid var(--p-border-s)",borderRadius:8,boxShadow:"0 8px 24px rgba(0,0,0,0.3)",zIndex:50,overflow:"hidden"},children:[(0,j.jsx)("div",{style:{padding:"5px 10px",fontSize:10,textTransform:"uppercase",letterSpacing:"0.06em",color:"var(--p-text-g)",borderBottom:"1px solid var(--p-border)"},children:"Tags"}),Te.map((A,ge)=>{let{bg:Le,text:Me,border:rt}=oa(A);return(0,j.jsxs)("button",{onMouseDown:ve=>{ve.preventDefault(),ue(A)},onMouseEnter:()=>U(ge),style:{width:"100%",textAlign:"left",display:"flex",alignItems:"center",gap:8,padding:"7px 12px",background:ge===z?"var(--p-hover)":"none",border:"none",cursor:"pointer"},children:[(0,j.jsx)("span",{style:{width:8,height:8,borderRadius:"50%",background:Me,flexShrink:0}}),(0,j.jsx)("span",{style:{fontSize:12,color:"var(--p-text-m)"},children:A}),(0,j.jsx)("span",{style:{marginLeft:"auto",display:"inline-flex",alignItems:"center",padding:"1px 7px",borderRadius:100,fontSize:10,background:Le,color:Me,border:`1px solid ${rt}`},children:"tag"})]},A)}),(0,j.jsx)("div",{style:{padding:"5px 10px",fontSize:10,color:"var(--p-text-g)",borderTop:"1px solid var(--p-border)"},children:"\\u2191\\u2193 navigate \\xB7 Enter select \\xB7 Esc close"})]})]})}),(0,j.jsxs)("div",{className:"flex items-center gap-2 flex-shrink-0",children:[I,w===!0&&m&&m.length>0&&(0,j.jsxs)("span",{style:{display:"inline-flex",alignItems:"center",gap:4,padding:"2px 8px",borderRadius:999,fontSize:10,fontWeight:600,border:"1px solid color-mix(in srgb, var(--p-blue) 40%, transparent)",background:"color-mix(in srgb, var(--p-blue) 10%, transparent)",color:"var(--p-blue-300)",flexShrink:0},title:`${m.filter(A=>A.status==="running").length} running \\xB7 ${m.filter(A=>A.status==="queued").length} queued`,children:[(0,j.jsx)("span",{className:"spinner",style:{width:9,height:9,borderWidth:1.5}}),m.filter(A=>A.status==="running").length," running",m.filter(A=>A.status==="queued").length>0&&(0,j.jsxs)(j.Fragment,{children:[" \\xB7 ",m.filter(A=>A.status==="queued").length," queued"]})]}),w===!0&&C&&v!==void 0&&v>0&&(0,j.jsx)(Uo,{id:"btn-agent-queue",title:"Agent Queue",onClick:C,label:`\\u{1F916} Queue ${v}`,icon:(0,j.jsx)(mt,{className:"w-3.5 h-3.5"})}),f&&(0,j.jsx)(Uo,{id:"btn-select-tasks",title:u?"Exit selection mode":"Select multiple tasks",onClick:f,label:u?"\\u2715 Done":"\\u2611 Select",icon:(0,j.jsx)(or,{className:"w-3.5 h-3.5"})}),(0,j.jsx)(Uo,{id:"header-shortcuts-hint",title:"Click to see keyboard shortcuts",onClick:()=>k(!0),label:"? shortcuts"}),(0,j.jsx)(Uo,{id:"btn-settings",title:"Settings",onClick:x,icon:(0,j.jsx)(_r,{className:"w-3.5 h-3.5"})})]}),y&&(0,j.jsx)("div",{style:{position:"fixed",inset:0,background:"rgba(2,12,27,0.80)",backdropFilter:"blur(8px)",WebkitBackdropFilter:"blur(8px)",zIndex:200,display:"flex",alignItems:"center",justifyContent:"center"},onClick:()=>k(!1),children:(0,j.jsxs)("div",{id:"shortcuts-modal",style:{background:"var(--p-card)",border:"1px solid var(--p-border-s)",borderRadius:14,padding:"20px 24px",minWidth:320,maxWidth:420,boxShadow:"var(--p-shadow-lg)"},onClick:A=>A.stopPropagation(),children:[(0,j.jsxs)("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",marginBottom:16},children:[(0,j.jsx)("span",{style:{fontSize:13,fontWeight:700,color:"var(--p-text)"},children:"Keyboard Shortcuts"}),(0,j.jsx)("button",{onClick:()=>k(!1),style:{background:"none",border:"none",cursor:"pointer",color:"var(--p-text-f)",padding:2},children:(0,j.jsx)(Ge,{style:{width:14,height:14}})})]}),(0,j.jsx)("div",{style:{display:"flex",flexDirection:"column",gap:8},children:[["Alt+N","Open new task panel"],["Esc","Close panel / modal"],["?","Show this shortcuts overlay"],["Alt+F","Focus task search"]].map(([A,ge])=>(0,j.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:12},children:[(0,j.jsx)("kbd",{style:{fontSize:10,fontFamily:"monospace",background:"var(--p-surface)",border:"1px solid var(--p-border-t)",borderRadius:4,padding:"2px 7px",color:"var(--p-text-sub)",flexShrink:0},children:A}),(0,j.jsx)("span",{style:{fontSize:12,color:"var(--p-text-m)"},children:ge})]},A))})]})})]})}var te=E(De(),1);var Xs=E(De(),1);var ma=E(K(),1);function Qs({id:e,value:t,onChange:a,disabled:r}){let[o,n]=Xs.default.useState(!1),l=Xs.default.useRef(null),s=$r.find(i=>i.value===t)??$r[0];return Xs.default.useEffect(()=>{let i=d=>{var c;(c=l.current)!=null&&c.contains(d.target)||n(!1)};return document.addEventListener("click",i),()=>document.removeEventListener("click",i)},[]),(0,ma.jsxs)("div",{id:e,ref:l,style:{position:"relative",display:"inline-block"},children:[(0,ma.jsxs)("button",{type:"button",title:s==null?void 0:s.tooltip,onClick:i=>{i.preventDefault(),r||n(d=>!d)},style:{display:"inline-flex",alignItems:"center",gap:5,padding:"3px 8px",borderRadius:6,border:"1px solid var(--p-border, rgba(255,255,255,0.08))",background:"var(--p-hover, rgba(255,255,255,0.05))",color:"var(--p-text-m, rgba(255,255,255,0.7))",fontSize:12,cursor:"pointer",whiteSpace:"nowrap"},children:[(0,ma.jsx)("span",{style:{fontSize:13},children:s==null?void 0:s.icon}),(0,ma.jsx)("span",{children:s==null?void 0:s.label})]}),o&&(0,ma.jsx)("div",{style:{position:"absolute",top:"100%",left:0,marginTop:4,background:"var(--p-card, #1e293b)",border:"1px solid var(--p-border-s, rgba(255,255,255,0.12))",borderRadius:8,padding:"4px 0",zIndex:200,minWidth:140,boxShadow:"0 8px 24px rgba(0,0,0,0.4)"},children:$r.map(i=>(0,ma.jsxs)("button",{type:"button",title:i.tooltip,onClick:()=>{a(i.value),n(!1)},style:{display:"flex",alignItems:"center",gap:8,width:"100%",padding:"6px 12px",border:"none",background:i.value===t?"var(--p-hover, rgba(255,255,255,0.06))":"transparent",color:i.value===t?"var(--p-text, #fff)":"var(--p-text-f, rgba(255,255,255,0.55))",fontSize:12,cursor:"pointer",textAlign:"left"},children:[(0,ma.jsx)("span",{style:{fontSize:14,lineHeight:1},children:i.icon}),(0,ma.jsx)("span",{children:i.label})]},i.value))})]})}var St=E(De(),1);var ol=E(De(),1);var ir=E(K(),1);function ur({markdown:e,className:t,style:a}){let r=ol.default.useRef(null),o=ol.default.useRef({}),[n,l]=ol.default.useState(null);return ol.default.useEffect(()=>{let s=r.current;if(!s)return;function i(){l(null)}async function d(p){let g=p.target,L=g==null?void 0:g.closest("a[data-task-ref]");if(!L){i();return}p.preventDefault();let x=L.getAttribute("data-task-ref");if(!x)return;let I=L.getBoundingClientRect(),N=o.current[x];if(N){l({id:x,title:N.title,status:N.status,x:I.left,y:I.bottom+6});return}try{let u=await(await fetch(`/api/tasks/${x}`)).json(),f={title:u.title??`Task ${x}`,status:u.status??"unknown"};o.current[x]=f,l({id:x,title:f.title,status:f.status,x:I.left,y:I.bottom+6})}catch{l({id:x,title:`Task ${x}`,status:"unknown",x:I.left,y:I.bottom+6})}}function c(p){var x,I;let g=(I=(x=p.target)==null?void 0:x.closest)==null?void 0:I.call(x,"a[data-task-ref]");if(!g)return;let L=g.getAttribute("data-task-ref");L&&window.dispatchEvent(new CustomEvent("vibeflow-task-ref-click",{detail:{refId:L}}))}return s.addEventListener("mouseover",d),s.addEventListener("mouseleave",i),s.addEventListener("click",c),()=>{s.removeEventListener("mouseover",d),s.removeEventListener("mouseleave",i),s.removeEventListener("click",c)}},[]),(0,ir.jsxs)("div",{style:{position:"relative"},children:[(0,ir.jsx)("div",{ref:r,className:t,style:a,dangerouslySetInnerHTML:{__html:qs(e)}}),n&&(0,ir.jsxs)("div",{style:{position:"fixed",left:n.x,top:n.y,background:"#0f172a",border:"1px solid rgba(59,130,246,0.4)",color:"#e2e8f0",borderRadius:8,padding:"8px 10px",fontSize:11,boxShadow:"0 10px 24px rgba(2,6,23,0.55)",zIndex:60,pointerEvents:"none",minWidth:180},children:[(0,ir.jsxs)("div",{style:{color:"#60a5fa",fontFamily:"Menlo,monospace",marginBottom:3},children:["#",n.id]}),(0,ir.jsx)("div",{style:{fontWeight:600,marginBottom:3},children:n.title}),(0,ir.jsxs)("div",{style:{color:"#94a3b8"},children:["status: ",n.status]})]})]})}var nl=E(De(),1),sg=E(K(),1),qo=nl.default.forwardRef(function({value:t,onChange:a,baseRows:r=4,maxRows:o,style:n,...l},s){let i=nl.default.useRef(null),d=o??r*2,c=nl.default.useCallback(()=>{let p=i.current;if(!p)return;p.style.height="auto";let g=window.getComputedStyle(p),L=Number.parseFloat(g.lineHeight||"0")||18,x=Number.parseFloat(g.paddingTop||"0")+Number.parseFloat(g.paddingBottom||"0"),I=Number.parseFloat(g.borderTopWidth||"0")+Number.parseFloat(g.borderBottomWidth||"0"),N=r*L+x+I,m=d*L+x+I,u=Math.max(N,Math.min(p.scrollHeight,m));p.style.height=`${u}px`,p.style.overflowY=p.scrollHeight>m?"auto":"hidden"},[r,d]);return nl.default.useLayoutEffect(()=>{c()},[t,c]),(0,sg.jsx)("textarea",{...l,ref:p=>{i.current=p,typeof s=="function"?s(p):s&&(s.current=p)},rows:r,value:t,onChange:p=>a(p.target.value),style:{...n,resize:"none"}})});var dg=E(De(),1);var ig=E(De(),1),ug=E(Br(),1),Aa=E(K(),1);function Gr({open:e,onClose:t,icon:a,title:r,headerActions:o,width:n,maxHeight:l,id:s,children:i,footer:d,boxStyle:c,onKeyDown:p}){if(ig.default.useEffect(()=>{if(!e)return;function x(I){I.key==="Escape"&&t(),p==null||p(I)}return window.addEventListener("keydown",x),()=>window.removeEventListener("keydown",x)},[e,t,p]),!e)return null;let g=!!(a||r||o),L=(0,Aa.jsx)("div",{id:s,className:"modal-backdrop",onClick:x=>{x.target===x.currentTarget&&t()},onMouseDown:x=>x.stopPropagation(),children:(0,Aa.jsxs)("div",{className:"modal-box",style:{width:n??"min(420px, 95vw)",maxHeight:l,...c},children:[g&&(0,Aa.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:10,padding:"14px 18px",borderBottom:"1px solid var(--p-border)",flexShrink:0},children:[a&&(0,Aa.jsx)("span",{style:{flexShrink:0,display:"flex",alignItems:"center"},children:a}),r&&(0,Aa.jsx)("span",{style:{fontSize:14,fontWeight:600,color:"var(--p-text)",flex:1,minWidth:0},children:r}),o&&(0,Aa.jsx)("div",{style:{display:"flex",alignItems:"center",gap:4,flexShrink:0,marginLeft:"auto"},children:o})]}),i,d&&(0,Aa.jsx)("div",{style:{display:"flex",alignItems:"center",justifyContent:"flex-end",gap:8,padding:"10px 18px",borderTop:"1px solid var(--p-border)",flexShrink:0},children:d})]})});return(0,ug.createPortal)(L,document.body)}var Gt=E(K(),1);function ga({open:e,message:t,title:a="Confirm",confirmLabel:r="Delete",cancelLabel:o="Cancel",loading:n,error:l,onConfirm:s,onCancel:i}){let d=dg.default.useCallback(c=>{c.key==="Enter"&&s()},[s]);return(0,Gt.jsx)(Gr,{open:e,onClose:i,id:"confirm-modal",width:"min(380px, 95vw)",icon:(0,Gt.jsx)(nr,{style:{width:20,height:20,color:"#f87171"}}),title:a,onKeyDown:d,footer:(0,Gt.jsxs)(Gt.Fragment,{children:[(0,Gt.jsx)("button",{id:"confirm-modal-cancel",onClick:i,disabled:n,style:{padding:"7px 16px",borderRadius:8,background:"var(--p-hover)",border:"1px solid var(--p-border)",color:"var(--p-text-m)",fontSize:13,cursor:"pointer",transition:"background 0.15s"},children:o}),(0,Gt.jsx)("button",{id:"confirm-modal-confirm",onClick:s,disabled:n,style:{padding:"7px 16px",borderRadius:8,background:"#dc2626",border:"none",color:"#fff",fontSize:13,fontWeight:600,cursor:n?"wait":"pointer",opacity:n?.6:1,transition:"background 0.15s"},children:n?"Deleting\\u2026":r})]}),children:(0,Gt.jsxs)("div",{style:{padding:"16px 18px"},children:[typeof t=="string"?(0,Gt.jsx)("p",{style:{margin:0,fontSize:13,color:"var(--p-text-f)",lineHeight:1.6},children:t}):t,l&&(0,Gt.jsx)("p",{style:{margin:"8px 0 0",fontSize:12,color:"var(--p-red)"},children:l})]})})}var Ye=E(K(),1);function fg(e){return e.linkedPath?"\\u{1F517}":/\\.(png|jpe?g|gif|webp|svg)$/i.test(e.name)?"\\u{1F5BC}\\uFE0F":/\\.html?$/i.test(e.name)?"\\u{1F310}":/\\.md$/i.test(e.name)||/\\.pdf$/i.test(e.name)?"\\u{1F4C4}":"\\u{1F4CE}"}function Ov(e){return/\\.(png|jpe?g|gif|webp|svg|html?)$/i.test(e.name)}function zv(e){return/\\.html?$/i.test(e.name)}function Ys({file:e,url:t,variant:a,onPreview:r,onDelete:o}){let n=Ov(e),l=zv(e);function s(){r?r(e,t):window.open(t,"_blank")}return a==="compact"?(0,Ye.jsxs)("div",{className:"group/file-compact",style:{display:"flex",alignItems:"center",gap:8,padding:"4px 8px",borderRadius:8,background:"var(--p-card)",border:"1px solid var(--p-border)",position:"relative"},children:[(0,Ye.jsx)("span",{style:{fontSize:14,flexShrink:0},children:fg(e)}),(0,Ye.jsx)("div",{style:{flex:1,minWidth:0},children:(0,Ye.jsx)("button",{onClick:s,style:{fontSize:12,color:"var(--p-blue-300)",background:"none",border:"none",cursor:"pointer",padding:0,textAlign:"left",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",maxWidth:"100%"},title:e.name,children:e.name})}),(0,Ye.jsx)("span",{className:"file-compact-ts",style:{fontSize:10,color:"var(--p-border-t)",flexShrink:0,marginLeft:2},children:e.createdAt?Pt(e.createdAt):"attached"}),(0,Ye.jsxs)("div",{className:"file-compact-actions",style:{position:"absolute",right:6,top:0,bottom:0,display:"flex",alignItems:"center",gap:4,transition:"opacity 0.15s",background:"var(--p-card)",paddingLeft:8},children:[n&&(0,Ye.jsx)("button",{onClick:s,style:{background:"none",border:"none",cursor:"pointer",padding:"2px 4px",borderRadius:4,fontSize:11,color:"var(--p-text-m)"},title:l?"Open in new tab":"Preview",children:l?"\\u2197":"\\u{1F441}"}),(0,Ye.jsx)("a",{href:t,download:e.name,style:{background:"none",border:"none",cursor:"pointer",padding:"2px 4px",borderRadius:4,fontSize:11,color:"var(--p-text-m)",textDecoration:"none"},title:"Download",onClick:i=>i.stopPropagation(),children:"\\u2193"}),o&&(0,Ye.jsx)("button",{onClick:()=>void o(e),style:{background:"none",border:"none",cursor:"pointer",padding:"2px 4px",borderRadius:4,fontSize:11,color:"var(--p-text-m)"},title:"Delete",children:"\\u2715"})]})]}):(0,Ye.jsxs)("div",{className:"group/file",style:{display:"flex",alignItems:"center",gap:10,padding:8,borderRadius:8,border:"1px solid var(--p-border)",transition:"background 0.15s",position:"relative"},children:[(0,Ye.jsx)("span",{style:{fontSize:18,flexShrink:0},children:fg(e)}),(0,Ye.jsxs)("div",{style:{flex:1,minWidth:0},children:[(0,Ye.jsx)("p",{style:{fontSize:12,fontWeight:500,color:"var(--p-text)",margin:0,cursor:"pointer",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},title:e.name,onClick:s,children:e.name}),(0,Ye.jsx)("p",{style:{fontSize:10,color:"var(--p-text-f)",margin:0},children:e.linkedPath?`linked: ${e.linkedPath}`:Rd(e.size??0)})]}),(0,Ye.jsxs)("div",{className:"file-normal-actions",style:{display:"flex",alignItems:"center",gap:4,transition:"opacity 0.15s"},children:[n&&(0,Ye.jsx)("button",{onClick:s,style:{background:"none",border:"none",cursor:"pointer",padding:"4px",borderRadius:4,fontSize:11,color:"var(--p-text-m)"},title:l?"Open in new tab":"Preview",children:l?"\\u2197":"\\u{1F441}"}),(0,Ye.jsx)("a",{href:t,download:e.name,style:{background:"none",border:"none",cursor:"pointer",padding:"4px",borderRadius:4,fontSize:11,color:"var(--p-text-m)",textDecoration:"none"},title:"Download",onClick:i=>i.stopPropagation(),children:"\\u2193"}),o&&(0,Ye.jsx)("button",{onClick:()=>void o(e),style:{background:"none",border:"none",cursor:"pointer",padding:"4px",borderRadius:4,fontSize:11,color:"var(--p-text-m)"},title:"Delete",children:"\\u2715"})]})]})}var q=E(K(),1);function cg({source:e}){return e!=="cli"?null:(0,q.jsx)("span",{title:"Via CLI (agent)",style:{fontSize:9,color:"var(--p-green-300)",background:"rgba(34,197,94,0.1)",border:"1px solid rgba(34,197,94,0.2)",borderRadius:4,padding:"0 4px",fontFamily:"monospace",lineHeight:"16px",flexShrink:0},children:">_"})}function Nv(e,t){if(e.kind==="lifecycle")return e.author??null;if(e.kind==="comment"){let a=e.comment;return a.type==="system"?null:a.author==="agent"?"\\u{1F916} Agent":a.authorName??t}return e.kind==="change"?e.actor:null}function Uv(e,t){let a=[];for(let r of e){let o=Nv(r,t),n=a[a.length-1];o&&n&&n.author===o?(n.items.push(r),r.sortKey>n.newestSortKey&&(n.newestSortKey=r.sortKey),r.sortKey<n.oldestSortKey&&(n.oldestSortKey=r.sortKey)):a.push({author:o,newestSortKey:r.sortKey,oldestSortKey:r.sortKey,items:[r]})}return a}function Nd({comments:e,files:t=[],localChanges:a=[],loading:r,error:o,gitUserName:n="You",taskAuthorName:l,baseUrl:s="",taskId:i,taskCreatedAt:d,taskUpdatedAt:c,onEdit:p,onDelete:g,onDeleteFile:L,onFilePreview:x}){let I=St.default.useRef(null),N=St.default.useRef(null),[m,u]=St.default.useState(null),[f,v]=St.default.useState(""),[C,w]=St.default.useState(null),[y,k]=St.default.useState(null),[z,U]=St.default.useState(()=>{try{return localStorage.getItem("vibeflow-show-updates")!=="false"}catch{return!0}}),F=St.default.useRef(r),Z=St.default.useMemo(()=>{let ee=[];d&&ee.push({kind:"lifecycle",sortKey:d,label:"Task created",icon:"\\u2726",author:l??n}),c&&c!==d&&ee.push({kind:"lifecycle",sortKey:c,label:"Task edited",icon:"\\u270E"});let Te=e.map(T=>({kind:"comment",sortKey:T.createdAt,comment:T})),ue=t.map(T=>{let V=T.url.startsWith("http")?T.url:`${s}${T.url}`;return{kind:"file",sortKey:T.createdAt??"9999",file:T,url:V}}),J=a.map(T=>({kind:"change",sortKey:T.timestamp,field:T.field,from:T.from,to:T.to,actor:T.actor,source:T.source}));return[...ee,...Te,...ue,...J].sort((T,V)=>V.sortKey.localeCompare(T.sortKey))},[e,t,a,s,d,c]),oe=St.default.useMemo(()=>Z.filter(ee=>ee.kind==="lifecycle"||ee.kind==="change").length,[Z]),fe=St.default.useMemo(()=>z?Z:Z.filter(ee=>ee.kind==="comment"||ee.kind==="file"),[Z,z]),Ce=St.default.useMemo(()=>Uv(fe,n),[fe,n]);return St.default.useEffect(()=>{let ee=F.current&&!r;F.current=r,I.current&&ee&&requestAnimationFrame(()=>{I.current&&(I.current.scrollTop=0)})},[r]),St.default.useEffect(()=>{m&&N.current&&(N.current.focus(),N.current.scrollIntoView({block:"nearest"}))},[m]),r?(0,q.jsx)("p",{style:{color:"var(--p-text-g)",fontSize:12,textAlign:"center",padding:"16px 0"},children:"Loading\\u2026"}):o?(0,q.jsx)("p",{style:{color:"var(--p-red-500)",fontSize:12,textAlign:"center",padding:"8px 0"},children:"Failed to load."}):Z.length===0?(0,q.jsx)("p",{style:{color:"var(--p-text-g)",fontSize:12,textAlign:"center",padding:"16px 0"},children:"No activity yet."}):(0,q.jsxs)("div",{style:{flex:1,display:"flex",flexDirection:"column",minHeight:0},children:[oe>0&&(0,q.jsxs)("div",{style:{display:"flex",alignItems:"center",padding:"4px 0 4px",flexShrink:0,borderBottom:"1px solid var(--p-border)",marginBottom:4},children:[(0,q.jsx)("span",{style:{fontSize:9,color:"var(--p-text-g)",flex:1,letterSpacing:"0.04em"},children:z?"":`${oe} system event${oe!==1?"s":""} hidden`}),(0,q.jsx)("button",{id:"dp-toggle-updates",onClick:()=>U(ee=>{let Te=!ee;try{localStorage.setItem("vibeflow-show-updates",String(Te))}catch{}return Te}),style:{all:"unset",cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center",width:22,height:22,borderRadius:5,color:z?"var(--p-text-m)":"var(--p-text-g)",transition:"color .12s, background .12s"},title:z?"Hide system events":`Show ${oe} system event${oe!==1?"s":""}`,onMouseEnter:ee=>{ee.currentTarget.style.color="var(--p-text)",ee.currentTarget.style.background="var(--p-hover)"},onMouseLeave:ee=>{ee.currentTarget.style.color=z?"var(--p-text-m)":"var(--p-text-g)",ee.currentTarget.style.background="transparent"},children:z?(0,q.jsxs)("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,q.jsx)("path",{d:"M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z"}),(0,q.jsx)("circle",{cx:"12",cy:"12",r:"3"})]}):(0,q.jsxs)("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,q.jsx)("path",{d:"M17.94 17.94A10.07 10.07 0 0 1 12 20c-7 0-11-8-11-8a18.45 18.45 0 0 1 5.06-5.94M9.9 4.24A9.12 9.12 0 0 1 12 4c7 0 11 8 11 8a18.5 18.5 0 0 1-2.16 3.19m-6.72-1.07a3 3 0 1 1-4.24-4.24"}),(0,q.jsx)("line",{x1:"1",y1:"1",x2:"23",y2:"23"})]})})]}),(0,q.jsx)("div",{ref:I,style:{flex:1,overflowY:"auto",display:"flex",flexDirection:"column",gap:2,minHeight:0},children:Ce.map((ee,Te)=>{let ue=ee.author!==null&&ee.items.length>1,J=ue,T=ee.author==="\\u{1F916} Agent";return(0,q.jsxs)("div",{style:{display:"flex",flexDirection:"column",gap:0},children:[J&&(0,q.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:6,padding:"6px 0 2px",marginTop:4},children:[(0,q.jsx)("span",{style:{fontSize:11,fontWeight:600,color:T?"var(--p-purple)":"var(--p-blue-300)",flexShrink:0},children:ee.author}),(0,q.jsx)("span",{style:{fontSize:10,color:"var(--p-text-g)",flexShrink:0},children:`${Pt(ee.oldestSortKey)} \\u2013 ${Pt(ee.newestSortKey)}`}),(0,q.jsxs)("span",{style:{fontSize:10,color:"var(--p-border-t)",flexShrink:0,marginLeft:2},children:["(",ee.items.length," activities)"]})]}),(0,q.jsx)("div",{style:{display:"flex",flexDirection:"column",gap:ue?4:8,paddingLeft:ue?8:0,borderLeft:ue?"1.5px solid var(--p-border)":"none",marginLeft:ue?4:0},children:ee.items.map((V,B)=>Hv(V,B,Te,ue,n,m,f,N,u,v,p,w,L?k:null,x))})]},`group-${Te}`)})}),(0,q.jsx)(ga,{open:C!==null,message:"Delete this comment? This action cannot be undone.",onConfirm:()=>{C&&g(C),w(null)},onCancel:()=>w(null)}),L&&(0,q.jsx)(ga,{open:y!==null,message:y?`Delete "${y.name}"? This action cannot be undone.`:"",onConfirm:()=>{y&&L(y),k(null)},onCancel:()=>k(null)})]})}function Hv(e,t,a,r,o,n,l,s,i,d,c,p,g,L){if(e.kind==="lifecycle")return(0,q.jsxs)("div",{style:{display:"flex",alignItems:"flex-start",gap:6,padding:"2px 0"},children:[(0,q.jsx)("span",{style:{fontSize:11,color:"var(--p-purple)",fontWeight:600,flexShrink:0,minWidth:18,paddingTop:1},children:e.icon}),(0,q.jsx)("div",{style:{flex:1,minWidth:0},children:(0,q.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:6,flexWrap:"wrap"},children:[(0,q.jsx)("span",{style:{fontSize:11,color:"var(--p-text-m)",fontStyle:"italic"},children:e.label}),!r&&(0,q.jsx)("span",{style:{fontSize:10,color:"var(--p-text-g)",marginLeft:"auto",flexShrink:0},children:Pt(e.sortKey)})]})})]},`lifecycle-${e.sortKey}-${a}-${t}`);if(e.kind==="change"){let C=e.from.length>28?e.from.slice(0,28)+"\\u2026":e.from,w=e.to.length>28?e.to.slice(0,28)+"\\u2026":e.to,y=e.from.length>28||e.to.length>28;return(0,q.jsxs)("div",{style:{display:"flex",alignItems:"flex-start",gap:6,padding:"2px 0"},children:[(0,q.jsx)("span",{style:{fontSize:11,color:"var(--p-blue)",fontWeight:600,flexShrink:0,minWidth:18,paddingTop:1},children:"\\u270E"}),(0,q.jsxs)("div",{style:{flex:1,minWidth:0},children:[(0,q.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:6,flexWrap:"wrap"},children:[!r&&(0,q.jsxs)("span",{style:{fontSize:11,fontWeight:600,color:"var(--p-blue-300)"},children:["\\u{1F464} ",e.actor]}),!r&&(0,q.jsx)(cg,{source:e.source}),(0,q.jsxs)("span",{style:{fontSize:11,color:"var(--p-text-m)"},children:["changed ",(0,q.jsx)("strong",{style:{color:"var(--p-text)"},children:e.field})]}),!r&&(0,q.jsx)("span",{style:{fontSize:10,color:"var(--p-text-g)",marginLeft:"auto",flexShrink:0},children:Pt(e.sortKey)})]}),(0,q.jsxs)("div",{title:y?`${e.from} \\u2192 ${e.to}`:void 0,style:{marginTop:2,fontSize:11,color:"var(--p-text-g)",display:"flex",alignItems:"center",gap:4,cursor:y?"help":"default"},children:[(0,q.jsx)("span",{style:{color:"var(--p-red)",background:"rgba(239,68,68,0.1)",borderRadius:4,padding:"1px 5px",maxWidth:120,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:C}),(0,q.jsx)("span",{style:{color:"var(--p-text-g)"},children:"\\u2192"}),(0,q.jsx)("span",{style:{color:"var(--p-green)",background:"rgba(34,197,94,0.1)",borderRadius:4,padding:"1px 5px",maxWidth:120,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:w})]})]})]},`change-${e.sortKey}-${a}-${t}`)}if(e.kind==="file"){let{file:v,url:C}=e;return(0,q.jsx)(Ys,{file:v,url:C,variant:"compact",onPreview:L?(w,y)=>L(w.name,y):void 0,onDelete:g?w=>(g(w),Promise.resolve()):void 0},`file-${v.name}-${a}-${t}`)}let x=e.comment,I=x.author==="agent",N=x.type==="system",m=x.deleted===!0,u=!!x.id&&!I&&!N&&!m&&x.isOwnComment!==!1,f=n===x.id;return N?(0,q.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:6,padding:"2px 0",fontSize:11,color:"var(--p-text-g)",fontStyle:"italic"},children:[(0,q.jsx)("span",{style:{opacity:.6},children:"\\u2B21"}),(0,q.jsx)("span",{children:x.text}),!r&&(0,q.jsx)("span",{style:{marginLeft:"auto",flexShrink:0,opacity:.6},children:Pt(x.createdAt)})]},x.id):(0,q.jsxs)("div",{className:"flex flex-col gap-1 group/comment",style:{paddingTop:r?2:4},children:[!r&&(0,q.jsxs)("div",{className:"flex items-center justify-between gap-1.5 text-xs mb-0.5",children:[(0,q.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,q.jsx)("span",{style:{color:m?"var(--p-text-g)":I?"var(--p-purple)":"var(--p-blue-300)"},children:I?"\\u{1F916} Agent":`\\u{1F464} ${x.authorName??o}`}),(0,q.jsx)(cg,{source:x.source}),(0,q.jsxs)("span",{style:{color:"var(--p-text-g)"},children:[Pt(x.createdAt),!m&&x.updatedAt?" \\xB7 edited":"",m?" \\xB7 deleted":""]})]}),u&&(0,q.jsxs)("div",{className:"flex items-center gap-1 opacity-0 group-hover/comment:opacity-100 transition-opacity",children:[(0,q.jsx)("button",{onClick:()=>{i(x.id),d(x.text)},className:"p-1 rounded hover:bg-slate-700 transition-colors",title:"Edit",children:(0,q.jsx)("span",{style:{fontSize:11,color:"var(--p-text-m)"},children:"\\u270E"})}),(0,q.jsx)("button",{onClick:()=>p(x),className:"p-1 rounded hover:bg-red-900/40 transition-colors",title:"Delete",children:(0,q.jsx)("span",{style:{fontSize:11,color:"var(--p-text-m)"},children:"\\u2715"})})]})]}),r&&(0,q.jsxs)("div",{className:"flex items-center justify-between gap-1.5",style:{marginBottom:2},children:[(0,q.jsxs)("span",{style:{fontSize:10,color:"var(--p-text-g)"},children:[Pt(x.createdAt),!m&&x.updatedAt?" \\xB7 edited":"",m?" \\xB7 deleted":""]}),u&&(0,q.jsxs)("div",{className:"flex items-center gap-1 opacity-0 group-hover/comment:opacity-100 transition-opacity",children:[(0,q.jsx)("button",{onClick:()=>{i(x.id),d(x.text)},className:"p-1 rounded hover:bg-slate-700 transition-colors",title:"Edit",children:(0,q.jsx)("span",{style:{fontSize:11,color:"var(--p-text-m)"},children:"\\u270E"})}),(0,q.jsx)("button",{onClick:()=>p(x),className:"p-1 rounded hover:bg-red-900/40 transition-colors",title:"Delete",children:(0,q.jsx)("span",{style:{fontSize:11,color:"var(--p-text-m)"},children:"\\u2715"})})]})]}),f?(0,q.jsxs)("div",{style:{display:"flex",flexDirection:"column",gap:6},children:[(0,q.jsx)(qo,{ref:s,value:l,onChange:d,baseRows:4,maxRows:12,onKeyDown:v=>{v.key==="Enter"&&(v.ctrlKey||v.metaKey)&&(v.preventDefault(),c(x,l).then(()=>i(null)))},style:{width:"100%",background:"var(--p-input)",border:"1px solid var(--p-border-s)",borderRadius:6,padding:"8px 10px",fontSize:12,color:"var(--p-text)",outline:"none",fontFamily:"inherit",boxSizing:"border-box"}}),(0,q.jsxs)("div",{style:{display:"flex",gap:6,justifyContent:"flex-end"},children:[(0,q.jsx)("button",{onClick:()=>i(null),style:{padding:"4px 10px",background:"var(--p-surface)",border:"none",borderRadius:5,fontSize:11,color:"var(--p-text-sub)",cursor:"pointer"},children:"Cancel"}),(0,q.jsx)("button",{onClick:async()=>{await c(x,l),i(null)},style:{padding:"4px 10px",background:"var(--p-blue)",border:"none",borderRadius:5,fontSize:11,color:"var(--p-white)",cursor:"pointer"},children:"Save"})]})]}):m?(0,q.jsx)("div",{style:{padding:"8px 14px",fontSize:12,color:"var(--p-text-g)",fontStyle:"italic",background:"var(--p-input)",border:"1px dashed var(--p-border)",borderRadius:8},children:"Comment deleted"}):(0,q.jsx)(ur,{markdown:x.text,style:{background:"var(--p-input)",border:"1px solid var(--p-border)",borderRadius:8,padding:"10px 14px",fontSize:12,color:"var(--p-text-sub)",lineHeight:1.6}})]},x.id)}var pg=E(De(),1);var dr=E(K(),1);function Ud({files:e,loading:t,error:a,baseUrl:r,onPreview:o,onDelete:n}){let[l,s]=pg.default.useState(null);return t?(0,dr.jsx)("p",{style:{color:"var(--p-text-g)",fontSize:12,textAlign:"center",padding:"16px 0"},children:"Loading\\u2026"}):a?(0,dr.jsx)("p",{style:{color:"var(--p-red-500)",fontSize:12,textAlign:"center",padding:"8px 0"},children:"Failed to load."}):e.length===0?(0,dr.jsx)("p",{style:{color:"var(--p-text-g)",fontSize:12,textAlign:"center",padding:"16px 0"},children:"No files attached."}):(0,dr.jsxs)("div",{style:{display:"flex",flexDirection:"column",gap:6},children:[e.map(i=>{let d=i.url??`${r}/api/files/${encodeURIComponent(i.name)}`;return(0,dr.jsx)(Ys,{file:i,url:d,variant:"normal",onPreview:c=>o(c),onDelete:n?c=>(s(c),Promise.resolve()):void 0},i.name)}),n&&(0,dr.jsx)(ga,{open:l!==null,message:l?`Delete "${l.name}"? This action cannot be undone.`:"",onConfirm:()=>{l&&n(l),s(null)},onCancel:()=>s(null)})]})}var qd=E(De(),1);var _o=E(De(),1),mg=E(Br(),1);var na=E(K(),1);function ll({value:e,onChange:t,previewValue:a,showPreview:r,setShowPreview:o,previewId:n,textareaId:l,placeholder:s,previewEmptyText:i,previewMinHeight:d=54,previewMaxHeight:c=220,baseRows:p=5,maxRows:g=12,autoFocus:L=!1,textareaRef:x,onKeyDown:I,afterTextarea:N,onBlur:m}){let u=_o.default.useRef(null),[f,v]=_o.default.useState([]),[C,w]=_o.default.useState(null),[y,k]=_o.default.useState(null);_o.default.useEffect(()=>{let F=!0;return fetch("/api/tasks").then(Z=>Z.json()).then(Z=>{if(!F)return;let oe=(Z.tasks??[]).map(fe=>({id:String(fe.id??""),title:String(fe.title??"")})).filter(fe=>fe.id.length>0);v(oe)}).catch(()=>{}),()=>{F=!1}},[]);function z(F){let Z=u.current;if(!Z){w(null);return}let oe=Z.selectionStart??F.length,fe=F.slice(0,oe),Ce=-1;for(let J=fe.length-1;J>=0;J--){if(fe[J]!=="#")continue;let T=J>0?fe[J-1]:"";if(T&&!/\\s/.test(T))continue;let V=fe.slice(J+1);if(!V.includes("#")){if(V.length>80)return;Ce=J;break}}if(Ce===-1){w(null);return}let ee=fe.slice(Ce+1).trim().toLowerCase(),Te=f.filter(J=>{if(!ee)return!0;let T=J.id.toLowerCase(),V=J.title.toLowerCase();return T.includes(ee)||V.includes(ee)}).sort((J,T)=>{let V=J.id.toLowerCase().startsWith(ee)?1:0,B=T.id.toLowerCase().startsWith(ee)?1:0;if(V!==B)return B-V;let A=J.title.toLowerCase().startsWith(ee)?1:0,ge=T.title.toLowerCase().startsWith(ee)?1:0;return A!==ge?ge-A:J.id.localeCompare(T.id)}).slice(0,6);if(!Te.length){w(null),k(null);return}let ue=Z.getBoundingClientRect();k({top:ue.top,left:ue.left,width:ue.width}),w({queryStart:Ce,queryEnd:oe,items:Te})}function U(F){let Z=C;if(!Z)return;let oe=`${e.slice(0,Z.queryStart)}#${F} ${e.slice(Z.queryEnd)}`;t(oe),w(null),k(null),requestAnimationFrame(()=>{let fe=u.current;if(!fe)return;let Ce=Z.queryStart+F.length+2;fe.focus(),fe.setSelectionRange(Ce,Ce)})}return r?(0,na.jsx)("div",{id:n,onClick:F=>{F.target.closest("a")||o(!1)},title:"Click to edit",style:{cursor:"text",minHeight:d,background:"var(--p-input)",border:"1px solid var(--p-border-s)",borderRadius:8,padding:10,fontSize:12,color:"var(--p-text-sub)",lineHeight:1.7,overflow:"auto",maxHeight:c},children:(a??e).trim()?(0,na.jsx)(ur,{markdown:a??e}):(0,na.jsx)("span",{style:{color:"var(--p-border-t)"},children:i??s})}):(0,na.jsxs)("div",{style:{position:"relative"},children:[(0,na.jsx)(qo,{id:l,ref:F=>{u.current=F,x&&(x.current=F)},className:"dp-textarea",placeholder:s,value:e,onChange:F=>{t(F),z(F)},onFocus:()=>o(!1),onBlur:()=>{w(null),k(null),o(!0),m==null||m()},baseRows:p,maxRows:g,autoFocus:L,onKeyDown:F=>{F.key==="Escape"&&(w(null),k(null)),I==null||I(F)}}),C&&y&&(0,mg.createPortal)((0,na.jsx)("div",{"data-task-ref-suggest":"true",style:{position:"fixed",left:y.left+8,width:y.width-16,top:y.top,transform:"translateY(-100%)",border:"1px solid var(--p-border-s)",background:"var(--p-card)",borderRadius:8,boxShadow:"var(--p-shadow-lg)",overflow:"hidden",zIndex:9999},children:C.items.map(F=>(0,na.jsxs)("button",{type:"button",onMouseDown:Z=>{Z.preventDefault(),U(F.id)},style:{width:"100%",display:"flex",alignItems:"center",gap:8,textAlign:"left",border:"none",borderBottom:"1px solid var(--p-border)",background:"transparent",color:"var(--p-text-sub)",padding:"7px 10px",fontSize:11,cursor:"pointer"},onMouseEnter:Z=>{Z.currentTarget.style.background="var(--p-hover)"},onMouseLeave:Z=>{Z.currentTarget.style.background="transparent"},children:[(0,na.jsxs)("span",{style:{fontFamily:"monospace",color:"var(--p-blue-300)"},children:["#",F.id]}),(0,na.jsx)("span",{style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:F.title})]},F.id))}),document.body),N]})}var Kr=E(De(),1);var Kt=E(K(),1);function Hd({tags:e,allTags:t,onChange:a,disabled:r}){let[o,n]=Kr.default.useState(""),[l,s]=Kr.default.useState(!1),i=Kr.default.useRef(null),d=Kr.default.useRef(null),c=o.trim().toLowerCase(),p=Kr.default.useMemo(()=>t.filter(f=>!e.includes(f)&&f.toLowerCase().includes(c)).slice(0,8),[t,e,c]),g=c.length>0&&!t.some(u=>u.toLowerCase()===c)&&!e.some(u=>u.toLowerCase()===c),L=c.length>0&&t.some(u=>u.toLowerCase()===c)&&!e.some(u=>u.toLowerCase()===c);function x(u){var v;let f=u.trim();!f||e.includes(f)||(a([...e,f]),n(""),s(!1),(v=i.current)==null||v.focus())}function I(u){a(e.filter(f=>f!==u))}function N(u){if(u.key==="Enter")if(u.preventDefault(),g||L){let f=t.find(v=>v.toLowerCase()===c);x(f??o.trim())}else p.length>0&&x(p[0]);u.key==="Escape"&&(s(!1),n("")),u.key==="Backspace"&&!o&&e.length>0&&I(e[e.length-1])}Kr.default.useEffect(()=>{function u(f){d.current&&!d.current.contains(f.target)&&s(!1)}return document.addEventListener("mousedown",u),()=>document.removeEventListener("mousedown",u)},[]);let m=l&&(p.length>0||g);return(0,Kt.jsxs)("div",{ref:d,style:{position:"relative"},children:[(0,Kt.jsxs)("div",{style:{display:"flex",flexWrap:"wrap",gap:4,alignItems:"center",padding:"5px 8px",borderRadius:8,border:`1px solid ${l?"var(--p-blue)":"var(--p-border)"}`,background:"var(--p-input)",cursor:r?"not-allowed":"text",opacity:r?.6:1,minHeight:34,transition:"border-color .12s"},onClick:()=>{var u;r||(u=i.current)==null||u.focus()},children:[(0,Kt.jsx)(rl,{tags:e,onRemove:r?void 0:I,size:"sm"}),!r&&(0,Kt.jsx)("input",{ref:i,type:"text",value:o,placeholder:e.length?"":"Add tags\\u2026",onChange:u=>{n(u.target.value),s(!0)},onFocus:()=>s(!0),onKeyDown:N,style:{background:"none",border:"none",outline:"none",fontSize:12,color:"var(--p-text)",minWidth:80,flex:1,padding:0,lineHeight:"1.4"}})]}),m&&(0,Kt.jsxs)("div",{style:{position:"absolute",top:"calc(100% + 4px)",left:0,right:0,background:"var(--p-card)",border:"1px solid var(--p-border-s)",borderRadius:8,boxShadow:"0 8px 24px rgba(0,0,0,0.25)",zIndex:50,overflow:"hidden"},onMouseDown:u=>u.preventDefault(),children:[p.map(u=>{let{bg:f,text:v,border:C}=oa(u);return(0,Kt.jsxs)("button",{type:"button",onClick:()=>x(u),style:{width:"100%",textAlign:"left",padding:"6px 10px",display:"flex",alignItems:"center",gap:6,background:"none",border:"none",cursor:"pointer",fontSize:12,color:"var(--p-text-m)"},onMouseEnter:w=>{w.currentTarget.style.background="var(--p-hover)"},onMouseLeave:w=>{w.currentTarget.style.background="none"},children:[(0,Kt.jsx)("span",{style:{width:8,height:8,borderRadius:"50%",background:v,border:`1px solid ${C}`,flexShrink:0}}),u]},u)}),g&&(0,Kt.jsxs)("button",{type:"button",onClick:()=>x(o.trim()),style:{width:"100%",textAlign:"left",padding:"6px 10px",display:"flex",alignItems:"center",gap:6,background:"none",border:p.length>0?"1px solid var(--p-border)":"none",borderLeft:"none",borderRight:"none",borderBottom:"none",cursor:"pointer",fontSize:12,color:"var(--p-text-g)"},onMouseEnter:u=>{u.currentTarget.style.background="var(--p-hover)",u.currentTarget.style.color="var(--p-text-m)"},onMouseLeave:u=>{u.currentTarget.style.background="none",u.currentTarget.style.color="var(--p-text-g)"},children:[(0,Kt.jsx)("span",{style:{fontSize:14,lineHeight:1},children:"+"}),\'Create "\',(0,Kt.jsx)("strong",{style:{color:"var(--p-text)"},children:o.trim()}),\'"\']})]})]})}var Y=E(K(),1);function _d({task:e,description:t,setDescription:a,showDescPreview:r,setShowDescPreview:o,priority:n,setPriority:l,onDescriptionBlur:s,onDescriptionDiscard:i,originalDescription:d,onPriorityChange:c,githubUrl:p,onFilePreview:g,onPatch:L,onDeleteScreenshot:x,liveFiles:I,allTags:N=[],overrideTags:m,onTagsChange:u}){var Z;let f=(e==null?void 0:e.files)??[],v=I?I.map(oe=>({name:oe.name,linkedPath:oe.linkedPath,addedAt:oe.createdAt,url:oe.url})):f,C=v==null?void 0:v.find(oe=>/\\.(png|jpe?g|gif|webp|svg|avif)$/i.test(oe.name)),w=e&&C?C.url||`/api/tasks/${e.id}/files/${encodeURIComponent(C.name)}`:null,y=qd.default.useRef(null),[k,z]=qd.default.useState(null),{userPart:U,consolePart:F}=_v(t);return(0,Y.jsxs)("div",{style:{display:"flex",flexDirection:"column",gap:12},children:[(0,Y.jsxs)("div",{children:[(0,Y.jsx)("div",{className:"dp-meta-label",style:{marginBottom:4},children:"Description"}),(0,Y.jsx)(ll,{value:t,previewValue:F?U:void 0,onChange:a,onBlur:s,showPreview:r,setShowPreview:o,previewId:"dp-desc-preview",textareaId:"dp-desc",placeholder:"Description (markdown)\\u2026",previewMinHeight:80,previewMaxHeight:220,baseRows:6,maxRows:12,autoFocus:!0,textareaRef:y,afterTextarea:i&&d!==void 0&&t!==d?(0,Y.jsx)("button",{type:"button",onMouseDown:oe=>{oe.preventDefault(),i()},title:"Discard changes and restore saved description",style:{marginTop:4,display:"flex",alignItems:"center",gap:4,fontSize:11,color:"var(--p-text-g)",background:"none",border:"1px solid var(--p-border-t)",borderRadius:6,padding:"3px 8px",cursor:"pointer",transition:"color .12s, border-color .12s"},onMouseEnter:oe=>{oe.currentTarget.style.color="var(--p-amber-300)",oe.currentTarget.style.borderColor="var(--p-amber-300)"},onMouseLeave:oe=>{oe.currentTarget.style.color="var(--p-text-g)",oe.currentTarget.style.borderColor="var(--p-border-t)"},children:"\\u21A9 Discard changes"}):void 0})]}),F&&(0,Y.jsx)(Wv,{logs:F}),e&&C&&w&&(0,Y.jsxs)("div",{children:[(0,Y.jsx)("div",{className:"dp-meta-label",children:"Screenshot"}),(0,Y.jsxs)("div",{id:"dp-screenshot-preview",style:{border:"1px solid color-mix(in srgb, var(--p-border-t) 70%, transparent)",borderRadius:10,overflow:"hidden",background:"var(--p-card)"},children:[(0,Y.jsx)("button",{onClick:()=>g(C.name,w),style:{width:"100%",height:112,border:"none",padding:0,background:"linear-gradient(135deg, var(--p-border), var(--p-bg))",cursor:"pointer",display:"block",overflow:"hidden"},title:"Preview screenshot",children:(0,Y.jsx)("img",{src:w,alt:"Task screenshot",style:{width:"100%",height:"100%",objectFit:"cover",display:"block"}})}),(0,Y.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:8,padding:"8px 10px",borderTop:"1px solid var(--p-border)",background:"var(--p-surface)"},children:[(0,Y.jsx)("span",{style:{fontSize:10,color:"var(--p-text-f)",flex:1,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:C.addedAt?`Captured ${Pt(C.addedAt)}`:"Screenshot attached"}),(0,Y.jsx)("button",{onClick:()=>g(C.name,w),style:{fontSize:10,color:"var(--p-text-m)",background:"transparent",border:"none",cursor:"pointer",padding:0},title:"Preview screenshot",children:"Preview"}),(0,Y.jsx)("button",{onClick:()=>z(C.name),style:{fontSize:10,color:"var(--p-red)",background:"transparent",border:"none",cursor:"pointer",padding:0},title:"Remove screenshot",children:"Remove"})]})]})]}),(0,Y.jsxs)("div",{children:[(0,Y.jsx)("div",{className:"dp-meta-label",children:"Tags"}),(0,Y.jsx)(Hd,{tags:m??(e==null?void 0:e.tags)??[],allTags:N,disabled:!e&&!u,onChange:oe=>{u?u(oe):e&&L(e.id,{tags:oe})}})]}),(0,Y.jsxs)("div",{children:[(0,Y.jsx)("div",{className:"dp-meta-label",children:"Priority"}),(0,Y.jsxs)("select",{id:"dp-priority",className:"dp-input",value:n,onChange:oe=>{let fe=oe.target.value;l(fe),c==null||c(fe)},style:{padding:"5px 8px",fontSize:12,cursor:"pointer",width:"auto"},children:[(0,Y.jsx)("option",{value:"",children:"\\u2014"}),(0,Y.jsx)("option",{value:"Critical",children:"Critical"}),(0,Y.jsx)("option",{value:"High",children:"High"}),(0,Y.jsx)("option",{value:"Medium",children:"Medium"}),(0,Y.jsx)("option",{value:"Low",children:"Low"})]})]}),e&&(0,Y.jsxs)("div",{id:"dp-metadata",style:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:6},children:[(0,Y.jsx)(Zs,{label:"Created",id:"dp-created",children:e.createdAt?Pt(e.createdAt):"\\u2014"}),(0,Y.jsx)(Zs,{label:"ID",id:"dp-id",children:(0,Y.jsx)("span",{style:{fontFamily:"monospace"},children:e.id})}),(0,Y.jsx)(Zs,{label:"Author",id:"dp-author",children:e.authorName??e.author??"\\u2014"}),e.agent&&(0,Y.jsx)(Zs,{label:"Agent",id:"dp-agent",children:(0,Y.jsx)("span",{style:{color:"#a78bfa"},children:e.agent})}),(e.commit||((Z=e.commits)==null?void 0:Z.length))&&(0,Y.jsx)(qv,{task:e,githubUrl:p}),e.annotatedElementText&&(0,Y.jsxs)("div",{id:"dp-annotated-text",style:{gridColumn:"1 / -1",background:"var(--p-card)",borderRadius:8,padding:"8px 10px"},children:[(0,Y.jsx)("div",{style:{fontSize:9,color:"var(--p-border-t)",marginBottom:2,textTransform:"uppercase",letterSpacing:"0.04em"},children:"Annotated element text"}),(0,Y.jsx)("div",{style:{fontSize:11,color:"var(--p-text-f)",fontStyle:"italic",whiteSpace:"pre-wrap",wordBreak:"break-word"},children:e.annotatedElementText})]})]}),(0,Y.jsx)(ga,{open:k!==null,message:"Remove this screenshot? This action cannot be undone.",confirmLabel:"Remove",onConfirm:()=>{k&&x(k),z(null)},onCancel:()=>z(null)})]})}function Zs({label:e,id:t,children:a}){return(0,Y.jsxs)("div",{id:t,style:{background:"var(--p-card)",borderRadius:8,padding:"8px 10px"},children:[(0,Y.jsx)("div",{style:{fontSize:9,color:"var(--p-border-t)",marginBottom:2,textTransform:"uppercase",letterSpacing:"0.04em"},children:e}),(0,Y.jsx)("div",{style:{fontSize:11,color:"var(--p-text-f)",borderBottom:"1px solid var(--p-border)",paddingBottom:4,display:"flex",alignItems:"center",minHeight:16},children:a})]})}function qv({task:e,githubUrl:t}){var n;let a=(n=e.commits)!=null&&n.length?e.commits:[{sha:e.commit,message:e.title??"",timestamp:e.createdAt??""}],r=a[a.length-1],o=a.map(l=>`${l.sha.slice(0,8)} ${l.timestamp?new Date(l.timestamp).toLocaleString():""} ${l.message.slice(0,60)}`).join(`\n`);return(0,Y.jsxs)("div",{id:"dp-commit",style:{background:"var(--p-card)",borderRadius:8,padding:"8px 10px",cursor:"default"},title:a.length>1?`All commits:\n${o}`:`${r.sha}\n${r.message}`,children:[(0,Y.jsxs)("div",{style:{fontSize:9,color:"var(--p-border-t)",marginBottom:2,textTransform:"uppercase",letterSpacing:"0.04em"},children:["Commit",a.length>1?"s":""]}),(0,Y.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:5},children:[t&&e.commitPushed!==!1?(0,Y.jsxs)("a",{href:`${t}/commit/${r.sha}`,target:"_blank",rel:"noopener noreferrer",style:{fontSize:10,color:"var(--p-blue-300)",fontFamily:"monospace",textDecoration:"none"},title:"Open diff on GitHub",onClick:l=>l.stopPropagation(),children:[r.sha.slice(0,8)," \\u2197"]}):(0,Y.jsxs)("span",{style:{fontSize:10,color:"var(--p-text-f)",fontFamily:"monospace"},title:e.commitPushed===!1?"Commit not pushed to remote yet":void 0,children:[r.sha.slice(0,8),e.commitPushed===!1?" \\u23F3":""]}),a.length>1&&(0,Y.jsxs)("span",{style:{fontSize:9,color:"var(--p-blue)",background:"color-mix(in srgb, var(--p-blue) 12%, transparent)",border:"1px solid color-mix(in srgb, var(--p-blue) 25%, transparent)",borderRadius:10,padding:"0 5px",fontWeight:600},children:["+",a.length-1]})]})]})}function _v(e){let a=e.indexOf(`\n---\n**Console logs**`);return a===-1?{userPart:e,consolePart:null}:{userPart:e.slice(0,a).trim(),consolePart:e.slice(a+1).trim()}}function Wv({logs:e}){let t=e.replace(/^---\\s*\\n/,"").split(`\n`).filter(a=>a.trim());return(0,Y.jsxs)("div",{id:"dp-console-logs",style:{borderRadius:8,border:"1px solid color-mix(in srgb, var(--p-red) 30%, var(--p-border))",background:"color-mix(in srgb, var(--p-red) 4%, var(--p-card))",overflow:"hidden"},children:[(0,Y.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:6,padding:"6px 10px",borderBottom:"1px solid color-mix(in srgb, var(--p-red) 20%, var(--p-border))",background:"color-mix(in srgb, var(--p-red) 8%, var(--p-card))"},children:[(0,Y.jsx)("span",{style:{fontSize:10,fontWeight:700,color:"color-mix(in srgb, var(--p-red) 80%, var(--p-text-sub))",letterSpacing:"0.05em",textTransform:"uppercase"},children:"Console Logs"}),(0,Y.jsx)("span",{style:{fontSize:9,color:"var(--p-text-g)",marginLeft:"auto"},children:"captured at submission"})]}),(0,Y.jsxs)("div",{style:{padding:"6px 10px",maxHeight:200,overflowY:"auto",display:"flex",flexDirection:"column",gap:3},children:[t.map((a,r)=>{let o=a.includes("\\u{1F534}"),n=a.includes("\\u{1F7E1}"),l=a.replace(/^[-*]\\s*/,"");return(0,Y.jsx)("div",{style:{fontFamily:"Menlo, monospace",fontSize:10,lineHeight:1.5,color:o?"var(--p-red)":n?"var(--p-amber-300)":"var(--p-text-f)",wordBreak:"break-all"},children:l},r)}),t.length===0&&(0,Y.jsx)("div",{style:{fontSize:10,color:"var(--p-text-g)",fontStyle:"italic"},children:"No log entries captured."})]})]})}var Wo=E(K(),1);function Wd({commentInput:e,setCommentInput:t,commentSubmitting:a,onSubmit:r,baseRows:o=4}){return(0,Wo.jsx)("div",{id:"dp-comment-input-area",children:(0,Wo.jsx)(ll,{value:e,onChange:t,showPreview:!1,setShowPreview:()=>{},previewId:"dp-comment-tab-edit",textareaId:"dp-comment-input",placeholder:"Add a comment\\u2026 (markdown)",previewEmptyText:"Leave a comment (markdown)\\u2026",previewMinHeight:o<=2?36:54,previewMaxHeight:140,baseRows:o,maxRows:10,autoFocus:!0,onKeyDown:n=>{n.key==="Enter"&&(n.ctrlKey||n.metaKey)&&(n.preventDefault(),r())},afterTextarea:(0,Wo.jsx)("button",{id:"dp-comment-submit",disabled:a,onMouseDown:n=>{n.preventDefault(),r()},title:"Send (Ctrl+Enter)",style:{position:"absolute",bottom:16,right:8,width:26,height:26,display:"flex",alignItems:"center",justifyContent:"center",background:"var(--p-blue)",border:"none",borderRadius:6,cursor:"pointer",color:"var(--p-white)",transition:"background .15s"},children:(0,Wo.jsx)("svg",{width:"13",height:"13",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{display:"block"},children:(0,Wo.jsx)("path",{d:"M2 8L14 2L10 8L14 14L2 8Z",fill:"currentColor"})})})})})}var Be=E(De(),1),$d=E(Br(),1);var M=E(K(),1),sl=[{id:"opencode/hy3-preview-free",label:"Hy3 Preview (Free)",provider:"OpenCode",recommended:!0},{id:"opencode/minimax-m2.5-free",label:"MiniMax M2.5 (Free)",provider:"OpenCode",recommended:!0},{id:"opencode/nemotron-3-super-free",label:"Nemotron 3 Super (Free)",provider:"OpenCode",recommended:!0},{id:"opencode-go/deepseek-v4-flash",label:"DeepSeek V4 Flash",provider:"OpenCode Go",recommended:!0},{id:"opencode-go/qwen3.5-plus",label:"Qwen 3.5 Plus",provider:"OpenCode Go",recommended:!0},{id:"opencode-go/qwen3.6-plus",label:"Qwen 3.6 Plus",provider:"OpenCode Go"},{id:"opencode-go/minimax-m2.5",label:"MiniMax M2.5",provider:"OpenCode Go"},{id:"opencode-go/minimax-m2.7",label:"MiniMax M2.7",provider:"OpenCode Go"},{id:"opencode-go/kimi-k2.5",label:"Kimi K2.5",provider:"OpenCode Go"},{id:"opencode-go/glm-5",label:"GLM 5",provider:"OpenCode Go"},{id:"github-copilot/gpt-4o",label:"GPT-4o (Copilot)",provider:"GitHub Copilot",recommended:!0},{id:"github-copilot/gpt-4.1",label:"GPT-4.1 (Copilot)",provider:"GitHub Copilot"},{id:"github-copilot/claude-haiku-4.5",label:"Claude Haiku 4.5 (Copilot)",provider:"GitHub Copilot"},{id:"github-copilot/gpt-5-mini",label:"GPT-5 Mini (Copilot)",provider:"GitHub Copilot"},{id:"openrouter/google/gemma-3-12b-it:free",label:"Gemma 3 12B (Free)",provider:"OpenRouter"},{id:"openrouter/anthropic/claude-3.5-haiku",label:"Claude 3.5 Haiku",provider:"OpenRouter"},{id:"openrouter/anthropic/claude-3.7-sonnet",label:"Claude 3.7 Sonnet",provider:"OpenRouter"},{id:"anthropic/claude-sonnet-4-20250514",label:"Claude Sonnet 4",provider:"Anthropic"},{id:"anthropic/claude-opus-4-20250514",label:"Claude Opus 4",provider:"Anthropic"},{id:"openai/gpt-4o",label:"GPT-4o",provider:"OpenAI"},{id:"openai/gpt-4-turbo",label:"GPT-4 Turbo",provider:"OpenAI"},{id:"google/gemini-2-5-pro",label:"Gemini 2.5 Pro",provider:"Google"},{id:"google/gemini-2-0-flash-exp",label:"Gemini 2.0 Flash",provider:"Google"},{id:"ollama/llama-3-1-8b",label:"Llama 3.1 8B",provider:"Ollama"},{id:"ollama/qwen2-5-coder",label:"Qwen 2.5 Coder",provider:"Ollama"}];function gg(e){if(!e)return"";let t=Date.now()-new Date(e).getTime(),a=Math.floor(t/6e4),r=Math.floor(t%6e4/1e3);return`${a}m ${r.toString().padStart(2,"0")}s`}function Js({value:e,onChange:t,disabled:a=!1,models:r=sl}){let[o,n]=Be.default.useState(!1),[l,s]=Be.default.useState(""),i=Be.default.useRef(null),d=Be.default.useRef(null),c=r.length>0?r:sl,p=c.find(f=>f.id===e),g=Be.default.useMemo(()=>{if(!l)return c;let f=l.toLowerCase();return c.filter(v=>v.label.toLowerCase().includes(f)||v.provider.toLowerCase().includes(f)||v.id.toLowerCase().includes(f))},[l,c]),L=Be.default.useMemo(()=>{let f={};for(let v of g)f[v.provider]||(f[v.provider]=[]),f[v.provider].push(v);return f},[g,c]),[x,I]=Be.default.useState(null);function N(){a||(n(f=>!f),requestAnimationFrame(()=>{if(i.current){let f=i.current.getBoundingClientRect();I(f)}}))}function m(){n(!1),s(""),I(null)}Be.default.useEffect(()=>{if(!o)return;function f(v){let C=v.target;i.current&&i.current.contains(C)||d.current&&d.current.contains(C)||m()}return document.addEventListener("mousedown",f),()=>document.removeEventListener("mousedown",f)},[o]),Be.default.useEffect(()=>{if(!o)return;function f(v){v.key==="Escape"&&m()}return document.addEventListener("keydown",f,!0),()=>document.removeEventListener("keydown",f,!0)},[o]);let u=o&&x?(0,$d.createPortal)((0,M.jsxs)("div",{ref:d,"data-model-picker-dropdown":!0,style:{position:"fixed",left:x.left,bottom:window.innerHeight-x.top+4,width:x.width,background:"var(--p-surface)",border:"1px solid var(--p-border)",borderRadius:8,boxShadow:"var(--p-shadow-lg)",zIndex:1e5,maxHeight:320,overflowY:"auto",display:"flex",flexDirection:"column"},children:[(0,M.jsx)("div",{style:{padding:8,borderBottom:"1px solid var(--p-border)",flexShrink:0},children:(0,M.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:6,padding:"6px 8px",background:"var(--p-bg-2)",borderRadius:6,border:"1px solid var(--p-border)"},children:[(0,M.jsx)(qr,{style:{width:12,height:12,color:"var(--p-text-g)",flexShrink:0}}),(0,M.jsx)("input",{type:"text",placeholder:"Filter models...",value:l,onChange:f=>s(f.target.value),autoFocus:!0,style:{flex:1,border:"none",background:"transparent",fontSize:12,color:"var(--p-text)",outline:"none"}})]})}),(0,M.jsxs)("div",{style:{flex:1,overflowY:"auto",padding:4},children:[Object.entries(L).map(([f,v])=>(0,M.jsxs)("div",{children:[(0,M.jsx)("div",{style:{padding:"6px 10px 4px",fontSize:10,fontWeight:600,color:"var(--p-text-g)",textTransform:"uppercase",letterSpacing:"0.04em"},children:f}),v.map(C=>(0,M.jsxs)("button",{type:"button",onClick:()=>{t(C.id),m()},style:{width:"100%",display:"flex",alignItems:"center",gap:8,padding:"6px 10px",borderRadius:5,border:"none",background:e===C.id?"color-mix(in srgb, var(--p-purple) 12%, transparent)":"transparent",color:e===C.id?"var(--p-purple-300)":"var(--p-text-m)",fontSize:12,cursor:"pointer",textAlign:"left",transition:"background .1s"},onMouseEnter:w=>{w.currentTarget.style.background=e===C.id?"color-mix(in srgb, var(--p-purple) 15%, transparent)":"var(--p-hover)"},onMouseLeave:w=>{w.currentTarget.style.background=e===C.id?"color-mix(in srgb, var(--p-purple) 12%, transparent)":"transparent"},children:[(0,M.jsx)("span",{style:{flex:1,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:C.label}),C.recommended&&(0,M.jsx)("span",{style:{fontSize:8,fontWeight:600,padding:"1px 4px",borderRadius:3,background:"var(--p-purple)",color:"#fff",flexShrink:0},children:"Rec"})]},C.id))]},f)),g.length===0&&(0,M.jsxs)("div",{style:{padding:16,textAlign:"center",fontSize:12,color:"var(--p-text-g)"},children:[\'No models match "\',l,\'"\']})]})]}),document.body):null;return(0,M.jsxs)("div",{ref:i,style:{position:"relative"},children:[(0,M.jsxs)("button",{type:"button",onClick:N,disabled:a,style:{width:"100%",display:"flex",alignItems:"center",justifyContent:"space-between",gap:8,padding:"8px 12px",borderRadius:7,border:`1px solid ${o?"var(--p-purple-300)":"var(--p-border)"}`,background:"var(--p-bg-2)",color:"var(--p-text-m)",fontSize:12,cursor:a?"not-allowed":"pointer",transition:"all .12s",opacity:a?.6:1},onMouseEnter:f=>{a||(f.currentTarget.style.borderColor="var(--p-purple-300)")},onMouseLeave:f=>{a||(f.currentTarget.style.borderColor=o?"var(--p-purple-300)":"var(--p-border)")},children:[(0,M.jsxs)("span",{style:{display:"flex",alignItems:"center",gap:8,overflow:"hidden"},children:[(0,M.jsx)("span",{style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:(p==null?void 0:p.label)||"Select model"}),(p==null?void 0:p.recommended)&&(0,M.jsx)("span",{style:{fontSize:9,fontWeight:600,padding:"1px 5px",borderRadius:3,background:"var(--p-purple)",color:"#fff",flexShrink:0},children:"Recommended"})]}),(0,M.jsx)(pa,{style:{width:14,height:14,color:"var(--p-text-g)",flexShrink:0,transition:"transform .15s",transform:o?"rotate(180deg)":void 0}})]}),u]})}function Vd({value:e,onChange:t,disabled:a=!1,agents:r}){var p,g,L;let[o,n]=Be.default.useState(!1),l=Be.default.useRef(null),s=Be.default.useRef(null),i=r.find(x=>x.id===e);function d(){a||n(x=>!x)}function c(){n(!1)}return Be.default.useEffect(()=>{if(!o)return;function x(I){let N=I.target;l.current&&l.current.contains(N)||s.current&&s.current.contains(N)||c()}return document.addEventListener("mousedown",x),()=>document.removeEventListener("mousedown",x)},[o]),(0,M.jsxs)("div",{ref:l,style:{position:"relative"},children:[(0,M.jsxs)("button",{type:"button",onClick:d,disabled:a,style:{width:"100%",display:"flex",alignItems:"center",justifyContent:"space-between",gap:8,padding:"8px 12px",borderRadius:7,border:`1px solid ${o?"var(--p-purple-300)":"var(--p-border)"}`,background:"var(--p-bg-2)",color:i?"var(--p-text)":"var(--p-text-m)",fontSize:12,cursor:a?"not-allowed":"pointer",transition:"all .12s",opacity:a?.6:1},children:[(0,M.jsxs)("span",{style:{display:"flex",alignItems:"center",gap:8,overflow:"hidden"},children:[(0,M.jsx)(mt,{style:{width:14,height:14,flexShrink:0,color:"var(--p-purple-300)"}}),(0,M.jsx)("span",{style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:(i==null?void 0:i.name)||"Select agent"}),i&&(0,M.jsx)("span",{style:{fontSize:9,fontWeight:500,padding:"1px 5px",borderRadius:3,background:"var(--p-border)",color:"var(--p-text-g)",flexShrink:0},children:i.scope})]}),(0,M.jsx)(pa,{style:{width:14,height:14,color:"var(--p-text-g)",flexShrink:0,transition:"transform .15s",transform:o?"rotate(180deg)":void 0}})]}),o&&(0,$d.createPortal)((0,M.jsx)("div",{ref:s,"data-agent-picker-dropdown":!0,style:{position:"fixed",left:((p=l.current)==null?void 0:p.getBoundingClientRect().left)??0,bottom:window.innerHeight-(((g=l.current)==null?void 0:g.getBoundingClientRect().top)??0)+4,width:((L=l.current)==null?void 0:L.getBoundingClientRect().width)??200,background:"var(--p-surface)",border:"1px solid var(--p-border)",borderRadius:8,boxShadow:"var(--p-shadow-lg)",zIndex:1e5,maxHeight:240,overflowY:"auto",display:"flex",flexDirection:"column"},children:r.map(x=>(0,M.jsxs)("button",{type:"button",onClick:()=>{t(x.id),c()},style:{width:"100%",display:"flex",alignItems:"center",gap:8,padding:"8px 12px",borderRadius:5,border:"none",background:e===x.id?"color-mix(in srgb, var(--p-purple) 12%, transparent)":"transparent",color:e===x.id?"var(--p-purple-300)":"var(--p-text-m)",fontSize:12,cursor:"pointer",textAlign:"left",transition:"background .1s"},onMouseEnter:I=>{I.currentTarget.style.background=e===x.id?"color-mix(in srgb, var(--p-purple) 15%, transparent)":"var(--p-hover)"},onMouseLeave:I=>{I.currentTarget.style.background=e===x.id?"color-mix(in srgb, var(--p-purple) 12%, transparent)":"transparent"},children:[(0,M.jsx)(mt,{style:{width:14,height:14,flexShrink:0,color:"var(--p-purple-300)"}}),(0,M.jsx)("span",{style:{flex:1,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:x.name}),(0,M.jsx)("span",{style:{fontSize:9,fontWeight:500,padding:"1px 4px",borderRadius:3,background:"var(--p-border)",color:"var(--p-text-g)",flexShrink:0},children:x.scope})]},x.id))}),document.body)]})}function $v({status:e}){let t={idle:"var(--p-text-g)",queued:"var(--p-amber)",running:"var(--p-blue)",done:"var(--p-green)",failed:"var(--p-red)"},a={idle:"Idle",queued:"Queued",running:"Running",done:"Completed",failed:"Failed"},[r,o]=Be.default.useState(!0);return Be.default.useEffect(()=>{if(e!=="running")return;let n=setInterval(()=>o(l=>!l),800);return()=>{clearInterval(n),o(!0)}},[e]),(0,M.jsxs)("span",{style:{display:"inline-flex",alignItems:"center",gap:6,fontSize:11,fontWeight:500,color:t[e]},children:[(0,M.jsx)("span",{style:{width:6,height:6,borderRadius:"50%",background:t[e],opacity:e==="running"?r?1:.3:1,transition:"opacity 0.3s ease"}}),a[e]]})}function Vv(e){var a;let t=e.trim();if(!t)return null;if(t.startsWith("{"))try{let r=JSON.parse(t);if(r.type==="text"&&typeof r.part=="object"&&r.part){let o=r.part,n=typeof o.text=="string"?o.text:"";return n?(0,M.jsx)("span",{style:{color:"#e2e8f0"},children:n}):null}if(r.type==="tool_use"&&typeof r.part=="object"&&r.part){let o=r.part;if(o.type==="tool"){let n=typeof o.tool=="string"?o.tool:"tool",l=typeof o.state=="object"&&o.state?o.state:{},s=typeof l.input=="object"&&l.input?l.input:{},i=l.output??((a=l.metadata)==null?void 0:a.output),d=l.error,c=typeof l.status=="string"?l.status:"";return(0,M.jsxs)("div",{style:{color:"#94a3b8"},children:[(0,M.jsxs)("div",{children:[(0,M.jsxs)("span",{style:{color:"#60a5fa"},children:["\\u2192 ",n]}),typeof s.description=="string"&&s.description&&(0,M.jsxs)("span",{children:[": ",s.description]}),typeof s.command=="string"&&s.command&&!s.description&&(0,M.jsxs)("span",{children:[": ",s.command]}),typeof s.filePath=="string"&&s.filePath&&(0,M.jsxs)("span",{children:[": ",s.filePath]}),typeof s.url=="string"&&s.url&&(0,M.jsxs)("span",{children:[": ",s.url]})]}),d!==void 0&&(0,M.jsx)("div",{style:{marginLeft:12,color:"#ef4444",whiteSpace:"pre-wrap",wordBreak:"break-word",fontSize:9},children:String(d).slice(0,2e3)}),i!==void 0&&d===void 0&&(0,M.jsx)("div",{style:{marginLeft:12,color:c==="error"?"#ef4444":"#22c55e",whiteSpace:"pre-wrap",wordBreak:"break-word",fontSize:9},children:String(i).slice(0,2e3)})]})}}if(r.type==="step_start"||r.type==="step_finish")return null;if(r.type==="error"){let o=typeof r.message=="string"?r.message:JSON.stringify(r);return(0,M.jsxs)("span",{style:{color:"#ef4444"},children:["Error: ",o]})}return(0,M.jsxs)("span",{style:{color:"#64748b",fontSize:9},children:["[",String(r.type),"]"]})}catch{}return t.startsWith("opencode run")?(0,M.jsxs)("span",{style:{color:"#64748b",fontSize:9},children:["$ ",t.split(`\n`)[0]]}):t.startsWith("\\u2713")||t.startsWith("\\u2717")||t.startsWith("\\u25B6")?(0,M.jsx)("span",{children:t}):(0,M.jsx)("span",{style:{color:"#94a3b8"},children:t})}function Gv({logs:e,status:t}){let a=Be.default.useRef(null),r=e.join(""),o=Be.default.useMemo(()=>r.split(`\n`).filter(n=>n.trim().length>0),[r]);return Be.default.useEffect(()=>{a.current&&t==="running"&&(a.current.scrollTop=a.current.scrollHeight)},[o.length,t]),(0,M.jsxs)("div",{ref:a,style:{background:"#0a0c10",border:"1px solid var(--p-border)",borderRadius:7,padding:"10px 12px",fontFamily:"\'SF Mono\', \'Fira Code\', monospace",fontSize:10,lineHeight:1.65,color:"#a3e635",maxHeight:200,overflowY:"auto"},children:[o.map((n,l)=>{let s=Vv(n);return s===null?null:(0,M.jsx)("div",{style:{whiteSpace:"pre-wrap",wordBreak:"break-word"},children:s},l)}).filter(Boolean),t==="running"&&(0,M.jsx)("span",{style:{color:"#a3e635"},children:"\\u258C"})]})}function Gd({task:e,run:t,onRun:a,onStop:r,onDequeue:o,models:n,defaultModel:l,onModelChange:s,agents:i,onAgentChange:d}){var y,k;let c=n&&n.length>0?n:sl,[p,g]=Be.default.useState(e.model??l??((y=c[0])==null?void 0:y.id)),[L,x]=Be.default.useState(e.agent??((k=i==null?void 0:i[0])==null?void 0:k.id)??"");function I(z){g(z),s==null||s(z)}function N(z){x(z),d==null||d(z)}function m(){a(e.id,p,L||void 0)}Be.default.useEffect(()=>{s==null||s(p)},[]),Be.default.useEffect(()=>{L&&(d==null||d(L))},[]),Be.default.useEffect(()=>{e.model&&e.model!==p&&g(e.model),e.agent&&e.agent!==L&&x(e.agent)},[e.model,e.agent]);let[u,f]=Be.default.useState("");Be.default.useEffect(()=>{if((t==null?void 0:t.status)!=="running")return;let z=setInterval(()=>f(gg(t.startedAt)),1e3);return f(gg(t.startedAt)),()=>clearInterval(z)},[t==null?void 0:t.status,t==null?void 0:t.startedAt]);let v=(t==null?void 0:t.status)??"idle",C=(t==null?void 0:t.worktree)??`wt/task-${e.id.slice(0,8)}`,w=(t==null?void 0:t.branch)??`agent/task-${e.id.slice(0,8)}`;return(0,M.jsxs)("div",{style:{display:"flex",flexDirection:"column",gap:14},children:[(0,M.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:10,flexWrap:"wrap"},children:[(0,M.jsx)($v,{status:v}),v==="running"&&u&&(0,M.jsxs)("span",{style:{fontSize:11,color:"var(--p-text-g)",display:"inline-flex",alignItems:"center",gap:4},children:[(0,M.jsx)(ar,{style:{width:10,height:10}}),u]}),v==="queued"&&(0,M.jsx)("span",{style:{fontSize:11,color:"var(--p-text-g)"},children:"Waiting for current run to finish\\u2026"})]}),v==="idle"&&(0,M.jsxs)("div",{style:{borderRadius:8,padding:12,fontSize:12,lineHeight:1.6,background:"color-mix(in srgb, var(--p-purple) 6%, transparent)",border:"1px solid color-mix(in srgb, var(--p-purple) 25%, transparent)",color:"var(--p-purple-300)"},children:[(0,M.jsx)("strong",{children:"Ready to run."})," The agent will create an isolated worktree, read the task description, and implement a solution. When done, you\'ll review the diff and merge."]}),v==="queued"&&(0,M.jsxs)("div",{style:{borderRadius:8,padding:12,fontSize:12,lineHeight:1.6,background:"color-mix(in srgb, var(--p-amber) 6%, transparent)",border:"1px solid color-mix(in srgb, var(--p-amber) 25%, transparent)",color:"var(--p-amber-300)"},children:[(0,M.jsx)("strong",{children:"\\u23F3 Queued"})," \\u2014 another task is currently running. This task will start automatically when the queue is free."]}),(0,M.jsxs)("div",{children:[(0,M.jsx)("div",{style:{fontSize:10,fontWeight:600,color:"var(--p-text-g)",textTransform:"uppercase",letterSpacing:"0.04em",marginBottom:6},children:"Model"}),(0,M.jsx)(Js,{value:p,onChange:I,disabled:v==="running"||v==="queued",models:c})]}),i&&i.length>0&&(0,M.jsxs)("div",{children:[(0,M.jsx)("div",{style:{fontSize:10,fontWeight:600,color:"var(--p-text-g)",textTransform:"uppercase",letterSpacing:"0.04em",marginBottom:6},children:"Agent"}),(0,M.jsx)(Vd,{value:L,onChange:N,disabled:v==="running"||v==="queued",agents:i})]}),(0,M.jsxs)("div",{style:{border:"1px solid var(--p-border)",borderRadius:8,padding:10,background:"var(--p-bg-2)",display:"flex",flexDirection:"column",gap:6},children:[(0,M.jsx)("div",{style:{fontSize:10,fontWeight:600,color:"var(--p-text-g)",textTransform:"uppercase",letterSpacing:"0.04em"},children:"Worktree"}),(0,M.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:6,fontSize:11,color:"var(--p-text-m)"},children:[(0,M.jsx)(Gn,{style:{width:10,height:10,color:"var(--p-text-g)",flexShrink:0}}),(0,M.jsx)("span",{style:{fontFamily:"monospace",fontSize:10},children:C})]}),(0,M.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:6,fontSize:11,color:"var(--p-text-m)"},children:[(0,M.jsx)(Kn,{style:{width:10,height:10,color:"var(--p-text-g)",flexShrink:0}}),(0,M.jsx)("span",{style:{fontFamily:"monospace",fontSize:10},children:w})]})]}),t&&t.logs.length>0&&(0,M.jsxs)("div",{children:[(0,M.jsxs)("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",marginBottom:6},children:[(0,M.jsx)("div",{style:{fontSize:10,fontWeight:600,color:"var(--p-text-g)",textTransform:"uppercase",letterSpacing:"0.04em"},children:"Live Output"}),v==="running"&&(0,M.jsxs)("span",{style:{fontSize:10,color:"var(--p-blue-300)",display:"flex",alignItems:"center",gap:4},children:[(0,M.jsx)("span",{style:{width:6,height:6,borderRadius:"50%",background:"var(--p-blue)",animation:"pulse 1s ease-in-out infinite"}}),"Streaming..."]})]}),(0,M.jsx)(Gv,{logs:t.logs,status:v})]}),e.agent&&!t&&(0,M.jsxs)("div",{style:{fontSize:11,color:"var(--p-text-g)"},children:["Last agent: ",(0,M.jsx)("span",{style:{color:"var(--p-purple-300)"},children:e.agent}),e.model&&(0,M.jsxs)(M.Fragment,{children:[" \\xB7 model ",(0,M.jsx)("span",{style:{color:"var(--p-purple-300)"},children:e.model})]})]}),t&&(t.status==="done"||t.status==="failed")&&(0,M.jsxs)("div",{style:{borderTop:"1px solid var(--p-border)",paddingTop:10,display:"flex",flexWrap:"wrap",gap:"10px 16px",fontSize:10,color:"var(--p-text-g)"},children:[t.durationMs!=null&&(0,M.jsxs)("span",{style:{display:"inline-flex",alignItems:"center",gap:4},children:[(0,M.jsx)(ar,{style:{width:10,height:10}}),Kv(t.durationMs)]}),t.totalTokens!=null&&t.totalTokens>0&&(0,M.jsxs)("span",{title:`${t.inputTokens??0} input \\xB7 ${t.outputTokens??0} output${t.reasoningTokens?` \\xB7 ${t.reasoningTokens} reasoning`:""}`,children:[jv(t.totalTokens)," tokens"]}),t.cost!=null&&t.cost>0&&(0,M.jsxs)("span",{style:{color:"var(--p-green)"},children:["$",t.cost.toFixed(4)]})]})]})}function Kv(e){let t=Math.floor(e/6e4),a=Math.floor(e%6e4/1e3);return t>0?`${t}m ${a.toString().padStart(2,"0")}s`:`${a}s`}function jv(e){return e>=1e6?`${(e/1e6).toFixed(1)}M`:e>=1e3?`${(e/1e3).toFixed(1)}k`:`${e}`}var D=E(K(),1),Xv="vibeflow-paste-hint-dismissed";function Qv({storageKey:e=Xv}){let[t,a]=te.default.useState(()=>{try{return!localStorage.getItem(e)}catch{return!0}});if(!t)return null;function r(){try{localStorage.setItem(e,"1")}catch{}a(!1)}return(0,D.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:8,padding:"6px 10px",margin:"0 0 6px",borderRadius:6,background:"rgba(37,99,235,0.08)",border:"1px solid rgba(37,99,235,0.18)",fontSize:11,color:"var(--p-blue-300)",flexShrink:0},children:[(0,D.jsxs)("span",{style:{flex:1,lineHeight:1.4},children:["\\u{1F4A1} ",(0,D.jsx)("strong",{children:"Tip:"})," Paste screenshots or files anywhere in this panel \\u2014 they attach automatically."]}),(0,D.jsx)("button",{onClick:r,title:"Dismiss",style:{flexShrink:0,background:"none",border:"none",cursor:"pointer",padding:2,color:"var(--p-blue-300)",opacity:.7,display:"flex",alignItems:"center"},onMouseEnter:o=>{o.currentTarget.style.opacity="1"},onMouseLeave:o=>{o.currentTarget.style.opacity="0.7"},children:(0,D.jsx)(Ge,{style:{width:12,height:12}})})]})}var Yv=[{id:"backlog",label:"backlog"},{id:"todo",label:"todo"},{id:"in-progress",label:"in-progress"},{id:"review",label:"review"},{id:"done",label:"done"}],Zv=5*1024*1024;function Kd(e,t=.8){return new Promise((a,r)=>{let o=new Image,n=URL.createObjectURL(e);o.onload=()=>{let l=document.createElement("canvas");l.width=o.naturalWidth,l.height=o.naturalHeight;let s=l.getContext("2d");if(!s){URL.revokeObjectURL(n),r(new Error("canvas unavailable"));return}s.drawImage(o,0,0),URL.revokeObjectURL(n),l.toBlob(i=>{i?a(i):r(new Error("canvas.toBlob failed"))},"image/jpeg",t)},o.onerror=()=>{URL.revokeObjectURL(n),r(new Error("image load failed"))},o.src=n})}function jd({open:e,task:t,tab:a,addColumnId:r="todo",gitUserName:o="You",githubUrl:n,baseUrl:l,isResizing:s,api:i,onClose:d,onSave:c,onCreate:p,onDelete:g,onPatch:L,onFilePreview:x,onActivityChange:I,externalLocalChanges:N=[],showLockIndicator:m=!0,lockedByUser:u,onGoBack:f,navBackLabel:v,commentVersion:C,allTasks:w=[],agentRun:y,onRunAgent:k,onStopAgent:z,onDequeueAgent:U,models:F,defaultModel:Z,perTypeModels:oe,defaultModelBug:fe,defaultModelResearch:Ce,defaultModelTask:ee,agents:Te,experimentalAgents:ue}){let J=!t,T=t?tl(t.type):tl("Task"),V=te.default.useRef(null),[B,A]=te.default.useState([]),ge=te.default.useRef(!1),Le=te.default.useRef(""),Me=te.default.useRef(""),rt=te.default.useMemo(()=>{let S=new Set;for(let $ of w)for(let Q of $.tags??[])S.add(Q);return[...S].sort()},[w]),[ve,Xe]=te.default.useState(a),[Oe,Ke]=te.default.useState(""),[we,ye]=te.default.useState(""),[gt,ht]=te.default.useState(r),[et,ha]=te.default.useState("Task"),[Bt,xa]=te.default.useState(""),[Xr,$o]=te.default.useState(!1),[Vo,Qr]=te.default.useState(!1),[Yr,va]=te.default.useState(!1),ul=F&&F.length>0?F[0].id:"",cr=te.default.useMemo(()=>{if(oe&&(t!=null&&t.type)){if(t.type==="Bug"&&fe)return fe;if(t.type==="Research"&&Ce)return Ce;if(t.type==="Task"&&ee)return ee}return Z??ul},[oe,t==null?void 0:t.type,Z,fe,Ce,ee,ul]),[pr,Ot]=te.default.useState((t==null?void 0:t.model)??cr),[dl,Go]=te.default.useState((t==null?void 0:t.agent)??"");te.default.useEffect(()=>{!pr&&cr&&Ot(cr)},[cr,pr]);let ri=te.default.useCallback(S=>{Ot(S),t&&S!==t.model&&L(t.id,{model:S})},[t,L]),oi=te.default.useCallback(S=>{Go(S),t&&S!==t.agent&&L(t.id,{agent:S})},[t,L]),[ni,fl]=te.default.useState([]),[li,Ko]=te.default.useState(!1),[mr,cl]=te.default.useState(null),[Da,Zr]=te.default.useState(""),[gr,pl]=te.default.useState(!1),[Jr,ml]=te.default.useState([]),[eo,gl]=te.default.useState(!1),[si,jo]=te.default.useState(null),[hl,to]=te.default.useState(0),hr=te.default.useRef(0),[h,b]=te.default.useState(0),[O,X]=te.default.useState(null),[de,se]=te.default.useState([]),[H,ae]=te.default.useState([]),Ie=te.default.useRef(null),pe=te.default.useRef(()=>{}),he=te.default.useRef(""),P=te.default.useRef(!1);te.default.useEffect(()=>{he.current=Da},[Da]),te.default.useEffect(()=>{P.current=Yr},[Yr]),te.default.useEffect(()=>{ge.current=s??!1},[s]),te.default.useEffect(()=>{e||I==null||I(null,"viewing")},[e]),te.default.useEffect(()=>{if(!e||!t)return;Oe!==Le.current||we!==Me.current?I==null||I(t.id,"locked"):I==null||I(t.id,"viewing")},[Oe,we,e,t==null?void 0:t.id]),te.default.useEffect(()=>{if(!e)return;function S($){var Q,ze,ke,jt,Xt,xl,ao,vl;if(!ge.current&&!((ze=(Q=$.target)==null?void 0:Q.closest)!=null&&ze.call(Q,"[data-task-ref-suggest]"))&&!((jt=(ke=$.target)==null?void 0:ke.closest)!=null&&jt.call(ke,".modal-backdrop"))&&!((xl=(Xt=$.target)==null?void 0:Xt.closest)!=null&&xl.call(Xt,"[data-model-picker-dropdown]"))&&!((vl=(ao=$.target)==null?void 0:ao.closest)!=null&&vl.call(ao,"[data-agent-picker-dropdown]"))&&V.current&&!V.current.contains($.target)){if(P.current)return;if(he.current.trim().length>0){pe.current(),va(!0);return}pe.current(),d()}}return document.addEventListener("mousedown",S),()=>document.removeEventListener("mousedown",S)},[e,d]),te.default.useEffect(()=>{if(!e)return;function S($){if($.key==="Escape"){if(P.current){va(!1),$.stopPropagation();return}if(he.current.trim().length>0){$.stopPropagation(),pe.current(),va(!0);return}}}return document.addEventListener("keydown",S,{capture:!0}),()=>document.removeEventListener("keydown",S,{capture:!0})},[e]),te.default.useEffect(()=>{if(e){if(Xe(a),$o(!!t),Zr(""),fl([]),ml([]),to(0),b(0),se([]),ae([]),Ot((t==null?void 0:t.model)??cr),Go((t==null?void 0:t.agent)??""),t){let S=(t.title??"").trim(),$=(t.description??"").trim();Ke(S),ye($),ht(t.status),ha(t.type??"Task"),xa(t.priority??""),Le.current=S,Me.current=$,I==null||I(t.id,"viewing")}else Ke(""),ye(""),ht(r),ha("Task"),xa("");t&&(Pe(t.id),$e(t.id)),setTimeout(()=>{var S;return(S=Ie.current)==null?void 0:S.focus()},50)}},[e,t==null?void 0:t.id,a]),te.default.useEffect(()=>{!e||!t||(ve==="comments"?(it(t.id),$e(t.id)):ve==="files"&&$e(t.id))},[ve,e,t==null?void 0:t.id]),te.default.useEffect(()=>{if(!e||!t||Oe!==Le.current||we!==Me.current)return;let $=(t.title??"").trim(),Q=(t.description??"").trim();($!==Le.current||Q!==Me.current)&&(Ke($),ye(Q),Le.current=$,Me.current=Q),t.status&&t.status!==gt&&ht(t.status),t.type&&t.type!==et&&ha(t.type),t.priority!==void 0&&t.priority!==Bt&&xa(t.priority??""),t.model&&t.model!==pr&&Ot(t.model),t.agent&&t.agent!==dl&&Go(t.agent)},[t==null?void 0:t.title,t==null?void 0:t.description,t==null?void 0:t.status,t==null?void 0:t.type,t==null?void 0:t.priority,t==null?void 0:t.model,t==null?void 0:t.agent]),te.default.useEffect(()=>{!e||!t||C===void 0||(ve==="comments"?it(t.id):Pe(t.id))},[C]);async function Pe(S){var $,Q;try{let[ze,ke]=await Promise.all([i.getComments(S),i.getFiles(S)]);to((($=ze.comments)==null?void 0:$.length)??0),b(((Q=ke.files)==null?void 0:Q.length)??0)}catch{}}async function it(S){var Q;let $=++hr.current;Ko(!0),cl(null);try{let ze=await i.getComments(S);if(hr.current!==$)return;fl(ze.comments??[]),to(((Q=ze.comments)==null?void 0:Q.length)??0)}catch{if(hr.current!==$)return;cl("failed")}finally{hr.current===$&&Ko(!1)}}async function $e(S){var $;gl(!0),jo(null);try{let Q=await i.getFiles(S);ml(Q.files??[]),b((($=Q.files)==null?void 0:$.length)??0)}catch{jo("failed")}finally{gl(!1)}}async function Ea(){var S;if(!Oe.trim()){(S=Ie.current)==null||S.focus();return}if(!J&&Da.trim()&&await ii(),J){let $=await p({title:Oe.trim(),description:we.trim()||Oe.trim(),status:gt,type:et,priority:Bt||void 0,selector:"/",tags:H.length>0?H:void 0});if($&&B.length>0){for(let Q of B)await i.uploadFile($,Q).catch(()=>null);A([])}d()}else xr()}function xr(){if(!t||J)return;let S=Oe.trim();if(!S)return;let $=Le.current,Q=Me.current,ze=S!==$,ke=we.trim()!==Q;!ze&&!ke||(ze&&vr("title",$,S),ke&&vr("description",Q,we.trim()),L(t.id,{title:S,description:we.trim(),type:et,priority:Bt||void 0}),Le.current=S,Me.current=we.trim())}pe.current=xr;function vr(S,$,Q){$!==Q&&se(ze=>[...ze,{field:S,from:$,to:Q,actor:o,timestamp:new Date().toISOString()}])}async function ii(){if(!(!t||!Da.trim())){pl(!0);try{await i.addComment(t.id,Da.trim()),Zr(""),await it(t.id)}finally{pl(!1)}}}async function bg(S,$){t&&(await i.updateComment(t.id,S.id,$),await it(t.id))}async function Tg(S){t&&(await i.deleteComment(t.id,S.id),await it(t.id))}async function Pg(S){if(!t)return;let $=t.id;X(null);for(let Q of Array.from(S.target.files??[])){if(!Q.type.startsWith("image/")&&Q.size>Zv){X(`"${Q.name}" exceeds the 5 MB limit and was skipped.`);continue}let ze;if(Q.type.startsWith("image/")){let ke=await Kd(Q),jt=Q.name.replace(/\\.(png|bmp|gif|webp|tiff?)$/i,".jpg");ze=new File([ke],jt,{type:"image/jpeg"})}else ze=Q;await i.uploadFile($,ze)}S.target.value="",await $e($),Pe($)}async function Rg(S){if(!t)return;X(null);let $=await Kd(S),ze=`paste-${new Date().toISOString().replace(/[:.]/g,"-").slice(0,19)}.jpg`,ke=new File([$],ze,{type:"image/jpeg"});await i.uploadFile(t.id,ke),await $e(t.id),Pe(t.id)}async function Mg(S){if(!t)return;let $=Array.from(S.items),Q=$.find(ke=>ke.type.startsWith("image/"));if(Q){let ke=Q.getAsFile();ke&&await Rg(ke);return}let ze=$.filter(ke=>ke.kind==="file"&&!ke.type.startsWith("image/"));if(ze.length>0){for(let ke of ze){let jt=ke.getAsFile();jt&&await i.uploadFile(t.id,jt)}await $e(t.id),Pe(t.id);return}}te.default.useEffect(()=>{if(!e)return;function S($){if(!$.clipboardData)return;let Q=$.target;if(!((Q.tagName==="TEXTAREA"||Q.tagName==="INPUT"||Q.isContentEditable)&&!Array.from($.clipboardData.items).some(Xt=>Xt.kind==="file"))){if($.preventDefault(),!t){let jt=Array.from($.clipboardData.items).find(Xt=>Xt.type.startsWith("image/"));if(jt){let Xt=jt.getAsFile();Xt&&(async()=>{let xl=await Kd(Xt),ao=new Date().toISOString().replace(/[:.]/g,"-").slice(0,19),vl=new File([xl],`paste-${ao}.jpg`,{type:"image/jpeg"});A(Og=>[...Og,vl])})()}return}Mg($.clipboardData)}}return document.addEventListener("paste",S),()=>document.removeEventListener("paste",S)},[e,t==null?void 0:t.id]);async function ef(S){t&&(await i.deleteFile(t.id,S.name),await $e(t.id),Pe(t.id))}async function Ag(S){if(!t)return;await i.deleteFile(t.id,S);let $=(t.files??[]).filter(Q=>Q.name!==S);L(t.id,{files:$}),await $e(t.id),Pe(t.id)}function Dg(S){ht(S),!J&&t&&L(t.id,{status:S})}let Eg=S=>S!==gt?"dp-status-btn":`dp-status-btn active-${S}`;function tf(){if(!P.current){if(he.current.trim().length>0){pe.current(),va(!0);return}pe.current(),d()}}let Fg=e&&t!=null&&(Oe!==Le.current||we!==Me.current),Bg=te.default.useMemo(()=>{let S=[...N,...de].sort((Q,ze)=>new Date(Q.timestamp).getTime()-new Date(ze.timestamp).getTime()),$=[];for(let Q of S)$.some(ke=>ke.field===Q.field&&ke.from.toLowerCase()===Q.from.toLowerCase()&&ke.to.toLowerCase()===Q.to.toLowerCase()&&ke.actor===Q.actor&&Math.abs(new Date(ke.timestamp).getTime()-new Date(Q.timestamp).getTime())<=3e3)||$.push(Q);return $},[N,de]),yr=!J&&!!u;return(0,D.jsxs)(D.Fragment,{children:[(0,D.jsxs)("aside",{id:"detail-panel",className:"open",ref:V,children:[yr&&(0,D.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:8,padding:"8px 12px",background:"rgba(234,88,12,0.12)",border:"1px solid rgba(234,88,12,0.25)",borderRadius:6,margin:"8px 12px 0",fontSize:12,color:"#f97316",fontWeight:500},children:["\\u{1F512} Locked by ",(0,D.jsx)("strong",{children:u})," \\u2014 editing disabled until they finish."]}),(0,D.jsxs)("div",{className:"dp-header",children:[(0,D.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:8,marginBottom:10},children:[f&&(0,D.jsx)("button",{id:"dp-back",onClick:f,title:v?`Back to: ${v}`:"Go back",style:{width:26,height:26,flexShrink:0,display:"flex",alignItems:"center",justifyContent:"center",borderRadius:6,border:"1px solid var(--p-border-t)",background:"transparent",color:"var(--p-text-g)",cursor:"pointer",transition:"background .12s,color .12s",fontSize:14,lineHeight:1},onMouseOver:S=>{S.currentTarget.style.background="var(--p-border)",S.currentTarget.style.color="var(--p-blue-300)",S.currentTarget.style.borderColor="var(--p-blue)"},onMouseOut:S=>{S.currentTarget.style.background="transparent",S.currentTarget.style.color="var(--p-text-g)",S.currentTarget.style.borderColor="var(--p-border-t)"},children:"\\u2190"}),(0,D.jsx)(Qs,{id:"dp-type-picker",value:et,disabled:yr,onChange:S=>{!J&&t&&S!==et&&vr("type",et,S),ha(S),!J&&t&&L(t.id,{type:S})}}),(0,D.jsx)("input",{id:"dp-title",ref:Ie,className:"dp-input",type:"text",placeholder:"Task title\\u2026",value:Oe,readOnly:yr,onChange:S=>Ke(S.target.value),onKeyDown:S=>{S.key==="Escape"&&(S.stopPropagation(),tf()),S.key==="Enter"&&J&&Ea()},style:{flex:1,fontSize:14,fontWeight:600,padding:"4px 8px",borderColor:"transparent",background:"transparent"},onFocus:S=>{S.currentTarget.style.borderColor="var(--p-blue)",S.currentTarget.style.background="var(--p-input)"},onBlur:S=>{S.currentTarget.style.borderColor="transparent",S.currentTarget.style.background="transparent",J||xr()}}),!J&&Oe!==Le.current&&Oe.trim()!==""&&(0,D.jsx)("button",{type:"button",title:"Discard title changes",onMouseDown:S=>{S.preventDefault(),Ke(Le.current)},style:{width:20,height:20,flexShrink:0,display:"flex",alignItems:"center",justifyContent:"center",borderRadius:4,border:"1px solid var(--p-border-t)",background:"none",color:"var(--p-text-g)",cursor:"pointer",fontSize:13,lineHeight:1},onMouseEnter:S=>{S.currentTarget.style.color="var(--p-amber-300)",S.currentTarget.style.borderColor="var(--p-amber-300)"},onMouseLeave:S=>{S.currentTarget.style.color="var(--p-text-g)",S.currentTarget.style.borderColor="var(--p-border-t)"},children:"\\u21A9"}),(0,D.jsx)("button",{id:"dp-close",onClick:tf,style:{width:26,height:26,flexShrink:0,display:"flex",alignItems:"center",justifyContent:"center",borderRadius:6,border:"none",background:"transparent",color:"var(--p-text-g)",cursor:"pointer",transition:"background .12s,color .12s",pointerEvents:"auto"},onMouseOver:S=>{S.currentTarget.style.background="var(--p-border)",S.currentTarget.style.color="var(--p-text-m)"},onMouseOut:S=>{S.currentTarget.style.background="transparent",S.currentTarget.style.color="var(--p-text-g)"},children:(0,D.jsx)(Ge,{style:{width:14,height:14}})}),m&&Fg&&t&&(0,D.jsx)("span",{id:"dp-lock-indicator",title:`Locked by ${o} \\u2014 unsaved changes`,style:{display:"inline-flex",alignItems:"center",gap:3,flexShrink:0,borderRadius:999,padding:"2px 7px",fontSize:10,fontWeight:600,border:"1px solid rgba(244,114,182,0.35)",color:"#f9a8d4",background:"rgba(157,23,77,0.28)"},children:"\\u{1F512} Locked"})]}),(0,D.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:6,flexWrap:"wrap",...yr?{pointerEvents:"none",opacity:.6}:{}},children:[(0,D.jsx)("span",{style:{fontSize:10,color:"var(--p-text-g)",fontWeight:500,textTransform:"uppercase",letterSpacing:"0.04em"},children:"Status"}),Yv.map(S=>(0,D.jsx)("button",{className:Eg(S.id),"data-status":S.id,onClick:()=>Dg(S.id),children:S.label},S.id))]})]}),!J&&(0,D.jsxs)("div",{className:"dp-tabs",id:"dp-tabs-row",children:[(0,D.jsx)("button",{className:`dp-tab${ve==="details"?" active":""}`,id:"dp-tab-details",onClick:()=>Xe("details"),children:"Details"}),(0,D.jsxs)("button",{className:`dp-tab${ve==="comments"?" active":""}`,id:"dp-tab-activity",onClick:()=>Xe("comments"),children:["Activity ",hl>0&&(0,D.jsxs)("span",{id:"dp-activity-count",style:{color:"var(--p-text-g)",fontSize:10},children:["(",hl,")"]})]}),(0,D.jsxs)("button",{className:`dp-tab${ve==="files"?" active":""}`,id:"dp-tab-files",onClick:()=>Xe("files"),children:["Files ",h>0&&(0,D.jsxs)("span",{id:"dp-file-count",style:{color:"var(--p-text-g)",fontSize:10},children:["(",h,")"]})]}),ue===!0&&(0,D.jsxs)("button",{className:`dp-tab${ve==="agent"?" active":""}`,id:"dp-tab-agent",onClick:()=>Xe("agent"),style:{color:ve==="agent"?"#c4b5fd":void 0,borderBottomColor:ve==="agent"?"#a78bfa":void 0},children:["\\u{1F916} Agent",y&&y.status!=="idle"&&(0,D.jsx)("span",{style:{display:"inline-flex",alignItems:"center",justifyContent:"center",width:14,height:12,borderRadius:10,fontSize:9,fontWeight:700,background:"#a78bfa",color:"#fff",marginLeft:4},children:y.status==="running"?"\\u25CF":y.status==="queued"?"\\u23F3":"\\u2713"})]})]}),(0,D.jsxs)("div",{className:"dp-body",children:[!J&&(0,D.jsx)(Qv,{}),(0,D.jsxs)("div",{className:"dp-pane",id:"dp-details-pane",style:{display:!t||ve==="details"?"":"none"},children:[(0,D.jsx)("div",{style:yr?{pointerEvents:"none",opacity:.6,flexShrink:0}:{flexShrink:0},children:(0,D.jsx)(_d,{task:t,description:we,setDescription:ye,showDescPreview:Xr,setShowDescPreview:$o,priority:Bt,setPriority:xa,onDescriptionBlur:J?void 0:xr,onDescriptionDiscard:J?void 0:()=>{ye(Me.current),$o(!0)},originalDescription:J?void 0:Me.current,onPriorityChange:J?void 0:S=>{t&&(S!==Bt&&vr("priority",Bt||"\\u2014",S||"\\u2014"),L(t.id,{priority:S||void 0}))},githubUrl:n,onFilePreview:x,onDeleteScreenshot:Ag,onPatch:L,liveFiles:Jr.length>0||eo?Jr:void 0,allTags:rt,overrideTags:J?H:void 0,onTagsChange:J?ae:void 0})}),!J&&t&&(0,D.jsx)("div",{style:{display:"flex",alignItems:"center",gap:8,flexWrap:"wrap",flexShrink:0,marginTop:12,borderTop:"1px solid var(--p-border)",paddingTop:10},children:(0,D.jsx)(Jv,{task:t})})]}),(0,D.jsxs)("div",{className:"dp-pane",id:"dp-activity-pane",style:{display:ve==="comments"&&!J?"":"none"},children:[(0,D.jsx)("div",{style:{borderBottom:"1px solid var(--p-border)",paddingBottom:8,flexShrink:0},children:(0,D.jsx)(Wd,{commentInput:Da,setCommentInput:Zr,commentSubmitting:gr,onSubmit:()=>void ii(),baseRows:2})}),(0,D.jsx)(Nd,{comments:ni,files:Jr,localChanges:Bg,loading:li,error:mr,gitUserName:o,taskAuthorName:t==null?void 0:t.authorName,baseUrl:l,taskId:t==null?void 0:t.id,taskCreatedAt:t==null?void 0:t.createdAt,taskUpdatedAt:t==null?void 0:t.updatedAt,onEdit:bg,onDelete:Tg,onDeleteFile:ef,onFilePreview:x})]}),(0,D.jsxs)("div",{className:"dp-pane",id:"dp-files-pane",style:{display:ve==="files"&&!J?"":"none"},children:[(0,D.jsx)(Ud,{files:Jr,loading:eo,error:si,baseUrl:l,onPreview:S=>x(S.name,S.linkedPath?`${l}/api/tasks/${t==null?void 0:t.id}/files/${encodeURIComponent(S.name)}`:`${l}${S.url}`),onDelete:yr?void 0:ef}),(0,D.jsxs)("div",{style:{borderTop:"1px solid var(--p-border)",paddingTop:8,flexShrink:0,display:"flex",gap:8,flexWrap:"wrap",alignItems:"center",...yr?{pointerEvents:"none",opacity:.5}:{}},children:[O&&(0,D.jsx)("div",{style:{width:"100%",fontSize:11,color:"var(--p-red)",background:"rgba(255,80,80,0.08)",border:"1px solid rgba(255,80,80,0.2)",borderRadius:5,padding:"4px 8px"},children:O}),(0,D.jsxs)("label",{style:{display:"flex",alignItems:"center",gap:6,cursor:"pointer",padding:"6px 10px",background:"var(--p-card)",border:"1px solid var(--p-border)",borderRadius:8,color:"var(--p-text-m)",fontSize:12,transition:"all .15s"},onMouseOver:S=>{S.currentTarget.style.borderColor="var(--p-border-t)",S.currentTarget.style.color="var(--p-text)"},onMouseOut:S=>{S.currentTarget.style.borderColor="var(--p-border)",S.currentTarget.style.color="var(--p-text-m)"},children:[(0,D.jsx)(zo,{style:{width:12,height:12}}),"Upload",(0,D.jsx)("input",{id:"dp-file-upload",type:"file",style:{display:"none"},multiple:!0,onChange:Pg})]}),(0,D.jsx)("span",{style:{fontSize:11,color:"var(--p-border-t)",marginLeft:"auto"},children:"or paste image"})]})]}),ue===!0&&(0,D.jsx)("div",{className:"dp-pane",id:"dp-agent-pane",style:{display:ve==="agent"&&!J&&t?"":"none"},children:t&&(0,D.jsx)(Gd,{task:t,run:y,onRun:(S,$,Q)=>k==null?void 0:k(S,$,Q),onStop:z??(()=>{}),onDequeue:U??(()=>{}),models:F,defaultModel:Z,onModelChange:ri,agents:Te,onAgentChange:oi})})]}),(0,D.jsxs)("div",{className:"dp-footer",children:[!J&&(0,D.jsx)("button",{id:"dp-delete",onClick:()=>Qr(!0),style:{color:"var(--p-red)",background:"none",border:"1px solid var(--p-border-t)",borderRadius:7,padding:"5px 12px",fontSize:12,cursor:"pointer",fontFamily:"inherit",transition:"all .15s"},onMouseOver:S=>{S.currentTarget.style.borderColor="var(--p-red)"},onMouseOut:S=>{S.currentTarget.style.borderColor="var(--p-border-t)"},children:"Delete"}),(0,D.jsx)("div",{style:{flex:1}}),J?(0,D.jsxs)(D.Fragment,{children:[B.length>0&&(0,D.jsxs)("span",{style:{fontSize:11,color:"var(--p-blue-300)",marginRight:8,background:"rgba(37,99,235,0.1)",border:"1px solid rgba(37,99,235,0.25)",borderRadius:6,padding:"3px 8px"},children:["\\u{1F4CE} ",B.length," screenshot",B.length!==1?"s":""," will attach on save"]}),(0,D.jsx)("button",{id:"dp-cancel",onClick:d,style:{padding:"5px 14px",borderRadius:7,fontSize:12,fontWeight:500,cursor:"pointer",border:"1px solid var(--p-border-t)",background:"var(--p-border)",color:"var(--p-text-sub)",fontFamily:"inherit",transition:"all .15s"},onMouseOver:S=>{S.currentTarget.style.borderColor="var(--p-text-g)"},onMouseOut:S=>{S.currentTarget.style.borderColor="var(--p-border-t)"},children:"Cancel"}),(0,D.jsx)("button",{id:"dp-save",onClick:()=>void Ea(),style:{padding:"5px 18px",borderRadius:7,fontSize:12,fontWeight:500,cursor:"pointer",border:"1px solid var(--p-blue-700)",background:"var(--p-blue)",color:"var(--p-white)",fontFamily:"inherit",transition:"background .15s"},onMouseOver:S=>{S.currentTarget.style.background="var(--p-blue-700)"},onMouseOut:S=>{S.currentTarget.style.background="var(--p-blue)"},children:"Add Task"})]}):ue===!0&&ve==="agent"&&t?(0,D.jsxs)("div",{style:{display:"flex",gap:8,alignItems:"center",justifyContent:"flex-end",flex:1},children:[(!y||y.status==="idle")&&(0,D.jsxs)("button",{id:"dp-run-agent",onClick:()=>k==null?void 0:k(t.id,pr,dl||void 0),style:{display:"inline-flex",alignItems:"center",gap:6,padding:"5px 14px",borderRadius:7,border:"1px solid var(--p-purple)",background:"var(--p-purple)",color:"#fff",fontSize:12,fontWeight:600,cursor:"pointer",transition:"background .12s"},onMouseEnter:S=>{S.currentTarget.style.background="#9333ea"},onMouseLeave:S=>{S.currentTarget.style.background="var(--p-purple)"},children:[(0,D.jsx)(Hr,{style:{width:12,height:12}}),"Run Agent"]}),(y==null?void 0:y.status)==="running"&&(0,D.jsxs)("button",{id:"dp-stop-agent",onClick:()=>z==null?void 0:z(t.id),style:{display:"inline-flex",alignItems:"center",gap:6,padding:"5px 14px",borderRadius:7,border:"1px solid var(--p-red)",background:"color-mix(in srgb, var(--p-red) 15%, transparent)",color:"var(--p-red)",fontSize:12,fontWeight:600,cursor:"pointer",transition:"background .12s"},onMouseEnter:S=>{S.currentTarget.style.background="color-mix(in srgb, var(--p-red) 25%, transparent)"},onMouseLeave:S=>{S.currentTarget.style.background="color-mix(in srgb, var(--p-red) 15%, transparent)"},children:[(0,D.jsx)(Wr,{style:{width:12,height:12}}),"Stop"]}),(y==null?void 0:y.status)==="queued"&&(0,D.jsxs)("button",{id:"dp-dequeue-agent",onClick:()=>U==null?void 0:U(t.id),style:{display:"inline-flex",alignItems:"center",gap:6,padding:"5px 14px",borderRadius:7,border:"1px solid var(--p-red)",background:"color-mix(in srgb, var(--p-red) 15%, transparent)",color:"var(--p-red)",fontSize:12,fontWeight:600,cursor:"pointer",transition:"background .12s"},onMouseEnter:S=>{S.currentTarget.style.background="color-mix(in srgb, var(--p-red) 25%, transparent)"},onMouseLeave:S=>{S.currentTarget.style.background="color-mix(in srgb, var(--p-red) 15%, transparent)"},children:[(0,D.jsx)(Zn,{style:{width:12,height:12}}),"Dequeue"]})]}):(0,D.jsx)("span",{style:{fontSize:11,color:"var(--p-text-g)",padding:"5px 4px"},children:"Changes are saved automatically"})]}),(0,D.jsx)(ga,{open:Vo,title:"Delete task?",message:`You are about to permanently delete "${(t==null?void 0:t.title)||"this task"}". This action cannot be undone.`,confirmLabel:"Delete task",onConfirm:()=>{Qr(!1),g(t.id),d()},onCancel:()=>Qr(!1)})]}),Yr&&(0,D.jsx)("div",{style:{position:"fixed",inset:0,zIndex:201,display:"flex",alignItems:"center",justifyContent:"center",backdropFilter:"blur(8px)",WebkitBackdropFilter:"blur(8px)",background:"rgba(2,12,27,0.80)"},children:(0,D.jsxs)("div",{style:{background:"var(--p-surface)",border:"1px solid var(--p-border-s)",borderRadius:16,padding:"28px 32px",width:"100%",maxWidth:480,boxShadow:"var(--p-shadow-lg)",position:"relative"},children:[(0,D.jsx)("div",{style:{width:44,height:44,borderRadius:12,background:"rgba(139,92,246,0.12)",border:"1px solid rgba(139,92,246,0.25)",display:"flex",alignItems:"center",justifyContent:"center",marginBottom:16},children:(0,D.jsx)(zo,{style:{width:20,height:20,color:"var(--p-purple)"}})}),(0,D.jsx)("h2",{style:{margin:"0 0 8px",fontSize:17,fontWeight:700,color:"var(--p-text)"},children:"Send comment?"}),(0,D.jsx)("p",{style:{margin:"0 0 22px",fontSize:13,color:"var(--p-text-f)",lineHeight:1.6},children:"You have an unsent comment. Do you want to send it before closing?"}),(0,D.jsxs)("div",{style:{display:"flex",gap:8},children:[(0,D.jsx)("button",{onClick:()=>{va(!1),ii().then(()=>d())},style:{flex:1,padding:"9px 14px",borderRadius:8,background:"var(--p-purple)",border:"none",color:"#fff",fontSize:13,fontWeight:600,cursor:"pointer",whiteSpace:"nowrap"},children:"Send & Close"}),(0,D.jsx)("button",{type:"button",onClick:()=>{va(!1),Zr(""),d()},style:{padding:"9px 16px",borderRadius:8,background:"var(--p-hover)",border:"1px solid var(--p-border)",color:"var(--p-text-m)",fontSize:13,cursor:"pointer"},children:"Discard & Close"}),(0,D.jsx)("button",{type:"button",onClick:()=>va(!1),style:{padding:"9px 16px",borderRadius:8,background:"var(--p-hover)",border:"1px solid var(--p-border)",color:"var(--p-text-m)",fontSize:13,cursor:"pointer"},children:"Keep editing"})]})]})})]})}function Jv({task:e}){let t=[];if(e.component&&t.push((0,D.jsxs)("span",{style:{display:"inline-flex",alignItems:"center",gap:4,padding:"2px 8px",background:"color-mix(in srgb, var(--p-purple) 14%, transparent)",border:"1px solid color-mix(in srgb, var(--p-purple) 36%, transparent)",borderRadius:100,fontSize:10,color:"var(--p-purple-300)",fontFamily:"monospace"},children:["\\u2B21 ",e.component]},"component")),e.file||e.selector&&e.selector!=="/"||e.cssSelector){let r=e.file??"";e.line!=null&&(r+=`:${e.line}`),e.col!=null&&(r+=`:${e.col}`);let o=e.cssSelector??(e.selector&&e.selector!=="/"?e.selector:""),n=r||o;if(n){let l=n.length>40?`\\u2026${n.slice(-40)}`:n,s=e.url?e.url.length>30?`\\u2026${e.url.slice(-30)}`:e.url:"";t.push((0,D.jsxs)("span",{style:{display:"inline-flex",alignItems:"center",gap:0,borderRadius:6,overflow:"hidden",border:"1px solid color-mix(in srgb, var(--p-blue) 15%, transparent)",fontSize:10,fontFamily:"monospace",whiteSpace:"nowrap"},children:[(0,D.jsx)("span",{title:[r,o].filter(Boolean).join(" \\xB7 "),style:{padding:"2px 6px",background:"color-mix(in srgb, var(--p-blue) 10%, transparent)",color:"var(--p-blue-300)"},children:l}),s&&(0,D.jsx)("span",{title:e.url,style:{padding:"2px 6px",background:"color-mix(in srgb, var(--p-border) 72%, transparent)",color:"var(--p-text-g)",borderLeft:"1px solid color-mix(in srgb, var(--p-blue) 18%, transparent)"},children:s})]},"source"))}}else if(e.url){let r=e.url.length>40?`\\u2026${e.url.slice(-40)}`:e.url;t.push((0,D.jsx)("span",{className:"dp-source-pill",title:e.url,children:r},"url"))}return e.reportBack&&t.push((0,D.jsx)("span",{style:{display:"inline-flex",alignItems:"center",gap:4,padding:"2px 8px",background:"color-mix(in srgb, var(--p-purple) 10%, transparent)",border:"1px solid color-mix(in srgb, var(--p-purple) 24%, transparent)",borderRadius:100,fontSize:10,color:"var(--p-purple-300)"},children:"\\u21A9 report back"},"rb")),(0,D.jsx)("div",{id:"dp-meta-row",style:{display:"flex",alignItems:"center",gap:6,flexWrap:"wrap",flex:1},children:t})}var jr=E(De(),1);var ne=E(K(),1),ey=[{id:"all",label:"All",dot:""},{id:"todo",label:"Todo",dot:"var(--p-amber)"},{id:"in-progress",label:"In Progress",dot:"var(--p-blue)"},{id:"review",label:"Review",dot:"var(--p-purple)"}],ty={todo:{background:"color-mix(in srgb, var(--p-amber) 16%, transparent)",border:"1px solid color-mix(in srgb, var(--p-amber) 38%, transparent)",color:"var(--p-amber-300)"},"in-progress":{background:"color-mix(in srgb, var(--p-blue) 16%, transparent)",border:"1px solid color-mix(in srgb, var(--p-blue) 38%, transparent)",color:"var(--p-blue-200)"},review:{background:"color-mix(in srgb, var(--p-purple) 16%, transparent)",border:"1px solid color-mix(in srgb, var(--p-purple) 38%, transparent)",color:"var(--p-purple-300)"},done:{background:"color-mix(in srgb, var(--p-green) 14%, transparent)",border:"1px solid color-mix(in srgb, var(--p-green) 32%, transparent)",color:"var(--p-green-300)"},backlog:{background:"color-mix(in srgb, var(--p-text-g) 16%, transparent)",border:"1px solid color-mix(in srgb, var(--p-text-g) 32%, transparent)",color:"var(--p-text-m)"},all:{background:"color-mix(in srgb, var(--p-blue) 12%, transparent)",border:"1px solid color-mix(in srgb, var(--p-blue) 32%, transparent)",color:"var(--p-blue-200)"}};function Xd({tasks:e,filter:t,onFilter:a,view:r="board",onViewChange:o,activityCounter:n}){let[l,s]=jr.default.useState(!1),[i,d]=jr.default.useState(!1),[c,p]=jr.default.useState(!1),g=jr.default.useMemo(()=>[...new Set(e.map(y=>y.type).filter(Boolean))].sort(),[e]),L=jr.default.useMemo(()=>[...new Set(e.map(y=>y.author).filter(Boolean))].sort(),[e]),x=jr.default.useMemo(()=>{let y=new Set;for(let k of e)for(let z of k.tags??[])y.add(z);return[...y].sort()},[e]);function I(y){return e.filter(k=>k.status===y).length}function N(y){a({...t,status:y}),s(!1),d(!1),p(!1)}function m(y){a({...t,type:y}),s(!1)}function u(y){a({...t,user:y}),d(!1)}function f(y){let k=t.tags??[],z=k.includes(y)?k.filter(U=>U!==y):[...k,y];a({...t,tags:z})}function v(y){y.stopPropagation();let k=y.currentTarget.dataset.status;k&&N(k)}let C={display:"flex",alignItems:"center",gap:5,padding:"3px 10px",borderRadius:6,fontSize:11,cursor:"pointer",border:"1px solid transparent",background:"transparent",color:"var(--p-text-f)",transition:"all .12s",fontFamily:"inherit",fontWeight:500},w={...C,background:"var(--p-card)",border:"1px solid var(--p-border)",color:"var(--p-text-f)",padding:"3px 10px",position:"relative"};return(0,ne.jsxs)("div",{"data-proto-id":"filter-bar",style:{display:"flex",alignItems:"center",gap:6,padding:"7px 16px",background:"var(--p-surface)",borderBottom:"1px solid var(--p-border)",flexShrink:0},onClick:()=>{s(!1),d(!1),p(!1)},children:[(0,ne.jsx)("div",{style:{display:"flex",alignItems:"center",gap:2},children:ey.map(y=>{let k=t.status===y.id,z=y.id!=="all"?I(y.id):null,U=k?ty[y.id]:{};return(0,ne.jsxs)("button",{"data-status":y.id,style:{...C,...U},onMouseOver:F=>{k||(F.currentTarget.style.background="var(--p-hover)",F.currentTarget.style.color="var(--p-text-m)")},onMouseOut:F=>{k||(F.currentTarget.style.background="transparent",F.currentTarget.style.color="var(--p-text-f)")},onClick:v,children:[y.dot&&(0,ne.jsx)("span",{style:{width:6,height:6,borderRadius:"50%",background:y.dot,flexShrink:0,display:"inline-block"}}),y.label,z!=null&&(0,ne.jsx)("span",{style:{color:k?"inherit":"var(--p-border-t)",fontSize:10,opacity:.8},children:z})]},y.id)})}),(0,ne.jsx)("div",{style:{flex:1}}),n,t.user&&(0,ne.jsxs)("span",{style:{display:"inline-flex",alignItems:"center",gap:4,padding:"2px 8px",borderRadius:100,background:"color-mix(in srgb, var(--p-purple) 10%, transparent)",border:"1px solid color-mix(in srgb, var(--p-purple) 24%, transparent)",fontSize:10,color:"var(--p-purple-300)"},children:[t.user,(0,ne.jsx)("button",{onClick:()=>u(null),style:{display:"flex",background:"none",border:"none",color:"var(--p-purple-300)",cursor:"pointer",padding:0,lineHeight:1},children:(0,ne.jsx)(Ge,{style:{width:10,height:10}})})]}),t.type&&(0,ne.jsxs)("span",{style:{display:"inline-flex",alignItems:"center",gap:4,padding:"2px 8px",borderRadius:100,background:"color-mix(in srgb, var(--p-blue) 10%, transparent)",border:"1px solid color-mix(in srgb, var(--p-blue) 24%, transparent)",fontSize:10,color:"var(--p-cyan-300)"},children:[t.type,(0,ne.jsx)("button",{onClick:()=>m(null),style:{display:"flex",background:"none",border:"none",color:"var(--p-cyan-300)",cursor:"pointer",padding:0,lineHeight:1},children:(0,ne.jsx)(Ge,{style:{width:10,height:10}})})]}),(t.tags??[]).map(y=>{let{bg:k,text:z,border:U}=oa(y);return(0,ne.jsxs)("span",{style:{display:"inline-flex",alignItems:"center",gap:4,padding:"2px 8px",borderRadius:100,background:k,border:`1px solid ${U}`,fontSize:10,color:z,fontWeight:600},children:[y,(0,ne.jsx)("button",{onClick:()=>f(y),style:{display:"flex",background:"none",border:"none",color:z,cursor:"pointer",padding:0,lineHeight:1},children:(0,ne.jsx)(Ge,{style:{width:10,height:10}})})]},y)}),(0,ne.jsxs)("div",{style:{position:"relative"},children:[(0,ne.jsxs)("button",{style:{...w,color:(t.tags??[]).length?"var(--p-green-300)":"var(--p-text-f)",borderColor:(t.tags??[]).length?"color-mix(in srgb, var(--p-green) 36%, transparent)":"var(--p-border)",opacity:x.length?1:.55},onClick:y=>{y.stopPropagation(),x.length&&(d(!1),s(!1),p(k=>!k))},children:[(0,ne.jsx)(Oo,{style:{width:12,height:12}}),"Tags",(t.tags??[]).length>0&&(0,ne.jsx)("span",{style:{fontSize:9,background:"color-mix(in srgb, var(--p-green) 20%, transparent)",color:"var(--p-green-300)",borderRadius:100,padding:"0 4px"},children:(t.tags??[]).length}),(0,ne.jsx)(pa,{style:{width:12,height:12}})]}),c&&x.length>0&&(0,ne.jsxs)("div",{style:{position:"absolute",top:"calc(100% + 4px)",right:0,minWidth:160,background:"var(--p-card)",border:"1px solid var(--p-border-s)",borderRadius:8,boxShadow:"0 8px 24px rgba(0,0,0,0.25)",zIndex:50,overflow:"hidden"},onClick:y=>y.stopPropagation(),children:[(t.tags??[]).length>0&&(0,ne.jsx)("button",{style:{width:"100%",textAlign:"left",padding:"7px 12px",fontSize:11,color:"var(--p-text-f)",background:"none",border:"none",cursor:"pointer",borderBottom:"1px solid var(--p-border)"},onClick:()=>a({...t,tags:[]}),children:"Clear tag filters"}),x.map(y=>{let{bg:k,text:z,border:U}=oa(y),F=(t.tags??[]).includes(y);return(0,ne.jsxs)("button",{style:{width:"100%",textAlign:"left",padding:"6px 12px",fontSize:11,color:"var(--p-text-m)",background:F?"var(--p-hover)":"none",border:"none",cursor:"pointer",display:"flex",alignItems:"center",gap:6},onMouseEnter:Z=>{Z.currentTarget.style.background="var(--p-hover)"},onMouseLeave:Z=>{Z.currentTarget.style.background=F?"var(--p-hover)":"none"},onClick:()=>f(y),children:[(0,ne.jsx)("span",{style:{width:8,height:8,borderRadius:"50%",background:z,border:`1px solid ${U}`,flexShrink:0}}),(0,ne.jsx)("span",{style:{flex:1},children:y}),F&&(0,ne.jsx)("span",{style:{color:z,fontSize:12,lineHeight:1},children:"\\u2713"})]},y)})]})]}),(0,ne.jsxs)("div",{style:{position:"relative"},children:[(0,ne.jsxs)("button",{style:{...w,color:t.user?"var(--p-purple-300)":"var(--p-text-f)",borderColor:t.user?"color-mix(in srgb, var(--p-purple) 36%, transparent)":"var(--p-border)",opacity:L.length?1:.55},onClick:y=>{y.stopPropagation(),L.length&&(s(!1),d(k=>!k))},children:[(0,ne.jsx)(Jn,{style:{width:12,height:12}}),"User",(0,ne.jsx)(pa,{style:{width:12,height:12}})]}),i&&L.length>0&&(0,ne.jsxs)("div",{style:{position:"absolute",top:"calc(100% + 4px)",right:0,minWidth:160,background:"var(--p-card)",border:"1px solid var(--p-border-s)",borderRadius:8,boxShadow:"0 8px 24px rgba(0,0,0,0.25)",zIndex:50,overflow:"hidden"},onClick:y=>y.stopPropagation(),children:[(0,ne.jsx)("button",{style:{width:"100%",textAlign:"left",padding:"7px 12px",fontSize:11,color:"var(--p-text-f)",background:"none",border:"none",cursor:"pointer",borderBottom:"1px solid var(--p-border)"},onClick:()=>u(null),children:"All users"}),L.map(y=>(0,ne.jsx)("button",{style:{width:"100%",textAlign:"left",padding:"7px 12px",fontSize:11,color:t.user===y?"var(--p-purple-300)":"var(--p-text-m)",background:t.user===y?"color-mix(in srgb, var(--p-purple) 12%, transparent)":"none",border:"none",cursor:"pointer"},onMouseOver:k=>{t.user!==y&&(k.currentTarget.style.background="var(--p-hover)")},onMouseOut:k=>{t.user!==y&&(k.currentTarget.style.background="none")},onClick:()=>u(y),children:y},y))]})]}),(0,ne.jsxs)("div",{style:{position:"relative"},children:[(0,ne.jsxs)("button",{style:{...w,color:t.type?"var(--p-cyan-300)":"var(--p-text-f)",borderColor:t.type?"color-mix(in srgb, var(--p-blue) 36%, transparent)":"var(--p-border)",opacity:g.length?1:.55},onClick:y=>{y.stopPropagation(),g.length&&s(k=>!k)},children:[(0,ne.jsx)(Oo,{style:{width:12,height:12}}),"Type",(0,ne.jsx)(pa,{style:{width:12,height:12}})]}),l&&g.length>0&&(0,ne.jsxs)("div",{style:{position:"absolute",top:"calc(100% + 4px)",right:0,minWidth:140,background:"var(--p-card)",border:"1px solid var(--p-border-s)",borderRadius:8,boxShadow:"0 8px 24px rgba(0,0,0,0.25)",zIndex:50,overflow:"hidden"},onClick:y=>y.stopPropagation(),children:[(0,ne.jsx)("button",{style:{width:"100%",textAlign:"left",padding:"7px 12px",fontSize:11,color:"var(--p-text-f)",background:"none",border:"none",cursor:"pointer",borderBottom:"1px solid var(--p-border)"},onClick:()=>m(null),children:"All types"}),g.map(y=>(0,ne.jsx)("button",{style:{width:"100%",textAlign:"left",padding:"7px 12px",fontSize:11,color:t.type===y?"var(--p-cyan-300)":"var(--p-text-m)",background:t.type===y?"color-mix(in srgb, var(--p-blue) 12%, transparent)":"none",border:"none",cursor:"pointer"},onMouseOver:k=>{t.type!==y&&(k.currentTarget.style.background="var(--p-hover)")},onMouseOut:k=>{t.type!==y&&(k.currentTarget.style.background="none")},onClick:()=>m(y),children:y},y))]})]}),(0,ne.jsxs)("div",{style:{display:"flex",alignItems:"center",background:"var(--p-card)",border:"1px solid var(--p-border)",borderRadius:8,padding:2,gap:0},children:[(0,ne.jsx)("button",{title:"Board view",style:{padding:"4px 7px",borderRadius:5,background:r==="board"?"var(--p-surface)":"none",color:r==="board"?"var(--p-text-sub)":"var(--p-text-g)",border:"none",cursor:"pointer",display:"flex",alignItems:"center",transition:"background .12s,color .12s"},onClick:y=>{y.stopPropagation(),o==null||o("board")},children:(0,ne.jsx)(jn,{style:{width:13,height:13}})}),(0,ne.jsx)("button",{title:"List view",style:{padding:"4px 7px",borderRadius:5,background:r==="list"?"var(--p-surface)":"none",color:r==="list"?"var(--p-text-sub)":"var(--p-text-g)",border:"none",cursor:"pointer",display:"flex",alignItems:"center",transition:"background .12s,color .12s"},onClick:y=>{y.stopPropagation(),o==null||o("list")},children:(0,ne.jsx)(Xn,{style:{width:13,height:13}})})]})]})}var It=E(De(),1);var _=E(K(),1),ay=[{id:"board",label:"Board",icon:(0,_.jsx)(rr,{className:"w-3.5 h-3.5"})},{id:"workflow",label:"Workflow",icon:(0,_.jsx)(el,{className:"w-3.5 h-3.5"})},{id:"agent",label:"Agent",icon:(0,_.jsx)(mt,{className:"w-3.5 h-3.5"})}];function Yd({open:e,visibleCols:t,settings:a,onClose:r,onSave:o,models:n,agents:l}){var T,V;let s=n&&n.length>0?n:sl,[i,d]=It.default.useState("board"),[c,p]=It.default.useState({}),[g,L]=It.default.useState(a.autoCommit??!1),[x,I]=It.default.useState(a.autoComment??!1),[N,m]=It.default.useState(a.autoPush??!1),[u,f]=It.default.useState(a.createBranch??!1),[v,C]=It.default.useState(a.defaultModel??""),[w,y]=It.default.useState(a.defaultAgent??"build"),[k,z]=It.default.useState(a.perTypeModels??!1),[U,F]=It.default.useState(a.defaultModelBug??""),[Z,oe]=It.default.useState(a.defaultModelResearch??""),[fe,Ce]=It.default.useState(a.defaultModelTask??""),[ee,Te]=It.default.useState(a.experimentalAgents??!1);It.default.useEffect(()=>{if(!e)return;let B={};lr.forEach(A=>{B[A.id]=t.includes(A.id)}),p(B),L(a.autoCommit??!1),I(a.autoComment??!1),m(a.autoPush??!1),f(a.createBranch??!1),C(a.defaultModel??""),y(a.defaultAgent??"build"),z(a.perTypeModels??!1),F(a.defaultModelBug??""),oe(a.defaultModelResearch??""),Ce(a.defaultModelTask??""),Te(a.experimentalAgents??!1),d("board")},[e,t,a]);function ue(){let B=lr.filter(A=>c[A.id]).map(A=>A.id);o(B,{autoCommit:g,autoComment:x,autoPush:N,createBranch:u,defaultModel:v,defaultAgent:w,perTypeModels:k,defaultModelBug:U,defaultModelResearch:Z,defaultModelTask:fe,experimentalAgents:ee}),r()}function J(B){p(A=>({...A,[B]:!A[B]}))}return(0,_.jsxs)(Gr,{open:e,onClose:r,id:"settings-modal",width:"min(460px, 95vw)",icon:(0,_.jsx)(_r,{style:{width:14,height:14,color:"var(--p-text-g)"}}),title:"Settings",headerActions:(0,_.jsx)("button",{id:"settings-close",onClick:r,style:{width:26,height:26,display:"flex",alignItems:"center",justifyContent:"center",borderRadius:6,border:"none",background:"transparent",color:"var(--p-text-g)",cursor:"pointer",transition:"background .12s,color .12s"},onMouseOver:B=>{B.currentTarget.style.background="var(--p-surface)",B.currentTarget.style.color="var(--p-text-m)"},onMouseOut:B=>{B.currentTarget.style.background="transparent",B.currentTarget.style.color="var(--p-text-g)"},children:(0,_.jsx)(Ge,{style:{width:14,height:14}})}),footer:(0,_.jsxs)("div",{style:{display:"flex",gap:8},children:[(0,_.jsx)("button",{id:"settings-cancel",onClick:r,className:"dp-status-btn",style:{padding:"5px 14px",fontSize:12},children:"Cancel"}),(0,_.jsx)("button",{id:"settings-apply",onClick:ue,style:{padding:"5px 14px",fontSize:12,fontWeight:500,borderRadius:6,border:"1px solid color-mix(in srgb, var(--p-purple) 55%, transparent)",background:"color-mix(in srgb, var(--p-purple) 18%, transparent)",color:"var(--p-purple-300)",cursor:"pointer",transition:"background .12s"},onMouseOver:B=>{B.currentTarget.style.background="color-mix(in srgb, var(--p-purple) 28%, transparent)"},onMouseOut:B=>{B.currentTarget.style.background="color-mix(in srgb, var(--p-purple) 18%, transparent)"},children:"Apply"})]}),children:[(0,_.jsx)("div",{className:"dp-tabs",children:ay.map(B=>(0,_.jsxs)("button",{onClick:()=>d(B.id),className:`dp-tab${i===B.id?" active":""}`,style:{display:"flex",alignItems:"center",gap:6},children:[B.icon,B.label]},B.id))}),i==="board"&&(0,_.jsxs)("div",{style:{padding:"14px 16px",display:"flex",flexDirection:"column",gap:10},children:[(0,_.jsx)("div",{className:"dp-meta-label",children:"Visible Columns"}),lr.map(B=>(0,_.jsxs)("label",{style:{display:"flex",alignItems:"center",gap:10,cursor:"pointer",userSelect:"none"},children:[(0,_.jsx)("input",{id:`settings-col-${B.id}`,type:"checkbox",checked:c[B.id]??!0,onChange:()=>J(B.id),style:{width:14,height:14,accentColor:B.color,cursor:"pointer"}}),(0,_.jsx)("span",{style:{width:8,height:8,borderRadius:"50%",background:B.color,flexShrink:0}}),(0,_.jsx)("span",{style:{fontSize:13,color:"var(--p-text-m)"},children:B.label})]},B.id))]}),i==="workflow"&&(0,_.jsxs)("div",{style:{padding:"14px 16px",display:"flex",flexDirection:"column",gap:16},children:[(0,_.jsx)(ei,{id:"settings-auto-comment",label:"Comment after task implementation",description:"Agent is instructed to add a summary comment after completing a task.",value:x,onChange:I}),(0,_.jsx)("div",{style:{height:1,background:"var(--p-border)",marginTop:-4,marginBottom:-4}}),(0,_.jsx)(ei,{id:"settings-auto-commit",label:"Commit after task implementation",description:"Agent is instructed to stage and commit changes after each task.",value:g,onChange:L}),(0,_.jsx)(ei,{id:"settings-auto-push",label:"Push after task commit",description:`Agent is instructed to push after every commit. Requires \'Commit\' to be ON.${g?"":" (Enable Commit first)"}`,value:N&&g,onChange:B=>m(B&&g)}),(0,_.jsx)(ei,{id:"settings-create-branch",label:"Create branch at end of session",description:"Agent creates a descriptive branch after all session tasks are done (e.g. fix/bug-errors, feat/eye-toggle). Name reflects the work: lowercase, kebab-case, 2\\u20135 words, prefix fix/feat/chore/docs.",value:u,onChange:f})]}),i==="agent"&&(0,_.jsxs)("div",{style:{padding:"14px 16px",display:"flex",flexDirection:"column",gap:14},children:[(0,_.jsxs)("div",{children:[(0,_.jsxs)("label",{style:{display:"flex",alignItems:"center",gap:10,cursor:"pointer",userSelect:"none",marginBottom:4},children:[(0,_.jsx)("input",{id:"settings-experimental-agents",type:"checkbox",checked:ee,onChange:()=>Te(!ee),style:{width:14,height:14,accentColor:"var(--p-purple)",cursor:"pointer"}}),(0,_.jsx)("span",{style:{fontSize:12,fontWeight:600,color:"var(--p-text-m)"},children:"Enable agent features (experimental)"})]}),(0,_.jsx)("div",{style:{fontSize:11,color:"var(--p-text-g)",marginLeft:24},children:"Agent runs, queue, and model selection are experimental and may change."})]}),!ee&&(0,_.jsx)("div",{style:{padding:16,borderRadius:8,background:"var(--p-bg-2)",border:"1px dashed var(--p-border)",textAlign:"center",fontSize:12,color:"var(--p-text-g)"},children:"Agent features are disabled. Toggle above to enable."}),ee&&(0,_.jsxs)(_.Fragment,{children:[(0,_.jsxs)("div",{children:[(0,_.jsx)("div",{className:"dp-meta-label",style:{marginBottom:6},children:"Default Model"}),(0,_.jsx)("div",{style:{fontSize:11,color:"var(--p-text-g)",marginBottom:10},children:"This model will be pre-selected when running the agent on a task."}),(0,_.jsx)(Js,{value:v,onChange:B=>C(B===v?"":B),models:s})]}),v&&(0,_.jsxs)("div",{style:{padding:10,borderRadius:7,background:"color-mix(in srgb, var(--p-green) 10%, transparent)",border:"1px solid color-mix(in srgb, var(--p-green) 30%, transparent)",fontSize:11,color:"var(--p-green-300)"},children:["\\u2713 Default model set to: ",(0,_.jsx)("strong",{children:(T=s.find(B=>B.id===v))==null?void 0:T.label})]}),(0,_.jsxs)("div",{children:[(0,_.jsx)("div",{className:"dp-meta-label",style:{marginBottom:6},children:"Default Agent"}),(0,_.jsx)("div",{style:{fontSize:11,color:"var(--p-text-g)",marginBottom:10},children:"This agent will be used when running agent on a task without a specific agent set."}),(0,_.jsx)(Vd,{value:w,onChange:B=>y(B),agents:l??[]})]}),w&&(0,_.jsxs)("div",{style:{padding:10,borderRadius:7,background:"color-mix(in srgb, var(--p-purple) 10%, transparent)",border:"1px solid color-mix(in srgb, var(--p-purple) 30%, transparent)",fontSize:11,color:"var(--p-purple-300)"},children:["\\u2713 Default agent set to: ",(0,_.jsx)("strong",{children:((V=l==null?void 0:l.find(B=>B.id===w))==null?void 0:V.name)??w})]}),(0,_.jsx)("div",{style:{height:1,background:"var(--p-border)",margin:"4px 0"}}),(0,_.jsxs)("div",{children:[(0,_.jsxs)("label",{style:{display:"flex",alignItems:"center",gap:10,cursor:"pointer",userSelect:"none",marginBottom:4},children:[(0,_.jsx)("input",{id:"settings-per-type-models",type:"checkbox",checked:k,onChange:()=>z(!k),style:{width:14,height:14,accentColor:"var(--p-purple)",cursor:"pointer"}}),(0,_.jsx)("span",{style:{fontSize:12,fontWeight:600,color:"var(--p-text-m)"},children:"Use different models per task type"})]}),(0,_.jsx)("div",{style:{fontSize:11,color:"var(--p-text-g)",marginLeft:24},children:"Override the default model for specific task types."})]}),k&&(0,_.jsxs)("div",{style:{display:"flex",flexDirection:"column",gap:12,paddingLeft:24},children:[(0,_.jsx)(Qd,{id:"dp-type-model-picker-bug",label:"Bug",color:"var(--p-red)",value:U,onChange:B=>F(B===U?"":B),models:s}),(0,_.jsx)(Qd,{id:"dp-type-model-picker-research",label:"Research",color:"var(--p-blue)",value:Z,onChange:B=>oe(B===Z?"":B),models:s}),(0,_.jsx)(Qd,{id:"dp-type-model-picker-task",label:"Task",color:"var(--p-green)",value:fe,onChange:B=>Ce(B===fe?"":B),models:s})]})]})]})]})}function ei({id:e,label:t,description:a,value:r,onChange:o}){return(0,_.jsxs)("div",{children:[(0,_.jsx)("div",{className:"dp-meta-label",style:{marginBottom:4},children:t}),(0,_.jsx)("div",{style:{fontSize:11,color:"var(--p-text-g)",marginBottom:10},children:a}),(0,_.jsxs)("div",{id:e,style:{display:"flex",alignItems:"center",gap:10,cursor:"pointer"},onClick:()=>o(!r),children:[(0,_.jsxs)("div",{style:{position:"relative",width:36,height:20,flexShrink:0},children:[(0,_.jsx)("div",{style:{width:36,height:20,borderRadius:10,background:r?"var(--p-purple)":"var(--p-card)",border:`1px solid ${r?"var(--p-purple-300)":"var(--p-border)"}`,transition:"all .15s"}}),(0,_.jsx)("div",{style:{position:"absolute",top:3,left:r?18:3,width:14,height:14,borderRadius:"50%",background:r?"var(--p-purple-300)":"var(--p-text-muted)",transition:"all .15s"}})]}),(0,_.jsx)("span",{style:{fontSize:12,color:"var(--p-text-g)"},children:r?"On":"Off"})]})]})}function Qd({id:e,label:t,color:a,value:r,onChange:o,models:n}){let l=n.find(s=>s.id===r);return(0,_.jsxs)("div",{id:e,children:[(0,_.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:8,marginBottom:6},children:[(0,_.jsx)("span",{style:{width:8,height:8,borderRadius:"50%",background:a,flexShrink:0}}),(0,_.jsx)("span",{style:{fontSize:11,fontWeight:600,color:"var(--p-text-m)"},children:t})]}),(0,_.jsx)(Js,{value:r,onChange:o,models:n}),l&&(0,_.jsxs)("div",{style:{fontSize:10,color:"var(--p-text-g)",marginTop:4,paddingLeft:4},children:["\\u2192 ",l.label]})]})}var ai=E(De(),1);var Ae=E(K(),1);function hg(e){return/\\.(png|jpe?g|gif|webp|svg|avif)$/i.test(e)}function ti(e){return/\\.md$/i.test(e)}function Zd({open:e,name:t,url:a,onClose:r}){let[o,n]=ai.default.useState(null),[l,s]=ai.default.useState(!1);return ai.default.useEffect(()=>{!e||!a||(ti(t)?(s(!0),n(null),fetch(a).then(i=>i.text()).then(i=>{n(i),s(!1)}).catch(()=>{n("Error loading file."),s(!1)})):n(null))},[e,t,a]),(0,Ae.jsx)(Gr,{open:e,onClose:r,id:"file-preview-modal",width:"min(700px, 95vw)",maxHeight:"88vh",boxStyle:{display:"flex",flexDirection:"column"},icon:(0,Ae.jsx)(Bo,{className:"w-4 h-4 text-slate-400"}),title:t,headerActions:(0,Ae.jsxs)(Ae.Fragment,{children:[(0,Ae.jsx)("a",{href:a,download:t,className:"text-slate-400 hover:text-slate-200 transition-colors p-1.5 rounded-md hover:bg-slate-700/60",title:"Download",children:(0,Ae.jsx)(zr,{className:"w-4 h-4"})}),(0,Ae.jsx)("button",{id:"file-preview-close",onClick:r,className:"text-slate-400 hover:text-slate-200 transition-colors p-1.5 rounded-md hover:bg-slate-700/60",title:"Close",children:(0,Ae.jsx)(Ge,{className:"w-4 h-4"})})]}),footer:(0,Ae.jsxs)(Ae.Fragment,{children:[(0,Ae.jsxs)("a",{href:a,download:t,className:"flex items-center gap-1.5 border border-slate-700 hover:bg-slate-800 text-slate-300 text-sm px-3 py-1.5 rounded-lg transition-colors",children:[(0,Ae.jsx)(zr,{className:"w-3.5 h-3.5"}),"Download"]}),(0,Ae.jsx)("button",{id:"file-preview-close-footer",onClick:r,className:"border border-slate-700 hover:bg-slate-800 text-slate-300 text-sm px-4 py-1.5 rounded-lg transition-colors",children:"Close"})]}),children:(0,Ae.jsxs)("div",{className:"flex-1 overflow-auto",style:{minHeight:0,padding:"16px 20px"},children:[hg(t)&&(0,Ae.jsx)("div",{style:{borderRadius:8,overflow:"hidden",border:"1px solid var(--p-border)",background:"var(--p-card)",display:"inline-block",width:"100%"},children:(0,Ae.jsx)("img",{src:a,alt:t,style:{maxWidth:"100%",display:"block",margin:"0 auto",objectFit:"contain"}})}),ti(t)&&l&&(0,Ae.jsx)("p",{className:"text-xs text-slate-500 py-4",children:"Loading\\u2026"}),ti(t)&&!l&&o!==null&&(0,Ae.jsx)("div",{id:"file-preview-md",style:{background:"var(--p-input)",border:"1px solid var(--p-border-s)",borderRadius:8,padding:"10px 14px",fontSize:13,color:"var(--p-text-sub)",lineHeight:1.65},children:(0,Ae.jsx)(ur,{markdown:o})}),!hg(t)&&!ti(t)&&(0,Ae.jsxs)("div",{className:"flex flex-col items-center justify-center gap-3 py-12 text-slate-500",children:[(0,Ae.jsx)(Bo,{className:"w-10 h-10 opacity-40"}),(0,Ae.jsx)("p",{className:"text-sm",children:"Preview not available for this file type."}),(0,Ae.jsxs)("a",{href:a,download:t,className:"flex items-center gap-1.5 text-violet-400 hover:text-violet-300 hover:underline text-sm transition-colors",children:[(0,Ae.jsx)(zr,{className:"w-3.5 h-3.5"}),"Download file"]})]})]})})}var il=E(De(),1);var be=E(K(),1);function ry(e){if(!e)return"";let t=Date.now()-new Date(e).getTime(),a=Math.floor(t/6e4),r=Math.floor(t%6e4/1e3);return`${a}m ${r.toString().padStart(2,"0")}s`}var xg={running:"var(--p-blue)",queued:"var(--p-amber)",done:"var(--p-green)",failed:"var(--p-red)"},oy={running:"Running",queued:"Queued",done:"Completed",failed:"Failed"};function Jd({open:e,runs:t,onStop:a,onOpenTask:r,onClose:o}){let n=il.default.useRef(null),[l,s]=il.default.useState({});if(il.default.useEffect(()=>{if(!e)return;let c=setInterval(()=>{let p={};for(let g of t)g.status==="running"&&g.startedAt&&(p[g.taskId]=ry(g.startedAt));s(p)},1e3);return()=>clearInterval(c)},[e,t]),il.default.useEffect(()=>{if(!e)return;function c(p){n.current&&!n.current.contains(p.target)&&o()}return document.addEventListener("mousedown",c),()=>document.removeEventListener("mousedown",c)},[e,o]),!e)return null;let i=t.filter(c=>c.status==="running"||c.status==="queued"),d=t.filter(c=>c.status==="done"||c.status==="failed");return(0,be.jsxs)("div",{ref:n,id:"agent-queue-panel",style:{position:"fixed",top:0,right:0,bottom:0,width:"min(420px, 90vw)",background:"var(--p-surface)",borderLeft:"1px solid var(--p-border)",zIndex:40,display:"flex",flexDirection:"column",boxShadow:"var(--p-shadow-lg)"},children:[(0,be.jsxs)("div",{style:{padding:"14px 16px",borderBottom:"1px solid var(--p-border)",display:"flex",alignItems:"center",gap:10},children:[(0,be.jsx)(mt,{style:{width:16,height:16,color:"var(--p-purple-300)"}}),(0,be.jsx)("span",{style:{fontSize:14,fontWeight:600,color:"var(--p-text)",flex:1},children:"Agent Queue"}),(0,be.jsxs)("span",{style:{fontSize:11,color:"var(--p-text-g)",background:"var(--p-bg-2)",padding:"2px 8px",borderRadius:10},children:[i.length," active \\xB7 ",d.length," completed"]}),(0,be.jsx)("button",{id:"agent-queue-close",onClick:o,style:{width:26,height:26,display:"flex",alignItems:"center",justifyContent:"center",borderRadius:6,border:"none",background:"transparent",color:"var(--p-text-g)",cursor:"pointer"},onMouseEnter:c=>{c.currentTarget.style.background="var(--p-surface)",c.currentTarget.style.color="var(--p-text-m)"},onMouseLeave:c=>{c.currentTarget.style.background="transparent",c.currentTarget.style.color="var(--p-text-g)"},children:(0,be.jsx)(Ge,{style:{width:14,height:14}})})]}),(0,be.jsxs)("div",{style:{flex:1,overflowY:"auto",padding:12,display:"flex",flexDirection:"column",gap:8},children:[t.length===0&&(0,be.jsx)("div",{style:{padding:24,textAlign:"center",fontSize:12,color:"var(--p-text-g)"},children:"No agent runs yet. Open a task and click the Agent tab to start."}),t.map(c=>(0,be.jsxs)("div",{style:{padding:"10px 12px",borderRadius:8,border:`1px solid ${c.status==="running"?"color-mix(in srgb, var(--p-blue) 30%, transparent)":"var(--p-border)"}`,background:c.status==="running"?"color-mix(in srgb, var(--p-blue) 6%, transparent)":"var(--p-bg-2)",cursor:"pointer",transition:"background .12s"},onClick:()=>r(c.taskId),onMouseEnter:p=>{p.currentTarget.style.background=c.status==="running"?"color-mix(in srgb, var(--p-blue) 10%, transparent)":"var(--p-hover)"},onMouseLeave:p=>{p.currentTarget.style.background=c.status==="running"?"color-mix(in srgb, var(--p-blue) 6%, transparent)":"var(--p-bg-2)"},children:[(0,be.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:8,marginBottom:6},children:[c.status==="running"&&(0,be.jsx)("span",{className:"spinner",style:{width:12,height:12,borderWidth:1.5}}),c.status==="queued"&&(0,be.jsx)("span",{style:{color:"var(--p-amber)",fontSize:12},children:"\\u23F3"}),c.status==="done"&&(0,be.jsx)("span",{style:{color:"var(--p-green)",fontSize:12},children:"\\u2713"}),c.status==="failed"&&(0,be.jsx)("span",{style:{color:"var(--p-red)",fontSize:12},children:"\\u2717"}),(0,be.jsx)("span",{style:{fontSize:12,fontWeight:600,color:"var(--p-text)",flex:1},children:c.taskTitle}),(0,be.jsx)("span",{style:{fontSize:10,fontWeight:500,color:xg[c.status]??"var(--p-text-g)",padding:"1px 6px",borderRadius:4,background:`${xg[c.status]??"var(--p-text-g)"}15`},children:oy[c.status]??c.status})]}),(0,be.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:12,fontSize:10,color:"var(--p-text-g)"},children:[c.model&&(0,be.jsxs)("span",{children:["Model: ",c.model]}),c.status==="running"&&l[c.taskId]&&(0,be.jsxs)("span",{style:{display:"flex",alignItems:"center",gap:3},children:[(0,be.jsx)(ar,{style:{width:9,height:9}}),l[c.taskId]]})]}),c.logs.length>0&&(0,be.jsx)("div",{style:{marginTop:8,padding:"6px 8px",background:"#0a0c10",borderRadius:6,fontFamily:"\'SF Mono\', \'Fira Code\', monospace",fontSize:9,lineHeight:1.5,color:"#a3e635",maxHeight:80,overflowY:"auto"},children:c.logs.slice(-3).map((p,g)=>(0,be.jsx)("div",{style:{whiteSpace:"pre-wrap",wordBreak:"break-word"},children:p.startsWith("$")?(0,be.jsx)("span",{style:{color:"var(--p-text-g)"},children:p}):p.startsWith("\\u2713")?(0,be.jsx)("span",{style:{color:"var(--p-green)"},children:p}):p.startsWith("\\u25B6")||p.startsWith("\\u2192")?(0,be.jsx)("span",{style:{color:"var(--p-blue-300)"},children:p}):p.startsWith("\\u2717")||p.startsWith("Error")?(0,be.jsx)("span",{style:{color:"var(--p-red)"},children:p}):p},g))}),c.status==="running"&&(0,be.jsxs)("button",{onClick:p=>{p.stopPropagation(),a(c.taskId)},style:{marginTop:8,display:"inline-flex",alignItems:"center",gap:4,padding:"3px 10px",borderRadius:5,border:"1px solid var(--p-red)",background:"color-mix(in srgb, var(--p-red) 15%, transparent)",color:"var(--p-red)",fontSize:10,fontWeight:600,cursor:"pointer"},children:[(0,be.jsx)(Wr,{style:{width:8,height:8}}),"Stop"]})]},c.taskId))]})]})}var fr=window.location.origin,la=`${fr}/api/tasks`,st={async getTasks(){return(await fetch(`${la}?_=${Date.now()}`,{cache:"no-store"})).json()},async createTask(e){return(await fetch(la,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)})).json()},async updateTask(e,t){return(await fetch(`${la}/${e}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)})).json()},async deleteTask(e){await fetch(`${la}/${e}`,{method:"DELETE"})},async getComments(e){return(await fetch(`${la}/${e}/comments`)).json()},async addComment(e,t){await fetch(`${la}/${e}/comments`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({author:"user",text:t,source:"web"})})},async updateComment(e,t,a){await fetch(`${la}/${e}/comments/${t}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({text:a})})},async deleteComment(e,t){await fetch(`${la}/${e}/comments/${t}`,{method:"DELETE"})},async getFiles(e){return(await fetch(`${la}/${e}/files`)).json()},async uploadFile(e,t){let a=await t.arrayBuffer();await fetch(`${la}/${e}/files/${encodeURIComponent(t.name)}`,{method:"POST",headers:{"Content-Type":"application/octet-stream"},body:a})},async deleteFile(e,t){await fetch(`${la}/${e}/files/${encodeURIComponent(t)}`,{method:"DELETE"})},async getProject(){return(await fetch(`${fr}/api/project`)).json()},async getCopilotStatus(){return(await fetch(`${fr}/api/copilot/status`)).json()},async copilotLogin(){return(await fetch(`${fr}/api/copilot/login`,{method:"POST"})).json().catch(()=>({}))},async getSettings(){return(await fetch(`${fr}/api/settings`,{cache:"no-store"})).json()},async saveSettings(e){await fetch(`${fr}/api/settings`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)})},wsUrl(){return`${window.location.protocol==="https:"?"wss:":"ws:"}//${window.location.host}`},async getModels(){var a;let t=await(await fetch(`${fr}/trpc/models`,{cache:"no-store"})).json();return((a=t==null?void 0:t.result)==null?void 0:a.data)??{models:[],error:"Invalid response"}},async getAgents(){return{agents:(await(await fetch(`${fr}/api/agent/agents`,{cache:"no-store"})).json()).agents??[],error:null}}};var re=E(K(),1),ny=window.__PORT__??3700,ly=window.__SAAS_MODE__??!1,vg=window.__BOARD_URL__??"",sy=window.__BOARD_NAME__??"",Sg=window.__IS_ADMIN__??!1;function iy({onClose:e}){let t=window.location.origin,[a,r]=le.default.useState("idle"),[o,n]=le.default.useState(!0),[l,s]=le.default.useState(null),[i,d]=le.default.useState("");async function c(){r("pushing"),d("");try{let g=await fetch(`${t}/api/push`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({keepLocalFiles:o})}),L=await g.json();if(!g.ok){d(L.error??"Push failed"),r("error");return}s({imported:L.imported??0,skipped:L.skipped}),r("done")}catch(g){d(g instanceof Error?g.message:"Network error"),r("error")}}let p=a==="pushing";return(0,re.jsx)("div",{style:{position:"fixed",inset:0,zIndex:9999,background:"rgba(5, 8, 18, 0.72)",backdropFilter:"blur(10px)",display:"flex",alignItems:"center",justifyContent:"center",padding:20,fontFamily:"Inter, system-ui, -apple-system, sans-serif"},children:(0,re.jsxs)("div",{style:{background:"#101827",border:"1px solid rgba(255,255,255,0.07)",borderRadius:24,maxWidth:380,width:"100%",boxShadow:"0 0 0 1px rgba(59,130,246,0.07), 0 40px 80px rgba(0,0,0,0.75)",overflow:"hidden",position:"relative"},children:[(0,re.jsx)("div",{style:{position:"absolute",top:0,left:"20%",right:"20%",height:1,background:"linear-gradient(90deg, transparent, rgba(59,130,246,0.5), transparent)"}}),(0,re.jsxs)("div",{style:{padding:"36px 36px 20px",display:"flex",flexDirection:"column",alignItems:"center",textAlign:"center"},children:[(0,re.jsx)("div",{style:{position:"relative",width:52,height:52,marginBottom:22},children:(0,re.jsxs)("svg",{width:"52",height:"52",viewBox:"0 0 18 18",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,re.jsx)("rect",{width:"18",height:"18",rx:"4",fill:"#2563eb"}),(0,re.jsx)("rect",{x:"2.5",y:"5",width:"2",height:"8",rx:"1",fill:"white",opacity:"0.7"}),(0,re.jsx)("rect",{x:"6.5",y:"2",width:"2",height:"14",rx:"1",fill:"white"}),(0,re.jsx)("rect",{x:"10.5",y:"6",width:"2",height:"6",rx:"1",fill:"white",opacity:"0.7"}),(0,re.jsx)("rect",{x:"14.5",y:"4",width:"2",height:"10",rx:"1",fill:"white",opacity:"0.85"})]})}),(0,re.jsx)("h1",{style:{fontSize:18,fontWeight:700,color:"#f1f5f9",letterSpacing:"-0.3px",margin:"0 0 7px"},children:"Online Mode Active"}),(0,re.jsxs)("p",{style:{fontSize:12,color:"rgba(255,255,255,0.36)",lineHeight:1.5,margin:0},children:["Connected to"," ",(0,re.jsx)("strong",{style:{color:"rgba(255,255,255,0.55)",fontWeight:500},children:sy||"Vibeflow SaaS"})]})]}),a==="done"&&l&&(0,re.jsxs)("div",{style:{margin:"0 28px 0",padding:"10px 14px",borderRadius:9,fontSize:12,display:"flex",alignItems:"center",gap:9,background:"rgba(16,185,129,0.08)",border:"1px solid rgba(16,185,129,0.18)",color:"#34d399"},children:[(0,re.jsx)("svg",{width:"13",height:"13",viewBox:"0 0 16 16",fill:"none",children:(0,re.jsx)("path",{d:"M13 5L6.5 11.5 3 8",stroke:"#34d399",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round"})}),l.imported," task",l.imported!==1?"s":""," pushed to board",l.skipped!=null&&l.skipped>0?` \\xB7 ${l.skipped} already existed`:""]}),a==="error"&&i&&(0,re.jsx)("div",{style:{margin:"0 28px 0",padding:"10px 14px",borderRadius:9,fontSize:12,display:"flex",alignItems:"center",gap:9,background:"rgba(239,68,68,0.08)",border:"1px solid rgba(239,68,68,0.18)",color:"#f87171"},children:i}),(0,re.jsxs)("div",{style:{padding:"20px 24px 28px",display:"flex",flexDirection:"column",gap:8},children:[vg&&(0,re.jsx)("a",{href:vg,target:"_blank",rel:"noopener noreferrer",style:{display:"flex",alignItems:"center",justifyContent:"center",gap:9,padding:14,background:"#2563eb",border:"none",borderRadius:12,color:"#fff",fontSize:14,fontWeight:600,cursor:"pointer",textDecoration:"none",letterSpacing:"-0.1px",transition:"background 0.15s, transform 0.1s"},onMouseEnter:g=>{g.currentTarget.style.background="#3b82f6",g.currentTarget.style.transform="translateY(-1px)"},onMouseLeave:g=>{g.currentTarget.style.background="#2563eb",g.currentTarget.style.transform="none"},children:"Open Web App \\u2192"}),a!=="done"&&(0,re.jsx)("button",{onClick:()=>void c(),disabled:p,style:{display:"flex",alignItems:"center",justifyContent:"center",gap:9,padding:12,background:"transparent",border:"1px solid rgba(255,255,255,0.08)",borderRadius:12,color:p?"rgba(255,255,255,0.25)":"rgba(255,255,255,0.4)",fontSize:13,fontWeight:500,cursor:p?"not-allowed":"pointer",transition:"border-color 0.15s, color 0.15s, background 0.15s"},onMouseEnter:g=>{p||(g.currentTarget.style.borderColor="rgba(255,255,255,0.15)",g.currentTarget.style.color="rgba(255,255,255,0.65)",g.currentTarget.style.background="rgba(255,255,255,0.03)")},onMouseLeave:g=>{p||(g.currentTarget.style.borderColor="rgba(255,255,255,0.08)",g.currentTarget.style.color="rgba(255,255,255,0.4)",g.currentTarget.style.background="transparent")},children:p?"\\u23F3 Pushing\\u2026":"\\u2191 Push local tasks"})]}),(0,re.jsxs)("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"0 24px 20px"},children:[(0,re.jsxs)("label",{style:{display:"flex",alignItems:"center",gap:7,cursor:"pointer"},children:[(0,re.jsx)("input",{type:"checkbox",checked:o,onChange:g=>n(g.target.checked),style:{accentColor:"#2563eb",width:13,height:13,cursor:"pointer"}}),(0,re.jsx)("span",{style:{fontSize:11.5,color:"rgba(255,255,255,0.28)"},children:"Keep local files"})]}),Sg&&e&&(0,re.jsx)("button",{onClick:e,style:{fontSize:11,color:"rgba(255,255,255,0.2)",background:"none",border:"none",cursor:"pointer",textDecoration:"underline",textUnderlineOffset:2,transition:"color 0.15s"},onMouseEnter:g=>{g.currentTarget.style.color="rgba(255,255,255,0.45)"},onMouseLeave:g=>{g.currentTarget.style.color="rgba(255,255,255,0.2)"},children:"Dismiss (admin)"})]})]})})}var yg={backlog:"Backlog",todo:"Todo","in-progress":"In Progress",review:"Review",done:"Done"};function uy(e,t,a){let r=a?e.filter(s=>{var i,d;return((i=s.title)==null?void 0:i.toLowerCase().includes(a))||((d=s.description)==null?void 0:d.toLowerCase().includes(a))}):e;if(a)return`${r.length} of ${e.length} tasks`;let o=r.filter(s=>s.status!=="done").length,n=r.filter(s=>s.status==="in-progress").length,l=r.filter(s=>s.status==="review").length;return`${o} open \\xB7 ${n} in-progress \\xB7 ${l} in review`}function Ig(){var to,hr;let[e,t]=le.default.useState([]),[a,r]=le.default.useState(!0),[o,n]=le.default.useState(!1),[l,s]=le.default.useState({open:!1,task:null,tab:"details"}),[i,d]=le.default.useState("board"),[c,p]=le.default.useState(!1),[g,L]=le.default.useState({open:!1,name:"",url:""}),[x,I]=le.default.useState(420),[N,m]=le.default.useState(!1),[u,f]=le.default.useState(""),[v,C]=le.default.useState(lr.map(h=>h.id)),[w,y]=le.default.useState({status:"all",component:null,type:null,user:null,tags:[]}),[k,z]=le.default.useState("Proto Board"),[U,F]=le.default.useState(!1),[Z,oe]=le.default.useState(!1),[fe,Ce]=le.default.useState("You"),[ee,Te]=le.default.useState(null),[ue,J]=le.default.useState(""),[T,V]=le.default.useState({}),[B,A]=le.default.useState([]),[ge,Le]=le.default.useState([]),Me=le.default.useRef(null),rt=le.default.useRef(null),ve=le.default.useRef(null),[Xe,Oe]=le.default.useState([]),Ke=le.default.useRef(!1),we=le.default.useRef([]),[ye,gt]=le.default.useState([]),[ht,et]=le.default.useState([]),[ha,Bt]=le.default.useState(!1),[xa,Xr]=le.default.useState(new Set),[$o,Vo]=le.default.useState(!1);function Qr(h,b,O){let X=we.current.find(se=>se.id===h);if(!X)return;X.status!=="in-progress"&&mr(h,{status:"in-progress"});let de=O||X.agent||T.defaultAgent||"build";fetch(`${eo}/api/agent/run`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({taskId:h,model:b,agent:de})}).then(async se=>{if(!se.ok){let H=await se.json().catch(()=>({error:"Failed to start agent"}));et(ae=>ae.map(Ie=>Ie.taskId===h?{...Ie,status:"failed",logs:[...Ie.logs,`\\u2717 ${H.error??"Failed to start agent"}`]}:Ie))}}).catch(se=>{et(H=>H.map(ae=>ae.taskId===h?{...ae,status:"failed",logs:[...ae.logs,`\\u2717 Network error: ${se.message}`]}:ae))})}function Yr(h){fetch(`${eo}/api/agent/stop`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({taskId:h})}).catch(()=>{}),et(b=>{let O=b.some(de=>de.taskId===h&&de.status==="running"),X=b.map(de=>de.taskId===h&&de.status==="running"?{...de,status:"failed",logs:[...de.logs,"\\u2717 Stopped by user"]}:de);if(O){let de=X.find(se=>se.status==="queued");if(de)return X.map(se=>se.taskId===de.taskId?{...se,status:"running",startedAt:new Date().toISOString(),logs:[...se.logs,"\\u25B6 Starting agent run\\u2026"]}:se)}return X})}function va(h){et(b=>b.filter(O=>O.taskId!==h))}function ul(h){Xr(b=>{let O=new Set(b);return O.has(h)?O.delete(h):O.add(h),O})}function cr(h){for(let b of h)Qr(b,"claude-sonnet-4-5");Bt(!1),Xr(new Set)}le.default.useEffect(()=>(Ot(),Go(),oi(),ni(),ri(),fl(),li(),Ko(),()=>{var h;rt.current&&clearTimeout(rt.current),(h=Me.current)==null||h.close()}),[]),le.default.useEffect(()=>{document.body.setAttribute("data-theme","dark")},[]),le.default.useEffect(()=>{function h(){let X=window.location.hash.match(/^#task-([a-f0-9]{30})$/i);if(!X){ve.current=null;return}let de=X[1].toLowerCase();if(ve.current===de)return;let se=e.find(H=>H.id.toLowerCase()===de);se&&(ve.current=de,Ke.current?s(H=>({...H,open:!0,task:se,tab:"details"})):s(H=>(H.task&&H.task.id!==se.id&&Oe(ae=>[...ae,H.task]),{...H,open:!0,task:se,tab:"details"})),Ke.current=!1)}function b(){}h();let O=()=>{ve.current=null,h()};return window.addEventListener("hashchange",O),window.addEventListener("vibeflow-task-ref-click",b),()=>{window.removeEventListener("hashchange",O),window.removeEventListener("vibeflow-task-ref-click",b)}},[e]),le.default.useEffect(()=>{if(!l.open||!l.task)return;let h=e.find(X=>X.id===l.task.id);if(!h)return;let b=l.task;Object.keys(h).some(X=>h[X]!==b[X])&&s(X=>({...X,task:h}))},[e,l.open,(to=l.task)==null?void 0:to.id]),le.default.useEffect(()=>{function h(b){var de,se,H;let O=(de=b.target)==null?void 0:de.tagName,X=O==="INPUT"||O==="TEXTAREA"||((se=b.target)==null?void 0:se.isContentEditable);if(b.key==="Escape"){if(g.open){L(ae=>({...ae,open:!1}));return}if(l.open){s(ae=>({...ae,open:!1}));return}if(c){p(!1);return}}if(!X&&((b.key==="?"||b.key==="/"&&b.shiftKey)&&((H=document.getElementById("header-shortcuts-hint"))==null||H.click()),b.altKey&&!b.ctrlKey&&!b.metaKey&&(b.key==="n"||b.key==="N")&&(b.preventDefault(),gr(null,"details")),b.altKey&&!b.ctrlKey&&!b.metaKey&&(b.key==="f"||b.key==="F"))){b.preventDefault();let ae=document.getElementById("global-search");ae==null||ae.focus(),ae==null||ae.select()}}return window.addEventListener("keydown",h),()=>window.removeEventListener("keydown",h)},[g.open,l.open,c]);function pr(h,b,O,X,de){let se=new Date().toISOString(),H=yg[b]??b,ae=yg[O]??O,Ie=Date.now()-3e3;gt(pe=>pe.some(P=>P.taskId===h&&P.to===ae&&new Date(P.timestamp).getTime()>Ie)?pe:[...pe,{taskId:h,field:"status",from:H,to:ae,actor:X,timestamp:se,source:de}].slice(-500))}async function Ot(){try{let h=await st.getTasks();we.current=h.tasks??[],t(h.tasks??[])}catch{}finally{r(!1)}}let dl=le.default.useCallback((h,b,O)=>{let X=String(h.id??"");if(!X)return;let de=h.created??h.createdAt,se=h.updated?String(h.updated):void 0,H=Array.isArray(h.comments)?h.comments.length:void 0,ae=Array.isArray(h.files)?h.files.length:void 0,Ie=h.status?String(h.status):void 0,pe=we.current.find(he=>he.id===X);Ie&&pe&&pe.status!==Ie&&pr(X,pe.status,Ie,b??"Someone",O),t(he=>{let P=he.find($e=>$e.id===X),Pe={id:X,title:h.title?String(h.title):(P==null?void 0:P.title)??"Untitled",description:h.description!=null?String(h.description):(P==null?void 0:P.description)??"",status:Ie??(P==null?void 0:P.status)??"todo",type:h.type?String(h.type):P==null?void 0:P.type,priority:h.priority?String(h.priority):P==null?void 0:P.priority,agent:h.agent?String(h.agent):P==null?void 0:P.agent,model:h.model?String(h.model):P==null?void 0:P.model,selector:h.selector?String(h.selector):P==null?void 0:P.selector,cssSelector:h.cssSelector?String(h.cssSelector):P==null?void 0:P.cssSelector,file:h.file?String(h.file):P==null?void 0:P.file,line:typeof h.line=="number"?h.line:P==null?void 0:P.line,col:typeof h.col=="number"?h.col:P==null?void 0:P.col,component:h.component?String(h.component):P==null?void 0:P.component,url:h.url?String(h.url):P==null?void 0:P.url,reportBack:h.reportBack===!0||(P==null?void 0:P.reportBack)===!0,commit:h.commit?String(h.commit):P==null?void 0:P.commit,commits:Array.isArray(h.commits)?h.commits:P==null?void 0:P.commits,commentCount:H??(P==null?void 0:P.commentCount),fileCount:ae??(P==null?void 0:P.fileCount),createdAt:de?String(de):(P==null?void 0:P.createdAt)??new Date().toISOString(),updatedAt:se??(P==null?void 0:P.updatedAt),author:h.author?String(h.author):P==null?void 0:P.author,tags:Array.isArray(h.tags)?h.tags:P==null?void 0:P.tags,sortKey:h.sortKey?String(h.sortKey):P==null?void 0:P.sortKey},it=he.filter($e=>$e.id!==X);return it.push(Pe),it.sort(($e,Ea)=>{let xr=new Date($e.updatedAt??$e.createdAt??"").getTime(),vr=new Date(Ea.updatedAt??Ea.createdAt??"").getTime();return xr===vr?$e.id.localeCompare(Ea.id):vr-xr}),we.current=it,it})},[]);async function Go(){try{let h=await st.getProject();h.name&&z(h.name),h.gitUserName&&Ce(h.gitUserName)}catch{}}async function ri(){try{let h=await fetch("/api/github-url").then(b=>b.json());Te(h.githubUrl??null)}catch{}}async function oi(){var h;try{let O=await st.getSettings();V(O),(h=O.visibleCols)!=null&&h.length&&C(O.visibleCols),O.viewMode&&d(O.viewMode),O.panelWidth&&O.panelWidth>=280&&O.panelWidth<=900&&I(O.panelWidth)}catch{}}async function ni(){try{let h=await st.getCopilotStatus();h!=null&&h.authenticated&&(h!=null&&h.username)?J(`Copilot: ${h.username}`):J("Copilot: not logged in")}catch{}}async function fl(){try{if(st.getModels){let h=await st.getModels();h.models&&h.models.length>0&&A(h.models)}}catch{}}async function li(){try{if(st.getAgents){let h=await st.getAgents();h.agents&&h.agents.length>0&&Le(h.agents)}}catch{}}function Ko(){let b=`${window.location.protocol==="https:"?"wss:":"ws:"}//${window.location.host}`,O=new WebSocket(b);Me.current=O,O.addEventListener("open",()=>{F(!0),oe(!0),Ot()}),O.addEventListener("close",()=>{F(!1),rt.current=setTimeout(Ko,1500)}),O.addEventListener("message",de=>{var se;try{let H=JSON.parse(de.data);if(H.type==="tasks-updated"||(se=H.type)!=null&&se.startsWith("task:")){Ot();return}if(H.type==="task-changed"&&H.task){let ae=H.task,Ie=typeof ae.alteredBy=="string"?ae.alteredBy:typeof ae.author=="string"?ae.author:"Someone",pe=H.source==="cli"?"cli":void 0;dl(ae,Ie,pe);return}if(H.type==="task-deleted"&&H.taskId){let ae=String(H.taskId);t(Ie=>{let pe=Ie.filter(he=>he.id!==ae);return we.current=pe,pe})}if(H.type==="agent-run-started"){et(ae=>{if(ae.find(Pe=>Pe.taskId===H.taskId&&(Pe.status==="running"||Pe.status==="queued")))return ae;let pe=we.current.find(Pe=>Pe.id===H.taskId),he=ae.some(Pe=>Pe.status==="running"),P={taskId:H.taskId,taskTitle:(pe==null?void 0:pe.title)??H.taskId.slice(0,8),status:he?"queued":"running",model:H.model,worktree:`wt/task-${H.taskId.slice(0,8)}`,branch:`agent/task-${H.taskId.slice(0,8)}`,startedAt:he?void 0:new Date().toISOString(),logs:[H.command??"\\u25B6 Starting agent run\\u2026"]};return[...ae,P]});return}if(H.type==="agent-run-log"){et(ae=>ae.map(Ie=>{if(Ie.taskId!==H.taskId)return Ie;let pe={...Ie,logs:[...Ie.logs,H.log]};for(let he of H.log.split(`\n`)){let P=he.trim();if(!(!P||!P.startsWith("{")))try{let Pe=JSON.parse(P);if(Pe.type==="step_finish"&&typeof Pe.part=="object"&&Pe.part){let it=Pe.part,$e=it.tokens,Ea=typeof it.cost=="number"?it.cost:0;$e&&(pe.inputTokens=(pe.inputTokens??0)+($e.input??0),pe.outputTokens=(pe.outputTokens??0)+($e.output??0),pe.totalTokens=(pe.totalTokens??0)+($e.total??0),pe.reasoningTokens=(pe.reasoningTokens??0)+($e.reasoning??0),pe.cost=(pe.cost??0)+Ea)}}catch{}}return pe}));return}if(H.type==="agent-run-finished"){et(ae=>{let Ie=ae.map(he=>he.taskId===H.taskId?{...he,status:H.success?"done":"failed",completedAt:new Date().toISOString(),logs:[...he.logs,H.success?"\\u2713 Agent run completed":`\\u2717 Agent run failed (exit ${H.exitCode})`],inputTokens:typeof H.inputTokens=="number"?H.inputTokens:he.inputTokens,outputTokens:typeof H.outputTokens=="number"?H.outputTokens:he.outputTokens,totalTokens:typeof H.totalTokens=="number"?H.totalTokens:he.totalTokens,reasoningTokens:typeof H.reasoningTokens=="number"?H.reasoningTokens:he.reasoningTokens,cost:typeof H.cost=="number"?H.cost:he.cost,durationMs:he.startedAt?Date.now()-new Date(he.startedAt).getTime():void 0}:he);if(!Ie.find(he=>he.status==="running")){let he=Ie.find(P=>P.status==="queued");if(he)return Ie.map(P=>P.taskId===he.taskId?{...P,status:"running",startedAt:new Date().toISOString(),logs:[...P.logs,"\\u25B6 Starting agent run\\u2026"]}:P)}return Ie});return}}catch{}});let X=setInterval(()=>{O.readyState===WebSocket.OPEN&&O.send(JSON.stringify({type:"ping"}))},2e4);O.addEventListener("close",()=>clearInterval(X))}async function mr(h,b){let O=we.current.find(X=>X.id===h);t(X=>{let de=X.map(se=>se.id===h?{...se,...b}:se);return we.current=de,de}),b.status&&(O!=null&&O.status)&&b.status!==O.status&&pr(h,O.status,b.status,fe);try{let X=await st.updateTask(h,b);X.task&&t(de=>{let se=de.map(H=>H.id===h?X.task:H);return we.current=se,se})}catch{Ot()}}async function cl(h,b,O,X,de){let se=we.current.filter(pe=>pe.status===b).sort(Or),H=Ad(se,h,O,X),ae=de??H.newSortKey,Ie=H.normalizationPatches;t(pe=>{let he=new Map;for(let{id:Pe,sortKey:it}of Ie)he.set(Pe,{sortKey:it});he.set(h,{status:b,sortKey:ae});let P=pe.map(Pe=>he.has(Pe.id)?{...Pe,...he.get(Pe.id)}:Pe);return we.current=P,P}),await st.updateTask(h,{status:b,sortKey:ae}).catch(()=>{Ot()})}async function Da(h){t(b=>{let O=b.filter(X=>X.id!==h);return we.current=O,O});try{await st.deleteTask(h)}catch{Ot()}}async function Zr(h){var b;try{let O=await st.createTask(h);return await Ot(),(b=O==null?void 0:O.task)==null?void 0:b.id}catch{}}function gr(h,b="details",O){Oe([]),s({open:!0,task:h,tab:b,addColumnId:O})}function pl(){Oe(h=>{if(h.length===0)return h;let b=h[h.length-1],O=h.slice(0,-1);return Ke.current=!0,ve.current=null,window.location.hash=`#task-${b.id}`,s(X=>({...X,open:!0,task:b,tab:"details"})),O})}function Jr(h,b){if(/\\.html?$/i.test(h)){window.open(b,"_blank","noopener,noreferrer");return}L({open:!0,name:h,url:b})}let ml=uy(e,v,u.toLowerCase()),eo=window.location.origin,gl=le.default.useMemo(()=>{let h=new Set;return e.forEach(b=>(b.tags??[]).forEach(O=>h.add(O))),Array.from(h).sort()},[e]),si=le.default.useMemo(()=>{var b;let h=(b=l.task)==null?void 0:b.id;return h?ye.filter(O=>O.taskId===h).map(({field:O,from:X,to:de,actor:se,timestamp:H,source:ae})=>({field:O,from:X,to:de,actor:se,timestamp:H,source:ae})):[]},[(hr=l.task)==null?void 0:hr.id,ye]),jo=le.default.useMemo(()=>{let h=e;return w.status!=="all"&&(h=h.filter(b=>b.status===w.status)),w.component&&(h=h.filter(b=>b.component===w.component)),w.type&&(h=h.filter(b=>b.type===w.type)),w.user&&(h=h.filter(b=>b.author===w.user)),w.tags&&w.tags.length>0&&(h=h.filter(b=>w.tags.every(O=>(b.tags??[]).includes(O)))),h},[e,w]),hl=Z&&!U;return(0,re.jsxs)(re.Fragment,{children:[ly&&!o&&(0,re.jsx)(iy,{onClose:Sg?()=>n(!0):void 0}),(0,re.jsx)(zd,{projectName:k,missingProjectIconStyle:"vibeflow",wsConnected:U,port:ny,searchQuery:u,filterTags:w.tags,allTags:gl,onToggleTag:h=>{let b=w.tags??[],O=b.includes(h)?b.filter(X=>X!==h):[...b,h];y(X=>({...X,tags:O}))},premiumUsage:ue,isLoading:a,taskSummary:ml,onSearchChange:f,onSettings:()=>p(!0),agentRuns:ht,selectMode:ha,onToggleSelectMode:()=>{Bt(h=>!h),Xr(new Set)},agentQueueCount:ht.filter(h=>h.status==="running"||h.status==="queued").length,onOpenAgentQueue:()=>Vo(!0),experimentalAgents:T.experimentalAgents}),(0,re.jsx)(Xd,{tasks:e,filter:w,view:i,onFilter:y,onViewChange:h=>{d(h),st.saveSettings({...T,viewMode:h}),V(b=>({...b,viewMode:h}))}}),(0,re.jsxs)("div",{className:"flex flex-1 overflow-hidden",style:{minHeight:0,position:"relative"},children:[i==="list"?(0,re.jsx)(Od,{tasks:jo,searchQuery:u,isLoading:a,onOpenPanel:(h,b)=>gr(h,b),onAddTask:h=>gr(null,"details",h),onDrop:(h,b)=>mr(h,{status:b}),experimentalAgents:T.experimentalAgents}):(0,re.jsx)(Fd,{tasks:jo,visibleCols:v,searchQuery:u,isLoading:a,onOpenPanel:(h,b,O)=>gr(h,b,O),onDrop:(h,b)=>mr(h,{status:b}),onReorder:cl,selectMode:ha,selectedTaskIds:xa,onToggleSelect:ul,agentStatuses:T.experimentalAgents===!0?le.default.useMemo(()=>new Map(ht.map(h=>[h.taskId,h.status])),[ht]):void 0,onRunSelectedAgents:T.experimentalAgents===!0?cr:void 0,onExitSelectMode:()=>{Bt(!1),Xr(new Set)},experimentalAgents:T.experimentalAgents}),l.open&&(0,re.jsxs)("div",{id:"detail-panel-container",style:{width:x,zIndex:N?30:10},className:N?"resizing":"",children:[(0,re.jsx)("div",{id:"detail-panel-resize-handle",onMouseDown:h=>{h.preventDefault(),m(!0),document.body.classList.add("vibeflow-resizing-panel");let b=h.clientX,O=x,X=se=>{let H=O-(se.clientX-b);I(Math.max(360,Math.min(860,H)))},de=se=>{m(!1),document.body.classList.remove("vibeflow-resizing-panel");let H=Math.max(360,Math.min(860,O-(se.clientX-b)));st.saveSettings({...T,panelWidth:H}),V(ae=>({...ae,panelWidth:H})),window.removeEventListener("mousemove",X),window.removeEventListener("mouseup",de)};window.addEventListener("mousemove",X),window.addEventListener("mouseup",de)}}),(0,re.jsx)(jd,{open:l.open,task:l.task,tab:l.tab,showLockIndicator:!1,addColumnId:l.addColumnId,gitUserName:fe,githubUrl:ee,baseUrl:eo,isResizing:N,api:st,onClose:()=>{Oe([]),s(h=>({...h,open:!1}))},onSave:async h=>{l.task&&await mr(l.task.id,h),s(b=>({...b,open:!1}))},onCreate:async h=>{let b=await Zr(h);return s(O=>({...O,open:!1})),b},onDelete:async h=>{await Da(h),s(b=>({...b,open:!1}))},onPatch:mr,onFilePreview:Jr,onGoBack:Xe.length>0?pl:void 0,navBackLabel:Xe.length>0?Xe[Xe.length-1].title:void 0,externalLocalChanges:si,allTasks:e,agentRun:ht.find(h=>{var b;return h.taskId===((b=l.task)==null?void 0:b.id)}),onRunAgent:Qr,onStopAgent:Yr,onDequeueAgent:va,models:B,defaultModel:T.defaultModel,perTypeModels:T.perTypeModels,defaultModelBug:T.defaultModelBug,defaultModelResearch:T.defaultModelResearch,defaultModelTask:T.defaultModelTask,agents:ge,experimentalAgents:T.experimentalAgents})]})]}),T.experimentalAgents===!0&&(0,re.jsx)(Jd,{open:$o,runs:ht,onStop:Yr,onOpenTask:h=>{let b=e.find(O=>O.id===h);b&&(gr(b,"agent"),Vo(!1))},onClose:()=>Vo(!1)}),hl&&(0,Lg.createPortal)((0,re.jsx)("div",{id:"ws-lost-overlay",style:{position:"fixed",top:0,left:0,width:"100vw",height:"100vh",zIndex:99999,background:"rgba(2, 6, 23, 0.88)",backdropFilter:"blur(4px)",WebkitBackdropFilter:"blur(4px)",display:"flex",alignItems:"center",justifyContent:"center",padding:16,pointerEvents:"all",cursor:"not-allowed"},children:(0,re.jsxs)("div",{style:{width:"min(420px, 92vw)",borderRadius:14,border:"1px solid var(--p-border-s)",background:"var(--p-card)",boxShadow:"0 16px 40px rgba(2,6,23,0.7)",padding:"20px 22px",display:"flex",flexDirection:"column",gap:10,cursor:"default",pointerEvents:"auto"},children:[(0,re.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:10},children:[(0,re.jsx)("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"var(--p-text-m)",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",style:{animation:"spin 1.1s linear infinite",flexShrink:0},children:(0,re.jsx)("path",{d:"M21 12a9 9 0 1 1-6.219-8.56"})}),(0,re.jsx)("span",{style:{fontSize:13,fontWeight:600,color:"var(--p-text)"},children:"Connection Lost"})]}),(0,re.jsx)("div",{style:{fontSize:12,color:"var(--p-text-m)",lineHeight:1.6},children:"Real-time connection to the server was interrupted. Reconnecting in the background\\u2026"})]})}),document.body),(0,re.jsx)(Yd,{open:c,visibleCols:v,settings:T,models:B,agents:ge,onClose:()=>p(!1),onSave:(h,b)=>{C(h);let O={...T,...b,visibleCols:h};V(O),st.saveSettings(O)}}),(0,re.jsx)(Zd,{open:g.open,name:g.name,url:g.url,onClose:()=>L(h=>({...h,open:!1}))})]})}var kg=E(K(),1),Cg=document.getElementById("root");Cg&&(0,wg.createRoot)(Cg).render((0,kg.jsx)(Ig,{}));})();\n/*! Bundled license information:\n\nreact/cjs/react.production.min.js:\n (**\n * @license React\n * react.production.min.js\n *\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *)\n\nscheduler/cjs/scheduler.production.min.js:\n (**\n * @license React\n * scheduler.production.min.js\n *\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *)\n\nreact-dom/cjs/react-dom.production.min.js:\n (**\n * @license React\n * react-dom.production.min.js\n *\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *)\n\nreact/cjs/react-jsx-runtime.production.min.js:\n (**\n * @license React\n * react-jsx-runtime.production.min.js\n *\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *)\n\nlucide-react/dist/esm/shared/src/utils.js:\nlucide-react/dist/esm/defaultAttributes.js:\nlucide-react/dist/esm/Icon.js:\nlucide-react/dist/esm/createLucideIcon.js:\nlucide-react/dist/esm/icons/bot.js:\nlucide-react/dist/esm/icons/chevron-down.js:\nlucide-react/dist/esm/icons/chevron-right.js:\nlucide-react/dist/esm/icons/circle-check-big.js:\nlucide-react/dist/esm/icons/clock.js:\nlucide-react/dist/esm/icons/download.js:\nlucide-react/dist/esm/icons/eye.js:\nlucide-react/dist/esm/icons/file-text.js:\nlucide-react/dist/esm/icons/flag.js:\nlucide-react/dist/esm/icons/folder-tree.js:\nlucide-react/dist/esm/icons/git-branch.js:\nlucide-react/dist/esm/icons/layout-dashboard.js:\nlucide-react/dist/esm/icons/list.js:\nlucide-react/dist/esm/icons/lock.js:\nlucide-react/dist/esm/icons/message-circle.js:\nlucide-react/dist/esm/icons/panels-top-left.js:\nlucide-react/dist/esm/icons/paperclip.js:\nlucide-react/dist/esm/icons/play.js:\nlucide-react/dist/esm/icons/plus.js:\nlucide-react/dist/esm/icons/search.js:\nlucide-react/dist/esm/icons/settings.js:\nlucide-react/dist/esm/icons/square-check-big.js:\nlucide-react/dist/esm/icons/square.js:\nlucide-react/dist/esm/icons/tag.js:\nlucide-react/dist/esm/icons/trash-2.js:\nlucide-react/dist/esm/icons/triangle-alert.js:\nlucide-react/dist/esm/icons/upload.js:\nlucide-react/dist/esm/icons/user.js:\nlucide-react/dist/esm/icons/workflow.js:\nlucide-react/dist/esm/icons/x.js:\nlucide-react/dist/esm/lucide-react.js:\n (**\n * @license lucide-react v0.468.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n *)\n*/\n';var er=Zt(import.meta.url),nr=Jt(er),tr=[un(nr,"kanban-template.html"),un(process.cwd(),"src","server","kanban-template.html"),un(process.cwd(),"dist","server","kanban-template.html")];function rr(n){let e=tr.find(r=>Gt(r));if(!e)throw new Error("kanban-template.html not found in expected locations");return Xt(e,"utf8").replaceAll("__PORT__",String(n))}function or(n){return n.saasMode?`window.__SAAS_MODE__ = true; window.__BOARD_URL__ = ${JSON.stringify(n.boardUrl??"")}; window.__BOARD_NAME__ = ${JSON.stringify(n.boardName??"")}; window.__IS_ADMIN__ = ${n.isAdmin?"true":"false"};`:""}var ar="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAxOCAxOCIgZmlsbD0ibm9uZSI+PHJlY3Qgd2lkdGg9IjE4IiBoZWlnaHQ9IjE4IiByeD0iNCIgZmlsbD0iIzI1NjNlYiIvPjxyZWN0IHg9IjIuNSIgeT0iNSIgd2lkdGg9IjIiIGhlaWdodD0iOCIgcng9IjEiIGZpbGw9IndoaXRlIiBvcGFjaXR5PSIwLjciLz48cmVjdCB4PSI2LjUiIHk9IjIiIHdpZHRoPSIyIiBoZWlnaHQ9IjE0IiByeD0iMSIgZmlsbD0id2hpdGUiLz48cmVjdCB4PSIxMC41IiB5PSI2IiB3aWR0aD0iMiIgaGVpZ2h0PSI2IiByeD0iMSIgZmlsbD0id2hpdGUiIG9wYWNpdHk9IjAuNyIvPjxyZWN0IHg9IjE0LjUiIHk9IjQiIHdpZHRoPSIyIiBoZWlnaHQ9IjEwIiByeD0iMSIgZmlsbD0id2hpdGUiIG9wYWNpdHk9IjAuODUiLz48L3N2Zz4=";function ir(n){return`<!DOCTYPE html>
|
|
29349
29532
|
<html lang="en" class="dark">
|
|
29350
29533
|
<head>
|
|
29351
29534
|
<meta charset="UTF-8">
|
|
29352
29535
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
29353
29536
|
<title>Vibeflow \u2014 Board</title>
|
|
29354
|
-
<link rel="icon" href="${
|
|
29537
|
+
<link rel="icon" href="${ar}" type="image/svg+xml">
|
|
29355
29538
|
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap" rel="stylesheet">
|
|
29356
|
-
<style>${
|
|
29539
|
+
<style>${An}</style>
|
|
29357
29540
|
</head>
|
|
29358
29541
|
<body class="h-screen overflow-hidden flex flex-col" style="background:#020c1b;">
|
|
29359
29542
|
<div id="root"></div>
|
|
29360
|
-
<script>window.__PORT__ = ${
|
|
29361
|
-
<script>${
|
|
29543
|
+
<script>window.__PORT__ = ${n.port}; ${or(n)}</script>
|
|
29544
|
+
<script>${ln}</script>
|
|
29362
29545
|
</body>
|
|
29363
|
-
</html>`}function
|
|
29364
|
-
`;case"t":return" ";case"r":return"\r";case"\\":return"\\";default:return r}})}function
|
|
29365
|
-
`)
|
|
29546
|
+
</html>`}function cn(n){let e=typeof n=="number"?{port:n}:n;return ln?ir(e):rr(e.port)}import{readFileSync as Mn,writeFileSync as Zo,mkdirSync as ea,existsSync as jn}from"fs";import{join as Hn,basename as sr}from"path";var On={port:3700};function lr(n){return Hn(n,B,Sn)}function Pe(n){let e=lr(n);if(!jn(e))return{...On};let r=Mn(e,"utf-8"),u=JSON.parse(r);return{...On,...u}}function Ue(n){let e=Hn(n,"package.json");if(jn(e))try{let r=JSON.parse(Mn(e,"utf-8"));if(r.name)return r.name}catch{}return sr(n)}import{mkdirSync as ur,writeFileSync as cr}from"fs";import{dirname as dr}from"path";import{randomBytes as pr}from"crypto";function Un(n){let e=n;return{...n,text:n.text||e.body||"",author:n.author??"agent"}}function pe(n,e){let r=le(n,e);return((r?ue(r):null)?.comments??[]).filter(d=>!d.deleted).map(Un)}function Wn(n){return n.replace(/\\(n|t|r|\\)/g,(e,r)=>{switch(r){case"n":return`
|
|
29547
|
+
`;case"t":return" ";case"r":return"\r";case"\\":return"\\";default:return r}})}function be(n,e,r,u,d,a,l){u=Wn(u);let i=le(n,e),s=(i?ue(i):null)?.comments??[],c={id:pr(8).toString("hex"),author:r,text:u,...d&&d.length>0?{files:d}:{},...a&&a!=="comment"?{type:a}:{},createdAt:new Date().toISOString(),source:l??"cli"},p=[...s,c];if(!V(n,e,{comments:p})){let h=Pn(n,e,new Date().toISOString());ur(dr(h),{recursive:!0}),cr(h,JSON.stringify({id:e,comments:p},null,2),"utf-8")}return c}function We(n,e,r,u){let d=le(n,e),l=(d?ue(d):null)?.comments??[],i=l.find(o=>o.id===r&&!o.deleted);return i?(i.text=Wn(u),i.updatedAt=new Date().toISOString(),V(n,e,{comments:l}),Un(i)):null}function $e(n,e,r){let u=le(n,e),a=(u?ue(u):null)?.comments??[],l=a.findIndex(i=>i.id===r&&!i.deleted);return l===-1?!1:(a[l]={...a[l],deleted:!0,text:"[Comment deleted]",updatedAt:new Date().toISOString()},V(n,e,{comments:a}),!0)}import{execSync as $n}from"child_process";import{existsSync as fr,readFileSync as mr,writeFileSync as da,mkdirSync as pa}from"fs";import{join as gr}from"path";var hr="config.json";function vr(n){return gr(n,B,hr)}function yr(n){let e=vr(n);if(!fr(e))return{};try{return JSON.parse(mr(e,"utf-8"))}catch{return{}}}function br(n){return n.length<=8?"***":n.slice(0,6)+"..."+n.slice(-4)}function kr(){try{return $n("gh auth token --hostname github.com",{encoding:"utf-8",timeout:5e3,stdio:["pipe","pipe","pipe"]}).trim()||null}catch{return null}}async function xr(n){try{let e=await fetch("https://api.github.com/user",{headers:{Authorization:`Bearer ${n}`,"User-Agent":"proto-studio-cli",Accept:"application/vnd.github+json"},signal:AbortSignal.timeout(5e3)});return e.ok?(await e.json()).login??null:null}catch{return null}}function wr(n){let e=process.env.GITHUB_TOKEN;if(e?.trim())return{token:e.trim(),source:"env"};let u=yr(n).copilotToken;if(typeof u=="string"&&u.trim())return{token:u.trim(),source:"config"};let d=kr();return d?{token:d,source:"gh-cli"}:null}async function Ae(n){let e=wr(n);if(!e)return{authenticated:!1,source:null,tokenHint:null,username:null};let r=await xr(e.token).catch(()=>null);return{authenticated:!0,source:e.source,tokenHint:br(e.token),username:r}}function ze(){try{return $n("gh --version",{encoding:"utf-8",timeout:3e3,stdio:["pipe","pipe","pipe"]}),!0}catch{return!1}}import{existsSync as dn,readFileSync as zn,writeFileSync as Bn,mkdirSync as Vn}from"fs";import{join as Be}from"path";import qn from"os";var Cr="settings.json";function Yn(){return Be(qn.homedir(),".vibeflow","settings.json")}function Kn(n){return Be(n,B,Cr)}function pn(){try{return JSON.parse(zn(Yn(),"utf-8"))}catch{return{}}}function Qn(n){let e=Be(qn.homedir(),".vibeflow");dn(e)||Vn(e,{recursive:!0}),Bn(Yn(),JSON.stringify(n,null,2),"utf-8")}function J(n){let e=pn(),r=Kn(n);if(!dn(r))return e;try{let u=JSON.parse(zn(r,"utf-8"));return{...e,...u}}catch{return e}}function Gn(n,e){let r=Be(n,B);dn(r)||Vn(r,{recursive:!0});let u=Kn(n),a={...J(n),...e};return Bn(u,JSON.stringify(a,null,2),"utf-8"),a}import Ve from"fs/promises";import Sr from"os";import fn from"path";var Er=fn.join(Sr.homedir(),".vibeflow"),qe=fn.join(Er,"token");async function Z(){try{return(await Ve.readFile(qe,"utf8")).trim()||null}catch{return null}}async function Xn(n){await Ve.mkdir(fn.dirname(qe),{recursive:!0}),await Ve.writeFile(qe,n,{mode:384})}async function Jn(){try{await Ve.unlink(qe)}catch{}}import{initTRPC as Pr,TRPCError as mn}from"@trpc/server";import{z as P}from"zod";var et=Pr.context().create(),Ir=et.router,ne=et.procedure,Zn=P.enum(["backlog","todo","in-progress","review","done"]),gn=P.object({id:P.string().min(1)}),nt=Ir({project:ne.query(({ctx:n})=>({name:Ue(n.projectDir),projectDir:n.projectDir})),copilotStatus:ne.query(async({ctx:n})=>await ze()?await Ae(n.projectDir):{authenticated:!1,reason:"gh CLI not found"}),tasks:ne.query(({ctx:n})=>({tasks:ie(n.projectDir).map(u=>({...u,createdAt:u.created,commentCount:(u.comments??[]).length,fileCount:tn(n.projectDir,u.id)}))})),searchTasks:ne.input(P.object({query:P.string().min(1),limit:P.number().int().min(1).max(100).optional(),pageScope:P.string().optional()})).query(({ctx:n,input:e})=>{let r=ie(n.projectDir),u=Math.max(1,e.limit??10),d=e.query.toLowerCase();return{results:r.filter(l=>`${l.title} ${l.description??""} ${l.type??""} ${l.component??""}`.toLowerCase().includes(d)).slice(0,u).map(l=>({score:1,task:l,commentCount:(l.comments??[]).length,fileCount:tn(n.projectDir,l.id)}))}}),createTask:ne.input(P.object({title:P.string().min(1),selector:P.string().min(1),description:P.string().optional(),cssSelector:P.string().optional(),url:P.string().optional(),type:P.string().optional(),priority:P.string().optional(),file:P.string().optional(),line:P.number().int().positive().optional(),col:P.number().int().positive().optional(),component:P.string().optional(),status:Zn.optional(),agent:P.string().optional(),model:P.string().optional(),author:P.string().optional(),annotatedElementText:P.string().max(300).optional()})).mutation(({ctx:n,input:e})=>{let r=Ee(n.projectDir,{title:e.title,description:e.description??"",selector:e.selector,cssSelector:e.cssSelector,url:e.url,status:e.status??"todo",screenshot:void 0,file:e.file,line:e.line,col:e.col,component:e.component,type:e.type,priority:e.priority,author:e.author??"Unknown",agent:e.agent,model:e.model,annotatedElementText:e.annotatedElementText});return n.broadcast({type:"tasks-updated"}),{success:!0,task:r}}),updateTask:ne.input(P.object({id:P.string().min(1),updates:P.object({status:Zn.optional(),title:P.string().min(1).optional(),description:P.string().optional(),type:P.string().optional(),priority:P.string().optional(),reportBack:P.boolean().optional(),agent:P.string().optional(),model:P.string().optional()})})).mutation(({ctx:n,input:e})=>{let r=V(n.projectDir,e.id,e.updates);if(!r)throw new mn({code:"NOT_FOUND",message:"Task not found"});return n.broadcast({type:"tasks-updated"}),{success:!0,task:r}}),deleteTask:ne.input(gn).mutation(({ctx:n,input:e})=>{if(!je(n.projectDir,e.id))throw new mn({code:"NOT_FOUND",message:"Task not found"});return n.broadcast({type:"tasks-updated"}),{success:!0}}),comments:ne.input(gn).query(({ctx:n,input:e})=>({comments:pe(n.projectDir,e.id)})),addComment:ne.input(P.object({taskId:P.string().min(1),text:P.string().min(1),author:P.enum(["user","agent"]).optional().default("user"),files:P.array(P.string()).optional(),source:P.enum(["cli","web"]).optional().default("web")})).mutation(({ctx:n,input:e})=>{let r=be(n.projectDir,e.taskId,e.author,e.text.trim(),e.files,void 0,e.source);return n.broadcast({type:"tasks-updated"}),{success:!0,comment:r}}),updateComment:ne.input(P.object({taskId:P.string().min(1),commentId:P.string().min(1),text:P.string().min(1)})).mutation(({ctx:n,input:e})=>{let r=We(n.projectDir,e.taskId,e.commentId,e.text.trim());if(!r)throw new mn({code:"NOT_FOUND",message:"Comment not found"});return{success:!0,comment:r}}),deleteComment:ne.input(P.object({taskId:P.string().min(1),commentId:P.string().min(1)})).mutation(({ctx:n,input:e})=>($e(n.projectDir,e.taskId,e.commentId),n.broadcast({type:"tasks-updated"}),{success:!0})),files:ne.input(gn).query(({ctx:n,input:e})=>({files:te(n.projectDir,e.id)})),models:ne.query(async()=>{try{let{execSync:n}=await import("child_process");return{models:n("opencode models",{encoding:"utf-8",timeout:1e4}).split(`
|
|
29548
|
+
`).map(d=>d.trim()).filter(d=>d.length>0&&!d.startsWith("#")).map(d=>{let a=d.split("/"),l=a[0]||"other",o=(a.slice(1).join("/")||d).replace(/-/g," ").replace(/(\d+\.\d+)/,"v$1").replace(/\b\w/g,s=>s.toUpperCase());return{id:d,label:o,provider:l}}),error:null}}catch(n){let e=n instanceof Error?n.message:"Unknown error";return{models:[],error:`OpenCode not found: ${e}`}}})});import{execSync as tt}from"child_process";function hn(n){try{let e=tt("git config user.name",{cwd:n,encoding:"utf8",stdio:["pipe","pipe","pipe"]}).trim(),r=tt("git config user.email",{cwd:n,encoding:"utf8",stdio:["pipe","pipe","pipe"]}).trim();return{name:e||"Unknown",email:r||""}}catch{return{name:"Unknown",email:""}}}function Ye(n){return/^[a-f0-9]{30}$/.test(n)}function Ie(n,e){let r=n.headers.origin;return r&&!r.startsWith("http://localhost")?(e.status(403).json({error:"Forbidden"}),!1):!0}var Or=new Set(["https://app.vibeflow.dev","https://vibeflow.dev","https://app.vibeflow.ai","https://vibeflow.ai"]);function Mr(n){if(!n)return null;try{let e=new URL(n).origin;return Or.has(e)?e:null}catch{return null}}var ii=Nr(import.meta.url);function gt(){for(let n of Object.values(Dr()))for(let e of n??[])if(e.family==="IPv4"&&!e.internal)return e.address;return null}function ht(n,e){n.get("/api/pages",(r,u)=>{u.json({pages:e})})}var it=new Map;function st(n){let r=it.get(n);if(r&&Date.now()-r.fetchedAt<3e5)return r.shas;try{let u=Oe("git log --remotes --format=%H",{cwd:n,timeout:5e3}).toString().trim(),d=new Set(u?u.split(`
|
|
29549
|
+
`):[]);return it.set(n,{shas:d,fetchedAt:Date.now()}),d}catch{return new Set}}function lt(n,e){return n?e.has(n):null}function vt(n,e,r){n.get("/api/project",(a,l)=>{l.json({name:Ue(e),projectDir:e})}),n.get("/api/tasks",(a,l)=>{let i=ie(e),o=st(e),s=i.map(c=>{let p=c.commits?.length?c.commits[c.commits.length-1].sha:void 0;return{...c,createdAt:c.created,commentCount:(c.comments??[]).filter(m=>!m.deleted).length,fileCount:c.files?.length??0,commitPushed:lt(p,o)}});l.json({tasks:s})}),n.param("id",(a,l,i,o)=>{if(!Ye(o)){l.status(400).json({error:"Invalid task id"});return}i()}),n.get("/api/tasks/:id",(a,l)=>{let{id:i}=a.params,o=le(e,i),s=o?ue(o):null;if(!s){l.status(404).json({error:"Task not found"});return}let c=st(e),p=s.commits?.length?s.commits[s.commits.length-1].sha:void 0;l.json({...s,commitPushed:lt(p,c)})}),n.post("/api/tasks",(a,l)=>{let{title:i,description:o,selector:s,cssSelector:c,url:p,type:m,priority:h,file:L,line:I,col:b,component:k,status:R,agent:U,model:K,screenshot:D,annotatedElementText:G,tags:ee}=a.body;if(!i||!s){l.status(400).json({error:"Missing required fields: title, selector"});return}let $=hn(e),f=Ee(e,{title:i,description:o||"",selector:s,cssSelector:c||void 0,url:p||void 0,status:["backlog","todo","in-progress","review","done"].includes(R)?R:"todo",file:L||void 0,line:I!=null?Number(I):void 0,col:b!=null?Number(b):void 0,component:k||void 0,type:m||void 0,priority:h||void 0,author:$.name,agent:U||void 0,model:K||void 0,annotatedElementText:G?String(G).slice(0,300):void 0,tags:Array.isArray(ee)?ee.filter(g=>typeof g=="string"&&g.length>0):void 0});if(D){let g=oe(e,B,Le);ot(g,{recursive:!0});let S=`${f.id}.png`;rt(oe(g,S),Buffer.from(D,"base64")),V(e,f.id,{screenshot:S}),f.screenshot=S}console.log(`[Proto] Task created: "${f.title}" (${f.id})`),r({type:"tasks-updated"}),l.json({success:!0,task:f})}),n.patch("/api/tasks/:id",(a,l)=>{let{id:i}=a.params,o=a.body,s=["backlog","todo","in-progress","review","done"];if(o.status!==void 0&&!s.includes(o.status)){l.status(400).json({error:`Invalid status: ${o.status}`});return}let c=V(e,i,o);if(!c){l.status(404).json({error:"Task not found"});return}console.log(`[Proto] Task updated: "${c.title}" (${c.id}) \u2192 status:${c.status}`),r({type:"task-changed",taskId:c.id,action:"update",task:c}),l.json({success:!0,task:c})}),n.delete("/api/tasks/:id",(a,l)=>{let{id:i}=a.params;if(!je(e,i)){l.status(404).json({error:"Task not found"});return}console.log(`[Proto] Task deleted: ${i}`),r({type:"task-deleted",taskId:i}),l.json({success:!0})}),n.get("/api/tasks/:id/comments",(a,l)=>{let{id:i}=a.params,o=pe(e,i);l.json({comments:o})}),n.post("/api/tasks/:id/comments",(a,l)=>{let{id:i}=a.params,{author:o,text:s,files:c,source:p}=a.body;if(!s||!s.trim()){l.status(400).json({error:"Missing required field: text"});return}let m=o==="agent"?"agent":"user",h=p==="cli"?"cli":"web",L=be(e,i,m,s.trim(),Array.isArray(c)?c:void 0,void 0,h);r({type:"tasks-updated"}),l.json({success:!0,comment:L})}),n.patch("/api/tasks/:id/comments/:commentId",(a,l)=>{let{id:i,commentId:o}=a.params,{text:s}=a.body;if(!s||!s.trim()){l.status(400).json({error:"Missing required field: text"});return}let c=We(e,i,o,s.trim());if(!c){l.status(404).json({error:"Comment not found"});return}l.json({success:!0,comment:c})}),n.delete("/api/tasks/:id/comments/:commentId",(a,l)=>{let{id:i,commentId:o}=a.params;if(!$e(e,i,o)){l.status(404).json({error:"Comment not found"});return}r({type:"tasks-updated"}),l.json({success:!0})}),n.get("/api/tasks/:id/files",(a,l)=>{let{id:i}=a.params,o=te(e,i);l.json({files:o})}),n.get("/api/tasks/:id/files/:filename",(a,l)=>{let{id:i,filename:o}=a.params,s=Rn(e,i,o);if(!s){l.status(404).json({error:"File not found"});return}l.sendFile(s)});let u=new Set([".png",".jpg",".jpeg",".gif",".webp",".pdf",".txt",".md",".json",".csv",".svg",".mp4",".mov",".zip"]);n.post("/api/tasks/:id/files/:filename",fe.raw({type:"*/*",limit:"50mb"}),(a,l)=>{let{id:i,filename:o}=a.params;if(!o||o.includes("/")||o.includes("\\")){l.status(400).json({error:"Invalid filename"});return}let s=dt(decodeURIComponent(o)).toLowerCase();if(!u.has(s)){l.status(415).json({error:"File type not allowed"});return}let c=a.body;if(!Buffer.isBuffer(c)||c.length===0){l.status(400).json({error:"Empty file body"});return}let p=Tn(e,i,decodeURIComponent(o),c);r({type:"tasks-updated"}),l.json({success:!0,file:p})}),n.delete("/api/tasks/:id/files/:filename",(a,l)=>{let{id:i,filename:o}=a.params;if(!_n(e,i,o)){l.status(404).json({error:"File not found"});return}be(e,i,"user",`\u{1F5D1}\uFE0F File removed: \`${o}\``,void 0,"system","web"),r({type:"tasks-updated"}),l.json({success:!0})});let d=oe(e,B,Le);n.post("/api/tasks/:id/screenshot",fe.json(),(a,l)=>{let{id:i}=a.params,{screenshot:o}=a.body;if(!le(e,i)){l.status(404).json({error:"Task not found"});return}if(!o){l.status(400).json({error:"Missing screenshot"});return}ot(d,{recursive:!0});let s=`${i}.png`;rt(oe(d,s),Buffer.from(o,"base64")),V(e,i,{screenshot:s}),r({type:"tasks-updated"}),l.json({success:!0,screenshot:s})}),n.delete("/api/tasks/:id/screenshot",(a,l)=>{let{id:i}=a.params;if(!le(e,i)){l.status(404).json({error:"Task not found"});return}let o=`${i}.png`,s=oe(d,o);yn(s)&&ct(s),V(e,i,{screenshot:void 0}),r({type:"tasks-updated"}),l.json({success:!0})})}function yt(n,e,r){n.get("/api/user",(i,o)=>{o.json(hn(e))}),n.get("/api/settings",(i,o)=>{o.json(J(e))}),n.post("/api/settings",(i,o)=>{if(!Ie(i,o))return;let s=new Set(["visibleCols","viewMode","panelWidth","autoCommit","autoComment","autoPush","createBranch","defaultModel","perTypeModels","defaultModelBug","defaultModelResearch","defaultModelTask"]),c=Object.fromEntries(Object.entries(i.body).filter(([m])=>s.has(m))),p=Gn(e,c);o.json({success:!0,settings:p})}),n.get("/api/push/workspaces",async(i,o)=>{let s=await Z().catch(()=>null);if(!s){o.status(401).json({error:"Not logged in"});return}let c=process.env.SPOTA_API_URL??"http://localhost:3000";try{let p=await fetch(`${c}/api/cli/workspaces`,{headers:{Authorization:`Bearer ${s}`}});if(!p.ok){let h=(await p.json().catch(()=>({}))).error??`HTTP ${p.status} from ${c}`;console.error(`[Proto] GET /api/push/workspaces failed: ${h}`),o.status(p.status).json({error:h});return}o.json(await p.json())}catch(p){let m=p instanceof Error?p.message:String(p);console.error(`[Proto] GET /api/push/workspaces network error: ${m}`),o.status(502).json({error:`Network error contacting SaaS API: ${m}`})}}),n.post("/api/push",fe.json(),async(i,o)=>{let{workspaceId:s,keepLocalFiles:c}=i.body,p=await Z().catch(()=>null);if(!p){o.status(401).json({error:"Not logged in"});return}let m=de(e);if(m.length===0){o.json({imported:0,message:"No local tasks found"});return}let h=process.env.SPOTA_API_URL??"http://localhost:3000",L={tasks:m};s&&(L.workspaceId=s);try{let I=await fetch(`${h}/api/cli/import`,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${p}`},body:JSON.stringify(L)});if(!I.ok){let k=await I.json().catch(()=>({}));o.status(I.status).json({error:k.error??"Import failed"});return}let b=await I.json();if(!c){for(let k of m)try{ct(k.filePath)}catch{}r?.({type:"tasks-updated"})}o.json({imported:b.imported,skipped:b.skipped??0,workspaceId:b.workspaceId,boardId:b.boardId})}catch(I){let b=I instanceof Error?I.message:String(I);console.error(`[Proto] POST /api/push network error: ${b}`),o.status(502).json({error:`Network error contacting SaaS API: ${b}`})}}),n.get("/api/copilot/status",(i,o)=>{Ae(e).then(s=>o.json(s)).catch(s=>{console.error(`[Proto] GET /api/copilot/status error: ${s instanceof Error?s.message:String(s)}`),o.json({authenticated:!1,source:null,tokenHint:null,username:null})})}),n.post("/api/copilot/login",async(i,o)=>{if(Ie(i,o))try{let s=await Ae(e);if(s.authenticated){o.json({launched:!1,alreadyAuthenticated:!0,username:s.username??null});return}if(!ze()){o.status(400).json({launched:!1,error:"GitHub CLI is not installed. Install gh and authenticate with 'gh auth login'."});return}at("gh",["auth","login","--web","--hostname","github.com","--git-protocol","https","--scopes","read:user,copilot"],{cwd:e,detached:!0,stdio:"ignore"}).unref(),o.json({launched:!0})}catch(s){let c=s instanceof Error?s.message:String(s);console.error(`[Proto] POST /api/copilot/login error: ${c}`),o.status(500).json({launched:!1,error:c})}});let u=null;n.get("/api/agent-status",(i,o)=>{o.json(u??{message:"",active:!1,updatedAt:null})}),n.post("/api/agent-status",(i,o)=>{if(!Ie(i,o))return;let{message:s,active:c}=i.body;u={message:(s??"").slice(0,200),active:c!==!1,updatedAt:new Date().toISOString()},r?.({type:"agent-status",...u}),o.json({ok:!0})}),n.delete("/api/agent-status",(i,o)=>{Ie(i,o)&&(u=null,r?.({type:"agent-status",message:"",active:!1,updatedAt:null}),o.json({ok:!0}))});let d=new Map,a=new Map;function l(i,o){try{let s=JSON.parse(o);if(s.type==="step_finish"&&typeof s.part=="object"&&s.part){let c=s.part,p=c.tokens,m=typeof c.cost=="number"?c.cost:0;if(p){let h=a.get(i)??{inputTokens:0,outputTokens:0,totalTokens:0,reasoningTokens:0,cost:0};a.set(i,{inputTokens:h.inputTokens+(p.input??0),outputTokens:h.outputTokens+(p.output??0),totalTokens:h.totalTokens+(p.total??0),reasoningTokens:h.reasoningTokens+(p.reasoning??0),cost:h.cost+m})}}}catch{}}n.post("/api/agent/run",fe.json(),async(i,o)=>{if(!Ie(i,o))return;let{taskId:s,model:c,agent:p}=i.body;if(!s){o.status(400).json({error:"taskId is required"});return}if(!Ye(s)){o.status(400).json({error:"Invalid task ID"});return}let m=le(e,s);if(!m){o.status(404).json({error:"Task not found"});return}let h=ue(m);if(!h){o.status(404).json({error:"Task not found"});return}let L=pe(e,s).filter(f=>!f.deleted),I=Pe(e),b=te(e,s).map(f=>({...f,url:`http://localhost:${I.port}${f.url}`})),k=J(e),R=(h.type??"").toLowerCase()==="research",U=(h.type??"").toLowerCase()==="bug",K=De(h,m,L,b,e),D=He({hasResearchTasks:R,hasBugTasks:U,autoCommit:k.autoCommit,autoPush:k.autoPush,autoComment:k.autoComment,createBranch:k.createBranch}),G=`${K}
|
|
29550
|
+
|
|
29551
|
+
${D}`;try{Oe("which opencode",{timeout:5e3})}catch{o.status(500).json({error:"opencode is not installed. Install it to run agents."});return}if(d.has(s)){o.status(409).json({error:"Agent already running for this task"});return}let ee=["run","--dangerously-skip-permissions","--format","json","--",G];c&&ee.splice(2,0,"--model",c),p&&ee.splice(2,0,"--agent",p),r?.({type:"agent-run-started",taskId:s,model:c,agent:p,command:`opencode ${ee.join(" ")}`});let $=at("opencode",ee,{cwd:e,env:{...process.env,FORCE_COLOR:"0"}});d.set(s,$),a.set(s,{inputTokens:0,outputTokens:0,totalTokens:0,reasoningTokens:0,cost:0});let ve="";$.stdout?.on("data",f=>{let g=f.toString();ve+=g;for(let S of g.split(`
|
|
29552
|
+
`))S.trim()&&l(s,S.trim());r?.({type:"agent-run-log",taskId:s,log:g})}),$.stderr?.on("data",f=>{let g=f.toString();ve+=g,r?.({type:"agent-run-log",taskId:s,log:g})}),$.on("close",f=>{d.delete(s);let g=a.get(s);a.delete(s),r?.({type:"agent-run-finished",taskId:s,exitCode:f,success:f===0,...g??{}})}),$.on("error",f=>{d.delete(s);let g=a.get(s);a.delete(s),r?.({type:"agent-run-finished",taskId:s,exitCode:1,success:!1,error:f.message,...g??{}})}),o.json({ok:!0,taskId:s,command:`opencode ${ee.join(" ")}`})}),n.post("/api/agent/stop",fe.json(),(i,o)=>{if(!Ie(i,o))return;let{taskId:s}=i.body;if(!s){o.status(400).json({error:"taskId is required"});return}let c=d.get(s);if(!c){o.status(404).json({error:"No active agent run for this task"});return}c.kill("SIGINT"),o.json({ok:!0,taskId:s})}),n.get("/api/agent/agents",(i,o)=>{try{let c=Oe("opencode agent list",{cwd:e,timeout:1e4,env:{...process.env,FORCE_COLOR:"0"}}).toString().split(`
|
|
29553
|
+
`).map(p=>p.trim()).filter(p=>/^[A-Za-z][A-Za-z0-9_-]+ \(/.test(p)).map(p=>{let m=p.match(/^([A-Za-z][A-Za-z0-9_-]+)\s+\((.+)\)$/);return m?{id:m[1],name:m[1],scope:m[2]}:null}).filter(Boolean);o.json({agents:c})}catch{o.json({agents:[]})}}),n.get("/api/agent/models",async(i,o)=>{try{let s=Oe("opencode models",{cwd:e,timeout:15e3,env:{...process.env,FORCE_COLOR:"0"}}).toString(),c=[];for(let p of s.split(`
|
|
29554
|
+
`)){let h=p.trim().match(/^([a-z0-9-]+)\/([a-z0-9._-]+)\s+(.+)$/i);h&&c.push({id:`${h[1]}/${h[2]}`,label:h[3].trim(),provider:h[1]})}o.json({models:c})}catch{o.json({models:[]})}}),n.get("/api/github-url",(i,o)=>{try{let s=Oe("git remote get-url origin",{cwd:e,timeout:3e3}).toString().trim(),c=s.match(/^git@github\.com:(.+?)(?:\.git)?$/);if(c){o.json({githubUrl:`https://github.com/${c[1]}`});return}let p=s.match(/^(https?:\/\/github\.com\/[^/]+\/[^/]+?)(?:\.git)?$/);if(p){o.json({githubUrl:p[1]});return}}catch{}o.json({githubUrl:null})})}function bt(n,e){let r=process.env.SPOTA_ADMIN_EMAIL??"",u=process.env.SPOTA_API_URL??"http://localhost:3000";n.get("/kanban",async(d,a)=>{let l=await Z().catch(()=>null);if(!l){a.type("html").send(cn({port:e}));return}let i=await re().catch(()=>null),o=!1;if(r)try{let c=await fetch(`${u}/api/cli/profile`,{headers:{Authorization:`Bearer ${l}`}}).catch(()=>null);c?.ok&&(o=(await c.json()).email===r)}catch{}let s={port:e,saasMode:!0,boardUrl:i?.url??`${u}/kanban`,boardName:i?.name,isAdmin:o};a.type("html").send(cn(s))})}var jr=`*{box-sizing:border-box;margin:0;padding:0}
|
|
29366
29555
|
body{font-family:system-ui,sans-serif;background:#0f172a;color:#e2e8f0;padding:32px;max-width:700px;margin:0 auto}
|
|
29367
29556
|
h1{font-size:22px;font-weight:700;color:#f1f5f9;margin-bottom:6px}
|
|
29368
29557
|
h2{font-size:14px;font-weight:600;color:#94a3b8;margin:24px 0 8px;text-transform:uppercase;letter-spacing:.06em}
|
|
@@ -29375,45 +29564,46 @@ code{font-family:monospace;font-size:12px;color:#a5b4fc;word-break:break-all}
|
|
|
29375
29564
|
.badge{display:inline-block;padding:2px 8px;background:rgba(59,130,246,.15);border:1px solid rgba(59,130,246,.3);border-radius:10px;font-size:11px;color:#60a5fa;margin-left:6px}
|
|
29376
29565
|
.badge.green{background:rgba(34,197,94,.15);border-color:rgba(34,197,94,.3);color:#4ade80}
|
|
29377
29566
|
pre{background:#050d1a;border:1px solid #1e293b;border-radius:6px;padding:12px;overflow-x:auto;font-family:monospace;font-size:12px;color:#a5b4fc;margin-top:8px}
|
|
29378
|
-
.note{font-size:11px;color:#64748b;margin-top:8px;padding:8px 10px;background:#0a0f1e;border-radius:6px;border-left:3px solid #334155}`;function
|
|
29567
|
+
.note{font-size:11px;color:#64748b;margin-top:8px;padding:8px 10px;background:#0a0f1e;border-radius:6px;border-left:3px solid #334155}`;function vn(n){return n.replace(/</g,"<").replace(/>/g,">")}var Hr="data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32' fill='none'%3E%3Crect width='32' height='32' rx='7' fill='%232563eb'/%3E%3Crect x='7' y='13' width='3.5' height='10' rx='1.5' fill='white' opacity='.75'/%3E%3Crect x='12.25' y='8.5' width='3.5' height='15' rx='1.5' fill='white'/%3E%3Crect x='17.5' y='14.5' width='3.5' height='8' rx='1.5' fill='white' opacity='.75'/%3E%3Crect x='22.5' y='11' width='2.5' height='11' rx='1.25' fill='white' opacity='.85'/%3E%3C/svg%3E";function ut(n,e){return`<!DOCTYPE html>
|
|
29379
29568
|
<html lang="en">
|
|
29380
|
-
<head><meta charset="UTF-8"><title>Vibeflow \u2014 Inject Overlay</title><link rel="icon" type="image/svg+xml" href="${
|
|
29569
|
+
<head><meta charset="UTF-8"><title>Vibeflow \u2014 Inject Overlay</title><link rel="icon" type="image/svg+xml" href="${Hr}"><style>${jr}</style></head>
|
|
29381
29570
|
<body>
|
|
29382
29571
|
<h1>Vibeflow \u2014 Inject Overlay</h1>
|
|
29383
|
-
<p style="margin-top:6px">${
|
|
29572
|
+
<p style="margin-top:6px">${n}</p>
|
|
29384
29573
|
${e.join(`
|
|
29385
29574
|
`)}
|
|
29386
|
-
</body></html>`}function
|
|
29575
|
+
</body></html>`}function kt(n,e,r,u){let d=r?r.replace(/[^a-zA-Z0-9_-]/g,""):void 0;if(u){let c=`${u}/api/overlay.js`,p=d?`window.__PROTO_BOARD_ID='${d}';`:"",m=`javascript:(function(){if(document.getElementById('vibeflow-studio-root')){alert('Vibeflow overlay is already active.')}else{${p}fetch('${c}').then(function(r){return r.text()}).then(function(code){eval(code)}).catch(function(){alert('Failed to load Vibeflow overlay')})}})()`,h=`${p}fetch('${c}').then(r=>r.text()).then(code=>eval(code));`,L=d?`<script src="${c}" data-vibeflow-overlay data-board-id="${d}"></script>`:`<script src="${c}" data-vibeflow-overlay></script>`;n.get("/inject",(I,b)=>{b.type("html").send(ut(`Add the Vibeflow overlay to any page to annotate and create tasks.${d?`<br><span style="font-size:12px;color:#64748b">Connected to board <code style="background:#1e293b;padding:2px 6px;border-radius:4px">${d}</code> via SaaS.</span>`:""}`,[`<h2>Option 1 \u2014 Bookmarklet <span class="badge green">CSP-safe</span> <span class="badge">recommended</span></h2>
|
|
29387
29576
|
<div class="card"><p>Drag this link to your bookmarks bar, then click it on any page to activate the overlay:</p>
|
|
29388
|
-
<a class="bookmarklet" href="${
|
|
29577
|
+
<a class="bookmarklet" href="${m}"><svg class='bookmarklet-icon' viewBox='0 0 32 32' fill='none' xmlns='http://www.w3.org/2000/svg'><rect x='7' y='13' width='3.5' height='10' rx='1.5' fill='white' opacity='.75'/><rect x='12.25' y='8.5' width='3.5' height='15' rx='1.5' fill='white'/><rect x='17.5' y='14.5' width='3.5' height='8' rx='1.5' fill='white' opacity='.75'/><rect x='22.5' y='11' width='2.5' height='11' rx='1.25' fill='white' opacity='.85'/></svg>Vibeflow annotate</a>
|
|
29389
29578
|
<div class="note">\u2705 Works on pages with strict Content-Security-Policy (uses fetch + eval instead of <script src>).<br>\u26A0\uFE0F Do not click the link here \u2014 drag it to your bookmarks bar first, then use it on your target page.</div></div>`,`<h2>Option 2 \u2014 Browser console <span class="badge green">CSP-safe</span></h2>
|
|
29390
29579
|
<div class="card"><p>Open browser DevTools console on your target page and paste:</p>
|
|
29391
|
-
<pre>${
|
|
29580
|
+
<pre>${vn(h)}</pre>
|
|
29392
29581
|
<div class="note">\u2705 Works on most pages \u2014 uses fetch + eval which respects <code>connect-src https:</code> and <code>unsafe-eval</code>.</div></div>`,`<h2>Option 3 \u2014 Script tag</h2>
|
|
29393
29582
|
<div class="card"><p>Add this tag to your HTML (before <code></body></code>):</p>
|
|
29394
|
-
<pre>${
|
|
29395
|
-
<div class="note">Requires your CSP to allow loading scripts from <code>${
|
|
29583
|
+
<pre>${vn(L)}</pre>
|
|
29584
|
+
<div class="note">Requires your CSP to allow loading scripts from <code>${u}</code>. Suitable when you control the page's HTML.</div></div>`]))});return}let a=`http://localhost:${e}/vibeflow-overlay.js`,l=d?` data-board-id="${d}"`:"",i=`<script src="${a}" data-vibeflow-overlay${l}></script>`,o=d?`s.setAttribute('data-board-id','${d}');`:"",s=`javascript:(function(){if(document.getElementById('vibeflow-studio-root')){alert('Vibeflow overlay is already active on this page.');}else{var s=document.createElement('script');s.src='${a}';s.setAttribute('data-vibeflow-overlay','');${o}document.head.appendChild(s);}})()`;n.get("/inject",(c,p)=>{p.type("html").send(ut("Add the Vibeflow overlay to any page without modifying source code.",[`<h2>Option 1 \u2014 Bookmarklet <span class="badge">recommended</span></h2>
|
|
29396
29585
|
<div class="card"><p>Drag this link to your bookmarks bar, then click it on any page to activate the overlay:</p>
|
|
29397
|
-
<a class="bookmarklet" href="${
|
|
29586
|
+
<a class="bookmarklet" href="${s}"><svg class='bookmarklet-icon' viewBox='0 0 32 32' fill='none' xmlns='http://www.w3.org/2000/svg'><rect x='7' y='13' width='3.5' height='10' rx='1.5' fill='white' opacity='.75'/><rect x='12.25' y='8.5' width='3.5' height='15' rx='1.5' fill='white'/><rect x='17.5' y='14.5' width='3.5' height='8' rx='1.5' fill='white' opacity='.75'/><rect x='22.5' y='11' width='2.5' height='11' rx='1.25' fill='white' opacity='.85'/></svg>Vibeflow annotate</a>
|
|
29398
29587
|
<div class="note">\u26A0\uFE0F Do not click the link here \u2014 drag it to your bookmarks bar first, then use it on your target page.</div></div>`,`<h2>Option 2 \u2014 Script tag</h2>
|
|
29399
29588
|
<div class="card"><p>Add this tag to your HTML (before <code></body></code>):</p>
|
|
29400
|
-
<pre>${
|
|
29589
|
+
<pre>${vn(i)}</pre>
|
|
29401
29590
|
<div class="note">Requires the proto server to be running at port ${e}. Works without the Chrome extension.</div></div>`,`<h2>Option 3 \u2014 Browser console</h2>
|
|
29402
29591
|
<div class="card"><p>Open browser DevTools console and paste:</p>
|
|
29403
|
-
<pre>var s=document.createElement('script');s.src='${
|
|
29592
|
+
<pre>var s=document.createElement('script');s.src='${a}';s.setAttribute('data-vibeflow-overlay','');${d?`s.setAttribute('data-board-id','${d}');`:""}document.head.appendChild(s);</pre></div>`,'<div class="note" style="margin-top:20px">\u2699\uFE0F <strong>CSP note:</strong> If your app sets a strict Content-Security-Policy, use the Chrome extension instead \u2014 it bypasses CSP by injecting in the main world.</div>']))})}function xt(n,e,r){n.use("/trpc",Ar({router:nt,createContext:()=>({projectDir:e,broadcast:r})}))}function wt(n){n.use((e,r,u,d)=>{console.error("[Proto] Unhandled error:",e.message),u.status(500).json({error:"Internal server error"})})}function Ct(n){n.use((e,r,u)=>{if(r.setHeader("Access-Control-Allow-Origin","*"),r.setHeader("Access-Control-Allow-Methods","GET, POST, PATCH, DELETE, OPTIONS"),r.setHeader("Access-Control-Allow-Headers","Content-Type"),e.method==="OPTIONS"){r.status(204).end();return}u()})}function St(n){n.disable("x-powered-by"),n.use((e,r,u)=>{r.setHeader("Content-Security-Policy",["default-src 'self'","script-src 'self' 'unsafe-inline' 'unsafe-eval' blob: https://cdn.tailwindcss.com https://unpkg.com","style-src 'self' 'unsafe-inline' https://fonts.googleapis.com","font-src 'self' https://fonts.gstatic.com","img-src 'self' data: blob:","connect-src 'self' ws://localhost:* ws://127.0.0.1:* wss://localhost:* wss://127.0.0.1:*","frame-ancestors 'none'","object-src 'none'","base-uri 'self'","form-action 'self'","worker-src 'self' blob:"].join("; ")),r.setHeader("Permissions-Policy","camera=(), microphone=(), geolocation=()"),r.setHeader("X-Content-Type-Options","nosniff"),r.setHeader("X-Frame-Options","DENY"),r.setHeader("Referrer-Policy","strict-origin-when-cross-origin"),r.setHeader("Cross-Origin-Embedder-Policy","unsafe-none"),r.setHeader("Cross-Origin-Opener-Policy","same-origin"),u()})}async function Ur(n,e){let r=e._testToken!==void 0?e._testToken:await Z().catch(()=>null),u=e._testWorkspace!==void 0?e._testWorkspace:r?await re().catch(()=>null):null,d=!!(r&&u),a=fe();Ct(a),St(a),a.use(fe.json({limit:"10mb"}));let l=pt(a),i=new ft({server:l}),o=p=>{let m=JSON.stringify(p);for(let h of i.clients)h.readyState===mt.OPEN&&h.send(m)};i.on("connection",p=>{p.on("message",m=>{try{JSON.parse(m.toString()).type==="ping"&&p.send(JSON.stringify({type:"pong"}))}catch{}})});let s=Mr(u?.url)??process.env.SPOTA_API_URL??"http://localhost:3000";if(d){a.use(["/api/tasks","/api/push","/trpc"],(m,h)=>{h.status(503).json({error:"Online mode active \u2014 local task API is disabled. All task operations go through the SaaS backend."})});let p=Dn(s);a.get("/vibeflow-overlay.js",(m,h)=>{h.type("application/javascript").send(p)})}else{Fe(n);let p=sn(e.port);a.get("/vibeflow-overlay.js",(h,L)=>{L.type("application/javascript").send(p)});let m=oe(n,B,Le);a.get("/screenshots/:filename",(h,L)=>{let{filename:I}=h.params,b=ce(I,".png");if(!Ye(b)){L.status(400).end();return}let k=oe(m,`${b}.png`);if(!yn(k)){L.status(404).end();return}L.sendFile(k)}),ht(a,[]),vt(a,n,o),xt(a,n,o),yt(a,n,o)}bt(a,e.port),kt(a,e.port,d?u?.id:void 0,d?s:void 0);let c=d?null:on(oe(n,B,Ne),{onChanged:p=>{let m=ue(p);o(m?{type:"task-changed",taskId:m.id,action:"update",task:m,source:"cli"}:{type:"tasks-updated"})},onDeleted:p=>{let m=ce(p,".json");o({type:"task-deleted",taskId:m})}});return wt(a),new Promise((p,m)=>{let h=e.host??"localhost";l.listen(e.port,h,()=>{let I=`http://${h==="0.0.0.0"?gt()??"localhost":h}:${e.port}`,b=h==="0.0.0.0"?`http://localhost:${e.port}`:null,k=y.dim(" "+"\u2500".repeat(62));console.log(),console.log(y.green(" \u2713 Vibeflow running")+y.dim(" \xB7 ")+y.cyan(I)),b&&console.log(y.dim(" Local: ")+y.cyan(b)),console.log(k),d?(console.log(y.dim(" Mode: ")+y.green("\u25CF Online")+y.dim(" \u2014 connected to Vibeflow SaaS")),console.log(y.dim(" Board: ")+y.white(u.name??"your board")),console.log(y.dim(" Web: ")+y.cyan(u.url)),console.log(k),console.log(y.dim(" Overlay script: ")+y.cyan(`${I}/vibeflow-overlay.js`)),console.log(),console.log(y.dim(" \u250C\u2500 Add to your HTML ")+y.dim("\u2500".repeat(43)+"\u2510")),console.log(y.dim(" \u2502 ")+y.yellow(`<script src="${I}/vibeflow-overlay.js" data-vibeflow-overlay></script>`)+y.dim(" \u2502")),console.log(y.dim(" \u2502 ")+y.dim("Or drag the bookmarklet: ")+y.cyan(`${I}/inject`)+y.dim(" \u2502")),console.log(y.dim(" \u2514"+"\u2500".repeat(63)+"\u2518"))):(console.log(y.dim(" Mode: ")+y.yellow("\u25CE Local")+y.dim(" \u2014 no account needed")),console.log(k),console.log(y.bold.white(" BOARDS & APIS")),console.log(y.dim(" Kanban board ")+y.cyan(`${I}/kanban`)),console.log(y.dim(" Task API ")+y.cyan(`${I}/api/tasks`)),console.log(k),console.log(y.bold.white(" INTEGRATE INTO YOUR APP")+y.dim(` (full guide: ${I}/inject)`)),console.log(y.dim(" 1. Add this script tag to your HTML:")),console.log(y.dim(" ")+y.yellow(`<script src="${I}/vibeflow-overlay.js" data-vibeflow-overlay></script>`)),console.log(y.dim(" 2. Reload your page \u2014 the overlay appears automatically.")),console.log(y.dim(" 3. Click anything to annotate it.")),console.log(k),console.log(y.dim(" Bookmarklet \u2014 no code changes needed:")),console.log(y.dim(" Visit and drag the bookmarklet from ")+y.cyan(`${I}/inject`)+y.dim(" to your bookmarks bar."))),console.log(),console.log(y.dim(" Press Ctrl+C to stop")),console.log(),p({url:I,close:async()=>{c&&await c.close(),i.close(),await new Promise(R=>l.close(()=>R()))}})}),l.on("error",m)})}async function bn(n,e){if(!n)return Ur(e.projectDir??process.cwd(),e);if(n.startsWith("http://")||n.startsWith("https://"))throw new Error(`Proxy mode is no longer supported.
|
|
29404
29593
|
To annotate an existing app, run: proto serve (API-only mode)
|
|
29405
|
-
Then install the Chrome extension and navigate to your app.`);let r=
|
|
29594
|
+
Then install the Chrome extension and navigate to your app.`);let r=Lr(n),d=Rr(r).isDirectory(),a=d?_r(r).filter(k=>dt(k)===".html").map(k=>oe(r,k)):[r];if(a.length===0)throw new Error("No HTML files found at "+n);let l=d?r:Fr(r);Fe(l);let i=fe();Ct(i),St(i),i.use(fe.json({limit:"10mb"}));let o=pt(i),s=new ft({server:o}),c=k=>{let R=JSON.stringify(k);for(let U of s.clients)U.readyState===mt.OPEN&&U.send(R)};s.on("connection",k=>{k.on("message",R=>{try{JSON.parse(R.toString()).type==="ping"&&k.send(JSON.stringify({type:"pong"}))}catch{}})});let p=e.noOverlay?null:sn(e.port);p&&i.get("/vibeflow-overlay.js",(k,R)=>{R.type("application/javascript").send(p)});let m=oe(l,B,Le);i.get("/screenshots/:filename",(k,R)=>{let{filename:U}=k.params,K=ce(U,".png");if(!Ye(K)){R.status(400).end();return}let D=oe(m,`${K}.png`);if(!yn(D)){R.status(404).end();return}R.sendFile(D)}),d&&i.get("/",(k,R)=>{let U=a.map(K=>{let D=ce(K);return`<li><a href="/${D}">${D}</a></li>`}).join(`
|
|
29406
29595
|
`);R.send(`<!DOCTYPE html><html><head><title>Vibeflow Studio</title>
|
|
29407
29596
|
<style>body{font-family:system-ui;max-width:600px;margin:40px auto;padding:0 20px}
|
|
29408
29597
|
a{color:#2563eb;text-decoration:none}a:hover{text-decoration:underline}
|
|
29409
29598
|
li{margin:8px 0}</style></head>
|
|
29410
29599
|
<body><h1>Vibeflow Studio</h1>
|
|
29411
29600
|
<p>Select a prototype to review:</p>
|
|
29412
|
-
<ul>${
|
|
29413
|
-
Push them to your board now? [Y/n]: `),async
|
|
29414
|
-
Login timed out. Please try again.`)),process.exitCode=1}import
|
|
29415
|
-
Uploading ${
|
|
29416
|
-
`),{uploaded:s,failed:l,failedFiles:g}}async function Rt(t,e){let r=eo(t),i=await Q();if(!i&&(console.log(q.yellow(" Not logged in. Starting login flow...")),await Ve(),i=await Q(),!i)){console.error(q.red(" Login failed. Please run `vibeflow login` and try again.")),process.exitCode=1;return}let c=pe(r);if(c.length===0){console.log(q.dim(" No local tasks found. Nothing to push."));return}console.log(q.cyan(` Found ${c.length} local task(s). Pushing to SaaS...`));let o=ro(),a=e.workspace;if(!a){let E=await ne();E&&(a=E.id,console.log(q.dim(` Using board: ${E.icon??""} ${E.name}`)))}let s={tasks:c};a&&(s.workspaceId=a);let l;try{let E=await fetch(`${o}/api/cli/import`,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${i}`},body:JSON.stringify(s)});if(!E.ok){let S=await E.json().catch(()=>({}));console.error(q.red(` Import failed: ${E.status} ${S.error??E.statusText}`)),process.exitCode=1;return}l=await E.json()}catch(E){let S=E instanceof Error?E.message:String(E);console.error(q.red(` Network error: ${S}`)),process.exitCode=1;return}console.log(q.green(` \u2713 Pushed ${l.imported} task(s) to SaaS`)),l.skipped&&l.skipped>0&&console.log(q.dim(` Skipped ${l.skipped} already-imported task(s).`));let f=(await ne())?.name??l.workspaceId;console.log(q.dim(` Board: ${f}`));let u=l.idMap??{},g=c.filter(E=>E.id&&u[E.id]).map(E=>({localId:E.id,remoteId:u[E.id]})),{uploaded:h,failed:k,failedFiles:L}=await ao(o,i,r,g);if(h>0&&console.log(q.green(` \u2713 Uploaded ${h} file(s) to storage`)),k>0){console.log(q.yellow(` \u26A0 ${k} file(s) failed to upload`));for(let E of L)console.log(q.dim(` - ${E.name}: ${E.reason}`))}if(e.keepLocalFiles){console.log(q.dim(" Local task files kept (--keep-local-files)."));return}let F=0;for(let E of c)try{Xr(E.filePath),F++}catch{}console.log(q.dim(` Deleted ${F} local task file(s).`))}var io="http://localhost:3000";function qe(){return process.env.SPOTA_API_URL??io}var so={backlog:"backlog",todo:"todo","in-progress":"in_progress",review:"review",done:"done"},lo={backlog:"backlog",todo:"todo",in_progress:"in-progress",review:"review",done:"done",cancelled:"done"};function fe(t){return lo[t]??"todo"}function co(t){return so[t]??"todo"}async function Ke(){let t=await Q();return t?{Authorization:`Bearer ${t}`}:null}async function Se(t){let e=await Ke();if(!e)return null;let r=new URL(`${qe()}/api/cli/tasks`);t&&r.searchParams.set("boardId",t);try{let i=await fetch(r.toString(),{headers:e});return i.ok?i.json():null}catch{return null}}async function Nt(t){let e=await Se();return e?e.tasks.find(r=>r.id===t)??null:null}async function vn(t,e){let r=await Ke();if(!r)return null;let i={};e.status!==void 0&&(i.status=co(e.status)),e.title!==void 0&&(i.title=e.title),e.description!==void 0&&(i.description=e.description),e.priority!==void 0&&(i.priority=e.priority);try{let c=await fetch(`${qe()}/api/cli/tasks/${encodeURIComponent(t)}`,{method:"PATCH",headers:{...r,"Content-Type":"application/json"},body:JSON.stringify(i)});if(!c.ok)return null;let o=await c.json();return{task:o.task,warning:o.warning}}catch{return null}}async function Lt(t,e){let r=await Ke();if(!r)return null;try{let i=await fetch(`${qe()}/api/cli/tasks/${encodeURIComponent(t)}/comments`,{method:"POST",headers:{...r,"Content-Type":"application/json"},body:JSON.stringify({body:e})});return i.ok?(await i.json()).comment:null}catch{return null}}async function Ft(t){let e=await Ke();if(!e)return null;try{let r=await fetch(`${qe()}/api/cli/tasks`,{method:"POST",headers:{...e,"Content-Type":"application/json"},body:JSON.stringify(t)});return r.ok?(await r.json()).task:null}catch{return null}}import{readFileSync as bn,existsSync as kn,unlinkSync as So}from"fs";import{resolve as K,join as Wt,basename as $t}from"path";import n from"chalk";import{createHash as uo,randomUUID as po}from"crypto";import{existsSync as fo,readFileSync as mo,writeFileSync as go,mkdirSync as ho}from"fs";import{join as Dt}from"path";import At from"os";import{PostHog as vo}from"posthog-node";var yo="phc_C9AUV3rnayLfVvxgHtvj6AXcwsd8FKWUfJ9262zWsCvM",bo="https://eu.i.posthog.com";function Ot(){return Dt(process.env.HOME??At.homedir(),".vibeflow")}function Mt(){return Dt(Ot(),"config.json")}function Ye(){try{return JSON.parse(mo(Mt(),"utf-8"))}catch{return{}}}function Ht(t){let e=Ot();fo(e)||ho(e,{recursive:!0});let r=Ye();go(Mt(),JSON.stringify({...r,...t},null,2),"utf-8")}function Ut(){return process.env.VIBEFLOW_TELEMETRY==="0"?!1:Ye().disabled!==!0}function yn(t){Ht({disabled:!t})}function jt(){let t=Ut(),e=Ye();return{enabled:t,anonymousId:e.anonymousId??null}}function ko(){let t=Ye();if(t.anonymousId)return t.anonymousId;let e=po();return Ht({anonymousId:e}),e}function wo(){let t=At.userInfo().username;return uo("sha256").update(t).digest("hex").slice(0,16)}var Ne=null;function xo(){return Ut()?(Ne||(Ne=new vo(yo,{host:bo,flushAt:1,flushInterval:0})),Ne):null}function ke(t,e){let r=xo();if(!r)return;let i=ko();r.capture({distinctId:i,event:t,properties:{...e,$user_id:wo()}})}async function we(){if(Ne)try{await Ne.shutdown()}catch{}}function Eo(t,e){let r=f=>f.replace(/[^0-9.]/g,"").split(".").map(Number),[i=0,c=0,o=0]=r(t),[a=0,s=0,l=0]=r(e);return i!==a?i>a:c!==s?c>s:o>l}function Po(){let t="0.5.0";if(!t)return;let e="@vibeflow-tools/cli";import("https").then(({default:r})=>{let i=r.get(`https://registry.npmjs.org/${encodeURIComponent(e)}/latest`,{timeout:5e3},c=>{let o="";c.on("data",a=>{o+=a.toString()}),c.on("end",()=>{try{let{version:a}=JSON.parse(o);a&&Eo(a,t)&&(console.log(),console.log(n.bgYellow.black.bold(` \u2191 Update available: ${t} \u2192 ${a} `)),console.log(n.dim(" Run: ")+n.cyan(`npm install -g ${e}@${a}`)+n.dim(" to update")),console.log())}catch{}})});i.on("error",()=>{}),i.on("timeout",()=>{i.destroy()})}).catch(()=>{})}It();var xe={backlog:n.gray,todo:n.yellow,"in-progress":n.blue,review:n.magenta,done:n.green},Io=new Set(["Task","Bug","Research"]);function To(t){if(t){for(let e of Io)if(e.toLowerCase()===t.toLowerCase())return e}}function ge(t){let e=(t??"Medium").trim().toLowerCase();return e==="critical"?0:e==="high"?1:e==="low"?3:2}var zt=["in-progress","review","todo","backlog","done"];function Qe(t){let e=zt.indexOf(t);return e===-1?zt.length:e}function Bt(t){try{return Ge("git",["push"],{cwd:t,stdio:"inherit"}),{ok:!0}}catch{try{let e=wn("git rev-parse --abbrev-ref HEAD",{cwd:t}).toString().trim();return Ge("git",["push","--set-upstream","origin",e],{cwd:t,stdio:"inherit"}),{ok:!0}}catch(e){return{ok:!1,error:(e instanceof Error?e.message:String(e)).slice(0,220)}}}}function Ee(t){let{autoCommit:e,autoPush:r,autoComment:i,createBranch:c}=t;if(console.log(n.bold("Agent instructions (concise):")),console.log(n.dim(" Discover: vibeflow tasks --status todo | vibeflow tasks --type Research | vibeflow tasks --user <email> | vibeflow tasks --tag <tag>")),console.log(n.dim(" Details: vibeflow tasks --get <id> (full task info with comments and files)")),console.log(n.dim(' Create: vibeflow tasks --add --title "..." --description "..."')),console.log(),console.log(n.dim(" Workflow:")),console.log(n.yellow(" \u26A0 IMMEDIATELY set in-progress BEFORE any implementation work:")),console.log(n.dim(" 1. vibeflow tasks --edit <id> --set-status in-progress \u2190 DO THIS FIRST")),console.log(n.dim(" 2. <implement the change>")),e){console.log(n.dim(" 3. git add <files> (stage your changes first)"));let o=["--set-status review"];e&&o.push('--commit-message "<one-line summary>"'),i&&o.push('--comment "<report>"'),console.log(n.dim(` 4. vibeflow tasks --edit <id> ${o.join(" ")}`)),console.log(n.dim(" CLI will commit staged changes and link the commit SHA automatically."))}else{console.log(n.dim(' 3. git add <files> && vibeflow tasks --commit --task <id> --message "<one-line summary>"'));let o=["--set-status review"];i&&o.push('--comment "<report>"'),console.log(n.dim(` 4. vibeflow tasks --edit <id> ${o.join(" ")}`))}i&&(console.log(n.dim("")),console.log(n.dim(" Comment format (--comment):")),console.log(n.dim(" \xB7 Plain text for concise one-liners.")),console.log(n.dim(" \xB7 Markdown for multi-section reports. Use **bold**, bullet lists, code fences.")),console.log(n.dim(" \xB7 Must cover: what changed, why, key decisions, anything future agents should know.")),console.log(n.dim(" \xB7 For long reports, attach a .md file and reference it in the comment."))),console.log(),e&&console.log(n.dim(" [setting] Auto-commit ON: provide --commit-message when setting status to review; CLI commits.")),r&&console.log(n.dim(" [setting] Auto-push ON: CLI pushes after the commit automatically.")),i&&console.log(n.dim(" [setting] Auto-comment ON: --comment is required when setting status to review.")),c&&(console.log(n.dim(" [setting] Create branch ON: after ALL tasks in this session are done, create and push a descriptive branch:")),console.log(n.dim(" git checkout -b <short-name> (e.g. fix/annotation-errors, feat/eye-toggle, chore/cleanup-extension)")),console.log(n.dim(" git push -u origin HEAD")),console.log(n.dim(" Branch name rules: lowercase, kebab-case, 2-5 words, prefix fix/feat/chore/docs.")),console.log(n.dim(" Describe the WORK done (not dates). Bad: agent/2026-04-16. Good: fix/bug-errors-visibility."))),t.hasResearchTasks&&(console.log(n.dim(" Research tasks: NEVER generate code \u2014 research only.")),console.log(n.dim(" Attach a .md report before marking Research tasks as review.")),console.log(n.dim(" CLI ENFORCES: cannot mark Research as review without an attached .md report.")),console.log(n.dim(" Use --report-file <path> to upload your .md report when marking as review:")),console.log(n.dim(' vibeflow tasks --edit <id> --set-status review --report-file ./report.md --comment "..."')),console.log(n.dim(" The file is uploaded to the task and deleted from the local filesystem automatically."))),t.hasBugTasks&&(console.log(n.dim(" Bug tasks: Include error logs / stack traces in the commit comment.")),console.log(n.dim(" Describe: the symptom, the console error, what triggered it, and how it was fixed."))),console.log(n.red(" CRITICAL: NEVER edit .vibeflow/ task files directly.")),console.log(n.dim(" All task operations (status, comments, commits) must go through CLI commands.")),console.log(n.red(" CRITICAL: Set in-progress BEFORE reading/planning. Other agents may pick the same task.")),console.log(n.dim(" The in-progress transition signals ownership. Skip it and another agent may duplicate your work.")),console.log(n.dim(" Sequence: discover tasks \u2192 pick one \u2192 set in-progress \u2192 THEN read details and implement.")),console.log(n.red(' CRITICAL: NEVER set a task status to "done".')),console.log(n.dim(' When your implementation is complete, set the status to "review" \u2014 not "done".')),console.log(n.dim(" Only humans can mark tasks as done after reviewing the work.")),console.log(n.dim(" The CLI will warn you and still allow the change \u2014 but agents must not use it.")),console.log()}var ie=new Co;ie.name("vibeflow").description("Vibeflow \u2014 CLI tool for frontend prototyping with LLM assistance").version("0.5.0");ie.addHelpText("after",`
|
|
29601
|
+
<ul>${U}</ul></body></html>`)});for(let k of a){let R=d?`/${ce(k)}`:"/";i.get(R,(U,K)=>{let D=Tr(k,"utf-8"),G=p?Fn(D,p):D;K.type("html").send(G)})}let h=a.map(k=>`/${ce(k)}`);ht(i,d?h:[]),vt(i,l,c),xt(i,l,c),yt(i,l,c),bt(i,e.port),kt(i,e.port);let L=null;L=rn(r,{onChange:k=>{let R=ce(k);console.log(y.dim(` File changed: ${R}`)),c({type:"reload",file:R})}});let I=oe(l,B,Ne),b=on(I,{onChanged:k=>{let R=ue(k);c(R?{type:"task-changed",taskId:R.id,action:"update",task:R,source:"cli"}:{type:"tasks-updated"})},onDeleted:k=>{let R=ce(k,".json");c({type:"task-deleted",taskId:R})}});return wt(i),new Promise((k,R)=>{let U=e.host??"localhost";o.listen(e.port,U,()=>{let D=`http://${U==="0.0.0.0"?gt()??"localhost":U}:${e.port}`,G=U==="0.0.0.0"?`http://localhost:${e.port}`:null,ee=y.dim(" "+"\u2500".repeat(62));console.log(),console.log(y.green(" \u2713 Vibeflow running")+y.dim(" \xB7 ")+y.cyan(D)),G&&console.log(y.dim(" Local: ")+y.cyan(G)),console.log(ee);for(let $ of a){let ve=d?`/${ce($)}`:"/";console.log(y.dim(" File: ")+y.cyan(`${D}${ve}`)+y.dim(` (${ce($)})`))}console.log(y.dim(" Kanban board: ")+y.cyan(`${D}/kanban`)),console.log(y.dim(" Task API: ")+y.cyan(`${D}/api/tasks`)),console.log(ee),console.log(y.bold.white(" INTEGRATE INTO YOUR APP")+y.dim(` (full guide: ${D}/inject)`)),console.log(y.dim(" 1. Add this script tag to your HTML:")),console.log(y.dim(" ")+y.yellow(`<script src="${D}/vibeflow-overlay.js" data-vibeflow-overlay></script>`)),console.log(y.dim(" 2. Reload your page \u2014 the overlay appears automatically.")),console.log(y.dim(" 3. Click anything to annotate it.")),console.log(),console.log(y.dim(" Press Ctrl+C to stop")),console.log(),e.open&&import("open").then($=>$.default(D)).catch(()=>{}),k({url:D,close:async()=>{L&&await L.close(),await b.close(),s.close(),await new Promise($=>o.close(()=>$()))}})}),o.on("error",R)})}async function ke(){return await Z()?"saas":"local"}import H from"chalk";import Wr from"open";import Et from"readline";import $r from"@inquirer/select";import{existsSync as zr,readdirSync as Pt,readFileSync as Br}from"fs";import{join as kn,resolve as Vr}from"path";var qr="http://localhost:3000",Yr=300*1e3;function It(){return process.env.SPOTA_API_URL??qr}async function Kr(n){return new Promise(e=>setTimeout(e,n))}async function Qr(n){return n.length===1?(console.log(H.dim(` Using board: ${n[0].icon??""} ${n[0].name}`)),n[0]):await $r({message:"Select a board to use:",choices:n.map(r=>({name:`${r.icon??""} ${r.name}`,value:r}))})}async function Tt(n,e){try{let r=await fetch(`${n}/api/cli/settings`,{headers:{Authorization:`Bearer ${e}`}});if(!r.ok)return;let u=await r.json();u.settings&&Object.keys(u.settings).length>0&&Qn({...u.settings,_settingsRefreshedAt:Date.now()})}catch{}}async function _t(){try{let n=await Z();if(!n)return;let r=pn()._settingsRefreshedAt??0;if(Date.now()-r<Yr)return;let u=It();Tt(u,n)}catch{}}async function Gr(n,e){try{let[r,u]=await Promise.all([fetch(`${n}/api/cli/workspaces`,{headers:{Authorization:`Bearer ${e}`}}),fetch(`${n}/api/cli/profile`,{headers:{Authorization:`Bearer ${e}`}})]);if(!r.ok)return;let d=await r.json();if(!d.workspaces?.length){console.log(H.yellow(" No boards found. Create a board in the web app first."));return}let a=u.ok?await u.json():null,l=await Qr(d.workspaces);await Nn({...l,email:a?.email??null}),console.log(H.green(` Board set: ${l.icon??""} ${l.name}`)),console.log(H.dim(` Open at: ${l.url}`))}catch{}}async function Xr(n,e,r,u){let d=kn(n,B,Ne);if(!zr(d))return;let a=[];try{for(let c of Pt(d))if(!c.startsWith(".")){let p=kn(d,c);for(let m of Pt(p).filter(h=>h.endsWith(".json")))a.push(kn(p,m))}}catch{return}if(a.length===0)return;let l=a.flatMap(c=>{try{return[JSON.parse(Br(c,"utf-8"))]}catch{return[]}}),i=new Set;try{let c=await fetch(`${e}/api/cli/tasks?boardId=${u.id}`,{headers:{Authorization:`Bearer ${r}`}}).catch(()=>null);if(c?.ok){let p=await c.json();i=new Set((p.tasks??[]).flatMap(m=>[m.id,...m.cliId?[m.cliId]:[]]))}}catch{}let o=l.filter(c=>!i.has(c.id));if(o.length===0)return;console.log(),console.log(H.bold(` ${o.length} local task${o.length!==1?"s are":" is"} not yet synced to the board:`));let s=o.slice(0,10);for(let c of s){let p=c.status?H.dim(` [${c.status}]`):"";console.log(H.dim(` \u2022 ${c.title??c.id}${p}`))}return o.length>10&&console.log(H.dim(` \u2026 and ${o.length-10} more`)),new Promise(c=>{let p=Et.createInterface({input:process.stdin,output:process.stdout});p.question(H.cyan(`
|
|
29602
|
+
Push them to your board now? [Y/n]: `),async m=>{if(p.close(),m.trim().toLowerCase()==="n"){console.log(H.dim(" Skipped. You can push later with: vibeflow push")),c();return}let h=Et.createInterface({input:process.stdin,output:process.stdout});h.question(H.cyan(" Delete local task files after push? [y/N]: "),async L=>{h.close();let I=L.trim().toLowerCase()!=="y";try{let b=await fetch(`${e}/api/cli/import`,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${r}`},body:JSON.stringify({boardId:u.id,tasks:o,keepLocalFiles:I})}),k={};try{k=await b.json()}catch{}b.ok?(console.log(H.green(` \u2713 Pushed ${k.imported??0} task${(k.imported??0)!==1?"s":""} to ${u.name}`)),(k.skipped??0)>0&&console.log(H.dim(` (${k.skipped} already existed and were skipped)`))):console.log(H.red(` Push failed: ${k.error??`HTTP ${b.status}`}`))}catch(b){console.log(H.red(` Push failed: ${b instanceof Error?b.message:"Network error"}`))}c()})})})}async function Ke(n=Vr(".")){let e=It();console.log(H.cyan(" Initiating device login flow..."));let r=await fetch(`${e}/api/cli/auth/device-init`,{method:"POST",headers:{"Content-Type":"application/json"}});if(!r.ok){console.error(H.red(` Failed to initiate login: ${r.status} ${r.statusText}`)),process.exitCode=1;return}let{deviceCode:u,userCode:d,verificationUrl:a,expiresIn:l}=await r.json();console.log(),console.log(H.bold(" Open this URL in your browser to authorize:")),console.log(H.underline(` ${a}`)),console.log();try{await Wr(a),console.log(H.dim(" (Browser opened automatically)"))}catch{}let i=Date.now()+l*1e3,o=3e3;for(;Date.now()<i;){await Kr(o);let s=await fetch(`${e}/api/cli/auth/device-poll`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({deviceCode:u})});if(!s.ok){console.error(H.red(" Poll request failed. Retrying..."));continue}let c=await s.json();if("token"in c){await Xn(c.token),console.log(),console.log(H.green(" Logged in successfully. Now operating in SaaS mode.")),await Promise.all([Gr(e,c.token),Tt(e,c.token)]);let{readWorkspace:p}=await import("./workspace-KGOQ67YV.js"),m=await p();m&&await Xr(n,e,c.token,m);return}if("expired"in c){console.error(H.red(" Device code expired. Please try again.")),process.exitCode=1;return}process.stdout.write(H.dim("."))}console.error(H.red(`
|
|
29603
|
+
Login timed out. Please try again.`)),process.exitCode=1}import Jr from"chalk";async function Rt(){await Promise.all([Jn(),Ln()]),console.log(Jr.green(" Logged out. Now operating in local mode."))}import q from"chalk";import{unlinkSync as Zr,readFileSync as eo,existsSync as no}from"fs";import{resolve as to,join as ro}from"path";var oo="http://localhost:3000";function ao(){return process.env.SPOTA_API_URL??oo}function io(n){return n<1024?`${n} B`:n<1024*1024?`${(n/1024).toFixed(1)} KB`:`${(n/(1024*1024)).toFixed(1)} MB`}function Nt(n,e,r=24){let u=Math.round(n/e*r);return`[${"\u2588".repeat(u)+"\u2591".repeat(r-u)}]`}async function so(n,e,r,u){let d=[];for(let{localId:h,remoteId:L}of u){let I=te(r,h);for(let b of I){let k=b.linkedPath??ro(In(r,h),b.name);no(k)&&d.push({remoteId:L,name:b.name,filePath:k,size:b.size})}}if(d.length===0)return{uploaded:0,failed:0,failedFiles:[]};let a=d.length,l=d.reduce((h,L)=>h+L.size,0);console.log(q.cyan(`
|
|
29604
|
+
Uploading ${a} file(s) (${io(l)})...`));let i=0,o=0,s=0,c=Date.now(),p=[];for(let h of d){let L=Math.round(i/a*100),I=Nt(i,a),b=(Date.now()-c)/1e3,k=s/Math.max(b,.01),R=l-s,U=k>0?Math.ceil(R/k):0,K=U>60?`${Math.ceil(U/60)}m`:`${U}s`;process.stdout.write(`\r ${I} ${L}% ${h.name.slice(0,28)} ETA: ${K} `);try{let D=eo(h.filePath),G=await fetch(`${n}/api/tasks/${encodeURIComponent(h.remoteId)}/files`,{method:"POST",headers:{Authorization:`Bearer ${e}`,"Content-Type":"application/octet-stream","x-filename":encodeURIComponent(h.name)},body:D});G.ok?(i++,s+=h.size):(o++,p.push({name:h.name,reason:`HTTP ${G.status}`}))}catch(D){o++,p.push({name:h.name,reason:D instanceof Error?D.message:String(D)})}}let m=Nt(a,a);return process.stdout.write(`\r ${m} 100% Done${" ".repeat(40)}
|
|
29605
|
+
`),{uploaded:i,failed:o,failedFiles:p}}async function Lt(n,e){let r=to(n),u=await Z();if(!u&&(console.log(q.yellow(" Not logged in. Starting login flow...")),await Ke(),u=await Z(),!u)){console.error(q.red(" Login failed. Please run `vibeflow login` and try again.")),process.exitCode=1;return}let d=de(r);if(d.length===0){console.log(q.dim(" No local tasks found. Nothing to push."));return}console.log(q.cyan(` Found ${d.length} local task(s). Pushing to SaaS...`));let a=ao(),l=e.workspace;if(!l){let b=await re();b&&(l=b.id,console.log(q.dim(` Using board: ${b.icon??""} ${b.name}`)))}let i={tasks:d};l&&(i.workspaceId=l);let o;try{let b=await fetch(`${a}/api/cli/import`,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${u}`},body:JSON.stringify(i)});if(!b.ok){let k=await b.json().catch(()=>({}));console.error(q.red(` Import failed: ${b.status} ${k.error??b.statusText}`)),process.exitCode=1;return}o=await b.json()}catch(b){let k=b instanceof Error?b.message:String(b);console.error(q.red(` Network error: ${k}`)),process.exitCode=1;return}console.log(q.green(` \u2713 Pushed ${o.imported} task(s) to SaaS`)),o.skipped&&o.skipped>0&&console.log(q.dim(` Skipped ${o.skipped} already-imported task(s).`));let s=(await re())?.name??o.workspaceId;console.log(q.dim(` Board: ${s}`));let c=o.idMap??{},p=d.filter(b=>b.id&&c[b.id]).map(b=>({localId:b.id,remoteId:c[b.id]})),{uploaded:m,failed:h,failedFiles:L}=await so(a,u,r,p);if(m>0&&console.log(q.green(` \u2713 Uploaded ${m} file(s) to storage`)),h>0){console.log(q.yellow(` \u26A0 ${h} file(s) failed to upload`));for(let b of L)console.log(q.dim(` - ${b.name}: ${b.reason}`))}if(e.keepLocalFiles){console.log(q.dim(" Local task files kept (--keep-local-files)."));return}let I=0;for(let b of d)try{Zr(b.filePath),I++}catch{}console.log(q.dim(` Deleted ${I} local task file(s).`))}var lo="http://localhost:3000";function Qe(){return process.env.SPOTA_API_URL??lo}var uo={backlog:"backlog",todo:"todo","in-progress":"in_progress",review:"review",done:"done"},co={backlog:"backlog",todo:"todo",in_progress:"in-progress",review:"review",done:"done",cancelled:"done"};function me(n){return co[n]??"todo"}function po(n){return uo[n]??"todo"}async function Ge(){let n=await Z();return n?{Authorization:`Bearer ${n}`}:null}async function Te(n){let e=await Ge();if(!e)return null;let r=new URL(`${Qe()}/api/cli/tasks`);n&&r.searchParams.set("boardId",n);try{let u=await fetch(r.toString(),{headers:e});return u.ok?u.json():null}catch{return null}}async function Ft(n){let e=await Te();return e?e.tasks.find(r=>r.id===n)??null:null}async function xn(n,e){let r=await Ge();if(!r)return null;let u={};e.status!==void 0&&(u.status=po(e.status)),e.title!==void 0&&(u.title=e.title),e.description!==void 0&&(u.description=e.description),e.priority!==void 0&&(u.priority=e.priority);try{let d=await fetch(`${Qe()}/api/cli/tasks/${encodeURIComponent(n)}`,{method:"PATCH",headers:{...r,"Content-Type":"application/json"},body:JSON.stringify(u)});if(!d.ok)return null;let a=await d.json();return{task:a.task,warning:a.warning}}catch{return null}}async function Dt(n,e){let r=await Ge();if(!r)return null;try{let u=await fetch(`${Qe()}/api/cli/tasks/${encodeURIComponent(n)}/comments`,{method:"POST",headers:{...r,"Content-Type":"application/json"},body:JSON.stringify({body:e})});return u.ok?(await u.json()).comment:null}catch{return null}}async function At(n){let e=await Ge();if(!e)return null;try{let r=await fetch(`${Qe()}/api/cli/tasks`,{method:"POST",headers:{...e,"Content-Type":"application/json"},body:JSON.stringify(n)});return r.ok?(await r.json()).task:null}catch{return null}}import{readFileSync as zt,existsSync as Bt,unlinkSync as Po}from"fs";import{resolve as Y,join as Io,basename as Vt}from"path";import t from"chalk";import{createHash as fo,randomUUID as mo}from"crypto";import{existsSync as go,readFileSync as ho,writeFileSync as vo,mkdirSync as yo}from"fs";import{join as Ot}from"path";import Mt from"os";import{PostHog as bo}from"posthog-node";var ko="phc_C9AUV3rnayLfVvxgHtvj6AXcwsd8FKWUfJ9262zWsCvM",xo="https://eu.i.posthog.com";function jt(){return Ot(process.env.HOME??Mt.homedir(),".vibeflow")}function Ht(){return Ot(jt(),"config.json")}function Xe(){try{return JSON.parse(ho(Ht(),"utf-8"))}catch{return{}}}function Ut(n){let e=jt();go(e)||yo(e,{recursive:!0});let r=Xe();vo(Ht(),JSON.stringify({...r,...n},null,2),"utf-8")}function Wt(){return process.env.VIBEFLOW_TELEMETRY==="0"?!1:Xe().disabled!==!0}function wn(n){Ut({disabled:!n})}function $t(){let n=Wt(),e=Xe();return{enabled:n,anonymousId:e.anonymousId??null}}function wo(){let n=Xe();if(n.anonymousId)return n.anonymousId;let e=mo();return Ut({anonymousId:e}),e}function Co(){let n=Mt.userInfo().username;return fo("sha256").update(n).digest("hex").slice(0,16)}var Me=null;function So(){return Wt()?(Me||(Me=new bo(ko,{host:xo,flushAt:1,flushInterval:0})),Me):null}function xe(n,e){let r=So();if(!r)return;let u=wo();r.capture({distinctId:u,event:n,properties:{...e,$user_id:Co()}})}async function we(){if(Me)try{await Me.shutdown()}catch{}}function To(n,e){let r=s=>s.replace(/[^0-9.]/g,"").split(".").map(Number),[u=0,d=0,a=0]=r(n),[l=0,i=0,o=0]=r(e);return u!==l?u>l:d!==i?d>i:a>o}function _o(){let n="0.5.1";if(!n)return;let e="@vibeflow-tools/cli";import("https").then(({default:r})=>{let u=r.get(`https://registry.npmjs.org/${encodeURIComponent(e)}/latest`,{timeout:5e3},d=>{let a="";d.on("data",l=>{a+=l.toString()}),d.on("end",()=>{try{let{version:l}=JSON.parse(a);l&&To(l,n)&&(console.log(),console.log(t.bgYellow.black.bold(` \u2191 Update available: ${n} \u2192 ${l} `)),console.log(t.dim(" Run: ")+t.cyan(`npm install -g ${e}@${l}`)+t.dim(" to update")),console.log())}catch{}})});u.on("error",()=>{}),u.on("timeout",()=>{u.destroy()})}).catch(()=>{})}_t();var Ce={backlog:t.gray,todo:t.yellow,"in-progress":t.blue,review:t.magenta,done:t.green},Ro=new Set(["Task","Bug","Research"]);function No(n){if(n){for(let e of Ro)if(e.toLowerCase()===n.toLowerCase())return e}}function he(n){let e=(n??"Medium").trim().toLowerCase();return e==="critical"?0:e==="high"?1:e==="low"?3:2}var qt=["in-progress","review","todo","backlog","done"];function Je(n){let e=qt.indexOf(n);return e===-1?qt.length:e}function Yt(n){try{return Ze("git",["push"],{cwd:n,stdio:"inherit"}),{ok:!0}}catch{try{let e=Cn("git rev-parse --abbrev-ref HEAD",{cwd:n}).toString().trim();return Ze("git",["push","--set-upstream","origin",e],{cwd:n,stdio:"inherit"}),{ok:!0}}catch(e){return{ok:!1,error:(e instanceof Error?e.message:String(e)).slice(0,220)}}}}function _e(n){let e=He(n);for(let r of e.split(`
|
|
29606
|
+
`))r.startsWith("Agent instructions")?console.log(t.bold(r)):r.startsWith(" \u26A0")?console.log(t.yellow(r)):r.startsWith(" CRITICAL:")?console.log(t.red(r)):console.log(t.dim(r))}var se=new Eo;se.name("vibeflow").description("Vibeflow \u2014 CLI tool for frontend prototyping with LLM assistance").version("0.5.1");se.addHelpText("after",`
|
|
29417
29607
|
${"\u2500".repeat(60)}
|
|
29418
29608
|
For coding agents \u2014 quick reference:
|
|
29419
29609
|
|
|
@@ -29445,20 +29635,17 @@ File attachments:
|
|
|
29445
29635
|
<file binary body>
|
|
29446
29636
|
List: GET /api/tasks/<id>/files
|
|
29447
29637
|
Delete: DELETE /api/tasks/<id>/files/<filename>
|
|
29448
|
-
`);
|
|
29449
|
-
`))console.log(
|
|
29450
|
-
`))console.log(
|
|
29451
|
-
`))console.log(
|
|
29452
|
-
`))console.log(
|
|
29453
|
-
`))console.log(
|
|
29454
|
-
`))console.log(
|
|
29455
|
-
`))console.log(n.dim(` ${D}`))}let W=[...U.comments??[]].sort((D,ee)=>new Date(D.createdAt).getTime()-new Date(ee.createdAt).getTime());if(W.length>0){console.log(n.dim(` comments (${W.length}):`));for(let D of W){let ee=D.authorId?`user:${D.authorId.slice(0,8)}`:"agent";console.log(n.dim(` [${ee}] ${D.createdAt}`));for(let Fe of D.body.split(`
|
|
29456
|
-
`))console.log(
|
|
29457
|
-
`))console.log(
|
|
29458
|
-
`))console.log(n.dim(` ${M}`))}}if(C.linkedFiles&&C.linkedFiles.length>0){console.log(n.dim(` linked files (${C.linkedFiles.length}):`));for(let x of C.linkedFiles)console.log(n.dim(` - ${x.name} ${x.url}`))}console.log(),console.log(n.yellow(" \u26A1 This task is already in-progress. Implement it now and mark as review when done."));return}if(e.add){if(!e.title?.trim()){console.log(n.red("\u2717 --title is required with --add")),console.log(n.dim(' Example: vibeflow tasks --add --title "Fix CTA spacing" --description "Button overflows on mobile"')),process.exitCode=1;return}if(await be()==="saas"){let w=await ne(),p=["backlog","todo","in-progress","review","done"].includes(e.setStatus??"")?e.setStatus:"todo",N=Cn(),_=await Ft({id:N,title:e.title.trim(),description:e.description?.trim(),status:p,boardId:w?.id});if(!_){console.log(n.red("\u2717 Failed to create task in online board.")),console.log(n.yellow(" Check your connection or run 'vibeflow login'.")),process.exitCode=1;return}e.json?console.log(JSON.stringify(_,null,2)):(console.log(n.green(`\u2713 Task created: ${_.title}`)),console.log(n.dim(` id: ${_.id} | status: ${fe(_.status)}`)));return}let b=K(t);_e(b);let A=["backlog","todo","in-progress","review","done"].includes(e.setStatus??"")?e.setStatus:"todo",I=Ce(b,{title:e.title.trim(),description:e.description?.trim()??"",status:A,selector:"/"});e.json?console.log(JSON.stringify(I,null,2)):(console.log(n.green(`\u2713 Task created: ${I.title}`)),console.log(n.dim(` id: ${I.id} | status: ${I.status}`)));return}if(e.commit){if(!e.task){console.log(n.red("\u2717 --task <task-id> is required with --commit")),console.log(n.dim(' Example: vibeflow tasks --commit --task abc12345 --message "fix button alignment"')),process.exitCode=1;return}let d=K(t),P=oe(d).find(w=>w.id===e.task||w.id.startsWith(e.task));if(!P){console.log(n.red(`\u2717 Task not found: ${e.task}`)),console.log(n.dim(" Run 'vibeflow tasks' to see available task IDs.")),process.exitCode=1;return}let A=e.message?.trim()||P.title;(P.type??"").toLowerCase()==="research"&&(console.log(n.yellow("\u26A0 WARNING: This is a Research task. Research tasks must NOT produce code changes.")),console.log(n.yellow(" Only commit research report files (.md). Do not commit code changes.")),console.log());let I=`${A} [proto:${P.id}]`;try{Ge("git",["commit","-m",I],{cwd:d,stdio:"inherit"});let w=wn("git rev-parse HEAD",{cwd:d}).toString().trim(),m={sha:w,message:A,timestamp:new Date().toISOString()},p=P.commits??[];if(V(d,P.id,{commits:[...p,m]}),console.log(n.green(`\u2713 Committed and linked to task: ${P.title}`)),console.log(n.dim(` commit: ${w}`)),console.log(n.dim(` proto: ${P.id}`)),X(d).autoPush){console.log(n.dim(" auto-push: pushing commit to remote..."));let _=Bt(d);_.ok?console.log(n.green("\u2713 Auto-push complete")):(console.log(n.yellow("\u26A0 Auto-push failed. Commit is local; run 'git push' manually.")),_.error&&console.log(n.dim(` reason: ${_.error}`)))}}catch{console.log(n.red("\u2717 git commit failed \u2014 ensure changes are staged with 'git add'")),process.exitCode=1}return}if(e.edit!==void 0){let d=typeof e.edit=="string"?e.edit:void 0,b=e.title||e.setStatus||e.description;if(!d||!b){if(e.type&&!s(e.type))return;let m=oe(t);if(e.status&&(m=m.filter(p=>p.status===e.status)),e.type&&(m=m.filter(p=>(p.type??"Task").toLowerCase()===e.type.toLowerCase())),e.user&&!l(e.user,m))return;if(e.user&&(m=m.filter(p=>o(p.author,e.user))),e.tag&&e.tag.length>0&&(m=m.filter(p=>e.tag.every(N=>(p.tags??[]).includes(N)))),console.log(n.bold("vibeflow tasks --edit \u2014 LLM Usage Instructions")),console.log(),console.log("Edit a task:"),console.log(n.cyan(' vibeflow tasks [dir] --edit <task-id> [--title "new title"] [--set-status backlog|todo|in-progress|review|done] [--description "new description"]')),console.log(),console.log("Examples:"),console.log(n.dim(" vibeflow tasks --edit abc12345 --set-status done")),console.log(n.dim(" vibeflow tasks --edit abc12345 --set-status in-progress")),console.log(n.dim(' vibeflow tasks --edit abc12345 --title "Updated title" --description "More detail"')),console.log(),m.length===0)console.log(n.dim("No tasks found."));else{console.log("Available tasks:");for(let p of m){let N=xe[p.status]??n.white;console.log(` ${N(`[${p.status}]`)} ${n.bold(p.id)} \u2014 ${p.title}`)}}return}let P=["backlog","todo","in-progress","review","done"];if(e.setStatus==="done"&&(console.log(n.yellow('\u26A0 WARNING: Agents should NEVER set a task status to "done".')),console.log(n.yellow(" Only humans should mark tasks as done after reviewing.")),console.log(n.dim(" If you are an agent, use --set-status review instead.")),console.log()),e.setStatus&&!P.includes(e.setStatus)){console.log(n.red(`\u2717 Invalid status: "${e.setStatus}"`)),console.log(n.yellow(` Valid statuses: ${P.join(" | ")}`)),console.log(n.dim(` Example: vibeflow tasks --edit ${d} --set-status in-progress`)),process.exitCode=1;return}if(e.setStatus==="review"&&!e.comment?.trim()){console.log(n.red("\u2717 --comment is required when setting status to review")),console.log(n.dim(" Provide a concise implementation report explaining:")),console.log(n.dim(" \xB7 what was changed and why")),console.log(n.dim(" \xB7 key decisions and trade-offs")),console.log(n.dim(" \xB7 anything future agents should know")),console.log(n.dim(` Example: vibeflow tasks --edit ${d} --set-status review --comment "Implemented X by doing Y. Key decision: Z."`)),process.exitCode=1;return}let A=await be();if(e.setStatus==="review"){let m=K(t),p=X(m);if(p.autoComment&&!e.comment?.trim()){console.log(n.red("\u2717 --comment is required (auto-comment setting is ON)")),console.log(n.dim(" Provide: what changed, why, key decisions, anything future agents should know.")),console.log(n.dim(" Plain text for short notes; Markdown for multi-section reports.")),console.log(n.dim(` Example: vibeflow tasks --edit ${d} --set-status review --comment "Implemented X by doing Y."`)),process.exitCode=1;return}if(p.autoCommit&&!e.commitMessage?.trim()){console.log(n.red("\u2717 --commit-message is required (auto-commit setting is ON)")),console.log(n.dim(" Stage your changes first, then provide a one-line commit summary.")),console.log(n.dim(` Example: vibeflow tasks --edit ${d} --set-status review --commit-message "fix: add hover effect" --comment "..."`)),process.exitCode=1;return}}if(A==="saas"){let m={};if(e.setStatus&&(m.status=e.setStatus),e.title&&(m.title=e.title),e.description&&(m.description=e.description),e.setStatus==="in-progress"){let N=await Nt(d);if(N&&fe(N.status)==="in-progress"){let _=N.author??"another user";console.log(n.yellow(`\u26A0 Task is already in-progress (last updated by: ${_})`)),console.log(n.yellow(" Another agent or user may be working on this task.")),console.log(n.yellow(" Proceeding \u2014 but verify the task is not being worked on elsewhere.")),console.log()}}let p=await vn(d,m);if(!p){console.log(n.red(`\u2717 Failed to update task: ${d}`)),console.log(n.yellow(" Ensure you are connected and the task ID exists in the online board.")),process.exitCode=1;return}p.warning&&console.log(n.yellow(`\u26A0 Server warning: ${p.warning}`)),e.setStatus==="review"&&e.comment?.trim()&&await Lt(d,e.comment.trim())&&console.log(n.dim(" comment: added")),console.log(n.green(`\u2713 Task updated: ${p.task.title}`)),console.log(n.dim(` id: ${p.task.id} | status: ${fe(p.task.status)}`));return}let I={};if(e.title&&(I.title=e.title),e.setStatus&&(I.status=e.setStatus),e.description&&(I.description=e.description),e.setStatus==="in-progress"){let m=K(t),N=oe(m).find(_=>_.id===d||_.id.startsWith(d));if(N&&((N.type??"").toLowerCase()==="research"&&(console.log(n.yellow("\u26A0 WARNING: This is a Research task. Policy: do NOT implement code.")),console.log(n.yellow(" Research only \u2014 attach a .md report file, leave a summary comment, mark as review.")),console.log()),N.status==="in-progress")){let _=N.updated?new Date(N.updated).toLocaleString():"unknown",z=N.author??"another user";console.log(n.yellow(`\u26A0 Task is already in-progress (author: ${z}, last updated: ${_})`)),console.log(n.yellow(" Another agent or user may be working on this task.")),console.log(n.yellow(" Proceeding \u2014 but verify the task is not being worked on elsewhere.")),console.log()}}if(e.setStatus==="review"){let m=K(t),N=oe(m).find(_=>_.id===d||_.id.startsWith(d));if(N&&(N.type??"").toLowerCase()==="research"){if(e.reportFile){let _=K(e.reportFile);if(!kn(_)){console.log(n.red(`\u2717 Report file not found: ${_}`)),process.exitCode=1;return}if(!/\.md$/i.test(_)){console.log(n.red("\u2717 Report file must be a Markdown (.md) file")),process.exitCode=1;return}let z=bn(_),{saveFile:J}=await import("./files-IX5QZQHC.js");J(m,N.id,$t(_),z),So(_),console.log(n.green(`\u2713 Report uploaded: ${$t(_)} (local file removed)`))}else if(!ae(m,N.id).some(J=>/\.md$/i.test(J.name))){console.log(n.red("\u2717 Cannot mark Research task as review: no .md report file attached.")),console.log(n.dim(" Provide a research report:")),console.log(n.dim(` vibeflow tasks --edit ${d} --set-status review --report-file ./my-research.md --comment "..."`)),process.exitCode=1;return}}}let w=V(t,d,I);if(!w){console.log(n.red(`\u2717 Task not found: ${d}`)),console.log(n.yellow(" Run 'vibeflow tasks' to see available task IDs.")),process.exitCode=1;return}if(e.setStatus==="review"&&e.comment?.trim()&&(ve(K(t),d,"agent",e.comment.trim()),console.log(n.dim(" comment: added"))),console.log(n.green(`\u2713 Task updated: ${w.title}`)),console.log(n.dim(` id: ${w.id} | status: ${w.status}`)),e.setStatus==="review"){let m=K(t),p=X(m);if(p.autoCommit&&e.commitMessage?.trim()){let _=oe(m).find(z=>z.id===d||z.id.startsWith(d));if(_){let z=`${e.commitMessage.trim()} [proto:${_.id}]`;try{Ge("git",["commit","-m",z],{cwd:m,stdio:"inherit"});let J=wn("git rev-parse HEAD",{cwd:m}).toString().trim(),C={sha:J,message:e.commitMessage.trim(),timestamp:new Date().toISOString()},x=_.commits??[];if(V(m,_.id,{commits:[...x,C]}),console.log(n.green(`\u2713 Committed: ${z}`)),console.log(n.dim(` sha: ${J}`)),p.autoPush){console.log(n.dim(" pushing..."));let v=Bt(m);v.ok?console.log(n.green("\u2713 Pushed")):(console.log(n.yellow("\u26A0 Push failed. Run 'git push' manually.")),v.error&&console.log(n.dim(` reason: ${v.error}`)))}}catch{console.log(n.red("\u2717 git commit failed \u2014 ensure changes are staged with 'git add'")),process.exitCode=1}}}}return}let f=["backlog","todo","in-progress","review","done"];if(e.status&&!f.includes(e.status)){console.log(n.red(`\u2717 Invalid status filter: "${e.status}"`)),console.log(n.yellow(` Valid statuses: ${f.join(" | ")}`)),console.log(n.dim(" Example: vibeflow tasks --status todo")),process.exitCode=1;return}if(e.type&&!s(e.type))return;if(await be()==="saas"){let d=await ne(),b=await Se(d?.id);if(!b){console.log(n.red("\u2717 Unable to reach the online backend.")),console.log(n.yellow(" Check your connection or run 'vibeflow login' if your session expired.")),process.exitCode=1;return}let P=b.tasks.map(p=>({...p,status:fe(p.status)}));if(e.status&&(P=P.filter(p=>p.status===e.status)),e.type&&(P=P.filter(p=>(p.type??"Task").toLowerCase()===e.type.toLowerCase())),e.user&&!l(e.user,P))return;e.user&&(P=P.filter(p=>o(p.author,e.user))),e.tag&&e.tag.length>0&&(P=P.filter(p=>e.tag.every(N=>(p.tags??[]).includes(N))));let A=e.limit!==void 0?parseInt(e.limit,10):20;if(!isNaN(A)&&A>0&&(P=P.slice(0,A)),e.json){console.log(JSON.stringify(P,null,2));return}let I=P.some(p=>(p.type??"").toLowerCase()==="research"),w=P.some(p=>(p.type??"").toLowerCase()==="bug"),m=X(K(t));if(Ee({hasResearchTasks:I,hasBugTasks:w,autoCommit:m.autoCommit,autoPush:m.autoPush,autoComment:m.autoComment,createBranch:m.createBranch}),P.length===0)console.log(n.dim("No tasks found."));else{P=P.sort((x,v)=>{let M=Qe(x.status)-Qe(v.status);if(M!==0)return M;let U=ge(x.priority??void 0)-ge(v.priority??void 0);return U!==0?U:new Date(v.updatedAt).getTime()-new Date(x.updatedAt).getTime()});for(let[x,v]of P.entries()){let M=xe[v.status]??n.white,U=To(v.type);if(console.log(` ${n.dim(`${x+1}.`)} ${M(`[${v.status}]`)} ${v.title}`),console.log(n.dim(` id: ${v.id}`)),console.log(n.dim(" selector: /")),U&&console.log(n.dim(` type: ${U}`)),v.priority&&console.log(n.dim(` priority: ${v.priority}`)),console.log(n.dim(` created: ${v.createdAt}`)),v.description){console.log(n.dim(" description:"));for(let Y of v.description.split(`
|
|
29459
|
-
`))console.log(
|
|
29460
|
-
`))console.log(
|
|
29461
|
-
`))console.log(
|
|
29462
|
-
`))console.log(n.dim(` ${m}`))}if(w.structuredComments&&w.structuredComments.length>0){console.log(n.dim(` comments (${w.structuredComments.length}):`));for(let m of w.structuredComments){let p=m.updatedAt?` (edited ${m.updatedAt})`:"";console.log(n.dim(` [${m.author??"agent"}] ${m.createdAt}${p}`));for(let N of m.text.split(`
|
|
29463
|
-
`))console.log(n.dim(` ${N}`))}}if(w.linkedFiles&&w.linkedFiles.length>0){console.log(n.dim(` linked files (${w.linkedFiles.length}):`));for(let m of w.linkedFiles){let p=m.linkedPath??Wt(F,".vibeflow","files",b.id,m.name);if(console.log(n.dim(` - ${m.name} ${m.url}`)),/\.(md|txt)$/i.test(m.name)&&m.size<1e5&&kn(p))try{let N=bn(p,"utf-8");console.log(n.dim(" \u250C\u2500\u2500 content \u2500\u2500"));for(let _ of N.split(`
|
|
29464
|
-
`))console.log(n.dim(` \u2502 ${_}`));console.log(n.dim(" \u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500"))}catch{}}}console.log()}let G=g.filter(d=>d.status==="backlog").length,O=g.filter(d=>d.status==="todo").length,Z=g.filter(d=>d.status==="in-progress").length,he=g.filter(d=>d.status==="review").length,se=g.filter(d=>d.status==="done").length,Le=!isNaN(k)&&k>0&&L>k?n.yellow(` (showing ${k} of ${L} matching \u2014 use --limit 0 for all)`):"";console.log(n.dim(` Total: ${g.length} | Backlog: ${G} | Todo: ${O} | In Progress: ${Z} | Review: ${he} | Done: ${se}`)+Le),await we()})()});ie.command("login",{hidden:!0}).description("Authenticate CLI against the Vibeflow SaaS backend (device flow)").action(async()=>{ke("command_run",{command:"login"}),await we(),await Ve()});ie.command("logout",{hidden:!0}).description("Remove stored auth token and switch to local mode").action(async()=>{ke("command_run",{command:"logout"}),await we(),await Tt()});ie.command("status",{hidden:!0}).description("Show login status, connection info, and task statistics").action(async()=>{if(await be()==="local"){console.log(n.yellow("\u25CF Not logged in")+n.dim(" (local mode)")),console.log(n.dim(" Run ")+n.cyan("vibeflow login")+n.dim(" to connect to the Vibeflow cloud.")),console.log();let o=K("."),a=pe(o);if(a.length>0){let s=a.reduce((l,f)=>(l[f.status]=(l[f.status]??0)+1,l),{});console.log(n.bold(" Local task statistics:"));for(let[l,f]of Object.entries(s)){let u=xe[l]??n.white;console.log(` ${u(l.padEnd(12))} ${f}`)}console.log(n.dim(` ${"total".padEnd(12)} ${a.length}`))}else console.log(n.dim(" No local tasks found."));return}let e=await ne();console.log(n.green("\u25CF Online")+n.dim(" (SaaS mode)")),e&&(console.log(n.dim(` Board: ${e.icon?e.icon+" ":""}${e.name}`)),e.email&&console.log(n.dim(` Email: ${e.email}`)),console.log(n.dim(" URL: ")+n.cyan(e.url))),console.log();let r=await Se(e?.id);if(!r){console.log(n.yellow(" \u26A0 Could not reach SaaS backend. Check your connection."));return}let i=r.tasks.map(o=>({...o,status:fe(o.status)}));if(i.length===0){console.log(n.dim(" No tasks found."));return}let c=i.reduce((o,a)=>(o[a.status]=(o[a.status]??0)+1,o),{});console.log(n.bold(" Task statistics:"));for(let[o,a]of Object.entries(c)){let s=xe[o]??n.white;console.log(` ${s(o.padEnd(12))} ${a}`)}console.log(n.dim(` ${"total".padEnd(12)} ${i.length}`))});ie.command("push",{hidden:!0}).description("Push all local tasks to the Vibeflow SaaS app and delete them locally").argument("[dir]","Project root directory",".").option("--workspace <id>","Target workspace ID (defaults to your first workspace)").option("--keep-local-files","Keep local task files after pushing (do not delete them)").action(async(t,e)=>{ke("command_run",{command:"push"}),await Rt(t,e),await we()});ie.command("telemetry").description("Manage CLI usage telemetry (opt-out at any time)").option("--enable","Enable usage telemetry (default)").option("--disable","Disable usage telemetry").option("--status","Show current telemetry status").action(async t=>{if(t.disable){yn(!1),console.log(n.yellow("Telemetry disabled. No usage data will be collected.")),console.log(n.dim("Run `vibeflow telemetry --enable` to re-enable at any time."));return}if(t.enable){yn(!0),console.log(n.green("Telemetry enabled. Thank you for helping improve Vibeflow!"));return}let{enabled:e,anonymousId:r}=jt(),i=process.env.VIBEFLOW_TELEMETRY==="0";console.log(n.bold("Telemetry status:")),console.log(` Enabled: ${e?n.green("yes"):n.yellow("no")}`),i&&console.log(n.dim(" (disabled via VIBEFLOW_TELEMETRY=0 environment variable)")),r&&console.log(n.dim(` Anonymous ID: ${r}`)),console.log(),console.log(n.dim(" vibeflow telemetry --disable Opt out of usage tracking")),console.log(n.dim(" vibeflow telemetry --enable Opt back in")),console.log(n.dim(" No PII is ever collected. User identity is hashed."))});ie.parse();
|
|
29638
|
+
`);se.command("serve").description("Serve HTML prototype(s) with live overlay, or start API-only task server for existing apps").argument("[target]","HTML file or directory of HTML files").option("-p, --port <port>","Port number","3700").option("--host <host>","Bind hostname (default: localhost; use 0.0.0.0 for LAN sharing)").option("--no-open","Do not open browser automatically").action(async(n,e)=>{xe("command_run",{command:"serve"}),await we(),await bn(n,{port:parseInt(e.port,10),host:e.host,open:e.open})});se.command("kanban").description("Start the Vibeflow server and open the live Kanban board in the browser").argument("[dir]","Project root directory",".").option("-p, --port <port>","Port number","3700").option("--host <host>","Bind hostname (default: localhost; use 0.0.0.0 for LAN sharing)").action(async(n,e)=>{xe("command_run",{command:"kanban"}),await we();let r=parseInt(e.port,10),d=(await bn(void 0,{port:r,host:e.host,open:!1,projectDir:Y(n)})).url+"/kanban";console.log(),console.log(t.green(" \u2713 Kanban board ready")),console.log(t.dim(" ")+t.cyan(d)),console.log(),console.log(t.bold("Agent prompt:")),console.log(t.dim(" Get new tasks and implement them, once done check again for new ones:")),console.log(t.dim(" ")+t.green("npx @vibeflow-tools/cli tasks --next")),console.log(),import("open").then(a=>a.default(d)).catch(()=>{console.log(t.dim(" Visit: ")+t.cyan(d))}),_o()});se.command("tasks").description("List or edit tasks in the project").argument("[dir]","Project root directory",".").option("--status <status>","Filter by status (backlog, todo, in-progress, review, done)").option("--type <type>","Filter by type (Task, Bug, Feature, Enhancement, Research)").option("--user <user>","Filter by exact task author email (case-insensitive)").option("--edit [task-id]","Edit a task by ID (LLM-friendly). Omit task-id to see usage instructions.").option("--add","Create a task (requires --title)").option("--title <title>","New title for the task (use with --edit)").option("--set-status <status>","New status: backlog | todo | in-progress | review | done (use with --edit)").option("--description <text>","New description for the task (use with --edit)").option("--json","Output machine-readable JSON").option("--commit","Commit staged changes and link the commit SHA to a task (use with --task)").option("--task <task-id>","Task ID to link with the commit (use with --commit)").option("--message <msg>","Commit message (use with --commit; task ID is appended automatically)").option("--comment <text>","Implementation report comment (required when setting status to review)").option("--commit-message <msg>","Commit message for auto-commit on review (required when auto-commit setting is ON)").option("--get <task-id>","Get full details of a single task by ID (supports partial ID prefix)").option("--next","Pick the next available todo task, move it to in-progress, and output it ready to work on").option("--tag <tag>","Filter by tag (can be specified multiple times for AND matching)",(n,e)=>[...e,n],[]).option("--report-file <path>","Path to a local .md file to upload as the research report (use with --set-status review on Research tasks; file is uploaded and deleted locally)").option("--limit <n>","Limit how many tasks are returned in list mode (default: 20; use 0 for unlimited)").action((n,e)=>{(async()=>{let r=e.add?"add":e.next?"next":e.edit?"edit":e.get?"get":"list";xe("command_run",{command:"tasks",subcommand:r});let u=["Task","Bug","Feature","Enhancement","Research"],d=f=>f.trim().toLowerCase(),a=(f,g)=>{let S=d(g);return S?d(f??"")===S:!0},l=f=>[...new Set(f.map(g=>g.author?.trim()).filter(g=>!!g))].sort((g,S)=>g.localeCompare(S)),i=f=>u.map(g=>g.toLowerCase()).includes(f.toLowerCase())?!0:(console.log(t.red(`\u2717 Invalid type filter: "${f}"`)),console.log(t.yellow(` Available types: ${u.join(" | ")}`)),console.log(t.dim(" Type filter is exact (example: --type Bug)")),process.exitCode=1,!1),o=(f,g)=>{let S=l(g);return S.length===0?(console.log(t.red("\u2717 Cannot filter by user: no task authors are available on this board.")),process.exitCode=1,!1):S.some(A=>a(A,f))?!0:(console.log(t.red(`\u2717 User not found: "${f}"`)),console.log(t.yellow(` Available users: ${S.join(" | ")}`)),console.log(t.dim(" User filter is exact email match (case-insensitive).")),process.exitCode=1,!1)};if(e.get){if(await ke()==="saas"){let x=await re(),M=await Te(x?.id);if(!M){console.log(t.red("\u2717 Unable to reach the online backend.")),process.exitCode=1;return}let E=M.tasks.find(T=>T.id===e.get||T.id.startsWith(e.get));if(!E){console.log(t.red(`\u2717 Task not found: ${e.get}`)),process.exitCode=1;return}let O=me(E.status);if(e.json){console.log(JSON.stringify({...E,status:O},null,2));return}let ae=Ce[O]??t.white;if(console.log(` ${ae(`[${O}]`)} ${t.bold(E.title)}`),console.log(t.dim(` id: ${E.id}`)),console.log(t.dim(" selector: /")),E.type&&console.log(t.dim(` type: ${E.type}`)),E.priority&&console.log(t.dim(` priority: ${E.priority}`)),console.log(t.dim(` created: ${E.createdAt}`)),E.description){console.log(t.dim(" description:"));for(let T of E.description.split(`
|
|
29639
|
+
`))console.log(t.dim(` ${T}`))}E.annotatedElementText&&console.log(t.dim(` element text: ${E.annotatedElementText}`));let X=[...E.comments??[]].sort((T,z)=>new Date(T.createdAt).getTime()-new Date(z.createdAt).getTime());if(X.length>0){console.log(t.dim(` comments (${X.length}):`));for(let T of X){console.log(t.dim(` [${T.author??"agent"}] ${T.createdAt}`));for(let z of T.body.split(`
|
|
29640
|
+
`))console.log(t.dim(` ${z}`))}}if(E.files&&E.files.length>0){console.log(t.dim(` linked files (${E.files.length}):`));for(let T of E.files){let z=T.url??`${process.env.SPOTA_API_URL??"http://localhost:3000"}/api/tasks/${E.id}/files/${encodeURIComponent(T.name)}`;if(console.log(t.dim(` - ${T.name} ${z}`)),T.content){console.log(t.dim(" \u250C\u2500\u2500 content \u2500\u2500"));for(let Se of T.content.split(`
|
|
29641
|
+
`))console.log(t.dim(` \u2502 ${Se}`));console.log(t.dim(" \u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500"))}}}let ge=J(Y(n)),en=(E.type??"").toLowerCase()==="research",Re=(E.type??"").toLowerCase()==="bug";_e({hasResearchTasks:en,hasBugTasks:Re,autoCommit:ge.autoCommit,autoPush:ge.autoPush,autoComment:ge.autoComment,createBranch:ge.createBranch});return}let g=Y(n),S=Pe(g),F=de(g).find(x=>x.id===e.get||x.id.startsWith(e.get));if(!F){console.log(t.red(`\u2717 Task not found: ${e.get}`)),console.log(t.dim(" Run 'vibeflow tasks' to see available task IDs.")),process.exitCode=1;return}let C=pe(g,F.id).sort((x,M)=>new Date(x.createdAt).getTime()-new Date(M.createdAt).getTime()),v=te(g,F.id).map(x=>({...x,url:`http://localhost:${S.port}${x.url}`})),w=nn(F,C,v);if(e.json){console.log(JSON.stringify({...F,comments:C,files:v},null,2));return}let N=Ce[F.status]??t.white,W=De(F,F.filePath,C,v,g).split(`
|
|
29642
|
+
`);if(W.length>0){let x=W[0],M=x.match(/^\[(\w+)\]\s+(.+)$/);console.log(M?` ${N(`[${M[1]}]`)} ${t.bold(M[2])}`:t.dim(x));for(let E=1;E<W.length;E++)console.log(t.dim(W[E]))}let Q=J(g),ye=(F.type??"").toLowerCase()==="research",j=(F.type??"").toLowerCase()==="bug";_e({hasResearchTasks:ye,hasBugTasks:j,autoCommit:Q.autoCommit,autoPush:Q.autoPush,autoComment:Q.autoComment,createBranch:Q.createBranch});return}if(e.next){if(await ke()==="saas"){let x=await re(),M=await Te(x?.id);if(!M){console.log(t.red("\u2717 Unable to reach the online backend.")),process.exitCode=1;return}if(e.type&&!i(e.type))return;let E=M.tasks.map(T=>({...T,status:me(T.status)})).filter(T=>T.status==="todo");if(e.type&&(E=E.filter(T=>(T.type??"Task").toLowerCase()===e.type.toLowerCase())),e.user&&!o(e.user,E))return;if(e.user&&(E=E.filter(T=>a(T.author,e.user))),e.tag&&e.tag.length>0&&(E=E.filter(T=>e.tag.every(z=>(T.tags??[]).includes(z)))),E=E.sort((T,z)=>{let Se=he(T.priority??void 0)-he(z.priority??void 0);return Se!==0?Se:new Date(T.createdAt).getTime()-new Date(z.createdAt).getTime()}),E.length===0){let T=[e.type&&`type=${e.type}`,e.user&&`user=${e.user}`,e.tag?.length&&`tag=${e.tag.join(",")}`].filter(Boolean),z=T.length>0?` matching ${T.join(" ")}`:"";console.log(t.dim(`No todo tasks found${z}. Nothing to work on.`));return}let O=E[0];if(!await xn(O.id,{status:"in-progress"})){console.log(t.red(`\u2717 Failed to move task to in-progress: ${O.id}`)),process.exitCode=1;return}if(e.json){console.log(JSON.stringify({...O,status:"in-progress"},null,2));return}let X=J(Y(n)),ge=(O.type??"").toLowerCase()==="research",en=(O.type??"").toLowerCase()==="bug";if(_e({hasResearchTasks:ge,hasBugTasks:en,autoCommit:X.autoCommit,autoPush:X.autoPush,autoComment:X.autoComment,createBranch:X.createBranch}),console.log(t.green.bold("\u25B6 NEXT TASK \u2014 Status moved to in-progress. Implement this now:")),console.log(),console.log(` ${t.blue("[in-progress]")} ${t.bold(O.title)}`),console.log(t.dim(` id: ${O.id}`)),O.type&&console.log(t.dim(` type: ${O.type}`)),O.priority&&console.log(t.dim(` priority: ${O.priority}`)),console.log(t.dim(` created: ${O.createdAt}`)),O.description){console.log(t.dim(" description:"));for(let T of O.description.split(`
|
|
29643
|
+
`))console.log(t.dim(` ${T}`))}let Re=[...O.comments??[]].sort((T,z)=>new Date(T.createdAt).getTime()-new Date(z.createdAt).getTime());if(Re.length>0){console.log(t.dim(` comments (${Re.length}):`));for(let T of Re){let z=T.authorId?`user:${T.authorId.slice(0,8)}`:"agent";console.log(t.dim(` [${z}] ${T.createdAt}`));for(let Se of T.body.split(`
|
|
29644
|
+
`))console.log(t.dim(` ${Se}`))}}console.log(),console.log(t.yellow(" \u26A1 This task is already in-progress. Implement it now and mark as review when done."));return}let g=Y(n),S=de(g);if(e.type&&!i(e.type))return;let A=S.filter(x=>x.status==="todo");if(e.type&&(A=A.filter(x=>(x.type??"Task").toLowerCase()===e.type.toLowerCase())),e.user&&!o(e.user,A))return;if(e.user&&(A=A.filter(x=>a(x.author,e.user))),e.tag&&e.tag.length>0&&(A=A.filter(x=>e.tag.every(M=>(x.tags??[]).includes(M)))),A=A.sort((x,M)=>{let E=he(x.priority)-he(M.priority);return E!==0?E:new Date(x.created).getTime()-new Date(M.created).getTime()}),A.length===0){let x=[e.type&&`type=${e.type}`,e.user&&`user=${e.user}`,e.tag?.length&&`tag=${e.tag.join(",")}`].filter(Boolean),M=x.length>0?` matching ${x.join(" ")}`:"";console.log(t.dim(`No todo tasks found${M}. Nothing to work on.`));return}let F=A[0],C=V(g,F.id,{status:"in-progress"});if(!C){console.log(t.red(`\u2717 Failed to update task: ${F.id}`)),process.exitCode=1;return}if(e.json){console.log(JSON.stringify({...C,filePath:F.filePath},null,2));return}let v=J(g),w=(C.type??"").toLowerCase()==="research",N=(C.type??"").toLowerCase()==="bug";_e({hasResearchTasks:w,hasBugTasks:N,autoCommit:v.autoCommit,autoPush:v.autoPush,autoComment:v.autoComment,createBranch:v.createBranch});let _=Pe(g),W=pe(g,C.id).sort((x,M)=>new Date(x.createdAt).getTime()-new Date(M.createdAt).getTime()),Q=te(g,C.id).map(x=>({...x,url:`http://localhost:${_.port}${x.url}`})),ye=De(C,F.filePath,W,Q,g);console.log(t.green.bold("\u25B6 NEXT TASK \u2014 Status moved to in-progress. Implement this now:")),console.log();let j=ye.split(`
|
|
29645
|
+
`);if(j.length>0){let x=j[0].match(/^\[(\w+)\]\s+(.+)$/);console.log(x?` ${t.blue(`[${x[1]}]`)} ${t.bold(x[2])}`:t.dim(j[0]));for(let M=1;M<j.length;M++)console.log(t.dim(j[M]))}console.log(),console.log(t.yellow(" \u26A1 This task is already in-progress. Implement it now and mark as review when done."));return}if(e.add){if(!e.title?.trim()){console.log(t.red("\u2717 --title is required with --add")),console.log(t.dim(' Example: vibeflow tasks --add --title "Fix CTA spacing" --description "Button overflows on mobile"')),process.exitCode=1;return}if(await ke()==="saas"){let C=await re(),w=["backlog","todo","in-progress","review","done"].includes(e.setStatus??"")?e.setStatus:"todo",N=En(),_=await At({id:N,title:e.title.trim(),description:e.description?.trim(),status:w,boardId:C?.id});if(!_){console.log(t.red("\u2717 Failed to create task in online board.")),console.log(t.yellow(" Check your connection or run 'vibeflow login'.")),process.exitCode=1;return}e.json?console.log(JSON.stringify(_,null,2)):(console.log(t.green(`\u2713 Task created: ${_.title}`)),console.log(t.dim(` id: ${_.id} | status: ${me(_.status)}`)));return}let g=Y(n);Fe(g);let A=["backlog","todo","in-progress","review","done"].includes(e.setStatus??"")?e.setStatus:"todo",F=Ee(g,{title:e.title.trim(),description:e.description?.trim()??"",status:A,selector:"/"});e.json?console.log(JSON.stringify(F,null,2)):(console.log(t.green(`\u2713 Task created: ${F.title}`)),console.log(t.dim(` id: ${F.id} | status: ${F.status}`)));return}if(e.commit){if(!e.task){console.log(t.red("\u2717 --task <task-id> is required with --commit")),console.log(t.dim(' Example: vibeflow tasks --commit --task abc12345 --message "fix button alignment"')),process.exitCode=1;return}let f=Y(n),S=ie(f).find(C=>C.id===e.task||C.id.startsWith(e.task));if(!S){console.log(t.red(`\u2717 Task not found: ${e.task}`)),console.log(t.dim(" Run 'vibeflow tasks' to see available task IDs.")),process.exitCode=1;return}let A=e.message?.trim()||S.title;(S.type??"").toLowerCase()==="research"&&(console.log(t.yellow("\u26A0 WARNING: This is a Research task. Research tasks must NOT produce code changes.")),console.log(t.yellow(" Only commit research report files (.md). Do not commit code changes.")),console.log());let F=`${A} [proto:${S.id}]`;try{Ze("git",["commit","-m",F],{cwd:f,stdio:"inherit"});let C=Cn("git rev-parse HEAD",{cwd:f}).toString().trim(),v={sha:C,message:A,timestamp:new Date().toISOString()},w=S.commits??[];if(V(f,S.id,{commits:[...w,v]}),console.log(t.green(`\u2713 Committed and linked to task: ${S.title}`)),console.log(t.dim(` commit: ${C}`)),console.log(t.dim(` proto: ${S.id}`)),J(f).autoPush){console.log(t.dim(" auto-push: pushing commit to remote..."));let _=Yt(f);_.ok?console.log(t.green("\u2713 Auto-push complete")):(console.log(t.yellow("\u26A0 Auto-push failed. Commit is local; run 'git push' manually.")),_.error&&console.log(t.dim(` reason: ${_.error}`)))}}catch{console.log(t.red("\u2717 git commit failed \u2014 ensure changes are staged with 'git add'")),process.exitCode=1}return}if(e.edit!==void 0){let f=typeof e.edit=="string"?e.edit:void 0,g=e.title||e.setStatus||e.description;if(!f||!g){if(e.type&&!i(e.type))return;let v=ie(n);if(e.status&&(v=v.filter(w=>w.status===e.status)),e.type&&(v=v.filter(w=>(w.type??"Task").toLowerCase()===e.type.toLowerCase())),e.user&&!o(e.user,v))return;if(e.user&&(v=v.filter(w=>a(w.author,e.user))),e.tag&&e.tag.length>0&&(v=v.filter(w=>e.tag.every(N=>(w.tags??[]).includes(N)))),console.log(t.bold("vibeflow tasks --edit \u2014 LLM Usage Instructions")),console.log(),console.log("Edit a task:"),console.log(t.cyan(' vibeflow tasks [dir] --edit <task-id> [--title "new title"] [--set-status backlog|todo|in-progress|review|done] [--description "new description"]')),console.log(),console.log("Examples:"),console.log(t.dim(" vibeflow tasks --edit abc12345 --set-status done")),console.log(t.dim(" vibeflow tasks --edit abc12345 --set-status in-progress")),console.log(t.dim(' vibeflow tasks --edit abc12345 --title "Updated title" --description "More detail"')),console.log(),v.length===0)console.log(t.dim("No tasks found."));else{console.log("Available tasks:");for(let w of v){let N=Ce[w.status]??t.white;console.log(` ${N(`[${w.status}]`)} ${t.bold(w.id)} \u2014 ${w.title}`)}}return}let S=["backlog","todo","in-progress","review","done"];if(e.setStatus==="done"&&(console.log(t.yellow('\u26A0 WARNING: Agents should NEVER set a task status to "done".')),console.log(t.yellow(" Only humans should mark tasks as done after reviewing.")),console.log(t.dim(" If you are an agent, use --set-status review instead.")),console.log()),e.setStatus&&!S.includes(e.setStatus)){console.log(t.red(`\u2717 Invalid status: "${e.setStatus}"`)),console.log(t.yellow(` Valid statuses: ${S.join(" | ")}`)),console.log(t.dim(` Example: vibeflow tasks --edit ${f} --set-status in-progress`)),process.exitCode=1;return}if(e.setStatus==="review"&&!e.comment?.trim()){console.log(t.red("\u2717 --comment is required when setting status to review")),console.log(t.dim(" Provide a concise implementation report explaining:")),console.log(t.dim(" \xB7 what was changed and why")),console.log(t.dim(" \xB7 key decisions and trade-offs")),console.log(t.dim(" \xB7 anything future agents should know")),console.log(t.dim(` Example: vibeflow tasks --edit ${f} --set-status review --comment "Implemented X by doing Y. Key decision: Z."`)),process.exitCode=1;return}let A=await ke();if(e.setStatus==="review"){let v=Y(n),w=J(v);if(w.autoComment&&!e.comment?.trim()){console.log(t.red("\u2717 --comment is required (auto-comment setting is ON)")),console.log(t.dim(" Provide: what changed, why, key decisions, anything future agents should know.")),console.log(t.dim(" Plain text for short notes; Markdown for multi-section reports.")),console.log(t.dim(` Example: vibeflow tasks --edit ${f} --set-status review --comment "Implemented X by doing Y."`)),process.exitCode=1;return}if(w.autoCommit&&!e.commitMessage?.trim()){console.log(t.red("\u2717 --commit-message is required (auto-commit setting is ON)")),console.log(t.dim(" Stage your changes first, then provide a one-line commit summary.")),console.log(t.dim(` Example: vibeflow tasks --edit ${f} --set-status review --commit-message "fix: add hover effect" --comment "..."`)),process.exitCode=1;return}}if(A==="saas"){let v={};if(e.setStatus&&(v.status=e.setStatus),e.title&&(v.title=e.title),e.description&&(v.description=e.description),e.setStatus==="in-progress"){let N=await Ft(f);if(N&&me(N.status)==="in-progress"){let _=N.author??"another user";console.log(t.yellow(`\u26A0 Task is already in-progress (last updated by: ${_})`)),console.log(t.yellow(" Another agent or user may be working on this task.")),console.log(t.yellow(" Proceeding \u2014 but verify the task is not being worked on elsewhere.")),console.log()}}let w=await xn(f,v);if(!w){console.log(t.red(`\u2717 Failed to update task: ${f}`)),console.log(t.yellow(" Ensure you are connected and the task ID exists in the online board.")),process.exitCode=1;return}w.warning&&console.log(t.yellow(`\u26A0 Server warning: ${w.warning}`)),e.setStatus==="review"&&e.comment?.trim()&&await Dt(f,e.comment.trim())&&console.log(t.dim(" comment: added")),console.log(t.green(`\u2713 Task updated: ${w.task.title}`)),console.log(t.dim(` id: ${w.task.id} | status: ${me(w.task.status)}`));return}let F={};if(e.title&&(F.title=e.title),e.setStatus&&(F.status=e.setStatus),e.description&&(F.description=e.description),e.setStatus==="in-progress"){let v=Y(n),N=ie(v).find(_=>_.id===f||_.id.startsWith(f));if(N&&((N.type??"").toLowerCase()==="research"&&(console.log(t.yellow("\u26A0 WARNING: This is a Research task. Policy: do NOT implement code.")),console.log(t.yellow(" Research only \u2014 attach a .md report file, leave a summary comment, mark as review.")),console.log()),N.status==="in-progress")){let _=N.updated?new Date(N.updated).toLocaleString():"unknown",W=N.author??"another user";console.log(t.yellow(`\u26A0 Task is already in-progress (author: ${W}, last updated: ${_})`)),console.log(t.yellow(" Another agent or user may be working on this task.")),console.log(t.yellow(" Proceeding \u2014 but verify the task is not being worked on elsewhere.")),console.log()}}if(e.setStatus==="review"){let v=Y(n),N=ie(v).find(_=>_.id===f||_.id.startsWith(f));if(N&&(N.type??"").toLowerCase()==="research"){if(e.reportFile){let _=Y(e.reportFile);if(!Bt(_)){console.log(t.red(`\u2717 Report file not found: ${_}`)),process.exitCode=1;return}if(!/\.md$/i.test(_)){console.log(t.red("\u2717 Report file must be a Markdown (.md) file")),process.exitCode=1;return}let W=zt(_),{saveFile:Q}=await import("./files-H2UIFEPJ.js");Q(v,N.id,Vt(_),W),Po(_),console.log(t.green(`\u2713 Report uploaded: ${Vt(_)} (local file removed)`))}else if(!te(v,N.id).some(Q=>/\.md$/i.test(Q.name))){console.log(t.red("\u2717 Cannot mark Research task as review: no .md report file attached.")),console.log(t.dim(" Provide a research report:")),console.log(t.dim(` vibeflow tasks --edit ${f} --set-status review --report-file ./my-research.md --comment "..."`)),process.exitCode=1;return}}}let C=V(n,f,F);if(!C){console.log(t.red(`\u2717 Task not found: ${f}`)),console.log(t.yellow(" Run 'vibeflow tasks' to see available task IDs.")),process.exitCode=1;return}if(e.setStatus==="review"&&e.comment?.trim()&&(be(Y(n),f,"agent",e.comment.trim()),console.log(t.dim(" comment: added"))),console.log(t.green(`\u2713 Task updated: ${C.title}`)),console.log(t.dim(` id: ${C.id} | status: ${C.status}`)),e.setStatus==="review"){let v=Y(n),w=J(v);if(w.autoCommit&&e.commitMessage?.trim()){let _=ie(v).find(W=>W.id===f||W.id.startsWith(f));if(_){let W=`${e.commitMessage.trim()} [proto:${_.id}]`;try{Ze("git",["commit","-m",W],{cwd:v,stdio:"inherit"});let Q=Cn("git rev-parse HEAD",{cwd:v}).toString().trim(),ye={sha:Q,message:e.commitMessage.trim(),timestamp:new Date().toISOString()},j=_.commits??[];if(V(v,_.id,{commits:[...j,ye]}),console.log(t.green(`\u2713 Committed: ${W}`)),console.log(t.dim(` sha: ${Q}`)),w.autoPush){console.log(t.dim(" pushing..."));let x=Yt(v);x.ok?console.log(t.green("\u2713 Pushed")):(console.log(t.yellow("\u26A0 Push failed. Run 'git push' manually.")),x.error&&console.log(t.dim(` reason: ${x.error}`)))}}catch{console.log(t.red("\u2717 git commit failed \u2014 ensure changes are staged with 'git add'")),process.exitCode=1}}}}return}let s=["backlog","todo","in-progress","review","done"];if(e.status&&!s.includes(e.status)){console.log(t.red(`\u2717 Invalid status filter: "${e.status}"`)),console.log(t.yellow(` Valid statuses: ${s.join(" | ")}`)),console.log(t.dim(" Example: vibeflow tasks --status todo")),process.exitCode=1;return}if(e.type&&!i(e.type))return;if(await ke()==="saas"){let f=await re(),g=await Te(f?.id);if(!g){console.log(t.red("\u2717 Unable to reach the online backend.")),console.log(t.yellow(" Check your connection or run 'vibeflow login' if your session expired.")),process.exitCode=1;return}let S=g.tasks.map(w=>({...w,status:me(w.status)}));if(e.status&&(S=S.filter(w=>w.status===e.status)),e.type&&(S=S.filter(w=>(w.type??"Task").toLowerCase()===e.type.toLowerCase())),e.user&&!o(e.user,S))return;e.user&&(S=S.filter(w=>a(w.author,e.user))),e.tag&&e.tag.length>0&&(S=S.filter(w=>e.tag.every(N=>(w.tags??[]).includes(N))));let A=e.limit!==void 0?parseInt(e.limit,10):20;if(!isNaN(A)&&A>0&&(S=S.slice(0,A)),e.json){console.log(JSON.stringify(S,null,2));return}let F=S.some(w=>(w.type??"").toLowerCase()==="research"),C=S.some(w=>(w.type??"").toLowerCase()==="bug"),v=J(Y(n));if(_e({hasResearchTasks:F,hasBugTasks:C,autoCommit:v.autoCommit,autoPush:v.autoPush,autoComment:v.autoComment,createBranch:v.createBranch}),S.length===0)console.log(t.dim("No tasks found."));else{S=S.sort((j,x)=>{let M=Je(j.status)-Je(x.status);if(M!==0)return M;let E=he(j.priority??void 0)-he(x.priority??void 0);return E!==0?E:new Date(x.updatedAt).getTime()-new Date(j.updatedAt).getTime()});for(let[j,x]of S.entries()){let M=Ce[x.status]??t.white,E=No(x.type);if(console.log(` ${t.dim(`${j+1}.`)} ${M(`[${x.status}]`)} ${x.title}`),console.log(t.dim(` id: ${x.id}`)),console.log(t.dim(" selector: /")),E&&console.log(t.dim(` type: ${E}`)),x.priority&&console.log(t.dim(` priority: ${x.priority}`)),console.log(t.dim(` created: ${x.createdAt}`)),x.description){console.log(t.dim(" description:"));for(let O of x.description.split(`
|
|
29646
|
+
`))console.log(t.dim(` ${O}`))}if(x.comments&&x.comments.length>0){let O=[...x.comments].sort((ae,X)=>new Date(ae.createdAt).getTime()-new Date(X.createdAt).getTime());console.log(t.dim(` comments (${O.length}):`));for(let ae of O){let X=ae.authorId?`user:${ae.authorId.slice(0,8)}`:"agent";console.log(t.dim(` [${X}] ${ae.createdAt}`));for(let ge of ae.body.split(`
|
|
29647
|
+
`))console.log(t.dim(` ${ge}`))}}if(x.files&&x.files.length>0){console.log(t.dim(` linked files (${x.files.length}):`));for(let O of x.files){let ae=O.url??`${process.env.SPOTA_API_URL??"http://localhost:3000"}/api/tasks/${x.id}/files/${encodeURIComponent(O.name)}`;if(console.log(t.dim(` - ${O.name} ${ae}`)),O.content){console.log(t.dim(" \u250C\u2500\u2500 content \u2500\u2500"));for(let X of O.content.split(`
|
|
29648
|
+
`))console.log(t.dim(` \u2502 ${X}`));console.log(t.dim(" \u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500"))}}}console.log()}let w=g.tasks.map(j=>({...j,status:me(j.status)})),N=w.filter(j=>j.status==="backlog").length,_=w.filter(j=>j.status==="todo").length,W=w.filter(j=>j.status==="in-progress").length,Q=w.filter(j=>j.status==="review").length,ye=w.filter(j=>j.status==="done").length;console.log(t.dim(` Total: ${w.length} | Backlog: ${N} | Todo: ${_} | In Progress: ${W} | Review: ${Q} | Done: ${ye}`))}return}let p=de(n);if(e.user&&!o(e.user,p))return;let m=e.status?p.filter(f=>f.status===e.status):p;e.type&&(m=m.filter(f=>(f.type??"Task").toLowerCase()===e.type.toLowerCase())),e.user&&(m=m.filter(f=>a(f.author,e.user))),e.tag&&e.tag.length>0&&(m=m.filter(f=>e.tag.every(g=>(f.tags??[]).includes(g))));let h=e.limit!==void 0?parseInt(e.limit,10):20;if(e.json){console.log(JSON.stringify(m,null,2));return}m=m.sort((f,g)=>{let S=Je(f.status)-Je(g.status);if(S!==0)return S;let A=he(f.priority)-he(g.priority);if(A!==0)return A;let F=new Date(f.updated??f.created).getTime(),C=new Date(g.updated??g.created).getTime();return F!==C?C-F:f.id.localeCompare(g.id)});let L=m.length;if(!isNaN(h)&&h>0&&(m=m.slice(0,h)),m.length===0){console.log(t.dim("No tasks found."));return}let I=Y(n),b=m.some(f=>(f.type??"").toLowerCase()==="research"),k=m.some(f=>(f.type??"").toLowerCase()==="bug"),R=J(I);_e({hasResearchTasks:b,hasBugTasks:k,autoCommit:R.autoCommit,autoPush:R.autoPush,autoComment:R.autoComment,createBranch:R.createBranch});let U=Pe(I);for(let[f,g]of m.entries()){let S=Ce[g.status]??t.white,A=pe(I,g.id).sort((v,w)=>new Date(v.createdAt).getTime()-new Date(w.createdAt).getTime()),F=te(I,g.id).map(v=>({...v,url:`http://localhost:${U.port}${v.url}`})),C=nn(g,A,F);if(console.log(` ${t.dim(`${f+1}.`)} ${S(`[${C.status}]`)} ${C.title}`),console.log(t.dim(` id: ${C.id}`)),console.log(t.dim(` file: ${g.filePath}`)),C.file&&console.log(t.dim(` source: ${C.file}${C.line!=null?`:${C.line}`:""}${C.col!=null?`:${C.col}`:""}`)),C.component&&console.log(t.dim(` component: ${C.component}`)),console.log(t.dim(` selector: ${C.selector}`)),g.cssSelector&&console.log(t.dim(` css: ${g.cssSelector}`)),C.url&&console.log(t.dim(` url: ${C.url}`)),g.screenshot&&console.log(t.dim(` screenshot: http://localhost:${U.port}/screenshots/${g.screenshot}`)),g.commits&&g.commits.length>0)if(g.commits.length===1)console.log(t.dim(` commit: ${g.commits[0].sha}`));else{console.log(t.dim(` commits (${g.commits.length}):`));for(let v of g.commits)console.log(t.dim(` ${v.sha.slice(0,8)} ${v.timestamp} ${v.message.slice(0,60)}`))}if(console.log(t.dim(` created: ${C.created}`)),C.type&&console.log(t.dim(` type: ${C.type}`)),C.priority&&console.log(t.dim(` priority: ${C.priority}`)),C.description){console.log(t.dim(" description:"));for(let v of C.description.split(`
|
|
29649
|
+
`))console.log(t.dim(` ${v}`))}if(C.structuredComments&&C.structuredComments.length>0){console.log(t.dim(` comments (${C.structuredComments.length}):`));for(let v of C.structuredComments){let w=v.updatedAt?` (edited ${v.updatedAt})`:"";console.log(t.dim(` [${v.author??"agent"}] ${v.createdAt}${w}`));for(let N of v.text.split(`
|
|
29650
|
+
`))console.log(t.dim(` ${N}`))}}if(C.linkedFiles&&C.linkedFiles.length>0){console.log(t.dim(` linked files (${C.linkedFiles.length}):`));for(let v of C.linkedFiles){let w=v.linkedPath??Io(I,".vibeflow","files",g.id,v.name);if(console.log(t.dim(` - ${v.name} ${v.url}`)),/\.(md|txt)$/i.test(v.name)&&v.size<1e5&&Bt(w))try{let N=zt(w,"utf-8");console.log(t.dim(" \u250C\u2500\u2500 content \u2500\u2500"));for(let _ of N.split(`
|
|
29651
|
+
`))console.log(t.dim(` \u2502 ${_}`));console.log(t.dim(" \u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500"))}catch{}}}console.log()}let K=p.filter(f=>f.status==="backlog").length,D=p.filter(f=>f.status==="todo").length,G=p.filter(f=>f.status==="in-progress").length,ee=p.filter(f=>f.status==="review").length,$=p.filter(f=>f.status==="done").length,ve=!isNaN(h)&&h>0&&L>h?t.yellow(` (showing ${h} of ${L} matching \u2014 use --limit 0 for all)`):"";console.log(t.dim(` Total: ${p.length} | Backlog: ${K} | Todo: ${D} | In Progress: ${G} | Review: ${ee} | Done: ${$}`)+ve),await we()})()});se.command("login",{hidden:!0}).description("Authenticate CLI against the Vibeflow SaaS backend (device flow)").action(async()=>{xe("command_run",{command:"login"}),await we(),await Ke()});se.command("logout",{hidden:!0}).description("Remove stored auth token and switch to local mode").action(async()=>{xe("command_run",{command:"logout"}),await we(),await Rt()});se.command("status",{hidden:!0}).description("Show login status, connection info, and task statistics").action(async()=>{if(await ke()==="local"){console.log(t.yellow("\u25CF Not logged in")+t.dim(" (local mode)")),console.log(t.dim(" Run ")+t.cyan("vibeflow login")+t.dim(" to connect to the Vibeflow cloud.")),console.log();let a=Y("."),l=de(a);if(l.length>0){let i=l.reduce((o,s)=>(o[s.status]=(o[s.status]??0)+1,o),{});console.log(t.bold(" Local task statistics:"));for(let[o,s]of Object.entries(i)){let c=Ce[o]??t.white;console.log(` ${c(o.padEnd(12))} ${s}`)}console.log(t.dim(` ${"total".padEnd(12)} ${l.length}`))}else console.log(t.dim(" No local tasks found."));return}let e=await re();console.log(t.green("\u25CF Online")+t.dim(" (SaaS mode)")),e&&(console.log(t.dim(` Board: ${e.icon?e.icon+" ":""}${e.name}`)),e.email&&console.log(t.dim(` Email: ${e.email}`)),console.log(t.dim(" URL: ")+t.cyan(e.url))),console.log();let r=await Te(e?.id);if(!r){console.log(t.yellow(" \u26A0 Could not reach SaaS backend. Check your connection."));return}let u=r.tasks.map(a=>({...a,status:me(a.status)}));if(u.length===0){console.log(t.dim(" No tasks found."));return}let d=u.reduce((a,l)=>(a[l.status]=(a[l.status]??0)+1,a),{});console.log(t.bold(" Task statistics:"));for(let[a,l]of Object.entries(d)){let i=Ce[a]??t.white;console.log(` ${i(a.padEnd(12))} ${l}`)}console.log(t.dim(` ${"total".padEnd(12)} ${u.length}`))});se.command("push",{hidden:!0}).description("Push all local tasks to the Vibeflow SaaS app and delete them locally").argument("[dir]","Project root directory",".").option("--workspace <id>","Target workspace ID (defaults to your first workspace)").option("--keep-local-files","Keep local task files after pushing (do not delete them)").action(async(n,e)=>{xe("command_run",{command:"push"}),await Lt(n,e),await we()});se.command("telemetry").description("Manage CLI usage telemetry (opt-out at any time)").option("--enable","Enable usage telemetry (default)").option("--disable","Disable usage telemetry").option("--status","Show current telemetry status").action(async n=>{if(n.disable){wn(!1),console.log(t.yellow("Telemetry disabled. No usage data will be collected.")),console.log(t.dim("Run `vibeflow telemetry --enable` to re-enable at any time."));return}if(n.enable){wn(!0),console.log(t.green("Telemetry enabled. Thank you for helping improve Vibeflow!"));return}let{enabled:e,anonymousId:r}=$t(),u=process.env.VIBEFLOW_TELEMETRY==="0";console.log(t.bold("Telemetry status:")),console.log(` Enabled: ${e?t.green("yes"):t.yellow("no")}`),u&&console.log(t.dim(" (disabled via VIBEFLOW_TELEMETRY=0 environment variable)")),r&&console.log(t.dim(` Anonymous ID: ${r}`)),console.log(),console.log(t.dim(" vibeflow telemetry --disable Opt out of usage tracking")),console.log(t.dim(" vibeflow telemetry --enable Opt back in")),console.log(t.dim(" No PII is ever collected. User identity is hashed."))});se.parse();
|