'use strict';

var chunkKHF2VXWO_cjs = require('./chunk-KHF2VXWO.cjs');

// src/interpreter/errors/codes/color.ts
var ColorErrorCode = /* @__PURE__ */ ((ColorErrorCode2) => {
  ColorErrorCode2["INITIALIZER_CRASHED"] = "COLOR_INITIALIZER_CRASHED";
  ColorErrorCode2["INITIALIZER_CONSTRUCT_FAILED"] = "COLOR_INITIALIZER_CONSTRUCT_FAILED";
  ColorErrorCode2["INITIALIZER_NOT_FOUND"] = "COLOR_INITIALIZER_NOT_FOUND";
  ColorErrorCode2["CONVERSION_TARGET_NOT_FOUND"] = "COLOR_CONVERSION_TARGET_NOT_FOUND";
  ColorErrorCode2["SOURCE_URI_NOT_FOUND"] = "COLOR_SOURCE_URI_NOT_FOUND";
  ColorErrorCode2["TARGET_URI_NOT_FOUND"] = "COLOR_TARGET_URI_NOT_FOUND";
  ColorErrorCode2["CONVERSION_ERROR"] = "COLOR_CONVERSION_ERROR";
  ColorErrorCode2["STRING_VALUE_ASSIGNMENT"] = "COLOR_STRING_VALUE_ASSIGNMENT";
  ColorErrorCode2["ATTRIBUTE_CHAIN_TOO_LONG"] = "COLOR_ATTRIBUTE_CHAIN_TOO_LONG";
  ColorErrorCode2["MISSING_SPEC"] = "COLOR_MISSING_SPEC";
  ColorErrorCode2["MISSING_SCHEMA"] = "COLOR_MISSING_SCHEMA";
  ColorErrorCode2["MISSING_ATTRIBUTE_SCHEMA"] = "COLOR_MISSING_ATTRIBUTE_SCHEMA";
  ColorErrorCode2["INVALID_ATTRIBUTE_TYPE"] = "COLOR_INVALID_ATTRIBUTE_TYPE";
  ColorErrorCode2["INVALID_ALPHA_VALUE"] = "COLOR_INVALID_ALPHA_VALUE";
  return ColorErrorCode2;
})(ColorErrorCode || {});

// src/interpreter/errors/codes/config.ts
var ConfigErrorCode = /* @__PURE__ */ ((ConfigErrorCode2) => {
  ConfigErrorCode2["NO_SPEC_FOUND"] = "CFG_NO_SPEC_FOUND";
  ConfigErrorCode2["NO_TYPE_FOUND"] = "CFG_NO_TYPE_FOUND";
  return ConfigErrorCode2;
})(ConfigErrorCode || {});

// src/interpreter/errors/codes/functions.ts
var FunctionsErrorCode = /* @__PURE__ */ ((FunctionsErrorCode2) => {
  FunctionsErrorCode2["EXPECTS_NUMBER_ARGUMENTS"] = "FN_EXPECTS_NUMBER_ARGUMENTS";
  FunctionsErrorCode2["REQUIRES_MIN_ARGUMENTS"] = "FN_REQUIRES_MIN_ARGUMENTS";
  FunctionsErrorCode2["EXPECTS_TYPE_ARGUMENT"] = "FN_EXPECTS_TYPE_ARGUMENT";
  FunctionsErrorCode2["DIVISION_BY_ZERO"] = "FN_DIVISION_BY_ZERO";
  FunctionsErrorCode2["ARGUMENT_OUT_OF_RANGE"] = "FN_ARGUMENT_OUT_OF_RANGE";
  FunctionsErrorCode2["INVALID_BASE"] = "FN_INVALID_BASE";
  FunctionsErrorCode2["PARSE_ERROR"] = "FN_PARSE_ERROR";
  FunctionsErrorCode2["UNIT_CONVERSION_FAILED"] = "FN_UNIT_CONVERSION_FAILED";
  FunctionsErrorCode2["NO_CONFIG_AVAILABLE"] = "FN_NO_CONFIG_AVAILABLE";
  FunctionsErrorCode2["FUNCTION_RETURNED_NULL"] = "FN_FUNCTION_RETURNED_NULL";
  FunctionsErrorCode2["EXECUTION_ERROR"] = "FN_EXECUTION_ERROR";
  return FunctionsErrorCode2;
})(FunctionsErrorCode || {});

// src/interpreter/errors/codes/interpreter.ts
var InterpreterErrorCode = /* @__PURE__ */ ((InterpreterErrorCode2) => {
  InterpreterErrorCode2["UNKNOWN_NODE_TYPE"] = "INT_UNKNOWN_NODE_TYPE";
  InterpreterErrorCode2["ARITHMETIC_REQUIRES_NUMBER"] = "INT_ARITHMETIC_REQUIRES_NUMBER";
  InterpreterErrorCode2["UNKNOWN_BINARY_OPERATOR"] = "INT_UNKNOWN_BINARY_OPERATOR";
  InterpreterErrorCode2["UNARY_MINUS_NULL"] = "INT_UNARY_MINUS_NULL";
  InterpreterErrorCode2["UNARY_PLUS_NON_NUMBER"] = "INT_UNARY_PLUS_NON_NUMBER";
  InterpreterErrorCode2["UNARY_NOT_NON_BOOLEAN"] = "INT_UNARY_NOT_NON_BOOLEAN";
  InterpreterErrorCode2["UNKNOWN_UNARY_OPERATOR"] = "INT_UNKNOWN_UNARY_OPERATOR";
  InterpreterErrorCode2["UNKNOWN_REFERENCE"] = "INT_UNKNOWN_REFERENCE";
  InterpreterErrorCode2["UNKNOWN_FUNCTION"] = "INT_UNKNOWN_FUNCTION";
  InterpreterErrorCode2["INVALID_VARIABLE_NAME"] = "INT_INVALID_VARIABLE_NAME";
  InterpreterErrorCode2["VARIABLE_ALREADY_DEFINED"] = "INT_VARIABLE_ALREADY_DEFINED";
  InterpreterErrorCode2["INVALID_VARIABLE_TYPE"] = "INT_INVALID_VARIABLE_TYPE";
  InterpreterErrorCode2["INVALID_VALUE_FOR_VARIABLE"] = "INT_INVALID_VALUE_FOR_VARIABLE";
  InterpreterErrorCode2["VARIABLE_NOT_FOUND"] = "INT_VARIABLE_NOT_FOUND";
  InterpreterErrorCode2["ASSIGNMENT_VALUE_NULL"] = "INT_ASSIGNMENT_VALUE_NULL";
  InterpreterErrorCode2["TYPE_MISMATCH"] = "INT_TYPE_MISMATCH";
  InterpreterErrorCode2["CANNOT_ASSIGN_TYPE"] = "INT_CANNOT_ASSIGN_TYPE";
  InterpreterErrorCode2["METHOD_RETURNED_NULL"] = "INT_METHOD_RETURNED_NULL";
  InterpreterErrorCode2["METHOD_NOT_FOUND"] = "INT_METHOD_NOT_FOUND";
  InterpreterErrorCode2["ATTRIBUTE_RETURNED_NULL"] = "INT_ATTRIBUTE_RETURNED_NULL";
  InterpreterErrorCode2["ATTRIBUTE_NOT_FOUND"] = "INT_ATTRIBUTE_NOT_FOUND";
  InterpreterErrorCode2["CANNOT_ACCESS_ATTRIBUTES"] = "INT_CANNOT_ACCESS_ATTRIBUTES";
  InterpreterErrorCode2["MAX_ITERATIONS_EXCEEDED"] = "INT_MAX_ITERATIONS_EXCEEDED";
  InterpreterErrorCode2["WHILE_CONDITION_NOT_BOOLEAN"] = "INT_WHILE_CONDITION_NOT_BOOLEAN";
  InterpreterErrorCode2["IF_CONDITION_NOT_BOOLEAN"] = "INT_IF_CONDITION_NOT_BOOLEAN";
  InterpreterErrorCode2["FOR_EACH_NOT_LIST"] = "INT_FOR_EACH_NOT_LIST";
  InterpreterErrorCode2["FOR_EACH_VARIABLE_SHADOW"] = "INT_FOR_EACH_VARIABLE_SHADOW";
  InterpreterErrorCode2["FOR_EACH_DUPLICATE_VARS"] = "INT_FOR_EACH_DUPLICATE_VARS";
  InterpreterErrorCode2["TEMPLATE_INVALID_TYPE"] = "INT_TEMPLATE_INVALID_TYPE";
  InterpreterErrorCode2["UNKNOWN_ERROR"] = "INT_UNKNOWN_ERROR";
  return InterpreterErrorCode2;
})(InterpreterErrorCode || {});

// src/interpreter/errors/codes/lexer.ts
var LexerErrorCode = /* @__PURE__ */ ((LexerErrorCode2) => {
  LexerErrorCode2["INVALID_CHARACTER"] = "LEXER_INVALID_CHARACTER";
  LexerErrorCode2["UNTERMINATED_STRING"] = "LEXER_UNTERMINATED_STRING";
  LexerErrorCode2["UNTERMINATED_REFERENCE"] = "LEXER_UNTERMINATED_REFERENCE";
  LexerErrorCode2["EMPTY_VARIABLE_NAME"] = "LEXER_EMPTY_VARIABLE_NAME";
  LexerErrorCode2["INVALID_HEX_COLOR_FORMAT"] = "LEXER_INVALID_HEX_COLOR_FORMAT";
  LexerErrorCode2["EXPECTED_CHARACTER"] = "LEXER_EXPECTED_CHARACTER";
  LexerErrorCode2["MULTIPLE_DECIMAL_POINTS"] = "LEXER_MULTIPLE_DECIMAL_POINTS";
  LexerErrorCode2["UNTERMINATED_TEMPLATE_STRING"] = "LEXER_UNTERMINATED_TEMPLATE_STRING";
  return LexerErrorCode2;
})(LexerErrorCode || {});

// src/interpreter/errors/codes/operations.ts
var OperationsErrorCode = /* @__PURE__ */ ((OperationsErrorCode2) => {
  OperationsErrorCode2["UNSUPPORTED_OPERAND_TYPE"] = "OP_UNSUPPORTED_OPERAND_TYPE";
  OperationsErrorCode2["CANNOT_MIX_UNITS"] = "OP_CANNOT_MIX_UNITS";
  OperationsErrorCode2["INCOMPATIBLE_TYPES"] = "OP_INCOMPATIBLE_TYPES";
  OperationsErrorCode2["CANNOT_COMPARE_UNITS"] = "OP_CANNOT_COMPARE_UNITS";
  OperationsErrorCode2["ORDERING_WITH_NULL"] = "OP_ORDERING_WITH_NULL";
  OperationsErrorCode2["LOGICAL_REQUIRES_BOOLEAN"] = "OP_LOGICAL_REQUIRES_BOOLEAN";
  OperationsErrorCode2["DIVISION_BY_ZERO"] = "OP_DIVISION_BY_ZERO";
  OperationsErrorCode2["UNIT_EXPONENT_NOT_SUPPORTED"] = "OP_UNIT_EXPONENT_NOT_SUPPORTED";
  return OperationsErrorCode2;
})(OperationsErrorCode || {});

// src/interpreter/errors/codes/parser.ts
var ParserErrorCode = /* @__PURE__ */ ((ParserErrorCode2) => {
  ParserErrorCode2["UNEXPECTED_TOKEN"] = "PARSER_UNEXPECTED_TOKEN";
  ParserErrorCode2["EXPECTED_TOKEN_TYPE"] = "PARSER_EXPECTED_TOKEN_TYPE";
  ParserErrorCode2["UNEXPECTED_END"] = "PARSER_UNEXPECTED_END";
  ParserErrorCode2["CONDITION_MUST_BE_BOOLEAN"] = "PARSER_CONDITION_MUST_BE_BOOLEAN";
  ParserErrorCode2["INVALID_SYNTAX"] = "PARSER_INVALID_SYNTAX";
  ParserErrorCode2["TOLERANT_REQUIRES_INLINE"] = "PARSER_TOLERANT_REQUIRES_INLINE";
  return ParserErrorCode2;
})(ParserErrorCode || {});

