import number_default from "./number.js";
var reA = /[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g, reB = new RegExp(reA.source, "g");
function zero(e) {
	return function() {
		return e;
	};
}
function one(e) {
	return function(r) {
		return e(r) + "";
	};
}
function string_default(a, o) {
	var s = reA.lastIndex = reB.lastIndex = 0, c, l, u, d = -1, f = [], p = [];
	for (a += "", o += ""; (c = reA.exec(a)) && (l = reB.exec(o));) (u = l.index) > s && (u = o.slice(s, u), f[d] ? f[d] += u : f[++d] = u), (c = c[0]) === (l = l[0]) ? f[d] ? f[d] += l : f[++d] = l : (f[++d] = null, p.push({
		i: d,
		x: number_default(c, l)
	})), s = reB.lastIndex;
	return s < o.length && (u = o.slice(s), f[d] ? f[d] += u : f[++d] = u), f.length < 2 ? p[0] ? one(p[0].x) : zero(o) : (o = p.length, function(e) {
		for (var r = 0, i; r < o; ++r) f[(i = p[r]).i] = i.x(e);
		return f.join("");
	});
}
export { string_default as default };
