import{S as s}from"./TextViewer-a959e5a3.js";import"./useSetting-bf1f702c.js";import"./index-25eb6331.js";import"./file-5139c625.js";import"./request-14d7fed5.js";import"./index-3bef6acb.js";import"./path-8ad564a3.js";import"./base-00eb0fe9.js";/* empty css                */import"./dialog-66decf59.js";import"./index-db57f3ab.js";import"./vnode-761469ca.js";import"./scroll-044a6ede.js";import"./button-c2afb424.js";import"./overlay-25bb32bf.js";import"./refs-e3c707bd.js";/* empty css                     *//* empty css               *//* empty css                  */import"./dropdown-item-13559a59.js";import"./index-51e1cffc.js";import"./index-b7ba0c9a.js";import"./dropdown-8894c5a8.js";import"./index-0746525e.js";import"./_initCloneObject-55db8b76.js";import"./_plugin-vue_export-helper-c27b6911.js";import"./directive-77ef4fb1.js";import"./index-98eb1092.js";import"./validator-551b2058.js";import"./index-02f3ff91.js";import"./index-1c392315.js";import"./index-73ac7f16.js";import"./strings-59e484a0.js";import"./debounce-8de7dc13.js";import"./index-272fcf3f.js";import"./useFileUpload-914f2d00.js";import"./common-9cc21621.js";function f(e){for(var r={},i=0;i<e.length;++i)r[e[i]]=!0;return r}var x=["NULL","NA","Inf","NaN","NA_integer_","NA_real_","NA_complex_","NA_character_","TRUE","FALSE"],b=["list","quote","bquote","eval","return","call","parse","deparse"],g=["if","else","repeat","while","function","for","in","next","break"],y=["if","else","repeat","while","function","for"],h=f(x),N=f(b),A=f(g),E=f(y),d=/[+\-*\/^<>=!&|~$:]/,o;function a(e,r){o=null;var i=e.next();if(i=="#")return e.skipToEnd(),"comment";if(i=="0"&&e.eat("x"))return e.eatWhile(/[\da-f]/i),"number";if(i=="."&&e.eat(/\d/))return e.match(/\d*(?:e[+\-]?\d+)?/),"number";if(/\d/.test(i))return e.match(/\d*(?:\.\d+)?(?:e[+\-]\d+)?L?/),"number";if(i=="'"||i=='"')return r.tokenize=I(i),"string";if(i=="`")return e.match(/[^`]+`/),"string.special";if(i=="."&&e.match(/.(?:[.]|\d+)/))return"keyword";if(/[a-zA-Z\.]/.test(i)){e.eatWhile(/[\w\.]/);var n=e.current();return h.propertyIsEnumerable(n)?"atom":A.propertyIsEnumerable(n)?(E.propertyIsEnumerable(n)&&!e.match(/\s*if(\s+|$)/,!1)&&(o="block"),"keyword"):N.propertyIsEnumerable(n)?"builtin":"variable"}else return i=="%"?(e.skipTo("%")&&e.next(),"variableName.special"):i=="<"&&e.eat("-")||i=="<"&&e.match("<-")||i=="-"&&e.match(/>>?/)||i=="="&&r.ctx.argList?"operator":d.test(i)?(i=="$"||e.eatWhile(d),"operator"):/[\(\){}\[\];]/.test(i)?(o=i,i==";"?"punctuation":null):null}function I(e){return function(r,i){if(r.eat("\\")){var n=r.next();return n=="x"?r.match(/^[a-f0-9]{2}/i):(n=="u"||n=="U")&&r.eat("{")&&r.skipTo("}")?r.next():n=="u"?r.match(/^[a-f0-9]{4}/i):n=="U"?r.match(/^[a-f0-9]{8}/i):/[0-7]/.test(n)&&r.match(/^[0-7]{1,2}/),"string.special"}else{for(var t;(t=r.next())!=null;){if(t==e){i.tokenize=a;break}if(t=="\\"){r.backUp(1);break}}return"string"}}}var k=1,p=2,u=4;function l(e,r,i){e.ctx={type:r,indent:e.indent,flags:0,column:i.column(),prev:e.ctx}}function v(e,r){var i=e.ctx;e.ctx={type:i.type,indent:i.indent,flags:i.flags|r,column:i.column,prev:i.prev}}function c(e){e.indent=e.ctx.indent,e.ctx=e.ctx.prev}const L={name:"r",startState:function(e){return{tokenize:a,ctx:{type:"top",indent:-e,flags:p},indent:0,afterIdent:!1}},token:function(e,r){if(e.sol()&&(r.ctx.flags&3||(r.ctx.flags|=p),r.ctx.flags&u&&c(r),r.indent=e.indentation()),e.eatSpace())return null;var i=r.tokenize(e,r);return i!="comment"&&!(r.ctx.flags&p)&&v(r,k),(o==";"||o=="{"||o=="}")&&r.ctx.type=="block"&&c(r),o=="{"?l(r,"}",e):o=="("?(l(r,")",e),r.afterIdent&&(r.ctx.argList=!0)):o=="["?l(r,"]",e):o=="block"?l(r,"block",e):o==r.ctx.type?c(r):r.ctx.type=="block"&&i!="comment"&&v(r,u),r.afterIdent=i=="variable"||i=="keyword",i},indent:function(e,r,i){if(e.tokenize!=a)return 0;var n=r&&r.charAt(0),t=e.ctx,m=n==t.type;return t.flags&u&&(t=t.prev),t.type=="block"?t.indent+(n=="{"?0:i.unit):t.flags&k?t.column+(m?0:1):t.indent+(m?0:i.unit)},languageData:{wordChars:".",commentTokens:{line:"#"},autocomplete:x.concat(b,g)}};function ce(){return s.define(L)}export{ce as default};
