diff = (A, B) => {
const r = d3.geoCentroid(A)[0] < -120 ? -120 : 0;
const p = d3.geoEquirectangular().rotate([r, 0]);
A = d3.geoProject(A, p).coordinates;
B = d3.geoProject(B, p).coordinates;
return d3.geoStitch({
type: "MultiPolygon",
coordinates: clip.difference(A, B).map((poly) =>
poly.map(
(ring) =>
ring
.map(p.invert)
.map((d) => (Math.abs(d[0]) === 180 && d[1] > 60 ? [d[0], 67] : d))
)
)
});
}