@burtson-labs/bandit-engine 2.0.51 → 2.0.52

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 (36) hide show
  1. package/dist/{chat-W5IFNEUC.mjs → chat-YWYLVKXX.mjs} +5 -5
  2. package/dist/chat-provider.js +225 -8
  3. package/dist/chat-provider.js.map +1 -1
  4. package/dist/chat-provider.mjs +3 -3
  5. package/dist/{chunk-EWUUF4GE.mjs → chunk-37PEP5JK.mjs} +2 -2
  6. package/dist/{chunk-HETIHZ42.mjs → chunk-M3BEAMCC.mjs} +2 -2
  7. package/dist/{chunk-QFSEZAG6.mjs → chunk-MH7WFWCP.mjs} +34 -3
  8. package/dist/chunk-MH7WFWCP.mjs.map +1 -0
  9. package/dist/{chunk-IDH2YOW3.mjs → chunk-QX6CO7TJ.mjs} +196 -9
  10. package/dist/chunk-QX6CO7TJ.mjs.map +1 -0
  11. package/dist/{chunk-LXD3IV6Z.mjs → chunk-RSSJADDD.mjs} +3 -3
  12. package/dist/{chunk-STMXPFAQ.mjs → chunk-TSQCNHOX.mjs} +4 -4
  13. package/dist/{chunk-JBXNXSAH.mjs → chunk-Y5N3NSTU.mjs} +459 -180
  14. package/dist/chunk-Y5N3NSTU.mjs.map +1 -0
  15. package/dist/{chunk-N7RMUOFB.mjs → chunk-YZ2HJFPQ.mjs} +2 -2
  16. package/dist/cli.js +1 -1
  17. package/dist/cli.js.map +1 -1
  18. package/dist/index.js +678 -183
  19. package/dist/index.js.map +1 -1
  20. package/dist/index.mjs +8 -8
  21. package/dist/management/management.js +648 -183
  22. package/dist/management/management.js.map +1 -1
  23. package/dist/management/management.mjs +6 -6
  24. package/dist/modals/chat-modal/chat-modal.js +197 -8
  25. package/dist/modals/chat-modal/chat-modal.js.map +1 -1
  26. package/dist/modals/chat-modal/chat-modal.mjs +3 -3
  27. package/package.json +1 -1
  28. package/dist/chunk-IDH2YOW3.mjs.map +0 -1
  29. package/dist/chunk-JBXNXSAH.mjs.map +0 -1
  30. package/dist/chunk-QFSEZAG6.mjs.map +0 -1
  31. /package/dist/{chat-W5IFNEUC.mjs.map → chat-YWYLVKXX.mjs.map} +0 -0
  32. /package/dist/{chunk-EWUUF4GE.mjs.map → chunk-37PEP5JK.mjs.map} +0 -0
  33. /package/dist/{chunk-HETIHZ42.mjs.map → chunk-M3BEAMCC.mjs.map} +0 -0
  34. /package/dist/{chunk-LXD3IV6Z.mjs.map → chunk-RSSJADDD.mjs.map} +0 -0
  35. /package/dist/{chunk-STMXPFAQ.mjs.map → chunk-TSQCNHOX.mjs.map} +0 -0
  36. /package/dist/{chunk-N7RMUOFB.mjs.map → chunk-YZ2HJFPQ.mjs.map} +0 -0
@@ -7943,13 +7943,22 @@ var init_projectStore = __esm({
7943
7943
  });
7944
7944
 
7945
7945
  // src/services/auth/authenticationService.ts
