@rebasepro/studio 0.1.2 → 0.2.1

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 (72) hide show
  1. package/LICENSE +17 -109
  2. package/dist/{ApiExplorer-DHVmWYfK.js → ApiExplorer-BmcdhAX0.js} +3 -4
  3. package/dist/ApiExplorer-BmcdhAX0.js.map +1 -0
  4. package/dist/{AuthSimulationSelector-CM488Eei.js → AuthSimulationSelector-DGoXkWSg.js} +2 -3
  5. package/dist/AuthSimulationSelector-DGoXkWSg.js.map +1 -0
  6. package/dist/{BranchesView-DcHZtvXo.js → BranchesView-BiTEwIhd.js} +2 -3
  7. package/dist/BranchesView-BiTEwIhd.js.map +1 -0
  8. package/dist/{CronJobsView-CijCToeK.js → CronJobsView-CNfz0etw.js} +2 -3
  9. package/dist/CronJobsView-CNfz0etw.js.map +1 -0
  10. package/dist/{JSEditor-CSHA0t_O.js → JSEditor-Ch8z8lJ4.js} +4 -5
  11. package/dist/JSEditor-Ch8z8lJ4.js.map +1 -0
  12. package/dist/{RLSEditor-BzDjqo6w.js → RLSEditor-CHEExeSB.js} +2 -3
  13. package/dist/RLSEditor-CHEExeSB.js.map +1 -0
  14. package/dist/{SQLEditor-Cr9Kg_Qg.js → SQLEditor-BELYJQRP.js} +75 -58
  15. package/dist/SQLEditor-BELYJQRP.js.map +1 -0
  16. package/dist/{StorageView-BYoslzBR.js → StorageView-B7AsN2qX.js} +2 -3
  17. package/dist/StorageView-B7AsN2qX.js.map +1 -0
  18. package/dist/common/src/util/entities.d.ts +2 -2
  19. package/dist/common/src/util/relations.d.ts +1 -1
  20. package/dist/core/src/components/LoginView/LoginView.d.ts +1 -6
  21. package/dist/core/src/contexts/SnackbarProvider.d.ts +1 -1
  22. package/dist/core/src/hooks/data/save.d.ts +2 -2
  23. package/dist/core/src/hooks/data/useEntityFetch.d.ts +5 -0
  24. package/dist/core/src/hooks/useResolvedComponent.d.ts +1 -1
  25. package/dist/index.es.js +8 -9
  26. package/dist/index.es.js.map +1 -1
  27. package/dist/index.umd.js +168 -150
  28. package/dist/index.umd.js.map +1 -1
  29. package/dist/types/src/controllers/auth.d.ts +9 -8
  30. package/dist/types/src/controllers/client.d.ts +3 -0
  31. package/dist/types/src/types/auth_adapter.d.ts +356 -0
  32. package/dist/types/src/types/collections.d.ts +67 -2
  33. package/dist/types/src/types/database_adapter.d.ts +94 -0
  34. package/dist/types/src/types/entity_actions.d.ts +7 -1
  35. package/dist/types/src/types/entity_callbacks.d.ts +1 -1
  36. package/dist/types/src/types/entity_views.d.ts +36 -1
  37. package/dist/types/src/types/index.d.ts +2 -0
  38. package/dist/types/src/types/plugins.d.ts +1 -1
  39. package/dist/types/src/types/properties.d.ts +24 -5
  40. package/dist/types/src/types/property_config.d.ts +6 -2
  41. package/dist/types/src/types/relations.d.ts +1 -1
  42. package/dist/types/src/types/translations.d.ts +8 -0
  43. package/dist/types/src/users/user.d.ts +5 -0
  44. package/dist/ui/src/components/FilterChip.d.ts +42 -0
  45. package/dist/ui/src/components/index.d.ts +5 -0
  46. package/dist/ui/src/icons/index.d.ts +2 -0
  47. package/package.json +21 -18
  48. package/src/components/ApiExplorer/ApiExplorer.tsx +1 -1
  49. package/src/components/ApiExplorer/EndpointDetail.tsx +10 -2
  50. package/src/components/ApiExplorer/TryItPanel.tsx +17 -6
  51. package/src/components/AuthSimulationSelector.tsx +1 -2
  52. package/src/components/Branches/BranchesView.tsx +24 -2
  53. package/src/components/CronJobs/CronJobsView.tsx +19 -2
  54. package/src/components/JSEditor/JSEditor.tsx +37 -6
  55. package/src/components/JSEditor/JSEditorSidebar.tsx +12 -2
  56. package/src/components/JSEditor/JSMonacoEditor.tsx +16 -3
  57. package/src/components/RLSEditor/PolicyEditor.tsx +19 -2
  58. package/src/components/RLSEditor/RLSEditor.tsx +22 -2
  59. package/src/components/SQLEditor/SQLEditor.tsx +124 -68
  60. package/src/components/SQLEditor/SQLEditorSidebar.tsx +1 -2
  61. package/src/components/SQLEditor/SchemaBrowser.tsx +14 -2
  62. package/src/components/StorageView/StorageView.tsx +39 -2
  63. package/src/components/StudioHomePage.tsx +1 -2
  64. package/src/utils/sql_utils.ts +1 -1
  65. package/dist/ApiExplorer-DHVmWYfK.js.map +0 -1
  66. package/dist/AuthSimulationSelector-CM488Eei.js.map +0 -1
  67. package/dist/BranchesView-DcHZtvXo.js.map +0 -1
  68. package/dist/CronJobsView-CijCToeK.js.map +0 -1
  69. package/dist/JSEditor-CSHA0t_O.js.map +0 -1
  70. package/dist/RLSEditor-BzDjqo6w.js.map +0 -1
  71. package/dist/SQLEditor-Cr9Kg_Qg.js.map +0 -1
  72. package/dist/StorageView-BYoslzBR.js.map +0 -1
package/dist/index.umd.js CHANGED
@@ -1,6 +1,6 @@
1
1
  (function(global, factory) {
2
- typeof exports === "object" && typeof module !== "undefined" ? factory(exports, require("@rebasepro/core"), require("react/jsx-runtime"), require("react"), require("@rebasepro/ui"), require("react-compiler-runtime"), require("lucide-react"), require("react-router-dom"), require("react-dom"), require("pgsql-ast-parser"), require("@rebasepro/utils"), require("prism-react-renderer"), require("@rebasepro/client"), require("@monaco-editor/react"), require("@rebasepro/types"), require("react-dropzone"), require("@xyflow/react"), require("@xyflow/react/dist/style.css"), require("@rebasepro/common"), require("dagre")) : typeof define === "function" && define.amd ? define(["exports", "@rebasepro/core", "react/jsx-runtime", "react", "@rebasepro/ui", "react-compiler-runtime", "lucide-react", "react-router-dom", "react-dom", "pgsql-ast-parser", "@rebasepro/utils", "prism-react-renderer", "@rebasepro/client", "@monaco-editor/react", "@rebasepro/types", "react-dropzone", "@xyflow/react", "@xyflow/react/dist/style.css", "@rebasepro/common", "dagre"], factory) : (global = typeof globalThis !== "undefined" ? globalThis : global || self, factory(global["Rebase collection editor"] = {}, global.core, global.jsxRuntime, global.React, global.ui, global.reactCompilerRuntime, global.lucideReact, global.reactRouterDom, global.reactDom, global.pgsqlAstParser, global.utils, global.prismReactRenderer, global.client, global.Editor, global.types, global.reactDropzone, global.react, null, global.common, global.dagre));
3
- })(this, (function(exports2, core, jsxRuntime, React, ui, reactCompilerRuntime, lucideReact, reactRouterDom, reactDom, pgsqlAstParser, utils, prismReactRenderer, client, Editor, types, reactDropzone, react, style_css, common, dagre) {
2
+ typeof exports === "object" && typeof module !== "undefined" ? factory(exports, require("@rebasepro/core"), require("react/jsx-runtime"), require("react"), require("@rebasepro/ui"), require("react-compiler-runtime"), require("react-router-dom"), require("react-dom"), require("pgsql-ast-parser"), require("@rebasepro/utils"), require("prism-react-renderer"), require("@rebasepro/client"), require("@monaco-editor/react"), require("@rebasepro/types"), require("react-dropzone"), require("@xyflow/react"), require("@xyflow/react/dist/style.css"), require("@rebasepro/common"), require("dagre")) : typeof define === "function" && define.amd ? define(["exports", "@rebasepro/core", "react/jsx-runtime", "react", "@rebasepro/ui", "react-compiler-runtime", "react-router-dom", "react-dom", "pgsql-ast-parser", "@rebasepro/utils", "prism-react-renderer", "@rebasepro/client", "@monaco-editor/react", "@rebasepro/types", "react-dropzone", "@xyflow/react", "@xyflow/react/dist/style.css", "@rebasepro/common", "dagre"], factory) : (global = typeof globalThis !== "undefined" ? globalThis : global || self, factory(global["Rebase collection editor"] = {}, global.core, global.jsxRuntime, global.React, global.ui, global.reactCompilerRuntime, global.reactRouterDom, global.reactDom, global.pgsqlAstParser, global.utils, global.prismReactRenderer, global.client, global.Editor, global.types, global.reactDropzone, global.react, null, global.common, global.dagre));
3
+ })(this, (function(exports2, core, jsxRuntime, React, ui, reactCompilerRuntime, reactRouterDom, reactDom, pgsqlAstParser, utils, prismReactRenderer, client, Editor, types, reactDropzone, react, style_css, common, dagre) {
4
4
  "use strict";
5
5
  const SECTIONS = [{
6
6
  label: "Database",
@@ -170,7 +170,7 @@
170
170
  ] }),
171
171
  /* @__PURE__ */ jsxRuntime.jsx("div", { style: {
172
172
  alignSelf: "flex-end"
173
- }, children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "p-2", children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ArrowRightIcon, { className: "text-primary", size: ui.iconSize.small }) }) })
173
+ }, children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "p-2", children: /* @__PURE__ */ jsxRuntime.jsx(ui.ArrowRightIcon, { className: "text-primary", size: ui.iconSize.small }) }) })
174
174
  ] }) }, tool.path)) })
175
175
  ] }, section.label));
176
176
  $[10] = context;
@@ -887,7 +887,7 @@
887
887
  return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col h-full overflow-hidden", children: [
888
888
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: ui.cls("flex items-center justify-between px-3 py-2 border-b bg-surface-50 dark:bg-surface-900 min-h-[48px]", ui.defaultBorderMixin), children: [
889
889
  /* @__PURE__ */ jsxRuntime.jsx(ui.Typography, { variant: "caption", className: "font-bold uppercase tracking-wider text-text-disabled dark:text-text-disabled-dark", children: t("studio_schema_tables") }),
890
- /* @__PURE__ */ jsxRuntime.jsx(ui.IconButton, { size: "small", onClick: onRetrySchema, title: "Refresh schema", children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.RefreshCwIcon, { size: ui.iconSize.smallest }) })
890
+ /* @__PURE__ */ jsxRuntime.jsx(ui.IconButton, { size: "small", onClick: onRetrySchema, title: "Refresh schema", children: /* @__PURE__ */ jsxRuntime.jsx(ui.RefreshCwIcon, { size: ui.iconSize.smallest }) })
891
891
  ] }),
892
892
  /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex-grow overflow-y-auto no-scrollbar p-1", children: Object.keys(schemas).length === 0 ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "p-4 text-center", children: /* @__PURE__ */ jsxRuntime.jsx(ui.Typography, { variant: "caption", className: "text-text-disabled dark:text-text-disabled-dark italic", children: t("studio_schema_no_tables") }) }) : Object.entries(schemas).map(([schemaName, tables]) => /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "mb-2", children: [
893
893
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center p-1 cursor-pointer hover:bg-surface-100 dark:hover:bg-surface-950 rounded transition-colors", onClick: () => setExpandedSchemas((prev) => ({
@@ -909,8 +909,8 @@
909
909
  /* @__PURE__ */ jsxRuntime.jsx(ui.IconButton, { size: "small", onClick: (e) => {
910
910
  e.stopPropagation();
911
911
  navigator.clipboard.writeText(table.tableName);
912
- }, title: "CopyIcon table name", children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.CopyIcon, { size: ui.iconSize.small }) }),
913
- /* @__PURE__ */ jsxRuntime.jsxs(ui.Menu, { trigger: /* @__PURE__ */ jsxRuntime.jsx(ui.IconButton, { size: "small", onClick: (e_0) => e_0.stopPropagation(), title: "Generate SQL templates", children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.MoreVerticalIcon, { size: ui.iconSize.small }) }), children: [
912
+ }, title: "CopyIcon table name", children: /* @__PURE__ */ jsxRuntime.jsx(ui.CopyIcon, { size: ui.iconSize.small }) }),
913
+ /* @__PURE__ */ jsxRuntime.jsxs(ui.Menu, { trigger: /* @__PURE__ */ jsxRuntime.jsx(ui.IconButton, { size: "small", onClick: (e_0) => e_0.stopPropagation(), title: "Generate SQL templates", children: /* @__PURE__ */ jsxRuntime.jsx(ui.MoreVerticalIcon, { size: ui.iconSize.small }) }), children: [
914
914
  /* @__PURE__ */ jsxRuntime.jsx(ui.MenuItem, { dense: true, className: "text-xs", onClick: (e_1) => {
915
915
  e_1.stopPropagation();
916
916
  onTableClick?.(`SELECT * FROM ${schemaName !== "public" ? `${schemaName}.` : ""}${table.tableName} LIMIT 100;`);
@@ -950,7 +950,7 @@ WHERE id = ?;`);
950
950
  /* @__PURE__ */ jsxRuntime.jsx(ui.IconButton, { size: "smallest", className: "opacity-0 group-hover:opacity-100 absolute right-1 bg-surface-50 dark:bg-surface-800 transition-colors pointer-events-auto", onClick: (e_6) => {
951
951
  e_6.stopPropagation();
952
952
  navigator.clipboard.writeText(col.name);
953
- }, title: "CopyIcon column name", children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.CopyIcon, { size: ui.iconSize.smallest }) })
953
+ }, title: "CopyIcon column name", children: /* @__PURE__ */ jsxRuntime.jsx(ui.CopyIcon, { size: ui.iconSize.smallest }) })
954
954
  ] }, col.name)) })
955
955
  ] }, table.tableName)) })
956
956
  ] }, schemaName)) })
@@ -996,7 +996,7 @@ WHERE id = ?;`);
996
996
  /* @__PURE__ */ jsxRuntime.jsx(ui.IconButton, { size: "smallest", className: "absolute right-1 top-1 opacity-0 group-hover:opacity-100 text-text-disabled hover:text-red-500 transition-opacity", onClick: (e) => {
997
997
  e.stopPropagation();
998
998
  onDeleteSnippet(snippet.id);
999
- }, children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Trash2Icon, { size: ui.iconSize.smallest }) })
999
+ }, children: /* @__PURE__ */ jsxRuntime.jsx(ui.Trash2Icon, { size: ui.iconSize.smallest }) })
1000
1000
  ] }, snippet.id)) })
1001
1001
  ] }),
1002
1002
  others.length > 0 && /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
