define('branch/merge-help', [
    'bitbucket/internal/util/events'
], function (
    events
) {

    return {
        init : function() {
            events.on('bitbucket.internal.pull-request.cant.merge', function(pullRequest, conflicted, vetoes, properties) {
                if (conflicted && properties) {
                    // send out an event to inform interested parties that the conflict resolution instructions have changed.
                    events.trigger('bitbucket.internal.branch.plugin.conflict.merge.help', null, {
                        stability: properties['branch.from-ref-stability'],
                        isAutoMergeConflict: properties['branch.auto-merge-conflict']
                    });
                }
            });

        }
    };
});
