cross-seed 7.0.0-2 → 7.0.0-3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (58) hide show
  1. package/dist/routes/staticFrontendPlugin.js +4 -2
  2. package/dist/routes/staticFrontendPlugin.js.map +1 -1
  3. package/dist/trpc/routers/index.d.ts +3 -3
  4. package/dist/trpc/routers/settings.d.ts +3 -3
  5. package/package.json +17 -58
  6. package/LICENSE +0 -201
  7. package/README.md +0 -33
  8. package/dist/webui/assets/FieldInfo-Bxj_j8SJ.js +0 -1
  9. package/dist/webui/assets/Page-C3rteCZt.js +0 -1
  10. package/dist/webui/assets/array-field-DVSC6nHP.js +0 -1
  11. package/dist/webui/assets/badge-DTZMtS0e.js +0 -1
  12. package/dist/webui/assets/check-Bu3ldi63.js +0 -1
  13. package/dist/webui/assets/chevron-down-CRy8M0kJ.js +0 -1
  14. package/dist/webui/assets/clients-CW8oEZoQ.js +0 -1
  15. package/dist/webui/assets/connect-YBNsnjWT.js +0 -1
  16. package/dist/webui/assets/debug-mz8-WYZj.js +0 -1
  17. package/dist/webui/assets/directories-BSK28RgR.js +0 -1
  18. package/dist/webui/assets/duration-field-C6xoSlJg.js +0 -1
  19. package/dist/webui/assets/general-lJJxZhH7.js +0 -1
  20. package/dist/webui/assets/health-CXbsVrie.js +0 -1
  21. package/dist/webui/assets/index-Bi48hI2z.js +0 -54
  22. package/dist/webui/assets/index-C-Ul7GNg.css +0 -1
  23. package/dist/webui/assets/index-C2cH1Gst.js +0 -1
  24. package/dist/webui/assets/index-Cc5bDmJr.js +0 -1
  25. package/dist/webui/assets/jobs-CxmNab9w.js +0 -1
  26. package/dist/webui/assets/library-vaj2W8sE.js +0 -1
  27. package/dist/webui/assets/loader-circle-M0gu1gZ-.js +0 -1
  28. package/dist/webui/assets/logs-Cu9RyKS0.js +0 -1
  29. package/dist/webui/assets/search-2R5sIdT8.js +0 -1
  30. package/dist/webui/assets/select-field-BCqNLDrJ.js +0 -1
  31. package/dist/webui/assets/select-zHgqMzLj.js +0 -1
  32. package/dist/webui/assets/settings-CMYjpTbZ.js +0 -1
  33. package/dist/webui/assets/submit-button-BtcnyggQ.js +0 -1
  34. package/dist/webui/assets/switch-G0W3uJVN.js +0 -1
  35. package/dist/webui/assets/switch-field-IBd9ORNq.js +0 -1
  36. package/dist/webui/assets/table-DvgJU7Gh.js +0 -1
  37. package/dist/webui/assets/test-tube-BIwmoM45.js +0 -1
  38. package/dist/webui/assets/text-field-DruSbGhy.js +0 -1
  39. package/dist/webui/assets/time-BSMZjmyW.js +0 -1
  40. package/dist/webui/assets/trackers-D-OpAe63.js +0 -7
  41. package/dist/webui/assets/use-form-validation-context-BkAfWAh0.js +0 -1
  42. package/dist/webui/assets/use-settings-form-submit-CDRh-E9U.js +0 -2
  43. package/dist/webui/assets/useQuery-A4Hv_4uX.js +0 -1
  44. package/dist/webui/index.html +0 -13
  45. package/node_modules/@cross-seed/shared/dist/configSchema.d.ts +0 -261
  46. package/node_modules/@cross-seed/shared/dist/configSchema.d.ts.map +0 -1
  47. package/node_modules/@cross-seed/shared/dist/configSchema.js +0 -53
  48. package/node_modules/@cross-seed/shared/dist/configSchema.js.map +0 -1
  49. package/node_modules/@cross-seed/shared/dist/constants.d.ts +0 -122
  50. package/node_modules/@cross-seed/shared/dist/constants.d.ts.map +0 -1
  51. package/node_modules/@cross-seed/shared/dist/constants.js +0 -127
  52. package/node_modules/@cross-seed/shared/dist/constants.js.map +0 -1
  53. package/node_modules/@cross-seed/shared/dist/tsconfig.tsbuildinfo +0 -1
  54. package/node_modules/@cross-seed/shared/dist/utils.d.ts +0 -6
  55. package/node_modules/@cross-seed/shared/dist/utils.d.ts.map +0 -1
  56. package/node_modules/@cross-seed/shared/dist/utils.js +0 -9
  57. package/node_modules/@cross-seed/shared/dist/utils.js.map +0 -1
  58. package/node_modules/@cross-seed/shared/package.json +0 -22
@@ -1,8 +1,10 @@
1
1
  import { readFile } from "node:fs/promises";
2
- import { extname, join } from "path";
2
+ import { createRequire } from "node:module";
3
+ import { dirname, extname, join } from "path";
3
4
  import { isTruthy } from "../utils.js";
4
5
  const SENTINEL_BASE_PATH = "/__CROSS_SEED_BASE_PATH__";
5
- const STATIC_ROOT = join(import.meta.dirname, "..", "..", "dist", "webui");
6
+ const require = createRequire(import.meta.url);
7
+ const STATIC_ROOT = join(dirname(require.resolve("webui/package.json")), "dist");
6
8
  const INDEX_HTML_PATH = join(STATIC_ROOT, "index.html");
7
9
  const UTF8 = { encoding: "utf-8" };