@@ -1007,7 +1007,7 @@ WHERE id = ?;`);
1007
1007
  /* @__PURE__ */ jsxRuntime.jsx(ui.IconButton, { size: "smallest", className: "absolute right-1 top-1 opacity-0 group-hover:opacity-100 text-text-disabled hover:text-red-500 transition-opacity", onClick: (e_0) => {
1008
1008
  e_0.stopPropagation();
1009
1009
  onDeleteSnippet(snippet_0.id);
1010
- }, children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Trash2Icon, { size: ui.iconSize.smallest }) })
1010
+ }, children: /* @__PURE__ */ jsxRuntime.jsx(ui.Trash2Icon, { size: ui.iconSize.smallest }) })
1011
1011
  ] }, snippet_0.id)) })
1012
1012
  ] })
1013
1013
  ] }) })
@@ -1558,14 +1558,6 @@ WHERE id = ?;`);
1558
1558
  function _temp$6(childPlan, idx) {
1559
1559
  return /* @__PURE__ */ jsxRuntime.jsx(ExplainVisualizer, { plan: childPlan, isRoot: false }, idx);
1560
1560
  }
1561
- let VirtualTableInput = null;
1562
- try {
1563
- const cms = require("@rebasepro/admin");
1564
- VirtualTableInput = cms.VirtualTableInput;
1565
- } catch {
1566
- }
1567
- const STORAGE_KEY_TABS = "rebase_sql_tabs";
1568
- const STORAGE_KEY_ACTIVE_TAB = "rebase_sql_active_tab";
1569
1561
  const FixedEditorOverlay = (t0) => {
1570
1562
  const $ = reactCompilerRuntime.c(26);
1571
1563
  const {
@@ -1723,9 +1715,14 @@ WHERE id = ?;`);
1723
1715
  }
1724
1716
  return t13;
1725
1717
  };
1718
+ const getStoragePrefix = (baseUrl) => {
1719
+ if (!baseUrl) return "default";
1720
+ return baseUrl.replace(/^https?:\/\//, "").replace(/[^a-zA-Z0-9]/g, "_");
1721
+ };
1726
1722
  const SQLEditor = () => {
1727
1723
  const {
1728
- databaseAdmin
1724
+ databaseAdmin,
1725
+ client: client2
1729
1726
  } = core.useRebaseContext();
1730
1727
  const sideEntityController = core.useStudioSideEntityController();
1731
1728
  const snackbarController = core.useSnackbarController();
@@ -1733,22 +1730,26 @@ WHERE id = ?;`);
1733
1730
  const {
1734
1731
  t
1735
1732
  } = core.useTranslation();
1733
+ const projectPrefix = React.useMemo(() => getStoragePrefix(client2?.baseUrl), [client2?.baseUrl]);
1736
1734
  const [schemas, setSchemas] = React.useState({});
1737
1735
  const [isSchemaLoading, setIsSchemaLoading] = React.useState(true);
1738
1736
  const schemaFetchedRef = React.useRef(false);
1739
1737
  const [schemaError, setSchemaError] = React.useState(null);
1740
1738
  const [selectedDatabase, setSelectedDatabase] = React.useState(() => {
1741
- return localStorage.getItem("rebase_sql_selected_db") || void 0;
1739
+ const projectPrefixSync = client2?.baseUrl ? client2.baseUrl.replace(/^https?:\/\//, "").replace(/[^a-zA-Z0-9]/g, "_") : "default";
1740
+ return localStorage.getItem(`rebase_sql_selected_db_${projectPrefixSync}`) || void 0;
1742
1741
  });
1743
1742
  const [selectedRole, setSelectedRole] = React.useState(() => {
1744
- return localStorage.getItem("rebase_sql_selected_role") || void 0;
1743
+ const projectPrefixSync_0 = client2?.baseUrl ? client2.baseUrl.replace(/^https?:\/\//, "").replace(/[^a-zA-Z0-9]/g, "_") : "default";
1744
+ return localStorage.getItem(`rebase_sql_selected_role_${projectPrefixSync_0}`) || void 0;
1745
1745
  });
1746
1746
  const [availableDatabases, setAvailableDatabases] = React.useState([]);
1747
1747
  const [availableRoles, setAvailableRoles] = React.useState([]);
1748
1748
  const [isLoadingConfig, setIsLoadingConfig] = React.useState(true);
1749
1749
  const [connectionConfigError, setConnectionConfigError] = React.useState(null);
1750
1750
  const [tabs, setTabs] = React.useState(() => {
1751
- const saved = localStorage.getItem(STORAGE_KEY_TABS);
1751
+ const projectPrefixSync_1 = client2?.baseUrl ? client2.baseUrl.replace(/^https?:\/\//, "").replace(/[^a-zA-Z0-9]/g, "_") : "default";
1752
+ const saved = localStorage.getItem(`rebase_sql_tabs_${projectPrefixSync_1}`);
1752
1753
  if (saved) {
1753
1754
  const parsed = JSON.parse(saved);
1754
1755
  return parsed.map((t_0) => ({
@@ -1764,8 +1765,8 @@ WHERE id = ?;`);
1764
1765
  id: "1",
1765
1766
  name: "Query 1",
1766
1767
  sql: "SELECT * FROM ",
1767
- database: localStorage.getItem("rebase_sql_selected_db") || void 0,
1768
- role: localStorage.getItem("rebase_sql_selected_role") || void 0,
1768
+ database: localStorage.getItem(`rebase_sql_selected_db_${projectPrefixSync_1}`) || void 0,
1769
+ role: localStorage.getItem(`rebase_sql_selected_role_${projectPrefixSync_1}`) || void 0,
1769
1770
  results: null,
1770
1771
  loading: false,
1771
1772
  error: null,
@@ -1774,7 +1775,8 @@ WHERE id = ?;`);
1774
1775
  }];
1775
1776
  });
1776
1777
  const [activeTabId, setActiveTabId] = React.useState(() => {
1777
- return localStorage.getItem(STORAGE_KEY_ACTIVE_TAB) || "1";
1778
+ const projectPrefixSync_2 = client2?.baseUrl ? client2.baseUrl.replace(/^https?:\/\//, "").replace(/[^a-zA-Z0-9]/g, "_") : "default";
1779
+ return localStorage.getItem(`rebase_sql_active_tab_${projectPrefixSync_2}`) || "1";
1778
1780
  });
1779
1781
  const activeTab = tabs.find((t_1) => t_1.id === activeTabId) || tabs[0];
1780
1782
  const updateActiveTab = React.useCallback((update) => {
@@ -1794,22 +1796,22 @@ WHERE id = ?;`);
1794
1796
  React.useEffect(() => {
1795
1797
  let mounted = true;
1796
1798
  const fetchConnectionConfig = async () => {
1797
- if (!databaseAdmin?.fetchAvailableDatabases || !databaseAdmin?.fetchAvailableRoles) {
1799
+ if (!databaseAdmin?.fetchAvailableDatabases || !databaseAdmin?.fetchAvailableRoles || !databaseAdmin?.executeSql) {
1798
1800
  setConnectionConfigError(t("studio_sql_sql_not_supported"));
1799
1801
  setIsLoadingConfig(false);
1800
1802
  return;
1801
1803
  }
1802
1804
  try {
1803
- const [dbs, roles, currentDbFromApi] = await Promise.all([databaseAdmin.fetchAvailableDatabases(), databaseAdmin.fetchAvailableRoles(), typeof databaseAdmin?.fetchCurrentDatabase === "function" ? databaseAdmin.fetchCurrentDatabase() : Promise.resolve(void 0)]);
1805
+ const [dbs, roles, currentDbFromApi, currentUserResult] = await Promise.all([databaseAdmin.fetchAvailableDatabases(), databaseAdmin.fetchAvailableRoles(), typeof databaseAdmin?.fetchCurrentDatabase === "function" ? databaseAdmin.fetchCurrentDatabase() : Promise.resolve(void 0), databaseAdmin.executeSql("SELECT current_user AS role").catch(() => [])]);
1804
1806
  if (mounted) {
1805
1807
  setAvailableDatabases(dbs);
1806
1808
  setAvailableRoles(roles);
1807
- const loadedDb = localStorage.getItem("rebase_sql_selected_db") || void 0;
1808
- const loadedRole = localStorage.getItem("rebase_sql_selected_role") || void 0;
1809
- const initialActiveTabId = localStorage.getItem(STORAGE_KEY_ACTIVE_TAB) || "1";
1809
+ const loadedDb = localStorage.getItem(`rebase_sql_selected_db_${projectPrefix}`) || void 0;
1810
+ const loadedRole = localStorage.getItem(`rebase_sql_selected_role_${projectPrefix}`) || void 0;
1811
+ const initialActiveTabId = localStorage.getItem(`rebase_sql_active_tab_${projectPrefix}`) || "1";
1810
1812
  let initialTabs = [];
1811
1813
  try {
1812
- const savedTabs = localStorage.getItem(STORAGE_KEY_TABS);
1814
+ const savedTabs = localStorage.getItem(`rebase_sql_tabs_${projectPrefix}`);
1813
1815
  if (savedTabs) initialTabs = JSON.parse(savedTabs);
1814
1816
  } catch (e) {
1815
1817
  }
@@ -1821,21 +1823,26 @@ WHERE id = ?;`);
1821
1823
  }
1822
1824
  if (actualDb) {
1823
1825
  setSelectedDatabase(actualDb);
1824
- localStorage.setItem("rebase_sql_selected_db", actualDb);
1825
- setTabs((prev_0) => prev_0.map((t_4) => t_4.id === initialActiveTabId && !t_4.database ? {
1826
+ localStorage.setItem(`rebase_sql_selected_db_${projectPrefix}`, actualDb);
1827
+ setTabs((prev_0) => prev_0.map((t_4) => t_4.id === initialActiveTabId && (!t_4.database || !dbs.includes(t_4.database)) ? {
1826
1828
  ...t_4,
1827
1829
  database: actualDb
1828
1830
  } : t_4));
1829
1831
  }
1832
+ const currentUser = currentUserResult?.[0]?.role;
1830
1833
  let actualRole = currentActiveTab?.role || loadedRole;
1831
1834
  if (actualRole && !roles.includes(actualRole)) actualRole = void 0;
1832
1835
  if (!actualRole && roles.length > 0) {
1833
- actualRole = roles.includes("postgres") ? "postgres" : roles[0];
1836
+ if (currentUser && roles.includes(currentUser)) {
1837
+ actualRole = currentUser;
1838
+ } else {
1839
+ actualRole = roles.includes("postgres") ? "postgres" : roles[0];
1840
+ }
1834
1841
  }
1835
1842
  if (actualRole) {
1836
1843
  setSelectedRole(actualRole);
1837
- localStorage.setItem("rebase_sql_selected_role", actualRole);
1838
- setTabs((prev_1) => prev_1.map((t_5) => t_5.id === initialActiveTabId && !t_5.role ? {
1844
+ localStorage.setItem(`rebase_sql_selected_role_${projectPrefix}`, actualRole);
1845
+ setTabs((prev_1) => prev_1.map((t_5) => t_5.id === initialActiveTabId && (!t_5.role || !roles.includes(t_5.role)) ? {
1839
1846
  ...t_5,
1840
1847
  role: actualRole
1841
1848
  } : t_5));
@@ -1859,10 +1866,10 @@ WHERE id = ?;`);
1859
1866
  return () => {
1860
1867
  mounted = false;
1861
1868
  };
1862
- }, [databaseAdmin]);
1869
+ }, [databaseAdmin, projectPrefix]);
1863
1870
  const handleDatabaseChange = (db, tabId) => {
1864
1871
  setSelectedDatabase(db);
1865
- localStorage.setItem("rebase_sql_selected_db", db);
1872
+ localStorage.setItem(`rebase_sql_selected_db_${projectPrefix}`, db);
1866
1873
  setTabs((prev_2) => prev_2.map((t_6) => t_6.id === activeTabId ? {
1867
1874
  ...t_6,
1868
1875
  database: db
@@ -1871,7 +1878,7 @@ WHERE id = ?;`);
1871
1878
  };
1872
1879
  const handleRoleChange = (role, tabId_0) => {
1873
1880
  setSelectedRole(role);
1874
- localStorage.setItem("rebase_sql_selected_role", role);
1881
+ localStorage.setItem(`rebase_sql_selected_role_${projectPrefix}`, role);
1875
1882
  setTabs((prev_3) => prev_3.map((t_7) => t_7.id === activeTabId ? {
1876
1883
  ...t_7,
1877
1884
  role
@@ -1883,7 +1890,7 @@ WHERE id = ?;`);
1883
1890
  if (newTab) {
1884
1891
  if (newTab.database && newTab.database !== selectedDatabase) {
1885
1892
  setSelectedDatabase(newTab.database);
1886
- localStorage.setItem("rebase_sql_selected_db", newTab.database);
1893
+ localStorage.setItem(`rebase_sql_selected_db_${projectPrefix}`, newTab.database);
1887
1894
  schemaFetchedRef.current = false;
1888
1895
  } else if (!newTab.database && selectedDatabase) {
1889
1896
  setTabs((prev_4) => prev_4.map((t_9) => t_9.id === newTabId ? {
@@ -1893,7 +1900,7 @@ WHERE id = ?;`);
1893
1900
  }
1894
1901
  if (newTab.role && newTab.role !== selectedRole) {
1895
1902
  setSelectedRole(newTab.role);
1896
- localStorage.setItem("rebase_sql_selected_role", newTab.role);
1903
+ localStorage.setItem(`rebase_sql_selected_role_${projectPrefix}`, newTab.role);
1897
1904
  } else if (!newTab.role && selectedRole) {
1898
1905
  setTabs((prev_5) => prev_5.map((t_10) => t_10.id === newTabId ? {
1899
1906
  ...t_10,
@@ -1901,7 +1908,7 @@ WHERE id = ?;`);
1901
1908
  } : t_10));
1902
1909
  }
1903
1910
  }
1904
- }, [tabs, selectedDatabase, selectedRole]);
1911
+ }, [tabs, selectedDatabase, selectedRole, projectPrefix]);
1905
1912
  const fetchSchema = React.useCallback(async () => {
1906
1913
  if (!databaseAdmin?.executeSql) {
1907
1914
  setSchemaError(t("studio_sql_sql_not_supported"));
@@ -2101,7 +2108,8 @@ WHERE id = ?;`);
2101
2108
  }
2102
2109
  }, [editingCell, schemas, activeTab.lastExecutedSql, activeTab.results, databaseAdmin, updateActiveTab, snackbarController, selectedDatabase, selectedRole]);
2103
2110
  const [columnWidths, setColumnWidths] = React.useState(() => {
2104
- const saved_0 = localStorage.getItem("rebase_sql_column_widths");
2111
+ const projectPrefixSync_3 = client2?.baseUrl ? client2.baseUrl.replace(/^https?:\/\//, "").replace(/[^a-zA-Z0-9]/g, "_") : "default";
2112
+ const saved_0 = localStorage.getItem(`rebase_sql_column_widths_${projectPrefixSync_3}`);
2105
2113
  return saved_0 ? JSON.parse(saved_0) : {};
2106
2114
  });
2107
2115
  const [snippets, setSnippets] = React.useState([]);
@@ -2109,11 +2117,19 @@ WHERE id = ?;`);
2109
2117
  const [isSaveDialogOpen, setIsSaveDialogOpen] = React.useState(false);
2110
2118
  const [newSnippetName, setNewSnippetName] = React.useState("");
2111
2119
  React.useEffect(() => {
2112
- const savedSnippets = localStorage.getItem("rebase_sql_snippets");
2113
- if (savedSnippets) setSnippets(JSON.parse(savedSnippets));
2114
- const savedHistory = localStorage.getItem("rebase_sql_history");
2115
- if (savedHistory) setHistory(JSON.parse(savedHistory));
2116
- }, []);
2120
+ const savedSnippets = localStorage.getItem(`rebase_sql_snippets_${projectPrefix}`);
2121
+ if (savedSnippets) {
2122
+ setSnippets(JSON.parse(savedSnippets));
2123
+ } else {
2124
+ setSnippets([]);
2125
+ }
2126
+ const savedHistory = localStorage.getItem(`rebase_sql_history_${projectPrefix}`);
2127
+ if (savedHistory) {
2128
+ setHistory(JSON.parse(savedHistory));
2129
+ } else {
2130
+ setHistory([]);
2131
+ }
2132
+ }, [projectPrefix]);
2117
2133
  React.useEffect(() => {
2118
2134
  const sanitizedTabs = tabs.map((t_12) => ({
2119
2135
  id: t_12.id,
@@ -2122,18 +2138,18 @@ WHERE id = ?;`);
2122
2138
  database: t_12.database,
2123
2139
  role: t_12.role
2124
2140
  }));
2125
- localStorage.setItem(STORAGE_KEY_TABS, JSON.stringify(sanitizedTabs));
2126
- }, [tabs]);
2141
+ localStorage.setItem(`rebase_sql_tabs_${projectPrefix}`, JSON.stringify(sanitizedTabs));
2142
+ }, [tabs, projectPrefix]);
2127
2143
  React.useEffect(() => {
2128
- localStorage.setItem(STORAGE_KEY_ACTIVE_TAB, activeTabId);
2129
- }, [activeTabId]);
2144
+ localStorage.setItem(`rebase_sql_active_tab_${projectPrefix}`, activeTabId);
2145
+ }, [activeTabId, projectPrefix]);
2130
2146
  const saveSnippets = (newSnippets) => {
2131
2147
  setSnippets(newSnippets);
2132
- localStorage.setItem("rebase_sql_snippets", JSON.stringify(newSnippets));
2148
+ localStorage.setItem(`rebase_sql_snippets_${projectPrefix}`, JSON.stringify(newSnippets));
2133
2149
  };
2134
2150
  const saveHistory = (newHistory) => {
2135
2151
  setHistory(newHistory);
2136
- localStorage.setItem("rebase_sql_history", JSON.stringify(newHistory.slice(-50)));
2152
+ localStorage.setItem(`rebase_sql_history_${projectPrefix}`, JSON.stringify(newHistory.slice(-50)));
2137
2153
  };
2138
2154
  const handleDeleteSnippet = (id) => {
2139
2155
  saveSnippets(snippets.filter((s) => s.id !== id));
@@ -2188,10 +2204,10 @@ WHERE id = ?;`);
2188
2204
  [key]: width
2189
2205
  }
2190
2206
  };
2191
- localStorage.setItem("rebase_sql_column_widths", JSON.stringify(newWidths));
2207
+ localStorage.setItem(`rebase_sql_column_widths_${projectPrefix}`, JSON.stringify(newWidths));
2192
2208
  return newWidths;
2193
2209
  });
2194
- }, [activeTab.sql]);
2210
+ }, [activeTab.sql, projectPrefix]);
2195
2211
  const handlePrettify = () => {
2196
2212
  const formatted = activeTab.sql.replace(/\s+/g, " ").replace(/\s?,\s?/g, ", ").replace(/\s?=\s?/g, " = ").trim();
2197
2213
  setSql(formatted);
@@ -2270,7 +2286,7 @@ WHERE id = ?;`);
2270
2286
  loading: false
2271
2287
  });
2272
2288
  }
2273
- }, [activeTab.sql, autoLimit, databaseAdmin, history, updateActiveTab]);
2289
+ }, [activeTab.sql, autoLimit, databaseAdmin, history, updateActiveTab, selectedDatabase, selectedRole]);
2274
2290
  const handleRun = React.useCallback(async (selectedText) => {
2275
2291
  const sqlTarget = selectedText || activeTab.sql;
2276
2292
  if (!sqlTarget.trim()) return;
@@ -2470,9 +2486,9 @@ WHERE id = ?;`);
2470
2486
  collection: ra.collection.collection,
2471
2487
  updateUrl: false
2472
2488
  });
2473
- }, children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.PencilIcon, { size: ui.iconSize.smallest }) }) }) });
2489
+ }, children: /* @__PURE__ */ jsxRuntime.jsx(ui.PencilIcon, { size: ui.iconSize.smallest }) }) }) });
2474
2490
  }
2475
- return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "h-full flex items-center justify-center", children: /* @__PURE__ */ jsxRuntime.jsx(ui.Menu, { trigger: /* @__PURE__ */ jsxRuntime.jsx(ui.IconButton, { size: "small", className: "text-surface-400 dark:text-surface-500 hover:text-surface-600 dark:hover:text-surface-300 transition-colors", onClick: (e_8) => e_8.stopPropagation(), children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.MoreVerticalIcon, { size: ui.iconSize.smallest }) }), children: rowActions.map((ra_0) => /* @__PURE__ */ jsxRuntime.jsx(ui.MenuItem, { dense: true, onClick: () => {
2491
+ return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "h-full flex items-center justify-center", children: /* @__PURE__ */ jsxRuntime.jsx(ui.Menu, { trigger: /* @__PURE__ */ jsxRuntime.jsx(ui.IconButton, { size: "small", className: "text-surface-400 dark:text-surface-500 hover:text-surface-600 dark:hover:text-surface-300 transition-colors", onClick: (e_8) => e_8.stopPropagation(), children: /* @__PURE__ */ jsxRuntime.jsx(ui.MoreVerticalIcon, { size: ui.iconSize.smallest }) }), children: rowActions.map((ra_0) => /* @__PURE__ */ jsxRuntime.jsx(ui.MenuItem, { dense: true, onClick: () => {
2476
2492
  sideEntityController?.open({
2477
2493
  path: ra_0.collection.collection.slug,
2478
2494
  entityId: ra_0.entityId,
@@ -2516,7 +2532,8 @@ WHERE id = ?;`);
2516
2532
  };
