import u from"shiki/langs/bash.mjs";import w from"shiki/langs/c.mjs";import N from"shiki/langs/coffee.mjs";import b from"shiki/langs/cpp.mjs";import y from"shiki/langs/csharp.mjs";import H from"shiki/langs/css.mjs";import v from"shiki/langs/go.mjs";import L from"shiki/langs/graphql.mjs";import _ from"shiki/langs/html.mjs";import x from"shiki/langs/http.mjs";import T from"shiki/langs/java.mjs";import j from"shiki/langs/javascript.mjs";import E from"shiki/langs/kotlin.mjs";import M from"shiki/langs/lua.mjs";import r from"shiki/langs/markdown.mjs";import q from"shiki/langs/objective-c.mjs";import A from"shiki/langs/perl.mjs";import D from"shiki/langs/php.mjs";import F from"shiki/langs/python.mjs";import R from"shiki/langs/ruby.mjs";import S from"shiki/langs/scala.mjs";import W from"shiki/langs/sql.mjs";import a from"shiki/langs/swift.mjs";import C from"shiki/langs/tsx.mjs";import G from"shiki/langs/typescript.mjs";import J from"shiki/langs/vim.mjs";import U from"shiki/langs/xml.mjs";import V from"shiki/langs/yaml.mjs";import $ from"shiki/langs/jsx.mjs";import{transformerNotationDiff as z,transformerNotationHighlight as B,transformerNotationWordHighlight as I,transformerNotationFocus as K,transformerNotationErrorLevel as O,transformerMetaHighlight as P,transformerMetaWordHighlight as Q,transformerRemoveNotationEscape as X}from"@shikijs/transformers";import{createHighlighterCoreSync as s}from"shiki/core";import{createJavaScriptRegexEngine as n}from"shiki/engine/javascript";import f from"./theme";import Y from"./treeview-transformer";import Z from"./node-transformer";import rr from"./line-numbers-transformer";import{mapLang as or}from"./map-lang";const tr=[{...r[0],displayName:"Markdoc",name:"markdoc",scopeName:"source.markdoc",aliases:[],repository:{...r[0].repository,fenced_code_block:{patterns:[...r[0].repository.fenced_code_block.patterns||[],{name:"markdoc",begin:".*{%",end:"%}",patterns:[{match:"(?<={%)\\s*(/\\w+(-\\w+)?|\\w+(-\\w+)?)",name:"markdoc.tag"},{match:"\\$\\w+",name:"markdoc.variable"},{match:'".*?"',name:"markdoc.string"},{match:"\\b\\w+(?=\\()",name:"markdoc.function"},{match:"\\s+\\w+(?==|\\s)",name:"markdoc.keyword"},{match:"(?<==)false|true(?=\\s)",name:"markdoc.boolean"}]}]}}}],p="text",c=s({themes:[f],langs:[u,w,N,b,y,H,v,L,_,x,T,j,E,M,r,q,A,D,F,R,S,W,a,C,G,U,J,V,tr,$],engine:n()}),mr=[z(),B(),I(),K(),O(),P(),Q(),X(),Z()],er=(o,m,h)=>{const{withLineNumbers:g,startLineNumber:l,highlight:d,customTransformer:e}=h||{},i=or(m?.toLowerCase()||p),t={lang:i,theme:"theme",meta:{__raw:d},transformers:[...i==="treeview"?[Y()]:[],...mr,...g?[rr(l)]:[],...e?[e]:[]]};try{return m==="swift"?s({themes:[f],langs:[a],engine:n({forgiving:!0})}).codeToHtml(o,t):c.codeToHtml(o,t)}catch{return c.codeToHtml(o,{...t,lang:p})}};function Vr(){return{highlight:er}}export{er as highlight,Vr as useCodeHighlight};
