import{s as a}from"./chunk-LvLJmgfZ.js";import{t as d}from"./react-Bj1aDYRI.js";import"./react-dom-CSu739Rf.js";import"./compiler-runtime-B3qBwwSJ.js";import{_ as f}from"./useEventListener-BakX-tnw.js";import{t as g}from"./jsx-runtime-PbYoItBR.js";import"./fullscreen-BXI8V5i6.js";import"./dist-Dez1I5M9.js";import"./dist-DHMtQYxT.js";import"./dist-Bj9Iedc0.js";import"./dist-D-o1OXc9.js";import"./dist-BZhJ1bTM.js";import"./dist-DnIl7RU-.js";import{t as h}from"./copy-icon-BCIGtBo0.js";import{n as c}from"./error-banner-C4DZksWV.js";import{t as x}from"./esm-DSv-aO_T.js";import"./dist-DQlrXcW2.js";import"./dist-B_4mXtvJ.js";import"./dist-BRRMCoI_.js";import"./dist-BzGK1_vc.js";import"./dist-d_9Qt_7_.js";import"./dist-DoxplNOD.js";import"./dist-Cq98Ix9k.js";import"./dist-npZrjkCf.js";import"./dist-CkHYcq4S.js";import{n as v,t as p}from"./esm-BqXnk7X6.js";var j=a(d(),1),o=a(g(),1);const e={python:"py",python3:"py",javascript:"js",typescript:"ts",shell:"sh",bash:"sh",unknown:"text",undefined:"text"};function m(t){return t?t in p:!1}var y=({language:t,hideUnsupportedLanguageErrors:n,showCopyButton:u,extensions:r=[],...s})=>{t=e[t||""]||t;let i=m(t);i||f.warn(`Language ${t} not found in CodeMirror.`);let l=(0,j.useMemo)(()=>m(t)?[v(t),...r].filter(Boolean):r,[t,r]);return(0,o.jsxs)("div",{className:"relative w-full group hover-actions-parent",children:[!i&&!n&&(0,o.jsx)(c,{className:"mb-1 rounded-sm",error:`Language ${t} not supported. Supported languages are: ${Object.keys(p).join(", ")}`}),u&&i&&(0,o.jsx)(h,{tooltip:!1,buttonClassName:"absolute top-2 right-2 z-10 hover-action",className:"h-4 w-4 text-muted-foreground",value:s.value||"",toastTitle:"Copied to clipboard"}),(0,o.jsx)(x,{...s,extensions:l})]})};export{e as LANGUAGE_MAP,y as default};