2517
2533
  const [sidebarSize, setSidebarSize] = React.useState(() => {
2518
2534
  try {
2519
- const saved_1 = localStorage.getItem("rebase_sql_editor_sidebar_size");
2535
+ const projectPrefixSync_4 = client2?.baseUrl ? client2.baseUrl.replace(/^https?:\/\//, "").replace(/[^a-zA-Z0-9]/g, "_") : "default";
2536
+ const saved_1 = localStorage.getItem(`rebase_sql_editor_sidebar_size_${projectPrefixSync_4}`);
2520
2537
  return saved_1 !== null ? parseFloat(saved_1) : 20;
2521
2538
  } catch (e_9) {
2522
2539
  return 20;
@@ -2524,7 +2541,8 @@ WHERE id = ?;`);
2524
2541
  });
2525
2542
  const [editorHeight, setEditorHeight] = React.useState(() => {
2526
2543
  try {
2527
- const saved_2 = localStorage.getItem("rebase_sql_editor_height");
2544
+ const projectPrefixSync_5 = client2?.baseUrl ? client2.baseUrl.replace(/^https?:\/\//, "").replace(/[^a-zA-Z0-9]/g, "_") : "default";
2545
+ const saved_2 = localStorage.getItem(`rebase_sql_editor_height_${projectPrefixSync_5}`);
2528
2546
  return saved_2 !== null ? parseFloat(saved_2) : 50;
2529
2547
  } catch (e_10) {
2530
2548
  return 50;
@@ -2532,16 +2550,16 @@ WHERE id = ?;`);
2532
2550
  });
2533
2551
  React.useEffect(() => {
2534
2552
  try {
2535
- localStorage.setItem("rebase_sql_editor_sidebar_size", sidebarSize.toString());
2553
+ localStorage.setItem(`rebase_sql_editor_sidebar_size_${projectPrefix}`, sidebarSize.toString());
2536
2554
  } catch (e_11) {
2537
2555
  }
2538
- }, [sidebarSize]);
2556
+ }, [sidebarSize, projectPrefix]);
2539
2557
  React.useEffect(() => {
2540
2558
  try {
2541
- localStorage.setItem("rebase_sql_editor_height", editorHeight.toString());
2559
+ localStorage.setItem(`rebase_sql_editor_height_${projectPrefix}`, editorHeight.toString());
2542
2560
  } catch (e_12) {
2543
2561
  }
2544
- }, [editorHeight]);
2562
+ }, [editorHeight, projectPrefix]);
2545
2563
  const activeSnippet = snippets.find((s_0) => s_0.sql === activeTab.sql);
2546
2564
  const isFavorite = activeSnippet?.isFavorite || false;
2547
2565
  return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex h-full w-full bg-white dark:bg-surface-950 overflow-hidden text-text-primary dark:text-text-primary-dark", children: [
@@ -2549,14 +2567,14 @@ WHERE id = ?;`);
2549
2567
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: ui.cls("flex items-center justify-between pr-2 border-b bg-white dark:bg-surface-950", ui.defaultBorderMixin), children: [
2550
2568
  /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex items-center flex-grow overflow-hidden mr-4", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center no-scrollbar overflow-x-auto min-w-0", children: [
2551
2569
  /* @__PURE__ */ jsxRuntime.jsx(ui.Tabs, { value: activeTabId, onValueChange: handleTabChange, variant: "boxy", className: "w-[unset] flex-shrink-0", innerClassName: "bg-white dark:bg-surface-950", children: tabs.map((tab_0) => /* @__PURE__ */ jsxRuntime.jsxs(ui.Tab, { value: tab_0.id, className: "flex items-center justify-between group max-w-[200px]", children: [
2552
- /* @__PURE__ */ jsxRuntime.jsx(lucideReact.TerminalIcon, { size: ui.iconSize.smallest, className: "text-blue-500 mr-1.5 flex-shrink-0" }),
2570
+ /* @__PURE__ */ jsxRuntime.jsx(ui.TerminalIcon, { size: ui.iconSize.smallest, className: "text-blue-500 mr-1.5 flex-shrink-0" }),
2553
2571
  /* @__PURE__ */ jsxRuntime.jsx("span", { className: "truncate", children: tab_0.name }),
2554
- tabs.length > 1 && /* @__PURE__ */ jsxRuntime.jsx(ui.IconButton, { size: "smallest", onClick: (e_13) => handleCloseTab(tab_0.id, e_13), className: "ml-1 !p-0.5 opacity-0 group-hover:opacity-100 hover:text-red-500 transition-opacity", children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.XIcon, { size: ui.iconSize.smallest }) })
2572
+ tabs.length > 1 && /* @__PURE__ */ jsxRuntime.jsx(ui.IconButton, { size: "smallest", onClick: (e_13) => handleCloseTab(tab_0.id, e_13), className: "ml-1 !p-0.5 opacity-0 group-hover:opacity-100 hover:text-red-500 transition-opacity", children: /* @__PURE__ */ jsxRuntime.jsx(ui.XIcon, { size: ui.iconSize.smallest }) })
2555
2573
  ] }, tab_0.id)) }),
2556
- /* @__PURE__ */ jsxRuntime.jsx(ui.IconButton, { size: "small", onClick: handleAddTab, className: "ml-2 flex-shrink-0", children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.PlusIcon, { size: ui.iconSize.smallest }) })
2574
+ /* @__PURE__ */ jsxRuntime.jsx(ui.IconButton, { size: "small", onClick: handleAddTab, className: "ml-2 flex-shrink-0", children: /* @__PURE__ */ jsxRuntime.jsx(ui.PlusIcon, { size: ui.iconSize.smallest }) })
2557
2575
  ] }) }),
2558
2576
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex shrink-0 items-center justify-end pr-2 gap-1.5", children: [
2559
- /* @__PURE__ */ jsxRuntime.jsx(ui.Tooltip, { title: t("studio_sql_format_sql"), children: /* @__PURE__ */ jsxRuntime.jsx(ui.IconButton, { size: "small", onClick: handlePrettify, children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.MenuIcon, { size: ui.iconSize.smallest }) }) }),
2577
+ /* @__PURE__ */ jsxRuntime.jsx(ui.Tooltip, { title: t("studio_sql_format_sql"), children: /* @__PURE__ */ jsxRuntime.jsx(ui.IconButton, { size: "small", onClick: handlePrettify, children: /* @__PURE__ */ jsxRuntime.jsx(ui.MenuIcon, { size: ui.iconSize.smallest }) }) }),
2560
2578
  /* @__PURE__ */ jsxRuntime.jsx(ui.Button, { variant: "text", size: "small", onClick: handleExplain, disabled: loading, children: t("studio_sql_explain") }),
2561
2579
  /* @__PURE__ */ jsxRuntime.jsx("div", { className: "h-4 w-px bg-surface-200 dark:bg-surface-950 mx-1" }),
2562
2580
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center space-x-2 px-2", onClick: (e_14) => {
@@ -2583,8 +2601,8 @@ WHERE id = ?;`);
2583
2601
  /* @__PURE__ */ jsxRuntime.jsx(ui.Button, { variant: "text", size: "small", onClick: () => setIsSaveDialogOpen(true), children: t("studio_sql_save") }),
2584
2602
  /* @__PURE__ */ jsxRuntime.jsx("div", { className: "h-4 w-px bg-surface-200 dark:bg-surface-950 mx-1" }),
2585
2603
  /* @__PURE__ */ jsxRuntime.jsx(ui.Menu, { trigger: /* @__PURE__ */ jsxRuntime.jsxs(ui.Button, { size: "small", variant: "outlined", className: "text-text-secondary dark:text-text-secondary-dark font-medium mr-2", children: [
2586
- /* @__PURE__ */ jsxRuntime.jsx(lucideReact.DatabaseIcon, { size: ui.iconSize.small, className: "mr-1.5 text-text-disabled dark:text-text-disabled-dark" }),
2587
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "max-w-[80px] truncate", children: isLoadingConfig ? "..." : selectedDatabase || t("studio_sql_select_db") })
2604
+ /* @__PURE__ */ jsxRuntime.jsx(ui.DatabaseIcon, { size: ui.iconSize.small, className: "mr-1.5 text-text-disabled dark:text-text-disabled-dark" }),
2605
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "max-w-[160px] truncate", children: isLoadingConfig ? "..." : `${selectedDatabase || t("studio_sql_select_db")}${selectedRole ? ` (${selectedRole})` : ""}` })
2588
2606
  ] }), children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "max-h-64 overflow-y-auto", children: [
2589
2607
  /* @__PURE__ */ jsxRuntime.jsx("div", { className: "px-3 py-1.5 border-b border-surface-200 dark:border-surface-950 mb-1", children: /* @__PURE__ */ jsxRuntime.jsx(ui.Typography, { variant: "caption", className: "font-bold uppercase tracking-wider text-[9px] text-text-disabled dark:text-text-disabled-dark", children: t("studio_sql_database") }) }),
2590
2608
  isLoadingConfig ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex items-center justify-center p-4", children: /* @__PURE__ */ jsxRuntime.jsx(ui.CircularProgress, { size: "small" }) }) : connectionConfigError ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "px-3 py-2 text-xs text-red-500 dark:text-red-400 max-w-[200px] break-words", children: connectionConfigError }) : /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
@@ -2597,7 +2615,7 @@ WHERE id = ?;`);
2597
2615
  ] })
2598
2616
  ] }) }),
2599
2617
  /* @__PURE__ */ jsxRuntime.jsxs(ui.Button, { onClick: () => handleRun(), disabled: loading, size: "small", color: "primary", children: [
2600
- loading ? /* @__PURE__ */ jsxRuntime.jsx(ui.CircularProgress, { size: "smallest", className: "mr-2" }) : /* @__PURE__ */ jsxRuntime.jsx(lucideReact.PlayIcon, { size: ui.iconSize.smallest, className: "mr-2" }),
2618
+ loading ? /* @__PURE__ */ jsxRuntime.jsx(ui.CircularProgress, { size: "smallest", className: "mr-2" }) : /* @__PURE__ */ jsxRuntime.jsx(ui.PlayIcon, { size: ui.iconSize.smallest, className: "mr-2" }),
2601
2619
  t("studio_sql_run")
2602
2620
  ] })
2603
2621
  ] })
@@ -3125,7 +3143,7 @@ return result;`);
3125
3143
  }