8
10
  const MIME_TYPES = {
@@ -1 +1 @@
1
- {"version":3,"file":"staticFrontendPlugin.js","sourceRoot":"","sources":["../../src/routes/staticFrontendPlugin.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC5C,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AACrC,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAGvC,MAAM,kBAAkB,GAAG,2BAA2B,CAAC;AACvD,MAAM,WAAW,GAAG,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,CAAC,CAAC;AAC3E,MAAM,eAAe,GAAG,IAAI,CAAC,WAAW,EAAE,YAAY,CAAC,CAAC;AACxD,MAAM,IAAI,GAAG,EAAE,QAAQ,EAAE,OAAO,EAAW,CAAC;AAC5C,MAAM,UAAU,GAA2B;IAC1C,OAAO,EAAE,WAAW;IACpB,MAAM,EAAE,UAAU;IAClB,KAAK,EAAE,wBAAwB;IAC/B,MAAM,EAAE,wBAAwB;IAChC,OAAO,EAAE,kBAAkB;IAC3B,MAAM,EAAE,WAAW;IACnB,MAAM,EAAE,YAAY;IACpB,OAAO,EAAE,YAAY;IACrB,MAAM,EAAE,eAAe;IACvB,MAAM,EAAE,cAAc;CACtB,CAAC;AAEF,SAAS,cAAc,CACtB,OAAe,EACf,GAAW,EACX,QAAgB;IAEhB,IACC,GAAG,KAAK,OAAO;QACf,GAAG,KAAK,MAAM;QACd,GAAG,KAAK,KAAK;QACb,GAAG,KAAK,MAAM;QACd,GAAG,KAAK,OAAO,EACd,CAAC;QACF,OAAO,OAAO,CAAC,UAAU,CAAC,kBAAkB,EAAE,QAAQ,CAAC,CAAC;IACzD,CAAC;IACD,OAAO,OAAO,CAAC;AAChB,CAAC;AAED,SAAS,cAAc,CAAC,GAAW;IAClC,OAAO,UAAU,CAAC,GAAG,CAAC,IAAI,0BAA0B,CAAC;AACtD,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,oBAAoB,CACzC,GAAoB,EACpB,EAAE,QAAQ,EAAwB;IAElC,2DAA2D;IAC3D,GAAG,CAAC,GAAG,CAAC,GAAG,EAAE,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,EAAE;QACrC,MAAM,mBAAmB,GAAG,OAAO,CAAC,GAAG,CAAC,UAAU,CAAC,QAAQ,CAAC;YAC3D,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,QAAQ,CAAC,MAAM,CAAC;YACpC,CAAC,CAAC,uBAAuB,CAAC,CAAC,2EAA2E;QACvG,MAAM,eAAe,GAAG,IAAI,CAC3B,WAAW,EACX,GAAG,mBAAmB,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,MAAM,CAAC,QAAQ,CAAC,CAClD,CAAC;QACF,IAAI,YAAoB,CAAC;QACzB,IAAI,aAAqB,CAAC;QAE1B,IAAI,CAAC;YACJ,YAAY,GAAG,MAAM,QAAQ,CAAC,eAAe,EAAE,IAAI,CAAC,CAAC;YACrD,aAAa,GAAG,OAAO,CAAC,eAAe,CAAC,CAAC;QAC1C,CAAC;QAAC,OAAO,CAAC,EAAE,CAAC;YACZ,IACE,CAAoB,CAAC,IAAI,IAAI,QAAQ;gBACrC,CAAoB,CAAC,IAAI,IAAI,QAAQ,EACrC,CAAC;gBACF,YAAY,GAAG,MAAM,QAAQ,CAAC,eAAe,EAAE,IAAI,CAAC,CAAC;gBACrD,aAAa,GAAG,OAAO,CAAC;YACzB,CAAC;iBAAM,CAAC;gBACP,MAAM,CAAC,CAAC;YACT,CAAC;QACF,CAAC;QAED,OAAO,KAAK;aACV,IAAI,CAAC,cAAc,CAAC,aAAa,CAAC,CAAC;aACnC,IAAI,CAAC,cAAc,CAAC,YAAY,EAAE,aAAa,EAAE,QAAQ,CAAC,CAAC,CAAC;IAC/D,CAAC,CAAC,CAAC;AACJ,CAAC"}
1
+ {"version":3,"file":"staticFrontendPlugin.js","sourceRoot":"","sources":["../../src/routes/staticFrontendPlugin.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC5C,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AAC9C,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAGvC,MAAM,kBAAkB,GAAG,2BAA2B,CAAC;AACvD,MAAM,OAAO,GAAG,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAC/C,MAAM,WAAW,GAAG,IAAI,CACvB,OAAO,CAAC,OAAO,CAAC,OAAO,CAAC,oBAAoB,CAAC,CAAC,EAC9C,MAAM,CACN,CAAC;AACF,MAAM,eAAe,GAAG,IAAI,CAAC,WAAW,EAAE,YAAY,CAAC,CAAC;AACxD,MAAM,IAAI,GAAG,EAAE,QAAQ,EAAE,OAAO,EAAW,CAAC;AAC5C,MAAM,UAAU,GAA2B;IAC1C,OAAO,EAAE,WAAW;IACpB,MAAM,EAAE,UAAU;IAClB,KAAK,EAAE,wBAAwB;IAC/B,MAAM,EAAE,wBAAwB;IAChC,OAAO,EAAE,kBAAkB;IAC3B,MAAM,EAAE,WAAW;IACnB,MAAM,EAAE,YAAY;IACpB,OAAO,EAAE,YAAY;IACrB,MAAM,EAAE,eAAe;IACvB,MAAM,EAAE,cAAc;CACtB,CAAC;AAEF,SAAS,cAAc,CACtB,OAAe,EACf,GAAW,EACX,QAAgB;IAEhB,IACC,GAAG,KAAK,OAAO;QACf,GAAG,KAAK,MAAM;QACd,GAAG,KAAK,KAAK;QACb,GAAG,KAAK,MAAM;QACd,GAAG,KAAK,OAAO,EACd,CAAC;QACF,OAAO,OAAO,CAAC,UAAU,CAAC,kBAAkB,EAAE,QAAQ,CAAC,CAAC;IACzD,CAAC;IACD,OAAO,OAAO,CAAC;AAChB,CAAC;AAED,SAAS,cAAc,CAAC,GAAW;IAClC,OAAO,UAAU,CAAC,GAAG,CAAC,IAAI,0BAA0B,CAAC;AACtD,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,oBAAoB,CACzC,GAAoB,EACpB,EAAE,QAAQ,EAAwB;IAElC,2DAA2D;IAC3D,GAAG,CAAC,GAAG,CAAC,GAAG,EAAE,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,EAAE;QACrC,MAAM,mBAAmB,GAAG,OAAO,CAAC,GAAG,CAAC,UAAU,CAAC,QAAQ,CAAC;YAC3D,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,QAAQ,CAAC,MAAM,CAAC;YACpC,CAAC,CAAC,uBAAuB,CAAC,CAAC,2EAA2E;QACvG,MAAM,eAAe,GAAG,IAAI,CAC3B,WAAW,EACX,GAAG,mBAAmB,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,MAAM,CAAC,QAAQ,CAAC,CAClD,CAAC;QACF,IAAI,YAAoB,CAAC;QACzB,IAAI,aAAqB,CAAC;QAE1B,IAAI,CAAC;YACJ,YAAY,GAAG,MAAM,QAAQ,CAAC,eAAe,EAAE,IAAI,CAAC,CAAC;YACrD,aAAa,GAAG,OAAO,CAAC,eAAe,CAAC,CAAC;QAC1C,CAAC;QAAC,OAAO,CAAC,EAAE,CAAC;YACZ,IACE,CAAoB,CAAC,IAAI,IAAI,QAAQ;gBACrC,CAAoB,CAAC,IAAI,IAAI,QAAQ,EACrC,CAAC;gBACF,YAAY,GAAG,MAAM,QAAQ,CAAC,eAAe,EAAE,IAAI,CAAC,CAAC;gBACrD,aAAa,GAAG,OAAO,CAAC;YACzB,CAAC;iBAAM,CAAC;gBACP,MAAM,CAAC,CAAC;YACT,CAAC;QACF,CAAC;QAED,OAAO,KAAK;aACV,IAAI,CAAC,cAAc,CAAC,aAAa,CAAC,CAAC;aACnC,IAAI,CAAC,cAAc,CAAC,YAAY,EAAE,aAAa,EAAE,QAAQ,CAAC,CAAC,CAAC;IAC/D,CAAC,CAAC,CAAC;AACJ,CAAC"}
@@ -61,12 +61,12 @@ export declare const appRouter: import("@trpc/server").TRPCBuiltRouter<{
61
61
  torznab: string[];
62
62
  useClientTorrents: boolean;
63
63
  dataDirs: string[];
64
- matchMode: import("packages/shared/dist/constants.js").MatchMode;
64
+ matchMode: import("@cross-seed/shared/constants").MatchMode;
65
65
  skipRecheck: boolean;
66
66
  autoResumeMaxDownload: number;
67
67
  ignoreNonRelevantFilesToResume: boolean;
68
68
  linkDirs: string[];
69
- linkType: import("packages/shared/dist/constants.js").LinkType;
69
+ linkType: import("@cross-seed/shared/constants").LinkType;
70
70
  flatLinking: boolean;
71
71
  maxDataDepth: number;
72
72
  outputDir: string;
@@ -74,7 +74,7 @@ export declare const appRouter: import("@trpc/server").TRPCBuiltRouter<{
74
74
  verbose: boolean;
75
75
  includeNonVideos: boolean;
76
76
  fuzzySizeThreshold: number;
77
- action: import("packages/shared/dist/constants.js").Action;
77
+ action: import("@cross-seed/shared/constants").Action;
78
78
  torrentClients: string[];
79
79
  duplicateCategories: boolean;
80
80
  notificationWebhookUrls: string[];
@@ -13,12 +13,12 @@ export declare const settingsRouter: import("@trpc/server").TRPCBuiltRouter<{
13
13
  torznab: string[];
14
14
  useClientTorrents: boolean;
15
15
  dataDirs: string[];
16
- matchMode: import("packages/shared/dist/constants.js").MatchMode;
16
+ matchMode: import("@cross-seed/shared/constants").MatchMode;
17
17
  skipRecheck: boolean;
18
18
  autoResumeMaxDownload: number;
19
19
  ignoreNonRelevantFilesToResume: boolean;
20
20
  linkDirs: string[];
21
- linkType: import("packages/shared/dist/constants.js").LinkType;
21
+ linkType: import("@cross-seed/shared/constants").LinkType;
22
22
  flatLinking: boolean;
23
23
  maxDataDepth: number;
24
24
  outputDir: string;
@@ -26,7 +26,7 @@ export declare const settingsRouter: import("@trpc/server").TRPCBuiltRouter<{
26
26
  verbose: boolean;
27
27
  includeNonVideos: boolean;
28
28
  fuzzySizeThreshold: number;
29
- action: import("packages/shared/dist/constants.js").Action;
29
+ action: import("@cross-seed/shared/constants").Action;
30
30
  torrentClients: string[];
31
31
  duplicateCategories: boolean;
32
32
  notificationWebhookUrls: string[];
package/package.json CHANGED
@@ -1,32 +1,8 @@
1
1
  {
2
2
  "name": "cross-seed",
3
- "version": "7.0.0-2",
3
+ "version": "7.0.0-3",
4
4
  "description": "Fully-automatic cross-seeding with Torznab",
5
- "workspaces": [
6
- ".",
7
- "packages/shared",
8
- "packages/webui",
9
- "packages/api-types"
10
- ],
11
- "scripts": {
12
- "test": "vitest",
13
- "coverage": "vitest run --coverage",
14
- "build": "npm run build:backend",
15
- "build:backend": "tsc -b tsconfig.json",
16
- "build:webui": "cd packages/webui && npm run build",
17
- "copy:webui": "rimraf dist/webui && mkdir -p dist && cp -r packages/webui/dist dist/webui",
18
- "build:api-types": "tsc -b packages/api-types/tsconfig.json",
19
- "build:all": "npm run build:backend && npm run build:api-types && npm run build:webui && npm run copy:webui",
20
- "watch": "tsc -b --watch --preserveWatchOutput",
21
- "dev": "concurrently --names \"TS,BE,FE\" --prefix-colors \"blue,green,magenta\" \"npm run watch\" \"npm run dev:backend\" \"npm run dev:frontend\"",
22
- "dev:backend": "node --watch dist/cmd.js daemon",
23
- "dev:frontend": "cd packages/webui && npm run dev",
24
- "prepare": "node -e \"const fs=require('fs'); if(!fs.existsSync('.git')) process.exit(0); require('child_process').execSync('husky install',{stdio:'inherit'})\"",
25
- "prepublishOnly": "rimraf dist tsconfig.tsbuildinfo packages/shared/tsconfig.tsbuildinfo packages/api-types/tsconfig.tsbuildinfo && npm run build:all",
26
- "lint": "concurrently --names \"Prettier,ESLint\" \"prettier --check '{src,tests}/{**/*,*}.{js,ts,cjs,mjs}'\" \"eslint '{src,tests}/{**/*,*}.{js,ts,cjs,mjs}'\"",
27
- "typecheck": "tsc -b tsconfig.json && tsc -p tsconfig.tests.json",
28
- "format": "prettier --write '{src,tests}/{**/*,*}.{js,ts,cjs,mjs}' package.json"
29
- },
5
+ "type": "module",
30
6
  "bin": {
31
7
  "cross-seed": "dist/cmd.js"
32
8
  },
@@ -36,10 +12,21 @@
36
12
  "files": [
37
13
  "dist/"
38
14
  ],
15
+ "scripts": {
16
+ "test": "vitest",
17
+ "coverage": "vitest run --coverage",
18
+ "build": "tsc -b tsconfig.json",
19
+ "watch": "tsc -b --watch --preserveWatchOutput",
20
+ "dev": "node --watch dist/cmd.js daemon",
21
+ "prepublishOnly": "rimraf dist tsconfig.tsbuildinfo && npm -C ../.. run build",
22
+ "lint": "concurrently --names \"Prettier,ESLint\" \"prettier --check '{src,tests}/{**/*,*}.{js,ts,cjs,mjs}'\" \"eslint '{src,tests}/{**/*,*}.{js,ts,cjs,mjs}'\"",
23
+ "typecheck": "tsc -b tsconfig.json && tsc -p tsconfig.tests.json",
24
+ "format": "prettier --write '{src,tests}/{**/*,*}.{js,ts,cjs,mjs}' package.json"
25
+ },
39
26
  "bundledDependencies": [
40
- "@cross-seed/shared"
27
+ "@cross-seed/shared",
28
+ "webui"
41
29
  ],
42
- "type": "module",
43
30
  "repository": {
44
31
  "type": "git",
45
32
  "url": "git://github.com/cross-seed/cross-seed.git"
@@ -47,7 +34,7 @@
47
34
  "author": "Michael Goodnow",
48
35
  "license": "Apache-2.0",
49
36
  "dependencies": {
50
- "@cross-seed/shared": "file:packages/shared",
37
+ "@cross-seed/shared": "file:../shared",
51
38
  "@fastify/cookie": "^11.0.2",
52
39
  "@trpc/server": "^11.1.2",
53
40
  "bcryptjs": "^3.0.2",
@@ -62,39 +49,11 @@
62
49
  "strip-ansi": "^7.1.0",
63
50
  "winston": "^3.3.3",
64
51
  "winston-daily-rotate-file": "^4.5.5",
52
+ "webui": "file:../webui",
65
53
  "xml2js": "^0.5.0",
66
54
  "xmlrpc": "^1.3.2",
67
55
  "zod": "^3.22.4"
68
56
  },
69
- "devDependencies": {
70
- "@types/bcryptjs": "^2.4.6",
71
- "@types/bencode": "^2.0.1",
72
- "@types/ms": "^0.7.34",
73
- "@types/node": "^24.10.1",
74
- "@types/xml2js": "^0.4.9",
75
- "@types/xmlrpc": "^1.3.6",
76
- "@typescript-eslint/eslint-plugin": "^6.16.0",
77
- "@typescript-eslint/parser": "^6.16.0",
78
- "@vitest/coverage-v8": "^3.1.1",
79
- "concurrently": "^9.1.2",
80
- "eslint": "^8.56.0",
81
- "husky": "^7.0.0",
82
- "lint-staged": "^12.1.4",
83
- "prettier": "^3.2.5",
84
- "prettier-plugin-tailwindcss": "^0.6.11",
85
- "rimraf": "^3.0.2",
86
- "typescript": "^5.6.2",
87
- "vitest": "^3.1.1"
88
- },
89
- "prettier": {
90
- "tabWidth": 4,
91
- "useTabs": true,
92
- "proseWrap": "always"
93
- },
94
- "lint-staged": {
95
- "*.{js,ts}": "eslint --cache",
96
- "*.{js,json,ts,css,md}": "prettier --write"
97
- },
98
57
  "np": {
99
58
  "yarn": false
100
59
  }
package/LICENSE DELETED
@@ -1,201 +0,0 @@
1
- Apache License
2
- Version 2.0, January 2004
3
- http://www.apache.org/licenses/
4
-
5
- TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
-
7
- 1. Definitions.
8
-
9
- "License" shall mean the terms and conditions for use, reproduction,
10
- and distribution as defined by Sections 1 through 9 of this document.
11
-
12
- "Licensor" shall mean the copyright owner or entity authorized by
13
- the copyright owner that is granting the License.
14
-
15
- "Legal Entity" shall mean the union of the acting entity and all
16
- other entities that control, are controlled by, or are under common
17
- control with that entity. For the purposes of this definition,
18
- "control" means (i) the power, direct or indirect, to cause the
19
- direction or management of such entity, whether by contract or
20
- otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
- outstanding shares, or (iii) beneficial ownership of such entity.
22
-
23
- "You" (or "Your") shall mean an individual or Legal Entity
24
- exercising permissions granted by this License.
25
-
26
- "Source" form shall mean the preferred form for making modifications,
27
- including but not limited to software source code, documentation
28
- source, and configuration files.
29
-
30
- "Object" form shall mean any form resulting from mechanical
31
- transformation or translation of a Source form, including but
32
- not limited to compiled object code, generated documentation,
33
- and conversions to other media types.
34
-
35
- "Work" shall mean the work of authorship, whether in Source or
36
- Object form, made available under the License, as indicated by a
37
- copyright notice that is included in or attached to the work
38
- (an example is provided in the Appendix below).
39
-
40
- "Derivative Works" shall mean any work, whether in Source or Object
41
- form, that is based on (or derived from) the Work and for which the
42
- editorial revisions, annotations, elaborations, or other modifications
43
- represent, as a whole, an original work of authorship. For the purposes
44
- of this License, Derivative Works shall not include works that remain
45
- separable from, or merely link (or bind by name) to the interfaces of,
46
- the Work and Derivative Works thereof.
47
-
48
- "Contribution" shall mean any work of authorship, including
49
- the original version of the Work and any modifications or additions
50
- to that Work or Derivative Works thereof, that is intentionally
51
- submitted to Licensor for inclusion in the Work by the copyright owner
52
- or by an individual or Legal Entity authorized to submit on behalf of
53
- the copyright owner. For the purposes of this definition, "submitted"
54
- means any form of electronic, verbal, or written communication sent
55
- to the Licensor or its representatives, including but not limited to
56
- communication on electronic mailing lists, source code control systems,
57
- and issue tracking systems that are managed by, or on behalf of, the
58
- Licensor for the purpose of discussing and improving the Work, but
59
- excluding communication that is conspicuously marked or otherwise
60
- designated in writing by the copyright owner as "Not a Contribution."
61
-
62
- "Contributor" shall mean Licensor and any individual or Legal Entity
63
- on behalf of whom a Contribution has been received by Licensor and
64
- subsequently incorporated within the Work.
65
-
66
- 2. Grant of Copyright License. Subject to the terms and conditions of
67
- this License, each Contributor hereby grants to You a perpetual,
68
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
- copyright license to reproduce, prepare Derivative Works of,
70
- publicly display, publicly perform, sublicense, and distribute the
71
- Work and such Derivative Works in Source or Object form.
72
-
73
- 3. Grant of Patent License. Subject to the terms and conditions of
74
- this License, each Contributor hereby grants to You a perpetual,
75
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
- (except as stated in this section) patent license to make, have made,
77
- use, offer to sell, sell, import, and otherwise transfer the Work,
78
- where such license applies only to those patent claims licensable
79
- by such Contributor that are necessarily infringed by their
80
- Contribution(s) alone or by combination of their Contribution(s)
81
- with the Work to which such Contribution(s) was submitted. If You
82
- institute patent litigation against any entity (including a
83
- cross-claim or counterclaim in a lawsuit) alleging that the Work
84
- or a Contribution incorporated within the Work constitutes direct
85
- or contributory patent infringement, then any patent licenses
86
- granted to You under this License for that Work shall terminate
87
- as of the date such litigation is filed.
88
-
89
- 4. Redistribution. You may reproduce and distribute copies of the
90
- Work or Derivative Works thereof in any medium, with or without
91
- modifications, and in Source or Object form, provided that You
92
- meet the following conditions:
93
-
94
- (a) You must give any other recipients of the Work or
95
- Derivative Works a copy of this License; and
96
-
97
- (b) You must cause any modified files to carry prominent notices
98
- stating that You changed the files; and
99
-
100
- (c) You must retain, in the Source form of any Derivative Works
101
- that You distribute, all copyright, patent, trademark, and
102
- attribution notices from the Source form of the Work,
103
- excluding those notices that do not pertain to any part of
104
- the Derivative Works; and
105
-
106
- (d) If the Work includes a "NOTICE" text file as part of its
107
- distribution, then any Derivative Works that You distribute must
108
- include a readable copy of the attribution notices contained
109
- within such NOTICE file, excluding those notices that do not
110
- pertain to any part of the Derivative Works, in at least one
111
- of the following places: within a NOTICE text file distributed
112
- as part of the Derivative Works; within the Source form or
113
- documentation, if provided along with the Derivative Works; or,
114
- within a display generated by the Derivative Works, if and
115
- wherever such third-party notices normally appear. The contents
116
- of the NOTICE file are for informational purposes only and
117
- do not modify the License. You may add Your own attribution
118
- notices within Derivative Works that You distribute, alongside
119
- or as an addendum to the NOTICE text from the Work, provided
120
- that such additional attribution notices cannot be construed
121
- as modifying the License.
122
-
123
- You may add Your own copyright statement to Your modifications and
124
- may provide additional or different license terms and conditions
125
- for use, reproduction, or distribution of Your modifications, or
126
- for any such Derivative Works as a whole, provided Your use,
127
- reproduction, and distribution of the Work otherwise complies with
128
- the conditions stated in this License.
129
-
130
- 5. Submission of Contributions. Unless You explicitly state otherwise,
131
- any Contribution intentionally submitted for inclusion in the Work
132
- by You to the Licensor shall be under the terms and conditions of
133
- this License, without any additional terms or conditions.
134
- Notwithstanding the above, nothing herein shall supersede or modify
135
- the terms of any separate license agreement you may have executed
136
- with Licensor regarding such Contributions.
137
-
138
- 6. Trademarks. This License does not grant permission to use the trade
139
- names, trademarks, service marks, or product names of the Licensor,
140
- except as required for reasonable and customary use in describing the
141
- origin of the Work and reproducing the content of the NOTICE file.
142
-
143
- 7. Disclaimer of Warranty. Unless required by applicable law or
144
- agreed to in writing, Licensor provides the Work (and each
145
- Contributor provides its Contributions) on an "AS IS" BASIS,
146
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
- implied, including, without limitation, any warranties or conditions
148
- of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
- PARTICULAR PURPOSE. You are solely responsible for determining the
150
- appropriateness of using or redistributing the Work and assume any
151
- risks associated with Your exercise of permissions under this License.
152
-
153
- 8. Limitation of Liability. In no event and under no legal theory,
154
- whether in tort (including negligence), contract, or otherwise,
155
- unless required by applicable law (such as deliberate and grossly
156
- negligent acts) or agreed to in writing, shall any Contributor be
157
- liable to You for damages, including any direct, indirect, special,
158
- incidental, or consequential damages of any character arising as a
159
- result of this License or out of the use or inability to use the
160
- Work (including but not limited to damages for loss of goodwill,
161
- work stoppage, computer failure or malfunction, or any and all
162
- other commercial damages or losses), even if such Contributor
163
- has been advised of the possibility of such damages.
164
-
165
- 9. Accepting Warranty or Additional Liability. While redistributing
166
- the Work or Derivative Works thereof, You may choose to offer,
167
- and charge a fee for, acceptance of support, warranty, indemnity,
168
- or other liability obligations and/or rights consistent with this
169
- License. However, in accepting such obligations, You may act only
170
- on Your own behalf and on Your sole responsibility, not on behalf
171
- of any other Contributor, and only if You agree to indemnify,
172
- defend, and hold each Contributor harmless for any liability
173
- incurred by, or claims asserted against, such Contributor by reason
174
- of your accepting any such warranty or additional liability.
175
-
176
- END OF TERMS AND CONDITIONS
177
-
178
- APPENDIX: How to apply the Apache License to your work.
179
-
180
- To apply the Apache License to your work, attach the following
181
- boilerplate notice, with the fields enclosed by brackets "[]"
182
- replaced with your own identifying information. (Don't include
183
- the brackets!) The text should be enclosed in the appropriate
184
- comment syntax for the file format. We also recommend that a
185
- file or class name and description of purpose be included on the
186
- same "printed page" as the copyright notice for easier
187
- identification within third-party archives.
188
-
189
- Copyright [yyyy] [name of copyright owner]
190
-
191
- Licensed under the Apache License, Version 2.0 (the "License");
192
- you may not use this file except in compliance with the License.
193
- You may obtain a copy of the License at
194
-
195
- http://www.apache.org/licenses/LICENSE-2.0
196
-
197
- Unless required by applicable law or agreed to in writing, software
198
- distributed under the License is distributed on an "AS IS" BASIS,
199
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200
- See the License for the specific language governing permissions and
201
- limitations under the License.
package/README.md DELETED
@@ -1,33 +0,0 @@
1
- # cross-seed: Fully-automatic cross-seeding
2
-
3
- `cross-seed` automatically finds and downloads torrents that are "cross seeds"
4
- existing across your other trackers, all based on your existing torrents and/or
5
- data. It is designed to match comprehensively while minimizing manual
6
- intervention, but it's also highly configurable to match your preferences.
7
-
8
- ## Torrent Client Integration
9
-
10
- `cross-seed` can inject new torrents it finds directly into your torrent client.
11
-
12
- If you use another client we do not currently support, and would like to help
13
- integrate it into `cross-seed`,
14
- [please open an issue here on GitHub to discuss it with us](https://github.com/cross-seed/cross-seed/issues).
15
-
16
- ## Requirements
17
-
18
- - [Node >= 24](https://nodejs.org/en/download)
19
- - Indexers that support Torznab or an tracker/indexer manager such as
20
- Prowlarr/Jackett (Prowlarr is preferred)
21
-
22
- ## Tutorial
23
-
24
- Head on over to [cross-seed.org](https://www.cross-seed.org) to get started.
25
-
26
- If you are migrating version to the latest available, please read
27
- [the v6 migration guide](https://www.cross-seed.org/docs/v6-migration).
28
-
29
- ## Troubleshooting
30
-
31
- Feel free to
32
- [start a discussion](https://github.com/cross-seed/cross-seed/discussions/new),
33
- or reach out on [Discord](https://discord.gg/jpbUFzS5Wb).
@@ -1 +0,0 @@
1
- import{j as s}from"./index-Bi48hI2z.js";const l=({fieldMeta:r})=>r&&r.errors&&r.errors.length>0?s.jsx(s.Fragment,{children:s.jsx("span",{className:"text-sm text-red-600",children:r.errors.map((n,t)=>typeof n=="object"&&n!==null?s.jsx("span",{children:n?.message||JSON.stringify(n)},t):s.jsx("span",{children:n},t))})}):null;export{l as F};
@@ -1 +0,0 @@
1
- import{Y as Ct,c as xe,r as s,j as a,Z as re,b as ae,$ as L,f as j,a0 as ve,d as A,g as h,e as Ne,a1 as Me,a2 as Te,a3 as _t,a4 as Rt,P as se,a5 as bt,a6 as It,a7 as yt,a8 as St,a9 as Et,aa as Pt,ab as Dt,ac as Nt,ad as Tt,i as O,ae as jt,B as At,af as Ot,S as kt}from"./index-Bi48hI2z.js";function Ft(e){return Ct({select:t=>t.location})}const Lt=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],Gt=xe("ChevronRight",Lt);const Kt=[["path",{d:"M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z",key:"a7tn18"}]],$t=xe("Moon",Kt);const Bt=[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]],Ut=xe("Sun",Bt);function Pe(e){const t=Vt(e),n=s.forwardRef((o,r)=>{const{children:c,...i}=o,u=s.Children.toArray(c),p=u.find(Yt);if(p){const f=p.props.children,d=u.map(l=>l===p?s.Children.count(f)>1?s.Children.only(null):s.isValidElement(f)?f.props.children:null:l);return a.jsx(t,{...i,ref:r,children:s.isValidElement(f)?s.cloneElement(f,void 0,d):null})}return a.jsx(t,{...i,ref:r,children:c})});return n.displayName=`${e}.Slot`,n}function Vt(e){const t=s.forwardRef((n,o)=>{const{children:r,...c}=n;if(s.isValidElement(r)){const i=Ht(r),u=zt(c,r.props);return r.type!==s.Fragment&&(u.ref=o?re(o,i):i),s.cloneElement(r,u)}return s.Children.count(r)>1?s.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Wt=Symbol("radix.slottable");function Yt(e){return s.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Wt}function zt(e,t){const n={...t};for(const o in t){const r=e[o],c=t[o];/^on[A-Z]/.test(o)?r&&c?n[o]=(...u)=>{const p=c(...u);return r(...u),p}:r&&(n[o]=r):o==="style"?n[o]={...r,...c}:o==="className"&&(n[o]=[r,c].filter(Boolean).join(" "))}return{...e,...n}}function Ht(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function je(e){const t=e+"CollectionProvider",[n,o]=ae(t),[r,c]=n(t,{collectionRef:{current:null},itemMap:new Map}),i=_=>{const{scope:g,children:M}=_,y=L.useRef(null),w=L.useRef(new Map).current;return a.jsx(r,{scope:g,itemMap:w,collectionRef:y,children:M})};i.displayName=t;const u=e+"CollectionSlot",p=Pe(u),f=L.forwardRef((_,g)=>{const{scope:M,children:y}=_,w=c(u,M),R=j(g,w.collectionRef);return a.jsx(p,{ref:R,children:y})});f.displayName=u;const d=e+"CollectionItemSlot",l="data-radix-collection-item",v=Pe(d),C=L.forwardRef((_,g)=>{const{scope:M,children:y,...w}=_,R=L.useRef(null),T=j(g,R),P=c(d,M);return L.useEffect(()=>(P.itemMap.set(R,{ref:R,...w}),()=>void P.itemMap.delete(R))),a.jsx(v,{[l]:"",ref:T,children:y})});C.displayName=d;function x(_){const g=c(e+"CollectionConsumer",_);return L.useCallback(()=>{const y=g.collectionRef.current;if(!y)return[];const w=Array.from(y.querySelectorAll(`[${l}]`));return Array.from(g.itemMap.values()).sort((P,D)=>w.indexOf(P.ref.current)-w.indexOf(D.ref.current))},[g.collectionRef,g.itemMap])}return[{Provider:i,Slot:f,ItemSlot:C},x,o]}var Xt=s.createContext(void 0);function Ae(e){const t=s.useContext(Xt);return e||t||"ltr"}var pe="rovingFocusGroup.onEntryFocus",Zt={bubbles:!1,cancelable:!0},q="RovingFocusGroup",[ge,Oe,qt]=je(q),[Jt,ke]=ae(q,[qt]),[Qt,en]=Jt(q),Fe=s.forwardRef((e,t)=>a.jsx(ge.Provider,{scope:e.__scopeRovingFocusGroup,children:a.jsx(ge.Slot,{scope:e.__scopeRovingFocusGroup,children:a.jsx(tn,{...e,ref:t})})}));Fe.displayName=q;var tn=s.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:o,loop:r=!1,dir:c,currentTabStopId:i,defaultCurrentTabStopId:u,onCurrentTabStopIdChange:p,onEntryFocus:f,preventScrollOnEntryFocus:d=!1,...l}=e,v=s.useRef(null),C=j(t,v),x=Ae(c),[_,g]=Ne({prop:i,defaultProp:u??null,onChange:p,caller:q}),[M,y]=s.useState(!1),w=Me(f),R=Oe(n),T=s.useRef(!1),[P,D]=s.useState(0);return s.useEffect(()=>{const b=v.current;if(b)return b.addEventListener(pe,w),()=>b.removeEventListener(pe,w)},[w]),a.jsx(Qt,{scope:n,orientation:o,dir:x,loop:r,currentTabStopId:_,onItemFocus:s.useCallback(b=>g(b),[g]),onItemShiftTab:s.useCallback(()=>y(!0),[]),onFocusableItemAdd:s.useCallback(()=>D(b=>b+1),[]),onFocusableItemRemove:s.useCallback(()=>D(b=>b-1),[]),children:a.jsx(A.div,{tabIndex:M||P===0?-1:0,"data-orientation":o,...l,ref:C,style:{outline:"none",...e.style},onMouseDown:h(e.onMouseDown,()=>{T.current=!0}),onFocus:h(e.onFocus,b=>{const $=!T.current;if(b.target===b.currentTarget&&$&&!M){const k=new CustomEvent(pe,Zt);if(b.currentTarget.dispatchEvent(k),!k.defaultPrevented){const V=R().filter(N=>N.focusable),W=V.find(N=>N.active),ee=V.find(N=>N.id===_),le=[W,ee,...V].filter(Boolean).map(N=>N.ref.current);Ke(le,d)}}T.current=!1}),onBlur:h(e.onBlur,()=>y(!1))})})}),Le="RovingFocusGroupItem",Ge=s.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:o=!0,active:r=!1,tabStopId:c,children:i,...u}=e,p=ve(),f=c||p,d=en(Le,n),l=d.currentTabStopId===f,v=Oe(n),{onFocusableItemAdd:C,onFocusableItemRemove:x,currentTabStopId:_}=d;return s.useEffect(()=>{if(o)return C(),()=>x()},[o,C,x]),a.jsx(ge.ItemSlot,{scope:n,id:f,focusable:o,active:r,children:a.jsx(A.span,{tabIndex:l?0:-1,"data-orientation":d.orientation,...u,ref:t,onMouseDown:h(e.onMouseDown,g=>{o?d.onItemFocus(f):g.preventDefault()}),onFocus:h(e.onFocus,()=>d.onItemFocus(f)),onKeyDown:h(e.onKeyDown,g=>{if(g.key==="Tab"&&g.shiftKey){d.onItemShiftTab();return}if(g.target!==g.currentTarget)return;const M=rn(g,d.orientation,d.dir);if(M!==void 0){if(g.metaKey||g.ctrlKey||g.altKey||g.shiftKey)return;g.preventDefault();let w=v().filter(R=>R.focusable).map(R=>R.ref.current);if(M==="last")w.reverse();else if(M==="prev"||M==="next"){M==="prev"&&w.reverse();const R=w.indexOf(g.currentTarget);w=d.loop?an(w,R+1):w.slice(R+1)}setTimeout(()=>Ke(w))}}),children:typeof i=="function"?i({isCurrentTabStop:l,hasTabStop:_!=null}):i})})});Ge.displayName=Le;var nn={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function on(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function rn(e,t,n){const o=on(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(o))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(o)))return nn[o]}function Ke(e,t=!1){const n=document.activeElement;for(const o of e)if(o===n||(o.focus({preventScroll:t}),document.activeElement!==n))return}function an(e,t){return e.map((n,o)=>e[(t+o)%e.length])}var sn=Fe,cn=Ge;function un(e){const t=ln(e),n=s.forwardRef((o,r)=>{const{children:c,...i}=o,u=s.Children.toArray(c),p=u.find(fn);if(p){const f=p.props.children,d=u.map(l=>l===p?s.Children.count(f)>1?s.Children.only(null):s.isValidElement(f)?f.props.children:null:l);return a.jsx(t,{...i,ref:r,children:s.isValidElement(f)?s.cloneElement(f,void 0,d):null})}return a.jsx(t,{...i,ref:r,children:c})});return n.displayName=`${e}.Slot`,n}function ln(e){const t=s.forwardRef((n,o)=>{const{children:r,...c}=n;if(s.isValidElement(r)){const i=mn(r),u=pn(c,r.props);return r.type!==s.Fragment&&(u.ref=o?re(o,i):i),s.cloneElement(r,u)}return s.Children.count(r)>1?s.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var dn=Symbol("radix.slottable");function fn(e){return s.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===dn}function pn(e,t){const n={...t};for(const o in t){const r=e[o],c=t[o];/^on[A-Z]/.test(o)?r&&c?n[o]=(...u)=>{const p=c(...u);return r(...u),p}:r&&(n[o]=r):o==="style"?n[o]={...r,...c}:o==="className"&&(n[o]=[r,c].filter(Boolean).join(" "))}return{...e,...n}}function mn(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var he=["Enter"," "],vn=["ArrowDown","PageUp","Home"],$e=["ArrowUp","PageDown","End"],gn=[...vn,...$e],hn={ltr:[...he,"ArrowRight"],rtl:[...he,"ArrowLeft"]},xn={ltr:["ArrowLeft"],rtl:["ArrowRight"]},J="Menu",[X,Mn,wn]=je(J),[G,Be]=ae(J,[wn,Te,ke]),ce=Te(),Ue=ke(),[Cn,K]=G(J),[_n,Q]=G(J),Ve=e=>{const{__scopeMenu:t,open:n=!1,children:o,dir:r,onOpenChange:c,modal:i=!0}=e,u=ce(t),[p,f]=s.useState(null),d=s.useRef(!1),l=Me(c),v=Ae(r);return s.useEffect(()=>{const C=()=>{d.current=!0,document.addEventListener("pointerdown",x,{capture:!0,once:!0}),document.addEventListener("pointermove",x,{capture:!0,once:!0})},x=()=>d.current=!1;return document.addEventListener("keydown",C,{capture:!0}),()=>{document.removeEventListener("keydown",C,{capture:!0}),document.removeEventListener("pointerdown",x,{capture:!0}),document.removeEventListener("pointermove",x,{capture:!0})}},[]),a.jsx(_t,{...u,children:a.jsx(Cn,{scope:t,open:n,onOpenChange:l,content:p,onContentChange:f,children:a.jsx(_n,{scope:t,onClose:s.useCallback(()=>l(!1),[l]),isUsingKeyboardRef:d,dir:v,modal:i,children:o})})})};Ve.displayName=J;var Rn="MenuAnchor",we=s.forwardRef((e,t)=>{const{__scopeMenu:n,...o}=e,r=ce(n);return a.jsx(Rt,{...r,...o,ref:t})});we.displayName=Rn;var Ce="MenuPortal",[bn,We]=G(Ce,{forceMount:void 0}),Ye=e=>{const{__scopeMenu:t,forceMount:n,children:o,container:r}=e,c=K(Ce,t);return a.jsx(bn,{scope:t,forceMount:n,children:a.jsx(se,{present:n||c.open,children:a.jsx(bt,{asChild:!0,container:r,children:o})})})};Ye.displayName=Ce;var E="MenuContent",[In,_e]=G(E),ze=s.forwardRef((e,t)=>{const n=We(E,e.__scopeMenu),{forceMount:o=n.forceMount,...r}=e,c=K(E,e.__scopeMenu),i=Q(E,e.__scopeMenu);return a.jsx(X.Provider,{scope:e.__scopeMenu,children:a.jsx(se,{present:o||c.open,children:a.jsx(X.Slot,{scope:e.__scopeMenu,children:i.modal?a.jsx(yn,{...r,ref:t}):a.jsx(Sn,{...r,ref:t})})})})}),yn=s.forwardRef((e,t)=>{const n=K(E,e.__scopeMenu),o=s.useRef(null),r=j(t,o);return s.useEffect(()=>{const c=o.current;if(c)return It(c)},[]),a.jsx(Re,{...e,ref:r,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:h(e.onFocusOutside,c=>c.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})}),Sn=s.forwardRef((e,t)=>{const n=K(E,e.__scopeMenu);return a.jsx(Re,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})}),En=un("MenuContent.ScrollLock"),Re=s.forwardRef((e,t)=>{const{__scopeMenu:n,loop:o=!1,trapFocus:r,onOpenAutoFocus:c,onCloseAutoFocus:i,disableOutsidePointerEvents:u,onEntryFocus:p,onEscapeKeyDown:f,onPointerDownOutside:d,onFocusOutside:l,onInteractOutside:v,onDismiss:C,disableOutsideScroll:x,..._}=e,g=K(E,n),M=Q(E,n),y=ce(n),w=Ue(n),R=Mn(n),[T,P]=s.useState(null),D=s.useRef(null),b=j(t,D,g.onContentChange),$=s.useRef(0),k=s.useRef(""),V=s.useRef(0),W=s.useRef(null),ee=s.useRef("right"),te=s.useRef(0),le=x?Et:s.Fragment,N=x?{as:En,allowPinchZoom:!0}:void 0,wt=m=>{const U=k.current+m,F=R().filter(S=>!S.disabled),Y=document.activeElement,de=F.find(S=>S.ref.current===Y)?.textValue,fe=F.map(S=>S.textValue),Se=Kn(fe,U,de),z=F.find(S=>S.textValue===Se)?.ref.current;(function S(Ee){k.current=Ee,window.clearTimeout($.current),Ee!==""&&($.current=window.setTimeout(()=>S(""),1e3))})(U),z&&setTimeout(()=>z.focus())};s.useEffect(()=>()=>window.clearTimeout($.current),[]),St();const B=s.useCallback(m=>ee.current===W.current?.side&&Bn(m,W.current?.area),[]);return a.jsx(In,{scope:n,searchRef:k,onItemEnter:s.useCallback(m=>{B(m)&&m.preventDefault()},[B]),onItemLeave:s.useCallback(m=>{B(m)||(D.current?.focus(),P(null))},[B]),onTriggerLeave:s.useCallback(m=>{B(m)&&m.preventDefault()},[B]),pointerGraceTimerRef:V,onPointerGraceIntentChange:s.useCallback(m=>{W.current=m},[]),children:a.jsx(le,{...N,children:a.jsx(Pt,{asChild:!0,trapped:r,onMountAutoFocus:h(c,m=>{m.preventDefault(),D.current?.focus({preventScroll:!0})}),onUnmountAutoFocus:i,children:a.jsx(Dt,{asChild:!0,disableOutsidePointerEvents:u,onEscapeKeyDown:f,onPointerDownOutside:d,onFocusOutside:l,onInteractOutside:v,onDismiss:C,children:a.jsx(sn,{asChild:!0,...w,dir:M.dir,orientation:"vertical",loop:o,currentTabStopId:T,onCurrentTabStopIdChange:P,onEntryFocus:h(p,m=>{M.isUsingKeyboardRef.current||m.preventDefault()}),preventScrollOnEntryFocus:!0,children:a.jsx(Nt,{role:"menu","aria-orientation":"vertical","data-state":ut(g.open),"data-radix-menu-content":"",dir:M.dir,...y,..._,ref:b,style:{outline:"none",..._.style},onKeyDown:h(_.onKeyDown,m=>{const F=m.target.closest("[data-radix-menu-content]")===m.currentTarget,Y=m.ctrlKey||m.altKey||m.metaKey,de=m.key.length===1;F&&(m.key==="Tab"&&m.preventDefault(),!Y&&de&&wt(m.key));const fe=D.current;if(m.target!==fe||!gn.includes(m.key))return;m.preventDefault();const z=R().filter(S=>!S.disabled).map(S=>S.ref.current);$e.includes(m.key)&&z.reverse(),Ln(z)}),onBlur:h(e.onBlur,m=>{m.currentTarget.contains(m.target)||(window.clearTimeout($.current),k.current="")}),onPointerMove:h(e.onPointerMove,Z(m=>{const U=m.target,F=te.current!==m.clientX;if(m.currentTarget.contains(U)&&F){const Y=m.clientX>te.current?"right":"left";ee.current=Y,te.current=m.clientX}}))})})})})})})});ze.displayName=E;var Pn="MenuGroup",be=s.forwardRef((e,t)=>{const{__scopeMenu:n,...o}=e;return a.jsx(A.div,{role:"group",...o,ref:t})});be.displayName=Pn;var Dn="MenuLabel",He=s.forwardRef((e,t)=>{const{__scopeMenu:n,...o}=e;return a.jsx(A.div,{...o,ref:t})});He.displayName=Dn;var ne="MenuItem",De="menu.itemSelect",ie=s.forwardRef((e,t)=>{const{disabled:n=!1,onSelect:o,...r}=e,c=s.useRef(null),i=Q(ne,e.__scopeMenu),u=_e(ne,e.__scopeMenu),p=j(t,c),f=s.useRef(!1),d=()=>{const l=c.current;if(!n&&l){const v=new CustomEvent(De,{bubbles:!0,cancelable:!0});l.addEventListener(De,C=>o?.(C),{once:!0}),yt(l,v),v.defaultPrevented?f.current=!1:i.onClose()}};return a.jsx(Xe,{...r,ref:p,disabled:n,onClick:h(e.onClick,d),onPointerDown:l=>{e.onPointerDown?.(l),f.current=!0},onPointerUp:h(e.onPointerUp,l=>{f.current||l.currentTarget?.click()}),onKeyDown:h(e.onKeyDown,l=>{const v=u.searchRef.current!=="";n||v&&l.key===" "||he.includes(l.key)&&(l.currentTarget.click(),l.preventDefault())})})});ie.displayName=ne;var Xe=s.forwardRef((e,t)=>{const{__scopeMenu:n,disabled:o=!1,textValue:r,...c}=e,i=_e(ne,n),u=Ue(n),p=s.useRef(null),f=j(t,p),[d,l]=s.useState(!1),[v,C]=s.useState("");return s.useEffect(()=>{const x=p.current;x&&C((x.textContent??"").trim())},[c.children]),a.jsx(X.ItemSlot,{scope:n,disabled:o,textValue:r??v,children:a.jsx(cn,{asChild:!0,...u,focusable:!o,children:a.jsx(A.div,{role:"menuitem","data-highlighted":d?"":void 0,"aria-disabled":o||void 0,"data-disabled":o?"":void 0,...c,ref:f,onPointerMove:h(e.onPointerMove,Z(x=>{o?i.onItemLeave(x):(i.onItemEnter(x),x.defaultPrevented||x.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:h(e.onPointerLeave,Z(x=>i.onItemLeave(x))),onFocus:h(e.onFocus,()=>l(!0)),onBlur:h(e.onBlur,()=>l(!1))})})})}),Nn="MenuCheckboxItem",Ze=s.forwardRef((e,t)=>{const{checked:n=!1,onCheckedChange:o,...r}=e;return a.jsx(tt,{scope:e.__scopeMenu,checked:n,children:a.jsx(ie,{role:"menuitemcheckbox","aria-checked":oe(n)?"mixed":n,...r,ref:t,"data-state":ye(n),onSelect:h(r.onSelect,()=>o?.(oe(n)?!0:!n),{checkForDefaultPrevented:!1})})})});Ze.displayName=Nn;var qe="MenuRadioGroup",[Tn,jn]=G(qe,{value:void 0,onValueChange:()=>{}}),Je=s.forwardRef((e,t)=>{const{value:n,onValueChange:o,...r}=e,c=Me(o);return a.jsx(Tn,{scope:e.__scopeMenu,value:n,onValueChange:c,children:a.jsx(be,{...r,ref:t})})});Je.displayName=qe;var Qe="MenuRadioItem",et=s.forwardRef((e,t)=>{const{value:n,...o}=e,r=jn(Qe,e.__scopeMenu),c=n===r.value;return a.jsx(tt,{scope:e.__scopeMenu,checked:c,children:a.jsx(ie,{role:"menuitemradio","aria-checked":c,...o,ref:t,"data-state":ye(c),onSelect:h(o.onSelect,()=>r.onValueChange?.(n),{checkForDefaultPrevented:!1})})})});et.displayName=Qe;var Ie="MenuItemIndicator",[tt,An]=G(Ie,{checked:!1}),nt=s.forwardRef((e,t)=>{const{__scopeMenu:n,forceMount:o,...r}=e,c=An(Ie,n);return a.jsx(se,{present:o||oe(c.checked)||c.checked===!0,children:a.jsx(A.span,{...r,ref:t,"data-state":ye(c.checked)})})});nt.displayName=Ie;var On="MenuSeparator",ot=s.forwardRef((e,t)=>{const{__scopeMenu:n,...o}=e;return a.jsx(A.div,{role:"separator","aria-orientation":"horizontal",...o,ref:t})});ot.displayName=On;var kn="MenuArrow",rt=s.forwardRef((e,t)=>{const{__scopeMenu:n,...o}=e,r=ce(n);return a.jsx(Tt,{...r,...o,ref:t})});rt.displayName=kn;var Fn="MenuSub",[Vo,at]=G(Fn),H="MenuSubTrigger",st=s.forwardRef((e,t)=>{const n=K(H,e.__scopeMenu),o=Q(H,e.__scopeMenu),r=at(H,e.__scopeMenu),c=_e(H,e.__scopeMenu),i=s.useRef(null),{pointerGraceTimerRef:u,onPointerGraceIntentChange:p}=c,f={__scopeMenu:e.__scopeMenu},d=s.useCallback(()=>{i.current&&window.clearTimeout(i.current),i.current=null},[]);return s.useEffect(()=>d,[d]),s.useEffect(()=>{const l=u.current;return()=>{window.clearTimeout(l),p(null)}},[u,p]),a.jsx(we,{asChild:!0,...f,children:a.jsx(Xe,{id:r.triggerId,"aria-haspopup":"menu","aria-expanded":n.open,"aria-controls":r.contentId,"data-state":ut(n.open),...e,ref:re(t,r.onTriggerChange),onClick:l=>{e.onClick?.(l),!(e.disabled||l.defaultPrevented)&&(l.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:h(e.onPointerMove,Z(l=>{c.onItemEnter(l),!l.defaultPrevented&&!e.disabled&&!n.open&&!i.current&&(c.onPointerGraceIntentChange(null),i.current=window.setTimeout(()=>{n.onOpenChange(!0),d()},100))})),onPointerLeave:h(e.onPointerLeave,Z(l=>{d();const v=n.content?.getBoundingClientRect();if(v){const C=n.content?.dataset.side,x=C==="right",_=x?-5:5,g=v[x?"left":"right"],M=v[x?"right":"left"];c.onPointerGraceIntentChange({area:[{x:l.clientX+_,y:l.clientY},{x:g,y:v.top},{x:M,y:v.top},{x:M,y:v.bottom},{x:g,y:v.bottom}],side:C}),window.clearTimeout(u.current),u.current=window.setTimeout(()=>c.onPointerGraceIntentChange(null),300)}else{if(c.onTriggerLeave(l),l.defaultPrevented)return;c.onPointerGraceIntentChange(null)}})),onKeyDown:h(e.onKeyDown,l=>{const v=c.searchRef.current!=="";e.disabled||v&&l.key===" "||hn[o.dir].includes(l.key)&&(n.onOpenChange(!0),n.content?.focus(),l.preventDefault())})})})});st.displayName=H;var ct="MenuSubContent",it=s.forwardRef((e,t)=>{const n=We(E,e.__scopeMenu),{forceMount:o=n.forceMount,...r}=e,c=K(E,e.__scopeMenu),i=Q(E,e.__scopeMenu),u=at(ct,e.__scopeMenu),p=s.useRef(null),f=j(t,p);return a.jsx(X.Provider,{scope:e.__scopeMenu,children:a.jsx(se,{present:o||c.open,children:a.jsx(X.Slot,{scope:e.__scopeMenu,children:a.jsx(Re,{id:u.contentId,"aria-labelledby":u.triggerId,...r,ref:f,align:"start",side:i.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:d=>{i.isUsingKeyboardRef.current&&p.current?.focus(),d.preventDefault()},onCloseAutoFocus:d=>d.preventDefault(),onFocusOutside:h(e.onFocusOutside,d=>{d.target!==u.trigger&&c.onOpenChange(!1)}),onEscapeKeyDown:h(e.onEscapeKeyDown,d=>{i.onClose(),d.preventDefault()}),onKeyDown:h(e.onKeyDown,d=>{const l=d.currentTarget.contains(d.target),v=xn[i.dir].includes(d.key);l&&v&&(c.onOpenChange(!1),u.trigger?.focus(),d.preventDefault())})})})})})});it.displayName=ct;function ut(e){return e?"open":"closed"}function oe(e){return e==="indeterminate"}function ye(e){return oe(e)?"indeterminate":e?"checked":"unchecked"}function Ln(e){const t=document.activeElement;for(const n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function Gn(e,t){return e.map((n,o)=>e[(t+o)%e.length])}function Kn(e,t,n){const r=t.length>1&&Array.from(t).every(f=>f===t[0])?t[0]:t,c=n?e.indexOf(n):-1;let i=Gn(e,Math.max(c,0));r.length===1&&(i=i.filter(f=>f!==n));const p=i.find(f=>f.toLowerCase().startsWith(r.toLowerCase()));return p!==n?p:void 0}function $n(e,t){const{x:n,y:o}=e;let r=!1;for(let c=0,i=t.length-1;c<t.length;i=c++){const u=t[c],p=t[i],f=u.x,d=u.y,l=p.x,v=p.y;d>o!=v>o&&n<(l-f)*(o-d)/(v-d)+f&&(r=!r)}return r}function Bn(e,t){if(!t)return!1;const n={x:e.clientX,y:e.clientY};return $n(n,t)}function Z(e){return t=>t.pointerType==="mouse"?e(t):void 0}var Un=Ve,Vn=we,Wn=Ye,Yn=ze,zn=be,Hn=He,Xn=ie,Zn=Ze,qn=Je,Jn=et,Qn=nt,eo=ot,to=rt,no=st,oo=it,ue="DropdownMenu",[ro]=ae(ue,[Be]),I=Be(),[ao,lt]=ro(ue),dt=e=>{const{__scopeDropdownMenu:t,children:n,dir:o,open:r,defaultOpen:c,onOpenChange:i,modal:u=!0}=e,p=I(t),f=s.useRef(null),[d,l]=Ne({prop:r,defaultProp:c??!1,onChange:i,caller:ue});return a.jsx(ao,{scope:t,triggerId:ve(),triggerRef:f,contentId:ve(),open:d,onOpenChange:l,onOpenToggle:s.useCallback(()=>l(v=>!v),[l]),modal:u,children:a.jsx(Un,{...p,open:d,onOpenChange:l,dir:o,modal:u,children:n})})};dt.displayName=ue;var ft="DropdownMenuTrigger",pt=s.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,disabled:o=!1,...r}=e,c=lt(ft,n),i=I(n);return a.jsx(Vn,{asChild:!0,...i,children:a.jsx(A.button,{type:"button",id:c.triggerId,"aria-haspopup":"menu","aria-expanded":c.open,"aria-controls":c.open?c.contentId:void 0,"data-state":c.open?"open":"closed","data-disabled":o?"":void 0,disabled:o,...r,ref:re(t,c.triggerRef),onPointerDown:h(e.onPointerDown,u=>{!o&&u.button===0&&u.ctrlKey===!1&&(c.onOpenToggle(),c.open||u.preventDefault())}),onKeyDown:h(e.onKeyDown,u=>{o||(["Enter"," "].includes(u.key)&&c.onOpenToggle(),u.key==="ArrowDown"&&c.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(u.key)&&u.preventDefault())})})})});pt.displayName=ft;var so="DropdownMenuPortal",mt=e=>{const{__scopeDropdownMenu:t,...n}=e,o=I(t);return a.jsx(Wn,{...o,...n})};mt.displayName=so;var vt="DropdownMenuContent",gt=s.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...o}=e,r=lt(vt,n),c=I(n),i=s.useRef(!1);return a.jsx(Yn,{id:r.contentId,"aria-labelledby":r.triggerId,...c,...o,ref:t,onCloseAutoFocus:h(e.onCloseAutoFocus,u=>{i.current||r.triggerRef.current?.focus(),i.current=!1,u.preventDefault()}),onInteractOutside:h(e.onInteractOutside,u=>{const p=u.detail.originalEvent,f=p.button===0&&p.ctrlKey===!0,d=p.button===2||f;(!r.modal||d)&&(i.current=!0)}),style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});gt.displayName=vt;var co="DropdownMenuGroup",io=s.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...o}=e,r=I(n);return a.jsx(zn,{...r,...o,ref:t})});io.displayName=co;var uo="DropdownMenuLabel",ht=s.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...o}=e,r=I(n);return a.jsx(Hn,{...r,...o,ref:t})});ht.displayName=uo;var lo="DropdownMenuItem",xt=s.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...o}=e,r=I(n);return a.jsx(Xn,{...r,...o,ref:t})});xt.displayName=lo;var fo="DropdownMenuCheckboxItem",po=s.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...o}=e,r=I(n);return a.jsx(Zn,{...r,...o,ref:t})});po.displayName=fo;var mo="DropdownMenuRadioGroup",vo=s.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...o}=e,r=I(n);return a.jsx(qn,{...r,...o,ref:t})});vo.displayName=mo;var go="DropdownMenuRadioItem",ho=s.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...o}=e,r=I(n);return a.jsx(Jn,{...r,...o,ref:t})});ho.displayName=go;var xo="DropdownMenuItemIndicator",Mo=s.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...o}=e,r=I(n);return a.jsx(Qn,{...r,...o,ref:t})});Mo.displayName=xo;var wo="DropdownMenuSeparator",Mt=s.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...o}=e,r=I(n);return a.jsx(eo,{...r,...o,ref:t})});Mt.displayName=wo;var Co="DropdownMenuArrow",_o=s.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...o}=e,r=I(n);return a.jsx(to,{...r,...o,ref:t})});_o.displayName=Co;var Ro="DropdownMenuSubTrigger",bo=s.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...o}=e,r=I(n);return a.jsx(no,{...r,...o,ref:t})});bo.displayName=Ro;var Io="DropdownMenuSubContent",yo=s.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...o}=e,r=I(n);return a.jsx(oo,{...r,...o,ref:t,style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});yo.displayName=Io;var So=dt,Eo=pt,Po=mt,Do=gt,No=ht,To=xt,jo=Mt;function Ao({...e}){return a.jsx(So,{"data-slot":"dropdown-menu",...e})}function Oo({...e}){return a.jsx(Eo,{"data-slot":"dropdown-menu-trigger",...e})}function ko({className:e,sideOffset:t=4,...n}){return a.jsx(Po,{children:a.jsx(Do,{"data-slot":"dropdown-menu-content",sideOffset:t,className:O("bg-popover text-popover-foreground 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 z-50 max-h-(--radix-dropdown-menu-content-available-height) min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border p-1 shadow-md",e),...n})})}function me({className:e,inset:t,variant:n="default",...o}){return a.jsx(To,{"data-slot":"dropdown-menu-item","data-inset":t,"data-variant":n,className:O("focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:!text-destructive [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",e),...o})}function Wo({className:e,inset:t,...n}){return a.jsx(No,{"data-slot":"dropdown-menu-label","data-inset":t,className:O("px-2 py-1.5 text-sm font-medium data-[inset]:pl-8",e),...n})}function Yo({className:e,...t}){return a.jsx(jo,{"data-slot":"dropdown-menu-separator",className:O("bg-border -mx-1 my-1 h-px",e),...t})}const Fo=({className:e})=>{const{setTheme:t}=jt();return a.jsxs(Ao,{children:[a.jsx(Oo,{asChild:!0,children:a.jsxs(At,{variant:"ghost",size:"icon",className:e,children:[a.jsx(Ut,{className:"h-[1.2rem] w-[1.2rem] scale-100 rotate-0 transition-all dark:scale-0 dark:-rotate-90"}),a.jsx($t,{className:"absolute h-[1.2rem] w-[1.2rem] scale-0 rotate-90 transition-all dark:scale-100 dark:rotate-0"}),a.jsx("span",{className:"sr-only",children:"Toggle theme"})]})}),a.jsxs(ko,{children:[a.jsx(me,{onClick:()=>t("light"),children:"Light"}),a.jsx(me,{onClick:()=>t("dark"),children:"Dark"}),a.jsx(me,{onClick:()=>t("system"),children:"System"})]})]})};function Lo({...e}){return a.jsx("nav",{"aria-label":"breadcrumb","data-slot":"breadcrumb",...e})}function Go({className:e,...t}){return a.jsx("ol",{"data-slot":"breadcrumb-list",className:O("text-muted-foreground flex flex-wrap items-center gap-1.5 text-sm break-words sm:gap-2.5",e),...t})}function Ko({className:e,...t}){return a.jsx("li",{"data-slot":"breadcrumb-item",className:O("inline-flex items-center gap-1.5",e),...t})}function $o({className:e,...t}){return a.jsx("span",{"data-slot":"breadcrumb-page",role:"link","aria-disabled":"true","aria-current":"page",className:O("text-foreground font-normal",e),...t})}function Bo({children:e,className:t,...n}){return a.jsx("li",{"data-slot":"breadcrumb-separator",role:"presentation","aria-hidden":"true",className:O("[&>svg]:size-3.5",t),...n,children:e??a.jsx(Gt,{})})}function zo({breadcrumbs:e,actions:t,children:n}){const o=Ft(),r=s.useMemo(()=>e||o.pathname.split("/").filter(Boolean).map(i=>i.charAt(0).toUpperCase()+i.slice(1)),[o.pathname,e]);return a.jsxs(a.Fragment,{children:[a.jsxs("header",{className:"flex h-12 shrink-0 items-center gap-2 border-b px-4",children:[a.jsx(Ot,{className:"-ml-1"}),a.jsx(kt,{orientation:"vertical",className:"mr-2 h-4"}),a.jsx(Lo,{children:a.jsx(Go,{children:r.map((c,i)=>a.jsxs(s.Fragment,{children:[a.jsx(Ko,{children:i===r.length-1?a.jsx($o,{children:c}):c}),i<r.length-1&&a.jsx(Bo,{})]},i))})}),a.jsxs("div",{className:"ml-auto flex items-center gap-2",children:[t,a.jsx(Fo,{})]})]}),a.jsx("div",{className:"flex flex-1 flex-col",children:a.jsx("div",{className:"@container/main",children:a.jsx("div",{className:"flex flex-col gap-4 p-4",children:n})})})]})}export{Gt as C,Ao as D,zo as P,Oo as a,ko as b,me as c,Wo as d,Yo as e,je as f,Ae as u};
@@ -1 +0,0 @@
1
- import{c as i,j as t,B as o,i as n,J as c}from"./index-Bi48hI2z.js";import{m as d}from"./use-settings-form-submit-CDRh-E9U.js";const u=[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]],x=i("Trash2",u),m=({className:a,onClick:s})=>t.jsxs(o,{type:"button",variant:"destructive",className:n("",a),onClick:s,children:[t.jsx("span",{className:"sr-only",children:"Delete option"}),t.jsx(x,{className:"size-4"})]}),y=({className:a,showDelete:s=!1,onDelete:r})=>{const e=d();return t.jsxs("div",{className:n("flex items-center gap-2",a),children:[t.jsx(c,{type:"text",id:`${e.name}`,className:"form-input",value:e.state.value?String(e.state.value):"","aria-invalid":!!(e.state.meta.isTouched&&e.state.meta.errorMap.onBlur?.length>0),onBlur:e.handleBlur,onChange:l=>e.handleChange(l.target.value)}),s&&t.jsx(m,{onClick:r})]})};export{y as default};
@@ -1 +0,0 @@
1
- import{j as n,K as s,i as o,M as d}from"./index-Bi48hI2z.js";const c=d("focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive inline-flex w-fit shrink-0 items-center justify-center gap-1 overflow-hidden rounded-md border px-2 py-0.5 text-xs font-medium whitespace-nowrap transition-[color,box-shadow] focus-visible:ring-[3px] [&>svg]:pointer-events-none [&>svg]:size-3",{variants:{variant:{default:"bg-primary text-primary-foreground [a&]:hover:bg-primary/90 border-transparent",secondary:"bg-secondary text-secondary-foreground [a&]:hover:bg-secondary/90 border-transparent",destructive:"bg-destructive [a&]:hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60 border-transparent text-white",outline:"text-foreground [a&]:hover:bg-accent [a&]:hover:text-accent-foreground"}},defaultVariants:{variant:"default"}});function u({className:e,variant:r,asChild:t=!1,...a}){const i=t?s:"span";return n.jsx(i,{"data-slot":"badge",className:o(c({variant:r}),e),...a})}export{u as B};
@@ -1 +0,0 @@
1
- import{c}from"./index-Bi48hI2z.js";const e=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],t=c("Check",e);export{t as C};
@@ -1 +0,0 @@
1
- import{c as o}from"./index-Bi48hI2z.js";const n=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],c=o("ChevronDown",n);export{c as C};
@@ -1 +0,0 @@
1
- import{c as ge,j as e,y as W,z as X,A as Z,E as ee,F as se,L as O,G as te,B as v,H as ne,Q as je,r as g,u as re,t as J}from"./index-Bi48hI2z.js";import{u as le,i as q,j as ie,b as ae,c as z,F as oe,k as B,f as Ce,p as be,a as we,A as Ne}from"./use-settings-form-submit-CDRh-E9U.js";import{u as de}from"./useQuery-A4Hv_4uX.js";import{P as Se,D as ve,a as Fe,b as ye,d as Te,c as I}from"./Page-C3rteCZt.js";import{T as Ae,a as De,b as H,c as V,d as Ue,e as F}from"./table-DvgJU7Gh.js";import{P as ce,T as Le,E as Oe,a as Ve,b as ke}from"./test-tube-BIwmoM45.js";import{L as Pe}from"./loader-circle-M0gu1gZ-.js";const Ee=[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}]],Re=ge("Trash",Ee);function Me({open:l,onOpenChange:a,client:r,onEdit:d}){return e.jsx(W,{open:l,onOpenChange:a,children:e.jsxs(X,{className:"sm:max-w-md",children:[e.jsxs(Z,{children:[e.jsx(ee,{children:"View Torrent Client"}),e.jsx(se,{children:"View torrent client details."})]}),e.jsxs("div",{className:"grid flex-1 auto-rows-min gap-6 px-4",children:[e.jsxs("div",{className:"grid gap-3",children:[e.jsx(O,{children:"URL"}),e.jsx("div",{className:"bg-muted/50 rounded-md border px-3 py-2 font-mono text-sm break-all",children:r?.url||"N/A"})]}),e.jsxs("div",{className:"grid gap-3",children:[e.jsx(O,{children:"Username"}),e.jsx("div",{className:"bg-muted/50 rounded-md border px-3 py-2 font-mono text-sm break-all",children:r?.user||"N/A"})]}),e.jsxs("div",{className:"grid gap-3",children:[e.jsx(O,{children:"Password"}),e.jsx("div",{className:"bg-muted/50 rounded-md border px-3 py-2 font-mono text-sm break-all",children:r?.password?"********":"N/A"})]}),e.jsxs("div",{className:"grid gap-3",children:[e.jsx(O,{children:"Read only"}),e.jsx("div",{className:"bg-muted/50 rounded-md border px-3 py-2 font-mono text-sm break-all",children:r?.readOnly?"Yes":"No"})]})]}),e.jsxs(te,{children:[d&&e.jsxs(v,{type:"button",onClick:()=>d(r),className:"flex-1",children:[e.jsx(ce,{className:"mr-2 h-4 w-4"}),"Edit"]}),e.jsx(ne,{asChild:!0,className:"flex-1",children:e.jsx(v,{type:"button",variant:"outline",className:"flex-1",children:"Close"})})]})]})})}function _(l){return new URL(l).protocol}function Q(l){return new URL(l).host}const $e=l=>{try{const a=_(l),r=Q(l);return`${a}//${r}`}catch(a){return console.warn("Unable to strip credentials from client URL",a),l}};function qe({client:l,protocol:a,host:r,username:d="",password:h}){let o="";l!=="deluge"&&d&&(o=d),h&&(o+=`:${h}`),o+="@";const C=ue(l,!1);return`${a}//${o}${r}${C}`}function Be({client:l,protocol:a,host:r,username:d="",password:h="",readonly:o=!1,usePlugin:C=!1}){let m="";d&&(m+=d),h&&(m+=`:${h}`),m+="@";const w=ue(l,C);return`${l.toLowerCase()}:${o?"readonly:":""}${a}//${m}${r}${w}`}function ue(l,a){switch(l.toLowerCase()){case"qbittorrent":return"";case"transmission":return"/transmission/rpc";case"deluge":return"/json";case"rtorrent":return a?"/rutorrent/plugins/httprpc/action.php":"/RPC2";default:return""}}const Ie=async({client:l,url:a,username:r="",password:d,plugin:h=!1})=>{try{return{success:(await je.clients.testConnection.mutate({client:l.toLowerCase(),url:a,username:r,password:d,readonly:!1,plugin:h})).success}}catch(o){return console.error("Error testing connection:",o),{success:!1}}},K={qbittorrent:"qBittorrent",rtorrent:"rTorrent",transmission:"Transmission",deluge:"Deluge"};function He({open:l,onOpenChange:a,mode:r,client:d}){const[h,o]=g.useState(!1),{isFieldRequired:C}=le(q),m=re(),{data:w}=de(m.settings.get.queryOptions(void 0,{select:t=>t.config.torrentClients||[]})),{saveConfig:N,isLoading:k}=ie(),c=ae({...z,defaultValues:d??{},onSubmit:async({value:t})=>{try{const p={...t,readOnly:t?.readOnly??!1},x=q.safeParse(p);if(x.success){const i=x.data,f=_(i.url),S=Q(i.url),j=Be({client:i.client,protocol:f,host:S,username:i.user??"",password:i.password??"",readonly:i.readOnly});let b;r==="edit"&&d&&d.index!==void 0?(b=[...w||[]],b[d.index]=j):b=[...w||[],j],N({torrentClients:b}),a(!1)}else throw console.error("FULL VALIDATION FAILED:",x.error.format()),new Error("Validation failed")}catch(p){return console.error("Exception during full validation:",p),{status:"error",error:{_form:"An unexpected error occurred during validation"}}}},validators:{onSubmit:q}}),P=async()=>{o(!0);const t=String(c.getFieldValue("client")),p=String(c.getFieldValue("url")),x=String(c.getFieldValue("user")||""),i=String(c.getFieldValue("password")||""),f=qe({client:t,protocol:_(p),host:Q(p),username:x,password:i});(await Ie({client:t,url:f,username:x,password:i,plugin:!1})).success?(J.success("Connection successful!",{description:"The torrent client connection was successful."}),o(!1)):(J.error("Connection failed",{description:"Failed to connect to the torrent client."}),o(!1))},y=k||h;return e.jsx(W,{open:l,onOpenChange:a,children:e.jsx(X,{className:"sm:max-w-md",children:e.jsx(oe,{isFieldRequired:C,children:e.jsxs("form",{onSubmit:t=>{t.preventDefault(),t.stopPropagation(),c.handleSubmit()},children:[e.jsxs(Z,{children:[e.jsx(ee,{children:r==="edit"?"Edit Client":"Create Client"}),e.jsx(se,{children:r==="edit"?"Edit the details of the torrent client.":"Create a new torrent client."})]}),e.jsxs("div",{className:"grid flex-1 auto-rows-min gap-6 px-4",children:[e.jsx("div",{className:"grid gap-3",children:e.jsx(c.AppField,{name:"client",children:t=>e.jsxs(e.Fragment,{children:[e.jsx(t.SelectField,{label:"Client",options:K}),t.state.value===K.rtorrent.toLowerCase()&&e.jsx(c.AppField,{name:"plugin",children:p=>e.jsx(p.SwitchField,{label:"Use Plugin URL"})})]})})}),e.jsx("div",{className:"grid gap-3",children:e.jsx(c.AppField,{name:"url",children:t=>e.jsx(t.TextField,{label:"Client URL"})})}),e.jsx("div",{className:"grid gap-3",children:e.jsx(c.AppField,{name:"user",children:t=>e.jsx(t.TextField,{label:"User"})})}),e.jsx("div",{className:"grid gap-3",children:e.jsx(c.AppField,{name:"password",children:t=>e.jsx(t.TextField,{label:"Password",type:"password"})})}),e.jsx("div",{className:"grid gap-3",children:e.jsx(c.AppField,{name:"readOnly",children:t=>e.jsx(t.SwitchField,{label:"Read only"})})}),e.jsx(c.Subscribe,{selector:t=>({urlValue:t.values.url,urlMeta:t.fieldMeta.url,userValue:t.values.user,userMeta:t.fieldMeta.user,passwordValue:t.values.password,passwordMeta:t.fieldMeta.password,clientValue:t.values.client}),children:({urlValue:t,urlMeta:p,userValue:x,userMeta:i,passwordValue:f,passwordMeta:S,clientValue:j})=>{const b=t&&!p?.errors?.length,E=j==="transmission"&&f===void 0?!0:f&&!S?.errors?.length,R=j==="deluge"||j==="transmission"?!0:x&&!i?.errors?.length,T=b&&E&&R;return e.jsxs(e.Fragment,{children:[e.jsx(v,{type:"button",variant:"outline",onClick:P,disabled:!T,className:"w-full",children:h?e.jsxs(e.Fragment,{children:[e.jsx(Pe,{className:"animate-spin"}),"Testing connection..."]}):e.jsxs(e.Fragment,{children:[e.jsx(Le,{className:"mr-2"}),"Test Connection"]})}),j==="qbittorrent"&&e.jsxs("p",{className:"text-muted-foreground -mt-4 px-2 text-sm italic",children:["Note: Testing connections can return false positives if"," ",e.jsx("code",{className:"bg-yellow-100 px-1",children:"Bypass auth on localhost"})," ","is enabled in qBittorrent."]})]})}})]}),e.jsxs(te,{className:"mt-6",children:[e.jsx(c.AppForm,{children:e.jsx(c.SubmitButton,{label:r==="edit"?"Update":"Create",actionLabel:r==="edit"?"Updating...":"Creating..."})}),e.jsx(ne,{asChild:!0,children:e.jsx(v,{type:"button",variant:"outline",disabled:y,children:"Cancel"})})]})]})})})})}function We(){const l=re(),{saveConfig:a}=ie(),[r,d]=g.useState(void 0),[h,o]=g.useState(null),[C,m]=g.useState(null),[w,N]=g.useState(!1),[k,c]=g.useState(!1),[P,y]=g.useState("create"),{isFieldRequired:t}=le(B),{data:p}=de(l.settings.get.queryOptions(void 0,{select:s=>{const n=Ce(s.config);return be(B,n,{includeUndefined:!0})}})),x=we(),i=ae({...z,defaultValues:p??z.defaultValues,onSubmit:x,validators:{onSubmit:B}}),[f,S]=g.useState(null);g.useEffect(()=>{f&&(document.getElementById(f)?.focus(),S(null))},[f]),g.useEffect(()=>{const s=p?.torrentClients??[];if(!s.length){d([]);return}const n=s.map((u,xe)=>{if(!u)return null;let A="",D="",U=!1,M="",$="";if(typeof u=="object")A=u.client,U=u.readOnly||!1,D=u.url,M=u.user||"",$=u.password||"";else if(typeof u=="string"){A=String(u).split(":")[0],U=String(u).includes("readonly");const fe=String(u).indexOf(":"),L=U?String(u).substring(String(u).indexOf(":",fe+1)+1):String(u).substring(String(u).indexOf(":")+1);if(!L)return null;const G=$e(L);if(!G)return null;D=G,M=j(L),$=b(L)}return!A||!D?null:{index:xe,client:A,url:D,user:M,password:$,readOnly:U}}).filter(Boolean);d(n)},[p]);const j=s=>{if(s.includes("@")){const n=s.split("://")[1].split("@")[0];return n.includes(":")?n.split(":")[0]:n.replace(":","")}return""},b=s=>{if(s.includes("@")){const n=s.split("://")[1].split("@")[0];if(n.includes(":"))return n.split(":")[1]}return""},E=s=>{s.preventDefault(),s.stopPropagation(),m(null),y("create"),c(!0)},R=s=>{N(s),s||o(null)},T=(s,n)=>{s.preventDefault(),s.stopPropagation(),o(null),m(n),N(!0)},Y=s=>{o(null),m(s),y("edit"),N(!1),c(!0)},pe=s=>{o(null);const n=r?.filter(u=>u.url!==s.url);d(n),a({torrentClients:n||[]})},he=s=>{c(s),s||o(null)},me=e.jsxs(v,{onClick:E,type:"button",size:"sm",children:[e.jsx(ke,{className:"mr-2 h-4 w-4"}),"Add Torrent Client"]});return e.jsxs(Se,{breadcrumbs:["Settings","Torrent Clients"],actions:me,children:[e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{children:[e.jsx("h1",{className:"text-2xl font-bold",children:"Torrent Clients"}),e.jsx("p",{className:"text-muted-foreground",children:"Manage your torrent clients"})]}),r?e.jsx("div",{className:"mt-4 mb-7 overflow-x-auto rounded-lg border",children:e.jsxs(Ae,{children:[e.jsx(De,{className:"bg-muted sticky top-0 z-10",children:e.jsxs(H,{className:"border-b",children:[e.jsx(V,{children:"Client"}),e.jsx(V,{children:"RPC URL"}),e.jsx(V,{children:"Read only"}),e.jsx(V,{className:"text-right",children:"Actions"})]})}),e.jsxs(Ue,{children:[r?.length===0&&e.jsx(H,{children:e.jsx(F,{colSpan:6,className:"text-center",children:e.jsx("p",{className:"text-muted-foreground",children:"No torrent clients configured. Add a client to start downloading."})})}),r?.map(s=>e.jsxs(H,{className:"hover:bg-muted/50 cursor-pointer",onClick:n=>T(n,s),children:[e.jsx(F,{className:"font-medium",children:s.client}),e.jsx(F,{className:"font-mono text-sm",children:s.url}),e.jsx(F,{children:s.readOnly?"Yes":"No"}),e.jsx(F,{className:"text-right",children:e.jsxs(ve,{open:h===s.url,onOpenChange:n=>o(n?s.url:null),children:[e.jsx(Fe,{asChild:!0,children:e.jsxs(v,{variant:"ghost",className:"h-8 w-8 p-0",type:"button",onClick:n=>{n.preventDefault(),n.stopPropagation()},children:[e.jsx("span",{className:"sr-only",children:"Actions"}),e.jsx(Oe,{className:"h-4 w-4"})]})}),e.jsxs(ye,{align:"end",children:[e.jsx(Te,{children:"Actions"}),e.jsxs(I,{onClick:n=>{T(n,s)},children:[e.jsx(Ve,{className:"mr-2 h-4 w-4"}),"View Details"]}),e.jsxs(I,{onClick:n=>{n.stopPropagation(),Y(s)},children:[e.jsx(ce,{className:"mr-2 h-4 w-4"}),"Edit"]}),e.jsxs(I,{variant:"destructive",onClick:n=>{n.stopPropagation(),pe(s)},children:[e.jsx(Re,{className:"mr-2 h-4 w-4"}),"Delete"]})]})]})})]},s.url))]})]})}):e.jsx("p",{className:"mb-4 text-lg",children:"No torrent clients configured. Add a client"}),e.jsx(oe,{isFieldRequired:t,children:e.jsx("form",{className:"form flex flex-col gap-4",onSubmit:s=>{s.preventDefault(),s.stopPropagation(),i.handleSubmit()},noValidate:!0,children:e.jsxs("div",{className:"flex flex-wrap gap-2",children:[e.jsx("h2",{className:"text-xl font-bold",children:"Torrent Client Options"}),e.jsxs("fieldset",{className:"form-fieldset w-full gap-6 rounded-md",children:[e.jsx("div",{className:"",children:e.jsx(i.AppField,{name:"action",children:s=>e.jsx(s.SelectField,{label:"Action",options:Ne})})}),e.jsx("div",{className:"",children:e.jsx(i.AppField,{name:"linkCategory",validators:{},children:s=>e.jsx(s.TextField,{label:"Link Category",required:!1})})}),e.jsx("div",{className:"",children:e.jsx(i.AppField,{name:"torrentDir",validators:{},children:s=>e.jsx(s.TextField,{label:"Torrent Directory",required:!1})})}),e.jsx("div",{className:"",children:e.jsx(i.AppField,{name:"outputDir",validators:{},children:s=>e.jsx(s.TextField,{label:"Output Directory",required:!1})})}),e.jsxs("div",{className:"form-field-switches col-span-2 gap-x-12",children:[e.jsx(i.AppField,{name:"skipRecheck",children:s=>e.jsx(s.SwitchField,{label:"Skip Recheck"})}),e.jsx(i.AppField,{name:"useClientTorrents",children:s=>e.jsx(s.SwitchField,{label:"Use Client Torrents"})}),e.jsx(i.AppField,{name:"duplicateCategories",children:s=>e.jsx(s.SwitchField,{label:"Duplicate Categories"})})]})]}),e.jsx(i.AppForm,{children:e.jsx(i.SubmitButton,{})})]})})})]}),e.jsx(Me,{open:w,onOpenChange:R,client:C,onEdit:Y}),e.jsx(He,{open:k,onOpenChange:he,client:C,mode:P})]})}export{We as component};
@@ -1 +0,0 @@
1
- import{u as g,r as x,j as e,L as d,B as i}from"./index-Bi48hI2z.js";import{F as m}from"./FieldInfo-Bxj_j8SJ.js";import{u as y,h as u,f as N,p as f,a as A,b as $,c as j,F as S,d as h,l as p}from"./use-settings-form-submit-CDRh-E9U.js";import{u as w}from"./useQuery-A4Hv_4uX.js";import{P as D}from"./Page-C3rteCZt.js";function R(){const{isFieldRequired:n}=y(u),v=g(),{data:b}=w(v.settings.get.queryOptions(void 0,{select:a=>{const r=N(a.config);return f(u,r,{includeUndefined:!0})}})),F=A(),l=$({...j,defaultValues:b??j.defaultValues,onSubmit:F,validators:{onSubmit:u}}),[c,o]=x.useState(null);return x.useEffect(()=>{c&&(document.getElementById(c)?.focus(),o(null))},[c]),e.jsx(D,{children:e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{children:[e.jsx("h1",{className:"text-2xl font-bold",children:"Connected App Settings"}),e.jsx("p",{className:"text-muted-foreground",children:"Manage apps connected to Cross-seed."})]}),e.jsx(S,{isFieldRequired:n,children:e.jsx("form",{className:"form flex flex-col gap-4",onSubmit:a=>{a.preventDefault(),a.stopPropagation(),l.handleSubmit()},noValidate:!0,children:e.jsxs("div",{className:"flex flex-wrap gap-6",children:[e.jsxs("fieldset",{className:"form-fieldset w-full gap-6",children:[e.jsx("div",{children:e.jsx(l.AppField,{name:"host",validators:{},children:a=>e.jsx(a.TextField,{label:"Host"})})}),e.jsx("div",{className:"",children:e.jsx(l.AppField,{name:"port",validators:{},children:a=>e.jsx(a.TextField,{label:"Port",type:"number"})})}),e.jsx("div",{className:"",children:e.jsx(l.AppField,{name:"apiKey",validators:{},children:a=>e.jsx(a.TextField,{label:"API Key"})})})]}),e.jsxs("fieldset",{className:"form-fieldset border-border w-full gap-6 rounded-md border",children:[e.jsx("legend",{children:"Connect to Other Apps"}),e.jsx("div",{className:"",children:e.jsx(l.Field,{name:"sonarr",mode:"array",validators:{},children:a=>e.jsxs("div",{className:"space-y-3",children:[e.jsxs(d,{htmlFor:a.name,className:"block w-full",children:["Sonarr URL(s)",n(a.name)&&e.jsx("span",{className:"pl-1 text-red-500",children:"*"})]}),a.state.value&&a.state.value.map((r,s)=>e.jsxs("div",{className:"gap-y- mb-3 flex flex-col",children:[e.jsx(l.AppField,{name:`sonarr[${s}]`,validators:{onBlur:h().url().or(p(""))},children:t=>e.jsx(t.ArrayField,{showDelete:a.state.value&&a.state.value?.length>1,index:s,onDelete:()=>{a.removeValue(s)}})}),e.jsx(l.Subscribe,{selector:t=>t.fieldMeta[`${a.name}[${s}]`],children:t=>e.jsx(m,{fieldMeta:t})})]},s)),e.jsx(i,{variant:"secondary",type:"button",onClick:()=>{a.pushValue("");const r=`${a.name}-${a.state.value?.length?a.state.value.length-1:0}`;o(r)},title:`Add ${a.name}`,children:"Add"})]})})}),e.jsx("div",{children:e.jsx(l.Field,{name:"radarr",mode:"array",validators:{},children:a=>e.jsxs("div",{className:"space-y-3",children:[e.jsxs(d,{htmlFor:a.name,className:"block w-full",children:["Radarr URL(s)",n(a.name)&&e.jsx("span",{className:"pl-1 text-red-500",children:"*"})]}),a.state.value&&a.state.value.map((r,s)=>e.jsxs("div",{className:"gap-y- mb-3 flex flex-col",children:[e.jsx(l.AppField,{name:`radarr[${s}]`,validators:{onBlur:h().url().or(p(""))},children:t=>e.jsx(t.ArrayField,{showDelete:a.state.value&&a.state.value?.length>1,index:s,onDelete:()=>{a.removeValue(s)}})}),e.jsx(l.Subscribe,{selector:t=>t.fieldMeta[`${a.name}[${s}]`],children:t=>e.jsx(m,{fieldMeta:t})})]},s)),e.jsx(i,{variant:"secondary",type:"button",onClick:()=>{a.pushValue("");const r=`${a.name}-${a.state.value?.length?a.state.value.length-1:0}`;o(r)},title:`Add ${a.name}`,children:"Add"})]})})}),e.jsx("div",{className:"",children:e.jsx(l.Field,{name:"notificationWebhookUrls",mode:"array",validators:{},children:a=>e.jsxs("div",{className:"space-y-3",children:[e.jsxs(d,{htmlFor:a.name,className:"block w-full",children:["Notification Webhook URL(s)",n(a.name)&&e.jsx("span",{className:"pl-1 text-red-500",children:"*"})]}),a.state.value?.map((r,s)=>e.jsxs("div",{className:"gap-y- mb-3 flex flex-col",children:[e.jsx(l.AppField,{name:`notificationWebhookUrls[${s}]`,validators:{onBlur:h().min(3).url().or(p(""))},children:t=>e.jsx(t.ArrayField,{showDelete:a.state.value&&a.state.value?.length>1,index:s,onDelete:()=>{a.removeValue(s)}})}),e.jsx(l.Subscribe,{selector:t=>t.fieldMeta[`${a.name}[${s}]`],children:t=>e.jsx(m,{fieldMeta:t})})]},s)),e.jsx(i,{variant:"secondary",type:"button",onClick:()=>{a.pushValue("");const r=`${a.name}-${a.state.value?.length?a.state.value.length-1:0}`;o(r)},title:`Add ${a.name}`,children:"Add"})]})})})]}),e.jsx(l.AppForm,{children:e.jsx(l.SubmitButton,{})})]})})})]})})}export{R as component};
@@ -1 +0,0 @@
1
- import{r as t,u as O,I as k,l as w,t as o,j as s,B as x}from"./index-Bi48hI2z.js";import{u as C}from"./useQuery-A4Hv_4uX.js";import{P as h}from"./Page-C3rteCZt.js";function P(){const[c,d]=t.useState(""),[n,l]=t.useState(!0),[p,u]=t.useState(""),f=t.useRef(null),m=O(),v=k(),{data:r,isLoading:b}=C(m.settings.get.queryOptions()),a=w(m.settings.replace.mutationOptions({onSuccess:()=>{o.success("Settings saved successfully!",{description:"Your changes will take effect on the next restart."}),v.invalidateQueries({queryKey:["settings.get"]})},onError:e=>{o.error("Failed to save settings",{description:e.message||"An unknown error occurred"})}})),g=()=>{const e=f.current;if(e){const i=window.pageYOffset||document.documentElement.scrollTop;e.style.height="auto",e.style.height=`${e.scrollHeight}px`,requestAnimationFrame(()=>{window.scrollTo(0,i)})}};t.useEffect(()=>{r?.config&&d(JSON.stringify(r.config,null,2))},[r]),t.useEffect(()=>{g()},[c]);const y=e=>{try{return JSON.parse(e),l(!0),u(""),!0}catch(i){return l(!1),u(i instanceof Error?i.message:"Invalid JSON"),!1}},j=e=>{d(e),y(e),setTimeout(g,0)},S=()=>{if(!n){o.error("Cannot save invalid JSON");return}try{const e=JSON.parse(c);a.mutate(e)}catch{o.error("Failed to parse JSON")}},N=()=>{r?.config&&(d(JSON.stringify(r.config,null,2)),l(!0),u(""),setTimeout(g,0))};if(b)return s.jsx(h,{breadcrumbs:["Diagnostics","Debug"],children:s.jsx("div",{className:"flex items-center justify-center p-8",children:s.jsx("div",{children:"Loading settings..."})})});const J=s.jsxs("div",{className:"flex gap-2",children:[s.jsx(x,{variant:"outline",onClick:N,disabled:a.isPending,children:"Reset"}),s.jsx(x,{onClick:S,disabled:!n||a.isPending,children:a.isPending?"Saving...":"Save"})]});return s.jsx(h,{breadcrumbs:["Diagnostics","Debug"],actions:J,children:s.jsxs("div",{className:"space-y-4",children:[s.jsxs("div",{children:[s.jsx("h1",{className:"text-2xl font-bold",children:"Debug Settings"}),s.jsx("p",{className:"text-muted-foreground",children:"Raw JSON editor for debugging configuration issues"})]}),s.jsx("div",{className:"relative",children:s.jsx("textarea",{ref:f,value:c,onChange:e=>j(e.target.value),className:`min-h-96 w-full resize-none overflow-hidden rounded-md border p-3 font-mono text-sm ${n?"border-gray-300 dark:border-gray-600":"border-red-500 dark:border-red-400"} bg-white text-gray-900 dark:bg-gray-900 dark:text-gray-100`,spellCheck:!1,placeholder:"Loading settings..."})}),!n&&s.jsxs("div",{className:"rounded-md bg-red-50 p-3 text-sm text-red-700 dark:bg-red-900/20 dark:text-red-400",children:[s.jsx("strong",{children:"JSON Error:"})," ",p]})]})})}export{P as component};
@@ -1 +0,0 @@
1
- import{u as f,r as d,j as e,L as m,B as u}from"./index-Bi48hI2z.js";import{u as g,e as c,f as b,p as y,a as D,b as N,c as p,F as S,d as h,L as A}from"./use-settings-form-submit-CDRh-E9U.js";import{F as x}from"./FieldInfo-Bxj_j8SJ.js";import{u as k}from"./useQuery-A4Hv_4uX.js";import{P as $}from"./Page-C3rteCZt.js";function T(){const{isFieldRequired:n}=g(c),j=f(),{data:v}=k(j.settings.get.queryOptions(void 0,{select:a=>{const r=b(a.config);return y(c,r,{includeUndefined:!0})}})),F=D(),s=N({...p,defaultValues:v??p.defaultValues,onSubmit:F,validators:{onSubmit:c}}),[i,o]=d.useState(null);return d.useEffect(()=>{i&&(document.getElementById(i)?.focus(),o(null))},[i]),e.jsx($,{children:e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{children:[e.jsx("h1",{className:"text-2xl font-bold",children:"Directory & Path Settings"}),e.jsx("p",{className:"text-muted-foreground",children:"Manage the directories and paths used by cross-seed."})]}),e.jsx(S,{isFieldRequired:n,children:e.jsx("form",{className:"form flex flex-col gap-4",onSubmit:a=>{a.preventDefault(),a.stopPropagation(),s.handleSubmit()},noValidate:!0,children:e.jsxs("div",{className:"flex flex-wrap gap-6",children:[e.jsxs("fieldset",{className:"form-fieldset w-full gap-6",children:[e.jsx("div",{className:"",children:e.jsx(s.Field,{name:"dataDirs",mode:"array",validators:{},children:a=>e.jsxs("div",{className:"space-y-3",children:[e.jsxs(m,{htmlFor:a.name,className:"block w-full",children:["Data Directories",n(a.name)&&e.jsx("span",{className:"pl-1 text-red-500",children:"*"})]}),a.state.value&&a.state.value.map((r,t)=>e.jsxs("div",{className:"gap-y- mb-3 flex flex-col",children:[e.jsx(s.AppField,{name:`dataDirs[${t}]`,validators:{onBlur:h()},children:l=>e.jsx(l.ArrayField,{showDelete:a.state.value&&a.state.value?.length>1,index:t,onDelete:()=>{a.removeValue(t)}})}),e.jsx(s.Subscribe,{selector:l=>l.fieldMeta[`${a.name}[${t}]`],children:l=>e.jsx(x,{fieldMeta:l})})]},t)),e.jsx(u,{variant:"secondary",type:"button",onClick:()=>{a.pushValue(""),a.state.value?.length&&o(`${a.name}-${a.state.value.length-1}`)},title:`Add ${a.name}`,children:"Add"})]})})}),e.jsx(s.AppField,{name:"flatLinking",validators:{},children:a=>e.jsx(a.SwitchField,{label:"Flat Linking",className:"form-field__switch flex flex-col items-start gap-5"})}),e.jsx("div",{className:"",children:e.jsx(s.AppField,{name:"linkType",children:a=>e.jsx(a.SelectField,{label:"Link Type",options:A})})}),e.jsx("div",{className:"",children:e.jsx(s.Field,{name:"linkDirs",mode:"array",validators:{},children:a=>e.jsxs("div",{className:"space-y-3",children:[e.jsxs(m,{htmlFor:a.name,className:"block w-full",children:["Link Directories",n(a.name)&&e.jsx("span",{className:"pl-1 text-red-500",children:"*"})]}),a.state.value?.map((r,t)=>e.jsxs("div",{className:"gap-y- mb-3 flex flex-col",children:[e.jsx(s.AppField,{name:`linkDirs[${t}]`,validators:{onBlur:h()},children:l=>e.jsx(l.ArrayField,{showDelete:(a.state.value&&a.state.value?.length>1)??void 0,index:t,onDelete:()=>{a.removeValue(t)}})}),e.jsx(s.Subscribe,{selector:l=>l.fieldMeta[`${a.name}[${t}]`],children:l=>e.jsx(x,{fieldMeta:l})})]},t)),e.jsx(u,{variant:"secondary",type:"button",onClick:()=>{a.pushValue("");const r=`${a.name}-${a.state.value?.length?a.state.value.length-1:0}`;o(r)},title:`Add ${a.name}`,children:"Add"})]})})}),e.jsx("div",{className:"",children:e.jsx(s.AppField,{name:"maxDataDepth",validators:{},children:a=>e.jsx(a.TextField,{label:"Max Data Depth",type:"number"})})})]}),e.jsx(s.AppForm,{children:e.jsx(s.SubmitButton,{})})]})})})]})})}export{T as component};
@@ -1 +0,0 @@
1
- import{r as i,j as r,i as S,J as D,L as C}from"./index-Bi48hI2z.js";import{S as L,a as M,b as P,c as y,d as E}from"./select-zHgqMzLj.js";import{m as R}from"./use-settings-form-submit-CDRh-E9U.js";import{u as T,R as k}from"./use-form-validation-context-BkAfWAh0.js";import{F as w}from"./FieldInfo-Bxj_j8SJ.js";import"./Page-C3rteCZt.js";import"./index-C2cH1Gst.js";import"./chevron-down-CRy8M0kJ.js";import"./check-Bu3ldi63.js";const B=[{label:"Millisecond",labelPlural:"Milliseconds",value:"milliseconds",ms:1},{label:"Second",labelPlural:"Seconds",value:"seconds",ms:1e3},{label:"Minute",labelPlural:"Minutes",value:"minutes",ms:60*1e3},{label:"Hour",labelPlural:"Hours",value:"hours",ms:3600*1e3},{label:"Day",labelPlural:"Days",value:"days",ms:1440*60*1e3}];function H({id:e,className:l,value:a,onChange:t,onBlur:d,units:c=B,disabled:p=!1}){const s=i.useMemo(()=>c,[c]),u=i.useMemo(()=>A(a),[a]),[o,h]=i.useState(()=>u!=null?v(u,s).value:s[2]?.value??s[0].value),[x,f]=i.useState(""),[g,U]=i.useState(!1),b=s.find(n=>n.value===o)??s[0],F=N(x),j=_(b,F);i.useEffect(()=>{if(!g&&u!=null){const n=v(u,s);n.value!==o&&h(n.value)}},[g,u,o,s]),i.useEffect(()=>{if(u==null){f("");return}const n=s.find(m=>m.value===o)??s[0];f($(u,n.ms))},[u,o,s]);const I=n=>{U(!0),f(n);const m=N(n);if(m==null){t(null);return}t(m*b.ms)},V=n=>{U(!0),h(n)};return r.jsxs("div",{className:S("flex items-center gap-3",l),children:[r.jsx(D,{id:e,name:e,type:"number",min:0,step:"any",className:"flex-1 shadow-none",value:x,onBlur:d,inputMode:"decimal",disabled:p,onChange:n=>I(n.target.value)}),r.jsxs(L,{value:b.value,onValueChange:V,disabled:p,children:[r.jsx(M,{className:"w-32 shadow-none",children:r.jsx(P,{"aria-label":j,children:j})}),r.jsx(y,{children:s.map(n=>r.jsx(E,{value:n.value,children:n.labelPlural??`${n.label}s`},n.value))})]})]})}function v(e,l){if(!Number.isFinite(e)||e<=0)return l[0];for(let a=l.length-1;a>=0;a-=1){const t=l[a];if(e>=t.ms)return t}return l[0]}function N(e){if(!e||e.trim()==="")return null;const l=Number(e);return!Number.isFinite(l)||l<0?null:l}function $(e,l){if(l===0)return"";const a=e/l;return Number.isInteger(a)?a.toString():z(a.toFixed(6))}function z(e){return e.includes(".")?e.replace(/\.?0+$/,""):e}function A(e){if(e==null)return null;if(typeof e=="number")return Number.isFinite(e)?e:null;const l=Number(e);return Number.isFinite(l)?l:null}function _(e,l){return l==null||l!==1?e.labelPlural??`${e.label}s`:e.label}const Y=({label:e,className:l,hideLabel:a=!1})=>{const t=R(),{isFieldRequired:d}=T();return r.jsxs("div",{className:S("space-y-3",l),children:[!a&&r.jsxs(C,{htmlFor:t.name,className:"block w-full",children:[e,d(t.name)&&r.jsx(k,{})]}),r.jsx(H,{id:t.name,value:t.state.value??null,onBlur:t.handleBlur,onChange:c=>t.handleChange(c)}),r.jsx(w,{fieldMeta:t.state.meta})]})};export{Y as default};
@@ -1 +0,0 @@
1
- import{u as h,r as c,j as e,L as j,B as F}from"./index-Bi48hI2z.js";import{F as f}from"./FieldInfo-Bxj_j8SJ.js";import{u as v,g as r,f as b,p as g,a as S,b as y,c as m,F as N,d as A}from"./use-settings-form-submit-CDRh-E9U.js";import{u as D}from"./useQuery-A4Hv_4uX.js";import{P as w}from"./Page-C3rteCZt.js";function B(){const{isFieldRequired:o}=v(r),u=h(),{data:p}=D(u.settings.get.queryOptions(void 0,{select:s=>{const n=b(s.config);return g(r,n,{includeUndefined:!0})}})),x=S(),a=y({...m,defaultValues:p??m.defaultValues,onSubmit:x,validators:{onSubmit:r}}),[i,d]=c.useState(null);return c.useEffect(()=>{i&&(document.getElementById(i)?.focus(),d(null))},[i]),e.jsx(w,{children:e.jsxs("div",{className:"space-y-4",children:[e.jsx("div",{children:e.jsx("h1",{className:"text-2xl font-bold",children:"General Settings"})}),e.jsx(N,{isFieldRequired:o,children:e.jsx("form",{className:"form flex flex-col gap-4",onSubmit:s=>{s.preventDefault(),s.stopPropagation(),a.handleSubmit()},noValidate:!0,children:e.jsxs("div",{className:"flex flex-wrap gap-6",children:[e.jsxs("fieldset",{className:"form-fieldset w-full gap-6",children:[e.jsx(a.AppField,{name:"includeNonVideos",children:s=>e.jsx(s.SwitchField,{label:"Include Non-Videos"})}),e.jsx(a.AppField,{name:"includeSingleEpisodes",children:s=>e.jsx(s.SwitchField,{label:"Include Single Episodes"})}),e.jsx("div",{className:"",children:e.jsx(a.AppField,{name:"snatchTimeout",validators:{},children:s=>e.jsx(s.DurationField,{label:"Snatch Timeout"})})}),e.jsx("div",{className:"",children:e.jsx(a.AppField,{name:"fuzzySizeThreshold",validators:{},children:s=>e.jsx(s.TextField,{label:"Fuzzy Size Threshold",type:"number"})})}),e.jsx("div",{className:"",children:e.jsx(a.AppField,{name:"seasonFromEpisodes",validators:{},children:s=>e.jsx(s.TextField,{label:"Season from Episodes",type:"number"})})}),e.jsx("div",{className:"",children:e.jsx(a.AppField,{name:"autoResumeMaxDownload",validators:{},children:s=>e.jsx(s.TextField,{label:"Auto-resume Max Download",type:"number"})})}),e.jsx("div",{className:"",children:e.jsx(a.Field,{name:"blockList",mode:"array",validators:{},children:s=>e.jsxs("div",{className:"space-y-3",children:[e.jsxs(j,{htmlFor:s.name,className:"block w-full",children:["Block List",o(s.name)&&e.jsx("span",{className:"pl-1 text-red-500",children:"*"})]}),s.state.value&&(s.state.value.length?s.state.value:[""]).map((n,l)=>e.jsxs("div",{className:"gap-y- mb-3 flex flex-col",children:[e.jsx(a.AppField,{name:`blockList[${l}]`,validators:{onBlur:A()},children:t=>e.jsx(t.ArrayField,{showDelete:s.state.value&&s.state.value?.length>1,index:l,onDelete:()=>{s.removeValue(l)}})}),e.jsx(a.Subscribe,{selector:t=>t.fieldMeta[`${s.name}[${l}]`],children:t=>e.jsx(f,{fieldMeta:t})})]},l)),e.jsx(F,{variant:"secondary",type:"button",onClick:()=>{s.pushValue("");const n=`${s.name}-${s.state.value?.length?s.state.value.length-1:0}`;d(n)},title:`Add ${s.name}`,children:"Add"})]})})})]}),e.jsx(a.AppForm,{children:e.jsx(a.SubmitButton,{})})]})})})]})})}export{B as component};