My question is an extension of this question and is about the power of a one-sided z-test for proportion differences: I have samples from two Binomially distributed trials $X_A\sim\text{Bin}(n_A, p_A), X_B\sim\text{Bin}(n_B, p_B)$, i.e. I know the outcomes $x_A, x_B$ as well as the sample sizes $n_A, n_B$. I would like to test whether $X_B$ exhibits a significantly higher success rate than $X_A$ using the MLE estimates $\hat{p}_A=\frac{x_A}{n_A}, \hat{p}_B=\frac{x_B}{n_B}$ as proxies for the success rates: $$ H_0: \hat{p}_A\geq \hat{p}_B\\ H_1: \hat{p}_A < \hat{p}_B $$
The z-statistic is given by $$ z = \frac{\hat{p}_B-\hat{p}_A}{\sqrt{\hat{p}(1-\hat{p})(n_A^{-1}+n_B^{-1})}} $$ where $\hat{p}=\frac{n_A\hat{p}_A+n_B\hat{p}_B}{n_A+n_B}$.
According to this document (page 6) the power of the z-test is given by $$ P(\text{reject H}_0|\ \text{H}_0\text{ false})=1-\Phi\left[\frac{\sqrt{n}(p_A-p_B)+z_{\alpha}\sqrt{p_A(1-p_A)}}{\sqrt{p_B(1-p_B)}}\right] $$ I am not quite sure how to arrive at this result.
Thanks for the help