3126
3144
  let t9;
3127
3145
  if ($[13] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
3128
- t9 = /* @__PURE__ */ jsxRuntime.jsx(lucideReact.PlusIcon, { size: ui.iconSize.smallest });
3146
+ t9 = /* @__PURE__ */ jsxRuntime.jsx(ui.PlusIcon, { size: ui.iconSize.smallest });
3129
3147
  $[13] = t9;
3130
3148
  } else {
3131
3149
  t9 = $[13];
@@ -3234,7 +3252,7 @@ return result;`);
3234
3252
  }
3235
3253
  let t6;
3236
3254
  if ($[11] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
3237
- t6 = /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Trash2Icon, { size: ui.iconSize.smallest });
3255
+ t6 = /* @__PURE__ */ jsxRuntime.jsx(ui.Trash2Icon, { size: ui.iconSize.smallest });
3238
3256
  $[11] = t6;
3239
3257
  } else {
3240
3258
  t6 = $[11];
@@ -3278,7 +3296,7 @@ return result;`);
3278
3296
  let t1;
3279
3297
  let t2;
3280
3298
  if ($[0] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
3281
- t1 = /* @__PURE__ */ jsxRuntime.jsx(lucideReact.KeyRoundIcon, { size: ui.iconSize.small, className: "text-text-secondary dark:text-text-secondary-dark" });
3299
+ t1 = /* @__PURE__ */ jsxRuntime.jsx(ui.KeyRoundIcon, { size: ui.iconSize.small, className: "text-text-secondary dark:text-text-secondary-dark" });
3282
3300
  t2 = /* @__PURE__ */ jsxRuntime.jsx(ui.Typography, { variant: "caption", className: "text-text-secondary dark:text-text-secondary-dark text-xs font-medium", children: "Auth:" });
3283
3301
  $[0] = t1;
3284
3302
  $[1] = t2;
@@ -3686,7 +3704,7 @@ return result;
3686
3704
  value: void 0,
3687
3705
  console: consoleEntries,
3688
3706
  duration,
3689
- error: err?.message || String(err),
3707
+ error: err instanceof Error ? err.message : String(err),
3690
3708
  timestamp: Date.now()
3691
3709
  });
3692
3710
  setResultView("json");
@@ -3825,23 +3843,23 @@ return result;
3825
3843
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: ui.cls("flex items-center justify-between pr-2 border-b bg-white dark:bg-surface-950", ui.defaultBorderMixin), children: [
3826
3844
  /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex items-center flex-grow overflow-hidden mr-4", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center no-scrollbar overflow-x-auto min-w-0", children: [
3827
3845
  /* @__PURE__ */ jsxRuntime.jsx(ui.Tabs, { value: activeTabId, onValueChange: setActiveTabId, variant: "boxy", className: "w-[unset] flex-shrink-0", innerClassName: "bg-white dark:bg-surface-950", children: tabs.map((tab) => /* @__PURE__ */ jsxRuntime.jsxs(ui.Tab, { value: tab.id, className: "flex items-center justify-between group max-w-[200px]", children: [
3828
- /* @__PURE__ */ jsxRuntime.jsx(lucideReact.TerminalIcon, { size: ui.iconSize.smallest, className: "text-amber-500 mr-1.5 flex-shrink-0" }),
3846
+ /* @__PURE__ */ jsxRuntime.jsx(ui.TerminalIcon, { size: ui.iconSize.smallest, className: "text-amber-500 mr-1.5 flex-shrink-0" }),
3829
3847
  /* @__PURE__ */ jsxRuntime.jsx("span", { className: "truncate", children: tab.name }),
3830
3848
  tabs.length > 1 && /* @__PURE__ */ jsxRuntime.jsx(ui.IconButton, { size: "smallest", onClick: (e) => {
3831
3849
  e.stopPropagation();
3832
3850
  closeTab(tab.id);
3833
- }, className: "ml-1 !p-0.5 opacity-0 group-hover:opacity-100 hover:text-red-500 transition-opacity", children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.XIcon, { size: ui.iconSize.smallest }) })
3851
+ }, className: "ml-1 !p-0.5 opacity-0 group-hover:opacity-100 hover:text-red-500 transition-opacity", children: /* @__PURE__ */ jsxRuntime.jsx(ui.XIcon, { size: ui.iconSize.smallest }) })
3834
3852
  ] }, tab.id)) }),
3835
- /* @__PURE__ */ jsxRuntime.jsx(ui.IconButton, { size: "small", onClick: addTab, className: "ml-2 flex-shrink-0", children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.PlusIcon, { size: ui.iconSize.smallest }) })
3853
+ /* @__PURE__ */ jsxRuntime.jsx(ui.IconButton, { size: "small", onClick: addTab, className: "ml-2 flex-shrink-0", children: /* @__PURE__ */ jsxRuntime.jsx(ui.PlusIcon, { size: ui.iconSize.smallest }) })
3836
3854
  ] }) }),
3837
3855
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex shrink-0 items-center justify-end gap-1.5", children: [
3838
3856
  /* @__PURE__ */ jsxRuntime.jsx(ui.Tooltip, { title: "SaveIcon as snippet", children: /* @__PURE__ */ jsxRuntime.jsx(ui.IconButton, { size: "small", onClick: () => {
3839
3857
  setSnippetName("");
3840
3858
  setShowSaveDialog(true);
3841
- }, disabled: !activeTab?.code.trim(), children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.SaveIcon, { size: ui.iconSize.smallest }) }) }),
3842
- result?.value && /* @__PURE__ */ jsxRuntime.jsx(ui.Tooltip, { title: "Export result as JSON", children: /* @__PURE__ */ jsxRuntime.jsx(ui.IconButton, { size: "small", onClick: exportResult, children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.DownloadIcon, { size: ui.iconSize.smallest }) }) }),
3859
+ }, disabled: !activeTab?.code.trim(), children: /* @__PURE__ */ jsxRuntime.jsx(ui.SaveIcon, { size: ui.iconSize.smallest }) }) }),
3860
+ result?.value && /* @__PURE__ */ jsxRuntime.jsx(ui.Tooltip, { title: "Export result as JSON", children: /* @__PURE__ */ jsxRuntime.jsx(ui.IconButton, { size: "small", onClick: exportResult, children: /* @__PURE__ */ jsxRuntime.jsx(ui.DownloadIcon, { size: ui.iconSize.smallest }) }) }),
3843
3861
  /* @__PURE__ */ jsxRuntime.jsxs(ui.Button, { size: "small", color: "primary", disabled: isRunning || !activeTab?.code.trim(), onClick: () => executeCode(), children: [
3844
- isRunning ? /* @__PURE__ */ jsxRuntime.jsx(ui.CircularProgress, { size: "smallest", className: "mr-2" }) : /* @__PURE__ */ jsxRuntime.jsx(lucideReact.PlayIcon, { size: ui.iconSize.smallest, className: "mr-2" }),
3862
+ isRunning ? /* @__PURE__ */ jsxRuntime.jsx(ui.CircularProgress, { size: "smallest", className: "mr-2" }) : /* @__PURE__ */ jsxRuntime.jsx(ui.PlayIcon, { size: ui.iconSize.smallest, className: "mr-2" }),
3845
3863
  "Run"
3846
3864
  ] })
3847
3865
  ] })
@@ -3918,9 +3936,9 @@ return result;
3918
3936
  collection: ra.collection.collection,
3919
3937
  updateUrl: false
3920
3938
  });
3921
- }, children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.PencilIcon, { size: ui.iconSize.smallest }) }) }) });
3939
+ }, children: /* @__PURE__ */ jsxRuntime.jsx(ui.PencilIcon, { size: ui.iconSize.smallest }) }) }) });
3922
3940
  }
3923
- return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "h-full flex items-center justify-center", children: /* @__PURE__ */ jsxRuntime.jsx(ui.Menu, { trigger: /* @__PURE__ */ jsxRuntime.jsx(ui.IconButton, { size: "small", className: "text-surface-400 dark:text-surface-500 hover:text-surface-600 dark:hover:text-surface-300", onClick: (e_1) => e_1.stopPropagation(), children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.MoreVerticalIcon, { size: ui.iconSize.smallest }) }), children: rowActions.map((ra_0) => /* @__PURE__ */ jsxRuntime.jsx(ui.MenuItem, { dense: true, onClick: () => {
3941
+ return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "h-full flex items-center justify-center", children: /* @__PURE__ */ jsxRuntime.jsx(ui.Menu, { trigger: /* @__PURE__ */ jsxRuntime.jsx(ui.IconButton, { size: "small", className: "text-surface-400 dark:text-surface-500 hover:text-surface-600 dark:hover:text-surface-300", onClick: (e_1) => e_1.stopPropagation(), children: /* @__PURE__ */ jsxRuntime.jsx(ui.MoreVerticalIcon, { size: ui.iconSize.smallest }) }), children: rowActions.map((ra_0) => /* @__PURE__ */ jsxRuntime.jsx(ui.MenuItem, { dense: true, onClick: () => {
3924
3942
  sideEntityController.open({
3925
3943
  path: ra_0.collection.collectionSlug,
3926
3944
  entityId: ra_0.entityId,
@@ -4264,7 +4282,7 @@ return result;
4264
4282
  }
4265
4283
  let t12;
4266
4284
  if ($[30] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
4267
- t12 = /* @__PURE__ */ jsxRuntime.jsx(ui.IconButton, { size: "small", onClick: () => setHelpOpen(true), children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.HelpCircleIcon, { size: ui.iconSize.smallest }) });
4285
+ t12 = /* @__PURE__ */ jsxRuntime.jsx(ui.IconButton, { size: "small", onClick: () => setHelpOpen(true), children: /* @__PURE__ */ jsxRuntime.jsx(ui.HelpCircleIcon, { size: ui.iconSize.smallest }) });
4268
4286
  $[30] = t12;
4269
4287
  } else {
4270
4288
  t12 = $[30];
@@ -5630,7 +5648,7 @@ return result;
5630
5648
  sidebarTab === "tables" && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col h-full", children: [
5631
5649
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: ui.cls("flex items-center justify-between px-3 py-2 border-b bg-surface-50 dark:bg-surface-900 min-h-[48px]", ui.defaultBorderMixin), children: [
5632
5650
  /* @__PURE__ */ jsxRuntime.jsx(ui.Typography, { variant: "caption", className: "font-bold uppercase tracking-wider text-text-disabled dark:text-text-disabled-dark", children: t("studio_schema_tables") }),
5633
- /* @__PURE__ */ jsxRuntime.jsx(ui.IconButton, { size: "small", onClick: fetchRLSData, title: "Refresh", children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.RefreshCwIcon, { size: ui.iconSize.smallest }) })
5651
+ /* @__PURE__ */ jsxRuntime.jsx(ui.IconButton, { size: "small", onClick: fetchRLSData, title: "Refresh", children: /* @__PURE__ */ jsxRuntime.jsx(ui.RefreshCwIcon, { size: ui.iconSize.smallest }) })
5634
5652
  ] }),
5635
5653
  /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex-grow overflow-y-auto no-scrollbar p-1", children: isLoading && tables.length === 0 ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex justify-center p-4", children: /* @__PURE__ */ jsxRuntime.jsx(ui.CircularProgress, { size: "small" }) }) : Object.keys(groupedTables).length === 0 ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "p-4 text-center", children: /* @__PURE__ */ jsxRuntime.jsx(ui.Typography, { variant: "caption", className: "text-text-disabled dark:text-text-disabled-dark italic", children: t("studio_rls_no_tables") }) }) : Object.entries(groupedTables).map(([schemaName, schemaTables]) => /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "mb-2", children: [
5636
5654
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center p-1 cursor-pointer hover:bg-surface-100 dark:hover:bg-surface-950 rounded transition-colors", onClick: () => setExpandedSchemas((prev) => ({
@@ -5659,7 +5677,7 @@ return result;
5659
5677
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex-grow overflow-y-auto p-3 space-y-3 no-scrollbar", children: [
5660
5678
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: ui.cls("p-3 rounded-lg border bg-white dark:bg-surface-900", ui.defaultBorderMixin), children: [
5661
5679
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2 mb-2", children: [
5662
- /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ShieldIcon, { size: ui.iconSize.smallest, className: "text-primary" }),
5680
+ /* @__PURE__ */ jsxRuntime.jsx(ui.ShieldIcon, { size: ui.iconSize.smallest, className: "text-primary" }),
5663
5681
  /* @__PURE__ */ jsxRuntime.jsx(ui.Typography, { variant: "body2", className: "font-semibold text-[13px]", children: "RLS Studio" })
5664
5682
  ] }),
5665
5683
  /* @__PURE__ */ jsxRuntime.jsx(ui.Typography, { variant: "caption", className: "text-text-secondary dark:text-text-secondary-dark text-[11px] leading-relaxed block", children: "Manage Row Level Security policies for your PostgreSQL tables. Enable RLS and create fine-grained access policies." })
@@ -5686,7 +5704,7 @@ return result;
5686
5704
  ] })
5687
5705
  ] }),
5688
5706
  rlsStats.total - rlsStats.enabled > 0 && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: ui.cls("p-2.5 rounded border border-yellow-200 dark:border-yellow-900/50 bg-yellow-50 dark:bg-yellow-900/20 flex items-start gap-2", ui.defaultBorderMixin), children: [
5689
- /* @__PURE__ */ jsxRuntime.jsx(lucideReact.AlertTriangleIcon, { size: 14, className: "text-yellow-600 dark:text-yellow-500 mt-0.5 shrink-0" }),
5707
+ /* @__PURE__ */ jsxRuntime.jsx(ui.AlertTriangleIcon, { size: 14, className: "text-yellow-600 dark:text-yellow-500 mt-0.5 shrink-0" }),
5690
5708
  /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
5691
5709
  /* @__PURE__ */ jsxRuntime.jsxs(ui.Typography, { variant: "caption", className: "text-yellow-800 dark:text-yellow-400 text-[11px] font-semibold block", children: [
5692
5710
  rlsStats.total - rlsStats.enabled,
@@ -5698,7 +5716,7 @@ return result;
5698
5716
  ] })
5699
5717
  ] }),