// src/interpreter/errors/codes/processor.ts
var ProcessorErrorCode = /* @__PURE__ */ ((ProcessorErrorCode2) => {
  ProcessorErrorCode2["TOKEN_NOT_FOUND"] = "PROC_TOKEN_NOT_FOUND";
  ProcessorErrorCode2["TOKEN_ALREADY_EXISTS"] = "PROC_TOKEN_ALREADY_EXISTS";
  ProcessorErrorCode2["CIRCULAR_DEPENDENCY"] = "PROC_CIRCULAR_DEPENDENCY";
  ProcessorErrorCode2["SUB_FIELD_NOT_RESOLVED"] = "PROC_SUB_FIELD_NOT_RESOLVED";
  ProcessorErrorCode2["DEPENDENCY_ERROR"] = "PROC_DEPENDENCY_ERROR";
  ProcessorErrorCode2["NO_THEMES_FOUND"] = "PROC_NO_THEMES_FOUND";
  ProcessorErrorCode2["THEME_NOT_FOUND"] = "PROC_THEME_NOT_FOUND";
  ProcessorErrorCode2["TOKEN_SET_NOT_FOUND"] = "PROC_TOKEN_SET_NOT_FOUND";
  ProcessorErrorCode2["TOKEN_SET_INVALID"] = "PROC_TOKEN_SET_INVALID";
  ProcessorErrorCode2["NO_SETS_TO_PROCESS"] = "PROC_NO_SETS_TO_PROCESS";
  ProcessorErrorCode2["MULTIPLE_SETS_NO_SELECTION"] = "PROC_MULTIPLE_SETS_NO_SELECTION";
  ProcessorErrorCode2["UNKNOWN_PARSING_ERROR"] = "PROC_UNKNOWN_PARSING_ERROR";
  ProcessorErrorCode2["RESOLVER_NOT_INITIALIZED"] = "PROC_RESOLVER_NOT_INITIALIZED";
  return ProcessorErrorCode2;
})(ProcessorErrorCode || {});

// src/interpreter/errors/codes/symbols.ts
var SymbolsErrorCode = /* @__PURE__ */ ((SymbolsErrorCode2) => {
  SymbolsErrorCode2["VALUE_MUST_BE_TYPE"] = "SYM_VALUE_MUST_BE_TYPE";
  SymbolsErrorCode2["VALUE_IS_NULL"] = "SYM_VALUE_IS_NULL";
  SymbolsErrorCode2["METHOD_NOT_FOUND"] = "SYM_METHOD_NOT_FOUND";
  SymbolsErrorCode2["MISSING_REQUIRED_ARGUMENT"] = "SYM_MISSING_REQUIRED_ARGUMENT";
  SymbolsErrorCode2["ATTRIBUTE_NOT_FOUND"] = "SYM_ATTRIBUTE_NOT_FOUND";
  SymbolsErrorCode2["CANNOT_SET_ATTRIBUTE"] = "SYM_CANNOT_SET_ATTRIBUTE";
  SymbolsErrorCode2["INVALID_RADIX"] = "SYM_INVALID_RADIX";
  SymbolsErrorCode2["RADIX_CONVERSION_ERROR"] = "SYM_RADIX_CONVERSION_ERROR";
  SymbolsErrorCode2["CANNOT_CONCATENATE"] = "SYM_CANNOT_CONCATENATE";
  SymbolsErrorCode2["CANNOT_SPLIT"] = "SYM_CANNOT_SPLIT";
  SymbolsErrorCode2["INDEX_OUT_OF_RANGE"] = "SYM_INDEX_OUT_OF_RANGE";
  SymbolsErrorCode2["KEY_MUST_BE_STRING"] = "SYM_KEY_MUST_BE_STRING";
  SymbolsErrorCode2["CANNOT_OPERATION_ON_TOKEN_TYPE"] = "SYM_CANNOT_OPERATION_ON_TOKEN_TYPE";
  SymbolsErrorCode2["INVALID_HEX_COLOR"] = "SYM_INVALID_HEX_COLOR";
  SymbolsErrorCode2["COLOR_MANAGER_NOT_AVAILABLE"] = "SYM_COLOR_MANAGER_NOT_AVAILABLE";
  SymbolsErrorCode2["INVALID_COLOR_VALUE"] = "SYM_INVALID_COLOR_VALUE";
  return SymbolsErrorCode2;
})(SymbolsErrorCode || {});

// src/interpreter/errors/codes/unit.ts
var UnitErrorCode = /* @__PURE__ */ ((UnitErrorCode2) => {
  UnitErrorCode2["CONVERSION_CRASHED"] = "UNIT_CONVERSION_CRASHED";
  UnitErrorCode2["SOURCE_URI_NOT_FOUND"] = "UNIT_SOURCE_URI_NOT_FOUND";
  UnitErrorCode2["RELATIVE_REQUIRES_TWO_NUMBERS"] = "UNIT_RELATIVE_REQUIRES_TWO_NUMBERS";
  UnitErrorCode2["NO_TO_ABSOLUTE_SCRIPT"] = "UNIT_NO_TO_ABSOLUTE_SCRIPT";
  UnitErrorCode2["TO_ABSOLUTE_MUST_RETURN_NUMBER"] = "UNIT_TO_ABSOLUTE_MUST_RETURN_NUMBER";
  UnitErrorCode2["CANNOT_CONVERT_MULTIPLE_RELATIVE"] = "UNIT_CANNOT_CONVERT_MULTIPLE_RELATIVE";
  UnitErrorCode2["NO_VALID_CONVERSION_PATH"] = "UNIT_NO_VALID_CONVERSION_PATH";
  return UnitErrorCode2;
})(UnitErrorCode || {});

