import '../../../../../../../../_virtual/_commonjsHelpers.mjs';
import { __exports as encoder } from '../../../../../../../../_virtual/encoder2.mjs';
import '../../../../../../../../_virtual/constants.mjs';
import { __exports as constants } from '../../../../../../../../_virtual/constants2.mjs';

'use strict';

Object.defineProperty(encoder, "__esModule", {
	value: true
});

var _constants = constants;

// Encode data string
var encode = function encode(data, structure, separator) {
	var encoded = data.split('').map(function (val, idx) {
		return _constants.BINARIES[structure[idx]];
	}).map(function (val, idx) {
		return val ? val[data[idx]] : '';
	});

	if (separator) {
		var last = data.length - 1;
		encoded = encoded.map(function (val, idx) {
			return idx < last ? val + separator : val;
		});
	}

	return encoded.join('');
};

var _default = encoder.default = encode;

export { _default as default };
//# sourceMappingURL=encoder.mjs.map