5700
5718
  rlsStats.enabled > 0 && rlsStats.enabled - rlsStats.withPolicies > 0 && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: ui.cls("p-2.5 rounded border border-blue-200 dark:border-blue-900/50 bg-blue-50 dark:bg-blue-900/20 flex items-start gap-2", ui.defaultBorderMixin), children: [
5701
- /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ShieldIcon, { size: 14, className: "text-blue-600 dark:text-blue-400 mt-0.5 shrink-0" }),
5719
+ /* @__PURE__ */ jsxRuntime.jsx(ui.ShieldIcon, { size: 14, className: "text-blue-600 dark:text-blue-400 mt-0.5 shrink-0" }),
5702
5720
  /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
5703
5721
  /* @__PURE__ */ jsxRuntime.jsxs(ui.Typography, { variant: "caption", className: "text-blue-800 dark:text-blue-300 text-[11px] font-semibold block", children: [
5704
5722
  rlsStats.enabled - rlsStats.withPolicies,
@@ -5738,7 +5756,7 @@ return result;
5738
5756
  }
5739
5757
  }, children: activeTableData.rlsEnabled ? t("studio_rls_disable_rls") : t("studio_rls_enable_rls") }),
5740
5758
  /* @__PURE__ */ jsxRuntime.jsx("div", { className: "h-4 w-px bg-surface-200 dark:bg-surface-950 mx-1" }),
5741
- /* @__PURE__ */ jsxRuntime.jsx(ui.Button, { variant: "text", size: "small", onClick: fetchRLSData, startIcon: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.RefreshCwIcon, { size: ui.iconSize.smallest }), children: "Refresh" }),
5759
+ /* @__PURE__ */ jsxRuntime.jsx(ui.Button, { variant: "text", size: "small", onClick: fetchRLSData, startIcon: /* @__PURE__ */ jsxRuntime.jsx(ui.RefreshCwIcon, { size: ui.iconSize.smallest }), children: "Refresh" }),
5742
5760
  /* @__PURE__ */ jsxRuntime.jsx("div", { className: "h-4 w-px bg-surface-200 dark:bg-surface-950 mx-1" }),
5743
5761
  /* @__PURE__ */ jsxRuntime.jsx(ui.Button, { size: "small", color: "primary", disabled: !activeCollection, onClick: () => setEditingPolicy("new"), children: t("studio_rls_create_policy") })
5744
5762
  ] }) })
@@ -5796,7 +5814,7 @@ return result;
5796
5814
  ] }),
5797
5815
  activeTableData && !activeTableData.rlsEnabled && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: ui.cls("p-4 sm:p-5 bg-yellow-50 dark:bg-yellow-900/20 border border-yellow-200 dark:border-yellow-900/50 rounded-lg flex flex-col sm:flex-row gap-4 items-start sm:items-center justify-between", ui.defaultBorderMixin), children: [
5798
5816
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex gap-3 items-start", children: [
5799
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "mt-1 bg-yellow-100 dark:bg-yellow-900/50 p-1.5 rounded-md shrink-0 flex items-center justify-center", children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.AlertTriangleIcon, { size: ui.iconSize.smallest }) }),
5817
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "mt-1 bg-yellow-100 dark:bg-yellow-900/50 p-1.5 rounded-md shrink-0 flex items-center justify-center", children: /* @__PURE__ */ jsxRuntime.jsx(ui.AlertTriangleIcon, { size: ui.iconSize.smallest }) }),
5800
5818
  /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
5801
5819
  /* @__PURE__ */ jsxRuntime.jsx(ui.Typography, { variant: "subtitle2", className: "text-yellow-800 dark:text-yellow-500", children: "Row Level Security (RLS) is disabled" }),
5802
5820
  /* @__PURE__ */ jsxRuntime.jsx(ui.Typography, { variant: "body2", className: "text-yellow-700 dark:text-yellow-600/90 mt-1 max-w-2xl", children: "Your table is completely readable and writable by anyone with access privileges. Enable RLS to create policies that restrict access to specific rows." })
@@ -5809,7 +5827,7 @@ return result;
5809
5827
  mergedPolicies.map((policy) => /* @__PURE__ */ jsxRuntime.jsxs(ui.Paper, { className: ui.cls("p-3 sm:px-4 sm:py-3 flex flex-col sm:flex-row sm:items-center justify-between gap-4 border rounded-lg", ui.defaultBorderMixin), children: [
5810
5828
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col gap-2 min-w-0", children: [
5811
5829
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2", children: [
5812
- /* @__PURE__ */ jsxRuntime.jsx(lucideReact.KeyIcon, { size: ui.iconSize.smallest, className: "text-text-secondary dark:text-text-secondary-dark shrink-0" }),
5830
+ /* @__PURE__ */ jsxRuntime.jsx(ui.KeyIcon, { size: ui.iconSize.smallest, className: "text-text-secondary dark:text-text-secondary-dark shrink-0" }),
5813
5831
  /* @__PURE__ */ jsxRuntime.jsx(ui.Typography, { variant: "body2", className: "truncate", children: policy.policyname }),
5814
5832
  policy.status === "code_only" && /* @__PURE__ */ jsxRuntime.jsx(ui.Tooltip, { title: "This policy is defined in your code but hasn't been applied to the database yet.", children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "px-1.5 py-0.5 rounded text-[10px] uppercase bg-primary/10 text-primary border border-primary/20 shrink-0", children: "Unapplied" }) }),
5815
5833
  policy.status === "live" && /* @__PURE__ */ jsxRuntime.jsx(ui.Tooltip, { title: "This policy is live in the database but missing from your codebase schema.", children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "px-1.5 py-0.5 rounded text-[10px] uppercase bg-orange-500/10 text-orange-600 border border-orange-500/20 shrink-0", children: "DB Only" }) })
@@ -5874,18 +5892,18 @@ return result;
5874
5892
  message: e_5 instanceof Error ? e_5.message : String(e_5)
5875
5893
  });
5876
5894
  }
5877
- }, children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Trash2Icon, { size: ui.iconSize.smallest }) }) })
5895
+ }, children: /* @__PURE__ */ jsxRuntime.jsx(ui.Trash2Icon, { size: ui.iconSize.smallest }) }) })
5878
5896
  ] })
5879
5897
  ] }, policy.policyname))
5880
5898
  ] }),
5881
5899
  activeTableData && mergedPolicies.length === 0 && activeTableData.rlsEnabled && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col items-center justify-center py-12 text-center", children: [
5882
- /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ShieldIcon, { size: 40, className: "text-surface-300 dark:text-surface-600 mb-4" }),
5900
+ /* @__PURE__ */ jsxRuntime.jsx(ui.ShieldIcon, { size: 40, className: "text-surface-300 dark:text-surface-600 mb-4" }),
5883
5901
  /* @__PURE__ */ jsxRuntime.jsx(ui.Typography, { variant: "subtitle2", className: "text-text-secondary dark:text-text-secondary-dark mb-2", children: "No policies defined" }),
5884
5902
  /* @__PURE__ */ jsxRuntime.jsx(ui.Typography, { variant: "caption", className: "text-text-disabled dark:text-text-disabled-dark max-w-sm mb-4", children: "RLS is enabled on this table but no policies exist. All access is denied by default (Postgres deny-all). Create a policy to allow specific access." }),
5885
5903
  activeCollection && /* @__PURE__ */ jsxRuntime.jsx(ui.Button, { size: "small", variant: "filled", color: "primary", onClick: () => setEditingPolicy("new"), children: t("studio_rls_create_policy") })
5886
5904
  ] }),
5887
5905
  activeTableData && mergedPolicies.length === 0 && !activeTableData.rlsEnabled && activeCollection && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col items-center justify-center py-12 text-center", children: [
5888
- /* @__PURE__ */ jsxRuntime.jsx(lucideReact.AlertTriangleIcon, { size: 40, className: "text-yellow-400 dark:text-yellow-600 mb-4" }),
5906
+ /* @__PURE__ */ jsxRuntime.jsx(ui.AlertTriangleIcon, { size: 40, className: "text-yellow-400 dark:text-yellow-600 mb-4" }),
5889
5907
  /* @__PURE__ */ jsxRuntime.jsx(ui.Typography, { variant: "subtitle2", className: "text-text-secondary dark:text-text-secondary-dark mb-2", children: "No access control" }),
5890
5908
  /* @__PURE__ */ jsxRuntime.jsx(ui.Typography, { variant: "caption", className: "text-text-disabled dark:text-text-disabled-dark max-w-sm", children: "This table has neither RLS nor policies. Enable RLS and create policies to restrict row-level access." })
5891
5909
  ] })
@@ -5903,11 +5921,11 @@ return result;
5903
5921
  return `${(bytes / (1024 * 1024 * 1024)).toFixed(2)} GB`;
5904
5922
  }
5905
5923
  function getFileIcon(contentType) {
5906
- if (!contentType) return lucideReact.FileTextIcon;
5907
- if (contentType.startsWith("image/")) return lucideReact.ImageIcon;
5908
- if (contentType.startsWith("video/")) return lucideReact.VideoIcon;
5909
- if (contentType.startsWith("audio/")) return lucideReact.Music2Icon;
5910
- return lucideReact.FileTextIcon;
5924
+ if (!contentType) return ui.FileTextIcon;
5925
+ if (contentType.startsWith("image/")) return ui.ImageIcon;
5926
+ if (contentType.startsWith("video/")) return ui.VideoIcon;
5927
+ if (contentType.startsWith("audio/")) return ui.Music2Icon;
5928
+ return ui.FileTextIcon;
5911
5929
  }
5912
5930
  function getExtension(name) {
5913
5931
  const parts = name.split(".");
@@ -5982,7 +6000,7 @@ return result;
5982
6000
  ] }),
5983
6001
  /* @__PURE__ */ jsxRuntime.jsxs(ui.DialogContent, { className: "space-y-4", children: [
5984
6002
  /* @__PURE__ */ jsxRuntime.jsx(ui.FileUpload, { onFilesAdded: handleFilesAdded, size: "large", uploadDescription: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col items-center justify-center pointer-events-none", children: [
5985
- /* @__PURE__ */ jsxRuntime.jsx(lucideReact.UploadCloudIcon, { className: "text-surface-accent-400 mb-2 w-8 h-8" }),
6003
+ /* @__PURE__ */ jsxRuntime.jsx(ui.UploadCloudIcon, { className: "text-surface-accent-400 mb-2 w-8 h-8" }),
5986
6004
  /* @__PURE__ */ jsxRuntime.jsx(ui.Typography, { variant: "label", children: "Drop files here or click to browse" }),
5987
6005
  /* @__PURE__ */ jsxRuntime.jsx(ui.Typography, { variant: "caption", color: "secondary", children: "Any file type supported" })
5988
6006
  ] }) }),
@@ -6001,13 +6019,13 @@ return result;
6001
6019
  /* @__PURE__ */ jsxRuntime.jsx(ui.IconButton, { size: "small", onClick: (e) => {
6002
6020
  e.stopPropagation();
6003
6021
  handleRemoveFile(index_0);
6004
- }, disabled: uploading, children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.XIcon, { size: 14 }) })
6022
+ }, disabled: uploading, children: /* @__PURE__ */ jsxRuntime.jsx(ui.XIcon, { size: 14 }) })
6005
6023
  ] }, `${file.name}-${index_0}`)) })
6006
6024
  ] })
6007
6025
  ] }),
6008
6026
  /* @__PURE__ */ jsxRuntime.jsxs(ui.DialogActions, { children: [
6009
6027
  /* @__PURE__ */ jsxRuntime.jsx(ui.Button, { variant: "text", onClick: handleClose, disabled: uploading, children: "Cancel" }),
6010
- /* @__PURE__ */ jsxRuntime.jsx(ui.Button, { variant: "filled", onClick: handleUpload, disabled: selectedFiles.length === 0 || uploading, startIcon: uploading ? /* @__PURE__ */ jsxRuntime.jsx(ui.CircularProgress, { size: "smallest" }) : /* @__PURE__ */ jsxRuntime.jsx(lucideReact.UploadCloudIcon, { size: 14 }), children: uploading ? "Uploading..." : `Upload${selectedFiles.length > 0 ? ` (${selectedFiles.length})` : ""}` })
6028
+ /* @__PURE__ */ jsxRuntime.jsx(ui.Button, { variant: "filled", onClick: handleUpload, disabled: selectedFiles.length === 0 || uploading, startIcon: uploading ? /* @__PURE__ */ jsxRuntime.jsx(ui.CircularProgress, { size: "smallest" }) : /* @__PURE__ */ jsxRuntime.jsx(ui.UploadCloudIcon, { size: 14 }), children: uploading ? "Uploading..." : `Upload${selectedFiles.length > 0 ? ` (${selectedFiles.length})` : ""}` })
6011
6029
  ] })
6012
6030
  ] });
6013
6031
  }
@@ -6028,9 +6046,9 @@ return result;
6028
6046
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: ui.cls("flex items-center justify-between p-3 border-b shrink-0", ui.defaultBorderMixin), children: [
6029
6047
  /* @__PURE__ */ jsxRuntime.jsx(ui.Typography, { variant: "body2", className: "font-medium truncate flex-1 mr-2", children: file.name }),
6030
6048
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-0.5", children: [
6031
- downloadUrl && /* @__PURE__ */ jsxRuntime.jsx(ui.Tooltip, { title: "Download", children: /* @__PURE__ */ jsxRuntime.jsx(ui.IconButton, { size: "small", onClick: () => window.open(downloadUrl, "_blank"), children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.DownloadIcon, { size: ui.iconSize.smallest }) }) }),
6032
- /* @__PURE__ */ jsxRuntime.jsx(ui.Tooltip, { title: "Delete", children: /* @__PURE__ */ jsxRuntime.jsx(ui.IconButton, { size: "small", onClick: () => setDeleteDialogOpen(true), className: "text-red-500 hover:bg-red-50 dark:hover:bg-red-900/20", children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Trash2Icon, { size: ui.iconSize.smallest }) }) }),
6033
- /* @__PURE__ */ jsxRuntime.jsx(ui.IconButton, { size: "small", onClick: onClose, children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.XIcon, { size: ui.iconSize.smallest }) })
6049
+ downloadUrl && /* @__PURE__ */ jsxRuntime.jsx(ui.Tooltip, { title: "Download", children: /* @__PURE__ */ jsxRuntime.jsx(ui.IconButton, { size: "small", onClick: () => window.open(downloadUrl, "_blank"), children: /* @__PURE__ */ jsxRuntime.jsx(ui.DownloadIcon, { size: ui.iconSize.smallest }) }) }),
6050
+ /* @__PURE__ */ jsxRuntime.jsx(ui.Tooltip, { title: "Delete", children: /* @__PURE__ */ jsxRuntime.jsx(ui.IconButton, { size: "small", onClick: () => setDeleteDialogOpen(true), className: "text-red-500 hover:bg-red-50 dark:hover:bg-red-900/20", children: /* @__PURE__ */ jsxRuntime.jsx(ui.Trash2Icon, { size: ui.iconSize.smallest }) }) }),
6051
+ /* @__PURE__ */ jsxRuntime.jsx(ui.IconButton, { size: "small", onClick: onClose, children: /* @__PURE__ */ jsxRuntime.jsx(ui.XIcon, { size: ui.iconSize.smallest }) })
6034
6052
  ] })
6035
6053
  ] }),
6036
6054
  /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex-1 overflow-auto", children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: ui.cls("flex flex-col items-center justify-center min-h-[200px] p-4 bg-surface-50 dark:bg-surface-800 border-b", ui.defaultBorderMixin), children: (() => {