// src/interpreter/errors/messages/en.ts
var messages = {
  // Lexer errors
  ["LEXER_INVALID_CHARACTER" /* INVALID_CHARACTER */]: (data) => `Invalid character '${data.char}' at position ${data.position}.${data.description ? ` ${data.description}` : ""}`,
  ["LEXER_UNTERMINATED_STRING" /* UNTERMINATED_STRING */]: (data) => `Unterminated string, missing '${data.quoteType}'.`,
  ["LEXER_UNTERMINATED_REFERENCE" /* UNTERMINATED_REFERENCE */]: "Unterminated reference, missing '}'.",
  ["LEXER_EMPTY_VARIABLE_NAME" /* EMPTY_VARIABLE_NAME */]: "Empty variable name.",
  ["LEXER_INVALID_HEX_COLOR_FORMAT" /* INVALID_HEX_COLOR_FORMAT */]: (data) => `Invalid hex color format: ${data.value}. Length should be ${data.expectedLength}.`,
  ["LEXER_EXPECTED_CHARACTER" /* EXPECTED_CHARACTER */]: (data) => `Expected character ${data.expected} got ${data.got}`,
  ["LEXER_MULTIPLE_DECIMAL_POINTS" /* MULTIPLE_DECIMAL_POINTS */]: (data) => `Invalid number '${data.value}': multiple decimal points.`,
  // Parser errors
  ["PARSER_UNEXPECTED_TOKEN" /* UNEXPECTED_TOKEN */]: (data) => `Unexpected token: ${data.token}`,
  ["PARSER_EXPECTED_TOKEN_TYPE" /* EXPECTED_TOKEN_TYPE */]: (data) => `Expected token type ${data.expected} but got ${data.got}`,
  ["PARSER_CONDITION_MUST_BE_BOOLEAN" /* CONDITION_MUST_BE_BOOLEAN */]: "If/elif condition must be a boolean",
  ["PARSER_INVALID_SYNTAX" /* INVALID_SYNTAX */]: (data) => data?.message ? String(data.message) : "Invalid syntax",
  ["PARSER_UNEXPECTED_END" /* UNEXPECTED_END */]: "Unexpected end of input",
  ["PARSER_TOLERANT_REQUIRES_INLINE" /* TOLERANT_REQUIRES_INLINE */]: "Tolerant mode only supports inline expressions. Use parse(true) for tolerant parsing.",
  // Interpreter errors
  ["INT_UNKNOWN_NODE_TYPE" /* UNKNOWN_NODE_TYPE */]: (data) => `No visit method for AST node type: ${data.nodeType}`,
  ["INT_ARITHMETIC_REQUIRES_NUMBER" /* ARITHMETIC_REQUIRES_NUMBER */]: (data) => `Arithmetic operator ${data.operator} requires Number or NumberWithUnit operands, got ${data.leftType} and ${data.rightType}.`,
  ["INT_UNKNOWN_BINARY_OPERATOR" /* UNKNOWN_BINARY_OPERATOR */]: (data) => `Unknown binary operator: ${data.operator} or type ${data.tokenType}`,
  ["INT_UNARY_MINUS_NULL" /* UNARY_MINUS_NULL */]: (data) => `Cannot apply unary '-' to a null ${data.symbolType}.`,
  ["INT_UNARY_PLUS_NON_NUMBER" /* UNARY_PLUS_NON_NUMBER */]: (data) => `Cannot apply unary '+' to non-number value: ${data.value}`,
  ["INT_UNARY_NOT_NON_BOOLEAN" /* UNARY_NOT_NON_BOOLEAN */]: (data) => `Cannot apply NOT to non-boolean value: ${data.value}.`,
  ["INT_UNKNOWN_UNARY_OPERATOR" /* UNKNOWN_UNARY_OPERATOR */]: (data) => `Unknown unary operator type: ${data.operator}`,
  ["INT_UNKNOWN_REFERENCE" /* UNKNOWN_REFERENCE */]: (data) => `Unknown reference: ${data.reference}`,
  ["INT_UNKNOWN_FUNCTION" /* UNKNOWN_FUNCTION */]: (data) => `Unknown function: '${data.functionName}'`,
  ["INT_INVALID_VARIABLE_NAME" /* INVALID_VARIABLE_NAME */]: (data) => `Invalid variable name '${data.name}'. Use a simple name (and underscores) without '.', '-', '['.`,
  ["INT_VARIABLE_ALREADY_DEFINED" /* VARIABLE_ALREADY_DEFINED */]: (data) => `Variable '${data.name}' already defined. Use a different name.`,
  ["INT_INVALID_VARIABLE_TYPE" /* INVALID_VARIABLE_TYPE */]: (data) => `Invalid variable type '${data.typeName}'. Use a valid type. (${data.validTypes})`,
  ["INT_INVALID_VALUE_FOR_VARIABLE" /* INVALID_VALUE_FOR_VARIABLE */]: (data) => `Invalid value '${data.value}' ('${data.type}') for variable '${data.name}'. Use a valid value.`,
  ["INT_VARIABLE_NOT_FOUND" /* VARIABLE_NOT_FOUND */]: (data) => `Variable '${data.name}' not found.`,
  ["INT_ASSIGNMENT_VALUE_NULL" /* ASSIGNMENT_VALUE_NULL */]: (data) => `Assignment value for '${data.identifier}' is null.`,
  ["INT_TYPE_MISMATCH" /* TYPE_MISMATCH */]: (data) => `Invalid value '${data.value}' (Found '${data.foundType}', expected '${data.expectedType}') for variable '${data.identifier}'. Use a valid value.`,
  ["INT_CANNOT_ASSIGN_TYPE" /* CANNOT_ASSIGN_TYPE */]: (data) => `Cannot assign ${data.valueType} to variable '${data.identifier}' of type ${data.variableType}.`,
  ["INT_METHOD_RETURNED_NULL" /* METHOD_RETURNED_NULL */]: (data) => `Method '${data.methodName}' returned null or undefined`,
  ["INT_METHOD_NOT_FOUND" /* METHOD_NOT_FOUND */]: (data) => `Method '${data.methodName}' not found on '${data.value}' (${data.type})`,
  ["INT_ATTRIBUTE_RETURNED_NULL" /* ATTRIBUTE_RETURNED_NULL */]: (data) => `Attribute '${data.attributeName}' returned null or undefined`,
  ["INT_ATTRIBUTE_NOT_FOUND" /* ATTRIBUTE_NOT_FOUND */]: (data) => `Attribute '${data.attributeName}' not found on '${data.value}' (${data.type})`,
  ["INT_CANNOT_ACCESS_ATTRIBUTES" /* CANNOT_ACCESS_ATTRIBUTES */]: (data) => `Cannot access attributes on ${data.type}`,
  ["INT_MAX_ITERATIONS_EXCEEDED" /* MAX_ITERATIONS_EXCEEDED */]: "Max iterations exceeded in while loop.",
  ["INT_WHILE_CONDITION_NOT_BOOLEAN" /* WHILE_CONDITION_NOT_BOOLEAN */]: "While loop condition must be a boolean.",
  ["INT_IF_CONDITION_NOT_BOOLEAN" /* IF_CONDITION_NOT_BOOLEAN */]: "If/elif condition must be a boolean.",
  ["INT_FOR_EACH_NOT_LIST" /* FOR_EACH_NOT_LIST */]: (data) => `for...in requires a List, got ${data.actualType}.`,
  ["INT_FOR_EACH_VARIABLE_SHADOW" /* FOR_EACH_VARIABLE_SHADOW */]: (data) => `for...in variable '${data.name}' shadows an existing variable in this scope.`,
  ["INT_FOR_EACH_DUPLICATE_VARS" /* FOR_EACH_DUPLICATE_VARS */]: (data) => `for...in item and index variables must have different names, both are '${data.name}'.`,
  ["INT_UNKNOWN_ERROR" /* UNKNOWN_ERROR */]: "An unknown error occurred during interpretation.",
  // Operations errors
  ["OP_UNSUPPORTED_OPERAND_TYPE" /* UNSUPPORTED_OPERAND_TYPE */]: (data) => `Unsupported operand type for unit decomposition: ${data.type}`,
  ["OP_CANNOT_MIX_UNITS" /* CANNOT_MIX_UNITS */]: (data) => `Cannot mix units: ${data.units.join(", ")}`,
  ["OP_INCOMPATIBLE_TYPES" /* INCOMPATIBLE_TYPES */]: (data) => `Cannot compare ${data.typeA} with ${data.typeB}. Incompatible types.`,
  ["OP_CANNOT_COMPARE_UNITS" /* CANNOT_COMPARE_UNITS */]: (data) => `Cannot compare NumberWithUnit of different units: ${data.unitA} and ${data.unitB}`,
  ["OP_ORDERING_WITH_NULL" /* ORDERING_WITH_NULL */]: "Cannot perform ordering comparison with null values.",
  ["OP_LOGICAL_REQUIRES_BOOLEAN" /* LOGICAL_REQUIRES_BOOLEAN */]: (data) => `${data.operator} operator requires boolean operands.`,
  ["OP_DIVISION_BY_ZERO" /* DIVISION_BY_ZERO */]: "Division by zero.",
  ["OP_UNIT_EXPONENT_NOT_SUPPORTED" /* UNIT_EXPONENT_NOT_SUPPORTED */]: (data) => `Cannot raise ${data.unitA} to the power of ${data.unitB}. Unit exponents are not supported.`,
  // Symbols errors
  ["SYM_VALUE_MUST_BE_TYPE" /* VALUE_MUST_BE_TYPE */]: (data) => `Value must be ${data.expectedType}, got ${data.actualType}.`,
  ["SYM_VALUE_IS_NULL" /* VALUE_IS_NULL */]: (data) => `Value must be ${data.expectedType}, got null.`,
  ["SYM_METHOD_NOT_FOUND" /* METHOD_NOT_FOUND */]: (data) => `Method '${data.methodName}' not found or invalid arguments on type '${data.type}'.`,
  ["SYM_MISSING_REQUIRED_ARGUMENT" /* MISSING_REQUIRED_ARGUMENT */]: (data) => `Missing required argument '${data.argumentName}' for method '${data.methodName}'.`,
  ["SYM_ATTRIBUTE_NOT_FOUND" /* ATTRIBUTE_NOT_FOUND */]: (data) => `Attribute '${data.attributeName}' not found on ${data.type}.`,
  ["SYM_CANNOT_SET_ATTRIBUTE" /* CANNOT_SET_ATTRIBUTE */]: (data) => `Cannot set attribute '${data.attributeName}' on type '${data.type}'.`,
  ["SYM_INVALID_RADIX" /* INVALID_RADIX */]: (data) => `Invalid radix: ${data.radix}. Must be between 2 and 36.`,
  ["SYM_RADIX_CONVERSION_ERROR" /* RADIX_CONVERSION_ERROR */]: (data) => `Error converting to base ${data.base}: ${data.error}.`,
  ["SYM_CANNOT_CONCATENATE" /* CANNOT_CONCATENATE */]: (data) => `Cannot concatenate ${data.type} to String.`,
  ["SYM_CANNOT_SPLIT" /* CANNOT_SPLIT */]: (data) => `Cannot split String by ${data.type}.`,
  ["SYM_INDEX_OUT_OF_RANGE" /* INDEX_OUT_OF_RANGE */]: (data) => `Index out of range for ${data.operation}.`,
  ["SYM_KEY_MUST_BE_STRING" /* KEY_MUST_BE_STRING */]: (data) => `Key must be a StringSymbol or string, got ${data.type}.`,
  ["SYM_CANNOT_OPERATION_ON_TOKEN_TYPE" /* CANNOT_OPERATION_ON_TOKEN_TYPE */]: (data) => `Cannot ${data.operation} Token with ${data.valueType} value.`,
  ["SYM_INVALID_HEX_COLOR" /* INVALID_HEX_COLOR */]: (data) => `Invalid hex color format: ${data.value}`,
  ["SYM_COLOR_MANAGER_NOT_AVAILABLE" /* COLOR_MANAGER_NOT_AVAILABLE */]: "ColorManager not available",
  ["SYM_INVALID_COLOR_VALUE" /* INVALID_COLOR_VALUE */]: (data) => `Value ${data.value} must be string, attributes record, or null, got ${data.type}.`,
  // Functions errors
  ["FN_EXPECTS_NUMBER_ARGUMENTS" /* EXPECTS_NUMBER_ARGUMENTS */]: (data) => `${data.functionName}() expects number arguments.`,
  ["FN_REQUIRES_MIN_ARGUMENTS" /* REQUIRES_MIN_ARGUMENTS */]: (data) => `${data.functionName}() requires at least ${data.minArgs} argument${data.minArgs === 1 ? "" : "s"}.`,
  ["FN_EXPECTS_TYPE_ARGUMENT" /* EXPECTS_TYPE_ARGUMENT */]: (data) => `${data.functionName}() expects ${data.expectedType} as ${data.argumentPosition} argument.`,
  ["FN_DIVISION_BY_ZERO" /* DIVISION_BY_ZERO */]: (data) => `${data.functionName}() division by zero.`,
  ["FN_ARGUMENT_OUT_OF_RANGE" /* ARGUMENT_OUT_OF_RANGE */]: (data) => `${data.functionName}() argument must be ${data.constraint}.`,
  ["FN_INVALID_BASE" /* INVALID_BASE */]: (data) => `${data.functionName}() base must be ${data.constraint}.`,
  ["FN_PARSE_ERROR" /* PARSE_ERROR */]: (data) => `Invalid string for ${data.functionName}: "${data.value}" with base ${data.base}.`,
  ["FN_UNIT_CONVERSION_FAILED" /* UNIT_CONVERSION_FAILED */]: (data) => `${data.functionName || "function"}() unit conversion failed${data.error ? `: ${data.error}` : ""}`,
  ["FN_NO_CONFIG_AVAILABLE" /* NO_CONFIG_AVAILABLE */]: (data) => `No config available for dynamic function '${data.functionName || "unknown"}'`,
  ["FN_FUNCTION_RETURNED_NULL" /* FUNCTION_RETURNED_NULL */]: (data) => `Dynamic function '${data.functionName || "unknown"}' returned null`,
  ["FN_EXECUTION_ERROR" /* EXECUTION_ERROR */]: (data) => `Error executing dynamic function '${data.functionName || "unknown"}'${data.error ? `: ${data.error}` : ""}`,
  // Config errors
  ["CFG_NO_SPEC_FOUND" /* NO_SPEC_FOUND */]: (data) => `No spec found for ${data.specName}`,
  ["CFG_NO_TYPE_FOUND" /* NO_TYPE_FOUND */]: (data) => `No type found for ${data.typeName}`,
  // Processor errors
  ["PROC_TOKEN_NOT_FOUND" /* TOKEN_NOT_FOUND */]: (data) => `Token '${data.tokenName}' not found`,
  ["PROC_TOKEN_ALREADY_EXISTS" /* TOKEN_ALREADY_EXISTS */]: (data) => `Token '${data.tokenName}' already exists.`,
  ["PROC_CIRCULAR_DEPENDENCY" /* CIRCULAR_DEPENDENCY */]: (data) => `Circular dependency detected: ${Array.isArray(data.tokens) ? data.tokens.join(", ") : data.tokens}`,
  ["PROC_SUB_FIELD_NOT_RESOLVED" /* SUB_FIELD_NOT_RESOLVED */]: (data) => `Sub-field '${data.fieldPath}' not resolved`,
  ["PROC_DEPENDENCY_ERROR" /* DEPENDENCY_ERROR */]: (data) => `Token '${data.tokenName}' failed due to dependency error: ${data.chain}
Root cause: ${data.rootCause}`,
  ["PROC_NO_THEMES_FOUND" /* NO_THEMES_FOUND */]: (data) => `No themes found for theme "${data.themeName}"`,
  ["PROC_THEME_NOT_FOUND" /* THEME_NOT_FOUND */]: (data) => `Theme "${data.themeName}" not found. Available: ${data.availableThemes.join(", ")}`,
  ["PROC_TOKEN_SET_NOT_FOUND" /* TOKEN_SET_NOT_FOUND */]: (data) => `Token set "${data.setName}" not found`,
  ["PROC_TOKEN_SET_INVALID" /* TOKEN_SET_INVALID */]: (data) => `Token set "${data.setName}" is not an object`,
  ["PROC_NO_SETS_TO_PROCESS" /* NO_SETS_TO_PROCESS */]: "No sets to process",
  ["PROC_MULTIPLE_SETS_NO_SELECTION" /* MULTIPLE_SETS_NO_SELECTION */]: (data) => `Multiple sets found (${data.setNames.join(", ")}) - specify activeSets or activeTheme`,
  // Color errors
  ["COLOR_INITIALIZER_CRASHED" /* INITIALIZER_CRASHED */]: "Initializer crashed!",
  ["COLOR_INITIALIZER_CONSTRUCT_FAILED" /* INITIALIZER_CONSTRUCT_FAILED */]: (data) => `Could not construct initializer from schema${data.error ? `: ${data.error}` : ""}`,
  ["COLOR_INITIALIZER_NOT_FOUND" /* INITIALIZER_NOT_FOUND */]: (data) => `No initializer found for keyword '${data.keyword}'`,
  ["COLOR_CONVERSION_TARGET_NOT_FOUND" /* CONVERSION_TARGET_NOT_FOUND */]: (data) => `Conversion function crashed! No target spec found for ${data.targetUri}`,
  ["COLOR_SOURCE_URI_NOT_FOUND" /* SOURCE_URI_NOT_FOUND */]: (data) => `No source URI found for color type '${data.colorType}'`,
  ["COLOR_TARGET_URI_NOT_FOUND" /* TARGET_URI_NOT_FOUND */]: (data) => `No target URI found for color type '${data.colorType}'`,
  ["COLOR_CONVERSION_ERROR" /* CONVERSION_ERROR */]: (data) => data.message ? String(data.message) : "Color conversion failed",
  ["COLOR_STRING_VALUE_ASSIGNMENT" /* STRING_VALUE_ASSIGNMENT */]: (data) => `Cannot set attributes '${data.attributes}' for variable ${data.identifier} on Color type ${data.colorType}.`,
  ["COLOR_ATTRIBUTE_CHAIN_TOO_LONG" /* ATTRIBUTE_CHAIN_TOO_LONG */]: (data) => `Attributes chain '${data.attributes}' for variable ${data.identifier} on Color type ${data.colorType} may not exceed one element.`,
  ["COLOR_MISSING_SPEC" /* MISSING_SPEC */]: (data) => `No spec ${data.colorType} defined for variable ${data.identifier} on Color type ${data.colorType}.`,
  ["COLOR_MISSING_SCHEMA" /* MISSING_SCHEMA */]: (data) => `No schema defined for Color type ${data.colorType}.`,
  ["COLOR_MISSING_ATTRIBUTE_SCHEMA" /* MISSING_ATTRIBUTE_SCHEMA */]: (data) => `No schema found for key ${data.attribute} for variable ${data.identifier} on Color type ${data.colorType}.`,
  ["COLOR_INVALID_ATTRIBUTE_TYPE" /* INVALID_ATTRIBUTE_TYPE */]: (data) => `Invalid attribute type '${data.attributeType}'. Use a valid type. (${data.validTypes})`,
  ["COLOR_INVALID_ALPHA_VALUE" /* INVALID_ALPHA_VALUE */]: (data) => `Invalid alpha value '${data.alpha}'. Alpha must be between 0 and 1.`,
  // Unit errors
  ["UNIT_CONVERSION_CRASHED" /* CONVERSION_CRASHED */]: (data) => `Conversion function crashed!${data.error ? ` ${data.error}` : ""}`,
  ["UNIT_SOURCE_URI_NOT_FOUND" /* SOURCE_URI_NOT_FOUND */]: (data) => `No source URI found for unit '${data.unit}'`,
  ["UNIT_RELATIVE_REQUIRES_TWO_NUMBERS" /* RELATIVE_REQUIRES_TWO_NUMBERS */]: "Relative conversion requires exactly 2 numbers",
  ["UNIT_NO_TO_ABSOLUTE_SCRIPT" /* NO_TO_ABSOLUTE_SCRIPT */]: (data) => `No to_absolute script found for relative unit '${data.unit}'`,
  ["UNIT_TO_ABSOLUTE_MUST_RETURN_NUMBER" /* TO_ABSOLUTE_MUST_RETURN_NUMBER */]: "to_absolute script must return a number",
  ["UNIT_CANNOT_CONVERT_MULTIPLE_RELATIVE" /* CANNOT_CONVERT_MULTIPLE_RELATIVE */]: "Cannot convert multiple relative units to a common format.",
  ["UNIT_NO_VALID_CONVERSION_PATH" /* NO_VALID_CONVERSION_PATH */]: "No valid conversion paths found for the provided inputs."
};

