1. The range of the function $f(x)=(\sin x-1)(\cos x-1)(x \in \mathbf{R})$ is $\qquad$ .
$$
\begin{array}{l}
f(x)=\sin x \cos x-(\sin x+\cos x)+1 \\
\xlongequal{t=\sin x+\cos x \in[-\sqrt{2}, \sqrt{2}]} \frac{t^{2}-1}{2}-t+1=\frac{1}{2}(t-1)^{2} \in\left[0, \frac{3+2 \sqrt{2}}{2}\right] .
\end{array}
$$

The translation is as follows:

$$
\begin{array}{l}
f(x)=\sin x \cos x-(\sin x+\cos x)+1 \\
\xlongequal{t=\sin x+\cos x \in[-\sqrt{2}, \sqrt{2}]} \frac{t^{2}-1}{2}-t+1=\frac{1}{2}(t-1)^{2} \in\left[0, \frac{3+2 \sqrt{2}}{2}\right] .
\end{array}
$$