import{n as e}from"./rolldown-runtime-DkW27tQK.js";function t(e){for(var t={},n=0,r=e.length;n]/)?(e.eat(/[\<\>]/),`atom`):e.eat(/[\+\-\*\/\&\|\:\!]/)?`atom`:e.eat(/[a-zA-Z$@_\xa1-\uffff]/)?(e.eatWhile(/[\w$\xa1-\uffff]/),e.eat(/[\?\!\=]/),`atom`):`operator`;if(r==`@`&&e.match(/^@?[a-zA-Z_\xa1-\uffff]/))return e.eat(`@`),e.eatWhile(/[\w\xa1-\uffff]/),`propertyName`;if(r==`$`)return e.eat(/[a-zA-Z_]/)?e.eatWhile(/[\w]/):e.eat(/\d/)?e.eat(/\d/):e.next(),`variableName.special`;if(/[a-zA-Z_\xa1-\uffff]/.test(r))return e.eatWhile(/[\w\xa1-\uffff]/),e.eat(/[\?\!]/),e.eat(`:`)?`atom`:`variable`;if(r==`|`&&(t.varList||t.lastTok==`{`||t.lastTok==`do`))return g=`|`,null;if(/[\(\)\[\]{}\\;]/.test(r))return g=r,null;if(r==`-`&&e.eat(`>`))return`operator`;if(/[=+\-\/*:\.^%<>~|]/.test(r)){var f=e.eatWhile(/[=+\-\/*:\.^%<>~|]/);return r==`.`&&!f&&(g=`.`),`operator`}return null}function i(e){for(var t=e.pos,n=0,r,i=!1,a=!1;(r=e.next())!=null;)if(a)a=!1;else{if(`[{(`.indexOf(r)>-1)n++;else if(`]})`.indexOf(r)>-1){if(n--,n<0)break}else if(r==`/`&&n==0){i=!0;break}a=r==`\\`}return e.backUp(e.pos-t),i}function a(e){return e||=1,function(t,n){if(t.peek()==`}`){if(e==1)return n.tokenize.pop(),n.tokenize[n.tokenize.length-1](t,n);n.tokenize[n.tokenize.length-1]=a(e-1)}else t.peek()==`{`&&(n.tokenize[n.tokenize.length-1]=a(e+1));return r(t,n)}}function o(){var e=!1;return function(t,n){return e?(n.tokenize.pop(),n.tokenize[n.tokenize.length-1](t,n)):(e=!0,r(t,n))}}function s(e,t,n,r){return function(i,s){var c=!1,l;for(s.context.type===`read-quoted-paused`&&(s.context=s.context.prev,i.eat(`}`));(l=i.next())!=null;){if(l==e&&(r||!c)){s.tokenize.pop();break}if(n&&l==`#`&&!c){if(i.eat(`{`)){e==`}`&&(s.context={prev:s.context,type:`read-quoted-paused`}),s.tokenize.push(a());break}if(/[@\$]/.test(i.peek())){s.tokenize.push(o());break}}c=!c&&l==`\\`}return t}}function c(e,t){return function(n,r){return t&&n.eatSpace(),n.match(e)?r.tokenize.pop():n.skipToEnd(),`string`}}function l(e,t){return e.sol()&&e.match(`=end`)&&e.eol()&&t.tokenize.pop(),e.skipToEnd(),`comment`}var u,d,f,p,m,h,g,_;function v(){return(v=e((()=>{u=`alias.and.BEGIN.begin.break.case.class.def.defined?.do.else.elsif.END.end.ensure.false.for.if.in.module.next.not.or.redo.rescue.retry.return.self.super.then.true.undef.unless.until.when.while.yield.nil.raise.throw.catch.fail.loop.callcc.caller.lambda.proc.public.protected.private.require.load.require_relative.extend.autoload.__END__.__FILE__.__LINE__.__dir__`.split(`.`),d=t(u),f=t([`def`,`class`,`case`,`for`,`while`,`until`,`module`,`catch`,`loop`,`proc`,`begin`]),p=t([`end`,`until`]),m={"[":`]`,"{":`}`,"(":`)`},h={"]":`[`,"}":`{`,")":`(`},_={name:`ruby`,startState:function(e){return{tokenize:[r],indented:0,context:{type:`top`,indented:-e},continuedLine:!1,lastTok:null,varList:!1}},token:function(e,t){g=null,e.sol()&&(t.indented=e.indentation());var n=t.tokenize[t.tokenize.length-1](e,t),r,i=g;if(n==`variable`){var a=e.current();n=t.lastTok==`.`?`property`:d.propertyIsEnumerable(e.current())?`keyword`:/^[A-Z]/.test(a)?`tag`:t.lastTok==`def`||t.lastTok==`class`||t.varList?`def`:`variable`,n==`keyword`&&(i=a,f.propertyIsEnumerable(a)?r=`indent`:p.propertyIsEnumerable(a)?r=`dedent`:((a==`if`||a==`unless`)&&e.column()==e.indentation()||a==`do`&&t.context.indented