@snagset/server 0.1.4 → 0.1.6

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 (87) hide show
  1. package/README.md +7 -5
  2. package/dist/bin.js +3 -1
  3. package/dist/bin.js.map +1 -1
  4. package/dist/db/connect.js +68 -31
  5. package/dist/db/connect.js.map +1 -1
  6. package/dist/db/migrate.js +144 -81
  7. package/dist/db/migrate.js.map +1 -1
  8. package/dist/db/rls.js +5 -4
  9. package/dist/db/rls.js.map +1 -1
  10. package/dist/explain.js +1 -1
  11. package/dist/explain.js.map +1 -1
  12. package/dist/platform.js +5 -1
  13. package/dist/platform.js.map +1 -1
  14. package/dist/serverless.js +1 -1
  15. package/dist/serverless.js.map +1 -1
  16. package/package.json +1 -1
  17. package/static/dashboard/assets/{CompositeItem-DooiJvYh.js → CompositeItem-B5AtyrD6.js} +1 -1
  18. package/static/dashboard/assets/ConfirmDialog-ClUMXHe1.js +1 -0
  19. package/static/dashboard/assets/{CopyButton-BX1ldjjz.js → CopyButton-DCsj-LZV.js} +1 -1
  20. package/static/dashboard/assets/{FieldItemContext-DkOlIwHg.js → FieldItemContext-DVEWRsEB.js} +1 -1
  21. package/static/dashboard/assets/{InstallTag-DahspVU0.js → InstallTag-B_qg9P2r.js} +1 -1
  22. package/static/dashboard/assets/SaveState-B-6cG0nU.js +1 -0
  23. package/static/dashboard/assets/{_app-CRQzX614.js → _app-DKjbkrkj.js} +2 -2
  24. package/static/dashboard/assets/{_app-Cd9_WR6L.js → _app-DQfqCcnn.js} +1 -1
  25. package/static/dashboard/assets/{activity-B-59HYua.js → activity-D8OAqMBy.js} +1 -1
  26. package/static/dashboard/assets/{arrow-left-aeWIKOlS.js → arrow-left-D2obUiWw.js} +1 -1
  27. package/static/dashboard/assets/{avatar-KLKmXBKs.js → avatar-DlHbKa1H.js} +1 -1
  28. package/static/dashboard/assets/{badge-Dly0Vqky.js → badge-CQoGgFU8.js} +1 -1
  29. package/static/dashboard/assets/{card-D3S4369l.js → card-YnwmM74t.js} +1 -1
  30. package/static/dashboard/assets/{check-CjehM7M4.js → check-CLHnIgiu.js} +1 -1
  31. package/static/dashboard/assets/{chevron-right-CtWPB3ox.js → chevron-right-BX_QQNXH.js} +1 -1
  32. package/static/dashboard/assets/{copy-DbrG17rp.js → copy-ZOZ0pLVD.js} +1 -1
  33. package/static/dashboard/assets/{dialog-GyPeOagK.js → dialog-BO8bYmy1.js} +2 -2
  34. package/static/dashboard/assets/{dropdown-menu-BOoXJZ3W.js → dropdown-menu-NLHjhAUe.js} +3 -3
  35. package/static/dashboard/assets/{image-off-BYE-vNh9.js → image-off-Dg9jTwH7.js} +1 -1
  36. package/static/dashboard/assets/index-B7_Oj3hr.js +169 -0
  37. package/static/dashboard/assets/{label-BGuYH_Ll.js → label-Dpq7t35_.js} +1 -1
  38. package/static/dashboard/assets/{layout-grid-DJ_OjGVc.js → layout-grid-Bf2WS_DV.js} +1 -1
  39. package/static/dashboard/assets/me-DoCJgtG9.js +1 -0
  40. package/static/dashboard/assets/{parts-DJaBw8EG.js → parts-C1QjM02Y.js} +1 -1
  41. package/static/dashboard/assets/{plus-x0wkLget.js → plus-D247LXUb.js} +1 -1
  42. package/static/dashboard/assets/s._site-BDWAQaIb.js +1 -0
  43. package/static/dashboard/assets/{s._site.comments-Bt0AsQ8j.js → s._site.comments-DEzj9S7b.js} +9 -9
  44. package/static/dashboard/assets/s._site.reviewers-DZ5GqGMU.js +1 -0
  45. package/static/dashboard/assets/s._site.settings-BIjpyBsc.js +1 -0
  46. package/static/dashboard/assets/{setup-DTi8FBnt.js → setup-ONHVc5kM.js} +1 -1
  47. package/static/dashboard/assets/sign-in-H0jNzIrs.js +1 -0
  48. package/static/dashboard/assets/{sign-up-CfU4RCfo.js → sign-up-DyiLEKht.js} +1 -1
  49. package/static/dashboard/assets/sites-Dnmo-2Me.js +1 -0
  50. package/static/dashboard/assets/studio-DxOnhxuB.js +1 -0
  51. package/static/dashboard/assets/studio-enyabWEx.js +1 -0
  52. package/static/dashboard/assets/studio.index-nkeq6PME.js +1 -0
  53. package/static/dashboard/assets/studio.integrations-BWPo36fJ.js +1 -0
  54. package/static/dashboard/assets/studio.members-DXS5CJK_.js +1 -0
  55. package/static/dashboard/assets/{sun-BLhaKyhb.js → sun-BzkBukC4.js} +1 -1
  56. package/static/dashboard/assets/{switch-En3PhTzh.js → switch-ElcxbE6-.js} +1 -1
  57. package/static/dashboard/assets/{table-DuU_ZP-u.js → table-DdjoxL3-.js} +1 -1
  58. package/static/dashboard/assets/{useAriaLabelledBy-C3DXCwhM.js → useAriaLabelledBy-BNUj3f_d.js} +1 -1
  59. package/static/dashboard/assets/{useBaseQuery-B_iu1J2b.js → useBaseQuery-yj7uWlSz.js} +1 -1
  60. package/static/dashboard/assets/useQuery-CBgK187B.js +1 -0
  61. package/static/dashboard/assets/useRender-BHlMpPxr.js +1 -0
  62. package/static/dashboard/assets/{useValueChanged-BwMBSSVy.js → useValueChanged-DQ0Iea1L.js} +1 -1
  63. package/static/dashboard/assets/{users-c6wDSgLD.js → users-DDrXwrCG.js} +1 -1
  64. package/static/dashboard/assets/welcome-Dg1oA1uA.js +11 -0
  65. package/static/dashboard/assets/you-CP3bZ82A.js +1 -0
  66. package/static/dashboard/assets/{zod-CBoGbUzv.js → zod-BUdBrC5l.js} +1 -1
  67. package/static/dashboard/index.html +1 -1
  68. package/vercel.json +10 -5
  69. package/static/dashboard/assets/ConfirmDialog-B5Kq--VU.js +0 -1
  70. package/static/dashboard/assets/SaveState-Q9xJjbqL.js +0 -6
  71. package/static/dashboard/assets/createLucideIcon-CJO80vPf.js +0 -36
  72. package/static/dashboard/assets/index-D4yHhKPM.js +0 -129
  73. package/static/dashboard/assets/me-B-0XXdLF.js +0 -1
  74. package/static/dashboard/assets/s._site-s4IRnE6u.js +0 -1
  75. package/static/dashboard/assets/s._site.reviewers-BzJsotII.js +0 -1
  76. package/static/dashboard/assets/s._site.settings-C6ei77kQ.js +0 -1
  77. package/static/dashboard/assets/sign-in-CGOMDkYg.js +0 -1
  78. package/static/dashboard/assets/sites-zZ5gTDCZ.js +0 -1
  79. package/static/dashboard/assets/studio-DaMq1jOg.js +0 -1
  80. package/static/dashboard/assets/studio-r6xIIciH.js +0 -1
  81. package/static/dashboard/assets/studio.index-CsF3xaoh.js +0 -1
  82. package/static/dashboard/assets/studio.integrations-BnPEkEA3.js +0 -1
  83. package/static/dashboard/assets/studio.members-DegH-I8c.js +0 -1
  84. package/static/dashboard/assets/useQuery-yeUPHKKg.js +0 -1
  85. package/static/dashboard/assets/useRender-Bl1M9SFS.js +0 -1
  86. package/static/dashboard/assets/welcome-Ddm5B8Xh.js +0 -11
  87. package/static/dashboard/assets/you-BmjZYMtz.js +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"migrate.js","sourceRoot":"","sources":["../../src/db/migrate.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACpD,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,QAAQ,MAAM,UAAU,CAAC;AAEhC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqCG;AAEH,MAAM,IAAI,GAAG,OAAO,CAAC,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC;AACrD,MAAM,GAAG,GAAG,IAAI,CAAC,IAAI,EAAE,YAAY,CAAC,CAAC;AAErC;;;;;;;;;GASG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAG,UAAU,CAAC;AAO5C,MAAM,MAAM,GAAG,CAAC,CAAS,EAAU,EAAE,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC,MAAM,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC,MAAM,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C,CAAC;QACpC,GAAG,GAAG,CAAC,MAAM,MAAM,CAAC,cAAc,CAAC,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,cAAc,CAAC,EAAE,EAAE,GAAG,EAAE,CAAC,EAAE,CAAC,CAAC;QACvF,MAAM,OAAO,CAAC,GAAG,CAAC,CAAC;IACrB,CAAC;IAAC,OAAO,CAAC,EAAE,CAAC;QACX,IAAI,CAAC,YAAY,cAAc,EAAE,CAAC;YAChC,OAAO,CAAC,KAAK,CAAC,cAAc,CAAC,CAAC,OAAO,EAAE,CAAC,CAAC;YACzC,IAAI,GAAG,CAAC,CAAC,QAAQ,CAAC;QACpB,CAAC;aAAM,CAAC;YACN,MAAM,GAAG,GAAG,CAAC,YAAY,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;YACvD,kEAAkE;YAClE,uEAAuE;YACvE,mBAAmB;YACnB,MAAM,aAAa,GAAG,oEAAoE,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;YACrG,OAAO,CAAC,KAAK,CAAC,cAAc,GAAG,EAAE,CAAC,CAAC;YACnC,IAAI,GAAG,aAAa,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QAC/B,CAAC;IACH,CAAC;YAAS,CAAC;QACT,MAAM,GAAG,EAAE,GAAG,CAAC,EAAE,OAAO,EAAE,CAAC,EAAE,CAAC,CAAC;IACjC,CAAC;IACD,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AACrB,CAAC"}
package/dist/db/rls.js CHANGED
@@ -30,10 +30,11 @@ export async function rlsStatus(sql) {
30
30
  warning =
31
31
  `row-level security is NOT in force: the role "${role?.name}" has BYPASSRLS, ` +
32
32
  `which overrides every policy migration 0001 created. Managed Postgres often ` +
33
- `grants it to the owner role in the connection string it hands you (Neon's ` +
34
- `neondb_owner does). Requests are still scoped by org_id in the application, ` +
35
- `so this is a lost safety net rather than an open door — to get it back, create ` +
36
- `a role without BYPASSRLS, grant it the tables, and point DATABASE_URL at it.`;
33
+ `grants it to the role in the connection string it hands you (Supabase's ` +
34
+ `postgres and Neon's neondb_owner both do). Requests are still scoped by org_id ` +
35
+ `in the application, so this is a lost safety net rather than an open door — to ` +
36
+ `get it back, create a role without BYPASSRLS, grant it the tables, and point ` +
37
+ `DATABASE_URL at it.`;
37
38
  }
