@marimo-team/frontend 0.19.3-dev17 → 0.19.3-dev21

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 (69) hide show
  1. package/dist/assets/{CellStatus-BwPGnX3z.js → CellStatus-DLqgbVV4.js} +1 -1
  2. package/dist/assets/{JsonOutput--AuyEErr.js → JsonOutput-B64aMW9B.js} +1 -1
  3. package/dist/assets/{MarimoErrorOutput-BZjY8e2w.js → MarimoErrorOutput-Cva6Gfqr.js} +1 -1
  4. package/dist/assets/{RenderHTML-BTLaM20B.js → RenderHTML-Daqo9pcD.js} +1 -1
  5. package/dist/assets/{add-cell-with-ai-BWWVs9qV.js → add-cell-with-ai-BsHIKGwv.js} +1 -1
  6. package/dist/assets/{add-database-form-Bw_YRH1r.js → add-database-form-hxk-QlNU.js} +1 -1
  7. package/dist/assets/{agent-panel-DXYuB421.js → agent-panel-ZJGfvLy4.js} +1 -1
  8. package/dist/assets/{ai-model-dropdown-BrUOgnWS.js → ai-model-dropdown-nzo8MLQ5.js} +1 -1
  9. package/dist/assets/{app-config-button-B8CXELx0.js → app-config-button-BeOl77GX.js} +1 -1
  10. package/dist/assets/{cell-editor-CQcpZLQc.js → cell-editor-c1P0x4Fj.js} +1 -1
  11. package/dist/assets/{cell-link-CFAPzUg5.js → cell-link-T1P92ttw.js} +1 -1
  12. package/dist/assets/{cells-DU3EySUd.js → cells-CibeVr5R.js} +1 -1
  13. package/dist/assets/{chat-components-Bc9j9ls4.js → chat-components-CVdyP1VW.js} +1 -1
  14. package/dist/assets/{chat-display-BrTi6c8V.js → chat-display-Bbzp0CzX.js} +1 -1
  15. package/dist/assets/{chat-panel-8Dym5Gv3.js → chat-panel-T30-embL.js} +1 -1
  16. package/dist/assets/{client-DfkWorYM.js → client-CEtu-2VG.js} +1 -1
  17. package/dist/assets/{column-preview-Ck6B_-sQ.js → column-preview-BlyFeHSu.js} +1 -1
  18. package/dist/assets/{command-B_minI8b.js → command-CyUURgqS.js} +1 -1
  19. package/dist/assets/{command-palette-BT3u6JBB.js → command-palette-DfiEH7WH.js} +1 -1
  20. package/dist/assets/{common-jorbwXZC.js → common-eyGhVBMz.js} +1 -1
  21. package/dist/assets/{datasource-DCvPlnaJ.js → datasource-D4vwmOLv.js} +1 -1
  22. package/dist/assets/{dependency-graph-panel-C9jYZ6pA.js → dependency-graph-panel-Cr-_H1bC.js} +1 -1
  23. package/dist/assets/{documentation-panel-AsatrTfg.js → documentation-panel-mdqxAzQf.js} +1 -1
  24. package/dist/assets/{download-PR1bF3g_.js → download-Bd63S7ca.js} +1 -1
  25. package/dist/assets/{edit-page-BvHKW1ab.js → edit-page-CgVMZsLj.js} +4 -4
  26. package/dist/assets/{error-panel-D_wVKV6I.js → error-panel-zDg8AjLO.js} +1 -1
  27. package/dist/assets/{es-CEE_7T0w.js → es-BMs8n9bF.js} +1 -1
  28. package/dist/assets/{file-explorer-panel-DltK8JVp.js → file-explorer-panel-Bvbp6xd9.js} +1 -1
  29. package/dist/assets/{floating-outline-BfdazXWm.js → floating-outline-DmKm2GKv.js} +1 -1
  30. package/dist/assets/{focus-CtlWIiQr.js → focus-BGO2qwac.js} +1 -1
  31. package/dist/assets/{form-Cy5TkLzh.js → form-Cs-aYOue.js} +1 -1
  32. package/dist/assets/{globals-BSLm1nlz.js → globals-BkITdONE.js} +1 -1
  33. package/dist/assets/{home-page-CEnaUutq.js → home-page-CqrJtZ_6.js} +1 -1
  34. package/dist/assets/{index-ImpEfS6x.js → index-DXLkhAK3.js} +3 -3
  35. package/dist/assets/{kiosk-mode-BnTZR6mM.js → kiosk-mode-Ocj2e3JE.js} +1 -1
  36. package/dist/assets/{layout-BTiWDrbh.js → layout-HXw-kbRR.js} +1 -1
  37. package/dist/assets/{logs-panel-Cnp9tO_1.js → logs-panel-C70PjyAu.js} +1 -1
  38. package/dist/assets/{markdown-renderer-BSrbBHwX.js → markdown-renderer-D2XRRGdl.js} +1 -1
  39. package/dist/assets/{mode-yhfN-4ye.js → mode-j1jRJgw_.js} +1 -1
  40. package/dist/assets/{name-cell-input-CmuWqgFR.js → name-cell-input-XHY7Ji2w.js} +1 -1
  41. package/dist/assets/{outline-panel-DCfj1bI-.js → outline-panel-DmehVoPZ.js} +1 -1
  42. package/dist/assets/{packages-panel-BiEckVdM.js → packages-panel-D8Dc0jXW.js} +1 -1
  43. package/dist/assets/{panels-BXRys72u.js → panels-DOPj-FZ7.js} +1 -1
  44. package/dist/assets/{process-output-wGlHkL-Q.js → process-output-DZorMbgK.js} +1 -1
  45. package/dist/assets/{readonly-python-code-xbh7G2Y2.js → readonly-python-code-CzWlUPo8.js} +1 -1
  46. package/dist/assets/{run-page-BCwJRhCq.js → run-page-B7UH5d5F.js} +1 -1
  47. package/dist/assets/{scratchpad-panel-ByFq6zUA.js → scratchpad-panel-BvjbLs06.js} +1 -1
  48. package/dist/assets/{session-panel-DuQl_oQp.js → session-panel-Cg2ez0A-.js} +1 -1
  49. package/dist/assets/{snippets-panel-R_ql6HGu.js → snippets-panel-BCzTzB9R.js} +1 -1
  50. package/dist/assets/{state-DEHWsmkM.js → state-BxWZf58F.js} +1 -1
  51. package/dist/assets/{state-DXAf-ejz.js → state-Eihpi8Gd.js} +1 -1
  52. package/dist/assets/{switch-CWzL-0WF.js → switch-Bf7BdNuP.js} +1 -1
  53. package/dist/assets/{textarea-CfvBt_Xm.js → textarea-BRmAhRr_.js} +1 -1
  54. package/dist/assets/{tracing-Kscqc1t3.js → tracing-1SYqHZWJ.js} +1 -1
  55. package/dist/assets/{tracing-panel-BEzOflWc.js → tracing-panel-Bcs0pfdJ.js} +2 -2
  56. package/dist/assets/{types-DhuSHMNQ.js → types-Dqr8wUa4.js} +1 -1
  57. package/dist/assets/{useAddCell-C9lbOVO1.js → useAddCell-BEZy0w8u.js} +1 -1
  58. package/dist/assets/{useCellActionButton-fsh9MTAX.js → useCellActionButton-BPZZpi7i.js} +1 -1
  59. package/dist/assets/{useDeleteCell-ByImoTpm.js → useDeleteCell-BIkFVvVx.js} +1 -1
  60. package/dist/assets/{useDependencyPanelTab-CngFbla0.js → useDependencyPanelTab-B4L5DuIf.js} +1 -1
  61. package/dist/assets/{useNotebookActions-D01w160c.js → useNotebookActions-N9jfUrVW.js} +1 -1
  62. package/dist/assets/{useRunCells-CmnSPQtM.js → useRunCells-d0gYuXYQ.js} +1 -1
  63. package/dist/assets/{useSplitCell-BTH64tve.js → useSplitCell-DGmYA9dE.js} +1 -1
  64. package/dist/assets/{utilities.esm-CMQs6YPp.js → utilities.esm-Bs_5S-OE.js} +1 -1
  65. package/dist/index.html +31 -31
  66. package/package.json +1 -1
  67. package/src/components/editor/renderers/vertical-layout/__tests__/useFocusFirstEditor.test.ts +27 -0
  68. package/src/components/editor/renderers/vertical-layout/useFocusFirstEditor.ts +6 -0
  69. package/src/core/cells/scrollCellIntoView.ts +3 -2
