@axiom-lattice/react-sdk 4.1.4 → 4.1.5

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 (70) hide show
  1. package/dist/{AgentDetailSideApp-KVL27KAF.mjs → AgentDetailSideApp-EBS7FGQS.mjs} +8 -8
  2. package/dist/AgentGovernanceWorkbench-IHYEFXEU.mjs +20 -0
  3. package/dist/{MessageGraph-LOSAZQ2V.mjs → MessageGraph-CU7TPJJI.mjs} +3 -3
  4. package/dist/{ReactChart-NDLIHCJJ.mjs → ReactChart-INAST7XW.mjs} +3 -3
  5. package/dist/{SkillFlow-OVKEKBOL.mjs → SkillFlow-TBKF765E.mjs} +4 -4
  6. package/dist/{TasksSideApp-37YKH7HV.mjs → TasksSideApp-IN46CQ4D.mjs} +4 -4
  7. package/dist/{TeamWorkspace-EAFZU3KS.mjs → TeamWorkspace-IH6F5QYO.mjs} +3 -3
  8. package/dist/{TopologyRuntimeView-53OCKDYA.mjs → TopologyRuntimeView-LR3YQQIU.mjs} +4 -4
  9. package/dist/{WorkflowAutomationView-R4EHXT7I.mjs → WorkflowAutomationView-GWBROX7L.mjs} +6 -6
  10. package/dist/{chunk-SLXJAOF2.mjs → chunk-4PV75HKR.mjs} +2 -2
  11. package/dist/{chunk-YYP5ASCR.mjs → chunk-EOBSSJ2W.mjs} +5 -5
  12. package/dist/{chunk-LEEQPRDB.mjs → chunk-HMBSH53V.mjs} +102 -33
  13. package/dist/chunk-HMBSH53V.mjs.map +1 -0
  14. package/dist/{chunk-NHD2XFH4.mjs → chunk-K7WBURGK.mjs} +3 -3
  15. package/dist/{chunk-AMIVRDYB.mjs → chunk-MFAPAXZ2.mjs} +2 -2
  16. package/dist/{chunk-WQBBDRPU.mjs → chunk-MSQON5ZR.mjs} +32 -28
  17. package/dist/chunk-MSQON5ZR.mjs.map +1 -0
  18. package/dist/{chunk-OT7IZRSM.mjs → chunk-O7PTPMW2.mjs} +2 -2
  19. package/dist/{chunk-EWLXRAWY.mjs → chunk-PBKPYK27.mjs} +237 -298
  20. package/dist/chunk-PBKPYK27.mjs.map +1 -0
  21. package/dist/{chunk-N4C7TX7T.mjs → chunk-R4XGQTDJ.mjs} +3 -3
  22. package/dist/{chunk-FKK4AXDU.mjs → chunk-YRPBTDOU.mjs} +5 -5
  23. package/dist/{embed-page-AgentDetailSideApp-3LBCEKFU.js → embed-page-AgentDetailSideApp-YPN3NDEA.js} +1 -1
  24. package/dist/{embed-page-AgentGovernanceWorkbench-K3JUQNBW.js → embed-page-AgentGovernanceWorkbench-FAZQNPAM.js} +1 -1
  25. package/dist/{embed-page-MessageGraph-3X4ROEN6.js → embed-page-MessageGraph-CEOPX4GM.js} +1 -1
  26. package/dist/{embed-page-ReactChart-F6VYCIYY.js → embed-page-ReactChart-NZAYQOQH.js} +1 -1
  27. package/dist/{embed-page-SkillFlow-3CF7R3CW.js → embed-page-SkillFlow-TPESM4DI.js} +1 -1
  28. package/dist/{embed-page-TasksSideApp-3WRDBZU3.js → embed-page-TasksSideApp-3EAPMISU.js} +1 -1
  29. package/dist/{embed-page-TeamWorkspace-6JSMZYUF.js → embed-page-TeamWorkspace-HB7ER45L.js} +1 -1
  30. package/dist/{embed-page-TopologyRuntimeView-YDFENLHH.js → embed-page-TopologyRuntimeView-O7JPR22B.js} +1 -1
  31. package/dist/{embed-page-WorkflowAutomationView-MP5B7Q2Q.js → embed-page-WorkflowAutomationView-OUXOBHXC.js} +1 -1
  32. package/dist/{embed-page-chunk-YMJGPA3F.js → embed-page-chunk-4SKSUBXL.js} +93 -102
  33. package/dist/{embed-page-chunk-B2E2XOH2.js → embed-page-chunk-5XKUKLZQ.js} +1 -1
  34. package/dist/{embed-page-chunk-UOL6CUAL.js → embed-page-chunk-6C2UZV63.js} +1 -1
  35. package/dist/{embed-page-chunk-IRP6JSSX.js → embed-page-chunk-GCDGRO6A.js} +1 -1
  36. package/dist/{embed-page-chunk-GDTBDOUE.js → embed-page-chunk-ILNGM4RN.js} +38 -38
  37. package/dist/embed-page-chunk-KFUAWYJ7.js +5 -0
  38. package/dist/{embed-page-chunk-FFO7CAYL.js → embed-page-chunk-RTVQJYET.js} +1 -1
  39. package/dist/{embed-page-chunk-QEYWJHEK.js → embed-page-chunk-TQPMRDLI.js} +1 -1
  40. package/dist/{embed-page-chunk-PAJ5NG2Z.js → embed-page-chunk-U6JBLAYD.js} +1 -1
  41. package/dist/{embed-page-chunk-RVXX5HKF.js → embed-page-chunk-ZTRCHYWV.js} +1 -1
  42. package/dist/embed-page.js +1 -1
  43. package/dist/index.d.mts +31 -6
  44. package/dist/index.d.ts +31 -6
  45. package/dist/index.js +224 -194
  46. package/dist/index.js.map +1 -1
  47. package/dist/index.mjs +26 -14
  48. package/dist/index.mjs.map +1 -1
  49. package/package.json +1 -1
  50. package/dist/AgentGovernanceWorkbench-I6S4XU3T.mjs +0 -20
  51. package/dist/chunk-EWLXRAWY.mjs.map +0 -1
  52. package/dist/chunk-LEEQPRDB.mjs.map +0 -1
  53. package/dist/chunk-WQBBDRPU.mjs.map +0 -1
  54. package/dist/embed-page-chunk-URNZX66S.js +0 -5
  55. /package/dist/{AgentDetailSideApp-KVL27KAF.mjs.map → AgentDetailSideApp-EBS7FGQS.mjs.map} +0 -0
  56. /package/dist/{AgentGovernanceWorkbench-I6S4XU3T.mjs.map → AgentGovernanceWorkbench-IHYEFXEU.mjs.map} +0 -0
  57. /package/dist/{MessageGraph-LOSAZQ2V.mjs.map → MessageGraph-CU7TPJJI.mjs.map} +0 -0
  58. /package/dist/{ReactChart-NDLIHCJJ.mjs.map → ReactChart-INAST7XW.mjs.map} +0 -0
  59. /package/dist/{SkillFlow-OVKEKBOL.mjs.map → SkillFlow-TBKF765E.mjs.map} +0 -0
  60. /package/dist/{TasksSideApp-37YKH7HV.mjs.map → TasksSideApp-IN46CQ4D.mjs.map} +0 -0
  61. /package/dist/{TeamWorkspace-EAFZU3KS.mjs.map → TeamWorkspace-IH6F5QYO.mjs.map} +0 -0
  62. /package/dist/{TopologyRuntimeView-53OCKDYA.mjs.map → TopologyRuntimeView-LR3YQQIU.mjs.map} +0 -0
  63. /package/dist/{WorkflowAutomationView-R4EHXT7I.mjs.map → WorkflowAutomationView-GWBROX7L.mjs.map} +0 -0
  64. /package/dist/{chunk-SLXJAOF2.mjs.map → chunk-4PV75HKR.mjs.map} +0 -0
  65. /package/dist/{chunk-YYP5ASCR.mjs.map → chunk-EOBSSJ2W.mjs.map} +0 -0
  66. /package/dist/{chunk-NHD2XFH4.mjs.map → chunk-K7WBURGK.mjs.map} +0 -0
  67. /package/dist/{chunk-AMIVRDYB.mjs.map → chunk-MFAPAXZ2.mjs.map} +0 -0
  68. /package/dist/{chunk-OT7IZRSM.mjs.map → chunk-O7PTPMW2.mjs.map} +0 -0
  69. /package/dist/{chunk-N4C7TX7T.mjs.map → chunk-R4XGQTDJ.mjs.map} +0 -0
  70. /package/dist/{chunk-FKK4AXDU.mjs.map → chunk-YRPBTDOU.mjs.map} +0 -0