38
39
  else if (unprotected.length) {
39
40
  warning =
@@ -1 +1 @@
1
- {"version":3,"file":"rls.js","sourceRoot":"","sources":["../../src/db/rls.ts"],"names":[],"mappings":"AAgDA,MAAM,CAAC,KAAK,UAAU,SAAS,CAAC,GAAiB;IAC/C,MAAM,CAAC,IAAI,CAAC,GAAG,MAAM,GAAG,CAAqC;;;GAG5D,CAAC;IAEF,iEAAiE;IACjE,8EAA8E;IAC9E,4EAA4E;IAC5E,gEAAgE;IAChE,MAAM,MAAM,GAAG,MAAM,GAAG,CAAuD;;;;;;;;;;;;;GAa9E,CAAC;IAEF,MAAM,WAAW,GAAG,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,QAAQ,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC;IAC9E,MAAM,SAAS,GAAG,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,QAAQ,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC;IACvF,MAAM,MAAM,GAAG,IAAI,EAAE,MAAM,IAAI,KAAK,CAAC;IACrC,MAAM,SAAS,GAAG,CAAC,MAAM,IAAI,CAAC,WAAW,CAAC,MAAM,IAAI,CAAC,SAAS,CAAC,MAAM,IAAI,MAAM,CAAC,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,OAAO;QACL,SAAS;QACT,IAAI,EAAE,IAAI,EAAE,IAAI,IAAI,SAAS;QAC7B,eAAe,EAAE,MAAM;QACvB,SAAS;QACT,WAAW;QACX,OAAO;KACR,CAAC;AACJ,CAAC"}
package/dist/explain.js CHANGED
@@ -46,7 +46,7 @@ export function explain(e) {
46
46
  case "ECONNREFUSED":
47
47
  return (`✗ no Postgres answered${where}.\n` +
48
48
  ` Start one, or point DATABASE_URL at a database that is running —\n` +
49
- ` a free Neon or Supabase branch works, so does a local install.`);
49
+ ` a free Supabase or Neon project works, so does a local install.`);
50
50
  case "ENOTFOUND":
51
51
  return `✗ that database host does not resolve${where}.\n Check the hostname in DATABASE_URL.`;
52
52
  case "ETIMEDOUT":
@@ -1 +1 @@
1
- {"version":3,"file":"explain.js","sourceRoot":"","sources":["../src/explain.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,qEAAqE;AACrE,MAAM,UAAU,OAAO,CAAC,CAAU;IAChC,OAAO,OAAO,CAAC,KAAK,QAAQ,IAAI,CAAC,KAAK,IAAI,IAAI,OAAQ,CAAwB,CAAC,IAAI,KAAK,QAAQ;QAC9F,CAAC,CAAE,CAAsB,CAAC,IAAI;QAC9B,CAAC,CAAC,SAAS,CAAC;AAChB,CAAC;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,UAAU,OAAO,CAAC,CAAU;IAChC,MAAM,GAAG,GAAG,CAAC,YAAY,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;IACvD,IAAI,GAAG;QAAE,OAAO,KAAK,GAAG,EAAE,CAAC;IAE3B,IAAI,KAAK,GAAG,EAAE,CAAC;IACf,IAAI,CAAC;QACH,MAAM,CAAC,GAAG,IAAI,GAAG,CAAC,OAAO,CAAC,GAAG,CAAC,cAAc,CAAC,IAAI,EAAE,CAAC,CAAC;QACrD,KAAK,GAAG,OAAO,CAAC,CAAC,QAAQ,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AAO,CAAC,CAAC,QAAQ,IAAI,CAAC,CAAC,IAAI,IAAI,MAAM,EAAE,CAAC;IAClD,CAAC;IAAC,MAAM,CAAC;QACP,4EAA4E;IAC9E,CAAC;IAED,QAAQ,OAAO,CAAC,CAAC,CAAC,EAAE,CAAC;QACnB,KAAK,cAAc;YACjB,OAAO,CACL,yBAAyB,KAAK,KAAK;gBACnC,sEAAsE;gBACtE,mEAAmE,CACpE,CAAC;QACJ,KAAK,WAAW;YACd,OAAO,wCAAwC,KAAK,0CAA0C,CAAC;QACjG,KAAK,WAAW;YACd,OAAO,CACL,wCAAwC,KAAK,KAAK;gBAClD,kEAAkE,CACnE,CAAC;QACJ;YACE,OAAO,KAAK,OAAO,CAAC,CAAC,CAAC,IAAI,wDAAwD,EAAE,CAAC;IACzF,CAAC;AACH,CAAC"}
package/dist/platform.js CHANGED
@@ -1,10 +1,14 @@
1
1
  const asHttps = (host) => (/^https?:\/\//.test(host) ? host : `https://${host}`).replace(/\/+$/, "");
2
2
  export function applyPlatformDefaults(env) {
3
- const out = { port: null, baseUrl: null };
3
+ const out = { port: null, baseUrl: null, database: null };
4
4
  if (!env.SNAGSET_PORT && env.PORT && /^\d+$/.test(env.PORT)) {
5
5
  env.SNAGSET_PORT = env.PORT;
6
6
  out.port = env.PORT;
7
7
  }
8
+ if (!env.DATABASE_URL && env.POSTGRES_URL && env.POSTGRES_URL.trim()) {
9
+ env.DATABASE_URL = env.POSTGRES_URL.trim();
10
+ out.database = "POSTGRES_URL";
11
+ }
8
12
  if (!env.SNAGSET_BASE_URL && !env.SNAGSET_PUBLIC_URL) {
9
13
  const candidates = [
10
14
  ["VERCEL_PROJECT_PRODUCTION_URL", env.VERCEL_PROJECT_PRODUCTION_URL],
@@ -1 +1 @@
1
- {"version":3,"file":"platform.js","sourceRoot":"","sources":["../src/platform.ts"],"names":[],"mappings":"AA0BA,MAAM,OAAO,GAAG,CAAC,IAAY,EAAU,EAAE,CAAC,CAAC,cAAc,CAAC,IAAI,C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AG,CAAC,UAAU,CAAC;YAC9B,CAAC,uBAAuB,EAAE,GAAG,CAAC,qBAAqB,CAAC;YACpD,CAAC,qBAAqB,EAAE,GAAG,CAAC,mBAAmB,CAAC;YAChD,CAAC,cAAc,EAAE,GAAG,CAAC,YAAY,CAAC,CAAC,CAAC,GAAG,GAAG,CAAC,YAAY,UAAU,CAAC,CAAC,CAAC,SAAS,CAAC;SAC/E,CAAC;QACF,KAAK,MAAM,CAAC,IAAI,EAAE,IAAI,CAAC,IAAI,UAAU,EAAE,CAAC;YACtC,IAAI,IAAI,IAAI,IAAI,CAAC,IAAI,EAAE,EAAE,CAAC;gBACxB,MAAM,KAAK,GAAG,OAAO,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC,CAAC;gBACnC,GAAG,CAAC,gBAAgB,GAAG,KAAK,CAAC;gBAC7B,GAAG,CAAC,OAAO,GAAG,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;gBAC9B,MAAM;YACR,CAAC;QACH,CAAC;IACH,CAAC;IACD,OAAO,GAAG,CAAC;AACb,CAAC"}
@@ -18,7 +18,7 @@ export function createServerlessHandler(options = {}) {
18
18
  "to decrypt on the next. Generate 32 random bytes, base64url them, and set it in the " +
19
19
  "deploy's environment (08 §4.2).");
20
20
  }
21
- const sql = connect(cfg.required("DATABASE_URL"), { max: cfg.int("SNAGSET_DATABASE_POOL_MAX") });
21
+ const sql = connect(cfg.required("DATABASE_URL"), { max: cfg.int("SNAGSET_DATABASE_POOL_MAX"), ssl: cfg.get("SNAGSET_DATABASE_SSL") });
22
22
  const app = createApp({
23
23
  sql,
24
24
  cfg,
@@ -1 +1 @@
1
- {"version":3,"file":"serverless.js","sourceRoot":"","sources":["../src/serverless.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AAC5B,OAAO,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAC;AAC1C,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACz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AE,cAAc,EAAE,2BAA2B,EAAE,eAAe,EAAE,UAAU,EAAE,EAAE,CACvG,CAAC;IACJ,CAAC;IAED,SAAS,KAAK,CAAC,OAAgB;QAC7B,IAAI,GAAG,CAAC;QACR,IAAI,CAAC;YACH,GAAG,GAAG,IAAI,EAAE,CAAC,GAAG,CAAC;QACnB,CAAC;QAAC,OAAO,CAAC,EAAE,CAAC;YACX,wEAAwE;YACxE,6DAA6D;YAC7D,OAAO,aAAa,CAAC,CAAC,CAAC,CAAC;QAC1B,CAAC;QACD,OAAO,GAAG,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;IAC5B,CAAC;IAED,KAAK,UAAU,aAAa;QAC1B,MAAM,IAAI,GAAG,MAAM,CAAC;QACpB,MAAM,GAAG,IAAI,CAAC;QACd,IAAI,IAAI;YAAE,MAAM,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,OAAO,EAAE,CAAC,EAAE,CAAC,CAAC;IAC/C,CAAC;IAED,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,aAAa,EAAE,CAAC;AACvC,CAAC;AAED,4GAA4G;AAC5G,MAAM,QAAQ,GAAG,uBAAuB,EAAE,CAAC;AAE3C,eAAe,EAAE,KAAK,EAAE,QAAQ,CAAC,KAAK,EAAE,CAAC;AAEzC,MAAM,CAAC,MAAM,OAAO,GAAG,QAAQ,CAAC,KAAK,CAAC;AAEtC,MAAM,CAAC,MAAM,aAAa,GAAG,QAAQ,CAAC,aAAa,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@snagset/server",
3
- "version": "0.1.4",
3
+ "version": "0.1.6",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "description": "The Snagset server: API, dashboard and widget in one package. Node and Postgres, or Vercel.",
@@ -1 +1 @@
1
- import{r as l,c as O,d as M,U as w,j as T,ap as _,X as j,E as k,ao as S,h as H}from"./index-D4yHhKPM.js";const U=l.createContext(void 0);function q(){return l.useContext(U)?.direction??"ltr"}const y=l.createContext({register:()=>{},unregister:()=>{},subscribeMapChange:()=>()=>{},nextIndexRef:{current:0}});function Y(){return l.useContext(y)}function B(s={}){const{guess:o,label:e,metadata:r,textRef:f,index:t}=s,{register:i,unregister:u,subscribeMapChange:d,nextIndexRef:h}=Y(),c=l.useRef(-1),[g,C]=l.useState(t==null&&o?()=>{if(c.current===-1){const p=h.current;h.current+=1,c.current=p}return c.current}:-1),v=t??g,R=l.useRef(null),E=l.useCallback(p=>{const b=R.current;b&&u(b),R.current=p,p&&i(p,{metadata:r??null,index:t??null,label:e,textRef:f})},[t,i,u,r,e,f]);return O(()=>{if(t==null)return d(p=>{const b=R.current?p.get(R.current)?.index:null;b!=null&&C(b)})},[t,d]),{ref:E,index:v}}function K(s){const{children:o,elementsRef:e,labelsRef:r,onMapChange:f}=s,t=M(f),[,i]=l.useState(!1),u=w(W).current,d=w(F).current,h=l.useRef(0),c=l.useRef(!0),g=l.useRef([]),C=l.useRef(null),v=M(()=>{c.current||(c.current=!0,i(n=>!n))}),R=M((n,x)=>{d.set(n,x),v()}),E=M(n=>{d.delete(n),v()}),p=M(n=>{const x=new Map;return e.current.length=0,r&&(r.current.length=0),n.forEach(a=>{x.set(a.element,{...a.registration.metadata??{},index:a.index}),e.current[a.index]=a.element,r&&(r.current[a.index]=a.registration.label!==void 0?a.registration.label:a.registration.textRef?.current?.textContent??a.element.textContent)}),h.current=e.current.length,x});function b(n){if(C.current?.disconnect(),C.current=null,typeof MutationObserver!="function"||n.length<2)return;const x=new MutationObserver(m=>{if(!J(m))return;let I=null;for(const L of n)if(L.isConnected){if(I&&D(I,L)>0){x.disconnect(),v();return}I=L}});C.current=x;const a=new Set;for(let m=1;m<n.length;m+=1){const I=G(n[m-1],n[m]);I&&a.add(I)}a.forEach(m=>x.observe(m,{childList:!0}))}const N=M(()=>{const[n,x]=z(d),a=p(n);b(x),g.current=n,c.current=!1,u.forEach(m=>m(a)),t(a)});O(()=>(c.current||p(g.current),()=>{e.current=[],r&&(r.current=[])}),[e,r,p]),O(()=>{c.current&&N()}),O(()=>()=>{C.current?.disconnect(),c.current=!0},[]);const P=M(n=>(u.add(n),()=>{u.delete(n)})),A=l.useMemo(()=>({register:R,unregister:E,subscribeMapChange:P,nextIndexRef:h}),[R,E,P,h]);return T.jsx(y.Provider,{value:A,children:o})}function F(){return new Map}function W(){return new Set}function z(s){const o=new Set,e=[],r=[];s.forEach((t,i)=>{if(!i.isConnected)return;const u=t.index,d={index:u??-1,element:i,registration:t};u===null?r.push(d):u>=0&&(o.add(u),e.push(d))});let f=0;return r.sort((t,i)=>D(t.element,i.element)),r.forEach(t=>{for(;o.has(f);)f+=1;t.index=f,e.push(t),f+=1}),o.size>0&&e.sort((t,i)=>t.index-i.index),[e,r.map(t=>t.element)]}function G(s,o){let e=s.parentElement;for(;e&&!e.contains(o);)e=e.parentElement;return e}function J(s){for(const o of s)for(let e=0;e<o.removedNodes.length;e+=1)if(o.removedNodes[e].isConnected)return!0;return!1}function D(s,o){return s.compareDocumentPosition(o)&Node.DOCUMENT_POSITION_FOLLOWING?-1:1}function V(s={}){const{highlightItemOnHover:o,highlightedIndex:e,onHighlightedIndexChange:r}=_(),{ref:f,index:t}=B(s),i=e===t,u=l.useRef(null),d=j(f,u);return{compositeProps:{tabIndex:i?0:-1,onFocus(){r(t)},onMouseMove(){const c=u.current;if(!o||!c)return;const g=c.hasAttribute("disabled")||c.ariaDisabled==="true";!i&&!g&&c.focus()}},compositeRef:d,index:t}}function Q(s){const{render:o,className:e,style:r,state:f=k,props:t=S,refs:i=S,metadata:u,stateAttributesMapping:d,tag:h="div",...c}=s,{compositeProps:g,compositeRef:C}=V({metadata:u});return H(h,s,{state:f,ref:[C,...i],props:[g,...t,c],stateAttributesMapping:d})}export{K as C,B as a,Q as b,q as u};
1
+ import{r as l,d as O,e as M,V as w,j as T,aq as Y,Y as _,E as j,ap as S,i as k}from"./index-B7_Oj3hr.js";const H=l.createContext(void 0);function K(){return l.useContext(H)?.direction??"ltr"}const y=l.createContext({register:()=>{},unregister:()=>{},subscribeMapChange:()=>()=>{},nextIndexRef:{current:0}});function B(){return l.useContext(y)}function F(s={}){const{guess:o,label:e,metadata:r,textRef:f,index:t}=s,{register:i,unregister:u,subscribeMapChange:d,nextIndexRef:h}=B(),c=l.useRef(-1),[g,C]=l.useState(t==null&&o?()=>{if(c.current===-1){const p=h.current;h.current+=1,c.current=p}return c.current}:-1),v=t??g,R=l.useRef(null),E=l.useCallback(p=>{const b=R.current;b&&u(b),R.current=p,p&&i(p,{metadata:r??null,index:t??null,label:e,textRef:f})},[t,i,u,r,e,f]);return O(()=>{if(t==null)return d(p=>{const b=R.current?p.get(R.current)?.index:null;b!=null&&C(b)})},[t,d]),{ref:E,index:v}}function Q(s){const{children:o,elementsRef:e,labelsRef:r,onMapChange:f}=s,t=M(f),[,i]=l.useState(!1),u=w(V).current,d=w(U).current,h=l.useRef(0),c=l.useRef(!0),g=l.useRef([]),C=l.useRef(null),v=M(()=>{c.current||(c.current=!0,i(n=>!n))}),R=M((n,x)=>{d.set(n,x),v()}),E=M(n=>{d.delete(n),v()}),p=M(n=>{const x=new Map;return e.current.length=0,r&&(r.current.length=0),n.forEach(a=>{x.set(a.element,{...a.registration.metadata??{},index:a.index}),e.current[a.index]=a.element,r&&(r.current[a.index]=a.registration.label!==void 0?a.registration.label:a.registration.textRef?.current?.textContent??a.element.textContent)}),h.current=e.current.length,x});function b(n){if(C.current?.disconnect(),C.current=null,typeof MutationObserver!="function"||n.length<2)return;const x=new MutationObserver(m=>{if(!z(m))return;let I=null;for(const L of n)if(L.isConnected){if(I&&D(I,L)>0){x.disconnect(),v();return}I=L}});C.current=x;const a=new Set;for(let m=1;m<n.length;m+=1){const I=q(n[m-1],n[m]);I&&a.add(I)}a.forEach(m=>x.observe(m,{childList:!0}))}const N=M(()=>{const[n,x]=W(d),a=p(n);b(x),g.current=n,c.current=!1,u.forEach(m=>m(a)),t(a)});O(()=>(c.current||p(g.current),()=>{e.current=[],r&&(r.current=[])}),[e,r,p]),O(()=>{c.current&&N()}),O(()=>()=>{C.current?.disconnect(),c.current=!0},[]);const P=M(n=>(u.add(n),()=>{u.delete(n)})),A=l.useMemo(()=>({register:R,unregister:E,subscribeMapChange:P,nextIndexRef:h}),[R,E,P,h]);return T.jsx(y.Provider,{value:A,children:o})}function U(){return new Map}function V(){return new Set}function W(s){const o=new Set,e=[],r=[];s.forEach((t,i)=>{if(!i.isConnected)return;const u=t.index,d={index:u??-1,element:i,registration:t};u===null?r.push(d):u>=0&&(o.add(u),e.push(d))});let f=0;return r.sort((t,i)=>D(t.element,i.element)),r.forEach(t=>{for(;o.has(f);)f+=1;t.index=f,e.push(t),f+=1}),o.size>0&&e.sort((t,i)=>t.index-i.index),[e,r.map(t=>t.element)]}function q(s,o){let e=s.parentElement;for(;e&&!e.contains(o);)e=e.parentElement;return e}function z(s){for(const o of s)for(let e=0;e<o.removedNodes.length;e+=1)if(o.removedNodes[e].isConnected)return!0;return!1}function D(s,o){return s.compareDocumentPosition(o)&Node.DOCUMENT_POSITION_FOLLOWING?-1:1}function G(s={}){const{highlightItemOnHover:o,highlightedIndex:e,onHighlightedIndexChange:r}=Y(),{ref:f,index:t}=F(s),i=e===t,u=l.useRef(null),d=_(f,u);return{compositeProps:{tabIndex:i?0:-1,onFocus(){r(t)},onMouseMove(){const c=u.current;if(!o||!c)return;const g=c.hasAttribute("disabled")||c.ariaDisabled==="true";!i&&!g&&c.focus()}},compositeRef:d,index:t}}function X(s){const{render:o,className:e,style:r,state:f=j,props:t=S,refs:i=S,metadata:u,stateAttributesMapping:d,tag:h="div",...c}=s,{compositeProps:g,compositeRef:C}=G({metadata:u});return k(h,s,{state:f,ref:[C,...i],props:[g,...t,c],stateAttributesMapping:d})}export{Q as C,F as a,X as b,K as u};
@@ -0,0 +1 @@
1
+ import{r as i,j as e,B as x}from"./index-B7_Oj3hr.js";import{E as u,G as g,I as C,H as D,J as v,K as b}from"./dialog-BO8bYmy1.js";import{L as E,I}from"./label-Dpq7t35_.js";function T({open:t,onOpenChange:o,title:m,description:r,children:h,confirmLabel:j,confirmWord:l,busy:s=!1,onConfirm:p}){const[n,c]=i.useState(""),d=i.useId();i.useEffect(()=>{t&&c("")},[t]);const f=!l||n.trim()===l;return e.jsx(u,{open:t,onOpenChange:a=>{!a&&s||o(a)},children:e.jsx(g,{showCloseButton:!1,children:e.jsxs("form",{className:"flex flex-col gap-4",onSubmit:a=>{a.preventDefault(),f&&!s&&p()},children:[e.jsxs(C,{children:[e.jsx(D,{children:m}),r&&e.jsx(v,{children:r})]}),h,l&&e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsxs(E,{htmlFor:d,children:["Type ",e.jsx("b",{className:"font-semibold text-foreground",children:l})," to confirm"]}),e.jsx(I,{id:d,value:n,autoComplete:"off",spellCheck:!1,disabled:s,onChange:a=>c(a.target.value)})]}),e.jsxs(b,{children:[e.jsx(x,{type:"button",variant:"outline",disabled:s,onClick:()=>o(!1),children:"Cancel"}),e.jsx(x,{type:"submit",variant:"destructive",loading:s,disabled:!f,children:s?"Working…":j})]})]})})})}export{T as C};
@@ -1 +1 @@
1
- import{r as n,j as t,B as c}from"./index-D4yHhKPM.js";import{C}from"./check-CjehM7M4.js";import{C as m}from"./copy-DbrG17rp.js";function l({text:r,label:e="Copy",withText:s=!1,size:a="icon-sm",className:p}){const[o,i]=n.useState(!1);return t.jsxs(c,{type:"button",variant:"outline",size:s?"sm":a,className:p,"aria-label":o?"Copied":e,onClick:()=>{navigator.clipboard?.writeText(r).catch(()=>{}),i(!0),setTimeout(()=>i(!1),1500)},children:[o?t.jsx(C,{}):t.jsx(m,{}),s&&(o?"Copied":e)]})}export{l as C};
1
+ import{r as n,j as t,B as c}from"./index-B7_Oj3hr.js";import{C}from"./check-CLHnIgiu.js";import{C as m}from"./copy-ZOZ0pLVD.js";function l({text:r,label:e="Copy",withText:s=!1,size:a="icon-sm",className:p}){const[o,i]=n.useState(!1);return t.jsxs(c,{type:"button",variant:"outline",size:s?"sm":a,className:p,"aria-label":o?"Copied":e,onClick:()=>{navigator.clipboard?.writeText(r).catch(()=>{}),i(!0),setTimeout(()=>i(!1),1500)},children:[o?t.jsx(C,{}):t.jsx(m,{}),s&&(o?"Copied":e)]})}export{l as C};
@@ -1 +1 @@
1
- import{r as t}from"./index-D4yHhKPM.js";const e=t.createContext({disabled:!1});function r(){return t.useContext(e)}export{r as u};
1
+ import{r as t}from"./index-B7_Oj3hr.js";const e=t.createContext({disabled:!1});function r(){return t.useContext(e)}export{r as u};
@@ -1 +1 @@
1
- import{r as o,j as e,B as i,ay as n}from"./index-D4yHhKPM.js";import{C as c}from"./check-CjehM7M4.js";import{C as l}from"./copy-DbrG17rp.js";function p(t){return`<script src="${location.origin}/snag.js" ${n("site")}="${t}" defer><\/script>`}function g({uid:t}){const[r,a]=o.useState(!1),s=p(t);return e.jsxs("div",{className:"relative rounded-md border border-border bg-background px-3 py-2.5 pr-11 font-mono text-[12.5px] leading-relaxed",children:[e.jsx("code",{className:"whitespace-pre-wrap break-all",children:s}),e.jsx(i,{variant:"ghost",size:"icon-sm",className:"absolute right-1.5 top-1.5","aria-label":r?"Copied":"Copy the tag",onClick:()=>{navigator.clipboard?.writeText(s),a(!0),setTimeout(()=>a(!1),1500)},children:r?e.jsx(c,{}):e.jsx(l,{})})]})}export{g as I};
1
+ import{r as o,j as e,B as i,aA as n}from"./index-B7_Oj3hr.js";import{C as c}from"./check-CLHnIgiu.js";import{C as l}from"./copy-ZOZ0pLVD.js";function p(t){return`<script src="${location.origin}/snag.js" ${n("site")}="${t}" defer><\/script>`}function g({uid:t}){const[r,a]=o.useState(!1),s=p(t);return e.jsxs("div",{className:"relative rounded-md border border-border bg-background px-3 py-2.5 pr-11 font-mono text-[12.5px] leading-relaxed",children:[e.jsx("code",{className:"whitespace-pre-wrap break-all",children:s}),e.jsx(i,{variant:"ghost",size:"icon-sm",className:"absolute right-1.5 top-1.5","aria-label":r?"Copied":"Copy the tag",onClick:()=>{navigator.clipboard?.writeText(s),a(!0),setTimeout(()=>a(!1),1500)},children:r?e.jsx(c,{}):e.jsx(l,{})})]})}export{g as I};
@@ -0,0 +1 @@
1
+ import{r,j as e,az as o}from"./index-B7_Oj3hr.js";function l({saving:s,savedAt:t}){const[i,a]=r.useState(!1);return r.useEffect(()=>{if(!t)return;a(!0);const n=setTimeout(()=>a(!1),1800);return()=>clearTimeout(n)},[t]),s?e.jsxs("span",{className:"inline-flex items-center gap-1.5 text-[12.5px] text-muted-foreground","aria-live":"polite",children:[e.jsx(o,{className:"size-3.5 animate-spin","aria-hidden":"true"}),"Saving"]}):e.jsx("span",{className:"text-[12.5px] text-muted-foreground","aria-live":"polite",children:i?"Saved":""})}export{l as S};
@@ -1,4 +1,4 @@
1
- import{u as pt,a as gt,b as ft,r as o,c as z,d as le,g as ht,j as e,B as J,e as w,f as se,m as be,E as xt,h as ve,i as ge,k as mt,l as bt,n as ne,o as Z,p as vt,L as _,q as jt,s as _e,M as yt,t as St,v as wt,w as Ct,x as kt,O as Nt}from"./index-D4yHhKPM.js";import{u as He}from"./useQuery-yeUPHKKg.js";import{T as Tt,i as ze,a as Pt,D as Rt,b as Mt,c as Et,X as Ot,d as It,e as Dt,f as At,g as _t,R as Ht,p as zt,h as Lt,j as $t,k as Bt,P as Ft,l as Ut,u as qt,m as Gt,n as Vt,o as Kt,q as Yt,r as Wt,s as Xt,t as Qt,v as Jt,w as Zt,x as es,y as ts,z as ss,A as ns,F as as,B as rs,C as os,E as Le,G as $e,H as Be,I as is,J as ls,K as ds}from"./dialog-GyPeOagK.js";import{c as B,n as Fe,g as cs,a as fe,t as us,d as ps,i as gs,u as fs,b as de,L as hs,I as xs}from"./label-BGuYH_Ll.js";import{g as he,u as ms,a as bs,b as vs,s as js,c as ys,d as Ss,e as ws,f as Cs,h as ks,S as Ue,E as Q,D as ae,i as re,j as oe,k as je,l as ee,m as I,n as V,o as Ns,p as ce}from"./dropdown-menu-BOoXJZ3W.js";import{u as qe}from"./useRender-Bl1M9SFS.js";import{c as D}from"./createLucideIcon-CJO80vPf.js";import{A as Ts,a as Ps}from"./avatar-KLKmXBKs.js";import{S as Rs,i as Ms,a as Es}from"./labels--UUyt9uB.js";import{u as Ge}from"./me-B-0XXdLF.js";import{L as te}from"./layout-grid-DJ_OjGVc.js";import{U as xe}from"./users-c6wDSgLD.js";import{c as Os}from"./update-duXzIzFS.js";import{P as Ve}from"./plus-x0wkLget.js";import{M as Is,S as Ds,a as As}from"./sun-BLhaKyhb.js";import"./useBaseQuery-B_iu1J2b.js";import"./check-CjehM7M4.js";import"./CompositeItem-DooiJvYh.js";import"./useValueChanged-BwMBSSVy.js";function _s(t){const s=pt({warn:t?.router===void 0}),n=t?.router||s;return gt(n.stores.__store,ft(t,n))}/**
1
+ import{u as pt,a as gt,b as ft,c as D,r as o,d as z,e as le,g as ht,j as e,B as J,f as w,h as se,m as be,E as xt,i as ve,k as ge,l as mt,n as bt,o as ne,p as Z,q as vt,L as _,s as jt,t as _e,M as yt,v as St,w as wt,x as Ct,y as kt,O as Nt}from"./index-B7_Oj3hr.js";import{u as He}from"./useQuery-CBgK187B.js";import{T as Tt,i as ze,a as Pt,D as Rt,b as Mt,c as Et,X as Ot,d as It,e as Dt,f as At,g as _t,R as Ht,p as zt,h as Lt,j as $t,k as Bt,P as Ft,l as Ut,u as qt,m as Gt,n as Vt,o as Kt,q as Yt,r as Wt,s as Xt,t as Qt,v as Jt,w as Zt,x as es,y as ts,z as ss,A as ns,F as as,B as rs,C as os,E as Le,G as $e,H as Be,I as is,J as ls,K as ds}from"./dialog-BO8bYmy1.js";import{c as B,n as Fe,g as cs,a as fe,t as us,d as ps,i as gs,u as fs,b as de,L as hs,I as xs}from"./label-Dpq7t35_.js";import{g as he,u as ms,a as bs,b as vs,s as js,c as ys,d as Ss,e as ws,f as Cs,h as ks,S as Ue,E as Q,D as ae,i as re,j as oe,k as je,l as ee,m as I,n as V,o as Ns,p as ce}from"./dropdown-menu-NLHjhAUe.js";import{u as qe}from"./useRender-BHlMpPxr.js";import{A as Ts,a as Ps}from"./avatar-DlHbKa1H.js";import{S as Rs,i as Ms,a as Es}from"./labels--UUyt9uB.js";import{u as Ge}from"./me-DoCJgtG9.js";import{L as te}from"./layout-grid-Bf2WS_DV.js";import{U as xe}from"./users-DDrXwrCG.js";import{c as Os}from"./update-duXzIzFS.js";import{P as Ve}from"./plus-D247LXUb.js";import{M as Is,S as Ds,a as As}from"./sun-BzkBukC4.js";import"./useBaseQuery-yj7uWlSz.js";import"./check-CLHnIgiu.js";import"./CompositeItem-B5AtyrD6.js";import"./useValueChanged-DQ0Iea1L.js";function _s(t){const s=pt({warn:t?.router===void 0}),n=t?.router||s;return gt(n.stores.__store,ft(t,n))}/**
2
2
  * @license lucide-react v1.39.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -53,4 +53,4 @@ import{u as pt,a as gt,b as ft,r as o,c as z,d as le,g as ht,j as e,B as J,e as
53
53
  *
54
54
  * This source code is licensed under the ISC license.
55
55
  * See the LICENSE file in the root directory of this source tree.
56
- */const Xs=[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]],Qe=D("user",Xs),ue=768;function Qs(){const[t,s]=o.useState(void 0);return o.useEffect(()=>{const n=window.matchMedia(`(max-width: ${ue-1}px)`),a=()=>{s(window.innerWidth<ue)};return n.addEventListener("change",a),s(window.innerWidth<ue),()=>n.removeEventListener("change",a)},[]),!!t}const Js=o.createContext({hasProvider:!1,timeoutMs:0,delayRef:{current:0},initialDelayRef:{current:0},timeout:new Tt,currentIdRef:{current:null},currentContextRef:{current:null}});function Zs(t,s){t.current=s.current}function en(t,s={open:!1}){const{open:n}=s,a="rootStore"in t?t.rootStore:t,r=a.useState("floatingId"),f=o.useContext(Js),{currentIdRef:d,delayRef:i,timeoutMs:h,initialDelayRef:c,currentContextRef:g,hasProvider:j,timeout:x}=f,[m,p]=o.useState(!1),S=o.useRef(n);return z(()=>{S.current=n},[n]),z(()=>{function u(){g.current?.setIsInstantPhase(!1),d.current=null,g.current=null,i.current=c.current,x.clear()}if(d.current&&!n&&d.current===r){if(p(!1),h){const b=r;return x.start(h,()=>{a.select("open")||d.current&&d.current!==b||u()}),()=>{(S.current||d.current!==b)&&x.clear()}}u()}},[n,r,d,i,h,c,g,x,a]),z(()=>{if(!n)return;const u=g.current,b=d.current;x.clear(),g.current={onOpenChange:a.setOpen,setIsInstantPhase:p},d.current=r,i.current={open:0,close:he(c.current,"close")},b!==null&&b!==r?(p(!0),u?.setIsInstantPhase(!0),u?.onOpenChange(!1,B(Fe))):(p(!1),u?.setIsInstantPhase(!1))},[n,r,a,d,i,c,g,x]),z(()=>()=>{if(d.current===r){if(g.current=null,!S.current)return;d.current=null,Zs(i,c),x.clear()}},[g,d,i,r,c,x]),o.useMemo(()=>({hasProvider:j,delayRef:i,isInstantPhase:m}),[j,i,m])}function tn(t,s){let n=null,a=null,r=!1;return{contextElement:t||void 0,getBoundingClientRect(){const f=t?.getBoundingClientRect()||{width:0,height:0,x:0,y:0},d=s.axis==="x"||s.axis==="both",i=s.axis==="y"||s.axis==="both",h=["mouseenter","mousemove"].includes(s.dataRef.current.openEvent?.type||"")&&s.pointerType!=="touch";let c=f.width,g=f.height,j=f.x,x=f.y;return n==null&&s.x&&d&&(n=f.x-s.x),a==null&&s.y&&i&&(a=f.y-s.y),j-=n||0,x-=a||0,c=0,g=0,!r||h?(c=s.axis==="y"?f.width:0,g=s.axis==="x"?f.height:0,j=d&&s.x!=null?s.x:j,x=i&&s.y!=null?s.y:x):r&&!h&&(g=s.axis==="x"?f.height:g,c=s.axis==="y"?f.width:c),r=!0,{width:c,height:g,x:j,y:x,top:x,right:j+c,bottom:x+g,left:j}}}}function Ee(t){return t!=null&&t.clientX!=null}function sn(t,s={}){const{enabled:n=!0,axis:a="both"}=s,r="rootStore"in t?t.rootStore:t,f=r.useState("open"),d=r.useState("floatingElement"),i=r.useState("domReferenceElement"),h=r.context.dataRef,c=o.useRef(!1),g=o.useRef(null),[j,x]=o.useState(),[m,p]=o.useState([]),S=le(v=>{r.set("positionReference",v)}),u=le((v,y,P)=>{c.current||h.current.openEvent&&!Ee(h.current.openEvent)||r.set("positionReference",tn(P??i,{x:v,y,axis:a,dataRef:h,pointerType:j}))}),b=le(v=>{f?g.current||(u(v.clientX,v.clientY,v.currentTarget),p([])):u(v.clientX,v.clientY,v.currentTarget)}),k=ze(j)?d:f;o.useEffect(()=>{if(!n){S(i);return}if(!k)return;function v(){g.current?.(),g.current=null}const y=ht(d);function P(l){const N=cs(l);fe(d,N)?v():u(l.clientX,l.clientY)}return!h.current.openEvent||Ee(h.current.openEvent)?g.current=Pt(y,"mousemove",P):S(i),v},[k,n,d,h,i,r,u,S,m]),o.useEffect(()=>()=>{r.set("positionReference",null)},[r]),o.useEffect(()=>{n&&!d&&(c.current=!1)},[n,d]),o.useEffect(()=>{!n&&f&&(c.current=!0)},[n,f]);const C=o.useMemo(()=>{function v(y){x(y.pointerType)}return{onPointerDown:v,onPointerEnter:v,onMouseMove:b,onMouseEnter:b}},[b]);return o.useMemo(()=>n?{reference:C,trigger:C}:{},[n,C])}function nn({...t}){return e.jsx(Rt,{"data-slot":"sheet",...t})}function an({...t}){return e.jsx(At,{"data-slot":"sheet-portal",...t})}function rn({className:t,...s}){return e.jsx(_t,{"data-slot":"sheet-overlay",className:w("fixed inset-0 z-50 bg-black/10 transition-opacity duration-150 data-ending-style:opacity-0 data-starting-style:opacity-0 supports-backdrop-filter:backdrop-blur-xs",t),...s})}function on({className:t,children:s,side:n="right",showCloseButton:a=!0,...r}){return e.jsxs(an,{children:[e.jsx(rn,{}),e.jsxs(Mt,{"data-slot":"sheet-content","data-side":n,className:w("fixed z-50 flex flex-col gap-4 bg-popover bg-clip-padding text-sm text-popover-foreground shadow-lg transition duration-200 ease-in-out data-ending-style:opacity-0 data-starting-style:opacity-0 data-[side=bottom]:inset-x-0 data-[side=bottom]:bottom-0 data-[side=bottom]:h-auto data-[side=bottom]:border-t data-[side=bottom]:data-ending-style:translate-y-[2.5rem] data-[side=bottom]:data-starting-style:translate-y-[2.5rem] data-[side=left]:inset-y-0 data-[side=left]:left-0 data-[side=left]:h-full data-[side=left]:w-3/4 data-[side=left]:border-r data-[side=left]:data-ending-style:translate-x-[-2.5rem] data-[side=left]:data-starting-style:translate-x-[-2.5rem] data-[side=right]:inset-y-0 data-[side=right]:right-0 data-[side=right]:h-full data-[side=right]:w-3/4 data-[side=right]:border-l data-[side=right]:data-ending-style:translate-x-[2.5rem] data-[side=right]:data-starting-style:translate-x-[2.5rem] data-[side=top]:inset-x-0 data-[side=top]:top-0 data-[side=top]:h-auto data-[side=top]:border-b data-[side=top]:data-ending-style:translate-y-[-2.5rem] data-[side=top]:data-starting-style:translate-y-[-2.5rem] data-[side=left]:sm:max-w-sm data-[side=right]:sm:max-w-sm",t),...r,children:[s,a&&e.jsxs(Et,{"data-slot":"sheet-close",render:e.jsx(J,{variant:"ghost",className:"absolute top-3 right-3",size:"icon-sm"}),children:[e.jsx(Ot,{}),e.jsx("span",{className:"sr-only",children:"Close"})]})]})]})}function ln({className:t,...s}){return e.jsx("div",{"data-slot":"sheet-header",className:w("flex flex-col gap-0.5 p-4",t),...s})}function dn({className:t,...s}){return e.jsx(It,{"data-slot":"sheet-title",className:w("font-heading text-base font-medium text-foreground",t),...s})}function cn({className:t,...s}){return e.jsx(Dt,{"data-slot":"sheet-description",className:w("text-sm text-muted-foreground",t),...s})}const Je=o.createContext(void 0);function K(t){const s=o.useContext(Je);if(s===void 0&&!t)throw new Error(se(72));return s}const un={...zt,disabled:t=>t.disabled,instantType:t=>t.instantType,isInstantPhase:t=>t.isInstantPhase,trackCursorAxis:t=>t.trackCursorAxis,disableHoverablePopup:t=>t.disableHoverablePopup,lastOpenChangeReason:t=>t.openChangeReason,closeOnClick:t=>t.closeOnClick,closeDelay:t=>t.closeDelay,adaptiveOrigin:t=>t.adaptiveOrigin};class pn extends Ht{constructor(s,n,a){const r=new Ft;super(gn(s,r,n,a),fn(r),un)}setOpen=(s,n)=>{Lt(this,s,n,{extraState:{openChangeReason:n.reason}})};cancelPendingOpen(s){this.state.floatingRootContext.dispatchOpenChange(!1,B(us,s))}}function gn(t,s,n,a=!1){const r={...$t(),disabled:!1,instantType:void 0,isInstantPhase:!1,trackCursorAxis:"none",disableHoverablePopup:!1,openChangeReason:null,closeOnClick:!0,closeDelay:0,adaptiveOrigin:void 0,...t};return r.floatingRootContext=Bt(s,n,a),r}function fn(t){return{popupRef:o.createRef(),onOpenChange:void 0,onOpenChangeComplete:void 0,triggerElements:t}}const hn=Ut(function(s){const{disabled:n=!1,defaultOpen:a=!1,open:r,disableHoverablePopup:f=!1,trackCursorAxis:d="none",actionsRef:i,onOpenChange:h,onOpenChangeComplete:c,handle:g,triggerId:j,defaultTriggerId:x=null,children:m}=s,p=qt(($,F)=>new pn({open:a,openProp:r,activeTriggerId:x,triggerIdProp:j},$,F));p.useControlledProp("openProp",r),p.useControlledProp("triggerIdProp",j),p.useContextCallback("onOpenChange",h),p.useContextCallback("onOpenChangeComplete",c);const S=p.useState("open"),u=!n&&S,b=p.useState("activeTriggerId"),k=p.useState("mounted"),C=p.useState("payload");p.useSyncedValues({trackCursorAxis:d,disableHoverablePopup:f,disabled:n}),Gt(p,{closeOnActiveTriggerUnmount:!0});const{forceUnmount:v,transitionStatus:y}=Vt(u,p),P=p.useState("isInstantPhase"),l=p.useState("instantType"),N=p.useState("lastOpenChangeReason"),R=o.useRef(null);z(()=>{S&&n&&p.setOpen(!1,B(ps))},[S,n,p]),z(()=>{y==="ending"&&N===Fe||y!=="ending"&&P?(l!=="delay"&&(R.current=l),p.set("instantType","delay")):R.current!==null&&(p.set("instantType",R.current),R.current=null)},[y,P,N,l,p]),z(()=>{u&&b==null&&p.set("payload",void 0)},[p,b,u]),o.useImperativeHandle(i,()=>({unmount:v,close:()=>p.setOpen(!1,B(gs))}),[v,p]);const L=u||k||!n&&d!=="none";return e.jsxs(Je.Provider,{value:p,children:[g&&e.jsx(Kt,{handle:g,store:p}),L&&e.jsx(xn,{store:p,disabled:n,trackCursorAxis:d}),typeof m=="function"?m({payload:C}):m]})});function xn({store:t,disabled:s,trackCursorAxis:n}){const a=t.useState("floatingRootContext"),r=Yt(a,{enabled:!s,referencePress:()=>t.select("closeOnClick")}),f=sn(a,{enabled:!s&&n!=="none",axis:n==="none"?void 0:n}),d=o.useMemo(()=>be(f.reference,r.reference),[f.reference,r.reference]);return Wt(t,{activeTriggerProps:d,inactiveTriggerProps:d,popupProps:r.floating??xt}),null}const mn=o.createContext(void 0);function bn(){return o.useContext(mn)}const Oe=600,Ze="data-base-ui-tooltip-trigger";function Ie(t){if("composedPath"in t){const n=t.composedPath();for(let a=0;a<n.length;a+=1){const r=n[a];if(ge(r))return r}}const s=t.target;return ge(s)?s:null}function vn(t){let s=t;for(;s;){const n=s.closest(`[${Ze}]`);if(n)return n;const a=s.getRootNode();s="host"in a&&ge(a.host)?a.host:null}return null}const jn=Xt(function(s,n){const{render:a,className:r,style:f,handle:d,payload:i,disabled:h,delay:c,closeOnClick:g=!0,closeDelay:j,id:x,...m}=s,p=K(!0),u=ms(d)??p;if(!u)throw new Error(se(82));const b=fs(x),k=u.useState("isTriggerActive",b),C=u.useState("isOpenedByTrigger",b),v=u.useState("floatingRootContext"),y=o.useRef(null),P=c??Oe,l=j??0,{registerTrigger:N,isMountedByThisTrigger:R}=Qt(b,y,u,{payload:i,closeOnClick:g,closeDelay:l}),L=bn(),{delayRef:$,isInstantPhase:F,hasProvider:M}=en(v,{open:C}),U=bs(v);u.useSyncedValue("isInstantPhase",F);const ie=u.useState("disabled"),q=h??ie,Ce=Jt(q),ke=u.useState("trackCursorAxis"),rt=u.useState("disableHoverablePopup"),G=o.useRef(!1),Y=Zt(),W=o.useRef(void 0);function Ne(){return M?he($.current,"open")===0?0:c??L??Oe:P}function Te(T){const A=y.current;if(!A||!T)return!1;const H=vn(T);return H!==null&&H!==A&&fe(A,H)}function ot(T){const A=Te(T);return G.current=A,A&&(U.openChangeTimeout.clear(),U.restTimeout.clear(),U.restTimeoutPending=!1,Y.clear()),A}const it=vs(v,{enabled:!q,mouseOnly:!0,move:!1,handleClose:!rt&&ke!=="both"?js():null,restMs:Ne,delay(){return j==null&&M?{close:he($.current,"close")}:{close:l}},triggerElementRef:y,isActiveTrigger:k,isClosing:()=>u.select("transitionStatus")==="ending",shouldOpen(){return!G.current}}),lt=ys(v,{enabled:!q}).reference,dt=T=>{const A=G.current,H=Ie(T),Pe=ot(H),X=y.current,ut=X&&H&&fe(X,H);if(Pe&&u.select("open")&&u.select("lastOpenChangeReason")===de){u.setOpen(!1,B(de,T));return}if(A&&!Pe&&ut&&!Ce.current&&!u.select("open")&&X&&ze(W.current)){const Re=()=>{!G.current&&!Ce.current&&!u.select("open")&&u.setOpen(!0,B(de,T,X))},Me=Ne();Me===0?(Y.clear(),Re()):Y.start(Me,Re)}},ct=u.useState("triggerProps",R);return ve("button",s,{state:{open:C},ref:[n,N,y],props:[it,lt,R||ke!=="none"?ct:void 0,{onMouseOver(T){dt(T.nativeEvent)},onFocus(T){Te(Ie(T.nativeEvent))&&T.preventBaseUIHandler()},onMouseLeave(){G.current=!1,Y.clear(),W.current=void 0},onPointerEnter(T){W.current=T.pointerType},onPointerDown(T){W.current=T.pointerType,u.set("closeOnClick",g),g&&!u.select("open")&&u.cancelPendingOpen(T.nativeEvent)},onClick(T){g&&!u.select("open")&&u.cancelPendingOpen(T.nativeEvent)},id:b,"data-trigger-disabled":q?"":void 0,[Ze]:q?void 0:""},m],stateAttributesMapping:es})}),et=o.createContext(void 0);function yn(){const t=o.useContext(et);if(t===void 0)throw new Error(se(70));return t}const Sn=o.forwardRef(function(s,n){const{children:a,container:r,className:f,render:d,style:i,...h}=s,{node:c,subtree:g}=ts({container:r,ref:n,componentProps:s,elementProps:h});return!g&&!c?null:e.jsxs(o.Fragment,{children:[g,c&&mt.createPortal(a,c)]})}),wn=o.forwardRef(function(s,n){const{keepMounted:a=!1,...r}=s;return K().useState("mounted")||a?e.jsx(et.Provider,{value:a,children:e.jsx(Sn,{ref:n,...r})}):null}),tt=o.createContext(void 0);function st(){const t=o.useContext(tt);if(t===void 0)throw new Error(se(71));return t}const Cn=o.forwardRef(function(s,n){const{render:a,className:r,anchor:f,positionMethod:d="absolute",side:i="top",align:h="center",sideOffset:c=0,alignOffset:g=0,collisionBoundary:j="clipping-ancestors",collisionPadding:x=5,arrowPadding:m=5,sticky:p=!1,disableAnchorTracking:S=!1,collisionAvoidance:u=ss,style:b,...k}=s,C=K(),v=yn(),y=C.useState("open"),P=C.useState("mounted"),l=C.useState("trackCursorAxis"),N=C.useState("disableHoverablePopup"),R=C.useState("floatingRootContext"),L=C.useState("instantType"),$=C.useState("transitionStatus"),F=C.useState("adaptiveOrigin"),M=Ss({anchor:f,positionMethod:d,floatingRootContext:R,mounted:P,side:i,sideOffset:c,align:h,alignOffset:g,collisionBoundary:j,collisionPadding:x,sticky:p,arrowPadding:m,disableAnchorTracking:S,keepMounted:v,collisionAvoidance:u,adaptiveOrigin:F}),U=o.useMemo(()=>({open:y,side:M.side,align:M.align,anchorHidden:M.anchorHidden,instant:l!=="none"?"tracking-cursor":L}),[y,M.side,M.align,M.anchorHidden,l,L]),ie=ws(s,U,{styles:M.positionerStyles,transitionStatus:$,props:k,refs:[n,C.useStateSetter("positionerElement")],hidden:!P,inert:!y||l==="both"||N});return e.jsx(tt.Provider,{value:M,children:ie})}),kn=o.forwardRef(function(s,n){const{render:a,className:r,style:f,...d}=s,i=K(),{side:h,align:c}=st(),g=i.useState("open"),j=i.useState("instantType"),x=i.useState("transitionStatus"),m=i.useState("popupProps"),p=i.useState("floatingRootContext"),S=i.useState("disabled"),u=i.useState("closeDelay");ns({open:g,ref:i.context.popupRef,onComplete(){g&&i.context.onOpenChangeComplete?.(!0)}}),Cs(p,{enabled:!S,closeDelay:u});const b=i.useStateSetter("popupElement");return ve("div",s,{state:{open:g,side:h,align:c,instant:j,transitionStatus:x},ref:[n,i.context.popupRef,b],props:[as,m,ks(x),d],stateAttributesMapping:rs})}),Nn=o.forwardRef(function(s,n){const{render:a,className:r,style:f,...d}=s,i=K(),{arrowRef:h,side:c,align:g,arrowUncentered:j,arrowStyles:x}=st(),m=i.useState("open"),p=i.useState("instantType");return ve("div",s,{state:{open:m,side:c,align:g,uncentered:j,instant:p},ref:[n,h],props:[{style:x,"aria-hidden":!0},d],stateAttributesMapping:os})});function Tn({...t}){return e.jsx(hn,{"data-slot":"tooltip",...t})}function Pn({...t}){return e.jsx(jn,{"data-slot":"tooltip-trigger",...t})}function Rn({className:t,side:s="top",sideOffset:n=4,align:a="center",alignOffset:r=0,children:f,...d}){return e.jsx(wn,{children:e.jsx(Cn,{align:a,alignOffset:r,side:s,sideOffset:n,className:"isolate z-50",children:e.jsxs(kn,{"data-slot":"tooltip-content",className:w("z-50 inline-flex w-fit max-w-xs origin-(--transform-origin) items-center gap-1.5 rounded-md bg-foreground px-3 py-1.5 text-xs text-background has-data-[slot=kbd]:pr-1.5 data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-left-2 data-[side=inline-start]:slide-in-from-right-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 **:data-[slot=kbd]:relative **:data-[slot=kbd]:isolate **:data-[slot=kbd]:z-50 **:data-[slot=kbd]:rounded-sm data-[state=delayed-open]:animate-in data-[state=delayed-open]:fade-in-0 data-[state=delayed-open]:zoom-in-95 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95",t),...d,children:[f,e.jsx(Nn,{className:"z-50 size-2.5 translate-y-[calc(-50%-2px)] rotate-45 rounded-[2px] bg-foreground fill-foreground data-[side=bottom]:top-1 data-[side=inline-end]:top-1/2! data-[side=inline-end]:-left-1 data-[side=inline-end]:-translate-y-1/2 data-[side=inline-start]:top-1/2! data-[side=inline-start]:-right-1 data-[side=inline-start]:-translate-y-1/2 data-[side=left]:top-1/2! data-[side=left]:-right-1 data-[side=left]:-translate-y-1/2 data-[side=right]:top-1/2! data-[side=right]:-left-1 data-[side=right]:-translate-y-1/2 data-[side=top]:-bottom-2.5"})]})})})}const Mn="sidebar_state",En=3600*24*7,On="16rem",In="18rem",Dn="3rem",An="b",nt=o.createContext(null);function we(){const t=o.useContext(nt);if(!t)throw new Error("useSidebar must be used within a SidebarProvider.");return t}function _n({defaultOpen:t=!0,open:s,onOpenChange:n,className:a,style:r,children:f,...d}){const i=Qs(),[h,c]=o.useState(!1),[g,j]=o.useState(t),x=s??g,m=o.useCallback(b=>{const k=typeof b=="function"?b(x):b;n?n(k):j(k),document.cookie=`${Mn}=${k}; path=/; max-age=${En}`},[n,x]),p=o.useCallback(()=>i?c(b=>!b):m(b=>!b),[i,m,c]);o.useEffect(()=>{const b=k=>{k.key===An&&(k.metaKey||k.ctrlKey)&&(k.preventDefault(),p())};return window.addEventListener("keydown",b),()=>window.removeEventListener("keydown",b)},[p]);const S=x?"expanded":"collapsed",u=o.useMemo(()=>({state:S,open:x,setOpen:m,isMobile:i,openMobile:h,setOpenMobile:c,toggleSidebar:p}),[S,x,m,i,h,c,p]);return e.jsx(nt.Provider,{value:u,children:e.jsx("div",{"data-slot":"sidebar-wrapper",style:{"--sidebar-width":On,"--sidebar-width-icon":Dn,...r},className:w("group/sidebar-wrapper flex min-h-svh w-full has-data-[variant=inset]:bg-sidebar",a),...d,children:f})})}function Hn({side:t="left",variant:s="sidebar",collapsible:n="offcanvas",className:a,children:r,dir:f,...d}){const{isMobile:i,state:h,openMobile:c,setOpenMobile:g}=we();return n==="none"?e.jsx("div",{"data-slot":"sidebar",className:w("flex h-full w-(--sidebar-width) flex-col bg-sidebar text-sidebar-foreground",a),...d,children:r}):i?e.jsx(nn,{open:c,onOpenChange:g,...d,children:e.jsxs(on,{dir:f,"data-sidebar":"sidebar","data-slot":"sidebar","data-mobile":"true",className:"w-(--sidebar-width) bg-sidebar p-0 text-sidebar-foreground [&>button]:hidden",style:{"--sidebar-width":In},side:t,children:[e.jsxs(ln,{className:"sr-only",children:[e.jsx(dn,{children:"Sidebar"}),e.jsx(cn,{children:"Displays the mobile sidebar."})]}),e.jsx("div",{className:"flex h-full w-full flex-col",children:r})]})}):e.jsxs("div",{className:"group peer hidden text-sidebar-foreground md:block","data-state":h,"data-collapsible":h==="collapsed"?n:"","data-variant":s,"data-side":t,"data-slot":"sidebar",children:[e.jsx("div",{"data-slot":"sidebar-gap",className:w("relative w-(--sidebar-width) bg-transparent transition-[width] duration-200 ease-linear","group-data-[collapsible=offcanvas]:w-0","group-data-[side=right]:rotate-180",s==="floating"||s==="inset"?"group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4)))]":"group-data-[collapsible=icon]:w-(--sidebar-width-icon)")}),e.jsx("div",{"data-slot":"sidebar-container","data-side":t,className:w("fixed inset-y-0 z-10 hidden h-svh w-(--sidebar-width) transition-[left,right,width] duration-200 ease-linear data-[side=left]:left-0 data-[side=left]:group-data-[collapsible=offcanvas]:left-[calc(var(--sidebar-width)*-1)] data-[side=right]:right-0 data-[side=right]:group-data-[collapsible=offcanvas]:right-[calc(var(--sidebar-width)*-1)] md:flex",s==="floating"||s==="inset"?"p-2 group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4))+2px)]":"group-data-[collapsible=icon]:w-(--sidebar-width-icon) group-data-[side=left]:border-r group-data-[side=right]:border-l",a),...d,children:e.jsx("div",{"data-sidebar":"sidebar","data-slot":"sidebar-inner",className:"flex size-full flex-col bg-sidebar group-data-[variant=floating]:rounded-lg group-data-[variant=floating]:shadow-sm group-data-[variant=floating]:ring-1 group-data-[variant=floating]:ring-sidebar-border",children:r})})]})}function zn({className:t,onClick:s,...n}){const{toggleSidebar:a}=we();return e.jsxs(J,{"data-sidebar":"trigger","data-slot":"sidebar-trigger",variant:"ghost",size:"icon-sm",className:w(t),onClick:r=>{s?.(r),a()},...n,children:[e.jsx(Ys,{}),e.jsx("span",{className:"sr-only",children:"Toggle Sidebar"})]})}function Ln({className:t,...s}){return e.jsx("main",{"data-slot":"sidebar-inset",className:w("relative flex w-full flex-1 flex-col bg-background md:peer-data-[variant=inset]:m-2 md:peer-data-[variant=inset]:ml-0 md:peer-data-[variant=inset]:rounded-xl md:peer-data-[variant=inset]:shadow-sm md:peer-data-[variant=inset]:peer-data-[state=collapsed]:ml-2",t),...s})}function $n({className:t,...s}){return e.jsx("div",{"data-slot":"sidebar-header","data-sidebar":"header",className:w("flex flex-col gap-2 p-2",t),...s})}function Bn({className:t,...s}){return e.jsx("div",{"data-slot":"sidebar-footer","data-sidebar":"footer",className:w("flex flex-col gap-2 p-2",t),...s})}function Fn({className:t,...s}){return e.jsx("div",{"data-slot":"sidebar-content","data-sidebar":"content",className:w("no-scrollbar flex min-h-0 flex-1 flex-col gap-0 overflow-auto group-data-[collapsible=icon]:overflow-hidden",t),...s})}function De({className:t,...s}){return e.jsx("div",{"data-slot":"sidebar-group","data-sidebar":"group",className:w("relative flex w-full min-w-0 flex-col p-2",t),...s})}function Un({className:t,render:s,...n}){return qe({defaultTagName:"div",props:be({className:w("flex h-8 shrink-0 items-center rounded-md px-2 text-xs font-medium text-sidebar-foreground/70 ring-sidebar-ring outline-hidden transition-[margin,opacity] duration-200 ease-linear group-data-[collapsible=icon]:-mt-8 group-data-[collapsible=icon]:opacity-0 focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0",t)},n),render:s,state:{slot:"sidebar-group-label",sidebar:"group-label"}})}function Ae({className:t,...s}){return e.jsx("div",{"data-slot":"sidebar-group-content","data-sidebar":"group-content",className:w("w-full text-sm",t),...s})}function pe({className:t,...s}){return e.jsx("ul",{"data-slot":"sidebar-menu","data-sidebar":"menu",className:w("flex w-full min-w-0 flex-col gap-0",t),...s})}function E({className:t,...s}){return e.jsx("li",{"data-slot":"sidebar-menu-item","data-sidebar":"menu-item",className:w("group/menu-item relative",t),...s})}const qn=bt("peer/menu-button group/menu-button flex w-full items-center gap-2 overflow-hidden rounded-md p-2 text-left text-sm ring-sidebar-ring outline-hidden transition-[width,height,padding] group-has-data-[sidebar=menu-action]/menu-item:pr-8 group-data-[collapsible=icon]:size-8! group-data-[collapsible=icon]:p-2! hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 data-open:hover:bg-sidebar-accent data-open:hover:text-sidebar-accent-foreground data-active:bg-sidebar-accent data-active:font-medium data-active:text-sidebar-accent-foreground [&_svg]:size-4 [&_svg]:shrink-0 [&>span:last-child]:truncate",{variants:{variant:{default:"hover:bg-sidebar-accent hover:text-sidebar-accent-foreground",outline:"bg-background shadow-[0_0_0_1px_var(--sidebar-border)] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground hover:shadow-[0_0_0_1px_var(--sidebar-accent)]"},size:{default:"h-8 text-sm",sm:"h-7 text-xs",lg:"h-12 text-sm group-data-[collapsible=icon]:p-0!"}},defaultVariants:{variant:"default",size:"default"}});function O({render:t,isActive:s=!1,variant:n="default",size:a="default",tooltip:r,className:f,...d}){const{isMobile:i,state:h}=we(),c=qe({defaultTagName:"button",props:be({className:w(qn({variant:n,size:a}),f)},d),render:r?e.jsx(Pn,{render:t}):t,state:{slot:"sidebar-menu-button",sidebar:"menu-button",size:a,active:s}});return r?(typeof r=="string"&&(r={children:r}),e.jsxs(Tn,{children:[c,e.jsx(Rn,{side:"right",align:"center",hidden:h!=="collapsed"||i,...r})]})):c}function Gn({className:t,...s}){return e.jsx("div",{"data-slot":"sidebar-menu-badge","data-sidebar":"menu-badge",className:w("pointer-events-none absolute right-1 flex h-5 min-w-5 items-center justify-center rounded-md px-1 text-xs font-medium text-sidebar-foreground tabular-nums select-none group-data-[collapsible=icon]:hidden peer-hover/menu-button:text-sidebar-accent-foreground peer-data-[size=default]/menu-button:top-1.5 peer-data-[size=lg]/menu-button:top-2.5 peer-data-[size=sm]/menu-button:top-1 peer-data-active/menu-button:text-sidebar-accent-foreground",t),...s})}function Vn({open:t,onOpenChange:s}){const n=Ge(),a=ne(),[r,f]=o.useState(""),[d,i]=o.useState(0),h=o.useRef(null),c=r.trim(),[g,j]=o.useState("");o.useEffect(()=>{const l=setTimeout(()=>j(c),180);return()=>clearTimeout(l)},[c]);const x=He({queryKey:["activity","search",g],queryFn:()=>Z.activity({q:g,status:"all",limit:8}),enabled:t&&g.length>=2,staleTime:3e4});o.useEffect(()=>{t||(f(""),i(0))},[t]);const m=o.useMemo(()=>[{id:"s:sites",label:"Sites",icon:e.jsx(te,{className:"size-4"}),go:()=>void a({to:"/sites"})},{id:"s:activity",label:"Activity",hint:"every site, newest first",icon:e.jsx(Ke,{className:"size-4"}),go:()=>void a({to:"/activity"})},{id:"s:members",label:"Members",icon:e.jsx(xe,{className:"size-4"}),go:()=>void a({to:"/studio/members"})},{id:"s:integrations",label:"Integrations",icon:e.jsx(Ye,{className:"size-4"}),go:()=>void a({to:"/studio/integrations"})},{id:"s:studio",label:"Studio settings",icon:e.jsx(ye,{className:"size-4"}),go:()=>void a({to:"/studio"})},{id:"s:you",label:"You",icon:e.jsx(Qe,{className:"size-4"}),go:()=>void a({to:"/you"})}],[a]),p=o.useMemo(()=>n.projects.map(l=>({id:`p:${l.uid}`,label:l.name,hint:l.unresolved>0?`${l.unresolved} open`:"nothing open",icon:e.jsx(me,{className:"size-4"}),go:()=>void a({to:"/s/$site/comments",params:{site:l.uid}})})),[n.projects,a]),S=l=>!c||l.toLowerCase().includes(c.toLowerCase()),u=[],b=p.filter(l=>S(l.label)),k=m.filter(l=>S(l.label));b.length&&u.push({title:"Sites",items:b}),k.length&&u.push({title:"Go to",items:k});const C=(x.data?.data??[]).map(l=>({id:`t:${l.id}`,label:l.latest?.body?.trim()||l.route,hint:`${l.site.name} · ${Ms(l.status)?Rs[l.status]:l.status} · ${l.key}`,icon:e.jsx(me,{className:"size-4"}),go:()=>void a({to:"/s/$site/comments",params:{site:l.site.uid},search:{thread:l.key}})}));C.length&&u.push({title:"Comments",items:C});const v=u.flatMap(l=>l.items),y=Math.min(d,Math.max(0,v.length-1)),P=l=>{l&&(s(!1),l.go())};return o.useEffect(()=>{h.current?.querySelector(`[data-at="${y}"]`)?.scrollIntoView({block:"nearest"})},[y]),e.jsx(Le,{open:t,onOpenChange:s,children:e.jsxs($e,{showCloseButton:!1,className:"top-[15%] max-h-[70dvh] translate-y-0 gap-0 overflow-hidden p-0 sm:max-w-lg",children:[e.jsx(Be,{className:"sr-only",children:"Search and go"}),e.jsxs("div",{className:"flex items-center gap-2 border-b border-border px-3",children:[e.jsx(Ue,{className:"size-4 shrink-0 text-muted-foreground"}),e.jsx("input",{autoFocus:!0,value:r,onChange:l=>{f(l.target.value),i(0)},onKeyDown:l=>{l.key==="ArrowDown"?(l.preventDefault(),i(N=>Math.min(N+1,v.length-1))):l.key==="ArrowUp"?(l.preventDefault(),i(N=>Math.max(N-1,0))):l.key==="Enter"&&(l.preventDefault(),P(v[y]))},placeholder:"Go to a site or a screen, or search every comment…","aria-label":"Search and go",className:"h-11 w-full bg-transparent text-[14px] outline-none placeholder:text-muted-foreground"})]}),e.jsxs("div",{ref:h,className:"min-h-0 flex-1 overflow-auto py-1.5",children:[v.length===0&&e.jsx("p",{className:"m-0 px-3 py-6 text-center text-[13px] text-muted-foreground",children:x.isFetching?"Looking…":c?`Nothing matches “${c}”.`:"Nothing here."}),u.map(l=>e.jsxs("div",{children:[e.jsx("div",{className:"px-3 py-1 text-[11px] font-medium uppercase tracking-wide text-muted-foreground",children:l.title}),l.items.map(N=>{const R=v.indexOf(N);return e.jsxs("button",{type:"button","data-at":R,onMouseMove:()=>i(R),onClick:()=>P(N),className:w("flex w-full items-center gap-2.5 border-0 bg-transparent px-3 py-2 text-left text-[13px] text-foreground",R===y&&"bg-muted"),children:[e.jsx("span",{className:"shrink-0 text-muted-foreground",children:N.icon}),e.jsx("span",{className:"min-w-0 flex-1 truncate",children:N.label}),N.hint&&e.jsx("span",{className:"shrink-0 text-[12px] text-muted-foreground",children:N.hint})]},N.id)})]},l.title)),x.isFetching&&v.length>0&&e.jsx("p",{className:"m-0 px-3 py-1.5 text-[12px] text-muted-foreground",children:"Searching every site…"})]})]})})}function Kn(){const[t,s]=o.useState(!1);return o.useEffect(()=>{const n=a=>{a.key.toLowerCase()!=="k"||!(a.metaKey||a.ctrlKey)||(a.preventDefault(),s(r=>!r))};return document.addEventListener("keydown",n),()=>document.removeEventListener("keydown",n)},[]),[t,s]}const at="https://snagset.com/docs/",Yn="https://www.npmjs.com/package/@snagset/server?activeTab=versions",Wn="https://snagset.com/docs/self-hosting/#upgrade";function Xn({children:t}){const s=Ge(),n=vt(s),[a,r]=Kn();return e.jsxs(_n,{children:[e.jsx(Qn,{me:s,site:n}),e.jsxs(Ln,{className:"min-w-0",children:[e.jsx(sa,{onSearch:()=>r(!0)}),e.jsx("div",{className:"min-h-0 flex-1",children:t})]}),e.jsx(Vn,{open:a,onOpenChange:r})]})}function Qn({me:t,site:s}){const n=_s({select:r=>r.location.pathname}),a=r=>n===r||n.startsWith(r+"/");return e.jsxs(Hn,{children:[e.jsx($n,{className:"px-3 pb-1 pt-3",children:e.jsx(Jn,{me:t})}),e.jsxs(Fn,{children:[e.jsxs(De,{children:[e.jsx(Zn,{me:t,site:s}),s&&e.jsx(Ae,{children:e.jsxs(pe,{children:[e.jsxs(E,{children:[e.jsxs(O,{isActive:a(`/s/${s.uid}/comments`),render:e.jsx(_,{to:"/s/$site/comments",params:{site:s.uid}}),children:[e.jsx(me,{}),e.jsx("span",{children:"Comments"})]}),s.unresolved>0&&e.jsx(Gn,{children:s.unresolved})]}),e.jsx(E,{children:e.jsxs(O,{isActive:a(`/s/${s.uid}/reviewers`),render:e.jsx(_,{to:"/s/$site/reviewers",params:{site:s.uid}}),children:[e.jsx(xe,{}),e.jsx("span",{children:"Reviewers"})]})}),e.jsx(E,{children:e.jsxs(O,{isActive:a(`/s/${s.uid}/settings`),render:e.jsx(_,{to:"/s/$site/settings",params:{site:s.uid}}),children:[e.jsx(Xe,{}),e.jsx("span",{children:"Settings"})]})})]})})]}),e.jsxs(De,{children:[e.jsx(Un,{children:"Studio"}),e.jsx(Ae,{children:e.jsxs(pe,{children:[e.jsx(E,{children:e.jsxs(O,{isActive:a("/sites"),render:e.jsx(_,{to:"/sites"}),children:[e.jsx(te,{}),e.jsx("span",{children:"Sites"})]})}),e.jsx(E,{children:e.jsxs(O,{isActive:a("/activity"),render:e.jsx(_,{to:"/activity"}),children:[e.jsx(Ke,{}),e.jsx("span",{children:"Activity"})]})}),e.jsx(E,{children:e.jsxs(O,{isActive:a("/studio/members"),render:e.jsx(_,{to:"/studio/members"}),children:[e.jsx(xe,{}),e.jsx("span",{children:"Members"})]})}),e.jsx(E,{children:e.jsxs(O,{isActive:a("/studio/integrations"),render:e.jsx(_,{to:"/studio/integrations"}),children:[e.jsx(Ye,{}),e.jsx("span",{children:"Integrations"})]})}),e.jsx(E,{children:e.jsxs(O,{isActive:n==="/studio",render:e.jsx(_,{to:"/studio"}),children:[e.jsx(ye,{}),e.jsx("span",{children:"General"})]})})]})})]})]}),e.jsx(Bn,{children:e.jsxs(pe,{children:[e.jsx(E,{children:e.jsxs(O,{render:e.jsx("a",{href:at,target:"_blank",rel:"noreferrer"}),children:[e.jsx(We,{}),e.jsx("span",{children:"Docs"}),e.jsx(Q,{className:"ml-auto size-3.5 text-muted-foreground"})]})}),e.jsx(E,{children:e.jsx(ea,{})}),e.jsx(E,{children:e.jsx(ta,{me:t})})]})})]})}function Jn({me:t}){const s=ne(),n=_e(),[a,r]=o.useState(!1),[f,d]=o.useState(""),[i,h]=o.useState(""),[c,g]=o.useState(!1),j=e.jsxs(e.Fragment,{children:[e.jsx(yt,{size:20}),e.jsxs("span",{className:"min-w-0 flex-1 text-left",children:[e.jsx("span",{className:"block truncate text-[14px] font-semibold leading-tight tracking-tight",children:t.org.name}),e.jsx("span",{className:"block truncate text-[11.5px] text-muted-foreground",children:location.host})]})]});if(t.orgs.length<=1&&!t.signupOpen)return e.jsx(_,{to:"/studio",className:"flex items-center gap-2.5 rounded-md px-1 py-0.5 text-foreground hover:bg-sidebar-accent","aria-label":`${t.org.name} — studio settings`,children:j});const x=async m=>{g(!0),h("");try{await m(),n.clear(),r(!1),d(""),s({to:"/sites",replace:!0})}catch(p){h(p instanceof Error?p.message:"Something went wrong. Try again.")}finally{g(!1)}};return e.jsxs(e.Fragment,{children:[e.jsxs(ae,{children:[e.jsxs(re,{render:e.jsx("button",{type:"button",className:"flex w-full items-center gap-2.5 rounded-md px-1 py-0.5 text-foreground hover:bg-sidebar-accent","aria-label":"Switch studio"}),children:[j,e.jsx(Se,{className:"size-3.5 shrink-0 text-muted-foreground"})]}),e.jsxs(oe,{align:"start",className:"w-[240px]",children:[e.jsxs(je,{children:[e.jsx(ee,{children:"Studios"}),t.orgs.map(m=>e.jsxs(I,{disabled:m.current,onClick:()=>void x(()=>Z.switchOrg(m.slug)),children:[e.jsx(ye,{}),e.jsx("span",{className:"truncate",children:m.name}),m.current&&e.jsx("span",{className:"ml-auto text-[11px] text-muted-foreground",children:"current"})]},m.slug))]}),e.jsx(V,{}),e.jsxs(I,{onClick:()=>void s({to:"/studio"}),children:[e.jsx(Xe,{}),"Studio settings"]}),t.signupOpen&&e.jsxs(I,{onClick:()=>r(!0),children:[e.jsx(Ve,{}),"New studio…"]})]})]}),e.jsx(Le,{open:a,onOpenChange:m=>!c&&r(m),children:e.jsx($e,{className:"sm:max-w-[420px]",children:e.jsxs("form",{className:"flex flex-col gap-4",onSubmit:m=>{m.preventDefault(),x(()=>Z.createOrg(f.trim()||"My studio"))},children:[e.jsxs(is,{children:[e.jsx(Be,{children:"New studio"}),e.jsx(ls,{children:"Its own sites, members and settings. You are its owner, and you move to it now — this one stays in the menu."})]}),e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx(hs,{htmlFor:"new-studio-name",children:"Studio name"}),e.jsx(xs,{id:"new-studio-name",value:f,onChange:m=>d(m.target.value),placeholder:"My studio",autoFocus:!0})]}),i&&e.jsx("p",{className:"m-0 text-[12px] text-destructive",children:i}),e.jsxs(ds,{children:[e.jsx(J,{type:"button",variant:"outline",onClick:()=>r(!1),disabled:c,children:"Cancel"}),e.jsx(J,{type:"submit",disabled:c,children:c?"Creating…":"Create studio"})]})]})})})]})}function Zn({me:t,site:s}){const n=ne();return e.jsxs(ae,{children:[e.jsxs(re,{render:e.jsx("button",{type:"button",className:"mb-1 flex h-[34px] w-full items-center justify-between rounded-md border border-border bg-card px-2.5 text-[13px] font-semibold text-foreground","aria-label":"Switch site"}),children:[e.jsx("span",{className:"truncate",children:s?.name??"No sites yet"}),e.jsx(Se,{className:"size-3.5 text-muted-foreground"})]}),e.jsxs(oe,{align:"start",className:"w-[240px]",children:[e.jsxs(je,{children:[e.jsx(ee,{children:"Sites"}),t.projects.map(a=>e.jsxs(I,{onClick:()=>void n({to:"/s/$site/comments",params:{site:a.uid}}),children:[e.jsx(te,{}),e.jsx("span",{className:"truncate",children:a.name}),a.uid===s?.uid&&e.jsx("span",{className:"ml-auto text-[11px] text-muted-foreground",children:"current"})]},a.uid))]}),e.jsx(V,{}),e.jsxs(I,{onClick:()=>void n({to:"/sites",search:{add:!0}}),children:[e.jsx(Ve,{}),"Add a site"]}),e.jsxs(I,{onClick:()=>void n({to:"/sites"}),children:[e.jsx(te,{}),"All sites"]})]})]})}function ea(){const t=He(kt.meta()),s=t.data?.version??"",[n,a]=o.useState({state:"idle"}),r=async()=>{a({state:"checking"});try{a({state:"done",result:await Os(s)})}catch{a({state:"failed"})}};return e.jsxs(ae,{children:[e.jsxs(re,{render:e.jsx(O,{}),children:[e.jsx(Us,{}),e.jsx("span",{children:"Help"})]}),e.jsxs(oe,{align:"start",side:"top",className:"w-[240px]",children:[e.jsxs(I,{render:e.jsx("a",{href:at,target:"_blank",rel:"noreferrer"}),children:[e.jsx(We,{}),"Docs",e.jsx(Q,{className:"ml-auto size-3 text-muted-foreground"})]}),e.jsxs(I,{render:e.jsx("a",{href:Yn,target:"_blank",rel:"noreferrer"}),children:["Changelog",e.jsx(Q,{className:"ml-auto size-3 text-muted-foreground"})]}),t.data?.sourceUrl&&e.jsxs(I,{render:e.jsx("a",{href:t.data.sourceUrl,target:"_blank",rel:"noreferrer"}),children:["Source · AGPL",e.jsx(Q,{className:"ml-auto size-3 text-muted-foreground"})]}),e.jsx(V,{}),e.jsxs("div",{className:"px-2 py-1.5 text-[12px] text-muted-foreground",children:["Snagset ",s||"—",n.state==="idle"&&e.jsxs(e.Fragment,{children:[" · ",e.jsx("button",{type:"button",className:"text-brand hover:underline",onClick:()=>void r(),children:"Check for updates"})]}),n.state==="checking"&&" · checking…",n.state==="failed"&&" · could not reach npm",n.state==="done"&&n.result&&e.jsxs(e.Fragment,{children:[" · ",n.result.newer?e.jsxs("a",{href:Wn,target:"_blank",rel:"noreferrer",className:"text-brand hover:underline",children:[n.result.latest," is out — how to upgrade"]}):"up to date"]})]})]})]})}function ta({me:t}){const s=ne(),n=_e(),[a,r]=o.useState(St),f=t.user.name||t.user.email,d=t.user.name?t.user.email:t.user.role,i=async()=>{await Z.logout().catch(()=>{}),Ct("out"),n.clear(),s({to:"/sign-in",replace:!0})};return e.jsxs(ae,{children:[e.jsxs(re,{render:e.jsx(O,{size:"lg"}),children:[e.jsx(Ts,{className:"size-8 rounded-full",children:e.jsx(Ps,{className:"bg-primary text-[12px] font-semibold text-primary-foreground",children:Es(t.user.name,t.user.email)})}),e.jsxs("div",{className:"min-w-0 flex-1 text-left leading-tight",children:[e.jsx("div",{className:"truncate text-[13px] font-semibold",children:f}),e.jsx("div",{className:"truncate text-[11.5px] text-muted-foreground",children:d})]}),e.jsx(Se,{className:"size-3.5 text-muted-foreground"})]}),e.jsxs(oe,{align:"start",side:"top",className:"w-[250px]",children:[e.jsx(je,{children:e.jsxs(ee,{className:"flex flex-col",children:[e.jsx("span",{className:"text-[13px] font-semibold",children:f}),e.jsx("span",{className:"text-[11.5px] font-normal text-muted-foreground",children:t.user.name?`${t.user.email} · ${t.user.role}`:t.user.role})]})}),e.jsx(V,{}),e.jsxs(Ns,{value:a,onValueChange:h=>{const c=h;wt(c),r(c)},children:[e.jsx(ee,{children:"Theme"}),e.jsxs(ce,{value:"system",children:[e.jsx(Is,{}),"System"]}),e.jsxs(ce,{value:"light",children:[e.jsx(Ds,{}),"Light"]}),e.jsxs(ce,{value:"dark",children:[e.jsx(As,{}),"Dark"]})]}),e.jsx(V,{}),e.jsxs(I,{onClick:()=>void s({to:"/you"}),children:[e.jsx(Qe,{}),"You"]}),e.jsxs(I,{onClick:()=>void i(),children:[e.jsx(Gs,{}),"Sign out"]})]})]})}function sa({onSearch:t}){const n=jt().map(a=>a.loaderData?.crumb).filter(a=>typeof a=="string"&&a.length>0);return e.jsxs("div",{className:"flex h-12 shrink-0 items-center gap-2.5 border-b border-border/60 px-4",children:[e.jsx(zn,{className:"-ml-1"}),e.jsx("nav",{"aria-label":"Breadcrumb",className:"flex items-center gap-2 text-[13.5px] font-medium text-muted-foreground",children:n.map((a,r)=>e.jsxs("span",{className:"flex items-center gap-2",children:[r>0&&e.jsx("span",{className:"text-line-strong",children:"/"}),e.jsx("span",{className:r===n.length-1?"text-foreground":void 0,children:a})]},r))}),e.jsx("div",{className:"flex-1"}),e.jsxs("button",{type:"button",onClick:t,"aria-label":"Search and go",className:"flex h-7 items-center gap-2 rounded-md border border-border bg-card px-2 text-[12.5px] text-muted-foreground",children:[e.jsx(Ue,{className:"size-3.5"}),e.jsx("span",{className:"hidden sm:inline",children:"Search"}),e.jsx("kbd",{className:"hidden rounded border border-border px-1 font-mono text-[11px] sm:inline",children:"⌘K"})]})]})}const ka=()=>e.jsx(Xn,{children:e.jsx(Nt,{})});export{ka as component};
56
+ */const Xs=[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]],Qe=D("user",Xs),ue=768;function Qs(){const[t,s]=o.useState(void 0);return o.useEffect(()=>{const n=window.matchMedia(`(max-width: ${ue-1}px)`),a=()=>{s(window.innerWidth<ue)};return n.addEventListener("change",a),s(window.innerWidth<ue),()=>n.removeEventListener("change",a)},[]),!!t}const Js=o.createContext({hasProvider:!1,timeoutMs:0,delayRef:{current:0},initialDelayRef:{current:0},timeout:new Tt,currentIdRef:{current:null},currentContextRef:{current:null}});function Zs(t,s){t.current=s.current}function en(t,s={open:!1}){const{open:n}=s,a="rootStore"in t?t.rootStore:t,r=a.useState("floatingId"),f=o.useContext(Js),{currentIdRef:d,delayRef:i,timeoutMs:h,initialDelayRef:c,currentContextRef:g,hasProvider:j,timeout:x}=f,[m,p]=o.useState(!1),S=o.useRef(n);return z(()=>{S.current=n},[n]),z(()=>{function u(){g.current?.setIsInstantPhase(!1),d.current=null,g.current=null,i.current=c.current,x.clear()}if(d.current&&!n&&d.current===r){if(p(!1),h){const b=r;return x.start(h,()=>{a.select("open")||d.current&&d.current!==b||u()}),()=>{(S.current||d.current!==b)&&x.clear()}}u()}},[n,r,d,i,h,c,g,x,a]),z(()=>{if(!n)return;const u=g.current,b=d.current;x.clear(),g.current={onOpenChange:a.setOpen,setIsInstantPhase:p},d.current=r,i.current={open:0,close:he(c.current,"close")},b!==null&&b!==r?(p(!0),u?.setIsInstantPhase(!0),u?.onOpenChange(!1,B(Fe))):(p(!1),u?.setIsInstantPhase(!1))},[n,r,a,d,i,c,g,x]),z(()=>()=>{if(d.current===r){if(g.current=null,!S.current)return;d.current=null,Zs(i,c),x.clear()}},[g,d,i,r,c,x]),o.useMemo(()=>({hasProvider:j,delayRef:i,isInstantPhase:m}),[j,i,m])}function tn(t,s){let n=null,a=null,r=!1;return{contextElement:t||void 0,getBoundingClientRect(){const f=t?.getBoundingClientRect()||{width:0,height:0,x:0,y:0},d=s.axis==="x"||s.axis==="both",i=s.axis==="y"||s.axis==="both",h=["mouseenter","mousemove"].includes(s.dataRef.current.openEvent?.type||"")&&s.pointerType!=="touch";let c=f.width,g=f.height,j=f.x,x=f.y;return n==null&&s.x&&d&&(n=f.x-s.x),a==null&&s.y&&i&&(a=f.y-s.y),j-=n||0,x-=a||0,c=0,g=0,!r||h?(c=s.axis==="y"?f.width:0,g=s.axis==="x"?f.height:0,j=d&&s.x!=null?s.x:j,x=i&&s.y!=null?s.y:x):r&&!h&&(g=s.axis==="x"?f.height:g,c=s.axis==="y"?f.width:c),r=!0,{width:c,height:g,x:j,y:x,top:x,right:j+c,bottom:x+g,left:j}}}}function Ee(t){return t!=null&&t.clientX!=null}function sn(t,s={}){const{enabled:n=!0,axis:a="both"}=s,r="rootStore"in t?t.rootStore:t,f=r.useState("open"),d=r.useState("floatingElement"),i=r.useState("domReferenceElement"),h=r.context.dataRef,c=o.useRef(!1),g=o.useRef(null),[j,x]=o.useState(),[m,p]=o.useState([]),S=le(v=>{r.set("positionReference",v)}),u=le((v,y,P)=>{c.current||h.current.openEvent&&!Ee(h.current.openEvent)||r.set("positionReference",tn(P??i,{x:v,y,axis:a,dataRef:h,pointerType:j}))}),b=le(v=>{f?g.current||(u(v.clientX,v.clientY,v.currentTarget),p([])):u(v.clientX,v.clientY,v.currentTarget)}),k=ze(j)?d:f;o.useEffect(()=>{if(!n){S(i);return}if(!k)return;function v(){g.current?.(),g.current=null}const y=ht(d);function P(l){const N=cs(l);fe(d,N)?v():u(l.clientX,l.clientY)}return!h.current.openEvent||Ee(h.current.openEvent)?g.current=Pt(y,"mousemove",P):S(i),v},[k,n,d,h,i,r,u,S,m]),o.useEffect(()=>()=>{r.set("positionReference",null)},[r]),o.useEffect(()=>{n&&!d&&(c.current=!1)},[n,d]),o.useEffect(()=>{!n&&f&&(c.current=!0)},[n,f]);const C=o.useMemo(()=>{function v(y){x(y.pointerType)}return{onPointerDown:v,onPointerEnter:v,onMouseMove:b,onMouseEnter:b}},[b]);return o.useMemo(()=>n?{reference:C,trigger:C}:{},[n,C])}function nn({...t}){return e.jsx(Rt,{"data-slot":"sheet",...t})}function an({...t}){return e.jsx(At,{"data-slot":"sheet-portal",...t})}function rn({className:t,...s}){return e.jsx(_t,{"data-slot":"sheet-overlay",className:w("fixed inset-0 z-50 bg-black/10 transition-opacity duration-150 data-ending-style:opacity-0 data-starting-style:opacity-0 supports-backdrop-filter:backdrop-blur-xs",t),...s})}function on({className:t,children:s,side:n="right",showCloseButton:a=!0,...r}){return e.jsxs(an,{children:[e.jsx(rn,{}),e.jsxs(Mt,{"data-slot":"sheet-content","data-side":n,className:w("fixed z-50 flex flex-col gap-4 bg-popover bg-clip-padding text-sm text-popover-foreground shadow-lg transition duration-200 ease-in-out data-ending-style:opacity-0 data-starting-style:opacity-0 data-[side=bottom]:inset-x-0 data-[side=bottom]:bottom-0 data-[side=bottom]:h-auto data-[side=bottom]:border-t data-[side=bottom]:data-ending-style:translate-y-[2.5rem] data-[side=bottom]:data-starting-style:translate-y-[2.5rem] data-[side=left]:inset-y-0 data-[side=left]:left-0 data-[side=left]:h-full data-[side=left]:w-3/4 data-[side=left]:border-r data-[side=left]:data-ending-style:translate-x-[-2.5rem] data-[side=left]:data-starting-style:translate-x-[-2.5rem] data-[side=right]:inset-y-0 data-[side=right]:right-0 data-[side=right]:h-full data-[side=right]:w-3/4 data-[side=right]:border-l data-[side=right]:data-ending-style:translate-x-[2.5rem] data-[side=right]:data-starting-style:translate-x-[2.5rem] data-[side=top]:inset-x-0 data-[side=top]:top-0 data-[side=top]:h-auto data-[side=top]:border-b data-[side=top]:data-ending-style:translate-y-[-2.5rem] data-[side=top]:data-starting-style:translate-y-[-2.5rem] data-[side=left]:sm:max-w-sm data-[side=right]:sm:max-w-sm",t),...r,children:[s,a&&e.jsxs(Et,{"data-slot":"sheet-close",render:e.jsx(J,{variant:"ghost",className:"absolute top-3 right-3",size:"icon-sm"}),children:[e.jsx(Ot,{}),e.jsx("span",{className:"sr-only",children:"Close"})]})]})]})}function ln({className:t,...s}){return e.jsx("div",{"data-slot":"sheet-header",className:w("flex flex-col gap-0.5 p-4",t),...s})}function dn({className:t,...s}){return e.jsx(It,{"data-slot":"sheet-title",className:w("font-heading text-base font-medium text-foreground",t),...s})}function cn({className:t,...s}){return e.jsx(Dt,{"data-slot":"sheet-description",className:w("text-sm text-muted-foreground",t),...s})}const Je=o.createContext(void 0);function K(t){const s=o.useContext(Je);if(s===void 0&&!t)throw new Error(se(72));return s}const un={...zt,disabled:t=>t.disabled,instantType:t=>t.instantType,isInstantPhase:t=>t.isInstantPhase,trackCursorAxis:t=>t.trackCursorAxis,disableHoverablePopup:t=>t.disableHoverablePopup,lastOpenChangeReason:t=>t.openChangeReason,closeOnClick:t=>t.closeOnClick,closeDelay:t=>t.closeDelay,adaptiveOrigin:t=>t.adaptiveOrigin};class pn extends Ht{constructor(s,n,a){const r=new Ft;super(gn(s,r,n,a),fn(r),un)}setOpen=(s,n)=>{Lt(this,s,n,{extraState:{openChangeReason:n.reason}})};cancelPendingOpen(s){this.state.floatingRootContext.dispatchOpenChange(!1,B(us,s))}}function gn(t,s,n,a=!1){const r={...$t(),disabled:!1,instantType:void 0,isInstantPhase:!1,trackCursorAxis:"none",disableHoverablePopup:!1,openChangeReason:null,closeOnClick:!0,closeDelay:0,adaptiveOrigin:void 0,...t};return r.floatingRootContext=Bt(s,n,a),r}function fn(t){return{popupRef:o.createRef(),onOpenChange:void 0,onOpenChangeComplete:void 0,triggerElements:t}}const hn=Ut(function(s){const{disabled:n=!1,defaultOpen:a=!1,open:r,disableHoverablePopup:f=!1,trackCursorAxis:d="none",actionsRef:i,onOpenChange:h,onOpenChangeComplete:c,handle:g,triggerId:j,defaultTriggerId:x=null,children:m}=s,p=qt(($,F)=>new pn({open:a,openProp:r,activeTriggerId:x,triggerIdProp:j},$,F));p.useControlledProp("openProp",r),p.useControlledProp("triggerIdProp",j),p.useContextCallback("onOpenChange",h),p.useContextCallback("onOpenChangeComplete",c);const S=p.useState("open"),u=!n&&S,b=p.useState("activeTriggerId"),k=p.useState("mounted"),C=p.useState("payload");p.useSyncedValues({trackCursorAxis:d,disableHoverablePopup:f,disabled:n}),Gt(p,{closeOnActiveTriggerUnmount:!0});const{forceUnmount:v,transitionStatus:y}=Vt(u,p),P=p.useState("isInstantPhase"),l=p.useState("instantType"),N=p.useState("lastOpenChangeReason"),R=o.useRef(null);z(()=>{S&&n&&p.setOpen(!1,B(ps))},[S,n,p]),z(()=>{y==="ending"&&N===Fe||y!=="ending"&&P?(l!=="delay"&&(R.current=l),p.set("instantType","delay")):R.current!==null&&(p.set("instantType",R.current),R.current=null)},[y,P,N,l,p]),z(()=>{u&&b==null&&p.set("payload",void 0)},[p,b,u]),o.useImperativeHandle(i,()=>({unmount:v,close:()=>p.setOpen(!1,B(gs))}),[v,p]);const L=u||k||!n&&d!=="none";return e.jsxs(Je.Provider,{value:p,children:[g&&e.jsx(Kt,{handle:g,store:p}),L&&e.jsx(xn,{store:p,disabled:n,trackCursorAxis:d}),typeof m=="function"?m({payload:C}):m]})});function xn({store:t,disabled:s,trackCursorAxis:n}){const a=t.useState("floatingRootContext"),r=Yt(a,{enabled:!s,referencePress:()=>t.select("closeOnClick")}),f=sn(a,{enabled:!s&&n!=="none",axis:n==="none"?void 0:n}),d=o.useMemo(()=>be(f.reference,r.reference),[f.reference,r.reference]);return Wt(t,{activeTriggerProps:d,inactiveTriggerProps:d,popupProps:r.floating??xt}),null}const mn=o.createContext(void 0);function bn(){return o.useContext(mn)}const Oe=600,Ze="data-base-ui-tooltip-trigger";function Ie(t){if("composedPath"in t){const n=t.composedPath();for(let a=0;a<n.length;a+=1){const r=n[a];if(ge(r))return r}}const s=t.target;return ge(s)?s:null}function vn(t){let s=t;for(;s;){const n=s.closest(`[${Ze}]`);if(n)return n;const a=s.getRootNode();s="host"in a&&ge(a.host)?a.host:null}return null}const jn=Xt(function(s,n){const{render:a,className:r,style:f,handle:d,payload:i,disabled:h,delay:c,closeOnClick:g=!0,closeDelay:j,id:x,...m}=s,p=K(!0),u=ms(d)??p;if(!u)throw new Error(se(82));const b=fs(x),k=u.useState("isTriggerActive",b),C=u.useState("isOpenedByTrigger",b),v=u.useState("floatingRootContext"),y=o.useRef(null),P=c??Oe,l=j??0,{registerTrigger:N,isMountedByThisTrigger:R}=Qt(b,y,u,{payload:i,closeOnClick:g,closeDelay:l}),L=bn(),{delayRef:$,isInstantPhase:F,hasProvider:M}=en(v,{open:C}),U=bs(v);u.useSyncedValue("isInstantPhase",F);const ie=u.useState("disabled"),q=h??ie,Ce=Jt(q),ke=u.useState("trackCursorAxis"),rt=u.useState("disableHoverablePopup"),G=o.useRef(!1),Y=Zt(),W=o.useRef(void 0);function Ne(){return M?he($.current,"open")===0?0:c??L??Oe:P}function Te(T){const A=y.current;if(!A||!T)return!1;const H=vn(T);return H!==null&&H!==A&&fe(A,H)}function ot(T){const A=Te(T);return G.current=A,A&&(U.openChangeTimeout.clear(),U.restTimeout.clear(),U.restTimeoutPending=!1,Y.clear()),A}const it=vs(v,{enabled:!q,mouseOnly:!0,move:!1,handleClose:!rt&&ke!=="both"?js():null,restMs:Ne,delay(){return j==null&&M?{close:he($.current,"close")}:{close:l}},triggerElementRef:y,isActiveTrigger:k,isClosing:()=>u.select("transitionStatus")==="ending",shouldOpen(){return!G.current}}),lt=ys(v,{enabled:!q}).reference,dt=T=>{const A=G.current,H=Ie(T),Pe=ot(H),X=y.current,ut=X&&H&&fe(X,H);if(Pe&&u.select("open")&&u.select("lastOpenChangeReason")===de){u.setOpen(!1,B(de,T));return}if(A&&!Pe&&ut&&!Ce.current&&!u.select("open")&&X&&ze(W.current)){const Re=()=>{!G.current&&!Ce.current&&!u.select("open")&&u.setOpen(!0,B(de,T,X))},Me=Ne();Me===0?(Y.clear(),Re()):Y.start(Me,Re)}},ct=u.useState("triggerProps",R);return ve("button",s,{state:{open:C},ref:[n,N,y],props:[it,lt,R||ke!=="none"?ct:void 0,{onMouseOver(T){dt(T.nativeEvent)},onFocus(T){Te(Ie(T.nativeEvent))&&T.preventBaseUIHandler()},onMouseLeave(){G.current=!1,Y.clear(),W.current=void 0},onPointerEnter(T){W.current=T.pointerType},onPointerDown(T){W.current=T.pointerType,u.set("closeOnClick",g),g&&!u.select("open")&&u.cancelPendingOpen(T.nativeEvent)},onClick(T){g&&!u.select("open")&&u.cancelPendingOpen(T.nativeEvent)},id:b,"data-trigger-disabled":q?"":void 0,[Ze]:q?void 0:""},m],stateAttributesMapping:es})}),et=o.createContext(void 0);function yn(){const t=o.useContext(et);if(t===void 0)throw new Error(se(70));return t}const Sn=o.forwardRef(function(s,n){const{children:a,container:r,className:f,render:d,style:i,...h}=s,{node:c,subtree:g}=ts({container:r,ref:n,componentProps:s,elementProps:h});return!g&&!c?null:e.jsxs(o.Fragment,{children:[g,c&&mt.createPortal(a,c)]})}),wn=o.forwardRef(function(s,n){const{keepMounted:a=!1,...r}=s;return K().useState("mounted")||a?e.jsx(et.Provider,{value:a,children:e.jsx(Sn,{ref:n,...r})}):null}),tt=o.createContext(void 0);function st(){const t=o.useContext(tt);if(t===void 0)throw new Error(se(71));return t}const Cn=o.forwardRef(function(s,n){const{render:a,className:r,anchor:f,positionMethod:d="absolute",side:i="top",align:h="center",sideOffset:c=0,alignOffset:g=0,collisionBoundary:j="clipping-ancestors",collisionPadding:x=5,arrowPadding:m=5,sticky:p=!1,disableAnchorTracking:S=!1,collisionAvoidance:u=ss,style:b,...k}=s,C=K(),v=yn(),y=C.useState("open"),P=C.useState("mounted"),l=C.useState("trackCursorAxis"),N=C.useState("disableHoverablePopup"),R=C.useState("floatingRootContext"),L=C.useState("instantType"),$=C.useState("transitionStatus"),F=C.useState("adaptiveOrigin"),M=Ss({anchor:f,positionMethod:d,floatingRootContext:R,mounted:P,side:i,sideOffset:c,align:h,alignOffset:g,collisionBoundary:j,collisionPadding:x,sticky:p,arrowPadding:m,disableAnchorTracking:S,keepMounted:v,collisionAvoidance:u,adaptiveOrigin:F}),U=o.useMemo(()=>({open:y,side:M.side,align:M.align,anchorHidden:M.anchorHidden,instant:l!=="none"?"tracking-cursor":L}),[y,M.side,M.align,M.anchorHidden,l,L]),ie=ws(s,U,{styles:M.positionerStyles,transitionStatus:$,props:k,refs:[n,C.useStateSetter("positionerElement")],hidden:!P,inert:!y||l==="both"||N});return e.jsx(tt.Provider,{value:M,children:ie})}),kn=o.forwardRef(function(s,n){const{render:a,className:r,style:f,...d}=s,i=K(),{side:h,align:c}=st(),g=i.useState("open"),j=i.useState("instantType"),x=i.useState("transitionStatus"),m=i.useState("popupProps"),p=i.useState("floatingRootContext"),S=i.useState("disabled"),u=i.useState("closeDelay");ns({open:g,ref:i.context.popupRef,onComplete(){g&&i.context.onOpenChangeComplete?.(!0)}}),Cs(p,{enabled:!S,closeDelay:u});const b=i.useStateSetter("popupElement");return ve("div",s,{state:{open:g,side:h,align:c,instant:j,transitionStatus:x},ref:[n,i.context.popupRef,b],props:[as,m,ks(x),d],stateAttributesMapping:rs})}),Nn=o.forwardRef(function(s,n){const{render:a,className:r,style:f,...d}=s,i=K(),{arrowRef:h,side:c,align:g,arrowUncentered:j,arrowStyles:x}=st(),m=i.useState("open"),p=i.useState("instantType");return ve("div",s,{state:{open:m,side:c,align:g,uncentered:j,instant:p},ref:[n,h],props:[{style:x,"aria-hidden":!0},d],stateAttributesMapping:os})});function Tn({...t}){return e.jsx(hn,{"data-slot":"tooltip",...t})}function Pn({...t}){return e.jsx(jn,{"data-slot":"tooltip-trigger",...t})}function Rn({className:t,side:s="top",sideOffset:n=4,align:a="center",alignOffset:r=0,children:f,...d}){return e.jsx(wn,{children:e.jsx(Cn,{align:a,alignOffset:r,side:s,sideOffset:n,className:"isolate z-50",children:e.jsxs(kn,{"data-slot":"tooltip-content",className:w("z-50 inline-flex w-fit max-w-xs origin-(--transform-origin) items-center gap-1.5 rounded-md bg-foreground px-3 py-1.5 text-xs text-background has-data-[slot=kbd]:pr-1.5 data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-left-2 data-[side=inline-start]:slide-in-from-right-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 **:data-[slot=kbd]:relative **:data-[slot=kbd]:isolate **:data-[slot=kbd]:z-50 **:data-[slot=kbd]:rounded-sm data-[state=delayed-open]:animate-in data-[state=delayed-open]:fade-in-0 data-[state=delayed-open]:zoom-in-95 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95",t),...d,children:[f,e.jsx(Nn,{className:"z-50 size-2.5 translate-y-[calc(-50%-2px)] rotate-45 rounded-[2px] bg-foreground fill-foreground data-[side=bottom]:top-1 data-[side=inline-end]:top-1/2! data-[side=inline-end]:-left-1 data-[side=inline-end]:-translate-y-1/2 data-[side=inline-start]:top-1/2! data-[side=inline-start]:-right-1 data-[side=inline-start]:-translate-y-1/2 data-[side=left]:top-1/2! data-[side=left]:-right-1 data-[side=left]:-translate-y-1/2 data-[side=right]:top-1/2! data-[side=right]:-left-1 data-[side=right]:-translate-y-1/2 data-[side=top]:-bottom-2.5"})]})})})}const Mn="sidebar_state",En=3600*24*7,On="16rem",In="18rem",Dn="3rem",An="b",nt=o.createContext(null);function we(){const t=o.useContext(nt);if(!t)throw new Error("useSidebar must be used within a SidebarProvider.");return t}function _n({defaultOpen:t=!0,open:s,onOpenChange:n,className:a,style:r,children:f,...d}){const i=Qs(),[h,c]=o.useState(!1),[g,j]=o.useState(t),x=s??g,m=o.useCallback(b=>{const k=typeof b=="function"?b(x):b;n?n(k):j(k),document.cookie=`${Mn}=${k}; path=/; max-age=${En}`},[n,x]),p=o.useCallback(()=>i?c(b=>!b):m(b=>!b),[i,m,c]);o.useEffect(()=>{const b=k=>{k.key===An&&(k.metaKey||k.ctrlKey)&&(k.preventDefault(),p())};return window.addEventListener("keydown",b),()=>window.removeEventListener("keydown",b)},[p]);const S=x?"expanded":"collapsed",u=o.useMemo(()=>({state:S,open:x,setOpen:m,isMobile:i,openMobile:h,setOpenMobile:c,toggleSidebar:p}),[S,x,m,i,h,c,p]);return e.jsx(nt.Provider,{value:u,children:e.jsx("div",{"data-slot":"sidebar-wrapper",style:{"--sidebar-width":On,"--sidebar-width-icon":Dn,...r},className:w("group/sidebar-wrapper flex min-h-svh w-full has-data-[variant=inset]:bg-sidebar",a),...d,children:f})})}function Hn({side:t="left",variant:s="sidebar",collapsible:n="offcanvas",className:a,children:r,dir:f,...d}){const{isMobile:i,state:h,openMobile:c,setOpenMobile:g}=we();return n==="none"?e.jsx("div",{"data-slot":"sidebar",className:w("flex h-full w-(--sidebar-width) flex-col bg-sidebar text-sidebar-foreground",a),...d,children:r}):i?e.jsx(nn,{open:c,onOpenChange:g,...d,children:e.jsxs(on,{dir:f,"data-sidebar":"sidebar","data-slot":"sidebar","data-mobile":"true",className:"w-(--sidebar-width) bg-sidebar p-0 text-sidebar-foreground [&>button]:hidden",style:{"--sidebar-width":In},side:t,children:[e.jsxs(ln,{className:"sr-only",children:[e.jsx(dn,{children:"Sidebar"}),e.jsx(cn,{children:"Displays the mobile sidebar."})]}),e.jsx("div",{className:"flex h-full w-full flex-col",children:r})]})}):e.jsxs("div",{className:"group peer hidden text-sidebar-foreground md:block","data-state":h,"data-collapsible":h==="collapsed"?n:"","data-variant":s,"data-side":t,"data-slot":"sidebar",children:[e.jsx("div",{"data-slot":"sidebar-gap",className:w("relative w-(--sidebar-width) bg-transparent transition-[width] duration-200 ease-linear","group-data-[collapsible=offcanvas]:w-0","group-data-[side=right]:rotate-180",s==="floating"||s==="inset"?"group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4)))]":"group-data-[collapsible=icon]:w-(--sidebar-width-icon)")}),e.jsx("div",{"data-slot":"sidebar-container","data-side":t,className:w("fixed inset-y-0 z-10 hidden h-svh w-(--sidebar-width) transition-[left,right,width] duration-200 ease-linear data-[side=left]:left-0 data-[side=left]:group-data-[collapsible=offcanvas]:left-[calc(var(--sidebar-width)*-1)] data-[side=right]:right-0 data-[side=right]:group-data-[collapsible=offcanvas]:right-[calc(var(--sidebar-width)*-1)] md:flex",s==="floating"||s==="inset"?"p-2 group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4))+2px)]":"group-data-[collapsible=icon]:w-(--sidebar-width-icon) group-data-[side=left]:border-r group-data-[side=right]:border-l",a),...d,children:e.jsx("div",{"data-sidebar":"sidebar","data-slot":"sidebar-inner",className:"flex size-full flex-col bg-sidebar group-data-[variant=floating]:rounded-lg group-data-[variant=floating]:shadow-sm group-data-[variant=floating]:ring-1 group-data-[variant=floating]:ring-sidebar-border",children:r})})]})}function zn({className:t,onClick:s,...n}){const{toggleSidebar:a}=we();return e.jsxs(J,{"data-sidebar":"trigger","data-slot":"sidebar-trigger",variant:"ghost",size:"icon-sm",className:w(t),onClick:r=>{s?.(r),a()},...n,children:[e.jsx(Ys,{}),e.jsx("span",{className:"sr-only",children:"Toggle Sidebar"})]})}function Ln({className:t,...s}){return e.jsx("main",{"data-slot":"sidebar-inset",className:w("relative flex w-full flex-1 flex-col bg-background md:peer-data-[variant=inset]:m-2 md:peer-data-[variant=inset]:ml-0 md:peer-data-[variant=inset]:rounded-xl md:peer-data-[variant=inset]:shadow-sm md:peer-data-[variant=inset]:peer-data-[state=collapsed]:ml-2",t),...s})}function $n({className:t,...s}){return e.jsx("div",{"data-slot":"sidebar-header","data-sidebar":"header",className:w("flex flex-col gap-2 p-2",t),...s})}function Bn({className:t,...s}){return e.jsx("div",{"data-slot":"sidebar-footer","data-sidebar":"footer",className:w("flex flex-col gap-2 p-2",t),...s})}function Fn({className:t,...s}){return e.jsx("div",{"data-slot":"sidebar-content","data-sidebar":"content",className:w("no-scrollbar flex min-h-0 flex-1 flex-col gap-0 overflow-auto group-data-[collapsible=icon]:overflow-hidden",t),...s})}function De({className:t,...s}){return e.jsx("div",{"data-slot":"sidebar-group","data-sidebar":"group",className:w("relative flex w-full min-w-0 flex-col p-2",t),...s})}function Un({className:t,render:s,...n}){return qe({defaultTagName:"div",props:be({className:w("flex h-8 shrink-0 items-center rounded-md px-2 text-xs font-medium text-sidebar-foreground/70 ring-sidebar-ring outline-hidden transition-[margin,opacity] duration-200 ease-linear group-data-[collapsible=icon]:-mt-8 group-data-[collapsible=icon]:opacity-0 focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0",t)},n),render:s,state:{slot:"sidebar-group-label",sidebar:"group-label"}})}function Ae({className:t,...s}){return e.jsx("div",{"data-slot":"sidebar-group-content","data-sidebar":"group-content",className:w("w-full text-sm",t),...s})}function pe({className:t,...s}){return e.jsx("ul",{"data-slot":"sidebar-menu","data-sidebar":"menu",className:w("flex w-full min-w-0 flex-col gap-0",t),...s})}function E({className:t,...s}){return e.jsx("li",{"data-slot":"sidebar-menu-item","data-sidebar":"menu-item",className:w("group/menu-item relative",t),...s})}const qn=bt("peer/menu-button group/menu-button flex w-full items-center gap-2 overflow-hidden rounded-md p-2 text-left text-sm ring-sidebar-ring outline-hidden transition-[width,height,padding] group-has-data-[sidebar=menu-action]/menu-item:pr-8 group-data-[collapsible=icon]:size-8! group-data-[collapsible=icon]:p-2! hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 data-open:hover:bg-sidebar-accent data-open:hover:text-sidebar-accent-foreground data-active:bg-sidebar-accent data-active:font-medium data-active:text-sidebar-accent-foreground [&_svg]:size-4 [&_svg]:shrink-0 [&>span:last-child]:truncate",{variants:{variant:{default:"hover:bg-sidebar-accent hover:text-sidebar-accent-foreground",outline:"bg-background shadow-[0_0_0_1px_var(--sidebar-border)] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground hover:shadow-[0_0_0_1px_var(--sidebar-accent)]"},size:{default:"h-8 text-sm",sm:"h-7 text-xs",lg:"h-12 text-sm group-data-[collapsible=icon]:p-0!"}},defaultVariants:{variant:"default",size:"default"}});function O({render:t,isActive:s=!1,variant:n="default",size:a="default",tooltip:r,className:f,...d}){const{isMobile:i,state:h}=we(),c=qe({defaultTagName:"button",props:be({className:w(qn({variant:n,size:a}),f)},d),render:r?e.jsx(Pn,{render:t}):t,state:{slot:"sidebar-menu-button",sidebar:"menu-button",size:a,active:s}});return r?(typeof r=="string"&&(r={children:r}),e.jsxs(Tn,{children:[c,e.jsx(Rn,{side:"right",align:"center",hidden:h!=="collapsed"||i,...r})]})):c}function Gn({className:t,...s}){return e.jsx("div",{"data-slot":"sidebar-menu-badge","data-sidebar":"menu-badge",className:w("pointer-events-none absolute right-1 flex h-5 min-w-5 items-center justify-center rounded-md px-1 text-xs font-medium text-sidebar-foreground tabular-nums select-none group-data-[collapsible=icon]:hidden peer-hover/menu-button:text-sidebar-accent-foreground peer-data-[size=default]/menu-button:top-1.5 peer-data-[size=lg]/menu-button:top-2.5 peer-data-[size=sm]/menu-button:top-1 peer-data-active/menu-button:text-sidebar-accent-foreground",t),...s})}function Vn({open:t,onOpenChange:s}){const n=Ge(),a=ne(),[r,f]=o.useState(""),[d,i]=o.useState(0),h=o.useRef(null),c=r.trim(),[g,j]=o.useState("");o.useEffect(()=>{const l=setTimeout(()=>j(c),180);return()=>clearTimeout(l)},[c]);const x=He({queryKey:["activity","search",g],queryFn:()=>Z.activity({q:g,status:"all",limit:8}),enabled:t&&g.length>=2,staleTime:3e4});o.useEffect(()=>{t||(f(""),i(0))},[t]);const m=o.useMemo(()=>[{id:"s:sites",label:"Sites",icon:e.jsx(te,{className:"size-4"}),go:()=>void a({to:"/sites"})},{id:"s:activity",label:"Activity",hint:"every site, newest first",icon:e.jsx(Ke,{className:"size-4"}),go:()=>void a({to:"/activity"})},{id:"s:members",label:"Members",icon:e.jsx(xe,{className:"size-4"}),go:()=>void a({to:"/studio/members"})},{id:"s:integrations",label:"Integrations",icon:e.jsx(Ye,{className:"size-4"}),go:()=>void a({to:"/studio/integrations"})},{id:"s:studio",label:"Studio settings",icon:e.jsx(ye,{className:"size-4"}),go:()=>void a({to:"/studio"})},{id:"s:you",label:"You",icon:e.jsx(Qe,{className:"size-4"}),go:()=>void a({to:"/you"})}],[a]),p=o.useMemo(()=>n.projects.map(l=>({id:`p:${l.uid}`,label:l.name,hint:l.unresolved>0?`${l.unresolved} open`:"nothing open",icon:e.jsx(me,{className:"size-4"}),go:()=>void a({to:"/s/$site/comments",params:{site:l.uid}})})),[n.projects,a]),S=l=>!c||l.toLowerCase().includes(c.toLowerCase()),u=[],b=p.filter(l=>S(l.label)),k=m.filter(l=>S(l.label));b.length&&u.push({title:"Sites",items:b}),k.length&&u.push({title:"Go to",items:k});const C=(x.data?.data??[]).map(l=>({id:`t:${l.id}`,label:l.latest?.body?.trim()||l.route,hint:`${l.site.name} · ${Ms(l.status)?Rs[l.status]:l.status} · ${l.key}`,icon:e.jsx(me,{className:"size-4"}),go:()=>void a({to:"/s/$site/comments",params:{site:l.site.uid},search:{thread:l.key}})}));C.length&&u.push({title:"Comments",items:C});const v=u.flatMap(l=>l.items),y=Math.min(d,Math.max(0,v.length-1)),P=l=>{l&&(s(!1),l.go())};return o.useEffect(()=>{h.current?.querySelector(`[data-at="${y}"]`)?.scrollIntoView({block:"nearest"})},[y]),e.jsx(Le,{open:t,onOpenChange:s,children:e.jsxs($e,{showCloseButton:!1,className:"top-[15%] max-h-[70dvh] translate-y-0 gap-0 overflow-hidden p-0 sm:max-w-lg",children:[e.jsx(Be,{className:"sr-only",children:"Search and go"}),e.jsxs("div",{className:"flex items-center gap-2 border-b border-border px-3",children:[e.jsx(Ue,{className:"size-4 shrink-0 text-muted-foreground"}),e.jsx("input",{autoFocus:!0,value:r,onChange:l=>{f(l.target.value),i(0)},onKeyDown:l=>{l.key==="ArrowDown"?(l.preventDefault(),i(N=>Math.min(N+1,v.length-1))):l.key==="ArrowUp"?(l.preventDefault(),i(N=>Math.max(N-1,0))):l.key==="Enter"&&(l.preventDefault(),P(v[y]))},placeholder:"Go to a site or a screen, or search every comment…","aria-label":"Search and go",className:"h-11 w-full bg-transparent text-[14px] outline-none placeholder:text-muted-foreground"})]}),e.jsxs("div",{ref:h,className:"min-h-0 flex-1 overflow-auto py-1.5",children:[v.length===0&&e.jsx("p",{className:"m-0 px-3 py-6 text-center text-[13px] text-muted-foreground",children:x.isFetching?"Looking…":c?`Nothing matches “${c}”.`:"Nothing here."}),u.map(l=>e.jsxs("div",{children:[e.jsx("div",{className:"px-3 py-1 text-[11px] font-medium uppercase tracking-wide text-muted-foreground",children:l.title}),l.items.map(N=>{const R=v.indexOf(N);return e.jsxs("button",{type:"button","data-at":R,onMouseMove:()=>i(R),onClick:()=>P(N),className:w("flex w-full items-center gap-2.5 border-0 bg-transparent px-3 py-2 text-left text-[13px] text-foreground",R===y&&"bg-muted"),children:[e.jsx("span",{className:"shrink-0 text-muted-foreground",children:N.icon}),e.jsx("span",{className:"min-w-0 flex-1 truncate",children:N.label}),N.hint&&e.jsx("span",{className:"shrink-0 text-[12px] text-muted-foreground",children:N.hint})]},N.id)})]},l.title)),x.isFetching&&v.length>0&&e.jsx("p",{className:"m-0 px-3 py-1.5 text-[12px] text-muted-foreground",children:"Searching every site…"})]})]})})}function Kn(){const[t,s]=o.useState(!1);return o.useEffect(()=>{const n=a=>{a.key.toLowerCase()!=="k"||!(a.metaKey||a.ctrlKey)||(a.preventDefault(),s(r=>!r))};return document.addEventListener("keydown",n),()=>document.removeEventListener("keydown",n)},[]),[t,s]}const at="https://snagset.com/docs/",Yn="https://www.npmjs.com/package/@snagset/server?activeTab=versions",Wn="https://snagset.com/docs/self-hosting/#upgrade";function Xn({children:t}){const s=Ge(),n=vt(s),[a,r]=Kn();return e.jsxs(_n,{children:[e.jsx(Qn,{me:s,site:n}),e.jsxs(Ln,{className:"min-w-0",children:[e.jsx(sa,{onSearch:()=>r(!0)}),e.jsx("div",{className:"min-h-0 flex-1",children:t})]}),e.jsx(Vn,{open:a,onOpenChange:r})]})}function Qn({me:t,site:s}){const n=_s({select:r=>r.location.pathname}),a=r=>n===r||n.startsWith(r+"/");return e.jsxs(Hn,{children:[e.jsx($n,{className:"px-3 pb-1 pt-3",children:e.jsx(Jn,{me:t})}),e.jsxs(Fn,{children:[e.jsxs(De,{children:[e.jsx(Zn,{me:t,site:s}),s&&e.jsx(Ae,{children:e.jsxs(pe,{children:[e.jsxs(E,{children:[e.jsxs(O,{isActive:a(`/s/${s.uid}/comments`),render:e.jsx(_,{to:"/s/$site/comments",params:{site:s.uid}}),children:[e.jsx(me,{}),e.jsx("span",{children:"Comments"})]}),s.unresolved>0&&e.jsx(Gn,{children:s.unresolved})]}),e.jsx(E,{children:e.jsxs(O,{isActive:a(`/s/${s.uid}/reviewers`),render:e.jsx(_,{to:"/s/$site/reviewers",params:{site:s.uid}}),children:[e.jsx(xe,{}),e.jsx("span",{children:"Reviewers"})]})}),e.jsx(E,{children:e.jsxs(O,{isActive:a(`/s/${s.uid}/settings`),render:e.jsx(_,{to:"/s/$site/settings",params:{site:s.uid}}),children:[e.jsx(Xe,{}),e.jsx("span",{children:"Settings"})]})})]})})]}),e.jsxs(De,{children:[e.jsx(Un,{children:"Studio"}),e.jsx(Ae,{children:e.jsxs(pe,{children:[e.jsx(E,{children:e.jsxs(O,{isActive:a("/sites"),render:e.jsx(_,{to:"/sites"}),children:[e.jsx(te,{}),e.jsx("span",{children:"Sites"})]})}),e.jsx(E,{children:e.jsxs(O,{isActive:a("/activity"),render:e.jsx(_,{to:"/activity"}),children:[e.jsx(Ke,{}),e.jsx("span",{children:"Activity"})]})}),e.jsx(E,{children:e.jsxs(O,{isActive:a("/studio/members"),render:e.jsx(_,{to:"/studio/members"}),children:[e.jsx(xe,{}),e.jsx("span",{children:"Members"})]})}),e.jsx(E,{children:e.jsxs(O,{isActive:a("/studio/integrations"),render:e.jsx(_,{to:"/studio/integrations"}),children:[e.jsx(Ye,{}),e.jsx("span",{children:"Integrations"})]})}),e.jsx(E,{children:e.jsxs(O,{isActive:n==="/studio",render:e.jsx(_,{to:"/studio"}),children:[e.jsx(ye,{}),e.jsx("span",{children:"General"})]})})]})})]})]}),e.jsx(Bn,{children:e.jsxs(pe,{children:[e.jsx(E,{children:e.jsxs(O,{render:e.jsx("a",{href:at,target:"_blank",rel:"noreferrer"}),children:[e.jsx(We,{}),e.jsx("span",{children:"Docs"}),e.jsx(Q,{className:"ml-auto size-3.5 text-muted-foreground"})]})}),e.jsx(E,{children:e.jsx(ea,{})}),e.jsx(E,{children:e.jsx(ta,{me:t})})]})})]})}function Jn({me:t}){const s=ne(),n=_e(),[a,r]=o.useState(!1),[f,d]=o.useState(""),[i,h]=o.useState(""),[c,g]=o.useState(!1),j=e.jsxs(e.Fragment,{children:[e.jsx(yt,{size:20}),e.jsxs("span",{className:"min-w-0 flex-1 text-left",children:[e.jsx("span",{className:"block truncate text-[14px] font-semibold leading-tight tracking-tight",children:t.org.name}),e.jsx("span",{className:"block truncate text-[11.5px] text-muted-foreground",children:location.host})]})]});if(t.orgs.length<=1&&!t.signupOpen)return e.jsx(_,{to:"/studio",className:"flex items-center gap-2.5 rounded-md px-1 py-0.5 text-foreground hover:bg-sidebar-accent","aria-label":`${t.org.name} — studio settings`,children:j});const x=async m=>{g(!0),h("");try{await m(),n.clear(),r(!1),d(""),s({to:"/sites",replace:!0})}catch(p){h(p instanceof Error?p.message:"Something went wrong. Try again.")}finally{g(!1)}};return e.jsxs(e.Fragment,{children:[e.jsxs(ae,{children:[e.jsxs(re,{render:e.jsx("button",{type:"button",className:"flex w-full items-center gap-2.5 rounded-md px-1 py-0.5 text-foreground hover:bg-sidebar-accent","aria-label":"Switch studio"}),children:[j,e.jsx(Se,{className:"size-3.5 shrink-0 text-muted-foreground"})]}),e.jsxs(oe,{align:"start",className:"w-[240px]",children:[e.jsxs(je,{children:[e.jsx(ee,{children:"Studios"}),t.orgs.map(m=>e.jsxs(I,{disabled:m.current,onClick:()=>void x(()=>Z.switchOrg(m.slug)),children:[e.jsx(ye,{}),e.jsx("span",{className:"truncate",children:m.name}),m.current&&e.jsx("span",{className:"ml-auto text-[11px] text-muted-foreground",children:"current"})]},m.slug))]}),e.jsx(V,{}),e.jsxs(I,{onClick:()=>void s({to:"/studio"}),children:[e.jsx(Xe,{}),"Studio settings"]}),t.signupOpen&&e.jsxs(I,{onClick:()=>r(!0),children:[e.jsx(Ve,{}),"New studio…"]})]})]}),e.jsx(Le,{open:a,onOpenChange:m=>!c&&r(m),children:e.jsx($e,{className:"sm:max-w-[420px]",children:e.jsxs("form",{className:"flex flex-col gap-4",onSubmit:m=>{m.preventDefault(),x(()=>Z.createOrg(f.trim()||"My studio"))},children:[e.jsxs(is,{children:[e.jsx(Be,{children:"New studio"}),e.jsx(ls,{children:"Its own sites, members and settings. You are its owner, and you move to it now — this one stays in the menu."})]}),e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx(hs,{htmlFor:"new-studio-name",children:"Studio name"}),e.jsx(xs,{id:"new-studio-name",value:f,onChange:m=>d(m.target.value),placeholder:"My studio",autoFocus:!0})]}),i&&e.jsx("p",{className:"m-0 text-[12px] text-destructive",children:i}),e.jsxs(ds,{children:[e.jsx(J,{type:"button",variant:"outline",onClick:()=>r(!1),disabled:c,children:"Cancel"}),e.jsx(J,{type:"submit",loading:c,children:c?"Creating…":"Create studio"})]})]})})})]})}function Zn({me:t,site:s}){const n=ne();return e.jsxs(ae,{children:[e.jsxs(re,{render:e.jsx("button",{type:"button",className:"mb-1 flex h-[34px] w-full items-center justify-between rounded-md border border-border bg-card px-2.5 text-[13px] font-semibold text-foreground","aria-label":"Switch site"}),children:[e.jsx("span",{className:"truncate",children:s?.name??"No sites yet"}),e.jsx(Se,{className:"size-3.5 text-muted-foreground"})]}),e.jsxs(oe,{align:"start",className:"w-[240px]",children:[e.jsxs(je,{children:[e.jsx(ee,{children:"Sites"}),t.projects.map(a=>e.jsxs(I,{onClick:()=>void n({to:"/s/$site/comments",params:{site:a.uid}}),children:[e.jsx(te,{}),e.jsx("span",{className:"truncate",children:a.name}),a.uid===s?.uid&&e.jsx("span",{className:"ml-auto text-[11px] text-muted-foreground",children:"current"})]},a.uid))]}),e.jsx(V,{}),e.jsxs(I,{onClick:()=>void n({to:"/sites",search:{add:!0}}),children:[e.jsx(Ve,{}),"Add a site"]}),e.jsxs(I,{onClick:()=>void n({to:"/sites"}),children:[e.jsx(te,{}),"All sites"]})]})]})}function ea(){const t=He(kt.meta()),s=t.data?.version??"",[n,a]=o.useState({state:"idle"}),r=async()=>{a({state:"checking"});try{a({state:"done",result:await Os(s)})}catch{a({state:"failed"})}};return e.jsxs(ae,{children:[e.jsxs(re,{render:e.jsx(O,{}),children:[e.jsx(Us,{}),e.jsx("span",{children:"Help"})]}),e.jsxs(oe,{align:"start",side:"top",className:"w-[240px]",children:[e.jsxs(I,{render:e.jsx("a",{href:at,target:"_blank",rel:"noreferrer"}),children:[e.jsx(We,{}),"Docs",e.jsx(Q,{className:"ml-auto size-3 text-muted-foreground"})]}),e.jsxs(I,{render:e.jsx("a",{href:Yn,target:"_blank",rel:"noreferrer"}),children:["Changelog",e.jsx(Q,{className:"ml-auto size-3 text-muted-foreground"})]}),t.data?.sourceUrl&&e.jsxs(I,{render:e.jsx("a",{href:t.data.sourceUrl,target:"_blank",rel:"noreferrer"}),children:["Source · AGPL",e.jsx(Q,{className:"ml-auto size-3 text-muted-foreground"})]}),e.jsx(V,{}),e.jsxs("div",{className:"px-2 py-1.5 text-[12px] text-muted-foreground",children:["Snagset ",s||"—",n.state==="idle"&&e.jsxs(e.Fragment,{children:[" · ",e.jsx("button",{type:"button",className:"text-brand hover:underline",onClick:()=>void r(),children:"Check for updates"})]}),n.state==="checking"&&" · checking…",n.state==="failed"&&" · could not reach npm",n.state==="done"&&n.result&&e.jsxs(e.Fragment,{children:[" · ",n.result.newer?e.jsxs("a",{href:Wn,target:"_blank",rel:"noreferrer",className:"text-brand hover:underline",children:[n.result.latest," is out — how to upgrade"]}):"up to date"]})]})]})]})}function ta({me:t}){const s=ne(),n=_e(),[a,r]=o.useState(St),f=t.user.name||t.user.email,d=t.user.name?t.user.email:t.user.role,i=async()=>{await Z.logout().catch(()=>{}),Ct("out"),n.clear(),s({to:"/sign-in",replace:!0})};return e.jsxs(ae,{children:[e.jsxs(re,{render:e.jsx(O,{size:"lg"}),children:[e.jsx(Ts,{className:"size-8 rounded-full",children:e.jsx(Ps,{className:"bg-primary text-[12px] font-semibold text-primary-foreground",children:Es(t.user.name,t.user.email)})}),e.jsxs("div",{className:"min-w-0 flex-1 text-left leading-tight",children:[e.jsx("div",{className:"truncate text-[13px] font-semibold",children:f}),e.jsx("div",{className:"truncate text-[11.5px] text-muted-foreground",children:d})]}),e.jsx(Se,{className:"size-3.5 text-muted-foreground"})]}),e.jsxs(oe,{align:"start",side:"top",className:"w-[250px]",children:[e.jsx(je,{children:e.jsxs(ee,{className:"flex flex-col",children:[e.jsx("span",{className:"text-[13px] font-semibold",children:f}),e.jsx("span",{className:"text-[11.5px] font-normal text-muted-foreground",children:t.user.name?`${t.user.email} · ${t.user.role}`:t.user.role})]})}),e.jsx(V,{}),e.jsxs(Ns,{value:a,onValueChange:h=>{const c=h;wt(c),r(c)},children:[e.jsx(ee,{children:"Theme"}),e.jsxs(ce,{value:"system",children:[e.jsx(Is,{}),"System"]}),e.jsxs(ce,{value:"light",children:[e.jsx(Ds,{}),"Light"]}),e.jsxs(ce,{value:"dark",children:[e.jsx(As,{}),"Dark"]})]}),e.jsx(V,{}),e.jsxs(I,{onClick:()=>void s({to:"/you"}),children:[e.jsx(Qe,{}),"You"]}),e.jsxs(I,{onClick:()=>void i(),children:[e.jsx(Gs,{}),"Sign out"]})]})]})}function sa({onSearch:t}){const n=jt().map(a=>a.loaderData?.crumb).filter(a=>typeof a=="string"&&a.length>0);return e.jsxs("div",{className:"flex h-12 shrink-0 items-center gap-2.5 border-b border-border/60 px-4",children:[e.jsx(zn,{className:"-ml-1"}),e.jsx("nav",{"aria-label":"Breadcrumb",className:"flex items-center gap-2 text-[13.5px] font-medium text-muted-foreground",children:n.map((a,r)=>e.jsxs("span",{className:"flex items-center gap-2",children:[r>0&&e.jsx("span",{className:"text-line-strong",children:"/"}),e.jsx("span",{className:r===n.length-1?"text-foreground":void 0,children:a})]},r))}),e.jsx("div",{className:"flex-1"}),e.jsxs("button",{type:"button",onClick:t,"aria-label":"Search and go",className:"flex h-7 items-center gap-2 rounded-md border border-border bg-card px-2 text-[12.5px] text-muted-foreground",children:[e.jsx(Ue,{className:"size-3.5"}),e.jsx("span",{className:"hidden sm:inline",children:"Search"}),e.jsx("kbd",{className:"hidden rounded border border-border px-1 font-mono text-[11px] sm:inline",children:"⌘K"})]})]})}const Ca=()=>e.jsx(Xn,{children:e.jsx(Nt,{})});export{Ca as component};
@@ -1 +1 @@
1
- import{j as e,u as n,G as a,B as r}from"./index-D4yHhKPM.js";function i({error:s}){const t=n(),o=s instanceof Error?s.message:"Something went wrong.";return e.jsx(a,{children:e.jsxs("div",{className:"flex flex-col items-start gap-3",children:[e.jsx("h1",{className:"m-0 text-lg font-semibold",children:"Could not load the dashboard"}),e.jsx("p",{className:"m-0 text-muted-foreground",children:o}),e.jsx(r,{variant:"outline",size:"sm",onClick:()=>void t.invalidate(),children:"Try again"})]})})}const m=({error:s})=>e.jsx(i,{error:s});export{m as errorComponent};
1
+ import{j as e,u as n,G as a,B as r}from"./index-B7_Oj3hr.js";function i({error:s}){const t=n(),o=s instanceof Error?s.message:"Something went wrong.";return e.jsx(a,{children:e.jsxs("div",{className:"flex flex-col items-start gap-3",children:[e.jsx("h1",{className:"m-0 text-lg font-semibold",children:"Could not load the dashboard"}),e.jsx("p",{className:"m-0 text-muted-foreground",children:o}),e.jsx(r,{variant:"outline",size:"sm",onClick:()=>void t.invalidate(),children:"Try again"})]})})}const m=({error:s})=>e.jsx(i,{error:s});export{m as errorComponent};
@@ -1 +1 @@
1
- import{H as g,I as f,J as p,n as v,j as e,B as m,L as N,o as P}from"./index-D4yHhKPM.js";import{Q as j,u as y}from"./useBaseQuery-B_iu1J2b.js";import{P as b,S as w}from"./parts-DJaBw8EG.js";import{b as S,c as R,S as E}from"./labels--UUyt9uB.js";import{u as F}from"./me-B-0XXdLF.js";import"./card-D3S4369l.js";var k=class extends j{constructor(s,n){super(s,n)}bindMethods(){super.bindMethods(),this.fetchNextPage=this.fetchNextPage.bind(this),this.fetchPreviousPage=this.fetchPreviousPage.bind(this)}setOptions(s){s._type="infinite",super.setOptions(s)}getOptimisticResult(s){return s._type="infinite",super.getOptimisticResult(s)}fetchNextPage(s){return this.fetch({...s,meta:{fetchMore:{direction:"forward"}}})}fetchPreviousPage(s){return this.fetch({...s,meta:{fetchMore:{direction:"backward"}}})}createResult(s,n){const{state:i}=s,l=super.createResult(s,n),{isFetching:o,isRefetching:r,isError:u,isRefetchError:d}=l,t=i.fetchMeta?.fetchMore?.direction,c=u&&t==="forward",a=o&&t==="forward",x=u&&t==="backward",h=o&&t==="backward";return{...l,fetchNextPage:this.fetchNextPage,fetchPreviousPage:this.fetchPreviousPage,hasNextPage:f(n,i.data),hasPreviousPage:g(n,i.data),isFetchNextPageError:c,isFetchingNextPage:a,isFetchPreviousPageError:x,isFetchingPreviousPage:h,isRefetchError:d&&!c&&!x,isRefetching:r&&!a&&!h}}};function M(s,n){return y(s,k)}const A=[{value:"unresolved",label:"Needs attention"},...R.map(s=>({value:s,label:E[s]})),{value:"all",label:"Everything"}];function C(s,n=new Date){const i=new Date(s),l=r=>new Date(r.getFullYear(),r.getMonth(),r.getDate()).getTime(),o=Math.round((l(n)-l(i))/864e5);return o<=0?"Today":o===1?"Yesterday":o<7?i.toLocaleDateString(void 0,{weekday:"long"}):i.toLocaleDateString(void 0,{day:"numeric",month:"long"})}function I(){const s=F(),{status:n="unresolved",site:i}=p.useSearch(),l=v({from:"/activity"}),o=t=>void l({search:c=>({...c,...t}),replace:!0}),r=M({queryKey:["activity",n,i??null],queryFn:({pageParam:t})=>P.activity({status:n,...i?{site:i}:{},...t?{cursor:t}:{}}),initialPageParam:"",getNextPageParam:t=>t.nextCursor??void 0,refetchOnWindowFocus:!0}),u=r.data?.pages.flatMap(t=>t.data)??[],d=[];for(const t of u){const c=C(t.updatedAt),a=d[d.length-1];a?.day===c?a.rows.push(t):d.push({day:c,rows:[t]})}return e.jsxs("div",{className:"flex flex-col gap-5 p-7",children:[e.jsx(b,{title:"Activity",sub:`Every site, newest first${i?"":" — all of them"}`}),e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[A.map(t=>e.jsx(m,{size:"sm",variant:n===t.value?"default":"outline",onClick:()=>o({status:t.value}),children:t.label},t.value)),e.jsx("div",{className:"flex-1"}),e.jsxs("label",{className:"flex items-center gap-2 text-[13px] text-muted-foreground",children:["Site",e.jsxs("select",{"aria-label":"Site",value:i??"",onChange:t=>o({site:t.target.value||void 0}),className:"h-8 rounded-md border border-input bg-background px-2.5 text-[13px] text-foreground",children:[e.jsx("option",{value:"",children:"All sites"}),s.projects.map(t=>e.jsx("option",{value:t.uid,children:t.name},t.uid))]})]})]}),r.isPending&&e.jsx("p",{className:"m-0 text-[13px] text-muted-foreground",children:"Reading…"}),r.isError&&e.jsx("p",{className:"m-0 text-[13px] text-destructive",children:"Could not read the feed. Reload to try again."}),r.isSuccess&&u.length===0&&e.jsx("p",{className:"m-0 text-[13px] text-muted-foreground",children:n==="resolved"?"Nothing has been resolved yet — this is where finished comments go.":n==="unresolved"?"Nothing needs attention. Every comment on every site is resolved.":"No comments yet on any site."}),d.map(({day:t,rows:c})=>e.jsxs("section",{className:"flex flex-col gap-2",children:[e.jsx("h2",{className:"m-0 text-[12px] font-medium uppercase tracking-wide text-muted-foreground",children:t}),e.jsx("ul",{className:"m-0 flex list-none flex-col gap-1.5 p-0",children:c.map(a=>e.jsx("li",{children:e.jsxs(N,{to:"/s/$site/comments",params:{site:a.site.uid},search:{thread:a.key},className:"flex flex-col gap-1 rounded-md border border-border px-3 py-2.5 no-underline transition-colors hover:bg-muted/60",children:[e.jsxs("span",{className:"flex flex-wrap items-center gap-x-2.5 gap-y-1 text-[13px]",children:[e.jsx(w,{status:a.status}),e.jsx("span",{className:"font-medium text-foreground",children:a.site.name}),e.jsx("code",{className:"font-mono text-[12px] text-muted-foreground",children:a.route}),e.jsx("span",{className:"flex-1"}),e.jsx("span",{className:"text-[12px] text-muted-foreground",children:S(a.updatedAt)})]}),a.latest?.body&&e.jsxs("span",{className:"line-clamp-2 text-[13px] text-foreground",children:[e.jsxs("span",{className:"text-muted-foreground",children:[a.latest.author??a.createdBy.name,": "]}),a.latest.body]}),e.jsxs("span",{className:"flex flex-wrap items-center gap-x-2 text-[12px] text-muted-foreground",children:[e.jsx("span",{className:"font-mono",children:a.key}),e.jsx("span",{children:"·"}),e.jsxs("span",{children:[a.commentCount," ",a.commentCount===1?"comment":"comments"]}),a.assignee&&e.jsxs(e.Fragment,{children:[e.jsx("span",{children:"·"}),e.jsx("span",{children:a.assignee})]})]})]})},a.id))})]},t)),r.hasNextPage&&e.jsx("div",{children:e.jsx(m,{variant:"outline",size:"sm",disabled:r.isFetchingNextPage,onClick:()=>void r.fetchNextPage(),children:r.isFetchingNextPage?"Reading…":"Show older"})})]})}export{I as component};
1
+ import{I as g,J as f,K as p,o as v,j as e,B as m,L as N,p as P}from"./index-B7_Oj3hr.js";import{Q as j,u as y}from"./useBaseQuery-yj7uWlSz.js";import{P as b,S as w}from"./parts-C1QjM02Y.js";import{b as S,c as R,S as E}from"./labels--UUyt9uB.js";import{u as F}from"./me-DoCJgtG9.js";import"./card-YnwmM74t.js";var k=class extends j{constructor(s,n){super(s,n)}bindMethods(){super.bindMethods(),this.fetchNextPage=this.fetchNextPage.bind(this),this.fetchPreviousPage=this.fetchPreviousPage.bind(this)}setOptions(s){s._type="infinite",super.setOptions(s)}getOptimisticResult(s){return s._type="infinite",super.getOptimisticResult(s)}fetchNextPage(s){return this.fetch({...s,meta:{fetchMore:{direction:"forward"}}})}fetchPreviousPage(s){return this.fetch({...s,meta:{fetchMore:{direction:"backward"}}})}createResult(s,n){const{state:i}=s,l=super.createResult(s,n),{isFetching:o,isRefetching:r,isError:u,isRefetchError:d}=l,t=i.fetchMeta?.fetchMore?.direction,c=u&&t==="forward",a=o&&t==="forward",x=u&&t==="backward",h=o&&t==="backward";return{...l,fetchNextPage:this.fetchNextPage,fetchPreviousPage:this.fetchPreviousPage,hasNextPage:f(n,i.data),hasPreviousPage:g(n,i.data),isFetchNextPageError:c,isFetchingNextPage:a,isFetchPreviousPageError:x,isFetchingPreviousPage:h,isRefetchError:d&&!c&&!x,isRefetching:r&&!a&&!h}}};function M(s,n){return y(s,k)}const A=[{value:"unresolved",label:"Needs attention"},...R.map(s=>({value:s,label:E[s]})),{value:"all",label:"Everything"}];function C(s,n=new Date){const i=new Date(s),l=r=>new Date(r.getFullYear(),r.getMonth(),r.getDate()).getTime(),o=Math.round((l(n)-l(i))/864e5);return o<=0?"Today":o===1?"Yesterday":o<7?i.toLocaleDateString(void 0,{weekday:"long"}):i.toLocaleDateString(void 0,{day:"numeric",month:"long"})}function I(){const s=F(),{status:n="unresolved",site:i}=p.useSearch(),l=v({from:"/activity"}),o=t=>void l({search:c=>({...c,...t}),replace:!0}),r=M({queryKey:["activity",n,i??null],queryFn:({pageParam:t})=>P.activity({status:n,...i?{site:i}:{},...t?{cursor:t}:{}}),initialPageParam:"",getNextPageParam:t=>t.nextCursor??void 0,refetchOnWindowFocus:!0}),u=r.data?.pages.flatMap(t=>t.data)??[],d=[];for(const t of u){const c=C(t.updatedAt),a=d[d.length-1];a?.day===c?a.rows.push(t):d.push({day:c,rows:[t]})}return e.jsxs("div",{className:"flex flex-col gap-5 p-7",children:[e.jsx(b,{title:"Activity",sub:`Every site, newest first${i?"":" — all of them"}`}),e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[A.map(t=>e.jsx(m,{size:"sm",variant:n===t.value?"default":"outline",onClick:()=>o({status:t.value}),children:t.label},t.value)),e.jsx("div",{className:"flex-1"}),e.jsxs("label",{className:"flex items-center gap-2 text-[13px] text-muted-foreground",children:["Site",e.jsxs("select",{"aria-label":"Site",value:i??"",onChange:t=>o({site:t.target.value||void 0}),className:"h-8 rounded-md border border-input bg-background px-2.5 text-[13px] text-foreground",children:[e.jsx("option",{value:"",children:"All sites"}),s.projects.map(t=>e.jsx("option",{value:t.uid,children:t.name},t.uid))]})]})]}),r.isPending&&e.jsx("p",{className:"m-0 text-[13px] text-muted-foreground",children:"Reading…"}),r.isError&&e.jsx("p",{className:"m-0 text-[13px] text-destructive",children:"Could not read the feed. Reload to try again."}),r.isSuccess&&u.length===0&&e.jsx("p",{className:"m-0 text-[13px] text-muted-foreground",children:n==="resolved"?"Nothing has been resolved yet — this is where finished comments go.":n==="unresolved"?"Nothing needs attention. Every comment on every site is resolved.":"No comments yet on any site."}),d.map(({day:t,rows:c})=>e.jsxs("section",{className:"flex flex-col gap-2",children:[e.jsx("h2",{className:"m-0 text-[12px] font-medium uppercase tracking-wide text-muted-foreground",children:t}),e.jsx("ul",{className:"m-0 flex list-none flex-col gap-1.5 p-0",children:c.map(a=>e.jsx("li",{children:e.jsxs(N,{to:"/s/$site/comments",params:{site:a.site.uid},search:{thread:a.key},className:"flex flex-col gap-1 rounded-md border border-border px-3 py-2.5 no-underline transition-colors hover:bg-muted/60",children:[e.jsxs("span",{className:"flex flex-wrap items-center gap-x-2.5 gap-y-1 text-[13px]",children:[e.jsx(w,{status:a.status}),e.jsx("span",{className:"font-medium text-foreground",children:a.site.name}),e.jsx("code",{className:"font-mono text-[12px] text-muted-foreground",children:a.route}),e.jsx("span",{className:"flex-1"}),e.jsx("span",{className:"text-[12px] text-muted-foreground",children:S(a.updatedAt)})]}),a.latest?.body&&e.jsxs("span",{className:"line-clamp-2 text-[13px] text-foreground",children:[e.jsxs("span",{className:"text-muted-foreground",children:[a.latest.author??a.createdBy.name,": "]}),a.latest.body]}),e.jsxs("span",{className:"flex flex-wrap items-center gap-x-2 text-[12px] text-muted-foreground",children:[e.jsx("span",{className:"font-mono",children:a.key}),e.jsx("span",{children:"·"}),e.jsxs("span",{children:[a.commentCount," ",a.commentCount===1?"comment":"comments"]}),a.assignee&&e.jsxs(e.Fragment,{children:[e.jsx("span",{children:"·"}),e.jsx("span",{children:a.assignee})]})]})]})},a.id))})]},t)),r.hasNextPage&&e.jsx("div",{children:e.jsx(m,{variant:"outline",size:"sm",disabled:r.isFetchingNextPage,onClick:()=>void r.fetchNextPage(),children:r.isFetchingNextPage?"Reading…":"Show older"})})]})}export{I as component};
@@ -1,4 +1,4 @@
1
- import{c as o}from"./createLucideIcon-CJO80vPf.js";/**
1
+ import{c as o}from"./index-B7_Oj3hr.js";/**
2
2
  * @license lucide-react v1.39.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -1 +1 @@
1
- import{r as a,f as b,h as f,j as d,e as m}from"./index-D4yHhKPM.js";import{w as A}from"./dialog-GyPeOagK.js";const x=a.createContext(void 0);function z(){const e=a.useContext(x);if(e===void 0)throw new Error(b(13));return e}const g={imageLoadingStatus:()=>null},R=a.forwardRef(function(t,r){const{className:v,render:p,style:s,...c}=t,[n,o]=a.useState("idle"),i={imageLoadingStatus:n},u=a.useMemo(()=>({imageLoadingStatus:n,setImageLoadingStatus:o}),[n,o]),l=f("span",t,{state:i,ref:r,props:c,stateAttributesMapping:g});return d.jsx(x.Provider,{value:u,children:l})}),k=a.forwardRef(function(t,r){const{className:v,render:p,delay:s=0,style:c,...n}=t,{imageLoadingStatus:o}=z(),[i,u]=a.useState(s===0),l=A();return a.useEffect(()=>(s>0?l.start(s,()=>u(!0)):u(!0),l.clear),[l,s]),f("span",t,{state:{imageLoadingStatus:o},ref:r,props:n,stateAttributesMapping:g,enabled:o!=="loaded"&&(s===0||i)})});function h({className:e,size:t="default",...r}){return d.jsx(R,{"data-slot":"avatar","data-size":t,className:m("group/avatar relative flex size-8 shrink-0 rounded-full select-none after:absolute after:inset-0 after:rounded-full after:border after:border-border after:mix-blend-darken data-[size=lg]:size-10 data-[size=sm]:size-6 dark:after:mix-blend-lighten",e),...r})}function w({className:e,...t}){return d.jsx(k,{"data-slot":"avatar-fallback",className:m("flex size-full items-center justify-center rounded-full bg-muted text-sm text-muted-foreground group-data-[size=sm]/avatar:text-xs",e),...t})}export{h as A,w as a};
1
+ import{r as a,h as b,i as f,j as d,f as m}from"./index-B7_Oj3hr.js";import{w as A}from"./dialog-BO8bYmy1.js";const x=a.createContext(void 0);function z(){const e=a.useContext(x);if(e===void 0)throw new Error(b(13));return e}const g={imageLoadingStatus:()=>null},R=a.forwardRef(function(t,r){const{className:v,render:p,style:s,...c}=t,[n,o]=a.useState("idle"),i={imageLoadingStatus:n},u=a.useMemo(()=>({imageLoadingStatus:n,setImageLoadingStatus:o}),[n,o]),l=f("span",t,{state:i,ref:r,props:c,stateAttributesMapping:g});return d.jsx(x.Provider,{value:u,children:l})}),k=a.forwardRef(function(t,r){const{className:v,render:p,delay:s=0,style:c,...n}=t,{imageLoadingStatus:o}=z(),[i,u]=a.useState(s===0),l=A();return a.useEffect(()=>(s>0?l.start(s,()=>u(!0)):u(!0),l.clear),[l,s]),f("span",t,{state:{imageLoadingStatus:o},ref:r,props:n,stateAttributesMapping:g,enabled:o!=="loaded"&&(s===0||i)})});function h({className:e,size:t="default",...r}){return d.jsx(R,{"data-slot":"avatar","data-size":t,className:m("group/avatar relative flex size-8 shrink-0 rounded-full select-none after:absolute after:inset-0 after:rounded-full after:border after:border-border after:mix-blend-darken data-[size=lg]:size-10 data-[size=sm]:size-6 dark:after:mix-blend-lighten",e),...r})}function w({className:e,...t}){return d.jsx(k,{"data-slot":"avatar-fallback",className:m("flex size-full items-center justify-center rounded-full bg-muted text-sm text-muted-foreground group-data-[size=sm]/avatar:text-xs",e),...t})}export{h as A,w as a};
@@ -1 +1 @@
1
- import{m as a,e as n,l as o}from"./index-D4yHhKPM.js";import{u as d}from"./useRender-Bl1M9SFS.js";const s=o("group/badge inline-flex h-5 w-fit shrink-0 items-center justify-center gap-1 overflow-hidden rounded-4xl border border-transparent px-2 py-0.5 text-xs font-medium whitespace-nowrap transition-all focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&>svg]:pointer-events-none [&>svg]:size-3!",{variants:{variant:{default:"bg-primary text-primary-foreground [a]:hover:bg-primary/80",secondary:"bg-secondary text-secondary-foreground [a]:hover:bg-secondary/80",destructive:"bg-destructive/10 text-destructive focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:focus-visible:ring-destructive/40 [a]:hover:bg-destructive/20",outline:"border-border text-foreground [a]:hover:bg-muted [a]:hover:text-muted-foreground",ghost:"hover:bg-muted hover:text-muted-foreground dark:hover:bg-muted/50",link:"text-primary underline-offset-4 hover:underline"}},defaultVariants:{variant:"default"}});function v({className:r,variant:e="default",render:t,...i}){return d({defaultTagName:"span",props:a({className:n(s({variant:e}),r)},i),render:t,state:{slot:"badge",variant:e}})}export{v as B};
1
+ import{m as a,f as n,n as o}from"./index-B7_Oj3hr.js";import{u as d}from"./useRender-BHlMpPxr.js";const s=o("group/badge inline-flex h-5 w-fit shrink-0 items-center justify-center gap-1 overflow-hidden rounded-4xl border border-transparent px-2 py-0.5 text-xs font-medium whitespace-nowrap transition-all focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&>svg]:pointer-events-none [&>svg]:size-3!",{variants:{variant:{default:"bg-primary text-primary-foreground [a]:hover:bg-primary/80",secondary:"bg-secondary text-secondary-foreground [a]:hover:bg-secondary/80",destructive:"bg-destructive/10 text-destructive focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:focus-visible:ring-destructive/40 [a]:hover:bg-destructive/20",outline:"border-border text-foreground [a]:hover:bg-muted [a]:hover:text-muted-foreground",ghost:"hover:bg-muted hover:text-muted-foreground dark:hover:bg-muted/50",link:"text-primary underline-offset-4 hover:underline"}},defaultVariants:{variant:"default"}});function v({className:r,variant:e="default",render:t,...i}){return d({defaultTagName:"span",props:a({className:n(s({variant:e}),r)},i),render:t,state:{slot:"badge",variant:e}})}export{v as B};
@@ -1 +1 @@
1
- import{j as s,e as t}from"./index-D4yHhKPM.js";function c({className:a,size:d="default",...r}){return s.jsx("div",{"data-slot":"card","data-size":d,className:t("group/card flex flex-col gap-(--card-spacing) overflow-hidden rounded-xl bg-card py-(--card-spacing) text-sm text-card-foreground ring-1 ring-foreground/10 [--card-spacing:--spacing(4)] has-data-[slot=card-footer]:pb-0 has-[>img:first-child]:pt-0 data-[size=sm]:[--card-spacing:--spacing(3)] data-[size=sm]:has-data-[slot=card-footer]:pb-0 *:[img:first-child]:rounded-t-xl *:[img:last-child]:rounded-b-xl",a),...r})}export{c as C};
1
+ import{j as s,f as t}from"./index-B7_Oj3hr.js";function c({className:a,size:d="default",...r}){return s.jsx("div",{"data-slot":"card","data-size":d,className:t("group/card flex flex-col gap-(--card-spacing) overflow-hidden rounded-xl bg-card py-(--card-spacing) text-sm text-card-foreground ring-1 ring-foreground/10 [--card-spacing:--spacing(4)] has-data-[slot=card-footer]:pb-0 has-[>img:first-child]:pt-0 data-[size=sm]:[--card-spacing:--spacing(3)] data-[size=sm]:has-data-[slot=card-footer]:pb-0 *:[img:first-child]:rounded-t-xl *:[img:last-child]:rounded-b-xl",a),...r})}export{c as C};
@@ -1,4 +1,4 @@
1
- import{c}from"./createLucideIcon-CJO80vPf.js";/**
1
+ import{c}from"./index-B7_Oj3hr.js";/**
2
2
  * @license lucide-react v1.39.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -1,4 +1,4 @@
1
- import{c as o}from"./createLucideIcon-CJO80vPf.js";/**
1
+ import{c as o}from"./index-B7_Oj3hr.js";/**
2
2
  * @license lucide-react v1.39.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -1,4 +1,4 @@
1
- import{c}from"./createLucideIcon-CJO80vPf.js";/**
1
+ import{c}from"./index-B7_Oj3hr.js";/**
2
2
  * @license lucide-react v1.39.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.