```ts
export function tokenize(input: string): string[] {
  if (input === "") {
    return [];
  }

  const tokens: string[] = [];
  let i = 0;
  let currentToken = "";
  let inQuotes = false;

  while (i < input.length) {
    const char = input[i];

    if (char === "\\") {
      if (i + 1 >= input.length) {
        throw new Error("Trailing backslash");
      }
      i++;
      const nextChar = input[i];
      currentToken += nextChar;
    } else if (char === '"') {
      if (!inQuotes && currentToken === "") {
        // Check for standalone quotes
        if (i + 1 < input.length && input[i + 1] === '"') {
          tokens.push("");
          i += 2;
          continue;
        }
      }
      inQuotes = !inQuotes;
    } else if (char === " " || char === "\t") {
      if (inQuotes) {
        currentToken += char;
      } else {
        if (currentToken !== "") {
          tokens.push(currentToken);
          currentToken = "";
        }
      }
    } else {
      currentToken += char;
    }

    i++;
  }

  if (inQuotes) {
    throw new Error("Unterminated quote");
  }

  if (currentToken !== "") {
    tokens.push(currentToken);
  }

  return tokens;
}
```