// src/interpreter/errors/messages/index.ts
var getMessage = /* @__PURE__ */ chunkKHF2VXWO_cjs.__name((code, data) => {
  const template = messages[code];
  if (!template) {
    return `Unknown error: ${code}`;
  }
  if (typeof template === "function") {
    return template(data || {});
  }
  return template;
}, "getMessage");

// src/interpreter/errors/base.ts
var _LanguageError = class _LanguageError extends Error {
  constructor(code, options) {
    const message = getMessage(code, options?.data);
    super(message, options?.cause ? { cause: options.cause } : void 0);
    this.name = this.constructor.name;
    this.code = code;
    this.data = options?.data || {};
    this.token = options?.token;
    this.line = options?.line ?? options?.token?.line;
    this.originalMessage = message;
    this.message = this.formatMessage();
  }
  formatMessage() {
    let base = this.originalMessage;
    if (this.line !== void 0) {
      base = `Line ${this.line}: ${base}`;
    }
    if (this.token?.value) {
      base += `
Near token: ${String(this.token.value)}`;
    }
    return base;
  }
};
chunkKHF2VXWO_cjs.__name(_LanguageError, "LanguageError");
var LanguageError = _LanguageError;
var _LexerError = class _LexerError extends LanguageError {
  constructor(code, options) {
    super(code, options);
    this.name = "LexerError";
    this.code = code;
  }
};
chunkKHF2VXWO_cjs.__name(_LexerError, "LexerError");
var LexerError = _LexerError;
var _ParserError = class _ParserError extends LanguageError {
  constructor(code, options) {
    super(code, options);
    this.name = "ParserError";
    this.code = code;
  }
};
chunkKHF2VXWO_cjs.__name(_ParserError, "ParserError");
var ParserError = _ParserError;
var _InterpreterError = class _InterpreterError extends LanguageError {
  constructor(code, options) {
    super(code, options);
    this.name = "InterpreterError";
    this.code = code;
  }
};
chunkKHF2VXWO_cjs.__name(_InterpreterError, "InterpreterError");
var InterpreterError = _InterpreterError;
var _ProcessorError = class _ProcessorError extends LanguageError {
  constructor(code, options) {
    super(code, options);
    this.name = "ProcessorError";
    this.code = code;
  }
};
chunkKHF2VXWO_cjs.__name(_ProcessorError, "ProcessorError");
var ProcessorError = _ProcessorError;

// src/interpreter/errors/utils.ts
function isLanguageError(error) {
  return error instanceof LanguageError;
}
chunkKHF2VXWO_cjs.__name(isLanguageError, "isLanguageError");
function isLexerError(error) {
  return error instanceof LexerError;
}
chunkKHF2VXWO_cjs.__name(isLexerError, "isLexerError");
function isParserError(error) {
  return error instanceof ParserError;
}
chunkKHF2VXWO_cjs.__name(isParserError, "isParserError");
function isInterpreterError(error) {
  return error instanceof InterpreterError;
}
chunkKHF2VXWO_cjs.__name(isInterpreterError, "isInterpreterError");
function isProcessorError(error) {
  return error instanceof ProcessorError;
}
chunkKHF2VXWO_cjs.__name(isProcessorError, "isProcessorError");
function serializeError(error) {
  if (error instanceof LanguageError) {
    return error;
  }
  if (error instanceof Error) {
    return error;
  }
  if (typeof error === "string") {
    return error;
  }
  if (error && typeof error === "object" && "message" in error) {
    return error;
  }
  return String(error);
}
chunkKHF2VXWO_cjs.__name(serializeError, "serializeError");

// src/interpreter/utils/type.ts
var isSome = /* @__PURE__ */ chunkKHF2VXWO_cjs.__name((v) => {
  return v != null;
}, "isSome");
var isNone = /* @__PURE__ */ chunkKHF2VXWO_cjs.__name((v) => {
  return v == null;
}, "isNone");
var isNull = /* @__PURE__ */ chunkKHF2VXWO_cjs.__name((v) => {
  return v === null;
}, "isNull");
var isUndefined = /* @__PURE__ */ chunkKHF2VXWO_cjs.__name((v) => {
  return v === void 0;
}, "isUndefined");
var isObject = /* @__PURE__ */ chunkKHF2VXWO_cjs.__name((v) => {
  return typeof v === "object" && v !== null && !Array.isArray(v);
}, "isObject");
var isString = /* @__PURE__ */ chunkKHF2VXWO_cjs.__name((v) => {
  return typeof v === "string";
}, "isString");
var isNumber = /* @__PURE__ */ chunkKHF2VXWO_cjs.__name((v) => {
  return typeof v === "number" && !Number.isNaN(v);
}, "isNumber");
var isBoolean = /* @__PURE__ */ chunkKHF2VXWO_cjs.__name((v) => {
  return typeof v === "boolean";
}, "isBoolean");
var isArray = /* @__PURE__ */ chunkKHF2VXWO_cjs.__name((v) => {
  return Array.isArray(v);
}, "isArray");
var isMap = /* @__PURE__ */ chunkKHF2VXWO_cjs.__name((v) => v instanceof Map, "isMap");
var getKeyAlt = /* @__PURE__ */ chunkKHF2VXWO_cjs.__name((keys, record) => {
  for (const key of keys) {
    if (key in record) {
      return record[key];
    }
  }
  return void 0;
}, "getKeyAlt");
var isObjectWithKey = /* @__PURE__ */ chunkKHF2VXWO_cjs.__name((value, key) => {
  return isObject(value) && key in value;
}, "isObjectWithKey");
var isOutOfBounds = /* @__PURE__ */ chunkKHF2VXWO_cjs.__name((value, index) => {
  if (!isArray(value)) return true;
  return index < 0 || index >= value.length;
}, "isOutOfBounds");
var isOutOfBoundsInclusive = /* @__PURE__ */ chunkKHF2VXWO_cjs.__name((value, index) => {
  if (!isArray(value)) return true;
  return index < 0 || index > value.length;
}, "isOutOfBoundsInclusive");
var safeParseInt = /* @__PURE__ */ chunkKHF2VXWO_cjs.__name((v) => {
  if (isNumber(v)) return Math.floor(v);
  if (isString(v)) {
    const parsed = parseInt(v, 10);
    return Number.isNaN(parsed) ? null : parsed;
  }
  return null;
}, "safeParseInt");
var nullToUndefined = /* @__PURE__ */ chunkKHF2VXWO_cjs.__name((v) => isNull(v) ? void 0 : v, "nullToUndefined");

// src/interpreter/utils/color.ts
function isValidHex(value) {
  if (!isString(value)) return false;
  if (!value.startsWith("#")) return false;
  const hexPart = value.substring(1);
  if (!(hexPart.length === 3 || hexPart.length === 4 || hexPart.length === 6 || hexPart.length === 8))
    return false;
  for (let i = 0; i < hexPart.length; i++) {
    const char = hexPart[i].toLowerCase();
    if (!(char >= "0" && char <= "9" || char >= "a" && char <= "f")) {
      return false;
    }
  }
  return true;
}
chunkKHF2VXWO_cjs.__name(isValidHex, "isValidHex");
function parseHexWithAlpha(value) {
  if (!isValidHex(value)) {
    throw new InterpreterError("SYM_INVALID_HEX_COLOR" /* INVALID_HEX_COLOR */, {
      data: { value }
    });
  }
  const hexPart = value.substring(1);
  if (hexPart.length === 3) {
    return { color: value, alpha: null };
  }
  if (hexPart.length === 4) {
    const r = hexPart[0];
    const g = hexPart[1];
    const b = hexPart[2];
    const a = hexPart[3];
    const expanded = `${r}${r}${g}${g}${b}${b}`;
    const alphaValue2 = Number.parseInt(a + a, 16) / 255;
    return { color: `#${expanded}`, alpha: alphaValue2 };
  }
  if (hexPart.length === 6) {
    return { color: value, alpha: null };
  }
  const colorPart = hexPart.substring(0, 6);
  const alphaPart = hexPart.substring(6, 8);
  const alphaValue = Number.parseInt(alphaPart, 16) / 255;
  return { color: `#${colorPart}`, alpha: alphaValue };
}
chunkKHF2VXWO_cjs.__name(parseHexWithAlpha, "parseHexWithAlpha");
function isValidAlpha(alpha) {
  return alpha === null || alpha >= 0 && alpha <= 1;
}
chunkKHF2VXWO_cjs.__name(isValidAlpha, "isValidAlpha");
function ensureValidAlpha(alpha) {
  if (!isValidAlpha(alpha)) {
    throw new InterpreterError("COLOR_INVALID_ALPHA_VALUE" /* INVALID_ALPHA_VALUE */, {
      data: { alpha }
    });
  }
}
chunkKHF2VXWO_cjs.__name(ensureValidAlpha, "ensureValidAlpha");
function isTransparent(alpha) {
  return alpha !== null && alpha < 1;
}
chunkKHF2VXWO_cjs.__name(isTransparent, "isTransparent");
function formatHex8(hexColor, alpha) {
  const alphaHex = Math.round(alpha * 255).toString(16).padStart(2, "0");
  let hex6 = hexColor;
  if (hexColor.length === 4) {
    hex6 = `#${hexColor[1]}${hexColor[1]}${hexColor[2]}${hexColor[2]}${hexColor[3]}${hexColor[3]}`;
  }
  return `${hex6}${alphaHex}`;
}
chunkKHF2VXWO_cjs.__name(formatHex8, "formatHex8");

// src/interpreter/utils/string.ts
var isAlpha = /* @__PURE__ */ chunkKHF2VXWO_cjs.__name((char) => {
  if (char === null) return false;
  const cp = char.codePointAt(0) ?? 0;
  return cp >= 65 && cp <= 90 || // A-Z
  cp >= 97 && cp <= 122;
}, "isAlpha");
var isNumber2 = /* @__PURE__ */ chunkKHF2VXWO_cjs.__name((char) => {
  if (char === null) return false;
  const cp = char.codePointAt(0) ?? 0;
  return cp >= 48 && cp <= 57;
}, "isNumber");
var isAlphaNumeric = /* @__PURE__ */ chunkKHF2VXWO_cjs.__name((char) => {
  if (char === null) return false;
  return isAlpha(char) || isNumber2(char);
}, "isAlphaNumeric");
var isSpace = /* @__PURE__ */ chunkKHF2VXWO_cjs.__name((char) => {
  if (char === null) return false;
  return /\s/.test(char);
}, "isSpace");
var capitalize = /* @__PURE__ */ chunkKHF2VXWO_cjs.__name((str) => `${str.charAt(0).toUpperCase()}${str.slice(1).toLowerCase()}`, "capitalize");

