@dsh-teamwork/dsh-teamwork 0.8.4 → 0.10.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (88) hide show
  1. package/README.md +5 -2
  2. package/README.zh-CN.md +1 -1
  3. package/assets/readme/icon-256.png +0 -0
  4. package/assets/readme/review-and-publish.png +0 -0
  5. package/assets/readme/teamwork-panel.png +0 -0
  6. package/assets/readme/versions-and-backups.png +0 -0
  7. package/docs/development.md +88 -3
  8. package/docs/en/guide.md +50 -2
  9. package/docs/zh-CN/guide.md +20 -2
  10. package/icon.svg +7 -4
  11. package/lib/audit-archive.js +174 -0
  12. package/lib/audit-archive.js.map +1 -0
  13. package/lib/audit-cli.js +91 -0
  14. package/lib/audit-cli.js.map +1 -0
  15. package/lib/bridge.js +32 -10
  16. package/lib/bridge.js.map +1 -1
  17. package/lib/client.js +58 -15
  18. package/lib/client.js.map +1 -1
  19. package/lib/config-sync.js +1 -1
  20. package/lib/config-sync.js.map +1 -1
  21. package/lib/index.js +356 -97
  22. package/lib/index.js.map +1 -1
  23. package/lib/locale.js +18 -0
  24. package/lib/locale.js.map +1 -0
  25. package/lib/login-callback.js +1 -1
  26. package/lib/login-callback.js.map +1 -1
  27. package/lib/messages.js +119 -0
  28. package/lib/messages.js.map +1 -0
  29. package/lib/panel.js +27 -20
  30. package/lib/panel.js.map +1 -1
  31. package/lib/phone-security.js +120 -2
  32. package/lib/phone-security.js.map +1 -1
  33. package/lib/pin-lock.js +89 -0
  34. package/lib/pin-lock.js.map +1 -0
  35. package/lib/platform-models.js +10 -7
  36. package/lib/platform-models.js.map +1 -1
  37. package/lib/plugin-status.js +4 -4
  38. package/lib/plugin-status.js.map +1 -1
  39. package/lib/preset-session.js +2 -1
  40. package/lib/preset-session.js.map +1 -1
  41. package/lib/relay.js +14 -9
  42. package/lib/relay.js.map +1 -1
  43. package/lib/shared-mode.js +151 -0
  44. package/lib/shared-mode.js.map +1 -0
  45. package/lib/shared-owner.js +122 -0
  46. package/lib/shared-owner.js.map +1 -0
  47. package/lib/shared-roster.js +112 -0
  48. package/lib/shared-roster.js.map +1 -0
  49. package/lib/task-session.js +55 -19
  50. package/lib/task-session.js.map +1 -1
  51. package/lib/token-file.js +34 -0
  52. package/lib/token-file.js.map +1 -0
  53. package/lib/types/audit-archive.d.ts +78 -0
  54. package/lib/types/audit-archive.d.ts.map +1 -0
  55. package/lib/types/audit-cli.d.ts +14 -0
  56. package/lib/types/audit-cli.d.ts.map +1 -0
  57. package/lib/types/bridge.d.ts +7 -3
  58. package/lib/types/bridge.d.ts.map +1 -1
  59. package/lib/types/client.d.ts +27 -4
  60. package/lib/types/client.d.ts.map +1 -1
  61. package/lib/types/index.d.ts +3 -0
  62. package/lib/types/index.d.ts.map +1 -1
  63. package/lib/types/locale.d.ts +13 -0
  64. package/lib/types/locale.d.ts.map +1 -0
  65. package/lib/types/messages.d.ts +67 -0
  66. package/lib/types/messages.d.ts.map +1 -0
  67. package/lib/types/panel.d.ts +64 -8
  68. package/lib/types/panel.d.ts.map +1 -1
  69. package/lib/types/phone-security.d.ts +37 -0
  70. package/lib/types/phone-security.d.ts.map +1 -1
  71. package/lib/types/pin-lock.d.ts +36 -0
  72. package/lib/types/pin-lock.d.ts.map +1 -0
  73. package/lib/types/platform-models.d.ts.map +1 -1
  74. package/lib/types/preset-session.d.ts.map +1 -1
  75. package/lib/types/relay.d.ts +15 -1
  76. package/lib/types/relay.d.ts.map +1 -1
  77. package/lib/types/shared-mode.d.ts +50 -0
  78. package/lib/types/shared-mode.d.ts.map +1 -0
  79. package/lib/types/shared-owner.d.ts +42 -0
  80. package/lib/types/shared-owner.d.ts.map +1 -0
  81. package/lib/types/shared-roster.d.ts +49 -0
  82. package/lib/types/shared-roster.d.ts.map +1 -0
  83. package/lib/types/task-session.d.ts +63 -2
  84. package/lib/types/task-session.d.ts.map +1 -1
  85. package/lib/types/token-file.d.ts +11 -0
  86. package/lib/types/token-file.d.ts.map +1 -0
  87. package/lib/web/client.js +1138 -378
  88. package/package.json +8 -1
package/lib/web/client.js CHANGED
@@ -31,15 +31,12 @@ var PANEL_ID = "dsh-teamwork";
31
31
  function currentSessionTracker(list) {
32
32
  let last;
33
33
  return () => {
34
- const open = Object.values(list.getSnapshot().byId).find((s) => (s.retainedBy?.mainView ?? 0) > 0);
35
- if (open) last = open.id;
34
+ const open2 = Object.values(list.getSnapshot().byId).find((s) => (s.retainedBy?.mainView ?? 0) > 0);
35
+ if (open2) last = open2.id;
36
36
  return last;
37
37
  };
38
38
  }
39
39
 
40
- // src/web/TeamworkPanel.tsx
41
- var import_react4 = require("react");
42
-
43
40
  // ui/src/root.tsx
44
41
  var import_react = require("react");
45
42
 
@@ -49,22 +46,25 @@ var css = String.raw`
49
46
  .twui {
50
47
  --twui-font: var(--dsw-font-family, system-ui, -apple-system, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif);
51
48
  --twui-mono: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;
52
- --twui-fg: var(--dsw-alias-label-primary, #1b2033);
53
- --twui-fg-muted: var(--dsw-alias-label-secondary, #565c73);
54
- --twui-fg-subtle: var(--dsw-alias-label-tertiary, #868ba0);
55
- --twui-bg: var(--dsw-alias-bg-base, #fbfaf8);
49
+ --twui-fg: var(--dsw-alias-label-primary, #0a0a0b);
50
+ --twui-fg-muted: var(--dsw-alias-label-secondary, #5c5c66);
51
+ --twui-fg-subtle: var(--dsw-alias-label-tertiary, #8e8e98);
52
+ --twui-bg: var(--dsw-alias-bg-base, #ffffff);
56
53
  --twui-surface: var(--dsw-alias-bg-layer-1, #ffffff);
57
- --twui-surface-muted: var(--dsw-alias-bg-layer-2, #f4f3f0);
58
- --twui-hover: var(--dsw-alias-interactive-bg-hover, rgba(27, 32, 51, 0.06));
59
- --twui-border: var(--dsw-alias-border-l2, #e7e5e0);
60
- --twui-border-strong: var(--dsw-alias-border-l3, #d5d3cd);
54
+ --twui-surface-muted: var(--dsw-alias-bg-layer-2, #f7f7f8);
55
+ --twui-hover: var(--dsw-alias-interactive-bg-hover, rgba(10, 10, 11, 0.05));
56
+ --twui-border: var(--dsw-alias-border-l2, #e8e8ea);
57
+ --twui-border-strong: var(--dsw-alias-border-l3, #d9d9de);
61
58
  --twui-accent: var(--dsw-alias-state-business-primary, #1e2f6d);
62
- --twui-primary: var(--dsw-alias-button-primary-fill, #1b2033);
59
+ --twui-primary: var(--dsw-alias-button-primary-fill, #0a0a0b);
63
60
  --twui-primary-fg: var(--dsw-alias-label-primary-inverted, #ffffff);
64
- --twui-success: var(--dsw-alias-state-success-primary, #1f8a4c);
65
- --twui-warning: var(--dsw-alias-state-warn-primary, #a8650a);
66
- --twui-danger: var(--dsw-alias-state-error-primary, #c9372c);
67
- --twui-focus: var(--dsw-focus-ring-color, #6a7bd1);
61
+ --twui-success: var(--dsw-alias-state-success-primary, #15803d);
62
+ --twui-warning: var(--dsw-alias-state-warn-primary, #a16207);
63
+ --twui-danger: var(--dsw-alias-state-error-primary, #c2261d);
64
+ --twui-brand: #1e2f6d;
65
+ --twui-brand-fg: #ffffff;
66
+ --twui-signal: #e8a33d;
67
+ --twui-focus: var(--dsw-focus-ring-color, #3b4f9a);
68
68
  --twui-radius-sm: var(--dsw-radius-sm, 6px);
69
69
  --twui-radius-md: var(--dsw-radius-md, 8px);
70
70
  --twui-radius-lg: var(--dsw-radius-lg, 12px);
@@ -80,21 +80,24 @@ var css = String.raw`
80
80
  }
