import{j as u}from"./js-yaml-yTPt38rv.js";import{f as b}from"./element-ui--fm6Vjyy.js";import{r as T}from"./highlightjs-D4ATuRwX.js";import{v as R,c as d,x as p,y as A,B as O}from"./vue-core-C3hq3bxF.js";var C=T();const i=b(C);function S(e){const n={className:"attr",begin:/"(\\.|[^\\"\r\n])*"(?=\s*:)/,relevance:1.01},t={match:/[{}[\],:]/,className:"punctuation",relevance:0},a=["true","false","null"],s={scope:"literal",beginKeywords:a.join(" ")};return{name:"JSON",aliases:["jsonc"],keywords:{literal:a},contains:[n,t,e.QUOTE_STRING_MODE,s,e.C_NUMBER_MODE,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE],illegal:"\\S"}}function v(e){const n="true false yes no null",t="[\\w#;/?:@&=+$,.~*'()[\\]]+",a={className:"attr",variants:[{begin:/[\w*@][\w*@ :()\./-]*:(?=[ \t]|$)/},{begin:/"[\w*@][\w*@ :()\./-]*":(?=[ \t]|$)/},{begin:/'[\w*@][\w*@ :()\./-]*':(?=[ \t]|$)/}]},s={className:"template-variable",variants:[{begin:/\{\{/,end:/\}\}/},{begin:/%\{/,end:/\}/}]},E={className:"string",relevance:0,begin:/'/,end:/'/,contains:[{match:/''/,scope:"char.escape",relevance:0}]},o={className:"string",relevance:0,variants:[{begin:/"/,end:/"/},{begin:/\S+/}],contains:[e.BACKSLASH_ESCAPE,s]},g=e.inherit(o,{variants:[{begin:/'/,end:/'/,contains:[{begin:/''/,relevance:0}]},{begin:/"/,end:/"/},{begin:/[^\s,{}[\]]+/}]}),m={className:"number",begin:"\\b"+"[0-9]{4}(-[0-9][0-9]){0,2}"+"([Tt \\t][0-9][0-9]?(:[0-9][0-9]){2})?"+"(\\.[0-9]*)?"+"([ \\t])*(Z|[-+][0-9][0-9]?(:[0-9][0-9])?)?"+"\\b"},c={end:",",endsWithParent:!0,excludeEnd:!0,keywords:n,relevance:0},_={begin:/\{/,end:/\}/,contains:[c],illegal:"\\n",relevance:0},N={begin:"\\[",end:"\\]",contains:[c],illegal:"\\n",relevance:0},l=[a,{className:"meta",begin:"^---\\s*$",relevance:10},{className:"string",begin:"[\\|>]([1-9]?[+-])?[ ]*\\n( +)[^ ][^\\n]*\\n(\\2[^\\n]+\\n?)*"},{begin:"<%[%=-]?",end:"[%-]?%>",subLanguage:"ruby",excludeBegin:!0,excludeEnd:!0,relevance:0},{className:"type",begin:"!\\w+!"+t},{className:"type",begin:"!<"+t+">"},{className:"type",begin:"!"+t},{className:"type",begin:"!!"+t},{className:"meta",begin:"&"+e.UNDERSCORE_IDENT_RE+"$"},{className:"meta",begin:"\\*"+e.UNDERSCORE_IDENT_RE+"$"},{className:"bullet",begin:"-(?=[ ]|$)",relevance:0},e.HASH_COMMENT_MODE,{beginKeywords:n,keywords:{literal:n}},m,{className:"number",begin:e.C_NUMBER_RE+"\\b",relevance:0},_,N,E,o],r=[...l];return r.pop(),r.push(g),c.contains=r,{name:"YAML",case_insensitive:!0,aliases:["yml"],contains:l}}i.registerLanguage("json",S);i.registerLanguage("yaml",v);const M={class:"code-viewer"},I=["lang","innerHTML"],$=R({__name:"FormattedCodeViewer",props:{lang:{},content:{}},setup(e){const n=e,t=d(()=>{let a="";try{return n.lang==="yaml"?a=u.dump(n.content,{indent:2}):a=JSON.stringify(n.content,null,2),i.highlight(a,{language:n.lang||"json"}).value}catch{return a}});return(a,s)=>(A(),p("pre",M,[O("code",{lang:n.lang||"json",innerHTML:t.value},null,8,I)]))}});export{$ as _};