@@ -6045,7 +6063,7 @@ return result;
6045
6063
  return /* @__PURE__ */ jsxRuntime.jsx("video", { src: downloadUrl_0, className: "max-w-full max-h-[400px] rounded-md", controls: true });
6046
6064
  } else if (isAudio_0 && downloadUrl_0) {
6047
6065
  return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col items-center gap-4", children: [
6048
- /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Music2Icon, { className: "text-surface-accent-400 w-10 h-10" }),
6066
+ /* @__PURE__ */ jsxRuntime.jsx(ui.Music2Icon, { className: "text-surface-accent-400 w-10 h-10" }),
6049
6067
  /* @__PURE__ */ jsxRuntime.jsx("audio", { src: downloadUrl_0, controls: true, className: "w-full max-w-xs" })
6050
6068
  ] });
6051
6069
  } else {
@@ -6092,7 +6110,7 @@ return result;
6092
6110
  const fullUrl_0 = downloadUrl.startsWith("http") ? downloadUrl : `${window.location.origin}${downloadUrl.startsWith("/") ? "" : "/"}${downloadUrl}`;
6093
6111
  return fullUrl_0;
6094
6112
  })() }),
6095
- /* @__PURE__ */ jsxRuntime.jsx(ui.Tooltip, { title: urlCopied ? "Copied!" : "Copy URL", children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "shrink-0", children: urlCopied ? /* @__PURE__ */ jsxRuntime.jsx(lucideReact.CheckIcon, { size: 14, className: "text-green-500" }) : /* @__PURE__ */ jsxRuntime.jsx(lucideReact.CopyIcon, { size: 14, className: "text-surface-accent-400" }) }) })
6113
+ /* @__PURE__ */ jsxRuntime.jsx(ui.Tooltip, { title: urlCopied ? "Copied!" : "Copy URL", children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "shrink-0", children: urlCopied ? /* @__PURE__ */ jsxRuntime.jsx(ui.CheckIcon, { size: 14, className: "text-green-500" }) : /* @__PURE__ */ jsxRuntime.jsx(ui.CopyIcon, { size: 14, className: "text-surface-accent-400" }) }) })
6096
6114
  ] })
6097
6115
  ] })
6098
6116
  ] })
@@ -6501,11 +6519,11 @@ return result;
6501
6519
  setNewFolderName("");
6502
6520
  setNewFolderDialogOpen(true);
6503
6521
  }, children: [
6504
- /* @__PURE__ */ jsxRuntime.jsx(lucideReact.FolderPlusIcon, { size: ui.iconSize.smallest }),
6522
+ /* @__PURE__ */ jsxRuntime.jsx(ui.FolderPlusIcon, { size: ui.iconSize.smallest }),
6505
6523
  "New folder"
6506
6524
  ] }),
6507
6525
  /* @__PURE__ */ jsxRuntime.jsxs(ui.Button, { onClick: () => setUploadDialogOpen(true), children: [
6508
- /* @__PURE__ */ jsxRuntime.jsx(lucideReact.PlusIcon, { size: ui.iconSize.smallest }),
6526
+ /* @__PURE__ */ jsxRuntime.jsx(ui.PlusIcon, { size: ui.iconSize.smallest }),
6509
6527
  "Upload files"
6510
6528
  ] })
6511
6529
  ] })
@@ -6533,7 +6551,7 @@ return result;
6533
6551
  });
6534
6552
  } }) }),
6535
6553
  /* @__PURE__ */ jsxRuntime.jsx("td", { className: "px-2 py-2.5", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2", children: [
6536
- /* @__PURE__ */ jsxRuntime.jsx(lucideReact.FolderIcon, { size: ui.iconSize.smallest, className: "text-amber-500 dark:text-amber-400 shrink-0" }),
6554
+ /* @__PURE__ */ jsxRuntime.jsx(ui.FolderIcon, { size: ui.iconSize.smallest, className: "text-amber-500 dark:text-amber-400 shrink-0" }),
6537
6555
  /* @__PURE__ */ jsxRuntime.jsx(ui.Typography, { variant: "body2", className: "text-[13px] font-medium truncate", children: folder.name })
6538
6556
  ] }) }),
6539
6557
  /* @__PURE__ */ jsxRuntime.jsx("td", { className: "px-4 py-2.5", children: /* @__PURE__ */ jsxRuntime.jsx(ui.Typography, { variant: "caption", className: "text-text-secondary dark:text-text-secondary-dark", children: "Folder" }) }),
@@ -6559,7 +6577,7 @@ return result;
6559
6577
  ] }) }),
6560
6578
  /* @__PURE__ */ jsxRuntime.jsx("td", { className: "px-4 py-2.5", children: /* @__PURE__ */ jsxRuntime.jsx(ui.Typography, { variant: "caption", className: "text-text-secondary dark:text-text-secondary-dark", children: getExtension(file_2.name) || file_2.contentType?.split("/")[1]?.toUpperCase() || "—" }) }),
6561
6579
  /* @__PURE__ */ jsxRuntime.jsx("td", { className: "px-4 py-2.5 text-right", children: /* @__PURE__ */ jsxRuntime.jsx(ui.Typography, { variant: "caption", className: "text-text-secondary dark:text-text-secondary-dark font-mono text-[11px]", children: file_2.size !== void 0 ? formatFileSize(file_2.size) : "—" }) }),
6562
- /* @__PURE__ */ jsxRuntime.jsx("td", { className: "px-2 py-2.5", onClick: (e_11) => e_11.stopPropagation(), children: /* @__PURE__ */ jsxRuntime.jsx(ui.IconButton, { size: "smallest", className: "opacity-0 group-hover:opacity-100 transition-opacity", onClick: () => handleDeleteFile(file_2), children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Trash2Icon, { size: 14 }) }) })
6580
+ /* @__PURE__ */ jsxRuntime.jsx("td", { className: "px-2 py-2.5", onClick: (e_11) => e_11.stopPropagation(), children: /* @__PURE__ */ jsxRuntime.jsx(ui.IconButton, { size: "smallest", className: "opacity-0 group-hover:opacity-100 transition-opacity", onClick: () => handleDeleteFile(file_2), children: /* @__PURE__ */ jsxRuntime.jsx(ui.Trash2Icon, { size: 14 }) }) })
6563
6581
  ] }, file_2.fullPath);
6564
6582
  })
6565
6583
  ] })
@@ -6571,7 +6589,7 @@ return result;
6571
6589
  /* @__PURE__ */ jsxRuntime.jsx("div", { className: "grid gap-3 grid-cols-[repeat(auto-fill,minmax(140px,1fr))]", children: folders.map((folder_0) => {
6572
6590
  const isChecked_1 = selectedPaths.has(folder_0.fullPath);
6573
6591
  return /* @__PURE__ */ jsxRuntime.jsxs("div", { "data-storage-item": true, className: ui.cls("rounded-lg p-3 cursor-pointer border", "transition-colors duration-150", ui.defaultBorderMixin, "hover:bg-surface-100 dark:hover:bg-surface-800 hover:shadow-sm", "flex items-center gap-2", isChecked_1 && "ring-2 ring-primary bg-primary/5 dark:bg-primary/10"), onClick: (e_12) => handleItemClick(folder_0, e_12), onDoubleClick: () => handleItemDoubleClick(folder_0), children: [
6574
- /* @__PURE__ */ jsxRuntime.jsx(lucideReact.FolderIcon, { size: ui.iconSize.smallest, className: "text-amber-500 dark:text-amber-400 shrink-0" }),
6592
+ /* @__PURE__ */ jsxRuntime.jsx(ui.FolderIcon, { size: ui.iconSize.smallest, className: "text-amber-500 dark:text-amber-400 shrink-0" }),
6575
6593
  /* @__PURE__ */ jsxRuntime.jsx(ui.Typography, { variant: "body2", className: "text-[13px] font-medium truncate", children: folder_0.name })
6576
6594
  ] }, folder_0.fullPath);
6577
6595
  }) })
@@ -6606,7 +6624,7 @@ return result;
6606
6624
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex-grow flex flex-col min-w-0 h-full", children: [
6607
6625
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: ui.cls("flex items-center justify-between pr-2 border-b bg-white dark:bg-surface-800 shrink-0 h-10", ui.defaultBorderMixin), children: [
6608
6626
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-1.5 flex-grow overflow-hidden px-3 py-2", children: [
6609
- currentPath && /* @__PURE__ */ jsxRuntime.jsx(ui.Tooltip, { title: "Go up", children: /* @__PURE__ */ jsxRuntime.jsx(ui.IconButton, { size: "small", onClick: handleNavigateUp, children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ArrowLeftIcon, { size: ui.iconSize.smallest }) }) }),
6627
+ currentPath && /* @__PURE__ */ jsxRuntime.jsx(ui.Tooltip, { title: "Go up", children: /* @__PURE__ */ jsxRuntime.jsx(ui.IconButton, { size: "small", onClick: handleNavigateUp, children: /* @__PURE__ */ jsxRuntime.jsx(ui.ArrowLeftIcon, { size: ui.iconSize.smallest }) }) }),
6610
6628
  /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex items-center gap-0.5 overflow-x-auto no-scrollbar", children: segments.map((seg, i_3) => /* @__PURE__ */ jsxRuntime.jsxs(React.Fragment, { children: [
6611
6629
  i_3 > 0 && /* @__PURE__ */ jsxRuntime.jsx(ui.Typography, { variant: "caption", className: "text-text-disabled dark:text-text-disabled-dark mx-0.5", children: "/" }),
6612
6630
  /* @__PURE__ */ jsxRuntime.jsx(ui.Button, { variant: "text", size: "small", className: ui.cls("px-1.5 py-0.5 min-h-0 min-w-0 h-6 text-xs whitespace-nowrap normal-case font-normal", i_3 === segments.length - 1 ? "text-text-primary dark:text-text-primary-dark font-medium" : "text-text-secondary dark:text-text-secondary-dark"), onClick: () => handleNavigate(seg.path), children: seg.label })
@@ -6621,7 +6639,7 @@ return result;
6621
6639
  setDeleteDialogTarget("selection");
6622
6640
  setDeleteDialogOpen(true);
6623
6641
  }, children: [
6624
- /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Trash2Icon, { size: 14, className: "mr-1" }),
6642
+ /* @__PURE__ */ jsxRuntime.jsx(ui.Trash2Icon, { size: 14, className: "mr-1" }),
6625
6643
  "Delete"
6626
6644
  ] }),
6627
6645
  /* @__PURE__ */ jsxRuntime.jsxs(ui.Button, { size: "small", variant: "text", onClick: () => {
@@ -6629,7 +6647,7 @@ return result;
6629
6647
  setSelectedFile(null);
6630
6648
  setSelectedDownloadUrl(null);
6631
6649
  }, children: [
6632
- /* @__PURE__ */ jsxRuntime.jsx(lucideReact.XIcon, { size: 14, className: "mr-1" }),
6650
+ /* @__PURE__ */ jsxRuntime.jsx(ui.XIcon, { size: 14, className: "mr-1" }),
6633
6651
  "Deselect"
6634
6652
  ] })
6635
6653
  ] }) : !loading ? /* @__PURE__ */ jsxRuntime.jsxs(ui.Chip, { size: "small", className: "shrink-0 text-[10px]", children: [
@@ -6640,16 +6658,16 @@ return result;
6640
6658
  ] }) : null
6641
6659
  ] }),
6642
6660
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex shrink-0 items-center justify-end gap-1.5 pr-1", children: [
6643
- /* @__PURE__ */ jsxRuntime.jsx(ui.Tooltip, { title: "Grid view", children: /* @__PURE__ */ jsxRuntime.jsx(ui.IconButton, { size: "small", onClick: () => setViewMode("grid"), className: ui.cls(viewMode === "grid" && "bg-surface-100 dark:bg-surface-800"), children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.LayoutGridIcon, { size: ui.iconSize.smallest }) }) }),
6644
- /* @__PURE__ */ jsxRuntime.jsx(ui.Tooltip, { title: "List view", children: /* @__PURE__ */ jsxRuntime.jsx(ui.IconButton, { size: "small", onClick: () => setViewMode("list"), className: ui.cls(viewMode === "list" && "bg-surface-100 dark:bg-surface-800"), children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ListIcon, { size: ui.iconSize.smallest }) }) }),
6661
+ /* @__PURE__ */ jsxRuntime.jsx(ui.Tooltip, { title: "Grid view", children: /* @__PURE__ */ jsxRuntime.jsx(ui.IconButton, { size: "small", onClick: () => setViewMode("grid"), className: ui.cls(viewMode === "grid" && "bg-surface-100 dark:bg-surface-800"), children: /* @__PURE__ */ jsxRuntime.jsx(ui.LayoutGridIcon, { size: ui.iconSize.smallest }) }) }),
6662
+ /* @__PURE__ */ jsxRuntime.jsx(ui.Tooltip, { title: "List view", children: /* @__PURE__ */ jsxRuntime.jsx(ui.IconButton, { size: "small", onClick: () => setViewMode("list"), className: ui.cls(viewMode === "list" && "bg-surface-100 dark:bg-surface-800"), children: /* @__PURE__ */ jsxRuntime.jsx(ui.ListIcon, { size: ui.iconSize.smallest }) }) }),
6645
6663
  /* @__PURE__ */ jsxRuntime.jsx("div", { className: ui.cls("h-4 w-px mx-0.5", ui.defaultBorderMixin, "bg-surface-200 dark:bg-surface-700") }),
6646
- /* @__PURE__ */ jsxRuntime.jsx(ui.Tooltip, { title: "Refresh", children: /* @__PURE__ */ jsxRuntime.jsx(ui.IconButton, { size: "small", onClick: handleRefresh, disabled: loading, children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.RefreshCwIcon, { size: ui.iconSize.smallest }) }) }),
6664
+ /* @__PURE__ */ jsxRuntime.jsx(ui.Tooltip, { title: "Refresh", children: /* @__PURE__ */ jsxRuntime.jsx(ui.IconButton, { size: "small", onClick: handleRefresh, disabled: loading, children: /* @__PURE__ */ jsxRuntime.jsx(ui.RefreshCwIcon, { size: ui.iconSize.smallest }) }) }),
6647
6665
  /* @__PURE__ */ jsxRuntime.jsx(ui.Tooltip, { title: "New folder", children: /* @__PURE__ */ jsxRuntime.jsx(ui.IconButton, { size: "small", onClick: () => {
6648
6666
  setNewFolderName("");
6649
6667
  setNewFolderDialogOpen(true);
6650
- }, children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.FolderPlusIcon, { size: ui.iconSize.smallest }) }) }),
6668
+ }, children: /* @__PURE__ */ jsxRuntime.jsx(ui.FolderPlusIcon, { size: ui.iconSize.smallest }) }) }),
6651
6669
  /* @__PURE__ */ jsxRuntime.jsxs(ui.Button, { size: "small", color: "primary", onClick: () => setUploadDialogOpen(true), children: [
6652
- /* @__PURE__ */ jsxRuntime.jsx(lucideReact.UploadCloudIcon, { size: ui.iconSize.smallest, className: "mr-1" }),
6670
+ /* @__PURE__ */ jsxRuntime.jsx(ui.UploadCloudIcon, { size: ui.iconSize.smallest, className: "mr-1" }),
6653
6671
  "Upload"
6654
6672
  ] })
6655
6673
  ] })
@@ -6665,7 +6683,7 @@ return result;
6665
6683
  /* @__PURE__ */ jsxRuntime.jsx("input", { ...getDropInputProps() }),