@@ -1,23 +1,23 @@
1
1
  import {
2
2
  AgentDetailView
3
- } from "./chunk-WQBBDRPU.mjs";
3
+ } from "./chunk-MSQON5ZR.mjs";
4
4
  import {
5
5
  ProjectScopeProvider_default
6
- } from "./chunk-N4C7TX7T.mjs";
7
- import "./chunk-OT7IZRSM.mjs";
6
+ } from "./chunk-R4XGQTDJ.mjs";
7
+ import "./chunk-O7PTPMW2.mjs";
8
8
  import "./chunk-DTZKYPER.mjs";
9
- import "./chunk-SLXJAOF2.mjs";
9
+ import "./chunk-4PV75HKR.mjs";
10
10
  import "./chunk-7FWCKQNB.mjs";
11
11
  import {
12
12
  useSideAppOpener
13
- } from "./chunk-EWLXRAWY.mjs";
13
+ } from "./chunk-PBKPYK27.mjs";
14
14
  import "./chunk-NSGSGYM7.mjs";
15
- import "./chunk-AMIVRDYB.mjs";
15
+ import "./chunk-MFAPAXZ2.mjs";
16
16
  import "./chunk-XC6TB6PI.mjs";
17
17
  import "./chunk-XAGSG72Y.mjs";