@@ -1,2 +1,2 @@
1
- var R0=Object.defineProperty;var U0=(o,e,t)=>e in o?R0(o,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):o[e]=t;var A0=(o,e,t)=>U0(o,typeof e!="symbol"?e+"":e,t);import{s as z0}from"./chunk-LvLJmgfZ.js";import{l as D0,u as j0}from"./useEvent-DlWF5OMa.js";import{t as W0}from"./react-BGmjiNul.js";import{qn as G0}from"./cells-DU3EySUd.js";import{t as $}from"./compiler-runtime-DeeZ7FnK.js";import{t as q0}from"./capitalize-DQeWKRGx.js";import{d as J0}from"./hotkeys-uKX61F1_.js";import{c as _0,n as X0,x as $0}from"./utils-CJJIceVn.js";import{t as e2}from"./jsx-runtime-DN_bIXfG.js";import{t as I0}from"./cn-C1rgT0yh.js";import{n as B0}from"./once-CTiSlR1m.js";import{r as t2}from"./requests-C0HaHO6a.js";import{t as i2}from"./createLucideIcon-CW2xpJ57.js";import{_ as o2}from"./select-D0g5GnIs.js";import{u as s2}from"./toDate-5JckKRQn.js";import{a as a2,c as e0,d as P0,f as S0,p as r2,r as n2,s as l2,t as d2,u as L0}from"./dropdown-menu-BP4_BZLr.js";import{t as t0}from"./tooltip-CvjcEpZC.js";import{t as C0}from"./multi-map-fjX9ImVF.js";var N0=i2("brain",[["path",{d:"M12 18V5",key:"adv99a"}],["path",{d:"M15 13a4.17 4.17 0 0 1-3-4 4.17 4.17 0 0 1-3 4",key:"1e3is1"}],["path",{d:"M17.598 6.5A3 3 0 1 0 12 5a3 3 0 1 0-5.598 1.5",key:"1gqd8o"}],["path",{d:"M17.997 5.125a4 4 0 0 1 2.526 5.77",key:"iwvgf7"}],["path",{d:"M18 18a4 4 0 0 0 2-7.464",key:"efp6ie"}],["path",{d:"M19.967 17.483A4 4 0 1 1 12 18a4 4 0 1 1-7.967-.517",key:"1gq6am"}],["path",{d:"M6 18a4 4 0 0 1-2-7.464",key:"k1g0md"}],["path",{d:"M6.003 5.125a4 4 0 0 0-2.526 5.77",key:"q97ue3"}]]),c2=$(),m2=o=>{switch(o){case"chat":return"chat_model";case"autocomplete":return"autocomplete_model";case"edit":return"edit_model"}};const O0=()=>{let o=(0,c2.c)(12),[e,t]=D0($0),{saveUserConfig:n}=t2(),r;o[0]!==n||o[1]!==t?(r=async h=>{await n({config:h}).then(()=>{t(u=>({...u,...h}))})},o[0]=n,o[1]=t,o[2]=r):r=o[2];let l=r,p;o[3]!==l||o[4]!==e?(p=async(h,u)=>{var v,f,s,k,x;let g=m2(u);g&&l({ai:{...e.ai,models:{custom_models:((f=(v=e.ai)==null?void 0:v.models)==null?void 0:f.custom_models)??[],displayed_models:((k=(s=e.ai)==null?void 0:s.models)==null?void 0:k.displayed_models)??[],...(x=e.ai)==null?void 0:x.models,[g]:h}}})},o[3]=l,o[4]=e,o[5]=p):p=o[5];let c=p,m;o[6]!==l||o[7]!==e?(m=async h=>{l({ai:{...e.ai,mode:h}})},o[6]=l,o[7]=e,o[8]=m):m=o[8];let a=m,d;return o[9]!==a||o[10]!==c?(d={saveModelChange:c,saveModeChange:a},o[9]=a,o[10]=c,o[11]=d):d=o[11],d},T0=["openai","anthropic","google","ollama","bedrock","deepseek","azure","github","openrouter","wandb","marimo"];var y=class s0{constructor(e,t){this.providerId=e,this.shortModelId=t}get id(){return`${this.providerId}/${this.shortModelId}`}static parse(e){if(!e.includes("/"))return new s0(p2(e),e);let[t,...n]=e.split("/");return new s0(t,n.join("/"))}};function p2(o){return o.startsWith("gpt")||o.startsWith("o3")||o.startsWith("o1")?"openai":o.startsWith("claude")?"anthropic":o.startsWith("gemini")||o.startsWith("google")?"google":o.startsWith("deepseek")?"deepseek":"ollama"}function i0(o){return T0.includes(o)}const h2=[{name:"Claude 4.5 Opus",model:"claude-opus-4-5",description:"Latest Opus model with enhanced capabilities and performance improvements",providers:["anthropic"],roles:["chat","edit"],thinking:!0},{name:"Claude 4.5 Sonnet",model:"claude-sonnet-4-5",description:"Latest Sonnet model with enhanced capabilities and performance improvements",providers:["anthropic"],roles:["chat","edit"],thinking:!0},{name:"Claude 4.1 Opus",model:"claude-opus-4-1",description:"Latest Opus model with enhanced capabilities and performance improvements",providers:["anthropic"],roles:["chat","edit"],thinking:!0},{name:"Claude 4 Opus",model:"claude-opus-4-0",description:"Most capable model with superior performance on complex tasks and reasoning",providers:["anthropic"],roles:["chat","edit"],thinking:!0},{name:"Claude 4 Sonnet",model:"claude-sonnet-4-0",description:"Next-generation Sonnet model with advanced reasoning and multimodal capabilities",providers:["anthropic"],roles:["chat","edit"],thinking:!0},{name:"Claude 3.7 Sonnet",model:"claude-3-7-sonnet-latest",description:"Enhanced Sonnet model with improved capabilities",providers:["anthropic"],roles:["chat","edit"],thinking:!1},{name:"Claude 3.5 Sonnet",model:"claude-3-5-sonnet-latest",description:"Balanced model with strong performance across reasoning, math, and coding",providers:["anthropic"],roles:["chat","edit"],thinking:!1},{name:"Claude 3.5 Haiku",model:"claude-3-5-haiku-latest",description:"Fast and efficient model with excellent performance for everyday tasks",providers:["anthropic"],roles:["chat","edit"],thinking:!1},{name:"Gemini 3.0 Pro",model:"gemini-3-pro-preview",description:"Most capable Gemini model with advanced reasoning and large context support",providers:["google"],roles:["chat","edit"],thinking:!0},{name:"Gemini 2.5 Pro",model:"gemini-2.5-pro",description:"Most capable Gemini model with advanced reasoning and large context support",providers:["google"],roles:["chat","edit"],thinking:!1},{name:"Gemini 2.5 Pro Experimental",model:"gemini-2.5-pro-exp",description:"Experimental version of Gemini 2.5 Pro with latest improvements",providers:["google"],roles:["chat","edit"],thinking:!1},{name:"Gemini 2.5 Flash",model:"gemini-2.5-flash",description:"Adaptive thinking, cost efficiency",providers:["google"],roles:["chat","edit"],thinking:!1},{name:"Gemini 2.5 Flash Lite",model:"gemini-2.5-flash-lite",description:"Most cost-efficient model supporting high throughput",providers:["google"],roles:["chat","edit"],thinking:!1},{name:"Gemini 2.0 Flash",model:"gemini-2.0-flash",description:"Next-generation Flash model with improved performance and capabilities",providers:["google"],roles:["chat","edit"],thinking:!1},{name:"Gemini 2.0 Flash Experimental",model:"gemini-2.0-flash-exp",description:"Experimental version of Gemini 2.0 Flash with cutting-edge features",providers:["google"],roles:["chat","edit"],thinking:!1},{name:"Gemini 2.0 Flash Lite",model:"gemini-2.0-flash-lite",description:"Lightweight version of Gemini 2.0 Flash optimized for efficiency",providers:["google"],roles:["chat","edit"],thinking:!1},{name:"Gemini 2.0 Flash Thinking",model:"gemini-2.0-flash-thinking-exp-01-21",description:"Specialized reasoning model with enhanced thinking capabilities",providers:["google"],roles:["chat"],thinking:!0},{name:"Gemini 1.5 Flash",model:"gemini-1.5-flash",description:"Fast and efficient model optimized for speed and everyday tasks",providers:["google"],roles:["chat","edit"],thinking:!1},{name:"Gemini 1.5 Flash 8B",model:"gemini-1.5-flash-8b",description:"Lightweight version of Gemini 1.5 Flash with 8 billion parameters",providers:["google"],roles:["chat","edit"],thinking:!1},{name:"Gemini 1.5 Pro",model:"gemini-1.5-pro",description:"Advanced model with superior reasoning capabilities and large context window",providers:["google"],roles:["chat","edit"],thinking:!1},{name:"GPT-5",model:"gpt-5",description:"The best model for coding and agentic tasks across domains",providers:["openai","azure","github"],roles:["chat","edit"],thinking:!1},{name:"GPT-5 Mini",model:"gpt-5-mini",description:"A faster, cost-efficient version of GPT-5 for well-defined tasks",providers:["openai","azure","github"],roles:["chat","edit"],thinking:!1},{name:"GPT-5 Nano",model:"gpt-5-nano",description:"Fastest, most cost-efficient version of GPT-5",providers:["openai","azure"],roles:["chat","edit"],thinking:!1},{name:"GPT-4.1",model:"gpt-4.1",description:"Fast, highly intelligent model with largest context window (1 million tokens)",providers:["openai","azure"],roles:["chat","edit"],thinking:!1},{name:"GPT-4.1 Mini",model:"gpt-4.1-mini",description:"Balanced for intelligence, speed, and cost",providers:["openai","azure"],roles:["chat","edit"],thinking:!1},{name:"GPT-4o",model:"gpt-4o",description:"Fast, intelligent, flexible GPT model with multimodal capabilities",providers:["openai","azure"],roles:["chat","edit"],thinking:!1},{name:"GPT-4o Mini",model:"gpt-4o-mini",description:"Fast, affordable small model for focused tasks",providers:["openai","azure","github"],roles:["chat","edit"],thinking:!1},{name:"o3",model:"o3",description:"Our most powerful reasoning model with chain-of-thought capabilities",providers:["openai","azure"],roles:["chat","edit"],thinking:!0},{name:"o3 Mini",model:"o3-mini",description:"A small model alternative to o3 for reasoning tasks",providers:["openai","azure"],roles:["chat","edit"],thinking:!0},{name:"o3 Pro",model:"o3-pro",description:"Version of o3 designed to think longer and provide most reliable responses",providers:["openai","azure"],roles:["chat","edit"],thinking:!0},{name:"o4 Mini",model:"o4-mini",description:"Faster, more affordable reasoning model optimized for math, coding, and visual tasks",providers:["openai","azure"],roles:["chat","edit"],thinking:!0},{name:"GPT-3.5-turbo",model:"gpt-3.5-turbo",description:"Fast and efficient model with excellent performance for everyday tasks",providers:["github"],roles:["chat","edit"],thinking:!1},{name:"Claude 4.5 Sonnet (Bedrock)",model:"global.anthropic.claude-sonnet-4-5-20250929-v1:0",description:"Enhanced Sonnet model with improved capabilities",providers:["bedrock"],roles:["chat","edit"],thinking:!1},{name:"Claude 4.1 Opus (Bedrock)",model:"us.anthropic.claude-opus-4-1-20250805-v1:0",description:"Opus model for deep thinking",providers:["bedrock"],roles:["chat","edit"],thinking:!1},{name:"Claude 3.7 Sonnet (Bedrock)",model:"us.anthropic.claude-3-7-sonnet-20250219-v1:0",description:"Enhanced Sonnet model with improved capabilities",providers:["bedrock"],roles:["chat","edit"],thinking:!1},{name:"Claude 3.5 Sonnet v2 (Bedrock)",model:"us.anthropic.claude-3-5-sonnet-20241022-v2:0",description:"Balanced model with strong performance across reasoning, math, and coding",providers:["bedrock"],roles:["chat","edit"],thinking:!1},{name:"Claude 3.5 Haiku (Bedrock)",model:"us.anthropic.claude-3-5-haiku-20241022-v1:0",description:"Fast and efficient model with excellent performance for everyday tasks",providers:["bedrock"],roles:["chat","edit"],thinking:!1},{name:"Llama 3.3 70B Instruct",model:"us.meta.llama3-3-70b-instruct-v1:0",description:"Large language model optimized for instruction following and chat",providers:["bedrock"],roles:["chat","edit"],thinking:!1},{name:"Cohere Embed Multilingual v3",model:"cohere.embed-multilingual-v3",description:"Multilingual text embedding model for semantic search and similarity",providers:["bedrock"],roles:["embed"],thinking:!1},{name:"Cohere Rerank 3.5",model:"cohere.rerank-v3-5:0",description:"Advanced reranking model for improving search result relevance",providers:["bedrock"],roles:["rerank"],thinking:!1},{name:"gpt-oss 20b",model:"gpt-oss:20b",description:"OpenAI\u2019s open-weight models designed for powerful reasoning, agentic tasks, and versatile developer use cases.",providers:["ollama"],roles:["chat","edit"],thinking:!0},{name:"Qwen3 8b",model:"qwen3:8b",description:"Qwen3 is the latest generation of large language models in Qwen series.",providers:["ollama"],roles:["chat","edit"],thinking:!0},{name:"Gemma3 12b",model:"gemma3:12b",description:"Lightweight gemma models trained by Google, trained to run on a single GPU.",providers:["ollama"],roles:["chat","edit"],thinking:!0},{name:"Meta Llama 3.1 8B (W&B)",model:"meta-llama/Llama-3.1-8B-Instruct",description:"Efficient conversational model optimized for responsive multilingual chatbot interactions",providers:["wandb"],roles:["chat","edit"],thinking:!1},{name:"OpenAI GPT OSS 120B",model:"openai/gpt-oss-120b",description:"Efficient Mixture-of-Experts model designed for high-reasoning, agentic and general-purpose use cases",providers:["wandb"],roles:["chat","edit"],thinking:!0},{name:"OpenAI GPT OSS 20B",model:"openai/gpt-oss-20b",description:"Lower latency Mixture-of-Experts model trained on OpenAI's Harmony response format with reasoning capabilities",providers:["wandb"],roles:["chat","edit"],thinking:!0},{name:"DeepSeek V3-0324",model:"deepseek-ai/DeepSeek-V3-0324",description:"Robust Mixture-of-Experts model tailored for high-complexity language processing and comprehensive document analysis",providers:["wandb"],roles:["chat","edit"],thinking:!1},{name:"Meta Llama 3.3 70B (W&B)",model:"meta-llama/Llama-3.3-70B-Instruct",description:"Multilingual model excelling in conversational tasks, detailed instruction-following, and coding",providers:["wandb"],roles:["chat","edit"],thinking:!1},{name:"DeepSeek R1-0528",model:"deepseek-ai/DeepSeek-R1-0528",description:"Optimized for precise reasoning tasks including complex coding, math, and structured document analysis",providers:["wandb"],roles:["chat","edit"],thinking:!0},{name:"MoonshotAI Kimi K2",model:"moonshotai/Kimi-K2-Instruct",description:"Mixture-of-Experts model optimized for complex tool use, reasoning, and code synthesis",providers:["wandb"],roles:["chat","edit"],thinking:!0},{name:"Z.AI GLM 4.5",model:"zai-org/GLM-4.5",description:"Mixture-of-Experts model with user-controllable thinking/non-thinking modes for strong reasoning, code generation, and agent alignment",providers:["wandb"],roles:["chat","edit"],thinking:!0}],g2=[{name:"OpenAI",id:"openai",description:"OpenAI's API for GPT models, including GPT-3.5 and GPT-4.",url:"https://platform.openai.com/"},{name:"Amazon Bedrock",id:"bedrock",description:"Amazon Bedrock provides access to foundation models from Amazon and leading AI startups via a unified API.",url:"https://aws.amazon.com/bedrock/"},{name:"Azure",id:"azure",description:"Azure provides access to models via the Azure cloud.",url:"https://azure.microsoft.com/en-us/products/ai-services/"},{name:"Anthropic",id:"anthropic",description:"Anthropic's Claude models for conversational and completion tasks.",url:"https://www.anthropic.com/"},{name:"Google AI",id:"google",description:"Google's Vertex AI and PaLM APIs for generative and conversational models.",url:"https://cloud.google.com/vertex-ai/docs/generative-ai/learn/overview"},{name:"Ollama",id:"ollama",description:"Ollama is a lightweight, open-source model server for running and sharing LLMs.",url:"https://ollama.ai/"},{name:"GitHub",id:"github",description:"GitHub's API for GPT models with GitHub-hosted models.",url:"https://github.com/features/copilot"},{name:"marimo",id:"marimo",description:"marimo's hosted models.",url:"https://docs.marimo.io/guides/editor_features/ai_completion/"},{name:"DeepSeek",id:"deepseek",description:"DeepSeek's API for GPT models.",url:"https://deepseek.com/"},{name:"LM Studio",id:"lmstudio",description:"LM Studio's API for GPT models.",url:"https://lmstudio.ai/"},{name:"OpenRouter",id:"openrouter",description:"OpenRouter's API for GPT models.",url:"https://openrouter.ai/"},{name:"Mistral",id:"mistral",description:"Mistral's API for GPT models.",url:"https://mistral.ai/"},{name:"Vercel v0",id:"vercel",description:"Vercel's API for GPT models.",url:"https://vercel.com/"},{name:"Together AI",id:"together",description:"Together AI's API for GPT models.",url:"https://together.ai/"},{name:"xAI",id:"xai",description:"xAI's API for GPT models.",url:"https://x.ai/"},{name:"Weights & Biases",id:"wandb",description:"Weights & Biases' hosted models for ML development and AI inference.",url:"https://wandb.ai/"}];var u2=B0(()=>{let o=new Map;for(let e of h2){let t=e.model,n={...e,model:e.model,roles:e.roles.map(r=>r),providers:e.providers,custom:!1};for(let r of n.providers){let l=`${r}/${t}`;o.set(l,n)}}return o}),F0=B0(()=>{let o=new Map,e=new Map;return g2.forEach((t,n)=>{let r=t.id;o.set(r,t),e.set(r,n)}),{providerMap:o,providerToOrderIdx:e}}),R=class W{constructor(e,t){A0(this,"modelsByProviderMap",new C0);this.customModels=new Set(e),this.displayedModels=new Set(t),this.modelsMap=new Map,this.buildMaps()}static getProviderInfo(e){let{providerMap:t}=F0();return t.get(e)}static create(e){let{customModels:t=[],displayedModels:n=[]}=e;return new W(t.map(r=>y.parse(r).id),n.map(r=>y.parse(r).id))}buildMaps(){let e=W.buildMapsFromConfig({displayedModels:this.displayedModels,customModels:this.customModels});e.modelsMap.size===0&&(J0.error("The configured displayed_models have filtered out all registered models. Reverting back to showing all models.",[...this.displayedModels]),e=W.buildMapsFromConfig({displayedModels:new Set,customModels:this.customModels})),this.modelsByProviderMap=e.modelsByProviderMap,this.modelsMap=e.modelsMap}static buildMapsFromConfig(e){let{displayedModels:t,customModels:n}=e,r=t.size>0,l=u2(),p=new Map,c=new Map,m=new C0;for(let a of n){if(r&&!t.has(a))continue;let d=y.parse(a),h={name:d.shortModelId,model:d.shortModelId,description:"Custom model",providers:[d.providerId],roles:[],thinking:!1,custom:!0};p.set(a,h)}if(r)for(let a of t){let d=l.get(a);d&&c.set(a,d)}else c=new Map(l);c=new Map([...p,...c]);for(let[a,d]of c.entries()){let h=y.parse(a);m.add(h.providerId,d)}return{modelsByProviderMap:m,modelsMap:c}}getDisplayedModels(){return this.displayedModels}getCustomModels(){return this.customModels}getModelsByProvider(e){return this.modelsByProviderMap.get(e)||[]}getGroupedModelsByProvider(){return this.modelsByProviderMap}getListModelsByProvider(){let e=[...this.getGroupedModelsByProvider().entries()],t=F0().providerToOrderIdx;return e.sort((n,r)=>{let l=n[0],p=r[0];return(t.get(l)??0)-(t.get(p)??0)}),e}getModelsMap(){return this.modelsMap}getModel(e){return this.modelsMap.get(e)}},E0="data:image/svg+xml,%3csvg%20role='img'%20viewBox='0%200%2024%2024'%20xmlns='http://www.w3.org/2000/svg'%3e%3ctitle%3eAnthropic%3c/title%3e%3cpath%20d='M17.3041%203.541h-3.6718l6.696%2016.918H24Zm-10.6082%200L0%2020.459h3.7442l1.3693-3.5527h7.0052l1.3693%203.5528h3.7442L10.5363%203.5409Zm-.3712%2010.2232%202.2914-5.9456%202.2914%205.9456Z'/%3e%3c/svg%3e",v2="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20xml:space='preserve'%20y='0'%20x='0'%20id='Layer_1'%20version='1.1'%20viewBox='0%200%20300.67%20179.8'%3e%3cstyle%20id='style1855'%20type='text/css'%3e.st1{fill-rule:evenodd;clip-rule:evenodd;fill:%23f90}%3c/style%3e%3cg%20transform='translate(-1.668%20-1.1)'%20id='g1865'%3e%3cpath%20id='path1857'%20d='M86.4%2066.4c0%203.7.4%206.7%201.1%208.9.8%202.2%201.8%204.6%203.2%207.2.5.8.7%201.6.7%202.3%200%201-.6%202-1.9%203L83.2%2092c-.9.6-1.8.9-2.6.9-1%200-2-.5-3-1.4-1.4-1.5-2.6-3.1-3.6-4.7-1-1.7-2-3.6-3.1-5.9-7.8%209.2-17.6%2013.8-29.4%2013.8-8.4%200-15.1-2.4-20-7.2-4.9-4.8-7.4-11.2-7.4-19.2%200-8.5%203-15.4%209.1-20.6%206.1-5.2%2014.2-7.8%2024.5-7.8%203.4%200%206.9.3%2010.6.8%203.7.5%207.5%201.3%2011.5%202.2v-7.3c0-7.6-1.6-12.9-4.7-16-3.2-3.1-8.6-4.6-16.3-4.6-3.5%200-7.1.4-10.8%201.3-3.7.9-7.3%202-10.8%203.4-1.6.7-2.8%201.1-3.5%201.3-.7.2-1.2.3-1.6.3-1.4%200-2.1-1-2.1-3.1v-4.9c0-1.6.2-2.8.7-3.5.5-.7%201.4-1.4%202.8-2.1%203.5-1.8%207.7-3.3%2012.6-4.5C41%201.9%2046.2%201.3%2051.7%201.3c11.9%200%2020.6%202.7%2026.2%208.1%205.5%205.4%208.3%2013.6%208.3%2024.6v32.4zM45.8%2081.6c3.3%200%206.7-.6%2010.3-1.8%203.6-1.2%206.8-3.4%209.5-6.4%201.6-1.9%202.8-4%203.4-6.4.6-2.4%201-5.3%201-8.7v-4.2c-2.9-.7-6-1.3-9.2-1.7-3.2-.4-6.3-.6-9.4-.6-6.7%200-11.6%201.3-14.9%204-3.3%202.7-4.9%206.5-4.9%2011.5%200%204.7%201.2%208.2%203.7%2010.6%202.4%202.5%205.9%203.7%2010.5%203.7zm80.3%2010.8c-1.8%200-3-.3-3.8-1-.8-.6-1.5-2-2.1-3.9L96.7%2010.2c-.6-2-.9-3.3-.9-4%200-1.6.8-2.5%202.4-2.5h9.8c1.9%200%203.2.3%203.9%201%20.8.6%201.4%202%202%203.9l16.8%2066.2%2015.6-66.2c.5-2%201.1-3.3%201.9-3.9.8-.6%202.2-1%204-1h8c1.9%200%203.2.3%204%201%20.8.6%201.5%202%201.9%203.9l15.8%2067%2017.3-67c.6-2%201.3-3.3%202-3.9.8-.6%202.1-1%203.9-1h9.3c1.6%200%202.5.8%202.5%202.5%200%20.5-.1%201-.2%201.6-.1.6-.3%201.4-.7%202.5l-24.1%2077.3c-.6%202-1.3%203.3-2.1%203.9-.8.6-2.1%201-3.8%201h-8.6c-1.9%200-3.2-.3-4-1-.8-.7-1.5-2-1.9-4L156%2023l-15.4%2064.4c-.5%202-1.1%203.3-1.9%204-.8.7-2.2%201-4%201zm128.5%202.7c-5.2%200-10.4-.6-15.4-1.8-5-1.2-8.9-2.5-11.5-4-1.6-.9-2.7-1.9-3.1-2.8-.4-.9-.6-1.9-.6-2.8v-5.1c0-2.1.8-3.1%202.3-3.1.6%200%201.2.1%201.8.3.6.2%201.5.6%202.5%201%203.4%201.5%207.1%202.7%2011%203.5%204%20.8%207.9%201.2%2011.9%201.2%206.3%200%2011.2-1.1%2014.6-3.3%203.4-2.2%205.2-5.4%205.2-9.5%200-2.8-.9-5.1-2.7-7-1.8-1.9-5.2-3.6-10.1-5.2L246%2052c-7.3-2.3-12.7-5.7-16-10.2-3.3-4.4-5-9.3-5-14.5%200-4.2.9-7.9%202.7-11.1%201.8-3.2%204.2-6%207.2-8.2%203-2.3%206.4-4%2010.4-5.2%204-1.2%208.2-1.7%2012.6-1.7%202.2%200%204.5.1%206.7.4%202.3.3%204.4.7%206.5%201.1%202%20.5%203.9%201%205.7%201.6%201.8.6%203.2%201.2%204.2%201.8%201.4.8%202.4%201.6%203%202.5.6.8.9%201.9.9%203.3v4.7c0%202.1-.8%203.2-2.3%203.2-.8%200-2.1-.4-3.8-1.2-5.7-2.6-12.1-3.9-19.2-3.9-5.7%200-10.2.9-13.3%202.8-3.1%201.9-4.7%204.8-4.7%208.9%200%202.8%201%205.2%203%207.1%202%201.9%205.7%203.8%2011%205.5l14.2%204.5c7.2%202.3%2012.4%205.5%2015.5%209.6%203.1%204.1%204.6%208.8%204.6%2014%200%204.3-.9%208.2-2.6%2011.6-1.8%203.4-4.2%206.4-7.3%208.8-3.1%202.5-6.8%204.3-11.1%205.6-4.5%201.4-9.2%202.1-14.3%202.1z'%20fill='%23252f3e'/%3e%3cg%20id='g1863'%3e%3cpath%20id='path1859'%20d='M273.5%20143.7c-32.9%2024.3-80.7%2037.2-121.8%2037.2-57.6%200-109.5-21.3-148.7-56.7-3.1-2.8-.3-6.6%203.4-4.4%2042.4%2024.6%2094.7%2039.5%20148.8%2039.5%2036.5%200%2076.6-7.6%20113.5-23.2%205.5-2.5%2010.2%203.6%204.8%207.6z'%20class='st1'/%3e%3cpath%20id='path1861'%20d='M287.2%20128.1c-4.2-5.4-27.8-2.6-38.5-1.3-3.2.4-3.7-2.4-.8-4.5%2018.8-13.2%2049.7-9.4%2053.3-5%203.6%204.5-1%2035.4-18.6%2050.2-2.7%202.3-5.3%201.1-4.1-1.9%204-9.9%2012.9-32.2%208.7-37.5z'%20class='st1'/%3e%3c/g%3e%3c/g%3e%3c/svg%3e",f2="data:image/svg+xml,%3csvg%20width='150'%20height='150'%20viewBox='0%200%2096%2096'%20xmlns='http://www.w3.org/2000/svg'%3e%3cdefs%3e%3clinearGradient%20id='e399c19f-b68f-429d-b176-18c2117ff73c'%20x1='-1032.172'%20x2='-1059.213'%20y1='145.312'%20y2='65.426'%20gradientTransform='matrix(1%200%200%20-1%201075%20158)'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20offset='0'%20stop-color='%23114a8b'/%3e%3cstop%20offset='1'%20stop-color='%230669bc'/%3e%3c/linearGradient%3e%3clinearGradient%20id='ac2a6fc2-ca48-4327-9a3c-d4dcc3256e15'%20x1='-1023.725'%20x2='-1029.98'%20y1='108.083'%20y2='105.968'%20gradientTransform='matrix(1%200%200%20-1%201075%20158)'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20offset='0'%20stop-opacity='.3'/%3e%3cstop%20offset='.071'%20stop-opacity='.2'/%3e%3cstop%20offset='.321'%20stop-opacity='.1'/%3e%3cstop%20offset='.623'%20stop-opacity='.05'/%3e%3cstop%20offset='1'%20stop-opacity='0'/%3e%3c/linearGradient%3e%3clinearGradient%20id='a7fee970-a784-4bb1-af8d-63d18e5f7db9'%20x1='-1027.165'%20x2='-997.482'%20y1='147.642'%20y2='68.561'%20gradientTransform='matrix(1%200%200%20-1%201075%20158)'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20offset='0'%20stop-color='%233ccbf4'/%3e%3cstop%20offset='1'%20stop-color='%232892df'/%3e%3c/linearGradient%3e%3c/defs%3e%3cpath%20fill='url(%23e399c19f-b68f-429d-b176-18c2117ff73c)'%20d='M33.338%206.544h26.038l-27.03%2080.087a4.152%204.152%200%200%201-3.933%202.824H8.149a4.145%204.145%200%200%201-3.928-5.47L29.404%209.368a4.152%204.152%200%200%201%203.934-2.825z'/%3e%3cpath%20fill='%230078d4'%20d='M71.175%2060.261h-41.29a1.911%201.911%200%200%200-1.305%203.309l26.532%2024.764a4.171%204.171%200%200%200%202.846%201.121h23.38z'/%3e%3cpath%20fill='url(%23ac2a6fc2-ca48-4327-9a3c-d4dcc3256e15)'%20d='M33.338%206.544a4.118%204.118%200%200%200-3.943%202.879L4.252%2083.917a4.14%204.14%200%200%200%203.908%205.538h20.787a4.443%204.443%200%200%200%203.41-2.9l5.014-14.777%2017.91%2016.705a4.237%204.237%200%200%200%202.666.972H81.24L71.024%2060.261l-29.781.007L59.47%206.544z'/%3e%3cpath%20fill='url(%23a7fee970-a784-4bb1-af8d-63d18e5f7db9)'%20d='M66.595%209.364a4.145%204.145%200%200%200-3.928-2.82H33.648a4.146%204.146%200%200%201%203.928%202.82l25.184%2074.62a4.146%204.146%200%200%201-3.928%205.472h29.02a4.146%204.146%200%200%200%203.927-5.472z'/%3e%3c/svg%3e",x2="data:image/svg+xml,%3csvg%20fill='currentColor'%20fill-rule='evenodd'%20height='1em'%20style='flex:none;line-height:1'%20viewBox='0%200%2024%2024'%20width='1em'%20xmlns='http://www.w3.org/2000/svg'%3e%3ctitle%3eDeepSeek%3c/title%3e%3cpath%20d='M23.748%204.482c-.254-.124-.364.113-.512.234-.051.039-.094.09-.137.136-.372.397-.806.657-1.373.626-.829-.046-1.537.214-2.163.848-.133-.782-.575-1.248-1.247-1.548-.352-.156-.708-.311-.955-.65-.172-.241-.219-.51-.305-.774-.055-.16-.11-.323-.293-.35-.2-.031-.278.136-.356.276-.313.572-.434%201.202-.422%201.84.027%201.436.633%202.58%201.838%203.393.137.093.172.187.129.323-.082.28-.18.552-.266.833-.055.179-.137.217-.329.14a5.526%205.526%200%2001-1.736-1.18c-.857-.828-1.631-1.742-2.597-2.458a11.365%2011.365%200%2000-.689-.471c-.985-.957.13-1.743.388-1.836.27-.098.093-.432-.779-.428-.872.004-1.67.295-2.687.684a3.055%203.055%200%2001-.465.137%209.597%209.597%200%2000-2.883-.102c-1.885.21-3.39%201.102-4.497%202.623C.082%208.606-.231%2010.684.152%2012.85c.403%202.284%201.569%204.175%203.36%205.653%201.858%201.533%203.997%202.284%206.438%202.14%201.482-.085%203.133-.284%204.994-1.86.47.234.962.327%201.78.397.63.059%201.236-.03%201.705-.128.735-.156.684-.837.419-.961-2.155-1.004-1.682-.595-2.113-.926%201.096-1.296%202.746-2.642%203.392-7.003.05-.347.007-.565%200-.845-.004-.17.035-.237.23-.256a4.173%204.173%200%20001.545-.475c1.396-.763%201.96-2.015%202.093-3.517.02-.23-.004-.467-.247-.588zM11.581%2018c-2.089-1.642-3.102-2.183-3.52-2.16-.392.024-.321.471-.235.763.09.288.207.486.371.739.114.167.192.416-.113.603-.673.416-1.842-.14-1.897-.167-1.361-.802-2.5-1.86-3.301-3.307-.774-1.393-1.224-2.887-1.298-4.482-.02-.386.093-.522.477-.592a4.696%204.696%200%20011.529-.039c2.132.312%203.946%201.265%205.468%202.774.868.86%201.525%201.887%202.202%202.891.72%201.066%201.494%202.082%202.48%202.914.348.292.625.514.891.677-.802.09-2.14.11-3.054-.614zm1-6.44a.306.306%200%2001.415-.287.302.302%200%2001.2.288.306.306%200%2001-.31.307.303.303%200%2001-.304-.308zm3.11%201.596c-.2.081-.399.151-.59.16a1.245%201.245%200%2001-.798-.254c-.274-.23-.47-.358-.552-.758a1.73%201.73%200%2001.016-.588c.07-.327-.008-.537-.239-.727-.187-.156-.426-.199-.688-.199a.559.559%200%2001-.254-.078c-.11-.054-.2-.19-.114-.358.028-.054.16-.186.192-.21.356-.202.767-.136%201.146.016.352.144.618.408%201.001.782.391.451.462.576.685.914.176.265.336.537.445.848.067.195-.019.354-.25.452z'%3e%3c/path%3e%3c/svg%3e",k2="data:image/svg+xml,%3csvg%20role='img'%20viewBox='0%200%2024%2024'%20xmlns='http://www.w3.org/2000/svg'%3e%3ctitle%3eGitHub%3c/title%3e%3cpath%20d='M12%20.297c-6.63%200-12%205.373-12%2012%200%205.303%203.438%209.8%208.205%2011.385.6.113.82-.258.82-.577%200-.285-.01-1.04-.015-2.04-3.338.724-4.042-1.61-4.042-1.61C4.422%2018.07%203.633%2017.7%203.633%2017.7c-1.087-.744.084-.729.084-.729%201.205.084%201.838%201.236%201.838%201.236%201.07%201.835%202.809%201.305%203.495.998.108-.776.417-1.305.76-1.605-2.665-.3-5.466-1.332-5.466-5.93%200-1.31.465-2.38%201.235-3.22-.135-.303-.54-1.523.105-3.176%200%200%201.005-.322%203.3%201.23.96-.267%201.98-.399%203-.405%201.02.006%202.04.138%203%20.405%202.28-1.552%203.285-1.23%203.285-1.23.645%201.653.24%202.873.12%203.176.765.84%201.23%201.91%201.23%203.22%200%204.61-2.805%205.625-5.475%205.92.42.36.81%201.096.81%202.22%200%201.606-.015%202.896-.015%203.286%200%20.315.21.69.825.57C20.565%2022.092%2024%2017.592%2024%2012.297c0-6.627-5.373-12-12-12'/%3e%3c/svg%3e",V0="data:image/svg+xml,%3csvg%20role='img'%20viewBox='0%200%2024%2024'%20xmlns='http://www.w3.org/2000/svg'%3e%3ctitle%3eGoogle%20Gemini%3c/title%3e%3cpath%20d='M11.04%2019.32Q12%2021.51%2012%2024q0-2.49.93-4.68.96-2.19%202.58-3.81t3.81-2.55Q21.51%2012%2024%2012q-2.49%200-4.68-.93a12.3%2012.3%200%200%201-3.81-2.58%2012.3%2012.3%200%200%201-2.58-3.81Q12%202.49%2012%200q0%202.49-.96%204.68-.93%202.19-2.55%203.81a12.3%2012.3%200%200%201-3.81%202.58Q2.49%2012%200%2012q2.49%200%204.68.96%202.19.93%203.81%202.55t2.55%203.81'/%3e%3c/svg%3e",w2="data:image/svg+xml,%3csvg%20role='img'%20viewBox='0%200%2024%2024'%20xmlns='http://www.w3.org/2000/svg'%3e%3ctitle%3eOllama%3c/title%3e%3cpath%20d='M16.361%2010.26a.894.894%200%200%200-.558.47l-.072.148.001.207c0%20.193.004.217.059.353.076.193.152.312.291.448.24.238.51.3.872.205a.86.86%200%200%200%20.517-.436.752.752%200%200%200%20.08-.498c-.064-.453-.33-.782-.724-.897a1.06%201.06%200%200%200-.466%200zm-9.203.005c-.305.096-.533.32-.65.639a1.187%201.187%200%200%200-.06.52c.057.309.31.59.598.667.362.095.632.033.872-.205.14-.136.215-.255.291-.448.055-.136.059-.16.059-.353l.001-.207-.072-.148a.894.894%200%200%200-.565-.472%201.02%201.02%200%200%200-.474.007Zm4.184%202c-.131.071-.223.25-.195.383.031.143.157.288.353.407.105.063.112.072.117.136.004.038-.01.146-.029.243-.02.094-.036.194-.036.222.002.074.07.195.143.253.064.052.076.054.255.059.164.005.198.001.264-.03.169-.082.212-.234.15-.525-.052-.243-.042-.28.087-.355.137-.08.281-.219.324-.314a.365.365%200%200%200-.175-.48.394.394%200%200%200-.181-.033c-.126%200-.207.03-.355.124l-.085.053-.053-.032c-.219-.13-.259-.145-.391-.143a.396.396%200%200%200-.193.032zm.39-2.195c-.373.036-.475.05-.654.086-.291.06-.68.195-.951.328-.94.46-1.589%201.226-1.787%202.114-.04.176-.045.234-.045.53%200%20.294.005.357.043.524.264%201.16%201.332%202.017%202.714%202.173.3.033%201.596.033%201.896%200%201.11-.125%202.064-.727%202.493-1.571.114-.226.169-.372.22-.602.039-.167.044-.23.044-.523%200-.297-.005-.355-.045-.531-.288-1.29-1.539-2.304-3.072-2.497a6.873%206.873%200%200%200-.855-.031zm.645.937a3.283%203.283%200%200%201%201.44.514c.223.148.537.458.671.662.166.251.26.508.303.82.02.143.01.251-.043.482-.08.345-.332.705-.672.957a3.115%203.115%200%200%201-.689.348c-.382.122-.632.144-1.525.138-.582-.006-.686-.01-.853-.042-.57-.107-1.022-.334-1.35-.68-.264-.28-.385-.535-.45-.946-.03-.192.025-.509.137-.776.136-.326.488-.73.836-.963.403-.269.934-.46%201.422-.512.187-.02.586-.02.773-.002zm-5.503-11a1.653%201.653%200%200%200-.683.298C5.617.74%205.173%201.666%204.985%202.819c-.07.436-.119%201.04-.119%201.503%200%20.544.064%201.24.155%201.721.02.107.031.202.023.208a8.12%208.12%200%200%201-.187.152%205.324%205.324%200%200%200-.949%201.02%205.49%205.49%200%200%200-.94%202.339%206.625%206.625%200%200%200-.023%201.357c.091.78.325%201.438.727%202.04l.13.195-.037.064c-.269.452-.498%201.105-.605%201.732-.084.496-.095.629-.095%201.294%200%20.67.009.803.088%201.266.095.555.288%201.143.503%201.534.071.128.243.393.264.407.007.003-.014.067-.046.141a7.405%207.405%200%200%200-.548%201.873c-.062.417-.071.552-.071.991%200%20.56.031.832.148%201.279L3.42%2024h1.478l-.05-.091c-.297-.552-.325-1.575-.068-2.597.117-.472.25-.819.498-1.296l.148-.29v-.177c0-.165-.003-.184-.057-.293a.915.915%200%200%200-.194-.25%201.74%201.74%200%200%201-.385-.543c-.424-.92-.506-2.286-.208-3.451.124-.486.329-.918.544-1.154a.787.787%200%200%200%20.223-.531c0-.195-.07-.355-.224-.522a3.136%203.136%200%200%201-.817-1.729c-.14-.96.114-2.005.69-2.834.563-.814%201.353-1.336%202.237-1.475.199-.033.57-.028.776.01.226.04.367.028.512-.041.179-.085.268-.19.374-.431.093-.215.165-.333.36-.576.234-.29.46-.489.822-.729.413-.27.884-.467%201.352-.561.17-.035.25-.04.569-.04.319%200%20.398.005.569.04a4.07%204.07%200%200%201%201.914.997c.117.109.398.457.488.602.034.057.095.177.132.267.105.241.195.346.374.43.14.068.286.082.503.045.343-.058.607-.053.943.016%201.144.23%202.14%201.173%202.581%202.437.385%201.108.276%202.267-.296%203.153-.097.15-.193.27-.333.419-.301.322-.301.722-.001%201.053.493.539.801%201.866.708%203.036-.062.772-.26%201.463-.533%201.854a2.096%202.096%200%200%201-.224.258.916.916%200%200%200-.194.25c-.054.109-.057.128-.057.293v.178l.148.29c.248.476.38.823.498%201.295.253%201.008.231%202.01-.059%202.581a.845.845%200%200%200-.044.098c0%20.006.329.009.732.009h.73l.02-.074.036-.134c.019-.076.057-.3.088-.516.029-.217.029-1.016%200-1.258-.11-.875-.295-1.57-.597-2.226-.032-.074-.053-.138-.046-.141.008-.005.057-.074.108-.152.376-.569.607-1.284.724-2.228.031-.26.031-1.378%200-1.628-.083-.645-.182-1.082-.348-1.525a6.083%206.083%200%200%200-.329-.7l-.038-.064.131-.194c.402-.604.636-1.262.727-2.04a6.625%206.625%200%200%200-.024-1.358%205.512%205.512%200%200%200-.939-2.339%205.325%205.325%200%200%200-.95-1.02%208.097%208.097%200%200%201-.186-.152.692.692%200%200%201%20.023-.208c.208-1.087.201-2.443-.017-3.503-.19-.924-.535-1.658-.98-2.082-.354-.338-.716-.482-1.15-.455-.996.059-1.8%201.205-2.116%203.01a6.805%206.805%200%200%200-.097.726c0%20.036-.007.066-.015.066a.96.96%200%200%201-.149-.078A4.857%204.857%200%200%200%2012%203.03c-.832%200-1.687.243-2.456.698a.958.958%200%200%201-.148.078c-.008%200-.015-.03-.015-.066a6.71%206.71%200%200%200-.097-.725C8.997%201.392%208.337.319%207.46.048a2.096%202.096%200%200%200-.585-.041Zm.293%201.402c.248.197.523.759.682%201.388.03.113.06.244.069.292.007.047.026.152.041.233.067.365.098.76.102%201.24l.002.475-.12.175-.118.178h-.278c-.324%200-.646.041-.954.124l-.238.06c-.033.007-.038-.003-.057-.144a8.438%208.438%200%200%201%20.016-2.323c.124-.788.413-1.501.696-1.711.067-.05.079-.049.157.013zm9.825-.012c.17.126.358.46.498.888.28.854.36%202.028.212%203.145-.019.14-.024.151-.057.144l-.238-.06a3.693%203.693%200%200%200-.954-.124h-.278l-.119-.178-.119-.175.002-.474c.004-.669.066-1.19.214-1.772.157-.623.434-1.185.68-1.382.078-.062.09-.063.159-.012z'/%3e%3c/svg%3e",H0="data:image/svg+xml,%3csvg%20role='img'%20viewBox='0%200%2024%2024'%20xmlns='http://www.w3.org/2000/svg'%3e%3ctitle%3eOpenAI%3c/title%3e%3cpath%20d='M22.2819%209.8211a5.9847%205.9847%200%200%200-.5157-4.9108%206.0462%206.0462%200%200%200-6.5098-2.9A6.0651%206.0651%200%200%200%204.9807%204.1818a5.9847%205.9847%200%200%200-3.9977%202.9%206.0462%206.0462%200%200%200%20.7427%207.0966%205.98%205.98%200%200%200%20.511%204.9107%206.051%206.051%200%200%200%206.5146%202.9001A5.9847%205.9847%200%200%200%2013.2599%2024a6.0557%206.0557%200%200%200%205.7718-4.2058%205.9894%205.9894%200%200%200%203.9977-2.9001%206.0557%206.0557%200%200%200-.7475-7.0729zm-9.022%2012.6081a4.4755%204.4755%200%200%201-2.8764-1.0408l.1419-.0804%204.7783-2.7582a.7948.7948%200%200%200%20.3927-.6813v-6.7369l2.02%201.1686a.071.071%200%200%201%20.038.052v5.5826a4.504%204.504%200%200%201-4.4945%204.4944zm-9.6607-4.1254a4.4708%204.4708%200%200%201-.5346-3.0137l.142.0852%204.783%202.7582a.7712.7712%200%200%200%20.7806%200l5.8428-3.3685v2.3324a.0804.0804%200%200%201-.0332.0615L9.74%2019.9502a4.4992%204.4992%200%200%201-6.1408-1.6464zM2.3408%207.8956a4.485%204.485%200%200%201%202.3655-1.9728V11.6a.7664.7664%200%200%200%20.3879.6765l5.8144%203.3543-2.0201%201.1685a.0757.0757%200%200%201-.071%200l-4.8303-2.7865A4.504%204.504%200%200%201%202.3408%207.872zm16.5963%203.8558L13.1038%208.364%2015.1192%207.2a.0757.0757%200%200%201%20.071%200l4.8303%202.7913a4.4944%204.4944%200%200%201-.6765%208.1042v-5.6772a.79.79%200%200%200-.407-.667zm2.0107-3.0231l-.142-.0852-4.7735-2.7818a.7759.7759%200%200%200-.7854%200L9.409%209.2297V6.8974a.0662.0662%200%200%201%20.0284-.0615l4.8303-2.7866a4.4992%204.4992%200%200%201%206.6802%204.66zM8.3065%2012.863l-2.02-1.1638a.0804.0804%200%200%201-.038-.0567V6.0742a4.4992%204.4992%200%200%201%207.3757-3.4537l-.142.0805L8.704%205.459a.7948.7948%200%200%200-.3927.6813zm1.0976-2.3654l2.602-1.4998%202.6069%201.4998v2.9994l-2.5974%201.4997-2.6067-1.4997Z'/%3e%3c/svg%3e",M2="data:image/svg+xml,%3csvg%20width='240'%20height='300'%20viewBox='0%200%20240%20300'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20clip-path='url(%23clip0_1401_86274)'%3e%3cmask%20id='mask0_1401_86274'%20style='mask-type:luminance'%20maskUnits='userSpaceOnUse'%20x='0'%20y='0'%20width='240'%20height='300'%3e%3cpath%20d='M240%200H0V300H240V0Z'%20fill='white'/%3e%3c/mask%3e%3cg%20mask='url(%23mask0_1401_86274)'%3e%3cpath%20d='M180%20240H60V120H180V240Z'%20fill='%23CFCECD'/%3e%3cpath%20d='M180%2060H60V240H180V60ZM240%20300H0V0H240V300Z'%20fill='%23211E1E'/%3e%3c/g%3e%3c/g%3e%3cdefs%3e%3cclipPath%20id='clip0_1401_86274'%3e%3crect%20width='240'%20height='300'%20fill='white'/%3e%3c/clipPath%3e%3c/defs%3e%3c/svg%3e",b2="data:image/svg+xml,%3csvg%20fill='currentColor'%20fill-rule='evenodd'%20height='1em'%20style='flex:none;line-height:1'%20viewBox='0%200%2024%2024'%20width='1em'%20xmlns='http://www.w3.org/2000/svg'%3e%3ctitle%3eOpenRouter%3c/title%3e%3cpath%20d='M16.804%201.957l7.22%204.105v.087L16.73%2010.21l.017-2.117-.821-.03c-1.059-.028-1.611.002-2.268.11-1.064.175-2.038.577-3.147%201.352L8.345%2011.03c-.284.195-.495.336-.68.455l-.515.322-.397.234.385.23.53.338c.476.314%201.17.796%202.701%201.866%201.11.775%202.083%201.177%203.147%201.352l.3.045c.694.091%201.375.094%202.825.033l.022-2.159%207.22%204.105v.087L16.589%2022l.014-1.862-.635.022c-1.386.042-2.137.002-3.138-.162-1.694-.28-3.26-.926-4.881-2.059l-2.158-1.5a21.997%2021.997%200%2000-.755-.498l-.467-.28a55.927%2055.927%200%2000-.76-.43C2.908%2014.73.563%2014.116%200%2014.116V9.888l.14.004c.564-.007%202.91-.622%203.809-1.124l1.016-.58.438-.274c.428-.28%201.072-.726%202.686-1.853%201.621-1.133%203.186-1.78%204.881-2.059%201.152-.19%201.974-.213%203.814-.138l.02-1.907z'%3e%3c/path%3e%3c/svg%3e",y2="data:image/svg+xml,%3csvg%20role='img'%20viewBox='0%200%2024%2024'%20xmlns='http://www.w3.org/2000/svg'%3e%3ctitle%3eWeights%20&%20Biases%3c/title%3e%3cpath%20d='M2.48%200a1.55%201.55%200%201%200%200%203.1%201.55%201.55%200%200%200%200-3.1zm19.04%200a1.55%201.55%200%201%200%200%203.101%201.55%201.55%200%200%200%200-3.101zM12%202.295a1.55%201.55%200%201%200%200%203.1%201.55%201.55%200%200%200%200-3.1zM2.48%205.272a2.48%202.48%200%201%200%200%204.96%202.48%202.48%200%200%200%200-4.96zm19.04%200a2.48%202.48%200%201%200%200%204.96%202.48%202.48%200%200%200%200-4.96zM12%208.496a1.55%201.55%200%201%200%200%203.1%201.55%201.55%200%200%200%200-3.1zm-9.52%203.907a1.55%201.55%200%201%200%200%203.1%201.55%201.55%200%200%200%200-3.1zm19.04%200a1.55%201.55%200%201%200%200%203.102%201.55%201.55%200%200%200%200-3.102zM12%2013.767a2.48%202.48%200%201%200%200%204.962%202.48%202.48%200%200%200%200-4.962zm-9.52%203.907a2.48%202.48%200%201%200%20.001%204.962%202.48%202.48%200%200%200%200-4.962zm19.04.93a1.55%201.55%200%201%200%200%203.102%201.55%201.55%200%200%200%200-3.101zM12%2020.9a1.55%201.55%200%201%200%200%203.1%201.55%201.55%200%200%200%200-3.1Z'/%3e%3c/svg%3e",A2="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAAXNSR0IArs4c6QAABtlJREFUWEetV21QlNcVfs67y67KV/EjJIRdBIxJrB9BotFqAtERTIKkk8SxNiGt7Ipa46DsxvjR0rVTKuKKJFYTE1SIxmhFbR0Kwc4YNSraqmNswhSFIrBUBD8QVGTZfU/nvrDLroqQ4Pm179nnnvvc5557zr2EXlj05hSfhgvO10AUB/A4AOHEFMCADOJrBFQx0zki+ajkkA9eyslr6kVYBUIPA8ZaLOr/ttQtYJKXgRHSy6B2EBVKwMZqa+6hnsZ0S2DY8jlD2uxSIYDxPQVx/S+CSZIEpyx3rI5wXIZsslm3neouxoMJMEhvNv6JwcvcwYkw8kk9xoZFYOjgYAT2HwBZlnH99i1UNtbj9KVKVDZcho9KhX4+GtgdDrQ52sVwGYQcbduAFRUbNrTdS+R+AhaLpL9Vu4kZ8wTYV6vFrydNxTsTY/Bk0KCHinHxymVsP/E1vjz1jRvXSQIEOqGxO39esWFbo2cQbwIzZ6r0QwPSWUa6APlp++GgyYLgwCB8dqQEs8a/iEF+/j3uSPW1RqTt2orTVRfBHmgCyjQaObZidRcJLwJPL032b3XSEQaixMqTJr6s7GlDcxNOVpZj13wz9IOG9EhAABxOJ5buyUfB6RNeeCKU+vnpYsssFrvXKYhImzvcQfJXDISH/GQg5kyeiqzifYh5eiSss+ZgoK9fryb2BMnMeG/HZhR+e/peEmtqrFuU/OpQwGKRdC21pSLjJZKwMuEtZBbtw6ujx+LDXxohfD/WWu12JH6UgfL6OncIAtpVKh5VlbW1XCGgMxlnA7xT/H4zeiLO26oVCUtMv1cyuq/2na0aMz7KcB/PzjO6rdaam6wQ0JuNx5h5EhFhybQZyD54AJuS5iNhzPN9nds9fsXeHdhRetgz3m2nv+ox6ig4qnqAped04UqWn6utwr/SrVBLKmWAkPHClS4Jw4c8jsbmmzheUYaA/r6YPjJKUcp24yqOlH8PiQgvDv8pQj2Obf3NG5i8erlSH9wmcTyFmQ2vyQxR8ZASE48vTh7BlGdGYWOSUgYU+76uBtPXW9zfyZOnYnvpYbQ7nYovSh+BJXGvY27en13FB1ofH+Qlp2LyUyPc4xZ/uQX7zohUcxmvJJ05OQ1M64TrMf9ANLTcxOK4RKTFJXZLQKxQZLin9ffRoLVdOVluGxsWib8tWun+/uZCGd7+NNsTkk+hJkMOAanCK2S8225HeuIsGF+a1i2B0KDBGB4cgkP/Oe/GaNRqxI14DkcvlqG59Y7iF/Eurv7EjRGKjU5Pxe22uy7fYdKZjflgfteT1gevvIGFU1/tlsCnv1qIV0ZFY8If30dd0zUFN2PMOGxKWoDMogJsPFSk+IRS1Wu3eKky6+O1KK0sV3xEKBdNZzszv+OJSvpZLDLe6HLdmwP5hsWY8uxoxK5ZoTQiYTOfn4TsXxiw/h8HkF3y124JLCv4HDtPHu2YjtBIOpNhI4DfeBKIDovE/kXLu1WgLwQy/74Xm74udsVuIr3JsJSBNZ4EREs9tyoH/v36K+5HqUBG4R5sPlzSqQDZSG8yTmPwQReBwX7+uHqrBetnG5Sq+KgJpO7Mxf6zJztzgI5TsDnJV8PaRoCV5Y4bOkyp2888EYqChR8owLob15TG5LJ5sdMxIkSHjMK/oKH5puIeHzEcb0+IwVffnUXx+TOuCZAz2+iVhFOyfoeKhsudKUAbOkuxoYAZbwqvODqvR43H7n8ew/73liN6aKRXgL58VDbU4+Ws37pDSISEDgL3bIOQvvjfZ/FsSCj2LlymHKdHYaZdW7Gn835AwBU//2a9KzLpTMYTAE8QE4kJxfWr9vpVrEyYiXmx8X2ev+j8GSzY/gm4s4ISsaXGunWVe2mh5pQXiJ3i+uLV/EVD+vjd+YgfGfWjSYjtFN2w3dnZiAg2lZ9z1CVLXpOXtnqzIZMZHZnnYYLEkvhEpMTEQav26TWR/zVdxx8O7IZYvYexxJRQnZ2rlEsvAuIhUtliKwK4qxF4jBStetqIMYgKi0TEkGA8ERiEwf4BGKDRulFCYtHOd586hr1nSt3d0QUgolU11lx3a70vu8TF9I5MxWBM8qT9eEAQ1CoJthsdtd9LIfEWUPsouWN3OnC3XXkP3G+E7FrrFjPQdVl+YHqHWFIGqG/J+cz8lmcUX41WSU5R/12vn17uRxskMtWuzRVl38sedr5It3TuPJI5k5kDe5yIqAqACoyBAHtcoamE4EyrWbet7MGi9BA5PNUY7FDjfYCTAQT1SKQDcAmMQiLKq1mX65WBP0QBL+ywRYu0dk3rSwx+AUAkCEFg8eLCHWJcYeYaSVKXOyT527qsXFsvieL/FjzLIPLjeMUAAAAASUVORK5CYII=",z2=$(),j2=z0(W0(),1),i=z0(e2(),1),K0={openai:H0,anthropic:E0,claude:E0,gemini:V0,google:V0,codex:H0,ollama:w2,azure:f2,bedrock:v2,deepseek:x2,github:k2,openrouter:b2,wandb:y2,marimo:A2,opencode:M2};const V=o=>{let e=(0,z2.c)(15),t,n,r;e[0]===o?(t=e[1],n=e[2],r=e[3]):({provider:n,className:r,...t}=o,e[0]=o,e[1]=t,e[2]=n,e[3]=r);let l=r===void 0?"":r;if(n==="openai-compatible"||!(n in K0)){let a;e[4]===l?a=e[5]:(a=I0("h-4 w-4",l),e[4]=l,e[5]=a);let d;return e[6]===a?d=e[7]:(d=(0,i.jsx)(G0,{className:a}),e[6]=a,e[7]=d),d}let p=K0[n],c;e[8]===l?c=e[9]:(c=I0("h-4 w-4 grayscale dark:invert",l),e[8]=l,e[9]=c);let m;return e[10]!==p||e[11]!==t||e[12]!==n||e[13]!==c?(m=(0,i.jsx)("img",{src:p,alt:n,className:c,...t}),e[10]=p,e[11]=t,e[12]=n,e[13]=c,e[14]=m):m=e[14],m};function U(o){switch(o){case"chat":return"bg-[var(--purple-3)] text-[var(--purple-11)]";case"autocomplete":return"bg-[var(--green-3)] text-[var(--green-11)]";case"edit":return"bg-[var(--blue-3)] text-[var(--blue-11)]";case"thinking":return"bg-[var(--purple-4)] text-[var(--purple-12)]"}return"bg-[var(--mauve-3)] text-[var(--mauve-11)]"}function Z0(o){switch(o){case"chat":return"Current model used for chat conversations";case"autocomplete":return"Current model used for autocomplete autocomplete";case"edit":return"Current model used for code edits";case"rerank":return"Current model used for reranking completions";case"embed":return"Current model used for embedding"}}var D=$();const G2=o=>{var a0,r0,n0,l0,d0,c0,m0,p0,h0,g0,u0,v0,f0,x0,k0,w0,M0,b0;let e=(0,D.c)(58),{value:t,placeholder:n,onSelect:r,triggerClassName:l,customDropdownContent:p,iconSize:c,showAddCustomModelDocs:m,forRole:a,displayIconOnly:d}=o,h=c===void 0?"medium":c,u=m===void 0?!1:m,g=d===void 0?!1:d,[v,f]=j2.useState(!1),s=j0(X0),k=j0(_0),{saveModelChange:x}=O0(),j=k.copilot==="custom"?(a0=s==null?void 0:s.models)==null?void 0:a0.autocomplete_model:void 0,G,I,M,B,P,b,S,L,C;if(e[0]!==((r0=s==null?void 0:s.models)==null?void 0:r0.autocomplete_model)||e[1]!==((n0=s==null?void 0:s.models)==null?void 0:n0.chat_model)||e[2]!==((l0=s==null?void 0:s.models)==null?void 0:l0.custom_models)||e[3]!==((d0=s==null?void 0:s.models)==null?void 0:d0.displayed_models)||e[4]!==((c0=s==null?void 0:s.models)==null?void 0:c0.edit_model)||e[5]!==j||e[6]!==g||e[7]!==a||e[8]!==h||e[9]!==v||e[10]!==r||e[11]!==n||e[12]!==x||e[13]!==l||e[14]!==t){let y0=R.create({customModels:[...((m0=s==null?void 0:s.models)==null?void 0:m0.custom_models)??[],(p0=s==null?void 0:s.models)==null?void 0:p0.chat_model,j,(h0=s==null?void 0:s.models)==null?void 0:h0.edit_model].filter(Boolean),displayedModels:(g0=s==null?void 0:s.models)==null?void 0:g0.displayed_models}),Q0=y0.getListModelsByProvider(),A=a==="autocomplete"?(u0=s==null?void 0:s.models)==null?void 0:u0.autocomplete_model:a==="chat"?(v0=s==null?void 0:s.models)==null?void 0:v0.chat_model:a==="edit"?(f0=s==null?void 0:s.models)==null?void 0:f0.edit_model:void 0,H=t?y.parse(t):A?y.parse(A):void 0,T=h==="medium"?"h-4 w-4":"h-3 w-3",Y0=(w,z)=>{let K=y0.getModel(w.id);return(0,i.jsxs)("div",{className:"flex items-center gap-2 w-full px-2 py-1",children:[(0,i.jsx)(V,{provider:w.providerId,className:T}),(0,i.jsxs)("div",{className:"flex flex-col",children:[(0,i.jsx)("span",{children:(K==null?void 0:K.name)||w.shortModelId}),(0,i.jsx)("span",{className:"text-xs text-muted-foreground",children:w.id})]}),(0,i.jsx)("div",{className:"ml-auto flex gap-1",children:(0,i.jsx)(t0,{content:Z0(z),children:(0,i.jsx)("span",{className:`text-xs px-1.5 py-0.5 rounded font-medium ${U(z)}`,children:z},z)})})]})},Q;e[24]!==a||e[25]!==r||e[26]!==x?(Q=w=>{r?r(w):x(w,a),f(!1)},e[24]=a,e[25]=r,e[26]=x,e[27]=Q):Q=e[27];let q=Q;I=d2,L=v,C=f;let J=`flex items-center justify-between px-2 py-0.5 border rounded-md
1
+ var R0=Object.defineProperty;var U0=(o,e,t)=>e in o?R0(o,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):o[e]=t;var A0=(o,e,t)=>U0(o,typeof e!="symbol"?e+"":e,t);import{s as z0}from"./chunk-LvLJmgfZ.js";import{l as D0,u as j0}from"./useEvent-DlWF5OMa.js";import{t as W0}from"./react-BGmjiNul.js";import{qn as G0}from"./cells-CibeVr5R.js";import{t as $}from"./compiler-runtime-DeeZ7FnK.js";import{t as q0}from"./capitalize-DQeWKRGx.js";import{d as J0}from"./hotkeys-uKX61F1_.js";import{c as _0,n as X0,x as $0}from"./utils-CJJIceVn.js";import{t as e2}from"./jsx-runtime-DN_bIXfG.js";import{t as I0}from"./cn-C1rgT0yh.js";import{n as B0}from"./once-CTiSlR1m.js";import{r as t2}from"./requests-C0HaHO6a.js";import{t as i2}from"./createLucideIcon-CW2xpJ57.js";import{_ as o2}from"./select-D0g5GnIs.js";import{u as s2}from"./toDate-5JckKRQn.js";import{a as a2,c as e0,d as P0,f as S0,p as r2,r as n2,s as l2,t as d2,u as L0}from"./dropdown-menu-BP4_BZLr.js";import{t as t0}from"./tooltip-CvjcEpZC.js";import{t as C0}from"./multi-map-fjX9ImVF.js";var N0=i2("brain",[["path",{d:"M12 18V5",key:"adv99a"}],["path",{d:"M15 13a4.17 4.17 0 0 1-3-4 4.17 4.17 0 0 1-3 4",key:"1e3is1"}],["path",{d:"M17.598 6.5A3 3 0 1 0 12 5a3 3 0 1 0-5.598 1.5",key:"1gqd8o"}],["path",{d:"M17.997 5.125a4 4 0 0 1 2.526 5.77",key:"iwvgf7"}],["path",{d:"M18 18a4 4 0 0 0 2-7.464",key:"efp6ie"}],["path",{d:"M19.967 17.483A4 4 0 1 1 12 18a4 4 0 1 1-7.967-.517",key:"1gq6am"}],["path",{d:"M6 18a4 4 0 0 1-2-7.464",key:"k1g0md"}],["path",{d:"M6.003 5.125a4 4 0 0 0-2.526 5.77",key:"q97ue3"}]]),c2=$(),m2=o=>{switch(o){case"chat":return"chat_model";case"autocomplete":return"autocomplete_model";case"edit":return"edit_model"}};const O0=()=>{let o=(0,c2.c)(12),[e,t]=D0($0),{saveUserConfig:n}=t2(),r;o[0]!==n||o[1]!==t?(r=async h=>{await n({config:h}).then(()=>{t(u=>({...u,...h}))})},o[0]=n,o[1]=t,o[2]=r):r=o[2];let l=r,p;o[3]!==l||o[4]!==e?(p=async(h,u)=>{var v,f,s,k,x;let g=m2(u);g&&l({ai:{...e.ai,models:{custom_models:((f=(v=e.ai)==null?void 0:v.models)==null?void 0:f.custom_models)??[],displayed_models:((k=(s=e.ai)==null?void 0:s.models)==null?void 0:k.displayed_models)??[],...(x=e.ai)==null?void 0:x.models,[g]:h}}})},o[3]=l,o[4]=e,o[5]=p):p=o[5];let c=p,m;o[6]!==l||o[7]!==e?(m=async h=>{l({ai:{...e.ai,mode:h}})},o[6]=l,o[7]=e,o[8]=m):m=o[8];let a=m,d;return o[9]!==a||o[10]!==c?(d={saveModelChange:c,saveModeChange:a},o[9]=a,o[10]=c,o[11]=d):d=o[11],d},T0=["openai","anthropic","google","ollama","bedrock","deepseek","azure","github","openrouter","wandb","marimo"];var y=class s0{constructor(e,t){this.providerId=e,this.shortModelId=t}get id(){return`${this.providerId}/${this.shortModelId}`}static parse(e){if(!e.includes("/"))return new s0(p2(e),e);let[t,...n]=e.split("/");return new s0(t,n.join("/"))}};function p2(o){return o.startsWith("gpt")||o.startsWith("o3")||o.startsWith("o1")?"openai":o.startsWith("claude")?"anthropic":o.startsWith("gemini")||o.startsWith("google")?"google":o.startsWith("deepseek")?"deepseek":"ollama"}function i0(o){return T0.includes(o)}const h2=[{name:"Claude 4.5 Opus",model:"claude-opus-4-5",description:"Latest Opus model with enhanced capabilities and performance improvements",providers:["anthropic"],roles:["chat","edit"],thinking:!0},{name:"Claude 4.5 Sonnet",model:"claude-sonnet-4-5",description:"Latest Sonnet model with enhanced capabilities and performance improvements",providers:["anthropic"],roles:["chat","edit"],thinking:!0},{name:"Claude 4.1 Opus",model:"claude-opus-4-1",description:"Latest Opus model with enhanced capabilities and performance improvements",providers:["anthropic"],roles:["chat","edit"],thinking:!0},{name:"Claude 4 Opus",model:"claude-opus-4-0",description:"Most capable model with superior performance on complex tasks and reasoning",providers:["anthropic"],roles:["chat","edit"],thinking:!0},{name:"Claude 4 Sonnet",model:"claude-sonnet-4-0",description:"Next-generation Sonnet model with advanced reasoning and multimodal capabilities",providers:["anthropic"],roles:["chat","edit"],thinking:!0},{name:"Claude 3.7 Sonnet",model:"claude-3-7-sonnet-latest",description:"Enhanced Sonnet model with improved capabilities",providers:["anthropic"],roles:["chat","edit"],thinking:!1},{name:"Claude 3.5 Sonnet",model:"claude-3-5-sonnet-latest",description:"Balanced model with strong performance across reasoning, math, and coding",providers:["anthropic"],roles:["chat","edit"],thinking:!1},{name:"Claude 3.5 Haiku",model:"claude-3-5-haiku-latest",description:"Fast and efficient model with excellent performance for everyday tasks",providers:["anthropic"],roles:["chat","edit"],thinking:!1},{name:"Gemini 3.0 Pro",model:"gemini-3-pro-preview",description:"Most capable Gemini model with advanced reasoning and large context support",providers:["google"],roles:["chat","edit"],thinking:!0},{name:"Gemini 2.5 Pro",model:"gemini-2.5-pro",description:"Most capable Gemini model with advanced reasoning and large context support",providers:["google"],roles:["chat","edit"],thinking:!1},{name:"Gemini 2.5 Pro Experimental",model:"gemini-2.5-pro-exp",description:"Experimental version of Gemini 2.5 Pro with latest improvements",providers:["google"],roles:["chat","edit"],thinking:!1},{name:"Gemini 2.5 Flash",model:"gemini-2.5-flash",description:"Adaptive thinking, cost efficiency",providers:["google"],roles:["chat","edit"],thinking:!1},{name:"Gemini 2.5 Flash Lite",model:"gemini-2.5-flash-lite",description:"Most cost-efficient model supporting high throughput",providers:["google"],roles:["chat","edit"],thinking:!1},{name:"Gemini 2.0 Flash",model:"gemini-2.0-flash",description:"Next-generation Flash model with improved performance and capabilities",providers:["google"],roles:["chat","edit"],thinking:!1},{name:"Gemini 2.0 Flash Experimental",model:"gemini-2.0-flash-exp",description:"Experimental version of Gemini 2.0 Flash with cutting-edge features",providers:["google"],roles:["chat","edit"],thinking:!1},{name:"Gemini 2.0 Flash Lite",model:"gemini-2.0-flash-lite",description:"Lightweight version of Gemini 2.0 Flash optimized for efficiency",providers:["google"],roles:["chat","edit"],thinking:!1},{name:"Gemini 2.0 Flash Thinking",model:"gemini-2.0-flash-thinking-exp-01-21",description:"Specialized reasoning model with enhanced thinking capabilities",providers:["google"],roles:["chat"],thinking:!0},{name:"Gemini 1.5 Flash",model:"gemini-1.5-flash",description:"Fast and efficient model optimized for speed and everyday tasks",providers:["google"],roles:["chat","edit"],thinking:!1},{name:"Gemini 1.5 Flash 8B",model:"gemini-1.5-flash-8b",description:"Lightweight version of Gemini 1.5 Flash with 8 billion parameters",providers:["google"],roles:["chat","edit"],thinking:!1},{name:"Gemini 1.5 Pro",model:"gemini-1.5-pro",description:"Advanced model with superior reasoning capabilities and large context window",providers:["google"],roles:["chat","edit"],thinking:!1},{name:"GPT-5",model:"gpt-5",description:"The best model for coding and agentic tasks across domains",providers:["openai","azure","github"],roles:["chat","edit"],thinking:!1},{name:"GPT-5 Mini",model:"gpt-5-mini",description:"A faster, cost-efficient version of GPT-5 for well-defined tasks",providers:["openai","azure","github"],roles:["chat","edit"],thinking:!1},{name:"GPT-5 Nano",model:"gpt-5-nano",description:"Fastest, most cost-efficient version of GPT-5",providers:["openai","azure"],roles:["chat","edit"],thinking:!1},{name:"GPT-4.1",model:"gpt-4.1",description:"Fast, highly intelligent model with largest context window (1 million tokens)",providers:["openai","azure"],roles:["chat","edit"],thinking:!1},{name:"GPT-4.1 Mini",model:"gpt-4.1-mini",description:"Balanced for intelligence, speed, and cost",providers:["openai","azure"],roles:["chat","edit"],thinking:!1},{name:"GPT-4o",model:"gpt-4o",description:"Fast, intelligent, flexible GPT model with multimodal capabilities",providers:["openai","azure"],roles:["chat","edit"],thinking:!1},{name:"GPT-4o Mini",model:"gpt-4o-mini",description:"Fast, affordable small model for focused tasks",providers:["openai","azure","github"],roles:["chat","edit"],thinking:!1},{name:"o3",model:"o3",description:"Our most powerful reasoning model with chain-of-thought capabilities",providers:["openai","azure"],roles:["chat","edit"],thinking:!0},{name:"o3 Mini",model:"o3-mini",description:"A small model alternative to o3 for reasoning tasks",providers:["openai","azure"],roles:["chat","edit"],thinking:!0},{name:"o3 Pro",model:"o3-pro",description:"Version of o3 designed to think longer and provide most reliable responses",providers:["openai","azure"],roles:["chat","edit"],thinking:!0},{name:"o4 Mini",model:"o4-mini",description:"Faster, more affordable reasoning model optimized for math, coding, and visual tasks",providers:["openai","azure"],roles:["chat","edit"],thinking:!0},{name:"GPT-3.5-turbo",model:"gpt-3.5-turbo",description:"Fast and efficient model with excellent performance for everyday tasks",providers:["github"],roles:["chat","edit"],thinking:!1},{name:"Claude 4.5 Sonnet (Bedrock)",model:"global.anthropic.claude-sonnet-4-5-20250929-v1:0",description:"Enhanced Sonnet model with improved capabilities",providers:["bedrock"],roles:["chat","edit"],thinking:!1},{name:"Claude 4.1 Opus (Bedrock)",model:"us.anthropic.claude-opus-4-1-20250805-v1:0",description:"Opus model for deep thinking",providers:["bedrock"],roles:["chat","edit"],thinking:!1},{name:"Claude 3.7 Sonnet (Bedrock)",model:"us.anthropic.claude-3-7-sonnet-20250219-v1:0",description:"Enhanced Sonnet model with improved capabilities",providers:["bedrock"],roles:["chat","edit"],thinking:!1},{name:"Claude 3.5 Sonnet v2 (Bedrock)",model:"us.anthropic.claude-3-5-sonnet-20241022-v2:0",description:"Balanced model with strong performance across reasoning, math, and coding",providers:["bedrock"],roles:["chat","edit"],thinking:!1},{name:"Claude 3.5 Haiku (Bedrock)",model:"us.anthropic.claude-3-5-haiku-20241022-v1:0",description:"Fast and efficient model with excellent performance for everyday tasks",providers:["bedrock"],roles:["chat","edit"],thinking:!1},{name:"Llama 3.3 70B Instruct",model:"us.meta.llama3-3-70b-instruct-v1:0",description:"Large language model optimized for instruction following and chat",providers:["bedrock"],roles:["chat","edit"],thinking:!1},{name:"Cohere Embed Multilingual v3",model:"cohere.embed-multilingual-v3",description:"Multilingual text embedding model for semantic search and similarity",providers:["bedrock"],roles:["embed"],thinking:!1},{name:"Cohere Rerank 3.5",model:"cohere.rerank-v3-5:0",description:"Advanced reranking model for improving search result relevance",providers:["bedrock"],roles:["rerank"],thinking:!1},{name:"gpt-oss 20b",model:"gpt-oss:20b",description:"OpenAI\u2019s open-weight models designed for powerful reasoning, agentic tasks, and versatile developer use cases.",providers:["ollama"],roles:["chat","edit"],thinking:!0},{name:"Qwen3 8b",model:"qwen3:8b",description:"Qwen3 is the latest generation of large language models in Qwen series.",providers:["ollama"],roles:["chat","edit"],thinking:!0},{name:"Gemma3 12b",model:"gemma3:12b",description:"Lightweight gemma models trained by Google, trained to run on a single GPU.",providers:["ollama"],roles:["chat","edit"],thinking:!0},{name:"Meta Llama 3.1 8B (W&B)",model:"meta-llama/Llama-3.1-8B-Instruct",description:"Efficient conversational model optimized for responsive multilingual chatbot interactions",providers:["wandb"],roles:["chat","edit"],thinking:!1},{name:"OpenAI GPT OSS 120B",model:"openai/gpt-oss-120b",description:"Efficient Mixture-of-Experts model designed for high-reasoning, agentic and general-purpose use cases",providers:["wandb"],roles:["chat","edit"],thinking:!0},{name:"OpenAI GPT OSS 20B",model:"openai/gpt-oss-20b",description:"Lower latency Mixture-of-Experts model trained on OpenAI's Harmony response format with reasoning capabilities",providers:["wandb"],roles:["chat","edit"],thinking:!0},{name:"DeepSeek V3-0324",model:"deepseek-ai/DeepSeek-V3-0324",description:"Robust Mixture-of-Experts model tailored for high-complexity language processing and comprehensive document analysis",providers:["wandb"],roles:["chat","edit"],thinking:!1},{name:"Meta Llama 3.3 70B (W&B)",model:"meta-llama/Llama-3.3-70B-Instruct",description:"Multilingual model excelling in conversational tasks, detailed instruction-following, and coding",providers:["wandb"],roles:["chat","edit"],thinking:!1},{name:"DeepSeek R1-0528",model:"deepseek-ai/DeepSeek-R1-0528",description:"Optimized for precise reasoning tasks including complex coding, math, and structured document analysis",providers:["wandb"],roles:["chat","edit"],thinking:!0},{name:"MoonshotAI Kimi K2",model:"moonshotai/Kimi-K2-Instruct",description:"Mixture-of-Experts model optimized for complex tool use, reasoning, and code synthesis",providers:["wandb"],roles:["chat","edit"],thinking:!0},{name:"Z.AI GLM 4.5",model:"zai-org/GLM-4.5",description:"Mixture-of-Experts model with user-controllable thinking/non-thinking modes for strong reasoning, code generation, and agent alignment",providers:["wandb"],roles:["chat","edit"],thinking:!0}],g2=[{name:"OpenAI",id:"openai",description:"OpenAI's API for GPT models, including GPT-3.5 and GPT-4.",url:"https://platform.openai.com/"},{name:"Amazon Bedrock",id:"bedrock",description:"Amazon Bedrock provides access to foundation models from Amazon and leading AI startups via a unified API.",url:"https://aws.amazon.com/bedrock/"},{name:"Azure",id:"azure",description:"Azure provides access to models via the Azure cloud.",url:"https://azure.microsoft.com/en-us/products/ai-services/"},{name:"Anthropic",id:"anthropic",description:"Anthropic's Claude models for conversational and completion tasks.",url:"https://www.anthropic.com/"},{name:"Google AI",id:"google",description:"Google's Vertex AI and PaLM APIs for generative and conversational models.",url:"https://cloud.google.com/vertex-ai/docs/generative-ai/learn/overview"},{name:"Ollama",id:"ollama",description:"Ollama is a lightweight, open-source model server for running and sharing LLMs.",url:"https://ollama.ai/"},{name:"GitHub",id:"github",description:"GitHub's API for GPT models with GitHub-hosted models.",url:"https://github.com/features/copilot"},{name:"marimo",id:"marimo",description:"marimo's hosted models.",url:"https://docs.marimo.io/guides/editor_features/ai_completion/"},{name:"DeepSeek",id:"deepseek",description:"DeepSeek's API for GPT models.",url:"https://deepseek.com/"},{name:"LM Studio",id:"lmstudio",description:"LM Studio's API for GPT models.",url:"https://lmstudio.ai/"},{name:"OpenRouter",id:"openrouter",description:"OpenRouter's API for GPT models.",url:"https://openrouter.ai/"},{name:"Mistral",id:"mistral",description:"Mistral's API for GPT models.",url:"https://mistral.ai/"},{name:"Vercel v0",id:"vercel",description:"Vercel's API for GPT models.",url:"https://vercel.com/"},{name:"Together AI",id:"together",description:"Together AI's API for GPT models.",url:"https://together.ai/"},{name:"xAI",id:"xai",description:"xAI's API for GPT models.",url:"https://x.ai/"},{name:"Weights & Biases",id:"wandb",description:"Weights & Biases' hosted models for ML development and AI inference.",url:"https://wandb.ai/"}];var u2=B0(()=>{let o=new Map;for(let e of h2){let t=e.model,n={...e,model:e.model,roles:e.roles.map(r=>r),providers:e.providers,custom:!1};for(let r of n.providers){let l=`${r}/${t}`;o.set(l,n)}}return o}),F0=B0(()=>{let o=new Map,e=new Map;return g2.forEach((t,n)=>{let r=t.id;o.set(r,t),e.set(r,n)}),{providerMap:o,providerToOrderIdx:e}}),R=class W{constructor(e,t){A0(this,"modelsByProviderMap",new C0);this.customModels=new Set(e),this.displayedModels=new Set(t),this.modelsMap=new Map,this.buildMaps()}static getProviderInfo(e){let{providerMap:t}=F0();return t.get(e)}static create(e){let{customModels:t=[],displayedModels:n=[]}=e;return new W(t.map(r=>y.parse(r).id),n.map(r=>y.parse(r).id))}buildMaps(){let e=W.buildMapsFromConfig({displayedModels:this.displayedModels,customModels:this.customModels});e.modelsMap.size===0&&(J0.error("The configured displayed_models have filtered out all registered models. Reverting back to showing all models.",[...this.displayedModels]),e=W.buildMapsFromConfig({displayedModels:new Set,customModels:this.customModels})),this.modelsByProviderMap=e.modelsByProviderMap,this.modelsMap=e.modelsMap}static buildMapsFromConfig(e){let{displayedModels:t,customModels:n}=e,r=t.size>0,l=u2(),p=new Map,c=new Map,m=new C0;for(let a of n){if(r&&!t.has(a))continue;let d=y.parse(a),h={name:d.shortModelId,model:d.shortModelId,description:"Custom model",providers:[d.providerId],roles:[],thinking:!1,custom:!0};p.set(a,h)}if(r)for(let a of t){let d=l.get(a);d&&c.set(a,d)}else c=new Map(l);c=new Map([...p,...c]);for(let[a,d]of c.entries()){let h=y.parse(a);m.add(h.providerId,d)}return{modelsByProviderMap:m,modelsMap:c}}getDisplayedModels(){return this.displayedModels}getCustomModels(){return this.customModels}getModelsByProvider(e){return this.modelsByProviderMap.get(e)||[]}getGroupedModelsByProvider(){return this.modelsByProviderMap}getListModelsByProvider(){let e=[...this.getGroupedModelsByProvider().entries()],t=F0().providerToOrderIdx;return e.sort((n,r)=>{let l=n[0],p=r[0];return(t.get(l)??0)-(t.get(p)??0)}),e}getModelsMap(){return this.modelsMap}getModel(e){return this.modelsMap.get(e)}},E0="data:image/svg+xml,%3csvg%20role='img'%20viewBox='0%200%2024%2024'%20xmlns='http://www.w3.org/2000/svg'%3e%3ctitle%3eAnthropic%3c/title%3e%3cpath%20d='M17.3041%203.541h-3.6718l6.696%2016.918H24Zm-10.6082%200L0%2020.459h3.7442l1.3693-3.5527h7.0052l1.3693%203.5528h3.7442L10.5363%203.5409Zm-.3712%2010.2232%202.2914-5.9456%202.2914%205.9456Z'/%3e%3c/svg%3e",v2="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20xml:space='preserve'%20y='0'%20x='0'%20id='Layer_1'%20version='1.1'%20viewBox='0%200%20300.67%20179.8'%3e%3cstyle%20id='style1855'%20type='text/css'%3e.st1{fill-rule:evenodd;clip-rule:evenodd;fill:%23f90}%3c/style%3e%3cg%20transform='translate(-1.668%20-1.1)'%20id='g1865'%3e%3cpath%20id='path1857'%20d='M86.4%2066.4c0%203.7.4%206.7%201.1%208.9.8%202.2%201.8%204.6%203.2%207.2.5.8.7%201.6.7%202.3%200%201-.6%202-1.9%203L83.2%2092c-.9.6-1.8.9-2.6.9-1%200-2-.5-3-1.4-1.4-1.5-2.6-3.1-3.6-4.7-1-1.7-2-3.6-3.1-5.9-7.8%209.2-17.6%2013.8-29.4%2013.8-8.4%200-15.1-2.4-20-7.2-4.9-4.8-7.4-11.2-7.4-19.2%200-8.5%203-15.4%209.1-20.6%206.1-5.2%2014.2-7.8%2024.5-7.8%203.4%200%206.9.3%2010.6.8%203.7.5%207.5%201.3%2011.5%202.2v-7.3c0-7.6-1.6-12.9-4.7-16-3.2-3.1-8.6-4.6-16.3-4.6-3.5%200-7.1.4-10.8%201.3-3.7.9-7.3%202-10.8%203.4-1.6.7-2.8%201.1-3.5%201.3-.7.2-1.2.3-1.6.3-1.4%200-2.1-1-2.1-3.1v-4.9c0-1.6.2-2.8.7-3.5.5-.7%201.4-1.4%202.8-2.1%203.5-1.8%207.7-3.3%2012.6-4.5C41%201.9%2046.2%201.3%2051.7%201.3c11.9%200%2020.6%202.7%2026.2%208.1%205.5%205.4%208.3%2013.6%208.3%2024.6v32.4zM45.8%2081.6c3.3%200%206.7-.6%2010.3-1.8%203.6-1.2%206.8-3.4%209.5-6.4%201.6-1.9%202.8-4%203.4-6.4.6-2.4%201-5.3%201-8.7v-4.2c-2.9-.7-6-1.3-9.2-1.7-3.2-.4-6.3-.6-9.4-.6-6.7%200-11.6%201.3-14.9%204-3.3%202.7-4.9%206.5-4.9%2011.5%200%204.7%201.2%208.2%203.7%2010.6%202.4%202.5%205.9%203.7%2010.5%203.7zm80.3%2010.8c-1.8%200-3-.3-3.8-1-.8-.6-1.5-2-2.1-3.9L96.7%2010.2c-.6-2-.9-3.3-.9-4%200-1.6.8-2.5%202.4-2.5h9.8c1.9%200%203.2.3%203.9%201%20.8.6%201.4%202%202%203.9l16.8%2066.2%2015.6-66.2c.5-2%201.1-3.3%201.9-3.9.8-.6%202.2-1%204-1h8c1.9%200%203.2.3%204%201%20.8.6%201.5%202%201.9%203.9l15.8%2067%2017.3-67c.6-2%201.3-3.3%202-3.9.8-.6%202.1-1%203.9-1h9.3c1.6%200%202.5.8%202.5%202.5%200%20.5-.1%201-.2%201.6-.1.6-.3%201.4-.7%202.5l-24.1%2077.3c-.6%202-1.3%203.3-2.1%203.9-.8.6-2.1%201-3.8%201h-8.6c-1.9%200-3.2-.3-4-1-.8-.7-1.5-2-1.9-4L156%2023l-15.4%2064.4c-.5%202-1.1%203.3-1.9%204-.8.7-2.2%201-4%201zm128.5%202.7c-5.2%200-10.4-.6-15.4-1.8-5-1.2-8.9-2.5-11.5-4-1.6-.9-2.7-1.9-3.1-2.8-.4-.9-.6-1.9-.6-2.8v-5.1c0-2.1.8-3.1%202.3-3.1.6%200%201.2.1%201.8.3.6.2%201.5.6%202.5%201%203.4%201.5%207.1%202.7%2011%203.5%204%20.8%207.9%201.2%2011.9%201.2%206.3%200%2011.2-1.1%2014.6-3.3%203.4-2.2%205.2-5.4%205.2-9.5%200-2.8-.9-5.1-2.7-7-1.8-1.9-5.2-3.6-10.1-5.2L246%2052c-7.3-2.3-12.7-5.7-16-10.2-3.3-4.4-5-9.3-5-14.5%200-4.2.9-7.9%202.7-11.1%201.8-3.2%204.2-6%207.2-8.2%203-2.3%206.4-4%2010.4-5.2%204-1.2%208.2-1.7%2012.6-1.7%202.2%200%204.5.1%206.7.4%202.3.3%204.4.7%206.5%201.1%202%20.5%203.9%201%205.7%201.6%201.8.6%203.2%201.2%204.2%201.8%201.4.8%202.4%201.6%203%202.5.6.8.9%201.9.9%203.3v4.7c0%202.1-.8%203.2-2.3%203.2-.8%200-2.1-.4-3.8-1.2-5.7-2.6-12.1-3.9-19.2-3.9-5.7%200-10.2.9-13.3%202.8-3.1%201.9-4.7%204.8-4.7%208.9%200%202.8%201%205.2%203%207.1%202%201.9%205.7%203.8%2011%205.5l14.2%204.5c7.2%202.3%2012.4%205.5%2015.5%209.6%203.1%204.1%204.6%208.8%204.6%2014%200%204.3-.9%208.2-2.6%2011.6-1.8%203.4-4.2%206.4-7.3%208.8-3.1%202.5-6.8%204.3-11.1%205.6-4.5%201.4-9.2%202.1-14.3%202.1z'%20fill='%23252f3e'/%3e%3cg%20id='g1863'%3e%3cpath%20id='path1859'%20d='M273.5%20143.7c-32.9%2024.3-80.7%2037.2-121.8%2037.2-57.6%200-109.5-21.3-148.7-56.7-3.1-2.8-.3-6.6%203.4-4.4%2042.4%2024.6%2094.7%2039.5%20148.8%2039.5%2036.5%200%2076.6-7.6%20113.5-23.2%205.5-2.5%2010.2%203.6%204.8%207.6z'%20class='st1'/%3e%3cpath%20id='path1861'%20d='M287.2%20128.1c-4.2-5.4-27.8-2.6-38.5-1.3-3.2.4-3.7-2.4-.8-4.5%2018.8-13.2%2049.7-9.4%2053.3-5%203.6%204.5-1%2035.4-18.6%2050.2-2.7%202.3-5.3%201.1-4.1-1.9%204-9.9%2012.9-32.2%208.7-37.5z'%20class='st1'/%3e%3c/g%3e%3c/g%3e%3c/svg%3e",f2="data:image/svg+xml,%3csvg%20width='150'%20height='150'%20viewBox='0%200%2096%2096'%20xmlns='http://www.w3.org/2000/svg'%3e%3cdefs%3e%3clinearGradient%20id='e399c19f-b68f-429d-b176-18c2117ff73c'%20x1='-1032.172'%20x2='-1059.213'%20y1='145.312'%20y2='65.426'%20gradientTransform='matrix(1%200%200%20-1%201075%20158)'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20offset='0'%20stop-color='%23114a8b'/%3e%3cstop%20offset='1'%20stop-color='%230669bc'/%3e%3c/linearGradient%3e%3clinearGradient%20id='ac2a6fc2-ca48-4327-9a3c-d4dcc3256e15'%20x1='-1023.725'%20x2='-1029.98'%20y1='108.083'%20y2='105.968'%20gradientTransform='matrix(1%200%200%20-1%201075%20158)'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20offset='0'%20stop-opacity='.3'/%3e%3cstop%20offset='.071'%20stop-opacity='.2'/%3e%3cstop%20offset='.321'%20stop-opacity='.1'/%3e%3cstop%20offset='.623'%20stop-opacity='.05'/%3e%3cstop%20offset='1'%20stop-opacity='0'/%3e%3c/linearGradient%3e%3clinearGradient%20id='a7fee970-a784-4bb1-af8d-63d18e5f7db9'%20x1='-1027.165'%20x2='-997.482'%20y1='147.642'%20y2='68.561'%20gradientTransform='matrix(1%200%200%20-1%201075%20158)'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20offset='0'%20stop-color='%233ccbf4'/%3e%3cstop%20offset='1'%20stop-color='%232892df'/%3e%3c/linearGradient%3e%3c/defs%3e%3cpath%20fill='url(%23e399c19f-b68f-429d-b176-18c2117ff73c)'%20d='M33.338%206.544h26.038l-27.03%2080.087a4.152%204.152%200%200%201-3.933%202.824H8.149a4.145%204.145%200%200%201-3.928-5.47L29.404%209.368a4.152%204.152%200%200%201%203.934-2.825z'/%3e%3cpath%20fill='%230078d4'%20d='M71.175%2060.261h-41.29a1.911%201.911%200%200%200-1.305%203.309l26.532%2024.764a4.171%204.171%200%200%200%202.846%201.121h23.38z'/%3e%3cpath%20fill='url(%23ac2a6fc2-ca48-4327-9a3c-d4dcc3256e15)'%20d='M33.338%206.544a4.118%204.118%200%200%200-3.943%202.879L4.252%2083.917a4.14%204.14%200%200%200%203.908%205.538h20.787a4.443%204.443%200%200%200%203.41-2.9l5.014-14.777%2017.91%2016.705a4.237%204.237%200%200%200%202.666.972H81.24L71.024%2060.261l-29.781.007L59.47%206.544z'/%3e%3cpath%20fill='url(%23a7fee970-a784-4bb1-af8d-63d18e5f7db9)'%20d='M66.595%209.364a4.145%204.145%200%200%200-3.928-2.82H33.648a4.146%204.146%200%200%201%203.928%202.82l25.184%2074.62a4.146%204.146%200%200%201-3.928%205.472h29.02a4.146%204.146%200%200%200%203.927-5.472z'/%3e%3c/svg%3e",x2="data:image/svg+xml,%3csvg%20fill='currentColor'%20fill-rule='evenodd'%20height='1em'%20style='flex:none;line-height:1'%20viewBox='0%200%2024%2024'%20width='1em'%20xmlns='http://www.w3.org/2000/svg'%3e%3ctitle%3eDeepSeek%3c/title%3e%3cpath%20d='M23.748%204.482c-.254-.124-.364.113-.512.234-.051.039-.094.09-.137.136-.372.397-.806.657-1.373.626-.829-.046-1.537.214-2.163.848-.133-.782-.575-1.248-1.247-1.548-.352-.156-.708-.311-.955-.65-.172-.241-.219-.51-.305-.774-.055-.16-.11-.323-.293-.35-.2-.031-.278.136-.356.276-.313.572-.434%201.202-.422%201.84.027%201.436.633%202.58%201.838%203.393.137.093.172.187.129.323-.082.28-.18.552-.266.833-.055.179-.137.217-.329.14a5.526%205.526%200%2001-1.736-1.18c-.857-.828-1.631-1.742-2.597-2.458a11.365%2011.365%200%2000-.689-.471c-.985-.957.13-1.743.388-1.836.27-.098.093-.432-.779-.428-.872.004-1.67.295-2.687.684a3.055%203.055%200%2001-.465.137%209.597%209.597%200%2000-2.883-.102c-1.885.21-3.39%201.102-4.497%202.623C.082%208.606-.231%2010.684.152%2012.85c.403%202.284%201.569%204.175%203.36%205.653%201.858%201.533%203.997%202.284%206.438%202.14%201.482-.085%203.133-.284%204.994-1.86.47.234.962.327%201.78.397.63.059%201.236-.03%201.705-.128.735-.156.684-.837.419-.961-2.155-1.004-1.682-.595-2.113-.926%201.096-1.296%202.746-2.642%203.392-7.003.05-.347.007-.565%200-.845-.004-.17.035-.237.23-.256a4.173%204.173%200%20001.545-.475c1.396-.763%201.96-2.015%202.093-3.517.02-.23-.004-.467-.247-.588zM11.581%2018c-2.089-1.642-3.102-2.183-3.52-2.16-.392.024-.321.471-.235.763.09.288.207.486.371.739.114.167.192.416-.113.603-.673.416-1.842-.14-1.897-.167-1.361-.802-2.5-1.86-3.301-3.307-.774-1.393-1.224-2.887-1.298-4.482-.02-.386.093-.522.477-.592a4.696%204.696%200%20011.529-.039c2.132.312%203.946%201.265%205.468%202.774.868.86%201.525%201.887%202.202%202.891.72%201.066%201.494%202.082%202.48%202.914.348.292.625.514.891.677-.802.09-2.14.11-3.054-.614zm1-6.44a.306.306%200%2001.415-.287.302.302%200%2001.2.288.306.306%200%2001-.31.307.303.303%200%2001-.304-.308zm3.11%201.596c-.2.081-.399.151-.59.16a1.245%201.245%200%2001-.798-.254c-.274-.23-.47-.358-.552-.758a1.73%201.73%200%2001.016-.588c.07-.327-.008-.537-.239-.727-.187-.156-.426-.199-.688-.199a.559.559%200%2001-.254-.078c-.11-.054-.2-.19-.114-.358.028-.054.16-.186.192-.21.356-.202.767-.136%201.146.016.352.144.618.408%201.001.782.391.451.462.576.685.914.176.265.336.537.445.848.067.195-.019.354-.25.452z'%3e%3c/path%3e%3c/svg%3e",k2="data:image/svg+xml,%3csvg%20role='img'%20viewBox='0%200%2024%2024'%20xmlns='http://www.w3.org/2000/svg'%3e%3ctitle%3eGitHub%3c/title%3e%3cpath%20d='M12%20.297c-6.63%200-12%205.373-12%2012%200%205.303%203.438%209.8%208.205%2011.385.6.113.82-.258.82-.577%200-.285-.01-1.04-.015-2.04-3.338.724-4.042-1.61-4.042-1.61C4.422%2018.07%203.633%2017.7%203.633%2017.7c-1.087-.744.084-.729.084-.729%201.205.084%201.838%201.236%201.838%201.236%201.07%201.835%202.809%201.305%203.495.998.108-.776.417-1.305.76-1.605-2.665-.3-5.466-1.332-5.466-5.93%200-1.31.465-2.38%201.235-3.22-.135-.303-.54-1.523.105-3.176%200%200%201.005-.322%203.3%201.23.96-.267%201.98-.399%203-.405%201.02.006%202.04.138%203%20.405%202.28-1.552%203.285-1.23%203.285-1.23.645%201.653.24%202.873.12%203.176.765.84%201.23%201.91%201.23%203.22%200%204.61-2.805%205.625-5.475%205.92.42.36.81%201.096.81%202.22%200%201.606-.015%202.896-.015%203.286%200%20.315.21.69.825.57C20.565%2022.092%2024%2017.592%2024%2012.297c0-6.627-5.373-12-12-12'/%3e%3c/svg%3e",V0="data:image/svg+xml,%3csvg%20role='img'%20viewBox='0%200%2024%2024'%20xmlns='http://www.w3.org/2000/svg'%3e%3ctitle%3eGoogle%20Gemini%3c/title%3e%3cpath%20d='M11.04%2019.32Q12%2021.51%2012%2024q0-2.49.93-4.68.96-2.19%202.58-3.81t3.81-2.55Q21.51%2012%2024%2012q-2.49%200-4.68-.93a12.3%2012.3%200%200%201-3.81-2.58%2012.3%2012.3%200%200%201-2.58-3.81Q12%202.49%2012%200q0%202.49-.96%204.68-.93%202.19-2.55%203.81a12.3%2012.3%200%200%201-3.81%202.58Q2.49%2012%200%2012q2.49%200%204.68.96%202.19.93%203.81%202.55t2.55%203.81'/%3e%3c/svg%3e",w2="data:image/svg+xml,%3csvg%20role='img'%20viewBox='0%200%2024%2024'%20xmlns='http://www.w3.org/2000/svg'%3e%3ctitle%3eOllama%3c/title%3e%3cpath%20d='M16.361%2010.26a.894.894%200%200%200-.558.47l-.072.148.001.207c0%20.193.004.217.059.353.076.193.152.312.291.448.24.238.51.3.872.205a.86.86%200%200%200%20.517-.436.752.752%200%200%200%20.08-.498c-.064-.453-.33-.782-.724-.897a1.06%201.06%200%200%200-.466%200zm-9.203.005c-.305.096-.533.32-.65.639a1.187%201.187%200%200%200-.06.52c.057.309.31.59.598.667.362.095.632.033.872-.205.14-.136.215-.255.291-.448.055-.136.059-.16.059-.353l.001-.207-.072-.148a.894.894%200%200%200-.565-.472%201.02%201.02%200%200%200-.474.007Zm4.184%202c-.131.071-.223.25-.195.383.031.143.157.288.353.407.105.063.112.072.117.136.004.038-.01.146-.029.243-.02.094-.036.194-.036.222.002.074.07.195.143.253.064.052.076.054.255.059.164.005.198.001.264-.03.169-.082.212-.234.15-.525-.052-.243-.042-.28.087-.355.137-.08.281-.219.324-.314a.365.365%200%200%200-.175-.48.394.394%200%200%200-.181-.033c-.126%200-.207.03-.355.124l-.085.053-.053-.032c-.219-.13-.259-.145-.391-.143a.396.396%200%200%200-.193.032zm.39-2.195c-.373.036-.475.05-.654.086-.291.06-.68.195-.951.328-.94.46-1.589%201.226-1.787%202.114-.04.176-.045.234-.045.53%200%20.294.005.357.043.524.264%201.16%201.332%202.017%202.714%202.173.3.033%201.596.033%201.896%200%201.11-.125%202.064-.727%202.493-1.571.114-.226.169-.372.22-.602.039-.167.044-.23.044-.523%200-.297-.005-.355-.045-.531-.288-1.29-1.539-2.304-3.072-2.497a6.873%206.873%200%200%200-.855-.031zm.645.937a3.283%203.283%200%200%201%201.44.514c.223.148.537.458.671.662.166.251.26.508.303.82.02.143.01.251-.043.482-.08.345-.332.705-.672.957a3.115%203.115%200%200%201-.689.348c-.382.122-.632.144-1.525.138-.582-.006-.686-.01-.853-.042-.57-.107-1.022-.334-1.35-.68-.264-.28-.385-.535-.45-.946-.03-.192.025-.509.137-.776.136-.326.488-.73.836-.963.403-.269.934-.46%201.422-.512.187-.02.586-.02.773-.002zm-5.503-11a1.653%201.653%200%200%200-.683.298C5.617.74%205.173%201.666%204.985%202.819c-.07.436-.119%201.04-.119%201.503%200%20.544.064%201.24.155%201.721.02.107.031.202.023.208a8.12%208.12%200%200%201-.187.152%205.324%205.324%200%200%200-.949%201.02%205.49%205.49%200%200%200-.94%202.339%206.625%206.625%200%200%200-.023%201.357c.091.78.325%201.438.727%202.04l.13.195-.037.064c-.269.452-.498%201.105-.605%201.732-.084.496-.095.629-.095%201.294%200%20.67.009.803.088%201.266.095.555.288%201.143.503%201.534.071.128.243.393.264.407.007.003-.014.067-.046.141a7.405%207.405%200%200%200-.548%201.873c-.062.417-.071.552-.071.991%200%20.56.031.832.148%201.279L3.42%2024h1.478l-.05-.091c-.297-.552-.325-1.575-.068-2.597.117-.472.25-.819.498-1.296l.148-.29v-.177c0-.165-.003-.184-.057-.293a.915.915%200%200%200-.194-.25%201.74%201.74%200%200%201-.385-.543c-.424-.92-.506-2.286-.208-3.451.124-.486.329-.918.544-1.154a.787.787%200%200%200%20.223-.531c0-.195-.07-.355-.224-.522a3.136%203.136%200%200%201-.817-1.729c-.14-.96.114-2.005.69-2.834.563-.814%201.353-1.336%202.237-1.475.199-.033.57-.028.776.01.226.04.367.028.512-.041.179-.085.268-.19.374-.431.093-.215.165-.333.36-.576.234-.29.46-.489.822-.729.413-.27.884-.467%201.352-.561.17-.035.25-.04.569-.04.319%200%20.398.005.569.04a4.07%204.07%200%200%201%201.914.997c.117.109.398.457.488.602.034.057.095.177.132.267.105.241.195.346.374.43.14.068.286.082.503.045.343-.058.607-.053.943.016%201.144.23%202.14%201.173%202.581%202.437.385%201.108.276%202.267-.296%203.153-.097.15-.193.27-.333.419-.301.322-.301.722-.001%201.053.493.539.801%201.866.708%203.036-.062.772-.26%201.463-.533%201.854a2.096%202.096%200%200%201-.224.258.916.916%200%200%200-.194.25c-.054.109-.057.128-.057.293v.178l.148.29c.248.476.38.823.498%201.295.253%201.008.231%202.01-.059%202.581a.845.845%200%200%200-.044.098c0%20.006.329.009.732.009h.73l.02-.074.036-.134c.019-.076.057-.3.088-.516.029-.217.029-1.016%200-1.258-.11-.875-.295-1.57-.597-2.226-.032-.074-.053-.138-.046-.141.008-.005.057-.074.108-.152.376-.569.607-1.284.724-2.228.031-.26.031-1.378%200-1.628-.083-.645-.182-1.082-.348-1.525a6.083%206.083%200%200%200-.329-.7l-.038-.064.131-.194c.402-.604.636-1.262.727-2.04a6.625%206.625%200%200%200-.024-1.358%205.512%205.512%200%200%200-.939-2.339%205.325%205.325%200%200%200-.95-1.02%208.097%208.097%200%200%201-.186-.152.692.692%200%200%201%20.023-.208c.208-1.087.201-2.443-.017-3.503-.19-.924-.535-1.658-.98-2.082-.354-.338-.716-.482-1.15-.455-.996.059-1.8%201.205-2.116%203.01a6.805%206.805%200%200%200-.097.726c0%20.036-.007.066-.015.066a.96.96%200%200%201-.149-.078A4.857%204.857%200%200%200%2012%203.03c-.832%200-1.687.243-2.456.698a.958.958%200%200%201-.148.078c-.008%200-.015-.03-.015-.066a6.71%206.71%200%200%200-.097-.725C8.997%201.392%208.337.319%207.46.048a2.096%202.096%200%200%200-.585-.041Zm.293%201.402c.248.197.523.759.682%201.388.03.113.06.244.069.292.007.047.026.152.041.233.067.365.098.76.102%201.24l.002.475-.12.175-.118.178h-.278c-.324%200-.646.041-.954.124l-.238.06c-.033.007-.038-.003-.057-.144a8.438%208.438%200%200%201%20.016-2.323c.124-.788.413-1.501.696-1.711.067-.05.079-.049.157.013zm9.825-.012c.17.126.358.46.498.888.28.854.36%202.028.212%203.145-.019.14-.024.151-.057.144l-.238-.06a3.693%203.693%200%200%200-.954-.124h-.278l-.119-.178-.119-.175.002-.474c.004-.669.066-1.19.214-1.772.157-.623.434-1.185.68-1.382.078-.062.09-.063.159-.012z'/%3e%3c/svg%3e",H0="data:image/svg+xml,%3csvg%20role='img'%20viewBox='0%200%2024%2024'%20xmlns='http://www.w3.org/2000/svg'%3e%3ctitle%3eOpenAI%3c/title%3e%3cpath%20d='M22.2819%209.8211a5.9847%205.9847%200%200%200-.5157-4.9108%206.0462%206.0462%200%200%200-6.5098-2.9A6.0651%206.0651%200%200%200%204.9807%204.1818a5.9847%205.9847%200%200%200-3.9977%202.9%206.0462%206.0462%200%200%200%20.7427%207.0966%205.98%205.98%200%200%200%20.511%204.9107%206.051%206.051%200%200%200%206.5146%202.9001A5.9847%205.9847%200%200%200%2013.2599%2024a6.0557%206.0557%200%200%200%205.7718-4.2058%205.9894%205.9894%200%200%200%203.9977-2.9001%206.0557%206.0557%200%200%200-.7475-7.0729zm-9.022%2012.6081a4.4755%204.4755%200%200%201-2.8764-1.0408l.1419-.0804%204.7783-2.7582a.7948.7948%200%200%200%20.3927-.6813v-6.7369l2.02%201.1686a.071.071%200%200%201%20.038.052v5.5826a4.504%204.504%200%200%201-4.4945%204.4944zm-9.6607-4.1254a4.4708%204.4708%200%200%201-.5346-3.0137l.142.0852%204.783%202.7582a.7712.7712%200%200%200%20.7806%200l5.8428-3.3685v2.3324a.0804.0804%200%200%201-.0332.0615L9.74%2019.9502a4.4992%204.4992%200%200%201-6.1408-1.6464zM2.3408%207.8956a4.485%204.485%200%200%201%202.3655-1.9728V11.6a.7664.7664%200%200%200%20.3879.6765l5.8144%203.3543-2.0201%201.1685a.0757.0757%200%200%201-.071%200l-4.8303-2.7865A4.504%204.504%200%200%201%202.3408%207.872zm16.5963%203.8558L13.1038%208.364%2015.1192%207.2a.0757.0757%200%200%201%20.071%200l4.8303%202.7913a4.4944%204.4944%200%200%201-.6765%208.1042v-5.6772a.79.79%200%200%200-.407-.667zm2.0107-3.0231l-.142-.0852-4.7735-2.7818a.7759.7759%200%200%200-.7854%200L9.409%209.2297V6.8974a.0662.0662%200%200%201%20.0284-.0615l4.8303-2.7866a4.4992%204.4992%200%200%201%206.6802%204.66zM8.3065%2012.863l-2.02-1.1638a.0804.0804%200%200%201-.038-.0567V6.0742a4.4992%204.4992%200%200%201%207.3757-3.4537l-.142.0805L8.704%205.459a.7948.7948%200%200%200-.3927.6813zm1.0976-2.3654l2.602-1.4998%202.6069%201.4998v2.9994l-2.5974%201.4997-2.6067-1.4997Z'/%3e%3c/svg%3e",M2="data:image/svg+xml,%3csvg%20width='240'%20height='300'%20viewBox='0%200%20240%20300'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20clip-path='url(%23clip0_1401_86274)'%3e%3cmask%20id='mask0_1401_86274'%20style='mask-type:luminance'%20maskUnits='userSpaceOnUse'%20x='0'%20y='0'%20width='240'%20height='300'%3e%3cpath%20d='M240%200H0V300H240V0Z'%20fill='white'/%3e%3c/mask%3e%3cg%20mask='url(%23mask0_1401_86274)'%3e%3cpath%20d='M180%20240H60V120H180V240Z'%20fill='%23CFCECD'/%3e%3cpath%20d='M180%2060H60V240H180V60ZM240%20300H0V0H240V300Z'%20fill='%23211E1E'/%3e%3c/g%3e%3c/g%3e%3cdefs%3e%3cclipPath%20id='clip0_1401_86274'%3e%3crect%20width='240'%20height='300'%20fill='white'/%3e%3c/clipPath%3e%3c/defs%3e%3c/svg%3e",b2="data:image/svg+xml,%3csvg%20fill='currentColor'%20fill-rule='evenodd'%20height='1em'%20style='flex:none;line-height:1'%20viewBox='0%200%2024%2024'%20width='1em'%20xmlns='http://www.w3.org/2000/svg'%3e%3ctitle%3eOpenRouter%3c/title%3e%3cpath%20d='M16.804%201.957l7.22%204.105v.087L16.73%2010.21l.017-2.117-.821-.03c-1.059-.028-1.611.002-2.268.11-1.064.175-2.038.577-3.147%201.352L8.345%2011.03c-.284.195-.495.336-.68.455l-.515.322-.397.234.385.23.53.338c.476.314%201.17.796%202.701%201.866%201.11.775%202.083%201.177%203.147%201.352l.3.045c.694.091%201.375.094%202.825.033l.022-2.159%207.22%204.105v.087L16.589%2022l.014-1.862-.635.022c-1.386.042-2.137.002-3.138-.162-1.694-.28-3.26-.926-4.881-2.059l-2.158-1.5a21.997%2021.997%200%2000-.755-.498l-.467-.28a55.927%2055.927%200%2000-.76-.43C2.908%2014.73.563%2014.116%200%2014.116V9.888l.14.004c.564-.007%202.91-.622%203.809-1.124l1.016-.58.438-.274c.428-.28%201.072-.726%202.686-1.853%201.621-1.133%203.186-1.78%204.881-2.059%201.152-.19%201.974-.213%203.814-.138l.02-1.907z'%3e%3c/path%3e%3c/svg%3e",y2="data:image/svg+xml,%3csvg%20role='img'%20viewBox='0%200%2024%2024'%20xmlns='http://www.w3.org/2000/svg'%3e%3ctitle%3eWeights%20&%20Biases%3c/title%3e%3cpath%20d='M2.48%200a1.55%201.55%200%201%200%200%203.1%201.55%201.55%200%200%200%200-3.1zm19.04%200a1.55%201.55%200%201%200%200%203.101%201.55%201.55%200%200%200%200-3.101zM12%202.295a1.55%201.55%200%201%200%200%203.1%201.55%201.55%200%200%200%200-3.1zM2.48%205.272a2.48%202.48%200%201%200%200%204.96%202.48%202.48%200%200%200%200-4.96zm19.04%200a2.48%202.48%200%201%200%200%204.96%202.48%202.48%200%200%200%200-4.96zM12%208.496a1.55%201.55%200%201%200%200%203.1%201.55%201.55%200%200%200%200-3.1zm-9.52%203.907a1.55%201.55%200%201%200%200%203.1%201.55%201.55%200%200%200%200-3.1zm19.04%200a1.55%201.55%200%201%200%200%203.102%201.55%201.55%200%200%200%200-3.102zM12%2013.767a2.48%202.48%200%201%200%200%204.962%202.48%202.48%200%200%200%200-4.962zm-9.52%203.907a2.48%202.48%200%201%200%20.001%204.962%202.48%202.48%200%200%200%200-4.962zm19.04.93a1.55%201.55%200%201%200%200%203.102%201.55%201.55%200%200%200%200-3.101zM12%2020.9a1.55%201.55%200%201%200%200%203.1%201.55%201.55%200%200%200%200-3.1Z'/%3e%3c/svg%3e",A2="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAAXNSR0IArs4c6QAABtlJREFUWEetV21QlNcVfs67y67KV/EjJIRdBIxJrB9BotFqAtERTIKkk8SxNiGt7Ipa46DsxvjR0rVTKuKKJFYTE1SIxmhFbR0Kwc4YNSraqmNswhSFIrBUBD8QVGTZfU/nvrDLroqQ4Pm179nnnvvc5557zr2EXlj05hSfhgvO10AUB/A4AOHEFMCADOJrBFQx0zki+ajkkA9eyslr6kVYBUIPA8ZaLOr/ttQtYJKXgRHSy6B2EBVKwMZqa+6hnsZ0S2DY8jlD2uxSIYDxPQVx/S+CSZIEpyx3rI5wXIZsslm3neouxoMJMEhvNv6JwcvcwYkw8kk9xoZFYOjgYAT2HwBZlnH99i1UNtbj9KVKVDZcho9KhX4+GtgdDrQ52sVwGYQcbduAFRUbNrTdS+R+AhaLpL9Vu4kZ8wTYV6vFrydNxTsTY/Bk0KCHinHxymVsP/E1vjz1jRvXSQIEOqGxO39esWFbo2cQbwIzZ6r0QwPSWUa6APlp++GgyYLgwCB8dqQEs8a/iEF+/j3uSPW1RqTt2orTVRfBHmgCyjQaObZidRcJLwJPL032b3XSEQaixMqTJr6s7GlDcxNOVpZj13wz9IOG9EhAABxOJ5buyUfB6RNeeCKU+vnpYsssFrvXKYhImzvcQfJXDISH/GQg5kyeiqzifYh5eiSss+ZgoK9fryb2BMnMeG/HZhR+e/peEmtqrFuU/OpQwGKRdC21pSLjJZKwMuEtZBbtw6ujx+LDXxohfD/WWu12JH6UgfL6OncIAtpVKh5VlbW1XCGgMxlnA7xT/H4zeiLO26oVCUtMv1cyuq/2na0aMz7KcB/PzjO6rdaam6wQ0JuNx5h5EhFhybQZyD54AJuS5iNhzPN9nds9fsXeHdhRetgz3m2nv+ox6ig4qnqAped04UqWn6utwr/SrVBLKmWAkPHClS4Jw4c8jsbmmzheUYaA/r6YPjJKUcp24yqOlH8PiQgvDv8pQj2Obf3NG5i8erlSH9wmcTyFmQ2vyQxR8ZASE48vTh7BlGdGYWOSUgYU+76uBtPXW9zfyZOnYnvpYbQ7nYovSh+BJXGvY27en13FB1ofH+Qlp2LyUyPc4xZ/uQX7zohUcxmvJJ05OQ1M64TrMf9ANLTcxOK4RKTFJXZLQKxQZLin9ffRoLVdOVluGxsWib8tWun+/uZCGd7+NNsTkk+hJkMOAanCK2S8225HeuIsGF+a1i2B0KDBGB4cgkP/Oe/GaNRqxI14DkcvlqG59Y7iF/Eurv7EjRGKjU5Pxe22uy7fYdKZjflgfteT1gevvIGFU1/tlsCnv1qIV0ZFY8If30dd0zUFN2PMOGxKWoDMogJsPFSk+IRS1Wu3eKky6+O1KK0sV3xEKBdNZzszv+OJSvpZLDLe6HLdmwP5hsWY8uxoxK5ZoTQiYTOfn4TsXxiw/h8HkF3y124JLCv4HDtPHu2YjtBIOpNhI4DfeBKIDovE/kXLu1WgLwQy/74Xm74udsVuIr3JsJSBNZ4EREs9tyoH/v36K+5HqUBG4R5sPlzSqQDZSG8yTmPwQReBwX7+uHqrBetnG5Sq+KgJpO7Mxf6zJztzgI5TsDnJV8PaRoCV5Y4bOkyp2888EYqChR8owLob15TG5LJ5sdMxIkSHjMK/oKH5puIeHzEcb0+IwVffnUXx+TOuCZAz2+iVhFOyfoeKhsudKUAbOkuxoYAZbwqvODqvR43H7n8ew/73liN6aKRXgL58VDbU4+Ws37pDSISEDgL3bIOQvvjfZ/FsSCj2LlymHKdHYaZdW7Gn835AwBU//2a9KzLpTMYTAE8QE4kJxfWr9vpVrEyYiXmx8X2ev+j8GSzY/gm4s4ISsaXGunWVe2mh5pQXiJ3i+uLV/EVD+vjd+YgfGfWjSYjtFN2w3dnZiAg2lZ9z1CVLXpOXtnqzIZMZHZnnYYLEkvhEpMTEQav26TWR/zVdxx8O7IZYvYexxJRQnZ2rlEsvAuIhUtliKwK4qxF4jBStetqIMYgKi0TEkGA8ERiEwf4BGKDRulFCYtHOd586hr1nSt3d0QUgolU11lx3a70vu8TF9I5MxWBM8qT9eEAQ1CoJthsdtd9LIfEWUPsouWN3OnC3XXkP3G+E7FrrFjPQdVl+YHqHWFIGqG/J+cz8lmcUX41WSU5R/12vn17uRxskMtWuzRVl38sedr5It3TuPJI5k5kDe5yIqAqACoyBAHtcoamE4EyrWbet7MGi9BA5PNUY7FDjfYCTAQT1SKQDcAmMQiLKq1mX65WBP0QBL+ywRYu0dk3rSwx+AUAkCEFg8eLCHWJcYeYaSVKXOyT527qsXFsvieL/FjzLIPLjeMUAAAAASUVORK5CYII=",z2=$(),j2=z0(W0(),1),i=z0(e2(),1),K0={openai:H0,anthropic:E0,claude:E0,gemini:V0,google:V0,codex:H0,ollama:w2,azure:f2,bedrock:v2,deepseek:x2,github:k2,openrouter:b2,wandb:y2,marimo:A2,opencode:M2};const V=o=>{let e=(0,z2.c)(15),t,n,r;e[0]===o?(t=e[1],n=e[2],r=e[3]):({provider:n,className:r,...t}=o,e[0]=o,e[1]=t,e[2]=n,e[3]=r);let l=r===void 0?"":r;if(n==="openai-compatible"||!(n in K0)){let a;e[4]===l?a=e[5]:(a=I0("h-4 w-4",l),e[4]=l,e[5]=a);let d;return e[6]===a?d=e[7]:(d=(0,i.jsx)(G0,{className:a}),e[6]=a,e[7]=d),d}let p=K0[n],c;e[8]===l?c=e[9]:(c=I0("h-4 w-4 grayscale dark:invert",l),e[8]=l,e[9]=c);let m;return e[10]!==p||e[11]!==t||e[12]!==n||e[13]!==c?(m=(0,i.jsx)("img",{src:p,alt:n,className:c,...t}),e[10]=p,e[11]=t,e[12]=n,e[13]=c,e[14]=m):m=e[14],m};function U(o){switch(o){case"chat":return"bg-[var(--purple-3)] text-[var(--purple-11)]";case"autocomplete":return"bg-[var(--green-3)] text-[var(--green-11)]";case"edit":return"bg-[var(--blue-3)] text-[var(--blue-11)]";case"thinking":return"bg-[var(--purple-4)] text-[var(--purple-12)]"}return"bg-[var(--mauve-3)] text-[var(--mauve-11)]"}function Z0(o){switch(o){case"chat":return"Current model used for chat conversations";case"autocomplete":return"Current model used for autocomplete autocomplete";case"edit":return"Current model used for code edits";case"rerank":return"Current model used for reranking completions";case"embed":return"Current model used for embedding"}}var D=$();const G2=o=>{var a0,r0,n0,l0,d0,c0,m0,p0,h0,g0,u0,v0,f0,x0,k0,w0,M0,b0;let e=(0,D.c)(58),{value:t,placeholder:n,onSelect:r,triggerClassName:l,customDropdownContent:p,iconSize:c,showAddCustomModelDocs:m,forRole:a,displayIconOnly:d}=o,h=c===void 0?"medium":c,u=m===void 0?!1:m,g=d===void 0?!1:d,[v,f]=j2.useState(!1),s=j0(X0),k=j0(_0),{saveModelChange:x}=O0(),j=k.copilot==="custom"?(a0=s==null?void 0:s.models)==null?void 0:a0.autocomplete_model:void 0,G,I,M,B,P,b,S,L,C;if(e[0]!==((r0=s==null?void 0:s.models)==null?void 0:r0.autocomplete_model)||e[1]!==((n0=s==null?void 0:s.models)==null?void 0:n0.chat_model)||e[2]!==((l0=s==null?void 0:s.models)==null?void 0:l0.custom_models)||e[3]!==((d0=s==null?void 0:s.models)==null?void 0:d0.displayed_models)||e[4]!==((c0=s==null?void 0:s.models)==null?void 0:c0.edit_model)||e[5]!==j||e[6]!==g||e[7]!==a||e[8]!==h||e[9]!==v||e[10]!==r||e[11]!==n||e[12]!==x||e[13]!==l||e[14]!==t){let y0=R.create({customModels:[...((m0=s==null?void 0:s.models)==null?void 0:m0.custom_models)??[],(p0=s==null?void 0:s.models)==null?void 0:p0.chat_model,j,(h0=s==null?void 0:s.models)==null?void 0:h0.edit_model].filter(Boolean),displayedModels:(g0=s==null?void 0:s.models)==null?void 0:g0.displayed_models}),Q0=y0.getListModelsByProvider(),A=a==="autocomplete"?(u0=s==null?void 0:s.models)==null?void 0:u0.autocomplete_model:a==="chat"?(v0=s==null?void 0:s.models)==null?void 0:v0.chat_model:a==="edit"?(f0=s==null?void 0:s.models)==null?void 0:f0.edit_model:void 0,H=t?y.parse(t):A?y.parse(A):void 0,T=h==="medium"?"h-4 w-4":"h-3 w-3",Y0=(w,z)=>{let K=y0.getModel(w.id);return(0,i.jsxs)("div",{className:"flex items-center gap-2 w-full px-2 py-1",children:[(0,i.jsx)(V,{provider:w.providerId,className:T}),(0,i.jsxs)("div",{className:"flex flex-col",children:[(0,i.jsx)("span",{children:(K==null?void 0:K.name)||w.shortModelId}),(0,i.jsx)("span",{className:"text-xs text-muted-foreground",children:w.id})]}),(0,i.jsx)("div",{className:"ml-auto flex gap-1",children:(0,i.jsx)(t0,{content:Z0(z),children:(0,i.jsx)("span",{className:`text-xs px-1.5 py-0.5 rounded font-medium ${U(z)}`,children:z},z)})})]})},Q;e[24]!==a||e[25]!==r||e[26]!==x?(Q=w=>{r?r(w):x(w,a),f(!1)},e[24]=a,e[25]=r,e[26]=x,e[27]=Q):Q=e[27];let q=Q;I=d2,L=v,C=f;let J=`flex items-center justify-between px-2 py-0.5 border rounded-md
2
2
  hover:bg-accent hover:text-accent-foreground ${l}`,_=H?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(V,{provider:H.providerId,className:T}),g?null:(0,i.jsx)("span",{className:"truncate",children:i0(H.providerId)?H.shortModelId:H.id})]}):(0,i.jsx)("span",{className:"text-muted-foreground truncate",children:n}),F;e[28]===_?F=e[29]:(F=(0,i.jsx)("div",{className:"flex items-center gap-2 truncate",children:_}),e[28]=_,e[29]=F);let X=`${T} ml-1`,E;e[30]===X?E=e[31]:(E=(0,i.jsx)(o2,{className:X}),e[30]=X,e[31]=E),e[32]!==J||e[33]!==F||e[34]!==E?(M=(0,i.jsxs)(r2,{className:J,children:[F,E]}),e[32]=J,e[33]=F,e[34]=E,e[35]=M):M=e[35],G=n2,B="w-[300px]",P=A&&a&&Y0(y.parse(A),a),e[36]!==A||e[37]!==a?(b=A&&a&&(0,i.jsx)(e0,{}),e[36]=A,e[37]=a,e[38]=b):b=e[38];let Y;e[39]!==q||e[40]!==T?(Y=w=>{let[z,K]=w;return(0,i.jsx)(I2,{provider:z,onSelect:q,models:K,iconSizeClass:T},z)},e[39]=q,e[40]=T,e[41]=Y):Y=e[41],S=Q0.map(Y),e[0]=(x0=s==null?void 0:s.models)==null?void 0:x0.autocomplete_model,e[1]=(k0=s==null?void 0:s.models)==null?void 0:k0.chat_model,e[2]=(w0=s==null?void 0:s.models)==null?void 0:w0.custom_models,e[3]=(M0=s==null?void 0:s.models)==null?void 0:M0.displayed_models,e[4]=(b0=s==null?void 0:s.models)==null?void 0:b0.edit_model,e[5]=j,e[6]=g,e[7]=a,e[8]=h,e[9]=v,e[10]=r,e[11]=n,e[12]=x,e[13]=l,e[14]=t,e[15]=G,e[16]=I,e[17]=M,e[18]=B,e[19]=P,e[20]=b,e[21]=S,e[22]=L,e[23]=C}else G=e[15],I=e[16],M=e[17],B=e[18],P=e[19],b=e[20],S=e[21],L=e[22],C=e[23];let N;e[42]===u?N=e[43]:(N=u&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(e0,{}),(0,i.jsx)(a2,{className:"flex items-center gap-2",children:(0,i.jsxs)("a",{className:"flex items-center gap-1",href:"https://links.marimo.app/custom-models",target:"_blank",rel:"noreferrer",children:[(0,i.jsx)(s2,{className:"h-3 w-3"}),(0,i.jsx)("span",{children:"How to add a custom model"})]})})]}),e[42]=u,e[43]=N);let O;e[44]!==G||e[45]!==p||e[46]!==N||e[47]!==B||e[48]!==P||e[49]!==b||e[50]!==S?(O=(0,i.jsxs)(G,{className:B,children:[P,b,S,p,N]}),e[44]=G,e[45]=p,e[46]=N,e[47]=B,e[48]=P,e[49]=b,e[50]=S,e[51]=O):O=e[51];let Z;return e[52]!==I||e[53]!==M||e[54]!==O||e[55]!==L||e[56]!==C?(Z=(0,i.jsxs)(I,{open:L,onOpenChange:C,children:[M,O]}),e[52]=I,e[53]=M,e[54]=O,e[55]=L,e[56]=C,e[57]=Z):Z=e[57],Z};var I2=o=>{let e=(0,D.c)(26),{provider:t,onSelect:n,models:r,iconSizeClass:l}=o,p=i0(t)?t:"openai-compatible",c;e[0]===t?c=e[1]:(c=R.getProviderInfo(t),e[0]=t,e[1]=c);let m=c;if(r.length===0)return null;let a;e[2]!==p||e[3]!==l?(a=(0,i.jsx)(V,{provider:p,className:l}),e[2]=p,e[3]=l,e[4]=a):a=e[4];let d;e[5]===t?d=e[6]:(d=o0(t),e[5]=t,e[6]=d);let h;e[7]!==a||e[8]!==d?(h=(0,i.jsx)(S0,{children:(0,i.jsxs)("p",{className:"flex items-center gap-2",children:[a,d]})}),e[7]=a,e[8]=d,e[9]=h):h=e[9];let u=m?-90:0,g;e[10]===m?g=e[11]:(g=m&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)("p",{className:"text-sm text-muted-foreground p-2 max-w-[300px]",children:[m.description,(0,i.jsx)("br",{})]}),(0,i.jsxs)("p",{className:"text-sm text-muted-foreground p-2 pt-0",children:["For more information, see the"," ",(0,i.jsx)("a",{href:m.url,target:"_blank",className:"underline",rel:"noreferrer","aria-label":"Provider details",children:"provider details"}),"."]}),(0,i.jsx)(e0,{})]}),e[10]=m,e[11]=g);let v;if(e[12]!==r||e[13]!==n||e[14]!==t){let k;e[16]!==n||e[17]!==t?(k=x=>{let j=`${t}/${x.model}`;return(0,i.jsxs)(L0,{children:[(0,i.jsx)(S0,{showChevron:!1,className:"py-2",children:(0,i.jsx)("div",{className:"flex items-center gap-2 w-full cursor-pointer",onClick:()=>{n(j)},children:(0,i.jsx)(B2,{model:x,provider:t})})}),(0,i.jsx)(P0,{className:"p-4 w-80",children:(0,i.jsx)(P2,{model:x,provider:t})})]},j)},e[16]=n,e[17]=t,e[18]=k):k=e[18],v=r.map(k),e[12]=r,e[13]=n,e[14]=t,e[15]=v}else v=e[15];let f;e[19]!==u||e[20]!==g||e[21]!==v?(f=(0,i.jsx)(l2,{children:(0,i.jsxs)(P0,{className:"max-h-[40vh] overflow-y-auto",alignOffset:u,sideOffset:5,children:[g,v]})}),e[19]=u,e[20]=g,e[21]=v,e[22]=f):f=e[22];let s;return e[23]!==h||e[24]!==f?(s=(0,i.jsxs)(L0,{children:[h,f]}),e[23]=h,e[24]=f,e[25]=s):s=e[25],s},B2=o=>{let e=(0,D.c)(17),{model:t,provider:n}=o,r=i0(n)?n:"openai-compatible",l;e[0]===r?l=e[1]:(l=(0,i.jsx)(V,{provider:r,className:"h-4 w-4"}),e[0]=r,e[1]=l);let p;e[2]===t.name?p=e[3]:(p=(0,i.jsx)("span",{children:t.name}),e[2]=t.name,e[3]=p);let c;e[4]===t.thinking?c=e[5]:(c=t.thinking&&(0,i.jsx)(t0,{content:"Reasoning model",children:(0,i.jsx)(N0,{className:`h-5 w-5 rounded-md p-1 ${U("thinking")}`})}),e[4]=t.thinking,e[5]=c);let m;e[6]===c?m=e[7]:(m=(0,i.jsx)("div",{className:"ml-auto",children:c}),e[6]=c,e[7]=m);let a;e[8]!==p||e[9]!==m?(a=(0,i.jsxs)("div",{className:"flex flex-row w-full items-center",children:[p,m]}),e[8]=p,e[9]=m,e[10]=a):a=e[10];let d;e[11]===t.custom?d=e[12]:(d=t.custom&&(0,i.jsx)(t0,{content:"Custom model",children:(0,i.jsx)(G0,{className:"h-5 w-5"})}),e[11]=t.custom,e[12]=d);let h;return e[13]!==l||e[14]!==a||e[15]!==d?(h=(0,i.jsxs)(i.Fragment,{children:[l,a,d]}),e[13]=l,e[14]=a,e[15]=d,e[16]=h):h=e[16],h};const P2=o=>{let e=(0,D.c)(28),{model:t,provider:n}=o,r;e[0]===t.name?r=e[1]:(r=(0,i.jsx)("h4",{className:"font-semibold text-base text-foreground",children:t.name}),e[0]=t.name,e[1]=r);let l;e[2]===t.model?l=e[3]:(l=(0,i.jsx)("p",{className:"text-xs text-muted-foreground font-mono",children:t.model}),e[2]=t.model,e[3]=l);let p;e[4]!==r||e[5]!==l?(p=(0,i.jsxs)("div",{children:[r,l]}),e[4]=r,e[5]=l,e[6]=p):p=e[6];let c;e[7]===t.description?c=e[8]:(c=(0,i.jsx)("p",{className:"text-sm text-muted-foreground leading-relaxed",children:t.description}),e[7]=t.description,e[8]=c);let m;e[9]===t.roles?m=e[10]:(m=t.roles.length>0&&(0,i.jsxs)("div",{children:[(0,i.jsx)("p",{className:"text-xs font-medium text-muted-foreground mb-2",children:"Capabilities:"}),(0,i.jsx)("div",{className:"flex flex-wrap gap-1",children:t.roles.map(S2)})]}),e[9]=t.roles,e[10]=m);let a;e[11]===t.thinking?a=e[12]:(a=t.thinking&&(0,i.jsxs)("div",{className:"flex items-center gap-2",children:[(0,i.jsx)("div",{className:"w-2 h-2 bg-purple-500 rounded-full animate-pulse"}),(0,i.jsx)("span",{className:"text-xs text-muted-foreground",children:"Supports thinking mode"})]}),e[11]=t.thinking,e[12]=a);let d;e[13]===n?d=e[14]:(d=(0,i.jsx)(V,{provider:n,className:"h-4 w-4"}),e[13]=n,e[14]=d);let h;e[15]===n?h=e[16]:(h=o0(n),e[15]=n,e[16]=h);let u;e[17]===h?u=e[18]:(u=(0,i.jsx)("span",{className:"text-xs text-muted-foreground",children:h}),e[17]=h,e[18]=u);let g;e[19]!==d||e[20]!==u?(g=(0,i.jsxs)("div",{className:"flex items-center gap-2 pt-2 border-t border-border",children:[d,u]}),e[19]=d,e[20]=u,e[21]=g):g=e[21];let v;return e[22]!==g||e[23]!==p||e[24]!==c||e[25]!==m||e[26]!==a?(v=(0,i.jsxs)("div",{className:"space-y-3",children:[p,c,m,a,g]}),e[22]=g,e[23]=p,e[24]=c,e[25]=m,e[26]=a,e[27]=v):v=e[27],v};function o0(o){let e=R.getProviderInfo(o);return e?e.name:q0(o)}function S2(o){return(0,i.jsx)("span",{className:`px-2 py-1 text-xs rounded-md font-medium ${U(o)}`,title:Z0(o),children:o},o)}export{R as a,O0 as c,V as i,N0 as l,o0 as n,y as o,U as r,T0 as s,G2 as t};
@@ -1 +1 @@
1
- import{s as z}from"./chunk-LvLJmgfZ.js";import{l as X}from"./useEvent-DlWF5OMa.js";import{t as Z}from"./react-BGmjiNul.js";import{_t as D}from"./cells-DU3EySUd.js";import{t as E}from"./compiler-runtime-DeeZ7FnK.js";import{C as Q,S as $,_ as ee}from"./utils-CJJIceVn.js";import{M as te}from"./config-Ba3eeYri.js";import{t as se}from"./jsx-runtime-DN_bIXfG.js";import{t as le}from"./button-DuYGqRtX.js";import{l as R}from"./once-CTiSlR1m.js";import{r as U}from"./requests-C0HaHO6a.js";import{t as ae}from"./createLucideIcon-CW2xpJ57.js";import{h as oe,l as B}from"./select-D0g5GnIs.js";import{c as ne,f as re,l as ie,r as ce,s as de,t as he}from"./state-DEHWsmkM.js";import{r as I}from"./input-CaEtLL8p.js";import{t as Y}from"./settings-MTlHVxz3.js";import{a as M,c as L,d as A,g as me,i as xe,l as F,o as P,p as pe,u as S}from"./textarea-CfvBt_Xm.js";import{t as fe}from"./use-toast-Bzf3rpev.js";import{t as K}from"./tooltip-CvjcEpZC.js";import{o as ue}from"./alert-dialog-k5KxevGr.js";import{c as je,l as ve,n as ge,t as V}from"./dialog-DUEuLcT2.js";import{t as be}from"./VisuallyHidden-BodIky8L.js";import{i as we,r as ye,t as Ne}from"./popover-DtnzNVk-.js";import{n as Ce}from"./useDebounce-em3gna-v.js";import{n as ke}from"./ImperativeModal-q6QlC2aZ.js";import{t as O}from"./kbd-Czc5z_04.js";import{t as _e}from"./links-DNmjkr65.js";import{t as G}from"./Inputs-DmoeP8nh.js";var Se=ae("power-off",[["path",{d:"M18.36 6.64A9 9 0 0 1 20.77 15",key:"dxknvb"}],["path",{d:"M6.16 6.16a9 9 0 1 0 12.68 12.68",key:"1x7qb5"}],["path",{d:"M12 2v4",key:"3427ic"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]]),Te=E(),s=z(se(),1);const Me=t=>{let e=(0,Te.c)(15),{description:a,disabled:f,tooltip:r}=t,i=f===void 0?!1:f,u=r===void 0?"Shutdown":r,{openConfirm:b,closeModal:l}=ke(),{sendShutdown:o}=U(),w;e[0]===o?w=e[1]:(w=()=>{o(),setTimeout(Le,200)},e[0]=o,e[1]=w);let j=w;if(te())return null;let m=i?"disabled":"red",c;e[2]!==l||e[3]!==a||e[4]!==j||e[5]!==b?(c=h=>{h.stopPropagation(),b({title:"Shutdown",description:a,variant:"destructive",confirmAction:(0,s.jsx)(ue,{onClick:()=>{j(),l()},"aria-label":"Confirm Shutdown",children:"Shutdown"})})},e[2]=l,e[3]=a,e[4]=j,e[5]=b,e[6]=c):c=e[6];let n;e[7]===Symbol.for("react.memo_cache_sentinel")?(n=(0,s.jsx)(oe,{strokeWidth:1}),e[7]=n):n=e[7];let d;e[8]!==i||e[9]!==m||e[10]!==c?(d=(0,s.jsx)(G,{"aria-label":"Shutdown","data-testid":"shutdown-button",shape:"circle",size:"small",color:m,className:"h-[27px] w-[27px]",disabled:i,onClick:c,children:n}),e[8]=i,e[9]=m,e[10]=c,e[11]=d):d=e[11];let x;return e[12]!==d||e[13]!==u?(x=(0,s.jsx)(K,{content:u,children:d}),e[12]=d,e[13]=u,e[14]=x):x=e[14],x};function Le(){window.close()}var J=E(),W=z(Z(),1),Ae=100;const Fe=()=>{let t=(0,J.c)(37),[e,a]=ee(),{saveAppConfig:f}=U(),r=(0,W.useId)(),i=(0,W.useId)(),u;t[0]===Symbol.for("react.memo_cache_sentinel")?(u=pe($),t[0]=u):u=t[0];let b;t[1]===e?b=t[2]:(b={resolver:u,defaultValues:e},t[1]=e,t[2]=b);let l=me(b),o;t[3]!==f||t[4]!==a?(o=async p=>{await f({config:p}).then(()=>{a(p)}).catch(()=>{a(p)})},t[3]=f,t[4]=a,t[5]=o):o=t[5];let w=o,j;t[6]===w?j=t[7]:(j=p=>{w(p)},t[6]=w,t[7]=j);let m=Ce(j,Ae),c;t[8]===e.width?c=t[9]:(c=[e.width],t[8]=e.width,t[9]=c),(0,W.useEffect)(Pe,c);let n;t[10]!==m||t[11]!==l?(n=l.handleSubmit(m),t[10]=m,t[11]=l,t[12]=n):n=t[12];let d;t[13]===Symbol.for("react.memo_cache_sentinel")?(d=(0,s.jsxs)("div",{children:[(0,s.jsx)(ie,{children:"Notebook Settings"}),(0,s.jsx)(ne,{children:"Configure how your notebook or application looks and behaves."})]}),t[13]=d):d=t[13];let x;t[14]===l.control?x=t[15]:(x=(0,s.jsxs)(H,{title:"Display",children:[(0,s.jsx)(L,{control:l.control,name:"width",render:He}),(0,s.jsx)(L,{control:l.control,name:"app_title",render:Ee})]}),t[14]=l.control,t[15]=x);let h;t[16]===l.control?h=t[17]:(h=(0,s.jsxs)(H,{title:"Custom Files",children:[(0,s.jsx)(L,{control:l.control,name:"css_file",render:Ie}),(0,s.jsx)(L,{control:l.control,name:"html_head_file",render:Oe})]}),t[16]=l.control,t[17]=h);let y;t[18]===l.control?y=t[19]:(y=(0,s.jsx)(H,{title:"Data",children:(0,s.jsx)(L,{control:l.control,name:"sql_output",render:ze})}),t[18]=l.control,t[19]=y);let N;t[20]!==r||t[21]!==i?(N=p=>{let{field:_}=p;return(0,s.jsxs)("div",{className:"flex flex-col gap-y-1",children:[(0,s.jsxs)(F,{className:"flex flex-col gap-2",children:[(0,s.jsx)(M,{children:(0,s.jsxs)("div",{className:"flex gap-4",children:[(0,s.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,s.jsx)(D,{id:r,"data-testid":"html-checkbox",checked:_.value.includes("html"),onCheckedChange:()=>{_.onChange(R(_.value,"html"))}}),(0,s.jsx)(S,{htmlFor:r,children:"HTML"})]}),(0,s.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,s.jsx)(D,{id:i,"data-testid":"ipynb-checkbox",checked:_.value.includes("ipynb"),onCheckedChange:()=>{_.onChange(R(_.value,"ipynb"))}}),(0,s.jsx)(S,{htmlFor:i,children:"IPYNB"})]})]})}),(0,s.jsx)(A,{})]}),(0,s.jsxs)(P,{children:["When enabled, marimo will periodically save this notebook in your selected formats (HTML, IPYNB) to a folder named"," ",(0,s.jsx)(O,{className:"inline",children:"__marimo__"})," next to your notebook file."]})]})},t[20]=r,t[21]=i,t[22]=N):N=t[22];let v;t[23]!==l.control||t[24]!==N?(v=(0,s.jsx)(H,{title:"Exporting outputs",children:(0,s.jsx)(L,{control:l.control,name:"auto_download",render:N})}),t[23]=l.control,t[24]=N,t[25]=v):v=t[25];let C;t[26]!==v||t[27]!==x||t[28]!==h||t[29]!==y?(C=(0,s.jsxs)("div",{className:"grid grid-cols-2 gap-x-8 gap-y-4",children:[x,h,y,v]}),t[26]=v,t[27]=x,t[28]=h,t[29]=y,t[30]=C):C=t[30];let g;t[31]!==C||t[32]!==n?(g=(0,s.jsxs)("form",{onChange:n,className:"flex flex-col gap-6",children:[d,C]}),t[31]=C,t[32]=n,t[33]=g):g=t[33];let k;return t[34]!==l||t[35]!==g?(k=(0,s.jsx)(xe,{...l,children:g}),t[34]=l,t[35]=g,t[36]=k):k=t[36],k};var H=t=>{let e=(0,J.c)(5),{title:a,children:f}=t,r;e[0]===a?r=e[1]:(r=(0,s.jsx)("h3",{className:"text-base font-semibold mb-1",children:a}),e[0]=a,e[1]=r);let i;return e[2]!==f||e[3]!==r?(i=(0,s.jsxs)("div",{className:"flex flex-col gap-y-2",children:[r,f]}),e[2]=f,e[3]=r,e[4]=i):i=e[4],i};function Pe(){window.dispatchEvent(new Event("resize"))}function qe(t){return(0,s.jsx)("option",{value:t,children:t},t)}function He(t){let{field:e}=t;return(0,s.jsxs)(F,{className:"flex flex-row items-center space-x-1 space-y-0",children:[(0,s.jsx)(S,{children:"Width"}),(0,s.jsx)(M,{children:(0,s.jsx)(B,{"data-testid":"app-width-select",onChange:a=>e.onChange(a.target.value),value:e.value,disabled:e.disabled,className:"inline-flex mr-2",children:re().map(qe)})}),(0,s.jsx)(A,{})]})}function Ee(t){let{field:e}=t;return(0,s.jsxs)("div",{className:"flex flex-col gap-y-1",children:[(0,s.jsxs)(F,{className:"flex flex-row items-center space-x-1 space-y-0",children:[(0,s.jsx)(S,{children:"App title"}),(0,s.jsx)(M,{children:(0,s.jsx)(I,{...e,value:e.value??"",onChange:a=>{e.onChange(a.target.value),Q.safeParse(a.target.value).success&&(document.title=a.target.value)}})}),(0,s.jsx)(A,{})]}),(0,s.jsx)(P,{children:"The application title is put in the title tag in the HTML code and typically displayed in the title bar of the browser window."})]})}function Ie(t){let{field:e}=t;return(0,s.jsxs)("div",{className:"flex flex-col gap-y-1",children:[(0,s.jsxs)(F,{className:"flex flex-row items-center space-x-1 space-y-0",children:[(0,s.jsx)(S,{className:"shrink-0",children:"Custom CSS"}),(0,s.jsx)(M,{children:(0,s.jsx)(I,{...e,value:e.value??"",placeholder:"custom.css",onChange:a=>{e.onChange(a.target.value),Q.safeParse(a.target.value).success&&(document.title=a.target.value)}})}),(0,s.jsx)(A,{})]}),(0,s.jsx)(P,{children:"A filepath to a custom css file to be injected into the notebook."})]})}function Oe(t){let{field:e}=t;return(0,s.jsxs)("div",{className:"flex flex-col gap-y-1",children:[(0,s.jsxs)(F,{className:"flex flex-row items-center space-x-1 space-y-0",children:[(0,s.jsx)(S,{className:"shrink-0",children:"HTML Head"}),(0,s.jsx)(M,{children:(0,s.jsx)(I,{...e,value:e.value??"",placeholder:"head.html",onChange:a=>{e.onChange(a.target.value)}})}),(0,s.jsx)(A,{})]}),(0,s.jsxs)(P,{children:["A filepath to an HTML file to be injected into the"," ",(0,s.jsx)(O,{className:"inline",children:"<head/>"})," section of the notebook. Use this to add analytics, custom fonts, meta tags, or external scripts."]})]})}function We(t){return(0,s.jsx)("option",{value:t.value,children:t.label},t.value)}function ze(t){let{field:e}=t;return(0,s.jsxs)("div",{className:"flex flex-col gap-y-1",children:[(0,s.jsxs)(F,{className:"flex flex-row items-center space-x-1 space-y-0",children:[(0,s.jsx)(S,{children:"SQL Output Type"}),(0,s.jsx)(M,{children:(0,s.jsx)(B,{"data-testid":"sql-output-select",onChange:a=>{e.onChange(a.target.value),fe({title:"Kernel Restart Required",description:"This change requires a kernel restart to take effect."})},value:e.value,disabled:e.disabled,className:"inline-flex mr-2",children:de.map(We)})}),(0,s.jsx)(A,{})]}),(0,s.jsxs)(P,{children:["The Python type returned by a SQL cell. For best performance with large datasets, we recommend using"," ",(0,s.jsx)(O,{className:"inline",children:"native"}),". See the"," ",(0,s.jsx)(_e,{href:"https://docs.marimo.io/guides/working_with_data/sql",children:"SQL guide"})," ","for more information."]})]})}var De=E();const Qe=t=>{let e=(0,De.c)(32),{showAppConfig:a,disabled:f,tooltip:r}=t,i=a===void 0?!0:a,u=f===void 0?!1:f,b=r===void 0?"Settings":r,[l,o]=X(he),w=u?"disabled":"hint-green",j;e[0]===Symbol.for("react.memo_cache_sentinel")?(j=(0,s.jsx)(Y,{strokeWidth:1.8}),e[0]=j):j=e[0];let m;e[1]===b?m=e[2]:(m=(0,s.jsx)(K,{content:b,children:j}),e[1]=b,e[2]=m);let c;e[3]!==u||e[4]!==w||e[5]!==m?(c=(0,s.jsx)(G,{"aria-label":"Config","data-testid":"app-config-button",shape:"circle",size:"small",className:"h-[27px] w-[27px]",disabled:u,color:w,children:m}),e[3]=u,e[4]=w,e[5]=m,e[6]=c):c=e[6];let n=c,d;e[7]===Symbol.for("react.memo_cache_sentinel")?(d=(0,s.jsxs)(ge,{className:"w-[90vw] h-[90vh] overflow-hidden sm:max-w-5xl top-[5vh] p-0",children:[(0,s.jsx)(be,{children:(0,s.jsx)(je,{children:"User settings"})}),(0,s.jsx)(ce,{})]}),e[7]=d):d=e[7];let x=d;if(!i){let T;e[8]===n?T=e[9]:(T=(0,s.jsx)(ve,{children:n}),e[8]=n,e[9]=T);let q;return e[10]!==o||e[11]!==l||e[12]!==T?(q=(0,s.jsxs)(V,{open:l,onOpenChange:o,children:[T,x]}),e[10]=o,e[11]=l,e[12]=T,e[13]=q):q=e[13],q}let h;e[14]===n?h=e[15]:(h=(0,s.jsx)(we,{asChild:!0,children:n}),e[14]=n,e[15]=h);let y,N;e[16]===Symbol.for("react.memo_cache_sentinel")?(y=(0,s.jsx)(Fe,{}),N=(0,s.jsx)("div",{className:"h-px bg-border my-2"}),e[16]=y,e[17]=N):(y=e[16],N=e[17]);let v;e[18]===o?v=e[19]:(v=()=>o(!0),e[18]=o,e[19]=v);let C;e[20]===Symbol.for("react.memo_cache_sentinel")?(C=(0,s.jsx)(Y,{strokeWidth:1.8,className:"w-4 h-4 mr-2"}),e[20]=C):C=e[20];let g;e[21]===v?g=e[22]:(g=(0,s.jsxs)(ye,{className:"w-[650px] overflow-auto max-h-[80vh] max-w-[80vw]",align:"end",side:"bottom",onFocusOutside:Re,children:[y,N,(0,s.jsxs)(le,{onClick:v,variant:"link",className:"px-0",children:[C,"User settings"]})]}),e[21]=v,e[22]=g);let k;e[23]!==g||e[24]!==h?(k=(0,s.jsxs)(Ne,{children:[h,g]}),e[23]=g,e[24]=h,e[25]=k):k=e[25];let p;e[26]!==o||e[27]!==l?(p=(0,s.jsx)(V,{open:l,onOpenChange:o,children:x}),e[26]=o,e[27]=l,e[28]=p):p=e[28];let _;return e[29]!==k||e[30]!==p?(_=(0,s.jsxs)(s.Fragment,{children:[k,p]}),e[29]=k,e[30]=p,e[31]=_):_=e[31],_};function Re(t){return t.preventDefault()}export{Me as n,Se as r,Qe as t};
1
+ import{s as z}from"./chunk-LvLJmgfZ.js";import{l as X}from"./useEvent-DlWF5OMa.js";import{t as Z}from"./react-BGmjiNul.js";import{_t as D}from"./cells-CibeVr5R.js";import{t as E}from"./compiler-runtime-DeeZ7FnK.js";import{C as Q,S as $,_ as ee}from"./utils-CJJIceVn.js";import{M as te}from"./config-Ba3eeYri.js";import{t as se}from"./jsx-runtime-DN_bIXfG.js";import{t as le}from"./button-DuYGqRtX.js";import{l as R}from"./once-CTiSlR1m.js";import{r as U}from"./requests-C0HaHO6a.js";import{t as ae}from"./createLucideIcon-CW2xpJ57.js";import{h as oe,l as B}from"./select-D0g5GnIs.js";import{c as ne,f as re,l as ie,r as ce,s as de,t as he}from"./state-BxWZf58F.js";import{r as I}from"./input-CaEtLL8p.js";import{t as Y}from"./settings-MTlHVxz3.js";import{a as M,c as L,d as A,g as me,i as xe,l as F,o as P,p as pe,u as S}from"./textarea-BRmAhRr_.js";import{t as fe}from"./use-toast-Bzf3rpev.js";import{t as K}from"./tooltip-CvjcEpZC.js";import{o as ue}from"./alert-dialog-k5KxevGr.js";import{c as je,l as ve,n as ge,t as V}from"./dialog-DUEuLcT2.js";import{t as be}from"./VisuallyHidden-BodIky8L.js";import{i as we,r as ye,t as Ne}from"./popover-DtnzNVk-.js";import{n as Ce}from"./useDebounce-em3gna-v.js";import{n as ke}from"./ImperativeModal-q6QlC2aZ.js";import{t as O}from"./kbd-Czc5z_04.js";import{t as _e}from"./links-DNmjkr65.js";import{t as G}from"./Inputs-DmoeP8nh.js";var Se=ae("power-off",[["path",{d:"M18.36 6.64A9 9 0 0 1 20.77 15",key:"dxknvb"}],["path",{d:"M6.16 6.16a9 9 0 1 0 12.68 12.68",key:"1x7qb5"}],["path",{d:"M12 2v4",key:"3427ic"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]]),Te=E(),s=z(se(),1);const Me=t=>{let e=(0,Te.c)(15),{description:a,disabled:f,tooltip:r}=t,i=f===void 0?!1:f,u=r===void 0?"Shutdown":r,{openConfirm:b,closeModal:l}=ke(),{sendShutdown:o}=U(),w;e[0]===o?w=e[1]:(w=()=>{o(),setTimeout(Le,200)},e[0]=o,e[1]=w);let j=w;if(te())return null;let m=i?"disabled":"red",c;e[2]!==l||e[3]!==a||e[4]!==j||e[5]!==b?(c=h=>{h.stopPropagation(),b({title:"Shutdown",description:a,variant:"destructive",confirmAction:(0,s.jsx)(ue,{onClick:()=>{j(),l()},"aria-label":"Confirm Shutdown",children:"Shutdown"})})},e[2]=l,e[3]=a,e[4]=j,e[5]=b,e[6]=c):c=e[6];let n;e[7]===Symbol.for("react.memo_cache_sentinel")?(n=(0,s.jsx)(oe,{strokeWidth:1}),e[7]=n):n=e[7];let d;e[8]!==i||e[9]!==m||e[10]!==c?(d=(0,s.jsx)(G,{"aria-label":"Shutdown","data-testid":"shutdown-button",shape:"circle",size:"small",color:m,className:"h-[27px] w-[27px]",disabled:i,onClick:c,children:n}),e[8]=i,e[9]=m,e[10]=c,e[11]=d):d=e[11];let x;return e[12]!==d||e[13]!==u?(x=(0,s.jsx)(K,{content:u,children:d}),e[12]=d,e[13]=u,e[14]=x):x=e[14],x};function Le(){window.close()}var J=E(),W=z(Z(),1),Ae=100;const Fe=()=>{let t=(0,J.c)(37),[e,a]=ee(),{saveAppConfig:f}=U(),r=(0,W.useId)(),i=(0,W.useId)(),u;t[0]===Symbol.for("react.memo_cache_sentinel")?(u=pe($),t[0]=u):u=t[0];let b;t[1]===e?b=t[2]:(b={resolver:u,defaultValues:e},t[1]=e,t[2]=b);let l=me(b),o;t[3]!==f||t[4]!==a?(o=async p=>{await f({config:p}).then(()=>{a(p)}).catch(()=>{a(p)})},t[3]=f,t[4]=a,t[5]=o):o=t[5];let w=o,j;t[6]===w?j=t[7]:(j=p=>{w(p)},t[6]=w,t[7]=j);let m=Ce(j,Ae),c;t[8]===e.width?c=t[9]:(c=[e.width],t[8]=e.width,t[9]=c),(0,W.useEffect)(Pe,c);let n;t[10]!==m||t[11]!==l?(n=l.handleSubmit(m),t[10]=m,t[11]=l,t[12]=n):n=t[12];let d;t[13]===Symbol.for("react.memo_cache_sentinel")?(d=(0,s.jsxs)("div",{children:[(0,s.jsx)(ie,{children:"Notebook Settings"}),(0,s.jsx)(ne,{children:"Configure how your notebook or application looks and behaves."})]}),t[13]=d):d=t[13];let x;t[14]===l.control?x=t[15]:(x=(0,s.jsxs)(H,{title:"Display",children:[(0,s.jsx)(L,{control:l.control,name:"width",render:He}),(0,s.jsx)(L,{control:l.control,name:"app_title",render:Ee})]}),t[14]=l.control,t[15]=x);let h;t[16]===l.control?h=t[17]:(h=(0,s.jsxs)(H,{title:"Custom Files",children:[(0,s.jsx)(L,{control:l.control,name:"css_file",render:Ie}),(0,s.jsx)(L,{control:l.control,name:"html_head_file",render:Oe})]}),t[16]=l.control,t[17]=h);let y;t[18]===l.control?y=t[19]:(y=(0,s.jsx)(H,{title:"Data",children:(0,s.jsx)(L,{control:l.control,name:"sql_output",render:ze})}),t[18]=l.control,t[19]=y);let N;t[20]!==r||t[21]!==i?(N=p=>{let{field:_}=p;return(0,s.jsxs)("div",{className:"flex flex-col gap-y-1",children:[(0,s.jsxs)(F,{className:"flex flex-col gap-2",children:[(0,s.jsx)(M,{children:(0,s.jsxs)("div",{className:"flex gap-4",children:[(0,s.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,s.jsx)(D,{id:r,"data-testid":"html-checkbox",checked:_.value.includes("html"),onCheckedChange:()=>{_.onChange(R(_.value,"html"))}}),(0,s.jsx)(S,{htmlFor:r,children:"HTML"})]}),(0,s.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,s.jsx)(D,{id:i,"data-testid":"ipynb-checkbox",checked:_.value.includes("ipynb"),onCheckedChange:()=>{_.onChange(R(_.value,"ipynb"))}}),(0,s.jsx)(S,{htmlFor:i,children:"IPYNB"})]})]})}),(0,s.jsx)(A,{})]}),(0,s.jsxs)(P,{children:["When enabled, marimo will periodically save this notebook in your selected formats (HTML, IPYNB) to a folder named"," ",(0,s.jsx)(O,{className:"inline",children:"__marimo__"})," next to your notebook file."]})]})},t[20]=r,t[21]=i,t[22]=N):N=t[22];let v;t[23]!==l.control||t[24]!==N?(v=(0,s.jsx)(H,{title:"Exporting outputs",children:(0,s.jsx)(L,{control:l.control,name:"auto_download",render:N})}),t[23]=l.control,t[24]=N,t[25]=v):v=t[25];let C;t[26]!==v||t[27]!==x||t[28]!==h||t[29]!==y?(C=(0,s.jsxs)("div",{className:"grid grid-cols-2 gap-x-8 gap-y-4",children:[x,h,y,v]}),t[26]=v,t[27]=x,t[28]=h,t[29]=y,t[30]=C):C=t[30];let g;t[31]!==C||t[32]!==n?(g=(0,s.jsxs)("form",{onChange:n,className:"flex flex-col gap-6",children:[d,C]}),t[31]=C,t[32]=n,t[33]=g):g=t[33];let k;return t[34]!==l||t[35]!==g?(k=(0,s.jsx)(xe,{...l,children:g}),t[34]=l,t[35]=g,t[36]=k):k=t[36],k};var H=t=>{let e=(0,J.c)(5),{title:a,children:f}=t,r;e[0]===a?r=e[1]:(r=(0,s.jsx)("h3",{className:"text-base font-semibold mb-1",children:a}),e[0]=a,e[1]=r);let i;return e[2]!==f||e[3]!==r?(i=(0,s.jsxs)("div",{className:"flex flex-col gap-y-2",children:[r,f]}),e[2]=f,e[3]=r,e[4]=i):i=e[4],i};function Pe(){window.dispatchEvent(new Event("resize"))}function qe(t){return(0,s.jsx)("option",{value:t,children:t},t)}function He(t){let{field:e}=t;return(0,s.jsxs)(F,{className:"flex flex-row items-center space-x-1 space-y-0",children:[(0,s.jsx)(S,{children:"Width"}),(0,s.jsx)(M,{children:(0,s.jsx)(B,{"data-testid":"app-width-select",onChange:a=>e.onChange(a.target.value),value:e.value,disabled:e.disabled,className:"inline-flex mr-2",children:re().map(qe)})}),(0,s.jsx)(A,{})]})}function Ee(t){let{field:e}=t;return(0,s.jsxs)("div",{className:"flex flex-col gap-y-1",children:[(0,s.jsxs)(F,{className:"flex flex-row items-center space-x-1 space-y-0",children:[(0,s.jsx)(S,{children:"App title"}),(0,s.jsx)(M,{children:(0,s.jsx)(I,{...e,value:e.value??"",onChange:a=>{e.onChange(a.target.value),Q.safeParse(a.target.value).success&&(document.title=a.target.value)}})}),(0,s.jsx)(A,{})]}),(0,s.jsx)(P,{children:"The application title is put in the title tag in the HTML code and typically displayed in the title bar of the browser window."})]})}function Ie(t){let{field:e}=t;return(0,s.jsxs)("div",{className:"flex flex-col gap-y-1",children:[(0,s.jsxs)(F,{className:"flex flex-row items-center space-x-1 space-y-0",children:[(0,s.jsx)(S,{className:"shrink-0",children:"Custom CSS"}),(0,s.jsx)(M,{children:(0,s.jsx)(I,{...e,value:e.value??"",placeholder:"custom.css",onChange:a=>{e.onChange(a.target.value),Q.safeParse(a.target.value).success&&(document.title=a.target.value)}})}),(0,s.jsx)(A,{})]}),(0,s.jsx)(P,{children:"A filepath to a custom css file to be injected into the notebook."})]})}function Oe(t){let{field:e}=t;return(0,s.jsxs)("div",{className:"flex flex-col gap-y-1",children:[(0,s.jsxs)(F,{className:"flex flex-row items-center space-x-1 space-y-0",children:[(0,s.jsx)(S,{className:"shrink-0",children:"HTML Head"}),(0,s.jsx)(M,{children:(0,s.jsx)(I,{...e,value:e.value??"",placeholder:"head.html",onChange:a=>{e.onChange(a.target.value)}})}),(0,s.jsx)(A,{})]}),(0,s.jsxs)(P,{children:["A filepath to an HTML file to be injected into the"," ",(0,s.jsx)(O,{className:"inline",children:"<head/>"})," section of the notebook. Use this to add analytics, custom fonts, meta tags, or external scripts."]})]})}function We(t){return(0,s.jsx)("option",{value:t.value,children:t.label},t.value)}function ze(t){let{field:e}=t;return(0,s.jsxs)("div",{className:"flex flex-col gap-y-1",children:[(0,s.jsxs)(F,{className:"flex flex-row items-center space-x-1 space-y-0",children:[(0,s.jsx)(S,{children:"SQL Output Type"}),(0,s.jsx)(M,{children:(0,s.jsx)(B,{"data-testid":"sql-output-select",onChange:a=>{e.onChange(a.target.value),fe({title:"Kernel Restart Required",description:"This change requires a kernel restart to take effect."})},value:e.value,disabled:e.disabled,className:"inline-flex mr-2",children:de.map(We)})}),(0,s.jsx)(A,{})]}),(0,s.jsxs)(P,{children:["The Python type returned by a SQL cell. For best performance with large datasets, we recommend using"," ",(0,s.jsx)(O,{className:"inline",children:"native"}),". See the"," ",(0,s.jsx)(_e,{href:"https://docs.marimo.io/guides/working_with_data/sql",children:"SQL guide"})," ","for more information."]})]})}var De=E();const Qe=t=>{let e=(0,De.c)(32),{showAppConfig:a,disabled:f,tooltip:r}=t,i=a===void 0?!0:a,u=f===void 0?!1:f,b=r===void 0?"Settings":r,[l,o]=X(he),w=u?"disabled":"hint-green",j;e[0]===Symbol.for("react.memo_cache_sentinel")?(j=(0,s.jsx)(Y,{strokeWidth:1.8}),e[0]=j):j=e[0];let m;e[1]===b?m=e[2]:(m=(0,s.jsx)(K,{content:b,children:j}),e[1]=b,e[2]=m);let c;e[3]!==u||e[4]!==w||e[5]!==m?(c=(0,s.jsx)(G,{"aria-label":"Config","data-testid":"app-config-button",shape:"circle",size:"small",className:"h-[27px] w-[27px]",disabled:u,color:w,children:m}),e[3]=u,e[4]=w,e[5]=m,e[6]=c):c=e[6];let n=c,d;e[7]===Symbol.for("react.memo_cache_sentinel")?(d=(0,s.jsxs)(ge,{className:"w-[90vw] h-[90vh] overflow-hidden sm:max-w-5xl top-[5vh] p-0",children:[(0,s.jsx)(be,{children:(0,s.jsx)(je,{children:"User settings"})}),(0,s.jsx)(ce,{})]}),e[7]=d):d=e[7];let x=d;if(!i){let T;e[8]===n?T=e[9]:(T=(0,s.jsx)(ve,{children:n}),e[8]=n,e[9]=T);let q;return e[10]!==o||e[11]!==l||e[12]!==T?(q=(0,s.jsxs)(V,{open:l,onOpenChange:o,children:[T,x]}),e[10]=o,e[11]=l,e[12]=T,e[13]=q):q=e[13],q}let h;e[14]===n?h=e[15]:(h=(0,s.jsx)(we,{asChild:!0,children:n}),e[14]=n,e[15]=h);let y,N;e[16]===Symbol.for("react.memo_cache_sentinel")?(y=(0,s.jsx)(Fe,{}),N=(0,s.jsx)("div",{className:"h-px bg-border my-2"}),e[16]=y,e[17]=N):(y=e[16],N=e[17]);let v;e[18]===o?v=e[19]:(v=()=>o(!0),e[18]=o,e[19]=v);let C;e[20]===Symbol.for("react.memo_cache_sentinel")?(C=(0,s.jsx)(Y,{strokeWidth:1.8,className:"w-4 h-4 mr-2"}),e[20]=C):C=e[20];let g;e[21]===v?g=e[22]:(g=(0,s.jsxs)(ye,{className:"w-[650px] overflow-auto max-h-[80vh] max-w-[80vw]",align:"end",side:"bottom",onFocusOutside:Re,children:[y,N,(0,s.jsxs)(le,{onClick:v,variant:"link",className:"px-0",children:[C,"User settings"]})]}),e[21]=v,e[22]=g);let k;e[23]!==g||e[24]!==h?(k=(0,s.jsxs)(Ne,{children:[h,g]}),e[23]=g,e[24]=h,e[25]=k):k=e[25];let p;e[26]!==o||e[27]!==l?(p=(0,s.jsx)(V,{open:l,onOpenChange:o,children:x}),e[26]=o,e[27]=l,e[28]=p):p=e[28];let _;return e[29]!==k||e[30]!==p?(_=(0,s.jsxs)(s.Fragment,{children:[k,p]}),e[29]=k,e[30]=p,e[31]=_):_=e[31],_};function Re(t){return t.preventDefault()}export{Me as n,Se as r,Qe as t};
@@ -1,5 +1,5 @@
1
1
  const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./loro_wasm_bg-BTbzDT9t.js","./loro_wasm_bg-CghhyG7y.js","./chunk-LvLJmgfZ.js"])))=>i.map(i=>d[i]);
2
- var id=Object.defineProperty;var Fa=re=>{throw TypeError(re)};var sd=(re,q,ge)=>q in re?id(re,q,{enumerable:!0,configurable:!0,writable:!0,value:ge}):re[q]=ge;var p=(re,q,ge)=>sd(re,typeof q!="symbol"?q+"":q,ge),ld=(re,q,ge)=>q.has(re)||Fa("Cannot "+ge);var La=(re,q,ge)=>(ld(re,q,"read from private field"),ge?ge.call(re):q.get(re)),Oa=(re,q,ge)=>q.has(re)?Fa("Cannot add the same private member more than once"):q instanceof WeakSet?q.add(re):q.set(re,ge);import{s as Da}from"./chunk-LvLJmgfZ.js";import{d as _a,f as wr,i as Q,l as En,n as ue,p as Bt,s as Nn,u as oe}from"./useEvent-DlWF5OMa.js";import{t as cd}from"./react-BGmjiNul.js";import{$t as ud,B as Ua,Bn as dd,C as kn,Dt as vr,Er as Ba,Ft as fd,Gr as md,H as ja,Kt as pd,L as Pa,M as hd,Mt as gd,Or as bd,Ot as Ma,Pt as Qe,Q as yd,Qt as wd,R as vd,Rt as Cn,Tr as Ed,Tt as Er,Ur as Ra,Vt as Nd,Yt as kd,Z as Nr,Zt as Cd,_n as Sd,_t as xd,a as Ga,at as Ad,bn as Td,br as Id,ct as Fd,ei as Sn,fr as Ld,gn as Od,hn as Dd,jt as _d,kt as Ja,l as Wa,lt as Ud,nn as kr,ot as Cr,p as Sr,st as xn,u as Va,un as Bd,ut as jt,v as nt,vr as xr,vt as $a,wt as jd,xr as Pd,z as Ha,__tla as Md}from"./cells-DU3EySUd.js";import{P as qa,R as Rd,k as Gd,w as Jd}from"./zod-Cg4WLWh2.js";import{t as Re}from"./compiler-runtime-DeeZ7FnK.js";import{n as Wd,r as Vd,s as $d,t as Hd,u as qd}from"./client-DfkWorYM.js";import{d as $e,f as zd,l as Ar,n as za}from"./hotkeys-uKX61F1_.js";import{t as Pt}from"./invariant-C6yE60hi.js";import{f as Ka,i as Kd,m as Ya,o as Yd,p as Xd,s as Xa,x as Tr}from"./utils-CJJIceVn.js";import{M as Qd,b as Zd,j as yt,k as Qa,o as ef,r as Za,s as tf,w as lt}from"./config-Ba3eeYri.js";import{a as nf,n as ei,t as rf}from"./switch-CWzL-0WF.js";import{n as of}from"./globals-BSLm1nlz.js";import{t as af}from"./ErrorBoundary-Drf1manw.js";import{t as sf}from"./useEventListener-COkmyg1v.js";import{t as lf}from"./jsx-runtime-DN_bIXfG.js";import{r as Ir,t as He}from"./button-DuYGqRtX.js";import{t as ct}from"./cn-C1rgT0yh.js";import{$t as An,Bt as Fr,Ct as ti,Dt as cf,E as uf,Gt as df,H as ni,I as ff,It as Tn,J as l,Jt as qe,P as mf,Pt as In,Rt as pf,St as Je,Ut as ut,V as ri,Vt as Mt,Xt as Rt,_ as hf,a as gf,at as B,bt as bf,ct as ze,ft as yf,it as wf,jt as vf,lt as Fn,m as Ef,pt as Nf,qt as pe,rt as H,st as kf,vt as Cf,w as Sf,wt as xf,yt as Af,zt as wt}from"./dist-CAcX026F.js";import{C as Tf,D as If,_ as Ff,a as Lf,c as Of,n as Lr,r as Df,v as _f,x as Uf,y as Bf}from"./dist-CI6_zMIl.js";import{E as jf,__tla as Pf}from"./JsonOutput--AuyEErr.js";import{c as oi,n as Mf}from"./once-CTiSlR1m.js";import{t as Or}from"./createReducer-DDa-hVe3.js";import{a as Rf,c as Gf,f as Ln,h as Jf,i as Wf,l as Gt,n as ai,o as Vf,t as $f}from"./dist-DKNOF5xd.js";import{r as Jt,t as Hf}from"./requests-C0HaHO6a.js";import{t as qf}from"./createLucideIcon-CW2xpJ57.js";import{f as zf,r as ii,t as Kf,__tla as Yf}from"./layout-BTiWDrbh.js";import{O as Xf,S as si,T as Qf,_ as Zf,a as li,k as em,n as tm,o as nm,r as ci,s as rm,x as om}from"./add-cell-with-ai-BWWVs9qV.js";import{t as am}from"./ai-model-dropdown-BrUOgnWS.js";import{h as im}from"./select-D0g5GnIs.js";import{t as sm}from"./download-PR1bF3g_.js";import{t as lm}from"./circle-check-Cr0N4h9T.js";import{r as cm,t as um}from"./types-DhuSHMNQ.js";import{n as ui}from"./spinner-C1czjtp7.js";import{t as di}from"./save-BOTLFf-P.js";import{I as fi,P as dm}from"./input-CaEtLL8p.js";import{a as fm,i as mm,n as mi}from"./state-DXAf-ejz.js";import{t as pm}from"./preload-helper-BW0IMuFq.js";import{t as vt}from"./use-toast-Bzf3rpev.js";import{r as hm}from"./useTheme-DfP1CWaW.js";import{t as Et}from"./tooltip-CvjcEpZC.js";import{r as gm,t as bm}from"./mode-yhfN-4ye.js";import{c as pi,i as hi,n as gi,r as ym}from"./dialog-DUEuLcT2.js";import{O as wm}from"./usePress-C2LPFxyv.js";import{a as vm,r as Em,t as Nm}from"./popover-DtnzNVk-.js";import{n as bi}from"./ImperativeModal-q6QlC2aZ.js";import{a as km}from"./error-banner-DU5Qb8a8.js";import{t as Cm}from"./copy-DRhpWiOq.js";import{a as Sm}from"./useRunCells-CmnSPQtM.js";import{t as Y}from"./extends-B9D0JO9U.js";import{t as Wt}from"./objectWithoutPropertiesLoose-CboCOq4o.js";import{t as xm}from"./kbd-Czc5z_04.js";import{a as Dr}from"./useInstallPackage-RldLPyJs.js";import{a as Am,o as Tm}from"./cell-link-CFAPzUg5.js";import{n as Im}from"./useAsyncData-BJJJOr9W.js";import{a as Fm,o as yi,r as Lm,s as wi,t as Om}from"./command-B_minI8b.js";import{r as Dm}from"./es-CEE_7T0w.js";import{a as _m}from"./focus-CtlWIiQr.js";import{a as vi}from"./renderShortcut-D0Pei-OA.js";import{t as _r}from"./label-qwandMoh.js";import{n as Ur,t as Ei}from"./useDeleteCell-ByImoTpm.js";import{n as Nt}from"./esm-B3JckBtM.js";import{n as Um,t as Bm}from"./icons-D4lB4En9.js";import{t as Ni}from"./dist-Ciq1Lh9M.js";import{t as jm}from"./useSplitCell-BTH64tve.js";import{t as ki}from"./Inputs-DmoeP8nh.js";import{co as Pm,do as Br,fo as Mm,ft as Rm,go as kt,ho as Ci,lo as jr,mo as Si,oo as xi,po as Gm,so as Ai,uo as Ti,__tla as Jm}from"./loro_wasm_bg-CghhyG7y.js";import{t as Wm}from"./ws-itdlXHqs.js";import{t as Pr}from"./useInterval-DpipYmgs.js";let Ii,Mr,Fi,dt,Li,On,Rr,Vt,Dn,be,Oi,Di,_i,Ui,_n,Bi,Gr,Un,Vm=Promise.all([(()=>{try{return Md}catch{}})(),(()=>{try{return Pf}catch{}})(),(()=>{try{return Yf}catch{}})(),(()=>{try{return Jm}catch{}})()]).then(async()=>{var vn,Ia,we,ve,Ee,Ne,ke,Ce,Se,xe,Ae,Te,Ie,Fe,Le,Oe,De,_e,Ue,Be,je;var re=qf("file-pen",[["path",{d:"M12.659 22H18a2 2 0 0 0 2-2V8a2.4 2.4 0 0 0-.706-1.706l-3.588-3.588A2.4 2.4 0 0 0 14 2H6a2 2 0 0 0-2 2v9.34",key:"o6klzx"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10.378 12.622a1 1 0 0 1 3 3.003L8.36 20.637a2 2 0 0 1-.854.506l-2.867.837a.5.5 0 0 1-.62-.62l.836-2.869a2 2 0 0 1 .506-.853z",key:"zhnas1"}]]);const q={showInput:"Mod-l",acceptEdit:"Mod-y",rejectEdit:"Mod-u"};var ge=300;const St=Mt.define({combine:e=>An(e,{onError:console.error,inputDebounceTime:ge,keymaps:q},{onError:(t,n)=>t&&n,inputDebounceTime:(t,n)=>t&&n,keymaps:(t,n)=>t&&n})}),rt=pe.define(),ot=qe.define({create(){return{show:!1,lineFrom:0,lineTo:0}},update(e,t){for(let n of t.effects)if(n.is(rt))return n.value;return e}}),xt=pe.define(),At=pe.define(),Wr=qe.define({create(){return{shouldFocus:!1,inputValue:""}},update(e,t){let n=e;for(let r of t.effects)r.is(xt)&&(n={...n,inputValue:r.value}),r.is(At)&&(n={...n,shouldFocus:r.value});return n}}),$t=pe.define(),Tt=qe.define({create(){return null},update(e,t){for(let n of t.effects)if(n.is($t))return n.value;return e}}),ft=pe.define(),Vr=qe.define({create(){return!1},update(e,t){for(let n of t.effects)if(n.is(ft))return n.value;return e}});var ji=1;const $r=e=>{let{state:t}=e,n=t.selection.main;if(n.empty)return!1;let r=t.doc,o=r.lineAt(n.from),a=r.lineAt(n.to);if(t.sliceDoc(o.from,a.to).trim().length<ji)return!1;let i=Math.max(1,Math.min(o.number,r.lines)),s=Math.max(1,Math.min(a.number,r.lines));return e.dispatch({effects:[rt.of({show:!0,lineFrom:i,lineTo:s}),At.of(!0),xt.of("")],selection:wt.cursor(o.from)}),!0},Hr=e=>e.state.field(Tt)?(e.dispatch({effects:[$t.of(null),rt.of({show:!1,lineFrom:0,lineTo:0}),At.of(!1),xt.of(""),ft.of(!1)]}),!0):!1,qr=e=>{let t=e.state.field(Tt);return t?(e.dispatch({changes:{from:t.from,to:t.to,insert:t.oldCode},effects:[$t.of(null),rt.of({show:!1,lineFrom:0,lineTo:0}),At.of(!1),xt.of(""),ft.of(!1)]}),!0):!1};var Bn={mac:"\u2318",windows:"\u229E Win",default:"Ctrl"};function Pi(){return navigator.platform.startsWith("Mac")?Bn.mac:navigator.platform.startsWith("Win")?Bn.windows:Bn.default}function jn(e){return e.replace("Mod",Pi()).replace("-"," ").toUpperCase()}function de(e,t){let n=document.createElement(e);return n.className=t,n}function Mi(e,t,n=void 0){let r=()=>{};return(...o)=>(r(),new Promise((a,i)=>{let s=setTimeout(()=>a(e(...o)),t);r=()=>{clearTimeout(s),n!==void 0&&i(n)}}))}var Ht=qe.define({create(){return{suggestion:null}},update(e,t){let n=t.effects.find(r=>r.is(qt));return!t.docChanged&&!n&&!t.selection?e:n&&t.state.doc===n.value.doc?{suggestion:n.value.text}:{suggestion:null}}}),qt=pe.define();function Ri(e,t){let n=e.state.selection.main.head,r=[],o=H.widget({widget:new Gi(t),side:1});return r.push(o.range(n)),H.set(r)}var Gi=class extends Fn{constructor(t){super();p(this,"suggestion");this.suggestion=t}toDOM(){let t=document.createElement("span");return t.style.opacity="0.4",t.className="cm-inline-suggestion",t.textContent=this.suggestion,t.setAttribute("role","suggestion"),t.setAttribute("aria-label",`Suggestion: ${this.suggestion}`),t}get lineBreaks(){return this.suggestion.split(`
2
+ var id=Object.defineProperty;var Fa=re=>{throw TypeError(re)};var sd=(re,q,ge)=>q in re?id(re,q,{enumerable:!0,configurable:!0,writable:!0,value:ge}):re[q]=ge;var p=(re,q,ge)=>sd(re,typeof q!="symbol"?q+"":q,ge),ld=(re,q,ge)=>q.has(re)||Fa("Cannot "+ge);var La=(re,q,ge)=>(ld(re,q,"read from private field"),ge?ge.call(re):q.get(re)),Oa=(re,q,ge)=>q.has(re)?Fa("Cannot add the same private member more than once"):q instanceof WeakSet?q.add(re):q.set(re,ge);import{s as Da}from"./chunk-LvLJmgfZ.js";import{d as _a,f as wr,i as Q,l as En,n as ue,p as Bt,s as Nn,u as oe}from"./useEvent-DlWF5OMa.js";import{t as cd}from"./react-BGmjiNul.js";import{$t as ud,B as Ua,Bn as dd,C as kn,Dt as vr,Er as Ba,Ft as fd,Gr as md,H as ja,Kt as pd,L as Pa,M as hd,Mt as gd,Or as bd,Ot as Ma,Pt as Qe,Q as yd,Qt as wd,R as vd,Rt as Cn,Tr as Ed,Tt as Er,Ur as Ra,Vt as Nd,Yt as kd,Z as Nr,Zt as Cd,_n as Sd,_t as xd,a as Ga,at as Ad,bn as Td,br as Id,ct as Fd,ei as Sn,fr as Ld,gn as Od,hn as Dd,jt as _d,kt as Ja,l as Wa,lt as Ud,nn as kr,ot as Cr,p as Sr,st as xn,u as Va,un as Bd,ut as jt,v as nt,vr as xr,vt as $a,wt as jd,xr as Pd,z as Ha,__tla as Md}from"./cells-CibeVr5R.js";import{P as qa,R as Rd,k as Gd,w as Jd}from"./zod-Cg4WLWh2.js";import{t as Re}from"./compiler-runtime-DeeZ7FnK.js";import{n as Wd,r as Vd,s as $d,t as Hd,u as qd}from"./client-CEtu-2VG.js";import{d as $e,f as zd,l as Ar,n as za}from"./hotkeys-uKX61F1_.js";import{t as Pt}from"./invariant-C6yE60hi.js";import{f as Ka,i as Kd,m as Ya,o as Yd,p as Xd,s as Xa,x as Tr}from"./utils-CJJIceVn.js";import{M as Qd,b as Zd,j as yt,k as Qa,o as ef,r as Za,s as tf,w as lt}from"./config-Ba3eeYri.js";import{a as nf,n as ei,t as rf}from"./switch-Bf7BdNuP.js";import{n as of}from"./globals-BkITdONE.js";import{t as af}from"./ErrorBoundary-Drf1manw.js";import{t as sf}from"./useEventListener-COkmyg1v.js";import{t as lf}from"./jsx-runtime-DN_bIXfG.js";import{r as Ir,t as He}from"./button-DuYGqRtX.js";import{t as ct}from"./cn-C1rgT0yh.js";import{$t as An,Bt as Fr,Ct as ti,Dt as cf,E as uf,Gt as df,H as ni,I as ff,It as Tn,J as l,Jt as qe,P as mf,Pt as In,Rt as pf,St as Je,Ut as ut,V as ri,Vt as Mt,Xt as Rt,_ as hf,a as gf,at as B,bt as bf,ct as ze,ft as yf,it as wf,jt as vf,lt as Fn,m as Ef,pt as Nf,qt as pe,rt as H,st as kf,vt as Cf,w as Sf,wt as xf,yt as Af,zt as wt}from"./dist-CAcX026F.js";import{C as Tf,D as If,_ as Ff,a as Lf,c as Of,n as Lr,r as Df,v as _f,x as Uf,y as Bf}from"./dist-CI6_zMIl.js";import{E as jf,__tla as Pf}from"./JsonOutput-B64aMW9B.js";import{c as oi,n as Mf}from"./once-CTiSlR1m.js";import{t as Or}from"./createReducer-DDa-hVe3.js";import{a as Rf,c as Gf,f as Ln,h as Jf,i as Wf,l as Gt,n as ai,o as Vf,t as $f}from"./dist-DKNOF5xd.js";import{r as Jt,t as Hf}from"./requests-C0HaHO6a.js";import{t as qf}from"./createLucideIcon-CW2xpJ57.js";import{f as zf,r as ii,t as Kf,__tla as Yf}from"./layout-HXw-kbRR.js";import{O as Xf,S as si,T as Qf,_ as Zf,a as li,k as em,n as tm,o as nm,r as ci,s as rm,x as om}from"./add-cell-with-ai-BsHIKGwv.js";import{t as am}from"./ai-model-dropdown-nzo8MLQ5.js";import{h as im}from"./select-D0g5GnIs.js";import{t as sm}from"./download-Bd63S7ca.js";import{t as lm}from"./circle-check-Cr0N4h9T.js";import{r as cm,t as um}from"./types-Dqr8wUa4.js";import{n as ui}from"./spinner-C1czjtp7.js";import{t as di}from"./save-BOTLFf-P.js";import{I as fi,P as dm}from"./input-CaEtLL8p.js";import{a as fm,i as mm,n as mi}from"./state-Eihpi8Gd.js";import{t as pm}from"./preload-helper-BW0IMuFq.js";import{t as vt}from"./use-toast-Bzf3rpev.js";import{r as hm}from"./useTheme-DfP1CWaW.js";import{t as Et}from"./tooltip-CvjcEpZC.js";import{r as gm,t as bm}from"./mode-j1jRJgw_.js";import{c as pi,i as hi,n as gi,r as ym}from"./dialog-DUEuLcT2.js";import{O as wm}from"./usePress-C2LPFxyv.js";import{a as vm,r as Em,t as Nm}from"./popover-DtnzNVk-.js";import{n as bi}from"./ImperativeModal-q6QlC2aZ.js";import{a as km}from"./error-banner-DU5Qb8a8.js";import{t as Cm}from"./copy-DRhpWiOq.js";import{a as Sm}from"./useRunCells-d0gYuXYQ.js";import{t as Y}from"./extends-B9D0JO9U.js";import{t as Wt}from"./objectWithoutPropertiesLoose-CboCOq4o.js";import{t as xm}from"./kbd-Czc5z_04.js";import{a as Dr}from"./useInstallPackage-RldLPyJs.js";import{a as Am,o as Tm}from"./cell-link-T1P92ttw.js";import{n as Im}from"./useAsyncData-BJJJOr9W.js";import{a as Fm,o as yi,r as Lm,s as wi,t as Om}from"./command-CyUURgqS.js";import{r as Dm}from"./es-BMs8n9bF.js";import{a as _m}from"./focus-BGO2qwac.js";import{a as vi}from"./renderShortcut-D0Pei-OA.js";import{t as _r}from"./label-qwandMoh.js";import{n as Ur,t as Ei}from"./useDeleteCell-BIkFVvVx.js";import{n as Nt}from"./esm-B3JckBtM.js";import{n as Um,t as Bm}from"./icons-D4lB4En9.js";import{t as Ni}from"./dist-Ciq1Lh9M.js";import{t as jm}from"./useSplitCell-DGmYA9dE.js";import{t as ki}from"./Inputs-DmoeP8nh.js";import{co as Pm,do as Br,fo as Mm,ft as Rm,go as kt,ho as Ci,lo as jr,mo as Si,oo as xi,po as Gm,so as Ai,uo as Ti,__tla as Jm}from"./loro_wasm_bg-CghhyG7y.js";import{t as Wm}from"./ws-itdlXHqs.js";import{t as Pr}from"./useInterval-DpipYmgs.js";let Ii,Mr,Fi,dt,Li,On,Rr,Vt,Dn,be,Oi,Di,_i,Ui,_n,Bi,Gr,Un,Vm=Promise.all([(()=>{try{return Md}catch{}})(),(()=>{try{return Pf}catch{}})(),(()=>{try{return Yf}catch{}})(),(()=>{try{return Jm}catch{}})()]).then(async()=>{var vn,Ia,we,ve,Ee,Ne,ke,Ce,Se,xe,Ae,Te,Ie,Fe,Le,Oe,De,_e,Ue,Be,je;var re=qf("file-pen",[["path",{d:"M12.659 22H18a2 2 0 0 0 2-2V8a2.4 2.4 0 0 0-.706-1.706l-3.588-3.588A2.4 2.4 0 0 0 14 2H6a2 2 0 0 0-2 2v9.34",key:"o6klzx"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10.378 12.622a1 1 0 0 1 3 3.003L8.36 20.637a2 2 0 0 1-.854.506l-2.867.837a.5.5 0 0 1-.62-.62l.836-2.869a2 2 0 0 1 .506-.853z",key:"zhnas1"}]]);const q={showInput:"Mod-l",acceptEdit:"Mod-y",rejectEdit:"Mod-u"};var ge=300;const St=Mt.define({combine:e=>An(e,{onError:console.error,inputDebounceTime:ge,keymaps:q},{onError:(t,n)=>t&&n,inputDebounceTime:(t,n)=>t&&n,keymaps:(t,n)=>t&&n})}),rt=pe.define(),ot=qe.define({create(){return{show:!1,lineFrom:0,lineTo:0}},update(e,t){for(let n of t.effects)if(n.is(rt))return n.value;return e}}),xt=pe.define(),At=pe.define(),Wr=qe.define({create(){return{shouldFocus:!1,inputValue:""}},update(e,t){let n=e;for(let r of t.effects)r.is(xt)&&(n={...n,inputValue:r.value}),r.is(At)&&(n={...n,shouldFocus:r.value});return n}}),$t=pe.define(),Tt=qe.define({create(){return null},update(e,t){for(let n of t.effects)if(n.is($t))return n.value;return e}}),ft=pe.define(),Vr=qe.define({create(){return!1},update(e,t){for(let n of t.effects)if(n.is(ft))return n.value;return e}});var ji=1;const $r=e=>{let{state:t}=e,n=t.selection.main;if(n.empty)return!1;let r=t.doc,o=r.lineAt(n.from),a=r.lineAt(n.to);if(t.sliceDoc(o.from,a.to).trim().length<ji)return!1;let i=Math.max(1,Math.min(o.number,r.lines)),s=Math.max(1,Math.min(a.number,r.lines));return e.dispatch({effects:[rt.of({show:!0,lineFrom:i,lineTo:s}),At.of(!0),xt.of("")],selection:wt.cursor(o.from)}),!0},Hr=e=>e.state.field(Tt)?(e.dispatch({effects:[$t.of(null),rt.of({show:!1,lineFrom:0,lineTo:0}),At.of(!1),xt.of(""),ft.of(!1)]}),!0):!1,qr=e=>{let t=e.state.field(Tt);return t?(e.dispatch({changes:{from:t.from,to:t.to,insert:t.oldCode},effects:[$t.of(null),rt.of({show:!1,lineFrom:0,lineTo:0}),At.of(!1),xt.of(""),ft.of(!1)]}),!0):!1};var Bn={mac:"\u2318",windows:"\u229E Win",default:"Ctrl"};function Pi(){return navigator.platform.startsWith("Mac")?Bn.mac:navigator.platform.startsWith("Win")?Bn.windows:Bn.default}function jn(e){return e.replace("Mod",Pi()).replace("-"," ").toUpperCase()}function de(e,t){let n=document.createElement(e);return n.className=t,n}function Mi(e,t,n=void 0){let r=()=>{};return(...o)=>(r(),new Promise((a,i)=>{let s=setTimeout(()=>a(e(...o)),t);r=()=>{clearTimeout(s),n!==void 0&&i(n)}}))}var Ht=qe.define({create(){return{suggestion:null}},update(e,t){let n=t.effects.find(r=>r.is(qt));return!t.docChanged&&!n&&!t.selection?e:n&&t.state.doc===n.value.doc?{suggestion:n.value.text}:{suggestion:null}}}),qt=pe.define();function Ri(e,t){let n=e.state.selection.main.head,r=[],o=H.widget({widget:new Gi(t),side:1});return r.push(o.range(n)),H.set(r)}var Gi=class extends Fn{constructor(t){super();p(this,"suggestion");this.suggestion=t}toDOM(){let t=document.createElement("span");return t.style.opacity="0.4",t.className="cm-inline-suggestion",t.textContent=this.suggestion,t.setAttribute("role","suggestion"),t.setAttribute("aria-label",`Suggestion: ${this.suggestion}`),t}get lineBreaks(){return this.suggestion.split(`
3
3
  `).length-1}},Ji=class{constructor(e){p(this,"cache",new Map);p(this,"timeout");this.timeout=e}get(e){let t=this.cache.get(e);return t?Date.now()-t.timestamp>this.timeout?(this.cache.delete(e),null):t.result:null}set(e,t){this.cache.set(e,{result:t,timestamp:Date.now()})}},Wi=(e,t)=>ze.fromClass(class{constructor(){p(this,"abortController",null);p(this,"cache");this.cache=new Ji(t.cacheTimeout??1e3)}async update(n){var i,s,c,u,d;if(!n.docChanged||((s=(i=t.events)==null?void 0:i.beforeSuggestionFetch)==null?void 0:s.call(i,n.view))===!1)return;(c=this.abortController)==null||c.abort(),this.abortController=new AbortController;let r=n.state.doc,o=r.toString(),a=this.cache.get(o);if(a){n.view.dispatch({effects:qt.of({text:a,doc:r})});return}try{let f=await e(n.state,this.abortController.signal,n.view);if(this.abortController.signal.aborted||((d=(u=t.events)==null?void 0:u.shouldShowSuggestion)==null?void 0:d.call(u,n.view,f))===!1)return;this.cache.set(o,f),n.view.dispatch({effects:qt.of({text:f,doc:r})})}catch(f){f instanceof Error&&f.name!=="AbortError"&&console.error("Suggestion fetch error:",f)}}destroy(){var n;(n=this.abortController)==null||n.abort()}}),Vi=ze.fromClass(class{constructor(){p(this,"decorations");this.decorations=H.none}update(e){var n;let t=(n=e.state.field(Ht))==null?void 0:n.suggestion;if(!t){this.decorations=H.none;return}this.decorations=Ri(e.view,t)}},{decorations:e=>e.decorations});function $i(e,t,n,r){return{...e.changeByRange(o=>{if(o===e.selection.main)return{changes:{from:n,to:r,insert:t},range:wt.cursor(n+t.length)};let a=r-n;return!o.empty||a&&e.sliceDoc(o.from-a,o.from)!==e.sliceDoc(n,r)?{range:o}:{changes:{from:o.from-a,to:o.from,insert:t},range:wt.cursor(o.from-a+t.length)}}),userEvent:"input.complete"}}var Hi=e=>{var r,o,a;let t=(r=e.state.field(Ht))==null?void 0:r.suggestion;if(!t)return!1;let n=e.state.facet(Pn);return e.dispatch({...$i(e.state,t,e.state.selection.main.head,e.state.selection.main.head)}),(a=(o=n.events)==null?void 0:o.onSuggestionAccepted)==null||a.call(o,e,t),!0},zr=e=>{var r,o,a;let t=(r=e.state.field(Ht))==null?void 0:r.suggestion;if(!t)return!1;let n=e.state.facet(Pn);return e.dispatch({effects:qt.of({text:null,doc:e.state.doc})}),(a=(o=n.events)==null?void 0:o.onSuggestionRejected)==null||a.call(o,e,t),!0},qi=Je.of([{key:"Tab",run:Hi},{key:"Escape",run:zr}]),Pn=Mt.define({combine:e=>e.at(-1)});function Kr(e){let{delay:t=500,includeKeymap:n=!0}=e,r=Mi(e.fetchFn,t);return[Ht,Pn.of(e),Wi(r,e),Vi,n?qi:[]]}const zi=B.baseTheme({".cm-ai-input-container":{display:"flex",flexDirection:"column",gap:"4px",width:"min(calc(100% + 7px), 500px)",padding:"5px 5px",margin:"0 -6px",backgroundColor:"light-dark(rgb(241, 243, 245), rgb(40, 40, 40))"},".cm-ai-input":{display:"block",width:"100%",padding:"3px 8px",border:"2px solid rgb(51, 154, 240)",borderRadius:"5px",fontSize:"12px"},".cm-ai-help-info-button":{fontSize:"10px",paddingLeft:"10px",height:"18px",color:"light-dark(rgb(109, 117, 125), rgb(170, 170, 170))",display:"block",marginRight:"auto"},".cm-ai-help-info-button:hover":{color:"light-dark(rgb(89, 97, 105), rgb(190, 190, 190))"},".cm-ai-generate-button":{background:"#0E639C",border:"none",padding:"2px 6px",color:"#ffffff",cursor:"pointer",font:"inherit",borderRadius:"4px","&:hover":{backgroundColor:"#1177bb"}},".cm-line.cm-ai-selection, .cm-line.cm-ai-selection.cm-active-line":{backgroundColor:"light-dark(color-mix(in srgb, rgb(223, 227, 232) 50%, transparent), color-mix(in srgb, rgb(50, 50, 50) 50%, transparent)) !important"},".cm-line:has(.cm-new-code-line)":{backgroundColor:"light-dark(color-mix(in srgb, rgb(183, 235, 143) 50%, transparent), color-mix(in srgb, rgb(40, 100, 40) 50%, transparent)) !important"},".cm-old-code-container":{backgroundColor:"light-dark(rgb(255, 205, 205), rgb(100, 40, 40))",position:"relative",display:"flex",paddingTop:"0",width:"100%",alignItems:"center"},".cm-code-button":{position:"absolute",right:"5px",top:"50%",transform:"translateY(-50%)",background:"none",border:"none",cursor:"pointer",fontSize:"16px"},".cm-floating-buttons":{fontFamily:"sans-serif",position:"absolute",top:"-20px",left:"5px",display:"flex"},".cm-floating-button":{fontFamily:"sans-serif",padding:"2px 5px",fontSize:"10px",cursor:"pointer",fontWeight:"700"},".cm-floating-accept":{backgroundColor:"light-dark(rgb(55, 125, 34), rgb(40, 80, 25))",borderTopLeftRadius:"5px",borderBottomLeftRadius:"5px",color:"white",filter:"brightness(90%)","&:hover":{filter:"brightness(100%)"}},".cm-floating-reject":{backgroundColor:"light-dark(rgb(220, 53, 69), rgb(180, 40, 50))",color:"white",borderTopRightRadius:"5px",borderBottomRightRadius:"5px",filter:"brightness(90%)","&:hover":{filter:"brightness(100%)"}},".hotkey":{display:"inline-block",padding:"0 4px",borderRadius:"3px",backgroundColor:"rgba(255, 255, 255, 0.1)",fontSize:"90%"},".cm-ai-loading-indicator":{fontStyle:"italic",fontSize:"10px",paddingLeft:"12px",color:"light-dark(rgb(109, 117, 125), rgb(170, 170, 170))",opacity:"0",transition:"opacity 0.3s ease-in-out","&::after":{content:'""',display:"inline-block",animation:"ellipsis-pulse 1.5s steps(4, end) infinite"},"&:not(:empty)":{opacity:"1"}},".cm-ai-input:disabled":{opacity:"0.5"},"@keyframes ellipsis-pulse":{"0%":{content:"'.'"},"25%":{content:"'..'"},"50%":{content:"'...'"},"75%":{content:"''"}},".cm-ai-loading-container":{display:"flex",alignItems:"center",padding:"0 8px"},".cm-ai-cancel-button":{padding:"2px 8px",fontSize:"10px",borderRadius:"4px",color:"light-dark(rgb(109, 117, 125), rgb(170, 170, 170))",cursor:"pointer","&:hover":{background:"light-dark(rgb(223, 227, 232), rgb(50, 50, 50))"}},".hidden":{display:"none"}});function Ki(e){var o,a;let t=e.state.facet(St),n={...q,...t.keymaps},r=de("div","cm-ai-tooltip").appendChild(de("div","cm-ai-tooltip-button"));return r.innerHTML=`<span>Edit <span class="hotkey">${jn(n.showInput)}</span></span>`,(o=r.querySelector("span"))==null||o.addEventListener("mousedown",i=>{i.stopPropagation(),i.button===0&&i.preventDefault()}),(a=r.querySelector("span"))==null||a.addEventListener("click",i=>{i.preventDefault(),$r(e)}),r}const Mn=Mt.define({combine(e){return An(e,{render:Ki,hideOnBlur:!1})}}),Yi=ze.fromClass((Ia=class{constructor(e){p(this,"view");p(this,"suppress");p(this,"dom");p(this,"mousedown",()=>{this.suppress=!0});p(this,"mouseup",()=>{this.suppress=!1,this.display(this.view)});p(this,"scroll",()=>{this.display(this.view)});p(this,"windowScroll",()=>{this.display(this.view)});Oa(this,vn,e=>{var n;let t=e.state.selection.ranges.find(r=>!r.empty);if(t&&!this.suppress){let r=e.coordsAtPos(t.from);if(!r)return;let o=e.dom.getBoundingClientRect(),a=(n=e.dom.parentElement)==null?void 0:n.getBoundingClientRect(),i=r.top>=o.top&&r.top<=o.bottom&&r.left>=o.left&&r.left<=o.right,s=!a||r.top>=a.top&&r.top<=a.bottom&&r.left>=a.left&&r.left<=a.right;if(!i||!s){this.dom.style.display="none",this.dom.setAttribute("aria-hidden","true");return}this.dom.style.display="flex",this.dom.setAttribute("aria-hidden","false");let c=this.dom.getBoundingClientRect(),u=o.width-c.width,d=Math.min(r.left,u),f=r.top-c.height;f=a?Math.max(a.y,f):f,this.dom.style.left=`${d}px`,this.dom.style.top=`${f}px`,requestAnimationFrame(()=>{this.dom&&this.dom.setAttribute("aria-hidden","false")})}else this.dom.style.display="none",this.dom.setAttribute("aria-hidden","true")});this.view=e;let t=e.state.facet(Mn);this.suppress=!1,document.addEventListener("mousedown",this.mousedown),document.addEventListener("mouseup",this.mouseup),e.scrollDOM.addEventListener("scroll",this.scroll),window.addEventListener("scroll",this.windowScroll,!0);let n=t.render(e);e.dom.appendChild(n),this.dom=n}update(e){this.display(e.view)}docViewUpdate(e){this.display(e)}display(e){if(e.state.field(ot).show){this.dom.style.display="none";return}if(e.state.facet(Mn).hideOnBlur&&!e.hasFocus){this.dom.style.display="none",this.dom.setAttribute("aria-hidden","true");return}e.requestMeasure({read:La(this,vn)})}destroy(){document.removeEventListener("mousedown",this.mousedown),document.removeEventListener("mouseup",this.mouseup),this.view.scrollDOM.removeEventListener("scroll",this.scroll),window.removeEventListener("scroll",this.windowScroll,!0),this.dom.remove()}},vn=new WeakMap,Ia));var Xi=B.baseTheme({".cm-ai-tooltip-button":{userSelect:"none",fontFamily:"system-ui, -apple-system, sans-serif",position:"fixed",display:"flex",boxSizing:"border-box",padding:"2px 6px",borderRadius:"4px",fontSize:"12px",backgroundColor:"#0E639C",color:"#ffffff",border:"1px solid transparent",boxShadow:"0 2px 4px rgba(0,0,0,0.1)",zIndex:"999",transition:"opacity 0.5s","&[aria-hidden='true']":{opacity:"0"},"&[aria-hidden='false']":{opacity:"1"},"& > span":{pointerEvents:"auto",cursor:"pointer",display:"inline-block",padding:"2px"},"&:hover":{backgroundColor:"#1177bb"}}});function Qi(){return[Yi,Xi]}var Zi=class extends Fn{constructor(t){super();p(this,"oldCode");this.oldCode=t}toDOM(t){let n=de("div","cm-old-code-container");n.setAttribute("role","region"),n.setAttribute("aria-label","Previous code version");let r=de("div","cm-old-code cm-line");r.textContent=this.oldCode;let o=de("div","cm-floating-buttons"),a=t.state.facet(St),i={...q,...a.keymaps},s=de("button","cm-floating-button cm-floating-accept");s.innerHTML=`<span class="hotkey">${jn(i.acceptEdit)}</span> Accept`,s.setAttribute("aria-label","Accept changes"),s.addEventListener("click",u=>{u.preventDefault(),u.stopPropagation(),t.focus(),Hr(t)});let c=de("button","cm-floating-button cm-floating-reject");return c.innerHTML=`<span class="hotkey">${jn(i.rejectEdit)}</span> Reject`,c.setAttribute("aria-label","Reject changes"),c.addEventListener("click",u=>{u.preventDefault(),u.stopPropagation(),t.focus(),qr(t)}),o.append(s,c),n.append(r,o),n}updateDOM(t,n){return!0}},es=class extends Fn{constructor(t){super();p(this,"complete");p(this,"abortController",null);p(this,"dom",null);p(this,"input",null);p(this,"loadingContainer",null);p(this,"helpInfo",null);p(this,"inputContainer",null);p(this,"form",null);p(this,"view",null);p(this,"onKeyDown",async t=>{t.key==="Enter"&&!t.shiftKey?(t.preventDefault(),await this.handleSubmit()):t.key==="Escape"&&this.onCancel()});p(this,"onCancel",()=>{this.cleanup();let t=this.view;t&&(t.dispatch({effects:[rt.of({show:!1,lineFrom:0,lineTo:0}),ft.of(!1)]}),t.focus())});p(this,"handleSubmit",async t=>{var g;let n=this.view;if(!n)return;let r=n.state.facet(St);t==null||t.stopPropagation();let o=n.state.field(ot),{input:a}=this;if(!a)return;let i=a.value.trim();if(!o.show||!i)return;let s=n.state.doc.line(o.lineFrom),c=n.state.doc.line(o.lineTo),u=s.from,d=c.to,f=n.state.sliceDoc(u,d),h=n.state.sliceDoc(0,u),m=n.state.sliceDoc(d);this.abortController=new AbortController,n.dispatch({effects:ft.of(!0)}),this.toggleLoading(!0);try{let y=await this.complete({prompt:i,selection:f,codeBefore:h,codeAfter:m,editorView:n,signal:this.abortController.signal});if(!n.state.field(ot).show)return;if(!y||typeof y!="string")throw Error("Invalid completion result");n.dispatch({changes:{from:u,to:d,insert:y},effects:[rt.of({show:!1,lineFrom:0,lineTo:0}),$t.of({from:u,to:u+y.length,oldCode:f,newCode:y}),ft.of(!1)]})}catch(y){if(y instanceof DOMException&&y.name==="AbortError")return;(g=r.onError)==null||g.call(r,y)}finally{this.cleanup(),this.toggleLoading(!1),n.focus()}});this.complete=t}toDOM(t){if(this.dom)return this.dom;this.view=t;let n=t.state.field(Wr),r=t.state.field(Vr),o=de("div","cm-ai-input-container");this.inputContainer=o,this.dom=o;let a=de("form","cm-ai-input-form");this.form=a,a.setAttribute("role","search"),a.setAttribute("aria-label","AI editing instructions"),a.addEventListener("submit",w=>w.preventDefault());let i=de("input","cm-ai-input");this.input=i,a.append(i),i.placeholder="Editing instructions...",i.setAttribute("aria-label","AI editing instructions"),i.setAttribute("autocomplete","off"),i.setAttribute("spellcheck","true"),i.value=n.inputValue;let s=de("div","cm-ai-loading-container");this.loadingContainer=s;let c=de("div","cm-ai-loading-indicator");c.setAttribute("role","status"),c.setAttribute("aria-live","polite"),c.textContent="Generating";let u=de("button","cm-ai-cancel-button");u.textContent="Cancel",u.setAttribute("aria-label","Cancel code generation"),u.addEventListener("click",this.onCancel),s.append(u,c);let d=de("div","cm-ai-help-info");this.helpInfo=d;let f=d.appendChild(document.createElement("button"));f.className="cm-ai-help-info-button",f.textContent="Esc to close",f.addEventListener("click",this.onCancel);let h=de("button","cm-ai-generate-button");h.textContent="\u23CE Generate",h.setAttribute("aria-label","Generate code"),h.addEventListener("click",this.handleSubmit),this.toggleLoading(r),n.shouldFocus&&requestAnimationFrame(()=>{i.value=n.inputValue,i.focus(),t.dispatch({effects:At.of(!1)})}),m(i.value),i.addEventListener("input",y),i.addEventListener("keydown",this.onKeyDown);function m(w){d.replaceChildren(w?h:f)}let g="";function y(){t.dispatch({effects:xt.of(i.value)});let w=i.value.trim();w!==g&&(g=w,m(w))}return o}toggleLoading(t){var n;this.inputContainer&&this.form&&this.loadingContainer&&this.helpInfo&&((n=this.inputContainer)==null||n.replaceChildren(this.form,t?this.loadingContainer:this.helpInfo))}updateDOM(t,n){return this.dom=t,this.input=t.querySelector(".cm-ai-input"),!0}cleanup(){var t,n,r;(t=this.abortController)==null||t.abort(),this.abortController=null,(n=this.dom)==null||n.remove(),(r=this.input)==null||r.remove(),this.dom=null,this.input=null}destroy(){this.cleanup()}};function ts(e){if(!e.prompt)throw Error("prompt function is required");let t={...q,...e.keymaps};return[St.of(e),ot,Wr,Tt,Vr,Qi(),zi,Je.of([{key:t.showInput,run:$r}]),ut.highest([Je.of([{key:t.acceptEdit,run:Hr},{key:t.rejectEdit,run:qr}])]),ns,rs,os,as]}const ns=B.updateListener.of(e=>{let t=e.state.field(ot);if(!t.show||!e.docChanged)return;let{lineFrom:n,lineTo:r}=t,o=!1;e.changes.iterChanges((a,i,s,c)=>{let u=e.state.doc.lineAt(a).number;if(u<n){let d=e.state.doc.lineAt(c).number-e.state.doc.lineAt(s).number;n+=d,r+=d,o=!0}else if(u<=r){let d=e.state.doc.lineAt(c).number-e.state.doc.lineAt(s).number;r+=d,o=!0}}),o&&e.view.dispatch({effects:[rt.of({show:!0,lineFrom:n,lineTo:r})]})}),rs=B.decorations.of(e=>{let t=e.state.field(Tt);return t?H.set([H.mark({class:"cm-new-code-line"}).range(t.from,t.to)]):H.none}),os=B.decorations.compute([ot],e=>{let t=e.field(ot),n=e.facet(St),r=[];if(t.show){let o=t.lineFrom,a=t.lineTo;for(let i=o;i<=a;i++){let s=e.doc.line(i).from;r.push(H.line({class:"cm-ai-selection"}).range(s)),i===o&&r.push(H.widget({widget:new es(n.prompt),side:-1}).range(s))}}return H.set(r)}),as=qe.define({create(e){return H.none},update(e,t){let n=t.state.field(Tt);return n?H.set([H.widget({widget:new Zi(n.oldCode),block:!0}).range(n.from)]):H.none},provide:e=>B.decorations.from(e)});var is=Re(),I=Da(cd(),1),Rn=()=>({entries:new Map}),{valueAtom:Yr,useActions:Xr}=Or(Rn,{submit:(e,t)=>{let{cellIds:n,deleteCell:r,deleteManyCells:o,store:a}=t,i=a.get(nt),s=a.get(Dd),c=new Set(i.cellIds.inOrderIds.filter(f=>i.cellData[f].code.trim()==="")),u=new Map;for(let f of n){if(c.has(f)){u.set(f,{cellId:f,type:"simple"});continue}let h=i.cellRuntime[f],m=new Map;for(let y of Object.values(s)){let w=y.declaredBy.includes(f),k=y.usedBy.some(C=>!c.has(C));w&&k&&m.set(y.name,y.usedBy)}let g;h!=null&&h.runElapsedTimeMs&&h.runElapsedTimeMs>2e3&&(g=h.runElapsedTimeMs),m.size===0&&g===void 0?u.set(f,{cellId:f,type:"simple"}):u.set(f,{cellId:f,type:"expensive",executionDurationMs:g,defs:m})}let d=[...u.values()].every(f=>f.type==="simple");return u.size>0&&d?(u.size===1?r({cellId:[...u.values()][0].cellId}):o({cellIds:[...u.values()].map(f=>f.cellId)}),Rn()):{...e,entries:u}},clear:()=>Rn()});Un=function(){let e=wr(),{submit:t,clear:n}=Xr(),{entries:r}=oe(Yr),o=Ei(),a=Ur();return(0,I.useMemo)(()=>({submit:i=>{t({cellIds:i,deleteCell:o,deleteManyCells:a,store:e})},clear:n,get idle(){return r.size===0},get shouldConfirmDelete(){return r.size>1}}),[e,t,n,r,o,a])},Ii=function(e){let t=(0,is.c)(16),n=oe(Yr),r=Xr(),o=Ur(),a;t[0]!==e||t[1]!==n.entries?(a=n.entries.get(e),t[0]=e,t[1]=n.entries,t[2]=a):a=t[2];let i=a;if(!i){let d;return t[3]===Symbol.for("react.memo_cache_sentinel")?(d={isPending:!1},t[3]=d):d=t[3],d}if(n.entries.size!==1){let d;return t[4]===i?d=t[5]:(d={isPending:!0,shouldConfirmDelete:!1,...i},t[4]=i,t[5]=d),d}let s;t[6]!==r||t[7]!==o||t[8]!==n.entries?(s=()=>{o({cellIds:[...n.entries.values()].map(ss)}),r.clear()},t[6]=r,t[7]=o,t[8]=n.entries,t[9]=s):s=t[9];let c;t[10]===r?c=t[11]:(c=()=>r.clear(),t[10]=r,t[11]=c);let u;return t[12]!==i||t[13]!==s||t[14]!==c?(u={isPending:!0,...i,shouldConfirmDelete:!0,confirm:s,cancel:c},t[12]=i,t[13]=s,t[14]=c,t[15]=u):u=t[15],u};function ss(e){return e.cellId}async function ls(e){var s,c;let t=`
4
4
  ${e.codeBefore}
5
5
  <rewrite_this>
@@ -1 +1 @@
1
- import{s as P}from"./chunk-LvLJmgfZ.js";import{d as j,l as O,n as w,u as y}from"./useEvent-DlWF5OMa.js";import{A,C as L,Gt as E,O as S,Pt as T,Ur as _,ei as $,pt as D}from"./cells-DU3EySUd.js";import{t as b}from"./compiler-runtime-DeeZ7FnK.js";import{d as F}from"./hotkeys-uKX61F1_.js";import{u as U}from"./utils-CJJIceVn.js";import{r as C}from"./constants-Bkp4R3bQ.js";import{j as q,p as B,w as G}from"./config-Ba3eeYri.js";import{t as H}from"./jsx-runtime-DN_bIXfG.js";import{t as M}from"./cn-C1rgT0yh.js";import{r as R}from"./requests-C0HaHO6a.js";import{n as V}from"./ImperativeModal-q6QlC2aZ.js";var z=b();function I(){return y(_)}function J(){let r=(0,z.c)(5),[t]=O(G),e=j(_),{openAlert:a}=V(),{sendRename:o}=R(),s;return r[0]!==t.state||r[1]!==a||r[2]!==o||r[3]!==e?(s=async l=>{let n=U();return t.state===q.OPEN?(B(i=>{l===null?i.delete(C.filePath):i.set(C.filePath,l)}),o({filename:l}).then(()=>(e(l),document.title=n.app_title||T.basename(l)||"Untitled Notebook",l)).catch(i=>(a(i.message),null))):(a("Failed to save notebook: not connected to a kernel."),null)},r[0]=t.state,r[1]=a,r[2]=o,r[3]=e,r[4]=s):s=r[4],w(s)}var p=b(),v=P(H(),1);const k=r=>{let t=(0,p.c)(12),{className:e,cellId:a,variant:o,onClick:s,formatCellName:l,skipScroll:n}=r,i=A()[a]??"",x=S().inOrderIds.indexOf(a),{showCellIfHidden:d}=L(),g=l??W,c;t[0]===e?c=t[1]:(c=M("inline-block cursor-pointer text-link hover:underline",e),t[0]=e,t[1]=c);let m;t[2]!==a||t[3]!==s||t[4]!==d||t[5]!==n||t[6]!==o?(m=h=>{if(a==="__scratch__")return!1;d({cellId:a}),h.stopPropagation(),h.preventDefault(),requestAnimationFrame(()=>{N(a,o,n)&&(s==null||s())})},t[2]=a,t[3]=s,t[4]=d,t[5]=n,t[6]=o,t[7]=m):m=t[7];let f=g(D(i,x)),u;return t[8]!==c||t[9]!==m||t[10]!==f?(u=(0,v.jsx)("div",{className:c,role:"link",tabIndex:-1,onClick:m,children:f}),t[8]=c,t[9]=m,t[10]=f,t[11]=u):u=t[11],u},K=r=>{let t=(0,p.c)(2),e;return t[0]===r?e=t[1]:(e=(0,v.jsx)(k,{...r,variant:"destructive"}),t[0]=r,t[1]=e),e},Q=r=>{let t=(0,p.c)(10),{cellId:e,lineNumber:a}=r,o=I(),s;t[0]!==e||t[1]!==a?(s=()=>E(e,a),t[0]=e,t[1]=a,t[2]=s):s=t[2];let l;t[3]!==e||t[4]!==o?(l=i=>e==="__scratch__"?"scratch":`marimo://${o||"untitled"}#cell=${i}`,t[3]=e,t[4]=o,t[5]=l):l=t[5];let n;return t[6]!==e||t[7]!==s||t[8]!==l?(n=(0,v.jsx)(k,{cellId:e,onClick:s,skipScroll:!0,variant:"destructive",className:"traceback-cell-link",formatCellName:l}),t[6]=e,t[7]=s,t[8]=l,t[9]=n):n=t[9],n};function N(r,t,e){let a=$.create(r),o=document.getElementById(a);return o===null?(F.error(`Cell ${a} not found on page.`),!1):(e||o.scrollIntoView({behavior:"smooth",block:"center"}),t==="destructive"&&(o.classList.add("error-outline"),setTimeout(()=>{o.classList.remove("error-outline")},2e3)),t==="focus"&&(o.classList.add("focus-outline"),setTimeout(()=>{o.classList.remove("focus-outline")},2e3)),!0)}function W(r){return r}export{I as a,N as i,K as n,J as o,Q as r,k as t};
1
+ import{s as P}from"./chunk-LvLJmgfZ.js";import{d as j,l as O,n as w,u as y}from"./useEvent-DlWF5OMa.js";import{A,C as L,Gt as E,O as S,Pt as T,Ur as _,ei as $,pt as D}from"./cells-CibeVr5R.js";import{t as b}from"./compiler-runtime-DeeZ7FnK.js";import{d as F}from"./hotkeys-uKX61F1_.js";import{u as U}from"./utils-CJJIceVn.js";import{r as C}from"./constants-Bkp4R3bQ.js";import{j as q,p as B,w as G}from"./config-Ba3eeYri.js";import{t as H}from"./jsx-runtime-DN_bIXfG.js";import{t as M}from"./cn-C1rgT0yh.js";import{r as R}from"./requests-C0HaHO6a.js";import{n as V}from"./ImperativeModal-q6QlC2aZ.js";var z=b();function I(){return y(_)}function J(){let r=(0,z.c)(5),[t]=O(G),e=j(_),{openAlert:a}=V(),{sendRename:o}=R(),s;return r[0]!==t.state||r[1]!==a||r[2]!==o||r[3]!==e?(s=async l=>{let n=U();return t.state===q.OPEN?(B(i=>{l===null?i.delete(C.filePath):i.set(C.filePath,l)}),o({filename:l}).then(()=>(e(l),document.title=n.app_title||T.basename(l)||"Untitled Notebook",l)).catch(i=>(a(i.message),null))):(a("Failed to save notebook: not connected to a kernel."),null)},r[0]=t.state,r[1]=a,r[2]=o,r[3]=e,r[4]=s):s=r[4],w(s)}var p=b(),v=P(H(),1);const k=r=>{let t=(0,p.c)(12),{className:e,cellId:a,variant:o,onClick:s,formatCellName:l,skipScroll:n}=r,i=A()[a]??"",x=S().inOrderIds.indexOf(a),{showCellIfHidden:d}=L(),g=l??W,c;t[0]===e?c=t[1]:(c=M("inline-block cursor-pointer text-link hover:underline",e),t[0]=e,t[1]=c);let m;t[2]!==a||t[3]!==s||t[4]!==d||t[5]!==n||t[6]!==o?(m=h=>{if(a==="__scratch__")return!1;d({cellId:a}),h.stopPropagation(),h.preventDefault(),requestAnimationFrame(()=>{N(a,o,n)&&(s==null||s())})},t[2]=a,t[3]=s,t[4]=d,t[5]=n,t[6]=o,t[7]=m):m=t[7];let f=g(D(i,x)),u;return t[8]!==c||t[9]!==m||t[10]!==f?(u=(0,v.jsx)("div",{className:c,role:"link",tabIndex:-1,onClick:m,children:f}),t[8]=c,t[9]=m,t[10]=f,t[11]=u):u=t[11],u},K=r=>{let t=(0,p.c)(2),e;return t[0]===r?e=t[1]:(e=(0,v.jsx)(k,{...r,variant:"destructive"}),t[0]=r,t[1]=e),e},Q=r=>{let t=(0,p.c)(10),{cellId:e,lineNumber:a}=r,o=I(),s;t[0]!==e||t[1]!==a?(s=()=>E(e,a),t[0]=e,t[1]=a,t[2]=s):s=t[2];let l;t[3]!==e||t[4]!==o?(l=i=>e==="__scratch__"?"scratch":`marimo://${o||"untitled"}#cell=${i}`,t[3]=e,t[4]=o,t[5]=l):l=t[5];let n;return t[6]!==e||t[7]!==s||t[8]!==l?(n=(0,v.jsx)(k,{cellId:e,onClick:s,skipScroll:!0,variant:"destructive",className:"traceback-cell-link",formatCellName:l}),t[6]=e,t[7]=s,t[8]=l,t[9]=n):n=t[9],n};function N(r,t,e){let a=$.create(r),o=document.getElementById(a);return o===null?(F.error(`Cell ${a} not found on page.`),!1):(e||o.scrollIntoView({behavior:"smooth",block:"center"}),t==="destructive"&&(o.classList.add("error-outline"),setTimeout(()=>{o.classList.remove("error-outline")},2e3)),t==="focus"&&(o.classList.add("focus-outline"),setTimeout(()=>{o.classList.remove("focus-outline")},2e3)),!0)}function W(r){return r}export{I as a,N as i,K as n,J as o,Q as r,k as t};
@@ -251,4 +251,4 @@ mark line col
251
251
  `]))));let c=this._buffer.match(this._osc_regex);if(c===null)return e.kind=It.ESC,e.text=this._buffer.slice(0,1),this._buffer=this._buffer.slice(1),e;e.kind=It.OSCURL,e.url=c[1],e.text=c[2];var s=c[0].length;return this._buffer=this._buffer.slice(s),e}else if(o=="(")return e.kind=It.Unknown,this._buffer=this._buffer.slice(3),e}}ansi_to_html(e){this.append_buffer(e);for(var n=[];;){var i=this.get_next_packet();if(i.kind==It.EOS||i.kind==It.Incomplete)break;i.kind==It.ESC||i.kind==It.Unknown||(i.kind==It.Text?n.push(this.transform_to_html(this.with_state(i))):i.kind==It.SGR?this.process_ansi(i):i.kind==It.OSCURL&&n.push(this.process_hyperlink(i)))}return n.join("")}with_state(e){return{bold:this.bold,faint:this.faint,italic:this.italic,underline:this.underline,fg:this.fg,bg:this.bg,text:e.text}}process_ansi(e){let n=e.text.split(";");for(;n.length>0;){let i=n.shift(),o=parseInt(i,10);if(isNaN(o)||o===0)this.fg=null,this.bg=null,this.bold=!1,this.faint=!1,this.italic=!1,this.underline=!1;else if(o===1)this.bold=!0;else if(o===2)this.faint=!0;else if(o===3)this.italic=!0;else if(o===4)this.underline=!0;else if(o===21)this.bold=!1;else if(o===22)this.faint=!1,this.bold=!1;else if(o===23)this.italic=!1;else if(o===24)this.underline=!1;else if(o===39)this.fg=null;else if(o===49)this.bg=null;else if(o>=30&&o<38)this.fg=this.ansi_colors[0][o-30];else if(o>=40&&o<48)this.bg=this.ansi_colors[0][o-40];else if(o>=90&&o<98)this.fg=this.ansi_colors[1][o-90];else if(o>=100&&o<108)this.bg=this.ansi_colors[1][o-100];else if((o===38||o===48)&&n.length>0){let s=o===38,c=n.shift();if(c==="5"&&n.length>0){let d=parseInt(n.shift(),10);d>=0&&d<=255&&(s?this.fg=this.palette_256[d]:this.bg=this.palette_256[d])}if(c==="2"&&n.length>2){let d=parseInt(n.shift(),10),f=parseInt(n.shift(),10),p=parseInt(n.shift(),10);if(d>=0&&d<=255&&f>=0&&f<=255&&p>=0&&p<=255){let y={rgb:[d,f,p],class_name:"truecolor"};s?this.fg=y:this.bg=y}}}}}transform_to_html(e){let n=e.text;if(n.length===0||(n=this.escape_txt_for_html(n),!e.bold&&!e.italic&&!e.faint&&!e.underline&&e.fg===null&&e.bg===null))return n;let i=[],o=[],s=e.fg,c=e.bg;e.bold&&i.push(this._boldStyle),e.faint&&i.push(this._faintStyle),e.italic&&i.push(this._italicStyle),e.underline&&i.push(this._underlineStyle),this._use_classes?(s&&(s.class_name==="truecolor"?i.push(`color:rgb(${s.rgb.join(",")})`):o.push(`${s.class_name}-fg`)),c&&(c.class_name==="truecolor"?i.push(`background-color:rgb(${c.rgb.join(",")})`):o.push(`${c.class_name}-bg`))):(s&&i.push(`color:rgb(${s.rgb.join(",")})`),c&&i.push(`background-color:rgb(${c.rgb})`));let d="",f="";return o.length&&(d=` class="${o.join(" ")}"`),i.length&&(f=` style="${i.join(";")}"`),`<span${f}${d}>${n}</span>`}process_hyperlink(e){let n=e.url.split(":");return n.length<1||!this._url_allowlist[n[0]]?"":`<a href="${this.escape_txt_for_html(e.url)}">${this.escape_txt_for_html(e.text)}</a>`}};function Sv(e,...n){let i=e.raw[0].replace(/^\s+|\s+\n|\s*#[\s\S]*?\n|\n/gm,"");return new RegExp(i)}function Q3(e,...n){let i=e.raw[0].replace(/^\s+|\s+\n|\s*#[\s\S]*?\n|\n/gm,"");return new RegExp(i,"g")}var G3,J3,X3,Y3=new km;Vu=function(e){try{let n=document.createElement("div");return n.innerHTML=e,(n.textContent||n.innerText||"").split(`
252
252
  `).map(i=>i.trimEnd()).join(`
253
253
  `)}catch(n){return Re.error("Error parsing HTML content:",n),e}},Aw=function(e){if(!e)return"";try{return Vu(Y3.ansi_to_html(e))}catch(n){return Re.error("Error converting ANSI to plain text:",n),e}},rm={startCase:e=>{if(!e)return"";if(typeof e!="string")throw Re.error(e),TypeError(`Expected string, got ${typeof e}`);return/[A-Za-z]/.test(e)?l4(e):e},htmlEscape:e=>e&&e.replaceAll("&","&amp;").replaceAll("<","&lt;").replaceAll(">","&gt;").replaceAll('"',"&quot;").replaceAll("'","&#039;").replaceAll(`
254
- `," "),withTrailingSlash(e){return e.endsWith("/")?e:`${e}/`},withoutTrailingSlash(e){return e.endsWith("/")?e.slice(0,-1):e},withoutLeadingSlash(e){return e.startsWith("/")?e.slice(1):e},asString:e=>{if(typeof e=="string")return e;try{return JSON.stringify(e)}catch{return String(e)}}};var Cv=!1;function Z3(e){var o;let n=[],i=[e.console].filter(Boolean).flat();for(let s of i){let c=s.mimetype==="text/plain",d=s.mimetype==="text/html"||s.mimetype==="application/vnd.marimo+traceback";if(c||d){let f=s.channel==="stderr"||s.channel==="marimo-error";switch(s.channel){case"stdout":case"stderr":case"marimo-error":{let p=rm.asString(s.data),y=d?Vu(p):p;n.push({timestamp:s.timestamp||Date.now(),level:f?"stderr":"stdout",message:y,cellId:e.cell_id});break}default:break}}}if(n.forEach(Ev.log),i.length===0&&Au((o=e.output)==null?void 0:o.mimetype)&&Array.isArray(e.output.data)){e.output.data.forEach(c=>{Ev.log({level:"stderr",cellId:e.cell_id,timestamp:e.timestamp??0,message:JSON.stringify(c)})});let s=e.output.data.some(c=>c.type==="internal");!Cv&&s&&(Cv=!0,Nl({title:"An internal error occurred",description:"See console for details.",className:"text-xs text-background bg-(--red-10) py-2 pl-3 *:flex *:gap-3"}))}return n}var Ev={log:e=>{let n=e.level==="stdout"?"gray":e.level==="stderr"?"red":"orange",i=e.level.toUpperCase();console.log(`%c[${i}]`,`color:${n}; padding:2px 0; border-radius:2px; font-weight:bold`,`[${Zh(e.timestamp)}]`,`(${e.cellId}) ${e.message}`)}};Zh=function(e){try{return K3(e).toLocaleTimeString(void 0,{hour12:!0,hour:"numeric",minute:"numeric",second:"numeric"})}catch{return""}},Dw=function(e,n){let i=Zu(n);i?i.focus():Re.warn(`[CellFocusManager] focusCellEditor: element not found: ${n}`)},sx=function(e){let n=document.getElementById(Zn.create(e));n?gf(n):Re.warn(`[CellFocusManager] focusCell: element not found: ${e}`)},zw=function(e){requestAnimationFrame(()=>{requestAnimationFrame(e)})},tm=function(){return document.activeElement instanceof HTMLElement&&document.activeElement.classList.contains("marimo-cell")};function gf(e){try{e.focus()}catch{Re.warn("[CellFocusManager] element may not be focusable",e)}}Jh=function(e,n){let{retries:i,delay:o,initialDelay:s=0}=n,c=0,d=()=>{if(c<i){try{if(e())return}catch(f){Re.error(`Error executing function on attempt ${c+1}, retrying`,{error:f})}c++,setTimeout(d,o)}};s>0?setTimeout(d,s):d()};function As({cellId:e,cell:n,isCodeHidden:i,codeFocus:o,variableName:s}){var d;if(!n)return;let c=document.getElementById(Zn.create(e));if(!c){Re.warn("scrollCellIntoView: element not found");return}if(tm()){gf(c);return}if(i)gf(c);else{let f=(d=n.current)==null?void 0:d.editorView;if(!f){Re.warn("scrollCellIntoView: editor not found",e);return}if(f.hasFocus)return;if(Jh(()=>(f.focus(),f.hasFocus),{retries:5,delay:20}),o==="top")f.dispatch({selection:{anchor:0,head:0}});else if(o==="bottom"){let p=f.state.doc.line(f.state.doc.lines);f.dispatch({selection:{anchor:p.from,head:p.from}})}else s&&Hu(f,s)}c.scrollIntoView({behavior:"smooth",block:"nearest"})}Bw=function(e){let n=document.getElementById(Zn.create(e));if(!n){Re.warn("scrollCellIntoView: element not found");return}n.classList.add("focus-outline"),setTimeout(()=>{n.classList.remove("focus-outline")},2e3),n.scrollIntoView({behavior:"smooth",block:"center"})};function eT(){let e=document.getElementById("App");e==null||e.scrollTo({top:e.scrollHeight,behavior:"smooth"})}function tT(){var e;(e=document.getElementById("App"))==null||e.scrollTo({top:0,behavior:"smooth"})}Hw=function(e){let n=Zu(e);if(n!=null&&n.hasFocus){ey(n,{behavior:"instant"});return}let i=document.getElementById(Zn.create(e));i?i.scrollIntoView({behavior:"instant",block:"nearest"}):Re.warn(`[CellFocusManager] scrollCellIntoView: element not found: ${e}`)},Mr=function({id:e,name:n="_",code:i="",lastCodeRun:o=null,lastExecutionTime:s=null,edited:c=!1,config:d,serializedEditorState:f=null}){return{id:e,config:d||{hide_code:!1,disabled:!1,column:null},name:n,code:i,edited:c,lastCodeRun:o,lastExecutionTime:s,serializedEditorState:f}};function nT(e){return{hide_code:!1,disabled:!1,column:null,...e}}Pr=function(e){return{outline:null,output:null,consoleOutputs:[],status:"idle",staleInputs:!1,interrupted:!1,errored:!1,stopped:!1,runElapsedTimeMs:null,runStartTimestamp:null,lastRunStartTimestamp:null,debuggerActive:!1,...e}};var yf=Gr();function Tv(e){let n={column:0,hide_code:!1,disabled:!1};return{...e,cellData:{[Rs]:Mr({id:Rs,config:n}),...e.cellData},cellRuntime:{[Rs]:Pr(),...e.cellRuntime},cellHandles:{[Rs]:(0,At.createRef)(),...e.cellHandles}}}function rT(){return Tv({cellIds:jl.from([]),cellData:{},cellRuntime:{},cellHandles:{},history:[],scrollKey:null,cellLogs:[],untouchedNewCells:new Set})}let iT,aT,Rv;({reducer:iT,createActions:aT,useActions:Rv,valueAtom:yt}=Ll(rT,{createNewCell:(e,n)=>{var T;let{cellId:i,before:o,code:s,lastCodeRun:c=null,lastExecutionTime:d=null,autoFocus:f=!0,skipIfCodeExists:p=!1,hideCode:y=!1}=n,w,_;if(p){for(let L of e.cellIds.inOrderIds)if(((T=e.cellData[L])==null?void 0:T.code)===s)return e}if(i==="__end__"){let L=e.cellIds.atOrThrow(0);w=L.id,_=L.length}else if(typeof i=="string"){let L=e.cellIds.findWithId(i);w=L.id,_=L.topLevelIds.indexOf(i)}else if(i.type==="__end__"){let L=e.cellIds.get(i.columnId)||e.cellIds.atOrThrow(0);w=L.id,_=L.length}else throw Error("Invalid cellId");let C=n.newCellId||Pa.create(),E=o?_:_+1;return{...e,cellIds:e.cellIds.insertId(C,w,E),cellData:{...e.cellData,[C]:Mr({id:C,code:s,lastCodeRun:c,config:nT({hide_code:y}),lastExecutionTime:d,edited:!!s&&s!==c})},cellRuntime:{...e.cellRuntime,[C]:Pr()},cellHandles:{...e.cellHandles,[C]:(0,At.createRef)()},scrollKey:f?C:null,untouchedNewCells:y?new Set([...e.untouchedNewCells,C]):e.untouchedNewCells}},moveCell:(e,n)=>{let{cellId:i,before:o,direction:s}=n;if(o!==void 0&&s!==void 0&&Re.warn("Both before and direction specified for moveCell. Ignoring one."),s){let f=e.cellIds.findWithId(i),p=e.cellIds.indexOf(f),y=s==="left"?p-1:p+1,w=e.cellIds.at(y);return w?{...e,cellIds:e.cellIds.moveAcrossColumns(f.id,i,w.id,void 0),scrollKey:i}:e}let c=e.cellIds.findWithId(i),d=c.indexOfOrThrow(i);return o&&d===0?{...e,cellIds:e.cellIds.moveWithinColumn(c.id,d,0),scrollKey:i}:!o&&d===c.length-1?{...e,cellIds:e.cellIds.moveWithinColumn(c.id,d,c.length-1),scrollKey:i}:o?{...e,cellIds:e.cellIds.moveWithinColumn(c.id,d,d-1),scrollKey:i}:{...e,cellIds:e.cellIds.moveWithinColumn(c.id,d,d+1),scrollKey:i}},dropCellOverCell:(e,n)=>{let{cellId:i,overCellId:o}=n,s=e.cellIds.findWithId(i),c=e.cellIds.findWithId(o),d=s.indexOfOrThrow(i),f=c.indexOfOrThrow(o);return s.id===c.id?d===f?e:{...e,cellIds:e.cellIds.moveWithinColumn(s.id,d,f),scrollKey:null}:{...e,cellIds:e.cellIds.moveAcrossColumns(s.id,i,c.id,o),scrollKey:null}},dropCellOverColumn:(e,n)=>{let{cellId:i,columnId:o}=n,s=e.cellIds.findWithId(i);return{...e,cellIds:e.cellIds.moveAcrossColumns(s.id,i,o,void 0)}},dropOverNewColumn:(e,n)=>{let{cellId:i}=n;return{...e,cellIds:e.cellIds.moveToNewColumn(i)}},moveColumn:(e,n)=>n.column===n.overColumn?e:{...e,cellIds:e.cellIds.moveColumn(n.column,n.overColumn)},focusCell:(e,n)=>{let i=e.cellIds.findWithId(n.cellId);if(i.length===0)return e;let{cellId:o,where:s}=n,c=i.indexOfOrThrow(o),d;d=s==="before"?xh(c-1,0,i.length-1):s==="after"?xh(c+1,0,i.length-1):c;let f=i.atOrThrow(d);return As({cellId:f,cell:e.cellHandles[f],isCodeHidden:qs(e,f),codeFocus:s==="after"?"top":"bottom",variableName:void 0}),e},focusTopCell:e=>{let n=e.cellIds.getColumns().at(0);if(n===void 0||n.length===0)return e;let i=n.first();return As({cellId:i,cell:e.cellHandles[i],isCodeHidden:qs(e,i),codeFocus:void 0,variableName:void 0}),tT(),e},focusBottomCell:e=>{let n=e.cellIds.getColumns().at(-1);if(n===void 0||n.length===0)return e;let i=n.last();return As({cellId:i,cell:e.cellHandles[i],isCodeHidden:qs(e,i),codeFocus:void 0,variableName:void 0}),eT(),e},sendToTop:(e,n)=>{let i=e.cellIds.findWithId(n.cellId);if(i.length===0)return e;let{cellId:o,scroll:s=!0}=n,c=i.indexOfOrThrow(o);return c===0?e:{...e,cellIds:e.cellIds.moveWithinColumn(i.id,c,0),scrollKey:s?o:null}},sendToBottom:(e,n)=>{let i=e.cellIds.findWithId(n.cellId);if(i.length===0)return e;let{cellId:o,scroll:s=!0}=n,c=i.indexOfOrThrow(o),d=i.length-1;return c===d?e:{...e,cellIds:e.cellIds.moveWithinColumn(i.id,c,d),scrollKey:s?o:null}},addColumn:(e,n)=>{let i=Pa.create();return{...e,cellIds:e.cellIds.addColumn(n.columnId,[i]),cellData:{...e.cellData,[i]:Mr({id:i})},cellRuntime:{...e.cellRuntime,[i]:Pr()},cellHandles:{...e.cellHandles,[i]:(0,At.createRef)()},scrollKey:i}},addColumnBreakpoint:(e,n)=>{let{cellId:i}=n;return e.cellIds.getColumns()[0].inOrderIds[0]===i?e:{...e,cellIds:e.cellIds.insertBreakpoint(i)}},deleteColumn:(e,n)=>{let{columnId:i}=n;return{...e,cellIds:e.cellIds.delete(i)}},mergeAllColumns:e=>({...e,cellIds:e.cellIds.mergeAllColumns()}),compactColumns:e=>({...e,cellIds:e.cellIds.compact()}),deleteCell:(e,n)=>{var p,y;let i=n.cellId;if(e.cellIds.hasOnlyOneId())return e;let o=e.cellIds.findWithId(i),s=o.indexOfOrThrow(i),c=s===0?1:s-1,d=null;o.length>1&&(d=o.atOrThrow(c));let f=(y=(p=e.cellHandles[i].current)==null?void 0:p.editorView)==null?void 0:y.state.toJSON({history:G4});return f.doc=e.cellData[i].code,lT(i),{...e,cellIds:e.cellIds.deleteById(i),history:[...e.history,{name:e.cellData[i].name,serializedEditorState:f,column:o.id,index:s,isSetupCell:i===gr}],scrollKey:d}},undoDeleteCell:e=>{if(e.history.length===0)return e;let{name:n,serializedEditorState:i={doc:""},column:o,index:s,isSetupCell:c}=e.history[e.history.length-1],d=c?gr:Pa.create(),f=Mr({id:d,name:n,code:i.doc,edited:i.doc.trim().length>0,serializedEditorState:i});return{...e,cellIds:e.cellIds.insertId(d,o,s),cellData:{...e.cellData,[d]:f},cellRuntime:{...e.cellRuntime,[d]:Pr()},cellHandles:{...e.cellHandles,[d]:(0,At.createRef)()},history:e.history.slice(0,-1),scrollKey:d}},clearSerializedEditorState:(e,n)=>{let{cellId:i}=n;return zs({state:e,cellId:i,cellReducer:o=>({...o,serializedEditorState:null})})},updateCellCode:(e,n)=>{let{cellId:i,code:o,formattingChange:s}=n;return e.cellData[i]?zs({state:e,cellId:i,cellReducer:c=>s?{...c,code:o,lastCodeRun:c.edited?c.lastCodeRun:o}:{...c,code:o,edited:o.trim()!==c.lastCodeRun}}):e},updateCellName:(e,n)=>{let{cellId:i,name:o}=n;return zs({state:e,cellId:i,cellReducer:s=>({...s,name:o})})},updateCellConfig:(e,n)=>{let{cellId:i,config:o}=n;return zs({state:e,cellId:i,cellReducer:s=>({...s,config:{...s.config,...o}})})},prepareForRun:(e,n)=>zs({state:js({state:e,cellId:n.cellId,cellReducer:i=>U3(i)}),cellId:n.cellId,cellReducer:i=>({...i,edited:!1,lastCodeRun:i.code.trim()})}),handleCellMessage:(e,n)=>{let i=n.cell_id,o=js({state:e,cellId:i,cellReducer:s=>W3(s,n)});return{...o,cellLogs:[...o.cellLogs,...Z3(n)]}},setCellIds:(e,n)=>{if(GR(e.cellIds.inOrderIds,n.cellIds))return e;let i={...e.cellData},o={...e.cellRuntime},s={...e.cellHandles};for(let c of n.cellIds)c in e.cellData||(i[c]=Mr({id:c})),c in e.cellRuntime||(o[c]=Pr()),c in e.cellHandles||(s[c]=(0,At.createRef)());return{...e,cellIds:jl.fromWithPreviousShape(n.cellIds,e.cellIds),cellData:i,cellRuntime:o,cellHandles:s}},setCellCodes:(e,n)=>{In(n.codes.length===n.ids.length,"Expected codes and ids to have the same length");let i={...e},o=({cell:s,code:c,cellId:d})=>{if(!s)return Mr({id:d,code:c,lastCodeRun:n.codeIsStale?null:c,edited:n.codeIsStale&&c.trim().length>0});let f=n.codeIsStale?s.lastCodeRun:c,p=f?f.trim()!==c.trim():!!c;if(s.code.trim()===c.trim())return{...s,code:c,edited:p,lastCodeRun:f};if(!sm()){let y=i.cellHandles[d].current;y!=null&&y.editorViewOrNull&&So(y.editorViewOrNull,c)}return{...s,code:c,edited:p,lastCodeRun:f}};for(let[s,c]of _x(n.ids,n.codes))s===void 0||c===void 0||(i={...i,cellData:{...i.cellData,[s]:o({cell:i.cellData[s],code:c,cellId:s})}});return i},setStdinResponse:(e,n)=>{let{cellId:i,response:o,outputIndex:s}=n;return js({state:e,cellId:i,cellReducer:c=>{let d=[...c.consoleOutputs],f=d[s];return f.channel==="stdin"?(d[s]={channel:"stdin",mimetype:f.mimetype,data:f.data,timestamp:f.timestamp,response:o},{...c,interrupted:!1,consoleOutputs:d}):(Re.warn("Expected stdin output"),c)}})},setCells:(e,n)=>{let i=Object.fromEntries(n.map(s=>[s.id,s])),o=Object.fromEntries(n.map(s=>[s.id,Pr()]));return Tv({...e,cellIds:jl.fromIdsAndColumns(n.map(s=>[s.id,s.config.column])),cellData:i,cellRuntime:o,cellHandles:Object.fromEntries(n.map(s=>[s.id,(0,At.createRef)()]))})},moveToNextCell:(e,n)=>{let{cellId:i,before:o,noCreate:s=!1}=n;if(i==="__scratch__")return e;let c=e.cellIds.findWithId(i),d=c.indexOfOrThrow(i),f=o?d-1:d+1,p=f===c.length,y=f===-1;if(p&&!s){let w=Pa.create();return{...e,cellIds:e.cellIds.insertId(w,c.id,f),cellData:{...e.cellData,[w]:Mr({id:w})},cellRuntime:{...e.cellRuntime,[w]:Pr()},cellHandles:{...e.cellHandles,[w]:(0,At.createRef)()},scrollKey:w}}if(y&&!s){let w=Pa.create();return{...e,cellIds:e.cellIds.insertId(w,c.id,0),cellData:{...e.cellData,[w]:Mr({id:w})},cellRuntime:{...e.cellRuntime,[w]:Pr()},cellHandles:{...e.cellHandles,[w]:(0,At.createRef)()},scrollKey:w}}if((p||y)&&s)return e;if(f>=0&&f<c.length){let w=c.atOrThrow(f);As({cellId:w,cell:e.cellHandles[w],isCodeHidden:qs(e,w),codeFocus:o?"bottom":"top",variableName:void 0})}return e},markTouched:(e,n)=>{let{cellId:i}=n;if(e.untouchedNewCells.has(i)){let o=new Set(e.untouchedNewCells);return o.delete(i),{...e,untouchedNewCells:o}}return e},scrollToTarget:e=>{let n=e.scrollKey;if(n===null)return e;let i=e.cellIds.findWithId(n),o=i.indexOfOrThrow(n),s=o===i.length-1?i.last():i.atOrThrow(o);return As({cellId:s,cell:e.cellHandles[s],isCodeHidden:qs(e,s),codeFocus:void 0,variableName:void 0}),{...e,scrollKey:null}},foldAll:e=>(zx(Object.values(e.cellHandles).map(n=>{var i;return(i=n.current)==null?void 0:i.editorView})),e),unfoldAll:e=>(Fx(Object.values(e.cellHandles).map(n=>{var i;return(i=n.current)==null?void 0:i.editorView})),e),clearLogs:e=>({...e,cellLogs:[]}),collapseCell:(e,n)=>{let{cellId:i}=n,o=e.cellIds.findWithId(i),s=o.topLevelIds.map(f=>e.cellRuntime[f].outline),c=wv(o.indexOfOrThrow(i),s);if(!c)return e;let d=o.atOrThrow(c[1]);return{...e,cellIds:e.cellIds.transformWithCellId(i,f=>f.collapse(i,d)),scrollKey:i}},expandCell:(e,n)=>{let{cellId:i}=n;return{...e,cellIds:e.cellIds.transformWithCellId(i,o=>o.expand(i)),scrollKey:i}},collapseAllCells:e=>({...e,cellIds:e.cellIds.transformAll(n=>{let i=n.topLevelIds.map(p=>e.cellRuntime[p].outline),o=[...n.nodes],s=[],c=[],d=o.length-1;for(;d>=0;){let p=wv(d,i);if(p){let y=d,w=p[1],_=s.find(T=>T.start<=w&&T.end===w);_&&(w=_.start),s.push({start:y,end:w});let C=n.atOrThrow(y),E=n.atOrThrow(w);c.push({id:C,until:E})}else c.push(null);d--}let f=c.reverse();return n.collapseAll(f)})}),expandAllCells:e=>({...e,cellIds:e.cellIds.transformAll(n=>n.expandAll())}),showCellIfHidden:(e,n)=>{let{cellId:i}=n,o=e.cellIds.findWithId(i),s=o,c=o.findAndExpandDeep(i);return c.equals(s)?e:{...e,cellIds:e.cellIds.transformWithCellId(i,()=>c)}},splitCell:(e,n)=>{var w;let{cellId:i}=n,o=e.cellIds.findWithId(i),s=o.indexOfOrThrow(i),c=e.cellData[i],d=e.cellHandles[i].current;if((d==null?void 0:d.editorView)==null)return e;let{beforeCursorCode:f,afterCursorCode:p}=A3(d.editorView);So(d.editorView,f);let y=Pa.create();return{...e,cellIds:e.cellIds.insertId(y,o.id,s+1),cellData:{...e.cellData,[i]:{...c,code:f,edited:!!f&&f.trim()!==((w=c.lastCodeRun)==null?void 0:w.trim())},[y]:Mr({id:y,code:p,edited:!!p})},cellRuntime:{...e.cellRuntime,[i]:{...e.cellRuntime[i],output:null,consoleOutputs:[]},[y]:Pr()},cellHandles:{...e.cellHandles,[y]:(0,At.createRef)()},scrollKey:y}},undoSplitCell:(e,n)=>{var d;let{cellId:i,snapshot:o}=n,s=e.cellData[i],c=e.cellHandles[i].current;return(c==null?void 0:c.editorView)==null?e:(So(c.editorView,o),{...e,cellIds:e.cellIds.transformWithCellId(i,f=>{let p=f.indexOfOrThrow(i)+1;return f.deleteAtIndex(p)}),cellData:{...e.cellData,[i]:{...s,code:o,edited:!!o&&(o==null?void 0:o.trim())!==((d=s.lastCodeRun)==null?void 0:d.trim())}},cellRuntime:{...e.cellRuntime,[i]:{...e.cellRuntime[i],output:null,consoleOutputs:[]}},cellHandles:{...e.cellHandles}})},clearCellOutput:(e,n)=>{let{cellId:i}=n;return js({state:e,cellId:i,cellReducer:o=>({...o,output:null,consoleOutputs:[]})})},clearCellConsoleOutput:(e,n)=>{let{cellId:i}=n;return js({state:e,cellId:i,cellReducer:o=>({...o,consoleOutputs:o.consoleOutputs.filter(s=>s.channel==="stdin"&&s.response==null)})})},clearAllCellOutputs:e=>{let n={...e.cellRuntime};for(let i of e.cellIds.inOrderIds)n[i]={...n[i],output:null,consoleOutputs:[]};return{...e,cellRuntime:n}},addSetupCellIfDoesntExist:(e,n)=>{let{code:i}=n;return e.cellIds.setupCellExists()?{...e,scrollKey:gr}:{...e,cellIds:e.cellIds.insertId(gr,e.cellIds.atOrThrow(0).id,0),cellData:{...e.cellData,[gr]:Mr({id:gr,name:gr,code:i,edited:!!i})},cellRuntime:{...e.cellRuntime,[gr]:Pr()},cellHandles:{...e.cellHandles,[gr]:(0,At.createRef)()},scrollKey:gr}}}));function qs(e,n){return!!e.cellData[n].config.hide_code&&!e.untouchedNewCells.has(n)}function js({state:e,cellId:n,cellReducer:i}){return n in e.cellRuntime?{...e,cellRuntime:{...e.cellRuntime,[n]:i(e.cellRuntime[n])}}:(Re.warn(`Cell ${n} not found in state`),e)}function zs({state:e,cellId:n,cellReducer:i}){return n in e.cellData?{...e,cellData:{...e.cellData,[n]:i(e.cellData[n])}}:(Re.warn(`Cell ${n} not found in state`),e)}Z_=function(e){let n=e.cellData,i={column:null};return e.cellIds.getColumns().length>1?e.cellIds.getColumns().flatMap((o,s)=>o.inOrderIds.map((c,d)=>{let f={...i};return d===0&&(f.column=s),{...n[c].config,...f}})):e.cellIds.getColumns().flatMap(o=>o.inOrderIds.map(s=>({...n[s].config,...i})))},Xu=Be(e=>e(yt).cellIds),C_=Be(e=>e(Xu).hasOnlyOneId()),R_=Be(e=>_m(e(yt)).length>0),Be(e=>hm(e(yt)).length>0);let Dv;X_=Be(e=>wk(e(yt))),c_=Be(e=>vk(e(yt))),td=Be(e=>{let{cellIds:n,cellRuntime:i,cellData:o}=e(yt);return n.inOrderIds.map(s=>{var f;let c=i[s],{name:d}=o[s];if(Au((f=c.output)==null?void 0:f.mimetype)){In(Array.isArray(c.output.data),"Expected array data");let p=c.output.data.filter(y=>!y.type.includes("ancestor"));if(p.length>0)return{output:{...c.output,data:p},cellId:s,cellName:d}}return null}).filter(Boolean)}),p_=Be(e=>{let{cellIds:n,cellRuntime:i}=e(yt);return F3(n.inOrderIds.map(o=>i[o].outline))}),U_=Be(e=>e(td).length),Dv=QR(Be(e=>{let{cellIds:n,cellData:i}=e(yt);return ci.fromEntries(n.inOrderIds.map(o=>{var s;return[o,(s=i[o])==null?void 0:s.name]}))}));var oT=Be(e=>e(yt).scrollKey);$w=()=>Yn(yt),Uw=()=>Yn(Xu),Rw=()=>Yn(Dv),Lw=()=>Yn(td),N_=()=>Yn(yt).cellLogs,Ww=()=>Yn(oT),sd=()=>st.get(yt),k_=()=>{let{cellIds:e,cellData:n}=st.get(yt);return e.inOrderIds.map(i=>{var o;return(o=n[i])==null?void 0:o.name}).filter(Boolean)};var sT=Mx(Tx(yt,e=>e.cellIds.inOrderIds.map(n=>e.cellData[n])));Zw=()=>Q2(sT),ox=Be(e=>gk(e(yt))),rx=Be(e=>yk(e(yt))),Jw=Be(e=>e(yt).cellIds.colLength),q_=Be(e=>e(yt).cellIds.idLength>0),F_=Be(e=>e(yt).cellIds.getColumnIds()),id=gd(e=>Be(n=>n(yt).cellData[e]));var vf=gd(e=>Be(n=>n(yt).cellRuntime[e]));const Ov=gd(e=>Be(n=>n(yt).cellHandles[e]));function lT(e){id.remove(e),vf.remove(e),Ov.remove(e)}tx=e=>{let n=(0,yf.c)(2),i;return n[0]===e?i=n[1]:(i=id(e),n[0]=e,n[1]=i),Yn(i)},M_=e=>{let n=(0,yf.c)(2),i;return n[0]===e?i=n[1]:(i=vf(e),n[0]=e,n[1]=i),Yn(i)},Mw=e=>{let n=(0,yf.c)(2),i;return n[0]===e?i=n[1]:(i=Ov(e),n[0]=e,n[1]=i),Yn(i)},bm=()=>{let{cellIds:e,cellHandles:n}=st.get(yt);return e.inOrderIds.map(i=>{var o,s;return(s=(o=n[i])==null?void 0:o.current)==null?void 0:s.editorViewOrNull}).filter(Boolean)},Zu=e=>{var i;let{cellHandles:n}=st.get(yt);return(i=n[e].current)==null?void 0:i.editorView},g_=function(e){let{cellIds:n,cellData:i,cellRuntime:o}=e;return n.getColumns().flatMap(s=>s.topLevelIds.map(c=>({...i[c],...o[c]})))},Q_=function(e){return Be(n=>n(yt).untouchedNewCells.has(e))};function cT(e){let n=vf(e);return Be(i=>{let o=i(n);if(!o||o.status==="queued"||o.status==="running")return;let s=[],c=o.consoleOutputs;if(c&&c.length>0){let f=c.find(p=>p.mimetype==="application/vnd.marimo+traceback");if(f){let p=f.data;s.push(...Vh(p))}}let d=o.output;if((d==null?void 0:d.mimetype)==="application/vnd.marimo+error"){let f=d.data;if(Array.isArray(f))for(let p of f)p.type==="syntax"&&p.lineno!=null&&s.push({kind:"cell",cellId:e,lineNumber:p.lineno}),p.type==="import-star"&&p.lineno!=null&&s.push({kind:"cell",cellId:e,lineNumber:p.lineno})}return s.length>0?s:void 0})}Pw=function(){return Rv()}})();export{Au as $,Ew as $n,Tw as $r,qu as $t,Rw as A,bo as An,Ra as Ar,Ph as At,Dw as B,Cs as Bn,ju as Br,Ow as Bt,Pw as C,Da as Cn,zu as Cr,Mh as Ct,Mw as D,Il as Dn,Al as Dr,di as Dt,Lw as E,Nw as En,ql as Er,Fu as Et,Pr as F,Lh as Fn,Oa as Fr,Iw as Ft,Aw as G,Nh as Gn,qw as Gr,jw as Gt,zw as H,Ih as Hn,Fw as Hr,Vi as Ht,Bw as I,wo as In,jl as Ir,Ah as It,qh as J,jh as Jn,Bu as Jr,Hu as Jt,Vu as K,zh as Kn,zl as Kr,Fh as Kt,Hw as L,$u as Ln,Vw as Lr,Bh as Lt,$w as M,Hh as Mn,Vh as Mr,$h as Mt,Ww as N,Wh as Nn,Uh as Nr,Fl as Nt,Uw as O,Kh as On,Wu as Or,Uu as Ot,Mr as P,Qh as Pn,Gh as Pr,Bl as Pt,Kw as Q,_o as Qn,Pa as Qr,Qw as Qt,Jh as R,Xh as Rn,Yh as Rr,Gw as Rt,Jw as S,Xw as Sn,xo as Sr,Yw as St,Zw as T,Ku as Tn,Hl as Tr,e_ as Tt,Zh as U,em as Un,Es as Ur,Vl as Ut,tm as V,nm as Vn,Ts as Vr,t_ as Vt,rm as W,im as Wn,$n as Wr,n_ as Wt,am as X,r_ as Xn,i_ as Xr,Qu as Xt,a_ as Y,om as Yn,o_ as Yr,s_ as Yt,sm as Z,Gu as Zn,lm as Zr,l_ as Zt,c_ as _,AD as __tla,Ju as _n,cm as _r,$l as _t,Xu as a,um as ai,u_ as an,d_ as ar,f_ as at,p_ as b,h_ as bn,Yu as br,m_ as bt,g_ as c,dm as ci,y_ as cn,v_ as cr,b_ as ct,Zu as d,w_ as dn,ko as dr,fm as dt,Zn as ei,ed as en,__ as er,x_ as et,k_ as f,Wl as fn,Dt as fr,S_ as ft,C_ as g,E_ as gn,T_ as gr,pm as gt,R_ as h,Ma as hn,hm as hr,mm as ht,td as i,D_ as ii,O_ as in,P_ as ir,So as it,M_ as j,gm as jn,L_ as jr,ym as jt,N_ as k,vm as kn,Ul as kr,nd as kt,bm as l,wm as li,I_ as ln,A_ as lr,rd as lt,q_ as m,j_ as mn,_m as mr,z_ as mt,id as n,gr as ni,ad as nn,od as nr,xm as nt,F_ as o,B_ as oi,Kl as on,H_ as or,V_ as ot,sd as p,$_ as pn,La as pr,W_ as pt,km as q,Sm as qn,Ql as qr,Cm as qt,U_ as r,ld as ri,Em as rn,K_ as rr,Jr as rt,Q_ as s,G_ as si,J_ as sn,Gl as sr,Lr as st,X_ as t,Rs as ti,Tm as tn,Y_ as tr,Rm as tt,Z_ as u,cd as ui,Jl as un,$i as ur,Dm as ut,yt as v,Om as vn,ex as vr,yr as vt,tx as w,nx as wn,Pm as wr,Mm as wt,rx as x,ud as xn,ix as xr,ax as xt,ox as y,Xl as yn,Lm as yr,dd as yt,sx as z,fd as zn,lx as zr,cx as zt};
254
+ `," "),withTrailingSlash(e){return e.endsWith("/")?e:`${e}/`},withoutTrailingSlash(e){return e.endsWith("/")?e.slice(0,-1):e},withoutLeadingSlash(e){return e.startsWith("/")?e.slice(1):e},asString:e=>{if(typeof e=="string")return e;try{return JSON.stringify(e)}catch{return String(e)}}};var Cv=!1;function Z3(e){var o;let n=[],i=[e.console].filter(Boolean).flat();for(let s of i){let c=s.mimetype==="text/plain",d=s.mimetype==="text/html"||s.mimetype==="application/vnd.marimo+traceback";if(c||d){let f=s.channel==="stderr"||s.channel==="marimo-error";switch(s.channel){case"stdout":case"stderr":case"marimo-error":{let p=rm.asString(s.data),y=d?Vu(p):p;n.push({timestamp:s.timestamp||Date.now(),level:f?"stderr":"stdout",message:y,cellId:e.cell_id});break}default:break}}}if(n.forEach(Ev.log),i.length===0&&Au((o=e.output)==null?void 0:o.mimetype)&&Array.isArray(e.output.data)){e.output.data.forEach(c=>{Ev.log({level:"stderr",cellId:e.cell_id,timestamp:e.timestamp??0,message:JSON.stringify(c)})});let s=e.output.data.some(c=>c.type==="internal");!Cv&&s&&(Cv=!0,Nl({title:"An internal error occurred",description:"See console for details.",className:"text-xs text-background bg-(--red-10) py-2 pl-3 *:flex *:gap-3"}))}return n}var Ev={log:e=>{let n=e.level==="stdout"?"gray":e.level==="stderr"?"red":"orange",i=e.level.toUpperCase();console.log(`%c[${i}]`,`color:${n}; padding:2px 0; border-radius:2px; font-weight:bold`,`[${Zh(e.timestamp)}]`,`(${e.cellId}) ${e.message}`)}};Zh=function(e){try{return K3(e).toLocaleTimeString(void 0,{hour12:!0,hour:"numeric",minute:"numeric",second:"numeric"})}catch{return""}},Dw=function(e,n){let i=Zu(n);i?i.focus():Re.warn(`[CellFocusManager] focusCellEditor: element not found: ${n}`)},sx=function(e){let n=document.getElementById(Zn.create(e));n?gf(n):Re.warn(`[CellFocusManager] focusCell: element not found: ${e}`)},zw=function(e){requestAnimationFrame(()=>{requestAnimationFrame(e)})},tm=function(){return document.activeElement instanceof HTMLElement&&document.activeElement.classList.contains("marimo-cell")};function gf(e){try{e.focus()}catch{Re.warn("[CellFocusManager] element may not be focusable",e)}}Jh=function(e,n){let{retries:i,delay:o,initialDelay:s=0}=n,c=0,d=()=>{if(c<i){try{if(e())return}catch(f){Re.error(`Error executing function on attempt ${c+1}, retrying`,{error:f})}c++,setTimeout(d,o)}};s>0?setTimeout(d,s):d()};function As({cellId:e,cell:n,isCodeHidden:i,codeFocus:o,variableName:s}){var d;if(!n)return;let c=document.getElementById(Zn.create(e));if(!c){Re.warn("scrollCellIntoView: element not found");return}if(tm()){gf(c);return}if(i)gf(c);else{let f=(d=n.current)==null?void 0:d.editorView;if(!f){Re.warn("scrollCellIntoView: editor not found",e);return}if(f.hasFocus||!document.hasFocus())return;if(Jh(()=>(f.focus(),f.hasFocus),{retries:5,delay:20}),o==="top")f.dispatch({selection:{anchor:0,head:0}});else if(o==="bottom"){let p=f.state.doc.line(f.state.doc.lines);f.dispatch({selection:{anchor:p.from,head:p.from}})}else s&&Hu(f,s)}c.scrollIntoView({behavior:"smooth",block:"nearest"})}Bw=function(e){let n=document.getElementById(Zn.create(e));if(!n){Re.warn("scrollCellIntoView: element not found");return}n.classList.add("focus-outline"),setTimeout(()=>{n.classList.remove("focus-outline")},2e3),n.scrollIntoView({behavior:"smooth",block:"center"})};function eT(){let e=document.getElementById("App");e==null||e.scrollTo({top:e.scrollHeight,behavior:"smooth"})}function tT(){var e;(e=document.getElementById("App"))==null||e.scrollTo({top:0,behavior:"smooth"})}Hw=function(e){let n=Zu(e);if(n!=null&&n.hasFocus){ey(n,{behavior:"instant"});return}let i=document.getElementById(Zn.create(e));i?i.scrollIntoView({behavior:"instant",block:"nearest"}):Re.warn(`[CellFocusManager] scrollCellIntoView: element not found: ${e}`)},Mr=function({id:e,name:n="_",code:i="",lastCodeRun:o=null,lastExecutionTime:s=null,edited:c=!1,config:d,serializedEditorState:f=null}){return{id:e,config:d||{hide_code:!1,disabled:!1,column:null},name:n,code:i,edited:c,lastCodeRun:o,lastExecutionTime:s,serializedEditorState:f}};function nT(e){return{hide_code:!1,disabled:!1,column:null,...e}}Pr=function(e){return{outline:null,output:null,consoleOutputs:[],status:"idle",staleInputs:!1,interrupted:!1,errored:!1,stopped:!1,runElapsedTimeMs:null,runStartTimestamp:null,lastRunStartTimestamp:null,debuggerActive:!1,...e}};var yf=Gr();function Tv(e){let n={column:0,hide_code:!1,disabled:!1};return{...e,cellData:{[Rs]:Mr({id:Rs,config:n}),...e.cellData},cellRuntime:{[Rs]:Pr(),...e.cellRuntime},cellHandles:{[Rs]:(0,At.createRef)(),...e.cellHandles}}}function rT(){return Tv({cellIds:jl.from([]),cellData:{},cellRuntime:{},cellHandles:{},history:[],scrollKey:null,cellLogs:[],untouchedNewCells:new Set})}let iT,aT,Rv;({reducer:iT,createActions:aT,useActions:Rv,valueAtom:yt}=Ll(rT,{createNewCell:(e,n)=>{var T;let{cellId:i,before:o,code:s,lastCodeRun:c=null,lastExecutionTime:d=null,autoFocus:f=!0,skipIfCodeExists:p=!1,hideCode:y=!1}=n,w,_;if(p){for(let L of e.cellIds.inOrderIds)if(((T=e.cellData[L])==null?void 0:T.code)===s)return e}if(i==="__end__"){let L=e.cellIds.atOrThrow(0);w=L.id,_=L.length}else if(typeof i=="string"){let L=e.cellIds.findWithId(i);w=L.id,_=L.topLevelIds.indexOf(i)}else if(i.type==="__end__"){let L=e.cellIds.get(i.columnId)||e.cellIds.atOrThrow(0);w=L.id,_=L.length}else throw Error("Invalid cellId");let C=n.newCellId||Pa.create(),E=o?_:_+1;return{...e,cellIds:e.cellIds.insertId(C,w,E),cellData:{...e.cellData,[C]:Mr({id:C,code:s,lastCodeRun:c,config:nT({hide_code:y}),lastExecutionTime:d,edited:!!s&&s!==c})},cellRuntime:{...e.cellRuntime,[C]:Pr()},cellHandles:{...e.cellHandles,[C]:(0,At.createRef)()},scrollKey:f?C:null,untouchedNewCells:y?new Set([...e.untouchedNewCells,C]):e.untouchedNewCells}},moveCell:(e,n)=>{let{cellId:i,before:o,direction:s}=n;if(o!==void 0&&s!==void 0&&Re.warn("Both before and direction specified for moveCell. Ignoring one."),s){let f=e.cellIds.findWithId(i),p=e.cellIds.indexOf(f),y=s==="left"?p-1:p+1,w=e.cellIds.at(y);return w?{...e,cellIds:e.cellIds.moveAcrossColumns(f.id,i,w.id,void 0),scrollKey:i}:e}let c=e.cellIds.findWithId(i),d=c.indexOfOrThrow(i);return o&&d===0?{...e,cellIds:e.cellIds.moveWithinColumn(c.id,d,0),scrollKey:i}:!o&&d===c.length-1?{...e,cellIds:e.cellIds.moveWithinColumn(c.id,d,c.length-1),scrollKey:i}:o?{...e,cellIds:e.cellIds.moveWithinColumn(c.id,d,d-1),scrollKey:i}:{...e,cellIds:e.cellIds.moveWithinColumn(c.id,d,d+1),scrollKey:i}},dropCellOverCell:(e,n)=>{let{cellId:i,overCellId:o}=n,s=e.cellIds.findWithId(i),c=e.cellIds.findWithId(o),d=s.indexOfOrThrow(i),f=c.indexOfOrThrow(o);return s.id===c.id?d===f?e:{...e,cellIds:e.cellIds.moveWithinColumn(s.id,d,f),scrollKey:null}:{...e,cellIds:e.cellIds.moveAcrossColumns(s.id,i,c.id,o),scrollKey:null}},dropCellOverColumn:(e,n)=>{let{cellId:i,columnId:o}=n,s=e.cellIds.findWithId(i);return{...e,cellIds:e.cellIds.moveAcrossColumns(s.id,i,o,void 0)}},dropOverNewColumn:(e,n)=>{let{cellId:i}=n;return{...e,cellIds:e.cellIds.moveToNewColumn(i)}},moveColumn:(e,n)=>n.column===n.overColumn?e:{...e,cellIds:e.cellIds.moveColumn(n.column,n.overColumn)},focusCell:(e,n)=>{let i=e.cellIds.findWithId(n.cellId);if(i.length===0)return e;let{cellId:o,where:s}=n,c=i.indexOfOrThrow(o),d;d=s==="before"?xh(c-1,0,i.length-1):s==="after"?xh(c+1,0,i.length-1):c;let f=i.atOrThrow(d);return As({cellId:f,cell:e.cellHandles[f],isCodeHidden:qs(e,f),codeFocus:s==="after"?"top":"bottom",variableName:void 0}),e},focusTopCell:e=>{let n=e.cellIds.getColumns().at(0);if(n===void 0||n.length===0)return e;let i=n.first();return As({cellId:i,cell:e.cellHandles[i],isCodeHidden:qs(e,i),codeFocus:void 0,variableName:void 0}),tT(),e},focusBottomCell:e=>{let n=e.cellIds.getColumns().at(-1);if(n===void 0||n.length===0)return e;let i=n.last();return As({cellId:i,cell:e.cellHandles[i],isCodeHidden:qs(e,i),codeFocus:void 0,variableName:void 0}),eT(),e},sendToTop:(e,n)=>{let i=e.cellIds.findWithId(n.cellId);if(i.length===0)return e;let{cellId:o,scroll:s=!0}=n,c=i.indexOfOrThrow(o);return c===0?e:{...e,cellIds:e.cellIds.moveWithinColumn(i.id,c,0),scrollKey:s?o:null}},sendToBottom:(e,n)=>{let i=e.cellIds.findWithId(n.cellId);if(i.length===0)return e;let{cellId:o,scroll:s=!0}=n,c=i.indexOfOrThrow(o),d=i.length-1;return c===d?e:{...e,cellIds:e.cellIds.moveWithinColumn(i.id,c,d),scrollKey:s?o:null}},addColumn:(e,n)=>{let i=Pa.create();return{...e,cellIds:e.cellIds.addColumn(n.columnId,[i]),cellData:{...e.cellData,[i]:Mr({id:i})},cellRuntime:{...e.cellRuntime,[i]:Pr()},cellHandles:{...e.cellHandles,[i]:(0,At.createRef)()},scrollKey:i}},addColumnBreakpoint:(e,n)=>{let{cellId:i}=n;return e.cellIds.getColumns()[0].inOrderIds[0]===i?e:{...e,cellIds:e.cellIds.insertBreakpoint(i)}},deleteColumn:(e,n)=>{let{columnId:i}=n;return{...e,cellIds:e.cellIds.delete(i)}},mergeAllColumns:e=>({...e,cellIds:e.cellIds.mergeAllColumns()}),compactColumns:e=>({...e,cellIds:e.cellIds.compact()}),deleteCell:(e,n)=>{var p,y;let i=n.cellId;if(e.cellIds.hasOnlyOneId())return e;let o=e.cellIds.findWithId(i),s=o.indexOfOrThrow(i),c=s===0?1:s-1,d=null;o.length>1&&(d=o.atOrThrow(c));let f=(y=(p=e.cellHandles[i].current)==null?void 0:p.editorView)==null?void 0:y.state.toJSON({history:G4});return f.doc=e.cellData[i].code,lT(i),{...e,cellIds:e.cellIds.deleteById(i),history:[...e.history,{name:e.cellData[i].name,serializedEditorState:f,column:o.id,index:s,isSetupCell:i===gr}],scrollKey:d}},undoDeleteCell:e=>{if(e.history.length===0)return e;let{name:n,serializedEditorState:i={doc:""},column:o,index:s,isSetupCell:c}=e.history[e.history.length-1],d=c?gr:Pa.create(),f=Mr({id:d,name:n,code:i.doc,edited:i.doc.trim().length>0,serializedEditorState:i});return{...e,cellIds:e.cellIds.insertId(d,o,s),cellData:{...e.cellData,[d]:f},cellRuntime:{...e.cellRuntime,[d]:Pr()},cellHandles:{...e.cellHandles,[d]:(0,At.createRef)()},history:e.history.slice(0,-1),scrollKey:d}},clearSerializedEditorState:(e,n)=>{let{cellId:i}=n;return zs({state:e,cellId:i,cellReducer:o=>({...o,serializedEditorState:null})})},updateCellCode:(e,n)=>{let{cellId:i,code:o,formattingChange:s}=n;return e.cellData[i]?zs({state:e,cellId:i,cellReducer:c=>s?{...c,code:o,lastCodeRun:c.edited?c.lastCodeRun:o}:{...c,code:o,edited:o.trim()!==c.lastCodeRun}}):e},updateCellName:(e,n)=>{let{cellId:i,name:o}=n;return zs({state:e,cellId:i,cellReducer:s=>({...s,name:o})})},updateCellConfig:(e,n)=>{let{cellId:i,config:o}=n;return zs({state:e,cellId:i,cellReducer:s=>({...s,config:{...s.config,...o}})})},prepareForRun:(e,n)=>zs({state:js({state:e,cellId:n.cellId,cellReducer:i=>U3(i)}),cellId:n.cellId,cellReducer:i=>({...i,edited:!1,lastCodeRun:i.code.trim()})}),handleCellMessage:(e,n)=>{let i=n.cell_id,o=js({state:e,cellId:i,cellReducer:s=>W3(s,n)});return{...o,cellLogs:[...o.cellLogs,...Z3(n)]}},setCellIds:(e,n)=>{if(GR(e.cellIds.inOrderIds,n.cellIds))return e;let i={...e.cellData},o={...e.cellRuntime},s={...e.cellHandles};for(let c of n.cellIds)c in e.cellData||(i[c]=Mr({id:c})),c in e.cellRuntime||(o[c]=Pr()),c in e.cellHandles||(s[c]=(0,At.createRef)());return{...e,cellIds:jl.fromWithPreviousShape(n.cellIds,e.cellIds),cellData:i,cellRuntime:o,cellHandles:s}},setCellCodes:(e,n)=>{In(n.codes.length===n.ids.length,"Expected codes and ids to have the same length");let i={...e},o=({cell:s,code:c,cellId:d})=>{if(!s)return Mr({id:d,code:c,lastCodeRun:n.codeIsStale?null:c,edited:n.codeIsStale&&c.trim().length>0});let f=n.codeIsStale?s.lastCodeRun:c,p=f?f.trim()!==c.trim():!!c;if(s.code.trim()===c.trim())return{...s,code:c,edited:p,lastCodeRun:f};if(!sm()){let y=i.cellHandles[d].current;y!=null&&y.editorViewOrNull&&So(y.editorViewOrNull,c)}return{...s,code:c,edited:p,lastCodeRun:f}};for(let[s,c]of _x(n.ids,n.codes))s===void 0||c===void 0||(i={...i,cellData:{...i.cellData,[s]:o({cell:i.cellData[s],code:c,cellId:s})}});return i},setStdinResponse:(e,n)=>{let{cellId:i,response:o,outputIndex:s}=n;return js({state:e,cellId:i,cellReducer:c=>{let d=[...c.consoleOutputs],f=d[s];return f.channel==="stdin"?(d[s]={channel:"stdin",mimetype:f.mimetype,data:f.data,timestamp:f.timestamp,response:o},{...c,interrupted:!1,consoleOutputs:d}):(Re.warn("Expected stdin output"),c)}})},setCells:(e,n)=>{let i=Object.fromEntries(n.map(s=>[s.id,s])),o=Object.fromEntries(n.map(s=>[s.id,Pr()]));return Tv({...e,cellIds:jl.fromIdsAndColumns(n.map(s=>[s.id,s.config.column])),cellData:i,cellRuntime:o,cellHandles:Object.fromEntries(n.map(s=>[s.id,(0,At.createRef)()]))})},moveToNextCell:(e,n)=>{let{cellId:i,before:o,noCreate:s=!1}=n;if(i==="__scratch__")return e;let c=e.cellIds.findWithId(i),d=c.indexOfOrThrow(i),f=o?d-1:d+1,p=f===c.length,y=f===-1;if(p&&!s){let w=Pa.create();return{...e,cellIds:e.cellIds.insertId(w,c.id,f),cellData:{...e.cellData,[w]:Mr({id:w})},cellRuntime:{...e.cellRuntime,[w]:Pr()},cellHandles:{...e.cellHandles,[w]:(0,At.createRef)()},scrollKey:w}}if(y&&!s){let w=Pa.create();return{...e,cellIds:e.cellIds.insertId(w,c.id,0),cellData:{...e.cellData,[w]:Mr({id:w})},cellRuntime:{...e.cellRuntime,[w]:Pr()},cellHandles:{...e.cellHandles,[w]:(0,At.createRef)()},scrollKey:w}}if((p||y)&&s)return e;if(f>=0&&f<c.length){let w=c.atOrThrow(f);As({cellId:w,cell:e.cellHandles[w],isCodeHidden:qs(e,w),codeFocus:o?"bottom":"top",variableName:void 0})}return e},markTouched:(e,n)=>{let{cellId:i}=n;if(e.untouchedNewCells.has(i)){let o=new Set(e.untouchedNewCells);return o.delete(i),{...e,untouchedNewCells:o}}return e},scrollToTarget:e=>{let n=e.scrollKey;if(n===null)return e;let i=e.cellIds.findWithId(n),o=i.indexOfOrThrow(n),s=o===i.length-1?i.last():i.atOrThrow(o);return As({cellId:s,cell:e.cellHandles[s],isCodeHidden:qs(e,s),codeFocus:void 0,variableName:void 0}),{...e,scrollKey:null}},foldAll:e=>(zx(Object.values(e.cellHandles).map(n=>{var i;return(i=n.current)==null?void 0:i.editorView})),e),unfoldAll:e=>(Fx(Object.values(e.cellHandles).map(n=>{var i;return(i=n.current)==null?void 0:i.editorView})),e),clearLogs:e=>({...e,cellLogs:[]}),collapseCell:(e,n)=>{let{cellId:i}=n,o=e.cellIds.findWithId(i),s=o.topLevelIds.map(f=>e.cellRuntime[f].outline),c=wv(o.indexOfOrThrow(i),s);if(!c)return e;let d=o.atOrThrow(c[1]);return{...e,cellIds:e.cellIds.transformWithCellId(i,f=>f.collapse(i,d)),scrollKey:i}},expandCell:(e,n)=>{let{cellId:i}=n;return{...e,cellIds:e.cellIds.transformWithCellId(i,o=>o.expand(i)),scrollKey:i}},collapseAllCells:e=>({...e,cellIds:e.cellIds.transformAll(n=>{let i=n.topLevelIds.map(p=>e.cellRuntime[p].outline),o=[...n.nodes],s=[],c=[],d=o.length-1;for(;d>=0;){let p=wv(d,i);if(p){let y=d,w=p[1],_=s.find(T=>T.start<=w&&T.end===w);_&&(w=_.start),s.push({start:y,end:w});let C=n.atOrThrow(y),E=n.atOrThrow(w);c.push({id:C,until:E})}else c.push(null);d--}let f=c.reverse();return n.collapseAll(f)})}),expandAllCells:e=>({...e,cellIds:e.cellIds.transformAll(n=>n.expandAll())}),showCellIfHidden:(e,n)=>{let{cellId:i}=n,o=e.cellIds.findWithId(i),s=o,c=o.findAndExpandDeep(i);return c.equals(s)?e:{...e,cellIds:e.cellIds.transformWithCellId(i,()=>c)}},splitCell:(e,n)=>{var w;let{cellId:i}=n,o=e.cellIds.findWithId(i),s=o.indexOfOrThrow(i),c=e.cellData[i],d=e.cellHandles[i].current;if((d==null?void 0:d.editorView)==null)return e;let{beforeCursorCode:f,afterCursorCode:p}=A3(d.editorView);So(d.editorView,f);let y=Pa.create();return{...e,cellIds:e.cellIds.insertId(y,o.id,s+1),cellData:{...e.cellData,[i]:{...c,code:f,edited:!!f&&f.trim()!==((w=c.lastCodeRun)==null?void 0:w.trim())},[y]:Mr({id:y,code:p,edited:!!p})},cellRuntime:{...e.cellRuntime,[i]:{...e.cellRuntime[i],output:null,consoleOutputs:[]},[y]:Pr()},cellHandles:{...e.cellHandles,[y]:(0,At.createRef)()},scrollKey:y}},undoSplitCell:(e,n)=>{var d;let{cellId:i,snapshot:o}=n,s=e.cellData[i],c=e.cellHandles[i].current;return(c==null?void 0:c.editorView)==null?e:(So(c.editorView,o),{...e,cellIds:e.cellIds.transformWithCellId(i,f=>{let p=f.indexOfOrThrow(i)+1;return f.deleteAtIndex(p)}),cellData:{...e.cellData,[i]:{...s,code:o,edited:!!o&&(o==null?void 0:o.trim())!==((d=s.lastCodeRun)==null?void 0:d.trim())}},cellRuntime:{...e.cellRuntime,[i]:{...e.cellRuntime[i],output:null,consoleOutputs:[]}},cellHandles:{...e.cellHandles}})},clearCellOutput:(e,n)=>{let{cellId:i}=n;return js({state:e,cellId:i,cellReducer:o=>({...o,output:null,consoleOutputs:[]})})},clearCellConsoleOutput:(e,n)=>{let{cellId:i}=n;return js({state:e,cellId:i,cellReducer:o=>({...o,consoleOutputs:o.consoleOutputs.filter(s=>s.channel==="stdin"&&s.response==null)})})},clearAllCellOutputs:e=>{let n={...e.cellRuntime};for(let i of e.cellIds.inOrderIds)n[i]={...n[i],output:null,consoleOutputs:[]};return{...e,cellRuntime:n}},addSetupCellIfDoesntExist:(e,n)=>{let{code:i}=n;return e.cellIds.setupCellExists()?{...e,scrollKey:gr}:{...e,cellIds:e.cellIds.insertId(gr,e.cellIds.atOrThrow(0).id,0),cellData:{...e.cellData,[gr]:Mr({id:gr,name:gr,code:i,edited:!!i})},cellRuntime:{...e.cellRuntime,[gr]:Pr()},cellHandles:{...e.cellHandles,[gr]:(0,At.createRef)()},scrollKey:gr}}}));function qs(e,n){return!!e.cellData[n].config.hide_code&&!e.untouchedNewCells.has(n)}function js({state:e,cellId:n,cellReducer:i}){return n in e.cellRuntime?{...e,cellRuntime:{...e.cellRuntime,[n]:i(e.cellRuntime[n])}}:(Re.warn(`Cell ${n} not found in state`),e)}function zs({state:e,cellId:n,cellReducer:i}){return n in e.cellData?{...e,cellData:{...e.cellData,[n]:i(e.cellData[n])}}:(Re.warn(`Cell ${n} not found in state`),e)}Z_=function(e){let n=e.cellData,i={column:null};return e.cellIds.getColumns().length>1?e.cellIds.getColumns().flatMap((o,s)=>o.inOrderIds.map((c,d)=>{let f={...i};return d===0&&(f.column=s),{...n[c].config,...f}})):e.cellIds.getColumns().flatMap(o=>o.inOrderIds.map(s=>({...n[s].config,...i})))},Xu=Be(e=>e(yt).cellIds),C_=Be(e=>e(Xu).hasOnlyOneId()),R_=Be(e=>_m(e(yt)).length>0),Be(e=>hm(e(yt)).length>0);let Dv;X_=Be(e=>wk(e(yt))),c_=Be(e=>vk(e(yt))),td=Be(e=>{let{cellIds:n,cellRuntime:i,cellData:o}=e(yt);return n.inOrderIds.map(s=>{var f;let c=i[s],{name:d}=o[s];if(Au((f=c.output)==null?void 0:f.mimetype)){In(Array.isArray(c.output.data),"Expected array data");let p=c.output.data.filter(y=>!y.type.includes("ancestor"));if(p.length>0)return{output:{...c.output,data:p},cellId:s,cellName:d}}return null}).filter(Boolean)}),p_=Be(e=>{let{cellIds:n,cellRuntime:i}=e(yt);return F3(n.inOrderIds.map(o=>i[o].outline))}),U_=Be(e=>e(td).length),Dv=QR(Be(e=>{let{cellIds:n,cellData:i}=e(yt);return ci.fromEntries(n.inOrderIds.map(o=>{var s;return[o,(s=i[o])==null?void 0:s.name]}))}));var oT=Be(e=>e(yt).scrollKey);$w=()=>Yn(yt),Uw=()=>Yn(Xu),Rw=()=>Yn(Dv),Lw=()=>Yn(td),N_=()=>Yn(yt).cellLogs,Ww=()=>Yn(oT),sd=()=>st.get(yt),k_=()=>{let{cellIds:e,cellData:n}=st.get(yt);return e.inOrderIds.map(i=>{var o;return(o=n[i])==null?void 0:o.name}).filter(Boolean)};var sT=Mx(Tx(yt,e=>e.cellIds.inOrderIds.map(n=>e.cellData[n])));Zw=()=>Q2(sT),ox=Be(e=>gk(e(yt))),rx=Be(e=>yk(e(yt))),Jw=Be(e=>e(yt).cellIds.colLength),q_=Be(e=>e(yt).cellIds.idLength>0),F_=Be(e=>e(yt).cellIds.getColumnIds()),id=gd(e=>Be(n=>n(yt).cellData[e]));var vf=gd(e=>Be(n=>n(yt).cellRuntime[e]));const Ov=gd(e=>Be(n=>n(yt).cellHandles[e]));function lT(e){id.remove(e),vf.remove(e),Ov.remove(e)}tx=e=>{let n=(0,yf.c)(2),i;return n[0]===e?i=n[1]:(i=id(e),n[0]=e,n[1]=i),Yn(i)},M_=e=>{let n=(0,yf.c)(2),i;return n[0]===e?i=n[1]:(i=vf(e),n[0]=e,n[1]=i),Yn(i)},Mw=e=>{let n=(0,yf.c)(2),i;return n[0]===e?i=n[1]:(i=Ov(e),n[0]=e,n[1]=i),Yn(i)},bm=()=>{let{cellIds:e,cellHandles:n}=st.get(yt);return e.inOrderIds.map(i=>{var o,s;return(s=(o=n[i])==null?void 0:o.current)==null?void 0:s.editorViewOrNull}).filter(Boolean)},Zu=e=>{var i;let{cellHandles:n}=st.get(yt);return(i=n[e].current)==null?void 0:i.editorView},g_=function(e){let{cellIds:n,cellData:i,cellRuntime:o}=e;return n.getColumns().flatMap(s=>s.topLevelIds.map(c=>({...i[c],...o[c]})))},Q_=function(e){return Be(n=>n(yt).untouchedNewCells.has(e))};function cT(e){let n=vf(e);return Be(i=>{let o=i(n);if(!o||o.status==="queued"||o.status==="running")return;let s=[],c=o.consoleOutputs;if(c&&c.length>0){let f=c.find(p=>p.mimetype==="application/vnd.marimo+traceback");if(f){let p=f.data;s.push(...Vh(p))}}let d=o.output;if((d==null?void 0:d.mimetype)==="application/vnd.marimo+error"){let f=d.data;if(Array.isArray(f))for(let p of f)p.type==="syntax"&&p.lineno!=null&&s.push({kind:"cell",cellId:e,lineNumber:p.lineno}),p.type==="import-star"&&p.lineno!=null&&s.push({kind:"cell",cellId:e,lineNumber:p.lineno})}return s.length>0?s:void 0})}Pw=function(){return Rv()}})();export{Au as $,Ew as $n,Tw as $r,qu as $t,Rw as A,bo as An,Ra as Ar,Ph as At,Dw as B,Cs as Bn,ju as Br,Ow as Bt,Pw as C,Da as Cn,zu as Cr,Mh as Ct,Mw as D,Il as Dn,Al as Dr,di as Dt,Lw as E,Nw as En,ql as Er,Fu as Et,Pr as F,Lh as Fn,Oa as Fr,Iw as Ft,Aw as G,Nh as Gn,qw as Gr,jw as Gt,zw as H,Ih as Hn,Fw as Hr,Vi as Ht,Bw as I,wo as In,jl as Ir,Ah as It,qh as J,jh as Jn,Bu as Jr,Hu as Jt,Vu as K,zh as Kn,zl as Kr,Fh as Kt,Hw as L,$u as Ln,Vw as Lr,Bh as Lt,$w as M,Hh as Mn,Vh as Mr,$h as Mt,Ww as N,Wh as Nn,Uh as Nr,Fl as Nt,Uw as O,Kh as On,Wu as Or,Uu as Ot,Mr as P,Qh as Pn,Gh as Pr,Bl as Pt,Kw as Q,_o as Qn,Pa as Qr,Qw as Qt,Jh as R,Xh as Rn,Yh as Rr,Gw as Rt,Jw as S,Xw as Sn,xo as Sr,Yw as St,Zw as T,Ku as Tn,Hl as Tr,e_ as Tt,Zh as U,em as Un,Es as Ur,Vl as Ut,tm as V,nm as Vn,Ts as Vr,t_ as Vt,rm as W,im as Wn,$n as Wr,n_ as Wt,am as X,r_ as Xn,i_ as Xr,Qu as Xt,a_ as Y,om as Yn,o_ as Yr,s_ as Yt,sm as Z,Gu as Zn,lm as Zr,l_ as Zt,c_ as _,AD as __tla,Ju as _n,cm as _r,$l as _t,Xu as a,um as ai,u_ as an,d_ as ar,f_ as at,p_ as b,h_ as bn,Yu as br,m_ as bt,g_ as c,dm as ci,y_ as cn,v_ as cr,b_ as ct,Zu as d,w_ as dn,ko as dr,fm as dt,Zn as ei,ed as en,__ as er,x_ as et,k_ as f,Wl as fn,Dt as fr,S_ as ft,C_ as g,E_ as gn,T_ as gr,pm as gt,R_ as h,Ma as hn,hm as hr,mm as ht,td as i,D_ as ii,O_ as in,P_ as ir,So as it,M_ as j,gm as jn,L_ as jr,ym as jt,N_ as k,vm as kn,Ul as kr,nd as kt,bm as l,wm as li,I_ as ln,A_ as lr,rd as lt,q_ as m,j_ as mn,_m as mr,z_ as mt,id as n,gr as ni,ad as nn,od as nr,xm as nt,F_ as o,B_ as oi,Kl as on,H_ as or,V_ as ot,sd as p,$_ as pn,La as pr,W_ as pt,km as q,Sm as qn,Ql as qr,Cm as qt,U_ as r,ld as ri,Em as rn,K_ as rr,Jr as rt,Q_ as s,G_ as si,J_ as sn,Gl as sr,Lr as st,X_ as t,Rs as ti,Tm as tn,Y_ as tr,Rm as tt,Z_ as u,cd as ui,Jl as un,$i as ur,Dm as ut,yt as v,Om as vn,ex as vr,yr as vt,tx as w,nx as wn,Pm as wr,Mm as wt,rx as x,ud as xn,ix as xr,ax as xt,ox as y,Xl as yn,Lm as yr,dd as yt,sx as z,fd as zn,lx as zr,cx as zt};
@@ -1 +1 @@
1
- import{s as f}from"./chunk-LvLJmgfZ.js";import{t as y}from"./react-BGmjiNul.js";import{Rn as g}from"./cells-DU3EySUd.js";import{t as j}from"./compiler-runtime-DeeZ7FnK.js";import{t as N}from"./jsx-runtime-DN_bIXfG.js";import{t as k}from"./cn-C1rgT0yh.js";import{t as x}from"./createLucideIcon-CW2xpJ57.js";import{h as w}from"./select-D0g5GnIs.js";import{t as u}from"./file-BnFXtaZZ.js";import{n as M}from"./play-BJDBXApx.js";var b=x("bot-message-square",[["path",{d:"M12 6V2H8",key:"1155em"}],["path",{d:"M15 11v2",key:"i11awn"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"M20 16a2 2 0 0 1-2 2H8.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 4 20.286V8a2 2 0 0 1 2-2h12a2 2 0 0 1 2 2z",key:"11gyqh"}],["path",{d:"M9 11v2",key:"1ueba0"}]]),v=x("paperclip",[["path",{d:"m16 6-8.414 8.586a2 2 0 0 0 2.829 2.829l8.414-8.586a4 4 0 1 0-5.657-5.657l-8.379 8.551a6 6 0 1 0 8.485 8.485l8.379-8.551",key:"1miecu"}]]),d=j(),_=f(y(),1),o=f(N(),1);const q=i=>{var c;let e=(0,d.c)(6),{attachment:t}=i;if((c=t.mediaType)!=null&&c.startsWith("image/")){let a=t.filename||"Attachment",m;return e[0]!==t.url||e[1]!==a?(m=(0,o.jsx)("img",{src:t.url,alt:a,className:"max-h-[100px] max-w-[100px] object-contain mb-1.5"}),e[0]=t.url,e[1]=a,e[2]=m):m=e[2],m}let s;e[3]===Symbol.for("react.memo_cache_sentinel")?(s=(0,o.jsx)(u,{className:"h-3 w-3 mt-0.5"}),e[3]=s):s=e[3];let l=t.filename||"Attachment",r;return e[4]===l?r=e[5]:(r=(0,o.jsxs)("div",{className:"flex flex-row gap-1 items-center text-xs",children:[s,l]}),e[4]=l,e[5]=r),r},A=i=>{let e=(0,d.c)(12),{file:t,className:s,onRemove:l}=i,[r,c]=(0,_.useState)(!1),a;e[0]===s?a=e[1]:(a=k("py-1 px-1.5 bg-muted rounded-md cursor-pointer flex flex-row gap-1 items-center text-xs",s),e[0]=s,e[1]=a);let m,p;e[2]===Symbol.for("react.memo_cache_sentinel")?(m=()=>c(!0),p=()=>c(!1),e[2]=m,e[3]=p):(m=e[2],p=e[3]);let n;e[4]!==t||e[5]!==r||e[6]!==l?(n=r?(0,o.jsx)(w,{className:"h-3 w-3 mt-0.5",onClick:l}):S(t),e[4]=t,e[5]=r,e[6]=l,e[7]=n):n=e[7];let h;return e[8]!==t.name||e[9]!==a||e[10]!==n?(h=(0,o.jsxs)("div",{className:a,onMouseEnter:m,onMouseLeave:p,children:[n,t.name]}),e[8]=t.name,e[9]=a,e[10]=n,e[11]=h):h=e[11],h};function S(i){let e="h-3 w-3 mt-0.5";return i.type.startsWith("image/")?(0,o.jsx)(M,{className:e}):i.type.startsWith("text/")?(0,o.jsx)(g,{className:e}):(0,o.jsx)(u,{className:e})}export{b as i,A as n,v as r,q as t};
1
+ import{s as f}from"./chunk-LvLJmgfZ.js";import{t as y}from"./react-BGmjiNul.js";import{Rn as g}from"./cells-CibeVr5R.js";import{t as j}from"./compiler-runtime-DeeZ7FnK.js";import{t as N}from"./jsx-runtime-DN_bIXfG.js";import{t as k}from"./cn-C1rgT0yh.js";import{t as x}from"./createLucideIcon-CW2xpJ57.js";import{h as w}from"./select-D0g5GnIs.js";import{t as u}from"./file-BnFXtaZZ.js";import{n as M}from"./play-BJDBXApx.js";var b=x("bot-message-square",[["path",{d:"M12 6V2H8",key:"1155em"}],["path",{d:"M15 11v2",key:"i11awn"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"M20 16a2 2 0 0 1-2 2H8.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 4 20.286V8a2 2 0 0 1 2-2h12a2 2 0 0 1 2 2z",key:"11gyqh"}],["path",{d:"M9 11v2",key:"1ueba0"}]]),v=x("paperclip",[["path",{d:"m16 6-8.414 8.586a2 2 0 0 0 2.829 2.829l8.414-8.586a4 4 0 1 0-5.657-5.657l-8.379 8.551a6 6 0 1 0 8.485 8.485l8.379-8.551",key:"1miecu"}]]),d=j(),_=f(y(),1),o=f(N(),1);const q=i=>{var c;let e=(0,d.c)(6),{attachment:t}=i;if((c=t.mediaType)!=null&&c.startsWith("image/")){let a=t.filename||"Attachment",m;return e[0]!==t.url||e[1]!==a?(m=(0,o.jsx)("img",{src:t.url,alt:a,className:"max-h-[100px] max-w-[100px] object-contain mb-1.5"}),e[0]=t.url,e[1]=a,e[2]=m):m=e[2],m}let s;e[3]===Symbol.for("react.memo_cache_sentinel")?(s=(0,o.jsx)(u,{className:"h-3 w-3 mt-0.5"}),e[3]=s):s=e[3];let l=t.filename||"Attachment",r;return e[4]===l?r=e[5]:(r=(0,o.jsxs)("div",{className:"flex flex-row gap-1 items-center text-xs",children:[s,l]}),e[4]=l,e[5]=r),r},A=i=>{let e=(0,d.c)(12),{file:t,className:s,onRemove:l}=i,[r,c]=(0,_.useState)(!1),a;e[0]===s?a=e[1]:(a=k("py-1 px-1.5 bg-muted rounded-md cursor-pointer flex flex-row gap-1 items-center text-xs",s),e[0]=s,e[1]=a);let m,p;e[2]===Symbol.for("react.memo_cache_sentinel")?(m=()=>c(!0),p=()=>c(!1),e[2]=m,e[3]=p):(m=e[2],p=e[3]);let n;e[4]!==t||e[5]!==r||e[6]!==l?(n=r?(0,o.jsx)(w,{className:"h-3 w-3 mt-0.5",onClick:l}):S(t),e[4]=t,e[5]=r,e[6]=l,e[7]=n):n=e[7];let h;return e[8]!==t.name||e[9]!==a||e[10]!==n?(h=(0,o.jsxs)("div",{className:a,onMouseEnter:m,onMouseLeave:p,children:[n,t.name]}),e[8]=t.name,e[9]=a,e[10]=n,e[11]=h):h=e[11],h};function S(i){let e="h-3 w-3 mt-0.5";return i.type.startsWith("image/")?(0,o.jsx)(M,{className:e}):i.type.startsWith("text/")?(0,o.jsx)(g,{className:e}):(0,o.jsx)(u,{className:e})}export{b as i,A as n,v as r,q as t};