3. If real numbers $x, y, z$ satisfy $x^{2}+y^{2}-2 x+2 y-1=0$, then the maximum value of the algebraic expression $M=(x+1) \sin z+$ $(y-1) \cos z$ is $\qquad$ .
$$
\begin{array}{l}
M \leqslant \sqrt{(x+1)^{2}+(y-1)^{2}}=\sqrt{x^{2}+y^{2}+2 x-2 y+2}=\sqrt{2\left(x^{2}+y^{2}\right)+1}, \\
\text { Also, }(x-1)^{2}+(y+1)^{2}=3 \Rightarrow x^{2}+y^{2} \leqslant(\sqrt{2}+\sqrt{3})^{2}=5+2 \sqrt{6},
\end{array}
$$

Therefore, the maximum value of $M$ is $\sqrt{11+4 \sqrt{6}}=2 \sqrt{2}+\sqrt{3}$.