/* Copyright (c) 2006, Ivan Sagalaev. All rights reserved. SPDX-License-Identifier: BSD-3-Clause */ 'use strict';function escape$$module$third_party$javascript$highlightjs$src$lib$regex(value){return new RegExp(value.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&"),"m")}function source$$module$third_party$javascript$highlightjs$src$lib$regex(re){if(!re)return null;if(typeof re==="string")return re;return re.source}function lookahead$$module$third_party$javascript$highlightjs$src$lib$regex(re){return concat$$module$third_party$javascript$highlightjs$src$lib$regex("(?=",re,")")} function anyNumberOfTimes$$module$third_party$javascript$highlightjs$src$lib$regex(re){return concat$$module$third_party$javascript$highlightjs$src$lib$regex("(",re,")*")}function optional$$module$third_party$javascript$highlightjs$src$lib$regex(re){return concat$$module$third_party$javascript$highlightjs$src$lib$regex("(",re,")?")} function concat$$module$third_party$javascript$highlightjs$src$lib$regex(...args){const joined=args.map(x=>{return source$$module$third_party$javascript$highlightjs$src$lib$regex(x)}).join("");return joined}function either$$module$third_party$javascript$highlightjs$src$lib$regex(...args){const joined="("+args.map(x=>{return source$$module$third_party$javascript$highlightjs$src$lib$regex(x)}).join("|")+")";return joined} function countMatchGroups$$module$third_party$javascript$highlightjs$src$lib$regex(re){return(new RegExp(re.toString()+"|")).exec("").length-1}function startsWith$$module$third_party$javascript$highlightjs$src$lib$regex(re,lexeme){const match=re&&re.exec(lexeme);return match&&match.index===0} function join$$module$third_party$javascript$highlightjs$src$lib$regex(regexps,separator="|"){const backreferenceRe=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;let numCaptures=0;let ret="";for(let i=0;i0)ret=ret+separator;ret=ret+"(";for(;re.length>0;){const match=backreferenceRe.exec(re);if(match==null){ret=ret+re;break}ret=ret+re.substring(0, match.index);re=re.substring(match.index+match[0].length);if(match[0][0]==="\\"&&match[1])ret=ret+("\\"+String(Number(match[1])+offset));else{ret=ret+match[0];if(match[0]==="(")numCaptures++}}ret=ret+")"}return ret}var module$third_party$javascript$highlightjs$src$lib$regex={};module$third_party$javascript$highlightjs$src$lib$regex.anyNumberOfTimes=anyNumberOfTimes$$module$third_party$javascript$highlightjs$src$lib$regex;module$third_party$javascript$highlightjs$src$lib$regex.concat=concat$$module$third_party$javascript$highlightjs$src$lib$regex; module$third_party$javascript$highlightjs$src$lib$regex.countMatchGroups=countMatchGroups$$module$third_party$javascript$highlightjs$src$lib$regex;module$third_party$javascript$highlightjs$src$lib$regex.either=either$$module$third_party$javascript$highlightjs$src$lib$regex;module$third_party$javascript$highlightjs$src$lib$regex.escape=escape$$module$third_party$javascript$highlightjs$src$lib$regex;module$third_party$javascript$highlightjs$src$lib$regex.join=join$$module$third_party$javascript$highlightjs$src$lib$regex; module$third_party$javascript$highlightjs$src$lib$regex.lookahead=lookahead$$module$third_party$javascript$highlightjs$src$lib$regex;module$third_party$javascript$highlightjs$src$lib$regex.optional=optional$$module$third_party$javascript$highlightjs$src$lib$regex;module$third_party$javascript$highlightjs$src$lib$regex.source=source$$module$third_party$javascript$highlightjs$src$lib$regex;module$third_party$javascript$highlightjs$src$lib$regex.startsWith=startsWith$$module$third_party$javascript$highlightjs$src$lib$regex;var $jscompDefaultExport$$module$third_party$javascript$highlightjs$src$languages$bash=function(hljs){const VAR={};const BRACED_VAR={begin:/\$\{/,end:/\}/,contains:["self",{begin:/:-/,contains:[VAR]}]};Object.assign(VAR,{className:"variable",variants:[{begin:concat$$module$third_party$javascript$highlightjs$src$lib$regex(/\$[\w\d#@][\w\d_]*/,`(?![\\w\\d])(?![$])`)},BRACED_VAR]});const SUBST={className:"subst",begin:/\$\(/,end:/\)/,contains:[hljs.BACKSLASH_ESCAPE]};const HERE_DOC={begin:/<<-?\s*(?=\w+)/, starts:{contains:[hljs.END_SAME_AS_BEGIN({begin:/(\w+)/,end:/(\w+)/,className:"string"})]}};const QUOTE_STRING={className:"string",begin:/"/,end:/"/,contains:[hljs.BACKSLASH_ESCAPE,VAR,SUBST]};SUBST.contains.push(QUOTE_STRING);const ESCAPED_QUOTE={className:"",begin:/\\"/};const APOS_STRING={className:"string",begin:/'/,end:/'/};const ARITHMETIC={begin:/\$\(\(/,end:/\)\)/,contains:[{begin:/\d+#[0-9a-f]+/,className:"number"},hljs.NUMBER_MODE,VAR]};const SH_LIKE_SHELLS=["fish","bash","zsh","sh","csh", "ksh","tcsh","dash","scsh"];const KNOWN_SHEBANG=hljs.SHEBANG({binary:`(${SH_LIKE_SHELLS.join("|")})`,relevance:10});const FUNCTION={className:"function",begin:/\w[\w\d_]*\s*\(\s*\)\s*\{/,returnBegin:true,contains:[hljs.inherit(hljs.TITLE_MODE,{begin:/\w[\w\d_]*/})],relevance:0};return{name:"Bash",aliases:["sh","zsh"],keywords:{$pattern:/\b[a-z._-]+\b/,keyword:"if then else elif fi for while in do done case esac function",literal:"true false",built_in:"break cd continue eval exec exit export getopts hash pwd readonly return shift test times "+ "trap umask unset "+"alias bind builtin caller command declare echo enable help let local logout mapfile printf "+"read readarray source type typeset ulimit unalias "+"set shopt "+"autoload bg bindkey bye cap chdir clone comparguments compcall compctl compdescribe compfiles "+"compgroups compquote comptags comptry compvalues dirs disable disown echotc echoti emulate "+"fc fg float functions getcap getln history integer jobs kill limit log noglob popd print "+"pushd pushln rehash sched setcap setopt stat suspend ttyctl unfunction unhash unlimit "+ "unsetopt vared wait whence where which zcompile zformat zftp zle zmodload zparseopts zprof "+"zpty zregexparse zsocket zstyle ztcp"},contains:[KNOWN_SHEBANG,hljs.SHEBANG(),FUNCTION,ARITHMETIC,hljs.HASH_COMMENT_MODE,HERE_DOC,QUOTE_STRING,ESCAPED_QUOTE,APOS_STRING,VAR]}};var module$third_party$javascript$highlightjs$src$languages$bash={};module$third_party$javascript$highlightjs$src$languages$bash.default=$jscompDefaultExport$$module$third_party$javascript$highlightjs$src$languages$bash;globalThis.hljs_bash=$jscompDefaultExport$$module$third_party$javascript$highlightjs$src$languages$bash;var module$third_party$javascript$highlightjs$export_shims$export_bash={};