var h=Object.defineProperty;var v=(a,r)=>{for(var o in r)h(a,o,{get:r[o],enumerable:!0})};var m=`.token-variable{color:var(--sys-color-token-variable)}.token-property{color:var(--sys-color-token-property)}.token-type{color:var(--sys-color-token-type)}.token-variable-special{color:var(--sys-color-token-variable-special)}.token-definition{color:var(--sys-color-token-definition)}.token-builtin{color:var(--sys-color-token-builtin)}.token-number{color:var(--sys-color-token-number)}.token-string{color:var(--sys-color-token-string)}.token-string-special{color:var(--sys-color-token-string-special)}.token-atom{color:var(--sys-color-token-atom)}.token-keyword{color:var(--sys-color-token-keyword)}.token-comment{color:var(--sys-color-token-comment)}.token-meta{color:var(--sys-color-token-meta)}.token-invalid{color:var(--sys-color-error)}.token-tag{color:var(--sys-color-token-tag)}.token-attribute{color:var(--sys-color-token-attribute)}.token-attribute-value{color:var(--sys-color-token-attribute-value)}.token-inserted{color:var(--sys-color-token-inserted)}.token-deleted{color:var(--sys-color-token-deleted)}.token-heading{color:var(--sys-color-token-variable-special);font-weight:bold}.token-link{color:var(--sys-color-token-variable-special);text-decoration:underline}.token-strikethrough{text-decoration:line-through}.token-strong{font-weight:bold}.token-emphasis{font-style:italic}
/*# sourceURL=${import.meta.resolve("./codeHighlighter.css")} */`;var k={};v(k,{CodeHighlighter:()=>p,create:()=>u,highlightNode:()=>C,highlightStyle:()=>g,languageFromMIME:()=>d});import*as e from"./../../../third_party/codemirror.next/codemirror.next.js";var t=e.tags,g=e.HighlightStyle.define([{tag:t.variableName,class:"token-variable"},{tag:t.definition(t.variableName),class:"token-definition"},{tag:t.propertyName,class:"token-property"},{tag:[t.typeName,t.className,t.namespace,t.macroName],class:"token-type"},{tag:[t.special(t.name),t.constant(t.className)],class:"token-variable-special"},{tag:t.standard(t.variableName),class:"token-builtin"},{tag:[t.number,t.literal,t.unit],class:"token-number"},{tag:t.string,class:"token-string"},{tag:[t.special(t.string),t.regexp,t.escape],class:"token-string-special"},{tag:[t.atom,t.labelName,t.bool],class:"token-atom"},{tag:t.keyword,class:"token-keyword"},{tag:[t.comment,t.quote],class:"token-comment"},{tag:t.meta,class:"token-meta"},{tag:t.invalid,class:"token-invalid"},{tag:t.tagName,class:"token-tag"},{tag:t.attributeName,class:"token-attribute"},{tag:t.attributeValue,class:"token-attribute-value"},{tag:t.inserted,class:"token-inserted"},{tag:t.deleted,class:"token-deleted"},{tag:t.heading,class:"token-heading"},{tag:t.link,class:"token-link"},{tag:t.strikethrough,class:"token-strikethrough"},{tag:t.strong,class:"token-strong"},{tag:t.emphasis,class:"token-emphasis"}]);async function u(a,r){let o=await d(r),i;return o?i=o.language.parser.parse(a):i=new e.Tree(e.NodeType.none,[],[],a.length),new p(a,i)}async function C(a,r){let o=a.textContent||"",i=await u(o,r);a.removeChildren(),i.highlight((l,c)=>{let s=document.createTextNode(l);if(c){let n=document.createElement("span");n.className=c,n.appendChild(s),s=n}a.appendChild(s)})}async function d(a){switch(a){case"application/javascript":case"application/ecmascript":case"application/x-ecmascript":case"application/x-javascript":case"text/ecmascript":case"text/javascript1.0":case"text/javascript1.1":case"text/javascript1.2":case"text/javascript1.3":case"text/javascript1.4":case"text/javascript1.5":case"text/jscript":case"text/livescript ":case"text/x-ecmascript":case"text/x-javascript":case"text/javascript":case"text/jsx":return e.javascript.javascript({jsx:!0});case"text/typescript":return e.javascript.javascript({typescript:!0});case"text/typescript-jsx":return e.javascript.javascript({typescript:!0,jsx:!0});case"text/css":return e.css.css();case"text/html":return e.html.html({autoCloseTags:!1,selfClosingTags:!0});case"application/xml":case"application/xhtml+xml":case"image/svg+xml":return(await e.xml()).xml();case"application/wasm":return(await e.wast()).wast();case"text/x-c++src":return(await e.cpp()).cpp();case"text/x-go":return new e.LanguageSupport(await e.go());case"text/x-java":return(await e.java()).java();case"text/x-kotlin":return new e.LanguageSupport(await e.kotlin());case"application/json":case"application/manifest+json":{let r=e.javascript.javascriptLanguage.configure({top:"SingleExpression"});return new e.LanguageSupport(r)}case"application/x-httpd-php":return(await e.php()).php();case"text/x-python":return(await e.python()).python();case"text/markdown":return(await e.markdown()).markdown();case"text/x-sh":return new e.LanguageSupport(await e.shell());case"text/x-coffeescript":return new e.LanguageSupport(await e.coffeescript());case"text/x-clojure":return new e.LanguageSupport(await e.clojure());case"application/vnd.dart":return new e.LanguageSupport(await e.dart());case"text/x-gss":return new e.LanguageSupport(await e.gss());case"text/x-less":return(await e.less()).less();case"text/x-sass":return(await e.sass()).sass({indented:!0});case"text/x-scala":return new e.LanguageSupport(await e.scala());case"text/x-scss":return(await e.sass()).sass({indented:!1});case"text/x.angular":return(await e.angular()).angular();case"text/x.svelte":return(await e.svelte()).svelte();case"text/x.vue":return(await e.vue()).vue();default:return null}}var p=class{code;tree;constructor(r,o){this.code=r,this.tree=o}highlight(r){this.highlightRange(0,this.code.length,r)}highlightRange(r,o,i){let l=r,c=(s,n)=>{s>l&&(i(this.code.slice(l,s),n),l=s)};e.highlightTree(this.tree,g,(s,n,x)=>{c(s,""),c(n,x)},r,o),c(o,"")}};export{k as CodeHighlighter,m as codeHighlighterStyles};
//# sourceMappingURL=code_highlighter.js.map