18
18
  import {
19
19
  useApi
20
- } from "./chunk-LEEQPRDB.mjs";
20
+ } from "./chunk-HMBSH53V.mjs";
21
21
  import "./chunk-SH6YXSHR.mjs";
22
22
 
23
23
  // src/components/Governance/AgentDetailSideApp.tsx
@@ -157,4 +157,4 @@ var AgentDetailSideApp = ({ data }) => {
157
157
  export {
158
158
  AgentDetailSideApp
159
159
  };
160
- //# sourceMappingURL=AgentDetailSideApp-KVL27KAF.mjs.map
160
+ //# sourceMappingURL=AgentDetailSideApp-EBS7FGQS.mjs.map
@@ -0,0 +1,20 @@
1
+ import {
2
+ AgentGovernanceWorkbench
3
+ } from "./chunk-EOBSSJ2W.mjs";
4
+ import "./chunk-MSQON5ZR.mjs";
5
+ import "./chunk-R4XGQTDJ.mjs";
6
+ import "./chunk-O7PTPMW2.mjs";
7
+ import "./chunk-DTZKYPER.mjs";
8
+ import "./chunk-4PV75HKR.mjs";
9
+ import "./chunk-7FWCKQNB.mjs";
10
+ import "./chunk-PBKPYK27.mjs";
11
+ import "./chunk-NSGSGYM7.mjs";
12
+ import "./chunk-MFAPAXZ2.mjs";
13
+ import "./chunk-XC6TB6PI.mjs";
14
+ import "./chunk-XAGSG72Y.mjs";
15
+ import "./chunk-HMBSH53V.mjs";
16
+ import "./chunk-SH6YXSHR.mjs";
17
+ export {
18
+ AgentGovernanceWorkbench
19
+ };
20
+ //# sourceMappingURL=AgentGovernanceWorkbench-IHYEFXEU.mjs.map
@@ -9,7 +9,7 @@ import {
9
9
  buildTraceGraph,
10
10
  collapseOlderPhases,
11
11
  formatToolName
12
- } from "./chunk-EWLXRAWY.mjs";
12
+ } from "./chunk-PBKPYK27.mjs";
13
13
  import "./chunk-NSGSGYM7.mjs";
