Solution (source code)

= Solution

Since the <magnetic field> is $B=\nabla\times A$, <Stokes theorem> gives, for any oriented surface $S$ bounded by $C$,
$$
\Phi=\int_SB\mathbin{\cdot}dS
=\int_S(\nabla\times A)\mathbin{\cdot}dS
=\boxed{\oint_CA\mathbin{\cdot}dx}.
$$
Under a <gauge transformation> $A\mapsto A+\nabla\chi$, the integral changes by
$$
\oint_C\nabla\chi\mathbin{\cdot}dx=0
$$
because $C$ is closed. The flux expression is therefore gauge independent.