flujo-ai 3.30.0 → 3.31.0

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 (152) hide show
  1. package/.next/BUILD_ID +1 -1
  2. package/.next/app-build-manifest.json +153 -153
  3. package/.next/app-path-routes-manifest.json +20 -20
  4. package/.next/build-manifest.json +2 -2
  5. package/.next/prerender-manifest.json +24 -24
  6. package/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  7. package/.next/server/app/_not-found.html +1 -1
  8. package/.next/server/app/_not-found.rsc +1 -1
  9. package/.next/server/app/api/approvals/[id]/route_client-reference-manifest.js +1 -1
  10. package/.next/server/app/api/approvals/route_client-reference-manifest.js +1 -1
  11. package/.next/server/app/api/backup/route_client-reference-manifest.js +1 -1
  12. package/.next/server/app/api/browse/route_client-reference-manifest.js +1 -1
  13. package/.next/server/app/api/bugs/enhance/route_client-reference-manifest.js +1 -1
  14. package/.next/server/app/api/cwd/route_client-reference-manifest.js +1 -1
  15. package/.next/server/app/api/encryption/secure/route_client-reference-manifest.js +1 -1
  16. package/.next/server/app/api/env/route_client-reference-manifest.js +1 -1
  17. package/.next/server/app/api/flow/[id]/route_client-reference-manifest.js +1 -1
  18. package/.next/server/app/api/flow/[id]/versions/[versionId]/route_client-reference-manifest.js +1 -1
  19. package/.next/server/app/api/flow/[id]/versions/route_client-reference-manifest.js +1 -1
  20. package/.next/server/app/api/flow/compile/route_client-reference-manifest.js +1 -1
  21. package/.next/server/app/api/flow/generate/route_client-reference-manifest.js +1 -1
  22. package/.next/server/app/api/flow/improve/route_client-reference-manifest.js +1 -1
  23. package/.next/server/app/api/flow/prompt-renderer/route_client-reference-manifest.js +1 -1
  24. package/.next/server/app/api/flow/quick-chat/route_client-reference-manifest.js +1 -1
  25. package/.next/server/app/api/flow/repair/route_client-reference-manifest.js +1 -1
  26. package/.next/server/app/api/flow/route_client-reference-manifest.js +1 -1
  27. package/.next/server/app/api/git/route_client-reference-manifest.js +1 -1
  28. package/.next/server/app/api/init/route_client-reference-manifest.js +1 -1
  29. package/.next/server/app/api/local-models/capability/route_client-reference-manifest.js +1 -1
  30. package/.next/server/app/api/local-models/pull/route_client-reference-manifest.js +1 -1
  31. package/.next/server/app/api/local-models/suggest/route_client-reference-manifest.js +1 -1
  32. package/.next/server/app/api/mcp/app-sandbox/route_client-reference-manifest.js +1 -1
  33. package/.next/server/app/api/mcp/cancel/route_client-reference-manifest.js +1 -1
  34. package/.next/server/app/api/mcp/oauth-capability/route_client-reference-manifest.js +1 -1
  35. package/.next/server/app/api/mcp/servers/[name]/prompts/get/route_client-reference-manifest.js +1 -1
  36. package/.next/server/app/api/mcp/servers/[name]/prompts/route_client-reference-manifest.js +1 -1
  37. package/.next/server/app/api/mcp/servers/[name]/resources/read/route_client-reference-manifest.js +1 -1
  38. package/.next/server/app/api/mcp/servers/[name]/resources/route_client-reference-manifest.js +1 -1
  39. package/.next/server/app/api/mcp/servers/[name]/route_client-reference-manifest.js +1 -1
  40. package/.next/server/app/api/mcp/servers/[name]/status/route_client-reference-manifest.js +1 -1
  41. package/.next/server/app/api/mcp/servers/[name]/tools/[toolName]/route_client-reference-manifest.js +1 -1
  42. package/.next/server/app/api/mcp/servers/[name]/tools/route_client-reference-manifest.js +1 -1
  43. package/.next/server/app/api/mcp/servers/route_client-reference-manifest.js +1 -1
  44. package/.next/server/app/api/mcp/test-connection/route_client-reference-manifest.js +1 -1
  45. package/.next/server/app/api/mcp/test-connection/stream/route_client-reference-manifest.js +1 -1
  46. package/.next/server/app/api/mcp-registry/route_client-reference-manifest.js +1 -1
  47. package/.next/server/app/api/mcp-registry/spotlight/route_client-reference-manifest.js +1 -1
  48. package/.next/server/app/api/model/[id]/route_client-reference-manifest.js +1 -1
  49. package/.next/server/app/api/model/provider/route_client-reference-manifest.js +1 -1
  50. package/.next/server/app/api/model/route_client-reference-manifest.js +1 -1
  51. package/.next/server/app/api/model/test/route_client-reference-manifest.js +1 -1
  52. package/.next/server/app/api/oauth/callback/route_client-reference-manifest.js +1 -1
  53. package/.next/server/app/api/oauth/initiate/route_client-reference-manifest.js +1 -1
  54. package/.next/server/app/api/oauth/reset/route_client-reference-manifest.js +1 -1
  55. package/.next/server/app/api/packages/build/route_client-reference-manifest.js +1 -1
  56. package/.next/server/app/api/packages/derive-secrets/route_client-reference-manifest.js +1 -1
  57. package/.next/server/app/api/packages/install/route_client-reference-manifest.js +1 -1
  58. package/.next/server/app/api/packages/install/status/route_client-reference-manifest.js +1 -1
  59. package/.next/server/app/api/packages/installed/route_client-reference-manifest.js +1 -1
  60. package/.next/server/app/api/packages/resolve/route_client-reference-manifest.js +1 -1
  61. package/.next/server/app/api/packages/scan-targets/route_client-reference-manifest.js +1 -1
  62. package/.next/server/app/api/packages/search/route_client-reference-manifest.js +1 -1
  63. package/.next/server/app/api/packages/uninstall/route_client-reference-manifest.js +1 -1
  64. package/.next/server/app/api/planned-executions/[id]/route_client-reference-manifest.js +1 -1
  65. package/.next/server/app/api/planned-executions/[id]/run/route_client-reference-manifest.js +1 -1
  66. package/.next/server/app/api/planned-executions/[id]/runs/route_client-reference-manifest.js +1 -1
  67. package/.next/server/app/api/planned-executions/preview-schedule/route_client-reference-manifest.js +1 -1
  68. package/.next/server/app/api/planned-executions/reconcile/route_client-reference-manifest.js +1 -1
  69. package/.next/server/app/api/planned-executions/route_client-reference-manifest.js +1 -1
  70. package/.next/server/app/api/registry/auth/resend/route_client-reference-manifest.js +1 -1
  71. package/.next/server/app/api/registry/auth/reset/route_client-reference-manifest.js +1 -1
  72. package/.next/server/app/api/registry/auth/route_client-reference-manifest.js +1 -1
  73. package/.next/server/app/api/registry/oauth/callback/route_client-reference-manifest.js +1 -1
  74. package/.next/server/app/api/registry/oauth/initiate/route_client-reference-manifest.js +1 -1
  75. package/.next/server/app/api/registry/publish/route_client-reference-manifest.js +1 -1
  76. package/.next/server/app/api/registry/settings/route_client-reference-manifest.js +1 -1
  77. package/.next/server/app/api/restore/route_client-reference-manifest.js +1 -1
  78. package/.next/server/app/api/runs/active/route_client-reference-manifest.js +1 -1
  79. package/.next/server/app/api/storage/route_client-reference-manifest.js +1 -1
  80. package/.next/server/app/api/update/route_client-reference-manifest.js +1 -1
  81. package/.next/server/app/api/waves/route_client-reference-manifest.js +1 -1
  82. package/.next/server/app/api/webhooks/[id]/route_client-reference-manifest.js +1 -1
  83. package/.next/server/app/chat/page_client-reference-manifest.js +1 -1
  84. package/.next/server/app/chat.html +1 -1
  85. package/.next/server/app/chat.rsc +1 -1
  86. package/.next/server/app/docs/page_client-reference-manifest.js +1 -1
  87. package/.next/server/app/docs.html +1 -1
  88. package/.next/server/app/docs.rsc +1 -1
  89. package/.next/server/app/executions/page_client-reference-manifest.js +1 -1
  90. package/.next/server/app/executions.html +1 -1
  91. package/.next/server/app/executions.rsc +1 -1
  92. package/.next/server/app/flows/page_client-reference-manifest.js +1 -1
  93. package/.next/server/app/flows.html +1 -1
  94. package/.next/server/app/flows.rsc +1 -1
  95. package/.next/server/app/index.html +1 -1
  96. package/.next/server/app/index.rsc +1 -1
  97. package/.next/server/app/mcp/page_client-reference-manifest.js +1 -1
  98. package/.next/server/app/mcp-flows/route.js +1 -1
  99. package/.next/server/app/mcp-flows/route_client-reference-manifest.js +1 -1
  100. package/.next/server/app/mcp-proxy/[server]/route.js +1 -1
  101. package/.next/server/app/mcp-proxy/[server]/route_client-reference-manifest.js +1 -1
  102. package/.next/server/app/mcp.html +1 -1
  103. package/.next/server/app/mcp.rsc +1 -1
  104. package/.next/server/app/models/page_client-reference-manifest.js +1 -1
  105. package/.next/server/app/packages/page_client-reference-manifest.js +1 -1
  106. package/.next/server/app/packages.html +1 -1
  107. package/.next/server/app/packages.rsc +1 -1
  108. package/.next/server/app/page_client-reference-manifest.js +1 -1
  109. package/.next/server/app/settings/page.js +1 -1
  110. package/.next/server/app/settings/page_client-reference-manifest.js +1 -1
  111. package/.next/server/app/settings.html +1 -1
  112. package/.next/server/app/settings.rsc +2 -2
  113. package/.next/server/app/v1/chat/completions/route_client-reference-manifest.js +1 -1
  114. package/.next/server/app/v1/chat/conversations/[conversationId]/breakpoints/route_client-reference-manifest.js +1 -1
  115. package/.next/server/app/v1/chat/conversations/[conversationId]/cancel/route_client-reference-manifest.js +1 -1
  116. package/.next/server/app/v1/chat/conversations/[conversationId]/debug/continue/route_client-reference-manifest.js +1 -1
  117. package/.next/server/app/v1/chat/conversations/[conversationId]/debug/step/route_client-reference-manifest.js +1 -1
  118. package/.next/server/app/v1/chat/conversations/[conversationId]/edit-state/route_client-reference-manifest.js +1 -1
  119. package/.next/server/app/v1/chat/conversations/[conversationId]/events/route_client-reference-manifest.js +1 -1
  120. package/.next/server/app/v1/chat/conversations/[conversationId]/inject/route_client-reference-manifest.js +1 -1
  121. package/.next/server/app/v1/chat/conversations/[conversationId]/resources/route_client-reference-manifest.js +1 -1
  122. package/.next/server/app/v1/chat/conversations/[conversationId]/respond/route_client-reference-manifest.js +1 -1
  123. package/.next/server/app/v1/chat/conversations/[conversationId]/route_client-reference-manifest.js +1 -1
  124. package/.next/server/app/v1/chat/conversations/route_client-reference-manifest.js +1 -1
  125. package/.next/server/app/v1/chat/events/route_client-reference-manifest.js +1 -1
  126. package/.next/server/app/v1/models/route_client-reference-manifest.js +1 -1
  127. package/.next/server/app/waves/page_client-reference-manifest.js +1 -1
  128. package/.next/server/app/waves.html +1 -1
  129. package/.next/server/app/waves.rsc +1 -1
  130. package/.next/server/app-paths-manifest.json +20 -20
  131. package/.next/server/chunks/166.js +4 -4
  132. package/.next/server/chunks/3570.js +42 -42
  133. package/.next/server/chunks/5040.js +1 -1
  134. package/.next/server/chunks/544.js +27 -27
  135. package/.next/server/chunks/5544.js +3 -3
  136. package/.next/server/chunks/701.js +1 -1
  137. package/.next/server/chunks/7506.js +1 -1
  138. package/.next/server/chunks/7821.js +1 -1
  139. package/.next/server/chunks/8387.js +1 -1
  140. package/.next/server/chunks/94.js +1 -1
  141. package/.next/server/functions-config-manifest.json +2 -2
  142. package/.next/server/middleware-manifest.json +1 -1
  143. package/.next/server/pages/404.html +1 -1
  144. package/.next/server/pages/500.html +1 -1
  145. package/.next/server/server-reference-manifest.js +1 -1
  146. package/.next/server/server-reference-manifest.json +1 -1
  147. package/.next/static/chunks/app/settings/{page-fb336bb049bab72a.js → page-e3d9ffd69d16873a.js} +1 -1
  148. package/.next/trace +10 -10
  149. package/README.md +1 -1
  150. package/package.json +1 -1
  151. /package/.next/static/{A9jP2ydtYbqx-IayWP2Sg → eaxwKaaFHlA1_FLDIyFGi}/_buildManifest.js +0 -0
  152. /package/.next/static/{A9jP2ydtYbqx-IayWP2Sg → eaxwKaaFHlA1_FLDIyFGi}/_ssgManifest.js +0 -0
