_previewDropMovedRow(hand) {
        if (hand.pos === undefined) {
            return this;
        }
        let handWire = this.wireIndexAt(hand.pos.y);
        if (handWire < 0 || handWire >= this.circuitDefinition.numWires) {
            // Dragged the row out of the circuit.
            return this;
        }

        let heldRowHeight = seq(hand.heldRow.gates).map(g => g === undefined ? 1 : g.height).max(1);
        handWire = Math.min(handWire, this.circuitDefinition.numWires - heldRowHeight);

        let newCols = [];
        for (let c = 0; c < this.circuitDefinition.columns.length; c++) {
            let gates = [...this.circuitDefinition.columns[c].gates];
            gates.splice(handWire, 0, hand.heldRow.gates[c]);
            gates.pop();
            newCols.push(new GateColumn(gates));
        }

        let newInitialStates = seq(this.circuitDefinition.customInitialValues.entries()).
            map(([k, v]) => [k + (k >= handWire ? 1 : 0), v]).
            toMap(([k, _]) => k, ([_, v]) => v);
        if (hand.heldRow.initialState !== undefined) {
            newInitialStates.set(handWire, hand.heldRow.initialState);
        }
        let newCircuitDef = this.circuitDefinition.withColumns(newCols).withInitialStates(newInitialStates);

        return this.withCircuit(newCircuitDef).
            _withHighlightedSlot({row: handWire, col: undefined, resizeStyle: false});
    }
@param {!Hand} hand
@returns {!DisplayedCircuit}
@private