From cfa3081bf1dd6dece996b5eedea9542fb87df4ba Mon Sep 17 00:00:00 2001 From: Cristian Pufu Date: Mon, 2 Mar 2026 08:32:24 +0200 Subject: [PATCH] fix: bump rollup to 4.59.0 to fix CVE path traversal vulnerability Resolves GitHub Dependabot alert for arbitrary file write via path traversal in rollup >= 4.0.0, < 4.59.0. Co-Authored-By: Claude Opus 4.6 --- .../dev/server/frontend/package-lock.json | 508 +++++++++--------- src/uipath/dev/server/frontend/package.json | 3 +- ...anel-DR8dCKHB.js => ChatPanel-DiTmerW3.js} | 2 +- .../server/static/assets/index-CzFU-Cnb.css | 1 + .../{index-DDtQJ0N8.js => index-RLauX7zc.js} | 6 +- .../server/static/assets/index-tYuNMmSp.css | 1 - src/uipath/dev/server/static/index.html | 4 +- 7 files changed, 265 insertions(+), 260 deletions(-) rename src/uipath/dev/server/static/assets/{ChatPanel-DR8dCKHB.js => ChatPanel-DiTmerW3.js} (99%) create mode 100644 src/uipath/dev/server/static/assets/index-CzFU-Cnb.css rename src/uipath/dev/server/static/assets/{index-DDtQJ0N8.js => index-RLauX7zc.js} (98%) delete mode 100644 src/uipath/dev/server/static/assets/index-tYuNMmSp.css diff --git a/src/uipath/dev/server/frontend/package-lock.json b/src/uipath/dev/server/frontend/package-lock.json index 32e99fe..463db51 100644 --- a/src/uipath/dev/server/frontend/package-lock.json +++ b/src/uipath/dev/server/frontend/package-lock.json @@ -23,6 +23,7 @@ "@types/react": "^19.0.0", "@types/react-dom": "^19.0.0", "@vitejs/plugin-react": "^4.3.0", + "rollup": "^4.59.0", "tailwindcss": "^4.0.0", "typescript": "~5.7.0", "vite": "^6.0.0" @@ -1103,9 +1104,9 @@ "license": "MIT" }, "node_modules/@rollup/rollup-android-arm-eabi": { - "version": "4.57.1", - "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.57.1.tgz", - "integrity": "sha512-A6ehUVSiSaaliTxai040ZpZ2zTevHYbvu/lDoeAteHI8QnaosIzm4qwtezfRg1jOYaUmnzLX1AOD6Z+UJjtifg==", + "version": "4.59.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.59.0.tgz", + "integrity": "sha512-upnNBkA6ZH2VKGcBj9Fyl9IGNPULcjXRlg0LLeaioQWueH30p6IXtJEbKAgvyv+mJaMxSm1l6xwDXYjpEMiLMg==", "cpu": [ "arm" ], @@ -1117,9 +1118,9 @@ ] }, "node_modules/@rollup/rollup-android-arm64": { - "version": "4.57.1", - "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm64/-/rollup-android-arm64-4.57.1.tgz", - "integrity": "sha512-dQaAddCY9YgkFHZcFNS/606Exo8vcLHwArFZ7vxXq4rigo2bb494/xKMMwRRQW6ug7Js6yXmBZhSBRuBvCCQ3w==", + "version": "4.59.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm64/-/rollup-android-arm64-4.59.0.tgz", + "integrity": "sha512-hZ+Zxj3SySm4A/DylsDKZAeVg0mvi++0PYVceVyX7hemkw7OreKdCvW2oQ3T1FMZvCaQXqOTHb8qmBShoqk69Q==", "cpu": [ "arm64" ], @@ -1131,9 +1132,9 @@ ] }, "node_modules/@rollup/rollup-darwin-arm64": { - "version": "4.57.1", - "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.57.1.tgz", - "integrity": "sha512-crNPrwJOrRxagUYeMn/DZwqN88SDmwaJ8Cvi/TN1HnWBU7GwknckyosC2gd0IqYRsHDEnXf328o9/HC6OkPgOg==", + "version": "4.59.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.59.0.tgz", + "integrity": "sha512-W2Psnbh1J8ZJw0xKAd8zdNgF9HRLkdWwwdWqubSVk0pUuQkoHnv7rx4GiF9rT4t5DIZGAsConRE3AxCdJ4m8rg==", "cpu": [ "arm64" ], @@ -1145,9 +1146,9 @@ ] }, "node_modules/@rollup/rollup-darwin-x64": { - "version": "4.57.1", - "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-x64/-/rollup-darwin-x64-4.57.1.tgz", - "integrity": "sha512-Ji8g8ChVbKrhFtig5QBV7iMaJrGtpHelkB3lsaKzadFBe58gmjfGXAOfI5FV0lYMH8wiqsxKQ1C9B0YTRXVy4w==", + "version": "4.59.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-x64/-/rollup-darwin-x64-4.59.0.tgz", + "integrity": "sha512-ZW2KkwlS4lwTv7ZVsYDiARfFCnSGhzYPdiOU4IM2fDbL+QGlyAbjgSFuqNRbSthybLbIJ915UtZBtmuLrQAT/w==", "cpu": [ "x64" ], @@ -1159,9 +1160,9 @@ ] }, "node_modules/@rollup/rollup-freebsd-arm64": { - "version": "4.57.1", - "resolved": "https://registry.npmjs.org/@rollup/rollup-freebsd-arm64/-/rollup-freebsd-arm64-4.57.1.tgz", - "integrity": "sha512-R+/WwhsjmwodAcz65guCGFRkMb4gKWTcIeLy60JJQbXrJ97BOXHxnkPFrP+YwFlaS0m+uWJTstrUA9o+UchFug==", + "version": "4.59.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-freebsd-arm64/-/rollup-freebsd-arm64-4.59.0.tgz", + "integrity": "sha512-EsKaJ5ytAu9jI3lonzn3BgG8iRBjV4LxZexygcQbpiU0wU0ATxhNVEpXKfUa0pS05gTcSDMKpn3Sx+QB9RlTTA==", "cpu": [ "arm64" ], @@ -1173,9 +1174,9 @@ ] }, "node_modules/@rollup/rollup-freebsd-x64": { - "version": "4.57.1", - "resolved": "https://registry.npmjs.org/@rollup/rollup-freebsd-x64/-/rollup-freebsd-x64-4.57.1.tgz", - "integrity": "sha512-IEQTCHeiTOnAUC3IDQdzRAGj3jOAYNr9kBguI7MQAAZK3caezRrg0GxAb6Hchg4lxdZEI5Oq3iov/w/hnFWY9Q==", + "version": "4.59.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-freebsd-x64/-/rollup-freebsd-x64-4.59.0.tgz", + "integrity": "sha512-d3DuZi2KzTMjImrxoHIAODUZYoUUMsuUiY4SRRcJy6NJoZ6iIqWnJu9IScV9jXysyGMVuW+KNzZvBLOcpdl3Vg==", "cpu": [ "x64" ], @@ -1187,9 +1188,9 @@ ] }, "node_modules/@rollup/rollup-linux-arm-gnueabihf": { - "version": "4.57.1", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-gnueabihf/-/rollup-linux-arm-gnueabihf-4.57.1.tgz", - "integrity": "sha512-F8sWbhZ7tyuEfsmOxwc2giKDQzN3+kuBLPwwZGyVkLlKGdV1nvnNwYD0fKQ8+XS6hp9nY7B+ZeK01EBUE7aHaw==", + "version": "4.59.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-gnueabihf/-/rollup-linux-arm-gnueabihf-4.59.0.tgz", + "integrity": "sha512-t4ONHboXi/3E0rT6OZl1pKbl2Vgxf9vJfWgmUoCEVQVxhW6Cw/c8I6hbbu7DAvgp82RKiH7TpLwxnJeKv2pbsw==", "cpu": [ "arm" ], @@ -1201,9 +1202,9 @@ ] }, "node_modules/@rollup/rollup-linux-arm-musleabihf": { - "version": "4.57.1", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-musleabihf/-/rollup-linux-arm-musleabihf-4.57.1.tgz", - "integrity": "sha512-rGfNUfn0GIeXtBP1wL5MnzSj98+PZe/AXaGBCRmT0ts80lU5CATYGxXukeTX39XBKsxzFpEeK+Mrp9faXOlmrw==", + "version": "4.59.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-musleabihf/-/rollup-linux-arm-musleabihf-4.59.0.tgz", + "integrity": "sha512-CikFT7aYPA2ufMD086cVORBYGHffBo4K8MQ4uPS/ZnY54GKj36i196u8U+aDVT2LX4eSMbyHtyOh7D7Zvk2VvA==", "cpu": [ "arm" ], @@ -1215,9 +1216,9 @@ ] }, "node_modules/@rollup/rollup-linux-arm64-gnu": { - "version": "4.57.1", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-gnu/-/rollup-linux-arm64-gnu-4.57.1.tgz", - "integrity": "sha512-MMtej3YHWeg/0klK2Qodf3yrNzz6CGjo2UntLvk2RSPlhzgLvYEB3frRvbEF2wRKh1Z2fDIg9KRPe1fawv7C+g==", + "version": "4.59.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-gnu/-/rollup-linux-arm64-gnu-4.59.0.tgz", + "integrity": "sha512-jYgUGk5aLd1nUb1CtQ8E+t5JhLc9x5WdBKew9ZgAXg7DBk0ZHErLHdXM24rfX+bKrFe+Xp5YuJo54I5HFjGDAA==", "cpu": [ "arm64" ], @@ -1229,9 +1230,9 @@ ] }, "node_modules/@rollup/rollup-linux-arm64-musl": { - "version": "4.57.1", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-musl/-/rollup-linux-arm64-musl-4.57.1.tgz", - "integrity": "sha512-1a/qhaaOXhqXGpMFMET9VqwZakkljWHLmZOX48R0I/YLbhdxr1m4gtG1Hq7++VhVUmf+L3sTAf9op4JlhQ5u1Q==", + "version": "4.59.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-musl/-/rollup-linux-arm64-musl-4.59.0.tgz", + "integrity": "sha512-peZRVEdnFWZ5Bh2KeumKG9ty7aCXzzEsHShOZEFiCQlDEepP1dpUl/SrUNXNg13UmZl+gzVDPsiCwnV1uI0RUA==", "cpu": [ "arm64" ], @@ -1243,9 +1244,9 @@ ] }, "node_modules/@rollup/rollup-linux-loong64-gnu": { - "version": "4.57.1", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-loong64-gnu/-/rollup-linux-loong64-gnu-4.57.1.tgz", - "integrity": "sha512-QWO6RQTZ/cqYtJMtxhkRkidoNGXc7ERPbZN7dVW5SdURuLeVU7lwKMpo18XdcmpWYd0qsP1bwKPf7DNSUinhvA==", + "version": "4.59.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-loong64-gnu/-/rollup-linux-loong64-gnu-4.59.0.tgz", + "integrity": "sha512-gbUSW/97f7+r4gHy3Jlup8zDG190AuodsWnNiXErp9mT90iCy9NKKU0Xwx5k8VlRAIV2uU9CsMnEFg/xXaOfXg==", "cpu": [ "loong64" ], @@ -1257,9 +1258,9 @@ ] }, "node_modules/@rollup/rollup-linux-loong64-musl": { - "version": "4.57.1", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-loong64-musl/-/rollup-linux-loong64-musl-4.57.1.tgz", - "integrity": "sha512-xpObYIf+8gprgWaPP32xiN5RVTi/s5FCR+XMXSKmhfoJjrpRAjCuuqQXyxUa/eJTdAE6eJ+KDKaoEqjZQxh3Gw==", + "version": "4.59.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-loong64-musl/-/rollup-linux-loong64-musl-4.59.0.tgz", + "integrity": "sha512-yTRONe79E+o0FWFijasoTjtzG9EBedFXJMl888NBEDCDV9I2wGbFFfJQQe63OijbFCUZqxpHz1GzpbtSFikJ4Q==", "cpu": [ "loong64" ], @@ -1271,9 +1272,9 @@ ] }, "node_modules/@rollup/rollup-linux-ppc64-gnu": { - "version": "4.57.1", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-ppc64-gnu/-/rollup-linux-ppc64-gnu-4.57.1.tgz", - "integrity": "sha512-4BrCgrpZo4hvzMDKRqEaW1zeecScDCR+2nZ86ATLhAoJ5FQ+lbHVD3ttKe74/c7tNT9c6F2viwB3ufwp01Oh2w==", + "version": "4.59.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-ppc64-gnu/-/rollup-linux-ppc64-gnu-4.59.0.tgz", + "integrity": "sha512-sw1o3tfyk12k3OEpRddF68a1unZ5VCN7zoTNtSn2KndUE+ea3m3ROOKRCZxEpmT9nsGnogpFP9x6mnLTCaoLkA==", "cpu": [ "ppc64" ], @@ -1285,9 +1286,9 @@ ] }, "node_modules/@rollup/rollup-linux-ppc64-musl": { - "version": "4.57.1", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-ppc64-musl/-/rollup-linux-ppc64-musl-4.57.1.tgz", - "integrity": "sha512-NOlUuzesGauESAyEYFSe3QTUguL+lvrN1HtwEEsU2rOwdUDeTMJdO5dUYl/2hKf9jWydJrO9OL/XSSf65R5+Xw==", + "version": "4.59.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-ppc64-musl/-/rollup-linux-ppc64-musl-4.59.0.tgz", + "integrity": "sha512-+2kLtQ4xT3AiIxkzFVFXfsmlZiG5FXYW7ZyIIvGA7Bdeuh9Z0aN4hVyXS/G1E9bTP/vqszNIN/pUKCk/BTHsKA==", "cpu": [ "ppc64" ], @@ -1299,9 +1300,9 @@ ] }, "node_modules/@rollup/rollup-linux-riscv64-gnu": { - "version": "4.57.1", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-gnu/-/rollup-linux-riscv64-gnu-4.57.1.tgz", - "integrity": "sha512-ptA88htVp0AwUUqhVghwDIKlvJMD/fmL/wrQj99PRHFRAG6Z5nbWoWG4o81Nt9FT+IuqUQi+L31ZKAFeJ5Is+A==", + "version": "4.59.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-gnu/-/rollup-linux-riscv64-gnu-4.59.0.tgz", + "integrity": "sha512-NDYMpsXYJJaj+I7UdwIuHHNxXZ/b/N2hR15NyH3m2qAtb/hHPA4g4SuuvrdxetTdndfj9b1WOmy73kcPRoERUg==", "cpu": [ "riscv64" ], @@ -1313,9 +1314,9 @@ ] }, "node_modules/@rollup/rollup-linux-riscv64-musl": { - "version": "4.57.1", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-musl/-/rollup-linux-riscv64-musl-4.57.1.tgz", - "integrity": "sha512-S51t7aMMTNdmAMPpBg7OOsTdn4tySRQvklmL3RpDRyknk87+Sp3xaumlatU+ppQ+5raY7sSTcC2beGgvhENfuw==", + "version": "4.59.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-musl/-/rollup-linux-riscv64-musl-4.59.0.tgz", + "integrity": "sha512-nLckB8WOqHIf1bhymk+oHxvM9D3tyPndZH8i8+35p/1YiVoVswPid2yLzgX7ZJP0KQvnkhM4H6QZ5m0LzbyIAg==", "cpu": [ "riscv64" ], @@ -1327,9 +1328,9 @@ ] }, "node_modules/@rollup/rollup-linux-s390x-gnu": { - "version": "4.57.1", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-s390x-gnu/-/rollup-linux-s390x-gnu-4.57.1.tgz", - "integrity": "sha512-Bl00OFnVFkL82FHbEqy3k5CUCKH6OEJL54KCyx2oqsmZnFTR8IoNqBF+mjQVcRCT5sB6yOvK8A37LNm/kPJiZg==", + "version": "4.59.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-s390x-gnu/-/rollup-linux-s390x-gnu-4.59.0.tgz", + "integrity": "sha512-oF87Ie3uAIvORFBpwnCvUzdeYUqi2wY6jRFWJAy1qus/udHFYIkplYRW+wo+GRUP4sKzYdmE1Y3+rY5Gc4ZO+w==", "cpu": [ "s390x" ], @@ -1341,9 +1342,9 @@ ] }, "node_modules/@rollup/rollup-linux-x64-gnu": { - "version": "4.57.1", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.57.1.tgz", - "integrity": "sha512-ABca4ceT4N+Tv/GtotnWAeXZUZuM/9AQyCyKYyKnpk4yoA7QIAuBt6Hkgpw8kActYlew2mvckXkvx0FfoInnLg==", + "version": "4.59.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.59.0.tgz", + "integrity": "sha512-3AHmtQq/ppNuUspKAlvA8HtLybkDflkMuLK4DPo77DfthRb71V84/c4MlWJXixZz4uruIH4uaa07IqoAkG64fg==", "cpu": [ "x64" ], @@ -1355,9 +1356,9 @@ ] }, "node_modules/@rollup/rollup-linux-x64-musl": { - "version": "4.57.1", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-musl/-/rollup-linux-x64-musl-4.57.1.tgz", - "integrity": "sha512-HFps0JeGtuOR2convgRRkHCekD7j+gdAuXM+/i6kGzQtFhlCtQkpwtNzkNj6QhCDp7DRJ7+qC/1Vg2jt5iSOFw==", + "version": "4.59.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-musl/-/rollup-linux-x64-musl-4.59.0.tgz", + "integrity": "sha512-2UdiwS/9cTAx7qIUZB/fWtToJwvt0Vbo0zmnYt7ED35KPg13Q0ym1g442THLC7VyI6JfYTP4PiSOWyoMdV2/xg==", "cpu": [ "x64" ], @@ -1369,9 +1370,9 @@ ] }, "node_modules/@rollup/rollup-openbsd-x64": { - "version": "4.57.1", - "resolved": "https://registry.npmjs.org/@rollup/rollup-openbsd-x64/-/rollup-openbsd-x64-4.57.1.tgz", - "integrity": "sha512-H+hXEv9gdVQuDTgnqD+SQffoWoc0Of59AStSzTEj/feWTBAnSfSD3+Dql1ZruJQxmykT/JVY0dE8Ka7z0DH1hw==", + "version": "4.59.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-openbsd-x64/-/rollup-openbsd-x64-4.59.0.tgz", + "integrity": "sha512-M3bLRAVk6GOwFlPTIxVBSYKUaqfLrn8l0psKinkCFxl4lQvOSz8ZrKDz2gxcBwHFpci0B6rttydI4IpS4IS/jQ==", "cpu": [ "x64" ], @@ -1383,9 +1384,9 @@ ] }, "node_modules/@rollup/rollup-openharmony-arm64": { - "version": "4.57.1", - "resolved": "https://registry.npmjs.org/@rollup/rollup-openharmony-arm64/-/rollup-openharmony-arm64-4.57.1.tgz", - "integrity": "sha512-4wYoDpNg6o/oPximyc/NG+mYUejZrCU2q+2w6YZqrAs2UcNUChIZXjtafAiiZSUc7On8v5NyNj34Kzj/Ltk6dQ==", + "version": "4.59.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-openharmony-arm64/-/rollup-openharmony-arm64-4.59.0.tgz", + "integrity": "sha512-tt9KBJqaqp5i5HUZzoafHZX8b5Q2Fe7UjYERADll83O4fGqJ49O1FsL6LpdzVFQcpwvnyd0i+K/VSwu/o/nWlA==", "cpu": [ "arm64" ], @@ -1397,9 +1398,9 @@ ] }, "node_modules/@rollup/rollup-win32-arm64-msvc": { - "version": "4.57.1", - "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-arm64-msvc/-/rollup-win32-arm64-msvc-4.57.1.tgz", - "integrity": "sha512-O54mtsV/6LW3P8qdTcamQmuC990HDfR71lo44oZMZlXU4tzLrbvTii87Ni9opq60ds0YzuAlEr/GNwuNluZyMQ==", + "version": "4.59.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-arm64-msvc/-/rollup-win32-arm64-msvc-4.59.0.tgz", + "integrity": "sha512-V5B6mG7OrGTwnxaNUzZTDTjDS7F75PO1ae6MJYdiMu60sq0CqN5CVeVsbhPxalupvTX8gXVSU9gq+Rx1/hvu6A==", "cpu": [ "arm64" ], @@ -1411,9 +1412,9 @@ ] }, "node_modules/@rollup/rollup-win32-ia32-msvc": { - "version": "4.57.1", - "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-ia32-msvc/-/rollup-win32-ia32-msvc-4.57.1.tgz", - "integrity": "sha512-P3dLS+IerxCT/7D2q2FYcRdWRl22dNbrbBEtxdWhXrfIMPP9lQhb5h4Du04mdl5Woq05jVCDPCMF7Ub0NAjIew==", + "version": "4.59.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-ia32-msvc/-/rollup-win32-ia32-msvc-4.59.0.tgz", + "integrity": "sha512-UKFMHPuM9R0iBegwzKF4y0C4J9u8C6MEJgFuXTBerMk7EJ92GFVFYBfOZaSGLu6COf7FxpQNqhNS4c4icUPqxA==", "cpu": [ "ia32" ], @@ -1425,9 +1426,9 @@ ] }, "node_modules/@rollup/rollup-win32-x64-gnu": { - "version": "4.57.1", - "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-gnu/-/rollup-win32-x64-gnu-4.57.1.tgz", - "integrity": "sha512-VMBH2eOOaKGtIJYleXsi2B8CPVADrh+TyNxJ4mWPnKfLB/DBUmzW+5m1xUrcwWoMfSLagIRpjUFeW5CO5hyciQ==", + "version": "4.59.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-gnu/-/rollup-win32-x64-gnu-4.59.0.tgz", + "integrity": "sha512-laBkYlSS1n2L8fSo1thDNGrCTQMmxjYY5G0WFWjFFYZkKPjsMBsgJfGf4TLxXrF6RyhI60L8TMOjBMvXiTcxeA==", "cpu": [ "x64" ], @@ -1439,9 +1440,9 @@ ] }, "node_modules/@rollup/rollup-win32-x64-msvc": { - "version": "4.57.1", - "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.57.1.tgz", - "integrity": "sha512-mxRFDdHIWRxg3UfIIAwCm6NzvxG0jDX/wBN6KsQFTvKFqqg9vTrWUE68qEjHt19A5wwx5X5aUi2zuZT7YR0jrA==", + "version": "4.59.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.59.0.tgz", + "integrity": "sha512-2HRCml6OztYXyJXAvdDXPKcawukWY2GpR5/nxKp4iBgiO3wcoEGkAaqctIbZcNB6KlUQBIqt8VYkNSj2397EfA==", "cpu": [ "x64" ], @@ -1453,49 +1454,49 @@ ] }, "node_modules/@tailwindcss/node": { - "version": "4.1.18", - "resolved": "https://registry.npmjs.org/@tailwindcss/node/-/node-4.1.18.tgz", - "integrity": "sha512-DoR7U1P7iYhw16qJ49fgXUlry1t4CpXeErJHnQ44JgTSKMaZUdf17cfn5mHchfJ4KRBZRFA/Coo+MUF5+gOaCQ==", + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/@tailwindcss/node/-/node-4.2.1.tgz", + "integrity": "sha512-jlx6sLk4EOwO6hHe1oCGm1Q4AN/s0rSrTTPBGPM0/RQ6Uylwq17FuU8IeJJKEjtc6K6O07zsvP+gDO6MMWo7pg==", "dev": true, "license": "MIT", "dependencies": { - "@jridgewell/remapping": "^2.3.4", - "enhanced-resolve": "^5.18.3", + "@jridgewell/remapping": "^2.3.5", + "enhanced-resolve": "^5.19.0", "jiti": "^2.6.1", - "lightningcss": "1.30.2", + "lightningcss": "1.31.1", "magic-string": "^0.30.21", "source-map-js": "^1.2.1", - "tailwindcss": "4.1.18" + "tailwindcss": "4.2.1" } }, "node_modules/@tailwindcss/oxide": { - "version": "4.1.18", - "resolved": "https://registry.npmjs.org/@tailwindcss/oxide/-/oxide-4.1.18.tgz", - "integrity": "sha512-EgCR5tTS5bUSKQgzeMClT6iCY3ToqE1y+ZB0AKldj809QXk1Y+3jB0upOYZrn9aGIzPtUsP7sX4QQ4XtjBB95A==", + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/@tailwindcss/oxide/-/oxide-4.2.1.tgz", + "integrity": "sha512-yv9jeEFWnjKCI6/T3Oq50yQEOqmpmpfzG1hcZsAOaXFQPfzWprWrlHSdGPEF3WQTi8zu8ohC9Mh9J470nT5pUw==", "dev": true, "license": "MIT", "engines": { - "node": ">= 10" + "node": ">= 20" }, "optionalDependencies": { - "@tailwindcss/oxide-android-arm64": "4.1.18", - "@tailwindcss/oxide-darwin-arm64": "4.1.18", - "@tailwindcss/oxide-darwin-x64": "4.1.18", - "@tailwindcss/oxide-freebsd-x64": "4.1.18", - "@tailwindcss/oxide-linux-arm-gnueabihf": "4.1.18", - "@tailwindcss/oxide-linux-arm64-gnu": "4.1.18", - "@tailwindcss/oxide-linux-arm64-musl": "4.1.18", - "@tailwindcss/oxide-linux-x64-gnu": "4.1.18", - "@tailwindcss/oxide-linux-x64-musl": "4.1.18", - "@tailwindcss/oxide-wasm32-wasi": "4.1.18", - "@tailwindcss/oxide-win32-arm64-msvc": "4.1.18", - "@tailwindcss/oxide-win32-x64-msvc": "4.1.18" + "@tailwindcss/oxide-android-arm64": "4.2.1", + "@tailwindcss/oxide-darwin-arm64": "4.2.1", + "@tailwindcss/oxide-darwin-x64": "4.2.1", + "@tailwindcss/oxide-freebsd-x64": "4.2.1", + "@tailwindcss/oxide-linux-arm-gnueabihf": "4.2.1", + "@tailwindcss/oxide-linux-arm64-gnu": "4.2.1", + "@tailwindcss/oxide-linux-arm64-musl": "4.2.1", + "@tailwindcss/oxide-linux-x64-gnu": "4.2.1", + "@tailwindcss/oxide-linux-x64-musl": "4.2.1", + "@tailwindcss/oxide-wasm32-wasi": "4.2.1", + "@tailwindcss/oxide-win32-arm64-msvc": "4.2.1", + "@tailwindcss/oxide-win32-x64-msvc": "4.2.1" } }, "node_modules/@tailwindcss/oxide-android-arm64": { - "version": "4.1.18", - "resolved": "https://registry.npmjs.org/@tailwindcss/oxide-android-arm64/-/oxide-android-arm64-4.1.18.tgz", - "integrity": "sha512-dJHz7+Ugr9U/diKJA0W6N/6/cjI+ZTAoxPf9Iz9BFRF2GzEX8IvXxFIi/dZBloVJX/MZGvRuFA9rqwdiIEZQ0Q==", + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/@tailwindcss/oxide-android-arm64/-/oxide-android-arm64-4.2.1.tgz", + "integrity": "sha512-eZ7G1Zm5EC8OOKaesIKuw77jw++QJ2lL9N+dDpdQiAB/c/B2wDh0QPFHbkBVrXnwNugvrbJFk1gK2SsVjwWReg==", "cpu": [ "arm64" ], @@ -1506,13 +1507,13 @@ "android" ], "engines": { - "node": ">= 10" + "node": ">= 20" } }, "node_modules/@tailwindcss/oxide-darwin-arm64": { - "version": "4.1.18", - "resolved": "https://registry.npmjs.org/@tailwindcss/oxide-darwin-arm64/-/oxide-darwin-arm64-4.1.18.tgz", - "integrity": "sha512-Gc2q4Qhs660bhjyBSKgq6BYvwDz4G+BuyJ5H1xfhmDR3D8HnHCmT/BSkvSL0vQLy/nkMLY20PQ2OoYMO15Jd0A==", + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/@tailwindcss/oxide-darwin-arm64/-/oxide-darwin-arm64-4.2.1.tgz", + "integrity": "sha512-q/LHkOstoJ7pI1J0q6djesLzRvQSIfEto148ppAd+BVQK0JYjQIFSK3JgYZJa+Yzi0DDa52ZsQx2rqytBnf8Hw==", "cpu": [ "arm64" ], @@ -1523,13 +1524,13 @@ "darwin" ], "engines": { - "node": ">= 10" + "node": ">= 20" } }, "node_modules/@tailwindcss/oxide-darwin-x64": { - "version": "4.1.18", - "resolved": "https://registry.npmjs.org/@tailwindcss/oxide-darwin-x64/-/oxide-darwin-x64-4.1.18.tgz", - "integrity": "sha512-FL5oxr2xQsFrc3X9o1fjHKBYBMD1QZNyc1Xzw/h5Qu4XnEBi3dZn96HcHm41c/euGV+GRiXFfh2hUCyKi/e+yw==", + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/@tailwindcss/oxide-darwin-x64/-/oxide-darwin-x64-4.2.1.tgz", + "integrity": "sha512-/f/ozlaXGY6QLbpvd/kFTro2l18f7dHKpB+ieXz+Cijl4Mt9AI2rTrpq7V+t04nK+j9XBQHnSMdeQRhbGyt6fw==", "cpu": [ "x64" ], @@ -1540,13 +1541,13 @@ "darwin" ], "engines": { - "node": ">= 10" + "node": ">= 20" } }, "node_modules/@tailwindcss/oxide-freebsd-x64": { - "version": "4.1.18", - "resolved": "https://registry.npmjs.org/@tailwindcss/oxide-freebsd-x64/-/oxide-freebsd-x64-4.1.18.tgz", - "integrity": "sha512-Fj+RHgu5bDodmV1dM9yAxlfJwkkWvLiRjbhuO2LEtwtlYlBgiAT4x/j5wQr1tC3SANAgD+0YcmWVrj8R9trVMA==", + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/@tailwindcss/oxide-freebsd-x64/-/oxide-freebsd-x64-4.2.1.tgz", + "integrity": "sha512-5e/AkgYJT/cpbkys/OU2Ei2jdETCLlifwm7ogMC7/hksI2fC3iiq6OcXwjibcIjPung0kRtR3TxEITkqgn0TcA==", "cpu": [ "x64" ], @@ -1557,13 +1558,13 @@ "freebsd" ], "engines": { - "node": ">= 10" + "node": ">= 20" } }, "node_modules/@tailwindcss/oxide-linux-arm-gnueabihf": { - "version": "4.1.18", - "resolved": "https://registry.npmjs.org/@tailwindcss/oxide-linux-arm-gnueabihf/-/oxide-linux-arm-gnueabihf-4.1.18.tgz", - "integrity": "sha512-Fp+Wzk/Ws4dZn+LV2Nqx3IilnhH51YZoRaYHQsVq3RQvEl+71VGKFpkfHrLM/Li+kt5c0DJe/bHXK1eHgDmdiA==", + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/@tailwindcss/oxide-linux-arm-gnueabihf/-/oxide-linux-arm-gnueabihf-4.2.1.tgz", + "integrity": "sha512-Uny1EcVTTmerCKt/1ZuKTkb0x8ZaiuYucg2/kImO5A5Y/kBz41/+j0gxUZl+hTF3xkWpDmHX+TaWhOtba2Fyuw==", "cpu": [ "arm" ], @@ -1574,13 +1575,13 @@ "linux" ], "engines": { - "node": ">= 10" + "node": ">= 20" } }, "node_modules/@tailwindcss/oxide-linux-arm64-gnu": { - "version": "4.1.18", - "resolved": "https://registry.npmjs.org/@tailwindcss/oxide-linux-arm64-gnu/-/oxide-linux-arm64-gnu-4.1.18.tgz", - "integrity": "sha512-S0n3jboLysNbh55Vrt7pk9wgpyTTPD0fdQeh7wQfMqLPM/Hrxi+dVsLsPrycQjGKEQk85Kgbx+6+QnYNiHalnw==", + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/@tailwindcss/oxide-linux-arm64-gnu/-/oxide-linux-arm64-gnu-4.2.1.tgz", + "integrity": "sha512-CTrwomI+c7n6aSSQlsPL0roRiNMDQ/YzMD9EjcR+H4f0I1SQ8QqIuPnsVp7QgMkC1Qi8rtkekLkOFjo7OlEFRQ==", "cpu": [ "arm64" ], @@ -1591,13 +1592,13 @@ "linux" ], "engines": { - "node": ">= 10" + "node": ">= 20" } }, "node_modules/@tailwindcss/oxide-linux-arm64-musl": { - "version": "4.1.18", - "resolved": "https://registry.npmjs.org/@tailwindcss/oxide-linux-arm64-musl/-/oxide-linux-arm64-musl-4.1.18.tgz", - "integrity": "sha512-1px92582HkPQlaaCkdRcio71p8bc8i/ap5807tPRDK/uw953cauQBT8c5tVGkOwrHMfc2Yh6UuxaH4vtTjGvHg==", + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/@tailwindcss/oxide-linux-arm64-musl/-/oxide-linux-arm64-musl-4.2.1.tgz", + "integrity": "sha512-WZA0CHRL/SP1TRbA5mp9htsppSEkWuQ4KsSUumYQnyl8ZdT39ntwqmz4IUHGN6p4XdSlYfJwM4rRzZLShHsGAQ==", "cpu": [ "arm64" ], @@ -1608,13 +1609,13 @@ "linux" ], "engines": { - "node": ">= 10" + "node": ">= 20" } }, "node_modules/@tailwindcss/oxide-linux-x64-gnu": { - "version": "4.1.18", - "resolved": "https://registry.npmjs.org/@tailwindcss/oxide-linux-x64-gnu/-/oxide-linux-x64-gnu-4.1.18.tgz", - "integrity": "sha512-v3gyT0ivkfBLoZGF9LyHmts0Isc8jHZyVcbzio6Wpzifg/+5ZJpDiRiUhDLkcr7f/r38SWNe7ucxmGW3j3Kb/g==", + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/@tailwindcss/oxide-linux-x64-gnu/-/oxide-linux-x64-gnu-4.2.1.tgz", + "integrity": "sha512-qMFzxI2YlBOLW5PhblzuSWlWfwLHaneBE0xHzLrBgNtqN6mWfs+qYbhryGSXQjFYB1Dzf5w+LN5qbUTPhW7Y5g==", "cpu": [ "x64" ], @@ -1625,13 +1626,13 @@ "linux" ], "engines": { - "node": ">= 10" + "node": ">= 20" } }, "node_modules/@tailwindcss/oxide-linux-x64-musl": { - "version": "4.1.18", - "resolved": "https://registry.npmjs.org/@tailwindcss/oxide-linux-x64-musl/-/oxide-linux-x64-musl-4.1.18.tgz", - "integrity": "sha512-bhJ2y2OQNlcRwwgOAGMY0xTFStt4/wyU6pvI6LSuZpRgKQwxTec0/3Scu91O8ir7qCR3AuepQKLU/kX99FouqQ==", + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/@tailwindcss/oxide-linux-x64-musl/-/oxide-linux-x64-musl-4.2.1.tgz", + "integrity": "sha512-5r1X2FKnCMUPlXTWRYpHdPYUY6a1Ar/t7P24OuiEdEOmms5lyqjDRvVY1yy9Rmioh+AunQ0rWiOTPE8F9A3v5g==", "cpu": [ "x64" ], @@ -1642,13 +1643,13 @@ "linux" ], "engines": { - "node": ">= 10" + "node": ">= 20" } }, "node_modules/@tailwindcss/oxide-wasm32-wasi": { - "version": "4.1.18", - "resolved": "https://registry.npmjs.org/@tailwindcss/oxide-wasm32-wasi/-/oxide-wasm32-wasi-4.1.18.tgz", - "integrity": "sha512-LffYTvPjODiP6PT16oNeUQJzNVyJl1cjIebq/rWWBF+3eDst5JGEFSc5cWxyRCJ0Mxl+KyIkqRxk1XPEs9x8TA==", + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/@tailwindcss/oxide-wasm32-wasi/-/oxide-wasm32-wasi-4.2.1.tgz", + "integrity": "sha512-MGFB5cVPvshR85MTJkEvqDUnuNoysrsRxd6vnk1Lf2tbiqNlXpHYZqkqOQalydienEWOHHFyyuTSYRsLfxFJ2Q==", "bundleDependencies": [ "@napi-rs/wasm-runtime", "@emnapi/core", @@ -1664,21 +1665,21 @@ "license": "MIT", "optional": true, "dependencies": { - "@emnapi/core": "^1.7.1", - "@emnapi/runtime": "^1.7.1", + "@emnapi/core": "^1.8.1", + "@emnapi/runtime": "^1.8.1", "@emnapi/wasi-threads": "^1.1.0", - "@napi-rs/wasm-runtime": "^1.1.0", + "@napi-rs/wasm-runtime": "^1.1.1", "@tybys/wasm-util": "^0.10.1", - "tslib": "^2.4.0" + "tslib": "^2.8.1" }, "engines": { "node": ">=14.0.0" } }, "node_modules/@tailwindcss/oxide-win32-arm64-msvc": { - "version": "4.1.18", - "resolved": "https://registry.npmjs.org/@tailwindcss/oxide-win32-arm64-msvc/-/oxide-win32-arm64-msvc-4.1.18.tgz", - "integrity": "sha512-HjSA7mr9HmC8fu6bdsZvZ+dhjyGCLdotjVOgLA2vEqxEBZaQo9YTX4kwgEvPCpRh8o4uWc4J/wEoFzhEmjvPbA==", + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/@tailwindcss/oxide-win32-arm64-msvc/-/oxide-win32-arm64-msvc-4.2.1.tgz", + "integrity": "sha512-YlUEHRHBGnCMh4Nj4GnqQyBtsshUPdiNroZj8VPkvTZSoHsilRCwXcVKnG9kyi0ZFAS/3u+qKHBdDc81SADTRA==", "cpu": [ "arm64" ], @@ -1689,13 +1690,13 @@ "win32" ], "engines": { - "node": ">= 10" + "node": ">= 20" } }, "node_modules/@tailwindcss/oxide-win32-x64-msvc": { - "version": "4.1.18", - "resolved": "https://registry.npmjs.org/@tailwindcss/oxide-win32-x64-msvc/-/oxide-win32-x64-msvc-4.1.18.tgz", - "integrity": "sha512-bJWbyYpUlqamC8dpR7pfjA0I7vdF6t5VpUGMWRkXVE3AXgIZjYUYAK7II1GNaxR8J1SSrSrppRar8G++JekE3Q==", + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/@tailwindcss/oxide-win32-x64-msvc/-/oxide-win32-x64-msvc-4.2.1.tgz", + "integrity": "sha512-rbO34G5sMWWyrN/idLeVxAZgAKWrn5LiR3/I90Q9MkA67s6T1oB0xtTe+0heoBvHSpbU9Mk7i6uwJnpo4u21XQ==", "cpu": [ "x64" ], @@ -1706,19 +1707,19 @@ "win32" ], "engines": { - "node": ">= 10" + "node": ">= 20" } }, "node_modules/@tailwindcss/vite": { - "version": "4.1.18", - "resolved": "https://registry.npmjs.org/@tailwindcss/vite/-/vite-4.1.18.tgz", - "integrity": "sha512-jVA+/UpKL1vRLg6Hkao5jldawNmRo7mQYrZtNHMIVpLfLhDml5nMRUo/8MwoX2vNXvnaXNNMedrMfMugAVX1nA==", + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/@tailwindcss/vite/-/vite-4.2.1.tgz", + "integrity": "sha512-TBf2sJjYeb28jD2U/OhwdW0bbOsxkWPwQ7SrqGf9sVcoYwZj7rkXljroBO9wKBut9XnmQLXanuDUeqQK0lGg/w==", "dev": true, "license": "MIT", "dependencies": { - "@tailwindcss/node": "4.1.18", - "@tailwindcss/oxide": "4.1.18", - "tailwindcss": "4.1.18" + "@tailwindcss/node": "4.2.1", + "@tailwindcss/oxide": "4.2.1", + "tailwindcss": "4.2.1" }, "peerDependencies": { "vite": "^5.2.0 || ^6 || ^7" @@ -2077,9 +2078,9 @@ "license": "MIT" }, "node_modules/@types/react": { - "version": "19.2.13", - "resolved": "https://registry.npmjs.org/@types/react/-/react-19.2.13.tgz", - "integrity": "sha512-KkiJeU6VbYbUOp5ITMIc7kBfqlYkKA5KhEHVrGMmUUMt7NeaZg65ojdPk+FtNrBAOXNVM5QM72jnADjM+XVRAQ==", + "version": "19.2.14", + "resolved": "https://registry.npmjs.org/@types/react/-/react-19.2.14.tgz", + "integrity": "sha512-ilcTH/UniCkMdtexkoCN0bI7pMcJDvmQFPvuPvmEaYA/NSfFTAgdUSLAoVjaRJm7+6PvcM+q1zYOwS4wTYMF9w==", "license": "MIT", "dependencies": { "csstype": "^3.2.2" @@ -2147,13 +2148,16 @@ } }, "node_modules/baseline-browser-mapping": { - "version": "2.9.19", - "resolved": "https://registry.npmjs.org/baseline-browser-mapping/-/baseline-browser-mapping-2.9.19.tgz", - "integrity": "sha512-ipDqC8FrAl/76p2SSWKSI+H9tFwm7vYqXQrItCuiVPt26Km0jS+NzSsBWAaBusvSbQcfJG+JitdMm+wZAgTYqg==", + "version": "2.10.0", + "resolved": "https://registry.npmjs.org/baseline-browser-mapping/-/baseline-browser-mapping-2.10.0.tgz", + "integrity": "sha512-lIyg0szRfYbiy67j9KN8IyeD7q7hcmqnJ1ddWmNt19ItGpNN64mnllmxUNFIOdOm6by97jlL6wfpTTJrmnjWAA==", "dev": true, "license": "Apache-2.0", "bin": { - "baseline-browser-mapping": "dist/cli.js" + "baseline-browser-mapping": "dist/cli.cjs" + }, + "engines": { + "node": ">=6.0.0" } }, "node_modules/browserslist": { @@ -2191,9 +2195,9 @@ } }, "node_modules/caniuse-lite": { - "version": "1.0.30001769", - "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001769.tgz", - "integrity": "sha512-BCfFL1sHijQlBGWBMuJyhZUhzo7wer5sVj9hqekB/7xn0Ypy+pER/edCYQm4exbXj4WiySGp40P8UuTh6w1srg==", + "version": "1.0.30001775", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001775.tgz", + "integrity": "sha512-s3Qv7Lht9zbVKE9XoTyRG6wVDCKdtOFIjBGg3+Yhn6JaytuNKPIjBMTMIY1AnOH3seL5mvF+x33oGAyK3hVt3A==", "dev": true, "funding": [ { @@ -2468,9 +2472,9 @@ } }, "node_modules/electron-to-chromium": { - "version": "1.5.286", - "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.286.tgz", - "integrity": "sha512-9tfDXhJ4RKFNerfjdCcZfufu49vg620741MNs26a9+bhLThdB+plgMeou98CAaHu/WATj2iHOOHTp1hWtABj2A==", + "version": "1.5.302", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.302.tgz", + "integrity": "sha512-sM6HAN2LyK82IyPBpznDRqlTQAtuSaO+ShzFiWTvoMJLHyZ+Y39r8VMfHzwbU8MVBzQ4Wdn85+wlZl2TLGIlwg==", "dev": true, "license": "ISC" }, @@ -2481,9 +2485,9 @@ "license": "EPL-2.0" }, "node_modules/enhanced-resolve": { - "version": "5.19.0", - "resolved": "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-5.19.0.tgz", - "integrity": "sha512-phv3E1Xl4tQOShqSte26C7Fl84EwUdZsyOuSSk9qtAGyyQs2s3jJzComh+Abf4g187lUUAvH+H26omrqia2aGg==", + "version": "5.20.0", + "resolved": "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-5.20.0.tgz", + "integrity": "sha512-/ce7+jQ1PQ6rVXwe+jKEg5hW5ciicHwIQUagZkp6IufBoY3YDgdTTY1azVs0qoRgVmvsNB+rbjLJxDAeHHtwsQ==", "dev": true, "license": "MIT", "dependencies": { @@ -2818,9 +2822,9 @@ } }, "node_modules/lightningcss": { - "version": "1.30.2", - "resolved": "https://registry.npmjs.org/lightningcss/-/lightningcss-1.30.2.tgz", - "integrity": "sha512-utfs7Pr5uJyyvDETitgsaqSyjCb2qNRAtuqUeWIAKztsOYdcACf2KtARYXg2pSvhkt+9NfoaNY7fxjl6nuMjIQ==", + "version": "1.31.1", + "resolved": "https://registry.npmjs.org/lightningcss/-/lightningcss-1.31.1.tgz", + "integrity": "sha512-l51N2r93WmGUye3WuFoN5k10zyvrVs0qfKBhyC5ogUQ6Ew6JUSswh78mbSO+IU3nTWsyOArqPCcShdQSadghBQ==", "dev": true, "license": "MPL-2.0", "dependencies": { @@ -2834,23 +2838,23 @@ "url": "https://opencollective.com/parcel" }, "optionalDependencies": { - "lightningcss-android-arm64": "1.30.2", - "lightningcss-darwin-arm64": "1.30.2", - "lightningcss-darwin-x64": "1.30.2", - "lightningcss-freebsd-x64": "1.30.2", - "lightningcss-linux-arm-gnueabihf": "1.30.2", - "lightningcss-linux-arm64-gnu": "1.30.2", - "lightningcss-linux-arm64-musl": "1.30.2", - "lightningcss-linux-x64-gnu": "1.30.2", - "lightningcss-linux-x64-musl": "1.30.2", - "lightningcss-win32-arm64-msvc": "1.30.2", - "lightningcss-win32-x64-msvc": "1.30.2" + "lightningcss-android-arm64": "1.31.1", + "lightningcss-darwin-arm64": "1.31.1", + "lightningcss-darwin-x64": "1.31.1", + "lightningcss-freebsd-x64": "1.31.1", + "lightningcss-linux-arm-gnueabihf": "1.31.1", + "lightningcss-linux-arm64-gnu": "1.31.1", + "lightningcss-linux-arm64-musl": "1.31.1", + "lightningcss-linux-x64-gnu": "1.31.1", + "lightningcss-linux-x64-musl": "1.31.1", + "lightningcss-win32-arm64-msvc": "1.31.1", + "lightningcss-win32-x64-msvc": "1.31.1" } }, "node_modules/lightningcss-android-arm64": { - "version": "1.30.2", - "resolved": "https://registry.npmjs.org/lightningcss-android-arm64/-/lightningcss-android-arm64-1.30.2.tgz", - "integrity": "sha512-BH9sEdOCahSgmkVhBLeU7Hc9DWeZ1Eb6wNS6Da8igvUwAe0sqROHddIlvU06q3WyXVEOYDZ6ykBZQnjTbmo4+A==", + "version": "1.31.1", + "resolved": "https://registry.npmjs.org/lightningcss-android-arm64/-/lightningcss-android-arm64-1.31.1.tgz", + "integrity": "sha512-HXJF3x8w9nQ4jbXRiNppBCqeZPIAfUo8zE/kOEGbW5NZvGc/K7nMxbhIr+YlFlHW5mpbg/YFPdbnCh1wAXCKFg==", "cpu": [ "arm64" ], @@ -2869,9 +2873,9 @@ } }, "node_modules/lightningcss-darwin-arm64": { - "version": "1.30.2", - "resolved": "https://registry.npmjs.org/lightningcss-darwin-arm64/-/lightningcss-darwin-arm64-1.30.2.tgz", - "integrity": "sha512-ylTcDJBN3Hp21TdhRT5zBOIi73P6/W0qwvlFEk22fkdXchtNTOU4Qc37SkzV+EKYxLouZ6M4LG9NfZ1qkhhBWA==", + "version": "1.31.1", + "resolved": "https://registry.npmjs.org/lightningcss-darwin-arm64/-/lightningcss-darwin-arm64-1.31.1.tgz", + "integrity": "sha512-02uTEqf3vIfNMq3h/z2cJfcOXnQ0GRwQrkmPafhueLb2h7mqEidiCzkE4gBMEH65abHRiQvhdcQ+aP0D0g67sg==", "cpu": [ "arm64" ], @@ -2890,9 +2894,9 @@ } }, "node_modules/lightningcss-darwin-x64": { - "version": "1.30.2", - "resolved": "https://registry.npmjs.org/lightningcss-darwin-x64/-/lightningcss-darwin-x64-1.30.2.tgz", - "integrity": "sha512-oBZgKchomuDYxr7ilwLcyms6BCyLn0z8J0+ZZmfpjwg9fRVZIR5/GMXd7r9RH94iDhld3UmSjBM6nXWM2TfZTQ==", + "version": "1.31.1", + "resolved": "https://registry.npmjs.org/lightningcss-darwin-x64/-/lightningcss-darwin-x64-1.31.1.tgz", + "integrity": "sha512-1ObhyoCY+tGxtsz1lSx5NXCj3nirk0Y0kB/g8B8DT+sSx4G9djitg9ejFnjb3gJNWo7qXH4DIy2SUHvpoFwfTA==", "cpu": [ "x64" ], @@ -2911,9 +2915,9 @@ } }, "node_modules/lightningcss-freebsd-x64": { - "version": "1.30.2", - "resolved": "https://registry.npmjs.org/lightningcss-freebsd-x64/-/lightningcss-freebsd-x64-1.30.2.tgz", - "integrity": "sha512-c2bH6xTrf4BDpK8MoGG4Bd6zAMZDAXS569UxCAGcA7IKbHNMlhGQ89eRmvpIUGfKWNVdbhSbkQaWhEoMGmGslA==", + "version": "1.31.1", + "resolved": "https://registry.npmjs.org/lightningcss-freebsd-x64/-/lightningcss-freebsd-x64-1.31.1.tgz", + "integrity": "sha512-1RINmQKAItO6ISxYgPwszQE1BrsVU5aB45ho6O42mu96UiZBxEXsuQ7cJW4zs4CEodPUioj/QrXW1r9pLUM74A==", "cpu": [ "x64" ], @@ -2932,9 +2936,9 @@ } }, "node_modules/lightningcss-linux-arm-gnueabihf": { - "version": "1.30.2", - "resolved": "https://registry.npmjs.org/lightningcss-linux-arm-gnueabihf/-/lightningcss-linux-arm-gnueabihf-1.30.2.tgz", - "integrity": "sha512-eVdpxh4wYcm0PofJIZVuYuLiqBIakQ9uFZmipf6LF/HRj5Bgm0eb3qL/mr1smyXIS1twwOxNWndd8z0E374hiA==", + "version": "1.31.1", + "resolved": "https://registry.npmjs.org/lightningcss-linux-arm-gnueabihf/-/lightningcss-linux-arm-gnueabihf-1.31.1.tgz", + "integrity": "sha512-OOCm2//MZJ87CdDK62rZIu+aw9gBv4azMJuA8/KB74wmfS3lnC4yoPHm0uXZ/dvNNHmnZnB8XLAZzObeG0nS1g==", "cpu": [ "arm" ], @@ -2953,9 +2957,9 @@ } }, "node_modules/lightningcss-linux-arm64-gnu": { - "version": "1.30.2", - "resolved": "https://registry.npmjs.org/lightningcss-linux-arm64-gnu/-/lightningcss-linux-arm64-gnu-1.30.2.tgz", - "integrity": "sha512-UK65WJAbwIJbiBFXpxrbTNArtfuznvxAJw4Q2ZGlU8kPeDIWEX1dg3rn2veBVUylA2Ezg89ktszWbaQnxD/e3A==", + "version": "1.31.1", + "resolved": "https://registry.npmjs.org/lightningcss-linux-arm64-gnu/-/lightningcss-linux-arm64-gnu-1.31.1.tgz", + "integrity": "sha512-WKyLWztD71rTnou4xAD5kQT+982wvca7E6QoLpoawZ1gP9JM0GJj4Tp5jMUh9B3AitHbRZ2/H3W5xQmdEOUlLg==", "cpu": [ "arm64" ], @@ -2974,9 +2978,9 @@ } }, "node_modules/lightningcss-linux-arm64-musl": { - "version": "1.30.2", - "resolved": "https://registry.npmjs.org/lightningcss-linux-arm64-musl/-/lightningcss-linux-arm64-musl-1.30.2.tgz", - "integrity": "sha512-5Vh9dGeblpTxWHpOx8iauV02popZDsCYMPIgiuw97OJ5uaDsL86cnqSFs5LZkG3ghHoX5isLgWzMs+eD1YzrnA==", + "version": "1.31.1", + "resolved": "https://registry.npmjs.org/lightningcss-linux-arm64-musl/-/lightningcss-linux-arm64-musl-1.31.1.tgz", + "integrity": "sha512-mVZ7Pg2zIbe3XlNbZJdjs86YViQFoJSpc41CbVmKBPiGmC4YrfeOyz65ms2qpAobVd7WQsbW4PdsSJEMymyIMg==", "cpu": [ "arm64" ], @@ -2995,9 +2999,9 @@ } }, "node_modules/lightningcss-linux-x64-gnu": { - "version": "1.30.2", - "resolved": "https://registry.npmjs.org/lightningcss-linux-x64-gnu/-/lightningcss-linux-x64-gnu-1.30.2.tgz", - "integrity": "sha512-Cfd46gdmj1vQ+lR6VRTTadNHu6ALuw2pKR9lYq4FnhvgBc4zWY1EtZcAc6EffShbb1MFrIPfLDXD6Xprbnni4w==", + "version": "1.31.1", + "resolved": "https://registry.npmjs.org/lightningcss-linux-x64-gnu/-/lightningcss-linux-x64-gnu-1.31.1.tgz", + "integrity": "sha512-xGlFWRMl+0KvUhgySdIaReQdB4FNudfUTARn7q0hh/V67PVGCs3ADFjw+6++kG1RNd0zdGRlEKa+T13/tQjPMA==", "cpu": [ "x64" ], @@ -3016,9 +3020,9 @@ } }, "node_modules/lightningcss-linux-x64-musl": { - "version": "1.30.2", - "resolved": "https://registry.npmjs.org/lightningcss-linux-x64-musl/-/lightningcss-linux-x64-musl-1.30.2.tgz", - "integrity": "sha512-XJaLUUFXb6/QG2lGIW6aIk6jKdtjtcffUT0NKvIqhSBY3hh9Ch+1LCeH80dR9q9LBjG3ewbDjnumefsLsP6aiA==", + "version": "1.31.1", + "resolved": "https://registry.npmjs.org/lightningcss-linux-x64-musl/-/lightningcss-linux-x64-musl-1.31.1.tgz", + "integrity": "sha512-eowF8PrKHw9LpoZii5tdZwnBcYDxRw2rRCyvAXLi34iyeYfqCQNA9rmUM0ce62NlPhCvof1+9ivRaTY6pSKDaA==", "cpu": [ "x64" ], @@ -3037,9 +3041,9 @@ } }, "node_modules/lightningcss-win32-arm64-msvc": { - "version": "1.30.2", - "resolved": "https://registry.npmjs.org/lightningcss-win32-arm64-msvc/-/lightningcss-win32-arm64-msvc-1.30.2.tgz", - "integrity": "sha512-FZn+vaj7zLv//D/192WFFVA0RgHawIcHqLX9xuWiQt7P0PtdFEVaxgF9rjM/IRYHQXNnk61/H/gb2Ei+kUQ4xQ==", + "version": "1.31.1", + "resolved": "https://registry.npmjs.org/lightningcss-win32-arm64-msvc/-/lightningcss-win32-arm64-msvc-1.31.1.tgz", + "integrity": "sha512-aJReEbSEQzx1uBlQizAOBSjcmr9dCdL3XuC/6HLXAxmtErsj2ICo5yYggg1qOODQMtnjNQv2UHb9NpOuFtYe4w==", "cpu": [ "arm64" ], @@ -3058,9 +3062,9 @@ } }, "node_modules/lightningcss-win32-x64-msvc": { - "version": "1.30.2", - "resolved": "https://registry.npmjs.org/lightningcss-win32-x64-msvc/-/lightningcss-win32-x64-msvc-1.30.2.tgz", - "integrity": "sha512-5g1yc73p+iAkid5phb4oVFMB45417DkRevRbt/El/gKXJk4jid+vPFF/AXbxn05Aky8PapwzZrdJShv5C0avjw==", + "version": "1.31.1", + "resolved": "https://registry.npmjs.org/lightningcss-win32-x64-msvc/-/lightningcss-win32-x64-msvc-1.31.1.tgz", + "integrity": "sha512-I9aiFrbd7oYHwlnQDqr1Roz+fTz61oDDJX7n9tYF9FJymH1cIN1DtKw3iYt6b8WZgEjoNwVSncwF4wx/ZedMhw==", "cpu": [ "x64" ], @@ -3163,9 +3167,9 @@ } }, "node_modules/mdast-util-from-markdown": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/mdast-util-from-markdown/-/mdast-util-from-markdown-2.0.2.tgz", - "integrity": "sha512-uZhTV/8NBuw0WHkPTrCqDOl0zVe1BIng5ZtHoDk49ME1qqcjYmmLmOf0gELgcRMxN4w2iuIeVso5/6QymSrgmA==", + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/mdast-util-from-markdown/-/mdast-util-from-markdown-2.0.3.tgz", + "integrity": "sha512-W4mAWTvSlKvf8L6J+VN9yLSqQ9AOAAvHuoDAmPkz4dHf553m5gVj2ejadHJhoJmcmxEnOv6Pa8XJhpxE93kb8Q==", "license": "MIT", "dependencies": { "@types/mdast": "^4.0.0", @@ -4266,9 +4270,9 @@ } }, "node_modules/rollup": { - "version": "4.57.1", - "resolved": "https://registry.npmjs.org/rollup/-/rollup-4.57.1.tgz", - "integrity": "sha512-oQL6lgK3e2QZeQ7gcgIkS2YZPg5slw37hYufJ3edKlfQSGGm8ICoxswK15ntSzF/a8+h7ekRy7k7oWc3BQ7y8A==", + "version": "4.59.0", + "resolved": "https://registry.npmjs.org/rollup/-/rollup-4.59.0.tgz", + "integrity": "sha512-2oMpl67a3zCH9H79LeMcbDhXW/UmWG/y2zuqnF2jQq5uq9TbM9TVyXvA4+t+ne2IIkBdrLpAaRQAvo7YI/Yyeg==", "dev": true, "license": "MIT", "dependencies": { @@ -4282,31 +4286,31 @@ "npm": ">=8.0.0" }, "optionalDependencies": { - "@rollup/rollup-android-arm-eabi": "4.57.1", - "@rollup/rollup-android-arm64": "4.57.1", - "@rollup/rollup-darwin-arm64": "4.57.1", - "@rollup/rollup-darwin-x64": "4.57.1", - "@rollup/rollup-freebsd-arm64": "4.57.1", - "@rollup/rollup-freebsd-x64": "4.57.1", - "@rollup/rollup-linux-arm-gnueabihf": "4.57.1", - "@rollup/rollup-linux-arm-musleabihf": "4.57.1", - "@rollup/rollup-linux-arm64-gnu": "4.57.1", - "@rollup/rollup-linux-arm64-musl": "4.57.1", - "@rollup/rollup-linux-loong64-gnu": "4.57.1", - "@rollup/rollup-linux-loong64-musl": "4.57.1", - "@rollup/rollup-linux-ppc64-gnu": "4.57.1", - "@rollup/rollup-linux-ppc64-musl": "4.57.1", - "@rollup/rollup-linux-riscv64-gnu": "4.57.1", - "@rollup/rollup-linux-riscv64-musl": "4.57.1", - "@rollup/rollup-linux-s390x-gnu": "4.57.1", - "@rollup/rollup-linux-x64-gnu": "4.57.1", - "@rollup/rollup-linux-x64-musl": "4.57.1", - "@rollup/rollup-openbsd-x64": "4.57.1", - "@rollup/rollup-openharmony-arm64": "4.57.1", - "@rollup/rollup-win32-arm64-msvc": "4.57.1", - "@rollup/rollup-win32-ia32-msvc": "4.57.1", - "@rollup/rollup-win32-x64-gnu": "4.57.1", - "@rollup/rollup-win32-x64-msvc": "4.57.1", + "@rollup/rollup-android-arm-eabi": "4.59.0", + "@rollup/rollup-android-arm64": "4.59.0", + "@rollup/rollup-darwin-arm64": "4.59.0", + "@rollup/rollup-darwin-x64": "4.59.0", + "@rollup/rollup-freebsd-arm64": "4.59.0", + "@rollup/rollup-freebsd-x64": "4.59.0", + "@rollup/rollup-linux-arm-gnueabihf": "4.59.0", + "@rollup/rollup-linux-arm-musleabihf": "4.59.0", + "@rollup/rollup-linux-arm64-gnu": "4.59.0", + "@rollup/rollup-linux-arm64-musl": "4.59.0", + "@rollup/rollup-linux-loong64-gnu": "4.59.0", + "@rollup/rollup-linux-loong64-musl": "4.59.0", + "@rollup/rollup-linux-ppc64-gnu": "4.59.0", + "@rollup/rollup-linux-ppc64-musl": "4.59.0", + "@rollup/rollup-linux-riscv64-gnu": "4.59.0", + "@rollup/rollup-linux-riscv64-musl": "4.59.0", + "@rollup/rollup-linux-s390x-gnu": "4.59.0", + "@rollup/rollup-linux-x64-gnu": "4.59.0", + "@rollup/rollup-linux-x64-musl": "4.59.0", + "@rollup/rollup-openbsd-x64": "4.59.0", + "@rollup/rollup-openharmony-arm64": "4.59.0", + "@rollup/rollup-win32-arm64-msvc": "4.59.0", + "@rollup/rollup-win32-ia32-msvc": "4.59.0", + "@rollup/rollup-win32-x64-gnu": "4.59.0", + "@rollup/rollup-win32-x64-msvc": "4.59.0", "fsevents": "~2.3.2" } }, @@ -4385,9 +4389,9 @@ } }, "node_modules/tailwindcss": { - "version": "4.1.18", - "resolved": "https://registry.npmjs.org/tailwindcss/-/tailwindcss-4.1.18.tgz", - "integrity": "sha512-4+Z+0yiYyEtUVCScyfHCxOYP06L5Ne+JiHhY2IjR2KWMIWhJOYZKLSGZaP5HkZ8+bY0cxfzwDE5uOmzFXyIwxw==", + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/tailwindcss/-/tailwindcss-4.2.1.tgz", + "integrity": "sha512-/tBrSQ36vCleJkAOsy9kbNTgaxvGbyOamC30PRePTQe/o1MFwEKHQk4Cn7BNGaPtjp+PuUrByJehM1hgxfq4sw==", "dev": true, "license": "MIT" }, diff --git a/src/uipath/dev/server/frontend/package.json b/src/uipath/dev/server/frontend/package.json index a4cea6a..d881bd3 100644 --- a/src/uipath/dev/server/frontend/package.json +++ b/src/uipath/dev/server/frontend/package.json @@ -9,6 +9,7 @@ "preview": "vite preview" }, "dependencies": { + "@monaco-editor/react": "^4.7.0", "elkjs": "^0.11.0", "react": "^19.0.0", "react-dom": "^19.0.0", @@ -16,7 +17,6 @@ "reactflow": "^11.11.4", "rehype-highlight": "^7.0.2", "remark-gfm": "^4.0.1", - "@monaco-editor/react": "^4.7.0", "zustand": "^5.0.0" }, "devDependencies": { @@ -24,6 +24,7 @@ "@types/react": "^19.0.0", "@types/react-dom": "^19.0.0", "@vitejs/plugin-react": "^4.3.0", + "rollup": "^4.59.0", "tailwindcss": "^4.0.0", "typescript": "~5.7.0", "vite": "^6.0.0" diff --git a/src/uipath/dev/server/static/assets/ChatPanel-DR8dCKHB.js b/src/uipath/dev/server/static/assets/ChatPanel-DiTmerW3.js similarity index 99% rename from src/uipath/dev/server/static/assets/ChatPanel-DR8dCKHB.js rename to src/uipath/dev/server/static/assets/ChatPanel-DiTmerW3.js index 5982d19..e3d3885 100644 --- a/src/uipath/dev/server/static/assets/ChatPanel-DR8dCKHB.js +++ b/src/uipath/dev/server/static/assets/ChatPanel-DiTmerW3.js @@ -1,2 +1,2 @@ -import{j as e,a as y}from"./vendor-react-N5xbSGOh.js";import{M,r as T,a as O,u as S}from"./index-DDtQJ0N8.js";import"./vendor-reactflow-CxoS0d5s.js";const J={user:{label:"You",color:"var(--info)"},tool:{label:"Tool",color:"var(--warning)"},assistant:{label:"AI",color:"var(--success)"}};function A({message:t,onToolCallClick:r,toolCallIndices:o}){const i=t.role==="user",l=t.tool_calls&&t.tool_calls.length>0,a=J[i?"user":l?"tool":"assistant"];return e.jsxs("div",{className:"py-1.5",children:[e.jsxs("div",{className:"flex items-center gap-1.5 mb-0.5",children:[e.jsx("div",{className:"w-2 h-2 rounded-full",style:{background:a.color}}),e.jsx("span",{className:"text-[11px] font-semibold",style:{color:a.color},children:a.label})]}),t.content&&(i?e.jsx("div",{className:"text-sm leading-relaxed pl-2.5 max-w-prose",style:{color:"var(--text-primary)"},children:t.content}):e.jsx("div",{className:"text-sm leading-relaxed pl-2.5 max-w-prose chat-markdown",style:{color:"var(--text-secondary)"},children:e.jsx(M,{remarkPlugins:[O],rehypePlugins:[T],children:t.content})})),t.tool_calls&&t.tool_calls.length>0&&e.jsx("div",{className:"flex flex-wrap gap-1 mt-1 pl-2.5",children:t.tool_calls.map((p,c)=>e.jsxs("span",{className:"inline-flex items-center gap-1 text-[11px] font-mono px-2 py-1 rounded cursor-pointer hover:brightness-125",style:{background:"var(--bg-primary)",border:"1px solid var(--border)",color:p.has_result?"var(--success)":"var(--text-muted)"},onClick:()=>r==null?void 0:r(p.name,(o==null?void 0:o[c])??0),children:[p.has_result?"✓":"•"," ",p.name]},`${p.name}-${c}`))})]})}function L({onSend:t,disabled:r,placeholder:o}){const[i,l]=y.useState(""),u=()=>{const c=i.trim();c&&(t(c),l(""))},a=c=>{c.key==="Enter"&&!c.shiftKey&&(c.preventDefault(),u())},p=!r&&i.trim().length>0;return e.jsxs("div",{className:"flex items-center gap-2 px-3 py-2 border-t",style:{borderColor:"var(--border)"},children:[e.jsx("input",{value:i,onChange:c=>l(c.target.value),onKeyDown:a,disabled:r,placeholder:o??"Message...",className:"flex-1 bg-transparent text-sm py-1 disabled:opacity-40 placeholder:text-[var(--text-muted)]",style:{color:"var(--text-primary)"}}),e.jsx("button",{onClick:u,disabled:!p,className:"text-xs font-semibold px-3 py-1.5 rounded transition-colors cursor-pointer disabled:opacity-30 disabled:cursor-not-allowed","aria-label":"Send message",style:{color:p?"var(--accent)":"var(--text-muted)",background:"transparent"},onMouseEnter:c=>{p&&(c.currentTarget.style.background="color-mix(in srgb, var(--accent) 10%, transparent)")},onMouseLeave:c=>{c.currentTarget.style.background="transparent"},children:"Send"})]})}function $(t){if(typeof t!="object"||t===null)return!1;const r=t;return typeof r.properties=="object"&&r.properties!==null&&Object.keys(r.properties).length>0}const f={color:"var(--text-primary)",border:"1px solid var(--border)",background:"var(--bg-primary)"},j="w-full text-[11px] font-mono py-1 px-2 rounded focus:outline-none";function R({name:t,prop:r,value:o,onChange:i}){const l=e.jsxs("label",{className:"text-[11px] font-medium block mb-1",style:{color:"var(--text-muted)"},children:[t,r.description&&e.jsxs("span",{className:"font-normal normal-case tracking-normal ml-1",style:{color:"var(--text-muted)",opacity:.7},children:["— ",r.description]})]});if(r.enum&&Array.isArray(r.enum))return e.jsxs("div",{children:[l,e.jsx("select",{value:String(o??""),onChange:a=>i(a.target.value),className:j,style:f,children:r.enum.map(a=>e.jsx("option",{value:String(a),children:String(a)},String(a)))})]});if(r.type==="boolean")return e.jsxs("div",{children:[l,e.jsxs("label",{className:"flex items-center gap-2 cursor-pointer py-1",children:[e.jsx("input",{type:"checkbox",checked:!!o,onChange:a=>i(a.target.checked),className:"accent-[var(--accent)]"}),e.jsx("span",{className:"text-[11px] font-mono",style:{color:"var(--text-secondary)"},children:o?"true":"false"})]})]});if(r.type==="number"||r.type==="integer")return e.jsxs("div",{children:[l,e.jsx("input",{type:"number",value:o==null?"":String(o),onChange:a=>i(a.target.value===""?null:Number(a.target.value)),step:r.type==="integer"?1:"any",className:j,style:f})]});if(r.type==="object"||r.type==="array"){const a=typeof o=="string"?o:JSON.stringify(o??null,null,2);return e.jsxs("div",{children:[l,e.jsx("textarea",{value:a,onChange:p=>i(p.target.value),rows:3,className:`${j} resize-y`,style:f})]})}const u=o==null?"":String(o);return u.length>100||u.includes(` +import{j as e,a as y}from"./vendor-react-N5xbSGOh.js";import{M,r as T,a as O,u as S}from"./index-RLauX7zc.js";import"./vendor-reactflow-CxoS0d5s.js";const J={user:{label:"You",color:"var(--info)"},tool:{label:"Tool",color:"var(--warning)"},assistant:{label:"AI",color:"var(--success)"}};function A({message:t,onToolCallClick:r,toolCallIndices:o}){const i=t.role==="user",l=t.tool_calls&&t.tool_calls.length>0,a=J[i?"user":l?"tool":"assistant"];return e.jsxs("div",{className:"py-1.5",children:[e.jsxs("div",{className:"flex items-center gap-1.5 mb-0.5",children:[e.jsx("div",{className:"w-2 h-2 rounded-full",style:{background:a.color}}),e.jsx("span",{className:"text-[11px] font-semibold",style:{color:a.color},children:a.label})]}),t.content&&(i?e.jsx("div",{className:"text-sm leading-relaxed pl-2.5 max-w-prose",style:{color:"var(--text-primary)"},children:t.content}):e.jsx("div",{className:"text-sm leading-relaxed pl-2.5 max-w-prose chat-markdown",style:{color:"var(--text-secondary)"},children:e.jsx(M,{remarkPlugins:[O],rehypePlugins:[T],children:t.content})})),t.tool_calls&&t.tool_calls.length>0&&e.jsx("div",{className:"flex flex-wrap gap-1 mt-1 pl-2.5",children:t.tool_calls.map((p,c)=>e.jsxs("span",{className:"inline-flex items-center gap-1 text-[11px] font-mono px-2 py-1 rounded cursor-pointer hover:brightness-125",style:{background:"var(--bg-primary)",border:"1px solid var(--border)",color:p.has_result?"var(--success)":"var(--text-muted)"},onClick:()=>r==null?void 0:r(p.name,(o==null?void 0:o[c])??0),children:[p.has_result?"✓":"•"," ",p.name]},`${p.name}-${c}`))})]})}function L({onSend:t,disabled:r,placeholder:o}){const[i,l]=y.useState(""),u=()=>{const c=i.trim();c&&(t(c),l(""))},a=c=>{c.key==="Enter"&&!c.shiftKey&&(c.preventDefault(),u())},p=!r&&i.trim().length>0;return e.jsxs("div",{className:"flex items-center gap-2 px-3 py-2 border-t",style:{borderColor:"var(--border)"},children:[e.jsx("input",{value:i,onChange:c=>l(c.target.value),onKeyDown:a,disabled:r,placeholder:o??"Message...",className:"flex-1 bg-transparent text-sm py-1 disabled:opacity-40 placeholder:text-[var(--text-muted)]",style:{color:"var(--text-primary)"}}),e.jsx("button",{onClick:u,disabled:!p,className:"text-xs font-semibold px-3 py-1.5 rounded transition-colors cursor-pointer disabled:opacity-30 disabled:cursor-not-allowed","aria-label":"Send message",style:{color:p?"var(--accent)":"var(--text-muted)",background:"transparent"},onMouseEnter:c=>{p&&(c.currentTarget.style.background="color-mix(in srgb, var(--accent) 10%, transparent)")},onMouseLeave:c=>{c.currentTarget.style.background="transparent"},children:"Send"})]})}function $(t){if(typeof t!="object"||t===null)return!1;const r=t;return typeof r.properties=="object"&&r.properties!==null&&Object.keys(r.properties).length>0}const f={color:"var(--text-primary)",border:"1px solid var(--border)",background:"var(--bg-primary)"},j="w-full text-[11px] font-mono py-1 px-2 rounded focus:outline-none";function R({name:t,prop:r,value:o,onChange:i}){const l=e.jsxs("label",{className:"text-[11px] font-medium block mb-1",style:{color:"var(--text-muted)"},children:[t,r.description&&e.jsxs("span",{className:"font-normal normal-case tracking-normal ml-1",style:{color:"var(--text-muted)",opacity:.7},children:["— ",r.description]})]});if(r.enum&&Array.isArray(r.enum))return e.jsxs("div",{children:[l,e.jsx("select",{value:String(o??""),onChange:a=>i(a.target.value),className:j,style:f,children:r.enum.map(a=>e.jsx("option",{value:String(a),children:String(a)},String(a)))})]});if(r.type==="boolean")return e.jsxs("div",{children:[l,e.jsxs("label",{className:"flex items-center gap-2 cursor-pointer py-1",children:[e.jsx("input",{type:"checkbox",checked:!!o,onChange:a=>i(a.target.checked),className:"accent-[var(--accent)]"}),e.jsx("span",{className:"text-[11px] font-mono",style:{color:"var(--text-secondary)"},children:o?"true":"false"})]})]});if(r.type==="number"||r.type==="integer")return e.jsxs("div",{children:[l,e.jsx("input",{type:"number",value:o==null?"":String(o),onChange:a=>i(a.target.value===""?null:Number(a.target.value)),step:r.type==="integer"?1:"any",className:j,style:f})]});if(r.type==="object"||r.type==="array"){const a=typeof o=="string"?o:JSON.stringify(o??null,null,2);return e.jsxs("div",{children:[l,e.jsx("textarea",{value:a,onChange:p=>i(p.target.value),rows:3,className:`${j} resize-y`,style:f})]})}const u=o==null?"":String(o);return u.length>100||u.includes(` `)?e.jsxs("div",{children:[l,e.jsx("textarea",{value:u,onChange:a=>i(a.target.value),rows:3,className:`${j} resize-y`,style:f})]}):e.jsxs("div",{children:[l,e.jsx("input",{type:"text",value:u,onChange:a=>i(a.target.value),className:j,style:f})]})}function _({label:t,color:r,onClick:o}){return e.jsx("button",{onClick:o,className:"text-xs font-semibold px-3 py-1.5 rounded cursor-pointer transition-colors",style:{background:`color-mix(in srgb, var(--${r}) 15%, var(--bg-secondary))`,color:`var(--${r})`,border:`1px solid color-mix(in srgb, var(--${r}) 30%, var(--border))`},onMouseEnter:i=>{i.currentTarget.style.background=`color-mix(in srgb, var(--${r}) 25%, var(--bg-secondary))`},onMouseLeave:i=>{i.currentTarget.style.background=`color-mix(in srgb, var(--${r}) 15%, var(--bg-secondary))`},children:t})}function F({interrupt:t,onRespond:r}){const[o,i]=y.useState(""),[l,u]=y.useState(!1),[a,p]=y.useState({}),[c,N]=y.useState(""),[k,h]=y.useState(null),g=t.input_schema,b=$(g),C=y.useCallback(()=>{const s=typeof t.input_value=="object"&&t.input_value!==null?t.input_value:{};if(b){const d={...s};for(const m of Object.keys(g.properties))m in d||(d[m]=null);const x=g.properties;for(const[m,v]of Object.entries(x))(v.type==="object"||v.type==="array")&&typeof d[m]!="string"&&(d[m]=JSON.stringify(d[m]??null,null,2));p(d)}else N(typeof t.input_value=="string"?t.input_value:JSON.stringify(t.input_value??null,null,2));h(null),u(!0)},[t.input_value,b,g]),E=()=>{u(!1),h(null)},w=()=>{if(b){const s={},d=g.properties;for(const[x,m]of Object.entries(a)){const v=d[x];if(((v==null?void 0:v.type)==="object"||(v==null?void 0:v.type)==="array")&&typeof m=="string")try{s[x]=JSON.parse(m)}catch{h(`Invalid JSON for "${x}"`);return}else s[x]=m}r({approved:!0,input:s})}else try{const s=JSON.parse(c);r({approved:!0,input:s})}catch{h("Invalid JSON");return}},n=y.useCallback((s,d)=>{p(x=>({...x,[s]:d}))},[]);return t.interrupt_type==="tool_call_confirmation"?e.jsxs("div",{className:"mx-3 my-2 rounded-lg overflow-hidden",style:{border:"1px solid color-mix(in srgb, var(--warning) 40%, var(--border))"},children:[e.jsxs("div",{className:"px-3 py-2 flex items-center gap-2",style:{background:"color-mix(in srgb, var(--warning) 10%, var(--bg-secondary))"},children:[e.jsx("span",{className:"text-[11px] font-semibold",style:{color:"var(--warning)"},children:l?"Edit Arguments":"Action Required"}),t.tool_name&&e.jsx("span",{className:"text-[11px] font-mono px-1.5 py-0.5 rounded",style:{background:"color-mix(in srgb, var(--warning) 15%, var(--bg-secondary))",color:"var(--text-primary)"},children:t.tool_name}),!l&&(t.input_value!=null||b)&&e.jsx("button",{onClick:C,className:"ml-auto p-1.5 rounded cursor-pointer transition-colors",style:{color:"var(--text-muted)"},"aria-label":"Edit arguments",onMouseEnter:s=>{s.currentTarget.style.color="var(--warning)"},onMouseLeave:s=>{s.currentTarget.style.color="var(--text-muted)"},title:"Edit arguments",children:e.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("path",{d:"M11 4H4a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7"}),e.jsx("path",{d:"M18.5 2.5a2.121 2.121 0 0 1 3 3L12 15l-4 1 1-4 9.5-9.5z"})]})})]}),l?e.jsxs("div",{className:"px-3 py-2 space-y-3 overflow-y-auto",style:{background:"var(--bg-secondary)",maxHeight:300},children:[b?Object.entries(g.properties).map(([s,d])=>e.jsx(R,{name:s,prop:d,value:a[s],onChange:x=>n(s,x)},s)):e.jsx("textarea",{value:c,onChange:s=>{N(s.target.value),h(null)},rows:8,className:"w-full text-[11px] font-mono py-1 px-2 rounded focus:outline-none resize-y",style:f}),k&&e.jsx("p",{className:"text-[11px]",style:{color:"var(--error)"},children:k})]}):t.input_value!=null&&e.jsx("pre",{className:"px-3 py-2 text-[11px] font-mono whitespace-pre-wrap break-words overflow-y-auto leading-normal",style:{background:"var(--bg-secondary)",color:"var(--text-secondary)",maxHeight:200},children:typeof t.input_value=="string"?t.input_value:JSON.stringify(t.input_value,null,2)}),e.jsx("div",{className:"flex items-center gap-2 px-3 py-2",style:{background:"var(--bg-secondary)",borderTop:"1px solid var(--border)"},children:l?e.jsxs(e.Fragment,{children:[e.jsx(_,{label:"Approve",color:"success",onClick:w}),e.jsx(_,{label:"Cancel",color:"text-muted",onClick:E})]}):e.jsxs(e.Fragment,{children:[e.jsx(_,{label:"Approve",color:"success",onClick:()=>r({approved:!0})}),e.jsx(_,{label:"Reject",color:"error",onClick:()=>r({approved:!1})})]})})]}):e.jsxs("div",{className:"mx-3 my-2 rounded-lg overflow-hidden",style:{border:"1px solid color-mix(in srgb, var(--accent) 40%, var(--border))"},children:[e.jsx("div",{className:"px-3 py-2",style:{background:"color-mix(in srgb, var(--accent) 10%, var(--bg-secondary))"},children:e.jsx("span",{className:"text-[11px] font-semibold",style:{color:"var(--accent)"},children:"Input Required"})}),t.content!=null&&e.jsx("div",{className:"px-3 py-2 text-sm leading-relaxed",style:{background:"var(--bg-secondary)",color:"var(--text-secondary)"},children:typeof t.content=="string"?t.content:JSON.stringify(t.content,null,2)}),e.jsxs("div",{className:"flex items-center gap-2 px-3 py-2",style:{background:"var(--bg-secondary)",borderTop:"1px solid var(--border)"},children:[e.jsx("input",{value:o,onChange:s=>i(s.target.value),onKeyDown:s=>{s.key==="Enter"&&!s.shiftKey&&o.trim()&&(s.preventDefault(),r({response:o.trim()}))},placeholder:"Type your response...",className:"flex-1 bg-transparent text-sm py-1 placeholder:text-[var(--text-muted)]",style:{color:"var(--text-primary)"}}),e.jsx("button",{onClick:()=>{o.trim()&&r({response:o.trim()})},disabled:!o.trim(),className:"text-xs font-semibold px-3 py-1.5 rounded transition-colors cursor-pointer disabled:opacity-30 disabled:cursor-not-allowed",style:{color:o.trim()?"var(--accent)":"var(--text-muted)",background:"transparent"},children:"Send"})]})]})}function I({messages:t,runId:r,runStatus:o,ws:i}){const l=y.useRef(null),u=y.useRef(!0),a=S(n=>n.addLocalChatMessage),p=S(n=>n.setFocusedSpan),c=S(n=>n.activeInterrupt[r]??null),N=S(n=>n.setActiveInterrupt),k=y.useMemo(()=>{const n=new Map,s=new Map;for(const d of t)if(d.tool_calls){const x=[];for(const m of d.tool_calls){const v=s.get(m.name)??0;x.push(v),s.set(m.name,v+1)}n.set(d.message_id,x)}return n},[t]),[h,g]=y.useState(!1),b=()=>{const n=l.current;if(!n)return;const s=n.scrollHeight-n.scrollTop-n.clientHeight<40;u.current=s,g(n.scrollTop>100)};y.useEffect(()=>{u.current&&l.current&&(l.current.scrollTop=l.current.scrollHeight)});const C=n=>{u.current=!0,a(r,{message_id:`local-${Date.now()}`,role:"user",content:n}),i.sendChatMessage(r,n)},E=n=>{u.current=!0,i.sendInterruptResponse(r,n),N(r,null)},w=o==="running"||!!c;return e.jsxs("div",{className:"flex flex-col h-full",children:[e.jsxs("div",{className:"relative flex-1 overflow-hidden",children:[e.jsxs("div",{ref:l,onScroll:b,className:"h-full overflow-y-auto px-3 py-2 space-y-0.5",children:[t.length===0&&e.jsx("p",{className:"text-[var(--text-muted)] text-sm text-center py-6",children:"No messages yet"}),t.map(n=>e.jsx(A,{message:n,toolCallIndices:k.get(n.message_id),onToolCallClick:(s,d)=>p({name:s,index:d})},n.message_id)),c&&e.jsx(F,{interrupt:c,onRespond:E})]}),h&&e.jsx("button",{onClick:()=>{var n;return(n=l.current)==null?void 0:n.scrollTo({top:0,behavior:"smooth"})},className:"absolute top-2 right-3 w-6 h-6 flex items-center justify-center rounded-full cursor-pointer transition-opacity opacity-70 hover:opacity-100",style:{background:"var(--bg-tertiary)",color:"var(--text-primary)"},title:"Scroll to top",children:e.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",children:e.jsx("polyline",{points:"18 15 12 9 6 15"})})})]}),e.jsx(L,{onSend:C,disabled:w,placeholder:c?"Respond to the interrupt above...":w?"Waiting for response...":"Message..."})]})}export{I as default}; diff --git a/src/uipath/dev/server/static/assets/index-CzFU-Cnb.css b/src/uipath/dev/server/static/assets/index-CzFU-Cnb.css new file mode 100644 index 0000000..dab1bbc --- /dev/null +++ b/src/uipath/dev/server/static/assets/index-CzFU-Cnb.css @@ -0,0 +1 @@ +/*! tailwindcss v4.2.1 | MIT License | https://tailwindcss.com */@layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-translate-x:0;--tw-translate-y:0;--tw-translate-z:0;--tw-rotate-x:initial;--tw-rotate-y:initial;--tw-rotate-z:initial;--tw-skew-x:initial;--tw-skew-y:initial;--tw-space-y-reverse:0;--tw-border-style:solid;--tw-leading:initial;--tw-font-weight:initial;--tw-tracking:initial;--tw-ordinal:initial;--tw-slashed-zero:initial;--tw-numeric-figure:initial;--tw-numeric-spacing:initial;--tw-numeric-fraction:initial;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000;--tw-duration:initial;--tw-ease:initial;--tw-blur:initial;--tw-brightness:initial;--tw-contrast:initial;--tw-grayscale:initial;--tw-hue-rotate:initial;--tw-invert:initial;--tw-opacity:initial;--tw-saturate:initial;--tw-sepia:initial;--tw-drop-shadow:initial;--tw-drop-shadow-color:initial;--tw-drop-shadow-alpha:100%;--tw-drop-shadow-size:initial}}}@layer theme{:root,:host{--font-sans:ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";--font-mono:ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;--spacing:.25rem;--container-xs:20rem;--container-xl:36rem;--container-2xl:42rem;--text-xs:.75rem;--text-xs--line-height:calc(1 / .75);--text-sm:.875rem;--text-sm--line-height:calc(1.25 / .875);--text-base:1rem;--text-base--line-height: 1.5 ;--font-weight-normal:400;--font-weight-medium:500;--font-weight-semibold:600;--font-weight-bold:700;--tracking-normal:0em;--tracking-wide:.025em;--tracking-wider:.05em;--tracking-widest:.1em;--leading-normal:1.5;--leading-relaxed:1.625;--radius-sm:.25rem;--radius-md:.375rem;--radius-lg:.5rem;--radius-xl:.75rem;--ease-in-out:cubic-bezier(.4, 0, .2, 1);--animate-spin:spin 1s linear infinite;--animate-pulse:pulse 2s cubic-bezier(.4, 0, .6, 1) infinite;--default-transition-duration:.15s;--default-transition-timing-function:cubic-bezier(.4, 0, .2, 1);--default-font-family:var(--font-sans);--default-mono-font-family:var(--font-mono)}}@layer base{*,:after,:before,::backdrop{box-sizing:border-box;border:0 solid;margin:0;padding:0}::file-selector-button{box-sizing:border-box;border:0 solid;margin:0;padding:0}html,:host{-webkit-text-size-adjust:100%;-moz-tab-size:4;tab-size:4;line-height:1.5;font-family:var(--default-font-family,ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji");font-feature-settings:var(--default-font-feature-settings,normal);font-variation-settings:var(--default-font-variation-settings,normal);-webkit-tap-highlight-color:transparent}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;-webkit-text-decoration:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:var(--default-mono-font-family,ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace);font-feature-settings:var(--default-mono-font-feature-settings,normal);font-variation-settings:var(--default-mono-font-variation-settings,normal);font-size:1em}small{font-size:80%}sub,sup{vertical-align:baseline;font-size:75%;line-height:0;position:relative}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}:-moz-focusring{outline:auto}progress{vertical-align:baseline}summary{display:list-item}ol,ul,menu{list-style:none}img,svg,video,canvas,audio,iframe,embed,object{vertical-align:middle;display:block}img,video{max-width:100%;height:auto}button,input,select,optgroup,textarea{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}::file-selector-button{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}:where(select:is([multiple],[size])) optgroup{font-weight:bolder}:where(select:is([multiple],[size])) optgroup option{padding-inline-start:20px}::file-selector-button{margin-inline-end:4px}::placeholder{opacity:1}@supports (not ((-webkit-appearance:-apple-pay-button))) or (contain-intrinsic-size:1px){::placeholder{color:currentColor}@supports (color:color-mix(in lab,red,red)){::placeholder{color:color-mix(in oklab,currentcolor 50%,transparent)}}}textarea{resize:vertical}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-date-and-time-value{min-height:1lh;text-align:inherit}::-webkit-datetime-edit{display:inline-flex}::-webkit-datetime-edit-fields-wrapper{padding:0}::-webkit-datetime-edit{padding-block:0}::-webkit-datetime-edit-year-field{padding-block:0}::-webkit-datetime-edit-month-field{padding-block:0}::-webkit-datetime-edit-day-field{padding-block:0}::-webkit-datetime-edit-hour-field{padding-block:0}::-webkit-datetime-edit-minute-field{padding-block:0}::-webkit-datetime-edit-second-field{padding-block:0}::-webkit-datetime-edit-millisecond-field{padding-block:0}::-webkit-datetime-edit-meridiem-field{padding-block:0}::-webkit-calendar-picker-indicator{line-height:1}:-moz-ui-invalid{box-shadow:none}button,input:where([type=button],[type=reset],[type=submit]){-webkit-appearance:button;-moz-appearance:button;appearance:button}::file-selector-button{-webkit-appearance:button;-moz-appearance:button;appearance:button}::-webkit-inner-spin-button{height:auto}::-webkit-outer-spin-button{height:auto}[hidden]:where(:not([hidden=until-found])){display:none!important}}@layer components;@layer utilities{.pointer-events-auto{pointer-events:auto}.pointer-events-none{pointer-events:none}.visible{visibility:visible}.absolute{position:absolute}.fixed{position:fixed}.relative{position:relative}.inset-0{inset:calc(var(--spacing) * 0)}.inset-y-0{inset-block:calc(var(--spacing) * 0)}.start{inset-inline-start:var(--spacing)}.end{inset-inline-end:var(--spacing)}.top-0{top:calc(var(--spacing) * 0)}.top-1{top:calc(var(--spacing) * 1)}.top-1\.5{top:calc(var(--spacing) * 1.5)}.top-2{top:calc(var(--spacing) * 2)}.top-4{top:calc(var(--spacing) * 4)}.top-full{top:100%}.right-0{right:calc(var(--spacing) * 0)}.right-1{right:calc(var(--spacing) * 1)}.right-3{right:calc(var(--spacing) * 3)}.right-4{right:calc(var(--spacing) * 4)}.bottom-1\.5{bottom:calc(var(--spacing) * 1.5)}.bottom-8{bottom:calc(var(--spacing) * 8)}.bottom-full{bottom:100%}.left-0{left:calc(var(--spacing) * 0)}.left-1\/2{left:50%}.left-2{left:calc(var(--spacing) * 2)}.z-10{z-index:10}.z-40{z-index:40}.z-50{z-index:50}.z-\[100\]{z-index:100}.container{width:100%}@media(min-width:40rem){.container{max-width:40rem}}@media(min-width:48rem){.container{max-width:48rem}}@media(min-width:64rem){.container{max-width:64rem}}@media(min-width:80rem){.container{max-width:80rem}}@media(min-width:96rem){.container{max-width:96rem}}.m-0{margin:calc(var(--spacing) * 0)}.mx-1{margin-inline:calc(var(--spacing) * 1)}.mx-2{margin-inline:calc(var(--spacing) * 2)}.mx-3{margin-inline:calc(var(--spacing) * 3)}.mx-auto{margin-inline:auto}.my-2{margin-block:calc(var(--spacing) * 2)}.mt-0\.5{margin-top:calc(var(--spacing) * .5)}.mt-1{margin-top:calc(var(--spacing) * 1)}.mt-2{margin-top:calc(var(--spacing) * 2)}.mt-2\.5{margin-top:calc(var(--spacing) * 2.5)}.mt-4{margin-top:calc(var(--spacing) * 4)}.mt-auto{margin-top:auto}.mr-0\.5{margin-right:calc(var(--spacing) * .5)}.mr-1{margin-right:calc(var(--spacing) * 1)}.mb-0\.5{margin-bottom:calc(var(--spacing) * .5)}.mb-1{margin-bottom:calc(var(--spacing) * 1)}.mb-1\.5{margin-bottom:calc(var(--spacing) * 1.5)}.mb-2{margin-bottom:calc(var(--spacing) * 2)}.mb-3{margin-bottom:calc(var(--spacing) * 3)}.mb-4{margin-bottom:calc(var(--spacing) * 4)}.mb-6{margin-bottom:calc(var(--spacing) * 6)}.mb-8{margin-bottom:calc(var(--spacing) * 8)}.ml-1{margin-left:calc(var(--spacing) * 1)}.ml-2{margin-left:calc(var(--spacing) * 2)}.ml-auto{margin-left:auto}.block{display:block}.flex{display:flex}.grid{display:grid}.hidden{display:none}.inline{display:inline}.inline-block{display:inline-block}.inline-flex{display:inline-flex}.table{display:table}.h-1\.5{height:calc(var(--spacing) * 1.5)}.h-2{height:calc(var(--spacing) * 2)}.h-2\.5{height:calc(var(--spacing) * 2.5)}.h-3{height:calc(var(--spacing) * 3)}.h-3\.5{height:calc(var(--spacing) * 3.5)}.h-4{height:calc(var(--spacing) * 4)}.h-5{height:calc(var(--spacing) * 5)}.h-6{height:calc(var(--spacing) * 6)}.h-7{height:calc(var(--spacing) * 7)}.h-8{height:calc(var(--spacing) * 8)}.h-9{height:calc(var(--spacing) * 9)}.h-10{height:calc(var(--spacing) * 10)}.h-\[14px\]{height:14px}.h-full{height:100%}.h-screen{height:100vh}.max-h-32{max-height:calc(var(--spacing) * 32)}.max-h-40{max-height:calc(var(--spacing) * 40)}.max-h-48{max-height:calc(var(--spacing) * 48)}.max-h-64{max-height:calc(var(--spacing) * 64)}.max-h-\[85vh\]{max-height:85vh}.min-h-0{min-height:calc(var(--spacing) * 0)}.min-h-full{min-height:100%}.w-0\.5{width:calc(var(--spacing) * .5)}.w-1\.5{width:calc(var(--spacing) * 1.5)}.w-2{width:calc(var(--spacing) * 2)}.w-3{width:calc(var(--spacing) * 3)}.w-3\.5{width:calc(var(--spacing) * 3.5)}.w-4{width:calc(var(--spacing) * 4)}.w-5{width:calc(var(--spacing) * 5)}.w-6{width:calc(var(--spacing) * 6)}.w-7{width:calc(var(--spacing) * 7)}.w-8{width:calc(var(--spacing) * 8)}.w-9{width:calc(var(--spacing) * 9)}.w-10{width:calc(var(--spacing) * 10)}.w-12{width:calc(var(--spacing) * 12)}.w-14{width:calc(var(--spacing) * 14)}.w-24{width:calc(var(--spacing) * 24)}.w-32{width:calc(var(--spacing) * 32)}.w-36{width:calc(var(--spacing) * 36)}.w-44{width:calc(var(--spacing) * 44)}.w-56{width:calc(var(--spacing) * 56)}.w-64{width:calc(var(--spacing) * 64)}.w-\[200px\]{width:200px}.w-\[calc\(100\%-24px\)\]{width:calc(100% - 24px)}.w-full{width:100%}.w-screen{width:100vw}.max-w-2xl{max-width:var(--container-2xl)}.max-w-\[160px\]{max-width:160px}.max-w-\[200px\]{max-width:200px}.max-w-prose{max-width:65ch}.max-w-xl{max-width:var(--container-xl)}.max-w-xs{max-width:var(--container-xs)}.min-w-0{min-width:calc(var(--spacing) * 0)}.min-w-\[140px\]{min-width:140px}.min-w-\[180px\]{min-width:180px}.min-w-\[400px\]{min-width:400px}.flex-1{flex:1}.flex-shrink-0,.shrink-0{flex-shrink:0}.-translate-x-1\/2{--tw-translate-x: -50% ;translate:var(--tw-translate-x) var(--tw-translate-y)}.transform{transform:var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,)}.animate-\[slideIn_0\.2s_ease-out\]{animation:.2s ease-out slideIn}.animate-pulse{animation:var(--animate-pulse)}.animate-spin{animation:var(--animate-spin)}.cursor-pointer{cursor:pointer}.resize{resize:both}.resize-none{resize:none}.resize-y{resize:vertical}.appearance-auto{-webkit-appearance:auto;-moz-appearance:auto;appearance:auto}.grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.flex-col{flex-direction:column}.flex-wrap{flex-wrap:wrap}.items-center{align-items:center}.items-end{align-items:flex-end}.items-start{align-items:flex-start}.justify-between{justify-content:space-between}.justify-center{justify-content:center}.justify-end{justify-content:flex-end}.gap-0{gap:calc(var(--spacing) * 0)}.gap-1{gap:calc(var(--spacing) * 1)}.gap-1\.5{gap:calc(var(--spacing) * 1.5)}.gap-2{gap:calc(var(--spacing) * 2)}.gap-2\.5{gap:calc(var(--spacing) * 2.5)}.gap-3{gap:calc(var(--spacing) * 3)}.gap-4{gap:calc(var(--spacing) * 4)}:where(.space-y-0\.5>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * .5) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * .5) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-1>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 1) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 1) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-1\.5>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 1.5) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 1.5) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-2>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 2) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 2) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-3>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 3) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 3) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-4>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 4) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 4) * calc(1 - var(--tw-space-y-reverse)))}.self-start{align-self:flex-start}.truncate{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.overflow-auto{overflow:auto}.overflow-hidden{overflow:hidden}.overflow-x-auto{overflow-x:auto}.overflow-y-auto{overflow-y:auto}.rounded{border-radius:.25rem}.rounded-full{border-radius:3.40282e38px}.rounded-lg{border-radius:var(--radius-lg)}.rounded-md{border-radius:var(--radius-md)}.rounded-sm{border-radius:var(--radius-sm)}.rounded-xl{border-radius:var(--radius-xl)}.rounded-r{border-top-right-radius:.25rem;border-bottom-right-radius:.25rem}.border{border-style:var(--tw-border-style);border-width:1px}.border-y{border-block-style:var(--tw-border-style);border-block-width:1px}.border-t{border-top-style:var(--tw-border-style);border-top-width:1px}.border-r{border-right-style:var(--tw-border-style);border-right-width:1px}.border-b{border-bottom-style:var(--tw-border-style);border-bottom-width:1px}.border-\[var\(--border\)\]{border-color:var(--border)}.bg-\[var\(--bg-primary\)\]{background-color:var(--bg-primary)}.bg-\[var\(--sidebar-bg\)\]{background-color:var(--sidebar-bg)}.bg-transparent{background-color:#0000}.p-0\.5{padding:calc(var(--spacing) * .5)}.p-1{padding:calc(var(--spacing) * 1)}.p-1\.5{padding:calc(var(--spacing) * 1.5)}.p-2{padding:calc(var(--spacing) * 2)}.p-3{padding:calc(var(--spacing) * 3)}.p-4{padding:calc(var(--spacing) * 4)}.p-6{padding:calc(var(--spacing) * 6)}.px-1{padding-inline:calc(var(--spacing) * 1)}.px-1\.5{padding-inline:calc(var(--spacing) * 1.5)}.px-2{padding-inline:calc(var(--spacing) * 2)}.px-2\.5{padding-inline:calc(var(--spacing) * 2.5)}.px-3{padding-inline:calc(var(--spacing) * 3)}.px-4{padding-inline:calc(var(--spacing) * 4)}.px-5{padding-inline:calc(var(--spacing) * 5)}.px-6{padding-inline:calc(var(--spacing) * 6)}.py-0\.5{padding-block:calc(var(--spacing) * .5)}.py-1{padding-block:calc(var(--spacing) * 1)}.py-1\.5{padding-block:calc(var(--spacing) * 1.5)}.py-2{padding-block:calc(var(--spacing) * 2)}.py-2\.5{padding-block:calc(var(--spacing) * 2.5)}.py-3{padding-block:calc(var(--spacing) * 3)}.py-4{padding-block:calc(var(--spacing) * 4)}.py-6{padding-block:calc(var(--spacing) * 6)}.py-8{padding-block:calc(var(--spacing) * 8)}.py-10{padding-block:calc(var(--spacing) * 10)}.py-\[3px\]{padding-block:3px}.pt-0{padding-top:calc(var(--spacing) * 0)}.pt-1{padding-top:calc(var(--spacing) * 1)}.pt-1\.5{padding-top:calc(var(--spacing) * 1.5)}.pt-2{padding-top:calc(var(--spacing) * 2)}.pt-3{padding-top:calc(var(--spacing) * 3)}.pt-4{padding-top:calc(var(--spacing) * 4)}.pt-px{padding-top:1px}.pr-0{padding-right:calc(var(--spacing) * 0)}.pr-1{padding-right:calc(var(--spacing) * 1)}.pr-2{padding-right:calc(var(--spacing) * 2)}.pb-0\.5{padding-bottom:calc(var(--spacing) * .5)}.pb-1{padding-bottom:calc(var(--spacing) * 1)}.pb-2{padding-bottom:calc(var(--spacing) * 2)}.pl-2{padding-left:calc(var(--spacing) * 2)}.pl-2\.5{padding-left:calc(var(--spacing) * 2.5)}.pl-\[22px\]{padding-left:22px}.text-center{text-align:center}.text-left{text-align:left}.text-right{text-align:right}.font-mono{font-family:var(--font-mono)}.text-base{font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height))}.text-sm{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.text-xs{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.text-\[9px\]{font-size:9px}.text-\[10px\]{font-size:10px}.text-\[11px\]{font-size:11px}.text-\[12px\]{font-size:12px}.text-\[13px\]{font-size:13px}.leading-none{--tw-leading:1;line-height:1}.leading-normal{--tw-leading:var(--leading-normal);line-height:var(--leading-normal)}.leading-relaxed{--tw-leading:var(--leading-relaxed);line-height:var(--leading-relaxed)}.font-bold{--tw-font-weight:var(--font-weight-bold);font-weight:var(--font-weight-bold)}.font-medium{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.font-normal{--tw-font-weight:var(--font-weight-normal);font-weight:var(--font-weight-normal)}.font-semibold{--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold)}.tracking-normal{--tw-tracking:var(--tracking-normal);letter-spacing:var(--tracking-normal)}.tracking-wide{--tw-tracking:var(--tracking-wide);letter-spacing:var(--tracking-wide)}.tracking-wider{--tw-tracking:var(--tracking-wider);letter-spacing:var(--tracking-wider)}.tracking-widest{--tw-tracking:var(--tracking-widest);letter-spacing:var(--tracking-widest)}.break-words{overflow-wrap:break-word}.break-all{word-break:break-all}.text-ellipsis{text-overflow:ellipsis}.whitespace-nowrap{white-space:nowrap}.whitespace-pre-wrap{white-space:pre-wrap}.text-\[var\(--text-muted\)\]{color:var(--text-muted)}.text-\[var\(--text-primary\)\]{color:var(--text-primary)}.normal-case{text-transform:none}.uppercase{text-transform:uppercase}.italic{font-style:italic}.tabular-nums{--tw-numeric-spacing:tabular-nums;font-variant-numeric:var(--tw-ordinal,) var(--tw-slashed-zero,) var(--tw-numeric-figure,) var(--tw-numeric-spacing,) var(--tw-numeric-fraction,)}.line-through{text-decoration-line:line-through}.no-underline{text-decoration-line:none}.underline{text-decoration-line:underline}.accent-\[var\(--accent\)\]{accent-color:var(--accent)}.opacity-0{opacity:0}.opacity-40{opacity:.4}.opacity-60{opacity:.6}.opacity-70{opacity:.7}.opacity-80{opacity:.8}.shadow-lg{--tw-shadow:0 10px 15px -3px var(--tw-shadow-color,#0000001a), 0 4px 6px -4px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-xl{--tw-shadow:0 20px 25px -5px var(--tw-shadow-color,#0000001a), 0 8px 10px -6px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.transition{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to,opacity,box-shadow,transform,translate,scale,rotate,filter,-webkit-backdrop-filter,backdrop-filter,display,content-visibility,overlay,pointer-events;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-\[width\]{transition-property:width;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-all{transition-property:all;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-colors{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-opacity{transition-property:opacity;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-transform{transition-property:transform,translate,scale,rotate;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.duration-200{--tw-duration:.2s;transition-duration:.2s}.ease-in-out{--tw-ease:var(--ease-in-out);transition-timing-function:var(--ease-in-out)}.outline-none{--tw-outline-style:none;outline-style:none}@media(hover:hover){.group-hover\:opacity-100:is(:where(.group):hover *){opacity:1}}.placeholder\:text-\[var\(--text-muted\)\]::placeholder{color:var(--text-muted)}@media(hover:hover){.hover\:bg-\[var\(--bg-hover\)\]:hover{background-color:var(--bg-hover)}.hover\:opacity-80:hover{opacity:.8}.hover\:opacity-100:hover{opacity:1}.hover\:brightness-125:hover{--tw-brightness:brightness(125%);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,)}}.focus\:opacity-100:focus{opacity:1}.focus\:outline-none:focus{--tw-outline-style:none;outline-style:none}.disabled\:cursor-not-allowed:disabled{cursor:not-allowed}.disabled\:opacity-30:disabled{opacity:.3}.disabled\:opacity-40:disabled{opacity:.4}.disabled\:opacity-50:disabled{opacity:.5}}pre code.hljs{padding:1em;display:block;overflow-x:auto}code.hljs{padding:3px 5px}.hljs{color:#c9d1d9;background:#0d1117}.hljs-doctag,.hljs-keyword,.hljs-meta .hljs-keyword,.hljs-template-tag,.hljs-template-variable,.hljs-type,.hljs-variable.language_{color:#ff7b72}.hljs-title,.hljs-title.class_,.hljs-title.class_.inherited__,.hljs-title.function_{color:#d2a8ff}.hljs-attr,.hljs-attribute,.hljs-literal,.hljs-meta,.hljs-number,.hljs-operator,.hljs-variable,.hljs-selector-attr,.hljs-selector-class,.hljs-selector-id{color:#79c0ff}.hljs-regexp,.hljs-string,.hljs-meta .hljs-string{color:#a5d6ff}.hljs-built_in,.hljs-symbol{color:#ffa657}.hljs-comment,.hljs-code,.hljs-formula{color:#8b949e}.hljs-name,.hljs-quote,.hljs-selector-tag,.hljs-selector-pseudo{color:#7ee787}.hljs-subst{color:#c9d1d9}.hljs-section{color:#1f6feb;font-weight:700}.hljs-bullet{color:#f2cc60}.hljs-emphasis{color:#c9d1d9;font-style:italic}.hljs-strong{color:#c9d1d9;font-weight:700}.hljs-addition{color:#aff5b4;background-color:#033a16}.hljs-deletion{color:#ffdcd7;background-color:#67060c}:root,[data-theme=dark]{--bg-primary:#0f172a;--bg-secondary:#1e293b;--bg-tertiary:#334155;--bg-hover:#263348;--bg-elevated:#253041;--text-primary:#cbd5e1;--text-secondary:#94a3b8;--text-muted:#64748b;--border:#334155;--accent:#fa4616;--accent-hover:#e03d12;--accent-light:#ff6a3d;--success:#22c55e;--warning:#eab308;--error:#ef4444;--info:#3b82f6;--sidebar-bg:#0e1526;--activity-bar-bg:#0a1020;--card-bg:#1e293b;--input-bg:#0f172a;--code-bg:#0f172a;--tab-active:#fa4616;--tab-text:#94a3b8;--tab-text-active:#fa4616;--node-bg:#1e293b;--node-border:#475569;--scrollbar-thumb:#334155;color-scheme:dark}[data-theme=light]{--bg-primary:#f8fafc;--bg-secondary:#fff;--bg-tertiary:#cbd5e1;--bg-hover:#f1f5f9;--bg-elevated:#fff;--text-primary:#0f172a;--text-secondary:#475569;--text-muted:#94a3b8;--border:#e2e8f0;--accent:#fa4616;--accent-hover:#e03d12;--accent-light:#ff6a3d;--success:#22c55e;--warning:#ca8a04;--error:#ef4444;--info:#2563eb;--sidebar-bg:#fff;--activity-bar-bg:#f1f5f9;--card-bg:#fff;--input-bg:#f8fafc;--code-bg:#e8ecf1;--tab-active:#fa4616;--tab-text:#64748b;--tab-text-active:#fa4616;--node-bg:#fff;--node-border:#cbd5e1;--scrollbar-thumb:#d1d5db;color-scheme:light}body{background:var(--bg-primary);color:var(--text-primary);margin:0;font-family:Inter,system-ui,-apple-system,sans-serif;transition:background-color .2s,color .2s}#root{height:100dvh;display:flex}:focus-visible{outline:2px solid var(--accent);outline-offset:1px}button:focus-visible,[role=button]:focus-visible,input:focus-visible,textarea:focus-visible,select:focus-visible{outline:2px solid var(--accent)}@supports (color:color-mix(in lab,red,red)){button:focus-visible,[role=button]:focus-visible,input:focus-visible,textarea:focus-visible,select:focus-visible{outline:2px solid color-mix(in srgb,var(--accent) 60%,transparent)}}button:focus-visible,[role=button]:focus-visible,input:focus-visible,textarea:focus-visible,select:focus-visible{outline-offset:0px;border-radius:3px}.drag-handle-row{cursor:row-resize;background:var(--border);height:3px;transition:background .15s;position:relative}.drag-handle-row:before{content:"";position:absolute;top:-5px;right:0;bottom:-5px;left:0}.drag-handle-row:hover,.drag-handle-row:active{background:var(--accent)}.drag-handle-col{cursor:col-resize;background:var(--border);width:3px;transition:background .15s;position:relative}.drag-handle-col:before{content:"";position:absolute;top:0;right:-5px;bottom:0;left:-5px}.drag-handle-col:hover,.drag-handle-col:active{background:var(--accent)}@keyframes skeleton-pulse{0%,to{opacity:.4}50%{opacity:.7}}.skeleton{background:var(--bg-tertiary);border-radius:4px;animation:1.5s ease-in-out infinite skeleton-pulse}.react-flow__node{font-size:12px}.react-flow__node-default{background:var(--node-bg)!important;color:var(--text-primary)!important;border-color:var(--node-border)!important}.react-flow__background{background:var(--bg-primary)!important}.react-flow__controls button{background:var(--bg-secondary)!important;color:var(--text-primary)!important;border-color:var(--border)!important}.react-flow__controls button:hover{background:var(--bg-hover)!important}.react-flow__controls button svg{fill:var(--text-primary)!important}::-webkit-scrollbar{width:6px;height:6px}::-webkit-scrollbar-track{background:var(--bg-secondary)}::-webkit-scrollbar-thumb{background:var(--scrollbar-thumb);border-radius:3px}select{-webkit-appearance:auto;-moz-appearance:auto;appearance:auto}select option{background:var(--bg-secondary);color:var(--text-primary)}.chat-markdown p{margin:.25em 0}.chat-markdown p:first-child{margin-top:0}.chat-markdown p:last-child{margin-bottom:0}.chat-markdown code{background:var(--code-bg);border:1px solid var(--border);border-radius:3px;padding:.1em .35em;font-size:.85em}.chat-markdown pre{background:var(--code-bg);border:1px solid var(--border);border-radius:6px;margin:.5em 0;padding:.75em;overflow-x:auto}.chat-markdown pre code{background:0 0;border:none;padding:0;font-size:.85em}.chat-markdown ul,.chat-markdown ol{margin:.25em 0;padding-left:1.5em}.chat-markdown li{margin:.1em 0}.chat-markdown h1,.chat-markdown h2,.chat-markdown h3{margin:.5em 0 .25em;font-weight:600}.chat-markdown h1{font-size:1.2em}.chat-markdown h2{font-size:1.1em}.chat-markdown h3{font-size:1em}.chat-markdown blockquote{border-left:3px solid var(--border);color:var(--text-secondary);margin:.25em 0;padding-left:.75em}.chat-markdown strong{font-weight:600}.chat-markdown a{color:var(--accent);text-decoration:underline}.chat-markdown table{border-collapse:collapse;width:100%;margin:.5em 0}.chat-markdown th,.chat-markdown td{border:1px solid var(--border);text-align:left;padding:.3em .6em}.chat-markdown th{background:var(--code-bg);font-weight:600}.chat-markdown tr:nth-child(2n){background:var(--code-bg)}.chat-markdown .hljs{background:0 0}[data-theme=light] .chat-markdown .hljs{color:#24292e}[data-theme=light] .chat-markdown .hljs-doctag,[data-theme=light] .chat-markdown .hljs-keyword,[data-theme=light] .chat-markdown .hljs-meta .hljs-keyword,[data-theme=light] .chat-markdown .hljs-template-tag,[data-theme=light] .chat-markdown .hljs-template-variable,[data-theme=light] .chat-markdown .hljs-type,[data-theme=light] .chat-markdown .hljs-variable.language_{color:#d73a49}[data-theme=light] .chat-markdown .hljs-title,[data-theme=light] .chat-markdown .hljs-title.class_,[data-theme=light] .chat-markdown .hljs-title.class_.inherited__,[data-theme=light] .chat-markdown .hljs-title.function_{color:#6f42c1}[data-theme=light] .chat-markdown .hljs-attr,[data-theme=light] .chat-markdown .hljs-attribute,[data-theme=light] .chat-markdown .hljs-literal,[data-theme=light] .chat-markdown .hljs-meta,[data-theme=light] .chat-markdown .hljs-number,[data-theme=light] .chat-markdown .hljs-operator,[data-theme=light] .chat-markdown .hljs-variable,[data-theme=light] .chat-markdown .hljs-selector-attr,[data-theme=light] .chat-markdown .hljs-selector-class,[data-theme=light] .chat-markdown .hljs-selector-id{color:#005cc5}[data-theme=light] .chat-markdown .hljs-regexp,[data-theme=light] .chat-markdown .hljs-string,[data-theme=light] .chat-markdown .hljs-meta .hljs-string{color:#032f62}[data-theme=light] .chat-markdown .hljs-built_in,[data-theme=light] .chat-markdown .hljs-symbol{color:#e36209}[data-theme=light] .chat-markdown .hljs-comment,[data-theme=light] .chat-markdown .hljs-code,[data-theme=light] .chat-markdown .hljs-formula{color:#6a737d}[data-theme=light] .chat-markdown .hljs-name,[data-theme=light] .chat-markdown .hljs-quote,[data-theme=light] .chat-markdown .hljs-selector-tag,[data-theme=light] .chat-markdown .hljs-selector-pseudo{color:#22863a}[data-theme=light] .chat-markdown .hljs-subst{color:#24292e}[data-theme=light] .chat-markdown .hljs-section{color:#005cc5}[data-theme=light] .chat-markdown .hljs-bullet{color:#735c0f}[data-theme=light] .chat-markdown .hljs-addition{color:#22863a;background-color:#f0fff4}[data-theme=light] .chat-markdown .hljs-deletion{color:#b31d28;background-color:#ffeef0}@keyframes agent-changed-pulse{0%,to{box-shadow:inset 0 0 0 50px color-mix(in srgb,var(--success) 20%,transparent)}50%{box-shadow:none}}.agent-changed-file{animation:2s ease-in-out 3 agent-changed-pulse}@property --tw-translate-x{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-y{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-z{syntax:"*";inherits:false;initial-value:0}@property --tw-rotate-x{syntax:"*";inherits:false}@property --tw-rotate-y{syntax:"*";inherits:false}@property --tw-rotate-z{syntax:"*";inherits:false}@property --tw-skew-x{syntax:"*";inherits:false}@property --tw-skew-y{syntax:"*";inherits:false}@property --tw-space-y-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-border-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-leading{syntax:"*";inherits:false}@property --tw-font-weight{syntax:"*";inherits:false}@property --tw-tracking{syntax:"*";inherits:false}@property --tw-ordinal{syntax:"*";inherits:false}@property --tw-slashed-zero{syntax:"*";inherits:false}@property --tw-numeric-figure{syntax:"*";inherits:false}@property --tw-numeric-spacing{syntax:"*";inherits:false}@property --tw-numeric-fraction{syntax:"*";inherits:false}@property --tw-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-shadow-color{syntax:"*";inherits:false}@property --tw-shadow-alpha{syntax:"";inherits:false;initial-value:100%}@property --tw-inset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-shadow-color{syntax:"*";inherits:false}@property --tw-inset-shadow-alpha{syntax:"";inherits:false;initial-value:100%}@property --tw-ring-color{syntax:"*";inherits:false}@property --tw-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-ring-color{syntax:"*";inherits:false}@property --tw-inset-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-ring-inset{syntax:"*";inherits:false}@property --tw-ring-offset-width{syntax:"";inherits:false;initial-value:0}@property --tw-ring-offset-color{syntax:"*";inherits:false;initial-value:#fff}@property --tw-ring-offset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-duration{syntax:"*";inherits:false}@property --tw-ease{syntax:"*";inherits:false}@property --tw-blur{syntax:"*";inherits:false}@property --tw-brightness{syntax:"*";inherits:false}@property --tw-contrast{syntax:"*";inherits:false}@property --tw-grayscale{syntax:"*";inherits:false}@property --tw-hue-rotate{syntax:"*";inherits:false}@property --tw-invert{syntax:"*";inherits:false}@property --tw-opacity{syntax:"*";inherits:false}@property --tw-saturate{syntax:"*";inherits:false}@property --tw-sepia{syntax:"*";inherits:false}@property --tw-drop-shadow{syntax:"*";inherits:false}@property --tw-drop-shadow-color{syntax:"*";inherits:false}@property --tw-drop-shadow-alpha{syntax:"";inherits:false;initial-value:100%}@property --tw-drop-shadow-size{syntax:"*";inherits:false}@keyframes spin{to{transform:rotate(360deg)}}@keyframes pulse{50%{opacity:.5}} diff --git a/src/uipath/dev/server/static/assets/index-DDtQJ0N8.js b/src/uipath/dev/server/static/assets/index-RLauX7zc.js similarity index 98% rename from src/uipath/dev/server/static/assets/index-DDtQJ0N8.js rename to src/uipath/dev/server/static/assets/index-RLauX7zc.js index c344822..371785f 100644 --- a/src/uipath/dev/server/static/assets/index-DDtQJ0N8.js +++ b/src/uipath/dev/server/static/assets/index-RLauX7zc.js @@ -1,4 +1,4 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/vendor-elk-CiLKfHel.js","assets/vendor-react-N5xbSGOh.js","assets/ChatPanel-DR8dCKHB.js","assets/vendor-reactflow-CxoS0d5s.js","assets/vendor-reactflow-B5DZHykP.css"])))=>i.map(i=>d[i]); +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/vendor-elk-CiLKfHel.js","assets/vendor-react-N5xbSGOh.js","assets/ChatPanel-DiTmerW3.js","assets/vendor-reactflow-CxoS0d5s.js","assets/vendor-reactflow-B5DZHykP.css"])))=>i.map(i=>d[i]); var Sl=Object.defineProperty;var Tl=(e,t,n)=>t in e?Sl(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var It=(e,t,n)=>Tl(e,typeof t!="symbol"?t+"":t,n);import{W as Tn,a as N,j as a,w as Cl,F as Al,g as Xr,b as Ml}from"./vendor-react-N5xbSGOh.js";import{H as ht,P as bt,B as Il,M as Rl,u as Ol,a as Ll,R as jl,b as Dl,C as Pl,c as Bl,d as Fl}from"./vendor-reactflow-CxoS0d5s.js";(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))r(i);new MutationObserver(i=>{for(const s of i)if(s.type==="childList")for(const o of s.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&r(o)}).observe(document,{childList:!0,subtree:!0});function n(i){const s={};return i.integrity&&(s.integrity=i.integrity),i.referrerPolicy&&(s.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?s.credentials="include":i.crossOrigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function r(i){if(i.ep)return;i.ep=!0;const s=n(i);fetch(i.href,s)}})();const Mi=e=>{let t;const n=new Set,r=(c,d)=>{const p=typeof c=="function"?c(t):c;if(!Object.is(p,t)){const m=t;t=d??(typeof p!="object"||p===null)?p:Object.assign({},t,p),n.forEach(f=>f(t,m))}},i=()=>t,l={setState:r,getState:i,getInitialState:()=>u,subscribe:c=>(n.add(c),()=>n.delete(c))},u=t=e(r,i,l);return l},zl=(e=>e?Mi(e):Mi),$l=e=>e;function Ul(e,t=$l){const n=Tn.useSyncExternalStore(e.subscribe,Tn.useCallback(()=>t(e.getState()),[e,t]),Tn.useCallback(()=>t(e.getInitialState()),[e,t]));return Tn.useDebugValue(n),n}const Ii=e=>{const t=zl(e),n=r=>Ul(t,r);return Object.assign(n,t),n},Ot=(e=>e?Ii(e):Ii),Ee=Ot(e=>({runs:{},selectedRunId:null,traces:{},logs:{},chatMessages:{},entrypoints:[],setRuns:t=>e(n=>{var s;let r=n.breakpoints;for(const o of t)(s=o.breakpoints)!=null&&s.length&&!r[o.id]&&(r={...r,[o.id]:Object.fromEntries(o.breakpoints.map(l=>[l,!0]))});const i={runs:Object.fromEntries(t.map(o=>[o.id,o]))};return r!==n.breakpoints&&(i.breakpoints=r),i}),upsertRun:t=>e(n=>{var i;const r={runs:{...n.runs,[t.id]:t}};if((i=t.breakpoints)!=null&&i.length&&!n.breakpoints[t.id]&&(r.breakpoints={...n.breakpoints,[t.id]:Object.fromEntries(t.breakpoints.map(s=>[s,!0]))}),(t.status==="completed"||t.status==="failed")&&n.activeNodes[t.id]){const{[t.id]:s,...o}=n.activeNodes;r.activeNodes=o}if(t.status!=="suspended"&&n.activeInterrupt[t.id]){const{[t.id]:s,...o}=n.activeInterrupt;r.activeInterrupt=o}return r}),selectRun:t=>e({selectedRunId:t}),addTrace:t=>e(n=>{const r=n.traces[t.run_id]??[],i=r.findIndex(o=>o.span_id===t.span_id),s=i>=0?r.map((o,l)=>l===i?t:o):[...r,t];return{traces:{...n.traces,[t.run_id]:s}}}),setTraces:(t,n)=>e(r=>({traces:{...r.traces,[t]:n}})),addLog:t=>e(n=>{const r=n.logs[t.run_id]??[];return{logs:{...n.logs,[t.run_id]:[...r,t]}}}),setLogs:(t,n)=>e(r=>({logs:{...r.logs,[t]:n}})),addChatEvent:(t,n)=>e(r=>{const i=r.chatMessages[t]??[],s=n.message;if(!s)return r;const o=s.messageId??s.message_id,l=s.role??"assistant",d=(s.contentParts??s.content_parts??[]).filter(b=>{const x=b.mimeType??b.mime_type??"";return x.startsWith("text/")||x==="application/json"}).map(b=>{const x=b.data;return(x==null?void 0:x.inline)??""}).join(` `).trim(),p=(s.toolCalls??s.tool_calls??[]).map(b=>({name:b.name??"",has_result:!!b.result})),m={message_id:o,role:l,content:d,tool_calls:p.length>0?p:void 0},f=i.findIndex(b=>b.message_id===o);if(f>=0)return{chatMessages:{...r.chatMessages,[t]:i.map((b,x)=>x===f?m:b)}};if(l==="user"){const b=i.findIndex(x=>x.message_id.startsWith("local-")&&x.role==="user"&&x.content===d);if(b>=0)return{chatMessages:{...r.chatMessages,[t]:i.map((x,y)=>y===b?m:x)}}}const h=[...i,m];return{chatMessages:{...r.chatMessages,[t]:h}}}),addLocalChatMessage:(t,n)=>e(r=>{const i=r.chatMessages[t]??[];return{chatMessages:{...r.chatMessages,[t]:[...i,n]}}}),setChatMessages:(t,n)=>e(r=>({chatMessages:{...r.chatMessages,[t]:n}})),setEntrypoints:t=>e({entrypoints:t}),breakpoints:{},toggleBreakpoint:(t,n)=>e(r=>{const i={...r.breakpoints[t]??{}};return i[n]?delete i[n]:i[n]=!0,{breakpoints:{...r.breakpoints,[t]:i}}}),clearBreakpoints:t=>e(n=>{const{[t]:r,...i}=n.breakpoints;return{breakpoints:i}}),activeNodes:{},setActiveNode:(t,n,r)=>e(i=>{const s=i.activeNodes[t]??{executing:{},prev:null};return{activeNodes:{...i.activeNodes,[t]:{executing:{...s.executing,[n]:r??null},prev:s.prev}}}}),removeActiveNode:(t,n)=>e(r=>{const i=r.activeNodes[t];if(!i)return r;const{[n]:s,...o}=i.executing;return{activeNodes:{...r.activeNodes,[t]:{executing:o,prev:n}}}}),resetRunGraphState:t=>e(n=>({stateEvents:{...n.stateEvents,[t]:[]},activeNodes:{...n.activeNodes,[t]:{executing:{},prev:null}}})),stateEvents:{},addStateEvent:(t,n,r,i,s)=>e(o=>{const l=o.stateEvents[t]??[];return{stateEvents:{...o.stateEvents,[t]:[...l,{node_name:n,qualified_node_name:i,phase:s,timestamp:Date.now(),payload:r}]}}}),setStateEvents:(t,n)=>e(r=>({stateEvents:{...r.stateEvents,[t]:n}})),focusedSpan:null,setFocusedSpan:t=>e({focusedSpan:t}),activeInterrupt:{},setActiveInterrupt:(t,n)=>e(r=>({activeInterrupt:{...r.activeInterrupt,[t]:n}})),reloadPending:!1,setReloadPending:t=>e({reloadPending:t}),graphCache:{},setGraphCache:(t,n)=>e(r=>({graphCache:{...r.graphCache,[t]:n}}))})),Yn="/api";async function Hl(e){const t=await fetch(`${Yn}/auth/login`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({environment:e})});if(!t.ok)throw new Error(`Login failed: ${t.status}`);return t.json()}async function cr(){const e=await fetch(`${Yn}/auth/status`);if(!e.ok)throw new Error(`Status check failed: ${e.status}`);return e.json()}async function Wl(e){const t=await fetch(`${Yn}/auth/select-tenant`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({tenant_name:e})});if(!t.ok)throw new Error(`Tenant selection failed: ${t.status}`);return t.json()}async function Kl(){await fetch(`${Yn}/auth/logout`,{method:"POST"})}const ys="uipath-env",Gl=["cloud","staging","alpha"];function ql(){const e=localStorage.getItem(ys);return Gl.includes(e)?e:"cloud"}const zn=Ot((e,t)=>({enabled:!0,status:"unauthenticated",environment:ql(),tenants:[],uipathUrl:null,pollTimer:null,expiryTimer:null,init:async()=>{try{const n=await fetch("/api/config");if(n.ok&&!(await n.json()).auth_enabled){e({enabled:!1});return}const r=await cr();e({status:r.status,tenants:r.tenants??[],uipathUrl:r.uipath_url??null}),r.status==="authenticated"&&t().startExpiryCheck()}catch(n){console.error("Auth init failed",n)}},setEnvironment:n=>{localStorage.setItem(ys,n),e({environment:n})},startLogin:async()=>{const{environment:n}=t();try{const r=await Hl(n);e({status:"pending"}),window.open(r.auth_url,"_blank"),t().pollStatus()}catch(r){console.error("Login failed",r)}},pollStatus:()=>{const{pollTimer:n}=t();if(n)return;const r=setInterval(async()=>{try{const i=await cr();i.status!=="pending"&&(t().stopPolling(),e({status:i.status,tenants:i.tenants??[],uipathUrl:i.uipath_url??null}),i.status==="authenticated"&&t().startExpiryCheck())}catch{}},2e3);e({pollTimer:r})},stopPolling:()=>{const{pollTimer:n}=t();n&&(clearInterval(n),e({pollTimer:null}))},startExpiryCheck:()=>{const{expiryTimer:n}=t();if(n)return;const r=setInterval(async()=>{try{(await cr()).status==="expired"&&(t().stopExpiryCheck(),e({status:"expired"}))}catch{}},3e4);e({expiryTimer:r})},stopExpiryCheck:()=>{const{expiryTimer:n}=t();n&&(clearInterval(n),e({expiryTimer:null}))},selectTenant:async n=>{try{const r=await Wl(n);e({status:"authenticated",uipathUrl:r.uipath_url,tenants:[]}),t().startExpiryCheck()}catch(r){console.error("Tenant selection failed",r)}},logout:async()=>{t().stopPolling(),t().stopExpiryCheck();try{await Kl()}catch{}e({status:"unauthenticated",tenants:[],uipathUrl:null})}})),vs=Ot(e=>({projectName:null,projectVersion:null,projectAuthors:null,init:async()=>{try{const t=await fetch("/api/config");if(t.ok){const n=await t.json();e({projectName:n.project_name??null,projectVersion:n.project_version??null,projectAuthors:n.project_authors??null})}}catch{}}}));class Vl{constructor(t){It(this,"ws",null);It(this,"url");It(this,"handlers",new Set);It(this,"reconnectTimer",null);It(this,"shouldReconnect",!0);It(this,"pendingMessages",[]);It(this,"activeSubscriptions",new Set);const n=window.location.protocol==="https:"?"wss:":"ws:";this.url=t??`${n}//${window.location.host}/ws`}connect(){var t;((t=this.ws)==null?void 0:t.readyState)!==WebSocket.OPEN&&(this.ws=new WebSocket(this.url),this.ws.onopen=()=>{console.log("[ws] connected");for(const n of this.activeSubscriptions)this.sendRaw(JSON.stringify({type:"subscribe",payload:{run_id:n}}));for(const n of this.pendingMessages)this.sendRaw(n);this.pendingMessages=[]},this.ws.onmessage=n=>{let r;try{r=JSON.parse(n.data)}catch{console.warn("[ws] failed to parse message",n.data);return}this.handlers.forEach(i=>{try{i(r)}catch(s){console.error("[ws] handler error",s)}})},this.ws.onclose=()=>{console.log("[ws] disconnected"),this.shouldReconnect&&(this.reconnectTimer=setTimeout(()=>this.connect(),2e3))},this.ws.onerror=()=>{var n;(n=this.ws)==null||n.close()})}disconnect(){var t;this.shouldReconnect=!1,this.reconnectTimer&&clearTimeout(this.reconnectTimer),(t=this.ws)==null||t.close(),this.ws=null}onMessage(t){return this.handlers.add(t),()=>this.handlers.delete(t)}sendRaw(t){var n;((n=this.ws)==null?void 0:n.readyState)===WebSocket.OPEN&&this.ws.send(t)}send(t,n){var i;const r=JSON.stringify({type:t,payload:n});((i=this.ws)==null?void 0:i.readyState)===WebSocket.OPEN?this.ws.send(r):this.pendingMessages.push(r)}subscribe(t){this.activeSubscriptions.add(t),this.send("subscribe",{run_id:t})}unsubscribe(t){this.activeSubscriptions.delete(t),this.send("unsubscribe",{run_id:t})}sendChatMessage(t,n){this.send("chat.message",{run_id:t,text:n})}sendInterruptResponse(t,n){this.send("chat.interrupt_response",{run_id:t,data:n})}debugStep(t){this.send("debug.step",{run_id:t})}debugContinue(t){this.send("debug.continue",{run_id:t})}debugStop(t){this.send("debug.stop",{run_id:t})}setBreakpoints(t,n){this.send("debug.set_breakpoints",{run_id:t,breakpoints:n})}sendAgentMessage(t,n,r,i){this.send("agent.message",{text:t,model:n,session_id:r??void 0,skill_ids:i&&i.length>0?i:void 0})}sendAgentStop(t){this.send("agent.stop",{session_id:t})}sendToolApproval(t,n,r){this.send("agent.tool_response",{session_id:t,tool_call_id:n,approved:r})}sendQuestionResponse(t,n,r){this.send("agent.question_response",{session_id:t,question_id:n,answer:r})}}const Me=Ot(e=>({evaluators:[],localEvaluators:[],evalSets:{},evalRuns:{},setEvaluators:t=>e({evaluators:t}),setLocalEvaluators:t=>e({localEvaluators:t}),addLocalEvaluator:t=>e(n=>({localEvaluators:[...n.localEvaluators,t]})),upsertLocalEvaluator:t=>e(n=>({localEvaluators:n.localEvaluators.some(r=>r.id===t.id)?n.localEvaluators.map(r=>r.id===t.id?t:r):[...n.localEvaluators,t]})),setEvalSets:t=>e({evalSets:Object.fromEntries(t.map(n=>[n.id,n]))}),addEvalSet:t=>e(n=>({evalSets:{...n.evalSets,[t.id]:t}})),updateEvalSetEvaluators:(t,n)=>e(r=>{const i=r.evalSets[t];return i?{evalSets:{...r.evalSets,[t]:{...i,evaluator_ids:n}}}:r}),incrementEvalSetCount:(t,n=1)=>e(r=>{const i=r.evalSets[t];return i?{evalSets:{...r.evalSets,[t]:{...i,eval_count:i.eval_count+n}}}:r}),setEvalRuns:t=>e({evalRuns:Object.fromEntries(t.map(n=>[n.id,n]))}),upsertEvalRun:t=>e(n=>({evalRuns:{...n.evalRuns,[t.id]:t}})),updateEvalRunProgress:(t,n,r)=>e(i=>{const s=i.evalRuns[t];return s?{evalRuns:{...i.evalRuns,[t]:{...s,progress_completed:n,progress_total:r,status:"running"}}}:i}),completeEvalRun:(t,n,r)=>e(i=>{const s=i.evalRuns[t];return s?{evalRuns:{...i.evalRuns,[t]:{...s,status:"completed",overall_score:n,evaluator_scores:r,end_time:new Date().toISOString()}}}:i})}));let Yl=0;function $t(){return`agent-msg-${++Yl}`}const ze=Ot(e=>({sessionId:null,status:"idle",_lastActiveAt:null,messages:[],plan:[],activeQuestion:null,models:[],selectedModel:null,modelsLoading:!1,skills:[],selectedSkillIds:[],skillsLoading:!1,setStatus:t=>e(n=>{const r=n.status==="thinking"||n.status==="planning"||n.status==="executing"||n.status==="awaiting_approval";return{status:t,_lastActiveAt:r&&!(t==="thinking"||t==="planning"||t==="executing"||t==="awaiting_approval")?Date.now():n._lastActiveAt}}),addUserMessage:t=>e(n=>({messages:[...n.messages,{id:$t(),role:"user",content:t,timestamp:Date.now()}]})),appendAssistantText:(t,n)=>e(r=>{const i=[...r.messages],s=i[i.length-1];return s&&s.role==="assistant"&&!s.done?i[i.length-1]={...s,content:s.content+t,done:n}:i.push({id:$t(),role:"assistant",content:t,timestamp:Date.now(),done:n}),{messages:i}}),setPlan:t=>e(n=>{const r=[...n.messages],i=r.findIndex(o=>o.role==="plan"),s={id:i>=0?r[i].id:$t(),role:"plan",content:"",timestamp:Date.now(),planItems:t};return i>=0?r[i]=s:r.push(s),{messages:r,plan:t}}),addToolUse:(t,n)=>e(r=>{const i=[...r.messages],s=i[i.length-1],o={tool:t,args:n};return s&&s.role==="tool"&&s.toolCalls?i[i.length-1]={...s,toolCalls:[...s.toolCalls,o]}:i.push({id:$t(),role:"tool",content:"",timestamp:Date.now(),toolCalls:[o]}),{messages:i}}),addToolResult:(t,n,r)=>e(i=>{const s=[...i.messages];for(let o=s.length-1;o>=0;o--){const l=s[o];if(l.role==="tool"&&l.toolCalls){const u=[...l.toolCalls];for(let c=u.length-1;c>=0;c--)if(u[c].tool===t&&u[c].result===void 0)return u[c]={...u[c],result:n,is_error:r},s[o]={...l,toolCalls:u},{messages:s}}}return{messages:s}}),addToolApprovalRequest:(t,n,r)=>e(i=>{const s=[...i.messages];for(let u=s.length-1;u>=0;u--){const c=s[u];if(c.role==="tool"&&c.toolCalls){const d=[...c.toolCalls];for(let p=d.length-1;p>=0;p--)if(d[p].tool===n&&!d[p].status&&d[p].result===void 0)return d[p]={...d[p],tool_call_id:t,status:"pending"},s[u]={...c,toolCalls:d},{messages:s}}if(c.role!=="tool")break}const o={tool:n,args:r,tool_call_id:t,status:"pending"},l=s[s.length-1];return l&&l.role==="tool"&&l.toolCalls?s[s.length-1]={...l,toolCalls:[...l.toolCalls,o]}:s.push({id:$t(),role:"tool",content:"",timestamp:Date.now(),toolCalls:[o]}),{messages:s}}),resolveToolApproval:(t,n)=>e(r=>{const i=[...r.messages];for(let s=i.length-1;s>=0;s--){const o=i[s];if(o.role==="tool"&&o.toolCalls){const l=[...o.toolCalls];for(let u=l.length-1;u>=0;u--)if(l[u].tool_call_id===t)return l[u]={...l[u],status:n?"approved":"denied"},i[s]={...o,toolCalls:l},{messages:i}}}return{messages:i}}),appendThinking:t=>e(n=>{const r=[...n.messages],i=r[r.length-1];return i&&i.role==="thinking"?r[r.length-1]={...i,content:i.content+t}:r.push({id:$t(),role:"thinking",content:t,timestamp:Date.now()}),{messages:r}}),addError:t=>e(n=>({status:"error",messages:[...n.messages,{id:$t(),role:"assistant",content:`Error: ${t}`,timestamp:Date.now(),done:!0}]})),setActiveQuestion:t=>e({activeQuestion:t}),setSessionId:t=>{sessionStorage.setItem("agent_session_id",t),e({sessionId:t})},setModels:t=>e({models:t}),setSelectedModel:t=>e({selectedModel:t}),setModelsLoading:t=>e({modelsLoading:t}),setSkills:t=>e({skills:t}),setSelectedSkillIds:t=>e({selectedSkillIds:t}),toggleSkill:t=>e(n=>({selectedSkillIds:n.selectedSkillIds.includes(t)?n.selectedSkillIds.filter(i=>i!==t):[...n.selectedSkillIds,t]})),setSkillsLoading:t=>e({skillsLoading:t}),hydrateSession:t=>e({sessionId:t.session_id,status:t.status||"done",messages:t.messages,plan:t.plan,selectedModel:t.model||null}),clearSession:()=>{sessionStorage.removeItem("agent_session_id"),e({sessionId:null,status:"idle",_lastActiveAt:null,messages:[],plan:[],activeQuestion:null})}})),be=Ot(e=>({children:{},expanded:{},selectedFile:null,openTabs:[],fileCache:{},dirty:{},buffers:{},loadingDirs:{},loadingFile:!1,agentChangedFiles:{},diffView:null,setChildren:(t,n)=>e(r=>({children:{...r.children,[t]:n}})),toggleExpanded:t=>e(n=>({expanded:{...n.expanded,[t]:!n.expanded[t]}})),setSelectedFile:t=>e({selectedFile:t}),openTab:t=>e(n=>({selectedFile:t,openTabs:n.openTabs.includes(t)?n.openTabs:[...n.openTabs,t]})),closeTab:t=>e(n=>{const r=n.openTabs.filter(c=>c!==t);let i=n.selectedFile;if(i===t){const c=n.openTabs.indexOf(t);i=r[Math.min(c,r.length-1)]??null}const{[t]:s,...o}=n.dirty,{[t]:l,...u}=n.buffers;return{openTabs:r,selectedFile:i,dirty:o,buffers:u}}),setFileContent:(t,n)=>e(r=>({fileCache:{...r.fileCache,[t]:n}})),updateBuffer:(t,n)=>e(r=>({buffers:{...r.buffers,[t]:n},dirty:{...r.dirty,[t]:!0}})),markClean:t=>e(n=>{const{[t]:r,...i}=n.dirty,{[t]:s,...o}=n.buffers;return{dirty:i,buffers:o}}),setLoadingDir:(t,n)=>e(r=>({loadingDirs:{...r.loadingDirs,[t]:n}})),setLoadingFile:t=>e({loadingFile:t}),markAgentChanged:t=>e(n=>({agentChangedFiles:{...n.agentChangedFiles,[t]:Date.now()}})),clearAgentChanged:t=>e(n=>{const{[t]:r,...i}=n.agentChangedFiles;return{agentChangedFiles:i}}),setDiffView:t=>e({diffView:t}),expandPath:t=>e(n=>{const r=t.split("/"),i={...n.expanded};for(let s=1;se.current.onMessage(x=>{var y,w;switch(x.type){case"run.updated":t(x.payload);break;case"trace":n(x.payload);break;case"log":r(x.payload);break;case"chat":{const T=x.payload.run_id;i(T,x.payload);break}case"chat.interrupt":{const T=x.payload.run_id;s(T,x.payload);break}case"state":{const T=x.payload.run_id,j=x.payload.node_name,O=x.payload.qualified_node_name??null,_=x.payload.phase??null,P=x.payload.payload;j==="__start__"&&_==="started"&&u(T),_==="started"?o(T,j,O):_==="completed"&&l(T,j),c(T,j,P,O,_);break}case"reload":d(!0);break;case"files.changed":{const T=x.payload.files,j=new Set(T),O=be.getState(),_=ze.getState(),P=_.status,D=P==="thinking"||P==="planning"||P==="executing"||P==="awaiting_approval",R=!D&&_._lastActiveAt!=null&&Date.now()-_._lastActiveAt<3e3,S=T.filter(L=>L in O.children?!1:(L.split("/").pop()??"").includes("."));if(console.log("[files.changed]",{all:T,files:S,agentStatus:P,agentIsActive:D,recentlyActive:R}),D||R){let L=!1;for(const C of S){if(O.dirty[C])continue;const v=((y=O.fileCache[C])==null?void 0:y.content)??null,E=((w=O.fileCache[C])==null?void 0:w.language)??null;Lr(C).then(I=>{const H=be.getState();if(H.dirty[C])return;H.setFileContent(C,I),H.expandPath(C);const U=C.split("/");for(let g=1;gbe.getState().setChildren(F,$)).catch(()=>{})}const V=be.getState().openTabs.includes(C);!L&&V&&v!==null&&I.content!==null&&v!==I.content&&(L=!0,be.getState().setSelectedFile(C),H.setDiffView({path:C,original:v,modified:I.content,language:E}),setTimeout(()=>{const g=be.getState().diffView;g&&g.path===C&&g.original===v&&be.getState().setDiffView(null)},5e3)),H.markAgentChanged(C),setTimeout(()=>be.getState().clearAgentChanged(C),1e4)}).catch(()=>{const I=be.getState();I.openTabs.includes(C)&&I.closeTab(C)})}}else for(const L of O.openTabs)O.dirty[L]||!j.has(L)||Lr(L).then(C=>{var E;const v=be.getState();v.dirty[L]||((E=v.fileCache[L])==null?void 0:E.content)!==C.content&&v.setFileContent(L,C)}).catch(()=>{});const M=new Set;for(const L of T){const C=L.lastIndexOf("/"),v=C===-1?"":L.substring(0,C);v in O.children&&M.add(v)}for(const L of M)$n(L).then(C=>be.getState().setChildren(L,C)).catch(()=>{});break}case"eval_run.created":p(x.payload);break;case"eval_run.progress":{const{run_id:T,completed:j,total:O,item_result:_}=x.payload;m(T,j,O,_);break}case"eval_run.completed":{const{run_id:T,overall_score:j,evaluator_scores:O}=x.payload;f(T,j,O);break}case"agent.status":{const{session_id:T,status:j}=x.payload,O=ze.getState();O.sessionId||O.setSessionId(T),O.setStatus(j),(j==="done"||j==="error"||j==="idle")&&O.setActiveQuestion(null);break}case"agent.text":{const{session_id:T,content:j,done:O}=x.payload,_=ze.getState();_.sessionId||_.setSessionId(T),_.appendAssistantText(j,O);break}case"agent.plan":{const{session_id:T,items:j}=x.payload,O=ze.getState();O.sessionId||O.setSessionId(T),O.setPlan(j);break}case"agent.tool_use":{const{session_id:T,tool:j,args:O}=x.payload,_=ze.getState();_.sessionId||_.setSessionId(T),_.addToolUse(j,O);break}case"agent.tool_result":{const{tool:T,result:j,is_error:O}=x.payload;ze.getState().addToolResult(T,j,O);break}case"agent.tool_approval":{const{session_id:T,tool_call_id:j,tool:O,args:_}=x.payload,P=ze.getState();P.sessionId||P.setSessionId(T),P.addToolApprovalRequest(j,O,_);break}case"agent.thinking":{const{content:T}=x.payload;ze.getState().appendThinking(T);break}case"agent.text_delta":{const{session_id:T,delta:j}=x.payload,O=ze.getState();O.sessionId||O.setSessionId(T),O.appendAssistantText(j,!1);break}case"agent.question":{const{session_id:T,question_id:j,question:O,options:_}=x.payload,P=ze.getState();P.sessionId||P.setSessionId(T),P.setActiveQuestion({question_id:j,question:O,options:_});break}case"agent.token_usage":break;case"agent.error":{const{message:T}=x.payload;ze.getState().addError(T);break}}}),[t,n,r,i,s,o,l,u,c,d,p,m,f]),e.current}const Lt="/api";async function jt(e,t){const n=await fetch(e,t);if(!n.ok){let r;try{r=(await n.json()).detail||n.statusText}catch{r=n.statusText}const i=new Error(`HTTP ${n.status}`);throw i.detail=r,i.status=n.status,i}return n.json()}async function ks(){return jt(`${Lt}/entrypoints`)}async function Jl(e){return jt(`${Lt}/entrypoints/${encodeURIComponent(e)}/schema`)}async function Ql(e){return jt(`${Lt}/entrypoints/${encodeURIComponent(e)}/mock-input`)}async function ec(e){return jt(`${Lt}/entrypoints/${encodeURIComponent(e)}/graph`)}async function Ri(e,t,n="run",r=[]){return jt(`${Lt}/runs`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({entrypoint:e,input_data:t,mode:n,breakpoints:r})})}async function tc(){return jt(`${Lt}/runs`)}async function ur(e){return jt(`${Lt}/runs/${e}`)}async function nc(){return jt(`${Lt}/reload`,{method:"POST"})}function rc(e){const t=e.replace(/^#\/?/,""),n={section:"debug",view:"new",runId:null,tab:"traces",setupEntrypoint:null,setupMode:null,evalCreating:!1,evalSetId:null,evalRunId:null,evalRunItemName:null,evaluatorId:null,evaluatorCreateType:null,evaluatorFilter:null,explorerFile:null};if(!t||t==="new"||t==="debug"||t==="debug/new")return n;const r=t.match(/^(?:debug\/)?setup\/([^/]+)\/(run|chat)$/);if(r)return{...n,view:"setup",setupEntrypoint:decodeURIComponent(r[1]),setupMode:r[2]};const i=t.match(/^(?:debug\/)?runs\/([^/]+)(?:\/(traces|output))?$/);if(i)return{...n,view:"details",runId:i[1],tab:i[2]??"traces"};if(t==="evals/new")return{...n,section:"evals",evalCreating:!0};const s=t.match(/^evals\/runs\/([^/]+?)(?:\/([^/]+))?$/);if(s)return{...n,section:"evals",evalRunId:s[1],evalRunItemName:s[2]?decodeURIComponent(s[2]):null};const o=t.match(/^evals\/sets\/([^/]+)$/);if(o)return{...n,section:"evals",evalSetId:o[1]};if(t==="evals")return{...n,section:"evals"};const l=t.match(/^evaluators\/new(?:\/(deterministic|llm|tool))?$/);if(l)return{...n,section:"evaluators",evaluatorCreateType:l[1]??"any"};const u=t.match(/^evaluators\/category\/(deterministic|llm|tool)$/);if(u)return{...n,section:"evaluators",evaluatorFilter:u[1]};const c=t.match(/^evaluators\/([^/]+)$/);if(c)return{...n,section:"evaluators",evaluatorId:c[1]};if(t==="evaluators")return{...n,section:"evaluators"};const d=t.match(/^explorer\/file\/(.+)$/);return d?{...n,section:"explorer",explorerFile:decodeURIComponent(d[1])}:t==="explorer"?{...n,section:"explorer"}:n}function ic(){return window.location.hash}function oc(e){return window.addEventListener("hashchange",e),()=>window.removeEventListener("hashchange",e)}function st(){const e=N.useSyncExternalStore(oc,ic),t=rc(e),n=N.useCallback(r=>{window.location.hash=r},[]);return{...t,navigate:n}}const Oi="(max-width: 767px)";function sc(){const[e,t]=N.useState(()=>window.matchMedia(Oi).matches);return N.useEffect(()=>{const n=window.matchMedia(Oi),r=i=>t(i.matches);return n.addEventListener("change",r),()=>n.removeEventListener("change",r)},[]),e}const ac=[{section:"debug",label:"Developer Console",icon:a.jsxs("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",children:[a.jsx("rect",{x:"8",y:"6",width:"8",height:"14",rx:"4"}),a.jsx("path",{d:"M6 10H4"}),a.jsx("path",{d:"M6 18H4"}),a.jsx("path",{d:"M18 10h2"}),a.jsx("path",{d:"M18 18h2"}),a.jsx("path",{d:"M8 14h8"}),a.jsx("path",{d:"M9 6l-1.5-2"}),a.jsx("path",{d:"M15 6l1.5-2"}),a.jsx("path",{d:"M6 14H4"}),a.jsx("path",{d:"M18 14h2"})]})},{section:"evals",label:"Evals",icon:a.jsxs("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",children:[a.jsx("path",{d:"M9 3h6"}),a.jsx("path",{d:"M10 3v6.5L5 20a1 1 0 0 0 .9 1.4h12.2a1 1 0 0 0 .9-1.4L14 9.5V3"}),a.jsx("path",{d:"M8.5 14h7"})]})},{section:"evaluators",label:"Evaluators",icon:a.jsxs("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",children:[a.jsx("path",{d:"M12 2l7 4v5c0 5.25-3.5 9.74-7 11-3.5-1.26-7-5.75-7-11V6l7-4z"}),a.jsx("path",{d:"M9 12l2 2 4-4"})]})},{section:"explorer",label:"Explorer",icon:a.jsx("svg",{width:"20",height:"20",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",fill:"currentColor",children:a.jsx("path",{d:"M7.5 22.5H17.595C17.07 23.4 16.11 24 15 24H7.5C4.185 24 1.5 21.315 1.5 18V6C1.5 4.89 2.1 3.93 3 3.405V18C3 20.475 5.025 22.5 7.5 22.5ZM21 8.121V18C21 19.6545 19.6545 21 18 21H7.5C5.8455 21 4.5 19.6545 4.5 18V3C4.5 1.3455 5.8455 0 7.5 0H12.879C13.4715 0 14.0505 0.24 14.4705 0.6585L20.3415 6.5295C20.766 6.954 21 7.5195 21 8.121ZM13.5 6.75C13.5 7.164 13.8375 7.5 14.25 7.5H19.1895L13.5 1.8105V6.75ZM19.5 18V9H14.25C13.0095 9 12 7.9905 12 6.75V1.5H7.5C6.672 1.5 6 2.1735 6 3V18C6 18.8265 6.672 19.5 7.5 19.5H18C18.828 19.5 19.5 18.8265 19.5 18Z"})})}];function lc({section:e,onSectionChange:t}){return a.jsx("div",{className:"w-12 flex flex-col items-center shrink-0 border-r",style:{background:"var(--activity-bar-bg)",borderColor:"var(--border)"},children:a.jsx("div",{className:"flex flex-col items-center gap-1 pt-2",children:ac.map(n=>{const r=e===n.section;return a.jsxs("button",{onClick:()=>t(n.section),className:"w-10 h-10 flex items-center justify-center rounded cursor-pointer transition-colors relative",style:{color:r?"var(--text-primary)":"var(--text-muted)",background:r?"var(--bg-hover)":"transparent",border:"none"},title:n.label,onMouseEnter:i=>{r||(i.currentTarget.style.color="var(--text-secondary)")},onMouseLeave:i=>{r||(i.currentTarget.style.color="var(--text-muted)")},children:[r&&a.jsx("div",{className:"absolute left-0 top-1.5 bottom-1.5 w-0.5 rounded-r",style:{background:"var(--accent)"}}),n.icon]},n.section)})})})}const tt="/api";async function nt(e,t){const n=await fetch(e,t);if(!n.ok){let r;try{r=(await n.json()).detail||n.statusText}catch{r=n.statusText}const i=new Error(`HTTP ${n.status}`);throw i.detail=r,i.status=n.status,i}return n.json()}async function cc(){return nt(`${tt}/evaluators`)}async function Es(){return nt(`${tt}/eval-sets`)}async function uc(e){return nt(`${tt}/eval-sets`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)})}async function dc(e,t){return nt(`${tt}/eval-sets/${encodeURIComponent(e)}/items`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)})}async function pc(e,t){await nt(`${tt}/eval-sets/${encodeURIComponent(e)}/items/${encodeURIComponent(t)}`,{method:"DELETE"})}async function fc(e){return nt(`${tt}/eval-sets/${encodeURIComponent(e)}`)}async function mc(e){return nt(`${tt}/eval-sets/${encodeURIComponent(e)}/runs`,{method:"POST"})}async function gc(){return nt(`${tt}/eval-runs`)}async function Li(e){return nt(`${tt}/eval-runs/${encodeURIComponent(e)}`)}async function Qr(){return nt(`${tt}/local-evaluators`)}async function hc(e){return nt(`${tt}/local-evaluators`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)})}async function bc(e,t){return nt(`${tt}/eval-sets/${encodeURIComponent(e)}/evaluators`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({evaluator_refs:t})})}async function xc(e,t){return nt(`${tt}/local-evaluators/${encodeURIComponent(e)}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)})}const yc={"uipath-exact-match":e=>({expectedOutput:e}),"uipath-json-similarity":e=>({expectedOutput:e}),"uipath-contains":()=>({searchText:""}),"uipath-llm-judge-output-semantic-similarity":e=>({expectedOutput:e}),"uipath-llm-judge-output-strict-json-similarity":e=>({expectedOutput:e}),"uipath-llm-judge-trajectory-similarity":()=>({expectedAgentBehavior:""}),"uipath-llm-judge-trajectory-simulation":()=>({expectedAgentBehavior:""}),"uipath-tool-call-count":()=>({}),"uipath-tool-call-args":()=>({}),"uipath-tool-call-order":()=>({}),"uipath-tool-call-output":()=>({})};function vc(e,t){if(!e)return{};const n=yc[e.evaluator_type_id];return n?n(t):e.type==="tool"?{}:e.evaluator_type_id.includes("trajectory")?{expectedAgentBehavior:""}:{expectedOutput:t}}function ws(e){return e?e.type==="tool"?!0:e.evaluator_type_id.includes("tool-call"):!1}function kc(e){return e?ws(e)?{label:"tools",color:"var(--warning, #e5a00d)"}:e.evaluator_type_id.includes("trajectory")?{label:"quality",color:"var(--info, #3b82f6)"}:{label:"output",color:"var(--success, #22c55e)"}:{label:"output",color:"var(--success, #22c55e)"}}function Ec({run:e,onClose:t}){const n=Me(R=>R.evalSets),r=Me(R=>R.setEvalSets),i=Me(R=>R.incrementEvalSetCount),s=Me(R=>R.localEvaluators),o=Me(R=>R.setLocalEvaluators),[l,u]=N.useState(`run-${e.id.slice(0,8)}`),[c,d]=N.useState(new Set),[p,m]=N.useState({}),f=N.useRef(new Set),[h,b]=N.useState(!1),[x,y]=N.useState(null),[w,T]=N.useState(!1),j=Object.values(n),O=N.useMemo(()=>Object.fromEntries(s.map(R=>[R.id,R])),[s]),_=N.useMemo(()=>{const R=new Set;for(const S of c){const M=n[S];M&&M.evaluator_ids.forEach(L=>R.add(L))}return[...R]},[c,n]);N.useEffect(()=>{const R=e.output_data,S=f.current;m(M=>{const L={};for(const C of _)if(S.has(C)&&M[C]!==void 0)L[C]=M[C];else{const v=O[C],E=vc(v,R);L[C]=JSON.stringify(E,null,2)}return L})},[_,O,e.output_data]),N.useEffect(()=>{const R=S=>{S.key==="Escape"&&t()};return document.addEventListener("keydown",R),()=>document.removeEventListener("keydown",R)},[t]),N.useEffect(()=>{j.length===0&&Es().then(r).catch(()=>{}),s.length===0&&Qr().then(o).catch(()=>{})},[]);const P=R=>{d(S=>{const M=new Set(S);return M.has(R)?M.delete(R):M.add(R),M})},D=async()=>{var S;if(!l.trim()||c.size===0)return;y(null),b(!0);const R={};for(const M of _){const L=p[M];if(L!==void 0)try{R[M]=JSON.parse(L)}catch{y(`Invalid JSON for evaluator "${((S=O[M])==null?void 0:S.name)??M}"`),b(!1);return}}try{for(const M of c){const L=n[M],C=new Set((L==null?void 0:L.evaluator_ids)??[]),v={};for(const[E,I]of Object.entries(R))C.has(E)&&(v[E]=I);await dc(M,{name:l.trim(),inputs:e.input_data,expected_output:null,evaluation_criterias:v}),i(M)}T(!0),setTimeout(t,3e3)}catch(M){y(M.detail||M.message||"Failed to add item")}finally{b(!1)}};return a.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center",style:{background:"rgba(0, 0, 0, 0.5)"},onClick:R=>{R.target===R.currentTarget&&t()},children:a.jsxs("div",{className:"w-full max-w-2xl rounded-lg p-6 shadow-xl max-h-[85vh] flex flex-col",style:{background:"var(--bg-primary)",border:"1px solid var(--border)"},children:[a.jsxs("div",{className:"flex items-center justify-between mb-6",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("div",{className:"w-1.5 h-1.5 rounded-full",style:{background:"var(--accent)"}}),a.jsx("span",{className:"text-sm font-semibold",style:{color:"var(--text-muted)"},children:"Add to Eval Set"})]}),a.jsx("button",{onClick:t,className:"w-7 h-7 flex items-center justify-center rounded cursor-pointer transition-colors",style:{color:"var(--text-muted)",background:"transparent",border:"none"},onMouseEnter:R=>{R.currentTarget.style.color="var(--text-primary)"},onMouseLeave:R=>{R.currentTarget.style.color="var(--text-muted)"},"aria-label":"Close",children:a.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",children:[a.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),a.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})]}),a.jsxs("div",{className:"flex-1 overflow-y-auto min-h-0 space-y-4 pr-1",children:[a.jsxs("div",{children:[a.jsx("label",{className:"block text-[11px] font-medium mb-1.5",style:{color:"var(--text-muted)"},children:"Item Name"}),a.jsx("input",{type:"text",value:l,onChange:R=>u(R.target.value),className:"w-full rounded-md px-3 py-2 text-xs",style:{background:"var(--bg-secondary)",border:"1px solid var(--border)",color:"var(--text-primary)"}})]}),a.jsxs("div",{children:[a.jsx("label",{className:"block text-[11px] font-medium mb-1.5",style:{color:"var(--text-muted)"},children:"Inputs"}),a.jsx("pre",{className:"rounded-md px-3 py-2 text-xs font-mono whitespace-pre-wrap break-words max-h-32 overflow-y-auto",style:{background:"var(--bg-secondary)",border:"1px solid var(--border)",color:"var(--text-secondary)"},children:JSON.stringify(e.input_data,null,2)})]}),a.jsxs("div",{children:[a.jsx("label",{className:"block text-[11px] font-medium mb-1.5",style:{color:"var(--text-muted)"},children:"Eval Sets"}),j.length===0?a.jsx("p",{className:"text-xs",style:{color:"var(--text-muted)"},children:"No eval sets found. Create one first."}):a.jsx("div",{className:"rounded-md border overflow-hidden max-h-40 overflow-y-auto",style:{borderColor:"var(--border)",background:"var(--bg-secondary)"},children:j.map(R=>a.jsxs("label",{className:"flex items-center gap-2.5 px-3 py-2 text-xs cursor-pointer transition-colors",style:{borderBottom:"1px solid var(--border)"},onMouseEnter:S=>{S.currentTarget.style.background="var(--bg-hover)"},onMouseLeave:S=>{S.currentTarget.style.background="transparent"},children:[a.jsx("input",{type:"checkbox",checked:c.has(R.id),onChange:()=>P(R.id),className:"accent-[var(--accent)]"}),a.jsx("span",{className:"flex-1 truncate",style:{color:"var(--text-primary)"},children:R.name}),a.jsxs("span",{className:"text-[10px]",style:{color:"var(--text-muted)"},children:[R.eval_count," items"]})]},R.id))})]}),_.length>0&&a.jsxs("div",{children:[a.jsx("label",{className:"block text-[11px] font-medium mb-1.5",style:{color:"var(--text-muted)"},children:"Evaluation Criteria"}),a.jsx("div",{className:"space-y-2",children:_.map(R=>{const S=O[R],M=ws(S),L=kc(S);return a.jsxs("div",{className:"rounded-md",style:{border:"1px solid var(--border)",background:"var(--bg-primary)",opacity:M?.6:1},children:[a.jsxs("div",{className:"flex items-center gap-2 px-3 py-2",style:{borderBottom:M?"none":"1px solid var(--border)"},children:[a.jsx("span",{className:"text-xs font-medium truncate flex-1",style:{color:"var(--text-primary)"},children:(S==null?void 0:S.name)??R}),a.jsx("span",{className:"text-[10px] px-1.5 py-0.5 rounded-full font-medium",style:{color:L.color,background:`color-mix(in srgb, ${L.color} 12%, transparent)`},children:L.label})]}),M?a.jsx("div",{className:"px-3 pb-2",children:a.jsx("span",{className:"text-[10px] italic",style:{color:"var(--text-muted)"},children:"Default criteria — uses evaluator config"})}):a.jsx("div",{className:"px-3 pb-2 pt-1",children:a.jsx("textarea",{value:p[R]??"{}",onChange:C=>{f.current.add(R),m(v=>({...v,[R]:C.target.value}))},rows:8,className:"w-full rounded px-2 py-1.5 text-xs font-mono resize-y",style:{background:"var(--bg-secondary)",border:"1px solid var(--border)",color:"var(--text-primary)"}})})]},R)})})]})]}),a.jsxs("div",{className:"mt-4 space-y-3",children:[x&&a.jsx("p",{className:"text-xs px-3 py-2 rounded",style:{color:"var(--error)",background:"color-mix(in srgb, var(--error) 10%, var(--bg-secondary))"},children:x}),w&&a.jsxs("p",{className:"text-xs px-3 py-2 rounded",style:{color:"var(--success)",background:"color-mix(in srgb, var(--success) 10%, var(--bg-secondary))"},children:["Added to ",c.size," eval set",c.size!==1?"s":"","."]}),a.jsxs("div",{className:"flex gap-2",children:[a.jsx("button",{onClick:t,className:"flex-1 py-2 rounded-md text-xs font-semibold cursor-pointer",style:{background:"var(--bg-secondary)",color:"var(--text-secondary)",border:"1px solid var(--border)"},children:"Cancel"}),a.jsx("button",{onClick:D,disabled:!l.trim()||c.size===0||h||w,className:"flex-1 py-2 rounded-md text-[13px] font-semibold transition-colors cursor-pointer disabled:opacity-40 disabled:cursor-not-allowed",style:{background:"var(--accent)",color:"var(--bg-primary)",border:"none"},children:h?"Adding...":w?"Added":"Add Item"})]})]})]})})}const wc={pending:"var(--text-muted)",running:"var(--warning)",suspended:"var(--info)",completed:"var(--success)",failed:"var(--error)"};function _c({run:e,isSelected:t,onClick:n}){var p;const r=wc[e.status]??"var(--text-muted)",i=((p=e.entrypoint.split("/").pop())==null?void 0:p.slice(0,16))??e.entrypoint,s=e.start_time?new Date(e.start_time).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"}):"",[o,l]=N.useState(!1),[u,c]=N.useState(!1),d=N.useRef(null);return N.useEffect(()=>{if(!o)return;const m=f=>{d.current&&!d.current.contains(f.target)&&l(!1)};return document.addEventListener("mousedown",m),()=>document.removeEventListener("mousedown",m)},[o]),a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"group relative w-full text-left px-3 py-1.5 flex items-center gap-2 transition-colors cursor-pointer",style:{background:t?"color-mix(in srgb, var(--accent) 15%, var(--bg-primary))":void 0,borderLeft:t?"3px solid var(--accent)":"3px solid transparent"},onMouseEnter:m=>{t||(m.currentTarget.style.background="var(--bg-hover)")},onMouseLeave:m=>{t||(m.currentTarget.style.background="")},onClick:n,children:[a.jsx("span",{className:"shrink-0 w-2 h-2 rounded-full",style:{background:r}}),a.jsxs("div",{className:"flex-1 min-w-0",children:[a.jsx("div",{className:"text-xs truncate",style:{color:t?"var(--text-primary)":"var(--text-secondary)"},children:i}),a.jsxs("div",{className:"text-[11px] tabular-nums",style:{color:"var(--text-muted)"},children:[s,e.duration?` · ${e.duration}`:""]})]}),e.status==="completed"&&a.jsxs("div",{ref:d,className:"relative shrink-0",children:[a.jsx("button",{onClick:m=>{m.stopPropagation(),l(f=>!f)},className:"opacity-40 group-hover:opacity-100 focus:opacity-100 w-7 h-7 flex items-center justify-center rounded transition-opacity cursor-pointer",style:{color:"var(--text-muted)"},onMouseEnter:m=>{m.currentTarget.style.color="var(--text-primary)",m.currentTarget.style.background="var(--bg-secondary)"},onMouseLeave:m=>{m.currentTarget.style.color="var(--text-muted)",m.currentTarget.style.background=""},"aria-label":"Actions",title:"Actions",children:a.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 16 16",fill:"currentColor",children:[a.jsx("circle",{cx:"8",cy:"3",r:"1.5"}),a.jsx("circle",{cx:"8",cy:"8",r:"1.5"}),a.jsx("circle",{cx:"8",cy:"13",r:"1.5"})]})}),o&&a.jsx("div",{className:"absolute right-0 top-full mt-1 z-50 min-w-[140px] rounded-md shadow-lg py-1",style:{background:"var(--bg-primary)",border:"1px solid var(--border)"},children:a.jsx("button",{onClick:m=>{m.stopPropagation(),l(!1),c(!0)},className:"w-full text-left px-3 py-1.5 text-xs cursor-pointer transition-colors",style:{color:"var(--text-secondary)"},onMouseEnter:m=>{m.currentTarget.style.background="var(--bg-hover)",m.currentTarget.style.color="var(--text-primary)"},onMouseLeave:m=>{m.currentTarget.style.background="",m.currentTarget.style.color="var(--text-secondary)"},children:"Add to Eval Set"})})]})]}),u&&a.jsx(Ec,{run:e,onClose:()=>c(!1)})]})}function ji({runs:e,selectedRunId:t,onSelectRun:n,onNewRun:r}){const i=[...e].sort((s,o)=>new Date(o.start_time??0).getTime()-new Date(s.start_time??0).getTime());return a.jsxs(a.Fragment,{children:[a.jsx("button",{onClick:r,className:"mx-3 mt-2.5 mb-1 px-3 py-1.5 text-[11px] font-medium rounded border border-[var(--border)] bg-transparent transition-colors cursor-pointer",style:{color:"var(--text-secondary)"},onMouseEnter:s=>{s.currentTarget.style.color="var(--text-primary)",s.currentTarget.style.borderColor="var(--text-muted)"},onMouseLeave:s=>{s.currentTarget.style.color="var(--text-secondary)",s.currentTarget.style.borderColor=""},children:"+ New Run"}),a.jsx("div",{className:"px-3 pt-3 pb-1 text-[11px] uppercase tracking-widest font-semibold",style:{color:"var(--text-muted)"},children:"History"}),a.jsxs("div",{className:"flex-1 overflow-y-auto",children:[i.map(s=>a.jsx(_c,{run:s,isSelected:s.id===t,onClick:()=>n(s.id)},s.id)),i.length===0&&a.jsx("p",{className:"text-xs px-3 py-4 text-center",style:{color:"var(--text-muted)"},children:"No runs yet"})]})]})}function _s(){const e=localStorage.getItem("uipath-dev-theme");return e==="light"||e==="dark"?e:"dark"}function Ns(e){document.documentElement.setAttribute("data-theme",e),localStorage.setItem("uipath-dev-theme",e)}Ns(_s());const Ss=Ot(e=>({theme:_s(),toggleTheme:()=>e(t=>{const n=t.theme==="dark"?"light":"dark";return Ns(n),{theme:n}})}));function Di(){const{theme:e,toggleTheme:t}=Ss(),{enabled:n,status:r,environment:i,tenants:s,uipathUrl:o,setEnvironment:l,startLogin:u,selectTenant:c,logout:d}=zn(),{projectName:p,projectVersion:m,projectAuthors:f}=vs(),[h,b]=N.useState(!1),[x,y]=N.useState(""),w=N.useRef(null),T=N.useRef(null);N.useEffect(()=>{if(!h)return;const v=E=>{w.current&&!w.current.contains(E.target)&&T.current&&!T.current.contains(E.target)&&b(!1)};return document.addEventListener("mousedown",v),()=>document.removeEventListener("mousedown",v)},[h]);const j=r==="authenticated",O=r==="expired",_=r==="pending",P=r==="needs_tenant";let D="UiPath: Disconnected",R=null,S=!0;j?(D=`UiPath: ${o?o.replace(/^https?:\/\/[^/]+\//,""):""}`,R="var(--success)",S=!1):O?(D=`UiPath: ${o?o.replace(/^https?:\/\/[^/]+\//,""):""} (expired)`,R="var(--error)",S=!1):_?D="UiPath: Signing in…":P&&(D="UiPath: Select Tenant");const M=()=>{_||(O?u():b(v=>!v))},L="flex items-center gap-1 px-1.5 rounded transition-colors",C={onMouseEnter:v=>{v.currentTarget.style.background="var(--bg-hover)",v.currentTarget.style.color="var(--text-primary)"},onMouseLeave:v=>{v.currentTarget.style.background="",v.currentTarget.style.color="var(--text-muted)"}};return a.jsxs("div",{className:"h-6 flex items-center justify-end gap-3 px-2 text-xs border-t shrink-0",style:{background:"var(--bg-secondary)",color:"var(--text-muted)",borderColor:"var(--border)",fontSize:"11px"},children:[n&&a.jsxs("div",{className:"relative flex items-center",children:[a.jsxs("div",{ref:T,className:`${L} cursor-pointer`,onClick:M,...C,title:j?o??"":O?"Token expired — click to re-authenticate":_?"Signing in…":P?"Select a tenant":"Click to sign in",children:[_?a.jsxs("svg",{className:"animate-spin",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[a.jsx("circle",{cx:"12",cy:"12",r:"10",strokeOpacity:"0.25"}),a.jsx("path",{d:"M12 2a10 10 0 0 1 10 10",strokeLinecap:"round"})]}):R?a.jsx("div",{className:"w-2 h-2 rounded-full flex-shrink-0",style:{background:R}}):S?a.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[a.jsx("rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2"}),a.jsx("path",{d:"M7 11V7a5 5 0 0 1 9.9-1"})]}):null,a.jsx("span",{className:"truncate max-w-[200px]",children:D})]}),h&&a.jsx("div",{ref:w,className:"absolute bottom-full right-0 mb-1 rounded border shadow-lg p-1 min-w-[180px]",style:{background:"var(--bg-secondary)",borderColor:"var(--border)"},children:j||O?a.jsxs(a.Fragment,{children:[a.jsxs("button",{onClick:()=>{o&&window.open(o,"_blank","noopener,noreferrer"),b(!1)},className:"w-full flex items-center gap-2 px-2 py-2 text-[11px] rounded cursor-pointer transition-colors text-left",style:{color:"var(--text-muted)",background:"transparent",border:"none"},onMouseEnter:v=>{v.currentTarget.style.background="var(--bg-hover)",v.currentTarget.style.color="var(--text-primary)"},onMouseLeave:v=>{v.currentTarget.style.background="transparent",v.currentTarget.style.color="var(--text-muted)"},children:[a.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[a.jsx("path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6"}),a.jsx("polyline",{points:"15 3 21 3 21 9"}),a.jsx("line",{x1:"10",y1:"14",x2:"21",y2:"3"})]}),"Go to Platform"]}),a.jsxs("button",{onClick:()=>{d(),b(!1)},className:"w-full flex items-center gap-2 px-2 py-2 text-[11px] rounded cursor-pointer transition-colors text-left",style:{color:"var(--text-muted)",background:"transparent",border:"none"},onMouseEnter:v=>{v.currentTarget.style.background="var(--bg-hover)",v.currentTarget.style.color="var(--text-primary)"},onMouseLeave:v=>{v.currentTarget.style.background="transparent",v.currentTarget.style.color="var(--text-muted)"},children:[a.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[a.jsx("path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4"}),a.jsx("polyline",{points:"16 17 21 12 16 7"}),a.jsx("line",{x1:"21",y1:"12",x2:"9",y2:"12"})]}),"Sign Out"]})]}):P?a.jsxs("div",{className:"p-1",children:[a.jsx("label",{className:"block text-[10px] font-medium mb-1",style:{color:"var(--text-muted)"},children:"Tenant"}),a.jsxs("select",{value:x,onChange:v=>y(v.target.value),className:"w-full rounded px-1.5 py-1 text-[10px] mb-1.5 appearance-auto",style:{background:"var(--bg-primary)",border:"1px solid var(--border)",color:"var(--text-primary)"},children:[a.jsx("option",{value:"",children:"Select…"}),s.map(v=>a.jsx("option",{value:v,children:v},v))]}),a.jsx("button",{onClick:()=>{x&&(c(x),b(!1))},disabled:!x,className:"w-full px-2 py-1 text-[10px] font-medium rounded border border-[var(--border)] bg-transparent cursor-pointer transition-colors disabled:opacity-30 disabled:cursor-not-allowed",style:{color:"var(--text-muted)"},children:"Confirm"})]}):a.jsxs("div",{className:"p-1",children:[a.jsx("label",{className:"block text-[10px] font-medium mb-1",style:{color:"var(--text-muted)"},children:"Environment"}),a.jsxs("select",{value:i,onChange:v=>l(v.target.value),className:"w-full rounded px-1.5 py-0.5 text-[10px] mb-1.5 appearance-auto",style:{background:"var(--bg-primary)",border:"1px solid var(--border)",color:"var(--text-muted)"},children:[a.jsx("option",{value:"cloud",children:"cloud"}),a.jsx("option",{value:"staging",children:"staging"}),a.jsx("option",{value:"alpha",children:"alpha"})]}),a.jsx("button",{onClick:()=>{u(),b(!1)},className:"w-full px-2 py-1 text-[10px] font-medium rounded border border-[var(--border)] bg-transparent cursor-pointer transition-colors",style:{color:"var(--text-muted)"},onMouseEnter:v=>{v.currentTarget.style.color="var(--text-primary)",v.currentTarget.style.borderColor="var(--text-muted)"},onMouseLeave:v=>{v.currentTarget.style.color="var(--text-muted)",v.currentTarget.style.borderColor="var(--border)"},children:"Sign In"})]})})]}),p&&a.jsxs("span",{className:L,children:["Project: ",p]}),m&&a.jsxs("span",{className:L,children:["Version: v",m]}),f&&a.jsxs("span",{className:L,children:["Author: ",f]}),a.jsxs("a",{href:"https://github.com/UiPath/uipath-dev-python",target:"_blank",rel:"noopener noreferrer",className:`${L} cursor-pointer no-underline`,style:{color:"var(--text-muted)"},...C,title:"View on GitHub",children:[a.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"currentColor",children:a.jsx("path",{d:"M12 0C5.37 0 0 5.37 0 12c0 5.31 3.435 9.795 8.205 11.385.6.105.825-.255.825-.57 0-.285-.015-1.23-.015-2.235-3.015.555-3.795-.735-4.035-1.41-.135-.345-.72-1.41-1.23-1.695-.42-.225-1.02-.78-.015-.795.945-.015 1.62.87 1.845 1.23 1.08 1.815 2.805 1.305 3.495.99.105-.78.42-1.305.765-1.605-2.67-.3-5.46-1.335-5.46-5.925 0-1.305.465-2.385 1.23-3.225-.12-.3-.54-1.53.12-3.18 0 0 1.005-.315 3.3 1.23.96-.27 1.98-.405 3-.405s2.04.135 3 .405c2.295-1.56 3.3-1.23 3.3-1.23.66 1.65.24 2.88.12 3.18.765.84 1.23 1.905 1.23 3.225 0 4.605-2.805 5.625-5.475 5.925.435.375.81 1.095.81 2.22 0 1.605-.015 2.895-.015 3.3 0 .315.225.69.825.57A12.02 12.02 0 0 0 24 12c0-6.63-5.37-12-12-12z"})}),a.jsx("span",{children:"uipath-dev-python"})]}),a.jsxs("div",{className:`${L} cursor-pointer`,onClick:t,...C,title:`Switch to ${e==="dark"?"light":"dark"} theme`,children:[a.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:e==="dark"?a.jsxs(a.Fragment,{children:[a.jsx("circle",{cx:"12",cy:"12",r:"5"}),a.jsx("line",{x1:"12",y1:"1",x2:"12",y2:"3"}),a.jsx("line",{x1:"12",y1:"21",x2:"12",y2:"23"}),a.jsx("line",{x1:"4.22",y1:"4.22",x2:"5.64",y2:"5.64"}),a.jsx("line",{x1:"18.36",y1:"18.36",x2:"19.78",y2:"19.78"}),a.jsx("line",{x1:"1",y1:"12",x2:"3",y2:"12"}),a.jsx("line",{x1:"21",y1:"12",x2:"23",y2:"12"}),a.jsx("line",{x1:"4.22",y1:"19.78",x2:"5.64",y2:"18.36"}),a.jsx("line",{x1:"18.36",y1:"5.64",x2:"19.78",y2:"4.22"})]}):a.jsx("path",{d:"M21 12.79A9 9 0 1 1 11.21 3 7 7 0 0 0 21 12.79z"})}),a.jsx("span",{children:e==="dark"?"Dark":"Light"})]})]})}function Nc(){const{navigate:e}=st(),t=Ee(c=>c.entrypoints),[n,r]=N.useState(""),[i,s]=N.useState(!0),[o,l]=N.useState(null);N.useEffect(()=>{!n&&t.length>0&&r(t[0])},[t,n]),N.useEffect(()=>{n&&(s(!0),l(null),Jl(n).then(c=>{var p;const d=(p=c.input)==null?void 0:p.properties;s(!!(d!=null&&d.messages))}).catch(c=>{const d=c.detail||{};l(d.error||d.message||`Failed to load entrypoint "${n}"`)}))},[n]);const u=c=>{n&&e(`#/setup/${encodeURIComponent(n)}/${c}`)};return a.jsx("div",{className:"flex items-center justify-center h-full",children:a.jsxs("div",{className:"w-full max-w-xl px-6",children:[a.jsxs("div",{className:"mb-8 text-center",children:[a.jsxs("div",{className:"flex items-center justify-center gap-2 mb-2",children:[a.jsx("div",{className:"w-1.5 h-1.5 rounded-full",style:{background:o?"var(--error)":"var(--accent)"}}),a.jsx("span",{className:"text-sm font-semibold",style:{color:"var(--text-muted)"},children:"New Run"})]}),!o&&a.jsx("p",{className:"text-sm",style:{color:"var(--text-muted)"},children:t.length>1?"Select an entrypoint and choose a mode":"Choose a mode"})]}),t.length>1&&a.jsxs("div",{className:"mb-8",children:[a.jsx("label",{className:"block text-[11px] font-medium mb-1.5",style:{color:"var(--text-muted)"},children:"Entrypoint"}),a.jsx("select",{id:"entrypoint-select",value:n,onChange:c=>r(c.target.value),className:"w-full rounded-md px-3 py-2 text-xs font-mono cursor-pointer appearance-auto",style:{background:"var(--bg-secondary)",border:"1px solid var(--border)",color:"var(--text-primary)"},children:t.map(c=>a.jsx("option",{value:c,children:c},c))})]}),o?a.jsxs("div",{className:"rounded-md border overflow-hidden",style:{borderColor:"color-mix(in srgb, var(--error) 25%, var(--border))",background:"var(--bg-secondary)"},children:[a.jsxs("div",{className:"px-3 py-2 flex items-center gap-2",style:{borderBottom:"1px solid color-mix(in srgb, var(--error) 15%, var(--border))",background:"color-mix(in srgb, var(--error) 4%, var(--bg-secondary))"},children:[a.jsx("svg",{width:"14",height:"14",viewBox:"0 0 16 16",fill:"none",style:{flexShrink:0},children:a.jsx("path",{d:"M8 1.5a6.5 6.5 0 100 13 6.5 6.5 0 000-13zM7.25 4.75h1.5v4h-1.5v-4zm.75 6.75a.75.75 0 110-1.5.75.75 0 010 1.5z",fill:"var(--error)"})}),a.jsx("span",{className:"text-[11px] font-medium",style:{color:"var(--error)"},children:"Failed to load entrypoint"})]}),a.jsx("div",{className:"overflow-auto max-h-48 p-3",children:a.jsx("pre",{className:"text-[11px] font-mono whitespace-pre-wrap break-words leading-relaxed m-0",style:{color:"var(--text-muted)"},children:o})})]}):a.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[a.jsx(Pi,{title:"Autonomous",description:"Run the agent end-to-end. Set breakpoints to pause and inspect execution.",icon:a.jsx(Sc,{}),color:"var(--success)",onClick:()=>u("run"),disabled:!n}),a.jsx(Pi,{title:"Conversational",description:i?"Interactive chat session. Send messages and receive responses in real time.":'Requires a "messages" property in the input schema.',icon:a.jsx(Tc,{}),color:"var(--accent)",onClick:()=>u("chat"),disabled:!n||!i})]})]})})}function Pi({title:e,description:t,icon:n,color:r,onClick:i,disabled:s}){return a.jsxs("button",{onClick:i,disabled:s,className:"group flex flex-col items-center text-center p-6 rounded-md border transition-all cursor-pointer disabled:opacity-40 disabled:cursor-not-allowed",style:{background:"var(--bg-secondary)",borderColor:"var(--border)"},onMouseEnter:o=>{s||(o.currentTarget.style.borderColor=r,o.currentTarget.style.background=`color-mix(in srgb, ${r} 5%, var(--bg-secondary))`)},onMouseLeave:o=>{o.currentTarget.style.borderColor="var(--border)",o.currentTarget.style.background="var(--bg-secondary)"},children:[a.jsx("div",{className:"mb-4 p-3 rounded-xl transition-colors",style:{background:`color-mix(in srgb, ${r} 10%, var(--bg-primary))`,color:r},children:n}),a.jsx("h3",{className:"text-sm font-semibold mb-1.5",style:{color:"var(--text-primary)"},children:e}),a.jsx("p",{className:"text-xs leading-relaxed",style:{color:"var(--text-muted)"},children:t})]})}function Sc(){return a.jsx("svg",{width:"28",height:"28",viewBox:"0 0 26 26",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:a.jsx("path",{d:"M23.832 15.166H22.7487C22.7487 10.9735 19.3579 7.58268 15.1654 7.58268H14.082V6.20685C14.732 5.83852 15.1654 5.13435 15.1654 4.33268C15.1654 3.14102 14.2012 2.16602 12.9987 2.16602C11.7962 2.16602 10.832 3.14102 10.832 4.33268C10.832 5.13435 11.2654 5.83852 11.9154 6.20685V7.58268H10.832C6.63953 7.58268 3.2487 10.9735 3.2487 15.166H2.16536C1.56953 15.166 1.08203 15.6535 1.08203 16.2493V19.4993C1.08203 20.0952 1.56953 20.5827 2.16536 20.5827H3.2487V21.666C3.2487 22.8685 4.2237 23.8327 5.41536 23.8327H20.582C21.7845 23.8327 22.7487 22.8685 22.7487 21.666V20.5827H23.832C24.4279 20.5827 24.9154 20.0952 24.9154 19.4993V16.2493C24.9154 15.6535 24.4279 15.166 23.832 15.166ZM22.7487 18.416H20.582V21.666H5.41536V18.416H3.2487V17.3327H5.41536V15.166C5.41536 12.176 7.84203 9.74935 10.832 9.74935H15.1654C18.1554 9.74935 20.582 12.176 20.582 15.166V17.3327H22.7487V18.416ZM9.20703 14.6243L11.7637 17.181L10.4854 18.4594L9.20703 17.181L7.9287 18.4594L6.65036 17.181L9.20703 14.6243ZM16.7904 14.6243L19.347 17.181L18.0687 18.4594L16.7904 17.181L15.512 18.4594L14.2337 17.181L16.7904 14.6243Z",fill:"currentColor"})})}function Tc(){return a.jsxs("svg",{width:"28",height:"28",viewBox:"0 0 26 26",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[a.jsx("path",{d:"M9.20901 13.541L11.7657 16.0977L10.4873 17.376L9.20901 16.0977L7.93068 17.376L6.65234 16.0977L9.20901 13.541ZM16.7923 13.541L19.349 16.0977L18.0707 17.376L16.7923 16.0977L15.514 17.376L14.2357 16.0977L16.7923 13.541Z",fill:"currentColor"}),a.jsx("path",{d:"M5.25 8.58398H20.75C21.3023 8.58398 21.75 9.0317 21.75 9.58398V23.5293L16.874 21.9043C16.5683 21.8024 16.248 21.751 15.9258 21.751H5.25C4.69782 21.751 4.25018 21.3031 4.25 20.751V9.58398C4.25 9.0317 4.69772 8.58398 5.25 8.58398Z",stroke:"currentColor",strokeWidth:"2"}),a.jsx("ellipse",{cx:"12.9987",cy:"4.33268",rx:"2.16667",ry:"2.16667",fill:"currentColor"}),a.jsx("rect",{x:"11.918",y:"5.41602",width:"2.16667",height:"2.16667",fill:"currentColor"}),a.jsx("path",{d:"M1.08203 14C1.08203 13.4477 1.52975 13 2.08203 13H3.2487V18.4167H2.08203C1.52975 18.4167 1.08203 17.969 1.08203 17.4167V14Z",fill:"currentColor"}),a.jsx("rect",{x:"3.25",y:"15.166",width:"2.16667",height:"1.08333",fill:"currentColor"}),a.jsx("path",{d:"M22.75 13H23.9167C24.4689 13 24.9167 13.4477 24.9167 14V17.4167C24.9167 17.969 24.469 18.4167 23.9167 18.4167H22.75V13Z",fill:"currentColor"}),a.jsx("rect",{x:"20.582",y:"15.166",width:"2.16667",height:"1.08333",fill:"currentColor"})]})}const Cc="modulepreload",Ac=function(e){return"/"+e},Bi={},Ts=function(t,n,r){let i=Promise.resolve();if(n&&n.length>0){let o=function(c){return Promise.all(c.map(d=>Promise.resolve(d).then(p=>({status:"fulfilled",value:p}),p=>({status:"rejected",reason:p}))))};document.getElementsByTagName("link");const l=document.querySelector("meta[property=csp-nonce]"),u=(l==null?void 0:l.nonce)||(l==null?void 0:l.getAttribute("nonce"));i=o(n.map(c=>{if(c=Ac(c),c in Bi)return;Bi[c]=!0;const d=c.endsWith(".css"),p=d?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${c}"]${p}`))return;const m=document.createElement("link");if(m.rel=d?"stylesheet":Cc,d||(m.as="script"),m.crossOrigin="",m.href=c,u&&m.setAttribute("nonce",u),document.head.appendChild(m),d)return new Promise((f,h)=>{m.addEventListener("load",f),m.addEventListener("error",()=>h(new Error(`Unable to preload CSS for ${c}`)))})}))}function s(o){const l=new Event("vite:preloadError",{cancelable:!0});if(l.payload=o,window.dispatchEvent(l),!l.defaultPrevented)throw o}return i.then(o=>{for(const l of o||[])l.status==="rejected"&&s(l.reason);return t().catch(s)})},Mc={opacity:0,width:1,height:1,minWidth:0,minHeight:0,border:"none",padding:0};function Ic({data:e}){const t=e.status,n=e.nodeWidth,r=e.label??"Start",i=e.hasBreakpoint,s=e.isPausedHere,o=e.isActiveNode,l=e.isExecutingNode,u=s?"var(--error)":l?"var(--success)":o?"var(--accent)":t==="completed"?"var(--success)":t==="running"?"var(--warning)":"var(--node-border)",c=s?"var(--error)":l?"var(--success)":"var(--accent)";return a.jsxs("div",{className:"px-3 py-1.5 rounded-full text-center text-xs overflow-hidden text-ellipsis whitespace-nowrap cursor-pointer relative",style:{width:n,background:"var(--node-bg)",color:"var(--text-primary)",border:`2px solid ${u}`,boxShadow:s||o||l?`0 0 4px ${c}`:void 0,animation:s||o||l?`node-pulse-${s?"red":l?"green":"accent"} 1.5s ease-in-out infinite`:void 0},title:r,children:[i&&a.jsx("div",{className:"absolute",style:{top:2,left:2,width:12,height:12,borderRadius:"50%",background:"var(--error)",border:"2px solid var(--node-bg)",boxShadow:"0 0 4px var(--error)"}}),r,a.jsx(ht,{type:"source",position:bt.Bottom,style:Mc})]})}const Rc={opacity:0,width:1,height:1,minWidth:0,minHeight:0,border:"none",padding:0};function Oc({data:e}){const t=e.status,n=e.nodeWidth,r=e.label??"End",i=e.hasBreakpoint,s=e.isPausedHere,o=e.isActiveNode,l=e.isExecutingNode,u=s?"var(--error)":l?"var(--success)":o?"var(--accent)":t==="completed"?"var(--success)":t==="failed"?"var(--error)":"var(--node-border)",c=s?"var(--error)":l?"var(--success)":"var(--accent)";return a.jsxs("div",{className:"px-3 py-1.5 rounded-full text-center text-xs overflow-hidden text-ellipsis whitespace-nowrap cursor-pointer relative",style:{width:n,background:"var(--node-bg)",color:"var(--text-primary)",border:`2px solid ${u}`,boxShadow:s||o||l?`0 0 4px ${c}`:void 0,animation:s||o||l?`node-pulse-${s?"red":l?"green":"accent"} 1.5s ease-in-out infinite`:void 0},title:r,children:[i&&a.jsx("div",{className:"absolute",style:{top:2,left:2,width:12,height:12,borderRadius:"50%",background:"var(--error)",border:"2px solid var(--node-bg)",boxShadow:"0 0 4px var(--error)"}}),a.jsx(ht,{type:"target",position:bt.Top,style:Rc}),r]})}const Fi={opacity:0,width:1,height:1,minWidth:0,minHeight:0,border:"none",padding:0};function Lc({data:e}){const t=e.status,n=e.nodeWidth,r=e.model_name,i=e.label??"Model",s=e.hasBreakpoint,o=e.isPausedHere,l=e.isActiveNode,u=e.isExecutingNode,c=o?"var(--error)":u?"var(--success)":l?"var(--accent)":t==="completed"?"var(--success)":t==="running"?"var(--warning)":t==="failed"?"var(--error)":"var(--node-border)",d=o?"var(--error)":u?"var(--success)":"var(--accent)";return a.jsxs("div",{className:"px-3 py-1.5 rounded-lg text-center text-xs overflow-hidden cursor-pointer relative",style:{width:n,background:"var(--node-bg)",color:"var(--text-primary)",border:`2px solid ${c}`,boxShadow:o||l||u?`0 0 4px ${d}`:void 0,animation:o||l||u?`node-pulse-${o?"red":u?"green":"accent"} 1.5s ease-in-out infinite`:void 0},title:r?`${i} ${r}`:i,children:[s&&a.jsx("div",{className:"absolute",style:{top:2,left:2,width:12,height:12,borderRadius:"50%",background:"var(--error)",border:"2px solid var(--node-bg)",boxShadow:"0 0 4px var(--error)"}}),a.jsx(ht,{type:"target",position:bt.Top,style:Fi}),a.jsx("div",{style:{color:"var(--info)",fontSize:9,marginBottom:1},children:"model"}),a.jsx("div",{className:"overflow-hidden text-ellipsis whitespace-nowrap",children:i}),r&&a.jsx("div",{className:"overflow-hidden text-ellipsis whitespace-nowrap",style:{color:"var(--text-muted)",fontSize:9,marginTop:1},title:r,children:r}),a.jsx(ht,{type:"source",position:bt.Bottom,style:Fi})]})}const zi={opacity:0,width:1,height:1,minWidth:0,minHeight:0,border:"none",padding:0},jc=3;function Dc({data:e}){const t=e.status,n=e.nodeWidth,r=e.tool_names,i=e.tool_count,s=e.label??"Tool",o=e.hasBreakpoint,l=e.isPausedHere,u=e.isActiveNode,c=e.isExecutingNode,d=l?"var(--error)":c?"var(--success)":u?"var(--accent)":t==="completed"?"var(--success)":t==="running"?"var(--warning)":t==="failed"?"var(--error)":"var(--node-border)",p=l?"var(--error)":c?"var(--success)":"var(--accent)",m=(r==null?void 0:r.slice(0,jc))??[],f=(i??(r==null?void 0:r.length)??0)-m.length;return a.jsxs("div",{className:"px-3 py-1.5 rounded-lg text-center text-xs overflow-hidden cursor-pointer relative",style:{width:n,background:"var(--node-bg)",color:"var(--text-primary)",border:`2px solid ${d}`,boxShadow:l||u||c?`0 0 4px ${p}`:void 0,animation:l||u||c?`node-pulse-${l?"red":c?"green":"accent"} 1.5s ease-in-out infinite`:void 0},title:r!=null&&r.length?`${s} @@ -38,7 +38,7 @@ ${r.join(` 50% { box-shadow: 0 0 10px var(--error); } } `}),a.jsxs(jl,{nodes:s,edges:u,onNodesChange:l,onEdgesChange:d,nodeTypes:$c,edgeTypes:Uc,onInit:v=>{w.current=v},onNodeClick:D,fitView:!0,proOptions:{hideAttribution:!0},nodesDraggable:!1,nodesConnectable:!1,elementsSelectable:!1,children:[a.jsx(Dl,{color:"var(--bg-tertiary)",gap:16}),a.jsx(Pl,{showInteractive:!1}),a.jsx(Bl,{position:"top-right",children:a.jsxs("button",{onClick:S,title:R?"Remove all breakpoints":"Set breakpoints on all nodes",style:{background:"var(--bg-secondary)",color:R?"var(--error)":"var(--text-muted)",border:`1px solid ${R?"var(--error)":"var(--node-border)"}`,borderRadius:6,padding:"4px 10px",fontSize:12,cursor:"pointer",display:"flex",alignItems:"center",gap:4},children:[a.jsx("span",{style:{display:"inline-block",width:8,height:8,borderRadius:"50%",background:R?"var(--error)":"var(--node-border)"}}),R?"Clear all":"Break all"]})}),a.jsx(Fl,{nodeColor:v=>{var I;if(v.type==="groupNode")return"var(--bg-tertiary)";const E=(I=v.data)==null?void 0:I.status;return E==="completed"?"var(--success)":E==="running"?"var(--warning)":E==="failed"?"var(--error)":"var(--node-border)"},nodeStrokeWidth:0,style:{background:"var(--bg-secondary)",width:120,height:80}})]})]})}const Ut="__setup__";function Xc({entrypoint:e,mode:t,ws:n,onRunCreated:r,isMobile:i}){const[s,o]=N.useState("{}"),[l,u]=N.useState({}),[c,d]=N.useState(!1),[p,m]=N.useState(!0),[f,h]=N.useState(null),[b,x]=N.useState(""),[y,w]=N.useState(!0),[T,j]=N.useState(()=>{const I=localStorage.getItem("setupTextareaHeight");return I?parseInt(I,10):140}),O=N.useRef(null),[_,P]=N.useState(()=>{const I=localStorage.getItem("setupPanelWidth");return I?parseInt(I,10):380}),D=t==="run";N.useEffect(()=>{m(!0),h(null),Ql(e).then(I=>{u(I.mock_input),o(JSON.stringify(I.mock_input,null,2))}).catch(I=>{console.error("Failed to load mock input:",I);const H=I.detail||{};h(H.message||`Failed to load schema for "${e}"`),o("{}")}).finally(()=>m(!1))},[e]),N.useEffect(()=>{Ee.getState().clearBreakpoints(Ut)},[]);const R=async()=>{let I;try{I=JSON.parse(s)}catch{alert("Invalid JSON input");return}d(!0);try{const H=Ee.getState().breakpoints[Ut]??{},U=Object.keys(H),V=await Ri(e,I,t,U);Ee.getState().clearBreakpoints(Ut),Ee.getState().upsertRun(V),r(V.id)}catch(H){console.error("Failed to create run:",H)}finally{d(!1)}},S=async()=>{const I=b.trim();if(I){d(!0);try{const H=Ee.getState().breakpoints[Ut]??{},U=Object.keys(H),V=await Ri(e,l,"chat",U);Ee.getState().clearBreakpoints(Ut),Ee.getState().upsertRun(V),Ee.getState().addLocalChatMessage(V.id,{message_id:`local-${Date.now()}`,role:"user",content:I}),n.sendChatMessage(V.id,I),r(V.id)}catch(H){console.error("Failed to create chat run:",H)}finally{d(!1)}}};N.useEffect(()=>{try{JSON.parse(s),w(!0)}catch{w(!1)}},[s]);const M=N.useCallback(I=>{I.preventDefault();const H="touches"in I?I.touches[0].clientY:I.clientY,U=T,V=F=>{const $="touches"in F?F.touches[0].clientY:F.clientY,k=Math.max(60,U+(H-$));j(k)},g=()=>{document.removeEventListener("mousemove",V),document.removeEventListener("mouseup",g),document.removeEventListener("touchmove",V),document.removeEventListener("touchend",g),document.body.style.cursor="",document.body.style.userSelect="",localStorage.setItem("setupTextareaHeight",String(T))};document.body.style.cursor="row-resize",document.body.style.userSelect="none",document.addEventListener("mousemove",V),document.addEventListener("mouseup",g),document.addEventListener("touchmove",V,{passive:!1}),document.addEventListener("touchend",g)},[T]),L=N.useCallback(I=>{I.preventDefault();const H="touches"in I?I.touches[0].clientX:I.clientX,U=_,V=F=>{const $=O.current;if(!$)return;const k="touches"in F?F.touches[0].clientX:F.clientX,ie=$.clientWidth-300,K=Math.max(280,Math.min(ie,U+(H-k)));P(K)},g=()=>{document.removeEventListener("mousemove",V),document.removeEventListener("mouseup",g),document.removeEventListener("touchmove",V),document.removeEventListener("touchend",g),document.body.style.cursor="",document.body.style.userSelect="",localStorage.setItem("setupPanelWidth",String(_))};document.body.style.cursor="col-resize",document.body.style.userSelect="none",document.addEventListener("mousemove",V),document.addEventListener("mouseup",g),document.addEventListener("touchmove",V,{passive:!1}),document.addEventListener("touchend",g)},[_]),C=D?"Autonomous":"Conversational",v=D?"var(--success)":"var(--accent)",E=a.jsxs("div",{className:"shrink-0 flex flex-col",style:i?{background:"var(--bg-primary)"}:{width:_,background:"var(--bg-primary)"},children:[a.jsxs("div",{className:"px-4 text-xs font-semibold border-b flex items-center gap-2 h-10",style:{color:"var(--text-muted)",borderColor:"var(--border)",background:"var(--bg-secondary)"},children:[a.jsx("span",{style:{color:v},children:"●"}),C]}),a.jsxs("div",{className:"flex-1 overflow-y-auto flex flex-col items-center justify-center gap-4 px-6",children:[a.jsx("svg",{width:"48",height:"48",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1",strokeLinecap:"round",strokeLinejoin:"round",style:{color:"var(--text-muted)",opacity:.5},children:D?a.jsxs(a.Fragment,{children:[a.jsx("circle",{cx:"12",cy:"12",r:"10"}),a.jsx("polyline",{points:"12 6 12 12 16 14"})]}):a.jsx("path",{d:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z"})}),a.jsxs("div",{className:"text-center space-y-1.5",children:[a.jsx("p",{className:"text-sm font-medium",style:{color:"var(--text-secondary)"},children:D?"Ready to execute":"Ready to chat"}),a.jsxs("p",{className:"text-xs leading-relaxed",style:{color:"var(--text-muted)"},children:["Click nodes to set breakpoints",D?a.jsxs(a.Fragment,{children:[",",a.jsx("br",{}),"configure input below, then run"]}):a.jsxs(a.Fragment,{children:[",",a.jsx("br",{}),"then send your first message"]})]})]})]}),D?a.jsxs("div",{className:"flex flex-col",style:{background:"var(--bg-primary)"},children:[!i&&a.jsx("div",{onMouseDown:M,onTouchStart:M,className:"shrink-0 drag-handle-row"}),a.jsxs("div",{className:"px-4 py-3",children:[f?a.jsx("div",{className:"text-xs mb-3 px-3 py-2 rounded",style:{color:"var(--error)",background:"color-mix(in srgb, var(--error) 10%, var(--bg-secondary))"},children:f}):a.jsxs(a.Fragment,{children:[a.jsxs("label",{className:"block text-[11px] font-medium mb-1.5",style:{color:"var(--text-muted)"},children:["Input",p&&a.jsx("span",{className:"ml-2 font-normal",children:"Loading..."})]}),a.jsx("textarea",{value:s,onChange:I=>o(I.target.value),spellCheck:!1,className:"w-full rounded-md px-3 py-2 text-xs font-mono leading-relaxed resize-none mb-3",style:{height:i?120:T,background:"var(--bg-secondary)",border:`1px solid ${y?"var(--border)":"#b91c1c"}`,color:"var(--text-primary)"}})]}),a.jsx("button",{onClick:R,disabled:c||p||!!f,className:"w-full py-2 text-sm font-semibold rounded-md border cursor-pointer disabled:opacity-30 disabled:cursor-not-allowed transition-colors flex items-center justify-center gap-2",style:{background:"transparent",borderColor:v,color:v},onMouseEnter:I=>{c||(I.currentTarget.style.background=`color-mix(in srgb, ${v} 10%, transparent)`)},onMouseLeave:I=>{I.currentTarget.style.background="transparent"},children:c?"Starting...":a.jsxs(a.Fragment,{children:[a.jsx("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"currentColor",stroke:"none",children:a.jsx("polygon",{points:"5,3 19,12 5,21"})}),"Execute"]})})]})]}):a.jsxs("div",{className:"flex items-center gap-2 px-3 py-2 border-t",style:{borderColor:"var(--border)"},children:[a.jsx("input",{value:b,onChange:I=>x(I.target.value),onKeyDown:I=>{I.key==="Enter"&&!I.shiftKey&&(I.preventDefault(),S())},disabled:c||p,placeholder:c?"Starting...":"Message...",className:"flex-1 bg-transparent text-sm py-1 disabled:opacity-40 placeholder:text-[var(--text-muted)]",style:{color:"var(--text-primary)"}}),a.jsx("button",{onClick:S,disabled:c||p||!b.trim(),className:"text-xs font-semibold px-3 py-1.5 rounded transition-colors cursor-pointer disabled:opacity-30 disabled:cursor-not-allowed",style:{color:!c&&b.trim()?"var(--accent)":"var(--text-muted)",background:"transparent"},onMouseEnter:I=>{!c&&b.trim()&&(I.currentTarget.style.background="color-mix(in srgb, var(--accent) 10%, transparent)")},onMouseLeave:I=>{I.currentTarget.style.background="transparent"},children:"Send"})]})]});return i?a.jsxs("div",{className:"flex flex-col h-full",children:[a.jsx("div",{className:"shrink-0",style:{height:"40vh"},children:a.jsx(Un,{entrypoint:e,traces:[],runId:Ut})}),a.jsx("div",{className:"flex-1 overflow-y-auto flex flex-col min-h-0",children:E})]}):a.jsxs("div",{ref:O,className:"flex h-full",children:[a.jsx("div",{className:"flex-1 min-w-0",children:a.jsx(Un,{entrypoint:e,traces:[],runId:Ut})}),a.jsx("div",{onMouseDown:L,onTouchStart:L,className:"shrink-0 drag-handle-col"}),E]})}const Zc={key:"var(--info)",string:"var(--success)",number:"var(--warning)",boolean:"var(--accent)",null:"var(--accent)",punctuation:"var(--text-muted)"};function Jc(e){const t=[],n=/("(?:[^"\\]|\\.)*")\s*:|("(?:[^"\\]|\\.)*")|(-?\d+(?:\.\d+)?(?:[eE][+-]?\d+)?)\b|(true|false)\b|(null)\b|([{}[\]:,])/g;let r=0,i;for(;(i=n.exec(e))!==null;){if(i.index>r&&t.push({type:"punctuation",text:e.slice(r,i.index)}),i[1]!==void 0){t.push({type:"key",text:i[1]});const s=e.indexOf(":",i.index+i[1].length);s!==-1&&(s>i.index+i[1].length&&t.push({type:"punctuation",text:e.slice(i.index+i[1].length,s)}),t.push({type:"punctuation",text:":"}),n.lastIndex=s+1)}else i[2]!==void 0?t.push({type:"string",text:i[2]}):i[3]!==void 0?t.push({type:"number",text:i[3]}):i[4]!==void 0?t.push({type:"boolean",text:i[4]}):i[5]!==void 0?t.push({type:"null",text:i[5]}):i[6]!==void 0&&t.push({type:"punctuation",text:i[6]});r=n.lastIndex}return rJc(e),[e]);return a.jsx("pre",{className:t,style:n,children:r.map((i,s)=>a.jsx("span",{style:{color:Zc[i.type]},children:i.text},s))})}const Qc={started:{color:"var(--info)",label:"Started"},running:{color:"var(--warning)",label:"Running"},completed:{color:"var(--success)",label:"Completed"},failed:{color:"var(--error)",label:"Failed"},error:{color:"var(--error)",label:"Error"}},eu={color:"var(--text-muted)",label:"Unknown"};function tu(e){if(typeof e!="string")return null;const t=e.trim();if(t.startsWith("{")&&t.endsWith("}")||t.startsWith("[")&&t.endsWith("]"))try{return JSON.stringify(JSON.parse(t),null,2)}catch{return null}return null}const Gi=200;function nu(e){if(typeof e=="string")return e;if(e==null)return String(e);try{return JSON.stringify(e,null,2)}catch{return String(e)}}function ru({value:e}){const[t,n]=N.useState(!1),r=nu(e),i=N.useMemo(()=>tu(e),[e]),s=i!==null,o=i??r,l=o.length>Gi||o.includes(` -`),u=N.useCallback(()=>n(c=>!c),[]);return l?a.jsxs("div",{children:[t?s?a.jsx(ot,{json:o,className:"font-mono text-[11px] whitespace-pre-wrap break-all",style:{}}):a.jsx("pre",{className:"font-mono text-[11px] whitespace-pre-wrap break-all",style:{color:"var(--text-primary)"},children:o}):a.jsxs("span",{className:"font-mono text-[11px] break-all",style:{color:"var(--text-primary)"},children:[o.slice(0,Gi),"..."]}),a.jsx("button",{onClick:u,className:"text-[11px] cursor-pointer ml-1 px-1",style:{color:"var(--info)"},children:t?"[less]":"[more]"})]}):s?a.jsx(ot,{json:o,className:"font-mono text-[11px] break-all whitespace-pre-wrap",style:{}}):a.jsx("span",{className:"font-mono text-[11px] break-all",style:{color:"var(--text-primary)"},children:o})}function iu({span:e}){const[t,n]=N.useState(!0),[r,i]=N.useState(!1),[s,o]=N.useState("table"),[l,u]=N.useState(!1),c=Qc[e.status.toLowerCase()]??{...eu,label:e.status},d=N.useMemo(()=>JSON.stringify(e,null,2),[e]),p=N.useCallback(()=>{navigator.clipboard.writeText(d).then(()=>{u(!0),setTimeout(()=>u(!1),1500)})},[d]),m=Object.entries(e.attributes),f=[{label:"Span",value:e.span_id},...e.trace_id?[{label:"Trace",value:e.trace_id}]:[],{label:"Run",value:e.run_id},...e.parent_span_id?[{label:"Parent",value:e.parent_span_id}]:[]];return a.jsxs("div",{className:"flex flex-col h-full text-xs leading-normal",children:[a.jsxs("div",{className:"px-2 border-b flex items-center gap-1 shrink-0",style:{borderColor:"var(--border)",background:"var(--bg-secondary)",height:"32px"},children:[a.jsx("button",{onClick:()=>o("table"),className:"px-2.5 h-6 text-[11px] font-semibold rounded transition-colors cursor-pointer inline-flex items-center",style:{color:s==="table"?"var(--accent)":"var(--text-muted)",background:s==="table"?"color-mix(in srgb, var(--accent) 10%, transparent)":"transparent"},onMouseEnter:h=>{s!=="table"&&(h.currentTarget.style.color="var(--text-primary)")},onMouseLeave:h=>{s!=="table"&&(h.currentTarget.style.color="var(--text-muted)")},children:"Table"}),a.jsx("button",{onClick:()=>o("json"),className:"px-2.5 h-6 text-[11px] font-semibold rounded transition-colors cursor-pointer inline-flex items-center",style:{color:s==="json"?"var(--accent)":"var(--text-muted)",background:s==="json"?"color-mix(in srgb, var(--accent) 10%, transparent)":"transparent"},onMouseEnter:h=>{s!=="json"&&(h.currentTarget.style.color="var(--text-primary)")},onMouseLeave:h=>{s!=="json"&&(h.currentTarget.style.color="var(--text-muted)")},children:"JSON"}),a.jsxs("span",{className:"ml-auto shrink-0 inline-flex items-center gap-1 px-2 py-0.5 rounded-full text-[11px] font-bold uppercase tracking-wider",style:{background:`color-mix(in srgb, ${c.color} 15%, var(--bg-secondary))`,color:c.color},children:[a.jsx("span",{className:"inline-block w-1.5 h-1.5 rounded-full",style:{background:c.color}}),c.label]})]}),a.jsx("div",{className:"overflow-y-auto flex-1 p-0.5 pr-0 pt-0 mr-0.5 mt-0.5",children:s==="table"?a.jsxs(a.Fragment,{children:[m.length>0&&a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"px-2 py-1 text-[11px] uppercase font-bold tracking-wider border-b cursor-pointer flex items-center",style:{color:"var(--success)",borderColor:"var(--border)",background:"var(--bg-secondary)"},onClick:()=>n(h=>!h),children:[a.jsxs("span",{className:"flex-1",children:["Attributes (",m.length,")"]}),a.jsx("span",{style:{color:"var(--text-muted)",transform:t?"rotate(0deg)":"rotate(-90deg)"},children:"▾"})]}),t&&m.map(([h,b],x)=>a.jsxs("div",{className:"flex gap-2 px-2 py-1 items-start border-b",style:{borderColor:"var(--border)",background:x%2===0?"var(--bg-primary)":"var(--bg-secondary)"},children:[a.jsx("span",{className:"font-mono font-semibold shrink-0 pt-px truncate text-[11px]",style:{color:"var(--info)",width:"35%"},title:h,children:h}),a.jsx("span",{className:"flex-1 min-w-0",children:a.jsx(ru,{value:b})})]},h))]}),a.jsxs("div",{className:"px-2 py-1 text-[11px] uppercase font-bold tracking-wider border-b cursor-pointer flex items-center",style:{color:"var(--success)",borderColor:"var(--border)",background:"var(--bg-secondary)"},onClick:()=>i(h=>!h),children:[a.jsxs("span",{className:"flex-1",children:["Identifiers (",f.length,")"]}),a.jsx("span",{style:{color:"var(--text-muted)",transform:r?"rotate(0deg)":"rotate(-90deg)"},children:"▾"})]}),r&&f.map((h,b)=>a.jsxs("div",{className:"flex gap-2 px-2 py-1 items-start border-b",style:{borderColor:"var(--border)",background:b%2===0?"var(--bg-primary)":"var(--bg-secondary)"},children:[a.jsx("span",{className:"font-mono font-semibold shrink-0 pt-px truncate text-[11px]",style:{color:"var(--info)",width:"35%"},title:h.label,children:h.label}),a.jsx("span",{className:"flex-1 min-w-0",children:a.jsx("span",{className:"font-mono text-[11px] break-all",style:{color:"var(--text-primary)"},children:h.value})})]},h.label))]}):a.jsxs("div",{className:"relative",children:[a.jsx("button",{onClick:p,className:"absolute top-1 right-1 z-10 text-[11px] cursor-pointer px-2 py-1 rounded transition-colors",style:{color:l?"var(--success)":"var(--text-muted)",background:"var(--bg-secondary)",border:"1px solid var(--border)"},onMouseEnter:h=>{l||(h.currentTarget.style.color="var(--text-primary)")},onMouseLeave:h=>{h.currentTarget.style.color=l?"var(--success)":"var(--text-muted)"},children:l?"Copied!":"Copy"}),a.jsx(ot,{json:d,className:"font-mono text-[11px] whitespace-pre-wrap p-2",style:{}})]})})]})}function ou(e){const t=[];function n(r,i){t.push({span:r.span,depth:i});for(const s of r.children)n(s,i+1)}for(const r of e)n(r,0);return t}function su({tree:e,selectedSpan:t,onSelect:n}){const r=N.useMemo(()=>ou(e),[e]),{globalStart:i,totalDuration:s}=N.useMemo(()=>{if(r.length===0)return{globalStart:0,totalDuration:1};let o=1/0,l=-1/0;for(const{span:u}of r){const c=new Date(u.timestamp).getTime();o=Math.min(o,c),l=Math.max(l,c+(u.duration_ms??0))}return{globalStart:o,totalDuration:Math.max(l-o,1)}},[r]);return r.length===0?null:a.jsx(a.Fragment,{children:r.map(({span:o,depth:l})=>{var b;const u=new Date(o.timestamp).getTime()-i,c=o.duration_ms??0,d=u/s*100,p=Math.max(c/s*100,.3),m=As[o.status.toLowerCase()]??"var(--text-muted)",f=o.span_id===(t==null?void 0:t.span_id),h=(b=o.attributes)==null?void 0:b["openinference.span.kind"];return a.jsxs("button",{"data-span-id":o.span_id,onClick:()=>n(o),className:"w-full text-left text-xs leading-normal py-1 flex items-center transition-colors",style:{background:f?"color-mix(in srgb, var(--accent) 10%, var(--bg-primary))":void 0,borderLeft:f?"2px solid var(--accent)":"2px solid transparent"},onMouseEnter:x=>{f||(x.currentTarget.style.background="var(--bg-hover)")},onMouseLeave:x=>{f||(x.currentTarget.style.background="")},children:[a.jsxs("div",{className:"shrink-0 flex items-center gap-1 overflow-hidden",style:{width:"35%",minWidth:"80px",paddingLeft:`${l*12+4}px`},children:[a.jsx("span",{className:"shrink-0 flex items-center justify-center w-3.5 h-3.5",children:a.jsx(Ms,{kind:h,statusColor:m})}),a.jsx("span",{className:"text-[var(--text-primary)] truncate",children:o.span_name})]}),a.jsx("div",{className:"flex-1 relative h-[14px] mx-1 rounded-sm",style:{background:"var(--bg-secondary)"},children:a.jsx("div",{className:"absolute rounded-sm",style:{left:`${d}%`,width:`${p}%`,top:"2px",bottom:"2px",background:m,opacity:.8,minWidth:"2px"}})}),a.jsx("span",{className:"shrink-0 text-[10px] tabular-nums pr-2",style:{width:"52px",textAlign:"right",color:"var(--text-muted)"},children:Is(o.duration_ms)})]},o.span_id)})})}const As={started:"var(--info)",running:"var(--warning)",completed:"var(--success)",failed:"var(--error)",error:"var(--error)"};function Ms({kind:e,statusColor:t}){const n=t,r=14,i={width:r,height:r,viewBox:"0 0 16 16",fill:"none",stroke:n,strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"};switch(e){case"LLM":return a.jsx("svg",{...i,children:a.jsx("path",{d:"M8 2L9 5L12 4L10 7L14 8L10 9L12 12L9 11L8 14L7 11L4 12L6 9L2 8L6 7L4 4L7 5Z",fill:n,stroke:"none"})});case"TOOL":return a.jsx("svg",{...i,children:a.jsx("path",{d:"M10.5 2.5a3.5 3.5 0 0 0-3.17 4.93L3.5 11.27a1 1 0 0 0 0 1.41l.82.82a1 1 0 0 0 1.41 0l3.84-3.83A3.5 3.5 0 1 0 10.5 2.5z"})});case"AGENT":return a.jsxs("svg",{...i,children:[a.jsx("rect",{x:"3",y:"5",width:"10",height:"8",rx:"2"}),a.jsx("circle",{cx:"6",cy:"9",r:"1",fill:n,stroke:"none"}),a.jsx("circle",{cx:"10",cy:"9",r:"1",fill:n,stroke:"none"}),a.jsx("path",{d:"M8 2v3"}),a.jsx("path",{d:"M6 2h4"})]});case"CHAIN":return a.jsxs("svg",{...i,children:[a.jsx("path",{d:"M6.5 9.5L9.5 6.5"}),a.jsx("path",{d:"M4.5 8.5l-1 1a2 2 0 0 0 2.83 2.83l1-1"}),a.jsx("path",{d:"M11.5 7.5l1-1a2 2 0 0 0-2.83-2.83l-1 1"})]});case"RETRIEVER":return a.jsxs("svg",{...i,children:[a.jsx("circle",{cx:"7",cy:"7",r:"4"}),a.jsx("path",{d:"M10 10l3.5 3.5"})]});case"EMBEDDING":return a.jsxs("svg",{...i,children:[a.jsx("rect",{x:"2",y:"2",width:"4",height:"4",rx:"0.5"}),a.jsx("rect",{x:"10",y:"2",width:"4",height:"4",rx:"0.5"}),a.jsx("rect",{x:"2",y:"10",width:"4",height:"4",rx:"0.5"}),a.jsx("rect",{x:"10",y:"10",width:"4",height:"4",rx:"0.5"})]});default:return a.jsx("span",{className:"shrink-0 w-2 h-2 rounded-full",style:{background:t}})}}function au(e){const t=new Map(e.map(o=>[o.span_id,o])),n=new Map;for(const o of e)if(o.parent_span_id){const l=n.get(o.parent_span_id)??[];l.push(o),n.set(o.parent_span_id,l)}const r=e.filter(o=>o.parent_span_id===null||!t.has(o.parent_span_id));function i(o){const l=(n.get(o.span_id)??[]).sort((u,c)=>u.timestamp.localeCompare(c.timestamp));return{span:o,children:l.map(i)}}return r.sort((o,l)=>o.timestamp.localeCompare(l.timestamp)).map(i).flatMap(o=>o.span.span_name==="root"?o.children:[o])}function Is(e){return e==null?"":e<1e3?`${e.toFixed(0)}ms`:`${(e/1e3).toFixed(2)}s`}function Rs(e){return e.map(t=>{const{span:n}=t;return t.children.length>0?{name:n.span_name,children:Rs(t.children)}:{name:n.span_name}})}function Dr({traces:e}){const[t,n]=N.useState(null),[r,i]=N.useState(new Set),[s,o]=N.useState(()=>{const D=localStorage.getItem("traceTreeSplitWidth");return D?parseFloat(D):50}),[l,u]=N.useState(!1),[c,d]=N.useState(!1),[p,m]=N.useState(()=>localStorage.getItem("traceViewMode")||"tree"),f=au(e),h=N.useMemo(()=>JSON.stringify(Rs(f),null,2),[e]),b=N.useCallback(()=>{navigator.clipboard.writeText(h).then(()=>{d(!0),setTimeout(()=>d(!1),1500)})},[h]),x=Ee(D=>D.focusedSpan),y=Ee(D=>D.setFocusedSpan),[w,T]=N.useState(null),j=N.useRef(null),O=N.useCallback(D=>{i(R=>{const S=new Set(R);return S.has(D)?S.delete(D):S.add(D),S})},[]),_=N.useRef(null);N.useEffect(()=>{const D=f.length>0?f[0].span.span_id:null,R=_.current;if(_.current=D,D&&D!==R)n(f[0].span);else if(t===null)f.length>0&&n(f[0].span);else{const S=e.find(M=>M.span_id===t.span_id);S&&S!==t&&n(S)}},[e]),N.useEffect(()=>{if(!x)return;const R=e.filter(S=>S.span_name===x.name).sort((S,M)=>S.timestamp.localeCompare(M.timestamp))[x.index];if(R){n(R),T(R.span_id);const S=new Map(e.map(M=>[M.span_id,M.parent_span_id]));i(M=>{const L=new Set(M);let C=R.parent_span_id;for(;C;)L.delete(C),C=S.get(C)??null;return L})}y(null)},[x,e,y]),N.useEffect(()=>{if(!w)return;const D=w;T(null),requestAnimationFrame(()=>{const R=j.current,S=R==null?void 0:R.querySelector(`[data-span-id="${D}"]`);R&&S&&S.scrollIntoView({block:"center",behavior:"smooth"})})},[w]),N.useEffect(()=>{if(!l)return;const D=S=>{const M=document.querySelector(".trace-tree-container");if(!M)return;const L=M.getBoundingClientRect(),C=(S.clientX-L.left)/L.width*100,v=Math.max(20,Math.min(80,C));o(v),localStorage.setItem("traceTreeSplitWidth",String(v))},R=()=>{u(!1)};return window.addEventListener("mousemove",D),window.addEventListener("mouseup",R),()=>{window.removeEventListener("mousemove",D),window.removeEventListener("mouseup",R)}},[l]);const P=D=>{D.preventDefault(),u(!0)};return a.jsxs("div",{className:"flex h-full trace-tree-container",style:{cursor:l?"col-resize":void 0},children:[a.jsxs("div",{className:"flex flex-col",style:{width:`${s}%`},children:[e.length>0&&a.jsxs("div",{className:"flex items-center gap-1 px-2 border-b shrink-0",style:{borderColor:"var(--border)",background:"var(--bg-secondary)",height:"32px"},children:[a.jsx("button",{onClick:()=>{m("tree"),localStorage.setItem("traceViewMode","tree")},className:"px-2.5 h-6 text-[11px] font-semibold rounded transition-colors cursor-pointer inline-flex items-center",style:{color:p==="tree"?"var(--accent)":"var(--text-muted)",background:p==="tree"?"color-mix(in srgb, var(--accent) 10%, transparent)":"transparent"},onMouseEnter:D=>{p!=="tree"&&(D.currentTarget.style.color="var(--text-primary)")},onMouseLeave:D=>{p!=="tree"&&(D.currentTarget.style.color="var(--text-muted)")},children:"Tree"}),a.jsx("button",{onClick:()=>{m("timeline"),localStorage.setItem("traceViewMode","timeline")},className:"px-2.5 h-6 text-[11px] font-semibold rounded transition-colors cursor-pointer inline-flex items-center",style:{color:p==="timeline"?"var(--accent)":"var(--text-muted)",background:p==="timeline"?"color-mix(in srgb, var(--accent) 10%, transparent)":"transparent"},onMouseEnter:D=>{p!=="timeline"&&(D.currentTarget.style.color="var(--text-primary)")},onMouseLeave:D=>{p!=="timeline"&&(D.currentTarget.style.color="var(--text-muted)")},children:"Timeline"}),a.jsx("button",{onClick:()=>{m("json"),localStorage.setItem("traceViewMode","json")},className:"px-2.5 h-6 text-[11px] font-semibold rounded transition-colors cursor-pointer inline-flex items-center",style:{color:p==="json"?"var(--accent)":"var(--text-muted)",background:p==="json"?"color-mix(in srgb, var(--accent) 10%, transparent)":"transparent"},onMouseEnter:D=>{p!=="json"&&(D.currentTarget.style.color="var(--text-primary)")},onMouseLeave:D=>{p!=="json"&&(D.currentTarget.style.color="var(--text-muted)")},children:"JSON"})]}),a.jsx("div",{ref:j,className:"overflow-y-auto flex-1 p-0.5 pr-0 pt-0 mr-0.5 mt-0.5",children:f.length===0?a.jsx("div",{className:"flex items-center justify-center h-full",children:a.jsx("p",{className:"text-[var(--text-muted)] text-sm",children:"No traces yet"})}):p==="tree"?f.map((D,R)=>a.jsx(Os,{node:D,depth:0,selectedId:(t==null?void 0:t.span_id)??null,onSelect:n,isLast:R===f.length-1,collapsedIds:r,toggleExpanded:O},D.span.span_id)):p==="timeline"?a.jsx(su,{tree:f,selectedSpan:t,onSelect:n}):a.jsxs("div",{className:"relative",children:[a.jsx("button",{onClick:b,className:"absolute top-1 right-1 z-10 text-[11px] cursor-pointer px-2 py-1 rounded transition-colors",style:{color:c?"var(--success)":"var(--text-muted)",background:"var(--bg-secondary)",border:"1px solid var(--border)"},onMouseEnter:D=>{c||(D.currentTarget.style.color="var(--text-primary)")},onMouseLeave:D=>{D.currentTarget.style.color=c?"var(--success)":"var(--text-muted)"},children:c?"Copied!":"Copy"}),a.jsx(ot,{json:h,className:"font-mono text-[11px] whitespace-pre-wrap p-2",style:{}})]})})]}),a.jsx("div",{onMouseDown:P,className:"shrink-0 drag-handle-col",style:l?{background:"var(--accent)"}:void 0}),a.jsx("div",{className:"flex-1 overflow-hidden",children:t?a.jsx(iu,{span:t}):a.jsx("div",{className:"flex items-center justify-center h-full",children:a.jsx("p",{className:"text-[var(--text-muted)] text-sm",children:"Select a span to view details"})})})]})}function Os({node:e,depth:t,selectedId:n,onSelect:r,isLast:i,collapsedIds:s,toggleExpanded:o}){var b;const{span:l}=e,u=!s.has(l.span_id),c=As[l.status.toLowerCase()]??"var(--text-muted)",d=Is(l.duration_ms),p=l.span_id===n,m=e.children.length>0,f=t*20,h=(b=l.attributes)==null?void 0:b["openinference.span.kind"];return a.jsxs("div",{className:"relative",children:[t>0&&a.jsx("div",{className:"absolute top-0 z-10 pointer-events-none",style:{left:`${f-10}px`,width:"1px",height:i?"16px":"100%",background:"var(--border)"}}),a.jsxs("button",{"data-span-id":l.span_id,onClick:()=>r(l),className:"w-full text-left text-xs leading-normal py-1.5 pr-2 flex items-center gap-1.5 transition-colors relative",style:{paddingLeft:`${f+4}px`,background:p?"color-mix(in srgb, var(--accent) 15%, var(--bg-primary))":void 0,borderLeft:p?"3px solid var(--accent)":"3px solid transparent"},onMouseEnter:x=>{p||(x.currentTarget.style.background="var(--bg-hover)")},onMouseLeave:x=>{p||(x.currentTarget.style.background="")},children:[t>0&&a.jsx("div",{className:"absolute z-10 pointer-events-none",style:{left:`${f-10}px`,top:"50%",width:"10px",height:"1px",background:"var(--border)"}}),m?a.jsx("span",{onClick:x=>{x.stopPropagation(),o(l.span_id)},className:"shrink-0 w-5 h-5 flex items-center justify-center cursor-pointer rounded hover:bg-[var(--bg-hover)]",style:{color:"var(--text-muted)"},children:a.jsx("svg",{width:"10",height:"10",viewBox:"0 0 10 10",style:{transform:u?"rotate(90deg)":"rotate(0deg)"},children:a.jsx("path",{d:"M3 1.5L7 5L3 8.5",stroke:"currentColor",strokeWidth:"1.5",fill:"none",strokeLinecap:"round",strokeLinejoin:"round"})})}):a.jsx("span",{className:"shrink-0 w-4"}),a.jsx("span",{className:"shrink-0 flex items-center justify-center w-4 h-4",children:a.jsx(Ms,{kind:h,statusColor:c})}),a.jsx("span",{className:"text-[var(--text-primary)] truncate min-w-0 flex-1",children:l.span_name}),d&&a.jsx("span",{className:"text-[var(--text-muted)] shrink-0 ml-auto pl-2 tabular-nums",children:d})]}),u&&e.children.map((x,y)=>a.jsx(Os,{node:x,depth:t+1,selectedId:n,onSelect:r,isLast:y===e.children.length-1,collapsedIds:s,toggleExpanded:o},x.span.span_id))]})}const lu={DEBUG:{color:"var(--text-muted)",bg:"color-mix(in srgb, var(--text-muted) 15%, var(--bg-secondary))",border:"var(--text-muted)"},INFO:{color:"var(--info)",bg:"color-mix(in srgb, var(--info) 15%, var(--bg-secondary))",border:"var(--info)"},WARN:{color:"var(--warning)",bg:"color-mix(in srgb, var(--warning) 15%, var(--bg-secondary))",border:"var(--warning)"},WARNING:{color:"var(--warning)",bg:"color-mix(in srgb, var(--warning) 15%, var(--bg-secondary))",border:"var(--warning)"},ERROR:{color:"var(--error)",bg:"color-mix(in srgb, var(--error) 15%, var(--bg-secondary))",border:"var(--error)"},CRITICAL:{color:"var(--error)",bg:"color-mix(in srgb, var(--error) 15%, var(--bg-secondary))",border:"var(--error)"}},cu={color:"var(--text-muted)",bg:"transparent"};function qi({logs:e}){const t=N.useRef(null),n=N.useRef(null),[r,i]=N.useState(!1);N.useEffect(()=>{var o;(o=n.current)==null||o.scrollIntoView({behavior:"smooth"})},[e.length]);const s=()=>{const o=t.current;o&&i(o.scrollTop>100)};return e.length===0?a.jsx("div",{className:"h-full flex items-center justify-center",children:a.jsx("p",{className:"text-[var(--text-muted)] text-sm",children:"No logs yet"})}):a.jsxs("div",{className:"h-full relative",children:[a.jsxs("div",{ref:t,onScroll:s,className:"h-full overflow-y-auto font-mono text-xs leading-normal",children:[e.map((o,l)=>{const u=new Date(o.timestamp).toLocaleTimeString(void 0,{hour12:!1}),c=o.level.toUpperCase(),d=c.slice(0,4),p=lu[c]??cu,m=l%2===0;return a.jsxs("div",{className:"flex gap-3 px-3 py-1.5",style:{background:m?"var(--bg-primary)":"var(--bg-secondary)"},children:[a.jsx("span",{className:"text-[var(--text-muted)] shrink-0",children:u}),a.jsx("span",{className:"shrink-0 self-start px-1.5 py-0.5 rounded text-[10px] font-semibold leading-none inline-flex items-center",style:{color:p.color,background:p.bg},children:d}),a.jsx("span",{className:"text-[var(--text-primary)] whitespace-pre-wrap break-all",children:o.message})]},l)}),a.jsx("div",{ref:n})]}),r&&a.jsx("button",{onClick:()=>{var o;return(o=t.current)==null?void 0:o.scrollTo({top:0,behavior:"smooth"})},className:"absolute top-2 right-3 w-6 h-6 flex items-center justify-center rounded-full cursor-pointer transition-opacity opacity-70 hover:opacity-100",style:{background:"var(--bg-tertiary)",color:"var(--text-primary)"},title:"Scroll to top",children:a.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",children:a.jsx("polyline",{points:"18 15 12 9 6 15"})})})]})}const uu={started:{color:"var(--accent)",label:"started"},updated:{color:"var(--info)",label:"updated"},completed:{color:"var(--success)",label:"completed"},faulted:{color:"var(--error)",label:"faulted"}},Vi={color:"var(--text-muted)",label:""};function An({events:e,runStatus:t}){const n=N.useRef(null),r=N.useRef(!0),[i,s]=N.useState(null),o=()=>{const l=n.current;l&&(r.current=l.scrollHeight-l.scrollTop-l.clientHeight<40)};return N.useEffect(()=>{r.current&&n.current&&(n.current.scrollTop=n.current.scrollHeight)}),e.length===0?a.jsx("div",{className:"flex-1 flex items-center justify-center h-full",children:a.jsx("p",{className:"text-xs",style:{color:"var(--text-muted)"},children:t==="running"?"Waiting for events...":"No events yet"})}):a.jsx("div",{ref:n,onScroll:o,className:"h-full overflow-y-auto font-mono text-xs leading-normal",children:e.map((l,u)=>{const c=new Date(l.timestamp).toLocaleTimeString(void 0,{hour12:!1}),d=l.payload&&Object.keys(l.payload).length>0,p=i===u,m=l.phase?uu[l.phase]??Vi:Vi;return a.jsxs("div",{children:[a.jsxs("div",{onClick:()=>{d&&s(p?null:u)},className:"flex items-center gap-2 px-3 py-1.5",style:{background:u%2===0?"var(--bg-primary)":"var(--bg-secondary)",cursor:d?"pointer":"default"},children:[a.jsx("span",{className:"shrink-0",style:{color:"var(--text-muted)"},children:c}),a.jsx("span",{className:"shrink-0",style:{color:m.color},children:"●"}),a.jsx("span",{className:"flex-1 truncate",style:{color:"var(--text-primary)"},children:l.node_name}),m.label&&a.jsx("span",{className:"shrink-0 text-[10px]",style:{color:"var(--text-muted)"},children:m.label}),d&&a.jsx("span",{className:"shrink-0 text-[9px] transition-transform",style:{color:"var(--text-muted)",transform:p?"rotate(90deg)":"rotate(0deg)"},children:"▸"})]}),p&&d&&a.jsx("div",{className:"px-3 py-2 border-t border-b",style:{borderColor:"var(--border)",background:"color-mix(in srgb, var(--bg-secondary) 80%, var(--bg-primary))"},children:a.jsx(ot,{json:JSON.stringify(l.payload,null,2),className:"text-[11px] font-mono whitespace-pre-wrap break-words"})})]},u)})})}function _t({title:e,copyText:t,trailing:n,children:r}){const[i,s]=N.useState(!1),o=N.useCallback(()=>{t&&navigator.clipboard.writeText(t).then(()=>{s(!0),setTimeout(()=>s(!1),1500)})},[t]);return a.jsxs("div",{className:"overflow-hidden",style:{border:"1px solid var(--border)"},children:[a.jsxs("div",{className:"px-3 py-2 flex items-center gap-2",style:{background:"var(--bg-secondary)"},children:[a.jsx("span",{className:"text-[11px] font-semibold",style:{color:"var(--text-primary)"},children:e}),n,t&&a.jsx("button",{onClick:o,className:`${n?"":"ml-auto "}text-[10px] cursor-pointer px-1.5 py-0.5 rounded transition-colors`,style:{color:i?"var(--success)":"var(--text-muted)",background:"var(--bg-tertiary)",border:"none"},onMouseEnter:l=>{i||(l.currentTarget.style.color="var(--text-primary)")},onMouseLeave:l=>{l.currentTarget.style.color=i?"var(--success)":"var(--text-muted)"},children:i?"Copied":"Copy"})]}),r]})}function Yi({runId:e,status:t,ws:n,breakpointNode:r}){const i=t==="suspended",s=o=>{const l=Ee.getState().breakpoints[e]??{};n.setBreakpoints(e,Object.keys(l)),o==="step"?n.debugStep(e):o==="continue"?n.debugContinue(e):n.debugStop(e)};return a.jsxs("div",{className:"flex items-center gap-1 px-4 h-10 border-b shrink-0",style:{borderColor:"var(--border)",background:"var(--bg-secondary)"},children:[a.jsx("span",{className:"text-[11px] font-semibold mr-1",style:{color:"var(--text-muted)"},children:"Debug"}),a.jsx(pr,{label:"Step",onClick:()=>s("step"),disabled:!i,color:"var(--info)",active:i}),a.jsx(pr,{label:"Continue",onClick:()=>s("continue"),disabled:!i,color:"var(--success)",active:i}),a.jsx(pr,{label:"Stop",onClick:()=>s("stop"),disabled:!i,color:"var(--error)",active:i}),a.jsx("span",{className:"text-[11px] ml-auto truncate",style:{color:i?"var(--accent)":"var(--text-muted)"},children:i?r?`Paused at ${r}`:"Paused":t})]})}function pr({label:e,onClick:t,disabled:n,color:r,active:i}){return a.jsx("button",{onClick:t,disabled:n,className:"px-3 py-1 h-7 text-[11px] font-semibold rounded transition-colors cursor-pointer disabled:opacity-30 disabled:cursor-not-allowed",style:{color:i?r:"var(--text-muted)",background:i?`color-mix(in srgb, ${r} 10%, transparent)`:"transparent"},onMouseEnter:s=>{n||(s.currentTarget.style.background=`color-mix(in srgb, ${r} 20%, transparent)`)},onMouseLeave:s=>{s.currentTarget.style.background=i?`color-mix(in srgb, ${r} 10%, transparent)`:"transparent"},children:e})}const Xi=N.lazy(()=>Ts(()=>import("./ChatPanel-DR8dCKHB.js"),__vite__mapDeps([2,1,3,4]))),du=[],pu=[],fu=[],mu=[];function gu({run:e,ws:t,isMobile:n}){const r=e.mode==="chat",[i,s]=N.useState(280),[o,l]=N.useState(()=>{const C=localStorage.getItem("chatPanelWidth");return C?parseInt(C,10):380}),[u,c]=N.useState("primary"),[d,p]=N.useState(r?"primary":"traces"),m=N.useRef(null),f=N.useRef(null),h=N.useRef(!1),b=Ee(C=>C.traces[e.id]||du),x=Ee(C=>C.logs[e.id]||pu),y=Ee(C=>C.chatMessages[e.id]||fu),w=Ee(C=>C.stateEvents[e.id]||mu),T=Ee(C=>C.breakpoints[e.id]);N.useEffect(()=>{t.setBreakpoints(e.id,T?Object.keys(T):[])},[e.id]);const j=N.useCallback(C=>{t.setBreakpoints(e.id,C)},[e.id,t]),O=N.useCallback(C=>{C.preventDefault(),h.current=!0;const v="touches"in C?C.touches[0].clientY:C.clientY,E=i,I=U=>{if(!h.current)return;const V=m.current;if(!V)return;const g="touches"in U?U.touches[0].clientY:U.clientY,F=V.clientHeight-100,$=Math.max(80,Math.min(F,E+(g-v)));s($)},H=()=>{h.current=!1,document.removeEventListener("mousemove",I),document.removeEventListener("mouseup",H),document.removeEventListener("touchmove",I),document.removeEventListener("touchend",H),document.body.style.cursor="",document.body.style.userSelect=""};document.body.style.cursor="row-resize",document.body.style.userSelect="none",document.addEventListener("mousemove",I),document.addEventListener("mouseup",H),document.addEventListener("touchmove",I,{passive:!1}),document.addEventListener("touchend",H)},[i]),_=N.useCallback(C=>{C.preventDefault();const v="touches"in C?C.touches[0].clientX:C.clientX,E=o,I=U=>{const V=f.current;if(!V)return;const g="touches"in U?U.touches[0].clientX:U.clientX,F=V.clientWidth-300,$=Math.max(280,Math.min(F,E+(v-g)));l($)},H=()=>{document.removeEventListener("mousemove",I),document.removeEventListener("mouseup",H),document.removeEventListener("touchmove",I),document.removeEventListener("touchend",H),document.body.style.cursor="",document.body.style.userSelect="",localStorage.setItem("chatPanelWidth",String(o))};document.body.style.cursor="col-resize",document.body.style.userSelect="none",document.addEventListener("mousemove",I),document.addEventListener("mouseup",H),document.addEventListener("touchmove",I,{passive:!1}),document.addEventListener("touchend",H)},[o]),P=r?"Chat":"Events",D=r?"var(--accent)":"var(--success)",R=C=>C==="primary"?D:C==="events"?"var(--success)":"var(--accent)",S=Ee(C=>C.activeInterrupt[e.id]??null),M=e.status==="running"?a.jsx("span",{className:"ml-auto text-[11px] px-2 py-0.5 rounded-full shrink-0",style:{background:"color-mix(in srgb, var(--warning) 15%, var(--bg-secondary))",color:"var(--warning)"},children:r?"Thinking...":"Running..."}):r&&e.status==="suspended"&&S?a.jsx("span",{className:"ml-auto text-[11px] px-2 py-0.5 rounded-full shrink-0",style:{background:"color-mix(in srgb, var(--warning) 15%, var(--bg-secondary))",color:"var(--warning)"},children:"Action Required"}):null;if(n){const C=[{id:"traces",label:"Traces",count:b.length},{id:"primary",label:P},...r?[{id:"events",label:"Events",count:w.length}]:[],{id:"io",label:"I/O"},{id:"logs",label:"Logs",count:x.length}];return a.jsxs("div",{className:"flex flex-col h-full",children:[(e.mode==="debug"||e.status==="suspended"&&!S||T&&Object.keys(T).length>0)&&a.jsx(Yi,{runId:e.id,status:e.status,ws:t,breakpointNode:e.breakpoint_node}),a.jsx("div",{className:"shrink-0",style:{height:"40vh"},children:a.jsx(Un,{entrypoint:e.entrypoint,traces:b,runId:e.id,breakpointNode:e.breakpoint_node,breakpointNextNodes:e.breakpoint_next_nodes,onBreakpointChange:j})}),a.jsxs("div",{className:"flex items-center gap-1 px-2 h-10 border-y shrink-0",style:{borderColor:"var(--border)",background:"var(--bg-secondary)"},children:[C.map(v=>a.jsxs("button",{onClick:()=>p(v.id),className:"px-2.5 py-1 h-7 text-xs font-semibold rounded transition-colors cursor-pointer",style:{color:d===v.id?R(v.id):"var(--text-muted)",background:d===v.id?`color-mix(in srgb, ${R(v.id)} 10%, transparent)`:"transparent"},children:[v.label,v.count!==void 0&&v.count>0&&a.jsx("span",{className:"ml-1 font-normal",style:{color:"var(--text-muted)"},children:v.count})]},v.id)),M]}),a.jsxs("div",{className:"flex-1 overflow-hidden",children:[d==="traces"&&a.jsx(Dr,{traces:b}),d==="primary"&&(r?a.jsx(N.Suspense,{fallback:a.jsx("div",{className:"flex items-center justify-center h-full",style:{color:"var(--text-muted)"},children:a.jsx("span",{className:"text-xs",children:"Loading chat..."})}),children:a.jsx(Xi,{messages:y,runId:e.id,runStatus:e.status,ws:t})}):a.jsx(An,{events:w,runStatus:e.status})),d==="events"&&a.jsx(An,{events:w,runStatus:e.status}),d==="io"&&a.jsx(Zi,{run:e}),d==="logs"&&a.jsx(qi,{logs:x})]})]})}const L=[{id:"primary",label:P},...r?[{id:"events",label:"Events",count:w.length}]:[],{id:"io",label:"I/O"},{id:"logs",label:"Logs",count:x.length}];return a.jsxs("div",{ref:f,className:"flex h-full",children:[a.jsxs("div",{ref:m,className:"flex flex-col flex-1 min-w-0",children:[(e.mode==="debug"||e.status==="suspended"&&!S||T&&Object.keys(T).length>0)&&a.jsx(Yi,{runId:e.id,status:e.status,ws:t,breakpointNode:e.breakpoint_node}),a.jsx("div",{className:"shrink-0 overflow-hidden",style:{height:i},children:a.jsx(Un,{entrypoint:e.entrypoint,traces:b,runId:e.id,breakpointNode:e.breakpoint_node,breakpointNextNodes:e.breakpoint_next_nodes,onBreakpointChange:j})}),a.jsx("div",{onMouseDown:O,onTouchStart:O,className:"shrink-0 drag-handle-row"}),a.jsx("div",{className:"flex-1 overflow-hidden",children:a.jsx(Dr,{traces:b})})]}),a.jsx("div",{onMouseDown:_,onTouchStart:_,className:"shrink-0 drag-handle-col"}),a.jsxs("div",{className:"shrink-0 flex flex-col",style:{width:o,background:"var(--bg-primary)"},children:[a.jsxs("div",{className:"flex items-center gap-1 px-2 h-10 border-b shrink-0",style:{borderColor:"var(--border)",background:"var(--bg-secondary)"},children:[L.map(C=>a.jsxs("button",{onClick:()=>c(C.id),className:"px-2.5 py-1 h-7 text-xs font-semibold rounded transition-colors cursor-pointer",style:{color:u===C.id?R(C.id):"var(--text-muted)",background:u===C.id?`color-mix(in srgb, ${R(C.id)} 10%, transparent)`:"transparent"},onMouseEnter:v=>{u!==C.id&&(v.currentTarget.style.color="var(--text-primary)")},onMouseLeave:v=>{u!==C.id&&(v.currentTarget.style.color="var(--text-muted)")},children:[C.label,C.count!==void 0&&C.count>0&&a.jsx("span",{className:"ml-1 font-normal",style:{color:"var(--text-muted)"},children:C.count})]},C.id)),M]}),a.jsxs("div",{className:"flex-1 overflow-hidden",children:[u==="primary"&&(r?a.jsx(N.Suspense,{fallback:a.jsx("div",{className:"flex items-center justify-center h-full",style:{color:"var(--text-muted)"},children:a.jsx("span",{className:"text-xs",children:"Loading chat..."})}),children:a.jsx(Xi,{messages:y,runId:e.id,runStatus:e.status,ws:t})}):a.jsx(An,{events:w,runStatus:e.status})),u==="events"&&a.jsx(An,{events:w,runStatus:e.status}),u==="io"&&a.jsx(Zi,{run:e}),u==="logs"&&a.jsx(qi,{logs:x})]})]})]})}function Zi({run:e}){return a.jsxs("div",{className:"p-2 overflow-y-auto h-full space-y-1.5",children:[a.jsx(_t,{title:"Input",copyText:JSON.stringify(e.input_data,null,2),children:a.jsx(ot,{json:JSON.stringify(e.input_data,null,2),className:"px-3 py-2 text-xs font-mono whitespace-pre-wrap break-words"})}),e.output_data&&a.jsx(_t,{title:"Output",copyText:typeof e.output_data=="string"?e.output_data:JSON.stringify(e.output_data,null,2),children:a.jsx(ot,{json:typeof e.output_data=="string"?e.output_data:JSON.stringify(e.output_data,null,2),className:"px-3 py-2 text-xs font-mono whitespace-pre-wrap break-words"})}),e.error&&a.jsxs("div",{className:"overflow-hidden",style:{border:"1px solid color-mix(in srgb, var(--error) 40%, var(--border))"},children:[a.jsxs("div",{className:"px-3 py-2 text-xs font-semibold flex items-center gap-2",style:{background:"color-mix(in srgb, var(--error) 15%, var(--bg-secondary))",color:"var(--error)"},children:[a.jsx("span",{children:"Error"}),a.jsx("span",{className:"px-1.5 py-0.5 rounded text-[10px] font-mono",style:{background:"color-mix(in srgb, var(--error) 20%, var(--bg-secondary))"},children:e.error.code}),a.jsx("span",{className:"px-1.5 py-0.5 rounded text-[10px] font-mono",style:{background:"color-mix(in srgb, var(--error) 20%, var(--bg-secondary))"},children:e.error.category})]}),a.jsxs("div",{className:"px-3 py-2 text-xs leading-normal",children:[a.jsx("div",{className:"font-semibold mb-2",style:{color:"var(--text-primary)"},children:e.error.title}),a.jsx("pre",{className:"whitespace-pre-wrap font-mono text-[11px] max-w-prose",style:{color:"var(--text-secondary)"},children:e.error.detail})]})]})]})}function Ji(){const{reloadPending:e,setReloadPending:t,setEntrypoints:n}=Ee(),[r,i]=N.useState(!1);if(!e)return null;const s=async()=>{i(!0);try{await nc();const o=await ks();n(o.map(l=>l.name)),t(!1)}catch(o){console.error("Reload failed:",o)}finally{i(!1)}};return a.jsxs("div",{className:"fixed top-4 left-1/2 -translate-x-1/2 z-50 flex items-center justify-between px-5 py-2.5 rounded-lg shadow-lg min-w-[400px]",style:{background:"var(--bg-secondary)",border:"1px solid var(--bg-tertiary)"},children:[a.jsx("span",{className:"text-sm",style:{color:"var(--text-secondary)"},children:"Files changed, reload to apply"}),a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("button",{onClick:s,disabled:r,className:"px-3 py-1 text-sm font-medium rounded cursor-pointer",style:{background:"var(--accent)",color:"#fff",opacity:r?.6:1},children:r?"Reloading...":"Reload"}),a.jsx("button",{onClick:()=>t(!1),className:"text-sm cursor-pointer px-1",style:{color:"var(--text-muted)",background:"none",border:"none"},children:"✕"})]})]})}let hu=0;const Qi=Ot(e=>({toasts:[],addToast:(t,n)=>{const r=String(++hu);e(s=>({toasts:[...s.toasts,{id:r,type:t,message:n}]})),setTimeout(()=>{e(s=>({toasts:s.toasts.filter(o=>o.id!==r)}))},t==="error"?8e3:5e3)},removeToast:t=>{e(n=>({toasts:n.toasts.filter(r=>r.id!==t)}))}})),eo={success:{color:"var(--success)",bg:"color-mix(in srgb, var(--success) 10%, var(--bg-elevated))",border:"color-mix(in srgb, var(--success) 30%, var(--border))"},error:{color:"var(--error)",bg:"color-mix(in srgb, var(--error) 10%, var(--bg-elevated))",border:"color-mix(in srgb, var(--error) 30%, var(--border))"},info:{color:"var(--info)",bg:"color-mix(in srgb, var(--info) 10%, var(--bg-elevated))",border:"color-mix(in srgb, var(--info) 30%, var(--border))"}};function to(){const e=Qi(n=>n.toasts),t=Qi(n=>n.removeToast);return e.length===0?null:a.jsx("div",{className:"fixed bottom-8 right-4 z-[100] flex flex-col gap-2 pointer-events-none",children:e.map(n=>{const r=eo[n.type]??eo.info;return a.jsxs("div",{className:"pointer-events-auto flex items-center gap-2 px-4 py-2.5 rounded-lg shadow-lg text-xs font-medium max-w-xs animate-[slideIn_0.2s_ease-out]",style:{background:r.bg,border:`1px solid ${r.border}`,color:r.color},children:[a.jsx("span",{className:"flex-1",children:n.message}),a.jsx("button",{onClick:()=>t(n.id),className:"shrink-0 w-5 h-5 flex items-center justify-center rounded cursor-pointer transition-opacity opacity-60 hover:opacity-100",style:{color:r.color,background:"transparent",border:"none"},"aria-label":"Dismiss",children:a.jsxs("svg",{width:"10",height:"10",viewBox:"0 0 10 10",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",children:[a.jsx("line",{x1:"1",y1:"1",x2:"9",y2:"9"}),a.jsx("line",{x1:"9",y1:"1",x2:"1",y2:"9"})]})})]},n.id)})})}function bu(e){return e===null?"-":`${Math.round(e*100)}%`}function xu(e){if(e===null)return"var(--text-muted)";const t=e*100;return t>=80?"var(--success)":t>=50?"var(--warning)":"var(--error)"}const no={pending:{color:"var(--text-muted)",label:"Pending"},running:{color:"var(--info)",label:"Running"},completed:{color:"var(--success)",label:"Completed"},failed:{color:"var(--error)",label:"Failed"}};function ro(){const e=Me(l=>l.evalSets),t=Me(l=>l.evalRuns),{evalSetId:n,evalRunId:r,navigate:i}=st(),s=Object.values(e),o=Object.values(t).sort((l,u)=>new Date(u.start_time??0).getTime()-new Date(l.start_time??0).getTime());return a.jsxs("div",{className:"flex-1 overflow-y-auto",children:[a.jsx("button",{onClick:()=>i("#/evals/new"),className:"w-[calc(100%-24px)] mx-3 mt-2.5 mb-1 px-3 py-1.5 text-[11px] text-center font-medium rounded border border-[var(--border)] bg-transparent transition-colors cursor-pointer",style:{color:"var(--text-secondary)"},onMouseEnter:l=>{l.currentTarget.style.color="var(--text-primary)",l.currentTarget.style.borderColor="var(--text-muted)"},onMouseLeave:l=>{l.currentTarget.style.color="var(--text-secondary)",l.currentTarget.style.borderColor=""},children:"+ New Eval Set"}),a.jsx("div",{className:"px-3 pt-3 pb-1 text-[11px] uppercase tracking-widest font-semibold",style:{color:"var(--text-muted)"},children:"Eval Sets"}),s.map(l=>{const u=n===l.id;return a.jsxs("button",{onClick:()=>i(`#/evals/sets/${l.id}`),className:"w-full text-left px-3 py-1.5 text-xs cursor-pointer transition-colors",style:{background:u?"color-mix(in srgb, var(--accent) 15%, var(--bg-primary))":"transparent",color:u?"var(--text-primary)":"var(--text-secondary)",borderLeft:u?"3px solid var(--accent)":"3px solid transparent"},onMouseEnter:c=>{u||(c.currentTarget.style.background="var(--bg-hover)")},onMouseLeave:c=>{u||(c.currentTarget.style.background="transparent")},children:[a.jsx("div",{className:"truncate font-medium",children:l.name}),a.jsxs("div",{className:"text-[11px] mt-0.5",style:{color:"var(--text-muted)"},children:[l.eval_count," items · ",l.evaluator_ids.length," evaluator",l.evaluator_ids.length!==1?"s":""]})]},l.id)}),s.length===0&&a.jsx("p",{className:"text-[11px] px-3 py-2",style:{color:"var(--text-muted)"},children:"No eval sets yet"}),a.jsx("div",{className:"px-3 pt-4 pb-1 text-[11px] uppercase tracking-widest font-semibold",style:{color:"var(--text-muted)"},children:"History"}),o.map(l=>{const u=r===l.id,c=no[l.status]??no.pending;return a.jsx("button",{onClick:()=>i(`#/evals/runs/${l.id}`),className:"w-full text-left px-3 py-1.5 text-xs cursor-pointer transition-colors",style:{background:u?"color-mix(in srgb, var(--accent) 15%, var(--bg-primary))":"transparent",color:u?"var(--text-primary)":"var(--text-secondary)",borderLeft:u?"3px solid var(--accent)":"3px solid transparent"},onMouseEnter:d=>{u||(d.currentTarget.style.background="var(--bg-hover)")},onMouseLeave:d=>{u||(d.currentTarget.style.background="transparent")},children:a.jsxs("div",{className:"flex items-center gap-1.5",children:[a.jsx("div",{className:"w-2 h-2 rounded-full shrink-0",style:{background:c.color}}),a.jsxs("div",{className:"flex-1 min-w-0",children:[a.jsx("div",{className:"truncate font-medium",children:l.eval_set_name}),a.jsx("div",{className:"text-[11px] mt-0.5",style:{color:"var(--text-muted)"},children:l.start_time?new Date(l.start_time).toLocaleString():c.label})]}),a.jsx("span",{className:"font-mono shrink-0",style:{color:xu(l.overall_score)},children:bu(l.overall_score)})]})},l.id)}),o.length===0&&a.jsx("p",{className:"text-[11px] px-3 py-2",style:{color:"var(--text-muted)"},children:"No eval runs yet"})]})}function io(e,t=60){const n=typeof e=="string"?e:JSON.stringify(e);return!n||n==="null"?"-":n.length>t?n.slice(0,t)+"...":n}function yu({evalSetId:e}){const[t,n]=N.useState(null),[r,i]=N.useState(!0),[s,o]=N.useState(null),[l,u]=N.useState(!1),[c,d]=N.useState("io"),p=Me(g=>g.evaluators),m=Me(g=>g.localEvaluators),f=Me(g=>g.updateEvalSetEvaluators),h=Me(g=>g.incrementEvalSetCount),b=Me(g=>g.upsertEvalRun),{navigate:x}=st(),[y,w]=N.useState(!1),[T,j]=N.useState(new Set),[O,_]=N.useState(!1),P=N.useRef(null),[D,R]=N.useState(()=>{const g=localStorage.getItem("evalSetSidebarWidth");return g?parseInt(g,10):320}),[S,M]=N.useState(!1),L=N.useRef(null);N.useEffect(()=>{localStorage.setItem("evalSetSidebarWidth",String(D))},[D]),N.useEffect(()=>{i(!0),o(null),fc(e).then(g=>{n(g),g.items.length>0&&o(g.items[0].name)}).catch(console.error).finally(()=>i(!1))},[e]);const C=async()=>{u(!0);try{const g=await mc(e);b(g),x(`#/evals/runs/${g.id}`)}catch(g){console.error(g)}finally{u(!1)}},v=async g=>{if(t)try{await pc(e,g),n(F=>{if(!F)return F;const $=F.items.filter(k=>k.name!==g);return{...F,items:$,eval_count:$.length}}),h(e,-1),s===g&&o(null)}catch(F){console.error(F)}},E=N.useCallback(()=>{t&&j(new Set(t.evaluator_ids)),w(!0)},[t]),I=g=>{j(F=>{const $=new Set(F);return $.has(g)?$.delete(g):$.add(g),$})},H=async()=>{if(t){_(!0);try{const g=await bc(e,Array.from(T));n(g),f(e,g.evaluator_ids),w(!1)}catch(g){console.error(g)}finally{_(!1)}}};N.useEffect(()=>{if(!y)return;const g=F=>{P.current&&!P.current.contains(F.target)&&w(!1)};return document.addEventListener("mousedown",g),()=>document.removeEventListener("mousedown",g)},[y]);const U=N.useCallback(g=>{g.preventDefault(),M(!0);const F="touches"in g?g.touches[0].clientX:g.clientX,$=D,k=K=>{const W=L.current;if(!W)return;const re="touches"in K?K.touches[0].clientX:K.clientX,de=W.clientWidth-300,xe=Math.max(280,Math.min(de,$+(F-re)));R(xe)},ie=()=>{M(!1),document.removeEventListener("mousemove",k),document.removeEventListener("mouseup",ie),document.removeEventListener("touchmove",k),document.removeEventListener("touchend",ie),document.body.style.cursor="",document.body.style.userSelect=""};document.body.style.cursor="col-resize",document.body.style.userSelect="none",document.addEventListener("mousemove",k),document.addEventListener("mouseup",ie),document.addEventListener("touchmove",k,{passive:!1}),document.addEventListener("touchend",ie)},[D]);if(r)return a.jsx("div",{className:"flex items-center justify-center h-full text-[var(--text-muted)] text-sm",children:"Loading..."});if(!t)return a.jsx("div",{className:"flex items-center justify-center h-full text-[var(--text-muted)]",children:"Eval set not found"});const V=t.items.find(g=>g.name===s)??null;return a.jsxs("div",{ref:L,className:"flex h-full",children:[a.jsxs("div",{className:"flex flex-col flex-1 min-w-0",children:[a.jsxs("div",{className:"px-4 h-10 border-b shrink-0 flex items-center gap-4",style:{borderColor:"var(--border)"},children:[a.jsx("h1",{className:"text-base font-semibold",style:{color:"var(--text-primary)"},children:t.name}),a.jsxs("span",{className:"text-[11px]",style:{color:"var(--text-muted)"},children:[t.eval_count," items"]}),a.jsxs("div",{className:"flex gap-1 items-center ml-auto relative",children:[a.jsx("button",{onClick:E,className:"w-7 h-7 flex items-center justify-center rounded cursor-pointer transition-colors",style:{color:"var(--text-muted)",background:"transparent",border:"none"},onMouseEnter:g=>{g.currentTarget.style.color="var(--text-primary)",g.currentTarget.style.background="var(--bg-secondary)"},onMouseLeave:g=>{g.currentTarget.style.color="var(--text-muted)",g.currentTarget.style.background="transparent"},title:"Edit evaluators","aria-label":"Edit evaluators",children:a.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[a.jsx("path",{d:"M17 3a2.85 2.83 0 1 1 4 4L7.5 20.5 2 22l1.5-5.5Z"}),a.jsx("path",{d:"m15 5 4 4"})]})}),t.evaluator_ids.map(g=>{const F=p.find($=>$.id===g);return a.jsx("span",{className:"px-1.5 py-0.5 rounded text-[11px] font-medium",style:{background:"var(--bg-tertiary)",color:"var(--text-secondary)"},children:(F==null?void 0:F.name)??g},g)}),y&&a.jsxs("div",{ref:P,className:"absolute top-full right-0 mt-1 z-50 rounded-md border shadow-lg",style:{background:"var(--bg-primary)",borderColor:"var(--border)",minWidth:220},children:[a.jsx("div",{className:"px-3 py-2 border-b text-[10px] uppercase tracking-wide font-semibold",style:{color:"var(--text-muted)",borderColor:"var(--border)"},children:"Evaluators"}),a.jsx("div",{className:"max-h-48 overflow-y-auto",children:m.length===0?a.jsx("div",{className:"px-3 py-3 text-xs",style:{color:"var(--text-muted)"},children:"No evaluators available"}):m.map(g=>a.jsxs("label",{className:"flex items-center gap-2 px-3 py-1.5 text-xs cursor-pointer transition-colors",style:{borderBottom:"1px solid var(--border)"},onMouseEnter:F=>{F.currentTarget.style.background="var(--bg-hover)"},onMouseLeave:F=>{F.currentTarget.style.background="transparent"},children:[a.jsx("input",{type:"checkbox",checked:T.has(g.id),onChange:()=>I(g.id),className:"accent-[var(--accent)]"}),a.jsx("span",{className:"flex-1 truncate",style:{color:"var(--text-primary)"},children:g.name})]},g.id))}),a.jsx("div",{className:"px-3 py-2 border-t flex justify-end",style:{borderColor:"var(--border)"},children:a.jsx("button",{onClick:H,disabled:O,className:"px-3 py-1 text-[11px] font-semibold rounded cursor-pointer transition-colors disabled:opacity-50",style:{background:"var(--accent)",color:"var(--bg-primary)",border:"none"},onMouseEnter:g=>{g.currentTarget.style.background="var(--accent-hover)"},onMouseLeave:g=>{g.currentTarget.style.background="var(--accent)"},children:O?"Saving...":"Update"})})]})]}),a.jsxs("button",{onClick:C,disabled:l,className:"ml-2 px-3 py-1 h-7 text-xs font-semibold rounded border flex items-center gap-1.5 cursor-pointer transition-colors disabled:opacity-30 disabled:cursor-not-allowed",style:{color:"var(--success)",borderColor:"var(--success)",background:"transparent"},onMouseEnter:g=>{l||(g.currentTarget.style.background="color-mix(in srgb, var(--success) 10%, transparent)")},onMouseLeave:g=>{g.currentTarget.style.background="transparent"},title:"Run eval set","aria-label":"Run eval set",children:[a.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"currentColor",stroke:"none",children:a.jsx("polygon",{points:"5,3 19,12 5,21"})}),l?"Running...":"Run"]})]}),a.jsxs("div",{className:"flex items-center px-3 h-7 text-[11px] font-semibold shrink-0 border-b",style:{color:"var(--text-muted)",background:"var(--bg-secondary)",borderColor:"var(--border)"},children:[a.jsx("span",{className:"w-56 shrink-0",children:"Name"}),a.jsx("span",{className:"flex-1 min-w-0",children:"Input"}),a.jsx("span",{className:"w-32 shrink-0 pl-2",children:"Expected Behavior"}),a.jsx("span",{className:"w-32 shrink-0 pl-2",children:"Expected Output"}),a.jsx("span",{className:"w-32 shrink-0 pl-2",children:"Simulation Instr."}),a.jsx("span",{className:"w-8 shrink-0"})]}),a.jsxs("div",{className:"flex-1 overflow-y-auto",children:[t.items.map(g=>{const F=g.name===s;return a.jsxs("button",{onClick:()=>o(F?null:g.name),className:"group w-full text-left px-3 py-1.5 flex items-center text-xs border-b transition-colors cursor-pointer",style:{borderColor:"var(--border)",background:F?"color-mix(in srgb, var(--accent) 10%, var(--bg-primary))":void 0,borderLeft:F?"3px solid var(--accent)":"3px solid transparent"},onMouseEnter:$=>{F||($.currentTarget.style.background="var(--bg-hover)")},onMouseLeave:$=>{F||($.currentTarget.style.background="")},children:[a.jsx("span",{className:"w-56 shrink-0 truncate",style:{color:"var(--text-primary)"},children:g.name}),a.jsx("span",{className:"flex-1 min-w-0 truncate font-mono text-[11px]",style:{color:"var(--text-muted)"},children:io(g.inputs)}),a.jsx("span",{className:"w-32 shrink-0 truncate pl-2 text-[11px]",style:{color:"var(--text-muted)"},children:g.expected_behavior||"-"}),a.jsx("span",{className:"w-32 shrink-0 truncate pl-2 font-mono text-[11px]",style:{color:"var(--text-muted)"},children:io(g.expected_output,40)}),a.jsx("span",{className:"w-32 shrink-0 truncate pl-2 text-[11px]",style:{color:"var(--text-muted)"},children:g.simulation_instructions||"-"}),a.jsx("span",{role:"button",tabIndex:0,className:"w-8 shrink-0 flex items-center justify-center opacity-0 group-hover:opacity-100 transition-opacity",onClick:$=>{$.stopPropagation(),v(g.name)},onKeyDown:$=>{$.key==="Enter"&&($.stopPropagation(),v(g.name))},style:{color:"var(--text-muted)"},onMouseEnter:$=>{$.currentTarget.style.color="var(--error)"},onMouseLeave:$=>{$.currentTarget.style.color="var(--text-muted)"},title:"Delete item",children:a.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",children:[a.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),a.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})]},g.name)}),t.items.length===0&&a.jsx("div",{className:"flex items-center justify-center py-8 text-[var(--text-muted)] text-xs",children:"No items in this eval set"})]})]}),a.jsx("div",{onMouseDown:U,onTouchStart:U,className:`shrink-0 drag-handle-col${S?"":" transition-all"}`,style:{width:V?3:0,opacity:V?1:0}}),a.jsxs("div",{className:`shrink-0 flex flex-col overflow-hidden${S?"":" transition-[width] duration-200 ease-in-out"}`,style:{width:V?D:0,background:"var(--bg-primary)"},children:[a.jsx("div",{className:"flex items-center gap-1 px-2 h-10 border-b shrink-0",style:{borderColor:"var(--border)",background:"var(--bg-secondary)",minWidth:D},children:["io","evaluators"].map(g=>{const F=c===g,$=g==="io"?"I/O":"Evaluators";return a.jsx("button",{onClick:()=>d(g),className:"px-2.5 py-1 h-7 text-xs font-semibold rounded inline-flex items-center cursor-pointer transition-colors",style:{color:F?"var(--accent)":"var(--text-muted)",background:F?"color-mix(in srgb, var(--accent) 10%, transparent)":"transparent",border:"none"},children:$},g)})}),a.jsx("div",{className:"flex-1 overflow-hidden",style:{minWidth:D},children:V?c==="io"?a.jsx(vu,{item:V}):a.jsx(ku,{item:V,evaluators:p}):null})]})]})}function vu({item:e}){const t=JSON.stringify(e.inputs,null,2),n=e.expected_output!=null?typeof e.expected_output=="string"?e.expected_output:JSON.stringify(e.expected_output,null,2):null;return a.jsxs("div",{className:"p-2 overflow-y-auto h-full space-y-1.5",children:[a.jsx(_t,{title:"Input",copyText:t,children:a.jsx(ot,{json:t,className:"px-3 py-2 text-xs font-mono whitespace-pre-wrap break-words"})}),e.expected_behavior&&a.jsx(_t,{title:"Expected Behavior",copyText:e.expected_behavior,children:a.jsx("div",{className:"px-3 py-2 text-xs leading-relaxed whitespace-pre-wrap",style:{color:"var(--text-secondary)"},children:e.expected_behavior})}),n&&a.jsx(_t,{title:"Expected Output",copyText:n,children:a.jsx(ot,{json:n,className:"px-3 py-2 text-xs font-mono whitespace-pre-wrap break-words"})}),e.simulation_instructions&&a.jsx(_t,{title:"Simulation Instructions",copyText:e.simulation_instructions,children:a.jsx("div",{className:"px-3 py-2 text-xs leading-relaxed whitespace-pre-wrap",style:{color:"var(--text-secondary)"},children:e.simulation_instructions})})]})}function ku({item:e,evaluators:t}){return a.jsx("div",{className:"p-2 overflow-y-auto h-full space-y-1.5",children:e.evaluator_ids.length>0?a.jsx(a.Fragment,{children:e.evaluator_ids.map(n=>{var s;const r=t.find(o=>o.id===n),i=(s=e.evaluation_criterias)==null?void 0:s[n];return a.jsxs("div",{className:"overflow-hidden",style:{border:"1px solid var(--border)"},children:[a.jsxs("div",{className:"px-3 py-2 flex items-center gap-2",style:{background:"var(--bg-secondary)"},children:[a.jsx("span",{className:"text-[11px] font-semibold",style:{color:"var(--text-primary)"},children:(r==null?void 0:r.name)??n}),a.jsx("span",{className:"ml-auto text-[10px]",style:{color:"var(--text-muted)"},children:i?"Custom criteria":"Default criteria"})]}),i&&a.jsx("pre",{className:"px-3 py-2 border-t text-[11px] font-mono overflow-x-auto max-h-32 whitespace-pre-wrap break-words",style:{borderColor:"var(--border)",color:"var(--text-secondary)"},children:JSON.stringify(i,null,2)})]},n)})}):a.jsx("div",{className:"flex items-center justify-center h-full text-[var(--text-muted)] text-xs",children:"No evaluators configured for this item"})})}function en(e){return e===null?"-":`${Math.round(e*100)}%`}function wt(e){if(e===null)return"var(--text-muted)";const t=e*100;return t>=80?"var(--success)":t>=50?"var(--warning)":"var(--error)"}function Eu(e,t){if(!e)return"-";const n=new Date(e).getTime(),r=t?new Date(t).getTime():Date.now(),i=Math.round((r-n)/1e3);return i<60?`${i}s`:`${Math.floor(i/60)}m ${i%60}s`}function oo(e){return e.replace(/\s*Evaluator$/i,"")}const so={pending:{color:"var(--text-muted)",bg:"var(--bg-tertiary)",label:"Pending"},running:{color:"var(--info)",bg:"rgba(59,130,246,0.1)",label:"Running"},completed:{color:"var(--success)",bg:"rgba(34,197,94,0.1)",label:"Completed"},failed:{color:"var(--error)",bg:"rgba(239,68,68,0.1)",label:"Failed"}};function wu({evalRunId:e,itemName:t}){const[n,r]=N.useState(null),[i,s]=N.useState(!0),{navigate:o}=st(),l=t??null,[u,c]=N.useState(220),d=N.useRef(null),p=N.useRef(!1),[m,f]=N.useState(()=>{const M=localStorage.getItem("evalSidebarWidth");return M?parseInt(M,10):320}),[h,b]=N.useState(!1),x=N.useRef(null);N.useEffect(()=>{localStorage.setItem("evalSidebarWidth",String(m))},[m]);const y=Me(M=>M.evalRuns[e]),w=Me(M=>M.evaluators);N.useEffect(()=>{s(!0),Li(e).then(M=>{if(r(M),!t){const L=M.results.find(C=>C.status==="completed")??M.results[0];L&&o(`#/evals/runs/${e}/${encodeURIComponent(L.name)}`)}}).catch(console.error).finally(()=>s(!1))},[e]),N.useEffect(()=>{((y==null?void 0:y.status)==="completed"||(y==null?void 0:y.status)==="failed")&&Li(e).then(r).catch(console.error)},[y==null?void 0:y.status,e]),N.useEffect(()=>{if(t||!(n!=null&&n.results))return;const M=n.results.find(L=>L.status==="completed")??n.results[0];M&&o(`#/evals/runs/${e}/${encodeURIComponent(M.name)}`)},[n==null?void 0:n.results]);const T=N.useCallback(M=>{M.preventDefault(),p.current=!0;const L="touches"in M?M.touches[0].clientY:M.clientY,C=u,v=I=>{if(!p.current)return;const H=d.current;if(!H)return;const U="touches"in I?I.touches[0].clientY:I.clientY,V=H.clientHeight-100,g=Math.max(80,Math.min(V,C+(U-L)));c(g)},E=()=>{p.current=!1,document.removeEventListener("mousemove",v),document.removeEventListener("mouseup",E),document.removeEventListener("touchmove",v),document.removeEventListener("touchend",E),document.body.style.cursor="",document.body.style.userSelect=""};document.body.style.cursor="row-resize",document.body.style.userSelect="none",document.addEventListener("mousemove",v),document.addEventListener("mouseup",E),document.addEventListener("touchmove",v,{passive:!1}),document.addEventListener("touchend",E)},[u]),j=N.useCallback(M=>{M.preventDefault(),b(!0);const L="touches"in M?M.touches[0].clientX:M.clientX,C=m,v=I=>{const H=x.current;if(!H)return;const U="touches"in I?I.touches[0].clientX:I.clientX,V=H.clientWidth-300,g=Math.max(280,Math.min(V,C+(L-U)));f(g)},E=()=>{b(!1),document.removeEventListener("mousemove",v),document.removeEventListener("mouseup",E),document.removeEventListener("touchmove",v),document.removeEventListener("touchend",E),document.body.style.cursor="",document.body.style.userSelect=""};document.body.style.cursor="col-resize",document.body.style.userSelect="none",document.addEventListener("mousemove",v),document.addEventListener("mouseup",E),document.addEventListener("touchmove",v,{passive:!1}),document.addEventListener("touchend",E)},[m]);if(i)return a.jsx("div",{className:"flex items-center justify-center h-full text-[var(--text-muted)] text-sm",children:"Loading..."});if(!n)return a.jsx("div",{className:"flex items-center justify-center h-full text-[var(--text-muted)]",children:"Eval run not found"});const O=y??n,_=so[O.status]??so.pending,P=O.status==="running",D=Object.keys(O.evaluator_scores??{}),R=n.results.find(M=>M.name===l)??null,S=((R==null?void 0:R.traces)??[]).map(M=>({...M,run_id:""}));return a.jsxs("div",{ref:x,className:"flex h-full",children:[a.jsxs("div",{ref:d,className:"flex flex-col flex-1 min-w-0",children:[a.jsxs("div",{className:"px-4 h-10 border-b shrink-0 flex items-center gap-4",style:{borderColor:"var(--border)"},children:[a.jsx("h1",{className:"text-base font-semibold truncate min-w-0",style:{color:"var(--text-primary)"},children:O.eval_set_name}),a.jsx("span",{className:"px-2 py-0.5 rounded text-[11px] font-semibold uppercase tracking-wide",style:{color:_.color,background:_.bg},children:_.label}),a.jsx("span",{className:"text-sm font-bold font-mono",style:{color:wt(O.overall_score)},children:en(O.overall_score)}),a.jsx("span",{className:"text-[11px]",style:{color:"var(--text-muted)"},children:Eu(O.start_time,O.end_time)}),P&&a.jsxs("div",{className:"flex items-center gap-2 max-w-[160px]",children:[a.jsx("div",{className:"flex-1 h-2 rounded-full overflow-hidden",style:{background:"var(--bg-tertiary)"},children:a.jsx("div",{className:"h-full rounded-full transition-all",style:{width:`${O.progress_total>0?O.progress_completed/O.progress_total*100:0}%`,background:"var(--info)"}})}),a.jsxs("span",{className:"text-[11px] shrink-0",style:{color:"var(--text-muted)"},children:[O.progress_completed,"/",O.progress_total]})]}),D.length>0&&a.jsx("div",{className:"flex gap-3 ml-auto",children:D.map(M=>{const L=w.find(v=>v.id===M),C=O.evaluator_scores[M];return a.jsxs("div",{className:"flex items-center gap-1.5",children:[a.jsx("span",{className:"text-[11px]",style:{color:"var(--text-muted)"},children:oo((L==null?void 0:L.name)??M)}),a.jsx("div",{className:"w-12 h-2 rounded-full overflow-hidden",style:{background:"var(--bg-tertiary)"},children:a.jsx("div",{className:"h-full rounded-full",style:{width:`${C*100}%`,background:wt(C)}})}),a.jsx("span",{className:"text-[11px] font-mono",style:{color:wt(C)},children:en(C)})]},M)})})]}),a.jsxs("div",{className:"shrink-0 overflow-hidden flex flex-col",style:{height:u},children:[a.jsxs("div",{className:"flex items-center px-3 h-7 text-[11px] font-semibold shrink-0 border-b",style:{color:"var(--text-muted)",background:"var(--bg-secondary)",borderColor:"var(--border)"},children:[a.jsx("span",{className:"w-5 shrink-0"}),a.jsx("span",{className:"flex-1 min-w-0",children:"Name"}),a.jsx("span",{className:"w-14 shrink-0 text-right",children:"Score"}),D.map(M=>{const L=w.find(C=>C.id===M);return a.jsx("span",{className:"w-36 shrink-0 text-right truncate pl-2",title:(L==null?void 0:L.name)??M,children:oo((L==null?void 0:L.name)??M)},M)}),a.jsx("span",{className:"w-14 shrink-0 text-right",children:"Time"})]}),a.jsxs("div",{className:"flex-1 overflow-y-auto",children:[n.results.map(M=>{const L=M.status==="pending",C=M.status==="failed",v=M.name===l;return a.jsxs("button",{onClick:()=>{o(v?`#/evals/runs/${e}`:`#/evals/runs/${e}/${encodeURIComponent(M.name)}`)},className:"w-full text-left px-3 py-1.5 flex items-center text-xs border-b transition-colors cursor-pointer",style:{borderColor:"var(--border)",background:v?"color-mix(in srgb, var(--accent) 10%, var(--bg-primary))":void 0,borderLeft:v?"2px solid var(--accent)":"2px solid transparent",opacity:L?.5:1},onMouseEnter:E=>{v||(E.currentTarget.style.background="var(--bg-hover)")},onMouseLeave:E=>{v||(E.currentTarget.style.background="")},children:[a.jsx("span",{className:"w-5 shrink-0 flex justify-center",children:a.jsx("span",{className:"w-2 h-2 rounded-full",style:{background:L?"var(--text-muted)":C?"var(--error)":M.overall_score>=.8?"var(--success)":M.overall_score>=.5?"var(--warning)":"var(--error)"}})}),a.jsx("span",{className:"flex-1 min-w-0 truncate",style:{color:"var(--text-primary)"},children:M.name}),a.jsx("span",{className:"w-14 shrink-0 text-right font-mono font-semibold",style:{color:wt(L?null:M.overall_score)},children:L?"-":en(M.overall_score)}),D.map(E=>a.jsx("span",{className:"w-36 shrink-0 text-right font-mono pl-2",style:{color:wt(L?null:M.scores[E]??null)},children:L?"-":en(M.scores[E]??null)},E)),a.jsx("span",{className:"w-14 shrink-0 text-right",style:{color:"var(--text-muted)"},children:M.duration_ms!==null?`${(M.duration_ms/1e3).toFixed(1)}s`:"-"})]},M.name)}),n.results.length===0&&a.jsx("div",{className:"flex items-center justify-center py-8 text-[var(--text-muted)] text-xs",children:P?"Waiting for results...":"No results"})]})]}),a.jsx("div",{onMouseDown:T,onTouchStart:T,className:"shrink-0 drag-handle-row"}),a.jsx("div",{className:"flex-1 overflow-hidden",children:R&&S.length>0?a.jsx(Dr,{traces:S}):a.jsx("div",{className:"flex items-center justify-center h-full text-[var(--text-muted)] text-xs",children:(R==null?void 0:R.status)==="pending"?"Pending...":"No traces available"})})]}),a.jsx("div",{onMouseDown:j,onTouchStart:j,className:`shrink-0 drag-handle-col${h?"":" transition-all"}`,style:{width:R?3:0,opacity:R?1:0}}),a.jsx(Nu,{width:m,item:R,evaluators:w,isRunning:P,isDragging:h})]})}const _u=[{id:"score",label:"Score"},{id:"io",label:"I/O"},{id:"logs",label:"Logs"}];function Nu({width:e,item:t,evaluators:n,isRunning:r,isDragging:i}){const[s,o]=N.useState("score"),l=!!t;return a.jsxs("div",{className:`shrink-0 flex flex-col overflow-hidden${i?"":" transition-[width] duration-200 ease-in-out"}`,style:{width:l?e:0,background:"var(--bg-primary)"},children:[a.jsxs("div",{className:"flex items-center gap-1 px-2 h-10 border-b shrink-0",style:{borderColor:"var(--border)",background:"var(--bg-secondary)",minWidth:e},children:[_u.map(u=>a.jsx("button",{onClick:()=>o(u.id),className:"px-2.5 py-1 h-7 text-xs font-semibold rounded transition-colors cursor-pointer",style:{color:s===u.id?"var(--accent)":"var(--text-muted)",background:s===u.id?"color-mix(in srgb, var(--accent) 10%, transparent)":"transparent",border:"none"},onMouseEnter:c=>{s!==u.id&&(c.currentTarget.style.color="var(--text-primary)")},onMouseLeave:c=>{s!==u.id&&(c.currentTarget.style.color="var(--text-muted)")},children:u.label},u.id)),r&&a.jsx("span",{className:"ml-auto text-[11px] px-2 py-0.5 rounded-full shrink-0",style:{background:"color-mix(in srgb, var(--warning) 15%, var(--bg-secondary))",color:"var(--warning)"},children:"Running..."})]}),a.jsx("div",{className:"flex-1 overflow-y-auto",style:{minWidth:e},children:t?t.status==="pending"?a.jsx("div",{className:"flex items-center justify-center h-full text-[var(--text-muted)] text-xs",children:"Pending..."}):a.jsxs(a.Fragment,{children:[t.status==="failed"&&a.jsxs("div",{className:"mx-2 mt-2 px-3 py-2 rounded text-xs",style:{background:"rgba(239,68,68,0.1)",color:"var(--error)"},children:[a.jsxs("div",{className:"flex items-center gap-2 font-semibold",children:[a.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 16 16",fill:"none",children:[a.jsx("circle",{cx:"8",cy:"8",r:"7",stroke:"currentColor",strokeWidth:"1.5"}),a.jsx("path",{d:"M8 4.5v4",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"}),a.jsx("circle",{cx:"8",cy:"11",r:"0.75",fill:"currentColor"})]}),a.jsx("span",{children:"Evaluator error"})]}),t.error&&a.jsx("div",{className:"mt-1 pl-[22px] text-[11px] opacity-80 break-words",style:{color:"var(--text-secondary)"},children:t.error})]}),s==="score"?a.jsx(Su,{item:t,evaluators:n}):s==="io"?a.jsx(Tu,{item:t}):a.jsx("div",{className:"flex items-center justify-center h-full text-[var(--text-muted)] text-xs",children:"Logs coming soon"})]}):null})]})}function Su({item:e,evaluators:t}){const n=Object.keys(e.scores);return a.jsxs("div",{className:"p-2 overflow-y-auto h-full space-y-1.5",children:[a.jsx("div",{className:"overflow-hidden",style:{border:"1px solid var(--border)"},children:a.jsxs("div",{className:"px-3 py-2 flex items-center gap-2",style:{background:"var(--bg-secondary)"},children:[a.jsx("span",{className:"truncate text-[11px] font-semibold",style:{color:"var(--text-primary)"},children:"Overall"}),a.jsxs("div",{className:"ml-auto flex items-center gap-2",children:[a.jsx("div",{className:"w-24 h-2.5 rounded-full overflow-hidden",style:{background:"var(--bg-tertiary)"},children:a.jsx("div",{className:"h-full rounded-full",style:{width:`${e.overall_score*100}%`,background:wt(e.overall_score)}})}),a.jsx("span",{className:"text-xs font-mono font-bold shrink-0 w-10 text-right",style:{color:wt(e.overall_score)},children:en(e.overall_score)})]})]})}),e.status==="failed"&&n.length===0&&a.jsx("div",{className:"px-3 py-3 text-xs text-center",style:{color:"var(--text-muted)"},children:"All evaluators failed — no scores available"}),n.map(r=>{const i=t.find(l=>l.id===r),s=e.scores[r],o=e.justifications[r];return a.jsxs("div",{className:"overflow-hidden",style:{border:"1px solid var(--border)"},children:[a.jsxs("div",{className:"px-3 py-2 flex items-center gap-2",style:{background:"var(--bg-secondary)"},children:[a.jsx("span",{className:"truncate text-[11px] font-semibold",style:{color:"var(--text-primary)"},title:(i==null?void 0:i.name)??r,children:(i==null?void 0:i.name)??r}),a.jsxs("div",{className:"ml-auto flex items-center gap-2",children:[a.jsx("div",{className:"w-24 h-2.5 rounded-full overflow-hidden",style:{background:"var(--bg-tertiary)"},children:a.jsx("div",{className:"h-full rounded-full",style:{width:`${s*100}%`,background:wt(s)}})}),a.jsx("span",{className:"text-xs font-mono font-bold shrink-0 w-10 text-right",style:{color:wt(s)},children:en(s)})]})]}),o&&a.jsx(Au,{text:o})]},r)})]})}function Tu({item:e}){const t=JSON.stringify(e.inputs,null,2),n=typeof e.output=="string"?e.output:JSON.stringify(e.output,null,2),r=e.expected_output!=null?typeof e.expected_output=="string"?e.expected_output:JSON.stringify(e.expected_output,null,2):null;return a.jsxs("div",{className:"p-2 overflow-y-auto h-full space-y-1.5",children:[a.jsx(_t,{title:"Input",copyText:t,children:a.jsx(ot,{json:t,className:"px-3 py-2 text-xs font-mono whitespace-pre-wrap break-words"})}),r&&a.jsx(_t,{title:"Expected Output",copyText:r,children:a.jsx(ot,{json:r,className:"px-3 py-2 text-xs font-mono whitespace-pre-wrap break-words"})}),a.jsx(_t,{title:"Output",copyText:n,trailing:e.duration_ms!==null?a.jsxs("span",{className:"ml-auto text-[10px]",style:{color:"var(--text-muted)"},children:[(e.duration_ms/1e3).toFixed(2),"s"]}):void 0,children:a.jsx(ot,{json:n,className:"px-3 py-2 text-xs font-mono whitespace-pre-wrap break-words"})})]})}function Cu(e){var i;const t=e.match(/expected="(.+?)"\s+actual="(.+?)"(.*)/s);if(!t)return null;const n={},r=((i=t[3])==null?void 0:i.trim())??"";if(r)for(const s of r.match(/(\w+)=([\S]+)/g)??[]){const o=s.indexOf("=");n[s.slice(0,o)]=s.slice(o+1)}return{expected:t[1],actual:t[2],meta:n}}function ao(e){try{const t=e.replace(/'/g,'"').replace(/\bTrue\b/g,"true").replace(/\bFalse\b/g,"false").replace(/\bNone\b/g,"null"),n=JSON.parse(t);return JSON.stringify(n,null,2)}catch{return e}}function Au({text:e}){const t=Cu(e);if(!t)return a.jsx("div",{className:"px-3 py-2 border-t",style:{borderColor:"var(--border)"},children:a.jsx("div",{className:"text-xs leading-relaxed",style:{color:"var(--text-secondary)"},children:e})});const n=ao(t.expected),r=ao(t.actual),i=n===r;return a.jsxs("div",{className:"border-t",style:{borderColor:"var(--border)"},children:[a.jsxs("div",{className:"grid grid-cols-2 gap-0",children:[a.jsxs("div",{className:"px-3 py-2 border-r",style:{borderColor:"var(--border)"},children:[a.jsx("div",{className:"text-[10px] font-semibold mb-1",style:{color:"var(--text-muted)"},children:"Expected"}),a.jsx("pre",{className:"text-[11px] font-mono whitespace-pre-wrap break-words",style:{color:"var(--text-secondary)"},children:n})]}),a.jsxs("div",{className:"px-3 py-2",children:[a.jsxs("div",{className:"flex items-center gap-1.5 mb-1",children:[a.jsx("span",{className:"text-[10px] font-semibold",style:{color:"var(--text-muted)"},children:"Actual"}),a.jsx("span",{className:"w-1.5 h-1.5 rounded-full",style:{background:i?"var(--success)":"var(--error)"}})]}),a.jsx("pre",{className:"text-[11px] font-mono whitespace-pre-wrap break-words",style:{color:i?"var(--success)":"var(--error)"},children:r})]})]}),Object.keys(t.meta).length>0&&a.jsx("div",{className:"px-3 py-1.5 border-t flex items-center gap-3",style:{borderColor:"var(--border)"},children:Object.entries(t.meta).map(([s,o])=>a.jsxs("span",{className:"text-[10px]",style:{color:"var(--text-muted)"},children:[a.jsx("span",{className:"font-medium",children:s.replace(/_/g," ")})," ",a.jsx("span",{className:"font-mono",children:o})]},s))})]})}const lo={deterministic:"var(--success)",llm:"#a78bfa",tool:"var(--info)"};function co(){const e=Me(f=>f.localEvaluators),t=Me(f=>f.addEvalSet),{navigate:n}=st(),[r,i]=N.useState(""),[s,o]=N.useState(new Set),[l,u]=N.useState(null),[c,d]=N.useState(!1),p=f=>{o(h=>{const b=new Set(h);return b.has(f)?b.delete(f):b.add(f),b})},m=async()=>{if(r.trim()){u(null),d(!0);try{const f=await uc({name:r.trim(),evaluator_refs:Array.from(s)});t(f),n(`#/evals/sets/${f.id}`)}catch(f){u(f.detail||f.message||"Failed to create eval set")}finally{d(!1)}}};return a.jsx("div",{className:"flex items-center justify-center h-full",children:a.jsxs("div",{className:"w-full max-w-xl px-6",children:[a.jsxs("div",{className:"mb-8 text-center",children:[a.jsxs("div",{className:"flex items-center justify-center gap-2 mb-2",children:[a.jsx("div",{className:"w-1.5 h-1.5 rounded-full",style:{background:"var(--accent)"}}),a.jsx("span",{className:"text-sm font-semibold",style:{color:"var(--text-muted)"},children:"New Eval Set"})]}),a.jsx("p",{className:"text-sm",style:{color:"var(--text-muted)"},children:"Create an evaluation set with a name and evaluators"})]}),a.jsxs("div",{className:"mb-6",children:[a.jsx("label",{className:"block text-[11px] font-medium mb-1.5",style:{color:"var(--text-muted)"},children:"Name"}),a.jsx("input",{type:"text",value:r,onChange:f=>i(f.target.value),placeholder:"e.g. Basic QA Tests",className:"w-full rounded-md px-3 py-2 text-xs",style:{background:"var(--bg-secondary)",border:"1px solid var(--border)",color:"var(--text-primary)"},onKeyDown:f=>{f.key==="Enter"&&r.trim()&&m()}})]}),a.jsxs("div",{className:"mb-6",children:[a.jsx("label",{className:"block text-[11px] font-medium mb-1.5",style:{color:"var(--text-muted)"},children:"Evaluators"}),e.length===0?a.jsxs("p",{className:"text-xs",style:{color:"var(--text-muted)"},children:["No evaluators configured."," ",a.jsx("button",{onClick:()=>n("#/evaluators/new"),className:"underline cursor-pointer",style:{color:"var(--accent)",background:"none",border:"none",padding:0,font:"inherit"},children:"Create one first"})]}):a.jsx("div",{className:"rounded-md border overflow-hidden",style:{borderColor:"var(--border)",background:"var(--bg-secondary)"},children:e.map(f=>a.jsxs("label",{className:"flex items-center gap-2.5 px-3 py-2 text-xs cursor-pointer transition-colors",style:{borderBottom:"1px solid var(--border)"},onMouseEnter:h=>{h.currentTarget.style.background="var(--bg-hover)"},onMouseLeave:h=>{h.currentTarget.style.background="transparent"},children:[a.jsx("input",{type:"checkbox",checked:s.has(f.id),onChange:()=>p(f.id),className:"accent-[var(--accent)]"}),a.jsx("span",{className:"flex-1 truncate",style:{color:"var(--text-primary)"},children:f.name}),a.jsx("span",{className:"text-[11px] font-medium px-1.5 py-0.5 rounded",style:{background:`color-mix(in srgb, ${lo[f.type]??"var(--text-muted)"} 15%, transparent)`,color:lo[f.type]??"var(--text-muted)"},children:f.type})]},f.id))})]}),l&&a.jsx("p",{className:"text-xs mb-4 px-3 py-2 rounded",style:{color:"var(--error)",background:"color-mix(in srgb, var(--error) 10%, var(--bg-secondary))"},children:l}),a.jsx("button",{onClick:m,disabled:!r.trim()||c,className:"w-full py-2 rounded-md text-[13px] font-semibold transition-colors cursor-pointer disabled:opacity-40 disabled:cursor-not-allowed",style:{background:"var(--accent)",color:"var(--bg-primary)",border:"none"},children:c?"Creating...":"Create Eval Set"})]})})}const Mu=[{type:"deterministic",label:"Deterministic",badgeColor:"var(--success)"},{type:"llm",label:"LLM Judge",badgeColor:"#a78bfa"},{type:"tool",label:"Tool-Based",badgeColor:"var(--info)"}];function uo(){const e=Me(s=>s.localEvaluators),{evaluatorFilter:t,evaluatorCreateType:n,navigate:r}=st(),i=!t&&!n;return a.jsxs(a.Fragment,{children:[a.jsx("button",{onClick:()=>r("#/evaluators/new"),className:"mx-3 mt-2.5 mb-1 px-3 py-1.5 text-[11px] font-medium rounded border border-[var(--border)] bg-transparent transition-colors cursor-pointer",style:{color:"var(--text-secondary)"},onMouseEnter:s=>{s.currentTarget.style.color="var(--text-primary)",s.currentTarget.style.borderColor="var(--text-muted)"},onMouseLeave:s=>{s.currentTarget.style.color="var(--text-secondary)",s.currentTarget.style.borderColor=""},children:"+ New Evaluator"}),a.jsx("div",{className:"px-3 pt-3 pb-1 text-[11px] uppercase tracking-widest font-semibold",style:{color:"var(--text-muted)"},children:"Categories"}),a.jsxs("div",{className:"flex-1 overflow-y-auto",children:[a.jsxs("button",{onClick:()=>r("#/evaluators"),className:"w-full text-left px-3 py-2 text-xs flex items-center gap-2 cursor-pointer transition-colors",style:{background:i?"color-mix(in srgb, var(--accent) 15%, var(--bg-primary))":"transparent",color:i?"var(--text-primary)":"var(--text-secondary)",borderLeft:i?"3px solid var(--accent)":"3px solid transparent"},onMouseEnter:s=>{i||(s.currentTarget.style.background="var(--bg-hover)")},onMouseLeave:s=>{i||(s.currentTarget.style.background="transparent")},children:[a.jsx("div",{className:"w-2 h-2 rounded-full shrink-0",style:{background:"var(--text-muted)"}}),a.jsx("span",{className:"flex-1 truncate",children:"All"}),e.length>0&&a.jsx("span",{className:"text-[10px] px-1.5 rounded-full",style:{background:"var(--bg-tertiary)",color:"var(--text-muted)"},children:e.length})]}),Mu.map(s=>{const o=e.filter(u=>u.type===s.type).length,l=t===s.type;return a.jsxs("button",{onClick:()=>r(l?"#/evaluators":`#/evaluators/category/${s.type}`),className:"w-full text-left px-3 py-2 text-xs flex items-center gap-2 cursor-pointer transition-colors",style:{background:l?"color-mix(in srgb, var(--accent) 15%, var(--bg-primary))":"transparent",color:l?"var(--text-primary)":"var(--text-secondary)",borderLeft:l?"3px solid var(--accent)":"3px solid transparent"},onMouseEnter:u=>{l||(u.currentTarget.style.background="var(--bg-hover)")},onMouseLeave:u=>{l||(u.currentTarget.style.background="transparent")},children:[a.jsx("div",{className:"w-2 h-2 rounded-full shrink-0",style:{background:s.badgeColor}}),a.jsx("span",{className:"flex-1 truncate",children:s.label}),o>0&&a.jsx("span",{className:"text-[10px] px-1.5 rounded-full",style:{background:"var(--bg-tertiary)",color:"var(--text-muted)"},children:o})]},s.type)})]})]})}const po={deterministic:{label:"Deterministic",color:"var(--success)",bg:"rgba(34,197,94,0.1)"},llm:{label:"LLM Judge",color:"#a78bfa",bg:"rgba(167,139,250,0.1)"},tool:{label:"Tool-Based",color:"var(--info)",bg:"rgba(59,130,246,0.1)"}},Pr={deterministic:"Deterministic",llm:"LLM Judge",tool:"Tool-Based"},pn={deterministic:[{id:"uipath-exact-match",name:"Exact Match"},{id:"uipath-contains",name:"Contains"},{id:"uipath-json-similarity",name:"JSON Similarity"}],llm:[{id:"uipath-llm-judge-output-semantic-similarity",name:"LLM Judge Output"},{id:"uipath-llm-judge-output-strict-json-similarity",name:"LLM Judge Strict JSON"},{id:"uipath-llm-judge-trajectory-similarity",name:"LLM Judge Trajectory"},{id:"uipath-llm-judge-trajectory-simulation",name:"LLM Judge Trajectory Simulation"}],tool:[{id:"uipath-tool-call-order",name:"Tool Call Order"},{id:"uipath-tool-call-args",name:"Tool Call Args"},{id:"uipath-tool-call-count",name:"Tool Call Count"},{id:"uipath-tool-call-output",name:"Tool Call Output"}]};function Ls(e){return e.includes("trajectory")?{targetOutputKey:!1,prompt:!0}:e.includes("llm-judge")?{targetOutputKey:!0,prompt:!0}:e.includes("tool-call-output")?{targetOutputKey:!0,prompt:!1}:e.includes("exact-match")||e.includes("contains")||e.includes("json-similarity")?{targetOutputKey:!0,prompt:!1}:{targetOutputKey:!1,prompt:!1}}const fr={"uipath-exact-match":{description:"Checks whether the agent output exactly matches the expected output.",prompt:""},"uipath-contains":{description:"Checks whether the agent output contains the expected substring.",prompt:""},"uipath-json-similarity":{description:"Compares JSON structures for semantic similarity, ignoring key ordering and whitespace.",prompt:""},"uipath-llm-judge-output-semantic-similarity":{description:"Uses an LLM to score semantic similarity between the agent's actual output and the expected output, accounting for synonyms, paraphrases, and equivalent expressions.",prompt:`As an expert evaluator, analyze the semantic similarity between the expected and actual outputs and determine a score from 0 to 100. Focus on comparing meaning and contextual equivalence of corresponding fields, accounting for alternative valid expressions, synonyms, and reasonable variations in language while maintaining high standards for accuracy and completeness. Provide your score with a brief justification. +`),u=N.useCallback(()=>n(c=>!c),[]);return l?a.jsxs("div",{children:[t?s?a.jsx(ot,{json:o,className:"font-mono text-[11px] whitespace-pre-wrap break-all",style:{}}):a.jsx("pre",{className:"font-mono text-[11px] whitespace-pre-wrap break-all",style:{color:"var(--text-primary)"},children:o}):a.jsxs("span",{className:"font-mono text-[11px] break-all",style:{color:"var(--text-primary)"},children:[o.slice(0,Gi),"..."]}),a.jsx("button",{onClick:u,className:"text-[11px] cursor-pointer ml-1 px-1",style:{color:"var(--info)"},children:t?"[less]":"[more]"})]}):s?a.jsx(ot,{json:o,className:"font-mono text-[11px] break-all whitespace-pre-wrap",style:{}}):a.jsx("span",{className:"font-mono text-[11px] break-all",style:{color:"var(--text-primary)"},children:o})}function iu({span:e}){const[t,n]=N.useState(!0),[r,i]=N.useState(!1),[s,o]=N.useState("table"),[l,u]=N.useState(!1),c=Qc[e.status.toLowerCase()]??{...eu,label:e.status},d=N.useMemo(()=>JSON.stringify(e,null,2),[e]),p=N.useCallback(()=>{navigator.clipboard.writeText(d).then(()=>{u(!0),setTimeout(()=>u(!1),1500)})},[d]),m=Object.entries(e.attributes),f=[{label:"Span",value:e.span_id},...e.trace_id?[{label:"Trace",value:e.trace_id}]:[],{label:"Run",value:e.run_id},...e.parent_span_id?[{label:"Parent",value:e.parent_span_id}]:[]];return a.jsxs("div",{className:"flex flex-col h-full text-xs leading-normal",children:[a.jsxs("div",{className:"px-2 border-b flex items-center gap-1 shrink-0",style:{borderColor:"var(--border)",background:"var(--bg-secondary)",height:"32px"},children:[a.jsx("button",{onClick:()=>o("table"),className:"px-2.5 h-6 text-[11px] font-semibold rounded transition-colors cursor-pointer inline-flex items-center",style:{color:s==="table"?"var(--accent)":"var(--text-muted)",background:s==="table"?"color-mix(in srgb, var(--accent) 10%, transparent)":"transparent"},onMouseEnter:h=>{s!=="table"&&(h.currentTarget.style.color="var(--text-primary)")},onMouseLeave:h=>{s!=="table"&&(h.currentTarget.style.color="var(--text-muted)")},children:"Table"}),a.jsx("button",{onClick:()=>o("json"),className:"px-2.5 h-6 text-[11px] font-semibold rounded transition-colors cursor-pointer inline-flex items-center",style:{color:s==="json"?"var(--accent)":"var(--text-muted)",background:s==="json"?"color-mix(in srgb, var(--accent) 10%, transparent)":"transparent"},onMouseEnter:h=>{s!=="json"&&(h.currentTarget.style.color="var(--text-primary)")},onMouseLeave:h=>{s!=="json"&&(h.currentTarget.style.color="var(--text-muted)")},children:"JSON"}),a.jsxs("span",{className:"ml-auto shrink-0 inline-flex items-center gap-1 px-2 py-0.5 rounded-full text-[11px] font-bold uppercase tracking-wider",style:{background:`color-mix(in srgb, ${c.color} 15%, var(--bg-secondary))`,color:c.color},children:[a.jsx("span",{className:"inline-block w-1.5 h-1.5 rounded-full",style:{background:c.color}}),c.label]})]}),a.jsx("div",{className:"overflow-y-auto flex-1 p-0.5 pr-0 pt-0 mr-0.5 mt-0.5",children:s==="table"?a.jsxs(a.Fragment,{children:[m.length>0&&a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"px-2 py-1 text-[11px] uppercase font-bold tracking-wider border-b cursor-pointer flex items-center",style:{color:"var(--success)",borderColor:"var(--border)",background:"var(--bg-secondary)"},onClick:()=>n(h=>!h),children:[a.jsxs("span",{className:"flex-1",children:["Attributes (",m.length,")"]}),a.jsx("span",{style:{color:"var(--text-muted)",transform:t?"rotate(0deg)":"rotate(-90deg)"},children:"▾"})]}),t&&m.map(([h,b],x)=>a.jsxs("div",{className:"flex gap-2 px-2 py-1 items-start border-b",style:{borderColor:"var(--border)",background:x%2===0?"var(--bg-primary)":"var(--bg-secondary)"},children:[a.jsx("span",{className:"font-mono font-semibold shrink-0 pt-px truncate text-[11px]",style:{color:"var(--info)",width:"35%"},title:h,children:h}),a.jsx("span",{className:"flex-1 min-w-0",children:a.jsx(ru,{value:b})})]},h))]}),a.jsxs("div",{className:"px-2 py-1 text-[11px] uppercase font-bold tracking-wider border-b cursor-pointer flex items-center",style:{color:"var(--success)",borderColor:"var(--border)",background:"var(--bg-secondary)"},onClick:()=>i(h=>!h),children:[a.jsxs("span",{className:"flex-1",children:["Identifiers (",f.length,")"]}),a.jsx("span",{style:{color:"var(--text-muted)",transform:r?"rotate(0deg)":"rotate(-90deg)"},children:"▾"})]}),r&&f.map((h,b)=>a.jsxs("div",{className:"flex gap-2 px-2 py-1 items-start border-b",style:{borderColor:"var(--border)",background:b%2===0?"var(--bg-primary)":"var(--bg-secondary)"},children:[a.jsx("span",{className:"font-mono font-semibold shrink-0 pt-px truncate text-[11px]",style:{color:"var(--info)",width:"35%"},title:h.label,children:h.label}),a.jsx("span",{className:"flex-1 min-w-0",children:a.jsx("span",{className:"font-mono text-[11px] break-all",style:{color:"var(--text-primary)"},children:h.value})})]},h.label))]}):a.jsxs("div",{className:"relative",children:[a.jsx("button",{onClick:p,className:"absolute top-1 right-1 z-10 text-[11px] cursor-pointer px-2 py-1 rounded transition-colors",style:{color:l?"var(--success)":"var(--text-muted)",background:"var(--bg-secondary)",border:"1px solid var(--border)"},onMouseEnter:h=>{l||(h.currentTarget.style.color="var(--text-primary)")},onMouseLeave:h=>{h.currentTarget.style.color=l?"var(--success)":"var(--text-muted)"},children:l?"Copied!":"Copy"}),a.jsx(ot,{json:d,className:"font-mono text-[11px] whitespace-pre-wrap p-2",style:{}})]})})]})}function ou(e){const t=[];function n(r,i){t.push({span:r.span,depth:i});for(const s of r.children)n(s,i+1)}for(const r of e)n(r,0);return t}function su({tree:e,selectedSpan:t,onSelect:n}){const r=N.useMemo(()=>ou(e),[e]),{globalStart:i,totalDuration:s}=N.useMemo(()=>{if(r.length===0)return{globalStart:0,totalDuration:1};let o=1/0,l=-1/0;for(const{span:u}of r){const c=new Date(u.timestamp).getTime();o=Math.min(o,c),l=Math.max(l,c+(u.duration_ms??0))}return{globalStart:o,totalDuration:Math.max(l-o,1)}},[r]);return r.length===0?null:a.jsx(a.Fragment,{children:r.map(({span:o,depth:l})=>{var b;const u=new Date(o.timestamp).getTime()-i,c=o.duration_ms??0,d=u/s*100,p=Math.max(c/s*100,.3),m=As[o.status.toLowerCase()]??"var(--text-muted)",f=o.span_id===(t==null?void 0:t.span_id),h=(b=o.attributes)==null?void 0:b["openinference.span.kind"];return a.jsxs("button",{"data-span-id":o.span_id,onClick:()=>n(o),className:"w-full text-left text-xs leading-normal py-1 flex items-center transition-colors",style:{background:f?"color-mix(in srgb, var(--accent) 10%, var(--bg-primary))":void 0,borderLeft:f?"2px solid var(--accent)":"2px solid transparent"},onMouseEnter:x=>{f||(x.currentTarget.style.background="var(--bg-hover)")},onMouseLeave:x=>{f||(x.currentTarget.style.background="")},children:[a.jsxs("div",{className:"shrink-0 flex items-center gap-1 overflow-hidden",style:{width:"35%",minWidth:"80px",paddingLeft:`${l*12+4}px`},children:[a.jsx("span",{className:"shrink-0 flex items-center justify-center w-3.5 h-3.5",children:a.jsx(Ms,{kind:h,statusColor:m})}),a.jsx("span",{className:"text-[var(--text-primary)] truncate",children:o.span_name})]}),a.jsx("div",{className:"flex-1 relative h-[14px] mx-1 rounded-sm",style:{background:"var(--bg-secondary)"},children:a.jsx("div",{className:"absolute rounded-sm",style:{left:`${d}%`,width:`${p}%`,top:"2px",bottom:"2px",background:m,opacity:.8,minWidth:"2px"}})}),a.jsx("span",{className:"shrink-0 text-[10px] tabular-nums pr-2",style:{width:"52px",textAlign:"right",color:"var(--text-muted)"},children:Is(o.duration_ms)})]},o.span_id)})})}const As={started:"var(--info)",running:"var(--warning)",completed:"var(--success)",failed:"var(--error)",error:"var(--error)"};function Ms({kind:e,statusColor:t}){const n=t,r=14,i={width:r,height:r,viewBox:"0 0 16 16",fill:"none",stroke:n,strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"};switch(e){case"LLM":return a.jsx("svg",{...i,children:a.jsx("path",{d:"M8 2L9 5L12 4L10 7L14 8L10 9L12 12L9 11L8 14L7 11L4 12L6 9L2 8L6 7L4 4L7 5Z",fill:n,stroke:"none"})});case"TOOL":return a.jsx("svg",{...i,children:a.jsx("path",{d:"M10.5 2.5a3.5 3.5 0 0 0-3.17 4.93L3.5 11.27a1 1 0 0 0 0 1.41l.82.82a1 1 0 0 0 1.41 0l3.84-3.83A3.5 3.5 0 1 0 10.5 2.5z"})});case"AGENT":return a.jsxs("svg",{...i,children:[a.jsx("rect",{x:"3",y:"5",width:"10",height:"8",rx:"2"}),a.jsx("circle",{cx:"6",cy:"9",r:"1",fill:n,stroke:"none"}),a.jsx("circle",{cx:"10",cy:"9",r:"1",fill:n,stroke:"none"}),a.jsx("path",{d:"M8 2v3"}),a.jsx("path",{d:"M6 2h4"})]});case"CHAIN":return a.jsxs("svg",{...i,children:[a.jsx("path",{d:"M6.5 9.5L9.5 6.5"}),a.jsx("path",{d:"M4.5 8.5l-1 1a2 2 0 0 0 2.83 2.83l1-1"}),a.jsx("path",{d:"M11.5 7.5l1-1a2 2 0 0 0-2.83-2.83l-1 1"})]});case"RETRIEVER":return a.jsxs("svg",{...i,children:[a.jsx("circle",{cx:"7",cy:"7",r:"4"}),a.jsx("path",{d:"M10 10l3.5 3.5"})]});case"EMBEDDING":return a.jsxs("svg",{...i,children:[a.jsx("rect",{x:"2",y:"2",width:"4",height:"4",rx:"0.5"}),a.jsx("rect",{x:"10",y:"2",width:"4",height:"4",rx:"0.5"}),a.jsx("rect",{x:"2",y:"10",width:"4",height:"4",rx:"0.5"}),a.jsx("rect",{x:"10",y:"10",width:"4",height:"4",rx:"0.5"})]});default:return a.jsx("span",{className:"shrink-0 w-2 h-2 rounded-full",style:{background:t}})}}function au(e){const t=new Map(e.map(o=>[o.span_id,o])),n=new Map;for(const o of e)if(o.parent_span_id){const l=n.get(o.parent_span_id)??[];l.push(o),n.set(o.parent_span_id,l)}const r=e.filter(o=>o.parent_span_id===null||!t.has(o.parent_span_id));function i(o){const l=(n.get(o.span_id)??[]).sort((u,c)=>u.timestamp.localeCompare(c.timestamp));return{span:o,children:l.map(i)}}return r.sort((o,l)=>o.timestamp.localeCompare(l.timestamp)).map(i).flatMap(o=>o.span.span_name==="root"?o.children:[o])}function Is(e){return e==null?"":e<1e3?`${e.toFixed(0)}ms`:`${(e/1e3).toFixed(2)}s`}function Rs(e){return e.map(t=>{const{span:n}=t;return t.children.length>0?{name:n.span_name,children:Rs(t.children)}:{name:n.span_name}})}function Dr({traces:e}){const[t,n]=N.useState(null),[r,i]=N.useState(new Set),[s,o]=N.useState(()=>{const D=localStorage.getItem("traceTreeSplitWidth");return D?parseFloat(D):50}),[l,u]=N.useState(!1),[c,d]=N.useState(!1),[p,m]=N.useState(()=>localStorage.getItem("traceViewMode")||"tree"),f=au(e),h=N.useMemo(()=>JSON.stringify(Rs(f),null,2),[e]),b=N.useCallback(()=>{navigator.clipboard.writeText(h).then(()=>{d(!0),setTimeout(()=>d(!1),1500)})},[h]),x=Ee(D=>D.focusedSpan),y=Ee(D=>D.setFocusedSpan),[w,T]=N.useState(null),j=N.useRef(null),O=N.useCallback(D=>{i(R=>{const S=new Set(R);return S.has(D)?S.delete(D):S.add(D),S})},[]),_=N.useRef(null);N.useEffect(()=>{const D=f.length>0?f[0].span.span_id:null,R=_.current;if(_.current=D,D&&D!==R)n(f[0].span);else if(t===null)f.length>0&&n(f[0].span);else{const S=e.find(M=>M.span_id===t.span_id);S&&S!==t&&n(S)}},[e]),N.useEffect(()=>{if(!x)return;const R=e.filter(S=>S.span_name===x.name).sort((S,M)=>S.timestamp.localeCompare(M.timestamp))[x.index];if(R){n(R),T(R.span_id);const S=new Map(e.map(M=>[M.span_id,M.parent_span_id]));i(M=>{const L=new Set(M);let C=R.parent_span_id;for(;C;)L.delete(C),C=S.get(C)??null;return L})}y(null)},[x,e,y]),N.useEffect(()=>{if(!w)return;const D=w;T(null),requestAnimationFrame(()=>{const R=j.current,S=R==null?void 0:R.querySelector(`[data-span-id="${D}"]`);R&&S&&S.scrollIntoView({block:"center",behavior:"smooth"})})},[w]),N.useEffect(()=>{if(!l)return;const D=S=>{const M=document.querySelector(".trace-tree-container");if(!M)return;const L=M.getBoundingClientRect(),C=(S.clientX-L.left)/L.width*100,v=Math.max(20,Math.min(80,C));o(v),localStorage.setItem("traceTreeSplitWidth",String(v))},R=()=>{u(!1)};return window.addEventListener("mousemove",D),window.addEventListener("mouseup",R),()=>{window.removeEventListener("mousemove",D),window.removeEventListener("mouseup",R)}},[l]);const P=D=>{D.preventDefault(),u(!0)};return a.jsxs("div",{className:"flex h-full trace-tree-container",style:{cursor:l?"col-resize":void 0},children:[a.jsxs("div",{className:"flex flex-col",style:{width:`${s}%`},children:[e.length>0&&a.jsxs("div",{className:"flex items-center gap-1 px-2 border-b shrink-0",style:{borderColor:"var(--border)",background:"var(--bg-secondary)",height:"32px"},children:[a.jsx("button",{onClick:()=>{m("tree"),localStorage.setItem("traceViewMode","tree")},className:"px-2.5 h-6 text-[11px] font-semibold rounded transition-colors cursor-pointer inline-flex items-center",style:{color:p==="tree"?"var(--accent)":"var(--text-muted)",background:p==="tree"?"color-mix(in srgb, var(--accent) 10%, transparent)":"transparent"},onMouseEnter:D=>{p!=="tree"&&(D.currentTarget.style.color="var(--text-primary)")},onMouseLeave:D=>{p!=="tree"&&(D.currentTarget.style.color="var(--text-muted)")},children:"Tree"}),a.jsx("button",{onClick:()=>{m("timeline"),localStorage.setItem("traceViewMode","timeline")},className:"px-2.5 h-6 text-[11px] font-semibold rounded transition-colors cursor-pointer inline-flex items-center",style:{color:p==="timeline"?"var(--accent)":"var(--text-muted)",background:p==="timeline"?"color-mix(in srgb, var(--accent) 10%, transparent)":"transparent"},onMouseEnter:D=>{p!=="timeline"&&(D.currentTarget.style.color="var(--text-primary)")},onMouseLeave:D=>{p!=="timeline"&&(D.currentTarget.style.color="var(--text-muted)")},children:"Timeline"}),a.jsx("button",{onClick:()=>{m("json"),localStorage.setItem("traceViewMode","json")},className:"px-2.5 h-6 text-[11px] font-semibold rounded transition-colors cursor-pointer inline-flex items-center",style:{color:p==="json"?"var(--accent)":"var(--text-muted)",background:p==="json"?"color-mix(in srgb, var(--accent) 10%, transparent)":"transparent"},onMouseEnter:D=>{p!=="json"&&(D.currentTarget.style.color="var(--text-primary)")},onMouseLeave:D=>{p!=="json"&&(D.currentTarget.style.color="var(--text-muted)")},children:"JSON"})]}),a.jsx("div",{ref:j,className:"overflow-y-auto flex-1 p-0.5 pr-0 pt-0 mr-0.5 mt-0.5",children:f.length===0?a.jsx("div",{className:"flex items-center justify-center h-full",children:a.jsx("p",{className:"text-[var(--text-muted)] text-sm",children:"No traces yet"})}):p==="tree"?f.map((D,R)=>a.jsx(Os,{node:D,depth:0,selectedId:(t==null?void 0:t.span_id)??null,onSelect:n,isLast:R===f.length-1,collapsedIds:r,toggleExpanded:O},D.span.span_id)):p==="timeline"?a.jsx(su,{tree:f,selectedSpan:t,onSelect:n}):a.jsxs("div",{className:"relative",children:[a.jsx("button",{onClick:b,className:"absolute top-1 right-1 z-10 text-[11px] cursor-pointer px-2 py-1 rounded transition-colors",style:{color:c?"var(--success)":"var(--text-muted)",background:"var(--bg-secondary)",border:"1px solid var(--border)"},onMouseEnter:D=>{c||(D.currentTarget.style.color="var(--text-primary)")},onMouseLeave:D=>{D.currentTarget.style.color=c?"var(--success)":"var(--text-muted)"},children:c?"Copied!":"Copy"}),a.jsx(ot,{json:h,className:"font-mono text-[11px] whitespace-pre-wrap p-2",style:{}})]})})]}),a.jsx("div",{onMouseDown:P,className:"shrink-0 drag-handle-col",style:l?{background:"var(--accent)"}:void 0}),a.jsx("div",{className:"flex-1 overflow-hidden",children:t?a.jsx(iu,{span:t}):a.jsx("div",{className:"flex items-center justify-center h-full",children:a.jsx("p",{className:"text-[var(--text-muted)] text-sm",children:"Select a span to view details"})})})]})}function Os({node:e,depth:t,selectedId:n,onSelect:r,isLast:i,collapsedIds:s,toggleExpanded:o}){var b;const{span:l}=e,u=!s.has(l.span_id),c=As[l.status.toLowerCase()]??"var(--text-muted)",d=Is(l.duration_ms),p=l.span_id===n,m=e.children.length>0,f=t*20,h=(b=l.attributes)==null?void 0:b["openinference.span.kind"];return a.jsxs("div",{className:"relative",children:[t>0&&a.jsx("div",{className:"absolute top-0 z-10 pointer-events-none",style:{left:`${f-10}px`,width:"1px",height:i?"16px":"100%",background:"var(--border)"}}),a.jsxs("button",{"data-span-id":l.span_id,onClick:()=>r(l),className:"w-full text-left text-xs leading-normal py-1.5 pr-2 flex items-center gap-1.5 transition-colors relative",style:{paddingLeft:`${f+4}px`,background:p?"color-mix(in srgb, var(--accent) 15%, var(--bg-primary))":void 0,borderLeft:p?"3px solid var(--accent)":"3px solid transparent"},onMouseEnter:x=>{p||(x.currentTarget.style.background="var(--bg-hover)")},onMouseLeave:x=>{p||(x.currentTarget.style.background="")},children:[t>0&&a.jsx("div",{className:"absolute z-10 pointer-events-none",style:{left:`${f-10}px`,top:"50%",width:"10px",height:"1px",background:"var(--border)"}}),m?a.jsx("span",{onClick:x=>{x.stopPropagation(),o(l.span_id)},className:"shrink-0 w-5 h-5 flex items-center justify-center cursor-pointer rounded hover:bg-[var(--bg-hover)]",style:{color:"var(--text-muted)"},children:a.jsx("svg",{width:"10",height:"10",viewBox:"0 0 10 10",style:{transform:u?"rotate(90deg)":"rotate(0deg)"},children:a.jsx("path",{d:"M3 1.5L7 5L3 8.5",stroke:"currentColor",strokeWidth:"1.5",fill:"none",strokeLinecap:"round",strokeLinejoin:"round"})})}):a.jsx("span",{className:"shrink-0 w-4"}),a.jsx("span",{className:"shrink-0 flex items-center justify-center w-4 h-4",children:a.jsx(Ms,{kind:h,statusColor:c})}),a.jsx("span",{className:"text-[var(--text-primary)] truncate min-w-0 flex-1",children:l.span_name}),d&&a.jsx("span",{className:"text-[var(--text-muted)] shrink-0 ml-auto pl-2 tabular-nums",children:d})]}),u&&e.children.map((x,y)=>a.jsx(Os,{node:x,depth:t+1,selectedId:n,onSelect:r,isLast:y===e.children.length-1,collapsedIds:s,toggleExpanded:o},x.span.span_id))]})}const lu={DEBUG:{color:"var(--text-muted)",bg:"color-mix(in srgb, var(--text-muted) 15%, var(--bg-secondary))",border:"var(--text-muted)"},INFO:{color:"var(--info)",bg:"color-mix(in srgb, var(--info) 15%, var(--bg-secondary))",border:"var(--info)"},WARN:{color:"var(--warning)",bg:"color-mix(in srgb, var(--warning) 15%, var(--bg-secondary))",border:"var(--warning)"},WARNING:{color:"var(--warning)",bg:"color-mix(in srgb, var(--warning) 15%, var(--bg-secondary))",border:"var(--warning)"},ERROR:{color:"var(--error)",bg:"color-mix(in srgb, var(--error) 15%, var(--bg-secondary))",border:"var(--error)"},CRITICAL:{color:"var(--error)",bg:"color-mix(in srgb, var(--error) 15%, var(--bg-secondary))",border:"var(--error)"}},cu={color:"var(--text-muted)",bg:"transparent"};function qi({logs:e}){const t=N.useRef(null),n=N.useRef(null),[r,i]=N.useState(!1);N.useEffect(()=>{var o;(o=n.current)==null||o.scrollIntoView({behavior:"smooth"})},[e.length]);const s=()=>{const o=t.current;o&&i(o.scrollTop>100)};return e.length===0?a.jsx("div",{className:"h-full flex items-center justify-center",children:a.jsx("p",{className:"text-[var(--text-muted)] text-sm",children:"No logs yet"})}):a.jsxs("div",{className:"h-full relative",children:[a.jsxs("div",{ref:t,onScroll:s,className:"h-full overflow-y-auto font-mono text-xs leading-normal",children:[e.map((o,l)=>{const u=new Date(o.timestamp).toLocaleTimeString(void 0,{hour12:!1}),c=o.level.toUpperCase(),d=c.slice(0,4),p=lu[c]??cu,m=l%2===0;return a.jsxs("div",{className:"flex gap-3 px-3 py-1.5",style:{background:m?"var(--bg-primary)":"var(--bg-secondary)"},children:[a.jsx("span",{className:"text-[var(--text-muted)] shrink-0",children:u}),a.jsx("span",{className:"shrink-0 self-start px-1.5 py-0.5 rounded text-[10px] font-semibold leading-none inline-flex items-center",style:{color:p.color,background:p.bg},children:d}),a.jsx("span",{className:"text-[var(--text-primary)] whitespace-pre-wrap break-all",children:o.message})]},l)}),a.jsx("div",{ref:n})]}),r&&a.jsx("button",{onClick:()=>{var o;return(o=t.current)==null?void 0:o.scrollTo({top:0,behavior:"smooth"})},className:"absolute top-2 right-3 w-6 h-6 flex items-center justify-center rounded-full cursor-pointer transition-opacity opacity-70 hover:opacity-100",style:{background:"var(--bg-tertiary)",color:"var(--text-primary)"},title:"Scroll to top",children:a.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",children:a.jsx("polyline",{points:"18 15 12 9 6 15"})})})]})}const uu={started:{color:"var(--accent)",label:"started"},updated:{color:"var(--info)",label:"updated"},completed:{color:"var(--success)",label:"completed"},faulted:{color:"var(--error)",label:"faulted"}},Vi={color:"var(--text-muted)",label:""};function An({events:e,runStatus:t}){const n=N.useRef(null),r=N.useRef(!0),[i,s]=N.useState(null),o=()=>{const l=n.current;l&&(r.current=l.scrollHeight-l.scrollTop-l.clientHeight<40)};return N.useEffect(()=>{r.current&&n.current&&(n.current.scrollTop=n.current.scrollHeight)}),e.length===0?a.jsx("div",{className:"flex-1 flex items-center justify-center h-full",children:a.jsx("p",{className:"text-xs",style:{color:"var(--text-muted)"},children:t==="running"?"Waiting for events...":"No events yet"})}):a.jsx("div",{ref:n,onScroll:o,className:"h-full overflow-y-auto font-mono text-xs leading-normal",children:e.map((l,u)=>{const c=new Date(l.timestamp).toLocaleTimeString(void 0,{hour12:!1}),d=l.payload&&Object.keys(l.payload).length>0,p=i===u,m=l.phase?uu[l.phase]??Vi:Vi;return a.jsxs("div",{children:[a.jsxs("div",{onClick:()=>{d&&s(p?null:u)},className:"flex items-center gap-2 px-3 py-1.5",style:{background:u%2===0?"var(--bg-primary)":"var(--bg-secondary)",cursor:d?"pointer":"default"},children:[a.jsx("span",{className:"shrink-0",style:{color:"var(--text-muted)"},children:c}),a.jsx("span",{className:"shrink-0",style:{color:m.color},children:"●"}),a.jsx("span",{className:"flex-1 truncate",style:{color:"var(--text-primary)"},children:l.node_name}),m.label&&a.jsx("span",{className:"shrink-0 text-[10px]",style:{color:"var(--text-muted)"},children:m.label}),d&&a.jsx("span",{className:"shrink-0 text-[9px] transition-transform",style:{color:"var(--text-muted)",transform:p?"rotate(90deg)":"rotate(0deg)"},children:"▸"})]}),p&&d&&a.jsx("div",{className:"px-3 py-2 border-t border-b",style:{borderColor:"var(--border)",background:"color-mix(in srgb, var(--bg-secondary) 80%, var(--bg-primary))"},children:a.jsx(ot,{json:JSON.stringify(l.payload,null,2),className:"text-[11px] font-mono whitespace-pre-wrap break-words"})})]},u)})})}function _t({title:e,copyText:t,trailing:n,children:r}){const[i,s]=N.useState(!1),o=N.useCallback(()=>{t&&navigator.clipboard.writeText(t).then(()=>{s(!0),setTimeout(()=>s(!1),1500)})},[t]);return a.jsxs("div",{className:"overflow-hidden",style:{border:"1px solid var(--border)"},children:[a.jsxs("div",{className:"px-3 py-2 flex items-center gap-2",style:{background:"var(--bg-secondary)"},children:[a.jsx("span",{className:"text-[11px] font-semibold",style:{color:"var(--text-primary)"},children:e}),n,t&&a.jsx("button",{onClick:o,className:`${n?"":"ml-auto "}text-[10px] cursor-pointer px-1.5 py-0.5 rounded transition-colors`,style:{color:i?"var(--success)":"var(--text-muted)",background:"var(--bg-tertiary)",border:"none"},onMouseEnter:l=>{i||(l.currentTarget.style.color="var(--text-primary)")},onMouseLeave:l=>{l.currentTarget.style.color=i?"var(--success)":"var(--text-muted)"},children:i?"Copied":"Copy"})]}),r]})}function Yi({runId:e,status:t,ws:n,breakpointNode:r}){const i=t==="suspended",s=o=>{const l=Ee.getState().breakpoints[e]??{};n.setBreakpoints(e,Object.keys(l)),o==="step"?n.debugStep(e):o==="continue"?n.debugContinue(e):n.debugStop(e)};return a.jsxs("div",{className:"flex items-center gap-1 px-4 h-10 border-b shrink-0",style:{borderColor:"var(--border)",background:"var(--bg-secondary)"},children:[a.jsx("span",{className:"text-[11px] font-semibold mr-1",style:{color:"var(--text-muted)"},children:"Debug"}),a.jsx(pr,{label:"Step",onClick:()=>s("step"),disabled:!i,color:"var(--info)",active:i}),a.jsx(pr,{label:"Continue",onClick:()=>s("continue"),disabled:!i,color:"var(--success)",active:i}),a.jsx(pr,{label:"Stop",onClick:()=>s("stop"),disabled:!i,color:"var(--error)",active:i}),a.jsx("span",{className:"text-[11px] ml-auto truncate",style:{color:i?"var(--accent)":"var(--text-muted)"},children:i?r?`Paused at ${r}`:"Paused":t})]})}function pr({label:e,onClick:t,disabled:n,color:r,active:i}){return a.jsx("button",{onClick:t,disabled:n,className:"px-3 py-1 h-7 text-[11px] font-semibold rounded transition-colors cursor-pointer disabled:opacity-30 disabled:cursor-not-allowed",style:{color:i?r:"var(--text-muted)",background:i?`color-mix(in srgb, ${r} 10%, transparent)`:"transparent"},onMouseEnter:s=>{n||(s.currentTarget.style.background=`color-mix(in srgb, ${r} 20%, transparent)`)},onMouseLeave:s=>{s.currentTarget.style.background=i?`color-mix(in srgb, ${r} 10%, transparent)`:"transparent"},children:e})}const Xi=N.lazy(()=>Ts(()=>import("./ChatPanel-DiTmerW3.js"),__vite__mapDeps([2,1,3,4]))),du=[],pu=[],fu=[],mu=[];function gu({run:e,ws:t,isMobile:n}){const r=e.mode==="chat",[i,s]=N.useState(280),[o,l]=N.useState(()=>{const C=localStorage.getItem("chatPanelWidth");return C?parseInt(C,10):380}),[u,c]=N.useState("primary"),[d,p]=N.useState(r?"primary":"traces"),m=N.useRef(null),f=N.useRef(null),h=N.useRef(!1),b=Ee(C=>C.traces[e.id]||du),x=Ee(C=>C.logs[e.id]||pu),y=Ee(C=>C.chatMessages[e.id]||fu),w=Ee(C=>C.stateEvents[e.id]||mu),T=Ee(C=>C.breakpoints[e.id]);N.useEffect(()=>{t.setBreakpoints(e.id,T?Object.keys(T):[])},[e.id]);const j=N.useCallback(C=>{t.setBreakpoints(e.id,C)},[e.id,t]),O=N.useCallback(C=>{C.preventDefault(),h.current=!0;const v="touches"in C?C.touches[0].clientY:C.clientY,E=i,I=U=>{if(!h.current)return;const V=m.current;if(!V)return;const g="touches"in U?U.touches[0].clientY:U.clientY,F=V.clientHeight-100,$=Math.max(80,Math.min(F,E+(g-v)));s($)},H=()=>{h.current=!1,document.removeEventListener("mousemove",I),document.removeEventListener("mouseup",H),document.removeEventListener("touchmove",I),document.removeEventListener("touchend",H),document.body.style.cursor="",document.body.style.userSelect=""};document.body.style.cursor="row-resize",document.body.style.userSelect="none",document.addEventListener("mousemove",I),document.addEventListener("mouseup",H),document.addEventListener("touchmove",I,{passive:!1}),document.addEventListener("touchend",H)},[i]),_=N.useCallback(C=>{C.preventDefault();const v="touches"in C?C.touches[0].clientX:C.clientX,E=o,I=U=>{const V=f.current;if(!V)return;const g="touches"in U?U.touches[0].clientX:U.clientX,F=V.clientWidth-300,$=Math.max(280,Math.min(F,E+(v-g)));l($)},H=()=>{document.removeEventListener("mousemove",I),document.removeEventListener("mouseup",H),document.removeEventListener("touchmove",I),document.removeEventListener("touchend",H),document.body.style.cursor="",document.body.style.userSelect="",localStorage.setItem("chatPanelWidth",String(o))};document.body.style.cursor="col-resize",document.body.style.userSelect="none",document.addEventListener("mousemove",I),document.addEventListener("mouseup",H),document.addEventListener("touchmove",I,{passive:!1}),document.addEventListener("touchend",H)},[o]),P=r?"Chat":"Events",D=r?"var(--accent)":"var(--success)",R=C=>C==="primary"?D:C==="events"?"var(--success)":"var(--accent)",S=Ee(C=>C.activeInterrupt[e.id]??null),M=e.status==="running"?a.jsx("span",{className:"ml-auto text-[11px] px-2 py-0.5 rounded-full shrink-0",style:{background:"color-mix(in srgb, var(--warning) 15%, var(--bg-secondary))",color:"var(--warning)"},children:r?"Thinking...":"Running..."}):r&&e.status==="suspended"&&S?a.jsx("span",{className:"ml-auto text-[11px] px-2 py-0.5 rounded-full shrink-0",style:{background:"color-mix(in srgb, var(--warning) 15%, var(--bg-secondary))",color:"var(--warning)"},children:"Action Required"}):null;if(n){const C=[{id:"traces",label:"Traces",count:b.length},{id:"primary",label:P},...r?[{id:"events",label:"Events",count:w.length}]:[],{id:"io",label:"I/O"},{id:"logs",label:"Logs",count:x.length}];return a.jsxs("div",{className:"flex flex-col h-full",children:[(e.mode==="debug"||e.status==="suspended"&&!S||T&&Object.keys(T).length>0)&&a.jsx(Yi,{runId:e.id,status:e.status,ws:t,breakpointNode:e.breakpoint_node}),a.jsx("div",{className:"shrink-0",style:{height:"40vh"},children:a.jsx(Un,{entrypoint:e.entrypoint,traces:b,runId:e.id,breakpointNode:e.breakpoint_node,breakpointNextNodes:e.breakpoint_next_nodes,onBreakpointChange:j})}),a.jsxs("div",{className:"flex items-center gap-1 px-2 h-10 border-y shrink-0",style:{borderColor:"var(--border)",background:"var(--bg-secondary)"},children:[C.map(v=>a.jsxs("button",{onClick:()=>p(v.id),className:"px-2.5 py-1 h-7 text-xs font-semibold rounded transition-colors cursor-pointer",style:{color:d===v.id?R(v.id):"var(--text-muted)",background:d===v.id?`color-mix(in srgb, ${R(v.id)} 10%, transparent)`:"transparent"},children:[v.label,v.count!==void 0&&v.count>0&&a.jsx("span",{className:"ml-1 font-normal",style:{color:"var(--text-muted)"},children:v.count})]},v.id)),M]}),a.jsxs("div",{className:"flex-1 overflow-hidden",children:[d==="traces"&&a.jsx(Dr,{traces:b}),d==="primary"&&(r?a.jsx(N.Suspense,{fallback:a.jsx("div",{className:"flex items-center justify-center h-full",style:{color:"var(--text-muted)"},children:a.jsx("span",{className:"text-xs",children:"Loading chat..."})}),children:a.jsx(Xi,{messages:y,runId:e.id,runStatus:e.status,ws:t})}):a.jsx(An,{events:w,runStatus:e.status})),d==="events"&&a.jsx(An,{events:w,runStatus:e.status}),d==="io"&&a.jsx(Zi,{run:e}),d==="logs"&&a.jsx(qi,{logs:x})]})]})}const L=[{id:"primary",label:P},...r?[{id:"events",label:"Events",count:w.length}]:[],{id:"io",label:"I/O"},{id:"logs",label:"Logs",count:x.length}];return a.jsxs("div",{ref:f,className:"flex h-full",children:[a.jsxs("div",{ref:m,className:"flex flex-col flex-1 min-w-0",children:[(e.mode==="debug"||e.status==="suspended"&&!S||T&&Object.keys(T).length>0)&&a.jsx(Yi,{runId:e.id,status:e.status,ws:t,breakpointNode:e.breakpoint_node}),a.jsx("div",{className:"shrink-0 overflow-hidden",style:{height:i},children:a.jsx(Un,{entrypoint:e.entrypoint,traces:b,runId:e.id,breakpointNode:e.breakpoint_node,breakpointNextNodes:e.breakpoint_next_nodes,onBreakpointChange:j})}),a.jsx("div",{onMouseDown:O,onTouchStart:O,className:"shrink-0 drag-handle-row"}),a.jsx("div",{className:"flex-1 overflow-hidden",children:a.jsx(Dr,{traces:b})})]}),a.jsx("div",{onMouseDown:_,onTouchStart:_,className:"shrink-0 drag-handle-col"}),a.jsxs("div",{className:"shrink-0 flex flex-col",style:{width:o,background:"var(--bg-primary)"},children:[a.jsxs("div",{className:"flex items-center gap-1 px-2 h-10 border-b shrink-0",style:{borderColor:"var(--border)",background:"var(--bg-secondary)"},children:[L.map(C=>a.jsxs("button",{onClick:()=>c(C.id),className:"px-2.5 py-1 h-7 text-xs font-semibold rounded transition-colors cursor-pointer",style:{color:u===C.id?R(C.id):"var(--text-muted)",background:u===C.id?`color-mix(in srgb, ${R(C.id)} 10%, transparent)`:"transparent"},onMouseEnter:v=>{u!==C.id&&(v.currentTarget.style.color="var(--text-primary)")},onMouseLeave:v=>{u!==C.id&&(v.currentTarget.style.color="var(--text-muted)")},children:[C.label,C.count!==void 0&&C.count>0&&a.jsx("span",{className:"ml-1 font-normal",style:{color:"var(--text-muted)"},children:C.count})]},C.id)),M]}),a.jsxs("div",{className:"flex-1 overflow-hidden",children:[u==="primary"&&(r?a.jsx(N.Suspense,{fallback:a.jsx("div",{className:"flex items-center justify-center h-full",style:{color:"var(--text-muted)"},children:a.jsx("span",{className:"text-xs",children:"Loading chat..."})}),children:a.jsx(Xi,{messages:y,runId:e.id,runStatus:e.status,ws:t})}):a.jsx(An,{events:w,runStatus:e.status})),u==="events"&&a.jsx(An,{events:w,runStatus:e.status}),u==="io"&&a.jsx(Zi,{run:e}),u==="logs"&&a.jsx(qi,{logs:x})]})]})]})}function Zi({run:e}){return a.jsxs("div",{className:"p-2 overflow-y-auto h-full space-y-1.5",children:[a.jsx(_t,{title:"Input",copyText:JSON.stringify(e.input_data,null,2),children:a.jsx(ot,{json:JSON.stringify(e.input_data,null,2),className:"px-3 py-2 text-xs font-mono whitespace-pre-wrap break-words"})}),e.output_data&&a.jsx(_t,{title:"Output",copyText:typeof e.output_data=="string"?e.output_data:JSON.stringify(e.output_data,null,2),children:a.jsx(ot,{json:typeof e.output_data=="string"?e.output_data:JSON.stringify(e.output_data,null,2),className:"px-3 py-2 text-xs font-mono whitespace-pre-wrap break-words"})}),e.error&&a.jsxs("div",{className:"overflow-hidden",style:{border:"1px solid color-mix(in srgb, var(--error) 40%, var(--border))"},children:[a.jsxs("div",{className:"px-3 py-2 text-xs font-semibold flex items-center gap-2",style:{background:"color-mix(in srgb, var(--error) 15%, var(--bg-secondary))",color:"var(--error)"},children:[a.jsx("span",{children:"Error"}),a.jsx("span",{className:"px-1.5 py-0.5 rounded text-[10px] font-mono",style:{background:"color-mix(in srgb, var(--error) 20%, var(--bg-secondary))"},children:e.error.code}),a.jsx("span",{className:"px-1.5 py-0.5 rounded text-[10px] font-mono",style:{background:"color-mix(in srgb, var(--error) 20%, var(--bg-secondary))"},children:e.error.category})]}),a.jsxs("div",{className:"px-3 py-2 text-xs leading-normal",children:[a.jsx("div",{className:"font-semibold mb-2",style:{color:"var(--text-primary)"},children:e.error.title}),a.jsx("pre",{className:"whitespace-pre-wrap font-mono text-[11px] max-w-prose",style:{color:"var(--text-secondary)"},children:e.error.detail})]})]})]})}function Ji(){const{reloadPending:e,setReloadPending:t,setEntrypoints:n}=Ee(),[r,i]=N.useState(!1);if(!e)return null;const s=async()=>{i(!0);try{await nc();const o=await ks();n(o.map(l=>l.name)),t(!1)}catch(o){console.error("Reload failed:",o)}finally{i(!1)}};return a.jsxs("div",{className:"fixed top-4 left-1/2 -translate-x-1/2 z-50 flex items-center justify-between px-5 py-2.5 rounded-lg shadow-lg min-w-[400px]",style:{background:"var(--bg-secondary)",border:"1px solid var(--bg-tertiary)"},children:[a.jsx("span",{className:"text-sm",style:{color:"var(--text-secondary)"},children:"Files changed, reload to apply"}),a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("button",{onClick:s,disabled:r,className:"px-3 py-1 text-sm font-medium rounded cursor-pointer",style:{background:"var(--accent)",color:"#fff",opacity:r?.6:1},children:r?"Reloading...":"Reload"}),a.jsx("button",{onClick:()=>t(!1),className:"text-sm cursor-pointer px-1",style:{color:"var(--text-muted)",background:"none",border:"none"},children:"✕"})]})]})}let hu=0;const Qi=Ot(e=>({toasts:[],addToast:(t,n)=>{const r=String(++hu);e(s=>({toasts:[...s.toasts,{id:r,type:t,message:n}]})),setTimeout(()=>{e(s=>({toasts:s.toasts.filter(o=>o.id!==r)}))},t==="error"?8e3:5e3)},removeToast:t=>{e(n=>({toasts:n.toasts.filter(r=>r.id!==t)}))}})),eo={success:{color:"var(--success)",bg:"color-mix(in srgb, var(--success) 10%, var(--bg-elevated))",border:"color-mix(in srgb, var(--success) 30%, var(--border))"},error:{color:"var(--error)",bg:"color-mix(in srgb, var(--error) 10%, var(--bg-elevated))",border:"color-mix(in srgb, var(--error) 30%, var(--border))"},info:{color:"var(--info)",bg:"color-mix(in srgb, var(--info) 10%, var(--bg-elevated))",border:"color-mix(in srgb, var(--info) 30%, var(--border))"}};function to(){const e=Qi(n=>n.toasts),t=Qi(n=>n.removeToast);return e.length===0?null:a.jsx("div",{className:"fixed bottom-8 right-4 z-[100] flex flex-col gap-2 pointer-events-none",children:e.map(n=>{const r=eo[n.type]??eo.info;return a.jsxs("div",{className:"pointer-events-auto flex items-center gap-2 px-4 py-2.5 rounded-lg shadow-lg text-xs font-medium max-w-xs animate-[slideIn_0.2s_ease-out]",style:{background:r.bg,border:`1px solid ${r.border}`,color:r.color},children:[a.jsx("span",{className:"flex-1",children:n.message}),a.jsx("button",{onClick:()=>t(n.id),className:"shrink-0 w-5 h-5 flex items-center justify-center rounded cursor-pointer transition-opacity opacity-60 hover:opacity-100",style:{color:r.color,background:"transparent",border:"none"},"aria-label":"Dismiss",children:a.jsxs("svg",{width:"10",height:"10",viewBox:"0 0 10 10",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",children:[a.jsx("line",{x1:"1",y1:"1",x2:"9",y2:"9"}),a.jsx("line",{x1:"9",y1:"1",x2:"1",y2:"9"})]})})]},n.id)})})}function bu(e){return e===null?"-":`${Math.round(e*100)}%`}function xu(e){if(e===null)return"var(--text-muted)";const t=e*100;return t>=80?"var(--success)":t>=50?"var(--warning)":"var(--error)"}const no={pending:{color:"var(--text-muted)",label:"Pending"},running:{color:"var(--info)",label:"Running"},completed:{color:"var(--success)",label:"Completed"},failed:{color:"var(--error)",label:"Failed"}};function ro(){const e=Me(l=>l.evalSets),t=Me(l=>l.evalRuns),{evalSetId:n,evalRunId:r,navigate:i}=st(),s=Object.values(e),o=Object.values(t).sort((l,u)=>new Date(u.start_time??0).getTime()-new Date(l.start_time??0).getTime());return a.jsxs("div",{className:"flex-1 overflow-y-auto",children:[a.jsx("button",{onClick:()=>i("#/evals/new"),className:"w-[calc(100%-24px)] mx-3 mt-2.5 mb-1 px-3 py-1.5 text-[11px] text-center font-medium rounded border border-[var(--border)] bg-transparent transition-colors cursor-pointer",style:{color:"var(--text-secondary)"},onMouseEnter:l=>{l.currentTarget.style.color="var(--text-primary)",l.currentTarget.style.borderColor="var(--text-muted)"},onMouseLeave:l=>{l.currentTarget.style.color="var(--text-secondary)",l.currentTarget.style.borderColor=""},children:"+ New Eval Set"}),a.jsx("div",{className:"px-3 pt-3 pb-1 text-[11px] uppercase tracking-widest font-semibold",style:{color:"var(--text-muted)"},children:"Eval Sets"}),s.map(l=>{const u=n===l.id;return a.jsxs("button",{onClick:()=>i(`#/evals/sets/${l.id}`),className:"w-full text-left px-3 py-1.5 text-xs cursor-pointer transition-colors",style:{background:u?"color-mix(in srgb, var(--accent) 15%, var(--bg-primary))":"transparent",color:u?"var(--text-primary)":"var(--text-secondary)",borderLeft:u?"3px solid var(--accent)":"3px solid transparent"},onMouseEnter:c=>{u||(c.currentTarget.style.background="var(--bg-hover)")},onMouseLeave:c=>{u||(c.currentTarget.style.background="transparent")},children:[a.jsx("div",{className:"truncate font-medium",children:l.name}),a.jsxs("div",{className:"text-[11px] mt-0.5",style:{color:"var(--text-muted)"},children:[l.eval_count," items · ",l.evaluator_ids.length," evaluator",l.evaluator_ids.length!==1?"s":""]})]},l.id)}),s.length===0&&a.jsx("p",{className:"text-[11px] px-3 py-2",style:{color:"var(--text-muted)"},children:"No eval sets yet"}),a.jsx("div",{className:"px-3 pt-4 pb-1 text-[11px] uppercase tracking-widest font-semibold",style:{color:"var(--text-muted)"},children:"History"}),o.map(l=>{const u=r===l.id,c=no[l.status]??no.pending;return a.jsx("button",{onClick:()=>i(`#/evals/runs/${l.id}`),className:"w-full text-left px-3 py-1.5 text-xs cursor-pointer transition-colors",style:{background:u?"color-mix(in srgb, var(--accent) 15%, var(--bg-primary))":"transparent",color:u?"var(--text-primary)":"var(--text-secondary)",borderLeft:u?"3px solid var(--accent)":"3px solid transparent"},onMouseEnter:d=>{u||(d.currentTarget.style.background="var(--bg-hover)")},onMouseLeave:d=>{u||(d.currentTarget.style.background="transparent")},children:a.jsxs("div",{className:"flex items-center gap-1.5",children:[a.jsx("div",{className:"w-2 h-2 rounded-full shrink-0",style:{background:c.color}}),a.jsxs("div",{className:"flex-1 min-w-0",children:[a.jsx("div",{className:"truncate font-medium",children:l.eval_set_name}),a.jsx("div",{className:"text-[11px] mt-0.5",style:{color:"var(--text-muted)"},children:l.start_time?new Date(l.start_time).toLocaleString():c.label})]}),a.jsx("span",{className:"font-mono shrink-0",style:{color:xu(l.overall_score)},children:bu(l.overall_score)})]})},l.id)}),o.length===0&&a.jsx("p",{className:"text-[11px] px-3 py-2",style:{color:"var(--text-muted)"},children:"No eval runs yet"})]})}function io(e,t=60){const n=typeof e=="string"?e:JSON.stringify(e);return!n||n==="null"?"-":n.length>t?n.slice(0,t)+"...":n}function yu({evalSetId:e}){const[t,n]=N.useState(null),[r,i]=N.useState(!0),[s,o]=N.useState(null),[l,u]=N.useState(!1),[c,d]=N.useState("io"),p=Me(g=>g.evaluators),m=Me(g=>g.localEvaluators),f=Me(g=>g.updateEvalSetEvaluators),h=Me(g=>g.incrementEvalSetCount),b=Me(g=>g.upsertEvalRun),{navigate:x}=st(),[y,w]=N.useState(!1),[T,j]=N.useState(new Set),[O,_]=N.useState(!1),P=N.useRef(null),[D,R]=N.useState(()=>{const g=localStorage.getItem("evalSetSidebarWidth");return g?parseInt(g,10):320}),[S,M]=N.useState(!1),L=N.useRef(null);N.useEffect(()=>{localStorage.setItem("evalSetSidebarWidth",String(D))},[D]),N.useEffect(()=>{i(!0),o(null),fc(e).then(g=>{n(g),g.items.length>0&&o(g.items[0].name)}).catch(console.error).finally(()=>i(!1))},[e]);const C=async()=>{u(!0);try{const g=await mc(e);b(g),x(`#/evals/runs/${g.id}`)}catch(g){console.error(g)}finally{u(!1)}},v=async g=>{if(t)try{await pc(e,g),n(F=>{if(!F)return F;const $=F.items.filter(k=>k.name!==g);return{...F,items:$,eval_count:$.length}}),h(e,-1),s===g&&o(null)}catch(F){console.error(F)}},E=N.useCallback(()=>{t&&j(new Set(t.evaluator_ids)),w(!0)},[t]),I=g=>{j(F=>{const $=new Set(F);return $.has(g)?$.delete(g):$.add(g),$})},H=async()=>{if(t){_(!0);try{const g=await bc(e,Array.from(T));n(g),f(e,g.evaluator_ids),w(!1)}catch(g){console.error(g)}finally{_(!1)}}};N.useEffect(()=>{if(!y)return;const g=F=>{P.current&&!P.current.contains(F.target)&&w(!1)};return document.addEventListener("mousedown",g),()=>document.removeEventListener("mousedown",g)},[y]);const U=N.useCallback(g=>{g.preventDefault(),M(!0);const F="touches"in g?g.touches[0].clientX:g.clientX,$=D,k=K=>{const W=L.current;if(!W)return;const re="touches"in K?K.touches[0].clientX:K.clientX,de=W.clientWidth-300,xe=Math.max(280,Math.min(de,$+(F-re)));R(xe)},ie=()=>{M(!1),document.removeEventListener("mousemove",k),document.removeEventListener("mouseup",ie),document.removeEventListener("touchmove",k),document.removeEventListener("touchend",ie),document.body.style.cursor="",document.body.style.userSelect=""};document.body.style.cursor="col-resize",document.body.style.userSelect="none",document.addEventListener("mousemove",k),document.addEventListener("mouseup",ie),document.addEventListener("touchmove",k,{passive:!1}),document.addEventListener("touchend",ie)},[D]);if(r)return a.jsx("div",{className:"flex items-center justify-center h-full text-[var(--text-muted)] text-sm",children:"Loading..."});if(!t)return a.jsx("div",{className:"flex items-center justify-center h-full text-[var(--text-muted)]",children:"Eval set not found"});const V=t.items.find(g=>g.name===s)??null;return a.jsxs("div",{ref:L,className:"flex h-full",children:[a.jsxs("div",{className:"flex flex-col flex-1 min-w-0",children:[a.jsxs("div",{className:"px-4 h-10 border-b shrink-0 flex items-center gap-4",style:{borderColor:"var(--border)"},children:[a.jsx("h1",{className:"text-base font-semibold",style:{color:"var(--text-primary)"},children:t.name}),a.jsxs("span",{className:"text-[11px]",style:{color:"var(--text-muted)"},children:[t.eval_count," items"]}),a.jsxs("div",{className:"flex gap-1 items-center ml-auto relative",children:[a.jsx("button",{onClick:E,className:"w-7 h-7 flex items-center justify-center rounded cursor-pointer transition-colors",style:{color:"var(--text-muted)",background:"transparent",border:"none"},onMouseEnter:g=>{g.currentTarget.style.color="var(--text-primary)",g.currentTarget.style.background="var(--bg-secondary)"},onMouseLeave:g=>{g.currentTarget.style.color="var(--text-muted)",g.currentTarget.style.background="transparent"},title:"Edit evaluators","aria-label":"Edit evaluators",children:a.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[a.jsx("path",{d:"M17 3a2.85 2.83 0 1 1 4 4L7.5 20.5 2 22l1.5-5.5Z"}),a.jsx("path",{d:"m15 5 4 4"})]})}),t.evaluator_ids.map(g=>{const F=p.find($=>$.id===g);return a.jsx("span",{className:"px-1.5 py-0.5 rounded text-[11px] font-medium",style:{background:"var(--bg-tertiary)",color:"var(--text-secondary)"},children:(F==null?void 0:F.name)??g},g)}),y&&a.jsxs("div",{ref:P,className:"absolute top-full right-0 mt-1 z-50 rounded-md border shadow-lg",style:{background:"var(--bg-primary)",borderColor:"var(--border)",minWidth:220},children:[a.jsx("div",{className:"px-3 py-2 border-b text-[10px] uppercase tracking-wide font-semibold",style:{color:"var(--text-muted)",borderColor:"var(--border)"},children:"Evaluators"}),a.jsx("div",{className:"max-h-48 overflow-y-auto",children:m.length===0?a.jsx("div",{className:"px-3 py-3 text-xs",style:{color:"var(--text-muted)"},children:"No evaluators available"}):m.map(g=>a.jsxs("label",{className:"flex items-center gap-2 px-3 py-1.5 text-xs cursor-pointer transition-colors",style:{borderBottom:"1px solid var(--border)"},onMouseEnter:F=>{F.currentTarget.style.background="var(--bg-hover)"},onMouseLeave:F=>{F.currentTarget.style.background="transparent"},children:[a.jsx("input",{type:"checkbox",checked:T.has(g.id),onChange:()=>I(g.id),className:"accent-[var(--accent)]"}),a.jsx("span",{className:"flex-1 truncate",style:{color:"var(--text-primary)"},children:g.name})]},g.id))}),a.jsx("div",{className:"px-3 py-2 border-t flex justify-end",style:{borderColor:"var(--border)"},children:a.jsx("button",{onClick:H,disabled:O,className:"px-3 py-1 text-[11px] font-semibold rounded cursor-pointer transition-colors disabled:opacity-50",style:{background:"var(--accent)",color:"var(--bg-primary)",border:"none"},onMouseEnter:g=>{g.currentTarget.style.background="var(--accent-hover)"},onMouseLeave:g=>{g.currentTarget.style.background="var(--accent)"},children:O?"Saving...":"Update"})})]})]}),a.jsxs("button",{onClick:C,disabled:l,className:"ml-2 px-3 py-1 h-7 text-xs font-semibold rounded border flex items-center gap-1.5 cursor-pointer transition-colors disabled:opacity-30 disabled:cursor-not-allowed",style:{color:"var(--success)",borderColor:"var(--success)",background:"transparent"},onMouseEnter:g=>{l||(g.currentTarget.style.background="color-mix(in srgb, var(--success) 10%, transparent)")},onMouseLeave:g=>{g.currentTarget.style.background="transparent"},title:"Run eval set","aria-label":"Run eval set",children:[a.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"currentColor",stroke:"none",children:a.jsx("polygon",{points:"5,3 19,12 5,21"})}),l?"Running...":"Run"]})]}),a.jsxs("div",{className:"flex items-center px-3 h-7 text-[11px] font-semibold shrink-0 border-b",style:{color:"var(--text-muted)",background:"var(--bg-secondary)",borderColor:"var(--border)"},children:[a.jsx("span",{className:"w-56 shrink-0",children:"Name"}),a.jsx("span",{className:"flex-1 min-w-0",children:"Input"}),a.jsx("span",{className:"w-32 shrink-0 pl-2",children:"Expected Behavior"}),a.jsx("span",{className:"w-32 shrink-0 pl-2",children:"Expected Output"}),a.jsx("span",{className:"w-32 shrink-0 pl-2",children:"Simulation Instr."}),a.jsx("span",{className:"w-8 shrink-0"})]}),a.jsxs("div",{className:"flex-1 overflow-y-auto",children:[t.items.map(g=>{const F=g.name===s;return a.jsxs("button",{onClick:()=>o(F?null:g.name),className:"group w-full text-left px-3 py-1.5 flex items-center text-xs border-b transition-colors cursor-pointer",style:{borderColor:"var(--border)",background:F?"color-mix(in srgb, var(--accent) 10%, var(--bg-primary))":void 0,borderLeft:F?"3px solid var(--accent)":"3px solid transparent"},onMouseEnter:$=>{F||($.currentTarget.style.background="var(--bg-hover)")},onMouseLeave:$=>{F||($.currentTarget.style.background="")},children:[a.jsx("span",{className:"w-56 shrink-0 truncate",style:{color:"var(--text-primary)"},children:g.name}),a.jsx("span",{className:"flex-1 min-w-0 truncate font-mono text-[11px]",style:{color:"var(--text-muted)"},children:io(g.inputs)}),a.jsx("span",{className:"w-32 shrink-0 truncate pl-2 text-[11px]",style:{color:"var(--text-muted)"},children:g.expected_behavior||"-"}),a.jsx("span",{className:"w-32 shrink-0 truncate pl-2 font-mono text-[11px]",style:{color:"var(--text-muted)"},children:io(g.expected_output,40)}),a.jsx("span",{className:"w-32 shrink-0 truncate pl-2 text-[11px]",style:{color:"var(--text-muted)"},children:g.simulation_instructions||"-"}),a.jsx("span",{role:"button",tabIndex:0,className:"w-8 shrink-0 flex items-center justify-center opacity-0 group-hover:opacity-100 transition-opacity",onClick:$=>{$.stopPropagation(),v(g.name)},onKeyDown:$=>{$.key==="Enter"&&($.stopPropagation(),v(g.name))},style:{color:"var(--text-muted)"},onMouseEnter:$=>{$.currentTarget.style.color="var(--error)"},onMouseLeave:$=>{$.currentTarget.style.color="var(--text-muted)"},title:"Delete item",children:a.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",children:[a.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),a.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})]},g.name)}),t.items.length===0&&a.jsx("div",{className:"flex items-center justify-center py-8 text-[var(--text-muted)] text-xs",children:"No items in this eval set"})]})]}),a.jsx("div",{onMouseDown:U,onTouchStart:U,className:`shrink-0 drag-handle-col${S?"":" transition-all"}`,style:{width:V?3:0,opacity:V?1:0}}),a.jsxs("div",{className:`shrink-0 flex flex-col overflow-hidden${S?"":" transition-[width] duration-200 ease-in-out"}`,style:{width:V?D:0,background:"var(--bg-primary)"},children:[a.jsx("div",{className:"flex items-center gap-1 px-2 h-10 border-b shrink-0",style:{borderColor:"var(--border)",background:"var(--bg-secondary)",minWidth:D},children:["io","evaluators"].map(g=>{const F=c===g,$=g==="io"?"I/O":"Evaluators";return a.jsx("button",{onClick:()=>d(g),className:"px-2.5 py-1 h-7 text-xs font-semibold rounded inline-flex items-center cursor-pointer transition-colors",style:{color:F?"var(--accent)":"var(--text-muted)",background:F?"color-mix(in srgb, var(--accent) 10%, transparent)":"transparent",border:"none"},children:$},g)})}),a.jsx("div",{className:"flex-1 overflow-hidden",style:{minWidth:D},children:V?c==="io"?a.jsx(vu,{item:V}):a.jsx(ku,{item:V,evaluators:p}):null})]})]})}function vu({item:e}){const t=JSON.stringify(e.inputs,null,2),n=e.expected_output!=null?typeof e.expected_output=="string"?e.expected_output:JSON.stringify(e.expected_output,null,2):null;return a.jsxs("div",{className:"p-2 overflow-y-auto h-full space-y-1.5",children:[a.jsx(_t,{title:"Input",copyText:t,children:a.jsx(ot,{json:t,className:"px-3 py-2 text-xs font-mono whitespace-pre-wrap break-words"})}),e.expected_behavior&&a.jsx(_t,{title:"Expected Behavior",copyText:e.expected_behavior,children:a.jsx("div",{className:"px-3 py-2 text-xs leading-relaxed whitespace-pre-wrap",style:{color:"var(--text-secondary)"},children:e.expected_behavior})}),n&&a.jsx(_t,{title:"Expected Output",copyText:n,children:a.jsx(ot,{json:n,className:"px-3 py-2 text-xs font-mono whitespace-pre-wrap break-words"})}),e.simulation_instructions&&a.jsx(_t,{title:"Simulation Instructions",copyText:e.simulation_instructions,children:a.jsx("div",{className:"px-3 py-2 text-xs leading-relaxed whitespace-pre-wrap",style:{color:"var(--text-secondary)"},children:e.simulation_instructions})})]})}function ku({item:e,evaluators:t}){return a.jsx("div",{className:"p-2 overflow-y-auto h-full space-y-1.5",children:e.evaluator_ids.length>0?a.jsx(a.Fragment,{children:e.evaluator_ids.map(n=>{var s;const r=t.find(o=>o.id===n),i=(s=e.evaluation_criterias)==null?void 0:s[n];return a.jsxs("div",{className:"overflow-hidden",style:{border:"1px solid var(--border)"},children:[a.jsxs("div",{className:"px-3 py-2 flex items-center gap-2",style:{background:"var(--bg-secondary)"},children:[a.jsx("span",{className:"text-[11px] font-semibold",style:{color:"var(--text-primary)"},children:(r==null?void 0:r.name)??n}),a.jsx("span",{className:"ml-auto text-[10px]",style:{color:"var(--text-muted)"},children:i?"Custom criteria":"Default criteria"})]}),i&&a.jsx("pre",{className:"px-3 py-2 border-t text-[11px] font-mono overflow-x-auto max-h-32 whitespace-pre-wrap break-words",style:{borderColor:"var(--border)",color:"var(--text-secondary)"},children:JSON.stringify(i,null,2)})]},n)})}):a.jsx("div",{className:"flex items-center justify-center h-full text-[var(--text-muted)] text-xs",children:"No evaluators configured for this item"})})}function en(e){return e===null?"-":`${Math.round(e*100)}%`}function wt(e){if(e===null)return"var(--text-muted)";const t=e*100;return t>=80?"var(--success)":t>=50?"var(--warning)":"var(--error)"}function Eu(e,t){if(!e)return"-";const n=new Date(e).getTime(),r=t?new Date(t).getTime():Date.now(),i=Math.round((r-n)/1e3);return i<60?`${i}s`:`${Math.floor(i/60)}m ${i%60}s`}function oo(e){return e.replace(/\s*Evaluator$/i,"")}const so={pending:{color:"var(--text-muted)",bg:"var(--bg-tertiary)",label:"Pending"},running:{color:"var(--info)",bg:"rgba(59,130,246,0.1)",label:"Running"},completed:{color:"var(--success)",bg:"rgba(34,197,94,0.1)",label:"Completed"},failed:{color:"var(--error)",bg:"rgba(239,68,68,0.1)",label:"Failed"}};function wu({evalRunId:e,itemName:t}){const[n,r]=N.useState(null),[i,s]=N.useState(!0),{navigate:o}=st(),l=t??null,[u,c]=N.useState(220),d=N.useRef(null),p=N.useRef(!1),[m,f]=N.useState(()=>{const M=localStorage.getItem("evalSidebarWidth");return M?parseInt(M,10):320}),[h,b]=N.useState(!1),x=N.useRef(null);N.useEffect(()=>{localStorage.setItem("evalSidebarWidth",String(m))},[m]);const y=Me(M=>M.evalRuns[e]),w=Me(M=>M.evaluators);N.useEffect(()=>{s(!0),Li(e).then(M=>{if(r(M),!t){const L=M.results.find(C=>C.status==="completed")??M.results[0];L&&o(`#/evals/runs/${e}/${encodeURIComponent(L.name)}`)}}).catch(console.error).finally(()=>s(!1))},[e]),N.useEffect(()=>{((y==null?void 0:y.status)==="completed"||(y==null?void 0:y.status)==="failed")&&Li(e).then(r).catch(console.error)},[y==null?void 0:y.status,e]),N.useEffect(()=>{if(t||!(n!=null&&n.results))return;const M=n.results.find(L=>L.status==="completed")??n.results[0];M&&o(`#/evals/runs/${e}/${encodeURIComponent(M.name)}`)},[n==null?void 0:n.results]);const T=N.useCallback(M=>{M.preventDefault(),p.current=!0;const L="touches"in M?M.touches[0].clientY:M.clientY,C=u,v=I=>{if(!p.current)return;const H=d.current;if(!H)return;const U="touches"in I?I.touches[0].clientY:I.clientY,V=H.clientHeight-100,g=Math.max(80,Math.min(V,C+(U-L)));c(g)},E=()=>{p.current=!1,document.removeEventListener("mousemove",v),document.removeEventListener("mouseup",E),document.removeEventListener("touchmove",v),document.removeEventListener("touchend",E),document.body.style.cursor="",document.body.style.userSelect=""};document.body.style.cursor="row-resize",document.body.style.userSelect="none",document.addEventListener("mousemove",v),document.addEventListener("mouseup",E),document.addEventListener("touchmove",v,{passive:!1}),document.addEventListener("touchend",E)},[u]),j=N.useCallback(M=>{M.preventDefault(),b(!0);const L="touches"in M?M.touches[0].clientX:M.clientX,C=m,v=I=>{const H=x.current;if(!H)return;const U="touches"in I?I.touches[0].clientX:I.clientX,V=H.clientWidth-300,g=Math.max(280,Math.min(V,C+(L-U)));f(g)},E=()=>{b(!1),document.removeEventListener("mousemove",v),document.removeEventListener("mouseup",E),document.removeEventListener("touchmove",v),document.removeEventListener("touchend",E),document.body.style.cursor="",document.body.style.userSelect=""};document.body.style.cursor="col-resize",document.body.style.userSelect="none",document.addEventListener("mousemove",v),document.addEventListener("mouseup",E),document.addEventListener("touchmove",v,{passive:!1}),document.addEventListener("touchend",E)},[m]);if(i)return a.jsx("div",{className:"flex items-center justify-center h-full text-[var(--text-muted)] text-sm",children:"Loading..."});if(!n)return a.jsx("div",{className:"flex items-center justify-center h-full text-[var(--text-muted)]",children:"Eval run not found"});const O=y??n,_=so[O.status]??so.pending,P=O.status==="running",D=Object.keys(O.evaluator_scores??{}),R=n.results.find(M=>M.name===l)??null,S=((R==null?void 0:R.traces)??[]).map(M=>({...M,run_id:""}));return a.jsxs("div",{ref:x,className:"flex h-full",children:[a.jsxs("div",{ref:d,className:"flex flex-col flex-1 min-w-0",children:[a.jsxs("div",{className:"px-4 h-10 border-b shrink-0 flex items-center gap-4",style:{borderColor:"var(--border)"},children:[a.jsx("h1",{className:"text-base font-semibold truncate min-w-0",style:{color:"var(--text-primary)"},children:O.eval_set_name}),a.jsx("span",{className:"px-2 py-0.5 rounded text-[11px] font-semibold uppercase tracking-wide",style:{color:_.color,background:_.bg},children:_.label}),a.jsx("span",{className:"text-sm font-bold font-mono",style:{color:wt(O.overall_score)},children:en(O.overall_score)}),a.jsx("span",{className:"text-[11px]",style:{color:"var(--text-muted)"},children:Eu(O.start_time,O.end_time)}),P&&a.jsxs("div",{className:"flex items-center gap-2 max-w-[160px]",children:[a.jsx("div",{className:"flex-1 h-2 rounded-full overflow-hidden",style:{background:"var(--bg-tertiary)"},children:a.jsx("div",{className:"h-full rounded-full transition-all",style:{width:`${O.progress_total>0?O.progress_completed/O.progress_total*100:0}%`,background:"var(--info)"}})}),a.jsxs("span",{className:"text-[11px] shrink-0",style:{color:"var(--text-muted)"},children:[O.progress_completed,"/",O.progress_total]})]}),D.length>0&&a.jsx("div",{className:"flex gap-3 ml-auto",children:D.map(M=>{const L=w.find(v=>v.id===M),C=O.evaluator_scores[M];return a.jsxs("div",{className:"flex items-center gap-1.5",children:[a.jsx("span",{className:"text-[11px]",style:{color:"var(--text-muted)"},children:oo((L==null?void 0:L.name)??M)}),a.jsx("div",{className:"w-12 h-2 rounded-full overflow-hidden",style:{background:"var(--bg-tertiary)"},children:a.jsx("div",{className:"h-full rounded-full",style:{width:`${C*100}%`,background:wt(C)}})}),a.jsx("span",{className:"text-[11px] font-mono",style:{color:wt(C)},children:en(C)})]},M)})})]}),a.jsxs("div",{className:"shrink-0 overflow-hidden flex flex-col",style:{height:u},children:[a.jsxs("div",{className:"flex items-center px-3 h-7 text-[11px] font-semibold shrink-0 border-b",style:{color:"var(--text-muted)",background:"var(--bg-secondary)",borderColor:"var(--border)"},children:[a.jsx("span",{className:"w-5 shrink-0"}),a.jsx("span",{className:"flex-1 min-w-0",children:"Name"}),a.jsx("span",{className:"w-14 shrink-0 text-right",children:"Score"}),D.map(M=>{const L=w.find(C=>C.id===M);return a.jsx("span",{className:"w-36 shrink-0 text-right truncate pl-2",title:(L==null?void 0:L.name)??M,children:oo((L==null?void 0:L.name)??M)},M)}),a.jsx("span",{className:"w-14 shrink-0 text-right",children:"Time"})]}),a.jsxs("div",{className:"flex-1 overflow-y-auto",children:[n.results.map(M=>{const L=M.status==="pending",C=M.status==="failed",v=M.name===l;return a.jsxs("button",{onClick:()=>{o(v?`#/evals/runs/${e}`:`#/evals/runs/${e}/${encodeURIComponent(M.name)}`)},className:"w-full text-left px-3 py-1.5 flex items-center text-xs border-b transition-colors cursor-pointer",style:{borderColor:"var(--border)",background:v?"color-mix(in srgb, var(--accent) 10%, var(--bg-primary))":void 0,borderLeft:v?"2px solid var(--accent)":"2px solid transparent",opacity:L?.5:1},onMouseEnter:E=>{v||(E.currentTarget.style.background="var(--bg-hover)")},onMouseLeave:E=>{v||(E.currentTarget.style.background="")},children:[a.jsx("span",{className:"w-5 shrink-0 flex justify-center",children:a.jsx("span",{className:"w-2 h-2 rounded-full",style:{background:L?"var(--text-muted)":C?"var(--error)":M.overall_score>=.8?"var(--success)":M.overall_score>=.5?"var(--warning)":"var(--error)"}})}),a.jsx("span",{className:"flex-1 min-w-0 truncate",style:{color:"var(--text-primary)"},children:M.name}),a.jsx("span",{className:"w-14 shrink-0 text-right font-mono font-semibold",style:{color:wt(L?null:M.overall_score)},children:L?"-":en(M.overall_score)}),D.map(E=>a.jsx("span",{className:"w-36 shrink-0 text-right font-mono pl-2",style:{color:wt(L?null:M.scores[E]??null)},children:L?"-":en(M.scores[E]??null)},E)),a.jsx("span",{className:"w-14 shrink-0 text-right",style:{color:"var(--text-muted)"},children:M.duration_ms!==null?`${(M.duration_ms/1e3).toFixed(1)}s`:"-"})]},M.name)}),n.results.length===0&&a.jsx("div",{className:"flex items-center justify-center py-8 text-[var(--text-muted)] text-xs",children:P?"Waiting for results...":"No results"})]})]}),a.jsx("div",{onMouseDown:T,onTouchStart:T,className:"shrink-0 drag-handle-row"}),a.jsx("div",{className:"flex-1 overflow-hidden",children:R&&S.length>0?a.jsx(Dr,{traces:S}):a.jsx("div",{className:"flex items-center justify-center h-full text-[var(--text-muted)] text-xs",children:(R==null?void 0:R.status)==="pending"?"Pending...":"No traces available"})})]}),a.jsx("div",{onMouseDown:j,onTouchStart:j,className:`shrink-0 drag-handle-col${h?"":" transition-all"}`,style:{width:R?3:0,opacity:R?1:0}}),a.jsx(Nu,{width:m,item:R,evaluators:w,isRunning:P,isDragging:h})]})}const _u=[{id:"score",label:"Score"},{id:"io",label:"I/O"},{id:"logs",label:"Logs"}];function Nu({width:e,item:t,evaluators:n,isRunning:r,isDragging:i}){const[s,o]=N.useState("score"),l=!!t;return a.jsxs("div",{className:`shrink-0 flex flex-col overflow-hidden${i?"":" transition-[width] duration-200 ease-in-out"}`,style:{width:l?e:0,background:"var(--bg-primary)"},children:[a.jsxs("div",{className:"flex items-center gap-1 px-2 h-10 border-b shrink-0",style:{borderColor:"var(--border)",background:"var(--bg-secondary)",minWidth:e},children:[_u.map(u=>a.jsx("button",{onClick:()=>o(u.id),className:"px-2.5 py-1 h-7 text-xs font-semibold rounded transition-colors cursor-pointer",style:{color:s===u.id?"var(--accent)":"var(--text-muted)",background:s===u.id?"color-mix(in srgb, var(--accent) 10%, transparent)":"transparent",border:"none"},onMouseEnter:c=>{s!==u.id&&(c.currentTarget.style.color="var(--text-primary)")},onMouseLeave:c=>{s!==u.id&&(c.currentTarget.style.color="var(--text-muted)")},children:u.label},u.id)),r&&a.jsx("span",{className:"ml-auto text-[11px] px-2 py-0.5 rounded-full shrink-0",style:{background:"color-mix(in srgb, var(--warning) 15%, var(--bg-secondary))",color:"var(--warning)"},children:"Running..."})]}),a.jsx("div",{className:"flex-1 overflow-y-auto",style:{minWidth:e},children:t?t.status==="pending"?a.jsx("div",{className:"flex items-center justify-center h-full text-[var(--text-muted)] text-xs",children:"Pending..."}):a.jsxs(a.Fragment,{children:[t.status==="failed"&&a.jsxs("div",{className:"mx-2 mt-2 px-3 py-2 rounded text-xs",style:{background:"rgba(239,68,68,0.1)",color:"var(--error)"},children:[a.jsxs("div",{className:"flex items-center gap-2 font-semibold",children:[a.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 16 16",fill:"none",children:[a.jsx("circle",{cx:"8",cy:"8",r:"7",stroke:"currentColor",strokeWidth:"1.5"}),a.jsx("path",{d:"M8 4.5v4",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"}),a.jsx("circle",{cx:"8",cy:"11",r:"0.75",fill:"currentColor"})]}),a.jsx("span",{children:"Evaluator error"})]}),t.error&&a.jsx("div",{className:"mt-1 pl-[22px] text-[11px] opacity-80 break-words",style:{color:"var(--text-secondary)"},children:t.error})]}),s==="score"?a.jsx(Su,{item:t,evaluators:n}):s==="io"?a.jsx(Tu,{item:t}):a.jsx("div",{className:"flex items-center justify-center h-full text-[var(--text-muted)] text-xs",children:"Logs coming soon"})]}):null})]})}function Su({item:e,evaluators:t}){const n=Object.keys(e.scores);return a.jsxs("div",{className:"p-2 overflow-y-auto h-full space-y-1.5",children:[a.jsx("div",{className:"overflow-hidden",style:{border:"1px solid var(--border)"},children:a.jsxs("div",{className:"px-3 py-2 flex items-center gap-2",style:{background:"var(--bg-secondary)"},children:[a.jsx("span",{className:"truncate text-[11px] font-semibold",style:{color:"var(--text-primary)"},children:"Overall"}),a.jsxs("div",{className:"ml-auto flex items-center gap-2",children:[a.jsx("div",{className:"w-24 h-2.5 rounded-full overflow-hidden",style:{background:"var(--bg-tertiary)"},children:a.jsx("div",{className:"h-full rounded-full",style:{width:`${e.overall_score*100}%`,background:wt(e.overall_score)}})}),a.jsx("span",{className:"text-xs font-mono font-bold shrink-0 w-10 text-right",style:{color:wt(e.overall_score)},children:en(e.overall_score)})]})]})}),e.status==="failed"&&n.length===0&&a.jsx("div",{className:"px-3 py-3 text-xs text-center",style:{color:"var(--text-muted)"},children:"All evaluators failed — no scores available"}),n.map(r=>{const i=t.find(l=>l.id===r),s=e.scores[r],o=e.justifications[r];return a.jsxs("div",{className:"overflow-hidden",style:{border:"1px solid var(--border)"},children:[a.jsxs("div",{className:"px-3 py-2 flex items-center gap-2",style:{background:"var(--bg-secondary)"},children:[a.jsx("span",{className:"truncate text-[11px] font-semibold",style:{color:"var(--text-primary)"},title:(i==null?void 0:i.name)??r,children:(i==null?void 0:i.name)??r}),a.jsxs("div",{className:"ml-auto flex items-center gap-2",children:[a.jsx("div",{className:"w-24 h-2.5 rounded-full overflow-hidden",style:{background:"var(--bg-tertiary)"},children:a.jsx("div",{className:"h-full rounded-full",style:{width:`${s*100}%`,background:wt(s)}})}),a.jsx("span",{className:"text-xs font-mono font-bold shrink-0 w-10 text-right",style:{color:wt(s)},children:en(s)})]})]}),o&&a.jsx(Au,{text:o})]},r)})]})}function Tu({item:e}){const t=JSON.stringify(e.inputs,null,2),n=typeof e.output=="string"?e.output:JSON.stringify(e.output,null,2),r=e.expected_output!=null?typeof e.expected_output=="string"?e.expected_output:JSON.stringify(e.expected_output,null,2):null;return a.jsxs("div",{className:"p-2 overflow-y-auto h-full space-y-1.5",children:[a.jsx(_t,{title:"Input",copyText:t,children:a.jsx(ot,{json:t,className:"px-3 py-2 text-xs font-mono whitespace-pre-wrap break-words"})}),r&&a.jsx(_t,{title:"Expected Output",copyText:r,children:a.jsx(ot,{json:r,className:"px-3 py-2 text-xs font-mono whitespace-pre-wrap break-words"})}),a.jsx(_t,{title:"Output",copyText:n,trailing:e.duration_ms!==null?a.jsxs("span",{className:"ml-auto text-[10px]",style:{color:"var(--text-muted)"},children:[(e.duration_ms/1e3).toFixed(2),"s"]}):void 0,children:a.jsx(ot,{json:n,className:"px-3 py-2 text-xs font-mono whitespace-pre-wrap break-words"})})]})}function Cu(e){var i;const t=e.match(/expected="(.+?)"\s+actual="(.+?)"(.*)/s);if(!t)return null;const n={},r=((i=t[3])==null?void 0:i.trim())??"";if(r)for(const s of r.match(/(\w+)=([\S]+)/g)??[]){const o=s.indexOf("=");n[s.slice(0,o)]=s.slice(o+1)}return{expected:t[1],actual:t[2],meta:n}}function ao(e){try{const t=e.replace(/'/g,'"').replace(/\bTrue\b/g,"true").replace(/\bFalse\b/g,"false").replace(/\bNone\b/g,"null"),n=JSON.parse(t);return JSON.stringify(n,null,2)}catch{return e}}function Au({text:e}){const t=Cu(e);if(!t)return a.jsx("div",{className:"px-3 py-2 border-t",style:{borderColor:"var(--border)"},children:a.jsx("div",{className:"text-xs leading-relaxed",style:{color:"var(--text-secondary)"},children:e})});const n=ao(t.expected),r=ao(t.actual),i=n===r;return a.jsxs("div",{className:"border-t",style:{borderColor:"var(--border)"},children:[a.jsxs("div",{className:"grid grid-cols-2 gap-0",children:[a.jsxs("div",{className:"px-3 py-2 border-r",style:{borderColor:"var(--border)"},children:[a.jsx("div",{className:"text-[10px] font-semibold mb-1",style:{color:"var(--text-muted)"},children:"Expected"}),a.jsx("pre",{className:"text-[11px] font-mono whitespace-pre-wrap break-words",style:{color:"var(--text-secondary)"},children:n})]}),a.jsxs("div",{className:"px-3 py-2",children:[a.jsxs("div",{className:"flex items-center gap-1.5 mb-1",children:[a.jsx("span",{className:"text-[10px] font-semibold",style:{color:"var(--text-muted)"},children:"Actual"}),a.jsx("span",{className:"w-1.5 h-1.5 rounded-full",style:{background:i?"var(--success)":"var(--error)"}})]}),a.jsx("pre",{className:"text-[11px] font-mono whitespace-pre-wrap break-words",style:{color:i?"var(--success)":"var(--error)"},children:r})]})]}),Object.keys(t.meta).length>0&&a.jsx("div",{className:"px-3 py-1.5 border-t flex items-center gap-3",style:{borderColor:"var(--border)"},children:Object.entries(t.meta).map(([s,o])=>a.jsxs("span",{className:"text-[10px]",style:{color:"var(--text-muted)"},children:[a.jsx("span",{className:"font-medium",children:s.replace(/_/g," ")})," ",a.jsx("span",{className:"font-mono",children:o})]},s))})]})}const lo={deterministic:"var(--success)",llm:"#a78bfa",tool:"var(--info)"};function co(){const e=Me(f=>f.localEvaluators),t=Me(f=>f.addEvalSet),{navigate:n}=st(),[r,i]=N.useState(""),[s,o]=N.useState(new Set),[l,u]=N.useState(null),[c,d]=N.useState(!1),p=f=>{o(h=>{const b=new Set(h);return b.has(f)?b.delete(f):b.add(f),b})},m=async()=>{if(r.trim()){u(null),d(!0);try{const f=await uc({name:r.trim(),evaluator_refs:Array.from(s)});t(f),n(`#/evals/sets/${f.id}`)}catch(f){u(f.detail||f.message||"Failed to create eval set")}finally{d(!1)}}};return a.jsx("div",{className:"flex items-center justify-center h-full",children:a.jsxs("div",{className:"w-full max-w-xl px-6",children:[a.jsxs("div",{className:"mb-8 text-center",children:[a.jsxs("div",{className:"flex items-center justify-center gap-2 mb-2",children:[a.jsx("div",{className:"w-1.5 h-1.5 rounded-full",style:{background:"var(--accent)"}}),a.jsx("span",{className:"text-sm font-semibold",style:{color:"var(--text-muted)"},children:"New Eval Set"})]}),a.jsx("p",{className:"text-sm",style:{color:"var(--text-muted)"},children:"Create an evaluation set with a name and evaluators"})]}),a.jsxs("div",{className:"mb-6",children:[a.jsx("label",{className:"block text-[11px] font-medium mb-1.5",style:{color:"var(--text-muted)"},children:"Name"}),a.jsx("input",{type:"text",value:r,onChange:f=>i(f.target.value),placeholder:"e.g. Basic QA Tests",className:"w-full rounded-md px-3 py-2 text-xs",style:{background:"var(--bg-secondary)",border:"1px solid var(--border)",color:"var(--text-primary)"},onKeyDown:f=>{f.key==="Enter"&&r.trim()&&m()}})]}),a.jsxs("div",{className:"mb-6",children:[a.jsx("label",{className:"block text-[11px] font-medium mb-1.5",style:{color:"var(--text-muted)"},children:"Evaluators"}),e.length===0?a.jsxs("p",{className:"text-xs",style:{color:"var(--text-muted)"},children:["No evaluators configured."," ",a.jsx("button",{onClick:()=>n("#/evaluators/new"),className:"underline cursor-pointer",style:{color:"var(--accent)",background:"none",border:"none",padding:0,font:"inherit"},children:"Create one first"})]}):a.jsx("div",{className:"rounded-md border overflow-hidden",style:{borderColor:"var(--border)",background:"var(--bg-secondary)"},children:e.map(f=>a.jsxs("label",{className:"flex items-center gap-2.5 px-3 py-2 text-xs cursor-pointer transition-colors",style:{borderBottom:"1px solid var(--border)"},onMouseEnter:h=>{h.currentTarget.style.background="var(--bg-hover)"},onMouseLeave:h=>{h.currentTarget.style.background="transparent"},children:[a.jsx("input",{type:"checkbox",checked:s.has(f.id),onChange:()=>p(f.id),className:"accent-[var(--accent)]"}),a.jsx("span",{className:"flex-1 truncate",style:{color:"var(--text-primary)"},children:f.name}),a.jsx("span",{className:"text-[11px] font-medium px-1.5 py-0.5 rounded",style:{background:`color-mix(in srgb, ${lo[f.type]??"var(--text-muted)"} 15%, transparent)`,color:lo[f.type]??"var(--text-muted)"},children:f.type})]},f.id))})]}),l&&a.jsx("p",{className:"text-xs mb-4 px-3 py-2 rounded",style:{color:"var(--error)",background:"color-mix(in srgb, var(--error) 10%, var(--bg-secondary))"},children:l}),a.jsx("button",{onClick:m,disabled:!r.trim()||c,className:"w-full py-2 rounded-md text-[13px] font-semibold transition-colors cursor-pointer disabled:opacity-40 disabled:cursor-not-allowed",style:{background:"var(--accent)",color:"var(--bg-primary)",border:"none"},children:c?"Creating...":"Create Eval Set"})]})})}const Mu=[{type:"deterministic",label:"Deterministic",badgeColor:"var(--success)"},{type:"llm",label:"LLM Judge",badgeColor:"#a78bfa"},{type:"tool",label:"Tool-Based",badgeColor:"var(--info)"}];function uo(){const e=Me(s=>s.localEvaluators),{evaluatorFilter:t,evaluatorCreateType:n,navigate:r}=st(),i=!t&&!n;return a.jsxs(a.Fragment,{children:[a.jsx("button",{onClick:()=>r("#/evaluators/new"),className:"mx-3 mt-2.5 mb-1 px-3 py-1.5 text-[11px] font-medium rounded border border-[var(--border)] bg-transparent transition-colors cursor-pointer",style:{color:"var(--text-secondary)"},onMouseEnter:s=>{s.currentTarget.style.color="var(--text-primary)",s.currentTarget.style.borderColor="var(--text-muted)"},onMouseLeave:s=>{s.currentTarget.style.color="var(--text-secondary)",s.currentTarget.style.borderColor=""},children:"+ New Evaluator"}),a.jsx("div",{className:"px-3 pt-3 pb-1 text-[11px] uppercase tracking-widest font-semibold",style:{color:"var(--text-muted)"},children:"Categories"}),a.jsxs("div",{className:"flex-1 overflow-y-auto",children:[a.jsxs("button",{onClick:()=>r("#/evaluators"),className:"w-full text-left px-3 py-2 text-xs flex items-center gap-2 cursor-pointer transition-colors",style:{background:i?"color-mix(in srgb, var(--accent) 15%, var(--bg-primary))":"transparent",color:i?"var(--text-primary)":"var(--text-secondary)",borderLeft:i?"3px solid var(--accent)":"3px solid transparent"},onMouseEnter:s=>{i||(s.currentTarget.style.background="var(--bg-hover)")},onMouseLeave:s=>{i||(s.currentTarget.style.background="transparent")},children:[a.jsx("div",{className:"w-2 h-2 rounded-full shrink-0",style:{background:"var(--text-muted)"}}),a.jsx("span",{className:"flex-1 truncate",children:"All"}),e.length>0&&a.jsx("span",{className:"text-[10px] px-1.5 rounded-full",style:{background:"var(--bg-tertiary)",color:"var(--text-muted)"},children:e.length})]}),Mu.map(s=>{const o=e.filter(u=>u.type===s.type).length,l=t===s.type;return a.jsxs("button",{onClick:()=>r(l?"#/evaluators":`#/evaluators/category/${s.type}`),className:"w-full text-left px-3 py-2 text-xs flex items-center gap-2 cursor-pointer transition-colors",style:{background:l?"color-mix(in srgb, var(--accent) 15%, var(--bg-primary))":"transparent",color:l?"var(--text-primary)":"var(--text-secondary)",borderLeft:l?"3px solid var(--accent)":"3px solid transparent"},onMouseEnter:u=>{l||(u.currentTarget.style.background="var(--bg-hover)")},onMouseLeave:u=>{l||(u.currentTarget.style.background="transparent")},children:[a.jsx("div",{className:"w-2 h-2 rounded-full shrink-0",style:{background:s.badgeColor}}),a.jsx("span",{className:"flex-1 truncate",children:s.label}),o>0&&a.jsx("span",{className:"text-[10px] px-1.5 rounded-full",style:{background:"var(--bg-tertiary)",color:"var(--text-muted)"},children:o})]},s.type)})]})]})}const po={deterministic:{label:"Deterministic",color:"var(--success)",bg:"rgba(34,197,94,0.1)"},llm:{label:"LLM Judge",color:"#a78bfa",bg:"rgba(167,139,250,0.1)"},tool:{label:"Tool-Based",color:"var(--info)",bg:"rgba(59,130,246,0.1)"}},Pr={deterministic:"Deterministic",llm:"LLM Judge",tool:"Tool-Based"},pn={deterministic:[{id:"uipath-exact-match",name:"Exact Match"},{id:"uipath-contains",name:"Contains"},{id:"uipath-json-similarity",name:"JSON Similarity"}],llm:[{id:"uipath-llm-judge-output-semantic-similarity",name:"LLM Judge Output"},{id:"uipath-llm-judge-output-strict-json-similarity",name:"LLM Judge Strict JSON"},{id:"uipath-llm-judge-trajectory-similarity",name:"LLM Judge Trajectory"},{id:"uipath-llm-judge-trajectory-simulation",name:"LLM Judge Trajectory Simulation"}],tool:[{id:"uipath-tool-call-order",name:"Tool Call Order"},{id:"uipath-tool-call-args",name:"Tool Call Args"},{id:"uipath-tool-call-count",name:"Tool Call Count"},{id:"uipath-tool-call-output",name:"Tool Call Output"}]};function Ls(e){return e.includes("trajectory")?{targetOutputKey:!1,prompt:!0}:e.includes("llm-judge")?{targetOutputKey:!0,prompt:!0}:e.includes("tool-call-output")?{targetOutputKey:!0,prompt:!1}:e.includes("exact-match")||e.includes("contains")||e.includes("json-similarity")?{targetOutputKey:!0,prompt:!1}:{targetOutputKey:!1,prompt:!1}}const fr={"uipath-exact-match":{description:"Checks whether the agent output exactly matches the expected output.",prompt:""},"uipath-contains":{description:"Checks whether the agent output contains the expected substring.",prompt:""},"uipath-json-similarity":{description:"Compares JSON structures for semantic similarity, ignoring key ordering and whitespace.",prompt:""},"uipath-llm-judge-output-semantic-similarity":{description:"Uses an LLM to score semantic similarity between the agent's actual output and the expected output, accounting for synonyms, paraphrases, and equivalent expressions.",prompt:`As an expert evaluator, analyze the semantic similarity between the expected and actual outputs and determine a score from 0 to 100. Focus on comparing meaning and contextual equivalence of corresponding fields, accounting for alternative valid expressions, synonyms, and reasonable variations in language while maintaining high standards for accuracy and completeness. Provide your score with a brief justification. ---- ExpectedOutput: {{ExpectedOutput}} @@ -71,7 +71,7 @@ AgentRunHistory: {{AgentRunHistory}}`},"uipath-tool-call-order":{description:"Validates that the agent called tools in the expected sequence.",prompt:""},"uipath-tool-call-args":{description:"Checks whether the agent called tools with the expected arguments.",prompt:""},"uipath-tool-call-count":{description:"Validates that the agent made the expected number of tool calls.",prompt:""},"uipath-tool-call-output":{description:"Validates the output returned by the agent's tool calls.",prompt:""}};function Iu(e){for(const[t,n]of Object.entries(pn))if(n.some(r=>r.id===e))return t;return"deterministic"}function Ru({evaluatorId:e,evaluatorFilter:t}){const n=Me(w=>w.localEvaluators),r=Me(w=>w.setLocalEvaluators),i=Me(w=>w.upsertLocalEvaluator),s=Me(w=>w.evaluators),{navigate:o}=st(),l=e?n.find(w=>w.id===e)??null:null,u=!!l,c=t?n.filter(w=>w.type===t):n,[d,p]=N.useState(()=>{const w=localStorage.getItem("evaluatorSidebarWidth");return w?parseInt(w,10):320}),[m,f]=N.useState(!1),h=N.useRef(null);N.useEffect(()=>{localStorage.setItem("evaluatorSidebarWidth",String(d))},[d]),N.useEffect(()=>{Qr().then(r).catch(console.error)},[r]);const b=N.useCallback(w=>{w.preventDefault(),f(!0);const T="touches"in w?w.touches[0].clientX:w.clientX,j=d,O=P=>{const D=h.current;if(!D)return;const R="touches"in P?P.touches[0].clientX:P.clientX,S=D.clientWidth-300,M=Math.max(280,Math.min(S,j+(T-R)));p(M)},_=()=>{f(!1),document.removeEventListener("mousemove",O),document.removeEventListener("mouseup",_),document.removeEventListener("touchmove",O),document.removeEventListener("touchend",_),document.body.style.cursor="",document.body.style.userSelect=""};document.body.style.cursor="col-resize",document.body.style.userSelect="none",document.addEventListener("mousemove",O),document.addEventListener("mouseup",_),document.addEventListener("touchmove",O,{passive:!1}),document.addEventListener("touchend",_)},[d]),x=w=>{i(w)},y=()=>{o("#/evaluators")};return a.jsxs("div",{ref:h,className:"flex h-full",children:[a.jsxs("div",{className:"flex flex-col flex-1 min-w-0",children:[a.jsxs("div",{className:"px-4 h-10 border-b shrink-0 flex items-center gap-4",style:{borderColor:"var(--border)"},children:[a.jsx("h1",{className:"text-base font-semibold",style:{color:"var(--text-primary)"},children:"Evaluators"}),a.jsxs("span",{className:"text-[11px]",style:{color:"var(--text-muted)"},children:[c.length,t?` / ${n.length}`:""," configured"]})]}),a.jsx("div",{className:"flex-1 overflow-y-auto p-4",children:c.length===0?a.jsx("div",{className:"flex items-center justify-center h-full text-[var(--text-muted)] text-xs",children:n.length===0?"No evaluators configured yet.":"No evaluators in this category."}):a.jsx("div",{className:"grid gap-3",style:{gridTemplateColumns:"repeat(auto-fill, minmax(320px, 1fr))"},children:c.map(w=>a.jsx(Ou,{evaluator:w,evaluators:s,selected:w.id===e,onClick:()=>o(w.id===e?"#/evaluators":`#/evaluators/${encodeURIComponent(w.id)}`)},w.id))})})]}),a.jsx("div",{onMouseDown:b,onTouchStart:b,className:`shrink-0 drag-handle-col${m?"":" transition-all"}`,style:{width:u?3:0,opacity:u?1:0}}),a.jsxs("div",{className:`shrink-0 flex flex-col overflow-hidden${m?"":" transition-[width] duration-200 ease-in-out"}`,style:{width:u?d:0,background:"var(--bg-primary)"},children:[a.jsxs("div",{className:"flex items-center gap-1 px-2 h-10 border-b shrink-0",style:{borderColor:"var(--border)",background:"var(--bg-secondary)",minWidth:d},children:[a.jsx("span",{className:"px-2 py-0.5 h-7 text-xs font-semibold rounded inline-flex items-center",style:{color:"var(--accent)",background:"color-mix(in srgb, var(--accent) 10%, transparent)"},children:"Edit Evaluator"}),a.jsx("button",{onClick:y,"aria-label":"Close editor",className:"ml-auto w-7 h-7 flex items-center justify-center rounded cursor-pointer transition-colors",style:{color:"var(--text-muted)",background:"transparent",border:"none"},onMouseEnter:w=>{w.currentTarget.style.color="var(--text-primary)"},onMouseLeave:w=>{w.currentTarget.style.color="var(--text-muted)"},children:a.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",children:[a.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),a.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})]}),a.jsx("div",{className:"flex-1 overflow-hidden",style:{minWidth:d},children:l&&a.jsx(Lu,{evaluator:l,onUpdated:x})})]})]})}function Ou({evaluator:e,evaluators:t,selected:n,onClick:r}){const i=po[e.type]??po.deterministic,s=t.find(l=>l.id===e.evaluator_type_id),o=e.evaluator_type_id.startsWith("file://");return a.jsxs("div",{className:"rounded-md p-4 flex flex-col cursor-pointer transition-colors",style:{border:n?"1px solid var(--accent)":"1px solid var(--border)",background:n?"color-mix(in srgb, var(--accent) 5%, var(--card-bg))":"var(--card-bg)"},onClick:r,onMouseEnter:l=>{n||(l.currentTarget.style.borderColor="var(--text-muted)")},onMouseLeave:l=>{n||(l.currentTarget.style.borderColor="var(--border)")},children:[a.jsx("div",{className:"text-sm font-semibold",style:{color:"var(--text-primary)"},children:e.name}),e.description&&a.jsx("div",{className:"text-xs leading-relaxed mt-2",style:{color:"var(--text-secondary)"},children:e.description}),a.jsxs("div",{className:"flex flex-wrap gap-1.5 mt-auto pt-3",children:[a.jsxs("span",{className:"px-2 py-0.5 rounded text-[10px] font-medium",style:{color:i.color,background:i.bg},children:["Category: ",i.label]}),a.jsxs("span",{className:"px-2 py-0.5 rounded text-[10px] font-medium",style:{background:"var(--bg-tertiary)",color:"var(--text-secondary)"},children:["Type: ",o?"Custom":(s==null?void 0:s.name)??e.evaluator_type_id]}),a.jsxs("span",{className:"px-2 py-0.5 rounded text-[10px] font-medium font-mono",style:{background:"var(--bg-tertiary)",color:"var(--text-secondary)"},children:["Target: ",e.target_output_key||"*"]})]})]})}function Lu({evaluator:e,onUpdated:t}){var O,_;const n=Iu(e.evaluator_type_id),r=pn[n]??[],[i,s]=N.useState(e.description),[o,l]=N.useState(e.evaluator_type_id),[u,c]=N.useState(((O=e.config)==null?void 0:O.targetOutputKey)??"*"),[d,p]=N.useState(((_=e.config)==null?void 0:_.prompt)??""),[m,f]=N.useState(!1),[h,b]=N.useState(null),[x,y]=N.useState(!1);N.useEffect(()=>{var P,D;s(e.description),l(e.evaluator_type_id),c(((P=e.config)==null?void 0:P.targetOutputKey)??"*"),p(((D=e.config)==null?void 0:D.prompt)??""),b(null),y(!1)},[e.id]);const w=Ls(o),T=async()=>{f(!0),b(null),y(!1);try{const P={};w.targetOutputKey&&(P.targetOutputKey=u),w.prompt&&d.trim()&&(P.prompt=d);const D=await xc(e.id,{description:i.trim(),evaluator_type_id:o,config:P});t(D),y(!0),setTimeout(()=>y(!1),2e3)}catch(P){const D=P==null?void 0:P.detail;b(D??"Failed to update evaluator")}finally{f(!1)}},j={background:"var(--bg-secondary)",color:"var(--text-primary)",border:"1px solid var(--border)"};return a.jsxs("div",{className:"flex flex-col h-full",children:[a.jsxs("div",{className:"p-4 overflow-y-auto flex-1 space-y-4",children:[a.jsxs("div",{children:[a.jsx("label",{className:"text-[11px] font-medium block mb-1",style:{color:"var(--text-muted)"},children:"Name"}),a.jsx("div",{className:"px-3 py-2 rounded-lg text-xs",style:{background:"var(--bg-tertiary)",color:"var(--text-secondary)"},children:e.name})]}),a.jsxs("div",{children:[a.jsx("label",{className:"text-[11px] font-medium block mb-1",style:{color:"var(--text-muted)"},children:"Category"}),a.jsx("div",{className:"px-3 py-2 rounded-lg text-xs",style:{background:"var(--bg-tertiary)",color:"var(--text-secondary)"},children:Pr[n]??n})]}),a.jsxs("div",{children:[a.jsx("label",{className:"text-[11px] font-medium block mb-1",style:{color:"var(--text-muted)"},children:"Type"}),a.jsx("select",{value:o,onChange:P=>l(P.target.value),className:"w-full px-3 py-2 rounded-lg text-xs outline-none cursor-pointer",style:j,children:r.map(P=>a.jsx("option",{value:P.id,children:P.name},P.id))})]}),a.jsxs("div",{children:[a.jsx("label",{className:"text-[11px] font-medium block mb-1",style:{color:"var(--text-muted)"},children:"Description"}),a.jsx("textarea",{value:i,onChange:P=>s(P.target.value),placeholder:"What does this evaluator check?",rows:4,className:"w-full px-3 py-2 rounded-lg text-xs leading-relaxed outline-none resize-y",style:j})]}),w.targetOutputKey&&a.jsxs("div",{children:[a.jsx("label",{className:"text-[11px] font-medium block mb-1",style:{color:"var(--text-muted)"},children:"Target Output Key"}),a.jsx("input",{type:"text",value:u,onChange:P=>c(P.target.value),placeholder:"*",className:"w-full px-3 py-2 rounded-lg text-xs outline-none",style:j}),a.jsx("div",{className:"text-[11px] mt-0.5",style:{color:"var(--text-muted)"},children:"Use * for entire output or a specific key name"})]}),w.prompt&&a.jsxs("div",{children:[a.jsx("label",{className:"text-[11px] font-medium block mb-1",style:{color:"var(--text-muted)"},children:"Prompt"}),a.jsx("textarea",{value:d,onChange:P=>p(P.target.value),placeholder:"Evaluation prompt for the LLM judge...",rows:8,className:"w-full px-3 py-2 rounded-lg text-xs font-mono leading-relaxed outline-none resize-y",style:j})]})]}),a.jsxs("div",{className:"shrink-0 p-4 space-y-2",children:[h&&a.jsx("div",{className:"text-xs px-3 py-2 rounded-lg",style:{background:"rgba(239,68,68,0.1)",color:"var(--error)"},children:h}),x&&a.jsx("div",{className:"text-xs px-3 py-2 rounded-lg",style:{background:"rgba(34,197,94,0.1)",color:"var(--success)"},children:"Saved successfully"}),a.jsx("button",{onClick:T,disabled:m,className:"w-full py-2.5 text-xs font-semibold rounded-md border cursor-pointer disabled:opacity-30 disabled:cursor-not-allowed transition-colors",style:{background:"transparent",borderColor:"var(--accent)",color:"var(--accent)"},onMouseEnter:P=>{P.currentTarget.style.background="color-mix(in srgb, var(--accent) 15%, transparent)"},onMouseLeave:P=>{P.currentTarget.style.background="transparent"},children:m?"Saving...":"Save Changes"})]})]})}const ju=["deterministic","llm","tool"];function Du({category:e}){var v;const t=Me(E=>E.addLocalEvaluator),{navigate:n}=st(),r=e!=="any",[i,s]=N.useState(r?e:"deterministic"),o=pn[i]??[],[l,u]=N.useState(""),[c,d]=N.useState(""),[p,m]=N.useState(((v=o[0])==null?void 0:v.id)??""),[f,h]=N.useState("*"),[b,x]=N.useState(""),[y,w]=N.useState(!1),[T,j]=N.useState(null),[O,_]=N.useState(!1),[P,D]=N.useState(!1);N.useEffect(()=>{var V;const E=r?e:"deterministic";s(E);const H=((V=(pn[E]??[])[0])==null?void 0:V.id)??"",U=fr[H];u(""),d((U==null?void 0:U.description)??""),m(H),h("*"),x((U==null?void 0:U.prompt)??""),j(null),_(!1),D(!1)},[e,r]);const R=E=>{var V;s(E);const H=((V=(pn[E]??[])[0])==null?void 0:V.id)??"",U=fr[H];m(H),O||d((U==null?void 0:U.description)??""),P||x((U==null?void 0:U.prompt)??"")},S=E=>{m(E);const I=fr[E];I&&(O||d(I.description),P||x(I.prompt))},M=Ls(p),L=async()=>{if(!l.trim()){j("Name is required");return}w(!0),j(null);try{const E={};M.targetOutputKey&&(E.targetOutputKey=f),M.prompt&&b.trim()&&(E.prompt=b);const I=await hc({name:l.trim(),description:c.trim(),evaluator_type_id:p,config:E});t(I),n("#/evaluators")}catch(E){const I=E==null?void 0:E.detail;j(I??"Failed to create evaluator")}finally{w(!1)}},C={background:"var(--bg-secondary)",border:"1px solid var(--border)",color:"var(--text-primary)"};return a.jsx("div",{className:"h-full overflow-y-auto",children:a.jsx("div",{className:"flex items-center justify-center min-h-full py-8",children:a.jsxs("div",{className:"w-full max-w-xl px-6",children:[a.jsxs("div",{className:"mb-8 text-center",children:[a.jsxs("div",{className:"flex items-center justify-center gap-2 mb-2",children:[a.jsx("div",{className:"w-1.5 h-1.5 rounded-full",style:{background:"var(--accent)"}}),a.jsx("span",{className:"text-sm font-semibold",style:{color:"var(--text-muted)"},children:"New Evaluator"})]}),a.jsx("p",{className:"text-sm",style:{color:"var(--text-muted)"},children:"Create an evaluator to score agent outputs"})]}),a.jsxs("div",{className:"mb-6",children:[a.jsx("label",{className:"block text-[11px] font-medium mb-1.5",style:{color:"var(--text-muted)"},children:"Name"}),a.jsx("input",{type:"text",value:l,onChange:E=>u(E.target.value),placeholder:"e.g. MyEvaluator",className:"w-full rounded-md px-3 py-2 text-xs",style:C,onKeyDown:E=>{E.key==="Enter"&&l.trim()&&L()}})]}),a.jsxs("div",{className:"mb-6",children:[a.jsx("label",{className:"block text-[11px] font-medium mb-1.5",style:{color:"var(--text-muted)"},children:"Category"}),r?a.jsx("div",{className:"px-3 py-2 rounded-md text-xs",style:{background:"var(--bg-tertiary)",color:"var(--text-secondary)"},children:Pr[i]??i}):a.jsx("select",{value:i,onChange:E=>R(E.target.value),className:"w-full rounded-md px-3 py-2 text-xs cursor-pointer appearance-auto",style:C,children:ju.map(E=>a.jsx("option",{value:E,children:Pr[E]},E))})]}),a.jsxs("div",{className:"mb-6",children:[a.jsx("label",{className:"block text-[11px] font-medium mb-1.5",style:{color:"var(--text-muted)"},children:"Type"}),a.jsx("select",{value:p,onChange:E=>S(E.target.value),className:"w-full rounded-md px-3 py-2 text-xs cursor-pointer appearance-auto",style:C,children:o.map(E=>a.jsx("option",{value:E.id,children:E.name},E.id))})]}),a.jsxs("div",{className:"mb-6",children:[a.jsx("label",{className:"block text-[11px] font-medium mb-1.5",style:{color:"var(--text-muted)"},children:"Description"}),a.jsx("textarea",{value:c,onChange:E=>{d(E.target.value),_(!0)},placeholder:"What does this evaluator check?",rows:3,className:"w-full rounded-md px-3 py-2 text-xs leading-relaxed resize-y",style:C})]}),M.targetOutputKey&&a.jsxs("div",{className:"mb-6",children:[a.jsx("label",{className:"block text-[11px] font-medium mb-1.5",style:{color:"var(--text-muted)"},children:"Target Output Key"}),a.jsx("input",{type:"text",value:f,onChange:E=>h(E.target.value),placeholder:"*",className:"w-full rounded-md px-3 py-2 text-xs",style:C}),a.jsx("div",{className:"text-xs mt-1",style:{color:"var(--text-muted)"},children:"Use * for entire output or a specific key name"})]}),M.prompt&&a.jsxs("div",{className:"mb-6",children:[a.jsx("label",{className:"block text-[11px] font-medium mb-1.5",style:{color:"var(--text-muted)"},children:"Prompt"}),a.jsx("textarea",{value:b,onChange:E=>{x(E.target.value),D(!0)},placeholder:"Evaluation prompt for the LLM judge...",rows:6,className:"w-full rounded-md px-3 py-2 text-xs font-mono leading-relaxed resize-y",style:C})]}),T&&a.jsx("p",{className:"text-xs mb-4 px-3 py-2 rounded",style:{color:"var(--error)",background:"color-mix(in srgb, var(--error) 10%, var(--bg-secondary))"},children:T}),a.jsx("button",{onClick:L,disabled:y||!l.trim(),className:"w-full py-2 rounded-md text-[13px] font-semibold transition-colors cursor-pointer disabled:opacity-40 disabled:cursor-not-allowed",style:{background:"var(--accent)",color:"var(--bg-primary)",border:"none"},children:y?"Creating...":"Create Evaluator"})]})})})}function js({path:e,name:t,type:n,depth:r}){const i=be(w=>w.children[e]),s=be(w=>!!w.expanded[e]),o=be(w=>!!w.loadingDirs[e]),l=be(w=>!!w.dirty[e]),u=be(w=>!!w.agentChangedFiles[e]),c=be(w=>w.selectedFile),{setChildren:d,toggleExpanded:p,setLoadingDir:m,openTab:f}=be(),{navigate:h}=st(),b=n==="directory",x=!b&&c===e,y=N.useCallback(()=>{b?(!i&&!o&&(m(e,!0),$n(e).then(w=>d(e,w)).catch(console.error).finally(()=>m(e,!1))),p(e)):(f(e),h(`#/explorer/file/${encodeURIComponent(e)}`))},[b,i,o,e,d,p,m,f,h]);return a.jsxs(a.Fragment,{children:[a.jsxs("button",{onClick:y,className:`w-full text-left flex items-center gap-1 py-[3px] text-[13px] cursor-pointer transition-colors group${u?" agent-changed-file":""}`,style:{paddingLeft:`${12+r*16}px`,paddingRight:"8px",background:x?"color-mix(in srgb, var(--accent) 15%, var(--bg-primary))":"transparent",color:x?"var(--text-primary)":"var(--text-secondary)",border:"none"},onMouseEnter:w=>{x||(w.currentTarget.style.background="var(--bg-hover)")},onMouseLeave:w=>{x||(w.currentTarget.style.background="transparent")},children:[a.jsx("span",{className:"w-3 shrink-0 flex items-center justify-center",style:{color:"var(--text-muted)"},children:b&&a.jsx("svg",{width:"10",height:"10",viewBox:"0 0 10 10",fill:"currentColor",style:{transform:s?"rotate(90deg)":"rotate(0deg)",transition:"transform 0.15s"},children:a.jsx("path",{d:"M3 1.5L7 5L3 8.5z"})})}),a.jsx("span",{className:"shrink-0",style:{color:b?"var(--accent)":"var(--text-muted)"},children:b?a.jsx("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",children:a.jsx("path",{d:"M22 19a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h5l2 3h9a2 2 0 0 1 2 2z"})}):a.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",children:[a.jsx("path",{d:"M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"}),a.jsx("polyline",{points:"14 2 14 8 20 8"})]})}),a.jsx("span",{className:"truncate flex-1",children:t}),l&&a.jsx("span",{className:"w-2 h-2 rounded-full shrink-0",style:{background:"var(--accent)"}}),o&&a.jsx("span",{className:"text-[10px] shrink-0",style:{color:"var(--text-muted)"},children:"..."})]}),b&&s&&i&&i.map(w=>a.jsx(js,{path:w.path,name:w.name,type:w.type,depth:r+1},w.path))]})}function fo(){const e=be(n=>n.children[""]),{setChildren:t}=be();return N.useEffect(()=>{e||$n("").then(n=>t("",n)).catch(console.error)},[e,t]),a.jsx("div",{className:"flex-1 overflow-y-auto py-1",children:e?e.map(n=>a.jsx(js,{path:n.path,name:n.name,type:n.type,depth:0},n.path)):a.jsx("p",{className:"text-[11px] px-3 py-2",style:{color:"var(--text-muted)"},children:"Loading..."})})}const mo=e=>{e.editor.defineTheme("uipath-dark",{base:"vs-dark",inherit:!0,rules:[{token:"comment",foreground:"64748b",fontStyle:"italic"},{token:"keyword",foreground:"c084fc"},{token:"string",foreground:"86efac"},{token:"number",foreground:"fcd34d"},{token:"type",foreground:"7dd3fc"}],colors:{"editor.background":"#0f172a","editor.foreground":"#cbd5e1","editor.lineHighlightBackground":"#1e293b","editor.selectionBackground":"#334155","editor.inactiveSelectionBackground":"#263348","editorLineNumber.foreground":"#64748b","editorLineNumber.activeForeground":"#94a3b8","editorCursor.foreground":"#fa4616","editorIndentGuide.background":"#334155","editorIndentGuide.activeBackground":"#64748b","editorWidget.background":"#1e293b","editorWidget.border":"#334155","editorSuggestWidget.background":"#1e293b","editorSuggestWidget.border":"#334155","editorSuggestWidget.selectedBackground":"#263348","editorHoverWidget.background":"#1e293b","editorHoverWidget.border":"#334155","scrollbarSlider.background":"#33415580","scrollbarSlider.hoverBackground":"#33415599","scrollbarSlider.activeBackground":"#334155cc"}}),e.editor.defineTheme("uipath-light",{base:"vs",inherit:!0,rules:[{token:"comment",foreground:"94a3b8",fontStyle:"italic"},{token:"keyword",foreground:"7c3aed"},{token:"string",foreground:"16a34a"},{token:"number",foreground:"d97706"},{token:"type",foreground:"0284c7"}],colors:{"editor.background":"#f8fafc","editor.foreground":"#0f172a","editor.lineHighlightBackground":"#f1f5f9","editor.selectionBackground":"#e2e8f0","editor.inactiveSelectionBackground":"#f1f5f9","editorLineNumber.foreground":"#94a3b8","editorLineNumber.activeForeground":"#475569","editorCursor.foreground":"#fa4616","editorIndentGuide.background":"#e2e8f0","editorIndentGuide.activeBackground":"#94a3b8","editorWidget.background":"#ffffff","editorWidget.border":"#e2e8f0","editorSuggestWidget.background":"#ffffff","editorSuggestWidget.border":"#e2e8f0","editorSuggestWidget.selectedBackground":"#f1f5f9","editorHoverWidget.background":"#ffffff","editorHoverWidget.border":"#e2e8f0","scrollbarSlider.background":"#d1d5db80","scrollbarSlider.hoverBackground":"#d1d5db99","scrollbarSlider.activeBackground":"#d1d5dbcc"}})};function go(e){return e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(1)} KB`:`${(e/(1024*1024)).toFixed(1)} MB`}function Pu(e){const t=e.replace(/\\/g,"/").split("/");return t[t.length-1]||e}function Bu(){const e=be(C=>C.openTabs),n=be(C=>C.selectedFile),r=be(C=>n?C.fileCache[n]:void 0),i=be(C=>n?!!C.dirty[n]:!1),s=be(C=>n?C.buffers[n]:void 0),o=be(C=>C.loadingFile),l=be(C=>C.dirty),u=be(C=>C.diffView),c=be(C=>n?!!C.agentChangedFiles[n]:!1),{setFileContent:d,updateBuffer:p,markClean:m,setLoadingFile:f,openTab:h,closeTab:b,setDiffView:x}=be(),{navigate:y}=st(),w=Ss(C=>C.theme),T=N.useRef(null),{explorerFile:j}=st();N.useEffect(()=>{j&&h(j)},[j,h]),N.useEffect(()=>{n&&(be.getState().fileCache[n]||(f(!0),Lr(n).then(C=>d(n,C)).catch(console.error).finally(()=>f(!1))))},[n,d,f]);const O=N.useCallback(()=>{if(!n)return;const C=be.getState().fileCache[n],E=be.getState().buffers[n]??(C==null?void 0:C.content);E!=null&&Xl(n,E).then(()=>{m(n),d(n,{...C,content:E})}).catch(console.error)},[n,m,d]);N.useEffect(()=>{const C=v=>{(v.ctrlKey||v.metaKey)&&v.key==="s"&&(v.preventDefault(),O())};return window.addEventListener("keydown",C),()=>window.removeEventListener("keydown",C)},[O]);const _=C=>{T.current=C},P=N.useCallback(C=>{C!==void 0&&n&&p(n,C)},[n,p]),D=N.useCallback(C=>{h(C),y(`#/explorer/file/${encodeURIComponent(C)}`)},[h,y]),R=N.useCallback((C,v)=>{C.stopPropagation();const E=be.getState(),I=E.openTabs.filter(H=>H!==v);if(b(v),E.selectedFile===v){const H=E.openTabs.indexOf(v),U=I[Math.min(H,I.length-1)];y(U?`#/explorer/file/${encodeURIComponent(U)}`:"#/explorer")}},[b,y]),S=N.useCallback((C,v)=>{C.button===1&&R(C,v)},[R]),M=e.length>0&&a.jsx("div",{className:"h-10 flex items-end overflow-x-auto shrink-0",style:{background:"var(--bg-secondary)",borderBottom:"1px solid var(--border)"},children:e.map(C=>{const v=C===n,E=!!l[C];return a.jsxs("button",{onClick:()=>D(C),onMouseDown:I=>S(I,C),className:"h-full flex items-center gap-1.5 px-3 text-[12px] shrink-0 cursor-pointer transition-colors relative",style:{background:v?"var(--bg-primary)":"transparent",color:v?"var(--text-primary)":"var(--text-secondary)",border:"none",borderBottom:v?"2px solid var(--accent)":"2px solid transparent",maxWidth:"180px"},onMouseEnter:I=>{v||(I.currentTarget.style.background="var(--bg-hover)")},onMouseLeave:I=>{v||(I.currentTarget.style.background="transparent")},children:[a.jsx("span",{className:"truncate",children:Pu(C)}),E?a.jsx("span",{className:"w-2 h-2 rounded-full shrink-0",style:{background:"var(--accent)"},title:"Unsaved changes"}):a.jsx("span",{className:"w-4 h-4 flex items-center justify-center rounded shrink-0 transition-colors",style:{color:"var(--text-muted)"},onClick:I=>R(I,C),onMouseEnter:I=>{I.currentTarget.style.background="var(--bg-hover)",I.currentTarget.style.color="var(--text-primary)"},onMouseLeave:I=>{I.currentTarget.style.background="transparent",I.currentTarget.style.color="var(--text-muted)"},children:a.jsx("svg",{width:"10",height:"10",viewBox:"0 0 16 16",fill:"currentColor",children:a.jsx("path",{d:"M8 8.707l3.646 3.647.708-.707L8.707 8l3.647-3.646-.707-.708L8 7.293 4.354 3.646l-.708.708L7.293 8l-3.647 3.646.708.708L8 8.707z"})})})]},C)})});if(!n)return a.jsxs("div",{className:"flex flex-col h-full",children:[M,a.jsx("div",{className:"flex-1 flex items-center justify-center",style:{color:"var(--text-muted)"},children:"Select a file to view"})]});if(o&&!r)return a.jsxs("div",{className:"flex flex-col h-full",children:[M,a.jsx("div",{className:"flex-1 flex items-center justify-center",style:{color:"var(--text-muted)"},children:a.jsx("div",{className:"text-sm",children:"Loading file..."})})]});if(!r&&!o)return a.jsxs("div",{className:"flex flex-col h-full",children:[M,a.jsx("div",{className:"flex-1 flex items-center justify-center",style:{color:"var(--text-muted)"},children:a.jsx("div",{className:"text-sm",children:"Failed to load file"})})]});if(!r)return null;if(r.binary)return a.jsxs("div",{className:"flex flex-col h-full",children:[M,a.jsx("div",{className:"h-8 flex items-center px-3 gap-2 text-xs shrink-0 border-b",style:{borderColor:"var(--border)",background:"var(--bg-secondary)"},children:a.jsx("span",{style:{color:"var(--text-muted)"},children:go(r.size)})}),a.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center gap-3",style:{color:"var(--text-muted)"},children:[a.jsxs("svg",{width:"48",height:"48",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1",strokeLinecap:"round",strokeLinejoin:"round",children:[a.jsx("path",{d:"M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"}),a.jsx("polyline",{points:"14 2 14 8 20 8"}),a.jsx("line",{x1:"9",y1:"15",x2:"15",y2:"15"})]}),a.jsx("span",{className:"text-sm",children:"Binary file — preview not available"})]})]});const L=u&&u.path===n;return a.jsxs("div",{className:"flex flex-col h-full",children:[M,a.jsxs("div",{className:"h-8 flex items-center px-3 gap-2 text-xs shrink-0 border-b",style:{borderColor:"var(--border)",background:"var(--bg-secondary)"},children:[r.language&&a.jsx("span",{className:"px-1.5 py-0.5 rounded text-[10px]",style:{background:"var(--bg-hover)",color:"var(--text-muted)"},children:r.language}),a.jsx("span",{style:{color:"var(--text-muted)"},children:go(r.size)}),c&&a.jsx("span",{className:"px-1.5 py-0.5 rounded text-[10px] font-medium",style:{background:"color-mix(in srgb, var(--info) 20%, transparent)",color:"var(--info)"},children:"Agent modified"}),a.jsx("div",{className:"flex-1"}),i&&a.jsx("span",{className:"text-[10px] font-medium",style:{color:"var(--accent)"},children:"Modified"}),a.jsx("button",{onClick:O,className:"px-2 py-0.5 rounded text-[11px] font-medium cursor-pointer transition-colors",style:{background:i?"var(--accent)":"var(--bg-hover)",color:i?"white":"var(--text-muted)",border:"none"},children:"Save"})]}),L&&a.jsxs("div",{className:"h-8 flex items-center px-3 gap-2 text-xs shrink-0 border-b",style:{borderColor:"var(--border)",background:"color-mix(in srgb, var(--info) 10%, var(--bg-secondary))"},children:[a.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"var(--info)",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[a.jsx("circle",{cx:"12",cy:"12",r:"10"}),a.jsx("line",{x1:"12",y1:"16",x2:"12",y2:"12"}),a.jsx("line",{x1:"12",y1:"8",x2:"12.01",y2:"8"})]}),a.jsx("span",{style:{color:"var(--info)"},children:"Agent modified this file"}),a.jsx("div",{className:"flex-1"}),a.jsx("button",{onClick:()=>x(null),className:"px-2 py-0.5 rounded text-[11px] font-medium cursor-pointer transition-colors",style:{background:"var(--bg-hover)",color:"var(--text-secondary)",border:"none"},children:"Dismiss"})]}),a.jsx("div",{className:"flex-1 overflow-hidden",children:L?a.jsx(Cl,{original:u.original,modified:u.modified,language:u.language??"plaintext",theme:w==="dark"?"uipath-dark":"uipath-light",beforeMount:mo,options:{readOnly:!0,minimap:{enabled:!1},fontSize:13,lineNumbersMinChars:4,scrollBeyondLastLine:!1,automaticLayout:!0,renderSideBySide:!0}},`diff-${n}`):a.jsx(Al,{language:r.language??"plaintext",theme:w==="dark"?"uipath-dark":"uipath-light",value:s??r.content??"",onChange:P,beforeMount:mo,onMount:_,options:{minimap:{enabled:!1},fontSize:13,lineNumbersMinChars:4,scrollBeyondLastLine:!1,wordWrap:"on",automaticLayout:!0,tabSize:2,renderWhitespace:"selection"}},n)})]})}const Zn="/api";async function Fu(){const e=await fetch(`${Zn}/agent/models`);if(!e.ok){if(e.status===401)return[];throw new Error(`HTTP ${e.status}`)}return e.json()}async function zu(e){const t=await fetch(`${Zn}/agent/session/${e}/diagnostics`);if(!t.ok)throw new Error(`HTTP ${t.status}`);return t.json()}async function $u(e){const t=await fetch(`${Zn}/agent/session/${e}/state`);if(t.status===404)return null;if(!t.ok)throw new Error(`HTTP ${t.status}`);return t.json()}async function Uu(){const e=await fetch(`${Zn}/agent/skills`);if(!e.ok)throw new Error(`HTTP ${e.status}`);return e.json()}function Hu(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const Wu=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Ku=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Gu={};function ho(e,t){return(Gu.jsx?Ku:Wu).test(e)}const qu=/[ \t\n\f\r]/g;function Vu(e){return typeof e=="object"?e.type==="text"?bo(e.value):!1:bo(e)}function bo(e){return e.replace(qu,"")===""}class xn{constructor(t,n,r){this.normal=n,this.property=t,r&&(this.space=r)}}xn.prototype.normal={};xn.prototype.property={};xn.prototype.space=void 0;function Ds(e,t){const n={},r={};for(const i of e)Object.assign(n,i.property),Object.assign(r,i.normal);return new xn(n,r,t)}function Br(e){return e.toLowerCase()}class Xe{constructor(t,n){this.attribute=n,this.property=t}}Xe.prototype.attribute="";Xe.prototype.booleanish=!1;Xe.prototype.boolean=!1;Xe.prototype.commaOrSpaceSeparated=!1;Xe.prototype.commaSeparated=!1;Xe.prototype.defined=!1;Xe.prototype.mustUseProperty=!1;Xe.prototype.number=!1;Xe.prototype.overloadedBoolean=!1;Xe.prototype.property="";Xe.prototype.spaceSeparated=!1;Xe.prototype.space=void 0;let Yu=0;const pe=Kt(),Pe=Kt(),Fr=Kt(),q=Kt(),Ae=Kt(),tn=Kt(),Qe=Kt();function Kt(){return 2**++Yu}const zr=Object.freeze(Object.defineProperty({__proto__:null,boolean:pe,booleanish:Pe,commaOrSpaceSeparated:Qe,commaSeparated:tn,number:q,overloadedBoolean:Fr,spaceSeparated:Ae},Symbol.toStringTag,{value:"Module"})),mr=Object.keys(zr);class ei extends Xe{constructor(t,n,r,i){let s=-1;if(super(t,n),xo(this,"space",i),typeof r=="number")for(;++s4&&n.slice(0,4)==="data"&&ed.test(t)){if(t.charAt(4)==="-"){const s=t.slice(5).replace(yo,rd);r="data"+s.charAt(0).toUpperCase()+s.slice(1)}else{const s=t.slice(4);if(!yo.test(s)){let o=s.replace(Qu,nd);o.charAt(0)!=="-"&&(o="-"+o),t="data"+o}}i=ei}return new i(r,t)}function nd(e){return"-"+e.toLowerCase()}function rd(e){return e.charAt(1).toUpperCase()}const id=Ds([Ps,Xu,zs,$s,Us],"html"),ti=Ds([Ps,Zu,zs,$s,Us],"svg");function od(e){return e.join(" ").trim()}var Yt={},gr,vo;function sd(){if(vo)return gr;vo=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,t=/\n/g,n=/^\s*/,r=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,i=/^:\s*/,s=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,o=/^[;\s]*/,l=/^\s+|\s+$/g,u=` `,c="/",d="*",p="",m="comment",f="declaration";function h(x,y){if(typeof x!="string")throw new TypeError("First argument must be a string");if(!x)return[];y=y||{};var w=1,T=1;function j(v){var E=v.match(t);E&&(w+=E.length);var I=v.lastIndexOf(u);T=~I?v.length-I:T+v.length}function O(){var v={line:w,column:T};return function(E){return E.position=new _(v),R(),E}}function _(v){this.start=v,this.end={line:w,column:T},this.source=y.source}_.prototype.content=x;function P(v){var E=new Error(y.source+":"+w+":"+T+": "+v);if(E.reason=v,E.filename=y.source,E.line=w,E.column=T,E.source=x,!y.silent)throw E}function D(v){var E=v.exec(x);if(E){var I=E[0];return j(I),x=x.slice(I.length),E}}function R(){D(n)}function S(v){var E;for(v=v||[];E=M();)E!==!1&&v.push(E);return v}function M(){var v=O();if(!(c!=x.charAt(0)||d!=x.charAt(1))){for(var E=2;p!=x.charAt(E)&&(d!=x.charAt(E)||c!=x.charAt(E+1));)++E;if(E+=2,p===x.charAt(E-1))return P("End of comment missing");var I=x.slice(2,E-2);return T+=2,j(I),x=x.slice(E),T+=2,v({type:m,comment:I})}}function L(){var v=O(),E=D(r);if(E){if(M(),!D(i))return P("property missing ':'");var I=D(s),H=v({type:f,property:b(E[0].replace(e,p)),value:I?b(I[0].replace(e,p)):p});return D(o),H}}function C(){var v=[];S(v);for(var E;E=L();)E!==!1&&(v.push(E),S(v));return v}return R(),C()}function b(x){return x?x.replace(l,p):p}return gr=h,gr}var ko;function ad(){if(ko)return Yt;ko=1;var e=Yt&&Yt.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Yt,"__esModule",{value:!0}),Yt.default=n;const t=e(sd());function n(r,i){let s=null;if(!r||typeof r!="string")return s;const o=(0,t.default)(r),l=typeof i=="function";return o.forEach(u=>{if(u.type!=="declaration")return;const{property:c,value:d}=u;l?i(c,d,u):d&&(s=s||{},s[c]=d)}),s}return Yt}var an={},Eo;function ld(){if(Eo)return an;Eo=1,Object.defineProperty(an,"__esModule",{value:!0}),an.camelCase=void 0;var e=/^--[a-zA-Z0-9_-]+$/,t=/-([a-z])/g,n=/^[^-]+$/,r=/^-(webkit|moz|ms|o|khtml)-/,i=/^-(ms)-/,s=function(c){return!c||n.test(c)||e.test(c)},o=function(c,d){return d.toUpperCase()},l=function(c,d){return"".concat(d,"-")},u=function(c,d){return d===void 0&&(d={}),s(c)?c:(c=c.toLowerCase(),d.reactCompat?c=c.replace(i,l):c=c.replace(r,l),c.replace(t,o))};return an.camelCase=u,an}var ln,wo;function cd(){if(wo)return ln;wo=1;var e=ln&&ln.__importDefault||function(i){return i&&i.__esModule?i:{default:i}},t=e(ad()),n=ld();function r(i,s){var o={};return!i||typeof i!="string"||(0,t.default)(i,function(l,u){l&&u&&(o[(0,n.camelCase)(l,s)]=u)}),o}return r.default=r,ln=r,ln}var ud=cd();const dd=Xr(ud),Hs=Ws("end"),ni=Ws("start");function Ws(e){return t;function t(n){const r=n&&n.position&&n.position[e]||{};if(typeof r.line=="number"&&r.line>0&&typeof r.column=="number"&&r.column>0)return{line:r.line,column:r.column,offset:typeof r.offset=="number"&&r.offset>-1?r.offset:void 0}}}function pd(e){const t=ni(e),n=Hs(e);if(t&&n)return{start:t,end:n}}function fn(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?_o(e.position):"start"in e||"end"in e?_o(e):"line"in e||"column"in e?$r(e):""}function $r(e){return No(e&&e.line)+":"+No(e&&e.column)}function _o(e){return $r(e&&e.start)+"-"+$r(e&&e.end)}function No(e){return e&&typeof e=="number"?e:1}class We extends Error{constructor(t,n,r){super(),typeof n=="string"&&(r=n,n=void 0);let i="",s={},o=!1;if(n&&("line"in n&&"column"in n?s={place:n}:"start"in n&&"end"in n?s={place:n}:"type"in n?s={ancestors:[n],place:n.position}:s={...n}),typeof t=="string"?i=t:!s.cause&&t&&(o=!0,i=t.message,s.cause=t),!s.ruleId&&!s.source&&typeof r=="string"){const u=r.indexOf(":");u===-1?s.ruleId=r:(s.source=r.slice(0,u),s.ruleId=r.slice(u+1))}if(!s.place&&s.ancestors&&s.ancestors){const u=s.ancestors[s.ancestors.length-1];u&&(s.place=u.position)}const l=s.place&&"start"in s.place?s.place.start:s.place;this.ancestors=s.ancestors||void 0,this.cause=s.cause||void 0,this.column=l?l.column:void 0,this.fatal=void 0,this.file="",this.message=i,this.line=l?l.line:void 0,this.name=fn(s.place)||"1:1",this.place=s.place||void 0,this.reason=this.message,this.ruleId=s.ruleId||void 0,this.source=s.source||void 0,this.stack=o&&s.cause&&typeof s.cause.stack=="string"?s.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}We.prototype.file="";We.prototype.name="";We.prototype.reason="";We.prototype.message="";We.prototype.stack="";We.prototype.column=void 0;We.prototype.line=void 0;We.prototype.ancestors=void 0;We.prototype.cause=void 0;We.prototype.fatal=void 0;We.prototype.place=void 0;We.prototype.ruleId=void 0;We.prototype.source=void 0;const ri={}.hasOwnProperty,fd=new Map,md=/[A-Z]/g,gd=new Set(["table","tbody","thead","tfoot","tr"]),hd=new Set(["td","th"]),Ks="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function bd(e,t){if(!t||t.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const n=t.filePath||void 0;let r;if(t.development){if(typeof t.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");r=Nd(n,t.jsxDEV)}else{if(typeof t.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof t.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");r=_d(n,t.jsx,t.jsxs)}const i={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:r,elementAttributeNameCase:t.elementAttributeNameCase||"react",evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space==="svg"?ti:id,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},s=Gs(i,e,void 0);return s&&typeof s!="string"?s:i.create(e,i.Fragment,{children:s||void 0},void 0)}function Gs(e,t,n){if(t.type==="element")return xd(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return yd(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return kd(e,t,n);if(t.type==="mdxjsEsm")return vd(e,t);if(t.type==="root")return Ed(e,t,n);if(t.type==="text")return wd(e,t)}function xd(e,t,n){const r=e.schema;let i=r;t.tagName.toLowerCase()==="svg"&&r.space==="html"&&(i=ti,e.schema=i),e.ancestors.push(t);const s=Vs(e,t.tagName,!1),o=Sd(e,t);let l=oi(e,t);return gd.has(t.tagName)&&(l=l.filter(function(u){return typeof u=="string"?!Vu(u):!0})),qs(e,o,s,t),ii(o,l),e.ancestors.pop(),e.schema=r,e.create(t,s,o,n)}function yd(e,t){if(t.data&&t.data.estree&&e.evaluater){const r=t.data.estree.body[0];return r.type,e.evaluater.evaluateExpression(r.expression)}hn(e,t.position)}function vd(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);hn(e,t.position)}function kd(e,t,n){const r=e.schema;let i=r;t.name==="svg"&&r.space==="html"&&(i=ti,e.schema=i),e.ancestors.push(t);const s=t.name===null?e.Fragment:Vs(e,t.name,!0),o=Td(e,t),l=oi(e,t);return qs(e,o,s,t),ii(o,l),e.ancestors.pop(),e.schema=r,e.create(t,s,o,n)}function Ed(e,t,n){const r={};return ii(r,oi(e,t)),e.create(t,e.Fragment,r,n)}function wd(e,t){return t.value}function qs(e,t,n,r){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=r)}function ii(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function _d(e,t,n){return r;function r(i,s,o,l){const c=Array.isArray(o.children)?n:t;return l?c(s,o,l):c(s,o)}}function Nd(e,t){return n;function n(r,i,s,o){const l=Array.isArray(s.children),u=ni(r);return t(i,s,o,l,{columnNumber:u?u.column-1:void 0,fileName:e,lineNumber:u?u.line:void 0},void 0)}}function Sd(e,t){const n={};let r,i;for(i in t.properties)if(i!=="children"&&ri.call(t.properties,i)){const s=Cd(e,i,t.properties[i]);if(s){const[o,l]=s;e.tableCellAlignToStyle&&o==="align"&&typeof l=="string"&&hd.has(t.tagName)?r=l:n[o]=l}}if(r){const s=n.style||(n.style={});s[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return n}function Td(e,t){const n={};for(const r of t.attributes)if(r.type==="mdxJsxExpressionAttribute")if(r.data&&r.data.estree&&e.evaluater){const s=r.data.estree.body[0];s.type;const o=s.expression;o.type;const l=o.properties[0];l.type,Object.assign(n,e.evaluater.evaluateExpression(l.argument))}else hn(e,t.position);else{const i=r.name;let s;if(r.value&&typeof r.value=="object")if(r.value.data&&r.value.data.estree&&e.evaluater){const l=r.value.data.estree.body[0];l.type,s=e.evaluater.evaluateExpression(l.expression)}else hn(e,t.position);else s=r.value===null?!0:r.value;n[i]=s}return n}function oi(e,t){const n=[];let r=-1;const i=e.passKeys?new Map:fd;for(;++ri?0:i+t:t=t>i?i:t,n=n>0?n:0,r.length<1e4)o=Array.from(r),o.unshift(t,n),e.splice(...o);else for(n&&e.splice(t,n);s0?(et(e,e.length,0,t),e):t}const Co={}.hasOwnProperty;function Xs(e){const t={};let n=-1;for(;++n13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)===65535||(n&65535)===65534||n>1114111?"�":String.fromCodePoint(n)}function dt(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const Ve=Dt(/[A-Za-z]/),He=Dt(/[\dA-Za-z]/),Pd=Dt(/[#-'*+\--9=?A-Z^-~]/);function Hn(e){return e!==null&&(e<32||e===127)}const Ur=Dt(/\d/),Bd=Dt(/[\dA-Fa-f]/),Fd=Dt(/[!-/:-@[-`{-~]/);function se(e){return e!==null&&e<-2}function Se(e){return e!==null&&(e<0||e===32)}function he(e){return e===-2||e===-1||e===32}const Jn=Dt(new RegExp("\\p{P}|\\p{S}","u")),Wt=Dt(/\s/);function Dt(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function on(e){const t=[];let n=-1,r=0,i=0;for(;++n55295&&s<57344){const l=e.charCodeAt(n+1);s<56320&&l>56319&&l<57344?(o=String.fromCharCode(s,l),i=1):o="�"}else o=String.fromCharCode(s);o&&(t.push(e.slice(r,n),encodeURIComponent(o)),r=n+i+1,o=""),i&&(n+=i,i=0)}return t.join("")+e.slice(r)}function ke(e,t,n,r){const i=r?r-1:Number.POSITIVE_INFINITY;let s=0;return o;function o(u){return he(u)?(e.enter(n),l(u)):t(u)}function l(u){return he(u)&&s++o))return;const P=t.events.length;let D=P,R,S;for(;D--;)if(t.events[D][0]==="exit"&&t.events[D][1].type==="chunkFlow"){if(R){S=t.events[D][1].end;break}R=!0}for(y(r),_=P;_T;){const O=n[j];t.containerState=O[1],O[0].exit.call(t,e)}n.length=T}function w(){i.write([null]),s=void 0,i=void 0,t.containerState._closeFlow=void 0}}function Wd(e,t,n){return ke(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function nn(e){if(e===null||Se(e)||Wt(e))return 1;if(Jn(e))return 2}function Qn(e,t,n){const r=[];let i=-1;for(;++i1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;const p={...e[r][1].end},m={...e[n][1].start};Mo(p,-u),Mo(m,u),o={type:u>1?"strongSequence":"emphasisSequence",start:p,end:{...e[r][1].end}},l={type:u>1?"strongSequence":"emphasisSequence",start:{...e[n][1].start},end:m},s={type:u>1?"strongText":"emphasisText",start:{...e[r][1].end},end:{...e[n][1].start}},i={type:u>1?"strong":"emphasis",start:{...o.start},end:{...l.end}},e[r][1].end={...o.start},e[n][1].start={...l.end},c=[],e[r][1].end.offset-e[r][1].start.offset&&(c=it(c,[["enter",e[r][1],t],["exit",e[r][1],t]])),c=it(c,[["enter",i,t],["enter",o,t],["exit",o,t],["enter",s,t]]),c=it(c,Qn(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),c=it(c,[["exit",s,t],["enter",l,t],["exit",l,t],["exit",i,t]]),e[n][1].end.offset-e[n][1].start.offset?(d=2,c=it(c,[["enter",e[n][1],t],["exit",e[n][1],t]])):d=0,et(e,r-1,n-r+3,c),n=r+c.length-d-2;break}}for(n=-1;++n0&&he(_)?ke(e,w,"linePrefix",s+1)(_):w(_)}function w(_){return _===null||se(_)?e.check(Io,b,j)(_):(e.enter("codeFlowValue"),T(_))}function T(_){return _===null||se(_)?(e.exit("codeFlowValue"),w(_)):(e.consume(_),T)}function j(_){return e.exit("codeFenced"),t(_)}function O(_,P,D){let R=0;return S;function S(E){return _.enter("lineEnding"),_.consume(E),_.exit("lineEnding"),M}function M(E){return _.enter("codeFencedFence"),he(E)?ke(_,L,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(E):L(E)}function L(E){return E===l?(_.enter("codeFencedFenceSequence"),C(E)):D(E)}function C(E){return E===l?(R++,_.consume(E),C):R>=o?(_.exit("codeFencedFenceSequence"),he(E)?ke(_,v,"whitespace")(E):v(E)):D(E)}function v(E){return E===null||se(E)?(_.exit("codeFencedFence"),P(E)):D(E)}}}function np(e,t,n){const r=this;return i;function i(o){return o===null?n(o):(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),s)}function s(o){return r.parser.lazy[r.now().line]?n(o):t(o)}}const br={name:"codeIndented",tokenize:ip},rp={partial:!0,tokenize:op};function ip(e,t,n){const r=this;return i;function i(c){return e.enter("codeIndented"),ke(e,s,"linePrefix",5)(c)}function s(c){const d=r.events[r.events.length-1];return d&&d[1].type==="linePrefix"&&d[2].sliceSerialize(d[1],!0).length>=4?o(c):n(c)}function o(c){return c===null?u(c):se(c)?e.attempt(rp,o,u)(c):(e.enter("codeFlowValue"),l(c))}function l(c){return c===null||se(c)?(e.exit("codeFlowValue"),o(c)):(e.consume(c),l)}function u(c){return e.exit("codeIndented"),t(c)}}function op(e,t,n){const r=this;return i;function i(o){return r.parser.lazy[r.now().line]?n(o):se(o)?(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),i):ke(e,s,"linePrefix",5)(o)}function s(o){const l=r.events[r.events.length-1];return l&&l[1].type==="linePrefix"&&l[2].sliceSerialize(l[1],!0).length>=4?t(o):se(o)?i(o):n(o)}}const sp={name:"codeText",previous:lp,resolve:ap,tokenize:cp};function ap(e){let t=e.length-4,n=3,r,i;if((e[n][1].type==="lineEnding"||e[n][1].type==="space")&&(e[t][1].type==="lineEnding"||e[t][1].type==="space")){for(r=n;++r=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+t+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return tthis.left.length?this.right.slice(this.right.length-r+this.left.length,this.right.length-t+this.left.length).reverse():this.left.slice(t).concat(this.right.slice(this.right.length-r+this.left.length).reverse())}splice(t,n,r){const i=n||0;this.setCursor(Math.trunc(t));const s=this.right.splice(this.right.length-i,Number.POSITIVE_INFINITY);return r&&cn(this.left,r),s.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(t){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(t)}pushMany(t){this.setCursor(Number.POSITIVE_INFINITY),cn(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),cn(this.right,t.reverse())}setCursor(t){if(!(t===this.left.length||t>this.left.length&&this.right.length===0||t<0&&this.left.length===0))if(t=4?t(o):e.interrupt(r.parser.constructs.flow,n,t)(o)}}function na(e,t,n,r,i,s,o,l,u){const c=u||Number.POSITIVE_INFINITY;let d=0;return p;function p(y){return y===60?(e.enter(r),e.enter(i),e.enter(s),e.consume(y),e.exit(s),m):y===null||y===32||y===41||Hn(y)?n(y):(e.enter(r),e.enter(o),e.enter(l),e.enter("chunkString",{contentType:"string"}),b(y))}function m(y){return y===62?(e.enter(s),e.consume(y),e.exit(s),e.exit(i),e.exit(r),t):(e.enter(l),e.enter("chunkString",{contentType:"string"}),f(y))}function f(y){return y===62?(e.exit("chunkString"),e.exit(l),m(y)):y===null||y===60||se(y)?n(y):(e.consume(y),y===92?h:f)}function h(y){return y===60||y===62||y===92?(e.consume(y),f):f(y)}function b(y){return!d&&(y===null||y===41||Se(y))?(e.exit("chunkString"),e.exit(l),e.exit(o),e.exit(r),t(y)):d999||f===null||f===91||f===93&&!u||f===94&&!l&&"_hiddenFootnoteSupport"in o.parser.constructs?n(f):f===93?(e.exit(s),e.enter(i),e.consume(f),e.exit(i),e.exit(r),t):se(f)?(e.enter("lineEnding"),e.consume(f),e.exit("lineEnding"),d):(e.enter("chunkString",{contentType:"string"}),p(f))}function p(f){return f===null||f===91||f===93||se(f)||l++>999?(e.exit("chunkString"),d(f)):(e.consume(f),u||(u=!he(f)),f===92?m:p)}function m(f){return f===91||f===92||f===93?(e.consume(f),l++,p):p(f)}}function ia(e,t,n,r,i,s){let o;return l;function l(m){return m===34||m===39||m===40?(e.enter(r),e.enter(i),e.consume(m),e.exit(i),o=m===40?41:m,u):n(m)}function u(m){return m===o?(e.enter(i),e.consume(m),e.exit(i),e.exit(r),t):(e.enter(s),c(m))}function c(m){return m===o?(e.exit(s),u(o)):m===null?n(m):se(m)?(e.enter("lineEnding"),e.consume(m),e.exit("lineEnding"),ke(e,c,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),d(m))}function d(m){return m===o||m===null||se(m)?(e.exit("chunkString"),c(m)):(e.consume(m),m===92?p:d)}function p(m){return m===o||m===92?(e.consume(m),d):d(m)}}function mn(e,t){let n;return r;function r(i){return se(i)?(e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),n=!0,r):he(i)?ke(e,r,n?"linePrefix":"lineSuffix")(i):t(i)}}const bp={name:"definition",tokenize:yp},xp={partial:!0,tokenize:vp};function yp(e,t,n){const r=this;let i;return s;function s(f){return e.enter("definition"),o(f)}function o(f){return ra.call(r,e,l,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(f)}function l(f){return i=dt(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),f===58?(e.enter("definitionMarker"),e.consume(f),e.exit("definitionMarker"),u):n(f)}function u(f){return Se(f)?mn(e,c)(f):c(f)}function c(f){return na(e,d,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(f)}function d(f){return e.attempt(xp,p,p)(f)}function p(f){return he(f)?ke(e,m,"whitespace")(f):m(f)}function m(f){return f===null||se(f)?(e.exit("definition"),r.parser.defined.push(i),t(f)):n(f)}}function vp(e,t,n){return r;function r(l){return Se(l)?mn(e,i)(l):n(l)}function i(l){return ia(e,s,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(l)}function s(l){return he(l)?ke(e,o,"whitespace")(l):o(l)}function o(l){return l===null||se(l)?t(l):n(l)}}const kp={name:"hardBreakEscape",tokenize:Ep};function Ep(e,t,n){return r;function r(s){return e.enter("hardBreakEscape"),e.consume(s),i}function i(s){return se(s)?(e.exit("hardBreakEscape"),t(s)):n(s)}}const wp={name:"headingAtx",resolve:_p,tokenize:Np};function _p(e,t){let n=e.length-2,r=3,i,s;return e[r][1].type==="whitespace"&&(r+=2),n-2>r&&e[n][1].type==="whitespace"&&(n-=2),e[n][1].type==="atxHeadingSequence"&&(r===n-1||n-4>r&&e[n-2][1].type==="whitespace")&&(n-=r+1===n?2:4),n>r&&(i={type:"atxHeadingText",start:e[r][1].start,end:e[n][1].end},s={type:"chunkText",start:e[r][1].start,end:e[n][1].end,contentType:"text"},et(e,r,n-r+1,[["enter",i,t],["enter",s,t],["exit",s,t],["exit",i,t]])),e}function Np(e,t,n){let r=0;return i;function i(d){return e.enter("atxHeading"),s(d)}function s(d){return e.enter("atxHeadingSequence"),o(d)}function o(d){return d===35&&r++<6?(e.consume(d),o):d===null||Se(d)?(e.exit("atxHeadingSequence"),l(d)):n(d)}function l(d){return d===35?(e.enter("atxHeadingSequence"),u(d)):d===null||se(d)?(e.exit("atxHeading"),t(d)):he(d)?ke(e,l,"whitespace")(d):(e.enter("atxHeadingText"),c(d))}function u(d){return d===35?(e.consume(d),u):(e.exit("atxHeadingSequence"),l(d))}function c(d){return d===null||d===35||Se(d)?(e.exit("atxHeadingText"),l(d)):(e.consume(d),c)}}const Sp=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],Oo=["pre","script","style","textarea"],Tp={concrete:!0,name:"htmlFlow",resolveTo:Mp,tokenize:Ip},Cp={partial:!0,tokenize:Op},Ap={partial:!0,tokenize:Rp};function Mp(e){let t=e.length;for(;t--&&!(e[t][0]==="enter"&&e[t][1].type==="htmlFlow"););return t>1&&e[t-2][1].type==="linePrefix"&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e}function Ip(e,t,n){const r=this;let i,s,o,l,u;return c;function c(k){return d(k)}function d(k){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(k),p}function p(k){return k===33?(e.consume(k),m):k===47?(e.consume(k),s=!0,b):k===63?(e.consume(k),i=3,r.interrupt?t:g):Ve(k)?(e.consume(k),o=String.fromCharCode(k),x):n(k)}function m(k){return k===45?(e.consume(k),i=2,f):k===91?(e.consume(k),i=5,l=0,h):Ve(k)?(e.consume(k),i=4,r.interrupt?t:g):n(k)}function f(k){return k===45?(e.consume(k),r.interrupt?t:g):n(k)}function h(k){const ie="CDATA[";return k===ie.charCodeAt(l++)?(e.consume(k),l===ie.length?r.interrupt?t:L:h):n(k)}function b(k){return Ve(k)?(e.consume(k),o=String.fromCharCode(k),x):n(k)}function x(k){if(k===null||k===47||k===62||Se(k)){const ie=k===47,K=o.toLowerCase();return!ie&&!s&&Oo.includes(K)?(i=1,r.interrupt?t(k):L(k)):Sp.includes(o.toLowerCase())?(i=6,ie?(e.consume(k),y):r.interrupt?t(k):L(k)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(k):s?w(k):T(k))}return k===45||He(k)?(e.consume(k),o+=String.fromCharCode(k),x):n(k)}function y(k){return k===62?(e.consume(k),r.interrupt?t:L):n(k)}function w(k){return he(k)?(e.consume(k),w):S(k)}function T(k){return k===47?(e.consume(k),S):k===58||k===95||Ve(k)?(e.consume(k),j):he(k)?(e.consume(k),T):S(k)}function j(k){return k===45||k===46||k===58||k===95||He(k)?(e.consume(k),j):O(k)}function O(k){return k===61?(e.consume(k),_):he(k)?(e.consume(k),O):T(k)}function _(k){return k===null||k===60||k===61||k===62||k===96?n(k):k===34||k===39?(e.consume(k),u=k,P):he(k)?(e.consume(k),_):D(k)}function P(k){return k===u?(e.consume(k),u=null,R):k===null||se(k)?n(k):(e.consume(k),P)}function D(k){return k===null||k===34||k===39||k===47||k===60||k===61||k===62||k===96||Se(k)?O(k):(e.consume(k),D)}function R(k){return k===47||k===62||he(k)?T(k):n(k)}function S(k){return k===62?(e.consume(k),M):n(k)}function M(k){return k===null||se(k)?L(k):he(k)?(e.consume(k),M):n(k)}function L(k){return k===45&&i===2?(e.consume(k),I):k===60&&i===1?(e.consume(k),H):k===62&&i===4?(e.consume(k),F):k===63&&i===3?(e.consume(k),g):k===93&&i===5?(e.consume(k),V):se(k)&&(i===6||i===7)?(e.exit("htmlFlowData"),e.check(Cp,$,C)(k)):k===null||se(k)?(e.exit("htmlFlowData"),C(k)):(e.consume(k),L)}function C(k){return e.check(Ap,v,$)(k)}function v(k){return e.enter("lineEnding"),e.consume(k),e.exit("lineEnding"),E}function E(k){return k===null||se(k)?C(k):(e.enter("htmlFlowData"),L(k))}function I(k){return k===45?(e.consume(k),g):L(k)}function H(k){return k===47?(e.consume(k),o="",U):L(k)}function U(k){if(k===62){const ie=o.toLowerCase();return Oo.includes(ie)?(e.consume(k),F):L(k)}return Ve(k)&&o.length<8?(e.consume(k),o+=String.fromCharCode(k),U):L(k)}function V(k){return k===93?(e.consume(k),g):L(k)}function g(k){return k===62?(e.consume(k),F):k===45&&i===2?(e.consume(k),g):L(k)}function F(k){return k===null||se(k)?(e.exit("htmlFlowData"),$(k)):(e.consume(k),F)}function $(k){return e.exit("htmlFlow"),t(k)}}function Rp(e,t,n){const r=this;return i;function i(o){return se(o)?(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),s):n(o)}function s(o){return r.parser.lazy[r.now().line]?n(o):t(o)}}function Op(e,t,n){return r;function r(i){return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),e.attempt(yn,t,n)}}const Lp={name:"htmlText",tokenize:jp};function jp(e,t,n){const r=this;let i,s,o;return l;function l(g){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(g),u}function u(g){return g===33?(e.consume(g),c):g===47?(e.consume(g),O):g===63?(e.consume(g),T):Ve(g)?(e.consume(g),D):n(g)}function c(g){return g===45?(e.consume(g),d):g===91?(e.consume(g),s=0,h):Ve(g)?(e.consume(g),w):n(g)}function d(g){return g===45?(e.consume(g),f):n(g)}function p(g){return g===null?n(g):g===45?(e.consume(g),m):se(g)?(o=p,H(g)):(e.consume(g),p)}function m(g){return g===45?(e.consume(g),f):p(g)}function f(g){return g===62?I(g):g===45?m(g):p(g)}function h(g){const F="CDATA[";return g===F.charCodeAt(s++)?(e.consume(g),s===F.length?b:h):n(g)}function b(g){return g===null?n(g):g===93?(e.consume(g),x):se(g)?(o=b,H(g)):(e.consume(g),b)}function x(g){return g===93?(e.consume(g),y):b(g)}function y(g){return g===62?I(g):g===93?(e.consume(g),y):b(g)}function w(g){return g===null||g===62?I(g):se(g)?(o=w,H(g)):(e.consume(g),w)}function T(g){return g===null?n(g):g===63?(e.consume(g),j):se(g)?(o=T,H(g)):(e.consume(g),T)}function j(g){return g===62?I(g):T(g)}function O(g){return Ve(g)?(e.consume(g),_):n(g)}function _(g){return g===45||He(g)?(e.consume(g),_):P(g)}function P(g){return se(g)?(o=P,H(g)):he(g)?(e.consume(g),P):I(g)}function D(g){return g===45||He(g)?(e.consume(g),D):g===47||g===62||Se(g)?R(g):n(g)}function R(g){return g===47?(e.consume(g),I):g===58||g===95||Ve(g)?(e.consume(g),S):se(g)?(o=R,H(g)):he(g)?(e.consume(g),R):I(g)}function S(g){return g===45||g===46||g===58||g===95||He(g)?(e.consume(g),S):M(g)}function M(g){return g===61?(e.consume(g),L):se(g)?(o=M,H(g)):he(g)?(e.consume(g),M):R(g)}function L(g){return g===null||g===60||g===61||g===62||g===96?n(g):g===34||g===39?(e.consume(g),i=g,C):se(g)?(o=L,H(g)):he(g)?(e.consume(g),L):(e.consume(g),v)}function C(g){return g===i?(e.consume(g),i=void 0,E):g===null?n(g):se(g)?(o=C,H(g)):(e.consume(g),C)}function v(g){return g===null||g===34||g===39||g===60||g===61||g===96?n(g):g===47||g===62||Se(g)?R(g):(e.consume(g),v)}function E(g){return g===47||g===62||Se(g)?R(g):n(g)}function I(g){return g===62?(e.consume(g),e.exit("htmlTextData"),e.exit("htmlText"),t):n(g)}function H(g){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(g),e.exit("lineEnding"),U}function U(g){return he(g)?ke(e,V,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(g):V(g)}function V(g){return e.enter("htmlTextData"),o(g)}}const li={name:"labelEnd",resolveAll:Fp,resolveTo:zp,tokenize:$p},Dp={tokenize:Up},Pp={tokenize:Hp},Bp={tokenize:Wp};function Fp(e){let t=-1;const n=[];for(;++t=3&&(c===null||se(c))?(e.exit("thematicBreak"),t(c)):n(c)}function u(c){return c===i?(e.consume(c),r++,u):(e.exit("thematicBreakSequence"),he(c)?ke(e,l,"whitespace")(c):l(c))}}const Ye={continuation:{tokenize:ef},exit:nf,name:"list",tokenize:Qp},Zp={partial:!0,tokenize:rf},Jp={partial:!0,tokenize:tf};function Qp(e,t,n){const r=this,i=r.events[r.events.length-1];let s=i&&i[1].type==="linePrefix"?i[2].sliceSerialize(i[1],!0).length:0,o=0;return l;function l(f){const h=r.containerState.type||(f===42||f===43||f===45?"listUnordered":"listOrdered");if(h==="listUnordered"?!r.containerState.marker||f===r.containerState.marker:Ur(f)){if(r.containerState.type||(r.containerState.type=h,e.enter(h,{_container:!0})),h==="listUnordered")return e.enter("listItemPrefix"),f===42||f===45?e.check(Fn,n,c)(f):c(f);if(!r.interrupt||f===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),u(f)}return n(f)}function u(f){return Ur(f)&&++o<10?(e.consume(f),u):(!r.interrupt||o<2)&&(r.containerState.marker?f===r.containerState.marker:f===41||f===46)?(e.exit("listItemValue"),c(f)):n(f)}function c(f){return e.enter("listItemMarker"),e.consume(f),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||f,e.check(yn,r.interrupt?n:d,e.attempt(Zp,m,p))}function d(f){return r.containerState.initialBlankLine=!0,s++,m(f)}function p(f){return he(f)?(e.enter("listItemPrefixWhitespace"),e.consume(f),e.exit("listItemPrefixWhitespace"),m):n(f)}function m(f){return r.containerState.size=s+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(f)}}function ef(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(yn,i,s);function i(l){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,ke(e,t,"listItemIndent",r.containerState.size+1)(l)}function s(l){return r.containerState.furtherBlankLines||!he(l)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,o(l)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(Jp,t,o)(l))}function o(l){return r.containerState._closeFlow=!0,r.interrupt=void 0,ke(e,e.attempt(Ye,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(l)}}function tf(e,t,n){const r=this;return ke(e,i,"listItemIndent",r.containerState.size+1);function i(s){const o=r.events[r.events.length-1];return o&&o[1].type==="listItemIndent"&&o[2].sliceSerialize(o[1],!0).length===r.containerState.size?t(s):n(s)}}function nf(e){e.exit(this.containerState.type)}function rf(e,t,n){const r=this;return ke(e,i,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function i(s){const o=r.events[r.events.length-1];return!he(s)&&o&&o[1].type==="listItemPrefixWhitespace"?t(s):n(s)}}const Lo={name:"setextUnderline",resolveTo:of,tokenize:sf};function of(e,t){let n=e.length,r,i,s;for(;n--;)if(e[n][0]==="enter"){if(e[n][1].type==="content"){r=n;break}e[n][1].type==="paragraph"&&(i=n)}else e[n][1].type==="content"&&e.splice(n,1),!s&&e[n][1].type==="definition"&&(s=n);const o={type:"setextHeading",start:{...e[r][1].start},end:{...e[e.length-1][1].end}};return e[i][1].type="setextHeadingText",s?(e.splice(i,0,["enter",o,t]),e.splice(s+1,0,["exit",e[r][1],t]),e[r][1].end={...e[s][1].end}):e[r][1]=o,e.push(["exit",o,t]),e}function sf(e,t,n){const r=this;let i;return s;function s(c){let d=r.events.length,p;for(;d--;)if(r.events[d][1].type!=="lineEnding"&&r.events[d][1].type!=="linePrefix"&&r.events[d][1].type!=="content"){p=r.events[d][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||p)?(e.enter("setextHeadingLine"),i=c,o(c)):n(c)}function o(c){return e.enter("setextHeadingLineSequence"),l(c)}function l(c){return c===i?(e.consume(c),l):(e.exit("setextHeadingLineSequence"),he(c)?ke(e,u,"lineSuffix")(c):u(c))}function u(c){return c===null||se(c)?(e.exit("setextHeadingLine"),t(c)):n(c)}}const af={tokenize:lf};function lf(e){const t=this,n=e.attempt(yn,r,e.attempt(this.parser.constructs.flowInitial,i,ke(e,e.attempt(this.parser.constructs.flow,i,e.attempt(pp,i)),"linePrefix")));return n;function r(s){if(s===null){e.consume(s);return}return e.enter("lineEndingBlank"),e.consume(s),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n}function i(s){if(s===null){e.consume(s);return}return e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),t.currentConstruct=void 0,n}}const cf={resolveAll:sa()},uf=oa("string"),df=oa("text");function oa(e){return{resolveAll:sa(e==="text"?pf:void 0),tokenize:t};function t(n){const r=this,i=this.parser.constructs[e],s=n.attempt(i,o,l);return o;function o(d){return c(d)?s(d):l(d)}function l(d){if(d===null){n.consume(d);return}return n.enter("data"),n.consume(d),u}function u(d){return c(d)?(n.exit("data"),s(d)):(n.consume(d),u)}function c(d){if(d===null)return!0;const p=i[d];let m=-1;if(p)for(;++m-1){const l=o[0];typeof l=="string"?o[0]=l.slice(r):o.shift()}s>0&&o.push(e[i].slice(0,s))}return o}function Nf(e,t){let n=-1;const r=[];let i;for(;++n0){const Ke=ee.tokenStack[ee.tokenStack.length-1];(Ke[1]||Do).call(ee,void 0,Ke[0])}for(G.position={start:Rt(B.length>0?B[0][1].start:{line:1,column:1,offset:0}),end:Rt(B.length>0?B[B.length-2][1].end:{line:1,column:1,offset:0})},we=-1;++we0){const Ke=ee.tokenStack[ee.tokenStack.length-1];(Ke[1]||Do).call(ee,void 0,Ke[0])}for(G.position={start:Rt(B.length>0?B[0][1].start:{line:1,column:1,offset:0}),end:Rt(B.length>0?B[B.length-2][1].end:{line:1,column:1,offset:0})},we=-1;++we0&&(r.className=["language-"+i[0]]);let s={type:"element",tagName:"code",properties:r,children:[{type:"text",value:n}]};return t.meta&&(s.data={meta:t.meta}),e.patch(t,s),s=e.applyData(t,s),s={type:"element",tagName:"pre",properties:{},children:[s]},e.patch(t,s),s}function Ff(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function zf(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function $f(e,t){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",r=String(t.identifier).toUpperCase(),i=on(r.toLowerCase()),s=e.footnoteOrder.indexOf(r);let o,l=e.footnoteCounts.get(r);l===void 0?(l=0,e.footnoteOrder.push(r),o=e.footnoteOrder.length):o=s+1,l+=1,e.footnoteCounts.set(r,l);const u={type:"element",tagName:"a",properties:{href:"#"+n+"fn-"+i,id:n+"fnref-"+i+(l>1?"-"+l:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(o)}]};e.patch(t,u);const c={type:"element",tagName:"sup",properties:{},children:[u]};return e.patch(t,c),e.applyData(t,c)}function Uf(e,t){const n={type:"element",tagName:"h"+t.depth,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Hf(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}}function ca(e,t){const n=t.referenceType;let r="]";if(n==="collapsed"?r+="[]":n==="full"&&(r+="["+(t.label||t.identifier)+"]"),t.type==="imageReference")return[{type:"text",value:"!["+t.alt+r}];const i=e.all(t),s=i[0];s&&s.type==="text"?s.value="["+s.value:i.unshift({type:"text",value:"["});const o=i[i.length-1];return o&&o.type==="text"?o.value+=r:i.push({type:"text",value:r}),i}function Wf(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return ca(e,t);const i={src:on(r.url||""),alt:t.alt};r.title!==null&&r.title!==void 0&&(i.title=r.title);const s={type:"element",tagName:"img",properties:i,children:[]};return e.patch(t,s),e.applyData(t,s)}function Kf(e,t){const n={src:on(t.url)};t.alt!==null&&t.alt!==void 0&&(n.alt=t.alt),t.title!==null&&t.title!==void 0&&(n.title=t.title);const r={type:"element",tagName:"img",properties:n,children:[]};return e.patch(t,r),e.applyData(t,r)}function Gf(e,t){const n={type:"text",value:t.value.replace(/\r?\n|\r/g," ")};e.patch(t,n);const r={type:"element",tagName:"code",properties:{},children:[n]};return e.patch(t,r),e.applyData(t,r)}function qf(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return ca(e,t);const i={href:on(r.url||"")};r.title!==null&&r.title!==void 0&&(i.title=r.title);const s={type:"element",tagName:"a",properties:i,children:e.all(t)};return e.patch(t,s),e.applyData(t,s)}function Vf(e,t){const n={href:on(t.url)};t.title!==null&&t.title!==void 0&&(n.title=t.title);const r={type:"element",tagName:"a",properties:n,children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function Yf(e,t,n){const r=e.all(t),i=n?Xf(n):ua(t),s={},o=[];if(typeof t.checked=="boolean"){const d=r[0];let p;d&&d.type==="element"&&d.tagName==="p"?p=d:(p={type:"element",tagName:"p",properties:{},children:[]},r.unshift(p)),p.children.length>0&&p.children.unshift({type:"text",value:" "}),p.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:t.checked,disabled:!0},children:[]}),s.className=["task-list-item"]}let l=-1;for(;++l:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing)*.5)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*.5)*calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-1>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing)*1)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*1)*calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-1\.5>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing)*1.5)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*1.5)*calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-2>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing)*2)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*2)*calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-3>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing)*3)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*3)*calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-4>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing)*4)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*4)*calc(1 - var(--tw-space-y-reverse)))}.self-start{align-self:flex-start}.truncate{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.overflow-auto{overflow:auto}.overflow-hidden{overflow:hidden}.overflow-x-auto{overflow-x:auto}.overflow-y-auto{overflow-y:auto}.rounded{border-radius:.25rem}.rounded-full{border-radius:3.40282e38px}.rounded-lg{border-radius:var(--radius-lg)}.rounded-md{border-radius:var(--radius-md)}.rounded-sm{border-radius:var(--radius-sm)}.rounded-xl{border-radius:var(--radius-xl)}.rounded-r{border-top-right-radius:.25rem;border-bottom-right-radius:.25rem}.border{border-style:var(--tw-border-style);border-width:1px}.border-y{border-block-style:var(--tw-border-style);border-block-width:1px}.border-t{border-top-style:var(--tw-border-style);border-top-width:1px}.border-r{border-right-style:var(--tw-border-style);border-right-width:1px}.border-b{border-bottom-style:var(--tw-border-style);border-bottom-width:1px}.border-\[var\(--border\)\]{border-color:var(--border)}.bg-\[var\(--bg-primary\)\]{background-color:var(--bg-primary)}.bg-\[var\(--sidebar-bg\)\]{background-color:var(--sidebar-bg)}.bg-transparent{background-color:#0000}.p-0\.5{padding:calc(var(--spacing)*.5)}.p-1{padding:calc(var(--spacing)*1)}.p-1\.5{padding:calc(var(--spacing)*1.5)}.p-2{padding:calc(var(--spacing)*2)}.p-3{padding:calc(var(--spacing)*3)}.p-4{padding:calc(var(--spacing)*4)}.p-6{padding:calc(var(--spacing)*6)}.px-1{padding-inline:calc(var(--spacing)*1)}.px-1\.5{padding-inline:calc(var(--spacing)*1.5)}.px-2{padding-inline:calc(var(--spacing)*2)}.px-2\.5{padding-inline:calc(var(--spacing)*2.5)}.px-3{padding-inline:calc(var(--spacing)*3)}.px-4{padding-inline:calc(var(--spacing)*4)}.px-5{padding-inline:calc(var(--spacing)*5)}.px-6{padding-inline:calc(var(--spacing)*6)}.py-0\.5{padding-block:calc(var(--spacing)*.5)}.py-1{padding-block:calc(var(--spacing)*1)}.py-1\.5{padding-block:calc(var(--spacing)*1.5)}.py-2{padding-block:calc(var(--spacing)*2)}.py-2\.5{padding-block:calc(var(--spacing)*2.5)}.py-3{padding-block:calc(var(--spacing)*3)}.py-4{padding-block:calc(var(--spacing)*4)}.py-6{padding-block:calc(var(--spacing)*6)}.py-8{padding-block:calc(var(--spacing)*8)}.py-10{padding-block:calc(var(--spacing)*10)}.py-\[3px\]{padding-block:3px}.pt-0{padding-top:calc(var(--spacing)*0)}.pt-1{padding-top:calc(var(--spacing)*1)}.pt-1\.5{padding-top:calc(var(--spacing)*1.5)}.pt-2{padding-top:calc(var(--spacing)*2)}.pt-3{padding-top:calc(var(--spacing)*3)}.pt-4{padding-top:calc(var(--spacing)*4)}.pt-px{padding-top:1px}.pr-0{padding-right:calc(var(--spacing)*0)}.pr-1{padding-right:calc(var(--spacing)*1)}.pr-2{padding-right:calc(var(--spacing)*2)}.pb-0\.5{padding-bottom:calc(var(--spacing)*.5)}.pb-1{padding-bottom:calc(var(--spacing)*1)}.pb-2{padding-bottom:calc(var(--spacing)*2)}.pl-2{padding-left:calc(var(--spacing)*2)}.pl-2\.5{padding-left:calc(var(--spacing)*2.5)}.pl-\[22px\]{padding-left:22px}.text-center{text-align:center}.text-left{text-align:left}.text-right{text-align:right}.font-mono{font-family:var(--font-mono)}.text-base{font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height))}.text-sm{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.text-xs{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.text-\[9px\]{font-size:9px}.text-\[10px\]{font-size:10px}.text-\[11px\]{font-size:11px}.text-\[12px\]{font-size:12px}.text-\[13px\]{font-size:13px}.leading-none{--tw-leading:1;line-height:1}.leading-normal{--tw-leading:var(--leading-normal);line-height:var(--leading-normal)}.leading-relaxed{--tw-leading:var(--leading-relaxed);line-height:var(--leading-relaxed)}.font-bold{--tw-font-weight:var(--font-weight-bold);font-weight:var(--font-weight-bold)}.font-medium{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.font-normal{--tw-font-weight:var(--font-weight-normal);font-weight:var(--font-weight-normal)}.font-semibold{--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold)}.tracking-normal{--tw-tracking:var(--tracking-normal);letter-spacing:var(--tracking-normal)}.tracking-wide{--tw-tracking:var(--tracking-wide);letter-spacing:var(--tracking-wide)}.tracking-wider{--tw-tracking:var(--tracking-wider);letter-spacing:var(--tracking-wider)}.tracking-widest{--tw-tracking:var(--tracking-widest);letter-spacing:var(--tracking-widest)}.break-words{overflow-wrap:break-word}.break-all{word-break:break-all}.text-ellipsis{text-overflow:ellipsis}.whitespace-nowrap{white-space:nowrap}.whitespace-pre-wrap{white-space:pre-wrap}.text-\[var\(--text-muted\)\]{color:var(--text-muted)}.text-\[var\(--text-primary\)\]{color:var(--text-primary)}.normal-case{text-transform:none}.uppercase{text-transform:uppercase}.italic{font-style:italic}.tabular-nums{--tw-numeric-spacing:tabular-nums;font-variant-numeric:var(--tw-ordinal,)var(--tw-slashed-zero,)var(--tw-numeric-figure,)var(--tw-numeric-spacing,)var(--tw-numeric-fraction,)}.line-through{text-decoration-line:line-through}.no-underline{text-decoration-line:none}.underline{text-decoration-line:underline}.accent-\[var\(--accent\)\]{accent-color:var(--accent)}.opacity-0{opacity:0}.opacity-40{opacity:.4}.opacity-60{opacity:.6}.opacity-70{opacity:.7}.opacity-80{opacity:.8}.shadow-lg{--tw-shadow:0 10px 15px -3px var(--tw-shadow-color,#0000001a),0 4px 6px -4px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-xl{--tw-shadow:0 20px 25px -5px var(--tw-shadow-color,#0000001a),0 8px 10px -6px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.transition{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to,opacity,box-shadow,transform,translate,scale,rotate,filter,-webkit-backdrop-filter,backdrop-filter,display,content-visibility,overlay,pointer-events;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-\[width\]{transition-property:width;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-all{transition-property:all;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-colors{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-opacity{transition-property:opacity;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-transform{transition-property:transform,translate,scale,rotate;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.duration-200{--tw-duration:.2s;transition-duration:.2s}.ease-in-out{--tw-ease:var(--ease-in-out);transition-timing-function:var(--ease-in-out)}.outline-none{--tw-outline-style:none;outline-style:none}@media(hover:hover){.group-hover\:opacity-100:is(:where(.group):hover *){opacity:1}}.placeholder\:text-\[var\(--text-muted\)\]::placeholder{color:var(--text-muted)}@media(hover:hover){.hover\:bg-\[var\(--bg-hover\)\]:hover{background-color:var(--bg-hover)}.hover\:opacity-80:hover{opacity:.8}.hover\:opacity-100:hover{opacity:1}.hover\:brightness-125:hover{--tw-brightness:brightness(125%);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,)}}.focus\:opacity-100:focus{opacity:1}.focus\:outline-none:focus{--tw-outline-style:none;outline-style:none}.disabled\:cursor-not-allowed:disabled{cursor:not-allowed}.disabled\:opacity-30:disabled{opacity:.3}.disabled\:opacity-40:disabled{opacity:.4}.disabled\:opacity-50:disabled{opacity:.5}}pre code.hljs{padding:1em;display:block;overflow-x:auto}code.hljs{padding:3px 5px}.hljs{color:#c9d1d9;background:#0d1117}.hljs-doctag,.hljs-keyword,.hljs-meta .hljs-keyword,.hljs-template-tag,.hljs-template-variable,.hljs-type,.hljs-variable.language_{color:#ff7b72}.hljs-title,.hljs-title.class_,.hljs-title.class_.inherited__,.hljs-title.function_{color:#d2a8ff}.hljs-attr,.hljs-attribute,.hljs-literal,.hljs-meta,.hljs-number,.hljs-operator,.hljs-variable,.hljs-selector-attr,.hljs-selector-class,.hljs-selector-id{color:#79c0ff}.hljs-regexp,.hljs-string,.hljs-meta .hljs-string{color:#a5d6ff}.hljs-built_in,.hljs-symbol{color:#ffa657}.hljs-comment,.hljs-code,.hljs-formula{color:#8b949e}.hljs-name,.hljs-quote,.hljs-selector-tag,.hljs-selector-pseudo{color:#7ee787}.hljs-subst{color:#c9d1d9}.hljs-section{color:#1f6feb;font-weight:700}.hljs-bullet{color:#f2cc60}.hljs-emphasis{color:#c9d1d9;font-style:italic}.hljs-strong{color:#c9d1d9;font-weight:700}.hljs-addition{color:#aff5b4;background-color:#033a16}.hljs-deletion{color:#ffdcd7;background-color:#67060c}:root,[data-theme=dark]{--bg-primary:#0f172a;--bg-secondary:#1e293b;--bg-tertiary:#334155;--bg-hover:#263348;--bg-elevated:#253041;--text-primary:#cbd5e1;--text-secondary:#94a3b8;--text-muted:#64748b;--border:#334155;--accent:#fa4616;--accent-hover:#e03d12;--accent-light:#ff6a3d;--success:#22c55e;--warning:#eab308;--error:#ef4444;--info:#3b82f6;--sidebar-bg:#0e1526;--activity-bar-bg:#0a1020;--card-bg:#1e293b;--input-bg:#0f172a;--code-bg:#0f172a;--tab-active:#fa4616;--tab-text:#94a3b8;--tab-text-active:#fa4616;--node-bg:#1e293b;--node-border:#475569;--scrollbar-thumb:#334155;color-scheme:dark}[data-theme=light]{--bg-primary:#f8fafc;--bg-secondary:#fff;--bg-tertiary:#cbd5e1;--bg-hover:#f1f5f9;--bg-elevated:#fff;--text-primary:#0f172a;--text-secondary:#475569;--text-muted:#94a3b8;--border:#e2e8f0;--accent:#fa4616;--accent-hover:#e03d12;--accent-light:#ff6a3d;--success:#22c55e;--warning:#ca8a04;--error:#ef4444;--info:#2563eb;--sidebar-bg:#fff;--activity-bar-bg:#f1f5f9;--card-bg:#fff;--input-bg:#f8fafc;--code-bg:#e8ecf1;--tab-active:#fa4616;--tab-text:#64748b;--tab-text-active:#fa4616;--node-bg:#fff;--node-border:#cbd5e1;--scrollbar-thumb:#d1d5db;color-scheme:light}body{background:var(--bg-primary);color:var(--text-primary);margin:0;font-family:Inter,system-ui,-apple-system,sans-serif;transition:background-color .2s,color .2s}#root{height:100dvh;display:flex}:focus-visible{outline:2px solid var(--accent);outline-offset:1px}button:focus-visible,[role=button]:focus-visible,input:focus-visible,textarea:focus-visible,select:focus-visible{outline:2px solid var(--accent)}@supports (color:color-mix(in lab,red,red)){button:focus-visible,[role=button]:focus-visible,input:focus-visible,textarea:focus-visible,select:focus-visible{outline:2px solid color-mix(in srgb,var(--accent)60%,transparent)}}button:focus-visible,[role=button]:focus-visible,input:focus-visible,textarea:focus-visible,select:focus-visible{outline-offset:0px;border-radius:3px}.drag-handle-row{cursor:row-resize;background:var(--border);height:3px;transition:background .15s;position:relative}.drag-handle-row:before{content:"";position:absolute;top:-5px;right:0;bottom:-5px;left:0}.drag-handle-row:hover,.drag-handle-row:active{background:var(--accent)}.drag-handle-col{cursor:col-resize;background:var(--border);width:3px;transition:background .15s;position:relative}.drag-handle-col:before{content:"";position:absolute;top:0;right:-5px;bottom:0;left:-5px}.drag-handle-col:hover,.drag-handle-col:active{background:var(--accent)}@keyframes skeleton-pulse{0%,to{opacity:.4}50%{opacity:.7}}.skeleton{background:var(--bg-tertiary);border-radius:4px;animation:1.5s ease-in-out infinite skeleton-pulse}.react-flow__node{font-size:12px}.react-flow__node-default{background:var(--node-bg)!important;color:var(--text-primary)!important;border-color:var(--node-border)!important}.react-flow__background{background:var(--bg-primary)!important}.react-flow__controls button{background:var(--bg-secondary)!important;color:var(--text-primary)!important;border-color:var(--border)!important}.react-flow__controls button:hover{background:var(--bg-hover)!important}.react-flow__controls button svg{fill:var(--text-primary)!important}::-webkit-scrollbar{width:6px;height:6px}::-webkit-scrollbar-track{background:var(--bg-secondary)}::-webkit-scrollbar-thumb{background:var(--scrollbar-thumb);border-radius:3px}select{-webkit-appearance:auto;-moz-appearance:auto;appearance:auto}select option{background:var(--bg-secondary);color:var(--text-primary)}.chat-markdown p{margin:.25em 0}.chat-markdown p:first-child{margin-top:0}.chat-markdown p:last-child{margin-bottom:0}.chat-markdown code{background:var(--code-bg);border:1px solid var(--border);border-radius:3px;padding:.1em .35em;font-size:.85em}.chat-markdown pre{background:var(--code-bg);border:1px solid var(--border);border-radius:6px;margin:.5em 0;padding:.75em;overflow-x:auto}.chat-markdown pre code{background:0 0;border:none;padding:0;font-size:.85em}.chat-markdown ul,.chat-markdown ol{margin:.25em 0;padding-left:1.5em}.chat-markdown li{margin:.1em 0}.chat-markdown h1,.chat-markdown h2,.chat-markdown h3{margin:.5em 0 .25em;font-weight:600}.chat-markdown h1{font-size:1.2em}.chat-markdown h2{font-size:1.1em}.chat-markdown h3{font-size:1em}.chat-markdown blockquote{border-left:3px solid var(--border);color:var(--text-secondary);margin:.25em 0;padding-left:.75em}.chat-markdown strong{font-weight:600}.chat-markdown a{color:var(--accent);text-decoration:underline}.chat-markdown table{border-collapse:collapse;width:100%;margin:.5em 0}.chat-markdown th,.chat-markdown td{border:1px solid var(--border);text-align:left;padding:.3em .6em}.chat-markdown th{background:var(--code-bg);font-weight:600}.chat-markdown tr:nth-child(2n){background:var(--code-bg)}.chat-markdown .hljs{background:0 0}[data-theme=light] .chat-markdown .hljs{color:#24292e}[data-theme=light] .chat-markdown .hljs-doctag,[data-theme=light] .chat-markdown .hljs-keyword,[data-theme=light] .chat-markdown .hljs-meta .hljs-keyword,[data-theme=light] .chat-markdown .hljs-template-tag,[data-theme=light] .chat-markdown .hljs-template-variable,[data-theme=light] .chat-markdown .hljs-type,[data-theme=light] .chat-markdown .hljs-variable.language_{color:#d73a49}[data-theme=light] .chat-markdown .hljs-title,[data-theme=light] .chat-markdown .hljs-title.class_,[data-theme=light] .chat-markdown .hljs-title.class_.inherited__,[data-theme=light] .chat-markdown .hljs-title.function_{color:#6f42c1}[data-theme=light] .chat-markdown .hljs-attr,[data-theme=light] .chat-markdown .hljs-attribute,[data-theme=light] .chat-markdown .hljs-literal,[data-theme=light] .chat-markdown .hljs-meta,[data-theme=light] .chat-markdown .hljs-number,[data-theme=light] .chat-markdown .hljs-operator,[data-theme=light] .chat-markdown .hljs-variable,[data-theme=light] .chat-markdown .hljs-selector-attr,[data-theme=light] .chat-markdown .hljs-selector-class,[data-theme=light] .chat-markdown .hljs-selector-id{color:#005cc5}[data-theme=light] .chat-markdown .hljs-regexp,[data-theme=light] .chat-markdown .hljs-string,[data-theme=light] .chat-markdown .hljs-meta .hljs-string{color:#032f62}[data-theme=light] .chat-markdown .hljs-built_in,[data-theme=light] .chat-markdown .hljs-symbol{color:#e36209}[data-theme=light] .chat-markdown .hljs-comment,[data-theme=light] .chat-markdown .hljs-code,[data-theme=light] .chat-markdown .hljs-formula{color:#6a737d}[data-theme=light] .chat-markdown .hljs-name,[data-theme=light] .chat-markdown .hljs-quote,[data-theme=light] .chat-markdown .hljs-selector-tag,[data-theme=light] .chat-markdown .hljs-selector-pseudo{color:#22863a}[data-theme=light] .chat-markdown .hljs-subst{color:#24292e}[data-theme=light] .chat-markdown .hljs-section{color:#005cc5}[data-theme=light] .chat-markdown .hljs-bullet{color:#735c0f}[data-theme=light] .chat-markdown .hljs-addition{color:#22863a;background-color:#f0fff4}[data-theme=light] .chat-markdown .hljs-deletion{color:#b31d28;background-color:#ffeef0}@keyframes agent-changed-pulse{0%,to{box-shadow:inset 0 0 0 50px color-mix(in srgb,var(--success)20%,transparent)}50%{box-shadow:none}}.agent-changed-file{animation:2s ease-in-out 3 agent-changed-pulse}@property --tw-translate-x{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-y{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-z{syntax:"*";inherits:false;initial-value:0}@property --tw-rotate-x{syntax:"*";inherits:false}@property --tw-rotate-y{syntax:"*";inherits:false}@property --tw-rotate-z{syntax:"*";inherits:false}@property --tw-skew-x{syntax:"*";inherits:false}@property --tw-skew-y{syntax:"*";inherits:false}@property --tw-space-y-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-border-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-leading{syntax:"*";inherits:false}@property --tw-font-weight{syntax:"*";inherits:false}@property --tw-tracking{syntax:"*";inherits:false}@property --tw-ordinal{syntax:"*";inherits:false}@property --tw-slashed-zero{syntax:"*";inherits:false}@property --tw-numeric-figure{syntax:"*";inherits:false}@property --tw-numeric-spacing{syntax:"*";inherits:false}@property --tw-numeric-fraction{syntax:"*";inherits:false}@property --tw-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-shadow-color{syntax:"*";inherits:false}@property --tw-shadow-alpha{syntax:"";inherits:false;initial-value:100%}@property --tw-inset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-shadow-color{syntax:"*";inherits:false}@property --tw-inset-shadow-alpha{syntax:"";inherits:false;initial-value:100%}@property --tw-ring-color{syntax:"*";inherits:false}@property --tw-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-ring-color{syntax:"*";inherits:false}@property --tw-inset-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-ring-inset{syntax:"*";inherits:false}@property --tw-ring-offset-width{syntax:"";inherits:false;initial-value:0}@property --tw-ring-offset-color{syntax:"*";inherits:false;initial-value:#fff}@property --tw-ring-offset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-duration{syntax:"*";inherits:false}@property --tw-ease{syntax:"*";inherits:false}@property --tw-blur{syntax:"*";inherits:false}@property --tw-brightness{syntax:"*";inherits:false}@property --tw-contrast{syntax:"*";inherits:false}@property --tw-grayscale{syntax:"*";inherits:false}@property --tw-hue-rotate{syntax:"*";inherits:false}@property --tw-invert{syntax:"*";inherits:false}@property --tw-opacity{syntax:"*";inherits:false}@property --tw-saturate{syntax:"*";inherits:false}@property --tw-sepia{syntax:"*";inherits:false}@property --tw-drop-shadow{syntax:"*";inherits:false}@property --tw-drop-shadow-color{syntax:"*";inherits:false}@property --tw-drop-shadow-alpha{syntax:"";inherits:false;initial-value:100%}@property --tw-drop-shadow-size{syntax:"*";inherits:false}@keyframes spin{to{transform:rotate(360deg)}}@keyframes pulse{50%{opacity:.5}} diff --git a/src/uipath/dev/server/static/index.html b/src/uipath/dev/server/static/index.html index 2460e24..04e5b77 100644 --- a/src/uipath/dev/server/static/index.html +++ b/src/uipath/dev/server/static/index.html @@ -5,11 +5,11 @@ UiPath Developer Console - + - +