@arbidocs/blocks 0.5.22 → 0.5.24

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 (104) hide show
  1. package/dist/{WorkspaceTableView-6JVHGDUB.cjs → WorkspaceTableView-GIDGNGBW.cjs} +6 -6
  2. package/dist/{WorkspaceTableView-6JVHGDUB.cjs.map → WorkspaceTableView-GIDGNGBW.cjs.map} +1 -1
  3. package/dist/{WorkspaceTableView-ECPHGWHF.js → WorkspaceTableView-S2PTTVHL.js} +4 -4
  4. package/dist/{WorkspaceTableView-ECPHGWHF.js.map → WorkspaceTableView-S2PTTVHL.js.map} +1 -1
  5. package/dist/auth/index.cjs +47 -47
  6. package/dist/auth/index.js +2 -2
  7. package/dist/{chunk-7DDMF3DZ.cjs → chunk-53T2FY4Z.cjs} +5 -31
  8. package/dist/chunk-53T2FY4Z.cjs.map +1 -0
  9. package/dist/chunk-5ZBXFHZW.js +434 -0
  10. package/dist/chunk-5ZBXFHZW.js.map +1 -0
  11. package/dist/{chunk-K237IYOD.cjs → chunk-BYJUI4AT.cjs} +54 -2
  12. package/dist/chunk-BYJUI4AT.cjs.map +1 -0
  13. package/dist/{chunk-O4EQYPLO.cjs → chunk-C2SZQKX2.cjs} +169 -27
  14. package/dist/chunk-C2SZQKX2.cjs.map +1 -0
  15. package/dist/{chunk-MSPNYW6Z.cjs → chunk-DTLVC6MN.cjs} +2 -53
  16. package/dist/chunk-DTLVC6MN.cjs.map +1 -0
  17. package/dist/{chunk-RVKVGS72.js → chunk-FDUQQNDT.js} +2 -2
  18. package/dist/{chunk-RVKVGS72.js.map → chunk-FDUQQNDT.js.map} +1 -1
  19. package/dist/{chunk-TTJGCJWX.cjs → chunk-H3XAHVDT.cjs} +42 -2
  20. package/dist/chunk-H3XAHVDT.cjs.map +1 -0
  21. package/dist/{chunk-XL55UDLO.js → chunk-IJJKUTKM.js} +5 -30
  22. package/dist/chunk-IJJKUTKM.js.map +1 -0
  23. package/dist/{chunk-ZX663X3X.cjs → chunk-KNRAKOCO.cjs} +6 -428
  24. package/dist/chunk-KNRAKOCO.cjs.map +1 -0
  25. package/dist/chunk-KUQOHPKP.cjs +443 -0
  26. package/dist/chunk-KUQOHPKP.cjs.map +1 -0
  27. package/dist/{chunk-F2BYURQZ.cjs → chunk-LYF47OXX.cjs} +5 -5
  28. package/dist/{chunk-F2BYURQZ.cjs.map → chunk-LYF47OXX.cjs.map} +1 -1
  29. package/dist/{chunk-PZRTRYPD.js → chunk-MKTEVOC3.js} +44 -5
  30. package/dist/chunk-MKTEVOC3.js.map +1 -0
  31. package/dist/{chunk-6XW3CMU4.js → chunk-N3KNAQ55.js} +144 -4
  32. package/dist/chunk-N3KNAQ55.js.map +1 -0
  33. package/dist/{chunk-KL6XOSEN.js → chunk-PLAGIVFF.js} +4 -52
  34. package/dist/chunk-PLAGIVFF.js.map +1 -0
  35. package/dist/{chunk-FZVAJFRH.cjs → chunk-RHKFCSFC.cjs} +2 -2
  36. package/dist/{chunk-FZVAJFRH.cjs.map → chunk-RHKFCSFC.cjs.map} +1 -1
  37. package/dist/{chunk-NVRJ6WTR.js → chunk-RTAYJUQM.js} +3 -3
  38. package/dist/{chunk-NVRJ6WTR.js.map → chunk-RTAYJUQM.js.map} +1 -1
  39. package/dist/{chunk-IXBJEQH5.js → chunk-VN4FSGBR.js} +53 -4
  40. package/dist/chunk-VN4FSGBR.js.map +1 -0
  41. package/dist/{chunk-SLRVI2YU.js → chunk-X6U6L6BG.js} +29 -4
  42. package/dist/chunk-X6U6L6BG.js.map +1 -0
  43. package/dist/{chunk-SQ5F5BFW.cjs → chunk-XDU3HHUU.cjs} +32 -6
  44. package/dist/chunk-XDU3HHUU.cjs.map +1 -0
  45. package/dist/{chunk-SKVVOEMX.js → chunk-XXUPUXBF.js} +8 -423
  46. package/dist/chunk-XXUPUXBF.js.map +1 -0
  47. package/dist/connect/index.cjs +1203 -624
  48. package/dist/connect/index.cjs.map +1 -1
  49. package/dist/connect/index.js +770 -197
  50. package/dist/connect/index.js.map +1 -1
  51. package/dist/connection/auth/CompactLogin.d.ts +26 -0
  52. package/dist/connection/auth/ConnectedLoginPage.d.ts +9 -1
  53. package/dist/connection/auth/index.d.ts +3 -1
  54. package/dist/connection/auth/sso-popup.d.ts +13 -0
  55. package/dist/connection/auth/sso-sign-in.d.ts +38 -0
  56. package/dist/connection/auth/support.d.ts +17 -0
  57. package/dist/connection/auth/useLoginActions.d.ts +9 -2
  58. package/dist/connection/billing/ConnectedQuotaDialog.d.ts +5 -13
  59. package/dist/connection/billing/index.d.ts +1 -1
  60. package/dist/connection/connectors/ConnectedSharePointAdminConsentPage.d.ts +26 -0
  61. package/dist/connection/connectors/index.d.ts +1 -0
  62. package/dist/connection/projects/ConnectedProjectsPanel.d.ts +9 -1
  63. package/dist/connection/projects/ProjectsListPage.d.ts +40 -0
  64. package/dist/connection/projects/index.d.ts +1 -0
  65. package/dist/connection/settings-page/ConnectedAccountSettings.d.ts +2 -1
  66. package/dist/connection/settings-page/ConnectedBoxPortalSection.d.ts +6 -0
  67. package/dist/connection/settings-page/appearanceSection.d.ts +30 -0
  68. package/dist/connection/settings-page/index.d.ts +1 -0
  69. package/dist/index.cjs +209 -237
  70. package/dist/index.cjs.map +1 -1
  71. package/dist/index.d.ts +2 -0
  72. package/dist/index.js +11 -50
  73. package/dist/index.js.map +1 -1
  74. package/dist/settings/AppearanceSettings.d.ts +1 -2
  75. package/dist/settings/index.cjs +153 -153
  76. package/dist/settings/index.d.ts +2 -1
  77. package/dist/settings/index.js +1 -1
  78. package/dist/site/index.cjs +82 -74
  79. package/dist/site/index.d.ts +2 -0
  80. package/dist/site/index.js +3 -3
  81. package/dist/studio/index.cjs +73 -73
  82. package/dist/studio/index.js +5 -5
  83. package/dist/theme/appearance.d.ts +47 -0
  84. package/dist/theme/fromCss.d.ts +33 -0
  85. package/node_modules/@arbidocs/coedit/package.json +1 -1
  86. package/package.json +5 -5
  87. package/dist/chunk-6XW3CMU4.js.map +0 -1
  88. package/dist/chunk-7DDMF3DZ.cjs.map +0 -1
  89. package/dist/chunk-AMTWY22T.js +0 -11
  90. package/dist/chunk-AMTWY22T.js.map +0 -1
  91. package/dist/chunk-IXBJEQH5.js.map +0 -1
  92. package/dist/chunk-K237IYOD.cjs.map +0 -1
  93. package/dist/chunk-KL6XOSEN.js.map +0 -1
  94. package/dist/chunk-MSPNYW6Z.cjs.map +0 -1
  95. package/dist/chunk-O4EQYPLO.cjs.map +0 -1
  96. package/dist/chunk-PZRTRYPD.js.map +0 -1
  97. package/dist/chunk-SKVVOEMX.js.map +0 -1
  98. package/dist/chunk-SLRVI2YU.js.map +0 -1
  99. package/dist/chunk-SQ5F5BFW.cjs.map +0 -1
  100. package/dist/chunk-TTJGCJWX.cjs.map +0 -1
  101. package/dist/chunk-XL55UDLO.js.map +0 -1
  102. package/dist/chunk-ZU2B2RZK.cjs +0 -13
  103. package/dist/chunk-ZU2B2RZK.cjs.map +0 -1
  104. package/dist/chunk-ZX663X3X.cjs.map +0 -1
@@ -1,7 +1,7 @@
1
1
  "use client";
2
2
  'use strict';
3
3
 
4
- var chunkF2BYURQZ_cjs = require('../chunk-F2BYURQZ.cjs');
4
+ var chunkLYF47OXX_cjs = require('../chunk-LYF47OXX.cjs');
5
5
  var chunkKJVDYWAM_cjs = require('../chunk-KJVDYWAM.cjs');
6
6
  var chunkJUUOJP7I_cjs = require('../chunk-JUUOJP7I.cjs');
7
7
  var chunkPSIKUQYM_cjs = require('../chunk-PSIKUQYM.cjs');
@@ -9,7 +9,7 @@ var chunkYD3RN2FY_cjs = require('../chunk-YD3RN2FY.cjs');
9
9
  var chunkFCWS7I5C_cjs = require('../chunk-FCWS7I5C.cjs');
10
10
  var chunkOU3RGQFX_cjs = require('../chunk-OU3RGQFX.cjs');
11
11
  require('../chunk-UAEYU2NN.cjs');
12
- var chunkFZVAJFRH_cjs = require('../chunk-FZVAJFRH.cjs');
12
+ var chunkRHKFCSFC_cjs = require('../chunk-RHKFCSFC.cjs');
13
13
  var chunk7ZHPLTGK_cjs = require('../chunk-7ZHPLTGK.cjs');
14
14
  var chunkBL74GYSA_cjs = require('../chunk-BL74GYSA.cjs');
15
15
  var chunkWPOQLGKJ_cjs = require('../chunk-WPOQLGKJ.cjs');
@@ -23,13 +23,13 @@ require('../chunk-464YPRAE.cjs');
23
23
  require('../chunk-NML42O7Q.cjs');
24
24
  var chunk5FYU7ZIU_cjs = require('../chunk-5FYU7ZIU.cjs');
25
25
  require('../chunk-ZESMRGDV.cjs');
26
- var chunkTTJGCJWX_cjs = require('../chunk-TTJGCJWX.cjs');
26
+ var chunkH3XAHVDT_cjs = require('../chunk-H3XAHVDT.cjs');
27
27
  var chunkC2ECYOPP_cjs = require('../chunk-C2ECYOPP.cjs');
28
28
  var chunkGOWXP5KT_cjs = require('../chunk-GOWXP5KT.cjs');
29
29
  var chunkYBTKLOGG_cjs = require('../chunk-YBTKLOGG.cjs');
30
30
  var chunkQZTNTP75_cjs = require('../chunk-QZTNTP75.cjs');
31
- var chunkSQ5F5BFW_cjs = require('../chunk-SQ5F5BFW.cjs');
32
- require('../chunk-ZU2B2RZK.cjs');
31
+ var chunkXDU3HHUU_cjs = require('../chunk-XDU3HHUU.cjs');
32
+ var chunkKUQOHPKP_cjs = require('../chunk-KUQOHPKP.cjs');
33
33
  var chunkVPPX5XUF_cjs = require('../chunk-VPPX5XUF.cjs');
34
34
  require('../chunk-PCB2BPN3.cjs');
35
35
  require('../chunk-NWNVWO6L.cjs');
@@ -56,7 +56,7 @@ var chunk2EI7NCUA_cjs = require('../chunk-2EI7NCUA.cjs');
56
56
  require('../chunk-QW3SVHGM.cjs');
57
57
  var chunkLKK52DEY_cjs = require('../chunk-LKK52DEY.cjs');
58
58
  var chunkQVBZESYQ_cjs = require('../chunk-QVBZESYQ.cjs');
59
- var chunkK237IYOD_cjs = require('../chunk-K237IYOD.cjs');
59
+ var chunkBYJUI4AT_cjs = require('../chunk-BYJUI4AT.cjs');
60
60
  var chunkCG757WKY_cjs = require('../chunk-CG757WKY.cjs');
61
61
  var chunkW3PSIIMN_cjs = require('../chunk-W3PSIIMN.cjs');
62
62
  var chunkQUMUAJ2P_cjs = require('../chunk-QUMUAJ2P.cjs');
