import*as e from"./write.js";import*as r from"./geojson.js";import*as o from"./prj.js";import*as t from"jszip";export default function(i,p){var s=new t,f=s.folder(p&&p.folder?p.folder:"layers");[r.point(i),r.multipoint(i),r.line(i),r.polygon(i),r.pointZ(i),r.multipointZ(i),r.lineZ(i),r.polygonZ(i)].forEach((function(r){r.geometries.length&&r.geometries[0].length&&e(r.properties,r.type,r.geometries,(function(e,t){var i=p&&p.types[r.type.toLowerCase()]?p.types[r.type.toLowerCase()]:r.type;f.file(i+".shp",t.shp.buffer,{binary:!0}),f.file(i+".shx",t.shx.buffer,{binary:!0}),f.file(i+".dbf",t.dbf.buffer,{binary:!0}),f.file(i+".prj",o)}))}));var n={compression:"STORE"};return process.browser||(n.type="nodebuffer"),s.generate(n)}