Surf commited on
Commit
4249e47
·
1 Parent(s): 56c49e4

Clear tracked Space files before republishing

Browse files
This view is limited to 50 files because it contains too many changes.   See raw diff
Files changed (50) hide show
  1. .dockerignore +0 -9
  2. .gitignore +0 -7
  3. Dockerfile +0 -28
  4. README.md +0 -56
  5. bun.lock +0 -263
  6. frontend/.env.example +0 -3
  7. frontend/bun.lock +0 -0
  8. frontend/components.json +0 -21
  9. frontend/eslint.config.js +0 -42
  10. frontend/index.html +0 -77
  11. frontend/package.json +0 -83
  12. frontend/scripts/check-env.cjs +0 -51
  13. frontend/src/App.tsx +0 -345
  14. frontend/src/ErrorBoundary.tsx +0 -106
  15. frontend/src/components/CodeBadge.tsx +0 -85
  16. frontend/src/components/PostCard.tsx +0 -141
  17. frontend/src/components/SettingsPanel.tsx +0 -637
  18. frontend/src/components/ui/accordion.tsx +0 -55
  19. frontend/src/components/ui/alert.tsx +0 -59
  20. frontend/src/components/ui/aspect-ratio.tsx +0 -5
  21. frontend/src/components/ui/avatar.tsx +0 -48
  22. frontend/src/components/ui/badge.tsx +0 -36
  23. frontend/src/components/ui/breadcrumb.tsx +0 -115
  24. frontend/src/components/ui/button.tsx +0 -57
  25. frontend/src/components/ui/calendar.tsx +0 -211
  26. frontend/src/components/ui/card.tsx +0 -76
  27. frontend/src/components/ui/carousel.tsx +0 -262
  28. frontend/src/components/ui/checkbox.tsx +0 -30
  29. frontend/src/components/ui/collapsible.tsx +0 -9
  30. frontend/src/components/ui/command.tsx +0 -153
  31. frontend/src/components/ui/context-menu.tsx +0 -200
  32. frontend/src/components/ui/dialog.tsx +0 -120
  33. frontend/src/components/ui/drawer.tsx +0 -118
  34. frontend/src/components/ui/dropdown-menu.tsx +0 -201
  35. frontend/src/components/ui/form.tsx +0 -176
  36. frontend/src/components/ui/hover-card.tsx +0 -29
  37. frontend/src/components/ui/input.tsx +0 -22
  38. frontend/src/components/ui/label.tsx +0 -26
  39. frontend/src/components/ui/menubar.tsx +0 -256
  40. frontend/src/components/ui/navigation-menu.tsx +0 -128
  41. frontend/src/components/ui/popover.tsx +0 -33
  42. frontend/src/components/ui/progress.tsx +0 -26
  43. frontend/src/components/ui/radio-group.tsx +0 -42
  44. frontend/src/components/ui/resizable.tsx +0 -43
  45. frontend/src/components/ui/scroll-area.tsx +0 -46
  46. frontend/src/components/ui/select.tsx +0 -157
  47. frontend/src/components/ui/separator.tsx +0 -31
  48. frontend/src/components/ui/sheet.tsx +0 -140
  49. frontend/src/components/ui/skeleton.tsx +0 -15
  50. frontend/src/components/ui/slider.tsx +0 -26