6666
6684
  renderContents(),
6667
6685
  isDragActive && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "absolute inset-0 z-10 flex items-center justify-center bg-primary/5 dark:bg-primary/10 backdrop-blur-[2px]", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col items-center gap-2 p-6 rounded-xl border-2 border-dashed border-primary bg-white/80 dark:bg-surface-900/80", children: [
6668
- /* @__PURE__ */ jsxRuntime.jsx(lucideReact.UploadCloudIcon, { className: "w-10 h-10 text-primary" }),
6686
+ /* @__PURE__ */ jsxRuntime.jsx(ui.UploadCloudIcon, { className: "w-10 h-10 text-primary" }),
6669
6687
  /* @__PURE__ */ jsxRuntime.jsx(ui.Typography, { variant: "subtitle2", className: "text-primary font-semibold", children: "Drop files to upload" }),
6670
6688
  /* @__PURE__ */ jsxRuntime.jsxs(ui.Typography, { variant: "caption", color: "secondary", children: [
6671
6689
  "to /",
@@ -6714,7 +6732,7 @@ return result;
6714
6732
  setDeleteDialogTarget(null);
6715
6733
  }, disabled: deleting, children: "Cancel" }),
6716
6734
  /* @__PURE__ */ jsxRuntime.jsxs(ui.LoadingButton, { color: "error", loading: deleting, onClick: deleteDialogTarget === "selection" ? handleBulkDelete : handleConfirmDeleteFolder, children: [
6717
- /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Trash2Icon, { size: 14, className: "mr-1" }),
6735
+ /* @__PURE__ */ jsxRuntime.jsx(ui.Trash2Icon, { size: 14, className: "mr-1" }),
6718
6736
  "Delete"
6719
6737
  ] })
6720
6738
  ] })
@@ -6748,7 +6766,7 @@ return result;
6748
6766
  setNewFolderName("");
6749
6767
  }, disabled: creatingFolder, children: "Cancel" }),
6750
6768
  /* @__PURE__ */ jsxRuntime.jsxs(ui.LoadingButton, { color: "primary", loading: creatingFolder, disabled: !newFolderName.trim(), onClick: handleCreateFolder, children: [
6751
- /* @__PURE__ */ jsxRuntime.jsx(lucideReact.FolderPlusIcon, { size: 14, className: "mr-1" }),
6769
+ /* @__PURE__ */ jsxRuntime.jsx(ui.FolderPlusIcon, { size: 14, className: "mr-1" }),
6752
6770
  "Create"
6753
6771
  ] })
6754
6772
  ] })
@@ -6917,7 +6935,7 @@ return result;
6917
6935
  const selectedJob = jobs.find((j) => j.id === selectedId);
6918
6936
  if (loading) return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex items-center justify-center h-full", children: /* @__PURE__ */ jsxRuntime.jsx(ui.CircularProgress, {}) });
6919
6937
  if (jobs.length === 0) return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col items-center justify-center h-full gap-4 text-center p-8", children: [
6920
- /* @__PURE__ */ jsxRuntime.jsx(lucideReact.CalendarIcon, { size: ui.iconSize.medium, className: "text-surface-300 dark:text-surface-600" }),
6938
+ /* @__PURE__ */ jsxRuntime.jsx(ui.CalendarIcon, { size: ui.iconSize.medium, className: "text-surface-300 dark:text-surface-600" }),
6921
6939
  /* @__PURE__ */ jsxRuntime.jsx(ui.Typography, { variant: "h6", color: "secondary", children: "No Cron Jobs Registered" }),
6922
6940
  /* @__PURE__ */ jsxRuntime.jsxs(ui.Typography, { variant: "body2", color: "disabled", className: "max-w-md", children: [
6923
6941
  "Create a file in your ",
@@ -6931,11 +6949,11 @@ return result;
6931
6949
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: ui.cls("flex flex-col w-[340px] min-w-[280px] border-r h-full", ui.defaultBorderMixin), children: [
6932
6950
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: ui.cls("flex items-center justify-between px-4 py-2.5 border-b bg-surface-50 dark:bg-surface-900 min-h-[48px]", ui.defaultBorderMixin), children: [
6933
6951
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2", children: [
6934
- /* @__PURE__ */ jsxRuntime.jsx(lucideReact.CalendarIcon, { size: ui.iconSize.smallest, className: "text-primary" }),
6952
+ /* @__PURE__ */ jsxRuntime.jsx(ui.CalendarIcon, { size: ui.iconSize.smallest, className: "text-primary" }),
6935
6953
  /* @__PURE__ */ jsxRuntime.jsx(ui.Typography, { variant: "subtitle2", className: "font-semibold", children: "Cron Jobs" }),
6936
6954
  /* @__PURE__ */ jsxRuntime.jsx(ui.Chip, { size: "smallest", className: "bg-surface-200 dark:bg-surface-700 text-surface-600 dark:text-surface-300", children: jobs.length })
6937
6955
  ] }),
6938
- /* @__PURE__ */ jsxRuntime.jsx(ui.IconButton, { size: "small", onClick: refreshJobs, title: "Refresh", children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.RefreshCwIcon, { size: ui.iconSize.smallest }) })
6956
+ /* @__PURE__ */ jsxRuntime.jsx(ui.IconButton, { size: "small", onClick: refreshJobs, title: "Refresh", children: /* @__PURE__ */ jsxRuntime.jsx(ui.RefreshCwIcon, { size: ui.iconSize.smallest }) })
6939
6957
  ] }),
6940
6958
  /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex-1 overflow-y-auto p-2 space-y-1", children: jobs.map((job) => /* @__PURE__ */ jsxRuntime.jsxs("div", { onClick: () => setSelectedId(job.id), className: ui.cls("flex items-center gap-3 px-3 py-2.5 rounded-lg cursor-pointer transition-all", selectedId === job.id ? "bg-primary/10 dark:bg-primary/15 ring-1 ring-primary/30" : "hover:bg-surface-100 dark:hover:bg-surface-950"), children: [
6941
6959
  /* @__PURE__ */ jsxRuntime.jsx("div", { className: ui.cls("w-2 h-2 rounded-full shrink-0", stateColors[job.state] || "bg-surface-400") }),
@@ -6956,8 +6974,8 @@ return result;
6956
6974
  ] })
6957
6975
  ] }),
6958
6976
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2 shrink-0", children: [
6959
- /* @__PURE__ */ jsxRuntime.jsx(ui.IconButton, { title: selectedJob.enabled ? "Pause job" : "Enable job", size: "small", onClick: () => handleToggle(selectedJob.id, !selectedJob.enabled), children: selectedJob.enabled ? /* @__PURE__ */ jsxRuntime.jsx(lucideReact.PauseIcon, { size: ui.iconSize.small }) : /* @__PURE__ */ jsxRuntime.jsx(lucideReact.PlayIcon, { size: ui.iconSize.smallest }) }),
6960
- /* @__PURE__ */ jsxRuntime.jsx(ui.Button, { size: "small", color: "primary", onClick: () => handleTrigger(selectedJob.id), disabled: triggering === selectedJob.id, startIcon: triggering === selectedJob.id ? /* @__PURE__ */ jsxRuntime.jsx(ui.CircularProgress, { size: "smallest" }) : /* @__PURE__ */ jsxRuntime.jsx(lucideReact.PlayIcon, { size: ui.iconSize.smallest }), children: "Run Now" })
6977
+ /* @__PURE__ */ jsxRuntime.jsx(ui.IconButton, { title: selectedJob.enabled ? "Pause job" : "Enable job", size: "small", onClick: () => handleToggle(selectedJob.id, !selectedJob.enabled), children: selectedJob.enabled ? /* @__PURE__ */ jsxRuntime.jsx(ui.PauseIcon, { size: ui.iconSize.small }) : /* @__PURE__ */ jsxRuntime.jsx(ui.PlayIcon, { size: ui.iconSize.smallest }) }),
6978
+ /* @__PURE__ */ jsxRuntime.jsx(ui.Button, { size: "small", color: "primary", onClick: () => handleTrigger(selectedJob.id), disabled: triggering === selectedJob.id, startIcon: triggering === selectedJob.id ? /* @__PURE__ */ jsxRuntime.jsx(ui.CircularProgress, { size: "smallest" }) : /* @__PURE__ */ jsxRuntime.jsx(ui.PlayIcon, { size: ui.iconSize.smallest }), children: "Run Now" })
6961
6979
  ] })
6962
6980
  ] }),
6963
6981
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "px-5 py-4 bg-surface-50 dark:bg-surface-900/50", children: [
@@ -6974,7 +6992,7 @@ return result;
6974
6992
  ] }),
6975
6993
  selectedJob.lastError && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "mt-3 p-3 rounded-lg bg-red-50 dark:bg-red-900/20 border border-red-200 dark:border-red-800/50", children: [
6976
6994
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2 mb-1", children: [
6977
- /* @__PURE__ */ jsxRuntime.jsx(lucideReact.AlertCircleIcon, { size: ui.iconSize.smallest, className: "text-red-500" }),
6995
+ /* @__PURE__ */ jsxRuntime.jsx(ui.AlertCircleIcon, { size: ui.iconSize.smallest, className: "text-red-500" }),
6978
6996
  /* @__PURE__ */ jsxRuntime.jsx(ui.Typography, { variant: "caption", className: "font-semibold text-red-700 dark:text-red-400", children: "Last Error" })
6979
6997
  ] }),
6980
6998
  /* @__PURE__ */ jsxRuntime.jsx(ui.Typography, { variant: "caption", className: "font-mono text-red-600 dark:text-red-300 text-[11px] break-all", children: selectedJob.lastError })
@@ -6982,10 +7000,10 @@ return result;
6982
7000
  ] }),
6983
7001
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: ui.cls("flex items-center justify-between px-5 py-2 border-y bg-white dark:bg-surface-950", ui.defaultBorderMixin), children: [
6984
7002
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2", children: [
6985
- /* @__PURE__ */ jsxRuntime.jsx(lucideReact.HistoryIcon, { size: ui.iconSize.smallest, className: "text-surface-400" }),
7003
+ /* @__PURE__ */ jsxRuntime.jsx(ui.HistoryIcon, { size: ui.iconSize.smallest, className: "text-surface-400" }),
6986
7004
  /* @__PURE__ */ jsxRuntime.jsx(ui.Typography, { variant: "subtitle2", className: "font-semibold text-[13px]", children: "Execution History" })
6987
7005
  ] }),
6988
- /* @__PURE__ */ jsxRuntime.jsx(ui.IconButton, { size: "small", onClick: () => refreshLogs(selectedJob.id), title: "Refresh logs", children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.RefreshCwIcon, { size: ui.iconSize.smallest }) })
7006
+ /* @__PURE__ */ jsxRuntime.jsx(ui.IconButton, { size: "small", onClick: () => refreshLogs(selectedJob.id), title: "Refresh logs", children: /* @__PURE__ */ jsxRuntime.jsx(ui.RefreshCwIcon, { size: ui.iconSize.smallest }) })
6989
7007
  ] }),
6990
7008
  /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex-1 overflow-y-auto", children: logsLoading ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex justify-center p-8", children: /* @__PURE__ */ jsxRuntime.jsx(ui.CircularProgress, { size: "small" }) }) : logs.length === 0 ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex items-center justify-center h-32", children: /* @__PURE__ */ jsxRuntime.jsx(ui.Typography, { variant: "body2", color: "disabled", children: "No executions yet" }) }) : /* @__PURE__ */ jsxRuntime.jsx("div", { className: "divide-y divide-surface-100 dark:divide-surface-950", children: logs.map((log, idx) => /* @__PURE__ */ jsxRuntime.jsx(LogRow, { log }, idx)) }) })
6991
7009
  ] }) })
@@ -7071,7 +7089,7 @@ return result;
7071
7089
  }
7072
7090
  let t2;
7073
7091
  if ($[2] !== log.success) {
7074
- t2 = log.success ? /* @__PURE__ */ jsxRuntime.jsx(lucideReact.CheckCircleIcon, { size: ui.iconSize.smallest, className: "text-emerald-500 shrink-0" }) : /* @__PURE__ */ jsxRuntime.jsx(lucideReact.AlertCircleIcon, { size: ui.iconSize.smallest, className: "text-red-500 shrink-0" });
7092
+ t2 = log.success ? /* @__PURE__ */ jsxRuntime.jsx(ui.CheckCircleIcon, { size: ui.iconSize.smallest, className: "text-emerald-500 shrink-0" }) : /* @__PURE__ */ jsxRuntime.jsx(ui.AlertCircleIcon, { size: ui.iconSize.smallest, className: "text-red-500 shrink-0" });
7075
7093
  $[2] = log.success;
7076
7094
  $[3] = t2;
7077
7095
  } else {
@@ -8380,7 +8398,7 @@ return result;
8380
8398
  };
8381
8399
  if (!branchAdmin) {
8382
8400
  return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col items-center justify-center h-full gap-4 text-center p-8", children: [
8383
- /* @__PURE__ */ jsxRuntime.jsx(lucideReact.GitBranchIcon, { size: ui.iconSize.large, className: "text-surface-300 dark:text-surface-600" }),
8401
+ /* @__PURE__ */ jsxRuntime.jsx(ui.GitBranchIcon, { size: ui.iconSize.large, className: "text-surface-300 dark:text-surface-600" }),
8384
8402
  /* @__PURE__ */ jsxRuntime.jsx(ui.Typography, { variant: "h6", color: "secondary", children: "Database Branching Not Available" }),
8385
8403
  /* @__PURE__ */ jsxRuntime.jsxs(ui.Typography, { variant: "body2", color: "disabled", className: "max-w-md", children: [
8386
8404
  "Branching requires a PostgreSQL backend with an admin connection configured. Set ",
@@ -8397,19 +8415,19 @@ return result;
8397
8415
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: ui.cls("flex flex-col w-[340px] min-w-[280px] border-r h-full", ui.defaultBorderMixin), children: [
8398
8416
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: ui.cls("flex items-center justify-between px-4 py-2.5 border-b bg-surface-50 dark:bg-surface-900 min-h-[48px]", ui.defaultBorderMixin), children: [
8399
8417
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2", children: [
8400
- /* @__PURE__ */ jsxRuntime.jsx(lucideReact.GitBranchIcon, { size: ui.iconSize.small, className: "text-primary" }),
8418
+ /* @__PURE__ */ jsxRuntime.jsx(ui.GitBranchIcon, { size: ui.iconSize.small, className: "text-primary" }),
8401
8419
  /* @__PURE__ */ jsxRuntime.jsx(ui.Typography, { variant: "subtitle2", className: "font-semibold", children: "Branches" }),
8402
8420
  /* @__PURE__ */ jsxRuntime.jsx(ui.Chip, { size: "smallest", className: "bg-surface-200 dark:bg-surface-700 text-surface-600 dark:text-surface-300", children: branches.length })
8403
8421
  ] }),
8404
8422
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-1", children: [
8405
- /* @__PURE__ */ jsxRuntime.jsx(ui.IconButton, { size: "small", onClick: loadBranches, title: "Refresh", children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.RefreshCwIcon, { size: ui.iconSize.smallest }) }),
8406
- /* @__PURE__ */ jsxRuntime.jsx(ui.IconButton, { size: "small", onClick: () => setCreateOpen(true), title: "Create branch", className: "text-primary", children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.PlusIcon, { size: ui.iconSize.smallest }) })
8423
+ /* @__PURE__ */ jsxRuntime.jsx(ui.IconButton, { size: "small", onClick: loadBranches, title: "Refresh", children: /* @__PURE__ */ jsxRuntime.jsx(ui.RefreshCwIcon, { size: ui.iconSize.smallest }) }),
8424
+ /* @__PURE__ */ jsxRuntime.jsx(ui.IconButton, { size: "small", onClick: () => setCreateOpen(true), title: "Create branch", className: "text-primary", children: /* @__PURE__ */ jsxRuntime.jsx(ui.PlusIcon, { size: ui.iconSize.smallest }) })
8407
8425
  ] })