81
81
  @media (prefers-color-scheme: dark) {
82
82
  .twui {
83
- --twui-fg: var(--dsw-alias-label-primary, #eceef5);
84
- --twui-fg-muted: var(--dsw-alias-label-secondary, #b0b5c8);
85
- --twui-fg-subtle: var(--dsw-alias-label-tertiary, #82889f);
86
- --twui-bg: var(--dsw-alias-bg-base, #131726);
87
- --twui-surface: var(--dsw-alias-bg-layer-1, #1a1f33);
88
- --twui-surface-muted: var(--dsw-alias-bg-layer-2, #222842);
83
+ --twui-fg: var(--dsw-alias-label-primary, #f4f4f5);
84
+ --twui-fg-muted: var(--dsw-alias-label-secondary, #a1a1aa);
85
+ --twui-fg-subtle: var(--dsw-alias-label-tertiary, #71717a);
86
+ --twui-bg: var(--dsw-alias-bg-base, #0b0b0c);
87
+ --twui-surface: var(--dsw-alias-bg-layer-1, #141416);
88
+ --twui-surface-muted: var(--dsw-alias-bg-layer-2, #1d1d20);
89
89
  --twui-hover: var(--dsw-alias-interactive-bg-hover, rgba(255, 255, 255, 0.07));
90
90
  --twui-border: var(--dsw-alias-border-l2, rgba(255, 255, 255, 0.09));
91
91
  --twui-border-strong: var(--dsw-alias-border-l3, rgba(255, 255, 255, 0.15));
92
92
  --twui-accent: var(--dsw-alias-state-business-primary, #a9b6ef);
93
- --twui-primary: var(--dsw-alias-button-primary-fill, #eceef5);
94
- --twui-primary-fg: var(--dsw-alias-label-primary-inverted, #131726);
95
- --twui-success: var(--dsw-alias-state-success-primary, #4cc27f);
96
- --twui-warning: var(--dsw-alias-state-warn-primary, #e6a640);
97
- --twui-danger: var(--dsw-alias-state-error-primary, #ff7b6e);
93
+ --twui-primary: var(--dsw-alias-button-primary-fill, #f4f4f5);
94
+ --twui-primary-fg: var(--dsw-alias-label-primary-inverted, #0b0b0c);
95
+ --twui-success: var(--dsw-alias-state-success-primary, #6ee7a0);
96
+ --twui-warning: var(--dsw-alias-state-warn-primary, #f0b44c);
97
+ --twui-danger: var(--dsw-alias-state-error-primary, #f87171);
98
+ --twui-focus: var(--dsw-focus-ring-color, #9db0f0);
99
+ --twui-brand: #3b4f9a;
100
+ --twui-signal: #f0b44c;
98
101
  --twui-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
99
102
  }
100
103
  }
@@ -141,6 +144,9 @@ var css = String.raw`
141
144
  .twui-badge[data-tone="warning"] { color: var(--twui-warning); background: color-mix(in srgb, var(--twui-warning) 12%, transparent); }
142
145
  .twui-badge[data-tone="danger"] { color: var(--twui-danger); background: color-mix(in srgb, var(--twui-danger) 10%, transparent); }
143
146
  .twui-badge[data-tone="accent"] { color: var(--twui-accent); background: color-mix(in srgb, var(--twui-accent) 10%, transparent); }
147
+ .twui-badge[data-tone="brand"] { color: var(--twui-brand-fg); background: var(--twui-brand); font-weight: 600; }
148
+ /* A lone attention dot beside a label (a button, a status line). */
149
+ .twui-signal-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--twui-signal); flex: none; }
144
150
  .twui-badge-dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex: none; }
145
151
  .twui-badge[data-outline] { background: transparent; border: 1px solid var(--twui-border-strong); }
146
152
 
@@ -312,6 +318,7 @@ var css = String.raw`
312
318
  .twui-footer-identity { display: flex; align-items: center; gap: 12px; min-width: 0; }
313
319
  .twui-footer-name { font-weight: 500; }
314
320
  .twui-footer-service { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
321
+ .twui-footer-service .twui-signal-dot { display: inline-block; margin-right: 6px; vertical-align: 1px; }
315
322
  .twui-footer-actions { margin-left: auto; gap: 4px; }
316
323
  .twui-footer-actions .twui-badge { background: transparent; font-size: 11px; height: 20px; padding: 0 4px; }
317
324
  .twui-footer-actions .twui-btn { font-size: 11px; height: 24px; padding-inline: 6px; }
@@ -325,10 +332,15 @@ var css = String.raw`
325
332
  .twui-resource-toolbar .twui-tab[aria-selected="true"] { background: var(--twui-fill); }
326
333
  .twui-resource-list .twui-item { border: 0; border-bottom: 1px solid var(--twui-border); border-radius: 0; box-shadow: none; background: transparent; }
327
334
  .twui-resource-list .twui-item-main { padding: 24px 2px; align-items: center; }
328
- .twui-resource-list .twui-tile { width: 42px; height: 42px; color: var(--twui-accent); align-self: start; }
335
+ .twui-resource-list .twui-tile { width: 42px; height: 42px; color: var(--twui-fg-muted); align-self: start; }
329
336
  .twui-resource-list .twui-item-subtitle { font: inherit; font-size: 11px; padding: 1px 6px; border-radius: 4px; background: var(--twui-fill); color: var(--twui-fg-muted); }
330
337
  .twui-resource-list .twui-item-tags { margin-top: 8px; }
331
338
  .twui-resource-list .twui-item-title { font-size: 15px; font-weight: 500; }
339
+ /* The one entry a screen leads with (the team assistant): a strong border, and the team's navy as a bar and on its tile. */
340
+ .twui-featured .twui-item { border-color: var(--twui-border-strong); box-shadow: inset 3px 0 0 var(--twui-brand); }
341
+ .twui-featured .twui-item-main { padding: 20px 20px 20px 23px; }
342
+ .twui-featured .twui-tile { background: var(--twui-brand); color: var(--twui-brand-fg); }
343
+ .twui-featured .twui-item-desc { max-width: 68ch; }
332
344
  .twui-account-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 48px; margin-top: 12px; align-items: start; }
333
345
  .twui-account-grid > section { gap: 20px; min-width: 0; }
334
346
  .twui-account-grid h3 { font-size: 15px; font-weight: 500; }
@@ -373,9 +385,15 @@ function join(...names) {
373
385
 
374
386
  // ui/src/brand.tsx
375
387
  var import_jsx_runtime2 = require("react/jsx-runtime");
376
- var MARK = "M206.84 178.37L203.20 176.51L197.50 174.07L191.54 172.04L185.35 170.41L178.93 169.17L172.31 168.32L165.50 167.86L158.53 167.77L151.41 168.06L144.16 168.72L136.80 169.75L129.35 171.13L121.82 172.87L114.23 174.96L109.15 176.54L98.77 180.09L95.30 181.17L90.18 182.60L86.83 183.42L81.88 184.48L77.03 185.31L72.29 185.93L67.65 186.34L61.63 186.57L57.23 186.50L51.52 186.10L47.35 185.57L41.96 184.58L36.75 183.26L31.71 181.62L34.49 185.76L37.47 189.81L40.64 193.76L44.00 197.60L47.54 201.33L51.26 204.95L55.15 208.44L59.21 211.81L63.44 215.04L67.84 218.14L72.39 221.10L77.09 223.91L81.95 226.57L86.95 229.08L94.72 232.53L102.79 235.59L111.15 238.26L119.80 240.51L125.70 241.78L134.78 243.30L140.96 244.06L144.09 244.36L173.55 246.46L180.99 247.20L187.94 248.12L194.39 249.29L200.32 250.79L203.07 251.68L205.68 252.68L209.32 254.39L212.63 256.39L215.59 258.72L218.18 261.38L219.71 263.37L223.20 305.34L228.75 306.83L233.12 307.74L237.50 308.33L241.25 308.55L245.00 308.50L249.38 308.10L253.75 307.35L258.75 306.16L268.56 303.21L246.40 256.22L246.73 253.74L247.28 251.31L248.06 248.95L249.61 245.50L250.90 243.25L252.39 241.04L254.06 238.85L255.91 236.70L257.94 234.56L260.13 232.43L264.98 228.19L270.41 223.93L277.92 218.50L302.38 201.94L304.94 200.12L309.92 196.37L317.01 190.52L321.49 186.47L327.85 180.20L333.75 173.71L339.20 167.02L344.20 160.15L347.28 155.48L350.15 150.75L352.81 145.96L355.27 141.12L357.52 136.24L359.57 131.33L361.40 126.38L363.02 121.41L364.43 116.42L365.63 111.42L366.61 106.41L367.38 101.41L367.94 96.41L368.27 91.43L364.74 95.37L360.88 99.12L356.71 102.68L353.38 105.22L348.64 108.41L344.87 110.67L339.54 113.49L335.33 115.45L330.91 117.29L326.31 118.98L321.50 120.54L318.18 121.50L313.04 122.82L309.49 123.63L298.73 125.74L293.54 126.91L285.93 128.90L278.54 131.16L271.39 133.69L264.50 136.48L257.89 139.53L253.65 141.71L249.55 144.00L245.59 146.40L239.93 150.20L236.35 152.87L232.93 155.65L228.12 160.01L225.13 163.04L222.32 166.18L218.46 171.06L215.04 176.17L212.07 181.49ZM0.00 299.31L6.29 300.81L19.95 304.97L27.09 306.81L30.85 307.55L34.71 308.11L38.64 308.45L42.44 308.56L45.78 308.48L49.55 308.17L52.80 307.74L56.57 307.06L60.13 306.25L63.75 305.29L76.43 301.42L80.87 300.19L85.96 299.11L90.20 298.63L92.48 298.57L95.22 298.67L97.56 298.92L100.48 299.40L106.29 300.81L119.95 304.97L126.98 306.78L130.85 307.55L134.55 308.09L137.85 308.40L141.64 308.56L145.61 308.49L149.55 308.17L153.42 307.64L157.20 306.93L160.85 306.07L164.44 305.10L179.80 300.47L183.48 299.58L186.92 298.96L190.65 298.61L194.30 298.61L198.04 298.98L202.57 299.84L194.87 271.11L192.61 271.07L189.26 271.14L185.49 271.44L182.24 271.86L178.58 272.51L174.89 273.34L171.27 274.29L157.98 278.34L153.04 279.67L149.99 280.33L147.56 280.72L144.76 280.99L142.48 281.06L140.20 281.00L137.40 280.73L134.98 280.35L131.93 279.70L127.00 278.38L113.68 274.32L109.51 273.23L105.83 272.42L102.03 271.77L98.93 271.39L95.61 271.14L92.44 271.07L88.64 271.18L84.71 271.52L80.85 272.08L77.09 272.82L69.95 274.66L55.73 278.98L49.99 280.33L47.09 280.78L44.76 280.99L42.48 281.06L39.73 280.97L35.96 280.52L31.93 279.70L27.57 278.54L16.42 275.11L10.94 273.58L5.08 272.28L0.00 271.51ZM284.83 299.31L289.73 298.66L292.48 298.57L295.69 298.71L299.01 299.13L302.00 299.72L305.73 300.65L319.95 304.97L327.09 306.81L330.85 307.55L334.71 308.11L338.64 308.45L342.44 308.56L345.78 308.48L349.71 308.16L353.42 307.64L357.31 306.90L364.44 305.10L379.25 300.61L382.97 299.69L385.96 299.11L389.73 298.66L392.93 298.57L396.15 298.75L400.00 299.31L400.00 271.51L395.61 271.14L390.85 271.08L386.27 271.36L381.47 271.98L377.09 272.82L372.66 273.91L367.92 275.26L357.41 278.50L352.52 279.80L347.56 280.72L345.22 280.96L342.93 281.06L340.65 281.02L338.34 280.84L335.96 280.52L332.97 279.94L327.57 278.54L316.46 275.13L311.57 273.75L306.45 272.55L301.11 271.64L297.98 271.30L294.99 271.12L289.43 271.13L283.78 271.64L277.70 272.69Z";
388
+ var BRAND_FLUKE = "M185.89 163.76C162.65 148.53 128.19 148.57 93.22 161.01C68.77 169.86 48.13 170.02 31.16 163.85C49.59 192.62 84.41 213.93 127.56 217.69C158.83 220.04 182.52 219.82 192.45 234.01L198.98 312.7L249.02 299.3L215.33 227.88C216.83 210.63 237.46 198.97 263.37 181.3C298.85 156.47 318.35 120.6 319.93 86.47C308.32 100.31 290.36 110.48 264.77 115.04C228.26 121.76 198.39 138.96 185.89 163.76Z";
389
+ var BRAND_SURFACE = "M-6.66 286.12L-4.69 285.14L-2.69 284.13L-0.66 283.12L1.41 282.11L3.52 281.13L5.66 280.19L7.83 279.31L10.05 278.49L12.3 277.77L14.59 277.16L16.91 276.66L19.26 276.3L21.62 276.07L24 276L26.38 276.07L28.74 276.3L31.09 276.66L33.41 277.16L35.7 277.77L37.95 278.49L40.17 279.31L42.34 280.19L44.48 281.13L46.59 282.11L48.66 283.12L50.69 284.13L52.69 285.14L54.66 286.12L56.59 287.06L58.48 287.94L60.34 288.76L62.17 289.5L63.95 290.16L65.7 290.72L67.41 291.18L69.09 291.54L70.74 291.8L72.38 291.95L74 292L75.62 291.95L77.26 291.8L78.91 291.54L80.59 291.18L82.3 290.72L84.05 290.16L85.83 289.5L87.66 288.76L89.52 287.94L91.41 287.06L93.34 286.12L95.31 285.14L97.31 284.13L99.34 283.12L101.41 282.11L103.52 281.13L105.66 280.19L107.83 279.31L110.05 278.49L112.3 277.77L114.59 277.16L116.91 276.66L119.26 276.3L121.62 276.07L124 276L126.38 276.07L128.74 276.3L131.09 276.66L133.41 277.16L135.7 277.77L137.95 278.49L140.17 279.31L142.34 280.19L144.48 281.13L146.59 282.11L148.66 283.12L150.69 284.13L152.69 285.14L154.66 286.12L156.59 287.06L158.48 287.94L160.34 288.76L162.17 289.5L163.95 290.16L165.7 290.72L167.41 291.18L169.09 291.54L170.74 291.8L172.38 291.95L174 292L175.62 291.95L177.26 291.8L178.91 291.54L180.59 291.18L182.3 290.72L184.05 290.16L185.83 289.5L187.66 288.76L189.52 287.94L191.41 287.06L193.34 286.12L195.31 285.14L197.31 284.13L199.34 283.12L201.41 282.11L203.52 281.13L205.66 280.19L207.83 279.31L210.05 278.49L212.3 277.77L214.59 277.16L216.91 276.66L219.26 276.3L221.62 276.07L224 276L226.38 276.07L228.74 276.3L231.09 276.66L233.41 277.16L235.7 277.77L237.95 278.49L240.17 279.31L242.34 280.19L244.48 281.13L246.59 282.11L248.66 283.12L250.69 284.13L252.69 285.14L254.66 286.12L256.59 287.06L258.48 287.94L260.34 288.76L262.17 289.5L263.95 290.16L265.7 290.72L267.41 291.18L269.09 291.54L270.74 291.8L272.38 291.95L274 292L275.62 291.95L277.26 291.8L278.91 291.54L280.59 291.18L282.3 290.72L284.05 290.16L285.83 289.5L287.66 288.76L289.52 287.94L291.41 287.06L293.34 286.12L295.31 285.14L297.31 284.13L299.34 283.12L301.41 282.11L303.52 281.13L305.66 280.19L307.83 279.31L310.05 278.49L312.3 277.77L314.59 277.16L316.91 276.66L319.26 276.3L321.62 276.07L324 276L326.38 276.07L328.74 276.3L331.09 276.66L333.41 277.16L335.7 277.77L337.95 278.49L340.17 279.31L342.34 280.19L344.48 281.13L346.59 282.11L348.66 283.12L350.69 284.13L352.69 285.14L354.66 286.12L356.59 287.06L358.48 287.94L360.34 288.76L362.17 289.5L363.95 290.16L365.7 290.72L367.41 291.18L369.09 291.54L370.74 291.8L372.38 291.95L374 292L375.62 291.95L377.26 291.8L378.91 291.54L380.59 291.18L382.3 290.72L384.05 290.16L385.83 289.5L387.66 288.76L389.52 287.94L391.41 287.06L393.34 286.12L395.31 285.14L397.31 284.13L399.34 283.12L401.41 282.11L406.59 292.94L404.66 293.88L402.69 294.86L400.69 295.87L398.66 296.88L396.59 297.89L394.48 298.87L392.34 299.81L390.17 300.69L387.95 301.51L385.7 302.23L383.41 302.84L381.09 303.34L378.74 303.7L376.38 303.93L374 304L371.62 303.93L369.26 303.7L366.91 303.34L364.59 302.84L362.3 302.23L360.05 301.51L357.83 300.69L355.66 299.81L353.52 298.87L351.41 297.89L349.34 296.88L347.31 295.87L345.31 294.86L343.34 293.88L341.41 292.94L339.52 292.06L337.66 291.24L335.83 290.5L334.05 289.84L332.3 289.28L330.59 288.82L328.91 288.46L327.26 288.2L325.62 288.05L324 288L322.38 288.05L320.74 288.2L319.09 288.46L317.41 288.82L315.7 289.28L313.95 289.84L312.17 290.5L310.34 291.24L308.48 292.06L306.59 292.94L304.66 293.88L302.69 294.86L300.69 295.87L298.66 296.88L296.59 297.89L294.48 298.87L292.34 299.81L290.17 300.69L287.95 301.51L285.7 302.23L283.41 302.84L281.09 303.34L278.74 303.7L276.38 303.93L274 304L271.62 303.93L269.26 303.7L266.91 303.34L264.59 302.84L262.3 302.23L260.05 301.51L257.83 300.69L255.66 299.81L253.52 298.87L251.41 297.89L249.34 296.88L247.31 295.87L245.31 294.86L243.34 293.88L241.41 292.94L239.52 292.06L237.66 291.24L235.83 290.5L234.05 289.84L232.3 289.28L230.59 288.82L228.91 288.46L227.26 288.2L225.62 288.05L224 288L222.38 288.05L220.74 288.2L219.09 288.46L217.41 288.82L215.7 289.28L213.95 289.84L212.17 290.5L210.34 291.24L208.48 292.06L206.59 292.94L204.66 293.88L202.69 294.86L200.69 295.87L198.66 296.88L196.59 297.89L194.48 298.87L192.34 299.81L190.17 300.69L187.95 301.51L185.7 302.23L183.41 302.84L181.09 303.34L178.74 303.7L176.38 303.93L174 304L171.62 303.93L169.26 303.7L166.91 303.34L164.59 302.84L162.3 302.23L160.05 301.51L157.83 300.69L155.66 299.81L153.52 298.87L151.41 297.89L149.34 296.88L147.31 295.87L145.31 294.86L143.34 293.88L141.41 292.94L139.52 292.06L137.66 291.24L135.83 290.5L134.05 289.84L132.3 289.28L130.59 288.82L128.91 288.46L127.26 288.2L125.62 288.05L124 288L122.38 288.05L120.74 288.2L119.09 288.46L117.41 288.82L115.7 289.28L113.95 289.84L112.17 290.5L110.34 291.24L108.48 292.06L106.59 292.94L104.66 293.88L102.69 294.86L100.69 295.87L98.66 296.88L96.59 297.89L94.48 298.87L92.34 299.81L90.17 300.69L87.95 301.51L85.7 302.23L83.41 302.84L81.09 303.34L78.74 303.7L76.38 303.93L74 304L71.62 303.93L69.26 303.7L66.91 303.34L64.59 302.84L62.3 302.23L60.05 301.51L57.83 300.69L55.66 299.81L53.52 298.87L51.41 297.89L49.34 296.88L47.31 295.87L45.31 294.86L43.34 293.88L41.41 292.94L39.52 292.06L37.66 291.24L35.83 290.5L34.05 289.84L32.3 289.28L30.59 288.82L28.91 288.46L27.26 288.2L25.62 288.05L24 288L22.38 288.05L20.74 288.2L19.09 288.46L17.41 288.82L15.7 289.28L13.95 289.84L12.17 290.5L10.34 291.24L8.48 292.06L6.59 292.94L4.66 293.88L2.69 294.86L0.69 295.87L-1.34 296.88Z";
390
+ var BRAND_SWELL = "M-5.18 331.11L-3.2 330.5L-1.2 329.87L0.82 329.24L2.85 328.62L4.91 328.02L6.97 327.45L9.06 326.93L11.16 326.44L13.27 326.02L15.4 325.66L17.54 325.38L19.69 325.17L21.84 325.04L24 325L26.16 325.04L28.31 325.17L30.46 325.38L32.6 325.66L34.73 326.02L36.84 326.44L38.94 326.93L41.03 327.45L43.09 328.02L45.15 328.62L47.18 329.24L49.2 329.87L51.2 330.5L53.18 331.11L55.15 331.71L57.09 332.28L59.03 332.81L60.94 333.3L62.84 333.73L64.73 334.11L66.6 334.43L68.46 334.68L70.31 334.86L72.16 334.96L74 335L75.84 334.96L77.69 334.86L79.54 334.68L81.4 334.43L83.27 334.11L85.16 333.73L87.06 333.3L88.97 332.81L90.91 332.28L92.85 331.71L94.82 331.11L96.8 330.5L98.8 329.87L100.82 329.24L102.85 328.62L104.91 328.02L106.97 327.45L109.06 326.93L111.16 326.44L113.27 326.02L115.4 325.66L117.54 325.38L119.69 325.17L121.84 325.04L124 325L126.16 325.04L128.31 325.17L130.46 325.38L132.6 325.66L134.73 326.02L136.84 326.44L138.94 326.93L141.03 327.45L143.09 328.02L145.15 328.62L147.18 329.24L149.2 329.87L151.2 330.5L153.18 331.11L155.15 331.71L157.09 332.28L159.03 332.81L160.94 333.3L162.84 333.73L164.73 334.11L166.6 334.43L168.46 334.68L170.31 334.86L172.16 334.96L174 335L175.84 334.96L177.69 334.86L179.54 334.68L181.4 334.43L183.27 334.11L185.16 333.73L187.06 333.3L188.97 332.81L190.91 332.28L192.85 331.71L194.82 331.11L196.8 330.5L198.8 329.87L200.82 329.24L202.85 328.62L204.91 328.02L206.97 327.45L209.06 326.93L211.16 326.44L213.27 326.02L215.4 325.66L217.54 325.38L219.69 325.17L221.84 325.04L224 325L226.16 325.04L228.31 325.17L230.46 325.38L232.6 325.66L234.73 326.02L236.84 326.44L238.94 326.93L241.03 327.45L243.09 328.02L245.15 328.62L247.18 329.24L249.2 329.87L251.2 330.5L253.18 331.11L255.15 331.71L257.09 332.28L259.03 332.81L260.94 333.3L262.84 333.73L264.73 334.11L266.6 334.43L268.46 334.68L270.31 334.86L272.16 334.96L274 335L275.84 334.96L277.69 334.86L279.54 334.68L281.4 334.43L283.27 334.11L285.16 333.73L287.06 333.3L288.97 332.81L290.91 332.28L292.85 331.71L294.82 331.11L296.8 330.5L298.8 329.87L300.82 329.24L302.85 328.62L304.91 328.02L306.97 327.45L309.06 326.93L311.16 326.44L313.27 326.02L315.4 325.66L317.54 325.38L319.69 325.17L321.84 325.04L324 325L326.16 325.04L328.31 325.17L330.46 325.38L332.6 325.66L334.73 326.02L336.84 326.44L338.94 326.93L341.03 327.45L343.09 328.02L345.15 328.62L347.18 329.24L349.2 329.87L351.2 330.5L353.18 331.11L355.15 331.71L357.09 332.28L359.03 332.81L360.94 333.3L362.84 333.73L364.73 334.11L366.6 334.43L368.46 334.68L370.31 334.86L372.16 334.96L374 335L375.84 334.96L377.69 334.86L379.54 334.68L381.4 334.43L383.27 334.11L385.16 333.73L387.06 333.3L388.97 332.81L390.91 332.28L392.85 331.71L394.82 331.11L396.8 330.5L398.8 329.87L400.82 329.24L402.85 328.62L405.15 336.29L403.18 336.89L401.2 337.5L399.2 338.13L397.18 338.76L395.15 339.38L393.09 339.98L391.03 340.55L388.94 341.07L386.84 341.56L384.73 341.98L382.6 342.34L380.46 342.62L378.31 342.83L376.16 342.96L374 343L371.84 342.96L369.69 342.83L367.54 342.62L365.4 342.34L363.27 341.98L361.16 341.56L359.06 341.07L356.97 340.55L354.91 339.98L352.85 339.38L350.82 338.76L348.8 338.13L346.8 337.5L344.82 336.89L342.85 336.29L340.91 335.72L338.97 335.19L337.06 334.7L335.16 334.27L333.27 333.89L331.4 333.57L329.54 333.32L327.69 333.14L325.84 333.04L324 333L322.16 333.04L320.31 333.14L318.46 333.32L316.6 333.57L314.73 333.89L312.84 334.27L310.94 334.7L309.03 335.19L307.09 335.72L305.15 336.29L303.18 336.89L301.2 337.5L299.2 338.13L297.18 338.76L295.15 339.38L293.09 339.98L291.03 340.55L288.94 341.07L286.84 341.56L284.73 341.98L282.6 342.34L280.46 342.62L278.31 342.83L276.16 342.96L274 343L271.84 342.96L269.69 342.83L267.54 342.62L265.4 342.34L263.27 341.98L261.16 341.56L259.06 341.07L256.97 340.55L254.91 339.98L252.85 339.38L250.82 338.76L248.8 338.13L246.8 337.5L244.82 336.89L242.85 336.29L240.91 335.72L238.97 335.19L237.06 334.7L235.16 334.27L233.27 333.89L231.4 333.57L229.54 333.32L227.69 333.14L225.84 333.04L224 333L222.16 333.04L220.31 333.14L218.46 333.32L216.6 333.57L214.73 333.89L212.84 334.27L210.94 334.7L209.03 335.19L207.09 335.72L205.15 336.29L203.18 336.89L201.2 337.5L199.2 338.13L197.18 338.76L195.15 339.38L193.09 339.98L191.03 340.55L188.94 341.07L186.84 341.56L184.73 341.98L182.6 342.34L180.46 342.62L178.31 342.83L176.16 342.96L174 343L171.84 342.96L169.69 342.83L167.54 342.62L165.4 342.34L163.27 341.98L161.16 341.56L159.06 341.07L156.97 340.55L154.91 339.98L152.85 339.38L150.82 338.76L148.8 338.13L146.8 337.5L144.82 336.89L142.85 336.29L140.91 335.72L138.97 335.19L137.06 334.7L135.16 334.27L133.27 333.89L131.4 333.57L129.54 333.32L127.69 333.14L125.84 333.04L124 333L122.16 333.04L120.31 333.14L118.46 333.32L116.6 333.57L114.73 333.89L112.84 334.27L110.94 334.7L109.03 335.19L107.09 335.72L105.15 336.29L103.18 336.89L101.2 337.5L99.2 338.13L97.18 338.76L95.15 339.38L93.09 339.98L91.03 340.55L88.94 341.07L86.84 341.56L84.73 341.98L82.6 342.34L80.46 342.62L78.31 342.83L76.16 342.96L74 343L71.84 342.96L69.69 342.83L67.54 342.62L65.4 342.34L63.27 341.98L61.16 341.56L59.06 341.07L56.97 340.55L54.91 339.98L52.85 339.38L50.82 338.76L48.8 338.13L46.8 337.5L44.82 336.89L42.85 336.29L40.91 335.72L38.97 335.19L37.06 334.7L35.16 334.27L33.27 333.89L31.4 333.57L29.54 333.32L27.69 333.14L25.84 333.04L24 333L22.16 333.04L20.31 333.14L18.46 333.32L16.6 333.57L14.73 333.89L12.84 334.27L10.94 334.7L9.03 335.19L7.09 335.72L5.15 336.29L3.18 336.89L1.2 337.5L-0.8 338.13L-2.82 338.76ZM-4.63 367.72L-2.64 367.29L-0.64 366.85L1.37 366.41L3.39 365.98L5.41 365.57L7.45 365.18L9.5 364.81L11.55 364.48L13.62 364.19L15.68 363.95L17.76 363.76L19.84 363.61L21.92 363.53L24 363.5L26.08 363.53L28.16 363.61L30.24 363.76L32.32 363.95L34.38 364.19L36.45 364.48L38.5 364.81L40.55 365.18L42.59 365.57L44.61 365.98L46.63 366.41L48.64 366.85L50.64 367.29L52.63 367.72L54.61 368.15L56.59 368.55L58.55 368.93L60.5 369.27L62.45 369.58L64.38 369.86L66.32 370.08L68.24 370.26L70.16 370.39L72.08 370.47L74 370.5L75.92 370.47L77.84 370.39L79.76 370.26L81.68 370.08L83.62 369.86L85.55 369.58L87.5 369.27L89.45 368.93L91.41 368.55L93.39 368.15L95.37 367.72L97.36 367.29L99.36 366.85L101.37 366.41L103.39 365.98L105.41 365.57L107.45 365.18L109.5 364.81L111.55 364.48L113.62 364.19L115.68 363.95L117.76 363.76L119.84 363.61L121.92 363.53L124 363.5L126.08 363.53L128.16 363.61L130.24 363.76L132.32 363.95L134.38 364.19L136.45 364.48L138.5 364.81L140.55 365.18L142.59 365.57L144.61 365.98L146.63 366.41L148.64 366.85L150.64 367.29L152.63 367.72L154.61 368.15L156.59 368.55L158.55 368.93L160.5 369.27L162.45 369.58L164.38 369.86L166.32 370.08L168.24 370.26L170.16 370.39L172.08 370.47L174 370.5L175.92 370.47L177.84 370.39L179.76 370.26L181.68 370.08L183.62 369.86L185.55 369.58L187.5 369.27L189.45 368.93L191.41 368.55L193.39 368.15L195.37 367.72L197.36 367.29L199.36 366.85L201.37 366.41L203.39 365.98L205.41 365.57L207.45 365.18L209.5 364.81L211.55 364.48L213.62 364.19L215.68 363.95L217.76 363.76L219.84 363.61L221.92 363.53L224 363.5L226.08 363.53L228.16 363.61L230.24 363.76L232.32 363.95L234.38 364.19L236.45 364.48L238.5 364.81L240.55 365.18L242.59 365.57L244.61 365.98L246.63 366.41L248.64 366.85L250.64 367.29L252.63 367.72L254.61 368.15L256.59 368.55L258.55 368.93L260.5 369.27L262.45 369.58L264.38 369.86L266.32 370.08L268.24 370.26L270.16 370.39L272.08 370.47L274 370.5L275.92 370.47L277.84 370.39L279.76 370.26L281.68 370.08L283.62 369.86L285.55 369.58L287.5 369.27L289.45 368.93L291.41 368.55L293.39 368.15L295.37 367.72L297.36 367.29L299.36 366.85L301.37 366.41L303.39 365.98L305.41 365.57L307.45 365.18L309.5 364.81L311.55 364.48L313.62 364.19L315.68 363.95L317.76 363.76L319.84 363.61L321.92 363.53L324 363.5L326.08 363.53L328.16 363.61L330.24 363.76L332.32 363.95L334.38 364.19L336.45 364.48L338.5 364.81L340.55 365.18L342.59 365.57L344.61 365.98L346.63 366.41L348.64 366.85L350.64 367.29L352.63 367.72L354.61 368.15L356.59 368.55L358.55 368.93L360.5 369.27L362.45 369.58L364.38 369.86L366.32 370.08L368.24 370.26L370.16 370.39L372.08 370.47L374 370.5L375.92 370.47L377.84 370.39L379.76 370.26L381.68 370.08L383.62 369.86L385.55 369.58L387.5 369.27L389.45 368.93L391.41 368.55L393.39 368.15L395.37 367.72L397.36 367.29L399.36 366.85L401.37 366.41L403.39 365.98L404.61 371.85L402.63 372.28L400.64 372.71L398.64 373.15L396.63 373.59L394.61 374.02L392.59 374.43L390.55 374.82L388.5 375.19L386.45 375.52L384.38 375.81L382.32 376.05L380.24 376.24L378.16 376.39L376.08 376.47L374 376.5L371.92 376.47L369.84 376.39L367.76 376.24L365.68 376.05L363.62 375.81L361.55 375.52L359.5 375.19L357.45 374.82L355.41 374.43L353.39 374.02L351.37 373.59L349.36 373.15L347.36 372.71L345.37 372.28L343.39 371.85L341.41 371.45L339.45 371.07L337.5 370.73L335.55 370.42L333.62 370.14L331.68 369.92L329.76 369.74L327.84 369.61L325.92 369.53L324 369.5L322.08 369.53L320.16 369.61L318.24 369.74L316.32 369.92L314.38 370.14L312.45 370.42L310.5 370.73L308.55 371.07L306.59 371.45L304.61 371.85L302.63 372.28L300.64 372.71L298.64 373.15L296.63 373.59L294.61 374.02L292.59 374.43L290.55 374.82L288.5 375.19L286.45 375.52L284.38 375.81L282.32 376.05L280.24 376.24L278.16 376.39L276.08 376.47L274 376.5L271.92 376.47L269.84 376.39L267.76 376.24L265.68 376.05L263.62 375.81L261.55 375.52L259.5 375.19L257.45 374.82L255.41 374.43L253.39 374.02L251.37 373.59L249.36 373.15L247.36 372.71L245.37 372.28L243.39 371.85L241.41 371.45L239.45 371.07L237.5 370.73L235.55 370.42L233.62 370.14L231.68 369.92L229.76 369.74L227.84 369.61L225.92 369.53L224 369.5L222.08 369.53L220.16 369.61L218.24 369.74L216.32 369.92L214.38 370.14L212.45 370.42L210.5 370.73L208.55 371.07L206.59 371.45L204.61 371.85L202.63 372.28L200.64 372.71L198.64 373.15L196.63 373.59L194.61 374.02L192.59 374.43L190.55 374.82L188.5 375.19L186.45 375.52L184.38 375.81L182.32 376.05L180.24 376.24L178.16 376.39L176.08 376.47L174 376.5L171.92 376.47L169.84 376.39L167.76 376.24L165.68 376.05L163.62 375.81L161.55 375.52L159.5 375.19L157.45 374.82L155.41 374.43L153.39 374.02L151.37 373.59L149.36 373.15L147.36 372.71L145.37 372.28L143.39 371.85L141.41 371.45L139.45 371.07L137.5 370.73L135.55 370.42L133.62 370.14L131.68 369.92L129.76 369.74L127.84 369.61L125.92 369.53L124 369.5L122.08 369.53L120.16 369.61L118.24 369.74L116.32 369.92L114.38 370.14L112.45 370.42L110.5 370.73L108.55 371.07L106.59 371.45L104.61 371.85L102.63 372.28L100.64 372.71L98.64 373.15L96.63 373.59L94.61 374.02L92.59 374.43L90.55 374.82L88.5 375.19L86.45 375.52L84.38 375.81L82.32 376.05L80.24 376.24L78.16 376.39L76.08 376.47L74 376.5L71.92 376.47L69.84 376.39L67.76 376.24L65.68 376.05L63.62 375.81L61.55 375.52L59.5 375.19L57.45 374.82L55.41 374.43L53.39 374.02L51.37 373.59L49.36 373.15L47.36 372.71L45.37 372.28L43.39 371.85L41.41 371.45L39.45 371.07L37.5 370.73L35.55 370.42L33.62 370.14L31.68 369.92L29.76 369.74L27.84 369.61L25.92 369.53L24 369.5L22.08 369.53L20.16 369.61L18.24 369.74L16.32 369.92L14.38 370.14L12.45 370.42L10.5 370.73L8.55 371.07L6.59 371.45L4.61 371.85L2.63 372.28L0.64 372.71L-1.36 373.15L-3.37 373.59Z";
391
+ var SEA = "M-4 291.5L-2 290.5L0 289.5L2 288.5L4 287.53L6 286.59L8 285.71L10 284.9L12 284.17L14 283.53L16 282.99L18 282.56L20 282.25L22 282.06L24 282L26 282.06L28 282.25L30 282.56L32 282.99L34 283.53L36 284.17L38 284.9L40 285.71L42 286.59L44 287.53L46 288.5L48 289.5L50 290.5L52 291.5L54 292.47L56 293.41L58 294.29L60 295.1L62 295.83L64 296.47L66 297.01L68 297.44L70 297.75L72 297.94L74 298L76 297.94L78 297.75L80 297.44L82 297.01L84 296.47L86 295.83L88 295.1L90 294.29L92 293.41L94 292.47L96 291.5L98 290.5L100 289.5L102 288.5L104 287.53L106 286.59L108 285.71L110 284.9L112 284.17L114 283.53L116 282.99L118 282.56L120 282.25L122 282.06L124 282L126 282.06L128 282.25L130 282.56L132 282.99L134 283.53L136 284.17L138 284.9L140 285.71L142 286.59L144 287.53L146 288.5L148 289.5L150 290.5L152 291.5L154 292.47L156 293.41L158 294.29L160 295.1L162 295.83L164 296.47L166 297.01L168 297.44L170 297.75L172 297.94L174 298L176 297.94L178 297.75L180 297.44L182 297.01L184 296.47L186 295.83L188 295.1L190 294.29L192 293.41L194 292.47L196 291.5L198 290.5L200 289.5L202 288.5L204 287.53L206 286.59L208 285.71L210 284.9L212 284.17L214 283.53L216 282.99L218 282.56L220 282.25L222 282.06L224 282L226 282.06L228 282.25L230 282.56L232 282.99L234 283.53L236 284.17L238 284.9L240 285.71L242 286.59L244 287.53L246 288.5L248 289.5L250 290.5L252 291.5L254 292.47L256 293.41L258 294.29L260 295.1L262 295.83L264 296.47L266 297.01L268 297.44L270 297.75L272 297.94L274 298L276 297.94L278 297.75L280 297.44L282 297.01L284 296.47L286 295.83L288 295.1L290 294.29L292 293.41L294 292.47L296 291.5L298 290.5L300 289.5L302 288.5L304 287.53L306 286.59L308 285.71L310 284.9L312 284.17L314 283.53L316 282.99L318 282.56L320 282.25L322 282.06L324 282L326 282.06L328 282.25L330 282.56L332 282.99L334 283.53L336 284.17L338 284.9L340 285.71L342 286.59L344 287.53L346 288.5L348 289.5L350 290.5L352 291.5L354 292.47L356 293.41L358 294.29L360 295.1L362 295.83L364 296.47L366 297.01L368 297.44L370 297.75L372 297.94L374 298L376 297.94L378 297.75L380 297.44L382 297.01L384 296.47L386 295.83L388 295.1L390 294.29L392 293.41L394 292.47L396 291.5L398 290.5L400 289.5L402 288.5L404 287.53L404 404L-4 404Z";
377
392
  var BRAND_INDIGO = "#1E2F6D";
378
393
  var BRAND_PAPER = "#F8F5EF";
394
+ var SEA_DEEP = "#111A42";
395
+ var SEA_SURFACE = "#7B91D4";
396
+ var SEA_SWELL = "#2B3F86";
379
397
  function BrandMark({ size = 32, title }) {
380
398
  return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(
381
399
  "svg",
@@ -390,7 +408,10 @@ function BrandMark({ size = 32, title }) {
390
408
  children: [
391
409
  title && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("title", { children: title }),
392
410
  /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("rect", { width: "400", height: "400", fill: BRAND_INDIGO }),
393
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("path", { fill: BRAND_PAPER, d: MARK })
411
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("path", { fill: BRAND_PAPER, d: BRAND_FLUKE }),
412
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("path", { fill: SEA_DEEP, d: SEA }),
413
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("path", { fill: SEA_SURFACE, d: BRAND_SURFACE }),
414
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("path", { fill: SEA_SWELL, d: BRAND_SWELL })
394
415
  ]
395
416
  }
396
417
  );
@@ -604,7 +625,7 @@ function Select({ id, label, value, options, onChange, onActivate, disabled = fa
604
625
  const root = (0, import_react3.useRef)(null);
605
626
  const trigger = (0, import_react3.useRef)(null);
606
627
  const list = (0, import_react3.useRef)(null);
607
- const [open, setOpen] = (0, import_react3.useState)(false);
628
+ const [open2, setOpen] = (0, import_react3.useState)(false);
608
629
  const [active, setActive] = (0, import_react3.useState)(0);
609
630
  const [side, setSide] = (0, import_react3.useState)("bottom");
610
631
  const [height, setHeight] = (0, import_react3.useState)(288);
@@ -631,7 +652,7 @@ function Select({ id, label, value, options, onChange, onActivate, disabled = fa
631
652
  setOpen(true);
632
653
  };
633
654
  (0, import_react3.useEffect)(() => {
634
- if (!open) return;
655
+ if (!open2) return;
635
656
  const rect = root.current?.getBoundingClientRect();
636
657
  if (rect) {
637
658
  const below = window.innerHeight - rect.bottom, above = rect.top;
@@ -645,19 +666,19 @@ function Select({ id, label, value, options, onChange, onActivate, disabled = fa
645
666
  };
646
667
  document.addEventListener("pointerdown", outside);
647
668
  return () => document.removeEventListener("pointerdown", outside);
648
- }, [open]);
669
+ }, [open2]);
649
670
  (0, import_react3.useEffect)(() => {
650
- if (open) list.current?.querySelector(`[data-index="${active}"]`)?.scrollIntoView?.({ block: "nearest" });
651
- }, [active, open]);
671
+ if (open2) list.current?.querySelector(`[data-index="${active}"]`)?.scrollIntoView?.({ block: "nearest" });
672
+ }, [active, open2]);
652
673
  (0, import_react3.useEffect)(() => {
653
674
  if (disabled) setOpen(false);
654
675
  }, [disabled]);
655
676
  (0, import_react3.useEffect)(() => {
656
- if (!open || options[active] && !options[active].disabled) return;
677
+ if (!open2 || options[active] && !options[active].disabled) return;
657
678
  const next = selected >= 0 && !options[selected].disabled ? selected : options.findIndex((o) => !o.disabled);
658
679
  if (next < 0) close(true);
659
680
  else setActive(next);
660
- }, [options, selected, active, open]);
681
+ }, [options, selected, active, open2]);
661
682
  return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: "twui-select", "data-split": !!onActivate || void 0, role: onActivate ? "group" : void 0, "aria-label": onActivate ? label : void 0, ref: root, onBlur: (e) => {
662
683
  if (!e.currentTarget.contains(e.relatedTarget)) close();
663
684
  }, children: [
@@ -674,10 +695,10 @@ function Select({ id, label, value, options, onChange, onActivate, disabled = fa
674
695
  className: "twui-select-trigger",
675
696
  "aria-label": `${label}:${options[selected]?.label ?? ""}`,
676
697
  "aria-haspopup": "listbox",
677
- "aria-expanded": open,
678
- "aria-controls": open ? listId : void 0,
698
+ "aria-expanded": open2,
699
+ "aria-controls": open2 ? listId : void 0,
679
700
  disabled,
680
- onClick: () => open ? close(true) : show(),
701
+ onClick: () => open2 ? close(true) : show(),
681
702
  onKeyDown: (e) => {
682
703
  if (["ArrowDown", "ArrowUp", "Home", "End"].includes(e.key)) {
683
704
  e.preventDefault();
@@ -690,7 +711,7 @@ function Select({ id, label, value, options, onChange, onActivate, disabled = fa
690
711
  ]
691
712
  }
692
713
  ),
693
- open && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
714
+ open2 && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
694
715
  "div",
695
716
  {
696
717
  ref: list,
@@ -768,6 +789,9 @@ function Select({ id, label, value, options, onChange, onActivate, disabled = fa
768
789
  ] });
769
790
  }
770
791
 
792
+ // src/web/TeamworkPanel.tsx
793
+ var import_react5 = require("react");
794
+
771
795
  // node_modules/.pnpm/qrcode-generator@2.0.4/node_modules/qrcode-generator/dist/qrcode.mjs
772
796
  var qrcode = function(typeNumber, errorCorrectionLevel) {
773
797
  const PAD0 = 236;
@@ -2406,6 +2430,13 @@ var stringToBytes = qrcode.stringToBytes;
2406
2430
  var ROUTE_PREFIX = "/api/teamwork";
2407
2431
 
2408
2432
  // src/web/api.ts
2433
+ var HostUnreachable = class extends Error {
2434
+ constructor(reason, status) {
2435
+ super(reason);
2436
+ this.reason = reason;
2437
+ this.status = status;
2438
+ }
2439
+ };
2409
2440
  var base = ROUTE_PREFIX.slice(1) + "/";
2410
2441
  async function call(route, payload = {}) {
2411
2442
  let response;
@@ -2417,17 +2448,18 @@ async function call(route, payload = {}) {
2417
2448
  credentials: "same-origin"
2418
2449
  });
2419
2450
  } catch {
2420
- throw new Error("无法连接 DSH 服务");
2451
+ throw new HostUnreachable("offline");
2421
2452
  }
2422
2453
  const data = await response.json().catch(() => null);
2423
2454
  if (!response.ok) {
2424
- if (response.status === 404 && !data) throw new Error("DSH 还没有加载 Teamwork 插件的服务端,请重启 DSH");
2425
- throw new Error(data?.error || `请求失败(HTTP ${response.status})`);
2455
+ if (response.status === 404 && !data) throw new HostUnreachable("not-loaded");
2456
+ if (data?.error) throw new Error(data.error);
2457
+ throw new HostUnreachable("status", response.status);
2426
2458
  }
2427
2459
  return data;
2428
2460
  }
2429
2461
  var api = {
2430
- quota: (teamId) => call("quota", { teamId }),
2462
+ summary: (teamId) => call("summary", { teamId }),
2431
2463
  profile: () => call("profile"),
2432
2464
  updateProfile: (input) => call("update-profile", input),
2433
2465
  state: (sessionId) => call("state", { sessionId }),
@@ -2440,66 +2472,639 @@ var api = {
2440
2472
  install: (id, version) => call("install", { id, version }),
2441
2473
  pairPhone: () => call("pair-phone", {}),
2442
2474
  decidePhone: (id, accept) => call("decide-phone", { id, accept }),
2443
- revokePhone: (id) => call("revoke-phone", { id })
2475
+ revokePhone: (id) => call("revoke-phone", { id }),
2476
+ shareEnable: (key) => call("share-enable", { key }),
2477
+ shareDisable: () => call("share-disable"),
2478
+ shareAuditKey: (key) => call("share-audit-key", { key }),
2479
+ shareInvite: (email) => call("share-invite", { email }),
2480
+ shareUnlock: (email) => call("share-unlock", { email })
2481
+ };
2482
+
2483
+ // src/web/messages.ts
2484
+ var import_react4 = require("react");
2485
+
2486
+ // src/locale.ts
2487
+ function fill(template, values) {
2488
+ return values ? template.replace(/\{(\w+)\}/g, (whole, name) => name in values ? String(values[name]) : whole) : template;
2489
+ }
2490
+ function translator(catalogs2, locale) {
2491
+ return (key, values) => fill(catalogs2[locale][key], values);
2492
+ }
2493
+
2494
+ // src/web/messages.ts
2495
+ var en = {
2496
+ // Shared
2497
+ "common.retry": "Try again",
2498
+ "common.cancel": "Cancel",
2499
+ "common.back": "Back to team resources",
2500
+ "common.admin": "Admin",
2501
+ "common.member": "Member",
2502
+ "common.allTeams": "All teams",
2503
+ "common.officialService": "Hosted service",
2504
+ "common.thisDsh": "this DSH",
2505
+ "error.offline": "Cannot reach DSH.",
2506
+ "error.notLoaded": "DSH has not loaded the Teamwork plugin’s host half yet. Restart DSH.",
2507
+ "error.status": "The request failed (HTTP {status}).",
2508
+ // Loading and sync
2509
+ "load.failed": "Could not read the team status",
2510
+ "load.stale": "The status did not refresh",
2511
+ "sync.failedTitle": "Sync failed; using the last synced configuration",
2512
+ "sync.failedBody": "Your team resources here may be out of date. Try again later, or check your connection.",
2513
+ "sync.done": "Team configuration synced",
2514
+ "sync.never": "Not synced yet",
2515
+ "sync.justNow": "Synced just now",
2516
+ "sync.minutes": "Synced {minutes} min ago",
2517
+ "sync.at": "Synced at {time}",
2518
+ "sync.running": "Syncing…",
2519
+ "sync.failed": "Sync failed",
2520
+ "sync.refresh": "Refresh",
2521
+ "team.gone": "The team you were browsing is no longer available, so all teams are shown.",
2522
+ // Header and navigation
2523
+ "nav.home": "Back to team resources",
2524
+ "nav.teams": "My teams",
2525
+ "nav.chooseTeam": "Choose a team",
2526
+ "nav.phones": "Phone",
2527
+ "nav.shared": "Shared DSH",
2528
+ "shared.title": "Shared DSH",
2529
+ "shared.body": "This DSH is its team’s shared DSH: it signs in as the team, and members reach it from the console or the app.",
2530
+ "shared.bodyTeam": "This DSH is {team}’s shared DSH: it signs in as the team, and members reach it from the console or the app.",
2531
+ "shared.keyFailed": "The team host key no longer works",
2532
+ "shared.auditTitle": "Audit key",
2533
+ "shared.auditSet": "Members’ sessions are archived, sealed to the key with fingerprint",
2534
+ "shared.auditMissingTitle": "No member can join yet",
2535
+ "shared.auditMissingBody": "Set your team’s audit key first. On your own computer run dsh-teamwork-audit keygen, keep the file it writes, and paste the public key it prints here.",
2536
+ "shared.auditKey": "Audit public key",
2537
+ "shared.auditPlaceholder": "The public key dsh-teamwork-audit keygen printed",
2538
+ "shared.auditSave": "Set key",
2539
+ "shared.auditReplace": "Replace key",
2540
+ "shared.auditSaved": "Audit key set; members can join",
2541
+ "shared.membersTitle": "Members who may reach it",
2542
+ "shared.noMembers": "Nobody is listed yet, or the relay is not connected. A team admin sets the list in the console.",
2543
+ "shared.noDevice": "No device yet",
2544
+ "shared.locked": "Locked",
2545
+ "shared.unlock": "Unlock",
2546
+ "shared.unlocked": "{email} can set a new PIN",
2547
+ "shared.invite": "Invite",
2548
+ "shared.inviteTitle": "Invite for {email}",
2549
+ "shared.inviteQr": "Invite QR code",
2550
+ "shared.inviteBody": "Single use, valid for a day. Hand it over yourself, in person or through a channel your team trusts, never through the Teamwork server. They open it in the app, or paste it in the console under Shared DSHs.",
2551
+ "shared.copy": "Copy link",
2552
+ "shared.copied": "Invite link copied",
2553
+ "shared.disable": "Turn shared mode off",
2554
+ "shared.disableTitle": "Turn shared mode off?",
2555
+ "shared.disableBody": "This DSH stops being the team’s: its key is deleted here, every member’s device and PIN is forgotten, and what the archive collected is sent first. A team admin can delete the key in the console too.",
2556
+ "shared.disabled": "Shared mode is off",
2557
+ "shared.enableTitle": "Use this DSH as a team’s shared DSH",
2558
+ "shared.enableBody": "A team admin creates a team host key under Shared DSHs in the team console. With it, this DSH signs in as the team, never as a person.",
2559
+ "shared.enableBodySignedIn": "A team admin creates a team host key under Shared DSHs in the team console. With it, this DSH signs in as the team, never as a person: you are signed out here first.",
2560
+ "shared.hostKey": "Team host key",
2561
+ "shared.enable": "Make it shared",
2562
+ "shared.enabled": "This DSH is now its team’s shared DSH",
2563
+ "nav.account": "Account",
2564
+ "nav.reviews": "{count} to review",
2565
+ "nav.reviewsHint": "Submissions waiting for your review in the team console",
2566
+ // No team, team chooser, teams page
2567
+ "noTeam.title": "Your account is connected. Next, join a team",
2568
+ "noTeam.body": "Accept an invitation or create a team on the website, then come back and refresh.",
2569
+ "noTeam.open": "Join or create a team",
2570
+ "noTeam.refresh": "I have joined; refresh",
2571
+ "noTeam.refreshed": "Team list refreshed",
2572
+ "choose.title": "Which team first?",
2573
+ "choose.body": "This only sets what you browse here. You can switch at the top at any time.",
2574
+ "choose.pick": "Choose",
2575
+ "choose.all": "Show every team’s resources",
2576
+ "teams.title": "My teams",
2577
+ "teams.body": "Switching what you browse never changes a running session or a paired phone.",
2578
+ "teams.browse": "Browse resources",
2579
+ "teams.manage": "Manage team",
2580
+ "teams.view": "View team",
2581
+ "teams.joinOrCreate": "Join or create a team",
2582
+ // Resource tabs
2583
+ "tabs.label": "Resource type",
2584
+ "tabs.presets": "Presets",
2585
+ "tabs.models": "Models",
2586
+ "tabs.plugins": "Plugins",
2587
+ "search.label": "Search team resources",
2588
+ "search.placeholder": "Search by name or purpose",
2589
+ "empty.noMatch": "Nothing matches",
2590
+ "empty.noMatchBody": "Try another word, or switch team.",
2591
+ "empty.none": "Nothing here yet",
2592
+ "empty.noneBody": "What an admin publishes on the website syncs here.",
2593
+ // Team assistant
2594
+ "assistant.label": "Team assistant",
2595
+ "assistant.body": "Ask it in a session about your team’s presets, models and plugins, your usage and budget, and what is waiting for review. Admins can also manage the team through it, with your approval for every change.",
2596
+ "assistant.examples": "Try asking",
2597
+ "assistant.example1": "What did I spend this month?",
2598
+ "assistant.example2": "Which presets does our team share?",
2599
+ "assistant.example3": "Submit my local preset for review",
2600
+ "assistant.ask": "Ask the assistant",
2601
+ // Presets
2602
+ "preset.sessionModel": "Session model",
2603
+ "preset.inUse": "In use in this session",
2604
+ "preset.ready": "Ready",
2605
+ "preset.checkOnStart": "Tools checked at start",
2606
+ "preset.notReady": "Not ready",
2607
+ "preset.details": "Details",
2608
+ "preset.newSession": "New session",
2609
+ "preset.useHere": "Use in this blank session",
2610
+ "preset.modelGone": "The team model this preset uses is no longer available. Ask an admin.",
2611
+ "preset.pluginsNotReady": "Plugins it needs are not ready: {plugins}.",
2612
+ "preset.toolsMissing": "Required tools are missing: {tools}. Install or enable them in DSH’s plugin manager.",
2613
+ "preset.sessionStarted": "This session has started, so the preset can only be used in a new session.",
2614
+ "preset.goInstall": "Go to install",
2615
+ "preset.model": "Model",
2616
+ "preset.tools": "Tools",
2617
+ "preset.noTools": "None required",
2618
+ "preset.required": "Required",
2619
+ "preset.optional": "optional",
2620
+ "preset.plugins": "Plugins it needs",
2621
+ "preset.noPlugins": "None",
2622
+ "preset.version": "Version",
2623
+ "preset.versionValue": "v{version}. A newer version arrives with the next sync after an admin publishes it.",
2624
+ "preset.toolsNote": "Tools are checked for the current session, again when you switch sessions, and before every request.",
2625
+ "preset.selected": "{name} is now used in this session.",
2626
+ "tool.available": "available",
2627
+ "tool.conditional": "checked when run",
2628
+ "tool.missing": "missing",
2629
+ "tool.unknown": "not checked yet",
2630
+ "list.separator": ", ",
2631
+ // Models
2632
+ "model.body": "Called by the team’s server, so the provider key stays there. Changes this session only, never your local default.",
2633
+ "model.use": "Use in this session",
2634
+ "model.openSession": "Open or start a session in DSH first, then choose a model.",
2635
+ "model.noContextWindow": "The team model “{name}” has no context window (contextWindow) configured, so it cannot be used yet. Ask a team admin to set it in the console, then sync again.",
2636
+ // Plugins
2637
+ "plugin.ready": "Enabled",
2638
+ "plugin.missing": "Not installed",
2639
+ "plugin.disabled": "Installed, not enabled",
2640
+ "plugin.versionMismatch": "Different local version",
2641
+ "plugin.failed": "Failed to load",
2642
+ "plugin.pending": "Waiting to load",
2643
+ "plugin.unknown": "Cannot confirm",
2644
+ "plugin.catalogChanged": "Team changed the version",
2645
+ "plugin.local": "Local {version}",
2646
+ "plugin.install": "Install",
2647
+ "plugin.managed": "Managed in DSH’s plugin manager",
2648
+ "plugin.confirmTitle": "Install and enable {spec}?",
2649
+ "plugin.confirmBody": "This runs the plugin’s code on your computer. The team fixes the version, and a plugin of the same name you already have is never overwritten.",
2650
+ "plugin.confirm": "Install and enable",
2651
+ // Footer budget
2652
+ "budget.loading": "Loading budget…",
2653
+ "budget.unavailable": "Budget unavailable",
2654
+ "budget.exhausted": "Budget used up",
2655
+ "budget.unconfirmed": "Budget being reconciled",
2656
+ "budget.remaining": "{points} points left",
2657
+ "budget.tokenLimited": "Token limit set",
2658
+ "budget.unlimited": "No budget limit",
2659
+ "budget.hint": "Your budget in the selected team; the model or provider may still have its own limits. Switching what you browse never changes the current session.",
2660
+ // Account
2661
+ "account.title": "Account",
2662
+ "account.body": "Your Teamwork profile, and how this DSH is connected.",
2663
+ "account.profile": "Profile",
2664
+ "account.readFailed": "Could not read your profile",
2665
+ "account.unnamed": "Teamwork user",
2666
+ "account.noEmail": "No email",
2667
+ "account.name": "Display name",
2668
+ "account.language": "Language",
2669
+ "account.languageHint": "Used here, on the Teamwork website and in the app.",
2670
+ "account.unsaved": "Unsaved changes are kept while you move between pages.",
2671
+ "account.save": "Save",
2672
+ "account.saved": "Profile saved",
2673
+ "account.discard": "Discard changes",
2674
+ "account.connection": "Connection",
2675
+ "account.restartNote": "Restarting DSH asks you to authorize again. Signing out removes the team configuration and disconnects the phone relay; your local sessions and installed plugins stay.",
2676
+ "account.signOut": "Sign this DSH out of Teamwork",
2677
+ "account.signOutTitle": "Sign out of Teamwork?",
2678
+ "account.signOutBody": "Team-model requests in progress may be affected, and phones can no longer reach this DSH through the current connection.",
2679
+ "account.signOutConfirm": "Sign out",
2680
+ "account.signedOut": "Signed out of Teamwork",
2681
+ // Sign-in
2682
+ "signIn.title": "Sign in to Teamwork",
2683
+ "signIn.reconnect": "Reconnect Teamwork",
2684
+ "signIn.lede": "Your team’s presets, models and plugins, published once and kept the same in every member’s DSH.",
2685
+ "signIn.step1": "Sign in in your browser",
2686
+ "signIn.step2Paste": "Authorize, then paste the line shown on the page below (valid for two minutes)",
2687
+ "signIn.step2Auto": "Authorize; this DSH finishes signing in by itself",
2688
+ "signIn.waiting": "Waiting for you to authorize in the browser. Team resources open here when you do.",
2689
+ "signIn.openPage": "Open the authorization page",
2690
+ "signIn.useCode": "Did not finish by itself? Use the code",
2691
+ "signIn.restart": "Start again",
2692
+ "signIn.expiredTitle": "This sign-in timed out",
2693
+ "signIn.expiredBody": "Open the authorization page again; a code from the old page does not work for a new sign-in.",
2694
+ "signIn.start": "Sign in in the browser",
2695
+ "signIn.pasteAuto": "Did not finish by itself? Paste the line shown on the page",
2696
+ "signIn.paste": "The line shown on the page",
2697
+ "signIn.finish": "Finish",
2698
+ "signIn.done": "Authorized, and the team configuration is synced",
2699
+ "signIn.keysTitle": "Keys stay on the server",
2700
+ "signIn.keysBody": "The team’s server calls the team models; provider keys never reach this computer.",
2701
+ "signIn.sideTitle": "Beside your own setup",
2702
+ "signIn.sideBody": "Team configuration is added as its own entries and never overwrites your models or presets.",
2703
+ "signIn.syncTitle": "Kept up to date",
2704
+ "signIn.syncBody": "Synced every minute. Once you are removed from a team, your next request is refused.",
2705
+ // Server
2706
+ "server.label": "Server",
2707
+ "server.change": "Change",
2708
+ "server.field": "Server address",
2709
+ "server.hint": "For a self-hosted team or local development, enter your DSH Teamwork address, for example http://localhost:3800. You sign in again after changing it.",
2710
+ "server.saveSignOut": "Sign out and switch server",
2711
+ "server.save": "Save",
2712
+ "server.reset": "Back to {host}",
2713
+ "server.wasReset": "Back on the default server",
2714
+ "server.changed": "Server changed",
2715
+ // Phones
2716
+ "phones.title": "Phone",
2717
+ "phones.body": "A phone connects to the DSH on this computer, whichever team you are browsing.",
2718
+ "relay.offTitle": "Phone access is not on",
2719
+ "relay.offBody": "Check that the server offers the phone relay and that this account is in a team.",
2720
+ "relay.connectingTitle": "Connecting to the relay…",
2721
+ "relay.connectingBody": "Once connected, you can pair a phone here.",
2722
+ "relay.refusedTitle": "The relay refused this computer",
2723
+ "relay.refusedBody": "The sign-in may have expired, or another DSH is connected as this computer. Sign out and in again to retry.",
2724
+ "phones.failed": "The phone action did not finish",
2725
+ "phones.expiredTitle": "The pairing code expired",
2726
+ "phones.expiredBody": "A code works once. Make a new one and scan it on your phone.",
2727
+ "phones.newCode": "Make a new code",
2728
+ "phones.emptyTitle": "Use this computer’s DSH from your phone",
2729
+ "phones.pair": "Pair a phone",
2730
+ "phones.emptyBody": "Phone and computer sign in to the same Teamwork account. Once paired, the phone reaches the personal and team sessions this DSH can reach; it cannot yet be limited to one team. Pairing adds no team permission, and either side can end it.",
2731
+ "phones.requested": "Asked to pair {time}",
2732
+ "phones.waiting": "Waiting for you",
2733
+ "phones.safetyCode": "Safety code: {code}. Check that the phone shows the same code, and confirm on the phone.",
2734
+ "phones.handshake": "Waiting for the phone to finish the encrypted handshake; it cannot be confirmed yet.",
2735
+ "phones.grant": "Once confirmed, the phone can see the personal and team sessions this DSH can reach, send messages, answer an agent’s questions and handle approvals. It cannot yet be limited to one team; pairing adds no team permission, and either side can end it. Phone and computer sign in to the same account.",
2736
+ "phones.reject": "Reject",
2737
+ "phones.rejected": "Rejected",
2738
+ "phones.accept": "Codes match; pair",
2739
+ "phones.accepted": "{device} is paired",
2740
+ "phones.paired": "Paired phones",
2741
+ "phones.none": "No phone is paired. Pairing is optional and does not affect team resources.",
2742
+ "phones.lastUsed": "Last used {time}",
2743
+ "phones.pairedAt": "Paired {time}",
2744
+ "phones.verified": "Verified encrypted device",
2745
+ "phones.repair": "Pair again",
2746
+ "phones.unpair": "Unpair",
2747
+ "phones.unpairTitle": "Unpair {device}?",
2748
+ "phones.unpairBody": "The phone disconnects at once and has to scan a new code to reach this computer again.",
2749
+ "phones.unpaired": "Unpaired",
2750
+ "phones.scan": "Scan with the DSH Teamwork app",
2751
+ "phones.manual": "Or type the pairing code in the app:",
2752
+ "phones.expires": "Expires in {time} and works once. Come back here to confirm after scanning.",
2753
+ "phones.collapsedNote": "Hidden, the code still works until it expires; a phone that submits it still needs your confirmation here.",
2754
+ "phones.hide": "Hide the code",
2755
+ "phones.qr": "Pairing QR code"
2756
+ };
2757
+ var zhCN = {
2758
+ "common.retry": "重试",
2759
+ "common.cancel": "取消",
2760
+ "common.back": "返回团队资源",
2761
+ "common.admin": "管理员",
2762
+ "common.member": "成员",
2763
+ "common.allTeams": "全部团队",
2764
+ "common.officialService": "官方服务",
2765
+ "common.thisDsh": "本机 DSH",
2766
+ "error.offline": "无法连接 DSH 服务。",
2767
+ "error.notLoaded": "DSH 还没有加载 Teamwork 插件的服务端,请重启 DSH。",
2768
+ "error.status": "请求失败(HTTP {status})。",
2769
+ "load.failed": "无法读取团队状态",
2770
+ "load.stale": "状态没有刷新",
2771
+ "sync.failedTitle": "同步失败,正在使用上次同步的配置",
2772
+ "sync.failedBody": "这里的团队资源可能不是最新的。请稍后重试,或检查网络连接。",
2773
+ "sync.done": "团队配置已同步",
2774
+ "sync.never": "尚未同步",
2775
+ "sync.justNow": "刚刚同步",
2776
+ "sync.minutes": "{minutes} 分钟前同步",
2777
+ "sync.at": "{time} 同步",
2778
+ "sync.running": "正在同步…",
2779
+ "sync.failed": "同步失败",
2780
+ "sync.refresh": "刷新",
2781
+ "team.gone": "当前团队已不可用,浏览范围已切换为全部团队。",
2782
+ "nav.home": "返回团队资源",
2783
+ "nav.teams": "我的团队",
2784
+ "nav.chooseTeam": "选择团队",
2785
+ "nav.phones": "手机连接",
2786
+ "nav.shared": "共享 DSH",
2787
+ "shared.title": "共享 DSH",
2788
+ "shared.body": "这台 DSH 是团队的共享 DSH:以团队身份登录,成员从控制台或 App 访问它。",
2789
+ "shared.bodyTeam": "这台 DSH 是 {team} 的共享 DSH:以团队身份登录,成员从控制台或 App 访问它。",
2790
+ "shared.keyFailed": "团队主机密钥已失效",
2791
+ "shared.auditTitle": "审计密钥",
2792
+ "shared.auditSet": "成员的会话已加密归档,密钥指纹",
2793
+ "shared.auditMissingTitle": "成员还不能加入",
2794
+ "shared.auditMissingBody": "请先设置团队的审计密钥。在你自己的电脑上运行 dsh-teamwork-audit keygen,妥善保管它写出的文件,并把打印出的公钥粘贴到这里。",
2795
+ "shared.auditKey": "审计公钥",
2796
+ "shared.auditPlaceholder": "dsh-teamwork-audit keygen 打印的公钥",
2797
+ "shared.auditSave": "设置密钥",
2798
+ "shared.auditReplace": "更换密钥",
2799
+ "shared.auditSaved": "审计密钥已设置,成员可以加入了",
2800
+ "shared.membersTitle": "可以访问的成员",
2801
+ "shared.noMembers": "名单还是空的,或者中继没有连接。团队管理员在控制台设置名单。",
2802
+ "shared.noDevice": "还没有设备",
2803
+ "shared.locked": "已锁定",
2804
+ "shared.unlock": "解锁",
2805
+ "shared.unlocked": "{email} 可以重新设置 PIN 了",
2806
+ "shared.invite": "邀请",
2807
+ "shared.inviteTitle": "给 {email} 的邀请",
2808
+ "shared.inviteQr": "邀请二维码",
2809
+ "shared.inviteBody": "只能使用一次,一天内有效。请亲自交给对方,当面或通过团队信任的渠道,不要经过 Teamwork 服务器。对方在 App 中打开,或粘贴到控制台的「共享 DSH」页。",
2810
+ "shared.copy": "复制链接",
2811
+ "shared.copied": "邀请链接已复制",
2812
+ "shared.disable": "关闭共享模式",
2813
+ "shared.disableTitle": "关闭共享模式?",
2814
+ "shared.disableBody": "这台 DSH 将不再属于团队:这里的密钥会被删除,所有成员的设备和 PIN 都会被遗忘,归档里已收集的内容会先发送出去。团队管理员也可以在控制台删除密钥。",
2815
+ "shared.disabled": "共享模式已关闭",
2816
+ "shared.enableTitle": "把这台 DSH 设为团队的共享 DSH",
2817
+ "shared.enableBody": "团队管理员在团队控制台的「共享 DSH」中创建团队主机密钥。用它登录后,这台 DSH 以团队身份运行,而不是某个人。",
2818
+ "shared.enableBodySignedIn": "团队管理员在团队控制台的「共享 DSH」中创建团队主机密钥。用它登录后,这台 DSH 以团队身份运行,而不是某个人:你会先在这里退出登录。",
2819
+ "shared.hostKey": "团队主机密钥",
2820
+ "shared.enable": "设为共享",
2821
+ "shared.enabled": "这台 DSH 已成为团队的共享 DSH",
2822
+ "nav.account": "我的账号",
2823
+ "nav.reviews": "{count} 项待审核",
2824
+ "nav.reviewsHint": "团队控制台里等待你审核的提交",
2825
+ "noTeam.title": "账号已连接,接下来加入团队",
2826
+ "noTeam.body": "在网页中接受邀请或创建团队,完成后回来刷新。",
2827
+ "noTeam.open": "加入或创建团队",
2828
+ "noTeam.refresh": "我已加入,刷新团队",
2829
+ "noTeam.refreshed": "团队列表已刷新",
2830
+ "choose.title": "先从哪个团队开始?",
2831
+ "choose.body": "这里只决定浏览哪个团队的资源,随时可以在页面顶部切换。",
2832
+ "choose.pick": "选择团队",
2833
+ "choose.all": "查看全部团队资源",
2834
+ "teams.title": "我的团队",
2835
+ "teams.body": "切换浏览范围不会改变已有会话或手机配对。",
2836
+ "teams.browse": "浏览资源",
2837
+ "teams.manage": "管理团队",
2838
+ "teams.view": "查看团队",
2839
+ "teams.joinOrCreate": "加入或创建团队",
2840
+ "tabs.label": "资源类型",
2841
+ "tabs.presets": "预设",
2842
+ "tabs.models": "模型",
2843
+ "tabs.plugins": "插件",
2844
+ "search.label": "搜索团队资源",
2845
+ "search.placeholder": "搜索名称或用途",
2846
+ "empty.noMatch": "没有匹配的资源",
2847
+ "empty.noMatchBody": "试试其他关键词或切换团队。",
2848
+ "empty.none": "这里还没有资源",
2849
+ "empty.noneBody": "管理员在网页发布后,资源会同步到这里。",
2850
+ "assistant.label": "团队助理",
2851
+ "assistant.body": "在会话里问它团队的预设、模型和插件,你的用量和预算,以及有哪些内容在等待审核。管理员还可以通过它管理团队,每一项改动都需要你批准。",
2852
+ "assistant.examples": "可以这样问",
2853
+ "assistant.example1": "我这个月用了多少?",
2854
+ "assistant.example2": "我们团队共享了哪些预设?",
2855
+ "assistant.example3": "把我本地的预设提交审核",
2856
+ "assistant.ask": "问问助理",
2857
+ "preset.sessionModel": "沿用会话模型",
2858
+ "preset.inUse": "本会话正在使用",
2859
+ "preset.ready": "可以使用",
2860
+ "preset.checkOnStart": "启动时检查工具",
2861
+ "preset.notReady": "未就绪",
2862
+ "preset.details": "详情",
2863
+ "preset.newSession": "新建会话",
2864
+ "preset.useHere": "用于当前空白会话",
2865
+ "preset.modelGone": "预设引用的团队模型已不可用,请联系管理员。",
2866
+ "preset.pluginsNotReady": "依赖插件 {plugins} 尚未就绪。",
2867
+ "preset.toolsMissing": "缺少必需工具 {tools},请在 DSH 插件管理器中安装或启用。",
2868
+ "preset.sessionStarted": "当前会话已开始对话,预设只能用在新会话里。",
2869
+ "preset.goInstall": "前往安装",
2870
+ "preset.model": "模型",
2871
+ "preset.tools": "工具",
2872
+ "preset.noTools": "无要求",
2873
+ "preset.required": "必需",
2874
+ "preset.optional": "可选",
2875
+ "preset.plugins": "依赖插件",
2876
+ "preset.noPlugins": "无",
2877
+ "preset.version": "版本",
2878
+ "preset.versionValue": "v{version},管理员发布新版本后下次同步生效",
2879
+ "preset.toolsNote": "工具按当前会话检查;切换会话后和每次请求前都会重新检查。",
2880
+ "preset.selected": "本会话已选择 {name}。",
2881
+ "tool.available": "可用",
2882
+ "tool.conditional": "执行时检查",
2883
+ "tool.missing": "缺失",
2884
+ "tool.unknown": "待检查",
2885
+ "list.separator": "、",
2886
+ "model.body": "由团队服务器代为调用,provider 密钥留在服务器上。只改当前会话,不改本地默认模型。",
2887
+ "model.use": "用于当前会话",
2888
+ "model.openSession": "先在 DSH 新建或打开一个会话,再选择模型。",
2889
+ "model.noContextWindow": "团队模型「{name}」没有配置上下文窗口(contextWindow),暂时不能使用。请团队管理员在控制台补充后重新同步。",
2890
+ "plugin.ready": "已启用",
2891
+ "plugin.missing": "未安装",
2892
+ "plugin.disabled": "已安装未启用",
2893
+ "plugin.versionMismatch": "本地版本不符",
2894
+ "plugin.failed": "加载失败",
2895
+ "plugin.pending": "等待加载",
2896
+ "plugin.unknown": "无法确认",
2897
+ "plugin.catalogChanged": "团队已更改版本",
2898
+ "plugin.local": "本地 {version}",
2899
+ "plugin.install": "安装",
2900
+ "plugin.managed": "在 DSH 插件管理器中管理",
2901
+ "plugin.confirmTitle": "安装并启用 {spec}?",
2902
+ "plugin.confirmBody": "这会在你的电脑上运行该插件的代码。版本由团队固定;已经装过的同名插件不会被覆盖。",
2903
+ "plugin.confirm": "安装并启用",
2904
+ "budget.loading": "预算加载中…",
2905
+ "budget.unavailable": "预算暂不可用",
2906
+ "budget.exhausted": "预算已用尽",
2907
+ "budget.unconfirmed": "预算待核实",
2908
+ "budget.remaining": "预算剩余 {points} 积分",
2909
+ "budget.tokenLimited": "已设 Token 上限",
2910
+ "budget.unlimited": "未设预算上限",
2911
+ "budget.hint": "所选团队中我的预算;模型或上游仍可能有其他限制。切换浏览的团队不改变当前会话。",
2912
+ "account.title": "我的账号",
2913
+ "account.body": "管理你的 Teamwork 个人资料和这台 DSH 的连接。",
2914
+ "account.profile": "个人资料",
2915
+ "account.readFailed": "暂时无法读取个人资料",
2916
+ "account.unnamed": "Teamwork 用户",
2917
+ "account.noEmail": "未设置邮箱",
2918
+ "account.name": "显示名称",
2919
+ "account.language": "语言",
2920
+ "account.languageHint": "用于这里、Teamwork 网页和手机 App。",
2921
+ "account.unsaved": "有未保存的修改,切换页面时会保留草稿。",
2922
+ "account.save": "保存资料",
2923
+ "account.saved": "个人资料已保存",
2924
+ "account.discard": "撤销修改",
2925
+ "account.connection": "账号与连接",
2926
+ "account.restartNote": "重启 DSH 后需要重新授权。退出会移除当前团队配置并断开手机中转;本地会话与已安装插件保留。",
2927
+ "account.signOut": "退出此 DSH 的 Teamwork",
2928
+ "account.signOutTitle": "退出 Teamwork?",
2929
+ "account.signOutBody": "运行中的团队模型请求可能受影响。手机将无法通过当前连接访问此 DSH。",
2930
+ "account.signOutConfirm": "确认退出",
2931
+ "account.signedOut": "已退出 Teamwork",
2932
+ "signIn.title": "登录 Teamwork",
2933
+ "signIn.reconnect": "重新连接 Teamwork",
2934
+ "signIn.lede": "团队的预设、模型和插件,一处发布,每位成员的 DSH 自动保持一致。",
2935
+ "signIn.step1": "在浏览器中登录",
2936
+ "signIn.step2Paste": "确认授权,把网页上显示的那一行粘贴到下方(两分钟内有效)",
2937
+ "signIn.step2Auto": "确认授权,这里会自动完成登录",
2938
+ "signIn.waiting": "等待浏览器确认授权,完成后这里会自动进入团队资源。",
2939
+ "signIn.openPage": "打开授权页面",
2940
+ "signIn.useCode": "没有自动完成?使用授权码",
2941
+ "signIn.restart": "重新开始登录",
2942
+ "signIn.expiredTitle": "本次登录等待已超时",
2943
+ "signIn.expiredBody": "请重新打开授权页面,旧页面的授权码不能用于新的登录请求。",
2944
+ "signIn.start": "在浏览器中登录",
2945
+ "signIn.pasteAuto": "没有自动完成?粘贴网页上显示的那一行",
2946
+ "signIn.paste": "网页上显示的那一行",
2947
+ "signIn.finish": "完成授权",
2948
+ "signIn.done": "已授权,团队配置已同步",
2949
+ "signIn.keysTitle": "密钥留在服务器",
2950
+ "signIn.keysBody": "团队模型由服务器代为调用,provider 密钥不会下发到这台电脑。",
2951
+ "signIn.sideTitle": "与本地配置并存",
2952
+ "signIn.sideBody": "团队配置作为独立条目加入,不覆盖你自己的模型和预设。",
2953
+ "signIn.syncTitle": "自动保持最新",
2954
+ "signIn.syncBody": "每分钟同步一次;被移出团队后,下一次请求即失效。",
2955
+ "server.label": "服务器",
2956
+ "server.change": "更改",
2957
+ "server.field": "服务器地址",
2958
+ "server.hint": "自建团队或本地开发时填写你的 DSH Teamwork 地址,例如 http://localhost:3800。更改后需要重新登录。",
2959
+ "server.saveSignOut": "退出并更换服务器",
2960
+ "server.save": "保存",
2961
+ "server.reset": "恢复为 {host}",
2962
+ "server.wasReset": "已恢复为默认服务器",
2963
+ "server.changed": "服务器已更改",
2964
+ "phones.title": "手机连接",
2965
+ "phones.body": "手机连接的是这台电脑上的 DSH,与当前浏览的团队无关。",
2966
+ "relay.offTitle": "手机连接尚未开启",
2967
+ "relay.offBody": "请确认服务器提供手机中转服务,并且当前账号已加入团队。",
2968
+ "relay.connectingTitle": "正在连接中转服务…",
2969
+ "relay.connectingBody": "连上之后就可以在这里配对手机。",
2970
+ "relay.refusedTitle": "中转服务拒绝了这台电脑",
2971
+ "relay.refusedBody": "登录可能已失效,或另一个 DSH 正以这台电脑的身份连接。退出后重新登录即可重试。",
2972
+ "phones.failed": "手机操作未完成",
2973
+ "phones.expiredTitle": "配对码已过期",
2974
+ "phones.expiredBody": "配对码只能使用一次。重新生成后,请在手机上扫描新码。",
2975
+ "phones.newCode": "重新生成配对码",
2976
+ "phones.emptyTitle": "在手机上操作这台电脑的 DSH",
2977
+ "phones.pair": "配对新手机",
2978
+ "phones.emptyBody": "手机和电脑须登录同一个 Teamwork 账号。配对后可访问本机 DSH 有权限的个人与各团队会话,目前不能只授权一个团队;配对不会增加团队权限,任一端都可解除。",
2979
+ "phones.requested": "{time} 申请配对",
2980
+ "phones.waiting": "等待你确认",
2981
+ "phones.safetyCode": "安全码:{code}。请核对手机上的安全码一致,并在手机上确认。",
2982
+ "phones.handshake": "等待手机完成加密握手,暂时无法确认。",
2983
+ "phones.grant": "确认后,手机可查看本机 DSH 可访问的个人与各团队会话,发送消息、回答 Agent 提问和处理审批。目前不能只授权一个团队;配对不会增加团队权限,任一端都可解除。手机与电脑须登录同一账号。",
2984
+ "phones.reject": "拒绝",
2985
+ "phones.rejected": "已拒绝",
2986
+ "phones.accept": "安全码一致,确认配对",
2987
+ "phones.accepted": "{device} 已配对",
2988
+ "phones.paired": "已配对手机",
2989
+ "phones.none": "尚无已配对手机。配对是可选功能,不影响团队资源的使用。",
2990
+ "phones.lastUsed": "最近使用 {time}",
2991
+ "phones.pairedAt": "配对于 {time}",
2992
+ "phones.verified": "已验证加密设备",
2993
+ "phones.repair": "需要重新配对",
2994
+ "phones.unpair": "解除配对",
2995
+ "phones.unpairTitle": "解除与 {device} 的配对?",
2996
+ "phones.unpairBody": "这台手机会立即断开,之后需要重新扫码配对才能再连到这台电脑。",
2997
+ "phones.unpaired": "已解除配对",
2998
+ "phones.scan": "用 DSH Teamwork App 扫码",
2999
+ "phones.manual": "也可以在 App 里手动输入配对码:",
3000
+ "phones.expires": "{time} 后失效,只能使用一次。扫码后请回到这里确认。",
3001
+ "phones.collapsedNote": "收起后,配对码在到期前仍然有效;手机提交后需在本机确认。",
3002
+ "phones.hide": "收起配对码",
3003
+ "phones.qr": "配对二维码"
2444
3004
  };
3005
+ var catalogs = { en, "zh-CN": zhCN };
3006
+ function words(locale) {
3007
+ return Object.assign(translator(catalogs, locale), { locale });
3008
+ }
3009
+ var Words = (0, import_react4.createContext)(words("en"));
3010
+ function useT() {
3011
+ return (0, import_react4.useContext)(Words);
3012
+ }
2445
3013
 
2446
3014
  // src/web/TeamworkPanel.tsx
2447
3015
  var import_jsx_runtime7 = require("react/jsx-runtime");
2448
3016
  var REFRESH_MS = 5e3;
3017
+ var SUMMARY_MS = 3e4;
2449
3018
  var views = /* @__PURE__ */ new Map();
2450
3019
  var profileDrafts = /* @__PURE__ */ new Map();
2451
3020
  var pluginText = {
2452
- ready: ["已启用", "success"],
2453
- missing: ["未安装", "warning"],
2454
- disabled: ["已安装未启用", "warning"],
2455
- "version-mismatch": ["本地版本不符", "warning"],
2456
- failed: ["加载失败", "danger"],
2457
- pending: ["等待加载", "warning"],
2458
- unknown: ["无法确认", "neutral"],
2459
- "catalog-changed": ["团队已更改版本", "warning"]
3021
+ ready: ["plugin.ready", "success"],
3022
+ missing: ["plugin.missing", "warning"],
3023
+ disabled: ["plugin.disabled", "warning"],
3024
+ "version-mismatch": ["plugin.versionMismatch", "warning"],
3025
+ failed: ["plugin.failed", "danger"],
3026
+ pending: ["plugin.pending", "warning"],
3027
+ unknown: ["plugin.unknown", "neutral"],
3028
+ "catalog-changed": ["plugin.catalogChanged", "warning"]
2460
3029
  };
2461
3030
  var toolText = {
2462
- available: ["可用", "success"],
2463
- conditional: ["执行时检查", "neutral"],
2464
- missing: ["缺失", "warning"],
2465
- unknown: ["待检查", "neutral"]
3031
+ available: ["tool.available", "success"],
3032
+ conditional: ["tool.conditional", "neutral"],
3033
+ missing: ["tool.missing", "warning"],
3034
+ unknown: ["tool.unknown", "neutral"]
2466
3035
  };
2467
3036
  var host = (server) => server.replace(/^https?:\/\//, "");
2468
3037
  var missingTools = (preset) => preset.tools.filter((t) => t.required && (t.state === "missing" || t.state === "unknown"));
2469
3038
  var pluginsNotReady = (preset) => preset.plugins.filter((p) => p.state !== "ready");
2470
- function synced(iso) {
2471
- if (!iso) return "尚未同步";
3039
+ var role = (t, value) => t(value === "admin" ? "common.admin" : "common.member");
3040
+ var open = (url) => window.open(url, "_blank", "noopener");
3041
+ function describe(t, error) {
3042
+ if (error instanceof HostUnreachable) {
3043
+ return error.reason === "offline" ? t("error.offline") : error.reason === "not-loaded" ? t("error.notLoaded") : t("error.status", { status: error.status ?? "" });
3044
+ }
3045
+ return error.message;
3046
+ }
3047
+ function synced(t, iso) {
3048
+ if (!iso) return t("sync.never");
2472
3049
  const seconds = Math.max(0, Math.round((Date.now() - Date.parse(iso)) / 1e3));
2473
- if (seconds < 60) return "刚刚同步";
2474
- if (seconds < 3600) return `${Math.round(seconds / 60)} 分钟前同步`;
2475
- return `${new Date(iso).toLocaleTimeString()} 同步`;
3050
+ if (seconds < 60) return t("sync.justNow");
3051
+ if (seconds < 3600) return t("sync.minutes", { minutes: Math.round(seconds / 60) });
3052
+ return t("sync.at", { time: new Date(iso).toLocaleTimeString(t.locale) });
3053
+ }
3054
+ function useSummary(team, revision) {
3055
+ const [summary, setSummary] = (0, import_react5.useState)();
3056
+ (0, import_react5.useEffect)(() => {
3057
+ setSummary(void 0);
3058
+ if (!team) return;
3059
+ let active = true;
3060
+ let timer;
3061
+ const load = async () => {
3062
+ let next = null;
3063
+ try {
3064
+ next = await api.summary(team);
3065
+ } catch {
3066
+ }
3067
+ if (active) {
3068
+ setSummary(next);
3069
+ timer = setTimeout(load, SUMMARY_MS);
3070
+ }
3071
+ };
3072
+ void load();
3073
+ return () => {
3074
+ active = false;
3075
+ clearTimeout(timer);
3076
+ };
3077
+ }, [team, revision]);
3078
+ return summary;
2476
3079
  }
2477
3080
  function TeamworkPanel({ host: dsh }) {
2478
- const currentSession = (0, import_react4.useRef)(dsh.currentSession ?? currentSessionTracker(dsh.sessions.list)).current;
2479
- const sessionId = (0, import_react4.useSyncExternalStore)(dsh.sessions.list.subscribe, currentSession);
2480
- const [snapshot, setState] = (0, import_react4.useState)();
2481
- const [loadedSession, setLoadedSession] = (0, import_react4.useState)();
3081
+ const currentSession = (0, import_react5.useRef)(dsh.currentSession ?? currentSessionTracker(dsh.sessions.list)).current;
3082
+ const sessionId = (0, import_react5.useSyncExternalStore)(dsh.sessions.list.subscribe, currentSession);
3083
+ const [snapshot, setState] = (0, import_react5.useState)();
3084
+ const [loadedSession, setLoadedSession] = (0, import_react5.useState)();
2482
3085
  const state = snapshot && (loadedSession === sessionId ? snapshot : { ...snapshot, session: null });
2483
- const [loadError, setLoadError] = (0, import_react4.useState)();
2484
- const [tab, setTab] = (0, import_react4.useState)("presets");
2485
- const [page, setPage] = (0, import_react4.useState)("resources");
2486
- const [team, setTeam] = (0, import_react4.useState)("all");
2487
- const [query, setQuery] = (0, import_react4.useState)("");
2488
- const [profile, setProfile] = (0, import_react4.useState)();
2489
- const [profileError, setProfileError] = (0, import_react4.useState)();
2490
- const [profileAttempt, setProfileAttempt] = (0, import_react4.useState)(0);
2491
- const identity = (0, import_react4.useRef)();
2492
- const touched = (0, import_react4.useRef)(false);
2493
- const browsing = (0, import_react4.useRef)({ team, tab, query });
3086
+ const [loadError, setLoadError] = (0, import_react5.useState)();
3087
+ const [tab, setTab] = (0, import_react5.useState)("presets");
3088
+ const [page, setPage] = (0, import_react5.useState)("resources");
3089
+ const [team, setTeam] = (0, import_react5.useState)("all");
3090
+ const [query, setQuery] = (0, import_react5.useState)("");
3091
+ const [profile, setProfile] = (0, import_react5.useState)();
3092
+ const [profileError, setProfileError] = (0, import_react5.useState)();
3093
+ const [profileAttempt, setProfileAttempt] = (0, import_react5.useState)(0);
3094
+ const identity = (0, import_react5.useRef)();
3095
+ const touched = (0, import_react5.useRef)(false);
3096
+ const browsing = (0, import_react5.useRef)({ team, tab, query });
2494
3097
  browsing.current = { team, tab, query };
2495
- const latest = (0, import_react4.useRef)(state);
3098
+ const latest = (0, import_react5.useRef)(state);
2496
3099
  latest.current = state;
2497
- const request = (0, import_react4.useRef)();
2498
- const context = (0, import_react4.useRef)(sessionId);
3100
+ const request = (0, import_react5.useRef)();
3101
+ const context = (0, import_react5.useRef)(sessionId);
2499
3102
  context.current = sessionId;
2500
- const [toast, setToast] = (0, import_react4.useState)();
2501
- const toastTimer = (0, import_react4.useRef)();
2502
- const refresh = (0, import_react4.useCallback)(() => {
3103
+ const [toast, setToast] = (0, import_react5.useState)();
3104
+ const toastTimer = (0, import_react5.useRef)();
3105
+ const locale = state?.locale ?? (navigator.language?.toLowerCase().startsWith("zh") ? "zh-CN" : "en");
3106
+ const t = (0, import_react5.useMemo)(() => words(locale), [locale]);
3107
+ const refresh = (0, import_react5.useCallback)(() => {
2503
3108
  if (request.current) return request.current;
2504
3109
  const session = context.current;
2505
3110
  request.current = (async () => {
@@ -2511,14 +3116,14 @@ function TeamworkPanel({ host: dsh }) {
2511
3116
  setLoadError(void 0);
2512
3117
  }
2513
3118
  } catch (error) {
2514
- setLoadError(error.message);
3119
+ setLoadError(error);
2515
3120
  } finally {
2516
3121
  request.current = void 0;
2517
3122
  }
2518
3123
  })();
2519
3124
  return request.current;
2520
3125
  }, []);
2521
- (0, import_react4.useEffect)(() => {
3126
+ (0, import_react5.useEffect)(() => {
2522
3127
  let disposed = false;
2523
3128
  let timer;
2524
3129
  const poll = async () => {
@@ -2533,8 +3138,8 @@ function TeamworkPanel({ host: dsh }) {
2533
3138
  clearTimeout(timer);
2534
3139
  };
2535
3140
  }, [refresh, sessionId]);
2536
- const authenticated = state?.authenticated, server = state?.server;
2537
- (0, import_react4.useEffect)(() => {
3141
+ const authenticated = state?.authenticated && !state.shared, server = state?.server;
3142
+ (0, import_react5.useEffect)(() => {
2538
3143
  identity.current = void 0;
2539
3144
  touched.current = false;
2540
3145
  setProfile(void 0);
@@ -2542,13 +3147,14 @@ function TeamworkPanel({ host: dsh }) {
2542
3147
  setTeam("all");
2543
3148
  setQuery("");
2544
3149
  }, [authenticated, server]);
2545
- (0, import_react4.useEffect)(() => {
3150
+ (0, import_react5.useEffect)(() => {
2546
3151
  setProfileError(void 0);
2547
3152
  if (!authenticated) return;
2548
3153
  let cancelled = false;
2549
3154
  void api.profile().then((next) => {
2550
3155
  if (cancelled) return;
2551
3156
  setProfile(next);
3157
+ void refresh();
2552
3158
  const key = `teamwork:team:${server}:${next.id}`;
2553
3159
  if (identity.current === key) return;
2554
3160
  identity.current = key;
@@ -2569,17 +3175,17 @@ function TeamworkPanel({ host: dsh }) {
2569
3175
  }
2570
3176
  saved ?? (saved = view?.team ?? null);
2571
3177
  const teams = latest.current?.teams ?? [];
2572
- const selected = saved && (saved === "all" || teams.some((t) => t.id === saved)) ? saved : teams.length === 1 ? teams[0].id : "all";
3178
+ const selected = saved && (saved === "all" || teams.some((t2) => t2.id === saved)) ? saved : teams.length === 1 ? teams[0].id : "all";
2573
3179
  setTeam(selected);
2574
3180
  if (saved === null && teams.length > 1) setPage("choose");
2575
3181
  }).catch((error) => {
2576
- if (!cancelled) setProfileError(error.message);
3182
+ if (!cancelled) setProfileError(error);
2577
3183
  });
2578
3184
  return () => {
2579
3185
  cancelled = true;
2580
3186
  };
2581
3187
  }, [authenticated, server, profileAttempt]);
2582
- (0, import_react4.useEffect)(() => {
3188
+ (0, import_react5.useEffect)(() => {
2583
3189
  if (profile && identity.current) views.set(identity.current, { team, tab, query });
2584
3190
  }, [profile, team, tab, query]);
2585
3191
  const navigate = (next) => {
@@ -2596,88 +3202,113 @@ function TeamworkPanel({ host: dsh }) {
2596
3202
  } catch {
2597
3203
  }
2598
3204
  };
2599
- (0, import_react4.useEffect)(() => {
2600
- if (state && team !== "all" && !state.teams.some((t) => t.id === team)) {
3205
+ (0, import_react5.useEffect)(() => {
3206
+ if (state && team !== "all" && !state.teams.some((t2) => t2.id === team)) {
2601
3207
  setTeam("all");
2602
3208
  setQuery("");
2603
3209
  if (profile) try {
2604
3210
  localStorage.setItem(`teamwork:team:${server}:${profile.id}`, "all");
2605
3211
  } catch {
2606
3212
  }
2607
- notify("当前团队已不可用,浏览范围已切换为全部团队。");
3213
+ notify(t("team.gone"));
2608
3214
  }
2609
3215
  }, [state?.teams, team]);
2610
- const notify = (0, import_react4.useCallback)((message, tone = "neutral") => {
3216
+ const notify = (0, import_react5.useCallback)((message, tone = "neutral") => {
2611
3217
  clearTimeout(toastTimer.current);
2612
3218
  setToast({ message, tone });
2613
3219
  toastTimer.current = setTimeout(() => setToast(void 0), tone === "danger" ? 6e3 : 3e3);
2614
3220
  }, []);
2615
- (0, import_react4.useEffect)(() => () => clearTimeout(toastTimer.current), []);
2616
- const run = (0, import_react4.useCallback)(async (action, done) => {
3221
+ (0, import_react5.useEffect)(() => () => clearTimeout(toastTimer.current), []);
3222
+ const run = (0, import_react5.useCallback)(async (action, done) => {
2617
3223
  try {
2618
3224
  const result = await action();
2619
3225
  const message = typeof done === "function" ? done(result) : done;
2620
3226
  if (message) notify(message);
2621
3227
  return true;
2622
3228
  } catch (error) {
2623
- notify(error.message, "danger");
3229
+ notify(describe(t, error), "danger");
2624
3230
  return false;
2625
3231
  } finally {
2626
3232
  await request.current;
2627
3233
  await refresh();
2628
3234
  }
2629
- }, [notify, refresh]);
3235
+ }, [notify, refresh, t]);
3236
+ const browsed = state?.authenticated ? state.teams.find((x) => x.id === team) : void 0;
3237
+ const summary = useSummary(browsed?.id, `${state?.server}:${state?.authRevision}`);
2630
3238
  const toastNode = toast && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Toast, { tone: toast.tone, children: toast.message });
3239
+ const retry = /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Button, { size: "sm", icon: "refresh", onClick: () => void refresh(), children: t("common.retry") });
2631
3240
  if (!state) {
2632
- return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Panel, { label: "Teamwork", header: loadError ? void 0 : /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(HeaderSkeleton, {}), children: loadError ? /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Banner, { tone: "danger", title: "无法读取团队状态", action: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Button, { size: "sm", icon: "refresh", onClick: () => void refresh(), children: "重试" }), children: loadError }) : /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(ListSkeleton, {}) });
3241
+ return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Words.Provider, { value: t, children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Panel, { label: "Teamwork", header: loadError ? void 0 : /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(HeaderSkeleton, {}), children: loadError ? /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Banner, { tone: "danger", title: t("load.failed"), action: retry, children: describe(t, loadError) }) : /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(ListSkeleton, {}) }) });
3242
+ }
3243
+ if (state.shared && !state.authenticated) {
3244
+ return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Words.Provider, { value: t, children: /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(Panel, { label: "Teamwork", children: [
3245
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Shared, { shared: state.shared, run }),
3246
+ toastNode
3247
+ ] }) });
2633
3248
  }
2634
3249
  if (!state.authenticated) {
2635
- return /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(Panel, { label: "Teamwork", centered: true, children: [
3250
+ return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Words.Provider, { value: t, children: /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(Panel, { label: "Teamwork", centered: true, children: [
2636
3251
  /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(SignIn, { state, run }),
2637
3252
  toastNode
2638
- ] });
3253
+ ] }) });
2639
3254
  }
2640
3255
  const inTeam = (item) => team === "all" || item.teamId === team;
2641
3256
  const matches = (item) => `${item.name} ${item.description ?? ""}`.toLocaleLowerCase().includes(query.toLocaleLowerCase());
2642
3257
  const presets = state.presets.filter(inTeam), models = state.models.filter(inTeam), plugins = state.plugins.filter(inTeam);
2643
- const tabs = [{ id: "presets", label: "预设", count: presets.length }, { id: "models", label: "模型", count: models.length }, { id: "plugins", label: "插件", count: plugins.length }];
3258
+ const assistants = query ? [] : presets.filter((p) => p.assistant);
3259
+ const listed = (tab === "presets" ? presets.filter((p) => !assistants.includes(p)) : tab === "models" ? models : plugins).filter(matches);
3260
+ const tabs = [{ id: "presets", label: t("tabs.presets"), count: presets.length }, { id: "models", label: t("tabs.models"), count: models.length }, { id: "plugins", label: t("tabs.plugins"), count: plugins.length }];
2644
3261
  const choosing = page === "choose" && state.teams.length > 1;
2645
- return /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(Panel, { label: "Teamwork", header: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Header, { state, page, team, selectTeam, navigate }), footer: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Footer, { state, team, run }), children: [
2646
- loadError && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Banner, { tone: "danger", title: "状态没有刷新", action: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Button, { size: "sm", icon: "refresh", onClick: () => void refresh(), children: "重试" }), children: loadError }),
2647
- state.sync.lastError && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Banner, { tone: "warning", title: "同步失败,正在使用上次同步的配置", action: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Button, { size: "sm", icon: "refresh", onClick: () => run(() => api.sync(), "团队配置已同步"), children: "重试" }), children: state.sync.lastError }),
2648
- page !== "resources" && !choosing && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Button, { variant: "ghost", size: "sm", onClick: () => navigate("resources"), children: "返回团队资源" }) }),
2649
- choosing ? /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(TeamChooser, { state, select: selectTeam }) : (page === "resources" || page === "choose") && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_jsx_runtime7.Fragment, { children: !state.teams.length ? /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(EmptyState, { icon: "layers", title: "账号已连接,接下来加入团队", action: /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: "twui-row", children: [
2650
- /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Button, { trailingIcon: "external", onClick: () => window.open(`${state.server}/teams`, "_blank", "noopener"), children: "加入或创建团队" }),
2651
- /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Button, { icon: "refresh", onClick: () => run(() => api.sync(), "团队列表已刷新"), children: "我已加入,刷新团队" })
2652
- ] }), children: "在网页中接受邀请或创建团队,完成后回来刷新。" }) : /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(import_jsx_runtime7.Fragment, { children: [
2653
- /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: "twui-resource-toolbar", children: [
2654
- /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Tabs, { label: "资源类型", items: tabs, value: tab, onChange: setTab }),
2655
- /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Input, { "aria-label": "搜索团队资源", placeholder: "搜索名称或用途", value: query, onChange: (e) => setQuery(e.target.value) })
2656
- ] }),
2657
- /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: "twui-resource-list", children: [
2658
- tab === "presets" && presets.filter(matches).map((p) => /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(PresetItem, { preset: p, state, dsh, run, onInstall: () => setTab("plugins") }, p.id)),
2659
- tab === "models" && models.filter(matches).map((m) => /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(ModelItem, { model: m, state, run }, m.id)),
2660
- tab === "plugins" && plugins.filter(matches).map((p) => /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(PluginItem, { plugin: p, run }, p.id)),
2661
- !(tab === "presets" ? presets : tab === "models" ? models : plugins).filter(matches).length && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(EmptyState, { icon: "layers", title: query ? "没有匹配的资源" : "这里还没有资源", children: query ? "试试其他关键词或切换团队。" : "管理员在网页发布后,资源会同步到这里。" })
2662
- ] }, `${team}:${tab}`)
2663
- ] }) }),
2664
- page === "devices" && /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(import_jsx_runtime7.Fragment, { children: [
2665
- /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(PageTitle, { title: "手机连接", children: "手机连接的是这台电脑上的 DSH,与当前浏览的团队无关。" }),
2666
- /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Phones, { state, run })
2667
- ] }),
2668
- page === "teams" && /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(import_jsx_runtime7.Fragment, { children: [
2669
- /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(PageTitle, { title: "我的团队", children: "浏览范围不会改变已有会话或手机配对。" }),
2670
- state.teams.map((t) => /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Item, { icon: "layers", title: t.name, tags: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Badge, { children: t.role === "admin" ? "管理员" : "成员" }), actions: /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(import_jsx_runtime7.Fragment, { children: [
2671
- /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Button, { onClick: () => selectTeam(t.id), children: "浏览资源" }),
2672
- /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Button, { variant: "ghost", trailingIcon: "external", onClick: () => window.open(t.consoleUrl, "_blank", "noopener"), children: t.role === "admin" ? "管理团队" : "查看团队" })
2673
- ] }) }, t.id)),
2674
- /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Button, { trailingIcon: "external", onClick: () => window.open(`${state.server}/teams`, "_blank", "noopener"), children: "加入或创建团队" }) })
2675
- ] }),
2676
- page === "profile" && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Account, { state, profile, error: profileError, retry: () => setProfileAttempt((n) => n + 1), updated: (next) => {
2677
- if (identity.current === `teamwork:team:${state.server}:${next.id}`) setProfile(next);
2678
- }, run }),
2679
- toastNode
2680
- ] });
3262
+ const teamLabel = (name) => team === "all" && state.teams.length > 1 ? name : void 0;
3263
+ return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Words.Provider, { value: t, children: /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(
3264
+ Panel,
3265
+ {
3266
+ label: "Teamwork",
3267
+ header: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Header, { state, page, team, reviews: browsed?.role === "admin" ? summary?.pendingReviews ?? 0 : 0, reviewUrl: browsed ? `${browsed.consoleUrl}/sharing` : "", selectTeam, navigate }),
3268
+ footer: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Footer, { state, budget: browsed ? summary === void 0 ? void 0 : summary?.budget ?? null : false, run }),
3269
+ children: [
3270
+ loadError !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Banner, { tone: "danger", title: t("load.stale"), action: retry, children: describe(t, loadError) }),
3271
+ state.sync.lastError && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Banner, { tone: "warning", title: t("sync.failedTitle"), action: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Button, { size: "sm", icon: "refresh", onClick: () => run(() => api.sync(), t("sync.done")), children: t("common.retry") }), children: t("sync.failedBody") }),
3272
+ page !== "resources" && !choosing && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Button, { variant: "ghost", size: "sm", onClick: () => navigate("resources"), children: t("common.back") }) }),
3273
+ choosing ? /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(TeamChooser, { state, select: selectTeam }) : (page === "resources" || page === "choose") && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_jsx_runtime7.Fragment, { children: !state.teams.length ? /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(EmptyState, { icon: "layers", title: t("noTeam.title"), action: /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: "twui-row", children: [
3274
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Button, { trailingIcon: "external", onClick: () => open(`${state.server}/teams`), children: t("noTeam.open") }),
3275
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Button, { icon: "refresh", onClick: () => run(() => api.sync(), t("noTeam.refreshed")), children: t("noTeam.refresh") })
3276
+ ] }), children: t("noTeam.body") }) : /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(import_jsx_runtime7.Fragment, { children: [
3277
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: "twui-resource-toolbar", children: [
3278
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Tabs, { label: t("tabs.label"), items: tabs, value: tab, onChange: setTab }),
3279
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Input, { "aria-label": t("search.label"), placeholder: t("search.placeholder"), value: query, onChange: (e) => setQuery(e.target.value) })
3280
+ ] }),
3281
+ tab === "presets" && assistants.map((p) => /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(AssistantItem, { preset: p, team: teamLabel(p.teamName), state, dsh, run }, p.id)),
3282
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: "twui-resource-list", children: [
3283
+ tab === "presets" && listed.map((p) => /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(PresetItem, { preset: p, team: teamLabel(p.teamName), state, dsh, run, onInstall: () => setTab("plugins") }, p.id)),
3284
+ tab === "models" && listed.map((m) => /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(ModelItem, { model: m, team: teamLabel(m.teamName), state, run }, m.id)),
3285
+ tab === "plugins" && listed.map((p) => /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(PluginItem, { plugin: p, team: teamLabel(p.teamName ?? ""), run }, p.id)),
3286
+ !listed.length && !(tab === "presets" && assistants.length) && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(EmptyState, { icon: "layers", title: query ? t("empty.noMatch") : t("empty.none"), children: query ? t("empty.noMatchBody") : t("empty.noneBody") })
3287
+ ] }, `${team}:${tab}`)
3288
+ ] }) }),
3289
+ page === "devices" && /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(import_jsx_runtime7.Fragment, { children: [
3290
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(PageTitle, { title: t("phones.title"), children: t("phones.body") }),
3291
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Phones, { state, run })
3292
+ ] }),
3293
+ page === "shared" && state.shared && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Shared, { shared: state.shared, run }),
3294
+ page === "teams" && /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(import_jsx_runtime7.Fragment, { children: [
3295
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(PageTitle, { title: t("teams.title"), children: t("teams.body") }),
3296
+ state.teams.map((x) => /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Item, { icon: "layers", title: x.name, tags: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Badge, { tone: x.role === "admin" ? "brand" : "neutral", children: role(t, x.role) }), actions: /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(import_jsx_runtime7.Fragment, { children: [
3297
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Button, { onClick: () => selectTeam(x.id), children: t("teams.browse") }),
3298
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Button, { variant: "ghost", trailingIcon: "external", onClick: () => open(x.consoleUrl), children: t(x.role === "admin" ? "teams.manage" : "teams.view") })
3299
+ ] }) }, x.id)),
3300
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Button, { trailingIcon: "external", onClick: () => open(`${state.server}/teams`), children: t("teams.joinOrCreate") }) })
3301
+ ] }),
3302
+ page === "profile" && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Account, { state, profile, error: profileError, retry: () => setProfileAttempt((n) => n + 1), updated: (next) => {
3303
+ if (identity.current === `teamwork:team:${state.server}:${next.id}`) {
3304
+ setProfile(next);
3305
+ void refresh();
3306
+ }
3307
+ }, run }),
3308
+ toastNode
3309
+ ]
3310
+ }
3311
+ ) });
2681
3312
  }
2682
3313
  function PageTitle({ title, children }) {
2683
3314
  return /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: "twui-stack", children: [
@@ -2686,25 +3317,27 @@ function PageTitle({ title, children }) {
2686
3317
  ] });
2687
3318
  }
2688
3319
  function TeamChooser({ state, select }) {
3320
+ const t = useT();
2689
3321
  return /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(import_jsx_runtime7.Fragment, { children: [
2690
- /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(PageTitle, { title: "先从哪个团队开始?", children: "选择资源的浏览范围;你也可以随时在页面顶部切换。" }),
2691
- state.teams.map((t) => /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Item, { icon: "layers", title: t.name, tags: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Badge, { children: t.role === "admin" ? "管理员" : "成员" }), actions: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Button, { onClick: () => select(t.id), children: "选择团队" }) }, t.id)),
2692
- /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Button, { variant: "primary", onClick: () => select("all"), children: "查看全部团队资源" }) })
3322
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(PageTitle, { title: t("choose.title"), children: t("choose.body") }),
3323
+ state.teams.map((x) => /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Item, { icon: "layers", title: x.name, tags: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Badge, { tone: x.role === "admin" ? "brand" : "neutral", children: role(t, x.role) }), actions: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Button, { onClick: () => select(x.id), children: t("choose.pick") }) }, x.id)),
3324
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Button, { variant: "primary", onClick: () => select("all"), children: t("choose.all") }) })
2693
3325
  ] });
2694
3326
  }
2695
3327
  function Account({ state, profile, error, retry, updated, run }) {
2696
- const [name, setName] = (0, import_react4.useState)("");
2697
- const [locale, setLocale] = (0, import_react4.useState)("zh-CN");
2698
- const [busy, setBusy] = (0, import_react4.useState)(false);
2699
- const [logoutConfirm, setLogoutConfirm] = (0, import_react4.useState)(false);
2700
- const [saveError, setSaveError] = (0, import_react4.useState)();
2701
- const saving = (0, import_react4.useRef)(false);
3328
+ const t = useT();
3329
+ const [name, setName] = (0, import_react5.useState)("");
3330
+ const [locale, setLocale] = (0, import_react5.useState)(t.locale);
3331
+ const [busy, setBusy] = (0, import_react5.useState)(false);
3332
+ const [logoutConfirm, setLogoutConfirm] = (0, import_react5.useState)(false);
3333
+ const [saveError, setSaveError] = (0, import_react5.useState)();
3334
+ const saving = (0, import_react5.useRef)(false);
2702
3335
  const key = profile ? `${state.server}:${profile.id}` : void 0;
2703
- const dirty = !!profile && (name.trim() !== (profile.name ?? "") || locale !== (profile.locale ?? "zh-CN"));
2704
- (0, import_react4.useEffect)(() => {
3336
+ const dirty = !!profile && (name.trim() !== (profile.name ?? "") || locale !== (profile.locale ?? t.locale));
3337
+ (0, import_react5.useEffect)(() => {
2705
3338
  const draft = key ? profileDrafts.get(key) : void 0;
2706
3339
  setName(draft?.name ?? profile?.name ?? "");
2707
- setLocale(draft?.locale ?? profile?.locale ?? "zh-CN");
3340
+ setLocale(draft?.locale ?? profile?.locale ?? t.locale);
2708
3341
  }, [key, profile?.name, profile?.locale]);
2709
3342
  const edit = (nextName, nextLocale) => {
2710
3343
  setName(nextName);
@@ -2723,51 +3356,52 @@ function Account({ state, profile, error, retry, updated, run }) {
2723
3356
  profileDrafts.delete(key);
2724
3357
  updated(next);
2725
3358
  } catch (error2) {
2726
- setSaveError(error2.message);
3359
+ setSaveError(error2);
2727
3360
  throw error2;
2728
3361
  }
2729
- }, "个人资料已保存");
3362
+ }, words(locale)("account.saved"));
2730
3363
  saving.current = false;
2731
3364
  setBusy(false);
2732
3365
  };
2733
3366
  return /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(import_jsx_runtime7.Fragment, { children: [
2734
- /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(PageTitle, { title: "我的账号", children: "管理你的 Teamwork 个人资料和这台 DSH 的连接。" }),
3367
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(PageTitle, { title: t("account.title"), children: t("account.body") }),
2735
3368
  /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: "twui-account-grid", children: [
2736
- /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("section", { className: "twui-stack", "aria-label": "个人资料", children: error ? /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Banner, { tone: "warning", title: "暂时无法读取个人资料", action: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Button, { onClick: retry, children: "重试" }), children: error }) : !profile ? /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(ListSkeleton, {}) : /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(import_jsx_runtime7.Fragment, { children: [
3369
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("section", { className: "twui-stack", "aria-label": t("account.profile"), children: error !== void 0 ? /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Banner, { tone: "warning", title: t("account.readFailed"), action: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Button, { onClick: retry, children: t("common.retry") }), children: describe(t, error) }) : !profile ? /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(ListSkeleton, {}) : /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(import_jsx_runtime7.Fragment, { children: [
2737
3370
  /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: "twui-row", style: { gap: 14 }, children: [
2738
3371
  /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Monogram, { text: profile.name || profile.email || "T", size: 44 }),
2739
3372
  /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { children: [
2740
- /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("h3", { children: profile.name || "Teamwork 用户" }),
2741
- /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("p", { className: "twui-muted", children: profile.email || "未设置邮箱" })
3373
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("h3", { children: profile.name || t("account.unnamed") }),
3374
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("p", { className: "twui-muted", children: profile.email || t("account.noEmail") })
2742
3375
  ] })
2743
3376
  ] }),
2744
3377
  /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("form", { className: "twui-stack", onSubmit: (e) => {
2745
3378
  e.preventDefault();
2746
3379
  void save();
2747
3380
  }, children: [
2748
- /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Field, { label: "显示名称", htmlFor: "teamwork-name", children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Input, { id: "teamwork-name", value: name, maxLength: 80, disabled: busy, onChange: (e) => edit(e.target.value, locale), autoComplete: "name" }) }),
2749
- /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Field, { label: "账号语言", htmlFor: "teamwork-locale", hint: "用于 Teamwork 网页和手机端;DSH 插件当前使用中文。", children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Select, { id: "teamwork-locale", label: "账号语言", value: locale, disabled: busy, onChange: (value) => edit(name, value), options: [{ value: "zh-CN", label: "简体中文" }, { value: "en", label: "English" }] }) }),
2750
- dirty && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("p", { className: "twui-subtle", children: "有未保存的修改,切换页面时会保留草稿。" }),
2751
- saveError && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Notice, { tone: "danger", children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { role: "alert", children: saveError }) }),
3381
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Field, { label: t("account.name"), htmlFor: "teamwork-name", children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Input, { id: "teamwork-name", value: name, maxLength: 80, disabled: busy, onChange: (e) => edit(e.target.value, locale), autoComplete: "name" }) }),
3382
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Field, { label: t("account.language"), htmlFor: "teamwork-locale", hint: t("account.languageHint"), children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Select, { id: "teamwork-locale", label: t("account.language"), value: locale, disabled: busy, onChange: (value) => edit(name, value), options: [{ value: "en", label: "English" }, { value: "zh-CN", label: "简体中文" }] }) }),
3383
+ dirty && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("p", { className: "twui-subtle", children: t("account.unsaved") }),
3384
+ saveError !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Notice, { tone: "danger", children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { role: "alert", children: describe(t, saveError) }) }),
2752
3385
  /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: "twui-row", children: [
2753
- /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Button, { type: "submit", variant: "primary", busy, disabled: !dirty, children: "保存资料" }),
3386
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Button, { type: "submit", variant: "primary", busy, disabled: !dirty, children: t("account.save") }),
2754
3387
  dirty && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Button, { variant: "ghost", disabled: busy, onClick: () => {
2755
3388
  if (key) profileDrafts.delete(key);
2756
3389
  setName(profile.name ?? "");
2757
- setLocale(profile.locale ?? "zh-CN");
3390
+ setLocale(profile.locale ?? t.locale);
2758
3391
  setSaveError(void 0);
2759
- }, children: "撤销修改" })
3392
+ }, children: t("account.discard") })
2760
3393
  ] })
2761
3394
  ] })
2762
3395
  ] }) }),
2763
- /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("section", { className: "twui-stack", "aria-label": "账号连接", children: [
2764
- /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("h3", { children: "账号与连接" }),
3396
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("section", { className: "twui-stack", "aria-label": t("account.connection"), children: [
3397
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("h3", { children: t("account.connection") }),
2765
3398
  /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(ServerSetting, { state, run }),
2766
- /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("p", { className: "twui-muted", children: "重启 DSH 后需要重新授权。退出会移除当前团队配置并断开手机中转;本地会话与已安装插件保留。" }),
2767
- /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Button, { variant: "ghost", icon: "logout", onClick: () => setLogoutConfirm(true), children: "退出此 DSH 的 Teamwork" }) }),
2768
- logoutConfirm && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Confirm, { title: "退出 Teamwork?", description: "运行中的团队模型请求可能受影响。手机将无法通过当前连接访问此 DSH。", confirmLabel: "确认退出", cancelLabel: "取消", busy, onCancel: () => setLogoutConfirm(false), onConfirm: async () => {
3399
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("p", { className: "twui-muted", children: t("account.restartNote") }),
3400
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Button, { variant: "ghost", icon: "logout", onClick: () => setLogoutConfirm(true), children: t("account.signOut") }) }),
3401
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(ShareEnable, { run, signedIn: true }),
3402
+ logoutConfirm && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Confirm, { title: t("account.signOutTitle"), description: t("account.signOutBody"), confirmLabel: t("account.signOutConfirm"), cancelLabel: t("common.cancel"), busy, onCancel: () => setLogoutConfirm(false), onConfirm: async () => {
2769
3403
  setBusy(true);
2770
- await run(() => api.logout(), "已退出 Teamwork");
3404
+ await run(() => api.logout(), t("account.signedOut"));
2771
3405
  setBusy(false);
2772
3406
  } })
2773
3407
  ] })
@@ -2775,18 +3409,19 @@ function Account({ state, profile, error, retry, updated, run }) {
2775
3409
  ] });
2776
3410
  }
2777
3411
  function SignIn({ state, run }) {
2778
- const [opened, setOpened] = (0, import_react4.useState)(null);
2779
- const [code, setCode] = (0, import_react4.useState)("");
2780
- const [busy, setBusy] = (0, import_react4.useState)(false);
2781
- const [error, setError] = (0, import_react4.useState)();
2782
- const [expired, setExpired] = (0, import_react4.useState)(false);
2783
- const locked = (0, import_react4.useRef)(false);
2784
- (0, import_react4.useEffect)(() => {
3412
+ const t = useT();
3413
+ const [opened, setOpened] = (0, import_react5.useState)(null);
3414
+ const [code, setCode] = (0, import_react5.useState)("");
3415
+ const [busy, setBusy] = (0, import_react5.useState)(false);
3416
+ const [error, setError] = (0, import_react5.useState)();
3417
+ const [expired, setExpired] = (0, import_react5.useState)(false);
3418
+ const locked = (0, import_react5.useRef)(false);
3419
+ (0, import_react5.useEffect)(() => {
2785
3420
  if (!opened) return;
2786
3421
  const timer = setTimeout(() => setExpired(true), Math.max(0, opened.expiresAt - Date.now()));
2787
3422
  return () => clearTimeout(timer);
2788
3423
  }, [opened]);
2789
- const open = async () => {
3424
+ const begin = async () => {
2790
3425
  if (locked.current) return;
2791
3426
  locked.current = true;
2792
3427
  setBusy(true);
@@ -2798,9 +3433,9 @@ function SignIn({ state, run }) {
2798
3433
  setOpened({ automatic, url, expiresAt: Date.now() + 10 * 60 * 1e3 });
2799
3434
  setExpired(false);
2800
3435
  setCode("");
2801
- window.open(url, "_blank", "noopener");
3436
+ open(url);
2802
3437
  } catch (failure) {
2803
- setError(failure.message);
3438
+ setError(failure);
2804
3439
  throw failure;
2805
3440
  }
2806
3441
  });
@@ -2819,10 +3454,10 @@ function SignIn({ state, run }) {
2819
3454
  try {
2820
3455
  await api.authorize(code.trim());
2821
3456
  } catch (failure) {
2822
- setError(failure.message);
3457
+ setError(failure);
2823
3458
  throw failure;
2824
3459
  }
2825
- }, "已授权,团队配置已同步");
3460
+ }, t("signIn.done"));
2826
3461
  } finally {
2827
3462
  locked.current = false;
2828
3463
  setBusy(false);
@@ -2832,7 +3467,7 @@ function SignIn({ state, run }) {
2832
3467
  e.preventDefault();
2833
3468
  if (code.trim()) void authorize();
2834
3469
  }, children: [
2835
- /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Field, { label: opened?.automatic ? "没有自动完成?粘贴网页上显示的那一行" : "网页上显示的那一行", htmlFor: "teamwork-code", children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
3470
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Field, { label: opened?.automatic ? t("signIn.pasteAuto") : t("signIn.paste"), htmlFor: "teamwork-code", children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
2836
3471
  Input,
2837
3472
  {
2838
3473
  id: "teamwork-code",
@@ -2846,38 +3481,39 @@ function SignIn({ state, run }) {
2846
3481
  autoFocus: !opened?.automatic
2847
3482
  }
2848
3483
  ) }),
2849
- /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Button, { type: "submit", variant: opened?.automatic ? "secondary" : "primary", size: "lg", block: true, busy, disabled: !code.trim() || expired, children: "完成授权" })
3484
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Button, { type: "submit", variant: opened?.automatic ? "secondary" : "primary", size: "lg", block: true, busy, disabled: !code.trim() || expired, children: t("signIn.finish") })
2850
3485
  ] });
2851
3486
  return /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { style: { width: "100%", maxWidth: 440, margin: "0 auto", display: "grid", gap: 24, padding: "24px 0" }, children: [
2852
3487
  /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { style: { display: "grid", justifyItems: "center", gap: 12, textAlign: "center" }, children: [
2853
3488
  /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(BrandMark, { size: 56, title: "DSH Teamwork" }),
2854
3489
  /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { style: { display: "grid", gap: 6 }, children: [
2855
- /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("h1", { style: { fontSize: 20, fontWeight: 650, letterSpacing: "-0.01em" }, children: state.teams.length ? "重新连接 Teamwork" : "登录 Teamwork" }),
2856
- /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("p", { className: "twui-muted", children: "团队的模型、预设和插件版本,一处发布,每位成员的 DSH 自动保持一致。" })
3490
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("h1", { style: { fontSize: 20, fontWeight: 650, letterSpacing: "-0.01em" }, children: state.teams.length ? t("signIn.reconnect") : t("signIn.title") }),
3491
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("p", { className: "twui-muted", children: t("signIn.lede") })
2857
3492
  ] })
2858
3493
  ] }),
2859
3494
  /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Card, { padding: 20, children: /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { style: { display: "grid", gap: 16 }, children: [
2860
3495
  /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("ol", { style: { listStyle: "none", margin: 0, padding: 0, display: "grid", gap: 10 }, children: [
2861
- /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Step, { n: 1, state: opened ? "done" : "active", children: "在浏览器中登录" }),
2862
- opened?.automatic === false ? /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Step, { n: 2, state: "active", children: "确认授权,把网页上显示的那一行粘贴到下方(两分钟内有效)" }) : /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Step, { n: 2, state: opened ? "active" : "todo", children: "确认授权,这里会自动完成登录" })
3496
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Step, { n: 1, state: opened ? "done" : "active", children: t("signIn.step1") }),
3497
+ opened?.automatic === false ? /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Step, { n: 2, state: "active", children: t("signIn.step2Paste") }) : /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Step, { n: 2, state: opened ? "active" : "todo", children: t("signIn.step2Auto") })
2863
3498
  ] }),
2864
- error && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Notice, { tone: "danger", children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { role: "alert", children: error }) }),
2865
- expired ? /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Banner, { tone: "warning", title: "本次登录等待已超时", action: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Button, { busy, onClick: () => void open(), children: "重新开始登录" }), children: "请重新打开授权页面,旧页面的授权码不能用于新的登录请求。" }) : opened ? /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(import_jsx_runtime7.Fragment, { children: [
2866
- opened.automatic && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("p", { role: "status", className: "twui-muted", children: "等待浏览器确认授权,完成后这里会自动进入团队资源。" }),
2867
- /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("a", { className: "twui-link", href: opened.url, target: "_blank", rel: "noopener noreferrer", children: "打开授权页面" }),
3499
+ error !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Notice, { tone: "danger", children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { role: "alert", children: describe(t, error) }) }),
3500
+ expired ? /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Banner, { tone: "warning", title: t("signIn.expiredTitle"), action: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Button, { busy, onClick: () => void begin(), children: t("signIn.restart") }), children: t("signIn.expiredBody") }) : opened ? /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(import_jsx_runtime7.Fragment, { children: [
3501
+ opened.automatic && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("p", { role: "status", className: "twui-muted", children: t("signIn.waiting") }),
3502
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("a", { className: "twui-link", href: opened.url, target: "_blank", rel: "noopener noreferrer", children: t("signIn.openPage") }),
2868
3503
  opened.automatic ? /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("details", { children: [
2869
- /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("summary", { className: "twui-link", children: "没有自动完成?使用授权码" }),
3504
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("summary", { className: "twui-link", children: t("signIn.useCode") }),
2870
3505
  /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("div", { style: { paddingTop: 12 }, children: pasteForm })
2871
3506
  ] }) : pasteForm,
2872
- /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Button, { variant: "ghost", size: "sm", busy, onClick: () => void open(), children: "重新开始登录" })
2873
- ] }) : /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Button, { variant: "primary", size: "lg", block: true, trailingIcon: "external", busy, onClick: () => void open(), children: "在浏览器中登录" })
3507
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Button, { variant: "ghost", size: "sm", busy, onClick: () => void begin(), children: t("signIn.restart") })
3508
+ ] }) : /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Button, { variant: "primary", size: "lg", block: true, trailingIcon: "external", busy, onClick: () => void begin(), children: t("signIn.start") })
2874
3509
  ] }) }),
2875
3510
  /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("ul", { style: { listStyle: "none", margin: 0, padding: 0, display: "grid", gap: 12 }, children: [
2876
- /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Point, { icon: "shield", title: "密钥留在服务器", children: "团队模型由服务器代为调用,provider 密钥不会下发到这台电脑。" }),
2877
- /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Point, { icon: "layers", title: "与本地配置并存", children: "团队配置作为独立条目加入,不覆盖你自己的模型和预设。" }),
2878
- /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Point, { icon: "sync", title: "自动保持最新", children: "每分钟同步一次;被移出团队后,下一次请求即失效。" })
3511
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Point, { icon: "shield", title: t("signIn.keysTitle"), children: t("signIn.keysBody") }),
3512
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Point, { icon: "layers", title: t("signIn.sideTitle"), children: t("signIn.sideBody") }),
3513
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Point, { icon: "sync", title: t("signIn.syncTitle"), children: t("signIn.syncBody") })
2879
3514
  ] }),
2880
- /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(ServerSetting, { state, run })
3515
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(ServerSetting, { state, run }),
3516
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(ShareEnable, { run, signedIn: false })
2881
3517
  ] });
2882
3518
  }
2883
3519
  function Step({ n, state, children }) {
@@ -2909,10 +3545,11 @@ function Point({ icon, title, children }) {
2909
3545
  ] });
2910
3546
  }
2911
3547
  function ServerSetting({ state, run }) {
2912
- const [editing, setEditing] = (0, import_react4.useState)(false);
2913
- const [value, setValue] = (0, import_react4.useState)(state.server);
2914
- const [error, setError] = (0, import_react4.useState)();
2915
- const [busy, setBusy] = (0, import_react4.useState)(false);
3548
+ const t = useT();
3549
+ const [editing, setEditing] = (0, import_react5.useState)(false);
3550
+ const [value, setValue] = (0, import_react5.useState)(state.server);
3551
+ const [error, setError] = (0, import_react5.useState)();
3552
+ const [busy, setBusy] = (0, import_react5.useState)(false);
2916
3553
  const isDefault = state.server === state.defaultServer;
2917
3554
  const save = async (server) => {
2918
3555
  setBusy(true);
@@ -2920,9 +3557,9 @@ function ServerSetting({ state, run }) {
2920
3557
  try {
2921
3558
  await api.setServer(server);
2922
3559
  setEditing(false);
2923
- await run(async () => void 0, server === null ? "已恢复为默认服务器" : "服务器已更改");
3560
+ await run(async () => void 0, server === null ? t("server.wasReset") : t("server.changed"));
2924
3561
  } catch (e) {
2925
- setError(e.message);
3562
+ setError(e);
2926
3563
  } finally {
2927
3564
  setBusy(false);
2928
3565
  }
@@ -2931,16 +3568,16 @@ function ServerSetting({ state, run }) {
2931
3568
  return /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: "twui-card", style: { display: "flex", alignItems: "center", gap: 12, padding: "12px 16px", boxShadow: "none" }, children: [
2932
3569
  /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { style: { color: "var(--twui-fg-subtle)" }, children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Icon, { name: "server", size: 16 }) }),
2933
3570
  /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { style: { flex: 1, minWidth: 0, display: "grid" }, children: [
2934
- /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { className: "twui-subtle", children: "服务器" }),
3571
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { className: "twui-subtle", children: t("server.label") }),
2935
3572
  /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("span", { className: "twui-row", style: { gap: 6 }, children: [
2936
3573
  /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { className: "twui-mono", style: { overflowWrap: "anywhere" }, children: host(state.server) }),
2937
- isDefault && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Badge, { tone: "accent", children: "官方服务" })
3574
+ isDefault && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Badge, { tone: "accent", children: t("common.officialService") })
2938
3575
  ] })
2939
3576
  ] }),
2940
3577
  /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Button, { size: "sm", onClick: () => {
2941
3578
  setValue(state.server);
2942
3579
  setEditing(true);
2943
- }, children: "更改" })
3580
+ }, children: t("server.change") })
2944
3581
  ] });
2945
3582
  }
2946
3583
  return /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(
@@ -2953,169 +3590,193 @@ function ServerSetting({ state, run }) {
2953
3590
  void save(value);
2954
3591
  },
2955
3592
  children: [
2956
- /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
2957
- Field,
3593
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Field, { label: t("server.field"), htmlFor: "teamwork-server", error: error === void 0 ? void 0 : describe(t, error), hint: t("server.hint"), children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
3594
+ Input,
2958
3595
  {
2959
- label: "服务器地址",
2960
- htmlFor: "teamwork-server",
2961
- error,
2962
- hint: "自建团队或本地开发时填写你的 DSH Teamwork 地址,例如 http://localhost:3800。更改后需要重新登录。",
2963
- children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
2964
- Input,
2965
- {
2966
- id: "teamwork-server",
2967
- className: "twui-mono",
2968
- value,
2969
- onChange: (e) => setValue(e.target.value),
2970
- "aria-invalid": error ? true : void 0,
2971
- autoComplete: "off",
2972
- spellCheck: false,
2973
- autoFocus: true
2974
- }
2975
- )
3596
+ id: "teamwork-server",
3597
+ className: "twui-mono",
3598
+ value,
3599
+ onChange: (e) => setValue(e.target.value),
3600
+ "aria-invalid": error !== void 0 ? true : void 0,
3601
+ autoComplete: "off",
3602
+ spellCheck: false,
3603
+ autoFocus: true
2976
3604
  }
2977
- ),
3605
+ ) }),
2978
3606
  /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: "twui-row", children: [
2979
- /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Button, { type: "submit", variant: "primary", size: "sm", busy, disabled: !value.trim() || value.trim() === state.server, children: state.authenticated ? "退出并更换服务器" : "保存" }),
3607
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Button, { type: "submit", variant: "primary", size: "sm", busy, disabled: !value.trim() || value.trim() === state.server, children: state.authenticated ? t("server.saveSignOut") : t("server.save") }),
2980
3608
  /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Button, { variant: "ghost", size: "sm", disabled: busy, onClick: () => {
2981
3609
  setEditing(false);
2982
3610
  setError(void 0);
2983
- }, children: "取消" }),
2984
- !isDefault && /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("button", { type: "button", className: "twui-link", style: { marginLeft: "auto", fontSize: 12 }, disabled: busy, onClick: () => void save(null), children: [
2985
- "恢复为 ",
2986
- host(state.defaultServer)
2987
- ] })
3611
+ }, children: t("common.cancel") }),
3612
+ !isDefault && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("button", { type: "button", className: "twui-link", style: { marginLeft: "auto", fontSize: 12 }, disabled: busy, onClick: () => void save(null), children: t("server.reset", { host: host(state.defaultServer) }) })
2988
3613
  ] })
2989
3614
  ]
2990
3615
  }
2991
3616
  );
2992
3617
  }
2993
- function Header({ state, page, team, selectTeam, navigate }) {
3618
+ function Header({ state, page, team, reviews, reviewUrl, selectTeam, navigate }) {
3619
+ const t = useT();
2994
3620
  const pending = state.phones.filter((p) => p.status === "pending").length;
2995
3621
  return /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(import_jsx_runtime7.Fragment, { children: [
2996
3622
  /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: "twui-brand-lockup", children: [
2997
- /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("button", { type: "button", className: "twui-brand-home", "aria-label": "返回团队资源", onClick: () => navigate("resources"), children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(BrandMark, { size: 32, title: "DSH Teamwork" }) }),
3623
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("button", { type: "button", className: "twui-brand-home", "aria-label": t("nav.home"), onClick: () => navigate("resources"), children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(BrandMark, { size: 32, title: "DSH Teamwork" }) }),
2998
3624
  /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: "twui-row twui-team-scope", children: [
2999
- /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Button, { variant: "ghost", onClick: () => navigate("teams"), children: "我的团队" }),
3625
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Button, { variant: "ghost", onClick: () => navigate("teams"), children: t("nav.teams") }),
3000
3626
  !!state.teams.length && /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(import_jsx_runtime7.Fragment, { children: [
3001
3627
  /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Icon, { name: "chevronRight", size: 14 }),
3002
- /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Select, { label: "选择团队", value: team, onActivate: () => navigate("resources"), onChange: selectTeam, options: [{ value: "all", label: "全部团队" }, ...state.teams.map((t) => ({ value: t.id, label: t.name, description: t.role === "admin" ? "管理员" : "成员" }))] })
3003
- ] })
3628
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Select, { label: t("nav.chooseTeam"), value: team, onActivate: () => navigate("resources"), onChange: selectTeam, options: [{ value: "all", label: t("common.allTeams") }, ...state.teams.map((x) => ({ value: x.id, label: x.name, description: role(t, x.role) }))] })
3629
+ ] }),
3630
+ state.teams.find((x) => x.id === team)?.role === "admin" && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Badge, { tone: "brand", children: t("common.admin") })
3004
3631
  ] })
3005
3632
  ] }),
3006
3633
  /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: "twui-row twui-header-actions", children: [
3007
- /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(Button, { variant: "ghost", icon: "smartphone", "aria-current": page === "devices" ? "page" : void 0, onClick: () => navigate("devices"), children: [
3008
- "手机连接",
3009
- pending ? ` · ${pending}` : ""
3634
+ reviews > 0 && /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(Button, { variant: "ghost", trailingIcon: "external", title: t("nav.reviewsHint"), onClick: () => open(reviewUrl), children: [
3635
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { className: "twui-signal-dot", "aria-hidden": "true" }),
3636
+ t("nav.reviews", { count: reviews })
3010
3637
  ] }),
3011
- /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Button, { variant: "ghost", icon: "settings", "aria-current": page === "profile" ? "page" : void 0, onClick: () => navigate("profile"), children: "我的账号" })
3638
+ state.shared ? (
3639
+ // A shared DSH has no person signed in and no phones of its own: its members, invites and key are on one page.
3640
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(Button, { variant: "ghost", icon: "server", "aria-current": page === "shared" ? "page" : void 0, onClick: () => navigate("shared"), children: [
3641
+ t("nav.shared"),
3642
+ state.shared.auditKey ? null : /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { className: "twui-signal-dot", "aria-hidden": "true" })
3643
+ ] })
3644
+ ) : /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(import_jsx_runtime7.Fragment, { children: [
3645
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(Button, { variant: "ghost", icon: "smartphone", "aria-current": page === "devices" ? "page" : void 0, onClick: () => navigate("devices"), children: [
3646
+ t("nav.phones"),
3647
+ pending ? /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(import_jsx_runtime7.Fragment, { children: [
3648
+ ` · ${pending}`,
3649
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { className: "twui-signal-dot", "aria-hidden": "true" })
3650
+ ] }) : null
3651
+ ] }),
3652
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Button, { variant: "ghost", icon: "settings", "aria-current": page === "profile" ? "page" : void 0, onClick: () => navigate("profile"), children: t("nav.account") })
3653
+ ] })
3012
3654
  ] })
3013
3655
  ] });
3014
3656
  }
3015
- function Quota({ team }) {
3016
- const [label, setLabel] = (0, import_react4.useState)("预算加载中…");
3017
- (0, import_react4.useEffect)(() => {
3018
- let active = true;
3019
- let timer;
3020
- const load = async () => {
3021
- let next = "预算暂不可用";
3022
- try {
3023
- const q = await api.quota(team);
3024
- next = q.exhausted ? "预算已用尽" : q.state === "unconfirmed" ? "预算待核实" : q.state === "known" && q.remaining !== null ? `预算剩余 ${q.remaining} 积分` : q.tokenLimited ? "已设 Token 上限" : "未设预算上限";
3025
- } catch {
3026
- }
3027
- if (active) {
3028
- setLabel(next);
3029
- timer = setTimeout(load, 3e4);
3030
- }
3031
- };
3032
- void load();
3033
- return () => {
3034
- active = false;
3035
- clearTimeout(timer);
3036
- };
3037
- }, [team]);
3038
- return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { className: "twui-footer-service", role: "status", title: "所选团队中我的预算;模型或上游仍可能有其他限制。切换资源团队不改变当前会话。", children: label });
3657
+ function Budget({ budget }) {
3658
+ const t = useT();
3659
+ const label = budget === void 0 ? t("budget.loading") : budget === null ? t("budget.unavailable") : budget.exhausted ? t("budget.exhausted") : budget.state === "unconfirmed" ? t("budget.unconfirmed") : budget.state === "known" && budget.remaining !== null ? t("budget.remaining", { points: budget.remaining }) : budget.tokenLimited ? t("budget.tokenLimited") : t("budget.unlimited");
3660
+ return /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("span", { className: "twui-footer-service", role: "status", title: t("budget.hint"), children: [
3661
+ budget?.exhausted && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { className: "twui-signal-dot", "aria-hidden": "true" }),
3662
+ label
3663
+ ] });
3039
3664
  }
3040
- function Footer({ state, team, run }) {
3041
- const [busy, setBusy] = (0, import_react4.useState)(false);
3665
+ function Footer({ state, budget, run }) {
3666
+ const t = useT();
3667
+ const [busy, setBusy] = (0, import_react5.useState)(false);
3042
3668
  return /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(import_jsx_runtime7.Fragment, { children: [
3043
3669
  /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: "twui-footer-identity", children: [
3044
3670
  /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { className: "twui-footer-name", children: "Teamwork" }),
3045
3671
  /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("span", { className: "twui-footer-service", title: state.server, children: [
3046
- state.server === state.defaultServer ? "官方服务" : host(state.server),
3047
- " · 本机 DSH"
3672
+ state.server === state.defaultServer ? t("common.officialService") : host(state.server),
3673
+ " · ",
3674
+ t("common.thisDsh")
3048
3675
  ] })
3049
3676
  ] }),
3050
3677
  /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: "twui-row twui-footer-actions", children: [
3051
- state.authenticated && state.teams.some((t) => t.id === team) && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Quota, { team }, `${state.server}:${state.authRevision}:${team}`),
3052
- /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { role: "status", children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Badge, { tone: state.sync.lastError ? "warning" : "success", dot: true, children: state.sync.running ? "正在同步…" : state.sync.lastError ? "同步失败" : synced(state.sync.lastSuccess) }) }),
3678
+ budget !== false && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Budget, { budget }),
3679
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { role: "status", children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Badge, { tone: state.sync.lastError ? "warning" : "success", dot: true, children: state.sync.running ? t("sync.running") : state.sync.lastError ? t("sync.failed") : synced(t, state.sync.lastSuccess) }) }),
3053
3680
  /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Button, { variant: "ghost", size: "sm", icon: "refresh", busy: busy || state.sync.running, onClick: async () => {
3054
3681
  setBusy(true);
3055
- await run(() => api.sync(), "团队配置已同步");
3682
+ await run(() => api.sync(), t("sync.done"));
3056
3683
  setBusy(false);
3057
- }, children: "刷新" })
3684
+ }, children: t("sync.refresh") })
3058
3685
  ] })
3059
3686
  ] });
3060
3687
  }
3061
- function PresetItem({ preset, state, dsh, run, onInstall }) {
3062
- const [open, setOpen] = (0, import_react4.useState)(false);
3688
+ function presetState(t, preset, state) {
3063
3689
  const missing = missingTools(preset);
3064
3690
  const plugins = pluginsNotReady(preset);
3065
3691
  const active = state.session?.preset?.id === preset.id;
3066
- const blocked = !preset.modelAvailable ? "预设引用的团队模型已不可用,请联系管理员。" : plugins.length ? `依赖插件 ${plugins.map((p) => p.name).join("、")} 尚未就绪。` : missing.length && state.session ? `缺少必需工具 ${missing.map((t) => t.name).join("、")},请在 DSH 插件管理器中安装或启用。` : void 0;
3067
- const useBlocked = blocked ?? (state.session?.started && !active ? "当前会话已开始对话,预设只能用在新会话里。" : void 0);
3068
- const ready = !blocked;
3692
+ const list = (names) => names.join(t("list.separator"));
3693
+ const blocked = !preset.modelAvailable ? preset.contextWindowMissing ? t("model.noContextWindow", { name: preset.model ?? "" }) : t("preset.modelGone") : plugins.length ? t("preset.pluginsNotReady", { plugins: list(plugins.map((p) => p.name)) }) : missing.length && state.session ? t("preset.toolsMissing", { tools: list(missing.map((x) => x.name)) }) : void 0;
3694
+ const useBlocked = blocked ?? (state.session?.started && !active ? t("preset.sessionStarted") : void 0);
3695
+ const blank = !!state.session && !state.session.started && !active;
3696
+ return { missing, plugins, active, blocked, useBlocked, blank };
3697
+ }
3698
+ function startSession(dsh, preset) {
3699
+ dsh.uiWorkspace.startSession(void 0, { agentPreset: `team:${preset.teamId}:${preset.id}` });
3700
+ dsh.layout.selectPanel(null);
3701
+ }
3702
+ function AssistantItem({ preset, team, state, dsh, run }) {
3703
+ const t = useT();
3704
+ const { active, blocked, useBlocked, blank } = presetState(t, preset, state);
3705
+ return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("div", { className: "twui-featured", children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
3706
+ Item,
3707
+ {
3708
+ icon: "session",
3709
+ title: /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(import_jsx_runtime7.Fragment, { children: [
3710
+ preset.name,
3711
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Badge, { tone: "brand", children: t("assistant.label") })
3712
+ ] }),
3713
+ subtitle: team,
3714
+ description: t("assistant.body"),
3715
+ tags: /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(import_jsx_runtime7.Fragment, { children: [
3716
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { className: "twui-subtle", children: t("assistant.examples") }),
3717
+ ["assistant.example1", "assistant.example2", "assistant.example3"].map((key) => /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Badge, { outline: true, children: t(key) }, key))
3718
+ ] }),
3719
+ actions: active ? /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Badge, { tone: "accent", dot: true, children: t("preset.inUse") }) : /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(import_jsx_runtime7.Fragment, { children: [
3720
+ blank && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Button, { size: "sm", disabled: useBlocked !== void 0, onClick: () => run(() => api.use(state.session.id, preset.id), t("preset.selected", { name: preset.name })), children: t("preset.useHere") }),
3721
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Button, { variant: "primary", size: "sm", icon: "plus", disabled: !!blocked, onClick: () => startSession(dsh, preset), children: t("assistant.ask") })
3722
+ ] }),
3723
+ notice: blocked ? /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Notice, { tone: "warning", children: blocked }) : void 0
3724
+ }
3725
+ ) });
3726
+ }
3727
+ function PresetItem({ preset, team, state, dsh, run, onInstall }) {
3728
+ const t = useT();
3729
+ const [expanded, setExpanded] = (0, import_react5.useState)(false);
3730
+ const { missing, plugins, active, blocked, useBlocked, blank } = presetState(t, preset, state);
3731
+ const model = preset.model ?? t("preset.sessionModel");
3069
3732
  return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
3070
3733
  Item,
3071
3734
  {
3072
3735
  icon: "layers",
3073
3736
  title: preset.name,
3074
- subtitle: preset.teamName,
3737
+ subtitle: team,
3075
3738
  description: preset.description || void 0,
3076
3739
  tags: /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(import_jsx_runtime7.Fragment, { children: [
3077
3740
  /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(Badge, { children: [
3078
3741
  /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Icon, { name: "cpu", size: 12 }),
3079
- preset.model
3742
+ model
3080
3743
  ] }),
3081
- active ? /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Badge, { tone: "accent", dot: true, children: "本会话正在使用" }) : ready ? /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Badge, { tone: !state.session && missing.length ? "neutral" : "success", dot: true, children: !state.session && missing.length ? "启动时检查工具" : "可以使用" }) : /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Badge, { tone: "warning", dot: true, children: "未就绪" })
3744
+ active ? /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Badge, { tone: "accent", dot: true, children: t("preset.inUse") }) : !blocked ? /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Badge, { tone: !state.session && missing.length ? "neutral" : "success", dot: true, children: !state.session && missing.length ? t("preset.checkOnStart") : t("preset.ready") }) : /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Badge, { tone: "warning", dot: true, children: t("preset.notReady") })
3082
3745
  ] }),
3083
3746
  actions: /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(import_jsx_runtime7.Fragment, { children: [
3084
- /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Button, { variant: "ghost", size: "sm", trailingIcon: open ? "chevronDown" : "chevronRight", "aria-expanded": open, onClick: () => setOpen(!open), children: "详情" }),
3085
- /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Button, { size: "sm", variant: !state.session || state.session.started ? "primary" : "secondary", icon: "plus", disabled: !ready, onClick: () => {
3086
- dsh.uiWorkspace.startSession(void 0, { agentPreset: `team:${preset.teamId}:${preset.id}` });
3087
- dsh.layout.selectPanel(null);
3088
- }, children: "新建会话" }),
3089
- !active && state.session && !state.session.started && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Button, { variant: "primary", size: "sm", disabled: useBlocked !== void 0, onClick: () => run(() => api.use(state.session.id, preset.id), (r) => r.message), children: "用于当前空白会话" })
3747
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Button, { variant: "ghost", size: "sm", trailingIcon: expanded ? "chevronDown" : "chevronRight", "aria-expanded": expanded, onClick: () => setExpanded(!expanded), children: t("preset.details") }),
3748
+ blank && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Button, { variant: "primary", size: "sm", disabled: useBlocked !== void 0, onClick: () => run(() => api.use(state.session.id, preset.id), t("preset.selected", { name: preset.name })), children: t("preset.useHere") }),
3749
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Button, { size: "sm", icon: "plus", disabled: !!blocked, onClick: () => startSession(dsh, preset), children: t("preset.newSession") })
3090
3750
  ] }),
3091
3751
  notice: useBlocked && !active ? /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: "twui-row", style: { gap: 6 }, children: [
3092
3752
  /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Notice, { tone: blocked ? "warning" : "neutral", children: useBlocked }),
3093
- plugins.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("button", { type: "button", className: "twui-link", style: { fontSize: 12 }, onClick: onInstall, children: "前往安装" })
3753
+ plugins.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("button", { type: "button", className: "twui-link", style: { fontSize: 12 }, onClick: onInstall, children: t("preset.goInstall") })
3094
3754
  ] }) : void 0,
3095
- children: open && /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(ItemBody, { children: [
3755
+ children: expanded && /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(ItemBody, { children: [
3096
3756
  /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(DefinitionList, { items: [
3097
- ["模型", preset.model],
3098
- ["工具", preset.tools.length ? /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { className: "twui-row", style: { gap: 6 }, children: preset.tools.map((t) => /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(Badge, { tone: toolText[t.state][1], title: t.required ? "必需" : "可选", children: [
3099
- /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { className: "twui-mono", children: t.name }),
3100
- t.required ? "" : " · 可选",
3757
+ [t("preset.model"), model],
3758
+ [t("preset.tools"), preset.tools.length ? /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { className: "twui-row", style: { gap: 6 }, children: preset.tools.map((x) => /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(Badge, { tone: toolText[x.state][1], title: x.required ? t("preset.required") : t("preset.optional"), children: [
3759
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { className: "twui-mono", children: x.name }),
3760
+ x.required ? "" : ` · ${t("preset.optional")}`,
3101
3761
  " · ",
3102
- toolText[t.state][0]
3103
- ] }, t.name)) }) : "无要求"],
3104
- ["依赖插件", preset.plugins.length ? /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { className: "twui-row", style: { gap: 6 }, children: preset.plugins.map((p) => /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(Badge, { tone: pluginText[p.state][1], children: [
3762
+ t(toolText[x.state][0])
3763
+ ] }, x.name)) }) : t("preset.noTools")],
3764
+ [t("preset.plugins"), preset.plugins.length ? /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { className: "twui-row", style: { gap: 6 }, children: preset.plugins.map((p) => /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(Badge, { tone: pluginText[p.state][1], children: [
3105
3765
  p.name,
3106
3766
  " @",
3107
3767
  p.version,
3108
3768
  " · ",
3109
- pluginText[p.state][0]
3110
- ] }, p.id)) }) : "无"],
3111
- ["版本", `v${preset.version},管理员发布新版本后下次同步生效`]
3769
+ t(pluginText[p.state][0])
3770
+ ] }, p.id)) }) : t("preset.noPlugins")],
3771
+ [t("preset.version"), t("preset.versionValue", { version: preset.version })]
3112
3772
  ] }),
3113
- /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("p", { className: "twui-subtle", children: "工具按当前会话检查;切换会话后和每次请求前都会重新检查。" })
3773
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("p", { className: "twui-subtle", children: t("preset.toolsNote") })
3114
3774
  ] })
3115
3775
  }
3116
3776
  );
3117
3777
  }
3118
- function ModelItem({ model, state, run }) {
3778
+ function ModelItem({ model, team, state, run }) {
3779
+ const t = useT();
3119
3780
  const s = state.session;
3120
3781
  const active = !!s?.model?.team && s.model.model === model.id;
3121
3782
  return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
@@ -3123,17 +3784,21 @@ function ModelItem({ model, state, run }) {
3123
3784
  {
3124
3785
  icon: "cpu",
3125
3786
  title: model.name,
3126
- subtitle: model.teamName,
3127
- description: "由团队服务器代为调用,provider 密钥留在服务器上。只改当前会话,不改本地默认模型。",
3128
- tags: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Badge, { children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { className: "twui-mono", children: model.upstream }) }),
3129
- actions: active ? /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Badge, { tone: "accent", dot: true, children: "本会话正在使用" }) : /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Button, { variant: "primary", size: "sm", disabled: !s, onClick: () => run(() => api.use(s.id, model.id), (r) => r.message), children: "用于当前会话" }),
3130
- notice: !s ? /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Notice, { children: "先在 DSH 新建或打开一个会话,再选择模型。" }) : void 0
3787
+ subtitle: team,
3788
+ description: t("model.body"),
3789
+ tags: /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(import_jsx_runtime7.Fragment, { children: [
3790
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Badge, { children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { className: "twui-mono", children: model.upstream }) }),
3791
+ model.contextWindowMissing && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Badge, { tone: "warning", dot: true, children: t("preset.notReady") })
3792
+ ] }),
3793
+ actions: active ? /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Badge, { tone: "accent", dot: true, children: t("preset.inUse") }) : /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Button, { size: "sm", disabled: !s || model.contextWindowMissing, onClick: () => run(() => api.use(s.id, model.id), t("preset.selected", { name: model.name })), children: t("model.use") }),
3794
+ notice: model.contextWindowMissing ? /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Notice, { tone: "warning", children: t("model.noContextWindow", { name: model.name }) }) : !s ? /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Notice, { children: t("model.openSession") }) : void 0
3131
3795
  }
3132
3796
  );
3133
3797
  }
3134
- function PluginItem({ plugin, run }) {
3135
- const [confirming, setConfirming] = (0, import_react4.useState)(false);
3136
- const [busy, setBusy] = (0, import_react4.useState)(false);
3798
+ function PluginItem({ plugin, team, run }) {
3799
+ const t = useT();
3800
+ const [confirming, setConfirming] = (0, import_react5.useState)(false);
3801
+ const [busy, setBusy] = (0, import_react5.useState)(false);
3137
3802
  const [label, tone] = pluginText[plugin.state];
3138
3803
  const spec = `${plugin.package ?? plugin.name}@${plugin.version}`;
3139
3804
  return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
@@ -3141,24 +3806,21 @@ function PluginItem({ plugin, run }) {
3141
3806
  {
3142
3807
  icon: "puzzle",
3143
3808
  title: plugin.name,
3144
- subtitle: plugin.teamName,
3809
+ subtitle: team || void 0,
3145
3810
  description: plugin.description || void 0,
3146
3811
  tags: /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(import_jsx_runtime7.Fragment, { children: [
3147
3812
  /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { className: "twui-subtle twui-mono", children: spec }),
3148
- /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Badge, { tone, dot: true, children: label }),
3149
- plugin.localVersion && plugin.localVersion !== plugin.version && /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(Badge, { children: [
3150
- "本地 ",
3151
- plugin.localVersion
3152
- ] })
3813
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Badge, { tone, dot: true, children: t(label) }),
3814
+ plugin.localVersion && plugin.localVersion !== plugin.version && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Badge, { children: t("plugin.local", { version: plugin.localVersion }) })
3153
3815
  ] }),
3154
- actions: plugin.state === "missing" ? !confirming && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Button, { variant: "primary", size: "sm", onClick: () => setConfirming(true), children: "安装" }) : /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { className: "twui-subtle", children: "在 DSH 插件管理器中管理" }),
3816
+ actions: plugin.state === "missing" ? !confirming && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Button, { size: "sm", onClick: () => setConfirming(true), children: t("plugin.install") }) : /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { className: "twui-subtle", children: t("plugin.managed") }),
3155
3817
  children: confirming && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
3156
3818
  Confirm,
3157
3819
  {
3158
- title: `安装并启用 ${spec}?`,
3159
- description: "这会在你的电脑上运行该插件的代码。版本由团队固定;已经装过的同名插件不会被覆盖。",
3160
- confirmLabel: "安装并启用",
3161
- cancelLabel: "取消",
3820
+ title: t("plugin.confirmTitle", { spec }),
3821
+ description: t("plugin.confirmBody"),
3822
+ confirmLabel: t("plugin.confirm"),
3823
+ cancelLabel: t("common.cancel"),
3162
3824
  busy,
3163
3825
  onCancel: () => setConfirming(false),
3164
3826
  onConfirm: async () => {
@@ -3192,29 +3854,30 @@ function ListSkeleton() {
3192
3854
  ] }, i)) });
3193
3855
  }
3194
3856
  var relayText = {
3195
- off: ["手机连接尚未开启", "请确认服务器提供手机中转服务,并且当前账号已加入团队。"],
3196
- connecting: ["正在连接中转服务…", "连上之后就可以在这里配对手机。"],
3197
- refused: ["中转服务拒绝了这台电脑", "登录可能已失效,或另一个 DSH 正以这台电脑的身份连接。退出后重新登录即可重试。"]
3857
+ off: ["relay.offTitle", "relay.offBody"],
3858
+ connecting: ["relay.connectingTitle", "relay.connectingBody"],
3859
+ refused: ["relay.refusedTitle", "relay.refusedBody"]
3198
3860
  };
3199
- var shortTime = (iso) => new Date(iso).toLocaleString("zh-CN", { month: "numeric", day: "numeric", hour: "2-digit", minute: "2-digit" });
3861
+ var shortTime = (t, iso) => new Date(iso).toLocaleString(t.locale, { month: "numeric", day: "numeric", hour: "2-digit", minute: "2-digit" });
3200
3862
  function Phones({ state, run }) {
3201
- const [offer, setOffer] = (0, import_react4.useState)();
3202
- const [revoking, setRevoking] = (0, import_react4.useState)();
3203
- const [busy, setBusy] = (0, import_react4.useState)();
3204
- const [error, setError] = (0, import_react4.useState)();
3205
- const [expired, setExpired] = (0, import_react4.useState)(false);
3206
- const locked = (0, import_react4.useRef)(false);
3863
+ const t = useT();
3864
+ const [offer, setOffer] = (0, import_react5.useState)();
3865
+ const [revoking, setRevoking] = (0, import_react5.useState)();
3866
+ const [busy, setBusy] = (0, import_react5.useState)();
3867
+ const [error, setError] = (0, import_react5.useState)();
3868
+ const [expired, setExpired] = (0, import_react5.useState)(false);
3869
+ const locked = (0, import_react5.useRef)(false);
3207
3870
  const pending = state.phones.filter((p) => p.status === "pending");
3208
3871
  const paired = state.phones.filter((p) => p.status === "confirmed");
3209
- const seen = (0, import_react4.useRef)(new Set(pending.map((p) => p.id)));
3210
- (0, import_react4.useEffect)(() => {
3872
+ const seen = (0, import_react5.useRef)(new Set(pending.map((p) => p.id)));
3873
+ (0, import_react5.useEffect)(() => {
3211
3874
  if (pending.some((p) => !seen.current.has(p.id))) {
3212
3875
  setOffer(void 0);
3213
3876
  setExpired(false);
3214
3877
  }
3215
3878
  seen.current = new Set(pending.map((p) => p.id));
3216
3879
  }, [state.phones]);
3217
- (0, import_react4.useEffect)(() => {
3880
+ (0, import_react5.useEffect)(() => {
3218
3881
  if (state.relay !== "connected") {
3219
3882
  setOffer(void 0);
3220
3883
  setExpired(false);
@@ -3230,7 +3893,7 @@ function Phones({ state, run }) {
3230
3893
  try {
3231
3894
  return await action();
3232
3895
  } catch (failure) {
3233
- setError(failure.message);
3896
+ setError(failure);
3234
3897
  throw failure;
3235
3898
  }
3236
3899
  }, done);
@@ -3245,11 +3908,11 @@ function Phones({ state, run }) {
3245
3908
  });
3246
3909
  if (state.relay !== "connected") {
3247
3910
  const [title, body] = relayText[state.relay];
3248
- return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Card, { children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(EmptyState, { icon: "smartphone", title, children: body }) });
3911
+ return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Card, { children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(EmptyState, { icon: "smartphone", title: t(title), children: t(body) }) });
3249
3912
  }
3250
3913
  return /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(import_jsx_runtime7.Fragment, { children: [
3251
- error && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Banner, { tone: "warning", title: "手机操作未完成", children: error }),
3252
- expired && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Banner, { tone: "warning", title: "配对码已过期", action: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Button, { busy: busy === "pair", disabled: !!busy, onClick: () => void pair(), children: "重新生成配对码" }), children: "配对码只能使用一次。重新生成后,请在手机上扫描新码。" }),
3914
+ error !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Banner, { tone: "warning", title: t("phones.failed"), children: describe(t, error) }),
3915
+ expired && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Banner, { tone: "warning", title: t("phones.expiredTitle"), action: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Button, { busy: busy === "pair", disabled: !!busy, onClick: () => void pair(), children: t("phones.newCode") }), children: t("phones.expiredBody") }),
3253
3916
  /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Card, { children: offer ? /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(PairingCode, { offer, onDone: () => setOffer(void 0), onExpire: () => {
3254
3917
  setOffer(void 0);
3255
3918
  setExpired(true);
@@ -3257,9 +3920,9 @@ function Phones({ state, run }) {
3257
3920
  EmptyState,
3258
3921
  {
3259
3922
  icon: "smartphone",
3260
- title: "在手机上操作这台电脑的 DSH",
3261
- action: !expired && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Button, { icon: "plus", busy: busy === "pair", disabled: !!busy, onClick: () => void pair(), children: "配对新手机" }),
3262
- children: "手机和电脑须登录同一个 Teamwork 账号。配对后可访问本机 DSH 有权限的个人与各团队会话,目前不能只授权一个团队;配对不会增加团队权限,任一端都可解除。"
3923
+ title: t("phones.emptyTitle"),
3924
+ action: !expired && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Button, { icon: "plus", busy: busy === "pair", disabled: !!busy, onClick: () => void pair(), children: t("phones.pair") }),
3925
+ children: t("phones.emptyBody")
3263
3926
  }
3264
3927
  ) }),
3265
3928
  pending.map((phone) => /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
@@ -3267,77 +3930,175 @@ function Phones({ state, run }) {
3267
3930
  {
3268
3931
  icon: "smartphone",
3269
3932
  title: phone.deviceName,
3270
- subtitle: `${shortTime(phone.createdAt)} 申请配对`,
3271
- tags: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Badge, { tone: "warning", dot: true, children: "等待你确认" }),
3272
- description: `${phone.safetyCode ? `安全码:${phone.safetyCode}。请核对手机上的安全码一致,并在手机上确认。` : "等待手机完成加密握手,暂时无法确认。"} 确认后,手机可查看本机 DSH 可访问的个人与各团队会话,发送消息、回答 Agent 提问和处理审批。目前不能只授权一个团队;配对不会增加团队权限,任一端都可解除。手机与电脑须登录同一账号。`,
3933
+ subtitle: t("phones.requested", { time: shortTime(t, phone.createdAt) }),
3934
+ tags: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Badge, { tone: "warning", dot: true, children: t("phones.waiting") }),
3935
+ description: `${phone.safetyCode ? t("phones.safetyCode", { code: phone.safetyCode }) : t("phones.handshake")} ${t("phones.grant")}`,
3273
3936
  actions: /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(import_jsx_runtime7.Fragment, { children: [
3274
- /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Button, { size: "sm", variant: "ghost", busy: busy === `reject:${phone.id}`, disabled: !!busy, onClick: () => void perform(`reject:${phone.id}`, () => api.decidePhone(phone.id, false), "已拒绝"), children: "拒绝" }),
3275
- /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Button, { size: "sm", busy: busy === `accept:${phone.id}`, disabled: !!busy || !phone.safetyCode || !phone.phoneConfirmed, onClick: () => void perform(`accept:${phone.id}`, () => api.decidePhone(phone.id, true), `${phone.deviceName} 已配对`), children: "安全码一致,确认配对" })
3937
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Button, { size: "sm", variant: "ghost", busy: busy === `reject:${phone.id}`, disabled: !!busy, onClick: () => void perform(`reject:${phone.id}`, () => api.decidePhone(phone.id, false), t("phones.rejected")), children: t("phones.reject") }),
3938
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Button, { size: "sm", busy: busy === `accept:${phone.id}`, disabled: !!busy || !phone.safetyCode || !phone.phoneConfirmed, onClick: () => void perform(`accept:${phone.id}`, () => api.decidePhone(phone.id, true), t("phones.accepted", { device: phone.deviceName })), children: t("phones.accept") })
3276
3939
  ] })
3277
3940
  },
3278
3941
  phone.id
3279
3942
  )),
3280
- /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("h3", { style: { fontSize: 15, fontWeight: 500 }, children: "已配对手机" }),
3281
- !paired.length && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("p", { className: "twui-muted", children: "尚无已配对手机。配对是可选功能,不影响团队资源的使用。" }),
3943
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("h3", { style: { fontSize: 15, fontWeight: 500 }, children: t("phones.paired") }),
3944
+ !paired.length && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("p", { className: "twui-muted", children: t("phones.none") }),
3282
3945
  paired.map((phone) => /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
3283
3946
  Item,
3284
3947
  {
3285
3948
  icon: "smartphone",
3286
3949
  title: phone.deviceName,
3287
- subtitle: phone.lastUsedAt ? `最近使用 ${shortTime(phone.lastUsedAt)}` : `配对于 ${shortTime(phone.createdAt)}`,
3288
- tags: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Badge, { tone: phone.verified ? "success" : "warning", dot: true, children: phone.verified ? "已验证加密设备" : "需要重新配对" }),
3289
- actions: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Button, { size: "sm", variant: "ghost", disabled: !!busy, onClick: () => setRevoking(phone), children: "解除配对" })
3950
+ subtitle: phone.lastUsedAt ? t("phones.lastUsed", { time: shortTime(t, phone.lastUsedAt) }) : t("phones.pairedAt", { time: shortTime(t, phone.createdAt) }),
3951
+ tags: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Badge, { tone: phone.verified ? "success" : "warning", dot: true, children: phone.verified ? t("phones.verified") : t("phones.repair") }),
3952
+ actions: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Button, { size: "sm", variant: "ghost", disabled: !!busy, onClick: () => setRevoking(phone), children: t("phones.unpair") })
3290
3953
  },
3291
3954
  phone.id
3292
3955
  )),
3293
3956
  revoking && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
3294
3957
  Confirm,
3295
3958
  {
3296
- title: `解除与 ${revoking.deviceName} 的配对?`,
3297
- description: "这台手机会立即断开,之后需要重新扫码配对才能再连到这台电脑。",
3298
- confirmLabel: "解除配对",
3299
- cancelLabel: "取消",
3959
+ title: t("phones.unpairTitle", { device: revoking.deviceName }),
3960
+ description: t("phones.unpairBody"),
3961
+ confirmLabel: t("phones.unpair"),
3962
+ cancelLabel: t("common.cancel"),
3300
3963
  busy: !!busy,
3301
3964
  onCancel: () => setRevoking(void 0),
3302
3965
  onConfirm: async () => {
3303
- if (await perform(`revoke:${revoking.id}`, () => api.revokePhone(revoking.id), "已解除配对")) setRevoking(void 0);
3966
+ if (await perform(`revoke:${revoking.id}`, () => api.revokePhone(revoking.id), t("phones.unpaired"))) setRevoking(void 0);
3304
3967
  }
3305
3968
  }
3306
3969
  )
3307
3970
  ] });
3308
3971
  }
3309
3972
  function PairingCode({ offer, onDone, onExpire }) {
3310
- const [now, setNow] = (0, import_react4.useState)(Date.now());
3311
- (0, import_react4.useEffect)(() => {
3973
+ const t = useT();
3974
+ const [now, setNow] = (0, import_react5.useState)(Date.now());
3975
+ (0, import_react5.useEffect)(() => {
3312
3976
  const timer = setInterval(() => setNow(Date.now()), 1e3);
3313
3977
  return () => clearInterval(timer);
3314
3978
  }, []);
3315
3979
  const left = Math.max(0, Math.round((Date.parse(offer.expiresAt) - now) / 1e3));
3316
- (0, import_react4.useEffect)(() => {
3980
+ (0, import_react5.useEffect)(() => {
3317
3981
  if (left === 0) onExpire();
3318
3982
  }, [left, onExpire]);
3319
3983
  return /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { style: { display: "flex", gap: 20, alignItems: "center", flexWrap: "wrap" }, children: [
3320
- /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(QrCode, { value: offer.link, size: 168 }),
3984
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(QrCode, { value: offer.link, size: 168, label: t("phones.qr") }),
3321
3985
  /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { style: { display: "grid", gap: 8, minWidth: 200, flex: "1 1 200px" }, children: [
3322
- /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("h2", { style: { fontSize: 15, fontWeight: 650 }, children: "用 DSH Teamwork App 扫码" }),
3323
- /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { className: "twui-subtle", children: "也可以在 App 里手动输入配对码:" }),
3986
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("h2", { style: { fontSize: 15, fontWeight: 650 }, children: t("phones.scan") }),
3987
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { className: "twui-subtle", children: t("phones.manual") }),
3324
3988
  /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("span", { className: "twui-mono", style: { fontSize: 20, letterSpacing: "0.12em" }, children: [
3325
3989
  offer.code.slice(0, 3),
3326
3990
  " ",
3327
3991
  offer.code.slice(3)
3328
3992
  ] }),
3329
- /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("span", { className: "twui-subtle", children: [
3330
- Math.floor(left / 60),
3331
- ":",
3332
- String(left % 60).padStart(2, "0"),
3333
- " 后失效,只能使用一次。扫码后请回到这里确认。"
3334
- ] }),
3335
- /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { className: "twui-subtle", children: "收起后,配对码在到期前仍然有效;手机提交后需在本机确认。" }),
3336
- /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Button, { size: "sm", variant: "ghost", onClick: onDone, children: "收起配对码" }) })
3993
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { className: "twui-subtle", children: t("phones.expires", { time: `${Math.floor(left / 60)}:${String(left % 60).padStart(2, "0")}` }) }),
3994
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { className: "twui-subtle", children: t("phones.collapsedNote") }),
3995
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Button, { size: "sm", variant: "ghost", onClick: onDone, children: t("phones.hide") }) })
3996
+ ] })
3997
+ ] });
3998
+ }
3999
+ function ShareEnable({ run, signedIn }) {
4000
+ const t = useT();
4001
+ const [key, setKey] = (0, import_react5.useState)("");
4002
+ const [busy, setBusy] = (0, import_react5.useState)(false);
4003
+ return /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("details", { children: [
4004
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("summary", { className: "twui-link", children: t("shared.enableTitle") }),
4005
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("form", { className: "twui-stack", style: { paddingTop: 12 }, onSubmit: async (e) => {
4006
+ e.preventDefault();
4007
+ setBusy(true);
4008
+ if (await run(() => api.shareEnable(key.trim()), t("shared.enabled"))) setKey("");
4009
+ setBusy(false);
4010
+ }, children: [
4011
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("p", { className: "twui-muted", children: t(signedIn ? "shared.enableBodySignedIn" : "shared.enableBody") }),
4012
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Field, { label: t("shared.hostKey"), htmlFor: "teamwork-host-key", children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Input, { id: "teamwork-host-key", className: "twui-mono", value: key, onChange: (e) => setKey(e.target.value), placeholder: "dshh_…", autoComplete: "off", spellCheck: false }) }),
4013
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Button, { type: "submit", busy, disabled: !key.trim(), children: t("shared.enable") }) })
4014
+ ] })
4015
+ ] });
4016
+ }
4017
+ function Shared({ shared, run }) {
4018
+ const t = useT();
4019
+ const [auditKey, setAuditKey] = (0, import_react5.useState)("");
4020
+ const [busy, setBusy] = (0, import_react5.useState)();
4021
+ const [invite, setInvite] = (0, import_react5.useState)();
4022
+ const [disabling, setDisabling] = (0, import_react5.useState)(false);
4023
+ const perform = async (id, action, done) => {
4024
+ setBusy(id);
4025
+ try {
4026
+ return await run(action, done);
4027
+ } finally {
4028
+ setBusy(void 0);
4029
+ }
4030
+ };
4031
+ return /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(import_jsx_runtime7.Fragment, { children: [
4032
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(PageTitle, { title: shared.name ?? t("shared.title"), children: shared.teamName ? t("shared.bodyTeam", { team: shared.teamName }) : t("shared.body") }),
4033
+ shared.error && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Banner, { tone: "danger", title: t("shared.keyFailed"), children: shared.error }),
4034
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("section", { className: "twui-stack", "aria-label": t("shared.auditTitle"), children: [
4035
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("h3", { children: t("shared.auditTitle") }),
4036
+ shared.auditKey ? /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("p", { className: "twui-muted", children: [
4037
+ t("shared.auditSet"),
4038
+ " ",
4039
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("span", { className: "twui-mono", children: [
4040
+ shared.auditKey.slice(0, 16),
4041
+ "…"
4042
+ ] })
4043
+ ] }) : /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Banner, { tone: "warning", title: t("shared.auditMissingTitle"), children: t("shared.auditMissingBody") }),
4044
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("form", { className: "twui-row", onSubmit: async (e) => {
4045
+ e.preventDefault();
4046
+ if (await perform("audit", () => api.shareAuditKey(auditKey.trim()), t("shared.auditSaved"))) setAuditKey("");
4047
+ }, children: [
4048
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Input, { "aria-label": t("shared.auditKey"), className: "twui-mono", value: auditKey, onChange: (e) => setAuditKey(e.target.value), placeholder: t("shared.auditPlaceholder"), autoComplete: "off", spellCheck: false }),
4049
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Button, { type: "submit", busy: busy === "audit", disabled: !!busy || !auditKey.trim(), children: shared.auditKey ? t("shared.auditReplace") : t("shared.auditSave") })
4050
+ ] })
4051
+ ] }),
4052
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("section", { className: "twui-stack", "aria-label": t("shared.membersTitle"), children: [
4053
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("h3", { children: t("shared.membersTitle") }),
4054
+ !shared.members.length && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("p", { className: "twui-muted", children: t("shared.noMembers") }),
4055
+ shared.members.map((m) => /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
4056
+ Item,
4057
+ {
4058
+ icon: "smartphone",
4059
+ title: m.email ?? m.userId,
4060
+ subtitle: m.devices.length ? m.devices.join(", ") : t("shared.noDevice"),
4061
+ tags: m.locked ? /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Badge, { tone: "warning", dot: true, children: t("shared.locked") }) : void 0,
4062
+ actions: /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(import_jsx_runtime7.Fragment, { children: [
4063
+ m.locked && m.email && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Button, { size: "sm", variant: "ghost", busy: busy === `unlock:${m.userId}`, disabled: !!busy, onClick: () => void perform(`unlock:${m.userId}`, () => api.shareUnlock(m.email), t("shared.unlocked", { email: m.email })), children: t("shared.unlock") }),
4064
+ m.email && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Button, { size: "sm", busy: busy === `invite:${m.userId}`, disabled: !!busy || !shared.auditKey, onClick: () => void perform(`invite:${m.userId}`, async () => setInvite({ email: m.email, ...await api.shareInvite(m.email) })), children: t("shared.invite") })
4065
+ ] })
4066
+ },
4067
+ m.userId
4068
+ ))
4069
+ ] }),
4070
+ invite && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Card, { padding: 16, children: /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: "twui-row", style: { alignItems: "flex-start", gap: 16 }, children: [
4071
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(QrCode, { value: invite.link, size: 168, label: t("shared.inviteQr") }),
4072
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: "twui-stack", children: [
4073
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("h3", { children: t("shared.inviteTitle", { email: invite.email }) }),
4074
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("p", { className: "twui-muted", children: t("shared.inviteBody") }),
4075
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("code", { className: "twui-mono", style: { wordBreak: "break-all", fontSize: 12 }, children: invite.link }),
4076
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: "twui-row", children: [
4077
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Button, { size: "sm", onClick: () => void navigator.clipboard?.writeText(invite.link).then(() => run(async () => void 0, t("shared.copied"))), children: t("shared.copy") }),
4078
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Button, { size: "sm", variant: "ghost", onClick: () => setInvite(void 0), children: t("phones.hide") })
4079
+ ] })
4080
+ ] })
4081
+ ] }) }),
4082
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("section", { className: "twui-stack", children: [
4083
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Button, { variant: "ghost", icon: "logout", disabled: !!busy, onClick: () => setDisabling(true), children: t("shared.disable") }) }),
4084
+ disabling && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
4085
+ Confirm,
4086
+ {
4087
+ title: t("shared.disableTitle"),
4088
+ description: t("shared.disableBody"),
4089
+ confirmLabel: t("shared.disable"),
4090
+ cancelLabel: t("common.cancel"),
4091
+ busy: busy === "disable",
4092
+ onCancel: () => setDisabling(false),
4093
+ onConfirm: async () => {
4094
+ if (await perform("disable", () => api.shareDisable(), t("shared.disabled"))) setDisabling(false);
4095
+ }
4096
+ }
4097
+ )
3337
4098
  ] })
3338
4099
  ] });
3339
4100
  }
3340
- function QrCode({ value, size }) {
4101
+ function QrCode({ value, size, label }) {
3341
4102
  const qr = qrcode_default(0, "M");
3342
4103
  qr.addData(value);
3343
4104
  qr.make();
@@ -3345,7 +4106,7 @@ function QrCode({ value, size }) {
3345
4106
  let d = "";
3346
4107
  for (let row = 0; row < count; row++) for (let col = 0; col < count; col++) if (qr.isDark(row, col)) d += `M${col + 4} ${row + 4}h1v1h-1z`;
3347
4108
  const extent = count + 8;
3348
- return /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("svg", { role: "img", "aria-label": "配对二维码", width: size, height: size, viewBox: `0 0 ${extent} ${extent}`, shapeRendering: "crispEdges", style: { borderRadius: 8, flex: "none" }, children: [
4109
+ return /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("svg", { role: "img", "aria-label": label, width: size, height: size, viewBox: `0 0 ${extent} ${extent}`, shapeRendering: "crispEdges", style: { borderRadius: 8, flex: "none" }, children: [
3349
4110
  /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("rect", { width: extent, height: extent, fill: "#ffffff" }),
3350
4111
  /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("path", { d, fill: "#000000" })
3351
4112
  ] });
@@ -3378,8 +4139,7 @@ function apply(ctx) {
3378
4139
  );
3379
4140
  ctx.slots.inject("main", () => ctx.slots.register({ name: "main", key: PANEL_ID }, () => /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(TeamworkPanel, { host: host2 })));
3380
4141
  }
3381
- var BRAND_MARK = "M206.84 178.37L203.20 176.51L197.50 174.07L191.54 172.04L185.35 170.41L178.93 169.17L172.31 168.32L165.50 167.86L158.53 167.77L151.41 168.06L144.16 168.72L136.80 169.75L129.35 171.13L121.82 172.87L114.23 174.96L109.15 176.54L98.77 180.09L95.30 181.17L90.18 182.60L86.83 183.42L81.88 184.48L77.03 185.31L72.29 185.93L67.65 186.34L61.63 186.57L57.23 186.50L51.52 186.10L47.35 185.57L41.96 184.58L36.75 183.26L31.71 181.62L34.49 185.76L37.47 189.81L40.64 193.76L44.00 197.60L47.54 201.33L51.26 204.95L55.15 208.44L59.21 211.81L63.44 215.04L67.84 218.14L72.39 221.10L77.09 223.91L81.95 226.57L86.95 229.08L94.72 232.53L102.79 235.59L111.15 238.26L119.80 240.51L125.70 241.78L134.78 243.30L140.96 244.06L144.09 244.36L173.55 246.46L180.99 247.20L187.94 248.12L194.39 249.29L200.32 250.79L203.07 251.68L205.68 252.68L209.32 254.39L212.63 256.39L215.59 258.72L218.18 261.38L219.71 263.37L223.20 305.34L228.75 306.83L233.12 307.74L237.50 308.33L241.25 308.55L245.00 308.50L249.38 308.10L253.75 307.35L258.75 306.16L268.56 303.21L246.40 256.22L246.73 253.74L247.28 251.31L248.06 248.95L249.61 245.50L250.90 243.25L252.39 241.04L254.06 238.85L255.91 236.70L257.94 234.56L260.13 232.43L264.98 228.19L270.41 223.93L277.92 218.50L302.38 201.94L304.94 200.12L309.92 196.37L317.01 190.52L321.49 186.47L327.85 180.20L333.75 173.71L339.20 167.02L344.20 160.15L347.28 155.48L350.15 150.75L352.81 145.96L355.27 141.12L357.52 136.24L359.57 131.33L361.40 126.38L363.02 121.41L364.43 116.42L365.63 111.42L366.61 106.41L367.38 101.41L367.94 96.41L368.27 91.43L364.74 95.37L360.88 99.12L356.71 102.68L353.38 105.22L348.64 108.41L344.87 110.67L339.54 113.49L335.33 115.45L330.91 117.29L326.31 118.98L321.50 120.54L318.18 121.50L313.04 122.82L309.49 123.63L298.73 125.74L293.54 126.91L285.93 128.90L278.54 131.16L271.39 133.69L264.50 136.48L257.89 139.53L253.65 141.71L249.55 144.00L245.59 146.40L239.93 150.20L236.35 152.87L232.93 155.65L228.12 160.01L225.13 163.04L222.32 166.18L218.46 171.06L215.04 176.17L212.07 181.49ZM0.00 299.31L6.29 300.81L19.95 304.97L27.09 306.81L30.85 307.55L34.71 308.11L38.64 308.45L42.44 308.56L45.78 308.48L49.55 308.17L52.80 307.74L56.57 307.06L60.13 306.25L63.75 305.29L76.43 301.42L80.87 300.19L85.96 299.11L90.20 298.63L92.48 298.57L95.22 298.67L97.56 298.92L100.48 299.40L106.29 300.81L119.95 304.97L126.98 306.78L130.85 307.55L134.55 308.09L137.85 308.40L141.64 308.56L145.61 308.49L149.55 308.17L153.42 307.64L157.20 306.93L160.85 306.07L164.44 305.10L179.80 300.47L183.48 299.58L186.92 298.96L190.65 298.61L194.30 298.61L198.04 298.98L202.57 299.84L194.87 271.11L192.61 271.07L189.26 271.14L185.49 271.44L182.24 271.86L178.58 272.51L174.89 273.34L171.27 274.29L157.98 278.34L153.04 279.67L149.99 280.33L147.56 280.72L144.76 280.99L142.48 281.06L140.20 281.00L137.40 280.73L134.98 280.35L131.93 279.70L127.00 278.38L113.68 274.32L109.51 273.23L105.83 272.42L102.03 271.77L98.93 271.39L95.61 271.14L92.44 271.07L88.64 271.18L84.71 271.52L80.85 272.08L77.09 272.82L69.95 274.66L55.73 278.98L49.99 280.33L47.09 280.78L44.76 280.99L42.48 281.06L39.73 280.97L35.96 280.52L31.93 279.70L27.57 278.54L16.42 275.11L10.94 273.58L5.08 272.28L0.00 271.51ZM284.83 299.31L289.73 298.66L292.48 298.57L295.69 298.71L299.01 299.13L302.00 299.72L305.73 300.65L319.95 304.97L327.09 306.81L330.85 307.55L334.71 308.11L338.64 308.45L342.44 308.56L345.78 308.48L349.71 308.16L353.42 307.64L357.31 306.90L364.44 305.10L379.25 300.61L382.97 299.69L385.96 299.11L389.73 298.66L392.93 298.57L396.15 298.75L400.00 299.31L400.00 271.51L395.61 271.14L390.85 271.08L386.27 271.36L381.47 271.98L377.09 272.82L372.66 273.91L367.92 275.26L357.41 278.50L352.52 279.80L347.56 280.72L345.22 280.96L342.93 281.06L340.65 281.02L338.34 280.84L335.96 280.52L332.97 279.94L327.57 278.54L316.46 275.13L311.57 273.75L306.45 272.55L301.11 271.64L297.98 271.30L294.99 271.12L289.43 271.13L283.78 271.64L277.70 272.69Z";
3382
4142
  function TeamIcon({ size, active }) {
3383
- return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("svg", { width: size, height: size, viewBox: "0 0 400 400", role: "img", "aria-label": "DSH Teamwork", style: { flex: "none", display: "block", color: active ? "var(--dsw-alias-state-business-primary)" : "inherit" }, children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("path", { fill: "currentColor", d: BRAND_MARK }) });
4143
+ return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("svg", { width: size, height: size, viewBox: "0 0 400 400", role: "img", "aria-label": "DSH Teamwork", style: { flex: "none", display: "block", color: active ? "var(--dsw-alias-state-business-primary)" : "inherit" }, children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("path", { fill: "currentColor", d: `${BRAND_FLUKE}${BRAND_SURFACE}${BRAND_SWELL}` }) });
3384
4144
  }
3385
4145
  return module.exports; } });