.dockerignore DELETED
@@ -1,9 +0,0 @@
1
- node_modules
2
- **/node_modules
3
- public
4
- frontend/dist
5
- frontend/node_modules
6
- .vulcan
7
- .vulcan-error-reporter.js
8
- *.log
9
- .git
 
 
 
 
 
 
 
 
 
 
.gitignore DELETED
@@ -1,7 +0,0 @@
1
- node_modules
2
- **/node_modules
3
- public
4
- frontend/dist
5
- .vulcan
6
- *.log
7
- *.sqlite*
 
 
 
 
 
 
 
 
Dockerfile DELETED
@@ -1,28 +0,0 @@
1
- # Surf Mystery Box 赠链追踪 — Hugging Face Spaces image
2
- # Stage 1: build the Vite frontend
3
- FROM oven/bun:1-slim AS web
4
-
5
- WORKDIR /web
6
- COPY frontend/package.json frontend/bun.lock ./
7
- RUN bun install
8
-
9
- COPY frontend/ ./
10
- # Served from the domain root, so assets use relative paths.
11
- ENV BASE_PATH=""
12
- RUN bun run build:client
13
-
14
- # Stage 2: backend + API + static files on one port
15
- FROM oven/bun:1-slim
16
-
17
- WORKDIR /app
18
- ENV NODE_ENV=production \
19
- PORT=7860
20
-
21
- COPY package.json bun.lock ./
22
- RUN bun install --production
23
-
24
- COPY . .
25
- COPY --from=web /web/dist/client ./public
26
-
27
- EXPOSE 7860
28
- CMD ["bun", "server.js"]
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
README.md DELETED
@@ -1,56 +0,0 @@
1
- ---
2
- title: Surf Mystery Box Tracker
3
- emoji: 🎁
4
- colorFrom: purple
5
- colorTo: indigo
6
- sdk: docker
7
- app_port: 7860
8
- pinned: false
9
- ---
10
-
11
- # Surf 盲盒赠链雷达
12
-
13
- 这个工具会自动收集 X 和 Telegram 上分享的 `asksurf.ai/mystery-box/g/<赠链码>`,并持续检查每个赠链还剩几个名额。只要发现还有名额的赠链,就推送到企业微信群,每个赠链只推一次。
14
-
15
- ## 怎么工作
16
-
17
- | 来源 | 方式 | 频率 |
18
- | --- | --- | --- |
19
- | X | 登录后用 X 搜索(主关键词 + 轮换关键词) | 每分钟 |
20
- | X | 读取常发赠链的账号主页(不需要登录) | 每 3 分钟 |
21
- | Telegram | 登录账号后实时接收所有已加入群/频道的新消息 | 实时 |
22
- | Telegram | 补读「重点群」离线期间的消息 | 每 2 分钟 |
23
- | Telegram | 全局搜索 `asksurf`,用来兜底 | 每 3 分钟 |
24
- | 名额检查 | 新赠链立刻检查。有名额的每 90 秒复查一次,其他的每 15 分钟一次(持续 3 天) | — |
25
- | 推送 | 发现有名额立刻推送,每个赠链只推一次 | — |
26
-
27
- ## 数据
28
-
29
- - 数据保存在本地 SQLite,加密后备份到 HF 数据集 `Ethscriptions/cut-data`,文件名是 `db.v2.enc`。
30
- - 有新赠链或推送后,2 秒内备份;平时最多每 4 分钟备份一次;重启前也会先备份。
31
- - 第一次启动时,会自动导入旧版的 `snapshot.json`:包括帖子、赠链、推送记录、Telegram 登录、X Cookie 和企业微信地址。
32
-
33
- ## 需要的 Secrets
34
-
35
- - `HF_TOKEN`:读写备份数据集。
36
- - `SNAPSHOT_KEY`:备份加密密钥。
37
- - 可选:`ADMIN_KEY`(管理密码,也可以在页面里设置)、`WECOM_WEBHOOK`。
38
-
39
- 不再需要 `SURF_API_KEY`。
40
-
41
- ## 代码结构
42
-
43
- ```
44
- server.js 启动:恢复数据 → 启动各个循环 → 提供页面和接口
45
- routes/api.js 接口
46
- lib/db.js SQLite
47
- lib/backup.js 加密备份 / 恢复 / 导入旧数据
48
- lib/detect.js 识别赠链和相关内容
49
- lib/pipeline.js 收录帖子(去重)
50
- lib/invites.js 检查名额
51
- lib/alerts.js 企业微信推送(每个赠链只推一次)
52
- lib/x/* X 搜索、主页、单条推文
53
- lib/tg/* Telegram 实时接收、补读、全局搜索、登录
54
- lib/scheduler.js 定时循环
55
- frontend/ 页面(Vite + React)
56
- ```
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
bun.lock DELETED
@@ -1,263 +0,0 @@
1
- {
2
- "lockfileVersion": 1,
3
- "configVersion": 1,
4
- "workspaces": {
5
- "": {
6
- "name": "backend",
7
- "dependencies": {
8
- "@huggingface/hub": "^2.17.10",
9
- "express": "4.22.1",
10
- "telegram": "^2.26.22",
11
- },
12
- },
13
- },
14
- "packages": {
15
- "@cryptography/aes": ["@cryptography/aes@0.1.1", "", {}, "sha512-PcYz4FDGblO6tM2kSC+VzhhK62vml6k6/YAkiWtyPvrgJVfnDRoHGDtKn5UiaRRUrvUTTocBpvc2rRgTCqxjsg=="],
16
-
17
- "@huggingface/blake3-jit": ["@huggingface/blake3-jit@0.0.2", "", {}, "sha512-Bq7B5qabyjrJfhBsl85Jd2QBtf+HzRD7h7A9GfN2lzrrsABhOa5evVPgzoCTxR7Ub0QFj7YDK1YkYRWBU25+2w=="],
18
-
19
- "@huggingface/hub": ["@huggingface/hub@2.17.10", "", { "dependencies": { "@huggingface/tasks": "^0.22.1", "@huggingface/xetchunk-wasm": "^0.2.0" }, "optionalDependencies": { "cli-progress": "^3.12.0" }, "bin": { "hfjs": "dist/cli.js" } }, "sha512-+2W2KKBMEMmfgFEgaWknCytsCQlyQ9Xpghv9BN5qOqkjb0l5f6mVhXBNyAVOmt/Gjny4I3Cb1ZKaUv28+0+17A=="],
20
-
21
- "@huggingface/tasks": ["@huggingface/tasks@0.22.2", "", {}, "sha512-m+LqKsOQPlG3UYolaQo9q154VlCV9cE26GL2bdqkhNVOeeeQYCzqZG7C9JvVl6+rwgupvmFIFxPrkTDbFp8U9w=="],
22
-
23
- "@huggingface/xetchunk-wasm": ["@huggingface/xetchunk-wasm@0.2.0", "", { "dependencies": { "@huggingface/blake3-jit": "0.0.2", "gearhash-jit": "1.0.2" } }, "sha512-cmp7oAAWeCpZGrVQTP/LxDtJdzGMfpxwkEVsZsk5jZQ2FwP2njm8LnyobhnQvLpkSAcJJwUzFJC0PYS9ZsqeTg=="],
24
-
25
- "accepts": ["accepts@1.3.8", "", { "dependencies": { "mime-types": "~2.1.34", "negotiator": "0.6.3" } }, "sha512-PYAthTa2m2VKxuvSD3DPC/Gy+U+sOA1LAuT8mkmRuvw+NACSaeXEQ+NHcVF7rONl6qcaxV3Uuemwawk+7+SJLw=="],
26
-
27
- "ansi-regex": ["ansi-regex@5.0.1", "", {}, "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ=="],
28
-
29
- "array-flatten": ["array-flatten@1.1.1", "", {}, "sha512-PCVAQswWemu6UdxsDFFX/+gVeYqKAod3D3UVm91jHwynguOwAvYPhx8nNlM++NqRcK6CxxpUafjmhIdKiHibqg=="],
30
-
31
- "async-mutex": ["async-mutex@0.3.2", "", { "dependencies": { "tslib": "^2.3.1" } }, "sha512-HuTK7E7MT7jZEh1P9GtRW9+aTWiDWWi9InbZ5hjxrnRa39KS4BW04+xLBhYNS2aXhHUIKZSw3gj4Pn1pj+qGAA=="],
32
-
33
- "base64-js": ["base64-js@1.5.1", "", {}, "sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA=="],
34
-
35
- "big-integer": ["big-integer@1.6.52", "", {}, "sha512-QxD8cf2eVqJOOz63z6JIN9BzvVs/dlySa5HGSBH5xtR8dPteIRQnBxxKqkNTiT6jbDTF6jAfrd4oMcND9RGbQg=="],
36
-
37
- "body-parser": ["body-parser@1.20.8", "", { "dependencies": { "bytes": "~3.1.2", "content-type": "~1.0.5", "debug": "2.6.9", "depd": "2.0.0", "destroy": "~1.2.0", "http-errors": "~2.0.1", "iconv-lite": "~0.4.24", "on-finished": "~2.4.1", "qs": "~6.16.0", "raw-body": "~2.5.3", "type-is": "~1.6.18", "unpipe": "~1.0.0" } }, "sha512-JNcyFQ64OiijEkPzUBTCe+hyPXUD/3LEldGQ6iF5LR1w00mx9o7xtDWHXBY2iItjdCFGoilOLNQbH943ut7pHA=="],
38
-
39
- "buffer": ["buffer@6.0.3", "", { "dependencies": { "base64-js": "^1.3.1", "ieee754": "^1.2.1" } }, "sha512-FTiCpNxtwiZZHEZbcbTIcZjERVICn9yq/pDFkTl95/AxzD1naBctN7YO68riM/gLSDY7sdrMby8hofADYuuqOA=="],
40
-
41
- "bufferutil": ["bufferutil@4.1.0", "", { "dependencies": { "node-gyp-build": "^4.3.0" } }, "sha512-ZMANVnAixE6AWWnPzlW2KpUrxhm9woycYvPOo67jWHyFowASTEd9s+QN1EIMsSDtwhIxN4sWE1jotpuDUIgyIw=="],
42
-
43
- "bytes": ["bytes@3.1.2", "", {}, "sha512-/Nf7TyzTx6S3yRJObOAV7956r8cr2+Oj8AC5dt8wSP3BQAoeX58NoHyCU8P8zGkNXStjTSi6fzO6F0pBdcYbEg=="],
44
-
45
- "call-bind-apply-helpers": ["call-bind-apply-helpers@1.0.2", "", { "dependencies": { "es-errors": "^1.3.0", "function-bind": "^1.1.2" } }, "sha512-Sp1ablJ0ivDkSzjcaJdxEunN5/XvksFJ2sMBFfq6x0ryhQV/2b/KwFe21cMpmHtPOSij8K99/wSfoEuTObmuMQ=="],
46
-
47
- "call-bound": ["call-bound@1.0.4", "", { "dependencies": { "call-bind-apply-helpers": "^1.0.2", "get-intrinsic": "^1.3.0" } }, "sha512-+ys997U96po4Kx/ABpBCqhA9EuxJaQWDQg7295H4hBphv3IZg0boBKuwYpt4YXp6MZ5AmZQnU/tyMTlRpaSejg=="],
48
-
49
- "cli-progress": ["cli-progress@3.12.0", "", { "dependencies": { "string-width": "^4.2.3" } }, "sha512-tRkV3HJ1ASwm19THiiLIXLO7Im7wlTuKnvkYaTkyoAPefqjNg7W7DHKUlGRxy9vxDvbyCYQkQozvptuMkGCg8A=="],
50
-
51
- "content-disposition": ["content-disposition@0.5.4", "", { "dependencies": { "safe-buffer": "5.2.1" } }, "sha512-FveZTNuGw04cxlAiWbzi6zTAL/lhehaWbTtgluJh4/E95DqMwTmha3KZN1aAWA8cFIhHzMZUvLevkw5Rqk+tSQ=="],
52
-
53
- "content-type": ["content-type@1.0.5", "", {}, "sha512-nTjqfcBFEipKdXCv4YDQWCfmcLZKm81ldF0pAopTvyrFGVbcR6P/VAAd5G7N+0tTr8QqiU0tFadD6FK4NtJwOA=="],
54
-
55
- "cookie": ["cookie@0.7.2", "", {}, "sha512-yki5XnKuf750l50uGTllt6kKILY4nQ1eNIQatoXEByZ5dWgnKqbnqmTrBE5B4N7lrMJKQ2ytWMiTO2o0v6Ew/w=="],
56
-
57
- "cookie-signature": ["cookie-signature@1.0.7", "", {}, "sha512-NXdYc3dLr47pBkpUCHtKSwIOQXLVn8dZEuywboCOJY/osA0wFSLlSawr3KN8qXJEyX66FcONTH8EIlVuK0yyFA=="],
58
-
59
- "d": ["d@1.0.2", "", { "dependencies": { "es5-ext": "^0.10.64", "type": "^2.7.2" } }, "sha512-MOqHvMWF9/9MX6nza0KgvFH4HpMU0EF5uUDXqX/BtxtU8NfB0QzRtJ8Oe/6SuS4kbhyzVJwjd97EA4PKrzJ8bw=="],
60
-
61
- "debug": ["debug@2.6.9", "", { "dependencies": { "ms": "2.0.0" } }, "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA=="],
62
-
63
- "depd": ["depd@2.0.0", "", {}, "sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw=="],
64
-
65
- "destroy": ["destroy@1.2.0", "", {}, "sha512-2sJGJTaXIIaR1w4iJSNoN0hnMY7Gpc/n8D4qSCJw8QqFWXf7cuAgnEHxBpweaVcPevC2l3KpjYCx3NypQQgaJg=="],
66
-
67
- "dom-serializer": ["dom-serializer@1.4.1", "", { "dependencies": { "domelementtype": "^2.0.1", "domhandler": "^4.2.0", "entities": "^2.0.0" } }, "sha512-VHwB3KfrcOOkelEG2ZOfxqLZdfkil8PtJi4P8N2MMXucZq2yLp75ClViUlOVwyoHEDjYU433Aq+5zWP61+RGag=="],
68
-
69
- "domelementtype": ["domelementtype@2.3.0", "", {}, "sha512-OLETBj6w0OsagBwdXnPdN0cnMfF9opN69co+7ZrbfPGrdpPVNBUj02spi6B1N7wChLQiPn4CSH/zJvXw56gmHw=="],
70
-
71
- "domhandler": ["domhandler@4.3.1", "", { "dependencies": { "domelementtype": "^2.2.0" } }, "sha512-GrwoxYN+uWlzO8uhUXRl0P+kHE4GtVPfYzVLcUxPL7KNdHKj66vvlhiweIHqYYXWlw+T8iLMp42Lm67ghw4WMQ=="],
72
-
73
- "domutils": ["domutils@2.8.0", "", { "dependencies": { "dom-serializer": "^1.0.1", "domelementtype": "^2.2.0", "domhandler": "^4.2.0" } }, "sha512-w96Cjofp72M5IIhpjgobBimYEfoPjx1Vx0BSX9P30WBdZW2WIKU0T1Bd0kz2eNZ9ikjKgHbEyKx8BB6H1L3h3A=="],
74
-
75
- "dunder-proto": ["dunder-proto@1.0.1", "", { "dependencies": { "call-bind-apply-helpers": "^1.0.1", "es-errors": "^1.3.0", "gopd": "^1.2.0" } }, "sha512-KIN/nDJBQRcXw0MLVhZE9iQHmG68qAVIBg9CqmUYjmQIhgij9U5MFvrqkUL5FbtyyzZuOeOt0zdeRe4UY7ct+A=="],
76
-
77
- "ee-first": ["ee-first@1.1.1", "", {}, "sha512-WMwm9LhRUo+WUaRN+vRuETqG89IgZphVSNkdFgeb6sS/E4OrDIN7t48CAewSHXc6C8lefD8KKfr5vY61brQlow=="],
78
-
79
- "emoji-regex": ["emoji-regex@8.0.0", "", {}, "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A=="],
80
-
81
- "encodeurl": ["encodeurl@2.0.0", "", {}, "sha512-Q0n9HRi4m6JuGIV1eFlmvJB7ZEVxu93IrMyiMsGC0lrMJMWzRgx6WGquyfQgZVb31vhGgXnfmPNNXmxnOkRBrg=="],
82
-
83
- "entities": ["entities@2.2.0", "", {}, "sha512-p92if5Nz619I0w+akJrLZH0MX0Pb5DX39XOwQTtXSdQQOaYH03S1uIQp4mhOZtAXrxq4ViO67YTiLBo2638o9A=="],
84
-
85
- "es-define-property": ["es-define-property@1.0.1", "", {}, "sha512-e3nRfgfUZ4rNGL232gUgX06QNyyez04KdjFrF+LTRoOXmrOgFKDg4BCdsjW8EnT69eqdYGmRpJwiPVYNrCaW3g=="],
86
-
87
- "es-errors": ["es-errors@1.3.0", "", {}, "sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw=="],
88
-
89
- "es-object-atoms": ["es-object-atoms@1.1.2", "", { "dependencies": { "es-errors": "^1.3.0" } }, "sha512-HWcBoN6NileqtSydK2FqHbS/LoDd2pqrnQHLyJzBj4kOp/ky2MWMN694xOfkK8/SnUsW2DH7EfyVlydKCsm1Zw=="],
90
-
91
- "es5-ext": ["es5-ext@0.10.64", "", { "dependencies": { "es6-iterator": "^2.0.3", "es6-symbol": "^3.1.3", "esniff": "^2.0.1", "next-tick": "^1.1.0" } }, "sha512-p2snDhiLaXe6dahss1LddxqEm+SkuDvV8dnIQG0MWjyHpcMNfXKPE+/Cc0y+PhxJX3A4xGNeFCj5oc0BUh6deg=="],
92
-
93
- "es6-iterator": ["es6-iterator@2.0.3", "", { "dependencies": { "d": "1", "es5-ext": "^0.10.35", "es6-symbol": "^3.1.1" } }, "sha512-zw4SRzoUkd+cl+ZoE15A9o1oQd920Bb0iOJMQkQhl3jNc03YqVjAhG7scf9C5KWRU/R13Orf588uCC6525o02g=="],
94
-
95
- "es6-symbol": ["es6-symbol@3.1.4", "", { "dependencies": { "d": "^1.0.2", "ext": "^1.7.0" } }, "sha512-U9bFFjX8tFiATgtkJ1zg25+KviIXpgRvRHS8sau3GfhVzThRQrOeksPeT0BWW2MNZs1OEWJ1DPXOQMn0KKRkvg=="],
96
-
97
- "escape-html": ["escape-html@1.0.3", "", {}, "sha512-NiSupZ4OeuGwr68lGIeym/ksIZMJodUGOSCZ/FSnTxcrekbvqrgdUxlJOMpijaKZVjAJrWrGs/6Jy8OMuyj9ow=="],
98
-
99
- "esniff": ["esniff@2.0.1", "", { "dependencies": { "d": "^1.0.1", "es5-ext": "^0.10.62", "event-emitter": "^0.3.5", "type": "^2.7.2" } }, "sha512-kTUIGKQ/mDPFoJ0oVfcmyJn4iBDRptjNVIzwIFR7tqWXdVI9xfA2RMwY/gbSpJG3lkdWNEjLap/NqVHZiJsdfg=="],
100
-
101
- "etag": ["etag@1.8.1", "", {}, "sha512-aIL5Fx7mawVa300al2BnEE4iNvo1qETxLrPI/o05L7z6go7fCw1J6EQmbK4FmJ2AS7kgVF/KEZWufBfdClMcPg=="],
102
-
103
- "event-emitter": ["event-emitter@0.3.5", "", { "dependencies": { "d": "1", "es5-ext": "~0.10.14" } }, "sha512-D9rRn9y7kLPnJ+hMq7S/nhvoKwwvVJahBi2BPmx3bvbsEdK3W9ii8cBSGjP+72/LnM4n6fo3+dkCX5FeTQruXA=="],
104
-
105
- "express": ["express@4.22.1", "", { "dependencies": { "accepts": "~1.3.8", "array-flatten": "1.1.1", "body-parser": "~1.20.3", "content-disposition": "~0.5.4", "content-type": "~1.0.4", "cookie": "~0.7.1", "cookie-signature": "~1.0.6", "debug": "2.6.9", "depd": "2.0.0", "encodeurl": "~2.0.0", "escape-html": "~1.0.3", "etag": "~1.8.1", "finalhandler": "~1.3.1", "fresh": "~0.5.2", "http-errors": "~2.0.0", "merge-descriptors": "1.0.3", "methods": "~1.1.2", "on-finished": "~2.4.1", "parseurl": "~1.3.3", "path-to-regexp": "~0.1.12", "proxy-addr": "~2.0.7", "qs": "~6.14.0", "range-parser": "~1.2.1", "safe-buffer": "5.2.1", "send": "~0.19.0", "serve-static": "~1.16.2", "setprototypeof": "1.2.0", "statuses": "~2.0.1", "type-is": "~1.6.18", "utils-merge": "1.0.1", "vary": "~1.1.2" } }, "sha512-F2X8g9P1X7uCPZMA3MVf9wcTqlyNp7IhH5qPCI0izhaOIYXaW9L535tGA3qmjRzpH+bZczqq7hVKxTR4NWnu+g=="],
106
-
107
- "ext": ["ext@1.7.0", "", { "dependencies": { "type": "^2.7.2" } }, "sha512-6hxeJYaL110a9b5TEJSj0gojyHQAmA2ch5Os+ySCiA1QGdS697XWY1pzsrSjqA9LDEEgdB/KypIlR59RcLuHYw=="],
108
-
109
- "finalhandler": ["finalhandler@1.3.2", "", { "dependencies": { "debug": "2.6.9", "encodeurl": "~2.0.0", "escape-html": "~1.0.3", "on-finished": "~2.4.1", "parseurl": "~1.3.3", "statuses": "~2.0.2", "unpipe": "~1.0.0" } }, "sha512-aA4RyPcd3badbdABGDuTXCMTtOneUCAYH/gxoYRTZlIJdF0YPWuGqiAsIrhNnnqdXGswYk6dGujem4w80UJFhg=="],
110
-
111
- "forwarded": ["forwarded@0.2.0", "", {}, "sha512-buRG0fpBtRHSTCOASe6hD258tEubFoRLb4ZNA6NxMVHNw2gOcwHo9wyablzMzOA5z9xA9L1KNjk/Nt6MT9aYow=="],
112
-
113
- "fresh": ["fresh@0.5.2", "", {}, "sha512-zJ2mQYM18rEFOudeV4GShTGIQ7RbzA7ozbU9I/XBpm7kqgMywgmylMwXHxZJmkVoYkna9d2pVXVXPdYTP9ej8Q=="],
114
-
115
- "function-bind": ["function-bind@1.1.2", "", {}, "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA=="],
116
-
117
- "gearhash-jit": ["gearhash-jit@1.0.2", "", {}, "sha512-UhzJL4KXSdqAKepy/tZwmi2Rcy0YMmtiC4DQS4SURCuIWdh8ECZtnXK2ePRMLigfB61hRKdLK/Vgg2bSw73izQ=="],
118
-
119
- "get-intrinsic": ["get-intrinsic@1.3.0", "", { "dependencies": { "call-bind-apply-helpers": "^1.0.2", "es-define-property": "^1.0.1", "es-errors": "^1.3.0", "es-object-atoms": "^1.1.1", "function-bind": "^1.1.2", "get-proto": "^1.0.1", "gopd": "^1.2.0", "has-symbols": "^1.1.0", "hasown": "^2.0.2", "math-intrinsics": "^1.1.0" } }, "sha512-9fSjSaos/fRIVIp+xSJlE6lfwhES7LNtKaCBIamHsjr2na1BiABJPo0mOjjz8GJDURarmCPGqaiVg5mfjb98CQ=="],
120
-
121
- "get-proto": ["get-proto@1.0.1", "", { "dependencies": { "dunder-proto": "^1.0.1", "es-object-atoms": "^1.0.0" } }, "sha512-sTSfBjoXBp89JvIKIefqw7U2CCebsc74kiY6awiGogKtoSGbgjYE/G/+l9sF3MWFPNc9IcoOC4ODfKHfxFmp0g=="],
122
-
123
- "gopd": ["gopd@1.2.0", "", {}, "sha512-ZUKRh6/kUFoAiTAtTYPZJ3hw9wNxx+BIBOijnlG9PnrJsCcSjs1wyyD6vJpaYtgnzDrKYRSqf3OO6Rfa93xsRg=="],
124
-
125
- "graceful-fs": ["graceful-fs@4.2.11", "", {}, "sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ=="],
126
-
127
- "has-symbols": ["has-symbols@1.1.0", "", {}, "sha512-1cDNdwJ2Jaohmb3sg4OmKaMBwuC48sYni5HUw2DvsC8LjGTLK9h+eb1X6RyuOHe4hT0ULCW68iomhjUoKUqlPQ=="],
128
-
129
- "hasown": ["hasown@2.0.4", "", { "dependencies": { "function-bind": "^1.1.2" } }, "sha512-T2UbfbBEF32wiepXIsMlTW9+dDYC6wMh/t/vYA4tuOMKqWz/n3vr1NFSxQiyP+zk2mXsoMA/i/7qV6LKut1t1A=="],
130
-
131
- "htmlparser2": ["htmlparser2@6.1.0", "", { "dependencies": { "domelementtype": "^2.0.1", "domhandler": "^4.0.0", "domutils": "^2.5.2", "entities": "^2.0.0" } }, "sha512-gyyPk6rgonLFEDGoeRgQNaEUvdJ4ktTmmUh/h2t7s+M8oPpIPxgNACWa+6ESR57kXstwqPiCut0V8NRpcwgU7A=="],
132
-
133
- "http-errors": ["http-errors@2.0.1", "", { "dependencies": { "depd": "~2.0.0", "inherits": "~2.0.4", "setprototypeof": "~1.2.0", "statuses": "~2.0.2", "toidentifier": "~1.0.1" } }, "sha512-4FbRdAX+bSdmo4AUFuS0WNiPz8NgFt+r8ThgNWmlrjQjt1Q7ZR9+zTlce2859x4KSXrwIsaeTqDoKQmtP8pLmQ=="],
134
-
135
- "iconv-lite": ["iconv-lite@0.4.24", "", { "dependencies": { "safer-buffer": ">= 2.1.2 < 3" } }, "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA=="],
136
-
137
- "ieee754": ["ieee754@1.2.1", "", {}, "sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA=="],
138
-
139
- "imurmurhash": ["imurmurhash@0.1.4", "", {}, "sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA=="],
140
-
141
- "inherits": ["inherits@2.0.4", "", {}, "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ=="],
142
-
143
- "ip-address": ["ip-address@10.7.5", "", {}, "sha512-t2v0rkILYv9WXmSL7TpAaU3HXgaFYOPUcH3QHgwQ++gpJuH3bqyMy4Fvt/DJCTKwzH3Cf+bAp5W/mFL39KPLzA=="],
144
-
145
- "ipaddr.js": ["ipaddr.js@1.9.1", "", {}, "sha512-0KI/607xoxSToH7GjN1FfSbLoU0+btTicjsQSWQlh/hZykN8KpmMf7uYwPW3R+akZ6R/w18ZlXSHBYXiYUPO3g=="],
146
-
147
- "is-fullwidth-code-point": ["is-fullwidth-code-point@3.0.0", "", {}, "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg=="],
148
-
149
- "is-typedarray": ["is-typedarray@1.0.0", "", {}, "sha512-cyA56iCMHAh5CdzjJIa4aohJyeO1YbwLi3Jc35MmRU6poroFjIGZzUzupGiRPOjgHg9TLu43xbpwXk523fMxKA=="],
150
-
151
- "math-intrinsics": ["math-intrinsics@1.1.0", "", {}, "sha512-/IXtbwEk5HTPyEwyKX6hGkYXxM9nbj64B+ilVJnC/R6B0pH5G4V3b0pVbL7DBj4tkhBAppbQUlf6F6Xl9LHu1g=="],
152
-
153
- "media-typer": ["media-typer@0.3.0", "", {}, "sha512-dq+qelQ9akHpcOl/gUVRTxVIOkAJ1wR3QAvb4RsVjS8oVoFjDGTc679wJYmUmknUF5HwMLOgb5O+a3KxfWapPQ=="],
154
-
155
- "merge-descriptors": ["merge-descriptors@1.0.3", "", {}, "sha512-gaNvAS7TZ897/rVaZ0nMtAyxNyi/pdbjbAwUpFQpN70GqnVfOiXpeUUMKRBmzXaSQ8DdTX4/0ms62r2K+hE6mQ=="],
156
-
157
- "methods": ["methods@1.1.2", "", {}, "sha512-iclAHeNqNm68zFtnZ0e+1L2yUIdvzNoauKU4WBA3VvH/vPFieF7qfRlwUZU+DA9P9bPXIS90ulxoUoCH23sV2w=="],
158
-
159
- "mime": ["mime@3.0.0", "", { "bin": { "mime": "cli.js" } }, "sha512-jSCU7/VB1loIWBZe14aEYHU/+1UMEHoaO7qxCOVJOw9GgH72VAWppxNcjU+x9a2k3GSIBXNKxXQFqRvvZ7vr3A=="],
160
-
161
- "mime-db": ["mime-db@1.52.0", "", {}, "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg=="],
162
-
163
- "mime-types": ["mime-types@2.1.35", "", { "dependencies": { "mime-db": "1.52.0" } }, "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw=="],
164
-
165
- "ms": ["ms@2.0.0", "", {}, "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A=="],
166
-
167
- "negotiator": ["negotiator@0.6.3", "", {}, "sha512-+EUsqGPLsM+j/zdChZjsnX51g4XrHFOIXwfnCVPGlQk/k5giakcKsuxCObBRu6DSm9opw/O6slWbJdghQM4bBg=="],
168
-
169
- "next-tick": ["next-tick@1.1.0", "", {}, "sha512-CXdUiJembsNjuToQvxayPZF9Vqht7hewsvy2sOWafLvi2awflj9mOC6bHIg50orX8IJvWKY9wYQ/zB2kogPslQ=="],
170
-
171
- "node-gyp-build": ["node-gyp-build@4.8.4", "", { "bin": { "node-gyp-build": "bin.js", "node-gyp-build-optional": "optional.js", "node-gyp-build-test": "build-test.js" } }, "sha512-LA4ZjwlnUblHVgq0oBF3Jl/6h/Nvs5fzBLwdEF4nuxnFdsfajde4WfxtJr3CaiH+F6ewcIB/q4jQ4UzPyid+CQ=="],
172
-
173
- "node-localstorage": ["node-localstorage@2.2.1", "", { "dependencies": { "write-file-atomic": "^1.1.4" } }, "sha512-vv8fJuOUCCvSPjDjBLlMqYMHob4aGjkmrkaE42/mZr0VT+ZAU10jRF8oTnX9+pgU9/vYJ8P7YT3Vd6ajkmzSCw=="],
174
-
175
- "object-inspect": ["object-inspect@1.13.4", "", {}, "sha512-W67iLl4J2EXEGTbfeHCffrjDfitvLANg0UlX3wFUUSTx92KXRFegMHUVgSqE+wvhAbi4WqjGg9czysTV2Epbew=="],
176
-
177
- "on-finished": ["on-finished@2.4.1", "", { "dependencies": { "ee-first": "1.1.1" } }, "sha512-oVlzkg3ENAhCk2zdv7IJwd/QUD4z2RxRwpkcGY8psCVcCYZNq4wYnVWALHM+brtuJjePWiYF/ClmuDr8Ch5+kg=="],
178
-
179
- "pako": ["pako@2.2.0", "", {}, "sha512-zJq6RP/5q+TO2OpFV3FHzlPnFjmkb7Nc99a5SNjJE+uu/PkpChs+NIZSSzbBoD+6kjiISXjfYdwj1ZRQ81dz/w=="],
180
-
181
- "parseurl": ["parseurl@1.3.3", "", {}, "sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ=="],
182
-
183
- "path-browserify": ["path-browserify@1.0.1", "", {}, "sha512-b7uo2UCUOYZcnF/3ID0lulOJi/bafxa1xPe7ZPsammBSpjSWQkjNxlt635YGS2MiR9GjvuXCtz2emr3jbsz98g=="],
184
-
185
- "path-to-regexp": ["path-to-regexp@0.1.13", "", {}, "sha512-A/AGNMFN3c8bOlvV9RreMdrv7jsmF9XIfDeCd87+I8RNg6s78BhJxMu69NEMHBSJFxKidViTEdruRwEk/WIKqA=="],
186
-
187
- "proxy-addr": ["proxy-addr@2.0.8", "", { "dependencies": { "forwarded": "0.2.0", "ipaddr.js": "1.9.1" } }, "sha512-5nnx0yGyVUcY6t9RnWcARWtwT9F1D8O9rt08htPvnd49W1IgZtmLkhu9WfMzQj1cFxjHIO6connUNVW5k7AVyQ=="],
188
-
189
- "qs": ["qs@6.14.2", "", { "dependencies": { "side-channel": "^1.1.0" } }, "sha512-V/yCWTTF7VJ9hIh18Ugr2zhJMP01MY7c5kh4J870L7imm6/DIzBsNLTXzMwUA3yZ5b/KBqLx8Kp3uRvd7xSe3Q=="],
190
-
191
- "range-parser": ["range-parser@1.2.1", "", {}, "sha512-Hrgsx+orqoygnmhFbKaHE6c296J+HTAQXoxEF6gNupROmmGJRoyzfG3ccAveqCBrwr/2yxQ5BVd/GTl5agOwSg=="],
192
-
193
- "raw-body": ["raw-body@2.5.3", "", { "dependencies": { "bytes": "~3.1.2", "http-errors": "~2.0.1", "iconv-lite": "~0.4.24", "unpipe": "~1.0.0" } }, "sha512-s4VSOf6yN0rvbRZGxs8Om5CWj6seneMwK3oDb4lWDH0UPhWcxwOWw5+qk24bxq87szX1ydrwylIOp2uG1ojUpA=="],
194
-
195
- "real-cancellable-promise": ["real-cancellable-promise@1.2.3", "", {}, "sha512-hBI5Gy/55VEeeMtImMgEirD7eq5UmqJf1J8dFZtbJZA/3rB0pYFZ7PayMGueb6v4UtUtpKpP+05L0VwyE1hI9Q=="],
196
-
197
- "safe-buffer": ["safe-buffer@5.2.1", "", {}, "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ=="],
198
-
199
- "safer-buffer": ["safer-buffer@2.1.2", "", {}, "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg=="],
200
-
201
- "send": ["send@0.19.2", "", { "dependencies": { "debug": "2.6.9", "depd": "2.0.0", "destroy": "1.2.0", "encodeurl": "~2.0.0", "escape-html": "~1.0.3", "etag": "~1.8.1", "fresh": "~0.5.2", "http-errors": "~2.0.1", "mime": "1.6.0", "ms": "2.1.3", "on-finished": "~2.4.1", "range-parser": "~1.2.1", "statuses": "~2.0.2" } }, "sha512-VMbMxbDeehAxpOtWJXlcUS5E8iXh6QmN+BkRX1GARS3wRaXEEgzCcB10gTQazO42tpNIya8xIyNx8fll1OFPrg=="],
202
-
203
- "serve-static": ["serve-static@1.16.3", "", { "dependencies": { "encodeurl": "~2.0.0", "escape-html": "~1.0.3", "parseurl": "~1.3.3", "send": "~0.19.1" } }, "sha512-x0RTqQel6g5SY7Lg6ZreMmsOzncHFU7nhnRWkKgWuMTu5NN0DR5oruckMqRvacAN9d5w6ARnRBXl9xhDCgfMeA=="],
204
-
205
- "setprototypeof": ["setprototypeof@1.2.0", "", {}, "sha512-E5LDX7Wrp85Kil5bhZv46j8jOeboKq5JMmYM3gVGdGH8xFpPWXUMsNrlODCrkoxMEeNi/XZIwuRvY4XNwYMJpw=="],
206
-
207
- "side-channel": ["side-channel@1.1.1", "", { "dependencies": { "es-errors": "^1.3.0", "object-inspect": "^1.13.4", "side-channel-list": "^1.0.1", "side-channel-map": "^1.0.1", "side-channel-weakmap": "^1.0.2" } }, "sha512-6x6dK6zJdpTzF4sQeNYxwtvBzf6Eg4GtlesS94HOvTudUeyK2WXAaIfmDgsyslYrRBeFIlsi54AYsFGUuhmvrQ=="],
208
-
209
- "side-channel-list": ["side-channel-list@1.0.1", "", { "dependencies": { "es-errors": "^1.3.0", "object-inspect": "^1.13.4" } }, "sha512-mjn/0bi/oUURjc5Xl7IaWi/OJJJumuoJFQJfDDyO46+hBWsfaVM65TBHq2eoZBhzl9EchxOijpkbRC8SVBQU0w=="],
210
-
211
- "side-channel-map": ["side-channel-map@1.0.1", "", { "dependencies": { "call-bound": "^1.0.2", "es-errors": "^1.3.0", "get-intrinsic": "^1.2.5", "object-inspect": "^1.13.3" } }, "sha512-VCjCNfgMsby3tTdo02nbjtM/ewra6jPHmpThenkTYh8pG9ucZ/1P8So4u4FGBek/BjpOVsDCMoLA/iuBKIFXRA=="],
212
-
213
- "side-channel-weakmap": ["side-channel-weakmap@1.0.2", "", { "dependencies": { "call-bound": "^1.0.2", "es-errors": "^1.3.0", "get-intrinsic": "^1.2.5", "object-inspect": "^1.13.3", "side-channel-map": "^1.0.1" } }, "sha512-WPS/HvHQTYnHisLo9McqBHOJk2FkHO/tlpvldyrnem4aeQp4hai3gythswg6p01oSoTl58rcpiFAjF2br2Ak2A=="],
214
-
215
- "slide": ["slide@1.1.6", "", {}, "sha512-NwrtjCg+lZoqhFU8fOwl4ay2ei8PaqCBOUV3/ektPY9trO1yQ1oXEfmHAhKArUVUr/hOHvy5f6AdP17dCM0zMw=="],
216
-
217
- "smart-buffer": ["smart-buffer@4.2.0", "", {}, "sha512-94hK0Hh8rPqQl2xXc3HsaBoOXKV20MToPkcXvwbISWLEs+64sBq5kFgn2kJDHb1Pry9yrP0dxrCI9RRci7RXKg=="],
218
-
219
- "socks": ["socks@2.8.10", "", { "dependencies": { "ip-address": "^10.1.1", "smart-buffer": "^4.2.0" } }, "sha512-e0VyvkVTwVYViNovRkZ9aodhxVlyoMn7eJhVUPxZ+eK9P/7CBkxvvsBOHqFPEH416726W8tLXXXjKwqgTErrCQ=="],
220
-
221
- "statuses": ["statuses@2.0.2", "", {}, "sha512-DvEy55V3DB7uknRo+4iOGT5fP1slR8wQohVdknigZPMpMstaKJQWhwiYBACJE3Ul2pTnATihhBYnRhZQHGBiRw=="],
222
-
223
- "store2": ["store2@2.14.4", "", {}, "sha512-srTItn1GOvyvOycgxjAnPA63FZNwy0PTyUBFMHRM+hVFltAeoh0LmNBz9SZqUS9mMqGk8rfyWyXn3GH5ReJ8Zw=="],
224
-
225
- "string-width": ["string-width@4.2.3", "", { "dependencies": { "emoji-regex": "^8.0.0", "is-fullwidth-code-point": "^3.0.0", "strip-ansi": "^6.0.1" } }, "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g=="],
226
-
227
- "strip-ansi": ["strip-ansi@6.0.1", "", { "dependencies": { "ansi-regex": "^5.0.1" } }, "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A=="],
228
-
229
- "telegram": ["telegram@2.26.22", "", { "dependencies": { "@cryptography/aes": "^0.1.1", "async-mutex": "^0.3.0", "big-integer": "^1.6.48", "buffer": "^6.0.3", "htmlparser2": "^6.1.0", "mime": "^3.0.0", "node-localstorage": "^2.2.1", "pako": "^2.0.3", "path-browserify": "^1.0.1", "real-cancellable-promise": "^1.1.1", "socks": "^2.6.2", "store2": "^2.13.0", "ts-custom-error": "^3.2.0", "websocket": "^1.0.34" }, "optionalDependencies": { "bufferutil": "^4.0.3", "utf-8-validate": "^5.0.5" } }, "sha512-EIj7Yrjiu0Yosa3FZ/7EyPg9s6UiTi/zDQrFmR/2Mg7pIUU+XjAit1n1u9OU9h2oRnRM5M+67/fxzQluZpaJJg=="],
230
-
231
- "toidentifier": ["toidentifier@1.0.1", "", {}, "sha512-o5sSPKEkg/DIQNmH43V0/uerLrpzVedkUh8tGNvaeXpfpuwjKenlSox/2O/BTlZUtEe+JG7s5YhEz608PlAHRA=="],
232
-
233
- "ts-custom-error": ["ts-custom-error@3.3.1", "", {}, "sha512-5OX1tzOjxWEgsr/YEUWSuPrQ00deKLh6D7OTWcvNHm12/7QPyRh8SYpyWvA4IZv8H/+GQWQEh/kwo95Q9OVW1A=="],
234
-
235
- "tslib": ["tslib@2.8.1", "", {}, "sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w=="],
236
-
237
- "type": ["type@2.7.3", "", {}, "sha512-8j+1QmAbPvLZow5Qpi6NCaN8FB60p/6x8/vfNqOk/hC+HuvFZhL4+WfekuhQLiqFZXOgQdrs3B+XxEmCc6b3FQ=="],
238
-
239
- "type-is": ["type-is@1.6.18", "", { "dependencies": { "media-typer": "0.3.0", "mime-types": "~2.1.24" } }, "sha512-TkRKr9sUTxEH8MdfuCSP7VizJyzRNMjj2J2do2Jr3Kym598JVdEksuzPQCnlFPW4ky9Q+iA+ma9BGm06XQBy8g=="],
240
-
241
- "typedarray-to-buffer": ["typedarray-to-buffer@3.1.5", "", { "dependencies": { "is-typedarray": "^1.0.0" } }, "sha512-zdu8XMNEDepKKR+XYOXAVPtWui0ly0NtohUscw+UmaHiAWT8hrV1rr//H6V+0DvJ3OQ19S979M0laLfX8rm82Q=="],
242
-
243
- "unpipe": ["unpipe@1.0.0", "", {}, "sha512-pjy2bYhSsufwWlKwPc+l3cN7+wuJlK6uz0YdJEOlQDbl6jo/YlPi4mb8agUkVC8BF7V8NuzeyPNqRksA3hztKQ=="],
244
-
245
- "utf-8-validate": ["utf-8-validate@5.0.10", "", { "dependencies": { "node-gyp-build": "^4.3.0" } }, "sha512-Z6czzLq4u8fPOyx7TU6X3dvUZVvoJmxSQ+IcrlmagKhilxlhZgxPK6C5Jqbkw1IDUmFTM+cz9QDnnLTwDz/2gQ=="],
246
-
247
- "utils-merge": ["utils-merge@1.0.1", "", {}, "sha512-pMZTvIkT1d+TFGvDOqodOclx0QWkkgi6Tdoa8gC8ffGAAqz9pzPTZWAybbsHHoED/ztMtkv/VoYTYyShUn81hA=="],
248
-
249
- "vary": ["vary@1.1.2", "", {}, "sha512-BNGbWLfd0eUPabhkXUVm0j8uuvREyTh5ovRa/dyow/BqAbZJyC+5fU+IzQOzmAKzYqYRAISoRhdQr3eIZ/PXqg=="],
250
-
251
- "websocket": ["websocket@1.0.35", "", { "dependencies": { "bufferutil": "^4.0.1", "debug": "^2.2.0", "es5-ext": "^0.10.63", "typedarray-to-buffer": "^3.1.5", "utf-8-validate": "^5.0.2", "yaeti": "^0.0.6" } }, "sha512-/REy6amwPZl44DDzvRCkaI1q1bIiQB0mEFQLUrhz3z2EK91cp3n72rAjUlrTP0zV22HJIUOVHQGPxhFRjxjt+Q=="],
252
-
253
- "write-file-atomic": ["write-file-atomic@1.3.4", "", { "dependencies": { "graceful-fs": "^4.1.11", "imurmurhash": "^0.1.4", "slide": "^1.1.5" } }, "sha512-SdrHoC/yVBPpV0Xq/mUZQIpW2sWXAShb/V4pomcJXh92RuaO+f3UTWItiR3Px+pLnV2PvC2/bfn5cwr5X6Vfxw=="],
254
-
255
- "yaeti": ["yaeti@0.0.6", "", {}, "sha512-MvQa//+KcZCUkBTIC9blM+CU9J2GzuTytsOUwf2lidtvkx/6gnEp1QvJv34t9vdjhFmha/mUiNDbN0D0mJWdug=="],
256
-
257
- "body-parser/qs": ["qs@6.16.0", "", { "dependencies": { "es-define-property": "^1.0.1", "side-channel": "^1.1.1" } }, "sha512-h6fhOIaRrID2CbEY2fqs+7t+UXZo+MLAnU5gRIq85uFtdiUPCdsApMlHhXogKVM4HM2DVbIjGNTTYH2OcmP1vA=="],
258
-
259
- "send/mime": ["mime@1.6.0", "", { "bin": { "mime": "cli.js" } }, "sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg=="],
260
-
261
- "send/ms": ["ms@2.1.3", "", {}, "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA=="],
262
- }
263
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
frontend/.env.example DELETED
@@ -1,3 +0,0 @@
1
- PORT=5173
2
- BACKEND_PORT=3001
3
- BASE_PATH=
 
 
 
 
frontend/bun.lock DELETED
The diff for this file is too large to render. See raw diff
 
frontend/components.json DELETED
@@ -1,21 +0,0 @@
1
- {
2
- "$schema": "https://ui.shadcn.com/schema.json",
3
- "style": "default",
4
- "rsc": false,
5
- "tsx": true,
6
- "tailwind": {
7
- "config": "",
8
- "css": "src/index.css",
9
- "baseColor": "slate",
10
- "cssVariables": true,
11
- "prefix": ""
12
- },
13
- "aliases": {
14
- "components": "@/components",
15
- "utils": "@/lib/utils",
16
- "ui": "@/components/ui",
17
- "lib": "@/lib",
18
- "hooks": "@/hooks"
19
- },
20
- "iconLibrary": "lucide"
21
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
frontend/eslint.config.js DELETED
@@ -1,42 +0,0 @@
1
- import js from '@eslint/js'
2
- import globals from 'globals'
3
- import reactHooks from 'eslint-plugin-react-hooks'
4
- import reactRefresh from 'eslint-plugin-react-refresh'
5
- import tseslint from 'typescript-eslint'
6
-
7
- export default tseslint.config(
8
- { ignores: ['dist', 'node_modules', 'src/api/**'] },
9
- {
10
- extends: [js.configs.recommended, ...tseslint.configs.recommended],
11
- files: ['**/*.{js,jsx,ts,tsx}'],
12
- languageOptions: {
13
- ecmaVersion: 2020,
14
- globals: {
15
- ...globals.browser,
16
- ...globals.node,
17
- },
18
- parserOptions: {
19
- ecmaFeatures: { jsx: true },
20
- },
21
- },
22
- plugins: {
23
- 'react-hooks': reactHooks,
24
- 'react-refresh': reactRefresh,
25
- },
26
- rules: {
27
- ...reactHooks.configs.recommended.rules,
28
- 'react-refresh/only-export-components': [
29
- 'warn',
30
- { allowConstantExport: true },
31
- ],
32
- 'no-unused-vars': 'off',
33
- '@typescript-eslint/no-unused-vars': ['warn', { argsIgnorePattern: '^_', varsIgnorePattern: '^_' }],
34
- '@typescript-eslint/no-explicit-any': 'off',
35
- '@typescript-eslint/no-empty-object-type': 'warn',
36
- '@typescript-eslint/ban-ts-comment': 'warn',
37
- '@typescript-eslint/no-require-imports': 'off',
38
- '@typescript-eslint/no-unused-expressions': 'warn',
39
- '@typescript-eslint/no-unsafe-function-type': 'warn',
40
- },
41
- },
42
- )
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
frontend/index.html DELETED
@@ -1,77 +0,0 @@
1
- <!doctype html>
2
- <html lang="zh-CN">
3
- <head>
4
- <meta charset="UTF-8" />
5
- <meta name="viewport" content="width=device-width, initial-scale=1.0" />
6
- <link rel="icon" href="/favicon.ico" />
7
- <title>Surf 盲盒赠链雷达</title>
8
- <script>
9
- document.documentElement.classList.add('dark');
10
- </script>
11
- </head>
12
- <body>
13
- <div id="root"><!--ssr-outlet--></div>
14
- <script type="module" src="./src/entry-client.tsx"></script>
15
- <script>
16
- // Fallback: if React fails to render (e.g. Vite dep stubs during cold
17
- // start), auto-reload until deps are ready. This fires OUTSIDE React
18
- // so it works even when React itself is null/undefined.
19
- (function(){
20
- var K='__boot_reload', W=30000, M=8;
21
- function st(){try{return JSON.parse(sessionStorage.getItem(K))||{c:0,t:0}}catch(e){return{c:0,t:0}}}
22
- setTimeout(function(){
23
- if(window.__reactOk)return;
24
- var s=st(),c=(Date.now()-s.t>W)?0:s.c;
25
- if(c<M){sessionStorage.setItem(K,JSON.stringify({c:c+1,t:Date.now()}));location.reload()}
26
- },3000);
27
- })();
28
- </script>
29
- <!-- Made by Surf badge -->
30
- <style>
31
- #surf-badge{position:fixed;bottom:16px;right:16px;z-index:2147483647;display:inline-flex;align-items:center;gap:4px;padding:4px 12px;border-radius:20px;font-family:"Lato",system-ui,sans-serif;font-size:12px;font-weight:500;line-height:16px;text-decoration:none;box-shadow:0 1px 1px rgba(51,51,51,.08),0 6px 12px rgba(51,51,51,.08);opacity:.9;transition:opacity .2s}
32
- #surf-badge:hover{opacity:1}
33
- @media print{#surf-badge{display:none}}
34
- </style>
35
- <a id="surf-badge" href="https://asksurf.ai" target="_blank" rel="noopener noreferrer" aria-label="Made by Surf" style="background:var(--bg-menu,#fff);color:var(--fg-base,#212121)">
36
- <span>Made by</span>
37
- <svg width="40" height="13" viewBox="0 0 63 20" fill="currentColor" xmlns="http://www.w3.org/2000/svg">
38
- <path d="M15.583 13.333C15.9931 13.3331 16.3814 13.5196 16.6377 13.8398L18.7666 16.5019C18.7956 16.5382 18.8261 16.5719 18.8574 16.6035C19.2049 16.954 19.6484 17.3405 19.6484 17.834C19.6484 18.3399 19.2383 18.75 18.7324 18.75H18.4668C18.1079 18.75 17.7682 18.5868 17.5439 18.3066L16.3633 16.831C15.6565 15.9476 14.2315 16.4477 14.2314 17.5791V18.6494C14.2314 18.7061 14.1827 18.7499 14.126 18.75H12.2529C11.6074 18.75 10.997 18.4562 10.5938 17.9521L9.69629 16.831C8.98948 15.9478 7.56544 16.4478 7.56543 17.5791V18.6494C7.56542 18.7062 7.51669 18.7499 7.45996 18.75H5.58594C4.94038 18.7499 4.32999 18.4563 3.92676 17.9521L3.03027 16.831C2.67436 16.3862 2.14844 15.9311 2.14844 15.3613V13.4385C2.14851 13.3817 2.19228 13.333 2.24902 13.333C2.65919 13.333 3.04737 13.5197 3.30371 13.8398L5.43359 16.5019C6.14031 17.3853 7.56521 16.8861 7.56543 15.7549V14.6846C7.56543 13.9385 8.16998 13.333 8.91602 13.333C9.32621 13.333 9.71437 13.5196 9.9707 13.8398L12.1006 16.5019C12.8052 17.3827 14.2227 16.8887 14.2314 15.7646V14.6846C14.2314 13.9385 14.837 13.333 15.583 13.333ZM15.583 6.66698C15.9932 6.66711 16.3814 6.8535 16.6377 7.17382L18.7666 9.83593C19.1224 10.2806 19.6484 10.7352 19.6484 11.3047V13.2266C19.6483 13.2833 19.6046 13.333 19.5479 13.333C19.1375 13.333 18.7495 13.1466 18.4932 12.8262L16.3633 10.1641C15.6565 9.28087 14.2315 9.78081 14.2314 10.9121V11.9824C14.2314 12.7284 13.6269 13.333 12.8809 13.333C12.4706 13.3329 12.0825 13.1465 11.8262 12.8262L9.69629 10.1641C8.98942 9.28109 7.56544 9.78088 7.56543 10.9121V11.9824C7.56543 12.7282 6.96062 13.3327 6.21484 13.333C5.80451 13.333 5.41551 13.1466 5.15918 12.8262L3.03027 10.1641C2.67435 9.71918 2.14844 9.26406 2.14844 8.69433V6.77245C2.14851 6.71573 2.19228 6.66699 2.24902 6.66698C2.65936 6.66698 3.04738 6.8534 3.30371 7.17382L5.43359 9.83593C6.14042 10.7191 7.56543 10.2192 7.56543 9.08788V8.01757C7.56543 7.27154 8.16998 6.66698 8.91602 6.66698C9.32634 6.66701 9.71437 6.85341 9.9707 7.17382L12.1006 9.83593C12.8052 10.7162 14.2225 10.2223 14.2314 9.09863V8.01757C14.2314 7.27154 14.837 6.66698 15.583 6.66698ZM3.33008 1.24999C3.68899 1.24999 4.02863 1.41318 4.25293 1.69335L5.43359 3.16894C6.14036 4.0524 7.56543 3.55227 7.56543 2.42089V1.35058C7.56544 1.29384 7.61417 1.25007 7.6709 1.24999H9.54395C10.1895 1.24999 10.7999 1.54378 11.2031 2.04784L12.1006 3.16894C12.8052 4.04953 14.2227 3.5556 14.2314 2.43163V1.35058C14.2315 1.29384 14.2802 1.25007 14.3369 1.24999H16.2109C16.8565 1.25014 17.4669 1.54375 17.8701 2.04784L18.7666 3.16894C19.1223 3.61354 19.6481 4.06741 19.6484 4.63671V6.56054C19.6483 6.61728 19.6046 6.66698 19.5479 6.66698C19.1377 6.66698 18.7495 6.48034 18.4932 6.16015L16.3633 3.49804C15.6566 2.61465 14.2317 3.11391 14.2314 4.24511V5.3164C14.2312 6.06217 13.6267 6.66698 12.8809 6.66698C12.4707 6.66693 12.0825 6.48039 11.8262 6.16015L9.69629 3.49804C8.98957 2.61465 7.56565 3.11391 7.56543 4.24511V5.3164C7.56518 6.06202 6.96046 6.66673 6.21484 6.66698C5.80453 6.66698 5.41551 6.48054 5.15918 6.16015L3.03027 3.49804C3.00109 3.46156 2.97093 3.42724 2.93945 3.3955C2.59217 3.04543 2.14867 2.65906 2.14844 2.16601C2.14844 1.66032 2.55877 1.24999 3.06445 1.24999H3.33008Z"/>
39
- <path d="M35.1083 6.97044C34.7154 6.97044 34.5223 6.77734 34.3692 6.39782C33.9963 5.49228 33.0042 4.97958 31.6925 4.97958C30.0146 4.97958 28.9559 5.83851 28.9559 6.99707C28.9493 8.30211 30.3675 8.80149 31.4328 9.07449L32.7645 9.42072C34.4957 9.84686 36.6863 10.799 36.6863 13.2559C36.6863 15.5664 34.8419 17.251 31.6392 17.251C28.8827 17.251 27.0649 16.0125 26.6321 13.9617C26.5389 13.5156 26.7986 13.2559 27.2514 13.2559H27.9971C28.3966 13.2559 28.5897 13.4557 28.7229 13.8485C29.1024 14.9272 30.2676 15.4466 31.6259 15.4466C33.3771 15.4466 34.6488 14.5676 34.6488 13.236C34.6488 12.0241 33.5236 11.5447 32.0654 11.1586L30.454 10.7191C28.2634 10.1265 26.9051 9.01456 26.9051 7.11692C26.9051 4.76651 29.0025 3.20179 31.7391 3.20179C34.2027 3.20179 36.0005 4.45357 36.4133 6.27131C36.5132 6.71076 36.2335 6.97044 35.7874 6.97044H35.1083Z"/>
40
- <path d="M45.0887 7.46316C45.0887 7.03036 45.3217 6.79732 45.7545 6.79732H46.4204C46.8532 6.79732 47.0862 7.03036 47.0862 7.46316V16.3588C47.0862 16.7915 46.8532 17.0246 46.4204 17.0246H45.7945C45.3617 17.0246 45.1286 16.7915 45.1286 16.3588V15.2535H45.0221C44.5494 16.3454 43.504 17.1578 41.9659 17.1578C40.0017 17.1578 38.6101 15.8394 38.6101 13.3026V7.46316C38.6101 7.03036 38.8431 6.79732 39.2759 6.79732H39.9351C40.3679 6.79732 40.601 7.03036 40.601 7.46316V13.0629C40.601 14.4545 41.4532 15.3467 42.685 15.3467C43.8036 15.3467 45.0954 14.521 45.0887 12.7832V7.46316Z"/>
41
- <path d="M49.3862 7.46316C49.3862 7.03036 49.6193 6.79732 50.0521 6.79732H50.6447C51.0774 6.79732 51.3105 7.03036 51.3105 7.46316V8.42196H51.417C51.7899 7.32333 52.8153 6.64418 54.0138 6.64418C54.0737 6.64418 54.147 6.64418 54.2202 6.65084C54.6397 6.65749 54.8594 6.91717 54.8594 7.33665V7.88264C54.8594 8.33541 54.673 8.54182 54.3467 8.50852C54.1803 8.48855 53.9938 8.47523 53.8207 8.47523C52.4091 8.47523 51.3771 9.4407 51.3771 10.779V16.3588C51.3771 16.7915 51.144 17.0246 50.7112 17.0246H50.0521C49.6193 17.0246 49.3862 16.7915 49.3862 16.3588V7.46316Z"/>
42
- <path d="M61.6788 7.72949C61.6788 8.16229 61.4457 8.39533 61.013 8.39533H59.4749V16.3588C59.4749 16.7915 59.2418 17.0246 58.809 17.0246H58.1432C57.7104 17.0246 57.4774 16.7915 57.4774 16.3588V8.39533H56.5652C56.1324 8.39533 55.8993 8.16229 55.8993 7.72949V7.46316C55.8993 7.03036 56.1324 6.79732 56.5652 6.79732H57.4774V5.61213C57.4774 3.69451 58.8956 2.74902 60.5136 2.74902C60.9131 2.74902 61.2593 2.78897 61.539 2.84224C61.9651 2.9288 62.1116 3.2484 61.9917 3.66122L61.8919 4.01412C61.7787 4.42028 61.5656 4.57342 61.2726 4.52015C61.1395 4.49352 60.993 4.4802 60.8199 4.4802C59.8477 4.4802 59.4749 4.97292 59.4749 5.87846V6.79732H61.013C61.4457 6.79732 61.6788 7.03036 61.6788 7.46316V7.72949Z"/>
43
- </svg>
44
- </a>
45
- <!-- Plaza badge: rendered only when this deployed site is shared on Surf Plaza. -->
46
- <script>
47
- (function(){
48
- try{
49
- var m=location.hostname.match(/^([a-z0-9][a-z0-9-]{0,51})\.(?:surf\.computer|stg\.ask\.surf)$/i);
50
- if(!m)return;
51
- var slug=m[1].toLowerCase();
52
- fetch('https://api.asksurf.ai/muninn/v1/plaza/by-subdomain?subdomain='+encodeURIComponent(slug))
53
- .then(function(r){return r.ok?r.json():null;})
54
- .then(function(j){
55
- var d=j&&j.data;
56
- if(!d||!d.shared||!d.listing_id)return;
57
- var a=document.createElement('a');
58
- a.id='plaza-badge';
59
- a.href='https://asksurf.ai/studio/gallery?id='+encodeURIComponent(d.listing_id);
60
- a.target='_blank';
61
- a.rel='noopener noreferrer';
62
- a.setAttribute('aria-label','Remix this on Surf Plaza');
63
- a.style.cssText='position:fixed;bottom:56px;right:16px;z-index:2147483647;display:inline-flex;align-items:center;gap:6px;padding:4px 12px;border-radius:20px;font-family:"Lato",system-ui,sans-serif;font-size:12px;font-weight:500;line-height:16px;text-decoration:none;background:#fd5587;color:#fff;box-shadow:0 1px 1px rgba(51,51,51,.08),0 6px 12px rgba(51,51,51,.16);opacity:.92;transition:opacity .2s';
64
- a.onmouseenter=function(){a.style.opacity='1';};
65
- a.onmouseleave=function(){a.style.opacity='.92';};
66
- a.innerHTML='<span aria-hidden="true" style="font-size:13px;line-height:1">↻</span><span>Remix on Plaza</span>';
67
- var s=document.createElement('style');
68
- s.textContent='@media print{#plaza-badge{display:none}}';
69
- document.head.appendChild(s);
70
- document.body.appendChild(a);
71
- })
72
- .catch(function(){});
73
- }catch(e){}
74
- })();
75
- </script>
76
- </body>
77
- </html>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
frontend/package.json DELETED
@@ -1,83 +0,0 @@
1
- {
2
- "name": "frontend",
3
- "private": true,
4
- "version": "0.0.0",
5
- "type": "module",
6
- "scripts": {
7
- "dev": "node scripts/check-env.cjs vite",
8
- "build": "node scripts/check-env.cjs npm run build:client && npm run build:server",
9
- "build:client": "vite build --outDir dist/client",
10
- "build:server": "vite build --ssr src/entry-server.tsx --outDir dist/server",
11
- "lint": "eslint .",
12
- "preview": "vite preview",
13
- "type-check": "tsc --noEmit --incremental"
14
- },
15
- "dependencies": {
16
- "@surf-ai/theme": "latest",
17
- "react": "19.2.4",
18
- "react-dom": "19.2.4",
19
- "class-variance-authority": "0.7.1",
20
- "clsx": "2.1.1",
21
- "tailwind-merge": "2.6.1",
22
- "lucide-react": "0.454.0",
23
- "next-themes": "0.4.6",
24
- "echarts": "5.6.0",
25
- "echarts-for-react": "3.0.6",
26
- "@radix-ui/react-accordion": "1.2.12",
27
- "@radix-ui/react-aspect-ratio": "1.1.8",
28
- "@radix-ui/react-avatar": "1.1.11",
29
- "@radix-ui/react-checkbox": "1.3.3",
30
- "@radix-ui/react-collapsible": "1.1.12",
31
- "@radix-ui/react-context-menu": "2.2.16",
32
- "@radix-ui/react-dialog": "1.1.15",
33
- "@radix-ui/react-dropdown-menu": "2.1.16",
34
- "@radix-ui/react-hover-card": "1.1.15",
35
- "@radix-ui/react-label": "2.1.8",
36
- "@radix-ui/react-menubar": "1.1.16",
37
- "@radix-ui/react-navigation-menu": "1.2.14",
38
- "@radix-ui/react-popover": "1.1.15",
39
- "@radix-ui/react-progress": "1.1.8",
40
- "@radix-ui/react-radio-group": "1.3.8",
41
- "@radix-ui/react-scroll-area": "1.2.10",
42
- "@radix-ui/react-select": "2.2.6",
43
- "@radix-ui/react-separator": "1.1.8",
44
- "@radix-ui/react-slider": "1.3.6",
45
- "@radix-ui/react-slot": "1.2.4",
46
- "@radix-ui/react-switch": "1.2.6",
47
- "@radix-ui/react-tabs": "1.1.13",
48
- "@radix-ui/react-toast": "1.2.15",
49
- "@radix-ui/react-toggle": "1.1.10",
50
- "@radix-ui/react-toggle-group": "1.1.11",
51
- "@radix-ui/react-tooltip": "1.2.8",
52
- "sonner": "1.7.4",
53
- "cmdk": "1.1.1",
54
- "vaul": "1.1.2",
55
- "embla-carousel-react": "8.6.0",
56
- "react-day-picker": "9.14.0",
57
- "react-resizable-panels": "4.7.6",
58
- "react-hook-form": "7.72.0",
59
- "@hookform/resolvers": "5.2.2",
60
- "date-fns": "4.1.0",
61
- "zod": "3.25.76",
62
- "@tanstack/react-query": "5.94.5",
63
- "@tanstack/query-core": "5.94.5",
64
- "scheduler": "0.27.0"
65
- },
66
- "devDependencies": {
67
- "@types/react": "19.2.14",
68
- "@types/react-dom": "19.2.3",
69
- "@types/node": "22.19.15",
70
- "@eslint/js": "9.39.4",
71
- "@vitejs/plugin-react": "4.7.0",
72
- "@tailwindcss/vite": "4.2.2",
73
- "eslint": "9.39.4",
74
- "eslint-plugin-react-hooks": "5.2.0",
75
- "eslint-plugin-react-refresh": "0.4.26",
76
- "globals": "16.5.0",
77
- "tailwindcss": "4.2.2",
78
- "tw-animate-css": "1.4.0",
79
- "typescript-eslint": "8.57.1",
80
- "typescript": "5.9.3",
81
- "vite": "6.4.2"
82
- }
83
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
frontend/scripts/check-env.cjs DELETED
@@ -1,51 +0,0 @@
1
- /**
2
- * Validates required env vars before running a command.
3
- * Loads .env manually, checks vars, then execs the actual command.
4
- *
5
- * Build: BASE_PATH (defined, can be empty), BACKEND_PORT
6
- * Dev: PORT, BACKEND_PORT, BASE_PATH
7
- */
8
- const fs = require('node:fs')
9
- const path = require('node:path')
10
- const { execSync } = require('node:child_process')
11
-
12
- // Load .env manually (Vite doesn't load non-VITE_ vars into process.env)
13
- const envPath = path.join(process.cwd(), '.env')
14
- if (fs.existsSync(envPath)) {
15
- for (const line of fs.readFileSync(envPath, 'utf8').split('\n')) {
16
- const trimmed = line.trim()
17
- if (!trimmed || trimmed.startsWith('#')) continue
18
- const eq = trimmed.indexOf('=')
19
- if (eq < 0) continue
20
- const key = trimmed.slice(0, eq)
21
- const val = trimmed.slice(eq + 1)
22
- if (!process.env[key]) process.env[key] = val
23
- }
24
- }
25
-
26
- const args = process.argv.slice(2)
27
- const isBuild = args.some(a => a.includes('build'))
28
-
29
- // Vars that must be non-empty
30
- const requiredNonEmpty = isBuild
31
- ? ['BACKEND_PORT']
32
- : ['PORT', 'BACKEND_PORT']
33
-
34
- // Vars that must be defined (empty is ok — BASE_PATH="" means root)
35
- const requiredDefined = ['BASE_PATH']
36
-
37
- const missingNonEmpty = requiredNonEmpty.filter(k => !process.env[k])
38
- const missingDefined = requiredDefined.filter(k => process.env[k] === undefined)
39
- const missing = [...missingNonEmpty, ...missingDefined]
40
-
41
- if (missing.length > 0) {
42
- console.error(`\n❌ Missing required env vars: ${missing.join(', ')}`)
43
- console.error(` Set them in your environment or copy .env.example to .env\n`)
44
- process.exit(1)
45
- }
46
-
47
- try {
48
- execSync(args.join(' '), { stdio: 'inherit', env: process.env })
49
- } catch (e) {
50
- process.exit(e.status || 1)
51
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
frontend/src/App.tsx DELETED
@@ -1,345 +0,0 @@
1
- import { useEffect, useState, type ReactNode } from 'react'
2
- import { useQuery, useQueryClient } from '@tanstack/react-query'
3
- import { ExternalLink, Gift, Loader2, RefreshCw, Search, Send, Settings, X as XIcon } from 'lucide-react'
4
- import { request } from './lib/api'
5
- import { formatCount, timeAgo } from './lib/format'
6
- import type { FeedResponse, StatusResponse, UsableCode } from './lib/types'
7
- import PostCard from './components/PostCard'
8
- import { CopyButton, countdown, useTick } from './components/CodeBadge'
9
- import SettingsPanel from './components/SettingsPanel'
10
-
11
- type View = 'gifts' | 'links' | 'talk' | 'all'
12
- type Source = '' | 'x' | 'telegram' | 'manual'
13
-
14
- const VIEWS: { id: View; label: string }[] = [
15
- { id: 'gifts', label: '赠链' },
16
- { id: 'links', label: '赠链 + 盲盒链接' },
17
- { id: 'talk', label: '讨论' },
18
- { id: 'all', label: '全部' },
19
- ]
20
- const SOURCES: { id: Source; label: string }[] = [
21
- { id: '', label: '全部来源' },
22
- { id: 'x', label: 'X' },
23
- { id: 'telegram', label: 'Telegram' },
24
- { id: 'manual', label: '手动' },
25
- ]
26
-
27
- function useDebounced<T>(value: T, ms = 300) {
28
- const [v, setV] = useState(value)
29
- useEffect(() => {
30
- const t = setTimeout(() => setV(value), ms)
31
- return () => clearTimeout(t)
32
- }, [value, ms])
33
- return v
34
- }
35
-
36
- export default function App() {
37
- const qc = useQueryClient()
38
- const [view, setView] = useState<View>('gifts')
39
- const [source, setSource] = useState<Source>('')
40
- const [q, setQ] = useState('')
41
- const query = useDebounced(q.trim())
42
- const [showSettings, setShowSettings] = useState(false)
43
- const [scanning, setScanning] = useState(false)
44
- const [notice, setNotice] = useState<{ text: string; error?: boolean } | null>(null)
45
-
46
- const feed = useQuery<FeedResponse>({
47
- queryKey: ['feed', view, source, query],
48
- queryFn: () => {
49
- const params = new URLSearchParams({ view, limit: '200' })
50
- if (source) params.set('source', source)
51
- if (query) params.set('q', query)
52
- return request<FeedResponse>(`feed?${params}`)
53
- },
54
- refetchInterval: 15000,
55
- placeholderData: (prev) => prev,
56
- })
57
- const status = useQuery<StatusResponse>({
58
- queryKey: ['status'],
59
- queryFn: () => request<StatusResponse>('status'),
60
- refetchInterval: 15000,
61
- })
62
-
63
- async function scan() {
64
- setScanning(true)
65
- setNotice(null)
66
- try {
67
- const r = await request<{ newPosts?: number; newCodes?: number; seconds?: number; pushed?: unknown[] }>('scan', { body: {} })
68
- const parts = [`抓取完成(${r.seconds ?? 0} 秒)`]
69
- parts.push(r.newPosts ? `新增 ${r.newPosts} 条帖子` : '没有新帖子')
70
- if (r.newCodes) parts.push(`${r.newCodes} 个新赠链`)
71
- if (r.pushed?.length) parts.push(`推送了 ${r.pushed.length} 个`)
72
- setNotice({ text: parts.join(',') })
73
- } catch (err) {
74
- setNotice({ text: err instanceof Error ? err.message : '抓取失败', error: true })
75
- } finally {
76
- setScanning(false)
77
- qc.invalidateQueries({ queryKey: ['feed'] })
78
- qc.invalidateQueries({ queryKey: ['status'] })
79
- }
80
- }
81
-
82
- const data = feed.data
83
- const posts = data?.posts ?? []
84
- const usable = data?.usable ?? []
85
-
86
- return (
87
- <div className="min-h-screen bg-background text-foreground">
88
- <header className="sticky top-0 z-20 border-b border-[var(--border-strong)] bg-background/85 backdrop-blur">
89
- <div className="mx-auto flex max-w-3xl items-center justify-between gap-3 px-4 py-3">
90
- <div className="min-w-0">
91
- <h1 className="flex items-center gap-2 text-base font-black sm:text-lg">
92
- <Gift className="h-5 w-5 text-brand-100" />
93
- Surf 盲盒赠链雷达
94
- </h1>
95
- <SourceStrip status={status.data} />
96
- </div>
97
- <div className="flex shrink-0 items-center gap-2">
98
- <button
99
- type="button"
100
- onClick={() => setShowSettings(true)}
101
- className="rounded-full border border-[var(--border-strong)] p-2 text-fg-subtle hover:bg-[var(--bg-subtle-hover)]"
102
- title="设置"
103
- >
104
- <Settings className="h-4 w-4" />
105
- </button>
106
- <button
107
- type="button"
108
- onClick={scan}
109
- disabled={scanning}
110
- className="flex items-center gap-1.5 rounded-full bg-brand-100 px-4 py-2 text-sm font-semibold text-white hover:opacity-90 disabled:opacity-50"
111
- >
112
- {scanning ? <Loader2 className="h-4 w-4 animate-spin" /> : <RefreshCw className="h-4 w-4" />}
113
- {scanning ? '抓取中' : '抓取最新'}
114
- </button>
115
- </div>
116
- </div>
117
- </header>
118
-
119
- <main className="mx-auto max-w-3xl px-4 pb-20 pt-5">
120
- {notice && (
121
- <p
122
- className={`mb-4 rounded-lg px-3 py-2 text-xs ${
123
- notice.error ? 'bg-red-500/10 text-red-400' : 'bg-brand-10 text-brand-100'
124
- }`}
125
- >
126
- {notice.text}
127
- </p>
128
- )}
129
-
130
- <Alerts status={status.data} onOpenSettings={() => setShowSettings(true)} />
131
-
132
- <UsableBoard codes={usable} loading={feed.isLoading} />
133
-
134
- <section className="mt-4 grid grid-cols-2 gap-2.5 sm:grid-cols-4">
135
- <Stat label="24 小时新赠链" value={formatCount(data?.stats.codes_24h)} />
136
- <Stat label="累计赠链" value={formatCount(data?.stats.codes)} />
137
- <Stat label="已推送" value={formatCount(data?.stats.pushed)} />
138
- <Stat
139
- label="最近一个新赠链"
140
- value={data?.stats.last_code_at ? timeAgo(data.stats.last_code_at * 1000) : '—'}
141
- />
142
- </section>
143
-
144
- <section className="mt-6 space-y-3">
145
- <div className="flex flex-wrap gap-1.5">
146
- {VIEWS.map((v) => (
147
- <Chip key={v.id} active={view === v.id} onClick={() => setView(v.id)}>
148
- {v.label}
149
- </Chip>
150
- ))}
151
- </div>
152
- <div className="flex flex-wrap items-center gap-2">
153
- <div className="flex flex-wrap gap-1.5">
154
- {SOURCES.map((s) => (
155
- <Chip key={s.id} small active={source === s.id} onClick={() => setSource(s.id)}>
156
- {s.label}
157
- </Chip>
158
- ))}
159
- </div>
160
- <label className="relative ml-auto flex min-w-[180px] flex-1 items-center sm:flex-none">
161
- <Search className="pointer-events-none absolute left-2.5 h-3.5 w-3.5 text-fg-muted" />
162
- <input
163
- value={q}
164
- onChange={(e) => setQ(e.target.value)}
165
- placeholder="搜索内容 / 作者 / 赠链码"
166
- className="w-full rounded-full border border-[var(--border-strong)] bg-transparent py-1.5 pl-8 pr-7 text-xs outline-none focus:border-brand-60 sm:w-56"
167
- />
168
- {q && (
169
- <button type="button" onClick={() => setQ('')} className="absolute right-2 text-fg-muted">
170
- <XIcon className="h-3.5 w-3.5" />
171
- </button>
172
- )}
173
- </label>
174
- </div>
175
- </section>
176
-
177
- <section className="mt-4 space-y-3">
178
- {feed.isLoading && (
179
- <div className="flex items-center justify-center gap-2 py-16 text-sm text-fg-muted">
180
- <Loader2 className="h-4 w-4 animate-spin" /> 加载中…
181
- </div>
182
- )}
183
- {feed.isError && (
184
- <p className="rounded-lg bg-red-500/10 px-3 py-2 text-xs text-red-400">
185
- 读取失败:{(feed.error as Error)?.message}
186
- </p>
187
- )}
188
- {!feed.isLoading && posts.length === 0 && !feed.isError && (
189
- <p className="py-16 text-center text-sm text-fg-muted">这里还没有内容</p>
190
- )}
191
- {posts.map((post) => (
192
- <PostCard key={post.id} post={post} />
193
- ))}
194
- {posts.length >= 200 && <p className="py-4 text-center text-xs text-fg-muted">只显示最近 200 条,可以用搜索找更早的</p>}
195
- </section>
196
- </main>
197
-
198
- {showSettings && (
199
- <div className="fixed inset-0 z-40 flex justify-end bg-black/50" onClick={() => setShowSettings(false)}>
200
- <div
201
- className="h-full w-full max-w-lg overflow-y-auto border-l border-[var(--border-strong)] bg-background p-4"
202
- onClick={(e) => e.stopPropagation()}
203
- >
204
- <div className="mb-4 flex items-center justify-between">
205
- <h2 className="text-base font-bold">设置</h2>
206
- <button type="button" onClick={() => setShowSettings(false)} className="rounded-md p-1.5 hover:bg-[var(--bg-subtle-hover)]">
207
- <XIcon className="h-4 w-4" />
208
- </button>
209
- </div>
210
- <SettingsPanel status={status.data} />
211
- </div>
212
- </div>
213
- )}
214
- </div>
215
- )
216
- }
217
-
218
- /* ------------------------------------------------------------- pieces -- */
219
-
220
- function Chip({ active, small, onClick, children }: { active: boolean; small?: boolean; onClick: () => void; children: ReactNode }) {
221
- return (
222
- <button
223
- type="button"
224
- onClick={onClick}
225
- className={`rounded-full border ${small ? 'px-2.5 py-1 text-[11px]' : 'px-3 py-1.5 text-xs'} font-medium transition ${
226
- active
227
- ? 'border-brand-60 bg-brand-10 text-brand-100'
228
- : 'border-[var(--border-strong)] text-fg-subtle hover:bg-[var(--bg-subtle-hover)]'
229
- }`}
230
- >
231
- {children}
232
- </button>
233
- )
234
- }
235
-
236
- function Stat({ label, value }: { label: string; value: string }) {
237
- return (
238
- <div className="rounded-[12px] border border-[var(--border-strong)] bg-[var(--bg-subtle)] px-3 py-2.5">
239
- <p className="text-[11px] text-fg-muted">{label}</p>
240
- <p className="mt-0.5 text-lg font-black">{value}</p>
241
- </div>
242
- )
243
- }
244
-
245
- function Pill({ tone, children }: { tone: 'ok' | 'warn' | 'bad' | 'off'; children: ReactNode }) {
246
- const dot = { ok: 'bg-emerald-400', warn: 'bg-amber-400', bad: 'bg-red-400', off: 'bg-zinc-500' }[tone]
247
- return (
248
- <span className="inline-flex items-center gap-1.5">
249
- <span className={`h-1.5 w-1.5 rounded-full ${dot}`} />
250
- {children}
251
- </span>
252
- )
253
- }
254
-
255
- function SourceStrip({ status }: { status?: StatusResponse }) {
256
- if (!status) return <p className="mt-0.5 text-[11px] text-fg-muted">连接中…</p>
257
- const x = status.x
258
- const t = status.telegram
259
- const xTone = !x.connected ? 'off' : x.expired ? 'bad' : x.pausedUntil ? 'warn' : 'ok'
260
- const xText = !x.connected ? 'X 未登录' : x.expired ? 'X 登录失效' : x.pausedUntil ? 'X 限流中' : 'X 实时搜索'
261
- const tTone = t.phase === 'live' ? 'ok' : t.phase === 'needs-login' || t.phase === 'error' ? 'bad' : t.phase === 'off' ? 'off' : 'warn'
262
- const tText =
263
- t.phase === 'live' ? 'Telegram 实时' : t.phase === 'needs-login' ? 'Telegram 需登录' : t.phase === 'off' ? 'Telegram 未开启' : 'Telegram 连接中'
264
- return (
265
- <p className="mt-0.5 flex flex-wrap gap-x-3 gap-y-0.5 text-[11px] text-fg-muted">
266
- <Pill tone={xTone}>{xText}</Pill>
267
- <Pill tone={tTone}>{tText}</Pill>
268
- <Pill tone={status.push.configured ? (status.push.lastError ? 'warn' : 'ok') : 'off'}>
269
- {status.push.configured ? '企业微信推送' : '未设置推送'}
270
- </Pill>
271
- </p>
272
- )
273
- }
274
-
275
- /** Problems the user should act on, shown in plain words. */
276
- function Alerts({ status, onOpenSettings }: { status?: StatusResponse; onOpenSettings: () => void }) {
277
- if (!status) return null
278
- const items: string[] = []
279
- if (!status.x.connected) items.push('X 还没登录,现在只能读少数账号的主页,大部分赠链会漏掉。')
280
- else if (status.x.expired) items.push('X 登录已失效,请重新粘贴 Cookie。')
281
- if (status.telegram.phase === 'needs-login') items.push(`Telegram 需要重新登录${status.telegram.error ? `(${status.telegram.error})` : ''}。`)
282
- if (!status.push.configured) items.push('还没设置企业微信推送地址。')
283
- else if (status.push.lastError) items.push(`推送失败:${status.push.lastError}`)
284
- if (status.backup.blockSave) items.push('读取备份失败,为了不覆盖旧数据,本次运行暂停了备份。')
285
- if (!items.length) return null
286
- return (
287
- <div className="mb-4 rounded-[12px] border border-amber-500/30 bg-amber-500/10 px-3 py-2.5 text-xs leading-5 text-amber-300">
288
- {items.map((t, i) => (
289
- <p key={i}>• {t}</p>
290
- ))}
291
- <button type="button" onClick={onOpenSettings} className="mt-1 font-semibold underline">
292
- 去设置
293
- </button>
294
- </div>
295
- )
296
- }
297
-
298
- function UsableBoard({ codes, loading }: { codes: UsableCode[]; loading: boolean }) {
299
- const now = useTick(1000)
300
- const sorted = codes
301
- if (loading) return null
302
- return (
303
- <section className="rounded-[14px] border border-brand-30 bg-[var(--bg-subtle)] p-4">
304
- <div className="flex items-baseline justify-between gap-2">
305
- <h2 className="flex items-center gap-1.5 text-sm font-bold text-brand-100">
306
- <Gift className="h-4 w-4" />
307
- 现在还能领({codes.length})
308
- </h2>
309
- <span className="text-[11px] text-fg-muted">每 90 秒复查一次名额</span>
310
- </div>
311
- {sorted.length === 0 ? (
312
- <p className="mt-2 text-xs leading-5 text-fg-muted">暂时没有还有名额的赠链。出现新的会自动推送到企业微信,也会显示在这里。</p>
313
- ) : (
314
- <div className="mt-3 space-y-2">
315
- {sorted.map((c) => {
316
- const link = `https://asksurf.ai/mystery-box/g/${c.code}`
317
- return (
318
- <div key={c.code} className="flex flex-wrap items-center gap-x-3 gap-y-1 rounded-lg bg-background/60 px-3 py-2">
319
- <a href={link} target="_blank" rel="noreferrer" className="font-mono text-sm font-bold text-brand-100 hover:underline">
320
- {c.code}
321
- </a>
322
- <span className="text-xs font-semibold">剩 {c.seats} 份</span>
323
- {c.expires_at ? <span className="text-xs text-fg-muted">{countdown(c.expires_at, now)}后到期</span> : null}
324
- {c.tier && <span className="text-xs text-fg-muted">{c.tier}</span>}
325
- <span className="min-w-0 flex-1 truncate text-[11px] text-fg-muted">
326
- {c.source === 'telegram' && <Send className="mr-1 inline h-3 w-3" />}
327
- {c.author_name || c.author || ''}
328
- {c.first_seen ? ` · ${timeAgo(c.first_seen * 1000)}发现` : ''}
329
- </span>
330
- <span className="flex items-center gap-1">
331
- <CopyButton text={link} label="复制" />
332
- {c.url && (
333
- <a href={c.url} target="_blank" rel="noreferrer" className="text-fg-muted hover:text-fg-base" title="原帖">
334
- <ExternalLink className="h-3.5 w-3.5" />
335
- </a>
336
- )}
337
- </span>
338
- </div>
339
- )
340
- })}
341
- </div>
342
- )}
343
- </section>
344
- )
345
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
frontend/src/ErrorBoundary.tsx DELETED
@@ -1,106 +0,0 @@
1
- import { Component, type ReactNode } from 'react'
2
-
3
- interface Props { children: ReactNode; fallback?: ReactNode }
4
- interface State { error: Error | null }
5
-
6
- // Auto-reload config for transient dep-optimization errors.
7
- // Shares the same key as entry-client's cold-start guard so reload
8
- // attempts are counted together, preventing double reload loops.
9
- const RELOAD_KEY = '__dep_reload'
10
- const MAX_RELOADS = 6
11
- // If the last reload was more than this many ms ago, reset the counter.
12
- // This prevents stale counters from blocking legitimate retries on a
13
- // later visit, while still capping rapid reload loops.
14
- const RELOAD_WINDOW_MS = 60_000
15
-
16
- // Patterns that indicate React modules loaded as stubs (dep optimization in progress)
17
- const DEP_OPT_PATTERNS = [
18
- "reading 'useState'",
19
- "reading 'useEffect'",
20
- "reading 'useRef'",
21
- "reading 'useCallback'",
22
- "reading 'useMemo'",
23
- "reading 'useContext'",
24
- "reading 'useReducer'",
25
- ]
26
-
27
- function isDepOptError(msg: string): boolean {
28
- return DEP_OPT_PATTERNS.some((p) => msg.includes(p))
29
- }
30
-
31
- // Shared format with entry-client: { c: count, t: timestamp }
32
- function getReloadState(): { c: number; t: number } {
33
- try {
34
- const raw = sessionStorage.getItem(RELOAD_KEY)
35
- if (raw) return JSON.parse(raw)
36
- } catch { /* ignore parse errors */ }
37
- return { c: 0, t: 0 }
38
- }
39
-
40
- export default class ErrorBoundary extends Component<Props, State> {
41
- state: State = { error: null }
42
-
43
- static getDerivedStateFromError(error: Error) {
44
- return { error }
45
- }
46
-
47
- componentDidCatch(error: Error) {
48
- if (!isDepOptError(error.message)) return
49
- // Vite dep optimization may serve React stubs during cold start.
50
- // Auto-reload so the browser fetches the real modules once ready.
51
- const prev = getReloadState()
52
- // Reset counter if outside the rapid-reload window (stale from earlier visit)
53
- const count = (Date.now() - prev.t > RELOAD_WINDOW_MS) ? 0 : prev.c
54
- if (count < MAX_RELOADS) {
55
- sessionStorage.setItem(RELOAD_KEY, JSON.stringify({ c: count + 1, t: Date.now() }))
56
- setTimeout(() => location.reload(), 3000)
57
- }
58
- }
59
-
60
- render() {
61
- if (this.state.error) {
62
- if (this.props.fallback) return this.props.fallback
63
-
64
- // Show a friendlier message for dep optimization errors that will auto-reload
65
- if (isDepOptError(this.state.error.message)) {
66
- const { c, t } = getReloadState()
67
- const fresh = (Date.now() - t <= RELOAD_WINDOW_MS)
68
- if (!fresh || c < MAX_RELOADS) {
69
- return (
70
- <div style={{
71
- padding: '24px',
72
- margin: '16px',
73
- borderRadius: '12px',
74
- background: 'rgba(59,130,246,0.06)',
75
- border: '1px solid rgba(59,130,246,0.15)',
76
- color: '#3b82f6',
77
- fontSize: '13px',
78
- fontFamily: 'system-ui, sans-serif',
79
- textAlign: 'center',
80
- }}>
81
- <p style={{ fontWeight: 600, marginBottom: '4px' }}>Loading dependencies...</p>
82
- <p style={{ opacity: 0.7, fontSize: '12px' }}>Reloading automatically</p>
83
- </div>
84
- )
85
- }
86
- }
87
-
88
- return (
89
- <div style={{
90
- padding: '24px',
91
- margin: '16px',
92
- borderRadius: '12px',
93
- background: 'rgba(245,34,45,0.06)',
94
- border: '1px solid rgba(245,34,45,0.15)',
95
- color: '#c0392b',
96
- fontSize: '13px',
97
- fontFamily: 'monospace',
98
- }}>
99
- <p style={{ fontWeight: 600, marginBottom: '8px' }}>Component Error</p>
100
- <p style={{ opacity: 0.8 }}>{this.state.error.message}</p>
101
- </div>
102
- )
103
- }
104
- return this.props.children
105
- }
106
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
frontend/src/components/CodeBadge.tsx DELETED
@@ -1,85 +0,0 @@
1
- import { useEffect, useState } from 'react'
2
- import { Check, Copy } from 'lucide-react'
3
- import { timeAgo } from '@/lib/format'
4
- import type { CodeInfo } from '@/lib/types'
5
-
6
- export function countdown(expiresAt: number | null | undefined, now = Date.now()) {
7
- if (!expiresAt) return null
8
- const s = Math.floor(expiresAt - now / 1000)
9
- if (s <= 0) return '已到期'
10
- const d = Math.floor(s / 86400)
11
- const h = Math.floor((s % 86400) / 3600)
12
- const m = Math.floor((s % 3600) / 60)
13
- if (d > 0) return `${d}天${h}小时`
14
- if (h > 0) return `${h}小时${m}分`
15
- return `${m}分${s % 60}秒`
16
- }
17
-
18
- export function statusText(info: CodeInfo) {
19
- if (!info.checked_at) return '检查中…'
20
- if (info.usable) return `剩 ${info.seats ?? 0} 份`
21
- if (info.status === 'INVALID') return '无效'
22
- if (info.status === 'EXPIRED') return '已过期'
23
- if ((info.seats ?? 0) <= 0) return '已领完'
24
- if (info.expires_at && info.expires_at * 1000 < Date.now()) return '已过期'
25
- return info.status || '不可用'
26
- }
27
-
28
- export function useTick(ms = 1000) {
29
- const [now, setNow] = useState(Date.now())
30
- useEffect(() => {
31
- const t = setInterval(() => setNow(Date.now()), ms)
32
- return () => clearInterval(t)
33
- }, [ms])
34
- return now
35
- }
36
-
37
- export function CopyButton({ text, label }: { text: string; label?: string }) {
38
- const [done, setDone] = useState(false)
39
- return (
40
- <button
41
- type="button"
42
- onClick={async (e) => {
43
- e.preventDefault()
44
- try {
45
- await navigator.clipboard.writeText(text)
46
- } catch {
47
- const el = document.createElement('textarea')
48
- el.value = text
49
- document.body.appendChild(el)
50
- el.select()
51
- document.execCommand('copy')
52
- el.remove()
53
- }
54
- setDone(true)
55
- setTimeout(() => setDone(false), 1500)
56
- }}
57
- className="inline-flex items-center gap-1 rounded-md px-1.5 py-0.5 text-[11px] text-fg-muted hover:bg-[var(--bg-subtle-hover)] hover:text-fg-base"
58
- title="复制"
59
- >
60
- {done ? <Check className="h-3 w-3" /> : <Copy className="h-3 w-3" />}
61
- {label}
62
- </button>
63
- )
64
- }
65
-
66
- /** One gift code inside a post: status, seats, expiry, copy. */
67
- export default function CodeBadge({ info }: { info: CodeInfo }) {
68
- const link = `https://asksurf.ai/mystery-box/g/${info.code}`
69
- return (
70
- <div
71
- className={`flex items-center gap-2 rounded-lg border px-2.5 py-1.5 text-xs ${
72
- info.usable ? 'border-brand-60 bg-brand-10' : 'border-[var(--border-strong)] bg-background/40'
73
- }`}
74
- >
75
- <a href={link} target="_blank" rel="noreferrer" className="font-mono font-semibold hover:underline">
76
- {info.code}
77
- </a>
78
- <span className={info.usable ? 'font-semibold text-brand-100' : 'text-fg-muted'}>{statusText(info)}</span>
79
- {info.usable && info.expires_at ? <span className="text-fg-muted">· {countdown(info.expires_at)}</span> : null}
80
- {info.tier && <span className="text-fg-muted">· {info.tier}</span>}
81
- {info.pushed_at ? <span className="text-fg-muted" title={`推送于 ${timeAgo(info.pushed_at * 1000)}`}>· 已推送</span> : null}
82
- <CopyButton text={link} />
83
- </div>
84
- )
85
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
frontend/src/components/PostCard.tsx DELETED
@@ -1,141 +0,0 @@
1
- import { ExternalLink, Eye, Heart, MessageCircle, Repeat2, Send } from 'lucide-react'
2
- import { formatCount, timeAgo } from '@/lib/format'
3
- import type { Post } from '@/lib/types'
4
- import CodeBadge from './CodeBadge'
5
-
6
- const KIND_LABEL: Record<string, string> = { gift: '赠链', box: '盲盒链接', talk: '讨论' }
7
-
8
- function sourceLabel(post: Post) {
9
- if (post.source === 'telegram') return 'Telegram'
10
- if (post.source === 'manual') return '手动添加'
11
- return 'X'
12
- }
13
-
14
- /** Render text with links clickable and the gift links highlighted. */
15
- function RichText({ text }: { text: string }) {
16
- const parts = text.split(/(https?:\/\/[^\s<>"'))】]+)/g)
17
- return (
18
- <p className="whitespace-pre-wrap break-words text-[14px] leading-6 text-fg-base">
19
- {parts.map((part, i) =>
20
- /^https?:\/\//.test(part) ? (
21
- <a
22
- key={i}
23
- href={part}
24
- target="_blank"
25
- rel="noreferrer"
26
- className={
27
- /mystery-box\/g\//i.test(part)
28
- ? 'rounded bg-brand-10 px-1 font-mono text-[13px] text-brand-100 hover:underline'
29
- : 'text-brand-100 hover:underline'
30
- }
31
- >
32
- {part.replace(/^https?:\/\//, '').slice(0, 60)}
33
- {part.replace(/^https?:\/\//, '').length > 60 ? '…' : ''}
34
- </a>
35
- ) : (
36
- <span key={i}>{part}</span>
37
- )
38
- )}
39
- </p>
40
- )
41
- }
42
-
43
- export default function PostCard({ post }: { post: Post }) {
44
- const media = (post.media || []).filter((m) => m?.url).slice(0, 4)
45
- const author = post.author_name || post.author || '未知'
46
- const handle = post.source === 'x' && post.author ? `@${post.author}` : null
47
- const created = post.created_at ? post.created_at * 1000 : null
48
- const codes = post.codes || []
49
- const usable = codes.some((c) => c.usable)
50
- const text = post.text || ''
51
-
52
- return (
53
- <article
54
- className={`rounded-[14px] border bg-[var(--bg-subtle)] p-4 transition-colors ${
55
- usable ? 'border-brand-60' : 'border-[var(--border-strong)]'
56
- }`}
57
- >
58
- <header className="flex items-start justify-between gap-3">
59
- <div className="min-w-0">
60
- <div className="flex flex-wrap items-center gap-x-2 gap-y-0.5">
61
- <span className="truncate text-sm font-bold">{author}</span>
62
- {handle && <span className="text-xs text-fg-muted">{handle}</span>}
63
- </div>
64
- <div className="mt-0.5 flex flex-wrap items-center gap-x-2 text-[11px] text-fg-muted">
65
- <span className="inline-flex items-center gap-1">
66
- {post.source === 'telegram' && <Send className="h-3 w-3" />}
67
- {sourceLabel(post)}
68
- </span>
69
- {post.via && post.source === 'telegram' && <span className="truncate">· {post.via}</span>}
70
- {created && <span>· {timeAgo(created)}</span>}
71
- </div>
72
- </div>
73
- <div className="flex shrink-0 items-center gap-2">
74
- <span
75
- className={`rounded-full px-2 py-0.5 text-[11px] font-medium ${
76
- post.kind === 'gift' ? 'bg-brand-10 text-brand-100' : 'bg-[var(--bg-subtle-hover)] text-fg-muted'
77
- }`}
78
- >
79
- {KIND_LABEL[post.kind] || post.kind}
80
- </span>
81
- {post.url && (
82
- <a
83
- href={post.url}
84
- target="_blank"
85
- rel="noreferrer"
86
- className="text-fg-muted hover:text-fg-base"
87
- title="打开原帖"
88
- >
89
- <ExternalLink className="h-4 w-4" />
90
- </a>
91
- )}
92
- </div>
93
- </header>
94
-
95
- {text && (
96
- <div className="mt-3">
97
- <RichText text={text.length > 900 ? `${text.slice(0, 900)}…` : text} />
98
- </div>
99
- )}
100
-
101
- {media.length > 0 && (
102
- <div className={`mt-3 grid gap-1.5 ${media.length > 1 ? 'grid-cols-2' : 'grid-cols-1'}`}>
103
- {media.map((m, i) => (
104
- <a key={i} href={m.url} target="_blank" rel="noreferrer" className="block overflow-hidden rounded-lg">
105
- <img src={m.url} alt="" loading="lazy" className="max-h-72 w-full object-cover" />
106
- </a>
107
- ))}
108
- </div>
109
- )}
110
-
111
- {codes.length > 0 && (
112
- <div className="mt-3 flex flex-wrap gap-2">
113
- {codes.map((code) => (
114
- <CodeBadge key={code.code} info={code} />
115
- ))}
116
- </div>
117
- )}
118
-
119
- {post.source === 'x' && (post.views || post.likes || post.reposts || post.replies) ? (
120
- <footer className="mt-3 flex flex-wrap gap-4 text-[11px] text-fg-muted">
121
- <span className="inline-flex items-center gap-1">
122
- <MessageCircle className="h-3 w-3" />
123
- {formatCount(post.replies)}
124
- </span>
125
- <span className="inline-flex items-center gap-1">
126
- <Repeat2 className="h-3 w-3" />
127
- {formatCount(post.reposts)}
128
- </span>
129
- <span className="inline-flex items-center gap-1">
130
- <Heart className="h-3 w-3" />
131
- {formatCount(post.likes)}
132
- </span>
133
- <span className="inline-flex items-center gap-1">
134
- <Eye className="h-3 w-3" />
135
- {formatCount(post.views)}
136
- </span>
137
- </footer>
138
- ) : null}
139
- </article>
140
- )
141
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
frontend/src/components/SettingsPanel.tsx DELETED
@@ -1,637 +0,0 @@
1
- import { useState, type ReactNode } from 'react'
2
- import { useQuery, useQueryClient } from '@tanstack/react-query'
3
- import { Loader2, Lock, Plus, Trash2 } from 'lucide-react'
4
- import { ApiError, getAdminKey, request, setAdminKey } from '@/lib/api'
5
- import { timeAgo } from '@/lib/format'
6
- import type { SettingsResponse, StatusResponse, TgChat, TgDialog } from '@/lib/types'
7
-
8
- /* ------------------------------------------------------------- helpers -- */
9
-
10
- function Section({ title, hint, children }: { title: string; hint?: ReactNode; children: ReactNode }) {
11
- return (
12
- <section className="rounded-[14px] border border-[var(--border-strong)] bg-[var(--bg-subtle)] p-4">
13
- <h3 className="text-sm font-bold">{title}</h3>
14
- {hint && <div className="mt-1 text-xs leading-5 text-fg-muted">{hint}</div>}
15
- <div className="mt-3 space-y-3">{children}</div>
16
- </section>
17
- )
18
- }
19
-
20
- function Btn({
21
- children,
22
- onClick,
23
- busy,
24
- kind = 'primary',
25
- disabled,
26
- }: {
27
- children: ReactNode
28
- onClick: () => void
29
- busy?: boolean
30
- kind?: 'primary' | 'ghost' | 'danger'
31
- disabled?: boolean
32
- }) {
33
- const style =
34
- kind === 'primary'
35
- ? 'bg-brand-100 text-white hover:opacity-90'
36
- : kind === 'danger'
37
- ? 'border border-red-500/40 text-red-400 hover:bg-red-500/10'
38
- : 'border border-[var(--border-strong)] text-fg-base hover:bg-[var(--bg-subtle-hover)]'
39
- return (
40
- <button
41
- type="button"
42
- onClick={onClick}
43
- disabled={busy || disabled}
44
- className={`inline-flex items-center justify-center gap-1.5 rounded-lg px-3 py-1.5 text-xs font-semibold transition disabled:opacity-50 ${style}`}
45
- >
46
- {busy && <Loader2 className="h-3.5 w-3.5 animate-spin" />}
47
- {children}
48
- </button>
49
- )
50
- }
51
-
52
- const inputCls =
53
- 'w-full rounded-lg border border-[var(--border-strong)] bg-background px-3 py-2 text-sm outline-none focus:border-brand-60'
54
-
55
- function Dot({ tone }: { tone: 'ok' | 'warn' | 'bad' | 'off' }) {
56
- const color = { ok: 'bg-emerald-400', warn: 'bg-amber-400', bad: 'bg-red-400', off: 'bg-zinc-500' }[tone]
57
- return <span className={`inline-block h-2 w-2 shrink-0 rounded-full ${color}`} />
58
- }
59
-
60
- function Msg({ text, error }: { text: string | null; error?: boolean }) {
61
- if (!text) return null
62
- return <p className={`text-xs leading-5 ${error ? 'text-red-400' : 'text-emerald-400'}`}>{text}</p>
63
- }
64
-
65
- /** Run an action with busy + message state. */
66
- function useAction() {
67
- const [busy, setBusy] = useState<string | null>(null)
68
- const [msg, setMsg] = useState<{ text: string; error?: boolean; at: string } | null>(null)
69
- async function run(name: string, fn: () => Promise<string | void>) {
70
- setBusy(name)
71
- setMsg(null)
72
- try {
73
- const text = await fn()
74
- if (text) setMsg({ text, at: name })
75
- } catch (err) {
76
- setMsg({ text: err instanceof Error ? err.message : String(err), error: true, at: name })
77
- } finally {
78
- setBusy(null)
79
- }
80
- }
81
- const msgFor = (...names: string[]) => (msg && names.includes(msg.at) ? <Msg text={msg.text} error={msg.error} /> : null)
82
- return { busy, run, msgFor }
83
- }
84
-
85
- /* --------------------------------------------------------------- panel -- */
86
-
87
- export default function SettingsPanel({ status }: { status?: StatusResponse }) {
88
- const qc = useQueryClient()
89
- const settings = useQuery<SettingsResponse, ApiError>({
90
- queryKey: ['settings'],
91
- queryFn: () => request<SettingsResponse>('settings'),
92
- refetchInterval: 15000,
93
- retry: (count, err) => !(err instanceof ApiError && err.needsKey) && count < 2,
94
- })
95
- const refresh = () => {
96
- qc.invalidateQueries({ queryKey: ['settings'] })
97
- qc.invalidateQueries({ queryKey: ['status'] })
98
- }
99
-
100
- if (settings.error?.needsKey) return <KeyGate onDone={refresh} />
101
- if (settings.isLoading || !settings.data)
102
- return (
103
- <div className="flex items-center gap-2 p-6 text-sm text-fg-muted">
104
- <Loader2 className="h-4 w-4 animate-spin" />
105
- {settings.error ? settings.error.message : '读取设置…'}
106
- </div>
107
- )
108
-
109
- const s = settings.data
110
- return (
111
- <div className="space-y-4">
112
- <AddBox onDone={refresh} />
113
- <XSection s={s} onDone={refresh} />
114
- <TelegramSection s={s} onDone={refresh} />
115
- <PushSection s={s} onDone={refresh} />
116
- <KeySection locked={s.locked} onDone={refresh} />
117
- <LogSection status={status} />
118
- </div>
119
- )
120
- }
121
-
122
- function KeyGate({ onDone }: { onDone: () => void }) {
123
- const [key, setKey] = useState(getAdminKey())
124
- const { busy, run, msgFor } = useAction()
125
- return (
126
- <Section title="输入管理密码" hint="设置页面需要管理密码,输入一次后这台设备会记住。">
127
- <div className="flex gap-2">
128
- <input className={inputCls} type="password" value={key} onChange={(e) => setKey(e.target.value)} placeholder="管理密码" />
129
- <Btn
130
- busy={busy === 'key'}
131
- onClick={() =>
132
- run('key', async () => {
133
- setAdminKey(key.trim())
134
- await request('auth/check', { body: {} })
135
- onDone()
136
- })
137
- }
138
- >
139
- <Lock className="h-3.5 w-3.5" />
140
- 确认
141
- </Btn>
142
- </div>
143
- {msgFor('key')}
144
- </Section>
145
- )
146
- }
147
-
148
- /* -------------------------------------------------------------- add box -- */
149
-
150
- function AddBox({ onDone }: { onDone: () => void }) {
151
- const qc = useQueryClient()
152
- const [input, setInput] = useState('')
153
- const { busy, run, msgFor } = useAction()
154
- return (
155
- <Section title="手动添加" hint="粘贴推文链接、赠链链接或赠链码(可多个,用空格隔开),会立刻检查名额,有名额就推送。">
156
- <div className="flex gap-2">
157
- <input
158
- className={inputCls}
159
- value={input}
160
- onChange={(e) => setInput(e.target.value)}
161
- placeholder="https://x.com/…/status/… 或 赠链码"
162
- />
163
- <Btn
164
- busy={busy === 'add'}
165
- disabled={!input.trim()}
166
- onClick={() =>
167
- run('add', async () => {
168
- const r = await request<{ message?: string; codes?: { code: string; usable: boolean; seats: number | null; status: string | null }[]; pushed?: unknown[] }>('add', {
169
- body: { input },
170
- })
171
- setInput('')
172
- qc.invalidateQueries({ queryKey: ['feed'] })
173
- onDone()
174
- if (r.message) return r.message
175
- const list = (r.codes || [])
176
- .map((c) => `${c.code}:${c.usable ? `有名额(${c.seats} 份)` : c.status === 'INVALID' ? '无效' : '已不可用'}`)
177
- .join(';')
178
- return `已添加 ${list}${r.pushed?.length ? ',已推送' : ''}`
179
- })
180
- }
181
- >
182
- <Plus className="h-3.5 w-3.5" />
183
- 添加
184
- </Btn>
185
- </div>
186
- {msgFor('add')}
187
- </Section>
188
- )
189
- }
190
-
191
- /* -------------------------------------------------------------------- X -- */
192
-
193
- function XSection({ s, onDone }: { s: SettingsResponse; onDone: () => void }) {
194
- const [cookies, setCookies] = useState('')
195
- const { busy, run, msgFor } = useAction()
196
- const x = s.x
197
- const tone = !x.connected ? 'off' : x.expired ? 'bad' : x.pausedUntil ? 'warn' : 'ok'
198
- const label = !x.connected
199
- ? '未登录:只能读少数账号主页,很多赠链会漏掉'
200
- : x.expired
201
- ? `登录已失效:${x.error || '请重新粘贴 Cookie'}`
202
- : x.pausedUntil
203
- ? `X 限流中,${timeAgo(x.pausedUntil * 1000).replace('前', '后')}自动恢复`
204
- : `已登录${x.username ? ` @${x.username}` : ''},每分钟搜索一次`
205
- return (
206
- <Section
207
- title="X(推特)"
208
- hint={
209
- <>
210
- 登录后才能实时搜索全站的赠链。在电脑浏览器登录 x.com → 按 F12 → Application / 存储 → Cookies → x.com,把
211
- <code className="mx-1 rounded bg-background px-1">auth_token</code>和<code className="mx-1 rounded bg-background px-1">ct0</code>
212
- 两项复制进来(格式:auth_token=…; ct0=…)。
213
- </>
214
- }
215
- >
216
- <div className="flex items-center gap-2 text-sm">
217
- <Dot tone={tone} />
218
- <span>{label}</span>
219
- </div>
220
- <textarea
221
- className={`${inputCls} h-20 font-mono text-xs`}
222
- value={cookies}
223
- onChange={(e) => setCookies(e.target.value)}
224
- placeholder="auth_token=xxxx; ct0=xxxx"
225
- />
226
- <div className="flex gap-2">
227
- <Btn
228
- busy={busy === 'x'}
229
- disabled={!cookies.trim()}
230
- onClick={() =>
231
- run('x', async () => {
232
- await request('x/connect', { body: { cookies } })
233
- setCookies('')
234
- onDone()
235
- return 'X 登录成功,已经开始搜索'
236
- })
237
- }
238
- >
239
- {x.connected ? '更新登录' : '登录 X'}
240
- </Btn>
241
- {x.connected && (
242
- <Btn
243
- kind="ghost"
244
- busy={busy === 'x-off'}
245
- onClick={() =>
246
- run('x-off', async () => {
247
- await request('x', { method: 'DELETE' })
248
- onDone()
249
- return '已退出 X'
250
- })
251
- }
252
- >
253
- 退出
254
- </Btn>
255
- )}
256
- </div>
257
- {msgFor('x', 'x-off')}
258
- </Section>
259
- )
260
- }
261
-
262
- /* ------------------------------------------------------------- Telegram -- */
263
-
264
- const TG_PHASE: Record<string, [string, 'ok' | 'warn' | 'bad' | 'off']> = {
265
- live: ['已连接,实时接收消息', 'ok'],
266
- connecting: ['正在连接…', 'warn'],
267
- waiting: ['刚启动,稍等一下再连接(避免和旧实例冲突)', 'warn'],
268
- 'needs-login': ['需要登录', 'bad'],
269
- flood: ['Telegram 限流中,稍后自动恢复', 'warn'],
270
- error: ['连接出错,会自动重试', 'bad'],
271
- off: ['未开启', 'off'],
272
- }
273
-
274
- function TelegramSection({ s, onDone }: { s: SettingsResponse; onDone: () => void }) {
275
- const t = s.telegram
276
- const [phone, setPhone] = useState('')
277
- const [code, setCode] = useState('')
278
- const [password, setPassword] = useState('')
279
- const [link, setLink] = useState('')
280
- const [dialogs, setDialogs] = useState<TgDialog[] | null>(null)
281
- const { busy, run, msgFor } = useAction()
282
- const [label, tone] = TG_PHASE[t.phase] || [t.phase, 'warn']
283
- const live = t.phase === 'live'
284
- const showLogin = !live || t.pendingCode
285
-
286
- return (
287
- <Section
288
- title="Telegram"
289
- hint="用你的 Telegram 账号读取群和频道里的消息。登录后,你加入的所有群里一出现赠链都会被收录;下面列表里的群还会补读离线期间的历史消息。"
290
- >
291
- <div className="flex flex-wrap items-center gap-2 text-sm">
292
- <Dot tone={tone} />
293
- <span>{label}</span>
294
- {live && t.me?.name && <span className="text-fg-muted">· {t.me.name}</span>}
295
- </div>
296
- {t.error && <p className="text-xs text-red-400">{t.error}</p>}
297
-
298
- {showLogin && (
299
- <div className="space-y-2 rounded-lg border border-[var(--border-strong)] p-3">
300
- {!t.pendingCode ? (
301
- <div className="flex gap-2">
302
- <input className={inputCls} value={phone} onChange={(e) => setPhone(e.target.value)} placeholder="手机号,例如 +8613800138000" />
303
- <Btn
304
- busy={busy === 'tg-start'}
305
- disabled={!phone.trim()}
306
- onClick={() =>
307
- run('tg-start', async () => {
308
- await request('tg/login/start', { body: { phone } })
309
- onDone()
310
- return '验证码已发到你的 Telegram,请在下面填写'
311
- })
312
- }
313
- >
314
- 发送验证码
315
- </Btn>
316
- </div>
317
- ) : (
318
- <>
319
- <input className={inputCls} value={code} onChange={(e) => setCode(e.target.value)} placeholder="Telegram 收到的验证码" />
320
- {t.needsPassword && (
321
- <input
322
- className={inputCls}
323
- type="password"
324
- value={password}
325
- onChange={(e) => setPassword(e.target.value)}
326
- placeholder="两步验证密码"
327
- />
328
- )}
329
- <Btn
330
- busy={busy === 'tg-code'}
331
- disabled={!code.trim()}
332
- onClick={() =>
333
- run('tg-code', async () => {
334
- const r = await request<{ ok: boolean; needPassword?: boolean }>('tg/login/code', { body: { code, password } })
335
- onDone()
336
- if (r.needPassword) return '这个账号开了两步验证,请再填写密码'
337
- setCode('')
338
- setPassword('')
339
- return '登录成功'
340
- })
341
- }
342
- >
343
- 登录
344
- </Btn>
345
- </>
346
- )}
347
- {msgFor('tg-start', 'tg-code')}
348
- </div>
349
- )}
350
-
351
- {t.loggedIn && (
352
- <div className="flex flex-wrap gap-2">
353
- <Btn
354
- kind="ghost"
355
- busy={busy === 'tg-re'}
356
- onClick={() =>
357
- run('tg-re', async () => {
358
- await request('tg/reconnect', { body: {} })
359
- onDone()
360
- return '已重新连接'
361
- })
362
- }
363
- >
364
- 重新连接
365
- </Btn>
366
- <Btn
367
- kind="danger"
368
- busy={busy === 'tg-out'}
369
- onClick={() =>
370
- run('tg-out', async () => {
371
- if (!confirm('确定退出 Telegram 登录?')) return
372
- await request('tg/logout', { body: {} })
373
- onDone()
374
- return '已退出'
375
- })
376
- }
377
- >
378
- 退出登录
379
- </Btn>
380
- {msgFor('tg-re', 'tg-out')}
381
- </div>
382
- )}
383
-
384
- <div>
385
- <p className="mb-2 text-xs font-semibold text-fg-subtle">重点群 / 频道({t.chats.length})</p>
386
- <div className="space-y-1.5">
387
- {t.chats.map((chat) => (
388
- <ChatRow key={chat.id} chat={chat} onDone={onDone} />
389
- ))}
390
- {t.chats.length === 0 && <p className="text-xs text-fg-muted">还没有添加</p>}
391
- </div>
392
- </div>
393
-
394
- {live && (
395
- <div className="space-y-2">
396
- <div className="flex gap-2">
397
- <input
398
- className={inputCls}
399
- value={link}
400
- onChange={(e) => setLink(e.target.value)}
401
- placeholder="群/频道链接,例如 https://t.me/xxx 或 @xxx"
402
- />
403
- <Btn
404
- busy={busy === 'tg-link'}
405
- disabled={!link.trim()}
406
- onClick={() =>
407
- run('tg-link', async () => {
408
- await request('tg/chats', { body: { link } })
409
- setLink('')
410
- onDone()
411
- return '已添加'
412
- })
413
- }
414
- >
415
- 添加
416
- </Btn>
417
- </div>
418
- <Btn
419
- kind="ghost"
420
- busy={busy === 'tg-dialogs'}
421
- onClick={() =>
422
- run('tg-dialogs', async () => {
423
- setDialogs(await request<TgDialog[]>('tg/dialogs'))
424
- })
425
- }
426
- >
427
- 从我加入的群里选
428
- </Btn>
429
- {msgFor('tg-link', 'tg-dialogs')}
430
- {dialogs && (
431
- <div className="max-h-72 space-y-1 overflow-y-auto rounded-lg border border-[var(--border-strong)] p-2">
432
- {dialogs.map((d) => (
433
- <div key={d.id} className="flex items-center justify-between gap-2 px-1 py-1 text-xs">
434
- <span className="min-w-0 truncate">
435
- {d.title || d.username || d.id}
436
- <span className="ml-1 text-fg-muted">
437
- {d.type === 'channel' ? '频道' : '群'}
438
- {d.members ? ` · ${d.members} 人` : ''}
439
- </span>
440
- </span>
441
- {d.tracked ? (
442
- <span className="shrink-0 text-fg-muted">已添加</span>
443
- ) : (
444
- <Btn
445
- kind="ghost"
446
- onClick={() =>
447
- run('tg-dialogs', async () => {
448
- await request('tg/chats', { body: { items: [d] } })
449
- setDialogs((list) => list?.map((x) => (x.id === d.id ? { ...x, tracked: true } : x)) || null)
450
- onDone()
451
- })
452
- }
453
- >
454
- 添加
455
- </Btn>
456
- )}
457
- </div>
458
- ))}
459
- </div>
460
- )}
461
- </div>
462
- )}
463
- </Section>
464
- )
465
- }
466
-
467
- function ChatRow({ chat, onDone }: { chat: TgChat; onDone: () => void }) {
468
- const { busy, run, msgFor } = useAction()
469
- return (
470
- <div className="rounded-lg bg-background/50 px-3 py-2">
471
- <div className="flex items-center justify-between gap-2">
472
- <div className="min-w-0">
473
- <p className="truncate text-sm">
474
- {chat.title || chat.username || chat.id}
475
- {chat.auto ? <span className="ml-1.5 text-[11px] text-fg-muted">自动发现</span> : null}
476
- </p>
477
- <p className="text-[11px] text-fg-muted">
478
- {chat.username ? `@${chat.username} · ` : ''}
479
- {chat.hits ? `已找到 ${chat.hits} 条赠链 · ` : ''}
480
- {chat.full ? '收录所有提到 Surf 的消息' : '只收录赠链和盲盒相关消息'}
481
- </p>
482
- </div>
483
- <div className="flex shrink-0 items-center gap-1">
484
- <Btn
485
- kind="ghost"
486
- busy={busy === 'full'}
487
- onClick={() =>
488
- run('full', async () => {
489
- await request(`tg/chats/${encodeURIComponent(chat.id)}/full`, { body: { full: !chat.full } })
490
- onDone()
491
- })
492
- }
493
- >
494
- {chat.full ? '只看赠链' : '看全部 Surf'}
495
- </Btn>
496
- <button
497
- type="button"
498
- title="移除"
499
- disabled={busy === 'rm'}
500
- onClick={() =>
501
- run('rm', async () => {
502
- await request(`tg/chats/${encodeURIComponent(chat.id)}`, { method: 'DELETE' })
503
- onDone()
504
- })
505
- }
506
- className="rounded-md p-1.5 text-fg-muted hover:bg-red-500/10 hover:text-red-400"
507
- >
508
- <Trash2 className="h-3.5 w-3.5" />
509
- </button>
510
- </div>
511
- </div>
512
- {msgFor('full', 'rm')}
513
- </div>
514
- )
515
- }
516
-
517
- /* ------------------------------------------------------------------ push -- */
518
-
519
- function PushSection({ s, onDone }: { s: SettingsResponse; onDone: () => void }) {
520
- const [hook, setHook] = useState('')
521
- const { busy, run, msgFor } = useAction()
522
- const p = s.push
523
- return (
524
- <Section
525
- title="企业微信推送"
526
- hint="发现还有名额的赠链时,推送到企业微信群机器人。每个赠链只推送一次。"
527
- >
528
- <div className="flex items-center gap-2 text-sm">
529
- <Dot tone={p.configured ? (p.lastError ? 'warn' : 'ok') : 'off'} />
530
- <span className="min-w-0 truncate">{p.configured ? p.webhook : '未设置'}</span>
531
- </div>
532
- {p.configured && (
533
- <p className="text-xs text-fg-muted">
534
- 本次运行已推送 {p.pushed} 条{p.lastPush ? `,最近一次 ${timeAgo(p.lastPush * 1000)}` : ''}
535
- </p>
536
- )}
537
- {p.lastError && <p className="text-xs text-red-400">最近一次失败:{p.lastError}</p>}
538
- <div className="flex gap-2">
539
- <input
540
- className={inputCls}
541
- value={hook}
542
- onChange={(e) => setHook(e.target.value)}
543
- placeholder="https://qyapi.weixin.qq.com/cgi-bin/webhook/send?key=…"
544
- />
545
- <Btn
546
- busy={busy === 'hook'}
547
- disabled={!hook.trim()}
548
- onClick={() =>
549
- run('hook', async () => {
550
- await request('notify', { body: { webhook: hook } })
551
- setHook('')
552
- onDone()
553
- return '已保存'
554
- })
555
- }
556
- >
557
- 保存
558
- </Btn>
559
- </div>
560
- {p.configured && (
561
- <Btn
562
- kind="ghost"
563
- busy={busy === 'test'}
564
- onClick={() =>
565
- run('test', async () => {
566
- await request('notify/test', { body: {} })
567
- return '测试消息已发出,去企业微信群里看看'
568
- })
569
- }
570
- >
571
- 发一条测试消息
572
- </Btn>
573
- )}
574
- {msgFor('hook', 'test')}
575
- </Section>
576
- )
577
- }
578
-
579
- /* ------------------------------------------------------------- admin key -- */
580
-
581
- function KeySection({ locked, onDone }: { locked: boolean; onDone: () => void }) {
582
- const [key, setKey] = useState('')
583
- const { busy, run, msgFor } = useAction()
584
- return (
585
- <Section
586
- title="管理密码"
587
- hint={
588
- locked
589
- ? '已设置:别人打开网页只能看,不能改设置、登录或退出账号。'
590
- : '还没设置:任何打开这个网页的人都能改设置。建议设置一个。'
591
- }
592
- >
593
- <div className="flex gap-2">
594
- <input
595
- className={inputCls}
596
- type="password"
597
- value={key}
598
- onChange={(e) => setKey(e.target.value)}
599
- placeholder={locked ? '新密码(留空则取消密码)' : '设置密码(至少 6 位)'}
600
- />
601
- <Btn
602
- busy={busy === 'setkey'}
603
- onClick={() =>
604
- run('setkey', async () => {
605
- await request('auth/key', { body: { key } })
606
- setAdminKey(key.trim())
607
- setKey('')
608
- onDone()
609
- return key.trim() ? '已设置,这台设备会记住密码' : '已取消密码'
610
- })
611
- }
612
- >
613
- 保存
614
- </Btn>
615
- </div>
616
- {msgFor('setkey')}
617
- </Section>
618
- )
619
- }
620
-
621
- /* ------------------------------------------------------------------- log -- */
622
-
623
- function LogSection({ status }: { status?: StatusResponse }) {
624
- const lines = [...(status?.log || [])].reverse().slice(0, 60)
625
- return (
626
- <Section title="运行记录" hint="最近的抓取、推送和出错情况(最新的在最上面)。">
627
- <div className="max-h-80 space-y-1 overflow-y-auto font-mono text-[11px] leading-5">
628
- {lines.map((line, i) => (
629
- <div key={i} className={line.level === 'error' ? 'text-red-400' : line.level === 'warn' ? 'text-amber-400' : 'text-fg-subtle'}>
630
- <span className="text-fg-muted">{new Date(line.at * 1000).toLocaleTimeString('zh-CN', { hour12: false })}</span> {line.message}
631
- </div>
632
- ))}
633
- {lines.length === 0 && <p className="text-fg-muted">暂无记录</p>}
634
- </div>
635
- </Section>
636
- )
637
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
frontend/src/components/ui/accordion.tsx DELETED
@@ -1,55 +0,0 @@
1
- import * as React from "react"
2
- import * as AccordionPrimitive from "@radix-ui/react-accordion"
3
- import { ChevronDown } from "lucide-react"
4
-
5
- import { cn } from "@/lib/utils"
6
-
7
- const Accordion = AccordionPrimitive.Root
8
-
9
- const AccordionItem = React.forwardRef<
10
- React.ElementRef<typeof AccordionPrimitive.Item>,
11
- React.ComponentPropsWithoutRef<typeof AccordionPrimitive.Item>
12
- >(({ className, ...props }, ref) => (
13
- <AccordionPrimitive.Item
14
- ref={ref}
15
- className={cn("border-b", className)}
16
- {...props}
17
- />
18
- ))
19
- AccordionItem.displayName = "AccordionItem"
20
-
21
- const AccordionTrigger = React.forwardRef<
22
- React.ElementRef<typeof AccordionPrimitive.Trigger>,
23
- React.ComponentPropsWithoutRef<typeof AccordionPrimitive.Trigger>
24
- >(({ className, children, ...props }, ref) => (
25
- <AccordionPrimitive.Header className="flex">
26
- <AccordionPrimitive.Trigger
27
- ref={ref}
28
- className={cn(
29
- "flex flex-1 items-center justify-between py-4 text-sm font-medium transition-all hover:underline text-left [&[data-state=open]>svg]:rotate-180",
30
- className
31
- )}
32
- {...props}
33
- >
34
- {children}
35
- <ChevronDown className="h-4 w-4 shrink-0 text-muted-foreground transition-transform duration-200" />
36
- </AccordionPrimitive.Trigger>
37
- </AccordionPrimitive.Header>
38
- ))
39
- AccordionTrigger.displayName = AccordionPrimitive.Trigger.displayName
40
-
41
- const AccordionContent = React.forwardRef<
42
- React.ElementRef<typeof AccordionPrimitive.Content>,
43
- React.ComponentPropsWithoutRef<typeof AccordionPrimitive.Content>
44
- >(({ className, children, ...props }, ref) => (
45
- <AccordionPrimitive.Content
46
- ref={ref}
47
- className="overflow-hidden text-sm data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down"
48
- {...props}
49
- >
50
- <div className={cn("pb-4 pt-0", className)}>{children}</div>
51
- </AccordionPrimitive.Content>
52
- ))
53
- AccordionContent.displayName = AccordionPrimitive.Content.displayName
54
-
55
- export { Accordion, AccordionItem, AccordionTrigger, AccordionContent }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
frontend/src/components/ui/alert.tsx DELETED
@@ -1,59 +0,0 @@
1
- import * as React from "react"
2
- import { cva, type VariantProps } from "class-variance-authority"
3
-
4
- import { cn } from "@/lib/utils"
5
-
6
- const alertVariants = cva(
7
- "relative w-full rounded-lg border px-4 py-3 text-sm [&>svg+div]:translate-y-[-3px] [&>svg]:absolute [&>svg]:left-4 [&>svg]:top-4 [&>svg]:text-foreground [&>svg~*]:pl-7",
8
- {
9
- variants: {
10
- variant: {
11
- default: "bg-background text-foreground",
12
- destructive:
13
- "border-destructive/50 text-destructive dark:border-destructive [&>svg]:text-destructive",
14
- },
15
- },
16
- defaultVariants: {
17
- variant: "default",
18
- },
19
- }
20
- )
21
-
22
- const Alert = React.forwardRef<
23
- HTMLDivElement,
24
- React.HTMLAttributes<HTMLDivElement> & VariantProps<typeof alertVariants>
25
- >(({ className, variant, ...props }, ref) => (
26
- <div
27
- ref={ref}
28
- role="alert"
29
- className={cn(alertVariants({ variant }), className)}
30
- {...props}
31
- />
32
- ))
33
- Alert.displayName = "Alert"
34
-
35
- const AlertTitle = React.forwardRef<
36
- HTMLParagraphElement,
37
- React.HTMLAttributes<HTMLHeadingElement>
38
- >(({ className, ...props }, ref) => (
39
- <h5
40
- ref={ref}
41
- className={cn("mb-1 font-medium leading-none tracking-tight", className)}
42
- {...props}
43
- />
44
- ))
45
- AlertTitle.displayName = "AlertTitle"
46
-
47
- const AlertDescription = React.forwardRef<
48
- HTMLParagraphElement,
49
- React.HTMLAttributes<HTMLParagraphElement>
50
- >(({ className, ...props }, ref) => (
51
- <div
52
- ref={ref}
53
- className={cn("text-sm [&_p]:leading-relaxed", className)}
54
- {...props}
55
- />
56
- ))
57
- AlertDescription.displayName = "AlertDescription"
58
-
59
- export { Alert, AlertTitle, AlertDescription }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
frontend/src/components/ui/aspect-ratio.tsx DELETED
@@ -1,5 +0,0 @@
1
- import * as AspectRatioPrimitive from "@radix-ui/react-aspect-ratio"
2
-
3
- const AspectRatio = AspectRatioPrimitive.Root
4
-
5
- export { AspectRatio }
 
 
 
 
 
 
frontend/src/components/ui/avatar.tsx DELETED
@@ -1,48 +0,0 @@
1
- import * as React from "react"
2
- import * as AvatarPrimitive from "@radix-ui/react-avatar"
3
-
4
- import { cn } from "@/lib/utils"
5
-
6
- const Avatar = React.forwardRef<
7
- React.ElementRef<typeof AvatarPrimitive.Root>,
8
- React.ComponentPropsWithoutRef<typeof AvatarPrimitive.Root>
9
- >(({ className, ...props }, ref) => (
10
- <AvatarPrimitive.Root
11
- ref={ref}
12
- className={cn(
13
- "relative flex h-10 w-10 shrink-0 overflow-hidden rounded-full",
14
- className
15
- )}
16
- {...props}
17
- />
18
- ))
19
- Avatar.displayName = AvatarPrimitive.Root.displayName
20
-
21
- const AvatarImage = React.forwardRef<
22
- React.ElementRef<typeof AvatarPrimitive.Image>,
23
- React.ComponentPropsWithoutRef<typeof AvatarPrimitive.Image>
24
- >(({ className, ...props }, ref) => (
25
- <AvatarPrimitive.Image
26
- ref={ref}
27
- className={cn("aspect-square h-full w-full", className)}
28
- {...props}
29
- />
30
- ))
31
- AvatarImage.displayName = AvatarPrimitive.Image.displayName
32
-
33
- const AvatarFallback = React.forwardRef<
34
- React.ElementRef<typeof AvatarPrimitive.Fallback>,
35
- React.ComponentPropsWithoutRef<typeof AvatarPrimitive.Fallback>
36
- >(({ className, ...props }, ref) => (
37
- <AvatarPrimitive.Fallback
38
- ref={ref}
39
- className={cn(
40
- "flex h-full w-full items-center justify-center rounded-full bg-muted",
41
- className
42
- )}
43
- {...props}
44
- />
45
- ))
46
- AvatarFallback.displayName = AvatarPrimitive.Fallback.displayName
47
-
48
- export { Avatar, AvatarImage, AvatarFallback }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
frontend/src/components/ui/badge.tsx DELETED
@@ -1,36 +0,0 @@
1
- import * as React from "react"
2
- import { cva, type VariantProps } from "class-variance-authority"
3
-
4
- import { cn } from "@/lib/utils"
5
-
6
- const badgeVariants = cva(
7
- "inline-flex items-center rounded-md border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",
8
- {
9
- variants: {
10
- variant: {
11
- default:
12
- "border-transparent bg-primary text-primary-foreground shadow hover:bg-primary/80",
13
- secondary:
14
- "border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",
15
- destructive:
16
- "border-transparent bg-destructive text-destructive-foreground shadow hover:bg-destructive/80",
17
- outline: "text-foreground",
18
- },
19
- },
20
- defaultVariants: {
21
- variant: "default",
22
- },
23
- }
24
- )
25
-
26
- export interface BadgeProps
27
- extends React.HTMLAttributes<HTMLDivElement>,
28
- VariantProps<typeof badgeVariants> {}
29
-
30
- function Badge({ className, variant, ...props }: BadgeProps) {
31
- return (
32
- <div className={cn(badgeVariants({ variant }), className)} {...props} />
33
- )
34
- }
35
-
36
- export { Badge, badgeVariants }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
frontend/src/components/ui/breadcrumb.tsx DELETED
@@ -1,115 +0,0 @@
1
- import * as React from "react"
2
- import { Slot } from "@radix-ui/react-slot"
3
- import { ChevronRight, MoreHorizontal } from "lucide-react"
4
-
5
- import { cn } from "@/lib/utils"
6
-
7
- const Breadcrumb = React.forwardRef<
8
- HTMLElement,
9
- React.ComponentPropsWithoutRef<"nav"> & {
10
- separator?: React.ReactNode
11
- }
12
- >(({ ...props }, ref) => <nav ref={ref} aria-label="breadcrumb" {...props} />)
13
- Breadcrumb.displayName = "Breadcrumb"
14
-
15
- const BreadcrumbList = React.forwardRef<
16
- HTMLOListElement,
17
- React.ComponentPropsWithoutRef<"ol">
18
- >(({ className, ...props }, ref) => (
19
- <ol
20
- ref={ref}
21
- className={cn(
22
- "flex flex-wrap items-center gap-1.5 break-words text-sm text-muted-foreground sm:gap-2.5",
23
- className
24
- )}
25
- {...props}
26
- />
27
- ))
28
- BreadcrumbList.displayName = "BreadcrumbList"
29
-
30
- const BreadcrumbItem = React.forwardRef<
31
- HTMLLIElement,
32
- React.ComponentPropsWithoutRef<"li">
33
- >(({ className, ...props }, ref) => (
34
- <li
35
- ref={ref}
36
- className={cn("inline-flex items-center gap-1.5", className)}
37
- {...props}
38
- />
39
- ))
40
- BreadcrumbItem.displayName = "BreadcrumbItem"
41
-
42
- const BreadcrumbLink = React.forwardRef<
43
- HTMLAnchorElement,
44
- React.ComponentPropsWithoutRef<"a"> & {
45
- asChild?: boolean
46
- }
47
- >(({ asChild, className, ...props }, ref) => {
48
- const Comp = asChild ? Slot : "a"
49
-
50
- return (
51
- <Comp
52
- ref={ref}
53
- className={cn("transition-colors hover:text-foreground", className)}
54
- {...props}
55
- />
56
- )
57
- })
58
- BreadcrumbLink.displayName = "BreadcrumbLink"
59
-
60
- const BreadcrumbPage = React.forwardRef<
61
- HTMLSpanElement,
62
- React.ComponentPropsWithoutRef<"span">
63
- >(({ className, ...props }, ref) => (
64
- <span
65
- ref={ref}
66
- role="link"
67
- aria-disabled="true"
68
- aria-current="page"
69
- className={cn("font-normal text-foreground", className)}
70
- {...props}
71
- />
72
- ))
73
- BreadcrumbPage.displayName = "BreadcrumbPage"
74
-
75
- const BreadcrumbSeparator = ({
76
- children,
77
- className,
78
- ...props
79
- }: React.ComponentProps<"li">) => (
80
- <li
81
- role="presentation"
82
- aria-hidden="true"
83
- className={cn("[&>svg]:w-3.5 [&>svg]:h-3.5", className)}
84
- {...props}
85
- >
86
- {children ?? <ChevronRight />}
87
- </li>
88
- )
89
- BreadcrumbSeparator.displayName = "BreadcrumbSeparator"
90
-
91
- const BreadcrumbEllipsis = ({
92
- className,
93
- ...props
94
- }: React.ComponentProps<"span">) => (
95
- <span
96
- role="presentation"
97
- aria-hidden="true"
98
- className={cn("flex h-9 w-9 items-center justify-center", className)}
99
- {...props}
100
- >
101
- <MoreHorizontal className="h-4 w-4" />
102
- <span className="sr-only">More</span>
103
- </span>
104
- )
105
- BreadcrumbEllipsis.displayName = "BreadcrumbElipssis"
106
-
107
- export {
108
- Breadcrumb,
109
- BreadcrumbList,
110
- BreadcrumbItem,
111
- BreadcrumbLink,
112
- BreadcrumbPage,
113
- BreadcrumbSeparator,
114
- BreadcrumbEllipsis,
115
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
frontend/src/components/ui/button.tsx DELETED
@@ -1,57 +0,0 @@
1
- import * as React from "react"
2
- import { Slot } from "@radix-ui/react-slot"
3
- import { cva, type VariantProps } from "class-variance-authority"
4
-
5
- import { cn } from "@/lib/utils"
6
-
7
- const buttonVariants = cva(
8
- "inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",
9
- {
10
- variants: {
11
- variant: {
12
- default:
13
- "bg-primary text-primary-foreground shadow hover:bg-primary/90",
14
- destructive:
15
- "bg-destructive text-destructive-foreground shadow-sm hover:bg-destructive/90",
16
- outline:
17
- "border border-input bg-background shadow-sm hover:bg-accent hover:text-accent-foreground",
18
- secondary:
19
- "bg-secondary text-secondary-foreground shadow-sm hover:bg-secondary/80",
20
- ghost: "hover:bg-accent hover:text-accent-foreground",
21
- link: "text-primary underline-offset-4 hover:underline",
22
- },
23
- size: {
24
- default: "h-9 px-4 py-2",
25
- sm: "h-8 rounded-md px-3 text-xs",
26
- lg: "h-10 rounded-md px-8",
27
- icon: "h-9 w-9",
28
- },
29
- },
30
- defaultVariants: {
31
- variant: "default",
32
- size: "default",
33
- },
34
- }
35
- )
36
-
37
- export interface ButtonProps
38
- extends React.ButtonHTMLAttributes<HTMLButtonElement>,
39
- VariantProps<typeof buttonVariants> {
40
- asChild?: boolean
41
- }
42
-
43
- const Button = React.forwardRef<HTMLButtonElement, ButtonProps>(
44
- ({ className, variant, size, asChild = false, ...props }, ref) => {
45
- const Comp = asChild ? Slot : "button"
46
- return (
47
- <Comp
48
- className={cn(buttonVariants({ variant, size, className }))}
49
- ref={ref}
50
- {...props}
51
- />
52
- )
53
- }
54
- )
55
- Button.displayName = "Button"
56
-
57
- export { Button, buttonVariants }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
frontend/src/components/ui/calendar.tsx DELETED
@@ -1,211 +0,0 @@
1
- import * as React from "react"
2
- import {
3
- ChevronDownIcon,
4
- ChevronLeftIcon,
5
- ChevronRightIcon,
6
- } from "lucide-react"
7
- import { DayButton, DayPicker, getDefaultClassNames } from "react-day-picker"
8
-
9
- import { cn } from "@/lib/utils"
10
- import { Button, buttonVariants } from "@/components/ui/button"
11
-
12
- function Calendar({
13
- className,
14
- classNames,
15
- showOutsideDays = true,
16
- captionLayout = "label",
17
- buttonVariant = "ghost",
18
- formatters,
19
- components,
20
- ...props
21
- }: React.ComponentProps<typeof DayPicker> & {
22
- buttonVariant?: React.ComponentProps<typeof Button>["variant"]
23
- }) {
24
- const defaultClassNames = getDefaultClassNames()
25
-
26
- return (
27
- <DayPicker
28
- showOutsideDays={showOutsideDays}
29
- className={cn(
30
- "bg-background group/calendar p-3 [--cell-size:2rem] [[data-slot=card-content]_&]:bg-transparent [[data-slot=popover-content]_&]:bg-transparent",
31
- String.raw`rtl:**:[.rdp-button\_next>svg]:rotate-180`,
32
- String.raw`rtl:**:[.rdp-button\_previous>svg]:rotate-180`,
33
- className
34
- )}
35
- captionLayout={captionLayout}
36
- formatters={{
37
- formatMonthDropdown: (date) =>
38
- date.toLocaleString("default", { month: "short" }),
39
- ...formatters,
40
- }}
41
- classNames={{
42
- root: cn("w-fit", defaultClassNames.root),
43
- months: cn(
44
- "relative flex flex-col gap-4 md:flex-row",
45
- defaultClassNames.months
46
- ),
47
- month: cn("flex w-full flex-col gap-4", defaultClassNames.month),
48
- nav: cn(
49
- "absolute inset-x-0 top-0 flex w-full items-center justify-between gap-1",
50
- defaultClassNames.nav
51
- ),
52
- button_previous: cn(
53
- buttonVariants({ variant: buttonVariant }),
54
- "h-[--cell-size] w-[--cell-size] select-none p-0 aria-disabled:opacity-50",
55
- defaultClassNames.button_previous
56
- ),
57
- button_next: cn(
58
- buttonVariants({ variant: buttonVariant }),
59
- "h-[--cell-size] w-[--cell-size] select-none p-0 aria-disabled:opacity-50",
60
- defaultClassNames.button_next
61
- ),
62
- month_caption: cn(
63
- "flex h-[--cell-size] w-full items-center justify-center px-[--cell-size]",
64
- defaultClassNames.month_caption
65
- ),
66
- dropdowns: cn(
67
- "flex h-[--cell-size] w-full items-center justify-center gap-1.5 text-sm font-medium",
68
- defaultClassNames.dropdowns
69
- ),
70
- dropdown_root: cn(
71
- "has-focus:border-ring border-input shadow-xs has-focus:ring-ring/50 has-focus:ring-[3px] relative rounded-md border",
72
- defaultClassNames.dropdown_root
73
- ),
74
- dropdown: cn(
75
- "bg-popover absolute inset-0 opacity-0",
76
- defaultClassNames.dropdown
77
- ),
78
- caption_label: cn(
79
- "select-none font-medium",
80
- captionLayout === "label"
81
- ? "text-sm"
82
- : "[&>svg]:text-muted-foreground flex h-8 items-center gap-1 rounded-md pl-2 pr-1 text-sm [&>svg]:size-3.5",
83
- defaultClassNames.caption_label
84
- ),
85
- table: "w-full border-collapse",
86
- weekdays: cn("flex", defaultClassNames.weekdays),
87
- weekday: cn(
88
- "text-muted-foreground flex-1 select-none rounded-md text-[0.8rem] font-normal",
89
- defaultClassNames.weekday
90
- ),
91
- week: cn("mt-2 flex w-full", defaultClassNames.week),
92
- week_number_header: cn(
93
- "w-[--cell-size] select-none",
94
- defaultClassNames.week_number_header
95
- ),
96
- week_number: cn(
97
- "text-muted-foreground select-none text-[0.8rem]",
98
- defaultClassNames.week_number
99
- ),
100
- day: cn(
101
- "group/day relative aspect-square h-full w-full select-none p-0 text-center [&:first-child[data-selected=true]_button]:rounded-l-md [&:last-child[data-selected=true]_button]:rounded-r-md",
102
- defaultClassNames.day
103
- ),
104
- range_start: cn(
105
- "bg-accent rounded-l-md",
106
- defaultClassNames.range_start
107
- ),
108
- range_middle: cn("rounded-none", defaultClassNames.range_middle),
109
- range_end: cn("bg-accent rounded-r-md", defaultClassNames.range_end),
110
- today: cn(
111
- "bg-accent text-accent-foreground rounded-md data-[selected=true]:rounded-none",
112
- defaultClassNames.today
113
- ),
114
- outside: cn(
115
- "text-muted-foreground aria-selected:text-muted-foreground",
116
- defaultClassNames.outside
117
- ),
118
- disabled: cn(
119
- "text-muted-foreground opacity-50",
120
- defaultClassNames.disabled
121
- ),
122
- hidden: cn("invisible", defaultClassNames.hidden),
123
- ...classNames,
124
- }}
125
- components={{
126
- Root: ({ className, rootRef, ...props }) => {
127
- return (
128
- <div
129
- data-slot="calendar"
130
- ref={rootRef}
131
- className={cn(className)}
132
- {...props}
133
- />
134
- )
135
- },
136
- Chevron: ({ className, orientation, ...props }) => {
137
- if (orientation === "left") {
138
- return (
139
- <ChevronLeftIcon className={cn("size-4", className)} {...props} />
140
- )
141
- }
142
-
143
- if (orientation === "right") {
144
- return (
145
- <ChevronRightIcon
146
- className={cn("size-4", className)}
147
- {...props}
148
- />
149
- )
150
- }
151
-
152
- return (
153
- <ChevronDownIcon className={cn("size-4", className)} {...props} />
154
- )
155
- },
156
- DayButton: CalendarDayButton,
157
- WeekNumber: ({ children, ...props }) => {
158
- return (
159
- <td {...props}>
160
- <div className="flex size-[--cell-size] items-center justify-center text-center">
161
- {children}
162
- </div>
163
- </td>
164
- )
165
- },
166
- ...components,
167
- }}
168
- {...props}
169
- />
170
- )
171
- }
172
-
173
- function CalendarDayButton({
174
- className,
175
- day,
176
- modifiers,
177
- ...props
178
- }: React.ComponentProps<typeof DayButton>) {
179
- const defaultClassNames = getDefaultClassNames()
180
-
181
- const ref = React.useRef<HTMLButtonElement>(null)
182
- React.useEffect(() => {
183
- if (modifiers.focused) ref.current?.focus()
184
- }, [modifiers.focused])
185
-
186
- return (
187
- <Button
188
- ref={ref}
189
- variant="ghost"
190
- size="icon"
191
- data-day={day.date.toLocaleDateString()}
192
- data-selected-single={
193
- modifiers.selected &&
194
- !modifiers.range_start &&
195
- !modifiers.range_end &&
196
- !modifiers.range_middle
197
- }
198
- data-range-start={modifiers.range_start}
199
- data-range-end={modifiers.range_end}
200
- data-range-middle={modifiers.range_middle}
201
- className={cn(
202
- "data-[selected-single=true]:bg-primary data-[selected-single=true]:text-primary-foreground data-[range-middle=true]:bg-accent data-[range-middle=true]:text-accent-foreground data-[range-start=true]:bg-primary data-[range-start=true]:text-primary-foreground data-[range-end=true]:bg-primary data-[range-end=true]:text-primary-foreground group-data-[focused=true]/day:border-ring group-data-[focused=true]/day:ring-ring/50 flex aspect-square h-auto w-full min-w-[--cell-size] flex-col gap-1 font-normal leading-none data-[range-end=true]:rounded-md data-[range-middle=true]:rounded-none data-[range-start=true]:rounded-md group-data-[focused=true]/day:relative group-data-[focused=true]/day:z-10 group-data-[focused=true]/day:ring-[3px] [&>span]:text-xs [&>span]:opacity-70",
203
- defaultClassNames.day,
204
- className
205
- )}
206
- {...props}
207
- />
208
- )
209
- }
210
-
211
- export { Calendar, CalendarDayButton }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
frontend/src/components/ui/card.tsx DELETED
@@ -1,76 +0,0 @@
1
- import * as React from "react"
2
-
3
- import { cn } from "@/lib/utils"
4
-
5
- const Card = React.forwardRef<
6
- HTMLDivElement,
7
- React.HTMLAttributes<HTMLDivElement>
8
- >(({ className, ...props }, ref) => (
9
- <div
10
- ref={ref}
11
- className={cn(
12
- "rounded-xl border bg-card text-card-foreground shadow",
13
- className
14
- )}
15
- {...props}
16
- />
17
- ))
18
- Card.displayName = "Card"
19
-
20
- const CardHeader = React.forwardRef<
21
- HTMLDivElement,
22
- React.HTMLAttributes<HTMLDivElement>
23
- >(({ className, ...props }, ref) => (
24
- <div
25
- ref={ref}
26
- className={cn("flex flex-col space-y-1.5 p-6", className)}
27
- {...props}
28
- />
29
- ))
30
- CardHeader.displayName = "CardHeader"
31
-
32
- const CardTitle = React.forwardRef<
33
- HTMLDivElement,
34
- React.HTMLAttributes<HTMLDivElement>
35
- >(({ className, ...props }, ref) => (
36
- <div
37
- ref={ref}
38
- className={cn("font-semibold leading-none tracking-tight", className)}
39
- {...props}
40
- />
41
- ))
42
- CardTitle.displayName = "CardTitle"
43
-
44
- const CardDescription = React.forwardRef<
45
- HTMLDivElement,
46
- React.HTMLAttributes<HTMLDivElement>
47
- >(({ className, ...props }, ref) => (
48
- <div
49
- ref={ref}
50
- className={cn("text-sm text-muted-foreground", className)}
51
- {...props}
52
- />
53
- ))
54
- CardDescription.displayName = "CardDescription"
55
-
56
- const CardContent = React.forwardRef<
57
- HTMLDivElement,
58
- React.HTMLAttributes<HTMLDivElement>
59
- >(({ className, ...props }, ref) => (
60
- <div ref={ref} className={cn("p-6 pt-0", className)} {...props} />
61
- ))
62
- CardContent.displayName = "CardContent"
63
-
64
- const CardFooter = React.forwardRef<
65
- HTMLDivElement,
66
- React.HTMLAttributes<HTMLDivElement>
67
- >(({ className, ...props }, ref) => (
68
- <div
69
- ref={ref}
70
- className={cn("flex items-center p-6 pt-0", className)}
71
- {...props}
72
- />
73
- ))
74
- CardFooter.displayName = "CardFooter"
75
-
76
- export { Card, CardHeader, CardFooter, CardTitle, CardDescription, CardContent }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
frontend/src/components/ui/carousel.tsx DELETED
@@ -1,262 +0,0 @@
1
- "use client"
2
-
3
- import * as React from "react"
4
- import useEmblaCarousel, {
5
- type UseEmblaCarouselType,
6
- } from "embla-carousel-react"
7
- import { ArrowLeft, ArrowRight } from "lucide-react"
8
-
9
- import { cn } from "@/lib/utils"
10
- import { Button } from "@/components/ui/button"
11
-
12
- type CarouselApi = UseEmblaCarouselType[1]
13
- type UseCarouselParameters = Parameters<typeof useEmblaCarousel>
14
- type CarouselOptions = UseCarouselParameters[0]
15
- type CarouselPlugin = UseCarouselParameters[1]
16
-
17
- type CarouselProps = {
18
- opts?: CarouselOptions
19
- plugins?: CarouselPlugin
20
- orientation?: "horizontal" | "vertical"
21
- setApi?: (api: CarouselApi) => void
22
- }
23
-
24
- type CarouselContextProps = {
25
- carouselRef: ReturnType<typeof useEmblaCarousel>[0]
26
- api: ReturnType<typeof useEmblaCarousel>[1]
27
- scrollPrev: () => void
28
- scrollNext: () => void
29
- canScrollPrev: boolean
30
- canScrollNext: boolean
31
- } & CarouselProps
32
-
33
- const CarouselContext = React.createContext<CarouselContextProps | null>(null)
34
-
35
- function useCarousel() {
36
- const context = React.useContext(CarouselContext)
37
-
38
- if (!context) {
39
- throw new Error("useCarousel must be used within a <Carousel />")
40
- }
41
-
42
- return context
43
- }
44
-
45
- const Carousel = React.forwardRef<
46
- HTMLDivElement,
47
- React.HTMLAttributes<HTMLDivElement> & CarouselProps
48
- >(
49
- (
50
- {
51
- orientation = "horizontal",
52
- opts,
53
- setApi,
54
- plugins,
55
- className,
56
- children,
57
- ...props
58
- },
59
- ref
60
- ) => {
61
- const [carouselRef, api] = useEmblaCarousel(
62
- {
63
- ...opts,
64
- axis: orientation === "horizontal" ? "x" : "y",
65
- },
66
- plugins
67
- )
68
- const [canScrollPrev, setCanScrollPrev] = React.useState(false)
69
- const [canScrollNext, setCanScrollNext] = React.useState(false)
70
-
71
- const onSelect = React.useCallback((api: CarouselApi) => {
72
- if (!api) {
73
- return
74
- }
75
-
76
- setCanScrollPrev(api.canScrollPrev())
77
- setCanScrollNext(api.canScrollNext())
78
- }, [])
79
-
80
- const scrollPrev = React.useCallback(() => {
81
- api?.scrollPrev()
82
- }, [api])
83
-
84
- const scrollNext = React.useCallback(() => {
85
- api?.scrollNext()
86
- }, [api])
87
-
88
- const handleKeyDown = React.useCallback(
89
- (event: React.KeyboardEvent<HTMLDivElement>) => {
90
- if (event.key === "ArrowLeft") {
91
- event.preventDefault()
92
- scrollPrev()
93
- } else if (event.key === "ArrowRight") {
94
- event.preventDefault()
95
- scrollNext()
96
- }
97
- },
98
- [scrollPrev, scrollNext]
99
- )
100
-
101
- React.useEffect(() => {
102
- if (!api || !setApi) {
103
- return
104
- }
105
-
106
- setApi(api)
107
- }, [api, setApi])
108
-
109
- React.useEffect(() => {
110
- if (!api) {
111
- return
112
- }
113
-
114
- onSelect(api)
115
- api.on("reInit", onSelect)
116
- api.on("select", onSelect)
117
-
118
- return () => {
119
- api?.off("select", onSelect)
120
- }
121
- }, [api, onSelect])
122
-
123
- return (
124
- <CarouselContext.Provider
125
- value={{
126
- carouselRef,
127
- api: api,
128
- opts,
129
- orientation:
130
- orientation || (opts?.axis === "y" ? "vertical" : "horizontal"),
131
- scrollPrev,
132
- scrollNext,
133
- canScrollPrev,
134
- canScrollNext,
135
- }}
136
- >
137
- <div
138
- ref={ref}
139
- onKeyDownCapture={handleKeyDown}
140
- className={cn("relative", className)}
141
- role="region"
142
- aria-roledescription="carousel"
143
- {...props}
144
- >
145
- {children}
146
- </div>
147
- </CarouselContext.Provider>
148
- )
149
- }
150
- )
151
- Carousel.displayName = "Carousel"
152
-
153
- const CarouselContent = React.forwardRef<
154
- HTMLDivElement,
155
- React.HTMLAttributes<HTMLDivElement>
156
- >(({ className, ...props }, ref) => {
157
- const { carouselRef, orientation } = useCarousel()
158
-
159
- return (
160
- <div ref={carouselRef} className="overflow-hidden">
161
- <div
162
- ref={ref}
163
- className={cn(
164
- "flex",
165
- orientation === "horizontal" ? "-ml-4" : "-mt-4 flex-col",
166
- className
167
- )}
168
- {...props}
169
- />
170
- </div>
171
- )
172
- })
173
- CarouselContent.displayName = "CarouselContent"
174
-
175
- const CarouselItem = React.forwardRef<
176
- HTMLDivElement,
177
- React.HTMLAttributes<HTMLDivElement>
178
- >(({ className, ...props }, ref) => {
179
- const { orientation } = useCarousel()
180
-
181
- return (
182
- <div
183
- ref={ref}
184
- role="group"
185
- aria-roledescription="slide"
186
- className={cn(
187
- "min-w-0 shrink-0 grow-0 basis-full",
188
- orientation === "horizontal" ? "pl-4" : "pt-4",
189
- className
190
- )}
191
- {...props}
192
- />
193
- )
194
- })
195
- CarouselItem.displayName = "CarouselItem"
196
-
197
- const CarouselPrevious = React.forwardRef<
198
- HTMLButtonElement,
199
- React.ComponentProps<typeof Button>
200
- >(({ className, variant = "outline", size = "icon", ...props }, ref) => {
201
- const { orientation, scrollPrev, canScrollPrev } = useCarousel()
202
-
203
- return (
204
- <Button
205
- ref={ref}
206
- variant={variant}
207
- size={size}
208
- className={cn(
209
- "absolute h-8 w-8 rounded-full",
210
- orientation === "horizontal"
211
- ? "-left-12 top-1/2 -translate-y-1/2"
212
- : "-top-12 left-1/2 -translate-x-1/2 rotate-90",
213
- className
214
- )}
215
- disabled={!canScrollPrev}
216
- onClick={scrollPrev}
217
- {...props}
218
- >
219
- <ArrowLeft className="h-4 w-4" />
220
- <span className="sr-only">Previous slide</span>
221
- </Button>
222
- )
223
- })
224
- CarouselPrevious.displayName = "CarouselPrevious"
225
-
226
- const CarouselNext = React.forwardRef<
227
- HTMLButtonElement,
228
- React.ComponentProps<typeof Button>
229
- >(({ className, variant = "outline", size = "icon", ...props }, ref) => {
230
- const { orientation, scrollNext, canScrollNext } = useCarousel()
231
-
232
- return (
233
- <Button
234
- ref={ref}
235
- variant={variant}
236
- size={size}
237
- className={cn(
238
- "absolute h-8 w-8 rounded-full",
239
- orientation === "horizontal"
240
- ? "-right-12 top-1/2 -translate-y-1/2"
241
- : "-bottom-12 left-1/2 -translate-x-1/2 rotate-90",
242
- className
243
- )}
244
- disabled={!canScrollNext}
245
- onClick={scrollNext}
246
- {...props}
247
- >
248
- <ArrowRight className="h-4 w-4" />
249
- <span className="sr-only">Next slide</span>
250
- </Button>
251
- )
252
- })
253
- CarouselNext.displayName = "CarouselNext"
254
-
255
- export {
256
- type CarouselApi,
257
- Carousel,
258
- CarouselContent,
259
- CarouselItem,
260
- CarouselPrevious,
261
- CarouselNext,
262
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
frontend/src/components/ui/checkbox.tsx DELETED
@@ -1,30 +0,0 @@
1
- "use client"
2
-
3
- import * as React from "react"
4
- import * as CheckboxPrimitive from "@radix-ui/react-checkbox"
5
- import { Check } from "lucide-react"
6
-
7
- import { cn } from "@/lib/utils"
8
-
9
- const Checkbox = React.forwardRef<
10
- React.ElementRef<typeof CheckboxPrimitive.Root>,
11
- React.ComponentPropsWithoutRef<typeof CheckboxPrimitive.Root>
12
- >(({ className, ...props }, ref) => (
13
- <CheckboxPrimitive.Root
14
- ref={ref}
15
- className={cn(
16
- "peer h-4 w-4 shrink-0 rounded-sm border border-primary shadow focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground",
17
- className
18
- )}
19
- {...props}
20
- >
21
- <CheckboxPrimitive.Indicator
22
- className={cn("flex items-center justify-center text-current")}
23
- >
24
- <Check className="h-4 w-4" />
25
- </CheckboxPrimitive.Indicator>
26
- </CheckboxPrimitive.Root>
27
- ))
28
- Checkbox.displayName = CheckboxPrimitive.Root.displayName
29
-
30
- export { Checkbox }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
frontend/src/components/ui/collapsible.tsx DELETED
@@ -1,9 +0,0 @@
1
- import * as CollapsiblePrimitive from "@radix-ui/react-collapsible"
2
-
3
- const Collapsible = CollapsiblePrimitive.Root
4
-
5
- const CollapsibleTrigger = CollapsiblePrimitive.CollapsibleTrigger
6
-
7
- const CollapsibleContent = CollapsiblePrimitive.CollapsibleContent
8
-
9
- export { Collapsible, CollapsibleTrigger, CollapsibleContent }
 
 
 
 
 
 
 
 
 
 
frontend/src/components/ui/command.tsx DELETED
@@ -1,153 +0,0 @@
1
- "use client"
2
-
3
- import * as React from "react"
4
- import { type DialogProps } from "@radix-ui/react-dialog"
5
- import { Command as CommandPrimitive } from "cmdk"
6
- import { Search } from "lucide-react"
7
-
8
- import { cn } from "@/lib/utils"
9
- import { Dialog, DialogContent } from "@/components/ui/dialog"
10
-
11
- const Command = React.forwardRef<
12
- React.ElementRef<typeof CommandPrimitive>,
13
- React.ComponentPropsWithoutRef<typeof CommandPrimitive>
14
- >(({ className, ...props }, ref) => (
15
- <CommandPrimitive
16
- ref={ref}
17
- className={cn(
18
- "flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground",
19
- className
20
- )}
21
- {...props}
22
- />
23
- ))
24
- Command.displayName = CommandPrimitive.displayName
25
-
26
- const CommandDialog = ({ children, ...props }: DialogProps) => {
27
- return (
28
- <Dialog {...props}>
29
- <DialogContent className="overflow-hidden p-0">
30
- <Command className="[&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground [&_[cmdk-group]:not([hidden])_~[cmdk-group]]:pt-0 [&_[cmdk-group]]:px-2 [&_[cmdk-input-wrapper]_svg]:h-5 [&_[cmdk-input-wrapper]_svg]:w-5 [&_[cmdk-input]]:h-12 [&_[cmdk-item]]:px-2 [&_[cmdk-item]]:py-3 [&_[cmdk-item]_svg]:h-5 [&_[cmdk-item]_svg]:w-5">
31
- {children}
32
- </Command>
33
- </DialogContent>
34
- </Dialog>
35
- )
36
- }
37
-
38
- const CommandInput = React.forwardRef<
39
- React.ElementRef<typeof CommandPrimitive.Input>,
40
- React.ComponentPropsWithoutRef<typeof CommandPrimitive.Input>
41
- >(({ className, ...props }, ref) => (
42
- <div className="flex items-center border-b px-3" cmdk-input-wrapper="">
43
- <Search className="mr-2 h-4 w-4 shrink-0 opacity-50" />
44
- <CommandPrimitive.Input
45
- ref={ref}
46
- className={cn(
47
- "flex h-10 w-full rounded-md bg-transparent py-3 text-sm outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50",
48
- className
49
- )}
50
- {...props}
51
- />
52
- </div>
53
- ))
54
-
55
- CommandInput.displayName = CommandPrimitive.Input.displayName
56
-
57
- const CommandList = React.forwardRef<
58
- React.ElementRef<typeof CommandPrimitive.List>,
59
- React.ComponentPropsWithoutRef<typeof CommandPrimitive.List>
60
- >(({ className, ...props }, ref) => (
61
- <CommandPrimitive.List
62
- ref={ref}
63
- className={cn("max-h-[300px] overflow-y-auto overflow-x-hidden", className)}
64
- {...props}
65
- />
66
- ))
67
-
68
- CommandList.displayName = CommandPrimitive.List.displayName
69
-
70
- const CommandEmpty = React.forwardRef<
71
- React.ElementRef<typeof CommandPrimitive.Empty>,
72
- React.ComponentPropsWithoutRef<typeof CommandPrimitive.Empty>
73
- >((props, ref) => (
74
- <CommandPrimitive.Empty
75
- ref={ref}
76
- className="py-6 text-center text-sm"
77
- {...props}
78
- />
79
- ))
80
-
81
- CommandEmpty.displayName = CommandPrimitive.Empty.displayName
82
-
83
- const CommandGroup = React.forwardRef<
84
- React.ElementRef<typeof CommandPrimitive.Group>,
85
- React.ComponentPropsWithoutRef<typeof CommandPrimitive.Group>
86
- >(({ className, ...props }, ref) => (
87
- <CommandPrimitive.Group
88
- ref={ref}
89
- className={cn(
90
- "overflow-hidden p-1 text-foreground [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground",
91
- className
92
- )}
93
- {...props}
94
- />
95
- ))
96
-
97
- CommandGroup.displayName = CommandPrimitive.Group.displayName
98
-
99
- const CommandSeparator = React.forwardRef<
100
- React.ElementRef<typeof CommandPrimitive.Separator>,
101
- React.ComponentPropsWithoutRef<typeof CommandPrimitive.Separator>
102
- >(({ className, ...props }, ref) => (
103
- <CommandPrimitive.Separator
104
- ref={ref}
105
- className={cn("-mx-1 h-px bg-border", className)}
106
- {...props}
107
- />
108
- ))
109
- CommandSeparator.displayName = CommandPrimitive.Separator.displayName
110
-
111
- const CommandItem = React.forwardRef<
112
- React.ElementRef<typeof CommandPrimitive.Item>,
113
- React.ComponentPropsWithoutRef<typeof CommandPrimitive.Item>
114
- >(({ className, ...props }, ref) => (
115
- <CommandPrimitive.Item
116
- ref={ref}
117
- className={cn(
118
- "relative flex cursor-default gap-2 select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none data-[disabled=true]:pointer-events-none data-[selected=true]:bg-accent data-[selected=true]:text-accent-foreground data-[disabled=true]:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",
119
- className
120
- )}
121
- {...props}
122
- />
123
- ))
124
-
125
- CommandItem.displayName = CommandPrimitive.Item.displayName
126
-
127
- const CommandShortcut = ({
128
- className,
129
- ...props
130
- }: React.HTMLAttributes<HTMLSpanElement>) => {
131
- return (
132
- <span
133
- className={cn(
134
- "ml-auto text-xs tracking-widest text-muted-foreground",
135
- className
136
- )}
137
- {...props}
138
- />
139
- )
140
- }
141
- CommandShortcut.displayName = "CommandShortcut"
142
-
143
- export {
144
- Command,
145
- CommandDialog,
146
- CommandInput,
147
- CommandList,
148
- CommandEmpty,
149
- CommandGroup,
150
- CommandItem,
151
- CommandShortcut,
152
- CommandSeparator,
153
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
frontend/src/components/ui/context-menu.tsx DELETED
@@ -1,200 +0,0 @@
1
- "use client"
2
-
3
- import * as React from "react"
4
- import * as ContextMenuPrimitive from "@radix-ui/react-context-menu"
5
- import { Check, ChevronRight, Circle } from "lucide-react"
6
-
7
- import { cn } from "@/lib/utils"
8
-
9
- const ContextMenu = ContextMenuPrimitive.Root
10
-
11
- const ContextMenuTrigger = ContextMenuPrimitive.Trigger
12
-
13
- const ContextMenuGroup = ContextMenuPrimitive.Group
14
-
15
- const ContextMenuPortal = ContextMenuPrimitive.Portal
16
-
17
- const ContextMenuSub = ContextMenuPrimitive.Sub
18
-
19
- const ContextMenuRadioGroup = ContextMenuPrimitive.RadioGroup
20
-
21
- const ContextMenuSubTrigger = React.forwardRef<
22
- React.ElementRef<typeof ContextMenuPrimitive.SubTrigger>,
23
- React.ComponentPropsWithoutRef<typeof ContextMenuPrimitive.SubTrigger> & {
24
- inset?: boolean
25
- }
26
- >(({ className, inset, children, ...props }, ref) => (
27
- <ContextMenuPrimitive.SubTrigger
28
- ref={ref}
29
- className={cn(
30
- "flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground",
31
- inset && "pl-8",
32
- className
33
- )}
34
- {...props}
35
- >
36
- {children}
37
- <ChevronRight className="ml-auto h-4 w-4" />
38
- </ContextMenuPrimitive.SubTrigger>
39
- ))
40
- ContextMenuSubTrigger.displayName = ContextMenuPrimitive.SubTrigger.displayName
41
-
42
- const ContextMenuSubContent = React.forwardRef<
43
- React.ElementRef<typeof ContextMenuPrimitive.SubContent>,
44
- React.ComponentPropsWithoutRef<typeof ContextMenuPrimitive.SubContent>
45
- >(({ className, ...props }, ref) => (
46
- <ContextMenuPrimitive.SubContent
47
- ref={ref}
48
- className={cn(
49
- "z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-[--radix-context-menu-content-transform-origin]",
50
- className
51
- )}
52
- {...props}
53
- />
54
- ))
55
- ContextMenuSubContent.displayName = ContextMenuPrimitive.SubContent.displayName
56
-
57
- const ContextMenuContent = React.forwardRef<
58
- React.ElementRef<typeof ContextMenuPrimitive.Content>,
59
- React.ComponentPropsWithoutRef<typeof ContextMenuPrimitive.Content>
60
- >(({ className, ...props }, ref) => (
61
- <ContextMenuPrimitive.Portal>
62
- <ContextMenuPrimitive.Content
63
- ref={ref}
64
- className={cn(
65
- "z-50 max-h-[--radix-context-menu-content-available-height] min-w-[8rem] overflow-y-auto overflow-x-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-[--radix-context-menu-content-transform-origin]",
66
- className
67
- )}
68
- {...props}
69
- />
70
- </ContextMenuPrimitive.Portal>
71
- ))
72
- ContextMenuContent.displayName = ContextMenuPrimitive.Content.displayName
73
-
74
- const ContextMenuItem = React.forwardRef<
75
- React.ElementRef<typeof ContextMenuPrimitive.Item>,
76
- React.ComponentPropsWithoutRef<typeof ContextMenuPrimitive.Item> & {
77
- inset?: boolean
78
- }
79
- >(({ className, inset, ...props }, ref) => (
80
- <ContextMenuPrimitive.Item
81
- ref={ref}
82
- className={cn(
83
- "relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
84
- inset && "pl-8",
85
- className
86
- )}
87
- {...props}
88
- />
89
- ))
90
- ContextMenuItem.displayName = ContextMenuPrimitive.Item.displayName
91
-
92
- const ContextMenuCheckboxItem = React.forwardRef<
93
- React.ElementRef<typeof ContextMenuPrimitive.CheckboxItem>,
94
- React.ComponentPropsWithoutRef<typeof ContextMenuPrimitive.CheckboxItem>
95
- >(({ className, children, checked, ...props }, ref) => (
96
- <ContextMenuPrimitive.CheckboxItem
97
- ref={ref}
98
- className={cn(
99
- "relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
100
- className
101
- )}
102
- checked={checked}
103
- {...props}
104
- >
105
- <span className="absolute left-2 flex h-3.5 w-3.5 items-center justify-center">
106
- <ContextMenuPrimitive.ItemIndicator>
107
- <Check className="h-4 w-4" />
108
- </ContextMenuPrimitive.ItemIndicator>
109
- </span>
110
- {children}
111
- </ContextMenuPrimitive.CheckboxItem>
112
- ))
113
- ContextMenuCheckboxItem.displayName =
114
- ContextMenuPrimitive.CheckboxItem.displayName
115
-
116
- const ContextMenuRadioItem = React.forwardRef<
117
- React.ElementRef<typeof ContextMenuPrimitive.RadioItem>,
118
- React.ComponentPropsWithoutRef<typeof ContextMenuPrimitive.RadioItem>
119
- >(({ className, children, ...props }, ref) => (
120
- <ContextMenuPrimitive.RadioItem
121
- ref={ref}
122
- className={cn(
123
- "relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
124
- className
125
- )}
126
- {...props}
127
- >
128
- <span className="absolute left-2 flex h-3.5 w-3.5 items-center justify-center">
129
- <ContextMenuPrimitive.ItemIndicator>
130
- <Circle className="h-4 w-4 fill-current" />
131
- </ContextMenuPrimitive.ItemIndicator>
132
- </span>
133
- {children}
134
- </ContextMenuPrimitive.RadioItem>
135
- ))
136
- ContextMenuRadioItem.displayName = ContextMenuPrimitive.RadioItem.displayName
137
-
138
- const ContextMenuLabel = React.forwardRef<
139
- React.ElementRef<typeof ContextMenuPrimitive.Label>,
140
- React.ComponentPropsWithoutRef<typeof ContextMenuPrimitive.Label> & {
141
- inset?: boolean
142
- }
143
- >(({ className, inset, ...props }, ref) => (
144
- <ContextMenuPrimitive.Label
145
- ref={ref}
146
- className={cn(
147
- "px-2 py-1.5 text-sm font-semibold text-foreground",
148
- inset && "pl-8",
149
- className
150
- )}
151
- {...props}
152
- />
153
- ))
154
- ContextMenuLabel.displayName = ContextMenuPrimitive.Label.displayName
155
-
156
- const ContextMenuSeparator = React.forwardRef<
157
- React.ElementRef<typeof ContextMenuPrimitive.Separator>,
158
- React.ComponentPropsWithoutRef<typeof ContextMenuPrimitive.Separator>
159
- >(({ className, ...props }, ref) => (
160
- <ContextMenuPrimitive.Separator
161
- ref={ref}
162
- className={cn("-mx-1 my-1 h-px bg-border", className)}
163
- {...props}
164
- />
165
- ))
166
- ContextMenuSeparator.displayName = ContextMenuPrimitive.Separator.displayName
167
-
168
- const ContextMenuShortcut = ({
169
- className,
170
- ...props
171
- }: React.HTMLAttributes<HTMLSpanElement>) => {
172
- return (
173
- <span
174
- className={cn(
175
- "ml-auto text-xs tracking-widest text-muted-foreground",
176
- className
177
- )}
178
- {...props}
179
- />
180
- )
181
- }
182
- ContextMenuShortcut.displayName = "ContextMenuShortcut"
183
-
184
- export {
185
- ContextMenu,
186
- ContextMenuTrigger,
187
- ContextMenuContent,
188
- ContextMenuItem,
189
- ContextMenuCheckboxItem,
190
- ContextMenuRadioItem,
191
- ContextMenuLabel,
192
- ContextMenuSeparator,
193
- ContextMenuShortcut,
194
- ContextMenuGroup,
195
- ContextMenuPortal,
196
- ContextMenuSub,
197
- ContextMenuSubContent,
198
- ContextMenuSubTrigger,
199
- ContextMenuRadioGroup,
200
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
frontend/src/components/ui/dialog.tsx DELETED
@@ -1,120 +0,0 @@
1
- import * as React from "react"
2
- import * as DialogPrimitive from "@radix-ui/react-dialog"
3
- import { X } from "lucide-react"
4
-
5
- import { cn } from "@/lib/utils"
6
-
7
- const Dialog = DialogPrimitive.Root
8
-
9
- const DialogTrigger = DialogPrimitive.Trigger
10
-
11
- const DialogPortal = DialogPrimitive.Portal
12
-
13
- const DialogClose = DialogPrimitive.Close
14
-
15
- const DialogOverlay = React.forwardRef<
16
- React.ElementRef<typeof DialogPrimitive.Overlay>,
17
- React.ComponentPropsWithoutRef<typeof DialogPrimitive.Overlay>
18
- >(({ className, ...props }, ref) => (
19
- <DialogPrimitive.Overlay
20
- ref={ref}
21
- className={cn(
22
- "fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",
23
- className
24
- )}
25
- {...props}
26
- />
27
- ))
28
- DialogOverlay.displayName = DialogPrimitive.Overlay.displayName
29
-
30
- const DialogContent = React.forwardRef<
31
- React.ElementRef<typeof DialogPrimitive.Content>,
32
- React.ComponentPropsWithoutRef<typeof DialogPrimitive.Content>
33
- >(({ className, children, ...props }, ref) => (
34
- <DialogPortal>
35
- <DialogOverlay />
36
- <DialogPrimitive.Content
37
- ref={ref}
38
- className={cn(
39
- "fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",
40
- className
41
- )}
42
- {...props}
43
- >
44
- {children}
45
- <DialogPrimitive.Close className="absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground">
46
- <X className="h-4 w-4" />
47
- <span className="sr-only">Close</span>
48
- </DialogPrimitive.Close>
49
- </DialogPrimitive.Content>
50
- </DialogPortal>
51
- ))
52
- DialogContent.displayName = DialogPrimitive.Content.displayName
53
-
54
- const DialogHeader = ({
55
- className,
56
- ...props
57
- }: React.HTMLAttributes<HTMLDivElement>) => (
58
- <div
59
- className={cn(
60
- "flex flex-col space-y-1.5 text-center sm:text-left",
61
- className
62
- )}
63
- {...props}
64
- />
65
- )
66
- DialogHeader.displayName = "DialogHeader"
67
-
68
- const DialogFooter = ({
69
- className,
70
- ...props
71
- }: React.HTMLAttributes<HTMLDivElement>) => (
72
- <div
73
- className={cn(
74
- "flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",
75
- className
76
- )}
77
- {...props}
78
- />
79
- )
80
- DialogFooter.displayName = "DialogFooter"
81
-
82
- const DialogTitle = React.forwardRef<
83
- React.ElementRef<typeof DialogPrimitive.Title>,
84
- React.ComponentPropsWithoutRef<typeof DialogPrimitive.Title>
85
- >(({ className, ...props }, ref) => (
86
- <DialogPrimitive.Title
87
- ref={ref}
88
- className={cn(
89
- "text-lg font-semibold leading-none tracking-tight",
90
- className
91
- )}
92
- {...props}
93
- />
94
- ))
95
- DialogTitle.displayName = DialogPrimitive.Title.displayName
96
-
97
- const DialogDescription = React.forwardRef<
98
- React.ElementRef<typeof DialogPrimitive.Description>,
99
- React.ComponentPropsWithoutRef<typeof DialogPrimitive.Description>
100
- >(({ className, ...props }, ref) => (
101
- <DialogPrimitive.Description
102
- ref={ref}
103
- className={cn("text-sm text-muted-foreground", className)}
104
- {...props}
105
- />
106
- ))
107
- DialogDescription.displayName = DialogPrimitive.Description.displayName
108
-
109
- export {
110
- Dialog,
111
- DialogPortal,
112
- DialogOverlay,
113
- DialogTrigger,
114
- DialogClose,
115
- DialogContent,
116
- DialogHeader,
117
- DialogFooter,
118
- DialogTitle,
119
- DialogDescription,
120
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
frontend/src/components/ui/drawer.tsx DELETED
@@ -1,118 +0,0 @@
1
- "use client"
2
-
3
- import * as React from "react"
4
- import { Drawer as DrawerPrimitive } from "vaul"
5
-
6
- import { cn } from "@/lib/utils"
7
-
8
- const Drawer = ({
9
- shouldScaleBackground = true,
10
- ...props
11
- }: React.ComponentProps<typeof DrawerPrimitive.Root>) => (
12
- <DrawerPrimitive.Root
13
- shouldScaleBackground={shouldScaleBackground}
14
- {...props}
15
- />
16
- )
17
- Drawer.displayName = "Drawer"
18
-
19
- const DrawerTrigger = DrawerPrimitive.Trigger
20
-
21
- const DrawerPortal = DrawerPrimitive.Portal
22
-
23
- const DrawerClose = DrawerPrimitive.Close
24
-
25
- const DrawerOverlay = React.forwardRef<
26
- React.ElementRef<typeof DrawerPrimitive.Overlay>,
27
- React.ComponentPropsWithoutRef<typeof DrawerPrimitive.Overlay>
28
- >(({ className, ...props }, ref) => (
29
- <DrawerPrimitive.Overlay
30
- ref={ref}
31
- className={cn("fixed inset-0 z-50 bg-black/80", className)}
32
- {...props}
33
- />
34
- ))
35
- DrawerOverlay.displayName = DrawerPrimitive.Overlay.displayName
36
-
37
- const DrawerContent = React.forwardRef<
38
- React.ElementRef<typeof DrawerPrimitive.Content>,
39
- React.ComponentPropsWithoutRef<typeof DrawerPrimitive.Content>
40
- >(({ className, children, ...props }, ref) => (
41
- <DrawerPortal>
42
- <DrawerOverlay />
43
- <DrawerPrimitive.Content
44
- ref={ref}
45
- className={cn(
46
- "fixed inset-x-0 bottom-0 z-50 mt-24 flex h-auto flex-col rounded-t-[10px] border bg-background",
47
- className
48
- )}
49
- {...props}
50
- >
51
- <div className="mx-auto mt-4 h-2 w-[100px] rounded-full bg-muted" />
52
- {children}
53
- </DrawerPrimitive.Content>
54
- </DrawerPortal>
55
- ))
56
- DrawerContent.displayName = "DrawerContent"
57
-
58
- const DrawerHeader = ({
59
- className,
60
- ...props
61
- }: React.HTMLAttributes<HTMLDivElement>) => (
62
- <div
63
- className={cn("grid gap-1.5 p-4 text-center sm:text-left", className)}
64
- {...props}
65
- />
66
- )
67
- DrawerHeader.displayName = "DrawerHeader"
68
-
69
- const DrawerFooter = ({
70
- className,
71
- ...props
72
- }: React.HTMLAttributes<HTMLDivElement>) => (
73
- <div
74
- className={cn("mt-auto flex flex-col gap-2 p-4", className)}
75
- {...props}
76
- />
77
- )
78
- DrawerFooter.displayName = "DrawerFooter"
79
-
80
- const DrawerTitle = React.forwardRef<
81
- React.ElementRef<typeof DrawerPrimitive.Title>,
82
- React.ComponentPropsWithoutRef<typeof DrawerPrimitive.Title>
83
- >(({ className, ...props }, ref) => (
84
- <DrawerPrimitive.Title
85
- ref={ref}
86
- className={cn(
87
- "text-lg font-semibold leading-none tracking-tight",
88
- className
89
- )}
90
- {...props}
91
- />
92
- ))
93
- DrawerTitle.displayName = DrawerPrimitive.Title.displayName
94
-
95
- const DrawerDescription = React.forwardRef<
96
- React.ElementRef<typeof DrawerPrimitive.Description>,
97
- React.ComponentPropsWithoutRef<typeof DrawerPrimitive.Description>
98
- >(({ className, ...props }, ref) => (
99
- <DrawerPrimitive.Description
100
- ref={ref}
101
- className={cn("text-sm text-muted-foreground", className)}
102
- {...props}
103
- />
104
- ))
105
- DrawerDescription.displayName = DrawerPrimitive.Description.displayName
106
-
107
- export {
108
- Drawer,
109
- DrawerPortal,
110
- DrawerOverlay,
111
- DrawerTrigger,
112
- DrawerClose,
113
- DrawerContent,
114
- DrawerHeader,
115
- DrawerFooter,
116
- DrawerTitle,
117
- DrawerDescription,
118
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
frontend/src/components/ui/dropdown-menu.tsx DELETED
@@ -1,201 +0,0 @@
1
- "use client"
2
-
3
- import * as React from "react"
4
- import * as DropdownMenuPrimitive from "@radix-ui/react-dropdown-menu"
5
- import { Check, ChevronRight, Circle } from "lucide-react"
6
-
7
- import { cn } from "@/lib/utils"
8
-
9
- const DropdownMenu = DropdownMenuPrimitive.Root
10
-
11
- const DropdownMenuTrigger = DropdownMenuPrimitive.Trigger
12
-
13
- const DropdownMenuGroup = DropdownMenuPrimitive.Group
14
-
15
- const DropdownMenuPortal = DropdownMenuPrimitive.Portal
16
-
17
- const DropdownMenuSub = DropdownMenuPrimitive.Sub
18
-
19
- const DropdownMenuRadioGroup = DropdownMenuPrimitive.RadioGroup
20
-
21
- const DropdownMenuSubTrigger = React.forwardRef<
22
- React.ElementRef<typeof DropdownMenuPrimitive.SubTrigger>,
23
- React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.SubTrigger> & {
24
- inset?: boolean
25
- }
26
- >(({ className, inset, children, ...props }, ref) => (
27
- <DropdownMenuPrimitive.SubTrigger
28
- ref={ref}
29
- className={cn(
30
- "flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent data-[state=open]:bg-accent [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",
31
- inset && "pl-8",
32
- className
33
- )}
34
- {...props}
35
- >
36
- {children}
37
- <ChevronRight className="ml-auto" />
38
- </DropdownMenuPrimitive.SubTrigger>
39
- ))
40
- DropdownMenuSubTrigger.displayName =
41
- DropdownMenuPrimitive.SubTrigger.displayName
42
-
43
- const DropdownMenuSubContent = React.forwardRef<
44
- React.ElementRef<typeof DropdownMenuPrimitive.SubContent>,
45
- React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.SubContent>
46
- >(({ className, ...props }, ref) => (
47
- <DropdownMenuPrimitive.SubContent
48
- ref={ref}
49
- className={cn(
50
- "z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-[--radix-dropdown-menu-content-transform-origin]",
51
- className
52
- )}
53
- {...props}
54
- />
55
- ))
56
- DropdownMenuSubContent.displayName =
57
- DropdownMenuPrimitive.SubContent.displayName
58
-
59
- const DropdownMenuContent = React.forwardRef<
60
- React.ElementRef<typeof DropdownMenuPrimitive.Content>,
61
- React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Content>
62
- >(({ className, sideOffset = 4, ...props }, ref) => (
63
- <DropdownMenuPrimitive.Portal>
64
- <DropdownMenuPrimitive.Content
65
- ref={ref}
66
- sideOffset={sideOffset}
67
- className={cn(
68
- "z-50 max-h-[var(--radix-dropdown-menu-content-available-height)] min-w-[8rem] overflow-y-auto overflow-x-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md",
69
- "data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-[--radix-dropdown-menu-content-transform-origin]",
70
- className
71
- )}
72
- {...props}
73
- />
74
- </DropdownMenuPrimitive.Portal>
75
- ))
76
- DropdownMenuContent.displayName = DropdownMenuPrimitive.Content.displayName
77
-
78
- const DropdownMenuItem = React.forwardRef<
79
- React.ElementRef<typeof DropdownMenuPrimitive.Item>,
80
- React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Item> & {
81
- inset?: boolean
82
- }
83
- >(({ className, inset, ...props }, ref) => (
84
- <DropdownMenuPrimitive.Item
85
- ref={ref}
86
- className={cn(
87
- "relative flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&>svg]:size-4 [&>svg]:shrink-0",
88
- inset && "pl-8",
89
- className
90
- )}
91
- {...props}
92
- />
93
- ))
94
- DropdownMenuItem.displayName = DropdownMenuPrimitive.Item.displayName
95
-
96
- const DropdownMenuCheckboxItem = React.forwardRef<
97
- React.ElementRef<typeof DropdownMenuPrimitive.CheckboxItem>,
98
- React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.CheckboxItem>
99
- >(({ className, children, checked, ...props }, ref) => (
100
- <DropdownMenuPrimitive.CheckboxItem
101
- ref={ref}
102
- className={cn(
103
- "relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
104
- className
105
- )}
106
- checked={checked}
107
- {...props}
108
- >
109
- <span className="absolute left-2 flex h-3.5 w-3.5 items-center justify-center">
110
- <DropdownMenuPrimitive.ItemIndicator>
111
- <Check className="h-4 w-4" />
112
- </DropdownMenuPrimitive.ItemIndicator>
113
- </span>
114
- {children}
115
- </DropdownMenuPrimitive.CheckboxItem>
116
- ))
117
- DropdownMenuCheckboxItem.displayName =
118
- DropdownMenuPrimitive.CheckboxItem.displayName
119
-
120
- const DropdownMenuRadioItem = React.forwardRef<
121
- React.ElementRef<typeof DropdownMenuPrimitive.RadioItem>,
122
- React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.RadioItem>
123
- >(({ className, children, ...props }, ref) => (
124
- <DropdownMenuPrimitive.RadioItem
125
- ref={ref}
126
- className={cn(
127
- "relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
128
- className
129
- )}
130
- {...props}
131
- >
132
- <span className="absolute left-2 flex h-3.5 w-3.5 items-center justify-center">
133
- <DropdownMenuPrimitive.ItemIndicator>
134
- <Circle className="h-2 w-2 fill-current" />
135
- </DropdownMenuPrimitive.ItemIndicator>
136
- </span>
137
- {children}
138
- </DropdownMenuPrimitive.RadioItem>
139
- ))
140
- DropdownMenuRadioItem.displayName = DropdownMenuPrimitive.RadioItem.displayName
141
-
142
- const DropdownMenuLabel = React.forwardRef<
143
- React.ElementRef<typeof DropdownMenuPrimitive.Label>,
144
- React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Label> & {
145
- inset?: boolean
146
- }
147
- >(({ className, inset, ...props }, ref) => (
148
- <DropdownMenuPrimitive.Label
149
- ref={ref}
150
- className={cn(
151
- "px-2 py-1.5 text-sm font-semibold",
152
- inset && "pl-8",
153
- className
154
- )}
155
- {...props}
156
- />
157
- ))
158
- DropdownMenuLabel.displayName = DropdownMenuPrimitive.Label.displayName
159
-
160
- const DropdownMenuSeparator = React.forwardRef<
161
- React.ElementRef<typeof DropdownMenuPrimitive.Separator>,
162
- React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Separator>
163
- >(({ className, ...props }, ref) => (
164
- <DropdownMenuPrimitive.Separator
165
- ref={ref}
166
- className={cn("-mx-1 my-1 h-px bg-muted", className)}
167
- {...props}
168
- />
169
- ))
170
- DropdownMenuSeparator.displayName = DropdownMenuPrimitive.Separator.displayName
171
-
172
- const DropdownMenuShortcut = ({
173
- className,
174
- ...props
175
- }: React.HTMLAttributes<HTMLSpanElement>) => {
176
- return (
177
- <span
178
- className={cn("ml-auto text-xs tracking-widest opacity-60", className)}
179
- {...props}
180
- />
181
- )
182
- }
183
- DropdownMenuShortcut.displayName = "DropdownMenuShortcut"
184
-
185
- export {
186
- DropdownMenu,
187
- DropdownMenuTrigger,
188
- DropdownMenuContent,
189
- DropdownMenuItem,
190
- DropdownMenuCheckboxItem,
191
- DropdownMenuRadioItem,
192
- DropdownMenuLabel,
193
- DropdownMenuSeparator,
194
- DropdownMenuShortcut,
195
- DropdownMenuGroup,
196
- DropdownMenuPortal,
197
- DropdownMenuSub,
198
- DropdownMenuSubContent,
199
- DropdownMenuSubTrigger,
200
- DropdownMenuRadioGroup,
201
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
frontend/src/components/ui/form.tsx DELETED
@@ -1,176 +0,0 @@
1
- import * as React from "react"
2
- import * as LabelPrimitive from "@radix-ui/react-label"
3
- import { Slot } from "@radix-ui/react-slot"
4
- import {
5
- Controller,
6
- FormProvider,
7
- useFormContext,
8
- type ControllerProps,
9
- type FieldPath,
10
- type FieldValues,
11
- } from "react-hook-form"
12
-
13
- import { cn } from "@/lib/utils"
14
- import { Label } from "@/components/ui/label"
15
-
16
- const Form = FormProvider
17
-
18
- type FormFieldContextValue<
19
- TFieldValues extends FieldValues = FieldValues,
20
- TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>
21
- > = {
22
- name: TName
23
- }
24
-
25
- const FormFieldContext = React.createContext<FormFieldContextValue>(
26
- {} as FormFieldContextValue
27
- )
28
-
29
- const FormField = <
30
- TFieldValues extends FieldValues = FieldValues,
31
- TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>
32
- >({
33
- ...props
34
- }: ControllerProps<TFieldValues, TName>) => {
35
- return (
36
- <FormFieldContext.Provider value={{ name: props.name }}>
37
- <Controller {...props} />
38
- </FormFieldContext.Provider>
39
- )
40
- }
41
-
42
- const useFormField = () => {
43
- const fieldContext = React.useContext(FormFieldContext)
44
- const itemContext = React.useContext(FormItemContext)
45
- const { getFieldState, formState } = useFormContext()
46
-
47
- const fieldState = getFieldState(fieldContext.name, formState)
48
-
49
- if (!fieldContext) {
50
- throw new Error("useFormField should be used within <FormField>")
51
- }
52
-
53
- const { id } = itemContext
54
-
55
- return {
56
- id,
57
- name: fieldContext.name,
58
- formItemId: `${id}-form-item`,
59
- formDescriptionId: `${id}-form-item-description`,
60
- formMessageId: `${id}-form-item-message`,
61
- ...fieldState,
62
- }
63
- }
64
-
65
- type FormItemContextValue = {
66
- id: string
67
- }
68
-
69
- const FormItemContext = React.createContext<FormItemContextValue>(
70
- {} as FormItemContextValue
71
- )
72
-
73
- const FormItem = React.forwardRef<
74
- HTMLDivElement,
75
- React.HTMLAttributes<HTMLDivElement>
76
- >(({ className, ...props }, ref) => {
77
- const id = React.useId()
78
-
79
- return (
80
- <FormItemContext.Provider value={{ id }}>
81
- <div ref={ref} className={cn("space-y-2", className)} {...props} />
82
- </FormItemContext.Provider>
83
- )
84
- })
85
- FormItem.displayName = "FormItem"
86
-
87
- const FormLabel = React.forwardRef<
88
- React.ElementRef<typeof LabelPrimitive.Root>,
89
- React.ComponentPropsWithoutRef<typeof LabelPrimitive.Root>
90
- >(({ className, ...props }, ref) => {
91
- const { error, formItemId } = useFormField()
92
-
93
- return (
94
- <Label
95
- ref={ref}
96
- className={cn(error && "text-destructive", className)}
97
- htmlFor={formItemId}
98
- {...props}
99
- />
100
- )
101
- })
102
- FormLabel.displayName = "FormLabel"
103
-
104
- const FormControl = React.forwardRef<
105
- React.ElementRef<typeof Slot>,
106
- React.ComponentPropsWithoutRef<typeof Slot>
107
- >(({ ...props }, ref) => {
108
- const { error, formItemId, formDescriptionId, formMessageId } = useFormField()
109
-
110
- return (
111
- <Slot
112
- ref={ref}
113
- id={formItemId}
114
- aria-describedby={
115
- !error
116
- ? `${formDescriptionId}`
117
- : `${formDescriptionId} ${formMessageId}`
118
- }
119
- aria-invalid={!!error}
120
- {...props}
121
- />
122
- )
123
- })
124
- FormControl.displayName = "FormControl"
125
-
126
- const FormDescription = React.forwardRef<
127
- HTMLParagraphElement,
128
- React.HTMLAttributes<HTMLParagraphElement>
129
- >(({ className, ...props }, ref) => {
130
- const { formDescriptionId } = useFormField()
131
-
132
- return (
133
- <p
134
- ref={ref}
135
- id={formDescriptionId}
136
- className={cn("text-[0.8rem] text-muted-foreground", className)}
137
- {...props}
138
- />
139
- )
140
- })
141
- FormDescription.displayName = "FormDescription"
142
-
143
- const FormMessage = React.forwardRef<
144
- HTMLParagraphElement,
145
- React.HTMLAttributes<HTMLParagraphElement>
146
- >(({ className, children, ...props }, ref) => {
147
- const { error, formMessageId } = useFormField()
148
- const body = error ? String(error?.message ?? "") : children
149
-
150
- if (!body) {
151
- return null
152
- }
153
-
154
- return (
155
- <p
156
- ref={ref}
157
- id={formMessageId}
158
- className={cn("text-[0.8rem] font-medium text-destructive", className)}
159
- {...props}
160
- >
161
- {body}
162
- </p>
163
- )
164
- })
165
- FormMessage.displayName = "FormMessage"
166
-
167
- export {
168
- useFormField,
169
- Form,
170
- FormItem,
171
- FormLabel,
172
- FormControl,
173
- FormDescription,
174
- FormMessage,
175
- FormField,
176
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
frontend/src/components/ui/hover-card.tsx DELETED
@@ -1,29 +0,0 @@
1
- "use client"
2
-
3
- import * as React from "react"
4
- import * as HoverCardPrimitive from "@radix-ui/react-hover-card"
5
-
6
- import { cn } from "@/lib/utils"
7
-
8
- const HoverCard = HoverCardPrimitive.Root
9
-
10
- const HoverCardTrigger = HoverCardPrimitive.Trigger
11
-
12
- const HoverCardContent = React.forwardRef<
13
- React.ElementRef<typeof HoverCardPrimitive.Content>,
14
- React.ComponentPropsWithoutRef<typeof HoverCardPrimitive.Content>
15
- >(({ className, align = "center", sideOffset = 4, ...props }, ref) => (
16
- <HoverCardPrimitive.Content
17
- ref={ref}
18
- align={align}
19
- sideOffset={sideOffset}
20
- className={cn(
21
- "z-50 w-64 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-[--radix-hover-card-content-transform-origin]",
22
- className
23
- )}
24
- {...props}
25
- />
26
- ))
27
- HoverCardContent.displayName = HoverCardPrimitive.Content.displayName
28
-
29
- export { HoverCard, HoverCardTrigger, HoverCardContent }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
frontend/src/components/ui/input.tsx DELETED
@@ -1,22 +0,0 @@
1
- import * as React from "react"
2
-
3
- import { cn } from "@/lib/utils"
4
-
5
- const Input = React.forwardRef<HTMLInputElement, React.ComponentProps<"input">>(
6
- ({ className, type, ...props }, ref) => {
7
- return (
8
- <input
9
- type={type}
10
- className={cn(
11
- "flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-base shadow-sm transition-[color,box-shadow] file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:border-[var(--fg-base)] disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",
12
- className
13
- )}
14
- ref={ref}
15
- {...props}
16
- />
17
- )
18
- }
19
- )
20
- Input.displayName = "Input"
21
-
22
- export { Input }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
frontend/src/components/ui/label.tsx DELETED
@@ -1,26 +0,0 @@
1
- "use client"
2
-
3
- import * as React from "react"
4
- import * as LabelPrimitive from "@radix-ui/react-label"
5
- import { cva, type VariantProps } from "class-variance-authority"
6
-
7
- import { cn } from "@/lib/utils"
8
-
9
- const labelVariants = cva(
10
- "text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"
11
- )
12
-
13
- const Label = React.forwardRef<
14
- React.ElementRef<typeof LabelPrimitive.Root>,
15
- React.ComponentPropsWithoutRef<typeof LabelPrimitive.Root> &
16
- VariantProps<typeof labelVariants>
17
- >(({ className, ...props }, ref) => (
18
- <LabelPrimitive.Root
19
- ref={ref}
20
- className={cn(labelVariants(), className)}
21
- {...props}
22
- />
23
- ))
24
- Label.displayName = LabelPrimitive.Root.displayName
25
-
26
- export { Label }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
frontend/src/components/ui/menubar.tsx DELETED
@@ -1,256 +0,0 @@
1
- "use client"
2
-
3
- import * as React from "react"
4
- import * as MenubarPrimitive from "@radix-ui/react-menubar"
5
- import { Check, ChevronRight, Circle } from "lucide-react"
6
-
7
- import { cn } from "@/lib/utils"
8
-
9
- function MenubarMenu({
10
- ...props
11
- }: React.ComponentProps<typeof MenubarPrimitive.Menu>) {
12
- return <MenubarPrimitive.Menu {...props} />
13
- }
14
-
15
- function MenubarGroup({
16
- ...props
17
- }: React.ComponentProps<typeof MenubarPrimitive.Group>) {
18
- return <MenubarPrimitive.Group {...props} />
19
- }
20
-
21
- function MenubarPortal({
22
- ...props
23
- }: React.ComponentProps<typeof MenubarPrimitive.Portal>) {
24
- return <MenubarPrimitive.Portal {...props} />
25
- }
26
-
27
- function MenubarRadioGroup({
28
- ...props
29
- }: React.ComponentProps<typeof MenubarPrimitive.RadioGroup>) {
30
- return <MenubarPrimitive.RadioGroup {...props} />
31
- }
32
-
33
- function MenubarSub({
34
- ...props
35
- }: React.ComponentProps<typeof MenubarPrimitive.Sub>) {
36
- return <MenubarPrimitive.Sub data-slot="menubar-sub" {...props} />
37
- }
38
-
39
- const Menubar = React.forwardRef<
40
- React.ElementRef<typeof MenubarPrimitive.Root>,
41
- React.ComponentPropsWithoutRef<typeof MenubarPrimitive.Root>
42
- >(({ className, ...props }, ref) => (
43
- <MenubarPrimitive.Root
44
- ref={ref}
45
- className={cn(
46
- "flex h-9 items-center space-x-1 rounded-md border bg-background p-1 shadow-sm",
47
- className
48
- )}
49
- {...props}
50
- />
51
- ))
52
- Menubar.displayName = MenubarPrimitive.Root.displayName
53
-
54
- const MenubarTrigger = React.forwardRef<
55
- React.ElementRef<typeof MenubarPrimitive.Trigger>,
56
- React.ComponentPropsWithoutRef<typeof MenubarPrimitive.Trigger>
57
- >(({ className, ...props }, ref) => (
58
- <MenubarPrimitive.Trigger
59
- ref={ref}
60
- className={cn(
61
- "flex cursor-default select-none items-center rounded-sm px-3 py-1 text-sm font-medium outline-none focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground",
62
- className
63
- )}
64
- {...props}
65
- />
66
- ))
67
- MenubarTrigger.displayName = MenubarPrimitive.Trigger.displayName
68
-
69
- const MenubarSubTrigger = React.forwardRef<
70
- React.ElementRef<typeof MenubarPrimitive.SubTrigger>,
71
- React.ComponentPropsWithoutRef<typeof MenubarPrimitive.SubTrigger> & {
72
- inset?: boolean
73
- }
74
- >(({ className, inset, children, ...props }, ref) => (
75
- <MenubarPrimitive.SubTrigger
76
- ref={ref}
77
- className={cn(
78
- "flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground",
79
- inset && "pl-8",
80
- className
81
- )}
82
- {...props}
83
- >
84
- {children}
85
- <ChevronRight className="ml-auto h-4 w-4" />
86
- </MenubarPrimitive.SubTrigger>
87
- ))
88
- MenubarSubTrigger.displayName = MenubarPrimitive.SubTrigger.displayName
89
-
90
- const MenubarSubContent = React.forwardRef<
91
- React.ElementRef<typeof MenubarPrimitive.SubContent>,
92
- React.ComponentPropsWithoutRef<typeof MenubarPrimitive.SubContent>
93
- >(({ className, ...props }, ref) => (
94
- <MenubarPrimitive.SubContent
95
- ref={ref}
96
- className={cn(
97
- "z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-[--radix-menubar-content-transform-origin]",
98
- className
99
- )}
100
- {...props}
101
- />
102
- ))
103
- MenubarSubContent.displayName = MenubarPrimitive.SubContent.displayName
104
-
105
- const MenubarContent = React.forwardRef<
106
- React.ElementRef<typeof MenubarPrimitive.Content>,
107
- React.ComponentPropsWithoutRef<typeof MenubarPrimitive.Content>
108
- >(
109
- (
110
- { className, align = "start", alignOffset = -4, sideOffset = 8, ...props },
111
- ref
112
- ) => (
113
- <MenubarPrimitive.Portal>
114
- <MenubarPrimitive.Content
115
- ref={ref}
116
- align={align}
117
- alignOffset={alignOffset}
118
- sideOffset={sideOffset}
119
- className={cn(
120
- "z-50 min-w-[12rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-[--radix-menubar-content-transform-origin]",
121
- className
122
- )}
123
- {...props}
124
- />
125
- </MenubarPrimitive.Portal>
126
- )
127
- )
128
- MenubarContent.displayName = MenubarPrimitive.Content.displayName
129
-
130
- const MenubarItem = React.forwardRef<
131
- React.ElementRef<typeof MenubarPrimitive.Item>,
132
- React.ComponentPropsWithoutRef<typeof MenubarPrimitive.Item> & {
133
- inset?: boolean
134
- }
135
- >(({ className, inset, ...props }, ref) => (
136
- <MenubarPrimitive.Item
137
- ref={ref}
138
- className={cn(
139
- "relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
140
- inset && "pl-8",
141
- className
142
- )}
143
- {...props}
144
- />
145
- ))
146
- MenubarItem.displayName = MenubarPrimitive.Item.displayName
147
-
148
- const MenubarCheckboxItem = React.forwardRef<
149
- React.ElementRef<typeof MenubarPrimitive.CheckboxItem>,
150
- React.ComponentPropsWithoutRef<typeof MenubarPrimitive.CheckboxItem>
151
- >(({ className, children, checked, ...props }, ref) => (
152
- <MenubarPrimitive.CheckboxItem
153
- ref={ref}
154
- className={cn(
155
- "relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
156
- className
157
- )}
158
- checked={checked}
159
- {...props}
160
- >
161
- <span className="absolute left-2 flex h-3.5 w-3.5 items-center justify-center">
162
- <MenubarPrimitive.ItemIndicator>
163
- <Check className="h-4 w-4" />
164
- </MenubarPrimitive.ItemIndicator>
165
- </span>
166
- {children}
167
- </MenubarPrimitive.CheckboxItem>
168
- ))
169
- MenubarCheckboxItem.displayName = MenubarPrimitive.CheckboxItem.displayName
170
-
171
- const MenubarRadioItem = React.forwardRef<
172
- React.ElementRef<typeof MenubarPrimitive.RadioItem>,
173
- React.ComponentPropsWithoutRef<typeof MenubarPrimitive.RadioItem>
174
- >(({ className, children, ...props }, ref) => (
175
- <MenubarPrimitive.RadioItem
176
- ref={ref}
177
- className={cn(
178
- "relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
179
- className
180
- )}
181
- {...props}
182
- >
183
- <span className="absolute left-2 flex h-3.5 w-3.5 items-center justify-center">
184
- <MenubarPrimitive.ItemIndicator>
185
- <Circle className="h-4 w-4 fill-current" />
186
- </MenubarPrimitive.ItemIndicator>
187
- </span>
188
- {children}
189
- </MenubarPrimitive.RadioItem>
190
- ))
191
- MenubarRadioItem.displayName = MenubarPrimitive.RadioItem.displayName
192
-
193
- const MenubarLabel = React.forwardRef<
194
- React.ElementRef<typeof MenubarPrimitive.Label>,
195
- React.ComponentPropsWithoutRef<typeof MenubarPrimitive.Label> & {
196
- inset?: boolean
197
- }
198
- >(({ className, inset, ...props }, ref) => (
199
- <MenubarPrimitive.Label
200
- ref={ref}
201
- className={cn(
202
- "px-2 py-1.5 text-sm font-semibold",
203
- inset && "pl-8",
204
- className
205
- )}
206
- {...props}
207
- />
208
- ))
209
- MenubarLabel.displayName = MenubarPrimitive.Label.displayName
210
-
211
- const MenubarSeparator = React.forwardRef<
212
- React.ElementRef<typeof MenubarPrimitive.Separator>,
213
- React.ComponentPropsWithoutRef<typeof MenubarPrimitive.Separator>
214
- >(({ className, ...props }, ref) => (
215
- <MenubarPrimitive.Separator
216
- ref={ref}
217
- className={cn("-mx-1 my-1 h-px bg-muted", className)}
218
- {...props}
219
- />
220
- ))
221
- MenubarSeparator.displayName = MenubarPrimitive.Separator.displayName
222
-
223
- const MenubarShortcut = ({
224
- className,
225
- ...props
226
- }: React.HTMLAttributes<HTMLSpanElement>) => {
227
- return (
228
- <span
229
- className={cn(
230
- "ml-auto text-xs tracking-widest text-muted-foreground",
231
- className
232
- )}
233
- {...props}
234
- />
235
- )
236
- }
237
- MenubarShortcut.displayname = "MenubarShortcut"
238
-
239
- export {
240
- Menubar,
241
- MenubarMenu,
242
- MenubarTrigger,
243
- MenubarContent,
244
- MenubarItem,
245
- MenubarSeparator,
246
- MenubarLabel,
247
- MenubarCheckboxItem,
248
- MenubarRadioGroup,
249
- MenubarRadioItem,
250
- MenubarPortal,
251
- MenubarSubContent,
252
- MenubarSubTrigger,
253
- MenubarGroup,
254
- MenubarSub,
255
- MenubarShortcut,
256
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
frontend/src/components/ui/navigation-menu.tsx DELETED
@@ -1,128 +0,0 @@
1
- import * as React from "react"
2
- import * as NavigationMenuPrimitive from "@radix-ui/react-navigation-menu"
3
- import { cva } from "class-variance-authority"
4
- import { ChevronDown } from "lucide-react"
5
-
6
- import { cn } from "@/lib/utils"
7
-
8
- const NavigationMenu = React.forwardRef<
9
- React.ElementRef<typeof NavigationMenuPrimitive.Root>,
10
- React.ComponentPropsWithoutRef<typeof NavigationMenuPrimitive.Root>
11
- >(({ className, children, ...props }, ref) => (
12
- <NavigationMenuPrimitive.Root
13
- ref={ref}
14
- className={cn(
15
- "relative z-10 flex max-w-max flex-1 items-center justify-center",
16
- className
17
- )}
18
- {...props}
19
- >
20
- {children}
21
- <NavigationMenuViewport />
22
- </NavigationMenuPrimitive.Root>
23
- ))
24
- NavigationMenu.displayName = NavigationMenuPrimitive.Root.displayName
25
-
26
- const NavigationMenuList = React.forwardRef<
27
- React.ElementRef<typeof NavigationMenuPrimitive.List>,
28
- React.ComponentPropsWithoutRef<typeof NavigationMenuPrimitive.List>
29
- >(({ className, ...props }, ref) => (
30
- <NavigationMenuPrimitive.List
31
- ref={ref}
32
- className={cn(
33
- "group flex flex-1 list-none items-center justify-center space-x-1",
34
- className
35
- )}
36
- {...props}
37
- />
38
- ))
39
- NavigationMenuList.displayName = NavigationMenuPrimitive.List.displayName
40
-
41
- const NavigationMenuItem = NavigationMenuPrimitive.Item
42
-
43
- const navigationMenuTriggerStyle = cva(
44
- "group inline-flex h-9 w-max items-center justify-center rounded-md bg-background px-4 py-2 text-sm font-medium transition-colors hover:bg-accent hover:text-accent-foreground focus:bg-accent focus:text-accent-foreground focus:outline-none disabled:pointer-events-none disabled:opacity-50 data-[state=open]:text-accent-foreground data-[state=open]:bg-accent/50 data-[state=open]:hover:bg-accent data-[state=open]:focus:bg-accent"
45
- )
46
-
47
- const NavigationMenuTrigger = React.forwardRef<
48
- React.ElementRef<typeof NavigationMenuPrimitive.Trigger>,
49
- React.ComponentPropsWithoutRef<typeof NavigationMenuPrimitive.Trigger>
50
- >(({ className, children, ...props }, ref) => (
51
- <NavigationMenuPrimitive.Trigger
52
- ref={ref}
53
- className={cn(navigationMenuTriggerStyle(), "group", className)}
54
- {...props}
55
- >
56
- {children}{" "}
57
- <ChevronDown
58
- className="relative top-[1px] ml-1 h-3 w-3 transition duration-300 group-data-[state=open]:rotate-180"
59
- aria-hidden="true"
60
- />
61
- </NavigationMenuPrimitive.Trigger>
62
- ))
63
- NavigationMenuTrigger.displayName = NavigationMenuPrimitive.Trigger.displayName
64
-
65
- const NavigationMenuContent = React.forwardRef<
66
- React.ElementRef<typeof NavigationMenuPrimitive.Content>,
67
- React.ComponentPropsWithoutRef<typeof NavigationMenuPrimitive.Content>
68
- >(({ className, ...props }, ref) => (
69
- <NavigationMenuPrimitive.Content
70
- ref={ref}
71
- className={cn(
72
- "left-0 top-0 w-full data-[motion^=from-]:animate-in data-[motion^=to-]:animate-out data-[motion^=from-]:fade-in data-[motion^=to-]:fade-out data-[motion=from-end]:slide-in-from-right-52 data-[motion=from-start]:slide-in-from-left-52 data-[motion=to-end]:slide-out-to-right-52 data-[motion=to-start]:slide-out-to-left-52 md:absolute md:w-auto ",
73
- className
74
- )}
75
- {...props}
76
- />
77
- ))
78
- NavigationMenuContent.displayName = NavigationMenuPrimitive.Content.displayName
79
-
80
- const NavigationMenuLink = NavigationMenuPrimitive.Link
81
-
82
- const NavigationMenuViewport = React.forwardRef<
83
- React.ElementRef<typeof NavigationMenuPrimitive.Viewport>,
84
- React.ComponentPropsWithoutRef<typeof NavigationMenuPrimitive.Viewport>
85
- >(({ className, ...props }, ref) => (
86
- <div className={cn("absolute left-0 top-full flex justify-center")}>
87
- <NavigationMenuPrimitive.Viewport
88
- className={cn(
89
- "origin-top-center relative mt-1.5 h-[var(--radix-navigation-menu-viewport-height)] w-full overflow-hidden rounded-md border bg-popover text-popover-foreground shadow data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-90 md:w-[var(--radix-navigation-menu-viewport-width)]",
90
- className
91
- )}
92
- ref={ref}
93
- {...props}
94
- />
95
- </div>
96
- ))
97
- NavigationMenuViewport.displayName =
98
- NavigationMenuPrimitive.Viewport.displayName
99
-
100
- const NavigationMenuIndicator = React.forwardRef<
101
- React.ElementRef<typeof NavigationMenuPrimitive.Indicator>,
102
- React.ComponentPropsWithoutRef<typeof NavigationMenuPrimitive.Indicator>
103
- >(({ className, ...props }, ref) => (
104
- <NavigationMenuPrimitive.Indicator
105
- ref={ref}
106
- className={cn(
107
- "top-full z-[1] flex h-1.5 items-end justify-center overflow-hidden data-[state=visible]:animate-in data-[state=hidden]:animate-out data-[state=hidden]:fade-out data-[state=visible]:fade-in",
108
- className
109
- )}
110
- {...props}
111
- >
112
- <div className="relative top-[60%] h-2 w-2 rotate-45 rounded-tl-sm bg-border shadow-md" />
113
- </NavigationMenuPrimitive.Indicator>
114
- ))
115
- NavigationMenuIndicator.displayName =
116
- NavigationMenuPrimitive.Indicator.displayName
117
-
118
- export {
119
- navigationMenuTriggerStyle,
120
- NavigationMenu,
121
- NavigationMenuList,
122
- NavigationMenuItem,
123
- NavigationMenuContent,
124
- NavigationMenuTrigger,
125
- NavigationMenuLink,
126
- NavigationMenuIndicator,
127
- NavigationMenuViewport,
128
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
frontend/src/components/ui/popover.tsx DELETED
@@ -1,33 +0,0 @@
1
- "use client"
2
-
3
- import * as React from "react"
4
- import * as PopoverPrimitive from "@radix-ui/react-popover"
5
-
6
- import { cn } from "@/lib/utils"
7
-
8
- const Popover = PopoverPrimitive.Root
9
-
10
- const PopoverTrigger = PopoverPrimitive.Trigger
11
-
12
- const PopoverAnchor = PopoverPrimitive.Anchor
13
-
14
- const PopoverContent = React.forwardRef<
15
- React.ElementRef<typeof PopoverPrimitive.Content>,
16
- React.ComponentPropsWithoutRef<typeof PopoverPrimitive.Content>
17
- >(({ className, align = "center", sideOffset = 4, ...props }, ref) => (
18
- <PopoverPrimitive.Portal>
19
- <PopoverPrimitive.Content
20
- ref={ref}
21
- align={align}
22
- sideOffset={sideOffset}
23
- className={cn(
24
- "z-50 w-72 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-[--radix-popover-content-transform-origin]",
25
- className
26
- )}
27
- {...props}
28
- />
29
- </PopoverPrimitive.Portal>
30
- ))
31
- PopoverContent.displayName = PopoverPrimitive.Content.displayName
32
-
33
- export { Popover, PopoverTrigger, PopoverContent, PopoverAnchor }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
frontend/src/components/ui/progress.tsx DELETED
@@ -1,26 +0,0 @@
1
- import * as React from "react"
2
- import * as ProgressPrimitive from "@radix-ui/react-progress"
3
-
4
- import { cn } from "@/lib/utils"
5
-
6
- const Progress = React.forwardRef<
7
- React.ElementRef<typeof ProgressPrimitive.Root>,
8
- React.ComponentPropsWithoutRef<typeof ProgressPrimitive.Root>
9
- >(({ className, value, ...props }, ref) => (
10
- <ProgressPrimitive.Root
11
- ref={ref}
12
- className={cn(
13
- "relative h-2 w-full overflow-hidden rounded-full bg-primary/20",
14
- className
15
- )}
16
- {...props}
17
- >
18
- <ProgressPrimitive.Indicator
19
- className="h-full w-full flex-1 bg-primary transition-all"
20
- style={{ transform: `translateX(-${100 - (value || 0)}%)` }}
21
- />
22
- </ProgressPrimitive.Root>
23
- ))
24
- Progress.displayName = ProgressPrimitive.Root.displayName
25
-
26
- export { Progress }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
frontend/src/components/ui/radio-group.tsx DELETED
@@ -1,42 +0,0 @@
1
- import * as React from "react"
2
- import * as RadioGroupPrimitive from "@radix-ui/react-radio-group"
3
- import { Circle } from "lucide-react"
4
-
5
- import { cn } from "@/lib/utils"
6
-
7
- const RadioGroup = React.forwardRef<
8
- React.ElementRef<typeof RadioGroupPrimitive.Root>,
9
- React.ComponentPropsWithoutRef<typeof RadioGroupPrimitive.Root>
10
- >(({ className, ...props }, ref) => {
11
- return (
12
- <RadioGroupPrimitive.Root
13
- className={cn("grid gap-2", className)}
14
- {...props}
15
- ref={ref}
16
- />
17
- )
18
- })
19
- RadioGroup.displayName = RadioGroupPrimitive.Root.displayName
20
-
21
- const RadioGroupItem = React.forwardRef<
22
- React.ElementRef<typeof RadioGroupPrimitive.Item>,
23
- React.ComponentPropsWithoutRef<typeof RadioGroupPrimitive.Item>
24
- >(({ className, ...props }, ref) => {
25
- return (
26
- <RadioGroupPrimitive.Item
27
- ref={ref}
28
- className={cn(
29
- "aspect-square h-4 w-4 rounded-full border border-primary text-primary shadow focus:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50",
30
- className
31
- )}
32
- {...props}
33
- >
34
- <RadioGroupPrimitive.Indicator className="flex items-center justify-center">
35
- <Circle className="h-3.5 w-3.5 fill-primary" />
36
- </RadioGroupPrimitive.Indicator>
37
- </RadioGroupPrimitive.Item>
38
- )
39
- })
40
- RadioGroupItem.displayName = RadioGroupPrimitive.Item.displayName
41
-
42
- export { RadioGroup, RadioGroupItem }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
frontend/src/components/ui/resizable.tsx DELETED
@@ -1,43 +0,0 @@
1
- import { GripVertical } from "lucide-react"
2
- import { Group, Panel, Separator } from "react-resizable-panels"
3
-
4
- import { cn } from "@/lib/utils"
5
-
6
- const ResizablePanelGroup = ({
7
- className,
8
- ...props
9
- }: React.ComponentProps<typeof Group>) => (
10
- <Group
11
- className={cn(
12
- "flex h-full w-full data-[panel-group-direction=vertical]:flex-col",
13
- className
14
- )}
15
- {...props}
16
- />
17
- )
18
-
19
- const ResizablePanel = Panel
20
-
21
- const ResizableHandle = ({
22
- withHandle,
23
- className,
24
- ...props
25
- }: React.ComponentProps<typeof Separator> & {
26
- withHandle?: boolean
27
- }) => (
28
- <Separator
29
- className={cn(
30
- "relative flex w-px items-center justify-center bg-border after:absolute after:inset-y-0 after:left-1/2 after:w-1 after:-translate-x-1/2 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring focus-visible:ring-offset-1 data-[panel-group-direction=vertical]:h-px data-[panel-group-direction=vertical]:w-full data-[panel-group-direction=vertical]:after:left-0 data-[panel-group-direction=vertical]:after:h-1 data-[panel-group-direction=vertical]:after:w-full data-[panel-group-direction=vertical]:after:-translate-y-1/2 data-[panel-group-direction=vertical]:after:translate-x-0 [&[data-panel-group-direction=vertical]>div]:rotate-90",
31
- className
32
- )}
33
- {...props}
34
- >
35
- {withHandle && (
36
- <div className="z-10 flex h-4 w-3 items-center justify-center rounded-sm border bg-border">
37
- <GripVertical className="h-2.5 w-2.5" />
38
- </div>
39
- )}
40
- </Separator>
41
- )
42
-
43
- export { ResizablePanelGroup, ResizablePanel, ResizableHandle }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
frontend/src/components/ui/scroll-area.tsx DELETED
@@ -1,46 +0,0 @@
1
- import * as React from "react"
2
- import * as ScrollAreaPrimitive from "@radix-ui/react-scroll-area"
3
-
4
- import { cn } from "@/lib/utils"
5
-
6
- const ScrollArea = React.forwardRef<
7
- React.ElementRef<typeof ScrollAreaPrimitive.Root>,
8
- React.ComponentPropsWithoutRef<typeof ScrollAreaPrimitive.Root>
9
- >(({ className, children, ...props }, ref) => (
10
- <ScrollAreaPrimitive.Root
11
- ref={ref}
12
- className={cn("relative overflow-hidden", className)}
13
- {...props}
14
- >
15
- <ScrollAreaPrimitive.Viewport className="h-full w-full rounded-[inherit]">
16
- {children}
17
- </ScrollAreaPrimitive.Viewport>
18
- <ScrollBar />
19
- <ScrollAreaPrimitive.Corner />
20
- </ScrollAreaPrimitive.Root>
21
- ))
22
- ScrollArea.displayName = ScrollAreaPrimitive.Root.displayName
23
-
24
- const ScrollBar = React.forwardRef<
25
- React.ElementRef<typeof ScrollAreaPrimitive.ScrollAreaScrollbar>,
26
- React.ComponentPropsWithoutRef<typeof ScrollAreaPrimitive.ScrollAreaScrollbar>
27
- >(({ className, orientation = "vertical", ...props }, ref) => (
28
- <ScrollAreaPrimitive.ScrollAreaScrollbar
29
- ref={ref}
30
- orientation={orientation}
31
- className={cn(
32
- "flex touch-none select-none transition-colors",
33
- orientation === "vertical" &&
34
- "h-full w-2.5 border-l border-l-transparent p-[1px]",
35
- orientation === "horizontal" &&
36
- "h-2.5 flex-col border-t border-t-transparent p-[1px]",
37
- className
38
- )}
39
- {...props}
40
- >
41
- <ScrollAreaPrimitive.ScrollAreaThumb className="relative flex-1 rounded-full bg-border" />
42
- </ScrollAreaPrimitive.ScrollAreaScrollbar>
43
- ))
44
- ScrollBar.displayName = ScrollAreaPrimitive.ScrollAreaScrollbar.displayName
45
-
46
- export { ScrollArea, ScrollBar }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
frontend/src/components/ui/select.tsx DELETED
@@ -1,157 +0,0 @@
1
- import * as React from "react"
2
- import * as SelectPrimitive from "@radix-ui/react-select"
3
- import { Check, ChevronDown, ChevronUp } from "lucide-react"
4
-
5
- import { cn } from "@/lib/utils"
6
-
7
- const Select = SelectPrimitive.Root
8
-
9
- const SelectGroup = SelectPrimitive.Group
10
-
11
- const SelectValue = SelectPrimitive.Value
12
-
13
- const SelectTrigger = React.forwardRef<
14
- React.ElementRef<typeof SelectPrimitive.Trigger>,
15
- React.ComponentPropsWithoutRef<typeof SelectPrimitive.Trigger>
16
- >(({ className, children, ...props }, ref) => (
17
- <SelectPrimitive.Trigger
18
- ref={ref}
19
- className={cn(
20
- "flex h-9 w-full items-center justify-between whitespace-nowrap rounded-md border border-input bg-transparent px-3 py-2 text-sm shadow-sm ring-offset-background data-[placeholder]:text-muted-foreground focus:outline-none focus:ring-1 focus:ring-ring disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",
21
- className
22
- )}
23
- {...props}
24
- >
25
- {children}
26
- <SelectPrimitive.Icon asChild>
27
- <ChevronDown className="h-4 w-4 opacity-50" />
28
- </SelectPrimitive.Icon>
29
- </SelectPrimitive.Trigger>
30
- ))
31
- SelectTrigger.displayName = SelectPrimitive.Trigger.displayName
32
-
33
- const SelectScrollUpButton = React.forwardRef<
34
- React.ElementRef<typeof SelectPrimitive.ScrollUpButton>,
35
- React.ComponentPropsWithoutRef<typeof SelectPrimitive.ScrollUpButton>
36
- >(({ className, ...props }, ref) => (
37
- <SelectPrimitive.ScrollUpButton
38
- ref={ref}
39
- className={cn(
40
- "flex cursor-default items-center justify-center py-1",
41
- className
42
- )}
43
- {...props}
44
- >
45
- <ChevronUp className="h-4 w-4" />
46
- </SelectPrimitive.ScrollUpButton>
47
- ))
48
- SelectScrollUpButton.displayName = SelectPrimitive.ScrollUpButton.displayName
49
-
50
- const SelectScrollDownButton = React.forwardRef<
51
- React.ElementRef<typeof SelectPrimitive.ScrollDownButton>,
52
- React.ComponentPropsWithoutRef<typeof SelectPrimitive.ScrollDownButton>
53
- >(({ className, ...props }, ref) => (
54
- <SelectPrimitive.ScrollDownButton
55
- ref={ref}
56
- className={cn(
57
- "flex cursor-default items-center justify-center py-1",
58
- className
59
- )}
60
- {...props}
61
- >
62
- <ChevronDown className="h-4 w-4" />
63
- </SelectPrimitive.ScrollDownButton>
64
- ))
65
- SelectScrollDownButton.displayName =
66
- SelectPrimitive.ScrollDownButton.displayName
67
-
68
- const SelectContent = React.forwardRef<
69
- React.ElementRef<typeof SelectPrimitive.Content>,
70
- React.ComponentPropsWithoutRef<typeof SelectPrimitive.Content>
71
- >(({ className, children, position = "popper", ...props }, ref) => (
72
- <SelectPrimitive.Portal>
73
- <SelectPrimitive.Content
74
- ref={ref}
75
- className={cn(
76
- "relative z-50 max-h-[--radix-select-content-available-height] min-w-[8rem] overflow-y-auto overflow-x-hidden rounded-md border bg-popover text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-[--radix-select-content-transform-origin]",
77
- position === "popper" &&
78
- "data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",
79
- className
80
- )}
81
- position={position}
82
- {...props}
83
- >
84
- <SelectScrollUpButton />
85
- <SelectPrimitive.Viewport
86
- className={cn(
87
- "p-1",
88
- position === "popper" &&
89
- "h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"
90
- )}
91
- >
92
- {children}
93
- </SelectPrimitive.Viewport>
94
- <SelectScrollDownButton />
95
- </SelectPrimitive.Content>
96
- </SelectPrimitive.Portal>
97
- ))
98
- SelectContent.displayName = SelectPrimitive.Content.displayName
99
-
100
- const SelectLabel = React.forwardRef<
101
- React.ElementRef<typeof SelectPrimitive.Label>,
102
- React.ComponentPropsWithoutRef<typeof SelectPrimitive.Label>
103
- >(({ className, ...props }, ref) => (
104
- <SelectPrimitive.Label
105
- ref={ref}
106
- className={cn("px-2 py-1.5 text-sm font-semibold", className)}
107
- {...props}
108
- />
109
- ))
110
- SelectLabel.displayName = SelectPrimitive.Label.displayName
111
-
112
- const SelectItem = React.forwardRef<
113
- React.ElementRef<typeof SelectPrimitive.Item>,
114
- React.ComponentPropsWithoutRef<typeof SelectPrimitive.Item>
115
- >(({ className, children, ...props }, ref) => (
116
- <SelectPrimitive.Item
117
- ref={ref}
118
- className={cn(
119
- "relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-2 pr-8 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
120
- className
121
- )}
122
- {...props}
123
- >
124
- <span className="absolute right-2 flex h-3.5 w-3.5 items-center justify-center">
125
- <SelectPrimitive.ItemIndicator>
126
- <Check className="h-4 w-4" />
127
- </SelectPrimitive.ItemIndicator>
128
- </span>
129
- <SelectPrimitive.ItemText>{children}</SelectPrimitive.ItemText>
130
- </SelectPrimitive.Item>
131
- ))
132
- SelectItem.displayName = SelectPrimitive.Item.displayName
133
-
134
- const SelectSeparator = React.forwardRef<
135
- React.ElementRef<typeof SelectPrimitive.Separator>,
136
- React.ComponentPropsWithoutRef<typeof SelectPrimitive.Separator>
137
- >(({ className, ...props }, ref) => (
138
- <SelectPrimitive.Separator
139
- ref={ref}
140
- className={cn("-mx-1 my-1 h-px bg-muted", className)}
141
- {...props}
142
- />
143
- ))
144
- SelectSeparator.displayName = SelectPrimitive.Separator.displayName
145
-
146
- export {
147
- Select,
148
- SelectGroup,
149
- SelectValue,
150
- SelectTrigger,
151
- SelectContent,
152
- SelectLabel,
153
- SelectItem,
154
- SelectSeparator,
155
- SelectScrollUpButton,
156
- SelectScrollDownButton,
157
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
frontend/src/components/ui/separator.tsx DELETED
@@ -1,31 +0,0 @@
1
- "use client"
2
-
3
- import * as React from "react"
4
- import * as SeparatorPrimitive from "@radix-ui/react-separator"
5
-
6
- import { cn } from "@/lib/utils"
7
-
8
- const Separator = React.forwardRef<
9
- React.ElementRef<typeof SeparatorPrimitive.Root>,
10
- React.ComponentPropsWithoutRef<typeof SeparatorPrimitive.Root>
11
- >(
12
- (
13
- { className, orientation = "horizontal", decorative = true, ...props },
14
- ref
15
- ) => (
16
- <SeparatorPrimitive.Root
17
- ref={ref}
18
- decorative={decorative}
19
- orientation={orientation}
20
- className={cn(
21
- "shrink-0 bg-border",
22
- orientation === "horizontal" ? "h-[1px] w-full" : "h-full w-[1px]",
23
- className
24
- )}
25
- {...props}
26
- />
27
- )
28
- )
29
- Separator.displayName = SeparatorPrimitive.Root.displayName
30
-
31
- export { Separator }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
frontend/src/components/ui/sheet.tsx DELETED
@@ -1,140 +0,0 @@
1
- "use client"
2
-
3
- import * as React from "react"
4
- import * as SheetPrimitive from "@radix-ui/react-dialog"
5
- import { cva, type VariantProps } from "class-variance-authority"
6
- import { X } from "lucide-react"
7
-
8
- import { cn } from "@/lib/utils"
9
-
10
- const Sheet = SheetPrimitive.Root
11
-
12
- const SheetTrigger = SheetPrimitive.Trigger
13
-
14
- const SheetClose = SheetPrimitive.Close
15
-
16
- const SheetPortal = SheetPrimitive.Portal
17
-
18
- const SheetOverlay = React.forwardRef<
19
- React.ElementRef<typeof SheetPrimitive.Overlay>,
20
- React.ComponentPropsWithoutRef<typeof SheetPrimitive.Overlay>
21
- >(({ className, ...props }, ref) => (
22
- <SheetPrimitive.Overlay
23
- className={cn(
24
- "fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",
25
- className
26
- )}
27
- {...props}
28
- ref={ref}
29
- />
30
- ))
31
- SheetOverlay.displayName = SheetPrimitive.Overlay.displayName
32
-
33
- const sheetVariants = cva(
34
- "fixed z-50 gap-4 bg-background p-6 shadow-lg transition ease-in-out data-[state=closed]:duration-300 data-[state=open]:duration-500 data-[state=open]:animate-in data-[state=closed]:animate-out",
35
- {
36
- variants: {
37
- side: {
38
- top: "inset-x-0 top-0 border-b data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top",
39
- bottom:
40
- "inset-x-0 bottom-0 border-t data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom",
41
- left: "inset-y-0 left-0 h-full w-3/4 border-r data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left sm:max-w-sm",
42
- right:
43
- "inset-y-0 right-0 h-full w-3/4 border-l data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right sm:max-w-sm",
44
- },
45
- },
46
- defaultVariants: {
47
- side: "right",
48
- },
49
- }
50
- )
51
-
52
- interface SheetContentProps
53
- extends React.ComponentPropsWithoutRef<typeof SheetPrimitive.Content>,
54
- VariantProps<typeof sheetVariants> {}
55
-
56
- const SheetContent = React.forwardRef<
57
- React.ElementRef<typeof SheetPrimitive.Content>,
58
- SheetContentProps
59
- >(({ side = "right", className, children, ...props }, ref) => (
60
- <SheetPortal>
61
- <SheetOverlay />
62
- <SheetPrimitive.Content
63
- ref={ref}
64
- className={cn(sheetVariants({ side }), className)}
65
- {...props}
66
- >
67
- <SheetPrimitive.Close className="absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-secondary">
68
- <X className="h-4 w-4" />
69
- <span className="sr-only">Close</span>
70
- </SheetPrimitive.Close>
71
- {children}
72
- </SheetPrimitive.Content>
73
- </SheetPortal>
74
- ))
75
- SheetContent.displayName = SheetPrimitive.Content.displayName
76
-
77
- const SheetHeader = ({
78
- className,
79
- ...props
80
- }: React.HTMLAttributes<HTMLDivElement>) => (
81
- <div
82
- className={cn(
83
- "flex flex-col space-y-2 text-center sm:text-left",
84
- className
85
- )}
86
- {...props}
87
- />
88
- )
89
- SheetHeader.displayName = "SheetHeader"
90
-
91
- const SheetFooter = ({
92
- className,
93
- ...props
94
- }: React.HTMLAttributes<HTMLDivElement>) => (
95
- <div
96
- className={cn(
97
- "flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",
98
- className
99
- )}
100
- {...props}
101
- />
102
- )
103
- SheetFooter.displayName = "SheetFooter"
104
-
105
- const SheetTitle = React.forwardRef<
106
- React.ElementRef<typeof SheetPrimitive.Title>,
107
- React.ComponentPropsWithoutRef<typeof SheetPrimitive.Title>
108
- >(({ className, ...props }, ref) => (
109
- <SheetPrimitive.Title
110
- ref={ref}
111
- className={cn("text-lg font-semibold text-foreground", className)}
112
- {...props}
113
- />
114
- ))
115
- SheetTitle.displayName = SheetPrimitive.Title.displayName
116
-
117
- const SheetDescription = React.forwardRef<
118
- React.ElementRef<typeof SheetPrimitive.Description>,
119
- React.ComponentPropsWithoutRef<typeof SheetPrimitive.Description>
120
- >(({ className, ...props }, ref) => (
121
- <SheetPrimitive.Description
122
- ref={ref}
123
- className={cn("text-sm text-muted-foreground", className)}
124
- {...props}
125
- />
126
- ))
127
- SheetDescription.displayName = SheetPrimitive.Description.displayName
128
-
129
- export {
130
- Sheet,
131
- SheetPortal,
132
- SheetOverlay,
133
- SheetTrigger,
134
- SheetClose,
135
- SheetContent,
136
- SheetHeader,
137
- SheetFooter,
138
- SheetTitle,
139
- SheetDescription,
140
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
frontend/src/components/ui/skeleton.tsx DELETED
@@ -1,15 +0,0 @@
1
- import { cn } from "@/lib/utils"
2
-
3
- function Skeleton({
4
- className,
5
- ...props
6
- }: React.HTMLAttributes<HTMLDivElement>) {
7
- return (
8
- <div
9
- className={cn("animate-pulse rounded-md bg-[var(--bg-subtle)]", className)}
10
- {...props}
11
- />
12
- )
13
- }
14
-
15
- export { Skeleton }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
frontend/src/components/ui/slider.tsx DELETED
@@ -1,26 +0,0 @@
1
- import * as React from "react"
2
- import * as SliderPrimitive from "@radix-ui/react-slider"
3
-
4
- import { cn } from "@/lib/utils"
5
-
6
- const Slider = React.forwardRef<
7
- React.ElementRef<typeof SliderPrimitive.Root>,
8
- React.ComponentPropsWithoutRef<typeof SliderPrimitive.Root>
9
- >(({ className, ...props }, ref) => (
10
- <SliderPrimitive.Root
11
- ref={ref}
12
- className={cn(
13
- "relative flex w-full touch-none select-none items-center",
14
- className
15
- )}
16
- {...props}
17
- >
18
- <SliderPrimitive.Track className="relative h-1.5 w-full grow overflow-hidden rounded-full bg-primary/20">
19
- <SliderPrimitive.Range className="absolute h-full bg-primary" />
20
- </SliderPrimitive.Track>
21
- <SliderPrimitive.Thumb className="block h-4 w-4 rounded-full border border-primary/50 bg-background shadow transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50" />
22
- </SliderPrimitive.Root>
23
- ))
24
- Slider.displayName = SliderPrimitive.Root.displayName
25
-
26
- export { Slider }