14
14
  import {
15
15
  Handle,
@@ -17,7 +17,7 @@ import {
17
17
  useReactFlow
18
18
  } from "./chunk-XC6TB6PI.mjs";
19
19
  import "./chunk-XAGSG72Y.mjs";
20
- import "./chunk-LEEQPRDB.mjs";
20
+ import "./chunk-HMBSH53V.mjs";
21
21
  import "./chunk-SH6YXSHR.mjs";
22
22
 
23
23
  // src/components/Chat/MessageGraph.tsx
@@ -376,4 +376,4 @@ var MessageGraph = ({
376
376
  export {
377
377
  MessageGraph
378
378
  };
379
- //# sourceMappingURL=MessageGraph-LOSAZQ2V.mjs.map
379
+ //# sourceMappingURL=MessageGraph-CU7TPJJI.mjs.map
@@ -1,8 +1,8 @@
1
1
  import {
2
2
  GenericDataTable
3
- } from "./chunk-EWLXRAWY.mjs";
3
+ } from "./chunk-PBKPYK27.mjs";
4
4
  import "./chunk-NSGSGYM7.mjs";
5
- import "./chunk-LEEQPRDB.mjs";
5
+ import "./chunk-HMBSH53V.mjs";
6
6
  import "./chunk-SH6YXSHR.mjs";
7
7
 
8
8
  // src/components/GenUI/ReactChart.tsx
@@ -452,4 +452,4 @@ var ReactChart = (props) => {
452
452
  export {
453
453
  ReactChart
454
454
  };
455
- //# sourceMappingURL=ReactChart-NDLIHCJJ.mjs.map
455
+ //# sourceMappingURL=ReactChart-INAST7XW.mjs.map
@@ -1,12 +1,12 @@
1
1
  import {
2
2
  SkillFlow_default
3
- } from "./chunk-NHD2XFH4.mjs";
4
- import "./chunk-AMIVRDYB.mjs";
3
+ } from "./chunk-K7WBURGK.mjs";
4
+ import "./chunk-MFAPAXZ2.mjs";
5
5
  import "./chunk-XC6TB6PI.mjs";
6
6
  import "./chunk-XAGSG72Y.mjs";
7
- import "./chunk-LEEQPRDB.mjs";
7
+ import "./chunk-HMBSH53V.mjs";
8
8
  import "./chunk-SH6YXSHR.mjs";
9
9
  export {
10
10
  SkillFlow_default as default
11
11
  };
12
- //# sourceMappingURL=SkillFlow-OVKEKBOL.mjs.map
12
+ //# sourceMappingURL=SkillFlow-TBKF765E.mjs.map
@@ -7,7 +7,7 @@ import {
7
7
  TaskOutlineList,
8
8
  buildTaskGraph,
9
9
  useOpenTaskChat
10
- } from "./chunk-SLXJAOF2.mjs";
10
+ } from "./chunk-4PV75HKR.mjs";
11
11
  import {
12
12
  WorkflowGraphBase,
13
13
  applyDagreLayout
@@ -15,7 +15,7 @@ import {
15
15
  import {
16
16
  FilterSelect,
17
17
  useWorkspaceContext
18
- } from "./chunk-EWLXRAWY.mjs";
18
+ } from "./chunk-PBKPYK27.mjs";
19
19
  import "./chunk-NSGSGYM7.mjs";
20
20
  import {
21
21
  Handle,
@@ -27,7 +27,7 @@ import "./chunk-XAGSG72Y.mjs";
27
27
  import {
28
28
  useAuth,
29
29
  useClient
30
- } from "./chunk-LEEQPRDB.mjs";
30
+ } from "./chunk-HMBSH53V.mjs";
31
31
  import "./chunk-SH6YXSHR.mjs";
32
32
 
33
33
  // src/components/Tasks/TasksSideApp.tsx
@@ -1094,4 +1094,4 @@ var TasksSideApp = ({ statusFilter, getOwnerLabel, showProjectFilter = true, ini
1094
1094
  export {
1095
1095
  TasksSideApp
1096
1096
  };
1097
- //# sourceMappingURL=TasksSideApp-37YKH7HV.mjs.map
1097
+ //# sourceMappingURL=TasksSideApp-IN46CQ4D.mjs.map
@@ -3,7 +3,7 @@ import {
3
3
  Chating,
4
4
  MailboxPanel,
5
5
  useAgentState
6
- } from "./chunk-EWLXRAWY.mjs";
6
+ } from "./chunk-PBKPYK27.mjs";
7
7
  import "./chunk-NSGSGYM7.mjs";
8
8
  import {
9
9
  Background,
@@ -15,7 +15,7 @@ import {
15
15
  useReactFlow
16
16
  } from "./chunk-XC6TB6PI.mjs";
17
17
  import "./chunk-XAGSG72Y.mjs";
18
- import "./chunk-LEEQPRDB.mjs";
18
+ import "./chunk-HMBSH53V.mjs";
19
19
  import "./chunk-SH6YXSHR.mjs";
20
20
 
21
21
  // src/components/GenUI/elements/TeamWorkspace/index.tsx
@@ -2409,4 +2409,4 @@ export {
2409
2409
  TeamWorkspace,
2410
2410
  TeamWorkspace_default as default
2411
2411
  };
2412
- //# sourceMappingURL=TeamWorkspace-EAFZU3KS.mjs.map
2412
+ //# sourceMappingURL=TeamWorkspace-IH6F5QYO.mjs.map
@@ -1,11 +1,11 @@
1
1
  import {
2
2
  WorkflowCanvas,
3
3
  expandWorkflow
4
- } from "./chunk-OT7IZRSM.mjs";
4
+ } from "./chunk-O7PTPMW2.mjs";
5
5
  import "./chunk-7FWCKQNB.mjs";
6
6
  import {
7
7
  MDResponse
8
- } from "./chunk-EWLXRAWY.mjs";
8
+ } from "./chunk-PBKPYK27.mjs";
9
9
  import "./chunk-NSGSGYM7.mjs";
10
10
  import {
11
11
  Background,
@@ -23,7 +23,7 @@ import {
23
23
  import "./chunk-XAGSG72Y.mjs";
24
24
  import {
25
25
  useApi
26
- } from "./chunk-LEEQPRDB.mjs";
26
+ } from "./chunk-HMBSH53V.mjs";
27
27
  import "./chunk-SH6YXSHR.mjs";
28
28
 
29
29
  // src/components/Chat/TopologyRuntimeView.tsx
@@ -811,4 +811,4 @@ var TopologyRuntimeView = () => {
811
811
  export {
812
812
  TopologyRuntimeView
813
813
  };
814
- //# sourceMappingURL=TopologyRuntimeView-53OCKDYA.mjs.map
814
+ //# sourceMappingURL=TopologyRuntimeView-LR3YQQIU.mjs.map
@@ -1,18 +1,18 @@
1
1
  import {
2
2
  WorkflowAutomationView,
3
3
  WorkflowAutomationView_default
4
- } from "./chunk-FKK4AXDU.mjs";
5
- import "./chunk-N4C7TX7T.mjs";
6
- import "./chunk-OT7IZRSM.mjs";
4
+ } from "./chunk-YRPBTDOU.mjs";
5
+ import "./chunk-R4XGQTDJ.mjs";
6
+ import "./chunk-O7PTPMW2.mjs";
7
7
  import "./chunk-7FWCKQNB.mjs";
8
- import "./chunk-EWLXRAWY.mjs";
8
+ import "./chunk-PBKPYK27.mjs";
9
9
  import "./chunk-NSGSGYM7.mjs";
10
10
  import "./chunk-XC6TB6PI.mjs";
11
11
  import "./chunk-XAGSG72Y.mjs";
12
- import "./chunk-LEEQPRDB.mjs";
12
+ import "./chunk-HMBSH53V.mjs";
13
13
  import "./chunk-SH6YXSHR.mjs";
14
14
  export {
15
15
  WorkflowAutomationView,
16
16
  WorkflowAutomationView_default as default
17
17
  };
18
- //# sourceMappingURL=WorkflowAutomationView-R4EHXT7I.mjs.map
18
+ //# sourceMappingURL=WorkflowAutomationView-GWBROX7L.mjs.map
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  MDResponse,
3
3
  useChatUIContext
4
- } from "./chunk-EWLXRAWY.mjs";
4
+ } from "./chunk-PBKPYK27.mjs";
5
5
 
6
6
  // src/components/Tasks/TaskOutlineList.tsx
7
7
  import {
@@ -2025,4 +2025,4 @@ export {
2025
2025
  TaskDetailPanel,
2026
2026
  useOpenTaskChat
2027
2027
  };
2028
- //# sourceMappingURL=chunk-SLXJAOF2.mjs.map
2028
+ //# sourceMappingURL=chunk-4PV75HKR.mjs.map
@@ -11,17 +11,17 @@ import {
11
11
  shortHash,
12
12
  startLearningRound,
13
13
  statusHex
14
- } from "./chunk-WQBBDRPU.mjs";
14
+ } from "./chunk-MSQON5ZR.mjs";
15
15
  import {
16
16
  ProjectScopeProvider_default,
17
17
  TrainingContextCard
18
- } from "./chunk-N4C7TX7T.mjs";
18
+ } from "./chunk-R4XGQTDJ.mjs";
19
19
  import {
20
20
  EntityListView,
21
21
  FilterSelect,
22
22
  useSideAppOpener,
23
23
  useWorkspaceContext
24
- } from "./chunk-EWLXRAWY.mjs";
24
+ } from "./chunk-PBKPYK27.mjs";
25
25
  import {
26
26
  Background,
27
27
  Controls,
@@ -35,7 +35,7 @@ import {
35
35
  import {
36
36
  useApi,
37
37
  useClient
38
- } from "./chunk-LEEQPRDB.mjs";
38
+ } from "./chunk-HMBSH53V.mjs";
39
39
 
40
40
  // src/components/Governance/AgentGovernanceWorkbench.tsx
41
41
  import React6, { useCallback as useCallback3, useEffect as useEffect4, useState as useState5 } from "react";
@@ -1833,4 +1833,4 @@ export {
1833
1833
  CreateAssistantModal_default,
1834
1834
  AgentGovernanceWorkbench
1835
1835
  };
1836
- //# sourceMappingURL=chunk-YYP5ASCR.mjs.map
1836
+ //# sourceMappingURL=chunk-EOBSSJ2W.mjs.map
@@ -1,3 +1,66 @@
1
+ // src/utils/authStorage.ts
2
+ var AUTH_KEYS = [
3
+ "lattice_token",
4
+ "lattice_user",
5
+ "lattice_tenants",
6
+ "lattice_current_tenant",
7
+ "lattice_personal_assistant"
8
+ ];
9
+ var PERSONAL_ASSISTANT_PREFIX = "lattice_personal_assistant_";
10
+ function isStandalonePwa() {
11
+ if (typeof window === "undefined") return false;
12
+ try {
13
+ const displayMode = window.matchMedia?.("(display-mode: standalone)")?.matches === true;
14
+ const iosStandalone = window.navigator?.standalone === true;
15
+ return displayMode || iosStandalone;
16
+ } catch {
17
+ return false;
18
+ }
19
+ }
20
+ function authStorage() {
21
+ if (typeof window === "undefined") return sessionStorage;
22
+ return isStandalonePwa() ? window.localStorage : window.sessionStorage;
23
+ }
24
+ function readAuthItem(key) {
25
+ const primary = authStorage();
26
+ const value = primary.getItem(key);
27
+ if (value !== null) return value;
28
+ if (primary !== window.localStorage) return null;
29
+ const legacy = window.sessionStorage.getItem(key);
30
+ if (legacy !== null) {
31
+ window.localStorage.setItem(key, legacy);
32
+ return legacy;
33
+ }
34
+ return null;
35
+ }
36
+ function writeAuthItem(key, value) {
37
+ authStorage().setItem(key, value);
38
+ }
39
+ function removeAuthItem(key) {
40
+ try {
41
+ window.localStorage.removeItem(key);
42
+ } catch {
43
+ }
44
+ try {
45
+ window.sessionStorage.removeItem(key);
46
+ } catch {
47
+ }
48
+ }
49
+ function clearAuthItems() {
50
+ if (typeof window === "undefined") return;
51
+ const keys = new Set(AUTH_KEYS);
52
+ for (const storage of [window.localStorage, window.sessionStorage]) {
53
+ try {
54
+ for (let index = 0; index < storage.length; index += 1) {
55
+ const key = storage.key(index);
56
+ if (key !== null && key.startsWith(PERSONAL_ASSISTANT_PREFIX)) keys.add(key);
57
+ }
58
+ } catch {
59
+ }
60
+ }
61
+ for (const key of keys) removeAuthItem(key);
62
+ }
63
+
1
64
  // src/context/AuthContext.tsx
2
65
  import { createContext, useContext, useState, useCallback, useEffect, useRef } from "react";
3
66
  import { jsx } from "react/jsx-runtime";
@@ -30,9 +93,9 @@ var AuthProvider = ({
30
93
  const currentTenantRef = useRef(currentTenant);
31
94
  currentTenantRef.current = currentTenant;
32
95
  useEffect(() => {
33
- const storedUser = sessionStorage.getItem("lattice_user");
34
- const storedTenants = sessionStorage.getItem("lattice_tenants");
35
- const storedCurrentTenant = sessionStorage.getItem("lattice_current_tenant");
96
+ const storedUser = readAuthItem("lattice_user");
97
+ const storedTenants = readAuthItem("lattice_tenants");
98
+ const storedCurrentTenant = readAuthItem("lattice_current_tenant");
36
99
  if (storedUser) {
37
100
  try {
38
101
  const userData = JSON.parse(storedUser);
@@ -41,14 +104,14 @@ var AuthProvider = ({
41
104
  if (storedCurrentTenant) {
42
105
  const ct = JSON.parse(storedCurrentTenant);
43
106
  setCurrentTenant(ct);
44
- const storedPA = sessionStorage.getItem(getPAKey(ct.id));
107
+ const storedPA = readAuthItem(getPAKey(ct.id));
45
108
  if (storedPA) setPersonalAssistant(JSON.parse(storedPA));
46
109
  }
47
110
  } catch {
48
- sessionStorage.removeItem("lattice_user");
49
- sessionStorage.removeItem("lattice_tenants");
50
- sessionStorage.removeItem("lattice_current_tenant");
51
- sessionStorage.removeItem("lattice_personal_assistant");
111
+ removeAuthItem("lattice_user");
112
+ removeAuthItem("lattice_tenants");
113
+ removeAuthItem("lattice_current_tenant");
114
+ removeAuthItem("lattice_personal_assistant");
52
115
  }
53
116
  }
54
117
  }, []);
@@ -74,10 +137,10 @@ var AuthProvider = ({
74
137
  const { user: userData, tenants: tenantList, token, requiresTenantSelection, hasTenants } = result.data;
75
138
  setUser(userData);
76
139
  setTenants(tenantList || []);
77
- sessionStorage.setItem("lattice_user", JSON.stringify(userData));
78
- sessionStorage.setItem("lattice_tenants", JSON.stringify(tenantList || []));
140
+ writeAuthItem("lattice_user", JSON.stringify(userData));
141
+ writeAuthItem("lattice_tenants", JSON.stringify(tenantList || []));
79
142
  if (token) {
80
- sessionStorage.setItem("lattice_token", token);
143
+ writeAuthItem("lattice_token", token);
81
144
  }
82
145
  onLoginSuccess?.(userData, tenantList || []);
83
146
  return { requiresTenantSelection, hasTenants };
@@ -103,7 +166,7 @@ var AuthProvider = ({
103
166
  throw new Error(data.error || "Registration failed");
104
167
  }
105
168
  if (data.data?.token) {
106
- sessionStorage.setItem("lattice_token", data.data.token);
169
+ writeAuthItem("lattice_token", data.data.token);
107
170
  }
108
171
  return { message: data.message || "Registration successful!", token: data.data?.token };
109
172
  } catch (err) {
@@ -119,7 +182,7 @@ var AuthProvider = ({
119
182
  setTenants([]);
120
183
  setCurrentTenant(null);
121
184
  setPersonalAssistant(null);
122
- sessionStorage.clear();
185
+ clearAuthItems();
123
186
  onLogout?.();
124
187
  }, [onLogout]);
125
188
  useEffect(() => {
@@ -138,8 +201,8 @@ var AuthProvider = ({
138
201
  method: "POST",
139
202
  headers: {
140
203
  "Content-Type": "application/json",
141
- ...sessionStorage.getItem("lattice_token") && {
142
- Authorization: `Bearer ${sessionStorage.getItem("lattice_token")}`
204
+ ...readAuthItem("lattice_token") && {
205
+ Authorization: `Bearer ${readAuthItem("lattice_token")}`
143
206
  }
144
207
  },
145
208
  body: JSON.stringify({ tenantId })
@@ -158,19 +221,19 @@ var AuthProvider = ({
158
221
  const tenantData = result.data.tenant;
159
222
  const oldTenantId = currentTenantRef.current?.id;
160
223
  if (oldTenantId) {
161
- sessionStorage.removeItem(getPAKey(oldTenantId));
224
+ removeAuthItem(getPAKey(oldTenantId));
162
225
  }
163
226
  setCurrentTenant(tenantData);
164
- sessionStorage.setItem("lattice_current_tenant", JSON.stringify(tenantData));
227
+ writeAuthItem("lattice_current_tenant", JSON.stringify(tenantData));
165
228
  setPersonalAssistant(result.data.personalAssistant || null);
166
229
  if (result.data.personalAssistant) {
167
230
  const paWithTenant = { ...result.data.personalAssistant, tenantId: tenantData.id };
168
- sessionStorage.setItem(getPAKey(tenantData.id), JSON.stringify(paWithTenant));
231
+ writeAuthItem(getPAKey(tenantData.id), JSON.stringify(paWithTenant));
169
232
  } else {
170
- sessionStorage.removeItem(getPAKey(tenantData.id));
233
+ removeAuthItem(getPAKey(tenantData.id));
171
234
  }
172
235
  if (result.data.token) {
173
- sessionStorage.setItem("lattice_token", result.data.token);
236
+ writeAuthItem("lattice_token", result.data.token);
174
237
  }
175
238
  onTenantSelected?.(tenantData);
176
239
  } catch (err) {
@@ -187,8 +250,8 @@ var AuthProvider = ({
187
250
  try {
188
251
  const response = await fetch(`${baseURL}/api/auth/tenants`, {
189
252
  headers: {
190
- ...sessionStorage.getItem("lattice_token") && {
191
- Authorization: `Bearer ${sessionStorage.getItem("lattice_token")}`
253
+ ...readAuthItem("lattice_token") && {
254
+ Authorization: `Bearer ${readAuthItem("lattice_token")}`
192
255
  }
193
256
  }
194
257
  });
@@ -209,7 +272,7 @@ var AuthProvider = ({
209
272
  tenant: item.tenant
210
273
  }));
211
274
  setTenants(tenantList);
212
- sessionStorage.setItem("lattice_tenants", JSON.stringify(tenantList));
275
+ writeAuthItem("lattice_tenants", JSON.stringify(tenantList));
213
276
  } catch (err) {
214
277
  const message = err instanceof Error ? err.message : "Failed to fetch tenants";
215
278
  setError(message);
@@ -223,8 +286,8 @@ var AuthProvider = ({
223
286
  try {
224
287
  const response = await fetch(`${baseURL}/api/users/${user.id}`, {
225
288
  headers: {
226
- ...sessionStorage.getItem("lattice_token") && {
227
- Authorization: `Bearer ${sessionStorage.getItem("lattice_token")}`
289
+ ...readAuthItem("lattice_token") && {
290
+ Authorization: `Bearer ${readAuthItem("lattice_token")}`
228
291
  }
229
292
  }
230
293
  });
@@ -240,7 +303,7 @@ var AuthProvider = ({
240
303
  }
241
304
  const { data } = await response.json();
242
305
  setUser(data);
243
- sessionStorage.setItem("lattice_user", JSON.stringify(data));
306
+ writeAuthItem("lattice_user", JSON.stringify(data));
244
307
  } catch (err) {
245
308
  const message = err instanceof Error ? err.message : "Failed to refresh user";
246
309
  setError(message);
@@ -259,8 +322,8 @@ var AuthProvider = ({
259
322
  method: "POST",
260
323
  headers: {
261
324
  "Content-Type": "application/json",
262
- ...sessionStorage.getItem("lattice_token") && {
263
- Authorization: `Bearer ${sessionStorage.getItem("lattice_token")}`
325
+ ...readAuthItem("lattice_token") && {
326
+ Authorization: `Bearer ${readAuthItem("lattice_token")}`
264
327
  }
265
328
  },
266
329
  body: JSON.stringify({ currentPassword, newPassword })
@@ -291,12 +354,12 @@ var AuthProvider = ({
291
354
  const tenantId = currentTenantRef.current?.id;
292
355
  if (info) {
293
356
  const paWithTenant = { ...info, tenantId: tenantId || info.tenantId };
294
- sessionStorage.setItem(getPAKey(tenantId), JSON.stringify(paWithTenant));
357
+ writeAuthItem(getPAKey(tenantId), JSON.stringify(paWithTenant));
295
358
  } else {
296
359
  if (tenantId) {
297
- sessionStorage.removeItem(getPAKey(tenantId));
360
+ removeAuthItem(getPAKey(tenantId));
298
361
  }
299
- sessionStorage.removeItem("lattice_personal_assistant");
362
+ removeAuthItem("lattice_personal_assistant");
300
363
  }
301
364
  }, []);
302
365
  const value = {
@@ -348,7 +411,7 @@ function AxiomLatticeProvider({
348
411
  const tenantId = authContext?.currentTenant?.id;
349
412
  const effectiveApiKey = useMemo(() => {
350
413
  if (authContext?.isAuthenticated) {
351
- return sessionStorage.getItem("lattice_token") || config.apiKey;
414
+ return readAuthItem("lattice_token") || config.apiKey;
352
415
  }
353
416
  return config.apiKey;
354
417
  }, [authContext?.isAuthenticated, authContext?.currentTenant?.id, config.apiKey]);
@@ -1075,6 +1138,12 @@ function useApi(options) {
1075
1138
  }
1076
1139
 
1077
1140
  export {
1141
+ isStandalonePwa,
1142
+ authStorage,
1143
+ readAuthItem,
1144
+ writeAuthItem,
1145
+ removeAuthItem,
1146
+ clearAuthItems,
1078
1147
  useAuth,
1079
1148
  useAuthOptional,
1080
1149
  AuthProvider,
@@ -1087,4 +1156,4 @@ export {
1087
1156
  useLatticeChatShellContext,
1088
1157
  useApi
1089
1158
  };
1090
- //# sourceMappingURL=chunk-LEEQPRDB.mjs.map
1159
+ //# sourceMappingURL=chunk-HMBSH53V.mjs.map