@marimo-team/frontend 0.19.5-dev2 → 0.19.5-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.
- package/dist/assets/{CellStatus-BXh1gynf.js → CellStatus-CkHNEnSR.js} +1 -1
- package/dist/assets/{ConnectedDataExplorerComponent-BKJwCHu7.js → ConnectedDataExplorerComponent-D9wGP6tv.js} +1 -1
- package/dist/assets/{JsonOutput-CLNTeasj.js → JsonOutput-DMMGGSXv.js} +1 -1
- package/dist/assets/{MarimoErrorOutput-Czq-EaOv.js → MarimoErrorOutput-DuFSglTT.js} +1 -1
- package/dist/assets/{RenderHTML-IHLDwtNi.js → RenderHTML-wR1-1y1P.js} +1 -1
- package/dist/assets/{add-cell-with-ai-i5LNDjJf.js → add-cell-with-ai-CbaApRYx.js} +1 -1
- package/dist/assets/{add-database-form-DiiD1Vbr.js → add-database-form-DHXYzyiI.js} +1 -1
- package/dist/assets/{agent-panel-CURqRcNk.js → agent-panel-3PTqPJTj.js} +1 -1
- package/dist/assets/{ai-model-dropdown-B4PTfGxC.js → ai-model-dropdown-ChmbKArd.js} +1 -1
- package/dist/assets/{app-config-button-CwTpgJrH.js → app-config-button-D6XweFDT.js} +1 -1
- package/dist/assets/{cell-editor-7OTv5JEt.js → cell-editor-6dMXQ0RL.js} +2 -2
- package/dist/assets/{cell-link-PmjS89xh.js → cell-link-DVWmB29p.js} +1 -1
- package/dist/assets/{cells-CqQgFV4b.js → cells-dG69fEtz.js} +2 -2
- package/dist/assets/{chat-components-BqIcG4qc.js → chat-components-WF7xAOzH.js} +1 -1
- package/dist/assets/{chat-display-DwogmR6s.js → chat-display-CSZE5mc2.js} +1 -1
- package/dist/assets/{chat-panel-CdPM1nVX.js → chat-panel-C3O3gAi9.js} +1 -1
- package/dist/assets/{client-DACzP75m.js → client-pvw6NZnl.js} +3 -3
- package/dist/assets/{column-preview-Dpc2R1kk.js → column-preview-BI3bmg8t.js} +1 -1
- package/dist/assets/{command-CrXI4rKp.js → command-C4F8xArq.js} +1 -1
- package/dist/assets/{command-palette-DlpYob2_.js → command-palette-DXCid2fN.js} +1 -1
- package/dist/assets/{common-UAJeFXMa.js → common-BWquCRv0.js} +1 -1
- package/dist/assets/{config-D6nhy4FA.js → config-CENq_7Pd.js} +1 -1
- package/dist/assets/{datasource-DuzaeKzi.js → datasource-wJp5J7GL.js} +1 -1
- package/dist/assets/{dependency-graph-panel-D6739nh_.js → dependency-graph-panel-C5ASDepz.js} +1 -1
- package/dist/assets/{documentation-panel-Buzk5Fu4.js → documentation-panel-DjP7xcas.js} +1 -1
- package/dist/assets/{download-7BValYrD.js → download-B5nrQ7oh.js} +1 -1
- package/dist/assets/{edit-page-BWYYclv8.js → edit-page-D8qZ-cED.js} +6 -6
- package/dist/assets/{error-panel-B20u-a2k.js → error-panel-C3ZWSKyy.js} +1 -1
- package/dist/assets/{es-DZXbHzby.js → es-CXayDCrt.js} +1 -1
- package/dist/assets/file-explorer-panel-DEAwmqNS.js +1 -0
- package/dist/assets/{floating-outline-D1jZFEZq.js → floating-outline-DmMqfgvM.js} +1 -1
- package/dist/assets/{focus-iNK7gxqn.js → focus-De0fAFlq.js} +1 -1
- package/dist/assets/{form-BRyVMnbz.js → form-CA9PbMgX.js} +1 -1
- package/dist/assets/{glide-data-editor-CRb9AiCG.js → glide-data-editor-Cp7ovNOX.js} +1 -1
- package/dist/assets/{globals-DSc2kOiG.js → globals-G25bi28X.js} +1 -1
- package/dist/assets/{home-page-DLOc5LxS.js → home-page-CpVwL4qV.js} +1 -1
- package/dist/assets/{index-DDc_1b-N.css → index-BI9O54ok.css} +1 -1
- package/dist/assets/{index-C4W61Wkp.js → index-CLIGiIEq.js} +7 -7
- package/dist/assets/{kiosk-mode-gpZZHb2k.js → kiosk-mode-BzPmO2rQ.js} +1 -1
- package/dist/assets/{layout-cqf4jVVJ.js → layout-CcJbEqnj.js} +1 -1
- package/dist/assets/links-nCUz50vX.js +1 -0
- package/dist/assets/{logs-panel-C61Ke6Vh.js → logs-panel-D81EnMXO.js} +1 -1
- package/dist/assets/{markdown-renderer-zLvh4wvy.js → markdown-renderer-CRVtPH5D.js} +1 -1
- package/dist/assets/{mermaid--ZwxKP7u.js → mermaid-PR_LvTgS.js} +1 -1
- package/dist/assets/{mode-D8wBTHYr.js → mode-ChYHAM7i.js} +1 -1
- package/dist/assets/{name-cell-input-Z3jP-uGb.js → name-cell-input-CpZt0vsF.js} +1 -1
- package/dist/assets/{outline-panel-yzZ-47YC.js → outline-panel-C9vRV5y9.js} +1 -1
- package/dist/assets/{packages-panel-CLSDsvMc.js → packages-panel-BQt2iLJb.js} +1 -1
- package/dist/assets/{panels-B_82vyOa.js → panels-D2M0X4Da.js} +1 -1
- package/dist/assets/{process-output-BoMxmckb.js → process-output-Nbtlvi7C.js} +1 -1
- package/dist/assets/{readonly-python-code-BsfcjvYh.js → readonly-python-code-Crr_9chk.js} +1 -1
- package/dist/assets/renderShortcut-DQ1H8wv8.js +1 -0
- package/dist/assets/{run-page-CDNWv23n.js → run-page-Zmcxhaf1.js} +1 -1
- package/dist/assets/{scratchpad-panel--7282IFi.js → scratchpad-panel-B7hgkWTO.js} +1 -1
- package/dist/assets/{session-panel-TIK7tELJ.js → session-panel-CCw-hpml.js} +1 -1
- package/dist/assets/{snippets-panel-DN67yVtB.js → snippets-panel-CftBFK7b.js} +1 -1
- package/dist/assets/{state-DxSsbZ2U.js → state-B_RAyPJZ.js} +1 -1
- package/dist/assets/{state-QEMH_vzx.js → state-dz5q1XdV.js} +1 -1
- package/dist/assets/{switch-DXFFGBN1.js → switch-CH7JBQ6U.js} +1 -1
- package/dist/assets/{terminal-BhbNfCNw.js → terminal-DWEf_1Us.js} +1 -1
- package/dist/assets/{textarea-CLcDrTce.js → textarea-C1B1m2rU.js} +1 -1
- package/dist/assets/{tracing--sgFXj_b.js → tracing-CAY6F2mI.js} +1 -1
- package/dist/assets/{tracing-panel-Vgs_QVja.js → tracing-panel-Dl60o0Ok.js} +2 -2
- package/dist/assets/{types-CaZe7wKe.js → types-D_eS2JEf.js} +1 -1
- package/dist/assets/{useAddCell-Ck7_02t2.js → useAddCell-BSOKbqcD.js} +1 -1
- package/dist/assets/{useBoolean-B_S7yTZz.js → useBoolean-CULqj1dx.js} +1 -1
- package/dist/assets/{useCellActionButton-BQ25CkMM.js → useCellActionButton-fUOTJQY2.js} +1 -1
- package/dist/assets/{useDeleteCell-D6tJT52g.js → useDeleteCell-CNPKeGD6.js} +1 -1
- package/dist/assets/{useDependencyPanelTab-DFsNyv7m.js → useDependencyPanelTab-Coe6wSmK.js} +1 -1
- package/dist/assets/{useNotebookActions-CgaHkAAt.js → useNotebookActions-UzFwrgYv.js} +1 -1
- package/dist/assets/{useRunCells-1OSi36uT.js → useRunCells-B7y_sG8R.js} +1 -1
- package/dist/assets/{useSplitCell-BZjrUoCW.js → useSplitCell-D5TLJkuE.js} +1 -1
- package/dist/assets/{useTheme-CNj0G_ol.js → useTheme-BSVRc0kJ.js} +1 -1
- package/dist/assets/{utilities.esm-Bc0J_PzK.js → utilities.esm-CRKmwR4M.js} +1 -1
- package/dist/assets/utils-Czt8B2GX.js +1 -0
- package/dist/assets/{vega-component-C1voDf5W.js → vega-component-CZVqD10k.js} +1 -1
- package/dist/index.html +37 -37
- package/package.json +1 -1
- package/src/components/app-config/user-config-form.tsx +1 -1
- package/src/components/editor/controls/Controls.tsx +1 -8
- package/src/components/editor/file-tree/file-explorer.tsx +4 -2
- package/src/components/editor/file-tree/file-viewer.tsx +9 -6
- package/src/core/config/config-schema.ts +5 -1
- package/src/core/config/config.ts +4 -0
- package/src/core/lsp/__tests__/transport.test.ts +149 -0
- package/src/core/lsp/transport.ts +48 -0
- package/src/css/app/Cell.css +0 -2
- package/src/plugins/layout/TexPlugin.tsx +7 -5
- package/dist/assets/file-explorer-panel-DDFHsvy9.js +0 -1
- package/dist/assets/links-D529u6GQ.js +0 -1
- package/dist/assets/renderShortcut-eU5Hsfml.js +0 -1
- package/dist/assets/utils-pfqq9IdB.js +0 -1
|
@@ -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{Jn as G0}from"./cells-CqQgFV4b.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-pfqq9IdB.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-D9lTzMzP.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-CQd4MZr5.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{Jn as G0}from"./cells-dG69fEtz.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{S as _0,c as X0,n as $0}from"./utils-Czt8B2GX.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-D9lTzMzP.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-CQd4MZr5.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($0),k=j0(X0),{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{vt as D}from"./cells-CqQgFV4b.js";import{t as E}from"./compiler-runtime-DeeZ7FnK.js";import{C as Q,S as $,_ as ee}from"./utils-pfqq9IdB.js";import{j as te}from"./config-D6nhy4FA.js";import{t as se}from"./jsx-runtime-DN_bIXfG.js";import{t as le}from"./button-B8cGZzP5.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-D9lTzMzP.js";import{c as ne,f as re,l as ie,r as ce,s as de,t as he}from"./state-QEMH_vzx.js";import{r as I}from"./input-B80Yt1uu.js";import{t as Y}from"./settings-MTlHVxz3.js";import{a as L,c as M,d as A,g as me,i as xe,l as F,o as P,p as pe,u as S}from"./textarea-CLcDrTce.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-jcHA5geR.js";import{c as je,l as ve,n as ge,t as V}from"./dialog-CF5DtF1E.js";import{t as be}from"./VisuallyHidden-B9t3FhTP.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-DVhvP4lH.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 Le=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(Me,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 Me(){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)(M,{control:l.control,name:"width",render:He}),(0,s.jsx)(M,{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)(M,{control:l.control,name:"css_file",render:Ie}),(0,s.jsx)(M,{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)(M,{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)(L,{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)(M,{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)(L,{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)(L,{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)(L,{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)(L,{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)(L,{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{Le 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{vt as D}from"./cells-dG69fEtz.js";import{t as E}from"./compiler-runtime-DeeZ7FnK.js";import{C as $,v as ee,w as Q}from"./utils-Czt8B2GX.js";import{j as te}from"./config-CENq_7Pd.js";import{t as se}from"./jsx-runtime-DN_bIXfG.js";import{t as le}from"./button-B8cGZzP5.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-D9lTzMzP.js";import{c as ne,f as re,l as ie,r as ce,s as de,t as he}from"./state-dz5q1XdV.js";import{r as I}from"./input-B80Yt1uu.js";import{t as Y}from"./settings-MTlHVxz3.js";import{a as L,c as M,d as A,g as me,i as xe,l as F,o as P,p as pe,u as S}from"./textarea-C1B1m2rU.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-jcHA5geR.js";import{c as je,l as ve,n as ge,t as V}from"./dialog-CF5DtF1E.js";import{t as be}from"./VisuallyHidden-B9t3FhTP.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-DVhvP4lH.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 Le=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(Me,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 Me(){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)(M,{control:l.control,name:"width",render:He}),(0,s.jsx)(M,{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)(M,{control:l.control,name:"css_file",render:Ie}),(0,s.jsx)(M,{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)(M,{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)(L,{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)(M,{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)(L,{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)(L,{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)(L,{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)(L,{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)(L,{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{Le 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 dd=Object.defineProperty;var La=oe=>{throw TypeError(oe)};var fd=(oe,q,ge)=>q in oe?dd(oe,q,{enumerable:!0,configurable:!0,writable:!0,value:ge}):oe[q]=ge;var p=(oe,q,ge)=>fd(oe,typeof q!="symbol"?q+"":q,ge),md=(oe,q,ge)=>q.has(oe)||La("Cannot "+ge);var Oa=(oe,q,ge)=>(md(oe,q,"read from private field"),ge?ge.call(oe):q.get(oe)),Da=(oe,q,ge)=>q.has(oe)?La("Cannot add the same private member more than once"):q instanceof WeakSet?q.add(oe):q.set(oe,ge);import{s as _a}from"./chunk-LvLJmgfZ.js";import{d as Ua,f as wr,i as Q,l as jt,n as ue,p as yt,s as Nn,u as re}from"./useEvent-DlWF5OMa.js";import{t as hd}from"./react-BGmjiNul.js";import{$ as pd,$t as gd,At as Ba,B as ja,Dr as Pa,Er as bd,Et as vr,Ft as Qe,Ht as yd,It as wd,Kr as vd,Mt as Ed,N as Nd,Nt as kd,Ot as Er,Q as Nr,Qt as Cd,R as Ma,Sr as Sd,Tt as xd,U as Ra,V as Ga,Vn as Ad,Wr as Ja,Xt as Td,_n as Id,a as Wa,ct as kn,d as Va,dn as Fd,dt as Pt,ei as Ld,en as Od,gn as Dd,kr as _d,kt as $a,lt as Ud,m as kr,o as Bd,ot as jd,pr as Pd,qt as Md,rn as Cr,st as Sr,ti as Cn,u as Ha,ut as Rd,vn as Gd,vt as Jd,w as Sn,xn as Wd,xr as Vd,y as nt,yr as xr,yt as qa,z as $d,zt as xn,__tla as Hd}from"./cells-
|
|
2
|
+
var dd=Object.defineProperty;var La=oe=>{throw TypeError(oe)};var fd=(oe,q,ge)=>q in oe?dd(oe,q,{enumerable:!0,configurable:!0,writable:!0,value:ge}):oe[q]=ge;var p=(oe,q,ge)=>fd(oe,typeof q!="symbol"?q+"":q,ge),md=(oe,q,ge)=>q.has(oe)||La("Cannot "+ge);var Oa=(oe,q,ge)=>(md(oe,q,"read from private field"),ge?ge.call(oe):q.get(oe)),Da=(oe,q,ge)=>q.has(oe)?La("Cannot add the same private member more than once"):q instanceof WeakSet?q.add(oe):q.set(oe,ge);import{s as _a}from"./chunk-LvLJmgfZ.js";import{d as Ua,f as wr,i as Q,l as jt,n as ue,p as yt,s as Nn,u as re}from"./useEvent-DlWF5OMa.js";import{t as hd}from"./react-BGmjiNul.js";import{$ as pd,$t as gd,At as Ba,B as ja,Dr as Pa,Er as bd,Et as vr,Ft as Qe,Ht as yd,It as wd,Kr as vd,Mt as Ed,N as Nd,Nt as kd,Ot as Er,Q as Nr,Qt as Cd,R as Ma,Sr as Sd,Tt as xd,U as Ra,V as Ga,Vn as Ad,Wr as Ja,Xt as Td,_n as Id,a as Wa,ct as kn,d as Va,dn as Fd,dt as Pt,ei as Ld,en as Od,gn as Dd,kr as _d,kt as $a,lt as Ud,m as kr,o as Bd,ot as jd,pr as Pd,qt as Md,rn as Cr,st as Sr,ti as Cn,u as Ha,ut as Rd,vn as Gd,vt as Jd,w as Sn,xn as Wd,xr as Vd,y as nt,yr as xr,yt as qa,z as $d,zt as xn,__tla as Hd}from"./cells-dG69fEtz.js";import{P as za,R as qd,k as zd,w as Kd}from"./zod-Cg4WLWh2.js";import{t as Re}from"./compiler-runtime-DeeZ7FnK.js";import{n as Xd,r as Yd,s as Qd,t as Zd,u as ef}from"./client-pvw6NZnl.js";import{a as Ka,d as Ge,f as tf,l as Ar,n as Xa}from"./hotkeys-uKX61F1_.js";import{t as Mt}from"./invariant-C6yE60hi.js";import{S as Tr,h as Ya,i as nf,m as rf,o as of,p as Qa,s as Za}from"./utils-Czt8B2GX.js";import{A as wt,O as ei,b as af,j as sf,o as lf,r as ti,s as cf,w as lt}from"./config-CENq_7Pd.js";import{a as uf,n as ni,t as df}from"./switch-CH7JBQ6U.js";import{n as ff}from"./globals-G25bi28X.js";import{t as mf}from"./ErrorBoundary-C7JBxSzd.js";import{t as hf}from"./useEventListener-COkmyg1v.js";import{t as pf}from"./jsx-runtime-DN_bIXfG.js";import{r as Ir,t as He}from"./button-B8cGZzP5.js";import{t as ct}from"./cn-C1rgT0yh.js";import{$t as An,Bt as Fr,Ct as ri,Dt as gf,E as bf,Gt as yf,H as oi,I as wf,It as Tn,J as l,Jt as qe,P as vf,Pt as In,Rt as Ef,St as We,Ut as ut,V as ai,Vt as Rt,Xt as Gt,_ as Nf,a as kf,at as B,bt as Cf,ct as ze,ft as Sf,it as xf,jt as Af,lt as Fn,m as Tf,pt as If,qt as he,rt as H,st as Ff,vt as Lf,w as Of,wt as Df,yt as _f,zt as vt}from"./dist-CAcX026F.js";import{C as Uf,D as Bf,_ as jf,a as Pf,c as Mf,n as Lr,r as Rf,v as Gf,x as Jf,y as Wf}from"./dist-CI6_zMIl.js";import{E as Vf,__tla as $f}from"./JsonOutput-DMMGGSXv.js";import{c as ii,n as Hf}from"./once-CTiSlR1m.js";import{t as Or}from"./createReducer-DDa-hVe3.js";import{a as qf,c as zf,f as Ln,h as Kf,i as Xf,l as Jt,n as si,o as Yf,t as Qf}from"./dist-DKNOF5xd.js";import{r as Wt,t as Zf}from"./requests-C0HaHO6a.js";import{t as em}from"./createLucideIcon-CW2xpJ57.js";import{f as tm,r as li,t as nm,__tla as rm}from"./layout-CcJbEqnj.js";import{O as om,S as ci,T as am,_ as im,a as ui,k as sm,n as lm,o as cm,r as di,s as um,x as dm}from"./add-cell-with-ai-CbaApRYx.js";import{t as fm}from"./ai-model-dropdown-ChmbKArd.js";import{h as mm}from"./select-D9lTzMzP.js";import{t as hm}from"./download-B5nrQ7oh.js";import{t as pm}from"./circle-check-Cr0N4h9T.js";import{r as gm,t as bm}from"./types-D_eS2JEf.js";import{n as fi}from"./spinner-C1czjtp7.js";import{t as mi}from"./save-BOTLFf-P.js";import{I as hi,P as ym}from"./input-B80Yt1uu.js";import{a as wm,i as vm,n as pi}from"./state-B_RAyPJZ.js";import{t as Em}from"./preload-helper-BW0IMuFq.js";import{t as Et}from"./use-toast-Bzf3rpev.js";import{r as Nm}from"./useTheme-BSVRc0kJ.js";import{t as Nt}from"./tooltip-CvjcEpZC.js";import{r as km,t as Cm}from"./mode-ChYHAM7i.js";import{c as gi,i as bi,n as yi,r as Sm}from"./dialog-CF5DtF1E.js";import{k as xm}from"./usePress-DTwIUo40.js";import{a as Am,r as Tm,t as Im}from"./popover-DtnzNVk-.js";import{n as wi}from"./ImperativeModal-DVhvP4lH.js";import{a as Fm}from"./error-banner-DvT0IGDZ.js";import{t as Lm}from"./copy-DRhpWiOq.js";import{a as Om}from"./useRunCells-B7y_sG8R.js";import{t as X}from"./extends-B9D0JO9U.js";import{t as Vt}from"./objectWithoutPropertiesLoose-CboCOq4o.js";import{t as Dm}from"./kbd-Czc5z_04.js";import{a as Dr}from"./useInstallPackage-RldLPyJs.js";import{a as _m,o as Um}from"./cell-link-DVWmB29p.js";import{n as Bm}from"./useAsyncData-BJJJOr9W.js";import{a as jm,o as vi,r as Pm,s as Ei,t as Mm}from"./command-C4F8xArq.js";import{r as Rm,t as Gm}from"./es-CXayDCrt.js";import{a as Jm}from"./focus-De0fAFlq.js";import{a as Ni}from"./renderShortcut-DQ1H8wv8.js";import{t as _r}from"./label-CNZLffHW.js";import{n as Ur,t as ki}from"./useDeleteCell-CNPKeGD6.js";import{n as kt}from"./esm-B3JckBtM.js";import{n as Wm,t as Vm}from"./icons-D4lB4En9.js";import{t as Ci}from"./dist-Ciq1Lh9M.js";import{t as $m}from"./useSplitCell-D5TLJkuE.js";import{t as Si}from"./Inputs-DmoeP8nh.js";import{co as Hm,do as Br,fo as qm,ft as zm,go as Ct,ho as xi,lo as jr,mo as Ai,oo as Ti,po as Km,so as Ii,uo as Fi,__tla as Xm}from"./loro_wasm_bg-CghhyG7y.js";import{t as Ym}from"./ws-itdlXHqs.js";import{t as Pr}from"./useInterval-BGPIviJp.js";let Li,Mr,Oi,dt,Di,On,Rr,$t,Dn,be,_i,Ui,Bi,ji,_n,Pi,Gr,Un,Qm=Promise.all([(()=>{try{return Hd}catch{}})(),(()=>{try{return $f}catch{}})(),(()=>{try{return rm}catch{}})(),(()=>{try{return Xm}catch{}})()]).then(async()=>{var En,Fa,we,ve,Ee,Ne,ke,Ce,Se,xe,Ae,Te,Ie,Fe,Le,Oe,De,_e,Ue,Be,je;var oe=em("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 xt=Rt.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=he.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}}),At=he.define(),Tt=he.define(),Wr=qe.define({create(){return{shouldFocus:!1,inputValue:""}},update(e,t){let n=e;for(let r of t.effects)r.is(At)&&(n={...n,inputValue:r.value}),r.is(Tt)&&(n={...n,shouldFocus:r.value});return n}}),Ht=he.define(),It=qe.define({create(){return null},update(e,t){for(let n of t.effects)if(n.is(Ht))return n.value;return e}}),ft=he.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 Mi=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<Mi)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}),Tt.of(!0),At.of("")],selection:vt.cursor(o.from)}),!0},Hr=e=>e.state.field(It)?(e.dispatch({effects:[Ht.of(null),rt.of({show:!1,lineFrom:0,lineTo:0}),Tt.of(!1),At.of(""),ft.of(!1)]}),!0):!1,qr=e=>{let t=e.state.field(It);return t?(e.dispatch({changes:{from:t.from,to:t.to,insert:t.oldCode},effects:[Ht.of(null),rt.of({show:!1,lineFrom:0,lineTo:0}),Tt.of(!1),At.of(""),ft.of(!1)]}),!0):!1};var Bn={mac:"\u2318",windows:"\u229E Win",default:"Ctrl"};function Ri(){return navigator.platform.startsWith("Mac")?Bn.mac:navigator.platform.startsWith("Win")?Bn.windows:Bn.default}function jn(e){return e.replace("Mod",Ri()).replace("-"," ").toUpperCase()}function de(e,t){let n=document.createElement(e);return n.className=t,n}function Gi(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 qt=qe.define({create(){return{suggestion:null}},update(e,t){let n=t.effects.find(r=>r.is(zt));return!t.docChanged&&!n&&!t.selection?e:n&&t.state.doc===n.value.doc?{suggestion:n.value.text}:{suggestion:null}}}),zt=he.define();function Ji(e,t){let n=e.state.selection.main.head,r=[],o=H.widget({widget:new Wi(t),side:1});return r.push(o.range(n)),H.set(r)}var Wi=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}},Vi=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()})}},$i=(e,t)=>ze.fromClass(class{constructor(){p(this,"abortController",null);p(this,"cache");this.cache=new Vi(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:zt.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:zt.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()}}),Hi=ze.fromClass(class{constructor(){p(this,"decorations");this.decorations=H.none}update(e){var n;let t=(n=e.state.field(qt))==null?void 0:n.suggestion;if(!t){this.decorations=H.none;return}this.decorations=Ji(e.view,t)}},{decorations:e=>e.decorations});function qi(e,t,n,r){return{...e.changeByRange(o=>{if(o===e.selection.main)return{changes:{from:n,to:r,insert:t},range:vt.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:vt.cursor(o.from-a+t.length)}}),userEvent:"input.complete"}}var zi=e=>{var r,o,a;let t=(r=e.state.field(qt))==null?void 0:r.suggestion;if(!t)return!1;let n=e.state.facet(Pn);return e.dispatch({...qi(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(qt))==null?void 0:r.suggestion;if(!t)return!1;let n=e.state.facet(Pn);return e.dispatch({effects:zt.of({text:null,doc:e.state.doc})}),(a=(o=n.events)==null?void 0:o.onSuggestionRejected)==null||a.call(o,e,t),!0},Ki=We.of([{key:"Tab",run:zi},{key:"Escape",run:zr}]),Pn=Rt.define({combine:e=>e.at(-1)});function Kr(e){let{delay:t=500,includeKeymap:n=!0}=e,r=Gi(e.fetchFn,t);return[qt,Pn.of(e),$i(r,e),Hi,n?Ki:[]]}const Xi=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 Yi(e){var o,a;let t=e.state.facet(xt),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=Rt.define({combine(e){return An(e,{render:Yi,hideOnBlur:!1})}}),Qi=ze.fromClass((Fa=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)});Da(this,En,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:Oa(this,En)})}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()}},En=new WeakMap,Fa));var Zi=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 es(){return[Qi,Zi]}var ts=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(xt),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}},ns=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(xt);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}),Ht.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:Tt.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:At.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 rs(e){if(!e.prompt)throw Error("prompt function is required");let t={...q,...e.keymaps};return[xt.of(e),ot,Wr,It,Vr,es(),Xi,We.of([{key:t.showInput,run:$r}]),ut.highest([We.of([{key:t.acceptEdit,run:Hr},{key:t.rejectEdit,run:qr}])]),os,as,is,ss]}const os=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})]})}),as=B.decorations.of(e=>{let t=e.state.field(It);return t?H.set([H.mark({class:"cm-new-code-line"}).range(t.from,t.to)]):H.none}),is=B.decorations.compute([ot],e=>{let t=e.field(ot),n=e.facet(xt),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 ns(n.prompt),side:-1}).range(s))}}return H.set(r)}),ss=qe.define({create(e){return H.none},update(e,t){let n=t.state.field(It);return n?H.set([H.widget({widget:new ts(n.oldCode),block:!0}).range(n.from)]):H.none},provide:e=>B.decorations.from(e)});var ls=Re(),F=_a(hd(),1),Rn=()=>({entries:new Map}),{valueAtom:Xr,useActions:Yr}=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}=Yr(),{entries:r}=re(Xr),o=ki(),a=Ur();return(0,F.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])},Li=function(e){let t=(0,ls.c)(16),n=re(Xr),r=Yr(),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(cs)}),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 cs(e){return e.cellId}async function us(e){var s,c;let t=`
|
|
4
4
|
${e.codeBefore}
|
|
5
5
|
<rewrite_this>
|
|
@@ -20,4 +20,4 @@ ${r.text}`:r.text,i={absoluteStartPos:n+o,absoluteEndPos:n+o+a.length,from:o,to:
|
|
|
20
20
|
|
|
21
21
|
`),i=new Qu().add(hr,o).add("text/plain",a).build();await navigator.clipboard.write([i]),wa(r.length)}catch(o){Ge.error("Failed to copy cells to clipboard",o);try{await Lm(r.map(a=>a.code).join(`
|
|
22
22
|
|
|
23
|
-
`)),wa(r.length)}catch{Ku()}}}),pasteAtCell:ue(async(t,n)=>{let{before:r=!1}=n??{};try{let o=await navigator.clipboard.read();for(let i of o)if(i.types.includes(hr)){let s=await(await i.getType(hr)).text();try{let c=qu.parse(JSON.parse(s));if(c.cells.length===0)break;let u=t,d=c.cells.reverse();for(let f of d)e.createNewCell({cellId:u,before:r,code:f.code,autoFocus:!0});return}catch(c){Ge.warn("Failed to parse clipboard cell data",c)}}let a=await navigator.clipboard.readText();a.trim()?e.createNewCell({cellId:t,before:r,code:a,autoFocus:!0}):Xu()}catch(o){Ge.error("Failed to paste from clipboard",o),Yu()}})}}var wa=e=>{let t=e===1?"Cell":`${e} cells`;Et({title:`${t} copied`,description:`${t} ${e===1?"has":"have"} been copied to clipboard.`})},Ku=()=>{Et({title:"Copy failed",description:"Failed to copy cells to clipboard.",variant:"danger"})},Xu=()=>{Et({title:"Nothing to paste",description:"No cell or text found in clipboard.",variant:"danger"})},Yu=()=>{Et({title:"Paste failed",description:"Failed to read from clipboard",variant:"danger"})},Qu=class{constructor(){p(this,"items",{})}add(e,t){return ClipboardItem.supports(e)?typeof t=="string"?(this.items[e]=new Blob([t],{type:e}),this):(this.items[e]=new Blob([JSON.stringify(t)],{type:e}),this):(Ge.warn(`ClipboardItem does not support ${e}`),this)}build(){return new ClipboardItem(this.items)}},Zu=Re();function va(){return{selectionStart:null,selectionEnd:null,selected:new Set}}var{reducer:Zm,createActions:eh,valueAtom:pr,useActions:ed}=Or(va,{select:(e,t)=>({selectionStart:t.cellId,selectionEnd:t.cellId,selected:new Set([t.cellId])}),extend:(e,t)=>{if(!e.selectionStart)return{selectionStart:t.cellId,selectionEnd:t.cellId,selected:new Set([t.cellId])};let{cellId:n,allCellIds:r}=t;try{let o=r.findWithId(e.selectionStart),a=o.indexOfOrThrow(e.selectionStart),i=o.indexOfOrThrow(n),[s,c]=a<i?[a,i]:[i,a],u=o.slice(s,c+1);return{selectionStart:e.selectionStart,selectionEnd:n,selected:new Set(u)}}catch{return{selectionStart:n,selectionEnd:n,selected:new Set([n])}}},clear:e=>e.selected.size===0?e:va()});Ui=()=>re(pr);function td(e){let t=(0,Zu.c)(2),n;return t[0]===e?n=t[1]:(n=yt(r=>r(pr).selected.has(e)),t[0]=e,t[1]=n),re(n)}Mr=function(){return ed()};function nd(e){return e.get(pr).selected}let Ea,Na,ka;Ea=Re(),{valueAtom:Na,useActions:$t}=Or(()=>new Set,{add:(e,t)=>{if(e.has(t))return e;let n=new Set(e);return n.add(t),n},remove:(e,t)=>{if(!e.has(t))return e;let n=new Set(e);return n.delete(t),Ra(()=>{let r=document.activeElement;if(!r)return;let o=Cn.findElementThroughShadowDOMs(r);o&&Ma(Cn.parse(o.id))}),n}}),ka=e=>yt(t=>t(Na).has(e)),ji=function(e){let t=(0,Ea.c)(2),n;return t[0]===e?n=t[1]:(n=ka(e),t[0]=e,t[1]=n),re(n)};var Bt=new WeakMap,rd=500;function od(e){if(e.ctrlKey||e.metaKey||e.altKey)return"";let t=e.key.toLowerCase();return e.shiftKey?`shift+${t}`:t}function ad(e,t){let n=od(e),r=e.target;if(!n||!r)return!1;let o=Bt.get(r),a=n;o!=null&&o.timeout&&clearTimeout(o.timeout),o&&(a=`${o.sequence} ${n}`);let i=t[a];if(i)return Bt.delete(r),i();if(!o){let s=t[n];if(s)return s()}if(Object.keys(t).some(s=>s.startsWith(`${a} `))){let s=window.setTimeout(()=>{Bt.delete(r)},rd);return Bt.set(r,{sequence:a,timeout:s}),!0}return Bt.delete(r),!1}var gr=Re();function Ca(e){return{handle:t=>e(t),bulkHandle:t=>{let n=!0;try{for(let r of t)n&&(n=e(r));return n}catch{return!1}}}}function Ye(e){return{handle:t=>e([t]),bulkHandle:t=>e(t)}}function id(e,t){let n=(0,gr.c)(12),r=Jm(),o=Sn(),a=$t(),i;n[0]!==e||n[1]!==r?(i=()=>{r.focusCell({cellId:e})},n[0]=e,n[1]=r,n[2]=i):i=n[2];let s;n[3]!==o||n[4]!==e||n[5]!==t||n[6]!==r||n[7]!==a?(s=()=>{a.remove(e),o.markTouched({cellId:e}),r.blurCell(),t.current&&br(t.current)},n[3]=o,n[4]=e,n[5]=t,n[6]=r,n[7]=a,n[8]=s):s=n[8];let c;n[9]!==i||n[10]!==s?(c={onFocusWithin:i,onBlurWithin:s},n[9]=i,n[10]=s,n[11]=c):c=n[11];let{focusWithinProps:u}=ym(c);return u}_i=function(e,t){let n=(0,gr.c)(30),{canMoveX:r,editorView:o,cellActionDropdownRef:a}=t,{saveOrNameNotebook:i}=dr(),{saveCellConfig:s}=Wt(),c=Ua(pi),u=Sn(),d=wr(),f=$t(),h=Om(),m=re(Qa),{copyCells:g,pasteAtCell:y}=zu(),w=Mr(),k=td(e),C=Un(),T=Ur(),I=re(Tr),_;n[0]!==C||n[1]!==w?(_={clear:()=>{C.clear(),w.clear()},extend:U=>{C.clear(),w.extend(U)},select:U=>{C.clear(),w.select(U)}},n[0]=C,n[1]=w,n[2]=_):_=n[2];let A=_,x=re(Ya),G;n[3]===x?G=n[4]:(G=(U,P)=>Ar(x.getHotkey(U).key)(P.nativeEvent||P),n[3]=x,n[4]=G);let ee=G,$=id(e,o),L;n[5]!==u||n[6]!==r||n[7]!==a||n[8]!==e||n[9]!==g||n[10]!==T||n[11]!==o||n[12]!==k||n[13]!==ee||n[14]!==m||n[15]!==y||n[16]!==C||n[17]!==h||n[18]!==s||n[19]!==i||n[20]!==A||n[21]!==c||n[22]!==d||n[23]!==f||n[24]!==I?(L={onKeyDown:U=>{if(Ir.fromInput(U)){U.continuePropagation();return}let P={"Mod+ArrowUp":()=>(u.focusTopCell(),A.clear(),!0),"Mod+ArrowDown":()=>(u.focusBottomCell(),A.clear(),!0),ArrowUp:()=>(u.focusCell({cellId:e,where:"before"}),A.clear(),!0),ArrowDown:()=>(u.focusCell({cellId:e,where:"after"}),A.clear(),!0),ArrowLeft:()=>{if(r){let E=d.get(nt),S=E.cellIds.findWithId(e),R=E.cellIds.indexOf(S),D=E.cellIds.at(R-1);if(D&&D.length>0){let te=Sa(e,D);return u.focusCell({cellId:te,where:"exact"}),A.clear(),!0}}return!1},ArrowRight:()=>{if(r){let E=d.get(nt),S=E.cellIds.findWithId(e),R=E.cellIds.indexOf(S),D=E.cellIds.at(R+1);if(D&&D.length>0){let te=Sa(e,D);return u.focusCell({cellId:te,where:"exact"}),A.clear(),!0}}return!1},"Shift+ArrowUp":()=>{let E=d.get(Wa);A.extend({cellId:e,allCellIds:E});let S=E.findWithId(e).before(e);return S&&A.extend({cellId:S,allCellIds:E}),u.focusCell({cellId:e,where:"before"}),!0},"Shift+ArrowDown":()=>{let E=d.get(Wa);A.extend({cellId:e,allCellIds:E});let S=E.findWithId(e).after(e);return S&&A.extend({cellId:S,allCellIds:E}),u.focusCell({cellId:e,where:"after"}),!0},Escape:()=>k?(A.clear(),!0):!1,Enter:()=>(f.add(e),Ga(d,e),A.clear(),!0),s:()=>(i(),!0)};for(let[E,S]of Object.entries(P))if(Ar(E)(U)&&S()){U.preventDefault();return}let me={"cell.run":Ye(E=>(h(E),!0)),"cell.runAndNewBelow":Ye(E=>{h(E);let S=E[E.length-1];return u.moveToNextCell({cellId:S,before:!1}),!0}),"cell.runAndNewAbove":Ye(E=>{h(E);let S=E[0];return u.moveToNextCell({cellId:S,before:!0}),!0}),"cell.createAbove":E=>(u.createNewCell({cellId:E,before:!0}),!0),"cell.createBelow":E=>(u.createNewCell({cellId:E,before:!1}),!0),"cell.moveUp":Ye(E=>{let S=E[0];return d.get(nt).cellIds.findWithId(S).first()===S?!1:(E.forEach(R=>{u.moveCell({cellId:R,before:!0})}),!0)}),"cell.moveDown":Ye(E=>{let S=E[E.length-1];return d.get(nt).cellIds.findWithId(S).last()===S?!1:([...E].reverse().forEach(R=>{u.moveCell({cellId:R,before:!1})}),!0)}),"cell.moveLeft":Ca(E=>r?(u.moveCell({cellId:E,direction:"left"}),!0):!1),"cell.moveRight":Ca(E=>r?(u.moveCell({cellId:E,direction:"right"}),!0):!1),"cell.hideCode":Ye(E=>{var R;let S=!E.map(D=>{var te;return((te=d.get(nt).cellData[D])==null?void 0:te.config)||null}).every(sd);s({configs:Object.fromEntries(E.map(D=>[D,{hide_code:S}]))});for(let D of E)u.updateCellConfig({cellId:D,config:{hide_code:S}});if(E.length===1){let D=E[0];u.focusCell({cellId:D,where:"after"}),S?((R=o.current)==null||R.contentDOM.blur(),ja(D)):Ga(d,D)}return!0}),"cell.focusDown":E=>(u.focusCell({cellId:E,where:"after"}),!0),"cell.focusUp":E=>(u.focusCell({cellId:E,where:"before"}),!0),"cell.sendToBottom":Ye(E=>(E.forEach(S=>{u.sendToBottom({cellId:S})}),!0)),"cell.sendToTop":Ye(E=>([...E].reverse().forEach(S=>{u.sendToTop({cellId:S})}),!0)),"cell.aiCompletion":E=>{var R;let S=!1;return c(D=>(D==null?void 0:D.cellId)===E?(S=!0,null):{cellId:E}),S&&((R=o.current)==null||R.focus()),!0},"cell.cellActions":()=>{var E;return(E=a.current)==null||E.toggle(),!0},"command.copyCell":Ye(E=>(g(E),!0)),"command.pasteCell":E=>(y(E),!0),"command.createCellBefore":E=>Ir.hasModifier(U)?!1:(u.createNewCell({cellId:E,before:!0,autoFocus:!0}),!0),"command.createCellAfter":E=>Ir.hasModifier(U)?!1:(u.createNewCell({cellId:E,before:!1,autoFocus:!0}),!0),"cell.delete":()=>{if(!I.keymap.destructive_delete)return!1;let E=K.size>=2?[...K]:[e],S=d.get(nt);return E.some(R=>{let{status:D}=S.cellRuntime[R];return D==="running"||D==="queued"})?!1:C.idle?(C.submit(E),!0):(T({cellIds:E}),C.clear(),!0)}},K=nd(d);if(m==="vim"&&ad(U.nativeEvent||U,{j:P.ArrowDown,k:P.ArrowUp,h:P.ArrowLeft,l:P.ArrowRight,i:P.Enter,"shift+j":P["Shift+ArrowDown"],"shift+k":P["Shift+ArrowUp"],"g g":P["Mod+ArrowUp"],"shift+g":P["Mod+ArrowDown"],"d d":()=>me["cell.delete"](),"y y":()=>(g(K.size>=2?[...K]:[e]),!0),p:()=>(y(e,{before:!1}),!0),"shift+p":()=>(y(e,{before:!0}),!0),o:()=>(u.createNewCell({cellId:e,before:!1,autoFocus:!0}),!0),"shift+o":()=>(u.createNewCell({cellId:e,before:!0,autoFocus:!0}),!0),u:()=>(u.undoDeleteCell(),!0)})){U.preventDefault();return}for(let[E,S]of Object.entries(me))if(ee(E,U)){if(S instanceof Function){if(S(e)){U.preventDefault();return}}else if(K.size>=2?S.bulkHandle([...K]):S.handle(e)){U.preventDefault();return}return}U.continuePropagation()}},n[5]=u,n[6]=r,n[7]=a,n[8]=e,n[9]=g,n[10]=T,n[11]=o,n[12]=k,n[13]=ee,n[14]=m,n[15]=y,n[16]=C,n[17]=h,n[18]=s,n[19]=i,n[20]=A,n[21]=c,n[22]=d,n[23]=f,n[24]=I,n[25]=L):L=n[25];let{keyboardProps:j}=hi(L),se;return n[26]!==$||n[27]!==k||n[28]!==j?(se=xm($,j,{"data-selected":k,className:"data-[selected=true]:ring-1 data-[selected=true]:ring-(--blue-8) data-[selected=true]:ring-offset-1"}),n[26]=$,n[27]=k,n[28]=j,n[29]=se):se=n[29],se};function sd(e){return e==null?void 0:e.hide_code}function ld(e,t){let n=(0,gr.c)(12),r=$t(),o=re(Qa),a=re(Ya),i;n[0]===a?i=n[1]:(i=Ar(a.getHotkey("command.vimEnterCommandMode").key),n[0]=a,n[1]=i);let s=i,c;n[2]!==e||n[3]!==r?(c=()=>{r.remove(e),ja(e),Ra(()=>{Ma(e)})},n[2]=e,n[3]=r,n[4]=c):c=n[4];let u=c,d;n[5]!==t||n[6]!==u?(d=()=>{if(!t.current){u();return}let g=t.current,y=g.state;if(Bf(g))return;let w=y.field(Pa,!1),k=Jt(y)!==null;w&&br(g),k&&Yf(g),!(w||k)&&u()},n[5]=t,n[6]=u,n[7]=d):d=n[7];let f=d,h;n[8]!==f||n[9]!==o||n[10]!==s?(h={onKeyDown:g=>{o==="vim"?s(g)&&f():g.key==="Escape"&&f(),g.continuePropagation()}},n[8]=f,n[9]=o,n[10]=s,n[11]=h):h=n[11];let{keyboardProps:m}=hi(h);return m}function Sa(e,t){let n=document.getElementById(Cn.create(e));if(!n)return t.first();let r=n.getBoundingClientRect();for(let o of t.topLevelIds){let a=document.getElementById(Cn.create(o));if(a){let i=a.getBoundingClientRect();if(r.top<=i.bottom&&r.bottom>=i.top)return o}}return t.last()}function br(e){e.state.field(Pa,!1)&&e.dispatch({effects:bd.of(null)})}var xa=Re();const cd=e=>{let t=(0,xa.c)(24),{editorView:n,code:r,currentLanguageAdapter:o,onAfterToggle:a}=e,i;t[0]===r?i=t[1]:(i=qa.markdown.isSupported(r)||r.trim()==="",t[0]=r,t[1]=i);let s=i,c;t[2]===r?c=t[3]:(c=qa.sql.isSupported(r)||r.trim()==="",t[2]=r,t[3]=c);let u=c&&o==="python",d;t[4]===Symbol.for("react.memo_cache_sentinel")?(d=(0,b.jsx)(Ad,{color:"var(--sky-11)",strokeWidth:2.5,className:"w-4 h-4"}),t[4]=d):d=t[4];let f;t[5]!==o||t[6]!==n||t[7]!==a||t[8]!==u?(f=(0,b.jsx)(yr,{editorView:n,currentLanguageAdapter:o,canSwitchToLanguage:u,icon:d,toType:"sql",displayName:"SQL",onAfterToggle:a}),t[5]=o,t[6]=n,t[7]=a,t[8]=u,t[9]=f):f=t[9];let h=s&&o==="python",m;t[10]===Symbol.for("react.memo_cache_sentinel")?(m=(0,b.jsx)(Vm,{fill:"var(--sky-11)",color:"black",className:"w-4 h-4"}),t[10]=m):m=t[10];let g;t[11]!==o||t[12]!==n||t[13]!==a||t[14]!==h?(g=(0,b.jsx)(yr,{editorView:n,currentLanguageAdapter:o,canSwitchToLanguage:h,icon:m,toType:"markdown",displayName:"Markdown",onAfterToggle:a}),t[11]=o,t[12]=n,t[13]=a,t[14]=h,t[15]=g):g=t[15];let y;t[16]===Symbol.for("react.memo_cache_sentinel")?(y=(0,b.jsx)(Wm,{fill:"var(--sky-11)",color:"black",className:"w-4 h-4"}),t[16]=y):y=t[16];let w;t[17]!==o||t[18]!==n?(w=(0,b.jsx)(yr,{editorView:n,currentLanguageAdapter:o,canSwitchToLanguage:!0,icon:y,toType:"python",displayName:"Python",onAfterToggle:tf.NOOP}),t[17]=o,t[18]=n,t[19]=w):w=t[19];let k;return t[20]!==w||t[21]!==f||t[22]!==g?(k=(0,b.jsxs)("div",{className:"absolute right-3 top-2 z-20 flex hover-action gap-1",children:[f,g,w]}),t[20]=w,t[21]=f,t[22]=g,t[23]=k):k=t[23],k},yr=e=>{let t=(0,xa.c)(10),{editorView:n,currentLanguageAdapter:r,canSwitchToLanguage:o,icon:a,toType:i,displayName:s,onAfterToggle:c}=e,u;t[0]!==n||t[1]!==c||t[2]!==i?(u=()=>{n&&(Pt(n,{language:i}),c())},t[0]=n,t[1]=c,t[2]=i,t[3]=u):u=t[3];let d=u;if(!o||r===i)return null;let f=`View as ${s}`,h;t[4]!==d||t[5]!==a?(h=(0,b.jsx)(He,{"data-testid":"language-toggle-button",variant:"text",size:"xs",className:"opacity-80 px-1",onClick:d,children:a}),t[4]=d,t[5]=a,t[6]=h):h=t[6];let m;return t[7]!==f||t[8]!==h?(m=(0,b.jsx)(Nt,{content:f,children:h}),t[7]=f,t[8]=h,t[9]=m):m=t[9],m};var Aa=Re(),Ta=({theme:e,showPlaceholder:t,id:n,config:r,code:o,status:a,serializedEditorState:i,setEditorView:s,runCell:c,userConfig:u,editorViewRef:d,editorViewParentRef:f,hidden:h,hasOutput:m,showHiddenCode:g,languageAdapter:y,setLanguageAdapter:w,showLanguageToggles:k=!0,outputArea:C})=>{var Me;let[T,I]=jt(pi),_=ki(),{saveOrNameNotebook:A}=dr(),x=Un(),{saveCellConfig:G}=Wt(),ee=a==="running"||a==="queued",$=Sn(),L=$m(),j=y==="markdown",se=ue(()=>ee?!1:x.idle&&u.keymap.destructive_delete?(x.submit([n]),!0):(_({cellId:n}),!0)),U=ue(()=>ee?!1:(c(),d.current&&br(d.current),!0)),P=ue(()=>{let O=!r.hide_code;return G({configs:{[n]:{hide_code:O}}}),$.updateCellConfig({cellId:n,config:{hide_code:O}}),O}),me=re(rf),K=ue(()=>{Rm({autoInstantiate:me,createNewCell:$.createNewCell})}),E=of(u),S=(0,F.useMemo)(()=>{var W;let O=Gc({cellId:n,showPlaceholder:t,enableAI:E,cellActions:{...$,afterToggleMarkdown:K,onRun:U,deleteCell:se,saveNotebook:A,createManyBelow:V=>{for(let le of[...V].reverse())$.createNewCell({code:le,before:!1,cellId:n,skipIfCodeExists:!0})},splitCell:L,toggleHideCode:P,aiCellCompletion:()=>{let V=!1;return I(le=>(le==null?void 0:le.cellId)===n?(V=!0,null):{cellId:n}),V}},completionConfig:u.completion,keymapConfig:u.keymap,lspConfig:u.language_servers,theme:e,hotkeys:new Xa(u.keymap.overrides??{}),diagnosticsConfig:u.diagnostics,displayConfig:u.display,inlineAiTooltip:((W=u.ai)==null?void 0:W.inline_tooltip)??!1});return O.push(ze.define(V=>(w(V.state.field(kn).type),{update(le){w(le.state.field(kn).type)}})),B.updateListener.of(V=>{V.selectionSet&&V.state.selection.ranges.some(le=>le.from!==le.to)&&g({focus:!1})}),B.domEventHandlers({focus:()=>{g({focus:!1})}})),O},[n,u.keymap,u.completion,u.language_servers,u.display,u.diagnostics,E,e,t,$,L,P,se,U,I,K,w,g,A]),R=Nr(),D=ue(()=>{if(R){let W=lr(n,V=>{$.updateCellCode({cellId:n,code:V,formattingChange:!0})},o);S.push(W.extension),o=W.code}let O=new B({state:Fr.create({doc:o,extensions:S})});s(O),R||Pt(O,{language:Sr(O.state).type})}),te=ue(()=>{if(Mt(d.current!==null,"Editor view is not initialized"),R){let O=lr(n,W=>{$.updateCellCode({cellId:n,code:W,formattingChange:!0})});S.push(O.extension)}d.current.dispatch({effects:[he.reconfigure.of([S]),Ud(d.current,{completionConfig:u.completion,hotkeysProvider:new Xa(u.keymap.overrides??{}),lspConfig:{...u.language_servers,diagnostics:u.diagnostics}})]})}),Je=ue(()=>{if(Mt(i,"Editor view is not initialized"),R){let W=lr(n,V=>{$.updateCellCode({cellId:n,code:V,formattingChange:!0})},o);S.push(W.extension),o=W.code}let O=new B({state:Fr.fromJSON(i,{doc:o,extensions:S},{history:Gf})});R||Pt(O,{language:Sr(O.state).type}),s(O),$.clearSerializedEditorState({cellId:n})});(0,F.useEffect)(()=>{i===null?d.current===null?D():te():Je(),d.current!==null&&f&&f.current!==null&&f.current.replaceChildren(d.current.dom)},[D,te,Je,d,f,i,S]),(0,F.useEffect)(()=>{let O=d.current;return()=>{O==null||O.destroy()}},[d]);let Pe=ld(n,d),$e="";return j&&h&&m?$e="h-0 overflow-hidden":h&&($e="opacity-20 h-8 [&>div.cm-editor]:h-full [&>div.cm-editor]:overflow-hidden [&_.cm-panels]:hidden"),(0,b.jsx)($u,{cellId:n,aiCompletionCell:T,currentCode:((Me=d.current)==null?void 0:Me.state.doc.toString())??o,currentLanguageAdapter:y,declineChange:ue(()=>{var O;I(null),(O=d.current)==null||O.focus()}),onChange:ue(O=>{var W;(W=d.current)==null||W.dispatch({changes:{from:0,to:d.current.state.doc.length,insert:O}})}),acceptChange:ue(O=>{var W,V;(W=d.current)==null||W.dispatch({changes:{from:0,to:d.current.state.doc.length,insert:O}}),(V=d.current)==null||V.focus(),I(null)}),runCell:U,outputArea:C,children:(0,b.jsxs)("div",{className:"relative w-full",...Pe,children:[(0,b.jsx)(Ia,{className:$e,editorView:d.current,ref:f,hidden:h,showHiddenCode:g}),!h&&k&&(0,b.jsx)("div",{className:"absolute top-1 right-5",children:(0,b.jsx)(cd,{code:o,editorView:d.current,currentLanguageAdapter:y,onAfterToggle:K})})]})})},Ia=F.forwardRef((e,t)=>{let n=(0,Aa.c)(14),{className:r,editorView:o,hidden:a,showHiddenCode:i}=e,s=(0,F.useRef)(null),c,u;n[0]===o?(c=n[1],u=n[2]):(c=()=>{o!==null&&s.current!==null&&s.current.children.length===0&&s.current.append(o.dom)},u=[o,s],n[0]=o,n[1]=c,n[2]=u),(0,F.useEffect)(c,u);let d;n[3]===r?d=n[4]:(d=ct("cm mathjax_ignore",r),n[3]=r,n[4]=d);let f;n[5]!==a||n[6]!==i?(f=g=>{a&&i&&(g.stopPropagation(),i({focus:!0}))},n[5]=a,n[6]=i,n[7]=f):f=n[7];let h;n[8]===t?h=n[9]:(h=g=>{t?_n(t,s)(g):_n(s)(g)},n[8]=t,n[9]=h);let m;return n[10]!==d||n[11]!==f||n[12]!==h?(m=(0,b.jsx)("div",{className:d,onDoubleClick:f,ref:h,"data-testid":"cell-editor"}),n[10]=d,n[11]=f,n[12]=h,n[13]=m):m=n[13],m});Ia.displayName="CellCodeMirrorEditor";function ud(e){let t=n=>{let r=(0,Aa.c)(5),o=re(lt),[a,i]=jt(dt);if(af(o.state)||a===void 0){let c;r[0]===Symbol.for("react.memo_cache_sentinel")?(c=(0,b.jsx)("span",{children:"Waiting for real-time collaboration connection..."}),r[0]=c):c=r[0];let u;return r[1]===i?u=r[2]:(u=(0,b.jsx)("div",{className:"flex h-full w-full items-baseline p-4",children:(0,b.jsxs)(Vf,{milliseconds:1e3,fallback:null,children:[c,(0,b.jsx)(He,{variant:"link",onClick:()=>{i("disabled")},children:"Turn off real-time collaboration"})]})}),r[1]=i,r[2]=u),u}let s;return r[3]===n?s=r[4]:(s=(0,b.jsx)(e,{...n}),r[3]=n,r[4]=s),s};return t.displayName=`WithWaitUntilConnected(${e.displayName})`,t}Pi=Nr()?ud((0,F.memo)(Ta)):(0,F.memo)(Ta)});export{Li as _,Qm as __tla,Mr as a,Oi as c,dt as d,Di as f,On as g,Rr as h,$t as i,Dn as l,be as m,_i as n,Ui as o,Bi as p,ji as r,_n as s,Pi as t,Gr as u,Un as v};
|
|
23
|
+
`)),wa(r.length)}catch{Ku()}}}),pasteAtCell:ue(async(t,n)=>{let{before:r=!1}=n??{};try{let o=await navigator.clipboard.read();for(let i of o)if(i.types.includes(hr)){let s=await(await i.getType(hr)).text();try{let c=qu.parse(JSON.parse(s));if(c.cells.length===0)break;let u=t,d=c.cells.reverse();for(let f of d)e.createNewCell({cellId:u,before:r,code:f.code,autoFocus:!0});return}catch(c){Ge.warn("Failed to parse clipboard cell data",c)}}let a=await navigator.clipboard.readText();a.trim()?e.createNewCell({cellId:t,before:r,code:a,autoFocus:!0}):Xu()}catch(o){Ge.error("Failed to paste from clipboard",o),Yu()}})}}var wa=e=>{let t=e===1?"Cell":`${e} cells`;Et({title:`${t} copied`,description:`${t} ${e===1?"has":"have"} been copied to clipboard.`})},Ku=()=>{Et({title:"Copy failed",description:"Failed to copy cells to clipboard.",variant:"danger"})},Xu=()=>{Et({title:"Nothing to paste",description:"No cell or text found in clipboard.",variant:"danger"})},Yu=()=>{Et({title:"Paste failed",description:"Failed to read from clipboard",variant:"danger"})},Qu=class{constructor(){p(this,"items",{})}add(e,t){return ClipboardItem.supports(e)?typeof t=="string"?(this.items[e]=new Blob([t],{type:e}),this):(this.items[e]=new Blob([JSON.stringify(t)],{type:e}),this):(Ge.warn(`ClipboardItem does not support ${e}`),this)}build(){return new ClipboardItem(this.items)}},Zu=Re();function va(){return{selectionStart:null,selectionEnd:null,selected:new Set}}var{reducer:Zm,createActions:eh,valueAtom:pr,useActions:ed}=Or(va,{select:(e,t)=>({selectionStart:t.cellId,selectionEnd:t.cellId,selected:new Set([t.cellId])}),extend:(e,t)=>{if(!e.selectionStart)return{selectionStart:t.cellId,selectionEnd:t.cellId,selected:new Set([t.cellId])};let{cellId:n,allCellIds:r}=t;try{let o=r.findWithId(e.selectionStart),a=o.indexOfOrThrow(e.selectionStart),i=o.indexOfOrThrow(n),[s,c]=a<i?[a,i]:[i,a],u=o.slice(s,c+1);return{selectionStart:e.selectionStart,selectionEnd:n,selected:new Set(u)}}catch{return{selectionStart:n,selectionEnd:n,selected:new Set([n])}}},clear:e=>e.selected.size===0?e:va()});Ui=()=>re(pr);function td(e){let t=(0,Zu.c)(2),n;return t[0]===e?n=t[1]:(n=yt(r=>r(pr).selected.has(e)),t[0]=e,t[1]=n),re(n)}Mr=function(){return ed()};function nd(e){return e.get(pr).selected}let Ea,Na,ka;Ea=Re(),{valueAtom:Na,useActions:$t}=Or(()=>new Set,{add:(e,t)=>{if(e.has(t))return e;let n=new Set(e);return n.add(t),n},remove:(e,t)=>{if(!e.has(t))return e;let n=new Set(e);return n.delete(t),Ra(()=>{let r=document.activeElement;if(!r)return;let o=Cn.findElementThroughShadowDOMs(r);o&&Ma(Cn.parse(o.id))}),n}}),ka=e=>yt(t=>t(Na).has(e)),ji=function(e){let t=(0,Ea.c)(2),n;return t[0]===e?n=t[1]:(n=ka(e),t[0]=e,t[1]=n),re(n)};var Bt=new WeakMap,rd=500;function od(e){if(e.ctrlKey||e.metaKey||e.altKey)return"";let t=e.key.toLowerCase();return e.shiftKey?`shift+${t}`:t}function ad(e,t){let n=od(e),r=e.target;if(!n||!r)return!1;let o=Bt.get(r),a=n;o!=null&&o.timeout&&clearTimeout(o.timeout),o&&(a=`${o.sequence} ${n}`);let i=t[a];if(i)return Bt.delete(r),i();if(!o){let s=t[n];if(s)return s()}if(Object.keys(t).some(s=>s.startsWith(`${a} `))){let s=window.setTimeout(()=>{Bt.delete(r)},rd);return Bt.set(r,{sequence:a,timeout:s}),!0}return Bt.delete(r),!1}var gr=Re();function Ca(e){return{handle:t=>e(t),bulkHandle:t=>{let n=!0;try{for(let r of t)n&&(n=e(r));return n}catch{return!1}}}}function Ye(e){return{handle:t=>e([t]),bulkHandle:t=>e(t)}}function id(e,t){let n=(0,gr.c)(12),r=Jm(),o=Sn(),a=$t(),i;n[0]!==e||n[1]!==r?(i=()=>{r.focusCell({cellId:e})},n[0]=e,n[1]=r,n[2]=i):i=n[2];let s;n[3]!==o||n[4]!==e||n[5]!==t||n[6]!==r||n[7]!==a?(s=()=>{a.remove(e),o.markTouched({cellId:e}),r.blurCell(),t.current&&br(t.current)},n[3]=o,n[4]=e,n[5]=t,n[6]=r,n[7]=a,n[8]=s):s=n[8];let c;n[9]!==i||n[10]!==s?(c={onFocusWithin:i,onBlurWithin:s},n[9]=i,n[10]=s,n[11]=c):c=n[11];let{focusWithinProps:u}=ym(c);return u}_i=function(e,t){let n=(0,gr.c)(30),{canMoveX:r,editorView:o,cellActionDropdownRef:a}=t,{saveOrNameNotebook:i}=dr(),{saveCellConfig:s}=Wt(),c=Ua(pi),u=Sn(),d=wr(),f=$t(),h=Om(),m=re(Ya),{copyCells:g,pasteAtCell:y}=zu(),w=Mr(),k=td(e),C=Un(),T=Ur(),I=re(Tr),_;n[0]!==C||n[1]!==w?(_={clear:()=>{C.clear(),w.clear()},extend:U=>{C.clear(),w.extend(U)},select:U=>{C.clear(),w.select(U)}},n[0]=C,n[1]=w,n[2]=_):_=n[2];let A=_,x=re(Qa),G;n[3]===x?G=n[4]:(G=(U,P)=>Ar(x.getHotkey(U).key)(P.nativeEvent||P),n[3]=x,n[4]=G);let ee=G,$=id(e,o),L;n[5]!==u||n[6]!==r||n[7]!==a||n[8]!==e||n[9]!==g||n[10]!==T||n[11]!==o||n[12]!==k||n[13]!==ee||n[14]!==m||n[15]!==y||n[16]!==C||n[17]!==h||n[18]!==s||n[19]!==i||n[20]!==A||n[21]!==c||n[22]!==d||n[23]!==f||n[24]!==I?(L={onKeyDown:U=>{if(Ir.fromInput(U)){U.continuePropagation();return}let P={"Mod+ArrowUp":()=>(u.focusTopCell(),A.clear(),!0),"Mod+ArrowDown":()=>(u.focusBottomCell(),A.clear(),!0),ArrowUp:()=>(u.focusCell({cellId:e,where:"before"}),A.clear(),!0),ArrowDown:()=>(u.focusCell({cellId:e,where:"after"}),A.clear(),!0),ArrowLeft:()=>{if(r){let E=d.get(nt),S=E.cellIds.findWithId(e),R=E.cellIds.indexOf(S),D=E.cellIds.at(R-1);if(D&&D.length>0){let te=Sa(e,D);return u.focusCell({cellId:te,where:"exact"}),A.clear(),!0}}return!1},ArrowRight:()=>{if(r){let E=d.get(nt),S=E.cellIds.findWithId(e),R=E.cellIds.indexOf(S),D=E.cellIds.at(R+1);if(D&&D.length>0){let te=Sa(e,D);return u.focusCell({cellId:te,where:"exact"}),A.clear(),!0}}return!1},"Shift+ArrowUp":()=>{let E=d.get(Wa);A.extend({cellId:e,allCellIds:E});let S=E.findWithId(e).before(e);return S&&A.extend({cellId:S,allCellIds:E}),u.focusCell({cellId:e,where:"before"}),!0},"Shift+ArrowDown":()=>{let E=d.get(Wa);A.extend({cellId:e,allCellIds:E});let S=E.findWithId(e).after(e);return S&&A.extend({cellId:S,allCellIds:E}),u.focusCell({cellId:e,where:"after"}),!0},Escape:()=>k?(A.clear(),!0):!1,Enter:()=>(f.add(e),Ga(d,e),A.clear(),!0),s:()=>(i(),!0)};for(let[E,S]of Object.entries(P))if(Ar(E)(U)&&S()){U.preventDefault();return}let me={"cell.run":Ye(E=>(h(E),!0)),"cell.runAndNewBelow":Ye(E=>{h(E);let S=E[E.length-1];return u.moveToNextCell({cellId:S,before:!1}),!0}),"cell.runAndNewAbove":Ye(E=>{h(E);let S=E[0];return u.moveToNextCell({cellId:S,before:!0}),!0}),"cell.createAbove":E=>(u.createNewCell({cellId:E,before:!0}),!0),"cell.createBelow":E=>(u.createNewCell({cellId:E,before:!1}),!0),"cell.moveUp":Ye(E=>{let S=E[0];return d.get(nt).cellIds.findWithId(S).first()===S?!1:(E.forEach(R=>{u.moveCell({cellId:R,before:!0})}),!0)}),"cell.moveDown":Ye(E=>{let S=E[E.length-1];return d.get(nt).cellIds.findWithId(S).last()===S?!1:([...E].reverse().forEach(R=>{u.moveCell({cellId:R,before:!1})}),!0)}),"cell.moveLeft":Ca(E=>r?(u.moveCell({cellId:E,direction:"left"}),!0):!1),"cell.moveRight":Ca(E=>r?(u.moveCell({cellId:E,direction:"right"}),!0):!1),"cell.hideCode":Ye(E=>{var R;let S=!E.map(D=>{var te;return((te=d.get(nt).cellData[D])==null?void 0:te.config)||null}).every(sd);s({configs:Object.fromEntries(E.map(D=>[D,{hide_code:S}]))});for(let D of E)u.updateCellConfig({cellId:D,config:{hide_code:S}});if(E.length===1){let D=E[0];u.focusCell({cellId:D,where:"after"}),S?((R=o.current)==null||R.contentDOM.blur(),ja(D)):Ga(d,D)}return!0}),"cell.focusDown":E=>(u.focusCell({cellId:E,where:"after"}),!0),"cell.focusUp":E=>(u.focusCell({cellId:E,where:"before"}),!0),"cell.sendToBottom":Ye(E=>(E.forEach(S=>{u.sendToBottom({cellId:S})}),!0)),"cell.sendToTop":Ye(E=>([...E].reverse().forEach(S=>{u.sendToTop({cellId:S})}),!0)),"cell.aiCompletion":E=>{var R;let S=!1;return c(D=>(D==null?void 0:D.cellId)===E?(S=!0,null):{cellId:E}),S&&((R=o.current)==null||R.focus()),!0},"cell.cellActions":()=>{var E;return(E=a.current)==null||E.toggle(),!0},"command.copyCell":Ye(E=>(g(E),!0)),"command.pasteCell":E=>(y(E),!0),"command.createCellBefore":E=>Ir.hasModifier(U)?!1:(u.createNewCell({cellId:E,before:!0,autoFocus:!0}),!0),"command.createCellAfter":E=>Ir.hasModifier(U)?!1:(u.createNewCell({cellId:E,before:!1,autoFocus:!0}),!0),"cell.delete":()=>{if(!I.keymap.destructive_delete)return!1;let E=K.size>=2?[...K]:[e],S=d.get(nt);return E.some(R=>{let{status:D}=S.cellRuntime[R];return D==="running"||D==="queued"})?!1:C.idle?(C.submit(E),!0):(T({cellIds:E}),C.clear(),!0)}},K=nd(d);if(m==="vim"&&ad(U.nativeEvent||U,{j:P.ArrowDown,k:P.ArrowUp,h:P.ArrowLeft,l:P.ArrowRight,i:P.Enter,"shift+j":P["Shift+ArrowDown"],"shift+k":P["Shift+ArrowUp"],"g g":P["Mod+ArrowUp"],"shift+g":P["Mod+ArrowDown"],"d d":()=>me["cell.delete"](),"y y":()=>(g(K.size>=2?[...K]:[e]),!0),p:()=>(y(e,{before:!1}),!0),"shift+p":()=>(y(e,{before:!0}),!0),o:()=>(u.createNewCell({cellId:e,before:!1,autoFocus:!0}),!0),"shift+o":()=>(u.createNewCell({cellId:e,before:!0,autoFocus:!0}),!0),u:()=>(u.undoDeleteCell(),!0)})){U.preventDefault();return}for(let[E,S]of Object.entries(me))if(ee(E,U)){if(S instanceof Function){if(S(e)){U.preventDefault();return}}else if(K.size>=2?S.bulkHandle([...K]):S.handle(e)){U.preventDefault();return}return}U.continuePropagation()}},n[5]=u,n[6]=r,n[7]=a,n[8]=e,n[9]=g,n[10]=T,n[11]=o,n[12]=k,n[13]=ee,n[14]=m,n[15]=y,n[16]=C,n[17]=h,n[18]=s,n[19]=i,n[20]=A,n[21]=c,n[22]=d,n[23]=f,n[24]=I,n[25]=L):L=n[25];let{keyboardProps:j}=hi(L),se;return n[26]!==$||n[27]!==k||n[28]!==j?(se=xm($,j,{"data-selected":k,className:"data-[selected=true]:ring-1 data-[selected=true]:ring-(--blue-8) data-[selected=true]:ring-offset-1"}),n[26]=$,n[27]=k,n[28]=j,n[29]=se):se=n[29],se};function sd(e){return e==null?void 0:e.hide_code}function ld(e,t){let n=(0,gr.c)(12),r=$t(),o=re(Ya),a=re(Qa),i;n[0]===a?i=n[1]:(i=Ar(a.getHotkey("command.vimEnterCommandMode").key),n[0]=a,n[1]=i);let s=i,c;n[2]!==e||n[3]!==r?(c=()=>{r.remove(e),ja(e),Ra(()=>{Ma(e)})},n[2]=e,n[3]=r,n[4]=c):c=n[4];let u=c,d;n[5]!==t||n[6]!==u?(d=()=>{if(!t.current){u();return}let g=t.current,y=g.state;if(Bf(g))return;let w=y.field(Pa,!1),k=Jt(y)!==null;w&&br(g),k&&Yf(g),!(w||k)&&u()},n[5]=t,n[6]=u,n[7]=d):d=n[7];let f=d,h;n[8]!==f||n[9]!==o||n[10]!==s?(h={onKeyDown:g=>{o==="vim"?s(g)&&f():g.key==="Escape"&&f(),g.continuePropagation()}},n[8]=f,n[9]=o,n[10]=s,n[11]=h):h=n[11];let{keyboardProps:m}=hi(h);return m}function Sa(e,t){let n=document.getElementById(Cn.create(e));if(!n)return t.first();let r=n.getBoundingClientRect();for(let o of t.topLevelIds){let a=document.getElementById(Cn.create(o));if(a){let i=a.getBoundingClientRect();if(r.top<=i.bottom&&r.bottom>=i.top)return o}}return t.last()}function br(e){e.state.field(Pa,!1)&&e.dispatch({effects:bd.of(null)})}var xa=Re();const cd=e=>{let t=(0,xa.c)(24),{editorView:n,code:r,currentLanguageAdapter:o,onAfterToggle:a}=e,i;t[0]===r?i=t[1]:(i=qa.markdown.isSupported(r)||r.trim()==="",t[0]=r,t[1]=i);let s=i,c;t[2]===r?c=t[3]:(c=qa.sql.isSupported(r)||r.trim()==="",t[2]=r,t[3]=c);let u=c&&o==="python",d;t[4]===Symbol.for("react.memo_cache_sentinel")?(d=(0,b.jsx)(Ad,{color:"var(--sky-11)",strokeWidth:2.5,className:"w-4 h-4"}),t[4]=d):d=t[4];let f;t[5]!==o||t[6]!==n||t[7]!==a||t[8]!==u?(f=(0,b.jsx)(yr,{editorView:n,currentLanguageAdapter:o,canSwitchToLanguage:u,icon:d,toType:"sql",displayName:"SQL",onAfterToggle:a}),t[5]=o,t[6]=n,t[7]=a,t[8]=u,t[9]=f):f=t[9];let h=s&&o==="python",m;t[10]===Symbol.for("react.memo_cache_sentinel")?(m=(0,b.jsx)(Vm,{fill:"var(--sky-11)",color:"black",className:"w-4 h-4"}),t[10]=m):m=t[10];let g;t[11]!==o||t[12]!==n||t[13]!==a||t[14]!==h?(g=(0,b.jsx)(yr,{editorView:n,currentLanguageAdapter:o,canSwitchToLanguage:h,icon:m,toType:"markdown",displayName:"Markdown",onAfterToggle:a}),t[11]=o,t[12]=n,t[13]=a,t[14]=h,t[15]=g):g=t[15];let y;t[16]===Symbol.for("react.memo_cache_sentinel")?(y=(0,b.jsx)(Wm,{fill:"var(--sky-11)",color:"black",className:"w-4 h-4"}),t[16]=y):y=t[16];let w;t[17]!==o||t[18]!==n?(w=(0,b.jsx)(yr,{editorView:n,currentLanguageAdapter:o,canSwitchToLanguage:!0,icon:y,toType:"python",displayName:"Python",onAfterToggle:tf.NOOP}),t[17]=o,t[18]=n,t[19]=w):w=t[19];let k;return t[20]!==w||t[21]!==f||t[22]!==g?(k=(0,b.jsxs)("div",{className:"absolute right-3 top-2 z-20 flex hover-action gap-1",children:[f,g,w]}),t[20]=w,t[21]=f,t[22]=g,t[23]=k):k=t[23],k},yr=e=>{let t=(0,xa.c)(10),{editorView:n,currentLanguageAdapter:r,canSwitchToLanguage:o,icon:a,toType:i,displayName:s,onAfterToggle:c}=e,u;t[0]!==n||t[1]!==c||t[2]!==i?(u=()=>{n&&(Pt(n,{language:i}),c())},t[0]=n,t[1]=c,t[2]=i,t[3]=u):u=t[3];let d=u;if(!o||r===i)return null;let f=`View as ${s}`,h;t[4]!==d||t[5]!==a?(h=(0,b.jsx)(He,{"data-testid":"language-toggle-button",variant:"text",size:"xs",className:"opacity-80 px-1",onClick:d,children:a}),t[4]=d,t[5]=a,t[6]=h):h=t[6];let m;return t[7]!==f||t[8]!==h?(m=(0,b.jsx)(Nt,{content:f,children:h}),t[7]=f,t[8]=h,t[9]=m):m=t[9],m};var Aa=Re(),Ta=({theme:e,showPlaceholder:t,id:n,config:r,code:o,status:a,serializedEditorState:i,setEditorView:s,runCell:c,userConfig:u,editorViewRef:d,editorViewParentRef:f,hidden:h,hasOutput:m,showHiddenCode:g,languageAdapter:y,setLanguageAdapter:w,showLanguageToggles:k=!0,outputArea:C})=>{var Me;let[T,I]=jt(pi),_=ki(),{saveOrNameNotebook:A}=dr(),x=Un(),{saveCellConfig:G}=Wt(),ee=a==="running"||a==="queued",$=Sn(),L=$m(),j=y==="markdown",se=ue(()=>ee?!1:x.idle&&u.keymap.destructive_delete?(x.submit([n]),!0):(_({cellId:n}),!0)),U=ue(()=>ee?!1:(c(),d.current&&br(d.current),!0)),P=ue(()=>{let O=!r.hide_code;return G({configs:{[n]:{hide_code:O}}}),$.updateCellConfig({cellId:n,config:{hide_code:O}}),O}),me=re(of),K=ue(()=>{Rm({autoInstantiate:me,createNewCell:$.createNewCell})}),E=rf(u),S=(0,F.useMemo)(()=>{var W;let O=Gc({cellId:n,showPlaceholder:t,enableAI:E,cellActions:{...$,afterToggleMarkdown:K,onRun:U,deleteCell:se,saveNotebook:A,createManyBelow:V=>{for(let le of[...V].reverse())$.createNewCell({code:le,before:!1,cellId:n,skipIfCodeExists:!0})},splitCell:L,toggleHideCode:P,aiCellCompletion:()=>{let V=!1;return I(le=>(le==null?void 0:le.cellId)===n?(V=!0,null):{cellId:n}),V}},completionConfig:u.completion,keymapConfig:u.keymap,lspConfig:u.language_servers,theme:e,hotkeys:new Xa(u.keymap.overrides??{}),diagnosticsConfig:u.diagnostics,displayConfig:u.display,inlineAiTooltip:((W=u.ai)==null?void 0:W.inline_tooltip)??!1});return O.push(ze.define(V=>(w(V.state.field(kn).type),{update(le){w(le.state.field(kn).type)}})),B.updateListener.of(V=>{V.selectionSet&&V.state.selection.ranges.some(le=>le.from!==le.to)&&g({focus:!1})}),B.domEventHandlers({focus:()=>{g({focus:!1})}})),O},[n,u.keymap,u.completion,u.language_servers,u.display,u.diagnostics,E,e,t,$,L,P,se,U,I,K,w,g,A]),R=Nr(),D=ue(()=>{if(R){let W=lr(n,V=>{$.updateCellCode({cellId:n,code:V,formattingChange:!0})},o);S.push(W.extension),o=W.code}let O=new B({state:Fr.create({doc:o,extensions:S})});s(O),R||Pt(O,{language:Sr(O.state).type})}),te=ue(()=>{if(Mt(d.current!==null,"Editor view is not initialized"),R){let O=lr(n,W=>{$.updateCellCode({cellId:n,code:W,formattingChange:!0})});S.push(O.extension)}d.current.dispatch({effects:[he.reconfigure.of([S]),Ud(d.current,{completionConfig:u.completion,hotkeysProvider:new Xa(u.keymap.overrides??{}),lspConfig:{...u.language_servers,diagnostics:u.diagnostics}})]})}),Je=ue(()=>{if(Mt(i,"Editor view is not initialized"),R){let W=lr(n,V=>{$.updateCellCode({cellId:n,code:V,formattingChange:!0})},o);S.push(W.extension),o=W.code}let O=new B({state:Fr.fromJSON(i,{doc:o,extensions:S},{history:Gf})});R||Pt(O,{language:Sr(O.state).type}),s(O),$.clearSerializedEditorState({cellId:n})});(0,F.useEffect)(()=>{i===null?d.current===null?D():te():Je(),d.current!==null&&f&&f.current!==null&&f.current.replaceChildren(d.current.dom)},[D,te,Je,d,f,i,S]),(0,F.useEffect)(()=>{let O=d.current;return()=>{O==null||O.destroy()}},[d]);let Pe=ld(n,d),$e="";return j&&h&&m?$e="h-0 overflow-hidden":h&&($e="opacity-20 h-8 [&>div.cm-editor]:h-full [&>div.cm-editor]:overflow-hidden [&_.cm-panels]:hidden"),(0,b.jsx)($u,{cellId:n,aiCompletionCell:T,currentCode:((Me=d.current)==null?void 0:Me.state.doc.toString())??o,currentLanguageAdapter:y,declineChange:ue(()=>{var O;I(null),(O=d.current)==null||O.focus()}),onChange:ue(O=>{var W;(W=d.current)==null||W.dispatch({changes:{from:0,to:d.current.state.doc.length,insert:O}})}),acceptChange:ue(O=>{var W,V;(W=d.current)==null||W.dispatch({changes:{from:0,to:d.current.state.doc.length,insert:O}}),(V=d.current)==null||V.focus(),I(null)}),runCell:U,outputArea:C,children:(0,b.jsxs)("div",{className:"relative w-full",...Pe,children:[(0,b.jsx)(Ia,{className:$e,editorView:d.current,ref:f,hidden:h,showHiddenCode:g}),!h&&k&&(0,b.jsx)("div",{className:"absolute top-1 right-5",children:(0,b.jsx)(cd,{code:o,editorView:d.current,currentLanguageAdapter:y,onAfterToggle:K})})]})})},Ia=F.forwardRef((e,t)=>{let n=(0,Aa.c)(14),{className:r,editorView:o,hidden:a,showHiddenCode:i}=e,s=(0,F.useRef)(null),c,u;n[0]===o?(c=n[1],u=n[2]):(c=()=>{o!==null&&s.current!==null&&s.current.children.length===0&&s.current.append(o.dom)},u=[o,s],n[0]=o,n[1]=c,n[2]=u),(0,F.useEffect)(c,u);let d;n[3]===r?d=n[4]:(d=ct("cm mathjax_ignore",r),n[3]=r,n[4]=d);let f;n[5]!==a||n[6]!==i?(f=g=>{a&&i&&(g.stopPropagation(),i({focus:!0}))},n[5]=a,n[6]=i,n[7]=f):f=n[7];let h;n[8]===t?h=n[9]:(h=g=>{t?_n(t,s)(g):_n(s)(g)},n[8]=t,n[9]=h);let m;return n[10]!==d||n[11]!==f||n[12]!==h?(m=(0,b.jsx)("div",{className:d,onDoubleClick:f,ref:h,"data-testid":"cell-editor"}),n[10]=d,n[11]=f,n[12]=h,n[13]=m):m=n[13],m});Ia.displayName="CellCodeMirrorEditor";function ud(e){let t=n=>{let r=(0,Aa.c)(5),o=re(lt),[a,i]=jt(dt);if(af(o.state)||a===void 0){let c;r[0]===Symbol.for("react.memo_cache_sentinel")?(c=(0,b.jsx)("span",{children:"Waiting for real-time collaboration connection..."}),r[0]=c):c=r[0];let u;return r[1]===i?u=r[2]:(u=(0,b.jsx)("div",{className:"flex h-full w-full items-baseline p-4",children:(0,b.jsxs)(Vf,{milliseconds:1e3,fallback:null,children:[c,(0,b.jsx)(He,{variant:"link",onClick:()=>{i("disabled")},children:"Turn off real-time collaboration"})]})}),r[1]=i,r[2]=u),u}let s;return r[3]===n?s=r[4]:(s=(0,b.jsx)(e,{...n}),r[3]=n,r[4]=s),s};return t.displayName=`WithWaitUntilConnected(${e.displayName})`,t}Pi=Nr()?ud((0,F.memo)(Ta)):(0,F.memo)(Ta)});export{Li as _,Qm as __tla,Mr as a,Oi as c,dt as d,Di as f,On as g,Rr as h,$t as i,Dn as l,be as m,_i as n,Ui as o,Bi as p,ji as r,_n as s,Pi as t,Gr as u,Un as v};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{s as j}from"./chunk-LvLJmgfZ.js";import{d as w,l as P,n as y,u as A}from"./useEvent-DlWF5OMa.js";import{Ft as L,Kt as O,Wr as _,j as E,k as F,mt as S,ti as T,w as $}from"./cells-
|
|
1
|
+
import{s as j}from"./chunk-LvLJmgfZ.js";import{d as w,l as P,n as y,u as A}from"./useEvent-DlWF5OMa.js";import{Ft as L,Kt as O,Wr as _,j as E,k as F,mt as S,ti as T,w as $}from"./cells-dG69fEtz.js";import{t as b}from"./compiler-runtime-DeeZ7FnK.js";import{d as D}from"./hotkeys-uKX61F1_.js";import{d as q}from"./utils-Czt8B2GX.js";import{r as I}from"./constants-Bkp4R3bQ.js";import{A as B,p as H,w as K}from"./config-CENq_7Pd.js";import{t as M}from"./jsx-runtime-DN_bIXfG.js";import{t as R}from"./cn-C1rgT0yh.js";import{r as U}from"./requests-C0HaHO6a.js";import{n as V}from"./ImperativeModal-DVhvP4lH.js";var W=b();function N(){return A(_)}function z(){let r=(0,W.c)(5),[t]=P(K),e=w(_),{openAlert:a}=V(),{sendRename:o}=U(),s;return r[0]!==t.state||r[1]!==a||r[2]!==o||r[3]!==e?(s=async l=>{let n=q();return t.state===B.OPEN?(H(i=>{l===null?i.delete(I.filePath):i.set(I.filePath,l)}),o({filename:l}).then(()=>(e(l),document.title=n.app_title||L.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],y(s)}var p=b(),v=j(M(),1);const k=r=>{let t=(0,p.c)(12),{className:e,cellId:a,variant:o,onClick:s,formatCellName:l,skipScroll:n}=r,i=E()[a]??"",C=F().inOrderIds.indexOf(a),{showCellIfHidden:d}=$(),g=l??Q,c;t[0]===e?c=t[1]:(c=R("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(()=>{x(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(S(i,C)),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},G=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},J=r=>{let t=(0,p.c)(10),{cellId:e,lineNumber:a}=r,o=N(),s;t[0]!==e||t[1]!==a?(s=()=>O(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 x(r,t,e){let a=T.create(r),o=document.getElementById(a);return o===null?(D.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 Q(r){return r}export{N as a,x as i,G as n,z as o,J as r,k as t};
|