import { charat as e, from as t, strlen as n, substr as r, trim as i } from "./Utility.js";
//#region ../../node_modules/stylis/src/Tokenizer.js
var a = 1, o = 1, s = 0, c = 0, l = 0, u = "";
function d(e, t, n, r, i, s, c, l) {
	return {
		value: e,
		root: t,
		parent: n,
		type: r,
		props: i,
		children: s,
		line: a,
		column: o,
		length: c,
		return: "",
		siblings: l
	};
}
function f() {
	return l;
}
function p() {
	return l = c > 0 ? e(u, --c) : 0, o--, l === 10 && (o = 1, a--), l;
}
function m() {
	return l = c < s ? e(u, c++) : 0, o++, l === 10 && (o = 1, a++), l;
}
function h() {
	return e(u, c);
}
function g() {
	return c;
}
function _(e, t) {
	return r(u, e, t);
}
function v(e) {
	switch (e) {
		case 0:
		case 9:
		case 10:
		case 13:
		case 32: return 5;
		case 33:
		case 43:
		case 44:
		case 47:
		case 62:
		case 64:
		case 126:
		case 59:
		case 123:
		case 125: return 4;
		case 58: return 3;
		case 34:
		case 39:
		case 40:
		case 91: return 2;
		case 41:
		case 93: return 1;
	}
	return 0;
}
function y(e) {
	return a = o = 1, s = n(u = e), c = 0, [];
}
function b(e) {
	return u = "", e;
}
function x(e) {
	return i(_(c - 1, w(e === 91 ? e + 2 : e === 40 ? e + 1 : e)));
}
function S(e) {
	for (; (l = h()) && l < 33;) m();
	return v(e) > 2 || v(l) > 3 ? "" : " ";
}
function C(e, t) {
	for (; --t && m() && !(l < 48 || l > 102 || l > 57 && l < 65 || l > 70 && l < 97););
	return _(e, g() + (t < 6 && h() == 32 && m() == 32));
}
function w(e) {
	for (; m();) switch (l) {
		case e: return c;
		case 34:
		case 39:
			e !== 34 && e !== 39 && w(l);
			break;
		case 40:
			e === 41 && w(e);
			break;
		case 92:
			m();
			break;
	}
	return c;
}
function T(e, n) {
	for (; m() && e + l !== 57 && !(e + l === 84 && h() === 47););
	return "/*" + _(n, c - 1) + "*" + t(e === 47 ? e : m());
}
function E(e) {
	for (; !v(h());) m();
	return _(e, c);
}
//#endregion
export { y as alloc, g as caret, f as char, T as commenter, b as dealloc, x as delimit, C as escaping, E as identifier, m as next, d as node, h as peek, p as prev, v as token, S as whitespace };