// src/interpreter/symbols.ts
function isTokenscriptSymbol(value) {
  return isObjectWithKey(value, "getTypeName");
}
chunkKHF2VXWO_cjs.__name(isTokenscriptSymbol, "isTokenscriptSymbol");
var typeEquals = /* @__PURE__ */ chunkKHF2VXWO_cjs.__name((typeA, typeB) => typeA?.toLowerCase() === typeB?.toLowerCase(), "typeEquals");
var typeName = /* @__PURE__ */ chunkKHF2VXWO_cjs.__name((base, sub) => {
  const baseStr = capitalize(base);
  if (sub) {
    const subStr = capitalize(sub);
    return `${baseStr}.${subStr}`;
  }
  return baseStr;
}, "typeName");
var getResultTypeName = /* @__PURE__ */ chunkKHF2VXWO_cjs.__name((result) => {
  if (isNull(result)) {
    return "Null";
  }
  if (isString(result)) {
    return "String";
  }
  if (isTokenscriptSymbol(result)) {
    return result.getTypeName();
  }
  return "Unknown";
}, "getResultTypeName");
var formatObjectEntries = /* @__PURE__ */ chunkKHF2VXWO_cjs.__name((data) => {
  let entries;
  if (isArray(data)) {
    entries = data;
  } else if (isMap(data)) {
    entries = Array.from(data.entries());
  } else {
    entries = Object.entries(data);
  }
  const formattedEntries = entries.map(([key, value]) => `${key}: ${String(value)}`).join(", ");
  return `{${formattedEntries}}`;
}, "formatObjectEntries");
var expectStringKey = /* @__PURE__ */ chunkKHF2VXWO_cjs.__name((key) => {
  if (isString(key)) {
    return key;
  }
  if (key instanceof StringSymbol && isSome(key.value)) {
    return key.value;
  }
  throw new InterpreterError("SYM_KEY_MUST_BE_STRING" /* KEY_MUST_BE_STRING */, {
    data: { type: typeof key }
  });
}, "expectStringKey");
var DictionaryImpl = {
  get(value, key, config) {
    const keyStr = expectStringKey(key);
    const result = value.get(keyStr);
    if (isSome(result)) {
      return result;
    }
    return new NullSymbol(config);
  },
  set(value, key, val) {
    const keyStr = expectStringKey(key);
    value.set(keyStr, val.cloneIfMutable());
  },
  deleteKey(value, key) {
    const keyStr = expectStringKey(key);
    value.delete(keyStr);
  },
  keys(value, config) {
    const keys = Array.from(value.keys()).map((key) => new StringSymbol(key, config));
    return new ListSymbol(keys, false, config);
  },
  values(value, config) {
    const values = Array.from(value.values());
    return new ListSymbol(values, false, config);
  },
  keyExists(value, key, config) {
    const keyStr = expectStringKey(key);
    return new BooleanSymbol(value.has(keyStr), config);
  },
  length(value, config) {
    return new NumberSymbol(value.size, config);
  },
  clear(value) {
    value.clear();
  },
  deepCopy(value) {
    const copiedMap = /* @__PURE__ */ new Map();
    for (const [key, val] of value.entries()) {
      copiedMap.set(key, val.deepCopy());
    }
    return copiedMap;
  },
  toString(value) {
    return formatObjectEntries(value);
  },
  hasAttribute(value, attributeName) {
    return value.has(attributeName);
  },
  getAttribute(value, attributeName) {
    const val = value.get(attributeName);
    return val !== void 0 ? val : null;
  }
};
var ListImpl = {
  append(value, item) {
    value.push(item.cloneIfMutable());
  },
  extend(value, ...items) {
    for (const item of items) {
      if (item instanceof ListSymbol) {
        value.push(...item.value.map((element) => element.cloneIfMutable()));
      } else {
        value.push(item.cloneIfMutable());
      }
    }
  },
  insert(value, indexSymbol, item) {
    const index = indexSymbol.value;
    if (isOutOfBoundsInclusive(value, index)) {
      throw new InterpreterError("SYM_INDEX_OUT_OF_RANGE" /* INDEX_OUT_OF_RANGE */, {
        data: { operation: "insert" }
      });
    }
    value.splice(index, 0, item.cloneIfMutable());
  },
  deleteAt(value, indexSymbol) {
    const index = indexSymbol.value;
    if (isOutOfBounds(value, index)) {
      throw new InterpreterError("SYM_INDEX_OUT_OF_RANGE" /* INDEX_OUT_OF_RANGE */, {
        data: { operation: "deletion" }
      });
    }
    value.splice(index, 1);
  },
  length(value, config) {
    return new NumberSymbol(value.length, config);
  },
  indexOf(value, item, config) {
    const idx = value.findIndex((el) => el.equals(item));
    return new NumberSymbol(idx, config);
  },
  get(value, indexSymbol) {
    let index = indexSymbol.value;
    if (index < 0) {
      index = value.length + index;
    }
    if (isOutOfBounds(value, index)) {
      throw new InterpreterError("SYM_INDEX_OUT_OF_RANGE" /* INDEX_OUT_OF_RANGE */, {
        data: { operation: "get" }
      });
    }
    return value[index];
  },
  update(value, indexSymbol, item) {
    const index = indexSymbol.value;
    if (isOutOfBounds(value, index)) {
      throw new InterpreterError("SYM_INDEX_OUT_OF_RANGE" /* INDEX_OUT_OF_RANGE */, {
        data: { operation: "update" }
      });
    }
    value[index] = item.cloneIfMutable();
  },
  join(value, separator, config) {
    const sep = separator?.value || "";
    const stringElements = value.map((element) => {
      if (element.value === null) {
        return "null";
      }
      return element.toString();
    });
    return new StringSymbol(stringElements.join(sep), config);
  },
  deepCopy(value) {
    return value.map((element) => element.deepCopy());
  },
  toString(value, isImplicit = false) {
    const delimiter = isImplicit ? " " : ", ";
    return value.map((x) => x.value === null ? "null" : x.toString()).join(delimiter);
  }
};
var _BaseSymbolType = class _BaseSymbolType {
  constructor(value, config) {
    this.value = value;
    this.config = config;
  }
  toString() {
    return String(this.value);
  }
  getTypeName() {
    return this.type;
  }
  typeEquals(other) {
    return typeEquals(this.type, other.type);
  }
  equals(other) {
    return this.typeEquals(other) && this.value === other.value;
  }
  hasMethod(methodName, args) {
    const methodDefinition = this.constructor._SUPPORTED_METHODS?.[methodName.toLowerCase()];
    if (!methodDefinition) return false;
    if (methodDefinition.args.length === 0) return true;
    const requiredArgs = methodDefinition.args.filter((arg) => !arg.optional);
    if (args.length < requiredArgs.length) {
      return false;
    }
    if (args.length > methodDefinition.args.length) {
      return false;
    }
    return true;
  }
  callMethod(methodName, args) {
    const methodDefinition = this.constructor._SUPPORTED_METHODS?.[methodName.toLowerCase()];
    if (!methodDefinition || !this.hasMethod?.(methodName, args)) {
      throw new InterpreterError("SYM_METHOD_NOT_FOUND" /* METHOD_NOT_FOUND */, {
        data: { methodName, type: this.type }
      });
    }
    if (methodDefinition.args.length === 0) {
      return methodDefinition.function.call(this, ...args);
    }
    const processedArgs = [];
    methodDefinition.args.forEach((argDef, index) => {
      if (args[index] !== void 0) {
        processedArgs.push(args[index]);
      } else if (!argDef.optional) {
        throw new InterpreterError("SYM_MISSING_REQUIRED_ARGUMENT" /* MISSING_REQUIRED_ARGUMENT */, {
          data: { argumentName: argDef.name, methodName }
        });
      }
    });
    return methodDefinition.function.call(this, ...processedArgs);
  }
  hasAttribute(_attributeName) {
    return false;
  }
  getAttribute(attributeName) {
    throw new InterpreterError("SYM_ATTRIBUTE_NOT_FOUND" /* ATTRIBUTE_NOT_FOUND */, {
      data: { attributeName, type: this.type }
    });
  }
  setAttribute(attributeName, _value) {
    throw new InterpreterError("SYM_CANNOT_SET_ATTRIBUTE" /* CANNOT_SET_ATTRIBUTE */, {
      data: { attributeName, type: this.type }
    });
  }
};
chunkKHF2VXWO_cjs.__name(_BaseSymbolType, "BaseSymbolType");
var BaseSymbolType = _BaseSymbolType;
var _NullSymbol = class _NullSymbol extends BaseSymbolType {
  constructor(config) {
    super(null, config);
    this.type = "Null";
  }
  validValue(val) {
    return isNone(val);
  }
  toString() {
    return "null";
  }
  deepCopy() {
    return new _NullSymbol(this.config);
  }
  cloneIfMutable() {
    return this;
  }
  equals(other) {
    return other instanceof _NullSymbol;
  }
  static empty() {
    return new _NullSymbol();
  }
  toJs(_options) {
    return null;
  }
};
chunkKHF2VXWO_cjs.__name(_NullSymbol, "NullSymbol");
_NullSymbol.type = "Null";
var NullSymbol = _NullSymbol;
var _NumberSymbol = class _NumberSymbol extends BaseSymbolType {
  constructor(value, config) {
    let safeValue;
    if (isNumber(value)) {
      safeValue = value;
    } else if (value instanceof _NumberSymbol || value instanceof NumberWithUnitSymbol) {
      safeValue = value.value;
    } else if (isNull(value)) {
      safeValue = null;
    } else {
      throw new InterpreterError("SYM_VALUE_MUST_BE_TYPE" /* VALUE_MUST_BE_TYPE */, {
        data: { expectedType: "int or float", actualType: typeof value }
      });
    }
    super(safeValue, config);
    this.type = "Number";
    this.value = safeValue;
  }
  validValue(val) {
    return isNumber(val) || val instanceof _NumberSymbol;
  }
  expectSafeValue(val) {
    if (isNone(val)) {
      throw new InterpreterError("SYM_VALUE_IS_NULL" /* VALUE_IS_NULL */, {
        data: { expectedType: "int or float" }
      });
    }
  }
  toString() {
    return String(this.value);
  }
  deepCopy() {
    return new _NumberSymbol(this.value, this.config);
  }
  cloneIfMutable() {
    return this;
  }
  static empty() {
    return new _NumberSymbol(null);
  }
  hasAttribute(attributeName) {
    return attributeName === "value";
  }
  getAttribute(attributeName) {
    if (attributeName === "value") {
      return new _NumberSymbol(this.value, this.config);
    }
    throw new InterpreterError("SYM_ATTRIBUTE_NOT_FOUND" /* ATTRIBUTE_NOT_FOUND */, {
      data: { attributeName, type: "Number" }
    });
  }
  // Direct translation of to_string method from token_interpreter/symbols.py
  toStringSymbol(radix) {
    this.expectSafeValue(this.value);
    if (radix) {
      this.expectSafeValue(radix?.value);
    } else {
      return new StringSymbol(String(this.value), this.config);
    }
    const base = radix.value;
    if (!Number.isInteger(base) || base < 2 || base > 36) {
      throw new InterpreterError("SYM_INVALID_RADIX" /* INVALID_RADIX */, {
        data: { radix: base }
      });
    }
    let numValue;
    if (base === 16) {
      numValue = Math.round(this.value);
      const fractionalPart = Math.abs(this.value % 1);
      if (fractionalPart === 0.5) {
        numValue = Math.floor(this.value);
      } else {
        numValue = Math.round(this.value);
      }
    } else {
      numValue = this.value;
    }
    try {
      if (Number.isInteger(numValue) && radix) {
        return new StringSymbol(numValue.toString(base), this.config);
      } else {
        return new StringSymbol(String(this.value), this.config);
      }
    } catch (e) {
      throw new InterpreterError("SYM_RADIX_CONVERSION_ERROR" /* RADIX_CONVERSION_ERROR */, {
        data: { base, error: String(e) }
      });
    }
  }
  toJs(_options) {
    return this.value;
  }
};
chunkKHF2VXWO_cjs.__name(_NumberSymbol, "NumberSymbol");
_NumberSymbol.type = "Number";
_NumberSymbol._SUPPORTED_METHODS = {
  to_string: {
    name: "to_string",
    function: /* @__PURE__ */ chunkKHF2VXWO_cjs.__name(function(radix) {
      return this.toStringSymbol(radix);
    }, "function"),
    args: [
      {
        name: "radix",
        type: "Number",
        optional: true
      }
    ],
    returnType: "String"
  }
};
var NumberSymbol = _NumberSymbol;
var _StringSymbol = class _StringSymbol extends BaseSymbolType {
  constructor(value, config) {
    let safeValue;
    if (typeof value === "string") {
      safeValue = value;
    } else if (value instanceof _StringSymbol) {
      safeValue = value.value;
    } else if (value === null) {
      safeValue = null;
    } else {
      throw new InterpreterError("SYM_VALUE_MUST_BE_TYPE" /* VALUE_MUST_BE_TYPE */, {
        data: { expectedType: "string", actualType: typeof value }
      });
    }
    super(safeValue, config);
    this.type = "String";
    this.value = safeValue;
  }
  validValue(val) {
    return typeof val === "string" || val instanceof _StringSymbol;
  }
  expectSafeValue(val) {
    if (val === null || val === void 0) {
      throw new InterpreterError("SYM_VALUE_IS_NULL" /* VALUE_IS_NULL */, {
        data: { expectedType: "string" }
      });
    }
  }
  upper() {
    this.expectSafeValue(this.value);
    return new _StringSymbol(this.value.toUpperCase(), this.config);
  }
  deepCopy() {
    return new _StringSymbol(this.value, this.config);
  }
  cloneIfMutable() {
    return this;
  }
  static empty() {
    return new _StringSymbol(null);
  }
  lower() {
    this.expectSafeValue(this.value);
    return new _StringSymbol(this.value.toLowerCase(), this.config);
  }
  length() {
    this.expectSafeValue(this.value);
    return new NumberSymbol(this.value.length, this.config);
  }
  concat(other) {
    this.expectSafeValue(this.value);
    if (other instanceof _StringSymbol) {
      other.expectSafeValue(other.value);
      return new _StringSymbol(this.value + other.value, this.config);
    }
    throw new InterpreterError("SYM_CANNOT_CONCATENATE" /* CANNOT_CONCATENATE */, {
      data: { type: `String ${typeof other}` }
    });
  }
  split(delimiter) {
    this.expectSafeValue(this.value);
    const strValue = this.value;
    if (delimiter instanceof _StringSymbol) {
      const parts = strValue.split(delimiter.value);
      return new ListSymbol(
        parts.map((p) => new _StringSymbol(p, this.config)),
        false,
        this.config
      );
    } else if (typeof delimiter === "string") {
      const parts = strValue.split(delimiter);
      return new ListSymbol(
        parts.map((p) => new _StringSymbol(p, this.config)),
        false,
        this.config
      );
    } else if (delimiter === void 0 || delimiter === null) {
      const parts = Array.from(strValue);
      return new ListSymbol(
        parts.map((p) => new _StringSymbol(p, this.config)),
        false,
        this.config
      );
    }
    throw new InterpreterError("SYM_CANNOT_SPLIT" /* CANNOT_SPLIT */, {
      data: { type: typeof delimiter }
    });
  }
  toJs(_options) {
    return this.value;
  }
};
chunkKHF2VXWO_cjs.__name(_StringSymbol, "StringSymbol");
_StringSymbol.type = "String";
_StringSymbol._SUPPORTED_METHODS = {
  upper: {
    function: /* @__PURE__ */ chunkKHF2VXWO_cjs.__name(function() {
      return this.upper();
    }, "function"),
    args: [],
    returnType: "String"
  },
  lower: {
    function: /* @__PURE__ */ chunkKHF2VXWO_cjs.__name(function() {
      return this.lower();
    }, "function"),
    args: [],
    returnType: "String"
  },
  length: {
    function: /* @__PURE__ */ chunkKHF2VXWO_cjs.__name(function() {
      return this.length();
    }, "function"),
    args: [],
    returnType: "Number"
  },
  concat: {
    function: /* @__PURE__ */ chunkKHF2VXWO_cjs.__name(function(other) {
      return this.concat(other);
    }, "function"),
    args: [{ name: "other", type: "String" }],
    returnType: "String"
  },
  split: {
    function: /* @__PURE__ */ chunkKHF2VXWO_cjs.__name(function(delimiter) {
      return this.split(delimiter);
    }, "function"),
    args: [{ name: "delimiter", type: "String", optional: true }],
    returnType: "List"
  }
};
var StringSymbol = _StringSymbol;
var _BooleanSymbol = class _BooleanSymbol extends BaseSymbolType {
  constructor(value, config) {
    let safeValue;
    if (typeof value === "boolean") {
      safeValue = value;
    } else if (value instanceof _BooleanSymbol) {
      safeValue = value.value;
    } else if (value === null) {
      safeValue = null;
    } else {
      throw new InterpreterError("SYM_VALUE_MUST_BE_TYPE" /* VALUE_MUST_BE_TYPE */, {
        data: { expectedType: "boolean", actualType: typeof value }
      });
    }
    super(safeValue, config);
    this.type = "Boolean";
    this.value = safeValue;
  }
  validValue(val) {
    return typeof val === "boolean" || val instanceof _BooleanSymbol;
  }
  expectSafeValue(val) {
    if (val === null || val === void 0) {
      throw new InterpreterError("SYM_VALUE_IS_NULL" /* VALUE_IS_NULL */, {
        data: { expectedType: "boolean" }
      });
    }
  }
  deepCopy() {
    return new _BooleanSymbol(this.value, this.config);
  }
  cloneIfMutable() {
    return this;
  }
  static empty() {
    return new _BooleanSymbol(null);
  }
  toJs(_options) {
    return this.value;
  }
};
chunkKHF2VXWO_cjs.__name(_BooleanSymbol, "BooleanSymbol");
_BooleanSymbol.type = "Boolean";
var BooleanSymbol = _BooleanSymbol;
var _ListSymbol = class _ListSymbol extends BaseSymbolType {
  constructor(elements, isImplicit = false, config) {
    const safeElements = elements === null ? [] : elements;
    super(safeElements, config);
    this.type = "List";
    this.value = safeElements;
    this.isImplicit = isImplicit;
  }
  validValue(val) {
    return Array.isArray(val) || val instanceof _ListSymbol;
  }
  toString() {
    return ListImpl.toString(this.value, this.isImplicit);
  }
  append(item) {
    ListImpl.append(this.value, item);
    return this;
  }
  extend(...items) {
    ListImpl.extend(this.value, ...items);
    return this;
  }
  insert(indexSymbol, item) {
    ListImpl.insert(this.value, indexSymbol, item);
    return this;
  }
  delete(indexSymbol) {
    ListImpl.deleteAt(this.value, indexSymbol);
    return this;
  }
  length() {
    return ListImpl.length(this.value, this.config);
  }
  index(item) {
    return ListImpl.indexOf(this.value, item, this.config);
  }
  get(indexSymbol) {
    return ListImpl.get(this.value, indexSymbol);
  }
  update(indexSymbol, item) {
    ListImpl.update(this.value, indexSymbol, item);
    return this;
  }
  join(separator) {
    return ListImpl.join(this.value, separator, this.config);
  }
  deepCopy() {
    const copiedElements = ListImpl.deepCopy(this.value);
    return new _ListSymbol(copiedElements, this.isImplicit, this.config);
  }
  cloneIfMutable() {
    return this.deepCopy();
  }
  static empty() {
    return new _ListSymbol(null);
  }
  getTypeName() {
    return this.isImplicit ? typeName(this.type, "Implicit") : typeName(this.type);
  }
  toJs(options) {
    const { recursive = true } = options ?? {};
    if (!recursive) return this.value;
    return this.value.map((item) => item.toJs(options));
  }
};
chunkKHF2VXWO_cjs.__name(_ListSymbol, "ListSymbol");
_ListSymbol.type = "List";
_ListSymbol._SUPPORTED_METHODS = {
  append: {
    function: /* @__PURE__ */ chunkKHF2VXWO_cjs.__name(function(item) {
      return this.append(item);
    }, "function"),
    args: [{ name: "item", type: "any" }],
    returnType: "List"
  },
  extend: {
    function: /* @__PURE__ */ chunkKHF2VXWO_cjs.__name(function(...items) {
      return this.extend(...items);
    }, "function"),
    args: [],
    returnType: "List"
  },
  insert: {
    function: /* @__PURE__ */ chunkKHF2VXWO_cjs.__name(function(index, item) {
      return this.insert(index, item);
    }, "function"),
    args: [
      { name: "index", type: "Number" },
      { name: "item", type: "any" }
    ],
    returnType: "List"
  },
  delete: {
    function: /* @__PURE__ */ chunkKHF2VXWO_cjs.__name(function(index) {
      return this.delete(index);
    }, "function"),
    args: [{ name: "index", type: "Number" }],
    returnType: "List"
  },
  length: {
    function: /* @__PURE__ */ chunkKHF2VXWO_cjs.__name(function() {
      return this.length();
    }, "function"),
    args: [],
    returnType: "Number"
  },
  index: {
    function: /* @__PURE__ */ chunkKHF2VXWO_cjs.__name(function(item) {
      return this.index(item);
    }, "function"),
    args: [{ name: "item", type: "any" }],
    returnType: "Number"
  },
  get: {
    function: /* @__PURE__ */ chunkKHF2VXWO_cjs.__name(function(index) {
      return this.get(index);
    }, "function"),
    args: [{ name: "index", type: "Number" }],
    returnType: "any"
  },
  update: {
    function: /* @__PURE__ */ chunkKHF2VXWO_cjs.__name(function(index, item) {
      return this.update(index, item);
    }, "function"),
    args: [
      { name: "index", type: "Number" },
      { name: "item", type: "any" }
    ],
    returnType: "List"
  },
  join: {
    function: /* @__PURE__ */ chunkKHF2VXWO_cjs.__name(function(separator) {
      return this.join(separator);
    }, "function"),
    args: [{ name: "separator", type: "String", optional: true }],
    returnType: "String"
  }
};
var ListSymbol = _ListSymbol;
var _NumberWithUnitSymbol = class _NumberWithUnitSymbol extends BaseSymbolType {
  constructor(value, unit, config) {
    let safeValue;
    if (typeof value === "number") {
      safeValue = value;
    } else if (value instanceof NumberSymbol) {
      safeValue = value.value;
    } else if (value === null) {
      safeValue = null;
    } else {
      throw new InterpreterError("SYM_VALUE_MUST_BE_TYPE" /* VALUE_MUST_BE_TYPE */, {
        data: { expectedType: "number or NumberSymbol", actualType: typeof value }
      });
    }
    super(safeValue, config);
    this.type = "NumberWithUnit";
    this.value = safeValue;
    if (typeof unit === "string" && !Object.values(chunkKHF2VXWO_cjs.SupportedFormats).includes(unit)) {
      throw new InterpreterError("SYM_ATTRIBUTE_NOT_FOUND" /* ATTRIBUTE_NOT_FOUND */, {
        data: { attributeName: unit, type: "Unit" }
      });
    }
    this.unit = typeof unit === "string" ? unit : unit;
  }
  validValue(val) {
    return val instanceof _NumberWithUnitSymbol;
  }
  static fromRecord(record, config) {
    if (record === null || typeof record !== "object") return;
    if (record.type !== "NumberWithUnit") return;
    if (!record.value && !record.unit) return;
    if (typeof record.value !== "number") return;
    return new _NumberWithUnitSymbol(record.value, record.unit, config);
  }
  toString() {
    return `${this.value}${this.unit}`;
  }
  expectSafeValue(val) {
    if (val === null || val === void 0) {
      throw new InterpreterError("SYM_VALUE_IS_NULL" /* VALUE_IS_NULL */, {
        data: { expectedType: "number" }
      });
    }
  }
  toStringSymbol() {
    this.expectSafeValue(this.value);
    return new StringSymbol(`${this.value}${this.unit}`, this.config);
  }
  to_number() {
    this.expectSafeValue(this.value);
    return new NumberSymbol(this.value, this.config);
  }
  equals(other) {
    return other instanceof _NumberWithUnitSymbol && this.value === other.value && this.unit.toLowerCase() === other?.unit.toLowerCase();
  }
  deepCopy() {
    return new _NumberWithUnitSymbol(this.value, this.unit, this.config);
  }
  cloneIfMutable() {
    return this;
  }
  static empty() {
    return new _NumberWithUnitSymbol(null, "px");
  }
  hasAttribute(attributeName) {
    return attributeName === "value";
  }
  getAttribute(attributeName) {
    if (attributeName === "value") {
      return new NumberSymbol(this.value, this.config);
    }
    throw new InterpreterError("SYM_ATTRIBUTE_NOT_FOUND" /* ATTRIBUTE_NOT_FOUND */, {
      data: { attributeName, type: "NumberWithUnit" }
    });
  }
  getTypeName() {
    return `${this.type}.${capitalize(this.unit)}`;
  }
  toJs(options) {
    const { stringify = false } = options ?? {};
    if (stringify) return this.toString();
    return { value: this.value, unit: this.unit };
  }
};
chunkKHF2VXWO_cjs.__name(_NumberWithUnitSymbol, "NumberWithUnitSymbol");
_NumberWithUnitSymbol.type = "NumberWithUnit";
_NumberWithUnitSymbol._SUPPORTED_METHODS = {
  to_string: {
    name: "to_string",
    function: /* @__PURE__ */ chunkKHF2VXWO_cjs.__name(function() {
      return this.toStringSymbol();
    }, "function"),
    args: [
      {
        name: "radix",
        type: "Number",
        optional: true
      }
    ],
    returnType: "String"
  },
  to_number: {
    function: /* @__PURE__ */ chunkKHF2VXWO_cjs.__name(function() {
      return this.to_number();
    }, "function"),
    args: [],
    returnType: "Number"
  }
};
var NumberWithUnitSymbol = _NumberWithUnitSymbol;
var _DictionarySymbol = class _DictionarySymbol extends BaseSymbolType {
  constructor(value, config) {
    let safeValue;
    if (value instanceof _DictionarySymbol) {
      safeValue = value.value;
    } else if (isMap(value)) {
      safeValue = value;
    } else if (isNull(value)) {
      safeValue = /* @__PURE__ */ new Map();
    } else if (isObject(value)) {
      safeValue = new Map(Object.entries(value));
    } else {
      throw new InterpreterError("SYM_VALUE_MUST_BE_TYPE" /* VALUE_MUST_BE_TYPE */, {
        data: { expectedType: "dict", actualType: typeof value }
      });
    }
    super(safeValue, config);
    this.type = "Dictionary";
    this.value = safeValue;
  }
  validValue(val) {
    return isMap(val) || isNull(val);
  }
  toString() {
    return DictionaryImpl.toString(this.value);
  }
  get(key) {
    return DictionaryImpl.get(this.value, key, this.config);
  }
  set(key, value) {
    DictionaryImpl.set(this.value, key, value);
    return this;
  }
  delete(key) {
    DictionaryImpl.deleteKey(this.value, key);
    return this;
  }
  keys() {
    return DictionaryImpl.keys(this.value, this.config);
  }
  values() {
    return DictionaryImpl.values(this.value, this.config);
  }
  keyExists(key) {
    return DictionaryImpl.keyExists(this.value, key, this.config);
  }
  length() {
    return DictionaryImpl.length(this.value, this.config);
  }
  clear() {
    DictionaryImpl.clear(this.value);
    return this;
  }
  deepCopy() {
    const copiedMap = DictionaryImpl.deepCopy(this.value);
    return new _DictionarySymbol(copiedMap, this.config);
  }
  cloneIfMutable() {
    return this.deepCopy();
  }
  static empty() {
    return new _DictionarySymbol(null);
  }
  hasAttribute(attributeName) {
    return DictionaryImpl.hasAttribute(this.value, attributeName);
  }
  getAttribute(attributeName) {
    return DictionaryImpl.getAttribute(this.value, attributeName);
  }
  toJs(options) {
    const { recursive = true } = options ?? {};
    const obj = {};
    for (const [key, child] of this.value.entries()) {
      obj[key] = recursive ? child.toJs(options) : child;
    }
    return obj;
  }
};
chunkKHF2VXWO_cjs.__name(_DictionarySymbol, "DictionarySymbol");
_DictionarySymbol.type = "Dictionary";
_DictionarySymbol._SUPPORTED_METHODS = {
  get: {
    function: /* @__PURE__ */ chunkKHF2VXWO_cjs.__name(function(key) {
      return this.get(key);
    }, "function"),
    args: [{ name: "key", type: "String", optional: false }],
    returnType: "any"
  },
  set: {
    function: /* @__PURE__ */ chunkKHF2VXWO_cjs.__name(function(key, value) {
      return this.set(key, value);
    }, "function"),
    args: [
      { name: "key", type: "String", optional: false },
      { name: "value", type: "any", optional: false }
    ],
    returnType: "Dictionary"
  },
  delete: {
    function: /* @__PURE__ */ chunkKHF2VXWO_cjs.__name(function(key) {
      return this.delete(key);
    }, "function"),
    args: [{ name: "key", type: "String", optional: false }],
    returnType: "Dictionary"
  },
  keys: {
    function: /* @__PURE__ */ chunkKHF2VXWO_cjs.__name(function() {
      return this.keys();
    }, "function"),
    args: [],
    returnType: "List"
  },
  values: {
    function: /* @__PURE__ */ chunkKHF2VXWO_cjs.__name(function() {
      return this.values();
    }, "function"),
    args: [],
    returnType: "List"
  },
  key_exists: {
    function: /* @__PURE__ */ chunkKHF2VXWO_cjs.__name(function(key) {
      return this.keyExists(key);
    }, "function"),
    args: [{ name: "key", type: "String", optional: false }],
    returnType: "Boolean"
  },
  length: {
    function: /* @__PURE__ */ chunkKHF2VXWO_cjs.__name(function() {
      return this.length();
    }, "function"),
    args: [],
    returnType: "Number"
  },
  clear: {
    function: /* @__PURE__ */ chunkKHF2VXWO_cjs.__name(function() {
      return this.clear();
    }, "function"),
    args: [],
    returnType: "Dictionary"
  }
};
var DictionarySymbol = _DictionarySymbol;
var _TokenSymbol = class _TokenSymbol extends BaseSymbolType {
  constructor(subType, value, config, metadata) {
    let safeValue;
    if (value instanceof _TokenSymbol) {
      safeValue = value.value;
    } else if (isMap(value)) {
      safeValue = value;
    } else if (isObject(value)) {
      safeValue = new Map(Object.entries(value));
    } else if (isArray(value)) {
      safeValue = value;
    } else if (isNull(value)) {
      safeValue = /* @__PURE__ */ new Map();
    } else {
      throw new InterpreterError("SYM_VALUE_MUST_BE_TYPE" /* VALUE_MUST_BE_TYPE */, {
        data: { expectedType: "Record or List", actualType: typeof value }
      });
    }
    super(safeValue, config);
    this.type = "Token";
    this.value = safeValue;
    this.subType = subType;
    this.metadata = metadata;
  }
  validValue(val) {
    return isMap(val) || isArray(val) || isNull(val);
  }
  toString() {
    if (isMap(this.value)) {
      return DictionaryImpl.toString(this.value);
    }
    return ListImpl.toString(this.value);
  }
  get(keyOrIndex) {
    if (isArray(this.value)) {
      const indexSymbol = typeof keyOrIndex === "number" ? new NumberSymbol(keyOrIndex, this.config) : keyOrIndex;
      if (!(indexSymbol instanceof NumberSymbol)) {
        throw new InterpreterError("SYM_CANNOT_OPERATION_ON_TOKEN_TYPE" /* CANNOT_OPERATION_ON_TOKEN_TYPE */, {
          data: { operation: "List get", valueType: "non-Number index" }
        });
      }
      return ListImpl.get(this.value, indexSymbol);
    }
    const keySymbol = typeof keyOrIndex === "string" ? new StringSymbol(keyOrIndex, this.config) : keyOrIndex;
    if (!(keySymbol instanceof StringSymbol)) {
      throw new InterpreterError("SYM_CANNOT_OPERATION_ON_TOKEN_TYPE" /* CANNOT_OPERATION_ON_TOKEN_TYPE */, {
        data: { operation: "Dictionary get", valueType: "non-String key" }
      });
    }
    return DictionaryImpl.get(this.value, keySymbol, this.config);
  }
  set(key, value) {
    if (isArray(this.value)) {
      throw new InterpreterError("SYM_CANNOT_OPERATION_ON_TOKEN_TYPE" /* CANNOT_OPERATION_ON_TOKEN_TYPE */, {
        data: { operation: "set key", valueType: "List" }
      });
    }
    DictionaryImpl.set(this.value, key, value);
    return this;
  }
  keys() {
    if (isArray(this.value)) {
      throw new InterpreterError("SYM_CANNOT_OPERATION_ON_TOKEN_TYPE" /* CANNOT_OPERATION_ON_TOKEN_TYPE */, {
        data: { operation: "get keys", valueType: "List" }
      });
    }
    return DictionaryImpl.keys(this.value, this.config);
  }
  values() {
    if (isMap(this.value)) {
      return DictionaryImpl.values(this.value, this.config);
    }
    return new ListSymbol(this.value, false, this.config);
  }
  length() {
    if (isMap(this.value)) {
      return DictionaryImpl.length(this.value, this.config);
    }
    return ListImpl.length(this.value, this.config);
  }
  // List-specific methods
  append(item) {
    if (isMap(this.value)) {
      throw new InterpreterError("SYM_CANNOT_OPERATION_ON_TOKEN_TYPE" /* CANNOT_OPERATION_ON_TOKEN_TYPE */, {
        data: { operation: "append", valueType: "Dictionary" }
      });
    }
    ListImpl.append(this.value, item);
    return this;
  }
  extend(...items) {
    if (isMap(this.value)) {
      throw new InterpreterError("SYM_CANNOT_OPERATION_ON_TOKEN_TYPE" /* CANNOT_OPERATION_ON_TOKEN_TYPE */, {
        data: { operation: "extend", valueType: "Dictionary" }
      });
    }
    ListImpl.extend(this.value, ...items);
    return this;
  }
  insert(indexSymbol, item) {
    if (isMap(this.value)) {
      throw new InterpreterError("SYM_CANNOT_OPERATION_ON_TOKEN_TYPE" /* CANNOT_OPERATION_ON_TOKEN_TYPE */, {
        data: { operation: "insert", valueType: "Dictionary" }
      });
    }
    ListImpl.insert(this.value, indexSymbol, item);
    return this;
  }
  delete(indexSymbol) {
    if (isMap(this.value)) {
      throw new InterpreterError("SYM_CANNOT_OPERATION_ON_TOKEN_TYPE" /* CANNOT_OPERATION_ON_TOKEN_TYPE */, {
        data: { operation: "delete", valueType: "Dictionary" }
      });
    }
    ListImpl.deleteAt(this.value, indexSymbol);
    return this;
  }
  index(item) {
    if (isMap(this.value)) {
      throw new InterpreterError("SYM_CANNOT_OPERATION_ON_TOKEN_TYPE" /* CANNOT_OPERATION_ON_TOKEN_TYPE */, {
        data: { operation: "get index", valueType: "Dictionary" }
      });
    }
    return ListImpl.indexOf(this.value, item, this.config);
  }
  update(indexSymbol, item) {
    if (isMap(this.value)) {
      throw new InterpreterError("SYM_CANNOT_OPERATION_ON_TOKEN_TYPE" /* CANNOT_OPERATION_ON_TOKEN_TYPE */, {
        data: { operation: "update", valueType: "Dictionary" }
      });
    }
    ListImpl.update(this.value, indexSymbol, item);
    return this;
  }
  join(separator) {
    if (isMap(this.value)) {
      throw new InterpreterError("SYM_CANNOT_OPERATION_ON_TOKEN_TYPE" /* CANNOT_OPERATION_ON_TOKEN_TYPE */, {
        data: { operation: "join", valueType: "Dictionary" }
      });
    }
    return ListImpl.join(this.value, separator, this.config);
  }
  deepCopy() {
    if (isMap(this.value)) {
      return new _TokenSymbol(
        this.subType,
        DictionaryImpl.deepCopy(this.value),
        this.config,
        this.metadata
      );
    }
    return new _TokenSymbol(this.subType, ListImpl.deepCopy(this.value), this.config, this.metadata);
  }
  cloneIfMutable() {
    return this.deepCopy();
  }
  static empty() {
    return new _TokenSymbol("unknown", null);
  }
  hasAttribute(attributeName) {
    if (attributeName === "subType" || attributeName === "type") {
      return true;
    }
    if (isMap(this.value)) {
      return DictionaryImpl.hasAttribute(this.value, attributeName);
    }
    return false;
  }
  getAttribute(attributeName) {
    if (attributeName === "subType") {
      return new StringSymbol(this.subType, this.config);
    }
    if (attributeName === "type") {
      return new StringSymbol(this.type, this.config);
    }
    if (isMap(this.value)) {
      return DictionaryImpl.getAttribute(this.value, attributeName);
    }
    return null;
  }
  getTypeName() {
    return typeName(this.type, this.subType);
  }
  toJs(options) {
    const { recursive = true } = options ?? {};
    if (isMap(this.value)) {
      const obj = {};
      const mapValue = this.value;
      for (const [key, child] of mapValue.entries()) {
        obj[key] = recursive ? child.toJs(options) : child;
      }
      return obj;
    }
    if (isArray(this.value)) {
      const arrayValue = this.value;
      return recursive ? arrayValue.map((item) => item.toJs(options)) : arrayValue;
    }
    return {};
  }
};
chunkKHF2VXWO_cjs.__name(_TokenSymbol, "TokenSymbol");
_TokenSymbol.type = "Token";
_TokenSymbol._SUPPORTED_METHODS = {
  get: {
    function: /* @__PURE__ */ chunkKHF2VXWO_cjs.__name(function(keyOrIndex) {
      return this.get(keyOrIndex);
    }, "function"),
    args: [{ name: "keyOrIndex", type: "String|Number", optional: false }],
    returnType: "any"
  },
  set: {
    function: /* @__PURE__ */ chunkKHF2VXWO_cjs.__name(function(key, value) {
      return this.set(key, value);
    }, "function"),
    args: [
      { name: "key", type: "String", optional: false },
      { name: "value", type: "any", optional: false }
    ],
    returnType: "Token"
  },
  keys: {
    function: /* @__PURE__ */ chunkKHF2VXWO_cjs.__name(function() {
      return this.keys();
    }, "function"),
    args: [],
    returnType: "List"
  },
  values: {
    function: /* @__PURE__ */ chunkKHF2VXWO_cjs.__name(function() {
      return this.values();
    }, "function"),
    args: [],
    returnType: "List"
  },
  length: {
    function: /* @__PURE__ */ chunkKHF2VXWO_cjs.__name(function() {
      return this.length();
    }, "function"),
    args: [],
    returnType: "Number"
  },
  // List methods (when value is Array)
  append: {
    function: /* @__PURE__ */ chunkKHF2VXWO_cjs.__name(function(item) {
      return this.append(item);
    }, "function"),
    args: [{ name: "item", type: "any" }],
    returnType: "Token"
  },
  extend: {
    function: /* @__PURE__ */ chunkKHF2VXWO_cjs.__name(function(...items) {
      return this.extend(...items);
    }, "function"),
    args: [],
    returnType: "Token"
  },
  insert: {
    function: /* @__PURE__ */ chunkKHF2VXWO_cjs.__name(function(index, item) {
      return this.insert(index, item);
    }, "function"),
    args: [
      { name: "index", type: "Number" },
      { name: "item", type: "any" }
    ],
    returnType: "Token"
  },
  delete: {
    function: /* @__PURE__ */ chunkKHF2VXWO_cjs.__name(function(index) {
      return this.delete(index);
    }, "function"),
    args: [{ name: "index", type: "Number" }],
    returnType: "Token"
  },
  index: {
    function: /* @__PURE__ */ chunkKHF2VXWO_cjs.__name(function(item) {
      return this.index(item);
    }, "function"),
    args: [{ name: "item", type: "any" }],
    returnType: "Number"
  },
  update: {
    function: /* @__PURE__ */ chunkKHF2VXWO_cjs.__name(function(index, item) {
      return this.update(index, item);
    }, "function"),
    args: [
      { name: "index", type: "Number" },
      { name: "item", type: "any" }
    ],
    returnType: "Token"
  },
  join: {
    function: /* @__PURE__ */ chunkKHF2VXWO_cjs.__name(function(separator) {
      return this.join(separator);
    }, "function"),
    args: [{ name: "separator", type: "String", optional: true }],
    returnType: "String"
  }
};
var TokenSymbol = _TokenSymbol;
var _ColorSymbol = class _ColorSymbol extends BaseSymbolType {
  constructor(value, subType, alpha, config) {
    const isHex = (isUndefined(subType) || subType?.toLowerCase() === "hex") && isString(value);
    const isDynamic = isString(subType) && isObject(value);
    const isValid = isNull(value) || isHex || isDynamic;
    if (!isValid) {
      throw new InterpreterError("SYM_INVALID_COLOR_VALUE" /* INVALID_COLOR_VALUE */, {
        data: { value: String(value), type: typeof value }
      });
    }
    if (isHex) {
      if (!isValidHex(value)) {
        throw new InterpreterError("SYM_INVALID_HEX_COLOR" /* INVALID_HEX_COLOR */, {
          data: { value: String(value) }
        });
      }
    }
    super(value, config);
    this.type = "Color";
    this.subType = null;
    this.alpha = null;
    this.value = value;
    this.subType = isHex ? "Hex" : subType || null;
    const alphaValue = alpha ?? null;
    ensureValidAlpha(alphaValue);
    this.alpha = alphaValue;
  }
  static empty() {
    return new _ColorSymbol(null);
  }
  toStringSymbol() {
    if (this.config?.colorManager) {
      const formatted = this.config.colorManager.formatColorMethod(this);
      return new StringSymbol(formatted, this.config);
    }
    if (isObject(this.value)) {
      return new StringSymbol(formatObjectEntries(this.value), this.config);
    }
    if (isString(this.value)) {
      if (this.isHex() && this.alpha !== null) {
        return new StringSymbol(formatHex8(this.value, this.alpha), this.config);
      }
      return new StringSymbol(this.value, this.config);
    }
    return new StringSymbol("", this.config);
  }
  toString() {
    return this.toStringSymbol().toString();
  }
  to(targetType) {
    if (!this.config?.colorManager) {
      throw new InterpreterError("SYM_COLOR_MANAGER_NOT_AVAILABLE" /* COLOR_MANAGER_NOT_AVAILABLE */);
    }
    return this.config.colorManager.convertToByType(this, targetType);
  }
  typeEquals(other) {
    if (!typeEquals(this.type, other.type)) return false;
    const otherColor = other;
    if (!this.subType && otherColor.isHex() || this.isHex() && !otherColor.subType) return true;
    return typeEquals(this.subType, other.subType);
  }
  isHex() {
    return typeEquals(this.subType, "hex");
  }
  validValue(val) {
    return val instanceof _ColorSymbol || isNull(val) || isObject(val) || isValidHex(val);
  }
  equals(other) {
    if (!this.typeEquals(other)) return false;
    const otherColor = other;
    if (this.alpha !== otherColor.alpha) return false;
    if (isObject(this.value) && isObject(otherColor.value)) {
      const thisKeys = Object.keys(this.value);
      const otherKeys = Object.keys(otherColor.value);
      if (thisKeys.length !== otherKeys.length) return false;
      for (const key of thisKeys) {
        if (!this.value[key].equals(otherColor.value[key])) return false;
      }
      return true;
    }
    return this.value === otherColor.value;
  }
  deepCopy() {
    if (isObject(this.value)) {
      const copiedValue = {};
      for (const [key, val] of Object.entries(this.value)) {
        copiedValue[key] = val.deepCopy();
      }
      return new _ColorSymbol(copiedValue, this.subType || void 0, this.alpha, this.config);
    }
    return new _ColorSymbol(this.value, this.subType || void 0, this.alpha, this.config);
  }
  cloneIfMutable() {
    if (isObject(this.value)) {
      return this.deepCopy();
    }
    return this;
  }
  hasAttribute(attributeName) {
    if (attributeName === "to" || attributeName === "alpha") {
      return true;
    }
    if (isObject(this.value)) {
      return attributeName in this.value;
    }
    return false;
  }
  getAttribute(attributeName) {
    if (attributeName === "to") {
      return this;
    }
    if (attributeName === "alpha") {
      return this.alpha !== null ? new NumberSymbol(this.alpha, this.config) : new NullSymbol(this.config);
    }
    if (isObject(this.value)) {
      const attributeValue = this.value[attributeName];
      if (attributeValue !== void 0) {
        return attributeValue;
      }
    }
    throw new InterpreterError("SYM_ATTRIBUTE_NOT_FOUND" /* ATTRIBUTE_NOT_FOUND */, {
      data: { attributeName, type: "Color" }
    });
  }
  hasMethod(methodName, args) {
    if (super.hasMethod?.(methodName, args)) {
      return true;
    }
    if (this.config?.colorManager.hasInitializer(methodName)) {
      return true;
    }
    return false;
  }
  callMethod(methodName, args) {
    const methodDefinition = this.constructor._SUPPORTED_METHODS?.[methodName.toLowerCase()];
    if (methodDefinition && super.hasMethod?.(methodName, args)) {
      return super.callMethod?.(methodName, args);
    }
    if (this.config?.colorManager.hasInitializer(methodName)) {
      return this.config.colorManager.convertToByType(this, methodName);
    }
    throw new InterpreterError("SYM_METHOD_NOT_FOUND" /* METHOD_NOT_FOUND */, {
      data: { methodName, type: this.type }
    });
  }
  getTypeName() {
    return typeName(this.type, nullToUndefined(this.subType));
  }
  toJs(options) {
    const { stringify = false, recursive = true } = options ?? {};
    if (stringify) {
      return this.toString();
    }
    if (isString(this.value)) {
      return {
        type: this.subType || "hex",
        value: this.value,
        alpha: this.alpha
      };
    }
    if (isObject(this.value)) {
      const result = {
        type: this.subType || "unknown",
        alpha: this.alpha
      };
      for (const [key, val] of Object.entries(this.value)) {
        result[key] = recursive ? val.toJs(options) : val;
      }
      return result;
    }
    return {
      type: this.subType || "unknown",
      value: null,
      alpha: this.alpha
    };
  }
};
chunkKHF2VXWO_cjs.__name(_ColorSymbol, "ColorSymbol");
_ColorSymbol.type = "Color";
_ColorSymbol._SUPPORTED_METHODS = {
  to_string: {
    name: "to_string",
    function: /* @__PURE__ */ chunkKHF2VXWO_cjs.__name(function() {
      return this.toStringSymbol();
    }, "function"),
    args: [],
    returnType: "String"
  }
};
var ColorSymbol = _ColorSymbol;
var jsValueToSymbolType = /* @__PURE__ */ chunkKHF2VXWO_cjs.__name((value, config) => {
  if (value instanceof BaseSymbolType) {
    value.config = config;
    return value;
  }
  if (isNone(value)) return new NullSymbol(config);
  if (isNumber(value)) return new NumberSymbol(value, config);
  if (isString(value)) {
    if (isValidHex(value)) return new ColorSymbol(value, "Hex", null, config);
    return new StringSymbol(value, config);
  }
  if (isBoolean(value)) return new BooleanSymbol(value, config);
  if (isArray(value))
    return new ListSymbol(
      value.map((item) => jsValueToSymbolType(item, config)),
      false,
      config
    );
  if (isObject(value)) {
    const dict = /* @__PURE__ */ new Map();
    for (const key in value) {
      dict.set(key, jsValueToSymbolType(value[key], config));
    }
    return new DictionarySymbol(dict, config);
  }
  throw new InterpreterError("SYM_VALUE_MUST_BE_TYPE" /* VALUE_MUST_BE_TYPE */, {
    data: { expectedType: "valid TokenScript type", actualType: typeof value }
  });
}, "jsValueToSymbolType");
var nullableSymbolTypes = {
  [NumberSymbol.type.toLowerCase()]: NumberSymbol,
  [StringSymbol.type.toLowerCase()]: StringSymbol,
  [BooleanSymbol.type.toLowerCase()]: BooleanSymbol,
  [NumberWithUnitSymbol.type.toLowerCase()]: NumberWithUnitSymbol,
  [ColorSymbol.type.toLowerCase()]: ColorSymbol,
  [NullSymbol.type.toLowerCase()]: NullSymbol
};
var basicSymbolTypes = {
  ...nullableSymbolTypes,
  [ListSymbol.type.toLowerCase()]: ListSymbol,
  [DictionarySymbol.type.toLowerCase()]: DictionarySymbol,
  [TokenSymbol.type.toLowerCase()]: TokenSymbol
};
function serializeInterpreterResult(value, options) {
  if (isString(value)) return value;
  if (isNull(value)) return null;
  if (isTokenscriptSymbol(value)) return value.toJs(options);
  return value;
}
chunkKHF2VXWO_cjs.__name(serializeInterpreterResult, "serializeInterpreterResult");
function stringifyInterpreterResult(value) {
  if (isString(value)) return value;
  if (isTokenscriptSymbol(value)) return value.toString();
  return String(value);
}
chunkKHF2VXWO_cjs.__name(stringifyInterpreterResult, "stringifyInterpreterResult");

