import{n as e}from"./css-7q0k7BOF.js";var t=new Set(e.properties),n=new Set(e.colors),r=new Set(e.values),i=new Set(e.fonts);function a(e){return RegExp(`^`+e.join(`|`))}var o=RegExp(`^`+[`true`,`false`,`null`,`auto`].join(`|`)),s=a([`\\(`,`\\)`,`=`,`>`,`<`,`==`,`>=`,`<=`,`\\+`,`-`,`\\!=`,`/`,`\\*`,`%`,`and`,`or`,`not`,`;`,`\\{`,`\\}`,`:`]),c=/^::?[a-zA-Z_][\w\-]*/,l;function u(e){return!e.peek()||e.match(/\s+$/,!1)}function d(e,t){let n=e.peek();return n===`)`?(e.next(),t.tokenizer=_,`operator`):n===`(`?(e.next(),e.eatSpace(),`operator`):n===`'`||n===`"`?(t.tokenizer=p(e.next()),`string`):(t.tokenizer=p(`)`,!1),`string`)}function f(e,t){return function(n,r){return n.sol()&&n.indentation()<=e?(r.tokenizer=_,_(n,r)):(t&&n.skipTo(`*/`)?(n.next(),n.next(),r.tokenizer=_):n.skipToEnd(),`comment`)}}function p(e,t){t??=!0;function n(r,i){let a=r.next(),o=r.peek(),s=r.string.charAt(r.pos-2);return a!==`\\`&&o===e||a===e&&s!==`\\`?(a!==e&&t&&r.next(),u(r)&&(i.cursorHalf=0),i.tokenizer=_,`string`):a===`#`&&o===`{`?(i.tokenizer=m(n),r.next(),`operator`):`string`}return n}function m(e){return function(t,n){return t.peek()===`}`?(t.next(),n.tokenizer=e,`operator`):_(t,n)}}function h(e,t){if(e.indentCount==0){e.indentCount++;let n=e.scopes[0].offset+t.indentUnit;e.scopes.unshift({offset:n})}}function g(e){e.scopes.length!=1&&e.scopes.shift()}function _(e,a){let v=e.peek();if(e.match(`/*`))return a.tokenizer=f(e.indentation(),!0),a.tokenizer(e,a);if(e.match(`//`))return a.tokenizer=f(e.indentation(),!1),a.tokenizer(e,a);if(e.match(`#{`))return a.tokenizer=m(_),`operator`;if(v===`"`||v===`'`)return e.next(),a.tokenizer=p(v),`string`;if(a.cursorHalf){if(v===`#`&&(e.next(),e.match(/[0-9a-fA-F]{6}|[0-9a-fA-F]{3}/))||e.match(/^-?[0-9\.]+/))return u(e)&&(a.cursorHalf=0),`number`;if(e.match(/^(px|em|in)\b/))return u(e)&&(a.cursorHalf=0),`unit`;if(e.match(o))return u(e)&&(a.cursorHalf=0),`keyword`;if(e.match(/^url/)&&e.peek()===`(`)return a.tokenizer=d,u(e)&&(a.cursorHalf=0),`atom`;if(v===`$`)return e.next(),e.eatWhile(/[\w-]/),u(e)&&(a.cursorHalf=0),`variable-2`;if(v===`!`)return e.next(),a.cursorHalf=0,e.match(/^[\w]+/)?`keyword`:`operator`;if(e.match(s))return u(e)&&(a.cursorHalf=0),`operator`;if(e.eatWhile(/[\w-]/))return u(e)&&(a.cursorHalf=0),l=e.current().toLowerCase(),r.has(l)?`atom`:n.has(l)?`keyword`:t.has(l)?(a.prevProp=e.current().toLowerCase(),`property`):`tag`;if(u(e))return a.cursorHalf=0,null}else{if(v===`-`&&e.match(/^-\w+-/))return`meta`;if(v===`.`){if(e.next(),e.match(/^[\w-]+/))return h(a,e),`qualifier`;if(e.peek()===`#`)return h(a,e),`tag`}if(v===`#`){if(e.next(),e.match(/^[\w-]+/))return h(a,e),`builtin`;if(e.peek()===`#`)return h(a,e),`tag`}if(v===`$`)return e.next(),e.eatWhile(/[\w-]/),`variable-2`;if(e.match(/^-?[0-9\.]+/))return`number`;if(e.match(/^(px|em|in)\b/))return`unit`;if(e.match(o))return`keyword`;if(e.match(/^url/)&&e.peek()===`(`)return a.tokenizer=d,`atom`;if(v===`=`&&e.match(/^=[\w-]+/))return h(a,e),`meta`;if(v===`+`&&e.match(/^\+[\w-]+/))return`meta`;if(v===`@`&&e.match(`@extend`)&&(e.match(/\s*[\w]/)||g(a)),e.match(/^@(else if|if|media|else|for|each|while|mixin|function)/))return h(a,e),`def`;if(v===`@`)return e.next(),e.eatWhile(/[\w-]/),`def`;if(e.eatWhile(/[\w-]/))if(e.match(/ *: *[\w-\+\$#!\("']/,!1)){l=e.current().toLowerCase();let n=a.prevProp+`-`+l;return t.has(n)?`property`:t.has(l)?(a.prevProp=l,`property`):i.has(l)?`property`:`tag`}else if(e.match(/ *:/,!1))return h(a,e),a.cursorHalf=1,a.prevProp=e.current().toLowerCase(),`property`;else if(e.match(/ *,/,!1))return`tag`;else return h(a,e),`tag`;if(v===`:`)return e.match(c)?`type`:(e.next(),a.cursorHalf=1,`operator`)}return e.match(s)?`operator`:(e.next(),null)}function v(e,t){e.sol()&&(t.indentCount=0);let n=t.tokenizer(e,t),r=e.current();if((r===`@return`||r===`}`)&&g(t),n!==null){let n=e.pos-r.length+e.indentUnit*t.indentCount,i=[];for(let e=0;e<t.scopes.length;e++){let r=t.scopes[e];r.offset<=n&&i.push(r)}t.scopes=i}return n}var y={name:`sass`,startState:function(){return{tokenizer:_,scopes:[{offset:0,type:`sass`}],indentCount:0,cursorHalf:0,definedVars:[],definedMixins:[]}},token:function(e,t){let n=v(e,t);return t.lastToken={style:n,content:e.current()},n},indent:function(e){return e.scopes[0].offset},languageData:{commentTokens:{line:`//`,block:{open:`/*`,close:`*/`}},autocomplete:e.all}};export{y as sass};