import{__exports as e}from"../../../_virtual/tokenize.mjs";import{__require as a}from"./tokenTypes.mjs";var r;function t(){return r||(r=1,function(e){e.__esModule=!0,e.FIELDS=void 0,e.default=function(e){var a,r,t,n,o,c,l,i,u,d,p,h,b=[],m=e.css.valueOf(),w=m.length,g=-1,_=1,v=0,O=0;function k(a,r){if(!e.safe)throw e.error("Unclosed "+a,_,v-g,v);i=(m+=r).length-1}for(;v<w;){switch((a=m.charCodeAt(v))===s.newline&&(g=v,_+=1),a){case s.space:case s.tab:case s.newline:case s.cr:case s.feed:i=v;do{i+=1,(a=m.charCodeAt(i))===s.newline&&(g=i,_+=1)}while(a===s.space||a===s.newline||a===s.tab||a===s.cr||a===s.feed);h=s.space,t=_,r=i-g-1,O=i;break;case s.plus:case s.greaterThan:case s.tilde:case s.pipe:i=v;do{i+=1,a=m.charCodeAt(i)}while(a===s.plus||a===s.greaterThan||a===s.tilde||a===s.pipe);h=s.combinator,t=_,r=v-g,O=i;break;case s.asterisk:case s.ampersand:case s.bang:case s.comma:case s.equals:case s.dollar:case s.caret:case s.openSquare:case s.closeSquare:case s.colon:case s.semicolon:case s.openParenthesis:case s.closeParenthesis:h=a,t=_,r=v-g,O=(i=v)+1;break;case s.singleQuote:case s.doubleQuote:p=a===s.singleQuote?"'":'"',i=v;do{for(n=!1,-1===(i=m.indexOf(p,i+1))&&k("quote",p),o=i;m.charCodeAt(o-1)===s.backslash;)o-=1,n=!n}while(n);h=s.str,t=_,r=v-g,O=i+1;break;default:a===s.slash&&m.charCodeAt(v+1)===s.asterisk?(0===(i=m.indexOf("*/",v+2)+1)&&k("comment","*/"),(c=(l=m.slice(v,i+1).split("\n")).length-1)>0?(u=_+c,d=i-l[c].length):(u=_,d=g),h=s.comment,_=u,t=u,r=i-d):a===s.slash?(h=a,t=_,r=v-g,O=(i=v)+1):(i=f(m,v),h=s.word,t=_,r=i-g),O=i+1}b.push([h,_,v-g,t,r,v,O]),d&&(g=d,d=null),v=O}return b};var r,t,s=function(e,a){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var r=n(a);if(r&&r.has(e))return r.get(e);var t={},s=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if("default"!==o&&Object.prototype.hasOwnProperty.call(e,o)){var c=s?Object.getOwnPropertyDescriptor(e,o):null;c&&(c.get||c.set)?Object.defineProperty(t,o,c):t[o]=e[o]}t.default=e,r&&r.set(e,t);return t}(a());function n(e){if("function"!=typeof WeakMap)return null;var a=new WeakMap,r=new WeakMap;return(n=function(e){return e?r:a})(e)}for(var o=((r={})[s.tab]=!0,r[s.newline]=!0,r[s.cr]=!0,r[s.feed]=!0,r),c=((t={})[s.space]=!0,t[s.tab]=!0,t[s.newline]=!0,t[s.cr]=!0,t[s.feed]=!0,t[s.ampersand]=!0,t[s.asterisk]=!0,t[s.bang]=!0,t[s.comma]=!0,t[s.colon]=!0,t[s.semicolon]=!0,t[s.openParenthesis]=!0,t[s.closeParenthesis]=!0,t[s.openSquare]=!0,t[s.closeSquare]=!0,t[s.singleQuote]=!0,t[s.doubleQuote]=!0,t[s.plus]=!0,t[s.pipe]=!0,t[s.tilde]=!0,t[s.greaterThan]=!0,t[s.equals]=!0,t[s.dollar]=!0,t[s.caret]=!0,t[s.slash]=!0,t),l={},i="0123456789abcdefABCDEF",u=0;u<22;u++)l[i.charCodeAt(u)]=!0;function f(e,a){var r,t=a;do{if(r=e.charCodeAt(t),c[r])return t-1;r===s.backslash?t=d(e,t)+1:t++}while(t<e.length);return t-1}function d(e,a){var r=a,t=e.charCodeAt(r+1);if(o[t]);else if(l[t]){var n=0;do{r++,n++,t=e.charCodeAt(r+1)}while(l[t]&&n<6);n<6&&t===s.space&&r++}else r++;return r}e.FIELDS={TYPE:0,START_LINE:1,START_COL:2,END_LINE:3,END_COL:4,START_POS:5,END_POS:6}}(e)),e}export{t as __require};