import{a as g}from"./chunk-AQ6EADP3.mjs";function tt(a,t,s){if(a&&a.length){let[e,n]=t,o=Math.PI/180*s,r=Math.cos(o),h=Math.sin(o);for(let i of a){let[l,c]=i;i[0]=(l-e)*r-(c-n)*h+e,i[1]=(l-e)*h+(c-n)*r+n}}}g(tt,"t");function Wt(a,t){return a[0]===t[0]&&a[1]===t[1]}g(Wt,"e");function Et(a,t,s,e=1){let n=s,o=Math.max(t,.1),r=a[0]&&a[0][0]&&typeof a[0][0]=="number"?[a]:a,h=[0,0];if(n)for(let l of r)tt(l,h,n);let i=(function(l,c,d){let p=[];for(let k of l){let w=[...k];Wt(w[0],w[w.length-1])||w.push([w[0][0],w[0][1]]),w.length>2&&p.push(w)}let u=[];c=Math.max(c,.1);let f=[];for(let k of p)for(let w=0;wk.yminw.ymin?1:k.xw.x?1:k.ymax===w.ymax?0:(k.ymax-w.ymax)/Math.abs(k.ymax-w.ymax))),!f.length)return u;let M=[],b=f[0].ymin,y=0;for(;M.length||f.length;){if(f.length){let k=-1;for(let w=0;wb);w++)k=w;f.splice(0,k+1).forEach((w=>{M.push({s:b,edge:w})}))}if(M=M.filter((k=>!(k.edge.ymax<=b))),M.sort(((k,w)=>k.edge.x===w.edge.x?0:(k.edge.x-w.edge.x)/Math.abs(k.edge.x-w.edge.x))),(d!==1||y%c==0)&&M.length>1)for(let k=0;k=M.length)break;let v=M[k].edge,P=M[w].edge;u.push([[Math.round(v.x),b],[Math.round(P.x),b]])}b+=d,M.forEach((k=>{k.edge.x=k.edge.x+d*k.edge.islope})),y++}return u})(r,o,e);if(n){for(let l of r)tt(l,h,-n);(function(l,c,d){let p=[];l.forEach((u=>p.push(...u))),tt(p,c,d)})(i,h,-n)}return i}g(Et,"s");function V(a,t){var s;let e=t.hachureAngle+90,n=t.hachureGap;n<0&&(n=4*t.strokeWidth),n=Math.round(Math.max(n,.1));let o=1;return t.roughness>=1&&(((s=t.randomizer)===null||s===void 0?void 0:s.next())||Math.random())>.7&&(o=n),Et(a,n,e,o||1)}g(V,"n");var F=class{static{g(this,"o")}constructor(t){this.helper=t}fillPolygons(t,s){return this._fillPolygons(t,s)}_fillPolygons(t,s){let e=V(t,s);return{type:"fillSketch",ops:this.renderLines(e,s)}}renderLines(t,s){let e=[];for(let n of t)e.push(...this.helper.doubleLineOps(n[0][0],n[0][1],n[1][0],n[1][1],s));return e}};function Y(a){let t=a[0],s=a[1];return Math.sqrt(Math.pow(t[0]-s[0],2)+Math.pow(t[1]-s[1],2))}g(Y,"a");var ot=class extends F{static{g(this,"h")}fillPolygons(t,s){let e=s.hachureGap;e<0&&(e=4*s.strokeWidth),e=Math.max(e,.1);let n=V(t,Object.assign({},s,{hachureGap:e})),o=Math.PI/180*s.hachureAngle,r=[],h=.5*e*Math.cos(o),i=.5*e*Math.sin(o);for(let[l,c]of n)Y([l,c])&&r.push([[l[0]-h,l[1]+i],[...c]],[[l[0]+h,l[1]-i],[...c]]);return{type:"fillSketch",ops:this.renderLines(r,s)}}},ht=class extends F{static{g(this,"r")}fillPolygons(t,s){let e=this._fillPolygons(t,s),n=Object.assign({},s,{hachureAngle:s.hachureAngle+90}),o=this._fillPolygons(t,n);return e.ops=e.ops.concat(o.ops),e}},rt=class{static{g(this,"i")}constructor(t){this.helper=t}fillPolygons(t,s){let e=V(t,s=Object.assign({},s,{hachureAngle:0}));return this.dotsOnLines(e,s)}dotsOnLines(t,s){let e=[],n=s.hachureGap;n<0&&(n=4*s.strokeWidth),n=Math.max(n,.1);let o=s.fillWeight;o<0&&(o=s.strokeWidth/2);let r=n/4;for(let h of t){let i=Y(h),l=i/n,c=Math.ceil(l)-1,d=i-c*n,p=(h[0][0]+h[1][0])/2-n/4,u=Math.min(h[0][1],h[1][1]);for(let f=0;f{let h=Y(r),i=Math.floor(h/(e+n)),l=(h+n-i*(e+n))/2,c=r[0],d=r[1];c[0]>d[0]&&(c=r[1],d=r[0]);let p=Math.atan((d[1]-c[1])/(d[0]-c[0]));for(let u=0;u{let r=Y(o),h=Math.round(r/(2*s)),i=o[0],l=o[1];i[0]>l[0]&&(i=o[1],l=o[0]);let c=Math.atan((l[1]-i[1])/(l[0]-i[0]));for(let d=0;dc%2?l+s:l+t));o.push({key:"C",data:i}),t=i[4],s=i[5];break}case"Q":o.push({key:"Q",data:[...h]}),t=h[2],s=h[3];break;case"q":{let i=h.map(((l,c)=>c%2?l+s:l+t));o.push({key:"Q",data:i}),t=i[2],s=i[3];break}case"A":o.push({key:"A",data:[...h]}),t=h[5],s=h[6];break;case"a":t+=h[5],s+=h[6],o.push({key:"A",data:[h[0],h[1],h[2],h[3],h[4],t,s]});break;case"H":o.push({key:"H",data:[...h]}),t=h[0];break;case"h":t+=h[0],o.push({key:"H",data:[t]});break;case"V":o.push({key:"V",data:[...h]}),s=h[0];break;case"v":s+=h[0],o.push({key:"V",data:[s]});break;case"S":o.push({key:"S",data:[...h]}),t=h[2],s=h[3];break;case"s":{let i=h.map(((l,c)=>c%2?l+s:l+t));o.push({key:"S",data:i}),t=i[2],s=i[3];break}case"T":o.push({key:"T",data:[...h]}),t=h[0],s=h[1];break;case"t":t+=h[0],s+=h[1],o.push({key:"T",data:[t,s]});break;case"Z":case"z":o.push({key:"Z",data:[]}),t=e,s=n}return o}g(Lt,"y");function Tt(a){let t=[],s="",e=0,n=0,o=0,r=0,h=0,i=0;for(let{key:l,data:c}of a){switch(l){case"M":t.push({key:"M",data:[...c]}),[e,n]=c,[o,r]=c;break;case"C":t.push({key:"C",data:[...c]}),e=c[4],n=c[5],h=c[2],i=c[3];break;case"L":t.push({key:"L",data:[...c]}),[e,n]=c;break;case"H":e=c[0],t.push({key:"L",data:[e,n]});break;case"V":n=c[0],t.push({key:"L",data:[e,n]});break;case"S":{let d=0,p=0;s==="C"||s==="S"?(d=e+(e-h),p=n+(n-i)):(d=e,p=n),t.push({key:"C",data:[d,p,...c]}),h=c[0],i=c[1],e=c[2],n=c[3];break}case"T":{let[d,p]=c,u=0,f=0;s==="Q"||s==="T"?(u=e+(e-h),f=n+(n-i)):(u=e,f=n);let M=e+2*(u-e)/3,b=n+2*(f-n)/3,y=d+2*(u-d)/3,k=p+2*(f-p)/3;t.push({key:"C",data:[M,b,y,k,d,p]}),h=u,i=f,e=d,n=p;break}case"Q":{let[d,p,u,f]=c,M=e+2*(d-e)/3,b=n+2*(p-n)/3,y=u+2*(d-u)/3,k=f+2*(p-f)/3;t.push({key:"C",data:[M,b,y,k,u,f]}),h=d,i=p,e=u,n=f;break}case"A":{let d=Math.abs(c[0]),p=Math.abs(c[1]),u=c[2],f=c[3],M=c[4],b=c[5],y=c[6];d===0||p===0?(t.push({key:"C",data:[e,n,b,y,b,y]}),e=b,n=y):(e!==b||n!==y)&&(Dt(e,n,b,y,d,p,u,f,M).forEach((function(k){t.push({key:"C",data:k})})),e=b,n=y);break}case"Z":t.push({key:"Z",data:[]}),e=o,n=r}s=l}return t}g(Tt,"m");function j(a,t,s){return[a*Math.cos(s)-t*Math.sin(s),a*Math.sin(s)+t*Math.cos(s)]}g(j,"w");function Dt(a,t,s,e,n,o,r,h,i,l){let c=(d=r,Math.PI*d/180);var d;let p=[],u=0,f=0,M=0,b=0;if(l)[u,f,M,b]=l;else{[a,t]=j(a,t,-c),[s,e]=j(s,e,-c);let D=(a-s)/2,S=(t-e)/2,I=D*D/(n*n)+S*S/(o*o);I>1&&(I=Math.sqrt(I),n*=I,o*=I);let E=n*n,G=o*o,Ct=E*G-E*S*S-G*D*D,zt=E*S*S+G*D*D,bt=(h===i?-1:1)*Math.sqrt(Math.abs(Ct/zt));M=bt*n*S/o+(a+s)/2,b=bt*-o*D/n+(t+e)/2,u=Math.asin(parseFloat(((t-b)/o).toFixed(9))),f=Math.asin(parseFloat(((e-b)/o).toFixed(9))),af&&(u-=2*Math.PI),!i&&f>u&&(f-=2*Math.PI)}let y=f-u;if(Math.abs(y)>120*Math.PI/180){let D=f,S=s,I=e;f=i&&f>u?u+120*Math.PI/180*1:u+120*Math.PI/180*-1,p=Dt(s=M+n*Math.cos(f),e=b+o*Math.sin(f),S,I,n,o,r,0,i,[f,D,M,b])}y=f-u;let k=Math.cos(u),w=Math.sin(u),v=Math.cos(f),P=Math.sin(f),x=Math.tan(y/4),T=4/3*n*x,_=4/3*o*x,Z=[a,t],A=[a+T*w,t-_*k],z=[s+T*P,e-_*v],kt=[s,e];if(A[0]=2*Z[0]-A[0],A[1]=2*Z[1]-A[1],l)return[A,z,kt].concat(p);{p=[A,z,kt].concat(p);let D=[];for(let S=0;S2){let n=[];for(let o=0;o2*Math.PI&&(u=0,f=2*Math.PI);let M=2*Math.PI/i.curveStepCount,b=Math.min(M/2,(f-u)/2),y=St(b,l,c,d,p,u,f,1,i);if(!i.disableMultiStroke){let k=St(b,l,c,d,p,u,f,1.5,i);y.push(...k)}return r&&(h?y.push(...C(l,c,l+d*Math.cos(u),c+p*Math.sin(u),i),...C(l,c,l+d*Math.cos(f),c+p*Math.sin(f),i)):y.push({op:"lineTo",data:[l,c]},{op:"lineTo",data:[l+d*Math.cos(u),c+p*Math.sin(u)]})),{type:"path",ops:y}}g(wt,"A");function xt(a,t){let s=Tt(Lt(Mt(a))),e=[],n=[0,0],o=[0,0];for(let{key:r,data:h}of s)switch(r){case"M":o=[h[0],h[1]],n=[h[0],h[1]];break;case"L":e.push(...C(o[0],o[1],h[0],h[1],t)),o=[h[0],h[1]];break;case"C":{let[i,l,c,d,p,u]=h;e.push(...jt(i,l,c,d,p,u,o,t)),o=[p,u];break}case"Z":e.push(...C(o[0],o[1],n[0],n[1],t)),o=[n[0],n[1]]}return{type:"path",ops:e}}g(xt,"_");function nt(a,t){let s=[];for(let e of a)if(e.length){let n=t.maxRandomnessOffset||0,o=e.length;if(o>2){s.push({op:"move",data:[e[0][0]+m(n,t),e[0][1]+m(n,t)]});for(let r=1;r500?.4:-.0016668*i+1.233334;let c=n.maxRandomnessOffset||0;c*c*100>h&&(c=i/10);let d=c/2,p=.2+.2*It(n),u=n.bowing*n.maxRandomnessOffset*(e-t)/200,f=n.bowing*n.maxRandomnessOffset*(a-s)/200;u=m(u,n,l),f=m(f,n,l);let M=[],b=g(()=>m(d,n,l),"M"),y=g(()=>m(c,n,l),"k"),k=n.preserveVertices;return o&&(r?M.push({op:"move",data:[a+(k?0:b()),t+(k?0:b())]}):M.push({op:"move",data:[a+(k?0:m(c,n,l)),t+(k?0:m(c,n,l))]})),r?M.push({op:"bcurveTo",data:[u+a+(s-a)*p+b(),f+t+(e-t)*p+b(),u+a+2*(s-a)*p+b(),f+t+2*(e-t)*p+b(),s+(k?0:b()),e+(k?0:b())]}):M.push({op:"bcurveTo",data:[u+a+(s-a)*p+y(),f+t+(e-t)*p+y(),u+a+2*(s-a)*p+y(),f+t+2*(e-t)*p+y(),s+(k?0:y()),e+(k?0:y())]}),M}g(pt,"R");function H(a,t,s){if(!a.length)return[];let e=[];e.push([a[0][0]+m(t,s),a[0][1]+m(t,s)]),e.push([a[0][0]+m(t,s),a[0][1]+m(t,s)]);for(let n=1;n3){let o=[],r=1-s.curveTightness;n.push({op:"move",data:[a[1][0],a[1][1]]});for(let h=1;h+21&&n.push(h)):n.push(h),n.push(a[t+3])}else{let i=a[t+0],l=a[t+1],c=a[t+2],d=a[t+3],p=W(i,l,.5),u=W(l,c,.5),f=W(c,d,.5),M=W(p,u,.5),b=W(u,f,.5),y=W(M,b,.5);ft([i,p,M,y],0,s,n),ft([y,b,f,d],0,s,n)}var o,r;return n}g(ft,"K");function Ft(a,t){return X(a,0,a.length,t)}g(Ft,"U");function X(a,t,s,e,n){let o=n||[],r=a[t],h=a[s-1],i=0,l=1;for(let c=t+1;ci&&(i=d,l=c)}return Math.sqrt(i)>e?(X(a,t,l+1,e,o),X(a,l,s,e,o)):(o.length||o.push(r),o.push(h)),o}g(X,"X");function at(a,t=.15,s){let e=[],n=(a.length-1)/3;for(let o=0;o0?X(e,0,e.length,s):e}g(at,"Y");var L="none",R=class{static{g(this,"et")}constructor(t){this.defaultOptions={maxRandomnessOffset:2,roughness:1,bowing:1,stroke:"#000",strokeWidth:1,curveTightness:0,curveFitting:.95,curveStepCount:9,fillStyle:"hachure",fillWeight:-1,hachureAngle:-41,hachureGap:-1,dashOffset:-1,dashGap:-1,zigzagOffset:-1,seed:0,disableMultiStroke:!1,disableMultiStrokeFill:!1,preserveVertices:!1,fillShapeRoughnessGain:.8},this.config=t||{},this.config.options&&(this.defaultOptions=this._o(this.config.options))}static newSeed(){return Math.floor(Math.random()*2**31)}_o(t){return t?Object.assign({},this.defaultOptions,t):this.defaultOptions}_d(t,s,e){return{shape:t,sets:s||[],options:e||this.defaultOptions}}line(t,s,e,n,o){let r=this._o(o);return this._d("line",[At(t,s,e,n,r)],r)}rectangle(t,s,e,n,o){let r=this._o(o),h=[],i=Rt(t,s,e,n,r);if(r.fill){let l=[[t,s],[t+e,s],[t+e,s+n],[t,s+n]];r.fillStyle==="solid"?h.push(nt([l],r)):h.push($([l],r))}return r.stroke!==L&&h.push(i),this._d("rectangle",h,r)}ellipse(t,s,e,n,o){let r=this._o(o),h=[],i=_t(e,n,r),l=ut(t,s,r,i);if(r.fill)if(r.fillStyle==="solid"){let c=ut(t,s,r,i).opset;c.type="fillPath",h.push(c)}else h.push($([l.estimatedPoints],r));return r.stroke!==L&&h.push(l.opset),this._d("ellipse",h,r)}circle(t,s,e,n){let o=this.ellipse(t,s,e,e,n);return o.shape="circle",o}linearPath(t,s){let e=this._o(s);return this._d("linearPath",[B(t,!1,e)],e)}arc(t,s,e,n,o,r,h=!1,i){let l=this._o(i),c=[],d=wt(t,s,e,n,o,r,h,!0,l);if(h&&l.fill)if(l.fillStyle==="solid"){let p=Object.assign({},l);p.disableMultiStroke=!0;let u=wt(t,s,e,n,o,r,!0,!1,p);u.type="fillPath",c.push(u)}else c.push((function(p,u,f,M,b,y,k){let w=p,v=u,P=Math.abs(f/2),x=Math.abs(M/2);P+=m(.01*P,k),x+=m(.01*x,k);let T=b,_=y;for(;T<0;)T+=2*Math.PI,_+=2*Math.PI;_-T>2*Math.PI&&(T=0,_=2*Math.PI);let Z=(_-T)/k.curveStepCount,A=[];for(let z=T;z<=_;z+=Z)A.push([w+P*Math.cos(z),v+x*Math.sin(z)]);return A.push([w+P*Math.cos(_),v+x*Math.sin(_)]),A.push([w,v]),$([A],k)})(t,s,e,n,o,r,l));return l.stroke!==L&&c.push(d),this._d("arc",c,l)}curve(t,s){let e=this._o(s),n=[],o=mt(t,e);if(e.fill&&e.fill!==L)if(e.fillStyle==="solid"){let r=mt(t,Object.assign(Object.assign({},e),{disableMultiStroke:!0,roughness:e.roughness?e.roughness+e.fillShapeRoughnessGain:0}));n.push({type:"fillPath",ops:this._mergedShape(r.ops)})}else{let r=[],h=t;if(h.length){let i=typeof h[0][0]=="number"?[h]:h;for(let l of i)l.length<3?r.push(...l):l.length===3?r.push(...at(Ot([l[0],l[0],l[1],l[2]]),10,(1+e.roughness)/2)):r.push(...at(Ot(l),10,(1+e.roughness)/2))}r.length&&n.push($([r],e))}return e.stroke!==L&&n.push(o),this._d("curve",n,e)}polygon(t,s){let e=this._o(s),n=[],o=B(t,!0,e);return e.fill&&(e.fillStyle==="solid"?n.push(nt([t],e)):n.push($([t],e))),e.stroke!==L&&n.push(o),this._d("polygon",n,e)}path(t,s){let e=this._o(s),n=[];if(!t)return this._d("path",n,e);t=(t||"").replace(/\n/g," ").replace(/(-\s)/g,"-").replace("/(ss)/g"," ");let o=e.fill&&e.fill!=="transparent"&&e.fill!==L,r=e.stroke!==L,h=!!(e.simplification&&e.simplification<1),i=(function(c,d,p){let u=Tt(Lt(Mt(c))),f=[],M=[],b=[0,0],y=[],k=g(()=>{y.length>=4&&M.push(...at(y,d)),y=[]},"i"),w=g(()=>{k(),M.length&&(f.push(M),M=[])},"c");for(let{key:P,data:x}of u)switch(P){case"M":w(),b=[x[0],x[1]],M.push(b);break;case"L":k(),M.push([x[0],x[1]]);break;case"C":if(!y.length){let T=M.length?M[M.length-1]:b;y.push([T[0],T[1]])}y.push([x[0],x[1]]),y.push([x[2],x[3]]),y.push([x[4],x[5]]);break;case"Z":k(),M.push([b[0],b[1]])}if(w(),!p)return f;let v=[];for(let P of f){let x=Ft(P,p);x.length&&v.push(x)}return v})(t,1,h?4-4*(e.simplification||1):(1+e.roughness)/2),l=xt(t,e);if(o)if(e.fillStyle==="solid")if(i.length===1){let c=xt(t,Object.assign(Object.assign({},e),{disableMultiStroke:!0,roughness:e.roughness?e.roughness+e.fillShapeRoughnessGain:0}));n.push({type:"fillPath",ops:this._mergedShape(c.ops)})}else n.push(nt(i,e));else n.push($(i,e));return r&&(h?i.forEach((c=>{n.push(B(c,!1,e))})):n.push(l)),this._d("path",n,e)}opsToPath(t,s){let e="";for(let n of t.ops){let o=typeof s=="number"&&s>=0?n.data.map((r=>+r.toFixed(s))):n.data;switch(n.op){case"move":e+=`M${o[0]} ${o[1]} `;break;case"bcurveTo":e+=`C${o[0]} ${o[1]}, ${o[2]} ${o[3]}, ${o[4]} ${o[5]} `;break;case"lineTo":e+=`L${o[0]} ${o[1]} `}}return e.trim()}toPaths(t){let s=t.sets||[],e=t.options||this.defaultOptions,n=[];for(let o of s){let r=null;switch(o.type){case"path":r={d:this.opsToPath(o),stroke:e.stroke,strokeWidth:e.strokeWidth,fill:L};break;case"fillPath":r={d:this.opsToPath(o),stroke:L,strokeWidth:0,fill:e.fill||L};break;case"fillSketch":r=this.fillSketch(o,e)}r&&n.push(r)}return n}fillSketch(t,s){let e=s.fillWeight;return e<0&&(e=s.strokeWidth/2),{d:this.opsToPath(t),stroke:s.fill||L,strokeWidth:e,fill:L}}_mergedShape(t){return t.filter(((s,e)=>e===0||s.op!=="move"))}},dt=class{static{g(this,"st")}constructor(t,s){this.canvas=t,this.ctx=this.canvas.getContext("2d"),this.gen=new R(s)}draw(t){let s=t.sets||[],e=t.options||this.getDefaultOptions(),n=this.ctx,o=t.options.fixedDecimalPlaceDigits;for(let r of s)switch(r.type){case"path":n.save(),n.strokeStyle=e.stroke==="none"?"transparent":e.stroke,n.lineWidth=e.strokeWidth,e.strokeLineDash&&n.setLineDash(e.strokeLineDash),e.strokeLineDashOffset&&(n.lineDashOffset=e.strokeLineDashOffset),this._drawToContext(n,r,o),n.restore();break;case"fillPath":{n.save(),n.fillStyle=e.fill||"";let h=t.shape==="curve"||t.shape==="polygon"||t.shape==="path"?"evenodd":"nonzero";this._drawToContext(n,r,o,h),n.restore();break}case"fillSketch":this.fillSketch(n,r,e)}}fillSketch(t,s,e){let n=e.fillWeight;n<0&&(n=e.strokeWidth/2),t.save(),e.fillLineDash&&t.setLineDash(e.fillLineDash),e.fillLineDashOffset&&(t.lineDashOffset=e.fillLineDashOffset),t.strokeStyle=e.fill||"",t.lineWidth=n,this._drawToContext(t,s,e.fixedDecimalPlaceDigits),t.restore()}_drawToContext(t,s,e,n="nonzero"){t.beginPath();for(let o of s.ops){let r=typeof e=="number"&&e>=0?o.data.map((h=>+h.toFixed(e))):o.data;switch(o.op){case"move":t.moveTo(r[0],r[1]);break;case"bcurveTo":t.bezierCurveTo(r[0],r[1],r[2],r[3],r[4],r[5]);break;case"lineTo":t.lineTo(r[0],r[1])}}s.type==="fillPath"?t.fill(n):t.stroke()}get generator(){return this.gen}getDefaultOptions(){return this.gen.defaultOptions}line(t,s,e,n,o){let r=this.gen.line(t,s,e,n,o);return this.draw(r),r}rectangle(t,s,e,n,o){let r=this.gen.rectangle(t,s,e,n,o);return this.draw(r),r}ellipse(t,s,e,n,o){let r=this.gen.ellipse(t,s,e,n,o);return this.draw(r),r}circle(t,s,e,n){let o=this.gen.circle(t,s,e,n);return this.draw(o),o}linearPath(t,s){let e=this.gen.linearPath(t,s);return this.draw(e),e}polygon(t,s){let e=this.gen.polygon(t,s);return this.draw(e),e}arc(t,s,e,n,o,r,h=!1,i){let l=this.gen.arc(t,s,e,n,o,r,h,i);return this.draw(l),l}curve(t,s){let e=this.gen.curve(t,s);return this.draw(e),e}path(t,s){let e=this.gen.path(t,s);return this.draw(e),e}},N="http://www.w3.org/2000/svg",gt=class{static{g(this,"ot")}constructor(t,s){this.svg=t,this.gen=new R(s)}draw(t){let s=t.sets||[],e=t.options||this.getDefaultOptions(),n=this.svg.ownerDocument||window.document,o=n.createElementNS(N,"g"),r=t.options.fixedDecimalPlaceDigits;for(let h of s){let i=null;switch(h.type){case"path":i=n.createElementNS(N,"path"),i.setAttribute("d",this.opsToPath(h,r)),i.setAttribute("stroke",e.stroke),i.setAttribute("stroke-width",e.strokeWidth+""),i.setAttribute("fill","none"),e.strokeLineDash&&i.setAttribute("stroke-dasharray",e.strokeLineDash.join(" ").trim()),e.strokeLineDashOffset&&i.setAttribute("stroke-dashoffset",`${e.strokeLineDashOffset}`);break;case"fillPath":i=n.createElementNS(N,"path"),i.setAttribute("d",this.opsToPath(h,r)),i.setAttribute("stroke","none"),i.setAttribute("stroke-width","0"),i.setAttribute("fill",e.fill||""),t.shape!=="curve"&&t.shape!=="polygon"||i.setAttribute("fill-rule","evenodd");break;case"fillSketch":i=this.fillSketch(n,h,e)}i&&o.appendChild(i)}return o}fillSketch(t,s,e){let n=e.fillWeight;n<0&&(n=e.strokeWidth/2);let o=t.createElementNS(N,"path");return o.setAttribute("d",this.opsToPath(s,e.fixedDecimalPlaceDigits)),o.setAttribute("stroke",e.fill||""),o.setAttribute("stroke-width",n+""),o.setAttribute("fill","none"),e.fillLineDash&&o.setAttribute("stroke-dasharray",e.fillLineDash.join(" ").trim()),e.fillLineDashOffset&&o.setAttribute("stroke-dashoffset",`${e.fillLineDashOffset}`),o}get generator(){return this.gen}getDefaultOptions(){return this.gen.defaultOptions}opsToPath(t,s){return this.gen.opsToPath(t,s)}line(t,s,e,n,o){let r=this.gen.line(t,s,e,n,o);return this.draw(r)}rectangle(t,s,e,n,o){let r=this.gen.rectangle(t,s,e,n,o);return this.draw(r)}ellipse(t,s,e,n,o){let r=this.gen.ellipse(t,s,e,n,o);return this.draw(r)}circle(t,s,e,n){let o=this.gen.circle(t,s,e,n);return this.draw(o)}linearPath(t,s){let e=this.gen.linearPath(t,s);return this.draw(e)}polygon(t,s){let e=this.gen.polygon(t,s);return this.draw(e)}arc(t,s,e,n,o,r,h=!1,i){let l=this.gen.arc(t,s,e,n,o,r,h,i);return this.draw(l)}curve(t,s){let e=this.gen.curve(t,s);return this.draw(e)}path(t,s){let e=this.gen.path(t,s);return this.draw(e)}},Vt={canvas:g((a,t)=>new dt(a,t),"canvas"),svg:g((a,t)=>new gt(a,t),"svg"),generator:g(a=>new R(a),"generator"),newSeed:g(()=>R.newSeed(),"newSeed")};export{Vt as a};