7946
- var TOKEN_KEY2, AuthenticationService, authenticationService;
7946
+ function emitAuthTokenChanged(token) {
7947
+ if (typeof window === "undefined") {
7948
+ return;
7949
+ }
7950
+ window.dispatchEvent(new CustomEvent(AUTH_TOKEN_CHANGED_EVENT, {
7951
+ detail: { token }
7952
+ }));
7953
+ }
7954
+ var TOKEN_KEY2, AUTH_TOKEN_CHANGED_EVENT, AuthenticationService, authenticationService;
7947
7955
  var init_authenticationService = __esm({
7948
7956
  "src/services/auth/authenticationService.ts"() {
7949
7957
  "use strict";
7950
7958
  init_authenticationStore();
7951
7959
  init_debugLogger();
7952
7960
  TOKEN_KEY2 = "authToken";
7961
+ AUTH_TOKEN_CHANGED_EVENT = "bandit:auth-token-changed";
7953
7962
  AuthenticationService = class {
7954
7963
  getToken() {
7955
7964
  const token = localStorage.getItem(TOKEN_KEY2);
@@ -7958,10 +7967,12 @@ var init_authenticationService = __esm({
7958
7967
  setToken(token) {
7959
7968
  localStorage.setItem(TOKEN_KEY2, token);
7960
7969
  useAuthenticationStore.getState().setToken(token);
7970
+ emitAuthTokenChanged(token);
7961
7971
  }
7962
7972
  clearToken() {
7963
7973
  localStorage.removeItem(TOKEN_KEY2);
7964
7974
  useAuthenticationStore.getState().clearToken();
7975
+ emitAuthTokenChanged(null);
7965
7976
  }
7966
7977
  isAuthenticated() {
7967
7978
  const token = useAuthenticationStore.getState().token;
@@ -8118,9 +8129,99 @@ function ensureDeviceId() {
8118
8129
  return (0, import_uuid4.v4)();
8119
8130
  }
8120
8131
  }
8132
+ function getStoredSyncIdentity() {
8133
+ if (typeof window === "undefined") {
8134
+ return null;
8135
+ }
8136
+ try {
8137
+ return window.localStorage.getItem(SYNC_IDENTITY_STORAGE_KEY);
8138
+ } catch (error) {
8139
+ debugLogger.warn("conversationSyncStore: unable to read stored sync identity", { error });
8140
+ return null;
8141
+ }
8142
+ }
8143
+ function setStoredSyncIdentity(identity) {
8144
+ if (typeof window === "undefined") {
8145
+ return;
8146
+ }
8147
+ try {
8148
+ if (identity) {
8149
+ window.localStorage.setItem(SYNC_IDENTITY_STORAGE_KEY, identity);
8150
+ } else {
8151
+ window.localStorage.removeItem(SYNC_IDENTITY_STORAGE_KEY);
8152
+ }
8153
+ } catch (error) {
8154
+ debugLogger.warn("conversationSyncStore: unable to persist sync identity", { error });
8155
+ }
8156
+ }
8121
8157
  function getPackageDefaultAdvancedKnowledgeSync() {
8122
8158
  return usePackageSettingsStore.getState().settings?.advancedKnowledgeSyncDefaultEnabled;
8123
8159
  }
8160
+ function clearAutoSyncTimer() {
8161
+ if (autoSyncTimeout) {
8162
+ clearTimeout(autoSyncTimeout);
8163
+ autoSyncTimeout = null;
8164
+ }
8165
+ }
8166
+ function resolveAuthIdentity(token) {
8167
+ if (!token) {
8168
+ return null;
8169
+ }
8170
+ const claims = authenticationService.parseJwtClaims(token);
8171
+ if (claims?.sub) {
8172
+ return claims.sub;
8173
+ }
8174
+ if (claims?.email) {
8175
+ return `email:${claims.email.toLowerCase()}`;
8176
+ }
8177
+ return `token:${token.slice(0, 32)}`;
8178
+ }
8179
+ function buildQueueResetState() {
8180
+ return {
8181
+ pendingConversationUpserts: /* @__PURE__ */ new Set(),
8182
+ pendingConversationDeletes: /* @__PURE__ */ new Set(),
8183
+ pendingProjectUpserts: /* @__PURE__ */ new Set(),
8184
+ pendingProjectDeletes: /* @__PURE__ */ new Set(),
8185
+ conflicts: null,
8186
+ lastSyncAt: null,
8187
+ cursor: null,
8188
+ lastError: null,
8189
+ totalConversationsOnServer: void 0,
8190
+ totalProjectsOnServer: void 0,
8191
+ hasCompletedInitialUpload: false,
8192
+ warningConversations: [],
8193
+ oversizedConversations: []
8194
+ };
8195
+ }
8196
+ async function clearLocalStoresForIdentitySwitch(fromIdentity, toIdentity) {
8197
+ const conversationCount = useConversationStore.getState().conversations.length;
8198
+ const projectCount = useProjectStore.getState().projects.length;
8199
+ debugLogger.warn("conversationSyncStore: auth identity changed, clearing local conversation/project cache", {
8200
+ fromIdentity,
8201
+ toIdentity,
8202
+ conversationCount,
8203
+ projectCount
8204
+ });
8205
+ suppressTracking = true;
8206
+ try {
8207
+ await useConversationStore.getState().clearAllConversations();
8208
+ await indexedDBService_default.clear(
8209
+ PROJECT_DB_NAME,
8210
+ PROJECT_DB_VERSION,
8211
+ PROJECT_STORE_NAME,
8212
+ PROJECT_STORE_CONFIGS
8213
+ );
8214
+ useProjectStore.setState({ projects: [] });
8215
+ conversationsMeta = snapshotConversationMetaMap(useConversationStore.getState().conversations);
8216
+ projectsMeta = snapshotProjectMetaMap(useProjectStore.getState().projects);
8217
+ } catch (error) {
8218
+ debugLogger.error("conversationSyncStore: failed to clear local stores on auth switch", {
8219
+ error: error instanceof Error ? error.message : String(error)
8220
+ });
8221
+ } finally {
8222
+ suppressTracking = false;
8223
+ }
8224
+ }
8124
8225
  function mapConversationToDTO(conversation) {
8125
8226
  const updatedAtIso = (conversation.updatedAt ?? /* @__PURE__ */ new Date()).toISOString();
8126
8227
  const createdAtIso = conversation.createdAt ? conversation.createdAt.toISOString() : null;
@@ -8514,7 +8615,7 @@ function buildOversizedMessage(notices) {
8514
8615
  const names = notices.map((n) => `"${n.name || "Untitled"}"`).join(", ");
8515
8616
  return `Some conversations (${names}) are too large for Bandit Cloud. Start a new conversation or archive older turns to continue syncing.`;
8516
8617
  }
8517
- var import_zustand11, import_uuid4, DEVICE_STORAGE_KEY, PAYLOAD_VERSION, MAX_CONVERSATION_BYTES, WARN_CONVERSATION_BYTES, suppressTracking, conversationsMeta, projectsMeta, conversationUnsubscribe, projectUnsubscribe, autoSyncTimeout, AUTO_SYNC_DELAY_MS, useConversationSyncStore;
8618
+ var import_zustand11, import_uuid4, DEVICE_STORAGE_KEY, SYNC_IDENTITY_STORAGE_KEY, PAYLOAD_VERSION, MAX_CONVERSATION_BYTES, WARN_CONVERSATION_BYTES, PROJECT_DB_NAME, PROJECT_DB_VERSION, PROJECT_STORE_NAME, PROJECT_STORE_CONFIGS, suppressTracking, conversationsMeta, projectsMeta, conversationUnsubscribe, projectUnsubscribe, autoSyncTimeout, AUTO_SYNC_DELAY_MS, useConversationSyncStore;
8518
8619
  var init_conversationSyncStore = __esm({
8519
8620
  "src/store/conversationSyncStore.ts"() {
8520
8621
  "use strict";
@@ -8524,13 +8625,19 @@ var init_conversationSyncStore = __esm({
8524
8625
  init_projectStore();
8525
8626
  init_packageSettingsStore();
8526
8627
  init_authenticationService();
8628
+ init_indexedDBService();
8527
8629
  init_conversationSyncEvents();
8528
8630
  init_conversationSyncService();
8529
8631
  init_debugLogger();
8530
8632
  DEVICE_STORAGE_KEY = "banditConversationDeviceId";
8633
+ SYNC_IDENTITY_STORAGE_KEY = "banditConversationSyncIdentity";
8531
8634
  PAYLOAD_VERSION = 1;
8532
8635
  MAX_CONVERSATION_BYTES = 12 * 1024 * 1024;
8533
8636
  WARN_CONVERSATION_BYTES = 10 * 1024 * 1024;
8637
+ PROJECT_DB_NAME = "bandit-projects";
8638
+ PROJECT_DB_VERSION = 1;
8639
+ PROJECT_STORE_NAME = "projects";
8640
+ PROJECT_STORE_CONFIGS = [{ name: PROJECT_STORE_NAME, keyPath: "id" }];
8534
8641
  suppressTracking = false;
8535
8642
  conversationsMeta = /* @__PURE__ */ new Map();
8536
8643
  projectsMeta = /* @__PURE__ */ new Map();
@@ -8566,6 +8673,9 @@ var init_conversationSyncStore = __esm({
8566
8673
  }
8567
8674
  useConversationSyncStore = (0, import_zustand11.create)((set, get) => ({
8568
8675
  initialized: false,
8676
+ hasLoadedPreference: false,
8677
+ initializedForToken: null,
8678
+ initializedForIdentity: null,
8569
8679
  syncEnabled: false,
8570
8680
  status: "disabled",
8571
8681
  lastSyncAt: null,
@@ -8585,20 +8695,63 @@ var init_conversationSyncStore = __esm({
8585
8695
  warningConversations: [],
8586
8696
  oversizedConversations: [],
8587
8697
  async initialize() {
8588
- if (get().initialized) {
8589
- return;
8590
- }
8591
8698
  ensureTrackersInitialized();
8592
8699
  const gatewayUrl = usePackageSettingsStore.getState().settings?.gatewayApiUrl;
8700
+ const token = authenticationService.getToken();
8701
+ const tokenIdentity = resolveAuthIdentity(token);
8702
+ const current = get();
8703
+ const storedIdentity = getStoredSyncIdentity();
8704
+ const knownIdentity = current.initializedForIdentity ?? storedIdentity;
8705
+ if (current.initialized && current.hasLoadedPreference && knownIdentity && tokenIdentity && knownIdentity === tokenIdentity) {
8706
+ return;
8707
+ }
8708
+ const hasIdentitySwitch = Boolean(
8709
+ knownIdentity && tokenIdentity && knownIdentity !== tokenIdentity
8710
+ );
8711
+ if (hasIdentitySwitch) {
8712
+ clearAutoSyncTimer();
8713
+ set({
8714
+ ...buildQueueResetState(),
8715
+ syncEnabled: false,
8716
+ status: "disabled",
8717
+ hasLoadedPreference: false,
8718
+ initializedForToken: null,
8719
+ initializedForIdentity: tokenIdentity
8720
+ });
8721
+ await clearLocalStoresForIdentitySwitch(
8722
+ knownIdentity,
8723
+ tokenIdentity
8724
+ );
8725
+ setStoredSyncIdentity(tokenIdentity);
8726
+ }
8593
8727
  if (!gatewayUrl) {
8594
8728
  debugLogger.info("conversationSyncStore: gateway API URL not configured; sync disabled");
8595
- set({ initialized: true, status: "disabled", syncEnabled: false });
8729
+ if (tokenIdentity) {
8730
+ setStoredSyncIdentity(tokenIdentity);
8731
+ }
8732
+ set({
8733
+ ...buildQueueResetState(),
8734
+ initialized: true,
8735
+ hasLoadedPreference: false,
8736
+ initializedForToken: null,
8737
+ initializedForIdentity: tokenIdentity,
8738
+ status: "disabled",
8739
+ syncEnabled: false
8740
+ });
8596
8741
  return;
8597
8742
  }
8598
- const token = authenticationService.getToken();
8599
8743
  if (!token) {
8600
8744
  debugLogger.info("conversationSyncStore: no authentication token; sync disabled until login");
8601
- set({ initialized: true, status: "disabled", syncEnabled: false });
8745
+ clearAutoSyncTimer();
8746
+ set({
8747
+ ...buildQueueResetState(),
8748
+ initialized: true,
8749
+ hasLoadedPreference: false,
8750
+ initializedForToken: null,
8751
+ initializedForIdentity: null,
8752
+ status: "disabled",
8753
+ syncEnabled: false
8754
+ });
8602
8755
  return;
8603
8756
  }
8604
8757
  try {
@@ -8620,14 +8773,27 @@ var init_conversationSyncStore = __esm({
8620
8773
  isAdvancedVectorFeaturesEnabled: get().isAdvancedVectorFeaturesEnabled
8621
8774
  }
8622
8775
  });
8623
- set({ initialized: true });
8776
+ set({
8777
+ initialized: true,
8778
+ hasLoadedPreference: true,
8779
+ initializedForToken: token,
8780
+ initializedForIdentity: tokenIdentity
8781
+ });
8782
+ setStoredSyncIdentity(tokenIdentity);
8624
8783
  if (preference.syncEnabled) {
8625
8784
  await get().runSync({ force: true });
8626
8785
  }
8627
8786
  } catch (error) {
8628
8787
  const message = error instanceof Error ? error.message : "Failed to load conversation sync preference";
8629
8788
  debugLogger.error("conversationSyncStore: initialization failed", { error: message });
8630
- set({ initialized: true, status: "error", lastError: message });
8789
+ set({
8790
+ initialized: true,
8791
+ hasLoadedPreference: false,
8792
+ initializedForToken: null,
8793
+ initializedForIdentity: tokenIdentity,
8794
+ status: "error",
8795
+ lastError: message
8796
+ });
8631
8797
  }
8632
8798
  },
8633
8799
  async setSyncEnabled(enabled) {
@@ -8655,6 +8821,12 @@ var init_conversationSyncStore = __esm({
8655
8821
  isAdvancedVectorFeaturesEnabled
8656
8822
  }
8657
8823
  });
8824
+ set({
8825
+ hasLoadedPreference: true,
8826
+ initializedForToken: authenticationService.getToken(),
8827
+ initializedForIdentity: resolveAuthIdentity(authenticationService.getToken())
8828
+ });
8829
+ setStoredSyncIdentity(resolveAuthIdentity(authenticationService.getToken()));
8658
8830
  if (enabled) {
8659
8831
  set({ hasCompletedInitialUpload: false });
8660
8832
  }
@@ -8692,6 +8864,12 @@ var init_conversationSyncStore = __esm({
8692
8864
  isAdvancedVectorFeaturesEnabled: enabled
8693
8865
  }
8694
8866
  });
8867
+ set({
8868
+ hasLoadedPreference: true,
8869
+ initializedForToken: authenticationService.getToken(),
8870
+ initializedForIdentity: resolveAuthIdentity(authenticationService.getToken())
8871
+ });
8872
+ setStoredSyncIdentity(resolveAuthIdentity(authenticationService.getToken()));
8695
8873
  if (preference.syncEnabled && preference.isAdvancedVectorFeaturesEnabled) {
8696
8874
  await get().runSync({ force: true });
8697
8875
  }
@@ -8737,6 +8915,15 @@ var init_conversationSyncStore = __esm({
8737
8915
  debugLogger.error("conversationSyncStore: runSync error - missing auth token");
8738
8916
  return;
8739
8917
  }
8918
+ const tokenIdentity = resolveAuthIdentity(token);
8919
+ if (state.initializedForIdentity && tokenIdentity && state.initializedForIdentity !== tokenIdentity) {
8920
+ debugLogger.warn("conversationSyncStore: runSync aborted due auth identity mismatch; reinitializing", {
8921
+ initializedForIdentity: state.initializedForIdentity,
8922
+ tokenIdentity
8923
+ });
8924
+ await get().initialize();
8925
+ return;
8926
+ }
8740
8927
  const pendingConversationIds = Array.from(state.pendingConversationUpserts);
8741
8928
  const pendingConversationDeleteIds = Array.from(state.pendingConversationDeletes);
8742
8929
  const pendingProjectIds = Array.from(state.pendingProjectUpserts);
@@ -32157,6 +32344,7 @@ var PersonalitiesTab = ({
32157
32344
  const [deleteDialogOpen, setDeleteDialogOpen] = (0, import_react24.useState)(false);
32158
32345
  const [personalityToDelete, setPersonalityToDelete] = (0, import_react24.useState)(null);
32159
32346
  const [clickedChips, setClickedChips] = (0, import_react24.useState)(/* @__PURE__ */ new Set());
32347
+ const [showTemplateHelp, setShowTemplateHelp] = (0, import_react24.useState)(false);
32160
32348
  const [cropperOpen, setCropperOpen] = (0, import_react24.useState)(false);
32161
32349
  const [selectedImageFile, setSelectedImageFile] = (0, import_react24.useState)(null);
32162
32350
  const promptTemplates = [
@@ -32410,28 +32598,15 @@ var PersonalitiesTab = ({
32410
32598
  }
32411
32599
  }
32412
32600
  ),
32413
- /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(import_material18.Box, { sx: {
32414
- height: "100%",
32415
- overflow: "auto",
32416
- p: { xs: 1.5, sm: 2 },
32417
- // Hide scrollbars while keeping scroll functionality
32418
- scrollbarWidth: "none",
32419
- // Firefox
32420
- "&::-webkit-scrollbar": {
32421
- display: "none"
32422
- // Chrome, Safari, Edge
32423
- },
32424
- "-ms-overflow-style": "none"
32425
- // IE and Edge
32426
- }, children: [
32601
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(import_material18.Box, { sx: { p: { xs: 1, sm: 2 } }, children: [
32427
32602
  /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(import_material18.Box, { sx: {
32428
32603
  display: "flex",
32429
32604
  flexDirection: { xs: "column", md: "row" },
32430
32605
  alignItems: { xs: "flex-start", md: "center" },
32431
32606
  justifyContent: "space-between",
32432
- mb: { xs: 2, md: 3 },
32607
+ mb: { xs: 1.25, md: 3 },
32433
32608
  flexWrap: "wrap",
32434
- gap: { xs: 1.5, md: 2 }
32609
+ gap: { xs: 1, md: 2 }
32435
32610
  }, children: [
32436
32611
  /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(import_material18.Box, { sx: {
32437
32612
  display: "flex",
@@ -32461,8 +32636,8 @@ var PersonalitiesTab = ({
32461
32636
  backgroundClip: "text",
32462
32637
  WebkitBackgroundClip: "text",
32463
32638
  WebkitTextFillColor: "transparent",
32464
- mb: 0.5,
32465
- fontSize: { xs: "1.55rem", sm: "1.75rem" }
32639
+ mb: { xs: 0.25, sm: 0.5 },
32640
+ fontSize: { xs: "1.35rem", sm: "1.75rem" }
32466
32641
  },
32467
32642
  children: "Quick Start Templates"
32468
32643
  }
@@ -32487,12 +32662,40 @@ var PersonalitiesTab = ({
32487
32662
  color: "white",
32488
32663
  fontWeight: 600,
32489
32664
  animation: "pulse 2s infinite",
32490
- alignSelf: { xs: "flex-start", md: "center" }
32665
+ alignSelf: { xs: "flex-start", md: "center" },
32666
+ display: { xs: "none", md: "inline-flex" }
32491
32667
  }
32492
32668
  }
32493
32669
  )
32494
32670
  ] }),
32495
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
32671
+ isMobile ? /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(
32672
+ import_material18.Box,
32673
+ {
32674
+ sx: {
32675
+ mb: 1.75,
32676
+ borderRadius: 2,
32677
+ border: "1px solid rgba(25, 118, 210, 0.2)",
32678
+ background: "linear-gradient(135deg, rgba(25, 118, 210, 0.05) 0%, rgba(66, 165, 245, 0.05) 100%)",
32679
+ px: 1.25,
32680
+ py: 1
32681
+ },
32682
+ children: [
32683
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(import_material18.Box, { sx: { display: "flex", alignItems: "center", justifyContent: "space-between", gap: 1 }, children: [
32684
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_material18.Typography, { variant: "body2", sx: { fontWeight: 600, color: "primary.main", fontSize: "0.82rem" }, children: "Tap any template to pre-fill your form" }),
32685
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
32686
+ import_material18.Button,
32687
+ {
32688
+ size: "small",
32689
+ onClick: () => setShowTemplateHelp((prev) => !prev),
32690
+ sx: { minWidth: "auto", px: 1, fontSize: "0.72rem", whiteSpace: "nowrap" },
32691
+ children: showTemplateHelp ? "Hide" : "Details"
32692
+ }
32693
+ )
32694
+ ] }),
32695
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_material18.Collapse, { in: showTemplateHelp, children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_material18.Typography, { variant: "body2", sx: { color: "text.secondary", fontSize: "0.8rem", lineHeight: 1.4, mt: 0.75 }, children: "Choose a setup you like, then tweak name, tone, and prompt details in the Create/Edit tab." }) })
32696
+ ]
32697
+ }
32698
+ ) : /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
32496
32699
  import_material18.Alert,
32497
32700
  {
32498
32701
  severity: "info",
@@ -32518,17 +32721,19 @@ var PersonalitiesTab = ({
32518
32721
  import_material18.Card,
32519
32722
  {
32520
32723
  sx: {
32521
- mb: { xs: 3, md: 4 },
32724
+ mb: { xs: 2, md: 4 },
32522
32725
  background: "linear-gradient(135deg, #1976d2 0%, #42a5f5 100%)",
32523
32726
  border: "2px solid transparent",
32524
- borderRadius: 3,
32727
+ borderRadius: { xs: 2.25, sm: 3 },
32525
32728
  cursor: "pointer",
32526
32729
  transition: "all 0.3s cubic-bezier(0.4, 0, 0.2, 1)",
32527
32730
  position: "relative",
32528
32731
  overflow: "hidden",
32529
- "&:hover": {
32530
- transform: "translateY(-4px) scale(1.02)",
32531
- boxShadow: "0 12px 40px rgba(25, 118, 210, 0.3)"
32732
+ ...isMobile ? {} : {
32733
+ "&:hover": {
32734
+ transform: "translateY(-4px) scale(1.02)",
32735
+ boxShadow: "0 12px 40px rgba(25, 118, 210, 0.3)"
32736
+ }
32532
32737
  },
32533
32738
  "&::before": {
32534
32739
  content: '""',
@@ -32553,41 +32758,70 @@ var PersonalitiesTab = ({
32553
32758
  setPersonalityTabIndex(1);
32554
32759
  },
32555
32760
  children: /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(import_material18.CardContent, { sx: {
32556
- p: { xs: 3, sm: 4 },
32761
+ p: { xs: 1.75, sm: 4 },
32557
32762
  color: "white",
32558
- textAlign: "center",
32763
+ textAlign: { xs: "left", sm: "center" },
32559
32764
  position: "relative",
32560
- zIndex: 1
32765
+ zIndex: 1,
32766
+ display: "flex",
32767
+ flexDirection: { xs: "row", sm: "column" },
32768
+ alignItems: { xs: "center", sm: "center" },
32769
+ gap: { xs: 1.25, sm: 0 }
32561
32770
  }, children: [
32562
32771
  /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_material18.Box, { sx: {
32563
32772
  display: "flex",
32564
32773
  alignItems: "center",
32565
32774
  justifyContent: "center",
32566
32775
  fontSize: 0,
32567
- mb: { xs: 1.5, sm: 2 }
32568
- }, children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_AutoAwesome.default, { sx: { fontSize: { xs: 36, sm: 44 }, color: "common.white", filter: "drop-shadow(0 4px 12px rgba(0,0,0,0.25))" } }) }),
32569
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
32570
- import_material18.Typography,
32571
- {
32572
- variant: "h5",
32573
- sx: {
32574
- fontWeight: 700,
32575
- mb: { xs: 0.75, sm: 1 },
32576
- textShadow: "0 2px 4px rgba(0,0,0,0.2)"
32577
- },
32578
- children: "Create from Scratch"
32579
- }
32580
- ),
32581
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
32582
- import_material18.Typography,
32776
+ mb: { xs: 0, sm: 2 },
32777
+ flexShrink: 0
32778
+ }, children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_AutoAwesome.default, { sx: { fontSize: { xs: 28, sm: 44 }, color: "common.white", filter: "drop-shadow(0 4px 12px rgba(0,0,0,0.25))" } }) }),
32779
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(import_material18.Box, { sx: { flex: 1, minWidth: 0 }, children: [
32780
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
32781
+ import_material18.Typography,
32782
+ {
32783
+ variant: "h5",
32784
+ sx: {
32785
+ fontWeight: 700,
32786
+ mb: { xs: 0.25, sm: 1 },
32787
+ textShadow: "0 2px 4px rgba(0,0,0,0.2)",
32788
+ fontSize: { xs: "1.1rem", sm: "1.75rem" }
32789
+ },
32790
+ children: "Create from Scratch"
32791
+ }
32792
+ ),
32793
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
32794
+ import_material18.Typography,
32795
+ {
32796
+ variant: "body1",
32797
+ sx: {
32798
+ opacity: 0.9,
32799
+ fontWeight: 500,
32800
+ textShadow: "0 1px 2px rgba(0,0,0,0.2)",
32801
+ fontSize: { xs: "0.8rem", sm: "1rem" },
32802
+ lineHeight: { xs: 1.3, sm: 1.5 },
32803
+ display: "-webkit-box",
32804
+ WebkitLineClamp: { xs: 2, sm: "unset" },
32805
+ WebkitBoxOrient: "vertical",
32806
+ overflow: "hidden"
32807
+ },
32808
+ children: "Start with a blank canvas and build your perfect AI personality"
32809
+ }
32810
+ )
32811
+ ] }),
32812
+ isMobile && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
32813
+ import_material18.Chip,
32583
32814
  {
32584
- variant: "body1",
32815
+ label: "Start",
32816
+ size: "small",
32585
32817
  sx: {
32586
- opacity: 0.9,
32587
- fontWeight: 500,
32588
- textShadow: "0 1px 2px rgba(0,0,0,0.2)"
32589
- },
32590
- children: "Start with a blank canvas and build your perfect AI personality"
32818
+ backgroundColor: "rgba(255,255,255,0.2)",
32819
+ color: "common.white",
32820
+ border: "1px solid rgba(255,255,255,0.45)",
32821
+ fontWeight: 600,
32822
+ height: 28,
32823
+ flexShrink: 0
32824
+ }
32591
32825
  }
32592
32826
  )
32593
32827
  ] })
@@ -32602,7 +32836,7 @@ var PersonalitiesTab = ({
32602
32836
  lg: "repeat(4, 1fr)",
32603
32837
  xl: "repeat(4, 1fr)"
32604
32838
  },
32605
- gap: { xs: 2, sm: 2.5, md: 3 },
32839
+ gap: { xs: 1.25, sm: 2.5, md: 3 },
32606
32840
  alignItems: "stretch"
32607
32841
  }, children: promptTemplates.map((template, index) => /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
32608
32842
  import_material18.Card,
@@ -32615,7 +32849,7 @@ var PersonalitiesTab = ({
32615
32849
  border: "1px solid",
32616
32850
  borderColor: "rgba(255,255,255,0.1)",
32617
32851
  borderRadius: 3,
32618
- minHeight: { xs: "auto", md: "280px" },
32852
+ minHeight: { xs: "200px", md: "280px" },
32619
32853
  display: "flex",
32620
32854
  flexDirection: "column",
32621
32855
  overflow: "hidden",
@@ -32633,19 +32867,21 @@ var PersonalitiesTab = ({
32633
32867
  opacity: 0,
32634
32868
  transition: "opacity 0.3s ease"
32635
32869
  },
32636
- "&:hover": {
32637
- transform: "translateY(-8px) scale(1.02)",
32638
- boxShadow: "0 20px 40px rgba(0,0,0,0.15)",
32639
- borderColor: "primary.main",
32640
- "&::before": {
32641
- opacity: 1
32642
- },
32643
- "& .template-icon": {
32644
- transform: "scale(1.1) rotate(5deg)"
32645
- },
32646
- "& .template-chip": {
32647
- transform: "translateY(-2px)",
32648
- boxShadow: "0 4px 12px rgba(0,0,0,0.2)"
32870
+ ...isMobile ? {} : {
32871
+ "&:hover": {
32872
+ transform: "translateY(-8px) scale(1.02)",
32873
+ boxShadow: "0 20px 40px rgba(0,0,0,0.15)",
32874
+ borderColor: "primary.main",
32875
+ "&::before": {
32876
+ opacity: 1
32877
+ },
32878
+ "& .template-icon": {
32879
+ transform: "scale(1.1) rotate(5deg)"
32880
+ },
32881
+ "& .template-chip": {
32882
+ transform: "translateY(-2px)",
32883
+ boxShadow: "0 4px 12px rgba(0,0,0,0.2)"
32884
+ }
32649
32885
  }
32650
32886
  },
32651
32887
  "&:active": {
@@ -32654,7 +32890,7 @@ var PersonalitiesTab = ({
32654
32890
  },
32655
32891
  onClick: () => handleTemplateSelect(template),
32656
32892
  children: /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(import_material18.CardContent, { sx: {
32657
- p: { xs: 2.5, sm: 3 },
32893
+ p: { xs: 2, sm: 3 },
32658
32894
  display: "flex",
32659
32895
  flexDirection: "column",
32660
32896
  height: "100%",
@@ -32664,7 +32900,7 @@ var PersonalitiesTab = ({
32664
32900
  /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(import_material18.Box, { sx: {
32665
32901
  display: "flex",
32666
32902
  alignItems: "center",
32667
- mb: { xs: 2, md: 2.5 },
32903
+ mb: { xs: 1.25, md: 2.5 },
32668
32904
  minHeight: { xs: "auto", md: "60px" }
32669
32905
  }, children: [
32670
32906
  /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
@@ -32673,9 +32909,9 @@ var PersonalitiesTab = ({
32673
32909
  src: template.avatar,
32674
32910
  alt: template.name,
32675
32911
  sx: {
32676
- width: { xs: 48, sm: 56, md: 60 },
32677
- height: { xs: 48, sm: 56, md: 60 },
32678
- mr: { xs: 1.5, md: 2 },
32912
+ width: { xs: 40, sm: 56, md: 60 },
32913
+ height: { xs: 40, sm: 56, md: 60 },
32914
+ mr: { xs: 1.2, md: 2 },
32679
32915
  transition: "transform 0.3s cubic-bezier(0.4, 0, 0.2, 1)",
32680
32916
  boxShadow: "0 4px 12px rgba(0,0,0,0.15)",
32681
32917
  border: "2px solid rgba(255,255,255,0.8)"
@@ -32729,10 +32965,10 @@ var PersonalitiesTab = ({
32729
32965
  lineHeight: 1.5,
32730
32966
  fontSize: { xs: "0.82rem", sm: "0.85rem", md: "0.875rem" },
32731
32967
  display: "-webkit-box",
32732
- WebkitLineClamp: 4,
32968
+ WebkitLineClamp: { xs: 2, sm: 4 },
32733
32969
  WebkitBoxOrient: "vertical",
32734
32970
  overflow: "hidden",
32735
- mb: { xs: 1.5, md: 2 },
32971
+ mb: { xs: 1.25, md: 2 },
32736
32972
  minHeight: { xs: "auto", md: "84px" }
32737
32973
  },
32738
32974
  children: template.description
@@ -32769,7 +33005,7 @@ var PersonalitiesTab = ({
32769
33005
  },
32770
33006
  index
32771
33007
  )) }),
32772
- /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(
33008
+ !isMobile && /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(
32773
33009
  import_material18.Alert,
32774
33010
  {
32775
33011
  severity: "info",
@@ -32783,20 +33019,7 @@ var PersonalitiesTab = ({
32783
33019
  )
32784
33020
  ] })
32785
33021
  ] });
32786
- const renderCreateEditTab = () => /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(import_material18.Box, { sx: {
32787
- height: "100%",
32788
- overflow: "auto",
32789
- p: { xs: 1.5, sm: 2 },
32790
- // Hide scrollbars while keeping scroll functionality
32791
- scrollbarWidth: "none",
32792
- // Firefox
32793
- "&::-webkit-scrollbar": {
32794
- display: "none"
32795
- // Chrome, Safari, Edge
32796
- },
32797
- "-ms-overflow-style": "none"
32798
- // IE and Edge
32799
- }, children: [
33022
+ const renderCreateEditTab = () => /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(import_material18.Box, { sx: { p: { xs: 1.5, sm: 2 } }, children: [
32800
33023
  /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(import_material18.Box, { sx: { mb: { xs: 2.5, md: 4 } }, children: [
32801
33024
  /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
32802
33025
  import_material18.Typography,
@@ -33266,6 +33489,9 @@ var PersonalitiesTab = ({
33266
33489
  import_material18.Box,
33267
33490
  {
33268
33491
  sx: {
33492
+ position: { xs: "sticky", sm: "static" },
33493
+ bottom: { xs: 10, sm: "auto" },
33494
+ zIndex: { xs: 5, sm: "auto" },
33269
33495
  display: "flex",
33270
33496
  flexDirection: { xs: "column", sm: "row" },
33271
33497
  gap: { xs: 1.5, sm: 2 },
@@ -33273,8 +33499,15 @@ var PersonalitiesTab = ({
33273
33499
  // Changed from flex-end to flex-start
33274
33500
  mr: { xs: 0, sm: 10 },
33275
33501
  // Add right margin to avoid FAB
33276
- mb: { xs: 8, sm: 2 }
33502
+ mb: { xs: 8, sm: 2 },
33277
33503
  // Add bottom margin on mobile for FAB clearance
33504
+ mt: { xs: 1.5, sm: 0 },
33505
+ p: { xs: 1.1, sm: 0 },
33506
+ borderRadius: { xs: 2, sm: 0 },
33507
+ border: { xs: "1px solid", sm: "none" },
33508
+ borderColor: { xs: "divider", sm: "transparent" },
33509
+ bgcolor: { xs: "background.paper", sm: "transparent" },
33510
+ boxShadow: { xs: 3, sm: "none" }
33278
33511
  },
33279
33512
  children: [
33280
33513
  /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
@@ -33302,20 +33535,7 @@ var PersonalitiesTab = ({
33302
33535
  }
33303
33536
  )
33304
33537
  ] });
33305
- const renderManageTab = () => /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(import_material18.Box, { sx: {
33306
- height: "100%",
33307
- overflow: "auto",
33308
- p: { xs: 1.5, sm: 2 },
33309
- // Hide scrollbars while keeping scroll functionality
33310
- scrollbarWidth: "none",
33311
- // Firefox
33312
- "&::-webkit-scrollbar": {
33313
- display: "none"
33314
- // Chrome, Safari, Edge
33315
- },
33316
- "-ms-overflow-style": "none"
33317
- // IE and Edge
33318
- }, children: [
33538
+ const renderManageTab = () => /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(import_material18.Box, { sx: { p: { xs: 1.5, sm: 2 } }, children: [
33319
33539
  /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(
33320
33540
  import_material18.Box,
33321
33541
  {
@@ -33564,7 +33784,7 @@ var PersonalitiesTab = ({
33564
33784
  ] })
33565
33785
  ] })
33566
33786
  ] });
33567
- return /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(import_material18.Box, { sx: { height: "100%", display: "flex", flexDirection: "column" }, children: [
33787
+ return /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(import_material18.Box, { sx: { display: "flex", flexDirection: "column" }, children: [
33568
33788
  /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(
33569
33789
  import_material18.Box,
33570
33790
  {
@@ -33690,7 +33910,7 @@ var PersonalitiesTab = ({
33690
33910
  ]
33691
33911
  }
33692
33912
  ) }),
33693
- /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(import_material18.Box, { sx: { flex: 1, overflow: "hidden" }, children: [
33913
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(import_material18.Box, { sx: { minHeight: 0 }, children: [
33694
33914
  personalityTabIndex === 0 && renderTemplatesTab(),
33695
33915
  personalityTabIndex === 1 && renderCreateEditTab(),
33696
33916
  personalityTabIndex === 2 && renderManageTab()
@@ -37489,6 +37709,7 @@ var import_Add = __toESM(require("@mui/icons-material/Add"));
37489
37709
  var import_Archive = __toESM(require("@mui/icons-material/Archive"));
37490
37710
  var import_Delete6 = __toESM(require("@mui/icons-material/Delete"));
37491
37711
  var import_Description4 = __toESM(require("@mui/icons-material/Description"));
37712
+ var import_FolderOpen = __toESM(require("@mui/icons-material/FolderOpen"));
37492
37713
  var import_Group2 = __toESM(require("@mui/icons-material/Group"));
37493
37714
  var import_Person3 = __toESM(require("@mui/icons-material/Person"));
37494
37715
  var import_Publish = __toESM(require("@mui/icons-material/Publish"));
@@ -37768,6 +37989,22 @@ var archiveSeedPack = async (sid) => {
37768
37989
  throw error;
37769
37990
  }
37770
37991
  };
37992
+ var deleteSeedPack = async (sid) => {
37993
+ const url = buildUrl2(`/seed-packs/${encodeURIComponent(sid)}`);
37994
+ try {
37995
+ const response = await fetch(url, { method: "DELETE", headers: buildHeaders2() });
37996
+ if (response.status === 204) {
37997
+ return;
37998
+ }
37999
+ await handleJsonResponse2(response, "Failed to delete seed pack");
38000
+ } catch (error) {
38001
+ debugLogger.error("seedPackService: failed to delete seed pack", {
38002
+ sid,
38003
+ error: error instanceof Error ? error.message : String(error)
38004
+ });
38005
+ throw error;
38006
+ }
38007
+ };
37771
38008
 
37772
38009
  // src/management/components/SeedPacksTab.tsx
37773
38010
  var import_jsx_runtime24 = require("react/jsx-runtime");
@@ -37803,10 +38040,23 @@ var getPreviewSnippet = (content) => {
37803
38040
  }
37804
38041
  return trimmed.length > 120 ? `${trimmed.slice(0, 120)}...` : trimmed;
37805
38042
  };
38043
+ var getImportedFileKey = (file) => (file.relativePath ?? file.name).toLowerCase();
38044
+ var isMarkdownFileName = (name) => {
38045
+ const lower = name.toLowerCase();
38046
+ return lower.endsWith(".md") || lower.endsWith(".markdown");
38047
+ };
38048
+ var getWebkitRelativePath = (file) => {
38049
+ const relativePath = file.webkitRelativePath;
38050
+ if (!relativePath) {
38051
+ return void 0;
38052
+ }
38053
+ const trimmed = relativePath.trim().replace(/^\/+/, "");
38054
+ return trimmed.length > 0 ? trimmed : void 0;
38055
+ };
37806
38056
  var mergeMarkdownFiles = (existing, incoming) => {
37807
38057
  const next = [...existing];
37808
38058
  incoming.forEach((file) => {
37809
- const index = next.findIndex((item) => item.name === file.name);
38059
+ const index = next.findIndex((item) => getImportedFileKey(item) === getImportedFileKey(file));
37810
38060
  if (index >= 0) {
37811
38061
  next[index] = file;
37812
38062
  } else {
@@ -37818,17 +38068,22 @@ var mergeMarkdownFiles = (existing, incoming) => {
37818
38068
  var buildMarkdownContent = (files) => {
37819
38069
  return files.map((file) => file.content.trim()).filter((content) => content.length > 0).join("\n\n---\n\n");
37820
38070
  };
37821
- var readMarkdownFiles = async (files) => {
38071
+ var readMarkdownFiles = async (files, source = "local") => {
37822
38072
  const list = Array.from(files);
37823
- const markdownFiles = list.filter((file) => file.name.toLowerCase().endsWith(".md"));
38073
+ const markdownFiles = list.filter((file) => isMarkdownFileName(file.name));
37824
38074
  const imported = await Promise.all(
37825
- markdownFiles.map(async (file) => ({
37826
- id: `${file.name}-${file.lastModified}`,
37827
- name: file.name,
37828
- size: file.size,
37829
- content: await file.text(),
37830
- lastModified: file.lastModified
37831
- }))
38075
+ markdownFiles.map(async (file) => {
38076
+ const relativePath = getWebkitRelativePath(file);
38077
+ return {
38078
+ id: `${source}-${relativePath ?? file.name}-${file.lastModified}-${file.size}`,
38079
+ name: file.name,
38080
+ size: file.size,
38081
+ content: await file.text(),
38082
+ lastModified: file.lastModified,
38083
+ relativePath,
38084
+ source
38085
+ };
38086
+ })
37832
38087
  );
37833
38088
  return { imported, skipped: list.length - markdownFiles.length };
37834
38089
  };
@@ -37944,7 +38199,7 @@ var SeedPackFileCard = ({ file, onPreview, onRemove, isReadOnly }) => /* @__PURE
37944
38199
  )
37945
38200
  }
37946
38201
  ),
37947
- /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_material25.Tooltip, { title: file.name, arrow: true, children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
38202
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_material25.Tooltip, { title: file.relativePath ?? file.name, arrow: true, children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
37948
38203
  import_material25.Typography,
37949
38204
  {
37950
38205
  variant: "body2",
@@ -37961,6 +38216,21 @@ var SeedPackFileCard = ({ file, onPreview, onRemove, isReadOnly }) => /* @__PURE
37961
38216
  children: file.name
37962
38217
  }
37963
38218
  ) }),
38219
+ file.relativePath && file.relativePath !== file.name && /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_material25.Tooltip, { title: file.relativePath, arrow: true, children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
38220
+ import_material25.Typography,
38221
+ {
38222
+ variant: "caption",
38223
+ color: "text.secondary",
38224
+ sx: {
38225
+ display: "block",
38226
+ whiteSpace: "nowrap",
38227
+ overflow: "hidden",
38228
+ textOverflow: "ellipsis",
38229
+ mb: 1
38230
+ },
38231
+ children: file.relativePath
38232
+ }
38233
+ ) }),
37964
38234
  /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(
37965
38235
  import_material25.Box,
37966
38236
  {
@@ -37977,7 +38247,7 @@ var SeedPackFileCard = ({ file, onPreview, onRemove, isReadOnly }) => /* @__PURE
37977
38247
  import_material25.Chip,
37978
38248
  {
37979
38249
  icon: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_Person3.default, { sx: { fontSize: "0.9rem !important" } }),
37980
- label: "Local",
38250
+ label: file.source === "azure-wiki" ? "Azure Wiki" : "Local",
37981
38251
  size: "small",
37982
38252
  sx: {
37983
38253
  bgcolor: "#388e3c20",
@@ -38066,16 +38336,20 @@ var SeedPacksTab = () => {
38066
38336
  const [createImportedFiles, setCreateImportedFiles] = (0, import_react33.useState)([]);
38067
38337
  const [previewFile, setPreviewFile] = (0, import_react33.useState)(null);
38068
38338
  const fileInputRef = (0, import_react33.useRef)(null);
38339
+ const wikiFolderInputRef = (0, import_react33.useRef)(null);
38069
38340
  const createFileInputRef = (0, import_react33.useRef)(null);
38341
+ const createWikiFolderInputRef = (0, import_react33.useRef)(null);
38070
38342
  const [isLoadingList, setIsLoadingList] = (0, import_react33.useState)(false);
38071
38343
  const [isLoadingDetail, setIsLoadingDetail] = (0, import_react33.useState)(false);
38072
38344
  const [isSaving, setIsSaving] = (0, import_react33.useState)(false);
38073
38345
  const [isPublishing, setIsPublishing] = (0, import_react33.useState)(false);
38074
38346
  const [isArchiving, setIsArchiving] = (0, import_react33.useState)(false);
38347
+ const [isDeleting, setIsDeleting] = (0, import_react33.useState)(false);
38075
38348
  const [isCreating, setIsCreating] = (0, import_react33.useState)(false);
38076
38349
  const [createDialogOpen, setCreateDialogOpen] = (0, import_react33.useState)(false);
38077
38350
  const [publishDialogOpen, setPublishDialogOpen] = (0, import_react33.useState)(false);
38078
38351
  const [archiveDialogOpen, setArchiveDialogOpen] = (0, import_react33.useState)(false);
38352
+ const [deleteDialogOpen, setDeleteDialogOpen] = (0, import_react33.useState)(false);
38079
38353
  const [newPackName, setNewPackName] = (0, import_react33.useState)("");
38080
38354
  const [newPackDescription, setNewPackDescription] = (0, import_react33.useState)("");
38081
38355
  const [newPackTags, setNewPackTags] = (0, import_react33.useState)("");
@@ -38180,26 +38454,37 @@ var SeedPacksTab = () => {
38180
38454
  void loadSeedPackDetail(selectedSid);
38181
38455
  }
38182
38456
  }, [selectedSid, loadSeedPackDetail]);
38457
+ (0, import_react33.useEffect)(() => {
38458
+ const setDirectoryUploadAttributes = (input) => {
38459
+ if (!input) {
38460
+ return;
38461
+ }
38462
+ input.setAttribute("webkitdirectory", "");
38463
+ input.setAttribute("directory", "");
38464
+ };
38465
+ setDirectoryUploadAttributes(wikiFolderInputRef.current);
38466
+ setDirectoryUploadAttributes(createWikiFolderInputRef.current);
38467
+ }, [selectedSeedPack, createDialogOpen]);
38183
38468
  const handleSelectPack = (pack) => {
38184
38469
  setSelectedSid(pack.sid);
38185
38470
  setSelectedSeedPack(pack);
38186
38471
  hydrateDraft(pack);
38187
38472
  };
38188
38473
  const handleImportFiles = (0, import_react33.useCallback)(
38189
- async (files) => {
38474
+ async (files, source = "local") => {
38190
38475
  if (!files || files.length === 0) {
38191
38476
  return;
38192
38477
  }
38193
- const { imported, skipped } = await readMarkdownFiles(files);
38478
+ const { imported, skipped } = await readMarkdownFiles(files, source);
38194
38479
  if (skipped > 0) {
38195
- showSnackbar("Only .md files are supported for seed packs.", "error");
38480
+ showSnackbar("Only .md and .markdown files are supported for seed packs.", "error");
38196
38481
  }
38197
38482
  if (imported.length === 0) {
38198
38483
  return;
38199
38484
  }
38200
38485
  try {
38201
38486
  const newlyAdded = imported.filter(
38202
- (file) => !importedFiles.some((existing) => existing.name === file.name)
38487
+ (file) => !importedFiles.some((existing) => getImportedFileKey(existing) === getImportedFileKey(file))
38203
38488
  );
38204
38489
  setImportedFiles((prev) => mergeMarkdownFiles(prev, imported));
38205
38490
  const combined = buildMarkdownContent(newlyAdded);
@@ -38214,8 +38499,9 @@ ${combined}` : combined;
38214
38499
  return { ...prev, content: nextContent };
38215
38500
  });
38216
38501
  }
38502
+ const importLabel = source === "azure-wiki" ? "from Azure DevOps wiki folder into the editor" : "into the editor";
38217
38503
  showSnackbar(
38218
- `Imported ${imported.length} markdown file${imported.length === 1 ? "" : "s"} into the editor.`,
38504
+ `Imported ${imported.length} markdown file${imported.length === 1 ? "" : "s"} ${importLabel}.`,
38219
38505
  "success"
38220
38506
  );
38221
38507
  } catch (error) {
@@ -38229,7 +38515,14 @@ ${combined}` : combined;
38229
38515
  );
38230
38516
  const handleFileInputChange = (0, import_react33.useCallback)(
38231
38517
  async (event) => {
38232
- await handleImportFiles(event.target.files);
38518
+ await handleImportFiles(event.target.files, "local");
38519
+ event.target.value = "";
38520
+ },
38521
+ [handleImportFiles]
38522
+ );
38523
+ const handleWikiFolderInputChange = (0, import_react33.useCallback)(
38524
+ async (event) => {
38525
+ await handleImportFiles(event.target.files, "azure-wiki");
38233
38526
  event.target.value = "";
38234
38527
  },
38235
38528
  [handleImportFiles]
@@ -38238,20 +38531,21 @@ ${combined}` : combined;
38238
38531
  setImportedFiles((prev) => prev.filter((file) => file.id !== id));
38239
38532
  }, []);
38240
38533
  const handleCreateImportFiles = (0, import_react33.useCallback)(
38241
- async (files) => {
38534
+ async (files, source = "local") => {
38242
38535
  if (!files || files.length === 0) {
38243
38536
  return;
38244
38537
  }
38245
- const { imported, skipped } = await readMarkdownFiles(files);
38538
+ const { imported, skipped } = await readMarkdownFiles(files, source);
38246
38539
  if (skipped > 0) {
38247
- showSnackbar("Only .md files are supported for seed packs.", "error");
38540
+ showSnackbar("Only .md and .markdown files are supported for seed packs.", "error");
38248
38541
  }
38249
38542
  if (imported.length === 0) {
38250
38543
  return;
38251
38544
  }
38252
38545
  setCreateImportedFiles((prev) => mergeMarkdownFiles(prev, imported));
38546
+ const importLabel = source === "azure-wiki" ? "from Azure DevOps wiki folder for this seed pack" : "for this seed pack";
38253
38547
  showSnackbar(
38254
- `Imported ${imported.length} markdown file${imported.length === 1 ? "" : "s"} for this seed pack.`,
38548
+ `Imported ${imported.length} markdown file${imported.length === 1 ? "" : "s"} ${importLabel}.`,
38255
38549
  "success"
38256
38550
  );
38257
38551
  },
@@ -38259,7 +38553,14 @@ ${combined}` : combined;
38259
38553
  );
38260
38554
  const handleCreateFileInputChange = (0, import_react33.useCallback)(
38261
38555
  async (event) => {
38262
- await handleCreateImportFiles(event.target.files);
38556
+ await handleCreateImportFiles(event.target.files, "local");
38557
+ event.target.value = "";
38558
+ },
38559
+ [handleCreateImportFiles]
38560
+ );
38561
+ const handleCreateWikiFolderInputChange = (0, import_react33.useCallback)(
38562
+ async (event) => {
38563
+ await handleCreateImportFiles(event.target.files, "azure-wiki");
38263
38564
  event.target.value = "";
38264
38565
  },
38265
38566
  [handleCreateImportFiles]
@@ -38404,6 +38705,34 @@ ${combined}` : combined;
38404
38705
  setIsArchiving(false);
38405
38706
  }
38406
38707
  };
38708
+ const handleDelete = async () => {
38709
+ if (!selectedSeedPack) {
38710
+ return;
38711
+ }
38712
+ const deletingSid = selectedSeedPack.sid;
38713
+ const deletingName = selectedSeedPack.name;
38714
+ setDeleteDialogOpen(false);
38715
+ setIsDeleting(true);
38716
+ try {
38717
+ await deleteSeedPack(deletingSid);
38718
+ setSelectedSid(null);
38719
+ setSelectedSeedPack(null);
38720
+ setDraft({ name: "", description: "", content: "" });
38721
+ setTagsInput("");
38722
+ setImportedFiles([]);
38723
+ setPreviewFile(null);
38724
+ await refreshSeedPacks();
38725
+ showSnackbar(`Deleted seed pack "${deletingName}".`, "success");
38726
+ } catch (error) {
38727
+ showSnackbar("Failed to delete seed pack.", "error");
38728
+ debugLogger.error("SeedPacksTab: failed to delete seed pack", {
38729
+ sid: deletingSid,
38730
+ error: error instanceof Error ? error.message : String(error)
38731
+ });
38732
+ } finally {
38733
+ setIsDeleting(false);
38734
+ }
38735
+ };
38407
38736
  const previewContent = draft.content.trim().length > 0 ? draft.content : "Preview will appear here as you type.";
38408
38737
  const selectedStatus = selectedSeedPack?.status ?? "draft";
38409
38738
  const statusChip = getStatusChip(selectedStatus);
@@ -38605,32 +38934,56 @@ ${combined}` : combined;
38605
38934
  sx: { mb: 1 },
38606
38935
  children: [
38607
38936
  /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_material25.Typography, { variant: "subtitle2", children: "Markdown content" }),
38937
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(import_material25.Stack, { direction: { xs: "column", sm: "row" }, spacing: 1, children: [
38938
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
38939
+ import_material25.Button,
38940
+ {
38941
+ size: "small",
38942
+ variant: "outlined",
38943
+ startIcon: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_UploadFile2.default, {}),
38944
+ onClick: () => fileInputRef.current?.click(),
38945
+ disabled: isReadOnly,
38946
+ children: "Import .md"
38947
+ }
38948
+ ),
38949
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
38950
+ import_material25.Button,
38951
+ {
38952
+ size: "small",
38953
+ variant: "outlined",
38954
+ startIcon: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_FolderOpen.default, {}),
38955
+ onClick: () => wikiFolderInputRef.current?.click(),
38956
+ disabled: isReadOnly,
38957
+ children: "Import wiki folder"
38958
+ }
38959
+ )
38960
+ ] }),
38608
38961
  /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
38609
- import_material25.Button,
38962
+ "input",
38610
38963
  {
38611
- size: "small",
38612
- variant: "outlined",
38613
- startIcon: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_UploadFile2.default, {}),
38614
- onClick: () => fileInputRef.current?.click(),
38615
- disabled: isReadOnly,
38616
- children: "Import .md"
38964
+ ref: fileInputRef,
38965
+ type: "file",
38966
+ accept: ".md,.markdown,text/markdown",
38967
+ multiple: true,
38968
+ onChange: handleFileInputChange,
38969
+ style: { display: "none" }
38617
38970
  }
38618
38971
  ),
38619
38972
  /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
38620
38973
  "input",
38621
38974
  {
38622
- ref: fileInputRef,
38975
+ ref: wikiFolderInputRef,
38623
38976
  type: "file",
38624
- accept: ".md",
38977
+ accept: ".md,.markdown,text/markdown",
38625
38978
  multiple: true,
38626
- onChange: handleFileInputChange,
38979
+ onChange: handleWikiFolderInputChange,
38627
38980
  style: { display: "none" }
38628
38981
  }
38629
38982
  )
38630
38983
  ]
38631
38984
  }
38632
38985
  ),
38633
- /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_material25.Typography, { variant: "caption", color: "text.secondary", sx: { mb: 1, display: "block" }, children: "Paste or import markdown files. Imports copy content into the editor." }),
38986
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_material25.Typography, { variant: "caption", color: "text.secondary", sx: { mb: 1, display: "block" }, children: "Paste or import markdown files. Use folder import for Azure DevOps wiki clones." }),
38634
38987
  /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
38635
38988
  import_material25.TextField,
38636
38989
  {
@@ -38729,6 +39082,17 @@ ${combined}` : combined;
38729
39082
  disabled: isReadOnly || isArchiving,
38730
39083
  children: isArchiving ? "Archiving..." : "Archive"
38731
39084
  }
39085
+ ),
39086
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
39087
+ import_material25.Button,
39088
+ {
39089
+ variant: "text",
39090
+ color: "error",
39091
+ startIcon: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_Delete6.default, {}),
39092
+ onClick: () => setDeleteDialogOpen(true),
39093
+ disabled: isDeleting,
39094
+ children: isDeleting ? "Deleting..." : "Delete"
39095
+ }
38732
39096
  )
38733
39097
  ] })
38734
39098
  ] })
@@ -38778,26 +39142,50 @@ ${combined}` : combined;
38778
39142
  ),
38779
39143
  /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_material25.Divider, {}),
38780
39144
  /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(import_material25.Stack, { direction: { xs: "column", sm: "row" }, spacing: 1, alignItems: "center", children: [
39145
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(import_material25.Stack, { direction: { xs: "column", sm: "row" }, spacing: 1, children: [
39146
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
39147
+ import_material25.Button,
39148
+ {
39149
+ size: "small",
39150
+ variant: "outlined",
39151
+ startIcon: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_UploadFile2.default, {}),
39152
+ onClick: () => createFileInputRef.current?.click(),
39153
+ disabled: !canManage,
39154
+ children: "Import .md files"
39155
+ }
39156
+ ),
39157
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
39158
+ import_material25.Button,
39159
+ {
39160
+ size: "small",
39161
+ variant: "outlined",
39162
+ startIcon: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_FolderOpen.default, {}),
39163
+ onClick: () => createWikiFolderInputRef.current?.click(),
39164
+ disabled: !canManage,
39165
+ children: "Import wiki folder"
39166
+ }
39167
+ )
39168
+ ] }),
39169
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_material25.Typography, { variant: "caption", color: "text.secondary", children: "Optional. Local files or cloned Azure DevOps wiki folders are merged into draft content." }),
38781
39170
  /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
38782
- import_material25.Button,
39171
+ "input",
38783
39172
  {
38784
- size: "small",
38785
- variant: "outlined",
38786
- startIcon: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_UploadFile2.default, {}),
38787
- onClick: () => createFileInputRef.current?.click(),
38788
- disabled: !canManage,
38789
- children: "Import .md files"
39173
+ ref: createFileInputRef,
39174
+ type: "file",
39175
+ accept: ".md,.markdown,text/markdown",
39176
+ multiple: true,
39177
+ onChange: handleCreateFileInputChange,
39178
+ style: { display: "none" }
38790
39179
  }
38791
39180
  ),
38792
- /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_material25.Typography, { variant: "caption", color: "text.secondary", children: "Optional. Files are merged into the draft content." }),
38793
39181
  /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
38794
39182
  "input",
38795
39183
  {
38796
- ref: createFileInputRef,
39184
+ ref: createWikiFolderInputRef,
38797
39185
  type: "file",
38798
- accept: ".md",
39186
+ accept: ".md,.markdown,text/markdown",
38799
39187
  multiple: true,
38800
- onChange: handleCreateFileInputChange,
39188
+ onChange: handleCreateWikiFolderInputChange,
38801
39189
  style: { display: "none" }
38802
39190
  }
38803
39191
  )
@@ -38862,6 +39250,21 @@ ${combined}` : combined;
38862
39250
  /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_material25.Button, { variant: "contained", color: "error", onClick: handleArchive, disabled: isArchiving, children: isArchiving ? "Archiving..." : "Archive" })
38863
39251
  ] })
38864
39252
  ] }),
39253
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(import_material25.Dialog, { open: deleteDialogOpen, onClose: () => setDeleteDialogOpen(false), maxWidth: "sm", fullWidth: true, children: [
39254
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_material25.DialogTitle, { children: "Delete seed pack" }),
39255
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(import_material25.DialogContent, { children: [
39256
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(import_material25.DialogContentText, { children: [
39257
+ 'Delete "',
39258
+ selectedSeedPack?.name ?? "this seed pack",
39259
+ '" permanently from this scope. Published versions and draft content will no longer be available.'
39260
+ ] }),
39261
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_material25.Alert, { severity: "warning", sx: { mt: 2 }, children: "This action cannot be undone." })
39262
+ ] }),
39263
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(import_material25.DialogActions, { children: [
39264
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_material25.Button, { onClick: () => setDeleteDialogOpen(false), children: "Cancel" }),
39265
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_material25.Button, { variant: "contained", color: "error", onClick: handleDelete, disabled: isDeleting, children: isDeleting ? "Deleting..." : "Delete" })
39266
+ ] })
39267
+ ] }),
38865
39268
  /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(
38866
39269
  import_material25.Dialog,
38867
39270
  {
@@ -39620,15 +40023,7 @@ var StorageTab = ({ currentTheme }) => {
39620
40023
  ] }) })
39621
40024
  ] }),
39622
40025
  /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(import_material27.Typography, { variant: "h6", gutterBottom: true, sx: { mb: 2, fontWeight: 600, color: "text.primary" }, children: "Storage Categories" }),
39623
- /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(import_material27.Box, { sx: {
39624
- maxHeight: "60vh",
39625
- overflow: "auto",
39626
- "&::-webkit-scrollbar": {
39627
- display: "none"
39628
- },
39629
- msOverflowStyle: "none",
39630
- scrollbarWidth: "none"
39631
- }, children: storageCategories.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(import_material27.Alert, { severity: "info", sx: { mt: 2 }, children: [
40026
+ /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(import_material27.Box, { children: storageCategories.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(import_material27.Alert, { severity: "info", sx: { mt: 2 }, children: [
39632
40027
  /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(import_material27.Typography, { variant: "body2", children: "No storage data found. This could mean:" }),
39633
40028
  /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(import_material27.Typography, { variant: "body2", component: "ul", sx: { mt: 1, pl: 2 }, children: [
39634
40029
  /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("li", { children: "All databases are empty" }),
@@ -41147,7 +41542,7 @@ var Management = () => {
41147
41542
  const [modalOpen, setModalOpen] = (0, import_react56.useState)(false);
41148
41543
  const banditHead6 = "https://cdn.burtson.ai/images/bandit-head.png";
41149
41544
  const [fabLogo, setFabLogo] = (0, import_react56.useState)(banditHead6);
41150
- const [tabIndex, setTabIndex] = (0, import_react56.useState)(0);
41545
+ const [tabIndex, setTabIndex] = (0, import_react56.useState)(4);
41151
41546
  const [logoFile, setLogoFile] = (0, import_react56.useState)(null);
41152
41547
  const [logoBase64, setLogoBase64] = (0, import_react56.useState)(null);
41153
41548
  const [brandingText, setBrandingText] = (0, import_react56.useState)("");
@@ -41860,7 +42255,6 @@ var Management = () => {
41860
42255
  }
41861
42256
  });
41862
42257
  }, [theme]);
41863
- if (!brandingLoaded) return null;
41864
42258
  const allNavTabs = [
41865
42259
  {
41866
42260
  label: "Personalities",
@@ -41917,6 +42311,18 @@ var Management = () => {
41917
42311
  }
41918
42312
  return true;
41919
42313
  });
42314
+ const preferredDefaultTabIndex = navTabs.findIndex((tab) => tab.label === "Preferences");
42315
+ const defaultTabIndex = preferredDefaultTabIndex >= 0 ? preferredDefaultTabIndex : 0;
42316
+ (0, import_react56.useEffect)(() => {
42317
+ setTabIndex((current) => {
42318
+ if (current < 0 || current >= navTabs.length) {
42319
+ return defaultTabIndex;
42320
+ }
42321
+ return current;
42322
+ });
42323
+ }, [navTabs.length, defaultTabIndex]);
42324
+ const mobileQuickTabs = navTabs.slice(0, 5);
42325
+ const hasMobileOverflowTabs = navTabs.length > mobileQuickTabs.length;
41920
42326
  const navigationContent = /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)(
41921
42327
  import_material47.Box,
41922
42328
  {
@@ -42073,6 +42479,7 @@ var Management = () => {
42073
42479
  ]
42074
42480
  }
42075
42481
  );
42482
+ if (!brandingLoaded) return null;
42076
42483
  return /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)(import_material47.ThemeProvider, { theme: currentTheme, children: [
42077
42484
  /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(import_material47.CssBaseline, {}),
42078
42485
  /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)(
@@ -42093,7 +42500,7 @@ var Management = () => {
42093
42500
  {
42094
42501
  sx: {
42095
42502
  width: "100%",
42096
- height: 64,
42503
+ minHeight: 64,
42097
42504
  display: "flex",
42098
42505
  alignItems: "center",
42099
42506
  justifyContent: "space-between",
@@ -42176,6 +42583,73 @@ var Management = () => {
42176
42583
  ]
42177
42584
  }
42178
42585
  ),
42586
+ isMobile && /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)(
42587
+ import_material47.Box,
42588
+ {
42589
+ sx: {
42590
+ width: "100%",
42591
+ display: "flex",
42592
+ gap: 1,
42593
+ px: 1.5,
42594
+ py: 1,
42595
+ overflowX: "auto",
42596
+ borderBottom: (theme2) => `1px solid ${theme2.palette.divider}`,
42597
+ bgcolor: (theme2) => theme2.palette.mode === "dark" ? "rgba(24,28,40,0.95)" : "rgba(255,255,255,0.95)",
42598
+ backdropFilter: "blur(12px)"
42599
+ },
42600
+ children: [
42601
+ mobileQuickTabs.map((tab) => {
42602
+ const quickTabIndex = navTabs.findIndex((navTab) => navTab.label === tab.label);
42603
+ const selected = tabIndex === quickTabIndex;
42604
+ return /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
42605
+ import_material47.Button,
42606
+ {
42607
+ size: "small",
42608
+ onClick: () => setTabIndex(quickTabIndex),
42609
+ sx: {
42610
+ flexShrink: 0,
42611
+ textTransform: "none",
42612
+ borderRadius: 999,
42613
+ px: 1.5,
42614
+ py: 0.6,
42615
+ minHeight: 32,
42616
+ fontSize: "0.78rem",
42617
+ fontWeight: selected ? 700 : 600,
42618
+ bgcolor: selected ? (theme2) => theme2.palette.mode === "dark" ? "rgba(25,118,210,0.2)" : "rgba(25,118,210,0.12)" : "transparent",
42619
+ color: selected ? "primary.main" : "text.secondary",
42620
+ border: (theme2) => selected ? `1px solid ${theme2.palette.primary.main}66` : `1px solid ${(0, import_styles31.alpha)(theme2.palette.divider, 0.45)}`,
42621
+ "&:hover": {
42622
+ bgcolor: (theme2) => theme2.palette.mode === "dark" ? "rgba(25,118,210,0.16)" : "rgba(25,118,210,0.1)"
42623
+ }
42624
+ },
42625
+ children: tab.label
42626
+ },
42627
+ tab.label
42628
+ );
42629
+ }),
42630
+ hasMobileOverflowTabs && /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
42631
+ import_material47.Button,
42632
+ {
42633
+ size: "small",
42634
+ onClick: () => setSidebarOpen(true),
42635
+ sx: {
42636
+ flexShrink: 0,
42637
+ textTransform: "none",
42638
+ borderRadius: 999,
42639
+ px: 1.5,
42640
+ py: 0.6,
42641
+ minHeight: 32,
42642
+ fontSize: "0.78rem",
42643
+ fontWeight: 600,
42644
+ color: "text.secondary",
42645
+ border: (theme2) => `1px dashed ${(0, import_styles31.alpha)(theme2.palette.divider, 0.6)}`
42646
+ },
42647
+ children: "More"
42648
+ }
42649
+ )
42650
+ ]
42651
+ }
42652
+ ),
42179
42653
  isMobile ? /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
42180
42654
  import_material47.SwipeableDrawer,
42181
42655
  {
@@ -42228,26 +42702,17 @@ var Management = () => {
42228
42702
  flex: 1,
42229
42703
  p: { xs: 1, sm: 3, md: 4 },
42230
42704
  overflowY: "auto",
42231
- height: isMobile ? "auto" : "100vh",
42705
+ overflowX: "hidden",
42232
42706
  maxWidth: "100vw",
42233
42707
  minWidth: 0,
42708
+ minHeight: 0,
42234
42709
  display: "flex",
42235
42710
  flexDirection: "column",
42236
42711
  bgcolor: "background.default",
42237
42712
  ml: isMobile ? 0 : "280px",
42238
42713
  // Fixed left margin only on desktop
42239
42714
  mt: 0,
42240
- transition: "margin-left 0.2s",
42241
- overflow: "auto",
42242
- // Hide scrollbars while keeping scroll functionality
42243
- scrollbarWidth: "none",
42244
- // Firefox
42245
- "&::-webkit-scrollbar": {
42246
- display: "none"
42247
- // Chrome, Safari, Edge
42248
- },
42249
- "-ms-overflow-style": "none"
42250
- // IE and Edge
42715
+ transition: "margin-left 0.2s"
42251
42716
  },
42252
42717
  children: [
42253
42718
  navTabs[tabIndex]?.label === "Personalities" && /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(