javascript – Statements that are not readable

I am having something like this

if (source.length > 0) {
    if (
        source(0).mandatory === true &&
        this.allInputs.documentsType !== "mandatory"
    ) {
        item.mandatory = !item.mandatory;
    } else if (
        source(0).mandatory === false &&
        this.allInputs.documentsType === "mandatory"
    ) {
        item.mandatory = !item.mandatory;
    }
} else {
    if (
        target(0).mandatory === true &&
        this.allInputs.documentsType === "mandatory"
    ) {
        item.mandatory = !item.mandatory;
    } else if (
        target(0).mandatory === false &&
        this.allInputs.documentsType !== "mandatory"
    ) {
        item.mandatory = !item.mandatory;
    }
}

All is workign OK, the problem I have I think this is not readable a lot, can some body help me this refactor, thanks