@@ -1 +1 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[4662,9195],{748:(e,t,r)=>{"use strict";r.d(t,{kY:()=>o,Ic:()=>i});var a=r(26796),n=r(87021);let o={light:{background:"#FFFFFF",foreground:"#2C3E50",surface:"#F5F6FA",surfaceRaised:"#FFFFFF",paperBackground:"#F5F6FA",textSecondary:"#7F8C8D",textDisabled:"#9CA3AF",border:"#e5e7eb",heading:"#111",text:"#333",secondaryText:"#666",error:{background:"#fef2f2",border:"#fecaca",text:"#dc2626"},domain:{resource:"#009688",resourceSoft:"#4DB6AC",signal:"#7E57C2",startNode:"#795548",codeBackground:"#f5f5f5",http:{get:"#2e7d32",post:"#1565c0",put:"#e65100",patch:"#6a1b9a",delete:"#c62828"},transport:{stdio:{fg:"#1976d2",bg:"#e3f2fd"},websocket:{fg:"#2e7d32",bg:"#e8f5e8"},sse:{fg:"#f57c00",bg:"#fff3e0"},streamable:{fg:"#00796b",bg:"#e0f2f1"},default:{fg:"#757575",bg:"#f5f5f5"}}}},dark:{background:"#0f1319",foreground:"#eef1f5",surface:"#1a212b",surfaceRaised:"#242d3a",paperBackground:"#1a212b",textSecondary:"#b4bdca",textDisabled:"#6b7280",border:"#37404e",heading:"#f5f7fa",text:"#eef1f5",secondaryText:"#b4bdca",error:{background:"#2a1618",border:"#5a2a2e",text:"#ff6b6b"},domain:{resource:"#26a69a",resourceSoft:"#4DB6AC",signal:"#9575CD",startNode:"#a1887f",codeBackground:"#242d3a",http:{get:"#66bb6a",post:"#5b9dff",put:"#ffa726",patch:"#ba68c8",delete:"#ef5350"},transport:{stdio:{fg:"#90caf9",bg:"#1e2a3a"},websocket:{fg:"#a5d6a7",bg:"#1e2e22"},sse:{fg:"#ffcc80",bg:"#33281a"},streamable:{fg:"#80cbc4",bg:"#17322e"},default:{fg:"#b4bdca",bg:"#242d3a"}}}}},s=(0,n.h)("frontend/utils/theme");function i(){let{isDarkMode:e}=(0,a.useTheme)();return s.debug("useThemeUtils called with isDarkMode: ".concat(e)),{getThemeValue:(t,r)=>e?r:t,getThemeColor:t=>{let r=t.split("."),a=o[e?"dark":"light"];for(let e of r)if(!a||"object"!=typeof a||!(e in a))return s.warn("Theme color path not found: ".concat(t)),"";else a=a[e];return a},colors:e?o.dark:o.light,isDarkMode:e}}},17325:(e,t,r)=>{"use strict";r.d(t,{A:()=>b});var a=r(12115),n=r(2821),o=r(57001),s=r(48116),i=r(16625),l=r(85795),d=r(95195);function c(e){return(0,d.Ay)("MuiFormGroup",e)}(0,l.A)("MuiFormGroup",["root","row","error"]);var u=r(45918),h=r(75108),p=r(95155);let x=(0,s.Ay)("div",{name:"MuiFormGroup",slot:"Root",overridesResolver:(e,t)=>{let{ownerState:r}=e;return[t.root,r.row&&t.row]}})({display:"flex",flexDirection:"column",flexWrap:"wrap",variants:[{props:{row:!0},style:{flexDirection:"row"}}]}),b=a.forwardRef(function(e,t){let r=(0,i.b)({props:e,name:"MuiFormGroup"}),{className:a,row:s=!1,...l}=r,d=(0,u.A)(),b=(0,h.A)({props:r,muiFormControl:d,states:["error"]}),m={...r,row:s,error:b.error},g=(e=>{let{classes:t,row:r,error:a}=e;return(0,o.A)({root:["root",r&&"row",a&&"error"]},c,t)})(m);return(0,p.jsx)(x,{className:(0,n.A)(g.root,a),ownerState:m,ref:t,...l})})},21422:(e,t,r)=>{"use strict";r.d(t,{A:()=>o});var a=r(15485),n=r(95155);let o=(0,a.A)((0,n.jsx)("path",{d:"M18 8h-1V6c0-2.76-2.24-5-5-5S7 3.24 7 6v2H6c-1.1 0-2 .9-2 2v10c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V10c0-1.1-.9-2-2-2M9 6c0-1.66 1.34-3 3-3s3 1.34 3 3v2H9zm9 14H6V10h12zm-6-3c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2"}),"LockOutlined")},26796:(e,t,r)=>{"use strict";r.r(t),r.d(t,{ThemeProvider:()=>p,useTheme:()=>x});var a=r(95155),n=r(12115),o=r(87021),s=r(7160),i=r(29197),l=r(748),d=r(84563),c=r(29692);let u=(0,o.h)("frontend/contexts/ThemeContext"),h=(0,n.createContext)(void 0),p=e=>{let{children:t}=e,[r,o]=(0,n.useState)(!1),[p,x]=(0,n.useState)(!1);(0,n.useEffect)(()=>{(async()=>{u.debug("Loading theme preference from storage");let e=await (0,c.YM)(c.Zg.THEME,"light");u.info("Theme loaded from storage: ".concat(e));let t="dark"===e;x(t),t?document.documentElement.classList.add("dark-theme"):document.documentElement.classList.remove("dark-theme"),o(!0)})()},[]);let b=(0,n.useMemo)(()=>(function(e){let t="dark"===e?l.kY.dark:l.kY.light,r="dark"===e;return(0,i.A)({palette:{mode:e,primary:{main:r?"#4f93f5":"#007bff",light:r?"#6aa6f7":"#3395ff",dark:r?"#3a7ad4":"#0056b3"},secondary:{main:r?"#a3adba":"#6c757d"},error:{main:r?"#ff6b6b":"#dc2626",light:r?"#5a2a2e":"#fecaca",dark:r?"#2a1618":"#b91c1c"},warning:{main:r?"#e0a23c":"#f59e0b"},info:{main:r?"#56b6d6":"#3b82f6"},success:{main:r?"#3fae72":"#16a34a"},divider:t.border,background:{default:t.background,paper:t.surface},text:{primary:t.foreground,secondary:t.textSecondary,disabled:t.textDisabled}},typography:{fontFamily:"var(--font-geist-sans), Arial, sans-serif",h1:{fontWeight:700},h2:{fontWeight:700},h3:{fontWeight:600},h4:{fontWeight:600},h5:{fontWeight:600},h6:{fontWeight:600}},components:{MuiButton:{styleOverrides:{root:{textTransform:"none",borderRadius:"0.375rem"}}},MuiPaper:{styleOverrides:{root:{borderRadius:"0.5rem",backgroundImage:"none"}}},MuiTextField:{styleOverrides:{root:{"& .MuiOutlinedInput-root":{borderRadius:"0.375rem"}}}},MuiCard:{styleOverrides:{root:{borderRadius:"0.5rem",border:r?"1px solid ".concat(t.border):void 0,boxShadow:r?"0 4px 6px -1px rgba(0, 0, 0, 0.4), 0 2px 4px -1px rgba(0, 0, 0, 0.3)":"0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06)"}}},MuiMenu:{styleOverrides:{paper:{backgroundColor:t.surfaceRaised,backgroundImage:"none"}}},MuiPopover:{styleOverrides:{paper:{backgroundColor:t.surfaceRaised,backgroundImage:"none"}}},MuiTooltip:{styleOverrides:{tooltip:r?{backgroundColor:t.surfaceRaised,border:"1px solid ".concat(t.border),color:t.foreground}:void 0}}}})})(p?"dark":"light"),[p]);return u.debug("Rendering ThemeProvider with isDarkMode: ".concat(p)),(0,a.jsx)(h.Provider,{value:{toggleTheme:()=>{x(e=>{let t=!e,r=t?"dark":"light";return u.info("Toggling theme to: ".concat(r)),t?document.documentElement.classList.add("dark-theme"):document.documentElement.classList.remove("dark-theme"),(0,c.VH)(c.Zg.THEME,r),t})},isDarkMode:p},children:(0,a.jsxs)(s.A,{theme:b,children:[(0,a.jsx)(d.Ay,{}),t]})})},x=()=>{let e=(0,n.useContext)(h);if(!e)throw u.error("useTheme hook used outside of ThemeProvider"),Error("useTheme must be used within a ThemeProvider");return u.debug("useTheme hook accessed"),e}},48363:(e,t,r)=>{"use strict";r.d(t,{A:()=>o});var a=r(15485),n=r(95155);let o=(0,a.A)((0,n.jsx)("path",{d:"M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76 0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71 0-3.1-1.39-3.1-3.1M8 13h8v-2H8zm9-6h-4v1.9h4c1.71 0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76 0 5-2.24 5-5s-2.24-5-5-5"}),"Link")},49215:(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>es});var a=r(95155),n=r(94049),o=r(12115),s=r(25635),i=r(98267),l=r(20537),d=r(37960),c=r(63186),u=r(22003),h=r(28548),p=r(2300),x=r(9562),b=r(56422),m=r(41983),g=r(91871),f=r(21422),y=r(15485);let v=(0,y.A)((0,a.jsx)("path",{d:"M18 8h-1V6c0-2.76-2.24-5-5-5S7 3.24 7 6h2c0-1.66 1.34-3 3-3s3 1.34 3 3v2H6c-1.1 0-2 .9-2 2v10c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V10c0-1.1-.9-2-2-2m0 12H6V10h12zm-6-3c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2"}),"LockOpenOutlined");var j=r(68212),k=r(42063),A=r(9164);function w(){let{setKey:e,changeKey:t,verifyKey:r,isEncryptionInitialized:i,isUserEncryptionEnabled:l}=(0,A.useStorage)(),[d,c]=(0,o.useState)(""),[y,w]=(0,o.useState)(""),[S,C]=(0,o.useState)(!1),[E,P]=(0,o.useState)(""),[R,T]=(0,o.useState)(""),[F,O]=(0,o.useState)(!1),[M,I]=(0,o.useState)(!1),[W,B]=(0,o.useState)(null),[D,z]=(0,o.useState)(!1),[L,V]=(0,o.useState)(!1),[U,N]=(0,o.useState)(!1),H=()=>{setTimeout(()=>window.location.reload(),800)};(0,o.useEffect)(()=>{(async()=>{let e=await i(),t=await l();z(e),V(t)})()},[i,l]);let K=async t=>{t.preventDefault(),N(!0),B(null);try{if(d.length<12){B({type:"error",text:"Encryption password must be at least 12 characters long for security"}),N(!1);return}if(d!==y){B({type:"error",text:"Passwords do not match"}),N(!1);return}await e(d),B({type:"success",text:"Encryption password set successfully"}),c(""),w(""),z(!0),H()}catch(e){B({type:"error",text:"Failed to set encryption password"})}finally{N(!1)}},G=async e=>{e.preventDefault(),N(!0),B(null);try{if(R.length<12){B({type:"error",text:"New password must be at least 12 characters long for security"}),N(!1);return}if(!await r(E)){B({type:"error",text:"Current password is incorrect"}),N(!1);return}await t(E,R)?(B({type:"success",text:"Encryption password changed successfully"}),P(""),T(""),H()):B({type:"error",text:"Failed to change encryption password"})}catch(e){B({type:"error",text:"An error occurred while changing the password"})}finally{N(!1)}};return(0,a.jsxs)(n.default,{sx:{width:"100%"},children:[(0,a.jsx)(s.default,{variant:"h6",gutterBottom:!0,children:"Encryption Settings"}),(0,a.jsx)(s.default,{variant:"body2",color:"text.secondary",sx:{mb:3},children:"Set an encryption password to secure sensitive data like API keys and credentials. This password is used to encrypt your data and is never stored directly."}),W&&(0,a.jsx)(u.A,{severity:W.type,sx:{mb:3},children:W.text}),(0,a.jsxs)(n.default,{sx:{display:"flex",alignItems:"center",mb:3},children:[(0,a.jsx)(s.default,{variant:"body1",sx:{mr:2},children:"Current encryption status:"}),D?L?(0,a.jsx)(h.A,{icon:(0,a.jsx)(f.A,{}),label:"Custom Password Protection",color:"success",variant:"outlined"}):(0,a.jsx)(h.A,{icon:(0,a.jsx)(v,{}),label:"Default Encryption",color:"primary",variant:"outlined"}):(0,a.jsx)(h.A,{label:"No Encryption",color:"error",variant:"outlined"})]}),D&&L?L?(0,a.jsxs)(p.A,{elevation:2,sx:{p:3},children:[(0,a.jsx)(s.default,{variant:"subtitle1",gutterBottom:!0,fontWeight:"bold",children:"Change Encryption Password"}),(0,a.jsx)(s.default,{variant:"body2",color:"text.secondary",sx:{mb:2},children:"You can change your custom encryption password here. This will re-encrypt your data with the new password. Your data will remain intact."}),(0,a.jsxs)(n.default,{component:"form",onSubmit:G,children:[(0,a.jsx)(x.A,{fullWidth:!0,label:"Current Password",variant:"outlined",value:E,onChange:e=>P(e.target.value),type:F?"text":"password",InputProps:{endAdornment:(0,a.jsx)(b.A,{position:"end",children:(0,a.jsx)(m.A,{"aria-label":"toggle current password visibility",onClick:()=>O(!F),edge:"end",children:F?(0,a.jsx)(j.A,{}):(0,a.jsx)(k.A,{})})})},sx:{mb:2}}),(0,a.jsx)(x.A,{fullWidth:!0,label:"New Password",variant:"outlined",value:R,onChange:e=>T(e.target.value),type:M?"text":"password",InputProps:{endAdornment:(0,a.jsx)(b.A,{position:"end",children:(0,a.jsx)(m.A,{"aria-label":"toggle new password visibility",onClick:()=>I(!M),edge:"end",children:M?(0,a.jsx)(j.A,{}):(0,a.jsx)(k.A,{})})})},sx:{mb:3}}),(0,a.jsx)(g.A,{type:"submit",variant:"contained",color:"primary",disabled:!E||!R||U,children:"Change Password"})]})]}):null:(0,a.jsxs)(p.A,{elevation:2,sx:{p:3,mb:4},children:[(0,a.jsx)(s.default,{variant:"subtitle1",gutterBottom:!0,fontWeight:"bold",children:"Set Custom Encryption Password"}),(0,a.jsx)(s.default,{variant:"body2",color:"text.secondary",sx:{mb:2},children:D?"Your data is currently protected with default encryption. Set a custom password for enhanced security.":"Create a strong password to protect your sensitive data. Make sure to remember this password as it cannot be recovered if lost."}),(0,a.jsxs)(n.default,{component:"form",onSubmit:K,children:[(0,a.jsx)(x.A,{fullWidth:!0,label:"New Password",variant:"outlined",value:d,onChange:e=>c(e.target.value),type:S?"text":"password",InputProps:{endAdornment:(0,a.jsx)(b.A,{position:"end",children:(0,a.jsx)(m.A,{"aria-label":"toggle password visibility",onClick:()=>C(!S),edge:"end",children:S?(0,a.jsx)(j.A,{}):(0,a.jsx)(k.A,{})})})},sx:{mb:2}}),(0,a.jsx)(x.A,{fullWidth:!0,label:"Confirm Password",variant:"outlined",value:y,onChange:e=>w(e.target.value),type:S?"text":"password",sx:{mb:3}}),(0,a.jsx)(g.A,{type:"submit",variant:"contained",color:"primary",disabled:!d||!y||U,children:D?"Upgrade to Custom Password":"Set Encryption Password"})]})]}),(0,a.jsx)(n.default,{sx:{mt:4},children:(0,a.jsxs)(u.A,{severity:L?"warning":"info",children:[(0,a.jsx)(s.default,{variant:"subtitle2",fontWeight:"bold",children:L?"Important Security Information":"About Default Encryption"}),L?(0,a.jsxs)(s.default,{variant:"body2",children:["• Your custom encryption password is never stored directly on the server",(0,a.jsx)("br",{}),"• If you forget your password, you will not be able to access your encrypted data",(0,a.jsx)("br",{}),"• Consider using a password manager to securely store this password"]}):(0,a.jsxs)(s.default,{variant:"body2",children:["• Your data is currently encrypted with a built-in default key",(0,a.jsx)("br",{}),"• This provides basic protection without requiring password setup",(0,a.jsx)("br",{}),"• For maximum security, set a custom password using the form above"]})]})})]})}var S=r(99944),C=r(9957),E=r(26796),P=r(87021);let R=(0,P.h)("frontend/components/Settings/ThemeSettings");function T(){let{isDarkMode:e,toggleTheme:t}=(0,E.useTheme)();return R.debug("Rendering ThemeSettings with isDarkMode: ".concat(e)),(0,a.jsxs)(n.default,{sx:{maxWidth:600},children:[(0,a.jsx)(s.default,{variant:"h6",gutterBottom:!0,children:"Theme Settings"}),(0,a.jsx)(s.default,{variant:"body2",color:"text.secondary",sx:{mb:2},children:"Customize the application appearance"}),(0,a.jsx)(S.A,{control:(0,a.jsx)(C.A,{checked:e,onChange:t,name:"darkMode"}),label:"Dark Mode"})]})}var F=r(71892),O=r(52397);function M(){let{globalEnvVars:e,setGlobalEnvVars:t,deleteGlobalEnvVar:r}=(0,A.useStorage)(),[i,l]=(0,o.useState)(null),d=async e=>{try{let r=Object.fromEntries(Object.entries(e).filter(e=>{let[t,r]=e;return"string"==typeof r||!r.metadata.isSecret||r.value!==O.gF}));await t(r),l({type:"success",text:"Global environment variables updated successfully"}),setTimeout(()=>{l(null)},3e3)}catch(e){l({type:"error",text:"Failed to update global environment variables"})}};return(0,a.jsxs)(n.default,{sx:{width:"100%"},children:[(0,a.jsx)(s.default,{variant:"body2",color:"text.secondary",sx:{mb:2},children:"Define global environment variables that can be bound to MCP servers. This allows you to manage API keys and other sensitive information in one place."}),i&&(0,a.jsx)(u.A,{severity:i.type,sx:{mb:2},children:i.text}),(0,a.jsx)(F.A,{serverName:"Global",initialEnv:e,onSave:d,onDelete:r})]})}var I=r(17325),W=r(22822),B=r(4474),D=r(21067),z=r(2778),L=r(52363),V=r(65036),U=r(50001),N=r(75912),H=r(27156);let K=(0,P.h)("frontend/components/Settings/BackupSettings"),G=[{key:"models",label:"Models",description:"AI model configurations",storageKey:H.Z.MODELS},{key:"mcpServers",label:"MCP Servers Configuration",description:"MCP server settings",storageKey:H.Z.MCP_SERVERS},{key:"mcpServersFolder",label:"MCP Servers Folder",description:"MCP server code and files",isFolder:!0},{key:"flows",label:"Flows",description:"Flow configurations",storageKey:H.Z.FLOWS},{key:"chatHistory",label:"Chat History",description:"Conversation history",storageKey:H.Z.CHAT_HISTORY},{key:"settings",label:"Settings",description:"Application settings",storageKey:H.Z.THEME},{key:"globalEnvVars",label:"Global Environment Variables",description:"Global environment variables",storageKey:H.Z.GLOBAL_ENV_VARS},{key:"encryptionKey",label:"Encryption Key",description:"Data encryption key",storageKey:H.Z.ENCRYPTION_KEY}];function Y(){let[e,t]=(0,o.useState)(G.reduce((e,t)=>({...e,[t.key]:!0}),{})),[r,i]=(0,o.useState)(G.reduce((e,t)=>({...e,[t.key]:!0}),{})),[l,d]=(0,o.useState)(null),c=(0,o.useRef)(null),[h,x]=(0,o.useState)(null),[b,m]=(0,o.useState)(!1),[f,y]=(0,o.useState)(!1),v=r=>{t({...e,[r.target.name]:r.target.checked})},j=e=>{i({...r,[e.target.name]:e.target.checked})},k=async()=>{K.debug("Creating backup with selections:",e),m(!0),x(null);try{let t=Object.entries(e).filter(e=>{let[t,r]=e;return r}).map(e=>{let[t]=e;return t});if(0===t.length){x({type:"error",text:"Please select at least one item to backup"}),m(!1);return}let r=await fetch("/api/backup",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({selections:t})});if(!r.ok)throw Error("Failed to create backup");let a=await r.blob(),n=window.URL.createObjectURL(a),o=document.createElement("a");o.style.display="none",o.href=n;let s=new Date().toISOString().replace(/[:.]/g,"-").substring(0,19);o.download="flujo-backup-".concat(s,".zip"),document.body.appendChild(o),o.click(),window.URL.revokeObjectURL(n),document.body.removeChild(o),x({type:"success",text:"Backup created successfully"})}catch(e){K.error("Error creating backup:",e),x({type:"error",text:e instanceof Error?e.message:"Failed to create backup"})}finally{m(!1)}},A=async()=>{K.debug("Restoring from backup with selections:",r),m(!0),x(null),y(!1);try{let e=Object.entries(r).filter(e=>{let[t,r]=e;return r}).map(e=>{let[t]=e;return t}),t=new FormData;t.append("file",l),t.append("selections",JSON.stringify(e));let a=await fetch("/api/restore",{method:"POST",body:t});if(!a.ok){let e=await a.json();throw Error(e.error||"Failed to restore from backup")}x({type:"success",text:"Restore completed successfully. You may need to refresh the page to see the changes."}),c.current&&(c.current.value=""),d(null)}catch(e){K.error("Error restoring from backup:",e),x({type:"error",text:e instanceof Error?e.message:"Failed to restore from backup"})}finally{m(!1)}},w=r=>{let a={...e};G.forEach(e=>{a[e.key]=r}),t(a)},C=e=>{let t={...r};G.forEach(r=>{t[r.key]=e}),i(t)};return(0,a.jsxs)(n.default,{sx:{width:"100%"},children:[(0,a.jsx)(s.default,{variant:"h6",gutterBottom:!0,children:"Backup and Restore"}),(0,a.jsx)(s.default,{variant:"body2",color:"text.secondary",sx:{mb:2},children:"Create backups of your application data or restore from a previous backup."}),h&&(0,a.jsx)(u.A,{severity:h.type,sx:{mb:2},children:h.text}),(0,a.jsxs)(p.A,{sx:{p:3,mb:3},children:[(0,a.jsx)(s.default,{variant:"subtitle1",gutterBottom:!0,fontWeight:"bold",children:"Create Backup"}),(0,a.jsx)(s.default,{variant:"body2",color:"text.secondary",sx:{mb:2},children:"Select the components you want to include in the backup."}),(0,a.jsxs)(n.default,{sx:{mb:2},children:[(0,a.jsx)(g.A,{size:"small",onClick:()=>w(!0),sx:{mr:1},children:"Select All"}),(0,a.jsx)(g.A,{size:"small",onClick:()=>w(!1),children:"Deselect All"})]}),(0,a.jsx)(I.A,{sx:{mb:3},children:G.map(t=>(0,a.jsx)(S.A,{control:(0,a.jsx)(W.A,{checked:e[t.key],onChange:v,name:t.key}),label:(0,a.jsxs)(n.default,{children:[(0,a.jsx)(s.default,{variant:"body1",children:t.label}),(0,a.jsx)(s.default,{variant:"body2",color:"text.secondary",children:t.description})]})},t.key))}),(0,a.jsx)(g.A,{variant:"contained",onClick:k,disabled:b||Object.values(e).every(e=>!e),startIcon:b?(0,a.jsx)(B.default,{size:20}):null,children:b?"Creating Backup...":"Create Backup"})]}),(0,a.jsxs)(p.A,{sx:{p:3},children:[(0,a.jsx)(s.default,{variant:"subtitle1",gutterBottom:!0,fontWeight:"bold",children:"Restore from Backup"}),(0,a.jsx)(s.default,{variant:"body2",color:"text.secondary",sx:{mb:2},children:"Select a backup file and choose which components to restore."}),(0,a.jsxs)(n.default,{sx:{mb:3},children:[(0,a.jsxs)(g.A,{variant:"outlined",component:"label",sx:{mb:2},children:["Select Backup File",(0,a.jsx)("input",{type:"file",hidden:!0,accept:".zip",onChange:e=>{let t=e.target.files;t&&t.length>0&&(d(t[0]),x(null))},ref:c})]}),l&&(0,a.jsxs)(s.default,{variant:"body2",sx:{ml:1},children:["Selected file: ",l.name]})]}),(0,a.jsx)(D.A,{sx:{mb:2}}),(0,a.jsx)(s.default,{variant:"subtitle2",gutterBottom:!0,children:"Restore Options"}),(0,a.jsxs)(n.default,{sx:{mb:2},children:[(0,a.jsx)(g.A,{size:"small",onClick:()=>C(!0),sx:{mr:1},children:"Select All"}),(0,a.jsx)(g.A,{size:"small",onClick:()=>C(!1),children:"Deselect All"})]}),(0,a.jsx)(I.A,{sx:{mb:3},children:G.map(e=>(0,a.jsx)(S.A,{control:(0,a.jsx)(W.A,{checked:r[e.key],onChange:j,name:e.key}),label:(0,a.jsxs)(n.default,{children:[(0,a.jsx)(s.default,{variant:"body1",children:e.label}),(0,a.jsx)(s.default,{variant:"body2",color:"text.secondary",children:e.description})]})},e.key))}),(0,a.jsx)(g.A,{variant:"contained",color:"warning",onClick:()=>l?0===Object.entries(r).filter(e=>{let[t,r]=e;return r}).map(e=>{let[t]=e;return t}).length?void x({type:"error",text:"Please select at least one item to restore"}):void y(!0):void x({type:"error",text:"Please select a backup file"}),disabled:b||!l||Object.values(r).every(e=>!e),startIcon:b?(0,a.jsx)(B.default,{size:20}):null,children:b?"Restoring...":"Restore from Backup"})]}),(0,a.jsxs)(z.A,{open:f,onClose:()=>y(!1),children:[(0,a.jsx)(L.A,{children:"Confirm Restore"}),(0,a.jsx)(V.A,{children:(0,a.jsx)(U.A,{children:"This will overwrite your existing data with the contents of the backup file. This action cannot be undone. Are you sure you want to continue?"})}),(0,a.jsxs)(N.A,{children:[(0,a.jsx)(g.A,{onClick:()=>y(!1),children:"Cancel"}),(0,a.jsx)(g.A,{onClick:A,color:"warning",variant:"contained",children:"Restore"})]})]})]})}var _=r(52641),J=r(84869);function Z(){let{settings:e,updateSettings:t}=(0,A.useStorage)(),r=(0,J.G)(),o=(null==e?void 0:e.speech)||{enabled:!0};return(0,a.jsxs)(n.default,{sx:{p:2},children:[!r.supported&&(0,a.jsx)(u.A,{severity:"warning",sx:{mb:3},children:"Speech recognition is not supported in your browser. Please use Chrome, Edge, or Safari for the best experience."}),(0,a.jsxs)(_.A,{fullWidth:!0,sx:{mb:3},children:[(0,a.jsx)(S.A,{control:(0,a.jsx)(C.A,{checked:o.enabled,onChange:r=>{t({...e,speech:{...o,enabled:r.target.checked}})},name:"enabled",disabled:!r.supported}),label:"Enable speech recognition"}),(0,a.jsx)(s.default,{variant:"body2",color:"text.secondary",sx:{mt:1},children:"When enabled, audio recordings will be transcribed using your browser's built-in offfline speech recognition capabilities."})]}),(0,a.jsxs)(p.A,{variant:"outlined",sx:{p:2,mb:3},children:[(0,a.jsx)(s.default,{variant:"subtitle2",gutterBottom:!0,children:"Speech Recognition Information"}),(0,a.jsxs)(n.default,{sx:{display:"flex",justifyContent:"space-between",mb:1},children:[(0,a.jsx)(s.default,{variant:"body2",children:"Technology:"}),(0,a.jsx)(s.default,{variant:"body2",children:"Web Speech API"})]}),(0,a.jsxs)(n.default,{sx:{display:"flex",justifyContent:"space-between",mb:1},children:[(0,a.jsx)(s.default,{variant:"body2",children:"Processing:"}),(0,a.jsx)(s.default,{variant:"body2",children:"Browser-based"})]}),(0,a.jsxs)(n.default,{sx:{display:"flex",justifyContent:"space-between",mb:1},children:[(0,a.jsx)(s.default,{variant:"body2",children:"Language:"}),(0,a.jsx)(s.default,{variant:"body2",children:"Automatically uses browser language"})]}),(0,a.jsxs)(n.default,{sx:{display:"flex",justifyContent:"space-between",mb:1},children:[(0,a.jsx)(s.default,{variant:"body2",children:"Privacy:"}),(0,a.jsx)(s.default,{variant:"body2",children:"Depends on browser implementation"})]})]}),(0,a.jsx)(u.A,{severity:"info",sx:{mt:3},children:(0,a.jsx)(s.default,{variant:"body2",children:"Speech recognition quality may vary based on your browser, microphone quality, and background noise. For best results, speak clearly and use a good quality microphone."})})]})}(0,P.h)("frontend/components/Settings/SpeechRecognitionSettings");let q=(0,P.h)("frontend/components/Settings/UpdateSettings");function $(){let{settings:e,updateSettings:t}=(0,A.useStorage)(),r=(null==e?void 0:e.update)||{checkOnStartup:!1},[i,l]=(0,o.useState)(!1),[d,c]=(0,o.useState)(!1),[h,p]=(0,o.useState)(null),[x,b]=(0,o.useState)(null),m=null===x||"git"===x,f=async()=>{l(!0),p(null);try{let e=await fetch("/api/update"),t=await e.json();"string"==typeof t.updateMode&&b(t.updateMode),e.ok&&!1!==t.success?!1===t.isGitRepo?p({severity:"info",message:t.message}):t.updateAvailable?p({severity:"warning",message:"An update is available (".concat(t.behindBy," new commit").concat(1===t.behindBy?"":"s"," on ").concat(t.branch,").")}):p({severity:"success",message:"FLUJO is up to date (v".concat(t.currentVersion,").")}):p({severity:"error",message:t.error||"Failed to check for updates."})}catch(e){q.error("Update check failed",e),p({severity:"error",message:"Failed to check for updates."})}finally{l(!1)}},y=async()=>{c(!0),p({severity:"info",message:"Updating FLUJO - this may take a few minutes..."});try{let e=await fetch("/api/update",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"apply"})}),t=await e.json();if(!e.ok||!1===t.success){p({severity:"error",message:t.error||"Update failed."}),c(!1);return}if(p({severity:"success",message:t.message}),t.restarting){let e=!1,t=async()=>{try{if((await fetch("/api/cwd",{cache:"no-store"})).ok&&e)return void window.location.reload()}catch(t){e=!0}setTimeout(t,3e3)};setTimeout(t,5e3)}else c(!1)}catch(e){q.error("Update failed",e),p({severity:"error",message:"Update failed."}),c(!1)}};return(0,a.jsxs)(n.default,{sx:{p:2},children:[(0,a.jsxs)(_.A,{fullWidth:!0,sx:{mb:2},children:[(0,a.jsx)(S.A,{control:(0,a.jsx)(C.A,{checked:r.checkOnStartup,onChange:a=>{t({...e,update:{...r,checkOnStartup:a.target.checked}})},name:"checkOnStartup"}),label:"Check for updates on startup"}),(0,a.jsxs)(s.default,{variant:"body2",color:"text.secondary",sx:{mt:1},children:["When enabled, FLUJO checks GitHub for a newer version when the home page loads and shows a one-click update banner if one is available. Updates run ",(0,a.jsx)("code",{children:"git pull"})," + rebuild in your install folder; your data is preserved."]}),!m&&(0,a.jsxs)(s.default,{variant:"body2",color:"text.secondary",sx:{mt:1},children:["This install can't update itself in place","container"===x?" (running in Docker) — pull a newer image instead.":"npm"===x?" (installed via npm) — rerun with the latest version instead.":" — it is not running from a git clone."]})]}),(0,a.jsxs)(n.default,{sx:{display:"flex",gap:2,mb:2},children:[(0,a.jsxs)(g.A,{variant:"outlined",onClick:f,disabled:i||d,children:[i?(0,a.jsx)(B.default,{size:20,sx:{mr:1}}):null,"Check now"]}),(0,a.jsxs)(g.A,{variant:"contained",onClick:y,disabled:d||!m,children:[d?(0,a.jsx)(B.default,{size:20,sx:{mr:1}}):null,"Update now"]})]}),h&&(0,a.jsx)(u.A,{severity:h.severity,sx:{mt:1},children:h.message})]})}let Q=(0,y.A)((0,a.jsx)("path",{d:"M5 13.18v4L12 21l7-3.82v-4L12 17zM12 3 1 9l11 6 9-4.91V17h2V9z"}),"School");var X=r(69195);function ee(){let{startTour:e}=(0,X.useTour)();return(0,a.jsxs)(n.default,{sx:{p:2},children:[(0,a.jsx)(s.default,{variant:"body2",color:"text.secondary",sx:{mb:2},children:"The guided tour walks you through the full first-run path — adding a model, connecting an MCP tool server, building a flow, and running it in chat. It launches automatically the first time you open FLUJO; replay it any time below."}),(0,a.jsx)(g.A,{variant:"outlined",startIcon:(0,a.jsx)(Q,{}),onClick:e,children:"Replay guided tour"})]})}let et=(0,P.h)("frontend/components/Settings/ExperimentalFeaturesSettings");function er(){var e,t,r,o;let{settings:i,updateSettings:l}=(0,A.useStorage)(),d=null!=(e=null==i?void 0:i.experimental)?e:{enabled:!1};return(0,a.jsxs)(n.default,{sx:{p:2},children:[(0,a.jsxs)(_.A,{fullWidth:!0,sx:{mb:2},children:[(0,a.jsx)(S.A,{control:(0,a.jsx)(C.A,{checked:d.enabled,onChange:e=>{et.debug("Experimental features toggled: ".concat(e.target.checked)),l({...i,experimental:{...d,enabled:e.target.checked}})},name:"experimentalEnabled"}),label:"Enable Experimental Features"}),(0,a.jsxs)(s.default,{variant:"body2",color:"text.secondary",sx:{mt:1},children:["Experimental features may be incomplete or unstable and can change or be removed at any time. When enabled, they become visible in the app — for example the ",(0,a.jsx)("strong",{children:"Waves"})," entry in the top navigation."]})]}),(0,a.jsxs)(_.A,{fullWidth:!0,sx:{mb:2},children:[(0,a.jsx)(S.A,{control:(0,a.jsx)(C.A,{checked:null!=(t=d.claudeSessionResume)&&t,onChange:e=>{et.debug("Claude session resume toggled: ".concat(e.target.checked)),l({...i,experimental:{...d,claudeSessionResume:e.target.checked}})},name:"claudeSessionResume"}),label:"Reuse Claude session across turns (reduce token usage)"}),(0,a.jsxs)(s.default,{variant:"body2",color:"text.secondary",sx:{mt:1},children:["For models using the ",(0,a.jsx)("strong",{children:"Claude\xa0subscription"})," (Agent\xa0SDK) adapter, resume one session per node instead of re-sending the whole conversation each turn — so only the newest message is sent. This can dramatically cut token usage on long chats. It changes how conversation context reaches the model, so it is off by default; if you notice a model losing track of earlier context, turn it back off."]})]}),(0,a.jsxs)(_.A,{fullWidth:!0,sx:{mb:2},children:[(0,a.jsx)(S.A,{control:(0,a.jsx)(C.A,{checked:null!=(r=d.autoUnloadOllamaModels)&&r,onChange:e=>{et.debug("Auto-unload Ollama models toggled: ".concat(e.target.checked)),l({...i,experimental:{...d,autoUnloadOllamaModels:e.target.checked}})},name:"autoUnloadOllamaModels"}),label:"Auto-unload idle Ollama models"}),(0,a.jsx)(s.default,{variant:"body2",color:"text.secondary",sx:{mt:1},children:"When a flow switches between different Ollama models on the same server, automatically unload the previous model from VRAM before loading the new one. Recommended for GPU-constrained hardware. Note: concurrent Ollama requests to the same server are serialised while this is on."})]}),(0,a.jsxs)(_.A,{fullWidth:!0,sx:{mb:2},children:[(0,a.jsx)(S.A,{control:(0,a.jsx)(C.A,{checked:null!=(o=d.mcpBetaProtocol)&&o,onChange:e=>{et.debug("MCP beta protocol toggled: ".concat(e.target.checked)),l({...i,experimental:{...d,mcpBetaProtocol:e.target.checked}})},name:"mcpBetaProtocol"}),label:"MCP beta protocol (spec 2026-07-28)"}),(0,a.jsxs)(s.default,{variant:"body2",color:"text.secondary",sx:{mt:1},children:["Connect to MCP servers using the ",(0,a.jsx)("strong",{children:"v2 beta SDK"})," with automatic version negotiation: servers that already speak the new stateless 2026-07-28 protocol are used natively, and every other server transparently falls back to the classic handshake — so existing servers keep working. The beta SDK's API may still change before its stable release; if a server misbehaves with this on, turn it off and reconnect. Websocket servers always use the stable SDK. Changing this rebuilds server connections on their next use."]})]}),(0,a.jsx)(u.A,{severity:"info",children:(0,a.jsx)(s.default,{variant:"body2",children:"Turning this off again hides experimental features from the navigation. It does not delete any data."})})]})}var ea=r(68855);function en(){let[e,t]=(0,o.useState)("globalEnv"),r=e=>(r,a)=>{t(!!a&&e)};return(0,a.jsxs)(n.default,{sx:{p:3},children:[(0,a.jsx)(s.default,{variant:"h5",gutterBottom:!0,children:"Settings"}),(0,a.jsxs)(n.default,{sx:{mt:2},children:[(0,a.jsxs)(i.A,{expanded:"globalEnv"===e,onChange:r("globalEnv"),children:[(0,a.jsx)(l.A,{expandIcon:(0,a.jsx)(c.A,{}),"aria-controls":"globalEnv-content",id:"globalEnv-header",children:(0,a.jsx)(s.default,{variant:"h6",children:"Global Environment Variables"})}),(0,a.jsx)(d.A,{children:(0,a.jsx)(M,{})})]}),(0,a.jsxs)(i.A,{expanded:"encryption"===e,onChange:r("encryption"),children:[(0,a.jsx)(l.A,{expandIcon:(0,a.jsx)(c.A,{}),"aria-controls":"encryption-content",id:"encryption-header",children:(0,a.jsx)(s.default,{variant:"h6",children:"Encryption"})}),(0,a.jsx)(d.A,{children:(0,a.jsx)(w,{})})]}),(0,a.jsxs)(i.A,{expanded:"theme"===e,onChange:r("theme"),children:[(0,a.jsx)(l.A,{expandIcon:(0,a.jsx)(c.A,{}),"aria-controls":"theme-content",id:"theme-header",children:(0,a.jsx)(s.default,{variant:"h6",children:"Theme"})}),(0,a.jsx)(d.A,{children:(0,a.jsx)(T,{})})]}),(0,a.jsxs)(i.A,{expanded:"backup"===e,onChange:r("backup"),children:[(0,a.jsx)(l.A,{expandIcon:(0,a.jsx)(c.A,{}),"aria-controls":"backup-content",id:"backup-header",children:(0,a.jsx)(s.default,{variant:"h6",children:"Backup & Restore"})}),(0,a.jsx)(d.A,{children:(0,a.jsx)(Y,{})})]}),(0,a.jsxs)(i.A,{expanded:"speech"===e,onChange:r("speech"),children:[(0,a.jsx)(l.A,{expandIcon:(0,a.jsx)(c.A,{}),"aria-controls":"speech-content",id:"speech-header",children:(0,a.jsx)(s.default,{variant:"h6",children:"Speech Recognition"})}),(0,a.jsx)(d.A,{children:(0,a.jsx)(Z,{})})]}),(0,a.jsxs)(i.A,{expanded:"updates"===e,onChange:r("updates"),children:[(0,a.jsx)(l.A,{expandIcon:(0,a.jsx)(c.A,{}),"aria-controls":"updates-content",id:"updates-header",children:(0,a.jsx)(s.default,{variant:"h6",children:"Updates"})}),(0,a.jsx)(d.A,{children:(0,a.jsx)($,{})})]}),(0,a.jsxs)(i.A,{expanded:"onboarding"===e,onChange:r("onboarding"),children:[(0,a.jsx)(l.A,{expandIcon:(0,a.jsx)(c.A,{}),"aria-controls":"onboarding-content",id:"onboarding-header",children:(0,a.jsx)(s.default,{variant:"h6",children:"Onboarding"})}),(0,a.jsx)(d.A,{children:(0,a.jsx)(ee,{})})]}),(0,a.jsxs)(i.A,{expanded:"registry"===e,onChange:r("registry"),children:[(0,a.jsx)(l.A,{expandIcon:(0,a.jsx)(c.A,{}),"aria-controls":"registry-content",id:"registry-header",children:(0,a.jsx)(s.default,{variant:"h6",children:"Package Registry Account"})}),(0,a.jsx)(d.A,{children:(0,a.jsx)(ea.A,{})})]}),(0,a.jsxs)(i.A,{expanded:"experimental"===e,onChange:r("experimental"),children:[(0,a.jsx)(l.A,{expandIcon:(0,a.jsx)(c.A,{}),"aria-controls":"experimental-content",id:"experimental-header",children:(0,a.jsx)(s.default,{variant:"h6",children:"Experimental Features"})}),(0,a.jsx)(d.A,{children:(0,a.jsx)(er,{})})]})]})]})}let eo=(0,P.h)("app/settings/page");function es(){return eo.debug("Rendering SettingsPage"),(0,a.jsx)(n.default,{component:"main",sx:{minHeight:"100vh"},children:(0,a.jsx)(en,{})})}},52397:(e,t,r)=>{"use strict";r.d(t,{RJ:()=>n,gF:()=>a});let a="masked:********",n="********"},68212:(e,t,r)=>{"use strict";r.d(t,{A:()=>o});var a=r(15485),n=r(95155);let o=(0,a.A)((0,n.jsx)("path",{d:"M12 7c2.76 0 5 2.24 5 5 0 .65-.13 1.26-.36 1.83l2.92 2.92c1.51-1.26 2.7-2.89 3.43-4.75-1.73-4.39-6-7.5-11-7.5-1.4 0-2.74.25-3.98.7l2.16 2.16C10.74 7.13 11.35 7 12 7M2 4.27l2.28 2.28.46.46C3.08 8.3 1.78 10.02 1 12c1.73 4.39 6 7.5 11 7.5 1.55 0 3.03-.3 4.38-.84l.42.42L19.73 22 21 20.73 3.27 3zM7.53 9.8l1.55 1.55c-.05.21-.08.43-.08.65 0 1.66 1.34 3 3 3 .22 0 .44-.03.65-.08l1.55 1.55c-.67.33-1.41.53-2.2.53-2.76 0-5-2.24-5-5 0-.79.2-1.53.53-2.2m4.31-.78 3.15 3.15.02-.16c0-1.66-1.34-3-3-3z"}),"VisibilityOff")},69195:(e,t,r)=>{"use strict";r.r(t),r.d(t,{TourProvider:()=>c,useTour:()=>d});var a=r(95155),n=r(12115),o=r(9164),s=r(77326);let i=(0,r(87021).h)("frontend/contexts/TourContext"),l=(0,n.createContext)({isActive:!1,stepIndex:0,startTour:()=>{},next:()=>{},back:()=>{},endTour:()=>{}}),d=()=>(0,n.useContext)(l),c=e=>{var t;let{children:r}=e,{settings:d,updateSettings:c,isLoading:u,settingsHydrated:h}=(0,o.useStorage)(),[p,x]=(0,n.useState)(!1),[b,m]=(0,n.useState)(0),g=(0,n.useRef)(!1),f=(0,n.useCallback)(()=>{var e;c({...d,onboarding:{...null!=(e=d.onboarding)?e:{},completed:!0}}).catch(e=>i.warn("Failed to persist onboarding completion",e))},[d,c]),y=(0,n.useCallback)(()=>{i.info("Starting guided tour"),m(0),x(!0)},[]),v=(0,n.useCallback)(()=>{i.info("Ending guided tour"),x(!1),f()},[f]),j=(0,n.useCallback)(()=>{m(e=>e>=s.$.length-1?(x(!1),f(),e):e+1)},[f]),k=(0,n.useCallback)(()=>{m(e=>Math.max(0,e-1))},[]);return(0,n.useEffect)(()=>{var e;u||!h||g.current||(g.current=!0,(null==(e=d.onboarding)?void 0:e.completed)!==!0&&(i.info("First run detected — auto-starting guided tour"),y()))},[u,h,null==(t=d.onboarding)?void 0:t.completed,y]),(0,a.jsx)(l.Provider,{value:{isActive:p,stepIndex:b,startTour:y,next:j,back:k,endTour:v},children:r})}},71892:(e,t,r)=>{"use strict";r.d(t,{A:()=>P});var a=r(95155),n=r(12115),o=r(2300),s=r(94049),i=r(25635),l=r(91871),d=r(80777),c=r(33077),u=r(9562),h=r(56422),p=r(28548),x=r(99944),b=r(22822),m=r(41983),g=r(56682),f=r(87021),y=r(9164),v=r(86946),j=r(21422),k=r(12857),A=r(48363),w=r(4484),S=r(1877),C=r(52397);let E=(0,f.h)("frontend/components/mcp/MCPEnvManager/EnvEditor"),P=e=>{let{serverName:t,initialEnv:r,onSave:f,onDelete:P,onServerRestart:R}=e,{globalEnvVars:T}=(0,y.useStorage)(),[F,O]=(0,n.useState)([]),[M,I]=(0,n.useState)(!1),[W,B]=(0,n.useState)(!1),[D,z]=(0,n.useState)(!1),[L,V]=(0,n.useState)(null);(0,n.useEffect)(()=>{E.debug("Initializing environment variables for server: ".concat(t),{variableCount:Object.keys(r).length}),O(Object.entries(r).map(e=>{let[t,r]=e,a="object"==typeof r&&null!==r&&"value"in r?r.value:r,n="object"==typeof r&&null!==r&&"metadata"in r?r.metadata:{isSecret:(0,S.xc)(t)},o=a.match(/\$\{global:([^}]+)\}/);if(o){let e=o[1];return{key:t,value:a,isSecret:n.isSecret,isBound:!0,boundTo:e}}let s="string"==typeof a&&(a.startsWith("encrypted:")||a.startsWith("encrypted_failed:"));return{key:t,value:s?C.gF:a,isSecret:n.isSecret,isEncrypted:s}}))},[r]);let U=async e=>{E.debug("Removing environment variable at index: ".concat(e));let r=F[e];if("Global"===t&&P&&r.key)try{await P(r.key),O(F.filter((t,r)=>r!==e))}catch(e){E.error("Failed to delete environment variable: ".concat(r.key),e)}else O(F.filter((t,r)=>r!==e)),I(!0)},N=(e,t,r)=>{let a=[...F];if("isSecret"===t){let t=a[e];t.isSecret&&!r?a[e]={...t,isSecret:r,value:"",isEncrypted:!1,showWarning:!0}:a[e]={...t,isSecret:r}}else{let n={...a[e],[t]:r,isSecret:"key"===t?(0,S.xc)(r):a[e].isSecret};"key"===t&&(n.isValidKey=""===r||/^[a-zA-Z0-9_]+$/.test(r)),"value"===t&&(a[e].isEncrypted&&(n.isEncrypted=!1),a[e].showWarning&&r&&(n.showWarning=!1)),a[e]=n}O(a),I(!0)},H=async()=>{if(F.some(e=>""!==e.key&&!1===e.isValidKey))return void E.error("Cannot save: Some variable names contain invalid characters");E.debug("Saving environment variables for server: ".concat(t),{variableCount:F.length}),B(!0);try{let e=F.reduce((e,t)=>{let{key:r,value:a,isBound:n,boundTo:o,isSecret:s,isEncrypted:i}=t;return r&&(n&&o?e[r]={value:"${global:".concat(o,"}"),metadata:{isSecret:s}}:s&&a===C.gF||(e[r]={value:a,metadata:{isSecret:s}})),e},{});await f(e),I(!1),R&&"Global"!==t&&(E.debug("Restarting server after env variable changes: ".concat(t)),await R(t))}catch(e){E.error("Failed to save environment variables:",e)}B(!1)};return(0,a.jsxs)(o.A,{sx:{p:3,borderRadius:2,border:1,borderColor:e=>"dark"===e.palette.mode?"#3a3a3a":"#e5e7eb"},children:[(0,a.jsxs)(s.default,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",mb:3},children:[(0,a.jsxs)(i.default,{variant:"h6",sx:{fontWeight:"semibold"},children:["Environment Variables - ",t]}),(0,a.jsx)(l.A,{variant:"contained",color:"primary",size:"small",startIcon:(0,a.jsx)(v.A,{}),onClick:()=>{E.debug("Adding new environment variable"),O([...F,{key:"",value:"",isSecret:!1}]),I(!0)},children:"Add Variable"})]}),(0,a.jsx)(d.A,{spacing:3,children:F.map((e,t)=>(0,a.jsxs)(c.Ay,{container:!0,spacing:2,alignItems:"flex-start",children:[(0,a.jsx)(c.Ay,{item:!0,xs:12,sm:5,children:(0,a.jsx)(u.A,{fullWidth:!0,placeholder:"Variable name",value:e.key,onChange:e=>N(t,"key",e.target.value),error:!1===e.isValidKey,helperText:!1===e.isValidKey?"Only alphanumeric characters and underscores allowed":"",size:"small"})}),(0,a.jsx)(c.Ay,{item:!0,xs:12,sm:5,children:(0,a.jsx)(u.A,{fullWidth:!0,type:e.isSecret?"password":"text",placeholder:e.showWarning?"Re-enter value":"Value",value:e.value,onChange:e=>N(t,"value",e.target.value),InputProps:{readOnly:e.isBound,startAdornment:e.isEncrypted?(0,a.jsx)(h.A,{position:"start",children:(0,a.jsx)(j.A,{fontSize:"small",titleAccess:"This value is stored encrypted"})}):null,endAdornment:e.isBound?(0,a.jsx)(h.A,{position:"end",children:(0,a.jsx)(p.A,{size:"small",label:"Bound to global: ".concat(e.boundTo),color:"primary",variant:"outlined",onDelete:()=>(e=>{E.debug("Unbinding variable at index: ".concat(e));let t=[...F];t[e]={...t[e],isBound:!1,boundTo:void 0},O(t),I(!0)})(t),deleteIcon:(0,a.jsx)(k.A,{fontSize:"small"})})}):null},error:e.showWarning,helperText:e.showWarning?"You must re-enter the value after switching from secret to normal mode":"",size:"small",sx:{bgcolor:t=>e.isBound?"dark"===t.palette.mode?"#1a1a1a":"#f9fafb":t.palette.background.paper}})}),(0,a.jsx)(c.Ay,{item:!0,xs:12,sm:2,children:(0,a.jsxs)(s.default,{sx:{display:"flex",alignItems:"center",mt:.5},children:[(0,a.jsx)(x.A,{control:(0,a.jsx)(b.A,{checked:e.isSecret,onChange:e=>N(t,"isSecret",e.target.checked),size:"small"}),label:"Secret",sx:{mr:1}}),!e.isBound&&(0,a.jsx)(m.A,{size:"small",color:"primary",onClick:()=>(e=>{E.debug("Opening bind modal for variable at index: ".concat(e)),V(e),z(!0)})(t),title:"Bind to global variable",sx:{mr:1},children:(0,a.jsx)(A.A,{fontSize:"small"})}),(0,a.jsx)(m.A,{size:"small",color:"error",onClick:()=>U(t),title:"Remove variable",children:(0,a.jsx)(w.A,{fontSize:"small"})})]})})]},t))}),(0,a.jsx)(g.A,{open:D,onClose:()=>{z(!1),V(null)},children:(0,a.jsxs)(s.default,{sx:{position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)",width:400,maxWidth:"90%",bgcolor:"background.paper",boxShadow:24,p:4,borderRadius:2},children:[(0,a.jsx)(i.default,{variant:"h6",sx:{mb:2},children:"Bind to Global Variable"}),0===Object.keys(T).length?(0,a.jsx)(i.default,{color:"text.secondary",sx:{mb:2},children:"No global variables available. Add some in Settings first."}):(0,a.jsx)(s.default,{sx:{maxHeight:300,overflow:"auto",mb:2},children:Object.entries(T).map(e=>{let[t,r]=e;return(0,a.jsxs)(l.A,{fullWidth:!0,variant:"text",onClick:()=>(e=>{if(null!==L){E.debug("Binding variable at index ".concat(L," to global variable: ").concat(e));let t=[...F];t[L]={...t[L],isBound:!0,boundTo:e,value:"${global:".concat(e,"}")},O(t),z(!1),V(null),I(!0)}})(t),sx:{justifyContent:"space-between",textAlign:"left",mb:1,p:1,borderRadius:1},children:[(0,a.jsx)(i.default,{variant:"body2",children:t}),(0,a.jsx)(i.default,{variant:"caption",color:"text.secondary",children:r&&"object"==typeof r&&r.metadata&&r.metadata.isSecret?C.gF:r&&"object"==typeof r?r.value:r})]},t)})}),(0,a.jsx)(s.default,{sx:{display:"flex",justifyContent:"flex-end"},children:(0,a.jsx)(l.A,{variant:"outlined",onClick:()=>{z(!1),V(null)},children:"Cancel"})})]})}),M&&(0,a.jsx)(s.default,{sx:{display:"flex",justifyContent:"flex-end",mt:3},children:(0,a.jsx)(l.A,{variant:"contained",color:"success",onClick:H,disabled:W||F.some(e=>""!==e.key&&!1===e.isValidKey),children:W?"Saving...":"Save Changes"})})]})}},77326:(e,t,r)=>{"use strict";r.d(t,{$:()=>a});let a=[{id:"welcome",path:"/",placement:"center",title:"Welcome to FLUJO \uD83D\uDC4B",body:"This quick tour walks you through going from zero to a running AI flow.\n\nYou'll add a model, connect a tool server, build a flow, and run it in chat. It takes about a minute — you can skip any time."},{id:"add-model",path:"/models",target:'[data-tour="add-model"]',placement:"bottom",title:"1. Add a model",body:'FLUJO needs at least one AI model to think with. Click "Add Model" to configure one.\n\nTip: an OpenRouter API key gives you access to several free models — paste the key, name the model, pick a free one, and add a custom instruction.'},{id:"add-mcp-server",path:"/mcp",target:'[data-tour="add-mcp-server"]',placement:"bottom",title:"2. Connect a tool server (MCP)",body:'MCP servers give your model real tools — file access, image generation, web search, and more.\n\nClick "Add Server" and install the "Everything" reference server to try the full range of capabilities while you learn.'},{id:"new-flow",path:"/flows",target:'[data-tour="new-flow"]',placement:"bottom",title:"3. Build a flow",body:'A flow wires everything together. Click "New Flow" to open the builder.\n\nConnect Start → Process → Finish, attach your model to the Process node, and bind the Everything MCP server so the model can use its tools.'},{id:"chat-input",path:"/chat",target:'[data-tour="chat-input"]',placement:"top",title:"4. Run it in chat",body:"Pick your flow from the selector, then send a message here.\n\nTry asking it to generate an image with the MCP server and tell you a joke — you'll see the flow execute live, step by step."},{id:"docs",path:"/chat",target:'[data-tour="nav-docs"]',placement:"bottom",title:"Need the API?",body:"FLUJO exposes an OpenAI-compatible API and a full REST surface. The Docs page lists every endpoint with its method, parameters, and response shape.\n\nYou can re-run this tour any time from Settings → Onboarding."},{id:"finish",path:"/chat",placement:"center",title:"You're all set \uD83C\uDF89",body:"That's the whole loop: models, tools, flows, and chat.\n\nExplore at your own pace — and remember the Docs page and Settings are there when you need them."}]},84869:(e,t,r)=>{"use strict";r.d(t,{G:()=>s,S:()=>o});let a=(0,r(87021).h)("frontend/services/transcription/webSpeech"),n=()=>"webkitSpeechRecognition"in window||"SpeechRecognition"in window;async function o(e,t){if(!n())throw Error("Web Speech API is not supported in this browser");a.debug("Starting Web Speech API transcription");try{let r=URL.createObjectURL(e),n=new Audio(r),o=new(window.SpeechRecognition||window.webkitSpeechRecognition);return o.continuous=!0,o.interimResults=!0,(null==t?void 0:t.language)&&(o.lang=t.language),new Promise((e,r)=>{let s="";o.onresult=e=>{let r="";for(let t=e.resultIndex;t<e.results.length;t++){let a=e.results[t][0].transcript;e.results[t].isFinal?s+=a+" ":r+=a}(null==t?void 0:t.onInterimResult)&&t.onInterimResult(s+r),a.debug("Recognition interim result",{finalLength:s.length,interimLength:r.length})},o.onend=()=>{a.debug("Recognition ended",{transcriptLength:s.length}),e(s.trim())},o.onerror=e=>{a.error("Recognition error",{error:e.error}),r(Error("Speech recognition error: ".concat(e.error)))},n.onplay=()=>{o.start(),a.debug("Recognition started")},n.onended=()=>{o.stop(),a.debug("Audio playback ended")},n.onerror=e=>{a.error("Audio playback error",{error:e}),o.stop(),r(Error("Error playing audio"))},n.play().catch(e=>{a.error("Error starting audio playback",{error:e}),r(e)})})}catch(e){throw a.error("Error in Web Speech API transcription",{error:e}),e}}function s(){return{supported:n(),message:n()?"Web Speech API is supported":"Web Speech API is not supported in this browser"}}},96040:(e,t,r)=>{Promise.resolve().then(r.bind(r,49215))}},e=>{e.O(0,[2678,4754,9244,3392,1871,7111,2003,9562,488,3272,3077,3659,8598,6404,3560,9164,8855,8441,1255,7358],()=>e(e.s=96040)),_N_E=e.O()}]);
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[4662,9195],{748:(e,t,r)=>{"use strict";r.d(t,{kY:()=>o,Ic:()=>i});var a=r(26796),n=r(87021);let o={light:{background:"#FFFFFF",foreground:"#2C3E50",surface:"#F5F6FA",surfaceRaised:"#FFFFFF",paperBackground:"#F5F6FA",textSecondary:"#7F8C8D",textDisabled:"#9CA3AF",border:"#e5e7eb",heading:"#111",text:"#333",secondaryText:"#666",error:{background:"#fef2f2",border:"#fecaca",text:"#dc2626"},domain:{resource:"#009688",resourceSoft:"#4DB6AC",signal:"#7E57C2",startNode:"#795548",codeBackground:"#f5f5f5",http:{get:"#2e7d32",post:"#1565c0",put:"#e65100",patch:"#6a1b9a",delete:"#c62828"},transport:{stdio:{fg:"#1976d2",bg:"#e3f2fd"},websocket:{fg:"#2e7d32",bg:"#e8f5e8"},sse:{fg:"#f57c00",bg:"#fff3e0"},streamable:{fg:"#00796b",bg:"#e0f2f1"},default:{fg:"#757575",bg:"#f5f5f5"}}}},dark:{background:"#0f1319",foreground:"#eef1f5",surface:"#1a212b",surfaceRaised:"#242d3a",paperBackground:"#1a212b",textSecondary:"#b4bdca",textDisabled:"#6b7280",border:"#37404e",heading:"#f5f7fa",text:"#eef1f5",secondaryText:"#b4bdca",error:{background:"#2a1618",border:"#5a2a2e",text:"#ff6b6b"},domain:{resource:"#26a69a",resourceSoft:"#4DB6AC",signal:"#9575CD",startNode:"#a1887f",codeBackground:"#242d3a",http:{get:"#66bb6a",post:"#5b9dff",put:"#ffa726",patch:"#ba68c8",delete:"#ef5350"},transport:{stdio:{fg:"#90caf9",bg:"#1e2a3a"},websocket:{fg:"#a5d6a7",bg:"#1e2e22"},sse:{fg:"#ffcc80",bg:"#33281a"},streamable:{fg:"#80cbc4",bg:"#17322e"},default:{fg:"#b4bdca",bg:"#242d3a"}}}}},s=(0,n.h)("frontend/utils/theme");function i(){let{isDarkMode:e}=(0,a.useTheme)();return s.debug("useThemeUtils called with isDarkMode: ".concat(e)),{getThemeValue:(t,r)=>e?r:t,getThemeColor:t=>{let r=t.split("."),a=o[e?"dark":"light"];for(let e of r)if(!a||"object"!=typeof a||!(e in a))return s.warn("Theme color path not found: ".concat(t)),"";else a=a[e];return a},colors:e?o.dark:o.light,isDarkMode:e}}},17325:(e,t,r)=>{"use strict";r.d(t,{A:()=>b});var a=r(12115),n=r(2821),o=r(57001),s=r(48116),i=r(16625),l=r(85795),d=r(95195);function c(e){return(0,d.Ay)("MuiFormGroup",e)}(0,l.A)("MuiFormGroup",["root","row","error"]);var u=r(45918),h=r(75108),p=r(95155);let x=(0,s.Ay)("div",{name:"MuiFormGroup",slot:"Root",overridesResolver:(e,t)=>{let{ownerState:r}=e;return[t.root,r.row&&t.row]}})({display:"flex",flexDirection:"column",flexWrap:"wrap",variants:[{props:{row:!0},style:{flexDirection:"row"}}]}),b=a.forwardRef(function(e,t){let r=(0,i.b)({props:e,name:"MuiFormGroup"}),{className:a,row:s=!1,...l}=r,d=(0,u.A)(),b=(0,h.A)({props:r,muiFormControl:d,states:["error"]}),m={...r,row:s,error:b.error},g=(e=>{let{classes:t,row:r,error:a}=e;return(0,o.A)({root:["root",r&&"row",a&&"error"]},c,t)})(m);return(0,p.jsx)(x,{className:(0,n.A)(g.root,a),ownerState:m,ref:t,...l})})},21422:(e,t,r)=>{"use strict";r.d(t,{A:()=>o});var a=r(15485),n=r(95155);let o=(0,a.A)((0,n.jsx)("path",{d:"M18 8h-1V6c0-2.76-2.24-5-5-5S7 3.24 7 6v2H6c-1.1 0-2 .9-2 2v10c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V10c0-1.1-.9-2-2-2M9 6c0-1.66 1.34-3 3-3s3 1.34 3 3v2H9zm9 14H6V10h12zm-6-3c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2"}),"LockOutlined")},26796:(e,t,r)=>{"use strict";r.r(t),r.d(t,{ThemeProvider:()=>p,useTheme:()=>x});var a=r(95155),n=r(12115),o=r(87021),s=r(7160),i=r(29197),l=r(748),d=r(84563),c=r(29692);let u=(0,o.h)("frontend/contexts/ThemeContext"),h=(0,n.createContext)(void 0),p=e=>{let{children:t}=e,[r,o]=(0,n.useState)(!1),[p,x]=(0,n.useState)(!1);(0,n.useEffect)(()=>{(async()=>{u.debug("Loading theme preference from storage");let e=await (0,c.YM)(c.Zg.THEME,"light");u.info("Theme loaded from storage: ".concat(e));let t="dark"===e;x(t),t?document.documentElement.classList.add("dark-theme"):document.documentElement.classList.remove("dark-theme"),o(!0)})()},[]);let b=(0,n.useMemo)(()=>(function(e){let t="dark"===e?l.kY.dark:l.kY.light,r="dark"===e;return(0,i.A)({palette:{mode:e,primary:{main:r?"#4f93f5":"#007bff",light:r?"#6aa6f7":"#3395ff",dark:r?"#3a7ad4":"#0056b3"},secondary:{main:r?"#a3adba":"#6c757d"},error:{main:r?"#ff6b6b":"#dc2626",light:r?"#5a2a2e":"#fecaca",dark:r?"#2a1618":"#b91c1c"},warning:{main:r?"#e0a23c":"#f59e0b"},info:{main:r?"#56b6d6":"#3b82f6"},success:{main:r?"#3fae72":"#16a34a"},divider:t.border,background:{default:t.background,paper:t.surface},text:{primary:t.foreground,secondary:t.textSecondary,disabled:t.textDisabled}},typography:{fontFamily:"var(--font-geist-sans), Arial, sans-serif",h1:{fontWeight:700},h2:{fontWeight:700},h3:{fontWeight:600},h4:{fontWeight:600},h5:{fontWeight:600},h6:{fontWeight:600}},components:{MuiButton:{styleOverrides:{root:{textTransform:"none",borderRadius:"0.375rem"}}},MuiPaper:{styleOverrides:{root:{borderRadius:"0.5rem",backgroundImage:"none"}}},MuiTextField:{styleOverrides:{root:{"& .MuiOutlinedInput-root":{borderRadius:"0.375rem"}}}},MuiCard:{styleOverrides:{root:{borderRadius:"0.5rem",border:r?"1px solid ".concat(t.border):void 0,boxShadow:r?"0 4px 6px -1px rgba(0, 0, 0, 0.4), 0 2px 4px -1px rgba(0, 0, 0, 0.3)":"0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06)"}}},MuiMenu:{styleOverrides:{paper:{backgroundColor:t.surfaceRaised,backgroundImage:"none"}}},MuiPopover:{styleOverrides:{paper:{backgroundColor:t.surfaceRaised,backgroundImage:"none"}}},MuiTooltip:{styleOverrides:{tooltip:r?{backgroundColor:t.surfaceRaised,border:"1px solid ".concat(t.border),color:t.foreground}:void 0}}}})})(p?"dark":"light"),[p]);return u.debug("Rendering ThemeProvider with isDarkMode: ".concat(p)),(0,a.jsx)(h.Provider,{value:{toggleTheme:()=>{x(e=>{let t=!e,r=t?"dark":"light";return u.info("Toggling theme to: ".concat(r)),t?document.documentElement.classList.add("dark-theme"):document.documentElement.classList.remove("dark-theme"),(0,c.VH)(c.Zg.THEME,r),t})},isDarkMode:p},children:(0,a.jsxs)(s.A,{theme:b,children:[(0,a.jsx)(d.Ay,{}),t]})})},x=()=>{let e=(0,n.useContext)(h);if(!e)throw u.error("useTheme hook used outside of ThemeProvider"),Error("useTheme must be used within a ThemeProvider");return u.debug("useTheme hook accessed"),e}},48363:(e,t,r)=>{"use strict";r.d(t,{A:()=>o});var a=r(15485),n=r(95155);let o=(0,a.A)((0,n.jsx)("path",{d:"M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76 0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71 0-3.1-1.39-3.1-3.1M8 13h8v-2H8zm9-6h-4v1.9h4c1.71 0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76 0 5-2.24 5-5s-2.24-5-5-5"}),"Link")},49215:(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>es});var a=r(95155),n=r(94049),o=r(12115),s=r(25635),i=r(98267),l=r(20537),d=r(37960),c=r(63186),u=r(22003),h=r(28548),p=r(2300),x=r(9562),b=r(56422),m=r(41983),g=r(91871),f=r(21422),y=r(15485);let v=(0,y.A)((0,a.jsx)("path",{d:"M18 8h-1V6c0-2.76-2.24-5-5-5S7 3.24 7 6h2c0-1.66 1.34-3 3-3s3 1.34 3 3v2H6c-1.1 0-2 .9-2 2v10c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V10c0-1.1-.9-2-2-2m0 12H6V10h12zm-6-3c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2"}),"LockOpenOutlined");var j=r(68212),k=r(42063),A=r(9164);function w(){let{setKey:e,changeKey:t,verifyKey:r,isEncryptionInitialized:i,isUserEncryptionEnabled:l}=(0,A.useStorage)(),[d,c]=(0,o.useState)(""),[y,w]=(0,o.useState)(""),[S,C]=(0,o.useState)(!1),[E,P]=(0,o.useState)(""),[T,R]=(0,o.useState)(""),[F,O]=(0,o.useState)(!1),[M,I]=(0,o.useState)(!1),[W,B]=(0,o.useState)(null),[D,z]=(0,o.useState)(!1),[L,V]=(0,o.useState)(!1),[U,N]=(0,o.useState)(!1),H=()=>{setTimeout(()=>window.location.reload(),800)};(0,o.useEffect)(()=>{(async()=>{let e=await i(),t=await l();z(e),V(t)})()},[i,l]);let K=async t=>{t.preventDefault(),N(!0),B(null);try{if(d.length<12){B({type:"error",text:"Encryption password must be at least 12 characters long for security"}),N(!1);return}if(d!==y){B({type:"error",text:"Passwords do not match"}),N(!1);return}await e(d),B({type:"success",text:"Encryption password set successfully"}),c(""),w(""),z(!0),H()}catch(e){B({type:"error",text:"Failed to set encryption password"})}finally{N(!1)}},G=async e=>{e.preventDefault(),N(!0),B(null);try{if(T.length<12){B({type:"error",text:"New password must be at least 12 characters long for security"}),N(!1);return}if(!await r(E)){B({type:"error",text:"Current password is incorrect"}),N(!1);return}await t(E,T)?(B({type:"success",text:"Encryption password changed successfully"}),P(""),R(""),H()):B({type:"error",text:"Failed to change encryption password"})}catch(e){B({type:"error",text:"An error occurred while changing the password"})}finally{N(!1)}};return(0,a.jsxs)(n.default,{sx:{width:"100%"},children:[(0,a.jsx)(s.default,{variant:"h6",gutterBottom:!0,children:"Encryption Settings"}),(0,a.jsx)(s.default,{variant:"body2",color:"text.secondary",sx:{mb:3},children:"Set an encryption password to secure sensitive data like API keys and credentials. This password is used to encrypt your data and is never stored directly."}),W&&(0,a.jsx)(u.A,{severity:W.type,sx:{mb:3},children:W.text}),(0,a.jsxs)(n.default,{sx:{display:"flex",alignItems:"center",mb:3},children:[(0,a.jsx)(s.default,{variant:"body1",sx:{mr:2},children:"Current encryption status:"}),D?L?(0,a.jsx)(h.A,{icon:(0,a.jsx)(f.A,{}),label:"Custom Password Protection",color:"success",variant:"outlined"}):(0,a.jsx)(h.A,{icon:(0,a.jsx)(v,{}),label:"Default Encryption",color:"primary",variant:"outlined"}):(0,a.jsx)(h.A,{label:"No Encryption",color:"error",variant:"outlined"})]}),D&&L?L?(0,a.jsxs)(p.A,{elevation:2,sx:{p:3},children:[(0,a.jsx)(s.default,{variant:"subtitle1",gutterBottom:!0,fontWeight:"bold",children:"Change Encryption Password"}),(0,a.jsx)(s.default,{variant:"body2",color:"text.secondary",sx:{mb:2},children:"You can change your custom encryption password here. This will re-encrypt your data with the new password. Your data will remain intact."}),(0,a.jsxs)(n.default,{component:"form",onSubmit:G,children:[(0,a.jsx)(x.A,{fullWidth:!0,label:"Current Password",variant:"outlined",value:E,onChange:e=>P(e.target.value),type:F?"text":"password",InputProps:{endAdornment:(0,a.jsx)(b.A,{position:"end",children:(0,a.jsx)(m.A,{"aria-label":"toggle current password visibility",onClick:()=>O(!F),edge:"end",children:F?(0,a.jsx)(j.A,{}):(0,a.jsx)(k.A,{})})})},sx:{mb:2}}),(0,a.jsx)(x.A,{fullWidth:!0,label:"New Password",variant:"outlined",value:T,onChange:e=>R(e.target.value),type:M?"text":"password",InputProps:{endAdornment:(0,a.jsx)(b.A,{position:"end",children:(0,a.jsx)(m.A,{"aria-label":"toggle new password visibility",onClick:()=>I(!M),edge:"end",children:M?(0,a.jsx)(j.A,{}):(0,a.jsx)(k.A,{})})})},sx:{mb:3}}),(0,a.jsx)(g.A,{type:"submit",variant:"contained",color:"primary",disabled:!E||!T||U,children:"Change Password"})]})]}):null:(0,a.jsxs)(p.A,{elevation:2,sx:{p:3,mb:4},children:[(0,a.jsx)(s.default,{variant:"subtitle1",gutterBottom:!0,fontWeight:"bold",children:"Set Custom Encryption Password"}),(0,a.jsx)(s.default,{variant:"body2",color:"text.secondary",sx:{mb:2},children:D?"Your data is currently protected with default encryption. Set a custom password for enhanced security.":"Create a strong password to protect your sensitive data. Make sure to remember this password as it cannot be recovered if lost."}),(0,a.jsxs)(n.default,{component:"form",onSubmit:K,children:[(0,a.jsx)(x.A,{fullWidth:!0,label:"New Password",variant:"outlined",value:d,onChange:e=>c(e.target.value),type:S?"text":"password",InputProps:{endAdornment:(0,a.jsx)(b.A,{position:"end",children:(0,a.jsx)(m.A,{"aria-label":"toggle password visibility",onClick:()=>C(!S),edge:"end",children:S?(0,a.jsx)(j.A,{}):(0,a.jsx)(k.A,{})})})},sx:{mb:2}}),(0,a.jsx)(x.A,{fullWidth:!0,label:"Confirm Password",variant:"outlined",value:y,onChange:e=>w(e.target.value),type:S?"text":"password",sx:{mb:3}}),(0,a.jsx)(g.A,{type:"submit",variant:"contained",color:"primary",disabled:!d||!y||U,children:D?"Upgrade to Custom Password":"Set Encryption Password"})]})]}),(0,a.jsx)(n.default,{sx:{mt:4},children:(0,a.jsxs)(u.A,{severity:L?"warning":"info",children:[(0,a.jsx)(s.default,{variant:"subtitle2",fontWeight:"bold",children:L?"Important Security Information":"About Default Encryption"}),L?(0,a.jsxs)(s.default,{variant:"body2",children:["• Your custom encryption password is never stored directly on the server",(0,a.jsx)("br",{}),"• If you forget your password, you will not be able to access your encrypted data",(0,a.jsx)("br",{}),"• Consider using a password manager to securely store this password"]}):(0,a.jsxs)(s.default,{variant:"body2",children:["• Your data is currently encrypted with a built-in default key",(0,a.jsx)("br",{}),"• This provides basic protection without requiring password setup",(0,a.jsx)("br",{}),"• For maximum security, set a custom password using the form above"]})]})})]})}var S=r(99944),C=r(9957),E=r(26796),P=r(87021);let T=(0,P.h)("frontend/components/Settings/ThemeSettings");function R(){let{isDarkMode:e,toggleTheme:t}=(0,E.useTheme)();return T.debug("Rendering ThemeSettings with isDarkMode: ".concat(e)),(0,a.jsxs)(n.default,{sx:{maxWidth:600},children:[(0,a.jsx)(s.default,{variant:"h6",gutterBottom:!0,children:"Theme Settings"}),(0,a.jsx)(s.default,{variant:"body2",color:"text.secondary",sx:{mb:2},children:"Customize the application appearance"}),(0,a.jsx)(S.A,{control:(0,a.jsx)(C.A,{checked:e,onChange:t,name:"darkMode"}),label:"Dark Mode"})]})}var F=r(71892),O=r(52397);function M(){let{globalEnvVars:e,setGlobalEnvVars:t,deleteGlobalEnvVar:r}=(0,A.useStorage)(),[i,l]=(0,o.useState)(null),d=async e=>{try{let r=Object.fromEntries(Object.entries(e).filter(e=>{let[t,r]=e;return"string"==typeof r||!r.metadata.isSecret||r.value!==O.gF}));await t(r),l({type:"success",text:"Global environment variables updated successfully"}),setTimeout(()=>{l(null)},3e3)}catch(e){l({type:"error",text:"Failed to update global environment variables"})}};return(0,a.jsxs)(n.default,{sx:{width:"100%"},children:[(0,a.jsx)(s.default,{variant:"body2",color:"text.secondary",sx:{mb:2},children:"Define global environment variables that can be bound to MCP servers. This allows you to manage API keys and other sensitive information in one place."}),i&&(0,a.jsx)(u.A,{severity:i.type,sx:{mb:2},children:i.text}),(0,a.jsx)(F.A,{serverName:"Global",initialEnv:e,onSave:d,onDelete:r})]})}var I=r(17325),W=r(22822),B=r(4474),D=r(21067),z=r(2778),L=r(52363),V=r(65036),U=r(50001),N=r(75912),H=r(27156);let K=(0,P.h)("frontend/components/Settings/BackupSettings"),G=[{key:"models",label:"Models",description:"AI model configurations",storageKey:H.Z.MODELS},{key:"mcpServers",label:"MCP Servers Configuration",description:"MCP server settings",storageKey:H.Z.MCP_SERVERS},{key:"mcpServersFolder",label:"MCP Servers Folder",description:"MCP server code and files",isFolder:!0},{key:"flows",label:"Flows",description:"Flow configurations",storageKey:H.Z.FLOWS},{key:"chatHistory",label:"Chat History",description:"Conversation history",storageKey:H.Z.CHAT_HISTORY},{key:"settings",label:"Settings",description:"Application settings",storageKey:H.Z.THEME},{key:"globalEnvVars",label:"Global Environment Variables",description:"Global environment variables",storageKey:H.Z.GLOBAL_ENV_VARS},{key:"encryptionKey",label:"Encryption Key",description:"Data encryption key",storageKey:H.Z.ENCRYPTION_KEY}];function Y(){let[e,t]=(0,o.useState)(G.reduce((e,t)=>({...e,[t.key]:!0}),{})),[r,i]=(0,o.useState)(G.reduce((e,t)=>({...e,[t.key]:!0}),{})),[l,d]=(0,o.useState)(null),c=(0,o.useRef)(null),[h,x]=(0,o.useState)(null),[b,m]=(0,o.useState)(!1),[f,y]=(0,o.useState)(!1),v=r=>{t({...e,[r.target.name]:r.target.checked})},j=e=>{i({...r,[e.target.name]:e.target.checked})},k=async()=>{K.debug("Creating backup with selections:",e),m(!0),x(null);try{let t=Object.entries(e).filter(e=>{let[t,r]=e;return r}).map(e=>{let[t]=e;return t});if(0===t.length){x({type:"error",text:"Please select at least one item to backup"}),m(!1);return}let r=await fetch("/api/backup",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({selections:t})});if(!r.ok)throw Error("Failed to create backup");let a=await r.blob(),n=window.URL.createObjectURL(a),o=document.createElement("a");o.style.display="none",o.href=n;let s=new Date().toISOString().replace(/[:.]/g,"-").substring(0,19);o.download="flujo-backup-".concat(s,".zip"),document.body.appendChild(o),o.click(),window.URL.revokeObjectURL(n),document.body.removeChild(o),x({type:"success",text:"Backup created successfully"})}catch(e){K.error("Error creating backup:",e),x({type:"error",text:e instanceof Error?e.message:"Failed to create backup"})}finally{m(!1)}},A=async()=>{K.debug("Restoring from backup with selections:",r),m(!0),x(null),y(!1);try{let e=Object.entries(r).filter(e=>{let[t,r]=e;return r}).map(e=>{let[t]=e;return t}),t=new FormData;t.append("file",l),t.append("selections",JSON.stringify(e));let a=await fetch("/api/restore",{method:"POST",body:t});if(!a.ok){let e=await a.json();throw Error(e.error||"Failed to restore from backup")}x({type:"success",text:"Restore completed successfully. You may need to refresh the page to see the changes."}),c.current&&(c.current.value=""),d(null)}catch(e){K.error("Error restoring from backup:",e),x({type:"error",text:e instanceof Error?e.message:"Failed to restore from backup"})}finally{m(!1)}},w=r=>{let a={...e};G.forEach(e=>{a[e.key]=r}),t(a)},C=e=>{let t={...r};G.forEach(r=>{t[r.key]=e}),i(t)};return(0,a.jsxs)(n.default,{sx:{width:"100%"},children:[(0,a.jsx)(s.default,{variant:"h6",gutterBottom:!0,children:"Backup and Restore"}),(0,a.jsx)(s.default,{variant:"body2",color:"text.secondary",sx:{mb:2},children:"Create backups of your application data or restore from a previous backup."}),h&&(0,a.jsx)(u.A,{severity:h.type,sx:{mb:2},children:h.text}),(0,a.jsxs)(p.A,{sx:{p:3,mb:3},children:[(0,a.jsx)(s.default,{variant:"subtitle1",gutterBottom:!0,fontWeight:"bold",children:"Create Backup"}),(0,a.jsx)(s.default,{variant:"body2",color:"text.secondary",sx:{mb:2},children:"Select the components you want to include in the backup."}),(0,a.jsxs)(n.default,{sx:{mb:2},children:[(0,a.jsx)(g.A,{size:"small",onClick:()=>w(!0),sx:{mr:1},children:"Select All"}),(0,a.jsx)(g.A,{size:"small",onClick:()=>w(!1),children:"Deselect All"})]}),(0,a.jsx)(I.A,{sx:{mb:3},children:G.map(t=>(0,a.jsx)(S.A,{control:(0,a.jsx)(W.A,{checked:e[t.key],onChange:v,name:t.key}),label:(0,a.jsxs)(n.default,{children:[(0,a.jsx)(s.default,{variant:"body1",children:t.label}),(0,a.jsx)(s.default,{variant:"body2",color:"text.secondary",children:t.description})]})},t.key))}),(0,a.jsx)(g.A,{variant:"contained",onClick:k,disabled:b||Object.values(e).every(e=>!e),startIcon:b?(0,a.jsx)(B.default,{size:20}):null,children:b?"Creating Backup...":"Create Backup"})]}),(0,a.jsxs)(p.A,{sx:{p:3},children:[(0,a.jsx)(s.default,{variant:"subtitle1",gutterBottom:!0,fontWeight:"bold",children:"Restore from Backup"}),(0,a.jsx)(s.default,{variant:"body2",color:"text.secondary",sx:{mb:2},children:"Select a backup file and choose which components to restore."}),(0,a.jsxs)(n.default,{sx:{mb:3},children:[(0,a.jsxs)(g.A,{variant:"outlined",component:"label",sx:{mb:2},children:["Select Backup File",(0,a.jsx)("input",{type:"file",hidden:!0,accept:".zip",onChange:e=>{let t=e.target.files;t&&t.length>0&&(d(t[0]),x(null))},ref:c})]}),l&&(0,a.jsxs)(s.default,{variant:"body2",sx:{ml:1},children:["Selected file: ",l.name]})]}),(0,a.jsx)(D.A,{sx:{mb:2}}),(0,a.jsx)(s.default,{variant:"subtitle2",gutterBottom:!0,children:"Restore Options"}),(0,a.jsxs)(n.default,{sx:{mb:2},children:[(0,a.jsx)(g.A,{size:"small",onClick:()=>C(!0),sx:{mr:1},children:"Select All"}),(0,a.jsx)(g.A,{size:"small",onClick:()=>C(!1),children:"Deselect All"})]}),(0,a.jsx)(I.A,{sx:{mb:3},children:G.map(e=>(0,a.jsx)(S.A,{control:(0,a.jsx)(W.A,{checked:r[e.key],onChange:j,name:e.key}),label:(0,a.jsxs)(n.default,{children:[(0,a.jsx)(s.default,{variant:"body1",children:e.label}),(0,a.jsx)(s.default,{variant:"body2",color:"text.secondary",children:e.description})]})},e.key))}),(0,a.jsx)(g.A,{variant:"contained",color:"warning",onClick:()=>l?0===Object.entries(r).filter(e=>{let[t,r]=e;return r}).map(e=>{let[t]=e;return t}).length?void x({type:"error",text:"Please select at least one item to restore"}):void y(!0):void x({type:"error",text:"Please select a backup file"}),disabled:b||!l||Object.values(r).every(e=>!e),startIcon:b?(0,a.jsx)(B.default,{size:20}):null,children:b?"Restoring...":"Restore from Backup"})]}),(0,a.jsxs)(z.A,{open:f,onClose:()=>y(!1),children:[(0,a.jsx)(L.A,{children:"Confirm Restore"}),(0,a.jsx)(V.A,{children:(0,a.jsx)(U.A,{children:"This will overwrite your existing data with the contents of the backup file. This action cannot be undone. Are you sure you want to continue?"})}),(0,a.jsxs)(N.A,{children:[(0,a.jsx)(g.A,{onClick:()=>y(!1),children:"Cancel"}),(0,a.jsx)(g.A,{onClick:A,color:"warning",variant:"contained",children:"Restore"})]})]})]})}var _=r(52641),J=r(84869);function Z(){let{settings:e,updateSettings:t}=(0,A.useStorage)(),r=(0,J.G)(),o=(null==e?void 0:e.speech)||{enabled:!0};return(0,a.jsxs)(n.default,{sx:{p:2},children:[!r.supported&&(0,a.jsx)(u.A,{severity:"warning",sx:{mb:3},children:"Speech recognition is not supported in your browser. Please use Chrome, Edge, or Safari for the best experience."}),(0,a.jsxs)(_.A,{fullWidth:!0,sx:{mb:3},children:[(0,a.jsx)(S.A,{control:(0,a.jsx)(C.A,{checked:o.enabled,onChange:r=>{t({...e,speech:{...o,enabled:r.target.checked}})},name:"enabled",disabled:!r.supported}),label:"Enable speech recognition"}),(0,a.jsx)(s.default,{variant:"body2",color:"text.secondary",sx:{mt:1},children:"When enabled, audio recordings will be transcribed using your browser's built-in offfline speech recognition capabilities."})]}),(0,a.jsxs)(p.A,{variant:"outlined",sx:{p:2,mb:3},children:[(0,a.jsx)(s.default,{variant:"subtitle2",gutterBottom:!0,children:"Speech Recognition Information"}),(0,a.jsxs)(n.default,{sx:{display:"flex",justifyContent:"space-between",mb:1},children:[(0,a.jsx)(s.default,{variant:"body2",children:"Technology:"}),(0,a.jsx)(s.default,{variant:"body2",children:"Web Speech API"})]}),(0,a.jsxs)(n.default,{sx:{display:"flex",justifyContent:"space-between",mb:1},children:[(0,a.jsx)(s.default,{variant:"body2",children:"Processing:"}),(0,a.jsx)(s.default,{variant:"body2",children:"Browser-based"})]}),(0,a.jsxs)(n.default,{sx:{display:"flex",justifyContent:"space-between",mb:1},children:[(0,a.jsx)(s.default,{variant:"body2",children:"Language:"}),(0,a.jsx)(s.default,{variant:"body2",children:"Automatically uses browser language"})]}),(0,a.jsxs)(n.default,{sx:{display:"flex",justifyContent:"space-between",mb:1},children:[(0,a.jsx)(s.default,{variant:"body2",children:"Privacy:"}),(0,a.jsx)(s.default,{variant:"body2",children:"Depends on browser implementation"})]})]}),(0,a.jsx)(u.A,{severity:"info",sx:{mt:3},children:(0,a.jsx)(s.default,{variant:"body2",children:"Speech recognition quality may vary based on your browser, microphone quality, and background noise. For best results, speak clearly and use a good quality microphone."})})]})}(0,P.h)("frontend/components/Settings/SpeechRecognitionSettings");let q=(0,P.h)("frontend/components/Settings/UpdateSettings");function $(){let{settings:e,updateSettings:t}=(0,A.useStorage)(),r=(null==e?void 0:e.update)||{checkOnStartup:!1},[i,l]=(0,o.useState)(!1),[d,c]=(0,o.useState)(!1),[h,p]=(0,o.useState)(null),[x,b]=(0,o.useState)(null),m=null===x||"git"===x,f=async()=>{l(!0),p(null);try{let e=await fetch("/api/update"),t=await e.json();"string"==typeof t.updateMode&&b(t.updateMode),e.ok&&!1!==t.success?!1===t.isGitRepo?p({severity:"info",message:t.message}):t.updateAvailable?p({severity:"warning",message:"An update is available (".concat(t.behindBy," new commit").concat(1===t.behindBy?"":"s"," on ").concat(t.branch,").")}):p({severity:"success",message:"FLUJO is up to date (v".concat(t.currentVersion,").")}):p({severity:"error",message:t.error||"Failed to check for updates."})}catch(e){q.error("Update check failed",e),p({severity:"error",message:"Failed to check for updates."})}finally{l(!1)}},y=async()=>{c(!0),p({severity:"info",message:"Updating FLUJO - this may take a few minutes..."});try{let e=await fetch("/api/update",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"apply"})}),t=await e.json();if(!e.ok||!1===t.success){p({severity:"error",message:t.error||"Update failed."}),c(!1);return}if(p({severity:"success",message:t.message}),t.restarting){let e=!1,t=async()=>{try{if((await fetch("/api/cwd",{cache:"no-store"})).ok&&e)return void window.location.reload()}catch(t){e=!0}setTimeout(t,3e3)};setTimeout(t,5e3)}else c(!1)}catch(e){q.error("Update failed",e),p({severity:"error",message:"Update failed."}),c(!1)}};return(0,a.jsxs)(n.default,{sx:{p:2},children:[(0,a.jsxs)(_.A,{fullWidth:!0,sx:{mb:2},children:[(0,a.jsx)(S.A,{control:(0,a.jsx)(C.A,{checked:r.checkOnStartup,onChange:a=>{t({...e,update:{...r,checkOnStartup:a.target.checked}})},name:"checkOnStartup"}),label:"Check for updates on startup"}),(0,a.jsxs)(s.default,{variant:"body2",color:"text.secondary",sx:{mt:1},children:["When enabled, FLUJO checks GitHub for a newer version when the home page loads and shows a one-click update banner if one is available. Updates run ",(0,a.jsx)("code",{children:"git pull"})," + rebuild in your install folder; your data is preserved."]}),!m&&(0,a.jsxs)(s.default,{variant:"body2",color:"text.secondary",sx:{mt:1},children:["This install can't update itself in place","container"===x?" (running in Docker) — pull a newer image instead.":"npm"===x?" (installed via npm) — rerun with the latest version instead.":" — it is not running from a git clone."]})]}),(0,a.jsxs)(n.default,{sx:{display:"flex",gap:2,mb:2},children:[(0,a.jsxs)(g.A,{variant:"outlined",onClick:f,disabled:i||d,children:[i?(0,a.jsx)(B.default,{size:20,sx:{mr:1}}):null,"Check now"]}),(0,a.jsxs)(g.A,{variant:"contained",onClick:y,disabled:d||!m,children:[d?(0,a.jsx)(B.default,{size:20,sx:{mr:1}}):null,"Update now"]})]}),h&&(0,a.jsx)(u.A,{severity:h.severity,sx:{mt:1},children:h.message})]})}let Q=(0,y.A)((0,a.jsx)("path",{d:"M5 13.18v4L12 21l7-3.82v-4L12 17zM12 3 1 9l11 6 9-4.91V17h2V9z"}),"School");var X=r(69195);function ee(){let{startTour:e}=(0,X.useTour)();return(0,a.jsxs)(n.default,{sx:{p:2},children:[(0,a.jsx)(s.default,{variant:"body2",color:"text.secondary",sx:{mb:2},children:"The guided tour walks you through the full first-run path — adding a model, connecting an MCP tool server, building a flow, and running it in chat. It launches automatically the first time you open FLUJO; replay it any time below."}),(0,a.jsx)(g.A,{variant:"outlined",startIcon:(0,a.jsx)(Q,{}),onClick:e,children:"Replay guided tour"})]})}let et=(0,P.h)("frontend/components/Settings/ExperimentalFeaturesSettings");function er(){var e,t,r,o,i;let{settings:l,updateSettings:d}=(0,A.useStorage)(),c=null!=(e=null==l?void 0:l.experimental)?e:{enabled:!1};return(0,a.jsxs)(n.default,{sx:{p:2},children:[(0,a.jsxs)(_.A,{fullWidth:!0,sx:{mb:2},children:[(0,a.jsx)(S.A,{control:(0,a.jsx)(C.A,{checked:c.enabled,onChange:e=>{et.debug("Experimental features toggled: ".concat(e.target.checked)),d({...l,experimental:{...c,enabled:e.target.checked}})},name:"experimentalEnabled"}),label:"Enable Experimental Features"}),(0,a.jsxs)(s.default,{variant:"body2",color:"text.secondary",sx:{mt:1},children:["Experimental features may be incomplete or unstable and can change or be removed at any time. When enabled, they become visible in the app — for example the ",(0,a.jsx)("strong",{children:"Waves"})," entry in the top navigation."]})]}),(0,a.jsxs)(_.A,{fullWidth:!0,sx:{mb:2},children:[(0,a.jsx)(S.A,{control:(0,a.jsx)(C.A,{checked:null!=(t=c.claudeSessionResume)&&t,onChange:e=>{et.debug("Claude session resume toggled: ".concat(e.target.checked)),d({...l,experimental:{...c,claudeSessionResume:e.target.checked}})},name:"claudeSessionResume"}),label:"Reuse Claude session across turns (reduce token usage)"}),(0,a.jsxs)(s.default,{variant:"body2",color:"text.secondary",sx:{mt:1},children:["For models using the ",(0,a.jsx)("strong",{children:"Claude\xa0subscription"})," (Agent\xa0SDK) adapter, resume one session per node instead of re-sending the whole conversation each turn — so only the newest message is sent. This can dramatically cut token usage on long chats. It changes how conversation context reaches the model, so it is off by default; if you notice a model losing track of earlier context, turn it back off."]})]}),(0,a.jsxs)(_.A,{fullWidth:!0,sx:{mb:2},children:[(0,a.jsx)(S.A,{control:(0,a.jsx)(C.A,{checked:null!=(r=c.autoUnloadOllamaModels)&&r,onChange:e=>{et.debug("Auto-unload Ollama models toggled: ".concat(e.target.checked)),d({...l,experimental:{...c,autoUnloadOllamaModels:e.target.checked}})},name:"autoUnloadOllamaModels"}),label:"Auto-unload idle Ollama models"}),(0,a.jsx)(s.default,{variant:"body2",color:"text.secondary",sx:{mt:1},children:"When a flow switches between different Ollama models on the same server, automatically unload the previous model from VRAM before loading the new one. Recommended for GPU-constrained hardware. Note: concurrent Ollama requests to the same server are serialised while this is on."})]}),(0,a.jsxs)(_.A,{fullWidth:!0,sx:{mb:2},children:[(0,a.jsx)(S.A,{control:(0,a.jsx)(C.A,{checked:null!=(o=c.mcpBetaProtocol)&&o,onChange:e=>{et.debug("MCP beta protocol toggled: ".concat(e.target.checked)),d({...l,experimental:{...c,mcpBetaProtocol:e.target.checked}})},name:"mcpBetaProtocol"}),label:"MCP beta protocol (spec 2026-07-28)"}),(0,a.jsxs)(s.default,{variant:"body2",color:"text.secondary",sx:{mt:1},children:["Connect to MCP servers using the ",(0,a.jsx)("strong",{children:"v2 beta SDK"})," with automatic version negotiation: servers that already speak the new stateless 2026-07-28 protocol are used natively, and every other server transparently falls back to the classic handshake — so existing servers keep working. The beta SDK's API may still change before its stable release; if a server misbehaves with this on, turn it off and reconnect. Websocket servers always use the stable SDK. Changing this rebuilds server connections on their next use."]})]}),(0,a.jsxs)(_.A,{fullWidth:!0,sx:{mb:2},children:[(0,a.jsx)(S.A,{control:(0,a.jsx)(C.A,{checked:null!=(i=c.protectedPathsEnabled)&&i,onChange:e=>{et.debug("Protected paths toggled: ".concat(e.target.checked)),d({...l,experimental:{...c,protectedPathsEnabled:e.target.checked}})},name:"protectedPathsEnabled"}),label:"Protect sensitive home-directory paths"}),(0,a.jsxs)(s.default,{variant:"body2",color:"text.secondary",sx:{mt:1},children:["Add a defense-in-depth deny list to the built-in ",(0,a.jsx)("strong",{children:"filesystem"})," ","and ",(0,a.jsx)("strong",{children:"bash"})," MCP servers. When enabled, sensitive locations such as Documents, Desktop, Downloads, and credential directories remain blocked even when they are included in a configured root. This is off by default, so configured roots normally grant access to their full contents."]})]}),(0,a.jsx)(u.A,{severity:"info",children:(0,a.jsx)(s.default,{variant:"body2",children:"Turning this off again hides experimental features from the navigation. It does not delete any data."})})]})}var ea=r(68855);function en(){let[e,t]=(0,o.useState)("globalEnv"),r=e=>(r,a)=>{t(!!a&&e)};return(0,a.jsxs)(n.default,{sx:{p:3},children:[(0,a.jsx)(s.default,{variant:"h5",gutterBottom:!0,children:"Settings"}),(0,a.jsxs)(n.default,{sx:{mt:2},children:[(0,a.jsxs)(i.A,{expanded:"globalEnv"===e,onChange:r("globalEnv"),children:[(0,a.jsx)(l.A,{expandIcon:(0,a.jsx)(c.A,{}),"aria-controls":"globalEnv-content",id:"globalEnv-header",children:(0,a.jsx)(s.default,{variant:"h6",children:"Global Environment Variables"})}),(0,a.jsx)(d.A,{children:(0,a.jsx)(M,{})})]}),(0,a.jsxs)(i.A,{expanded:"encryption"===e,onChange:r("encryption"),children:[(0,a.jsx)(l.A,{expandIcon:(0,a.jsx)(c.A,{}),"aria-controls":"encryption-content",id:"encryption-header",children:(0,a.jsx)(s.default,{variant:"h6",children:"Encryption"})}),(0,a.jsx)(d.A,{children:(0,a.jsx)(w,{})})]}),(0,a.jsxs)(i.A,{expanded:"theme"===e,onChange:r("theme"),children:[(0,a.jsx)(l.A,{expandIcon:(0,a.jsx)(c.A,{}),"aria-controls":"theme-content",id:"theme-header",children:(0,a.jsx)(s.default,{variant:"h6",children:"Theme"})}),(0,a.jsx)(d.A,{children:(0,a.jsx)(R,{})})]}),(0,a.jsxs)(i.A,{expanded:"backup"===e,onChange:r("backup"),children:[(0,a.jsx)(l.A,{expandIcon:(0,a.jsx)(c.A,{}),"aria-controls":"backup-content",id:"backup-header",children:(0,a.jsx)(s.default,{variant:"h6",children:"Backup & Restore"})}),(0,a.jsx)(d.A,{children:(0,a.jsx)(Y,{})})]}),(0,a.jsxs)(i.A,{expanded:"speech"===e,onChange:r("speech"),children:[(0,a.jsx)(l.A,{expandIcon:(0,a.jsx)(c.A,{}),"aria-controls":"speech-content",id:"speech-header",children:(0,a.jsx)(s.default,{variant:"h6",children:"Speech Recognition"})}),(0,a.jsx)(d.A,{children:(0,a.jsx)(Z,{})})]}),(0,a.jsxs)(i.A,{expanded:"updates"===e,onChange:r("updates"),children:[(0,a.jsx)(l.A,{expandIcon:(0,a.jsx)(c.A,{}),"aria-controls":"updates-content",id:"updates-header",children:(0,a.jsx)(s.default,{variant:"h6",children:"Updates"})}),(0,a.jsx)(d.A,{children:(0,a.jsx)($,{})})]}),(0,a.jsxs)(i.A,{expanded:"onboarding"===e,onChange:r("onboarding"),children:[(0,a.jsx)(l.A,{expandIcon:(0,a.jsx)(c.A,{}),"aria-controls":"onboarding-content",id:"onboarding-header",children:(0,a.jsx)(s.default,{variant:"h6",children:"Onboarding"})}),(0,a.jsx)(d.A,{children:(0,a.jsx)(ee,{})})]}),(0,a.jsxs)(i.A,{expanded:"registry"===e,onChange:r("registry"),children:[(0,a.jsx)(l.A,{expandIcon:(0,a.jsx)(c.A,{}),"aria-controls":"registry-content",id:"registry-header",children:(0,a.jsx)(s.default,{variant:"h6",children:"Package Registry Account"})}),(0,a.jsx)(d.A,{children:(0,a.jsx)(ea.A,{})})]}),(0,a.jsxs)(i.A,{expanded:"experimental"===e,onChange:r("experimental"),children:[(0,a.jsx)(l.A,{expandIcon:(0,a.jsx)(c.A,{}),"aria-controls":"experimental-content",id:"experimental-header",children:(0,a.jsx)(s.default,{variant:"h6",children:"Experimental Features"})}),(0,a.jsx)(d.A,{children:(0,a.jsx)(er,{})})]})]})]})}let eo=(0,P.h)("app/settings/page");function es(){return eo.debug("Rendering SettingsPage"),(0,a.jsx)(n.default,{component:"main",sx:{minHeight:"100vh"},children:(0,a.jsx)(en,{})})}},52397:(e,t,r)=>{"use strict";r.d(t,{RJ:()=>n,gF:()=>a});let a="masked:********",n="********"},68212:(e,t,r)=>{"use strict";r.d(t,{A:()=>o});var a=r(15485),n=r(95155);let o=(0,a.A)((0,n.jsx)("path",{d:"M12 7c2.76 0 5 2.24 5 5 0 .65-.13 1.26-.36 1.83l2.92 2.92c1.51-1.26 2.7-2.89 3.43-4.75-1.73-4.39-6-7.5-11-7.5-1.4 0-2.74.25-3.98.7l2.16 2.16C10.74 7.13 11.35 7 12 7M2 4.27l2.28 2.28.46.46C3.08 8.3 1.78 10.02 1 12c1.73 4.39 6 7.5 11 7.5 1.55 0 3.03-.3 4.38-.84l.42.42L19.73 22 21 20.73 3.27 3zM7.53 9.8l1.55 1.55c-.05.21-.08.43-.08.65 0 1.66 1.34 3 3 3 .22 0 .44-.03.65-.08l1.55 1.55c-.67.33-1.41.53-2.2.53-2.76 0-5-2.24-5-5 0-.79.2-1.53.53-2.2m4.31-.78 3.15 3.15.02-.16c0-1.66-1.34-3-3-3z"}),"VisibilityOff")},69195:(e,t,r)=>{"use strict";r.r(t),r.d(t,{TourProvider:()=>c,useTour:()=>d});var a=r(95155),n=r(12115),o=r(9164),s=r(77326);let i=(0,r(87021).h)("frontend/contexts/TourContext"),l=(0,n.createContext)({isActive:!1,stepIndex:0,startTour:()=>{},next:()=>{},back:()=>{},endTour:()=>{}}),d=()=>(0,n.useContext)(l),c=e=>{var t;let{children:r}=e,{settings:d,updateSettings:c,isLoading:u,settingsHydrated:h}=(0,o.useStorage)(),[p,x]=(0,n.useState)(!1),[b,m]=(0,n.useState)(0),g=(0,n.useRef)(!1),f=(0,n.useCallback)(()=>{var e;c({...d,onboarding:{...null!=(e=d.onboarding)?e:{},completed:!0}}).catch(e=>i.warn("Failed to persist onboarding completion",e))},[d,c]),y=(0,n.useCallback)(()=>{i.info("Starting guided tour"),m(0),x(!0)},[]),v=(0,n.useCallback)(()=>{i.info("Ending guided tour"),x(!1),f()},[f]),j=(0,n.useCallback)(()=>{m(e=>e>=s.$.length-1?(x(!1),f(),e):e+1)},[f]),k=(0,n.useCallback)(()=>{m(e=>Math.max(0,e-1))},[]);return(0,n.useEffect)(()=>{var e;u||!h||g.current||(g.current=!0,(null==(e=d.onboarding)?void 0:e.completed)!==!0&&(i.info("First run detected — auto-starting guided tour"),y()))},[u,h,null==(t=d.onboarding)?void 0:t.completed,y]),(0,a.jsx)(l.Provider,{value:{isActive:p,stepIndex:b,startTour:y,next:j,back:k,endTour:v},children:r})}},71892:(e,t,r)=>{"use strict";r.d(t,{A:()=>P});var a=r(95155),n=r(12115),o=r(2300),s=r(94049),i=r(25635),l=r(91871),d=r(80777),c=r(33077),u=r(9562),h=r(56422),p=r(28548),x=r(99944),b=r(22822),m=r(41983),g=r(56682),f=r(87021),y=r(9164),v=r(86946),j=r(21422),k=r(12857),A=r(48363),w=r(4484),S=r(1877),C=r(52397);let E=(0,f.h)("frontend/components/mcp/MCPEnvManager/EnvEditor"),P=e=>{let{serverName:t,initialEnv:r,onSave:f,onDelete:P,onServerRestart:T}=e,{globalEnvVars:R}=(0,y.useStorage)(),[F,O]=(0,n.useState)([]),[M,I]=(0,n.useState)(!1),[W,B]=(0,n.useState)(!1),[D,z]=(0,n.useState)(!1),[L,V]=(0,n.useState)(null);(0,n.useEffect)(()=>{E.debug("Initializing environment variables for server: ".concat(t),{variableCount:Object.keys(r).length}),O(Object.entries(r).map(e=>{let[t,r]=e,a="object"==typeof r&&null!==r&&"value"in r?r.value:r,n="object"==typeof r&&null!==r&&"metadata"in r?r.metadata:{isSecret:(0,S.xc)(t)},o=a.match(/\$\{global:([^}]+)\}/);if(o){let e=o[1];return{key:t,value:a,isSecret:n.isSecret,isBound:!0,boundTo:e}}let s="string"==typeof a&&(a.startsWith("encrypted:")||a.startsWith("encrypted_failed:"));return{key:t,value:s?C.gF:a,isSecret:n.isSecret,isEncrypted:s}}))},[r]);let U=async e=>{E.debug("Removing environment variable at index: ".concat(e));let r=F[e];if("Global"===t&&P&&r.key)try{await P(r.key),O(F.filter((t,r)=>r!==e))}catch(e){E.error("Failed to delete environment variable: ".concat(r.key),e)}else O(F.filter((t,r)=>r!==e)),I(!0)},N=(e,t,r)=>{let a=[...F];if("isSecret"===t){let t=a[e];t.isSecret&&!r?a[e]={...t,isSecret:r,value:"",isEncrypted:!1,showWarning:!0}:a[e]={...t,isSecret:r}}else{let n={...a[e],[t]:r,isSecret:"key"===t?(0,S.xc)(r):a[e].isSecret};"key"===t&&(n.isValidKey=""===r||/^[a-zA-Z0-9_]+$/.test(r)),"value"===t&&(a[e].isEncrypted&&(n.isEncrypted=!1),a[e].showWarning&&r&&(n.showWarning=!1)),a[e]=n}O(a),I(!0)},H=async()=>{if(F.some(e=>""!==e.key&&!1===e.isValidKey))return void E.error("Cannot save: Some variable names contain invalid characters");E.debug("Saving environment variables for server: ".concat(t),{variableCount:F.length}),B(!0);try{let e=F.reduce((e,t)=>{let{key:r,value:a,isBound:n,boundTo:o,isSecret:s,isEncrypted:i}=t;return r&&(n&&o?e[r]={value:"${global:".concat(o,"}"),metadata:{isSecret:s}}:s&&a===C.gF||(e[r]={value:a,metadata:{isSecret:s}})),e},{});await f(e),I(!1),T&&"Global"!==t&&(E.debug("Restarting server after env variable changes: ".concat(t)),await T(t))}catch(e){E.error("Failed to save environment variables:",e)}B(!1)};return(0,a.jsxs)(o.A,{sx:{p:3,borderRadius:2,border:1,borderColor:e=>"dark"===e.palette.mode?"#3a3a3a":"#e5e7eb"},children:[(0,a.jsxs)(s.default,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",mb:3},children:[(0,a.jsxs)(i.default,{variant:"h6",sx:{fontWeight:"semibold"},children:["Environment Variables - ",t]}),(0,a.jsx)(l.A,{variant:"contained",color:"primary",size:"small",startIcon:(0,a.jsx)(v.A,{}),onClick:()=>{E.debug("Adding new environment variable"),O([...F,{key:"",value:"",isSecret:!1}]),I(!0)},children:"Add Variable"})]}),(0,a.jsx)(d.A,{spacing:3,children:F.map((e,t)=>(0,a.jsxs)(c.Ay,{container:!0,spacing:2,alignItems:"flex-start",children:[(0,a.jsx)(c.Ay,{item:!0,xs:12,sm:5,children:(0,a.jsx)(u.A,{fullWidth:!0,placeholder:"Variable name",value:e.key,onChange:e=>N(t,"key",e.target.value),error:!1===e.isValidKey,helperText:!1===e.isValidKey?"Only alphanumeric characters and underscores allowed":"",size:"small"})}),(0,a.jsx)(c.Ay,{item:!0,xs:12,sm:5,children:(0,a.jsx)(u.A,{fullWidth:!0,type:e.isSecret?"password":"text",placeholder:e.showWarning?"Re-enter value":"Value",value:e.value,onChange:e=>N(t,"value",e.target.value),InputProps:{readOnly:e.isBound,startAdornment:e.isEncrypted?(0,a.jsx)(h.A,{position:"start",children:(0,a.jsx)(j.A,{fontSize:"small",titleAccess:"This value is stored encrypted"})}):null,endAdornment:e.isBound?(0,a.jsx)(h.A,{position:"end",children:(0,a.jsx)(p.A,{size:"small",label:"Bound to global: ".concat(e.boundTo),color:"primary",variant:"outlined",onDelete:()=>(e=>{E.debug("Unbinding variable at index: ".concat(e));let t=[...F];t[e]={...t[e],isBound:!1,boundTo:void 0},O(t),I(!0)})(t),deleteIcon:(0,a.jsx)(k.A,{fontSize:"small"})})}):null},error:e.showWarning,helperText:e.showWarning?"You must re-enter the value after switching from secret to normal mode":"",size:"small",sx:{bgcolor:t=>e.isBound?"dark"===t.palette.mode?"#1a1a1a":"#f9fafb":t.palette.background.paper}})}),(0,a.jsx)(c.Ay,{item:!0,xs:12,sm:2,children:(0,a.jsxs)(s.default,{sx:{display:"flex",alignItems:"center",mt:.5},children:[(0,a.jsx)(x.A,{control:(0,a.jsx)(b.A,{checked:e.isSecret,onChange:e=>N(t,"isSecret",e.target.checked),size:"small"}),label:"Secret",sx:{mr:1}}),!e.isBound&&(0,a.jsx)(m.A,{size:"small",color:"primary",onClick:()=>(e=>{E.debug("Opening bind modal for variable at index: ".concat(e)),V(e),z(!0)})(t),title:"Bind to global variable",sx:{mr:1},children:(0,a.jsx)(A.A,{fontSize:"small"})}),(0,a.jsx)(m.A,{size:"small",color:"error",onClick:()=>U(t),title:"Remove variable",children:(0,a.jsx)(w.A,{fontSize:"small"})})]})})]},t))}),(0,a.jsx)(g.A,{open:D,onClose:()=>{z(!1),V(null)},children:(0,a.jsxs)(s.default,{sx:{position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)",width:400,maxWidth:"90%",bgcolor:"background.paper",boxShadow:24,p:4,borderRadius:2},children:[(0,a.jsx)(i.default,{variant:"h6",sx:{mb:2},children:"Bind to Global Variable"}),0===Object.keys(R).length?(0,a.jsx)(i.default,{color:"text.secondary",sx:{mb:2},children:"No global variables available. Add some in Settings first."}):(0,a.jsx)(s.default,{sx:{maxHeight:300,overflow:"auto",mb:2},children:Object.entries(R).map(e=>{let[t,r]=e;return(0,a.jsxs)(l.A,{fullWidth:!0,variant:"text",onClick:()=>(e=>{if(null!==L){E.debug("Binding variable at index ".concat(L," to global variable: ").concat(e));let t=[...F];t[L]={...t[L],isBound:!0,boundTo:e,value:"${global:".concat(e,"}")},O(t),z(!1),V(null),I(!0)}})(t),sx:{justifyContent:"space-between",textAlign:"left",mb:1,p:1,borderRadius:1},children:[(0,a.jsx)(i.default,{variant:"body2",children:t}),(0,a.jsx)(i.default,{variant:"caption",color:"text.secondary",children:r&&"object"==typeof r&&r.metadata&&r.metadata.isSecret?C.gF:r&&"object"==typeof r?r.value:r})]},t)})}),(0,a.jsx)(s.default,{sx:{display:"flex",justifyContent:"flex-end"},children:(0,a.jsx)(l.A,{variant:"outlined",onClick:()=>{z(!1),V(null)},children:"Cancel"})})]})}),M&&(0,a.jsx)(s.default,{sx:{display:"flex",justifyContent:"flex-end",mt:3},children:(0,a.jsx)(l.A,{variant:"contained",color:"success",onClick:H,disabled:W||F.some(e=>""!==e.key&&!1===e.isValidKey),children:W?"Saving...":"Save Changes"})})]})}},77326:(e,t,r)=>{"use strict";r.d(t,{$:()=>a});let a=[{id:"welcome",path:"/",placement:"center",title:"Welcome to FLUJO \uD83D\uDC4B",body:"This quick tour walks you through going from zero to a running AI flow.\n\nYou'll add a model, connect a tool server, build a flow, and run it in chat. It takes about a minute — you can skip any time."},{id:"add-model",path:"/models",target:'[data-tour="add-model"]',placement:"bottom",title:"1. Add a model",body:'FLUJO needs at least one AI model to think with. Click "Add Model" to configure one.\n\nTip: an OpenRouter API key gives you access to several free models — paste the key, name the model, pick a free one, and add a custom instruction.'},{id:"add-mcp-server",path:"/mcp",target:'[data-tour="add-mcp-server"]',placement:"bottom",title:"2. Connect a tool server (MCP)",body:'MCP servers give your model real tools — file access, image generation, web search, and more.\n\nClick "Add Server" and install the "Everything" reference server to try the full range of capabilities while you learn.'},{id:"new-flow",path:"/flows",target:'[data-tour="new-flow"]',placement:"bottom",title:"3. Build a flow",body:'A flow wires everything together. Click "New Flow" to open the builder.\n\nConnect Start → Process → Finish, attach your model to the Process node, and bind the Everything MCP server so the model can use its tools.'},{id:"chat-input",path:"/chat",target:'[data-tour="chat-input"]',placement:"top",title:"4. Run it in chat",body:"Pick your flow from the selector, then send a message here.\n\nTry asking it to generate an image with the MCP server and tell you a joke — you'll see the flow execute live, step by step."},{id:"docs",path:"/chat",target:'[data-tour="nav-docs"]',placement:"bottom",title:"Need the API?",body:"FLUJO exposes an OpenAI-compatible API and a full REST surface. The Docs page lists every endpoint with its method, parameters, and response shape.\n\nYou can re-run this tour any time from Settings → Onboarding."},{id:"finish",path:"/chat",placement:"center",title:"You're all set \uD83C\uDF89",body:"That's the whole loop: models, tools, flows, and chat.\n\nExplore at your own pace — and remember the Docs page and Settings are there when you need them."}]},84869:(e,t,r)=>{"use strict";r.d(t,{G:()=>s,S:()=>o});let a=(0,r(87021).h)("frontend/services/transcription/webSpeech"),n=()=>"webkitSpeechRecognition"in window||"SpeechRecognition"in window;async function o(e,t){if(!n())throw Error("Web Speech API is not supported in this browser");a.debug("Starting Web Speech API transcription");try{let r=URL.createObjectURL(e),n=new Audio(r),o=new(window.SpeechRecognition||window.webkitSpeechRecognition);return o.continuous=!0,o.interimResults=!0,(null==t?void 0:t.language)&&(o.lang=t.language),new Promise((e,r)=>{let s="";o.onresult=e=>{let r="";for(let t=e.resultIndex;t<e.results.length;t++){let a=e.results[t][0].transcript;e.results[t].isFinal?s+=a+" ":r+=a}(null==t?void 0:t.onInterimResult)&&t.onInterimResult(s+r),a.debug("Recognition interim result",{finalLength:s.length,interimLength:r.length})},o.onend=()=>{a.debug("Recognition ended",{transcriptLength:s.length}),e(s.trim())},o.onerror=e=>{a.error("Recognition error",{error:e.error}),r(Error("Speech recognition error: ".concat(e.error)))},n.onplay=()=>{o.start(),a.debug("Recognition started")},n.onended=()=>{o.stop(),a.debug("Audio playback ended")},n.onerror=e=>{a.error("Audio playback error",{error:e}),o.stop(),r(Error("Error playing audio"))},n.play().catch(e=>{a.error("Error starting audio playback",{error:e}),r(e)})})}catch(e){throw a.error("Error in Web Speech API transcription",{error:e}),e}}function s(){return{supported:n(),message:n()?"Web Speech API is supported":"Web Speech API is not supported in this browser"}}},96040:(e,t,r)=>{Promise.resolve().then(r.bind(r,49215))}},e=>{e.O(0,[2678,4754,9244,3392,1871,7111,2003,9562,488,3272,3077,3659,8598,6404,3560,9164,8855,8441,1255,7358],()=>e(e.s=96040)),_N_E=e.O()}]);