@visactor/vrender-kits 1.0.26-alpha.0 → 1.0.26-alpha.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/index.es.js +631 -576
  2. package/package.json +5 -5
package/dist/index.es.js CHANGED
@@ -72,42 +72,41 @@ typeof SuppressedError === "function" ? SuppressedError : function (error, suppr
72
72
 
73
73
  function t(t, e, s) {
74
74
  if (t && t.length) {
75
- const [n, a] = e,
76
- o = Math.PI / 180 * s,
77
- h = Math.cos(o),
78
- r = Math.sin(o);
79
- t.forEach(t => {
80
- const [e, s] = t;
81
- t[0] = (e - n) * h - (s - a) * r + n, t[1] = (e - n) * r + (s - a) * h + a;
82
- });
75
+ const [n, o] = e,
76
+ a = Math.PI / 180 * s,
77
+ h = Math.cos(a),
78
+ r = Math.sin(a);
79
+ for (const e of t) {
80
+ const [t, s] = e;
81
+ e[0] = (t - n) * h - (s - o) * r + n, e[1] = (t - n) * r + (s - o) * h + o;
82
+ }
83
83
  }
84
84
  }
85
- function e(t) {
86
- const e = t[0],
87
- s = t[1];
88
- return Math.sqrt(Math.pow(e[0] - s[0], 2) + Math.pow(e[1] - s[1], 2));
89
- }
90
- function s(e, s) {
91
- const n = s.hachureAngle + 90;
92
- let a = s.hachureGap;
93
- a < 0 && (a = 4 * s.strokeWidth), a = Math.max(a, .1);
94
- const o = [0, 0];
95
- if (n) for (const s of e) t(s, o, n);
96
- const h = function (t, e) {
97
- const s = [];
98
- for (const e of t) {
99
- const t = [...e];
100
- t[0].join(",") !== t[t.length - 1].join(",") && t.push([t[0][0], t[0][1]]), t.length > 2 && s.push(t);
85
+ function e(t, e) {
86
+ return t[0] === e[0] && t[1] === e[1];
87
+ }
88
+ function s(s, n, o) {
89
+ let a = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 1;
90
+ const h = o,
91
+ r = Math.max(n, .1),
92
+ i = s[0] && s[0][0] && "number" == typeof s[0][0] ? [s] : s,
93
+ c = [0, 0];
94
+ if (h) for (const e of i) t(e, c, h);
95
+ const l = function (t, s, n) {
96
+ const o = [];
97
+ for (const s of t) {
98
+ const t = [...s];
99
+ e(t[0], t[t.length - 1]) || t.push([t[0][0], t[0][1]]), t.length > 2 && o.push(t);
101
100
  }
102
- const n = [];
103
- e = Math.max(e, .1);
104
101
  const a = [];
105
- for (const t of s) for (let e = 0; e < t.length - 1; e++) {
102
+ s = Math.max(s, .1);
103
+ const h = [];
104
+ for (const t of o) for (let e = 0; e < t.length - 1; e++) {
106
105
  const s = t[e],
107
106
  n = t[e + 1];
108
107
  if (s[1] !== n[1]) {
109
108
  const t = Math.min(s[1], n[1]);
110
- a.push({
109
+ h.push({
111
110
  ymin: t,
112
111
  ymax: Math.max(s[1], n[1]),
113
112
  x: t === s[1] ? s[0] : n[0],
@@ -115,43 +114,52 @@ function s(e, s) {
115
114
  });
116
115
  }
117
116
  }
118
- if (a.sort((t, e) => t.ymin < e.ymin ? -1 : t.ymin > e.ymin ? 1 : t.x < e.x ? -1 : t.x > e.x ? 1 : t.ymax === e.ymax ? 0 : (t.ymax - e.ymax) / Math.abs(t.ymax - e.ymax)), !a.length) return n;
119
- let o = [],
120
- h = a[0].ymin;
121
- for (; o.length || a.length;) {
122
- if (a.length) {
117
+ if (h.sort((t, e) => t.ymin < e.ymin ? -1 : t.ymin > e.ymin ? 1 : t.x < e.x ? -1 : t.x > e.x ? 1 : t.ymax === e.ymax ? 0 : (t.ymax - e.ymax) / Math.abs(t.ymax - e.ymax)), !h.length) return a;
118
+ let r = [],
119
+ i = h[0].ymin,
120
+ c = 0;
121
+ for (; r.length || h.length;) {
122
+ if (h.length) {
123
123
  let t = -1;
124
- for (let e = 0; e < a.length && !(a[e].ymin > h); e++) t = e;
125
- a.splice(0, t + 1).forEach(t => {
126
- o.push({
127
- s: h,
124
+ for (let e = 0; e < h.length && !(h[e].ymin > i); e++) t = e;
125
+ h.splice(0, t + 1).forEach(t => {
126
+ r.push({
127
+ s: i,
128
128
  edge: t
129
129
  });
130
130
  });
131
131
  }
132
- if (o = o.filter(t => !(t.edge.ymax <= h)), o.sort((t, e) => t.edge.x === e.edge.x ? 0 : (t.edge.x - e.edge.x) / Math.abs(t.edge.x - e.edge.x)), o.length > 1) for (let t = 0; t < o.length; t += 2) {
132
+ if (r = r.filter(t => !(t.edge.ymax <= i)), r.sort((t, e) => t.edge.x === e.edge.x ? 0 : (t.edge.x - e.edge.x) / Math.abs(t.edge.x - e.edge.x)), (1 !== n || c % s == 0) && r.length > 1) for (let t = 0; t < r.length; t += 2) {
133
133
  const e = t + 1;
134
- if (e >= o.length) break;
135
- const s = o[t].edge,
136
- a = o[e].edge;
137
- n.push([[Math.round(s.x), h], [Math.round(a.x), h]]);
134
+ if (e >= r.length) break;
135
+ const s = r[t].edge,
136
+ n = r[e].edge;
137
+ a.push([[Math.round(s.x), i], [Math.round(n.x), i]]);
138
138
  }
139
- h += e, o.forEach(t => {
140
- t.edge.x = t.edge.x + e * t.edge.islope;
141
- });
139
+ i += n, r.forEach(t => {
140
+ t.edge.x = t.edge.x + n * t.edge.islope;
141
+ }), c++;
142
142
  }
143
- return n;
144
- }(e, a);
145
- if (n) {
146
- for (const s of e) t(s, o, -n);
143
+ return a;
144
+ }(i, r, a);
145
+ if (h) {
146
+ for (const e of i) t(e, c, -h);
147
147
  !function (e, s, n) {
148
- const a = [];
149
- e.forEach(t => a.push(...t)), t(a, s, n);
150
- }(h, o, -n);
148
+ const o = [];
149
+ e.forEach(t => o.push(...t)), t(o, s, n);
150
+ }(l, c, -h);
151
151
  }
152
- return h;
152
+ return l;
153
153
  }
154
- class n {
154
+ function n(t, e) {
155
+ var n;
156
+ const o = e.hachureAngle + 90;
157
+ let a = e.hachureGap;
158
+ a < 0 && (a = 4 * e.strokeWidth), a = Math.round(Math.max(a, .1));
159
+ let h = 1;
160
+ return e.roughness >= 1 && ((null === (n = e.randomizer) || void 0 === n ? void 0 : n.next()) || Math.random()) > .7 && (h = a), s(t, a, o, h || 1);
161
+ }
162
+ class o {
155
163
  constructor(t) {
156
164
  this.helper = t;
157
165
  }
@@ -159,10 +167,10 @@ class n {
159
167
  return this._fillPolygons(t, e);
160
168
  }
161
169
  _fillPolygons(t, e) {
162
- const n = s(t, e);
170
+ const s = n(t, e);
163
171
  return {
164
172
  type: "fillSketch",
165
- ops: this.renderLines(n, e)
173
+ ops: this.renderLines(s, e)
166
174
  };
167
175
  }
168
176
  renderLines(t, e) {
@@ -171,143 +179,148 @@ class n {
171
179
  return s;
172
180
  }
173
181
  }
174
- class a extends n {
175
- fillPolygons(t, n) {
176
- let a = n.hachureGap;
177
- a < 0 && (a = 4 * n.strokeWidth), a = Math.max(a, .1);
178
- const o = s(t, Object.assign({}, n, {
179
- hachureGap: a
182
+ function a(t) {
183
+ const e = t[0],
184
+ s = t[1];
185
+ return Math.sqrt(Math.pow(e[0] - s[0], 2) + Math.pow(e[1] - s[1], 2));
186
+ }
187
+ class h extends o {
188
+ fillPolygons(t, e) {
189
+ let s = e.hachureGap;
190
+ s < 0 && (s = 4 * e.strokeWidth), s = Math.max(s, .1);
191
+ const o = n(t, Object.assign({}, e, {
192
+ hachureGap: s
180
193
  })),
181
- h = Math.PI / 180 * n.hachureAngle,
194
+ h = Math.PI / 180 * e.hachureAngle,
182
195
  r = [],
183
- i = .5 * a * Math.cos(h),
184
- c = .5 * a * Math.sin(h);
185
- for (const [t, s] of o) e([t, s]) && r.push([[t[0] - i, t[1] + c], [...s]], [[t[0] + i, t[1] - c], [...s]]);
196
+ i = .5 * s * Math.cos(h),
197
+ c = .5 * s * Math.sin(h);
198
+ for (const [t, e] of o) a([t, e]) && r.push([[t[0] - i, t[1] + c], [...e]], [[t[0] + i, t[1] - c], [...e]]);
186
199
  return {
187
200
  type: "fillSketch",
188
- ops: this.renderLines(r, n)
201
+ ops: this.renderLines(r, e)
189
202
  };
190
203
  }
191
204
  }
192
- class o extends n {
205
+ class r extends o {
193
206
  fillPolygons(t, e) {
194
207
  const s = this._fillPolygons(t, e),
195
208
  n = Object.assign({}, e, {
196
209
  hachureAngle: e.hachureAngle + 90
197
210
  }),
198
- a = this._fillPolygons(t, n);
199
- return s.ops = s.ops.concat(a.ops), s;
211
+ o = this._fillPolygons(t, n);
212
+ return s.ops = s.ops.concat(o.ops), s;
200
213
  }
201
214
  }
202
- class h {
215
+ class i {
203
216
  constructor(t) {
204
217
  this.helper = t;
205
218
  }
206
219
  fillPolygons(t, e) {
207
- const n = s(t, e = Object.assign({}, e, {
220
+ const s = n(t, e = Object.assign({}, e, {
208
221
  hachureAngle: 0
209
222
  }));
210
- return this.dotsOnLines(n, e);
223
+ return this.dotsOnLines(s, e);
211
224
  }
212
- dotsOnLines(t, s) {
213
- const n = [];
214
- let a = s.hachureGap;
215
- a < 0 && (a = 4 * s.strokeWidth), a = Math.max(a, .1);
216
- let o = s.fillWeight;
217
- o < 0 && (o = s.strokeWidth / 2);
218
- const h = a / 4;
225
+ dotsOnLines(t, e) {
226
+ const s = [];
227
+ let n = e.hachureGap;
228
+ n < 0 && (n = 4 * e.strokeWidth), n = Math.max(n, .1);
229
+ let o = e.fillWeight;
230
+ o < 0 && (o = e.strokeWidth / 2);
231
+ const h = n / 4;
219
232
  for (const r of t) {
220
- const t = e(r),
221
- i = t / a,
233
+ const t = a(r),
234
+ i = t / n,
222
235
  c = Math.ceil(i) - 1,
223
- l = t - c * a,
224
- u = (r[0][0] + r[1][0]) / 2 - a / 4,
236
+ l = t - c * n,
237
+ u = (r[0][0] + r[1][0]) / 2 - n / 4,
225
238
  p = Math.min(r[0][1], r[1][1]);
226
239
  for (let t = 0; t < c; t++) {
227
- const e = p + l + t * a,
240
+ const a = p + l + t * n,
228
241
  r = u - h + 2 * Math.random() * h,
229
- i = e - h + 2 * Math.random() * h,
230
- c = this.helper.ellipse(r, i, o, o, s);
231
- n.push(...c.ops);
242
+ i = a - h + 2 * Math.random() * h,
243
+ c = this.helper.ellipse(r, i, o, o, e);
244
+ s.push(...c.ops);
232
245
  }
233
246
  }
234
247
  return {
235
248
  type: "fillSketch",
236
- ops: n
249
+ ops: s
237
250
  };
238
251
  }
239
252
  }
240
- class r {
253
+ class c {
241
254
  constructor(t) {
242
255
  this.helper = t;
243
256
  }
244
257
  fillPolygons(t, e) {
245
- const n = s(t, e);
258
+ const s = n(t, e);
246
259
  return {
247
260
  type: "fillSketch",
248
- ops: this.dashedLine(n, e)
261
+ ops: this.dashedLine(s, e)
249
262
  };
250
263
  }
251
- dashedLine(t, s) {
252
- const n = s.dashOffset < 0 ? s.hachureGap < 0 ? 4 * s.strokeWidth : s.hachureGap : s.dashOffset,
253
- a = s.dashGap < 0 ? s.hachureGap < 0 ? 4 * s.strokeWidth : s.hachureGap : s.dashGap,
264
+ dashedLine(t, e) {
265
+ const s = e.dashOffset < 0 ? e.hachureGap < 0 ? 4 * e.strokeWidth : e.hachureGap : e.dashOffset,
266
+ n = e.dashGap < 0 ? e.hachureGap < 0 ? 4 * e.strokeWidth : e.hachureGap : e.dashGap,
254
267
  o = [];
255
268
  return t.forEach(t => {
256
- const h = e(t),
257
- r = Math.floor(h / (n + a)),
258
- i = (h + a - r * (n + a)) / 2;
269
+ const h = a(t),
270
+ r = Math.floor(h / (s + n)),
271
+ i = (h + n - r * (s + n)) / 2;
259
272
  let c = t[0],
260
273
  l = t[1];
261
274
  c[0] > l[0] && (c = t[1], l = t[0]);
262
275
  const u = Math.atan((l[1] - c[1]) / (l[0] - c[0]));
263
276
  for (let t = 0; t < r; t++) {
264
- const e = t * (n + a),
265
- h = e + n,
266
- r = [c[0] + e * Math.cos(u) + i * Math.cos(u), c[1] + e * Math.sin(u) + i * Math.sin(u)],
277
+ const a = t * (s + n),
278
+ h = a + s,
279
+ r = [c[0] + a * Math.cos(u) + i * Math.cos(u), c[1] + a * Math.sin(u) + i * Math.sin(u)],
267
280
  l = [c[0] + h * Math.cos(u) + i * Math.cos(u), c[1] + h * Math.sin(u) + i * Math.sin(u)];
268
- o.push(...this.helper.doubleLineOps(r[0], r[1], l[0], l[1], s));
281
+ o.push(...this.helper.doubleLineOps(r[0], r[1], l[0], l[1], e));
269
282
  }
270
283
  }), o;
271
284
  }
272
285
  }
273
- class i {
286
+ class l {
274
287
  constructor(t) {
275
288
  this.helper = t;
276
289
  }
277
290
  fillPolygons(t, e) {
278
- const n = e.hachureGap < 0 ? 4 * e.strokeWidth : e.hachureGap,
279
- a = e.zigzagOffset < 0 ? n : e.zigzagOffset,
280
- o = s(t, e = Object.assign({}, e, {
281
- hachureGap: n + a
291
+ const s = e.hachureGap < 0 ? 4 * e.strokeWidth : e.hachureGap,
292
+ o = e.zigzagOffset < 0 ? s : e.zigzagOffset,
293
+ a = n(t, e = Object.assign({}, e, {
294
+ hachureGap: s + o
282
295
  }));
283
296
  return {
284
297
  type: "fillSketch",
285
- ops: this.zigzagLines(o, a, e)
298
+ ops: this.zigzagLines(a, o, e)
286
299
  };
287
300
  }
288
- zigzagLines(t, s, n) {
289
- const a = [];
301
+ zigzagLines(t, e, s) {
302
+ const n = [];
290
303
  return t.forEach(t => {
291
- const o = e(t),
292
- h = Math.round(o / (2 * s));
304
+ const o = a(t),
305
+ h = Math.round(o / (2 * e));
293
306
  let r = t[0],
294
307
  i = t[1];
295
308
  r[0] > i[0] && (r = t[1], i = t[0]);
296
309
  const c = Math.atan((i[1] - r[1]) / (i[0] - r[0]));
297
310
  for (let t = 0; t < h; t++) {
298
- const e = 2 * t * s,
299
- o = 2 * (t + 1) * s,
300
- h = Math.sqrt(2 * Math.pow(s, 2)),
301
- i = [r[0] + e * Math.cos(c), r[1] + e * Math.sin(c)],
302
- l = [r[0] + o * Math.cos(c), r[1] + o * Math.sin(c)],
311
+ const o = 2 * t * e,
312
+ a = 2 * (t + 1) * e,
313
+ h = Math.sqrt(2 * Math.pow(e, 2)),
314
+ i = [r[0] + o * Math.cos(c), r[1] + o * Math.sin(c)],
315
+ l = [r[0] + a * Math.cos(c), r[1] + a * Math.sin(c)],
303
316
  u = [i[0] + h * Math.cos(c + Math.PI / 4), i[1] + h * Math.sin(c + Math.PI / 4)];
304
- a.push(...this.helper.doubleLineOps(i[0], i[1], u[0], u[1], n), ...this.helper.doubleLineOps(u[0], u[1], l[0], l[1], n));
317
+ n.push(...this.helper.doubleLineOps(i[0], i[1], u[0], u[1], s), ...this.helper.doubleLineOps(u[0], u[1], l[0], l[1], s));
305
318
  }
306
- }), a;
319
+ }), n;
307
320
  }
308
321
  }
309
- const c = {};
310
- class l {
322
+ const u = {};
323
+ class p {
311
324
  constructor(t) {
312
325
  this.seed = t;
313
326
  }
@@ -315,113 +328,116 @@ class l {
315
328
  return this.seed ? (2 ** 31 - 1 & (this.seed = Math.imul(48271, this.seed))) / 2 ** 31 : Math.random();
316
329
  }
317
330
  }
318
- const u = {
319
- A: 7,
320
- a: 7,
321
- C: 6,
322
- c: 6,
323
- H: 1,
324
- h: 1,
325
- L: 2,
326
- l: 2,
327
- M: 2,
328
- m: 2,
329
- Q: 4,
330
- q: 4,
331
- S: 4,
332
- s: 4,
333
- T: 2,
334
- t: 2,
335
- V: 1,
336
- v: 1,
337
- Z: 0,
338
- z: 0
339
- };
340
- function p(t, e) {
331
+ const f = 0,
332
+ d = 1,
333
+ g = 2,
334
+ M = {
335
+ A: 7,
336
+ a: 7,
337
+ C: 6,
338
+ c: 6,
339
+ H: 1,
340
+ h: 1,
341
+ L: 2,
342
+ l: 2,
343
+ M: 2,
344
+ m: 2,
345
+ Q: 4,
346
+ q: 4,
347
+ S: 4,
348
+ s: 4,
349
+ T: 2,
350
+ t: 2,
351
+ V: 1,
352
+ v: 1,
353
+ Z: 0,
354
+ z: 0
355
+ };
356
+ function k(t, e) {
341
357
  return t.type === e;
342
358
  }
343
- function f(t) {
359
+ function b(t) {
344
360
  const e = [],
345
361
  s = function (t) {
346
362
  const e = new Array();
347
363
  for (; "" !== t;) if (t.match(/^([ \t\r\n,]+)/)) t = t.substr(RegExp.$1.length);else if (t.match(/^([aAcChHlLmMqQsStTvVzZ])/)) e[e.length] = {
348
- type: 0,
364
+ type: f,
349
365
  text: RegExp.$1
350
366
  }, t = t.substr(RegExp.$1.length);else {
351
367
  if (!t.match(/^(([-+]?[0-9]+(\.[0-9]*)?|[-+]?\.[0-9]+)([eE][-+]?[0-9]+)?)/)) return [];
352
368
  e[e.length] = {
353
- type: 1,
369
+ type: d,
354
370
  text: `${parseFloat(RegExp.$1)}`
355
371
  }, t = t.substr(RegExp.$1.length);
356
372
  }
357
373
  return e[e.length] = {
358
- type: 2,
374
+ type: g,
359
375
  text: ""
360
376
  }, e;
361
377
  }(t);
362
378
  let n = "BOD",
363
- a = 0,
364
- o = s[a];
365
- for (; !p(o, 2);) {
379
+ o = 0,
380
+ a = s[o];
381
+ for (; !k(a, g);) {
366
382
  let h = 0;
367
383
  const r = [];
368
384
  if ("BOD" === n) {
369
- if ("M" !== o.text && "m" !== o.text) return f("M0,0" + t);
370
- a++, h = u[o.text], n = o.text;
371
- } else p(o, 1) ? h = u[n] : (a++, h = u[o.text], n = o.text);
372
- if (!(a + h < s.length)) throw new Error("Path data ended short");
373
- for (let t = a; t < a + h; t++) {
385
+ if ("M" !== a.text && "m" !== a.text) return b("M0,0" + t);
386
+ o++, h = M[a.text], n = a.text;
387
+ } else k(a, d) ? h = M[n] : (o++, h = M[a.text], n = a.text);
388
+ if (!(o + h < s.length)) throw new Error("Path data ended short");
389
+ for (let t = o; t < o + h; t++) {
374
390
  const e = s[t];
375
- if (!p(e, 1)) throw new Error("Param not a number: " + n + "," + e.text);
391
+ if (!k(e, d)) throw new Error("Param not a number: " + n + "," + e.text);
376
392
  r[r.length] = +e.text;
377
393
  }
378
- if ("number" != typeof u[n]) throw new Error("Bad segment: " + n);
394
+ if ("number" != typeof M[n]) throw new Error("Bad segment: " + n);
379
395
  {
380
396
  const t = {
381
397
  key: n,
382
398
  data: r
383
399
  };
384
- e.push(t), a += h, o = s[a], "M" === n && (n = "L"), "m" === n && (n = "l");
400
+ e.push(t), o += h, a = s[o], "M" === n && (n = "L"), "m" === n && (n = "l");
385
401
  }
386
402
  }
387
403
  return e;
388
404
  }
389
- function d(t) {
405
+ function y(t) {
390
406
  let e = 0,
391
407
  s = 0,
392
408
  n = 0,
393
- a = 0;
394
- const o = [];
409
+ o = 0;
410
+ const a = [];
395
411
  for (const {
396
412
  key: h,
397
413
  data: r
398
414
  } of t) switch (h) {
399
415
  case "M":
400
- o.push({
416
+ a.push({
401
417
  key: "M",
402
418
  data: [...r]
403
- }), [e, s] = r, [n, a] = r;
419
+ }), [e, s] = r, [n, o] = r;
404
420
  break;
405
421
  case "m":
406
- e += r[0], s += r[1], o.push({
422
+ e += r[0], s += r[1], a.push({
407
423
  key: "M",
408
424
  data: [e, s]
409
- }), n = e, a = s;
425
+ }), n = e, o = s;
410
426
  break;
411
427
  case "L":
412
- o.push({
428
+ a.push({
413
429
  key: "L",
414
430
  data: [...r]
415
431
  }), [e, s] = r;
416
432
  break;
417
433
  case "l":
418
- e += r[0], s += r[1], o.push({
434
+ e += r[0], s += r[1], a.push({
419
435
  key: "L",
420
436
  data: [e, s]
421
437
  });
422
438
  break;
423
439
  case "C":
424
- o.push({
440
+ a.push({
425
441
  key: "C",
426
442
  data: [...r]
427
443
  }), e = r[4], s = r[5];
@@ -429,14 +445,14 @@ function d(t) {
429
445
  case "c":
430
446
  {
431
447
  const t = r.map((t, n) => n % 2 ? t + s : t + e);
432
- o.push({
448
+ a.push({
433
449
  key: "C",
434
450
  data: t
435
451
  }), e = t[4], s = t[5];
436
452
  break;
437
453
  }
438
454
  case "Q":
439
- o.push({
455
+ a.push({
440
456
  key: "Q",
441
457
  data: [...r]
442
458
  }), e = r[2], s = r[3];
@@ -444,50 +460,50 @@ function d(t) {
444
460
  case "q":
445
461
  {
446
462
  const t = r.map((t, n) => n % 2 ? t + s : t + e);
447
- o.push({
463
+ a.push({
448
464
  key: "Q",
449
465
  data: t
450
466
  }), e = t[2], s = t[3];
451
467
  break;
452
468
  }
453
469
  case "A":
454
- o.push({
470
+ a.push({
455
471
  key: "A",
456
472
  data: [...r]
457
473
  }), e = r[5], s = r[6];
458
474
  break;
459
475
  case "a":
460
- e += r[5], s += r[6], o.push({
476
+ e += r[5], s += r[6], a.push({
461
477
  key: "A",
462
478
  data: [r[0], r[1], r[2], r[3], r[4], e, s]
463
479
  });
464
480
  break;
465
481
  case "H":
466
- o.push({
482
+ a.push({
467
483
  key: "H",
468
484
  data: [...r]
469
485
  }), e = r[0];
470
486
  break;
471
487
  case "h":
472
- e += r[0], o.push({
488
+ e += r[0], a.push({
473
489
  key: "H",
474
490
  data: [e]
475
491
  });
476
492
  break;
477
493
  case "V":
478
- o.push({
494
+ a.push({
479
495
  key: "V",
480
496
  data: [...r]
481
497
  }), s = r[0];
482
498
  break;
483
499
  case "v":
484
- s += r[0], o.push({
500
+ s += r[0], a.push({
485
501
  key: "V",
486
502
  data: [s]
487
503
  });
488
504
  break;
489
505
  case "S":
490
- o.push({
506
+ a.push({
491
507
  key: "S",
492
508
  data: [...r]
493
509
  }), e = r[2], s = r[3];
@@ -495,39 +511,39 @@ function d(t) {
495
511
  case "s":
496
512
  {
497
513
  const t = r.map((t, n) => n % 2 ? t + s : t + e);
498
- o.push({
514
+ a.push({
499
515
  key: "S",
500
516
  data: t
501
517
  }), e = t[2], s = t[3];
502
518
  break;
503
519
  }
504
520
  case "T":
505
- o.push({
521
+ a.push({
506
522
  key: "T",
507
523
  data: [...r]
508
524
  }), e = r[0], s = r[1];
509
525
  break;
510
526
  case "t":
511
- e += r[0], s += r[1], o.push({
527
+ e += r[0], s += r[1], a.push({
512
528
  key: "T",
513
529
  data: [e, s]
514
530
  });
515
531
  break;
516
532
  case "Z":
517
533
  case "z":
518
- o.push({
534
+ a.push({
519
535
  key: "Z",
520
536
  data: []
521
- }), e = n, s = a;
537
+ }), e = n, s = o;
522
538
  }
523
- return o;
539
+ return a;
524
540
  }
525
- function g(t) {
541
+ function m$2(t) {
526
542
  const e = [];
527
543
  let s = "",
528
544
  n = 0,
529
- a = 0,
530
545
  o = 0,
546
+ a = 0,
531
547
  h = 0,
532
548
  r = 0,
533
549
  i = 0;
@@ -540,90 +556,90 @@ function g(t) {
540
556
  e.push({
541
557
  key: "M",
542
558
  data: [...l]
543
- }), [n, a] = l, [o, h] = l;
559
+ }), [n, o] = l, [a, h] = l;
544
560
  break;
545
561
  case "C":
546
562
  e.push({
547
563
  key: "C",
548
564
  data: [...l]
549
- }), n = l[4], a = l[5], r = l[2], i = l[3];
565
+ }), n = l[4], o = l[5], r = l[2], i = l[3];
550
566
  break;
551
567
  case "L":
552
568
  e.push({
553
569
  key: "L",
554
570
  data: [...l]
555
- }), [n, a] = l;
571
+ }), [n, o] = l;
556
572
  break;
557
573
  case "H":
558
574
  n = l[0], e.push({
559
575
  key: "L",
560
- data: [n, a]
576
+ data: [n, o]
561
577
  });
562
578
  break;
563
579
  case "V":
564
- a = l[0], e.push({
580
+ o = l[0], e.push({
565
581
  key: "L",
566
- data: [n, a]
582
+ data: [n, o]
567
583
  });
568
584
  break;
569
585
  case "S":
570
586
  {
571
587
  let t = 0,
572
- o = 0;
573
- "C" === s || "S" === s ? (t = n + (n - r), o = a + (a - i)) : (t = n, o = a), e.push({
588
+ a = 0;
589
+ "C" === s || "S" === s ? (t = n + (n - r), a = o + (o - i)) : (t = n, a = o), e.push({
574
590
  key: "C",
575
- data: [t, o, ...l]
576
- }), r = l[0], i = l[1], n = l[2], a = l[3];
591
+ data: [t, a, ...l]
592
+ }), r = l[0], i = l[1], n = l[2], o = l[3];
577
593
  break;
578
594
  }
579
595
  case "T":
580
596
  {
581
- const [t, o] = l;
597
+ const [t, a] = l;
582
598
  let h = 0,
583
599
  c = 0;
584
- "Q" === s || "T" === s ? (h = n + (n - r), c = a + (a - i)) : (h = n, c = a);
600
+ "Q" === s || "T" === s ? (h = n + (n - r), c = o + (o - i)) : (h = n, c = o);
585
601
  const u = n + 2 * (h - n) / 3,
586
- p = a + 2 * (c - a) / 3,
602
+ p = o + 2 * (c - o) / 3,
587
603
  f = t + 2 * (h - t) / 3,
588
- d = o + 2 * (c - o) / 3;
604
+ d = a + 2 * (c - a) / 3;
589
605
  e.push({
590
606
  key: "C",
591
- data: [u, p, f, d, t, o]
592
- }), r = h, i = c, n = t, a = o;
607
+ data: [u, p, f, d, t, a]
608
+ }), r = h, i = c, n = t, o = a;
593
609
  break;
594
610
  }
595
611
  case "Q":
596
612
  {
597
- const [t, s, o, h] = l,
613
+ const [t, s, a, h] = l,
598
614
  c = n + 2 * (t - n) / 3,
599
- u = a + 2 * (s - a) / 3,
600
- p = o + 2 * (t - o) / 3,
615
+ u = o + 2 * (s - o) / 3,
616
+ p = a + 2 * (t - a) / 3,
601
617
  f = h + 2 * (s - h) / 3;
602
618
  e.push({
603
619
  key: "C",
604
- data: [c, u, p, f, o, h]
605
- }), r = t, i = s, n = o, a = h;
620
+ data: [c, u, p, f, a, h]
621
+ }), r = t, i = s, n = a, o = h;
606
622
  break;
607
623
  }
608
624
  case "A":
609
625
  {
610
626
  const t = Math.abs(l[0]),
611
627
  s = Math.abs(l[1]),
612
- o = l[2],
628
+ a = l[2],
613
629
  h = l[3],
614
630
  r = l[4],
615
631
  i = l[5],
616
632
  c = l[6];
617
633
  if (0 === t || 0 === s) e.push({
618
634
  key: "C",
619
- data: [n, a, i, c, i, c]
620
- }), n = i, a = c;else if (n !== i || a !== c) {
621
- k(n, a, i, c, t, s, o, h, r).forEach(function (t) {
635
+ data: [n, o, i, c, i, c]
636
+ }), n = i, o = c;else if (n !== i || o !== c) {
637
+ x(n, o, i, c, t, s, a, h, r).forEach(function (t) {
622
638
  e.push({
623
639
  key: "C",
624
640
  data: t
625
641
  });
626
- }), n = i, a = c;
642
+ }), n = i, o = c;
627
643
  }
628
644
  break;
629
645
  }
@@ -631,171 +647,180 @@ function g(t) {
631
647
  e.push({
632
648
  key: "Z",
633
649
  data: []
634
- }), n = o, a = h;
650
+ }), n = a, o = h;
635
651
  }
636
652
  s = c;
637
653
  }
638
654
  return e;
639
655
  }
640
- function M(t, e, s) {
656
+ function w(t, e, s) {
641
657
  return [t * Math.cos(s) - e * Math.sin(s), t * Math.sin(s) + e * Math.cos(s)];
642
658
  }
643
- function k(t, e, s, n, a, o, h, r, i, c) {
659
+ function x(t, e, s, n, o, a, h, r, i, c) {
644
660
  const l = (u = h, Math.PI * u / 180);
645
661
  var u;
646
662
  let p = [],
647
663
  f = 0,
648
664
  d = 0,
649
665
  g = 0,
650
- b = 0;
651
- if (c) [f, d, g, b] = c;else {
652
- [t, e] = M(t, e, -l), [s, n] = M(s, n, -l);
666
+ M = 0;
667
+ if (c) [f, d, g, M] = c;else {
668
+ [t, e] = w(t, e, -l), [s, n] = w(s, n, -l);
653
669
  const h = (t - s) / 2,
654
670
  c = (e - n) / 2;
655
- let u = h * h / (a * a) + c * c / (o * o);
656
- u > 1 && (u = Math.sqrt(u), a *= u, o *= u);
657
- const p = a * a,
658
- k = o * o,
659
- y = p * k - p * c * c - k * h * h,
660
- m = p * c * c + k * h * h,
661
- w = (r === i ? -1 : 1) * Math.sqrt(Math.abs(y / m));
662
- g = w * a * c / o + (t + s) / 2, b = w * -o * h / a + (e + n) / 2, f = Math.asin(parseFloat(((e - b) / o).toFixed(9))), d = Math.asin(parseFloat(((n - b) / o).toFixed(9))), t < g && (f = Math.PI - f), s < g && (d = Math.PI - d), f < 0 && (f = 2 * Math.PI + f), d < 0 && (d = 2 * Math.PI + d), i && f > d && (f -= 2 * Math.PI), !i && d > f && (d -= 2 * Math.PI);
671
+ let u = h * h / (o * o) + c * c / (a * a);
672
+ u > 1 && (u = Math.sqrt(u), o *= u, a *= u);
673
+ const p = o * o,
674
+ k = a * a,
675
+ b = p * k - p * c * c - k * h * h,
676
+ y = p * c * c + k * h * h,
677
+ m = (r === i ? -1 : 1) * Math.sqrt(Math.abs(b / y));
678
+ g = m * o * c / a + (t + s) / 2, M = m * -a * h / o + (e + n) / 2, f = Math.asin(parseFloat(((e - M) / a).toFixed(9))), d = Math.asin(parseFloat(((n - M) / a).toFixed(9))), t < g && (f = Math.PI - f), s < g && (d = Math.PI - d), f < 0 && (f = 2 * Math.PI + f), d < 0 && (d = 2 * Math.PI + d), i && f > d && (f -= 2 * Math.PI), !i && d > f && (d -= 2 * Math.PI);
663
679
  }
664
- let y = d - f;
665
- if (Math.abs(y) > 120 * Math.PI / 180) {
680
+ let k = d - f;
681
+ if (Math.abs(k) > 120 * Math.PI / 180) {
666
682
  const t = d,
667
683
  e = s,
668
684
  r = n;
669
- d = i && d > f ? f + 120 * Math.PI / 180 * 1 : f + 120 * Math.PI / 180 * -1, p = k(s = g + a * Math.cos(d), n = b + o * Math.sin(d), e, r, a, o, h, 0, i, [d, t, g, b]);
685
+ d = i && d > f ? f + 120 * Math.PI / 180 * 1 : f + 120 * Math.PI / 180 * -1, p = x(s = g + o * Math.cos(d), n = M + a * Math.sin(d), e, r, o, a, h, 0, i, [d, t, g, M]);
670
686
  }
671
- y = d - f;
672
- const m = Math.cos(f),
673
- w = Math.sin(f),
674
- x = Math.cos(d),
687
+ k = d - f;
688
+ const b = Math.cos(f),
689
+ y = Math.sin(f),
690
+ m = Math.cos(d),
675
691
  P = Math.sin(d),
676
- v = Math.tan(y / 4),
677
- O = 4 / 3 * a * v,
692
+ v = Math.tan(k / 4),
678
693
  S = 4 / 3 * o * v,
694
+ O = 4 / 3 * a * v,
679
695
  L = [t, e],
680
- T = [t + O * w, e - S * m],
681
- D = [s + O * P, n - S * x],
696
+ T = [t + S * y, e - O * b],
697
+ D = [s + S * P, n - O * m],
682
698
  A = [s, n];
683
699
  if (T[0] = 2 * L[0] - T[0], T[1] = 2 * L[1] - T[1], c) return [T, D, A].concat(p);
684
700
  {
685
701
  p = [T, D, A].concat(p);
686
702
  const t = [];
687
703
  for (let e = 0; e < p.length; e += 3) {
688
- const s = M(p[e][0], p[e][1], l),
689
- n = M(p[e + 1][0], p[e + 1][1], l),
690
- a = M(p[e + 2][0], p[e + 2][1], l);
691
- t.push([s[0], s[1], n[0], n[1], a[0], a[1]]);
704
+ const s = w(p[e][0], p[e][1], l),
705
+ n = w(p[e + 1][0], p[e + 1][1], l),
706
+ o = w(p[e + 2][0], p[e + 2][1], l);
707
+ t.push([s[0], s[1], n[0], n[1], o[0], o[1]]);
692
708
  }
693
709
  return t;
694
710
  }
695
711
  }
696
- const b = {
712
+ const P = {
697
713
  randOffset: function (t, e) {
698
- return A(t, e);
714
+ return G(t, e);
699
715
  },
700
716
  randOffsetWithRange: function (t, e, s) {
701
- return D(t, e, s);
717
+ return E(t, e, s);
702
718
  },
703
- ellipse: function (t, e, s, n, a) {
704
- const o = P(s, n, a);
705
- return v(t, e, a, o).opset;
719
+ ellipse: function (t, e, s, n, o) {
720
+ const a = T(s, n, o);
721
+ return D(t, e, o, a).opset;
706
722
  },
707
- doubleLineOps: function (t, e, s, n, a) {
708
- return I(t, e, s, n, a, !0);
723
+ doubleLineOps: function (t, e, s, n, o) {
724
+ return $(t, e, s, n, o, !0);
709
725
  }
710
726
  };
711
- function y(t, e, s, n, a) {
727
+ function v(t, e, s, n, o) {
712
728
  return {
713
729
  type: "path",
714
- ops: I(t, e, s, n, a)
730
+ ops: $(t, e, s, n, o)
715
731
  };
716
732
  }
717
- function m$2(t, e, s) {
733
+ function S(t, e, s) {
718
734
  const n = (t || []).length;
719
735
  if (n > 2) {
720
- const a = [];
721
- for (let e = 0; e < n - 1; e++) a.push(...I(t[e][0], t[e][1], t[e + 1][0], t[e + 1][1], s));
722
- return e && a.push(...I(t[n - 1][0], t[n - 1][1], t[0][0], t[0][1], s)), {
736
+ const o = [];
737
+ for (let e = 0; e < n - 1; e++) o.push(...$(t[e][0], t[e][1], t[e + 1][0], t[e + 1][1], s));
738
+ return e && o.push(...$(t[n - 1][0], t[n - 1][1], t[0][0], t[0][1], s)), {
723
739
  type: "path",
724
- ops: a
740
+ ops: o
725
741
  };
726
742
  }
727
- return 2 === n ? y(t[0][0], t[0][1], t[1][0], t[1][1], s) : {
743
+ return 2 === n ? v(t[0][0], t[0][1], t[1][0], t[1][1], s) : {
728
744
  type: "path",
729
745
  ops: []
730
746
  };
731
747
  }
732
- function w(t, e, s, n, a) {
748
+ function O(t, e, s, n, o) {
733
749
  return function (t, e) {
734
- return m$2(t, !0, e);
735
- }([[t, e], [t + s, e], [t + s, e + n], [t, e + n]], a);
736
- }
737
- function x(t, e) {
738
- let s = _(t, 1 * (1 + .2 * e.roughness), e);
739
- if (!e.disableMultiStroke) {
740
- const n = _(t, 1.5 * (1 + .22 * e.roughness), function (t) {
741
- const e = Object.assign({}, t);
742
- e.randomizer = void 0, t.seed && (e.seed = t.seed + 1);
743
- return e;
744
- }(e));
745
- s = s.concat(n);
750
+ return S(t, !0, e);
751
+ }([[t, e], [t + s, e], [t + s, e + n], [t, e + n]], o);
752
+ }
753
+ function L(t, e) {
754
+ if (t.length) {
755
+ const s = "number" == typeof t[0][0] ? [t] : t,
756
+ n = j(s[0], 1 * (1 + .2 * e.roughness), e),
757
+ o = e.disableMultiStroke ? [] : j(s[0], 1.5 * (1 + .22 * e.roughness), z(e));
758
+ for (let t = 1; t < s.length; t++) {
759
+ const a = s[t];
760
+ if (a.length) {
761
+ const t = j(a, 1 * (1 + .2 * e.roughness), e),
762
+ s = e.disableMultiStroke ? [] : j(a, 1.5 * (1 + .22 * e.roughness), z(e));
763
+ for (const e of t) "move" !== e.op && n.push(e);
764
+ for (const t of s) "move" !== t.op && o.push(t);
765
+ }
766
+ }
767
+ return {
768
+ type: "path",
769
+ ops: n.concat(o)
770
+ };
746
771
  }
747
772
  return {
748
773
  type: "path",
749
- ops: s
774
+ ops: []
750
775
  };
751
776
  }
752
- function P(t, e, s) {
777
+ function T(t, e, s) {
753
778
  const n = Math.sqrt(2 * Math.PI * Math.sqrt((Math.pow(t / 2, 2) + Math.pow(e / 2, 2)) / 2)),
754
- a = Math.ceil(Math.max(s.curveStepCount, s.curveStepCount / Math.sqrt(200) * n)),
755
- o = 2 * Math.PI / a;
779
+ o = Math.ceil(Math.max(s.curveStepCount, s.curveStepCount / Math.sqrt(200) * n)),
780
+ a = 2 * Math.PI / o;
756
781
  let h = Math.abs(t / 2),
757
782
  r = Math.abs(e / 2);
758
783
  const i = 1 - s.curveFitting;
759
- return h += A(h * i, s), r += A(r * i, s), {
760
- increment: o,
784
+ return h += G(h * i, s), r += G(r * i, s), {
785
+ increment: a,
761
786
  rx: h,
762
787
  ry: r
763
788
  };
764
789
  }
765
- function v(t, e, s, n) {
766
- const [a, o] = z(n.increment, t, e, n.rx, n.ry, 1, n.increment * D(.1, D(.4, 1, s), s), s);
767
- let h = W(a, null, s);
790
+ function D(t, e, s, n) {
791
+ const [o, a] = F(n.increment, t, e, n.rx, n.ry, 1, n.increment * E(.1, E(.4, 1, s), s), s);
792
+ let h = q(o, null, s);
768
793
  if (!s.disableMultiStroke && 0 !== s.roughness) {
769
- const [a] = z(n.increment, t, e, n.rx, n.ry, 1.5, 0, s),
770
- o = W(a, null, s);
771
- h = h.concat(o);
794
+ const [o] = F(n.increment, t, e, n.rx, n.ry, 1.5, 0, s),
795
+ a = q(o, null, s);
796
+ h = h.concat(a);
772
797
  }
773
798
  return {
774
- estimatedPoints: o,
799
+ estimatedPoints: a,
775
800
  opset: {
776
801
  type: "path",
777
802
  ops: h
778
803
  }
779
804
  };
780
805
  }
781
- function O(t, e, s, n, a, o, h, r, i) {
806
+ function A(t, e, s, n, o, a, h, r, i) {
782
807
  const c = t,
783
808
  l = e;
784
809
  let u = Math.abs(s / 2),
785
810
  p = Math.abs(n / 2);
786
- u += A(.01 * u, i), p += A(.01 * p, i);
787
- let f = a,
788
- d = o;
811
+ u += G(.01 * u, i), p += G(.01 * p, i);
812
+ let f = o,
813
+ d = a;
789
814
  for (; f < 0;) f += 2 * Math.PI, d += 2 * Math.PI;
790
815
  d - f > 2 * Math.PI && (f = 0, d = 2 * Math.PI);
791
816
  const g = 2 * Math.PI / i.curveStepCount,
792
817
  M = Math.min(g / 2, (d - f) / 2),
793
- k = E(M, c, l, u, p, f, d, 1, i);
818
+ k = V(M, c, l, u, p, f, d, 1, i);
794
819
  if (!i.disableMultiStroke) {
795
- const t = E(M, c, l, u, p, f, d, 1.5, i);
820
+ const t = V(M, c, l, u, p, f, d, 1.5, i);
796
821
  k.push(...t);
797
822
  }
798
- return h && (r ? k.push(...I(c, l, c + u * Math.cos(f), l + p * Math.sin(f), i), ...I(c, l, c + u * Math.cos(d), l + p * Math.sin(d), i)) : k.push({
823
+ return h && (r ? k.push(...$(c, l, c + u * Math.cos(f), l + p * Math.sin(f), i), ...$(c, l, c + u * Math.cos(d), l + p * Math.sin(d), i)) : k.push({
799
824
  op: "lineTo",
800
825
  data: [c, l]
801
826
  }, {
@@ -806,19 +831,48 @@ function O(t, e, s, n, a, o, h, r, i) {
806
831
  ops: k
807
832
  };
808
833
  }
809
- function S(t, e) {
834
+ function _(t, e) {
835
+ const s = m$2(y(b(t))),
836
+ n = [];
837
+ let o = [0, 0],
838
+ a = [0, 0];
839
+ for (const {
840
+ key: t,
841
+ data: h
842
+ } of s) switch (t) {
843
+ case "M":
844
+ a = [h[0], h[1]], o = [h[0], h[1]];
845
+ break;
846
+ case "L":
847
+ n.push(...$(a[0], a[1], h[0], h[1], e)), a = [h[0], h[1]];
848
+ break;
849
+ case "C":
850
+ {
851
+ const [t, s, o, r, i, c] = h;
852
+ n.push(...Z(t, s, o, r, i, c, a, e)), a = [i, c];
853
+ break;
854
+ }
855
+ case "Z":
856
+ n.push(...$(a[0], a[1], o[0], o[1], e)), a = [o[0], o[1]];
857
+ }
858
+ return {
859
+ type: "path",
860
+ ops: n
861
+ };
862
+ }
863
+ function I(t, e) {
810
864
  const s = [];
811
865
  for (const n of t) if (n.length) {
812
866
  const t = e.maxRandomnessOffset || 0,
813
- a = n.length;
814
- if (a > 2) {
867
+ o = n.length;
868
+ if (o > 2) {
815
869
  s.push({
816
870
  op: "move",
817
- data: [n[0][0] + A(t, e), n[0][1] + A(t, e)]
871
+ data: [n[0][0] + G(t, e), n[0][1] + G(t, e)]
818
872
  });
819
- for (let o = 1; o < a; o++) s.push({
873
+ for (let a = 1; a < o; a++) s.push({
820
874
  op: "lineTo",
821
- data: [n[o][0] + A(t, e), n[o][1] + A(t, e)]
875
+ data: [n[a][0] + G(t, e), n[a][1] + G(t, e)]
822
876
  });
823
877
  }
824
878
  }
@@ -827,73 +881,76 @@ function S(t, e) {
827
881
  ops: s
828
882
  };
829
883
  }
830
- function L(t, e) {
884
+ function C(t, e) {
831
885
  return function (t, e) {
832
886
  let s = t.fillStyle || "hachure";
833
- if (!c[s]) switch (s) {
887
+ if (!u[s]) switch (s) {
834
888
  case "zigzag":
835
- c[s] || (c[s] = new a(e));
889
+ u[s] || (u[s] = new h(e));
836
890
  break;
837
891
  case "cross-hatch":
838
- c[s] || (c[s] = new o(e));
892
+ u[s] || (u[s] = new r(e));
839
893
  break;
840
894
  case "dots":
841
- c[s] || (c[s] = new h(e));
895
+ u[s] || (u[s] = new i(e));
842
896
  break;
843
897
  case "dashed":
844
- c[s] || (c[s] = new r(e));
898
+ u[s] || (u[s] = new c(e));
845
899
  break;
846
900
  case "zigzag-line":
847
- c[s] || (c[s] = new i(e));
901
+ u[s] || (u[s] = new l(e));
848
902
  break;
849
- case "hachure":
850
903
  default:
851
- s = "hachure", c[s] || (c[s] = new n(e));
904
+ s = "hachure", u[s] || (u[s] = new o(e));
852
905
  }
853
- return c[s];
854
- }(e, b).fillPolygons(t, e);
906
+ return u[s];
907
+ }(e, P).fillPolygons(t, e);
908
+ }
909
+ function z(t) {
910
+ const e = Object.assign({}, t);
911
+ return e.randomizer = void 0, t.seed && (e.seed = t.seed + 1), e;
855
912
  }
856
- function T(t) {
857
- return t.randomizer || (t.randomizer = new l(t.seed || 0)), t.randomizer.next();
913
+ function W(t) {
914
+ return t.randomizer || (t.randomizer = new p(t.seed || 0)), t.randomizer.next();
858
915
  }
859
- function D(t, e, s) {
916
+ function E(t, e, s) {
860
917
  let n = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 1;
861
- return s.roughness * n * (T(s) * (e - t) + t);
918
+ return s.roughness * n * (W(s) * (e - t) + t);
862
919
  }
863
- function A(t, e) {
920
+ function G(t, e) {
864
921
  let s = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 1;
865
- return D(-t, t, e, s);
922
+ return E(-t, t, e, s);
866
923
  }
867
- function I(t, e, s, n, a) {
868
- let o = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : !1;
869
- const h = o ? a.disableMultiStrokeFill : a.disableMultiStroke,
870
- r = C(t, e, s, n, a, !0, !1);
924
+ function $(t, e, s, n, o) {
925
+ let a = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : !1;
926
+ const h = a ? o.disableMultiStrokeFill : o.disableMultiStroke,
927
+ r = R(t, e, s, n, o, !0, !1);
871
928
  if (h) return r;
872
- const i = C(t, e, s, n, a, !0, !0);
929
+ const i = R(t, e, s, n, o, !0, !0);
873
930
  return r.concat(i);
874
931
  }
875
- function C(t, e, s, n, a, o, h) {
932
+ function R(t, e, s, n, o, a, h) {
876
933
  const r = Math.pow(t - s, 2) + Math.pow(e - n, 2),
877
934
  i = Math.sqrt(r);
878
935
  let c = 1;
879
936
  c = i < 200 ? 1 : i > 500 ? .4 : -.0016668 * i + 1.233334;
880
- let l = a.maxRandomnessOffset || 0;
937
+ let l = o.maxRandomnessOffset || 0;
881
938
  l * l * 100 > r && (l = i / 10);
882
939
  const u = l / 2,
883
- p = .2 + .2 * T(a);
884
- let f = a.bowing * a.maxRandomnessOffset * (n - e) / 200,
885
- d = a.bowing * a.maxRandomnessOffset * (t - s) / 200;
886
- f = A(f, a, c), d = A(d, a, c);
940
+ p = .2 + .2 * W(o);
941
+ let f = o.bowing * o.maxRandomnessOffset * (n - e) / 200,
942
+ d = o.bowing * o.maxRandomnessOffset * (t - s) / 200;
943
+ f = G(f, o, c), d = G(d, o, c);
887
944
  const g = [],
888
- M = () => A(u, a, c),
889
- k = () => A(l, a, c),
890
- b = a.preserveVertices;
891
- return o && (h ? g.push({
945
+ M = () => G(u, o, c),
946
+ k = () => G(l, o, c),
947
+ b = o.preserveVertices;
948
+ return a && (h ? g.push({
892
949
  op: "move",
893
950
  data: [t + (b ? 0 : M()), e + (b ? 0 : M())]
894
951
  }) : g.push({
895
952
  op: "move",
896
- data: [t + (b ? 0 : A(l, a, c)), e + (b ? 0 : A(l, a, c))]
953
+ data: [t + (b ? 0 : G(l, o, c)), e + (b ? 0 : G(l, o, c))]
897
954
  })), h ? g.push({
898
955
  op: "bcurveTo",
899
956
  data: [f + t + (s - t) * p + M(), d + e + (n - e) * p + M(), f + t + 2 * (s - t) * p + M(), d + e + 2 * (n - e) * p + M(), s + (b ? 0 : M()), n + (b ? 0 : M())]
@@ -902,75 +959,76 @@ function C(t, e, s, n, a, o, h) {
902
959
  data: [f + t + (s - t) * p + k(), d + e + (n - e) * p + k(), f + t + 2 * (s - t) * p + k(), d + e + 2 * (n - e) * p + k(), s + (b ? 0 : k()), n + (b ? 0 : k())]
903
960
  }), g;
904
961
  }
905
- function _(t, e, s) {
962
+ function j(t, e, s) {
963
+ if (!t.length) return [];
906
964
  const n = [];
907
- n.push([t[0][0] + A(e, s), t[0][1] + A(e, s)]), n.push([t[0][0] + A(e, s), t[0][1] + A(e, s)]);
908
- for (let a = 1; a < t.length; a++) n.push([t[a][0] + A(e, s), t[a][1] + A(e, s)]), a === t.length - 1 && n.push([t[a][0] + A(e, s), t[a][1] + A(e, s)]);
909
- return W(n, null, s);
965
+ n.push([t[0][0] + G(e, s), t[0][1] + G(e, s)]), n.push([t[0][0] + G(e, s), t[0][1] + G(e, s)]);
966
+ for (let o = 1; o < t.length; o++) n.push([t[o][0] + G(e, s), t[o][1] + G(e, s)]), o === t.length - 1 && n.push([t[o][0] + G(e, s), t[o][1] + G(e, s)]);
967
+ return q(n, null, s);
910
968
  }
911
- function W(t, e, s) {
969
+ function q(t, e, s) {
912
970
  const n = t.length,
913
- a = [];
971
+ o = [];
914
972
  if (n > 3) {
915
- const o = [],
973
+ const a = [],
916
974
  h = 1 - s.curveTightness;
917
- a.push({
975
+ o.push({
918
976
  op: "move",
919
977
  data: [t[1][0], t[1][1]]
920
978
  });
921
979
  for (let e = 1; e + 2 < n; e++) {
922
980
  const s = t[e];
923
- o[0] = [s[0], s[1]], o[1] = [s[0] + (h * t[e + 1][0] - h * t[e - 1][0]) / 6, s[1] + (h * t[e + 1][1] - h * t[e - 1][1]) / 6], o[2] = [t[e + 1][0] + (h * t[e][0] - h * t[e + 2][0]) / 6, t[e + 1][1] + (h * t[e][1] - h * t[e + 2][1]) / 6], o[3] = [t[e + 1][0], t[e + 1][1]], a.push({
981
+ a[0] = [s[0], s[1]], a[1] = [s[0] + (h * t[e + 1][0] - h * t[e - 1][0]) / 6, s[1] + (h * t[e + 1][1] - h * t[e - 1][1]) / 6], a[2] = [t[e + 1][0] + (h * t[e][0] - h * t[e + 2][0]) / 6, t[e + 1][1] + (h * t[e][1] - h * t[e + 2][1]) / 6], a[3] = [t[e + 1][0], t[e + 1][1]], o.push({
924
982
  op: "bcurveTo",
925
- data: [o[1][0], o[1][1], o[2][0], o[2][1], o[3][0], o[3][1]]
983
+ data: [a[1][0], a[1][1], a[2][0], a[2][1], a[3][0], a[3][1]]
926
984
  });
927
985
  }
928
986
  if (e && 2 === e.length) {
929
987
  const t = s.maxRandomnessOffset;
930
- a.push({
988
+ o.push({
931
989
  op: "lineTo",
932
- data: [e[0] + A(t, s), e[1] + A(t, s)]
990
+ data: [e[0] + G(t, s), e[1] + G(t, s)]
933
991
  });
934
992
  }
935
- } else 3 === n ? (a.push({
993
+ } else 3 === n ? (o.push({
936
994
  op: "move",
937
995
  data: [t[1][0], t[1][1]]
938
- }), a.push({
996
+ }), o.push({
939
997
  op: "bcurveTo",
940
998
  data: [t[1][0], t[1][1], t[2][0], t[2][1], t[2][0], t[2][1]]
941
- })) : 2 === n && a.push(...I(t[0][0], t[0][1], t[1][0], t[1][1], s));
942
- return a;
999
+ })) : 2 === n && o.push(...R(t[0][0], t[0][1], t[1][0], t[1][1], s, !0, !0));
1000
+ return o;
943
1001
  }
944
- function z(t, e, s, n, a, o, h, r) {
1002
+ function F(t, e, s, n, o, a, h, r) {
945
1003
  const i = [],
946
1004
  c = [];
947
1005
  if (0 === r.roughness) {
948
- t /= 4, c.push([e + n * Math.cos(-t), s + a * Math.sin(-t)]);
949
- for (let o = 0; o <= 2 * Math.PI; o += t) {
950
- const t = [e + n * Math.cos(o), s + a * Math.sin(o)];
1006
+ t /= 4, c.push([e + n * Math.cos(-t), s + o * Math.sin(-t)]);
1007
+ for (let a = 0; a <= 2 * Math.PI; a += t) {
1008
+ const t = [e + n * Math.cos(a), s + o * Math.sin(a)];
951
1009
  i.push(t), c.push(t);
952
1010
  }
953
- c.push([e + n * Math.cos(0), s + a * Math.sin(0)]), c.push([e + n * Math.cos(t), s + a * Math.sin(t)]);
1011
+ c.push([e + n * Math.cos(0), s + o * Math.sin(0)]), c.push([e + n * Math.cos(t), s + o * Math.sin(t)]);
954
1012
  } else {
955
- const l = A(.5, r) - Math.PI / 2;
956
- c.push([A(o, r) + e + .9 * n * Math.cos(l - t), A(o, r) + s + .9 * a * Math.sin(l - t)]);
1013
+ const l = G(.5, r) - Math.PI / 2;
1014
+ c.push([G(a, r) + e + .9 * n * Math.cos(l - t), G(a, r) + s + .9 * o * Math.sin(l - t)]);
957
1015
  const u = 2 * Math.PI + l - .01;
958
1016
  for (let h = l; h < u; h += t) {
959
- const t = [A(o, r) + e + n * Math.cos(h), A(o, r) + s + a * Math.sin(h)];
1017
+ const t = [G(a, r) + e + n * Math.cos(h), G(a, r) + s + o * Math.sin(h)];
960
1018
  i.push(t), c.push(t);
961
1019
  }
962
- c.push([A(o, r) + e + n * Math.cos(l + 2 * Math.PI + .5 * h), A(o, r) + s + a * Math.sin(l + 2 * Math.PI + .5 * h)]), c.push([A(o, r) + e + .98 * n * Math.cos(l + h), A(o, r) + s + .98 * a * Math.sin(l + h)]), c.push([A(o, r) + e + .9 * n * Math.cos(l + .5 * h), A(o, r) + s + .9 * a * Math.sin(l + .5 * h)]);
1020
+ c.push([G(a, r) + e + n * Math.cos(l + 2 * Math.PI + .5 * h), G(a, r) + s + o * Math.sin(l + 2 * Math.PI + .5 * h)]), c.push([G(a, r) + e + .98 * n * Math.cos(l + h), G(a, r) + s + .98 * o * Math.sin(l + h)]), c.push([G(a, r) + e + .9 * n * Math.cos(l + .5 * h), G(a, r) + s + .9 * o * Math.sin(l + .5 * h)]);
963
1021
  }
964
1022
  return [c, i];
965
1023
  }
966
- function E(t, e, s, n, a, o, h, r, i) {
967
- const c = o + A(.1, i),
1024
+ function V(t, e, s, n, o, a, h, r, i) {
1025
+ const c = a + G(.1, i),
968
1026
  l = [];
969
- l.push([A(r, i) + e + .9 * n * Math.cos(c - t), A(r, i) + s + .9 * a * Math.sin(c - t)]);
970
- for (let o = c; o <= h; o += t) l.push([A(r, i) + e + n * Math.cos(o), A(r, i) + s + a * Math.sin(o)]);
971
- return l.push([e + n * Math.cos(h), s + a * Math.sin(h)]), l.push([e + n * Math.cos(h), s + a * Math.sin(h)]), W(l, null, i);
1027
+ l.push([G(r, i) + e + .9 * n * Math.cos(c - t), G(r, i) + s + .9 * o * Math.sin(c - t)]);
1028
+ for (let a = c; a <= h; a += t) l.push([G(r, i) + e + n * Math.cos(a), G(r, i) + s + o * Math.sin(a)]);
1029
+ return l.push([e + n * Math.cos(h), s + o * Math.sin(h)]), l.push([e + n * Math.cos(h), s + o * Math.sin(h)]), q(l, null, i);
972
1030
  }
973
- function $(t, e, s, n, a, o, h, r) {
1031
+ function Z(t, e, s, n, o, a, h, r) {
974
1032
  const i = [],
975
1033
  c = [r.maxRandomnessOffset || 1, (r.maxRandomnessOffset || 1) + .3];
976
1034
  let l = [0, 0];
@@ -981,93 +1039,112 @@ function $(t, e, s, n, a, o, h, r) {
981
1039
  data: [h[0], h[1]]
982
1040
  }) : i.push({
983
1041
  op: "move",
984
- data: [h[0] + (p ? 0 : A(c[0], r)), h[1] + (p ? 0 : A(c[0], r))]
985
- }), l = p ? [a, o] : [a + A(c[f], r), o + A(c[f], r)], i.push({
1042
+ data: [h[0] + (p ? 0 : G(c[0], r)), h[1] + (p ? 0 : G(c[0], r))]
1043
+ }), l = p ? [o, a] : [o + G(c[f], r), a + G(c[f], r)], i.push({
986
1044
  op: "bcurveTo",
987
- data: [t + A(c[f], r), e + A(c[f], r), s + A(c[f], r), n + A(c[f], r), l[0], l[1]]
1045
+ data: [t + G(c[f], r), e + G(c[f], r), s + G(c[f], r), n + G(c[f], r), l[0], l[1]]
988
1046
  });
989
1047
  return i;
990
1048
  }
991
- function G(t) {
1049
+ function Q(t) {
992
1050
  return [...t];
993
1051
  }
994
- function R(t, e) {
1052
+ function H(t) {
1053
+ let e = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
1054
+ const s = t.length;
1055
+ if (s < 3) throw new Error("A curve must have at least three points.");
1056
+ const n = [];
1057
+ if (3 === s) n.push(Q(t[0]), Q(t[1]), Q(t[2]), Q(t[2]));else {
1058
+ const s = [];
1059
+ s.push(t[0], t[0]);
1060
+ for (let e = 1; e < t.length; e++) s.push(t[e]), e === t.length - 1 && s.push(t[e]);
1061
+ const o = [],
1062
+ a = 1 - e;
1063
+ n.push(Q(s[0]));
1064
+ for (let t = 1; t + 2 < s.length; t++) {
1065
+ const e = s[t];
1066
+ o[0] = [e[0], e[1]], o[1] = [e[0] + (a * s[t + 1][0] - a * s[t - 1][0]) / 6, e[1] + (a * s[t + 1][1] - a * s[t - 1][1]) / 6], o[2] = [s[t + 1][0] + (a * s[t][0] - a * s[t + 2][0]) / 6, s[t + 1][1] + (a * s[t][1] - a * s[t + 2][1]) / 6], o[3] = [s[t + 1][0], s[t + 1][1]], n.push(o[1], o[2], o[3]);
1067
+ }
1068
+ }
1069
+ return n;
1070
+ }
1071
+ function N(t, e) {
995
1072
  return Math.pow(t[0] - e[0], 2) + Math.pow(t[1] - e[1], 2);
996
1073
  }
997
- function q(t, e, s) {
998
- const n = R(e, s);
999
- if (0 === n) return R(t, e);
1000
- let a = ((t[0] - e[0]) * (s[0] - e[0]) + (t[1] - e[1]) * (s[1] - e[1])) / n;
1001
- return a = Math.max(0, Math.min(1, a)), R(t, j(e, s, a));
1074
+ function B(t, e, s) {
1075
+ const n = N(e, s);
1076
+ if (0 === n) return N(t, e);
1077
+ let o = ((t[0] - e[0]) * (s[0] - e[0]) + (t[1] - e[1]) * (s[1] - e[1])) / n;
1078
+ return o = Math.max(0, Math.min(1, o)), N(t, J(e, s, o));
1002
1079
  }
1003
- function j(t, e, s) {
1080
+ function J(t, e, s) {
1004
1081
  return [t[0] + (e[0] - t[0]) * s, t[1] + (e[1] - t[1]) * s];
1005
1082
  }
1006
- function F(t, e, s, n) {
1007
- const a = n || [];
1083
+ function K(t, e, s, n) {
1084
+ const o = n || [];
1008
1085
  if (function (t, e) {
1009
1086
  const s = t[e + 0],
1010
1087
  n = t[e + 1],
1011
- a = t[e + 2],
1012
- o = t[e + 3];
1013
- let h = 3 * n[0] - 2 * s[0] - o[0];
1088
+ o = t[e + 2],
1089
+ a = t[e + 3];
1090
+ let h = 3 * n[0] - 2 * s[0] - a[0];
1014
1091
  h *= h;
1015
- let r = 3 * n[1] - 2 * s[1] - o[1];
1092
+ let r = 3 * n[1] - 2 * s[1] - a[1];
1016
1093
  r *= r;
1017
- let i = 3 * a[0] - 2 * o[0] - s[0];
1094
+ let i = 3 * o[0] - 2 * a[0] - s[0];
1018
1095
  i *= i;
1019
- let c = 3 * a[1] - 2 * o[1] - s[1];
1096
+ let c = 3 * o[1] - 2 * a[1] - s[1];
1020
1097
  return c *= c, h < i && (h = i), r < c && (r = c), h + r;
1021
1098
  }(t, e) < s) {
1022
1099
  const s = t[e + 0];
1023
- if (a.length) {
1024
- (o = a[a.length - 1], h = s, Math.sqrt(R(o, h))) > 1 && a.push(s);
1025
- } else a.push(s);
1026
- a.push(t[e + 3]);
1100
+ if (o.length) {
1101
+ (a = o[o.length - 1], h = s, Math.sqrt(N(a, h))) > 1 && o.push(s);
1102
+ } else o.push(s);
1103
+ o.push(t[e + 3]);
1027
1104
  } else {
1028
1105
  const n = .5,
1029
- o = t[e + 0],
1106
+ a = t[e + 0],
1030
1107
  h = t[e + 1],
1031
1108
  r = t[e + 2],
1032
1109
  i = t[e + 3],
1033
- c = j(o, h, n),
1034
- l = j(h, r, n),
1035
- u = j(r, i, n),
1036
- p = j(c, l, n),
1037
- f = j(l, u, n),
1038
- d = j(p, f, n);
1039
- F([o, c, p, d], 0, s, a), F([d, f, u, i], 0, s, a);
1110
+ c = J(a, h, n),
1111
+ l = J(h, r, n),
1112
+ u = J(r, i, n),
1113
+ p = J(c, l, n),
1114
+ f = J(l, u, n),
1115
+ d = J(p, f, n);
1116
+ K([a, c, p, d], 0, s, o), K([d, f, u, i], 0, s, o);
1040
1117
  }
1041
- var o, h;
1042
- return a;
1118
+ var a, h;
1119
+ return o;
1043
1120
  }
1044
- function V(t, e) {
1045
- return Z(t, 0, t.length, e);
1121
+ function U(t, e) {
1122
+ return X(t, 0, t.length, e);
1046
1123
  }
1047
- function Z(t, e, s, n, a) {
1048
- const o = a || [],
1124
+ function X(t, e, s, n, o) {
1125
+ const a = o || [],
1049
1126
  h = t[e],
1050
1127
  r = t[s - 1];
1051
1128
  let i = 0,
1052
1129
  c = 1;
1053
1130
  for (let n = e + 1; n < s - 1; ++n) {
1054
- const e = q(t[n], h, r);
1131
+ const e = B(t[n], h, r);
1055
1132
  e > i && (i = e, c = n);
1056
1133
  }
1057
- return Math.sqrt(i) > n ? (Z(t, e, c + 1, n, o), Z(t, c, s, n, o)) : (o.length || o.push(h), o.push(r)), o;
1134
+ return Math.sqrt(i) > n ? (X(t, e, c + 1, n, a), X(t, c, s, n, a)) : (a.length || a.push(h), a.push(r)), a;
1058
1135
  }
1059
- function Q(t) {
1136
+ function Y(t) {
1060
1137
  let e = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : .15;
1061
1138
  let s = arguments.length > 2 ? arguments[2] : undefined;
1062
1139
  const n = [],
1063
- a = (t.length - 1) / 3;
1064
- for (let s = 0; s < a; s++) {
1065
- F(t, 3 * s, e, n);
1140
+ o = (t.length - 1) / 3;
1141
+ for (let s = 0; s < o; s++) {
1142
+ K(t, 3 * s, e, n);
1066
1143
  }
1067
- return s && s > 0 ? Z(n, 0, n.length, s) : n;
1144
+ return s && s > 0 ? X(n, 0, n.length, s) : n;
1068
1145
  }
1069
- const H = "none";
1070
- class N {
1146
+ const tt$1 = "none";
1147
+ class et {
1071
1148
  constructor(t) {
1072
1149
  this.defaultOptions = {
1073
1150
  maxRandomnessOffset: 2,
@@ -1088,7 +1165,8 @@ class N {
1088
1165
  seed: 0,
1089
1166
  disableMultiStroke: !1,
1090
1167
  disableMultiStrokeFill: !1,
1091
- preserveVertices: !1
1168
+ preserveVertices: !1,
1169
+ fillShapeRoughnessGain: .8
1092
1170
  }, this.config = t || {}, this.config.options && (this.defaultOptions = this._o(this.config.options));
1093
1171
  }
1094
1172
  static newSeed() {
@@ -1104,187 +1182,161 @@ class N {
1104
1182
  options: s || this.defaultOptions
1105
1183
  };
1106
1184
  }
1107
- line(t, e, s, n, a) {
1108
- const o = this._o(a);
1109
- return this._d("line", [y(t, e, s, n, o)], o);
1185
+ line(t, e, s, n, o) {
1186
+ const a = this._o(o);
1187
+ return this._d("line", [v(t, e, s, n, a)], a);
1110
1188
  }
1111
- rectangle(t, e, s, n, a) {
1112
- const o = this._o(a),
1189
+ rectangle(t, e, s, n, o) {
1190
+ const a = this._o(o),
1113
1191
  h = [],
1114
- r = w(t, e, s, n, o);
1115
- if (o.fill) {
1116
- const a = [[t, e], [t + s, e], [t + s, e + n], [t, e + n]];
1117
- "solid" === o.fillStyle ? h.push(S([a], o)) : h.push(L([a], o));
1192
+ r = O(t, e, s, n, a);
1193
+ if (a.fill) {
1194
+ const o = [[t, e], [t + s, e], [t + s, e + n], [t, e + n]];
1195
+ "solid" === a.fillStyle ? h.push(I([o], a)) : h.push(C([o], a));
1118
1196
  }
1119
- return o.stroke !== H && h.push(r), this._d("rectangle", h, o);
1197
+ return a.stroke !== tt$1 && h.push(r), this._d("rectangle", h, a);
1120
1198
  }
1121
- ellipse(t, e, s, n, a) {
1122
- const o = this._o(a),
1199
+ ellipse(t, e, s, n, o) {
1200
+ const a = this._o(o),
1123
1201
  h = [],
1124
- r = P(s, n, o),
1125
- i = v(t, e, o, r);
1126
- if (o.fill) if ("solid" === o.fillStyle) {
1127
- const s = v(t, e, o, r).opset;
1202
+ r = T(s, n, a),
1203
+ i = D(t, e, a, r);
1204
+ if (a.fill) if ("solid" === a.fillStyle) {
1205
+ const s = D(t, e, a, r).opset;
1128
1206
  s.type = "fillPath", h.push(s);
1129
- } else h.push(L([i.estimatedPoints], o));
1130
- return o.stroke !== H && h.push(i.opset), this._d("ellipse", h, o);
1207
+ } else h.push(C([i.estimatedPoints], a));
1208
+ return a.stroke !== tt$1 && h.push(i.opset), this._d("ellipse", h, a);
1131
1209
  }
1132
1210
  circle(t, e, s, n) {
1133
- const a = this.ellipse(t, e, s, s, n);
1134
- return a.shape = "circle", a;
1211
+ const o = this.ellipse(t, e, s, s, n);
1212
+ return o.shape = "circle", o;
1135
1213
  }
1136
1214
  linearPath(t, e) {
1137
1215
  const s = this._o(e);
1138
- return this._d("linearPath", [m$2(t, !1, s)], s);
1216
+ return this._d("linearPath", [S(t, !1, s)], s);
1139
1217
  }
1140
- arc(t, e, s, n, a, o) {
1218
+ arc(t, e, s, n, o, a) {
1141
1219
  let h = arguments.length > 6 && arguments[6] !== undefined ? arguments[6] : !1;
1142
1220
  let r = arguments.length > 7 ? arguments[7] : undefined;
1143
1221
  const i = this._o(r),
1144
1222
  c = [],
1145
- l = O(t, e, s, n, a, o, h, !0, i);
1223
+ l = A(t, e, s, n, o, a, h, !0, i);
1146
1224
  if (h && i.fill) if ("solid" === i.fillStyle) {
1147
1225
  const h = Object.assign({}, i);
1148
1226
  h.disableMultiStroke = !0;
1149
- const r = O(t, e, s, n, a, o, !0, !1, h);
1227
+ const r = A(t, e, s, n, o, a, !0, !1, h);
1150
1228
  r.type = "fillPath", c.push(r);
1151
- } else c.push(function (t, e, s, n, a, o, h) {
1229
+ } else c.push(function (t, e, s, n, o, a, h) {
1152
1230
  const r = t,
1153
1231
  i = e;
1154
1232
  let c = Math.abs(s / 2),
1155
1233
  l = Math.abs(n / 2);
1156
- c += A(.01 * c, h), l += A(.01 * l, h);
1157
- let u = a,
1158
- p = o;
1234
+ c += G(.01 * c, h), l += G(.01 * l, h);
1235
+ let u = o,
1236
+ p = a;
1159
1237
  for (; u < 0;) u += 2 * Math.PI, p += 2 * Math.PI;
1160
1238
  p - u > 2 * Math.PI && (u = 0, p = 2 * Math.PI);
1161
1239
  const f = (p - u) / h.curveStepCount,
1162
1240
  d = [];
1163
1241
  for (let t = u; t <= p; t += f) d.push([r + c * Math.cos(t), i + l * Math.sin(t)]);
1164
- return d.push([r + c * Math.cos(p), i + l * Math.sin(p)]), d.push([r, i]), L([d], h);
1165
- }(t, e, s, n, a, o, i));
1166
- return i.stroke !== H && c.push(l), this._d("arc", c, i);
1242
+ return d.push([r + c * Math.cos(p), i + l * Math.sin(p)]), d.push([r, i]), C([d], h);
1243
+ }(t, e, s, n, o, a, i));
1244
+ return i.stroke !== tt$1 && c.push(l), this._d("arc", c, i);
1167
1245
  }
1168
1246
  curve(t, e) {
1169
1247
  const s = this._o(e),
1170
1248
  n = [],
1171
- a = x(t, s);
1172
- if (s.fill && s.fill !== H && t.length >= 3) {
1173
- const e = Q(function (t) {
1174
- let e = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
1175
- const s = t.length;
1176
- if (s < 3) throw new Error("A curve must have at least three points.");
1177
- const n = [];
1178
- if (3 === s) n.push(G(t[0]), G(t[1]), G(t[2]), G(t[2]));else {
1179
- const s = [];
1180
- s.push(t[0], t[0]);
1181
- for (let e = 1; e < t.length; e++) s.push(t[e]), e === t.length - 1 && s.push(t[e]);
1182
- const a = [],
1183
- o = 1 - e;
1184
- n.push(G(s[0]));
1185
- for (let t = 1; t + 2 < s.length; t++) {
1186
- const e = s[t];
1187
- a[0] = [e[0], e[1]], a[1] = [e[0] + (o * s[t + 1][0] - o * s[t - 1][0]) / 6, e[1] + (o * s[t + 1][1] - o * s[t - 1][1]) / 6], a[2] = [s[t + 1][0] + (o * s[t][0] - o * s[t + 2][0]) / 6, s[t + 1][1] + (o * s[t][1] - o * s[t + 2][1]) / 6], a[3] = [s[t + 1][0], s[t + 1][1]], n.push(a[1], a[2], a[3]);
1188
- }
1189
- }
1190
- return n;
1191
- }(t), 10, (1 + s.roughness) / 2);
1192
- "solid" === s.fillStyle ? n.push(S([e], s)) : n.push(L([e], s));
1249
+ o = L(t, s);
1250
+ if (s.fill && s.fill !== tt$1) if ("solid" === s.fillStyle) {
1251
+ const e = L(t, Object.assign(Object.assign({}, s), {
1252
+ disableMultiStroke: !0,
1253
+ roughness: s.roughness ? s.roughness + s.fillShapeRoughnessGain : 0
1254
+ }));
1255
+ n.push({
1256
+ type: "fillPath",
1257
+ ops: this._mergedShape(e.ops)
1258
+ });
1259
+ } else {
1260
+ const e = [],
1261
+ o = t;
1262
+ if (o.length) {
1263
+ const t = "number" == typeof o[0][0] ? [o] : o;
1264
+ for (const n of t) n.length < 3 ? e.push(...n) : 3 === n.length ? e.push(...Y(H([n[0], n[0], n[1], n[2]]), 10, (1 + s.roughness) / 2)) : e.push(...Y(H(n), 10, (1 + s.roughness) / 2));
1265
+ }
1266
+ e.length && n.push(C([e], s));
1193
1267
  }
1194
- return s.stroke !== H && n.push(a), this._d("curve", n, s);
1268
+ return s.stroke !== tt$1 && n.push(o), this._d("curve", n, s);
1195
1269
  }
1196
1270
  polygon(t, e) {
1197
1271
  const s = this._o(e),
1198
1272
  n = [],
1199
- a = m$2(t, !0, s);
1200
- return s.fill && ("solid" === s.fillStyle ? n.push(S([t], s)) : n.push(L([t], s))), s.stroke !== H && n.push(a), this._d("polygon", n, s);
1273
+ o = S(t, !0, s);
1274
+ return s.fill && ("solid" === s.fillStyle ? n.push(I([t], s)) : n.push(C([t], s))), s.stroke !== tt$1 && n.push(o), this._d("polygon", n, s);
1201
1275
  }
1202
1276
  path(t, e) {
1203
1277
  const s = this._o(e),
1204
1278
  n = [];
1205
1279
  if (!t) return this._d("path", n, s);
1206
1280
  t = (t || "").replace(/\n/g, " ").replace(/(-\s)/g, "-").replace("/(ss)/g", " ");
1207
- const a = s.fill && "transparent" !== s.fill && s.fill !== H,
1208
- o = s.stroke !== H,
1281
+ const o = s.fill && "transparent" !== s.fill && s.fill !== tt$1,
1282
+ a = s.stroke !== tt$1,
1209
1283
  h = !!(s.simplification && s.simplification < 1),
1210
1284
  r = function (t, e, s) {
1211
- const n = g(d(f(t))),
1212
- a = [];
1213
- let o = [],
1285
+ const n = m$2(y(b(t))),
1286
+ o = [];
1287
+ let a = [],
1214
1288
  h = [0, 0],
1215
1289
  r = [];
1216
1290
  const i = () => {
1217
- r.length >= 4 && o.push(...Q(r, e)), r = [];
1291
+ r.length >= 4 && a.push(...Y(r, e)), r = [];
1218
1292
  },
1219
1293
  c = () => {
1220
- i(), o.length && (a.push(o), o = []);
1294
+ i(), a.length && (o.push(a), a = []);
1221
1295
  };
1222
1296
  for (const {
1223
1297
  key: t,
1224
1298
  data: e
1225
1299
  } of n) switch (t) {
1226
1300
  case "M":
1227
- c(), h = [e[0], e[1]], o.push(h);
1301
+ c(), h = [e[0], e[1]], a.push(h);
1228
1302
  break;
1229
1303
  case "L":
1230
- i(), o.push([e[0], e[1]]);
1304
+ i(), a.push([e[0], e[1]]);
1231
1305
  break;
1232
1306
  case "C":
1233
1307
  if (!r.length) {
1234
- const t = o.length ? o[o.length - 1] : h;
1308
+ const t = a.length ? a[a.length - 1] : h;
1235
1309
  r.push([t[0], t[1]]);
1236
1310
  }
1237
1311
  r.push([e[0], e[1]]), r.push([e[2], e[3]]), r.push([e[4], e[5]]);
1238
1312
  break;
1239
1313
  case "Z":
1240
- i(), o.push([h[0], h[1]]);
1314
+ i(), a.push([h[0], h[1]]);
1241
1315
  }
1242
- if (c(), !s) return a;
1316
+ if (c(), !s) return o;
1243
1317
  const l = [];
1244
- for (const t of a) {
1245
- const e = V(t, s);
1318
+ for (const t of o) {
1319
+ const e = U(t, s);
1246
1320
  e.length && l.push(e);
1247
1321
  }
1248
1322
  return l;
1249
- }(t, 1, h ? 4 - 4 * s.simplification : (1 + s.roughness) / 2);
1250
- return a && ("solid" === s.fillStyle ? n.push(S(r, s)) : n.push(L(r, s))), o && (h ? r.forEach(t => {
1251
- n.push(m$2(t, !1, s));
1252
- }) : n.push(function (t, e) {
1253
- const s = g(d(f(t))),
1254
- n = [];
1255
- let a = [0, 0],
1256
- o = [0, 0];
1257
- for (const {
1258
- key: t,
1259
- data: h
1260
- } of s) switch (t) {
1261
- case "M":
1262
- {
1263
- const t = 1 * (e.maxRandomnessOffset || 0),
1264
- s = e.preserveVertices;
1265
- n.push({
1266
- op: "move",
1267
- data: h.map(n => n + (s ? 0 : A(t, e)))
1268
- }), o = [h[0], h[1]], a = [h[0], h[1]];
1269
- break;
1270
- }
1271
- case "L":
1272
- n.push(...I(o[0], o[1], h[0], h[1], e)), o = [h[0], h[1]];
1273
- break;
1274
- case "C":
1275
- {
1276
- const [t, s, a, r, i, c] = h;
1277
- n.push(...$(t, s, a, r, i, c, o, e)), o = [i, c];
1278
- break;
1279
- }
1280
- case "Z":
1281
- n.push(...I(o[0], o[1], a[0], a[1], e)), o = [a[0], a[1]];
1282
- }
1283
- return {
1284
- type: "path",
1285
- ops: n
1286
- };
1287
- }(t, s))), this._d("path", n, s);
1323
+ }(t, 1, h ? 4 - 4 * (s.simplification || 1) : (1 + s.roughness) / 2),
1324
+ i = _(t, s);
1325
+ if (o) if ("solid" === s.fillStyle) {
1326
+ if (1 === r.length) {
1327
+ const e = _(t, Object.assign(Object.assign({}, s), {
1328
+ disableMultiStroke: !0,
1329
+ roughness: s.roughness ? s.roughness + s.fillShapeRoughnessGain : 0
1330
+ }));
1331
+ n.push({
1332
+ type: "fillPath",
1333
+ ops: this._mergedShape(e.ops)
1334
+ });
1335
+ } else n.push(I(r, s));
1336
+ } else n.push(C(r, s));
1337
+ return a && (h ? r.forEach(t => {
1338
+ n.push(S(t, !1, s));
1339
+ }) : n.push(i)), this._d("path", n, s);
1288
1340
  }
1289
1341
  opsToPath(t, e) {
1290
1342
  let s = "";
@@ -1315,15 +1367,15 @@ class N {
1315
1367
  d: this.opsToPath(t),
1316
1368
  stroke: s.stroke,
1317
1369
  strokeWidth: s.strokeWidth,
1318
- fill: H
1370
+ fill: tt$1
1319
1371
  };
1320
1372
  break;
1321
1373
  case "fillPath":
1322
1374
  e = {
1323
1375
  d: this.opsToPath(t),
1324
- stroke: H,
1376
+ stroke: tt$1,
1325
1377
  strokeWidth: 0,
1326
- fill: s.fill || H
1378
+ fill: s.fill || tt$1
1327
1379
  };
1328
1380
  break;
1329
1381
  case "fillSketch":
@@ -1337,34 +1389,37 @@ class N {
1337
1389
  let s = e.fillWeight;
1338
1390
  return s < 0 && (s = e.strokeWidth / 2), {
1339
1391
  d: this.opsToPath(t),
1340
- stroke: e.fill || H,
1392
+ stroke: e.fill || tt$1,
1341
1393
  strokeWidth: s,
1342
- fill: H
1394
+ fill: tt$1
1343
1395
  };
1344
1396
  }
1397
+ _mergedShape(t) {
1398
+ return t.filter((t, e) => 0 === e || "move" !== t.op);
1399
+ }
1345
1400
  }
1346
- class B {
1401
+ class st {
1347
1402
  constructor(t, e) {
1348
- this.canvas = t, this.ctx = this.canvas.getContext("2d"), this.gen = new N(e);
1403
+ this.canvas = t, this.ctx = this.canvas.getContext("2d"), this.gen = new et(e);
1349
1404
  }
1350
1405
  draw(t) {
1351
1406
  const e = t.sets || [],
1352
1407
  s = t.options || this.getDefaultOptions(),
1353
1408
  n = this.ctx,
1354
- a = t.options.fixedDecimalPlaceDigits;
1355
- for (const o of e) switch (o.type) {
1409
+ o = t.options.fixedDecimalPlaceDigits;
1410
+ for (const a of e) switch (a.type) {
1356
1411
  case "path":
1357
- n.save(), n.strokeStyle = "none" === s.stroke ? "transparent" : s.stroke, n.lineWidth = s.strokeWidth, s.strokeLineDash && n.setLineDash(s.strokeLineDash), s.strokeLineDashOffset && (n.lineDashOffset = s.strokeLineDashOffset), this._drawToContext(n, o, a), n.restore();
1412
+ n.save(), n.strokeStyle = "none" === s.stroke ? "transparent" : s.stroke, n.lineWidth = s.strokeWidth, s.strokeLineDash && n.setLineDash(s.strokeLineDash), s.strokeLineDashOffset && (n.lineDashOffset = s.strokeLineDashOffset), this._drawToContext(n, a, o), n.restore();
1358
1413
  break;
1359
1414
  case "fillPath":
1360
1415
  {
1361
1416
  n.save(), n.fillStyle = s.fill || "";
1362
1417
  const e = "curve" === t.shape || "polygon" === t.shape || "path" === t.shape ? "evenodd" : "nonzero";
1363
- this._drawToContext(n, o, a, e), n.restore();
1418
+ this._drawToContext(n, a, o, e), n.restore();
1364
1419
  break;
1365
1420
  }
1366
1421
  case "fillSketch":
1367
- this.fillSketch(n, o, s);
1422
+ this.fillSketch(n, a, s);
1368
1423
  }
1369
1424
  }
1370
1425
  fillSketch(t, e, s) {
@@ -1395,21 +1450,21 @@ class B {
1395
1450
  getDefaultOptions() {
1396
1451
  return this.gen.defaultOptions;
1397
1452
  }
1398
- line(t, e, s, n, a) {
1399
- const o = this.gen.line(t, e, s, n, a);
1400
- return this.draw(o), o;
1453
+ line(t, e, s, n, o) {
1454
+ const a = this.gen.line(t, e, s, n, o);
1455
+ return this.draw(a), a;
1401
1456
  }
1402
- rectangle(t, e, s, n, a) {
1403
- const o = this.gen.rectangle(t, e, s, n, a);
1404
- return this.draw(o), o;
1457
+ rectangle(t, e, s, n, o) {
1458
+ const a = this.gen.rectangle(t, e, s, n, o);
1459
+ return this.draw(a), a;
1405
1460
  }
1406
- ellipse(t, e, s, n, a) {
1407
- const o = this.gen.ellipse(t, e, s, n, a);
1408
- return this.draw(o), o;
1461
+ ellipse(t, e, s, n, o) {
1462
+ const a = this.gen.ellipse(t, e, s, n, o);
1463
+ return this.draw(a), a;
1409
1464
  }
1410
1465
  circle(t, e, s, n) {
1411
- const a = this.gen.circle(t, e, s, n);
1412
- return this.draw(a), a;
1466
+ const o = this.gen.circle(t, e, s, n);
1467
+ return this.draw(o), o;
1413
1468
  }
1414
1469
  linearPath(t, e) {
1415
1470
  const s = this.gen.linearPath(t, e);
@@ -1419,10 +1474,10 @@ class B {
1419
1474
  const s = this.gen.polygon(t, e);
1420
1475
  return this.draw(s), s;
1421
1476
  }
1422
- arc(t, e, s, n, a, o) {
1477
+ arc(t, e, s, n, o, a) {
1423
1478
  let h = arguments.length > 6 && arguments[6] !== undefined ? arguments[6] : !1;
1424
1479
  let r = arguments.length > 7 ? arguments[7] : undefined;
1425
- const i = this.gen.arc(t, e, s, n, a, o, h, r);
1480
+ const i = this.gen.arc(t, e, s, n, o, a, h, r);
1426
1481
  return this.draw(i), i;
1427
1482
  }
1428
1483
  curve(t, e) {
@@ -1434,38 +1489,38 @@ class B {
1434
1489
  return this.draw(s), s;
1435
1490
  }
1436
1491
  }
1437
- const J = "http://www.w3.org/2000/svg";
1438
- class K {
1492
+ const nt = "http://www.w3.org/2000/svg";
1493
+ class ot {
1439
1494
  constructor(t, e) {
1440
- this.svg = t, this.gen = new N(e);
1495
+ this.svg = t, this.gen = new et(e);
1441
1496
  }
1442
1497
  draw(t) {
1443
1498
  const e = t.sets || [],
1444
1499
  s = t.options || this.getDefaultOptions(),
1445
1500
  n = this.svg.ownerDocument || window.document,
1446
- a = n.createElementNS(J, "g"),
1447
- o = t.options.fixedDecimalPlaceDigits;
1501
+ o = n.createElementNS(nt, "g"),
1502
+ a = t.options.fixedDecimalPlaceDigits;
1448
1503
  for (const h of e) {
1449
1504
  let e = null;
1450
1505
  switch (h.type) {
1451
1506
  case "path":
1452
- e = n.createElementNS(J, "path"), e.setAttribute("d", this.opsToPath(h, o)), e.setAttribute("stroke", s.stroke), e.setAttribute("stroke-width", s.strokeWidth + ""), e.setAttribute("fill", "none"), s.strokeLineDash && e.setAttribute("stroke-dasharray", s.strokeLineDash.join(" ").trim()), s.strokeLineDashOffset && e.setAttribute("stroke-dashoffset", `${s.strokeLineDashOffset}`);
1507
+ e = n.createElementNS(nt, "path"), e.setAttribute("d", this.opsToPath(h, a)), e.setAttribute("stroke", s.stroke), e.setAttribute("stroke-width", s.strokeWidth + ""), e.setAttribute("fill", "none"), s.strokeLineDash && e.setAttribute("stroke-dasharray", s.strokeLineDash.join(" ").trim()), s.strokeLineDashOffset && e.setAttribute("stroke-dashoffset", `${s.strokeLineDashOffset}`);
1453
1508
  break;
1454
1509
  case "fillPath":
1455
- e = n.createElementNS(J, "path"), e.setAttribute("d", this.opsToPath(h, o)), e.setAttribute("stroke", "none"), e.setAttribute("stroke-width", "0"), e.setAttribute("fill", s.fill || ""), "curve" !== t.shape && "polygon" !== t.shape || e.setAttribute("fill-rule", "evenodd");
1510
+ e = n.createElementNS(nt, "path"), e.setAttribute("d", this.opsToPath(h, a)), e.setAttribute("stroke", "none"), e.setAttribute("stroke-width", "0"), e.setAttribute("fill", s.fill || ""), "curve" !== t.shape && "polygon" !== t.shape || e.setAttribute("fill-rule", "evenodd");
1456
1511
  break;
1457
1512
  case "fillSketch":
1458
1513
  e = this.fillSketch(n, h, s);
1459
1514
  }
1460
- e && a.appendChild(e);
1515
+ e && o.appendChild(e);
1461
1516
  }
1462
- return a;
1517
+ return o;
1463
1518
  }
1464
1519
  fillSketch(t, e, s) {
1465
1520
  let n = s.fillWeight;
1466
1521
  n < 0 && (n = s.strokeWidth / 2);
1467
- const a = t.createElementNS(J, "path");
1468
- return a.setAttribute("d", this.opsToPath(e, s.fixedDecimalPlaceDigits)), a.setAttribute("stroke", s.fill || ""), a.setAttribute("stroke-width", n + ""), a.setAttribute("fill", "none"), s.fillLineDash && a.setAttribute("stroke-dasharray", s.fillLineDash.join(" ").trim()), s.fillLineDashOffset && a.setAttribute("stroke-dashoffset", `${s.fillLineDashOffset}`), a;
1522
+ const o = t.createElementNS(nt, "path");
1523
+ return o.setAttribute("d", this.opsToPath(e, s.fixedDecimalPlaceDigits)), o.setAttribute("stroke", s.fill || ""), o.setAttribute("stroke-width", n + ""), o.setAttribute("fill", "none"), s.fillLineDash && o.setAttribute("stroke-dasharray", s.fillLineDash.join(" ").trim()), s.fillLineDashOffset && o.setAttribute("stroke-dashoffset", `${s.fillLineDashOffset}`), o;
1469
1524
  }
1470
1525
  get generator() {
1471
1526
  return this.gen;
@@ -1476,21 +1531,21 @@ class K {
1476
1531
  opsToPath(t, e) {
1477
1532
  return this.gen.opsToPath(t, e);
1478
1533
  }
1479
- line(t, e, s, n, a) {
1480
- const o = this.gen.line(t, e, s, n, a);
1481
- return this.draw(o);
1534
+ line(t, e, s, n, o) {
1535
+ const a = this.gen.line(t, e, s, n, o);
1536
+ return this.draw(a);
1482
1537
  }
1483
- rectangle(t, e, s, n, a) {
1484
- const o = this.gen.rectangle(t, e, s, n, a);
1485
- return this.draw(o);
1538
+ rectangle(t, e, s, n, o) {
1539
+ const a = this.gen.rectangle(t, e, s, n, o);
1540
+ return this.draw(a);
1486
1541
  }
1487
- ellipse(t, e, s, n, a) {
1488
- const o = this.gen.ellipse(t, e, s, n, a);
1489
- return this.draw(o);
1542
+ ellipse(t, e, s, n, o) {
1543
+ const a = this.gen.ellipse(t, e, s, n, o);
1544
+ return this.draw(a);
1490
1545
  }
1491
1546
  circle(t, e, s, n) {
1492
- const a = this.gen.circle(t, e, s, n);
1493
- return this.draw(a);
1547
+ const o = this.gen.circle(t, e, s, n);
1548
+ return this.draw(o);
1494
1549
  }
1495
1550
  linearPath(t, e) {
1496
1551
  const s = this.gen.linearPath(t, e);
@@ -1500,10 +1555,10 @@ class K {
1500
1555
  const s = this.gen.polygon(t, e);
1501
1556
  return this.draw(s);
1502
1557
  }
1503
- arc(t, e, s, n, a, o) {
1558
+ arc(t, e, s, n, o, a) {
1504
1559
  let h = arguments.length > 6 && arguments[6] !== undefined ? arguments[6] : !1;
1505
1560
  let r = arguments.length > 7 ? arguments[7] : undefined;
1506
- const i = this.gen.arc(t, e, s, n, a, o, h, r);
1561
+ const i = this.gen.arc(t, e, s, n, o, a, h, r);
1507
1562
  return this.draw(i);
1508
1563
  }
1509
1564
  curve(t, e) {
@@ -1515,11 +1570,11 @@ class K {
1515
1570
  return this.draw(s);
1516
1571
  }
1517
1572
  }
1518
- var U = {
1519
- canvas: (t, e) => new B(t, e),
1520
- svg: (t, e) => new K(t, e),
1521
- generator: t => new N(t),
1522
- newSeed: () => N.newSeed()
1573
+ var at = {
1574
+ canvas: (t, e) => new st(t, e),
1575
+ svg: (t, e) => new ot(t, e),
1576
+ generator: t => new et(t),
1577
+ newSeed: () => et.newSeed()
1523
1578
  };
1524
1579
 
1525
1580
  const defaultRouthThemeSpec = {
@@ -1969,7 +2024,7 @@ class RoughBaseRender {
1969
2024
  return;
1970
2025
  }
1971
2026
  const canvas = context.canvas.nativeCanvas;
1972
- const rc = U.canvas(canvas);
2027
+ const rc = at.canvas(canvas);
1973
2028
  const customPath = new CustomPath2D();
1974
2029
  const roughContext = new RoughContext2d(context, customPath);
1975
2030
  context.save();
@@ -2040,7 +2095,7 @@ let RoughCanvasArcRender = class RoughCanvasArcRender extends RoughBaseRender {
2040
2095
  return;
2041
2096
  }
2042
2097
  const canvas = context.canvas.nativeCanvas;
2043
- const rc = U.canvas(canvas);
2098
+ const rc = at.canvas(canvas);
2044
2099
  context.highPerformanceSave();
2045
2100
  const arcAttribute = arc.getGraphicTheme();
2046
2101
  let { x = arcAttribute.x, y = arcAttribute.y } = arc.attribute;
@@ -2104,7 +2159,7 @@ let RoughCanvasAreaRender = class RoughCanvasAreaRender extends DefaultCanvasAre
2104
2159
  }
2105
2160
  context.highPerformanceSave();
2106
2161
  const canvas = context.canvas.nativeCanvas;
2107
- const rc = U.canvas(canvas, {});
2162
+ const rc = at.canvas(canvas, {});
2108
2163
  const customPath = new CustomPath2D();
2109
2164
  drawAreaSegments(customPath, cache, clipRange, {
2110
2165
  offsetX,
@@ -2171,7 +2226,7 @@ let RoughCanvasCircleRender = class RoughCanvasCircleRender extends RoughBaseRen
2171
2226
  return;
2172
2227
  }
2173
2228
  const canvas = context.canvas.nativeCanvas;
2174
- const rc = U.canvas(canvas, {});
2229
+ const rc = at.canvas(canvas, {});
2175
2230
  const circleAttribute = circle.getGraphicTheme();
2176
2231
  let { x = circleAttribute.x, y = circleAttribute.y } = circle.attribute;
2177
2232
  if (!circle.transMatrix.onlyTranslate()) {
@@ -2230,7 +2285,7 @@ let RoughCanvasPathRender = class RoughCanvasPathRender extends RoughBaseRender
2230
2285
  return;
2231
2286
  }
2232
2287
  const canvas = context.canvas.nativeCanvas;
2233
- const rc = U.canvas(canvas, {});
2288
+ const rc = at.canvas(canvas, {});
2234
2289
  context.highPerformanceSave();
2235
2290
  const pathAttribute = path.getGraphicTheme();
2236
2291
  context.transformFromMatrix(path.transMatrix, true);