function post( action, data ) {
	return wp.ajax.post( action, {
		_ajax_nonce: SimpleStatsVue.wpNonce,
		...data,
	} );
}

export default {
	createUser:     ( email, optin )    => post( 'simplestats_auth_create_user', { email, optin: optin ? 1 : 0 } ),
	createSite:     ( trackingType )    => post( 'simplestats_auth_create_site', { tracking_type: trackingType } ),
	signIn:         ( email, password ) => post( 'simplestats_auth_sign_in',     { email, password } ),
	forgotPassword: ( email )           => post( 'simplestats_auth_forgot',      { email } ),
};