8408
8426
  ] }),
8409
8427
  /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex-1 overflow-y-auto p-2 space-y-1", children: branches.length === 0 ? /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col items-center justify-center h-full gap-3 text-center px-4", children: [
8410
- /* @__PURE__ */ jsxRuntime.jsx(lucideReact.CopyIcon, { size: ui.iconSize.small, className: "text-surface-300 dark:text-surface-600" }),
8428
+ /* @__PURE__ */ jsxRuntime.jsx(ui.CopyIcon, { size: ui.iconSize.small, className: "text-surface-300 dark:text-surface-600" }),
8411
8429
  /* @__PURE__ */ jsxRuntime.jsx(ui.Typography, { variant: "body2", color: "disabled", className: "text-[13px]", children: "No branches yet. Create one to start working with an isolated database copy." }),
8412
- /* @__PURE__ */ jsxRuntime.jsx(ui.Button, { size: "small", variant: "outlined", onClick: () => setCreateOpen(true), startIcon: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.PlusIcon, { size: ui.iconSize.smallest }), children: "Create Branch" })
8430
+ /* @__PURE__ */ jsxRuntime.jsx(ui.Button, { size: "small", variant: "outlined", onClick: () => setCreateOpen(true), startIcon: /* @__PURE__ */ jsxRuntime.jsx(ui.PlusIcon, { size: ui.iconSize.smallest }), children: "Create Branch" })
8413
8431
  ] }) : branches.map((branch) => /* @__PURE__ */ jsxRuntime.jsxs("div", { onClick: () => setSelectedBranch(branch.name), className: ui.cls("flex items-center gap-3 px-3 py-2.5 rounded-lg cursor-pointer transition-all", selectedBranch === branch.name ? "bg-primary/10 dark:bg-primary/15 ring-1 ring-primary/30" : "hover:bg-surface-100 dark:hover:bg-surface-950"), children: [
8414
8432
  /* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-2 h-2 rounded-full shrink-0 bg-emerald-500" }),
8415
8433
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex-1 min-w-0", children: [
@@ -8425,7 +8443,7 @@ return result;
8425
8443
  ] }, branch.name)) })
8426
8444
  ] }),
8427
8445
  /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex-1 flex flex-col min-w-0 h-full overflow-hidden", children: !selected ? /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col items-center justify-center h-full gap-3", children: [
8428
- /* @__PURE__ */ jsxRuntime.jsx(lucideReact.GitBranchIcon, { size: ui.iconSize.large, className: "text-surface-200 dark:text-surface-700" }),
8446
+ /* @__PURE__ */ jsxRuntime.jsx(ui.GitBranchIcon, { size: ui.iconSize.large, className: "text-surface-200 dark:text-surface-700" }),
8429
8447
  /* @__PURE__ */ jsxRuntime.jsx(ui.Typography, { variant: "body2", color: "disabled", children: branches.length === 0 ? "Create a branch to get started" : "Select a branch to view details" })
8430
8448
  ] }) : /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
8431
8449
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: ui.cls("flex items-center justify-between px-5 py-3 border-b bg-white dark:bg-surface-950 min-h-[56px]", ui.defaultBorderMixin), children: [
@@ -8439,7 +8457,7 @@ return result;
8439
8457
  ] })
8440
8458
  ] })
8441
8459
  ] }),
8442
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex items-center gap-2 shrink-0", children: /* @__PURE__ */ jsxRuntime.jsx(ui.Button, { size: "small", color: "error", variant: "outlined", onClick: () => setDeleteTarget(selected.name), startIcon: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Trash2Icon, { size: ui.iconSize.smallest }), children: "Delete" }) })
8460
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex items-center gap-2 shrink-0", children: /* @__PURE__ */ jsxRuntime.jsx(ui.Button, { size: "small", color: "error", variant: "outlined", onClick: () => setDeleteTarget(selected.name), startIcon: /* @__PURE__ */ jsxRuntime.jsx(ui.Trash2Icon, { size: ui.iconSize.smallest }), children: "Delete" }) })
8443
8461
  ] }),
8444
8462
  /* @__PURE__ */ jsxRuntime.jsx("div", { className: "px-5 py-4 bg-surface-50 dark:bg-surface-900/50", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "grid grid-cols-2 md:grid-cols-4 gap-3", children: [
8445
8463
  /* @__PURE__ */ jsxRuntime.jsx(StatCard, { label: "Branch Name", value: selected.name, mono: true }),
@@ -8485,7 +8503,7 @@ return result;
8485
8503
  ] }),
8486
8504
  /* @__PURE__ */ jsxRuntime.jsxs(ui.DialogActions, { children: [
8487
8505
  /* @__PURE__ */ jsxRuntime.jsx(ui.Button, { variant: "text", onClick: () => setCreateOpen(false), disabled: creating, children: "Cancel" }),
8488
- /* @__PURE__ */ jsxRuntime.jsx(ui.Button, { color: "primary", onClick: handleCreate, disabled: !newBranchName.trim() || creating, startIcon: creating ? /* @__PURE__ */ jsxRuntime.jsx(ui.CircularProgress, { size: "smallest" }) : /* @__PURE__ */ jsxRuntime.jsx(lucideReact.PlusIcon, { size: ui.iconSize.smallest }), children: creating ? "Creating..." : "Create Branch" })
8506
+ /* @__PURE__ */ jsxRuntime.jsx(ui.Button, { color: "primary", onClick: handleCreate, disabled: !newBranchName.trim() || creating, startIcon: creating ? /* @__PURE__ */ jsxRuntime.jsx(ui.CircularProgress, { size: "smallest" }) : /* @__PURE__ */ jsxRuntime.jsx(ui.PlusIcon, { size: ui.iconSize.smallest }), children: creating ? "Creating..." : "Create Branch" })
8489
8507
  ] })
8490
8508
  ] }),
8491
8509
  /* @__PURE__ */ jsxRuntime.jsx(core.ConfirmationDialog, { open: !!deleteTarget, onAccept: handleDelete, onCancel: () => setDeleteTarget(null), title: "Delete Branch", body: /* @__PURE__ */ jsxRuntime.jsxs(ui.Typography, { variant: "body2", children: [
@@ -8654,7 +8672,7 @@ return result;
8654
8672
  let t2;
8655
8673
  if ($[3] !== endpoint.parameters) {
8656
8674
  t2 = endpoint.parameters.length > 0 && /* @__PURE__ */ jsxRuntime.jsxs("section", { children: [
8657
- /* @__PURE__ */ jsxRuntime.jsx(SectionHeading, { icon: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.SlidersHorizontalIcon, { size: ui.iconSize.small, className: "text-text-secondary dark:text-text-secondary-dark" }), title: "Parameters" }),
8675
+ /* @__PURE__ */ jsxRuntime.jsx(SectionHeading, { icon: /* @__PURE__ */ jsxRuntime.jsx(ui.SlidersHorizontalIcon, { size: ui.iconSize.small, className: "text-text-secondary dark:text-text-secondary-dark" }), title: "Parameters" }),
8658
8676
  /* @__PURE__ */ jsxRuntime.jsx("div", { className: ui.cls("rounded-lg border overflow-hidden", ui.defaultBorderMixin), children: /* @__PURE__ */ jsxRuntime.jsxs("table", { className: "w-full text-sm", children: [
8659
8677
  /* @__PURE__ */ jsxRuntime.jsx("thead", { children: /* @__PURE__ */ jsxRuntime.jsxs("tr", { className: "bg-surface-100 dark:bg-surface-900 text-left", children: [
8660
8678
  /* @__PURE__ */ jsxRuntime.jsx("th", { className: "px-4 py-2 font-medium text-text-secondary dark:text-text-secondary-dark", children: "Name" }),
@@ -8673,7 +8691,7 @@ return result;
8673
8691
  let t3;
8674
8692
  if ($[5] !== endpoint.requestBody || $[6] !== spec) {
8675
8693
  t3 = endpoint.requestBody && /* @__PURE__ */ jsxRuntime.jsxs("section", { children: [
8676
- /* @__PURE__ */ jsxRuntime.jsx(SectionHeading, { icon: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.UploadIcon, { size: ui.iconSize.small, className: "text-text-secondary dark:text-text-secondary-dark" }), title: "Request Body" }),
8694
+ /* @__PURE__ */ jsxRuntime.jsx(SectionHeading, { icon: /* @__PURE__ */ jsxRuntime.jsx(ui.UploadIcon, { size: ui.iconSize.small, className: "text-text-secondary dark:text-text-secondary-dark" }), title: "Request Body" }),
8677
8695
  Object.entries(endpoint.requestBody.content ?? {}).map((t42) => {
8678
8696
  const [contentType, media] = t42;
8679
8697
  return /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
@@ -8690,7 +8708,7 @@ return result;
8690
8708
  }
8691
8709
  let t4;
8692
8710
  if ($[8] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
8693
- t4 = /* @__PURE__ */ jsxRuntime.jsx(SectionHeading, { icon: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ArrowRightFromLineIcon, { size: ui.iconSize.small, className: "text-text-secondary dark:text-text-secondary-dark" }), title: "Responses" });
8711
+ t4 = /* @__PURE__ */ jsxRuntime.jsx(SectionHeading, { icon: /* @__PURE__ */ jsxRuntime.jsx(ui.ArrowRightFromLineIcon, { size: ui.iconSize.small, className: "text-text-secondary dark:text-text-secondary-dark" }), title: "Responses" });
8694
8712
  $[8] = t4;
8695
8713
  } else {
8696
8714
  t4 = $[8];
@@ -9210,10 +9228,10 @@ return result;
9210
9228
  /* @__PURE__ */ jsxRuntime.jsx("code", { className: "text-xs font-mono text-text-primary dark:text-text-primary-dark break-all", children: resolvedUrl })
9211
9229
  ] }),
9212
9230
  /* @__PURE__ */ jsxRuntime.jsx(ui.Button, { variant: "filled", onClick: execute, disabled: loading, className: "w-full", children: loading ? /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "flex items-center gap-2", children: [
9213
- /* @__PURE__ */ jsxRuntime.jsx(lucideReact.LoaderIcon, { size: ui.iconSize.small, className: "animate-spin" }),
9231
+ /* @__PURE__ */ jsxRuntime.jsx(ui.LoaderIcon, { size: ui.iconSize.small, className: "animate-spin" }),
9214
9232
  "Sending…"
9215
9233
  ] }) : /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "flex items-center gap-2", children: [
9216
- /* @__PURE__ */ jsxRuntime.jsx(lucideReact.SendIcon, { size: ui.iconSize.small }),
9234
+ /* @__PURE__ */ jsxRuntime.jsx(ui.SendIcon, { size: ui.iconSize.small }),
9217
9235
  "Send Request"
9218
9236
  ] }) }),
9219
9237
  response && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: ui.cls("rounded-lg border overflow-hidden", ui.defaultBorderMixin), children: [
@@ -9313,7 +9331,7 @@ return result;
9313
9331
  }
9314
9332
  let t2;
9315
9333
  if ($[2] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
9316
- t2 = /* @__PURE__ */ jsxRuntime.jsx(lucideReact.PlusIcon, { size: ui.iconSize.small, className: "mr-1" });
9334
+ t2 = /* @__PURE__ */ jsxRuntime.jsx(ui.PlusIcon, { size: ui.iconSize.small, className: "mr-1" });
9317
9335
  $[2] = t2;
9318
9336
  } else {
9319
9337
  t2 = $[2];
@@ -9348,7 +9366,7 @@ return result;
9348
9366
  t62 = (v, i) => /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2", children: [
9349
9367
  /* @__PURE__ */ jsxRuntime.jsx(ui.TextField, { size: "small", placeholder: "Header name", value: v.key, onChange: (e) => onChange(i, e.target.value, v.value), className: "w-1/3", inputClassName: "font-mono text-xs" }),
9350
9368
  /* @__PURE__ */ jsxRuntime.jsx(ui.TextField, { size: "small", placeholder: "Value", value: v.value, onChange: (e_0) => onChange(i, v.key, e_0.target.value), className: "flex-1", inputClassName: "font-mono text-xs" }),
9351
- /* @__PURE__ */ jsxRuntime.jsx(ui.IconButton, { size: "small", onClick: () => onRemove(i), className: "text-text-secondary hover:text-red-500 shrink-0", title: "Remove", children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.XIcon, { size: ui.iconSize.small }) })
9369
+ /* @__PURE__ */ jsxRuntime.jsx(ui.IconButton, { size: "small", onClick: () => onRemove(i), className: "text-text-secondary hover:text-red-500 shrink-0", title: "Remove", children: /* @__PURE__ */ jsxRuntime.jsx(ui.XIcon, { size: ui.iconSize.small }) })
9352
9370
  ] }, i);
9353
9371
  $[12] = onChange;
9354
9372
  $[13] = onRemove;
@@ -9553,7 +9571,7 @@ return result;
9553
9571
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: ui.cls("w-72 min-w-[272px] flex flex-col h-full overflow-hidden border-r", ui.defaultBorderMixin, "bg-surface-50 dark:bg-surface-900"), children: [
9554
9572
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "p-4 space-y-3", children: [
9555
9573
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2", children: [
9556
- /* @__PURE__ */ jsxRuntime.jsx(lucideReact.BookOpenIcon, { size: ui.iconSize.medium, className: "text-primary dark:text-primary-dark" }),
9574
+ /* @__PURE__ */ jsxRuntime.jsx(ui.BookOpenIcon, { size: ui.iconSize.medium, className: "text-primary dark:text-primary-dark" }),
9557
9575
  /* @__PURE__ */ jsxRuntime.jsx(ui.Typography, { variant: "subtitle2", className: "font-semibold", children: spec.info?.title ?? "API Reference" })
9558
9576
  ] }),
9559
9577
  spec.info?.version && /* @__PURE__ */ jsxRuntime.jsxs(ui.Chip, { size: "smallest", colorScheme: "cyanDarker", children: [
@@ -9586,7 +9604,7 @@ return result;
9586
9604
  /* @__PURE__ */ jsxRuntime.jsx("code", { className: "text-sm font-mono text-text-primary dark:text-text-primary-dark truncate", children: selectedEndpoint.path })
9587
9605
  ] }),
9588
9606
  /* @__PURE__ */ jsxRuntime.jsxs(ui.Button, { variant: tryItOpen ? "filled" : "outlined", size: "small", onClick: () => setTryItOpen((v) => !v), children: [
9589
- /* @__PURE__ */ jsxRuntime.jsx(lucideReact.PlayIcon, { size: ui.iconSize.small, className: "mr-1" }),
9607
+ /* @__PURE__ */ jsxRuntime.jsx(ui.PlayIcon, { size: ui.iconSize.small, className: "mr-1" }),
9590
9608
  "Try It"
9591
9609
  ] })
9592
9610
  ] }),