exports.BaseSymbolType = BaseSymbolType;
exports.BooleanSymbol = BooleanSymbol;
exports.ColorErrorCode = ColorErrorCode;
exports.ColorSymbol = ColorSymbol;
exports.ConfigErrorCode = ConfigErrorCode;
exports.DictionarySymbol = DictionarySymbol;
exports.FunctionsErrorCode = FunctionsErrorCode;
exports.InterpreterError = InterpreterError;
exports.InterpreterErrorCode = InterpreterErrorCode;
exports.LanguageError = LanguageError;
exports.LexerError = LexerError;
exports.LexerErrorCode = LexerErrorCode;
exports.ListSymbol = ListSymbol;
exports.NullSymbol = NullSymbol;
exports.NumberSymbol = NumberSymbol;
exports.NumberWithUnitSymbol = NumberWithUnitSymbol;
exports.OperationsErrorCode = OperationsErrorCode;
exports.ParserError = ParserError;
exports.ParserErrorCode = ParserErrorCode;
exports.ProcessorError = ProcessorError;
exports.ProcessorErrorCode = ProcessorErrorCode;
exports.StringSymbol = StringSymbol;
exports.SymbolsErrorCode = SymbolsErrorCode;
exports.TokenSymbol = TokenSymbol;
exports.UnitErrorCode = UnitErrorCode;
exports.basicSymbolTypes = basicSymbolTypes;
exports.ensureValidAlpha = ensureValidAlpha;
exports.formatHex8 = formatHex8;
exports.getKeyAlt = getKeyAlt;
exports.getMessage = getMessage;
exports.getResultTypeName = getResultTypeName;
exports.isAlpha = isAlpha;
exports.isAlphaNumeric = isAlphaNumeric;
exports.isArray = isArray;
exports.isBoolean = isBoolean;
exports.isInterpreterError = isInterpreterError;
exports.isLanguageError = isLanguageError;
exports.isLexerError = isLexerError;
exports.isNull = isNull;
exports.isNumber = isNumber;
exports.isNumber2 = isNumber2;
exports.isObject = isObject;
exports.isParserError = isParserError;
exports.isProcessorError = isProcessorError;
exports.isSome = isSome;
exports.isSpace = isSpace;
exports.isString = isString;
exports.isTokenscriptSymbol = isTokenscriptSymbol;
exports.isTransparent = isTransparent;
exports.jsValueToSymbolType = jsValueToSymbolType;
exports.parseHexWithAlpha = parseHexWithAlpha;
exports.safeParseInt = safeParseInt;
exports.serializeError = serializeError;
exports.serializeInterpreterResult = serializeInterpreterResult;
exports.stringifyInterpreterResult = stringifyInterpreterResult;
exports.typeEquals = typeEquals;
exports.typeName = typeName;
//# sourceMappingURL=chunk-K65UI6KX.cjs.map
//# sourceMappingURL=chunk-K65UI6KX.cjs.map