@@ -163,9 +163,9 @@ var ConnectedUserEntity = React7.memo(function ConnectedUserEntity2({
163
163
  if (isMe) openSettings();
164
164
  else openDirectChat?.(user.external_id);
165
165
  };
166
- const tooltipContent = /* @__PURE__ */ jsxRuntime.jsxs(chunkTTJGCJWX_cjs.EntityTooltip, { children: [
166
+ const tooltipContent = /* @__PURE__ */ jsxRuntime.jsxs(chunkH3XAHVDT_cjs.EntityTooltip, { children: [
167
167
  /* @__PURE__ */ jsxRuntime.jsx(
168
- chunkTTJGCJWX_cjs.EntityTooltipHeader,
168
+ chunkH3XAHVDT_cjs.EntityTooltipHeader,
169
169
  {
170
170
  lead: /* @__PURE__ */ jsxRuntime.jsxs(
171
171
  ui.Avatar,
@@ -196,13 +196,13 @@ var ConnectedUserEntity = React7.memo(function ConnectedUserEntity2({
196
196
  subtitle: user.email
197
197
  }
198
198
  ),
199
- userIsAgent && agentOwner && /* @__PURE__ */ jsxRuntime.jsx(chunkTTJGCJWX_cjs.EntityTooltipSection, { children: /* @__PURE__ */ jsxRuntime.jsxs(chunkTTJGCJWX_cjs.EntityTooltipHint, { icon: /* @__PURE__ */ jsxRuntime.jsx(react.ArbiBotHeadIcon, { className: "w-3.5 h-3.5 flex-shrink-0" }), children: [
199
+ userIsAgent && agentOwner && /* @__PURE__ */ jsxRuntime.jsx(chunkH3XAHVDT_cjs.EntityTooltipSection, { children: /* @__PURE__ */ jsxRuntime.jsxs(chunkH3XAHVDT_cjs.EntityTooltipHint, { icon: /* @__PURE__ */ jsxRuntime.jsx(react.ArbiBotHeadIcon, { className: "w-3.5 h-3.5 flex-shrink-0" }), children: [
200
200
  "Agent of",
201
201
  " ",
202
202
  /* @__PURE__ */ jsxRuntime.jsx("span", { className: "font-medium text-foreground", children: ui.getUserDisplayName(agentOwner) })
203
203
  ] }) }),
204
204
  sharedWorkspaces.length > 0 && /* @__PURE__ */ jsxRuntime.jsx(
205
- chunkTTJGCJWX_cjs.EntityTooltipSection,
205
+ chunkH3XAHVDT_cjs.EntityTooltipSection,
206
206
  {
207
207
  icon: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Users, { className: "w-3.5 h-3.5 flex-shrink-0" }),
208
208
  heading: "Shared Workspaces",
@@ -233,7 +233,7 @@ var ConnectedUserEntity = React7.memo(function ConnectedUserEntity2({
233
233
  ] })
234
234
  }
235
235
  ),
236
- interactive && variant === "pill" && canChat && /* @__PURE__ */ jsxRuntime.jsx(chunkTTJGCJWX_cjs.EntityTooltipHint, { isRuled: true, icon: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.MessageCircleMore, { className: "w-3 h-3" }), children: "Click to send message" })
236
+ interactive && variant === "pill" && canChat && /* @__PURE__ */ jsxRuntime.jsx(chunkH3XAHVDT_cjs.EntityTooltipHint, { isRuled: true, icon: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.MessageCircleMore, { className: "w-3 h-3" }), children: "Click to send message" })
237
237
  ] });
238
238
  return /* @__PURE__ */ jsxRuntime.jsx(
239
239
  ui.UserEntity,
@@ -368,7 +368,7 @@ function ConnectedWorkspaceActivity({
368
368
  [feed.data]
369
369
  );
370
370
  return /* @__PURE__ */ jsxRuntime.jsx(
371
- chunkTTJGCJWX_cjs.WorkspaceActivityList,
371
+ chunkH3XAHVDT_cjs.WorkspaceActivityList,
372
372
  {
373
373
  ...listProps,
374
374
  items,
@@ -1088,7 +1088,7 @@ function NotificationCenter({
1088
1088
  }
1089
1089
  ];
1090
1090
  return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col h-full bg-background", "data-testid": "notifications-page", children: [
1091
- /* @__PURE__ */ jsxRuntime.jsx(chunkFZVAJFRH_cjs.DraggableHeader, { children: /* @__PURE__ */ jsxRuntime.jsx(
1091
+ /* @__PURE__ */ jsxRuntime.jsx(chunkRHKFCSFC_cjs.DraggableHeader, { children: /* @__PURE__ */ jsxRuntime.jsx(
1092
1092
  chunkMEMWZ72Y_cjs.TabHeader,
1093
1093
  {
1094
1094
  tabs,
@@ -1401,7 +1401,7 @@ function ConnectedWorkspaceNotificationMenu({
1401
1401
  }, [error, notify17]);
1402
1402
  if (!workspaceId) return null;
1403
1403
  return /* @__PURE__ */ jsxRuntime.jsx(
1404
- chunkTTJGCJWX_cjs.WorkspaceNotificationMenu,
1404
+ chunkH3XAHVDT_cjs.WorkspaceNotificationMenu,
1405
1405
  {
1406
1406
  ...menuProps,
1407
1407
  level,
@@ -1420,7 +1420,7 @@ function ConnectedThreadFollow({
1420
1420
  enabled: live
1421
1421
  });
1422
1422
  if (!conversationId) return null;
1423
- const Control = as === "menu-item" ? chunkTTJGCJWX_cjs.ThreadFollowMenuItem : chunkTTJGCJWX_cjs.ThreadFollowButton;
1423
+ const Control = as === "menu-item" ? chunkH3XAHVDT_cjs.ThreadFollowMenuItem : chunkH3XAHVDT_cjs.ThreadFollowButton;
1424
1424
  return /* @__PURE__ */ jsxRuntime.jsx(
1425
1425
  Control,
1426
1426
  {
@@ -3217,10 +3217,10 @@ function cascadeTagCombination(tags, previous, next) {
3217
3217
  function tagCombinationMatches(combination, items) {
3218
3218
  if (!isCombining(combination)) return void 0;
3219
3219
  const pass = (list) => new Set(
3220
- chunkFZVAJFRH_cjs.applyInvertedIndexFilter(
3220
+ chunkRHKFCSFC_cjs.applyInvertedIndexFilter(
3221
3221
  [...list],
3222
3222
  combination,
3223
- chunkFZVAJFRH_cjs.buildInvertedIndex(
3223
+ chunkRHKFCSFC_cjs.buildInvertedIndex(
3224
3224
  [...list],
3225
3225
  (item) => item.id,
3226
3226
  (item) => item.tagIds
@@ -3337,7 +3337,7 @@ function ConnectedTagTable({
3337
3337
  const fail = (fallback) => (e) => notify17(browser.refusalReason(e, fallback), "error");
3338
3338
  const snapshot3 = (data) => {
3339
3339
  const title = exportTitle ?? ui.tagKindTitle(kind, { plural: true });
3340
- const bytes = chunkTTJGCJWX_cjs.tagTableDocx(data, {
3340
+ const bytes = chunkH3XAHVDT_cjs.tagTableDocx(data, {
3341
3341
  title,
3342
3342
  nameOf: (id) => people.find((p) => p.value === id)?.label
3343
3343
  });
@@ -3346,7 +3346,7 @@ function ConnectedTagTable({
3346
3346
  return { blob: new Blob([bytes], { type: chunkJIOHDVWH_cjs.DOCX_MIME_TYPE }), name };
3347
3347
  };
3348
3348
  return /* @__PURE__ */ jsxRuntime.jsx(
3349
- chunkTTJGCJWX_cjs.TagTable,
3349
+ chunkH3XAHVDT_cjs.TagTable,
3350
3350
  {
3351
3351
  ...props,
3352
3352
  table,
@@ -3484,9 +3484,9 @@ function GlossaryExport({ labelId, nameOf }) {
3484
3484
  const narrowed = agreements.find((a) => a.id === narrowTo);
3485
3485
  const title = narrowed ? `Glossary - ${narrowed.name}` : "Glossary";
3486
3486
  const download = (format) => {
3487
- const entries = chunkTTJGCJWX_cjs.glossaryEntries(sources, { labelId: narrowed?.id });
3488
- const blob = format === "docx" ? new Blob([chunkTTJGCJWX_cjs.glossaryDocx(entries, { title })], { type: chunkJIOHDVWH_cjs.DOCX_MIME_TYPE }) : new Blob([chunkTTJGCJWX_cjs.glossaryMarkdown(entries, { title })], { type: "text/markdown" });
3489
- documentTools.downloadBlob(blob, chunkTTJGCJWX_cjs.glossaryFileName(title, format));
3487
+ const entries = chunkH3XAHVDT_cjs.glossaryEntries(sources, { labelId: narrowed?.id });
3488
+ const blob = format === "docx" ? new Blob([chunkH3XAHVDT_cjs.glossaryDocx(entries, { title })], { type: chunkJIOHDVWH_cjs.DOCX_MIME_TYPE }) : new Blob([chunkH3XAHVDT_cjs.glossaryMarkdown(entries, { title })], { type: "text/markdown" });
3489
+ documentTools.downloadBlob(blob, chunkH3XAHVDT_cjs.glossaryFileName(title, format));
3490
3490
  };
3491
3491
  return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2", "data-testid": "tags-glossary", children: [
3492
3492
  agreements.length > 0 && /* @__PURE__ */ jsxRuntime.jsxs(
@@ -4272,7 +4272,7 @@ var DocumentSharedCell = React7.memo(function DocumentSharedCell2({
4272
4272
  [document2.external_id, onToggle]
4273
4273
  );
4274
4274
  return /* @__PURE__ */ jsxRuntime.jsx(
4275
- chunkTTJGCJWX_cjs.SharedCell,
4275
+ chunkH3XAHVDT_cjs.SharedCell,
4276
4276
  {
4277
4277
  item: document2,
4278
4278
  onToggle: handleToggle,
@@ -4855,7 +4855,7 @@ function TagFilterChips({
4855
4855
  const name = (id) => tags.find((t) => t.external_id === id)?.name ?? id;
4856
4856
  return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-wrap items-center gap-1.5", "data-testid": "tags-filter-chips", children: [
4857
4857
  set2.map(([id, state]) => /* @__PURE__ */ jsxRuntime.jsx(
4858
- chunkFZVAJFRH_cjs.FilterChip,
4858
+ chunkRHKFCSFC_cjs.FilterChip,
4859
4859
  {
4860
4860
  label: name(id),
4861
4861
  state,
@@ -4983,7 +4983,7 @@ function KindSection({
4983
4983
  {
4984
4984
  testId: `tags-kind-${kind}`,
4985
4985
  title: ui.tagKindTitle(kind, { plural: true }),
4986
- description: chunkTTJGCJWX_cjs.tagKindDescription(kind),
4986
+ description: chunkH3XAHVDT_cjs.tagKindDescription(kind),
4987
4987
  actions: picker,
4988
4988
  children: [
4989
4989
  browser.isEntityTag({ kind }) && extractingCount > 0 && /* @__PURE__ */ jsxRuntime.jsxs(
@@ -4994,9 +4994,9 @@ function KindSection({
4994
4994
  children: [
4995
4995
  /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Loader2, { className: "size-4 animate-spin" }),
4996
4996
  "Extracting ",
4997
- chunkTTJGCJWX_cjs.entitiesPhrase().toLowerCase(),
4997
+ chunkH3XAHVDT_cjs.entitiesPhrase().toLowerCase(),
4998
4998
  " from ",
4999
- chunkTTJGCJWX_cjs.documentCount(extractingCount),
4999
+ chunkH3XAHVDT_cjs.documentCount(extractingCount),
5000
5000
  "\u2026"
5001
5001
  ]
5002
5002
  }
@@ -5014,7 +5014,7 @@ function KindSection({
5014
5014
  onOpenDocument: (id) => openDocument(id),
5015
5015
  onOpenFact: ctx.onOpenFact,
5016
5016
  onOpenThread: (id) => openConversation(id),
5017
- labels: chunkTTJGCJWX_cjs.tagTableLabels(kind),
5017
+ labels: chunkH3XAHVDT_cjs.tagTableLabels(kind),
5018
5018
  testId: `tags-table-${kind}`
5019
5019
  }
5020
5020
  )
@@ -5116,12 +5116,12 @@ function TagSection({
5116
5116
  onOpenDocument: (id) => openDocument(id),
5117
5117
  onOpenFact: ctx.onOpenFact,
5118
5118
  onOpenThread: (id) => openConversation(id),
5119
- labels: chunkTTJGCJWX_cjs.tagTableLabels(tag.kind),
5119
+ labels: chunkH3XAHVDT_cjs.tagTableLabels(tag.kind),
5120
5120
  testId: "tags-rows"
5121
5121
  }
5122
5122
  ),
5123
5123
  /* @__PURE__ */ jsxRuntime.jsx(
5124
- chunkTTJGCJWX_cjs.TagDetail,
5124
+ chunkH3XAHVDT_cjs.TagDetail,
5125
5125
  {
5126
5126
  row: detailRow && narrowTagRow(detailRow, ctx.filter.matches),
5127
5127
  fields: schema.data?.fields ?? [],
@@ -5133,10 +5133,10 @@ function TagSection({
5133
5133
  onOpenDocument: (id) => openDocument(id),
5134
5134
  onOpenFact: ctx.onOpenFact,
5135
5135
  onOpenThread: (id) => openConversation(id),
5136
- noteLabel: chunkTTJGCJWX_cjs.tagNoteLabel(tag.kind),
5136
+ noteLabel: chunkH3XAHVDT_cjs.tagNoteLabel(tag.kind),
5137
5137
  noteIsValue: tag.kind === "annotation",
5138
5138
  renderPassages: (d, label) => renderPassages(d.doc_ext_id, label),
5139
- labels: chunkTTJGCJWX_cjs.tagDetailLabels(),
5139
+ labels: chunkH3XAHVDT_cjs.tagDetailLabels(),
5140
5140
  testId: "tags-detail"
5141
5141
  }
5142
5142
  )
@@ -5224,7 +5224,7 @@ function ConnectedTagsPage({
5224
5224
  const onDelete = async (t) => {
5225
5225
  const nested = browser.getChildTags([...tags], t.external_id);
5226
5226
  const uses = browser.tagUseCount(t);
5227
- const n2 = chunkTTJGCJWX_cjs.tagsPageNouns();
5227
+ const n2 = chunkH3XAHVDT_cjs.tagsPageNouns();
5228
5228
  const tagNoun = (count2) => (count2 === 1 ? n2.tag : n2.tags).toLowerCase();
5229
5229
  const carriers = uses === 1 ? `${n2.document}, ${n2.fact} or ${n2.thread}` : `${n2.documents}, ${n2.facts} and ${n2.threads}`;
5230
5230
  const message = `Delete ${ui.tagKindNouns(t.kind).singular} "${t.name}"?` + (uses > 0 ? `
@@ -5245,16 +5245,16 @@ ${nested.length} nested ${tagNoun(nested.length)} ${nested.length === 1 ? "moves
5245
5245
  try {
5246
5246
  await extract.mutateAsync(docIds);
5247
5247
  notify17(
5248
- `Extracting ${chunkTTJGCJWX_cjs.entitiesPhrase().toLowerCase()} from ${chunkTTJGCJWX_cjs.documentCount(docIds.length)}. You will be notified when it is done.`,
5248
+ `Extracting ${chunkH3XAHVDT_cjs.entitiesPhrase().toLowerCase()} from ${chunkH3XAHVDT_cjs.documentCount(docIds.length)}. You will be notified when it is done.`,
5249
5249
  "info"
5250
5250
  );
5251
5251
  } catch (error) {
5252
- notify17(browser.refusalReason(error, `Could not extract ${chunkTTJGCJWX_cjs.entitiesPhrase().toLowerCase()}`), "error");
5252
+ notify17(browser.refusalReason(error, `Could not extract ${chunkH3XAHVDT_cjs.entitiesPhrase().toLowerCase()}`), "error");
5253
5253
  throw error;
5254
5254
  }
5255
5255
  };
5256
5256
  const picker = /* @__PURE__ */ jsxRuntime.jsx(
5257
- chunkTTJGCJWX_cjs.TagPicker,
5257
+ chunkH3XAHVDT_cjs.TagPicker,
5258
5258
  {
5259
5259
  tags: viewTags,
5260
5260
  selectedId: tag?.external_id,
@@ -5268,10 +5268,10 @@ ${nested.length} nested ${tagNoun(nested.length)} ${nested.length === 1 ? "moves
5268
5268
  onOpenTag: openTag,
5269
5269
  onOpenFact
5270
5270
  };
5271
- const n = chunkTTJGCJWX_cjs.tagsPageNouns();
5271
+ const n = chunkH3XAHVDT_cjs.tagsPageNouns();
5272
5272
  const action = view === "person" || view === "organisation" ? {
5273
5273
  label: "Extract",
5274
- title: `Extract ${chunkTTJGCJWX_cjs.entitiesPhrase().toLowerCase()} from ${n.documents.toLowerCase()}`,
5274
+ title: `Extract ${chunkH3XAHVDT_cjs.entitiesPhrase().toLowerCase()} from ${n.documents.toLowerCase()}`,
5275
5275
  icon: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Sparkles, { className: "h-4 w-4" }),
5276
5276
  run: () => setExtracting(true),
5277
5277
  testId: "tags-extract-entities"
@@ -5421,7 +5421,7 @@ ${nested.length} nested ${tagNoun(nested.length)} ${nested.length === 1 ? "moves
5421
5421
  }
5422
5422
  ),
5423
5423
  /* @__PURE__ */ jsxRuntime.jsx(
5424
- chunkTTJGCJWX_cjs.ExtractEntitiesDialog,
5424
+ chunkH3XAHVDT_cjs.ExtractEntitiesDialog,
5425
5425
  {
5426
5426
  open: extracting,
5427
5427
  onOpenChange: setExtracting,
@@ -6118,10 +6118,10 @@ function useFactFilters(notes, view, chat) {
6118
6118
  const factFilters = view.filters;
6119
6119
  const setFactFilters = view.setFilters;
6120
6120
  const quickFilteredNotes = React7.useMemo(
6121
- () => chunkFZVAJFRH_cjs.applyInvertedIndexFilter(
6121
+ () => chunkRHKFCSFC_cjs.applyInvertedIndexFilter(
6122
6122
  notes,
6123
6123
  factFilters,
6124
- chunkFZVAJFRH_cjs.buildInvertedIndex(
6124
+ chunkRHKFCSFC_cjs.buildInvertedIndex(
6125
6125
  notes,
6126
6126
  (f) => f.external_id,
6127
6127
  (f) => Object.entries(getFactFilterAttributes(f)).filter(([id, on]) => on && factFilterIds.includes(id)).map(([id]) => id)
@@ -7424,7 +7424,7 @@ function ConnectedFactsPage({
7424
7424
  onNewFact: composing && !editingId ? () => void 0 : composer.startNewFact,
7425
7425
  navSlotRef: setNavSlot,
7426
7426
  navigator: view === "table" ? /* @__PURE__ */ jsxRuntime.jsx(
7427
- chunkTTJGCJWX_cjs.GridRowNavigator,
7427
+ chunkH3XAHVDT_cjs.GridRowNavigator,
7428
7428
  {
7429
7429
  gridApi,
7430
7430
  selectedId: editingId,
@@ -7685,7 +7685,7 @@ var NO_SSO = {
7685
7685
  };
7686
7686
  function useAuthPages() {
7687
7687
  const auth = chunkMB3S2ETI_cjs.useHost().auth;
7688
- return { ...auth, passwordRules: auth?.passwordRules ?? chunkK237IYOD_cjs.DEFAULT_PASSWORD_RULES };
7688
+ return { ...auth, passwordRules: auth?.passwordRules ?? chunkBYJUI4AT_cjs.DEFAULT_PASSWORD_RULES };
7689
7689
  }
7690
7690
  function useSsoSignIn() {
7691
7691
  const sso = chunkMB3S2ETI_cjs.useHost().sso;
@@ -7764,11 +7764,11 @@ function ConnectedProfileCard({
7764
7764
  const display = profile?.fullName || "Unnamed";
7765
7765
  return /* @__PURE__ */ jsxRuntime.jsxs(chunkIRY63R4L_cjs.SettingsSection, { icon: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.UserCircle, {}), title, children: [
7766
7766
  /* @__PURE__ */ jsxRuntime.jsx(
7767
- chunkFZVAJFRH_cjs.ProfileCard,
7767
+ chunkRHKFCSFC_cjs.ProfileCard,
7768
7768
  {
7769
7769
  avatar: /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
7770
7770
  /* @__PURE__ */ jsxRuntime.jsx(
7771
- chunkFZVAJFRH_cjs.AvatarPicker,
7771
+ chunkRHKFCSFC_cjs.AvatarPicker,
7772
7772
  {
7773
7773
  pictureUrl: profile?.picture,
7774
7774
  initials: chunkUFEXJIEY_cjs.initials(display),
@@ -7818,7 +7818,7 @@ function ConnectedIdentityVerification({
7818
7818
  });
7819
7819
  return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
7820
7820
  /* @__PURE__ */ jsxRuntime.jsx(
7821
- chunkFZVAJFRH_cjs.IdentityVerificationCard,
7821
+ chunkRHKFCSFC_cjs.IdentityVerificationCard,
7822
7822
  {
7823
7823
  flow,
7824
7824
  labels,
@@ -7827,7 +7827,7 @@ function ConnectedIdentityVerification({
7827
7827
  }
7828
7828
  ),
7829
7829
  /* @__PURE__ */ jsxRuntime.jsx(
7830
- chunkFZVAJFRH_cjs.IdentityVerificationDialog,
7830
+ chunkRHKFCSFC_cjs.IdentityVerificationDialog,
7831
7831
  {
7832
7832
  flow,
7833
7833
  accountName: profile?.fullName ?? "",
@@ -7840,7 +7840,7 @@ function ConnectedIdentityVerification({
7840
7840
  function ConnectedRequireVerified({ children, labels }) {
7841
7841
  const { data: profile } = react.useProfile();
7842
7842
  const flow = react.useIdentityVerification();
7843
- return /* @__PURE__ */ jsxRuntime.jsx(chunkFZVAJFRH_cjs.RequireVerified, { flow, accountName: profile?.fullName ?? "", labels, children });
7843
+ return /* @__PURE__ */ jsxRuntime.jsx(chunkRHKFCSFC_cjs.RequireVerified, { flow, accountName: profile?.fullName ?? "", labels, children });
7844
7844
  }
7845
7845
  function ConnectedPasswordChangeDialog({
7846
7846
  open,
@@ -7865,7 +7865,7 @@ function ConnectedPasswordChangeDialog({
7865
7865
  onRecoveryComplete
7866
7866
  });
7867
7867
  return /* @__PURE__ */ jsxRuntime.jsx(
7868
- chunkFZVAJFRH_cjs.PasswordChangeDialog,
7868
+ chunkRHKFCSFC_cjs.PasswordChangeDialog,
7869
7869
  {
7870
7870
  open,
7871
7871
  onClose: form.onCancel,
@@ -7905,23 +7905,23 @@ function ConnectedSecuritySection({ children }) {
7905
7905
  ] });
7906
7906
  }
7907
7907
  function ConnectedNotificationPreferences({
7908
- categories = chunkFZVAJFRH_cjs.EMAIL_NOTIFICATION_CATEGORIES,
7908
+ categories = chunkRHKFCSFC_cjs.EMAIL_NOTIFICATION_CATEGORIES,
7909
7909
  title = "Notifications"
7910
7910
  }) {
7911
7911
  const keys = React7.useMemo(
7912
- () => categories === chunkFZVAJFRH_cjs.EMAIL_NOTIFICATION_CATEGORIES ? chunkFZVAJFRH_cjs.EMAIL_NOTIFICATION_KEYS : categories.map((c) => c.key),
7912
+ () => categories === chunkRHKFCSFC_cjs.EMAIL_NOTIFICATION_CATEGORIES ? chunkRHKFCSFC_cjs.EMAIL_NOTIFICATION_KEYS : categories.map((c) => c.key),
7913
7913
  [categories]
7914
7914
  );
7915
7915
  const prefs = react.useNotificationPreferences(keys);
7916
7916
  return /* @__PURE__ */ jsxRuntime.jsx(chunkIRY63R4L_cjs.SettingsSection, { title, children: /* @__PURE__ */ jsxRuntime.jsx(chunkIRY63R4L_cjs.SettingsCard, { className: "space-y-0", children: /* @__PURE__ */ jsxRuntime.jsx(
7917
- chunkFZVAJFRH_cjs.NotificationCategoryList,
7917
+ chunkRHKFCSFC_cjs.NotificationCategoryList,
7918
7918
  {
7919
7919
  masterId: "emailNotifications",
7920
7920
  masterTitle: "Email Notifications",
7921
7921
  masterDescription: "Email me about activity when I\u2019m away",
7922
7922
  masterChecked: prefs.masterChecked,
7923
7923
  onMasterChange: prefs.setAll,
7924
- categories: chunkFZVAJFRH_cjs.toNotificationCategories(prefs.checked, categories),
7924
+ categories: chunkRHKFCSFC_cjs.toNotificationCategories(prefs.checked, categories),
7925
7925
  onCategoryChange: prefs.setCategory
7926
7926
  }
7927
7927
  ) }) });
@@ -7934,7 +7934,7 @@ function ConnectedSessionsRow({
7934
7934
  const sessions = react.useSessions({ enabled: open });
7935
7935
  const currentSessionId = react.useCurrentSessionId();
7936
7936
  const terminate = react.useTerminateSession();
7937
- const views = chunkFZVAJFRH_cjs.toActiveSessionViews(sessions.data ?? [], {
7937
+ const views = chunkRHKFCSFC_cjs.toActiveSessionViews(sessions.data ?? [], {
7938
7938
  currentSessionId,
7939
7939
  terminatingId: terminate.isPending ? terminate.variables : null,
7940
7940
  renderIcon: renderSessionIcon
@@ -7963,7 +7963,7 @@ function ConnectedSessionsRow({
7963
7963
  }
7964
7964
  ),
7965
7965
  /* @__PURE__ */ jsxRuntime.jsx(
7966
- chunkFZVAJFRH_cjs.ActiveSessionsDialog,
7966
+ chunkRHKFCSFC_cjs.ActiveSessionsDialog,
7967
7967
  {
7968
7968
  open,
7969
7969
  onOpenChange: setOpen,
@@ -8005,7 +8005,7 @@ function ConnectedLogoutDialog({
8005
8005
  signOut.mutate({ everywhere, reason: "manual" });
8006
8006
  };
8007
8007
  return /* @__PURE__ */ jsxRuntime.jsx(
8008
- chunkFZVAJFRH_cjs.LogoutDialog,
8008
+ chunkRHKFCSFC_cjs.LogoutDialog,
8009
8009
  {
8010
8010
  open,
8011
8011
  onClose,
@@ -8013,7 +8013,7 @@ function ConnectedLogoutDialog({
8013
8013
  onLogoutAll: () => void run(true),
8014
8014
  canLogoutAll,
8015
8015
  isOnline,
8016
- sessions: chunkFZVAJFRH_cjs.toLogoutSessionViews(sessions.data ?? []),
8016
+ sessions: chunkRHKFCSFC_cjs.toLogoutSessionViews(sessions.data ?? []),
8017
8017
  renderSessionIcon
8018
8018
  }
8019
8019
  );
@@ -8055,12 +8055,12 @@ function ConnectedDangerZone({ renderSubscriptionLink }) {
8055
8055
  }
8056
8056
  ),
8057
8057
  /* @__PURE__ */ jsxRuntime.jsx(
8058
- chunkFZVAJFRH_cjs.DeleteAccountDialog,
8058
+ chunkRHKFCSFC_cjs.DeleteAccountDialog,
8059
8059
  {
8060
8060
  open: dialogOpen,
8061
8061
  onClose: flow.onClose,
8062
8062
  step: flow.step,
8063
- blockers: chunkFZVAJFRH_cjs.toDeleteBlockerViews(flow.blockers, renderSubscriptionLink),
8063
+ blockers: chunkRHKFCSFC_cjs.toDeleteBlockerViews(flow.blockers, renderSubscriptionLink),
8064
8064
  onContinue: flow.onContinue,
8065
8065
  onBack: flow.onBack,
8066
8066
  userEmail,
@@ -8144,7 +8144,7 @@ function ConnectedSsoDisconnect() {
8144
8144
  /* @__PURE__ */ jsxRuntime.jsx(ui.DialogDescription, { children: "Sign in with your email and master password instead. Your data stays unchanged." })
8145
8145
  ] }),
8146
8146
  /* @__PURE__ */ jsxRuntime.jsxs("form", { className: "space-y-4", onSubmit: submit, children: [
8147
- step === "email" ? /* @__PURE__ */ jsxRuntime.jsx(chunkK237IYOD_cjs.AuthField, { htmlFor: "disconnect-email", label: "Email", children: /* @__PURE__ */ jsxRuntime.jsx(
8147
+ step === "email" ? /* @__PURE__ */ jsxRuntime.jsx(chunkBYJUI4AT_cjs.AuthField, { htmlFor: "disconnect-email", label: "Email", children: /* @__PURE__ */ jsxRuntime.jsx(
8148
8148
  ui.Input,
8149
8149
  {
8150
8150
  id: "disconnect-email",
@@ -8156,7 +8156,7 @@ function ConnectedSsoDisconnect() {
8156
8156
  disabled: busy
8157
8157
  }
8158
8158
  ) }) : /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
8159
- changedEmail && /* @__PURE__ */ jsxRuntime.jsx(chunkK237IYOD_cjs.AuthField, { htmlFor: "disconnect-code", label: `Verification code sent to ${email}`, children: /* @__PURE__ */ jsxRuntime.jsx(
8159
+ changedEmail && /* @__PURE__ */ jsxRuntime.jsx(chunkBYJUI4AT_cjs.AuthField, { htmlFor: "disconnect-code", label: `Verification code sent to ${email}`, children: /* @__PURE__ */ jsxRuntime.jsx(
8160
8160
  ui.Input,
8161
8161
  {
8162
8162
  id: "disconnect-code",
@@ -8167,7 +8167,7 @@ function ConnectedSsoDisconnect() {
8167
8167
  disabled: busy
8168
8168
  }
8169
8169
  ) }),
8170
- /* @__PURE__ */ jsxRuntime.jsx(chunkK237IYOD_cjs.AuthField, { htmlFor: "disconnect-password", label: "Master password", children: /* @__PURE__ */ jsxRuntime.jsx(
8170
+ /* @__PURE__ */ jsxRuntime.jsx(chunkBYJUI4AT_cjs.AuthField, { htmlFor: "disconnect-password", label: "Master password", children: /* @__PURE__ */ jsxRuntime.jsx(
8171
8171
  ui.Input,
8172
8172
  {
8173
8173
  id: "disconnect-password",
@@ -8191,10 +8191,36 @@ function ConnectedSsoDisconnect() {
8191
8191
  )
8192
8192
  ] });
8193
8193
  }
8194
+ function ConnectedBoxPortalSection() {
8195
+ const { isBoxAdmin } = react.useBoxRole();
8196
+ const { licenceUrl } = chunk2QQUGL2V_cjs.useBlocksEnvironment().runtimeConfig;
8197
+ if (!isBoxAdmin || !licenceUrl) return null;
8198
+ return /* @__PURE__ */ jsxRuntime.jsx(chunkIRY63R4L_cjs.SettingsSection, { icon: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Building2, {}), title: "Box", testId: "box-portal-section", children: /* @__PURE__ */ jsxRuntime.jsx(chunkIRY63R4L_cjs.SettingsCard, { children: /* @__PURE__ */ jsxRuntime.jsx(
8199
+ chunkIRY63R4L_cjs.SettingsRow,
8200
+ {
8201
+ label: "Manage your Box in the ARBI portal",
8202
+ description: "Users, storage, AI usage and billing.",
8203
+ children: /* @__PURE__ */ jsxRuntime.jsxs(
8204
+ "a",
8205
+ {
8206
+ href: licenceUrl,
8207
+ target: "_blank",
8208
+ rel: "noopener noreferrer",
8209
+ className: "inline-flex shrink-0 items-center gap-1.5 self-start rounded-md border border-input bg-background px-3 py-1.5 text-sm font-medium text-foreground hover:bg-muted focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring pointer-coarse:min-h-11",
8210
+ "data-testid": "box-portal-link",
8211
+ children: [
8212
+ "Open portal",
8213
+ /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ExternalLink, { className: "size-3.5", "aria-hidden": true })
8214
+ ]
8215
+ }
8216
+ )
8217
+ }
8218
+ ) }) });
8219
+ }
8194
8220
  function ServerConnectionRow({ onRefresh, ...status }) {
8195
8221
  const { runtimeConfig } = chunk2QQUGL2V_cjs.useBlocksEnvironment();
8196
8222
  const [isRefreshing, setIsRefreshing] = React7.useState(false);
8197
- const view = chunkFZVAJFRH_cjs.serverConnectionView(status, runtimeConfig.deploymentDomain || "server");
8223
+ const view = chunkRHKFCSFC_cjs.serverConnectionView(status, runtimeConfig.deploymentDomain || "server");
8198
8224
  const refresh = async () => {
8199
8225
  setIsRefreshing(true);
8200
8226
  try {
@@ -8204,7 +8230,7 @@ function ServerConnectionRow({ onRefresh, ...status }) {
8204
8230
  }
8205
8231
  };
8206
8232
  return /* @__PURE__ */ jsxRuntime.jsx(chunkIRY63R4L_cjs.SettingsRow, { label: "Server connection", description: view.description, children: /* @__PURE__ */ jsxRuntime.jsx(
8207
- chunkFZVAJFRH_cjs.ServerConnectionButton,
8233
+ chunkRHKFCSFC_cjs.ServerConnectionButton,
8208
8234
  {
8209
8235
  state: view.state,
8210
8236
  label: view.label,
@@ -8229,6 +8255,7 @@ function ConnectedAccountSettings({
8229
8255
  const [logoutOpen, setLogoutOpen] = React7.useState(false);
8230
8256
  return /* @__PURE__ */ jsxRuntime.jsxs(chunkIRY63R4L_cjs.SettingsPanel, { className: "max-w-2xl", children: [
8231
8257
  /* @__PURE__ */ jsxRuntime.jsx(ConnectedProfileCard, { avatarClassName, nameBadge: profileBadge }),
8258
+ /* @__PURE__ */ jsxRuntime.jsx(ConnectedBoxPortalSection, {}),
8232
8259
  afterProfile,
8233
8260
  /* @__PURE__ */ jsxRuntime.jsxs(chunkIRY63R4L_cjs.SettingsDisclosure, { title: "More", testId: "account-more-settings", children: [
8234
8261
  /* @__PURE__ */ jsxRuntime.jsx(ConnectedSsoDisconnect, {}),
@@ -8613,13 +8640,13 @@ var COLUMNS = [
8613
8640
  flex: 1,
8614
8641
  minWidth: 120,
8615
8642
  cellRenderer: (params) => isStandard(params.data) ? /* @__PURE__ */ jsxRuntime.jsx(
8616
- chunkFZVAJFRH_cjs.ModelProviderLabel,
8643
+ chunkRHKFCSFC_cjs.ModelProviderLabel,
8617
8644
  {
8618
8645
  logo: /* @__PURE__ */ jsxRuntime.jsx(ui.ArbiIcon, { size: 14, "aria-label": "ARBI", className: "flex-shrink-0 rounded-sm" }),
8619
8646
  children: "ARBI CITY"
8620
8647
  }
8621
8648
  ) : /* @__PURE__ */ jsxRuntime.jsx(
8622
- chunkFZVAJFRH_cjs.ModelProviderLabel,
8649
+ chunkRHKFCSFC_cjs.ModelProviderLabel,
8623
8650
  {
8624
8651
  logo: /* @__PURE__ */ jsxRuntime.jsx(ui.ProviderIcon, { modelName: params.data?.model_name, provider: params.value, size: 14 }),
8625
8652
  children: PROVIDER_NAMES[params.value ?? ""] || params.value || "\u2014"
@@ -8696,7 +8723,7 @@ function ConnectedPremiumModels() {
8696
8723
  );
8697
8724
  if (premiumModels.length === 0) return null;
8698
8725
  return /* @__PURE__ */ jsxRuntime.jsx(chunkIRY63R4L_cjs.SettingsPanel, { className: "max-w-2xl space-y-4", children: /* @__PURE__ */ jsxRuntime.jsx(chunkIRY63R4L_cjs.SettingsSection, { title: "Premium models", children: /* @__PURE__ */ jsxRuntime.jsx(chunkIRY63R4L_cjs.SettingsCard, { className: "space-y-0", children: /* @__PURE__ */ jsxRuntime.jsx(
8699
- chunkFZVAJFRH_cjs.PremiumModelsFrame,
8726
+ chunkRHKFCSFC_cjs.PremiumModelsFrame,
8700
8727
  {
8701
8728
  enabled: premiumModel !== "",
8702
8729
  onEnabledChange: (enabled) => {
@@ -8825,10 +8852,10 @@ function ConnectedAppsSettings({
8825
8852
  }
8826
8853
  };
8827
8854
  if (isLoading) {
8828
- return /* @__PURE__ */ jsxRuntime.jsx(chunkFZVAJFRH_cjs.ConnectionsLoading, { message: "Loading connected apps\u2026" });
8855
+ return /* @__PURE__ */ jsxRuntime.jsx(chunkRHKFCSFC_cjs.ConnectionsLoading, { message: "Loading connected apps\u2026" });
8829
8856
  }
8830
8857
  if (catalogError) {
8831
- return /* @__PURE__ */ jsxRuntime.jsx(chunkFZVAJFRH_cjs.ConnectionsError, { message: "Failed to load connector catalog. Please refresh and try again." });
8858
+ return /* @__PURE__ */ jsxRuntime.jsx(chunkRHKFCSFC_cjs.ConnectionsError, { message: "Failed to load connector catalog. Please refresh and try again." });
8832
8859
  }
8833
8860
  const visibleCatalog = catalog.filter((c) => isVendorVisible(c.vendor_key));
8834
8861
  const sharePointVisible = isVendorVisible("microsoft_sharepoint");
@@ -8837,7 +8864,7 @@ function ConnectedAppsSettings({
8837
8864
  (c) => !react.isMailboxSyncVendor(c.vendor_key) && !react.isSharePointVendor(c.vendor_key)
8838
8865
  );
8839
8866
  const renderCard = (entry) => /* @__PURE__ */ jsxRuntime.jsx(
8840
- chunkFZVAJFRH_cjs.ConnectionCard,
8867
+ chunkRHKFCSFC_cjs.ConnectionCard,
8841
8868
  {
8842
8869
  connection: toConnectionCardView(entry, connectedByVendor[entry.vendor_key], {
8843
8870
  isDisconnecting: disconnect.isPending && disconnect.variables?.vendorKey === entry.vendor_key,
@@ -8965,7 +8992,7 @@ function ConnectedAppsSettings({
8965
8992
  }
8966
8993
  )
8967
8994
  ] }),
8968
- catalog.length === 0 ? /* @__PURE__ */ jsxRuntime.jsx(chunkIRY63R4L_cjs.SettingsCard, { children: /* @__PURE__ */ jsxRuntime.jsx(chunkFZVAJFRH_cjs.ConnectionsEmpty, { message: "No connectors available yet." }) }) : /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
8995
+ catalog.length === 0 ? /* @__PURE__ */ jsxRuntime.jsx(chunkIRY63R4L_cjs.SettingsCard, { children: /* @__PURE__ */ jsxRuntime.jsx(chunkRHKFCSFC_cjs.ConnectionsEmpty, { message: "No connectors available yet." }) }) : /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
8969
8996
  renderGroup("Email & Drive", EMAIL_AND_DRIVE_SUBTITLE, /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Mail, {}), emailCatalog),
8970
8997
  renderGroup(
8971
8998
  "Apps & Integrations (MCP)",
@@ -9126,7 +9153,7 @@ function StorageItemsTable({
9126
9153
  }
9127
9154
  ];
9128
9155
  return /* @__PURE__ */ jsxRuntime.jsx(
9129
- chunkSQ5F5BFW_cjs.DataTable,
9156
+ chunkXDU3HHUU_cjs.DataTable,
9130
9157
  {
9131
9158
  columns,
9132
9159
  rows,
@@ -9471,7 +9498,7 @@ function ConnectedStorageProjectCard({
9471
9498
  project.personal && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "mt-0.5 text-sm text-muted-foreground", children: "Mail, recordings of calls you host, chat attachments and everything not in a project." })
9472
9499
  ] }),
9473
9500
  /* @__PURE__ */ jsxRuntime.jsx(
9474
- chunkFZVAJFRH_cjs.UsageToggle,
9501
+ chunkRHKFCSFC_cjs.UsageToggle,
9475
9502
  {
9476
9503
  value: view,
9477
9504
  onChange: setView,
@@ -9556,7 +9583,7 @@ function ConnectedStorageProjectCard({
9556
9583
  ] })
9557
9584
  ] }),
9558
9585
  view === "largest" && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-3", children: [
9559
- /* @__PURE__ */ jsxRuntime.jsx(chunkFZVAJFRH_cjs.UsageToggle, { value: kind, onChange: setKind, options: KIND_FILTERS, ariaLabel: "Kind" }),
9586
+ /* @__PURE__ */ jsxRuntime.jsx(chunkRHKFCSFC_cjs.UsageToggle, { value: kind, onChange: setKind, options: KIND_FILTERS, ariaLabel: "Kind" }),
9560
9587
  largest.isLoading ? /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm text-muted-foreground", children: "Loading\u2026" }) : /* @__PURE__ */ jsxRuntime.jsx(
9561
9588
  StorageItemsTable,
9562
9589
  {
@@ -9806,7 +9833,7 @@ function ConnectedSettingsPage({
9806
9833
  }, [requested]);
9807
9834
  const controlled = section !== void 0;
9808
9835
  return /* @__PURE__ */ jsxRuntime.jsx(
9809
- chunkFZVAJFRH_cjs.SettingsPage,
9836
+ chunkRHKFCSFC_cjs.SettingsPage,
9810
9837
  {
9811
9838
  ...page,
9812
9839
  sections,
@@ -9838,7 +9865,7 @@ function UsageSettings({ icon: icon2 }) {
9838
9865
  description: "AI usage today, in \xA3 (ex VAT).",
9839
9866
  testId: "settings-usage",
9840
9867
  children: /* @__PURE__ */ jsxRuntime.jsx(
9841
- chunkFZVAJFRH_cjs.UsageSummary,
9868
+ chunkRHKFCSFC_cjs.UsageSummary,
9842
9869
  {
9843
9870
  stats: [
9844
9871
  {
@@ -9913,6 +9940,62 @@ function organisationSettingsSection({
9913
9940
  )
9914
9941
  };
9915
9942
  }
9943
+ function appearanceSettingsSection(options2) {
9944
+ const TabIcon = options2.theme ? lucideReact.Palette : lucideReact.Type;
9945
+ return {
9946
+ id: "appearance",
9947
+ label: "Appearance",
9948
+ icon: /* @__PURE__ */ jsxRuntime.jsx(TabIcon, { className: "w-6 h-6" }),
9949
+ render: () => /* @__PURE__ */ jsxRuntime.jsx(AppearanceSection, { ...options2 })
9950
+ };
9951
+ }
9952
+ function AppearanceSection({
9953
+ appearance,
9954
+ theme,
9955
+ themePreview,
9956
+ icon: icon2 = /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Palette, { className: "size-4" }),
9957
+ description = "Colours and type on this device."
9958
+ }) {
9959
+ return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
9960
+ appearance && /* @__PURE__ */ jsxRuntime.jsx(ReaderAppearance, { bundle: appearance }),
9961
+ theme && /* @__PURE__ */ jsxRuntime.jsx(
9962
+ chunkIRY63R4L_cjs.SettingsSection,
9963
+ {
9964
+ icon: icon2,
9965
+ title: "Appearance",
9966
+ description,
9967
+ testId: appearance ? "settings-appearance-theme" : "settings-appearance",
9968
+ children: /* @__PURE__ */ jsxRuntime.jsx(
9969
+ chunkKUQOHPKP_cjs.ThemeEditor,
9970
+ {
9971
+ bundle: theme,
9972
+ variant: "collapsed",
9973
+ preview: themePreview,
9974
+ testIdPrefix: "settings-theme"
9975
+ }
9976
+ )
9977
+ }
9978
+ )
9979
+ ] });
9980
+ }
9981
+ function ReaderAppearance({ bundle }) {
9982
+ const state = bundle.useStore();
9983
+ const { defaults } = bundle;
9984
+ const isDefault = state.pairingId === defaults.pairingId && state.colorScheme === defaults.colorScheme && state.textSize === defaults.textSize;
9985
+ return /* @__PURE__ */ jsxRuntime.jsx(
9986
+ chunkRHKFCSFC_cjs.AppearanceSettings,
9987
+ {
9988
+ colorScheme: state.colorScheme,
9989
+ onColorSchemeChange: state.setColorScheme,
9990
+ textSize: state.textSize,
9991
+ onTextSizeChange: state.setTextSize,
9992
+ pairingId: state.pairingId,
9993
+ onPairingChange: state.setPairing,
9994
+ pairingIds: bundle.pairingIds,
9995
+ onReset: isDefault ? void 0 : state.reset
9996
+ }
9997
+ );
9998
+ }
9916
9999
  function ConnectedProjectStorage({ projectExtId }) {
9917
10000
  const { data, isLoading } = react.useStorageProjects("mine", projectExtId);
9918
10001
  const project = data?.projects.find((p) => p.project_ext_id === projectExtId);
@@ -10031,7 +10114,7 @@ function ConnectedDeploymentStorage() {
10031
10114
  deployment.unattributed_bytes > 0 && ` \xB7 ${formatBytes(deployment.unattributed_bytes)} not owned by any project`
10032
10115
  ] }),
10033
10116
  trend.dates.length > 1 && /* @__PURE__ */ jsxRuntime.jsx(
10034
- chunkFZVAJFRH_cjs.UsageLineChart,
10117
+ chunkRHKFCSFC_cjs.UsageLineChart,
10035
10118
  {
10036
10119
  dates: trend.dates,
10037
10120
  series: trend.series,
@@ -10040,7 +10123,7 @@ function ConnectedDeploymentStorage() {
10040
10123
  }
10041
10124
  ),
10042
10125
  /* @__PURE__ */ jsxRuntime.jsx(
10043
- chunkFZVAJFRH_cjs.UsageToggle,
10126
+ chunkRHKFCSFC_cjs.UsageToggle,
10044
10127
  {
10045
10128
  value: view,
10046
10129
  onChange: setView,
@@ -10053,7 +10136,7 @@ function ConnectedDeploymentStorage() {
10053
10136
  }
10054
10137
  ),
10055
10138
  view === "items" ? /* @__PURE__ */ jsxRuntime.jsx(
10056
- chunkSQ5F5BFW_cjs.DataTable,
10139
+ chunkXDU3HHUU_cjs.DataTable,
10057
10140
  {
10058
10141
  columns: itemColumns,
10059
10142
  rows: (items.data?.items ?? []).map((item) => ({ item })),
@@ -10062,7 +10145,7 @@ function ConnectedDeploymentStorage() {
10062
10145
  emptyTitle: "Nothing stored yet"
10063
10146
  }
10064
10147
  ) : /* @__PURE__ */ jsxRuntime.jsx(
10065
- chunkSQ5F5BFW_cjs.DataTable,
10148
+ chunkXDU3HHUU_cjs.DataTable,
10066
10149
  {
10067
10150
  columns: projectColumns,
10068
10151
  rows: [...view === "people" ? people : projects].sort(byBytes),
@@ -10515,13 +10598,13 @@ function ConnectedWorkspaceSettings({
10515
10598
  const [membersExpanded, setMembersExpanded] = React7.useState(false);
10516
10599
  const [shareOpen, setShareOpen] = React7.useState(false);
10517
10600
  if (!workspace) {
10518
- return /* @__PURE__ */ jsxRuntime.jsx(chunkKJVDYWAM_cjs.PageLoading, { children: /* @__PURE__ */ jsxRuntime.jsx(chunkTTJGCJWX_cjs.LoadingIndicator, { message: "Loading workspace..." }) });
10601
+ return /* @__PURE__ */ jsxRuntime.jsx(chunkKJVDYWAM_cjs.PageLoading, { children: /* @__PURE__ */ jsxRuntime.jsx(chunkH3XAHVDT_cjs.LoadingIndicator, { message: "Loading workspace..." }) });
10519
10602
  }
10520
10603
  return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
10521
10604
  /* @__PURE__ */ jsxRuntime.jsxs(chunkKJVDYWAM_cjs.WorkspacePageFrame, { testId, children: [
10522
10605
  /* @__PURE__ */ jsxRuntime.jsxs(chunkKJVDYWAM_cjs.WorkspaceIdentityPanel, { children: [
10523
10606
  /* @__PURE__ */ jsxRuntime.jsx(
10524
- chunkTTJGCJWX_cjs.EntityIdentityBar,
10607
+ chunkH3XAHVDT_cjs.EntityIdentityBar,
10525
10608
  {
10526
10609
  testId: "workspace-identity-bar",
10527
10610
  canEdit: isOwner,
@@ -10538,7 +10621,7 @@ function ConnectedWorkspaceSettings({
10538
10621
  label: "Name",
10539
10622
  value: workspace.name,
10540
10623
  placeholder: "Untitled",
10541
- maxLength: chunkTTJGCJWX_cjs.IDENTITY_NAME_MAX_LENGTH,
10624
+ maxLength: chunkH3XAHVDT_cjs.IDENTITY_NAME_MAX_LENGTH,
10542
10625
  valueClassName: "truncate text-base font-semibold",
10543
10626
  testId: "workspace-home-title",
10544
10627
  hideLabel: true,
@@ -10819,9 +10902,9 @@ function ConnectedMailboxSyncDialog({
10819
10902
  showDescription: true,
10820
10903
  className: "w-[92vw] sm:max-w-lg",
10821
10904
  children: [
10822
- /* @__PURE__ */ jsxRuntime.jsxs(chunkFZVAJFRH_cjs.SyncDialogBody, { children: [
10823
- !lockedWorkspaceExtId && /* @__PURE__ */ jsxRuntime.jsx(chunkFZVAJFRH_cjs.SyncField, { label: "Target workspace", htmlFor: "sync-workspace", children: /* @__PURE__ */ jsxRuntime.jsx(
10824
- chunkFZVAJFRH_cjs.SyncSelect,
10905
+ /* @__PURE__ */ jsxRuntime.jsxs(chunkRHKFCSFC_cjs.SyncDialogBody, { children: [
10906
+ !lockedWorkspaceExtId && /* @__PURE__ */ jsxRuntime.jsx(chunkRHKFCSFC_cjs.SyncField, { label: "Target workspace", htmlFor: "sync-workspace", children: /* @__PURE__ */ jsxRuntime.jsx(
10907
+ chunkRHKFCSFC_cjs.SyncSelect,
10825
10908
  {
10826
10909
  id: "sync-workspace",
10827
10910
  value: workspaceExtId,
@@ -10830,9 +10913,9 @@ function ConnectedMailboxSyncDialog({
10830
10913
  options: memberWorkspaces.map((w) => ({ value: w.external_id, label: w.name }))
10831
10914
  }
10832
10915
  ) }),
10833
- /* @__PURE__ */ jsxRuntime.jsxs(chunkFZVAJFRH_cjs.SyncField, { label: "Backfill window", htmlFor: "sync-backfill", children: [
10916
+ /* @__PURE__ */ jsxRuntime.jsxs(chunkRHKFCSFC_cjs.SyncField, { label: "Backfill window", htmlFor: "sync-backfill", children: [
10834
10917
  /* @__PURE__ */ jsxRuntime.jsx(
10835
- chunkFZVAJFRH_cjs.SyncSelect,
10918
+ chunkRHKFCSFC_cjs.SyncSelect,
10836
10919
  {
10837
10920
  id: "sync-backfill",
10838
10921
  value: backfill,
@@ -10852,17 +10935,17 @@ function ConnectedMailboxSyncDialog({
10852
10935
  "aria-label": "Import emails since date"
10853
10936
  }
10854
10937
  ),
10855
- /* @__PURE__ */ jsxRuntime.jsx(chunkFZVAJFRH_cjs.SyncSmallNote, { children: "Emails are always imported from this date onward \u2014 the start point never moves." })
10938
+ /* @__PURE__ */ jsxRuntime.jsx(chunkRHKFCSFC_cjs.SyncSmallNote, { children: "Emails are always imported from this date onward \u2014 the start point never moves." })
10856
10939
  ] })
10857
10940
  ] }),
10858
10941
  /* @__PURE__ */ jsxRuntime.jsx(
10859
- chunkFZVAJFRH_cjs.SyncField,
10942
+ chunkRHKFCSFC_cjs.SyncField,
10860
10943
  {
10861
10944
  label: `Folders to import${selectedFolders.length > 0 ? ` (${selectedFolders.length})` : ""}`,
10862
10945
  hint: "Select at least one folder to import.",
10863
- actions: folders.length > 0 && /* @__PURE__ */ jsxRuntime.jsxs(chunkFZVAJFRH_cjs.SyncLinkRow, { children: [
10946
+ actions: folders.length > 0 && /* @__PURE__ */ jsxRuntime.jsxs(chunkRHKFCSFC_cjs.SyncLinkRow, { children: [
10864
10947
  /* @__PURE__ */ jsxRuntime.jsx(
10865
- chunkFZVAJFRH_cjs.SyncLinkButton,
10948
+ chunkRHKFCSFC_cjs.SyncLinkButton,
10866
10949
  {
10867
10950
  onClick: () => setExpandAllNonce((n) => n + 1),
10868
10951
  testId: "mail-folders-expand-all",
@@ -10870,20 +10953,20 @@ function ConnectedMailboxSyncDialog({
10870
10953
  }
10871
10954
  ),
10872
10955
  /* @__PURE__ */ jsxRuntime.jsx(
10873
- chunkFZVAJFRH_cjs.SyncLinkButton,
10956
+ chunkRHKFCSFC_cjs.SyncLinkButton,
10874
10957
  {
10875
10958
  onClick: () => setCollapseAllNonce((n) => n + 1),
10876
10959
  testId: "mail-folders-collapse-all",
10877
10960
  children: "Collapse all"
10878
10961
  }
10879
10962
  ),
10880
- /* @__PURE__ */ jsxRuntime.jsx(chunkFZVAJFRH_cjs.SyncLinkButton, { onClick: toggleAllFolders, children: allSelected ? "Clear all" : "Select all" })
10963
+ /* @__PURE__ */ jsxRuntime.jsx(chunkRHKFCSFC_cjs.SyncLinkButton, { onClick: toggleAllFolders, children: allSelected ? "Clear all" : "Select all" })
10881
10964
  ] }),
10882
- children: foldersLoading ? /* @__PURE__ */ jsxRuntime.jsx(chunkFZVAJFRH_cjs.SyncLoading, { children: "Loading folders\u2026" }) : foldersError ? (
10965
+ children: foldersLoading ? /* @__PURE__ */ jsxRuntime.jsx(chunkRHKFCSFC_cjs.SyncLoading, { children: "Loading folders\u2026" }) : foldersError ? (
10883
10966
  // A failed fetch is not an empty mailbox: it hides auth/scope errors (e.g. a Gmail
10884
10967
  // account needing reconnect).
10885
10968
  /* @__PURE__ */ jsxRuntime.jsx(
10886
- chunkFZVAJFRH_cjs.SyncReconnectNotice,
10969
+ chunkRHKFCSFC_cjs.SyncReconnectNotice,
10887
10970
  {
10888
10971
  message: `Couldn\u2019t load folders from ${catalog.display_name}. Reconnect the account and try again.`,
10889
10972
  onReconnect: () => void reconnect(),
@@ -10891,7 +10974,7 @@ function ConnectedMailboxSyncDialog({
10891
10974
  testId: "folders-reconnect"
10892
10975
  }
10893
10976
  )
10894
- ) : folders.length === 0 ? /* @__PURE__ */ jsxRuntime.jsx(chunkFZVAJFRH_cjs.SyncNote, { children: "No folders found." }) : /* @__PURE__ */ jsxRuntime.jsx(chunkFZVAJFRH_cjs.SyncTreeFrame, { children: /* @__PURE__ */ jsxRuntime.jsx(
10977
+ ) : folders.length === 0 ? /* @__PURE__ */ jsxRuntime.jsx(chunkRHKFCSFC_cjs.SyncNote, { children: "No folders found." }) : /* @__PURE__ */ jsxRuntime.jsx(chunkRHKFCSFC_cjs.SyncTreeFrame, { children: /* @__PURE__ */ jsxRuntime.jsx(
10895
10978
  chunkWUG24K7P_cjs.MailFolderTree,
10896
10979
  {
10897
10980
  nodes: folderTree,
@@ -10903,9 +10986,9 @@ function ConnectedMailboxSyncDialog({
10903
10986
  ) })
10904
10987
  }
10905
10988
  ),
10906
- /* @__PURE__ */ jsxRuntime.jsxs(chunkFZVAJFRH_cjs.SyncOptions, { children: [
10989
+ /* @__PURE__ */ jsxRuntime.jsxs(chunkRHKFCSFC_cjs.SyncOptions, { children: [
10907
10990
  /* @__PURE__ */ jsxRuntime.jsx(
10908
- chunkFZVAJFRH_cjs.SyncOptionToggle,
10991
+ chunkRHKFCSFC_cjs.SyncOptionToggle,
10909
10992
  {
10910
10993
  checked: skipDuplicates,
10911
10994
  onCheckedChange: setSkipDuplicates,
@@ -10915,7 +10998,7 @@ function ConnectedMailboxSyncDialog({
10915
10998
  }
10916
10999
  ),
10917
11000
  /* @__PURE__ */ jsxRuntime.jsx(
10918
- chunkFZVAJFRH_cjs.SyncOptionToggle,
11001
+ chunkRHKFCSFC_cjs.SyncOptionToggle,
10919
11002
  {
10920
11003
  checked: autoRename,
10921
11004
  onCheckedChange: setAutoRename,
@@ -10925,7 +11008,7 @@ function ConnectedMailboxSyncDialog({
10925
11008
  }
10926
11009
  ),
10927
11010
  /* @__PURE__ */ jsxRuntime.jsx(
10928
- chunkFZVAJFRH_cjs.SyncOptionToggle,
11011
+ chunkRHKFCSFC_cjs.SyncOptionToggle,
10929
11012
  {
10930
11013
  checked: shared,
10931
11014
  onCheckedChange: setShared,
@@ -10935,7 +11018,7 @@ function ConnectedMailboxSyncDialog({
10935
11018
  }
10936
11019
  ),
10937
11020
  /* @__PURE__ */ jsxRuntime.jsx(
10938
- chunkFZVAJFRH_cjs.SyncOptionToggle,
11021
+ chunkRHKFCSFC_cjs.SyncOptionToggle,
10939
11022
  {
10940
11023
  checked: autoSync,
10941
11024
  onCheckedChange: setAutoSync,
@@ -10947,7 +11030,7 @@ function ConnectedMailboxSyncDialog({
10947
11030
  ] })
10948
11031
  ] }),
10949
11032
  /* @__PURE__ */ jsxRuntime.jsx(
10950
- chunkFZVAJFRH_cjs.SyncDialogFooter,
11033
+ chunkRHKFCSFC_cjs.SyncDialogFooter,
10951
11034
  {
10952
11035
  onCancel: () => onOpenChange(false),
10953
11036
  onSave: handleEnableSubmit,
@@ -11009,7 +11092,7 @@ function DriveFolderNode({
11009
11092
  const mightHaveChildren = docCount == null || docCount > 0;
11010
11093
  const orderedChildren = [...children].sort((a, b) => a.name.localeCompare(b.name));
11011
11094
  return /* @__PURE__ */ jsxRuntime.jsx(
11012
- chunkFZVAJFRH_cjs.SyncFolderRow,
11095
+ chunkRHKFCSFC_cjs.SyncFolderRow,
11013
11096
  {
11014
11097
  id: folder.id,
11015
11098
  name: folder.name,
@@ -11023,7 +11106,7 @@ function DriveFolderNode({
11023
11106
  onCheckedChange: () => onToggle(folder.id),
11024
11107
  count: typeof docCount === "number" ? docCount : void 0,
11025
11108
  isCountLoading: isSelectable && countLoading,
11026
- children: isLoading ? /* @__PURE__ */ jsxRuntime.jsx(chunkFZVAJFRH_cjs.SyncFolderStatus, { depth, kind: "loading" }) : orderedChildren.length === 0 ? /* @__PURE__ */ jsxRuntime.jsx(chunkFZVAJFRH_cjs.SyncFolderStatus, { depth, kind: "empty" }) : orderedChildren.map((child) => /* @__PURE__ */ jsxRuntime.jsx(
11109
+ children: isLoading ? /* @__PURE__ */ jsxRuntime.jsx(chunkRHKFCSFC_cjs.SyncFolderStatus, { depth, kind: "loading" }) : orderedChildren.length === 0 ? /* @__PURE__ */ jsxRuntime.jsx(chunkRHKFCSFC_cjs.SyncFolderStatus, { depth, kind: "empty" }) : orderedChildren.map((child) => /* @__PURE__ */ jsxRuntime.jsx(
11027
11110
  DriveFolderNode,
11028
11111
  {
11029
11112
  vendorKey,
@@ -11169,9 +11252,9 @@ function ConnectedDriveSyncDialog({
11169
11252
  showDescription: true,
11170
11253
  className: "w-[92vw] sm:max-w-lg",
11171
11254
  children: [
11172
- /* @__PURE__ */ jsxRuntime.jsxs(chunkFZVAJFRH_cjs.SyncDialogBody, { children: [
11173
- !lockedWorkspaceExtId && /* @__PURE__ */ jsxRuntime.jsx(chunkFZVAJFRH_cjs.SyncField, { label: "Target workspace", htmlFor: "drive-sync-workspace", children: /* @__PURE__ */ jsxRuntime.jsx(
11174
- chunkFZVAJFRH_cjs.SyncSelect,
11255
+ /* @__PURE__ */ jsxRuntime.jsxs(chunkRHKFCSFC_cjs.SyncDialogBody, { children: [
11256
+ !lockedWorkspaceExtId && /* @__PURE__ */ jsxRuntime.jsx(chunkRHKFCSFC_cjs.SyncField, { label: "Target workspace", htmlFor: "drive-sync-workspace", children: /* @__PURE__ */ jsxRuntime.jsx(
11257
+ chunkRHKFCSFC_cjs.SyncSelect,
11175
11258
  {
11176
11259
  id: "drive-sync-workspace",
11177
11260
  value: workspaceExtId,
@@ -11181,13 +11264,13 @@ function ConnectedDriveSyncDialog({
11181
11264
  }
11182
11265
  ) }),
11183
11266
  /* @__PURE__ */ jsxRuntime.jsx(
11184
- chunkFZVAJFRH_cjs.SyncField,
11267
+ chunkRHKFCSFC_cjs.SyncField,
11185
11268
  {
11186
11269
  label: `Folders to import${selectedFolders.length > 0 ? ` (${selectedFolders.length})` : ""}`,
11187
11270
  hint: "Select at least one folder. Importing a folder includes everything inside it.",
11188
- actions: orderedFolders.length > 0 && /* @__PURE__ */ jsxRuntime.jsxs(chunkFZVAJFRH_cjs.SyncLinkRow, { children: [
11271
+ actions: orderedFolders.length > 0 && /* @__PURE__ */ jsxRuntime.jsxs(chunkRHKFCSFC_cjs.SyncLinkRow, { children: [
11189
11272
  /* @__PURE__ */ jsxRuntime.jsx(
11190
- chunkFZVAJFRH_cjs.SyncLinkButton,
11273
+ chunkRHKFCSFC_cjs.SyncLinkButton,
11191
11274
  {
11192
11275
  onClick: () => setExpandAllNonce((n) => n + 1),
11193
11276
  testId: "drive-folders-expand-all",
@@ -11195,7 +11278,7 @@ function ConnectedDriveSyncDialog({
11195
11278
  }
11196
11279
  ),
11197
11280
  /* @__PURE__ */ jsxRuntime.jsx(
11198
- chunkFZVAJFRH_cjs.SyncLinkButton,
11281
+ chunkRHKFCSFC_cjs.SyncLinkButton,
11199
11282
  {
11200
11283
  onClick: () => setCollapseAllNonce((n) => n + 1),
11201
11284
  testId: "drive-folders-collapse-all",
@@ -11203,19 +11286,19 @@ function ConnectedDriveSyncDialog({
11203
11286
  }
11204
11287
  )
11205
11288
  ] }),
11206
- children: foldersLoading ? /* @__PURE__ */ jsxRuntime.jsx(chunkFZVAJFRH_cjs.SyncLoading, { children: "Loading folders\u2026" }) : needsReconnect ? /* @__PURE__ */ jsxRuntime.jsx(
11207
- chunkFZVAJFRH_cjs.SyncReconnectNotice,
11289
+ children: foldersLoading ? /* @__PURE__ */ jsxRuntime.jsx(chunkRHKFCSFC_cjs.SyncLoading, { children: "Loading folders\u2026" }) : needsReconnect ? /* @__PURE__ */ jsxRuntime.jsx(
11290
+ chunkRHKFCSFC_cjs.SyncReconnectNotice,
11208
11291
  {
11209
11292
  ...reconnectButtonProps,
11210
11293
  message: `Reconnect ${catalog.display_name} to enable ${productName} \u2014 your account needs to grant file access.`
11211
11294
  }
11212
11295
  ) : foldersError ? /* @__PURE__ */ jsxRuntime.jsx(
11213
- chunkFZVAJFRH_cjs.SyncReconnectNotice,
11296
+ chunkRHKFCSFC_cjs.SyncReconnectNotice,
11214
11297
  {
11215
11298
  ...reconnectButtonProps,
11216
11299
  message: `Couldn\u2019t load folders from ${productName}. Reconnect the account and try again.`
11217
11300
  }
11218
- ) : orderedFolders.length === 0 ? /* @__PURE__ */ jsxRuntime.jsx(chunkFZVAJFRH_cjs.SyncNote, { children: "No folders found." }) : /* @__PURE__ */ jsxRuntime.jsx(chunkFZVAJFRH_cjs.SyncTreeFrame, { children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "space-y-0.5", "data-testid": "drive-folder-tree", children: orderedFolders.map((f) => /* @__PURE__ */ jsxRuntime.jsx(
11301
+ ) : orderedFolders.length === 0 ? /* @__PURE__ */ jsxRuntime.jsx(chunkRHKFCSFC_cjs.SyncNote, { children: "No folders found." }) : /* @__PURE__ */ jsxRuntime.jsx(chunkRHKFCSFC_cjs.SyncTreeFrame, { children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "space-y-0.5", "data-testid": "drive-folder-tree", children: orderedFolders.map((f) => /* @__PURE__ */ jsxRuntime.jsx(
11219
11302
  DriveFolderNode,
11220
11303
  {
11221
11304
  vendorKey: catalog.vendor_key,
@@ -11232,9 +11315,9 @@ function ConnectedDriveSyncDialog({
11232
11315
  )) }) })
11233
11316
  }
11234
11317
  ),
11235
- /* @__PURE__ */ jsxRuntime.jsxs(chunkFZVAJFRH_cjs.SyncOptions, { children: [
11318
+ /* @__PURE__ */ jsxRuntime.jsxs(chunkRHKFCSFC_cjs.SyncOptions, { children: [
11236
11319
  /* @__PURE__ */ jsxRuntime.jsx(
11237
- chunkFZVAJFRH_cjs.SyncOptionToggle,
11320
+ chunkRHKFCSFC_cjs.SyncOptionToggle,
11238
11321
  {
11239
11322
  checked: skipDuplicates,
11240
11323
  onCheckedChange: setSkipDuplicates,
@@ -11243,7 +11326,7 @@ function ConnectedDriveSyncDialog({
11243
11326
  }
11244
11327
  ),
11245
11328
  /* @__PURE__ */ jsxRuntime.jsx(
11246
- chunkFZVAJFRH_cjs.SyncOptionToggle,
11329
+ chunkRHKFCSFC_cjs.SyncOptionToggle,
11247
11330
  {
11248
11331
  checked: autoRename,
11249
11332
  onCheckedChange: setAutoRename,
@@ -11252,7 +11335,7 @@ function ConnectedDriveSyncDialog({
11252
11335
  }
11253
11336
  ),
11254
11337
  /* @__PURE__ */ jsxRuntime.jsx(
11255
- chunkFZVAJFRH_cjs.SyncOptionToggle,
11338
+ chunkRHKFCSFC_cjs.SyncOptionToggle,
11256
11339
  {
11257
11340
  checked: shared,
11258
11341
  onCheckedChange: setShared,
@@ -11261,7 +11344,7 @@ function ConnectedDriveSyncDialog({
11261
11344
  }
11262
11345
  ),
11263
11346
  /* @__PURE__ */ jsxRuntime.jsx(
11264
- chunkFZVAJFRH_cjs.SyncOptionToggle,
11347
+ chunkRHKFCSFC_cjs.SyncOptionToggle,
11265
11348
  {
11266
11349
  checked: autoSync,
11267
11350
  onCheckedChange: setAutoSync,
@@ -11273,7 +11356,7 @@ function ConnectedDriveSyncDialog({
11273
11356
  ] })
11274
11357
  ] }),
11275
11358
  /* @__PURE__ */ jsxRuntime.jsx(
11276
- chunkFZVAJFRH_cjs.SyncDialogFooter,
11359
+ chunkRHKFCSFC_cjs.SyncDialogFooter,
11277
11360
  {
11278
11361
  onCancel: () => onOpenChange(false),
11279
11362
  onSave: handleEnableSubmit,
@@ -11287,6 +11370,46 @@ function ConnectedDriveSyncDialog({
11287
11370
  }
11288
11371
  );
11289
11372
  }
11373
+ function ConnectedSharePointAdminConsentPage({
11374
+ result: givenResult
11375
+ } = {}) {
11376
+ const queryResult = React7.useMemo(() => new URLSearchParams(window.location.search).get("result"), []);
11377
+ const result = givenResult === void 0 ? queryResult : givenResult;
11378
+ const { apiBaseUrl } = chunk2QQUGL2V_cjs.useBlocksEnvironment().runtimeConfig;
11379
+ const consentUrl = `${apiBaseUrl}/v1/connectors/microsoft_sharepoint/admin-consent`;
11380
+ return /* @__PURE__ */ jsxRuntime.jsx(chunkS4G3DNMA_cjs.ConsentPage, { children: /* @__PURE__ */ jsxRuntime.jsxs(chunkS4G3DNMA_cjs.ConsentCard, { size: "md", children: [
11381
+ /* @__PURE__ */ jsxRuntime.jsx(
11382
+ chunkS4G3DNMA_cjs.ConsentHeader,
11383
+ {
11384
+ icon: /* @__PURE__ */ jsxRuntime.jsx(chunkEWWVKXEQ_cjs.VendorLogo, { vendorKey: "microsoft_sharepoint", product: "sharepoint" }),
11385
+ title: "Approve ARBI for SharePoint access",
11386
+ children: "A member of your organization uses ARBI and wants to sync documents from SharePoint. Your Microsoft 365 organization requires an administrator to approve this once for the whole organization."
11387
+ }
11388
+ ),
11389
+ result === "granted" && /* @__PURE__ */ jsxRuntime.jsx(chunkS4G3DNMA_cjs.ConsentNotice, { tone: "success", title: "Access approved \u2014 you\u2019re all set.", className: "mt-4", children: "People in your organization can now connect SharePoint from their own ARBI account. Nothing is synced until each user connects and chooses what to import." }),
11390
+ result === "declined" && /* @__PURE__ */ jsxRuntime.jsx(chunkS4G3DNMA_cjs.ConsentNotice, { tone: "warning", title: "The approval didn\u2019t complete.", className: "mt-4", children: "The request was declined or canceled on the Microsoft screen. You can try again below \u2014 you must sign in with a Microsoft 365 administrator account of your organization." }),
11391
+ /* @__PURE__ */ jsxRuntime.jsxs(chunkS4G3DNMA_cjs.ConsentSection, { title: "What you are approving", children: [
11392
+ /* @__PURE__ */ jsxRuntime.jsx(
11393
+ chunkS4G3DNMA_cjs.ConsentBulletList,
11394
+ {
11395
+ items: [
11396
+ /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
11397
+ /* @__PURE__ */ jsxRuntime.jsx(chunkS4G3DNMA_cjs.ConsentStrong, { children: "Read SharePoint sites and files" }),
11398
+ " \u2014 lets each user who connects their own account import documents from sites they already have access to. ARBI never gets more access than the user has."
11399
+ ] }),
11400
+ /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
11401
+ /* @__PURE__ */ jsxRuntime.jsx(chunkS4G3DNMA_cjs.ConsentStrong, { children: "Sign users in and keep access" }),
11402
+ " \u2014 standard sign-in (openid, profile, email) and offline access so syncs keep working between sessions."
11403
+ ] })
11404
+ ]
11405
+ }
11406
+ ),
11407
+ /* @__PURE__ */ jsxRuntime.jsx(chunkS4G3DNMA_cjs.ConsentText, { children: "Approving does not sync anything by itself and grants ARBI no standing access to your tenant. Each user still connects their own Microsoft account, and their tokens are end-to-end encrypted so ARBI\u2019s servers cannot read them at rest." }),
11408
+ /* @__PURE__ */ jsxRuntime.jsx(ui.Button, { asChild: true, className: "w-full pointer-coarse:h-11", children: /* @__PURE__ */ jsxRuntime.jsx("a", { href: consentUrl, children: "Review and approve in Microsoft" }) }),
11409
+ /* @__PURE__ */ jsxRuntime.jsx(chunkS4G3DNMA_cjs.ConsentText, { variant: "footnote", children: "You\u2019ll sign in at login.microsoftonline.com and see Microsoft\u2019s own summary of these permissions before anything is granted." })
11410
+ ] })
11411
+ ] }) });
11412
+ }
11290
11413
  var focus = null;
11291
11414
  var listeners2 = /* @__PURE__ */ new Set();
11292
11415
  function requestProjectBillingFocus(next) {
@@ -11305,7 +11428,7 @@ function BillingProjectEntity({
11305
11428
  subscription = "none",
11306
11429
  ...props
11307
11430
  }) {
11308
- const { stripeEnabled } = chunkF2BYURQZ_cjs.useBillingSupport();
11431
+ const { stripeEnabled } = chunkLYF47OXX_cjs.useBillingSupport();
11309
11432
  const isPaid2 = stripeEnabled && (subscription === "active" || subscription === "past_due" || subscription === "dev");
11310
11433
  return /* @__PURE__ */ jsxRuntime.jsx(ui.ProjectEntity, { ...props, subscription, isPaid: isPaid2 });
11311
11434
  }
@@ -11332,8 +11455,8 @@ function InvoicesModal({
11332
11455
  key: inv.number ?? String(i),
11333
11456
  date: formatInvoiceDate(inv.date),
11334
11457
  kind: KIND_LABELS2[inv.kind],
11335
- amount: chunkF2BYURQZ_cjs.formatMoney(inv.amount, inv.currency),
11336
- amountNote: inv.amount_ex_vat != null && inv.amount_ex_vat !== inv.amount ? `${chunkF2BYURQZ_cjs.formatMoney(inv.amount_ex_vat, inv.currency)} ex VAT` : void 0,
11458
+ amount: chunkLYF47OXX_cjs.formatMoney(inv.amount, inv.currency),
11459
+ amountNote: inv.amount_ex_vat != null && inv.amount_ex_vat !== inv.amount ? `${chunkLYF47OXX_cjs.formatMoney(inv.amount_ex_vat, inv.currency)} ex VAT` : void 0,
11337
11460
  status: inv.status,
11338
11461
  isPaid: isPaid2,
11339
11462
  href: inv.hosted_invoice_url ?? inv.url ?? inv.pdf_url ?? void 0,
@@ -11341,7 +11464,7 @@ function InvoicesModal({
11341
11464
  };
11342
11465
  });
11343
11466
  return /* @__PURE__ */ jsxRuntime.jsx(
11344
- chunkFZVAJFRH_cjs.InvoicesDialog,
11467
+ chunkRHKFCSFC_cjs.InvoicesDialog,
11345
11468
  {
11346
11469
  open,
11347
11470
  onOpenChange,
@@ -11368,7 +11491,7 @@ function StripeCheckoutModal({
11368
11491
  const [clientSecret, setClientSecret] = React7.useState(null);
11369
11492
  const [isCreating, setIsCreating] = React7.useState(false);
11370
11493
  const [stripe, setStripe] = React7.useState(null);
11371
- const { stripeEnabled, checkout } = chunkF2BYURQZ_cjs.useBillingSupport();
11494
+ const { stripeEnabled, checkout } = chunkLYF47OXX_cjs.useBillingSupport();
11372
11495
  const createCheckout = react.useCreateProjectCheckout();
11373
11496
  const refreshProject = react.useRefreshProject();
11374
11497
  const invalidateProjects = react.useInvalidateProjects();
@@ -11395,7 +11518,7 @@ function StripeCheckoutModal({
11395
11518
  projectExtId,
11396
11519
  body: {
11397
11520
  interval,
11398
- packs: chunkF2BYURQZ_cjs.PRO_PACKS,
11521
+ packs: chunkLYF47OXX_cjs.PRO_PACKS,
11399
11522
  ai_blocks: aiBlocks,
11400
11523
  storage_blocks: storageBlocks,
11401
11524
  addon_budget_pence: addonBudgetPence,
@@ -11411,7 +11534,7 @@ function StripeCheckoutModal({
11411
11534
  },
11412
11535
  onError: (error) => {
11413
11536
  console.error("Failed to create checkout session:", error);
11414
- const reason = chunkF2BYURQZ_cjs.apiErrorDetail(error)?.message;
11537
+ const reason = chunkLYF47OXX_cjs.apiErrorDetail(error)?.message;
11415
11538
  shell.notify.error(
11416
11539
  reason ? `Checkout didn't start: ${reason}` : "Checkout didn't start. Try again."
11417
11540
  );
@@ -11444,9 +11567,9 @@ function StripeCheckoutModal({
11444
11567
  }
11445
11568
  }, [open]);
11446
11569
  const isStripeConfigured = stripeEnabled;
11447
- const vatNote = quote ? `${chunkF2BYURQZ_cjs.checkoutItemsLabel(aiBlocks, storageBlocks)} \xB7 ${chunkF2BYURQZ_cjs.quoteTotalLine(quote)}` : null;
11570
+ const vatNote = quote ? `${chunkLYF47OXX_cjs.checkoutItemsLabel(aiBlocks, storageBlocks)} \xB7 ${chunkLYF47OXX_cjs.quoteTotalLine(quote)}` : null;
11448
11571
  return /* @__PURE__ */ jsxRuntime.jsx(
11449
- chunkFZVAJFRH_cjs.CheckoutDialogFrame,
11572
+ chunkRHKFCSFC_cjs.CheckoutDialogFrame,
11450
11573
  {
11451
11574
  open,
11452
11575
  onOpenChange,
@@ -11456,7 +11579,7 @@ function StripeCheckoutModal({
11456
11579
  children: clientSecret && !!stripe && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
11457
11580
  vatNote && /* @__PURE__ */ jsxRuntime.jsx("p", { "data-testid": "checkout-vat-note", className: "mb-4 text-sm text-muted-foreground", children: vatNote }),
11458
11581
  checkout?.render(stripe, { clientSecret, onComplete: handleComplete }),
11459
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "mt-3", children: /* @__PURE__ */ jsxRuntime.jsxs(chunkFZVAJFRH_cjs.MoreInfo, { title: "Paying", label: "Payment help", testId: "checkout-payment-help", children: [
11582
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "mt-3", children: /* @__PURE__ */ jsxRuntime.jsxs(chunkRHKFCSFC_cjs.MoreInfo, { title: "Paying", label: "Payment help", testId: "checkout-payment-help", children: [
11460
11583
  /* @__PURE__ */ jsxRuntime.jsx("p", { "data-testid": "checkout-decline-note", children: "Card declined? Nothing was charged. Try again or use another card." }),
11461
11584
  /* @__PURE__ */ jsxRuntime.jsx("p", { "data-testid": "checkout-vat-id-note", children: "No VAT number? Leave \u2018purchasing as a business\u2019 unticked." }),
11462
11585
  /* @__PURE__ */ jsxRuntime.jsx("p", { children: "Add-ons chosen here are on the first invoice with the plan and renew with it until you reduce them." })
@@ -11498,31 +11621,31 @@ function defaultBillingCountry(languages = typeof navigator === "undefined" ? []
11498
11621
  }
11499
11622
  var choiceForPacks = (packs) => packs > 0 ? "pro" : "free";
11500
11623
  function proCard(selected, isAnnual, prices) {
11501
- const packs = chunkF2BYURQZ_cjs.PLAN_CHOICE_PACKS.pro;
11624
+ const packs = chunkLYF47OXX_cjs.PLAN_CHOICE_PACKS.pro;
11502
11625
  const currency = prices.monthly?.currency ?? prices.annual?.currency ?? "gbp";
11503
- const monthly = chunkF2BYURQZ_cjs.packPrice(prices.monthly, packs);
11504
- const annual = chunkF2BYURQZ_cjs.packPrice(prices.annual, packs);
11626
+ const monthly = chunkLYF47OXX_cjs.packPrice(prices.monthly, packs);
11627
+ const annual = chunkLYF47OXX_cjs.packPrice(prices.annual, packs);
11505
11628
  const current2 = isAnnual ? annual : monthly;
11506
11629
  const effectiveMonthly = current2 ? isAnnual ? current2.amount_ex_vat / 12 : current2.amount_ex_vat : null;
11507
11630
  return {
11508
11631
  id: packs,
11509
- name: chunkF2BYURQZ_cjs.planNameForPacks(packs),
11632
+ name: chunkLYF47OXX_cjs.planNameForPacks(packs),
11510
11633
  isSelected: selected === "pro",
11511
11634
  price: current2 && effectiveMonthly != null ? {
11512
11635
  annual: isAnnual,
11513
- yearlyStrike: isAnnual && monthly && monthly.amount_ex_vat * 12 > current2.amount_ex_vat ? chunkF2BYURQZ_cjs.formatMoney(monthly.amount_ex_vat * 12, currency) : void 0,
11514
- yearlyTotal: isAnnual ? chunkF2BYURQZ_cjs.formatMoney(current2.amount_ex_vat, currency) : void 0,
11636
+ yearlyStrike: isAnnual && monthly && monthly.amount_ex_vat * 12 > current2.amount_ex_vat ? chunkLYF47OXX_cjs.formatMoney(monthly.amount_ex_vat * 12, currency) : void 0,
11637
+ yearlyTotal: isAnnual ? chunkLYF47OXX_cjs.formatMoney(current2.amount_ex_vat, currency) : void 0,
11515
11638
  intervalLabel: isAnnual ? "/yr + VAT" : "/mo",
11516
- monthly: chunkF2BYURQZ_cjs.formatMoney(Math.round(effectiveMonthly), currency),
11639
+ monthly: chunkLYF47OXX_cjs.formatMoney(Math.round(effectiveMonthly), currency),
11517
11640
  taxLabel: "+ VAT",
11518
11641
  // The inclusive figure for a UK customer, right under the headline.
11519
- note: `${chunkF2BYURQZ_cjs.formatMoney(current2.amount, currency)}${isAnnual ? "/yr" : "/mo"} incl. UK VAT`
11642
+ note: `${chunkLYF47OXX_cjs.formatMoney(current2.amount, currency)}${isAnnual ? "/yr" : "/mo"} incl. UK VAT`
11520
11643
  } : void 0,
11521
11644
  features: [
11522
- `${react.formatGbp(chunkF2BYURQZ_cjs.PRO_AI_GBP)} of AI usage / month`,
11523
- `${chunkF2BYURQZ_cjs.PRO_STORAGE_GB} GB storage`,
11645
+ `${react.formatGbp(chunkLYF47OXX_cjs.PRO_AI_GBP)} of AI usage / month`,
11646
+ `${chunkLYF47OXX_cjs.PRO_STORAGE_GB} GB storage`,
11524
11647
  "Unlimited collaborators",
11525
- ...isAnnual ? [chunkF2BYURQZ_cjs.ANNUAL_PREMIUM_AI_NOTE] : []
11648
+ ...isAnnual ? [chunkLYF47OXX_cjs.ANNUAL_PREMIUM_AI_NOTE] : []
11526
11649
  ]
11527
11650
  };
11528
11651
  }
@@ -11534,9 +11657,9 @@ function buildPlanCards(selected, isAnnual, prices, isOnFree) {
11534
11657
  isCurrent: isOnFree,
11535
11658
  isSelected: selected === "free" && !isOnFree,
11536
11659
  features: [
11537
- `${react.formatGbp(chunkF2BYURQZ_cjs.FREE_AI_GBP)} of AI usage / month`,
11538
- `${chunkF2BYURQZ_cjs.FREE_STORAGE_MB.toLocaleString("en-US")} MB storage`,
11539
- chunkF2BYURQZ_cjs.FREE_COLLABORATORS === 0 ? "Just you" : `${chunkF2BYURQZ_cjs.FREE_COLLABORATORS} collaborators`
11660
+ `${react.formatGbp(chunkLYF47OXX_cjs.FREE_AI_GBP)} of AI usage / month`,
11661
+ `${chunkLYF47OXX_cjs.FREE_STORAGE_MB.toLocaleString("en-US")} MB storage`,
11662
+ chunkLYF47OXX_cjs.FREE_COLLABORATORS === 0 ? "Just you" : `${chunkLYF47OXX_cjs.FREE_COLLABORATORS} collaborators`
11540
11663
  ]
11541
11664
  };
11542
11665
  return [free, proCard(selected, isAnnual, prices)];
@@ -11549,7 +11672,7 @@ function PlanChoiceCards({
11549
11672
  isOnFree = false
11550
11673
  }) {
11551
11674
  return /* @__PURE__ */ jsxRuntime.jsx(
11552
- chunkFZVAJFRH_cjs.PlanCardGrid,
11675
+ chunkRHKFCSFC_cjs.PlanCardGrid,
11553
11676
  {
11554
11677
  plans: buildPlanCards(selected, isAnnual, prices, isOnFree),
11555
11678
  onSelect: (id) => onSelect(choiceForPacks(id))
@@ -11558,13 +11681,13 @@ function PlanChoiceCards({
11558
11681
  }
11559
11682
  function PlanInfoPopover2() {
11560
11683
  const { openSettings } = chunk2QQUGL2V_cjs.useBlocksEnvironment();
11561
- return /* @__PURE__ */ jsxRuntime.jsx(chunkFZVAJFRH_cjs.PlanInfoPopover, { onOpenModelList: () => openSettings("chat") });
11684
+ return /* @__PURE__ */ jsxRuntime.jsx(chunkRHKFCSFC_cjs.PlanInfoPopover, { onOpenModelList: () => openSettings("chat") });
11562
11685
  }
11563
11686
  function CheckoutAddonBudget({
11564
11687
  value,
11565
11688
  onChange
11566
11689
  }) {
11567
- const budget = chunkF2BYURQZ_cjs.parseBudgetPounds(value);
11690
+ const budget = chunkLYF47OXX_cjs.parseBudgetPounds(value);
11568
11691
  return /* @__PURE__ */ jsxRuntime.jsxs(
11569
11692
  "div",
11570
11693
  {
@@ -11587,7 +11710,7 @@ function CheckoutAddonBudget({
11587
11710
  step: 25,
11588
11711
  className: "h-8 w-24",
11589
11712
  value,
11590
- placeholder: String(chunkF2BYURQZ_cjs.DEFAULT_SPEND_CAP_PENCE / 100),
11713
+ placeholder: String(chunkLYF47OXX_cjs.DEFAULT_SPEND_CAP_PENCE / 100),
11591
11714
  onChange: (e) => onChange(e.target.value),
11592
11715
  "aria-invalid": budget === void 0,
11593
11716
  "data-testid": "checkout-addon-budget-input"
@@ -11605,7 +11728,7 @@ function BlockStepper({
11605
11728
  onChange,
11606
11729
  testId
11607
11730
  }) {
11608
- const set2 = (n) => onChange(Math.max(0, Math.min(chunkF2BYURQZ_cjs.MAX_CHECKOUT_BLOCKS, n)));
11731
+ const set2 = (n) => onChange(Math.max(0, Math.min(chunkLYF47OXX_cjs.MAX_CHECKOUT_BLOCKS, n)));
11609
11732
  return /* @__PURE__ */ jsxRuntime.jsxs(
11610
11733
  "div",
11611
11734
  {
@@ -11649,7 +11772,7 @@ function BlockStepper({
11649
11772
  className: "size-8",
11650
11773
  "aria-label": `More: ${label}`,
11651
11774
  onClick: () => set2(value + 1),
11652
- disabled: value >= chunkF2BYURQZ_cjs.MAX_CHECKOUT_BLOCKS,
11775
+ disabled: value >= chunkLYF47OXX_cjs.MAX_CHECKOUT_BLOCKS,
11653
11776
  "data-testid": `${testId}-increment`,
11654
11777
  children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Plus, { className: "size-4" })
11655
11778
  }
@@ -11666,8 +11789,8 @@ function CheckoutAddonBlocks({
11666
11789
  onStorageBlocksChange,
11667
11790
  price
11668
11791
  }) {
11669
- const ai = chunkF2BYURQZ_cjs.addonPrice(price, "ai_usage");
11670
- const storage = chunkF2BYURQZ_cjs.addonPrice(price, "storage");
11792
+ const ai = chunkLYF47OXX_cjs.addonPrice(price, "ai_usage");
11793
+ const storage = chunkLYF47OXX_cjs.addonPrice(price, "storage");
11671
11794
  return /* @__PURE__ */ jsxRuntime.jsxs(
11672
11795
  "div",
11673
11796
  {
@@ -11677,8 +11800,8 @@ function CheckoutAddonBlocks({
11677
11800
  /* @__PURE__ */ jsxRuntime.jsx(
11678
11801
  BlockStepper,
11679
11802
  {
11680
- label: `+${react.formatGbp(ai?.ai_gbp || chunkF2BYURQZ_cjs.ADDON_BLOCK_AI_GBP)} of AI usage`,
11681
- priceText: chunkF2BYURQZ_cjs.checkoutBlockPriceText(price, "ai_usage"),
11803
+ label: `+${react.formatGbp(ai?.ai_gbp || chunkLYF47OXX_cjs.ADDON_BLOCK_AI_GBP)} of AI usage`,
11804
+ priceText: chunkLYF47OXX_cjs.checkoutBlockPriceText(price, "ai_usage"),
11682
11805
  value: aiBlocks,
11683
11806
  onChange: onAiBlocksChange,
11684
11807
  testId: "checkout-ai-blocks"
@@ -11687,8 +11810,8 @@ function CheckoutAddonBlocks({
11687
11810
  /* @__PURE__ */ jsxRuntime.jsx(
11688
11811
  BlockStepper,
11689
11812
  {
11690
- label: `+${storage?.storage_gb || chunkF2BYURQZ_cjs.STORAGE_BLOCK_GB} GB storage`,
11691
- priceText: chunkF2BYURQZ_cjs.checkoutBlockPriceText(price, "storage"),
11813
+ label: `+${storage?.storage_gb || chunkLYF47OXX_cjs.STORAGE_BLOCK_GB} GB storage`,
11814
+ priceText: chunkLYF47OXX_cjs.checkoutBlockPriceText(price, "storage"),
11692
11815
  value: storageBlocks,
11693
11816
  onChange: onStorageBlocksChange,
11694
11817
  testId: "checkout-storage-blocks"
@@ -11743,14 +11866,14 @@ function ConnectedReferralRewardSummary({
11743
11866
  if (!reward) return null;
11744
11867
  const applied = totalCents != null && currency ? applyReferralReward(totalCents, reward, currency) : null;
11745
11868
  return /* @__PURE__ */ jsxRuntime.jsx(
11746
- chunkFZVAJFRH_cjs.ReferralRewardSummary,
11869
+ chunkRHKFCSFC_cjs.ReferralRewardSummary,
11747
11870
  {
11748
- amountLabel: chunkF2BYURQZ_cjs.formatMoney(reward.amount, reward.currency),
11871
+ amountLabel: chunkLYF47OXX_cjs.formatMoney(reward.amount, reward.currency),
11749
11872
  breakdown: applied && totalCents != null && currency ? {
11750
- subtotal: chunkF2BYURQZ_cjs.formatMoney(totalCents, currency),
11751
- reward: chunkF2BYURQZ_cjs.formatMoney(applied.bonus, currency),
11752
- youPay: chunkF2BYURQZ_cjs.formatMoney(applied.youPay, currency),
11753
- rollover: applied.remaining > 0 ? chunkF2BYURQZ_cjs.formatMoney(applied.remaining, currency) : void 0
11873
+ subtotal: chunkLYF47OXX_cjs.formatMoney(totalCents, currency),
11874
+ reward: chunkLYF47OXX_cjs.formatMoney(applied.bonus, currency),
11875
+ youPay: chunkLYF47OXX_cjs.formatMoney(applied.youPay, currency),
11876
+ rollover: applied.remaining > 0 ? chunkLYF47OXX_cjs.formatMoney(applied.remaining, currency) : void 0
11754
11877
  } : void 0
11755
11878
  }
11756
11879
  );
@@ -11758,7 +11881,7 @@ function ConnectedReferralRewardSummary({
11758
11881
  function ConnectedReferralRewardNote() {
11759
11882
  const reward = useReferralReward();
11760
11883
  if (!reward) return null;
11761
- return /* @__PURE__ */ jsxRuntime.jsx(chunkFZVAJFRH_cjs.ReferralRewardNote, { amountLabel: chunkF2BYURQZ_cjs.formatMoney(reward.amount, reward.currency) });
11884
+ return /* @__PURE__ */ jsxRuntime.jsx(chunkRHKFCSFC_cjs.ReferralRewardNote, { amountLabel: chunkLYF47OXX_cjs.formatMoney(reward.amount, reward.currency) });
11762
11885
  }
11763
11886
  function CheckoutTotal({
11764
11887
  state,
@@ -11787,7 +11910,7 @@ function CheckoutTotal({
11787
11910
  className: "text-sm font-medium text-foreground",
11788
11911
  "data-testid": "checkout-total",
11789
11912
  "aria-live": "polite",
11790
- children: state.quote && !state.isLoading ? chunkF2BYURQZ_cjs.quoteTotalLine(state.quote) : state.isLoading ? "Calculating total\u2026" : state.error
11913
+ children: state.quote && !state.isLoading ? chunkLYF47OXX_cjs.quoteTotalLine(state.quote) : state.isLoading ? "Calculating total\u2026" : state.error
11791
11914
  }
11792
11915
  )
11793
11916
  ] });
@@ -11820,13 +11943,13 @@ function useCheckoutQuote({
11820
11943
  ...aiBlocks || storageBlocks ? { addons: { ai_usage: aiBlocks, storage: storageBlocks } } : {}
11821
11944
  } : null
11822
11945
  );
11823
- const { code, message } = query.isError ? chunkF2BYURQZ_cjs.quoteError(query.error) : {};
11824
- const locationInvalid = code === chunkF2BYURQZ_cjs.TAX_LOCATION_INVALID;
11946
+ const { code, message } = query.isError ? chunkLYF47OXX_cjs.quoteError(query.error) : {};
11947
+ const locationInvalid = code === chunkLYF47OXX_cjs.TAX_LOCATION_INVALID;
11825
11948
  const isLoading = enabled && (query.isLoading || postal !== postalCode.trim());
11826
11949
  return {
11827
11950
  quote: query.data,
11828
11951
  isLoading,
11829
- showPostcode: chunkF2BYURQZ_cjs.POSTCODE_COUNTRIES.includes(country) || locationInvalid || postalCode !== "",
11952
+ showPostcode: chunkLYF47OXX_cjs.POSTCODE_COUNTRIES.includes(country) || locationInvalid || postalCode !== "",
11830
11953
  error: query.isError ? locationInvalid ? message ?? "Enter your ZIP / postal code to see the total." : message ?? "Couldn't calculate tax. Stripe shows the total next." : null,
11831
11954
  canContinue: !isLoading && (!!query.data || query.isError && !locationInvalid)
11832
11955
  };
@@ -11835,7 +11958,7 @@ function SubscriptionPlans({ projectExtId, onDismiss }) {
11835
11958
  const { data: products, isLoading, error } = react.useProducts();
11836
11959
  const [isAnnual, setIsAnnual] = React7.useState(false);
11837
11960
  const [promoCode, setPromoCode] = React7.useState("");
11838
- const [addonBudget, setAddonBudget] = React7.useState(String(chunkF2BYURQZ_cjs.DEFAULT_SPEND_CAP_PENCE / 100));
11961
+ const [addonBudget, setAddonBudget] = React7.useState(String(chunkLYF47OXX_cjs.DEFAULT_SPEND_CAP_PENCE / 100));
11839
11962
  const [checkoutBudget, setCheckoutBudget] = React7.useState(null);
11840
11963
  const [aiBlocks, setAiBlocks] = React7.useState(0);
11841
11964
  const [storageBlocks, setStorageBlocks] = React7.useState(0);
@@ -11853,31 +11976,31 @@ function SubscriptionPlans({ projectExtId, onDismiss }) {
11853
11976
  storageBlocks,
11854
11977
  enabled: !!products?.length
11855
11978
  });
11856
- if (isLoading) return /* @__PURE__ */ jsxRuntime.jsx(chunkFZVAJFRH_cjs.PlanNotice, { children: "Loading plans\u2026" });
11857
- if (error) return /* @__PURE__ */ jsxRuntime.jsx(chunkFZVAJFRH_cjs.PlanNotice, { tone: "error", children: "Plans didn't load. Try again." });
11858
- if (!products || products.length === 0) return /* @__PURE__ */ jsxRuntime.jsx(chunkFZVAJFRH_cjs.PlanNotice, { children: "No plans available." });
11859
- const prices = chunkF2BYURQZ_cjs.findProPrices(products);
11979
+ if (isLoading) return /* @__PURE__ */ jsxRuntime.jsx(chunkRHKFCSFC_cjs.PlanNotice, { children: "Loading plans\u2026" });
11980
+ if (error) return /* @__PURE__ */ jsxRuntime.jsx(chunkRHKFCSFC_cjs.PlanNotice, { tone: "error", children: "Plans didn't load. Try again." });
11981
+ if (!products || products.length === 0) return /* @__PURE__ */ jsxRuntime.jsx(chunkRHKFCSFC_cjs.PlanNotice, { children: "No plans available." });
11982
+ const prices = chunkLYF47OXX_cjs.findProPrices(products);
11860
11983
  const intervalPrice = isAnnual ? prices.annual : prices.monthly;
11861
- const selectedPrice = chunkF2BYURQZ_cjs.packPrice(intervalPrice);
11984
+ const selectedPrice = chunkLYF47OXX_cjs.packPrice(intervalPrice);
11862
11985
  if (!intervalPrice) return null;
11863
11986
  const interval = isAnnual ? "year" : "month";
11864
- const savingsPercent = chunkF2BYURQZ_cjs.calcSavingsPercent(prices.monthly, prices.annual);
11987
+ const savingsPercent = chunkLYF47OXX_cjs.calcSavingsPercent(prices.monthly, prices.annual);
11865
11988
  const handleSubscribe = () => {
11866
11989
  setCheckoutInterval(interval);
11867
- const parsed = chunkF2BYURQZ_cjs.parseBudgetPounds(addonBudget);
11868
- setCheckoutBudget(parsed == null || parsed === chunkF2BYURQZ_cjs.DEFAULT_SPEND_CAP_PENCE ? null : parsed);
11990
+ const parsed = chunkLYF47OXX_cjs.parseBudgetPounds(addonBudget);
11991
+ setCheckoutBudget(parsed == null || parsed === chunkLYF47OXX_cjs.DEFAULT_SPEND_CAP_PENCE ? null : parsed);
11869
11992
  setCheckoutQuote(quote.quote);
11870
11993
  setIsCheckoutModalOpen(true);
11871
11994
  };
11872
11995
  return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
11873
- /* @__PURE__ */ jsxRuntime.jsxs(chunkFZVAJFRH_cjs.PlanStack, { children: [
11996
+ /* @__PURE__ */ jsxRuntime.jsxs(chunkRHKFCSFC_cjs.PlanStack, { children: [
11874
11997
  /* @__PURE__ */ jsxRuntime.jsx(
11875
- chunkFZVAJFRH_cjs.PlanPickerHeader,
11998
+ chunkRHKFCSFC_cjs.PlanPickerHeader,
11876
11999
  {
11877
12000
  title: "Plan",
11878
12001
  info: /* @__PURE__ */ jsxRuntime.jsx(PlanInfoPopover2, {}),
11879
12002
  toggle: /* @__PURE__ */ jsxRuntime.jsx(
11880
- chunkFZVAJFRH_cjs.PricingToggle,
12003
+ chunkRHKFCSFC_cjs.PricingToggle,
11881
12004
  {
11882
12005
  isAnnual,
11883
12006
  onToggle: () => setIsAnnual(!isAnnual),
@@ -11914,7 +12037,7 @@ function SubscriptionPlans({ projectExtId, onDismiss }) {
11914
12037
  currency: intervalPrice.currency
11915
12038
  }
11916
12039
  ),
11917
- /* @__PURE__ */ jsxRuntime.jsx(chunkFZVAJFRH_cjs.PromoCodeInput, { value: promoCode, onChange: setPromoCode }),
12040
+ /* @__PURE__ */ jsxRuntime.jsx(chunkRHKFCSFC_cjs.PromoCodeInput, { value: promoCode, onChange: setPromoCode }),
11918
12041
  /* @__PURE__ */ jsxRuntime.jsx(
11919
12042
  CheckoutCountrySelect,
11920
12043
  {
@@ -11926,9 +12049,9 @@ function SubscriptionPlans({ projectExtId, onDismiss }) {
11926
12049
  }
11927
12050
  ),
11928
12051
  /* @__PURE__ */ jsxRuntime.jsx(CheckoutTotal, { state: quote, postalCode, onPostalCodeChange: setPostalCode }),
11929
- /* @__PURE__ */ jsxRuntime.jsxs(chunkFZVAJFRH_cjs.PlanActionRow, { children: [
12052
+ /* @__PURE__ */ jsxRuntime.jsxs(chunkRHKFCSFC_cjs.PlanActionRow, { children: [
11930
12053
  onDismiss && /* @__PURE__ */ jsxRuntime.jsx(
11931
- chunkFZVAJFRH_cjs.PlanActionButton,
12054
+ chunkRHKFCSFC_cjs.PlanActionButton,
11932
12055
  {
11933
12056
  tone: "muted",
11934
12057
  fill: true,
@@ -11939,11 +12062,11 @@ function SubscriptionPlans({ projectExtId, onDismiss }) {
11939
12062
  }
11940
12063
  ),
11941
12064
  /* @__PURE__ */ jsxRuntime.jsx(
11942
- chunkFZVAJFRH_cjs.PlanActionButton,
12065
+ chunkRHKFCSFC_cjs.PlanActionButton,
11943
12066
  {
11944
12067
  fill: true,
11945
12068
  onClick: handleSubscribe,
11946
- disabled: !selectedPrice || chunkF2BYURQZ_cjs.parseBudgetPounds(addonBudget) === void 0 || !quote.canContinue,
12069
+ disabled: !selectedPrice || chunkLYF47OXX_cjs.parseBudgetPounds(addonBudget) === void 0 || !quote.canContinue,
11947
12070
  size: "sm",
11948
12071
  "data-testid": "subscribe-button",
11949
12072
  children: "Continue to payment"
@@ -11983,7 +12106,7 @@ var FALLBACK_MESSAGES = {
11983
12106
  BILLING_ADDRESS_REQUIRED: "Add a billing address first."
11984
12107
  };
11985
12108
  function addonErrorMessage(error) {
11986
- const detail = chunkF2BYURQZ_cjs.apiErrorDetail(error);
12109
+ const detail = chunkLYF47OXX_cjs.apiErrorDetail(error);
11987
12110
  if (detail && typeof detail === "object") {
11988
12111
  const { code, message } = detail;
11989
12112
  if (message) return message;
@@ -12005,18 +12128,18 @@ function chargeRefusalMessage(error) {
12005
12128
  return code ? REFUSALS[code] : null;
12006
12129
  }
12007
12130
  function addonErrorCode(error) {
12008
- const detail = chunkF2BYURQZ_cjs.apiErrorDetail(error);
12131
+ const detail = chunkLYF47OXX_cjs.apiErrorDetail(error);
12009
12132
  if (detail && typeof detail === "object") {
12010
12133
  const code = detail.code;
12011
12134
  if (code && code in FALLBACK_MESSAGES) return code;
12012
12135
  }
12013
12136
  return null;
12014
12137
  }
12015
- var addedMessage = (kind, blockAiGbp, blockStorageGb) => kind === "ai_usage" ? `${react.formatGbp(blockAiGbp ?? chunkF2BYURQZ_cjs.ADDON_BLOCK_AI_GBP)} of AI usage added` : `${blockStorageGb ?? chunkF2BYURQZ_cjs.STORAGE_BLOCK_GB} GB added`;
12138
+ var addedMessage = (kind, blockAiGbp, blockStorageGb) => kind === "ai_usage" ? `${react.formatGbp(blockAiGbp ?? chunkLYF47OXX_cjs.ADDON_BLOCK_AI_GBP)} of AI usage added` : `${blockStorageGb ?? chunkLYF47OXX_cjs.STORAGE_BLOCK_GB} GB added`;
12016
12139
  function useAddonPurchase() {
12017
12140
  const addBlock = react.useAddProjectAddonBlock();
12018
12141
  const { mutate } = addBlock;
12019
- const { onAddonBlocksBought } = chunkF2BYURQZ_cjs.useBillingSupport();
12142
+ const { onAddonBlocksBought } = chunkLYF47OXX_cjs.useBillingSupport();
12020
12143
  const buy = React7.useCallback(
12021
12144
  (kind, projectExtId, options2) => {
12022
12145
  mutate(
@@ -12060,7 +12183,7 @@ function PlanChangeLines({
12060
12183
  isError,
12061
12184
  className
12062
12185
  }) {
12063
- const lines = preview ? chunkF2BYURQZ_cjs.planPreviewLines(preview) : [{ id: "pay-today", text: isError ? chunkF2BYURQZ_cjs.PAY_TODAY_UNPRICED : "Checking price\u2026" }];
12186
+ const lines = preview ? chunkLYF47OXX_cjs.planPreviewLines(preview) : [{ id: "pay-today", text: isError ? chunkLYF47OXX_cjs.PAY_TODAY_UNPRICED : "Checking price\u2026" }];
12064
12187
  return /* @__PURE__ */ jsxRuntime.jsx("div", { className, "data-testid": "plan-change-lines", children: lines.map((line) => /* @__PURE__ */ jsxRuntime.jsx("p", { "data-testid": `plan-change-${line.id}`, children: line.text }, line.id)) });
12065
12188
  }
12066
12189
  var BANK_CONFIRM_PLAN_CHANGE = "Confirm with your bank. Nothing is charged until you do.";
@@ -12068,13 +12191,13 @@ function notifyPlanChange(data, fallback, planName2) {
12068
12191
  const outcome = data?.plan_change;
12069
12192
  switch (outcome?.result) {
12070
12193
  case "upgraded": {
12071
- const plan = chunkF2BYURQZ_cjs.planNameForPacks(data?.addons?.packs ?? data?.packs);
12072
- const charged = outcome.charged_pence > 0 ? ` \xB7 ${chunkF2BYURQZ_cjs.formatMoney(outcome.charged_pence, "gbp")} charged` : "";
12194
+ const plan = chunkLYF47OXX_cjs.planNameForPacks(data?.addons?.packs ?? data?.packs);
12195
+ const charged = outcome.charged_pence > 0 ? ` \xB7 ${chunkLYF47OXX_cjs.formatMoney(outcome.charged_pence, "gbp")} charged` : "";
12073
12196
  shell.notify.success(`Upgraded to ${plan}${charged}`);
12074
12197
  break;
12075
12198
  }
12076
12199
  case "scheduled": {
12077
- const when2 = chunkF2BYURQZ_cjs.formatPeriodEnd(data?.addons?.period_end ?? data?.current_period_end);
12200
+ const when2 = chunkLYF47OXX_cjs.formatPeriodEnd(data?.addons?.period_end ?? data?.current_period_end);
12078
12201
  shell.notify.success(when2 ? `Scheduled for ${when2}` : fallback);
12079
12202
  break;
12080
12203
  }
@@ -12107,23 +12230,23 @@ function ChangeProPlan({
12107
12230
  const { data: products } = react.useProducts();
12108
12231
  const changePlan = react.useChangeProjectPlan();
12109
12232
  const cancel = react.useCancelProjectSubscription();
12110
- const prices = chunkF2BYURQZ_cjs.findProPrices(products);
12233
+ const prices = chunkLYF47OXX_cjs.findProPrices(products);
12111
12234
  const addons = project.addons;
12112
12235
  const isCanceling = project.cancel_at_period_end === true || project.subscription === "canceled";
12113
- const currentPacks = Math.max(addons?.packs ?? project.packs ?? chunkF2BYURQZ_cjs.PRO_PACKS, chunkF2BYURQZ_cjs.PRO_PACKS);
12114
- const isLegacyMultiPack = currentPacks > chunkF2BYURQZ_cjs.PRO_PACKS;
12236
+ const currentPacks = Math.max(addons?.packs ?? project.packs ?? chunkLYF47OXX_cjs.PRO_PACKS, chunkLYF47OXX_cjs.PRO_PACKS);
12237
+ const isLegacyMultiPack = currentPacks > chunkLYF47OXX_cjs.PRO_PACKS;
12115
12238
  const currentInterval = project.plan_interval === "year" ? "year" : "month";
12116
12239
  const scheduledPacks = isCanceling ? 0 : addons?.packs_next ?? currentPacks;
12117
12240
  const scheduledInterval = addons?.pending_interval ?? currentInterval;
12118
12241
  const [targetPacks, setTargetPacks] = React7.useState(scheduledPacks);
12119
12242
  const [chosenInterval, setChosenInterval] = React7.useState(scheduledInterval);
12120
- const targetInterval = targetPacks > chunkF2BYURQZ_cjs.PRO_PACKS ? currentInterval : chosenInterval;
12243
+ const targetInterval = targetPacks > chunkLYF47OXX_cjs.PRO_PACKS ? currentInterval : chosenInterval;
12121
12244
  const periodEnd = formatDate(addons?.period_end ?? project.current_period_end);
12122
12245
  const when2 = periodEnd ?? "the end of the period";
12123
12246
  const shortWhen = periodEnd ? periodEnd.replace(/ \d{4}$/, "") : "period end";
12124
12247
  const isPending = changePlan.isPending || cancel.isPending;
12125
12248
  const sameAsScheduled = targetPacks === scheduledPacks && (targetPacks === 0 || targetInterval === scheduledInterval);
12126
- const packOptions = isLegacyMultiPack ? [currentPacks, chunkF2BYURQZ_cjs.PRO_PACKS, 0] : [chunkF2BYURQZ_cjs.PRO_PACKS, 0];
12249
+ const packOptions = isLegacyMultiPack ? [currentPacks, chunkLYF47OXX_cjs.PRO_PACKS, 0] : [chunkLYF47OXX_cjs.PRO_PACKS, 0];
12127
12250
  const intervalPrice = targetInterval === "year" ? prices.annual : prices.monthly;
12128
12251
  const currency = intervalPrice?.currency ?? project.currency ?? "gbp";
12129
12252
  const preview = react.usePreviewProjectPlanChange(
@@ -12131,7 +12254,7 @@ function ChangeProPlan({
12131
12254
  sameAsScheduled || targetPacks === 0 ? null : { packs: targetPacks, interval: targetInterval }
12132
12255
  );
12133
12256
  const noChange = sameAsScheduled || preview.data?.unchanged === true;
12134
- const nameFor = (packs) => packs === currentPacks && packs > 0 ? chunkF2BYURQZ_cjs.proTierName(project) : chunkF2BYURQZ_cjs.planNameForPacks(packs);
12257
+ const nameFor = (packs) => packs === currentPacks && packs > 0 ? chunkLYF47OXX_cjs.proTierName(project) : chunkLYF47OXX_cjs.planNameForPacks(packs);
12135
12258
  const effects = [];
12136
12259
  const target = nameFor(targetPacks);
12137
12260
  if (targetPacks === 0) {
@@ -12141,7 +12264,7 @@ function ChangeProPlan({
12141
12264
  if (targetPacks < currentPacks) {
12142
12265
  effects.push(`Changes to one Pro licence on ${when2}. No refund.`);
12143
12266
  } else if (!isCanceling && addons?.packs_next != null) {
12144
- effects.push(`Cancels the change to ${chunkF2BYURQZ_cjs.planNameForPacks(addons.packs_next)}.`);
12267
+ effects.push(`Cancels the change to ${chunkLYF47OXX_cjs.planNameForPacks(addons.packs_next)}.`);
12145
12268
  }
12146
12269
  if (targetInterval !== currentInterval) {
12147
12270
  effects.push(`${targetInterval === "year" ? "Annual" : "Monthly"} billing from ${when2}.`);
@@ -12180,33 +12303,33 @@ function ChangeProPlan({
12180
12303
  if (packs === 0) {
12181
12304
  return {
12182
12305
  total: "\xA30",
12183
- summary: `${react.formatGbp(chunkF2BYURQZ_cjs.FREE_AI_GBP)} of AI usage \xB7 ${chunkF2BYURQZ_cjs.FREE_STORAGE_MB} MB \xB7 just you`
12306
+ summary: `${react.formatGbp(chunkLYF47OXX_cjs.FREE_AI_GBP)} of AI usage \xB7 ${chunkLYF47OXX_cjs.FREE_STORAGE_MB} MB \xB7 just you`
12184
12307
  };
12185
12308
  }
12186
- const allowance = `${react.formatGbp(chunkF2BYURQZ_cjs.PRO_AI_GBP * packs)} of AI usage \xB7 ${chunkF2BYURQZ_cjs.PRO_STORAGE_GB * packs} GB`;
12187
- const legacy = packs > chunkF2BYURQZ_cjs.PRO_PACKS;
12188
- const exVat = legacy ? project.amount_ex_vat : chunkF2BYURQZ_cjs.packPrice(intervalPrice)?.amount_ex_vat;
12309
+ const allowance = `${react.formatGbp(chunkLYF47OXX_cjs.PRO_AI_GBP * packs)} of AI usage \xB7 ${chunkLYF47OXX_cjs.PRO_STORAGE_GB * packs} GB`;
12310
+ const legacy = packs > chunkLYF47OXX_cjs.PRO_PACKS;
12311
+ const exVat = legacy ? project.amount_ex_vat : chunkLYF47OXX_cjs.packPrice(intervalPrice)?.amount_ex_vat;
12189
12312
  return {
12190
- total: exVat != null ? chunkF2BYURQZ_cjs.plusVat(exVat, currency) : void 0,
12313
+ total: exVat != null ? chunkLYF47OXX_cjs.plusVat(exVat, currency) : void 0,
12191
12314
  summary: allowance
12192
12315
  };
12193
12316
  };
12194
- return /* @__PURE__ */ jsxRuntime.jsxs(chunkFZVAJFRH_cjs.PlanStack, { gap: 4, testId: "change-pro-plan", children: [
12317
+ return /* @__PURE__ */ jsxRuntime.jsxs(chunkRHKFCSFC_cjs.PlanStack, { gap: 4, testId: "change-pro-plan", children: [
12195
12318
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-wrap items-center justify-between gap-2", children: [
12196
12319
  /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-sm font-medium text-foreground", children: "Billing" }),
12197
- targetPacks > chunkF2BYURQZ_cjs.PRO_PACKS ? /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-sm text-muted-foreground", "data-testid": "change-plan-interval-fixed", children: currentInterval === "year" ? "Annual" : "Monthly" }) : /* @__PURE__ */ jsxRuntime.jsx(
12198
- chunkFZVAJFRH_cjs.PricingToggle,
12320
+ targetPacks > chunkLYF47OXX_cjs.PRO_PACKS ? /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-sm text-muted-foreground", "data-testid": "change-plan-interval-fixed", children: currentInterval === "year" ? "Annual" : "Monthly" }) : /* @__PURE__ */ jsxRuntime.jsx(
12321
+ chunkRHKFCSFC_cjs.PricingToggle,
12199
12322
  {
12200
12323
  isAnnual: targetInterval === "year",
12201
12324
  onToggle: () => setChosenInterval(targetInterval === "year" ? "month" : "year"),
12202
- savingsPercent: chunkF2BYURQZ_cjs.calcSavingsPercent(prices.monthly, prices.annual)
12325
+ savingsPercent: chunkLYF47OXX_cjs.calcSavingsPercent(prices.monthly, prices.annual)
12203
12326
  }
12204
12327
  )
12205
12328
  ] }),
12206
- /* @__PURE__ */ jsxRuntime.jsx(chunkFZVAJFRH_cjs.PlanStack, { gap: 2, children: packOptions.map((packs) => {
12329
+ /* @__PURE__ */ jsxRuntime.jsx(chunkRHKFCSFC_cjs.PlanStack, { gap: 2, children: packOptions.map((packs) => {
12207
12330
  const { total, summary } = optionFor(packs);
12208
12331
  return /* @__PURE__ */ jsxRuntime.jsx(
12209
- chunkFZVAJFRH_cjs.PlanTierOption,
12332
+ chunkRHKFCSFC_cjs.PlanTierOption,
12210
12333
  {
12211
12334
  onSelect: setTargetPacks,
12212
12335
  option: {
@@ -12223,13 +12346,13 @@ function ChangeProPlan({
12223
12346
  );
12224
12347
  }) }),
12225
12348
  isLegacyMultiPack && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-wrap items-center gap-x-3 gap-y-1", children: [
12226
- /* @__PURE__ */ jsxRuntime.jsxs(chunkFZVAJFRH_cjs.PlanNotice, { className: "text-xs", testId: "change-plan-legacy-note", children: [
12227
- chunkF2BYURQZ_cjs.proTierName(project),
12349
+ /* @__PURE__ */ jsxRuntime.jsxs(chunkRHKFCSFC_cjs.PlanNotice, { className: "text-xs", testId: "change-plan-legacy-note", children: [
12350
+ chunkLYF47OXX_cjs.proTierName(project),
12228
12351
  " is no longer sold"
12229
12352
  ] }),
12230
- /* @__PURE__ */ jsxRuntime.jsxs(chunkFZVAJFRH_cjs.MoreInfo, { title: "Legacy plan", testId: "change-plan-legacy-more-info", children: [
12353
+ /* @__PURE__ */ jsxRuntime.jsxs(chunkRHKFCSFC_cjs.MoreInfo, { title: "Legacy plan", testId: "change-plan-legacy-more-info", children: [
12231
12354
  /* @__PURE__ */ jsxRuntime.jsxs("p", { children: [
12232
- chunkF2BYURQZ_cjs.proTierName(project),
12355
+ chunkLYF47OXX_cjs.proTierName(project),
12233
12356
  " keeps renewing at its own price, with its allowance and add-ons, until you change it."
12234
12357
  ] }),
12235
12358
  /* @__PURE__ */ jsxRuntime.jsxs("p", { children: [
@@ -12250,7 +12373,7 @@ function ChangeProPlan({
12250
12373
  ),
12251
12374
  targetPacks > 0 && /* @__PURE__ */ jsxRuntime.jsx(ConnectedReferralRewardNote, {}),
12252
12375
  /* @__PURE__ */ jsxRuntime.jsx(
12253
- chunkFZVAJFRH_cjs.PlanActionButton,
12376
+ chunkRHKFCSFC_cjs.PlanActionButton,
12254
12377
  {
12255
12378
  onClick: apply,
12256
12379
  disabled: noChange || isPending,
@@ -12261,9 +12384,9 @@ function ChangeProPlan({
12261
12384
  ] });
12262
12385
  }
12263
12386
  function ChangePlanDialog({ project, open, onOpenChange }) {
12264
- const isPro = !!project && chunkF2BYURQZ_cjs.isProProject(project);
12387
+ const isPro = !!project && chunkLYF47OXX_cjs.isProProject(project);
12265
12388
  return /* @__PURE__ */ jsxRuntime.jsx(
12266
- chunkFZVAJFRH_cjs.PlanDialogFrame,
12389
+ chunkRHKFCSFC_cjs.PlanDialogFrame,
12267
12390
  {
12268
12391
  open,
12269
12392
  onOpenChange,
@@ -12283,14 +12406,14 @@ function ChangePlanDialog({ project, open, onOpenChange }) {
12283
12406
  }
12284
12407
  function ProjectsTable() {
12285
12408
  const { data: projects, isLoading } = react.useProjects();
12286
- const currentUserExtId = chunkF2BYURQZ_cjs.useSelfExtId();
12409
+ const currentUserExtId = chunkLYF47OXX_cjs.useSelfExtId();
12287
12410
  const { openProject } = chunk2QQUGL2V_cjs.useBlocksEnvironment();
12288
12411
  const updateProject = react.useUpdateProjectFields();
12289
12412
  const [renameTarget, setRenameTarget] = React7.useState(null);
12290
12413
  const [renameValue, setRenameValue] = React7.useState("");
12291
12414
  const [invoicesTarget, setInvoicesTarget] = React7.useState(null);
12292
12415
  const [upgradeTarget, setUpgradeTarget] = React7.useState(null);
12293
- const { stripeEnabled } = chunkF2BYURQZ_cjs.useBillingSupport();
12416
+ const { stripeEnabled } = chunkLYF47OXX_cjs.useBillingSupport();
12294
12417
  const ownedProjects = React7.useMemo(
12295
12418
  () => (projects ?? []).filter((p) => p.created_by === currentUserExtId),
12296
12419
  [projects, currentUserExtId]
@@ -12329,13 +12452,13 @@ function ProjectsTable() {
12329
12452
  const hasPaid = p.subscription === "active" || p.subscription === "past_due";
12330
12453
  const canUpgrade = stripeEnabled && !hasPaid && p.subscription !== "canceled" && p.subscription !== "dev";
12331
12454
  return /* @__PURE__ */ jsxRuntime.jsx(
12332
- chunkFZVAJFRH_cjs.ProjectRow,
12455
+ chunkRHKFCSFC_cjs.ProjectRow,
12333
12456
  {
12334
12457
  testId: `project-row-${p.external_id}`,
12335
12458
  onOpen: () => openProject(p.external_id),
12336
12459
  identity: /* @__PURE__ */ jsxRuntime.jsx(BillingProjectEntity, { name: p.name, relation: "mine", subscription: p.subscription, size: "sm" }),
12337
- summary: stripeEnabled ? /* @__PURE__ */ jsxRuntime.jsx("span", { className: "flex items-center whitespace-nowrap", children: /* @__PURE__ */ jsxRuntime.jsx(chunkFZVAJFRH_cjs.PlanBadge, { ...chunkF2BYURQZ_cjs.planBadgeView(p) }) }) : void 0,
12338
- usage: p.quotas ? /* @__PURE__ */ jsxRuntime.jsx(chunkFZVAJFRH_cjs.QuotaMeter, { items: chunkF2BYURQZ_cjs.getQuotaItems(p.quotas), size: "lg" }) : void 0,
12460
+ summary: stripeEnabled ? /* @__PURE__ */ jsxRuntime.jsx("span", { className: "flex items-center whitespace-nowrap", children: /* @__PURE__ */ jsxRuntime.jsx(chunkRHKFCSFC_cjs.PlanBadge, { ...chunkLYF47OXX_cjs.planBadgeView(p) }) }) : void 0,
12461
+ usage: p.quotas ? /* @__PURE__ */ jsxRuntime.jsx(chunkRHKFCSFC_cjs.QuotaMeter, { items: chunkLYF47OXX_cjs.getQuotaItems(p.quotas), size: "lg" }) : void 0,
12339
12462
  actions: /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
12340
12463
  canUpgrade && /* @__PURE__ */ jsxRuntime.jsxs(
12341
12464
  ui.Button,
@@ -12369,9 +12492,9 @@ function ProjectsTable() {
12369
12492
  );
12370
12493
  };
12371
12494
  return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
12372
- /* @__PURE__ */ jsxRuntime.jsx(chunkFZVAJFRH_cjs.ProjectList, { isLoading, isEmpty: ownedProjects.length === 0, isFilteredOut: false, children: ownedProjects.map(renderRow) }),
12495
+ /* @__PURE__ */ jsxRuntime.jsx(chunkRHKFCSFC_cjs.ProjectList, { isLoading, isEmpty: ownedProjects.length === 0, isFilteredOut: false, children: ownedProjects.map(renderRow) }),
12373
12496
  /* @__PURE__ */ jsxRuntime.jsx(
12374
- chunkFZVAJFRH_cjs.RenameDialog,
12497
+ chunkRHKFCSFC_cjs.RenameDialog,
12375
12498
  {
12376
12499
  open: !!renameTarget,
12377
12500
  onClose: () => setRenameTarget(null),
@@ -12402,7 +12525,7 @@ function ProjectsTable() {
12402
12525
  }
12403
12526
  function SharedProjects() {
12404
12527
  const { data: projects } = react.useProjects();
12405
- const currentUserExtId = chunkF2BYURQZ_cjs.useSelfExtId();
12528
+ const currentUserExtId = chunkLYF47OXX_cjs.useSelfExtId();
12406
12529
  const { data: usageToday } = react.useUserUsageToday();
12407
12530
  const shared = React7.useMemo(
12408
12531
  () => (projects ?? []).filter((p) => p.created_by !== currentUserExtId),
@@ -12410,10 +12533,10 @@ function SharedProjects() {
12410
12533
  );
12411
12534
  if (shared.length === 0) return null;
12412
12535
  const usedToday = usageToday?.used_gbp ?? 0;
12413
- return /* @__PURE__ */ jsxRuntime.jsx(chunkFZVAJFRH_cjs.SharedProjectsSection, { footnote: "Your daily AI usage allowance in projects other people run \u2014 their plan and billing are theirs.", children: shared.map((p) => {
12536
+ return /* @__PURE__ */ jsxRuntime.jsx(chunkRHKFCSFC_cjs.SharedProjectsSection, { footnote: "Your daily AI usage allowance in projects other people run \u2014 their plan and billing are theirs.", children: shared.map((p) => {
12414
12537
  const cap = p.daily_cap_per_user;
12415
12538
  return /* @__PURE__ */ jsxRuntime.jsx(
12416
- chunkFZVAJFRH_cjs.SharedProjectRow,
12539
+ chunkRHKFCSFC_cjs.SharedProjectRow,
12417
12540
  {
12418
12541
  testId: `shared-project-${p.external_id}`,
12419
12542
  identity: /* @__PURE__ */ jsxRuntime.jsx(BillingProjectEntity, { name: p.name, relation: "other", size: "sm" }),
@@ -12457,7 +12580,7 @@ function DailyCapEditor({ project }) {
12457
12580
  );
12458
12581
  };
12459
12582
  return /* @__PURE__ */ jsxRuntime.jsx(
12460
- chunkFZVAJFRH_cjs.DailyCapField,
12583
+ chunkRHKFCSFC_cjs.DailyCapField,
12461
12584
  {
12462
12585
  value,
12463
12586
  onChange: setValue,
@@ -12470,11 +12593,11 @@ function DailyCapEditor({ project }) {
12470
12593
  function SubscriptionStatus({ project }) {
12471
12594
  const { quotas, cancel_at_period_end, subscription, current_period_end, addons } = project;
12472
12595
  return /* @__PURE__ */ jsxRuntime.jsx(
12473
- chunkFZVAJFRH_cjs.SubscriptionStatusView,
12596
+ chunkRHKFCSFC_cjs.SubscriptionStatusView,
12474
12597
  {
12475
- resetDate: chunkF2BYURQZ_cjs.formatResetDate(addons?.ai_usage_reset_at ?? current_period_end),
12598
+ resetDate: chunkLYF47OXX_cjs.formatResetDate(addons?.ai_usage_reset_at ?? current_period_end),
12476
12599
  isCanceling: subscription === "canceled" || cancel_at_period_end === true,
12477
- meters: chunkF2BYURQZ_cjs.getQuotaItems(quotas).map((q) => ({
12600
+ meters: chunkLYF47OXX_cjs.getQuotaItems(quotas).map((q) => ({
12478
12601
  key: q.key,
12479
12602
  icon: q.icon,
12480
12603
  label: q.label,
@@ -12538,7 +12661,7 @@ function PendingChange({
12538
12661
  }
12539
12662
  );
12540
12663
  }
12541
- var titleFor = (kind, blockAiGbp, blockStorageGb) => kind === "ai_usage" ? `Add ${react.formatGbp(blockAiGbp ?? chunkF2BYURQZ_cjs.ADDON_BLOCK_AI_GBP)} of AI usage` : `Add ${blockStorageGb ?? chunkF2BYURQZ_cjs.STORAGE_BLOCK_GB} GB storage`;
12664
+ var titleFor = (kind, blockAiGbp, blockStorageGb) => kind === "ai_usage" ? `Add ${react.formatGbp(blockAiGbp ?? chunkLYF47OXX_cjs.ADDON_BLOCK_AI_GBP)} of AI usage` : `Add ${blockStorageGb ?? chunkLYF47OXX_cjs.STORAGE_BLOCK_GB} GB storage`;
12542
12665
  var blocksOf = (kind, project) => (kind === "ai_usage" ? project.addons?.ai_blocks : project.addons?.storage_blocks) ?? 0;
12543
12666
  function Row({ label, children }) {
12544
12667
  return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-baseline justify-between gap-4", children: [
@@ -12559,11 +12682,11 @@ function AddAddonDialog({
12559
12682
  const addons = project.addons;
12560
12683
  if (!addons) return null;
12561
12684
  const isAnnual = project.plan_interval === "year";
12562
- const price = chunkF2BYURQZ_cjs.addonCharge(kind, addons, isAnnual, addons.period_end ?? project.current_period_end);
12563
- const nextCharge = chunkF2BYURQZ_cjs.formatPeriodEnd(addons.period_end ?? project.current_period_end);
12564
- const now = quote.data ? chunkF2BYURQZ_cjs.quoteParts(quote.data.now) : null;
12565
- const renewal = quote.data ? chunkF2BYURQZ_cjs.quoteParts(quote.data.renewal) : null;
12566
- const today = now ? { total: chunkF2BYURQZ_cjs.money2(now.total), detail: chunkF2BYURQZ_cjs.taxDetail(now) } : { total: price.now, detail: `incl. VAT (${price.nowExVat} + ${price.nowVat} VAT)` };
12685
+ const price = chunkLYF47OXX_cjs.addonCharge(kind, addons, isAnnual, addons.period_end ?? project.current_period_end);
12686
+ const nextCharge = chunkLYF47OXX_cjs.formatPeriodEnd(addons.period_end ?? project.current_period_end);
12687
+ const now = quote.data ? chunkLYF47OXX_cjs.quoteParts(quote.data.now) : null;
12688
+ const renewal = quote.data ? chunkLYF47OXX_cjs.quoteParts(quote.data.renewal) : null;
12689
+ const today = now ? { total: chunkLYF47OXX_cjs.money2(now.total), detail: chunkLYF47OXX_cjs.taxDetail(now) } : { total: price.now, detail: `incl. VAT (${price.nowExVat} + ${price.nowVat} VAT)` };
12567
12690
  const pricing = quote.isLoading;
12568
12691
  const confirm = () => {
12569
12692
  const before = blocksOf(kind, project);
@@ -12602,8 +12725,8 @@ function AddAddonDialog({
12602
12725
  isAnnual ? "yearly" : "monthly",
12603
12726
  " \xB7 no refund"
12604
12727
  ] }),
12605
- /* @__PURE__ */ jsxRuntime.jsx(chunkFZVAJFRH_cjs.MoreInfo, { title: "Adding a top-up", testId: "add-addon-more-info", children: /* @__PURE__ */ jsxRuntime.jsx(
12606
- chunkFZVAJFRH_cjs.MoreInfoList,
12728
+ /* @__PURE__ */ jsxRuntime.jsx(chunkRHKFCSFC_cjs.MoreInfo, { title: "Adding a top-up", testId: "add-addon-more-info", children: /* @__PURE__ */ jsxRuntime.jsx(
12729
+ chunkRHKFCSFC_cjs.MoreInfoList,
12607
12730
  {
12608
12731
  items: [
12609
12732
  {
@@ -12618,7 +12741,7 @@ function AddAddonDialog({
12618
12741
  term: "Usage cap",
12619
12742
  text: "Adding by hand is never blocked by the usage cap; the cap limits automatic top-ups only."
12620
12743
  },
12621
- ...isAnnual && kind === "ai_usage" ? [{ term: "Annual", text: `${chunkF2BYURQZ_cjs.ANNUAL_PREMIUM_AI_NOTE}.` }] : []
12744
+ ...isAnnual && kind === "ai_usage" ? [{ term: "Annual", text: `${chunkLYF47OXX_cjs.ANNUAL_PREMIUM_AI_NOTE}.` }] : []
12622
12745
  ]
12623
12746
  }
12624
12747
  ) })
@@ -12641,7 +12764,7 @@ function AddAddonDialog({
12641
12764
  )
12642
12765
  ] }) }),
12643
12766
  !pricing && /* @__PURE__ */ jsxRuntime.jsxs(Row, { label: "Next charge", children: [
12644
- renewal ? chunkF2BYURQZ_cjs.totalWithTaxWord(renewal) : price.then.replace(/\/(month|year)/, ""),
12767
+ renewal ? chunkLYF47OXX_cjs.totalWithTaxWord(renewal) : price.then.replace(/\/(month|year)/, ""),
12645
12768
  nextCharge ? ` on ${nextCharge}` : " at renewal"
12646
12769
  ] })
12647
12770
  ] }) }),
@@ -12672,11 +12795,11 @@ function ReduceAddonDialog({
12672
12795
  const update = react.useUpdateProjectNextPeriodAddons();
12673
12796
  const addons = project.addons;
12674
12797
  if (!addons) return null;
12675
- const { min, next } = chunkF2BYURQZ_cjs.reduceBounds(kind, addons);
12798
+ const { min, next } = chunkLYF47OXX_cjs.reduceBounds(kind, addons);
12676
12799
  const keep = Math.max(min, next - 1);
12677
- const size = chunkF2BYURQZ_cjs.nextRemovedBlockSize(kind, addons);
12678
- const what = chunkF2BYURQZ_cjs.stepLabel(kind, size);
12679
- const from = chunkF2BYURQZ_cjs.formatPeriodEnd(addons.period_end ?? project.current_period_end) ?? "your next renewal";
12800
+ const size = chunkLYF47OXX_cjs.nextRemovedBlockSize(kind, addons);
12801
+ const what = chunkLYF47OXX_cjs.stepLabel(kind, size);
12802
+ const from = chunkLYF47OXX_cjs.formatPeriodEnd(addons.period_end ?? project.current_period_end) ?? "your next renewal";
12680
12803
  const fromShort = from.replace(/ \d{4}$/, "");
12681
12804
  const allowanceNext = kind === "ai_usage" ? addons.ai_allowance_next_gbp - size : addons.storage_allowance_next_gb - size;
12682
12805
  const allowanceNow = kind === "ai_usage" ? addons.ai_allowance_gbp : addons.storage_allowance_gb;
@@ -12684,7 +12807,7 @@ function ReduceAddonDialog({
12684
12807
  const save = () => update.mutate(
12685
12808
  {
12686
12809
  projectExtId: project.external_id,
12687
- body: chunkF2BYURQZ_cjs.nextPeriodBody(kind, keep)
12810
+ body: chunkLYF47OXX_cjs.nextPeriodBody(kind, keep)
12688
12811
  },
12689
12812
  {
12690
12813
  onSuccess: () => {
@@ -12712,7 +12835,7 @@ function ReduceAddonDialog({
12712
12835
  fromShort,
12713
12836
  " \xB7 no refund"
12714
12837
  ] }),
12715
- /* @__PURE__ */ jsxRuntime.jsxs(chunkFZVAJFRH_cjs.MoreInfo, { title: "Reducing a top-up", testId: "reduce-addon-more-info", children: [
12838
+ /* @__PURE__ */ jsxRuntime.jsxs(chunkRHKFCSFC_cjs.MoreInfo, { title: "Reducing a top-up", testId: "reduce-addon-more-info", children: [
12716
12839
  /* @__PURE__ */ jsxRuntime.jsxs("p", { children: [
12717
12840
  "The reduction applies from your next renewal (",
12718
12841
  from,
@@ -12751,7 +12874,7 @@ function ReduceAddonDialog({
12751
12874
  }
12752
12875
  ) });
12753
12876
  }
12754
- var gbp = (pence) => chunkF2BYURQZ_cjs.formatMoney(pence, "gbp");
12877
+ var gbp = (pence) => chunkLYF47OXX_cjs.formatMoney(pence, "gbp");
12755
12878
  var gb2 = (n) => `${Math.round(n * 10) / 10} GB`;
12756
12879
  var pct = (used, limit) => limit > 0 ? Math.min(100, used / limit * 100) : 0;
12757
12880
  function formatShortDate(unix) {
@@ -12763,20 +12886,20 @@ function AutoTopupThreshold({
12763
12886
  addons
12764
12887
  }) {
12765
12888
  const updateSettings = react.useUpdateProjectAddonSettings();
12766
- const min = addons.min_auto_topup_threshold_gbp || chunkF2BYURQZ_cjs.MIN_AUTO_TOPUP_THRESHOLD_GBP;
12889
+ const min = addons.min_auto_topup_threshold_gbp || chunkLYF47OXX_cjs.MIN_AUTO_TOPUP_THRESHOLD_GBP;
12767
12890
  const saved = addons.auto_topup_threshold_gbp;
12768
12891
  const [value, setValue] = React7.useState(String(saved));
12769
12892
  React7.useEffect(() => setValue(String(saved)), [saved]);
12770
12893
  const parsed = Number(value);
12771
12894
  const valid = Number.isFinite(parsed) && parsed >= min;
12772
12895
  const dirty = valid && parsed !== saved;
12773
- const off = chunkF2BYURQZ_cjs.isAddonBudgetZero(addons);
12896
+ const off = chunkLYF47OXX_cjs.isAddonBudgetZero(addons);
12774
12897
  const save = () => {
12775
12898
  if (!dirty) return;
12776
12899
  updateSettings.mutate(
12777
12900
  {
12778
12901
  projectExtId: project.external_id,
12779
- body: chunkF2BYURQZ_cjs.addonSettingsBody(addons, { auto_topup_threshold_gbp: parsed })
12902
+ body: chunkLYF47OXX_cjs.addonSettingsBody(addons, { auto_topup_threshold_gbp: parsed })
12780
12903
  },
12781
12904
  {
12782
12905
  onSuccess: () => shell.notify.success(`Auto-add below ${react.formatGbp(parsed)} of AI usage left`),
@@ -12873,10 +12996,10 @@ function ResourceMeter({
12873
12996
  const update = react.useUpdateProjectNextPeriodAddons();
12874
12997
  const isAi = kind === "ai_usage";
12875
12998
  const slug = isAi ? "ai-usage" : "storage";
12876
- const periodEnd = chunkF2BYURQZ_cjs.formatPeriodEnd(addons.period_end ?? project.current_period_end);
12999
+ const periodEnd = chunkLYF47OXX_cjs.formatPeriodEnd(addons.period_end ?? project.current_period_end);
12877
13000
  const from = periodEnd ?? "your next renewal";
12878
13001
  const fromShort = formatShortDate(addons.period_end ?? project.current_period_end) ?? "renewal";
12879
- const { min, current: current2, next } = chunkF2BYURQZ_cjs.reduceBounds(kind, addons);
13002
+ const { min, current: current2, next } = chunkLYF47OXX_cjs.reduceBounds(kind, addons);
12880
13003
  const fmt = (n) => isAi ? react.formatGbp(n) : gb2(n);
12881
13004
  const used = isAi ? addons.ai_used_gbp : addons.storage_used_gb;
12882
13005
  const allowance = isAi ? addons.ai_allowance_gbp : addons.storage_allowance_gb;
@@ -12884,15 +13007,15 @@ function ResourceMeter({
12884
13007
  const plan = isAi ? addons.plan_ai_gbp : addons.plan_storage_gb;
12885
13008
  const topUps = Math.max(0, allowance - plan);
12886
13009
  const blocks = isAi ? addons.ai_blocks : addons.storage_blocks;
12887
- const hasLegacy = chunkF2BYURQZ_cjs.splitBlocks(kind, blocks, addons).legacy > 0;
12888
- const room = chunkF2BYURQZ_cjs.autoRoom(kind, addons);
12889
- const capZero = chunkF2BYURQZ_cjs.isAddonBudgetZero(addons);
12890
- const resets = isAi ? formatShortDate(chunkF2BYURQZ_cjs.aiUsageResetTimestamp(project)) : null;
12891
- const removeSize = chunkF2BYURQZ_cjs.nextRemovedBlockSize(kind, addons);
13010
+ const hasLegacy = chunkLYF47OXX_cjs.splitBlocks(kind, blocks, addons).legacy > 0;
13011
+ const room = chunkLYF47OXX_cjs.autoRoom(kind, addons);
13012
+ const capZero = chunkLYF47OXX_cjs.isAddonBudgetZero(addons);
13013
+ const resets = isAi ? formatShortDate(chunkLYF47OXX_cjs.aiUsageResetTimestamp(project)) : null;
13014
+ const removeSize = chunkLYF47OXX_cjs.nextRemovedBlockSize(kind, addons);
12892
13015
  const undo = () => update.mutate(
12893
13016
  {
12894
13017
  projectExtId: project.external_id,
12895
- body: chunkF2BYURQZ_cjs.nextPeriodBody(kind, current2)
13018
+ body: chunkLYF47OXX_cjs.nextPeriodBody(kind, current2)
12896
13019
  },
12897
13020
  {
12898
13021
  onSuccess: () => shell.notify.success("Kept"),
@@ -12909,7 +13032,7 @@ function ResourceMeter({
12909
13032
  allowance: { used, plan, topUps, autoRoom: capZero ? 0 : room },
12910
13033
  legend: {
12911
13034
  plan: `Plan ${fmt(plan)}`,
12912
- topUps: topUps > 0 ? `Top-ups ${fmt(topUps)}${hasLegacy ? ` (${chunkF2BYURQZ_cjs.blocksLabel(kind, blocks, addons)})` : ""}` : void 0,
13035
+ topUps: topUps > 0 ? `Top-ups ${fmt(topUps)}${hasLegacy ? ` (${chunkLYF47OXX_cjs.blocksLabel(kind, blocks, addons)})` : ""}` : void 0,
12913
13036
  autoRoom: room != null && room > 0 && !capZero ? `Automatic up to ${fmt(room)}` : void 0
12914
13037
  },
12915
13038
  testId: `usage-meter-${slug}`,
@@ -12938,9 +13061,9 @@ function ResourceMeter({
12938
13061
  {
12939
13062
  icon: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Plus, { className: "size-3.5" }),
12940
13063
  label: isAi ? react.formatGbp(addons.block_ai_gbp) : `${addons.block_storage_gb} GB`,
12941
- caption: chunkF2BYURQZ_cjs.addStepCaption(kind, addons),
13064
+ caption: chunkLYF47OXX_cjs.addStepCaption(kind, addons),
12942
13065
  onClick: onAdd,
12943
- ariaLabel: `Add ${chunkF2BYURQZ_cjs.stepLabel(kind, isAi ? addons.block_ai_gbp : addons.block_storage_gb)}`,
13066
+ ariaLabel: `Add ${chunkLYF47OXX_cjs.stepLabel(kind, isAi ? addons.block_ai_gbp : addons.block_storage_gb)}`,
12944
13067
  testId: isAi ? "add-ai-block-button" : "add-storage-block-button"
12945
13068
  }
12946
13069
  ),
@@ -12951,7 +13074,7 @@ function ResourceMeter({
12951
13074
  label: isAi ? react.formatGbp(removeSize) : `${removeSize} GB`,
12952
13075
  caption: `from ${fromShort}`,
12953
13076
  onClick: onReduce,
12954
- ariaLabel: `Remove ${chunkF2BYURQZ_cjs.stepLabel(kind, removeSize)} from ${from}`,
13077
+ ariaLabel: `Remove ${chunkLYF47OXX_cjs.stepLabel(kind, removeSize)} from ${from}`,
12955
13078
  testId: `reduce-${slug}-button`
12956
13079
  }
12957
13080
  )
@@ -12990,10 +13113,10 @@ function UsageCapEditor({ project, addons }) {
12990
13113
  updateSettings.mutate(
12991
13114
  {
12992
13115
  projectExtId: project.external_id,
12993
- body: chunkF2BYURQZ_cjs.addonSettingsBody(addons, { spend_cap_pence: nextCap })
13116
+ body: chunkLYF47OXX_cjs.addonSettingsBody(addons, { spend_cap_pence: nextCap })
12994
13117
  },
12995
13118
  {
12996
- onSuccess: () => shell.notify.success(chunkF2BYURQZ_cjs.budgetSavedMessage(nextCap)),
13119
+ onSuccess: () => shell.notify.success(chunkLYF47OXX_cjs.budgetSavedMessage(nextCap)),
12997
13120
  onError: (error) => shell.notify.error(addonErrorMessage(error))
12998
13121
  }
12999
13122
  );
@@ -13004,14 +13127,14 @@ function UsageCapEditor({ project, addons }) {
13004
13127
  /* @__PURE__ */ jsxRuntime.jsx(
13005
13128
  chunkQZTNTP75_cjs.UsageMeter,
13006
13129
  {
13007
- label: chunkF2BYURQZ_cjs.USAGE_CAP_LABEL,
13130
+ label: chunkLYF47OXX_cjs.USAGE_CAP_LABEL,
13008
13131
  hint: spendResets && savedCap !== 0 ? `resets ${spendResets}` : void 0,
13009
13132
  value: readout,
13010
13133
  pct: savedCap != null && savedCap > 0 ? pct(spent, savedCap) : 0,
13011
13134
  testId: "addon-spend"
13012
13135
  }
13013
13136
  ),
13014
- addons.cap_reached && savedCap != null && savedCap > 0 && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-xs text-muted-foreground", "data-testid": "addon-cap-reached", children: chunkF2BYURQZ_cjs.CAP_REACHED_MESSAGE }),
13137
+ addons.cap_reached && savedCap != null && savedCap > 0 && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-xs text-muted-foreground", "data-testid": "addon-cap-reached", children: chunkLYF47OXX_cjs.CAP_REACHED_MESSAGE }),
13015
13138
  addons.manual_spent_pence > 0 && /* @__PURE__ */ jsxRuntime.jsxs("p", { className: "text-xs text-muted-foreground", "data-testid": "addon-manual-spend", children: [
13016
13139
  "Added by hand this month: ",
13017
13140
  gbp(addons.manual_spent_pence),
@@ -13032,7 +13155,7 @@ function UsageCapEditor({ project, addons }) {
13032
13155
  step: 25,
13033
13156
  className: "h-9 w-28",
13034
13157
  value: noCap ? "" : value,
13035
- placeholder: noCap ? "No limit" : String(chunkF2BYURQZ_cjs.DEFAULT_SPEND_CAP_PENCE / 100),
13158
+ placeholder: noCap ? "No limit" : String(chunkLYF47OXX_cjs.DEFAULT_SPEND_CAP_PENCE / 100),
13036
13159
  disabled: noCap,
13037
13160
  onChange: (e) => setValue(e.target.value),
13038
13161
  onKeyDown: (e) => e.key === "Enter" && save(),
@@ -13058,7 +13181,7 @@ function UsageCapEditor({ project, addons }) {
13058
13181
  checked: noCap,
13059
13182
  onCheckedChange: (checked) => {
13060
13183
  setNoCap(checked);
13061
- if (!checked && value === "") setValue(String(chunkF2BYURQZ_cjs.DEFAULT_SPEND_CAP_PENCE / 100));
13184
+ if (!checked && value === "") setValue(String(chunkLYF47OXX_cjs.DEFAULT_SPEND_CAP_PENCE / 100));
13062
13185
  },
13063
13186
  "data-testid": "no-cap-switch"
13064
13187
  }
@@ -13071,8 +13194,8 @@ function UsageCapEditor({ project, addons }) {
13071
13194
  function UsageInfo({ addons, isAnnual }) {
13072
13195
  const period = isAnnual ? "year" : "month";
13073
13196
  const legacy = (addons.legacy_ai_blocks ?? 0) > 0 || (addons.legacy_storage_blocks ?? 0) > 0;
13074
- return /* @__PURE__ */ jsxRuntime.jsx(chunkFZVAJFRH_cjs.MoreInfo, { title: "Usage and top-ups", testId: "usage-more-info", children: /* @__PURE__ */ jsxRuntime.jsx(
13075
- chunkFZVAJFRH_cjs.MoreInfoList,
13197
+ return /* @__PURE__ */ jsxRuntime.jsx(chunkRHKFCSFC_cjs.MoreInfo, { title: "Usage and top-ups", testId: "usage-more-info", children: /* @__PURE__ */ jsxRuntime.jsx(
13198
+ chunkRHKFCSFC_cjs.MoreInfoList,
13076
13199
  {
13077
13200
  items: [
13078
13201
  {
@@ -13087,7 +13210,7 @@ function UsageInfo({ addons, isAnnual }) {
13087
13210
  term: "Automatic top-ups",
13088
13211
  text: "One step is added when AI usage drops below your auto top-up level, or when an upload needs more storage."
13089
13212
  },
13090
- { term: "Usage cap", text: chunkF2BYURQZ_cjs.USAGE_CAP_HELP },
13213
+ { term: "Usage cap", text: chunkLYF47OXX_cjs.USAGE_CAP_HELP },
13091
13214
  {
13092
13215
  term: "Reducing",
13093
13216
  text: "\u2212 removes one step from your next renewal. You keep this period's allowance. No refunds."
@@ -13098,7 +13221,7 @@ function UsageInfo({ addons, isAnnual }) {
13098
13221
  text: "Top-ups bought on an earlier price keep their size and price until removed; they are removed last."
13099
13222
  }
13100
13223
  ] : [],
13101
- ...isAnnual ? [{ term: "Annual", text: `${chunkF2BYURQZ_cjs.ANNUAL_PREMIUM_AI_NOTE}.` }] : [],
13224
+ ...isAnnual ? [{ term: "Annual", text: `${chunkLYF47OXX_cjs.ANNUAL_PREMIUM_AI_NOTE}.` }] : [],
13102
13225
  {
13103
13226
  term: "Prices",
13104
13227
  text: "Shown ex VAT. The confirm step shows the total with VAT before you pay."
@@ -13190,7 +13313,7 @@ function formatShortDate2(unix) {
13190
13313
  if (!unix) return null;
13191
13314
  return new Date(unix * 1e3).toLocaleDateString("en-GB", { day: "numeric", month: "short" });
13192
13315
  }
13193
- var gbp2 = (pence) => chunkF2BYURQZ_cjs.formatMoney(pence, "gbp");
13316
+ var gbp2 = (pence) => chunkLYF47OXX_cjs.formatMoney(pence, "gbp");
13194
13317
  var gbNum = (n) => `${Math.round(n * 10) / 10}`;
13195
13318
  var pct2 = (used, limit) => limit > 0 ? Math.min(100, used / limit * 100) : 0;
13196
13319
  function Meter({
@@ -13208,15 +13331,15 @@ function Meter({
13208
13331
  ] });
13209
13332
  }
13210
13333
  function usePlanPrice(project) {
13211
- const { data: products } = react.useProducts({ enabled: chunkF2BYURQZ_cjs.isProProject(project) });
13212
- if (!chunkF2BYURQZ_cjs.isProProject(project)) return null;
13334
+ const { data: products } = react.useProducts({ enabled: chunkLYF47OXX_cjs.isProProject(project) });
13335
+ if (!chunkLYF47OXX_cjs.isProProject(project)) return null;
13213
13336
  const isAnnual = project.plan_interval === "year";
13214
13337
  if (project.amount != null) {
13215
13338
  return { incl: project.amount, ex: project.amount_ex_vat ?? null, isAnnual };
13216
13339
  }
13217
- if ((project.packs ?? chunkF2BYURQZ_cjs.PRO_PACKS) > chunkF2BYURQZ_cjs.PRO_PACKS) return null;
13218
- const prices = chunkF2BYURQZ_cjs.findProPrices(products);
13219
- const pp = chunkF2BYURQZ_cjs.packPrice(isAnnual ? prices.annual : prices.monthly);
13340
+ if ((project.packs ?? chunkLYF47OXX_cjs.PRO_PACKS) > chunkLYF47OXX_cjs.PRO_PACKS) return null;
13341
+ const prices = chunkLYF47OXX_cjs.findProPrices(products);
13342
+ const pp = chunkLYF47OXX_cjs.packPrice(isAnnual ? prices.annual : prices.monthly);
13220
13343
  return pp ? { incl: pp.amount, ex: pp.amount_ex_vat, isAnnual } : null;
13221
13344
  }
13222
13345
  function paidLine(payment, addons) {
@@ -13229,11 +13352,11 @@ function ProjectPlanCard({
13229
13352
  onChangePlan
13230
13353
  }) {
13231
13354
  const { quotas, addons } = project;
13232
- const isPro = chunkF2BYURQZ_cjs.isProProject(project);
13355
+ const isPro = chunkLYF47OXX_cjs.isProProject(project);
13233
13356
  const used = quotas?.ai_usage?.used ?? 0;
13234
13357
  const limit = quotas?.ai_usage?.limit ?? 0;
13235
- const resetDate = formatShortDate2(chunkF2BYURQZ_cjs.aiUsageResetTimestamp(project));
13236
- const periodEnd = chunkF2BYURQZ_cjs.formatPeriodEnd(addons?.period_end ?? project.current_period_end);
13358
+ const resetDate = formatShortDate2(chunkLYF47OXX_cjs.aiUsageResetTimestamp(project));
13359
+ const periodEnd = chunkLYF47OXX_cjs.formatPeriodEnd(addons?.period_end ?? project.current_period_end);
13237
13360
  const when2 = periodEnd ?? "the end of the period";
13238
13361
  const storageUsed = quotas?.storage_gb?.used ?? 0;
13239
13362
  const storageLimit = quotas?.storage_gb?.limit ?? 0;
@@ -13249,7 +13372,7 @@ function ProjectPlanCard({
13249
13372
  project.external_id,
13250
13373
  hasScheduledChange && addons ? { packs: packsNext ?? addons.packs, interval: pending ?? currentInterval } : null
13251
13374
  ).data;
13252
- const tier = isPro ? chunkF2BYURQZ_cjs.proTierName(project) : project.subscription === "dev" ? "Dev" : "Free";
13375
+ const tier = isPro ? chunkLYF47OXX_cjs.proTierName(project) : project.subscription === "dev" ? "Dev" : "Free";
13253
13376
  const pendingPayment = addons?.payment?.status === "pending" ? addons.payment : null;
13254
13377
  const confirmUrl = pendingPayment?.confirm_url ?? addons?.confirm_url;
13255
13378
  const paidPayment = addons?.payment?.status === "paid" ? addons.payment : null;
@@ -13283,7 +13406,7 @@ function ProjectPlanCard({
13283
13406
  isPro && " ",
13284
13407
  isPro && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "ml-1 text-sm font-normal text-muted-foreground", children: currentInterval === "year" ? "Annual" : "Monthly" })
13285
13408
  ] }),
13286
- isPro && periodEnd && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-sm text-muted-foreground", "data-testid": "project-plan-renews", children: isCanceling ? `Ends ${periodEnd}` : hasScheduledChange && nextBill ? `Next bill ${chunkF2BYURQZ_cjs.totalWithTaxWord({
13409
+ isPro && periodEnd && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-sm text-muted-foreground", "data-testid": "project-plan-renews", children: isCanceling ? `Ends ${periodEnd}` : hasScheduledChange && nextBill ? `Next bill ${chunkLYF47OXX_cjs.totalWithTaxWord({
13287
13410
  subtotal: nextBill.next_renewal_ex_vat_pence,
13288
13411
  tax: nextBill.next_renewal_tax_pence,
13289
13412
  total: nextBill.next_renewal_pence,
@@ -13292,7 +13415,7 @@ function ProjectPlanCard({
13292
13415
  ] }),
13293
13416
  price && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "ml-auto text-right", "data-testid": "project-plan-price", children: [
13294
13417
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "text-lg font-semibold tabular-nums text-foreground", children: [
13295
- price.ex != null ? chunkF2BYURQZ_cjs.plusVat(price.ex) : gbp2(price.incl),
13418
+ price.ex != null ? chunkLYF47OXX_cjs.plusVat(price.ex) : gbp2(price.incl),
13296
13419
  /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-sm font-normal text-muted-foreground", children: price.isAnnual ? "/year" : "/month" })
13297
13420
  ] }),
13298
13421
  price.ex != null && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "text-xs text-muted-foreground", children: [
@@ -13330,7 +13453,7 @@ function ProjectPlanCard({
13330
13453
  undoTestId: "undo-plan-change-button",
13331
13454
  children: [
13332
13455
  "Changes to ",
13333
- chunkF2BYURQZ_cjs.planNameForPacks(packsNext),
13456
+ chunkLYF47OXX_cjs.planNameForPacks(packsNext),
13334
13457
  " on ",
13335
13458
  when2,
13336
13459
  "."
@@ -13375,8 +13498,8 @@ function ProjectPlanCard({
13375
13498
  }
13376
13499
  )
13377
13500
  ] }),
13378
- addons?.billing_error && /* @__PURE__ */ jsxRuntime.jsx(chunkFZVAJFRH_cjs.PlanNotice, { tone: "error", testId: "plan-billing-error", children: addons.billing_error }),
13379
- confirmUrl ? /* @__PURE__ */ jsxRuntime.jsxs(chunkFZVAJFRH_cjs.PlanNotice, { testId: "plan-payment-state", children: [
13501
+ addons?.billing_error && /* @__PURE__ */ jsxRuntime.jsx(chunkRHKFCSFC_cjs.PlanNotice, { tone: "error", testId: "plan-billing-error", children: addons.billing_error }),
13502
+ confirmUrl ? /* @__PURE__ */ jsxRuntime.jsxs(chunkRHKFCSFC_cjs.PlanNotice, { testId: "plan-payment-state", children: [
13380
13503
  "Waiting for your bank",
13381
13504
  pendingPayment?.amount_pence ? ` \xB7 ${gbp2(pendingPayment.amount_pence)}` : "",
13382
13505
  " \xB7",
@@ -13394,7 +13517,7 @@ function ProjectPlanCard({
13394
13517
  ]
13395
13518
  }
13396
13519
  )
13397
- ] }) : paidPayment && addons && /* @__PURE__ */ jsxRuntime.jsx(chunkFZVAJFRH_cjs.PlanNotice, { testId: "plan-payment-state", children: paidLine(paidPayment, addons) }),
13520
+ ] }) : paidPayment && addons && /* @__PURE__ */ jsxRuntime.jsx(chunkRHKFCSFC_cjs.PlanNotice, { testId: "plan-payment-state", children: paidLine(paidPayment, addons) }),
13398
13521
  isPro && /* @__PURE__ */ jsxRuntime.jsxs(
13399
13522
  "button",
13400
13523
  {
@@ -13421,7 +13544,7 @@ function ProjectBilling({
13421
13544
  const { addons } = project;
13422
13545
  return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-4", "data-testid": "project-billing", children: [
13423
13546
  /* @__PURE__ */ jsxRuntime.jsx(ProjectPlanCard, { project, onChangePlan }),
13424
- addons && chunkF2BYURQZ_cjs.isProProject(project) && /* @__PURE__ */ jsxRuntime.jsx(ProjectUsageCard, { project, addons })
13547
+ addons && chunkLYF47OXX_cjs.isProProject(project) && /* @__PURE__ */ jsxRuntime.jsx(ProjectUsageCard, { project, addons })
13425
13548
  ] });
13426
13549
  }
13427
13550
  var BREAKDOWN_LABELS = {
@@ -13556,13 +13679,13 @@ function ProjectUsageContent({
13556
13679
  };
13557
13680
  const quotaPct = effectiveUsage && aiUsageLimit ? Math.round(effectiveUsage.total_spend / aiUsageLimit * 100) : 0;
13558
13681
  return /* @__PURE__ */ jsxRuntime.jsx(
13559
- chunkFZVAJFRH_cjs.UsagePanel,
13682
+ chunkRHKFCSFC_cjs.UsagePanel,
13560
13683
  {
13561
13684
  state,
13562
13685
  dateRange,
13563
13686
  emptyMessage: `No usage ${period === "current" ? "yet this month" : "last month"}.`,
13564
13687
  period: /* @__PURE__ */ jsxRuntime.jsx(
13565
- chunkFZVAJFRH_cjs.UsageToggle,
13688
+ chunkRHKFCSFC_cjs.UsageToggle,
13566
13689
  {
13567
13690
  ariaLabel: "Period",
13568
13691
  value: period,
@@ -13575,7 +13698,7 @@ function ProjectUsageContent({
13575
13698
  ),
13576
13699
  actions: /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
13577
13700
  effectiveUsage?.invoice_pdf && /* @__PURE__ */ jsxRuntime.jsx(
13578
- chunkFZVAJFRH_cjs.UsageActionButton,
13701
+ chunkRHKFCSFC_cjs.UsageActionButton,
13579
13702
  {
13580
13703
  label: "Download Stripe invoice PDF",
13581
13704
  icon: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Download, { className: "size-3.5" }),
@@ -13583,7 +13706,7 @@ function ProjectUsageContent({
13583
13706
  }
13584
13707
  ),
13585
13708
  /* @__PURE__ */ jsxRuntime.jsx(
13586
- chunkFZVAJFRH_cjs.UsageActionButton,
13709
+ chunkRHKFCSFC_cjs.UsageActionButton,
13587
13710
  {
13588
13711
  label: "Print usage summary",
13589
13712
  icon: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Printer, { className: "size-3.5" }),
@@ -13593,7 +13716,7 @@ function ProjectUsageContent({
13593
13716
  ] }),
13594
13717
  children: effectiveUsage && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
13595
13718
  /* @__PURE__ */ jsxRuntime.jsx(
13596
- chunkFZVAJFRH_cjs.UsageSummary,
13719
+ chunkRHKFCSFC_cjs.UsageSummary,
13597
13720
  {
13598
13721
  stats: [
13599
13722
  {
@@ -13601,7 +13724,7 @@ function ProjectUsageContent({
13601
13724
  value: /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children: react.formatGbp(effectiveUsage.total_spend) }),
13602
13725
  label: /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
13603
13726
  "AI usage",
13604
- quotaPct > 0 ? /* @__PURE__ */ jsxRuntime.jsxs(chunkFZVAJFRH_cjs.UsageQuotaHint, { children: [
13727
+ quotaPct > 0 ? /* @__PURE__ */ jsxRuntime.jsxs(chunkRHKFCSFC_cjs.UsageQuotaHint, { children: [
13605
13728
  "(",
13606
13729
  quotaPct,
13607
13730
  "% of quota)"
@@ -13622,7 +13745,7 @@ function ProjectUsageContent({
13622
13745
  }
13623
13746
  ),
13624
13747
  /* @__PURE__ */ jsxRuntime.jsx(
13625
- chunkFZVAJFRH_cjs.UsageToggle,
13748
+ chunkRHKFCSFC_cjs.UsageToggle,
13626
13749
  {
13627
13750
  ariaLabel: "Breakdown by",
13628
13751
  size: "fill",
@@ -13635,12 +13758,12 @@ function ProjectUsageContent({
13635
13758
  }
13636
13759
  ),
13637
13760
  /* @__PURE__ */ jsxRuntime.jsx(
13638
- chunkFZVAJFRH_cjs.UsageSection,
13761
+ chunkRHKFCSFC_cjs.UsageSection,
13639
13762
  {
13640
- footer: /* @__PURE__ */ jsxRuntime.jsx(chunkFZVAJFRH_cjs.UsageLegend, { series }),
13763
+ footer: /* @__PURE__ */ jsxRuntime.jsx(chunkRHKFCSFC_cjs.UsageLegend, { series }),
13641
13764
  title: `Daily AI usage${breakdown === "model" ? ` by ${BREAKDOWN_LABELS[breakdown]}` : ""}`,
13642
13765
  children: /* @__PURE__ */ jsxRuntime.jsx(
13643
- chunkFZVAJFRH_cjs.UsageLineChart,
13766
+ chunkRHKFCSFC_cjs.UsageLineChart,
13644
13767
  {
13645
13768
  dates,
13646
13769
  series,
@@ -13651,12 +13774,12 @@ function ProjectUsageContent({
13651
13774
  }
13652
13775
  ),
13653
13776
  /* @__PURE__ */ jsxRuntime.jsx(
13654
- chunkFZVAJFRH_cjs.UsageSection,
13777
+ chunkRHKFCSFC_cjs.UsageSection,
13655
13778
  {
13656
13779
  title: "Breakdown",
13657
13780
  gap: "md",
13658
13781
  action: /* @__PURE__ */ jsxRuntime.jsx(
13659
- chunkFZVAJFRH_cjs.UsageToggle,
13782
+ chunkRHKFCSFC_cjs.UsageToggle,
13660
13783
  {
13661
13784
  ariaLabel: "Breakdown metric",
13662
13785
  value: metric,
@@ -13668,7 +13791,7 @@ function ProjectUsageContent({
13668
13791
  }
13669
13792
  ),
13670
13793
  children: /* @__PURE__ */ jsxRuntime.jsx(
13671
- chunkFZVAJFRH_cjs.UsageProportionBar,
13794
+ chunkRHKFCSFC_cjs.UsageProportionBar,
13672
13795
  {
13673
13796
  metric,
13674
13797
  items: breakdownItems.map((item) => ({
@@ -13686,13 +13809,13 @@ function ProjectUsageContent({
13686
13809
  );
13687
13810
  }
13688
13811
  function ProjectDetail({ projectExtId, storage }) {
13689
- const { stripeEnabled } = chunkF2BYURQZ_cjs.useBillingSupport();
13812
+ const { stripeEnabled } = chunkLYF47OXX_cjs.useBillingSupport();
13690
13813
  const [planOpen, setPlanOpen] = React7.useState(false);
13691
13814
  const [renameOpen, setRenameOpen] = React7.useState(false);
13692
13815
  const [renameValue, setRenameValue] = React7.useState("");
13693
13816
  const updateProject = react.useUpdateProjectFields();
13694
13817
  const { data: projects, isLoading } = react.useProjects();
13695
- const currentUserExtId = chunkF2BYURQZ_cjs.useSelfExtId();
13818
+ const currentUserExtId = chunkLYF47OXX_cjs.useSelfExtId();
13696
13819
  const project = projects?.find((p) => p.external_id === projectExtId);
13697
13820
  const handleSaveRename = React7.useCallback(() => {
13698
13821
  const trimmed = renameValue.trim();
@@ -13726,7 +13849,7 @@ function ProjectDetail({ projectExtId, storage }) {
13726
13849
  }
13727
13850
  return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "p-6 space-y-6 max-w-4xl", "data-testid": `project-detail-${project.external_id}`, children: [
13728
13851
  /* @__PURE__ */ jsxRuntime.jsx(
13729
- chunkFZVAJFRH_cjs.ProjectDetailHeader,
13852
+ chunkRHKFCSFC_cjs.ProjectDetailHeader,
13730
13853
  {
13731
13854
  icon: /* @__PURE__ */ jsxRuntime.jsx(ui.EntityIcon, { entityType: "PROJECT" }),
13732
13855
  name: project.name,
@@ -13734,11 +13857,11 @@ function ProjectDetail({ projectExtId, storage }) {
13734
13857
  setRenameValue(project.name);
13735
13858
  setRenameOpen(true);
13736
13859
  },
13737
- badge: stripeEnabled ? /* @__PURE__ */ jsxRuntime.jsx(chunkFZVAJFRH_cjs.PlanBadge, { ...chunkF2BYURQZ_cjs.planBadgeView(project), size: "md" }) : void 0
13860
+ badge: stripeEnabled ? /* @__PURE__ */ jsxRuntime.jsx(chunkRHKFCSFC_cjs.PlanBadge, { ...chunkLYF47OXX_cjs.planBadgeView(project), size: "md" }) : void 0
13738
13861
  }
13739
13862
  ),
13740
13863
  hasBilling && /* @__PURE__ */ jsxRuntime.jsx(ProjectBilling, { project, onChangePlan: () => setPlanOpen(true) }),
13741
- /* @__PURE__ */ jsxRuntime.jsxs(chunkFZVAJFRH_cjs.ProjectDetailSection, { title: hasBilling ? "Collaborator limits" : "Plan limits", children: [
13864
+ /* @__PURE__ */ jsxRuntime.jsxs(chunkRHKFCSFC_cjs.ProjectDetailSection, { title: hasBilling ? "Collaborator limits" : "Plan limits", children: [
13742
13865
  !hasBilling && /* @__PURE__ */ jsxRuntime.jsx(SubscriptionStatus, { project }),
13743
13866
  /* @__PURE__ */ jsxRuntime.jsxs(
13744
13867
  "div",
@@ -13754,7 +13877,7 @@ function ProjectDetail({ projectExtId, storage }) {
13754
13877
  }
13755
13878
  )
13756
13879
  ] }),
13757
- /* @__PURE__ */ jsxRuntime.jsx(chunkFZVAJFRH_cjs.ProjectDetailSection, { title: "Usage", children: /* @__PURE__ */ jsxRuntime.jsx(
13880
+ /* @__PURE__ */ jsxRuntime.jsx(chunkRHKFCSFC_cjs.ProjectDetailSection, { title: "Usage", children: /* @__PURE__ */ jsxRuntime.jsx(
13758
13881
  ProjectUsageContent,
13759
13882
  {
13760
13883
  projectExtId: project.external_id,
@@ -13764,7 +13887,7 @@ function ProjectDetail({ projectExtId, storage }) {
13764
13887
  ) }),
13765
13888
  storage,
13766
13889
  /* @__PURE__ */ jsxRuntime.jsx(
13767
- chunkFZVAJFRH_cjs.RenameDialog,
13890
+ chunkRHKFCSFC_cjs.RenameDialog,
13768
13891
  {
13769
13892
  open: renameOpen,
13770
13893
  onClose: () => setRenameOpen(false),
@@ -13779,7 +13902,7 @@ function ProjectDetail({ projectExtId, storage }) {
13779
13902
  ] });
13780
13903
  }
13781
13904
  function createProjectErrorMessage(error, fallback = "Failed to create project") {
13782
- const detail = chunkF2BYURQZ_cjs.apiErrorDetail(error);
13905
+ const detail = chunkLYF47OXX_cjs.apiErrorDetail(error);
13783
13906
  if (typeof detail === "string" && detail) return detail;
13784
13907
  const message = detail?.message;
13785
13908
  return typeof message === "string" && message ? message : fallback;
@@ -13789,7 +13912,7 @@ function NewProjectFlow({ open, onOpenChange, defaultName }) {
13789
13912
  const [plan, setPlan] = React7.useState("pro");
13790
13913
  const [isAnnual, setIsAnnual] = React7.useState(false);
13791
13914
  const [promoCode, setPromoCode] = React7.useState("");
13792
- const [addonBudget, setAddonBudget] = React7.useState(String(chunkF2BYURQZ_cjs.DEFAULT_SPEND_CAP_PENCE / 100));
13915
+ const [addonBudget, setAddonBudget] = React7.useState(String(chunkLYF47OXX_cjs.DEFAULT_SPEND_CAP_PENCE / 100));
13793
13916
  const [checkoutBudget, setCheckoutBudget] = React7.useState(null);
13794
13917
  const [aiBlocks, setAiBlocks] = React7.useState(0);
13795
13918
  const [storageBlocks, setStorageBlocks] = React7.useState(0);
@@ -13803,7 +13926,7 @@ function NewProjectFlow({ open, onOpenChange, defaultName }) {
13803
13926
  const [checkoutProjectName, setCheckoutProjectName] = React7.useState("");
13804
13927
  const [checkoutInterval, setCheckoutInterval] = React7.useState("month");
13805
13928
  const paymentCompletedRef = React7.useRef(false);
13806
- const { stripeEnabled } = chunkF2BYURQZ_cjs.useBillingSupport();
13929
+ const { stripeEnabled } = chunkLYF47OXX_cjs.useBillingSupport();
13807
13930
  const { data: products, isLoading: productsLoading } = react.useProducts({
13808
13931
  enabled: stripeEnabled
13809
13932
  });
@@ -13832,18 +13955,18 @@ function NewProjectFlow({ open, onOpenChange, defaultName }) {
13832
13955
  setPlan("pro");
13833
13956
  setPromoCode("");
13834
13957
  setPostalCode("");
13835
- setAddonBudget(String(chunkF2BYURQZ_cjs.DEFAULT_SPEND_CAP_PENCE / 100));
13958
+ setAddonBudget(String(chunkLYF47OXX_cjs.DEFAULT_SPEND_CAP_PENCE / 100));
13836
13959
  setAiBlocks(0);
13837
13960
  setStorageBlocks(0);
13838
13961
  setIsCreating(false);
13839
13962
  }
13840
13963
  onOpenChange(newOpen);
13841
13964
  };
13842
- const prices = chunkF2BYURQZ_cjs.findProPrices(products);
13965
+ const prices = chunkLYF47OXX_cjs.findProPrices(products);
13843
13966
  const intervalPrice = isAnnual ? prices.annual : prices.monthly;
13844
- const selectedPrice = chunkF2BYURQZ_cjs.packPrice(intervalPrice);
13967
+ const selectedPrice = chunkLYF47OXX_cjs.packPrice(intervalPrice);
13845
13968
  const currency = intervalPrice?.currency ?? "gbp";
13846
- const savingsPercent = chunkF2BYURQZ_cjs.calcSavingsPercent(prices.monthly, prices.annual);
13969
+ const savingsPercent = chunkLYF47OXX_cjs.calcSavingsPercent(prices.monthly, prices.annual);
13847
13970
  const isPro = stripeEnabled && plan !== "free";
13848
13971
  const quote = useCheckoutQuote({
13849
13972
  interval: isAnnual ? "year" : "month",
@@ -13853,14 +13976,14 @@ function NewProjectFlow({ open, onOpenChange, defaultName }) {
13853
13976
  storageBlocks,
13854
13977
  enabled: open && isPro && !!selectedPrice
13855
13978
  });
13856
- const canSubmit = !!projectName.trim() && !isCreating && !createProject.isPending && (!isPro || !!selectedPrice && chunkF2BYURQZ_cjs.parseBudgetPounds(addonBudget) !== void 0 && quote.canContinue);
13979
+ const canSubmit = !!projectName.trim() && !isCreating && !createProject.isPending && (!isPro || !!selectedPrice && chunkLYF47OXX_cjs.parseBudgetPounds(addonBudget) !== void 0 && quote.canContinue);
13857
13980
  const handleCreateFree = () => {
13858
13981
  setIsCreating(true);
13859
13982
  createProject.mutate(
13860
13983
  {
13861
13984
  name: projectName.trim(),
13862
13985
  plan: "free",
13863
- daily_cap_per_user: chunkF2BYURQZ_cjs.SUGGESTED_DAILY_CAP_PER_USER
13986
+ daily_cap_per_user: chunkLYF47OXX_cjs.SUGGESTED_DAILY_CAP_PER_USER
13864
13987
  },
13865
13988
  {
13866
13989
  onSuccess: () => {
@@ -13877,14 +14000,14 @@ function NewProjectFlow({ open, onOpenChange, defaultName }) {
13877
14000
  };
13878
14001
  const handleSubscribe = () => {
13879
14002
  const interval = isAnnual ? "year" : "month";
13880
- const parsed = chunkF2BYURQZ_cjs.parseBudgetPounds(addonBudget);
13881
- const budgetToSend = parsed == null || parsed === chunkF2BYURQZ_cjs.DEFAULT_SPEND_CAP_PENCE ? null : parsed;
14003
+ const parsed = chunkLYF47OXX_cjs.parseBudgetPounds(addonBudget);
14004
+ const budgetToSend = parsed == null || parsed === chunkLYF47OXX_cjs.DEFAULT_SPEND_CAP_PENCE ? null : parsed;
13882
14005
  setIsCreating(true);
13883
14006
  createProject.mutate(
13884
14007
  {
13885
14008
  name: projectName.trim(),
13886
14009
  plan: "pro",
13887
- daily_cap_per_user: chunkF2BYURQZ_cjs.SUGGESTED_DAILY_CAP_PER_USER
14010
+ daily_cap_per_user: chunkLYF47OXX_cjs.SUGGESTED_DAILY_CAP_PER_USER
13888
14011
  },
13889
14012
  {
13890
14013
  onSuccess: (newProject) => {
@@ -13925,8 +14048,8 @@ function NewProjectFlow({ open, onOpenChange, defaultName }) {
13925
14048
  description: stripeEnabled ? "Name it and pick a plan." : "Projects group your workspaces.",
13926
14049
  showDescription: true,
13927
14050
  size: "xl",
13928
- children: /* @__PURE__ */ jsxRuntime.jsxs(chunkFZVAJFRH_cjs.PlanStack, { gap: 5, children: [
13929
- /* @__PURE__ */ jsxRuntime.jsxs(chunkFZVAJFRH_cjs.PlanStack, { gap: 2, children: [
14051
+ children: /* @__PURE__ */ jsxRuntime.jsxs(chunkRHKFCSFC_cjs.PlanStack, { gap: 5, children: [
14052
+ /* @__PURE__ */ jsxRuntime.jsxs(chunkRHKFCSFC_cjs.PlanStack, { gap: 2, children: [
13930
14053
  /* @__PURE__ */ jsxRuntime.jsx(ui.Label, { htmlFor: "new-project-name", children: "Name" }),
13931
14054
  /* @__PURE__ */ jsxRuntime.jsx(
13932
14055
  ui.Input,
@@ -13942,16 +14065,16 @@ function NewProjectFlow({ open, onOpenChange, defaultName }) {
13942
14065
  }
13943
14066
  )
13944
14067
  ] }),
13945
- stripeEnabled && (productsLoading ? /* @__PURE__ */ jsxRuntime.jsx(chunkFZVAJFRH_cjs.PlanNotice, { children: "Loading plans\u2026" }) : /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
13946
- /* @__PURE__ */ jsxRuntime.jsxs(chunkFZVAJFRH_cjs.PlanPickerCard, { children: [
14068
+ stripeEnabled && (productsLoading ? /* @__PURE__ */ jsxRuntime.jsx(chunkRHKFCSFC_cjs.PlanNotice, { children: "Loading plans\u2026" }) : /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
14069
+ /* @__PURE__ */ jsxRuntime.jsxs(chunkRHKFCSFC_cjs.PlanPickerCard, { children: [
13947
14070
  /* @__PURE__ */ jsxRuntime.jsx(
13948
- chunkFZVAJFRH_cjs.PlanPickerHeader,
14071
+ chunkRHKFCSFC_cjs.PlanPickerHeader,
13949
14072
  {
13950
14073
  title: "Plan",
13951
14074
  info: /* @__PURE__ */ jsxRuntime.jsx(PlanInfoPopover2, {}),
13952
14075
  infoPlacement: "toggle",
13953
14076
  toggle: plan !== "free" ? /* @__PURE__ */ jsxRuntime.jsx(
13954
- chunkFZVAJFRH_cjs.PricingToggle,
14077
+ chunkRHKFCSFC_cjs.PricingToggle,
13955
14078
  {
13956
14079
  isAnnual,
13957
14080
  onToggle: () => setIsAnnual(!isAnnual),
@@ -13989,7 +14112,7 @@ function NewProjectFlow({ open, onOpenChange, defaultName }) {
13989
14112
  currency
13990
14113
  }
13991
14114
  ),
13992
- /* @__PURE__ */ jsxRuntime.jsx(chunkFZVAJFRH_cjs.PromoCodeInput, { value: promoCode, onChange: setPromoCode }),
14115
+ /* @__PURE__ */ jsxRuntime.jsx(chunkRHKFCSFC_cjs.PromoCodeInput, { value: promoCode, onChange: setPromoCode }),
13993
14116
  /* @__PURE__ */ jsxRuntime.jsx(
13994
14117
  CheckoutCountrySelect,
13995
14118
  {
@@ -14008,10 +14131,10 @@ function NewProjectFlow({ open, onOpenChange, defaultName }) {
14008
14131
  onPostalCodeChange: setPostalCode
14009
14132
  }
14010
14133
  )
14011
- ] }) : /* @__PURE__ */ jsxRuntime.jsx(chunkFZVAJFRH_cjs.PlanNotice, { children: "Pro isn't available right now." }))
14134
+ ] }) : /* @__PURE__ */ jsxRuntime.jsx(chunkRHKFCSFC_cjs.PlanNotice, { children: "Pro isn't available right now." }))
14012
14135
  ] })),
14013
- /* @__PURE__ */ jsxRuntime.jsx(chunkFZVAJFRH_cjs.PlanActionButton, { onClick: submit, disabled: !canSubmit, children: isCreating ? "Creating\u2026" : isPro ? "Continue to payment" : "Create project" }),
14014
- isSlow && /* @__PURE__ */ jsxRuntime.jsx(chunkFZVAJFRH_cjs.PlanNotice, { className: "text-xs", testId: "new-project-still-working", children: "Still working. We'll update here." })
14136
+ /* @__PURE__ */ jsxRuntime.jsx(chunkRHKFCSFC_cjs.PlanActionButton, { onClick: submit, disabled: !canSubmit, children: isCreating ? "Creating\u2026" : isPro ? "Continue to payment" : "Create project" }),
14137
+ isSlow && /* @__PURE__ */ jsxRuntime.jsx(chunkRHKFCSFC_cjs.PlanNotice, { className: "text-xs", testId: "new-project-still-working", children: "Still working. We'll update here." })
14015
14138
  ] })
14016
14139
  }
14017
14140
  ),
@@ -14039,7 +14162,7 @@ function NewProjectFlow({ open, onOpenChange, defaultName }) {
14039
14162
  function useAutoRefreshPendingProjects() {
14040
14163
  const { data: projects } = react.useProjects();
14041
14164
  const refreshProject = react.useRefreshProject();
14042
- const currentUserExtId = chunkF2BYURQZ_cjs.useSelfExtId();
14165
+ const currentUserExtId = chunkLYF47OXX_cjs.useSelfExtId();
14043
14166
  const refreshedRef = React7.useRef(/* @__PURE__ */ new Set());
14044
14167
  React7.useEffect(() => {
14045
14168
  if (!projects || !currentUserExtId) return;
@@ -14055,8 +14178,13 @@ function useAutoRefreshPendingProjects() {
14055
14178
  var QUOTA_EXCEEDED_MESSAGE = "This project's AI usage for this month is used up.";
14056
14179
  var BOX_MEMBER_QUOTA_MESSAGE = "AI usage for this month is used up. Ask your Box admin to add more.";
14057
14180
  var BOX_ADMIN_QUOTA_MESSAGE = "AI usage for this month is used up. Add more in the ARBI portal.";
14058
- function ConnectedQuotaDialog({ info, onClose: close, box }) {
14059
- const { openProject } = chunk2QQUGL2V_cjs.useBlocksEnvironment();
14181
+ function ConnectedQuotaDialog({ info, onClose: close }) {
14182
+ const { openProject, runtimeConfig } = chunk2QQUGL2V_cjs.useBlocksEnvironment();
14183
+ const role = react.useBoxRole({ enabled: info !== null });
14184
+ const box = role.isBox ? {
14185
+ isAdmin: role.isBoxAdmin && !!runtimeConfig.licenceUrl,
14186
+ portalUrl: runtimeConfig.licenceUrl
14187
+ } : void 0;
14060
14188
  const { data: projects, refetch: refetchProjects } = react.useProjects();
14061
14189
  const [addAiUsageFor, setAddAiUsageFor] = React7.useState(null);
14062
14190
  const open = info !== null;
@@ -14065,7 +14193,7 @@ function ConnectedQuotaDialog({ info, onClose: close, box }) {
14065
14193
  if (quotaProjectId) void refetchProjects();
14066
14194
  }, [quotaProjectId, refetchProjects]);
14067
14195
  const project = info?.projectExtId ? projects?.find((p) => p.external_id === info.projectExtId) : void 0;
14068
- const addons = project && chunkF2BYURQZ_cjs.isProProject(project) ? project.addons : null;
14196
+ const addons = project && chunkLYF47OXX_cjs.isProProject(project) ? project.addons : null;
14069
14197
  const handleUpgrade = () => {
14070
14198
  if (info?.projectExtId) {
14071
14199
  requestProjectBillingFocus({ projectExtId: info.projectExtId, openUpgrade: true });
@@ -14101,8 +14229,8 @@ function ConnectedQuotaDialog({ info, onClose: close, box }) {
14101
14229
  /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, {})
14102
14230
  );
14103
14231
  } else if (addons) {
14104
- const price = `${chunkF2BYURQZ_cjs.formatMoney(addons.ai_block_price_ex_vat_pence, "gbp")} + VAT`;
14105
- const capZero = chunkF2BYURQZ_cjs.isAddonBudgetZero(addons);
14232
+ const price = `${chunkLYF47OXX_cjs.formatMoney(addons.ai_block_price_ex_vat_pence, "gbp")} + VAT`;
14233
+ const capZero = chunkLYF47OXX_cjs.isAddonBudgetZero(addons);
14106
14234
  const addAiUsage = /* @__PURE__ */ jsxRuntime.jsxs(ui.Button, { onClick: handleAddAiUsage, "data-testid": "quota-add-ai-usage-button", children: [
14107
14235
  "Add ",
14108
14236
  react.formatGbp(addons.block_ai_gbp),
@@ -14110,7 +14238,7 @@ function ConnectedQuotaDialog({ info, onClose: close, box }) {
14110
14238
  price
14111
14239
  ] });
14112
14240
  if (capZero || addons.cap_reached) {
14113
- message = capZero ? chunkF2BYURQZ_cjs.ZERO_BUDGET_MESSAGE : chunkF2BYURQZ_cjs.CAP_REACHED_MESSAGE;
14241
+ message = capZero ? chunkLYF47OXX_cjs.ZERO_BUDGET_MESSAGE : chunkLYF47OXX_cjs.CAP_REACHED_MESSAGE;
14114
14242
  actions = /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
14115
14243
  addAiUsage,
14116
14244
  /* @__PURE__ */ jsxRuntime.jsx(ui.Button, { variant: "outline", onClick: handleRaiseCap, "data-testid": "quota-raise-cap-button", children: capZero ? "Set cap" : "Raise cap" })
@@ -14123,7 +14251,7 @@ function ConnectedQuotaDialog({ info, onClose: close, box }) {
14123
14251
  const addAiUsageProject = addAiUsageFor ? projects?.find((p) => p.external_id === addAiUsageFor) : void 0;
14124
14252
  return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
14125
14253
  /* @__PURE__ */ jsxRuntime.jsx(
14126
- chunkFZVAJFRH_cjs.QuotaExceededDialogView,
14254
+ chunkRHKFCSFC_cjs.QuotaExceededDialogView,
14127
14255
  {
14128
14256
  open,
14129
14257
  onClose: close,
@@ -14220,7 +14348,7 @@ function ConnectedWelcomeDialog({
14220
14348
  }) {
14221
14349
  const currentUser = react.useArbiSession().user;
14222
14350
  const { data: projects } = react.useProjects();
14223
- const balance = chunkF2BYURQZ_cjs.useRewardBalance();
14351
+ const balance = chunkLYF47OXX_cjs.useRewardBalance();
14224
14352
  const [showPlans, setShowPlans] = React7.useState(false);
14225
14353
  const [showInvite, setShowInvite] = React7.useState(false);
14226
14354
  const [selectedProjectId, setSelectedProjectId] = React7.useState(null);
@@ -14241,25 +14369,25 @@ function ConnectedWelcomeDialog({
14241
14369
  return /* @__PURE__ */ jsxRuntime.jsx(ChangePlanDialog, { project: selectedProject, open, onOpenChange: handleOpenChange });
14242
14370
  }
14243
14371
  if (showInvite) {
14244
- return /* @__PURE__ */ jsxRuntime.jsx(chunkFZVAJFRH_cjs.InviteContactsDialog, { open, onClose: () => handleOpenChange(false), children: /* @__PURE__ */ jsxRuntime.jsx(
14372
+ return /* @__PURE__ */ jsxRuntime.jsx(chunkRHKFCSFC_cjs.InviteContactsDialog, { open, onClose: () => handleOpenChange(false), children: /* @__PURE__ */ jsxRuntime.jsx(
14245
14373
  ConnectedAddContacts,
14246
14374
  {
14247
14375
  onClose: () => handleOpenChange(false),
14248
- rewardAmount: chunkF2BYURQZ_cjs.formatMoney(REFERRAL_OFFER.amount, REFERRAL_OFFER.currency)
14376
+ rewardAmount: chunkLYF47OXX_cjs.formatMoney(REFERRAL_OFFER.amount, REFERRAL_OFFER.currency)
14249
14377
  }
14250
14378
  ) });
14251
14379
  }
14252
- const firstName = currentUser?.given_name;
14380
+ const firstName2 = currentUser?.given_name;
14253
14381
  const hasBalance = balance !== null;
14254
- const quotaItems = chunkF2BYURQZ_cjs.getQuotaItems(selectedProject.quotas);
14255
- const resetTs = chunkF2BYURQZ_cjs.aiUsageResetTimestamp(selectedProject);
14256
- const aiUsageHint = resetTs ? `resets ${chunkF2BYURQZ_cjs.formatResetDate(resetTs)}` : void 0;
14382
+ const quotaItems = chunkLYF47OXX_cjs.getQuotaItems(selectedProject.quotas);
14383
+ const resetTs = chunkLYF47OXX_cjs.aiUsageResetTimestamp(selectedProject);
14384
+ const aiUsageHint = resetTs ? `resets ${chunkLYF47OXX_cjs.formatResetDate(resetTs)}` : void 0;
14257
14385
  return /* @__PURE__ */ jsxRuntime.jsx(
14258
- chunkFZVAJFRH_cjs.WelcomeDialog,
14386
+ chunkRHKFCSFC_cjs.WelcomeDialog,
14259
14387
  {
14260
14388
  open,
14261
14389
  onClose: () => handleOpenChange(false),
14262
- firstName,
14390
+ firstName: firstName2,
14263
14391
  hasReward: hasBalance,
14264
14392
  projectPicker: /* @__PURE__ */ jsxRuntime.jsx(
14265
14393
  chunkKJVDYWAM_cjs.ProjectPicker,
@@ -14270,7 +14398,7 @@ function ConnectedWelcomeDialog({
14270
14398
  onChange: setSelectedProjectId
14271
14399
  }
14272
14400
  ),
14273
- planBadge: /* @__PURE__ */ jsxRuntime.jsx(chunkFZVAJFRH_cjs.PlanBadge, { ...chunkF2BYURQZ_cjs.planBadgeView(selectedProject), size: "md" }),
14401
+ planBadge: /* @__PURE__ */ jsxRuntime.jsx(chunkRHKFCSFC_cjs.PlanBadge, { ...chunkLYF47OXX_cjs.planBadgeView(selectedProject), size: "md" }),
14274
14402
  quotas: quotaItems.map((q) => ({
14275
14403
  key: q.key,
14276
14404
  icon: q.icon,
@@ -14280,9 +14408,9 @@ function ConnectedWelcomeDialog({
14280
14408
  hint: q.key === "ai-usage" ? aiUsageHint : void 0
14281
14409
  })),
14282
14410
  onSeePlans: () => setShowPlans(true),
14283
- referralOfferLabel: `${chunkF2BYURQZ_cjs.formatMoney(REFERRAL_OFFER.amount, REFERRAL_OFFER.currency)} off your plan`,
14411
+ referralOfferLabel: `${chunkLYF47OXX_cjs.formatMoney(REFERRAL_OFFER.amount, REFERRAL_OFFER.currency)} off your plan`,
14284
14412
  onInvite: () => setShowInvite(true),
14285
- rewardBalanceLabel: hasBalance ? chunkF2BYURQZ_cjs.formatMoney(balance.amount, balance.currency) : void 0
14413
+ rewardBalanceLabel: hasBalance ? chunkLYF47OXX_cjs.formatMoney(balance.amount, balance.currency) : void 0
14286
14414
  }
14287
14415
  );
14288
14416
  }
@@ -14319,7 +14447,7 @@ function WorkspaceCardsView({
14319
14447
  createDisabledReason,
14320
14448
  workspaceState
14321
14449
  }) {
14322
- const { stripeEnabled } = chunkF2BYURQZ_cjs.useBillingSupport();
14450
+ const { stripeEnabled } = chunkLYF47OXX_cjs.useBillingSupport();
14323
14451
  const { hrefFor } = chunk2QQUGL2V_cjs.useBlocksEnvironment();
14324
14452
  const workspaceLabel = ui.getEntityLabel("WORKSPACE");
14325
14453
  const projectLabel = ui.getEntityLabel("PROJECT").toLowerCase();
@@ -14339,7 +14467,7 @@ function WorkspaceCardsView({
14339
14467
  }
14340
14468
  return /* @__PURE__ */ jsxRuntime.jsx(chunkKJVDYWAM_cjs.WorkspaceList, { testId: "workspace-cards-list", children: groups.map((group) => {
14341
14469
  const project = projects.find((p) => p.external_id === group.projectExtId);
14342
- const { breakdown, readout } = chunkF2BYURQZ_cjs.projectGroupBilling(project, {
14470
+ const { breakdown, readout } = chunkLYF47OXX_cjs.projectGroupBilling(project, {
14343
14471
  isOwned: group.isOwned,
14344
14472
  stripeEnabled
14345
14473
  });
@@ -14498,7 +14626,7 @@ function useConnectedWorkspaceList({
14498
14626
  [selfId, pinned]
14499
14627
  );
14500
14628
  const filtered = React7.useMemo(
14501
- () => chunkFZVAJFRH_cjs.applyTriStateFilters(workspaces, filterMap, attributesOf),
14629
+ () => chunkRHKFCSFC_cjs.applyTriStateFilters(workspaces, filterMap, attributesOf),
14502
14630
  [workspaces, filterMap, attributesOf]
14503
14631
  );
14504
14632
  const groups = React7.useMemo(
@@ -14563,7 +14691,7 @@ function useConnectedWorkspaceList({
14563
14691
  };
14564
14692
  }
14565
14693
  var WorkspaceTableView = React7.lazy(
14566
- () => import('../WorkspaceTableView-6JVHGDUB.cjs').then((m) => ({ default: m.WorkspaceTableView }))
14694
+ () => import('../WorkspaceTableView-GIDGNGBW.cjs').then((m) => ({ default: m.WorkspaceTableView }))
14567
14695
  );
14568
14696
  var WORKSPACES_TAB_ID = "workspaces";
14569
14697
  var defaultRenderMember2 = (user, size) => {
@@ -14615,7 +14743,7 @@ function ConnectedWorkspaceList({
14615
14743
  else void openWorkspace(workspace.external_id, { name: workspace.name });
14616
14744
  };
14617
14745
  const createDisabledReason = list.canCreateProjects === false ? react.PROJECT_CREATION_DENIED_REASON : void 0;
14618
- if (list.isLoading) return /* @__PURE__ */ jsxRuntime.jsx(chunkTTJGCJWX_cjs.LoadingIndicator, { message: "Loading workspaces..." });
14746
+ if (list.isLoading) return /* @__PURE__ */ jsxRuntime.jsx(chunkH3XAHVDT_cjs.LoadingIndicator, { message: "Loading workspaces..." });
14619
14747
  if (list.error) {
14620
14748
  return /* @__PURE__ */ jsxRuntime.jsx(
14621
14749
  chunkFCWS7I5C_cjs.HomeLoadError,
@@ -14688,7 +14816,7 @@ function ConnectedWorkspaceList({
14688
14816
  workspaceState
14689
14817
  }
14690
14818
  ) })
14691
- ) : /* @__PURE__ */ jsxRuntime.jsx(React7.Suspense, { fallback: /* @__PURE__ */ jsxRuntime.jsx(chunkTTJGCJWX_cjs.LoadingIndicator, { message: "Loading grid..." }), children: /* @__PURE__ */ jsxRuntime.jsx(chunkFCWS7I5C_cjs.HomeCenteredColumn, { children: /* @__PURE__ */ jsxRuntime.jsx(
14819
+ ) : /* @__PURE__ */ jsxRuntime.jsx(React7.Suspense, { fallback: /* @__PURE__ */ jsxRuntime.jsx(chunkH3XAHVDT_cjs.LoadingIndicator, { message: "Loading grid..." }), children: /* @__PURE__ */ jsxRuntime.jsx(chunkFCWS7I5C_cjs.HomeCenteredColumn, { children: /* @__PURE__ */ jsxRuntime.jsx(
14692
14820
  WorkspaceTableView,
14693
14821
  {
14694
14822
  list,
@@ -14702,6 +14830,242 @@ function ConnectedWorkspaceList({
14702
14830
  ) }) }) })
14703
14831
  ] });
14704
14832
  }
14833
+ function workspaceSummary(w) {
14834
+ return {
14835
+ id: w.external_id,
14836
+ name: w.name,
14837
+ description: w.description ?? void 0,
14838
+ isPublic: !!w.is_public,
14839
+ documentCount: chunkJUUOJP7I_cjs.workspaceDocumentCount(w),
14840
+ conversationCount: chunkJUUOJP7I_cjs.workspaceConversationCount(w),
14841
+ memberCount: w.users?.length ?? 0,
14842
+ filesMb: w.user_files_mb ?? 0,
14843
+ updatedAt: w.updated_at
14844
+ };
14845
+ }
14846
+ function distinctMembers(workspaces) {
14847
+ const byId = /* @__PURE__ */ new Map();
14848
+ for (const w of workspaces) {
14849
+ for (const member of w.users ?? []) {
14850
+ const user = member.user;
14851
+ const id = user?.external_id;
14852
+ if (!id || byId.has(id)) continue;
14853
+ const name = [user.given_name, user.family_name].filter(Boolean).join(" ").trim();
14854
+ byId.set(id, {
14855
+ id,
14856
+ name: name || user.email || "Unknown",
14857
+ email: user.email ?? "",
14858
+ role: member.role ?? "member",
14859
+ isAgent: Boolean(member.agent_ext_id) || chunkJUUOJP7I_cjs.isAgentAccount(user)
14860
+ });
14861
+ }
14862
+ }
14863
+ return [...byId.values()];
14864
+ }
14865
+ function buildProjectSummaries(projects, workspaces) {
14866
+ const byProject = /* @__PURE__ */ new Map();
14867
+ for (const w of workspaces ?? []) {
14868
+ const id = w.project_ext_id;
14869
+ if (!id) continue;
14870
+ byProject.set(id, [...byProject.get(id) ?? [], w]);
14871
+ }
14872
+ const summaries = (projects ?? []).map((p) => {
14873
+ const own = byProject.get(p.external_id) ?? [];
14874
+ const storage = p.quotas?.storage_gb;
14875
+ const aiUsage = p.quotas?.ai_usage;
14876
+ const stats = chunkJUUOJP7I_cjs.workspaceGroupStats(own);
14877
+ return {
14878
+ id: p.external_id,
14879
+ name: p.name,
14880
+ createdAt: p.created_at,
14881
+ subscription: p.subscription ?? "none",
14882
+ workspaces: own.map(workspaceSummary),
14883
+ workspaceCount: own.length,
14884
+ documentCount: stats.documents,
14885
+ conversationCount: stats.conversations,
14886
+ members: distinctMembers(own),
14887
+ memberCount: stats.members,
14888
+ filesMb: own.reduce((sum, w) => sum + (w.user_files_mb ?? 0), 0),
14889
+ storageUsedGb: storage?.used ?? 0,
14890
+ storageLimitGb: storage?.limit ?? 0,
14891
+ aiUsageUsed: aiUsage?.used ?? 0,
14892
+ aiUsageLimit: aiUsage?.limit ?? 0,
14893
+ client: p.client ?? null,
14894
+ clientRef: p.client_ref ?? null,
14895
+ stage: p.stage ?? null,
14896
+ leadUser: p.lead_user ?? null,
14897
+ budget: p.budget ?? null,
14898
+ fields: p.fields ?? {}
14899
+ };
14900
+ });
14901
+ const work = (s) => s.documentCount + s.conversationCount;
14902
+ return summaries.sort((a, b) => work(b) - work(a));
14903
+ }
14904
+ function useProjectSummaries() {
14905
+ const projects = react.useProjects();
14906
+ const workspaces = react.useWorkspaces();
14907
+ const summaries = React7.useMemo(
14908
+ () => buildProjectSummaries(
14909
+ projects.data,
14910
+ workspaces.data
14911
+ ),
14912
+ [projects.data, workspaces.data]
14913
+ );
14914
+ return {
14915
+ projects: summaries,
14916
+ isLoading: projects.isLoading || workspaces.isLoading,
14917
+ isError: projects.isError || workspaces.isError,
14918
+ error: projects.error ?? workspaces.error
14919
+ };
14920
+ }
14921
+ function useProjectSummary(projectId) {
14922
+ const { projects, isLoading, isError } = useProjectSummaries();
14923
+ const project = React7.useMemo(() => projects.find((p) => p.id === projectId), [projects, projectId]);
14924
+ const usage = react.useProjectUsage(projectId, 0, { enabled: !!projectId });
14925
+ return { project, usage: usage.data, usageLoading: usage.isLoading, isLoading, isError };
14926
+ }
14927
+ function primaryProjectWorkspace(project) {
14928
+ const work = (w) => w.documentCount + w.conversationCount;
14929
+ return [...project.workspaces].sort((a, b) => work(b) - work(a))[0];
14930
+ }
14931
+ var DEFAULT_PROJECT_LIST_COLUMNS = [
14932
+ "name",
14933
+ "client",
14934
+ "stage",
14935
+ "documents",
14936
+ "conversations",
14937
+ "members",
14938
+ "storage"
14939
+ ];
14940
+ var DEFAULT_PROJECTS_LIST_LABELS = {
14941
+ title: "Projects",
14942
+ description: "Every project: its client, stage, documents and the work on it.",
14943
+ searchPlaceholder: "Search projects and workspaces\u2026",
14944
+ columns: {
14945
+ name: "Project",
14946
+ client: "Client",
14947
+ stage: "Stage",
14948
+ documents: "Documents",
14949
+ conversations: "Threads",
14950
+ members: "Team",
14951
+ storage: "Storage"
14952
+ },
14953
+ opened: "opened",
14954
+ loadingTitle: "Loading projects\u2026",
14955
+ loadingDescription: "Fetching your projects.",
14956
+ emptyTitle: "No projects yet"
14957
+ };
14958
+ function formatStorageGb(gb3) {
14959
+ if (gb3 <= 0) return "\u2014";
14960
+ if (gb3 < 0.1) return `${Math.round(gb3 * 1024)} MB`;
14961
+ return `${gb3.toFixed(2)} GB`;
14962
+ }
14963
+ function ProjectsListPage({
14964
+ labels: given,
14965
+ columns: shown = DEFAULT_PROJECT_LIST_COLUMNS,
14966
+ actions,
14967
+ testId = "projects"
14968
+ }) {
14969
+ const labels = {
14970
+ ...DEFAULT_PROJECTS_LIST_LABELS,
14971
+ ...given,
14972
+ columns: { ...DEFAULT_PROJECTS_LIST_LABELS.columns, ...given?.columns }
14973
+ };
14974
+ const { openProject } = chunk2QQUGL2V_cjs.useBlocksEnvironment();
14975
+ const [search, setSearch] = React7.useState("");
14976
+ const { projects, isLoading } = useProjectSummaries();
14977
+ const rows = React7.useMemo(() => {
14978
+ const q = search.trim().toLowerCase();
14979
+ if (!q) return projects;
14980
+ return projects.filter(
14981
+ (p) => p.name.toLowerCase().includes(q) || p.workspaces.some((w) => w.name.toLowerCase().includes(q))
14982
+ );
14983
+ }, [search, projects]);
14984
+ const all = {
14985
+ name: {
14986
+ key: "name",
14987
+ header: labels.columns.name,
14988
+ render: (p) => /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "min-w-0", children: [
14989
+ /* @__PURE__ */ jsxRuntime.jsx("p", { className: "max-w-[22rem] truncate font-medium text-foreground", children: p.name }),
14990
+ /* @__PURE__ */ jsxRuntime.jsxs("p", { className: "truncate text-xs text-muted-foreground", children: [
14991
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "font-mono", children: p.clientRef || p.id }),
14992
+ " \xB7 ",
14993
+ labels.opened,
14994
+ " ",
14995
+ chunkUFEXJIEY_cjs.fmtDate(p.createdAt)
14996
+ ] })
14997
+ ] })
14998
+ },
14999
+ client: {
15000
+ key: "client",
15001
+ header: labels.columns.client,
15002
+ render: (p) => /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-sm text-foreground", children: p.client || "\u2014" })
15003
+ },
15004
+ stage: {
15005
+ key: "stage",
15006
+ header: labels.columns.stage,
15007
+ render: (p) => p.stage ? /* @__PURE__ */ jsxRuntime.jsx(ui.Badge, { variant: "secondary", children: p.stage }) : /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-xs text-muted-foreground", children: "\u2014" })
15008
+ },
15009
+ documents: {
15010
+ key: "documents",
15011
+ header: labels.columns.documents,
15012
+ align: "right",
15013
+ render: (p) => /* @__PURE__ */ jsxRuntime.jsx("span", { className: "font-medium text-foreground", children: p.documentCount.toLocaleString() })
15014
+ },
15015
+ conversations: {
15016
+ key: "conversations",
15017
+ header: labels.columns.conversations,
15018
+ align: "right",
15019
+ render: (p) => /* @__PURE__ */ jsxRuntime.jsx("span", { className: "font-medium text-foreground", children: p.conversationCount.toLocaleString() })
15020
+ },
15021
+ members: {
15022
+ key: "team",
15023
+ header: labels.columns.members,
15024
+ render: (p) => p.memberCount ? /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "inline-flex items-center gap-1.5 text-sm text-foreground", children: [
15025
+ /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Users, { className: "size-3.5 text-muted-foreground" }),
15026
+ p.memberCount
15027
+ ] }) : /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-xs text-muted-foreground", children: "\u2014" })
15028
+ },
15029
+ storage: {
15030
+ key: "storage",
15031
+ header: labels.columns.storage,
15032
+ align: "right",
15033
+ render: (p) => /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-sm text-muted-foreground", children: formatStorageGb(p.storageUsedGb) })
15034
+ }
15035
+ };
15036
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-6", "data-testid": `page-${testId}`, children: [
15037
+ /* @__PURE__ */ jsxRuntime.jsx(
15038
+ chunkXDU3HHUU_cjs.PageHeader,
15039
+ {
15040
+ eyebrow: labels.eyebrow,
15041
+ title: labels.title,
15042
+ description: labels.description,
15043
+ actions
15044
+ }
15045
+ ),
15046
+ /* @__PURE__ */ jsxRuntime.jsx(
15047
+ chunkH3XAHVDT_cjs.Toolbar,
15048
+ {
15049
+ search,
15050
+ onSearch: setSearch,
15051
+ searchPlaceholder: labels.searchPlaceholder,
15052
+ testId: `${testId}-toolbar`
15053
+ }
15054
+ ),
15055
+ /* @__PURE__ */ jsxRuntime.jsx(
15056
+ chunkXDU3HHUU_cjs.DataTable,
15057
+ {
15058
+ area: testId,
15059
+ columns: shown.map((c) => all[c]),
15060
+ rows,
15061
+ getRowId: (p) => p.id,
15062
+ onRowClick: (p) => openProject(p.id),
15063
+ emptyTitle: isLoading ? labels.loadingTitle : labels.emptyTitle,
15064
+ emptyDescription: isLoading ? labels.loadingDescription : labels.emptyDescription
15065
+ }
15066
+ )
15067
+ ] });
15068
+ }
14705
15069
  var PROJECTS_BASE_TAB_ID = "projects";
14706
15070
  var isPaid = (p) => p.subscription === "active" || p.subscription === "past_due";
14707
15071
  function useLocalProjectTabs() {
@@ -14721,6 +15085,13 @@ function useLocalProjectTabs() {
14721
15085
  };
14722
15086
  }
14723
15087
  function ConnectedProjectsPanel({
15088
+ layout = "panel",
15089
+ page,
15090
+ ...panel
15091
+ }) {
15092
+ return layout === "page" ? /* @__PURE__ */ jsxRuntime.jsx(ProjectsListPage, { ...page }) : /* @__PURE__ */ jsxRuntime.jsx(ProjectsPanel, { ...panel });
15093
+ }
15094
+ function ProjectsPanel({
14724
15095
  tabs: hostTabs,
14725
15096
  projectStorage,
14726
15097
  footer,
@@ -14737,7 +15108,7 @@ function ConnectedProjectsPanel({
14737
15108
  const { data: projects } = react.useProjects();
14738
15109
  const canCreateProjects = react.useCanCreateProjects();
14739
15110
  const { userId } = chunkIWT4QVQL_cjs.useConnectedWorkspace();
14740
- const { stripeEnabled } = chunkF2BYURQZ_cjs.useBillingSupport();
15111
+ const { stripeEnabled } = chunkLYF47OXX_cjs.useBillingSupport();
14741
15112
  const billingPortal = useOpenBillingPortal();
14742
15113
  const [newProjectOpen, setNewProjectOpen] = React7.useState(false);
14743
15114
  useAutoRefreshPendingProjects();
@@ -14764,15 +15135,15 @@ function ConnectedProjectsPanel({
14764
15135
  [ownedCount, tabs, projects]
14765
15136
  );
14766
15137
  const paidProject = projects?.find(isPaid);
14767
- const panel = /* @__PURE__ */ jsxRuntime.jsxs(chunkFZVAJFRH_cjs.PanelFrame, { className, testId: "projects-panel", children: [
14768
- /* @__PURE__ */ jsxRuntime.jsx(chunkFZVAJFRH_cjs.DraggableHeader, { children: /* @__PURE__ */ jsxRuntime.jsx(
15138
+ const panel = /* @__PURE__ */ jsxRuntime.jsxs(chunkRHKFCSFC_cjs.PanelFrame, { className, testId: "projects-panel", children: [
15139
+ /* @__PURE__ */ jsxRuntime.jsx(chunkRHKFCSFC_cjs.DraggableHeader, { children: /* @__PURE__ */ jsxRuntime.jsx(
14769
15140
  chunkMEMWZ72Y_cjs.TabHeader,
14770
15141
  {
14771
15142
  tabs: headerTabs,
14772
15143
  activeTabId: activeProjectId ?? PROJECTS_BASE_TAB_ID,
14773
15144
  onTabChange: (id) => tabs.onSelect(id === PROJECTS_BASE_TAB_ID ? null : id),
14774
15145
  afterTabs: (isCompact) => /* @__PURE__ */ jsxRuntime.jsx(
14775
- chunkFZVAJFRH_cjs.PanelAddButton,
15146
+ chunkRHKFCSFC_cjs.PanelAddButton,
14776
15147
  {
14777
15148
  label: "New project",
14778
15149
  onClick: () => setNewProjectOpen(true),
@@ -14787,15 +15158,15 @@ function ConnectedProjectsPanel({
14787
15158
  compactBreakpoint: 360
14788
15159
  }
14789
15160
  ) }),
14790
- /* @__PURE__ */ jsxRuntime.jsx(chunkFZVAJFRH_cjs.PanelFrameBody, { children: activeProjectId ? /* @__PURE__ */ jsxRuntime.jsx(chunkFZVAJFRH_cjs.PanelScroll, { children: /* @__PURE__ */ jsxRuntime.jsx(
15161
+ /* @__PURE__ */ jsxRuntime.jsx(chunkRHKFCSFC_cjs.PanelFrameBody, { children: activeProjectId ? /* @__PURE__ */ jsxRuntime.jsx(chunkRHKFCSFC_cjs.PanelScroll, { children: /* @__PURE__ */ jsxRuntime.jsx(
14791
15162
  ProjectDetail,
14792
15163
  {
14793
15164
  projectExtId: activeProjectId,
14794
15165
  storage: projectStorage?.(activeProjectId)
14795
15166
  }
14796
- ) }) : /* @__PURE__ */ jsxRuntime.jsxs(chunkFZVAJFRH_cjs.PanelScroll, { variant: "padded", children: [
15167
+ ) }) : /* @__PURE__ */ jsxRuntime.jsxs(chunkRHKFCSFC_cjs.PanelScroll, { variant: "padded", children: [
14797
15168
  /* @__PURE__ */ jsxRuntime.jsx(ProjectsTable, {}),
14798
- stripeEnabled && paidProject && /* @__PURE__ */ jsxRuntime.jsx(chunkFZVAJFRH_cjs.PanelActionsRow, { children: /* @__PURE__ */ jsxRuntime.jsxs(
15169
+ stripeEnabled && paidProject && /* @__PURE__ */ jsxRuntime.jsx(chunkRHKFCSFC_cjs.PanelActionsRow, { children: /* @__PURE__ */ jsxRuntime.jsxs(
14799
15170
  ui.Button,
14800
15171
  {
14801
15172
  onClick: () => billingPortal.open(paidProject.external_id),
@@ -14823,104 +15194,6 @@ function ConnectedProjectsPanel({
14823
15194
  ] });
14824
15195
  return hostTabs ? panel : /* @__PURE__ */ jsxRuntime.jsx(chunkMB3S2ETI_cjs.ArbiHost, { config: localHost, children: panel });
14825
15196
  }
14826
- function workspaceSummary(w) {
14827
- return {
14828
- id: w.external_id,
14829
- name: w.name,
14830
- description: w.description ?? void 0,
14831
- isPublic: !!w.is_public,
14832
- documentCount: chunkJUUOJP7I_cjs.workspaceDocumentCount(w),
14833
- conversationCount: chunkJUUOJP7I_cjs.workspaceConversationCount(w),
14834
- memberCount: w.users?.length ?? 0,
14835
- filesMb: w.user_files_mb ?? 0,
14836
- updatedAt: w.updated_at
14837
- };
14838
- }
14839
- function distinctMembers(workspaces) {
14840
- const byId = /* @__PURE__ */ new Map();
14841
- for (const w of workspaces) {
14842
- for (const member of w.users ?? []) {
14843
- const user = member.user;
14844
- const id = user?.external_id;
14845
- if (!id || byId.has(id)) continue;
14846
- const name = [user.given_name, user.family_name].filter(Boolean).join(" ").trim();
14847
- byId.set(id, {
14848
- id,
14849
- name: name || user.email || "Unknown",
14850
- email: user.email ?? "",
14851
- role: member.role ?? "member",
14852
- isAgent: Boolean(member.agent_ext_id) || chunkJUUOJP7I_cjs.isAgentAccount(user)
14853
- });
14854
- }
14855
- }
14856
- return [...byId.values()];
14857
- }
14858
- function buildProjectSummaries(projects, workspaces) {
14859
- const byProject = /* @__PURE__ */ new Map();
14860
- for (const w of workspaces ?? []) {
14861
- const id = w.project_ext_id;
14862
- if (!id) continue;
14863
- byProject.set(id, [...byProject.get(id) ?? [], w]);
14864
- }
14865
- const summaries = (projects ?? []).map((p) => {
14866
- const own = byProject.get(p.external_id) ?? [];
14867
- const storage = p.quotas?.storage_gb;
14868
- const aiUsage = p.quotas?.ai_usage;
14869
- const stats = chunkJUUOJP7I_cjs.workspaceGroupStats(own);
14870
- return {
14871
- id: p.external_id,
14872
- name: p.name,
14873
- createdAt: p.created_at,
14874
- subscription: p.subscription ?? "none",
14875
- workspaces: own.map(workspaceSummary),
14876
- workspaceCount: own.length,
14877
- documentCount: stats.documents,
14878
- conversationCount: stats.conversations,
14879
- members: distinctMembers(own),
14880
- memberCount: stats.members,
14881
- filesMb: own.reduce((sum, w) => sum + (w.user_files_mb ?? 0), 0),
14882
- storageUsedGb: storage?.used ?? 0,
14883
- storageLimitGb: storage?.limit ?? 0,
14884
- aiUsageUsed: aiUsage?.used ?? 0,
14885
- aiUsageLimit: aiUsage?.limit ?? 0,
14886
- client: p.client ?? null,
14887
- clientRef: p.client_ref ?? null,
14888
- stage: p.stage ?? null,
14889
- leadUser: p.lead_user ?? null,
14890
- budget: p.budget ?? null,
14891
- fields: p.fields ?? {}
14892
- };
14893
- });
14894
- const work = (s) => s.documentCount + s.conversationCount;
14895
- return summaries.sort((a, b) => work(b) - work(a));
14896
- }
14897
- function useProjectSummaries() {
14898
- const projects = react.useProjects();
14899
- const workspaces = react.useWorkspaces();
14900
- const summaries = React7.useMemo(
14901
- () => buildProjectSummaries(
14902
- projects.data,
14903
- workspaces.data
14904
- ),
14905
- [projects.data, workspaces.data]
14906
- );
14907
- return {
14908
- projects: summaries,
14909
- isLoading: projects.isLoading || workspaces.isLoading,
14910
- isError: projects.isError || workspaces.isError,
14911
- error: projects.error ?? workspaces.error
14912
- };
14913
- }
14914
- function useProjectSummary(projectId) {
14915
- const { projects, isLoading, isError } = useProjectSummaries();
14916
- const project = React7.useMemo(() => projects.find((p) => p.id === projectId), [projects, projectId]);
14917
- const usage = react.useProjectUsage(projectId, 0, { enabled: !!projectId });
14918
- return { project, usage: usage.data, usageLoading: usage.isLoading, isLoading, isError };
14919
- }
14920
- function primaryProjectWorkspace(project) {
14921
- const work = (w) => w.documentCount + w.conversationCount;
14922
- return [...project.workspaces].sort((a, b) => work(b) - work(a))[0];
14923
- }
14924
15197
  function RowsEditor({
14925
15198
  label,
14926
15199
  rows,
@@ -22672,9 +22945,9 @@ function ConnectedTagEntity({
22672
22945
  onEditClick();
22673
22946
  }
22674
22947
  };
22675
- const tooltipContent = showTooltip ? /* @__PURE__ */ jsxRuntime.jsxs(chunkTTJGCJWX_cjs.EntityTooltip, { children: [
22948
+ const tooltipContent = showTooltip ? /* @__PURE__ */ jsxRuntime.jsxs(chunkH3XAHVDT_cjs.EntityTooltip, { children: [
22676
22949
  /* @__PURE__ */ jsxRuntime.jsx(
22677
- chunkTTJGCJWX_cjs.EntityTooltipHeader,
22950
+ chunkH3XAHVDT_cjs.EntityTooltipHeader,
22678
22951
  {
22679
22952
  lead: /* @__PURE__ */ jsxRuntime.jsx(
22680
22953
  "span",
@@ -24571,7 +24844,7 @@ function useDocumentFilters({
24571
24844
  [documentFilters]
24572
24845
  );
24573
24846
  const baseFilteredDocuments = React7.useMemo(
24574
- () => chunkFZVAJFRH_cjs.applyInvertedIndexFilter(documents, documentFilters, invertedIndex, getDocId),
24847
+ () => chunkRHKFCSFC_cjs.applyInvertedIndexFilter(documents, documentFilters, invertedIndex, getDocId),
24575
24848
  [documents, documentFilters, invertedIndex]
24576
24849
  );
24577
24850
  const filteredDocuments = React7.useMemo(() => {
@@ -25786,7 +26059,7 @@ function ConnectedFieldsManager({
25786
26059
  ) });
25787
26060
  }
25788
26061
  return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col h-full", children: [
25789
- /* @__PURE__ */ jsxRuntime.jsxs(chunkFZVAJFRH_cjs.DraggableHeader, { children: [
26062
+ /* @__PURE__ */ jsxRuntime.jsxs(chunkRHKFCSFC_cjs.DraggableHeader, { children: [
25790
26063
  /* @__PURE__ */ jsxRuntime.jsx(chunkEWWVKXEQ_cjs.FieldsManagerTitle, { title, className: "px-4 pt-3.5 pb-2" }),
25791
26064
  /* @__PURE__ */ jsxRuntime.jsx("div", { className: "px-3", children: tabHeader })
25792
26065
  ] }),
@@ -27244,7 +27517,7 @@ function ConnectedFilesPage({
27244
27517
  viewMode === "grid" ? (
27245
27518
  // ‹ n / N › over the table's displayed rows; a step opens the document.
27246
27519
  /* @__PURE__ */ jsxRuntime.jsx(
27247
- chunkTTJGCJWX_cjs.GridRowNavigator,
27520
+ chunkH3XAHVDT_cjs.GridRowNavigator,
27248
27521
  {
27249
27522
  gridApi,
27250
27523
  selectedId: viewingDocumentId ?? selectedDocumentIds[0] ?? null,
@@ -28323,7 +28596,7 @@ function ConnectedMessenger({
28323
28596
  }
28324
28597
  );
28325
28598
  if (!activeId && layout === "panel") {
28326
- return /* @__PURE__ */ jsxRuntime.jsxs(chunkFZVAJFRH_cjs.PanelFrame, { testId: "dm-messenger", children: [
28599
+ return /* @__PURE__ */ jsxRuntime.jsxs(chunkRHKFCSFC_cjs.PanelFrame, { testId: "dm-messenger", children: [
28327
28600
  list,
28328
28601
  peoplePicker
28329
28602
  ] });
@@ -28333,7 +28606,7 @@ function ConnectedMessenger({
28333
28606
  const presence = activePeer ? host.presenceOf?.(activePeer.external_id) : void 0;
28334
28607
  const threadName = active?.title ?? (activePeer ? react.userDisplayName(activePeer) : null);
28335
28608
  const thread = activeId ? /* @__PURE__ */ jsxRuntime.jsxs(
28336
- chunkFZVAJFRH_cjs.PanelFrame,
28609
+ chunkRHKFCSFC_cjs.PanelFrame,
28337
28610
  {
28338
28611
  testId: isSplit ? "dm-messenger-thread" : "dm-messenger",
28339
28612
  className: isSplit ? "min-w-0 flex-1 bg-card" : void 0,
@@ -28400,7 +28673,7 @@ function ConnectedMessenger({
28400
28673
  groupChat.external_id
28401
28674
  ) : null,
28402
28675
  peoplePicker,
28403
- /* @__PURE__ */ jsxRuntime.jsx(chunkFZVAJFRH_cjs.PanelFrameBody, { className: "flex flex-col overflow-visible", children: active ? /* @__PURE__ */ jsxRuntime.jsx(
28676
+ /* @__PURE__ */ jsxRuntime.jsx(chunkRHKFCSFC_cjs.PanelFrameBody, { className: "flex flex-col overflow-visible", children: active ? /* @__PURE__ */ jsxRuntime.jsx(
28404
28677
  ConnectedChatThread,
28405
28678
  {
28406
28679
  chat: active.chat,
@@ -29000,7 +29273,7 @@ function DeveloperFooter({
29000
29273
  }, [configVersions, configToLoad, parentMessage?.config_ext_id]);
29001
29274
  const hasLoadedConfig = !!loadedConfigId && loadedConfigId !== "default";
29002
29275
  return /* @__PURE__ */ jsxRuntime.jsx(
29003
- chunkFZVAJFRH_cjs.ConfigSwitcherBar,
29276
+ chunkRHKFCSFC_cjs.ConfigSwitcherBar,
29004
29277
  {
29005
29278
  options: options2,
29006
29279
  value: loadedConfigId || "default",
@@ -29269,8 +29542,8 @@ function ConnectedDeveloperConfig({ modeSwitcher } = {}) {
29269
29542
  handleDeleteConfig,
29270
29543
  handleLoadConfig
29271
29544
  } = useDeveloperConfig();
29272
- return /* @__PURE__ */ jsxRuntime.jsxs(chunkFZVAJFRH_cjs.PanelFrame, { testId: "developer-config", children: [
29273
- /* @__PURE__ */ jsxRuntime.jsx(chunkFZVAJFRH_cjs.DraggableHeader, { children: /* @__PURE__ */ jsxRuntime.jsx(
29545
+ return /* @__PURE__ */ jsxRuntime.jsxs(chunkRHKFCSFC_cjs.PanelFrame, { testId: "developer-config", children: [
29546
+ /* @__PURE__ */ jsxRuntime.jsx(chunkRHKFCSFC_cjs.DraggableHeader, { children: /* @__PURE__ */ jsxRuntime.jsx(
29274
29547
  chunkMEMWZ72Y_cjs.TabHeader,
29275
29548
  {
29276
29549
  tabs: [{ id: "config", label: "Developer Config", icon: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Code2, { className: "size-4" }) }],
@@ -29280,7 +29553,7 @@ function ConnectedDeveloperConfig({ modeSwitcher } = {}) {
29280
29553
  rightContent: modeSwitcher
29281
29554
  }
29282
29555
  ) }),
29283
- /* @__PURE__ */ jsxRuntime.jsx(chunkFZVAJFRH_cjs.PanelFrameBody, { className: "overflow-auto p-4", children: configSchema ? /* @__PURE__ */ jsxRuntime.jsx(
29556
+ /* @__PURE__ */ jsxRuntime.jsx(chunkRHKFCSFC_cjs.PanelFrameBody, { className: "overflow-auto p-4", children: configSchema ? /* @__PURE__ */ jsxRuntime.jsx(
29284
29557
  ConnectedConfigForm,
29285
29558
  {
29286
29559
  schema: configSchema,
@@ -29288,7 +29561,7 @@ function ConnectedDeveloperConfig({ modeSwitcher } = {}) {
29288
29561
  onChange: handleConfigChange,
29289
29562
  availableModels: availableModels?.models
29290
29563
  }
29291
- ) : /* @__PURE__ */ jsxRuntime.jsx(chunkFZVAJFRH_cjs.PanelNote, { children: "Loading configuration schema..." }) }),
29564
+ ) : /* @__PURE__ */ jsxRuntime.jsx(chunkRHKFCSFC_cjs.PanelNote, { children: "Loading configuration schema..." }) }),
29292
29565
  /* @__PURE__ */ jsxRuntime.jsx(
29293
29566
  DeveloperFooter,
29294
29567
  {
@@ -29732,9 +30005,9 @@ function ConnectedWorkspaceEntity({
29732
30005
  );
29733
30006
  const documentCount2 = (workspace.shared_document_count ?? 0) + (workspace.private_document_count ?? 0);
29734
30007
  const conversationCount = (workspace.shared_conversation_count ?? 0) + (workspace.private_conversation_count ?? 0);
29735
- const tooltipContent = /* @__PURE__ */ jsxRuntime.jsxs(chunkTTJGCJWX_cjs.EntityTooltip, { children: [
30008
+ const tooltipContent = /* @__PURE__ */ jsxRuntime.jsxs(chunkH3XAHVDT_cjs.EntityTooltip, { children: [
29736
30009
  /* @__PURE__ */ jsxRuntime.jsx(
29737
- chunkTTJGCJWX_cjs.EntityTooltipHeader,
30010
+ chunkH3XAHVDT_cjs.EntityTooltipHeader,
29738
30011
  {
29739
30012
  lead: /* @__PURE__ */ jsxRuntime.jsx(
29740
30013
  ui.ShieldIcon,
@@ -29751,7 +30024,7 @@ function ConnectedWorkspaceEntity({
29751
30024
  }
29752
30025
  ),
29753
30026
  /* @__PURE__ */ jsxRuntime.jsx(
29754
- chunkTTJGCJWX_cjs.EntityTooltipStats,
30027
+ chunkH3XAHVDT_cjs.EntityTooltipStats,
29755
30028
  {
29756
30029
  stats: [
29757
30030
  {
@@ -29775,11 +30048,11 @@ function ConnectedWorkspaceEntity({
29775
30048
  ]
29776
30049
  }
29777
30050
  ),
29778
- workspace.updated_at && /* @__PURE__ */ jsxRuntime.jsxs(chunkTTJGCJWX_cjs.EntityTooltipHint, { children: [
30051
+ workspace.updated_at && /* @__PURE__ */ jsxRuntime.jsxs(chunkH3XAHVDT_cjs.EntityTooltipHint, { children: [
29779
30052
  "Updated ",
29780
30053
  ui.formatFriendlyDate(workspace.updated_at)
29781
30054
  ] }),
29782
- interactive && variant !== "icon" && /* @__PURE__ */ jsxRuntime.jsxs(chunkTTJGCJWX_cjs.EntityTooltipHint, { icon: /* @__PURE__ */ jsxRuntime.jsx(ui.EntityIcon, { entityType: "WORKSPACE", className: "w-3 h-3" }), children: [
30055
+ interactive && variant !== "icon" && /* @__PURE__ */ jsxRuntime.jsxs(chunkH3XAHVDT_cjs.EntityTooltipHint, { icon: /* @__PURE__ */ jsxRuntime.jsx(ui.EntityIcon, { entityType: "WORKSPACE", className: "w-3 h-3" }), children: [
29783
30056
  "Click to open ",
29784
30057
  ui.getEntityLabel("WORKSPACE").toLowerCase(),
29785
30058
  " settings"
@@ -29847,7 +30120,7 @@ function ConnectedProjectEntity({
29847
30120
  subscription = "none",
29848
30121
  ...props
29849
30122
  }) {
29850
- const { stripeEnabled } = chunkF2BYURQZ_cjs.useBillingSupport();
30123
+ const { stripeEnabled } = chunkLYF47OXX_cjs.useBillingSupport();
29851
30124
  return /* @__PURE__ */ jsxRuntime.jsx(
29852
30125
  ui.ProjectEntity,
29853
30126
  {
@@ -30565,7 +30838,7 @@ function ConnectedThreadTaskBar({
30565
30838
  ) }),
30566
30839
  /* @__PURE__ */ jsxRuntime.jsxs(ui.DropdownMenuContent, { align: "end", children: [
30567
30840
  /* @__PURE__ */ jsxRuntime.jsx(
30568
- chunkTTJGCJWX_cjs.ThreadFollowMenuItem,
30841
+ chunkH3XAHVDT_cjs.ThreadFollowMenuItem,
30569
30842
  {
30570
30843
  following: follow.following,
30571
30844
  onFollowingChange: (on) => (
@@ -30616,7 +30889,7 @@ function ConnectedThreadTaskBar({
30616
30889
  ] }),
30617
30890
  error && /* @__PURE__ */ jsxRuntime.jsx("span", { role: "alert", className: "text-xs text-destructive", children: error }),
30618
30891
  /* @__PURE__ */ jsxRuntime.jsx(
30619
- chunkFZVAJFRH_cjs.RenameDialog,
30892
+ chunkRHKFCSFC_cjs.RenameDialog,
30620
30893
  {
30621
30894
  open: renameOpen,
30622
30895
  onClose: () => setRenameOpen(false),
@@ -32815,7 +33088,7 @@ function MessageDetailsModal({
32815
33088
  ]
32816
33089
  }
32817
33090
  ),
32818
- messageDetails && /* @__PURE__ */ jsxRuntime.jsx("div", { "data-testid": "message-details-content", children: /* @__PURE__ */ jsxRuntime.jsx(chunkFZVAJFRH_cjs.MessageJsonTree, { data: messageDetails, name: "message", defaultExpanded: true }) })
33091
+ messageDetails && /* @__PURE__ */ jsxRuntime.jsx("div", { "data-testid": "message-details-content", children: /* @__PURE__ */ jsxRuntime.jsx(chunkRHKFCSFC_cjs.MessageJsonTree, { data: messageDetails, name: "message", defaultExpanded: true }) })
32819
33092
  ] })
32820
33093
  ]
32821
33094
  }
@@ -35761,7 +36034,7 @@ function ConnectedForgotPassword({
35761
36034
  setError(null);
35762
36035
  } else {
35763
36036
  setError(
35764
- chunkK237IYOD_cjs.parseAuthError(err, {
36037
+ chunkBYJUI4AT_cjs.parseAuthError(err, {
35765
36038
  messageMap: { "Incorrect username or password": client.RECOVERY_KEY_ERRORS.AUTH_FAILED },
35766
36039
  defaultMessage: "Failed to authenticate with recovery key. Please check your email and try again."
35767
36040
  })
@@ -35786,7 +36059,7 @@ function ConnectedForgotPassword({
35786
36059
  await sso.signIn({ returnTo: "/recover" });
35787
36060
  };
35788
36061
  return /* @__PURE__ */ jsxRuntime.jsx(
35789
- chunkK237IYOD_cjs.AccountRecoveryDialog,
36062
+ chunkBYJUI4AT_cjs.AccountRecoveryDialog,
35790
36063
  {
35791
36064
  open,
35792
36065
  onClose: handleClose,
@@ -35812,7 +36085,7 @@ async function backUpOnSignup({
35812
36085
  saveRecoveryKey,
35813
36086
  auth0Sub
35814
36087
  }) {
35815
- await chunkK237IYOD_cjs.promptSaveCredential(email, password);
36088
+ await chunkBYJUI4AT_cjs.promptSaveCredential(email, password);
35816
36089
  if (!saveRecoveryKey) return;
35817
36090
  try {
35818
36091
  await react.downloadRecoveryFile({ signingPrivateKey, email, auth0Sub });
@@ -35821,15 +36094,74 @@ async function backUpOnSignup({
35821
36094
  }
35822
36095
  }
35823
36096
 
35824
- // src/connection/auth/useLoginActions.ts
36097
+ // src/connection/auth/sso-name.ts
36098
+ var clean = (value) => value?.trim() ?? "";
36099
+ function resolveSsoName(profile, preferred = {}, emailFallback) {
36100
+ const fullName = clean(profile.name);
36101
+ let given = clean(preferred.given_name) || clean(profile.given_name);
36102
+ let family = clean(preferred.family_name) || clean(profile.family_name);
36103
+ if (!given && fullName) {
36104
+ const surnameAtEnd = family && fullName.length > family.length && fullName.toLowerCase().endsWith(family.toLowerCase());
36105
+ given = surnameAtEnd ? fullName.slice(0, fullName.length - family.length).trim() : fullName.split(/\s+/)[0];
36106
+ }
36107
+ if (!family && given && fullName.toLowerCase().startsWith(given.toLowerCase())) {
36108
+ family = fullName.slice(given.length).trim();
36109
+ }
36110
+ if (!given && emailFallback) given = emailFallback.split("@")[0];
36111
+ return { given_name: given, family_name: family };
36112
+ }
36113
+
36114
+ // src/connection/auth/sso-sign-in.ts
36115
+ function ssoAccountStatus(arbi, token, user) {
36116
+ return arbi.sso.status({ token, email: user.email, picture: user.picture });
36117
+ }
36118
+ async function completeSsoSignIn(arbi, { token, user, status, password, saveRecoveryKey = true }) {
36119
+ const email = user.email;
36120
+ if (status.status === "new_user") {
36121
+ const { given_name: firstName2, family_name: lastName } = resolveSsoName(user, status, email);
36122
+ const { signingPrivateKey } = await arbi.sso.register({
36123
+ token,
36124
+ email,
36125
+ password,
36126
+ firstName: firstName2,
36127
+ lastName,
36128
+ picture: user.picture
36129
+ });
36130
+ await backUpOnSignup({
36131
+ email,
36132
+ password,
36133
+ signingPrivateKey,
36134
+ saveRecoveryKey,
36135
+ auth0Sub: user.sub
36136
+ });
36137
+ const login2 = await arbi.sso.login({
36138
+ token,
36139
+ email,
36140
+ password,
36141
+ profile: { ...resolveSsoName(user, status), picture: user.picture ?? null }
36142
+ });
36143
+ return { login: login2, registered: true, linked: false };
36144
+ }
36145
+ const linked = status.status === "local_exists";
36146
+ const signIn = linked ? arbi.sso.link : arbi.sso.login;
36147
+ const login = await signIn({ token, email, password });
36148
+ return { login: login ?? void 0, registered: false, linked };
36149
+ }
35825
36150
  var BAD_CREDENTIALS = "This username/password combination is not valid. Please double-check your credentials and try again.";
35826
36151
  function useLoginActions({
35827
36152
  formState,
35828
- formActions
36153
+ formActions,
36154
+ onError
35829
36155
  }) {
35830
36156
  const arbi = react.useArbi();
36157
+ const signInLayer = chunkIWT4QVQL_cjs.useOptionalConnection();
35831
36158
  const sso = useSsoSignIn();
35832
- const { notify: notify17 } = chunk2QQUGL2V_cjs.useBlocksEnvironment();
36159
+ const environment = chunk2QQUGL2V_cjs.useBlocksEnvironment();
36160
+ const environmentNotify = environment.notify;
36161
+ const notify17 = React7.useCallback(
36162
+ (...args) => args[1] === "error" && onError && typeof args[0] === "string" ? onError(args[0]) : environmentNotify(...args),
36163
+ [environmentNotify, onError]
36164
+ );
35833
36165
  const { passwordRules, onRegistered, onUnlockedOffline } = useAuthPages();
35834
36166
  const [isAuthenticating, setIsAuthenticating] = React7.useState(false);
35835
36167
  const [isRequestingCode, setIsRequestingCode] = React7.useState(false);
@@ -35837,7 +36169,7 @@ function useLoginActions({
35837
36169
  email,
35838
36170
  password,
35839
36171
  confirmPassword,
35840
- firstName,
36172
+ firstName: firstName2,
35841
36173
  lastName,
35842
36174
  verificationCode,
35843
36175
  cooldownSeconds
@@ -35889,14 +36221,16 @@ function useLoginActions({
35889
36221
  const handleLocalLogin = React7.useCallback(
35890
36222
  async (opts) => {
35891
36223
  arbi.session?.setSsoMode(false);
35892
- if (!password) {
36224
+ const loginEmail = opts?.credentials?.email ?? email;
36225
+ const loginPassword = opts?.credentials?.password ?? password;
36226
+ if (!loginPassword) {
35893
36227
  notify17("Please fill in all required fields.", "error");
35894
36228
  return;
35895
36229
  }
35896
- if (!validateEmailWithError(email)) return;
36230
+ if (!validateEmailWithError(loginEmail)) return;
35897
36231
  if (typeof navigator !== "undefined" && !navigator.onLine) {
35898
36232
  try {
35899
- await arbi.unlock(email, password);
36233
+ await arbi.unlock(loginEmail, loginPassword);
35900
36234
  onUnlockedOffline?.();
35901
36235
  } catch (err) {
35902
36236
  notify17(
@@ -35906,27 +36240,41 @@ function useLoginActions({
35906
36240
  }
35907
36241
  return;
35908
36242
  }
36243
+ if (signInLayer && !signInLayer.apiConfigured) {
36244
+ await signInLayer.login(loginEmail, loginPassword);
36245
+ return;
36246
+ }
35909
36247
  setIsAuthenticating(true);
35910
36248
  try {
35911
- const login = await arbi.login(email, password);
36249
+ const login = await arbi.login(loginEmail, loginPassword);
35912
36250
  if (opts?.isFreshRegistration) onRegistered?.(login);
36251
+ return login;
35913
36252
  } catch (error) {
35914
36253
  setIsAuthenticating(false);
35915
36254
  console.error("Login error:", error);
35916
36255
  notify17(
35917
- chunkK237IYOD_cjs.parseAuthError(error, {
36256
+ chunkBYJUI4AT_cjs.parseAuthError(error, {
35918
36257
  messageMap: { "Incorrect username or password": BAD_CREDENTIALS }
35919
36258
  }),
35920
36259
  "error"
35921
36260
  );
35922
36261
  }
35923
36262
  },
35924
- [arbi, email, password, validateEmailWithError, notify17, onRegistered, onUnlockedOffline]
36263
+ [
36264
+ arbi,
36265
+ signInLayer,
36266
+ email,
36267
+ password,
36268
+ validateEmailWithError,
36269
+ notify17,
36270
+ onRegistered,
36271
+ onUnlockedOffline
36272
+ ]
35925
36273
  );
35926
36274
  const handleRegister = React7.useCallback(
35927
36275
  async (saveRecoveryKey = true) => {
35928
36276
  arbi.session?.setSsoMode(false);
35929
- if (!password || !confirmPassword || !firstName || !lastName || !verificationCode) {
36277
+ if (!password || !confirmPassword || !firstName2 || !lastName || !verificationCode) {
35930
36278
  notify17("Please fill in all required fields.", "error");
35931
36279
  return;
35932
36280
  }
@@ -35946,7 +36294,7 @@ function useLoginActions({
35946
36294
  email,
35947
36295
  password,
35948
36296
  verificationCode: verificationCode.trim(),
35949
- firstName,
36297
+ firstName: firstName2,
35950
36298
  lastName
35951
36299
  });
35952
36300
  await backUpOnSignup({ email, password, signingPrivateKey, saveRecoveryKey });
@@ -35954,7 +36302,7 @@ function useLoginActions({
35954
36302
  } catch (error) {
35955
36303
  setIsAuthenticating(false);
35956
36304
  console.error("Registration error:", error);
35957
- notify17(chunkK237IYOD_cjs.parseAuthError(error), "error");
36305
+ notify17(chunkBYJUI4AT_cjs.parseAuthError(error), "error");
35958
36306
  }
35959
36307
  },
35960
36308
  [
@@ -35962,7 +36310,7 @@ function useLoginActions({
35962
36310
  email,
35963
36311
  password,
35964
36312
  confirmPassword,
35965
- firstName,
36313
+ firstName2,
35966
36314
  lastName,
35967
36315
  verificationCode,
35968
36316
  validateEmailWithError,
@@ -35986,7 +36334,7 @@ function useLoginForm() {
35986
36334
  const [email, setEmail] = React7.useState("");
35987
36335
  const [password, setPassword] = React7.useState("");
35988
36336
  const [confirmPassword, setConfirmPassword] = React7.useState("");
35989
- const [firstName, setFirstName] = React7.useState("");
36337
+ const [firstName2, setFirstName] = React7.useState("");
35990
36338
  const [lastName, setLastName] = React7.useState("");
35991
36339
  const [verificationCode, setVerificationCode] = React7.useState("");
35992
36340
  const [verificationSent, setVerificationSent] = React7.useState(false);
@@ -36012,7 +36360,7 @@ function useLoginForm() {
36012
36360
  };
36013
36361
  }, []);
36014
36362
  React7.useEffect(() => {
36015
- const { params: hashParams, trailingFragment } = chunkK237IYOD_cjs.splitAuthHash(window.location.hash);
36363
+ const { params: hashParams, trailingFragment } = chunkBYJUI4AT_cjs.splitAuthHash(window.location.hash);
36016
36364
  const errorParam = hashParams.get("error");
36017
36365
  const errorDescriptionParam = hashParams.get("error_description");
36018
36366
  const emailParam = hashParams.get("verify");
@@ -36027,7 +36375,7 @@ function useLoginForm() {
36027
36375
  }
36028
36376
  const nextParam = hashParams.get("next");
36029
36377
  if (nextParam) {
36030
- onReturnPath?.(chunkK237IYOD_cjs.withTrailingFragment(decodeURIComponent(nextParam), trailingFragment));
36378
+ onReturnPath?.(chunkBYJUI4AT_cjs.withTrailingFragment(decodeURIComponent(nextParam), trailingFragment));
36031
36379
  }
36032
36380
  if (emailParam) {
36033
36381
  setIsRegistering(true);
@@ -36122,7 +36470,7 @@ function useLoginForm() {
36122
36470
  email,
36123
36471
  password,
36124
36472
  confirmPassword,
36125
- firstName,
36473
+ firstName: firstName2,
36126
36474
  lastName,
36127
36475
  verificationCode,
36128
36476
  verificationSent,
@@ -36158,36 +36506,242 @@ function useLoginForm() {
36158
36506
  };
36159
36507
  return { ...state, ...actions };
36160
36508
  }
36161
- function useRegisterSubmitState(isRegistering, isPending, password, confirmPassword, email, firstName, lastName, verificationCode, isPasswordValid) {
36509
+ function useRegisterSubmitState(isRegistering, isPending, password, confirmPassword, email, firstName2, lastName, verificationCode, isPasswordValid) {
36162
36510
  const isDisabled = React7.useMemo(() => {
36163
36511
  if (!isRegistering) return false;
36164
- return isPending || !isPasswordValid(password) || password !== confirmPassword || !email || !firstName || !lastName || !verificationCode;
36512
+ return isPending || !isPasswordValid(password) || password !== confirmPassword || !email || !firstName2 || !lastName || !verificationCode;
36165
36513
  }, [
36166
36514
  isRegistering,
36167
36515
  isPending,
36168
36516
  password,
36169
36517
  confirmPassword,
36170
36518
  email,
36171
- firstName,
36519
+ firstName2,
36172
36520
  lastName,
36173
36521
  verificationCode,
36174
36522
  isPasswordValid
36175
36523
  ]);
36176
36524
  const isDefault = React7.useMemo(() => {
36177
36525
  if (!isRegistering) return false;
36178
- return email && password && confirmPassword && firstName && lastName && verificationCode && isPasswordValid(password) && password === confirmPassword;
36526
+ return email && password && confirmPassword && firstName2 && lastName && verificationCode && isPasswordValid(password) && password === confirmPassword;
36179
36527
  }, [
36180
36528
  isRegistering,
36181
36529
  email,
36182
36530
  password,
36183
36531
  confirmPassword,
36184
- firstName,
36532
+ firstName2,
36185
36533
  lastName,
36186
36534
  verificationCode,
36187
36535
  isPasswordValid
36188
36536
  ]);
36189
36537
  return { isDisabled, isDefault };
36190
36538
  }
36539
+ var firstName = (user, fallback) => user?.given_name || fallback.split("@")[0];
36540
+ function CompactLogin({
36541
+ onSsoSignIn,
36542
+ onSignedIn,
36543
+ appName = "ARBI",
36544
+ ssoName = appName
36545
+ }) {
36546
+ const arbi = react.useArbi();
36547
+ const auth = useAuthPages();
36548
+ const { notify: notify17 } = chunk2QQUGL2V_cjs.useBlocksEnvironment();
36549
+ const isSsoOnly = !!auth.ssoOnly;
36550
+ const [error, setError] = React7.useState(null);
36551
+ const formState = useLoginForm();
36552
+ const { email, password, setEmail, setPassword } = formState;
36553
+ const { isAuthenticating, handleLocalLogin } = useLoginActions({
36554
+ formState,
36555
+ formActions: formState,
36556
+ onError: setError
36557
+ });
36558
+ const [sso, setSso] = React7.useState(null);
36559
+ const [masterPassword, setMasterPassword] = React7.useState("");
36560
+ const signInLocally = async (e) => {
36561
+ e.preventDefault();
36562
+ setError(null);
36563
+ const login = await handleLocalLogin();
36564
+ if (login) onSignedIn?.(firstName(login.response?.user, email));
36565
+ };
36566
+ const finishSso = async () => {
36567
+ if (!sso?.user.email) {
36568
+ setError("User email not available");
36569
+ return;
36570
+ }
36571
+ try {
36572
+ const status = await ssoAccountStatus(arbi, sso.accessToken, sso.user);
36573
+ const { login } = await completeSsoSignIn(arbi, {
36574
+ token: sso.accessToken,
36575
+ user: sso.user,
36576
+ status,
36577
+ password: masterPassword
36578
+ });
36579
+ const name = login?.response?.user.given_name ?? sso.user.given_name ?? sso.user.name;
36580
+ setError(null);
36581
+ setSso(null);
36582
+ setMasterPassword("");
36583
+ const shown = name ?? sso.user.email.split("@")[0];
36584
+ notify17(`Welcome, ${shown}!`, "success");
36585
+ onSignedIn?.(shown);
36586
+ } catch (err) {
36587
+ console.error("[SSO] Error during authentication:", err);
36588
+ setError(chunkBYJUI4AT_cjs.parseAuthError(err, { defaultMessage: "Authentication failed. Please try again." }));
36589
+ }
36590
+ };
36591
+ const startSso = async () => {
36592
+ if (!onSsoSignIn) return;
36593
+ try {
36594
+ const result = await onSsoSignIn();
36595
+ if (result) setSso(result);
36596
+ } catch (err) {
36597
+ setError(err instanceof Error ? err.message : "Authentication failed. Please try again.");
36598
+ }
36599
+ };
36600
+ const cancelSso = () => {
36601
+ setSso(null);
36602
+ setMasterPassword("");
36603
+ setError(null);
36604
+ };
36605
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-4", "data-testid": "embedded-auth", children: [
36606
+ error && /* @__PURE__ */ jsxRuntime.jsx(
36607
+ "div",
36608
+ {
36609
+ className: "bg-destructive/10 text-destructive p-3 rounded-md",
36610
+ "data-testid": "embedded-auth-error",
36611
+ children: /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm", children: error })
36612
+ }
36613
+ ),
36614
+ sso ? /* @__PURE__ */ jsxRuntime.jsxs(
36615
+ "form",
36616
+ {
36617
+ onSubmit: (e) => {
36618
+ e.preventDefault();
36619
+ if (masterPassword) void finishSso();
36620
+ },
36621
+ className: "space-y-3",
36622
+ children: [
36623
+ /* @__PURE__ */ jsxRuntime.jsxs("p", { className: "text-sm text-muted-foreground", children: [
36624
+ "Enter your ",
36625
+ appName,
36626
+ " ",
36627
+ /* @__PURE__ */ jsxRuntime.jsx("strong", { children: "master password" }),
36628
+ " \u2014 the encryption passphrase you set when you first registered, not your ",
36629
+ ssoName,
36630
+ " sign-in password."
36631
+ ] }),
36632
+ /* @__PURE__ */ jsxRuntime.jsx(
36633
+ ui.Input,
36634
+ {
36635
+ type: "password",
36636
+ placeholder: "Enter master password",
36637
+ value: masterPassword,
36638
+ onChange: (e) => setMasterPassword(e.target.value),
36639
+ autoFocus: true,
36640
+ "data-testid": "embedded-auth-password-input"
36641
+ }
36642
+ ),
36643
+ /* @__PURE__ */ jsxRuntime.jsx(
36644
+ ui.Button,
36645
+ {
36646
+ type: "submit",
36647
+ className: "w-full",
36648
+ disabled: !masterPassword,
36649
+ "data-testid": "embedded-auth-continue-button",
36650
+ children: "Continue"
36651
+ }
36652
+ ),
36653
+ /* @__PURE__ */ jsxRuntime.jsx(
36654
+ ui.Button,
36655
+ {
36656
+ type: "button",
36657
+ variant: "outline",
36658
+ className: "w-full",
36659
+ onClick: cancelSso,
36660
+ "data-testid": "embedded-auth-cancel-button",
36661
+ children: "Cancel"
36662
+ }
36663
+ )
36664
+ ]
36665
+ }
36666
+ ) : isSsoOnly ? /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
36667
+ /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm text-muted-foreground", children: "Please sign in with your organization account." }),
36668
+ /* @__PURE__ */ jsxRuntime.jsxs(
36669
+ ui.Button,
36670
+ {
36671
+ onClick: () => void startSso(),
36672
+ className: "w-full",
36673
+ "data-testid": "embedded-auth-sso-button",
36674
+ children: [
36675
+ /* @__PURE__ */ jsxRuntime.jsx(lucideReact.LogIn, { className: "mr-2 h-4 w-4" }),
36676
+ "Sign in with ",
36677
+ ssoName
36678
+ ]
36679
+ }
36680
+ )
36681
+ ] }) : /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
36682
+ /* @__PURE__ */ jsxRuntime.jsxs("form", { onSubmit: (e) => void signInLocally(e), className: "space-y-3", children: [
36683
+ /* @__PURE__ */ jsxRuntime.jsx(
36684
+ ui.Input,
36685
+ {
36686
+ type: "email",
36687
+ placeholder: "Email",
36688
+ value: email,
36689
+ onChange: (e) => setEmail(e.target.value),
36690
+ required: true,
36691
+ disabled: isAuthenticating,
36692
+ "data-testid": "embedded-auth-email-input"
36693
+ }
36694
+ ),
36695
+ /* @__PURE__ */ jsxRuntime.jsx(
36696
+ ui.Input,
36697
+ {
36698
+ type: "password",
36699
+ placeholder: "Password",
36700
+ value: password,
36701
+ onChange: (e) => setPassword(e.target.value),
36702
+ required: true,
36703
+ disabled: isAuthenticating,
36704
+ "data-testid": "embedded-auth-password-input"
36705
+ }
36706
+ ),
36707
+ /* @__PURE__ */ jsxRuntime.jsx(
36708
+ ui.Button,
36709
+ {
36710
+ type: "submit",
36711
+ className: "w-full",
36712
+ disabled: isAuthenticating,
36713
+ "data-testid": "embedded-auth-signin-button",
36714
+ children: isAuthenticating ? /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
36715
+ /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Loader2, { className: "mr-2 h-4 w-4 animate-spin" }),
36716
+ "Signing in..."
36717
+ ] }) : "Sign In"
36718
+ }
36719
+ )
36720
+ ] }),
36721
+ onSsoSignIn && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
36722
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "relative", children: [
36723
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "absolute inset-0 flex items-center", children: /* @__PURE__ */ jsxRuntime.jsx("span", { className: "w-full border-t" }) }),
36724
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "relative flex justify-center text-sm uppercase", children: /* @__PURE__ */ jsxRuntime.jsx("span", { className: "bg-background px-2 text-muted-foreground", children: "Or" }) })
36725
+ ] }),
36726
+ /* @__PURE__ */ jsxRuntime.jsxs(
36727
+ ui.Button,
36728
+ {
36729
+ onClick: () => void startSso(),
36730
+ className: "w-full",
36731
+ variant: "outline",
36732
+ "data-testid": "embedded-auth-sso-option-button",
36733
+ children: [
36734
+ /* @__PURE__ */ jsxRuntime.jsx(lucideReact.LogIn, { className: "mr-2 h-4 w-4" }),
36735
+ "Sign in with ",
36736
+ ssoName,
36737
+ " (SSO)"
36738
+ ]
36739
+ }
36740
+ )
36741
+ ] })
36742
+ ] })
36743
+ ] });
36744
+ }
36191
36745
  function useSsoVerificationRedirect() {
36192
36746
  const sso = useSsoSignIn();
36193
36747
  const { notify: notify17 } = chunk2QQUGL2V_cjs.useBlocksEnvironment();
@@ -36225,11 +36779,18 @@ function warmSodium() {
36225
36779
  if (typeof window.requestIdleCallback === "function") window.requestIdleCallback(run);
36226
36780
  else window.setTimeout(run, 200);
36227
36781
  }
36228
- function ConnectedLoginPage() {
36782
+ function ConnectedLoginPage({
36783
+ layout = "page",
36784
+ ...compact
36785
+ } = {}) {
36786
+ return layout === "compact" ? /* @__PURE__ */ jsxRuntime.jsx(CompactLogin, { ...compact }) : /* @__PURE__ */ jsxRuntime.jsx(LoginPage, {});
36787
+ }
36788
+ function LoginPage() {
36229
36789
  const sso = useSsoSignIn();
36230
36790
  const auth = useAuthPages();
36231
36791
  const { notify: notify17 } = chunk2QQUGL2V_cjs.useBlocksEnvironment();
36232
36792
  const isSsoOnly = !!auth.ssoOnly;
36793
+ const allowRegistration = auth.allowRegistration ?? true;
36233
36794
  const isOnline = documentTools.useIsOnline();
36234
36795
  const passwordRules = auth.passwordRules;
36235
36796
  useSsoVerificationRedirect();
@@ -36239,7 +36800,7 @@ function ConnectedLoginPage() {
36239
36800
  email,
36240
36801
  password,
36241
36802
  confirmPassword,
36242
- firstName,
36803
+ firstName: firstName2,
36243
36804
  lastName,
36244
36805
  verificationCode,
36245
36806
  verificationSent,
@@ -36280,7 +36841,7 @@ function ConnectedLoginPage() {
36280
36841
  password,
36281
36842
  confirmPassword,
36282
36843
  email,
36283
- firstName,
36844
+ firstName2,
36284
36845
  lastName,
36285
36846
  verificationCode,
36286
36847
  passwordRules.isValid
@@ -36290,13 +36851,21 @@ function ConnectedLoginPage() {
36290
36851
  auth.onIntent?.();
36291
36852
  };
36292
36853
  React7.useEffect(() => {
36293
- if (!isOnline) setIsRegistering(false);
36294
- }, [isOnline, setIsRegistering]);
36854
+ if (!isOnline || !allowRegistration) setIsRegistering(false);
36855
+ }, [isOnline, allowRegistration, setIsRegistering]);
36856
+ chunkBYJUI4AT_cjs.useFragmentCredentials({
36857
+ enabled: !!auth.fragmentSignIn,
36858
+ onCredentials: ({ email: linkEmail, password: linkPassword, next }) => {
36859
+ setEmail(linkEmail);
36860
+ if (next) auth.onReturnPath?.(next);
36861
+ void handleLocalLogin({ credentials: { email: linkEmail, password: linkPassword } });
36862
+ }
36863
+ });
36295
36864
  const autoRequestFiredRef = React7.useRef(false);
36296
36865
  const emailInputRef = React7.useRef(null);
36297
36866
  React7.useEffect(() => {
36298
36867
  if (!pendingAutoRequest || autoRequestFiredRef.current) return;
36299
- if (isSsoOnly || !isOnline) return;
36868
+ if (isSsoOnly || !isOnline || !allowRegistration) return;
36300
36869
  autoRequestFiredRef.current = true;
36301
36870
  setPendingAutoRequest(false);
36302
36871
  void handleRequestVerificationCode();
@@ -36304,6 +36873,7 @@ function ConnectedLoginPage() {
36304
36873
  pendingAutoRequest,
36305
36874
  isSsoOnly,
36306
36875
  isOnline,
36876
+ allowRegistration,
36307
36877
  setPendingAutoRequest,
36308
36878
  handleRequestVerificationCode
36309
36879
  ]);
@@ -36373,9 +36943,9 @@ function ConnectedLoginPage() {
36373
36943
  handleLocalLogin();
36374
36944
  }
36375
36945
  };
36376
- const offlineIndicator = /* @__PURE__ */ jsxRuntime.jsx(chunkK237IYOD_cjs.AuthOfflineBadge, { title: "No connection \u2014 sign in to unlock your offline files on this device" });
36946
+ const offlineIndicator = /* @__PURE__ */ jsxRuntime.jsx(chunkBYJUI4AT_cjs.AuthOfflineBadge, { title: "No connection \u2014 sign in to unlock your offline files on this device" });
36377
36947
  const loginRegisterToggle = /* @__PURE__ */ jsxRuntime.jsx(
36378
- chunkK237IYOD_cjs.AuthTabs,
36948
+ chunkBYJUI4AT_cjs.AuthTabs,
36379
36949
  {
36380
36950
  ariaLabel: "Login or register",
36381
36951
  value: isRegistering ? "register" : "login",
@@ -36389,16 +36959,22 @@ function ConnectedLoginPage() {
36389
36959
  const aside = isSsoOnly ? void 0 : auth.aside;
36390
36960
  const isStepTwo = isRegistering && verificationSent && showVerificationForm;
36391
36961
  return /* @__PURE__ */ jsxRuntime.jsxs(
36392
- chunkK237IYOD_cjs.AuthLayout,
36962
+ chunkBYJUI4AT_cjs.AuthLayout,
36393
36963
  {
36394
36964
  brand: auth.brand,
36395
36965
  corner: auth.corner,
36396
- headerRight: !isSsoOnly ? isOnline ? loginRegisterToggle : offlineIndicator : void 0,
36966
+ headerRight: isSsoOnly ? void 0 : !isOnline ? offlineIndicator : allowRegistration ? loginRegisterToggle : void 0,
36397
36967
  aside,
36398
36968
  children: [
36399
36969
  auth.banner,
36400
36970
  !isSsoOnly && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
36401
- /* @__PURE__ */ jsxRuntime.jsx(chunkK237IYOD_cjs.AuthHeading, { title: isRegistering ? "Create your account" : "Welcome back" }),
36971
+ /* @__PURE__ */ jsxRuntime.jsx(
36972
+ chunkBYJUI4AT_cjs.AuthHeading,
36973
+ {
36974
+ title: isRegistering ? "Create your account" : auth.heading?.title ?? "Welcome back",
36975
+ description: isRegistering ? void 0 : auth.heading?.description
36976
+ }
36977
+ ),
36402
36978
  /* @__PURE__ */ jsxRuntime.jsxs("div", { "data-testid": "login-form-container", children: [
36403
36979
  /* @__PURE__ */ jsxRuntime.jsxs(
36404
36980
  "form",
@@ -36410,17 +36986,17 @@ function ConnectedLoginPage() {
36410
36986
  "aria-busy": isAuthenticating,
36411
36987
  children: [
36412
36988
  /* @__PURE__ */ jsxRuntime.jsx(
36413
- chunkK237IYOD_cjs.AuthField,
36989
+ chunkBYJUI4AT_cjs.AuthField,
36414
36990
  {
36415
36991
  htmlFor: "email",
36416
- label: "Email",
36992
+ label: isRegistering ? "Email" : auth.emailLabel ?? "Email",
36417
36993
  required: true,
36418
- labelAction: isRegistering && verificationSent ? /* @__PURE__ */ jsxRuntime.jsx(chunkK237IYOD_cjs.AuthLink, { onClick: clearForm, "data-testid": "clear-button", children: "Clear form" }) : void 0,
36994
+ labelAction: isRegistering && verificationSent ? /* @__PURE__ */ jsxRuntime.jsx(chunkBYJUI4AT_cjs.AuthLink, { onClick: clearForm, "data-testid": "clear-button", children: "Clear form" }) : void 0,
36419
36995
  trailing: (
36420
36996
  // Shown once the address is locked in with a code in hand — i.e. the emailed
36421
36997
  // link, or a code typed in. The server checks the code when the account is made.
36422
36998
  showVerifiedBadge ? /* @__PURE__ */ jsxRuntime.jsx(
36423
- chunkK237IYOD_cjs.AuthFieldBadge,
36999
+ chunkBYJUI4AT_cjs.AuthFieldBadge,
36424
37000
  {
36425
37001
  testId: "email-verified-badge",
36426
37002
  icon: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.BadgeCheck, { className: "h-4 w-4", "aria-hidden": "true" }),
@@ -36429,7 +37005,7 @@ function ConnectedLoginPage() {
36429
37005
  ) : void 0
36430
37006
  ),
36431
37007
  children: /* @__PURE__ */ jsxRuntime.jsx(
36432
- chunkK237IYOD_cjs.AuthInput,
37008
+ chunkBYJUI4AT_cjs.AuthInput,
36433
37009
  {
36434
37010
  ref: emailInputRef,
36435
37011
  type: "email",
@@ -36461,7 +37037,7 @@ function ConnectedLoginPage() {
36461
37037
  }
36462
37038
  ),
36463
37039
  /* @__PURE__ */ jsxRuntime.jsx(
36464
- chunkK237IYOD_cjs.AuthLink,
37040
+ chunkBYJUI4AT_cjs.AuthLink,
36465
37041
  {
36466
37042
  onClick: () => {
36467
37043
  if (!email) {
@@ -36483,9 +37059,9 @@ function ConnectedLoginPage() {
36483
37059
  )
36484
37060
  ] }),
36485
37061
  isRegistering && verificationSent && !showVerificationForm && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-2 pt-1", "data-testid": "verification-sent-notice", children: [
36486
- /* @__PURE__ */ jsxRuntime.jsx(chunkK237IYOD_cjs.AuthNote, { children: "We've sent a link to your email \u2014 click it to continue." }),
37062
+ /* @__PURE__ */ jsxRuntime.jsx(chunkBYJUI4AT_cjs.AuthNote, { children: "We've sent a link to your email \u2014 click it to continue." }),
36487
37063
  /* @__PURE__ */ jsxRuntime.jsx(
36488
- chunkK237IYOD_cjs.AuthLink,
37064
+ chunkBYJUI4AT_cjs.AuthLink,
36489
37065
  {
36490
37066
  onClick: () => setShowVerificationForm(true),
36491
37067
  className: "w-full text-center",
@@ -36495,8 +37071,8 @@ function ConnectedLoginPage() {
36495
37071
  )
36496
37072
  ] }),
36497
37073
  isStepTwo && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
36498
- !showVerifiedBadge && /* @__PURE__ */ jsxRuntime.jsx(chunkK237IYOD_cjs.AuthField, { htmlFor: "verificationCode", label: "Verification Code", required: true, children: /* @__PURE__ */ jsxRuntime.jsx(
36499
- chunkK237IYOD_cjs.AuthInput,
37074
+ !showVerifiedBadge && /* @__PURE__ */ jsxRuntime.jsx(chunkBYJUI4AT_cjs.AuthField, { htmlFor: "verificationCode", label: "Verification Code", required: true, children: /* @__PURE__ */ jsxRuntime.jsx(
37075
+ chunkBYJUI4AT_cjs.AuthInput,
36500
37076
  {
36501
37077
  type: "text",
36502
37078
  placeholder: "THREE-WORD-CODE",
@@ -36514,12 +37090,12 @@ function ConnectedLoginPage() {
36514
37090
  }
36515
37091
  ) }),
36516
37092
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "grid grid-cols-1 gap-4 sm:grid-cols-2", children: [
36517
- /* @__PURE__ */ jsxRuntime.jsx(chunkK237IYOD_cjs.AuthField, { htmlFor: "firstName", label: "First Name", required: true, children: /* @__PURE__ */ jsxRuntime.jsx(
36518
- chunkK237IYOD_cjs.AuthInput,
37093
+ /* @__PURE__ */ jsxRuntime.jsx(chunkBYJUI4AT_cjs.AuthField, { htmlFor: "firstName", label: "First Name", required: true, children: /* @__PURE__ */ jsxRuntime.jsx(
37094
+ chunkBYJUI4AT_cjs.AuthInput,
36519
37095
  {
36520
37096
  type: "text",
36521
37097
  placeholder: "",
36522
- value: firstName,
37098
+ value: firstName2,
36523
37099
  onChange: (e) => setFirstName(e.target.value),
36524
37100
  "data-testid": "firstname-input",
36525
37101
  name: "firstName",
@@ -36528,8 +37104,8 @@ function ConnectedLoginPage() {
36528
37104
  required: true
36529
37105
  }
36530
37106
  ) }),
36531
- /* @__PURE__ */ jsxRuntime.jsx(chunkK237IYOD_cjs.AuthField, { htmlFor: "lastName", label: "Last Name", required: true, children: /* @__PURE__ */ jsxRuntime.jsx(
36532
- chunkK237IYOD_cjs.AuthInput,
37107
+ /* @__PURE__ */ jsxRuntime.jsx(chunkBYJUI4AT_cjs.AuthField, { htmlFor: "lastName", label: "Last Name", required: true, children: /* @__PURE__ */ jsxRuntime.jsx(
37108
+ chunkBYJUI4AT_cjs.AuthInput,
36533
37109
  {
36534
37110
  type: "text",
36535
37111
  placeholder: "",
@@ -36559,9 +37135,9 @@ function ConnectedLoginPage() {
36559
37135
  }
36560
37136
  )
36561
37137
  ] }),
36562
- !isRegistering && /* @__PURE__ */ jsxRuntime.jsxs(chunkK237IYOD_cjs.AuthField, { htmlFor: "password", label: "Password", required: true, children: [
37138
+ !isRegistering && /* @__PURE__ */ jsxRuntime.jsxs(chunkBYJUI4AT_cjs.AuthField, { htmlFor: "password", label: "Password", required: true, children: [
36563
37139
  /* @__PURE__ */ jsxRuntime.jsx(
36564
- chunkK237IYOD_cjs.RevealablePasswordInput,
37140
+ chunkBYJUI4AT_cjs.RevealablePasswordInput,
36565
37141
  {
36566
37142
  isRevealed: showPassword,
36567
37143
  onToggleReveal: () => setShowPassword((v) => !v),
@@ -36580,7 +37156,7 @@ function ConnectedLoginPage() {
36580
37156
  }
36581
37157
  ),
36582
37158
  /* @__PURE__ */ jsxRuntime.jsx(
36583
- chunkK237IYOD_cjs.AuthLink,
37159
+ chunkBYJUI4AT_cjs.AuthLink,
36584
37160
  {
36585
37161
  onClick: () => setShowForgotPasswordModal(true),
36586
37162
  className: "mt-2",
@@ -36590,7 +37166,7 @@ function ConnectedLoginPage() {
36590
37166
  )
36591
37167
  ] }),
36592
37168
  isStepTwo && /* @__PURE__ */ jsxRuntime.jsx(
36593
- chunkK237IYOD_cjs.AuthConsent,
37169
+ chunkBYJUI4AT_cjs.AuthConsent,
36594
37170
  {
36595
37171
  termsAccepted,
36596
37172
  onTermsAcceptedChange: setTermsAccepted,
@@ -36602,7 +37178,7 @@ function ConnectedLoginPage() {
36602
37178
  }
36603
37179
  ),
36604
37180
  (!isRegistering || isStepTwo) && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "space-y-3 pt-1", children: /* @__PURE__ */ jsxRuntime.jsx(
36605
- chunkK237IYOD_cjs.AuthSubmitButton,
37181
+ chunkBYJUI4AT_cjs.AuthSubmitButton,
36606
37182
  {
36607
37183
  isBusy: isAuthenticating,
36608
37184
  disabled: isAuthenticating || isRegistering && isRegisterSubmitDisabled,
@@ -36613,7 +37189,7 @@ function ConnectedLoginPage() {
36613
37189
  }
36614
37190
  ),
36615
37191
  (!isRegistering || !verificationSent) && sso.available && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "mt-6 space-y-4", children: [
36616
- /* @__PURE__ */ jsxRuntime.jsx(chunkK237IYOD_cjs.AuthDivider, { label: "or continue with" }),
37192
+ /* @__PURE__ */ jsxRuntime.jsx(chunkBYJUI4AT_cjs.AuthDivider, { label: "or continue with" }),
36617
37193
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "grid grid-cols-3 gap-2", children: [
36618
37194
  /* @__PURE__ */ jsxRuntime.jsxs(
36619
37195
  ui.Button,
@@ -36670,7 +37246,7 @@ function ConnectedLoginPage() {
36670
37246
  ] })
36671
37247
  ] })
36672
37248
  ] }),
36673
- !isRegistering && sso.available && /* @__PURE__ */ jsxRuntime.jsx(chunkK237IYOD_cjs.AuthLink, { onClick: () => handleSsoLogin(), "data-testid": "login-with-arbi-button", children: "Continue with Arbicity" }),
37249
+ !isRegistering && sso.available && /* @__PURE__ */ jsxRuntime.jsx(chunkBYJUI4AT_cjs.AuthLink, { onClick: () => handleSsoLogin(), "data-testid": "login-with-arbi-button", children: "Continue with Arbicity" }),
36674
37250
  !isRegistering && auth.footer,
36675
37251
  /* @__PURE__ */ jsxRuntime.jsx(
36676
37252
  ConnectedForgotPassword,
@@ -36698,6 +37274,46 @@ function ConnectedLoginPage() {
36698
37274
  }
36699
37275
  );
36700
37276
  }
37277
+
37278
+ // src/connection/auth/sso-popup.ts
37279
+ function openSsoPopup(url, { features = "width=600,height=700" } = {}) {
37280
+ return new Promise((resolve, reject) => {
37281
+ const opened = window.open(url, "auth", features);
37282
+ if (!opened) {
37283
+ resolve(null);
37284
+ return;
37285
+ }
37286
+ const popup = opened;
37287
+ const closedPoll = setInterval(() => {
37288
+ if (popup.closed) {
37289
+ done();
37290
+ resolve(null);
37291
+ }
37292
+ }, 500);
37293
+ const done = () => {
37294
+ window.removeEventListener("message", onMessage);
37295
+ clearInterval(closedPoll);
37296
+ };
37297
+ function onMessage(event) {
37298
+ if (event.origin !== window.location.origin) return;
37299
+ const data = event.data;
37300
+ if (data?.error) {
37301
+ done();
37302
+ reject(new Error(data.error));
37303
+ return;
37304
+ }
37305
+ if (!data?.accessToken) return;
37306
+ done();
37307
+ if (!popup.closed) popup.close();
37308
+ if (!data.user) {
37309
+ reject(new Error("Invalid authentication response"));
37310
+ return;
37311
+ }
37312
+ resolve({ accessToken: data.accessToken, user: data.user });
37313
+ }
37314
+ window.addEventListener("message", onMessage);
37315
+ });
37316
+ }
36701
37317
  var MAX_RESEND_WARNING_THRESHOLD = 3;
36702
37318
  var MAX_RESEND_BLOCK_THRESHOLD = 6;
36703
37319
  var RATE_LIMIT_COOLDOWN_MS = 6e4;
@@ -36762,7 +37378,7 @@ function SsoResendVerificationButton({
36762
37378
  onClick: async () => handleResendEmailVerification(),
36763
37379
  disabled: loading || disabled,
36764
37380
  "aria-label": "Resend verification email",
36765
- children: loading ? /* @__PURE__ */ jsxRuntime.jsx(chunkTTJGCJWX_cjs.LoadingIndicator, {}) : /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
37381
+ children: loading ? /* @__PURE__ */ jsxRuntime.jsx(chunkH3XAHVDT_cjs.LoadingIndicator, {}) : /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
36766
37382
  "Didn't get a verification email? ",
36767
37383
  /* @__PURE__ */ jsxRuntime.jsx("span", { className: "font-semibold", children: "Resend" })
36768
37384
  ] })
@@ -36771,23 +37387,6 @@ function SsoResendVerificationButton({
36771
37387
  }
36772
37388
  ) : /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, {});
36773
37389
  }
36774
-
36775
- // src/connection/auth/sso-name.ts
36776
- var clean = (value) => value?.trim() ?? "";
36777
- function resolveSsoName(profile, preferred = {}, emailFallback) {
36778
- const fullName = clean(profile.name);
36779
- let given = clean(preferred.given_name) || clean(profile.given_name);
36780
- let family = clean(preferred.family_name) || clean(profile.family_name);
36781
- if (!given && fullName) {
36782
- const surnameAtEnd = family && fullName.length > family.length && fullName.toLowerCase().endsWith(family.toLowerCase());
36783
- given = surnameAtEnd ? fullName.slice(0, fullName.length - family.length).trim() : fullName.split(/\s+/)[0];
36784
- }
36785
- if (!family && given && fullName.toLowerCase().startsWith(given.toLowerCase())) {
36786
- family = fullName.slice(given.length).trim();
36787
- }
36788
- if (!given && emailFallback) given = emailFallback.split("@")[0];
36789
- return { given_name: given, family_name: family };
36790
- }
36791
37390
  var NO_RECOVERY_KEY_WARNING2 = "Without your password or a recovery key, we cannot recover your account or data.";
36792
37391
  function ConnectedSsoCallback() {
36793
37392
  const sso = useSsoSignIn();
@@ -36977,11 +37576,7 @@ function ConnectedSsoCallback() {
36977
37576
  setIsCheckingStatus(true);
36978
37577
  try {
36979
37578
  console.info("[SSO] Checking user status...");
36980
- const response = await arbi.sso.status({
36981
- token: accessToken,
36982
- email: user.email,
36983
- picture: user.picture
36984
- });
37579
+ const response = await ssoAccountStatus(arbi, accessToken, user);
36985
37580
  console.info("[SSO] User status:", response.status);
36986
37581
  setSsoStatus(response);
36987
37582
  } catch (error2) {
@@ -37025,40 +37620,18 @@ function ConnectedSsoCallback() {
37025
37620
  setIsSubmitting(true);
37026
37621
  setError(null);
37027
37622
  try {
37028
- const email = user.email;
37029
- if (ssoStatus.status === "new_user") {
37030
- const { given_name: firstName, family_name: lastName } = resolveSsoName(
37031
- user,
37032
- ssoStatus,
37033
- email
37034
- );
37035
- const { signingPrivateKey } = await arbi.sso.register({
37036
- token: accessToken,
37037
- email,
37038
- password,
37039
- firstName,
37040
- lastName,
37041
- picture: user.picture
37042
- });
37043
- await backUpOnSignup({
37044
- email,
37045
- password,
37046
- signingPrivateKey,
37047
- saveRecoveryKey,
37048
- auth0Sub: user.sub
37049
- });
37050
- const login = await arbi.sso.login({
37051
- token: accessToken,
37052
- email,
37053
- password,
37054
- profile: { ...resolveSsoName(user, ssoStatus), picture: user.picture ?? null }
37055
- });
37623
+ const { login, registered, linked } = await completeSsoSignIn(arbi, {
37624
+ token: accessToken,
37625
+ user,
37626
+ status: ssoStatus,
37627
+ password,
37628
+ saveRecoveryKey
37629
+ });
37630
+ if (registered && login) {
37056
37631
  auth.onRegistered?.(login);
37057
37632
  return;
37058
37633
  }
37059
- const signIn = ssoStatus.status === "local_exists" ? arbi.sso.link : arbi.sso.login;
37060
- await signIn({ token: accessToken, email, password });
37061
- if (ssoStatus.status === "local_exists") {
37634
+ if (linked) {
37062
37635
  notify17("Your local account has been linked to SSO", "success");
37063
37636
  }
37064
37637
  } catch (err) {
@@ -37134,7 +37707,7 @@ function ConnectedSsoCallback() {
37134
37707
  window.location.href = sso.continueUrl("link", auth0Message.state);
37135
37708
  }
37136
37709
  } : () => navigate("/");
37137
- return /* @__PURE__ */ jsxRuntime.jsxs(chunkK237IYOD_cjs.AuthLayout, { brand: auth.brand, corner: auth.corner, children: [
37710
+ return /* @__PURE__ */ jsxRuntime.jsxs(chunkBYJUI4AT_cjs.AuthLayout, { brand: auth.brand, corner: auth.corner, children: [
37138
37711
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "text-center py-8", "data-testid": "auth0-message", children: [
37139
37712
  /* @__PURE__ */ jsxRuntime.jsx("h2", { className: "text-lg font-semibold text-foreground mb-2", children: getTitle() }),
37140
37713
  /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm text-muted-foreground", children: getDescription() }),
@@ -37185,7 +37758,7 @@ function ConnectedSsoCallback() {
37185
37758
  ] });
37186
37759
  }
37187
37760
  if (isCheckingStatus || !ssoStatus) {
37188
- return /* @__PURE__ */ jsxRuntime.jsxs(chunkK237IYOD_cjs.AuthLayout, { brand: auth.brand, corner: auth.corner, children: [
37761
+ return /* @__PURE__ */ jsxRuntime.jsxs(chunkBYJUI4AT_cjs.AuthLayout, { brand: auth.brand, corner: auth.corner, children: [
37189
37762
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "text-center py-8", "data-testid": "sso-loading", children: [
37190
37763
  /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Loader2, { className: "h-8 w-8 animate-spin mx-auto mb-4" }),
37191
37764
  /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm text-muted-foreground", children: "Completing authentication..." })
@@ -37193,14 +37766,14 @@ function ConnectedSsoCallback() {
37193
37766
  /* @__PURE__ */ jsxRuntime.jsx(ui.Button, { onClick: () => navigate("/login"), variant: "ghost", className: "w-full text-sm", children: "Cancel" })
37194
37767
  ] });
37195
37768
  }
37196
- return /* @__PURE__ */ jsxRuntime.jsxs(chunkK237IYOD_cjs.AuthLayout, { brand: auth.brand, corner: auth.corner, children: [
37769
+ return /* @__PURE__ */ jsxRuntime.jsxs(chunkBYJUI4AT_cjs.AuthLayout, { brand: auth.brand, corner: auth.corner, children: [
37197
37770
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "pt-3", "data-testid": "sso-password-form", children: [
37198
37771
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "mb-6 text-center", children: [
37199
37772
  /* @__PURE__ */ jsxRuntime.jsx("h2", { className: "text-lg font-semibold text-foreground", children: getTitle() }),
37200
37773
  getDescription() && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "mt-2 text-sm text-muted-foreground", children: getDescription() })
37201
37774
  ] }),
37202
37775
  /* @__PURE__ */ jsxRuntime.jsxs("form", { onSubmit: handlePasswordSubmit, className: "space-y-4", children: [
37203
- /* @__PURE__ */ jsxRuntime.jsx(chunkK237IYOD_cjs.AuthField, { htmlFor: "email", label: "Email", children: /* @__PURE__ */ jsxRuntime.jsx(
37776
+ /* @__PURE__ */ jsxRuntime.jsx(chunkBYJUI4AT_cjs.AuthField, { htmlFor: "email", label: "Email", children: /* @__PURE__ */ jsxRuntime.jsx(
37204
37777
  ui.Input,
37205
37778
  {
37206
37779
  type: "email",
@@ -37215,7 +37788,7 @@ function ConnectedSsoCallback() {
37215
37788
  ) }),
37216
37789
  ssoStatus.status === "new_user" ? /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
37217
37790
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex gap-4", children: [
37218
- /* @__PURE__ */ jsxRuntime.jsx(chunkK237IYOD_cjs.AuthField, { htmlFor: "firstName", label: "First Name", className: "flex-1", children: /* @__PURE__ */ jsxRuntime.jsx(
37791
+ /* @__PURE__ */ jsxRuntime.jsx(chunkBYJUI4AT_cjs.AuthField, { htmlFor: "firstName", label: "First Name", className: "flex-1", children: /* @__PURE__ */ jsxRuntime.jsx(
37219
37792
  ui.Input,
37220
37793
  {
37221
37794
  type: "text",
@@ -37228,7 +37801,7 @@ function ConnectedSsoCallback() {
37228
37801
  "data-testid": "sso-firstname-display"
37229
37802
  }
37230
37803
  ) }),
37231
- /* @__PURE__ */ jsxRuntime.jsx(chunkK237IYOD_cjs.AuthField, { htmlFor: "lastName", label: "Last Name", className: "flex-1", children: /* @__PURE__ */ jsxRuntime.jsx(
37804
+ /* @__PURE__ */ jsxRuntime.jsx(chunkBYJUI4AT_cjs.AuthField, { htmlFor: "lastName", label: "Last Name", className: "flex-1", children: /* @__PURE__ */ jsxRuntime.jsx(
37232
37805
  ui.Input,
37233
37806
  {
37234
37807
  type: "text",
@@ -37257,7 +37830,7 @@ function ConnectedSsoCallback() {
37257
37830
  getUnmetRequirement: passwordRules.unmet
37258
37831
  }
37259
37832
  )
37260
- ] }) : /* @__PURE__ */ jsxRuntime.jsxs(chunkK237IYOD_cjs.AuthField, { htmlFor: "password", label: "Password", required: true, children: [
37833
+ ] }) : /* @__PURE__ */ jsxRuntime.jsxs(chunkBYJUI4AT_cjs.AuthField, { htmlFor: "password", label: "Password", required: true, children: [
37261
37834
  /* @__PURE__ */ jsxRuntime.jsx(
37262
37835
  ui.Input,
37263
37836
  {
@@ -37276,7 +37849,7 @@ function ConnectedSsoCallback() {
37276
37849
  }
37277
37850
  ),
37278
37851
  ssoStatus?.status === "sso_exists" && /* @__PURE__ */ jsxRuntime.jsx(
37279
- chunkK237IYOD_cjs.AuthLink,
37852
+ chunkBYJUI4AT_cjs.AuthLink,
37280
37853
  {
37281
37854
  onClick: () => setShowForgotPasswordModal(true),
37282
37855
  className: "mt-2",
@@ -37285,9 +37858,9 @@ function ConnectedSsoCallback() {
37285
37858
  }
37286
37859
  )
37287
37860
  ] }),
37288
- error && /* @__PURE__ */ jsxRuntime.jsx(chunkK237IYOD_cjs.AuthAlert, { testId: "sso-error-message", children: error.message }),
37861
+ error && /* @__PURE__ */ jsxRuntime.jsx(chunkBYJUI4AT_cjs.AuthAlert, { testId: "sso-error-message", children: error.message }),
37289
37862
  ssoStatus.status === "new_user" && /* @__PURE__ */ jsxRuntime.jsx(
37290
- chunkK237IYOD_cjs.AuthConsent,
37863
+ chunkBYJUI4AT_cjs.AuthConsent,
37291
37864
  {
37292
37865
  termsAccepted,
37293
37866
  onTermsAcceptedChange: setTermsAccepted,
@@ -37529,7 +38102,7 @@ function ConnectedRecoveryKeyDialog({
37529
38102
  onOpenChange(false);
37530
38103
  };
37531
38104
  return /* @__PURE__ */ jsxRuntime.jsx(
37532
- chunkK237IYOD_cjs.RecoveryKeyDialog,
38105
+ chunkBYJUI4AT_cjs.RecoveryKeyDialog,
37533
38106
  {
37534
38107
  open,
37535
38108
  onClose: handleClose,
@@ -37838,55 +38411,55 @@ function ConnectedAccountAccessBadge() {
37838
38411
 
37839
38412
  Object.defineProperty(exports, "CAP_REACHED_MESSAGE", {
37840
38413
  enumerable: true,
37841
- get: function () { return chunkF2BYURQZ_cjs.CAP_REACHED_MESSAGE; }
38414
+ get: function () { return chunkLYF47OXX_cjs.CAP_REACHED_MESSAGE; }
37842
38415
  });
37843
38416
  Object.defineProperty(exports, "ZERO_BUDGET_MESSAGE", {
37844
38417
  enumerable: true,
37845
- get: function () { return chunkF2BYURQZ_cjs.ZERO_BUDGET_MESSAGE; }
38418
+ get: function () { return chunkLYF47OXX_cjs.ZERO_BUDGET_MESSAGE; }
37846
38419
  });
37847
38420
  Object.defineProperty(exports, "aiUsageResetTimestamp", {
37848
38421
  enumerable: true,
37849
- get: function () { return chunkF2BYURQZ_cjs.aiUsageResetTimestamp; }
38422
+ get: function () { return chunkLYF47OXX_cjs.aiUsageResetTimestamp; }
37850
38423
  });
37851
38424
  Object.defineProperty(exports, "formatMoney", {
37852
38425
  enumerable: true,
37853
- get: function () { return chunkF2BYURQZ_cjs.formatMoney; }
38426
+ get: function () { return chunkLYF47OXX_cjs.formatMoney; }
37854
38427
  });
37855
38428
  Object.defineProperty(exports, "formatResetDate", {
37856
38429
  enumerable: true,
37857
- get: function () { return chunkF2BYURQZ_cjs.formatResetDate; }
38430
+ get: function () { return chunkLYF47OXX_cjs.formatResetDate; }
37858
38431
  });
37859
38432
  Object.defineProperty(exports, "getQuotaItems", {
37860
38433
  enumerable: true,
37861
- get: function () { return chunkF2BYURQZ_cjs.getQuotaItems; }
38434
+ get: function () { return chunkLYF47OXX_cjs.getQuotaItems; }
37862
38435
  });
37863
38436
  Object.defineProperty(exports, "isAddonBudgetZero", {
37864
38437
  enumerable: true,
37865
- get: function () { return chunkF2BYURQZ_cjs.isAddonBudgetZero; }
38438
+ get: function () { return chunkLYF47OXX_cjs.isAddonBudgetZero; }
37866
38439
  });
37867
38440
  Object.defineProperty(exports, "isProProject", {
37868
38441
  enumerable: true,
37869
- get: function () { return chunkF2BYURQZ_cjs.isProProject; }
38442
+ get: function () { return chunkLYF47OXX_cjs.isProProject; }
37870
38443
  });
37871
38444
  Object.defineProperty(exports, "planBadgeView", {
37872
38445
  enumerable: true,
37873
- get: function () { return chunkF2BYURQZ_cjs.planBadgeView; }
38446
+ get: function () { return chunkLYF47OXX_cjs.planBadgeView; }
37874
38447
  });
37875
38448
  Object.defineProperty(exports, "planName", {
37876
38449
  enumerable: true,
37877
- get: function () { return chunkF2BYURQZ_cjs.planName; }
38450
+ get: function () { return chunkLYF47OXX_cjs.planName; }
37878
38451
  });
37879
38452
  Object.defineProperty(exports, "projectGroupBilling", {
37880
38453
  enumerable: true,
37881
- get: function () { return chunkF2BYURQZ_cjs.projectGroupBilling; }
38454
+ get: function () { return chunkLYF47OXX_cjs.projectGroupBilling; }
37882
38455
  });
37883
38456
  Object.defineProperty(exports, "useBillingSupport", {
37884
38457
  enumerable: true,
37885
- get: function () { return chunkF2BYURQZ_cjs.useBillingSupport; }
38458
+ get: function () { return chunkLYF47OXX_cjs.useBillingSupport; }
37886
38459
  });
37887
38460
  Object.defineProperty(exports, "useRewardBalance", {
37888
38461
  enumerable: true,
37889
- get: function () { return chunkF2BYURQZ_cjs.useRewardBalance; }
38462
+ get: function () { return chunkLYF47OXX_cjs.useRewardBalance; }
37890
38463
  });
37891
38464
  Object.defineProperty(exports, "ConnectedAssistantDock", {
37892
38465
  enumerable: true,
@@ -38165,6 +38738,7 @@ exports.ConnectedSearchPage = ConnectedSearchPage;
38165
38738
  exports.ConnectedSecuritySection = ConnectedSecuritySection;
38166
38739
  exports.ConnectedSessionsRow = ConnectedSessionsRow;
38167
38740
  exports.ConnectedSettingsPage = ConnectedSettingsPage;
38741
+ exports.ConnectedSharePointAdminConsentPage = ConnectedSharePointAdminConsentPage;
38168
38742
  exports.ConnectedSharedFilesPage = ConnectedSharedFilesPage;
38169
38743
  exports.ConnectedSignatureVerifyPage = ConnectedSignatureVerifyPage;
38170
38744
  exports.ConnectedSkillUpload = ConnectedSkillUpload;
@@ -38212,6 +38786,8 @@ exports.DEFAULT_CONNECTED_SEARCH_PAGE_LABELS = DEFAULT_CONNECTED_SEARCH_PAGE_LAB
38212
38786
  exports.DEFAULT_CONNECTED_SKILL_UPLOAD_LABELS = DEFAULT_CONNECTED_SKILL_UPLOAD_LABELS;
38213
38787
  exports.DEFAULT_CONNECTED_WORKFLOW_RUNNER_LABELS = DEFAULT_CONNECTED_WORKFLOW_RUNNER_LABELS;
38214
38788
  exports.DEFAULT_OAUTH_PERMISSIONS = DEFAULT_OAUTH_PERMISSIONS;
38789
+ exports.DEFAULT_PROJECTS_LIST_LABELS = DEFAULT_PROJECTS_LIST_LABELS;
38790
+ exports.DEFAULT_PROJECT_LIST_COLUMNS = DEFAULT_PROJECT_LIST_COLUMNS;
38215
38791
  exports.DEFAULT_SEARCH_FIELDS = DEFAULT_SEARCH_FIELDS;
38216
38792
  exports.DEFAULT_SEARCH_ROW_LABELS = DEFAULT_SEARCH_ROW_LABELS;
38217
38793
  exports.DEFAULT_SETTINGS_SECTIONS = DEFAULT_SETTINGS_SECTIONS;
@@ -38281,6 +38857,7 @@ exports.WorkflowRunStatusCell = WorkflowRunStatusCell;
38281
38857
  exports.WorkflowRunThread = WorkflowRunThread;
38282
38858
  exports.WorkflowStepMessage = WorkflowStepMessage;
38283
38859
  exports.accountSettingsSection = accountSettingsSection;
38860
+ exports.appearanceSettingsSection = appearanceSettingsSection;
38284
38861
  exports.backUpOnSignup = backUpOnSignup;
38285
38862
  exports.bookingCancelLink = bookingCancelLink;
38286
38863
  exports.buildNotificationCenterItems = buildNotificationCenterItems;
@@ -38302,6 +38879,7 @@ exports.documentFamilyMeta = documentFamilyMeta;
38302
38879
  exports.documentFieldContent = documentFieldContent;
38303
38880
  exports.filesViewMode = filesViewMode;
38304
38881
  exports.filterNotificationCenterItems = filterNotificationCenterItems;
38882
+ exports.formatStorageGb = formatStorageGb;
38305
38883
  exports.groupFallbackName = groupFallbackName;
38306
38884
  exports.identifyOAuthClient = identifyOAuthClient;
38307
38885
  exports.isActiveDocumentStatus = isActiveDocumentStatus;
@@ -38309,6 +38887,7 @@ exports.joinEventMeeting = joinEventMeeting;
38309
38887
  exports.loadEventWebinar = loadEventWebinar;
38310
38888
  exports.mailSettingsSection = mailSettingsSection;
38311
38889
  exports.openMeetingLink = openMeetingLink;
38890
+ exports.openSsoPopup = openSsoPopup;
38312
38891
  exports.organisationSettingsSection = organisationSettingsSection;
38313
38892
  exports.parseArbiCallUrl = parseArbiCallUrl;
38314
38893
  exports.parseOAuthConsentRequest = parseOAuthConsentRequest;